microsoft-agents-hosting-core 1.9.0.dev5__tar.gz → 1.9.0.dev10__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.
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/PKG-INFO +2 -2
- microsoft_agents_hosting_core-1.9.0.dev10/VERSION.txt +1 -0
- microsoft_agents_hosting_core-1.9.0.dev10/microsoft_agents/hosting/core/app/_selector.py +143 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/_type_defs.py +2 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/_utils.py +30 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/agent_application.py +314 -66
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/state/turn_state.py +0 -15
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents_hosting_core.egg-info/PKG-INFO +2 -2
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents_hosting_core.egg-info/SOURCES.txt +1 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents_hosting_core.egg-info/requires.txt +1 -1
- microsoft_agents_hosting_core-1.9.0.dev5/VERSION.txt +0 -1
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/LICENSE +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/MANIFEST.in +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/_http_adapter_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/_oauth/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/_oauth/_flow_state.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/_oauth/_flow_storage_client.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/_oauth/_oauth_flow.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/_utils/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/_utils/_service_set.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/_utils/_turn_context_wrapper.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/activity_handler.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/agent.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/_routes/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/_routes/_route.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/_routes/_route_list.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/_routes/route_rank.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/adaptive_card/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/adaptive_card/_type_defs.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/adaptive_card/adaptive_card.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/adaptive_card/factory.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/adaptive_card/models.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/app_error.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/app_options.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/attachment_downloader.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/input_file.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/m365_attachment_downloader.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/oauth/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/oauth/_handlers/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/oauth/_handlers/_authorization_handler.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/oauth/_handlers/_user_authorization.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/oauth/_handlers/agentic_user_authorization.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/oauth/_handlers/connector_user_authorization.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/oauth/_sign_in_response.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/oauth/_sign_in_state.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/oauth/auth_handler.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/oauth/authorization.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/oauth/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/oauth/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/oauth/telemetry/spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/proactive/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/proactive/conversation.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/proactive/conversation_builder.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/proactive/conversation_reference_builder.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/proactive/create_conversation_options.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/proactive/proactive.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/proactive/proactive_options.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/proactive/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/proactive/telemetry/_utils.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/proactive/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/proactive/telemetry/spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/query.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/state/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/state/conversation_state.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/state/state.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/state/temp_state.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/streaming/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/streaming/citation.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/streaming/citation_util.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/streaming/streaming_response.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/telemetry/metrics.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/telemetry/spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/app/typing_indicator.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/_entra_issuers.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/_helpers.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/_log_config.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/access_token_provider_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/agent_auth_configuration.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/anonymous_token_provider.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/auth_types.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/authentication_constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/claims_identity.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/connection_manager.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/connection_settings_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/connections.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/jwt/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/jwt/_authorize_request.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/jwt/jwt_token_validator.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/telemetry/metrics.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/authorization/telemetry/spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/card_factory.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/channel_adapter.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/channel_api_handler_protocol.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/channel_service_adapter.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/channel_service_client_factory_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/client/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/client/agent_conversation_reference.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/client/channel_factory_protocol.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/client/channel_host_protocol.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/client/channel_info_protocol.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/client/channel_protocol.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/client/channels_configuration.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/client/configuration_channel_host.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/client/conversation_constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/client/conversation_id_factory.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/client/conversation_id_factory_options.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/client/conversation_id_factory_protocol.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/client/http_agent_channel.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/client/http_agent_channel_factory.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/_utils.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/agent_sign_in_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/attachments_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/client/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/client/_base_client.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/client/agent_sign_in.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/client/connector_client.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/client/user_token.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/client/user_token_client.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/connector_client_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/conversations_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/get_product_info.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/mcs/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/mcs/mcs_connector_client.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/teams/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/teams/teams_connector_client.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/telemetry/_request_span_wrapper.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/telemetry/connector_spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/telemetry/metrics.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/telemetry/user_token_client_spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/user_token_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/connector/user_token_client_base.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/errors/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/errors/error_resources.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/header_propagation/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/header_propagation/agentic_header_provider.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/header_propagation/header_propagation_context.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/header_propagation/header_value_provider.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/http/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/http/_channel_service_routes.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/http/_http_request_protocol.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/http/_http_response.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/message_factory.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/middleware_set.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/py.typed +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/rest_channel_service_client_factory.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/security/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/security/_connector.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/security/_middleware.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/security/_utils.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/security/_validator.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/security/outbound_host_validator.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/state/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/state/agent_state.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/state/state_property_accessor.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/state/user_state.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/_type_aliases.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/error_handling.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/memory_storage.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/storage.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/store_item.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/telemetry/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/telemetry/metrics.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/telemetry/spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/transcript/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/transcript/transcript_file_store.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/transcript/transcript_info.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/transcript/transcript_logger.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/transcript/transcript_memory_store.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/storage/transcript/transcript_store.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/adapter/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/adapter/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/adapter/metrics.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/adapter/spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/attributes.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/core/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/core/_agents_telemetry.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/core/base_span_wrapper.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/core/resource.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/core/simple_span_wrapper.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/core/type_defs.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/turn_context/__init__.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/turn_context/constants.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/turn_context/spans.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/telemetry/utils.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents/hosting/core/turn_context.py +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents_hosting_core.egg-info/dependency_links.txt +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/microsoft_agents_hosting_core.egg-info/top_level.txt +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/pyproject.toml +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/readme.md +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/setup.cfg +0 -0
- {microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/setup.py +0 -0
{microsoft_agents_hosting_core-1.9.0.dev5 → microsoft_agents_hosting_core-1.9.0.dev10}/PKG-INFO
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-hosting-core
|
|
3
|
-
Version: 1.9.0.
|
|
3
|
+
Version: 1.9.0.dev10
|
|
4
4
|
Summary: Core library for Microsoft Agents
|
|
5
5
|
Author: Microsoft Corporation
|
|
6
6
|
License-Expression: MIT
|
|
@@ -15,7 +15,7 @@ Classifier: Operating System :: OS Independent
|
|
|
15
15
|
Requires-Python: >=3.10
|
|
16
16
|
Description-Content-Type: text/markdown
|
|
17
17
|
License-File: LICENSE
|
|
18
|
-
Requires-Dist: microsoft-agents-activity==1.9.0.
|
|
18
|
+
Requires-Dist: microsoft-agents-activity==1.9.0.dev10
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.9.0.dev10
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
|
+
# Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import re
|
|
5
|
+
|
|
6
|
+
from microsoft_agents.activity import ActivityTypes, ChannelId
|
|
7
|
+
from microsoft_agents.hosting.core import TurnContext
|
|
8
|
+
from ._type_defs import RouteSelector, TextSelector
|
|
9
|
+
from ._utils import _matches_text
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _text_selector(
|
|
13
|
+
select: str | re.Pattern[str] | list[str | re.Pattern[str]],
|
|
14
|
+
) -> RouteSelector:
|
|
15
|
+
"""Creates a route selector that matches the activity text against the selection criteria.
|
|
16
|
+
|
|
17
|
+
Strings must match the text exactly; regex patterns must fully match it.
|
|
18
|
+
|
|
19
|
+
:param select: A string, regex pattern, or a list of strings/regex patterns to match against.
|
|
20
|
+
:return: A route selector function that returns True if the activity text matches any of the selection criteria.
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
def __selector(context: TurnContext) -> bool:
|
|
24
|
+
"""Selector function that checks if the given text matches the selection criteria."""
|
|
25
|
+
return _matches_text(select, context.activity.text or "")
|
|
26
|
+
|
|
27
|
+
return __selector
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _event_selector(event_selector: TextSelector | None) -> RouteSelector:
|
|
31
|
+
"""Creates a route selector that matches the given event name.
|
|
32
|
+
|
|
33
|
+
:param event_selector: The text selector for the event name to match against.
|
|
34
|
+
:return: A route selector function that matches the specified event name.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
def __selector(context: TurnContext) -> bool:
|
|
38
|
+
"""Selector function that checks if the given event name matches the selection criteria."""
|
|
39
|
+
if not context.activity.type == ActivityTypes.event:
|
|
40
|
+
return False
|
|
41
|
+
return event_selector is None or _matches_text(
|
|
42
|
+
event_selector, context.activity.name or ""
|
|
43
|
+
)
|
|
44
|
+
|
|
45
|
+
return __selector
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _invoke_event_selector(event_selector: TextSelector | None) -> RouteSelector:
|
|
49
|
+
"""Creates a route selector that matches the given invoke event name.
|
|
50
|
+
|
|
51
|
+
:param event_selector: The text selector for the invoke event name to match against.
|
|
52
|
+
:return: A route selector function that matches the specified invoke event name.
|
|
53
|
+
"""
|
|
54
|
+
|
|
55
|
+
def __selector(context: TurnContext) -> bool:
|
|
56
|
+
"""Selector function that checks if the given invoke event name matches the selection criteria."""
|
|
57
|
+
if not context.activity.type == ActivityTypes.invoke:
|
|
58
|
+
return False
|
|
59
|
+
return event_selector is None or _matches_text(
|
|
60
|
+
event_selector, context.activity.name or ""
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
return __selector
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def _activity_type_selector(activity_type: str | list[str]) -> RouteSelector:
|
|
67
|
+
"""Creates a route selector that matches the given activity type.
|
|
68
|
+
|
|
69
|
+
:param activity_type: The activity type or list of activity types to match against.
|
|
70
|
+
:return: A route selector function that matches the specified activity type.
|
|
71
|
+
"""
|
|
72
|
+
if isinstance(activity_type, list):
|
|
73
|
+
return lambda context: context.activity.type in activity_type
|
|
74
|
+
return lambda context: context.activity.type == activity_type
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def _channel_selector(channel_id: str | ChannelId | None) -> RouteSelector:
|
|
78
|
+
"""Creates a route selector that matches the given channel ID.
|
|
79
|
+
|
|
80
|
+
:param channel_id: The channel ID to match against.
|
|
81
|
+
:return: A route selector function that matches the specified channel ID.
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
norm_channel_id = ChannelId(channel_id) if channel_id is not None else None
|
|
85
|
+
|
|
86
|
+
if norm_channel_id is None:
|
|
87
|
+
return lambda context: True
|
|
88
|
+
else:
|
|
89
|
+
|
|
90
|
+
def __selector(context: TurnContext) -> bool:
|
|
91
|
+
"""Selector function that checks if the given channel ID matches the selection criteria."""
|
|
92
|
+
if context.activity.channel_id is None:
|
|
93
|
+
return False
|
|
94
|
+
return norm_channel_id.includes(context.activity.channel_id)
|
|
95
|
+
|
|
96
|
+
return __selector
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def _all_selector(*selectors: RouteSelector) -> RouteSelector:
|
|
100
|
+
"""Combines multiple route selectors into one that only passes if all selectors pass.
|
|
101
|
+
|
|
102
|
+
:param selectors: A variable number of route selector functions to combine.
|
|
103
|
+
:return: A new route selector function that only passes if all provided selectors pass.
|
|
104
|
+
"""
|
|
105
|
+
|
|
106
|
+
def selector(context: TurnContext) -> bool:
|
|
107
|
+
return all(sel(context) for sel in selectors)
|
|
108
|
+
|
|
109
|
+
return selector
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
class _SimpleRouteSelector:
|
|
113
|
+
"""A simple route selector that combines multiple selection criteria such as channel ID, activity type, and text pattern."""
|
|
114
|
+
|
|
115
|
+
def __init__(
|
|
116
|
+
self,
|
|
117
|
+
*,
|
|
118
|
+
channel_id: str | ChannelId | None = None,
|
|
119
|
+
activity_type: str | list[str] | None = None,
|
|
120
|
+
text_pattern: str | re.Pattern[str] | list[str | re.Pattern[str]] | None = None,
|
|
121
|
+
) -> None:
|
|
122
|
+
"""Initializes a simple route selector with optional channel ID, activity type, and text pattern.
|
|
123
|
+
|
|
124
|
+
:param channel_id: The channel ID to match against, or None to match any channel.
|
|
125
|
+
:param activity_type: The activity type to match against, or None to match any activity type.
|
|
126
|
+
:param text_pattern: A text pattern or list of patterns to match against the activity text, or None to match any text.
|
|
127
|
+
"""
|
|
128
|
+
|
|
129
|
+
self._selectors = []
|
|
130
|
+
if channel_id is not None:
|
|
131
|
+
self._selectors.append(_channel_selector(channel_id))
|
|
132
|
+
if activity_type is not None:
|
|
133
|
+
self._selectors.append(_activity_type_selector(activity_type))
|
|
134
|
+
if text_pattern is not None:
|
|
135
|
+
self._selectors.append(_text_selector(text_pattern))
|
|
136
|
+
|
|
137
|
+
def __call__(self, context: TurnContext) -> bool:
|
|
138
|
+
"""Calls the route selector with the given context.
|
|
139
|
+
|
|
140
|
+
:param context: The turn context to evaluate.
|
|
141
|
+
:return: True if all selectors pass for the given context, False otherwise.
|
|
142
|
+
"""
|
|
143
|
+
return all(selector(context) for selector in self._selectors)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
2
|
# Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
+
import re
|
|
4
5
|
from typing import Callable, TypeVar, Awaitable, Protocol
|
|
5
6
|
|
|
6
7
|
from ..turn_context import TurnContext
|
|
@@ -11,6 +12,7 @@ RouteSelector = Callable[[TurnContext], bool]
|
|
|
11
12
|
StateT = TypeVar("StateT", bound=TurnState)
|
|
12
13
|
_StateContra = TypeVar("_StateContra", bound=TurnState, contravariant=True)
|
|
13
14
|
_RouteHandlerT = TypeVar("_RouteHandlerT", bound=Callable)
|
|
15
|
+
TextSelector = str | re.Pattern[str] | list[str | re.Pattern[str]]
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
class _RouteDecorator(Protocol[_RouteHandlerT]):
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
2
2
|
# Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
+
import re
|
|
5
|
+
|
|
4
6
|
from email.message import Message
|
|
5
7
|
from urllib.parse import urlparse
|
|
6
8
|
|
|
9
|
+
from ._type_defs import TextSelector
|
|
10
|
+
|
|
7
11
|
_CONTENT_TYPE = "Content-Type"
|
|
8
12
|
|
|
9
13
|
|
|
@@ -34,3 +38,29 @@ def _basic_url_check(url: str) -> bool:
|
|
|
34
38
|
return parsed.scheme == "https" or (
|
|
35
39
|
parsed.scheme == "http" and parsed.hostname == "localhost"
|
|
36
40
|
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _matches_text(select: TextSelector | None = None, text: str | None = None) -> bool:
|
|
44
|
+
"""Checks if the given text matches the specified text selector.
|
|
45
|
+
|
|
46
|
+
:param select: The text selector to match against. Can be a string, a compiled regex pattern, or a list of these.
|
|
47
|
+
:param text: The text to check. Defaults to an empty string if None is provided.
|
|
48
|
+
:return: True if the text matches the selector, False otherwise.
|
|
49
|
+
"""
|
|
50
|
+
if select is None:
|
|
51
|
+
return True
|
|
52
|
+
|
|
53
|
+
text = text or ""
|
|
54
|
+
if isinstance(select, list):
|
|
55
|
+
for item in select:
|
|
56
|
+
if isinstance(item, re.Pattern):
|
|
57
|
+
if re.fullmatch(item, text) is not None:
|
|
58
|
+
return True
|
|
59
|
+
elif text == item:
|
|
60
|
+
return True
|
|
61
|
+
return False
|
|
62
|
+
|
|
63
|
+
if isinstance(select, re.Pattern):
|
|
64
|
+
return re.fullmatch(select, text) is not None
|
|
65
|
+
|
|
66
|
+
return text == select
|