weaver-work-cli 0.1.75 → 0.1.78

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 (268) hide show
  1. package/README.md +3 -1
  2. package/dist/chunks/{archive-OZJ6PYUR.js → archive-ENBSUMHV.js} +1 -1
  3. package/dist/chunks/{archive-oa-BHL5RK2F.js → archive-oa-7BFPQ6M5.js} +1 -1
  4. package/dist/chunks/{asset-HKRFRQR2.js → asset-V5SUD3PW.js} +1 -1
  5. package/dist/chunks/{asset-idle-GGIR4KE7.js → asset-idle-3CEL7WFX.js} +1 -1
  6. package/dist/chunks/{attachment-content-4OV65NK5.js → attachment-content-TFOC3Y3X.js} +3 -3
  7. package/dist/chunks/{blog-HYDP4DV3.js → blog-FLI4SS3P.js} +1 -1
  8. package/dist/chunks/{caizhilian-JS4RQZ6Z.js → caizhilian-7WCTKCCP.js} +3 -3
  9. package/dist/chunks/{calendar-SWRY4DIT.js → calendar-G726HUUH.js} +1 -1
  10. package/dist/chunks/{chunk-5ZJGPEIB.js → chunk-2KW7AI6P.js} +1 -1
  11. package/dist/chunks/{chunk-JOY3HZXL.js → chunk-2UV4IZIT.js} +21 -15
  12. package/dist/chunks/{chunk-FEZK536Z.js → chunk-4PBN7NJY.js} +353 -43
  13. package/dist/chunks/{chunk-VOMDD2C5.js → chunk-5E2FDXBU.js} +1 -1
  14. package/dist/chunks/{chunk-ZUB4M4N3.js → chunk-5VQ7JHV4.js} +134 -49
  15. package/dist/chunks/{chunk-I6NOHKEK.js → chunk-7SQN5IZR.js} +1 -1
  16. package/dist/chunks/{chunk-4FCBEWNB.js → chunk-BP7BONZO.js} +675 -86
  17. package/dist/chunks/{chunk-U6Y32KEV.js → chunk-BWFCTE43.js} +1 -1
  18. package/dist/chunks/{chunk-PG5YSNYY.js → chunk-DACQKJ6O.js} +3 -3
  19. package/dist/chunks/{chunk-KWJEICD4.js → chunk-E2EY3DMS.js} +2 -2
  20. package/dist/chunks/{chunk-KEA4XQPO.js → chunk-FAC4IFGQ.js} +4 -4
  21. package/dist/chunks/{chunk-MXCRKXOP.js → chunk-FPWCCRKT.js} +1 -1
  22. package/dist/chunks/{minute-doc-OQUMDTKG.js → chunk-IBTGXLOT.js} +101 -18
  23. package/dist/chunks/{chunk-OJ4JPD25.js → chunk-LQLIXBJF.js} +6 -8
  24. package/dist/chunks/{chunk-BNKUHN4N.js → chunk-OVTCWLNQ.js} +2 -2
  25. package/dist/chunks/{chunk-5D2V7ZAN.js → chunk-PMRNIGKZ.js} +1 -1
  26. package/dist/chunks/{chunk-OQCK5SAU.js → chunk-RVEKGVZU.js} +1 -1
  27. package/dist/chunks/{chunk-2AUFKU2D.js → chunk-SWFTWNWL.js} +11 -11
  28. package/dist/chunks/{chunk-TA2RBUTH.js → chunk-TBCKK6LH.js} +1 -1
  29. package/dist/chunks/{chunk-SU6IJD6D.js → chunk-TD5IOEGN.js} +1 -1
  30. package/dist/chunks/{chunk-J7FAAHWH.js → chunk-UDBQJLQF.js} +1 -1
  31. package/dist/chunks/{chunk-BSR5TM7U.js → chunk-USYFVIUR.js} +22 -7
  32. package/dist/chunks/{chunk-ERZY6GYL.js → chunk-UZ2E3VNI.js} +1 -1
  33. package/dist/chunks/{chunk-NWYHCZTY.js → chunk-VNEU7OUN.js} +1 -1
  34. package/dist/chunks/{chunk-5QUTQHXF.js → chunk-WNFDR5PC.js} +198 -80
  35. package/dist/chunks/{chunk-LJI4N6FV.js → chunk-XNN5PZTI.js} +1 -1
  36. package/dist/chunks/{chunk-QJWVYOOV.js → chunk-Z44YFIN6.js} +2 -2
  37. package/dist/chunks/{chunk-ZWIMLT6P.js → chunk-ZOTXXGUM.js} +7 -7
  38. package/dist/chunks/{cli-FULPXIKJ.js → cli-WA7FOQKC.js} +35 -35
  39. package/dist/chunks/{commands-BNWFNTD3.js → commands-J52MJ6NF.js} +3 -3
  40. package/dist/chunks/{conflict-5BKCDV2F.js → conflict-D4GVAURN.js} +2 -2
  41. package/dist/chunks/{contract-WI23OXVC.js → contract-GW7US3UF.js} +4400 -3548
  42. package/dist/chunks/{cowork-DZBBVNMQ.js → cowork-GZDODGKF.js} +1 -1
  43. package/dist/chunks/{create-flow-7ZRBRKX7.js → create-flow-ERDGW3FZ.js} +10 -6
  44. package/dist/chunks/{data-PAZVE6QE.js → data-HTQZRPPI.js} +1 -1
  45. package/dist/chunks/{ebuilder-form-5SQXIGXN.js → ebuilder-form-GHNIZ7ET.js} +2 -2
  46. package/dist/chunks/{ehr-CX5F4ZAU.js → ehr-P6T7OAAV.js} +2 -2
  47. package/dist/chunks/{entry-mode-I2BYNONZ.js → entry-mode-SQU5WTX6.js} +3 -3
  48. package/dist/chunks/{env-ZAQZ7EHN.js → env-DASBNSEM.js} +2 -2
  49. package/dist/chunks/{esb-DQTXDIBF.js → esb-ATRKVHCD.js} +3 -3
  50. package/dist/chunks/{factory-XRI6KZ7H.js → factory-A3NAKZAA.js} +1 -1
  51. package/dist/chunks/{fna-FK6HQVJL.js → fna-IKYI3SST.js} +1 -1
  52. package/dist/chunks/{group-chat-MLWNYM2P.js → group-chat-7SEAVAJR.js} +3 -3
  53. package/dist/chunks/{host-MEC4VQZA.js → host-6UOXYOOY.js} +2 -2
  54. package/dist/chunks/{host-KUMU3DDK.js → host-EJSJSLVK.js} +2 -2
  55. package/dist/chunks/{host-3EPREGXS.js → host-EYNLB6S4.js} +2 -2
  56. package/dist/chunks/{host-T6NNQGVZ.js → host-OT4KNR3G.js} +2 -2
  57. package/dist/chunks/{host-VI7Q45PM.js → host-UY4LQPN4.js} +2 -2
  58. package/dist/chunks/{host-J74JGYAW.js → host-XXGDQM7D.js} +2 -2
  59. package/dist/chunks/{hrm-KKVAW4P5.js → hrm-5JQ7QZ6A.js} +2 -2
  60. package/dist/chunks/{im-47CIWQNL.js → im-2YJW3EI5.js} +2 -2
  61. package/dist/chunks/{invoice-CDYRBNIG.js → invoice-37HR6L3W.js} +937 -552
  62. package/dist/chunks/{jiuchuanhui-M7QTRHZK.js → jiuchuanhui-KBWUZ7WT.js} +1 -1
  63. package/dist/chunks/{lazy-dispatch-FKQJZFI5.js → lazy-dispatch-ZDKLS5MR.js} +6 -6
  64. package/dist/chunks/{mail-NRBS5N6Y.js → mail-YBKUM6HM.js} +1 -1
  65. package/dist/chunks/{meeting-WC5LD3IO.js → meeting-7AEQGBAT.js} +19 -13
  66. package/dist/chunks/minute-doc-REI6RUE4.js +20 -0
  67. package/dist/chunks/{okr-EHKSKMPL.js → okr-HW7IULIR.js} +1 -1
  68. package/dist/chunks/{operations-V5VM5MS2.js → operations-4P2UYVLH.js} +3 -3
  69. package/dist/chunks/{performance-ZJADXJPN.js → performance-PM2G6L3E.js} +1 -1
  70. package/dist/chunks/{plan-OTDNBDJ7.js → plan-3YYGZ7ZM.js} +1 -1
  71. package/dist/chunks/{project-4XVBQ3HX.js → project-6PRGBLO2.js} +39 -15
  72. package/dist/chunks/{reception-3FAHOOH7.js → reception-7G3J2MA6.js} +1 -1
  73. package/dist/chunks/{recruit-stage-3WTVWW2K.js → recruit-stage-TLZJUFHD.js} +544 -464
  74. package/dist/chunks/{registry-TJGCVRCW.js → registry-3VTB3KLV.js} +3 -3
  75. package/dist/chunks/{registry-F4YFZLOD.js → registry-KQ4TNUWO.js} +1 -1
  76. package/dist/chunks/{registry-NBTBXR4L.js → registry-UVTI323K.js} +12 -11
  77. package/dist/chunks/{room-recommend-KL62XB2Y.js → room-recommend-ELEJUYBN.js} +4 -4
  78. package/dist/chunks/{schedule-XOISYUPB.js → schedule-XBKY7VEA.js} +4 -4
  79. package/dist/chunks/{smart-extract-UYGNV3BM.js → smart-extract-T5Z4AULN.js} +1 -1
  80. package/dist/chunks/{update-AV5VOXGY.js → update-77ZUIYSG.js} +2 -2
  81. package/dist/chunks/{workflow-V54LJPXL.js → workflow-SYCBS5XD.js} +3 -3
  82. package/dist/index.js +3 -3
  83. package/dist/internal/update/service.js +9 -8
  84. package/dist/shortcuts/contract/data/collection-ledger-html.js +109 -33
  85. package/dist/shortcuts/contract/data/collection-node-catalog.js +26 -2
  86. package/dist/shortcuts/contract/data/report-renderers.js +75 -31
  87. package/dist/shortcuts/contract/data/report-spec.js +17 -3
  88. package/dist/shortcuts/contract/manifest.js +20 -3
  89. package/dist/shortcuts/contract/operations/bizreview-report.js +23 -2
  90. package/dist/shortcuts/contract/operations/collection-node.js +116 -1
  91. package/dist/shortcuts/contract/operations/compare-report.js +27 -5
  92. package/dist/shortcuts/contract/operations/credit-page.js +11 -2
  93. package/dist/shortcuts/contract/operations/docx-slots.js +27 -2
  94. package/dist/shortcuts/contract/operations/draft-submit.js +9 -6
  95. package/dist/shortcuts/contract/operations/elements-build.js +162 -30
  96. package/dist/shortcuts/contract/operations/elements-spec.js +50 -0
  97. package/dist/shortcuts/contract/operations/generated-submit.js +35 -0
  98. package/dist/shortcuts/contract/operations/ledger-card.js +32 -2
  99. package/dist/shortcuts/contract/operations/ledger-stat.js +17 -5
  100. package/dist/shortcuts/contract/operations/ledger.js +88 -16
  101. package/dist/shortcuts/contract/operations/metrics.js +16 -3
  102. package/dist/shortcuts/contract/operations/ops-draft.js +359 -27
  103. package/dist/shortcuts/contract/operations/page.js +23 -0
  104. package/dist/shortcuts/contract/operations/quote-recognize.js +91 -13
  105. package/dist/shortcuts/contract/operations/quote-submit.js +16 -0
  106. package/dist/shortcuts/contract/operations/review-report.js +11 -3
  107. package/dist/shortcuts/contract/operations/save-recognize.js +62 -1
  108. package/dist/shortcuts/contract/operations/triage.js +18 -3
  109. package/dist/shortcuts/contract/operations/viewlink.js +17 -1
  110. package/dist/shortcuts/ehr/operations/recruit.js +255 -90
  111. package/dist/shortcuts/invoice/business-response.js +13 -0
  112. package/dist/shortcuts/invoice/calendar.js +24 -0
  113. package/dist/shortcuts/invoice/host.js +26 -15
  114. package/dist/shortcuts/invoice/index.js +2 -2
  115. package/dist/shortcuts/invoice/invoice-record.js +7 -2
  116. package/dist/shortcuts/invoice/manifest.js +179 -155
  117. package/dist/shortcuts/invoice/operations/get.js +9 -3
  118. package/dist/shortcuts/invoice/operations/issuing-red-requests.js +138 -0
  119. package/dist/shortcuts/invoice/operations/registry.js +4 -5
  120. package/dist/shortcuts/invoice/operations/reim-auto.js +40 -2
  121. package/dist/shortcuts/invoice/operations/reim-customer-projects.js +79 -0
  122. package/dist/shortcuts/invoice/operations/reim-customer.js +79 -30
  123. package/dist/shortcuts/invoice/operations/reim-relation.js +0 -146
  124. package/dist/shortcuts/invoice/operations/reim.js +2 -126
  125. package/dist/shortcuts/invoice/operations/shared.js +15 -17
  126. package/dist/shortcuts/invoice/preapproval-enrichment.js +180 -0
  127. package/dist/shortcuts/invoice/projection.js +14 -0
  128. package/dist/shortcuts/invoice/read-enrichment.js +123 -0
  129. package/dist/shortcuts/meeting/confirm-gate.js +42 -0
  130. package/dist/shortcuts/meeting/continuation.js +6 -2
  131. package/dist/shortcuts/meeting/minute-doc.js +119 -12
  132. package/dist/shortcuts/meeting/operations/attachment.js +19 -0
  133. package/dist/shortcuts/meeting/operations/compose-outcome.js +24 -2
  134. package/dist/shortcuts/meeting/operations/eb/conflict.js +2 -1
  135. package/dist/shortcuts/meeting/operations/eb/create-flow.js +162 -19
  136. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +22 -3
  137. package/dist/shortcuts/meeting/operations/group-share.js +268 -0
  138. package/dist/shortcuts/meeting/operations/minute-content.js +58 -1
  139. package/dist/shortcuts/meeting/operations/minute-export.js +295 -0
  140. package/dist/shortcuts/meeting/operations/registry.js +4 -0
  141. package/dist/shortcuts/project/operations/read.js +40 -15
  142. package/dist/shortcuts/recruit-stage/context.js +16 -81
  143. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +89 -53
  144. package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +15 -5
  145. package/dist/shortcuts/recruit-stage/operations/jd-create.js +46 -108
  146. package/dist/shortcuts/recruit-stage/operations/list.js +203 -74
  147. package/dist/shortcuts/recruit-stage/operations/resume-import.js +21 -85
  148. package/dist/shortcuts/recruit-stage/operations/search.js +113 -53
  149. package/dist/shortcuts/recruit-stage/shared.js +153 -4
  150. package/dist/shortcuts/workflow/endpoints.js +2 -0
  151. package/dist/shortcuts/workflow/operations/form.js +11 -0
  152. package/dist/shortcuts/workflow/operations/read.js +24 -5
  153. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +2 -2
  154. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +2 -0
  155. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +28 -4
  156. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.node.js +198 -0
  157. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +4 -2
  158. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.subordinate.js +70 -0
  159. package/dist/shortcuts/workflow/operations/todoSmartConvert/workflowClarification.js +15 -5
  160. package/docs/agent-invoice.md +28 -2
  161. package/docs/invoice.md +60 -9
  162. package/docs/project.md +1 -1
  163. package/package.json +1 -1
  164. package/skill-template/domains/yepiaotong.md +36 -7
  165. package/skills/weaver-e10-jinchengda/SKILL.md +64 -28
  166. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +4 -4
  167. package/skills/weaver-e10-jinchengda/references/contract-bizreview-report-template.html +1 -1
  168. package/skills/weaver-e10-jinchengda/references/contract-bizreview.md +5 -4
  169. package/skills/weaver-e10-jinchengda/references/contract-collection-node.md +26 -2
  170. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +4 -4
  171. package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +9 -8
  172. package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +47 -52
  173. package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +1 -1
  174. package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +5 -5
  175. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +1 -1
  176. package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +7 -1
  177. package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +21 -12
  178. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +44 -1
  179. package/skills/weaver-e10-jinchengda/references/contract-firstscreen-guide.md +5 -4
  180. package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +8 -0
  181. package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +33 -3
  182. package/skills/weaver-e10-jinchengda/references/contract-ledger-report.md +1 -1
  183. package/skills/weaver-e10-jinchengda/references/contract-material-gap.md +17 -3
  184. package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +12 -12
  185. package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +18 -10
  186. package/skills/weaver-e10-jinchengda/references/contract-ops-draft.md +77 -37
  187. package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +7 -0
  188. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +55 -12
  189. package/skills/weaver-e10-jinchengda/references/contract-review-todo.md +102 -0
  190. package/skills/weaver-e10-jinchengda/references/contract-sign-launch.md +1 -17
  191. package/skills/weaver-e10-jinchengda/references/contract-smart-draft.md +11 -8
  192. package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +2 -1
  193. package/skills/weaver-e10-jinchengda/references/orchestration.md +6 -6
  194. package/skills/weaver-e10-meeting/SKILL.md +203 -80
  195. package/skills/weaver-e10-meeting/references/create-quickstart.md +98 -0
  196. package/skills/weaver-e10-meeting/references/delivery-checklist.md +34 -0
  197. package/skills/weaver-e10-meeting/references/error-codes.md +44 -0
  198. package/skills/weaver-e10-meeting/references/minutes-pipeline.md +56 -3
  199. package/skills/weaver-e10-meeting/references/room-recommend.md +2 -0
  200. package/skills/weaver-e10-recruit-stage/SKILL.md +158 -146
  201. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +64 -51
  202. package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +56 -18
  203. package/skills/weaver-e10-recruit-stage/lib/recruit-attach-probe.mjs +127 -0
  204. package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +217 -30
  205. package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +39 -7
  206. package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +2 -2
  207. package/skills/weaver-e10-recruit-stage/references/position-templates.md +10 -10
  208. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +18 -18
  209. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +29 -31
  210. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +2 -2
  211. package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +4 -2
  212. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +19 -20
  213. package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +4 -4
  214. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +3 -3
  215. package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +10 -0
  216. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +4 -3
  217. package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +21 -25
  218. package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +1 -1
  219. package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +19 -7
  220. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +31 -58
  221. package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +3 -1
  222. package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +2 -2
  223. package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +2 -2
  224. package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +1 -1
  225. package/skills/weaver-e10-recruit-stage/templates/match-report.html +25 -15
  226. package/skills/weaver-e10-shijingran/SKILL.md +2 -2
  227. package/skills/weaver-e10-shijingran/references/operations.md +5 -2
  228. package/skills/weaver-e10-shijingran/references/source-manifest.json +41 -40
  229. package/skills/weaver-e10-workflow/SKILL.md +13 -9
  230. package/skills/weaver-e10-workflow/references/todo-dialogue.md +33 -8
  231. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +19 -14
  232. package/skills/weaver-e10-workflow/references/workflow-create.md +1 -1
  233. package/skills/weaver-e10-workflow/references/workflow-query.md +4 -2
  234. package/skills/weaver-e10-workflow/references/workflow-view.md +3 -3
  235. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +132 -42
  236. package/skills/weaver-e10-yepiaotong/SKILL.md +133 -61
  237. package/skills/weaver-e10-yepiaotong/references/invoice-add.md +3 -1
  238. package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +18 -2
  239. package/skills/weaver-e10-yepiaotong/references/invoice-disabled-capabilities.md +3 -3
  240. package/skills/weaver-e10-yepiaotong/references/invoice-download.md +1 -1
  241. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +13 -1
  242. package/skills/weaver-e10-yepiaotong/references/invoice-file-upload.md +3 -1
  243. package/skills/weaver-e10-yepiaotong/references/invoice-import.md +6 -4
  244. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +42 -45
  245. package/skills/weaver-e10-yepiaotong/references/invoice-ocr-preview.md +1 -1
  246. package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +18 -2
  247. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +14 -1
  248. package/skills/weaver-e10-yepiaotong/references/invoice-red-workflow.md +96 -0
  249. package/skills/weaver-e10-yepiaotong/references/invoice-reim-relation.md +56 -369
  250. package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +16 -6
  251. package/skills/weaver-e10-yepiaotong/references/name-fuzzy-search.md +38 -0
  252. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +163 -646
  253. package/skills/weaver-e10-yepiaotong/references/reim-customer-search.md +90 -44
  254. package/skills/weaver-e10-yepiaotong/references/reim-eligibility-rules.md +85 -0
  255. package/skills/weaver-e10-yepiaotong/references/reim-fill-validation.md +61 -0
  256. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +91 -280
  257. package/skills/weaver-e10-yepiaotong/references/reim-preapproval-rules.md +98 -0
  258. package/skills/weaver-e10-yepiaotong/references/reim-travel-invoice-matching.md +48 -0
  259. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +234 -695
  260. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +395 -204
  261. package/skills/weaver-e10-yepiaotong/references/travel-application-fill.md +84 -0
  262. package/skills/weaver-e10-yepiaotong/references/workflow-direct-fill.md +165 -0
  263. package/templates/meeting/minute.docx +0 -0
  264. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +0 -93
  265. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +0 -774
  266. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +0 -111
  267. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +0 -360
  268. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +0 -167
@@ -23,6 +23,7 @@
23
23
  * 触发解析后立刻返回 `pending`,让调用方 1 分钟后再来查(`parseStatus`)。
24
24
  */
25
25
  import { meetingValidationError } from '../errors.js';
26
+ import { requireDestructiveConfirm } from '../confirm-gate.js';
26
27
  import { meetingSuccess, SCHEMA_ID } from './types.js';
27
28
  /** minutes_status 枚举(接口文档口径)。 */
28
29
  const MINUTE_STATUS = {
@@ -95,6 +96,11 @@ const meetingMinuteWriteContent = {
95
96
  description: '写完内容后是否生成 docx 并挂到 doc_file(默认 true)。系统不会根据正文自动出文档,'
96
97
  + '不生成纪要文件字段就一直空着;传 false 可跳过',
97
98
  },
99
+ confirm: {
100
+ type: 'boolean',
101
+ description: '只有"要覆盖已有正文/纪要文案"时才需要:原字段非空且内容不同 → 不传会被拒绝(confirm_required)。'
102
+ + '首次写入(原字段为空)或内容相同不需要',
103
+ },
98
104
  },
99
105
  required: ['id', 'mt_id'],
100
106
  },
@@ -122,6 +128,35 @@ const meetingMinuteWriteContent = {
122
128
  patch.minutes_content = minutesContent;
123
129
  if (parseContent !== undefined)
124
130
  patch.parse_content = parseContent;
131
+ // 覆盖已有正文/纪要文案 = 破坏性写入。判断依据是 CLI 读到的现状,不是调用方的声明:
132
+ // 原字段非空且内容不同才拦;首次写入(原字段为空)或内容相同直接放行 —— 日常路径不多一轮确认。
133
+ const willWriteText = minutesContent !== undefined && minutesContent.trim() !== '';
134
+ const willWriteMinutes = parseContent !== undefined && parseContent.trim() !== '';
135
+ if (args.confirm !== true && (willWriteText || willWriteMinutes)) {
136
+ if (!current)
137
+ current = await readMinute(env, id);
138
+ const details = [];
139
+ if (willWriteText) {
140
+ const oldText = textOf(current.minutes_content);
141
+ const nextText = minutesContent;
142
+ if (oldText.trim() !== '' && oldText.trim() !== nextText.trim()) {
143
+ details.push(`纪要原文:现有 ${oldText.length} 字 → 将替换为 ${nextText.length} 字`);
144
+ }
145
+ }
146
+ if (willWriteMinutes) {
147
+ const oldMinute = textOf(current.parse_content);
148
+ const nextMinute = parseContent;
149
+ if (oldMinute.trim() !== '' && oldMinute.trim() !== nextMinute.trim()) {
150
+ details.push(`纪要文案:现有 ${oldMinute.length} 字 → 将替换为 ${nextMinute.length} 字`);
151
+ }
152
+ }
153
+ requireDestructiveConfirm({
154
+ confirm: args.confirm,
155
+ destructive: details.length > 0,
156
+ action: '覆盖这条纪要的已有内容',
157
+ details,
158
+ });
159
+ }
125
160
  let statusReason;
126
161
  if (args.minutes_status !== undefined) {
127
162
  patch.minutes_status = textOf(args.minutes_status);
@@ -159,6 +194,28 @@ const meetingMinuteWriteContent = {
159
194
  // 导致"正文有内容、纪要文件字段空"(2026-11-16 真机)。
160
195
  let minuteDoc = null;
161
196
  if (args.with_doc !== false) {
197
+ // ⛔ 优先走 ESB「保存解析并生成文档」(与群聊链路同一条动作流):服务端生成标准文档并回写 mt_minutes。
198
+ // 以前这条路径直接本地拼 docx → 文档中心失败就只剩「文档附件」,纪要文件永远空着。
199
+ try {
200
+ const { generateMinuteDocViaEsb } = await import('../minute-doc.js');
201
+ const esbBody = textOf(after.parse_content) || textOf(after.minutes_content);
202
+ const esb = await generateMinuteDocViaEsb(env, { id, content: esbBody });
203
+ if (esb.docId) {
204
+ const check = await readMinute(env, id);
205
+ const attached = textOf(check.mt_minutes).includes(esb.docId);
206
+ minuteDoc = { docId: esb.docId, source: 'esb', attached };
207
+ if (!attached)
208
+ warnings.push('ESB 已生成纪要文档,但 mt_minutes 回读为空,请稍后复查');
209
+ }
210
+ else if (esb.error) {
211
+ warnings.push(`ESB 生成纪要文档未成功(${esb.error}),改用本地 docx 兜底`);
212
+ }
213
+ }
214
+ catch (error) {
215
+ warnings.push(`ESB 生成纪要文档异常(${String(error?.message ?? error).slice(0, 100)}),改用本地 docx 兜底`);
216
+ }
217
+ }
218
+ if (args.with_doc !== false && !minuteDoc) {
162
219
  try {
163
220
  const { buildMinuteDocx } = await import('../minute-doc.js');
164
221
  const { meetingStateDir } = await import('./env.js');
@@ -192,7 +249,7 @@ const meetingMinuteWriteContent = {
192
249
  }
193
250
  // 统一走 ensureMinuteDoc:它会把 docx 同时发成"文档中心文档"并写 mt_minutes
194
251
  // (mt_minutes 是文档组件,只认文档 id;塞附件 fileId 会被静默丢弃)。
195
- if (args.with_doc !== false) {
252
+ if (args.with_doc !== false && !minuteDoc) {
196
253
  try {
197
254
  const { ensureMinuteDoc } = await import('../minute-doc.js');
198
255
  const better = await ensureMinuteDoc(env, {
@@ -0,0 +1,295 @@
1
+ /**
2
+ * 会议纪要「按模板出文档」——不绑定任何会议记录。
3
+ *
4
+ * 为什么单独一个 op:`meeting.minute.writeContent` 那条链路以「纪要 id + 会议 id」为入口,
5
+ * 会议不存在时 `ensureMinuteDoc` 直接返回 null,于是"没有会议就出不了文档"。
6
+ * 这里只做三件事:模板渲染 → 落 docx → 传文档中心(folder 300),**不碰任何会议/纪要字段**,
7
+ * 所以对现有建会、纪要、任务链路零影响。
8
+ *
9
+ * 模板:templates/meeting/minute.docx(可用 WEAVER_MEETING_MINUTE_TEMPLATE 覆盖)。
10
+ * 样式(半磅):大标题 52 / 抬头栏 22 / 正文与标题沿用 buildBodyParagraphsXml 的字号(22 / 32)。
11
+ */
12
+ import { mkdir, readFile, writeFile } from 'node:fs/promises';
13
+ import { dirname, join, resolve } from 'node:path';
14
+ import { existsSync } from 'node:fs';
15
+ import { fileURLToPath } from 'node:url';
16
+ import { meetingValidationError } from '../errors.js';
17
+ import { meetingSuccess } from './types.js';
18
+ import { buildBodyParagraphsXml, buildMinuteDocx } from '../minute-doc.js';
19
+ import { readDocxEntries, renderDocx, writeDocxEntries } from '../invitation/docx.js';
20
+ import { meetingStateDir } from './env.js';
21
+ /** 正文插入点:模板里这一整段会被替换成渲染好的正文 */
22
+ const BODY_MARK = '@@正文@@';
23
+ /** 模板默认位置:CLI 包根目录下的 templates/meeting/minute.docx */
24
+ function templatePath() {
25
+ const override = process.env.WEAVER_MEETING_MINUTE_TEMPLATE;
26
+ if (override && override.trim() !== '')
27
+ return resolve(override);
28
+ // 打包后位置会变(dist/index.js 或 dist/chunks/*.js),所以不用固定层级,改为向上找
29
+ let dir = dirname(fileURLToPath(import.meta.url));
30
+ for (let i = 0; i < 8; i += 1) {
31
+ const candidate = join(dir, 'templates/meeting/minute.docx');
32
+ if (existsSync(candidate))
33
+ return candidate;
34
+ const parent = dirname(dir);
35
+ if (parent === dir)
36
+ break;
37
+ dir = parent;
38
+ }
39
+ return join(dir, 'templates/meeting/minute.docx');
40
+ }
41
+ /** 目录 id → 目录类型(100=系统 / 200=公共 / 300=个人)。未知目录沿用 company,与旧行为一致。 */
42
+ export function inferFolderType(folderId) {
43
+ if (folderId === '100')
44
+ return 'sys';
45
+ if (folderId === '200')
46
+ return 'company';
47
+ if (folderId === '300')
48
+ return 'privy';
49
+ return '';
50
+ }
51
+ /** 目录类型 → 可见范围说明 */
52
+ export function visibilityOf(folderType) {
53
+ if (folderType === 'privy')
54
+ return '仅本人可见(个人知识库)';
55
+ if (folderType === 'company')
56
+ return '本租户可见(公共知识库)';
57
+ if (folderType === 'sys')
58
+ return '系统知识库';
59
+ return '未知';
60
+ }
61
+ function safeName(input) {
62
+ return String(input || '会议纪要').replace(/[\\/:*?"<>|]+/g, '-').replace(/\s+/g, ' ').trim().slice(0, 80)
63
+ || '会议纪要';
64
+ }
65
+ /** 把模板里 @@正文@@ 所在段落换成正文段落(正文不参与占位符替换,避免内容里的 {} 被误填) */
66
+ export function injectMinuteBody(documentXml, content) {
67
+ const bodyXml = buildBodyParagraphsXml(content, { body: 22, heading: 32, cell: 20 });
68
+ const paragraphs = documentXml.split(/(?=<w:p[ >])/);
69
+ let replaced = false;
70
+ const out = paragraphs.map((chunk) => {
71
+ if (replaced || !chunk.includes(BODY_MARK))
72
+ return chunk;
73
+ replaced = true;
74
+ // 丢掉标记所在段落,换成正文段落(保留结尾的 </w:body> 等尾部由切片自然携带)
75
+ const tail = chunk.slice(chunk.indexOf('</w:p>') + '</w:p>'.length);
76
+ return bodyXml + tail;
77
+ });
78
+ return replaced ? out.join('') : documentXml;
79
+ }
80
+ export const minuteExportOperations = [
81
+ {
82
+ name: 'meeting.minute.exportDoc',
83
+ resource: 'minute',
84
+ method: 'exportDoc',
85
+ action: 'meeting.minute.exportDoc',
86
+ summary: '把会议记录整理成标准版式纪要文档并上传:按模板 templates/meeting/minute.docx 渲染(标题/抬头栏/正文分级),'
87
+ + '生成 docx 并传文档中心 300 目录,返回文档 id 与本地路径。**不需要会议 id**——系统里没有这场会也能出文档',
88
+ capability: 'minute',
89
+ risk: 'read-before-write',
90
+ inputSchema: {
91
+ type: 'object',
92
+ additionalProperties: false,
93
+ properties: {
94
+ subject: { type: 'string', minLength: 1, description: '纪要标题(=文档名),如「东航项目沟通会会议纪要」' },
95
+ content: { type: 'string', minLength: 1, description: '正文(markdown):## 讨论与结论 / ## 会议决议 / ## 待办事项' },
96
+ mt_name: { type: 'string', description: '抬头「会议主题」;不传则用 subject' },
97
+ begin_datetime: { type: 'string', description: '抬头「会议时间」起(yyyy-MM-dd HH:mm);只在记录里有时才传' },
98
+ end_datetime: { type: 'string', description: '抬头「会议时间」止' },
99
+ address: { type: 'string', description: '抬头「会议地点」' },
100
+ host: { type: 'string', description: '抬头「主持人」' },
101
+ recorder: { type: 'string', description: '抬头「记录人」,默认当前登录人' },
102
+ hrm_members: { type: 'string', description: '抬头「参会人员」,逗号分隔' },
103
+ crm_members: { type: 'string', description: '抬头「参会客户」' },
104
+ folder_id: { type: 'string', description: '文档中心目录 id,默认 300(个人知识库);200=公共知识库、100=系统知识库' },
105
+ folder_type: {
106
+ type: 'string',
107
+ enum: ['company', 'privy', 'sys'],
108
+ description: '目录类型;省略时按 folder_id 推断(300→privy、200→company、100→sys)',
109
+ },
110
+ },
111
+ required: ['subject', 'content'],
112
+ },
113
+ handler: async (args, env) => {
114
+ const startedAt = Date.now();
115
+ const subject = String(args.subject ?? '').trim();
116
+ const content = String(args.content ?? '').trim();
117
+ if (!subject)
118
+ throw meetingValidationError('subject_required', '必须提供纪要标题(subject)');
119
+ if (!content)
120
+ throw meetingValidationError('content_required', '必须提供正文(content)');
121
+ const session = await env.host.getSession().catch(() => null);
122
+ let loginName = String(session?.userName ?? session?.name ?? '').trim();
123
+ const warnings = [];
124
+ // 记录人:显式传 > 会话里的姓名 > 文档中心当前用户 > 「未记录」
125
+ // (小E 的会话常常只有 userId,没有姓名,直接写「未记录」在正式文档里很难看)
126
+ let recorder = String(args.recorder ?? '').trim() || loginName;
127
+ if (!recorder) {
128
+ try {
129
+ const { executeCaizhilianOperation } = await import('../../caizhilian/operations.js');
130
+ const { createCaizhilianHost } = await import('../../caizhilian/host.js');
131
+ const { createCaizhilianContinuationSigner } = await import('../../caizhilian/continuation.js');
132
+ const probeEnv = {
133
+ ...env,
134
+ host: createCaizhilianHost(env.ctx),
135
+ continuation: createCaizhilianContinuationSigner(env.ctx),
136
+ };
137
+ const who = await executeCaizhilianOperation('caizhilian.user.current', {}, probeEnv);
138
+ const name = String(who?.data?.employeeName ?? who?.data?.name ?? who?.data?.userName ?? '').trim();
139
+ if (name) {
140
+ recorder = name;
141
+ loginName = name;
142
+ }
143
+ }
144
+ catch {
145
+ // 取不到就继续走兜底,不阻断出文档
146
+ }
147
+ }
148
+ if (!recorder) {
149
+ recorder = '未记录';
150
+ warnings.push('记录人未取到当前登录人姓名,已填「未记录」;要写具体人请显式传 recorder');
151
+ }
152
+ const tplPath = templatePath();
153
+ let template = null;
154
+ try {
155
+ template = await readFile(tplPath);
156
+ }
157
+ catch {
158
+ // ⛔ 不要在这里抛错:模板丢了(CLI 安装不完整 / 升级只覆盖了 dist)时,
159
+ // 报错会让模型自己去满盘 `Get-ChildItem -Recurse -Filter minute.docx` 找模板,
160
+ // 实测白烧 30 秒以上,最后还得用环境变量指过去。这里退回内置版式,照样出文档。
161
+ template = null;
162
+ warnings.push(`纪要模板未随 CLI 包找到(${tplPath}),本次用内置版式生成;`
163
+ + '重新安装 CLI 可恢复标准模板版式。');
164
+ }
165
+ const values = {
166
+ mt_name: String(args.mt_name ?? '').trim() || subject,
167
+ begin_datetime: String(args.begin_datetime ?? '').trim() || '未记录',
168
+ end_datetime: String(args.end_datetime ?? '').trim() || '未记录',
169
+ address: String(args.address ?? '').trim() || '未记录',
170
+ host: String(args.host ?? '').trim() || '未记录',
171
+ recorder,
172
+ hrm_members: String(args.hrm_members ?? '').trim() || '未记录',
173
+ crm_members: String(args.crm_members ?? '').trim() || '无',
174
+ };
175
+ // 1) 渲染抬头栏占位符(正文此时还没插入,不会误替换用户内容里的 {})
176
+ // 2) 插入正文
177
+ let buffer;
178
+ let filledKeys = [];
179
+ if (template) {
180
+ const rendered = renderDocx(template, (key) => ({ text: values[key] ?? '' }));
181
+ filledKeys = rendered.filled;
182
+ const entries = readDocxEntries(rendered.buffer).map((entry) => (entry.name === 'word/document.xml'
183
+ ? { name: entry.name, data: Buffer.from(injectMinuteBody(entry.data.toString('utf8'), content), 'utf8') }
184
+ : entry));
185
+ buffer = writeDocxEntries(entries);
186
+ if (rendered.pending.length > 0) {
187
+ warnings.push(`模板里有未填充的占位符:${rendered.pending.join('、')}(已留空,检查模板是否新增了字段)`);
188
+ }
189
+ }
190
+ else {
191
+ // 内置版式兜底:结构与模板一致(标题 / 抬头栏 / 正文分级),只是字号走默认
192
+ buffer = buildMinuteDocx({
193
+ title: subject,
194
+ meta: [
195
+ `会议主题:${values.mt_name}`,
196
+ `会议时间:${values.begin_datetime} ~ ${values.end_datetime}`,
197
+ `会议地点:${values.address}`,
198
+ `主持人:${values.host}`,
199
+ `记录人:${values.recorder}`,
200
+ `参会人员:${values.hrm_members}`,
201
+ `参会客户:${values.crm_members}`,
202
+ ],
203
+ content,
204
+ });
205
+ }
206
+ // 3) 落本地 docx
207
+ const fileName = safeName(subject);
208
+ const dir = join(meetingStateDir(env.ctx), 'minute-docs');
209
+ await mkdir(dir, { recursive: true });
210
+ const filePath = join(dir, `${fileName}.docx`);
211
+ await writeFile(filePath, buffer);
212
+ // 4) 传文档中心(folder 默认 300)——与纪要文件同一套动作流,不绑会议
213
+ let docId = '';
214
+ let docError = '';
215
+ let targetFolderId = '300';
216
+ let targetFolderType = 'company';
217
+ let caizhilianEnvRef = null;
218
+ try {
219
+ const { executeCaizhilianOperation } = await import('../../caizhilian/operations.js');
220
+ const { createCaizhilianHost } = await import('../../caizhilian/host.js');
221
+ const { createCaizhilianContinuationSigner } = await import('../../caizhilian/continuation.js');
222
+ const caizhilianEnv = {
223
+ ...env,
224
+ host: createCaizhilianHost(env.ctx),
225
+ continuation: createCaizhilianContinuationSigner(env.ctx),
226
+ };
227
+ const folderId = String(args.folder_id ?? '').trim() || '300';
228
+ const folderType = String(args.folder_type ?? '').trim() || inferFolderType(folderId) || 'company';
229
+ targetFolderId = folderId;
230
+ targetFolderType = folderType;
231
+ caizhilianEnvRef = caizhilianEnv;
232
+ const base = {
233
+ file_path: (await import('node:path')).win32.normalize(filePath),
234
+ name: fileName,
235
+ folder_id: folderId,
236
+ folder_type: folderType,
237
+ author_id: String(session?.userId ?? '').trim(),
238
+ };
239
+ const prepared = await executeCaizhilianOperation('caizhilian.document.create-office.prepare', base, caizhilianEnv);
240
+ const continuation = String(prepared?.data?.continuation ?? '');
241
+ if (continuation) {
242
+ const applied = await executeCaizhilianOperation('caizhilian.document.create-office.apply', { ...base, continuation, confirm: true }, caizhilianEnv);
243
+ docId = String(applied?.data?.doc_id ?? '').trim();
244
+ }
245
+ }
246
+ catch (error) {
247
+ docError = String(error?.message ?? error).slice(0, 200);
248
+ }
249
+ if (!docId) {
250
+ warnings.push(`文档中心未返回文档 id${docError ? `(${docError})` : ''};docx 已落本地,文件名可直接用于上传`);
251
+ }
252
+ // 5) 回查落地结果:目录名 / 类型 / 状态 —— 防止"创建接口说成功、实际落在别处"
253
+ let docFolder = null;
254
+ let docStatus = null;
255
+ let contentType = '';
256
+ if (docId && caizhilianEnvRef) {
257
+ try {
258
+ const { executeCaizhilianOperation } = await import('../../caizhilian/operations.js');
259
+ const got = await executeCaizhilianOperation('caizhilian.document.get', { doc_id: docId }, caizhilianEnvRef);
260
+ const info = got?.data ?? {};
261
+ docStatus = typeof info.docStatus === 'number' ? info.docStatus : null;
262
+ contentType = String(info.contentType ?? '');
263
+ const first = Array.isArray(info.parentFolders) ? info.parentFolders[0] : null;
264
+ if (first) {
265
+ docFolder = { id: String(first.id ?? ''), name: String(first.name ?? ''), type: String(first.type ?? '') };
266
+ }
267
+ }
268
+ catch (error) {
269
+ warnings.push(`文档已创建(${docId}),但回查目录失败:${String(error?.message ?? error).slice(0, 120)}`);
270
+ }
271
+ }
272
+ if (docFolder && docFolder.id !== targetFolderId) {
273
+ warnings.push(`目标目录是 ${targetFolderId},实际落在 ${docFolder.id}(${docFolder.name})——请确认是否有权限`);
274
+ }
275
+ return meetingSuccess('meeting.minute.exportDoc', {
276
+ subject,
277
+ fileName: `${fileName}.docx`,
278
+ filePath,
279
+ size: buffer.length,
280
+ docId,
281
+ docError,
282
+ folderId: targetFolderId,
283
+ folderType: docFolder?.type || targetFolderType,
284
+ folderName: docFolder?.name ?? '',
285
+ folderPath: docFolder?.name ?? '',
286
+ visibility: visibilityOf(docFolder?.type || targetFolderType),
287
+ docStatus,
288
+ contentType,
289
+ templatePath: tplPath,
290
+ filled: filledKeys,
291
+ durationMs: Date.now() - startedAt,
292
+ }, { warnings });
293
+ },
294
+ },
295
+ ];
@@ -19,6 +19,8 @@ import { meetingPipelineOperations } from './pipeline.js';
19
19
  import { meetingInvitationOperations } from './invitation.js';
20
20
  import { meetingMemberExpandOperations } from './eb/member-expand.js';
21
21
  import { meetingInvitationPublishOperations } from './invitation-publish.js';
22
+ import { minuteExportOperations } from './minute-export.js';
23
+ import { groupShareOperations } from './group-share.js';
22
24
  import { meetingQrOperations } from './qrcode.js';
23
25
  import { meetingSummaryOperations } from './summary.js';
24
26
  import { meetingFormFieldOperations } from './form-fields.js';
@@ -48,6 +50,8 @@ function buildRegistry() {
48
50
  ...meetingInvitationOperations,
49
51
  ...meetingMemberExpandOperations,
50
52
  ...meetingInvitationPublishOperations,
53
+ ...minuteExportOperations,
54
+ ...groupShareOperations,
51
55
  ...meetingQrOperations,
52
56
  ...meetingSummaryOperations,
53
57
  ...meetingFormFieldOperations,
@@ -493,26 +493,51 @@ export const projectReadOperations = [
493
493
  resource: 'project',
494
494
  method: 'diagnose',
495
495
  action: 'project.version.check',
496
- summary: '查询事井然应用版本并判断是否满足 20.6.11;仅用于异常诊断或用户主动询问',
496
+ summary: '检测事井然应用是否安装及版本(要求 >= 20.6.11);仅用于接口异常诊断或用户主动询问版本',
497
497
  risk: 'read',
498
498
  inputSchema: schemaOf({ appId: { type: 'string', description: '可选;缺省时自动解析' } }),
499
499
  handler: async (args, { host }) => {
500
- const appId = args.appId ? String(args.appId) : await getAppId(host);
501
- const response = await host.request({
502
- method: 'GET',
503
- path: '/api/installer/public/querySpAppVersionInfo',
504
- query: { appId },
505
- operation: 'project.version.check',
506
- });
507
- assertWeaverSuccess(response, 'project.version.check');
508
- const version = String(response?.data?.commitVersion ?? '');
509
- if (!version)
510
- throw new Error('接口未返回应用版本');
500
+ let appId = args.appId ? String(args.appId) : '';
501
+ if (!appId) {
502
+ try {
503
+ appId = await getAppId(host);
504
+ }
505
+ catch {
506
+ return projectSuccess('project.version.check', {
507
+ installed: false,
508
+ appId: null,
509
+ commitVersion: null,
510
+ versionOk: false,
511
+ minRequiredVersion: MIN_VERSION.join('.'),
512
+ status: 'NOT_INSTALLED',
513
+ reason: 'app_not_found',
514
+ message: '未检测到事井然项目管理应用(getAppIds 未返回 appId),请先安装应用',
515
+ });
516
+ }
517
+ }
518
+ let commitVersion = '';
519
+ try {
520
+ const response = await host.request({
521
+ method: 'GET',
522
+ path: '/api/installer/public/querySpAppVersionInfo',
523
+ query: { appId },
524
+ operation: 'project.version.check',
525
+ });
526
+ assertWeaverSuccess(response, 'project.version.check');
527
+ commitVersion = String(response?.data?.commitVersion ?? '').trim();
528
+ }
529
+ catch {
530
+ commitVersion = '';
531
+ }
532
+ const installed = commitVersion !== '';
533
+ const versionOk = installed && versionAtLeast(commitVersion);
511
534
  return projectSuccess('project.version.check', {
535
+ installed,
512
536
  appId,
513
- version,
514
- minimumVersion: MIN_VERSION.join('.'),
515
- supported: versionAtLeast(version),
537
+ commitVersion: installed ? commitVersion : null,
538
+ versionOk,
539
+ minRequiredVersion: MIN_VERSION.join('.'),
540
+ status: installed ? (versionOk ? 'OK' : 'VERSION_TOO_LOW') : 'NOT_INSTALLED',
516
541
  });
517
542
  },
518
543
  },
@@ -23,7 +23,6 @@ const SELFUSE_DEFAULT_FLOW = {
23
23
  id: '874896524979806209',
24
24
  name: '初筛+面试+offer阶段',
25
25
  };
26
- const digitalMenuMemo = new Map();
27
26
  function cacheDirFor(baseUrl) {
28
27
  const url = new URL(baseUrl);
29
28
  const host = url.hostname + (url.port ? `_${url.port}` : '');
@@ -33,48 +32,6 @@ function cacheDirFor(baseUrl) {
33
32
  const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolve(homedir(), '.weaver-work-cli');
34
33
  return join(home, 'env-cache', 'recruit-ops', host);
35
34
  }
36
- /**
37
- * 磁盘缓存兼容:脚本版(recruit-stage 技能)播种的缓存里若已带 defaultRecruitFlow /
38
- * lists.digital_human,直接复用(同环境免请求);CLI 侧则运行时解析一次并 memo。
39
- */
40
- async function readLegacyCacheExtra(baseUrl) {
41
- try {
42
- const dir = cacheDirFor(baseUrl);
43
- if (!existsSync(dir))
44
- return { defaultRecruitFlow: null, digitalHumanMenu: null };
45
- const files = await (await import('node:fs/promises')).readdir(dir);
46
- const jsonFiles = files.filter((f) => f.endsWith('.json'));
47
- // 原实现要求「目录内恰好 1 个 json 才读」,多环境/多应用共存时必然读不到 →
48
- // 改为遍历全部 json,取第一个带所需键的(2026-11-05 修)。
49
- let flow = null;
50
- let dh = null;
51
- for (const f of jsonFiles) {
52
- let raw;
53
- try {
54
- raw = JSON.parse(await readFile(join(dir, f), 'utf8'));
55
- }
56
- catch {
57
- continue;
58
- }
59
- if (!flow && raw?.defaultRecruitFlow && raw.defaultRecruitFlow.id) {
60
- flow = { id: String(raw.defaultRecruitFlow.id), name: String(raw.defaultRecruitFlow.name || '') };
61
- }
62
- if (!dh && raw?.lists?.digital_human?.listId) {
63
- dh = {
64
- menuName: String(raw.lists.digital_human.menuName || '面试数字人配置'),
65
- listId: String(raw.lists.digital_human.listId),
66
- cusMenuId: String(raw.lists.digital_human.cusMenuId || ''),
67
- };
68
- }
69
- if (flow && dh)
70
- break;
71
- }
72
- return { defaultRecruitFlow: flow, digitalHumanMenu: dh };
73
- }
74
- catch {
75
- return { defaultRecruitFlow: null, digitalHumanMenu: null };
76
- }
77
- }
78
35
  /**
79
36
  * 「默认招聘流程」探测失败标记的磁盘 TTL。
80
37
  *
@@ -91,19 +48,22 @@ const FLOW_MISS_TTL_MS = 6 * 60 * 60 * 1000;
91
48
  * 辅助标记放同目录也不会干扰命中(2026-11-28 缓存治理后双保险;旧实现「目录内恰好
92
49
  * 1 个 json 才命中」时放同目录会把上下文缓存打冷,故历史上必须放目录外)。
93
50
  */
94
- function flowMissPath(baseUrl) {
51
+ function flowMissPath(baseUrl, ownerUserId) {
95
52
  const hostDir = cacheDirFor(baseUrl); // .../env-cache/recruit-ops/<host>
96
53
  const hostName = hostDir.split(/[\\/]/).pop() || 'unknown';
97
- return join(hostDir, '..', `_recruit-stage`, `flow-miss-${hostName}.json`);
54
+ const owner = String(ownerUserId || 'anon').replace(/[^\w.-]/g, '_');
55
+ return join(hostDir, '..', `_recruit-stage`, `flow-miss-${hostName}-${owner}.json`);
98
56
  }
99
- /** 读「上次探测失败」的时间戳(同环境 + 未过期才复用)。 */
100
- async function readFlowMissAt(baseUrl) {
57
+ /** 读「上次探测失败」的时间戳(同环境 + 同用户 + 未过期才复用)。 */
58
+ async function readFlowMissAt(baseUrl, ownerUserId) {
101
59
  if (process.env.E10_RS_NO_FLOW_CACHE === '1')
102
60
  return null;
103
61
  try {
104
- const raw = JSON.parse(await readFile(flowMissPath(baseUrl), 'utf8'));
62
+ const raw = JSON.parse(await readFile(flowMissPath(baseUrl, ownerUserId), 'utf8'));
105
63
  if (raw?.baseUrl !== baseUrl || !raw?.missedAt)
106
64
  return null;
65
+ if (ownerUserId && String(raw.ownerUserId || '') !== ownerUserId)
66
+ return null;
107
67
  if (Date.now() - raw.missedAt > FLOW_MISS_TTL_MS)
108
68
  return null;
109
69
  return raw.missedAt;
@@ -112,16 +72,16 @@ async function readFlowMissAt(baseUrl) {
112
72
  return null;
113
73
  }
114
74
  }
115
- async function writeFlowMiss(baseUrl) {
75
+ async function writeFlowMiss(baseUrl, ownerUserId) {
116
76
  if (process.env.E10_RS_NO_FLOW_CACHE === '1')
117
77
  return;
118
78
  try {
119
79
  const dir = cacheDirFor(baseUrl);
120
80
  if (!existsSync(dir))
121
81
  return; // 目录不存在说明连环境缓存都没播种过,不额外造目录
122
- const target = flowMissPath(baseUrl);
82
+ const target = flowMissPath(baseUrl, ownerUserId);
123
83
  await mkdir(dirname(target), { recursive: true });
124
- await writeFile(target, JSON.stringify({ baseUrl, missedAt: Date.now() }), 'utf8');
84
+ await writeFile(target, JSON.stringify({ baseUrl, ownerUserId, missedAt: Date.now() }), 'utf8');
125
85
  }
126
86
  catch { /* 写失败不影响主流程 */ }
127
87
  }
@@ -152,16 +112,11 @@ function isDefaultFlowRow(x) {
152
112
  * 探测成功写正缓存(memo);**探测失败**写带 TTL 的落盘标记,避免每个进程重复空跑 3 个 RTT。
153
113
  */
154
114
  async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
155
- const memoKey = baseUrl;
115
+ const memoKey = baseUrl + '|' + String(cache?.ownerUserId || '');
156
116
  if (flowMemo.has(memoKey))
157
117
  return flowMemo.get(memoKey) ?? null;
158
- const legacy = await readLegacyCacheExtra(baseUrl);
159
- if (legacy.defaultRecruitFlow) {
160
- flowMemo.set(memoKey, legacy.defaultRecruitFlow);
161
- return legacy.defaultRecruitFlow;
162
- }
163
118
  // TTL 内已知探测失败 → 跳过三条探测通道(下面 ③ 的自用兜底仍会生效)
164
- const missFresh = await readFlowMissAt(baseUrl);
119
+ const missFresh = await readFlowMissAt(baseUrl, String(cache.ownerUserId || ''));
165
120
  let result = null;
166
121
  /** 是否由服务端通道(①菜单列表 / ②旧接口)解析出来;③ 自用常量兜底不算 */
167
122
  let serverResolved = false;
@@ -255,28 +210,11 @@ async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
255
210
  // 服务端三条通道都没解析出来 → 记一次「探测失败」,TTL 内后续进程不再空跑(见 FLOW_MISS_TTL_MS)。
256
211
  // 进程内仍 memo 结果(自用常量兜底的值也好、null 也好),避免同进程重复走 ③。
257
212
  if (!missFresh)
258
- await writeFlowMiss(baseUrl);
213
+ await writeFlowMiss(baseUrl, String(cache.ownerUserId || ''));
259
214
  flowMemo.set(memoKey, result);
260
215
  }
261
216
  return result;
262
217
  }
263
- async function resolveDigitalHumanMenu(host, baseUrl, cache) {
264
- const memoKey = baseUrl;
265
- if (digitalMenuMemo.has(memoKey))
266
- return digitalMenuMemo.get(memoKey) ?? null;
267
- const legacy = await readLegacyCacheExtra(baseUrl);
268
- if (legacy.digitalHumanMenu) {
269
- digitalMenuMemo.set(memoKey, legacy.digitalHumanMenu);
270
- return legacy.digitalHumanMenu;
271
- }
272
- // 从 all_search 菜单里按别名找(跨基线菜单名不同:面试数字人配置/数字人配置)
273
- const allSearch = (cache.lists?.all_search || []);
274
- const candidates = allSearch.filter((m) => m.listId);
275
- let hit = (candidates.find((m) => (m.menuName || '').includes('面试数字人'))
276
- || candidates.find((m) => (m.menuName || '').includes('数字人配置'))) ?? null;
277
- digitalMenuMemo.set(memoKey, hit);
278
- return hit;
279
- }
280
218
  const loaders = new Map();
281
219
  export function createRecruitStageContext() {
282
220
  // 每个工厂独立记录「本次调用链」的缓存元信息:
@@ -291,11 +229,8 @@ export function createRecruitStageContext() {
291
229
  const cache = await loaders.get(loaderKey).load(host);
292
230
  own = loaders.get(loaderKey).lastMeta();
293
231
  const baseUrl = (await host.getSession()).baseUrl.replace(/\/+$/, '');
294
- const [defaultRecruitFlow, digitalHumanMenu] = await Promise.all([
295
- resolveDefaultRecruitFlow(host, baseUrl, cache.appId, cache),
296
- resolveDigitalHumanMenu(host, baseUrl, cache),
297
- ]);
298
- return { ...cache, defaultRecruitFlow, digitalHumanMenu };
232
+ const defaultRecruitFlow = await resolveDefaultRecruitFlow(host, baseUrl, cache.appId, cache);
233
+ return { ...cache, defaultRecruitFlow };
299
234
  });
300
235
  fn.lastCacheMeta = () => own;
301
236
  return fn;