{"_id":"@apollo-music/dsh-wecom-kf-bridge","name":"@apollo-music/dsh-wecom-kf-bridge","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@apollo-music/dsh-wecom-kf-bridge","version":"0.1.0","description":"Enterprise WeCom Customer Service bridge for DeepSeek Harness","repository":{"type":"git","url":"git+https://github.com/fde0-inc/dsh-wecom-bridge.git","directory":"packages/kf-bridge"},"type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./callback-crypto":{"types":"./dist/callback-crypto.d.ts","import":"./dist/callback-crypto.js"},"./callback-handler":{"types":"./dist/callback-handler.d.ts","import":"./dist/callback-handler.js"},"./protocol":{"types":"./dist/protocol.d.ts","import":"./dist/protocol.js"},"./api-client":{"types":"./dist/api-client.d.ts","import":"./dist/api-client.js"},"./cursor-store":{"types":"./dist/cursor-store.d.ts","import":"./dist/cursor-store.js"},"./dsh-adapter":{"types":"./dist/dsh-adapter.d.ts","import":"./dist/dsh-adapter.js"},"./inbound-media":{"types":"./dist/inbound-media.d.ts","import":"./dist/inbound-media.js"},"./read-kf-file-tool":{"types":"./dist/read-kf-file-tool.d.ts","import":"./dist/read-kf-file-tool.js"},"./sync-worker":{"types":"./dist/sync-worker.d.ts","import":"./dist/sync-worker.js"}},"engines":{"node":">=24"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"license":"UNLICENSED","keywords":["deepseek-harness","cordis","wecom","customer-service","kf"],"scripts":{"clean":"node ./scripts/clean.mjs","build":"npm run clean && tsc -p tsconfig.types.json && rolldown -c && node ./scripts/verify-bundle.mjs","prepack":"npm run build","test":"npm run build && node --test test/*.node-test.ts test/*.node-test.mjs","typecheck":"tsc --noEmit"},"peerDependencies":{"@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-host-apiproxy":"0.1.1-rc.2","@deepseek-ai/dsh-host-webserver":"0.1.1-rc.2","@deepseek-ai/dsh-llm":"0.1.1-rc.2","@deepseek-ai/dsh-session":"0.1.1-rc.2","@deepseek-ai/dsh-tools":"0.1.1-rc.2"},"devDependencies":{"@deepseek-ai/cordis":"4.0.1","@deepseek-ai/dsh-host-apiproxy":"0.1.1-rc.2","@deepseek-ai/dsh-host-webserver":"0.1.1-rc.2","@deepseek-ai/dsh-llm":"0.1.1-rc.2","@deepseek-ai/dsh-session":"0.1.1-rc.2","@deepseek-ai/dsh-tools":"0.1.1-rc.2","@types/node":"24.13.3","rolldown":"1.2.4","typescript":"7.0.2"},"_id":"@apollo-music/dsh-wecom-kf-bridge@0.1.0","bugs":{"url":"https://github.com/fde0-inc/dsh-wecom-bridge/issues"},"homepage":"https://github.com/fde0-inc/dsh-wecom-bridge#readme","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-3tkiGms8ArUGl4+OjI6cXck7QiA4/6EJ/S6GtJxwhxhpgGLBmmS1Pf+t3Zl1PTBly5fbnQIK6ssgeQEkwDyCcA==","shasum":"89bd11a9a4bf0deffebc6a60adcb7545b71b3f22","tarball":"https://registry.npmjs.org/@apollo-music/dsh-wecom-kf-bridge/-/dsh-wecom-kf-bridge-0.1.0.tgz","fileCount":26,"unpackedSize":57289,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHijJvYMAO4PRjSWVrZ7x0WF/CXOL25N8STcto7pywwbAiBWx3IkqBbQHRnIv7oof+NbAYr2WMbpQDOe2goUAiKubQ=="}]},"_npmUser":{"name":"djagger","email":"634750802@qq.com"},"directories":{},"maintainers":[{"name":"djagger","email":"634750802@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/dsh-wecom-kf-bridge_0.1.0_1787810078456_0.4427151985855817"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-27T05:54:38.238Z","0.1.0":"2026-08-27T05:54:38.585Z","modified":"2026-08-27T05:54:38.809Z"},"maintainers":[{"name":"djagger","email":"634750802@qq.com"}],"description":"Enterprise WeCom Customer Service bridge for DeepSeek Harness","homepage":"https://github.com/fde0-inc/dsh-wecom-bridge#readme","keywords":["deepseek-harness","cordis","wecom","customer-service","kf"],"repository":{"type":"git","url":"git+https://github.com/fde0-inc/dsh-wecom-bridge.git","directory":"packages/kf-bridge"},"bugs":{"url":"https://github.com/fde0-inc/dsh-wecom-bridge/issues"},"license":"UNLICENSED","readme":"# dsh-wecom-kf-bridge\n\n企业微信「微信客服」到 DeepSeek Harness 的独立 Cordis Bridge。它与仓库中的企业微信智能机器人\n（AIBot 长连接）使用不同协议、配置和运行状态，不共享传输实现。\n\n## 当前纵向切片（0.1.0）\n\n- 企业微信回调 URL 验证、SHA-1 验签和 AES-256-CBC 解密\n- 回调快速 ACK，随后按 `open_kfid` 串行调用 `sync_msg`\n- 为每个客服账号原子持久化 `next_cursor`\n- 将 `origin=3` 的客户文本、图片、语音、视频和文件送入 DSH\n- 在素材 3 天有效期内下载并持久化到 workspace；大文件按不超过 20MB 的 Range 分块获取\n- 图片在当前模型声明支持视觉时作为原生图片输入，否则保留受控文件路径\n- `read_kf_file` 工具只允许读取触发当前工具调用的那条客服消息所携带的 UTF-8 文本附件\n- 每个 `open_kfid + external_userid` 使用稳定的 DSH Session\n- 仅在 DSH `turn/end` 后发送最终文本；按 UTF-8 2048 字节拆分，并在超过 5 条前整体拒绝\n- Access Token 缓存和失效后单次刷新重试\n- 消费 `msg_send_fail` 事件并记录失败消息、失败类型和脱敏客户标识\n\n语音当前保存为 AMR/Silk 原文件，不做内置语音转写；视频和二进制文档会保存并向 Agent 提供路径，\n但 `read_kf_file` 与 DSH 官方 `read` 工具一样只读取 UTF-8 文本。位置、链接、名片、小程序等结构化消息\n尚未接入。`msg_send_fail` 会记录日志，但尚未提供持久化发送重试队列。\n\n## 安装\n\n```sh\nnpm install @apollo-music/dsh-wecom-kf-bridge@0.1.0\n```\n\n## Cordis 配置\n\n```yaml\n- id: apollo-wecom-kf-bridge\n  name: '@apollo-music/dsh-wecom-kf-bridge'\n  disabled: !!js process.env.APOLLO_WECOM_KF_ENABLED !== '1'\n  config:\n    callbackPath: /wecom/kf/callback\n    workspace: !!js process.env.APOLLO_HARNESS_WORKSPACE\n    agentPreset: my-agent-wecom-kf\n    mediaDirectory: .dsh-wecom/kf-inbox\n    maxMediaBytes: 20971520\n    mediaDownloadTimeoutMs: 20000\n    maxReadFileBytes: 5242880\n    maxReadResultBytes: 51200\n    maxReadLines: 500\n```\n\n默认环境变量：\n\n- `WECOM_CORP_ID`\n- `WECOM_KF_SECRET`\n- `WECOM_KF_CALLBACK_TOKEN`\n- `WECOM_KF_CALLBACK_AES_KEY`\n- `APOLLO_WECOM_KF_CURSOR_FILE`（可选，默认位于 workspace 的 `.dsh-wecom/`）\n- `WECOM_KF_SESSION_EPOCH`（可选，用于显式切换稳定 Session）\n\n对外回调 URL 需要由反向代理提供 HTTPS，并转发到 DSH WebServer 的 `callbackPath`。\n","readmeFilename":"README.md","_rev":"1-f523ae3b9f92729cb99cef21ff0efd93"}