agentenv-framework-protocol 0.1.639__tar.gz → 0.1.640__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/PKG-INFO +10 -1
  2. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/README.md +9 -0
  3. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/pyproject.toml +1 -1
  4. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/__init__.py +2 -0
  5. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/tasks/__init__.py +2 -0
  6. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/tasks/v1.py +71 -21
  7. agentenv_framework_protocol-0.1.640/tests/test_usage_models.py +71 -0
  8. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/.gitignore +0 -0
  9. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/LICENSE +0 -0
  10. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/NOTICE +0 -0
  11. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/THIRD_PARTY_NOTICES.md +0 -0
  12. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/__init__.py +0 -0
  13. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/advanced_agent.py +0 -0
  14. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/basic_agent.py +0 -0
  15. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/custom_extensions_agent.py +0 -0
  16. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/multimodal_agent.py +0 -0
  17. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/reference_model.py +0 -0
  18. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/streaming_agent.py +0 -0
  19. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/website/notes/.gitignore +0 -0
  20. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/website/notes/Dockerfile +0 -0
  21. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/website/notes/Dockerfile.dockerignore +0 -0
  22. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/website/notes/README.md +0 -0
  23. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/website/notes/data/seed.json +0 -0
  24. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/website/notes/env.toml +0 -0
  25. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/website/notes/site.py +0 -0
  26. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/website/notes/web/index.html +0 -0
  27. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/website/notes/web/package-lock.json +0 -0
  28. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/website/notes/web/package.json +0 -0
  29. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/website/notes/web/src/main.js +0 -0
  30. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/website/notes/web/src/style.css +0 -0
  31. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/examples/website/notes/web/vite.config.js +0 -0
  32. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/__init__.py +0 -0
  33. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/_atif_copy.py +0 -0
  34. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/_media_spool.py +0 -0
  35. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/_secrets.py +0 -0
  36. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/_snapshot_state.py +0 -0
  37. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/_trajectory_log.py +0 -0
  38. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/_triggers.py +0 -0
  39. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/_turn_index.py +0 -0
  40. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/clock.py +0 -0
  41. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/control_token.py +0 -0
  42. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/extensions.py +0 -0
  43. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/framework.py +0 -0
  44. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/peer_agents.py +0 -0
  45. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/proxy.py +0 -0
  46. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/registry.py +0 -0
  47. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/a2a_agent/staging.py +0 -0
  48. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/agent_env_environment.py +0 -0
  49. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/PROFILE.md +0 -0
  50. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/__init__.py +0 -0
  51. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/__main__.py +0 -0
  52. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/_image_size.py +0 -0
  53. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/adapter.py +0 -0
  54. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/builder.py +0 -0
  55. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/fixtures/coding.json +0 -0
  56. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/fixtures/coding.stripped.json +0 -0
  57. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/fixtures/computer_use.json +0 -0
  58. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/fixtures/late_result.json +0 -0
  59. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/fixtures/media/482405b002a62efa8516c36709a7a100637507670576fa73a20ad5420d55c66f.png +0 -0
  60. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/fixtures/media/55c64d0fcd6f9d5f7c828093857e3fdfda68478bb4e9bd24d481ef391c7804e8.heic +0 -0
  61. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/fixtures/media/67905ad3cc2dd52b1f5f6a6d2814de0396618b29b4238b9af5207aeb69936e6d.mp4 +0 -0
  62. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/fixtures/media/69a8aa01fe5537076d023dd5e9cc4275b39fc0434aa6483a9f58b66ef2f3c896.png +0 -0
  63. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/fixtures/media/82e60066a2de261b6653bcdda90d1cb9a7af2f474cecd82e8d371e8384d72315.png +0 -0
  64. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/fixtures/media/845e91831319e89c4d656bdb80c278ac09a7230d61e5dfd2e1b1fbb436ac8917.pdf +0 -0
  65. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/fixtures/multi_agent.json +0 -0
  66. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/fixtures/odd_parts.json +0 -0
  67. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/fixtures/subagent.json +0 -0
  68. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/fixtures/two_turns.json +0 -0
  69. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/kit.py +0 -0
  70. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/models/LICENSE +0 -0
  71. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/models/VENDORED.md +0 -0
  72. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/models/__init__.py +0 -0
  73. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/models/agent.py +0 -0
  74. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/models/content.py +0 -0
  75. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/models/final_metrics.py +0 -0
  76. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/models/metrics.py +0 -0
  77. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/models/observation.py +0 -0
  78. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/models/observation_result.py +0 -0
  79. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/models/step.py +0 -0
  80. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/models/subagent_trajectory_ref.py +0 -0
  81. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/models/tool_call.py +0 -0
  82. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/models/trajectory.py +0 -0
  83. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/profile.py +0 -0
  84. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/reader.py +0 -0
  85. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/runner.py +0 -0
  86. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/served.py +0 -0
  87. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/atif/validator.py +0 -0
  88. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/client.py +0 -0
  89. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/__init__.py +0 -0
  90. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/_declare.py +0 -0
  91. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/_desktop.py +0 -0
  92. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/_job.py +0 -0
  93. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/_linux.py +0 -0
  94. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/_load.py +0 -0
  95. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/_macos.py +0 -0
  96. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/_reaping.py +0 -0
  97. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/_session_posix.py +0 -0
  98. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/_session_windows.py +0 -0
  99. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/_windows.py +0 -0
  100. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/_with_fds.py +0 -0
  101. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/_x11.py +0 -0
  102. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/annotate.py +0 -0
  103. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/app.py +0 -0
  104. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/app_data.py +0 -0
  105. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/app_runtime.py +0 -0
  106. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/apps.py +0 -0
  107. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/card.py +0 -0
  108. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/checks.py +0 -0
  109. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/clock.py +0 -0
  110. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/conformance/__init__.py +0 -0
  111. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/conformance/__main__.py +0 -0
  112. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/conformance/checks.py +0 -0
  113. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/conformance/client.py +0 -0
  114. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/conformance/desk.py +0 -0
  115. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/conformance/fixture.py +0 -0
  116. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/conformance/mp4.py +0 -0
  117. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/conformance/page_fixture.py +0 -0
  118. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/conformance/report.py +0 -0
  119. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/conformance/wayland_fixture.py +0 -0
  120. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/dataplane.py +0 -0
  121. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/driver.py +0 -0
  122. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/errors.py +0 -0
  123. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/extensions.py +0 -0
  124. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/frames.py +0 -0
  125. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/keys.py +0 -0
  126. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/launch.py +0 -0
  127. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/manifest.py +0 -0
  128. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/operations.py +0 -0
  129. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/platform.py +0 -0
  130. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/prefix.py +0 -0
  131. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/queue.py +0 -0
  132. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/recording.py +0 -0
  133. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/results.py +0 -0
  134. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/run_install_step.py +0 -0
  135. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/runtime.py +0 -0
  136. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/seed.py +0 -0
  137. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/serve.py +0 -0
  138. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/serve_app.py +0 -0
  139. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/served.py +0 -0
  140. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/session.py +0 -0
  141. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/settings.py +0 -0
  142. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/skill.py +0 -0
  143. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/spaces.py +0 -0
  144. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/svc.py +0 -0
  145. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/computer/tools.py +0 -0
  146. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/errors.py +0 -0
  147. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/manifest.py +0 -0
  148. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/passthrough.py +0 -0
  149. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/preflight.py +0 -0
  150. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/tool_access.py +0 -0
  151. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/tool_client.py +0 -0
  152. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/tool_context.py +0 -0
  153. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/transfers.py +0 -0
  154. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/types.py +0 -0
  155. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website/__init__.py +0 -0
  156. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website/clock.py +0 -0
  157. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website/conformance.py +0 -0
  158. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website/environment.py +0 -0
  159. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website/errors.py +0 -0
  160. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website/forwarding.py +0 -0
  161. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website/readiness.py +0 -0
  162. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website/routes.py +0 -0
  163. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website/session.py +0 -0
  164. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website_browser/__init__.py +0 -0
  165. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website_browser/cdp.py +0 -0
  166. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website_browser/contexts.py +0 -0
  167. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website_browser/control.py +0 -0
  168. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website_browser/data.py +0 -0
  169. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website_browser/devtools.py +0 -0
  170. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website_browser/environment.py +0 -0
  171. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website_browser/log.py +0 -0
  172. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website_browser/network.py +0 -0
  173. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website_browser/recording.py +0 -0
  174. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website_browser/scope.py +0 -0
  175. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website_browser/shapes.py +0 -0
  176. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/src/agentenv_protocol/website_browser/stream.py +0 -0
  177. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/atif_cases.py +0 -0
  178. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/computer_fake.py +0 -0
  179. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/conftest.py +0 -0
  180. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/probe_fake.py +0 -0
  181. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_a2a_agent.py +0 -0
  182. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_a2a_agent_clock.py +0 -0
  183. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_a2a_agent_examples.py +0 -0
  184. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_a2a_atif_media.py +0 -0
  185. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_a2a_atif_prescribe.py +0 -0
  186. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_a2a_atif_scrubbing.py +0 -0
  187. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_a2a_atif_serving.py +0 -0
  188. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_a2a_atif_turns.py +0 -0
  189. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_a2a_cdp_config.py +0 -0
  190. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_a2a_object_transfers.py +0 -0
  191. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_a2a_peer_agents.py +0 -0
  192. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_a2a_proxy.py +0 -0
  193. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_a2a_staging.py +0 -0
  194. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_a2a_trajectory_log.py +0 -0
  195. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_agent_env_environment.py +0 -0
  196. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_atif_builder.py +0 -0
  197. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_atif_fixtures.py +0 -0
  198. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_atif_kit.py +0 -0
  199. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_atif_profile.py +0 -0
  200. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_atif_reader.py +0 -0
  201. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_atif_validator.py +0 -0
  202. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_atif_vendored.py +0 -0
  203. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_browser_cdp.py +0 -0
  204. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_browser_contexts.py +0 -0
  205. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_browser_data.py +0 -0
  206. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_browser_log.py +0 -0
  207. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_browser_network.py +0 -0
  208. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_browser_recording.py +0 -0
  209. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_browser_state.py +0 -0
  210. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_client.py +0 -0
  211. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_app_data.py +0 -0
  212. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_app_server.py +0 -0
  213. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_clock.py +0 -0
  214. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_conformance.py +0 -0
  215. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_conformance_attempts.py +0 -0
  216. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_conformance_checks.py +0 -0
  217. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_conformance_page.py +0 -0
  218. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_conformance_recording.py +0 -0
  219. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_dataplane.py +0 -0
  220. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_declare.py +0 -0
  221. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_driver.py +0 -0
  222. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_driver_keys.py +0 -0
  223. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_extensions.py +0 -0
  224. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_frames.py +0 -0
  225. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_macos.py +0 -0
  226. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_page.py +0 -0
  227. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_queue.py +0 -0
  228. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_recording.py +0 -0
  229. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_recording_annotate.py +0 -0
  230. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_screenshot_delay.py +0 -0
  231. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_seed.py +0 -0
  232. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_serve.py +0 -0
  233. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_served.py +0 -0
  234. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_session_windows.py +0 -0
  235. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_spaces.py +0 -0
  236. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_svc_forward.py +0 -0
  237. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_tool_prefix.py +0 -0
  238. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_computer_windows_driver.py +0 -0
  239. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_control_token.py +0 -0
  240. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_data_objects.py +0 -0
  241. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_devtools_pipe.py +0 -0
  242. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_errors.py +0 -0
  243. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_extension_methods.py +0 -0
  244. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_intake.py +0 -0
  245. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_manifest.py +0 -0
  246. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_preflight.py +0 -0
  247. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_tool_access.py +0 -0
  248. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_tool_annotations.py +0 -0
  249. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_tool_client.py +0 -0
  250. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_tool_context.py +0 -0
  251. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_tool_context_fastmcp.py +0 -0
  252. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_tool_context_injection.py +0 -0
  253. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_usage.py +0 -0
  254. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_website_api.py +0 -0
  255. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_website_browser.py +0 -0
  256. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_website_conformance.py +0 -0
  257. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_website_environment.py +0 -0
  258. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_website_forwarding.py +0 -0
  259. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_website_live.py +0 -0
  260. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_website_mcp.py +0 -0
  261. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/tests/test_website_notes_example.py +0 -0
  262. {agentenv_framework_protocol-0.1.639 → agentenv_framework_protocol-0.1.640}/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.639
3
+ Version: 0.1.640
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
@@ -1502,6 +1502,15 @@ reads what `to_dict` wrote under any protocol version, a field it leaves out
1502
1502
  being `None` and a key it doesn't know ignored, and `TaskResult.failure(...,
1503
1503
  usage=...)` carries usage on a failure as `success` does.
1504
1504
 
1505
+ A turn whose calls used more than one model, such as a subagent on a smaller
1506
+ model or a side call for a title, gives its counts by model in `Usage.models`:
1507
+ one `ModelUsage` per model, with the model's name as called, its `calls`, its
1508
+ token and cache counts read as `Usage`'s are, and the agent's own `cost_usd`
1509
+ for them when it has one. The rows cover every call the turn counted; a call
1510
+ the agent can't name goes under the model it was configured with. The host
1511
+ prices each row at its own model's rate. A turn on one model leaves `models`
1512
+ empty, and is priced at its role's model.
1513
+
1505
1514
  Whoever makes a model call knows what its counts hold, so an agent builds its own
1506
1515
  `Usage`. `Usage.from_model_response(usage)` is the default reader for a model
1507
1516
  response's own usage, with `input_tokens` counting the cache
@@ -1431,6 +1431,15 @@ reads what `to_dict` wrote under any protocol version, a field it leaves out
1431
1431
  being `None` and a key it doesn't know ignored, and `TaskResult.failure(...,
1432
1432
  usage=...)` carries usage on a failure as `success` does.
1433
1433
 
1434
+ A turn whose calls used more than one model, such as a subagent on a smaller
1435
+ model or a side call for a title, gives its counts by model in `Usage.models`:
1436
+ one `ModelUsage` per model, with the model's name as called, its `calls`, its
1437
+ token and cache counts read as `Usage`'s are, and the agent's own `cost_usd`
1438
+ for them when it has one. The rows cover every call the turn counted; a call
1439
+ the agent can't name goes under the model it was configured with. The host
1440
+ prices each row at its own model's rate. A turn on one model leaves `models`
1441
+ empty, and is priced at its role's model.
1442
+
1434
1443
  Whoever makes a model call knows what its counts hold, so an agent builds its own
1435
1444
  `Usage`. `Usage.from_model_response(usage)` is the default reader for a model
1436
1445
  response's own usage, with `input_tokens` counting the cache
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agentenv-framework-protocol"
3
- version = "0.1.639"
3
+ version = "0.1.640"
4
4
  description = "Open data-plane protocol and server SDK for agent environments."
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -131,6 +131,7 @@ from .tasks.v1 import (
131
131
  TaskStreamItem,
132
132
  TextPart,
133
133
  TrajectoryLog,
134
+ ModelUsage,
134
135
  Usage,
135
136
  WriteOnly,
136
137
  )
@@ -272,6 +273,7 @@ __all__ = [
272
273
  "TriggerDecideRequest",
273
274
  "TriggerRegisterRequest",
274
275
  "Uploaded",
276
+ "ModelUsage",
275
277
  "Usage",
276
278
  "WriteNamespaceGrant",
277
279
  "WriteObject",
@@ -16,6 +16,7 @@ from .v1 import (
16
16
  TaskStreamItem,
17
17
  TextPart,
18
18
  TrajectoryLog,
19
+ ModelUsage,
19
20
  Usage,
20
21
  WriteOnly,
21
22
  )
@@ -36,6 +37,7 @@ __all__ = [
36
37
  "TaskStreamItem",
37
38
  "TextPart",
38
39
  "TrajectoryLog",
40
+ "ModelUsage",
39
41
  "Usage",
40
42
  "WriteOnly",
41
43
  ]
@@ -385,12 +385,60 @@ def _count(value: Any) -> int | None:
385
385
  return value if isinstance(value, int) and not isinstance(value, bool) and value >= 0 else None
386
386
 
387
387
 
388
+ def _check_counts(record: Any, names: Iterable[str]) -> None:
389
+ for name in names:
390
+ value = getattr(record, name)
391
+ if value is not None and (isinstance(value, bool) or not isinstance(value, int) or value < 0):
392
+ raise ValueError(f"{name} must be a non-negative integer")
393
+ if record.input_includes_cache is not None and not isinstance(record.input_includes_cache, bool):
394
+ raise ValueError("input_includes_cache must be true, false or null")
395
+ if record.cost_usd is not None and (
396
+ isinstance(record.cost_usd, bool) or not isinstance(record.cost_usd, (int, float)) or record.cost_usd < 0
397
+ ):
398
+ raise ValueError("cost_usd cannot be negative")
399
+
400
+
401
+ _MODEL_COUNTERS = ("calls", "input_tokens", "output_tokens", "cache_read_tokens", "cache_write_tokens")
402
+
403
+
404
+ @dataclass(frozen=True, slots=True, kw_only=True)
405
+ class ModelUsage:
406
+ """One model's share of a turn's usage: the calls the turn made to ``model``, as it was called, and their counts,
407
+ read as ``Usage``'s are, with the agent's own cost for them when it has one."""
408
+
409
+ model: str
410
+ calls: int | None = None
411
+ input_tokens: int | None = None
412
+ output_tokens: int | None = None
413
+ cache_read_tokens: int | None = None
414
+ cache_write_tokens: int | None = None
415
+ input_includes_cache: bool | None = None
416
+ cost_usd: float | None = None
417
+
418
+ def __post_init__(self) -> None:
419
+ if not isinstance(self.model, str) or not self.model:
420
+ raise ValueError("a model's usage must name the model")
421
+ _check_counts(self, _MODEL_COUNTERS)
422
+
423
+ @classmethod
424
+ def from_dict(cls, data: Mapping[str, Any]) -> "ModelUsage":
425
+ """The model's usage ``to_dict`` wrote; a key this version doesn't know is ignored."""
426
+ if not isinstance(data, Mapping):
427
+ raise TypeError("a model's usage must be a mapping")
428
+ return cls(**{f.name: data[f.name] for f in fields(cls) if data.get(f.name) is not None})
429
+
430
+ def to_dict(self) -> dict[str, Any]:
431
+ return {f.name: value for f in fields(self) if (value := getattr(self, f.name)) is not None}
432
+
433
+
388
434
  @dataclass(frozen=True, slots=True, kw_only=True)
389
435
  class Usage:
390
436
  """Common execution metrics plus runtime-specific, JSON-shaped details. ``cache_read_tokens`` and
391
437
  ``cache_write_tokens`` count the prompt tokens read from and written to the provider's prompt cache;
392
438
  ``input_includes_cache`` says whether ``input_tokens`` counts both of them (True), neither (False), or is unknown
393
- (None), which a price needs to read the counts."""
439
+ (None), which a price needs to read the counts. ``models`` is the counts by model, for a turn whose calls used
440
+ more than one: it covers every call the turn counted, so a price can charge each model at its own rate. A count
441
+ the turn leaves out that every row gives is the rows' sum, and so is the includes-cache flag the rows agree on."""
394
442
 
395
443
  tool_call_count: int | None = None
396
444
  input_tokens: int | None = None
@@ -400,25 +448,22 @@ class Usage:
400
448
  cache_write_tokens: int | None = None
401
449
  input_includes_cache: bool | None = None
402
450
  cost_usd: float | None = None
451
+ models: tuple[ModelUsage, ...] = ()
403
452
  provider_details: Mapping[str, Any] = field(default_factory=dict)
404
453
 
405
454
  def __post_init__(self) -> None:
406
- for name in _USAGE_COUNTERS:
407
- value = getattr(self, name)
408
- if value is not None and (
409
- isinstance(value, bool) or not isinstance(value, int) or value < 0
410
- ):
411
- raise ValueError(f"{name} must be a non-negative integer")
412
- if self.input_includes_cache is not None and not isinstance(
413
- self.input_includes_cache, bool
414
- ):
415
- raise ValueError("input_includes_cache must be true, false or null")
416
- if self.cost_usd is not None and (
417
- isinstance(self.cost_usd, bool)
418
- or not isinstance(self.cost_usd, (int, float))
419
- or self.cost_usd < 0
420
- ):
421
- raise ValueError("cost_usd cannot be negative")
455
+ _check_counts(self, _USAGE_COUNTERS)
456
+ if isinstance(self.models, (str, bytes, Mapping)) or not isinstance(self.models, Iterable):
457
+ raise TypeError("models must be a list of each model's usage")
458
+ object.__setattr__(self, "models", tuple(
459
+ model if isinstance(model, ModelUsage) else ModelUsage.from_dict(model) for model in self.models))
460
+ for name in _MODEL_COUNTERS[1:]:
461
+ values = [getattr(model, name) for model in self.models]
462
+ if getattr(self, name) is None and values and None not in values:
463
+ object.__setattr__(self, name, sum(values))
464
+ flags = {model.input_includes_cache for model in self.models}
465
+ if self.input_includes_cache is None and len(flags) == 1:
466
+ object.__setattr__(self, "input_includes_cache", flags.pop())
422
467
  if not isinstance(self.provider_details, Mapping):
423
468
  raise TypeError("provider_details must be a mapping")
424
469
  object.__setattr__(
@@ -434,8 +479,10 @@ class Usage:
434
479
  known = {
435
480
  f.name: data[f.name]
436
481
  for f in fields(cls)
437
- if f.name != "provider_details" and data.get(f.name) is not None
482
+ if f.name not in ("provider_details", "models") and data.get(f.name) is not None
438
483
  }
484
+ if data.get("models") is not None:
485
+ known["models"] = data["models"]
439
486
  details = data.get("provider_details")
440
487
  return cls(**known, provider_details={} if details is None else details)
441
488
 
@@ -481,17 +528,20 @@ class Usage:
481
528
 
482
529
  @property
483
530
  def is_empty(self) -> bool:
484
- return all(value is None for value in self._values().values()) and not self.provider_details
531
+ return (all(value is None for value in self._values().values()) and not self.models
532
+ and not self.provider_details)
485
533
 
486
534
  def to_dict(self) -> dict[str, Any]:
487
535
  result = {name: value for name, value in self._values().items() if value is not None}
536
+ if self.models:
537
+ result["models"] = [model.to_dict() for model in self.models]
488
538
  if self.provider_details:
489
539
  result["provider_details"] = _thaw(self.provider_details)
490
540
  return result
491
541
 
492
542
  def _values(self) -> dict[str, Any]:
493
- """Every field but ``provider_details``, by name, in declaration order."""
494
- return {f.name: getattr(self, f.name) for f in fields(self) if f.name != "provider_details"}
543
+ """Every field but ``models`` and ``provider_details``, by name, in declaration order."""
544
+ return {f.name: getattr(self, f.name) for f in fields(self) if f.name not in ("models", "provider_details")}
495
545
 
496
546
 
497
547
  @dataclass(frozen=True, slots=True, kw_only=True)
@@ -0,0 +1,71 @@
1
+ """``Usage.models``, a turn's counts by model: each ``ModelUsage`` validated like ``Usage``'s own counts, written by
2
+ ``to_dict`` only when there are some, read back by ``from_dict`` from mappings, and ignored by an older reader."""
3
+
4
+ import pytest
5
+
6
+ from agentenv_protocol.a2a_agent import ModelUsage, Usage
7
+
8
+ SONNET = ModelUsage(model="claude-sonnet-4-6", calls=2, input_tokens=9000, output_tokens=400, cache_read_tokens=8000,
9
+ cache_write_tokens=500, input_includes_cache=True, cost_usd=0.012)
10
+ HAIKU = ModelUsage(model="claude-haiku-4-5", calls=1, input_tokens=3000, output_tokens=90, input_includes_cache=True)
11
+ TURN = Usage(tool_call_count=3, input_tokens=12000, output_tokens=490, cache_read_tokens=8000, cache_write_tokens=500,
12
+ input_includes_cache=True, models=(SONNET, HAIKU))
13
+
14
+
15
+ def test_a_turns_models_round_trip_and_are_written_only_when_there_are_some():
16
+ assert Usage.from_dict(TURN.to_dict()) == TURN
17
+ assert TURN.to_dict()["models"] == [
18
+ {"model": "claude-sonnet-4-6", "calls": 2, "input_tokens": 9000, "output_tokens": 400,
19
+ "cache_read_tokens": 8000, "cache_write_tokens": 500, "input_includes_cache": True, "cost_usd": 0.012},
20
+ {"model": "claude-haiku-4-5", "calls": 1, "input_tokens": 3000, "output_tokens": 90,
21
+ "input_includes_cache": True}]
22
+ assert "models" not in Usage(input_tokens=5).to_dict()
23
+ assert not Usage(models=()).to_dict() and Usage(models=()).is_empty
24
+ assert not Usage(models=(HAIKU,)).is_empty
25
+
26
+
27
+ def test_models_given_as_mappings_are_read_as_each_models_usage_and_an_unknown_key_is_ignored():
28
+ usage = Usage(models=[{"model": "gpt-4.1-mini", "input_tokens": 10, "output_tokens": 2, "reasoning_tokens": 1}])
29
+ assert usage.models == (ModelUsage(model="gpt-4.1-mini", input_tokens=10, output_tokens=2),)
30
+ assert Usage.from_dict({"input_tokens": 10, "models": None}) == Usage(input_tokens=10)
31
+
32
+
33
+ @pytest.mark.parametrize("field", ["calls", "input_tokens", "output_tokens", "cache_read_tokens", "cache_write_tokens"])
34
+ @pytest.mark.parametrize("value", [-1, 1.5, "3", True])
35
+ def test_a_models_count_that_isnt_a_non_negative_integer_is_refused(field, value):
36
+ with pytest.raises(ValueError, match=f"{field} must be a non-negative integer"):
37
+ ModelUsage(model="m", **{field: value})
38
+ with pytest.raises(ValueError, match=field):
39
+ Usage.from_dict({"models": [{"model": "m", field: value}]})
40
+
41
+
42
+ @pytest.mark.parametrize("row", [{"input_tokens": 1}, {"model": ""}, {"model": 7}])
43
+ def test_a_models_usage_must_name_its_model(row):
44
+ with pytest.raises((ValueError, TypeError)):
45
+ Usage(models=[row])
46
+
47
+
48
+ @pytest.mark.parametrize("models", [{"model": "m"}, "m", 3])
49
+ def test_models_must_be_a_list(models):
50
+ with pytest.raises(TypeError, match="models must be a list"):
51
+ Usage(models=models)
52
+
53
+
54
+ def test_a_models_own_cost_and_flag_are_checked_as_usages_are():
55
+ with pytest.raises(ValueError, match="cost_usd cannot be negative"):
56
+ ModelUsage(model="m", cost_usd=-1)
57
+ with pytest.raises(ValueError, match="input_includes_cache must be true, false or null"):
58
+ ModelUsage(model="m", input_includes_cache="yes")
59
+
60
+
61
+ def test_a_turn_that_gives_only_its_rows_takes_their_sums_as_its_counts():
62
+ usage = Usage(models=(SONNET, HAIKU))
63
+ assert (usage.input_tokens, usage.output_tokens, usage.input_includes_cache) == (12000, 490, True)
64
+ assert (usage.cache_read_tokens, usage.cache_write_tokens) == (None, None)
65
+ assert Usage(input_tokens=5, models=(HAIKU,)).input_tokens == 5
66
+
67
+
68
+ @pytest.mark.parametrize("models", [{}, "", 0, False])
69
+ def test_from_dict_refuses_a_models_value_that_isnt_a_list_even_when_empty(models):
70
+ with pytest.raises(TypeError, match="models must be a list"):
71
+ Usage.from_dict({"input_tokens": 1, "models": models})