ylib-wecom-openclaw-plugin 2026.4.29

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 (180) hide show
  1. package/README.md +596 -0
  2. package/dist/index.d.ts +10 -0
  3. package/dist/index.js +99 -0
  4. package/dist/src/accounts.d.ts +57 -0
  5. package/dist/src/accounts.js +247 -0
  6. package/dist/src/agent/api-client.d.ts +95 -0
  7. package/dist/src/agent/api-client.js +425 -0
  8. package/dist/src/agent/handler.d.ts +64 -0
  9. package/dist/src/agent/handler.js +731 -0
  10. package/dist/src/agent/index.d.ts +5 -0
  11. package/dist/src/agent/index.js +21 -0
  12. package/dist/src/agent/webhook.d.ts +25 -0
  13. package/dist/src/agent/webhook.js +294 -0
  14. package/dist/src/agent/xml.d.ts +21 -0
  15. package/dist/src/agent/xml.js +43 -0
  16. package/dist/src/channel.d.ts +5 -0
  17. package/dist/src/channel.js +815 -0
  18. package/dist/src/chat-queue.d.ts +31 -0
  19. package/dist/src/chat-queue.js +53 -0
  20. package/dist/src/config-schema.d.ts +587 -0
  21. package/dist/src/config-schema.js +146 -0
  22. package/dist/src/const.d.ts +128 -0
  23. package/dist/src/const.js +168 -0
  24. package/dist/src/dm-policy.d.ts +29 -0
  25. package/dist/src/dm-policy.js +146 -0
  26. package/dist/src/dynamic-agent.d.ts +37 -0
  27. package/dist/src/dynamic-agent.js +67 -0
  28. package/dist/src/dynamic-routing.d.ts +65 -0
  29. package/dist/src/dynamic-routing.js +62 -0
  30. package/dist/src/endpoint-dispatch.d.ts +54 -0
  31. package/dist/src/endpoint-dispatch.js +967 -0
  32. package/dist/src/endpoint-event-adapter.d.ts +15 -0
  33. package/dist/src/endpoint-event-adapter.js +427 -0
  34. package/dist/src/group-policy.d.ts +30 -0
  35. package/dist/src/group-policy.js +126 -0
  36. package/dist/src/http.d.ts +27 -0
  37. package/dist/src/http.js +168 -0
  38. package/dist/src/im-runtime-telemetry.d.ts +25 -0
  39. package/dist/src/im-runtime-telemetry.js +68 -0
  40. package/dist/src/interface.d.ts +192 -0
  41. package/dist/src/interface.js +5 -0
  42. package/dist/src/markdown-chunk.d.ts +1 -0
  43. package/dist/src/markdown-chunk.js +396 -0
  44. package/dist/src/mcp/index.d.ts +6 -0
  45. package/dist/src/mcp/index.js +28 -0
  46. package/dist/src/mcp/interceptors/biz-error.d.ts +11 -0
  47. package/dist/src/mcp/interceptors/biz-error.js +73 -0
  48. package/dist/src/mcp/interceptors/doc-auth-error.d.ts +10 -0
  49. package/dist/src/mcp/interceptors/doc-auth-error.js +235 -0
  50. package/dist/src/mcp/interceptors/index.d.ts +35 -0
  51. package/dist/src/mcp/interceptors/index.js +143 -0
  52. package/dist/src/mcp/interceptors/msg-media.d.ts +11 -0
  53. package/dist/src/mcp/interceptors/msg-media.js +201 -0
  54. package/dist/src/mcp/interceptors/smartpage-create.d.ts +30 -0
  55. package/dist/src/mcp/interceptors/smartpage-create.js +252 -0
  56. package/dist/src/mcp/interceptors/smartpage-export.d.ts +17 -0
  57. package/dist/src/mcp/interceptors/smartpage-export.js +135 -0
  58. package/dist/src/mcp/interceptors/smartsheet-upload.d.ts +22 -0
  59. package/dist/src/mcp/interceptors/smartsheet-upload.js +388 -0
  60. package/dist/src/mcp/interceptors/types.d.ts +64 -0
  61. package/dist/src/mcp/interceptors/types.js +8 -0
  62. package/dist/src/mcp/schema.d.ts +11 -0
  63. package/dist/src/mcp/schema.js +115 -0
  64. package/dist/src/mcp/tool.d.ts +63 -0
  65. package/dist/src/mcp/tool.js +318 -0
  66. package/dist/src/mcp/transport.d.ts +94 -0
  67. package/dist/src/mcp/transport.js +702 -0
  68. package/dist/src/media-handler.d.ts +55 -0
  69. package/dist/src/media-handler.js +306 -0
  70. package/dist/src/media-uploader.d.ts +142 -0
  71. package/dist/src/media-uploader.js +446 -0
  72. package/dist/src/message-parser.d.ts +104 -0
  73. package/dist/src/message-parser.js +232 -0
  74. package/dist/src/message-sender.d.ts +54 -0
  75. package/dist/src/message-sender.js +210 -0
  76. package/dist/src/monitor.d.ts +69 -0
  77. package/dist/src/monitor.js +1846 -0
  78. package/dist/src/onboarding.d.ts +8 -0
  79. package/dist/src/onboarding.js +248 -0
  80. package/dist/src/openclaw-compat.d.ts +148 -0
  81. package/dist/src/openclaw-compat.js +839 -0
  82. package/dist/src/proactive-markdown-send.d.ts +14 -0
  83. package/dist/src/proactive-markdown-send.js +205 -0
  84. package/dist/src/reqid-store.d.ts +23 -0
  85. package/dist/src/reqid-store.js +136 -0
  86. package/dist/src/runtime.d.ts +2 -0
  87. package/dist/src/runtime.js +7 -0
  88. package/dist/src/shared/command-auth.d.ts +23 -0
  89. package/dist/src/shared/command-auth.js +112 -0
  90. package/dist/src/shared/xml-parser.d.ts +46 -0
  91. package/dist/src/shared/xml-parser.js +228 -0
  92. package/dist/src/state-dir-resolve.d.ts +2 -0
  93. package/dist/src/state-dir-resolve.js +33 -0
  94. package/dist/src/state-manager.d.ts +115 -0
  95. package/dist/src/state-manager.js +413 -0
  96. package/dist/src/target.d.ts +35 -0
  97. package/dist/src/target.js +71 -0
  98. package/dist/src/template-card-manager.d.ts +55 -0
  99. package/dist/src/template-card-manager.js +316 -0
  100. package/dist/src/template-card-parser.d.ts +37 -0
  101. package/dist/src/template-card-parser.js +672 -0
  102. package/dist/src/timeout.d.ts +20 -0
  103. package/dist/src/timeout.js +57 -0
  104. package/dist/src/types/account.d.ts +29 -0
  105. package/dist/src/types/account.js +5 -0
  106. package/dist/src/types/config.d.ts +98 -0
  107. package/dist/src/types/config.js +8 -0
  108. package/dist/src/types/constants.d.ts +42 -0
  109. package/dist/src/types/constants.js +45 -0
  110. package/dist/src/types/index.d.ts +7 -0
  111. package/dist/src/types/index.js +17 -0
  112. package/dist/src/types/message.d.ts +238 -0
  113. package/dist/src/types/message.js +6 -0
  114. package/dist/src/utils.d.ts +148 -0
  115. package/dist/src/utils.js +92 -0
  116. package/dist/src/version.d.ts +2 -0
  117. package/dist/src/version.js +28 -0
  118. package/dist/src/webhook/command-auth.d.ts +47 -0
  119. package/dist/src/webhook/command-auth.js +137 -0
  120. package/dist/src/webhook/gateway.d.ts +36 -0
  121. package/dist/src/webhook/gateway.js +297 -0
  122. package/dist/src/webhook/handler.d.ts +19 -0
  123. package/dist/src/webhook/handler.js +481 -0
  124. package/dist/src/webhook/helpers.d.ts +157 -0
  125. package/dist/src/webhook/helpers.js +936 -0
  126. package/dist/src/webhook/http.d.ts +27 -0
  127. package/dist/src/webhook/http.js +168 -0
  128. package/dist/src/webhook/index.d.ts +11 -0
  129. package/dist/src/webhook/index.js +43 -0
  130. package/dist/src/webhook/media.d.ts +30 -0
  131. package/dist/src/webhook/media.js +152 -0
  132. package/dist/src/webhook/monitor.d.ts +59 -0
  133. package/dist/src/webhook/monitor.js +1672 -0
  134. package/dist/src/webhook/state.d.ts +220 -0
  135. package/dist/src/webhook/state.js +568 -0
  136. package/dist/src/webhook/target.d.ts +41 -0
  137. package/dist/src/webhook/target.js +165 -0
  138. package/dist/src/webhook/types.d.ts +348 -0
  139. package/dist/src/webhook/types.js +36 -0
  140. package/dist/src/webhook/video-frame.d.ts +13 -0
  141. package/dist/src/webhook/video-frame.js +108 -0
  142. package/openclaw.plugin.json +19 -0
  143. package/package.json +96 -0
  144. package/schema.json +534 -0
  145. package/scripts/generate-schema.mjs +33 -0
  146. package/skills/wecom-contact/SKILL.md +162 -0
  147. package/skills/wecom-doc/SKILL.md +162 -0
  148. package/skills/wecom-doc/references/create-doc.md +56 -0
  149. package/skills/wecom-doc/references/edit-doc-content.md +68 -0
  150. package/skills/wecom-doc/references/get-doc-content.md +88 -0
  151. package/skills/wecom-doc/references/smartpage-create.md +125 -0
  152. package/skills/wecom-doc/references/smartpage-export.md +160 -0
  153. package/skills/wecom-meeting/SKILL.md +441 -0
  154. package/skills/wecom-meeting/references/example-full.md +30 -0
  155. package/skills/wecom-meeting/references/example-reminder.md +46 -0
  156. package/skills/wecom-meeting/references/example-security.md +22 -0
  157. package/skills/wecom-meeting/references/response-get-meeting-info.md +148 -0
  158. package/skills/wecom-msg/SKILL.md +157 -0
  159. package/skills/wecom-msg/references/api-get-messages.md +93 -0
  160. package/skills/wecom-msg/references/api-get-msg-chat-list.md +58 -0
  161. package/skills/wecom-msg/references/api-get-msg-media.md +44 -0
  162. package/skills/wecom-msg/references/api-send-message.md +39 -0
  163. package/skills/wecom-preflight/SKILL.md +141 -0
  164. package/skills/wecom-schedule/SKILL.md +161 -0
  165. package/skills/wecom-schedule/references/api-check-availability.md +56 -0
  166. package/skills/wecom-schedule/references/api-create-schedule.md +38 -0
  167. package/skills/wecom-schedule/references/api-get-schedule-detail.md +81 -0
  168. package/skills/wecom-schedule/references/api-update-schedule.md +32 -0
  169. package/skills/wecom-schedule/references/ref-reminders.md +24 -0
  170. package/skills/wecom-send-media/SKILL.md +68 -0
  171. package/skills/wecom-send-template-card/SKILL.md +157 -0
  172. package/skills/wecom-send-template-card/references/api-template-card-types.md +358 -0
  173. package/skills/wecom-smartsheet/SKILL.md +164 -0
  174. package/skills/wecom-smartsheet/references/smartsheet-cell-value-formats.md +163 -0
  175. package/skills/wecom-smartsheet/references/smartsheet-field-types.md +44 -0
  176. package/skills/wecom-smartsheet/references/smartsheet-get-records.md +96 -0
  177. package/skills/wecom-smartsheet/references/webhook-examples.md +185 -0
  178. package/skills/wecom-smartsheet/references/webhook-fallback.md +184 -0
  179. package/skills/wecom-todo/SKILL.md +392 -0
  180. package/skills/wecom-todo/examples/workflows.md +163 -0
package/package.json ADDED
@@ -0,0 +1,96 @@
1
+ {
2
+ "name": "ylib-wecom-openclaw-plugin",
3
+ "version": "2026.4.29",
4
+ "type": "module",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "import": "./dist/index.js"
11
+ }
12
+ },
13
+ "files": [
14
+ "dist",
15
+ "schema.json",
16
+ "scripts/generate-schema.mjs",
17
+ "skills",
18
+ "openclaw.plugin.json",
19
+ "README.md"
20
+ ],
21
+ "scripts": {
22
+ "test": "vitest run",
23
+ "test:watch": "vitest --watch",
24
+ "test:im-stream": "vitest run src/endpoint-dispatch.test.ts",
25
+ "build": "tsc",
26
+ "dev": "tsc --watch",
27
+ "clean": "rm -rf dist",
28
+ "prebuild": "npm run clean",
29
+ "schema:generate": "node ./scripts/generate-schema.mjs",
30
+ "regression:long-markdown": "npm run build && node ./scripts/regression-long-markdown.mjs",
31
+ "prepublishOnly": "npm run build && npm run schema:generate",
32
+ "release": "node scripts/publish-all.mjs",
33
+ "release:dry": "node scripts/publish-all.mjs --dry-run",
34
+ "release:ci": "node scripts/publish-all.mjs --yes --restore=no",
35
+ "deploy:local": "bash scripts/dev-deploy.sh",
36
+ "deploy:local:extensions": "bash scripts/dev-deploy.sh --target=extensions"
37
+ },
38
+ "keywords": [
39
+ "wecom",
40
+ "openclaw",
41
+ "wecom-openclaw-plugin"
42
+ ],
43
+ "author": "",
44
+ "license": "MIT",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "https://github.com/WecomTeam/wecom-openclaw-plugin.git"
48
+ },
49
+ "homepage": "https://github.com/WecomTeam/wecom-openclaw-plugin#readme",
50
+ "bugs": {
51
+ "url": "https://github.com/WecomTeam/wecom-openclaw-plugin/issues"
52
+ },
53
+ "description": "OpenClaw WeCom (企业微信) channel plugin (official by Tencent WeCom team)",
54
+ "openclaw": {
55
+ "extensions": [
56
+ "./dist/index.js"
57
+ ],
58
+ "channel": {
59
+ "id": "wecom",
60
+ "label": "企业微信",
61
+ "selectionLabel": "企业微信 (WeCom)",
62
+ "docsPath": "/channels/wecom",
63
+ "docsLabel": "wecom-openclaw-plugin",
64
+ "blurb": "企业微信机器人接入插件",
65
+ "order": 80,
66
+ "quickstartAllowFrom": true
67
+ },
68
+ "install": {
69
+ "npmSpec": "ylib-wecom-openclaw-plugin",
70
+ "localPath": "extensions/ylib-wecom-openclaw-plugin",
71
+ "defaultChoice": "npm"
72
+ }
73
+ },
74
+ "dependencies": {
75
+ "@wecom/aibot-node-sdk": "^1.0.6",
76
+ "fast-xml-parser": "^5.5.9",
77
+ "file-type": "^21.3.0",
78
+ "marked": "^16.4.1",
79
+ "undici": "^7.24.6",
80
+ "zod": "^4.3.6"
81
+ },
82
+ "peerDependencies": {
83
+ "ylib-openclaw": "2026.3.9-beta.5"
84
+ },
85
+ "peerDependenciesMeta": {
86
+ "ylib-openclaw": {
87
+ "optional": true
88
+ }
89
+ },
90
+ "devDependencies": {
91
+ "@types/node": "^22.10.0",
92
+ "ylib-openclaw": "2026.3.9-beta.5",
93
+ "typescript": "^5.3.3",
94
+ "vitest": "^4.1.1"
95
+ }
96
+ }
package/schema.json ADDED
@@ -0,0 +1,534 @@
1
+ {
2
+ "pluginId": "wecom",
3
+ "channel": "wecom",
4
+ "rawSchema": {
5
+ "$schema": "http://json-schema.org/draft-07/schema#",
6
+ "type": "object",
7
+ "properties": {
8
+ "name": {
9
+ "type": "string"
10
+ },
11
+ "enabled": {
12
+ "type": "boolean"
13
+ },
14
+ "websocketUrl": {
15
+ "type": "string"
16
+ },
17
+ "botId": {
18
+ "type": "string"
19
+ },
20
+ "secret": {
21
+ "type": "string"
22
+ },
23
+ "connectionMode": {
24
+ "default": "websocket",
25
+ "readOnly": true,
26
+ "description": "企业微信仅支持 websocket(固定值,不可修改)",
27
+ "type": "string",
28
+ "enum": [
29
+ "websocket"
30
+ ]
31
+ },
32
+ "token": {
33
+ "type": "string"
34
+ },
35
+ "encodingAESKey": {
36
+ "type": "string"
37
+ },
38
+ "receiveId": {
39
+ "type": "string"
40
+ },
41
+ "welcomeText": {
42
+ "type": "string"
43
+ },
44
+ "streamPlaceholderContent": {
45
+ "type": "string"
46
+ },
47
+ "gatewayBaseUrl": {
48
+ "type": "string"
49
+ },
50
+ "gatewayToken": {
51
+ "type": "string"
52
+ },
53
+ "uploadHost": {
54
+ "type": "string"
55
+ },
56
+ "modelName": {
57
+ "default": "main",
58
+ "type": "string"
59
+ },
60
+ "agentId": {
61
+ "default": "main",
62
+ "type": "string"
63
+ },
64
+ "scopeType": {
65
+ "default": "workspace",
66
+ "readOnly": true,
67
+ "type": "string"
68
+ },
69
+ "workspaceId": {
70
+ "default": "",
71
+ "readOnly": true,
72
+ "type": "string"
73
+ },
74
+ "projectId": {
75
+ "default": "",
76
+ "readOnly": true,
77
+ "type": "string"
78
+ },
79
+ "scope_kind": {
80
+ "readOnly": true,
81
+ "type": "string"
82
+ },
83
+ "scopeKind": {
84
+ "readOnly": true,
85
+ "type": "string"
86
+ },
87
+ "scope_type": {
88
+ "readOnly": true,
89
+ "type": "string"
90
+ },
91
+ "workspace_id": {
92
+ "readOnly": true,
93
+ "type": "string"
94
+ },
95
+ "project_id": {
96
+ "readOnly": true,
97
+ "type": "string"
98
+ },
99
+ "type": {
100
+ "readOnly": true,
101
+ "type": "string"
102
+ },
103
+ "separateSessionByConversation": {
104
+ "default": true,
105
+ "readOnly": true,
106
+ "description": "是否按单聊/群聊区分 session(固定值,不可修改)",
107
+ "type": "boolean"
108
+ },
109
+ "groupSessionScope": {
110
+ "default": "group_sender",
111
+ "readOnly": true,
112
+ "description": "群组按人隔离会话模式(固定值,不可修改)",
113
+ "type": "string",
114
+ "enum": [
115
+ "group_sender"
116
+ ]
117
+ },
118
+ "allowFrom": {
119
+ "type": "array",
120
+ "items": {
121
+ "anyOf": [
122
+ {
123
+ "type": "string"
124
+ },
125
+ {
126
+ "type": "number"
127
+ }
128
+ ]
129
+ }
130
+ },
131
+ "dmPolicy": {
132
+ "type": "string",
133
+ "enum": [
134
+ "open",
135
+ "allowlist",
136
+ "pairing",
137
+ "disabled"
138
+ ]
139
+ },
140
+ "groupPolicy": {
141
+ "type": "string",
142
+ "enum": [
143
+ "open",
144
+ "allowlist",
145
+ "disabled"
146
+ ]
147
+ },
148
+ "groupAllowFrom": {
149
+ "type": "array",
150
+ "items": {
151
+ "anyOf": [
152
+ {
153
+ "type": "string"
154
+ },
155
+ {
156
+ "type": "number"
157
+ }
158
+ ]
159
+ }
160
+ },
161
+ "groups": {
162
+ "type": "object",
163
+ "propertyNames": {
164
+ "type": "string"
165
+ },
166
+ "additionalProperties": {}
167
+ },
168
+ "sendThinkingMessage": {
169
+ "type": "boolean"
170
+ },
171
+ "showFinalAnswerOnly": {
172
+ "default": false,
173
+ "type": "boolean"
174
+ },
175
+ "mediaLocalRoots": {
176
+ "type": "array",
177
+ "items": {
178
+ "type": "string"
179
+ }
180
+ },
181
+ "agent": {
182
+ "type": "object",
183
+ "properties": {
184
+ "corpId": {
185
+ "type": "string"
186
+ },
187
+ "corpSecret": {
188
+ "type": "string"
189
+ },
190
+ "agentId": {
191
+ "anyOf": [
192
+ {
193
+ "type": "string"
194
+ },
195
+ {
196
+ "type": "number"
197
+ }
198
+ ]
199
+ },
200
+ "token": {
201
+ "type": "string"
202
+ },
203
+ "encodingAESKey": {
204
+ "type": "string"
205
+ }
206
+ },
207
+ "additionalProperties": {}
208
+ },
209
+ "network": {
210
+ "type": "object",
211
+ "properties": {
212
+ "egressProxyUrl": {
213
+ "type": "string"
214
+ }
215
+ },
216
+ "additionalProperties": {}
217
+ },
218
+ "media": {
219
+ "type": "object",
220
+ "properties": {
221
+ "maxFileSizeMB": {
222
+ "type": "number"
223
+ },
224
+ "allowedMimeTypes": {
225
+ "type": "array",
226
+ "items": {
227
+ "type": "string"
228
+ }
229
+ }
230
+ },
231
+ "additionalProperties": {}
232
+ },
233
+ "dynamicAgents": {
234
+ "type": "object",
235
+ "properties": {
236
+ "enabled": {
237
+ "type": "boolean"
238
+ },
239
+ "mappings": {
240
+ "type": "object",
241
+ "propertyNames": {
242
+ "type": "string"
243
+ },
244
+ "additionalProperties": {}
245
+ }
246
+ },
247
+ "additionalProperties": {}
248
+ },
249
+ "defaultAccount": {
250
+ "type": "string"
251
+ },
252
+ "accounts": {
253
+ "type": "object",
254
+ "propertyNames": {
255
+ "type": "string"
256
+ },
257
+ "additionalProperties": {
258
+ "type": "object",
259
+ "properties": {
260
+ "name": {
261
+ "type": "string"
262
+ },
263
+ "enabled": {
264
+ "type": "boolean"
265
+ },
266
+ "websocketUrl": {
267
+ "type": "string"
268
+ },
269
+ "botId": {
270
+ "type": "string"
271
+ },
272
+ "secret": {
273
+ "type": "string"
274
+ },
275
+ "connectionMode": {
276
+ "default": "websocket",
277
+ "readOnly": true,
278
+ "description": "企业微信仅支持 websocket(固定值,不可修改)",
279
+ "type": "string",
280
+ "enum": [
281
+ "websocket"
282
+ ]
283
+ },
284
+ "token": {
285
+ "type": "string"
286
+ },
287
+ "encodingAESKey": {
288
+ "type": "string"
289
+ },
290
+ "receiveId": {
291
+ "type": "string"
292
+ },
293
+ "welcomeText": {
294
+ "type": "string"
295
+ },
296
+ "streamPlaceholderContent": {
297
+ "type": "string"
298
+ },
299
+ "gatewayBaseUrl": {
300
+ "type": "string"
301
+ },
302
+ "gatewayToken": {
303
+ "type": "string"
304
+ },
305
+ "uploadHost": {
306
+ "type": "string"
307
+ },
308
+ "modelName": {
309
+ "default": "main",
310
+ "type": "string"
311
+ },
312
+ "agentId": {
313
+ "default": "main",
314
+ "type": "string"
315
+ },
316
+ "scopeType": {
317
+ "default": "workspace",
318
+ "readOnly": true,
319
+ "type": "string"
320
+ },
321
+ "workspaceId": {
322
+ "default": "",
323
+ "readOnly": true,
324
+ "type": "string"
325
+ },
326
+ "projectId": {
327
+ "default": "",
328
+ "readOnly": true,
329
+ "type": "string"
330
+ },
331
+ "scope_kind": {
332
+ "readOnly": true,
333
+ "type": "string"
334
+ },
335
+ "scopeKind": {
336
+ "readOnly": true,
337
+ "type": "string"
338
+ },
339
+ "scope_type": {
340
+ "readOnly": true,
341
+ "type": "string"
342
+ },
343
+ "workspace_id": {
344
+ "readOnly": true,
345
+ "type": "string"
346
+ },
347
+ "project_id": {
348
+ "readOnly": true,
349
+ "type": "string"
350
+ },
351
+ "type": {
352
+ "readOnly": true,
353
+ "type": "string"
354
+ },
355
+ "separateSessionByConversation": {
356
+ "default": true,
357
+ "readOnly": true,
358
+ "description": "是否按单聊/群聊区分 session(固定值,不可修改)",
359
+ "type": "boolean"
360
+ },
361
+ "groupSessionScope": {
362
+ "default": "group_sender",
363
+ "readOnly": true,
364
+ "description": "群组按人隔离会话模式(固定值,不可修改)",
365
+ "type": "string",
366
+ "enum": [
367
+ "group_sender"
368
+ ]
369
+ },
370
+ "allowFrom": {
371
+ "type": "array",
372
+ "items": {
373
+ "anyOf": [
374
+ {
375
+ "type": "string"
376
+ },
377
+ {
378
+ "type": "number"
379
+ }
380
+ ]
381
+ }
382
+ },
383
+ "dmPolicy": {
384
+ "type": "string",
385
+ "enum": [
386
+ "open",
387
+ "allowlist",
388
+ "pairing",
389
+ "disabled"
390
+ ]
391
+ },
392
+ "groupPolicy": {
393
+ "type": "string",
394
+ "enum": [
395
+ "open",
396
+ "allowlist",
397
+ "disabled"
398
+ ]
399
+ },
400
+ "groupAllowFrom": {
401
+ "type": "array",
402
+ "items": {
403
+ "anyOf": [
404
+ {
405
+ "type": "string"
406
+ },
407
+ {
408
+ "type": "number"
409
+ }
410
+ ]
411
+ }
412
+ },
413
+ "groups": {
414
+ "type": "object",
415
+ "propertyNames": {
416
+ "type": "string"
417
+ },
418
+ "additionalProperties": {}
419
+ },
420
+ "sendThinkingMessage": {
421
+ "type": "boolean"
422
+ },
423
+ "showFinalAnswerOnly": {
424
+ "default": false,
425
+ "type": "boolean"
426
+ },
427
+ "mediaLocalRoots": {
428
+ "type": "array",
429
+ "items": {
430
+ "type": "string"
431
+ }
432
+ },
433
+ "agent": {
434
+ "type": "object",
435
+ "properties": {
436
+ "corpId": {
437
+ "type": "string"
438
+ },
439
+ "corpSecret": {
440
+ "type": "string"
441
+ },
442
+ "agentId": {
443
+ "anyOf": [
444
+ {
445
+ "type": "string"
446
+ },
447
+ {
448
+ "type": "number"
449
+ }
450
+ ]
451
+ },
452
+ "token": {
453
+ "type": "string"
454
+ },
455
+ "encodingAESKey": {
456
+ "type": "string"
457
+ }
458
+ },
459
+ "additionalProperties": {}
460
+ },
461
+ "network": {
462
+ "type": "object",
463
+ "properties": {
464
+ "egressProxyUrl": {
465
+ "type": "string"
466
+ }
467
+ },
468
+ "additionalProperties": {}
469
+ },
470
+ "media": {
471
+ "type": "object",
472
+ "properties": {
473
+ "maxFileSizeMB": {
474
+ "type": "number"
475
+ },
476
+ "allowedMimeTypes": {
477
+ "type": "array",
478
+ "items": {
479
+ "type": "string"
480
+ }
481
+ }
482
+ },
483
+ "additionalProperties": {}
484
+ },
485
+ "dynamicAgents": {
486
+ "type": "object",
487
+ "properties": {
488
+ "enabled": {
489
+ "type": "boolean"
490
+ },
491
+ "mappings": {
492
+ "type": "object",
493
+ "propertyNames": {
494
+ "type": "string"
495
+ },
496
+ "additionalProperties": {}
497
+ }
498
+ },
499
+ "additionalProperties": {}
500
+ }
501
+ },
502
+ "required": [
503
+ "connectionMode",
504
+ "modelName",
505
+ "agentId",
506
+ "scopeType",
507
+ "workspaceId",
508
+ "projectId",
509
+ "separateSessionByConversation",
510
+ "groupSessionScope",
511
+ "showFinalAnswerOnly"
512
+ ],
513
+ "additionalProperties": false
514
+ }
515
+ },
516
+ "channelConfigUpdatedAt": {
517
+ "type": "string"
518
+ }
519
+ },
520
+ "required": [
521
+ "connectionMode",
522
+ "modelName",
523
+ "agentId",
524
+ "scopeType",
525
+ "workspaceId",
526
+ "projectId",
527
+ "separateSessionByConversation",
528
+ "groupSessionScope",
529
+ "showFinalAnswerOnly"
530
+ ],
531
+ "additionalProperties": false
532
+ },
533
+ "schemaVersion": 1
534
+ }
@@ -0,0 +1,33 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from "node:fs";
4
+ import path from "node:path";
5
+ import { fileURLToPath, pathToFileURL } from "node:url";
6
+
7
+ const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
8
+ const entryPath = path.join(root, "dist", "index.js");
9
+ const outputPath = path.join(root, "schema.json");
10
+
11
+ if (!fs.existsSync(entryPath)) {
12
+ throw new Error("dist/index.js not found, run build first");
13
+ }
14
+
15
+ const mod = await import(pathToFileURL(entryPath).href);
16
+ const plugin = mod.default;
17
+ const rawSchema = plugin?.configSchema?.schema;
18
+
19
+ if (!rawSchema || typeof rawSchema !== "object" || Array.isArray(rawSchema)) {
20
+ throw new Error("failed to resolve wecom plugin raw schema from dist/index.js");
21
+ }
22
+
23
+ const payload = {
24
+ pluginId: "wecom",
25
+ channel: "wecom",
26
+ rawSchema,
27
+ schemaVersion: 1,
28
+ // generatedAt: new Date().toISOString(),
29
+ };
30
+
31
+ fs.writeFileSync(outputPath, `${JSON.stringify(payload, null, 2)}\n`, "utf8");
32
+ console.log(`[schema] generated ${outputPath}`);
33
+