weaver-work-cli 0.1.8 → 0.1.21

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 (271) hide show
  1. package/README.md +25 -17
  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 +435 -0
  14. package/dist/core/state.js +26 -0
  15. package/dist/internal/e10/auth/commands.js +34 -19
  16. package/dist/internal/e10/auth/session.js +74 -2
  17. package/dist/internal/e10/auth/xiaoe.js +359 -94
  18. package/dist/internal/e10/context.js +18 -6
  19. package/dist/internal/e10/request-runtime.js +8 -1
  20. package/dist/internal/skills/install.js +148 -28
  21. package/dist/internal/skills/reader.js +12 -9
  22. package/dist/shortcuts/blog/continuation.js +74 -0
  23. package/dist/shortcuts/blog/errors.js +60 -0
  24. package/dist/shortcuts/blog/host.js +175 -0
  25. package/dist/shortcuts/blog/index.js +324 -0
  26. package/dist/shortcuts/blog/manifest.js +415 -0
  27. package/dist/shortcuts/blog/operations/comment.js +125 -0
  28. package/dist/shortcuts/blog/operations/comments.js +31 -0
  29. package/dist/shortcuts/blog/operations/edit.js +131 -0
  30. package/dist/shortcuts/blog/operations/export.js +46 -0
  31. package/dist/shortcuts/blog/operations/like.js +80 -0
  32. package/dist/shortcuts/blog/operations/publish.js +157 -0
  33. package/dist/shortcuts/blog/operations/query-user.js +58 -0
  34. package/dist/shortcuts/blog/operations/query.js +96 -0
  35. package/dist/shortcuts/blog/operations/registry.js +54 -0
  36. package/dist/shortcuts/blog/operations/remind.js +176 -0
  37. package/dist/shortcuts/blog/operations/shared.js +330 -0
  38. package/dist/shortcuts/blog/operations/types.js +16 -0
  39. package/dist/shortcuts/blog/operations.js +9 -0
  40. package/dist/shortcuts/caizhilian/continuation.js +70 -0
  41. package/dist/shortcuts/caizhilian/errors.js +53 -0
  42. package/dist/shortcuts/caizhilian/host.js +190 -0
  43. package/dist/shortcuts/caizhilian/index.js +186 -0
  44. package/dist/shortcuts/caizhilian/manifest.js +42 -0
  45. package/dist/shortcuts/caizhilian/operations/api.js +801 -0
  46. package/dist/shortcuts/caizhilian/operations/confirm.js +75 -0
  47. package/dist/shortcuts/caizhilian/operations/files.js +306 -0
  48. package/dist/shortcuts/caizhilian/operations/form.js +170 -0
  49. package/dist/shortcuts/caizhilian/operations/handlers/collab.js +611 -0
  50. package/dist/shortcuts/caizhilian/operations/handlers/document.js +890 -0
  51. package/dist/shortcuts/caizhilian/operations/handlers/file-collection.js +1227 -0
  52. package/dist/shortcuts/caizhilian/operations/handlers/file-upload.js +192 -0
  53. package/dist/shortcuts/caizhilian/operations/handlers/fileops.js +570 -0
  54. package/dist/shortcuts/caizhilian/operations/handlers/folder.js +1024 -0
  55. package/dist/shortcuts/caizhilian/operations/handlers/search.js +318 -0
  56. package/dist/shortcuts/caizhilian/operations/handlers/setting-attach.js +294 -0
  57. package/dist/shortcuts/caizhilian/operations/handlers/setting-backup.js +423 -0
  58. package/dist/shortcuts/caizhilian/operations/handlers/setting-encrypt.js +238 -0
  59. package/dist/shortcuts/caizhilian/operations/handlers/setting-storage.js +364 -0
  60. package/dist/shortcuts/caizhilian/operations/handlers/system.js +106 -0
  61. package/dist/shortcuts/caizhilian/operations/registry.js +151 -0
  62. package/dist/shortcuts/caizhilian/operations/shared.js +408 -0
  63. package/dist/shortcuts/caizhilian/operations/specs.js +698 -0
  64. package/dist/shortcuts/caizhilian/operations/types.js +57 -0
  65. package/dist/shortcuts/caizhilian/operations.js +21 -0
  66. package/dist/shortcuts/contract/continuation.js +70 -0
  67. package/dist/shortcuts/contract/errors.js +62 -0
  68. package/dist/shortcuts/contract/host.js +205 -0
  69. package/dist/shortcuts/contract/index.js +318 -0
  70. package/dist/shortcuts/contract/manifest.js +596 -0
  71. package/dist/shortcuts/contract/operations/clause-reference.js +78 -0
  72. package/dist/shortcuts/contract/operations/form-info.js +371 -0
  73. package/dist/shortcuts/contract/operations/read.js +118 -0
  74. package/dist/shortcuts/contract/operations/registry.js +43 -0
  75. package/dist/shortcuts/contract/operations/request.js +300 -0
  76. package/dist/shortcuts/contract/operations/shared.js +133 -0
  77. package/dist/shortcuts/contract/operations/subject.js +157 -0
  78. package/dist/shortcuts/contract/operations/template.js +81 -0
  79. package/dist/shortcuts/contract/operations/types.js +7 -0
  80. package/dist/shortcuts/contract/operations/workflow.js +52 -0
  81. package/dist/shortcuts/contract/operations/write.js +131 -0
  82. package/dist/shortcuts/contract/operations.js +8 -0
  83. package/dist/shortcuts/hrm/index.js +83 -2
  84. package/dist/shortcuts/hrm/manifest.js +16 -9
  85. package/dist/shortcuts/hrm/operations/employee.js +160 -30
  86. package/dist/shortcuts/hrm/operations/org.js +17 -3
  87. package/dist/shortcuts/hrm/operations/position.js +18 -2
  88. package/dist/shortcuts/hrm/operations/registry.js +2 -0
  89. package/dist/shortcuts/hrm/operations/resolve.js +449 -0
  90. package/dist/shortcuts/index.js +5 -1
  91. package/dist/shortcuts/invoice/index.js +74 -36
  92. package/dist/shortcuts/invoice/manifest.js +674 -4
  93. package/dist/shortcuts/invoice/markdown.js +172 -0
  94. package/dist/shortcuts/invoice/operations/add.js +3 -3
  95. package/dist/shortcuts/invoice/operations/delete.js +2 -2
  96. package/dist/shortcuts/invoice/operations/get.js +10 -2
  97. package/dist/shortcuts/invoice/operations/import.js +2 -2
  98. package/dist/shortcuts/invoice/operations/registry.js +8 -1
  99. package/dist/shortcuts/invoice/operations/reim-auto.js +719 -0
  100. package/dist/shortcuts/invoice/operations/reim.js +85 -2
  101. package/dist/shortcuts/invoice/operations/shared.js +75 -8
  102. package/dist/shortcuts/invoice/operations/update.js +2 -2
  103. package/dist/shortcuts/invoice/operations/upload-and-validate.js +93 -0
  104. package/dist/shortcuts/invoice/operations/validate-preview.js +2 -1
  105. package/dist/shortcuts/invoice/projection.js +328 -0
  106. package/dist/shortcuts/meeting/host.js +18 -1
  107. package/dist/shortcuts/meeting/manifest.js +30 -18
  108. package/dist/shortcuts/meeting/operations/eb/catalog.js +390 -0
  109. package/dist/shortcuts/meeting/operations/eb/conflict.js +389 -0
  110. package/dist/shortcuts/meeting/operations/eb/factory.js +389 -0
  111. package/dist/shortcuts/meeting/operations/eb/index.js +22 -0
  112. package/dist/shortcuts/meeting/operations/env.js +8 -1
  113. package/dist/shortcuts/meeting/operations/registry.js +2 -0
  114. package/dist/shortcuts/meeting/operations/signs.js +216 -2
  115. package/dist/shortcuts/workflow/endpoints.js +2 -1
  116. package/dist/shortcuts/workflow/errors.js +8 -2
  117. package/dist/shortcuts/workflow/host.js +11 -4
  118. package/dist/shortcuts/workflow/operations/form.js +1016 -590
  119. package/dist/shortcuts/workflow/operations/read.js +913 -231
  120. package/dist/shortcuts/workflow/operations/shared.js +21 -0
  121. package/dist/shortcuts/workflow/operations/write.js +750 -52
  122. package/dist/shortcuts/workflow/operations.js +36 -10
  123. package/docs/_catalog.md +6 -0
  124. package/docs/agent-invoice.md +5 -1
  125. package/docs/agent-io-channel-design.md +468 -0
  126. package/docs/agent-skill-install.md +9 -4
  127. package/docs/blog.md +123 -0
  128. package/docs/caizhilian.md +304 -0
  129. package/docs/contract.md +91 -0
  130. package/docs/e10-auth.md +4 -2
  131. package/docs/hrm.md +53 -11
  132. package/docs/invoice.md +5 -1
  133. package/docs/meeting.md +1 -1
  134. package/docs/operation-manual.md +15 -3
  135. package/docs/skill-review-2026-09-19.md +2 -2
  136. package/package.json +1 -1
  137. package/scripts/package-skill.mjs +32 -20
  138. package/scripts/xiaoe_env.py +118 -0
  139. package/skill-template/business-info.json +113 -14
  140. package/skill-template/domains/blog.md +24 -0
  141. package/skill-template/domains/caizhilian.md +22 -0
  142. package/skill-template/domains/hrm.md +2 -1
  143. package/skill-template/domains/jinchengda.md +23 -0
  144. package/skill-template/domains/meeting.md +1 -1
  145. package/skill-template/domains/workflow.md +1 -1
  146. package/skill-template/skill-template.md +1 -1
  147. package/skills/weaver-e10-blog/SKILL.md +111 -0
  148. package/skills/weaver-e10-blog/references/blog-comment.md +51 -0
  149. package/skills/weaver-e10-blog/references/blog-comments.md +39 -0
  150. package/skills/weaver-e10-blog/references/blog-default-permission.md +38 -0
  151. package/skills/weaver-e10-blog/references/blog-disabled-capabilities.md +11 -0
  152. package/skills/weaver-e10-blog/references/blog-edit.md +51 -0
  153. package/skills/weaver-e10-blog/references/blog-export.md +42 -0
  154. package/skills/weaver-e10-blog/references/blog-like.md +50 -0
  155. package/skills/weaver-e10-blog/references/blog-publish.md +52 -0
  156. package/skills/weaver-e10-blog/references/blog-query-user.md +45 -0
  157. package/skills/weaver-e10-blog/references/blog-query.md +49 -0
  158. package/skills/weaver-e10-blog/references/blog-remind.md +51 -0
  159. package/skills/weaver-e10-blog/references/blog-resolve-users.md +38 -0
  160. package/skills/weaver-e10-blog/references/source-manifest.json +1540 -0
  161. package/skills/weaver-e10-caizhilian/SKILL.md +217 -0
  162. package/skills/weaver-e10-caizhilian/references/agent-entry.md +106 -0
  163. package/skills/weaver-e10-caizhilian/references/collaboration.md +112 -0
  164. package/skills/weaver-e10-caizhilian/references/document.md +111 -0
  165. package/skills/weaver-e10-caizhilian/references/file-collection.md +173 -0
  166. package/skills/weaver-e10-caizhilian/references/file-upload.md +309 -0
  167. package/skills/weaver-e10-caizhilian/references/files.md +120 -0
  168. package/skills/weaver-e10-caizhilian/references/folder.md +122 -0
  169. package/skills/weaver-e10-caizhilian/references/org-browser.md +104 -0
  170. package/skills/weaver-e10-caizhilian/references/setting-attach.md +440 -0
  171. package/skills/weaver-e10-caizhilian/references/setting-backup.md +372 -0
  172. package/skills/weaver-e10-caizhilian/references/setting-encrypt.md +399 -0
  173. package/skills/weaver-e10-caizhilian/references/setting-storage.md +603 -0
  174. package/skills/weaver-e10-caizhilian/references/source-manifest.json +5694 -0
  175. package/skills/weaver-e10-caizhilian/references/withheld.md +93 -0
  176. package/skills/weaver-e10-caizhilian/references/write-protocol.md +120 -0
  177. package/skills/weaver-e10-calendar/SKILL.md +4 -3
  178. package/skills/weaver-e10-ebuilder-form/SKILL.md +4 -9
  179. package/skills/weaver-e10-ebuilder-form/references/context-routing.md +0 -9
  180. package/skills/weaver-e10-ebuilder-form/references/custom-api.md +1 -5
  181. package/skills/weaver-e10-ebuilder-form/references/fields-browser.md +1 -5
  182. package/skills/weaver-e10-ebuilder-form/references/list-nlist.md +1 -5
  183. package/skills/weaver-e10-ebuilder-form/references/openapi-read.md +1 -5
  184. package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +1 -5
  185. package/skills/weaver-e10-esb/SKILL.md +2 -2
  186. package/skills/weaver-e10-esb/references/source-manifest.json +9 -9
  187. package/skills/weaver-e10-hrm/SKILL.md +104 -9
  188. package/skills/weaver-e10-hrm/references/employee.md +89 -15
  189. package/skills/weaver-e10-hrm/references/org.md +114 -5
  190. package/skills/weaver-e10-hrm/references/position.md +14 -7
  191. package/skills/weaver-e10-hrm/references/source-manifest.json +1 -1
  192. package/skills/weaver-e10-jinchengda/SKILL.md +167 -0
  193. package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +82 -0
  194. package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +69 -0
  195. package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +78 -0
  196. package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +27 -0
  197. package/skills/weaver-e10-jinchengda/references/contract-request-status.md +71 -0
  198. package/skills/weaver-e10-jinchengda/references/contract-request-write.md +94 -0
  199. package/skills/weaver-e10-jinchengda/references/contract-signing-subjects.md +89 -0
  200. package/skills/weaver-e10-jinchengda/references/contract-subject-create.md +77 -0
  201. package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +66 -0
  202. package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +94 -0
  203. package/skills/weaver-e10-jinchengda/references/source-manifest.json +259 -0
  204. package/skills/weaver-e10-jiuchuanhui/SKILL.md +5 -11
  205. package/skills/weaver-e10-jucailin/SKILL.md +4 -3
  206. package/skills/weaver-e10-mail/SKILL.md +4 -11
  207. package/skills/weaver-e10-meeting/SKILL.md +66 -32
  208. package/skills/weaver-e10-meeting/references/meeting-change.md +5 -2
  209. package/skills/weaver-e10-meeting/references/meeting-create.md +2 -1
  210. package/skills/weaver-e10-meeting/references/meeting-eb.md +114 -0
  211. package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +9 -8
  212. package/skills/weaver-e10-meeting/references/meeting-receipts-signs.md +35 -7
  213. package/skills/weaver-e10-meeting/references/meeting-update.md +1 -1
  214. package/skills/weaver-e10-okr/SKILL.md +6 -11
  215. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  216. package/skills/weaver-e10-plan/SKILL.md +3 -3
  217. package/skills/weaver-e10-plan/references/plan-collect-and-compose.md +1 -1
  218. package/skills/weaver-e10-plan/references/plan-overview-and-routing.md +1 -1
  219. package/skills/weaver-e10-plan/references/source-manifest.json +13 -13
  220. package/skills/weaver-e10-qiyecheng/SKILL.md +4 -10
  221. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +9 -9
  222. package/skills/weaver-e10-shared/SKILL.md +42 -34
  223. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +16 -43
  224. package/skills/weaver-e10-shared/references/json-output-contract.md +20 -11
  225. package/skills/weaver-e10-shared/references/non-interactive-environment.md +21 -14
  226. package/skills/weaver-e10-shijingran/SKILL.md +2 -1
  227. package/skills/weaver-e10-shijingran/references/source-manifest.json +9 -9
  228. package/skills/weaver-e10-skill-maker/SKILL.md +4 -10
  229. package/skills/weaver-e10-skill-maker/references/business-skill-generation.md +5 -3
  230. package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +12 -27
  231. package/skills/weaver-e10-skill-maker/references/module-gap-audit-and-repair.md +17 -5
  232. package/skills/weaver-e10-skill-maker/references/source-update-detection.md +4 -27
  233. package/skills/weaver-e10-skill-maker/references/weaver-skill-style.md +1 -1
  234. package/skills/weaver-e10-wenshuding/SKILL.md +5 -16
  235. package/skills/weaver-e10-wenshuding/references/source-manifest.json +7 -7
  236. package/skills/weaver-e10-workflow/SKILL.md +41 -46
  237. package/skills/weaver-e10-workflow/references/source-manifest.json +39 -75
  238. package/skills/weaver-e10-workflow/references/workflow-batch.md +90 -29
  239. package/skills/weaver-e10-workflow/references/workflow-create.md +83 -109
  240. package/skills/weaver-e10-workflow/references/workflow-memory.md +19 -9
  241. package/skills/weaver-e10-workflow/references/workflow-operate.md +2 -2
  242. package/skills/weaver-e10-workflow/references/workflow-query.md +40 -27
  243. package/skills/weaver-e10-workflow/references/workflow-share.md +18 -2
  244. package/skills/weaver-e10-workflow/references/workflow-view.md +3 -4
  245. package/skills/weaver-e10-yepiaotong/SKILL.md +74 -39
  246. package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +22 -1
  247. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +3 -1
  248. package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +135 -0
  249. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +15 -3
  250. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +1 -1
  251. package/skills/weaver-e10-yepiaotong/references/invoice-summarize.py +217 -0
  252. package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +88 -0
  253. package/skills/weaver-e10-yepiaotong/references/invoice-validation-preview.md +7 -2
  254. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +89 -9
  255. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +1 -0
  256. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +70 -49
  257. package/skills/weaver-e10-yepiaotong/references/reim-fast-path.md +119 -0
  258. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +55 -36
  259. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +4 -0
  260. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +149 -0
  261. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +125 -5
  262. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +430 -63
  263. package/skills/weaver-e10-yimiaoban/SKILL.md +4 -12
  264. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
  265. package/skills/weaver-e10-ziguanjia/SKILL.md +2 -1
  266. package/skills/weaver-e10-ziguanjia/references/ziguanjia-agent-entry.md +3 -3
  267. package/tools/weaver-skill-detector-1.0.13/SKILL.md +9 -9
  268. package/tools/weaver-skill-detector-1.0.13/references/checklist.md +3 -3
  269. package/tools/weaver-skill-detector-1.0.13/scripts/__pycache__/validate_skill.cpython-313.pyc +0 -0
  270. package/tools/weaver-skill-detector-1.0.13/scripts/validate_skill.py +98 -91
  271. package/scripts/sync-connector-skills.mjs +0 -172
@@ -0,0 +1,93 @@
1
+ # 采知连:明确不提供的能力(withheld)与源 Skill 范围外模块
2
+
3
+ ## 何时使用
4
+
5
+ - 用户要求「列一下有哪些环境 / 看看当前配置 / 重新加载配置 / 切换到测试环境」这类源 Skill 的系统管理能力。
6
+ - 用户拿着源 Skill(`weaver-e10-caizhilian` 1.1.17)的 operation 名来调用,但 CLI 里没有对应 operation。
7
+ - `caizhilian operations` 的 `withheldOperations` 里给出了名称与理由,需要向用户解释替代方案。
8
+
9
+ ## 输入要点
10
+
11
+ ### 4 个 withheld 系统操作
12
+
13
+ 源 `scripts/system_plugins.py` 的这 4 个插件**没有**转换成 CLI operation。原因都是同一个:它们操作的是源 Skill 自带的 `assets/config.json` 多环境配置与本地登录态缓存,而在 weaver-work-cli 里,环境、配置与登录态由框架统一管理,业务模块不得自建一套。
14
+
15
+ | 源 operation | withheld 名称 | 不提供的原因 | 替代命令 |
16
+ | --- | --- | --- | --- |
17
+ | `list_systems` | `caizhilian.system.list-systems` | 读取 Skill 自带 config.json 的多环境列表与登录态 | `weaver-work-cli config list`、`weaver-work-cli e10 auth status`;连通性自检用 `weaver-work-cli --json caizhilian health` |
18
+ | `get_loaded_config` | `caizhilian.system.get-loaded-config` | 输出 Skill 本地配置生效内容(含 cookies 掩码、下载目录) | `weaver-work-cli config list`;不在业务模块内暴露配置快照 |
19
+ | `reload_config` | `caizhilian.system.reload-config` | 重新加载 Skill 本地 config.json | 无需替代:CLI 每次进程启动即读取框架配置,没有进程内缓存需要刷新 |
20
+ | `switch_config` | `caizhilian.system.switch-config` | 在 Skill 本地多套环境配置间切换 | `weaver-work-cli config set ...`、`weaver-work-cli e10 auth login --base-url <域名>` |
21
+
22
+ 只保留了 `caizhilian.system.health`(源 `check_system_health`):探测 `/api/doc/config/getUserConfiguration?configKeys`,返回 `{ environment, healthy, base_url, url, status_code, business_code, diagnosis, elapsed_ms }`,其中 `environment.provider` 固定为 `weaver-work-cli:e10-auth`;本地无登录态时抛 `authentication/session_unavailable`。
23
+
24
+ ### 源 Skill 目录内的已补充模块
25
+
26
+ 以下模块已补充到 caizhilian CLI 中:
27
+
28
+ | 源模块 | CLI 操作 | 说明 |
29
+ | --- | --- | --- |
30
+ | 系统设置-附件 | `caizhilian.setting-attach.get` / `.set.prepare` / `.set.apply` | 附件全局设置(上传最大、格式控制、批量下载等 11 项) |
31
+ | 系统设置-备份 | `caizhilian.setting-backup.get` / `.set.prepare` / `.set.apply` / `.rule.*` | 备份设置(开关、规则 CRUD、启停) |
32
+ | 系统设置-加密 | `caizhilian.setting-encrypt.get` / `.set.prepare` / `.set.apply` | 加解密设置(8 项配置) |
33
+ | 系统设置-存储 | `caizhilian.setting-storage.instance.*` / `.rule.*` | 存储实例与规则管理 |
34
+ | 文件收集 | `caizhilian.file-collection.task.*` / `.scan.*` / `.run.*` / `.cancel.*` / `.delete.*` | FTP/SFTP 文件采集任务管理 |
35
+ | 文件上传 | `caizhilian.file-upload.contract` / `.prepare` / `.upload.prepare` / `.upload.apply` | 本地文件上传到文件服务 |
36
+
37
+ ### 源基础设施脚本的处理方式
38
+
39
+ 源的通用基础设施不是业务 operation,已按 weaver-work-cli 的框架能力**等价替换**,不单独暴露:
40
+
41
+ | 源文件 | 处理方式 |
42
+ | --- | --- |
43
+ | `scripts/cli.py`、`scripts/engine.py`、`scripts/plugin_base.py` | 由 `src/shortcuts/caizhilian/index.ts` + `operations/registry.ts` 承担(命令注册、operation 分派、prepare/apply 展开) |
44
+ | `scripts/http_client.py` | 由 `src/shortcuts/caizhilian/host.ts` + 框架 E10 HTTP client 承担(Cookie/ETEAMSID/User-Agent 注入、超时、重试、下载流处理) |
45
+ | `scripts/_session_helper.py`、`scripts/environment_provider.py`、`scripts/cache_manager.py`、`.cache/` | 由框架登录态管理承担(`weaver-work-cli e10 auth ...`);业务模块不读写登录缓存 |
46
+ | `scripts/_utils.py`、`scripts/_plugin_helpers.py` | 直译进 `operations/shared.ts`、`operations/files.ts`、`operations/api.ts`(文件元数据、上传下载、Python 语义小工具) |
47
+ | `scripts/response_templates.py` | 输出归一逻辑直译进各 handler(`users[]` / `departments[]` / `documents[]` 等键名与字段) |
48
+ | `scripts/reply_lint.py`、`scripts/collection_lint_skill.py` | 属于源 Skill 的回复与 Skill 自检工具,不在业务 CLI 范围 |
49
+ | `doc-business-orchestrations/*.json` | 编排建议已落进各 reference 的「典型链路」,不作为可执行 operation 暴露 |
50
+
51
+ ## 命令
52
+
53
+ Windows PowerShell:
54
+
55
+ ```powershell
56
+ weaver-work-cli caizhilian operations
57
+ weaver-work-cli --json caizhilian health
58
+ weaver-work-cli config list
59
+ weaver-work-cli e10 auth status
60
+ ```
61
+
62
+ macOS/Linux(bash/zsh):
63
+
64
+ ```bash
65
+ weaver-work-cli caizhilian operations
66
+ weaver-work-cli --json caizhilian health
67
+ weaver-work-cli config list
68
+ weaver-work-cli e10 auth status
69
+ ```
70
+
71
+ `caizhilian operations` 的返回里带 `withheldOperations`,每项是 `{ name, reason }`,可以直接把 `reason` 转述给用户。
72
+
73
+ ## 输出处理
74
+
75
+ - 用户点名要 withheld 能力时:**不要报「做不到」就结束**,要给出上表里的替代命令,并说明「环境与登录态由 weaver-work-cli 框架统一管理」。
76
+ - 用户拿源 operation 名(如 `create_html_document`、`search_documents`)来调用时,用 `caizhilian operations` 的 `sourceOperation` 字段反查 CLI operation 名(如 `caizhilian.document.create-html.prepare` / `.apply`),再按 `write-protocol.md` 走确认链。
77
+ - `caizhilian health` 的 `diagnosis` 字段是逗号分隔的判定项:`ok`、`network_error`、`http_error`、`http_status_mismatch`、`business_code_mismatch`、`request_failed`。非 `ok` 时把 `status_code`、`business_code`、`elapsed_ms` 一起给用户。
78
+
79
+ ## 注意
80
+
81
+ - 不要为了让用户满意而**临时补出** withheld 操作,也不要用 curl / 脚本绕过 CLI 去读框架配置或登录态。
82
+ - 不要读取、列出、打印或解析 CLI runtime 内部的登录凭据文件;认证相关一律通过 `weaver-work-cli auth` / `weaver-work-cli e10 auth` 命令。
83
+ - 源 Skill 范围外模块的能力**不要**用 caizhilian 的 operation 去近似模拟(例如用附件上传去替代「附件全局设置」)。
84
+ - 如果用户确实需要范围外模块,回复「需要按 skill-maker 单独生成对应模块 CLI 与 Skill」,不要在本模块里扩权。
85
+
86
+ ## 失败处理
87
+
88
+ | error.type / subtype | 触发场景 | 处理 |
89
+ | --- | --- | --- |
90
+ | `validation/operation_unknown` | 调用了 withheld 或范围外的 operation 名 | 用 `caizhilian operations` 校对,按本文件的替代命令回复用户 |
91
+ | `authentication/session_unavailable` | `caizhilian health` 时本地无登录态 | 引导用户执行 `weaver-work-cli e10 auth login`,不要猜域名 |
92
+ | `api/http_error` / `api/business_error` | health 探测返回非成功码 | 把 `diagnosis`、`status_code`、`business_code` 交给用户 |
93
+ | `network/*` | health 探测网络失败 | `retryable=true` 时最多重试一次 |
@@ -0,0 +1,120 @@
1
+ # 采知连写操作确认协议(prepare → apply)
2
+
3
+ ## 何时使用
4
+
5
+ - 要执行任何**会产生服务端副作用**的操作:创建/修改文档、替换正文、改作者、文件夹创建、权限与默认共享增删改、标签增删、参与人增删、共享增删、附件上传替换、封面设置移除、比对文件上传与提交。
6
+ - 收到 `confirmation/required` 或任何 `continuation_*` / `plan_changed` 报错,需要判断下一步。
7
+ - 写操作结果不确定(超时、连接中断、返回结构异常),需要决定「查一次还是重放」。
8
+
9
+ ## 输入要点
10
+
11
+ ### 四步链路
12
+
13
+ 1. **只读定位**:先用查询类操作拿到真实 ID 与合法枚举值(`document.search` / `document.get` / `folder.query-by-name` / `*.form` / `*.list` / `org.search-*`)。ID 一律不要猜。
14
+ 2. **prepare**:`weaver-work-cli --json caizhilian run <name>.prepare --input-json '<json>'`。这一步**不产生副作用**,只做只读回查、组装请求体、计算指纹,并签发 `continuation`。
15
+ 3. **向用户摘要并取得明确确认**:必须写清「对哪个对象(名称 + ID)、做什么、影响范围、是否可撤销」。涉及本地文件时还要写清文件路径、文件名、大小。用户没有明确同意,不得进入第 4 步。
16
+ 4. **apply**:`weaver-work-cli --json caizhilian run <name>.apply --input-json '<与 prepare 完全相同的 json>' --continuation TOKEN --yes`。`--yes` 会注入 `confirm: true`,`--continuation` 注入票据。
17
+
18
+ ### 票据(continuation)约束
19
+
20
+ - 有效期 **10 分钟**(`expires_in_ms`),过期报 `continuation_expired`,必须重新 prepare。
21
+ - 票据里绑定了 **baseUrl + 登录账号**:换环境或换账号后复用会报 `continuation_context_mismatch`。
22
+ - 票据绑定 **目标 apply 操作名**:把 A 操作的票据用于 B 操作报 `continuation_mismatch`。
23
+ - 票据里存了 prepare 时的**入参指纹**(排除 `confirm` / `continuation`):apply 入参与 prepare 不一致报 `continuation_args_changed`;关键字段(如 `doc_id`)单独漂移报 `continuation_target_changed`。
24
+ - 票据里还存了**请求体指纹**与(文件类)**文件 MD5 + 大小**:表单级联结果变化报 `plan_changed`,本地文件被改动报 `file_changed`。
25
+ - 票据签名校验失败或无法解析报 `continuation_invalid`;缺失报 `continuation_required`;apply 未带 `--yes` 报 `confirmation/required`(`error.type = "confirmation"`)。
26
+ - 结论:**apply 的 `--input-json` 必须与 prepare 逐字一致**。要改任何参数,就重新走一遍 prepare,不要「改一个字段再 apply」。
27
+
28
+ ### prepare 返回体
29
+
30
+ ```json
31
+ {
32
+ "schemaVersion": 1,
33
+ "ok": true,
34
+ "operation": "caizhilian.folder.create.prepare",
35
+ "data": {
36
+ "request": { "method": "POST", "path": "/api/doc/folder/create", "body": {} },
37
+ "continuation": "TOKEN",
38
+ "expires_in_ms": 600000,
39
+ "hint": "确认无误后调用 caizhilian.folder.create.apply(必须回传本次 continuation 且 confirm=true,CLI 加 --yes)"
40
+ },
41
+ "meta": { "status": "PREPARED", "requiresConfirmation": true, "expires_in_ms": 600000 },
42
+ "warnings": []
43
+ }
44
+ ```
45
+
46
+ `warnings` 是 prepare 阶段的非阻断提醒(例如共享兜底覆盖了文件夹兜底、参与人已在列表中、待删条目已消失),**必须原样转述给用户**,不要静默丢弃。
47
+
48
+ ## 命令
49
+
50
+ Windows PowerShell:
51
+
52
+ ```powershell
53
+ weaver-work-cli --json caizhilian run caizhilian.document.create-markdown.prepare --input-json '{"name":"周报","folder_id":"456","folder_type":"company","file_path":"C:\data\weekly.md"}'
54
+ weaver-work-cli --json caizhilian run caizhilian.document.create-markdown.apply --input-json '{"name":"周报","folder_id":"456","folder_type":"company","file_path":"C:\data\weekly.md"}' --continuation TOKEN --yes
55
+ weaver-work-cli --json caizhilian run caizhilian.share.add.prepare --input-json '{"doc_id":"1234567890","obj_type":"resource","share_level":"1","obj_id":["789"]}'
56
+ weaver-work-cli --json caizhilian run caizhilian.share.add.apply --input-json '{"doc_id":"1234567890","obj_type":"resource","share_level":"1","obj_id":["789"]}' --continuation TOKEN --yes
57
+ ```
58
+
59
+ macOS/Linux(bash/zsh):
60
+
61
+ ```bash
62
+ weaver-work-cli --json caizhilian run caizhilian.document.create-markdown.prepare --input-json '{"name":"周报","folder_id":"456","folder_type":"company","file_path":"/tmp/data/weekly.md"}'
63
+ weaver-work-cli --json caizhilian run caizhilian.document.create-markdown.apply --input-json '{"name":"周报","folder_id":"456","folder_type":"company","file_path":"/tmp/data/weekly.md"}' --continuation TOKEN --yes
64
+ weaver-work-cli --json caizhilian run caizhilian.share.add.prepare --input-json '{"doc_id":"1234567890","obj_type":"resource","share_level":"1","obj_id":["789"]}'
65
+ weaver-work-cli --json caizhilian run caizhilian.share.add.apply --input-json '{"doc_id":"1234567890","obj_type":"resource","share_level":"1","obj_id":["789"]}' --continuation TOKEN --yes
66
+ ```
67
+
68
+ ## 输出处理
69
+
70
+ - prepare 成功:把 `data` 里的请求预览翻译成**人话摘要**(对象、动作、范围、可撤销性),连同 `warnings` 一起给用户,然后等确认。不要把 `continuation` 当业务结果展示,也不要截断或改写它。
71
+ - apply 成功:`data` 是服务端返回的业务结果(新文档 ID、新文件夹 ID、上传后的 `file_id`、共享列表等)。摘要关键 ID 与名称,并说明「已生效」。
72
+ - apply 失败:按 `error.type` / `error.subtype` 判断。**只要错误发生在请求已发出之后,一律不得自动重放**。
73
+ - 多步写入(`cover.set` = 上传 + 改字段、`document.replace-content` = 上传 + 替换 + 通知、`document.create-by-upload` = 批量上传)失败时,先看 `data.summary` 与 `warnings` 判断已完成到哪一步,再决定是否需要人工在 E10 页面复核。
74
+
75
+ ## 写结果不确定的决策树
76
+
77
+ 出现「请求已发出但结果未知」的情形(网络超时、连接被重置、`response_shape` / `empty_response`、进程被中断),按顺序执行:
78
+
79
+ 1. **立即停止**,不要重试同一个 apply,也不要用同一个 `continuation` 再跑一次。
80
+ 2. **最多做一次只读回查**确认实际状态:
81
+ - 文档创建 → `caizhilian.document.search`(按名称 + `folder_id` + 创建时间)
82
+ - 文档字段/正文/作者 → `caizhilian.document.get`
83
+ - 文件夹 → `caizhilian.folder.query-by-name`
84
+ - 权限/默认共享 → `caizhilian.folder.permission.list` / `caizhilian.folder.default-share.list`
85
+ - 标签/参与人/共享 → `caizhilian.tag.list` / `caizhilian.participant.list` / `caizhilian.share.list`
86
+ - 附件/比对文件 → `caizhilian.compare.list-file-objects`
87
+ 3. **回查结果二选一**:
88
+ - 已生效 → 告知用户「操作已成功」,不再重放。
89
+ - 未生效 → 告知用户失败原因,**重新 prepare**(拿新票据)后再由用户确认执行;不要复用旧票据。
90
+ 4. 回查本身也失败 → 停止,把原始错误交给用户,建议在 E10 页面人工核对。
91
+
92
+ > 说明:`partial/write_uncertain` 是错误分类里保留的「写结果不确定」类型;采知连模块当前把批量与多步写入的部分失败通过 `warnings` + `data.summary` 表达,遇到上述网络类不确定情形时按本节决策树处理。
93
+
94
+ ## 注意
95
+
96
+ - **绝不允许跳过 prepare 直接 apply**,也不允许由 Agent 自行编造 `continuation`。没有票据就没有写权限。
97
+ - `--yes` 只能在**用户已经明确同意**之后使用。用户说「先看看」或没有回应,都等于未确认。
98
+ - 删除类操作(`folder.default-share.delete`、`folder.permission.delete`、`share.delete`、`participant.remove`、`tag.remove`、`cover.remove`)**不可撤销**,确认摘要必须列出被删对象的名称与 ID,并明示不可恢复。
99
+ - 扩大可见范围的操作(`share.add`、`folder.permission.set-auth` 从 `user` 改成 `true`、`folder.permission.add` 给 `all`)属于**信息暴露面扩大**,必须在摘要里写明「谁会因此看到什么」。
100
+ - 一次确认只对一次 apply 有效:票据用过即失效语义上不应复用,重复 apply 同一票据属于误用,需重新 prepare。
101
+ - 不要把票据、Cookie、ETEAMSID、Token 写进回复、日志或提交到仓库。
102
+
103
+ ## 失败处理
104
+
105
+ | error.type / subtype | 含义 | 处理 |
106
+ | --- | --- | --- |
107
+ | `confirmation/required` | apply 缺 `confirm: true` | 先向用户摘要并取得确认,再加 `--yes` 重跑 apply |
108
+ | `validation/continuation_required` | apply 缺 `continuation` | 先跑 prepare 拿票据 |
109
+ | `validation/continuation_invalid` | 票据签名校验失败或无法解析 | 重新 prepare;不要修改票据字符串 |
110
+ | `validation/continuation_expired` | 超过 10 分钟有效期 | 重新 prepare |
111
+ | `validation/continuation_mismatch` | 票据被用于别的 apply 操作 | 用对应操作的 prepare 重新签发 |
112
+ | `validation/continuation_context_mismatch` | 环境(baseUrl)或登录账号已变 | 确认目标环境后重新 prepare |
113
+ | `validation/continuation_target_changed` | 关键字段(如 `doc_id`)与 prepare 不一致 | 重新 prepare |
114
+ | `validation/continuation_args_changed` | 整体入参指纹与 prepare 不一致 | 用与 prepare 完全相同的入参,或重新 prepare |
115
+ | `validation/plan_changed` | 组装出的请求体指纹与 prepare 不一致(表单级联结果或服务端状态已变) | 重新 prepare,并把变化告知用户 |
116
+ | `validation/file_changed` | prepare 后本地文件 MD5/大小变化 | 与用户确认文件后重新 prepare |
117
+ | `authentication/session_expired` | 登录态失效 | 停止,引导重新登录,然后从 prepare 重新开始 |
118
+ | `api/business_error` | 服务端业务拒绝 | 原样转述 message;写操作不要重复提交 |
119
+ | `network/*`(retryable) | 请求未确认送达 | 按上文决策树:停止 → 一次只读回查 → 必要时重新 prepare |
120
+ | `partial/write_uncertain` | 写结果不确定 | 同上决策树,禁止自动重放 |
@@ -15,8 +15,8 @@ cliHelp: "weaver-work-cli calendar --help"
15
15
 
16
16
  # 泛微E10日程管理
17
17
 
18
- **CRITICAL — 开始前 MUST 先用 Read 工具读取 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md),其中包含安装、E10 认证、JSON 输出和高风险写入规则。若不存在则必须先执行 `weaver-work-cli skills install shared --target-dir <当前Agent的Skills目录>`,若 CLI 未安装则先执行 `npm install -g weaver-work-cli`,安装或读取失败时必须停止执行。**
19
-
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 不能在未确认时自行安装。用户明确确认后,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
20
 
21
21
  本技能覆盖日程管理业务域:**创建日程**、**查询列表**、**查询详情**、**查询总数**、**更新日程**、**删除日程**、**查询类型/紧急程度字典**、**应用版本检测**。写操作(创建/更新/删除)全部走 prepare→apply 确认协议。
22
22
 
@@ -102,5 +102,6 @@ weaver-work-cli --json calendar run calendar.list --input-json '{"page_no":1,"pa
102
102
  macOS/Linux(bash/zsh):
103
103
 
104
104
  ```bash
105
- printf '%s\n' '{"page_no":1,"page_size":10}' | weaver-work-cli --json calendar run calendar.list --input -
105
+ printf '%s
106
+ ' '{"page_no":1,"page_size":10}' | weaver-work-cli --json calendar run calendar.list --input -
106
107
  ```
@@ -11,23 +11,18 @@ agent_created: true
11
11
  requires:
12
12
  bins: ["weaver-work-cli"]
13
13
  dependencies:
14
- - weaver-e10-login
14
+ - weaver-e10-shared
15
15
  cliHelp: "weaver-work-cli ebuilder-form --help"
16
16
  ---
17
17
 
18
18
  # 泛微E10 eBuilder表单
19
19
 
20
- **CRITICAL — 开始前 MUST 先用 Read 工具读取 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md),其中包含安装、E10 认证、JSON 输出和高风险写入规则。若不存在则必须先执行 `weaver-work-cli skills install shared --target-dir <当前Agent的Skills目录>`,若 CLI 未安装则先执行 `npm install -g weaver-work-cli`,安装或读取失败时必须停止执行。**
20
+ **CRITICAL — 开始前 MUST 先用 Read 工具读取 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md),其中包含安装、E10 认证、JSON 输出和高风险写入规则。若共享规则不存在、CLI 未安装或读取失败,说明本技能的必需依赖缺失,必须调用宿主提供的提问/确认弹框,向用户说明必须补齐 `weaver-work-cli` 与共享 skill `weaver-e10-shared`(不补齐本技能无法执行)及补齐计划,并把下面两条待执行命令原样完整展示在确认信息中;Agent 不能在未确认时自行安装。用户明确确认后,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`——省略会装进默认目录,导致本技能依然读不到共享规则。命令均成功后重新读取共享规则;仍读不到就停止并把结果报告用户,不得凭猜测继续。**
21
+ **`--is-connector` 判据**:用户明确使用连接器、或上下文要求用连接器完成任务 → 传 `true`;本次任务或上下文直接选择单独技能 → 不传;用户没有明确说明时,按**正在运行的这份 Skill 是哪一级**定——**用户级(条目标 `(user)`)不传,连接器级(标 `(connector)`)传**(同名 Skill 只会运行用户级那一份)。传 `true` 时不要再写 `--profile` / `--base-url`。完整规则见 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md)。
21
22
 
22
23
  本技能覆盖 eBuilder 表单菜单定位、List/NList 页面查询、字段/选项/浏览字段解析,以及 OpenAPI 和已发布自定义接口的表单数据读写。所有业务调用必须通过 `weaver-work-cli ebuilder-form`,禁止绕过 CLI 直接拼 E10 接口、Cookie、ETEAMSID 或 `/api/bs/` 路径。
23
24
 
24
- 认证由 `weaver-work-cli` 共享登录能力和 `weaver-e10-login` 兼容依赖托管。底层请求头由 CLI 自动设置,Agent 不得在对话或命令输入中索取、粘贴或输出这些凭证:
25
-
26
- ```text
27
- Cookie: <e10-login 返回的完整原始 Cookie 串>(禁止裁剪/去重/改写)
28
- eteamsid: <e10-login 返回的 ETEAMSID>
29
- User-Agent: AgentType=<agentType>,IsAgent=true
30
- ```
25
+ 认证由 `weaver-e10-shared` 共享规则和 `weaver-work-cli auth ...` 命令体系托管。底层请求头三件套由 CLI 统一注入,Agent 不得在对话或命令输入中索取、粘贴或输出这些凭证;唯一权威声明见 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md) 的「请求头契约」章节。
31
26
 
32
27
  ## 命令入口
33
28
 
@@ -4,15 +4,6 @@
4
4
 
5
5
  用户给了菜单名、页面 URL,或需要拿到 `appId` / `apiPrefix` / `objId` / `listId` / 页面地址时使用。这是几乎所有其它 operation 的前置步骤。
6
6
 
7
- ## 请求头契约(CLI 注入,Agent 不手写)
8
-
9
- CLI 发往 E10 的每个请求都自动携带以下三项用户信息参数,缺一不可(业务入参里不要传这些字段,也不要手工拼装请求头):
10
-
11
- ```text
12
- Cookie: <e10-login 返回的完整原始 Cookie 串>(禁止裁剪/去重/改写)
13
- eteamsid: <e10-login 返回的 ETEAMSID>
14
- User-Agent: AgentType=<agentType>,IsAgent=true
15
- ```
16
7
 
17
8
  ## operation
18
9
 
@@ -8,11 +8,7 @@
8
8
 
9
9
  ## 请求头契约(CLI 注入,Agent 不手写)
10
10
 
11
- ```text
12
- Cookie: <e10-login 返回的完整原始 Cookie 串>(禁止裁剪/去重/改写)
13
- eteamsid: <e10-login 返回的 ETEAMSID>
14
- User-Agent: AgentType=<agentType>,IsAgent=true
15
- ```
11
+ 请求头三件套由 `weaver-work-cli` 统一注入,Agent 不手写、不覆盖;唯一权威声明见 [`../../weaver-e10-shared/SKILL.md`](../../weaver-e10-shared/SKILL.md) 的「请求头契约」章节。
16
12
 
17
13
  ## operation
18
14
 
@@ -8,11 +8,7 @@
8
8
 
9
9
  ## 请求头契约(CLI 注入,Agent 不手写)
10
10
 
11
- ```text
12
- Cookie: <e10-login 返回的完整原始 Cookie 串>(禁止裁剪/去重/改写)
13
- eteamsid: <e10-login 返回的 ETEAMSID>
14
- User-Agent: AgentType=<agentType>,IsAgent=true
15
- ```
11
+ 请求头三件套由 `weaver-work-cli` 统一注入,Agent 不手写、不覆盖;唯一权威声明见 [`../../weaver-e10-shared/SKILL.md`](../../weaver-e10-shared/SKILL.md) 的「请求头契约」章节。
16
12
 
17
13
  ## operation
18
14
 
@@ -8,11 +8,7 @@
8
8
 
9
9
  ## 请求头契约(CLI 注入,Agent 不手写)
10
10
 
11
- ```text
12
- Cookie: <e10-login 返回的完整原始 Cookie 串>(禁止裁剪/去重/改写)
13
- eteamsid: <e10-login 返回的 ETEAMSID>
14
- User-Agent: AgentType=<agentType>,IsAgent=true
15
- ```
11
+ 请求头三件套由 `weaver-work-cli` 统一注入,Agent 不手写、不覆盖;唯一权威声明见 [`../../weaver-e10-shared/SKILL.md`](../../weaver-e10-shared/SKILL.md) 的「请求头契约」章节。
16
12
 
17
13
  ## operation
18
14
 
@@ -8,11 +8,7 @@
8
8
 
9
9
  ## 请求头契约(CLI 注入,Agent 不手写)
10
10
 
11
- ```text
12
- Cookie: <e10-login 返回的完整原始 Cookie 串>(禁止裁剪/去重/改写)
13
- eteamsid: <e10-login 返回的 ETEAMSID>
14
- User-Agent: AgentType=<agentType>,IsAgent=true
15
- ```
11
+ 请求头三件套由 `weaver-work-cli` 统一注入,Agent 不手写、不覆盖;唯一权威声明见 [`../../weaver-e10-shared/SKILL.md`](../../weaver-e10-shared/SKILL.md) 的「请求头契约」章节。
16
12
 
17
13
  ## operation
18
14
 
@@ -8,11 +8,7 @@
8
8
 
9
9
  ## 请求头契约(CLI 注入,Agent 不手写)
10
10
 
11
- ```text
12
- Cookie: <e10-login 返回的完整原始 Cookie 串>(禁止裁剪/去重/改写)
13
- eteamsid: <e10-login 返回的 ETEAMSID>
14
- User-Agent: AgentType=<agentType>,IsAgent=true
15
- ```
11
+ 请求头三件套由 `weaver-work-cli` 统一注入,Agent 不手写、不覆盖;唯一权威声明见 [`../../weaver-e10-shared/SKILL.md`](../../weaver-e10-shared/SKILL.md) 的「请求头契约」章节。
16
12
 
17
13
  ## operation
18
14
 
@@ -15,8 +15,8 @@ cliHelp: "weaver-work-cli esb --help"
15
15
 
16
16
  # 泛微E10 ESB动作流执行
17
17
 
18
- **CRITICAL — 开始前 MUST 先用 Read 工具读取 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md),其中包含安装、E10 认证、JSON 输出和高风险写入规则。若不存在则必须先执行 `weaver-work-cli skills install shared --target-dir <当前Agent的Skills目录>`,若 CLI 未安装则先执行 `npm install -g weaver-work-cli`,安装或读取失败时必须停止执行。**
19
-
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 不能在未确认时自行安装。用户明确确认后,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
20
 
21
21
  本技能覆盖 ESB 中心的**自定义触发类型动作流**:取入参模板(只读)与执行动作流(写操作,需确认)。按动作流名称解析 ID、唯一值对应的 `primary_key` SQL 查询都不在本技能范围内,见「不在范围」。
22
22
 
@@ -104,12 +104,12 @@
104
104
  }
105
105
  },
106
106
  "artifactBaseline": {
107
- "aggregateSha256": "9867d4f6de7aa27f37e6bad3702e22b3d2f3fe5b62157642e32861a1847c22f9",
107
+ "aggregateSha256": "13a4b9b7beec15e4377ab86dc220dde327c9b398dacd88d8f691b9e21cf7f30f",
108
108
  "files": [
109
109
  {
110
110
  "path": "docs/_catalog.md",
111
- "size": 4580,
112
- "sha256": "7ec48267965b4ccd35dcc463ed0a73dd71c3f4d2fc3d978165f508261945d4b3"
111
+ "size": 5332,
112
+ "sha256": "a81903939aea5bf1196d1e3243709d2facf50d9bdcf74d8a6ca731061310dbbe"
113
113
  },
114
114
  {
115
115
  "path": "docs/esb.md",
@@ -123,8 +123,8 @@
123
123
  },
124
124
  {
125
125
  "path": "skill-template/business-info.json",
126
- "size": 6294,
127
- "sha256": "7af8cc1b35564b11a4c33cf566b22919d75c8a4daeec488d6ff8979c098c8ff7"
126
+ "size": 8216,
127
+ "sha256": "370a45e86c6b7e33869c5df1bf08d9f22bd98fa8b157b49716e13bca0e7b63c3"
128
128
  },
129
129
  {
130
130
  "path": "skill-template/domains/esb.md",
@@ -149,8 +149,8 @@
149
149
  },
150
150
  {
151
151
  "path": "skills/weaver-e10-esb/SKILL.md",
152
- "size": 6841,
153
- "sha256": "b6b1bb5c629ef627267de04922e0f5a9504fe7eafe52f8406924f2981a14198d"
152
+ "size": 8073,
153
+ "sha256": "a12d79807348cdb3be2e17bfdca1fc783f5be004eb4b76906db73b81ea203d00"
154
154
  },
155
155
  {
156
156
  "path": "src/shortcuts/esb/continuation.ts",
@@ -209,8 +209,8 @@
209
209
  },
210
210
  {
211
211
  "path": "src/shortcuts/index.ts",
212
- "size": 1274,
213
- "sha256": "54df058151b6f3602a2d112a49396b4ad4121cdba06d31c4c368ebd3235192c4"
212
+ "size": 1420,
213
+ "sha256": "569bef374df2d86b511150a0c609ce1abee63f8317994513bce6241276b5be40"
214
214
  },
215
215
  {
216
216
  "path": "test/business/esb-command.test.ts",
@@ -5,7 +5,7 @@ display_name_en: Weaver E10 Organization Management
5
5
  description: 泛微E10组织管理(员工/组织/岗位查询)的 E10 查询能力,通过 weaver-work-cli hrm 命令执行。
6
6
  description_zh: 泛微E10组织管理(员工/组织/岗位查询)的 E10 查询能力,通过 weaver-work-cli hrm 命令执行。
7
7
  description_en: Weaver E10 Organization Management capabilities for E10, covering employee, organization and position queries, delivered through the weaver-work-cli hrm command.
8
- version: 1.0.0
8
+ version: 1.0.28
9
9
  author: 泛微网络科技股份有限公司
10
10
  agent_created: true
11
11
  requires:
@@ -15,10 +15,10 @@ cliHelp: "weaver-work-cli hrm --help"
15
15
 
16
16
  # 泛微E10组织管理
17
17
 
18
- **CRITICAL — 开始前 MUST 先用 Read 工具读取 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md),其中包含安装、E10 认证、JSON 输出和高风险写入规则。若不存在则必须先执行 `weaver-work-cli skills install shared --target-dir <当前Agent的Skills目录>`,若 CLI 未安装则先执行 `npm install -g weaver-work-cli`,安装或读取失败时必须停止执行。**
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 不能在未确认时自行安装。用户明确确认后,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)。
19
20
 
20
-
21
- 本技能覆盖组织管理三大业务域:**员工(employee)**、**组织(org)**、**岗位(position)**,全部为只读查询,无写操作。代理商查询(`containsDls=true`)属于禁用边界,见 [`references/employee.md`](references/employee.md)。
21
+ 本技能覆盖组织管理三大业务域:**员工(employee)**、**组织(org)**、**岗位(position)**,全部为只读查询,无写操作。代理商查询(`containsDls=true`)属于禁用边界,见 [`references/employee.md`](references/employee.md)。组织域额外提供**多维(虚拟组织维度)解析** `hrm.org.resolve`,见下方「多维解析」。
22
22
 
23
23
  ## 命令入口
24
24
 
@@ -42,24 +42,117 @@ weaver-work-cli --json hrm run <operation> --input -
42
42
  | --- | --- |
43
43
  | 查员工、工号/手机/邮箱、查下属、部门成员、批量人员、人员详情 | [`references/employee.md`](references/employee.md) |
44
44
  | 查分部、查部门、组织架构、层级路径、组织详情 | [`references/org.md`](references/org.md) |
45
+ | **按「多维名称 + 部门/分部名称」找组织**(多维 / 虚拟组织 / 维度) | [`references/org.md`](references/org.md) 的「多维解析」 |
45
46
  | 查岗位、岗位详情、批量岗位 | [`references/position.md`](references/position.md) |
47
+ | **按部门/分部反查人员**(某部门下有哪些人) | [`references/employee.md`](references/employee.md) 的「按组织反查人员」 |
48
+ | **按岗位反查人员**(某岗位下有哪些人) | 本技能不支持,需跨到 `weaver-e10-jucailin`;先读下方「反查人员的能力边界」 |
49
+
50
+ ## 多维解析(`hrm.org.resolve`):一次调用,禁止自己分两步推理
51
+
52
+ E10 组织树按**多维**(虚拟组织维度,如「行政组织」「1号维度」「备份维度」)切分,同名部门/分部在不同维度下是**不同节点**;组织浏览接口不传 `companyId` 会**默认落到「行政组织」维度**。所以「按名称找部门/分部」需要先定位多维 id,再带 `companyId` 查组织。
53
+
54
+ **这段编排已在 CLI 内实现,Agent 只调一次 `hrm.org.resolve`,不要自己先查维度、再查组织。**
55
+
56
+ ```text
57
+ weaver-work-cli --json hrm run hrm.org.resolve --input-json '{"virtual":"1号维度","name":"第一团队"}'
58
+ ```
59
+
60
+ - 入参:`virtual`(多维名称)+ `name`(部门/分部名称);`type` 可选(`department`/`subcompany`,**不传时同时检索两者、按部门优先定位**);歧义候选**默认最多回 20 条**,要一次性看全时传 `maxCandidates`(1~200)。
61
+ - 匹配分**三级**,"能不能自动往下走"完全不同,别混为一谈:
62
+
63
+ | 级别 | 判定 | CLI 行为 |
64
+ | --- | --- | --- |
65
+ | ① 精确 | 忽略大小写/空白的全等 | 唯一 → 继续;多个 → `ambiguous` |
66
+ | ② 包含(模糊) | 名称是关键字子串 | 唯一 → 继续;多个 → `ambiguous` |
67
+ | ③ **近似(打字级差异,如「客服维度」→「客户维度」)** | 编辑距离阈值内 | **只回 `suggestions`,`status = not_found`,绝不继续** |
68
+
69
+ ### 🔴 不要替用户做主(三条硬边界,违反即算答错)
70
+
71
+ 1. **禁止自行替换/纠正名称**。用户说「客服维度」,就只能在「客服维度」不存在时**如实告知**;不许把「客户维度」当成用户的意思直接用(这是最典型的越权:看着像就替用户认了)。
72
+ 2. **禁止在 `ambiguous` 里替用户选**。不许取第一条、不许取「看起来最像的」、不许取「唯一直属根节点的」——一律列表让用户挑。
73
+ 3. **`not_found` ≠ 换个名字再试**。必须把 `data.message` + `data.suggestions`(近似名称)+ `data.availableVirtuals`(该租户全部多维)原样交给用户,等用户确认;**用户确认后**才用 `virtualId`(维度)/ `orgId`(组织)复调,不要再用名称猜。
74
+
75
+ > 实例:`{"virtual":"客服维度","name":"云桥测试"}` → `not_found`(`suggestions: [客户维度]`)。正确回复是「本租户没有『客服维度』,最接近的是『客户维度』(id …),要用它继续查『云桥测试』吗?」——**不是**直接返回客户维度下的结果。
76
+ > 反过来,③ 之外的 ①② 是 CLI 既定行为(属于系统收敛,不属于你改名),命中了就正常往下走。
77
+
78
+ - **结果判定只看 `data.status`,不要只看 `ok`**(本操作三种结果都是 `ok: true`):
79
+
80
+ | `data.status` | 含义 | Agent 必须做什么 |
81
+ | --- | --- | --- |
82
+ | `resolved` | 已定位唯一组织 | 用 `data.org`(`id`/`name`/`type`/`fullPath`/`link`)直接回答,用 `[名称](link)` 呈现;**若同时回 `data.alsoMatched`(同名但另一类型的节点,如既有同名部门又有同名分部),必须一并告知用户**,不要只报 `org` |
83
+ | `ambiguous` | 精确或包含命中多个 | **停下来问用户**:把 `data.candidates` 以表格(名称 / `fullPath` / link)列出让用户选,不要自行挑一个;候选被截断(`truncated: true`)时先告知总数,用户要全量就用 `maxCandidates` 复调 |
84
+ | `not_found` | 名称不存在(含"只有近似名称"的情况) | 原样转述 `data.message`,并把 `data.suggestions`/`data.availableVirtuals` 一并给用户确认;**禁止自行替换名称后重试** |
85
+
86
+ - 用户确认候选后**复调同一个操作**:把候选的 `id` 作为 `orgId` 传回(若是维度歧义,把维度 `id` 作为 `virtualId` 传回),一次即可定位;**不要再用名称重试猜**。
87
+ - **🔴「这个租户有哪些多维」暂不支持**(`hrm.org.virtuals` 已下线,`hrm schema --full` 的 `withheldOperations` 里有声明):
88
+ - 没有列维度的 operation,**也不许绕**——不要故意传一个不存在的维度名去套 `not_found.availableVirtuals` 来"列清单",那属于构造假查询。
89
+ - `availableVirtuals` 只用于**纠错**(用户给的名字对不上时,顺手告诉他本租户有哪些维度可参考),维度 id 也只从 `not_found.availableVirtuals` / 维度歧义的 `candidates` 里取。
90
+ - 用户明确问"有哪些多维"时 → 直接回答**该能力暂不支持**,并请其改用「维度名 + 组织名」的方式查询。
91
+ - 完整契约、匹配规则与示例见 [`references/org.md`](references/org.md) 的「多维解析」。
92
+
93
+ ## 反查人员的能力边界
94
+
95
+ "这个部门/岗位下有哪些人"是高频误判点,先按下表判断,**不要默认认为 hrm 整个模块都做不到**:
96
+
97
+ | 起点 | 支持情况 | 走哪里 |
98
+ | --- | --- | --- |
99
+ | 部门 / 分部 | ✅ 支持 | `hrm.dept.members`(同模块,**只返回直属成员,不含子部门**) |
100
+ | 岗位 | ❌ 不支持反查 | `position.*` 只给 `userCount` 人数,`employee.query` 不支持按岗位过滤;需跨到聚才林通讯录高级搜索 `ehr.hr.contact.search` + `saCondition` |
101
+
102
+ 只有**岗位反查**才需要跨模块。以下护栏**自包含**,跨模块前读完;聚才林技能(`weaver-e10-jucailin`,连接器版 `weaver-e10-jucailin-connector`)的通讯录高级搜索条件文档是补充,不是前置依赖(读不到也必须按本节执行)。
103
+
104
+ **陷阱 1 · 条件元素漏字段键 → 整个条件被静默丢弃**
105
+
106
+ `saCondition` 的每个字段值是「条件对象数组」,**元素内部必须再带一个服务端认识的键**(字段同名键,或 `xxx_condition` 算子键):
107
+
108
+ | 字段类型 | 正确写法 |
109
+ | --- | --- |
110
+ | BROWSER(岗位/部门/分部/上级) | `"position": [{ "position": [{ "id": "<id>", "includeSub": true }] }]` |
111
+ | SELECT(状态/性别) | `"personnel_status": [{ "personnel_status": ["normal"] }]` |
112
+ | INPUT(姓名/工号) | `"username": [{ "username_condition": "in", "username": "杰" }]` |
113
+
114
+ 写成 `"position": [{ "id": "<id>" }]`(元素里只有裸 id)时**不报错、不返回错误码**,服务端直接忽略该条件——看起来"有结果",其实完全没过滤。
115
+
116
+ **陷阱 2 · `saCondition` 不继承"默认在职"**
117
+
118
+ 便捷字段路径默认在职;一旦改用 `saCondition` 且不写 `personnel_status`,就是**不限状态(含离职)**。两者叠加就是"无过滤 + 不限状态"。
119
+
120
+ **结果自检(必做,不得跳过)**
121
+
122
+ 跨模块反查后必须核对 `total`,再决定是否回复用户:
123
+
124
+ 1. 先取该租户的**全量基线 N**:用 `personnel_status: ["all"]`(或空条件)查一次,得到"不限状态总人数";
125
+ 2. 条件生效时 `total` 必须**明显小于 N**;
126
+ 3. **一旦 `total` 等于或接近 N,就判定为"条件被吞"**——不要回复"有这么多结果",回到上面两条检查条件结构后重查;
127
+ 4. 岗位反查的合理量级通常是**个位数到几十**(单个岗位不会等于全公司人数)。
128
+
129
+ > 量级示例(本次实测,随租户不同,**不可当常量**):全量含离职 N=44853、在职=11976、离职=32692,而 `{"position":[…正确…]}` 得到的真实岗位人数=1。写下这些数字只为说明"条件生效后 total 会掉几个数量级"。
46
130
 
47
131
  ## 跨模块约定(必须先知道)
48
132
 
49
133
  三个业务域统一走 E10 HRM 内部浏览/详情接口,响应统一 `WeaResult` 契约,已在 CLI 内归一化,但语义差异仍会影响结果解读:
50
134
 
51
135
  - **响应成功判定**:统一 `code=200`(WeaResult)。业务失败码即使 HTTP 200 也会抛 `api/business_error`;`403` 会抛 `api/permission_denied`(提示联系管理员开启接口开关,不盲目重试)。
52
- - **数据行位置**:列表接口行在 `data.data`(浏览按钮 `browser/data/*` 与岗位批量 `queryListByOrgTree`),总数在 `data.total`;员工浏览/下属查询因 `data/resource` 的 `data.count` 恒为 0,CLI 额外请求 `count/resource` 取真实 `data.total`。下属按 id 查询(`myDirectSubordinates`/`myIndirectSubordinates`)的行在 `data.page.result`、总数在 `data.page.totalCount`。
53
- - **详情接口**:员工名片(`profile/get`)、组织详情(`organization/getForm`)、岗位详情(`getEditOrAddPostForm`)返回单对象(`data` 直接承载),CLI 附 `link`。
136
+ - **数据行位置(描述的是上游原始响应,不是 CLI 输出)**:上游列表接口行在 `data.data`(浏览按钮 `browser/data/*` 与岗位批量 `queryListByOrgTree`);下属按 id 查询(`myDirectSubordinates`/`myIndirectSubordinates`)的行在 `data.page.result`、总数在 `data.page.totalCount`。
137
+ - CLI 已把上述差异归一化:**列表类统一读 envelope 的 `data.rows` + `data.total`,分页参数在 `meta`(current/pageSize)**。不要把上游的 `data.data` / `data.page.result` 当成 CLI 输出路径。
138
+ - ⚠️ **CLI 不会去请求 count 接口**(员工浏览上游的 `data.count` 恒为 0,调 count 也拿不到可靠总数):除 `subordinate.by-id` 外,`employee.query`/`subordinate.mine`/`dept.members` 的 `data.total` **就是本页行数**,不是真实总数。要真实总数只能按 `current` 逐页翻到 `rows.length < pageSize`;`subordinate.by-id` 的 `total` 来自上游 `page.totalCount`,是真值(并附 `data.page.hasNext/totalPages`)。
139
+ - **详情接口**:员工卡片(`card/get`)、组织详情(`organization/getForm`)、岗位详情(`getEditOrAddPostForm`)底层都是 `WeaForm` 单对象。**上游响应**里业务字段在 `data.data`;CLI 会把它**展平上移一层**,因此**最终输出中业务字段直接挂在 envelope 的 `data` 下,不存在 `data.data` 嵌套**(`items`/`groups`/`layout` 等前端表单元数据已丢弃),并附 `link`。
140
+ - **`hrm.employee.detail` 默认只回核心业务字段**(26 键,约完整卡片体积的 1/5;实体数组只留 `{id,name}`、人员数组只留 `{id,name,statusCode,avatar}`、`avatar` 只留 1 个 `url`)。**只有确实要完整卡片时才传 `full: true`** —— 默认别传,它会带回 `password`/`last_android`/`hideFieldList`/`setting`/各类 `*_admin` 等无用元数据,显著撑大上下文。
141
+ - **「人员列表」默认只回精简行**:`hrm.subordinate.mine` / `hrm.subordinate.by-id` / `hrm.dept.members` 每行只有 `id`/`name`/`link`(原始行 366B(`mine`/`dept.members`)/ 960B(`by-id`,其中上游 `superior` 对象一项就占 485B),精简后约 116~120B);`hrm.employee.query` 保留人员信息、每行 6 键(`id`/`name`/`department`/`position`/`statusCode`/`link`,368B → 186B)。需要部门/岗位/电话/上级等完整列时显式传 `full: true`;缺部门岗位信息时,优先对个别人再调 `hrm.employee.detail`(其精简卡片已含 `department`/`position` 的 `{id,name}`),**不要为列表好看就默认开 `full`**。
142
+ - **🔴 三套 id 不要混用**:人员行可能出现 `id`(**人员 id**,驼峰 `userId` 与它同值)、`userid`(登录信息 id)、`cid`(`employee.batch` 里叫 `imCid`,IM 联系人 id)。**只有人员 `id` 能用于**卡片链接、`employee.detail`、`employee.batch.ids`、`subordinate.by-id.id`;`userid`/`cid` 分别只用于登录账号与 IM 场景。`employee.query` 默认行只留人员 `id`,另两套仅在 `full: true` 时出现。
54
143
  - **长整型 id 一律按字符串传递**:人员 id、组织节点 id、岗位 id 都是长整型,避免精度丢失。
55
144
  - **手机号脱敏**:员工/批量/下属列表返回的 `mobile` 已由 CLI 脱敏(3 位前缀 + `****` + 末 4 位),Agent 直接呈现,不做二次处理。
56
145
 
57
146
  ## 安全边界
58
147
 
59
148
  - **🔴 无条件禁止全量拉取**:`employee.query`/`org.query`/`position.query` 必须携带至少一个收敛条件,无条件时先询问用户,禁止空条件调用。`position.list` 无 `org`/`name`/`code` 过滤时必须显式 `all=true`。
149
+ - **🔴 分页统一约束:`pageSize` 默认 `10`、最大 `100`**。支持 `pageSize` 的操作只有 `employee.query`/`subordinate.mine`/`subordinate.by-id`/`dept.members`/`org.query`/`position.list`;`position.query` 不接受该参数(传入被忽略,固定按 200 返回)。需要更多数据时用 `current` 递增翻页,**禁止靠放大 `pageSize` 一次取回大结果**——大结果会整段进入上下文。`position.list` 自带自动翻页,通常无需显式传 `pageSize`。
150
+ - 说明:服务端**不校验**该上限(实测 `pageSize=500` 会原样返回 500 行,不传 `pageSize` 时服务端按 20 返回),所以这条是**本技能为控制上下文体积定下的自觉约束**。Agent 必须遵守,不得因为"服务端没拦"就放大取值。
60
151
  - **🔴 `status` 不能单独使用**:`employee.query` 的 `status`(`["normal"]` 在职 / `["6"]` 离职)必须搭配其它条件(keyword/工号/姓名/手机/邮箱)。
61
152
  - **批量禁止循环单查**:批量查询一律走 `batch`(每批 ≤100,CLI 自动分批);岗位批量走 `position.list` 一次性返回,禁止按 id 逐个调详情。
62
- - **姓名/工号/名称模糊匹配**:多人命中时必须列出候选让用户选择,不得自动取第一条;`dept.members` 部门重名时报 `dept_ambiguous`,需改用组织 id。
153
+ - **姓名/工号/名称模糊匹配**:多人命中时必须列出候选让用户选择,不得自动取第一条;`dept.members` 部门重名时报 `dept_ambiguous`,需改用组织 id。`hrm.org.resolve` 不抛歧义错误,而是回 `data.status = ambiguous` + `data.candidates`,同样必须问用户、不得自动取第一条。
154
+ - **🔴 禁止自主任意解读名称**:`hrm.org.resolve` 报 `not_found` 时,`data.suggestions`(近似名称)**只是给用户看的提示,不是给你用的参数**——不得据此改名重试、也不得省略「不存在」这一事实直接给结果。凡「名称对不上」一律先回用户,用户确认后再用 `virtualId`/`orgId` 复调。
155
+ - **🔴 禁止绕取未暴露能力**:`hrm.employee.dls`(代理商查询)与 `hrm.org.virtuals`(列多维)都在 `hrm schema --full` 的 `withheldOperations` 里声明为不可用;**不得构造假查询(如故意传不存在的维度名)去套内部字段**、也不得编造或绕过。用户问到就如实回答暂不支持。
63
156
  - **人员 id、组织 id、岗位 id 都是长整型**,一律按字符串传递。
64
157
  - **代理商查询禁用**:`hrm.employee.dls`(`containsDls=true`)仅泛微自用系统支持,已列为禁用边界,不得编造或绕过。
65
158
 
@@ -67,7 +160,8 @@ weaver-work-cli --json hrm run <operation> --input -
67
160
 
68
161
  - `code=302` 或认证类错误:引导用户执行 `weaver-work-cli auth login`,不要用其他方式排查。
69
162
  - 业务失败看 stderr JSON 的 `error.type` / `error.subtype` / `error.message`,不要用退出码 `0` 判断成功。
70
- - 常见业务错误:`empty_condition`(空条件拉取被拦截)、`full_pull_blocked`(岗位全量需 `all=true`)、`dept_not_found`/`dept_ambiguous`(组织未找到或重名,改用 id)、`enum_invalid`(枚举取值非法)、`permission_denied`(接口开关未开启)。
163
+ - 常见业务错误:`empty_condition`(空条件拉取被拦截)、`full_pull_blocked`(岗位全量需 `all=true`)、`dept_not_found`/`dept_ambiguous`(组织未找到或重名,改用 id)、`enum_invalid`(枚举取值非法)、`permission_denied`(接口开关未开启)、`virtual_required`/`name_required`(`hrm.org.resolve` 缺多维或多维名称参数)。
164
+ - `hrm.org.resolve` 的「没找到 / 命中多个」**不是错误**:命令仍退出 0、`ok: true`,判定以 `data.status` 为准,不要把 `not_found` 当异常重试。
71
165
 
72
166
  ## 平台兼容
73
167
 
@@ -82,7 +176,8 @@ weaver-work-cli --json hrm run hrm.employee.query --input-json '{"keyword":"张
82
176
  macOS/Linux(bash/zsh):
83
177
 
84
178
  ```bash
85
- printf '%s\n' '{"keyword":"张三"}' | weaver-work-cli --json hrm run hrm.employee.query --input -
179
+ printf '%s
180
+ ' '{"keyword":"张三"}' | weaver-work-cli --json hrm run hrm.employee.query --input -
86
181
  ```
87
182
 
88
183
  复杂 JSON 建议保存为 UTF-8 文件后按平台传给 `--input <file>`。