agentenv-framework-protocol 0.1.610__tar.gz → 0.1.614__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.610 → agentenv_framework_protocol-0.1.614}/PKG-INFO +48 -2
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/README.md +47 -1
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/pyproject.toml +1 -1
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/_atif_copy.py +25 -14
- agentenv_framework_protocol-0.1.614/src/agentenv_protocol/a2a_agent/_secrets.py +265 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/_trajectory_log.py +10 -5
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/framework.py +25 -3
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/agent_env_environment.py +24 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/PROFILE.md +2 -0
- agentenv_framework_protocol-0.1.614/src/agentenv_protocol/computer/annotate.py +551 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/conformance/checks.py +143 -24
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/driver.py +23 -4
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/extensions.py +6 -4
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/manifest.py +2 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/recording.py +35 -9
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/runtime.py +28 -2
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/computer_fake.py +59 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/probe_fake.py +15 -1
- agentenv_framework_protocol-0.1.614/tests/test_a2a_atif_scrubbing.py +399 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_page.py +1 -58
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_recording.py +2 -1
- agentenv_framework_protocol-0.1.614/tests/test_computer_recording_annotate.py +496 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/.gitignore +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/LICENSE +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/NOTICE +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/THIRD_PARTY_NOTICES.md +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/advanced_agent.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/basic_agent.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/custom_extensions_agent.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/multimodal_agent.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/reference_model.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/streaming_agent.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/website/notes/.gitignore +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/website/notes/Dockerfile +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/website/notes/Dockerfile.dockerignore +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/website/notes/README.md +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/website/notes/data/seed.json +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/website/notes/env.toml +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/website/notes/site.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/website/notes/web/index.html +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/website/notes/web/package-lock.json +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/website/notes/web/package.json +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/website/notes/web/src/main.js +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/website/notes/web/src/style.css +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/examples/website/notes/web/vite.config.js +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/_snapshot_state.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/_triggers.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/_turn_index.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/clock.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/control_token.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/extensions.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/peer_agents.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/proxy.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/registry.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/staging.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/tasks/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/a2a_agent/tasks/v1.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/__main__.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/adapter.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/builder.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/fixtures/coding.json +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/fixtures/coding.stripped.json +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/fixtures/computer_use.json +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/fixtures/late_result.json +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/fixtures/media/482405b002a62efa8516c36709a7a100637507670576fa73a20ad5420d55c66f.png +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/fixtures/media/55c64d0fcd6f9d5f7c828093857e3fdfda68478bb4e9bd24d481ef391c7804e8.heic +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/fixtures/media/67905ad3cc2dd52b1f5f6a6d2814de0396618b29b4238b9af5207aeb69936e6d.mp4 +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/fixtures/media/69a8aa01fe5537076d023dd5e9cc4275b39fc0434aa6483a9f58b66ef2f3c896.png +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/fixtures/media/82e60066a2de261b6653bcdda90d1cb9a7af2f474cecd82e8d371e8384d72315.png +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/fixtures/media/845e91831319e89c4d656bdb80c278ac09a7230d61e5dfd2e1b1fbb436ac8917.pdf +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/fixtures/multi_agent.json +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/fixtures/odd_parts.json +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/fixtures/subagent.json +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/fixtures/two_turns.json +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/kit.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/models/LICENSE +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/models/VENDORED.md +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/models/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/models/agent.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/models/content.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/models/final_metrics.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/models/metrics.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/models/observation.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/models/observation_result.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/models/step.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/models/subagent_trajectory_ref.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/models/tool_call.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/models/trajectory.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/profile.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/reader.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/runner.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/served.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/atif/validator.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/client.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/_declare.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/_desktop.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/_job.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/_linux.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/_load.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/_macos.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/_reaping.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/_session_posix.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/_session_windows.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/_windows.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/_with_fds.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/_x11.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/app.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/app_data.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/app_runtime.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/apps.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/card.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/checks.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/clock.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/conformance/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/conformance/__main__.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/conformance/client.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/conformance/desk.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/conformance/fixture.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/conformance/mp4.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/conformance/page_fixture.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/conformance/report.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/conformance/wayland_fixture.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/dataplane.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/errors.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/frames.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/keys.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/launch.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/operations.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/platform.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/prefix.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/queue.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/results.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/run_install_step.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/seed.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/serve.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/serve_app.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/served.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/session.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/settings.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/skill.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/spaces.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/svc.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/computer/tools.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/errors.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/manifest.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/passthrough.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/preflight.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/tool_access.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/tool_client.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/tool_context.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/transfers.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/types.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website/clock.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website/conformance.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website/environment.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website/errors.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website/forwarding.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website/readiness.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website/routes.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website/session.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website_browser/__init__.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website_browser/cdp.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website_browser/contexts.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website_browser/control.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website_browser/data.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website_browser/devtools.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website_browser/environment.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website_browser/log.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website_browser/network.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website_browser/recording.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website_browser/scope.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website_browser/shapes.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/src/agentenv_protocol/website_browser/stream.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/atif_cases.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/conftest.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_a2a_agent.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_a2a_agent_clock.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_a2a_agent_examples.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_a2a_atif_serving.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_a2a_atif_turns.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_a2a_cdp_config.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_a2a_object_transfers.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_a2a_peer_agents.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_a2a_proxy.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_a2a_staging.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_a2a_trajectory_log.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_agent_env_environment.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_atif_builder.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_atif_fixtures.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_atif_kit.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_atif_profile.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_atif_reader.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_atif_validator.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_atif_vendored.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_browser_cdp.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_browser_contexts.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_browser_data.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_browser_log.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_browser_network.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_browser_recording.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_browser_state.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_client.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_app_data.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_app_server.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_clock.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_conformance.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_conformance_attempts.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_conformance_checks.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_conformance_page.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_conformance_recording.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_dataplane.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_declare.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_driver.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_driver_keys.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_extensions.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_frames.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_macos.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_queue.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_seed.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_serve.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_served.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_session_windows.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_spaces.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_svc_forward.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_tool_prefix.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_computer_windows_driver.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_control_token.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_data_objects.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_devtools_pipe.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_errors.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_extension_methods.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_intake.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_manifest.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_preflight.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_tool_access.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_tool_annotations.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_tool_client.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_tool_context.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_tool_context_fastmcp.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_tool_context_injection.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_usage.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_website_api.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_website_browser.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_website_conformance.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_website_environment.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_website_forwarding.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_website_live.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_website_mcp.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/tests/test_website_notes_example.py +0 -0
- {agentenv_framework_protocol-0.1.610 → agentenv_framework_protocol-0.1.614}/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.614
|
|
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`,
|
|
@@ -1737,6 +1753,36 @@ extension names the state the SDK keeps (`"state": ["turns"]` in its params,
|
|
|
1737
1753
|
`SNAPSHOT_STATE_PARAM`), and agent-env grants the object only to an agent whose
|
|
1738
1754
|
card has it, since an SDK from before it refuses the object.
|
|
1739
1755
|
|
|
1756
|
+
Every `atif/1` read leaves out the secrets the SDK knows, each written
|
|
1757
|
+
`[redacted:<length>]` wherever it occurs: in the document, the aux log and the
|
|
1758
|
+
turn context, inline, uploaded and in cursor pages, whose byte budget counts
|
|
1759
|
+
what they serve. The SDK knows:
|
|
1760
|
+
|
|
1761
|
+
- its control token, and the model credentials in its environment:
|
|
1762
|
+
`LITELLM_API_KEY` and the values of `LITELLM_EXTRA_HEADERS`;
|
|
1763
|
+
- write-only agent-config values: a string whole, and in a mapping what a
|
|
1764
|
+
credential-like key names (`Authorization`, `api_key`, `token`, `password`,
|
|
1765
|
+
...), so a mapping of sampling parameters keeps its ordinary words;
|
|
1766
|
+
- an MCP registration's header values and credential-like query values, and a
|
|
1767
|
+
CDP endpoint's header values and the token in its URLs;
|
|
1768
|
+
- every transfer grant an extension call hands the agent: the parts of its URL
|
|
1769
|
+
that carry the credential (a presigned URL's credential-like query values,
|
|
1770
|
+
`X-Amz-Signature` but not `X-Amz-Algorithm`, decoded and as the URL writes
|
|
1771
|
+
them; else a token-like path segment; a password), its headers other than `Content-Type` and the
|
|
1772
|
+
like, and a signed upload form's signing fields. Every copy of the URL holds
|
|
1773
|
+
those parts, so a URL an agent prints keeps its host and path and loses its
|
|
1774
|
+
signature;
|
|
1775
|
+
- a clock follower's read token;
|
|
1776
|
+
- whatever the agent registers with `self.register_secret(value)`, once its app
|
|
1777
|
+
exists (in `run`, say).
|
|
1778
|
+
|
|
1779
|
+
They're taken from each extension call before any handler runs, the agent's own
|
|
1780
|
+
included. A value under 8 characters isn't scrubbed, with a warning naming where
|
|
1781
|
+
it came from. Each is matched raw, JSON-escaped and percent-encoded, the longest
|
|
1782
|
+
first, and a read scrubs as it serves, so a secret learned after a step was
|
|
1783
|
+
written is left out too. Native reads keep every secret byte for byte, so a
|
|
1784
|
+
replay of the served inputs holds what the served copy redacts.
|
|
1785
|
+
|
|
1740
1786
|
`enable(..., description="...")` is reserved for declarations carrying
|
|
1741
1787
|
configuration or metadata. It preserves the agent-specific extension prose
|
|
1742
1788
|
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`,
|
|
@@ -1666,6 +1682,36 @@ extension names the state the SDK keeps (`"state": ["turns"]` in its params,
|
|
|
1666
1682
|
`SNAPSHOT_STATE_PARAM`), and agent-env grants the object only to an agent whose
|
|
1667
1683
|
card has it, since an SDK from before it refuses the object.
|
|
1668
1684
|
|
|
1685
|
+
Every `atif/1` read leaves out the secrets the SDK knows, each written
|
|
1686
|
+
`[redacted:<length>]` wherever it occurs: in the document, the aux log and the
|
|
1687
|
+
turn context, inline, uploaded and in cursor pages, whose byte budget counts
|
|
1688
|
+
what they serve. The SDK knows:
|
|
1689
|
+
|
|
1690
|
+
- its control token, and the model credentials in its environment:
|
|
1691
|
+
`LITELLM_API_KEY` and the values of `LITELLM_EXTRA_HEADERS`;
|
|
1692
|
+
- write-only agent-config values: a string whole, and in a mapping what a
|
|
1693
|
+
credential-like key names (`Authorization`, `api_key`, `token`, `password`,
|
|
1694
|
+
...), so a mapping of sampling parameters keeps its ordinary words;
|
|
1695
|
+
- an MCP registration's header values and credential-like query values, and a
|
|
1696
|
+
CDP endpoint's header values and the token in its URLs;
|
|
1697
|
+
- every transfer grant an extension call hands the agent: the parts of its URL
|
|
1698
|
+
that carry the credential (a presigned URL's credential-like query values,
|
|
1699
|
+
`X-Amz-Signature` but not `X-Amz-Algorithm`, decoded and as the URL writes
|
|
1700
|
+
them; else a token-like path segment; a password), its headers other than `Content-Type` and the
|
|
1701
|
+
like, and a signed upload form's signing fields. Every copy of the URL holds
|
|
1702
|
+
those parts, so a URL an agent prints keeps its host and path and loses its
|
|
1703
|
+
signature;
|
|
1704
|
+
- a clock follower's read token;
|
|
1705
|
+
- whatever the agent registers with `self.register_secret(value)`, once its app
|
|
1706
|
+
exists (in `run`, say).
|
|
1707
|
+
|
|
1708
|
+
They're taken from each extension call before any handler runs, the agent's own
|
|
1709
|
+
included. A value under 8 characters isn't scrubbed, with a warning naming where
|
|
1710
|
+
it came from. Each is matched raw, JSON-escaped and percent-encoded, the longest
|
|
1711
|
+
first, and a read scrubs as it serves, so a secret learned after a step was
|
|
1712
|
+
written is left out too. Native reads keep every secret byte for byte, so a
|
|
1713
|
+
replay of the served inputs holds what the served copy redacts.
|
|
1714
|
+
|
|
1669
1715
|
`enable(..., description="...")` is reserved for declarations carrying
|
|
1670
1716
|
configuration or metadata. It preserves the agent-specific extension prose
|
|
1671
1717
|
published in the Agent Card. The versioned SDK definition provides a generic
|
|
@@ -13,7 +13,7 @@ import uuid
|
|
|
13
13
|
from contextlib import contextmanager
|
|
14
14
|
from dataclasses import dataclass, field
|
|
15
15
|
from datetime import datetime, timezone
|
|
16
|
-
from typing import Any, Iterable, Iterator, Sequence
|
|
16
|
+
from typing import Any, Callable, Iterable, Iterator, Sequence
|
|
17
17
|
from urllib.parse import urlsplit, urlunsplit
|
|
18
18
|
|
|
19
19
|
from ..atif import FORMAT, Adapter, AdapterRun, AuxEntry, Media, ServedTurn, TurnContext
|
|
@@ -64,12 +64,15 @@ class AtifPage:
|
|
|
64
64
|
|
|
65
65
|
|
|
66
66
|
class AtifCopy:
|
|
67
|
-
"""One A2A context's atif/1 document. Safe to feed from the agent's thread while the loop reads it.
|
|
67
|
+
"""One A2A context's atif/1 document. Safe to feed from the agent's thread while the loop reads it. Everything it
|
|
68
|
+
serves goes through ``scrub``, the agent's secrets redacted."""
|
|
68
69
|
|
|
69
|
-
def __init__(self, adapter: type[Adapter], context_id: str
|
|
70
|
+
def __init__(self, adapter: type[Adapter], context_id: str, *,
|
|
71
|
+
scrub: Callable[[Any], Any] = lambda served: served) -> None:
|
|
70
72
|
self._run = AdapterRun(adapter, trajectory_id=uuid.uuid4().hex)
|
|
71
73
|
self._adapter = adapter.__name__
|
|
72
74
|
self._context_id = context_id
|
|
75
|
+
self._scrub = scrub
|
|
73
76
|
self._lock = threading.Lock()
|
|
74
77
|
self._tasks: dict[str, _Task] = {}
|
|
75
78
|
self._failed: str | None = None
|
|
@@ -126,8 +129,9 @@ class AtifCopy:
|
|
|
126
129
|
task.turn = ServedTurn.of(task.context, **ending)
|
|
127
130
|
task.ended = True
|
|
128
131
|
|
|
129
|
-
def task_read(self, task_id: str) -> tuple[dict[str, Any], list[
|
|
130
|
-
"""An ended task's document as it stood when the task ended, its aux log and its served turn context
|
|
132
|
+
def task_read(self, task_id: str) -> tuple[dict[str, Any], list[dict[str, Any]], dict[str, Any]] | None:
|
|
133
|
+
"""An ended task's document as it stood when the task ended, its aux log and its served turn context, as served:
|
|
134
|
+
on the wire and scrubbed."""
|
|
131
135
|
with self._lock:
|
|
132
136
|
self._check()
|
|
133
137
|
task = self._tasks.get(task_id)
|
|
@@ -135,19 +139,22 @@ class AtifCopy:
|
|
|
135
139
|
return None
|
|
136
140
|
document = self._run.document(through=task.place)
|
|
137
141
|
assert document is not None
|
|
138
|
-
return document,
|
|
142
|
+
return (self._scrub(document), self._scrub([entry.wire() for entry in task.aux]),
|
|
143
|
+
self._scrub(task.turn.wire()))
|
|
139
144
|
|
|
140
145
|
def context_read(self) -> dict[str, Any] | None:
|
|
141
146
|
"""The context's live page: every closed step a reader may be served, or None before the first."""
|
|
142
147
|
with self._lock:
|
|
143
148
|
self._check()
|
|
144
|
-
|
|
149
|
+
page = self._run.page()
|
|
150
|
+
return None if page is None else self._scrub(page)
|
|
145
151
|
|
|
146
152
|
def page(self, after: int, max_steps: int, max_bytes: int, *, task_id: str | None = None) -> AtifPage:
|
|
147
153
|
"""The closed steps after step ``after``, of the whole context or of task ``task_id``, within both budgets; the
|
|
148
154
|
first is always returned, so one larger than ``max_bytes`` can't stall a reader. With them, the sub-agents of
|
|
149
155
|
every task they belong to, as far as each is served: a sub-agent can gain steps while its task runs, and the
|
|
150
|
-
page that serves a task's last step, which closes only as the task ends, carries them whole.
|
|
156
|
+
page that serves a task's last step, which closes only as the task ends, carries them whole. The byte budget
|
|
157
|
+
counts what it serves, scrubbed."""
|
|
151
158
|
with self._lock:
|
|
152
159
|
self._check()
|
|
153
160
|
document = self._run.page()
|
|
@@ -162,21 +169,25 @@ class AtifCopy:
|
|
|
162
169
|
served: list[dict[str, Any]] = []
|
|
163
170
|
tasks: set[str | None] = set()
|
|
164
171
|
used = 0
|
|
172
|
+
last = after
|
|
165
173
|
for step, owner in pending[:max_steps]:
|
|
166
|
-
|
|
174
|
+
scrubbed = self._scrub(step)
|
|
175
|
+
size = len(json.dumps(scrubbed))
|
|
167
176
|
if served and used + size > max_bytes:
|
|
168
177
|
break
|
|
169
|
-
served.append(
|
|
178
|
+
served.append(scrubbed)
|
|
170
179
|
tasks.add(owner)
|
|
171
180
|
used += size
|
|
181
|
+
last = step["step_id"]
|
|
172
182
|
header = None
|
|
173
183
|
subagents: list[dict[str, Any]] = []
|
|
174
184
|
if document is not None:
|
|
175
|
-
header = {key: value for key, value in document.items()
|
|
176
|
-
|
|
177
|
-
|
|
185
|
+
header = self._scrub({key: value for key, value in document.items()
|
|
186
|
+
if key not in ("steps", "subagent_trajectories")})
|
|
187
|
+
subagents = self._scrub([sub for sub in document.get("subagent_trajectories", [])
|
|
188
|
+
if sub_tasks.get(sub["trajectory_id"]) in tasks])
|
|
178
189
|
return AtifPage(header=header, subagents=subagents, steps=served,
|
|
179
|
-
next=
|
|
190
|
+
next=last, has_more=len(served) < len(pending))
|
|
180
191
|
|
|
181
192
|
def _open(self, task_id: str) -> _Task | None:
|
|
182
193
|
if self._failed is not None:
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
"""The secrets an agent's atif/1 reads leave out: every value the SDK holds or is handed (its control token, write-only
|
|
2
|
+
agent-config values, MCP and CDP registrations' credentials, the grants and tokens in extension calls, the model
|
|
3
|
+
credentials in its environment) and every one the agent registers. Each read scrubs every string it serves, so a
|
|
4
|
+
secret learned after a step was written is still left out; native reads are never scrubbed."""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import json
|
|
9
|
+
import logging
|
|
10
|
+
import os
|
|
11
|
+
import re
|
|
12
|
+
import threading
|
|
13
|
+
from collections.abc import Iterable, Iterator, Mapping
|
|
14
|
+
from typing import Any, TypeVar
|
|
15
|
+
from urllib.parse import quote, unquote_plus, urlsplit
|
|
16
|
+
|
|
17
|
+
from pydantic import BaseModel, SecretStr
|
|
18
|
+
|
|
19
|
+
from ..transfers import HttpGetGrant, HttpPostPolicyGrant, HttpPutGrant
|
|
20
|
+
from .extensions import CdpAddRequest, ClockSyncTimeRequest, McpAddRequest
|
|
21
|
+
from .tasks.v1 import AgentConfig
|
|
22
|
+
|
|
23
|
+
logger = logging.getLogger(__name__)
|
|
24
|
+
|
|
25
|
+
#: A shorter value isn't scrubbed: replacing it everywhere it occurs would mangle ordinary text.
|
|
26
|
+
MIN_SECRET_LENGTH = 8
|
|
27
|
+
#: The model credentials an agent's environment holds, which a tool can echo.
|
|
28
|
+
MODEL_KEY_ENV = "LITELLM_API_KEY"
|
|
29
|
+
MODEL_HEADERS_ENV = "LITELLM_EXTRA_HEADERS"
|
|
30
|
+
# Two rules tell a credential by its name. A header is one unless it plainly describes the request, since a header an
|
|
31
|
+
# agent is handed is there to authorize it. A query parameter, a signed form's field or a write-only mapping's key is
|
|
32
|
+
# one only when named like one, since most of them aren't: X-Amz-Algorithm, a key path, a sampling parameter.
|
|
33
|
+
_PLAIN_HEADERS = frozenset({"accept", "content-encoding", "content-length", "content-type", "user-agent"})
|
|
34
|
+
#: The words of such a name that mark its value as a credential, and the endings that do: ``X-Amz-Signature`` and Azure's ``sig`` are, ``X-Amz-Algorithm``, ``X-Amz-Date``
|
|
35
|
+
#: and ``X-Amz-SignedHeaders`` aren't, so ``AWS4-HMAC-SHA256`` is left in an agent's text.
|
|
36
|
+
_CREDENTIAL_WORDS = frozenset({
|
|
37
|
+
"auth", "authorization", "bearer", "cookie", "credential", "credentials", "jwt", "key", "passwd", "password",
|
|
38
|
+
"policy", "pwd", "secret", "sig", "signature", "token", "accessid", "googleaccessid", "awsaccesskeyid",
|
|
39
|
+
})
|
|
40
|
+
_CREDENTIAL_ENDINGS = ("key", "token", "secret", "password", "signature", "credential")
|
|
41
|
+
_NAME_WORD = re.compile(r"[a-z0-9]+")
|
|
42
|
+
#: How long a path segment of a URL with no query must be to be taken as its credential, as a grant server's signed
|
|
43
|
+
#: token is: longer than an ordinary path's words, unlike ``MIN_SECRET_LENGTH``, which bounds what is scrubbed at all.
|
|
44
|
+
MIN_TOKEN_SEGMENT_LENGTH = 16
|
|
45
|
+
_TOKEN_SEGMENT = re.compile(rf"[A-Za-z0-9_.=~+-]{{{MIN_TOKEN_SEGMENT_LENGTH},}}")
|
|
46
|
+
|
|
47
|
+
T = TypeVar("T")
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class Secrets:
|
|
51
|
+
"""The values an agent's atif/1 reads leave out, each written ``[redacted:<length>]`` wherever it occurs, in its raw,
|
|
52
|
+
JSON-escaped (ASCII or not) and percent-encoded forms. Safe to add to from the agent's threads while the loop
|
|
53
|
+
scrubs. The match is compiled as a prefix trie, once per change and when a read needs it, so a call that hands the
|
|
54
|
+
agent a grant per file, or a run that accumulates thousands, costs neither a rebuild per secret nor a slower
|
|
55
|
+
scan."""
|
|
56
|
+
|
|
57
|
+
def __init__(self, *, write_only: Mapping[str, str] | None = None) -> None:
|
|
58
|
+
#: The agent's write-only config fields, each to its wire name, whose values an agent-config call hands it.
|
|
59
|
+
self._write_only = dict(write_only or {})
|
|
60
|
+
self._lock = threading.Lock()
|
|
61
|
+
self._forms: set[str] = set()
|
|
62
|
+
self._pattern: re.Pattern[str] | None = None
|
|
63
|
+
self._stale = False
|
|
64
|
+
self._short: set[str] = set()
|
|
65
|
+
|
|
66
|
+
def add(self, value: str | SecretStr | None, *, source: str, warn: bool = True) -> None:
|
|
67
|
+
"""Leave ``value`` out of every atif/1 read from now on; ``source`` names it in the warning a value too short to
|
|
68
|
+
scrub gets, never the value, unless ``warn`` is off, as for the parts of a URL."""
|
|
69
|
+
text = value.get_secret_value() if isinstance(value, SecretStr) else value
|
|
70
|
+
if not isinstance(text, str) or not text:
|
|
71
|
+
return
|
|
72
|
+
if len(text) < MIN_SECRET_LENGTH:
|
|
73
|
+
if warn and source not in self._short:
|
|
74
|
+
self._short.add(source)
|
|
75
|
+
logger.warning("a secret from %s is shorter than %d characters, so atif/1 reads don't scrub it",
|
|
76
|
+
source, MIN_SECRET_LENGTH)
|
|
77
|
+
return
|
|
78
|
+
forms = _forms(text)
|
|
79
|
+
with self._lock:
|
|
80
|
+
if not forms <= self._forms:
|
|
81
|
+
self._forms |= forms
|
|
82
|
+
self._stale = True
|
|
83
|
+
|
|
84
|
+
@classmethod
|
|
85
|
+
def for_agent(cls, *, write_only: Mapping[str, str], defaults: Mapping[str, Any],
|
|
86
|
+
environ: Mapping[str, str] | None = None) -> Secrets:
|
|
87
|
+
"""What an agent's SDK knows from the start: the model credentials in its environment, and its write-only
|
|
88
|
+
config's defaults (``defaults`` by wire name). Its control token comes when it's served, the rest with each
|
|
89
|
+
extension call (``add_request``) and from the agent (``add``)."""
|
|
90
|
+
secrets = cls(write_only=write_only)
|
|
91
|
+
secrets.add_environment(environ)
|
|
92
|
+
wire_names = set(write_only.values())
|
|
93
|
+
for name, value in defaults.items():
|
|
94
|
+
if name in wire_names:
|
|
95
|
+
secrets.add_values(value, source="a write-only agent-config default")
|
|
96
|
+
return secrets
|
|
97
|
+
|
|
98
|
+
def add_all(self, values: Iterable[str | SecretStr | None], *, source: str, warn: bool = True) -> None:
|
|
99
|
+
for value in values:
|
|
100
|
+
self.add(value, source=source, warn=warn)
|
|
101
|
+
|
|
102
|
+
def add_environment(self, environ: Mapping[str, str] | None = None) -> None:
|
|
103
|
+
"""The model credentials in the agent's environment: its key, and its extra headers' values."""
|
|
104
|
+
environ = os.environ if environ is None else environ
|
|
105
|
+
self.add(environ.get(MODEL_KEY_ENV), source=MODEL_KEY_ENV)
|
|
106
|
+
try:
|
|
107
|
+
headers = json.loads(environ.get(MODEL_HEADERS_ENV) or "{}")
|
|
108
|
+
except ValueError:
|
|
109
|
+
return
|
|
110
|
+
if isinstance(headers, dict):
|
|
111
|
+
self.add_all(_header_values(headers), source=MODEL_HEADERS_ENV)
|
|
112
|
+
|
|
113
|
+
def add_request(self, request: BaseModel | None) -> None:
|
|
114
|
+
"""Every secret an extension call hands the agent, whichever handler takes it: the parts of its grants' URLs
|
|
115
|
+
that carry their credentials, their headers and signing fields, an MCP or CDP registration's credentials, a clock
|
|
116
|
+
follower's read token, wherever the request holds them, and an agent-config call's write-only values."""
|
|
117
|
+
if isinstance(request, AgentConfig):
|
|
118
|
+
for name in request.model_fields_set & self._write_only.keys():
|
|
119
|
+
self.add_values(getattr(request, name), source="a write-only agent-config value")
|
|
120
|
+
for item in _models(request):
|
|
121
|
+
if isinstance(item, (HttpGetGrant, HttpPutGrant, HttpPostPolicyGrant)):
|
|
122
|
+
self.add_all(_url_secrets(str(item.url)), source="a transfer grant", warn=False)
|
|
123
|
+
self.add_all(_grant_secrets(item), source="a transfer grant")
|
|
124
|
+
elif isinstance(item, McpAddRequest):
|
|
125
|
+
self.add_all(_query_values(item.url), source="an MCP registration", warn=False)
|
|
126
|
+
self.add_all(_header_values(item.headers), source="an MCP registration's headers")
|
|
127
|
+
elif isinstance(item, CdpAddRequest):
|
|
128
|
+
self.add_all([*_url_secrets(item.http_url), *_url_secrets(item.ws_url)], source="a CDP registration",
|
|
129
|
+
warn=False)
|
|
130
|
+
self.add_all(_header_values(item.headers), source="a CDP registration's headers")
|
|
131
|
+
elif isinstance(item, ClockSyncTimeRequest):
|
|
132
|
+
self.add(item.read_token, source="a clock follower's read token")
|
|
133
|
+
|
|
134
|
+
def add_values(self, value: Any, *, source: str) -> None:
|
|
135
|
+
"""The credentials a write-only config value holds: a string or list of strings whole, and in a mapping or a model
|
|
136
|
+
only what a credential-like key names (and everything below it), so a write-only mapping of sampling parameters,
|
|
137
|
+
as pi's ``model_params`` is, doesn't have ``priority`` or a provider's name redacted wherever it occurs."""
|
|
138
|
+
self.add_all(_credentials(value, whole=not isinstance(value, (Mapping, BaseModel))), source=source)
|
|
139
|
+
|
|
140
|
+
def scrub(self, value: T) -> T:
|
|
141
|
+
"""``value`` with every secret redacted in its strings: its mappings' keys and values and its lists' items."""
|
|
142
|
+
pattern = self._match()
|
|
143
|
+
return value if pattern is None else _scrub(value, pattern)
|
|
144
|
+
|
|
145
|
+
def _match(self) -> re.Pattern[str] | None:
|
|
146
|
+
with self._lock:
|
|
147
|
+
if self._stale:
|
|
148
|
+
self._pattern = re.compile(_trie(self._forms))
|
|
149
|
+
self._stale = False
|
|
150
|
+
return self._pattern
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def _forms(text: str) -> set[str]:
|
|
154
|
+
"""How a secret can appear in a served string: raw, JSON-escaped with and without ASCII escapes (inbound DataParts
|
|
155
|
+
are written without), and percent-encoded, as in another URL's query."""
|
|
156
|
+
return {text, json.dumps(text)[1:-1], json.dumps(text, ensure_ascii=False)[1:-1], quote(text, safe="")}
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def _scrub(value: Any, pattern: re.Pattern[str]) -> Any:
|
|
160
|
+
if isinstance(value, str):
|
|
161
|
+
return pattern.sub(lambda match: f"[redacted:{len(match.group(0))}]", value)
|
|
162
|
+
if isinstance(value, dict):
|
|
163
|
+
return {_scrub(key, pattern): _scrub(item, pattern) for key, item in value.items()}
|
|
164
|
+
if isinstance(value, list):
|
|
165
|
+
return [_scrub(item, pattern) for item in value]
|
|
166
|
+
return value
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def _trie(forms: Iterable[str]) -> str:
|
|
170
|
+
"""One expression matching each of ``forms``, the longest at any position: a prefix trie, whose shared prefixes
|
|
171
|
+
are matched once, with each unbranching run written as one literal, so its nesting is its branching."""
|
|
172
|
+
root: dict[str, Any] = {}
|
|
173
|
+
for form in forms:
|
|
174
|
+
node = root
|
|
175
|
+
for char in form:
|
|
176
|
+
node = node.setdefault(char, {})
|
|
177
|
+
node[""] = {}
|
|
178
|
+
return _branch(root)
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def _branch(node: dict[str, Any]) -> str:
|
|
182
|
+
run: list[str] = []
|
|
183
|
+
while len(node) == 1 and "" not in node:
|
|
184
|
+
[(char, node)] = node.items()
|
|
185
|
+
run.append(re.escape(char))
|
|
186
|
+
children = sorted(char for char in node if char)
|
|
187
|
+
if not children:
|
|
188
|
+
return "".join(run)
|
|
189
|
+
group = "(?:" + "|".join(re.escape(char) + _branch(node[char]) for char in children) + ")"
|
|
190
|
+
# An end here as well: the longer match first, the end if it fails.
|
|
191
|
+
return "".join(run) + (f"{group}?" if "" in node else group)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def _models(value: Any) -> Iterator[BaseModel]:
|
|
195
|
+
"""``value`` and every model it holds, in fields, lists and mappings."""
|
|
196
|
+
if isinstance(value, BaseModel):
|
|
197
|
+
yield value
|
|
198
|
+
for name in type(value).model_fields:
|
|
199
|
+
yield from _models(getattr(value, name))
|
|
200
|
+
elif isinstance(value, (list, tuple)):
|
|
201
|
+
for item in value:
|
|
202
|
+
yield from _models(item)
|
|
203
|
+
elif isinstance(value, Mapping):
|
|
204
|
+
for item in value.values():
|
|
205
|
+
yield from _models(item)
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
def _credentials(value: Any, *, whole: bool) -> Iterator[str | SecretStr]:
|
|
209
|
+
"""The strings ``value`` holds that are credentials: all of them when ``whole`` (a write-only string field, or what a
|
|
210
|
+
credential-like key names), else those a credential-like key or field name marks, and everything below it."""
|
|
211
|
+
if isinstance(value, (str, SecretStr)):
|
|
212
|
+
if whole:
|
|
213
|
+
yield value
|
|
214
|
+
elif isinstance(value, (list, tuple, set)):
|
|
215
|
+
for item in value:
|
|
216
|
+
yield from _credentials(item, whole=whole)
|
|
217
|
+
elif isinstance(value, BaseModel):
|
|
218
|
+
for name in type(value).model_fields:
|
|
219
|
+
yield from _credentials(getattr(value, name), whole=whole or _names_credential(name))
|
|
220
|
+
elif isinstance(value, Mapping):
|
|
221
|
+
for key, item in value.items():
|
|
222
|
+
yield from _credentials(item, whole=whole or isinstance(key, str) and _names_credential(key))
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
def _names_credential(name: str) -> bool:
|
|
226
|
+
words = _NAME_WORD.findall(name.lower())
|
|
227
|
+
return any(word in _CREDENTIAL_WORDS or word.endswith(_CREDENTIAL_ENDINGS) for word in words)
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
def _grant_secrets(grant: HttpGetGrant | HttpPutGrant | HttpPostPolicyGrant) -> list[str]:
|
|
231
|
+
"""A grant's credential headers, and a signed upload form's signing fields."""
|
|
232
|
+
secrets = _header_values(grant.headers)
|
|
233
|
+
if isinstance(grant, HttpPostPolicyGrant):
|
|
234
|
+
secrets += [value for name, value in grant.fields.items()
|
|
235
|
+
if name != grant.path_field and _names_credential(name)]
|
|
236
|
+
return secrets
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
def _url_secrets(url: str) -> list[str]:
|
|
240
|
+
"""The parts of a URL that carry its credential: a presigned URL's credential-like query values, else its token-like
|
|
241
|
+
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
|
+
rest (its host, its path, ``X-Amz-Algorithm``) isn't secret, and leaving it keeps each grant's share of the match
|
|
244
|
+
to its signature: the session token and access key a role signs every grant with are each one secret."""
|
|
245
|
+
parts = urlsplit(url)
|
|
246
|
+
carried = _query_values(url)
|
|
247
|
+
if not carried:
|
|
248
|
+
carried = [segment for segment in parts.path.split("/") if _TOKEN_SEGMENT.fullmatch(segment)]
|
|
249
|
+
return [*carried, *([parts.password] if parts.password else [])]
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
def _query_values(url: str) -> list[str]:
|
|
253
|
+
"""The values of a URL's credential-like query parameters (a signature, a credential, a token, a key), decoded and
|
|
254
|
+
as the URL writes them, whose own percent-encoding is what a copy of the URL inside another URL's query holds."""
|
|
255
|
+
values: list[str] = []
|
|
256
|
+
for pair in urlsplit(url).query.split("&"):
|
|
257
|
+
name, _, written = pair.partition("=")
|
|
258
|
+
if written and _names_credential(unquote_plus(name)):
|
|
259
|
+
values += [unquote_plus(written), written]
|
|
260
|
+
return values
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
def _header_values(headers: Mapping[str, Any] | None) -> list[str]:
|
|
264
|
+
return [value for name, value in (headers or {}).items()
|
|
265
|
+
if isinstance(value, str) and name.lower() not in _PLAIN_HEADERS]
|
|
@@ -6,9 +6,9 @@ import json
|
|
|
6
6
|
import logging
|
|
7
7
|
from collections import OrderedDict
|
|
8
8
|
from dataclasses import dataclass
|
|
9
|
-
from typing import Any, Sequence
|
|
9
|
+
from typing import Any, Callable, Sequence
|
|
10
10
|
|
|
11
|
-
from ..atif import Adapter
|
|
11
|
+
from ..atif import Adapter
|
|
12
12
|
from ._atif_copy import AtifCopy, AtifPage, TurnStart
|
|
13
13
|
from ._turn_index import TurnIndex
|
|
14
14
|
from .extensions import TrajectoryState
|
|
@@ -60,8 +60,8 @@ class AtifTaskRead:
|
|
|
60
60
|
"""An ended task's atif/1 document as it stood when the task ended, its aux log and its served turn context."""
|
|
61
61
|
|
|
62
62
|
document: dict[str, Any]
|
|
63
|
-
aux: list[
|
|
64
|
-
turn:
|
|
63
|
+
aux: list[dict[str, Any]]
|
|
64
|
+
turn: dict[str, Any]
|
|
65
65
|
|
|
66
66
|
|
|
67
67
|
@dataclass(frozen=True, slots=True)
|
|
@@ -87,6 +87,7 @@ class TaskTrajectories:
|
|
|
87
87
|
*,
|
|
88
88
|
native: str | None = None,
|
|
89
89
|
atif: type[Adapter] | None = None,
|
|
90
|
+
scrub: Callable[[Any], Any] | None = None,
|
|
90
91
|
) -> None:
|
|
91
92
|
if max_contexts < 1:
|
|
92
93
|
raise ValueError("max_contexts must be positive")
|
|
@@ -95,6 +96,8 @@ class TaskTrajectories:
|
|
|
95
96
|
self._atif = atif
|
|
96
97
|
#: Each context's count of started tasks, kept only for an agent that serves atif/1.
|
|
97
98
|
self._turns = TurnIndex() if atif is not None else None
|
|
99
|
+
#: What every atif/1 read goes through: the agent's secrets redacted.
|
|
100
|
+
self._scrub = scrub
|
|
98
101
|
self._tasks: dict[str, _TaskRecord] = {}
|
|
99
102
|
self._contexts: OrderedDict[str, list[str]] = OrderedDict()
|
|
100
103
|
self._copies: dict[str, AtifCopy] = {}
|
|
@@ -129,7 +132,9 @@ class TaskTrajectories:
|
|
|
129
132
|
if self._atif is not None and turn is not None:
|
|
130
133
|
copy = self._copies.get(record.context_id)
|
|
131
134
|
if copy is None:
|
|
132
|
-
copy = self._copies[record.context_id] = AtifCopy(
|
|
135
|
+
copy = self._copies[record.context_id] = AtifCopy(
|
|
136
|
+
self._atif, record.context_id, **({"scrub": self._scrub} if self._scrub is not None else {})
|
|
137
|
+
)
|
|
133
138
|
copy.start(task_id, self._turns.next(record.context_id), turn)
|
|
134
139
|
record.log._atif = _CopySink(copy, task_id)
|
|
135
140
|
self._touch(record.context_id)
|
|
@@ -34,6 +34,7 @@ from ..atif import PROFILE_KEY as ATIF_PROFILE_KEY
|
|
|
34
34
|
from ..atif import PROFILE_VERSION as ATIF_PROFILE_VERSION
|
|
35
35
|
from ..atif import SCHEMA_VERSION as ATIF_SCHEMA_VERSION
|
|
36
36
|
from ._atif_copy import TurnStart
|
|
37
|
+
from ._secrets import Secrets
|
|
37
38
|
from ._snapshot_state import SnapshotStates
|
|
38
39
|
from ._trajectory_log import MAX_TRAJECTORY_READ_BYTES, TaskTrajectories
|
|
39
40
|
from ._triggers import TriggerEngine, TriggerError
|
|
@@ -259,6 +260,15 @@ class AgentEnvAgent:
|
|
|
259
260
|
raise RuntimeError("session references are available after create_app()")
|
|
260
261
|
return application.services.session_ref_for_context(context_id)
|
|
261
262
|
|
|
263
|
+
def register_secret(self, value: str) -> None:
|
|
264
|
+
"""Leave ``value`` out of this agent's atif/1 reads from now on, wherever it occurs, as the SDK does with the
|
|
265
|
+
secrets it holds and is handed; one under 8 characters isn't, with a warning. Native reads keep it."""
|
|
266
|
+
application = getattr(self, "_agentenv_a2a_application", None)
|
|
267
|
+
if application is None:
|
|
268
|
+
raise RuntimeError("secrets are registered after create_app()")
|
|
269
|
+
if application.services.secrets is not None:
|
|
270
|
+
application.services.secrets.add(value, source="the agent")
|
|
271
|
+
|
|
262
272
|
def set_session_ref_for_context(self, context_id: str, session_ref: str) -> None:
|
|
263
273
|
"""Associate a native session reference with an A2A context."""
|
|
264
274
|
if not context_id:
|
|
@@ -578,7 +588,15 @@ class _SdkServices:
|
|
|
578
588
|
self.trajectory_formats: tuple[str, ...] = (
|
|
579
589
|
(native, ATIF_FORMAT) if atif is not None else (native,) if native else ()
|
|
580
590
|
)
|
|
581
|
-
|
|
591
|
+
#: The secrets the agent's atif/1 reads leave out; an agent that serves none has none to scrub.
|
|
592
|
+
self.secrets = Secrets.for_agent(
|
|
593
|
+
write_only={field: wire for field, wire in _config_wire_names(self.config_model).items()
|
|
594
|
+
if wire in self._write_only_config_fields},
|
|
595
|
+
defaults=self.config_defaults,
|
|
596
|
+
) if atif is not None else None
|
|
597
|
+
self.task_trajectories = TaskTrajectories(
|
|
598
|
+
native=native, atif=atif, scrub=self.secrets.scrub if self.secrets is not None else None
|
|
599
|
+
)
|
|
582
600
|
#: Whether the card offers atif/1, served from the copy an adapter builds.
|
|
583
601
|
self.serves_atif = atif is not None
|
|
584
602
|
#: The SDK's state in the agent's snapshots, which only an agent that serves atif/1 keeps.
|
|
@@ -911,7 +929,7 @@ class _SdkServices:
|
|
|
911
929
|
) -> dict[str, Any]:
|
|
912
930
|
"""A whole atif/1 document: a task read's as it stood when the task ended, with the
|
|
913
931
|
task's aux log and turn context, or a context read's live page; inline, or uploaded
|
|
914
|
-
through the request's grants."""
|
|
932
|
+
through the request's grants, as the copy serves it, its secrets scrubbed."""
|
|
915
933
|
served: dict[str, Any] = {}
|
|
916
934
|
if isinstance(request, (TaskTrajectoryRequest, TaskObjectTrajectoryRequest)):
|
|
917
935
|
read = self.task_trajectories.atif_task(request.task_id)
|
|
@@ -921,7 +939,7 @@ class _SdkServices:
|
|
|
921
939
|
detail=f"No completed trajectory available for task '{request.task_id}'",
|
|
922
940
|
)
|
|
923
941
|
document = read.document
|
|
924
|
-
served = {"aux":
|
|
942
|
+
served = {"aux": read.aux, "turn_context": read.turn}
|
|
925
943
|
else:
|
|
926
944
|
if isinstance(request, ContextObjectTrajectoryRequest):
|
|
927
945
|
_refuse_turn_objects(request)
|
|
@@ -1116,6 +1134,8 @@ def _taking_the_control_token(
|
|
|
1116
1134
|
async def lifespan(app: Starlette) -> AsyncIterator[Any]:
|
|
1117
1135
|
application.control_token = take_control_token() or application.control_token
|
|
1118
1136
|
log_guard(application.control_token)
|
|
1137
|
+
if application.services.secrets is not None:
|
|
1138
|
+
application.services.secrets.add(application.control_token, source="the control token")
|
|
1119
1139
|
if inner is None:
|
|
1120
1140
|
yield None
|
|
1121
1141
|
else:
|
|
@@ -1332,6 +1352,8 @@ class A2AAgentApplication:
|
|
|
1332
1352
|
extension_request = None
|
|
1333
1353
|
else:
|
|
1334
1354
|
extension_request = request_model.model_validate(payload)
|
|
1355
|
+
if self.services.secrets is not None:
|
|
1356
|
+
self.services.secrets.add_request(extension_request)
|
|
1335
1357
|
if extension_uri == TRAJECTORY_V1.uri:
|
|
1336
1358
|
self.services.check_trajectory_format(extension_request.format)
|
|
1337
1359
|
if extension_request.format == ATIF_FORMAT:
|