microsoft-agents-hosting-core 1.4.0.dev18__tar.gz → 1.5.0.dev8__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 (193) hide show
  1. {microsoft_agents_hosting_core-1.4.0.dev18/microsoft_agents_hosting_core.egg-info → microsoft_agents_hosting_core-1.5.0.dev8}/PKG-INFO +13 -2
  2. microsoft_agents_hosting_core-1.5.0.dev8/VERSION.txt +1 -0
  3. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/__init__.py +2 -0
  4. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/_http_adapter_base.py +68 -4
  5. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/agent_application.py +1 -0
  6. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/proactive/conversation.py +47 -6
  7. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/proactive/conversation_builder.py +35 -34
  8. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/proactive/conversation_reference_builder.py +31 -29
  9. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/proactive/create_conversation_options.py +6 -7
  10. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/proactive/proactive.py +46 -41
  11. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/proactive/proactive_options.py +2 -3
  12. microsoft_agents_hosting_core-1.5.0.dev8/microsoft_agents/hosting/core/app/proactive/telemetry/_utils.py +38 -0
  13. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/proactive/telemetry/spans.py +20 -4
  14. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py +25 -0
  15. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/claims_identity.py +69 -9
  16. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/jwt/jwt_token_validator.py +2 -2
  17. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/channel_service_adapter.py +17 -11
  18. microsoft_agents_hosting_core-1.5.0.dev8/microsoft_agents/hosting/core/outbound_host_validator.py +117 -0
  19. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/telemetry/core/_agents_telemetry.py +7 -2
  20. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/telemetry/core/base_span_wrapper.py +4 -4
  21. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/telemetry/core/simple_span_wrapper.py +22 -3
  22. microsoft_agents_hosting_core-1.5.0.dev8/microsoft_agents/hosting/core/telemetry/turn_context/__init__.py +0 -0
  23. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8/microsoft_agents_hosting_core.egg-info}/PKG-INFO +13 -2
  24. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents_hosting_core.egg-info/SOURCES.txt +3 -0
  25. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents_hosting_core.egg-info/requires.txt +3 -1
  26. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/pyproject.toml +4 -1
  27. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/readme.md +9 -0
  28. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/setup.py +2 -0
  29. microsoft_agents_hosting_core-1.4.0.dev18/VERSION.txt +0 -1
  30. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/LICENSE +0 -0
  31. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/MANIFEST.in +0 -0
  32. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/_oauth/__init__.py +0 -0
  33. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/_oauth/_flow_state.py +0 -0
  34. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/_oauth/_flow_storage_client.py +0 -0
  35. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/_oauth/_oauth_flow.py +0 -0
  36. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/_utils/__init__.py +0 -0
  37. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/_utils/_service_set.py +0 -0
  38. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/activity_handler.py +0 -0
  39. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/agent.py +0 -0
  40. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/__init__.py +0 -0
  41. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/_routes/__init__.py +0 -0
  42. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/_routes/_route.py +0 -0
  43. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/_routes/_route_list.py +0 -0
  44. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/_routes/route_rank.py +0 -0
  45. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/_type_defs.py +0 -0
  46. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/adaptive_card/__init__.py +0 -0
  47. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/adaptive_card/_type_defs.py +0 -0
  48. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/adaptive_card/adaptive_card.py +0 -0
  49. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/adaptive_card/factory.py +0 -0
  50. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/adaptive_card/models.py +0 -0
  51. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/app_error.py +0 -0
  52. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/app_options.py +0 -0
  53. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/input_file.py +0 -0
  54. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/oauth/__init__.py +0 -0
  55. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py +0 -0
  56. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/oauth/_handlers/_authorization_handler.py +0 -0
  57. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/oauth/_handlers/_user_authorization.py +0 -0
  58. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py +0 -0
  59. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/oauth/_handlers/connector_user_authorization.py +0 -0
  60. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/oauth/_sign_in_response.py +0 -0
  61. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/oauth/_sign_in_state.py +0 -0
  62. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/oauth/auth_handler.py +0 -0
  63. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/oauth/authorization.py +0 -0
  64. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/oauth/telemetry/__init__.py +0 -0
  65. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/oauth/telemetry/constants.py +0 -0
  66. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/oauth/telemetry/spans.py +0 -0
  67. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/proactive/__init__.py +0 -0
  68. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/proactive/telemetry/__init__.py +0 -0
  69. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/proactive/telemetry/constants.py +0 -0
  70. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/query.py +0 -0
  71. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/state/__init__.py +0 -0
  72. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/state/conversation_state.py +0 -0
  73. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/state/state.py +0 -0
  74. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/state/temp_state.py +0 -0
  75. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/state/turn_state.py +0 -0
  76. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/streaming/__init__.py +0 -0
  77. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/streaming/citation.py +0 -0
  78. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/streaming/citation_util.py +0 -0
  79. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/streaming/streaming_response.py +0 -0
  80. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/telemetry/__init__.py +0 -0
  81. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/telemetry/constants.py +0 -0
  82. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/telemetry/metrics.py +0 -0
  83. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/telemetry/spans.py +0 -0
  84. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/app/typing_indicator.py +0 -0
  85. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/__init__.py +0 -0
  86. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/_entra_issuers.py +0 -0
  87. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/_log_config.py +0 -0
  88. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/access_token_provider_base.py +0 -0
  89. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/anonymous_token_provider.py +0 -0
  90. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/auth_types.py +0 -0
  91. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/authentication_constants.py +0 -0
  92. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/connection_manager.py +0 -0
  93. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/connection_settings_base.py +0 -0
  94. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/connections.py +0 -0
  95. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/jwt/__init__.py +0 -0
  96. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/jwt/_authorize_request.py +0 -0
  97. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/telemetry/__init__.py +0 -0
  98. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/telemetry/constants.py +0 -0
  99. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/telemetry/metrics.py +0 -0
  100. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/authorization/telemetry/spans.py +0 -0
  101. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/card_factory.py +0 -0
  102. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/channel_adapter.py +0 -0
  103. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/channel_api_handler_protocol.py +0 -0
  104. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/channel_service_client_factory_base.py +0 -0
  105. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/client/__init__.py +0 -0
  106. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/client/agent_conversation_reference.py +0 -0
  107. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/client/channel_factory_protocol.py +0 -0
  108. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/client/channel_host_protocol.py +0 -0
  109. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/client/channel_info_protocol.py +0 -0
  110. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/client/channel_protocol.py +0 -0
  111. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/client/channels_configuration.py +0 -0
  112. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/client/configuration_channel_host.py +0 -0
  113. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/client/conversation_constants.py +0 -0
  114. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/client/conversation_id_factory.py +0 -0
  115. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/client/conversation_id_factory_options.py +0 -0
  116. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py +0 -0
  117. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/client/http_agent_channel.py +0 -0
  118. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/client/http_agent_channel_factory.py +0 -0
  119. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/__init__.py +0 -0
  120. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/_utils.py +0 -0
  121. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/agent_sign_in_base.py +0 -0
  122. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/attachments_base.py +0 -0
  123. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/client/__init__.py +0 -0
  124. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/client/_base_client.py +0 -0
  125. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/client/agent_sign_in.py +0 -0
  126. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/client/connector_client.py +0 -0
  127. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/client/user_token.py +0 -0
  128. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/client/user_token_client.py +0 -0
  129. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/connector_client_base.py +0 -0
  130. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/conversations_base.py +0 -0
  131. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/get_product_info.py +0 -0
  132. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/mcs/__init__.py +0 -0
  133. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/mcs/mcs_connector_client.py +0 -0
  134. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/teams/__init__.py +0 -0
  135. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/teams/teams_connector_client.py +0 -0
  136. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/telemetry/__init__.py +0 -0
  137. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/telemetry/_request_span_wrapper.py +0 -0
  138. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/telemetry/connector_spans.py +0 -0
  139. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/telemetry/constants.py +0 -0
  140. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/telemetry/metrics.py +0 -0
  141. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/telemetry/user_token_client_spans.py +0 -0
  142. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/user_token_base.py +0 -0
  143. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/connector/user_token_client_base.py +0 -0
  144. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/errors/__init__.py +0 -0
  145. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/errors/error_resources.py +0 -0
  146. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/header_propagation/__init__.py +0 -0
  147. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/header_propagation/agentic_header_provider.py +0 -0
  148. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/header_propagation/header_propagation_context.py +0 -0
  149. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/header_propagation/header_value_provider.py +0 -0
  150. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/http/__init__.py +0 -0
  151. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/http/_channel_service_routes.py +0 -0
  152. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/http/_http_request_protocol.py +0 -0
  153. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/http/_http_response.py +0 -0
  154. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/message_factory.py +0 -0
  155. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/middleware_set.py +0 -0
  156. /microsoft_agents_hosting_core-1.4.0.dev18/microsoft_agents/hosting/core/storage/telemetry/__init__.py → /microsoft_agents_hosting_core-1.5.0.dev8/microsoft_agents/hosting/core/py.typed +0 -0
  157. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/rest_channel_service_client_factory.py +0 -0
  158. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/state/__init__.py +0 -0
  159. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/state/agent_state.py +0 -0
  160. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/state/state_property_accessor.py +0 -0
  161. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/state/user_state.py +0 -0
  162. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/storage/__init__.py +0 -0
  163. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/storage/_type_aliases.py +0 -0
  164. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/storage/error_handling.py +0 -0
  165. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/storage/memory_storage.py +0 -0
  166. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/storage/storage.py +0 -0
  167. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/storage/store_item.py +0 -0
  168. {microsoft_agents_hosting_core-1.4.0.dev18/microsoft_agents/hosting/core/telemetry/adapter → microsoft_agents_hosting_core-1.5.0.dev8/microsoft_agents/hosting/core/storage/telemetry}/__init__.py +0 -0
  169. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/storage/telemetry/constants.py +0 -0
  170. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/storage/telemetry/metrics.py +0 -0
  171. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/storage/telemetry/spans.py +0 -0
  172. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/storage/transcript/__init__.py +0 -0
  173. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/storage/transcript/transcript_file_store.py +0 -0
  174. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/storage/transcript/transcript_info.py +0 -0
  175. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/storage/transcript/transcript_logger.py +0 -0
  176. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/storage/transcript/transcript_memory_store.py +0 -0
  177. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/storage/transcript/transcript_store.py +0 -0
  178. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/telemetry/__init__.py +0 -0
  179. {microsoft_agents_hosting_core-1.4.0.dev18/microsoft_agents/hosting/core/telemetry/turn_context → microsoft_agents_hosting_core-1.5.0.dev8/microsoft_agents/hosting/core/telemetry/adapter}/__init__.py +0 -0
  180. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/telemetry/adapter/constants.py +0 -0
  181. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/telemetry/adapter/metrics.py +0 -0
  182. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/telemetry/adapter/spans.py +0 -0
  183. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/telemetry/attributes.py +0 -0
  184. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/telemetry/core/__init__.py +0 -0
  185. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/telemetry/core/resource.py +0 -0
  186. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/telemetry/core/type_defs.py +0 -0
  187. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/telemetry/turn_context/constants.py +0 -0
  188. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/telemetry/turn_context/spans.py +0 -0
  189. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/telemetry/utils.py +0 -0
  190. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents/hosting/core/turn_context.py +0 -0
  191. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents_hosting_core.egg-info/dependency_links.txt +0 -0
  192. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/microsoft_agents_hosting_core.egg-info/top_level.txt +0 -0
  193. {microsoft_agents_hosting_core-1.4.0.dev18 → microsoft_agents_hosting_core-1.5.0.dev8}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-hosting-core
3
- Version: 1.4.0.dev18
3
+ Version: 1.5.0.dev8
4
4
  Summary: Core library for Microsoft Agents
5
5
  Author: Microsoft Corporation
6
6
  License-Expression: MIT
@@ -15,12 +15,14 @@ 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.4.0.dev18
18
+ Requires-Dist: microsoft-agents-activity==1.5.0.dev8
19
19
  Requires-Dist: pyjwt>=2.10.1
20
20
  Requires-Dist: isodate>=0.6.1
21
21
  Requires-Dist: python-dotenv>=1.1.1
22
22
  Requires-Dist: opentelemetry-api>=1.27.0
23
23
  Requires-Dist: opentelemetry-sdk>=1.27.0
24
+ Requires-Dist: aiohttp>=3.11.11
25
+ Requires-Dist: yarl<2.0,>=1.17.0
24
26
  Dynamic: license-file
25
27
  Dynamic: requires-dist
26
28
 
@@ -42,6 +44,15 @@ This library is part of the **Microsoft 365 Agents SDK for Python** - a comprehe
42
44
  <th style="width:20%">Date</th>
43
45
  <th style="width:60%">Release Notes</th>
44
46
  </tr>
47
+ <tr>
48
+ <td>1.4.0</td>
49
+ <td>2026-08-18</td>
50
+ <td>
51
+ <a href="https://github.com/microsoft/Agents-for-python/blob/main/changelog.md#microsoft-365-agents-sdk-for-python---release-notes-v140">
52
+ 1.4.0 Release Notes
53
+ </a>
54
+ </td>
55
+ </tr>
45
56
  <tr>
46
57
  <td>1.3.0</td>
47
58
  <td>2026-07-30</td>
@@ -0,0 +1 @@
1
+ 1.5.0.dev8
@@ -9,6 +9,7 @@ from .message_factory import MessageFactory
9
9
  from .middleware_set import Middleware, MiddlewareSet
10
10
  from .rest_channel_service_client_factory import RestChannelServiceClientFactory
11
11
  from .turn_context import TurnContext
12
+ from .outbound_host_validator import OutboundHostValidator
12
13
 
13
14
  # HTTP abstractions
14
15
  from .http import (
@@ -122,6 +123,7 @@ __all__ = [
122
123
  "Middleware",
123
124
  "RestChannelServiceClientFactory",
124
125
  "TurnContext",
126
+ "OutboundHostValidator",
125
127
  "HttpRequestProtocol",
126
128
  "HttpResponse",
127
129
  "HttpResponseFactory",
@@ -7,6 +7,8 @@ from abc import ABC
7
7
  from http import HTTPStatus
8
8
  from traceback import format_exc
9
9
 
10
+ import logging
11
+
10
12
  from microsoft_agents.activity import Activity, DeliveryModes
11
13
  from microsoft_agents.hosting.core.telemetry.adapter import spans
12
14
 
@@ -20,6 +22,9 @@ from .http._http_response import HttpResponse, HttpResponseFactory
20
22
  from .message_factory import MessageFactory
21
23
  from .rest_channel_service_client_factory import RestChannelServiceClientFactory
22
24
  from .turn_context import TurnContext
25
+ from .outbound_host_validator import OutboundHostValidator, _try_create_url
26
+
27
+ logger = logging.getLogger(__name__)
23
28
 
24
29
 
25
30
  class HttpAdapterBase(ChannelServiceAdapter, ABC):
@@ -35,6 +40,7 @@ class HttpAdapterBase(ChannelServiceAdapter, ABC):
35
40
  connection_manager: Connections | None = None,
36
41
  channel_service_client_factory: ChannelServiceClientFactoryBase | None = None,
37
42
  channel_service_client_factory_options: dict | None = None,
43
+ host_validator: OutboundHostValidator | None = None,
38
44
  ):
39
45
  """Initialize the HTTP adapter.
40
46
 
@@ -73,6 +79,7 @@ class HttpAdapterBase(ChannelServiceAdapter, ABC):
73
79
  connection_manager,
74
80
  **(channel_service_client_factory_options or {}),
75
81
  )
82
+ self._host_validator = host_validator or OutboundHostValidator()
76
83
 
77
84
  super().__init__(factory)
78
85
 
@@ -112,10 +119,8 @@ class HttpAdapterBase(ChannelServiceAdapter, ABC):
112
119
  span.share(activity=activity)
113
120
 
114
121
  # Get claims identity (default to anonymous if not set by middleware)
115
- claims_identity: (
116
- ClaimsIdentity
117
- ) = request.get_claims_identity() or ClaimsIdentity(
118
- {}, False, authentication_type="Anonymous"
122
+ claims_identity: ClaimsIdentity = (
123
+ request.get_claims_identity() or ClaimsIdentity()
119
124
  )
120
125
 
121
126
  # Validate required activity fields
@@ -128,6 +133,11 @@ class HttpAdapterBase(ChannelServiceAdapter, ABC):
128
133
  "Activity must have type and conversation.id"
129
134
  )
130
135
 
136
+ if not self._validate_service_url(claims_identity, activity):
137
+ return HttpResponseFactory.unauthorized(
138
+ "Service URL is not allowed by the host validator."
139
+ )
140
+
131
141
  try:
132
142
  # Process the inbound activity with the agent
133
143
  invoke_response = await self.process_activity(
@@ -153,3 +163,57 @@ class HttpAdapterBase(ChannelServiceAdapter, ABC):
153
163
 
154
164
  except PermissionError:
155
165
  return HttpResponseFactory.unauthorized()
166
+
167
+ def _validate_service_url(
168
+ self, claims_identity: ClaimsIdentity, activity: Activity
169
+ ) -> bool:
170
+ """Validate the service URL against the claims identity.
171
+
172
+ Args:
173
+ claims_identity: The claims identity to validate against.
174
+ activity: The activity containing the service URL to validate.
175
+
176
+ Returns:
177
+ True if the service URL is valid, False otherwise.
178
+ """
179
+
180
+ if (
181
+ self._host_validator.enabled
182
+ and activity.service_url
183
+ and not self._host_validator.is_allowed(activity.service_url)
184
+ ):
185
+ logger.warning(
186
+ "Service URL %s is not allowed by the host validator.",
187
+ activity.service_url,
188
+ )
189
+ return False
190
+
191
+ if not claims_identity:
192
+ return True
193
+
194
+ claims_service_url = claims_identity.get_claim_value("serviceurl")
195
+ if activity.service_url and claims_service_url:
196
+ claim_url = _try_create_url(claims_service_url)
197
+ activity_url = _try_create_url(activity.service_url)
198
+ claim_url_host = (claim_url.host or "") if claim_url else ""
199
+ activity_url_host = (activity_url.host or "") if activity_url else ""
200
+ if (
201
+ not claim_url
202
+ or not activity_url
203
+ or claim_url_host.casefold() != activity_url_host.casefold()
204
+ ):
205
+ if self._host_validator and self._host_validator.enabled:
206
+ logger.warning(
207
+ "Service URL host mismatch: %s vs %s",
208
+ claim_url_host,
209
+ activity_url_host,
210
+ )
211
+ return False
212
+ else:
213
+ logger.warning(
214
+ "Service URL host mismatch (host validator disabled): %s vs %s",
215
+ claim_url_host,
216
+ activity_url_host,
217
+ )
218
+
219
+ return True
@@ -903,6 +903,7 @@ class AgentApplication(Agent, Generic[StateT]):
903
903
  if (
904
904
  self.options.remove_recipient_mention
905
905
  and context.activity.type == ActivityTypes.message
906
+ and context.activity.text is not None
906
907
  ):
907
908
  context.activity.text = context.remove_recipient_mention(context.activity)
908
909
 
@@ -1,19 +1,20 @@
1
- """
2
- Copyright (c) Microsoft Corporation. All rights reserved.
3
- Licensed under the MIT License.
4
- """
1
+ # Copyright (c) Microsoft Corporation. All rights reserved.
2
+ # Licensed under the MIT License.
5
3
 
6
4
  from __future__ import annotations
7
5
 
8
6
  from typing import TYPE_CHECKING
9
7
 
8
+ from opentelemetry.trace import SpanContext
9
+
10
10
  from microsoft_agents.activity import ConversationReference
11
11
  from microsoft_agents.hosting.core.authorization import ClaimsIdentity
12
12
  from microsoft_agents.hosting.core.storage.store_item import StoreItem
13
13
 
14
14
  if TYPE_CHECKING:
15
15
  from microsoft_agents.hosting.core.turn_context import TurnContext
16
- from microsoft_agents.hosting.core.channel_adapter import ChannelAdapter
16
+
17
+ from .telemetry._utils import _deserialize_span_context, _dump_span_context
17
18
 
18
19
  # JWT claim keys that are persisted alongside a ConversationReference.
19
20
  _PERSISTED_CLAIM_KEYS = frozenset({"aud", "azp", "appid", "idtyp", "ver", "iss", "tid"})
@@ -41,7 +42,20 @@ class Conversation(StoreItem):
41
42
  self,
42
43
  claims: dict[str, str] | ClaimsIdentity,
43
44
  conversation_reference: ConversationReference,
45
+ *,
46
+ _span_context: dict | None = None,
44
47
  ) -> None:
48
+ """Creates a new :class:`~microsoft_agents.hosting.core.app.proactive.Conversation` instance.
49
+
50
+ :param claims: Filtered JWT claims (``aud``, ``azp``, ``appid``, ``idtyp``,
51
+ ``ver``, ``iss``, ``tid``). May be a raw ``dict`` or a
52
+ :class:`~microsoft_agents.hosting.core.authorization.ClaimsIdentity`.
53
+ :type claims: dict[str, str] or ClaimsIdentity
54
+ :param conversation_reference: The conversation reference.
55
+ :type conversation_reference: :class:`~microsoft_agents.activity.ConversationReference`
56
+ :param _span_context: Optional serialized span context for telemetry linking. For internal use only; this is not part of the public API.
57
+ :type _span_context: dict or None
58
+ """
45
59
  if isinstance(claims, ClaimsIdentity):
46
60
  self.claims: dict[str, str] = Conversation.claims_from_identity(claims)
47
61
  else:
@@ -49,6 +63,29 @@ class Conversation(StoreItem):
49
63
  k: v for k, v in claims.items() if k in _PERSISTED_CLAIM_KEYS
50
64
  }
51
65
  self.conversation_reference: ConversationReference = conversation_reference
66
+ self._span_context_dict: dict | None = _span_context
67
+
68
+ def _set_span_context(self, span_context: SpanContext) -> None:
69
+ """Sets the span context for this conversation, serializing it to a dictionary for storage.
70
+
71
+ For internal use only; this is not part of the public API.
72
+
73
+ :param span_context: The SpanContext to set.
74
+ :type span_context: SpanContext
75
+ """
76
+ self._span_context_dict = _dump_span_context(span_context)
77
+
78
+ def _get_span_context(self) -> SpanContext | None:
79
+ """Gets the span context for this conversation, deserializing it from a dictionary.
80
+
81
+ For internal use only; this is not part of the public API.
82
+
83
+ :return: The SpanContext, or None if not set.
84
+ :rtype: SpanContext or None
85
+ """
86
+ if self._span_context_dict is None:
87
+ return None
88
+ return _deserialize_span_context(self._span_context_dict)
52
89
 
53
90
  # ------------------------------------------------------------------
54
91
  # Factory helpers
@@ -97,7 +134,9 @@ class Conversation(StoreItem):
97
134
  :return: Reconstituted claims identity.
98
135
  :rtype: :class:`~microsoft_agents.hosting.core.authorization.ClaimsIdentity`
99
136
  """
100
- return ClaimsIdentity(claims=dict(claims), is_authenticated=True)
137
+ if not claims:
138
+ return ClaimsIdentity()
139
+ return ClaimsIdentity(claims=dict(claims))
101
140
 
102
141
  # ------------------------------------------------------------------
103
142
  # Validation
@@ -135,6 +174,7 @@ class Conversation(StoreItem):
135
174
  "conversation_reference": self.conversation_reference.model_dump(
136
175
  mode="json", by_alias=True, exclude_unset=True
137
176
  ),
177
+ "_span_context": self._span_context_dict,
138
178
  }
139
179
 
140
180
  @staticmethod
@@ -145,4 +185,5 @@ class Conversation(StoreItem):
145
185
  return Conversation(
146
186
  claims=json_data.get("claims", {}),
147
187
  conversation_reference=reference,
188
+ _span_context=json_data.get("_span_context", None),
148
189
  )
@@ -5,11 +5,10 @@ Licensed under the MIT License.
5
5
 
6
6
  from __future__ import annotations
7
7
 
8
- from typing import Optional
9
-
10
8
  from microsoft_agents.activity import (
11
9
  ChannelAccount,
12
10
  Channels,
11
+ ChannelId,
13
12
  ConversationAccount,
14
13
  ConversationReference,
15
14
  )
@@ -38,6 +37,7 @@ class ConversationBuilder:
38
37
  conversation = (
39
38
  ConversationBuilder
40
39
  .create_from_identity(claims_identity, "msteams")
40
+ .with_user("user-aad-oid")
41
41
  .with_conversation("19:thread-id@thread.v2")
42
42
  .build()
43
43
  )
@@ -45,16 +45,16 @@ class ConversationBuilder:
45
45
 
46
46
  def __init__(self) -> None:
47
47
  self._claims: dict[str, str] = {}
48
- self._channel_id: Optional[str] = None
49
- self._service_url: Optional[str] = None
50
- self._agent_id: Optional[str] = None
51
- self._agent_name: Optional[str] = None
52
- self._user_id: Optional[str] = None
53
- self._user_name: Optional[str] = None
54
- self._conversation_id: Optional[str] = None
55
- self._conversation_name: Optional[str] = None
56
- self._tenant_id: Optional[str] = None
57
- self._activity_id: Optional[str] = None
48
+ self._channel_id: str | None = None
49
+ self._service_url: str | None = None
50
+ self._agent_id: str | None = None
51
+ self._agent_name: str | None = None
52
+ self._user_id: str | None = None
53
+ self._user_name: str | None = None
54
+ self._conversation_id: str | None = None
55
+ self._conversation_name: str | None = None
56
+ self._tenant_id: str | None = None
57
+ self._activity_id: str | None = None
58
58
 
59
59
  # ------------------------------------------------------------------
60
60
  # Entry-point factories
@@ -65,8 +65,8 @@ class ConversationBuilder:
65
65
  cls,
66
66
  agent_client_id: str,
67
67
  channel_id: str,
68
- service_url: Optional[str] = None,
69
- requestor_id: Optional[str] = None,
68
+ service_url: str | None = None,
69
+ requestor_id: str | None = None,
70
70
  ) -> "ConversationBuilder":
71
71
  """
72
72
  Start building a :class:`~microsoft_agents.hosting.core.app.proactive.conversation.Conversation`
@@ -79,7 +79,7 @@ class ConversationBuilder:
79
79
  :type channel_id: str
80
80
  :param service_url: Override the service URL. Defaults to the canonical
81
81
  URL for *channel_id*.
82
- :type service_url: Optional[str]
82
+ :type service_url: str | None
83
83
  :param requestor_id: If provided, stored as the ``appid`` claim (useful
84
84
  when the requestor differs from the audience).
85
85
  :type requestor_id: Optional[str]
@@ -106,7 +106,7 @@ class ConversationBuilder:
106
106
  cls,
107
107
  identity: ClaimsIdentity,
108
108
  channel_id: str,
109
- service_url: Optional[str] = None,
109
+ service_url: str | None = None,
110
110
  ) -> "ConversationBuilder":
111
111
  """
112
112
  Start building a :class:`~microsoft_agents.hosting.core.app.proactive.conversation.Conversation`
@@ -117,7 +117,7 @@ class ConversationBuilder:
117
117
  :param channel_id: The channel identifier.
118
118
  :type channel_id: str
119
119
  :param service_url: Override the service URL.
120
- :type service_url: Optional[str]
120
+ :type service_url: str | None
121
121
  :return: A builder pre-populated with the identity's claims.
122
122
  :rtype: :class:`microsoft_agents.hosting.core.app.proactive.ConversationBuilder`
123
123
  """
@@ -142,7 +142,7 @@ class ConversationBuilder:
142
142
  def with_user(
143
143
  self,
144
144
  user_id: str,
145
- user_name: Optional[str] = None,
145
+ user_name: str | None = None,
146
146
  ) -> "ConversationBuilder":
147
147
  """
148
148
  Set the user account.
@@ -161,8 +161,8 @@ class ConversationBuilder:
161
161
  def with_conversation(
162
162
  self,
163
163
  conversation_id: str,
164
- conversation_name: Optional[str] = None,
165
- tenant_id: Optional[str] = None,
164
+ conversation_name: str | None = None,
165
+ tenant_id: str | None = None,
166
166
  ) -> "ConversationBuilder":
167
167
  """
168
168
  Set the conversation account details.
@@ -201,7 +201,7 @@ class ConversationBuilder:
201
201
  """
202
202
  Construct the :class:`~microsoft_agents.hosting.core.app.proactive.conversation.Conversation`.
203
203
 
204
- :raises ValueError: If required fields (``channel_id``, ``conversation_id``) are missing.
204
+ :raises ValueError: If a required identifier (channel, conversation, agent, or user) is missing.
205
205
  :return: The built :class:`~microsoft_agents.hosting.core.app.proactive.conversation.Conversation`.
206
206
  :rtype: :class:`~microsoft_agents.hosting.core.app.proactive.conversation.Conversation`
207
207
  """
@@ -209,28 +209,29 @@ class ConversationBuilder:
209
209
  raise ValueError("ConversationBuilder: channel_id is required.")
210
210
  if not self._conversation_id:
211
211
  raise ValueError("ConversationBuilder: conversation_id is required.")
212
+ if not self._agent_id:
213
+ raise ValueError("ConversationBuilder: agent_id is required.")
214
+ if not self._user_id:
215
+ raise ValueError("ConversationBuilder: user_id is required.")
212
216
 
213
- agent = (
214
- ChannelAccount(id=self._agent_id, name=self._agent_name)
215
- if self._agent_id
216
- else None
217
- )
218
- user = (
219
- ChannelAccount(id=self._user_id, name=self._user_name)
220
- if self._user_id
221
- else None
222
- )
217
+ agent_values = {"id": self._agent_id}
218
+ if self._agent_name is not None:
219
+ agent_values["name"] = self._agent_name
220
+
221
+ user_values = {"id": self._user_id}
222
+ if self._user_name is not None:
223
+ user_values["name"] = self._user_name
223
224
 
224
225
  reference = ConversationReference(
225
- channel_id=self._channel_id,
226
+ channel_id=ChannelId(self._channel_id),
226
227
  service_url=self._service_url or _service_url_for_channel(self._channel_id),
227
228
  conversation=ConversationAccount(
228
229
  id=self._conversation_id,
229
230
  name=self._conversation_name,
230
231
  tenant_id=self._tenant_id,
231
232
  ),
232
- bot=agent,
233
- user=user,
233
+ agent=ChannelAccount(**agent_values),
234
+ user=ChannelAccount(**user_values),
234
235
  activity_id=self._activity_id,
235
236
  )
236
237
 
@@ -5,14 +5,13 @@ Licensed under the MIT License.
5
5
 
6
6
  from __future__ import annotations
7
7
 
8
- from typing import Optional
9
-
10
8
  from microsoft_agents.activity import (
11
9
  ChannelAccount,
12
10
  Channels,
13
11
  ConversationAccount,
14
12
  ConversationReference,
15
13
  )
14
+ from microsoft_agents.activity._model_utils import pick_model, SkipNone
16
15
 
17
16
 
18
17
  def _service_url_for_channel(channel_id: str) -> str:
@@ -45,15 +44,15 @@ class ConversationReferenceBuilder:
45
44
  """
46
45
 
47
46
  def __init__(self) -> None:
48
- self._channel_id: Optional[str] = None
49
- self._conversation_id: Optional[str] = None
50
- self._service_url: Optional[str] = None
51
- self._agent_id: Optional[str] = None
52
- self._agent_name: Optional[str] = None
53
- self._user_id: Optional[str] = None
54
- self._user_name: Optional[str] = None
55
- self._activity_id: Optional[str] = None
56
- self._locale: Optional[str] = None
47
+ self._channel_id: str | None = None
48
+ self._conversation_id: str | None = None
49
+ self._service_url: str | None = None
50
+ self._agent_id: str | None = None
51
+ self._agent_name: str | None = None
52
+ self._user_id: str | None = None
53
+ self._user_name: str | None = None
54
+ self._activity_id: str | None = None
55
+ self._locale: str | None = None
57
56
 
58
57
  # ------------------------------------------------------------------
59
58
  # Entry-point factories
@@ -64,7 +63,7 @@ class ConversationReferenceBuilder:
64
63
  cls,
65
64
  channel_id: str,
66
65
  conversation_id: str,
67
- ) -> "ConversationReferenceBuilder":
66
+ ) -> ConversationReferenceBuilder:
68
67
  """
69
68
  Start building a :class:`~microsoft_agents.activity.ConversationReference`
70
69
  from a channel ID and an existing conversation ID.
@@ -86,8 +85,8 @@ class ConversationReferenceBuilder:
86
85
  cls,
87
86
  agent_client_id: str,
88
87
  channel_id: str,
89
- service_url: Optional[str] = None,
90
- ) -> "ConversationReferenceBuilder":
88
+ service_url: str | None = None,
89
+ ) -> ConversationReferenceBuilder:
91
90
  """
92
91
  Start building a :class:`~microsoft_agents.activity.ConversationReference`
93
92
  from an agent application ID and channel.
@@ -101,7 +100,7 @@ class ConversationReferenceBuilder:
101
100
  :type channel_id: str
102
101
  :param service_url: Override the service URL. When ``None`` the default
103
102
  URL for the channel is used.
104
- :type service_url: Optional[str]
103
+ :type service_url: str | None
105
104
  :return: A builder pre-populated for the agent.
106
105
  :rtype: :class:`microsoft_agents.hosting.core.app.proactive.ConversationReferenceBuilder`
107
106
  """
@@ -124,15 +123,15 @@ class ConversationReferenceBuilder:
124
123
  def with_agent(
125
124
  self,
126
125
  agent_id: str,
127
- agent_name: Optional[str] = None,
128
- ) -> "ConversationReferenceBuilder":
126
+ agent_name: str | None = None,
127
+ ) -> ConversationReferenceBuilder:
129
128
  """
130
129
  Set the agent (bot) account on the reference.
131
130
 
132
131
  :param agent_id: The agent's channel account ID.
133
132
  :type agent_id: str
134
133
  :param agent_name: Optional display name.
135
- :type agent_name: Optional[str]
134
+ :type agent_name: str | None
136
135
  :return: ``self`` for chaining.
137
136
  :rtype: :class:`microsoft_agents.hosting.core.app.proactive.ConversationReferenceBuilder`
138
137
  """
@@ -143,15 +142,15 @@ class ConversationReferenceBuilder:
143
142
  def with_user(
144
143
  self,
145
144
  user_id: str,
146
- user_name: Optional[str] = None,
147
- ) -> "ConversationReferenceBuilder":
145
+ user_name: str | None = None,
146
+ ) -> ConversationReferenceBuilder:
148
147
  """
149
148
  Set the user account on the reference.
150
149
 
151
150
  :param user_id: The user's channel account ID.
152
151
  :type user_id: str
153
152
  :param user_name: Optional display name.
154
- :type user_name: Optional[str]
153
+ :type user_name: str | None
155
154
  :return: ``self`` for chaining.
156
155
  :rtype: :class:`microsoft_agents.hosting.core.app.proactive.ConversationReferenceBuilder`
157
156
  """
@@ -159,7 +158,7 @@ class ConversationReferenceBuilder:
159
158
  self._user_name = user_name
160
159
  return self
161
160
 
162
- def with_service_url(self, service_url: str) -> "ConversationReferenceBuilder":
161
+ def with_service_url(self, service_url: str) -> ConversationReferenceBuilder:
163
162
  """
164
163
  Override the service URL.
165
164
 
@@ -171,7 +170,7 @@ class ConversationReferenceBuilder:
171
170
  self._service_url = service_url
172
171
  return self
173
172
 
174
- def with_activity_id(self, activity_id: str) -> "ConversationReferenceBuilder":
173
+ def with_activity_id(self, activity_id: str) -> ConversationReferenceBuilder:
175
174
  """
176
175
  Set the activity ID on the reference.
177
176
 
@@ -183,7 +182,7 @@ class ConversationReferenceBuilder:
183
182
  self._activity_id = activity_id
184
183
  return self
185
184
 
186
- def with_locale(self, locale: str) -> "ConversationReferenceBuilder":
185
+ def with_locale(self, locale: str) -> ConversationReferenceBuilder:
187
186
  """
188
187
  Set the locale on the reference.
189
188
 
@@ -217,22 +216,25 @@ class ConversationReferenceBuilder:
217
216
  service_url = self._service_url or _service_url_for_channel(self._channel_id)
218
217
 
219
218
  agent = (
220
- ChannelAccount(id=self._agent_id, name=self._agent_name)
219
+ pick_model(
220
+ ChannelAccount, id=self._agent_id, name=SkipNone(self._agent_name)
221
+ )
221
222
  if self._agent_id
222
223
  else None
223
224
  )
224
225
  user = (
225
- ChannelAccount(id=self._user_id, name=self._user_name)
226
+ pick_model(ChannelAccount, id=self._user_id, name=SkipNone(self._user_name))
226
227
  if self._user_id
227
228
  else None
228
229
  )
229
230
 
230
- return ConversationReference(
231
+ return pick_model(
232
+ ConversationReference,
231
233
  channel_id=self._channel_id,
232
234
  conversation=ConversationAccount(id=self._conversation_id),
233
235
  service_url=service_url,
234
- bot=agent,
235
- user=user,
236
+ agent=SkipNone(agent),
237
+ user=SkipNone(user),
236
238
  activity_id=self._activity_id,
237
239
  locale=self._locale,
238
240
  )
@@ -6,7 +6,6 @@ Licensed under the MIT License.
6
6
  from __future__ import annotations
7
7
 
8
8
  from dataclasses import dataclass, field
9
- from typing import Optional
10
9
 
11
10
  from microsoft_agents.activity import ConversationParameters
12
11
  from microsoft_agents.hosting.core.authorization import ClaimsIdentity
@@ -26,10 +25,10 @@ class CreateConversationOptions:
26
25
  passed to the channel when creating the conversation.
27
26
  :type parameters: :class:`~microsoft_agents.activity.ConversationParameters`
28
27
  :param service_url: Optional override for the channel service URL.
29
- :type service_url: Optional[str]
28
+ :type service_url: str | None
30
29
  :param audience: Optional OAuth audience override. When ``None`` the
31
30
  audience is derived from *identity*.
32
- :type audience: Optional[str]
31
+ :type audience: str | None
33
32
  :param store_conversation: When ``True`` the newly created conversation is
34
33
  automatically stored via
35
34
  :meth:`~microsoft_agents.hosting.core.app.proactive.proactive.Proactive.store_conversation`
@@ -37,11 +36,11 @@ class CreateConversationOptions:
37
36
  :type store_conversation: bool
38
37
  """
39
38
 
40
- identity: ClaimsIdentity = field(default=None)
39
+ identity: ClaimsIdentity
41
40
  channel_id: str = field(default="")
42
- parameters: Optional[ConversationParameters] = field(default=None)
43
- service_url: Optional[str] = field(default=None)
44
- audience: Optional[str] = field(default=None)
41
+ parameters: ConversationParameters | None = field(default=None)
42
+ service_url: str | None = field(default=None)
43
+ audience: str | None = field(default=None)
45
44
  store_conversation: bool = field(default=False)
46
45
 
47
46
  def validate(self) -> None: