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
@@ -270,16 +270,24 @@ const orgResolve = {
270
270
  action: 'hrm.org.resolve',
271
271
  summary: '按「多维名称 + 部门/分部名称」解析组织:自动取全量多维→精确优先/模糊兜底匹配→按维度查组织;歧义时返回候选待用户确认',
272
272
  risk: READ,
273
- inputSchema: schemaOf({
274
- virtual: { type: 'string', description: '多维名称(如「行政组织」「1号维度」);精确优先,未命中按包含模糊匹配' },
275
- name: { type: 'string', description: '部门或分部名称;精确优先,未命中按包含模糊匹配' },
276
- type: { type: 'string', enum: [...ORG_TYPES], description: `department 部门 / subcompany 分部;不传时同时检索两者、按部门优先定位,并把同名另一类型节点回在 alsoMatched` },
277
- virtualId: { ...SCHEMA_ID, description: '多维 id;用户确认后复调可直接传,跳过维度名称匹配' },
278
- orgId: { ...SCHEMA_ID, description: '组织节点 id;用户确认后复调可直接传,跳过名称匹配' },
279
- maxCandidates: { ...SCHEMA_ID, description: `歧义时最多回传的候选条数,1~${MAX_CANDIDATES_LIMIT},默认 ${MAX_CANDIDATES}` },
280
- }, {
281
- description: '首调必填 virtual + name;复调可用 virtualId / orgId 直接定位。结果以 data.status 判定(resolved / ambiguous / not_found)。',
282
- }),
273
+ inputSchema: {
274
+ ...schemaOf({
275
+ virtual: { type: 'string', description: '多维名称(如「行政组织」「1号维度」);精确优先,未命中按包含模糊匹配' },
276
+ name: { type: 'string', description: '部门或分部名称;精确优先,未命中按包含模糊匹配' },
277
+ type: { type: 'string', enum: [...ORG_TYPES], description: `department 部门 / subcompany 分部;不传时同时检索两者、按部门优先定位,并把同名另一类型节点回在 alsoMatched` },
278
+ virtualId: { ...SCHEMA_ID, description: '多维 id;用户确认后复调可直接传,跳过维度名称匹配' },
279
+ orgId: { ...SCHEMA_ID, description: '组织节点 id;用户确认后复调可直接传,跳过名称匹配' },
280
+ maxCandidates: { ...SCHEMA_ID, description: `歧义时最多回传的候选条数,1~${MAX_CANDIDATES_LIMIT},默认 ${MAX_CANDIDATES}` },
281
+ }, {
282
+ description: '首调必填 virtual + name;复调可用 virtualId / orgId 直接定位。结果以 data.status 判定(resolved / ambiguous / not_found)。',
283
+ }),
284
+ anyOf: [
285
+ { required: ['virtual', 'name'] },
286
+ { required: ['virtual', 'orgId'] },
287
+ { required: ['virtualId', 'name'] },
288
+ { required: ['virtualId', 'orgId'] },
289
+ ],
290
+ },
283
291
  handler: async (args, { host }) => {
284
292
  const typeArg = optionalText(args.type);
285
293
  if (typeArg && !ORG_TYPES.includes(typeArg)) {
@@ -68,7 +68,10 @@ const groupSearch = {
68
68
  createBegin: { type: 'integer', description: '创建时间下界(unix 秒)' },
69
69
  createEnd: { type: 'integer', description: '创建时间上界(unix 秒)' },
70
70
  pageSize: { type: 'integer', minimum: 1, maximum: 200, description: '每页大小(默认 100)' },
71
- }, { description: '至少提供一个搜索条件' }),
71
+ }, {
72
+ requiredAny: ['name', 'type', 'members', 'owner', 'creator', 'today', 'yesterday', 'createBegin', 'createEnd'],
73
+ description: '至少提供一个搜索条件',
74
+ }),
72
75
  handler: async (args, { host }) => {
73
76
  const cond = {};
74
77
  let mask = 0;
@@ -562,6 +562,48 @@ const issuingContractDetailOutputSchema = objectSchema({
562
562
  }, ['docId', 'fileId', 'name'])),
563
563
  contractDocIds: { ...nullableText, description: '全部文档 id,英文逗号分隔。开票申请「合同文本」不要填这个字符串' },
564
564
  }, ['requestId', 'requestName', 'workflowName', 'customer', 'customerSource', 'contractDocuments', 'contractDocIds']);
565
+ /**
566
+ * 每条 operation 的一句话用途,写入 schema 的 summary。
567
+ *
568
+ * 口径:只描述「做什么 + 关键入参 + 是否写库」,不写未在实现里体现的业务承诺;
569
+ * prepare/apply 成对出现时,prepare 标注「只出预览,不写入」,apply 标注「落库前需确认」。
570
+ */
571
+ const OPERATION_SUMMARIES = {
572
+ 'invoice.list': '分页查询本人票夹的发票列表;可按类型、开票/消费日期区间、关键词过滤',
573
+ 'invoice.enterprise.list': '分页查询企业票夹的发票列表(企业抬头下的发票);过滤条件同票夹列表',
574
+ 'invoice.get': '按 fid 或票号取单张发票详情',
575
+ 'invoice.upload': '上传本地文件或 URL 到发票系统(产出 fileId,尚不入票夹);入参 file/url',
576
+ 'invoice.ocr.preview': '对上传的文件做 OCR 预览(不落库);入参 file/url,可指定 upload/is_save',
577
+ 'invoice.upload-and-validate': '上传并做发票查验(真假校验),返回查验结果',
578
+ 'invoice.import.prepare': '准备把发票导入票夹(只出预览,不写入);入参 file/url/validate/syncToOa',
579
+ 'invoice.import.apply': '提交把发票导入票夹(落库前需确认);需 continuation + confirm',
580
+ 'invoice.add.prepare': '准备新增发票记录(只出预览,不写入);入参 info/scope',
581
+ 'invoice.add.apply': '提交新增发票记录(落库前需确认);需 continuation + confirm',
582
+ 'invoice.update.prepare': '准备修改发票记录(只出预览,不写入);入参 fid/scope/changes',
583
+ 'invoice.update.apply': '提交修改发票记录(落库前需确认);需 continuation + confirm',
584
+ 'invoice.download': '把发票文件下载到本地;入参 fid/fileId/output(写本地文件)',
585
+ 'invoice.delete.prepare': '准备删除发票记录(只出预览,不写入);入参 fid/scope',
586
+ 'invoice.delete.apply': '提交删除发票记录(落库前需确认);需 continuation + confirm',
587
+ 'invoice.reim.file-ocr.preview': '按报销附件 fileId 取发票识别结果(批量,不落库)',
588
+ 'invoice.reim.requests.list': '分页查询可报销的流程单(报销申请列表);可按时间与场景过滤',
589
+ 'invoice.reim.workflow.resolve': '按流程单 ID 批量解析对应的报销流程定义',
590
+ 'invoice.reim.employee-superiors': '取当前员工的上级链(报销审批人候选,无入参)',
591
+ 'invoice.reim.field.search': '按关键词检索报销表单字段(含字段 ID 与所属流程/节点)',
592
+ 'invoice.reim.customer.search': '按关键词检索客户(报销关联客户候选)',
593
+ 'invoice.reim.relation.search': '按目标与关键词检索报销关联关系(客户/项目)',
594
+ 'invoice.reim.relation.save': '保存发票与客户/项目的关联关系(写操作,经动作流)',
595
+ 'invoice.reim.relation.list': '按发票 fid/fids 查已建立的报销关联关系',
596
+ 'invoice.reim.candidates.list': '按消费日期区间查询可参与报销的发票候选(有数量上限)',
597
+ 'invoice.reim.subsidy.submit': '提交报销补贴申请并创建报销流程(高风险写操作,会落库发起流程)',
598
+ 'invoice.issuing.contracts.list': '按合同卡片/流程 ID 查可开票的合同列表',
599
+ 'invoice.issuing.contract.detail': '按 requestId 查开票对应合同的流程明细',
600
+ };
601
+ function withSummaries(operations) {
602
+ return operations.map((item) => ({
603
+ ...item,
604
+ summary: item.summary || OPERATION_SUMMARIES[item.name] || '',
605
+ }));
606
+ }
565
607
  export const invoiceOperations = [
566
608
  {
567
609
  name: 'invoice.list',
@@ -1136,6 +1178,7 @@ export const invoiceOperations = [
1136
1178
  description: '合同审批流程 requestId 列表;与 cards 二选一',
1137
1179
  },
1138
1180
  },
1181
+ anyOf: [{ required: ['cards'] }, { required: ['requestIds'] }],
1139
1182
  },
1140
1183
  outputSchema: issuingContractsOutputSchema,
1141
1184
  },
@@ -1245,7 +1288,7 @@ export const invoiceManifest = {
1245
1288
  },
1246
1289
  note: '--view 与 --fields 互斥。投影只影响输出,不改变任何请求参数;meta.projection 会说明本次裁剪结果。',
1247
1290
  },
1248
- operations: invoiceOperations,
1291
+ operations: withSummaries(invoiceOperations),
1249
1292
  withheldOperations: [
1250
1293
  {
1251
1294
  name: 'invoice.share',
@@ -1,3 +1,4 @@
1
+ import { charsOf, compactForStdout } from '../../core/output.js';
1
2
  import { E10_SESSION_EXPIRED_MESSAGE } from '../../internal/e10/auth/messages.js';
2
3
  import { requireE10Session } from '../../internal/e10/context.js';
3
4
  import { getActiveProfile } from '../../internal/e10/auth/session.js';
@@ -56,6 +57,75 @@ function businessCode(value) {
56
57
  return code;
57
58
  return undefined;
58
59
  }
60
+ /** 错误里透传原始响应时的上限(字符)。失败响应不保证小,必须定量。 */
61
+ const RAW_RESPONSE_BUDGET_CHARS = 4_096;
62
+ const BUSINESS_MESSAGE_KEYS = ['msg', 'message', 'resultMsg', 'reminderMsg', 'failMsg', 'errorMsg'];
63
+ const BUSINESS_MESSAGE_CONTAINERS = ['actionData', 'responseData', 'customData', 'mainTable', 'data', 'result'];
64
+ function deepMessage(value, depth) {
65
+ if (!value || typeof value !== 'object' || Array.isArray(value) || depth > 4)
66
+ return '';
67
+ const record = value;
68
+ for (const key of BUSINESS_MESSAGE_KEYS) {
69
+ const item = record[key];
70
+ if (typeof item === 'string' && item.trim())
71
+ return item.trim();
72
+ }
73
+ for (const key of BUSINESS_MESSAGE_CONTAINERS) {
74
+ const found = deepMessage(record[key], depth + 1);
75
+ if (found)
76
+ return found;
77
+ }
78
+ return '';
79
+ }
80
+ /**
81
+ * ESB 动作流失败时,顶层 `resultMsg` 往往只是框架给的「执行失败!」;
82
+ * 真正原因藏在出参里(`actionData.responseData.customData.mainTable.msg`,
83
+ * 例如「您对当前客户无领取权限,无法领取。」)。
84
+ *
85
+ * 只在**比顶层文案更有信息量**时返回,避免与 `message` 重复。
86
+ * 注意:本函数只补充 `details`,不改动 `message` 原文。
87
+ */
88
+ export function jiuchuanhuiBusinessDetailMessage(value) {
89
+ if (!value || typeof value !== 'object' || Array.isArray(value))
90
+ return '';
91
+ const root = value;
92
+ const top = jiuchuanhuiBusinessMessage(value);
93
+ for (const key of BUSINESS_MESSAGE_CONTAINERS) {
94
+ const found = deepMessage(root[key], 0);
95
+ if (found && found !== top)
96
+ return found;
97
+ }
98
+ return '';
99
+ }
100
+ /**
101
+ * 原始响应超出预算时逐档压缩;压缩后仍超线就只留键名,绝不把 stderr 撑爆
102
+ * (错误通道不过 `Output.prepare`,没有落盘与预算兜底)。
103
+ */
104
+ function boundedResponse(value) {
105
+ if (value === undefined)
106
+ return undefined;
107
+ const chars = charsOf(value);
108
+ if (chars <= RAW_RESPONSE_BUDGET_CHARS)
109
+ return value;
110
+ const compacted = compactForStdout(value, RAW_RESPONSE_BUDGET_CHARS);
111
+ if (charsOf(compacted) <= RAW_RESPONSE_BUDGET_CHARS) {
112
+ return { note: `原始响应 ${chars} 字符,已按预算压缩为预览`, preview: compacted };
113
+ }
114
+ const keys = value && typeof value === 'object' && !Array.isArray(value)
115
+ ? Object.keys(value).slice(0, 20)
116
+ : [];
117
+ return { note: `原始响应 ${chars} 字符,超过 ${RAW_RESPONSE_BUDGET_CHARS} 字符预算,未内联`, keys };
118
+ }
119
+ /** 业务失败时的 details:保留原有 code/message,另带可执行的业务原因与原始响应。 */
120
+ function failureDetails(value, code, message) {
121
+ const businessMessage = jiuchuanhuiBusinessDetailMessage(value);
122
+ return {
123
+ code,
124
+ message,
125
+ ...(businessMessage ? { businessMessage } : {}),
126
+ response: boundedResponse(value),
127
+ };
128
+ }
59
129
  export function assertJiuchuanhuiPath(requestPath) {
60
130
  if (typeof requestPath !== 'string' || !requestPath.startsWith('/') || requestPath.startsWith('//')) {
61
131
  throw jiuchuanhuiValidationError('path_invalid', '请求路径必须是相对绝对路径');
@@ -135,7 +205,7 @@ export function createJiuchuanhuiHost(ctx, dependencies = {}) {
135
205
  if (response.status < 200 || response.status >= 300) {
136
206
  throw new JiuchuanhuiCliError('api', 'http_error', `泛微接口 HTTP ${response.status}`, {
137
207
  code: response.status,
138
- details: { status: response.status },
208
+ details: { status: response.status, response: boundedResponse(response.value) },
139
209
  exitCode: 1,
140
210
  });
141
211
  }
@@ -144,14 +214,16 @@ export function createJiuchuanhuiHost(ctx, dependencies = {}) {
144
214
  if (response.status < 200 || response.status >= 300) {
145
215
  throw new JiuchuanhuiCliError('api', 'http_error', `泛微接口 HTTP ${response.status}`, {
146
216
  code: response.status,
147
- details: { status: response.status, message: jiuchuanhuiBusinessMessage(response.value) },
217
+ details: { status: response.status, message: jiuchuanhuiBusinessMessage(response.value), response: boundedResponse(response.value) },
148
218
  exitCode: 1,
149
219
  });
150
220
  }
151
221
  if (!isJiuchuanhuiSuccess(response.value)) {
152
- throw new JiuchuanhuiCliError('api', 'business_error', jiuchuanhuiBusinessMessage(response.value), {
222
+ const message = jiuchuanhuiBusinessMessage(response.value);
223
+ throw new JiuchuanhuiCliError('api', 'business_error', message, {
153
224
  code: businessCode(response.value),
154
- details: { code: businessCode(response.value), message: jiuchuanhuiBusinessMessage(response.value) },
225
+ // message 一律原样(服务端 resultMsg),细节另开字段补充,不改写既有文案。
226
+ details: failureDetails(response.value, businessCode(response.value), message),
155
227
  exitCode: 1,
156
228
  });
157
229
  }
@@ -59,6 +59,107 @@ function writePair(baseName, title, props, required = [], fixed = {}, withPrepar
59
59
  });
60
60
  return list;
61
61
  }
62
+ /**
63
+ * 每条 operation 的一句话用途,写入 schema 的 summary。
64
+ *
65
+ * 口径:只描述「做什么 + 关键入参 + 是否写库」,不写未在实现里体现的业务承诺;
66
+ * prepare/apply 成对出现时,prepare 标注「只出预览,不写入」,apply 标注「落库前需确认」。
67
+ */
68
+ const OPERATION_SUMMARIES = {
69
+ 'jiuchuanhui.cache.init': '初始化九氚汇本地缓存(写本地缓存文件,不调业务接口);入参 dryRun/verbose',
70
+ 'jiuchuanhui.app.discovery': '按标签取九氚汇相关 eBuilder 应用 ID 列表',
71
+ 'jiuchuanhui.form.discovery': '按标签与应用取表单(对象)定义,用于定位客户/商机等主表',
72
+ 'jiuchuanhui.field.options': '取表单某字段的选项字典(id↔name);入参 fieldName/objId/groupId',
73
+ 'jiuchuanhui.rest.cfg.detail': '按 apid + id 取 REST 配置详情(动作流配置解析结果)',
74
+ 'jiuchuanhui.config.id.by.pk': '按主表与数据主键反查配置 ID(经动作流)',
75
+ 'jiuchuanhui.file.preview': '取附件预览地址;入参 fileId/fieldId/appId',
76
+ 'jiuchuanhui.customer.create.prepare': '准备新建客户(只出预览,不写入);入参 mainTable 与客户字段',
77
+ 'jiuchuanhui.customer.create.apply': '提交新建客户(落库前需确认);需 continuation + confirm',
78
+ 'jiuchuanhui.customer.get': '按 id 取客户详情',
79
+ 'jiuchuanhui.customer.search': '分页查询客户列表(支持条件过滤)',
80
+ 'jiuchuanhui.customer.type.search': '分页查询客户类型字典',
81
+ 'jiuchuanhui.customer.status.search': '分页查询客户状态字典',
82
+ 'jiuchuanhui.customer.industry.search': '分页查询客户行业字典',
83
+ 'jiuchuanhui.customer.open-sea.search': '分页查询公海客户列表',
84
+ 'jiuchuanhui.customer.update.prepare': '准备修改客户(只出预览,不写入);入参 mainTable 与待改字段',
85
+ 'jiuchuanhui.customer.update.apply': '提交修改客户(落库前需确认);需 continuation + confirm',
86
+ 'jiuchuanhui.customer.transfer.prepare': '准备转移客户负责人(只出预览,不写入);入参 mainTable 与目标负责人',
87
+ 'jiuchuanhui.customer.transfer.apply': '提交转移客户负责人(落库前需确认);需 continuation + confirm',
88
+ 'jiuchuanhui.customer.open-sea.release.prepare': '准备把客户释放到公海(只出预览,不写入)',
89
+ 'jiuchuanhui.customer.open-sea.release.apply': '提交把客户释放到公海(落库前需确认);需 continuation + confirm',
90
+ 'jiuchuanhui.customer.open-sea.claim.prepare': '准备从公海领取客户(只出预览,不写入)',
91
+ 'jiuchuanhui.customer.open-sea.claim.apply': '提交从公海领取客户(落库前需确认);需 continuation + confirm',
92
+ 'jiuchuanhui.customer.duplicate.check': '客户查重:按名称/关键信息找出疑似重复客户(经动作流)',
93
+ 'jiuchuanhui.customer.contact-record.create.prepare': '准备新增客户联系记录(只出预览,不写入)',
94
+ 'jiuchuanhui.customer.contact-record.create.apply': '提交新增客户联系记录(落库前需确认);需 continuation + confirm',
95
+ 'jiuchuanhui.customer.contact-record.batch.prepare': '准备批量新增客户联系记录(只出预览,不写入)',
96
+ 'jiuchuanhui.customer.contact-record.batch.apply': '提交批量新增客户联系记录(落库前需确认);需 continuation + confirm',
97
+ 'jiuchuanhui.contact.create.prepare': '准备新建联系人(只出预览,不写入);入参 mainTable 与联系人字段',
98
+ 'jiuchuanhui.contact.create.apply': '提交新建联系人(落库前需确认);需 continuation + confirm',
99
+ 'jiuchuanhui.contact.get': '按 id 取联系人详情',
100
+ 'jiuchuanhui.contact.update.prepare': '准备修改联系人(只出预览,不写入)',
101
+ 'jiuchuanhui.contact.update.apply': '提交修改联系人(落库前需确认);需 continuation + confirm',
102
+ 'jiuchuanhui.contact.by-entity.search': '按客户或商机查询关联的联系人列表;入参 customerId/saleChanceId',
103
+ 'jiuchuanhui.sale.create.prepare': '准备新建商机(只出预览,不写入);入参 mainTable 与商机字段',
104
+ 'jiuchuanhui.sale.create.apply': '提交新建商机(落库前需确认);需 continuation + confirm',
105
+ 'jiuchuanhui.sale.get': '按 id 取商机详情',
106
+ 'jiuchuanhui.sale.search': '分页查询商机列表(支持条件过滤)',
107
+ 'jiuchuanhui.sale.update.prepare': '准备修改商机(只出预览,不写入)',
108
+ 'jiuchuanhui.sale.update.apply': '提交修改商机(落库前需确认);需 continuation + confirm',
109
+ 'jiuchuanhui.sale.stage.search': '分页查询销售阶段字典',
110
+ 'jiuchuanhui.sale.process.search': '分页查询商机的流程/阶段推进记录',
111
+ 'jiuchuanhui.sale.lose-reason.search': '分页查询丢单原因字典',
112
+ 'jiuchuanhui.rival.search': '分页查询竞争对手列表',
113
+ 'jiuchuanhui.sale.win.prepare': '准备标记商机赢单(只出预览,不写入)',
114
+ 'jiuchuanhui.sale.win.apply': '提交标记商机赢单(落库前需确认);需 continuation + confirm',
115
+ 'jiuchuanhui.sale.lose.prepare': '准备标记商机输单(只出预览,不写入)',
116
+ 'jiuchuanhui.sale.lose.apply': '提交标记商机输单(落库前需确认);需 continuation + confirm',
117
+ 'jiuchuanhui.sale.invalid.prepare': '准备作废商机(只出预览,不写入)',
118
+ 'jiuchuanhui.sale.invalid.apply': '提交作废商机(落库前需确认);需 continuation + confirm',
119
+ 'jiuchuanhui.sale.pause.prepare': '准备暂停商机(只出预览,不写入)',
120
+ 'jiuchuanhui.sale.pause.apply': '提交暂停商机(落库前需确认);需 continuation + confirm',
121
+ 'jiuchuanhui.sale.restart.prepare': '准备重启商机(只出预览,不写入)',
122
+ 'jiuchuanhui.sale.restart.apply': '提交重启商机(落库前需确认);需 continuation + confirm',
123
+ 'jiuchuanhui.sale.manager-change.prepare': '准备变更商机负责人(只出预览,不写入)',
124
+ 'jiuchuanhui.sale.manager-change.apply': '提交变更商机负责人(落库前需确认);需 continuation + confirm',
125
+ 'jiuchuanhui.sale.link-contacts.prepare': '准备给商机关联联系人(只出预览,不写入)',
126
+ 'jiuchuanhui.sale.link-contacts.apply': '提交给商机关联联系人(落库前需确认);需 continuation + confirm',
127
+ 'jiuchuanhui.sale.contact-record.create.prepare': '准备新增商机联系记录(只出预览,不写入)',
128
+ 'jiuchuanhui.sale.contact-record.create.apply': '提交新增商机联系记录(落库前需确认);需 continuation + confirm',
129
+ 'jiuchuanhui.clue.create.prepare': '准备新建线索(只出预览,不写入);入参 mainTable 与线索字段',
130
+ 'jiuchuanhui.clue.create.apply': '提交新建线索(落库前需确认);需 continuation + confirm',
131
+ 'jiuchuanhui.clue.get': '按 id 取线索详情',
132
+ 'jiuchuanhui.clue.search': '分页查询线索列表(支持条件过滤)',
133
+ 'jiuchuanhui.clue.pool.search': '分页查询线索池列表',
134
+ 'jiuchuanhui.clue.update.prepare': '准备修改线索(只出预览,不写入)',
135
+ 'jiuchuanhui.clue.update.apply': '提交修改线索(落库前需确认);需 continuation + confirm',
136
+ 'jiuchuanhui.clue.status-change.prepare': '准备变更线索状态(只出预览,不写入)',
137
+ 'jiuchuanhui.clue.status-change.apply': '提交变更线索状态(落库前需确认);需 continuation + confirm',
138
+ 'jiuchuanhui.clue.to-customer.prepare': '准备把线索转为客户(只出预览,不写入)',
139
+ 'jiuchuanhui.clue.to-customer.apply': '提交把线索转为客户(落库前需确认);需 continuation + confirm',
140
+ 'jiuchuanhui.clue.contact-record.create.prepare': '准备新增线索联系记录(只出预览,不写入)',
141
+ 'jiuchuanhui.clue.contact-record.create.apply': '提交新增线索联系记录(落库前需确认);需 continuation + confirm',
142
+ 'jiuchuanhui.contact-plan.create.prepare': '准备新建联系计划(只出预览,不写入)',
143
+ 'jiuchuanhui.contact-plan.create.apply': '提交新建联系计划(落库前需确认);需 continuation + confirm',
144
+ 'jiuchuanhui.contact-plan.complete.prepare': '准备把联系计划标记完成(只出预览,不写入)',
145
+ 'jiuchuanhui.contact-plan.complete.apply': '提交把联系计划标记完成(落库前需确认);需 continuation + confirm',
146
+ 'jiuchuanhui.entity.contact-records.list': '查某个实体(客户/商机/线索)名下的联系记录;入参 mainTable 与实体主键',
147
+ 'jiuchuanhui.contact-records.by-person-time.list': '按人员与时间范围查联系记录',
148
+ 'jiuchuanhui.entity.id.by-name': '按名称解析实体 ID(重名时会给出候选)',
149
+ 'jiuchuanhui.user.id.by-name': '按姓名解析用户 ID(重名时会给出候选)',
150
+ 'jiuchuanhui.user.current-profile': '取当前登录人的画像信息(部门/岗位/上级)',
151
+ 'jiuchuanhui.entity.permission.judge': '判定当前用户对某实体(客户/商机/线索)的操作权限',
152
+ 'jiuchuanhui.company.business-profile.query': '查客户的工商画像信息',
153
+ 'jiuchuanhui.field.info.by-ids': '按 ID 批量取字段信息(名称/类型)',
154
+ 'jiuchuanhui.browser-option.search': '通用浏览按钮检索:按自定义浏览按钮类型取候选(路径参数 pathParams)',
155
+ 'jiuchuanhui.get-rest-cfg-detail': '按 apid + id 取 REST 配置详情(与 rest.cfg.detail 同类,路径不同)',
156
+ };
157
+ function withSummaries(operations) {
158
+ return operations.map((item) => ({
159
+ ...item,
160
+ summary: item.summary || OPERATION_SUMMARIES[item.name] || '',
161
+ }));
162
+ }
62
163
  export const jiuchuanhuiOperations = [
63
164
  // ==================== 发现与配置 ====================
64
165
  {
@@ -81,7 +182,10 @@ export const jiuchuanhuiOperations = [
81
182
  inputSchema: {
82
183
  type: 'object',
83
184
  additionalProperties: false,
84
- properties: { tag: { type: 'string', default: 'jch-crm-project' } },
185
+ properties: {
186
+ tag: { type: 'string', description: '应用标签;必填,常用 jch-crm-project(不会自动注入默认值)' },
187
+ },
188
+ required: ['tag'],
85
189
  },
86
190
  },
87
191
  {
@@ -456,7 +560,7 @@ export const jiuchuanhuiManifest = {
456
560
  host: 'e10-jiuchuanhui',
457
561
  status: 'builtin',
458
562
  sourceSkill: 'weaver-e10-jiuchuanhui',
459
- operations: jiuchuanhuiOperations,
563
+ operations: withSummaries(jiuchuanhuiOperations),
460
564
  withheldOperations: [
461
565
  {
462
566
  name: 'jiuchuanhui.sale.stage-advance',
@@ -269,10 +269,13 @@ const attachmentList = {
269
269
  summary: '查询会议/议题的附件清单(返回 fileId):会议附件 mt_accessorys、项目文件 project_files、议题资料 related_materials;直接读 EB 详情原始值,不经摘要层',
270
270
  capability: 'attachment',
271
271
  risk: 'read',
272
- inputSchema: schemaOf({
273
- mtId: { ...SCHEMA_ID, description: '会议 id(查会议附件时必填,与 topicId 二选一)' },
274
- topicId: { ...SCHEMA_ID, description: '议题 id(查议题资料时用)' },
275
- }, { required: [] }),
272
+ inputSchema: {
273
+ ...schemaOf({
274
+ mtId: { ...SCHEMA_ID, description: '会议 id(查会议附件时必填,与 topicId 二选一)' },
275
+ topicId: { ...SCHEMA_ID, description: '议题 id(查议题资料时用)' },
276
+ }, { required: [] }),
277
+ anyOf: [{ required: ['mtId'] }, { required: ['topicId'] }],
278
+ },
276
279
  handler: async (args, env) => {
277
280
  const mtId = String(args.mtId ?? '').trim();
278
281
  const topicId = String(args.topicId ?? '').trim();
@@ -306,12 +309,15 @@ const attachmentDownload = {
306
309
  summary: '按 fileId 下载附件到本地(默认 ~/.weaver-work-cli/meeting/attachments/);也可传 mtId 一次下载该会议全部附件',
307
310
  capability: 'attachment',
308
311
  risk: 'read',
309
- inputSchema: schemaOf({
310
- fileId: { ...SCHEMA_ID, description: '文件 id(与 mtId 二选一)' },
311
- mtId: { ...SCHEMA_ID, description: '会议 id:一次下载该会议全部附件与项目文件' },
312
- outDir: { type: 'string', description: '落地目录(默认 <state>/meeting/attachments)' },
313
- fileName: { type: 'string', description: '指定文件名(仅单文件时生效)' },
314
- }, { required: [] }),
312
+ inputSchema: {
313
+ ...schemaOf({
314
+ fileId: { ...SCHEMA_ID, description: '文件 id(与 mtId 二选一)' },
315
+ mtId: { ...SCHEMA_ID, description: '会议 id:一次下载该会议全部附件与项目文件' },
316
+ outDir: { type: 'string', description: '落地目录(默认 <state>/meeting/attachments)' },
317
+ fileName: { type: 'string', description: '指定文件名(仅单文件时生效)' },
318
+ }, { required: [] }),
319
+ anyOf: [{ required: ['fileId'] }, { required: ['mtId'] }],
320
+ },
315
321
  handler: async (args, env) => {
316
322
  const fileId = String(args.fileId ?? '').trim();
317
323
  const mtId = String(args.mtId ?? '').trim();
@@ -353,12 +359,15 @@ const attachmentExtract = {
353
359
  summary: '下载附件并抽取纯文本(txt/md/csv/json/docx/xlsx/pptx),返回正文与 txt 落地路径;pdf/图片等不支持格式会明确标注,不编造内容',
354
360
  capability: 'attachment',
355
361
  risk: 'read',
356
- inputSchema: schemaOf({
357
- fileId: { ...SCHEMA_ID, description: '文件 id(与 mtId 二选一)' },
358
- mtId: { ...SCHEMA_ID, description: '会议 id:抽取该会议全部附件(最多 10 个)' },
359
- maxChars: { type: 'number', description: '每个文件返回正文的最大字符数(默认 4000,最多 20000)' },
360
- outDir: { type: 'string', description: '落地目录(默认 <state>/meeting/attachments)' },
361
- }, { required: [] }),
362
+ inputSchema: {
363
+ ...schemaOf({
364
+ fileId: { ...SCHEMA_ID, description: '文件 id(与 mtId 二选一)' },
365
+ mtId: { ...SCHEMA_ID, description: '会议 id:抽取该会议全部附件(最多 10 个)' },
366
+ maxChars: { type: 'number', description: '每个文件返回正文的最大字符数(默认 4000,最多 20000)' },
367
+ outDir: { type: 'string', description: '落地目录(默认 <state>/meeting/attachments)' },
368
+ }, { required: [] }),
369
+ anyOf: [{ required: ['fileId'] }, { required: ['mtId'] }],
370
+ },
362
371
  handler: async (args, env) => {
363
372
  const fileId = String(args.fileId ?? '').trim();
364
373
  const mtId = String(args.mtId ?? '').trim();
@@ -98,6 +98,7 @@ const meetingMemberExpand = {
98
98
  refresh: { type: 'boolean', description: '忽略缓存重新查(默认 false)' },
99
99
  maxDepartments: { type: 'number', description: `分部展开时最多取几个部门,默认 ${MAX_DEPARTMENTS}` },
100
100
  },
101
+ anyOf: [{ required: ['keyword'] }, { required: ['keywords'] }],
101
102
  },
102
103
  handler: async (args, env) => {
103
104
  const tokens = [
@@ -489,7 +489,7 @@ const meetingInvitationRender = {
489
489
  description: '输出文件完整路径(可选)。缺省写到 ~/.weaver-work-cli/meeting/invitations/邀请函-{会议名}-{日期}.docx',
490
490
  },
491
491
  },
492
- required: [],
492
+ anyOf: [{ required: ['mtId'] }, { required: ['mt_name', 'begin_datetime'] }],
493
493
  },
494
494
  handler: async (args, env) => {
495
495
  const mtId = String(args.mtId ?? '').trim();
@@ -18,23 +18,26 @@ const meetingLink = {
18
18
  summary: '生成对象详情页链接:EB 版 /sp/ebdfpage/card/0/{objid}/{dataid}(按 tag 解析 objid 并缓存);标准版会议 /sp/meeting/meetingSingle?meetingId=(会议室/会议类型无单页,不附链接)',
19
19
  capability: 'link',
20
20
  risk: 'read',
21
- inputSchema: schemaOf({
22
- dataId: { ...SCHEMA_ID, description: '对象 id:标准版=会议 id;EB 版=表单数据 id(单条查询用)' },
23
- dataIds: { ...SCHEMA_ID_LIST, description: '批量:一次为多条数据生成链接(列表输出用)' },
24
- type: {
25
- type: 'string',
26
- enum: [...EB_TYPES],
27
- description: '对象类别(默认 meeting)。映射 EB 表 tag,详见 references/meeting-eb.md 的链接章节',
28
- },
29
- tag: { type: 'string', description: '直接指定 EB 表 tag(如 uf_mt_detail),与 type 二选一,优先于 type' },
30
- mode: {
31
- type: 'string',
32
- enum: ['auto', 'eb', 'standard'],
33
- description: 'auto(默认)=按当前环境模式自动判定;也可显式指定',
34
- },
35
- name: { type: 'string', description: '链接显示名;传入后同时返回 markdown 内联链接' },
36
- refresh: { type: 'boolean', description: 'true=强制重新解析 EB objid(忽略缓存)' },
37
- }, { required: [] }),
21
+ inputSchema: {
22
+ ...schemaOf({
23
+ dataId: { ...SCHEMA_ID, description: '对象 id:标准版=会议 id;EB 版=表单数据 id(单条查询用)' },
24
+ dataIds: { ...SCHEMA_ID_LIST, description: '批量:一次为多条数据生成链接(列表输出用)' },
25
+ type: {
26
+ type: 'string',
27
+ enum: [...EB_TYPES],
28
+ description: '对象类别(默认 meeting)。映射 EB 表 tag,详见 references/meeting-eb.md 的链接章节',
29
+ },
30
+ tag: { type: 'string', description: '直接指定 EB 表 tag(如 uf_mt_detail),与 type 二选一,优先于 type' },
31
+ mode: {
32
+ type: 'string',
33
+ enum: ['auto', 'eb', 'standard'],
34
+ description: 'auto(默认)=按当前环境模式自动判定;也可显式指定',
35
+ },
36
+ name: { type: 'string', description: '链接显示名;传入后同时返回 markdown 内联链接' },
37
+ refresh: { type: 'boolean', description: 'true=强制重新解析 EB objid(忽略缓存)' },
38
+ }, { required: [] }),
39
+ anyOf: [{ required: ['dataId'] }, { required: ['dataIds'] }],
40
+ },
38
41
  handler: async (args, { host, ctx }) => {
39
42
  const single = args.dataId !== undefined && args.dataId !== null && String(args.dataId).trim() !== '';
40
43
  const batch = Array.isArray(args.dataIds)
@@ -150,7 +150,13 @@ const okrList = {
150
150
  match: { type: 'string', enum: ['and', 'or'], default: 'and', description: '多条件关系(仅标准版链路)' },
151
151
  page_no: { type: 'integer', minimum: 1, default: 1 },
152
152
  page_size: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
153
- }, { description: 'self 模式必填 period_type + period_range;all 模式按需传 name / principalid / status' }),
153
+ }, {
154
+ anyOf: [
155
+ { required: ['query_scope'], properties: { query_scope: { const: 'all' } } },
156
+ { required: ['period_type', 'period_range'] },
157
+ ],
158
+ description: 'self 模式必填 period_type + period_range;all 模式需显式传 query_scope=all,按需传 name / principalid / status',
159
+ }),
154
160
  handler: async (args, { host }) => {
155
161
  const { pageNo, pageSize } = pageOf(args);
156
162
  const queryScope = resolveQueryScope(args);
@@ -1,12 +1,15 @@
1
- import { getE10Session } from '../../internal/e10/context.js';
1
+ import { isStructuredError } from '../../core/errors.js';
2
+ import { getE10Session, requireE10Session } from '../../internal/e10/context.js';
3
+ import { E10_AUTH_REQUIRED_MESSAGE } from '../../internal/e10/auth/messages.js';
2
4
  import { E10ApiError, createE10RequestRuntime, } from '../../internal/e10/request-runtime.js';
3
5
  import { receptionBusinessError, receptionEnvironmentError } from './errors.js';
4
6
  import { UploadProtocolError, uploadToFileService } from './upload.js';
5
7
  import { fetchRestaurantRooms as fetchRooms } from './operations/restaurant-rooms.js';
6
8
  /** 单次上传的总时限。分片上传是多轮请求,留足 3 分钟。 */
7
9
  const UPLOAD_TIMEOUT_MS = 180_000;
8
- export function createReceptionHost(ctx) {
10
+ export function createReceptionHost(ctx, dependencies = {}) {
9
11
  let cached = null;
12
+ const requireSession = dependencies.requireSession || requireE10Session;
10
13
  async function resolve() {
11
14
  if (cached)
12
15
  return cached;
@@ -129,11 +132,22 @@ export function createReceptionHost(ctx) {
129
132
  /**
130
133
  * 查「小食堂包厢」。
131
134
  * eteamsId / tenantKey 只在这里取用并塞进请求体,不返回给调用方。
135
+ *
136
+ * 这条命令必须拿到真实会话,所以走 `requireSession` 而不是只读快照:
137
+ * 小e 下本地没有 auth 文件时,公共会话层会先静默换票再执行,不会再直接
138
+ * 报「未取得会话」。
132
139
  */
133
140
  async function fetchRestaurantRooms(options = {}) {
134
- const { e10 } = await resolve();
135
- if (!e10) {
136
- throw receptionEnvironmentError('NO_SESSION', '未取得 E10 会话,无法查询小食堂包厢');
141
+ let e10;
142
+ try {
143
+ e10 = await requireSession(ctx);
144
+ }
145
+ catch (error) {
146
+ // 小e 自动恢复失败时抛的是结构化认证错误(authentication/xiaoe_*),
147
+ // details.attemptedSteps 能说明试过哪些凭据通道,原样上抛让模型按现行口径处理。
148
+ if (isStructuredError(error))
149
+ throw error;
150
+ throw receptionEnvironmentError('NO_SESSION', E10_AUTH_REQUIRED_MESSAGE);
137
151
  }
138
152
  const runtime = createE10RequestRuntime(ctx, e10);
139
153
  return fetchRooms(runtime, {
@@ -68,6 +68,7 @@ export const receptionOperations = [
68
68
  snapshot: { type: 'string', description: '字段快照路径;同时用于推导技能包内 render.py 位置' },
69
69
  renderPy: { type: 'string', description: '显式指定 render.py 路径' },
70
70
  },
71
+ anyOf: [{ required: ['runId'] }, { required: ['known'] }],
71
72
  },
72
73
  outputSchema: {
73
74
  type: 'object',
@@ -153,6 +154,7 @@ export const receptionOperations = [
153
154
  description: '填单页打开形态:drawer 为右侧抽屉(默认)',
154
155
  },
155
156
  },
157
+ anyOf: [{ required: ['runId'] }, { required: ['known'] }],
156
158
  },
157
159
  outputSchema: {
158
160
  type: 'object',
@@ -1033,7 +1033,10 @@ export const interviewArrangeOperations = [
1033
1033
  summary: '预填模式(人工保存):输出人才卡片 URL + 面试管理列表 URL + 选面试方式的 jsExpr,触发表单联动后由 HR 核对保存,不落库',
1034
1034
  capability: 'recruit.interview.arrange',
1035
1035
  risk: 'read',
1036
- inputSchema: schemaOf(baseInput, {}),
1036
+ inputSchema: {
1037
+ ...schemaOf(baseInput, {}),
1038
+ anyOf: [{ required: ['talentId'] }, { required: ['mobile'] }, { required: ['name'] }],
1039
+ },
1037
1040
  handler: prefill,
1038
1041
  },
1039
1042
  {
@@ -323,16 +323,19 @@ const formStructure = {
323
323
  name: 'smart-extract.form.structure',
324
324
  risk: 'read',
325
325
  summary: '取表单结构并归一化:传 workflowId(+nodeId,缺省自动取发起节点) 走流程节点字段,传 formId 走 EB 表单。输出 mainFieldsStr/subFieldsStr 压缩串,可直接进提示词。',
326
- inputSchema: schemaOf({
327
- workflowId: { ...SCHEMA_ID, description: '流程模板 ID(wf)' },
328
- nodeId: { ...SCHEMA_ID, description: '流程节点 ID;不传时自动取发起节点' },
329
- formId: { ...SCHEMA_ID, description: 'EB 表单 ID(与 workflowId 二选一)' },
330
- targetFieldIdList: {
331
- type: 'array',
332
- items: { type: 'string' },
333
- description: '只输出这些字段 ID(可选)',
334
- },
335
- }),
326
+ inputSchema: {
327
+ ...schemaOf({
328
+ workflowId: { ...SCHEMA_ID, description: '流程模板 ID(wf)' },
329
+ nodeId: { ...SCHEMA_ID, description: '流程节点 ID;不传时自动取发起节点' },
330
+ formId: { ...SCHEMA_ID, description: 'EB 表单 ID(与 workflowId 二选一)' },
331
+ targetFieldIdList: {
332
+ type: 'array',
333
+ items: { type: 'string' },
334
+ description: '只输出这些字段 ID(可选)',
335
+ },
336
+ }),
337
+ anyOf: [{ required: ['workflowId'] }, { required: ['formId'] }],
338
+ },
336
339
  handler: async (args, env) => {
337
340
  const workflowId = optionalId(args.workflowId, 'workflowId');
338
341
  const formId = optionalId(args.formId, 'formId');