When developing agents in the DeepSeek Harness (DSH) environment, connecting an Agent to Telegram, Feishu, or WeCom often requires more than basic text interfaces. The Agent needs to handle speech-to-text, receive images, send files, and interact using native message formats.
dsh-im-hub-media is a plugin designed specifically for DSH. It acts as a multi-platform instant messaging gateway, connecting DeepSeek Harness agents to major IM platforms and supporting automatic speech transcription and bidirectional media distribution.
Plugin Overview¶
- Name:
dsh-im-hub-media - Maintainer: GooDAnDReaDY
- Open-source license: MIT
Built on the DSH plugin system, the plugin aims to address the lack of “non-text” capabilities when agents interact with IM platforms.
Core Features¶
Based on verified information, the plugin mainly includes the following capabilities:
1. Multi-Platform Adapters¶
- Telegram Adapter:
- Speech Transcription (STT): Automatically intercepts voice messages (.oga/.ogg formats), transcribes them through the host STT chain, and injects the text into the context.
- Multimedia Processing: Supports ingesting images and captions and downloading documents/files.
- Context Association: Supports quoted replies and thread-context assembly.
- Media Distribution: When an Agent reply contains a
MEDIA:/absolute/pathmarker, the plugin automatically calls native interfaces to send images, voice messages, or documents.
- Feishu (Lark) Adapter:
- Connection Methods: Supports WebSocket long connections and Webhook callbacks.
- Message Cards: Supports rendering interactive message cards.
- Rich Media Exchange: Natively supports exchange of Feishu voice, documents, and attachments.
- WeCom Adapter:
- Enterprise Gateway: Built-in XML/JSON message encryption and decryption logic to satisfy WeCom security requirements.
- Integration Methods: Supports bot and app integration modes.
2. Security and Isolation¶
- Access Control: Supports configuring allowlists via
allowedUsersandallowedChats. - Session Isolation: Each chat session has independent session state to prevent context confusion.
- Credential Resolution: Credentials such as Bot Tokens are dynamically resolved through the host Credentials service, eliminating the need for hardcoding.
Installation and Enablement¶
The installation process requires the DSH CLI tool. Make sure DeepSeek Harness is already installed in the current environment.
dsh plugin --profile web add @goodandready/dsh-im-hub-media
After installation, the DSH service must be restarted to mount the adapter tree.
systemctl --user restart dsh-web
Configuration and Usage¶
Media Distribution Mechanism¶
When replying to messages, the Agent triggers media distribution by inserting a specified marker into the text. The Agent must include a MEDIA:/absolute/path marker in its reply; the plugin automatically recognizes the path and calls the corresponding platform API to send native media files.
Voice Processing Flow¶
When a user sends a voice message on a supported IM platform:
1. The plugin intercepts the audio file (such as .oga/.ogg).
2. Speech-to-text processing is performed through the host STT chain.
3. The transcribed text is passed to the DSH Agent as input context.
File Processing¶
The plugin downloads received files and parses them. For smaller text or code files, the content is directly injected inline into the message stream; for large files or non-text files, they are saved to the configured download directory.
Configuration Example¶
Enable the required adapters in the DSH configuration file. The following example shows how to enable Telegram and configure the media download path:
dsh-im-hub-media:
adapters:
telegram:
enabled: true
# Token environment variable resolved from the host Credentials service
tokenEnv: TELEGRAM_BOT_TOKEN
# Restrict accessible user IDs
allowedUsers: ["123456789"]
# Specify the STT provider, default auto
sttProvider: auto
# Specify the media file download directory
downloadMediaDir: data/im/media
feishu:
enabled: false
appId: cli_xxx
appSecretEnv: FEISHU_APP_SECRET
wecom:
enabled: false
corpId: ww_xxx
secretEnv: WECOM_SECRET
Notes¶
- Restart Dependency: After installation, the DSH process must be restarted to load the plugin.
- Permissions and Directory: Ensure the configured
downloadMediaDirhas write permissions and that the DSH process can access it. - Host Service Dependencies: Speech transcription depends on the host-configured STT chain, and credential resolution depends on the host Credentials service.
- Source Code Review: Before using it in a production environment, review the GitHub source code to confirm security and compatibility.
Summary¶
By providing standardized interfaces, dsh-im-hub-media transforms the native capabilities of Telegram, Feishu, and WeCom into context and tools usable by DSH Agents. It addresses pain points in voice interaction, file transfer, and rich media presentation, making it a practical component for building cross-platform automated agents.