graphcore-kernel 0.1.0__tar.gz → 0.2.0__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 (349) hide show
  1. {graphcore_kernel-0.1.0/graphcore_kernel.egg-info → graphcore_kernel-0.2.0}/PKG-INFO +1 -1
  2. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/__init__.py +2 -2
  3. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/api.py +9 -1
  4. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/base/__init__.py +2 -2
  5. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/base/views.py +4 -9
  6. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/context.py +7 -1
  7. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/render.py +8 -2
  8. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/server.py +23 -7
  9. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/testing.py +2 -1
  10. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/tests/test_frontend.py +71 -9
  11. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/tests/test_server.py +55 -2
  12. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/tools.py +29 -9
  13. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/AGENT_FRONTEND_TDD.md +23 -7
  14. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/STRATEGY_EXECUTION_TDD.md +34 -1
  15. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/BaseStrategy.py +12 -0
  16. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/RequestTemplateStrategies.py +17 -5
  17. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/StrategyExecutorService.py +24 -0
  18. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/support.py +17 -1
  19. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/test_executor.py +26 -2
  20. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/app_discovery.py +72 -14
  21. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/discovery.py +6 -1
  22. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/test_import_package.py +12 -0
  23. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/tests/test_ticks.py +20 -1
  24. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/case.py +3 -1
  25. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/public_api_manifest.py +2 -2
  26. graphcore_kernel-0.2.0/graphcore/tests/test_app_discovery.py +162 -0
  27. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_composition_boundaries.py +3 -0
  28. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/agent_asgi.py +10 -2
  29. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0/graphcore_kernel.egg-info}/PKG-INFO +1 -1
  30. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/pyproject.toml +1 -1
  31. graphcore_kernel-0.1.0/graphcore/tests/test_app_discovery.py +0 -90
  32. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/LICENSE +0 -0
  33. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/NOTICE +0 -0
  34. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/README.md +0 -0
  35. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/__init__.py +0 -0
  36. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/client.py +0 -0
  37. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/errors.py +0 -0
  38. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/loading.py +0 -0
  39. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/registry.py +0 -0
  40. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/signatures.py +0 -0
  41. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/tests/__init__.py +0 -0
  42. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/tests/fakes.py +0 -0
  43. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/tests/test_loading.py +0 -0
  44. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/__init__.py +0 -0
  45. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/graph_api.py +0 -0
  46. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/predicate_codec.py +0 -0
  47. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/tests/__init__.py +0 -0
  48. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/tests/test_changed_entities.py +0 -0
  49. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/tests/test_graph_api.py +0 -0
  50. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/tests/test_graph_api_access.py +0 -0
  51. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/tests/test_graph_api_grants.py +0 -0
  52. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/tests/test_predicate_codec.py +0 -0
  53. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/tests/test_subtree_query.py +0 -0
  54. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/apps.py +0 -0
  55. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/__init__.py +0 -0
  56. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/README.md +0 -0
  57. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/__init__.py +0 -0
  58. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/authenticator.py +0 -0
  59. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/onboarding.py +0 -0
  60. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/principals.py +0 -0
  61. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/resource_metadata.py +0 -0
  62. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/service_accounts.py +0 -0
  63. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/testing.py +0 -0
  64. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/tests/__init__.py +0 -0
  65. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/tests/test_authenticator.py +0 -0
  66. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/tests/test_onboarding.py +0 -0
  67. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/tests/test_service_accounts.py +0 -0
  68. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/users.py +0 -0
  69. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/__init__.py +0 -0
  70. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/access_port.py +0 -0
  71. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/adapter/__init__.py +0 -0
  72. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/adapter/default_access_adapter.py +0 -0
  73. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/adapter/tests/__init__.py +0 -0
  74. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/adapter/tests/test_default_adapter.py +0 -0
  75. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/adapter/tests/test_entity_write_hooks.py +0 -0
  76. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/adapter/tests/test_group_types.py +0 -0
  77. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/adapter/tests/test_sync_support.py +0 -0
  78. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/defaults.py +0 -0
  79. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/kernel_policy.py +0 -0
  80. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/kernel_writes.py +0 -0
  81. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/lookups.py +0 -0
  82. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/policy.py +0 -0
  83. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/__init__.py +0 -0
  84. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_can_contain.py +0 -0
  85. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_contained_by.py +0 -0
  86. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_creation.py +0 -0
  87. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_delete_permission.py +0 -0
  88. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_granted_to_me.py +0 -0
  89. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_integration.py +0 -0
  90. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_invites.py +0 -0
  91. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_kernel_policy.py +0 -0
  92. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_lockout.py +0 -0
  93. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_policy.py +0 -0
  94. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_primitives.py +0 -0
  95. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_principal_creation.py +0 -0
  96. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/bootstrap/__init__.py +0 -0
  97. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/bootstrap/deployment.py +0 -0
  98. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/bootstrap/signals.py +0 -0
  99. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/bootstrap/tests/__init__.py +0 -0
  100. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/bootstrap/tests/test_deployment_seed.py +0 -0
  101. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/broadcast/__init__.py +0 -0
  102. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/broadcast/broadcaster.py +0 -0
  103. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/broadcast/channels.py +0 -0
  104. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/broadcast/tests/__init__.py +0 -0
  105. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/broadcast/tests/test_broadcaster.py +0 -0
  106. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/celery.py +0 -0
  107. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/ARCHITECTURE_PRINCIPLES.md +0 -0
  108. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/AUTHORIZATION_TECHNICAL_TDD.md +0 -0
  109. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/ENTITY_REFERENCE_TDD.md +0 -0
  110. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/GRAPHAPI_FRONT_DOOR.md +0 -0
  111. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/RUNTIME.md +0 -0
  112. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/SCHEDULING_TDD.md +0 -0
  113. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/VIEW_ENTITY_TDD.md +0 -0
  114. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/VIEW_SYSTEM_TDD.md +0 -0
  115. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/__init__.py +0 -0
  116. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/doc_topics.py +0 -0
  117. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/docs_discovery.py +0 -0
  118. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/public_api.py +0 -0
  119. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/__init__.py +0 -0
  120. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/Entity.py +0 -0
  121. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/__init__.py +0 -0
  122. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/deployment/Deployment.py +0 -0
  123. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/deployment/__init__.py +0 -0
  124. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/grant/Grant.py +0 -0
  125. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/grant/__init__.py +0 -0
  126. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/group/Group.py +0 -0
  127. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/group/README.md +0 -0
  128. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/group/__init__.py +0 -0
  129. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/invite/Invite.py +0 -0
  130. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/invite/__init__.py +0 -0
  131. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/request_template/RequestTemplate.py +0 -0
  132. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/request_template/__init__.py +0 -0
  133. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/request_template/tests/__init__.py +0 -0
  134. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/request_template/tests/test_request_template.py +0 -0
  135. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/service_account/ServiceAccount.py +0 -0
  136. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/service_account/__init__.py +0 -0
  137. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/strategy_request/StrategyRequest.py +0 -0
  138. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/strategy_request/__init__.py +0 -0
  139. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/strategy_request/tests/__init__.py +0 -0
  140. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/strategy_request/tests/test_strategy_request_entity.py +0 -0
  141. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/tests/__init__.py +0 -0
  142. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/tests/test_entity.py +0 -0
  143. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/tests/test_grant_group_entities.py +0 -0
  144. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/tests/test_write_once_fields.py +0 -0
  145. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/user/User.py +0 -0
  146. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/user/__init__.py +0 -0
  147. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/user/tests/__init__.py +0 -0
  148. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/user/tests/test_user_entity.py +0 -0
  149. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/view/View.py +0 -0
  150. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/view/__init__.py +0 -0
  151. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/view/position.py +0 -0
  152. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/view/tests/__init__.py +0 -0
  153. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/view/tests/test_position.py +0 -0
  154. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/view/tests/test_view_entity.py +0 -0
  155. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/DeploymentStrategies.py +0 -0
  156. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/GrantStrategies.py +0 -0
  157. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/GroupStrategies.py +0 -0
  158. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/InviteStrategies.py +0 -0
  159. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/ViewStrategies.py +0 -0
  160. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/__init__.py +0 -0
  161. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/runner.py +0 -0
  162. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/session.py +0 -0
  163. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/BaseStrategyTest.py +0 -0
  164. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/__init__.py +0 -0
  165. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/test_BaseStrategies.py +0 -0
  166. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/test_grant_strategies.py +0 -0
  167. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/test_group_strategies.py +0 -0
  168. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/test_runner.py +0 -0
  169. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/test_strategy_locks.py +0 -0
  170. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/test_utils.py +0 -0
  171. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/test_view_strategies.py +0 -0
  172. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/errors.py +0 -0
  173. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/README.md +0 -0
  174. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/__init__.py +0 -0
  175. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/dispatcher.py +0 -0
  176. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/environments/__init__.py +0 -0
  177. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/environments/celery.py +0 -0
  178. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/environments/in_process.py +0 -0
  179. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/local_session.py +0 -0
  180. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/redis_run_events.py +0 -0
  181. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/requests.py +0 -0
  182. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/run_events.py +0 -0
  183. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/strategy_context.py +0 -0
  184. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tasks.py +0 -0
  185. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/__init__.py +0 -0
  186. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/contract.py +0 -0
  187. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/test_dispatchers.py +0 -0
  188. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/test_local_session.py +0 -0
  189. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/test_reconcile_runs.py +0 -0
  190. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/test_run_events.py +0 -0
  191. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/test_strategy_context.py +0 -0
  192. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/gateway/__init__.py +0 -0
  193. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/gateway/remote.py +0 -0
  194. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/gateway/tests/__init__.py +0 -0
  195. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/gateway/tests/test_remote.py +0 -0
  196. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/EntityService.py +0 -0
  197. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/__init__.py +0 -0
  198. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/entity_cache.py +0 -0
  199. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/__init__.py +0 -0
  200. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_EntityService.py +0 -0
  201. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_EntityService_list.py +0 -0
  202. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_EntityService_model_resolution.py +0 -0
  203. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_EntityService_referrers.py +0 -0
  204. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_EntityService_routing.py +0 -0
  205. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_dependent_on.py +0 -0
  206. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_engine_is_type_agnostic.py +0 -0
  207. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_engine_resolves_read_permission.py +0 -0
  208. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_entity_cache.py +0 -0
  209. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_null_entity_cache.py +0 -0
  210. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/__init__.py +0 -0
  211. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/commands/__init__.py +0 -0
  212. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/commands/dev_reset.py +0 -0
  213. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/commands/graphcore_createadmin.py +0 -0
  214. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/commands/graphcore_policy.py +0 -0
  215. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/commands/graphcore_status.py +0 -0
  216. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/tests/__init__.py +0 -0
  217. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/tests/test_createadmin.py +0 -0
  218. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/tests/test_policy_command.py +0 -0
  219. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/tests/test_status_command.py +0 -0
  220. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/migrations/0001_initial.py +0 -0
  221. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/migrations/0002_invite.py +0 -0
  222. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/migrations/__init__.py +0 -0
  223. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/models.py +0 -0
  224. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/ENTITY_REPOSITORY_TECHNICAL_TDD.md +0 -0
  225. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/__init__.py +0 -0
  226. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/__init__.py +0 -0
  227. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/backends.py +0 -0
  228. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/bindings.py +0 -0
  229. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/cache.py +0 -0
  230. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/compiler.py +0 -0
  231. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/identity.py +0 -0
  232. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/models.py +0 -0
  233. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/repository.py +0 -0
  234. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/tests/__init__.py +0 -0
  235. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/tests/test_backends.py +0 -0
  236. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/tests/test_compiler.py +0 -0
  237. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/tests/test_repository.py +0 -0
  238. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/tests/test_shared_column.py +0 -0
  239. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/tests/test_threads.py +0 -0
  240. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/tests/test_update_shape.py +0 -0
  241. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/threads.py +0 -0
  242. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/repository.py +0 -0
  243. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/tests/__init__.py +0 -0
  244. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/tests/contract.py +0 -0
  245. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/tests/evaluate.py +0 -0
  246. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/tests/fixtures.py +0 -0
  247. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/tests/memory.py +0 -0
  248. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/tests/test_memory_repository.py +0 -0
  249. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/tests/test_query_types.py +0 -0
  250. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/__init__.py +0 -0
  251. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/api.py +0 -0
  252. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/apps.py +0 -0
  253. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/auth/__init__.py +0 -0
  254. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/auth/grants.py +0 -0
  255. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/auth/onboarding.py +0 -0
  256. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/auth/perms.py +0 -0
  257. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/auth/policy.py +0 -0
  258. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/auth/roles.py +0 -0
  259. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/auth/subjects.py +0 -0
  260. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/entities/__init__.py +0 -0
  261. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/errors.py +0 -0
  262. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/persistence/__init__.py +0 -0
  263. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/persistence/django.py +0 -0
  264. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/scheduling.py +0 -0
  265. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/strategies/__init__.py +0 -0
  266. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/test_settings.py +0 -0
  267. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/testing.py +0 -0
  268. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/EntityDirectory.py +0 -0
  269. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/README.md +0 -0
  270. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/StrategyDirectory.py +0 -0
  271. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/TYPE_METADATA_PLACEMENT.md +0 -0
  272. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/__init__.py +0 -0
  273. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/decorators.py +0 -0
  274. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/registry.py +0 -0
  275. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/__init__.py +0 -0
  276. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/test_agent_frontend_discovery.py +0 -0
  277. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/test_app_config.py +0 -0
  278. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/test_discovery.py +0 -0
  279. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/test_entity_directory_storage.py +0 -0
  280. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/test_principal_flag.py +0 -0
  281. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/test_strategy_directory.py +0 -0
  282. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/routes/__init__.py +0 -0
  283. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/routes/tests/__init__.py +0 -0
  284. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/routes/tests/test_routes.py +0 -0
  285. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/runtime.py +0 -0
  286. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/__init__.py +0 -0
  287. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/beat_scheduler.py +0 -0
  288. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/beat_tasks.py +0 -0
  289. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/scheduler.py +0 -0
  290. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/tests/__init__.py +0 -0
  291. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/tests/contract.py +0 -0
  292. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/tests/memory.py +0 -0
  293. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/tests/test_beat_scheduler.py +0 -0
  294. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/tests/test_memory_scheduler.py +0 -0
  295. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tasks.py +0 -0
  296. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/test_settings.py +0 -0
  297. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/__init__.py +0 -0
  298. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/runner.py +0 -0
  299. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/settings.py +0 -0
  300. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/tests/__init__.py +0 -0
  301. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/tests/agent_view_fixture.py +0 -0
  302. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/tests/test_case_and_runner.py +0 -0
  303. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/tests/test_settings_for_apps.py +0 -0
  304. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/__init__.py +0 -0
  305. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/ids.py +0 -0
  306. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/runs.py +0 -0
  307. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_docs_discovery.py +0 -0
  308. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_no_print.py +0 -0
  309. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_packaging.py +0 -0
  310. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_public_api_boundaries.py +0 -0
  311. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_public_api_contract.py +0 -0
  312. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_public_api_docs.py +0 -0
  313. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_runtime.py +0 -0
  314. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_shared_type_boundaries.py +0 -0
  315. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_shared_types.py +0 -0
  316. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_test_settings.py +0 -0
  317. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/__init__.py +0 -0
  318. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/agent_client.py +0 -0
  319. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/channel_layer.py +0 -0
  320. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/consumers.py +0 -0
  321. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/routing.py +0 -0
  322. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/tests/__init__.py +0 -0
  323. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/tests/test_agent_client.py +0 -0
  324. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/tests/test_api_views.py +0 -0
  325. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/tests/test_channel_layer.py +0 -0
  326. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/tests/test_consumers.py +0 -0
  327. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/tests/test_resource_metadata.py +0 -0
  328. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/urls.py +0 -0
  329. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/views.py +0 -0
  330. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/__init__.py +0 -0
  331. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/access.py +0 -0
  332. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/api.py +0 -0
  333. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/entities.py +0 -0
  334. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/entity_id.py +0 -0
  335. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/execution.py +0 -0
  336. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/identity.py +0 -0
  337. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/onboarding.py +0 -0
  338. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/query.py +0 -0
  339. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/schedules.py +0 -0
  340. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/strategy.py +0 -0
  341. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/tests/__init__.py +0 -0
  342. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/tests/test_entity_id.py +0 -0
  343. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/urls.py +0 -0
  344. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore_kernel.egg-info/SOURCES.txt +0 -0
  345. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore_kernel.egg-info/dependency_links.txt +0 -0
  346. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore_kernel.egg-info/entry_points.txt +0 -0
  347. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore_kernel.egg-info/requires.txt +0 -0
  348. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore_kernel.egg-info/top_level.txt +0 -0
  349. {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: graphcore-kernel
3
- Version: 0.1.0
3
+ Version: 0.2.0
4
4
  Summary: GraphCore platform kernel (entities, strategies, transport, auth)
5
5
  Author: GraphCore
6
6
  License-Expression: Apache-2.0
@@ -1,8 +1,8 @@
1
- from graphcore.agent_frontend.api import AgentView, ToolSpec, agent_view, operation, strategy_tool
1
+ from graphcore.agent_frontend.api import AgentView, Image, ToolSpec, agent_view, operation, strategy_tool
2
2
  from graphcore.agent_frontend.context import Context
3
3
  from graphcore.agent_frontend.errors import AgentError, RenderTooLarge
4
4
 
5
5
  __all__ = [
6
- 'AgentError', 'AgentView', 'Context', 'RenderTooLarge', 'ToolSpec',
6
+ 'AgentError', 'AgentView', 'Context', 'Image', 'RenderTooLarge', 'ToolSpec',
7
7
  'agent_view', 'operation', 'strategy_tool',
8
8
  ]
@@ -35,8 +35,16 @@ def strategy_tool(
35
35
  )
36
36
 
37
37
 
38
+ @dataclass(frozen=True)
39
+ class Image:
40
+ """An image an operation returns for the agent to look at: its encoded bytes and media type."""
41
+ data: bytes
42
+ media_type: str
43
+
44
+
38
45
  def operation(name: str, description: str, schema: dict) -> Callable[[Callable], ToolSpec]:
39
- """A view tool that is code: `async def fn(ctx, **params)`."""
46
+ """A view tool that is code: `async def fn(ctx, **params)`. It returns JSON values, an
47
+ `Image`, or a list mixing the two."""
40
48
  def wrap(fn: Callable) -> ToolSpec:
41
49
  return ToolSpec(name=name, description=description, schema=schema, fn=fn, takes_target=False)
42
50
  return wrap
@@ -2,10 +2,10 @@
2
2
  the same `default_for` type, replaces the one here, and may reuse these parts."""
3
3
  from graphcore.agent_frontend.base.views import (
4
4
  children_section, deployment_tools, entity_fields, entity_summary, entity_view, grouped,
5
- home_view, places, type_tools, view_tools, view_view,
5
+ home_view, routes_section, type_tools, view_tools, view_view,
6
6
  )
7
7
 
8
8
  __all__ = [
9
9
  'children_section', 'deployment_tools', 'entity_fields', 'entity_summary', 'entity_view',
10
- 'grouped', 'home_view', 'places', 'type_tools', 'view_tools', 'view_view',
10
+ 'grouped', 'home_view', 'routes_section', 'type_tools', 'view_tools', 'view_view',
11
11
  ]
@@ -101,20 +101,15 @@ async def deployment_tools(ctx: Context, entity: Optional[Any] = None) -> list[T
101
101
  return [strategy_tool(s['name'], takes_target=False) for s in ctx.deployment_strategies()]
102
102
 
103
103
 
104
- def places(ctx: Context) -> list:
105
- """`## Places` and a compact placement per route other than `/` that needs no entity."""
104
+ def routes_section(ctx: Context) -> list:
105
+ """`## Routes` and a compact placement per route other than `/` that needs no entity."""
106
106
  paths = [r['pattern'] for r in ctx.routes() if r['pattern'] != '/' and '{' not in r['pattern']]
107
- return ['## Places', *(ctx.place(path) for path in paths)] if paths else []
107
+ return ['## Routes', *(ctx.place(path) for path in paths)] if paths else []
108
108
 
109
109
 
110
110
  @agent_view('home', tools=deployment_tools)
111
111
  async def home_view(ctx: Context) -> list:
112
- top_level = await ctx.find(frozenset(ctx.entity_types()), where={'parent_id': None})
113
- return [
114
- *places(ctx),
115
- "## Top-level entities\nOpen one to see what it contains.",
116
- *grouped(ctx, top_level),
117
- ]
112
+ return routes_section(ctx)
118
113
 
119
114
 
120
115
  @agent_view('entity', tools=type_tools)
@@ -54,7 +54,7 @@ class Reads:
54
54
  class Context:
55
55
  def __init__(
56
56
  self, principal: Principal, address: str, entity: Any, client: GraphClient, reads: Reads,
57
- registry: Optional[AgentRegistry] = None, query_max: int = DEFAULT_QUERY_MAX,
57
+ registry: Optional[AgentRegistry] = None, query_max: int = DEFAULT_QUERY_MAX, web_base: str = '',
58
58
  ):
59
59
  self.principal = principal
60
60
  self.address = address
@@ -66,6 +66,7 @@ class Context:
66
66
  self._reads = reads
67
67
  self._registry = registry
68
68
  self._query_max = query_max
69
+ self._web_base = web_base
69
70
 
70
71
  def _record(self, entity: Any) -> None:
71
72
  self._reads.seen[entity.entity_id] = f"v{entity.version}"
@@ -129,6 +130,11 @@ class Context:
129
130
  self.more = cursor is not None
130
131
  return found
131
132
 
133
+ def web_url(self, target: str) -> Optional[str]:
134
+ """The web app's URL for an address or entity id: `GRAPHCORE_WEB_URL` plus its
135
+ address, or None when the deployment sets no web URL."""
136
+ return self._web_base + to_address(target) if self._web_base else None
137
+
132
138
  def view(self, name: str) -> Optional[AgentView]:
133
139
  """The agent view registered as `name`: an app's, else the base one."""
134
140
  return self._registry.by_name(name) if self._registry and name else None
@@ -23,6 +23,11 @@ class Frontend:
23
23
  registry: AgentRegistry
24
24
  max_chars: int = int(os.environ.get('GRAPHCORE_AGENT_RENDER_MAX_CHARS', DEFAULT_MAX_CHARS))
25
25
  query_max: int = int(os.environ.get('GRAPHCORE_AGENT_QUERY_MAX', DEFAULT_QUERY_MAX))
26
+ # The web app's URL with its base path (`GRAPHCORE_WEB_URL`); empty when there is none.
27
+ web_url: str = ''
28
+
29
+ def __post_init__(self) -> None:
30
+ self.web_url = self.web_url.rstrip('/')
26
31
 
27
32
 
28
33
  @dataclass
@@ -177,7 +182,7 @@ async def _render_body(
177
182
  resolved = fe.client.resolve(address)
178
183
  except NotFound:
179
184
  raise AgentError('NotFound', f"no route matches {address!r}; start from open('/')")
180
- ctx = Context(principal, address, None, fe.client, reads, fe.registry, fe.query_max)
185
+ ctx = Context(principal, address, None, fe.client, reads, fe.registry, fe.query_max, fe.web_url)
181
186
  view, entity = await _choose(fe, ctx, resolved['view_name'], resolved['entity_id'])
182
187
  ctx.entity = entity
183
188
  result = await (view.fn(ctx, entity) if entity is not None else view.fn(ctx))
@@ -196,7 +201,8 @@ async def render(fe: Frontend, principal: Principal, address: str) -> Rendered:
196
201
  reads = Reads()
197
202
  body = await _render_body(fe, principal, address, reads, with_tools=True)
198
203
  version = reads.version()
199
- out = [f"# {body.title}", f"address: {address} · version: {version}"]
204
+ web = f"web: {fe.web_url}{address} · " if fe.web_url else ''
205
+ out = [f"# {body.title}", f"address: {address} · {web}version: {version}"]
200
206
  if body.text:
201
207
  out.append('\n' + body.text)
202
208
  if body.tools:
@@ -1,11 +1,13 @@
1
1
  """The MCP endpoint: four fixed tools over a `Frontend`, stateless, bearer-authenticated."""
2
2
  from __future__ import annotations
3
3
 
4
- from typing import Any, Callable, Optional, Sequence
4
+ import base64
5
+ from typing import Annotated, Any, Callable, Optional, Sequence
5
6
 
6
7
  from mcp.server.mcpserver import Context, MCPServer
7
8
  from mcp.server.mcpserver.exceptions import ToolError
8
9
  from mcp.server.transport_security import TransportSecuritySettings
10
+ from mcp_types import CallToolResult, ImageContent, TextContent
9
11
  from starlette.middleware.cors import CORSMiddleware
10
12
  from starlette.responses import JSONResponse
11
13
 
@@ -25,6 +27,10 @@ Every place is a Markdown page: its content, its address, a version, and a Tools
25
27
  - act(strategy, target, params): run a strategy directly when no place lists it as a tool.
26
28
  Reads and writes run as the user whose token you connected with.
27
29
  """
30
+ WEB_INSTRUCTIONS = """\
31
+ A place's `web:` link opens the same place in the web app. Give it to the user when
32
+ they need to do something there.
33
+ """
28
34
 
29
35
 
30
36
  def _principal(ctx: Context):
@@ -62,11 +68,12 @@ class _BearerAuth:
62
68
 
63
69
  def create_app(
64
70
  client: GraphClient, registry: AgentRegistry, path: str = '/mcp', allowed_origins: Sequence[str] = (),
65
- challenge: Callable[[dict], str] = lambda scope: 'Bearer',
71
+ challenge: Callable[[dict], str] = lambda scope: 'Bearer', web_url: str = '',
66
72
  ):
67
- """``challenge`` builds the 401's ``WWW-Authenticate`` value from the ASGI scope."""
68
- fe = Frontend(client, registry)
69
- mcp = MCPServer('graphcore', instructions=INSTRUCTIONS)
73
+ """``challenge`` builds the 401's ``WWW-Authenticate`` value from the ASGI scope;
74
+ ``web_url`` is the web app's URL, which every render then links to."""
75
+ fe = Frontend(client, registry, web_url=web_url)
76
+ mcp = MCPServer('graphcore', instructions=INSTRUCTIONS + (WEB_INSTRUCTIONS if web_url else ''))
70
77
 
71
78
  @mcp.tool(description='Read a place. Returns Markdown with its address, version and Tools.')
72
79
  async def open(at: str, ctx: Context, version: Optional[str] = None) -> str:
@@ -80,8 +87,17 @@ def create_app(
80
87
  async def call(
81
88
  at: str, tool: str, ctx: Context, params: Optional[dict[str, Any]] = None,
82
89
  seen_version: Optional[str] = None,
83
- ) -> str:
84
- return await _guard(tools.call)(fe, _principal(ctx), at, tool, params, seen_version)
90
+ ) -> Annotated[CallToolResult, str]:
91
+ # Annotated with `str` so the output schema and structured content stay what a `-> str` tool's are.
92
+ out = await _guard(tools.call)(fe, _principal(ctx), at, tool, params, seen_version)
93
+ return CallToolResult(
94
+ content=[
95
+ TextContent(type='text', text=out.text),
96
+ *(ImageContent(type='image', data=base64.b64encode(i.data).decode(), mime_type=i.media_type)
97
+ for i in out.images),
98
+ ],
99
+ structured_content={'result': out.text},
100
+ )
85
101
 
86
102
  @mcp.tool(description='Run a strategy by name, optionally on a target address or entity id.')
87
103
  async def act(strategy: str, ctx: Context, target: Optional[str] = None, params: Optional[dict[str, Any]] = None) -> str:
@@ -42,4 +42,5 @@ async def call_tool(
42
42
  fe: Frontend, principal: Principal, at: str, tool: str, params: Optional[dict] = None,
43
43
  seen_version: Optional[str] = None,
44
44
  ) -> dict:
45
- return json.loads(await tools.call(fe, principal, to_address(at), tool, params, seen_version))
45
+ out = await tools.call(fe, principal, to_address(at), tool, params, seen_version)
46
+ return {**json.loads(out.text), 'images': list(out.images)}
@@ -4,7 +4,7 @@ import subprocess
4
4
  import sys
5
5
  import unittest
6
6
 
7
- from graphcore.agent_frontend import agent_view, operation, strategy_tool
7
+ from graphcore.agent_frontend import Image, agent_view, operation, strategy_tool
8
8
  from graphcore.agent_frontend.api import AgentView, view_of
9
9
  from graphcore.agent_frontend.base.views import MAX_FIELD_CHARS
10
10
  from graphcore.agent_frontend.errors import AgentError, RenderTooLarge
@@ -12,10 +12,17 @@ from graphcore.agent_frontend.loading import load_registry
12
12
  from graphcore.agent_frontend.registry import AgentRegistry
13
13
  from graphcore.agent_frontend.render import Frontend, render
14
14
  from graphcore.agent_frontend import tools
15
+ from graphcore.agent_frontend.testing import call_tool, open_place
15
16
  from graphcore.agent_frontend.tests.fakes import PRINCIPAL, FakeEntity, FakeGraphClient
16
17
  from graphcore.types.query import ContainsValue
17
18
 
18
19
 
20
+ PNG = bytes.fromhex(
21
+ '89504e470d0a1a0a0000000d4948445200000001000000010806000000'
22
+ '1f15c4890000000d49444154789c6360000002000001e221bc330000000049454e44ae426082'
23
+ )
24
+
25
+
19
26
  def run(coro):
20
27
  return asyncio.run(coro)
21
28
 
@@ -100,12 +107,33 @@ class FrontendTests(unittest.TestCase):
100
107
  f"long: {'x' * MAX_FIELD_CHARS}… (truncated; {MAX_FIELD_CHARS + 1} characters)"):
101
108
  self.assertIn(line, text)
102
109
 
103
- def test_home_lists_places_then_top_level_entities(self):
110
+ def test_home_lists_only_routes(self):
104
111
  text = run(render(self.fe, PRINCIPAL, '/')).text
105
- self.assertIn('## Places\n\n- notes.index · /notes', text)
112
+ self.assertIn('## Routes\n\n- notes.index · /notes', text)
106
113
  self.assertNotIn('/notes/{entity}', text)
107
- self.assertLess(text.index('## Places'), text.index('## Top-level entities'))
108
- self.assertIn('### t.Folder (1)\n\n- Work · t.Folder · /e/b/1', text)
114
+ self.assertNotIn('Top-level entities', text)
115
+ self.assertNotIn('/e/b/1', text)
116
+
117
+ def test_header_links_every_place_to_the_web_app(self):
118
+ fe = Frontend(self.client, self.registry, max_chars=5000, web_url='http://localhost:3000/app/')
119
+ entity = run(open_place(fe, PRINCIPAL, '/e/b/1'))
120
+ self.assertIn('address: /e/b/1 · web: http://localhost:3000/app/e/b/1 · version: ', entity.text)
121
+ self.assertIn('web: http://localhost:3000/app/ · ', run(open_place(fe, PRINCIPAL, '/')).text)
122
+
123
+ def test_header_has_no_web_link_without_a_web_url(self):
124
+ text = run(open_place(self.fe, PRINCIPAL, '/e/b/1')).text
125
+ self.assertNotIn('web:', text)
126
+ self.assertIn('address: /e/b/1 · version: ', text)
127
+
128
+ def test_views_build_web_links(self):
129
+ @agent_view('notes.index')
130
+ async def notes_index(ctx):
131
+ return [f"{ctx.web_url('/notes')} {ctx.web_url('gc://b/2')}"]
132
+ self.registry.add(view_of(notes_index))
133
+ fe = Frontend(self.client, self.registry, max_chars=5000, web_url='http://localhost:3000/app')
134
+ self.assertIn('http://localhost:3000/app/notes http://localhost:3000/app/e/b/2',
135
+ run(render(fe, PRINCIPAL, '/notes')).text)
136
+ self.assertIn('None None', run(render(self.fe, PRINCIPAL, '/notes')).text)
109
137
 
110
138
  def test_tools_by_policy(self):
111
139
  r = run(render(self.fe, PRINCIPAL, '/e/b/2'))
@@ -331,9 +359,10 @@ class ToolTests(unittest.TestCase):
331
359
  def test_call_runs_strategy_and_returns_new_version(self):
332
360
  r = run(render(self.fe, PRINCIPAL, '/e/b/2'))
333
361
  out = run(tools.call(self.fe, PRINCIPAL, '/e/b/2', 'rename', {'name': 'X'}, r.version))
334
- self.assertIn('"ok":true', out)
362
+ self.assertIn('"ok":true', out.text)
363
+ self.assertEqual(out.images, ())
335
364
  self.assertIn(('Rename', 'gc://b/2', {'name': 'X'}), self.client.executed)
336
- self.assertNotIn(r.version, out)
365
+ self.assertNotIn(r.version, out.text)
337
366
 
338
367
  def test_stale(self):
339
368
  with self.assertRaises(AgentError) as cm:
@@ -367,7 +396,40 @@ class ToolTests(unittest.TestCase):
367
396
  reg.add(view_of(v))
368
397
  fe = Frontend(self.client, reg)
369
398
  out = run(tools.call(fe, PRINCIPAL, '/e/b/2', 'ping', {}))
370
- self.assertIn('pong', out)
399
+ self.assertIn('pong', out.text)
400
+
401
+ def _with_operation(self, returns):
402
+ @operation('look', 'Look', {'type': 'object', 'properties': {}})
403
+ async def look(ctx):
404
+ return returns
405
+
406
+ async def view_tools(ctx, entity):
407
+ return [look]
408
+
409
+ @agent_view('x.look', default_for=['t.Note'], tools=view_tools)
410
+ async def v(ctx, entity):
411
+ return []
412
+ reg = load_registry([])
413
+ reg.add(view_of(v))
414
+ return Frontend(self.client, reg)
415
+
416
+ def test_an_operation_returns_an_image(self):
417
+ png = Image(PNG, 'image/png')
418
+ out = run(call_tool(self._with_operation(png), PRINCIPAL, '/e/b/2', 'look'))
419
+ self.assertEqual(out['result'], {'image': 'image/png', 'bytes': len(PNG)})
420
+ self.assertEqual(out['images'], [png])
421
+ self.assertEqual(out['images'][0].data, PNG)
422
+
423
+ def test_an_operation_returns_a_caption_and_an_image(self):
424
+ png = Image(PNG, 'image/png')
425
+ out = run(call_tool(self._with_operation(['caption', png]), PRINCIPAL, '/e/b/2', 'look'))
426
+ self.assertEqual(out['result'], ['caption', {'image': 'image/png', 'bytes': len(PNG)}])
427
+ self.assertEqual(out['images'], [png])
428
+
429
+ def test_an_operation_returning_a_dict_returns_no_images(self):
430
+ out = run(call_tool(self._with_operation({'pong': True}), PRINCIPAL, '/e/b/2', 'look'))
431
+ self.assertEqual(out['result'], {'pong': True})
432
+ self.assertEqual(out['images'], [])
371
433
 
372
434
  def test_a_tool_that_deletes_its_own_place_succeeds(self):
373
435
  @operation('discard', 'Discard', {'type': 'object', 'properties': {}})
@@ -384,7 +446,7 @@ class ToolTests(unittest.TestCase):
384
446
  reg = load_registry([])
385
447
  reg.add(view_of(v))
386
448
  fe = Frontend(self.client, reg)
387
- out = json.loads(run(tools.call(fe, PRINCIPAL, '/e/b/2', 'discard', {})))
449
+ out = json.loads(run(tools.call(fe, PRINCIPAL, '/e/b/2', 'discard', {})).text)
388
450
  self.assertEqual(out['result'], {'deleted': True})
389
451
  self.assertTrue(out['ok'])
390
452
  self.assertIsNone(out['address'])
@@ -1,21 +1,42 @@
1
+ import base64
1
2
  from contextlib import asynccontextmanager
2
3
 
3
4
  import httpx2
4
5
  from django.test import SimpleTestCase
5
6
 
7
+ from graphcore.agent_frontend import Image, agent_view, operation
8
+ from graphcore.agent_frontend.api import view_of
9
+ from graphcore.agent_frontend.loading import load_registry
6
10
  from graphcore.agent_frontend.registry import AgentRegistry
7
11
  from graphcore.agent_frontend.server import create_app
8
12
  from graphcore.agent_frontend.tests.fakes import FakeEntity, FakeGraphClient
9
13
 
14
+ PNG = b'\x89PNG\r\n\x1a\nnot really'
15
+
16
+
17
+ @operation('look', 'Look', {'type': 'object', 'properties': {}})
18
+ async def look(ctx):
19
+ return ['caption', Image(PNG, 'image/png')]
20
+
21
+
22
+ async def note_tools(ctx, entity):
23
+ return [look]
24
+
25
+
26
+ @agent_view('x.look', default_for=['t.Note'], tools=note_tools)
27
+ async def note(ctx, entity):
28
+ return []
29
+
30
+
10
31
  HEADERS = {'Accept': 'application/json, text/event-stream', 'Content-Type': 'application/json'}
11
32
 
12
33
 
13
34
  class McpServerTests(SimpleTestCase):
14
35
  @asynccontextmanager
15
- async def serving(self, allowed_origins=(), **kwargs):
36
+ async def serving(self, allowed_origins=(), registry=None, **kwargs):
16
37
  self.graph = FakeGraphClient()
17
38
  self.graph.add(FakeEntity('gc://b/1', 't.Note', fields={'title': 'Hello'}))
18
- app = create_app(self.graph, AgentRegistry(), allowed_origins=allowed_origins, **kwargs)
39
+ app = create_app(self.graph, registry or AgentRegistry(), allowed_origins=allowed_origins, **kwargs)
19
40
  self._id = 0
20
41
  # The session manager's task group must enter and exit in one task, so no asyncSetUp.
21
42
  async with app.mcp_app.router.lifespan_context(app.mcp_app):
@@ -61,6 +82,20 @@ class McpServerTests(SimpleTestCase):
61
82
  tools = (await self.rpc('tools/list')).json()['result']['tools']
62
83
  self.assertEqual({t['name'] for t in tools}, {'open', 'find', 'call', 'act'})
63
84
 
85
+ async def initialize(self):
86
+ init = await self.rpc('initialize', {
87
+ 'protocolVersion': '2025-06-18', 'capabilities': {}, 'clientInfo': {'name': 't', 'version': '0'},
88
+ })
89
+ return init.json()['result']
90
+
91
+ async def test_instructions_name_the_web_link_only_with_a_web_url(self):
92
+ async with self.serving(web_url='http://localhost:3000/app'):
93
+ self.assertIn('`web:` link', (await self.initialize())['instructions'])
94
+ result = await self.call_tool('open', {'at': '/e/b/1'})
95
+ self.assertIn('web: http://localhost:3000/app/e/b/1', result['content'][0]['text'])
96
+ async with self.serving():
97
+ self.assertNotIn('web:', (await self.initialize())['instructions'])
98
+
64
99
  async def test_open_root(self):
65
100
  async with self.serving():
66
101
  result = await self.call_tool('open', {'at': '/'})
@@ -81,6 +116,24 @@ class McpServerTests(SimpleTestCase):
81
116
  self.assertIn('stale', result['content'][0]['text'].lower())
82
117
  self.assertEqual(self.graph.executed, [])
83
118
 
119
+ async def test_call_of_an_image_operation_returns_text_then_image(self):
120
+ registry = load_registry([])
121
+ registry.add(view_of(note))
122
+ async with self.serving(registry=registry):
123
+ result = await self.call_tool('call', {'at': '/e/b/1', 'tool': 'look'})
124
+ self.assertFalse(result.get('isError'))
125
+ text, image = result['content']
126
+ self.assertEqual(text['type'], 'text')
127
+ self.assertIn('"bytes":%d' % len(PNG), text['text'])
128
+ self.assertEqual(image, {'type': 'image', 'mimeType': 'image/png', 'data': base64.b64encode(PNG).decode()})
129
+
130
+ async def test_call_of_a_strategy_tool_returns_one_text_block(self):
131
+ async with self.serving(registry=load_registry([])):
132
+ result = await self.call_tool('call', {'at': '/e/b/1', 'tool': 'rename', 'params': {'name': 'x'}})
133
+ self.assertFalse(result.get('isError'))
134
+ self.assertEqual([c['type'] for c in result['content']], ['text'])
135
+ self.assertEqual(result['structuredContent'], {'result': result['content'][0]['text']})
136
+
84
137
  async def test_answers_preflight_from_an_allowed_origin_without_a_token(self):
85
138
  async with self.serving(allowed_origins=['http://localhost:3000']):
86
139
  response = await self.http.options('/mcp', headers={
@@ -2,10 +2,12 @@
2
2
  from __future__ import annotations
3
3
 
4
4
  import json
5
+ from dataclasses import dataclass
5
6
  from typing import Any, Optional
6
7
 
7
8
  import jsonschema
8
9
 
10
+ from graphcore.agent_frontend.api import Image
9
11
  from graphcore.agent_frontend.context import Context, Reads, label_of, to_address
10
12
  from graphcore.agent_frontend.errors import AgentError
11
13
  from graphcore.agent_frontend.render import Frontend, ResolvedTool, render
@@ -17,6 +19,23 @@ def _json(value: Any) -> str:
17
19
  return json.dumps(value, default=str, separators=(',', ':'))
18
20
 
19
21
 
22
+ @dataclass(frozen=True)
23
+ class CallResult:
24
+ """`call`'s JSON, and the images its operation returned, in order; each image's place in
25
+ the JSON `result` holds a placeholder."""
26
+ text: str
27
+ images: tuple[Image, ...] = ()
28
+
29
+
30
+ def _take_images(value: Any, images: list[Image]) -> Any:
31
+ if isinstance(value, Image):
32
+ images.append(value)
33
+ return {'image': value.media_type, 'bytes': len(value.data)}
34
+ if isinstance(value, (list, tuple)):
35
+ return [_take_images(v, images) for v in value]
36
+ return value
37
+
38
+
20
39
  async def open_(fe: Frontend, principal: Principal, at: str, version: Optional[str] = None) -> str:
21
40
  rendered = await render(fe, principal, at)
22
41
  if version is None:
@@ -69,7 +88,7 @@ async def _target_id(fe: Frontend, target: str) -> str:
69
88
  async def call(
70
89
  fe: Frontend, principal: Principal, at: str, tool: str, params: Optional[dict] = None,
71
90
  seen_version: Optional[str] = None,
72
- ) -> str:
91
+ ) -> CallResult:
73
92
  params = params or {}
74
93
  rendered = await render(fe, principal, at)
75
94
  if seen_version is not None and seen_version != rendered.version:
@@ -88,13 +107,14 @@ async def call(
88
107
  except jsonschema.ValidationError as exc:
89
108
  raise AgentError('InvalidRequest', f"{exc.message}; schema: {_json(schema)}")
90
109
 
110
+ images: list[Image] = []
91
111
  try:
92
112
  if chosen.spec.fn is not None:
93
- ctx = Context(principal, rendered.address, rendered.entity, fe.client, Reads(), fe.registry, fe.query_max)
94
- result = await chosen.spec.fn(ctx, **params)
113
+ ctx = Context(principal, rendered.address, rendered.entity, fe.client, Reads(), fe.registry, fe.query_max, fe.web_url)
114
+ result = _take_images(await chosen.spec.fn(ctx, **params), images)
95
115
  else:
96
116
  target = await _target_id(fe, params['target']) if chosen.takes_target else chosen.spec.bind
97
- ctx = Context(principal, rendered.address, rendered.entity, fe.client, Reads(), fe.registry, fe.query_max)
117
+ ctx = Context(principal, rendered.address, rendered.entity, fe.client, Reads(), fe.registry, fe.query_max, fe.web_url)
98
118
  result = await ctx.execute(chosen.spec.strategy, target, _strategy_params(chosen, params))
99
119
  except NotFound as exc:
100
120
  raise AgentError('NotFound', str(exc))
@@ -105,15 +125,15 @@ async def call(
105
125
  # The tool deleted the place or revoked the caller's access to it.
106
126
  if exc.code != 'NotFound':
107
127
  raise
108
- return _json({
128
+ return CallResult(_json({
109
129
  'ok': True, 'tool': chosen.name, 'result': result, 'address': None,
110
130
  'note': f"ran {chosen.name}; {rendered.address} no longer exists or is not readable",
111
- })
112
- return _json({
131
+ }), tuple(images))
132
+ return CallResult(_json({
113
133
  'ok': True, 'tool': chosen.name, 'result': result, 'address': after.address,
114
134
  'version': after.version,
115
135
  'note': f"ran {chosen.name} at {after.address}; open it to see the change",
116
- })
136
+ }), tuple(images))
117
137
 
118
138
 
119
139
  async def act(
@@ -130,7 +150,7 @@ async def act(
130
150
  raise AgentError('InvalidRequest', f"{exc.message}; schema: {_json(info.get('schema'))}")
131
151
  try:
132
152
  target_id = await _target_id(fe, target) if target else None
133
- ctx = Context(principal, '/', None, fe.client, Reads(), fe.registry, fe.query_max)
153
+ ctx = Context(principal, '/', None, fe.client, Reads(), fe.registry, fe.query_max, fe.web_url)
134
154
  result = await ctx.execute(strategy, target_id, params)
135
155
  except NotFound as exc:
136
156
  raise AgentError('NotFound', str(exc))
@@ -160,6 +160,10 @@ returns `InvalidRequest` with the full JSON schema.
160
160
  - A success returns the tool's result, the address, its new render
161
161
  version, and a one-line note of what changed. It never returns a render;
162
162
  the agent calls `open` when it wants one.
163
+ - An operation's images follow that JSON as MCP `image` content, one block
164
+ per image in the order returned. In the JSON `result`, each image is a
165
+ placeholder giving its media type and size in bytes, never its data, so an
166
+ agent or host that ignores image content still knows one was returned.
163
167
 
164
168
  The endpoint's MCP `instructions` state: start with `open("/")`; every
165
169
  render begins with its address and version; renders are snapshots, so
@@ -177,7 +181,7 @@ held per connection (Requirement 7).
177
181
 
178
182
  ```markdown
179
183
  # Handbook · stacks.Stack
180
- address: /e/k3x9…/m2p… · version: 7f3a…
184
+ address: /e/k3x9…/m2p… · web: https://app.example.com/e/k3x9…/m2p… · version: 7f3a…
181
185
 
182
186
  The team handbook. 42 documents, 3 awaiting review.
183
187
 
@@ -193,7 +197,16 @@ The team handbook. 42 documents, 3 awaiting review.
193
197
  ```
194
198
 
195
199
  - The header is the label and type (or the view name when there is no
196
- entity), the address, and the render version.
200
+ entity), the address, the place's web URL, and the render version.
201
+ - The web URL is `GRAPHCORE_WEB_URL` (the web app's URL, base path
202
+ included) plus the address: a route names one view for both clients, so
203
+ the same address opens the same place in the browser. `with_agent_frontend`
204
+ reads the setting; the `Frontend` takes it as `web_url`, and the MCP
205
+ `instructions` mention the link only when it is set. Without it the header
206
+ has no `web:` part. `ctx.web_url(target)` gives a view any other place's
207
+ web URL, or `None`. Nothing checks that the web app has a view at the
208
+ address; it mounts every server route and `/e/…`, so the link lands
209
+ somewhere.
197
210
  - A compact placement is one line: label, type, address.
198
211
  - A full placement is the child's render under a heading, without its
199
212
  tools section.
@@ -320,7 +333,11 @@ and its parameters and declaring its request schema. It performs reads and
320
333
  strategy executions through `ctx`, each checked as the user; it has no
321
334
  other path. Operations exist for multi-step tasks ("create a document in
322
335
  the review folder and assign a reviewer") and computed targets ("archive
323
- every document in this stack with no edits in 90 days").
336
+ every document in this stack with no edits in 90 days"). For an agent that
337
+ has to look at something (a photo to caption, a scanned receipt), an
338
+ operation may return an `Image` (its bytes and media type), or a list mixing
339
+ JSON values and images. The kernel sends the bytes as given; it does not
340
+ resize or re-encode them. Strategy results are always JSON.
324
341
 
325
342
  A tool's name and description default to the strategy's; the view may set
326
343
  either.
@@ -343,9 +360,8 @@ bound to the entity. An app that adds a strategy to another app's type
343
360
  with `policy.extend` adds it to that type's default tools. The sections
344
361
  are exported (`entity_summary`, `entity_fields`, `children_section`) for an
345
362
  app view to reuse.
346
- - **`home`**: `## Places`, a compact placement of every route other than
347
- `/` that needs no entity, then the user's top-level entities grouped by
348
- type, placed compactly. Tools are the strategies on the deployment's
363
+ - **`home`**: `## Routes`, a compact placement of every route other than
364
+ `/` that needs no entity. Tools are the strategies on the deployment's
349
365
  allowlist. The web client's `TopBar` links the same routes.
350
366
  - **`view`**, the default for `graphcore.View`: a view renders as
351
367
  itself, as in the web client. It calls the agent view its `component`
@@ -370,7 +386,7 @@ async def entity(ctx, entity):
370
386
  ```
371
387
 
372
388
  The module also exports its parts for reuse: `entity_summary`,
373
- `entity_fields`, `children_section`, `places`, `grouped`, `type_tools`,
389
+ `entity_fields`, `children_section`, `routes_section`, `grouped`, `type_tools`,
374
390
  `deployment_tools`, and the views `entity_view` and `home_view`. A view with `default_for` that wants the type's default tools
375
391
  returns `type_tools(ctx, entity)` from its `tools`.
376
392