3.2 KiB
Slack EBA Adapter
Structure
Slack is migrated into src/langbot/pkg/platform/adapters/slack/ with the standard EBA adapter layout:
adapter.pyowns lifecycle, listener dispatch, unified webhook handling, outbound send/reply, and event caches.event_converter.pymaps Slackimandapp_mentionchannel events tomessage.received.message_converter.pymaps commonMessageChaincomponents to Slack text fallback and maps inbound Slack text/image payloads back to EBA components.api_impl.pyprovides cache-backed common read APIs.platform_api.pydeclares safe Slack-specific API actions.manifest.yamldeclaresslack-eba.
The legacy src/langbot/pkg/platform/sources/slack.py adapter is kept unchanged.
Configuration
| Field | Required | Notes |
|---|---|---|
webhook_url |
No | Generated by LangBot. Paste it into Slack Event Subscriptions. |
bot_token |
Yes | Slack bot token, usually xoxb-.... |
signing_secret |
Yes | Slack app signing secret. |
Events
| Event | Notes |
|---|---|
message.received |
Emitted for private im messages and channel app_mention events. Channel messages are mapped to group chats. |
platform.specific |
Reserved for Slack event types that are not converted into common message events. |
Common APIs
Required:
send_messagereply_message
Optional:
get_messageget_user_infoget_friend_listget_group_infoget_group_listget_group_member_listget_group_member_infocall_platform_api
Cache-backed APIs are only available after the relevant inbound event has been observed.
Platform APIs
| Action | Notes |
|---|---|
get_mode |
Returns webhook mode and configured bot account id. |
auth_test |
Calls Slack auth.test with the configured bot token. |
Known Limits
- Slack file/image outbound is currently represented as text fallback because the existing Slack SDK wrapper only exposes
chat_postMessage. - Inbound channel coverage follows the legacy adapter behavior: only
app_mentionevents are treated as group messages. - Real live testing requires a public callback URL configured in Slack Event Subscriptions.
Verification
Local mocked unit coverage validates manifest parity, event conversion, legacy listener compatibility, cache-backed APIs, send/reply routing, and declared platform APIs.
Plugin E2E evidence was captured on June 2, 2026 against dev.rockchin.top with Slack private DM input and EBAEventProbe through the standalone runtime.
Evidence file: /home/wgc/LangBotxg/LangBotEbaTest/data/temp/slack_eba_plugin_probe.jsonl.
Observed:
- Real Slack private text produced
MessageReceivedwithadapter_name=slack-eba,Source + Plain, private chat type, and filledbot_uuid. - Safe common APIs passed:
get_message,get_user_info,get_friend_list. - Outbound component fallback sweep passed through
send_message: plain/at/face, image, quote, file, and forward. - Declared Slack platform APIs passed:
get_mode,auth_test.
Still pending:
- Channel
app_mentionplugin E2E. - Real inbound Slack file/image UI evidence.
Live probe scaffold: tests/e2e/live_slack_eba_probe.py.