ChengqianHuang/dsh-lark

dsh-lark

Lark/Feishu bridge bundle for DeepSeek Harness: drive local dsh sessions from chat messages and reply in chat

未分類deepseek-harnessdshfeishu

description: "Run local dsh tasks from Lark or Feishu and receive each task's answer in chat." kind: "package-bundle"

dsh-lark

Your local coding agent, a chat message away.

English | 简体中文

Summary

Send your Lark or Feishu bot a task. DeepSeek Harness runs it in your local workspace and replies to the message that started it. Review a change, investigate a failing test, or ask about your code while keeping the session available in the dsh Web UI.

  • Switch sessions. Send /sessions in a private chat and click to continue a previous session.
  • Continue the conversation. Private chats and group topics keep their own sessions; follow-up messages retain context.
  • Exchange files and track tasks. Receive images/files, approve explicit file delivery, and follow one progress card with a stop button.
  • Stay in control. Restrict senders and chats, inspect /status, interrupt with /stop, and start fresh with /new.
  • Use your existing dsh setup. Sessions inherit the host's default agent preset and permission policy.
  • Keep setup local. The bridge uses lark-cli event subscriptions; it opens no public webhook endpoint.

Example prompts: “Explain this repository's entry points”, “Review the changes in my workspace”, or “Find why the parser test fails”. Available actions depend on your dsh tools and permissions.

Table of Contents


Use this package

You need a working dsh installation, Node.js ^22.19.0 || >=24.0.0, pnpm, and a configured Lark or Feishu bot with lark-cli on your PATH. The current compatibility target is dsh 0.1.2-alpha.5; see setup for credentials, scopes, and your sender ID.

1. Build and install the bundle

git clone https://github.com/ChengqianHuang/dsh-lark.git
cd dsh-lark
pnpm install --frozen-lockfile
pnpm build
dsh plugin --profile web add "$PWD"

The local checkout is linked into the web profile. Rebuild it after changing source. If you run dsh from source, use pnpm dsh from the harness repository for the dsh commands; pass the absolute plugin directory to add.

2. Allow your account

Merge this entry into ${DSH_HOME:-$HOME/.dsh}/profiles/web/cordis.patch.yml, replacing the example sender ID. Keep any existing entries in that file.

- id: lark
  config:
    allowedSenders: [ou_your_open_id]
    workspacePath: ~/projects/my-project
    groupPolicy: disabled
    locale: en

Session and interaction cards are enabled by default and require CLI card.action.trigger support. Configure callbacks using setup before starting; set sessionCards: false, interactionCards: false, and progressCards: false to disable all cards. Set receiveAttachments: false and fileDelivery: false for text-only use.

Start with direct messages. To enable groups, use groupPolicy: mentions and restrict allowedChats; see the configuration reference. An empty sender allowlist fails startup unless you explicitly enable allowAllSenders. The example uses English notices; set locale: zh-CN for Chinese.

3. Start and try it

dsh --profile web --dump-config
dsh web

The config dump should contain the dsh-lark layer and your settings; it does not check Lark connectivity. Send /help to your bot, then ask it to describe the workspace. Open the session in the Web UI to inspect tool activity. Handle permission requests and questions using the cards described in interactions.

To remove the bundle, run dsh plugin --profile web remove dsh-lark. Saved dsh session history remains subject to your host's retention policy.

Commands

MessageResult
Plain textRun one task in this chat's session; additional tasks wait in a bounded queue.
/sessionsShow private-chat session choices; see session switching.
/statusShow the current session, running state, and queue without waiting for a task.
/stopCancel the current bridge task and clear pending messages.
/newCancel bridge work, clear pending messages, and reset this chat's session.
/helpShow available commands immediately.

In groups, start a topic with the bot's exact @display name, then reply inside that owned topic to continue it. Unknown slash commands return help and never run as agent prompts. Bot notices support English and Simplified Chinese; the model chooses its answer language from the conversation.


Understand the implementation

Message flow and session ownership

lark-cli delivers message events → sender/chat checks admit them → a chat queue submits a dsh turn → the bridge selects that turn's recorded answer → lark-cli replies to its originating message.

The bundle's patch installs the lark row. The service owns the event consumer and router; the host owns agents, tools, credentials, permissions, and durable session history. See design for concurrency, disposal, and delivery guarantees.

Further Exploration

Model Experience

Accepted input becomes a logged user message with its Lark chat, sender, message ID, and group topic root. Images use durable DSH attachment references; ordinary files become workspace locators. The bridge handles slash commands and registers the approved lark_send_file tool in its agents. A progress card projects logged assistant text without reasoning; the settled turn also receives a bounded text reply.

Known Limitations and Deferred Work

Text messages, plain-text replies, and private-chat session selection cards are supported. Send /sessions, then click Switch to this session; subsequent messages continue that session in the same bot chat. See setup for callback requirements. Approvals and structured user questions are supported in private chats and groups; see interactions. Images, ordinary files, explicit file delivery, and incremental text in task cards are supported; see task workflows. Ordinary file parsing depends on workspace tools, and image understanding depends on the selected model. Long answers are truncated; inspect the dsh session for the full response.

Chat sessions share the configured filesystem workspace and host permissions. Group members can see replies; authorized senders in the same topic share its context. Topic sessions still share the filesystem. Private-chat choices and the current selection survive restarts when session cards are enabled. Group bindings, queued messages, card tokens, and deduplication memory remain transient. This is a trusted-user integration, with no exactly-once delivery guarantee; review the security model before adding other users.

Dev Note

Working context for maintainers

None.