microsoft-agents-hosting-slack 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_slack-1.9.0.dev5/microsoft_agents_hosting_slack.egg-info → microsoft_agents_hosting_slack-1.9.0.dev10}/PKG-INFO +10 -4
- microsoft_agents_hosting_slack-1.9.0.dev10/VERSION.txt +1 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/slack_agent_extension.py +164 -93
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10/microsoft_agents_hosting_slack.egg-info}/PKG-INFO +10 -4
- microsoft_agents_hosting_slack-1.9.0.dev10/microsoft_agents_hosting_slack.egg-info/requires.txt +2 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/readme.md +8 -2
- microsoft_agents_hosting_slack-1.9.0.dev5/VERSION.txt +0 -1
- microsoft_agents_hosting_slack-1.9.0.dev5/microsoft_agents_hosting_slack.egg-info/requires.txt +0 -2
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/LICENSE +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/MANIFEST.in +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/__init__.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/_path_navigator.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/api/__init__.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/api/action_payload.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/api/chunks.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/api/event_content.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/api/event_envelope.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/api/slack_api.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/api/slack_channel_data.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/api/slack_model.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/api/slack_response.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/api/slack_stream.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/py.typed +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/route_handlers.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/slack_activity.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/slack_helpers.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents/hosting/slack/slack_turn_context.py +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents_hosting_slack.egg-info/SOURCES.txt +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents_hosting_slack.egg-info/dependency_links.txt +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/microsoft_agents_hosting_slack.egg-info/top_level.txt +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/pyproject.toml +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/setup.cfg +0 -0
- {microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-hosting-slack
|
|
3
|
-
Version: 1.9.0.
|
|
3
|
+
Version: 1.9.0.dev10
|
|
4
4
|
Summary: Integration library for Microsoft Agents with Slack
|
|
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-hosting-core==1.9.0.
|
|
18
|
+
Requires-Dist: microsoft-agents-hosting-core==1.9.0.dev10
|
|
19
19
|
Requires-Dist: aiohttp>=3.12
|
|
20
20
|
Dynamic: license-file
|
|
21
21
|
Dynamic: requires-dist
|
|
@@ -78,8 +78,14 @@ async def on_slack_message(context: SlackTurnContext, state: TurnState) -> None:
|
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
Use `@slack.message("hello")` for a specific message or `@slack.event("reaction_added")`
|
|
81
|
-
for a specific event. Both accept compiled regular
|
|
82
|
-
activities.
|
|
81
|
+
for a specific event. Both accept a string, a compiled regular expression, or a list of
|
|
82
|
+
either, and match only Slack activities. When called without a selector, they match every
|
|
83
|
+
Slack message or event and register at `RouteRank.LAST`, so more specific routes win.
|
|
84
|
+
`on_message()` and `on_event()` are deprecated aliases.
|
|
85
|
+
|
|
86
|
+
`@slack.conversation_update(...)`, `@slack.members_added()`, `@slack.members_removed()`,
|
|
87
|
+
and `@slack.installation_update()` mirror the corresponding `AgentApplication` route
|
|
88
|
+
hooks, but match only Slack activities and pass a `SlackTurnContext` to the handler.
|
|
83
89
|
|
|
84
90
|
Handlers receive a `SlackTurnContext` with typed `activity.slack_channel_data` and
|
|
85
91
|
access to the per-turn Slack API client through `context.client`. Envelope, payload,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.9.0.dev10
|
|
@@ -5,15 +5,22 @@ Licensed under the MIT License.
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
import
|
|
9
|
-
from typing import Any, Generic, Pattern, TypeVar
|
|
8
|
+
import warnings
|
|
10
9
|
|
|
10
|
+
from typing import Any, Callable, Generic, TypeVar
|
|
11
11
|
from typing_extensions import deprecated
|
|
12
12
|
|
|
13
|
-
from microsoft_agents.activity import
|
|
13
|
+
from microsoft_agents.activity import (
|
|
14
|
+
Channels,
|
|
15
|
+
ConversationUpdateTypes,
|
|
16
|
+
)
|
|
14
17
|
from microsoft_agents.hosting.core import TurnContext
|
|
15
|
-
from microsoft_agents.hosting.core.app import AgentApplication
|
|
16
|
-
from microsoft_agents.hosting.core.app._type_defs import
|
|
18
|
+
from microsoft_agents.hosting.core.app import AgentApplication
|
|
19
|
+
from microsoft_agents.hosting.core.app._type_defs import (
|
|
20
|
+
RouteHandler,
|
|
21
|
+
_RouteDecorator,
|
|
22
|
+
TextSelector,
|
|
23
|
+
)
|
|
17
24
|
from microsoft_agents.hosting.core.app.state import TurnState
|
|
18
25
|
|
|
19
26
|
from .api import (
|
|
@@ -26,18 +33,6 @@ from .route_handlers import SlackRouteHandler, wrap_slack_route_handler
|
|
|
26
33
|
|
|
27
34
|
StateT = TypeVar("StateT", bound=TurnState)
|
|
28
35
|
|
|
29
|
-
TextSelector = str | Pattern[str] | None
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
def _matches_text(selector: TextSelector, text: str | None) -> bool:
|
|
33
|
-
if selector is None:
|
|
34
|
-
return True
|
|
35
|
-
if text is None:
|
|
36
|
-
return False
|
|
37
|
-
if isinstance(selector, Pattern):
|
|
38
|
-
return re.fullmatch(selector, text) is not None
|
|
39
|
-
return text == selector
|
|
40
|
-
|
|
41
36
|
|
|
42
37
|
def _is_slack_channel(context: TurnContext) -> bool:
|
|
43
38
|
return context.activity.channel_id == Channels.slack.value
|
|
@@ -48,8 +43,11 @@ class SlackAgentExtension(Generic[StateT]):
|
|
|
48
43
|
Slack-specific route registration and helpers for an
|
|
49
44
|
:class:`~microsoft_agents.hosting.core.app.AgentApplication`.
|
|
50
45
|
|
|
51
|
-
Handlers registered with :meth:`message
|
|
52
|
-
:
|
|
46
|
+
Handlers registered with :meth:`message`, :meth:`event`,
|
|
47
|
+
:meth:`conversation_update`, :meth:`members_added`,
|
|
48
|
+
:meth:`members_removed`, or :meth:`installation_update` match only Slack
|
|
49
|
+
activities and receive a :class:`SlackTurnContext` with a typed
|
|
50
|
+
:class:`SlackActivity`.
|
|
53
51
|
Pass ``slack_api=...`` to configure the extension's default API client.
|
|
54
52
|
Before each Slack turn, this client is registered in turn services only
|
|
55
53
|
if no :class:`SlackApi` is already present. Clients supplied by middleware
|
|
@@ -182,116 +180,189 @@ class SlackAgentExtension(Generic[StateT]):
|
|
|
182
180
|
|
|
183
181
|
def message(
|
|
184
182
|
self,
|
|
185
|
-
select: TextSelector = None,
|
|
183
|
+
select: TextSelector | None = None,
|
|
186
184
|
*,
|
|
187
185
|
auth_handlers: list[str] | None = None,
|
|
188
|
-
|
|
186
|
+
**kwargs,
|
|
189
187
|
) -> _RouteDecorator[SlackRouteHandler[StateT]]:
|
|
190
188
|
"""Register a handler for Slack message activities.
|
|
191
189
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
``rank`` defaults to :attr:`RouteRank.DEFAULT`; when ``select`` is
|
|
198
|
-
``None`` the rank is downgraded to :attr:`RouteRank.LAST` so explicit
|
|
199
|
-
text routes win — matching the C# behavior.
|
|
200
|
-
|
|
201
|
-
``auth_handlers`` selects the authentication handlers for the route.
|
|
190
|
+
:param select: Optional text selector to match the incoming message text.
|
|
191
|
+
:type select: TextSelector | None
|
|
192
|
+
:param auth_handlers: Optional list of authorization handler IDs for the route.
|
|
193
|
+
:type auth_handlers: list[str] | None
|
|
194
|
+
:param kwargs: Additional route configuration passed to :meth:`microsoft_agents.hosting.core.AgentApplication.add_route`.
|
|
202
195
|
"""
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
def __selector(context: TurnContext) -> bool:
|
|
208
|
-
if context.activity.type != ActivityTypes.message or not _is_slack_channel(
|
|
209
|
-
context
|
|
210
|
-
):
|
|
211
|
-
return False
|
|
212
|
-
return _matches_text(select, context.activity.text)
|
|
213
|
-
|
|
214
|
-
def __call(
|
|
215
|
-
func: SlackRouteHandler[StateT],
|
|
216
|
-
) -> SlackRouteHandler[StateT]:
|
|
217
|
-
self._app.add_route(
|
|
218
|
-
__selector,
|
|
219
|
-
wrap_slack_route_handler(func, self._app),
|
|
220
|
-
rank=effective_rank,
|
|
221
|
-
auth_handlers=auth_handlers,
|
|
196
|
+
return self._wrap_decorator(
|
|
197
|
+
self._app.message(
|
|
198
|
+
select, auth_handlers=auth_handlers, channel_id=Channels.slack, **kwargs
|
|
222
199
|
)
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
return __call
|
|
200
|
+
)
|
|
226
201
|
|
|
227
202
|
@deprecated(
|
|
228
203
|
"SlackAgentExtension.on_message is deprecated; use SlackAgentExtension.message instead."
|
|
229
204
|
)
|
|
230
205
|
def on_message(
|
|
231
206
|
self,
|
|
232
|
-
select: TextSelector = None,
|
|
207
|
+
select: TextSelector | None = None,
|
|
233
208
|
*,
|
|
234
209
|
auth_handlers: list[str] | None = None,
|
|
235
|
-
|
|
210
|
+
**kwargs,
|
|
236
211
|
) -> _RouteDecorator[SlackRouteHandler[StateT]]:
|
|
237
212
|
"""Deprecated alias for :meth:`message`; emits ``DeprecationWarning``."""
|
|
238
|
-
return self.message(select, auth_handlers=auth_handlers,
|
|
213
|
+
return self.message(select, auth_handlers=auth_handlers, **kwargs)
|
|
239
214
|
|
|
240
215
|
# ── event routes ───────────────────────────────────────────────────────
|
|
241
216
|
|
|
242
217
|
def event(
|
|
243
218
|
self,
|
|
244
|
-
|
|
219
|
+
select: TextSelector | None = None,
|
|
245
220
|
*,
|
|
221
|
+
event_name: str | None = None,
|
|
246
222
|
auth_handlers: list[str] | None = None,
|
|
247
|
-
|
|
223
|
+
**kwargs,
|
|
248
224
|
) -> _RouteDecorator[SlackRouteHandler[StateT]]:
|
|
249
225
|
"""Register a handler for Slack event activities.
|
|
250
226
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
:
|
|
258
|
-
is preserved. ``auth_handlers`` selects authentication handlers.
|
|
227
|
+
:param select: Optional text selector to match the incoming event name.
|
|
228
|
+
:type select: TextSelector | None
|
|
229
|
+
:param event_name: (Deprecated) Optional specific event name to match.
|
|
230
|
+
:type event_name: str | None
|
|
231
|
+
:param auth_handlers: Optional list of authorization handler IDs for the route.
|
|
232
|
+
:type auth_handlers: list[str] | None
|
|
233
|
+
:param kwargs: Additional route configuration passed to :meth:`microsoft_agents.hosting.core.AgentApplication.add_route`.
|
|
259
234
|
"""
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
def __selector(context: TurnContext) -> bool:
|
|
267
|
-
if context.activity.type != ActivityTypes.event or not _is_slack_channel(
|
|
268
|
-
context
|
|
269
|
-
):
|
|
270
|
-
return False
|
|
271
|
-
return _matches_text(event_name, context.activity.name)
|
|
272
|
-
|
|
273
|
-
def __call(
|
|
274
|
-
func: SlackRouteHandler[StateT],
|
|
275
|
-
) -> SlackRouteHandler[StateT]:
|
|
276
|
-
self._app.add_route(
|
|
277
|
-
__selector,
|
|
278
|
-
wrap_slack_route_handler(func, self._app),
|
|
279
|
-
rank=effective_rank,
|
|
280
|
-
auth_handlers=auth_handlers,
|
|
235
|
+
if event_name is not None:
|
|
236
|
+
warnings.warn(
|
|
237
|
+
"The `event_name` parameter is deprecated; use `select` instead.",
|
|
238
|
+
DeprecationWarning,
|
|
239
|
+
stacklevel=2,
|
|
281
240
|
)
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
241
|
+
return self._wrap_decorator(
|
|
242
|
+
self._app.event(
|
|
243
|
+
select, auth_handlers=auth_handlers, channel_id=Channels.slack, **kwargs
|
|
244
|
+
)
|
|
245
|
+
)
|
|
285
246
|
|
|
286
247
|
@deprecated(
|
|
287
248
|
"SlackAgentExtension.on_event is deprecated; use SlackAgentExtension.event instead."
|
|
288
249
|
)
|
|
289
250
|
def on_event(
|
|
290
251
|
self,
|
|
291
|
-
event_name: TextSelector = None,
|
|
252
|
+
event_name: TextSelector | None = None,
|
|
292
253
|
*,
|
|
293
254
|
auth_handlers: list[str] | None = None,
|
|
294
|
-
|
|
255
|
+
**kwargs,
|
|
295
256
|
) -> _RouteDecorator[SlackRouteHandler[StateT]]:
|
|
296
257
|
"""Deprecated alias for :meth:`event`; emits ``DeprecationWarning``."""
|
|
297
|
-
return self.event(event_name, auth_handlers=auth_handlers,
|
|
258
|
+
return self.event(event_name, auth_handlers=auth_handlers, **kwargs)
|
|
259
|
+
|
|
260
|
+
# ── AgentApplication route hooks ───────────────────────────────────────
|
|
261
|
+
|
|
262
|
+
def _wrap_decorator(
|
|
263
|
+
self, decorator: Callable[[RouteHandler[StateT]], RouteHandler[StateT]]
|
|
264
|
+
) -> _RouteDecorator[SlackRouteHandler[StateT]]:
|
|
265
|
+
"""Wrap a core route decorator so it accepts a :class:`SlackRouteHandler`.
|
|
266
|
+
|
|
267
|
+
The handler is converted via :func:`wrap_slack_route_handler` before being
|
|
268
|
+
passed to *decorator*, and the original handler is returned.
|
|
269
|
+
|
|
270
|
+
:param decorator: A core route decorator from :class:`AgentApplication`.
|
|
271
|
+
:return: A decorator that registers a :class:`SlackRouteHandler`.
|
|
272
|
+
"""
|
|
273
|
+
|
|
274
|
+
def __call(func: SlackRouteHandler[StateT]) -> SlackRouteHandler[StateT]:
|
|
275
|
+
decorator(wrap_slack_route_handler(func, self._app))
|
|
276
|
+
return func
|
|
277
|
+
|
|
278
|
+
return __call
|
|
279
|
+
|
|
280
|
+
def conversation_update(
|
|
281
|
+
self,
|
|
282
|
+
type: ConversationUpdateTypes | str,
|
|
283
|
+
*,
|
|
284
|
+
auth_handlers: list[str] | None = None,
|
|
285
|
+
**kwargs: Any,
|
|
286
|
+
) -> _RouteDecorator[SlackRouteHandler[StateT]]:
|
|
287
|
+
"""Register a handler for a Slack conversation update event type.
|
|
288
|
+
|
|
289
|
+
Non-Slack activities never match. The handler receives a
|
|
290
|
+
:class:`SlackTurnContext` and the turn state.
|
|
291
|
+
|
|
292
|
+
:param type: The :class:`ConversationUpdateTypes` value to match (e.g. ``membersAdded``).
|
|
293
|
+
:param auth_handlers: Optional list of auth handler names to run before the route.
|
|
294
|
+
:param kwargs: Additional route configuration, such as ``rank``, passed to
|
|
295
|
+
:meth:`AgentApplication.add_route`.
|
|
296
|
+
:return: A decorator that registers the handler and returns it.
|
|
297
|
+
"""
|
|
298
|
+
return self._wrap_decorator(
|
|
299
|
+
self._app.conversation_update(
|
|
300
|
+
type, auth_handlers=auth_handlers, channel_id=Channels.slack, **kwargs
|
|
301
|
+
)
|
|
302
|
+
)
|
|
303
|
+
|
|
304
|
+
def members_added(
|
|
305
|
+
self,
|
|
306
|
+
*,
|
|
307
|
+
auth_handlers: list[str] | None = None,
|
|
308
|
+
**kwargs: Any,
|
|
309
|
+
) -> _RouteDecorator[SlackRouteHandler[StateT]]:
|
|
310
|
+
"""Register a handler for the Slack ``membersAdded`` event.
|
|
311
|
+
|
|
312
|
+
Non-Slack activities never match. The handler receives a
|
|
313
|
+
:class:`SlackTurnContext` and the turn state.
|
|
314
|
+
|
|
315
|
+
:param auth_handlers: Optional list of auth handler names to run before the route.
|
|
316
|
+
:param kwargs: Additional route configuration, such as ``rank``, passed to
|
|
317
|
+
:meth:`AgentApplication.add_route`.
|
|
318
|
+
:return: A decorator that registers the handler and returns it.
|
|
319
|
+
"""
|
|
320
|
+
return self._wrap_decorator(
|
|
321
|
+
self._app.members_added(
|
|
322
|
+
auth_handlers=auth_handlers, channel_id=Channels.slack, **kwargs
|
|
323
|
+
)
|
|
324
|
+
)
|
|
325
|
+
|
|
326
|
+
def members_removed(
|
|
327
|
+
self,
|
|
328
|
+
*,
|
|
329
|
+
auth_handlers: list[str] | None = None,
|
|
330
|
+
**kwargs: Any,
|
|
331
|
+
) -> _RouteDecorator[SlackRouteHandler[StateT]]:
|
|
332
|
+
"""Register a handler for the Slack ``membersRemoved`` event.
|
|
333
|
+
|
|
334
|
+
Non-Slack activities never match. The handler receives a
|
|
335
|
+
:class:`SlackTurnContext` and the turn state.
|
|
336
|
+
|
|
337
|
+
:param auth_handlers: Optional list of auth handler names to run before the route.
|
|
338
|
+
:param kwargs: Additional route configuration, such as ``rank``, passed to
|
|
339
|
+
:meth:`AgentApplication.add_route`.
|
|
340
|
+
:return: A decorator that registers the handler and returns it.
|
|
341
|
+
"""
|
|
342
|
+
return self._wrap_decorator(
|
|
343
|
+
self._app.members_removed(
|
|
344
|
+
auth_handlers=auth_handlers, channel_id=Channels.slack, **kwargs
|
|
345
|
+
)
|
|
346
|
+
)
|
|
347
|
+
|
|
348
|
+
def installation_update(
|
|
349
|
+
self,
|
|
350
|
+
*,
|
|
351
|
+
auth_handlers: list[str] | None = None,
|
|
352
|
+
**kwargs: Any,
|
|
353
|
+
) -> _RouteDecorator[SlackRouteHandler[StateT]]:
|
|
354
|
+
"""Register a handler for the Slack ``installationUpdate`` event.
|
|
355
|
+
|
|
356
|
+
Non-Slack activities never match. The handler receives a
|
|
357
|
+
:class:`SlackTurnContext` and the turn state.
|
|
358
|
+
|
|
359
|
+
:param auth_handlers: Optional list of auth handler names to run before the route.
|
|
360
|
+
:param kwargs: Additional route configuration, such as ``rank``, passed to
|
|
361
|
+
:meth:`AgentApplication.add_route`.
|
|
362
|
+
:return: A decorator that registers the handler and returns it.
|
|
363
|
+
"""
|
|
364
|
+
return self._wrap_decorator(
|
|
365
|
+
self._app.installation_update(
|
|
366
|
+
auth_handlers=auth_handlers, channel_id=Channels.slack, **kwargs
|
|
367
|
+
)
|
|
368
|
+
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: microsoft-agents-hosting-slack
|
|
3
|
-
Version: 1.9.0.
|
|
3
|
+
Version: 1.9.0.dev10
|
|
4
4
|
Summary: Integration library for Microsoft Agents with Slack
|
|
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-hosting-core==1.9.0.
|
|
18
|
+
Requires-Dist: microsoft-agents-hosting-core==1.9.0.dev10
|
|
19
19
|
Requires-Dist: aiohttp>=3.12
|
|
20
20
|
Dynamic: license-file
|
|
21
21
|
Dynamic: requires-dist
|
|
@@ -78,8 +78,14 @@ async def on_slack_message(context: SlackTurnContext, state: TurnState) -> None:
|
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
Use `@slack.message("hello")` for a specific message or `@slack.event("reaction_added")`
|
|
81
|
-
for a specific event. Both accept compiled regular
|
|
82
|
-
activities.
|
|
81
|
+
for a specific event. Both accept a string, a compiled regular expression, or a list of
|
|
82
|
+
either, and match only Slack activities. When called without a selector, they match every
|
|
83
|
+
Slack message or event and register at `RouteRank.LAST`, so more specific routes win.
|
|
84
|
+
`on_message()` and `on_event()` are deprecated aliases.
|
|
85
|
+
|
|
86
|
+
`@slack.conversation_update(...)`, `@slack.members_added()`, `@slack.members_removed()`,
|
|
87
|
+
and `@slack.installation_update()` mirror the corresponding `AgentApplication` route
|
|
88
|
+
hooks, but match only Slack activities and pass a `SlackTurnContext` to the handler.
|
|
83
89
|
|
|
84
90
|
Handlers receive a `SlackTurnContext` with typed `activity.slack_channel_data` and
|
|
85
91
|
access to the per-turn Slack API client through `context.client`. Envelope, payload,
|
{microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/readme.md
RENAMED
|
@@ -56,8 +56,14 @@ async def on_slack_message(context: SlackTurnContext, state: TurnState) -> None:
|
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
Use `@slack.message("hello")` for a specific message or `@slack.event("reaction_added")`
|
|
59
|
-
for a specific event. Both accept compiled regular
|
|
60
|
-
activities.
|
|
59
|
+
for a specific event. Both accept a string, a compiled regular expression, or a list of
|
|
60
|
+
either, and match only Slack activities. When called without a selector, they match every
|
|
61
|
+
Slack message or event and register at `RouteRank.LAST`, so more specific routes win.
|
|
62
|
+
`on_message()` and `on_event()` are deprecated aliases.
|
|
63
|
+
|
|
64
|
+
`@slack.conversation_update(...)`, `@slack.members_added()`, `@slack.members_removed()`,
|
|
65
|
+
and `@slack.installation_update()` mirror the corresponding `AgentApplication` route
|
|
66
|
+
hooks, but match only Slack activities and pass a `SlackTurnContext` to the handler.
|
|
61
67
|
|
|
62
68
|
Handlers receive a `SlackTurnContext` with typed `activity.slack_channel_data` and
|
|
63
69
|
access to the per-turn Slack API client through `context.client`. Envelope, payload,
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.9.0.dev5
|
{microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/LICENSE
RENAMED
|
File without changes
|
{microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/MANIFEST.in
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/setup.cfg
RENAMED
|
File without changes
|
{microsoft_agents_hosting_slack-1.9.0.dev5 → microsoft_agents_hosting_slack-1.9.0.dev10}/setup.py
RENAMED
|
File without changes
|