microsoft-agents-hosting-core 0.5.0.dev11__tar.gz → 0.5.0.dev19__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 (105) hide show
  1. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/PKG-INFO +7 -2
  2. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/agent_application.py +6 -7
  3. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py +6 -6
  4. microsoft_agents_hosting_core-0.5.0.dev19/microsoft_agents/hosting/core/app/typing_indicator.py +79 -0
  5. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/authorization/access_token_provider_base.py +1 -1
  6. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/authorization/anonymous_token_provider.py +1 -1
  7. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/authorization/jwt_token_validator.py +6 -4
  8. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents_hosting_core.egg-info/PKG-INFO +7 -2
  9. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents_hosting_core.egg-info/requires.txt +1 -1
  10. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/pyproject.toml +5 -0
  11. microsoft_agents_hosting_core-0.5.0.dev11/microsoft_agents/hosting/core/app/typing_indicator.py +0 -55
  12. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/LICENSE +0 -0
  13. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/__init__.py +0 -0
  14. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/_oauth/__init__.py +0 -0
  15. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/_oauth/_flow_state.py +0 -0
  16. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/_oauth/_flow_storage_client.py +0 -0
  17. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/_oauth/_oauth_flow.py +0 -0
  18. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/activity_handler.py +0 -0
  19. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/agent.py +0 -0
  20. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/__init__.py +0 -0
  21. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/_routes/__init__.py +0 -0
  22. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/_routes/_route.py +0 -0
  23. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/_routes/_route_list.py +0 -0
  24. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/_routes/route_rank.py +0 -0
  25. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/_type_defs.py +0 -0
  26. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/app_error.py +0 -0
  27. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/app_options.py +0 -0
  28. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/input_file.py +0 -0
  29. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/oauth/__init__.py +0 -0
  30. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py +0 -0
  31. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/oauth/_handlers/_authorization_handler.py +0 -0
  32. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/oauth/_handlers/_user_authorization.py +0 -0
  33. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/oauth/_sign_in_response.py +0 -0
  34. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/oauth/_sign_in_state.py +0 -0
  35. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/oauth/auth_handler.py +0 -0
  36. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/oauth/authorization.py +0 -0
  37. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/query.py +0 -0
  38. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/state/__init__.py +0 -0
  39. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/state/conversation_state.py +0 -0
  40. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/state/state.py +0 -0
  41. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/state/temp_state.py +0 -0
  42. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/app/state/turn_state.py +0 -0
  43. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/authorization/__init__.py +0 -0
  44. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py +0 -0
  45. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/authorization/auth_types.py +0 -0
  46. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/authorization/authentication_constants.py +0 -0
  47. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/authorization/claims_identity.py +0 -0
  48. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/authorization/connections.py +0 -0
  49. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/card_factory.py +0 -0
  50. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/channel_adapter.py +0 -0
  51. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/channel_api_handler_protocol.py +0 -0
  52. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/channel_service_adapter.py +0 -0
  53. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/channel_service_client_factory_base.py +0 -0
  54. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/client/__init__.py +0 -0
  55. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/client/agent_conversation_reference.py +0 -0
  56. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/client/channel_factory_protocol.py +0 -0
  57. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/client/channel_host_protocol.py +0 -0
  58. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/client/channel_info_protocol.py +0 -0
  59. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/client/channel_protocol.py +0 -0
  60. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/client/channels_configuration.py +0 -0
  61. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/client/configuration_channel_host.py +0 -0
  62. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/client/conversation_constants.py +0 -0
  63. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/client/conversation_id_factory.py +0 -0
  64. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/client/conversation_id_factory_options.py +0 -0
  65. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py +0 -0
  66. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/client/http_agent_channel.py +0 -0
  67. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/client/http_agent_channel_factory.py +0 -0
  68. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/connector/__init__.py +0 -0
  69. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/connector/agent_sign_in_base.py +0 -0
  70. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/connector/attachments_base.py +0 -0
  71. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/connector/client/__init__.py +0 -0
  72. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/connector/client/connector_client.py +0 -0
  73. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/connector/client/user_token_client.py +0 -0
  74. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/connector/connector_client_base.py +0 -0
  75. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/connector/conversations_base.py +0 -0
  76. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/connector/get_product_info.py +0 -0
  77. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/connector/teams/__init__.py +0 -0
  78. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/connector/teams/teams_connector_client.py +0 -0
  79. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/connector/user_token_base.py +0 -0
  80. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/connector/user_token_client_base.py +0 -0
  81. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/message_factory.py +0 -0
  82. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/middleware_set.py +0 -0
  83. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/rest_channel_service_client_factory.py +0 -0
  84. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/state/__init__.py +0 -0
  85. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/state/agent_state.py +0 -0
  86. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/state/state_property_accessor.py +0 -0
  87. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/state/user_state.py +0 -0
  88. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/storage/__init__.py +0 -0
  89. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/storage/_type_aliases.py +0 -0
  90. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/storage/error_handling.py +0 -0
  91. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/storage/memory_storage.py +0 -0
  92. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/storage/storage.py +0 -0
  93. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/storage/store_item.py +0 -0
  94. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/storage/transcript_file_store.py +0 -0
  95. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/storage/transcript_info.py +0 -0
  96. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/storage/transcript_logger.py +0 -0
  97. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/storage/transcript_memory_store.py +0 -0
  98. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/storage/transcript_store.py +0 -0
  99. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents/hosting/core/turn_context.py +0 -0
  100. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents_hosting_core.egg-info/SOURCES.txt +0 -0
  101. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents_hosting_core.egg-info/dependency_links.txt +0 -0
  102. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/microsoft_agents_hosting_core.egg-info/top_level.txt +0 -0
  103. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/readme.md +0 -0
  104. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/setup.cfg +0 -0
  105. {microsoft_agents_hosting_core-0.5.0.dev11 → microsoft_agents_hosting_core-0.5.0.dev19}/setup.py +0 -0
@@ -1,16 +1,21 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-hosting-core
3
- Version: 0.5.0.dev11
3
+ Version: 0.5.0.dev19
4
4
  Summary: Core library for Microsoft Agents
5
5
  Author: Microsoft Corporation
6
6
  License-Expression: MIT
7
7
  Project-URL: Homepage, https://github.com/microsoft/Agents
8
8
  Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Python :: 3.14
9
14
  Classifier: Operating System :: OS Independent
10
15
  Requires-Python: >=3.10
11
16
  Description-Content-Type: text/markdown
12
17
  License-File: LICENSE
13
- Requires-Dist: microsoft-agents-activity==0.5.0.dev11
18
+ Requires-Dist: microsoft-agents-activity==0.5.0.dev19
14
19
  Requires-Dist: pyjwt>=2.10.1
15
20
  Requires-Dist: isodate>=0.6.1
16
21
  Requires-Dist: azure-core>=1.30.0
@@ -93,7 +93,6 @@ class AgentApplication(Agent, Generic[StateT]):
93
93
  :param kwargs: Additional configuration parameters.
94
94
  :type kwargs: Any
95
95
  """
96
- self.typing = TypingIndicator()
97
96
  self._route_list = _RouteList[StateT]()
98
97
 
99
98
  configuration = kwargs
@@ -659,9 +658,12 @@ class AgentApplication(Agent, Generic[StateT]):
659
658
  await self._start_long_running_call(context, self._on_turn)
660
659
 
661
660
  async def _on_turn(self, context: TurnContext):
661
+ typing = None
662
662
  try:
663
663
  if context.activity.type != ActivityTypes.typing:
664
- await self._start_typing(context)
664
+ if self._options.start_typing_timer:
665
+ typing = TypingIndicator()
666
+ await typing.start(context)
665
667
 
666
668
  self._remove_mentions(context)
667
669
 
@@ -709,11 +711,8 @@ class AgentApplication(Agent, Generic[StateT]):
709
711
  )
710
712
  await self._on_error(context, err)
711
713
  finally:
712
- self.typing.stop()
713
-
714
- async def _start_typing(self, context: TurnContext):
715
- if self._options.start_typing_timer:
716
- await self.typing.start(context)
714
+ if typing:
715
+ await typing.stop()
717
716
 
718
717
  def _remove_mentions(self, context: TurnContext):
719
718
  if (
@@ -118,20 +118,20 @@ class AgenticUserAuthorization(_AuthorizationHandler):
118
118
  connection = self._connection_manager.get_token_provider(
119
119
  context.identity, "agentic"
120
120
  )
121
- upn = context.activity.get_agentic_user()
121
+ agentic_user_id = context.activity.get_agentic_user()
122
122
  agentic_instance_id = context.activity.get_agentic_instance_id()
123
- if not upn or not agentic_instance_id:
123
+ if not agentic_user_id or not agentic_instance_id:
124
124
  logger.error(
125
- "Unable to retrieve agentic user token: missing UPN or agentic instance ID. UPN: %s, Agentic Instance ID: %s",
126
- upn,
125
+ "Unable to retrieve agentic user token: missing agentic user Id or agentic instance Id. agentic_user_id: %s, Agentic Instance ID: %s",
126
+ agentic_user_id,
127
127
  agentic_instance_id,
128
128
  )
129
129
  raise ValueError(
130
- f"Unable to retrieve agentic user token: missing UPN or agentic instance ID. UPN: {upn}, Agentic Instance ID: {agentic_instance_id}"
130
+ f"Unable to retrieve agentic user token: missing agentic User Id or agentic instance Id. agentic_user_id: {agentic_user_id}, Agentic Instance ID: {agentic_instance_id}"
131
131
  )
132
132
 
133
133
  token = await connection.get_agentic_user_token(
134
- agentic_instance_id, upn, scopes
134
+ agentic_instance_id, agentic_user_id, scopes
135
135
  )
136
136
  return TokenResponse(token=token) if token else TokenResponse()
137
137
 
@@ -0,0 +1,79 @@
1
+ """
2
+ Copyright (c) Microsoft Corporation. All rights reserved.
3
+ Licensed under the MIT License.
4
+ """
5
+
6
+ from __future__ import annotations
7
+ import asyncio
8
+ import logging
9
+
10
+ from typing import Optional
11
+
12
+ from microsoft_agents.hosting.core import TurnContext
13
+ from microsoft_agents.activity import Activity, ActivityTypes
14
+
15
+ logger = logging.getLogger(__name__)
16
+
17
+
18
+ class TypingIndicator:
19
+ """
20
+ Encapsulates the logic for sending "typing" activity to the user.
21
+ """
22
+
23
+ def __init__(self, intervalSeconds=1) -> None:
24
+ self._intervalSeconds = intervalSeconds
25
+ self._task: Optional[asyncio.Task] = None
26
+ self._running: bool = False
27
+ self._lock = asyncio.Lock()
28
+
29
+ async def start(self, context: TurnContext) -> None:
30
+ async with self._lock:
31
+ if self._running:
32
+ return
33
+
34
+ logger.debug(
35
+ f"Starting typing indicator with interval: {self._intervalSeconds} seconds"
36
+ )
37
+ self._running = True
38
+ self._task = asyncio.create_task(self._typing_loop(context))
39
+
40
+ async def stop(self) -> None:
41
+ async with self._lock:
42
+ if not self._running:
43
+ return
44
+
45
+ logger.debug("Stopping typing indicator")
46
+ self._running = False
47
+ task = self._task
48
+ self._task = None
49
+
50
+ # Cancel outside the lock to avoid blocking
51
+ if task and not task.done():
52
+ task.cancel()
53
+ try:
54
+ await task
55
+ except asyncio.CancelledError:
56
+ pass
57
+
58
+ async def _typing_loop(self, context: TurnContext):
59
+ """Continuously send typing indicators at the specified interval."""
60
+ try:
61
+ while True:
62
+ # Check running status under lock
63
+ async with self._lock:
64
+ if not self._running:
65
+ break
66
+
67
+ try:
68
+ logger.debug("Sending typing activity")
69
+ await context.send_activity(Activity(type=ActivityTypes.typing))
70
+ except Exception as e:
71
+ logger.error(f"Error sending typing activity: {e}")
72
+ async with self._lock:
73
+ self._running = False
74
+ break
75
+
76
+ await asyncio.sleep(self._intervalSeconds)
77
+ except asyncio.CancelledError:
78
+ logger.debug("Typing indicator loop cancelled")
79
+ raise
@@ -43,6 +43,6 @@ class AccessTokenProviderBase(Protocol):
43
43
  raise NotImplementedError()
44
44
 
45
45
  async def get_agentic_user_token(
46
- self, agent_app_instance_id: str, upn: str, scopes: list[str]
46
+ self, agent_app_instance_id: str, agentic_user_id: str, scopes: list[str]
47
47
  ) -> Optional[str]:
48
48
  raise NotImplementedError()
@@ -33,6 +33,6 @@ class AnonymousTokenProvider(AccessTokenProviderBase):
33
33
  return "", ""
34
34
 
35
35
  async def get_agentic_user_token(
36
- self, agent_app_instance_id: str, upn: str, scopes: list[str]
36
+ self, agent_app_instance_id: str, agentic_user_id: str, scopes: list[str]
37
37
  ) -> Optional[str]:
38
38
  return ""
@@ -1,6 +1,7 @@
1
1
  # Copyright (c) Microsoft Corporation. All rights reserved.
2
2
  # Licensed under the MIT License.
3
3
 
4
+ import asyncio
4
5
  import logging
5
6
  import jwt
6
7
 
@@ -16,10 +17,10 @@ class JwtTokenValidator:
16
17
  def __init__(self, configuration: AgentAuthConfiguration):
17
18
  self.configuration = configuration
18
19
 
19
- def validate_token(self, token: str) -> ClaimsIdentity:
20
+ async def validate_token(self, token: str) -> ClaimsIdentity:
20
21
 
21
22
  logger.debug("Validating JWT token.")
22
- key = self._get_public_key_or_secret(token)
23
+ key = await self._get_public_key_or_secret(token)
23
24
  decoded_token = jwt.decode(
24
25
  token,
25
26
  key=key,
@@ -39,7 +40,7 @@ class JwtTokenValidator:
39
40
  logger.debug("Returning anonymous claims identity.")
40
41
  return ClaimsIdentity({}, False, authentication_type="Anonymous")
41
42
 
42
- def _get_public_key_or_secret(self, token: str) -> PyJWK:
43
+ async def _get_public_key_or_secret(self, token: str) -> PyJWK:
43
44
  header = get_unverified_header(token)
44
45
  unverified_payload: dict = decode(token, options={"verify_signature": False})
45
46
 
@@ -50,5 +51,6 @@ class JwtTokenValidator:
50
51
  )
51
52
  jwks_client = PyJWKClient(jwksUri)
52
53
 
53
- key = jwks_client.get_signing_key(header["kid"])
54
+ key = await asyncio.to_thread(jwks_client.get_signing_key, header["kid"])
55
+
54
56
  return key
@@ -1,16 +1,21 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: microsoft-agents-hosting-core
3
- Version: 0.5.0.dev11
3
+ Version: 0.5.0.dev19
4
4
  Summary: Core library for Microsoft Agents
5
5
  Author: Microsoft Corporation
6
6
  License-Expression: MIT
7
7
  Project-URL: Homepage, https://github.com/microsoft/Agents
8
8
  Classifier: Programming Language :: Python :: 3
9
+ Classifier: Programming Language :: Python :: 3.10
10
+ Classifier: Programming Language :: Python :: 3.11
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Classifier: Programming Language :: Python :: 3.13
13
+ Classifier: Programming Language :: Python :: 3.14
9
14
  Classifier: Operating System :: OS Independent
10
15
  Requires-Python: >=3.10
11
16
  Description-Content-Type: text/markdown
12
17
  License-File: LICENSE
13
- Requires-Dist: microsoft-agents-activity==0.5.0.dev11
18
+ Requires-Dist: microsoft-agents-activity==0.5.0.dev19
14
19
  Requires-Dist: pyjwt>=2.10.1
15
20
  Requires-Dist: isodate>=0.6.1
16
21
  Requires-Dist: azure-core>=1.30.0
@@ -1,4 +1,4 @@
1
- microsoft-agents-activity==0.5.0.dev11
1
+ microsoft-agents-activity==0.5.0.dev19
2
2
  pyjwt>=2.10.1
3
3
  isodate>=0.6.1
4
4
  azure-core>=1.30.0
@@ -13,6 +13,11 @@ license-files = ["LICENSE"]
13
13
  requires-python = ">=3.10"
14
14
  classifiers = [
15
15
  "Programming Language :: Python :: 3",
16
+ "Programming Language :: Python :: 3.10",
17
+ "Programming Language :: Python :: 3.11",
18
+ "Programming Language :: Python :: 3.12",
19
+ "Programming Language :: Python :: 3.13",
20
+ "Programming Language :: Python :: 3.14",
16
21
  "Operating System :: OS Independent",
17
22
  ]
18
23
 
@@ -1,55 +0,0 @@
1
- """
2
- Copyright (c) Microsoft Corporation. All rights reserved.
3
- Licensed under the MIT License.
4
- """
5
-
6
- from __future__ import annotations
7
- import logging
8
-
9
- from threading import Timer
10
- from typing import Optional
11
-
12
- from microsoft_agents.hosting.core import TurnContext
13
- from microsoft_agents.activity import Activity, ActivityTypes
14
-
15
- logger = logging.getLogger(__name__)
16
-
17
-
18
- class TypingIndicator:
19
- """
20
- Encapsulates the logic for sending "typing" activity to the user.
21
- """
22
-
23
- _interval: int
24
- _timer: Optional[Timer] = None
25
-
26
- def __init__(self, interval=1000) -> None:
27
- self._interval = interval
28
-
29
- async def start(self, context: TurnContext) -> None:
30
- if self._timer is not None:
31
- return
32
-
33
- logger.debug(f"Starting typing indicator with interval: {self._interval} ms")
34
- func = self._on_timer(context)
35
- self._timer = Timer(self._interval, func)
36
- self._timer.start()
37
- await func()
38
-
39
- def stop(self) -> None:
40
- if self._timer:
41
- logger.debug("Stopping typing indicator")
42
- self._timer.cancel()
43
- self._timer = None
44
-
45
- def _on_timer(self, context: TurnContext):
46
- async def __call__():
47
- try:
48
- logger.debug("Sending typing activity")
49
- await context.send_activity(Activity(type=ActivityTypes.typing))
50
- except Exception as e:
51
- # TODO: Improve when adding logging
52
- logger.error(f"Error sending typing activity: {e}")
53
- self.stop()
54
-
55
- return __call__