dsh-im-lark: Integrating Feishu / Lark with DeepSeek Harness

Introduction

The plugin-based architecture of DeepSeek Harness (DSH) allows IM channels to be extended on demand. Existing solutions either rely on third-party proxies or require building a custom service. xbzbing/dsh-im-lark is a native plugin that integrates Feishu / Lark bots directly into the DSH Web interface, treating Feishu private chats as a conversation entry point. It provides two independent paths: a default standalone session mode and a core-connected mode that integrates with the DSH core.

Plugin Positioning & Maintenance

dsh-im-lark is a connectivity-type plugin for DeepSeek Harness, maintained by xbzbing. Its core value is turning Feishu / Lark into an IM endpoint for DSH, with support for long-task reminders, failure alerts, and question push notifications.

Two Usage Modes

The plugin offers two mutually exclusive usage paths:

  • Standalone Session (default): Connect Feishu and leave “Connect to My Super Assistant” off. The plugin creates its own session and handles conversations directly within Feishu. Text commands, questions, and approval reminders are managed by the plugin itself.
  • Core-Connected Mode: Connect Feishu and enable “Connect to My Super Assistant.” Feishu acts as one entry point into the Web interface, with messages, commands, and reminders all delegated to the core.

Core-Connected Mode is only active when “Connect to My Super Assistant” is enabled and the core service is running; otherwise, all traffic falls through to Standalone Session. A given message is never processed by both paths.

Core Capabilities

Inbound & Outbound

  • Inbound: Text, rich text, images, and files; voice, video, stickers, and similar types receive a clear notice rather than being silently dropped.
  • Outbound: Markdown cards and images; long responses are segmented by both character count and card size limits.

Quoted Replies & Status Feedback

  • Responses quote the message that triggered them, in both direct and group chats.
  • Upon receiving a message, a Get (received) emoji reaction is added first; after the response is actually delivered, a DONE reaction is appended to the original message. Both markers coexist — enqueueing does not count as completion (the task runs asynchronously after the core enqueues the message).
  • In Core-Connected Mode, the DONE marker follows the core’s completes signal; in Standalone Mode, it aligns with turn completion, and reminder responses are stamped on the spot after settlement.
  • On failure, only Get is retained — no false “completed” signal is left behind; each message is stamped at most once.

Card Updates & Interactions

  • Streaming responses update the same card in place; once platform limits are hit (14-day window, 5 QPS per card), a new card is sent instead.
  • Single-choice and multi-choice questions in Core-Connected Mode can be checked and submitted directly in Feishu, with results routed back to the core.
  • Multiple questions are bundled into a single card: all questions appear in one form with a single “Submit” button (the core requires all questions to be submitted in one batch). Controls are labeled by question number; open-ended questions use a free-text input.
  • Incomplete answers or multiple selections on a single-choice question will identify the specific question and redraw the card; approvals are not auto-answered — the user is directed to the Web interface.
  • If questions exceed card component or size limits, a plain-text card is sent instead, listing all questions, options, and the expected reply format so the user can respond in plain text.
  • Both modes support an “Other” free-text input option.

Group Chats & Task Reminders

  • In group chats, only messages that @mention the bot are processed (group permissions are limited to the @-mention scope); the full group history is never read.
  • In Standalone Mode, if a turn runs long (default: over 30 minutes), a completion reminder with elapsed time and a summary is sent when it finishes; if the turn fails or is externally aborted, an immediate alert is sent with the original error. A stop initiated by the owner themselves does not count as a failure.

Installation & Activation

Install the stable release:

dsh plugin --profile web add dsh-im-lark

Install the pre-release:

dsh plugin --profile web add dsh-im-lark@stage

Install from source (for development):

npm install
npm run build
dsh plugin --profile web add file:/absolute/path/to/dsh-im-lark

A file: dependency injects a copy into the profile’s node_modules, decoupling it from the repository: after modifying code, run npm run build and then uninstall and reinstall to sync changes to the running Host.

No need to restart dsh web after reinstalling: the Host is partially managed by hot-reload; simply refresh the browser page. Open Settings → Feishu Bot (or Plugins → dsh-im-lark) and fill in the credentials.

In the panel’s “Application Credentials” section, click “Scan to Create App,” scan the QR code with Feishu, and confirm on your phone. Once the app is created, credentials are saved automatically and the connection begins. The QR code is valid for 1 hour and is limited to a single user.

Feishu-Side Setup

Create an enterprise self-built application on the Feishu Open Platform and obtain the App ID and App Secret. Add the Bot capability. Under Permission Management, enable:

  • im:message.p2p_msg:readonly (receive direct-message text)
  • im:message.group_at_msg:readonly (receive @-mention messages in group chats)
  • im:message:send_as_bot (send messages as the bot)
  • im:resource (upload/download images and files)
  • Reaction (optional): the reaction-related permissions in the console. If absent, the main flow is unaffected; the “processing” indicator simply degrades to no indicator.

Under “Event Subscriptions,” select long-lived connection and subscribe to im.message.receive_v1; under “Callback Configuration,” add card.action.trigger (needed for card interactions), also over long-lived connection. Publish a version and wait for the admin to approve; before publishing, only the developer can use it.

Configuration Example

Static configuration is written in the profile’s patch and takes effect after a restart:

- id: dsh-im-lark
  name: dsh-im-lark
  config:
    domain: feishu          # feishu (default) or lark (international)
    maxText: 2000           # Max characters per message; auto-segmented if exceeded
    typingIndicator: true   # Get on receipt; DONE appended to original message after delivery (Get is not removed)
    replyStatus: false      # Append model, duration, and token count at the end of the reply
    directBusyMode: steer   # Standalone mode: behavior when sending during an active turn — steer (interject) / queue (wait). Legacy value `interrupt` migrates to `steer`; `/queue` always queues
    directWorkspaceId: ''   # Workspace ID for standalone sessions; leave empty to use the auto-created default
    questionReminders: true # Send a Feishu reminder when a question/authorization is pending in Standalone Mode
    questionDelayMinutes: 5 # How long to wait before reminding (0–120 min): answer on Web within this window to avoid the ping
    longTaskReminders: true # Standalone mode: send a completion reminder when a turn exceeds the threshold
    longTaskMinutes: 30     # Long-task threshold (1–1440 minutes)
    failureReminders: true  # Standalone mode: immediate alert on turn failure or external abort

Items editable in the panel are persisted to $DSH_HOME/.dsh-im-lark/config.json and survive uninstall/reinstall. Credentials are stored separately in credentials.json, with directory permissions 0700 and file permissions 0600. Only the last few digits of the App ID appear in logs and error messages; the panel displays the full App ID and binding time, but the Secret is never echoed back.

Standalone Session Commands

Command Description
/help List all commands
/new Start a new session
/sessions [page] List recent sessions with sequence numbers (excluding the foreground session), 10 per page
/switch <seq, 0, front, or session-id> Switch the current session; 0 and front return to the foreground session
/status Current session and runtime status
/stop Abort the running turn
/trace View the model and duration of the last response
/send <seq, 0, or session-id> <content> Send to the specified session; that turn’s response returns here. 0 is the foreground session. Images can be attached. If the turn is already running, behavior follows the “interject during turn” setting
/queue <seq, 0, or session-id> <content> Same as /send, but always queues after the target’s current turn

/send behaves like a normal message: when the target session has an active turn, the panel’s “interject during turn” setting determines whether to interject into the current turn or queue. /queue accepts the same parameters but always queues behind the current turn, regardless of that setting.

CLI & Slash Commands

  • /lark (Web input field): /lark <body> sends a text message to your own Feishu; /lark status checks whether credentials and the recipient are ready. Bypasses the model entirely.
  • dsh-lark-send (terminal / script): dsh-lark-send text <body>, status, help. The recipient is always the owner; there is no --to flag. Exit codes: 0 success, 1 send failure, 2 invalid arguments.

The recipient is always the “owner”: in Standalone Mode, it is the first person to DM the bot on Feishu; in Core-Connected Mode, it is the user bound by the core. If no owner is set yet, a clear error is returned.

Limitations & Notes

Event handlers must return within 3 seconds; all heavy work is done asynchronously. Text message body ≤ 150 KB, card ≤ 30 KB — exceeding these causes the platform to reject the message. Message send rate is 5 QPS (per user / per group); the plugin includes built-in rate limiting and backoff. A card can be PATCH-updated for up to 14 days at 5 QPS per card; after expiry, new messages are sent instead. Images ≤ 10 MB, files ≤ 30 MB, with a local pre-check before upload. Message editing has a retry limit, and the recall window is admin-configured (commonly 24 hours). There is no official “typing” API, so emoji reactions serve only as a weak indicator.

The plugin runs with the current DSH process’s permissions. Review the source code and license before installing.

Use Cases

  • Developers who need to interact with DSH directly from Feishu / Lark.
  • Scenarios where Feishu serves as the IM endpoint while retaining full Web-side core capabilities.
  • Long-running conversations requiring task completion reminders, failure alerts, and question push notifications.

Summary

dsh-im-lark provides a native IM bridge from Feishu / Lark to DeepSeek Harness, supporting both Standalone Session and Core-Connected modes, covering common scenarios such as inbound/outbound messaging, quoted replies, card interactions, and task reminders. Installation and configuration are centralized in the panel and profile patch — no custom service required.

Plugin page: https://www.skillhub.cn/plugins/xbzbing/dsh-im-lark
GitHub: https://github.com/xbzbing/dsh-im-lark

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye