weaver-work-cli 0.1.67 → 0.1.69

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/dist/chunks/{archive-WUZKAEZ6.js → archive-VUTREF3P.js} +16 -12
  2. package/dist/chunks/{archive-oa-PN46RTI2.js → archive-oa-VXXO4RTB.js} +4 -4
  3. package/dist/chunks/{asset-ZPC5VWZM.js → asset-45U6TY7I.js} +44 -12
  4. package/dist/chunks/{asset-idle-DHGP3NYY.js → asset-idle-YCRBMTIT.js} +4 -4
  5. package/dist/chunks/{attachment-content-7SDA6WER.js → attachment-content-7BEDNQ3O.js} +3 -3
  6. package/dist/chunks/{blog-JC47AIXK.js → blog-5AML4WMG.js} +4 -4
  7. package/dist/chunks/{caizhilian-IKIHM77A.js → caizhilian-3P7BUNHT.js} +6 -6
  8. package/dist/chunks/{calendar-GZTSJ57Y.js → calendar-2HUXM3CZ.js} +4 -4
  9. package/dist/chunks/{chunk-33ANTJWB.js → chunk-3CBURKSY.js} +5 -5
  10. package/dist/chunks/{chunk-IN6NXQ26.js → chunk-3Q5F4C5B.js} +47 -27
  11. package/dist/chunks/{chunk-XARLZK6C.js → chunk-3TZURS7M.js} +3 -3
  12. package/dist/chunks/{chunk-R6GGDZ2C.js → chunk-4XYRTXRR.js} +1 -1
  13. package/dist/chunks/{chunk-LNWFHNVK.js → chunk-67AN5YJT.js} +379 -55
  14. package/dist/chunks/{chunk-KS6LXSCA.js → chunk-6DH73Q5H.js} +85 -81
  15. package/dist/chunks/{chunk-3W5NMGDS.js → chunk-727VKJQK.js} +2 -2
  16. package/dist/chunks/{chunk-5QYE52LG.js → chunk-7M5OYRK2.js} +18 -9
  17. package/dist/chunks/{chunk-TXXO4TJT.js → chunk-BEYEXCWU.js} +2 -2
  18. package/dist/chunks/{chunk-26FCCU5O.js → chunk-DSBV4GRK.js} +3 -3
  19. package/dist/chunks/{chunk-G7PQWD4L.js → chunk-DVFA3ODS.js} +38 -10
  20. package/dist/chunks/{chunk-HWA2A25Y.js → chunk-E7VWE2XI.js} +3 -3
  21. package/dist/chunks/{chunk-DTJZOAO6.js → chunk-ELF5TPSG.js} +7 -7
  22. package/dist/chunks/{chunk-6ZOSVKMT.js → chunk-ERAE4GHX.js} +1 -1
  23. package/dist/chunks/{chunk-4PYLZORW.js → chunk-FMAZ42HS.js} +12 -12
  24. package/dist/chunks/{chunk-TJN4PIYO.js → chunk-GTAFCAVP.js} +2 -0
  25. package/dist/chunks/{chunk-WSHIOSGM.js → chunk-H2NRTGZR.js} +3 -3
  26. package/dist/chunks/{chunk-4WCVRDC5.js → chunk-HG6INLH6.js} +13 -0
  27. package/dist/chunks/{chunk-FDBAFANU.js → chunk-I5XB4MZT.js} +227 -23
  28. package/dist/chunks/{chunk-RU7ZZQQQ.js → chunk-JAIZY37Z.js} +4 -4
  29. package/dist/chunks/{chunk-ATEXBEPD.js → chunk-LCM5SSGJ.js} +4 -1
  30. package/dist/chunks/{chunk-FJUOUSV3.js → chunk-LRKKKO5A.js} +36 -9
  31. package/dist/chunks/{chunk-HLT6B26P.js → chunk-LSVA7QA6.js} +1 -1
  32. package/dist/chunks/{chunk-6N4JPNFL.js → chunk-MD5CW4B6.js} +1 -1
  33. package/dist/chunks/{chunk-MRYKV5HN.js → chunk-MLJK4KLE.js} +37 -37
  34. package/dist/chunks/{chunk-C4YQJFZV.js → chunk-PAWXVT6H.js} +22 -11
  35. package/dist/chunks/{chunk-Q6D6PSMH.js → chunk-QYDSTYGG.js} +3 -3
  36. package/dist/chunks/{chunk-AFZTMYGC.js → chunk-T24EBWAZ.js} +1 -1
  37. package/dist/chunks/{chunk-6T5X6YWX.js → chunk-U3OO3IZF.js} +3 -3
  38. package/dist/chunks/{chunk-VLY5RTVO.js → chunk-UVWW5ABZ.js} +3 -3
  39. package/dist/chunks/{chunk-NP3ZZFGI.js → chunk-VZUH3LKI.js} +16 -5
  40. package/dist/chunks/{chunk-JU5OPHSY.js → chunk-YR3K53BU.js} +36 -27
  41. package/dist/chunks/{conflict-DYCSX7CN.js → conflict-VKCRXHUV.js} +2 -2
  42. package/dist/chunks/{contract-N5WNHKHI.js → contract-3PMHUASH.js} +202 -25
  43. package/dist/chunks/{cowork-34CBYVQP.js → cowork-FZBTTBYX.js} +4 -4
  44. package/dist/chunks/{create-flow-PABAGCK2.js → create-flow-WYPLBLRK.js} +6 -6
  45. package/dist/chunks/{data-QKWI5325.js → data-2YZ6A6TL.js} +32 -5
  46. package/dist/chunks/{ebuilder-form-ZONRROK4.js → ebuilder-form-AWPTMZBZ.js} +6 -6
  47. package/dist/chunks/{ehr-2CONM7R6.js → ehr-MNPR4TE5.js} +4 -4
  48. package/dist/chunks/{employee-PGMY6NI6.js → employee-QX57HEWS.js} +1 -1
  49. package/dist/chunks/{entry-mode-C2WPJQJM.js → entry-mode-BCJ7RPFC.js} +3 -3
  50. package/dist/chunks/{env-SEEXUXZF.js → env-SCVCHBN2.js} +2 -2
  51. package/dist/chunks/{esb-FQASCY2H.js → esb-GSB5QCEX.js} +6 -6
  52. package/dist/chunks/{factory-WNLDOLJZ.js → factory-CBXYOEBF.js} +1 -1
  53. package/dist/chunks/{fna-FCLVIWAS.js → fna-XBSNUS2V.js} +4 -4
  54. package/dist/chunks/{group-chat-DOS4XWUN.js → group-chat-RFL4U7RF.js} +3 -3
  55. package/dist/chunks/{host-P7G22WNM.js → host-2UMNXX5H.js} +4 -4
  56. package/dist/chunks/{host-XLCBLNJD.js → host-BD44ASOD.js} +4 -4
  57. package/dist/chunks/{host-2ED2KC4X.js → host-NVDG3NC6.js} +4 -4
  58. package/dist/chunks/{host-46NYKDQP.js → host-R7BP3CTI.js} +4 -4
  59. package/dist/chunks/{host-7IPZKIM4.js → host-SYPCA63D.js} +4 -4
  60. package/dist/chunks/{host-2UYZEY2V.js → host-XVWBOSEN.js} +4 -4
  61. package/dist/chunks/{hrm-XKL27NX2.js → hrm-FZUDJAND.js} +20 -14
  62. package/dist/chunks/{im-NDYIMASG.js → im-F5NENPD7.js} +5 -5
  63. package/dist/chunks/{invoice-SMODTN2D.js → invoice-DS6FLU55.js} +44 -7
  64. package/dist/chunks/{jiuchuanhui-3T5X7SB7.js → jiuchuanhui-PY2WEBUH.js} +161 -10
  65. package/dist/chunks/{lazy-dispatch-K25LTKQY.js → lazy-dispatch-F6O2EPGR.js} +7 -7
  66. package/dist/chunks/{mail-P7VMUKQW.js → mail-ZEOSANEJ.js} +4 -4
  67. package/dist/chunks/{meeting-2IWXP5IL.js → meeting-N2AGGLVI.js} +15 -15
  68. package/dist/chunks/{minute-doc-N4OR5OLP.js → minute-doc-C62EZOJH.js} +4 -4
  69. package/dist/chunks/{okr-VZXRQGS4.js → okr-OZUMTMCL.js} +11 -5
  70. package/dist/chunks/{operations-62N6EP3C.js → operations-LQY3FTPH.js} +1 -1
  71. package/dist/chunks/{operations-MI2BSKZX.js → operations-UTUWFJTX.js} +5 -5
  72. package/dist/chunks/{org-NFE7X7FK.js → org-MWWIFNAO.js} +1 -1
  73. package/dist/chunks/{performance-OPEQNW7Y.js → performance-GBKM5G2Y.js} +3 -3
  74. package/dist/chunks/{plan-TJAS4N5X.js → plan-C2NENH42.js} +4 -4
  75. package/dist/chunks/{project-CYBGU6K6.js → project-FAJ2P3UR.js} +4 -4
  76. package/dist/chunks/{reception-3FT2F66K.js → reception-NH6MJFPR.js} +20 -10
  77. package/dist/chunks/{recruit-stage-WPGB5BDJ.js → recruit-stage-DPEFHLSE.js} +7 -4
  78. package/dist/chunks/{registry-JMNOXRST.js → registry-4S3RXXWS.js} +3 -3
  79. package/dist/chunks/{registry-XOUVCSV4.js → registry-7US3QQXV.js} +12 -12
  80. package/dist/chunks/{registry-E5RQJVWN.js → registry-AC33ZZVH.js} +1 -1
  81. package/dist/chunks/{registry-QRMXRSCT.js → registry-FTPUUHWC.js} +5 -5
  82. package/dist/chunks/{registry-ABKBGGGK.js → registry-Y2HWS6JS.js} +4 -4
  83. package/dist/chunks/{room-recommend-TWIEVY44.js → room-recommend-LMNF76YS.js} +4 -4
  84. package/dist/chunks/{schedule-XZ4UUX4E.js → schedule-4QE2THAP.js} +4 -4
  85. package/dist/chunks/{smart-extract-DEBLJPCQ.js → smart-extract-GTYKF5TJ.js} +32 -21
  86. package/dist/chunks/{workflow-D7LBN5MZ.js → workflow-KXYTQZ2H.js} +81 -12
  87. package/dist/core/error-codes.js +1 -1
  88. package/dist/core/host-policy.js +56 -0
  89. package/dist/core/timing.js +227 -0
  90. package/dist/index.js +39 -36
  91. package/dist/internal/e10/auth/commands.js +11 -0
  92. package/dist/internal/e10/auth/error-log.js +13 -0
  93. package/dist/internal/e10/auth/messages.js +10 -0
  94. package/dist/internal/e10/auth/xiaoe.js +12 -2
  95. package/dist/internal/e10/context.js +39 -12
  96. package/dist/internal/e10/network-error.js +28 -0
  97. package/dist/internal/e10/tls-policy.js +260 -0
  98. package/dist/shortcuts/archive/operations/archive-info.js +9 -5
  99. package/dist/shortcuts/asset/manifest.js +42 -4
  100. package/dist/shortcuts/contract/manifest.js +204 -21
  101. package/dist/shortcuts/data/manifest.js +45 -2
  102. package/dist/shortcuts/ebuilder-form/manifest.js +38 -10
  103. package/dist/shortcuts/hrm/index.js +20 -7
  104. package/dist/shortcuts/hrm/operations/employee.js +22 -11
  105. package/dist/shortcuts/hrm/operations/org.js +18 -9
  106. package/dist/shortcuts/hrm/operations/position.js +24 -12
  107. package/dist/shortcuts/hrm/operations/resolve.js +18 -10
  108. package/dist/shortcuts/im/operations/group-read.js +4 -1
  109. package/dist/shortcuts/invoice/manifest.js +44 -1
  110. package/dist/shortcuts/jiuchuanhui/host.js +76 -4
  111. package/dist/shortcuts/jiuchuanhui/manifest.js +106 -2
  112. package/dist/shortcuts/meeting/operations/attachment-content.js +25 -16
  113. package/dist/shortcuts/meeting/operations/eb/member-expand.js +1 -0
  114. package/dist/shortcuts/meeting/operations/invitation.js +1 -1
  115. package/dist/shortcuts/meeting/operations/link.js +20 -17
  116. package/dist/shortcuts/okr/operations/read.js +7 -1
  117. package/dist/shortcuts/reception/host.js +19 -5
  118. package/dist/shortcuts/reception/manifest.js +2 -0
  119. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +4 -1
  120. package/dist/shortcuts/smart-extract/operations/structure.js +13 -10
  121. package/dist/shortcuts/smart-extract/operations/target.js +15 -7
  122. package/dist/shortcuts/workflow/index.js +55 -5
  123. package/dist/shortcuts/workflow/operations/aiDeepRead/collect.js +26 -2
  124. package/dist/shortcuts/workflow/operations/aiDeepRead/render.js +23 -4
  125. package/dist/shortcuts/workflow/operations/deepRead.js +295 -4
  126. package/dist/shortcuts/workflow/operations/read.js +44 -22
  127. package/dist/shortcuts/workflow/operations/types.js +7 -1
  128. package/dist/shortcuts/workflow/operations/write.js +20 -2
  129. package/dist/shortcuts/workflow/operations.js +19 -1
  130. package/docs/e10-auth.md +48 -1
  131. package/package.json +1 -1
  132. package/scripts/xiaoe_env.py +18 -3
  133. package/skills/weaver-e10-asset-idle/SKILL.md +1 -1
  134. package/skills/weaver-e10-blog/SKILL.md +2 -2
  135. package/skills/weaver-e10-calendar/SKILL.md +1 -1
  136. package/skills/weaver-e10-data/SKILL.md +1 -1
  137. package/skills/weaver-e10-esb/SKILL.md +1 -1
  138. package/skills/weaver-e10-esb/references/source-manifest.json +3 -3
  139. package/skills/weaver-e10-hrm/SKILL.md +1 -1
  140. package/skills/weaver-e10-jiuchuanhui/references/customer.md +1 -0
  141. package/skills/weaver-e10-jucailin/SKILL.md +84 -17
  142. package/skills/weaver-e10-jucailin/agents/openai.yaml +2 -1
  143. package/skills/weaver-e10-jucailin/references/recruit-create.md +7 -8
  144. package/skills/weaver-e10-jucailin/references/recruit-implement-INDEX.md +41 -0
  145. package/skills/weaver-e10-jucailin/references/recruit-implement-consult-sop.md +77 -0
  146. package/skills/weaver-e10-jucailin/references/recruit-implement-guardrails.md +41 -0
  147. package/skills/weaver-e10-jucailin/references/recruit-implement-kb-data-update-channels.md +31 -0
  148. package/skills/weaver-e10-jucailin/references/recruit-implement-kb-form-external.md +43 -0
  149. package/skills/weaver-e10-jucailin/references/recruit-implement-kb-talent-base-form.md +32 -0
  150. package/skills/weaver-e10-jucailin/references/recruit-implement-pattern-external-collect-update-talent.md +93 -0
  151. package/skills/weaver-e10-jucailin/references/recruit-implement-pattern-external-share-edit.md +64 -0
  152. package/skills/weaver-e10-jucailin/references/recruit-read.md +1 -1
  153. package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +1 -1
  154. package/skills/weaver-e10-jucailin/references/recruit-write.md +4 -11
  155. package/skills/weaver-e10-jucailin/references/safety-boundaries.md +3 -3
  156. package/skills/weaver-e10-mail/SKILL.md +52 -10
  157. package/skills/weaver-e10-mail/references/mail-agent-entry.md +1 -2
  158. package/skills/weaver-e10-meeting/SKILL.md +1 -1
  159. package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
  160. package/skills/weaver-e10-okr/SKILL.md +1 -1
  161. package/skills/weaver-e10-okr/references/source-manifest.json +5 -5
  162. package/skills/weaver-e10-plan/SKILL.md +2 -2
  163. package/skills/weaver-e10-plan/references/source-manifest.json +3 -3
  164. package/skills/weaver-e10-qiyecheng/SKILL.md +2 -2
  165. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +3 -3
  166. package/skills/weaver-e10-reception-flow/SKILL.md +53 -16
  167. package/skills/weaver-e10-shared/SKILL.md +4 -9
  168. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +2 -2
  169. package/skills/weaver-e10-shijingran/SKILL.md +14 -6
  170. package/skills/weaver-e10-shijingran/references/source-manifest.json +5 -4
  171. package/skills/weaver-e10-workflow/SKILL.md +11 -11
  172. package/skills/weaver-e10-workflow/aiDeepRead/templates//346/261/207/346/200/273/345/256/241/346/211/271-demo.html +92 -12
  173. package/skills/weaver-e10-workflow/references/source-manifest.json +3 -3
  174. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +6 -4
  175. package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +1 -2
  176. package/skills/weaver-e10-workflow/references/workflow-deep-read.md +44 -8
  177. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +84 -12
  178. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
  179. package/skills/weaver-e10-ziguanjia/SKILL.md +1 -1
  180. package/skills/weaver-e10-ziguanjia/references/ziguanjia-agent-entry.md +1 -2
@@ -107,14 +107,28 @@ const contractAssistantOperationContracts = ([
107
107
  pageNo: { type: 'integer', minimum: 1 },
108
108
  pageSize: { type: 'integer', minimum: 1, maximum: 200 },
109
109
  }),
110
- assistantRead('contract.assistant.rule.group.query', {
111
- method: 'POST',
112
- path: '/api/ebd/contract/ai/config/queryCustomConfigRules',
113
- }, { config_id: idString, configId: idString }, []),
114
- assistantRead('contract.assistant.element.query', {
115
- method: 'POST',
116
- path: '/api/ebd/contract/ai/config/queryElementConfigRules',
117
- }, { config_id: idString, configId: idString }, []),
110
+ {
111
+ name: 'contract.assistant.rule.group.query',
112
+ risk: 'read',
113
+ auth: AUTH,
114
+ fixed: { method: 'POST', path: '/api/ebd/contract/ai/config/queryCustomConfigRules' },
115
+ // config_id / configId 二选一:handler 为 requireId(input.config_id ?? input.configId)
116
+ inputSchema: {
117
+ ...readSchema({ config_id: idString, configId: idString }),
118
+ anyOf: [{ required: ['config_id'] }, { required: ['configId'] }],
119
+ },
120
+ },
121
+ {
122
+ name: 'contract.assistant.element.query',
123
+ risk: 'read',
124
+ auth: AUTH,
125
+ fixed: { method: 'POST', path: '/api/ebd/contract/ai/config/queryElementConfigRules' },
126
+ // config_id / configId 二选一:handler 为 requireId(input.config_id ?? input.configId)
127
+ inputSchema: {
128
+ ...readSchema({ config_id: idString, configId: idString }),
129
+ anyOf: [{ required: ['config_id'] }, { required: ['configId'] }],
130
+ },
131
+ },
118
132
  assistantRead('contract.assistant.flow.list', {
119
133
  method: 'POST',
120
134
  path: '/api/ebd/contract/tool/permission/list/page',
@@ -545,18 +559,22 @@ const quoteContracts = [
545
559
  name: 'contract.ledger.aggregate',
546
560
  risk: 'read',
547
561
  fixed: { local: true, kind: 'ledger-aggregate' },
548
- inputSchema: readSchema({
549
- ref: { type: 'string', minLength: 1, description: '单个 refId(weaver-work-cli refs 暂存结果)' },
550
- refs: { type: 'array', items: { type: 'string' }, description: '多个 refId:分批取数后合并统计' },
551
- file: { type: 'string', maxLength: 4096, description: '直接给结果 JSON 文件路径(与 ref/refs 可同时使用)' },
552
- refsDir: { type: 'string', maxLength: 4096, description: 'refs 根目录;默认 ~/.weaver-work-cli/state/refs' },
553
- by: { type: 'array', items: { type: 'string' }, description: '分组字段(语义键,如 xsjl / khmc);不传只出总计' },
554
- sum: { type: 'array', items: { type: 'string' }, description: '求和字段(金额,如 htzje / yxje)' },
555
- where: { type: 'array', items: { type: 'string' }, description: '过滤条件,形如 xsjl=吴洋洋(子串匹配)' },
556
- dedupe: { type: 'boolean', description: '按 id / form_data_id / rowKey / ebrecord_rowkey 去重(分批窗口重叠时使用)' },
557
- detail: { type: 'boolean', description: '输出命中明细(签订日期/合同号/客户/销售经理/合同总金额)' },
558
- limit: { type: 'integer', minimum: 1, maximum: 1000, description: '明细最多返回条数,默认 20' },
559
- }),
562
+ inputSchema: {
563
+ ...readSchema({
564
+ ref: { type: 'string', minLength: 1, description: '单个 refId(weaver-work-cli refs 暂存结果)' },
565
+ refs: { type: 'array', items: { type: 'string' }, description: '多个 refId:分批取数后合并统计' },
566
+ file: { type: 'string', maxLength: 4096, description: '直接给结果 JSON 文件路径(与 ref/refs 可同时使用)' },
567
+ refsDir: { type: 'string', maxLength: 4096, description: 'refs 根目录;默认 ~/.weaver-work-cli/state/refs' },
568
+ by: { type: 'array', items: { type: 'string' }, description: '分组字段(语义键,如 xsjl / khmc);不传只出总计' },
569
+ sum: { type: 'array', items: { type: 'string' }, description: '求和字段(金额,如 htzje / yxje)' },
570
+ where: { type: 'array', items: { type: 'string' }, description: '过滤条件,形如 xsjl=吴洋洋(子串匹配)' },
571
+ dedupe: { type: 'boolean', description: '按 id / form_data_id / rowKey / ebrecord_rowkey 去重(分批窗口重叠时使用)' },
572
+ detail: { type: 'boolean', description: '输出命中明细(签订日期/合同号/客户/销售经理/合同总金额)' },
573
+ limit: { type: 'integer', minimum: 1, maximum: 1000, description: '明细最多返回条数,默认 20' },
574
+ }),
575
+ // 结果来源三选一:handler 无来源时抛 source_required(ledger.ts)
576
+ anyOf: [{ required: ['ref'] }, { required: ['refs'] }, { required: ['file'] }],
577
+ },
560
578
  },
561
579
  {
562
580
  name: 'contract.ledger.metrics',
@@ -753,6 +771,171 @@ const contractCustomerOperationContracts = [
753
771
  }, ['searchValue', 'workflowId']),
754
772
  },
755
773
  ];
774
+ /**
775
+ * 每条 operation 的一句话用途,写入 schema 的 summary。
776
+ *
777
+ * 口径:只描述「做什么 + 关键入参 + 是否写库」,不写未在实现里体现的业务承诺;
778
+ * prepare/apply 成对出现时,prepare 标注「只出预览,不写入」,apply 标注「落库前需确认」。
779
+ */
780
+ const OPERATION_SUMMARIES = {
781
+ 'contract.type.tree': '合同类型组织树:取全部合同类型节点(含层级与类型 ID),用于选择合同类型、挂载条款或流程',
782
+ 'contract.modeltext.list': '分页查询合同正文模板列表(eBuilder 表单数据,按 pageNo/pageSize 翻页)',
783
+ 'contract.clause.tree': '条款分类树:取条款目录节点(含层级),用于按分类浏览条款',
784
+ 'contract.clause.list': '分页查询条款列表;可按条款名称/编号/状态/分组/合同类型/组织过滤,返回条款概要',
785
+ 'contract.clause.group.list': '分页查询条款分组列表;可按条款名称/编号/状态/合同类型过滤',
786
+ 'contract.clause.search': '按关键词/标签检索条款正文(getClauses);支持 id/title/tagId/group 过滤与分页',
787
+ 'contract.clause.tags': '取条款标签字典(label↔value),用于条款搜索与筛选',
788
+ 'contract.clause.reference.get': '查询某份合同文件已引用的条款(按 fileId/requestId 过滤,可按引用对象类型与时间范围收窄)',
789
+ 'contract.clause.reference.save.prepare': '准备保存条款引用(只出预览,不写入);入参 clauseIds/fileId/requestId',
790
+ 'contract.clause.reference.save.apply': '提交保存条款引用(落库前需确认);入参 clauseIds/fileId/requestId + continuation + confirm',
791
+ 'contract.subject.app': '按标签取 eBuilder 应用 ID 列表(签约主体数据所在应用)',
792
+ 'contract.subject.form': '按 appId + tag 取签约主体的表单(对象)定义',
793
+ 'contract.subject.fields': '取签约主体表单的字段元数据(用于确定可写字段与字段类型)',
794
+ 'contract.subject.options': '取签约主体表单某字段的选项字典(id↔name)',
795
+ 'contract.subject.query': '分页查询签约主体数据(按 objId/mainTable,可带明细)',
796
+ 'contract.subject.create.prepare': '准备新建签约主体(只出预览,不写入);入参 objId/mainTable',
797
+ 'contract.subject.create.apply': '提交新建签约主体(落库前需确认);入参 objId/mainTable + continuation + confirm',
798
+ 'contract.workflow.query': '按流程名查合同流程定义基础信息(含类型与启用状态)',
799
+ 'contract.workflow.list': '按 wfpCode 查当前用户可发起的合同流程列表',
800
+ 'contract.workflow.form.info': '取流程发起页的基础参数(表单与节点初始化信息)',
801
+ 'contract.workflow.field.options': '取流程表单某字段的选项值(浏览按钮类字段,分页)',
802
+ 'contract.request.create.prepare': '准备新建合同流程(只出预览,不写入);入参 workflowId/requestname/formData',
803
+ 'contract.request.create.apply': '提交新建合同流程(落库前需确认);入参 workflowId/requestname/formData + continuation + confirm',
804
+ 'contract.request.save.prepare': '准备保存流程表单草稿(只出预览,不写入);入参 requestId/workflowId/formData',
805
+ 'contract.request.save.apply': '提交保存流程表单草稿(落库前需确认);入参 requestId/workflowId/formData + continuation + confirm',
806
+ 'contract.request.submit.prepare': '准备提交流程(只出预览,不写入);入参 requestId',
807
+ 'contract.request.submit.apply': '提交流程(落库前需确认);入参 requestId + continuation + confirm',
808
+ 'contract.request.supervise.prepare': '准备流程督办(只出预览,不写入);入参 requestId/remark',
809
+ 'contract.request.supervise.apply': '提交流程督办(落库前需确认);入参 requestId/remark + continuation + confirm',
810
+ 'contract.request.status': '按 requestId 查流程当前状态(当前节点与处理人)',
811
+ 'contract.request.log': '按 requestId 查流程流转日志与签字意见',
812
+ 'contract.review.export': '导出合同 AI 审查记录(按 fileId/flowId)',
813
+ 'contract.review.digest': '汇总合同 AI 审查结果摘要(可按通过项、是否附原文过滤)',
814
+ 'contract.flow.page': '按流程名取合同流程页面地址(供打开或跳转)',
815
+ 'contract.flow.upload-field': '取流程附件上传字段定义(含字段 ID 与表单 ID)',
816
+ 'contract.flow.launch': '上传本地文件并拉起合同流程发起页;入参 flow/path/fileName',
817
+ 'contract.flow.save-recognize-record': '把 AI 识别结果保存到流程附件字段(写操作,会落库识别记录)',
818
+ 'contract.recommend.doc': '按文本内容推荐合同正文模板',
819
+ 'contract.compare.upload': '校验待比对的本地文件可上传(preUploadCheck,只校验不落库)',
820
+ 'contract.compare.search': '按关键词检索可参与比对的文档(文档中心)',
821
+ 'contract.compare.versions': '取某文档的历史版本列表(按 fileId/docId 分页)',
822
+ 'contract.compare.page': '生成两版本比对的页面地址(供打开比对页)',
823
+ 'contract.compare.diff': '取两份文件的 AI 比对差异结果(按 baseFileId/compareFileId)',
824
+ 'contract.compare.report': '生成合同比对报告并写到本地文件;入参 files/baseFileId/compareFileId/out',
825
+ 'contract.credit.page': '按企业名称生成征信查询页面地址(打开外部征信页)',
826
+ 'contract.clause.permission': '查询当前用户对条款组件的操作权限(能否新增/修改/删除)',
827
+ 'contract.clause.types': '取全部条款类型(queryAllCluseType),用于条款归属分类',
828
+ 'contract.clause.check': '校验条款名称在同一归属下是否重复(按 clauseName/belongId)',
829
+ 'contract.clause.browser': '按名称检索条款浏览按钮候选(表单选条款时用)',
830
+ 'contract.clause.subcompany': '按名称检索分部/子公司浏览按钮候选(表单选组织时用)',
831
+ 'contract.clause.category.create.prepare': '准备新建条款分类(只出预览,不写入);入参 clauseName/parentId',
832
+ 'contract.clause.category.create.apply': '提交新建条款分类(落库前需确认);入参 clauseName/parentId + continuation + confirm',
833
+ 'contract.clause.category.update.prepare': '准备修改条款分类(只出预览,不写入);入参 id',
834
+ 'contract.clause.category.update.apply': '提交修改条款分类(落库前需确认);入参 id + continuation + confirm',
835
+ 'contract.clause.category.delete.prepare': '准备删除条款分类(只出预览,不写入);入参 id',
836
+ 'contract.clause.category.delete.apply': '提交删除条款分类(落库前需确认);入参 id + continuation + confirm',
837
+ 'contract.clause.insert': '把条款清单插入本地 Word 模板并另存;入参 path/out/clauses(写本地文件)',
838
+ 'contract.clause.create.prepare': '准备新建条款(只出预览,不写入);入参 clauseName/clauseContent/belongId',
839
+ 'contract.clause.create.apply': '提交新建条款(落库前需确认);入参 clauseName/clauseContent/belongId + continuation + confirm',
840
+ 'contract.clause.update.prepare': '准备修改条款(只出预览,不写入);入参 id',
841
+ 'contract.clause.update.apply': '提交修改条款(落库前需确认);入参 id + continuation + confirm',
842
+ 'contract.clause.delete.prepare': '准备删除条款(只出预览,不写入);入参 id',
843
+ 'contract.clause.delete.apply': '提交删除条款(落库前需确认);入参 id + continuation + confirm',
844
+ 'contract.clause.group.create.prepare': '准备新建条款分组(只出预览,不写入);入参 clauseName/belongId',
845
+ 'contract.clause.group.create.apply': '提交新建条款分组(落库前需确认);入参 clauseName/belongId + continuation + confirm',
846
+ 'contract.clause.group.update.prepare': '准备修改条款分组(只出预览,不写入);入参 id',
847
+ 'contract.clause.group.update.apply': '提交修改条款分组(落库前需确认);入参 id + continuation + confirm',
848
+ 'contract.clause.group.delete.prepare': '准备删除条款分组(只出预览,不写入);入参 id',
849
+ 'contract.clause.group.delete.apply': '提交删除条款分组(落库前需确认);入参 id + continuation + confirm',
850
+ 'contract.customer.browser': '在流程表单中检索客户浏览按钮候选(按 searchValue 与字段)',
851
+ 'contract.assistant.init': '取合同助手初始化配置(全部 eBuilder 配置项)',
852
+ 'contract.assistant.meta': '取合同助手基础元数据(可用类型与标识)',
853
+ 'contract.assistant.list': '按名称分页查询合同助手列表',
854
+ 'contract.assistant.doc.query': '按 ai_id 查合同助手关联的文档配置',
855
+ 'contract.assistant.config.query': '按 ai_id/aiMark 查合同助手的能力配置',
856
+ 'contract.assistant.tips.query': '按 ai_id 查合同助手的提示语配置',
857
+ 'contract.assistant.doc.folder.search': '检索文档中心文件夹浏览按钮候选(配置助手文档范围时用)',
858
+ 'contract.assistant.keygroup.search': '检索合同要点分组浏览按钮候选',
859
+ 'contract.assistant.rule.classification.list': '查询合同助手的分类规则列表',
860
+ 'contract.assistant.rule.list': '按 flid 分页查询合同助手规则',
861
+ 'contract.assistant.rule.group.query': '按 config_id 查自定义规则分组配置',
862
+ 'contract.assistant.element.query': '按 config_id 查要素规则配置',
863
+ 'contract.assistant.flow.list': '按 ai_id 分页查询合同助手绑定的流程',
864
+ 'contract.assistant.create.prepare': '准备新建合同助手(只出预览,不写入);入参 ai_name/type',
865
+ 'contract.assistant.create.apply': '提交新建合同助手(落库前需确认);入参 ai_name/type + continuation + confirm',
866
+ 'contract.assistant.delete.prepare': '准备删除合同助手(只出预览,不写入);入参 ids',
867
+ 'contract.assistant.delete.apply': '提交删除合同助手(落库前需确认);入参 ids + continuation + confirm',
868
+ 'contract.assistant.doc.save.prepare': '准备保存合同助手文档配置(只出预览,不写入);入参 kind/ai_id',
869
+ 'contract.assistant.doc.save.apply': '提交保存合同助手文档配置(落库前需确认);入参 kind/ai_id + continuation + confirm',
870
+ 'contract.assistant.agent.update.prepare': '准备修改合同助手智能体配置(只出预览,不写入);入参 id/ai_id',
871
+ 'contract.assistant.agent.update.apply': '提交修改合同助手智能体配置(落库前需确认);入参 id/ai_id + continuation + confirm',
872
+ 'contract.assistant.tips.create.prepare': '准备新增合同助手提示语(只出预览,不写入);入参 tsynr/ai_id',
873
+ 'contract.assistant.tips.create.apply': '提交新增合同助手提示语(落库前需确认);入参 tsynr/ai_id + continuation + confirm',
874
+ 'contract.assistant.tips.delete.prepare': '准备删除合同助手提示语(只出预览,不写入);入参 ids/ai_id',
875
+ 'contract.assistant.tips.delete.apply': '提交删除合同助手提示语(落库前需确认);入参 ids/ai_id + continuation + confirm',
876
+ 'contract.assistant.rule.classification.create.prepare': '准备新建分类规则(只出预览,不写入);入参 htlx/htlxlabelid',
877
+ 'contract.assistant.rule.classification.create.apply': '提交新建分类规则(落库前需确认);入参 htlx/htlxlabelid + continuation + confirm',
878
+ 'contract.assistant.rule.classification.update.prepare': '准备修改分类规则(只出预览,不写入);入参 id/htlx',
879
+ 'contract.assistant.rule.classification.update.apply': '提交修改分类规则(落库前需确认);入参 id/htlx + continuation + confirm',
880
+ 'contract.assistant.rule.classification.delete.prepare': '准备删除分类规则(只出预览,不写入);入参 id',
881
+ 'contract.assistant.rule.classification.delete.apply': '提交删除分类规则(落库前需确认);入参 id + continuation + confirm',
882
+ 'contract.assistant.rule.create.prepare': '准备新建审查规则(只出预览,不写入);入参 gzmc/rule_content/flid',
883
+ 'contract.assistant.rule.create.apply': '提交新建审查规则(落库前需确认);入参 gzmc/rule_content/flid + continuation + confirm',
884
+ 'contract.assistant.rule.update.prepare': '准备修改审查规则(只出预览,不写入);入参 id/gzmc',
885
+ 'contract.assistant.rule.update.apply': '提交修改审查规则(落库前需确认);入参 id/gzmc + continuation + confirm',
886
+ 'contract.assistant.rule.delete.prepare': '准备删除审查规则(只出预览,不写入);入参 ids',
887
+ 'contract.assistant.rule.delete.apply': '提交删除审查规则(落库前需确认);入参 ids + continuation + confirm',
888
+ 'contract.assistant.rule.group.create.prepare': '准备新建自定义规则分组(只出预览,不写入);入参 rule_flag/config_id',
889
+ 'contract.assistant.rule.group.create.apply': '提交新建自定义规则分组(落库前需确认);入参 rule_flag/config_id + continuation + confirm',
890
+ 'contract.assistant.rule.group.update.prepare': '准备修改自定义规则分组(只出预览,不写入);入参 id/rule_flag',
891
+ 'contract.assistant.rule.group.update.apply': '提交修改自定义规则分组(落库前需确认);入参 id/rule_flag + continuation + confirm',
892
+ 'contract.assistant.rule.group.delete.prepare': '准备删除自定义规则分组(只出预览,不写入);入参 ids/config_id',
893
+ 'contract.assistant.rule.group.delete.apply': '提交删除自定义规则分组(落库前需确认);入参 ids/config_id + continuation + confirm',
894
+ 'contract.assistant.element.create.prepare': '准备新增要素规则(只出预览,不写入);入参 element_name/config_id',
895
+ 'contract.assistant.element.create.apply': '提交新增要素规则(落库前需确认);入参 element_name/config_id + continuation + confirm',
896
+ 'contract.assistant.element.delete.prepare': '准备删除要素规则(只出预览,不写入);入参 ids/config_id',
897
+ 'contract.assistant.element.delete.apply': '提交删除要素规则(落库前需确认);入参 ids/config_id + continuation + confirm',
898
+ 'contract.assistant.flow.save.prepare': '准备新增合同助手流程绑定(只出预览,不写入);入参 ai_id/flowId',
899
+ 'contract.assistant.flow.save.apply': '提交新增合同助手流程绑定(落库前需确认);入参 ai_id/flowId + confirm',
900
+ 'contract.assistant.flow.update.prepare': '准备修改合同助手流程绑定(只出预览,不写入);入参 id/ai_id',
901
+ 'contract.assistant.flow.update.apply': '提交修改合同助手流程绑定(落库前需确认);入参 id/ai_id + confirm',
902
+ 'contract.assistant.flow.delete.prepare': '准备删除合同助手流程绑定(只出预览,不写入);入参 ids/ai_id',
903
+ 'contract.assistant.flow.delete.apply': '提交删除合同助手流程绑定(落库前需确认);入参 ids/ai_id + continuation + confirm',
904
+ 'contract.performance.link': '按菜单/统计期间/时间字段生成履约报表查询链接',
905
+ 'contract.performance.fields': '取履约报表菜单的可用字段(用于组装查询条件)',
906
+ 'contract.performance.source.entry': '按数据来源与菜单解析履约数据的入口配置',
907
+ 'contract.performance.menu.search': '按关键词检索当前用户有权限的履约报表菜单',
908
+ 'contract.performance.list.init': '初始化履约列表(listInit:取列配置与筛选器定义)',
909
+ 'contract.performance.list.filters': '取履约列表的筛选器定义(可含字段元数据)',
910
+ 'contract.performance.list.query': '查询履约列表数据(按搜索字段/条件/分页,支持多页翻取)',
911
+ 'contract.performance.receipt.query': '按合同编号批量查询履约收款数据',
912
+ 'contract.quote.rmb': '把金额数字转成人民币大写(本地计算,不调接口)',
913
+ 'contract.docx.slots.scan': '扫描 Word 模板的占位槽位并列出;入参 template',
914
+ 'contract.docx.slots.fill': '按计划把内容填入 Word 模板槽位并另存;入参 template/out/plan(写本地文件)',
915
+ 'contract.docx.verify': '校验生成的 Word 是否满足标题与占位要求;入参 path',
916
+ 'contract.quotescreen.recognize': '识别报价单截图/附件并生成结构化报价文件(写本地产物)',
917
+ 'contract.quotescreen.submit': '把识别后的报价提交到指定合同流程(写操作,会落库)',
918
+ 'contract.triage.extract': '从合同文件中抽取分诊要素并生成结构化结果(写本地文件);入参 file/outDir',
919
+ 'contract.ledger.aggregate': '按维度汇总台账数据(可过滤、去重、取明细;支持引用已有结果 refId)',
920
+ 'contract.ledger.metrics': '按 key 取台账指标定义(口径说明)',
921
+ 'contract.ledger.guard': '校验台账合计与明细条件是否一致(防多算/漏算)',
922
+ 'contract.ledger.route': '按查询意图把需求路由到台账菜单与查询条件',
923
+ 'contract.ledger.card': '生成台账卡片页面并写入本地产物;入参 menu/pageId/out',
924
+ 'contract.review.report': '生成合同审查报告文档并写到本地;入参 data/out',
925
+ 'contract.elements.build': '按分诊结果构建合同要素结构(写本地产物)',
926
+ 'contract.firstscreen.run': '跑合同首屏流程:识别附件并生成首屏结果(写本地产物)',
927
+ 'contract.file.download': '按 fileId 下载合同附件到本地;入参 fileId/savePath(可限最大字节)',
928
+ 'contract.quote.sheets': '列出报价 Excel 的工作表名;入参 path(读本地文件)',
929
+ 'contract.quote.parse': '解析报价 Excel 明细(可按 sheet 过滤、可保留备注);入参 path',
930
+ 'contract.quote.extract': '从报价文件抽取结构化报价;入参 path',
931
+ 'contract.quote.normalize': '把已有报价数据规范化后输出;入参 data',
932
+ };
933
+ function withSummaries(operations) {
934
+ return operations.map((item) => ({
935
+ ...item,
936
+ summary: item.summary || OPERATION_SUMMARIES[item.name] || '',
937
+ }));
938
+ }
756
939
  export const contractOperations = [
757
940
  {
758
941
  name: 'contract.type.tree',
@@ -1880,7 +2063,7 @@ export const contractManifest = {
1880
2063
  host: 'e10-contract',
1881
2064
  status: 'builtin',
1882
2065
  sourceSkill: 'weaver-e10-jinchengda',
1883
- operations: contractOperations,
2066
+ operations: withSummaries(contractOperations),
1884
2067
  withheldOperations: [
1885
2068
  {
1886
2069
  name: 'contract.credit.query',
@@ -31,7 +31,12 @@ const INPUT_SCHEMAS = {
31
31
  'data.ds.count': { required: ['group', 'table'], optional: ['where', 'source_type', 'app_id'] },
32
32
  'data.noun.list': { required: ['skill'], optional: ['source_type', 'source_group', 'source_table'] },
33
33
  'data.noun.scope': { required: ['ids'], optional: [] },
34
- 'data.attribution.metric': { required: [], optional: ['ids', 'group_ids', 'item_ids'] },
34
+ 'data.attribution.metric': {
35
+ required: [],
36
+ optional: ['ids', 'group_ids', 'item_ids'],
37
+ // 至少其一:handler 三者全空即抛 missing_argument(attribution.ts parseAttributionScopeIds)
38
+ anyOf: [{ required: ['ids'] }, { required: ['group_ids'] }, { required: ['item_ids'] }],
39
+ },
35
40
  'data.field.name2id': { required: ['module', 'type', 'name'], optional: ['form_param', 'eb_browser_param', 'property_type'] },
36
41
  'data.field.options': { required: ['field_name', 'obj_id', 'group'], optional: ['source_type'] },
37
42
  'data.conf.get': { required: ['key'], optional: ['type', 'group'] },
@@ -58,26 +63,64 @@ const INPUT_SCHEMAS = {
58
63
  'method', 'fields', 'raw', 'show_params', 'full', 'with_example', 'no_example',
59
64
  'dry_run', 'timeout',
60
65
  ],
66
+ // conf_key + group 与本地 confAttrs(conf_file / attrs)二选一(module.ts 头部两条校验)
67
+ anyOf: [
68
+ { required: ['conf_key', 'group'] },
69
+ { required: ['conf_file'] },
70
+ { required: ['attrs'] },
71
+ ],
61
72
  },
62
73
  'data.attend.statis': { required: [], optional: ['user', 'begin', 'end'] },
63
74
  };
75
+ /**
76
+ * 少量字段的取值口径。只写会踩坑的:默认全部字段只声明类型,不编说明。
77
+ * `dsl` 走 `readJsonArg`(operations/query.ts),传 SQL 文本会直接被 JSON 解析拒绝。
78
+ */
79
+ const FIELD_DESCRIPTIONS = {
80
+ 'data.dsl.query.dsl': 'DSL 查询体:JSON 字符串,或 @文件路径;CLI 按 JSON 解析,不能传 SQL 文本(会报「--dsl 不是合法 JSON」)',
81
+ };
64
82
  function inputSchemaOf(name) {
65
83
  const spec = INPUT_SCHEMAS[name] || { required: [], optional: [] };
66
84
  const properties = {};
67
85
  for (const key of [...spec.required, ...spec.optional]) {
68
- properties[key] = { type: key === 'keys' || key === 'ids' || key === 'group_ids' || key === 'item_ids' ? 'array' : 'string' };
86
+ const description = FIELD_DESCRIPTIONS[`${name}.${key}`];
87
+ properties[key] = {
88
+ type: key === 'keys' || key === 'ids' || key === 'group_ids' || key === 'item_ids' ? 'array' : 'string',
89
+ ...(description ? { description } : {}),
90
+ };
69
91
  }
70
92
  return {
71
93
  type: 'object',
72
94
  properties,
73
95
  required: spec.required,
96
+ ...(spec.anyOf ? { anyOf: spec.anyOf } : {}),
74
97
  additionalProperties: false,
75
98
  };
76
99
  }
100
+ /**
101
+ * 写类 operation 的风险标注。
102
+ *
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 个配置写操作与只读查询同一标签」的整改要求一致。
111
+ */
112
+ const WRITE_RISK = new Set([
113
+ 'data.conf.add',
114
+ 'data.conf.add-file',
115
+ 'data.conf.update',
116
+ 'data.conf.delete',
117
+ 'data.module.call',
118
+ ]);
77
119
  export const dataOperations = operationDefinitions().map((definition) => ({
78
120
  name: definition.name,
79
121
  resource: definition.capability,
80
122
  summary: definition.summary,
123
+ risk: WRITE_RISK.has(definition.name) ? 'high-risk-write' : 'read',
81
124
  command: definition.command,
82
125
  inputSchema: inputSchemaOf(definition.name),
83
126
  }));
@@ -81,6 +81,8 @@ export const ebuilderFormOperations = [
81
81
  orderParams: { type: 'array' },
82
82
  passid: { type: 'string' },
83
83
  cid: { type: 'string' },
84
+ }, {
85
+ anyOf: [{ required: ['context'] }, { required: ['listId', 'appId'] }, { required: ['menuKeywords'] }, { required: ['menu'] }, { required: ['url'] }],
84
86
  }),
85
87
  },
86
88
  {
@@ -107,6 +109,8 @@ export const ebuilderFormOperations = [
107
109
  pageFilter: {},
108
110
  customConfig: { type: 'object' },
109
111
  refPluginPackageId: { type: 'string' },
112
+ }, {
113
+ anyOf: [{ required: ['context'] }, { required: ['hostPageId', 'appId'] }, { required: ['menuKeywords'] }, { required: ['menu'] }, { required: ['url'] }],
110
114
  }),
111
115
  },
112
116
  {
@@ -123,6 +127,15 @@ export const ebuilderFormOperations = [
123
127
  enableMerge: { type: ['boolean', 'string'], default: true },
124
128
  customParam: {},
125
129
  params: {},
130
+ }, {
131
+ anyOf: [
132
+ { required: ['context'] },
133
+ { required: ['url'] },
134
+ { required: ['menuKeywords'] },
135
+ { required: ['menu'] },
136
+ { required: ['objId'] },
137
+ { required: ['listId', 'appId', 'listKind'] },
138
+ ],
126
139
  }),
127
140
  },
128
141
  {
@@ -130,16 +143,31 @@ export const ebuilderFormOperations = [
130
143
  summary: '按字段元数据 ID 读取选择类字段选项',
131
144
  risk: 'read',
132
145
  fixed: { path: '/api/ebuilder/common/ds/options' },
133
- inputSchema: schema({
134
- ...contextProperties,
135
- fieldName: { type: 'string', pattern: '^\\d+$' },
136
- fieldId: { type: 'string', pattern: '^\\d+$' },
137
- sourceType: { type: 'string', default: 'FORM' },
138
- groupId: { type: 'string' },
139
- optionLevel: { type: ['integer', 'string'], default: 1 },
140
- }, {
141
- anyOf: [{ required: ['fieldName'] }, { required: ['fieldId'] }],
142
- }),
146
+ inputSchema: {
147
+ ...schema({
148
+ ...contextProperties,
149
+ fieldName: { type: 'string', pattern: '^\\d+$' },
150
+ fieldId: { type: 'string', pattern: '^\\d+$' },
151
+ sourceType: { type: 'string', default: 'FORM' },
152
+ groupId: { type: 'string' },
153
+ optionLevel: { type: ['integer', 'string'], default: 1 },
154
+ }),
155
+ // 两条同时成立:① fieldName / fieldId 二选一;② 上下文至少要能给出一组(resolveContext 最终要求 objId)
156
+ allOf: [
157
+ { anyOf: [{ required: ['fieldName'] }, { required: ['fieldId'] }] },
158
+ {
159
+ anyOf: [
160
+ { required: ['context'] },
161
+ { required: ['objId'] },
162
+ { required: ['listId', 'appId'] },
163
+ { required: ['hostPageId', 'appId'] },
164
+ { required: ['menuKeywords'] },
165
+ { required: ['menu'] },
166
+ { required: ['url'] },
167
+ ],
168
+ },
169
+ ],
170
+ },
143
171
  },
144
172
  {
145
173
  name: 'ebuilder-form.mapping.get',
@@ -149,17 +149,30 @@ export const hrmShortcut = {
149
149
  ctx.output.write(hrmManifest, { json: true });
150
150
  return;
151
151
  }
152
- // 精简版:name + summary + 参数名 + 必填项,供 Agent 快速路由,避免全量 schema 撑爆上下文
152
+ // 精简版:name + summary + 参数名 + 必填项,供 Agent 快速路由,避免全量 schema 撑爆上下文。
153
+ //
154
+ // `atLeastOne`:查询类的「至少一个收敛条件」用 inputSchema.anyOf 表达,
155
+ // 精简视图原先只打印 required(=[]),看起来像「无需入参」,实测空入参会被
156
+ // E-0003 empty_condition 拒(hrm.employee.query / org.query / position.query)。
157
+ // 这里把 anyOf 各分支的 required 并成扁平列表回给调用方,避免再靠报错反推。
153
158
  const brief = {
154
159
  schemaVersion: hrmManifest.schemaVersion,
155
160
  name: hrmManifest.name,
156
161
  version: hrmManifest.version,
157
- operations: hrmManifest.operations.map((o) => ({
158
- name: o.name,
159
- summary: o.summary,
160
- params: Object.keys(o.inputSchema?.properties ?? {}),
161
- required: o.inputSchema?.required ?? [],
162
- })),
162
+ operations: hrmManifest.operations.map((o) => {
163
+ const anyOf = Array.isArray(o.inputSchema?.anyOf) ? o.inputSchema.anyOf : null;
164
+ const atLeastOne = anyOf
165
+ ? [...new Set(anyOf.flatMap((branch) => branch?.required ?? []))]
166
+ : [];
167
+ return {
168
+ name: o.name,
169
+ summary: o.summary,
170
+ risk: o.risk,
171
+ params: Object.keys(o.inputSchema?.properties ?? {}),
172
+ required: o.inputSchema?.required ?? [],
173
+ ...(atLeastOne.length ? { atLeastOne } : {}),
174
+ };
175
+ }),
163
176
  };
164
177
  ctx.output.write(brief, { json: true });
165
178
  }));
@@ -205,17 +205,28 @@ const employeeQuery = {
205
205
  action: 'hrm.employee.query',
206
206
  summary: '按工号/姓名/手机/邮箱(keyword 自动推断或显式字段)查询员工;默认在职,status 传 ["6"] 查离职;默认每行只回人员信息',
207
207
  risk: READ,
208
- inputSchema: schemaOf({
209
- keyword: { type: 'string', description: '查询关键词,自动推断:含 @→邮箱;11 位纯数字→手机;纯数字或字母开头含数字→工号;其余→姓名(模糊)' },
210
- username: { type: 'string', description: '姓名(模糊匹配)' },
211
- job_num: { type: 'string', description: '工号(模糊匹配)' },
212
- mobile: { type: 'string', description: '手机号(模糊匹配)' },
213
- email: { type: 'string', description: '邮箱(模糊匹配)' },
214
- status: { type: 'array', items: { type: 'string', enum: [...EMPLOYEE_STATUS] }, description: '默认 ["normal"] 在职;["6"] 离职。不能单独作为收敛条件' },
215
- full: { type: 'boolean', description: '默认 false:每行只回人员信息(id/name/department/position/statusCode/link);true:回完整行(另含 userid/cid/mobile/departmentId/deptLink)' },
216
- all: { type: 'boolean', description: 'true = 自动翻页拉全量(最多 50 页);结果多时建议直接传,避免只拿到第一页' },
217
- ...SCHEMA_PAGE,
218
- }),
208
+ inputSchema: {
209
+ ...schemaOf({
210
+ keyword: { type: 'string', description: '查询关键词,自动推断:含 @→邮箱;11 位纯数字→手机;纯数字或字母开头含数字→工号;其余→姓名(模糊)' },
211
+ username: { type: 'string', description: '姓名(模糊匹配)' },
212
+ job_num: { type: 'string', description: '工号(模糊匹配)' },
213
+ mobile: { type: 'string', description: '手机号(模糊匹配)' },
214
+ email: { type: 'string', description: '邮箱(模糊匹配)' },
215
+ status: { type: 'array', items: { type: 'string', enum: [...EMPLOYEE_STATUS] }, description: '默认 ["normal"] 在职;["6"] 离职。不能单独作为收敛条件' },
216
+ full: { type: 'boolean', description: '默认 false:每行只回人员信息(id/name/department/position/statusCode/link);true:回完整行(另含 userid/cid/mobile/departmentId/deptLink)' },
217
+ all: { type: 'boolean', description: 'true = 自动翻页拉全量(最多 50 页);结果多时建议直接传,避免只拿到第一页' },
218
+ ...SCHEMA_PAGE,
219
+ }),
220
+ anyOf: [
221
+ { required: ['keyword'] },
222
+ { required: ['username'] },
223
+ { required: ['job_num'] },
224
+ { required: ['mobile'] },
225
+ { required: ['email'] },
226
+ // all:true 是「无收敛条件拉全员」的显式开关(见 resolveEmployeeCondition),all:false 不算条件
227
+ { required: ['all'], properties: { all: { const: true } } },
228
+ ],
229
+ },
219
230
  handler: async (args, { host }) => {
220
231
  const { field, value } = resolveEmployeeCondition(args);
221
232
  const status = Array.isArray(args.status) && args.status.length > 0 ? args.status : ['normal'];
@@ -15,15 +15,24 @@ const orgQuery = {
15
15
  action: 'hrm.org.query',
16
16
  summary: '按名称/编号/上级组织查询分部或部门(type 区分;不传 type 时默认部门,可用 type 切分部分部)',
17
17
  risk: READ,
18
- inputSchema: schemaOf({
19
- type: { type: 'string', enum: [...ORG_TYPES], description: 'subcompany 分部 / department 部门;不传默认 department' },
20
- name: { type: 'string', description: '名称(模糊包含匹配)' },
21
- code: { type: 'string', description: '编号(模糊包含匹配)' },
22
- parent: { type: 'array', items: SCHEMA_ID, description: '上级部门 id 数组(部门挂在部门下,department)' },
23
- subcompany: { type: 'array', items: SCHEMA_ID, description: '上级分部 id 数组(部门挂在分部下,department)' },
24
- supSubDepartment: { type: 'array', items: SCHEMA_ID, description: '上级分部 id 数组(分部挂在分部下,subcompany)' },
25
- ...SCHEMA_PAGE,
26
- }),
18
+ inputSchema: {
19
+ ...schemaOf({
20
+ type: { type: 'string', enum: [...ORG_TYPES], description: 'subcompany 分部 / department 部门;不传默认 department' },
21
+ name: { type: 'string', description: '名称(模糊包含匹配)' },
22
+ code: { type: 'string', description: '编号(模糊包含匹配)' },
23
+ parent: { type: 'array', items: SCHEMA_ID, description: '上级部门 id 数组(部门挂在部门下,department)' },
24
+ subcompany: { type: 'array', items: SCHEMA_ID, description: '上级分部 id 数组(部门挂在分部下,department)' },
25
+ supSubDepartment: { type: 'array', items: SCHEMA_ID, description: '上级分部 id 数组(分部挂在分部下,subcompany)' },
26
+ ...SCHEMA_PAGE,
27
+ }),
28
+ anyOf: [
29
+ { required: ['name'] },
30
+ { required: ['code'] },
31
+ { required: ['parent'] },
32
+ { required: ['subcompany'] },
33
+ { required: ['supSubDepartment'] },
34
+ ],
35
+ },
27
36
  handler: async (args, { host }) => {
28
37
  const type = args.type === undefined ? 'department' : String(args.type);
29
38
  if (!ORG_TYPES.includes(type)) {
@@ -44,11 +44,14 @@ const positionQuery = {
44
44
  action: 'hrm.position.query',
45
45
  summary: '按名称/编号查岗位(快捷搜索名称编号合一;显式 name/code 走高级条件)',
46
46
  risk: READ,
47
- inputSchema: schemaOf({
48
- keyword: { type: 'string', description: '快捷搜索关键词,名称与编号合一匹配' },
49
- name: { type: 'string', description: '岗位名称(包含匹配)' },
50
- code: { type: 'string', description: '岗位编号(精确匹配)' },
51
- }),
47
+ inputSchema: {
48
+ ...schemaOf({
49
+ keyword: { type: 'string', description: '快捷搜索关键词,名称与编号合一匹配' },
50
+ name: { type: 'string', description: '岗位名称(包含匹配)' },
51
+ code: { type: 'string', description: '岗位编号(精确匹配)' },
52
+ }),
53
+ anyOf: [{ required: ['keyword'] }, { required: ['name'] }, { required: ['code'] }],
54
+ },
52
55
  handler: async (args, { host }) => {
53
56
  const name = args.name === undefined ? '' : String(args.name).trim();
54
57
  const code = args.code === undefined ? '' : String(args.code).trim();
@@ -127,13 +130,22 @@ const positionList = {
127
130
  action: 'hrm.position.list',
128
131
  summary: '按组织/名称/编号批量查询岗位(岗位地址簿,一次性 + 自动翻页;无过滤需显式 all=true)',
129
132
  risk: READ,
130
- inputSchema: schemaOf({
131
- org: SCHEMA_ID,
132
- name: { type: 'string', description: '岗位名称过滤(与 code 二选一)' },
133
- code: { type: 'string', description: '岗位编号过滤(与 name 二选一)' },
134
- all: { type: 'boolean', description: '显式确认全量拉取(无 org/name/code 过滤时必填 true)' },
135
- pageSize: SCHEMA_ID,
136
- }),
133
+ inputSchema: {
134
+ ...schemaOf({
135
+ org: SCHEMA_ID,
136
+ name: { type: 'string', description: '岗位名称过滤(与 code 二选一)' },
137
+ code: { type: 'string', description: '岗位编号过滤(与 name 二选一)' },
138
+ all: { type: 'boolean', description: '显式确认全量拉取(无 org/name/code 过滤时必填 true)' },
139
+ pageSize: SCHEMA_ID,
140
+ }),
141
+ anyOf: [
142
+ { required: ['org'] },
143
+ { required: ['name'] },
144
+ { required: ['code'] },
145
+ // 无过滤时必须显式 all=true(见 handler 的 full_pull_blocked),all:false 不算
146
+ { required: ['all'], properties: { all: { const: true } } },
147
+ ],
148
+ },
137
149
  handler: async (args, { host }) => {
138
150
  const hasFilter = args.org !== undefined || args.name !== undefined || args.code !== undefined;
139
151
  if (!hasFilter && args.all !== true) {