npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@apollo-music/dsh-wecom-kf-bridge

v0.1.0

Published

Enterprise WeCom Customer Service bridge for DeepSeek Harness

Downloads

141

Readme

dsh-wecom-kf-bridge

企业微信「微信客服」到 DeepSeek Harness 的独立 Cordis Bridge。它与仓库中的企业微信智能机器人 (AIBot 长连接)使用不同协议、配置和运行状态,不共享传输实现。

当前纵向切片(0.1.0)

  • 企业微信回调 URL 验证、SHA-1 验签和 AES-256-CBC 解密
  • 回调快速 ACK,随后按 open_kfid 串行调用 sync_msg
  • 为每个客服账号原子持久化 next_cursor
  • origin=3 的客户文本、图片、语音、视频和文件送入 DSH
  • 在素材 3 天有效期内下载并持久化到 workspace;大文件按不超过 20MB 的 Range 分块获取
  • 图片在当前模型声明支持视觉时作为原生图片输入,否则保留受控文件路径
  • read_kf_file 工具只允许读取触发当前工具调用的那条客服消息所携带的 UTF-8 文本附件
  • 每个 open_kfid + external_userid 使用稳定的 DSH Session
  • 仅在 DSH turn/end 后发送最终文本;按 UTF-8 2048 字节拆分,并在超过 5 条前整体拒绝
  • Access Token 缓存和失效后单次刷新重试
  • 消费 msg_send_fail 事件并记录失败消息、失败类型和脱敏客户标识

语音当前保存为 AMR/Silk 原文件,不做内置语音转写;视频和二进制文档会保存并向 Agent 提供路径, 但 read_kf_file 与 DSH 官方 read 工具一样只读取 UTF-8 文本。位置、链接、名片、小程序等结构化消息 尚未接入。msg_send_fail 会记录日志,但尚未提供持久化发送重试队列。

安装

npm install @apollo-music/[email protected]

Cordis 配置

- id: apollo-wecom-kf-bridge
  name: '@apollo-music/dsh-wecom-kf-bridge'
  disabled: !!js process.env.APOLLO_WECOM_KF_ENABLED !== '1'
  config:
    callbackPath: /wecom/kf/callback
    workspace: !!js process.env.APOLLO_HARNESS_WORKSPACE
    agentPreset: my-agent-wecom-kf
    mediaDirectory: .dsh-wecom/kf-inbox
    maxMediaBytes: 20971520
    mediaDownloadTimeoutMs: 20000
    maxReadFileBytes: 5242880
    maxReadResultBytes: 51200
    maxReadLines: 500

默认环境变量:

  • WECOM_CORP_ID
  • WECOM_KF_SECRET
  • WECOM_KF_CALLBACK_TOKEN
  • WECOM_KF_CALLBACK_AES_KEY
  • APOLLO_WECOM_KF_CURSOR_FILE(可选,默认位于 workspace 的 .dsh-wecom/
  • WECOM_KF_SESSION_EPOCH(可选,用于显式切换稳定 Session)

对外回调 URL 需要由反向代理提供 HTTPS,并转发到 DSH WebServer 的 callbackPath