agentenv-framework-protocol 0.1.628__tar.gz → 0.1.631__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 (261) hide show
  1. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/PKG-INFO +7 -3
  2. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/README.md +6 -2
  3. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/pyproject.toml +1 -1
  4. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/_trajectory_log.py +1 -0
  5. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/tasks/v1.py +15 -0
  6. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/builder.py +37 -2
  7. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_a2a_atif_prescribe.py +30 -0
  8. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_atif_builder.py +75 -0
  9. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/.gitignore +0 -0
  10. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/LICENSE +0 -0
  11. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/NOTICE +0 -0
  12. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/THIRD_PARTY_NOTICES.md +0 -0
  13. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/__init__.py +0 -0
  14. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/advanced_agent.py +0 -0
  15. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/basic_agent.py +0 -0
  16. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/custom_extensions_agent.py +0 -0
  17. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/multimodal_agent.py +0 -0
  18. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/reference_model.py +0 -0
  19. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/streaming_agent.py +0 -0
  20. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/website/notes/.gitignore +0 -0
  21. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/website/notes/Dockerfile +0 -0
  22. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/website/notes/Dockerfile.dockerignore +0 -0
  23. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/website/notes/README.md +0 -0
  24. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/website/notes/data/seed.json +0 -0
  25. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/website/notes/env.toml +0 -0
  26. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/website/notes/site.py +0 -0
  27. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/website/notes/web/index.html +0 -0
  28. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/website/notes/web/package-lock.json +0 -0
  29. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/website/notes/web/package.json +0 -0
  30. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/website/notes/web/src/main.js +0 -0
  31. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/website/notes/web/src/style.css +0 -0
  32. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/examples/website/notes/web/vite.config.js +0 -0
  33. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/__init__.py +0 -0
  34. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/__init__.py +0 -0
  35. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/_atif_copy.py +0 -0
  36. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/_media_spool.py +0 -0
  37. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/_secrets.py +0 -0
  38. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/_snapshot_state.py +0 -0
  39. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/_triggers.py +0 -0
  40. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/_turn_index.py +0 -0
  41. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/clock.py +0 -0
  42. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/control_token.py +0 -0
  43. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/extensions.py +0 -0
  44. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/framework.py +0 -0
  45. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/peer_agents.py +0 -0
  46. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/proxy.py +0 -0
  47. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/registry.py +0 -0
  48. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/staging.py +0 -0
  49. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/a2a_agent/tasks/__init__.py +0 -0
  50. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/agent_env_environment.py +0 -0
  51. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/PROFILE.md +0 -0
  52. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/__init__.py +0 -0
  53. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/__main__.py +0 -0
  54. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/_image_size.py +0 -0
  55. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/adapter.py +0 -0
  56. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/fixtures/coding.json +0 -0
  57. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/fixtures/coding.stripped.json +0 -0
  58. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/fixtures/computer_use.json +0 -0
  59. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/fixtures/late_result.json +0 -0
  60. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/fixtures/media/482405b002a62efa8516c36709a7a100637507670576fa73a20ad5420d55c66f.png +0 -0
  61. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/fixtures/media/55c64d0fcd6f9d5f7c828093857e3fdfda68478bb4e9bd24d481ef391c7804e8.heic +0 -0
  62. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/fixtures/media/67905ad3cc2dd52b1f5f6a6d2814de0396618b29b4238b9af5207aeb69936e6d.mp4 +0 -0
  63. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/fixtures/media/69a8aa01fe5537076d023dd5e9cc4275b39fc0434aa6483a9f58b66ef2f3c896.png +0 -0
  64. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/fixtures/media/82e60066a2de261b6653bcdda90d1cb9a7af2f474cecd82e8d371e8384d72315.png +0 -0
  65. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/fixtures/media/845e91831319e89c4d656bdb80c278ac09a7230d61e5dfd2e1b1fbb436ac8917.pdf +0 -0
  66. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/fixtures/multi_agent.json +0 -0
  67. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/fixtures/odd_parts.json +0 -0
  68. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/fixtures/subagent.json +0 -0
  69. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/fixtures/two_turns.json +0 -0
  70. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/kit.py +0 -0
  71. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/models/LICENSE +0 -0
  72. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/models/VENDORED.md +0 -0
  73. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/models/__init__.py +0 -0
  74. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/models/agent.py +0 -0
  75. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/models/content.py +0 -0
  76. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/models/final_metrics.py +0 -0
  77. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/models/metrics.py +0 -0
  78. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/models/observation.py +0 -0
  79. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/models/observation_result.py +0 -0
  80. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/models/step.py +0 -0
  81. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/models/subagent_trajectory_ref.py +0 -0
  82. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/models/tool_call.py +0 -0
  83. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/models/trajectory.py +0 -0
  84. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/profile.py +0 -0
  85. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/reader.py +0 -0
  86. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/runner.py +0 -0
  87. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/served.py +0 -0
  88. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/atif/validator.py +0 -0
  89. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/client.py +0 -0
  90. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/__init__.py +0 -0
  91. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/_declare.py +0 -0
  92. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/_desktop.py +0 -0
  93. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/_job.py +0 -0
  94. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/_linux.py +0 -0
  95. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/_load.py +0 -0
  96. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/_macos.py +0 -0
  97. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/_reaping.py +0 -0
  98. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/_session_posix.py +0 -0
  99. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/_session_windows.py +0 -0
  100. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/_windows.py +0 -0
  101. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/_with_fds.py +0 -0
  102. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/_x11.py +0 -0
  103. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/annotate.py +0 -0
  104. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/app.py +0 -0
  105. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/app_data.py +0 -0
  106. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/app_runtime.py +0 -0
  107. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/apps.py +0 -0
  108. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/card.py +0 -0
  109. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/checks.py +0 -0
  110. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/clock.py +0 -0
  111. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/conformance/__init__.py +0 -0
  112. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/conformance/__main__.py +0 -0
  113. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/conformance/checks.py +0 -0
  114. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/conformance/client.py +0 -0
  115. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/conformance/desk.py +0 -0
  116. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/conformance/fixture.py +0 -0
  117. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/conformance/mp4.py +0 -0
  118. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/conformance/page_fixture.py +0 -0
  119. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/conformance/report.py +0 -0
  120. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/conformance/wayland_fixture.py +0 -0
  121. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/dataplane.py +0 -0
  122. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/driver.py +0 -0
  123. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/errors.py +0 -0
  124. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/extensions.py +0 -0
  125. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/frames.py +0 -0
  126. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/keys.py +0 -0
  127. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/launch.py +0 -0
  128. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/manifest.py +0 -0
  129. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/operations.py +0 -0
  130. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/platform.py +0 -0
  131. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/prefix.py +0 -0
  132. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/queue.py +0 -0
  133. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/recording.py +0 -0
  134. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/results.py +0 -0
  135. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/run_install_step.py +0 -0
  136. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/runtime.py +0 -0
  137. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/seed.py +0 -0
  138. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/serve.py +0 -0
  139. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/serve_app.py +0 -0
  140. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/served.py +0 -0
  141. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/session.py +0 -0
  142. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/settings.py +0 -0
  143. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/skill.py +0 -0
  144. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/spaces.py +0 -0
  145. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/svc.py +0 -0
  146. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/computer/tools.py +0 -0
  147. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/errors.py +0 -0
  148. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/manifest.py +0 -0
  149. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/passthrough.py +0 -0
  150. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/preflight.py +0 -0
  151. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/tool_access.py +0 -0
  152. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/tool_client.py +0 -0
  153. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/tool_context.py +0 -0
  154. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/transfers.py +0 -0
  155. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/types.py +0 -0
  156. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website/__init__.py +0 -0
  157. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website/clock.py +0 -0
  158. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website/conformance.py +0 -0
  159. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website/environment.py +0 -0
  160. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website/errors.py +0 -0
  161. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website/forwarding.py +0 -0
  162. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website/readiness.py +0 -0
  163. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website/routes.py +0 -0
  164. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website/session.py +0 -0
  165. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website_browser/__init__.py +0 -0
  166. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website_browser/cdp.py +0 -0
  167. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website_browser/contexts.py +0 -0
  168. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website_browser/control.py +0 -0
  169. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website_browser/data.py +0 -0
  170. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website_browser/devtools.py +0 -0
  171. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website_browser/environment.py +0 -0
  172. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website_browser/log.py +0 -0
  173. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website_browser/network.py +0 -0
  174. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website_browser/recording.py +0 -0
  175. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website_browser/scope.py +0 -0
  176. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website_browser/shapes.py +0 -0
  177. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/src/agentenv_protocol/website_browser/stream.py +0 -0
  178. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/atif_cases.py +0 -0
  179. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/computer_fake.py +0 -0
  180. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/conftest.py +0 -0
  181. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/probe_fake.py +0 -0
  182. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_a2a_agent.py +0 -0
  183. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_a2a_agent_clock.py +0 -0
  184. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_a2a_agent_examples.py +0 -0
  185. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_a2a_atif_media.py +0 -0
  186. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_a2a_atif_scrubbing.py +0 -0
  187. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_a2a_atif_serving.py +0 -0
  188. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_a2a_atif_turns.py +0 -0
  189. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_a2a_cdp_config.py +0 -0
  190. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_a2a_object_transfers.py +0 -0
  191. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_a2a_peer_agents.py +0 -0
  192. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_a2a_proxy.py +0 -0
  193. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_a2a_staging.py +0 -0
  194. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_a2a_trajectory_log.py +0 -0
  195. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_agent_env_environment.py +0 -0
  196. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_atif_fixtures.py +0 -0
  197. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_atif_kit.py +0 -0
  198. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_atif_profile.py +0 -0
  199. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_atif_reader.py +0 -0
  200. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_atif_validator.py +0 -0
  201. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_atif_vendored.py +0 -0
  202. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_browser_cdp.py +0 -0
  203. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_browser_contexts.py +0 -0
  204. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_browser_data.py +0 -0
  205. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_browser_log.py +0 -0
  206. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_browser_network.py +0 -0
  207. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_browser_recording.py +0 -0
  208. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_browser_state.py +0 -0
  209. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_client.py +0 -0
  210. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_app_data.py +0 -0
  211. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_app_server.py +0 -0
  212. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_clock.py +0 -0
  213. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_conformance.py +0 -0
  214. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_conformance_attempts.py +0 -0
  215. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_conformance_checks.py +0 -0
  216. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_conformance_page.py +0 -0
  217. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_conformance_recording.py +0 -0
  218. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_dataplane.py +0 -0
  219. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_declare.py +0 -0
  220. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_driver.py +0 -0
  221. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_driver_keys.py +0 -0
  222. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_extensions.py +0 -0
  223. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_frames.py +0 -0
  224. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_macos.py +0 -0
  225. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_page.py +0 -0
  226. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_queue.py +0 -0
  227. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_recording.py +0 -0
  228. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_recording_annotate.py +0 -0
  229. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_screenshot_delay.py +0 -0
  230. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_seed.py +0 -0
  231. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_serve.py +0 -0
  232. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_served.py +0 -0
  233. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_session_windows.py +0 -0
  234. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_spaces.py +0 -0
  235. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_svc_forward.py +0 -0
  236. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_tool_prefix.py +0 -0
  237. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_computer_windows_driver.py +0 -0
  238. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_control_token.py +0 -0
  239. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_data_objects.py +0 -0
  240. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_devtools_pipe.py +0 -0
  241. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_errors.py +0 -0
  242. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_extension_methods.py +0 -0
  243. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_intake.py +0 -0
  244. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_manifest.py +0 -0
  245. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_preflight.py +0 -0
  246. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_tool_access.py +0 -0
  247. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_tool_annotations.py +0 -0
  248. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_tool_client.py +0 -0
  249. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_tool_context.py +0 -0
  250. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_tool_context_fastmcp.py +0 -0
  251. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_tool_context_injection.py +0 -0
  252. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_usage.py +0 -0
  253. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_website_api.py +0 -0
  254. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_website_browser.py +0 -0
  255. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_website_conformance.py +0 -0
  256. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_website_environment.py +0 -0
  257. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_website_forwarding.py +0 -0
  258. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_website_live.py +0 -0
  259. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_website_mcp.py +0 -0
  260. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/tests/test_website_notes_example.py +0 -0
  261. {agentenv_framework_protocol-0.1.628 → agentenv_framework_protocol-0.1.631}/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.628
3
+ Version: 0.1.631
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
@@ -1382,7 +1382,9 @@ the profile's spec, and `fixtures/` holds its canonical examples. The package ne
1382
1382
 
1383
1383
  The builder closes a step when the next one starts, puts every result in its call's step, writes `prompt_tokens`
1384
1384
  with the cache included, stores media at `media/<sha256>.<ext>`, embeds sub-agents and normalizes timestamps. A
1385
- record no method takes is counted in the root profile.
1385
+ record no method takes is counted in the root profile. `turn.tool_definitions([...], agent=None)` writes the tools
1386
+ the model was offered, in OpenAI's function form, to a trajectory's `agent.tool_definitions`; a later call adds
1387
+ tools and replaces those of the same name.
1386
1388
  - **The runner** (`AdapterRun`, `replay`) feeds one A2A context's records through one adapter instance, a task at a
1387
1389
  time. It writes each task's user step from its `TurnContext`, and the final response once, with the task's
1388
1390
  terminal state on its last step. Its `page()` is the live view, built when it's read: closed steps only, so a
@@ -1728,7 +1730,9 @@ one adapter instance, and feeds it every event the agent appends, as it appends
1728
1730
  trajectory returned at task end runs through the adapter then. The agent's own
1729
1731
  code feeds the adapter's aux files, records that aren't in the native log such
1730
1732
  as a hook's notes, with `request.trajectory.aux(name, record)`, where they
1731
- happened among the events. An agent with an adapter that both appends events and
1733
+ happened among the events. `request.trajectory.builds_atif` says whether the task
1734
+ feeds a copy, so an agent gathers what only its aux files take, such as a log it
1735
+ tails, only then. An agent with an adapter that both appends events and
1732
1736
  returns a native trajectory fails the turn with code
1733
1737
  `framework.trajectory_appended_and_returned`, since its ATIF copy would come
1734
1738
  from one of them and its native record from the other.
@@ -1311,7 +1311,9 @@ the profile's spec, and `fixtures/` holds its canonical examples. The package ne
1311
1311
 
1312
1312
  The builder closes a step when the next one starts, puts every result in its call's step, writes `prompt_tokens`
1313
1313
  with the cache included, stores media at `media/<sha256>.<ext>`, embeds sub-agents and normalizes timestamps. A
1314
- record no method takes is counted in the root profile.
1314
+ record no method takes is counted in the root profile. `turn.tool_definitions([...], agent=None)` writes the tools
1315
+ the model was offered, in OpenAI's function form, to a trajectory's `agent.tool_definitions`; a later call adds
1316
+ tools and replaces those of the same name.
1315
1317
  - **The runner** (`AdapterRun`, `replay`) feeds one A2A context's records through one adapter instance, a task at a
1316
1318
  time. It writes each task's user step from its `TurnContext`, and the final response once, with the task's
1317
1319
  terminal state on its last step. Its `page()` is the live view, built when it's read: closed steps only, so a
@@ -1657,7 +1659,9 @@ one adapter instance, and feeds it every event the agent appends, as it appends
1657
1659
  trajectory returned at task end runs through the adapter then. The agent's own
1658
1660
  code feeds the adapter's aux files, records that aren't in the native log such
1659
1661
  as a hook's notes, with `request.trajectory.aux(name, record)`, where they
1660
- happened among the events. An agent with an adapter that both appends events and
1662
+ happened among the events. `request.trajectory.builds_atif` says whether the task
1663
+ feeds a copy, so an agent gathers what only its aux files take, such as a log it
1664
+ tails, only then. An agent with an adapter that both appends events and
1661
1665
  returns a native trajectory fails the turn with code
1662
1666
  `framework.trajectory_appended_and_returned`, since its ATIF copy would come
1663
1667
  from one of them and its native record from the other.
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "agentenv-framework-protocol"
3
- version = "0.1.628"
3
+ version = "0.1.631"
4
4
  description = "Open data-plane protocol and server SDK for agent environments."
5
5
  readme = "README.md"
6
6
  license = "Apache-2.0"
@@ -155,6 +155,7 @@ class TaskTrajectories:
155
155
  built = self._built.setdefault(record.context_id, self._prescribed)
156
156
  if self._atif is not None and turn is not None and ATIF_FORMAT in built:
157
157
  copy = self._copies.get(record.context_id)
158
+ record.log._starts_document = copy is None
158
159
  if copy is None:
159
160
  copy = self._copies[record.context_id] = AtifCopy(
160
161
  self._atif, record.context_id, media=self.media.sink(record.context_id),
@@ -163,6 +163,7 @@ class TrajectoryLog:
163
163
 
164
164
  __slots__ = (
165
165
  "_events", "_size_bytes", "_format", "_native", "_sealed", "_task_id", "_warned", "_adapter", "_atif",
166
+ "_starts_document",
166
167
  )
167
168
 
168
169
  def __init__(self, *, native: str | None = None, adapter: AdapterSpec | None = None) -> None:
@@ -175,11 +176,25 @@ class TrajectoryLog:
175
176
  self._warned = False
176
177
  self._adapter = adapter
177
178
  self._atif: Any = None
179
+ self._starts_document = False
178
180
 
179
181
  @property
180
182
  def format(self) -> str | None:
181
183
  return self._format
182
184
 
185
+ @property
186
+ def builds_atif(self) -> bool:
187
+ """Whether this task feeds an atif/1 copy: the agent has an ATIF adapter and the run prescribed atif/1. An agent
188
+ gathers what only its aux files take, such as a log it tails, only then."""
189
+ return self._atif is not None
190
+
191
+ @property
192
+ def starts_document(self) -> bool:
193
+ """Whether this task opens a new atif/1 document of its conversation: the conversation's first, or the first
194
+ since the copy was dropped (a restart, an eviction, a snapshot restore). What an agent feeds a document once,
195
+ such as the tools its model is offered, it feeds again then."""
196
+ return self._starts_document
197
+
183
198
  def set_format(self, format: str) -> None:
184
199
  """Name the events' versioned format, such as ``my-cli-events/1``; once an event is
185
200
  appended, it stays."""
@@ -229,6 +229,13 @@ class _Trajectory:
229
229
  steps: list[_Step] = field(default_factory=list)
230
230
  open: _Step | None = None
231
231
  task: int = -1
232
+ tools: dict[str, dict[str, Any]] = field(default_factory=dict)
233
+
234
+ def agent_block(self) -> dict[str, Any]:
235
+ block = dict(self.agent)
236
+ if self.tools:
237
+ block["tool_definitions"] = [json.loads(json.dumps(tool)) for tool in self.tools.values()]
238
+ return block
232
239
 
233
240
 
234
241
  class Document:
@@ -411,6 +418,14 @@ class Document:
411
418
  self._subs[agent_id] = _Trajectory(agent_id, _agent(name or agent_id, version, model_name), task=self._task)
412
419
  self._spawned[spawned_by] = agent_id
413
420
 
421
+ def tool_definitions(self, agent: str | None, definitions: Sequence[Any]) -> None:
422
+ if not isinstance(definitions, (list, tuple)):
423
+ raise AtifError(f"tool definitions are a list, not {type(definitions).__name__}")
424
+ checked = [_tool_definition(definition) for definition in definitions]
425
+ tools = self._traj(agent).tools
426
+ for definition in checked:
427
+ tools[definition["function"]["name"]] = definition
428
+
414
429
  def store(self, data: bytes, media_type: str, info: Mapping[str, Any]) -> Media:
415
430
  if not isinstance(data, (bytes, bytearray)):
416
431
  raise AtifError("media bytes are bytes")
@@ -576,9 +591,9 @@ class Document:
576
591
  doc: dict[str, Any] = {"schema_version": SCHEMA_VERSION, "session_id": self._context_id}
577
592
  if self._trajectory_id is not None:
578
593
  doc["trajectory_id"] = self._trajectory_id
579
- doc["agent"] = dict(root.agent)
594
+ doc["agent"] = root.agent_block()
580
595
  doc["steps"] = _steps(root, counts[None], linked, closed_only)
581
- subs = [{"schema_version": SCHEMA_VERSION, "trajectory_id": trajectory.actor, "agent": dict(trajectory.agent),
596
+ subs = [{"schema_version": SCHEMA_VERSION, "trajectory_id": trajectory.actor, "agent": trajectory.agent_block(),
582
597
  "steps": _steps(trajectory, counts[trajectory.actor], linked, closed_only)}
583
598
  for trajectory in self._subs.values() if counts[trajectory.actor]]
584
599
  if subs:
@@ -656,6 +671,19 @@ def _task_error(error: Mapping[str, Any] | None) -> dict[str, Any] | None:
656
671
  return {k: v for k, v in (("kind", kind), ("message", message), ("code", code)) if v is not None}
657
672
 
658
673
 
674
+ def _tool_definition(definition: Any) -> dict[str, Any]:
675
+ function = definition.get("function") if isinstance(definition, Mapping) else None
676
+ if not isinstance(function, Mapping) or definition.get("type") != "function":
677
+ raise AtifError(f"a tool definition is a function entry, {{'type': 'function', 'function': {{...}}}}, "
678
+ f"not {definition!r:.80}")
679
+ _str(function.get("name"), "a tool definition's name", optional=False)
680
+ if function.get("description") is not None and not isinstance(function["description"], str):
681
+ raise AtifError("a tool definition's description is a string")
682
+ if function.get("parameters") is not None and not isinstance(function["parameters"], Mapping):
683
+ raise AtifError("a tool definition's parameters are a JSON Schema object")
684
+ return _json(dict(definition), "a tool definition")
685
+
686
+
659
687
  def _agent(name: str | None, version: str | None, model: str | None) -> dict[str, Any]:
660
688
  agent = {"name": name or "unknown", "version": version or "unknown"}
661
689
  if model:
@@ -882,6 +910,13 @@ class AtifTurn:
882
910
  result points at it; a sub-agent that writes no step is left out, and so is the pointer."""
883
911
  self._doc.subagent(agent_id, spawned_by, name, version, model_name)
884
912
 
913
+ def tool_definitions(self, definitions: Sequence[Mapping[str, Any]], *, agent: str | None = None) -> None:
914
+ """The tools the model was offered, each in OpenAI's function-calling form (``{"type": "function", "function":
915
+ {"name", "description", "parameters"}}``), written to the trajectory's ``agent.tool_definitions``. A later call
916
+ adds tools and replaces those of the same name, in place. The agent block isn't one of the steps a live reader
917
+ holds, so it may grow after a page is served."""
918
+ self._doc.tool_definitions(agent, definitions)
919
+
885
920
  def media(self, data: bytes, media_type: str, *, width: int | None = None, height: int | None = None,
886
921
  duration_ms: int | None = None, pages: int | None = None, name: str | None = None) -> Media:
887
922
  """Store media bytes (through the sink) and return the Media to put in content."""
@@ -101,3 +101,33 @@ def test_a_conversation_restored_over_takes_the_prescription_in_effect_at_its_ne
101
101
  play("t2")
102
102
  assert trajectories.atif_task("t2") is not None
103
103
  trajectories.media.close()
104
+
105
+
106
+ def test_a_task_says_whether_it_feeds_an_atif_copy() -> None:
107
+ trajectories = TaskTrajectories(native=NATIVE, atif=Shots)
108
+ turn = TurnStart(message_id=None, parts=(TextPart(text="hi"),), agent_name="toy", agent_version="1",
109
+ agent_model=None)
110
+ unprescribed = trajectories.register("t1", "before")
111
+ trajectories.start("t1", turn)
112
+ trajectories.prescribe([FORMAT])
113
+ prescribed = trajectories.register("t2", "after")
114
+ waiting = prescribed.builds_atif
115
+ trajectories.start("t2", turn)
116
+ assert (unprescribed.builds_atif, waiting, prescribed.builds_atif) == (False, False, True)
117
+ assert TaskTrajectories(native=NATIVE).register("t3", "ctx").builds_atif is False
118
+
119
+
120
+ def test_a_task_says_whether_it_opens_a_new_document_of_its_conversation() -> None:
121
+ trajectories = TaskTrajectories(native=NATIVE, atif=Shots)
122
+ trajectories.prescribe([FORMAT])
123
+ turn = TurnStart(message_id=None, parts=(TextPart(text="hi"),), agent_name="toy", agent_version="1",
124
+ agent_model=None)
125
+ opened = []
126
+ for task_id in ("t1", "t2", "t3"):
127
+ log = trajectories.register(task_id, "ctx")
128
+ trajectories.start(task_id, turn)
129
+ opened.append(log.starts_document)
130
+ trajectories.seal(task_id, TrajectoryState.COMPLETED, final=(TextPart(text="done"),))
131
+ if task_id == "t2":
132
+ trajectories.restored("ctx", 2)
133
+ assert opened == [True, False, True]
@@ -688,3 +688,78 @@ def test_a_served_turn_keeps_a_null_it_requires_so_replay_rebuilds_the_document(
688
688
  def test_a_served_turn_or_aux_log_that_breaks_its_shape_is_refused(turn, aux):
689
689
  with pytest.raises(ValidationError):
690
690
  RecordedTask.from_served(turn, [], aux)
691
+
692
+
693
+ def tooled():
694
+ @atif_adapter(native_format="toy-events/1", version="0.1.0", input_includes_cache=False)
695
+ class Tooled(Adapter):
696
+ @native(type="tools")
697
+ def tools(self, r, turn):
698
+ turn.tool_definitions(r["tools"], agent=r.get("agent"))
699
+
700
+ @native(type="call")
701
+ def call(self, r, turn):
702
+ turn.tool_call(step=r["step"], tool_call_id=r["id"], function_name="Agent", arguments={})
703
+
704
+ @native(type="spawn")
705
+ def spawn(self, r, turn):
706
+ turn.subagent("sub", spawned_by=r["id"])
707
+
708
+ @native(type="say")
709
+ def say(self, r, turn):
710
+ turn.message(step=r["step"], text=r["text"], agent=r.get("agent"))
711
+ return Tooled
712
+
713
+
714
+ def tool(name, description="", **schema):
715
+ return {"type": "function", "function": {"name": name, "description": description,
716
+ "parameters": {"type": "object", "properties": schema}}}
717
+
718
+
719
+ def test_tool_definitions_go_on_the_agent_block_and_a_later_one_replaces_its_name_in_place():
720
+ run, pages = run_task([
721
+ {"type": "say", "step": "a", "text": "first"},
722
+ {"type": "tools", "tools": [tool("Bash", "Run a command", command={"type": "string"}), tool("Read")]},
723
+ {"type": "say", "step": "b", "text": "second"},
724
+ {"type": "tools", "tools": [tool("Bash", "Run a shell command"), tool("Write")]},
725
+ ], cls=tooled())
726
+ definitions = run.document()["agent"]["tool_definitions"]
727
+ assert [d["function"]["name"] for d in definitions] == ["Bash", "Read", "Write"]
728
+ assert definitions[0]["function"]["description"] == "Run a shell command"
729
+ assert "tool_definitions" not in pages[1]["agent"] and all(is_prefix(a, b) for a, b in zip(pages, pages[1:]))
730
+ check(run.document())
731
+
732
+
733
+ def test_a_sub_agent_has_tool_definitions_of_its_own():
734
+ run, _ = run_task([
735
+ {"type": "call", "step": "a", "id": "spawn-1"}, {"type": "spawn", "id": "spawn-1"},
736
+ {"type": "tools", "tools": [tool("Bash")], "agent": "sub"},
737
+ {"type": "say", "step": "s", "text": "from the sub-agent", "agent": "sub"},
738
+ ], cls=tooled())
739
+ document = run.document()
740
+ assert "tool_definitions" not in document["agent"]
741
+ assert [d["function"]["name"] for d in document["subagent_trajectories"][0]["agent"]["tool_definitions"]] == [
742
+ "Bash"]
743
+
744
+
745
+ def test_a_read_hands_out_a_copy_of_the_tool_definitions():
746
+ run, _ = run_task([{"type": "tools", "tools": [tool("Bash")]}, {"type": "say", "step": "a", "text": "hi"}],
747
+ cls=tooled())
748
+ run.document()["agent"]["tool_definitions"][0]["function"]["name"] = "changed"
749
+ assert run.document()["agent"]["tool_definitions"][0]["function"]["name"] == "Bash"
750
+
751
+
752
+ @pytest.mark.parametrize("definition", [
753
+ {"name": "Bash"},
754
+ {"type": "function", "function": {"description": "no name"}},
755
+ {"type": "function", "function": {"name": "Bash", "parameters": "not a schema"}},
756
+ {"type": "function", "function": {"name": "Bash", "description": 3}},
757
+ {"type": "function", "function": {"name": "Bash", "parameters": {"bad": math.nan}}},
758
+ ])
759
+ def test_a_tool_definition_that_isnt_a_function_entry_is_refused_and_nothing_is_written(definition):
760
+ run = AdapterRun(tooled())
761
+ run.start_task(CTX)
762
+ with pytest.raises(AtifError):
763
+ run.native({"type": "tools", "tools": [tool("Read"), definition]})
764
+ run.native({"type": "say", "step": "a", "text": "hi"})
765
+ assert "tool_definitions" not in run.document()["agent"]