vis-agent 0.5.20.dev9206__tar.gz → 0.5.21.dev9250__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 (183) hide show
  1. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/PKG-INFO +1 -1
  2. vis_agent-0.5.21.dev9250/contracts/fixtures/view.json +207 -0
  3. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/schema/view.json +167 -3
  4. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/pyproject.toml +1 -1
  5. vis_agent-0.5.21.dev9250/release-tag +1 -0
  6. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/engine/_client.py +86 -6
  7. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/extension.py +9 -4
  8. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_app_attachments.py +15 -0
  9. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_client.py +75 -0
  10. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_live_primitives.py +24 -0
  11. vis_agent-0.5.20.dev9206/contracts/fixtures/view.json +0 -79
  12. vis_agent-0.5.20.dev9206/release-tag +0 -1
  13. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/.gitignore +0 -0
  14. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/LICENSE +0 -0
  15. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/README.md +0 -0
  16. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/activity-arguments.json +0 -0
  17. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/activity-cases.json +0 -0
  18. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/activity-copy.json +0 -0
  19. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/activity-execution.json +0 -0
  20. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/activity-groups.json +0 -0
  21. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/activity-read-session.json +0 -0
  22. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/activity-reads.json +0 -0
  23. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/activity-results.json +0 -0
  24. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/activity-stream.json +0 -0
  25. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/activity-tables.json +0 -0
  26. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/activity.json +0 -0
  27. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/app-log.json +0 -0
  28. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/app-pictures.json +0 -0
  29. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/attachment-reference.json +0 -0
  30. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/attachment-verbs.json +0 -0
  31. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/diff.json +0 -0
  32. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/live-primitives.json +0 -0
  33. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/live-view-checks.json +0 -0
  34. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/message-links.json +0 -0
  35. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/session-health.json +0 -0
  36. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/setting-models.json +0 -0
  37. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/setting-presets.json +0 -0
  38. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/shell-handle.json +0 -0
  39. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/team-updated.json +0 -0
  40. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/fixtures/transcript-export.json +0 -0
  41. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/oauth/mcp-client.json +0 -0
  42. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/schema/activity.json +0 -0
  43. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/schema/agents.json +0 -0
  44. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/schema/automations.json +0 -0
  45. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/schema/common.json +0 -0
  46. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/schema/config.json +0 -0
  47. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/schema/content.json +0 -0
  48. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/schema/council.json +0 -0
  49. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/schema/diff.json +0 -0
  50. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/schema/evals.json +0 -0
  51. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/schema/gateway.json +0 -0
  52. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/schema/keymap.json +0 -0
  53. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/schema/provider.json +0 -0
  54. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/schema/symbol.json +0 -0
  55. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/contracts/schema/toggle.json +0 -0
  56. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/examples/greeter/tests/test_greeter.py +0 -0
  57. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/hatch_build.py +0 -0
  58. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/__init__.py +0 -0
  59. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/_contracts.py +0 -0
  60. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/_outside.py +0 -0
  61. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/_wire.py +0 -0
  62. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/activity.py +0 -0
  63. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/engine/__init__.py +0 -0
  64. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/engine/_agent.py +0 -0
  65. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/engine/_agents.py +0 -0
  66. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/engine/_council.py +0 -0
  67. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/engine/_extensions.py +0 -0
  68. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/engine/_groups.py +0 -0
  69. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/engine/_host.py +0 -0
  70. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/engine/_install.py +0 -0
  71. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/engine/_local.py +0 -0
  72. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/engine/_models.py +0 -0
  73. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/engine/_sounds.py +0 -0
  74. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/engine/_speech.py +0 -0
  75. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/__init__.py +0 -0
  76. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/_gateway.py +0 -0
  77. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/agent.py +0 -0
  78. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/bench.py +0 -0
  79. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/check.py +0 -0
  80. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/compare.py +0 -0
  81. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/environment.py +0 -0
  82. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/grade.py +0 -0
  83. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/harbor.py +0 -0
  84. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/judge-rubric.toml +0 -0
  85. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/judge.py +0 -0
  86. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/labels.py +0 -0
  87. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/leaderboard.py +0 -0
  88. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/lic.py +0 -0
  89. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/longmemeval.py +0 -0
  90. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/mrcr.py +0 -0
  91. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/repeats.py +0 -0
  92. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/report.py +0 -0
  93. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/reports.py +0 -0
  94. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/rounds.py +0 -0
  95. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/stages.py +0 -0
  96. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/stats.py +0 -0
  97. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/evals/trajectory.py +0 -0
  98. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/extension_package.py +0 -0
  99. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/live_check.py +0 -0
  100. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/py.typed +0 -0
  101. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/src/blockether/vis/views.py +0 -0
  102. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/conftest.py +0 -0
  103. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/evals_atif.py +0 -0
  104. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_activity.py +0 -0
  105. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_agent.py +0 -0
  106. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_agent_extension_lifecycle.py +0 -0
  107. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_agent_extensions.py +0 -0
  108. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_agents.py +0 -0
  109. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_api_guides.py +0 -0
  110. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_app_door.py +0 -0
  111. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_app_images.py +0 -0
  112. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_attach_parity.py +0 -0
  113. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_attachments.py +0 -0
  114. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_authoring.py +0 -0
  115. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_automations.py +0 -0
  116. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_catalog.py +0 -0
  117. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_catalog_recipe.py +0 -0
  118. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_ci_report_recipe.py +0 -0
  119. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_client_extensions_engine.py +0 -0
  120. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_code_quality_recipe.py +0 -0
  121. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_contract_catalogs.py +0 -0
  122. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_contracts.py +0 -0
  123. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_council.py +0 -0
  124. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_declarations.py +0 -0
  125. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_engine.py +0 -0
  126. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_engine_docstrings.py +0 -0
  127. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_agent.py +0 -0
  128. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_bench.py +0 -0
  129. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_check.py +0 -0
  130. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_compare.py +0 -0
  131. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_environment.py +0 -0
  132. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_gateway.py +0 -0
  133. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_grade.py +0 -0
  134. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_guards.py +0 -0
  135. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_harbor.py +0 -0
  136. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_judge.py +0 -0
  137. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_labels.py +0 -0
  138. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_lic.py +0 -0
  139. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_longmemeval.py +0 -0
  140. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_mrcr.py +0 -0
  141. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_repeats.py +0 -0
  142. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_report.py +0 -0
  143. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_rounds.py +0 -0
  144. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_stages.py +0 -0
  145. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_stats.py +0 -0
  146. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_tasks.py +0 -0
  147. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_evals_trajectory.py +0 -0
  148. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_extension_package.py +0 -0
  149. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_extension_reference.py +0 -0
  150. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_gateway_performance.py +0 -0
  151. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_goals.py +0 -0
  152. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_install.py +0 -0
  153. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_keybindings.py +0 -0
  154. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_live_check.py +0 -0
  155. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_live_view_checks.py +0 -0
  156. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_live_wait.py +0 -0
  157. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_local.py +0 -0
  158. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_method_typing.py +0 -0
  159. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_models.py +0 -0
  160. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_monitor_recipe.py +0 -0
  161. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_namespace.py +0 -0
  162. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_outside.py +0 -0
  163. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_private_file.py +0 -0
  164. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_providers.py +0 -0
  165. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_read_session.py +0 -0
  166. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_record_arguments.py +0 -0
  167. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_registration.py +0 -0
  168. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_repair_hooks.py +0 -0
  169. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_result_sequence.py +0 -0
  170. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_scoped_settings.py +0 -0
  171. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_sdk_guide.py +0 -0
  172. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_sdk_typing.py +0 -0
  173. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_shell_contract.py +0 -0
  174. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_shell_handle.py +0 -0
  175. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_shortcuts_live.py +0 -0
  176. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_sounds.py +0 -0
  177. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_speech.py +0 -0
  178. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_structured_live.py +0 -0
  179. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_symbol_contract.py +0 -0
  180. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_testing.py +0 -0
  181. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_text_list_arguments.py +0 -0
  182. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_tools.py +0 -0
  183. {vis_agent-0.5.20.dev9206 → vis_agent-0.5.21.dev9250}/tests/test_views.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: vis-agent
3
- Version: 0.5.20.dev9206
3
+ Version: 0.5.21.dev9250
4
4
  Summary: The Vis Python SDK — author extensions and control local or remote engines.
5
5
  Project-URL: Homepage, https://vis.blockether.com
6
6
  Project-URL: Documentation, https://vis.blockether.com
@@ -0,0 +1,207 @@
1
+ {
2
+ "input": {
3
+ "id": "input-one",
4
+ "title": "Name",
5
+ "nodes": [
6
+ {
7
+ "id": "name",
8
+ "name": "name",
9
+ "type": "plaintext",
10
+ "label": "Name",
11
+ "is_required": true
12
+ }
13
+ ],
14
+ "submit_label": "Submit",
15
+ "cancel_label": "Cancel",
16
+ "is_cancellable": true,
17
+ "timeout_ms": 30000,
18
+ "created_at": 1
19
+ },
20
+ "live": {
21
+ "id": "live-one",
22
+ "title": "Build",
23
+ "nodes": [
24
+ {
25
+ "id": "status",
26
+ "type": "status",
27
+ "text": "Building",
28
+ "tone": "running"
29
+ }
30
+ ],
31
+ "timeout_ms": 30000,
32
+ "channel_ids": [
33
+ "operator"
34
+ ],
35
+ "seq": 0,
36
+ "created_at": 1
37
+ },
38
+ "patch": {
39
+ "view_id": "live-one",
40
+ "seq": 1,
41
+ "ops": [
42
+ {
43
+ "op": "set",
44
+ "node_id": "status",
45
+ "text": "Done",
46
+ "tone": "ok"
47
+ }
48
+ ]
49
+ },
50
+ "answer": {
51
+ "is_submitted": true,
52
+ "reason": "submitted",
53
+ "request_id": "input-one",
54
+ "values": {
55
+ "name": "Ada"
56
+ }
57
+ },
58
+ "result": {
59
+ "view_id": "live-one",
60
+ "is_completed": true,
61
+ "reason": "completed",
62
+ "is_from_human": false,
63
+ "view": {
64
+ "title": "Build",
65
+ "nodes": [
66
+ {
67
+ "id": "status",
68
+ "type": "status",
69
+ "text": "Done",
70
+ "tone": "ok"
71
+ }
72
+ ]
73
+ },
74
+ "elided": []
75
+ },
76
+ "input_result": {
77
+ "reason": "submitted"
78
+ },
79
+ "delta": {
80
+ "base": "diff --git a/é.txt b/é.txt\n--- a/é.txt\n+++ b/é.txt\n@@ -1,2 +1,2 @@\n one 😀\n-two 😀\n+two 😁\n",
81
+ "target": "diff --git a/é.txt b/é.txt\n--- a/é.txt\n+++ b/é.txt\n@@ -1,2 +1,2 @@\n one 😀\n-two 😀\n+two 😂\n",
82
+ "frame": {
83
+ "first_seq": 2,
84
+ "patch": {
85
+ "view_id": "live-one",
86
+ "seq": 2,
87
+ "ops": [
88
+ {
89
+ "op": "set",
90
+ "node_id": "change",
91
+ "new_revision": "fff0002"
92
+ }
93
+ ]
94
+ },
95
+ "splices": [
96
+ {
97
+ "op_index": 0,
98
+ "key": "patch",
99
+ "base_hash": 1640763359,
100
+ "edits": [
101
+ {
102
+ "start": 88,
103
+ "delete": 2,
104
+ "insert": "😂"
105
+ }
106
+ ]
107
+ }
108
+ ]
109
+ }
110
+ },
111
+ "delta_fold": {
112
+ "view": {
113
+ "id": "live-one",
114
+ "seq": 1,
115
+ "nodes": [
116
+ {
117
+ "id": "change",
118
+ "type": "diff",
119
+ "patch": "diff --git a/é.txt b/é.txt\n--- a/é.txt\n+++ b/é.txt\n@@ -1,60 +1,60 @@\n+one 😁\n line 2 of the text\n line 3 of the text\n line 4 of the text\n line 5 of the text\n line 6 of the text\n line 7 of the text\n line 8 of the text\n line 9 of the text\n line 10 of the text\n line 11 of the text\n line 12 of the text\n line 13 of the text\n line 14 of the text\n line 15 of the text\n line 16 of the text\n line 17 of the text\n line 18 of the text\n line 19 of the text\n line 20 of the text\n line 21 of the text\n line 22 of the text\n line 23 of the text\n line 24 of the text\n line 25 of the text\n line 26 of the text\n line 27 of the text\n line 28 of the text\n line 29 of the text\n line 30 of the text\n line 31 of the text\n line 32 of the text\n line 33 of the text\n line 34 of the text\n line 35 of the text\n line 36 of the text\n line 37 of the text\n line 38 of the text\n line 39 of the text\n+forty 𝄞\n line 41 of the text\n line 42 of the text\n line 43 of the text\n line 44 of the text\n line 45 of the text\n line 46 of the text\n line 47 of the text\n line 48 of the text\n line 49 of the text\n line 50 of the text\n line 51 of the text\n line 52 of the text\n line 53 of the text\n line 54 of the text\n line 55 of the text\n line 56 of the text\n line 57 of the text\n line 58 of the text\n line 59 of the text\n line 60 of the text\n"
120
+ }
121
+ ]
122
+ },
123
+ "frame": {
124
+ "first_seq": 2,
125
+ "patch": {
126
+ "view_id": "live-one",
127
+ "seq": 2,
128
+ "ops": [
129
+ {
130
+ "op": "remove-node",
131
+ "node_id": "change"
132
+ },
133
+ {
134
+ "op": "add-node",
135
+ "node_spec": {
136
+ "id": "change",
137
+ "type": "diff",
138
+ "label": "Again"
139
+ }
140
+ },
141
+ {
142
+ "op": "set",
143
+ "node_id": "change",
144
+ "new_revision": "fff0003"
145
+ }
146
+ ]
147
+ },
148
+ "splices": [
149
+ {
150
+ "op_index": 1,
151
+ "key": "patch",
152
+ "base_hash": -1610968926,
153
+ "edits": [
154
+ {
155
+ "start": 74,
156
+ "delete": 2,
157
+ "insert": "😂"
158
+ },
159
+ {
160
+ "start": 876,
161
+ "delete": 0,
162
+ "insert": "𝄞"
163
+ }
164
+ ],
165
+ "node_id": "change"
166
+ },
167
+ {
168
+ "op_index": 2,
169
+ "key": "patch",
170
+ "base_hash": 2012309847,
171
+ "edits": [
172
+ {
173
+ "start": 1299,
174
+ "delete": 0,
175
+ "insert": "+the end\n"
176
+ }
177
+ ]
178
+ }
179
+ ]
180
+ },
181
+ "patch": {
182
+ "view_id": "live-one",
183
+ "seq": 2,
184
+ "ops": [
185
+ {
186
+ "op": "remove-node",
187
+ "node_id": "change"
188
+ },
189
+ {
190
+ "op": "add-node",
191
+ "node_spec": {
192
+ "id": "change",
193
+ "type": "diff",
194
+ "label": "Again",
195
+ "patch": "diff --git a/é.txt b/é.txt\n--- a/é.txt\n+++ b/é.txt\n@@ -1,60 +1,60 @@\n+one 😂\n line 2 of the text\n line 3 of the text\n line 4 of the text\n line 5 of the text\n line 6 of the text\n line 7 of the text\n line 8 of the text\n line 9 of the text\n line 10 of the text\n line 11 of the text\n line 12 of the text\n line 13 of the text\n line 14 of the text\n line 15 of the text\n line 16 of the text\n line 17 of the text\n line 18 of the text\n line 19 of the text\n line 20 of the text\n line 21 of the text\n line 22 of the text\n line 23 of the text\n line 24 of the text\n line 25 of the text\n line 26 of the text\n line 27 of the text\n line 28 of the text\n line 29 of the text\n line 30 of the text\n line 31 of the text\n line 32 of the text\n line 33 of the text\n line 34 of the text\n line 35 of the text\n line 36 of the text\n line 37 of the text\n line 38 of the text\n line 39 of the text\n+forty 𝄞𝄞\n line 41 of the text\n line 42 of the text\n line 43 of the text\n line 44 of the text\n line 45 of the text\n line 46 of the text\n line 47 of the text\n line 48 of the text\n line 49 of the text\n line 50 of the text\n line 51 of the text\n line 52 of the text\n line 53 of the text\n line 54 of the text\n line 55 of the text\n line 56 of the text\n line 57 of the text\n line 58 of the text\n line 59 of the text\n line 60 of the text\n"
196
+ }
197
+ },
198
+ {
199
+ "op": "set",
200
+ "node_id": "change",
201
+ "patch": "diff --git a/é.txt b/é.txt\n--- a/é.txt\n+++ b/é.txt\n@@ -1,60 +1,60 @@\n+one 😂\n line 2 of the text\n line 3 of the text\n line 4 of the text\n line 5 of the text\n line 6 of the text\n line 7 of the text\n line 8 of the text\n line 9 of the text\n line 10 of the text\n line 11 of the text\n line 12 of the text\n line 13 of the text\n line 14 of the text\n line 15 of the text\n line 16 of the text\n line 17 of the text\n line 18 of the text\n line 19 of the text\n line 20 of the text\n line 21 of the text\n line 22 of the text\n line 23 of the text\n line 24 of the text\n line 25 of the text\n line 26 of the text\n line 27 of the text\n line 28 of the text\n line 29 of the text\n line 30 of the text\n line 31 of the text\n line 32 of the text\n line 33 of the text\n line 34 of the text\n line 35 of the text\n line 36 of the text\n line 37 of the text\n line 38 of the text\n line 39 of the text\n+forty 𝄞𝄞\n line 41 of the text\n line 42 of the text\n line 43 of the text\n line 44 of the text\n line 45 of the text\n line 46 of the text\n line 47 of the text\n line 48 of the text\n line 49 of the text\n line 50 of the text\n line 51 of the text\n line 52 of the text\n line 53 of the text\n line 54 of the text\n line 55 of the text\n line 56 of the text\n line 57 of the text\n line 58 of the text\n line 59 of the text\n line 60 of the text\n+the end\n",
202
+ "new_revision": "fff0003"
203
+ }
204
+ ]
205
+ }
206
+ }
207
+ }
@@ -303,7 +303,15 @@
303
303
  "$ref": "common.json#/$defs/non_blank_string"
304
304
  },
305
305
  "view": {
306
- "$ref": "#/$defs/live_view"
306
+ "description": "The view. A stream that asked for `app_opens=summary` gets the summary of an app whose body holds more characters than `x-vis-elide-above-chars` of `patch_event`. A client that has the view at that `seq` keeps its body. Another client reads the app when it shows it.",
307
+ "oneOf": [
308
+ {
309
+ "$ref": "#/$defs/live_view"
310
+ },
311
+ {
312
+ "$ref": "#/$defs/live_view_summary"
313
+ }
314
+ ]
307
315
  }
308
316
  },
309
317
  "required": [
@@ -374,15 +382,155 @@
374
382
  },
375
383
  "patch": {
376
384
  "$ref": "#/$defs/live_patch"
385
+ },
386
+ "is_elided": {
387
+ "description": "True when the stream left out the patch of an app. Only a stream that asked for `app_patches=elided` gets such a frame, and only for a patch whose strings hold more characters than `x-vis-elide-above-chars`. The view changed: a client that shows it reads it again.",
388
+ "const": true
389
+ },
390
+ "last_seq": {
391
+ "description": "The seq of the view after an elided frame. A frame with a patch has it in the patch.",
392
+ "type": "integer",
393
+ "minimum": 0
377
394
  }
378
395
  },
379
396
  "required": [
380
397
  "kind",
381
398
  "view_id",
382
- "first_seq",
383
- "patch"
399
+ "first_seq"
400
+ ],
401
+ "oneOf": [
402
+ {
403
+ "required": [
404
+ "patch"
405
+ ]
406
+ },
407
+ {
408
+ "required": [
409
+ "is_elided",
410
+ "last_seq"
411
+ ]
412
+ }
413
+ ],
414
+ "x-vis-elide-above-chars": 16384
415
+ },
416
+ "string_edit": {
417
+ "description": "One change of a string. At `start`, `delete` UTF-16 code units of the base string go out and `insert` comes in. `start` counts in the base string.",
418
+ "type": "object",
419
+ "additionalProperties": false,
420
+ "properties": {
421
+ "start": {
422
+ "type": "integer",
423
+ "minimum": 0
424
+ },
425
+ "delete": {
426
+ "type": "integer",
427
+ "minimum": 0
428
+ },
429
+ "insert": {
430
+ "type": "string"
431
+ }
432
+ },
433
+ "required": [
434
+ "start",
435
+ "delete",
436
+ "insert"
384
437
  ]
385
438
  },
439
+ "patch_splice": {
440
+ "description": "A long string of one `set` or `add-node` operation, as edits of a base string. The operation comes without the key. The base is the string that the node has for the key before the operation. For a node that an earlier operation of the frame removed, the base is the string that the node had when the frame started.",
441
+ "type": "object",
442
+ "additionalProperties": false,
443
+ "properties": {
444
+ "op_index": {
445
+ "description": "The index of the operation in `ops`.",
446
+ "type": "integer",
447
+ "minimum": 0
448
+ },
449
+ "node_id": {
450
+ "description": "The node that has the key. In an `add-node` operation, it is `node_spec` or a node in its `children`. Absent: the node of the operation.",
451
+ "$ref": "common.json#/$defs/non_blank_string"
452
+ },
453
+ "key": {
454
+ "description": "The key of the node that the edits give.",
455
+ "$ref": "common.json#/$defs/non_blank_string"
456
+ },
457
+ "base_hash": {
458
+ "description": "The hash of the base string: `h = 31 * h + unit` for each UTF-16 code unit, kept as a signed 32-bit number. A client whose string has another hash reads the view.",
459
+ "type": "integer"
460
+ },
461
+ "edits": {
462
+ "description": "In ascending order of `start`, without overlap.",
463
+ "type": "array",
464
+ "items": {
465
+ "$ref": "#/$defs/string_edit"
466
+ }
467
+ }
468
+ },
469
+ "required": [
470
+ "op_index",
471
+ "key",
472
+ "base_hash",
473
+ "edits"
474
+ ]
475
+ },
476
+ "view_delta": {
477
+ "description": "One published frame of an app, as a read with `since` gives it. A string with more characters than `x-vis-splice-above-chars` comes as a `patch_splice` when the node had a string of that length before. The gateway keeps the newest frames of an app while their strings hold at most `x-vis-chars-kept` characters. It answers the whole view when the frames hold more characters than the view.",
478
+ "type": "object",
479
+ "additionalProperties": false,
480
+ "properties": {
481
+ "first_seq": {
482
+ "type": "integer",
483
+ "minimum": 0
484
+ },
485
+ "patch": {
486
+ "description": "A `live_patch`. An operation comes without each key that a splice gives.",
487
+ "type": "object",
488
+ "additionalProperties": false,
489
+ "properties": {
490
+ "view_id": {
491
+ "$ref": "common.json#/$defs/non_blank_string"
492
+ },
493
+ "seq": {
494
+ "type": "integer",
495
+ "minimum": 0
496
+ },
497
+ "ops": {
498
+ "type": "array",
499
+ "items": {
500
+ "type": "object",
501
+ "properties": {
502
+ "op": {
503
+ "$ref": "common.json#/$defs/non_blank_string"
504
+ }
505
+ },
506
+ "required": [
507
+ "op"
508
+ ]
509
+ },
510
+ "minItems": 1
511
+ }
512
+ },
513
+ "required": [
514
+ "view_id",
515
+ "seq",
516
+ "ops"
517
+ ]
518
+ },
519
+ "splices": {
520
+ "type": "array",
521
+ "items": {
522
+ "$ref": "#/$defs/patch_splice"
523
+ }
524
+ }
525
+ },
526
+ "required": [
527
+ "first_seq",
528
+ "patch",
529
+ "splices"
530
+ ],
531
+ "x-vis-splice-above-chars": 1024,
532
+ "x-vis-chars-kept": 262144
533
+ },
386
534
  "option": {
387
535
  "type": "object",
388
536
  "additionalProperties": false,
@@ -3034,6 +3182,22 @@
3034
3182
  "x-vis-max-nodes": 64,
3035
3183
  "x-vis-max-picture-bytes": 8388608
3036
3184
  },
3185
+ "live_view_summary": {
3186
+ "description": "An app in a list that asked for `summary=true`, or in a `view.open` event of a stream that asked for `app_opens=summary`: the live view of the app without its body. The properties with the schema `false` are the keys that a summary leaves out. Read the view to get them.",
3187
+ "type": "object",
3188
+ "properties": {
3189
+ "is_summary": {
3190
+ "const": true
3191
+ },
3192
+ "nodes": false,
3193
+ "log": false,
3194
+ "submissions": false,
3195
+ "agent_note": false
3196
+ },
3197
+ "required": [
3198
+ "is_summary"
3199
+ ]
3200
+ },
3037
3201
  "live_op": {
3038
3202
  "x-vis-patch-targets": {
3039
3203
  "description": "The node types that each node op takes, and the op keys that each node type takes in that op. The first key of an append is the collection of the node. Every host refuses an op outside this table with the op_target or op_key rule, before it applies the op.",
@@ -8,7 +8,7 @@ build-backend = "hatchling.build"
8
8
 
9
9
  [project]
10
10
  name = "vis-agent"
11
- version = "0.5.20.dev9206"
11
+ version = "0.5.21.dev9250"
12
12
  description = "The Vis Python SDK — author extensions and control local or remote engines."
13
13
  readme = "README.md"
14
14
  requires-python = ">=3.12"
@@ -0,0 +1 @@
1
+ beta-570fbad240c1c7f190efef9826e0b568164e8c4b
@@ -7,13 +7,16 @@ means that a submitted mutation was rolled back.
7
7
 
8
8
  from __future__ import annotations
9
9
 
10
+ import gzip
10
11
  import inspect
12
+ import ipaddress
11
13
  import json
12
14
  import math
13
15
  import re
14
16
  import threading
15
17
  import time
16
18
  import uuid
19
+ import zlib
17
20
  from abc import ABC, abstractmethod
18
21
  from collections.abc import Iterable, Mapping
19
22
  from dataclasses import dataclass, field
@@ -172,6 +175,51 @@ def _gateway_error(
172
175
  return GatewayError(status, code, **counts)
173
176
 
174
177
 
178
+ # A smaller JSON body costs more to compress than it saves.
179
+ _GZIP_MIN_BYTES = 1024
180
+
181
+
182
+ def _is_loopback(host: str) -> bool:
183
+ """Tell if a gateway host is this machine, where compression saves nothing."""
184
+ if host == "localhost":
185
+ return True
186
+ try:
187
+ return ipaddress.ip_address(host).is_loopback
188
+ except ValueError:
189
+ return False
190
+
191
+
192
+ def _inflated(content: bytes, limit: int) -> bytes:
193
+ """Give at most `limit` plain bytes of a gzip body that can be cut short."""
194
+ try:
195
+ return zlib.decompressobj(31).decompress(content, limit)
196
+ except zlib.error:
197
+ return b""
198
+
199
+
200
+ class _Inflated:
201
+ """One whole gzip answer, read as its plain bytes."""
202
+
203
+ def __init__(self, raw):
204
+ self._raw = raw
205
+ self.status = raw.status
206
+ self.headers = raw.headers
207
+ del self.headers["Content-Encoding"]
208
+ del self.headers["Content-Length"]
209
+
210
+ def __enter__(self):
211
+ return self
212
+
213
+ def __exit__(self, *args):
214
+ self._raw.close()
215
+
216
+ def read(self) -> bytes:
217
+ try:
218
+ return gzip.decompress(self._raw.read())
219
+ except (EOFError, zlib.error):
220
+ raise OSError("gzip answer cut short") from None
221
+
222
+
175
223
  def _duration(value: float) -> float:
176
224
  if not math.isfinite(value) or value <= 0:
177
225
  raise ValueError("timeout must be positive and finite")
@@ -389,6 +437,10 @@ class ExecutionLayer(ABC):
389
437
  ) -> Any:
390
438
  """Run one transport exchange. Do not retry mutations."""
391
439
 
440
+ def _open_whole(self, method, route, **options) -> Any:
441
+ """Run one exchange whose answer the caller reads whole, not as a stream."""
442
+ return self._open(method, route, **options)
443
+
392
444
  def _ensure_client_lease(self, *, pid: int | None = None) -> str:
393
445
  if self._closed:
394
446
  raise TransportError("client is closed")
@@ -472,7 +524,7 @@ class ExecutionLayer(ABC):
472
524
  _segment(path[s[1:]]) if s.startswith(":") else s for s in route.split("/")
473
525
  )
474
526
  try:
475
- with self._open(
527
+ with self._open_whole(
476
528
  method.upper(),
477
529
  resolved,
478
530
  query=query,
@@ -3563,10 +3615,11 @@ class GatewayClient(ExecutionLayer):
3563
3615
 
3564
3616
  The project path is absolute and belongs to the gateway machine, not this
3565
3617
  Python process. TLS certificate verification is enabled. Redirects are
3566
- refused, so credentials cannot follow them to another origin. Each instance
3567
- and its session handles use one calling thread. HTTP failures raise
3568
- `GatewayError`. Connection, deadline and protocol failures use the
3569
- `TransportError` exception family.
3618
+ refused, so credentials cannot follow them to another origin. With a gateway
3619
+ on another machine, whole answers and large JSON bodies travel compressed
3620
+ with gzip. Event streams stay plain. Each instance and its session handles
3621
+ use one calling thread. HTTP failures raise `GatewayError`. Connection,
3622
+ deadline and protocol failures use the `TransportError` exception family.
3570
3623
  """
3571
3624
 
3572
3625
  def __init__(self, url: str, *, token: str | None = None, timeout: float = 30):
@@ -3595,6 +3648,10 @@ class GatewayClient(ExecutionLayer):
3595
3648
  # The lease that an answer named as unknown, until a new lease replaces it.
3596
3649
  self._lease_lost: str | None = None
3597
3650
  self._lease_seen = 0.0
3651
+ # Compression pays only over a network. A loopback exchange stays plain.
3652
+ self._is_remote = not _is_loopback(parts.hostname)
3653
+ # True after an answer says that this gateway inflates gzip request bodies.
3654
+ self._inflates = False
3598
3655
  self._opener = build_opener(_NoRedirect())
3599
3656
 
3600
3657
  def _open(
@@ -3608,6 +3665,7 @@ class GatewayClient(ExecutionLayer):
3608
3665
  timeout=None,
3609
3666
  upload_sha256=None,
3610
3667
  upload_length=None,
3668
+ is_whole=False,
3611
3669
  ):
3612
3670
  if self._closed:
3613
3671
  raise TransportError("client is closed")
@@ -3629,6 +3687,12 @@ class GatewayClient(ExecutionLayer):
3629
3687
  raise ValueError("body and content are mutually exclusive")
3630
3688
  content = json.dumps(body, allow_nan=False).encode()
3631
3689
  headers["Content-Type"] = "application/json"
3690
+ if self._is_remote and self._inflates and len(content) >= _GZIP_MIN_BYTES:
3691
+ content = gzip.compress(content, 6, mtime=0)
3692
+ headers["Content-Encoding"] = "gzip"
3693
+ # A stream stays plain: each event must arrive when the gateway writes it.
3694
+ if is_whole and self._is_remote:
3695
+ headers["Accept-Encoding"] = "gzip"
3632
3696
  if upload_sha256 is not None:
3633
3697
  headers["Content-Type"] = "application/zip"
3634
3698
  headers["Transfer-Encoding"] = "chunked"
@@ -3646,7 +3710,11 @@ class GatewayClient(ExecutionLayer):
3646
3710
  except HTTPError as exc:
3647
3711
  with exc:
3648
3712
  self._note_lease(lease, exc, is_answered=False)
3649
- raise _gateway_error(exc.code, exc.read(65536), self._token) from None
3713
+ self._note_codings(exc)
3714
+ detail = exc.read(65536)
3715
+ if exc.headers.get("Content-Encoding") == "gzip":
3716
+ detail = _inflated(detail, 65536)
3717
+ raise _gateway_error(exc.code, detail, self._token) from None
3650
3718
  except TimeoutError:
3651
3719
  raise VisTimeout("gateway request timed out") from None
3652
3720
  except (URLError, OSError) as exc:
@@ -3654,8 +3722,20 @@ class GatewayClient(ExecutionLayer):
3654
3722
  raise VisTimeout("gateway request timed out") from None
3655
3723
  raise TransportError("gateway connection failed") from None
3656
3724
  self._note_lease(lease, raw, is_answered=True)
3725
+ self._note_codings(raw)
3657
3726
  return raw
3658
3727
 
3728
+ def _open_whole(self, method, route, **options):
3729
+ raw = self._open(method, route, is_whole=True, **options)
3730
+ if raw.headers.get("Content-Encoding") == "gzip":
3731
+ return _Inflated(raw)
3732
+ return raw
3733
+
3734
+ def _note_codings(self, answer):
3735
+ """Record that an answer says the gateway inflates gzip request bodies."""
3736
+ if "gzip" in (answer.headers.get("Accept-Encoding") or "").lower():
3737
+ self._inflates = True
3738
+
3659
3739
  def _note_lease(self, sent, answer, *, is_answered):
3660
3740
  """Record what one gateway answer says about the lease that it carried."""
3661
3741
  headers = getattr(answer, "headers", None)
@@ -6164,11 +6164,12 @@ class LiveView:
6164
6164
  continue
6165
6165
  self._parents[str(node_id)] = parent
6166
6166
  children = node.get("children")
6167
- if isinstance(children, list):
6168
- self._index(children, str(node_id))
6169
- else:
6167
+ # The toolbar of a diff is in `children` too, and the diff takes ops.
6168
+ if node.get("type") != "group" or not isinstance(children, list):
6170
6169
  self._nodes[str(node_id)] = str(node.get("type") or "plaintext")
6171
6170
  self._order.append(str(node_id))
6171
+ if isinstance(children, list):
6172
+ self._index(children, str(node_id))
6172
6173
 
6173
6174
  def _refuse_closed(self):
6174
6175
  raise Interrupted(self.view_id, self.reason, self.note)
@@ -6225,9 +6226,13 @@ class LiveView:
6225
6226
  """Fold this op into the last one addressing the same node, if it folds.
6226
6227
 
6227
6228
  Only the LAST op for that node is a candidate, so nothing reorders past
6228
- a `clear` or a `remove` that stands between them.
6229
+ a `clear` or a `remove` that stands between them. An `add-node` or a
6230
+ `remove-node` ends the search: it can drop the node with its group and
6231
+ add it again.
6229
6232
  """
6230
6233
  for earlier in reversed(self._buffer):
6234
+ if earlier["op"] in ("add-node", "remove-node"):
6235
+ break
6231
6236
  if earlier.get("node_id") != op.get("node_id"):
6232
6237
  continue
6233
6238
  if earlier["op"] == op["op"] and op["op"] in ("set", "set-value"):
@@ -197,6 +197,21 @@ def test_attach_opens_one_app_and_answers_its_handle(host):
197
197
  assert repr(app) == "<vis app 'app-1' open>"
198
198
 
199
199
 
200
+ def test_a_diff_with_a_toolbar_keeps_its_handle(host):
201
+ # The toolbar is in `children`, as the nodes of a group are. The diff takes ops.
202
+ toolbar = [vis.ui.button("refresh", "Refresh")]
203
+ app = vis.attach(
204
+ vis.ui.app("Review", vis.ui.diff("change", PATCH, children=toolbar))
205
+ )
206
+ app.node("change").set(PATCH + "+z = 4\n")
207
+ app.flush()
208
+ (sent,) = host.ops("patch")
209
+ assert sent["patch"]["ops"] == [
210
+ {"op": "set", "node_id": "change", "patch": PATCH + "+z = 4\n"}
211
+ ]
212
+ assert "refresh" in app
213
+
214
+
200
215
  def test_reply_sends_only_the_given_keys(host):
201
216
  app = vis.attach(vis.ui.app("Review", vis.ui.diff("change", PATCH)))
202
217
  answer = app.reply(