dsh-wechat-push: Delivering HTML Content to the WeChat Official Account Draft Box

Preface

When running agents in DeepSeek Harness (DSH), the common output is Markdown or HTML content. To publish content to a WeChat Official Account (公众号), you typically need to manually log into the platform, paste and format the content, and upload images. Another approach is to use a channel plugin that “controls DSH through WeChat conversations,” which focuses on interaction rather than “writing existing HTML into the draft box in one go.”

Below is the community plugin dsh-wechat-push (maintainer tangzijie716): it targets the web profile and provides tools and a Web UI button to deliver HTML content and images directly to the Official Account’s draft box. The plugin does not handle mass sending—after a draft is created, a person still needs to click send in the platform backend.

What Is This

dsh-wechat-push is a network-related plugin for DSH (categorized under networking tools in SkillHub). In one sentence: it delivers HTML content and images directly to a WeChat Official Account draft box (the manifest notes that its delivery capability was split from the delivery half of dsh-wechat-mp).

  • Repository: tangzijie716/dsh-wechat-push
  • License: MIT
  • Version listed on the SkillHub directory page: v1.0.0, GitHub Stars: 0
  • It is independent from dsh-wechat-html (Markdown → WeChat-ready HTML): this plugin does not format content; it directly accepts HTML text or files, and can be used without installing a formatting plugin.

Core Functions

Tools (callable by Agents)

Tool Purpose
mp_upload_image Upload a local jpg/png (under 1MB), returning the mmbiz.qpic.cn URL that must be used in the body text
mp_create_draft Create a draft from HTML; provide either html_path or html for the body
mp_list_drafts Read-only listing of recent drafts (newest first), used to confirm successful creation

mp_create_draft supports title, cover, body image list, optional author/digest/original link, etc.; a cover is required. You can pass cover path and body image paths in a single call, for example:

{
  "html_path": "./content/article.html",
  "title": "示例文章",
  "cover": {
    "path": "./content/cover.png"
  },
  "images": [
    { "token": "dsh-mp-image-0", "path": "./content/image-01.png" }
  ]
}

Web UI: “Publish to Official Account” button

After each assistant reply, you can click Publish to Official Account; with one click, the reply is formatted (using a configured template) and placed into the draft box. The button starts from Markdown and requires the formatting plugin dsh-wechat-html: if installed, it renders via ctx.get('wechatHtml'); if not installed, it clearly indicates what is missing.

The button has no place to choose a cover; you must configure defaultCoverMediaId or defaultCover in cordis.patch.yml (see configuration below). External images in the message are preserved, but the result may warn that they will be filtered by WeChat.

Credential Model

The plugin does not read environment variables, $DSH_HOME, or a managed credential store. Each call must pass a credential file path credentials_path from the caller, containing:

Name Meaning
WECHAT_MP_APPID Official Account AppID
WECHAT_MP_SECRET Official Account AppSecret

It supports the NAME=value format of .env or the refs: section of .credentials.yaml. Passing a path rather than plaintext keys avoids exposing secrets in DSH tool arguments and session logs.

Installation and Activation

The official README gives the installation command as follows (must be run in the plugin repository root directory; the README’s premise is that the source code of that directory has already been obtained):

dsh plugin --profile web add file:.

Requires Node.js ≥ 18. At runtime, DeepSeek Harness provides the two host dependencies @deepseek-ai/dsh-tools and @deepseek-ai/dsh-typert-protocol.

Before installing, review the source code and MIT license of the GitHub repository yourself. The plugin runs under the permissions of the current dsh process and can access the network and local files; the directory site SkillHub and DeepSeek / High-Flyer have no official affiliation and serve only as a community index.

Typical Usage

1. Prepare a credential file

Obtain the AppID and AppSecret from Official Account Platform → Settings & Development → Basic Configuration (the Secret is shown only once). Write both into a credential file, for example D:\WeChat-Publishing\.env.

2. Agent calls tools to create a draft

Always include credentials_path when calling, for example:

mp_create_draft(credentials_path="D:\WeChat-Publishing\.env", ...)
mp_upload_image(credentials_path="D:\WeChat-Publishing\.env", path="...")
mp_list_drafts(credentials_path="D:\WeChat-Publishing\.env", count=3)

If you only have an HTML string and no file, use the html parameter; if html_path is used, the submitted body will be saved separately as <html_path>.submitted.html (a save failure does not cancel the already-created draft, but a warning is returned).

3. Optional: Web UI one-click delivery

After configuring a default cover for wechat-push in the profile’s cordis.patch.yml, you can use the Publish to Official Account button in the conversation UI (requires dsh-wechat-html to be installed for formatting).

Full optional configuration example (no credentials):

- id: wechat-push
  config:
    tokenCacheDir: ''
    baseUrl: https://api.weixin.qq.com
    defaultAuthor: ''
    defaultCover: './content/cover.png'
    defaultCoverMediaId: ''
    requireApproval: false

The patch layer replaces the entire config block for that id; any keys you want to keep must all be written out.

Write operations do not prompt for approval by default; if you need a fail-closed approval gate, set requireApproval: true (when enabled, the “Publish to Official Account” button also cannot bypass it; you must switch to the protected mp_create_draft).

Applicable Scenarios and Notes

Who it suits

  • Those who have already generated or hold WeChat-ready HTML in the DSH web profile and want an agent or button to write it into the draft box for later manual mass sending.
  • Those who need to combine it with dsh-wechat-html: Markdown output → formatting → delivery by this plugin.

Must be aware

  1. Permissions and security: Installing means executing third-party code locally under your user permissions; credentials should only be placed in files you control and passed via credentials_path.
  2. Official Account Platform IP whitelist: The source of API calls must be on the whitelist, otherwise errcode 40164; residential IP changes can cause previously working configurations to fail.
  3. access_token mutual exclusion: Only one valid token can exist per AppID at a time; other CMS/scripts will kick each other out (errcode 45009, etc.); this plugin caches on disk and merges concurrent refreshes, but cannot control external systems.
  4. Account capabilities: The README states that unverified personal subscription accounts can use the draft box and material APIs; they cannot mass send via API, consistent with this plugin’s “create drafts only.” Without permission, errcode 48001 is common.
  5. Image limits: Body images go through media/uploadimg, only jpg/png and < 1MB; covers go through the permanent thumb material API, handled by the plugin.

Conclusion

dsh-wechat-push connects HTML output from DSH with the WeChat Official Account draft box: on the tool side it suits agent pipelines, and the Web UI button suits quickly storing a single reply; mass sending remains a manual confirmation step on the Official Account platform.

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

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

Xiaoye