{"_id":"sillymd-wechat","_rev":"40-9eb4c6e3cfd38b9db34d69d4fc7ddeab","name":"sillymd-wechat","dist-tags":{"latest":"3.0.2"},"versions":{"1.0.0":{"name":"sillymd-wechat","version":"1.0.0","keywords":["wechat","wecom","openclaw","sillymd","bridge","plugin"],"author":{"name":"SillyMD"},"license":"MIT","_id":"sillymd-wechat@1.0.0","maintainers":[{"name":"sillymd","email":"hughwang@jcoding.tech"}],"homepage":"https://github.com/sillymd/sillymd-openclaw-wechat-plugin#readme","bugs":{"url":"https://github.com/sillymd/sillymd-openclaw-wechat-plugin/issues"},"bin":{"sillymdwechat":"bin/cli.js","sillymd-wechat":"bin/cli.js"},"dist":{"shasum":"8d87e9a45ce7d3e3fa811ad81b035bbbe2a186ad","tarball":"https://registry.npmjs.org/sillymd-wechat/-/sillymd-wechat-1.0.0.tgz","fileCount":18,"integrity":"sha512-O6gowuNQmZ7ayYnQcLiuc5adEPiqxWOoXM2Fo1DVHN6d61Aaiz5GlBhDkCVVUx2LFtwNAe5L5gknIQehj0eidw==","signatures":[{"sig":"MEUCIQCEQveDiv/B/aRUaNLe86EN9HS2FfcQSVRxuzDiScvxpgIgaXAOLw2/F8EvHOzja86CcWhf8m54DjwHn5lmZp8mkdw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":169963},"main":"index.js","engines":{"node":">=14.0.0"},"gitHead":"d9acfada166d86661b7232dd086e88593eeb25e5","scripts":{"start":"node bin/cli.js","install":"node install.js"},"_npmUser":{"name":"sillymd","email":"hughwang@jcoding.tech"},"repository":{"url":"git+https://github.com/sillymd/sillymd-openclaw-wechat-plugin.git","type":"git"},"_npmVersion":"11.7.0","description":"SillyMD OpenClaw-WeChat Plugin - 企业微信与OpenClaw双向消息桥接","directories":{},"_nodeVersion":"22.20.0","preferGlobal":true,"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sillymd-wechat_1.0.0_1772389175051_0.8458594995655979","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"sillymd-wechat","version":"1.0.1","keywords":["wechat","wecom","openclaw","sillymd","bridge","plugin"],"author":{"name":"SillyMD"},"license":"MIT","_id":"sillymd-wechat@1.0.1","maintainers":[{"name":"sillymd","email":"hughwang@jcoding.tech"}],"homepage":"https://github.com/sillymd/sillymd-openclaw-wechat-plugin#readme","bugs":{"url":"https://github.com/sillymd/sillymd-openclaw-wechat-plugin/issues"},"bin":{"sillymdwechat":"bin/cli.js","sillymd-wechat":"bin/cli.js"},"dist":{"shasum":"1840e6643053b6be10278314727efa4754375682","tarball":"https://registry.npmjs.org/sillymd-wechat/-/sillymd-wechat-1.0.1.tgz","fileCount":18,"integrity":"sha512-UgnlEQ2WvEk7Gz6LsuEVzbiRUt69VZLpMf7j+qz4bDOPcF1ek0XTapqtaujmVrKKUC/xtroTFptpXh+ba9dJ1Q==","signatures":[{"sig":"MEUCIQDt1GQKoC68VzEmI4AnbxdSaOqHvL3ovPdB7+Du858cqwIgUNIWWgbEqN1H9aou4b/TLsdR7pq8/qmQjN2P99mQXWM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":169981},"main":"index.js","engines":{"node":">=14.0.0"},"gitHead":"63ce1d9a609cbd20a3f60f817d3b49936cc1a2dd","scripts":{"start":"node bin/cli.js","install":"node install.js"},"_npmUser":{"name":"sillymd","email":"hughwang@jcoding.tech"},"repository":{"url":"git+https://github.com/sillymd/sillymd-openclaw-wechat-plugin.git","type":"git"},"_npmVersion":"11.7.0","description":"SillyMD OpenClaw-WeChat Plugin - 企业微信与OpenClaw双向消息桥接","directories":{},"_nodeVersion":"22.20.0","preferGlobal":true,"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sillymd-wechat_1.0.1_1772389307147_0.8380805279128241","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"sillymd-wechat","version":"1.0.2","keywords":["wechat","wecom","openclaw","sillymd","bridge","plugin"],"author":{"name":"SillyMD"},"license":"MIT","_id":"sillymd-wechat@1.0.2","maintainers":[{"name":"sillymd","email":"hughwang@jcoding.tech"}],"homepage":"https://github.com/sillymd/sillymd-openclaw-wechat-plugin#readme","bugs":{"url":"https://github.com/sillymd/sillymd-openclaw-wechat-plugin/issues"},"bin":{"sillymdwechat":"bin/cli.js","sillymd-wechat":"bin/cli.js"},"dist":{"shasum":"c0cb0ecfaac06eed8015f6112419c9744a3cad68","tarball":"https://registry.npmjs.org/sillymd-wechat/-/sillymd-wechat-1.0.2.tgz","fileCount":19,"integrity":"sha512-h2vi/gxi4LUWdezcpFpdTlE+u5wprrvDzd2PioBA+CQjjf41m4PQKhyVsSiLYj05W7alDluDJPUJqiEZZ/qjEA==","signatures":[{"sig":"MEUCIFAzKwbAL6wPrWJkhnz7qYulMQYWayiFwx/9DuELjvQBAiEA3F0HgI0nrsqrKvHvDUoRB/iu+qTRKaWQefb6FYEILr0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":170584},"main":"index.js","engines":{"node":">=14.0.0"},"gitHead":"a87176879d6b6b02d12547c9bfc018303ea44cef","scripts":{"start":"node bin/cli.js","install":"node install.js"},"_npmUser":{"name":"sillymd","email":"hughwang@jcoding.tech"},"repository":{"url":"git+https://github.com/sillymd/sillymd-openclaw-wechat-plugin.git","type":"git"},"_npmVersion":"11.7.0","description":"SillyMD OpenClaw-WeChat Plugin - 企业微信与OpenClaw双向消息桥接","directories":{},"_nodeVersion":"22.20.0","preferGlobal":true,"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/sillymd-wechat_1.0.2_1772389382821_0.13790259147644557","host":"s3://npm-registry-packages-npm-production"}},"3.0.2":{"name":"sillymd-wechat","version":"3.0.2","description":"SillyMD OpenClaw-WeChat Plugin - 企业微信与OpenClaw双向消息桥接","main":"index.js","bin":{"sillymdwechat":"bin/cli.js","sillymd-wechat":"bin/cli.js"},"scripts":{"start":"node bin/cli.js","install":"node install.js"},"keywords":["wechat","wecom","openclaw","sillymd","bridge","plugin"],"author":{"name":"SillyMD"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/sillymd/sillymd-openclaw-wechat-plugin.git"},"engines":{"node":">=14.0.0"},"preferGlobal":true,"gitHead":"138c51c44997448d43d9c3a3fcd6f06858739ec2","_id":"sillymd-wechat@3.0.2","bugs":{"url":"https://github.com/sillymd/sillymd-openclaw-wechat-plugin/issues"},"homepage":"https://github.com/sillymd/sillymd-openclaw-wechat-plugin#readme","_nodeVersion":"22.20.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-2YQXL94CCsBHOokqpIYAqYKWl5hDu78QwlvYGqHFAi1RX5RCAdcB0ovVJtriJY7tSIGRn6qjzT3qfaSN80X+6A==","shasum":"e1778f4c941405b311d70324cf2383d522834e9e","tarball":"https://registry.npmjs.org/sillymd-wechat/-/sillymd-wechat-3.0.2.tgz","fileCount":40,"unpackedSize":2197652,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCICk/PtD1yPJhjtvO4z3V87Z5PnM3vs//fbbV7eKvBgRWAiBdhfkE7QvEF05Xqvmqhhyf9ywBrJPcF6mxzqTDHFHL7g=="}]},"_npmUser":{"name":"sillymd","email":"hughwang@jcoding.tech"},"directories":{},"maintainers":[{"name":"sillymd","email":"hughwang@jcoding.tech"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sillymd-wechat_3.0.2_1772722371322_0.5776151390262461"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-01T18:19:35.051Z","modified":"2026-03-05T14:52:51.717Z","1.0.0":"2026-03-01T18:19:35.197Z","1.0.1":"2026-03-01T18:21:47.282Z","1.0.2":"2026-03-01T18:23:02.992Z","1.0.3":"2026-03-05T09:51:17.259Z","1.0.4":"2026-03-05T10:27:30.772Z","1.0.5":"2026-03-05T10:30:53.997Z","1.0.6":"2026-03-05T10:34:33.088Z","1.0.7":"2026-03-05T10:44:55.116Z","1.0.8":"2026-03-05T10:49:31.991Z","1.0.9":"2026-03-05T10:55:09.907Z","1.0.10":"2026-03-05T11:03:05.582Z","1.0.11":"2026-03-05T11:13:46.507Z","1.0.12":"2026-03-05T11:22:02.847Z","1.1.0":"2026-03-05T11:29:04.251Z","2.0.0":"2026-03-05T11:32:02.794Z","1.0.13":"2026-03-05T11:56:20.923Z","1.0.14":"2026-03-05T12:10:02.765Z","2.1.0":"2026-03-05T12:11:31.155Z","2.1.1":"2026-03-05T12:13:04.620Z","3.0.0":"2026-03-05T12:24:53.541Z","3.0.1":"2026-03-05T14:35:50.413Z","3.0.2":"2026-03-05T14:52:51.598Z"},"bugs":{"url":"https://github.com/sillymd/sillymd-openclaw-wechat-plugin/issues"},"author":{"name":"SillyMD"},"license":"MIT","homepage":"https://github.com/sillymd/sillymd-openclaw-wechat-plugin#readme","keywords":["wechat","wecom","openclaw","sillymd","bridge","plugin"],"repository":{"type":"git","url":"git+https://github.com/sillymd/sillymd-openclaw-wechat-plugin.git"},"description":"SillyMD OpenClaw-WeChat Plugin - 企业微信与OpenClaw双向消息桥接","maintainers":[{"name":"sillymd","email":"hughwang@jcoding.tech"}],"readme":"# SillyMD OpenClaw-WeChat Plugin\r\n\r\n企业微信与 OpenClaw 的双向消息桥接插件，支持本地语音识别和多媒体消息。\r\n\r\n[![Release](https://img.shields.io/github/v/release/sillymd/sillymd-openclaw-wechat-plugin)](https://github.com/sillymd/sillymd-openclaw-wechat-plugin/releases)\r\n[![Python](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/)\r\n[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\r\n\r\n**仓库镜像:** [GitHub](https://github.com/sillymd/sillymd-openclaw-wechat-plugin) | [Gitee](https://gitee.com/sillymd/sillymd-openclaw-wechat-plugin)\r\n\r\n## 功能特性\r\n\r\n- **双向消息同步**: 企业微信 ↔ OpenClaw 实时消息互通\r\n- **本地语音识别**: 集成 Sherpa-ONNX 和 Whisper，无需联网即可识别语音\r\n- **多媒体支持**: 文本、图片、视频、语音、文件消息\r\n- **简化配置**: 仅需 api_key 和 owner_id，其他配置自动获取\r\n- **智能抄送**: 非 owner 用户提问时自动抄送 owner\r\n- **文件直传**: 支持通过 SillyMD 发送媒体文件\r\n- **离线安装支持**: 包含所有依赖 wheels，无需外网即可安装\r\n\r\n## 系统要求\r\n\r\n- Python 3.8+\r\n- Windows/Linux/macOS\r\n- 内存: 至少 4GB (推荐 8GB)\r\n- 磁盘: 至少 1GB 可用空间\r\n\r\n## 快速开始\r\n\r\n### 方式一：npm 安装（推荐）\r\n\r\n```bash\r\n# 全局安装（会自动下载 models 和 wheels）\r\nnpm install -g sillymd-wechat\r\n\r\n# 配置（交互式）\r\nsillymd-wechat check\r\n\r\n# 启动插件\r\nsillymd-wechat start\r\n```\r\n\r\n### 方式二：手动安装\r\n\r\n```bash\r\n# 克隆仓库 (GitHub)\r\ngit clone https://github.com/sillymd/sillymd-openclaw-wechat-plugin.git\r\ncd sillymd-openclaw-wechat-plugin\r\n\r\n# 或者从 Gitee 克隆（国内推荐）\r\ngit clone https://gitee.com/sillymd/sillymd-openclaw-wechat-plugin.git\r\ncd sillymd-openclaw-wechat-plugin\r\n\r\n# 安装依赖（自动下载 models 和 wheels）\r\npython install.py --skip\r\n\r\n# 配置\r\nsillymd-wechat check\r\n\r\n# 启动插件\r\npython wecom_to_openclaw_bridge.py\r\n```\r\n\r\n### 配置插件\r\n\r\n编辑 `config.json`，或使用交互式配置：\r\n\r\n```bash\r\n# 交互式配置（可单独运行）\r\nsillymd-wechat check\r\n\r\n# 或手动编辑 config.json\r\n```\r\n\r\n```json\r\n{\r\n  \"api_key\": \"YOUR_SILLYMD_API_KEY\",\r\n  \"wechat\": {\r\n    \"owner_id\": \"YOUR_WECHAT_OWNER_ID\"\r\n  }\r\n}\r\n```\r\n\r\n**必要配置:**\r\n- `api_key`: 从 SillyMD 获取的 API Key - https://websocket.sillymd.com\r\n- `wechat.owner_id`: 企微 owner 的 ID（接收抄送消息）\r\n\r\n**自动获取的配置（无需手动设置）:**\r\n- JWT Token - 通过 api_key 自动登录获取\r\n- Tenant ID / Device ID - WebSocket 连接后自动获取\r\n- 企微配置（token, corp_id, encoding_aes_key 等）- 从后端自动获取\r\n\r\n### 启动插件\r\n\r\n```bash\r\n# 使用 npm 命令\r\nsillymd-wechat start\r\n\r\n# 或直接运行 Python\r\npython wecom_to_openclaw_bridge.py\r\n```\r\n\r\n## 下载安装\r\n\r\n```bash\r\n# 克隆仓库\r\ngit clone https://github.com/sillymd/sillymd-openclaw-wechat-plugin.git\r\n# 或从 Gitee 克隆（国内推荐）\r\ngit clone https://gitee.com/sillymd/sillymd-openclaw-wechat-plugin.git\r\n\r\ncd sillymd-openclaw-wechat-plugin\r\n\r\n# 安装（会自动下载 models 和 wheels）\r\npython install.py --skip\r\n```\r\n\r\n> **注意**: 安装时会从 https://resource.sillymd.com/sillyhub/ 下载模型和依赖文件。\r\n\r\n## 目录结构\r\n\r\n```\r\n.\r\n├── wecom_to_openclaw_bridge.py    # 主程序入口\r\n├── server_connector.py            # 服务器连接器（WebSocket/HTTP）\r\n├── config_manager.py              # 配置管理\r\n├── wechat_crypto.py               # 微信消息加解密\r\n├── voice_recognition.py           # 语音识别模块\r\n├── asr_sherpa_onnx.py             # Sherpa-ONNX ASR\r\n├── openclaw_session.py            # OpenClaw 会话管理\r\n├── openclaw_send_file.py          # 文件发送工具\r\n├── logging_config.py              # 日志配置\r\n├── models_list.md                 # 模型文件清单（安装时自动下载）\r\n├── wheels_list.md                 # 依赖包清单（安装时自动下载）\r\n├── models/                        # 语音识别模型（安装时自动下载）\r\n│   └── sherpa-onnx/ASR/          # Sherpa-ONNX 模型\r\n├── wheels/                        # Python 依赖包（安装时自动下载）\r\n├── whisper_local/                 # Whisper 本地实现\r\n├── logs/                          # 日志目录\r\n├── file/                          # 接收的媒体文件\r\n├── config.json                    # 主配置文件\r\n├── install.py                     # 安装脚本\r\n├── bin/cli.js                     # npm CLI 入口\r\n├── PLUGIN.md                      # 插件说明\r\n└── README.md                      # 本文件\r\n```\r\n\r\n## 语音识别说明\r\n\r\n插件优先使用 **Sherpa-ONNX** 进行语音识别：\r\n\r\n1. **Sherpa-ONNX** (默认): 本地 ONNX 模型，速度快，支持中英文\r\n2. **Whisper** (备用): 本地 Whisper 模型，准确率高，多语言支持\r\n\r\n语音文件会自动从 AMR 格式转换为 WAV 格式进行处理。\r\n\r\n## 配置说明\r\n\r\n### 配置文件\r\n\r\n插件使用极简配置，只需创建 `config.json` 文件：\r\n\r\n```json\r\n{\r\n  \"api_key\": \"YOUR_SILLYMD_API_KEY\",\r\n  \"wechat\": {\r\n    \"owner_id\": \"YOUR_WECHAT_OWNER_ID\"\r\n  }\r\n}\r\n```\r\n\r\n### 配置项说明\r\n\r\n| 配置项 | 必填 | 说明 |\r\n|--------|------|------|\r\n| `api_key` | ✅ | 从 SillyMD 控制台获取的 API Key |\r\n| `wechat.owner_id` | ✅ | 企业微信所有者 ID（接收抄送消息的目标用户）|\r\n\r\n### 自动获取的配置\r\n\r\n以下配置无需手动设置，插件启动时会自动从后端 API 获取并存储在内存中：\r\n\r\n| 配置项 | 来源 | 用途 |\r\n|--------|------|------|\r\n| `tenant_id` | API 获取 | 租户唯一标识 |\r\n| `device_id` | WebSocket 绑定 | 设备标识 |\r\n| `jwt_token` | API 获取 | WebSocket 认证（如使用 API Key 直接连接则不需要）|\r\n| `token` | API 获取 | 企业微信消息加解密 Token |\r\n| `encoding_aes_key` | API 获取 | 企业微信消息加解密密钥 |\r\n| `corp_id` | API 获取 | 企业微信 CorpID |\r\n| `corp_secret` | API 获取 | 企业微信应用密钥 |\r\n\r\n**安全说明**：所有敏感配置（token, aes_key, corp_secret 等）均从后端动态获取，**不会写入本地配置文件**，仅存储在内存中使用，避免配置文件泄露导致的安全风险。\r\n\r\n### 环境变量（可选）\r\n\r\n可通过环境变量覆盖配置：\r\n\r\n```bash\r\n# Windows PowerShell\r\n$env:SILLYMD_API_KEY=\"your_api_key\"\r\n$env:WECOM_OWNER_ID=\"YourName\"\r\n\r\n# Linux/Mac\r\nexport SILLYMD_API_KEY=your_api_key\r\nexport WECOM_OWNER_ID=YourName\r\n```\r\n\r\n## 常见问题\r\n\r\n### Q: 安装依赖时提示缺少 Microsoft Visual C++?\r\nA: 从 wheels/ 目录安装预编译的依赖包：\r\n```bash\r\npip install wheels/*.whl\r\n```\r\n\r\n### Q: 语音识别失败?\r\nA: 检查 models/ 目录下模型文件是否完整，或查看日志了解具体错误。\r\n\r\n### Q: 消息重复发送?\r\nA: 插件已内置去重机制，会自动跳过重复消息。如需清理缓存，删除 `.processed_responses` 文件。\r\n\r\n### Q: 如何更新配置?\r\nA: 修改 `.env` 文件或对应的 JSON 配置文件，然后重启插件即可。\r\n\r\n## 日志查看\r\n\r\n插件运行日志默认输出到控制台，也可查看生成的日志文件：\r\n\r\n```bash\r\n# 实时查看日志\r\ntail -f wecom_bridge.log\r\n```\r\n\r\n## 技术架构\r\n\r\n```\r\n┌─────────────┐      WebSocket       ┌─────────────┐\r\n│   企业微信   │ ◄──────────────────► │ SillyMD 服务器│\r\n└─────────────┘                      └─────────────┘\r\n       │                                     │\r\n       │         Webhook/回调                │\r\n       ▼                                     ▼\r\n┌─────────────────────────────────────────────────┐\r\n│          wecom_to_openclaw_bridge.py            │\r\n│  ┌──────────────┐  ┌──────────────────────┐    │\r\n│  │ wechat_crypto│  │ voice_recognition    │    │\r\n│  │   消息加解密  │  │ Sherpa-ONNX/Whisper │    │\r\n│  └──────────────┘  └──────────────────────┘    │\r\n└─────────────────────────────────────────────────┘\r\n                        │\r\n                        │ OpenClaw CLI\r\n                        ▼\r\n               ┌─────────────────┐\r\n               │   OpenClaw      │\r\n               │   AI Agent      │\r\n               └─────────────────┘\r\n```\r\n\r\n## 许可证\r\n\r\nMIT License\r\n\r\n## 支持与反馈\r\n\r\n如有问题，请提交 Issue 或联系开发者。\r\n","readmeFilename":"README.md"}