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.
- {graphcore_kernel-0.1.0/graphcore_kernel.egg-info → graphcore_kernel-0.2.0}/PKG-INFO +1 -1
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/__init__.py +2 -2
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/api.py +9 -1
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/base/__init__.py +2 -2
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/base/views.py +4 -9
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/context.py +7 -1
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/render.py +8 -2
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/server.py +23 -7
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/testing.py +2 -1
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/tests/test_frontend.py +71 -9
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/tests/test_server.py +55 -2
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/tools.py +29 -9
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/AGENT_FRONTEND_TDD.md +23 -7
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/STRATEGY_EXECUTION_TDD.md +34 -1
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/BaseStrategy.py +12 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/RequestTemplateStrategies.py +17 -5
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/StrategyExecutorService.py +24 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/support.py +17 -1
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/test_executor.py +26 -2
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/app_discovery.py +72 -14
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/discovery.py +6 -1
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/test_import_package.py +12 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/tests/test_ticks.py +20 -1
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/case.py +3 -1
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/public_api_manifest.py +2 -2
- graphcore_kernel-0.2.0/graphcore/tests/test_app_discovery.py +162 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_composition_boundaries.py +3 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/agent_asgi.py +10 -2
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0/graphcore_kernel.egg-info}/PKG-INFO +1 -1
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/pyproject.toml +1 -1
- graphcore_kernel-0.1.0/graphcore/tests/test_app_discovery.py +0 -90
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/LICENSE +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/NOTICE +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/README.md +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/client.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/errors.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/loading.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/registry.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/signatures.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/tests/fakes.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/tests/test_loading.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/graph_api.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/predicate_codec.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/tests/test_changed_entities.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/tests/test_graph_api.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/tests/test_graph_api_access.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/tests/test_graph_api_grants.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/tests/test_predicate_codec.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/api/tests/test_subtree_query.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/apps.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/README.md +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/authenticator.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/onboarding.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/principals.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/resource_metadata.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/service_accounts.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/testing.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/tests/test_authenticator.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/tests/test_onboarding.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/tests/test_service_accounts.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authn/users.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/access_port.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/adapter/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/adapter/default_access_adapter.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/adapter/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/adapter/tests/test_default_adapter.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/adapter/tests/test_entity_write_hooks.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/adapter/tests/test_group_types.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/adapter/tests/test_sync_support.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/defaults.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/kernel_policy.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/kernel_writes.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/lookups.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/policy.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_can_contain.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_contained_by.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_creation.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_delete_permission.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_granted_to_me.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_integration.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_invites.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_kernel_policy.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_lockout.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_policy.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_primitives.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/auth/authz/tests/test_principal_creation.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/bootstrap/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/bootstrap/deployment.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/bootstrap/signals.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/bootstrap/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/bootstrap/tests/test_deployment_seed.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/broadcast/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/broadcast/broadcaster.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/broadcast/channels.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/broadcast/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/broadcast/tests/test_broadcaster.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/celery.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/ARCHITECTURE_PRINCIPLES.md +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/AUTHORIZATION_TECHNICAL_TDD.md +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/ENTITY_REFERENCE_TDD.md +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/GRAPHAPI_FRONT_DOOR.md +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/RUNTIME.md +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/SCHEDULING_TDD.md +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/VIEW_ENTITY_TDD.md +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/VIEW_SYSTEM_TDD.md +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/doc_topics.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/docs_discovery.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/docs/public_api.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/Entity.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/deployment/Deployment.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/deployment/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/grant/Grant.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/grant/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/group/Group.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/group/README.md +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/group/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/invite/Invite.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/invite/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/request_template/RequestTemplate.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/request_template/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/request_template/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/request_template/tests/test_request_template.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/service_account/ServiceAccount.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/service_account/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/strategy_request/StrategyRequest.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/strategy_request/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/strategy_request/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/strategy_request/tests/test_strategy_request_entity.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/tests/test_entity.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/tests/test_grant_group_entities.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/tests/test_write_once_fields.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/user/User.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/user/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/user/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/user/tests/test_user_entity.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/view/View.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/view/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/view/position.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/view/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/view/tests/test_position.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/entity/view/tests/test_view_entity.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/DeploymentStrategies.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/GrantStrategies.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/GroupStrategies.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/InviteStrategies.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/ViewStrategies.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/runner.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/session.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/BaseStrategyTest.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/test_BaseStrategies.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/test_grant_strategies.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/test_group_strategies.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/test_runner.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/test_strategy_locks.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/test_utils.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/domain/strategy/tests/test_view_strategies.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/errors.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/README.md +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/dispatcher.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/environments/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/environments/celery.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/environments/in_process.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/local_session.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/redis_run_events.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/requests.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/run_events.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/strategy_context.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tasks.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/contract.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/test_dispatchers.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/test_local_session.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/test_reconcile_runs.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/test_run_events.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/execution/tests/test_strategy_context.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/gateway/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/gateway/remote.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/gateway/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/gateway/tests/test_remote.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/EntityService.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/entity_cache.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_EntityService.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_EntityService_list.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_EntityService_model_resolution.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_EntityService_referrers.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_EntityService_routing.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_dependent_on.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_engine_is_type_agnostic.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_engine_resolves_read_permission.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_entity_cache.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/graph/tests/test_null_entity_cache.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/commands/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/commands/dev_reset.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/commands/graphcore_createadmin.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/commands/graphcore_policy.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/commands/graphcore_status.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/tests/test_createadmin.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/tests/test_policy_command.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/management/tests/test_status_command.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/migrations/0001_initial.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/migrations/0002_invite.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/migrations/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/models.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/ENTITY_REPOSITORY_TECHNICAL_TDD.md +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/backends.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/bindings.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/cache.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/compiler.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/identity.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/models.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/repository.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/tests/test_backends.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/tests/test_compiler.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/tests/test_repository.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/tests/test_shared_column.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/tests/test_threads.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/tests/test_update_shape.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/django/threads.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/repository.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/tests/contract.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/tests/evaluate.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/tests/fixtures.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/tests/memory.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/tests/test_memory_repository.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/persistence/tests/test_query_types.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/api.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/apps.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/auth/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/auth/grants.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/auth/onboarding.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/auth/perms.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/auth/policy.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/auth/roles.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/auth/subjects.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/entities/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/errors.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/persistence/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/persistence/django.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/scheduling.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/strategies/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/test_settings.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/public/testing.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/EntityDirectory.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/README.md +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/StrategyDirectory.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/TYPE_METADATA_PLACEMENT.md +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/decorators.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/registry.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/test_agent_frontend_discovery.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/test_app_config.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/test_discovery.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/test_entity_directory_storage.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/test_principal_flag.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/registry/tests/test_strategy_directory.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/routes/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/routes/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/routes/tests/test_routes.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/runtime.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/beat_scheduler.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/beat_tasks.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/scheduler.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/tests/contract.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/tests/memory.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/tests/test_beat_scheduler.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/scheduling/tests/test_memory_scheduler.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tasks.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/test_settings.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/runner.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/settings.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/tests/agent_view_fixture.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/tests/test_case_and_runner.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/testing/tests/test_settings_for_apps.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/ids.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/runs.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_docs_discovery.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_no_print.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_packaging.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_public_api_boundaries.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_public_api_contract.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_public_api_docs.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_runtime.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_shared_type_boundaries.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_shared_types.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/tests/test_test_settings.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/agent_client.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/channel_layer.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/consumers.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/routing.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/tests/test_agent_client.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/tests/test_api_views.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/tests/test_channel_layer.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/tests/test_consumers.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/tests/test_resource_metadata.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/urls.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/transport/views.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/access.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/api.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/entities.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/entity_id.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/execution.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/identity.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/onboarding.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/query.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/schedules.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/strategy.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/tests/__init__.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/types/tests/test_entity_id.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/urls.py +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore_kernel.egg-info/SOURCES.txt +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore_kernel.egg-info/dependency_links.txt +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore_kernel.egg-info/entry_points.txt +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore_kernel.egg-info/requires.txt +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore_kernel.egg-info/top_level.txt +0 -0
- {graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/setup.cfg +0 -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,
|
|
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', '
|
|
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
|
|
105
|
-
"""`##
|
|
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 ['##
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
69
|
-
|
|
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
|
-
|
|
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
|
-
|
|
45
|
+
out = await tools.call(fe, principal, to_address(at), tool, params, seen_version)
|
|
46
|
+
return {**json.loads(out.text), 'images': list(out.images)}
|
{graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/tests/test_frontend.py
RENAMED
|
@@ -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
|
|
110
|
+
def test_home_lists_only_routes(self):
|
|
104
111
|
text = run(render(self.fe, PRINCIPAL, '/')).text
|
|
105
|
-
self.assertIn('##
|
|
112
|
+
self.assertIn('## Routes\n\n- notes.index · /notes', text)
|
|
106
113
|
self.assertNotIn('/notes/{entity}', text)
|
|
107
|
-
self.
|
|
108
|
-
self.
|
|
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'])
|
{graphcore_kernel-0.1.0 → graphcore_kernel-0.2.0}/graphcore/agent_frontend/tests/test_server.py
RENAMED
|
@@ -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
|
-
) ->
|
|
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`**: `##
|
|
347
|
-
`/` that needs no entity
|
|
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`, `
|
|
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
|
|