microsoft-agents-hosting-core 1.2.0.dev20__tar.gz → 1.4.0.dev13__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 (192) hide show
  1. {microsoft_agents_hosting_core-1.2.0.dev20/microsoft_agents_hosting_core.egg-info → microsoft_agents_hosting_core-1.4.0.dev13}/PKG-INFO +33 -4
  2. microsoft_agents_hosting_core-1.4.0.dev13/VERSION.txt +1 -0
  3. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/__init__.py +15 -3
  4. {microsoft_agents_hosting_core-1.2.0.dev20/microsoft_agents/hosting/core/http → microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core}/_http_adapter_base.py +39 -22
  5. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/_oauth/_oauth_flow.py +17 -32
  6. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/_utils/__init__.py +6 -0
  7. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/_utils/_service_set.py +55 -0
  8. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/_type_defs.py +6 -0
  9. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/agent_application.py +123 -46
  10. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/app_options.py +1 -0
  11. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/oauth/_handlers/_authorization_handler.py +4 -0
  12. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/oauth/_handlers/_user_authorization.py +34 -17
  13. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py +23 -2
  14. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/oauth/_handlers/connector_user_authorization.py +1 -1
  15. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/oauth/authorization.py +52 -24
  16. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/proactive/conversation.py +7 -11
  17. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/streaming/streaming_response.py +8 -3
  18. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/telemetry/spans.py +2 -0
  19. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/authorization/__init__.py +6 -1
  20. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/authorization/_entra_issuers.py +197 -0
  21. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/authorization/_log_config.py +172 -0
  22. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/authorization/access_token_provider_base.py +16 -3
  23. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py +300 -0
  24. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/authorization/anonymous_token_provider.py +9 -0
  25. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/authorization/auth_types.py +2 -0
  26. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/authorization/authentication_constants.py +12 -2
  27. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/authorization/connection_manager.py +224 -0
  28. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/authorization/connection_settings_base.py +111 -0
  29. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/authorization/connections.py +26 -0
  30. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/authorization/jwt/__init__.py +10 -0
  31. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/authorization/jwt/_authorize_request.py +62 -0
  32. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/authorization/jwt/jwt_token_validator.py +272 -0
  33. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/card_factory.py +13 -41
  34. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/channel_adapter.py +10 -10
  35. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/channel_service_adapter.py +66 -79
  36. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/client/channel_factory_protocol.py +2 -1
  37. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/client/channel_host_protocol.py +5 -0
  38. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/client/channel_protocol.py +1 -1
  39. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/__init__.py +3 -0
  40. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/connector/_utils.py +27 -0
  41. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/client/__init__.py +3 -0
  42. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/connector/client/_base_client.py +94 -0
  43. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/connector/client/agent_sign_in.py +111 -0
  44. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/client/connector_client.py +146 -125
  45. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/connector/client/user_token.py +271 -0
  46. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/connector/client/user_token_client.py +300 -0
  47. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/connector_client_base.py +7 -1
  48. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/mcs/mcs_connector_client.py +9 -10
  49. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/connector/user_token_client_base.py +119 -0
  50. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/header_propagation/__init__.py +13 -0
  51. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/header_propagation/agentic_header_provider.py +76 -0
  52. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/header_propagation/header_propagation_context.py +76 -0
  53. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/header_propagation/header_value_provider.py +25 -0
  54. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/http/__init__.py +0 -2
  55. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/http/_channel_service_routes.py +25 -9
  56. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/http/_http_request_protocol.py +2 -2
  57. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/http/_http_response.py +5 -5
  58. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/message_factory.py +16 -10
  59. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/rest_channel_service_client_factory.py +20 -19
  60. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/storage/__init__.py +8 -4
  61. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/storage/_type_aliases.py +6 -0
  62. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/storage/error_handling.py +45 -0
  63. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/storage/memory_storage.py +29 -15
  64. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/storage/storage.py +49 -20
  65. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/storage/store_item.py +30 -0
  66. microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/storage/transcript/__init__.py +24 -0
  67. {microsoft_agents_hosting_core-1.2.0.dev20/microsoft_agents/hosting/core/storage → microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/storage/transcript}/transcript_logger.py +3 -3
  68. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/attributes.py +1 -0
  69. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/turn_context.py +110 -108
  70. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents_hosting_core.egg-info}/PKG-INFO +33 -4
  71. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents_hosting_core.egg-info/SOURCES.txt +24 -7
  72. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents_hosting_core.egg-info/requires.txt +1 -2
  73. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/readme.md +31 -1
  74. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/setup.py +0 -1
  75. microsoft_agents_hosting_core-1.2.0.dev20/VERSION.txt +0 -1
  76. microsoft_agents_hosting_core-1.2.0.dev20/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py +0 -119
  77. microsoft_agents_hosting_core-1.2.0.dev20/microsoft_agents/hosting/core/authorization/jwt_token_validator.py +0 -116
  78. microsoft_agents_hosting_core-1.2.0.dev20/microsoft_agents/hosting/core/connector/client/user_token_client.py +0 -403
  79. microsoft_agents_hosting_core-1.2.0.dev20/microsoft_agents/hosting/core/connector/user_token_client_base.py +0 -20
  80. microsoft_agents_hosting_core-1.2.0.dev20/microsoft_agents/hosting/core/storage/_type_aliases.py +0 -3
  81. microsoft_agents_hosting_core-1.2.0.dev20/microsoft_agents/hosting/core/storage/error_handling.py +0 -42
  82. microsoft_agents_hosting_core-1.2.0.dev20/microsoft_agents/hosting/core/storage/store_item.py +0 -15
  83. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/LICENSE +0 -0
  84. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/MANIFEST.in +0 -0
  85. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/_oauth/__init__.py +0 -0
  86. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/_oauth/_flow_state.py +0 -0
  87. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/_oauth/_flow_storage_client.py +0 -0
  88. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/activity_handler.py +0 -0
  89. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/agent.py +0 -0
  90. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/__init__.py +0 -0
  91. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/_routes/__init__.py +0 -0
  92. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/_routes/_route.py +0 -0
  93. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/_routes/_route_list.py +0 -0
  94. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/_routes/route_rank.py +0 -0
  95. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/app_error.py +0 -0
  96. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/input_file.py +0 -0
  97. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/oauth/__init__.py +0 -0
  98. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py +0 -0
  99. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/oauth/_sign_in_response.py +0 -0
  100. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/oauth/_sign_in_state.py +0 -0
  101. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/oauth/auth_handler.py +0 -0
  102. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/oauth/telemetry/__init__.py +0 -0
  103. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/oauth/telemetry/constants.py +0 -0
  104. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/oauth/telemetry/spans.py +0 -0
  105. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/proactive/__init__.py +0 -0
  106. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/proactive/conversation_builder.py +0 -0
  107. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/proactive/conversation_reference_builder.py +0 -0
  108. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/proactive/create_conversation_options.py +0 -0
  109. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/proactive/proactive.py +0 -0
  110. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/proactive/proactive_options.py +0 -0
  111. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/proactive/telemetry/__init__.py +0 -0
  112. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/proactive/telemetry/constants.py +0 -0
  113. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/proactive/telemetry/spans.py +0 -0
  114. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/query.py +0 -0
  115. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/state/__init__.py +0 -0
  116. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/state/conversation_state.py +0 -0
  117. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/state/state.py +0 -0
  118. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/state/temp_state.py +0 -0
  119. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/state/turn_state.py +0 -0
  120. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/streaming/__init__.py +0 -0
  121. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/streaming/citation.py +0 -0
  122. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/streaming/citation_util.py +0 -0
  123. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/telemetry/__init__.py +0 -0
  124. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/telemetry/constants.py +0 -0
  125. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/telemetry/metrics.py +0 -0
  126. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/app/typing_indicator.py +0 -0
  127. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/authorization/claims_identity.py +0 -0
  128. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/authorization/telemetry/__init__.py +0 -0
  129. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/authorization/telemetry/constants.py +0 -0
  130. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/authorization/telemetry/metrics.py +0 -0
  131. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/authorization/telemetry/spans.py +0 -0
  132. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/channel_api_handler_protocol.py +0 -0
  133. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/channel_service_client_factory_base.py +0 -0
  134. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/client/__init__.py +0 -0
  135. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/client/agent_conversation_reference.py +0 -0
  136. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/client/channel_info_protocol.py +0 -0
  137. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/client/channels_configuration.py +0 -0
  138. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/client/configuration_channel_host.py +0 -0
  139. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/client/conversation_constants.py +0 -0
  140. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/client/conversation_id_factory.py +0 -0
  141. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/client/conversation_id_factory_options.py +0 -0
  142. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py +0 -0
  143. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/client/http_agent_channel.py +0 -0
  144. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/client/http_agent_channel_factory.py +0 -0
  145. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/agent_sign_in_base.py +0 -0
  146. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/attachments_base.py +0 -0
  147. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/conversations_base.py +0 -0
  148. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/get_product_info.py +0 -0
  149. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/mcs/__init__.py +0 -0
  150. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/teams/__init__.py +0 -0
  151. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/teams/teams_connector_client.py +0 -0
  152. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/telemetry/__init__.py +0 -0
  153. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/telemetry/_request_span_wrapper.py +0 -0
  154. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/telemetry/connector_spans.py +0 -0
  155. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/telemetry/constants.py +0 -0
  156. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/telemetry/metrics.py +0 -0
  157. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/telemetry/user_token_client_spans.py +0 -0
  158. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/connector/user_token_base.py +0 -0
  159. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/errors/__init__.py +0 -0
  160. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/errors/error_resources.py +0 -0
  161. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/middleware_set.py +0 -0
  162. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/state/__init__.py +0 -0
  163. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/state/agent_state.py +0 -0
  164. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/state/state_property_accessor.py +0 -0
  165. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/state/user_state.py +0 -0
  166. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/storage/telemetry/__init__.py +0 -0
  167. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/storage/telemetry/constants.py +0 -0
  168. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/storage/telemetry/metrics.py +0 -0
  169. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/storage/telemetry/spans.py +0 -0
  170. {microsoft_agents_hosting_core-1.2.0.dev20/microsoft_agents/hosting/core/storage → microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/storage/transcript}/transcript_file_store.py +0 -0
  171. {microsoft_agents_hosting_core-1.2.0.dev20/microsoft_agents/hosting/core/storage → microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/storage/transcript}/transcript_info.py +0 -0
  172. {microsoft_agents_hosting_core-1.2.0.dev20/microsoft_agents/hosting/core/storage → microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/storage/transcript}/transcript_memory_store.py +0 -0
  173. {microsoft_agents_hosting_core-1.2.0.dev20/microsoft_agents/hosting/core/storage → microsoft_agents_hosting_core-1.4.0.dev13/microsoft_agents/hosting/core/storage/transcript}/transcript_store.py +0 -0
  174. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/__init__.py +0 -0
  175. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/adapter/__init__.py +0 -0
  176. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/adapter/constants.py +0 -0
  177. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/adapter/metrics.py +0 -0
  178. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/adapter/spans.py +0 -0
  179. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/core/__init__.py +0 -0
  180. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/core/_agents_telemetry.py +0 -0
  181. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/core/base_span_wrapper.py +0 -0
  182. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/core/resource.py +0 -0
  183. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/core/simple_span_wrapper.py +0 -0
  184. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/core/type_defs.py +0 -0
  185. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/turn_context/__init__.py +0 -0
  186. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/turn_context/constants.py +0 -0
  187. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/turn_context/spans.py +0 -0
  188. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents/hosting/core/telemetry/utils.py +0 -0
  189. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents_hosting_core.egg-info/dependency_links.txt +0 -0
  190. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/microsoft_agents_hosting_core.egg-info/top_level.txt +0 -0
  191. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/pyproject.toml +0 -0
  192. {microsoft_agents_hosting_core-1.2.0.dev20 → microsoft_agents_hosting_core-1.4.0.dev13}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-hosting-core
3
- Version: 1.2.0.dev20
3
+ Version: 1.4.0.dev13
4
4
  Summary: Core library for Microsoft Agents
5
5
  Author: Microsoft Corporation
6
6
  License-Expression: MIT
@@ -15,10 +15,9 @@ 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.dev20
18
+ Requires-Dist: microsoft-agents-activity==1.4.0.dev13
19
19
  Requires-Dist: pyjwt>=2.10.1
20
20
  Requires-Dist: isodate>=0.6.1
21
- Requires-Dist: azure-core>=1.30.0
22
21
  Requires-Dist: python-dotenv>=1.1.1
23
22
  Requires-Dist: opentelemetry-api>=1.27.0
24
23
  Requires-Dist: opentelemetry-sdk>=1.27.0
@@ -43,6 +42,24 @@ This library is part of the **Microsoft 365 Agents SDK for Python** - a comprehe
43
42
  <th style="width:20%">Date</th>
44
43
  <th style="width:60%">Release Notes</th>
45
44
  </tr>
45
+ <tr>
46
+ <td>1.3.0</td>
47
+ <td>2026-07-30</td>
48
+ <td>
49
+ <a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v130">
50
+ 1.3.0 Release Notes
51
+ </a>
52
+ </td>
53
+ </tr>
54
+ <tr>
55
+ <td>1.2.0</td>
56
+ <td>2026-07-17</td>
57
+ <td>
58
+ <a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v120">
59
+ 1.2.0 Release Notes
60
+ </a>
61
+ </td>
62
+ </tr>
46
63
  <tr>
47
64
  <td>1.1.0</td>
48
65
  <td>2026-06-19</td>
@@ -61,6 +78,15 @@ This library is part of the **Microsoft 365 Agents SDK for Python** - a comprehe
61
78
  </a>
62
79
  </td>
63
80
  </tr>
81
+ <tr>
82
+ <td>0.9.1</td>
83
+ <td>2026-05-04</td>
84
+ <td>
85
+ <a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v091">
86
+ 0.9.1 Release Notes
87
+ </a>
88
+ </td>
89
+ </tr>
64
90
  <tr>
65
91
  <td>0.9.0</td>
66
92
  <td>2026-04-15</td>
@@ -126,11 +152,14 @@ We offer the following PyPI packages to create conversational experiences based
126
152
  | `microsoft-agents-activity` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-activity)](https://pypi.org/project/microsoft-agents-activity/) | Types and validators implementing the Activity protocol spec. |
127
153
  | `microsoft-agents-hosting-core` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-core)](https://pypi.org/project/microsoft-agents-hosting-core/) | Core library for Microsoft Agents hosting. |
128
154
  | `microsoft-agents-hosting-aiohttp` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-aiohttp)](https://pypi.org/project/microsoft-agents-hosting-aiohttp/) | Configures aiohttp to run the Agent. |
129
- | `microsoft-agents-hosting-teams` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-teams)](https://pypi.org/project/microsoft-agents-hosting-teams/) | Provides classes to host an Agent for Teams. |
155
+ | `microsoft-agents-hosting-fastapi` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-fastapi)](https://pypi.org/project/microsoft-agents-hosting-fastapi/) | Configures fastapi to run the Agent. |
156
+ | `microsoft-agents-hosting-msteams` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-msteams)](https://pypi.org/project/microsoft-agents-hosting-msteams/) | Provides classes to host an Agent for Teams. |
130
157
  | `microsoft-agents-hosting-dialogs` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-dialogs)](https://pypi.org/project/microsoft-agents-hosting-dialogs/) | Dialog system with waterfall dialogs, prompts, and multi-turn conversation management. |
158
+ | `microsoft-agents-hosting-slack` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-hosting-slack)](https://pypi.org/project/microsoft-agents-hosting-slack/) | Provides classes to host an Agent for Slack. |
131
159
  | `microsoft-agents-storage-blob` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-storage-blob)](https://pypi.org/project/microsoft-agents-storage-blob/) | Extension to use Azure Blob as storage. |
132
160
  | `microsoft-agents-storage-cosmos` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-storage-cosmos)](https://pypi.org/project/microsoft-agents-storage-cosmos/) | Extension to use CosmosDB as storage. |
133
161
  | `microsoft-agents-authentication-msal` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-authentication-msal)](https://pypi.org/project/microsoft-agents-authentication-msal/) | MSAL-based authentication for Microsoft Agents. |
162
+ | `microsoft-agents-authentication-entra-auth-sidecar` | [![PyPI](https://img.shields.io/pypi/v/microsoft-agents-authentication-entra-auth-sidecar)](https://pypi.org/project/microsoft-agents-authentication-entra-auth-sidecar/) | Credential-free Entra ID Agent ID authentication via the sidecar. |
134
163
 
135
164
  Additionally we provide a Copilot Studio Client, to interact with Agents created in CopilotStudio:
136
165
 
@@ -0,0 +1 @@
1
+ 1.4.0.dev13
@@ -15,9 +15,9 @@ from .http import (
15
15
  HttpRequestProtocol,
16
16
  HttpResponse,
17
17
  HttpResponseFactory,
18
- HttpAdapterBase,
19
18
  ChannelServiceRoutes,
20
19
  )
20
+ from ._http_adapter_base import HttpAdapterBase
21
21
 
22
22
  # Application Style
23
23
  from .app._type_defs import RouteHandler, RouteSelector, StateT
@@ -54,9 +54,10 @@ from .authorization.access_token_provider_base import AccessTokenProviderBase
54
54
  from .authorization.authentication_constants import AuthenticationConstants
55
55
  from .authorization.anonymous_token_provider import AnonymousTokenProvider
56
56
  from .authorization.connections import Connections
57
+ from .authorization.connection_manager import ConnectionManager
57
58
  from .authorization.agent_auth_configuration import AgentAuthConfiguration
58
59
  from .authorization.claims_identity import ClaimsIdentity
59
- from .authorization.jwt_token_validator import JwtTokenValidator
60
+ from .authorization.jwt.jwt_token_validator import JwtTokenValidator
60
61
  from .authorization.auth_types import AuthTypes
61
62
 
62
63
  # Client API
@@ -88,6 +89,13 @@ from .connector import (
88
89
  get_product_info,
89
90
  )
90
91
 
92
+ # Header propagation
93
+ from .header_propagation import (
94
+ HeaderValueProvider,
95
+ AgenticHeaderProvider,
96
+ HeaderPropagationContext,
97
+ )
98
+
91
99
  # State management
92
100
  from .state.agent_state import AgentState
93
101
  from .state.state_property_accessor import StatePropertyAccessor
@@ -125,7 +133,7 @@ __all__ = [
125
133
  "InputFile",
126
134
  "InputFileDownloader",
127
135
  "Query",
128
- "Route",
136
+ "_Route",
129
137
  "RouteHandler",
130
138
  "TypingIndicator",
131
139
  "Citation",
@@ -142,6 +150,7 @@ __all__ = [
142
150
  "AuthenticationConstants",
143
151
  "AnonymousTokenProvider",
144
152
  "Connections",
153
+ "ConnectionManager",
145
154
  "AgentAuthConfiguration",
146
155
  "ClaimsIdentity",
147
156
  "JwtTokenValidator",
@@ -166,6 +175,9 @@ __all__ = [
166
175
  "TeamsConnectorClient",
167
176
  "ConnectorClientBase",
168
177
  "get_product_info",
178
+ "HeaderValueProvider",
179
+ "AgenticHeaderProvider",
180
+ "HeaderPropagationContext",
169
181
  "AgentState",
170
182
  "StatePropertyAccessor",
171
183
  "UserState",
@@ -4,22 +4,22 @@
4
4
  """Base HTTP adapter with shared processing logic."""
5
5
 
6
6
  from abc import ABC
7
+ from http import HTTPStatus
7
8
  from traceback import format_exc
8
9
 
9
10
  from microsoft_agents.activity import Activity, DeliveryModes
10
- from microsoft_agents.hosting.core.authorization import ClaimsIdentity, Connections
11
- from microsoft_agents.hosting.core import (
12
- Agent,
13
- ChannelServiceAdapter,
14
- ChannelServiceClientFactoryBase,
15
- MessageFactory,
16
- RestChannelServiceClientFactory,
17
- TurnContext,
18
- )
19
11
  from microsoft_agents.hosting.core.telemetry.adapter import spans
20
12
 
21
- from ._http_request_protocol import HttpRequestProtocol
22
- from ._http_response import HttpResponse, HttpResponseFactory
13
+ from .agent import Agent
14
+ from .authorization.claims_identity import ClaimsIdentity
15
+ from .authorization.connections import Connections
16
+ from .channel_service_adapter import ChannelServiceAdapter
17
+ from .channel_service_client_factory_base import ChannelServiceClientFactoryBase
18
+ from .http._http_request_protocol import HttpRequestProtocol
19
+ from .http._http_response import HttpResponse, HttpResponseFactory
20
+ from .message_factory import MessageFactory
21
+ from .rest_channel_service_client_factory import RestChannelServiceClientFactory
22
+ from .turn_context import TurnContext
23
23
 
24
24
 
25
25
  class HttpAdapterBase(ChannelServiceAdapter, ABC):
@@ -34,12 +34,14 @@ class HttpAdapterBase(ChannelServiceAdapter, ABC):
34
34
  *,
35
35
  connection_manager: Connections | None = None,
36
36
  channel_service_client_factory: ChannelServiceClientFactoryBase | None = None,
37
+ channel_service_client_factory_options: dict | None = None,
37
38
  ):
38
39
  """Initialize the HTTP adapter.
39
40
 
40
- Args:
41
- connection_manager: Optional connection manager for OAuth.
42
- channel_service_client_factory: Factory for creating channel service clients.
41
+ :param connection_manager: Optional connection manager for OAuth.
42
+ :param channel_service_client_factory: Factory for creating channel service clients.
43
+ :param channel_service_client_factory_options: Optional dictionary of options to pass to the channel service client factory
44
+ This is only used if channel_service_client_factory is not provided and connection_manager is provided.
43
45
  """
44
46
 
45
47
  async def on_turn_error(context: TurnContext, error: Exception):
@@ -58,12 +60,21 @@ class HttpAdapterBase(ChannelServiceAdapter, ABC):
58
60
 
59
61
  self.on_turn_error = on_turn_error
60
62
 
61
- channel_service_client_factory = (
62
- channel_service_client_factory
63
- or RestChannelServiceClientFactory(connection_manager)
64
- )
63
+ factory: ChannelServiceClientFactoryBase
65
64
 
66
- super().__init__(channel_service_client_factory)
65
+ if channel_service_client_factory:
66
+ factory = channel_service_client_factory
67
+ else:
68
+ if not connection_manager:
69
+ raise ValueError(
70
+ "HttpAdapterBase.__init__: Either channel_service_client_factory or connection_manager must be provided."
71
+ )
72
+ factory = RestChannelServiceClientFactory(
73
+ connection_manager,
74
+ **(channel_service_client_factory_options or {}),
75
+ )
76
+
77
+ super().__init__(factory)
67
78
 
68
79
  async def process_request(
69
80
  self, request: HttpRequestProtocol, agent: Agent
@@ -101,8 +112,10 @@ class HttpAdapterBase(ChannelServiceAdapter, ABC):
101
112
  span.share(activity=activity)
102
113
 
103
114
  # Get claims identity (default to anonymous if not set by middleware)
104
- claims_identity: ClaimsIdentity = (
105
- request.get_claims_identity() or ClaimsIdentity({}, False)
115
+ claims_identity: (
116
+ ClaimsIdentity
117
+ ) = request.get_claims_identity() or ClaimsIdentity(
118
+ {}, False, authentication_type="Anonymous"
106
119
  )
107
120
 
108
121
  # Validate required activity fields
@@ -128,8 +141,12 @@ class HttpAdapterBase(ChannelServiceAdapter, ABC):
128
141
  ):
129
142
  with spans.AdapterWriteResponse(activity):
130
143
  # Invoke and ExpectReplies cannot be performed async
144
+ invoke_response_status = (
145
+ invoke_response.status if invoke_response else None
146
+ )
131
147
  return HttpResponseFactory.json(
132
- invoke_response.body, invoke_response.status
148
+ invoke_response.body if invoke_response else None,
149
+ invoke_response_status or HTTPStatus.NOT_IMPLEMENTED,
133
150
  )
134
151
 
135
152
  return HttpResponseFactory.accepted()
@@ -12,12 +12,12 @@ from typing import Optional
12
12
  from microsoft_agents.activity import (
13
13
  Activity,
14
14
  ActivityTypes,
15
- TokenExchangeState,
15
+ TokenExchangeRequest,
16
16
  TokenResponse,
17
17
  SignInResource,
18
18
  )
19
19
 
20
- from ..connector.client import UserTokenClient
20
+ from ..connector import UserTokenClientBase
21
21
  from ._flow_state import _FlowState, _FlowStateTag, _FlowErrorTag
22
22
 
23
23
  logger = logging.getLogger(__name__)
@@ -38,16 +38,10 @@ class _OAuthFlow:
38
38
 
39
39
  This class is responsible for managing the entire OAuth flow, including
40
40
  obtaining user tokens, signing out users, and handling token exchanges.
41
-
42
- Contract with other classes (usage of other classes is enforced in unit tests):
43
- TurnContext.activity.channel_id
44
- TurnContext.activity.from_property.id
45
-
46
- UserTokenClient: user_token.get_token(), user_token.sign_out()
47
41
  """
48
42
 
49
43
  def __init__(
50
- self, flow_state: _FlowState, user_token_client: UserTokenClient, **kwargs
44
+ self, flow_state: _FlowState, user_token_client: UserTokenClientBase, **kwargs
51
45
  ):
52
46
  """
53
47
  Arguments:
@@ -125,13 +119,11 @@ class _OAuthFlow:
125
119
  self._user_id,
126
120
  self._abs_oauth_connection_name,
127
121
  )
128
- token_response: TokenResponse = (
129
- await self._user_token_client.user_token.get_token(
130
- user_id=self._user_id,
131
- connection_name=self._abs_oauth_connection_name,
132
- channel_id=self._channel_id,
133
- code=magic_code,
134
- )
122
+ token_response: TokenResponse = await self._user_token_client.get_user_token(
123
+ user_id=self._user_id,
124
+ connection_name=self._abs_oauth_connection_name,
125
+ channel_id=self._channel_id,
126
+ magic_code=magic_code,
135
127
  )
136
128
  if token_response:
137
129
  logger.info("User token obtained successfully: %s", token_response)
@@ -153,7 +145,7 @@ class _OAuthFlow:
153
145
  self._user_id,
154
146
  self._abs_oauth_connection_name,
155
147
  )
156
- await self._user_token_client.user_token.sign_out(
148
+ await self._user_token_client.sign_out_user(
157
149
  user_id=self._user_id,
158
150
  connection_name=self._abs_oauth_connection_name,
159
151
  channel_id=self._channel_id,
@@ -185,18 +177,9 @@ class _OAuthFlow:
185
177
 
186
178
  logger.debug("Starting new OAuth flow")
187
179
 
188
- token_exchange_state = TokenExchangeState(
180
+ res = await self._user_token_client.get_token_or_sign_in_resource(
189
181
  connection_name=self._abs_oauth_connection_name,
190
- conversation=activity.get_conversation_reference(force_base_channel=True),
191
- relates_to=activity.relates_to,
192
- ms_app_id=self._ms_app_id,
193
- )
194
-
195
- res = await self._user_token_client.user_token._get_token_or_sign_in_resource(
196
- activity.from_property.id,
197
- self._abs_oauth_connection_name,
198
- token_exchange_state.conversation.channel_id,
199
- token_exchange_state.get_encoded_state(),
182
+ activity=activity,
200
183
  )
201
184
 
202
185
  if res.token_response:
@@ -251,16 +234,18 @@ class _OAuthFlow:
251
234
  """Handles the continuation of the flow from an invoke activity for token exchange."""
252
235
  token_exchange_request = activity.value
253
236
  try:
254
- token_response = await self._user_token_client.user_token.exchange_token(
237
+ token_response = await self._user_token_client.exchange_token(
255
238
  user_id=self._user_id,
256
239
  connection_name=self._abs_oauth_connection_name,
257
240
  channel_id=self._channel_id,
258
- body=token_exchange_request,
241
+ exchange_request=TokenExchangeRequest.model_validate(
242
+ token_exchange_request
243
+ ),
259
244
  )
260
245
  return token_response, _FlowErrorTag.NONE
261
246
  except Exception as e:
262
247
  # A 400 with 'ConsentRequired' means the user hasn't consented yet.
263
- # Return None so the caller can send a 412 back to Teams, which will
248
+ # Return TokenResponse() so the caller can send a 412 back to Teams, which will
264
249
  # prompt the user for consent and retry the token exchange.
265
250
  # Any other error is a critical failure and should propagate.
266
251
  if getattr(e, "status", None) == 400 and "Consent Required" in getattr(
@@ -271,7 +256,7 @@ class _OAuthFlow:
271
256
  self._user_id,
272
257
  )
273
258
 
274
- return None, _FlowErrorTag.PRECONDITION_FAILED
259
+ return TokenResponse(), _FlowErrorTag.PRECONDITION_FAILED
275
260
  raise
276
261
 
277
262
  async def continue_flow(self, activity: Activity) -> _FlowResponse:
@@ -0,0 +1,6 @@
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License.
3
+
4
+ from ._service_set import _ServiceSet
5
+
6
+ __all__ = ["_ServiceSet"]
@@ -0,0 +1,55 @@
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License.
3
+
4
+ from __future__ import annotations
5
+
6
+ from typing import TypeVar, cast, Any
7
+
8
+ T = TypeVar("T")
9
+
10
+
11
+ class _ServiceSet:
12
+ """
13
+ A class that represents a collection of services, allowing for the storage and retrieval of service instances by their type.
14
+ """
15
+
16
+ def __init__(self, service_set: _ServiceSet | None = None) -> None:
17
+ """
18
+ Initializes a new instance of the _ServiceSet class.
19
+
20
+ :param service_set: An optional _ServiceSet instance to copy the state from.
21
+ """
22
+ self._state: dict[type, Any] = {}
23
+ if service_set is not None:
24
+ self._state.update(service_set._state)
25
+
26
+ def get(self, key: type[T]) -> T | None:
27
+ """
28
+ Gets a value from the state collection.
29
+ :param key:
30
+ :return:
31
+ """
32
+ val = self._state.get(key)
33
+ if val is not None:
34
+ if not isinstance(val, key):
35
+ raise TypeError(
36
+ f"Value for key '{key.__name__}' is not of type {key.__name__} (got {type(val).__name__})"
37
+ )
38
+ return cast(T, val)
39
+ return None
40
+
41
+ def has(self, key: type) -> bool:
42
+ """
43
+ Checks if a value exists in the state collection.
44
+ :param key: Type of the value to check for.
45
+ :return: True if the value exists, False otherwise.
46
+ """
47
+ return key in self._state
48
+
49
+ def set(self, key: type[T], value: T) -> None:
50
+ """
51
+ Sets a value in the state collection.
52
+ :param key: Type of the value to set.
53
+ :param value: The value to set.
54
+ """
55
+ self._state[key] = value
@@ -13,3 +13,9 @@ StateT = TypeVar("StateT", bound=TurnState)
13
13
 
14
14
  class RouteHandler(Protocol[StateT]):
15
15
  def __call__(self, context: TurnContext, state: StateT, /) -> Awaitable[None]: ...
16
+
17
+
18
+ class HandoffHandler(Protocol[StateT]):
19
+ def __call__(
20
+ self, context: TurnContext, state: StateT, handoff_data: str
21
+ ) -> Awaitable[None]: ...