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
@@ -4,11 +4,11 @@ import {
4
4
  esbOperationDefinitions,
5
5
  getEsbOperation,
6
6
  hasEsbOperation
7
- } from "./chunk-VOMDD2C5.js";
8
- import "./chunk-OQCK5SAU.js";
7
+ } from "./chunk-5E2FDXBU.js";
8
+ import "./chunk-RVEKGVZU.js";
9
9
  import "./chunk-TXUG266F.js";
10
10
  import "./chunk-7BDPM5ST.js";
11
- import "./chunk-MXCRKXOP.js";
11
+ import "./chunk-FPWCCRKT.js";
12
12
  import "./chunk-IZCQU5D5.js";
13
13
  import "./chunk-QVKRNL7L.js";
14
14
  import "./chunk-Y3C6MDL7.js";
@@ -4,7 +4,7 @@ import {
4
4
  getWorkflowOperation,
5
5
  hasWorkflowOperation,
6
6
  workflowOperationDefinitions
7
- } from "./chunk-FEZK536Z.js";
7
+ } from "./chunk-4PBN7NJY.js";
8
8
  import "./chunk-HP7JIYMT.js";
9
9
  import "./chunk-WRXSAVKO.js";
10
10
  import "./chunk-JJONWB5N.js";
@@ -4,18 +4,19 @@ import {
4
4
  getMeetingOperation,
5
5
  hasMeetingOperation,
6
6
  meetingOperationDefinitions
7
- } from "./chunk-4FCBEWNB.js";
8
- import "./chunk-KWJEICD4.js";
7
+ } from "./chunk-BP7BONZO.js";
8
+ import "./chunk-E2EY3DMS.js";
9
+ import "./chunk-IBTGXLOT.js";
9
10
  import "./chunk-WMRNO6IU.js";
10
- import "./chunk-2AUFKU2D.js";
11
- import "./chunk-QJWVYOOV.js";
12
- import "./chunk-KEA4XQPO.js";
13
- import "./chunk-ZUB4M4N3.js";
14
- import "./chunk-ZWIMLT6P.js";
15
- import "./chunk-BSR5TM7U.js";
16
- import "./chunk-NWYHCZTY.js";
17
- import "./chunk-I6NOHKEK.js";
18
- import "./chunk-ERZY6GYL.js";
11
+ import "./chunk-SWFTWNWL.js";
12
+ import "./chunk-Z44YFIN6.js";
13
+ import "./chunk-FAC4IFGQ.js";
14
+ import "./chunk-5VQ7JHV4.js";
15
+ import "./chunk-ZOTXXGUM.js";
16
+ import "./chunk-USYFVIUR.js";
17
+ import "./chunk-VNEU7OUN.js";
18
+ import "./chunk-7SQN5IZR.js";
19
+ import "./chunk-UZ2E3VNI.js";
19
20
  import "./chunk-7BDPM5ST.js";
20
21
  import "./chunk-QVKRNL7L.js";
21
22
  import "./chunk-Y3C6MDL7.js";
@@ -7,10 +7,10 @@ import {
7
7
  loadRooms,
8
8
  recommendRooms,
9
9
  rememberFrequentRoom
10
- } from "./chunk-BSR5TM7U.js";
11
- import "./chunk-NWYHCZTY.js";
12
- import "./chunk-I6NOHKEK.js";
13
- import "./chunk-ERZY6GYL.js";
10
+ } from "./chunk-USYFVIUR.js";
11
+ import "./chunk-VNEU7OUN.js";
12
+ import "./chunk-7SQN5IZR.js";
13
+ import "./chunk-UZ2E3VNI.js";
14
14
  import "./chunk-7BDPM5ST.js";
15
15
  import "./chunk-UG5G54VL.js";
16
16
  import "./chunk-BUSC6UAE.js";
@@ -8,10 +8,10 @@ import {
8
8
  resolveMeetingScheduleTypeIds,
9
9
  resolveMemberIdsByName,
10
10
  runScheduleConflictFlow
11
- } from "./chunk-KEA4XQPO.js";
12
- import "./chunk-NWYHCZTY.js";
13
- import "./chunk-I6NOHKEK.js";
14
- import "./chunk-ERZY6GYL.js";
11
+ } from "./chunk-FAC4IFGQ.js";
12
+ import "./chunk-VNEU7OUN.js";
13
+ import "./chunk-7SQN5IZR.js";
14
+ import "./chunk-UZ2E3VNI.js";
15
15
  import "./chunk-7BDPM5ST.js";
16
16
  import "./chunk-UG5G54VL.js";
17
17
  import "./chunk-BUSC6UAE.js";
@@ -21,7 +21,7 @@ import {
21
21
  createE10RequestRuntime,
22
22
  isE10SessionExpiredResponse,
23
23
  requireE10Session
24
- } from "./chunk-MXCRKXOP.js";
24
+ } from "./chunk-FPWCCRKT.js";
25
25
  import "./chunk-IZCQU5D5.js";
26
26
  import {
27
27
  getActiveProfile
@@ -2,8 +2,8 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  updateCommand
5
- } from "./chunk-SU6IJD6D.js";
6
- import "./chunk-OJ4JPD25.js";
5
+ } from "./chunk-TD5IOEGN.js";
6
+ import "./chunk-LQLIXBJF.js";
7
7
  import "./chunk-7DE3VMZD.js";
8
8
  import "./chunk-2BZ7TY4M.js";
9
9
  import "./chunk-UG5G54VL.js";
@@ -14,13 +14,13 @@ import {
14
14
  validateRuleFile,
15
15
  workflowOperationDefinitions,
16
16
  workflowSuccess
17
- } from "./chunk-FEZK536Z.js";
17
+ } from "./chunk-4PBN7NJY.js";
18
18
  import {
19
19
  createWorkflowContinuationSigner
20
20
  } from "./chunk-HP7JIYMT.js";
21
21
  import {
22
22
  createWorkflowHost
23
- } from "./chunk-TA2RBUTH.js";
23
+ } from "./chunk-TBCKK6LH.js";
24
24
  import {
25
25
  CLARIFICATION_SUBTYPE,
26
26
  WorkflowCliError,
@@ -36,7 +36,7 @@ import "./chunk-7BDPM5ST.js";
36
36
  import {
37
37
  reportPlatformError
38
38
  } from "./chunk-MD5CW4B6.js";
39
- import "./chunk-MXCRKXOP.js";
39
+ import "./chunk-FPWCCRKT.js";
40
40
  import "./chunk-IZCQU5D5.js";
41
41
  import "./chunk-QVKRNL7L.js";
42
42
  import "./chunk-Y3C6MDL7.js";
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunks/chunk-257JXJGD.js";
12
12
  import {
13
13
  UpdateService
14
- } from "./chunks/chunk-OJ4JPD25.js";
14
+ } from "./chunks/chunk-LQLIXBJF.js";
15
15
  import "./chunks/chunk-7DE3VMZD.js";
16
16
  import {
17
17
  packageRootDir
@@ -85,7 +85,7 @@ async function bootstrap(argv = process.argv.slice(2)) {
85
85
  const [{ createProgram }, { registerCommands }, { updateCommand }] = await Promise.all([
86
86
  import("./chunks/root-YZG2TS5W.js"),
87
87
  import("./chunks/register-SQOPIR2G.js"),
88
- import("./chunks/update-AV5VOXGY.js")
88
+ import("./chunks/update-77ZUIYSG.js")
89
89
  ]);
90
90
  const { program, ctx } = createProgram();
91
91
  await registerCommands(program, ctx, [updateCommand]);
@@ -112,7 +112,7 @@ async function bootstrap(argv = process.argv.slice(2)) {
112
112
  var startup = await bootstrap();
113
113
  if (!startup.handled) {
114
114
  try {
115
- await import("./chunks/cli-FULPXIKJ.js");
115
+ await import("./chunks/cli-WA7FOQKC.js");
116
116
  } finally {
117
117
  startup.release?.();
118
118
  }
@@ -7,6 +7,7 @@ import { isXiaoEHostEnvironment } from '../../core/runtime-agent.js';
7
7
  import { compareVersions, findNpmCli, npmRunner } from './npm.js';
8
8
  import { UPDATE_INTERVAL_MS, UpdateStore } from './store.js';
9
9
  const NAME = 'weaver-work-cli';
10
+ export const UPDATE_REGISTRY = 'https://registry.npmmirror.com/';
10
11
  const CHECK_TIMEOUT_MS = 3_000;
11
12
  const INSTALL_TIMEOUT_MS = 120_000;
12
13
  export class UpdateService {
@@ -47,7 +48,7 @@ export class UpdateService {
47
48
  catch {
48
49
  throw new Error('无法读取 npm 安装配置,请检查 npm 是否可用。');
49
50
  }
50
- if (typeof config.prefix !== 'string' || typeof config.registry !== 'string')
51
+ if (typeof config.prefix !== 'string')
51
52
  throw new Error('无法识别 npm 安装配置。');
52
53
  const prefix = resolve(config.prefix);
53
54
  const expected = process.platform === 'win32'
@@ -60,11 +61,9 @@ export class UpdateService {
60
61
  catch { /* Not this installation. */ }
61
62
  if (!matches)
62
63
  throw new Error('当前 CLI 不是此 npm 管理的全局安装,未执行更新。请使用原安装方式维护。');
63
- const registry = new URL(config.registry);
64
- if (!['https:', 'http:'].includes(registry.protocol) || registry.username || registry.password) {
65
- throw new Error('npm registry 配置不可用于更新。');
66
- }
67
- return { prefix, registry: registry.href };
64
+ // Version lookup and installation use the same domestic mirror. Never mutate
65
+ // the user's npmrc, and never inherit registry overrides from their environment.
66
+ return { prefix, registry: UPDATE_REGISTRY };
68
67
  }
69
68
  status() {
70
69
  if (this.skipReason)
@@ -79,7 +78,8 @@ export class UpdateService {
79
78
  };
80
79
  }
81
80
  validPending(state) {
82
- return typeof state.pending?.version === 'string'
81
+ return state.registry === UPDATE_REGISTRY
82
+ && typeof state.pending?.version === 'string'
83
83
  && typeof state.pending.token === 'string'
84
84
  && /^[a-f0-9-]{36}$/.test(state.pending.token)
85
85
  && compareVersions(state.pending.version, this.options.currentVersion) === 1;
@@ -115,11 +115,12 @@ export class UpdateService {
115
115
  if (typeof latest !== 'string' || compareVersions(latest, this.options.currentVersion) === undefined) {
116
116
  throw new Error('npm 返回的版本号无效。');
117
117
  }
118
+ const samePending = this.validPending(state) && state.pending.version === latest;
118
119
  state.latestVersion = latest;
119
120
  state.prefix = install.prefix;
120
121
  state.registry = install.registry;
121
122
  if (compareVersions(latest, this.options.currentVersion) === 1) {
122
- if (!this.validPending(state) || state.pending.version !== latest) {
123
+ if (!samePending) {
123
124
  state.pending = { version: latest, token: randomUUID() };
124
125
  }
125
126
  }
@@ -1,3 +1,4 @@
1
+ import { PROJECT_CARD_OBJ_ID } from '../operations/page.js';
1
2
  /**
2
3
  * 收款节点台账 HTML(2026-11-29)。
3
4
  *
@@ -49,6 +50,14 @@ td.num,th.num{text-align:right;font-variant-numeric:tabular-nums;white-space:now
49
50
  .pill.g{color:var(--green);background:var(--green-bg)}
50
51
  .pill.gray{color:var(--text-2);background:#eef0f4}
51
52
  .overdue{color:var(--red);font-weight:600}
53
+ a.jump{color:var(--primary);text-decoration:none;border-bottom:1px dashed rgba(36,104,242,.45)}
54
+ a.jump:hover{color:#1a53cc;border-bottom-style:solid}
55
+ .sep{color:var(--text-3)}
56
+ tr.group>td{background:#fbfcff;border-top:1px solid var(--border)}
57
+ tr.detail>td{background:#fff}
58
+ tr.detail .term{color:var(--text);padding-left:12px;position:relative;line-height:1.6}
59
+ tr.detail .term::before{content:"└";position:absolute;left:0;color:var(--text-3)}
60
+ tr.detail .sub{font-size:12px;color:var(--text-3)}
52
61
  .empty{padding:44px;text-align:center;color:var(--text-3)}
53
62
  .footer-note{padding:12px 20px;font-size:12px;color:var(--text-3);border-top:1px solid var(--border);line-height:1.8}
54
63
  .warnbar{background:var(--orange-bg);border:1px solid #f7d9b0;color:#8a5200;border-radius:8px;padding:10px 16px;font-size:12.5px;margin-top:16px;line-height:1.7}
@@ -74,45 +83,109 @@ function formatWan(value) {
74
83
  return '—';
75
84
  return (Number(value) / 10000).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 });
76
85
  }
86
+ function groupRows(rows) {
87
+ const groups = new Map();
88
+ for (const row of rows) {
89
+ const contractNo = String(row.contractNo ?? '').trim();
90
+ const key = `${row.projectId}||${contractNo}`;
91
+ let group = groups.get(key);
92
+ if (!group) {
93
+ group = {
94
+ key,
95
+ projectId: row.projectId,
96
+ projectName: row.projectName,
97
+ contractNo,
98
+ contractAmount: row.contractAmount,
99
+ dueAmount: 0,
100
+ receivedAmount: 0,
101
+ unreceivedAmount: 0,
102
+ maxOverdueDays: 0,
103
+ overdueStages: 0,
104
+ stages: [],
105
+ };
106
+ groups.set(key, group);
107
+ }
108
+ // 合同金额是合同级属性:同组多行取**最大值**,不重复累加(避免虚增)
109
+ group.contractAmount = Math.max(group.contractAmount, row.contractAmount);
110
+ group.dueAmount = round2(group.dueAmount + row.dueAmount);
111
+ group.receivedAmount = round2(group.receivedAmount + row.receivedAmount);
112
+ group.unreceivedAmount = round2(group.unreceivedAmount + row.unreceivedAmount);
113
+ const overdue = row.overdueDays ?? 0;
114
+ if (overdue > 0) {
115
+ group.overdueStages += 1;
116
+ group.maxOverdueDays = Math.max(group.maxOverdueDays, overdue);
117
+ }
118
+ group.stages.push(row);
119
+ }
120
+ for (const group of groups.values()) {
121
+ group.stages.sort((a, b) => (b.overdueDays ?? -Infinity) - (a.overdueDays ?? -Infinity));
122
+ }
123
+ return [...groups.values()].sort((a, b) => b.maxOverdueDays - a.maxOverdueDays);
124
+ }
125
+ function round2(value) {
126
+ return Math.round(value * 100) / 100;
127
+ }
128
+ /** 单元格里的链接:能取到地址就渲染 `<a target="_blank">`,取不到就是纯文本。 */
129
+ function anchor(href, label) {
130
+ const text = esc(label || '—');
131
+ if (!href)
132
+ return text;
133
+ return `<a class="jump" href="${esc(href)}" target="_blank" rel="noopener">${text}</a>`;
134
+ }
135
+ function statusPill(overdue) {
136
+ if (overdue === null)
137
+ return '<span class="pill gray">无计划日</span>';
138
+ if (overdue > 0)
139
+ return '<span class="pill r">已逾期</span>';
140
+ if (overdue === 0)
141
+ return '<span class="pill o">今日到期</span>';
142
+ return '<span class="pill o">待到账</span>';
143
+ }
77
144
  export function renderCollectionLedger(rows, totals, options = {}) {
78
145
  const title = options.title?.trim() || '合同台账 · 收款节点';
79
146
  const manager = options.managerName?.trim() || '—';
80
147
  const generatedAt = (options.generatedAt ?? new Date()).toLocaleString('zh-CN', { hour12: false });
81
148
  const warnings = options.warnings ?? [];
82
- const sorted = [...rows].sort((a, b) => {
83
- const left = a.overdueDays;
84
- const right = b.overdueDays;
85
- if (left === null && right === null)
86
- return 0;
87
- if (left === null)
88
- return 1;
89
- if (right === null)
90
- return -1;
91
- return right - left;
92
- });
93
- const body = sorted.length === 0
94
- ? `<tr><td colspan="10"><div class="empty">该客户经理名下暂无「条件已达成且未收清」的付款阶段</div></td></tr>`
95
- : sorted.map((row) => {
96
- const overdue = row.overdueDays;
97
- const status = overdue === null
98
- ? '<span class="pill gray">无计划日</span>'
99
- : overdue > 0
100
- ? '<span class="pill r">已逾期</span>'
101
- : overdue === 0
102
- ? '<span class="pill o">今日到期</span>'
103
- : '<span class="pill o">待到账</span>';
104
- return ` <tr>
105
- <td><div class="cname">${esc(row.projectName || '—')}</div><div class="ctype">${esc(row.contractNo || '—')}</div></td>
106
- <td><div class="ctype">${esc(row.term || '—')}</div></td>
107
- <td class="num">${formatMoney(row.contractAmount)}</td>
149
+ const linkOf = options.linkOf ?? {};
150
+ const groups = groupRows(rows);
151
+ const body = groups.length === 0
152
+ ? '<tr><td colspan="10"><div class="empty">该客户经理名下暂无「条件已达成且未收清」的付款阶段</div></td></tr>'
153
+ : groups.map((group) => {
154
+ const projectHref = group.projectId && linkOf.project ? linkOf.project(group.projectId) : '';
155
+ const contractParts = group.contractNo
156
+ ? group.contractNo.split(',').map((item) => item.trim()).filter(Boolean)
157
+ : [];
158
+ const contractHtml = contractParts.length
159
+ ? contractParts.map((no) => anchor(linkOf.contract ? linkOf.contract(no) : '', no)).join('<span class="sep">、</span>')
160
+ : '—';
161
+ const overdueText = group.overdueStages > 0
162
+ ? `<span class="overdue">${group.maxOverdueDays}</span>`
163
+ : '—';
164
+ const mainRow = ` <tr class="group">
165
+ <td><div class="cname">${anchor(projectHref, group.projectName || '—')}</div><div class="ctype">合同号:${contractHtml}</div></td>
166
+ <td><div class="ctype">共 ${group.stages.length} 个收款节点${group.overdueStages ? `(逾期 ${group.overdueStages} 个)` : ''}</div></td>
167
+ <td class="num"><b>${formatMoney(group.contractAmount)}</b></td>
168
+ <td class="num">—</td>
169
+ <td class="num"><b>${formatMoney(group.dueAmount)}</b></td>
170
+ <td class="num">${formatMoney(group.receivedAmount)}</td>
171
+ <td class="num"><b>${formatMoney(group.unreceivedAmount)}</b></td>
172
+ <td class="mono">—</td>
173
+ <td class="num">${overdueText}</td>
174
+ <td>${group.overdueStages ? `<span class="pill r">${group.overdueStages} 个逾期</span>` : '<span class="pill g">未逾期</span>'}</td>
175
+ </tr>`;
176
+ const detailRows = group.stages.map((row) => ` <tr class="detail">
177
+ <td><div class="term">${esc(row.term || '—')}</div></td>
178
+ <td><span class="sub">└ 收款节点</span></td>
179
+ <td class="num">—</td>
108
180
  <td class="num">${row.ratio ? `${row.ratio}%` : '—'}</td>
109
181
  <td class="num">${formatMoney(row.dueAmount)}</td>
110
182
  <td class="num">${formatMoney(row.receivedAmount)}</td>
111
- <td class="num"><b>${formatMoney(row.unreceivedAmount)}</b></td>
183
+ <td class="num">${formatMoney(row.unreceivedAmount)}</td>
112
184
  <td class="mono">${esc(row.planReceiveDate || '—')}</td>
113
- <td class="num">${overdue !== null && overdue > 0 ? `<span class="overdue">${overdue}</span>` : '—'}</td>
114
- <td>${status}</td>
115
- </tr>`;
185
+ <td class="num">${row.overdueDays !== null && row.overdueDays > 0 ? `<span class="overdue">${row.overdueDays}</span>` : '—'}</td>
186
+ <td>${statusPill(row.overdueDays)}</td>
187
+ </tr>`).join('\n');
188
+ return `${mainRow}\n${detailRows}`;
116
189
  }).join('\n');
117
190
  const warnHtml = warnings.length
118
191
  ? `<div class="warnbar">${warnings.map((item) => esc(item)).join('<br>')}</div>`
@@ -146,7 +219,7 @@ export function renderCollectionLedger(rows, totals, options = {}) {
146
219
  <div class="stat">
147
220
  <div class="k">合同金额合计</div>
148
221
  <div class="v">${formatWan(totals.contractAmount)}<small> 万元</small></div>
149
- <div class="sub">命中条款所属合同金额</div>
222
+ <div class="sub">${totals.contracts} 份合同(同一合同多期只计一次)</div>
150
223
  </div>
151
224
  <div class="stat">
152
225
  <div class="k">本期应收合计</div>
@@ -166,7 +239,7 @@ export function renderCollectionLedger(rows, totals, options = {}) {
166
239
  </div>
167
240
 
168
241
  <div class="table-card">
169
- <div class="table-head"><span class="t">到收款节点的付款阶段</span><span class="n">共 ${totals.stages} 条</span></div>
242
+ <div class="table-head"><span class="t">到收款节点的付款阶段</span><span class="n">${groups.length} 个项目·合同,共 ${totals.stages} 个收款节点</span></div>
170
243
  <table>
171
244
  <thead><tr>
172
245
  <th>项目 / 合同号</th><th>付款条件</th><th class="num">合同金额(元)</th><th class="num">比例</th>
@@ -179,7 +252,10 @@ ${body}
179
252
  </table>
180
253
  <div class="footer-note">
181
254
  数据来源:项目看板(客户经理 = ${esc(manager)},项目状态 ∈ 5 个未结束值)→ 项目合同付款阶段明细台账(关联项目 inC 批量过滤,台账仅返回未收清条款)。<br>
182
- 口径:本期应收 = 合同金额 × 比例;未收 = 本期应收 − 已收;逾期天数 = 今天 − 计划收款日(本地计算,正数表示已逾期)。金额单位:元(KPI 卡另附万元概览)。
255
+ 呈现口径:同一「项目 + 合同号」的多笔收款节点合并为一组 —— 主行给合同金额与应收/已收/未收合计,明细行(└)给每个收款节点;合同金额是合同级属性,只在主行出现一次,明细行不重复。<br>
256
+ 口径:本期应收 = 合同金额 × 比例;未收 = 本期应收 − 已收;逾期天数 = 今天 − 计划收款日(本地计算,正数表示已逾期)。金额单位:元(KPI 卡另附万元概览)。<br>
257
+ KPI「合同金额合计」按合同去重统计(同一合同有多期只计一次,不是按行累加);应收/已收/未收则是各期之和。<br>
258
+ 跳转:项目名 → 项目卡片页(/sp/ebdfpage/card/2/${PROJECT_CARD_OBJ_ID}/{项目ID});合同号 → 合同卡片页(/sp/ebdfpage/card/0/846297265322573825/{数据ID},数据 ID 由本链路按合同号解析;解析不到的合同号不带链接)。
183
259
  </div>
184
260
  </div>
185
261
  </div>
@@ -207,13 +207,37 @@ export function daysBetween(dateText, today) {
207
207
  const base = Date.UTC(today.getFullYear(), today.getMonth(), today.getDate());
208
208
  return Math.round((base - target) / 86_400_000);
209
209
  }
210
+ /**
211
+ * 合同金额的去重键:同一份合同无论出现几期(几行),合同金额只应计一次。
212
+ *
213
+ * 2026-12-01 事故:`summarize` 原先按**行**累加 `contractAmount`,同一合同有 2 期就被算了两遍
214
+ * (3 行 × 50 万 → KPI 显示 150 万,实际只有 2 份合同 100 万)。
215
+ * 合同号字段可能是多值(`HT-001,HT-002`)→ 先拆分排序再拼键,保证 `HT-001,HT-002` 与
216
+ * `HT-002,HT-001` 是同一把键。
217
+ */
218
+ export function contractKeyOf(contractNo) {
219
+ return String(contractNo ?? '')
220
+ .split(',')
221
+ .map((item) => item.trim())
222
+ .filter(Boolean)
223
+ .sort()
224
+ .join('|');
225
+ }
210
226
  export function summarize(rows) {
211
227
  const overdue = rows.filter((row) => (row.overdueDays ?? 0) > 0);
228
+ // 合同金额按**合同**去重(同一合同多期只计一次,金额取该合同各行的最大值,避免脏数据放大)
229
+ const amountByContract = new Map();
230
+ for (const row of rows) {
231
+ const key = contractKeyOf(row.contractNo);
232
+ if (!key)
233
+ continue;
234
+ amountByContract.set(key, Math.max(amountByContract.get(key) ?? 0, row.contractAmount));
235
+ }
212
236
  return {
213
237
  stages: rows.length,
214
- contracts: new Set(rows.map((row) => row.contractNo).filter(Boolean)).size,
238
+ contracts: amountByContract.size || new Set(rows.map((row) => row.contractNo).filter(Boolean)).size,
215
239
  projects: new Set(rows.map((row) => row.projectId).filter(Boolean)).size,
216
- contractAmount: round2(rows.reduce((sum, row) => sum + row.contractAmount, 0)),
240
+ contractAmount: round2([...amountByContract.values()].reduce((sum, value) => sum + value, 0)),
217
241
  dueAmount: round2(rows.reduce((sum, row) => sum + row.dueAmount, 0)),
218
242
  receivedAmount: round2(rows.reduce((sum, row) => sum + row.receivedAmount, 0)),
219
243
  unreceivedAmount: round2(rows.reduce((sum, row) => sum + row.unreceivedAmount, 0)),