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
@@ -0,0 +1,163 @@
1
+ # 典型工作流
2
+
3
+ ### 工作流 1:查看待办列表(标准三步流程)
4
+
5
+ **用户意图**:"看看我最近的待办" / "我有哪些待办事项?" / "我还有多少事要做?"
6
+
7
+ **步骤:**
8
+
9
+ 1. **获取待办列表**(只有 ID 和状态,没有内容):使用 `wecom_mcp` tool 调用 `wecom_mcp call todo get_todo_list '{}'`
10
+
11
+ 2. **用返回的 todo_id 列表获取完整详情**(禁止跳过!):使用 `wecom_mcp` tool 调用 `wecom_mcp call todo get_todo_detail '{"todo_id_list": ["返回的TODO_ID_1", "返回的TODO_ID_2"]}'`
12
+
13
+ 3. **通过 wecom-contact 获取通讯录**,将 follower_id / creator_id 转为姓名:使用 `wecom_mcp` tool 调用 `wecom_mcp call contact get_userlist '{}'`
14
+
15
+ 用返回的 userlist 中的 userid 匹配 follower_id 和 creator_id,取 name 字段作为展示姓名。
16
+
17
+ 4. **检查分页**:检查第一步返回的 `has_more` 字段。如果为 `true`,在展示结果时必须提醒用户:"以上是部分待办,还有更多待办未显示,需要我继续查看吗?"
18
+
19
+ **展示格式(分派人和创建人必须显示为姓名,不是 ID):**
20
+
21
+ ```
22
+ 📋 您当前的待办事项(共 3 项)
23
+
24
+ 1. 🔵 完成Q2规划文档
25
+ - 待办状态:进行中 | 我的状态:已接受
26
+ - 提醒时间:2025-06-01 09:00
27
+ - 分派人:张三、李四
28
+ - 创建时间:2025-01-15
29
+
30
+ 2. 🔵 提交周报
31
+ - 待办状态:进行中 | 我的状态:已接受
32
+ - 提醒时间:2025-03-17 18:00
33
+ - 创建时间:2025-03-10
34
+
35
+ 3. ☑️ 代码评审
36
+ - 待办状态:已完成 | 我的状态:已完成
37
+ - 创建时间:2025-03-01
38
+ ```
39
+
40
+ ---
41
+
42
+ ### 工作流 2:按时间范围查询待办
43
+
44
+ **用户意图**:"这个月创建的待办有哪些?"
45
+
46
+ **步骤:**
47
+
48
+ 1. **按时间过滤获取列表**:使用 `wecom_mcp` tool 调用 `wecom_mcp call todo get_todo_list '{"create_begin_time": "2025-03-01 00:00:00", "create_end_time": "2025-03-31 23:59:59"}'`
49
+
50
+ 2. **获取详情**(同工作流 1 的第 2、3 步)。
51
+
52
+ ---
53
+
54
+ ### 工作流 3:创建待办并分派给同事
55
+
56
+ **用户意图**:"帮我创建一个待办,让张三下周一前完成需求文档"
57
+
58
+ **步骤:**
59
+
60
+ 1. **通讯录查询**:通过 wecom-contact 技能查询张三的 userid,在返回结果中筛选姓名为"张三"的成员,获取其 userid。使用 `wecom_mcp` tool 调用 `wecom_mcp call contact get_userlist '{}'`
61
+
62
+ 2. **创建待办并分派**:使用 `wecom_mcp` tool 调用 `wecom_mcp call todo create_todo '{"content": "<待办的内容>", "follower_list": {"followers": [{"follower_id": "zhangsan", "follower_status": 1}]}, "remind_time": "2025-03-24 09:00:00"}'`
63
+
64
+ 3. **展示结果**:
65
+ ```
66
+ ✅ 待办创建成功!
67
+
68
+ 📝 内容:完成需求文档
69
+ 👥 分派人:张三
70
+ ⏰ 提醒时间:2025-03-24 09:00
71
+ ```
72
+
73
+ > `follower_id` 必须来自 `wecom-contact` 技能的 `get_userlist` 接口返回的 `userid`,禁止自行猜测。若搜索结果有多个同名人员,需展示候选列表让用户确认。
74
+
75
+ ---
76
+
77
+ ### 工作流 4:标记待办完成
78
+
79
+ 需要区分两种场景:**标记待办本身完成**(改 `todo_status`)和**标记我的参与状态为完成**(改 `user_status`)。
80
+
81
+ #### 场景 A:标记待办本身完成
82
+
83
+ **用户意图**:"把'完成Q2规划文档'这个待办标记为完成" / "关闭这个待办"
84
+
85
+ 1. **查找目标待办**:使用 `wecom_mcp` tool 调用 `wecom_mcp call todo get_todo_list '{}'`
86
+ 2. **获取详情确认**:使用 `wecom_mcp` tool 调用 `wecom_mcp call todo get_todo_detail '{"todo_id_list": ["TODO_ID"]}'`
87
+ 3. **将待办状态改为已完成**:使用 `wecom_mcp` tool 调用 `wecom_mcp call todo update_todo '{"todo_id": "TODO_ID", "todo_status": 0}'`
88
+
89
+ #### 场景 B:标记我的参与状态为完成
90
+
91
+ **用户意图**:"我已经完成了这个待办" / "标记我的部分为完成"
92
+
93
+ 1. **查找目标待办**:使用 `wecom_mcp` tool 调用 `wecom_mcp call todo get_todo_list '{}'`
94
+ 2. **获取详情确认**:使用 `wecom_mcp` tool 调用 `wecom_mcp call todo get_todo_detail '{"todo_id_list": ["TODO_ID"]}'`
95
+ 3. **变更当前用户的参与状态为已完成**:使用 `wecom_mcp` tool 调用 `wecom_mcp call todo change_todo_user_status '{"todo_id": "TODO_ID", "user_status": 2}'`
96
+
97
+ > **如何判断用户意图:** 如果用户说"标记完成"且该待办是自己创建的、没有其他分派人,通常指场景 A(标记待办本身完成)。如果该待办有多个参与人,用户可能只是想标记自己那部分完成(场景 B)。不确定时应向用户确认。
98
+
99
+ > 用户提供的是待办内容描述而非 ID,所以需要先通过 `get_todo_list` 和 `get_todo_detail` 查找再匹配。匹配到多个相似待办时,列出候选项让用户确认。
100
+
101
+ ---
102
+
103
+ ### 工作流 5:更新待办内容或提醒时间
104
+
105
+ **用户意图**:"把那个需求文档的待办提醒时间改到下周五"
106
+
107
+ **步骤:**
108
+
109
+ 1. **查找目标待办**:使用 `wecom_mcp` tool 调用 `wecom_mcp call todo get_todo_list '{}'`
110
+
111
+ 再查详情:使用 `wecom_mcp` tool 调用 `wecom_mcp call todo get_todo_detail '{"todo_id_list": ["TODO_ID_1", "TODO_ID_2"]}'`
112
+
113
+ 2. **确认目标后更新**:使用 `wecom_mcp` tool 调用 `wecom_mcp call todo update_todo '{"todo_id": "TODO_ID", "remind_time": "2025-03-28 09:00:00"}'`
114
+
115
+ 3. **展示结果**:
116
+ ```
117
+ ✅ 待办已更新!
118
+
119
+ 📝 内容:完成需求文档
120
+ ⏰ 新提醒时间:2025-03-28 09:00
121
+ ```
122
+
123
+ ---
124
+
125
+ ### 工作流 6:删除待办
126
+
127
+ **用户意图**:"删掉'代码评审'那个待办"
128
+
129
+ **步骤:**
130
+
131
+ 1. **查找目标待办**:使用 `wecom_mcp` tool 调用 `wecom_mcp call todo get_todo_list '{}'`
132
+
133
+ 再查详情:使用 `wecom_mcp` tool 调用 `wecom_mcp call todo get_todo_detail '{"todo_id_list": ["TODO_ID"]}'`
134
+
135
+ 2. **向用户确认后删除**:使用 `wecom_mcp` tool 调用 `wecom_mcp call todo delete_todo '{"todo_id": "TODO_ID"}'`
136
+
137
+ 3. **展示结果**:
138
+ ```
139
+ ✅ 待办已删除:代码评审
140
+ ```
141
+
142
+ > 删除前必须向用户确认,确认措辞示例:"确认删除待办'代码评审'吗?删除后不可恢复。"
143
+
144
+ ---
145
+
146
+ ### 工作流 7:分页获取大量待办
147
+
148
+ 当待办数量超过单页上限时,通过 `cursor` 循环分页拉取:
149
+
150
+ - 首次请求(不传 cursor):使用 `wecom_mcp` tool 调用 `wecom_mcp call todo get_todo_list '{"limit": 20}'`
151
+
152
+ 如果没有拉取完,还有更多的待办,会返回 has_more=true, next_cursor="CURSOR_1"
153
+
154
+ - 第二次请求(传入上次的 next_cursor):使用 `wecom_mcp` tool 调用 `wecom_mcp call todo get_todo_list '{"limit": 20, "cursor": "CURSOR_1"}'`
155
+
156
+ 返回 has_more=false,拉取完毕
157
+
158
+ **分页规则:**
159
+ - 首次请求不传 `cursor`
160
+ - `has_more` 为 `true` 时,将 `next_cursor` 作为下次请求的 `cursor` 传入
161
+ - `has_more` 为 `false` 时停止请求
162
+ - 分页过程中时间过滤参数保持不变
163
+ - **如果选择不继续翻页(比如当前页数据已经够用),必须告诉用户还有更多待办未显示,问用户是否需要继续查看**