@yanhaidao/wecom 2.2.7 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/.github/workflows/release.yml +56 -0
  2. package/CLAUDE.md +1 -1
  3. package/GOVERNANCE.md +26 -0
  4. package/LICENSE +7 -0
  5. package/README.md +275 -91
  6. package/assets/01.bot-add.png +0 -0
  7. package/assets/01.bot-setp2.png +0 -0
  8. package/assets/02.agent.add.png +0 -0
  9. package/assets/02.agent.api-set.png +0 -0
  10. package/assets/register.png +0 -0
  11. package/changelog/v2.2.28.md +70 -0
  12. package/changelog/v2.3.2.md +70 -0
  13. package/compat-single-account.md +118 -0
  14. package/package.json +10 -2
  15. package/src/accounts.ts +17 -55
  16. package/src/agent/api-client.ts +84 -37
  17. package/src/agent/api-client.upload.test.ts +110 -0
  18. package/src/agent/handler.event-filter.test.ts +50 -0
  19. package/src/agent/handler.ts +147 -145
  20. package/src/channel.config.test.ts +147 -0
  21. package/src/channel.lifecycle.test.ts +234 -0
  22. package/src/channel.ts +90 -140
  23. package/src/config/accounts.resolve.test.ts +38 -0
  24. package/src/config/accounts.ts +257 -22
  25. package/src/config/index.ts +6 -0
  26. package/src/config/network.ts +9 -5
  27. package/src/config/routing.test.ts +88 -0
  28. package/src/config/routing.ts +26 -0
  29. package/src/config/schema.ts +35 -4
  30. package/src/config-schema.ts +5 -41
  31. package/src/dynamic-agent.account-scope.test.ts +17 -0
  32. package/src/dynamic-agent.ts +13 -13
  33. package/src/gateway-monitor.ts +200 -0
  34. package/src/http.ts +16 -2
  35. package/src/media.test.ts +28 -1
  36. package/src/media.ts +59 -1
  37. package/src/monitor/state.queue.test.ts +1 -1
  38. package/src/monitor/state.ts +1 -1
  39. package/src/monitor/types.ts +1 -1
  40. package/src/monitor.active.test.ts +13 -7
  41. package/src/monitor.inbound-filter.test.ts +63 -0
  42. package/src/monitor.ts +948 -128
  43. package/src/monitor.webhook.test.ts +288 -3
  44. package/src/outbound.test.ts +130 -0
  45. package/src/outbound.ts +44 -9
  46. package/src/shared/command-auth.ts +4 -2
  47. package/src/shared/xml-parser.test.ts +21 -1
  48. package/src/shared/xml-parser.ts +18 -0
  49. package/src/types/account.ts +43 -14
  50. package/src/types/config.ts +37 -2
  51. package/src/types/index.ts +3 -0
  52. package/src/types.ts +29 -147
  53. package/GEMINI.md +0 -76
  54. package//345/212/250/346/200/201Agent/350/267/257/347/224/261.md +0 -360
@@ -0,0 +1,56 @@
1
+ name: Release & Publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - 'v*'
7
+
8
+ jobs:
9
+ publish:
10
+ runs-on: ubuntu-latest
11
+ # 🌟 必须与 npm 设置的 Environment 一致
12
+ environment: release
13
+ permissions:
14
+ contents: write # 发布 Release
15
+ id-token: write # 获取 OIDC 身份令牌
16
+ steps:
17
+ - name: Checkout Code
18
+ uses: actions/checkout@v4
19
+
20
+ - name: Setup Node.js
21
+ uses: actions/setup-node@v4
22
+ with:
23
+ # npm Trusted Publishing (OIDC) requires npm >=11.5.1.
24
+ # Use Node 24 to get modern npm in hosted runners.
25
+ node-version: '24'
26
+ registry-url: 'https://registry.npmjs.org'
27
+
28
+ - name: Show runtime versions
29
+ run: |
30
+ node -v
31
+ npm -v
32
+
33
+ - name: Ensure npm trusted publishing support
34
+ run: |
35
+ npm i -g npm@^11.5.1
36
+ npm -v
37
+
38
+ - name: Install Dependencies
39
+ run: npm install --legacy-peer-deps || npm install
40
+
41
+ - name: Build Plugin
42
+ run: npm run build --if-present
43
+
44
+ # 🚀 自动发布到 npm (使用 OIDC 自动授权,无需 Token)
45
+ - name: Publish to npm
46
+ run: npm publish --access public
47
+
48
+ # 自动同步发布 GitHub Release
49
+ - name: Create GitHub Release
50
+ uses: softprops/action-gh-release@v2
51
+ with:
52
+ body_path: changelog/${{ github.ref_name }}.md
53
+ draft: false
54
+ prerelease: false
55
+ env:
56
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
package/CLAUDE.md CHANGED
@@ -228,7 +228,7 @@ streamStore.updateStream(streamId, (state) => {
228
228
  - `undici`: HTTP client with proxy support
229
229
  - `fast-xml-parser`: XML parsing for Agent callbacks
230
230
  - `zod`: Configuration validation
231
- - `openclaw`: Peer dependency (>=2026.1.26)
231
+ - `openclaw`: Peer dependency (>=2026.2.24)
232
232
 
233
233
  ## WeCom API Endpoints Used
234
234
 
package/GOVERNANCE.md ADDED
@@ -0,0 +1,26 @@
1
+ # Governance
2
+
3
+ This document clarifies project ownership and collaboration expectations so contributors can work together with fewer ambiguities.
4
+
5
+ ## 1. Upstream ownership
6
+ - This repository is the **Upstream / Source of Truth** for the OpenClaw WeCom plugin.
7
+ - **Author & Lead Maintainer:** YanHaidao (GitHub: YanHaidao).
8
+
9
+ ## 2. Co-maintenance model
10
+ - Tencent Cloud contributors are welcome as **co-maintainers** for code, docs, testing, and cloud deployment adaptation.
11
+ - Tencent Cloud may host an official mirror repository for sync and downstream integration needs.
12
+
13
+ ## 3. Decision-making
14
+ - We prefer discussion and consensus on non-trivial changes.
15
+ - If consensus is not reached in time, the Lead Maintainer makes the final upstream decision for roadmap, architecture, and release direction.
16
+
17
+ ## 4. Contribution workflow
18
+ - Non-trivial changes should be proposed via Pull Request.
19
+ - Keep change scope clear, include test notes when relevant, and document behavior changes.
20
+
21
+ ## 5. Mirrors and downstream adaptations
22
+ - Mirrors may carry downstream patches (for example deployment integration or cloud templates).
23
+ - Mirrors/downstream repositories should keep attribution in README or NOTICE:
24
+ - Upstream source: this repository
25
+ - Author: YanHaidao
26
+ - Co-maintained with Tencent Cloud contributors
package/LICENSE ADDED
@@ -0,0 +1,7 @@
1
+ ISC License (ISC)
2
+
3
+ Copyright (c) 2026
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
6
+
7
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.