weaver-work-cli 0.1.7 → 0.1.20

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 (264) hide show
  1. package/README.md +11 -11
  2. package/dist/cmd/action.js +76 -0
  3. package/dist/cmd/index.js +2 -0
  4. package/dist/cmd/refs/index.js +103 -0
  5. package/dist/cmd/register.js +31 -0
  6. package/dist/cmd/root.js +1 -0
  7. package/dist/cmd/setup/index.js +25 -5
  8. package/dist/cmd/skills/index.js +37 -5
  9. package/dist/core/connector.js +54 -0
  10. package/dist/core/context.js +2 -1
  11. package/dist/core/input.js +48 -0
  12. package/dist/core/output.js +298 -3
  13. package/dist/core/refs.js +432 -0
  14. package/dist/core/state.js +26 -0
  15. package/dist/internal/e10/auth/commands.js +2 -2
  16. package/dist/internal/e10/auth/session.js +14 -0
  17. package/dist/internal/e10/auth/xiaoe.js +116 -51
  18. package/dist/internal/e10/request-runtime.js +5 -0
  19. package/dist/internal/skills/install.js +148 -28
  20. package/dist/internal/skills/reader.js +12 -9
  21. package/dist/shortcuts/blog/continuation.js +74 -0
  22. package/dist/shortcuts/blog/errors.js +60 -0
  23. package/dist/shortcuts/blog/host.js +175 -0
  24. package/dist/shortcuts/blog/index.js +324 -0
  25. package/dist/shortcuts/blog/manifest.js +415 -0
  26. package/dist/shortcuts/blog/operations/comment.js +125 -0
  27. package/dist/shortcuts/blog/operations/comments.js +31 -0
  28. package/dist/shortcuts/blog/operations/edit.js +131 -0
  29. package/dist/shortcuts/blog/operations/export.js +46 -0
  30. package/dist/shortcuts/blog/operations/like.js +80 -0
  31. package/dist/shortcuts/blog/operations/publish.js +157 -0
  32. package/dist/shortcuts/blog/operations/query-user.js +58 -0
  33. package/dist/shortcuts/blog/operations/query.js +96 -0
  34. package/dist/shortcuts/blog/operations/registry.js +54 -0
  35. package/dist/shortcuts/blog/operations/remind.js +176 -0
  36. package/dist/shortcuts/blog/operations/shared.js +330 -0
  37. package/dist/shortcuts/blog/operations/types.js +16 -0
  38. package/dist/shortcuts/blog/operations.js +9 -0
  39. package/dist/shortcuts/caizhilian/continuation.js +70 -0
  40. package/dist/shortcuts/caizhilian/errors.js +53 -0
  41. package/dist/shortcuts/caizhilian/host.js +190 -0
  42. package/dist/shortcuts/caizhilian/index.js +186 -0
  43. package/dist/shortcuts/caizhilian/manifest.js +42 -0
  44. package/dist/shortcuts/caizhilian/operations/api.js +801 -0
  45. package/dist/shortcuts/caizhilian/operations/confirm.js +75 -0
  46. package/dist/shortcuts/caizhilian/operations/files.js +306 -0
  47. package/dist/shortcuts/caizhilian/operations/form.js +170 -0
  48. package/dist/shortcuts/caizhilian/operations/handlers/collab.js +611 -0
  49. package/dist/shortcuts/caizhilian/operations/handlers/document.js +890 -0
  50. package/dist/shortcuts/caizhilian/operations/handlers/file-collection.js +346 -0
  51. package/dist/shortcuts/caizhilian/operations/handlers/file-upload.js +192 -0
  52. package/dist/shortcuts/caizhilian/operations/handlers/fileops.js +570 -0
  53. package/dist/shortcuts/caizhilian/operations/handlers/folder.js +969 -0
  54. package/dist/shortcuts/caizhilian/operations/handlers/search.js +318 -0
  55. package/dist/shortcuts/caizhilian/operations/handlers/setting-attach.js +294 -0
  56. package/dist/shortcuts/caizhilian/operations/handlers/setting-backup.js +423 -0
  57. package/dist/shortcuts/caizhilian/operations/handlers/setting-encrypt.js +238 -0
  58. package/dist/shortcuts/caizhilian/operations/handlers/setting-storage.js +364 -0
  59. package/dist/shortcuts/caizhilian/operations/handlers/system.js +106 -0
  60. package/dist/shortcuts/caizhilian/operations/registry.js +151 -0
  61. package/dist/shortcuts/caizhilian/operations/shared.js +408 -0
  62. package/dist/shortcuts/caizhilian/operations/specs.js +623 -0
  63. package/dist/shortcuts/caizhilian/operations/types.js +57 -0
  64. package/dist/shortcuts/caizhilian/operations.js +21 -0
  65. package/dist/shortcuts/contract/continuation.js +70 -0
  66. package/dist/shortcuts/contract/errors.js +62 -0
  67. package/dist/shortcuts/contract/host.js +205 -0
  68. package/dist/shortcuts/contract/index.js +318 -0
  69. package/dist/shortcuts/contract/manifest.js +596 -0
  70. package/dist/shortcuts/contract/operations/clause-reference.js +78 -0
  71. package/dist/shortcuts/contract/operations/form-info.js +371 -0
  72. package/dist/shortcuts/contract/operations/read.js +118 -0
  73. package/dist/shortcuts/contract/operations/registry.js +43 -0
  74. package/dist/shortcuts/contract/operations/request.js +300 -0
  75. package/dist/shortcuts/contract/operations/shared.js +133 -0
  76. package/dist/shortcuts/contract/operations/subject.js +157 -0
  77. package/dist/shortcuts/contract/operations/template.js +81 -0
  78. package/dist/shortcuts/contract/operations/types.js +7 -0
  79. package/dist/shortcuts/contract/operations/workflow.js +52 -0
  80. package/dist/shortcuts/contract/operations/write.js +131 -0
  81. package/dist/shortcuts/contract/operations.js +8 -0
  82. package/dist/shortcuts/hrm/index.js +83 -2
  83. package/dist/shortcuts/hrm/operations/employee.js +160 -30
  84. package/dist/shortcuts/hrm/operations/org.js +17 -3
  85. package/dist/shortcuts/hrm/operations/position.js +18 -2
  86. package/dist/shortcuts/index.js +5 -1
  87. package/dist/shortcuts/invoice/index.js +74 -36
  88. package/dist/shortcuts/invoice/manifest.js +674 -4
  89. package/dist/shortcuts/invoice/markdown.js +172 -0
  90. package/dist/shortcuts/invoice/operations/add.js +3 -3
  91. package/dist/shortcuts/invoice/operations/delete.js +2 -2
  92. package/dist/shortcuts/invoice/operations/get.js +10 -2
  93. package/dist/shortcuts/invoice/operations/import.js +2 -2
  94. package/dist/shortcuts/invoice/operations/registry.js +8 -1
  95. package/dist/shortcuts/invoice/operations/reim-auto.js +719 -0
  96. package/dist/shortcuts/invoice/operations/reim.js +85 -2
  97. package/dist/shortcuts/invoice/operations/shared.js +75 -8
  98. package/dist/shortcuts/invoice/operations/update.js +2 -2
  99. package/dist/shortcuts/invoice/operations/upload-and-validate.js +93 -0
  100. package/dist/shortcuts/invoice/operations/validate-preview.js +2 -1
  101. package/dist/shortcuts/invoice/projection.js +328 -0
  102. package/dist/shortcuts/meeting/host.js +18 -1
  103. package/dist/shortcuts/meeting/manifest.js +30 -18
  104. package/dist/shortcuts/meeting/operations/eb/catalog.js +390 -0
  105. package/dist/shortcuts/meeting/operations/eb/conflict.js +389 -0
  106. package/dist/shortcuts/meeting/operations/eb/factory.js +389 -0
  107. package/dist/shortcuts/meeting/operations/eb/index.js +22 -0
  108. package/dist/shortcuts/meeting/operations/env.js +8 -1
  109. package/dist/shortcuts/meeting/operations/registry.js +2 -0
  110. package/dist/shortcuts/meeting/operations/signs.js +216 -2
  111. package/dist/shortcuts/workflow/endpoints.js +2 -1
  112. package/dist/shortcuts/workflow/errors.js +8 -2
  113. package/dist/shortcuts/workflow/host.js +6 -3
  114. package/dist/shortcuts/workflow/operations/form.js +931 -533
  115. package/dist/shortcuts/workflow/operations/read.js +462 -81
  116. package/dist/shortcuts/workflow/operations/shared.js +44 -0
  117. package/dist/shortcuts/workflow/operations/write.js +760 -56
  118. package/dist/shortcuts/workflow/operations.js +36 -10
  119. package/docs/_catalog.md +6 -0
  120. package/docs/agent-invoice.md +5 -1
  121. package/docs/agent-io-channel-design.md +468 -0
  122. package/docs/agent-skill-install.md +9 -4
  123. package/docs/blog.md +123 -0
  124. package/docs/caizhilian.md +304 -0
  125. package/docs/contract.md +91 -0
  126. package/docs/e10-auth.md +2 -2
  127. package/docs/hrm.md +19 -9
  128. package/docs/invoice.md +5 -1
  129. package/docs/meeting.md +1 -1
  130. package/docs/operation-manual.md +15 -3
  131. package/docs/skill-review-2026-09-19.md +2 -2
  132. package/package.json +2 -2
  133. package/scripts/package-skill.mjs +33 -20
  134. package/skill-template/business-info.json +113 -14
  135. package/skill-template/domains/blog.md +24 -0
  136. package/skill-template/domains/caizhilian.md +22 -0
  137. package/skill-template/domains/jinchengda.md +23 -0
  138. package/skill-template/domains/meeting.md +1 -1
  139. package/skill-template/domains/workflow.md +1 -1
  140. package/skill-template/skill-template.md +1 -1
  141. package/skills/weaver-e10-blog/SKILL.md +111 -0
  142. package/skills/weaver-e10-blog/references/blog-comment.md +51 -0
  143. package/skills/weaver-e10-blog/references/blog-comments.md +39 -0
  144. package/skills/weaver-e10-blog/references/blog-default-permission.md +38 -0
  145. package/skills/weaver-e10-blog/references/blog-disabled-capabilities.md +11 -0
  146. package/skills/weaver-e10-blog/references/blog-edit.md +51 -0
  147. package/skills/weaver-e10-blog/references/blog-export.md +42 -0
  148. package/skills/weaver-e10-blog/references/blog-like.md +50 -0
  149. package/skills/weaver-e10-blog/references/blog-publish.md +52 -0
  150. package/skills/weaver-e10-blog/references/blog-query-user.md +45 -0
  151. package/skills/weaver-e10-blog/references/blog-query.md +49 -0
  152. package/skills/weaver-e10-blog/references/blog-remind.md +51 -0
  153. package/skills/weaver-e10-blog/references/blog-resolve-users.md +38 -0
  154. package/skills/weaver-e10-blog/references/source-manifest.json +1540 -0
  155. package/skills/weaver-e10-caizhilian/SKILL.md +216 -0
  156. package/skills/weaver-e10-caizhilian/references/agent-entry.md +106 -0
  157. package/skills/weaver-e10-caizhilian/references/collaboration.md +112 -0
  158. package/skills/weaver-e10-caizhilian/references/document.md +111 -0
  159. package/skills/weaver-e10-caizhilian/references/file-collection.md +136 -0
  160. package/skills/weaver-e10-caizhilian/references/file-upload.md +309 -0
  161. package/skills/weaver-e10-caizhilian/references/files.md +120 -0
  162. package/skills/weaver-e10-caizhilian/references/folder.md +118 -0
  163. package/skills/weaver-e10-caizhilian/references/org-browser.md +104 -0
  164. package/skills/weaver-e10-caizhilian/references/setting-attach.md +410 -0
  165. package/skills/weaver-e10-caizhilian/references/setting-backup.md +372 -0
  166. package/skills/weaver-e10-caizhilian/references/setting-encrypt.md +399 -0
  167. package/skills/weaver-e10-caizhilian/references/setting-storage.md +603 -0
  168. package/skills/weaver-e10-caizhilian/references/source-manifest.json +5079 -0
  169. package/skills/weaver-e10-caizhilian/references/withheld.md +93 -0
  170. package/skills/weaver-e10-caizhilian/references/write-protocol.md +120 -0
  171. package/skills/weaver-e10-calendar/SKILL.md +4 -3
  172. package/skills/weaver-e10-ebuilder-form/SKILL.md +4 -9
  173. package/skills/weaver-e10-ebuilder-form/references/context-routing.md +0 -9
  174. package/skills/weaver-e10-ebuilder-form/references/custom-api.md +1 -5
  175. package/skills/weaver-e10-ebuilder-form/references/fields-browser.md +1 -5
  176. package/skills/weaver-e10-ebuilder-form/references/list-nlist.md +1 -5
  177. package/skills/weaver-e10-ebuilder-form/references/openapi-read.md +1 -5
  178. package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +1 -5
  179. package/skills/weaver-e10-esb/SKILL.md +2 -2
  180. package/skills/weaver-e10-esb/references/source-manifest.json +9 -9
  181. package/skills/weaver-e10-hrm/SKILL.md +54 -6
  182. package/skills/weaver-e10-hrm/references/employee.md +89 -15
  183. package/skills/weaver-e10-hrm/references/org.md +7 -4
  184. package/skills/weaver-e10-hrm/references/position.md +14 -7
  185. package/skills/weaver-e10-hrm/references/source-manifest.json +1 -1
  186. package/skills/weaver-e10-jinchengda/SKILL.md +166 -0
  187. package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +82 -0
  188. package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +69 -0
  189. package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +78 -0
  190. package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +27 -0
  191. package/skills/weaver-e10-jinchengda/references/contract-request-status.md +71 -0
  192. package/skills/weaver-e10-jinchengda/references/contract-request-write.md +94 -0
  193. package/skills/weaver-e10-jinchengda/references/contract-signing-subjects.md +89 -0
  194. package/skills/weaver-e10-jinchengda/references/contract-subject-create.md +77 -0
  195. package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +66 -0
  196. package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +94 -0
  197. package/skills/weaver-e10-jinchengda/references/source-manifest.json +259 -0
  198. package/skills/weaver-e10-jiuchuanhui/SKILL.md +5 -11
  199. package/skills/weaver-e10-jucailin/SKILL.md +4 -3
  200. package/skills/weaver-e10-mail/SKILL.md +4 -11
  201. package/skills/weaver-e10-meeting/SKILL.md +66 -32
  202. package/skills/weaver-e10-meeting/references/meeting-change.md +5 -2
  203. package/skills/weaver-e10-meeting/references/meeting-create.md +2 -1
  204. package/skills/weaver-e10-meeting/references/meeting-eb.md +114 -0
  205. package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +9 -8
  206. package/skills/weaver-e10-meeting/references/meeting-receipts-signs.md +35 -7
  207. package/skills/weaver-e10-meeting/references/meeting-update.md +1 -1
  208. package/skills/weaver-e10-okr/SKILL.md +6 -11
  209. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  210. package/skills/weaver-e10-plan/SKILL.md +3 -3
  211. package/skills/weaver-e10-plan/references/plan-collect-and-compose.md +1 -1
  212. package/skills/weaver-e10-plan/references/plan-overview-and-routing.md +1 -1
  213. package/skills/weaver-e10-plan/references/source-manifest.json +13 -13
  214. package/skills/weaver-e10-qiyecheng/SKILL.md +4 -10
  215. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +9 -9
  216. package/skills/weaver-e10-shared/SKILL.md +36 -25
  217. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +10 -31
  218. package/skills/weaver-e10-shared/references/json-output-contract.md +20 -11
  219. package/skills/weaver-e10-shijingran/SKILL.md +2 -1
  220. package/skills/weaver-e10-shijingran/references/source-manifest.json +9 -9
  221. package/skills/weaver-e10-skill-maker/SKILL.md +4 -10
  222. package/skills/weaver-e10-skill-maker/references/business-skill-generation.md +5 -3
  223. package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +12 -27
  224. package/skills/weaver-e10-skill-maker/references/module-gap-audit-and-repair.md +17 -5
  225. package/skills/weaver-e10-skill-maker/references/source-update-detection.md +4 -27
  226. package/skills/weaver-e10-wenshuding/SKILL.md +5 -16
  227. package/skills/weaver-e10-wenshuding/references/source-manifest.json +7 -7
  228. package/skills/weaver-e10-workflow/SKILL.md +32 -37
  229. package/skills/weaver-e10-workflow/references/source-manifest.json +40 -77
  230. package/skills/weaver-e10-workflow/references/workflow-batch.md +90 -29
  231. package/skills/weaver-e10-workflow/references/workflow-create.md +79 -109
  232. package/skills/weaver-e10-workflow/references/workflow-memory.md +19 -9
  233. package/skills/weaver-e10-workflow/references/workflow-operate.md +2 -2
  234. package/skills/weaver-e10-workflow/references/workflow-query.md +37 -20
  235. package/skills/weaver-e10-workflow/references/workflow-share.md +18 -2
  236. package/skills/weaver-e10-workflow/references/workflow-view.md +4 -4
  237. package/skills/weaver-e10-yepiaotong/SKILL.md +75 -39
  238. package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +22 -1
  239. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +3 -1
  240. package/skills/weaver-e10-yepiaotong/references/invoice-issuing.md +5 -5
  241. package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +135 -0
  242. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +15 -3
  243. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +1 -1
  244. package/skills/weaver-e10-yepiaotong/references/invoice-summarize.py +217 -0
  245. package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +88 -0
  246. package/skills/weaver-e10-yepiaotong/references/invoice-validation-preview.md +7 -2
  247. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +90 -10
  248. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +1 -0
  249. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +70 -49
  250. package/skills/weaver-e10-yepiaotong/references/reim-fast-path.md +119 -0
  251. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +55 -36
  252. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +4 -0
  253. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +149 -0
  254. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +125 -5
  255. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +430 -63
  256. package/skills/weaver-e10-yimiaoban/SKILL.md +4 -12
  257. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
  258. package/skills/weaver-e10-ziguanjia/SKILL.md +2 -1
  259. package/skills/weaver-e10-ziguanjia/references/ziguanjia-agent-entry.md +3 -3
  260. package/tools/weaver-skill-detector-1.0.13/SKILL.md +9 -9
  261. package/tools/weaver-skill-detector-1.0.13/references/checklist.md +3 -3
  262. package/tools/weaver-skill-detector-1.0.13/scripts/__pycache__/validate_skill.cpython-313.pyc +0 -0
  263. package/tools/weaver-skill-detector-1.0.13/scripts/validate_skill.py +98 -91
  264. package/scripts/sync-connector-skills.mjs +0 -172
@@ -113,16 +113,16 @@ weaver-work-cli --profile PROFILE_NAME auth status
113
113
 
114
114
  ## 5. 安装已有业务模块 Skill
115
115
 
116
- ### 5.1 安装到 Codex 默认目录
116
+ ### 5.1 安装到当前 Agent
117
117
 
118
118
  ```text
119
119
  weaver-work-cli skills install yepiaotong
120
120
  weaver-work-cli skills install wenshuding
121
121
  ```
122
122
 
123
- 默认目标目录优先使用环境变量 `CODEX_HOME` 下的 `skills` 子目录;未设置 `CODEX_HOME` 时使用用户主目录下的 `.codex/skills`(Windows PowerShell 示例:`$env:USERPROFILE\.codex\skills`)。安装非 shared 业务 Skill 时,CLI 会自动带上 `weaver-e10-shared`。
123
+ CLI 优先使用 `--target-dir` 或通用环境变量 `WEAVER_SKILLS_ROOT`。未显式指定时,会根据当前进程的 Codex/WorkBuddy 环境信号选择当前用户的 skills 目录;如果宿主不明确、存在多个候选目录,或者当前为其它 Agent 且未提供路径,则停止安装并要求显式指定,避免装错位置。安装非 shared 业务 Skill 时,CLI 会自动带上 `weaver-e10-shared`。
124
124
 
125
- ### 5.2 安装到 WorkBuddy 或其它 Agent
125
+ ### 5.2 显式安装到 WorkBuddy 或其它 Agent
126
126
 
127
127
  Windows PowerShell:
128
128
 
@@ -152,6 +152,18 @@ macOS/Linux(bash/zsh):
152
152
  weaver-work-cli skills install MODULE_NAME --target-dir "/path/to/agent-skills"
153
153
  ```
154
154
 
155
+ 经常使用同一 Agent 时,也可以设置通用目录环境变量:
156
+
157
+ ```powershell
158
+ $env:WEAVER_SKILLS_ROOT = "$env:USERPROFILE\.other-agent\skills"
159
+ weaver-work-cli skills install MODULE_NAME
160
+ ```
161
+
162
+ ```bash
163
+ export WEAVER_SKILLS_ROOT="$HOME/.other-agent/skills"
164
+ weaver-work-cli skills install MODULE_NAME
165
+ ```
166
+
155
167
  `<module>` 可以传短名,例如 `yepiaotong`、`wenshuding`、`skill-maker`,也可以传完整名,例如 `weaver-e10-yepiaotong`。传 `all` 会安装包内全部 Skill。
156
168
 
157
169
  ### 5.3 验证安装结果
@@ -38,13 +38,13 @@
38
38
  | 13 | jucailin「三个子系统」与实际列出的四个业务域矛盾 | 改为「四个子系统(人事档案/出勤/薪酬/招聘)」 |
39
39
  | 14 | shared SKILL.md 存在整句重复;登录依赖表述与 CLI 现状(auth 托管)冲突 | 去重并与现状对齐 |
40
40
  | 15 | qiyecheng manifest 残留开发者个人路径 `/Users/zhufangyuan/...` | 脱敏为占位 |
41
- | 16 | connector 版依赖声明错误:`weaver-e10-login` 被错写成重复的 `weaver-e10-shared-connector` | 修正为 login + shared-connector |
41
+ | 16 | connector 版依赖声明仍保留旧 login 兼容项 | 修正为 shared-connector |
42
42
 
43
43
  ## 四、规则遵从性(硬规则 / 门禁 BLOCK)
44
44
 
45
45
  | # | 问题 | 修复 |
46
46
  |---|---|---|
47
- | 17 | **7 个接口型 skill 未声明 `weaver-e10-login` 依赖,且未写明请求头三件套**(B10a / B10c,BLOCK) | jiuchuanhui / mail / meeting / okr / qiyecheng / skill-maker / workflow 全部补齐,统一新增「认证与请求头契约」章节 |
47
+ | 17 | **7 个接口型 skill 未声明 `weaver-e10-shared` 依赖,且未写明请求头三件套**(B10a / B10c,BLOCK) | jiuchuanhui / mail / meeting / okr / qiyecheng / skill-maker / workflow 全部补齐,统一新增「认证与请求头契约」章节 |
48
48
  | 18 | plan description 246 字,超 200 字上限 | 压到 164 字,触发词保留 |
49
49
  | 19 | 改写登录红线时误触发 B10b(该规则无否定豁免,写成「禁止 Playwright/扫码…」也会被判违规) | 去掉敏感词枚举,改为不含触发词的表述 |
50
50
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weaver-work-cli",
3
- "version": "0.1.7",
3
+ "version": "0.1.20",
4
4
  "description": "面向泛微工作工具链的可扩展 TypeScript CLI 基础框架(E10 业票通等能力)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -49,4 +49,4 @@
49
49
  "tsx": "^4.19.0",
50
50
  "typescript": "^5.6.0"
51
51
  }
52
- }
52
+ }
@@ -13,7 +13,6 @@ const skillTemplateRoot = path.join(repositoryRoot, 'skill-template')
13
13
  const productMetadataPath = path.join(skillTemplateRoot, 'product.json')
14
14
  const packageJsonPath = path.join(repositoryRoot, 'package.json')
15
15
  const sharedSkillName = 'weaver-e10-shared'
16
- const legacySharedSkillName = 'weaver-work-cli-shared'
17
16
  const skillPrefix = 'weaver-e10-'
18
17
  const legacySkillPrefix = 'weaver-work-cli-'
19
18
  const [requestedSkillArg, outputArg] = process.argv.slice(2)
@@ -77,6 +76,7 @@ function defaultOutput(skillNames) {
77
76
  function shouldSkip(entry, relativePath) {
78
77
  if (entry.name === '.DS_Store' || entry.name.startsWith('.')) return true
79
78
  if (relativePath === 'product.json') return true
79
+ if (relativePath === 'references/source-manifest.json') return true
80
80
  if (entry.isDirectory() && ['assets', 'node_modules', 'scripts'].includes(entry.name)) return true
81
81
  return false
82
82
  }
@@ -87,6 +87,31 @@ function assertSafeRelativePath(relativePath) {
87
87
  }
88
88
  }
89
89
 
90
+ function assertSkillFrontmatter(skillName, content) {
91
+ const normalized = content.replace(/\r\n/g, '\n')
92
+ const lines = normalized.split('\n')
93
+ if (lines[0] !== '---') {
94
+ throw new Error(`${skillName}/SKILL.md 缺少 YAML frontmatter:文件必须以 --- 开头`)
95
+ }
96
+
97
+ const end = lines.indexOf('---', 1)
98
+ if (end < 0) {
99
+ throw new Error(`${skillName}/SKILL.md 缺少 YAML frontmatter 结束标记 ---`)
100
+ }
101
+
102
+ const frontmatter = lines.slice(1, end).join('\n')
103
+ const nameMatch = frontmatter.match(/^name:\s*["']?([^"'\n]+?)["']?\s*$/m)
104
+ if (!nameMatch) {
105
+ throw new Error(`${skillName}/SKILL.md 的 YAML frontmatter 缺少 name`)
106
+ }
107
+ if (nameMatch[1] !== skillName) {
108
+ throw new Error(`${skillName}/SKILL.md 的 frontmatter name 必须等于目录名 ${skillName}`)
109
+ }
110
+ if (!/^description:\s*\S/m.test(frontmatter)) {
111
+ throw new Error(`${skillName}/SKILL.md 的 YAML frontmatter 缺少 description`)
112
+ }
113
+ }
114
+
90
115
  function crc32(buffer) {
91
116
  let crc = 0xffffffff
92
117
  for (const byte of buffer) {
@@ -184,11 +209,6 @@ async function createZipArchive(root, entries) {
184
209
  return Buffer.concat([...localParts, centralDirectory, end])
185
210
  }
186
211
 
187
- function rewriteSkillContent(skillName, relativePath, content) {
188
- if (skillName !== legacySharedSkillName || relativePath !== 'SKILL.md') return content
189
- return content.replace(/^name:\s*weaver-e10-shared\s*$/mu, `name: ${legacySharedSkillName}`)
190
- }
191
-
192
212
  async function loadProductMetadata() {
193
213
  const product = JSON.parse(await readFile(productMetadataPath, 'utf8'))
194
214
  const packageInfo = JSON.parse(await readFile(packageJsonPath, 'utf8'))
@@ -218,10 +238,11 @@ async function writeProductMetadata(packageRoot, packagedEntries, packageName, p
218
238
  packagedEntries.push(`${packageName}/product.json`)
219
239
  }
220
240
 
221
- async function copySkill(skillName, stagingRoot, packagedEntries, productMetadata, packageName = skillName) {
241
+ async function copySkill(skillName, stagingRoot, packagedEntries, productMetadata) {
222
242
  const sourceRoot = path.join(skillsRoot, skillName)
223
- const packageRoot = path.join(stagingRoot, packageName)
224
- await stat(path.join(sourceRoot, 'SKILL.md'))
243
+ const packageRoot = path.join(stagingRoot, skillName)
244
+ const skillMarkdown = await readFile(path.join(sourceRoot, 'SKILL.md'), 'utf8')
245
+ assertSkillFrontmatter(skillName, skillMarkdown)
225
246
 
226
247
  async function copyDir(relativeDir = '') {
227
248
  const sourceDir = path.join(sourceRoot, relativeDir)
@@ -240,19 +261,14 @@ async function copySkill(skillName, stagingRoot, packagedEntries, productMetadat
240
261
  await copyDir(relativePath)
241
262
  } else if (entry.isFile()) {
242
263
  await mkdir(path.dirname(target), { recursive: true, mode: 0o700 })
243
- if (packageName === skillName) {
244
- await copyFile(source, target)
245
- } else {
246
- const content = await readFile(source, 'utf8')
247
- await writeFile(target, rewriteSkillContent(packageName, relativePath, content))
248
- }
249
- packagedEntries.push(`${packageName}/${relativePath}`)
264
+ await copyFile(source, target)
265
+ packagedEntries.push(`${skillName}/${relativePath}`)
250
266
  }
251
267
  }
252
268
  }
253
269
 
254
270
  await copyDir()
255
- await writeProductMetadata(packageRoot, packagedEntries, packageName, productMetadata)
271
+ await writeProductMetadata(packageRoot, packagedEntries, skillName, productMetadata)
256
272
  }
257
273
 
258
274
  const skillNames = await resolveSkillNames()
@@ -267,9 +283,6 @@ try {
267
283
  await mkdir(path.dirname(output), { recursive: true, mode: 0o700 })
268
284
  for (const skillName of skillNames) {
269
285
  await copySkill(skillName, stagingRoot, packagedEntries, productMetadata)
270
- if (skillName === sharedSkillName) {
271
- await copySkill(skillName, stagingRoot, packagedEntries, productMetadata, legacySharedSkillName)
272
- }
273
286
  }
274
287
 
275
288
  await rm(output, { force: true })
@@ -207,23 +207,26 @@
207
207
  ],
208
208
  "weaver-e10-ebuilder-form": [
209
209
  "eBuilder",
210
- "ebuilder",
211
- "EB表单",
212
- "表单",
213
- "数据列表",
214
- "表格",
215
- "列表数据",
210
+ "eBuilder表单",
211
+ "表单数据",
212
+ "表单查询",
213
+ "表单新增",
214
+ "表单修改",
215
+ "表单删除",
216
+ "eBuilder菜单",
216
217
  "菜单定位",
217
- "字段定义",
218
+ "List列表",
219
+ "NList列表",
220
+ "表单字段",
218
221
  "浏览字段",
219
- "人员字段",
220
- "部门字段",
221
- "表单数据",
222
- "自定义接口",
222
+ "选项字段",
223
+ "主明细映射",
223
224
  "OpenAPI",
224
- "新增表单数据",
225
- "修改表单数据",
226
- "删除表单数据"
225
+ "自定义接口",
226
+ "objId",
227
+ "interfacePk",
228
+ "表单分页",
229
+ "表单详情"
227
230
  ],
228
231
  "weaver-e10-shared": [
229
232
  "安装",
@@ -355,5 +358,101 @@
355
358
  "修改流程表单",
356
359
  "智能分组",
357
360
  "待办统计"
361
+ ],
362
+ "weaver-e10-blog": [
363
+ "日报",
364
+ "工作日报",
365
+ "写日报",
366
+ "查日报",
367
+ "提交日报",
368
+ "提交情况",
369
+ "补交",
370
+ "未提交",
371
+ "未交日报",
372
+ "催交",
373
+ "提醒交日报",
374
+ "日报提醒",
375
+ "下属日报",
376
+ "我关注的人",
377
+ "关注人员日报",
378
+ "日报评论",
379
+ "日报点赞",
380
+ "导出日报",
381
+ "日报报表",
382
+ "编辑日报",
383
+ "发布日报"
384
+ ],
385
+ "weaver-e10-caizhilian": [
386
+ "采知连",
387
+ "文档中心",
388
+ "知识库",
389
+ "公共知识库",
390
+ "个人知识库",
391
+ "虚拟知识库",
392
+ "在线文档",
393
+ "文档检索",
394
+ "文档搜索",
395
+ "建文档",
396
+ "新建文档",
397
+ "HTML 文档",
398
+ "Markdown 文档",
399
+ "Office 文档",
400
+ "上传建文档",
401
+ "文档详情",
402
+ "文档正文",
403
+ "替换正文",
404
+ "更新正文",
405
+ "修改文档字段",
406
+ "变更作者",
407
+ "文档作者",
408
+ "文件夹",
409
+ "虚拟文件夹",
410
+ "文件夹权限",
411
+ "文档权限",
412
+ "下载权限",
413
+ "默认共享",
414
+ "文档默认共享",
415
+ "标签",
416
+ "参与人",
417
+ "文档共享",
418
+ "共享设置",
419
+ "取消共享",
420
+ "附件",
421
+ "上传附件",
422
+ "替换附件",
423
+ "下载附件",
424
+ "附件转 PDF",
425
+ "封面",
426
+ "设置封面",
427
+ "移除封面",
428
+ "文档比对",
429
+ "比对链接",
430
+ "组织架构",
431
+ "人员检索",
432
+ "部门",
433
+ "子部门",
434
+ "岗位",
435
+ "角色",
436
+ "外部联系人",
437
+ "当前用户",
438
+ "系统健康检查",
439
+ "采知连接口连通性"
440
+ ],
441
+ "weaver-e10-jinchengda": [
442
+ "合同",
443
+ "合同管理",
444
+ "合同类型",
445
+ "合同模板",
446
+ "合同条款",
447
+ "条款引用",
448
+ "签约主体",
449
+ "合同审批",
450
+ "发起审批",
451
+ "保存审批",
452
+ "提交审批",
453
+ "催办",
454
+ "审批进度",
455
+ "审批意见",
456
+ "今承达"
358
457
  ]
359
458
  }
@@ -0,0 +1,24 @@
1
+ 本业务域用于 E10 工作日报(blog)。入口 `SKILL.md` 按 weaver 风格组织:CRITICAL 共享前置、路由优先级、高优先级语义、逐 operation 命令表、处理链、执行原则、写操作失败决策树和「不在范围」。具体用法拆到 `references/`:
2
+
3
+ - `blog-query.md`:群体日报查询(`user_type` 四档:直接/间接/全部下属、我关注的人),客户端窗口裁剪与 `not_submitted` 口径。
4
+ - `blog-query-user.md`:单人日报逐日扫描(`detailsByDate`,区间上限 62 天),`submit_status` 判定与 62 天上限报错。
5
+ - `blog-resolve-users.md`:HRM 按姓名精确解析 `user_id`(取 `id` 字段,不是 `userid`)。
6
+ - `blog-comments.md`:查某条日报的评论列表。
7
+ - `blog-default-permission.md`:查某日期的默认共享对象,供发布时回填 `permissionList`。
8
+ - `blog-export.md`:导出日报报表为 xlsx,本地文件写入与拒绝覆盖策略。
9
+ - `blog-publish.md`:发布日报的 `prepare -> apply` 写入协议(含写前查重与默认共享回填)。
10
+ - `blog-edit.md`:编辑指定日期日报的 `prepare -> apply` 写入协议(含目标指纹校验)。
11
+ - `blog-comment.md`:评论指定日报的 `prepare -> apply` 写入协议(含评论列表回查)。
12
+ - `blog-like.md`:点赞与取消点赞的 `prepare -> apply` 写入协议。
13
+ - `blog-remind.md`:提醒提交日报的 `prepare -> apply` 写入协议,默认文案与逐人发送语义。
14
+ - `blog-disabled-capabilities.md`:按 userId 批量查个人、`unRead`、EB 日报接口族、删除、撤回提醒等未暴露能力的处理边界。
15
+
16
+ Agent 调优重点:
17
+
18
+ - `weaver-work-cli blog schema` 是 operation 合约第一信息源。
19
+ - 查指定个人只能用 `blog.query_user`;`filter.userIds` 被服务端忽略,按 userId 列表查会静默返回登录人自己的日报。
20
+ - 补交状态统一由 CLI 判定为 `正常` / `补交` / `未提交`,不使用服务端 `later` 字段口径。
21
+ - 业务输入不得包含 Cookie、ETEAMSID、Token 或内部控制字段。
22
+ - 写操作只接受 CLI 生成的 continuation,不手工构造或复用;`apply` 一律要求 `confirm=true`。
23
+ - 结果为 `partial/write_uncertain` 时停止,不自动重放写请求,先用 `blog.query_user` 只读回查。
24
+ - 导出属于本地文件写入:`output` 指向已存在文件时 CLI 拒绝覆盖。
@@ -0,0 +1,22 @@
1
+ 本业务域用于 E10 采知连(文档中心 / 知识库)。入口 `SKILL.md` 按飞书 `lark-approval` 风格组织:CRITICAL 共享前置、登录与请求头凭证契约、路由优先级、高优先级语义、逐 operation 命令表、处理链、执行原则、写操作失败决策树和「不在范围」。具体用法拆到 `references/`:
2
+
3
+ - `agent-entry.md`:schema / operations 入口、统一 `caizhilian run` 调用方式、`--input-json` 与 `--input <path>` 选择、成功与失败 envelope、完整错误码表。
4
+ - `document.md`:文档检索、文档详情、当前登录人,以及 HTML / Markdown / Office / 批量上传四种建文档方式与四种编辑(基础字段、作者、保存正文、替换正文)。
5
+ - `folder.md`:文件夹创建、虚拟文件夹检索、文件夹默认设置,以及默认共享与八类文档权限(含 `Premisstion` 源拼写与按权限反查)。
6
+ - `collaboration.md`:标签(公共/个人)、参与人、文档共享的查询与增删,含 `share.add` 的「已存在」语义与 `share_entry_id` 用法。
7
+ - `org-browser.md`:人员/部门/分部/外部人员/岗位/角色/客户/客户类型八类浏览器检索与当前登录人,用于把名称解析成 ID。
8
+ - `files.md`:附件上传/替换/下载(含转 PDF)、封面上传/设置/移除、文档比对(检索、文件对象、上传、提交拿 `compare_link`)。
9
+ - `write-protocol.md`:prepare → apply 四步链路、continuation 票据约束与全部票据类错误码、写结果不确定的决策树。
10
+ - `withheld.md`:4 个不提供的系统操作(环境列表 / 配置快照 / 配置重载 / 环境切换)与源 Skill 范围外模块,以及源基础设施脚本的等价替换说明。
11
+
12
+ Agent 调优重点:
13
+
14
+ - `weaver-work-cli caizhilian schema` 是 operation、字段与风险等级的合约第一信息源;`caizhilian operations` 给出按资源分组的能力目录与 `withheldOperations`。
15
+ - 业务输入不得包含 Cookie、ETEAMSID、Token 或内部控制字段;认证只走 `weaver-work-cli auth ...`。
16
+ - ID 一律来自查询:`doc_id` 来自检索或详情,`folder_id` 来自 `folder.query-by-name`,人员与部门 ID 来自 `org.search-*`,权限与共享的合法取值来自 `*.form` / `*.list`。
17
+ - 枚举拼写 1:1 沿用源接口,权限键是 `deletePremisstion` / `downloadPremisstion` / `newCreateDocPremisstion` / `newCreateFolderPremisstion`,不要「纠正」成 `Permission`。
18
+ - 写操作只接受 CLI 生成的 continuation,不手工构造、不跨操作复用;apply 入参必须与 prepare 逐字一致,票据有效期 10 分钟。
19
+ - 分页 `has_next` 按「本页条数 >= page_size」判定,服务端 `total` 不可信;列表默认小页,回复只给摘要。
20
+ - 附件、封面图片、正文文件属于用户私有数据:上传下载前必须提醒文件可能进入大模型上下文并取得明确确认;文件内容不得读入上下文,只引用路径与元数据。
21
+ - 上传与下载是长耗时操作(120 秒超时、下载上限 100MB),一次只跑一个,不并发批量传输。
22
+ - 结果为 `partial/write_uncertain`、网络中断或回查不一致时停止,最多补一次只读回查,不自动重放写请求。
@@ -0,0 +1,23 @@
1
+ 本业务域用于泛微 E10 今承达合同管理。入口 `SKILL.md` 按飞书 `lark-approval` 风格组织:CRITICAL 共享前置、路由优先级、选命令表、处理链、执行原则、写操作失败决策树和“不在本 skill 范围”。具体用法拆到 `references/`:
2
+
3
+ - `contract-agent-entry.md`:schema、`contract run` 统一入口、退出码与输入方式。
4
+ - `contract-template-selector.md`:合同类型树、模板分类树、模板列表与模板详情。
5
+ - `contract-clause-recommender.md`:条款标签、条款分类树、条款搜索、条款列表与条款组。
6
+ - `contract-clause-reference-save.md`:已引用条款查询与条款引用写入的 `prepare -> apply` 协议。
7
+ - `contract-signing-subjects.md`:应用 Tag、表单 Tag、字段定义、字段选项与签约主体查询。
8
+ - `contract-subject-create.md`:新建签约主体的 `prepare -> apply` 写入协议。
9
+ - `contract-workflow-discovery.md`:workflowId、表单字段与字段选项的运行时解析链。
10
+ - `contract-request-write.md`:创建、保存、提交、催办四个写操作的确认链与错误边界。
11
+ - `contract-request-status.md`:流程状态、签字意见与 `flowStatus.code` 枚举。
12
+ - `contract-disabled-capabilities.md`:企业资信、撤回/退回等未实现能力的处理边界。
13
+ - `source-manifest.json`:源资料指纹,用于后续更新检测。
14
+
15
+ Agent 调优重点:
16
+
17
+ - `weaver-work-cli contract schema` 是 operation 合约第一信息源。
18
+ - 业务输入不得包含 `userid`、`userId`、Cookie、ETEAMSID、Token 或内部控制字段,用户 ID 由 CLI 从会话注入。
19
+ - 环境相关 ID(`appId`、`objId`、`formId`、`workflowId`、`nodeId`)必须运行时解析,未找到就停止,不使用标准环境 ID 兜底。
20
+ - 各接口成功码不统一(`code=0`、`code=200`、`message.code="0"`、`message.errcode="0"`),HTTP 200 不等于业务成功。
21
+ - 写操作只接受 CLI 生成的 continuation,不手工构造或复用;提交审批与催办需要与“创建并保存”分开的第二次确认。
22
+ - 提交后必须回读 `contract.request.status` 的 `flowStatus.code`(1 审批中 / 3 已归档)才算生效。
23
+ - 结果为 `partial/write_uncertain` 时停止,不自动重放写请求。
@@ -1,3 +1,3 @@
1
1
  # 会议(meeting)业务域
2
2
 
3
- 会议域覆盖 E10 标准版会议应用:环境模式探测、会议列表、会议室与占用视图、会议类型、冲突检测、预约会议(prepare/apply 确认链)、回执与签到查询。入口 `SKILL.md` 只做路由;具体命令、字段约束与失败处理拆到 `references/`(meeting-queries / meeting-create / meeting-receipts-signs)。关键安全边界:预约与回执更新是高风险写,必须走 prepare→用户确认→apply;冲突命中(含仅提醒)绝不提供"强制新建"选项;EB 版链路与工作流建会在 v1 未实现,见 manifest 的 withheldOperations。
3
+ 会议域覆盖 E10 标准版会议应用:环境模式探测、会议列表、会议室与占用视图、会议类型、冲突检测、预约会议(prepare/apply 确认链)、回执与签到查询。入口 `SKILL.md` 只做路由;具体命令、字段约束与失败处理拆到 `references/`(meeting-queries / meeting-create / meeting-receipts-signs)。关键安全边界:预约与回执更新是高风险写,必须走 prepare→用户确认→apply;冲突命中严格按应用设置处置(禁止提交→直接拒绝;仅提醒→告知用户,用户坚持时仍可继续提交);EB 版链路与工作流建会在 v1 未实现,见 manifest 的 withheldOperations。
@@ -6,7 +6,7 @@
6
6
  - `workflow-operate.md`:单条流程同意/提交/退回/转办/委托/转发/抄送/加审/收回/结束/征询/删除/催办的 `prepare -> apply` 写入协议。
7
7
  - `workflow-batch.md`:批量提交/置已读/催办/共享/转发/退回的 6 个**单命令**写入协议。
8
8
  - `workflow-share.md`:单条流程共享给人员/部门/分部/群组/角色/岗位/所有人的 `prepare -> apply` 写入协议。
9
- - `workflow-create.md`:发起流程的 `createList -> createForm -> createPrepare -> createApply` 确认链。
9
+ - `workflow-create.md`:发起流程的 `createForm -> createRequest` 两条命令链(工作流解析、载入表单、必填校验与落盘收敛在命令内部)。
10
10
  - `workflow-edit.md`:修改已存在流程表单的 `editLoad -> editPrepare -> editApply` 确认链。
11
11
  - `workflow-memory.md`:记忆偏好读取、`oaContext`(OA 版本 + 当前用户身份)与语义记忆保存。
12
12
  - `source-manifest.json`:源资料指纹、sourceChunks、operationImpact 与生成产物基线,供源资料更新检测。
@@ -13,7 +13,7 @@ requires:
13
13
  cliHelp: "weaver-work-cli {{command}} --help"
14
14
  ---
15
15
 
16
- **CRITICAL — 开始前 MUST 先用 Read 工具读取 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md),其中包含安装、E10 认证、JSON 输出和高风险写入规则。若不存在则必须先执行 `weaver-work-cli skills install shared --skills-dir <当前Agent的Skills目录>`,若 CLI 未安装则先执行 `npm install -g weaver-work-cli`,安装或读取失败时必须停止执行。**
16
+ **CRITICAL — 开始前 MUST 先用 Read 工具读取 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md),其中包含安装、E10 认证、JSON 输出和高风险写入规则。若共享规则不存在、CLI 未安装或读取失败,说明本技能的必需依赖缺失,必须先提示用户先补齐 `weaver-work-cli` 与共享 skill `weaver-e10-shared`(不补齐本技能无法执行),并把下面两条待执行命令原样完整展示给用户;Agent 不能自行安装——必须先取得用户明确确认后再执行。用户确认后按顺序执行且仅执行一次:① 缺 CLI 时执行 `npm install -g weaver-work-cli`;② 再执行 `weaver-work-cli skills install shared --target-dir <SKILLS_ROOT>` 装回共享 skill,`<SKILLS_ROOT>` 取本 SKILL.md 所在目录的上一级绝对目录(即与本技能同级的 skills 根目录),不要省略 `--target-dir`——省略会装进默认目录,导致本技能依然读不到共享规则。安装或读取失败时必须停止执行;命令均成功后重新读取共享规则,仍读不到就停止并把结果报告用户,不得凭猜测继续。**
17
17
  认证和登录态只能按共享规则通过 `weaver-work-cli auth ...` 命令判断;禁止直接读取、列出、打印或解析用户主目录下的旧 `.e10-cli`、auth、config 或 Keychain 数据。
18
18
  所有命令通过 `weaver-work-cli --json {{command}} run <operation>` 执行:简单 JSON 优先传 `--input-json '<json>'`,复杂或多行 JSON 先写入 UTF-8 文件再传 `--input <path>`,只有确认当前 shell 能稳定传管道时才使用 `--input -`。调用前先按需读取 references 下对应的文件,查参数结构,不要猜字段;**references 是第一信息源**,`weaver-work-cli {{command}} schema` 是 operation、字段和风险等级的合约来源。
19
19
  若 `schema` 或 reference 提供 `inputExamples`,优先复用其中和当前意图最接近的样例并只替换用户明确给出的值;标记为 `synthetic` 的样例需要业务复核,不能当作源资料事实。若 operation 标记了 `missingExamples` 或参数覆盖矩阵中的 `needs-confirmation` 字段,先向用户说明缺少哪些入参事实并索取补充,不要通过反复尝试不同 JSON 格式来猜。
@@ -0,0 +1,111 @@
1
+ ---
2
+ name: weaver-e10-blog
3
+ display_name: 泛微E10工作日报
4
+ display_name_en: Weaver E10 Daily Report
5
+ description: "泛微 E10 工作日报的查询、发布、编辑、评论、点赞、提醒与 Excel 导出能力,通过 weaver-work-cli blog 命令执行。"
6
+ description_zh: "泛微 E10 工作日报全流程:群体日报查询(下属/关注)、单人日报查询、HRM 姓名解析、评论查询、默认共享查询、日报导出 xlsx,以及发布、编辑、评论、点赞、提醒的 prepare -> apply 写入确认链。"
7
+ description_en: "Full lifecycle of Weaver E10 daily reports: group and personal queries, HRM name resolution, comments, default sharing, Excel export, and prepare -> apply confirmation chains for publish, edit, comment, like, and remind operations."
8
+ version: 1.0.0
9
+ author: 泛微网络科技股份有限公司
10
+ agent_created: true
11
+ requires:
12
+ bins: ["weaver-work-cli"]
13
+ cliHelp: "weaver-work-cli blog --help"
14
+ ---
15
+
16
+ # weaver-work-cli 日报助手
17
+
18
+ **CRITICAL — 开始前 MUST 先用 Read 工具读取 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md),其中包含安装、E10 认证、JSON 输出和高风险写入规则。若共享规则不存在、CLI 未安装或读取失败,说明本技能的必需依赖缺失,必须先提示用户先补齐 `weaver-work-cli` 与共享 skill `weaver-e10-shared`(不补齐本技能无法执行),并把下面两条待执行命令原样完整展示给用户;Agent 不能自行安装——必须先取得用户明确确认后再执行。用户确认后按顺序执行且仅执行一次:① 缺 CLI 时执行 `npm install -g weaver-work-cli`;② 再执行 `weaver-work-cli skills install shared --target-dir <SKILLS_ROOT>` 装回共享 skill,`<SKILLS_ROOT>` 取本 SKILL.md 所在目录的上一级绝对目录(即与本技能同级的 skills 根目录),不要省略 `--target-dir`——省略会装进默认目录,导致本技能依然读不到共享规则。命令均成功后重新读取共享规则;仍读不到就停止并把结果报告用户,不得凭猜测继续。**
19
+ **`--is-connector` 判据**:用户明确使用连接器、或上下文要求用连接器完成任务 → 传 `true`;本次任务或上下文直接选择单独技能 → 不传;用户没有明确说明时,按**正在运行的这份 Skill 是哪一级**定——**用户级(条目标 `(user)`)不传,连接器级(标 `(connector)`)传**(同名 Skill 只会运行用户级那一份)。传 `true` 时不要再写 `--profile` / `--base-url`。完整规则见 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md)。
20
+
21
+ 认证和登录态只能按共享规则通过 `weaver-work-cli auth ...` 命令判断;禁止直接读取、列出、打印或解析用户主目录下的旧 `.e10-cli`、auth、config 或 Keychain 数据。
22
+ 所有命令通过 `weaver-work-cli --json blog run <operation>` 执行:简单 JSON 优先传 `--input-json '<json>'`,复杂或多行 JSON 先写入 UTF-8 文件再传 `--input <path>`,只有确认当前 shell 能稳定传管道时才使用 `--input -`。调用前先按需读取 references 下对应文件;**references 是第一信息源**,`weaver-work-cli blog schema` 是 operation、字段和风险等级的合约来源,不要靠反复尝试不同 JSON 格式来猜字段。
23
+ 命令示例、提示词和临时说明必须同时兼容 Windows 和 macOS/Linux;涉及 JSON 输入、用户目录、路径分隔符、Python 启动器、文件删除、目录查看或文件比对时,同时给 Windows PowerShell 与 macOS/Linux(bash/zsh)两套示例。Agent 先根据当前系统和 shell 选择对应示例,不确定时用 `node -p "process.platform"` 判断。Windows/PowerShell 下不要使用 `printf`、`$HOME/...`、`~/...`、bash 反斜杠续行、`rm/ls/diff/python3` 等 Unix-only 写法。
24
+
25
+ ## 适用场景与触发条件
26
+
27
+ 触发条件:用户提到「日报」「工作日报」「写日报」「查日报」「日报补交」「未提交日报」「催交日报」「提醒交日报」「下属日报」「我关注的人的日报」「日报评论」「点赞日报」「导出日报」「日报 Excel」等意图,或需要把某人姓名解析为 E10 人员后再查日报。
28
+
29
+ 典型适用场景:
30
+ - 查询下属/关注人群体的日报提交与补交情况(blog.query)
31
+ - 按日期区间逐日查询单人日报与提交状态(blog.query_user)
32
+ - 把姓名、工号模糊信息解析成 E10 userId(blog.resolve_users)
33
+ - 查询某篇日报的评论(blog.comments)、导出日报 Excel(blog.export)
34
+ - 发布/编辑/评论/点赞/催交日报(prepare -> apply 确认链,写入类高风险操作)
35
+
36
+ 不适用:人事档案、考勤、薪酬、流程审批等非日报意图。
37
+
38
+ ## 路由优先级
39
+
40
+ 1. 用户意图涉及工作日报(日报、日志、补交、催交、提醒交日报)→ 本模块。
41
+ 2. 先读 `weaver-work-cli blog schema` 确认 operation 合约,再按命令表选 operation。
42
+ 3. 人事档案、考勤、薪酬等非日报意图 → 不属于本模块。
43
+
44
+ ## 高优先级语义
45
+
46
+ - 业务对象:工作日报(blog)。别名:日报、工作日报、日志、补交、催交。
47
+ - **查指定个人**只能用 `blog.query_user`(按天扫描,区间上限 62 天);不要尝试按 userId 列表批量查个人——服务端会忽略该过滤并静默返回当前登录人自己的日报。
48
+ - **查群体**(直接下属 / 间接下属 / 全部下属 / 我关注的人)用 `blog.query` 的 `user_type`。
49
+ - 补交状态由 CLI 按「提交时间 vs 日报日期是否同日」判定,输出为 `正常` / `补交` / `未提交`,不要使用其它口径。
50
+ - 提醒默认文案固定为「请填写 YYYY年 M月 D日 的日报!」,日期与输入 `date` 一致。
51
+ - HRM 解析人员取 `user_id`;姓名同名多命中时 CLI 会报错并列出候选,改用 `user_id` 指定。
52
+
53
+ ## 命令表
54
+
55
+ | 用户意图 | operation | reference |
56
+ | --- | --- | --- |
57
+ | 查群体日报(下属 / 我关注的人) | `blog.query` | [blog-query.md](references/blog-query.md) |
58
+ | 查某人某天 / 某段日报 | `blog.query_user` | [blog-query-user.md](references/blog-query-user.md) |
59
+ | 按姓名解析 userId | `blog.resolve_users` | [blog-resolve-users.md](references/blog-resolve-users.md) |
60
+ | 查某条日报的评论 | `blog.comments` | [blog-comments.md](references/blog-comments.md) |
61
+ | 查某日期默认共享对象 | `blog.default_permission` | [blog-default-permission.md](references/blog-default-permission.md) |
62
+ | 导出日报为 xlsx | `blog.export` | [blog-export.md](references/blog-export.md) |
63
+ | 发布日报 | `blog.publish.prepare` → `blog.publish.apply` | [blog-publish.md](references/blog-publish.md) |
64
+ | 编辑指定日期日报 | `blog.edit.prepare` → `blog.edit.apply` | [blog-edit.md](references/blog-edit.md) |
65
+ | 评论指定日报 | `blog.comment.prepare` → `blog.comment.apply` | [blog-comment.md](references/blog-comment.md) |
66
+ | 点赞 / 取消点赞 | `blog.like.prepare` → `blog.like.apply` | [blog-like.md](references/blog-like.md) |
67
+ | 提醒提交日报 | `blog.remind.prepare` → `blog.remind.apply` | [blog-remind.md](references/blog-remind.md) |
68
+ | 暂未支持的能力 | — | [blog-disabled-capabilities.md](references/blog-disabled-capabilities.md) |
69
+
70
+ 统一 JSON 入口:
71
+
72
+ Windows PowerShell:
73
+
74
+ ```powershell
75
+ weaver-work-cli --json blog run blog.query --input-json '{"user_type":"myFollow","start_date":"2026-09-14","end_date":"2026-09-16"}'
76
+ ```
77
+
78
+ macOS/Linux(bash/zsh):
79
+
80
+ ```bash
81
+ weaver-work-cli --json blog run blog.query --input-json '{"user_type":"myFollow","start_date":"2026-09-14","end_date":"2026-09-16"}'
82
+ ```
83
+
84
+ ## 处理链
85
+
86
+ - **日报提交情况报表**:`blog.query`(user_type 按意图选择)→ 汇总 `submit_status` → 向用户输出按人统计表。未提交按人天取 `not_submitted[]`;`not_submitted_people[]` 是整窗完全没交的人(用于催交)。
87
+ - **发布**:`blog.publish.prepare`(自动查当日是否已有日报、回填默认共享)→ 向用户复述日期与内容 → 用户确认 → `blog.publish.apply --yes`(CLI 回查验证)。
88
+ - **编辑**:`blog.edit.prepare`(自动取原内容与差异)→ 复述原内容与新内容 → 用户确认 → `blog.edit.apply --yes`。
89
+ - **评论 / 点赞**:`prepare` 定位目标日报(无日报即报错,不询问)→ 用户确认 → `apply --yes`。
90
+ - **提醒**:`blog.remind.prepare`(解析被提醒人 + 默认文案)→ 复述人员与文案 → 用户确认 → `blog.remind.apply --yes`(逐人发送)。
91
+
92
+ ## 执行原则
93
+
94
+ - 最小必要查询:先 `schema`,再按需读 reference;列表结果只保留任务所需字段,回复时给摘要与统计,不粘贴超长 JSON。
95
+ - 业务输入只描述业务对象和意图;认证、Cookie、ETEAMSID、Token 全部由 CLI 托管,禁止出现在输入中。
96
+ - 错误以 JSON envelope 的 `error.type/subtype` 驱动:`name_ambiguous` 列出候选后改用 user_id;`range_too_large` 缩小区间;`output_exists` 换输出路径。
97
+ - 导出属于本地文件写入:`output` 指向已存在文件时 CLI 拒绝覆盖。
98
+
99
+ ## 写操作失败决策树
100
+
101
+ 1. `confirmation.required` → 向用户复述 prepare 返回的目标、差异与文案,取得明确确认后带 `confirm=true` 重调 apply;不要伪造 continuation。
102
+ 2. `target_changed` / `publish_already_exists` → 重新 prepare,再向用户确认。
103
+ 3. `partial/write_uncertain` → 停止,不做任何写重试;用 `blog.query_user` 只读回查后向用户报告。
104
+ 4. `authentication/session_expired` → 按 shared 规则先向用户确认 E10 登录域名,再引导登录。
105
+
106
+ ## 不在范围
107
+
108
+ - 禁止绕过 CLI 直接 `curl`/`fetch` E10 日报接口,禁止读取或拼装 Cookie、ETEAMSID。
109
+ - 按 userId 列表批量查个人日报未暴露(服务端忽略该过滤,详见 disabled-capabilities)。
110
+ - EB 日报应用接口族(ebuilder / secondev)未暴露;当前租户未启用 EB 日报应用。
111
+ - 删除日报、撤销已发送提醒未提供。
@@ -0,0 +1,51 @@
1
+ # 评论日报(blog.comment prepare -> apply)
2
+
3
+ ## 何时使用
4
+
5
+ 对某条日报发表评论。目标日报必须存在:`prepare` 阶段按「blog_id」或「日期 + 人员」自动定位,找不到即报错(不询问、不猜测)。
6
+
7
+ ## 输入要点(prepare)
8
+
9
+ | 字段 | 必填 | 说明 |
10
+ | --- | --- | --- |
11
+ | blog_id | 与 date 二选一 | 日报记录 id |
12
+ | date | 与 blog_id 二选一 | 日报归属日期,配合 user_id / name 定位 |
13
+ | user_id / name | 否(二选一) | 目标人员;都缺省时定位当前登录人当天日报 |
14
+ | content | 是 | 评论内容 |
15
+
16
+ ## 命令
17
+
18
+ Windows PowerShell:
19
+
20
+ ```powershell
21
+ weaver-work-cli --json blog run blog.comment.prepare --input-json '{"name":"PLACEHOLDER_NAME","date":"2026-08-18","content":"辛苦了,已核对。"}'
22
+ ```
23
+
24
+ 用户确认后:
25
+
26
+ ```powershell
27
+ weaver-work-cli --json blog run blog.comment.apply --input-json '{"continuation":"<prepare 返回的 continuation>","confirm":true}'
28
+ ```
29
+
30
+ macOS/Linux(bash/zsh):
31
+
32
+ ```bash
33
+ weaver-work-cli --json blog run blog.comment.prepare --input-json '{"date":"2026-08-18","content":"辛苦了,已核对。"}'
34
+ weaver-work-cli --json blog run blog.comment.apply --input-json '{"continuation":"<prepare 返回的 continuation>","confirm":true}'
35
+ ```
36
+
37
+ ## 输出处理
38
+
39
+ 1. prepare 返回目标日报摘要(`target_content_text`)与评论内容、continuation。
40
+ 2. 向用户复述目标日报与评论内容,确认后调 apply。
41
+ 3. apply 通过评论列表回查验证,返回 `comment_id`。
42
+
43
+ ## 注意
44
+
45
+ - 评论对目标日报的可见人群可见;发送前必须确认内容。
46
+ - 目标日期无日报时报 `target_missing`,如实向用户报告「对应日期 X 人员 X 无日报,无法评论」。
47
+
48
+ ## 失败处理
49
+
50
+ - `target_missing` / `name_ambiguous` / `name_not_found`:按错误详情处理。
51
+ - `partial/write_uncertain`:停止重试,用 `blog.comments` 回查后报告。
@@ -0,0 +1,39 @@
1
+ # 评论查询(blog.comments)
2
+
3
+ ## 何时使用
4
+
5
+ 查看某条日报下已有的评论列表(分页)。
6
+
7
+ ## 输入要点
8
+
9
+ | 字段 | 必填 | 说明 |
10
+ | --- | --- | --- |
11
+ | blog_id | 是 | 日报记录 id |
12
+ | page_no / page_size | 否 | 默认 1 / 20,page_size 上限 100 |
13
+
14
+ ## 命令
15
+
16
+ Windows PowerShell:
17
+
18
+ ```powershell
19
+ weaver-work-cli --json blog run blog.comments --input-json '{"blog_id":"1000000000000000001"}'
20
+ ```
21
+
22
+ macOS/Linux(bash/zsh):
23
+
24
+ ```bash
25
+ weaver-work-cli --json blog run blog.comments --input-json '{"blog_id":"1000000000000000001","page_size":50}'
26
+ ```
27
+
28
+ ## 输出处理
29
+
30
+ - `total_count`:评论总数;`comments[]` 含评论人(`commentor.name`)、`content`、`create_time`。
31
+ - 需要目标日报 id 但只知道「人 + 日期」时,用 `blog.comment.prepare`(内部自动定位)。
32
+
33
+ ## 注意
34
+
35
+ - 只读操作,无需确认。
36
+
37
+ ## 失败处理
38
+
39
+ - `business_error`:透出服务端 message,检查 blog_id 是否有效。