microsoft-agents-hosting-core 1.2.0.dev1__tar.gz → 1.2.0.dev5__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 (168) hide show
  1. {microsoft_agents_hosting_core-1.2.0.dev1/microsoft_agents_hosting_core.egg-info → microsoft_agents_hosting_core-1.2.0.dev5}/PKG-INFO +2 -2
  2. microsoft_agents_hosting_core-1.2.0.dev5/VERSION.txt +1 -0
  3. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/_type_defs.py +1 -1
  4. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/agent_application.py +148 -38
  5. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/oauth/authorization.py +13 -3
  6. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/turn_context.py +2 -2
  7. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5/microsoft_agents_hosting_core.egg-info}/PKG-INFO +2 -2
  8. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents_hosting_core.egg-info/requires.txt +1 -1
  9. microsoft_agents_hosting_core-1.2.0.dev1/VERSION.txt +0 -1
  10. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/LICENSE +0 -0
  11. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/MANIFEST.in +0 -0
  12. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/__init__.py +0 -0
  13. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/_oauth/__init__.py +0 -0
  14. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/_oauth/_flow_state.py +0 -0
  15. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/_oauth/_flow_storage_client.py +0 -0
  16. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/_oauth/_oauth_flow.py +0 -0
  17. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/activity_handler.py +0 -0
  18. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/agent.py +0 -0
  19. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/__init__.py +0 -0
  20. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/_routes/__init__.py +0 -0
  21. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/_routes/_route.py +0 -0
  22. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/_routes/_route_list.py +0 -0
  23. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/_routes/route_rank.py +0 -0
  24. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/app_error.py +0 -0
  25. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/app_options.py +0 -0
  26. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/input_file.py +0 -0
  27. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/oauth/__init__.py +0 -0
  28. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py +0 -0
  29. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/oauth/_handlers/_authorization_handler.py +0 -0
  30. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/oauth/_handlers/_user_authorization.py +0 -0
  31. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py +0 -0
  32. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/oauth/_handlers/connector_user_authorization.py +0 -0
  33. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/oauth/_sign_in_response.py +0 -0
  34. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/oauth/_sign_in_state.py +0 -0
  35. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/oauth/auth_handler.py +0 -0
  36. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/oauth/telemetry/__init__.py +0 -0
  37. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/oauth/telemetry/constants.py +0 -0
  38. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/oauth/telemetry/spans.py +0 -0
  39. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/proactive/__init__.py +0 -0
  40. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/proactive/conversation.py +0 -0
  41. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/proactive/conversation_builder.py +0 -0
  42. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/proactive/conversation_reference_builder.py +0 -0
  43. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/proactive/create_conversation_options.py +0 -0
  44. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/proactive/proactive.py +0 -0
  45. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/proactive/proactive_options.py +0 -0
  46. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/proactive/telemetry/__init__.py +0 -0
  47. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/proactive/telemetry/constants.py +0 -0
  48. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/proactive/telemetry/spans.py +0 -0
  49. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/query.py +0 -0
  50. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/state/__init__.py +0 -0
  51. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/state/conversation_state.py +0 -0
  52. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/state/state.py +0 -0
  53. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/state/temp_state.py +0 -0
  54. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/state/turn_state.py +0 -0
  55. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/streaming/__init__.py +0 -0
  56. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/streaming/citation.py +0 -0
  57. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/streaming/citation_util.py +0 -0
  58. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/streaming/streaming_response.py +0 -0
  59. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/telemetry/__init__.py +0 -0
  60. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/telemetry/constants.py +0 -0
  61. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/telemetry/metrics.py +0 -0
  62. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/telemetry/spans.py +0 -0
  63. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/app/typing_indicator.py +0 -0
  64. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/authorization/__init__.py +0 -0
  65. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/authorization/access_token_provider_base.py +0 -0
  66. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py +0 -0
  67. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/authorization/anonymous_token_provider.py +0 -0
  68. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/authorization/auth_types.py +0 -0
  69. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/authorization/authentication_constants.py +0 -0
  70. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/authorization/claims_identity.py +0 -0
  71. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/authorization/connections.py +0 -0
  72. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/authorization/jwt_token_validator.py +0 -0
  73. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/authorization/telemetry/__init__.py +0 -0
  74. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/authorization/telemetry/constants.py +0 -0
  75. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/authorization/telemetry/metrics.py +0 -0
  76. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/authorization/telemetry/spans.py +0 -0
  77. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/card_factory.py +0 -0
  78. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/channel_adapter.py +0 -0
  79. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/channel_api_handler_protocol.py +0 -0
  80. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/channel_service_adapter.py +0 -0
  81. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/channel_service_client_factory_base.py +0 -0
  82. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/client/__init__.py +0 -0
  83. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/client/agent_conversation_reference.py +0 -0
  84. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/client/channel_factory_protocol.py +0 -0
  85. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/client/channel_host_protocol.py +0 -0
  86. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/client/channel_info_protocol.py +0 -0
  87. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/client/channel_protocol.py +0 -0
  88. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/client/channels_configuration.py +0 -0
  89. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/client/configuration_channel_host.py +0 -0
  90. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/client/conversation_constants.py +0 -0
  91. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/client/conversation_id_factory.py +0 -0
  92. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/client/conversation_id_factory_options.py +0 -0
  93. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py +0 -0
  94. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/client/http_agent_channel.py +0 -0
  95. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/client/http_agent_channel_factory.py +0 -0
  96. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/__init__.py +0 -0
  97. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/agent_sign_in_base.py +0 -0
  98. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/attachments_base.py +0 -0
  99. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/client/__init__.py +0 -0
  100. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/client/connector_client.py +0 -0
  101. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/client/user_token_client.py +0 -0
  102. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/connector_client_base.py +0 -0
  103. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/conversations_base.py +0 -0
  104. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/get_product_info.py +0 -0
  105. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/mcs/__init__.py +0 -0
  106. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/mcs/mcs_connector_client.py +0 -0
  107. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/teams/__init__.py +0 -0
  108. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/teams/teams_connector_client.py +0 -0
  109. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/telemetry/__init__.py +0 -0
  110. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/telemetry/_request_span_wrapper.py +0 -0
  111. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/telemetry/connector_spans.py +0 -0
  112. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/telemetry/constants.py +0 -0
  113. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/telemetry/metrics.py +0 -0
  114. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/telemetry/user_token_client_spans.py +0 -0
  115. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/user_token_base.py +0 -0
  116. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/connector/user_token_client_base.py +0 -0
  117. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/errors/__init__.py +0 -0
  118. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/errors/error_resources.py +0 -0
  119. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/http/__init__.py +0 -0
  120. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/http/_channel_service_routes.py +0 -0
  121. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/http/_http_adapter_base.py +0 -0
  122. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/http/_http_request_protocol.py +0 -0
  123. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/http/_http_response.py +0 -0
  124. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/message_factory.py +0 -0
  125. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/middleware_set.py +0 -0
  126. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/rest_channel_service_client_factory.py +0 -0
  127. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/state/__init__.py +0 -0
  128. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/state/agent_state.py +0 -0
  129. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/state/state_property_accessor.py +0 -0
  130. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/state/user_state.py +0 -0
  131. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/storage/__init__.py +0 -0
  132. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/storage/_type_aliases.py +0 -0
  133. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/storage/error_handling.py +0 -0
  134. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/storage/memory_storage.py +0 -0
  135. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/storage/storage.py +0 -0
  136. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/storage/store_item.py +0 -0
  137. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/storage/telemetry/__init__.py +0 -0
  138. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/storage/telemetry/constants.py +0 -0
  139. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/storage/telemetry/metrics.py +0 -0
  140. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/storage/telemetry/spans.py +0 -0
  141. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/storage/transcript_file_store.py +0 -0
  142. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/storage/transcript_info.py +0 -0
  143. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/storage/transcript_logger.py +0 -0
  144. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/storage/transcript_memory_store.py +0 -0
  145. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/storage/transcript_store.py +0 -0
  146. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/__init__.py +0 -0
  147. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/adapter/__init__.py +0 -0
  148. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/adapter/constants.py +0 -0
  149. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/adapter/metrics.py +0 -0
  150. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/adapter/spans.py +0 -0
  151. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/attributes.py +0 -0
  152. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/core/__init__.py +0 -0
  153. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/core/_agents_telemetry.py +0 -0
  154. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/core/base_span_wrapper.py +0 -0
  155. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/core/resource.py +0 -0
  156. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/core/simple_span_wrapper.py +0 -0
  157. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/core/type_defs.py +0 -0
  158. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/turn_context/__init__.py +0 -0
  159. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/turn_context/constants.py +0 -0
  160. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/turn_context/spans.py +0 -0
  161. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents/hosting/core/telemetry/utils.py +0 -0
  162. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents_hosting_core.egg-info/SOURCES.txt +0 -0
  163. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents_hosting_core.egg-info/dependency_links.txt +0 -0
  164. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/microsoft_agents_hosting_core.egg-info/top_level.txt +0 -0
  165. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/pyproject.toml +0 -0
  166. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/readme.md +0 -0
  167. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/setup.cfg +0 -0
  168. {microsoft_agents_hosting_core-1.2.0.dev1 → microsoft_agents_hosting_core-1.2.0.dev5}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-hosting-core
3
- Version: 1.2.0.dev1
3
+ Version: 1.2.0.dev5
4
4
  Summary: Core library for Microsoft Agents
5
5
  Author: Microsoft Corporation
6
6
  License-Expression: MIT
@@ -15,7 +15,7 @@ Classifier: Operating System :: OS Independent
15
15
  Requires-Python: >=3.10
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
- Requires-Dist: microsoft-agents-activity==1.2.0.dev1
18
+ Requires-Dist: microsoft-agents-activity==1.2.0.dev5
19
19
  Requires-Dist: pyjwt>=2.10.1
20
20
  Requires-Dist: isodate>=0.6.1
21
21
  Requires-Dist: azure-core>=1.30.0
@@ -0,0 +1 @@
1
+ 1.2.0.dev5
@@ -12,4 +12,4 @@ StateT = TypeVar("StateT", bound=TurnState)
12
12
 
13
13
 
14
14
  class RouteHandler(Protocol[StateT]):
15
- def __call__(self, context: TurnContext, state: StateT) -> Awaitable[None]: ...
15
+ def __call__(self, context: TurnContext, state: StateT, /) -> Awaitable[None]: ...
@@ -16,9 +16,9 @@ from typing import (
16
16
  Callable,
17
17
  Generic,
18
18
  Optional,
19
- Pattern,
20
19
  TypeVar,
21
20
  cast,
21
+ overload,
22
22
  )
23
23
 
24
24
  from microsoft_agents.activity import (
@@ -71,11 +71,12 @@ class AgentApplication(Agent, Generic[StateT]):
71
71
  _adapter: Optional[ChannelServiceAdapter] = None
72
72
  _auth: Optional[Authorization] = None
73
73
  _proactive: Optional[Proactive] = None
74
- _internal_before_turn: list[Callable[[TurnContext, StateT], Awaitable[bool]]] = []
75
- _internal_after_turn: list[Callable[[TurnContext, StateT], Awaitable[bool]]] = []
76
- _route_list: _RouteList[StateT] = _RouteList[StateT]()
74
+ _internal_before_turn: list[Callable[[TurnContext, StateT], Awaitable[bool]]]
75
+ _internal_after_turn: list[Callable[[TurnContext, StateT], Awaitable[bool]]]
76
+ _route_list: _RouteList[StateT]
77
77
  _error: Optional[Callable[[TurnContext, Exception], Awaitable[None]]] = None
78
78
  _turn_state_factory: Optional[Callable[[TurnContext], StateT]] = None
79
+ _connection_manager: Connections
79
80
 
80
81
  def __init__(
81
82
  self,
@@ -98,6 +99,8 @@ class AgentApplication(Agent, Generic[StateT]):
98
99
  :type kwargs: Any
99
100
  """
100
101
  self._route_list = _RouteList[StateT]()
102
+ self._internal_before_turn = []
103
+ self._internal_after_turn = []
101
104
 
102
105
  configuration = kwargs
103
106
 
@@ -157,8 +160,25 @@ class AgentApplication(Agent, Generic[StateT]):
157
160
 
158
161
  # TODO: decide how to initialize the Authorization (params vs options vs kwargs)
159
162
  if authorization:
163
+ if connection_manager:
164
+ logger.error(
165
+ "AgentApplication: connection_manager is not needed when authorization is provided."
166
+ )
167
+ raise ApplicationError(
168
+ "The `AgentApplication` does not take a `connection_manager` when `authorization` is provided."
169
+ )
160
170
  self._auth = authorization
171
+ self._connection_manager = self._auth.connection_manager
161
172
  else:
173
+ if not connection_manager:
174
+ logger.error(
175
+ "AgentApplication: connection_manager is required for Authorization.",
176
+ stack_info=True,
177
+ )
178
+ raise ApplicationError(
179
+ "The `AgentApplication` requires a `connection_manager` to initialize the `Authorization` instance."
180
+ )
181
+
162
182
  auth_options = {
163
183
  key: value
164
184
  for key, value in configuration.items()
@@ -167,9 +187,20 @@ class AgentApplication(Agent, Generic[StateT]):
167
187
  self._auth = Authorization(
168
188
  storage=self._options.storage,
169
189
  connection_manager=connection_manager,
170
- handlers=options.authorization_handlers,
190
+ auth_handlers=options.authorization_handlers,
171
191
  **auth_options,
172
192
  )
193
+ self._connection_manager = connection_manager
194
+
195
+ @property
196
+ def connection_manager(self) -> Connections:
197
+ """
198
+ The application's connection manager.
199
+
200
+ :return: The connection manager for the application.
201
+ :rtype: :class:`microsoft_agents.hosting.core.authorization.Connections`
202
+ """
203
+ return self._connection_manager
173
204
 
174
205
  @property
175
206
  def adapter(self) -> ChannelServiceAdapter:
@@ -244,6 +275,34 @@ class AgentApplication(Agent, Generic[StateT]):
244
275
  """)
245
276
  return self._proactive
246
277
 
278
+ def before_turn(
279
+ self, handler: Callable[[TurnContext, StateT], Awaitable[bool]]
280
+ ) -> Callable[[TurnContext, StateT], Awaitable[bool]]:
281
+ """
282
+ Adds a handler to be called before each turn of the conversation.
283
+
284
+ :param handler: A function that takes a TurnContext and a StateT and returns an Awaitable.
285
+ :type handler: Callable[[TurnContext, StateT], Awaitable[bool]]
286
+ :return: The added handler.
287
+ :rtype: Callable[[TurnContext, StateT], Awaitable[bool]]
288
+ """
289
+ self._internal_before_turn.append(handler)
290
+ return handler
291
+
292
+ def after_turn(
293
+ self, handler: Callable[[TurnContext, StateT], Awaitable[bool]]
294
+ ) -> Callable[[TurnContext, StateT], Awaitable[bool]]:
295
+ """
296
+ Adds a handler to be called after each turn of the conversation.
297
+
298
+ :param handler: A function that takes a TurnContext and a StateT and returns an Awaitable.
299
+ :type handler: Callable[[TurnContext, StateT], Awaitable[bool]]
300
+ :return: The added handler.
301
+ :rtype: Callable[[TurnContext, StateT], Awaitable[bool]]
302
+ """
303
+ self._internal_after_turn.append(handler)
304
+ return handler
305
+
247
306
  def add_route(
248
307
  self,
249
308
  selector: RouteSelector,
@@ -259,7 +318,7 @@ class AgentApplication(Agent, Generic[StateT]):
259
318
 
260
319
  :param selector: A function that takes a TurnContext and returns a boolean indicating whether the route should be selected.
261
320
  :type selector: Callable[[:class:`microsoft_agents.hosting.core.turn_context.TurnContext`], bool]
262
- :param handler: A function that takes a TurnContext and a TurnState and returns an Awaitable.
321
+ :param handler: A function that takes a TurnContext and a StateT and returns an Awaitable.
263
322
  :type handler: :class:`microsoft_agents.hosting.core.app._type_defs.RouteHandler`[StateT]
264
323
  :param is_invoke: Whether the route is for an invoke activity, defaults to False
265
324
  :type is_invoke: bool, Optional
@@ -312,6 +371,8 @@ class AgentApplication(Agent, Generic[StateT]):
312
371
  """
313
372
 
314
373
  def __selector(context: TurnContext):
374
+ if isinstance(activity_type, list):
375
+ return context.activity.type in activity_type
315
376
  return activity_type == context.activity.type
316
377
 
317
378
  def __call(func: RouteHandler[StateT]) -> RouteHandler[StateT]:
@@ -325,7 +386,7 @@ class AgentApplication(Agent, Generic[StateT]):
325
386
 
326
387
  def message(
327
388
  self,
328
- select: str | Pattern[str] | list[str | Pattern[str]],
389
+ select: str | re.Pattern[str] | list[str | re.Pattern[str]],
329
390
  *,
330
391
  auth_handlers: Optional[list[str]] = None,
331
392
  **kwargs,
@@ -342,7 +403,7 @@ class AgentApplication(Agent, Generic[StateT]):
342
403
  return True
343
404
 
344
405
  :param select: Literal text, compiled regex, or list of either used to match the incoming message.
345
- :type select: str | Pattern[str] | list[str | Pattern[str]]
406
+ :type select: str | re.Pattern[str] | list[str | re.Pattern[str]]
346
407
  :param auth_handlers: Optional list of authorization handler IDs for the route.
347
408
  :type auth_handlers: Optional[list[str]]
348
409
  :param kwargs: Additional route configuration passed to :meth:`microsoft_agents.hosting.core.AgentApplication.add_route`.
@@ -353,9 +414,18 @@ class AgentApplication(Agent, Generic[StateT]):
353
414
  return False
354
415
 
355
416
  text = context.activity.text if context.activity.text else ""
356
- if isinstance(select, Pattern):
357
- hits = re.fullmatch(select, text)
358
- return hits is not None
417
+
418
+ if isinstance(select, list):
419
+ for item in select:
420
+ if isinstance(item, re.Pattern):
421
+ if re.fullmatch(item, text) is not None:
422
+ return True
423
+ elif text == item:
424
+ return True
425
+ return False
426
+
427
+ if isinstance(select, re.Pattern):
428
+ return re.fullmatch(select, text) is not None
359
429
 
360
430
  return text == select
361
431
 
@@ -370,7 +440,7 @@ class AgentApplication(Agent, Generic[StateT]):
370
440
 
371
441
  def conversation_update(
372
442
  self,
373
- type: ConversationUpdateTypes,
443
+ type: ConversationUpdateTypes | str,
374
444
  *,
375
445
  auth_handlers: Optional[list[str]] = None,
376
446
  **kwargs,
@@ -387,35 +457,37 @@ class AgentApplication(Agent, Generic[StateT]):
387
457
  return True
388
458
 
389
459
  :param type: Conversation update category that must match the incoming activity.
390
- :type type: microsoft_agents.activity.ConversationUpdateTypes
460
+ :type type: microsoft_agents.activity.ConversationUpdateTypes | str
391
461
  :param auth_handlers: Optional list of authorization handler IDs for the route.
392
462
  :type auth_handlers: Optional[list[str]]
393
463
  :param kwargs: Additional route configuration passed to :meth:`microsoft_agents.hosting.core.AgentApplication.add_route`.
394
464
  """
395
465
 
466
+ update_type = type.value if isinstance(type, ConversationUpdateTypes) else type
467
+
396
468
  def __selector(context: TurnContext):
397
469
  if context.activity.type != ActivityTypes.conversation_update:
398
470
  return False
399
471
 
400
- if type == "membersAdded":
472
+ if update_type == "membersAdded":
401
473
  if isinstance(context.activity.members_added, list):
402
474
  return len(context.activity.members_added) > 0
403
475
  return False
404
476
 
405
- if type == "membersRemoved":
477
+ if update_type == "membersRemoved":
406
478
  if isinstance(context.activity.members_removed, list):
407
479
  return len(context.activity.members_removed) > 0
408
480
  return False
409
481
 
410
482
  if isinstance(context.activity.channel_data, object):
411
483
  data = vars(context.activity.channel_data)
412
- return data["event_type"] == type
484
+ return data["event_type"] == update_type
413
485
 
414
486
  return False
415
487
 
416
488
  def __call(func: RouteHandler[StateT]) -> RouteHandler[StateT]:
417
489
  logger.debug(
418
- f"Registering conversation update handler for route handler {func.__name__} with type: {type} with auth handlers: {auth_handlers}"
490
+ f"Registering conversation update handler for route handler {func.__name__} with type: {update_type} with auth handlers: {auth_handlers}"
419
491
  )
420
492
  self.add_route(__selector, func, auth_handlers=auth_handlers, **kwargs)
421
493
  return func
@@ -424,7 +496,7 @@ class AgentApplication(Agent, Generic[StateT]):
424
496
 
425
497
  def message_reaction(
426
498
  self,
427
- type: MessageReactionTypes,
499
+ type: MessageReactionTypes | str,
428
500
  *,
429
501
  auth_handlers: Optional[list[str]] = None,
430
502
  **kwargs,
@@ -441,22 +513,24 @@ class AgentApplication(Agent, Generic[StateT]):
441
513
  return True
442
514
 
443
515
  :param type: Reaction category that must match the incoming activity.
444
- :type type: microsoft_agents.activity.MessageReactionTypes
516
+ :type type: microsoft_agents.activity.MessageReactionTypes | str
445
517
  :param auth_handlers: Optional list of authorization handler IDs for the route.
446
518
  :type auth_handlers: Optional[list[str]]
447
519
  :param kwargs: Additional route configuration passed to :meth:`microsoft_agents.hosting.core.AgentApplication.add_route`.
448
520
  """
449
521
 
522
+ reaction_type = type.value if isinstance(type, MessageReactionTypes) else type
523
+
450
524
  def __selector(context: TurnContext):
451
525
  if context.activity.type != ActivityTypes.message_reaction:
452
526
  return False
453
527
 
454
- if type == "reactionsAdded":
528
+ if reaction_type == "reactionsAdded":
455
529
  if isinstance(context.activity.reactions_added, list):
456
530
  return len(context.activity.reactions_added) > 0
457
531
  return False
458
532
 
459
- if type == "reactionsRemoved":
533
+ if reaction_type == "reactionsRemoved":
460
534
  if isinstance(context.activity.reactions_removed, list):
461
535
  return len(context.activity.reactions_removed) > 0
462
536
  return False
@@ -465,7 +539,7 @@ class AgentApplication(Agent, Generic[StateT]):
465
539
 
466
540
  def __call(func: RouteHandler[StateT]) -> RouteHandler[StateT]:
467
541
  logger.debug(
468
- f"Registering message reaction handler for route handler {func.__name__} with type: {type} with auth handlers: {auth_handlers}"
542
+ f"Registering message reaction handler for route handler {func.__name__} with type: {reaction_type} with auth handlers: {auth_handlers}"
469
543
  )
470
544
  self.add_route(__selector, func, auth_handlers=auth_handlers, **kwargs)
471
545
  return func
@@ -474,7 +548,7 @@ class AgentApplication(Agent, Generic[StateT]):
474
548
 
475
549
  def message_update(
476
550
  self,
477
- type: MessageUpdateTypes,
551
+ type: MessageUpdateTypes | str,
478
552
  *,
479
553
  auth_handlers: Optional[list[str]] = None,
480
554
  **kwargs,
@@ -491,56 +565,85 @@ class AgentApplication(Agent, Generic[StateT]):
491
565
  return True
492
566
 
493
567
  :param type: Message update category that must match the incoming activity.
494
- :type type: microsoft_agents.activity.MessageUpdateTypes
568
+ :type type: microsoft_agents.activity.MessageUpdateTypes | str
495
569
  :param auth_handlers: Optional list of authorization handler IDs for the route.
496
570
  :type auth_handlers: Optional[list[str]]
497
571
  :param kwargs: Additional route configuration passed to :meth:`microsoft_agents.hosting.core.AgentApplication.add_route`.
498
572
  """
499
573
 
574
+ update_type = type.value if isinstance(type, MessageUpdateTypes) else type
575
+
500
576
  def __selector(context: TurnContext):
501
- if type == "editMessage":
577
+ if update_type == "editMessage":
502
578
  if (
503
579
  context.activity.type == ActivityTypes.message_update
504
580
  and isinstance(context.activity.channel_data, dict)
505
581
  ):
506
582
  data = context.activity.channel_data
507
- return data["event_type"] == type
583
+ return data["event_type"] == update_type
508
584
  return False
509
585
 
510
- if type == "softDeleteMessage":
586
+ if update_type == "softDeleteMessage":
511
587
  if (
512
588
  context.activity.type == ActivityTypes.message_delete
513
589
  and isinstance(context.activity.channel_data, dict)
514
590
  ):
515
591
  data = context.activity.channel_data
516
- return data["event_type"] == type
592
+ return data["event_type"] == update_type
517
593
  return False
518
594
 
519
- if type == "undeleteMessage":
595
+ if update_type == "undeleteMessage":
520
596
  if (
521
597
  context.activity.type == ActivityTypes.message_update
522
598
  and isinstance(context.activity.channel_data, dict)
523
599
  ):
524
600
  data = context.activity.channel_data
525
- return data["event_type"] == type
601
+ return data["event_type"] == update_type
526
602
  return False
527
603
  return False
528
604
 
529
605
  def __call(func: RouteHandler[StateT]) -> RouteHandler[StateT]:
530
606
  logger.debug(
531
- f"Registering message update handler for route handler {func.__name__} with type: {type} with auth handlers: {auth_handlers}"
607
+ f"Registering message update handler for route handler {func.__name__} with type: {update_type} with auth handlers: {auth_handlers}"
532
608
  )
533
609
  self.add_route(__selector, func, auth_handlers=auth_handlers, **kwargs)
534
610
  return func
535
611
 
536
612
  return __call
537
613
 
614
+ @overload
538
615
  def handoff(
539
- self, *, auth_handlers: Optional[list[str]] = None, **kwargs
616
+ self,
617
+ func: Callable[[TurnContext, StateT, str], Awaitable[None]],
618
+ *,
619
+ auth_handlers: Optional[list[str]] = None,
620
+ **kwargs,
621
+ ) -> Callable[[TurnContext, StateT, str], Awaitable[None]]: ...
622
+
623
+ @overload
624
+ def handoff(
625
+ self,
626
+ *,
627
+ auth_handlers: Optional[list[str]] = None,
628
+ **kwargs: Any,
540
629
  ) -> Callable[
541
630
  [Callable[[TurnContext, StateT, str], Awaitable[None]]],
542
631
  Callable[[TurnContext, StateT, str], Awaitable[None]],
543
- ]:
632
+ ]: ...
633
+
634
+ def handoff(
635
+ self,
636
+ func: Optional[Callable[[TurnContext, StateT, str], Awaitable[None]]] = None,
637
+ *,
638
+ auth_handlers: Optional[list[str]] = None,
639
+ **kwargs,
640
+ ) -> (
641
+ Callable[[TurnContext, StateT, str], Awaitable[None]]
642
+ | Callable[
643
+ [Callable[[TurnContext, StateT, str], Awaitable[None]]],
644
+ Callable[[TurnContext, StateT, str], Awaitable[None]],
645
+ ]
646
+ ):
544
647
  """
545
648
  Register a handler to hand off conversations from one copilot to another.
546
649
 
@@ -551,6 +654,8 @@ class AgentApplication(Agent, Generic[StateT]):
551
654
  async def on_handoff(context: TurnContext, state: TurnState, continuation: str):
552
655
  print(continuation)
553
656
 
657
+ :param func: Optional handler to register directly without using decorator syntax.
658
+ :type func: Optional[Callable[[TurnContext, StateT, str], Awaitable[None]]]
554
659
  :param auth_handlers: Optional list of authorization handler IDs for the route.
555
660
  :type auth_handlers: Optional[list[str]]
556
661
  :param kwargs: Additional route configuration passed to :meth:`microsoft_agents.hosting.core.AgentApplication.add_route`.
@@ -566,24 +671,29 @@ class AgentApplication(Agent, Generic[StateT]):
566
671
  func: Callable[[TurnContext, StateT, str], Awaitable[None]],
567
672
  ) -> Callable[[TurnContext, StateT, str], Awaitable[None]]:
568
673
  async def __handler(context: TurnContext, state: StateT):
569
- if not context.activity.value:
570
- return False
571
- await func(context, state, context.activity.value["continuation"])
674
+ if (
675
+ isinstance(context.activity.value, dict)
676
+ and "continuation" in context.activity.value
677
+ ):
678
+ await func(context, state, context.activity.value["continuation"])
679
+ else:
680
+ logger.warning("Invalid handoff action received")
572
681
  await context.send_activity(
573
682
  Activity(
574
683
  type=ActivityTypes.invoke_response,
575
684
  value=InvokeResponse(status=200),
576
685
  )
577
686
  )
578
- return True
579
687
 
580
688
  logger.debug(
581
689
  f"Registering handoff handler for route handler {func.__name__} with auth handlers: {auth_handlers}"
582
690
  )
583
691
 
584
- self.add_route(__selector, func, auth_handlers=auth_handlers, **kwargs)
692
+ self.add_route(__selector, __handler, auth_handlers=auth_handlers, **kwargs)
585
693
  return func
586
694
 
695
+ if func is not None:
696
+ return __call(func)
587
697
  return __call
588
698
 
589
699
  def on_sign_in_success(
@@ -3,10 +3,8 @@ Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  Licensed under the MIT License.
4
4
  """
5
5
 
6
- from datetime import datetime
7
6
  import logging
8
- from typing import TypeVar, Optional, Callable, Awaitable, Generic, cast
9
- import jwt
7
+ from typing import Optional, Callable, Awaitable, cast
10
8
 
11
9
  from microsoft_agents.activity import Activity, Channels, SignInConstants, TokenResponse
12
10
  from microsoft_agents.activity.activity_types import ActivityTypes
@@ -126,6 +124,18 @@ class Authorization:
126
124
  auth_handler=auth_handler,
127
125
  )
128
126
 
127
+ @property
128
+ def connection_manager(self) -> Connections:
129
+ """
130
+ The connection manager for the authorization instance.
131
+
132
+ The connection manager is responsible for managing the connections to the various authentication providers.
133
+
134
+ :return: The connection manager.
135
+ :rtype: :class:`microsoft_agents.hosting.core.authorization.Connections`
136
+ """
137
+ return self._connection_manager
138
+
129
139
  @staticmethod
130
140
  def _sign_in_state_key(context: TurnContext) -> str:
131
141
  """Generate a unique storage key for the sign-in state based on the context.
@@ -93,12 +93,12 @@ class TurnContext(TurnContextProtocol):
93
93
  setattr(context, attribute, getattr(self, attribute))
94
94
 
95
95
  @property
96
- def activity(self):
96
+ def activity(self) -> Activity:
97
97
  """
98
98
  The received activity.
99
99
  :return:
100
100
  """
101
- return self._activity
101
+ return self._activity # type: ignore[return-value]
102
102
 
103
103
  @activity.setter
104
104
  def activity(self, value):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-hosting-core
3
- Version: 1.2.0.dev1
3
+ Version: 1.2.0.dev5
4
4
  Summary: Core library for Microsoft Agents
5
5
  Author: Microsoft Corporation
6
6
  License-Expression: MIT
@@ -15,7 +15,7 @@ Classifier: Operating System :: OS Independent
15
15
  Requires-Python: >=3.10
16
16
  Description-Content-Type: text/markdown
17
17
  License-File: LICENSE
18
- Requires-Dist: microsoft-agents-activity==1.2.0.dev1
18
+ Requires-Dist: microsoft-agents-activity==1.2.0.dev5
19
19
  Requires-Dist: pyjwt>=2.10.1
20
20
  Requires-Dist: isodate>=0.6.1
21
21
  Requires-Dist: azure-core>=1.30.0
@@ -1,4 +1,4 @@
1
- microsoft-agents-activity==1.2.0.dev1
1
+ microsoft-agents-activity==1.2.0.dev5
2
2
  pyjwt>=2.10.1
3
3
  isodate>=0.6.1
4
4
  azure-core>=1.30.0
@@ -1 +0,0 @@
1
- 1.2.0.dev1