weaver-work-cli 0.1.69 → 0.1.71

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 (232) hide show
  1. package/dist/chunks/{archive-VUTREF3P.js → archive-5P33NAUN.js} +22 -5
  2. package/dist/chunks/{archive-oa-VXXO4RTB.js → archive-oa-YTY5D7DG.js} +17 -5
  3. package/dist/chunks/{asset-45U6TY7I.js → asset-3Q5MFQBX.js} +22 -5
  4. package/dist/chunks/{asset-idle-YCRBMTIT.js → asset-idle-PQPNYIS7.js} +15 -5
  5. package/dist/chunks/{attachment-content-7BEDNQ3O.js → attachment-content-7CN7JB6B.js} +3 -3
  6. package/dist/chunks/{blog-5AML4WMG.js → blog-MFHHK6ZR.js} +25 -5
  7. package/dist/chunks/{caizhilian-3P7BUNHT.js → caizhilian-OZ435AYW.js} +22 -8
  8. package/dist/chunks/{calendar-2HUXM3CZ.js → calendar-TNJXS5UC.js} +15 -5
  9. package/dist/chunks/{chunk-H2NRTGZR.js → chunk-2DNCKZRX.js} +3 -3
  10. package/dist/chunks/{chunk-DVFA3ODS.js → chunk-35A56FJ7.js} +12 -0
  11. package/dist/chunks/{chunk-HG6INLH6.js → chunk-6MMSLE6K.js} +23 -6
  12. package/dist/chunks/{chunk-UVWW5ABZ.js → chunk-B4NINGP2.js} +3 -3
  13. package/dist/chunks/{chunk-LRKKKO5A.js → chunk-DRJYPXKC.js} +3 -4
  14. package/dist/chunks/{chunk-3TZURS7M.js → chunk-EJLP63UO.js} +1 -1
  15. package/dist/chunks/{chunk-FMAZ42HS.js → chunk-FRMDHZSN.js} +11 -11
  16. package/dist/chunks/{chunk-MLJK4KLE.js → chunk-G7ZM2VOX.js} +34 -34
  17. package/dist/chunks/{chunk-LSVA7QA6.js → chunk-GB2MCJPG.js} +3 -1
  18. package/dist/chunks/{chunk-3CBURKSY.js → chunk-ICNUOWLL.js} +4 -4
  19. package/dist/chunks/{chunk-GTAFCAVP.js → chunk-IZCQU5D5.js} +1 -1
  20. package/dist/chunks/{chunk-BEYEXCWU.js → chunk-LU2SPJYY.js} +2 -2
  21. package/dist/chunks/{chunk-E7VWE2XI.js → chunk-MD5RXRI3.js} +3 -3
  22. package/dist/chunks/{chunk-VZUH3LKI.js → chunk-MZVQKQP5.js} +167 -157
  23. package/dist/chunks/{chunk-67AN5YJT.js → chunk-OFCF23FY.js} +9 -9
  24. package/dist/chunks/{chunk-ERAE4GHX.js → chunk-OPTJ6IF7.js} +1 -1
  25. package/dist/chunks/{chunk-727VKJQK.js → chunk-OZ7CJC7W.js} +2 -2
  26. package/dist/chunks/{chunk-T24EBWAZ.js → chunk-P3AFNAJ6.js} +48 -21
  27. package/dist/chunks/{chunk-4XYRTXRR.js → chunk-Q3EXRNB4.js} +1 -1
  28. package/dist/chunks/{chunk-QYDSTYGG.js → chunk-SKWKCLJX.js} +3 -3
  29. package/dist/chunks/{chunk-DSBV4GRK.js → chunk-SSS75WXW.js} +3 -3
  30. package/dist/chunks/{chunk-I5XB4MZT.js → chunk-SUWR5QEG.js} +94 -65
  31. package/dist/chunks/{chunk-YR3K53BU.js → chunk-VJWVB55R.js} +2 -2
  32. package/dist/chunks/{chunk-JAIZY37Z.js → chunk-VMVMEIL3.js} +4 -4
  33. package/dist/chunks/chunk-WM33BSIL.js +136 -0
  34. package/dist/chunks/{chunk-6DH73Q5H.js → chunk-X2C5CGGM.js} +52 -51
  35. package/dist/chunks/{chunk-ELF5TPSG.js → chunk-XLSJC6JZ.js} +6 -6
  36. package/dist/chunks/{chunk-U3OO3IZF.js → chunk-YN5SD4TX.js} +20 -7
  37. package/dist/chunks/{conflict-VKCRXHUV.js → conflict-Y4PXZ2YQ.js} +2 -2
  38. package/dist/chunks/{contract-3PMHUASH.js → contract-C3BGUMBM.js} +48 -5
  39. package/dist/chunks/{cowork-FZBTTBYX.js → cowork-2AWG4QLA.js} +37 -8
  40. package/dist/chunks/{create-flow-WYPLBLRK.js → create-flow-LOUOK46Z.js} +6 -6
  41. package/dist/chunks/{data-2YZ6A6TL.js → data-BSFYMXVO.js} +99 -184
  42. package/dist/chunks/{ebuilder-form-AWPTMZBZ.js → ebuilder-form-LAAMTD2Y.js} +17 -7
  43. package/dist/chunks/{ehr-MNPR4TE5.js → ehr-36KEX5SH.js} +62 -13
  44. package/dist/chunks/{entry-mode-BCJ7RPFC.js → entry-mode-6N2IGCS4.js} +3 -3
  45. package/dist/chunks/{env-SCVCHBN2.js → env-QYLS3EB3.js} +2 -2
  46. package/dist/chunks/{esb-GSB5QCEX.js → esb-PTYS3E67.js} +17 -7
  47. package/dist/chunks/{factory-CBXYOEBF.js → factory-LPFPKZ4T.js} +1 -1
  48. package/dist/chunks/{fna-XBSNUS2V.js → fna-JNHCLRDE.js} +15 -5
  49. package/dist/chunks/{group-chat-RFL4U7RF.js → group-chat-QP2WX4QJ.js} +3 -3
  50. package/dist/chunks/{host-2UMNXX5H.js → host-57LSRSE7.js} +4 -4
  51. package/dist/chunks/{host-NVDG3NC6.js → host-7BVR7CQ3.js} +4 -4
  52. package/dist/chunks/{host-SYPCA63D.js → host-C2BLBIID.js} +4 -4
  53. package/dist/chunks/{host-XVWBOSEN.js → host-K2ZKNXME.js} +4 -4
  54. package/dist/chunks/{host-R7BP3CTI.js → host-NS36QFLR.js} +6 -4
  55. package/dist/chunks/{host-BD44ASOD.js → host-QXFKQXNX.js} +4 -4
  56. package/dist/chunks/{hrm-FZUDJAND.js → hrm-FSGO4NSH.js} +15 -6
  57. package/dist/chunks/{im-F5NENPD7.js → im-2BFGS2XO.js} +16 -6
  58. package/dist/chunks/{invoice-DS6FLU55.js → invoice-JKLTTHSZ.js} +27 -6
  59. package/dist/chunks/{jiuchuanhui-PY2WEBUH.js → jiuchuanhui-PTABJE7V.js} +1294 -1134
  60. package/dist/chunks/{lazy-dispatch-F6O2EPGR.js → lazy-dispatch-YN2ZP3CS.js} +6 -6
  61. package/dist/chunks/{mail-ZEOSANEJ.js → mail-YNO7ZZUK.js} +116 -97
  62. package/dist/chunks/{meeting-N2AGGLVI.js → meeting-NIDHDBCB.js} +29 -16
  63. package/dist/chunks/{minute-doc-C62EZOJH.js → minute-doc-G3QAT7DE.js} +4 -4
  64. package/dist/chunks/{okr-OZUMTMCL.js → okr-QC52G6AJ.js} +15 -5
  65. package/dist/chunks/{operations-LQY3FTPH.js → operations-2WHIF5WV.js} +1 -1
  66. package/dist/chunks/{operations-UTUWFJTX.js → operations-MQV32ITT.js} +5 -5
  67. package/dist/chunks/{performance-GBKM5G2Y.js → performance-3MQ3AHDQ.js} +97 -11
  68. package/dist/chunks/{plan-C2NENH42.js → plan-ISINIEPY.js} +15 -5
  69. package/dist/chunks/{project-FAJ2P3UR.js → project-IJ6DVKT7.js} +18 -5
  70. package/dist/chunks/{reception-NH6MJFPR.js → reception-3H5LUG2I.js} +17 -7
  71. package/dist/chunks/{recruit-stage-DPEFHLSE.js → recruit-stage-MIOJXP6W.js} +412 -85
  72. package/dist/chunks/{registry-7US3QQXV.js → registry-3GQRYP2R.js} +12 -12
  73. package/dist/chunks/{registry-Y2HWS6JS.js → registry-3S7AVMXR.js} +4 -4
  74. package/dist/chunks/{registry-FTPUUHWC.js → registry-NHHKOEU3.js} +5 -5
  75. package/dist/chunks/{room-recommend-LMNF76YS.js → room-recommend-IOKBJVYP.js} +4 -4
  76. package/dist/chunks/{schedule-4QE2THAP.js → schedule-IB6EUARH.js} +4 -4
  77. package/dist/chunks/{smart-extract-GTYKF5TJ.js → smart-extract-N2TK3CEF.js} +19 -6
  78. package/dist/chunks/{workflow-KXYTQZ2H.js → workflow-RINBAL2M.js} +22 -8
  79. package/dist/cmd/auth/index.js +23 -0
  80. package/dist/cmd/e10/index.js +2 -1
  81. package/dist/cmd/index.js +2 -0
  82. package/dist/core/manifest-view.js +207 -0
  83. package/dist/core/output.js +38 -8
  84. package/dist/index.js +35 -35
  85. package/dist/internal/e10/auth/crypto.js +18 -8
  86. package/dist/internal/e10/auth/error-log.js +1 -2
  87. package/dist/internal/e10/auth/messages.js +2 -3
  88. package/dist/internal/e10/auth/xiaoe.js +1 -1
  89. package/dist/internal/e10/tls-policy.js +61 -13
  90. package/dist/shortcuts/archive/index.js +11 -2
  91. package/dist/shortcuts/archive/operations/download.js +1 -0
  92. package/dist/shortcuts/archive/operations/flow-url.js +3 -0
  93. package/dist/shortcuts/archive/operations/prelib.js +2 -0
  94. package/dist/shortcuts/archive/operations/upload.js +1 -0
  95. package/dist/shortcuts/archive-oa/index.js +11 -2
  96. package/dist/shortcuts/archive-oa/operations/borrow-car.js +2 -0
  97. package/dist/shortcuts/asset/index.js +11 -2
  98. package/dist/shortcuts/asset/manifest.js +7 -0
  99. package/dist/shortcuts/asset-idle/index.js +11 -2
  100. package/dist/shortcuts/blog/index.js +11 -2
  101. package/dist/shortcuts/blog/manifest.js +10 -0
  102. package/dist/shortcuts/caizhilian/host.js +20 -4
  103. package/dist/shortcuts/caizhilian/index.js +12 -2
  104. package/dist/shortcuts/caizhilian/manifest.js +4 -25
  105. package/dist/shortcuts/caizhilian/operations/handlers/search.js +34 -0
  106. package/dist/shortcuts/caizhilian/operations/registry.js +25 -1
  107. package/dist/shortcuts/calendar/index.js +11 -2
  108. package/dist/shortcuts/contract/index.js +11 -2
  109. package/dist/shortcuts/contract/manifest.js +32 -0
  110. package/dist/shortcuts/contract/operations/write.js +3 -0
  111. package/dist/shortcuts/cowork/index.js +21 -5
  112. package/dist/shortcuts/cowork/manifest.js +3 -0
  113. package/dist/shortcuts/cowork/operations/discuss-write.js +2 -0
  114. package/dist/shortcuts/cowork/operations/item-write.js +3 -0
  115. package/dist/shortcuts/cowork/operations/member-write.js +2 -0
  116. package/dist/shortcuts/cowork/operations/permission-write.js +2 -0
  117. package/dist/shortcuts/cowork/operations/review-write.js +1 -0
  118. package/dist/shortcuts/data/errors.js +16 -29
  119. package/dist/shortcuts/data/host.js +16 -7
  120. package/dist/shortcuts/data/index.js +12 -41
  121. package/dist/shortcuts/data/manifest.js +5 -44
  122. package/dist/shortcuts/data/operations/attend.js +2 -2
  123. package/dist/shortcuts/data/operations/conf.js +0 -88
  124. package/dist/shortcuts/data/operations/ds.js +4 -4
  125. package/dist/shortcuts/data/operations/index.js +1 -5
  126. package/dist/shortcuts/data/operations/module.js +40 -14
  127. package/dist/shortcuts/data/operations/query.js +2 -2
  128. package/dist/shortcuts/ebuilder-form/index.js +11 -2
  129. package/dist/shortcuts/ebuilder-form/manifest.js +12 -0
  130. package/dist/shortcuts/ehr/index.js +11 -2
  131. package/dist/shortcuts/ehr/operations/attend-write.js +51 -8
  132. package/dist/shortcuts/esb/index.js +11 -2
  133. package/dist/shortcuts/esb/manifest.js +2 -0
  134. package/dist/shortcuts/fna/index.js +11 -2
  135. package/dist/shortcuts/hrm/index.js +11 -1
  136. package/dist/shortcuts/im/index.js +11 -2
  137. package/dist/shortcuts/invoice/index.js +11 -2
  138. package/dist/shortcuts/invoice/manifest.js +8 -0
  139. package/dist/shortcuts/jiuchuanhui/cache.js +49 -35
  140. package/dist/shortcuts/jiuchuanhui/host.js +37 -5
  141. package/dist/shortcuts/jiuchuanhui/index.js +57 -7
  142. package/dist/shortcuts/jiuchuanhui/manifest.js +38 -1
  143. package/dist/shortcuts/jiuchuanhui/operations/customer-quick.js +110 -0
  144. package/dist/shortcuts/jiuchuanhui/operations/datajson.js +11 -56
  145. package/dist/shortcuts/jiuchuanhui/operations/esb.js +9 -16
  146. package/dist/shortcuts/jiuchuanhui/operations/generic.js +8 -30
  147. package/dist/shortcuts/jiuchuanhui/operations/registry.js +8 -2
  148. package/dist/shortcuts/jiuchuanhui/operations/shared.js +0 -10
  149. package/dist/shortcuts/mail/errors.js +14 -0
  150. package/dist/shortcuts/mail/index.js +23 -6
  151. package/dist/shortcuts/mail/manifest.js +11 -4
  152. package/dist/shortcuts/mail/operations/mail-blacklist.js +6 -6
  153. package/dist/shortcuts/mail/operations/mail-contacts.js +10 -10
  154. package/dist/shortcuts/mail/operations/mail-manage.js +15 -14
  155. package/dist/shortcuts/mail/operations/mail-read.js +7 -25
  156. package/dist/shortcuts/mail/operations/mail-send.js +12 -12
  157. package/dist/shortcuts/mail/operations/mail-sign.js +10 -10
  158. package/dist/shortcuts/mail/operations/mail-template.js +10 -10
  159. package/dist/shortcuts/meeting/index.js +11 -2
  160. package/dist/shortcuts/meeting/operations/invitation-publish.js +1 -0
  161. package/dist/shortcuts/okr/index.js +11 -2
  162. package/dist/shortcuts/performance/index.js +62 -3
  163. package/dist/shortcuts/performance/operations/flow-detail.js +5 -4
  164. package/dist/shortcuts/performance/scheme-validate.js +7 -0
  165. package/dist/shortcuts/performance/shared.js +40 -2
  166. package/dist/shortcuts/plan/index.js +11 -2
  167. package/dist/shortcuts/project/index.js +11 -2
  168. package/dist/shortcuts/project/operations/write.js +3 -0
  169. package/dist/shortcuts/reception/index.js +11 -2
  170. package/dist/shortcuts/reception/manifest.js +2 -2
  171. package/dist/shortcuts/reception/operations/ask.js +3 -0
  172. package/dist/shortcuts/recruit-stage/index.js +22 -3
  173. package/dist/shortcuts/recruit-stage/manifest.js +2 -0
  174. package/dist/shortcuts/recruit-stage/operations/jd-create.js +33 -16
  175. package/dist/shortcuts/recruit-stage/operations/profile.js +186 -0
  176. package/dist/shortcuts/recruit-stage/operations/registry.js +2 -0
  177. package/dist/shortcuts/recruit-stage/operations/resume-import.js +76 -47
  178. package/dist/shortcuts/recruit-stage/operations/search.js +151 -16
  179. package/dist/shortcuts/recruit-stage/operations/tag.js +17 -3
  180. package/dist/shortcuts/recruit-stage/shared.js +11 -1
  181. package/dist/shortcuts/smart-extract/index.js +11 -2
  182. package/dist/shortcuts/smart-extract/manifest.js +1 -0
  183. package/dist/shortcuts/smart-extract/operations/save.js +2 -0
  184. package/dist/shortcuts/workflow/index.js +21 -1
  185. package/dist/shortcuts/workflow/operations/aiDeepRead/collect.js +5 -2
  186. package/dist/shortcuts/workflow/operations/read.js +2 -2
  187. package/dist/shortcuts/workflow/operations/write.js +1 -1
  188. package/docs/caizhilian.md +1 -1
  189. package/docs/contract.md +1 -0
  190. package/docs/data.md +22 -22
  191. package/docs/e10-auth.md +41 -33
  192. package/docs/ehr.md +2 -0
  193. package/docs/jiuchuanhui.md +17 -5
  194. package/docs/reception.md +4 -3
  195. package/package.json +1 -1
  196. package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
  197. package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
  198. package/scripts/pysite/sitecustomize.py +41 -0
  199. package/skill-template/domains/data.md +4 -4
  200. package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
  201. package/skills/weaver-e10-caizhilian/references/org-browser.md +1 -0
  202. package/skills/weaver-e10-cowork/SKILL.md +3 -1
  203. package/skills/weaver-e10-data/SKILL.md +12 -16
  204. package/skills/weaver-e10-data/references/config-center.md +6 -7
  205. package/skills/weaver-e10-data/references/datasource.md +1 -1
  206. package/skills/weaver-e10-data/references/scene-and-misc.md +2 -2
  207. package/skills/weaver-e10-jiuchuanhui/SKILL.md +51 -90
  208. package/skills/weaver-e10-jiuchuanhui/references/cache.md +17 -13
  209. package/skills/weaver-e10-jiuchuanhui/references/clue.md +2 -2
  210. package/skills/weaver-e10-jiuchuanhui/references/customer.md +49 -11
  211. package/skills/weaver-e10-jiuchuanhui/references/discovery-config.md +3 -3
  212. package/skills/weaver-e10-jiuchuanhui/references/jiuchuanhui-entry.md +9 -7
  213. package/skills/weaver-e10-jiuchuanhui/references/sale.md +2 -2
  214. package/skills/weaver-e10-jucailin/references/attend-write.md +1 -1
  215. package/skills/weaver-e10-mail/SKILL.md +4 -1
  216. package/skills/weaver-e10-mail/references/mail-read.md +4 -2
  217. package/skills/weaver-e10-mail/references/safety-boundaries.md +1 -0
  218. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  219. package/skills/weaver-e10-performance/SKILL.md +9 -7
  220. package/skills/weaver-e10-performance/agents/openai.yaml +4 -2
  221. package/skills/weaver-e10-performance/references/flow-assess.md +19 -6
  222. package/skills/weaver-e10-recruit-stage/SKILL.md +125 -20
  223. package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +359 -0
  224. package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +87 -0
  225. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +9 -2
  226. package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +1 -0
  227. package/skills/weaver-e10-recruit-stage/templates/match-report.html +177 -0
  228. package/skills/weaver-e10-shared/SKILL.md +22 -1
  229. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +2 -2
  230. package/skills/weaver-e10-workflow/SKILL.md +1 -1
  231. package/skills/weaver-e10-workflow/references/workflow-deep-read.md +8 -3
  232. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
@@ -46,10 +46,6 @@ const INPUT_SCHEMAS = {
46
46
  'data.conf.group-file': { required: ['group_file'], optional: [] },
47
47
  'data.conf.resolve': { required: ['text'], optional: ['group'] },
48
48
  'data.conf.resolve-file': { required: ['path'], optional: ['group'] },
49
- 'data.conf.add': { required: ['key', 'value'], optional: ['name', 'attrs', 'type', 'group', 'force'] },
50
- 'data.conf.add-file': { required: ['add_file'], optional: ['type', 'group'] },
51
- 'data.conf.update': { required: ['key'], optional: ['value', 'name', 'attrs', 'type', 'group'] },
52
- 'data.conf.delete': { required: ['key'], optional: ['type', 'group'] },
53
49
  'data.scene.groups': { required: [], optional: ['client'] },
54
50
  'data.scene.items': { required: ['group'], optional: ['client'] },
55
51
  'data.scene.search': {
@@ -100,20 +96,10 @@ function inputSchemaOf(name) {
100
96
  /**
101
97
  * 写类 operation 的风险标注。
102
98
  *
103
- * 依据执行逻辑逐个核对(`operations/conf.ts`、`operations/module.ts`):
104
- * - `conf.add` / `conf.add-file` / `conf.update` / `conf.delete` 都走 `POST` 写配置中心,
105
- * `conf.delete` 直接删键、不可撤销;
106
- * - `module.call` 透传任意业务模块(method/body 由调用方给),副作用无法在本地枚举。
107
- *
108
- * 这五个之外一律 `read`:data 域其余 operation 只做查询与元数据读取。
109
- * 配置中心是租户级共享数据,写错影响所有使用方,故按 `high-risk-write` 标注,
110
- * 与文档「至少 5 个配置写操作与只读查询同一标签」的整改要求一致。
99
+ * `module.call` 会执行配置化业务接口。尽管运行时已按接口名称拦截写语义和未知语义,
100
+ * 配置风险元数据尚未标准化,仍保守标记为 `high-risk-write`。
111
101
  */
112
102
  const WRITE_RISK = new Set([
113
- 'data.conf.add',
114
- 'data.conf.add-file',
115
- 'data.conf.update',
116
- 'data.conf.delete',
117
103
  'data.module.call',
118
104
  ]);
119
105
  export const dataOperations = operationDefinitions().map((definition) => ({
@@ -144,35 +130,10 @@ export const dataManifest = {
144
130
  '`ds.find` 的 `/ds/listByPage` 端点当前忽略 name ⇒ 未命中只代表未落在抓取窗口内,不等于表不存在。',
145
131
  '`module call` 的 `token` 头在运行时属保留头,必须走 trustedHeaders(INVOICE 已内置换取逻辑)。',
146
132
  '人员 / 部门 / 岗位一律走 `weaver-work-cli hrm`;data 通道对 /api/hrm/ 路径有黑名单(退出码 6)。',
147
- '`hasSearchRight=false` 是权限受限(终端态):结果照常给出但退出码 4,不得交付为「无数据」。',
148
- '`field name2id`(名称→字段值 id)与 `ds fields`(字段元数据)是两件事;`id2name` 已停用并在本次迁移中删除。',
133
+ '`hasSearchRight=false` 是权限受限(终端态):结果照常给出但退出码 6,不得交付为「无数据」。',
134
+ '`field name2id`(名称→字段值 id)与 `ds fields`(字段元数据)是两件事;选项值显示映射使用 `field options`。',
149
135
  '`attribution metric` 取的是**归因分析设置**(指标口径 / 可关联维度 / 下钻路径),与 `noun scope` 的词库解释不同;归因分析优先用这里的设置,未配置时才回退通用流程。',
150
136
  ],
151
137
  operations: dataOperations,
152
- withheldOperations: [
153
- {
154
- name: 'data.doc.count',
155
- reason: '文档数量由配置中心 DOCUMENT.POST_DOCUMENT_DOCUMENT_LIST_COUNT 覆盖(conf group api DOCUMENT → module call),不在 data 模块重复封装。',
156
- },
157
- {
158
- name: 'data.doc.list',
159
- reason: '同上:DOCUMENT.POST_DOCUMENT_DOCUMENT_LIST。注意 documentList 的 data.total 实测恒为 0,总量必须取 count 接口。',
160
- },
161
- {
162
- name: 'data.field.id2name',
163
- reason: '已停用:技能里 19 处均为禁令;该实现打的是 /api/bcw/test/testRemoteBrowser 探针接口。选项值显示映射改走 field options。',
164
- },
165
- {
166
- name: 'data.refusal.get',
167
- reason: '拒答话术属智能问数宿主平台职责;场景技能明确「不做拒答 / 话术判定」,迁入只会扩出一个被禁止调用的入口。',
168
- },
169
- {
170
- name: 'data.refusal.rules',
171
- reason: '同上:getRefusalSpeechRules 由平台在加载完成 / 取数前 / 交付前自行拉取并替换话术。',
172
- },
173
- {
174
- name: 'data.exp.*',
175
- reason: '专家包远端版本管理属 `weaver-work-cli skills repo …` 资源域,不进 data。',
176
- },
177
- ],
138
+ withheldOperations: [],
178
139
  };
@@ -1,4 +1,4 @@
1
- import { dataValidationError } from '../errors.js';
1
+ import { dataPolicyError, dataValidationError } from '../errors.js';
2
2
  import { scanTips, tipsLines } from './shared.js';
3
3
  /**
4
4
  * 考勤假期余额:`POST /api/attend/web/attendInfoV2/getAttendInfoStatis`。
@@ -40,7 +40,7 @@ export async function attendStatis(input, host) {
40
40
  if (String(response?.code) !== '200') {
41
41
  const message = String(response?.msg || '');
42
42
  if (/没有权限|无权限|权限不足|未授权|无权访问|无查询权限/i.test(message)) {
43
- throw dataValidationError('permission_denied', '当前用户对该人员考勤数据无查询权限,请检查登录态或联系管理员开通', 4);
43
+ throw dataPolicyError('permission_denied', '当前用户对该人员考勤数据无查询权限,请检查登录态或联系管理员开通');
44
44
  }
45
45
  return { data: response, text: `code=${response?.code} msg=${message}` };
46
46
  }
@@ -12,9 +12,6 @@ const CONF_PREFIX_TYPE = [['CONN_', 'conn'], ['DS_', 'ds'], ['WF_', 'wf'], ['API
12
12
  const CONF_GET_PATH = '/api/dw/newetl/chatBi/getChatBiConfigMap';
13
13
  const CONF_BATCH_PATH = '/api/dw/newetl/chatBi/batchGetChatBiConfigMap';
14
14
  const CONF_BATCH_GROUP_PATH = '/api/dw/newetl/chatBi/batchGetChatBiConfigMapByTypeAndGroup';
15
- const CONF_ADD_PATH = '/api/dw/newetl/chatBi/batchAddChatBiConfigMap';
16
- const CONF_UPDATE_PATH = '/api/dw/newetl/chatBi/updateChatBiConfigMap';
17
- const CONF_DELETE_PATH = '/api/dw/newetl/chatBi/deleteChatBiConfigMap';
18
15
  /** 文本里的 `#{KEY}` 占位符(至少 3 字符、下划线大写,排除 `#{}` 与短键)。 */
19
16
  const CONF_TOKEN_RE = /#\{([A-Z][A-Z0-9_]{2,})\}/g;
20
17
  function confKeyType(key, explicitType) {
@@ -282,91 +279,6 @@ export async function confResolveFile(input, host) {
282
279
  const result = await resolveText(host, text, input.group);
283
280
  return { data: result, text: result.output };
284
281
  }
285
- export async function confAdd(input, host) {
286
- const key = positionals(input, 'keys')[0] || (typeof input.key === 'string' ? input.key : '');
287
- if (!key || input.value === undefined) {
288
- throw dataValidationError('missing_argument', 'conf add 缺少 confKey/confValue(用法: conf add <key> --value <真实值>)');
289
- }
290
- const confType = confKeyType(key, input.type);
291
- if (!input.force && await confGetData(host, confType, key, true, input.group)) {
292
- process.stderr.write(`[config-resolve] 配置已存在,跳过新增(如需修改请用 conf update): ${key}\n`);
293
- return { data: null, text: `已存在,跳过: ${key}` };
294
- }
295
- const item = putGroup({
296
- confType,
297
- confKey: key,
298
- confValue: String(input.value),
299
- confAttrs: input.attrs || '',
300
- confName: input.name || '',
301
- }, confType, input.group);
302
- const response = await host.request({ method: 'POST', path: CONF_ADD_PATH, body: [item], operation: 'conf.add' });
303
- return {
304
- data: response,
305
- text: `新增成功: ${item.confGroup ? `${item.confGroup}/` : ''}${key} = ${item.confValue}`,
306
- };
307
- }
308
- export async function confAddFile(input, host) {
309
- const raw = input.add_file ?? positionals(input, 'keys')[0];
310
- if (raw === undefined)
311
- throw dataValidationError('missing_argument', 'conf add-file 缺少参数(用法: conf add-file @items.json)');
312
- const parsed = readJsonArg(String(raw), '--add-file');
313
- const list = Array.isArray(parsed) ? parsed : [parsed];
314
- const toAdd = [];
315
- for (const item of list) {
316
- if (!item.confKey || item.confValue === undefined)
317
- continue;
318
- const confType = item.confType || confKeyType(item.confKey, input.type);
319
- const group = item.confGroup !== undefined ? item.confGroup : input.group;
320
- if (await confGetData(host, confType, item.confKey, true, group)) {
321
- process.stderr.write(`[config-resolve] 已存在跳过: ${item.confKey}\n`);
322
- continue;
323
- }
324
- toAdd.push(putGroup({
325
- confType,
326
- confKey: item.confKey,
327
- confValue: String(item.confValue),
328
- confAttrs: item.confAttrs || '',
329
- confName: item.confName || '',
330
- }, confType, group));
331
- }
332
- if (!toAdd.length)
333
- return { data: null, text: '全部已存在,无新增' };
334
- const response = await host.request({ method: 'POST', path: CONF_ADD_PATH, body: toAdd, operation: 'conf.add-file' });
335
- return { data: response, text: `批量新增 ${toAdd.length} 条成功` };
336
- }
337
- export async function confUpdate(input, host) {
338
- const key = positionals(input, 'keys')[0] || (typeof input.key === 'string' ? input.key : '');
339
- if (!key)
340
- throw dataValidationError('missing_argument', 'conf update 缺少 confKey');
341
- if (input.value === undefined && input.name === undefined && input.attrs === undefined) {
342
- throw dataValidationError('nothing_to_update', 'conf update 至少需提供 --value / --name / --attrs 之一');
343
- }
344
- const confType = confKeyType(key, input.type);
345
- const body = putGroup({ confType, confKey: key }, confType, input.group);
346
- if (input.value !== undefined)
347
- body.confValue = String(input.value);
348
- if (input.name !== undefined)
349
- body.confName = input.name;
350
- if (input.attrs !== undefined)
351
- body.confAttrs = input.attrs;
352
- const response = await host.request({ method: 'POST', path: CONF_UPDATE_PATH, body, operation: 'conf.update' });
353
- return { data: response, text: `更新成功: ${body.confGroup ? `${body.confGroup}/` : ''}${key}` };
354
- }
355
- export async function confDelete(input, host) {
356
- const key = positionals(input, 'keys')[0] || (typeof input.key === 'string' ? input.key : '');
357
- if (!key)
358
- throw dataValidationError('missing_argument', 'conf delete 缺少 confKey');
359
- const confType = confKeyType(key, input.type);
360
- const response = await host.request({
361
- method: 'DELETE',
362
- path: `${CONF_DELETE_PATH}?confType=${encodeURIComponent(confType)}&confKey=${encodeURIComponent(key)}${groupSuffix(confType, input.group)}`,
363
- operation: 'conf.delete',
364
- });
365
- return {
366
- data: response,
367
- text: `删除成功: ${useGroup(confType, input.group) && input.group ? `${input.group}/` : ''}${key}`,
368
- };
369
- }
370
282
  export { confGetData, confKeyType, normalizeBatch, CONF_BATCH_PATH };
371
283
  /** `confAttrs` 可能是字符串或对象——统一成对象,供 module call 使用。 */
372
284
  export function attributesOf(record) {
@@ -1,5 +1,5 @@
1
1
  import { needArg } from '../host.js';
2
- import { dataApiError, dataValidationError } from '../errors.js';
2
+ import { dataApiError, dataAuthError, dataValidationError } from '../errors.js';
3
3
  import { applyAppId, baseDto, parseOrder, parseStat, parseWhereArg, readListArg, renderTable, scanTips, tipsLines, } from './shared.js';
4
4
  // ---------------------------------------------------------------- 分组清单
5
5
  //
@@ -163,7 +163,7 @@ export async function dsFieldsDsl(input, host) {
163
163
  return { data: response, text: renderFields(response) };
164
164
  }
165
165
  export async function dsList(input, host) {
166
- // 先校验必填参数再取登录态:未登录时缺参必须报用法错误(退出码 8),
166
+ // 先校验必填参数再取登录态:未登录时缺参必须报用法错误(退出码 2),
167
167
  // 否则会被登录失败抢先,把「参数写错」误报成「登录态失效」。
168
168
  const groupId = needArg(input, 'group');
169
169
  const tableId = needArg(input, 'table');
@@ -458,7 +458,7 @@ export async function dsFind(input, host) {
458
458
  const okScan = scan.filter((result) => !result.error);
459
459
  const errs = scan.filter((result) => result.error);
460
460
  if (!okScan.length && errs.length && errs.some((result) => /登录态失效|401/.test(String(result.error)))) {
461
- throw dataValidationError('session_expired', '登录态失效:请重新登录 weaver-work-cli(`weaver-work-cli auth login --base-url <域名>`)后重试(本次未取到任何分组)', 2);
461
+ throw dataAuthError('session_expired', '登录态失效:请重新登录 weaver-work-cli(`weaver-work-cli auth login --base-url <域名>`)后重试(本次未取到任何分组)');
462
462
  }
463
463
  const candidates = mergeCandidates(scan, input.limit);
464
464
  const data = {
@@ -666,7 +666,7 @@ export async function dsDescribe(input, host) {
666
666
  : '非 EB 分组,数据源通道无需 appId';
667
667
  data.elapsedMs = Date.now() - startedAt;
668
668
  if (errors.length && input.require) {
669
- throw dataValidationError('describe_failed', `describe 存在失败分支,--require 下不继续:${JSON.stringify(errors)}`, 7);
669
+ throw dataApiError('describe_failed', `describe 存在失败分支,--require 下不继续:${JSON.stringify(errors)}`, { details: { errors } });
670
670
  }
671
671
  const fields = data.fields || {};
672
672
  const lexicon = data.lexicon || {};
@@ -5,7 +5,7 @@ import { attendStatis } from './attend.js';
5
5
  import { fieldName2id, fieldOptions } from './field.js';
6
6
  import { nounList, nounScope } from './noun.js';
7
7
  import { attributionMetric } from './attribution.js';
8
- import { confAdd, confAddFile, confBatch, confBatchFile, confDelete, confGet, confGroup, confGroupFile, confResolve, confResolveFile, confUpdate, } from './conf.js';
8
+ import { confBatch, confBatchFile, confGet, confGroup, confGroupFile, confResolve, confResolveFile, } from './conf.js';
9
9
  import { moduleCall } from './module.js';
10
10
  import { sceneGroups, sceneItems, sceneSearch } from './scene.js';
11
11
  const DEFINITIONS = [
@@ -32,10 +32,6 @@ const DEFINITIONS = [
32
32
  { name: 'data.conf.group-file', summary: '按文件批量取多个分组的配置', capability: 'config', handler: confGroupFile, command: 'conf group-file' },
33
33
  { name: 'data.conf.resolve', summary: '把文本里的 #{KEY} 占位符替换为配置值', capability: 'config', handler: confResolve, command: 'conf resolve' },
34
34
  { name: 'data.conf.resolve-file', summary: '按文件替换 #{KEY} 占位符', capability: 'config', handler: confResolveFile, command: 'conf resolve-file' },
35
- { name: 'data.conf.add', summary: '新增配置(已存在默认跳过,--force 重建)', capability: 'config', handler: confAdd, command: 'conf add' },
36
- { name: 'data.conf.add-file', summary: '按文件批量新增配置(已存在的跳过)', capability: 'config', handler: confAddFile, command: 'conf add-file' },
37
- { name: 'data.conf.update', summary: '更新配置的 value / name / attrs', capability: 'config', handler: confUpdate, command: 'conf update' },
38
- { name: 'data.conf.delete', summary: '删除配置', capability: 'config', handler: confDelete, command: 'conf delete' },
39
35
  { name: 'data.scene.groups', summary: '场景分组骨架(getSceneGroups)', capability: 'scene', handler: sceneGroups, command: 'scene groups' },
40
36
  { name: 'data.scene.items', summary: '组内条目(接口 / 数据源,含取数通道参数)', capability: 'scene', handler: sceneItems, command: 'scene items' },
41
37
  { name: 'data.scene.search', summary: '关键词候选召回(后端 keyword 优先,本地打分兜底)', capability: 'scene', handler: sceneSearch, command: 'scene search' },
@@ -1,5 +1,5 @@
1
1
  import { readFileSync } from 'node:fs';
2
- import { dataApiError, dataHrmBlocked, dataPermissionBlocked, dataValidationError } from '../errors.js';
2
+ import { DataCliError, dataApiError, dataAuthError, dataHrmBlocked, dataNetworkError, dataPermissionBlocked, dataPolicyError, dataValidationError, } from '../errors.js';
3
3
  import { attributesOf, confGetData } from './conf.js';
4
4
  import { parseJsonSafe, readJsonArg, readListArg, renderTable, scanTips, tipFields, tipsLines } from './shared.js';
5
5
  /**
@@ -14,6 +14,25 @@ import { parseJsonSafe, readJsonArg, readListArg, renderTable, scanTips, tipFiel
14
14
  const HRM_PATTERNS = ['/api/hrm/', '/api/bs/hrm/', '/api/app/hrm/'];
15
15
  const PERM_WORDS = ['没有权限', '无权限', '权限不足', '未授权', '无权访问', '无查询权限'];
16
16
  const INVOICE_TOKEN_PATH = '/api/inc/proxy/getToken?appType=1';
17
+ /**
18
+ * module.call 只能执行名称可明确判定为读取的接口。
19
+ *
20
+ * POST/FORM 既可能是查询也可能写业务,不能按 HTTP 方法放行;当前 confAttrs 也没有
21
+ * 可验证的副作用元数据。因此采用名称白名单 + 默认拒绝:写语义优先阻断,名称不明确
22
+ * 为读取时也拒绝真实请求。--show-params / --dry-run 不发送业务请求,不受此门禁影响。
23
+ */
24
+ const READ_NAME_RE = /查询|获取|取得|读取|列表|清单|明细|详情|统计|计数|搜索|检索|查找|查看|分页|报表|query|get|list|count|search|find|fetch|read|detail|stat|report|page|info/i;
25
+ const WRITE_NAME_RE = /新增|创建|添加|修改|更新|删除|保存|提交|审批|审核|发布|撤回|撤销|驳回|拒绝|发送|通知|提醒|导入|上传|下载|同步|执行|启动|停止|关闭|启用|禁用|绑定|解绑|分配|转交|归档|清空|create|add|insert|update|delete|remove|save|submit|approve|audit|publish|withdraw|revoke|reject|send|notify|remind|import|upload|download|sync|execute|start|stop|close|enable|disable|bind|unbind|assign|transfer|archive|clear/i;
26
+ function assertReadOnlyApiName(apiName, confKey) {
27
+ const name = String(apiName || '').trim();
28
+ const details = { apiName: name || null, confKey };
29
+ if (WRITE_NAME_RE.test(name)) {
30
+ throw dataPolicyError('module_write_interface_blocked', `已阻断疑似写操作接口:${name || confKey}(module call 仅允许名称可明确识别为读取的接口)`, details);
31
+ }
32
+ if (!READ_NAME_RE.test(name)) {
33
+ throw dataPolicyError('module_read_interface_unverified', `已阻断接口:${name || confKey}(接口名称无法明确判定为读取操作;仅可用 --show-params 或 --dry-run 预览)`, details);
34
+ }
35
+ }
17
36
  /** 业务参数 → query 串(数组按多值展开、对象 JSON 化,对齐 `urlencode(..., doseq=True)`)。 */
18
37
  function queryStringOf(obj) {
19
38
  const params = new URLSearchParams();
@@ -91,19 +110,19 @@ function loadConfFile(path) {
91
110
  raw = readFileSync(path, 'utf-8');
92
111
  }
93
112
  catch (error) {
94
- throw dataApiError('conf_file_unreadable', `读 --conf-file 失败:${error.message}(${path})`);
113
+ throw dataValidationError('conf_file_unreadable', `读 --conf-file 失败:${error.message}(${path})`);
95
114
  }
96
115
  let parsed;
97
116
  try {
98
117
  parsed = JSON.parse(raw.replace(/^\uFEFF/, '').trim());
99
118
  }
100
119
  catch {
101
- throw dataApiError('conf_file_invalid', `--conf-file 不是合法 JSON:${path}`);
120
+ throw dataValidationError('conf_file_invalid', `--conf-file 不是合法 JSON:${path}`);
102
121
  }
103
122
  if (Array.isArray(parsed))
104
123
  parsed = parsed[0] || {};
105
124
  if (!parsed || typeof parsed !== 'object') {
106
- throw dataApiError('conf_file_invalid', `--conf-file 形态异常(期望对象):${path}`);
125
+ throw dataValidationError('conf_file_invalid', `--conf-file 形态异常(期望对象):${path}`);
107
126
  }
108
127
  // 形态②:`conf get --json` 原样输出(有 confAttrs);形态①:模板缓存(本身就是 attrs 视图)
109
128
  if (parsed.confAttrs !== undefined || (parsed.confValue !== undefined && parsed.api_path === undefined)) {
@@ -155,8 +174,10 @@ export async function moduleCall(input, host) {
155
174
  record = await confGetData(host, confType, confKey, false, group);
156
175
  }
157
176
  catch (error) {
177
+ if (error instanceof DataCliError)
178
+ throw error;
158
179
  const message = String(error?.message || error);
159
- throw dataApiError('conf_get_failed', `conf get 失败:${message}(先核对 confType / confGroup / confKey;自定义 confType 须显式 --type;登录态问题请重新登录)`, { code: /登录态失效/.test(message) ? 2 : 3 });
180
+ throw dataApiError('conf_get_failed', `conf get 失败:${message}(先核对 confType / confGroup / confKey;自定义 confType 须显式 --type;登录态问题请重新登录)`);
160
181
  }
161
182
  attrs = attributesOf(record);
162
183
  }
@@ -276,7 +297,9 @@ export async function moduleCall(input, host) {
276
297
  };
277
298
  return { data: out, text: JSON.stringify(out, null, 1) };
278
299
  }
279
- // ---- ⑥ 发请求 ----
300
+ // ---- ⑥ 真实请求前:接口名称必须明确是读取语义 ----
301
+ assertReadOnlyApiName(apiName, confKey);
302
+ // ---- ⑦ 发请求 ----
280
303
  const headers = { ...extraHeaders };
281
304
  const trustedHeaders = {};
282
305
  if (effMethod === 'POST')
@@ -293,7 +316,9 @@ export async function moduleCall(input, host) {
293
316
  token = null;
294
317
  }
295
318
  if (!token) {
296
- throw dataApiError('invoice_token_missing', `未取到发票云 Token(INVOICE 业务接口必需;HTTP ${tokenResponse.status})`, { code: 7 });
319
+ throw dataApiError('invoice_token_missing', `未取到发票云 Token(INVOICE 业务接口必需;HTTP ${tokenResponse.status})`, {
320
+ details: { httpStatus: tokenResponse.status },
321
+ });
297
322
  }
298
323
  trustedHeaders.token = token;
299
324
  }
@@ -312,7 +337,7 @@ export async function moduleCall(input, host) {
312
337
  operation: `module.call:${confKey}`,
313
338
  });
314
339
  if (status === 401) {
315
- throw dataApiError('login_required', '登录态失效(HTTP 401):请执行 `weaver-work-cli auth login --base-url <域名>` 重新登录', { code: 2 });
340
+ throw dataAuthError('login_required', '登录态失效(HTTP 401):请执行 `weaver-work-cli auth login --base-url <域名>` 重新登录', { httpStatus: 401 });
316
341
  }
317
342
  let obj = null;
318
343
  try {
@@ -325,14 +350,17 @@ export async function moduleCall(input, host) {
325
350
  // 非 JSON:原样输出前 2000 字符(2xx 视为正常,其余按请求失败)
326
351
  const out = { ok: status >= 200 && status < 300, api_name: apiName, http: status, nonJson: text.slice(0, 2000) };
327
352
  if (status < 200 || status >= 300) {
328
- throw dataApiError('non_json', `HTTP ${status} 且响应非 JSON(已原样输出前 2000 字符)`, { code: 7, details: out });
353
+ throw dataNetworkError('non_json', `HTTP ${status} 且响应非 JSON(已原样输出前 2000 字符)`, {
354
+ retryable: false,
355
+ details: { httpStatus: status, ...out },
356
+ });
329
357
  }
330
358
  return { data: out, text: text.slice(0, 2000) };
331
359
  }
332
- // ---- ⑦ --raw:原样输出响应体 ----
360
+ // ---- ⑧ --raw:原样输出响应体 ----
333
361
  if (input.raw)
334
362
  return { data: obj, text: JSON.stringify(obj, null, 1) };
335
- // ---- ⑧ 提取精简结果 ----
363
+ // ---- ⑨ 提取精简结果 ----
336
364
  const payload = payloadOf(obj);
337
365
  const flags = flagsOf(obj, payload.value);
338
366
  const tips = scanTips(obj);
@@ -374,9 +402,7 @@ export async function moduleCall(input, host) {
374
402
  lines.push(...tipsLines(tips));
375
403
  // 权限受限是终端态:结果照常给出(供调用方留证),但退出码必须非 0
376
404
  if (flags.some((flag) => flag.startsWith('hasSearchRight=false'))) {
377
- const error = dataPermissionBlocked('权限受限:hasSearchRight=false(立即终止,不重试、不换参、不交付为「无数据」)');
378
- error.details = { result: out };
379
- throw error;
405
+ throw dataPermissionBlocked('权限受限:hasSearchRight=false(立即终止,不重试、不换参、不交付为「无数据」)', { result: out });
380
406
  }
381
407
  return { data: out, text: lines.join('\n') };
382
408
  }
@@ -1,5 +1,5 @@
1
1
  import { needArg } from '../host.js';
2
- import { dataValidationError } from '../errors.js';
2
+ import { dataPolicyError } from '../errors.js';
3
3
  import { readJsonArg, renderTable, scanTips, tipsLines } from './shared.js';
4
4
  /**
5
5
  * DSL 直查:`POST /api/dw/dsl/executeQueryDsl`。
@@ -32,7 +32,7 @@ export async function executeQuery(input, host) {
32
32
  if (code !== undefined && String(code) !== '200' && String(code) !== '0') {
33
33
  const message = String(response?.msg || '');
34
34
  if (/没有权限|无权限|权限不足|未授权|无权访问|无查询权限/i.test(message)) {
35
- throw dataValidationError('permission_denied', '当前用户对该数据无查询权限,请检查登录态是否有效或联系管理员开通', 4);
35
+ throw dataPolicyError('permission_denied', '当前用户对该数据无查询权限,请检查登录态是否有效或联系管理员开通');
36
36
  }
37
37
  }
38
38
  const payload = response?.data;
@@ -1,6 +1,7 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
3
3
  import { reportPlatformError } from '../../core/error-codes.js';
4
+ import { MANIFEST_LIST_COMPACT_PATHS, manifestView, schemaOptionsOf } from '../../core/manifest-view.js';
4
5
  import { createEbuilderFormContinuationSigner } from './continuation.js';
5
6
  import { ebuilderValidationError } from './errors.js';
6
7
  import { createEbuilderFormHost } from './host.js';
@@ -95,8 +96,16 @@ export const ebuilderFormShortcut = {
95
96
  const ebuilder = program.command('ebuilder-form').description('泛微E10 eBuilder 表单菜单、List/NList、OpenAPI 与自定义接口能力');
96
97
  ebuilder.command('schema')
97
98
  .description('Print ebuilder-form operation manifest for agents')
98
- .action(action((ctx) => {
99
- ctx.output.write(ebuilderFormManifest, { json: true });
99
+ .option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
100
+ .option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
101
+ .option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
102
+ .action(action((ctx, options) => {
103
+ const schema = schemaOptionsOf(options);
104
+ ctx.output.write(manifestView(ebuilderFormManifest, schema), {
105
+ json: true,
106
+ // 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
107
+ ...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
108
+ });
100
109
  }));
101
110
  ebuilder.command('run')
102
111
  .description('Run an ebuilder-form operation with JSON input')
@@ -233,6 +233,7 @@ export const ebuilderFormOperations = [
233
233
  name: 'ebuilder-form.openapi.add.prepare',
234
234
  summary: '准备 OpenAPI saveFormData 新增请求,签发 continuation,不写入',
235
235
  risk: 'read-before-write',
236
+ requiresConfirmation: true,
236
237
  inputSchema: schema({
237
238
  ...contextProperties,
238
239
  datas: { type: 'array', minItems: 1 },
@@ -243,12 +244,14 @@ export const ebuilderFormOperations = [
243
244
  name: 'ebuilder-form.openapi.add.apply',
244
245
  summary: '确认后执行 OpenAPI saveFormData 新增请求',
245
246
  risk: 'high-risk-write',
247
+ requiresConfirmation: true,
246
248
  inputSchema: schema(preparedWriteProperties, { required: ['confirm', 'continuation'] }),
247
249
  },
248
250
  {
249
251
  name: 'ebuilder-form.openapi.update.prepare',
250
252
  summary: '准备 OpenAPI updateFormData 修改请求,签发 continuation,不写入',
251
253
  risk: 'read-before-write',
254
+ requiresConfirmation: true,
252
255
  inputSchema: schema({
253
256
  ...contextProperties,
254
257
  datas: { type: 'array', minItems: 1 },
@@ -259,12 +262,14 @@ export const ebuilderFormOperations = [
259
262
  name: 'ebuilder-form.openapi.update.apply',
260
263
  summary: '确认后执行 OpenAPI updateFormData 修改请求',
261
264
  risk: 'high-risk-write',
265
+ requiresConfirmation: true,
262
266
  inputSchema: schema(preparedWriteProperties, { required: ['confirm', 'continuation'] }),
263
267
  },
264
268
  {
265
269
  name: 'ebuilder-form.openapi.delete.prepare',
266
270
  summary: '准备 OpenAPI deleteData 删除请求,签发 continuation,不写入',
267
271
  risk: 'read-before-write',
272
+ requiresConfirmation: true,
268
273
  inputSchema: schema({
269
274
  ...contextProperties,
270
275
  mainTable: { type: 'object', description: '删除条件;按数据 ID 删除时传 {"id":"..."}' },
@@ -279,6 +284,7 @@ export const ebuilderFormOperations = [
279
284
  name: 'ebuilder-form.openapi.delete.apply',
280
285
  summary: '确认后执行 OpenAPI deleteData 删除请求',
281
286
  risk: 'high-risk-write',
287
+ requiresConfirmation: true,
282
288
  inputSchema: schema(preparedWriteProperties, { required: ['confirm', 'continuation'] }),
283
289
  },
284
290
  {
@@ -320,6 +326,7 @@ export const ebuilderFormOperations = [
320
326
  name: 'ebuilder-form.custom.add.prepare',
321
327
  summary: '准备已发布自定义接口 saveFormData 新增请求,签发 continuation',
322
328
  risk: 'read-before-write',
329
+ requiresConfirmation: true,
323
330
  inputSchema: schema({
324
331
  ...contextProperties,
325
332
  interfacePk: { type: 'string', minLength: 1 },
@@ -331,12 +338,14 @@ export const ebuilderFormOperations = [
331
338
  name: 'ebuilder-form.custom.add.apply',
332
339
  summary: '确认后执行已发布自定义接口 saveFormData 新增请求',
333
340
  risk: 'high-risk-write',
341
+ requiresConfirmation: true,
334
342
  inputSchema: schema(preparedWriteProperties, { required: ['confirm', 'continuation'] }),
335
343
  },
336
344
  {
337
345
  name: 'ebuilder-form.custom.update.prepare',
338
346
  summary: '准备已发布自定义接口 updateFormData 修改请求,签发 continuation',
339
347
  risk: 'read-before-write',
348
+ requiresConfirmation: true,
340
349
  inputSchema: schema({
341
350
  ...contextProperties,
342
351
  interfacePk: { type: 'string', minLength: 1 },
@@ -348,12 +357,14 @@ export const ebuilderFormOperations = [
348
357
  name: 'ebuilder-form.custom.update.apply',
349
358
  summary: '确认后执行已发布自定义接口 updateFormData 修改请求',
350
359
  risk: 'high-risk-write',
360
+ requiresConfirmation: true,
351
361
  inputSchema: schema(preparedWriteProperties, { required: ['confirm', 'continuation'] }),
352
362
  },
353
363
  {
354
364
  name: 'ebuilder-form.custom.delete.prepare',
355
365
  summary: '准备已发布自定义接口 deleteFormData 删除请求,签发 continuation',
356
366
  risk: 'read-before-write',
367
+ requiresConfirmation: true,
357
368
  inputSchema: schema({
358
369
  ...contextProperties,
359
370
  interfacePk: { type: 'string', minLength: 1 },
@@ -365,6 +376,7 @@ export const ebuilderFormOperations = [
365
376
  name: 'ebuilder-form.custom.delete.apply',
366
377
  summary: '确认后执行已发布自定义接口 deleteFormData 删除请求',
367
378
  risk: 'high-risk-write',
379
+ requiresConfirmation: true,
368
380
  inputSchema: schema(preparedWriteProperties, { required: ['confirm', 'continuation'] }),
369
381
  },
370
382
  ];
@@ -1,6 +1,7 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
3
3
  import { shouldReportPlatformError, toPlatformError } from '../../core/error-codes.js';
4
+ import { MANIFEST_LIST_COMPACT_PATHS, manifestView, schemaOptionsOf } from '../../core/manifest-view.js';
4
5
  import { createEhrContinuationSigner } from './continuation.js';
5
6
  import { createEhrHost } from './host.js';
6
7
  import { ehrManifest } from './manifest.js';
@@ -114,8 +115,16 @@ export const ehrShortcut = {
114
115
  const ehr = program.command('ehr').description('泛微E10聚才林(人事档案/出勤管理/薪酬管理)');
115
116
  ehr.command('schema')
116
117
  .description('Print ehr operation manifest for agents')
117
- .action(action((ctx) => {
118
- ctx.output.write(ehrManifest, { json: true });
118
+ .option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
119
+ .option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
120
+ .option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
121
+ .action(action((ctx, options) => {
122
+ const schema = schemaOptionsOf(options);
123
+ ctx.output.write(manifestView(ehrManifest, schema), {
124
+ json: true,
125
+ // 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
126
+ ...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
127
+ });
119
128
  }));
120
129
  ehr.command('run')
121
130
  .description('Run an ehr operation with JSON input')
@@ -458,29 +458,67 @@ const ehrAttendAppealResultApply = {
458
458
  const recalcSchema = {
459
459
  beginDate: SCHEMA_DATE,
460
460
  endDate: SCHEMA_DATE,
461
- onlyEmpIds: { type: 'array', items: SCHEMA_ID, description: '限定重算的人员 ID;不传则重算全部' },
461
+ scope: {
462
+ type: 'string',
463
+ enum: ['all', 'specified'],
464
+ description: '重算范围,必填:all=全部人员(影响面最大,必须由调用方显式声明);specified=仅重算 onlyEmpIds 中的人员',
465
+ },
466
+ onlyEmpIds: { type: 'array', items: SCHEMA_ID, description: '范围人员 ID;scope=specified 时必填且至少 1 人' },
462
467
  };
468
+ /**
469
+ * 解析重算范围。
470
+ *
471
+ * 历史实现把「不传 onlyEmpIds」默认成全部人员,并当场签发 continuation:
472
+ * 一次空参调用就能换出一张「全公司考勤重算」的票据。范围属于破坏面最大的参数,
473
+ * 不允许再靠缺省值推断:必须显式声明 scope,且 specified 必须带非空人员列表。
474
+ */
475
+ function resolveRecalcScope(args) {
476
+ const rawScope = args.scope;
477
+ if (rawScope !== 'all' && rawScope !== 'specified') {
478
+ throw ehrValidationError('scope_required', 'scope 必填,只能是 all 或 specified;不会再把缺省当作全部人员', {
479
+ hint: '只重算部分人员:scope=specified + onlyEmpIds=[…];确需全量重算:scope=all(须显式传入)',
480
+ received: rawScope === undefined ? '(未传)' : rawScope,
481
+ });
482
+ }
483
+ const onlyEmpIds = toIdList(args.onlyEmpIds, 'onlyEmpIds');
484
+ if (rawScope === 'specified') {
485
+ if (!onlyEmpIds?.length) {
486
+ throw ehrValidationError('scope_empty', 'scope=specified 时 onlyEmpIds 必填且至少 1 人', {
487
+ hint: '补上要重算的人员 ID;如果要全量重算,请显式改传 scope=all',
488
+ });
489
+ }
490
+ return { scope: 'specified', onlyEmpIds };
491
+ }
492
+ if (onlyEmpIds?.length) {
493
+ throw ehrValidationError('scope_conflict', 'scope=all 时不得同时传 onlyEmpIds', {
494
+ hint: '只重算部分人员请把 scope 改为 specified;否则去掉 onlyEmpIds',
495
+ });
496
+ }
497
+ return { scope: 'all' };
498
+ }
463
499
  const ehrAttendReportRecalcPrepare = {
464
500
  name: 'ehr.attend.report.recalc.prepare',
465
501
  resource: 'attend',
466
502
  method: 'report.recalc.prepare',
467
503
  action: 'ehr.attend.report.recalc.prepare',
468
- summary: '准备考勤报表重算:校验日期范围与人员范围并生成确认预览,不触发重算',
504
+ summary: '准备考勤报表重算:校验日期范围与人员范围并生成确认预览,不触发重算;scope 必填,不传不会默认全部人员',
469
505
  capability: 'attend',
470
506
  risk: WRITE,
471
507
  requiresConfirmation: true,
472
- inputSchema: schemaOf({ ...recalcSchema }, { required: ['beginDate', 'endDate'] }),
508
+ inputSchema: schemaOf({ ...recalcSchema }, { required: ['beginDate', 'endDate', 'scope'] }),
473
509
  handler: async (args, { host, continuation }) => {
474
510
  const { beginDate, endDate } = args;
475
511
  if (beginDate > endDate) {
476
512
  throw ehrValidationError('date_range_invalid', 'beginDate 不得晚于 endDate');
477
513
  }
478
- const onlyEmpIds = toIdList(args.onlyEmpIds, 'onlyEmpIds');
514
+ // 先定范围再签票据:范围非法时直接失败,不会留下一张可用于执行的全量票据
515
+ const { scope, onlyEmpIds } = resolveRecalcScope(args);
479
516
  const preview = {
480
517
  beginDate,
481
518
  endDate,
482
- onlyEmpIds,
483
- scope: onlyEmpIds?.length ? `指定 ${onlyEmpIds.length} 人` : '全部人员',
519
+ scope,
520
+ onlyEmpIds: onlyEmpIds ?? null,
521
+ scopeText: scope === 'all' ? '全部人员' : `指定 ${onlyEmpIds.length} 人`,
484
522
  };
485
523
  const session = await host.getSession();
486
524
  const token = await continuation.issue({
@@ -508,7 +546,7 @@ const ehrAttendReportRecalcApply = {
508
546
  capability: 'attend',
509
547
  risk: WRITE,
510
548
  requiresConfirmation: true,
511
- inputSchema: schemaOf({ ...recalcSchema, confirm: { const: true }, continuation: { type: 'string', minLength: 1 } }, { required: ['beginDate', 'endDate', 'confirm', 'continuation'] }),
549
+ inputSchema: schemaOf({ ...recalcSchema, confirm: { const: true }, continuation: { type: 'string', minLength: 1 } }, { required: ['beginDate', 'endDate', 'scope', 'confirm', 'continuation'] }),
512
550
  handler: async (args, env) => {
513
551
  requireConfirm(args, 'ehr.attend.report.recalc.apply');
514
552
  const lease = await verifyLease(args, 'ehr.attend.report.recalc.apply', env);
@@ -516,8 +554,13 @@ const ehrAttendReportRecalcApply = {
516
554
  if (payload.beginDate !== args.beginDate || payload.endDate !== args.endDate) {
517
555
  throw ehrValidationError('target_changed', '重算日期范围与 prepare 时的快照不一致,请重新执行 prepare');
518
556
  }
557
+ const { scope, onlyEmpIds } = resolveRecalcScope(args);
558
+ const preparedIds = payload.onlyEmpIds ?? null;
559
+ const currentIds = onlyEmpIds ?? null;
560
+ if (payload.scope !== scope || JSON.stringify(preparedIds) !== JSON.stringify(currentIds)) {
561
+ throw ehrValidationError('target_changed', '重算人员范围与 prepare 时的快照不一致,请重新执行 prepare');
562
+ }
519
563
  const body = { beginDate: args.beginDate, endDate: args.endDate };
520
- const onlyEmpIds = toIdList(args.onlyEmpIds, 'onlyEmpIds');
521
564
  if (onlyEmpIds?.length)
522
565
  body.onlyEmpIds = onlyEmpIds;
523
566
  let response;