Preface¶
The plugin system of DeepSeek Harness can integrate channel capabilities into the same dsh environment. For developers who need to collaborate with agents in Feishu/Lark, common requirements include: sending messages in private chats or group chats, receiving streaming cards, handling dsh approval requests, calling cloud documents/spreadsheets/calendar/tasks, and routing multiple agents by chat.
harness-lark is a Lark/Feishu channel plugin that provides Feishu communication capabilities for DeepSeek Harness.
What This Is¶
The repository for harness-lark is:
https://github.com/huoxue1/harness-lark
The license is MIT. It addresses the problem of connecting DeepSeek Harness sessions, streaming replies, approval requests, and Feishu capabilities to the Feishu/Lark messaging channel.
Core Features¶
Below are the verified capabilities.
- IM Messaging: WebSocket long-connection message reception, text/card replies, @mentions, group chat/private chat policies, reconnection deduplication.
- Interactive Cards + Streaming Replies: reasoning stream → answer stream → final result updated to the card, including collapsible reasoning panel, elapsed time/token footer.
- Media: Upload, download, and sending of images/files/audio.
- Documents/Wiki/Drive: Create/read/update cloud documents (docx), knowledge base nodes, cloud drive files.
- Base/Spreadsheet/Calendar/Tasks: Bitable, spreadsheets, calendar events, tasks.
- User OAuth: Device authorization code flow (RFC 8628), user-level token management.
- Emoji Reactions: Message replies receive a GET emoji (processing), replaced with DONE upon completion.
- Feishu Approval Cards: dsh approval requests (e.g., bash sandbox escalation) are sent to the conversation as cards with approve/reject buttons; clicking responds, and automatic rejection occurs on timeout.
- Slash Commands: Local commands such as /status, /model, /cd, /permission, /setting, /help.
Installation and Enablement¶
Prerequisites¶
The following conditions must be met before installation:
Node.js ≥ 22 (including pnpm)
dsh CLI installed
Feishu Open Platform application credentials: appId, appSecret
Subscribed event: im.message.receive_v1
Recommended Installation¶
First, set the Feishu application credentials:
export FEISHU_APP_ID=cli_xxx
export FEISHU_APP_SECRET=your_secret
Then install to the web profile:
dsh plugin --profile web add harness-lark
Next, start:
dsh --profile web
After the above steps, the plugin will load with the current dsh process and call Feishu APIs within the authorized scope.
Optional one-click script:
export FEISHU_APP_ID=cli_xxx
export FEISHU_APP_SECRET=your_secret
bash scripts/install-dsh.sh web harness-lark
Source Installation¶
First, clone the repository and build:
git clone https://github.com/huoxue1/harness-lark.git
cd harness-lark
pnpm install && pnpm run build
Then add the local directory to the web profile:
dsh plugin --profile web add file:/path/to/harness-lark
Typical Usage¶
Slash Commands¶
After startup, the following local commands can be used in Feishu conversations:
/status
/model
/cd
/new
/stop
/permission
/setting
/help
These commands are used to view status, switch models, change the working directory, create a new context, stop current replies, adjust permissions/settings, and view help.
Group Chat Mentions¶
In group chats, commands can be prefixed with @bot, for example:
@bot /status
The plugin automatically strips the mention prefix.
Multi-Agent Routing¶
Multi-agent configuration can be routed by chat in config.agents. Below is an example expressing only chat routing:
agents:
- id: agent-a
chats:
- oc_111
- p2p
- id: agent-b
chats:
- oc_222
- group
Where oc_ prefixed values indicate exact chat_id, and p2p and group indicate type labels.
Security and Applicable Scenarios¶
harness-lark is suitable for private chat assistant scenarios. The plugin calls Feishu APIs as a bot within the authorized scope, carrying inherent risks such as model hallucinations and prompt injection. It is recommended not to join group chats or allow others to interact, and to maintain the default secure configuration:
groupPolicy: disabled
requireMentionInGroups: true
User-data tools call Feishu APIs as the user after they execute /feishu auth to authorize; when unauthorized, they fall back to bot identity. Wiki/Drive/IM tools always call as the bot.
It is recommended to review the source code and license before installation. The license is MIT.
Links¶
GitHub repository:
https://github.com/huoxue1/harness-lark