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
@@ -0,0 +1,198 @@
1
+ import { workflowApiError, workflowValidationError } from '../../errors.js';
2
+ import { WORKFLOW_ENDPOINTS } from '../../endpoints.js';
3
+ import { responseData } from '../shared.js';
4
+ const NODE_PAGE_SIZE = 200;
5
+ const NODE_ID = /^\d+$/u;
6
+ const NAME_WITH_ID = /^(.*?)\s*[((]\s*(\d+)\s*[))]\s*$/u;
7
+ function recordOf(value) {
8
+ return value !== null && typeof value === 'object' && !Array.isArray(value)
9
+ ? value : {};
10
+ }
11
+ function textOf(value) {
12
+ return typeof value === 'string' || typeof value === 'number' ? String(value).trim() : '';
13
+ }
14
+ function tokensOf(value, field) {
15
+ if (value === undefined || value === null || value === '')
16
+ return [];
17
+ if (!Array.isArray(value) && typeof value !== 'string' && typeof value !== 'number') {
18
+ throw workflowValidationError('input_invalid', `${field} 必须是字符串或字符串数组`);
19
+ }
20
+ const values = Array.isArray(value) ? value : [value];
21
+ return values.flatMap(item => String(item).split(',')).map(item => item.trim()).filter(Boolean);
22
+ }
23
+ function browserRows(response) {
24
+ const root = recordOf(responseData(response));
25
+ const data = recordOf(root.data);
26
+ const nested = recordOf(data.data);
27
+ const page = { ...root, ...data, ...nested, ...recordOf(data.page ?? root.page ?? nested.page) };
28
+ const candidates = [nested.data, data.data, root.data, data.list, data.result, data.rows, page.result, root.list, root.result];
29
+ const list = candidates.find(Array.isArray);
30
+ if (!Array.isArray(list)) {
31
+ throw workflowApiError('node_metadata_invalid', '节点浏览接口返回结构异常,无法确认节点名称', {
32
+ details: { endpoint: WORKFLOW_ENDPOINTS.NODE_TREE_BROWSER },
33
+ });
34
+ }
35
+ return {
36
+ rows: list.filter(item => item !== null && typeof item === 'object' && !Array.isArray(item)),
37
+ page,
38
+ };
39
+ }
40
+ function definitionOf(row, inherited = {}) {
41
+ const id = textOf(row.id ?? row.nodeId ?? row.nodeid);
42
+ const name = textOf(row.name ?? row.content ?? row.richContent ?? row.title ?? row.nodeName ?? row.nodename);
43
+ if (!id || !name)
44
+ return null;
45
+ const workflowId = textOf(row.workflowId ?? row.workflowid) || inherited.workflowId || '';
46
+ const workflowName = textOf(row.workflowName ?? row.workflowname) || inherited.workflowName || '';
47
+ return { id, name, ...(workflowId ? { workflowId } : {}), ...(workflowName ? { workflowName } : {}) };
48
+ }
49
+ function pageDefinitions(rows) {
50
+ const definitions = [];
51
+ const visit = (row, inherited) => {
52
+ const children = Array.isArray(row.children) ? row.children : Array.isArray(row.childs) ? row.childs : [];
53
+ const ownWorkflowId = textOf(row.workflowId ?? row.workflowid);
54
+ const ownWorkflowName = textOf(row.workflowName ?? row.workflowname);
55
+ const context = {
56
+ workflowId: ownWorkflowId || inherited.workflowId,
57
+ workflowName: ownWorkflowName || inherited.workflowName,
58
+ };
59
+ if (children.length) {
60
+ for (const child of children) {
61
+ if (child !== null && typeof child === 'object' && !Array.isArray(child)) {
62
+ visit(child, context);
63
+ }
64
+ }
65
+ return;
66
+ }
67
+ const definition = definitionOf(row, context);
68
+ if (definition)
69
+ definitions.push(definition);
70
+ };
71
+ for (const row of rows)
72
+ visit(row, {});
73
+ return definitions;
74
+ }
75
+ async function exactNodeDefinitions(name, env) {
76
+ const found = new Map();
77
+ const related = new Map();
78
+ const seenPages = new Set();
79
+ let readCount = 0;
80
+ for (let pageNo = 1;; pageNo += 1) {
81
+ const response = await env.host.workflowRequest({
82
+ method: 'POST',
83
+ path: WORKFLOW_ENDPOINTS.NODE_TREE_BROWSER,
84
+ operation: 'workflow.todoSmartConvert.resolveNodeName',
85
+ body: {
86
+ showHistory: true,
87
+ belongType: 1,
88
+ workflowIdsCondition: 'in',
89
+ searchValue: name,
90
+ current: pageNo,
91
+ pageNo,
92
+ pageSize: NODE_PAGE_SIZE,
93
+ },
94
+ });
95
+ const { rows, page } = browserRows(response);
96
+ const definitions = pageDefinitions(rows);
97
+ if (rows.length && !definitions.length) {
98
+ throw workflowApiError('node_metadata_invalid', '节点浏览接口返回了缺少节点 ID 或名称的记录', {
99
+ details: { endpoint: WORKFLOW_ENDPOINTS.NODE_TREE_BROWSER, nodeName: name, pageNo },
100
+ });
101
+ }
102
+ readCount += rows.length;
103
+ const signature = definitions.map(item => `${item.id}:${item.workflowId ?? ''}`).join('|');
104
+ if (pageNo > 1 && signature && seenPages.has(signature)) {
105
+ throw workflowApiError('node_metadata_pagination', '节点浏览接口未正确翻页,无法确认全部同名节点', {
106
+ details: { endpoint: WORKFLOW_ENDPOINTS.NODE_TREE_BROWSER, nodeName: name, pageNo },
107
+ });
108
+ }
109
+ if (signature)
110
+ seenPages.add(signature);
111
+ for (const item of definitions) {
112
+ if (item.name.includes(name) || name.includes(item.name)) {
113
+ related.set(`${item.id}:${item.workflowId ?? ''}`, item);
114
+ }
115
+ if (item.name === name)
116
+ found.set(`${item.id}:${item.workflowId ?? ''}`, item);
117
+ }
118
+ const hasNext = typeof page.hasNext === 'boolean' ? page.hasNext : undefined;
119
+ const totalPages = Number(page.totalPages ?? page.pages);
120
+ const totalCount = Number(page.totalCount ?? page.total);
121
+ const responsePageSize = Number(page.pageSize);
122
+ const pageSize = Number.isSafeInteger(responsePageSize) && responsePageSize > 0 ? responsePageSize : NODE_PAGE_SIZE;
123
+ if (hasNext === false || (Number.isSafeInteger(totalPages) && totalPages > 0 && pageNo >= totalPages)
124
+ || (Number.isSafeInteger(totalCount) && totalCount >= 0 && readCount >= totalCount))
125
+ break;
126
+ const expectsMore = hasNext === true || (Number.isSafeInteger(totalPages) && pageNo < totalPages)
127
+ || (Number.isSafeInteger(totalCount) && readCount < totalCount);
128
+ if (expectsMore) {
129
+ if (!rows.length || pageNo >= 100) {
130
+ throw workflowApiError('node_metadata_pagination', '节点浏览接口分页数量与返回数据不一致,无法确认全部同名节点', {
131
+ details: { endpoint: WORKFLOW_ENDPOINTS.NODE_TREE_BROWSER, nodeName: name, pageNo, readCount, totalCount },
132
+ });
133
+ }
134
+ continue;
135
+ }
136
+ if (rows.length < pageSize)
137
+ break;
138
+ if (pageNo >= 100) {
139
+ throw workflowApiError('node_metadata_pagination', '节点浏览接口分页超过安全上限,无法确认全部同名节点', {
140
+ details: { endpoint: WORKFLOW_ENDPOINTS.NODE_TREE_BROWSER, nodeName: name },
141
+ });
142
+ }
143
+ }
144
+ return { exact: [...found.values()], candidates: [...related.values()] };
145
+ }
146
+ /** 将节点 ID / 名称统一解析成标准列表只接受的节点 ID 条件。 */
147
+ export async function resolveTodoNodeFilter(args, env) {
148
+ const explicitIds = [];
149
+ const requestedNames = tokensOf(args.nodeName, 'nodeName');
150
+ if (args.nodeName !== undefined && !requestedNames.length) {
151
+ throw workflowValidationError('node_name_required', '请说明要查询的节点名称');
152
+ }
153
+ for (const token of tokensOf(args.nodeId, 'nodeId')) {
154
+ const withId = NAME_WITH_ID.exec(token);
155
+ if (withId)
156
+ explicitIds.push(withId[2]);
157
+ else if (NODE_ID.test(token))
158
+ explicitIds.push(token);
159
+ else
160
+ requestedNames.push(token);
161
+ }
162
+ const names = [...new Set(requestedNames)];
163
+ if (names.length && args.nodeIdTerm === 'notin') {
164
+ throw workflowValidationError('node_name_notin_unsupported', '按节点名称查询不支持 nodeIdTerm=notin,请改用明确的节点 ID 排除');
165
+ }
166
+ if (!names.length) {
167
+ if (!explicitIds.length)
168
+ return { args, named: false };
169
+ const nodeIds = [...new Set(explicitIds)];
170
+ const { nodeName: _nodeName, ...rest } = args;
171
+ const resolution = {
172
+ requestedNames: [], nodeIds, matchedDefinitions: [], nodeDefinitionCount: nodeIds.length,
173
+ };
174
+ return { args: { ...rest, nodeId: nodeIds.join(',') }, resolution, named: false };
175
+ }
176
+ const resolvedNames = await Promise.all(names.map(name => exactNodeDefinitions(name, env)));
177
+ const matchedDefinitions = resolvedNames.flatMap(item => item.exact);
178
+ const matchedNames = new Set(matchedDefinitions.map(item => item.name));
179
+ const missing = names.filter(name => !matchedNames.has(name));
180
+ if (missing.length) {
181
+ const candidates = [...new Map(resolvedNames.flatMap(item => item.candidates)
182
+ .map(item => [`${item.id}:${item.workflowId ?? ''}`, item])).values()].slice(0, 20);
183
+ throw workflowValidationError('node_name_not_found', `未找到节点:${missing.join('、')}`, {
184
+ nodeNames: missing,
185
+ ...(candidates.length ? { candidates } : {}),
186
+ });
187
+ }
188
+ const uniqueDefinitions = [...new Map(matchedDefinitions.map(item => [`${item.id}:${item.workflowId ?? ''}`, item])).values()];
189
+ const nodeIds = [...new Set([...explicitIds, ...uniqueDefinitions.map(item => item.id)])];
190
+ const resolution = {
191
+ requestedNames: names,
192
+ nodeIds,
193
+ matchedDefinitions: uniqueDefinitions,
194
+ nodeDefinitionCount: nodeIds.length,
195
+ };
196
+ const { nodeName: _nodeName, ...rest } = args;
197
+ return { args: { ...rest, nodeId: nodeIds.join(',') }, resolution, named: true };
198
+ }
@@ -36,7 +36,7 @@ function displayRows(response) {
36
36
  return rows;
37
37
  }
38
38
  /** 准备原生查询,并用同条件标准列表生成有界分布;不收窄时间、不生成摘要或汇总ID。 */
39
- export async function prepareTodoQuery(args, env) {
39
+ export async function prepareTodoQuery(args, env, nodeResolution) {
40
40
  const category = readCategory(args.category);
41
41
  const requestedLimit = args.limit === undefined || args.limit === null || args.limit === '' ? QUERY_MAX_LIMIT : args.limit;
42
42
  const policy = readCollectPolicy('query', requestedLimit);
@@ -50,7 +50,7 @@ export async function prepareTodoQuery(args, env) {
50
50
  && String(searchArgs[key]).trim() !== '');
51
51
  if (!explicitTab)
52
52
  searchArgs.tabid = DEFAULT_TABID;
53
- if (searchArgs.isremarks === undefined) {
53
+ if (searchArgs.isremarks === undefined && !nodeResolution) {
54
54
  const defaultIsremarks = generalRules()?.identityFilter?.defaultIsremarks?.trim();
55
55
  if (defaultIsremarks)
56
56
  searchArgs.isremarks = defaultIsremarks;
@@ -146,12 +146,14 @@ export async function prepareTodoQuery(args, env) {
146
146
  category, requestedLimit: policy.limit, totalAvailable: total,
147
147
  filters: Object.fromEntries(Object.entries(searchArgs).filter(([key]) => !['category', 'tabid', 'sort'].includes(key))),
148
148
  listQuery,
149
+ ...(nodeResolution ? { nodeResolution } : {}),
149
150
  ...(categoryCounts ? { categoryCounts } : {}),
150
151
  ...(sort ? { sort } : {}),
151
152
  },
152
153
  totalCount: total,
153
154
  distribution: { items: [...counts.values()], readCount: seen.size, totalCount: total, complete, truncated: !complete },
154
155
  markdown: total === null ? '查询条件已准备,数量待列表返回。' : `查询条件已准备,匹配${total}条待办。`,
156
+ ...(nodeResolution ? { nodeResolution } : {}),
155
157
  ...(warnings?.length ? { warnings } : {}),
156
158
  };
157
159
  }
@@ -0,0 +1,70 @@
1
+ import { WORKFLOW_ENDPOINTS } from '../../endpoints.js';
2
+ import { workflowApiError, workflowClarificationError } from '../../errors.js';
3
+ import { asString, parseNameWithId, responseData } from '../shared.js';
4
+ /** 只从当前会话可访问的直属下属中匹配;确认重名候选后传入的 ID 也须重新校验。 */
5
+ export async function resolveTodoSubordinate(input, env) {
6
+ const { name, id } = parseNameWithId(asString(input) ?? '');
7
+ if (!name) {
8
+ throw workflowClarificationError('subordinate', '', '请问您要查询哪位下属的待办?', [], {
9
+ clarificationReason: 'subordinate_required', missingInput: ['subordinateName'],
10
+ });
11
+ }
12
+ const session = await env.host.getSession();
13
+ const employeeId = session.userId.trim();
14
+ if (!/^\d+$/u.test(employeeId)) {
15
+ throw workflowApiError('current_employee_missing', '当前会话无法确认您的人员 ID,无法查询下属待办');
16
+ }
17
+ const matches = new Map();
18
+ for (let pageNo = 1;; pageNo += 1) {
19
+ const response = await env.host.workflowRequest({
20
+ method: 'GET', path: `/api/bs/hrm/user/myDirectSubordinates/${employeeId}`,
21
+ operation: 'workflow.todoSmartConvert.subordinate',
22
+ query: { id: employeeId, pageNo, pageSize: 10, virtualId: '1', username: name, isMobile: false },
23
+ headers: { Referer: `${session.baseUrl.replace(/\/+$/u, '')}/sp/hrm/profileInfo/${employeeId}` },
24
+ });
25
+ const data = responseData(response);
26
+ if (data?.hasRight !== true) {
27
+ throw workflowApiError('subordinate_no_right', '当前会话没有查看直属下属的权限', { code: 403 });
28
+ }
29
+ const page = data.page;
30
+ if (!Array.isArray(page?.result)) {
31
+ throw workflowApiError('unexpected_response', '直属下属查询返回结构异常');
32
+ }
33
+ for (const row of page.result) {
34
+ if (asString(row?.username) !== name)
35
+ continue;
36
+ // 人员 ID 使用字符串,保留长整型精度。
37
+ const rowId = typeof row.employeeId === 'string' ? row.employeeId : row.id;
38
+ if (typeof rowId !== 'string' || !/^\d+$/u.test(rowId) || rowId === employeeId)
39
+ continue;
40
+ const candidate = { id: rowId, name, department: asString(row.department?.name) };
41
+ if (id === rowId)
42
+ return candidate;
43
+ matches.set(rowId, candidate);
44
+ }
45
+ if (page.result.length === 0 || !(page.hasNext || (page.totalPages ?? 0) > pageNo))
46
+ break;
47
+ }
48
+ const candidates = [...matches.values()];
49
+ if (!id && candidates.length === 1)
50
+ return candidates[0];
51
+ if (!candidates.length || id) {
52
+ throw workflowClarificationError('subordinate', name, `未找到可查询的直属下属「${name}」,请确认姓名。`);
53
+ }
54
+ throw workflowClarificationError('subordinate', name, `有多位直属下属名为「${name}」,请确认具体人员。`, candidates.map(({ id: candidateId, name: candidateName, department }, index) => ({
55
+ id: candidateId, name: candidateName, index: index + 1,
56
+ label: department ? `${candidateName} · ${department}` : candidateName,
57
+ display: `${candidateName}(${candidateId})`,
58
+ })));
59
+ }
60
+ /** 查询、分布和候选计数统一使用下属 ID 路径,保留原生查询报文。 */
61
+ export function scopeTodoSubordinate(env, subordinate) {
62
+ const { host } = env;
63
+ const paths = [WORKFLOW_ENDPOINTS.TODO_LIST, WORKFLOW_ENDPOINTS.TODO_TOTAL, WORKFLOW_ENDPOINTS.TODO_TREE];
64
+ return { ...env, host: {
65
+ workflowRequest: request => host.workflowRequest(paths.includes(request.path)
66
+ ? { ...request, path: `${request.path}/${subordinate.id}` } : request),
67
+ workflowBinaryRequest: request => host.workflowBinaryRequest(request),
68
+ getSession: () => host.getSession(),
69
+ } };
70
+ }
@@ -5,6 +5,7 @@ import { responseData } from '../shared.js';
5
5
  import { DEFAULT_TABID } from './todoSmartConvert.core.js';
6
6
  import { generalRules } from './aigroupRules.js';
7
7
  const COUNT_CONCURRENCY = 4;
8
+ const DISCONTINUED_WORKFLOW_NAME = /废弃|作废|停用|失效|已下线/u;
8
9
  function recordOf(value) {
9
10
  return value !== null && typeof value === 'object' && !Array.isArray(value)
10
11
  ? value : {};
@@ -162,6 +163,15 @@ export async function enrichWorkflowClarification(error, args, env) {
162
163
  }
163
164
  if (candidates.length < 2)
164
165
  return error;
166
+ const selectable = candidates.filter(candidate => !DISCONTINUED_WORKFLOW_NAME.test(candidate.name));
167
+ if (selectable.length === 0) {
168
+ const question = '匹配到的工作流名称均带废弃或停用标识,请提供当前使用的工作流名称。';
169
+ return new WorkflowCliError(error.type, error.subtype, question, {
170
+ code: error.code, retryable: error.retryable, stage: error.stage, exitCode: error.exitCode,
171
+ partialData: error.partialData,
172
+ details: { ...details, clarificationQuestion: question, clarificationReason: 'workflow_discontinued', candidates: [] },
173
+ });
174
+ }
165
175
  const nameRequests = new Map();
166
176
  const scopedEnv = {
167
177
  ...env,
@@ -181,11 +191,11 @@ export async function enrichWorkflowClarification(error, args, env) {
181
191
  getSession: () => env.host.getSession(),
182
192
  },
183
193
  };
184
- const queries = await mapLimited(candidates, candidate => buildCandidateQuery(candidate, args, scopedEnv));
194
+ const queries = await mapLimited(selectable, candidate => buildCandidateQuery(candidate, args, scopedEnv));
185
195
  // Only this enrichment shares counts: never reuse results across commands, filters or users.
186
196
  const countRequests = new Map();
187
197
  const [types, counts] = await Promise.all([
188
- candidates.some(candidate => !candidate.workflowTypeName) ? loadWorkflowTypes(queries, env) : Promise.resolve(new Map()),
198
+ selectable.some(candidate => !candidate.workflowTypeName) ? loadWorkflowTypes(queries, env) : Promise.resolve(new Map()),
189
199
  mapLimited(queries, query => {
190
200
  if (query.body === null)
191
201
  return Promise.resolve(null);
@@ -198,7 +208,7 @@ export async function enrichWorkflowClarification(error, args, env) {
198
208
  return pending;
199
209
  }),
200
210
  ]);
201
- const enriched = candidates.map((candidate, index) => ({
211
+ const enriched = selectable.map((candidate, index) => ({
202
212
  ...candidate, workflowTypeName: candidate.workflowTypeName ?? types.get(candidate.id) ?? null, totalCount: counts[index],
203
213
  })).filter(candidate => candidate.totalCount !== 0);
204
214
  enriched.sort((left, right) => {
@@ -214,8 +224,8 @@ export async function enrichWorkflowClarification(error, args, env) {
214
224
  });
215
225
  const excluded = candidates.length - enriched.length;
216
226
  const question = excluded === 0 ? error.message : enriched.length === 0
217
- ? `匹配到的${candidates.length}个工作流在当前筛选条件下均无待办,无需选择。`
218
- : `已排除当前筛选条件下没有待办的工作流,请确认要查询的工作流(剩余${enriched.length}项)。`;
227
+ ? `保留的${selectable.length}个工作流在当前筛选条件下均无待办,无需选择。`
228
+ : `已排除无待办或名称带废弃标识的工作流,请确认要查询的工作流(剩余${enriched.length}项)。`;
219
229
  return new WorkflowCliError(error.type, error.subtype, question, {
220
230
  code: error.code, retryable: error.retryable, stage: error.stage, exitCode: error.exitCode,
221
231
  partialData: error.partialData,
@@ -8,6 +8,10 @@
8
8
  - `skills/weaver-e10-yepiaotong/SKILL.md`:业票通入口路由。
9
9
  - `skills/weaver-e10-yepiaotong/references/`:按 schema、查询、文件预览、流程发票字段、报销、开票、写入和暂缓能力拆分的具体说明。
10
10
 
11
+ **AI 报销相对时间最高优先级**:涉及“今天、本月、上个月、上周、最近 30 天、近一日历月”等相对时间时,必须先通过宿主时间工具或本机系统时钟读取本次实时当前时刻,转换为北京时间 `Asia/Shanghai` 后再推算日期及年份;不把示例、历史记录、记忆或旧会话中的年份当作当前年。同一操作的查询、翻页、校验、标题及汇总复用这一次新鲜基准;新的报销操作、用户新增或更改相对时间条件,或跨越北京时间日界时重新取时。取不到实时系统时间时暂停相关日期推算。
12
+
13
+ 时间口径:上个月是上一自然月的首日至末日;上周是上一周周一至周日;最近 30 天是北京时间今天及前 29 天,含首尾;近一日历月是从北京时间今天回溯一个日历月至今天,上月无对应日取上月末,不能与最近 30 天混用。跨月、跨年按实际日历计算,不凭印象填写年份。
14
+
11
15
  ## 准备
12
16
 
13
17
  ```text
@@ -54,9 +58,21 @@ weaver-work-cli --json invoice run invoice.list --input-json '{"page_size":10,"s
54
58
 
55
59
  ## 推荐工作流
56
60
 
61
+ 出差报销查票按 reim-travel-invoice-matching.md 覆盖从出发到返程的完整行程,逐项匹配出发接驳、往返城际及退改签、目的地交通、返程接驳、自驾通行 / 过桥 / 停车、住宿餐饮及符合已知制度的租车 / 行李托运等。根据实际路线、中转 / 途经地、消费 / 服务日期及用途判断,不只按起终点两个城市筛票;按 fid 去重、排除已挂单并展示阶段、依据及待确认项。缺凭证的相关票可先列候选,选票和申请匹配后仍须通过真实关联校验。
62
+
63
+ AI 报销事前申请:已提交并处于审批中的申请即可使用,审批完成同样有效,不必等待审批通过或流程结束;草稿 / 未提交不可用。仍须核验本人归属、工作流类型、用途及适用日期,不只接受 `flowStatus=6`。候选池 `complete` 表示数据读取完整,不代表申请已审批完成。
64
+
65
+ 福利报销即话费 / 油费福利费报销,走 `reim-phone-subsidy-rules.md`;仅说福利时两类分别查票处理,没有相关可报发票就提示并结束,空类不继续查询申请或额度。
66
+
67
+ 凭证与餐饮票种按 reim-eligibility-rules.md:差旅滴滴及其他网约车必须关联对应行程单,酒店 / 宾馆住宿必须关联对应住宿结账单(水单),通行类沿用票据汇总单;非差旅按原凭证范围执行,普通巡游出租车、公交 / 地铁及城际交通不新增行程单。餐饮仍须普通发票,只有合法匹配业务招待046的餐饮强制小票,其他合规非招待餐饮免小票。凭证须在本张 travel_ids 中真实关联且用途对应,发票自身附件、未关联的上传文件、预订单或单纯支付截图不能代替差旅必需凭证;不符合时暂停所选批次,不能交付报销页面。实际租车服务不要求关联凭证,不因 travel_ids 为空拦截,也不套用网约车行程单门槛;其他报销条件按实际场景执行。
68
+
69
+ 事前申请按 `reim-preapproval-rules.md` 先核验发票标签 / 登记关联的申请;无有效登记才查最近一个月的对应类型申请,多条让用户选、无则暂停报销并提醒先创建提交申请;下述外出补建分支仍可准备申请页面。出差用泛微出差 / 外出,话费用话费补贴,油费用私车公用补贴,团建 / 聚餐用员工活动费,业务招待用业务招待,垫付 / 借款用借款申请。普通报销页面的相关客户、相关项目、相关发票、相关事前申请流程四项都必须显式填写真实值,员工活动、餐饮、借款及其他普通费用均无省略例外;缺真实关联或候选未选定先补齐并暂停,不编造对象。补贴专用提交、仅上传登记、开票及补建申请页面仍按各自规则。
70
+
71
+ 差旅、打车、住宿、通行费未找到适用事前申请时,提醒创建并提交 `出差/外出流程(100003460000000746)`,按 `travel-application-fill.md` 复用报销页面预填方式:读取真实字段,集中补齐起始日期、结束日期、出差原因、是否本地出差、出差 / 外出类型、客户服务方式,选项按真实 `options` ID 填写。先展示申请汇总,再交付完整页面指令,用户在页面核对保存并提交;报销保持暂停,不能把预填或草稿当作已提交申请。
72
+
57
73
  处理“把这张发票录入业票通”的典型流程:
58
74
 
59
- 1. 提醒用户文件会上传到 E10 业票通做识别和查验,用户明确确认后再继续。
75
+ 1. 直接处理用户已要求录入的指定文件,不追加文件处理风险提示或二次确认;业票通的文件处理授权按本模块规则执行。
60
76
  2. 每个文件执行一次 `invoice.upload-and-validate`,一步完成上传、OCR 识别、查验并进个人票夹。
61
77
  3. 按返回的 `invoices[]` 逐张报告:`ret.ret=0` 为识别并查验成功;非 0 时报告 `ret.message`,`fid` 非空说明已进票夹但查验没通过,`fid` 为空说明没进票夹。号码用 `detailUrl` 做链接。
62
78
 
@@ -64,7 +80,17 @@ weaver-work-cli --json invoice run invoice.list --input-json '{"page_size":10,"s
64
80
 
65
81
  删除、编辑、新增同样必须使用 `prepare -> apply`。出现 `partial/write_uncertain` 时停止,不能自动重试写操作。
66
82
 
67
- 处理“把发票填进流程表单”的场景,直接复用本次已选发票,以 `[{id,name}]` 引用数组填写;无需额外转换调用。处理“报销发票/自动填单”时,先读取 `invoice-reim.md`,用报销相关只读 operation(`invoice.reim.candidates.list`、`invoice.reim.requests.list`、`invoice.reim.workflow.resolve`、`invoice.reim.employee-superiors`、`invoice.reim.field.search`、`invoice.reim.relation.list`)获取候选发票、事前申请、工作流、人员上级和相关客户/项目,其中 `invoice.reim.relation.list` 读回发票上传时登记的相关客户、相关项目、事前申请,登记过的直接用、不再问用户;发票上传成功后(`invoice.import.apply`、`invoice.upload-and-validate`、`invoice.add.apply`),仅上传 / 录入且无报销意图时,识别查验完后同一批先只问一次要不要登记(这时不查数据),用户同意后再按类别采集(话费 / 油费用 `weaver-e10-workflow` 的 `workflow.search` 从最近的报销单找出事前申请,找不到给出发起链接;差旅 / 打车 / 滴滴问相关项目和事前申请;其他问相关客户、相关项目、事前申请),用 `invoice.reim.relation.save` 登记,它失败不重试、不影响上传;报销意图下不问登记、不采集登记数据,只读已有登记,见 `invoice-reim-relation.md`;报销单的载入、创建和修改统一走 `weaver-e10-workflow`:`workflow.createForm` 载入表单,`workflow.createRequest`(`action` 固定 `draft`)存草稿,修改走 `workflow.editLoad` / `workflow.editPrepare` / `workflow.editApply`。旧的 `invoice.reim.flow.create/update.*` 已移除,不要再调用。处理“开票 / 待开票合同”时读取 `invoice-issuing-workflow.md`:先用 `weaver-e10-workflow` 的 `workflow.search` 查出当前用户有权限看的合同审批流程,再把 `data.cards` 传给 `invoice.issuing.contracts.list` 补齐是否开票、合同号、客户名称和开票金额,列出待开票合同;用户选定后用 `invoice.issuing.contract.detail` 取合同客户与合同正文文档 id,按销售方选开票申请流程,问清预计收款时间并确认后用 `workflow.createForm` / `workflow.createRequest`(`action` 固定 `draft`)存草稿。当前修正资料包没有客户档案查询或红字发票红冲接口,`invoice.customer.*` 和 `invoice.red.*` 不能调用或绕过。
83
+ 处理“把发票填进流程表单”的场景,从本次已选发票取得业务 fid,页面相关发票字段逐项编码为 `##fid` 后用英文分号分行,单张也须加前缀,不以浏览按钮归类为条件;不为此额外查询详情。处理“报销发票/自动填单”时,先读取 `reim-workflow.md`,用报销相关只读 operation(`invoice.reim.candidates.list`、`invoice.reim.requests.list`、`invoice.reim.workflow.resolve`、`invoice.reim.customer.search`、`invoice.reim.relation.list`)获取候选发票、事前申请、工作流和相关客户/项目,其中 `invoice.reim.relation.list` 读回发票上传时登记的相关客户、相关项目、事前申请,登记申请优先核验类型与提交状态,客户经统一查询确认,项目从该客户本行relatedProject选择,已有明确取值不重复问;发票上传成功后(`invoice.import.apply`、`invoice.upload-and-validate`、`invoice.add.apply`),仅上传 / 录入且无报销意图时,识别查验完后同一批先只问一次要不要登记(这时不查数据),用户同意后再按类别采集(话费 / 油费用 `weaver-e10-workflow` 的 `workflow.search` 从最近的报销单找出事前申请,找不到给出发起链接;差旅 / 打车 / 滴滴问相关项目和事前申请;其他问相关客户、相关项目、事前申请),用 `invoice.reim.relation.save` 登记,它失败不重试、不影响上传;报销意图下不问登记、不采集登记数据,只读已有登记,见 `invoice-reim-relation.md`;普通报销按主流程的查票、填单、已保存修改阶段读取对应段落,上传登记说明仅无报销意图时加载;依赖契约用到时补齐、已读复用。普通报销使用 `workflow.createRequestDirect` 只读字段(明细以 `isDetail` 标记),按技能页面契约保留完整 arguments.sdkOptions,四项关联在 params.customParams、fieldAssignKeys 及 src 显式填值,即使与默认相同也不省略;由 Agent 按 reim-fill-validation.md 逐项核对通过后,先展示本次填写汇总,再输出完整 browsertool 标签及 JSON(含闭合标签);标签不包代码块,闭合后不追加文字,由用户在页面核对保存;已保存单据修改走 `workflow.editLoad` / `workflow.editPrepare` / `workflow.editApply`。旧的 `invoice.reim.flow.create/update.*` 已移除,不要再调用。处理“开票 / 待开票合同”时读取 `invoice-issuing-workflow.md`:先用 `weaver-e10-workflow` 的 `workflow.search` 查出当前用户有权限看的合同审批流程,再把 `data.cards` 传给 `invoice.issuing.contracts.list` 补齐是否开票、合同号、客户名称和开票金额,列出待开票合同;用户选定后用 `invoice.issuing.contract.detail` 取合同客户与合同正文文档 id,按销售方选开票申请流程,问清预计收款时间并确认后用 `workflow.createRequestDirect` 取字段并输出开票申请预填页面,用户核对保存。客户档案查询 `invoice.customer.*` 以及税务端实际开红票、红字发票查询和确认的 `invoice.red.*` 仍不能调用或绕过。
84
+
85
+ 发票语境下的“退票 / 红冲 / 开错票了 / 开红票”读取 `invoice-red-workflow.md`。客户名称缺失时先询问,已有名称直接传 `customerName` 给 `invoice.issuing.red.requests.list`,固定查询普通开票申请 `100003460000000214`;不把示例客户名称写成固定条件。多条候选展示真实标题、状态等供用户选择,唯一项回显采用,零条停止;保留原客户名称翻页,不自动换词或扩大工作流,不因审批中或已结束自行排除。所选 `requestId` 是蓝字开票申请流程 ID。对固定 `合同开票冲红流程(887410479139758085)` 用 `workflow.createRequestDirect` 取得真实字段,按名称定位可写主表字段“蓝字发票开票流程”,仅填 `##requestId`,`src` 对应 `%23%23requestId`,其他字段交给默认值或联动;不调用普通开票的合同详情,不采集预计收款日期或按销售方分流。先展示填写汇总,再输出完整 `browsertool`,由用户核对保存,不自动保存或提交,也不宣称已完成红冲。机票 / 火车票退票和退票费报销按原业务处理。
86
+
87
+ 报销页面逐票对齐:当前组 N 张正式发票对应 N 个完整的 `##fid`,每个 fid 独立加前缀后用英文分号分行,不以浏览按钮标记为条件。相关事前申请流程同样逐票传 N 个 `##requestId`,相同申请也重复,例如 4 张票传 `##A;##A;##A;##A`;不因字段位于主表而只传一个值,不使用逗号或开头顿号。客户、项目和承担主体各只传单一 `##真实ID`,即使元数据标记为多选或明细,也不扩成逗号或分号多值串。若真实元数据无法承载该格式,说明并暂停,不擅自改写。无需填写的字段按业务规则处理,不构造占位数据,其余联动列不新增赋值。交付前由 Agent 按 `reim-fill-validation.md` 逐项核对四项真实关联、完整 `arguments.sdkOptions`、URL 正确转义后与 `customParams` 同值同序,以及 `fieldAssignKeys` 完整;核对通过后交付同一份页面 JSON。
88
+
89
+ 报销生成输出在交付前按 reim-workflow.md 的输出检查清理无业务含义的格式残留,避免额外添加下划线紧接美元符号的组合及其转义装饰;只清理模型新增装饰,不更改真实字段 ID、业务原值、金额和合法编码。
90
+
91
+ AI 报销页面浏览 / 引用字段使用带 `##` 前缀的真实 ID,`src` 中对应 `%23%23真实ID`,URL 解码后与 `customParams` 同值。客户、项目、承担主体各严格单值,不传裸 ID,不使用逗号或分号拼接多个 ID;发票和相关事前申请流程按 N 张正式发票逐项加前缀、用英文分号分行,相同申请也逐票重复 N 次。客户名、项目名、承担主体名和流程标题仅用于候选及汇总,不附加到 ID 后,也不直接使用登记 `value` 的 `名称(ID)` 展示串。保留完整 SDK;实际登记 API 的名称字段和查询返回结构不因页面编码改变。
92
+
93
+ 客户、相关项目及承担主体统一用invoice.reim.customer.search,只传客户名称keywords。多客户先选客户,再只使用该客户本行relatedProject及承担主体,不跨客户合并;项目失败null+projectsError不当零条。只有项目名称或登记只有项目时先补所属客户,未在本客户列表的项目需核实客户或改选候选,不再按项目名或独立历史查询。普通报销各场景客户及项目均必填,多项目手动选,无项目或不完整先补齐;福利专用提交和登记原搜索次数、授权及采集规则保留。
68
94
 
69
95
  ## 暂缓能力
70
96
 
package/docs/invoice.md CHANGED
@@ -6,6 +6,10 @@
6
6
 
7
7
  面向 Agent 的说明位于 `skills/weaver-e10-yepiaotong`。入口 `SKILL.md` 只负责共享规则和 reference 路由;具体细节拆在 `skills/weaver-e10-yepiaotong/references/`,与飞书 CLI 的业务 Skill 组织方式保持一致。
8
8
 
9
+ **AI 报销相对时间最高优先级**:涉及“今天、本月、上个月、上周、最近 30 天、近一日历月”等相对时间时,Agent 必须先通过宿主时间工具或本机系统时钟读取本次实时当前时刻,转换为北京时间 `Asia/Shanghai` 后再推算日期及年份;不把示例、历史记录、记忆或旧会话中的年份当作当前年。同一操作的查询、翻页、校验、标题及汇总复用这一次新鲜基准;新的报销操作、用户新增或更改相对时间条件,或跨越北京时间日界时重新取时。取不到实时系统时间时暂停相关日期推算。
10
+
11
+ 时间口径:上个月是上一自然月的首日至末日;上周是上一周周一至周日;最近 30 天是北京时间今天及前 29 天,含首尾;近一日历月是从北京时间今天回溯一个日历月至今天,上月无对应日取上月末,不能与最近 30 天混用。跨月、跨年按实际日历计算,不凭印象填写年份。
12
+
9
13
  ## 公共前置
10
14
 
11
15
  先通过 E10 鉴权模块登录:
@@ -30,6 +34,8 @@ Agent 不得在业务 JSON 中传 `access_token`、`app_key`、`app_secret`、Co
30
34
 
31
35
  优先使用 `invoice run <operation>`:
32
36
 
37
+ 业票通按用户已明确的上传、识别、查验、导入或报销 / 开票请求,直接处理本任务指定文件,不追加文件处理风险提示或二次确认。本模块按 [文件处理规则](../skills/weaver-e10-yepiaotong/SKILL.md#4-附件图片和文件处理) 覆盖共享技能的通用文件处理确认要求;可选关联登记及 `prepare -> apply` 等业务确认仍按各自规则。
38
+
33
39
  Windows PowerShell:
34
40
 
35
41
  ```powershell
@@ -52,12 +58,28 @@ weaver-work-cli --json invoice list --fields number,detailUrl
52
58
 
53
59
  当前输出层把完整 JSON 直接写 stdout。0.1.17 起可用 `--view summary`(列表语义平表,仅 `invoice.list` / `invoice.enterprise.list` 支持)与 `--fields a,b.c`(点路径投影,所有 operation 可用)裁剪输出——两者互斥,只影响输出、不改变请求参数;仍不提供飞书 CLI 的 `--jq`、`--format table/ndjson` 或通用 `--page-all`。Agent 使用时应默认小页读取和摘要渲染:列表先 `page_size=10`,按 `start_pos` 继续;回复只展示关键字段和数量,超长详情/OCR/调试 JSON 落本地文件后给路径。
54
60
 
55
- 票面扩展信息 `ext`(费用说明、城市、备注、起止地、上下车站点)对报销按城市 / 行程筛票很关键。`/api/inc/sync` 的 `mext` 按位选择返回哪些 `ext` 字段,不传就不返回 `ext`,所以 `invoice.list` / `invoice.enterprise.list` 默认传 `mext=2147483647` 取回完整 `ext`(调用方显式传的 `mext` 优先)。每条发票保留原始 `ext` 字符串,另加解析好的 `extInfo`(`expenseNote`、`content`、`city`、`province`、`comment`、`from`、`to`、`stationGetOn`、`stationGetOff`,空值省键);`--view summary`、`--view detail` 把这些字段平铺展示。提取逻辑在 `src/shortcuts/invoice/invoice-record.ts`,列表项是 `{ info, ret }` 包装时也能识别。
61
+ 票面扩展信息 `ext`(费用说明、城市、备注、起止地、上下车站点)对报销按城市 / 行程筛票很关键。`/api/inc/sync` 的 `mext` 按位选择返回哪些 `ext` 字段,不传就不返回 `ext`,所以 `invoice.list` / `invoice.enterprise.list` 默认传 `mext=2147483647` 取回完整 `ext`(调用方显式传的 `mext` 优先)。每条发票保留原始 `ext` 字符串,另加解析好的 `extInfo`(`expenseNote`、`content`、`city`、`province`、`comment`、`from`、`to`、`stationGetOn`、`stationGetOff`、`userId`、`passengerName`,空值省键);`--view summary`、`--view detail` 把这些字段平铺展示。提取逻辑在 `src/shortcuts/invoice/invoice-record.ts`,列表项是 `{ info, ret }` 包装时也能识别。
62
+
63
+ 乘车人信息统一取 `ext.userId`(滴滴乘车人身份证号)和 `ext.passengerName`(乘车人姓名),仅从这两个真实字段提取,不与登录用户或票夹所有者混用。完整列表在 `items[].extInfo`(包装项为 `items[].info.extInfo`)返回,完整详情在 `infos[].info.extInfo` 返回;`summary` / `detail` 视图平铺为 `items[].userId`、`items[].passengerName`。身份证号保持字符串(保留前导零与末尾 `X`),缺失 / 空值省略;无须额外查询乘车人或逐票详情。
64
+
65
+ 列表和详情在 `data.employeeInfo` 独立返回当前登录人员信息:`department`(部门)、`mobile`(手机号)、`location`(办公所在地)。部门和所在地数组每项仅保留 `{id,name}`,手机号原样保留,包括脱敏值,缺失为 `null`;不保留卡片其他业务或前端元数据,也不重复放入发票明细。CLI 使用公共 E10 会话对 `/api/bs/hrm/card/get/{当前登录userId}` 发起一次只读请求,与票据 / 字典并行,超时 5 秒,不携带业票通专用 Token;接口不可用时 `employeeInfo=null`、附 `warnings`,保留成功发票,认证失败正常报错。完整输出和 `summary` / `detail` 均保留这个对象。
66
+
67
+ `invoice.reim.candidates.list` 同样在顶层返回 employeeInfo,整条自动分页命令只查询一次人员卡片,与第一页发票并行;逐票保留 extInfo 和真实存在的消费秒级 consumptionTime。出差报销按 reim-travel-invoice-matching.md,从出发到返程逐项识别七类相关费用:出发接驳、往返城际及退改签、目的地交通、返程接驳、自驾通行 / 过桥 / 停车、住宿餐饮,以及符合已知公司制度的租车 / 行李托运等。复用真实路线、中转 / 途经地及实际发生 / 服务日期,不只匹配两个城市。按 fid 去重、排除已挂单,标明阶段、依据和待确认项;候选由用户选定后仍须申请、客户和凭证校验。
56
68
 
57
69
  发票列表(个人 / 企业)和详情均返回 `id`,值与同一条发票的 `fid` 完全一致。完整列表输出位于 `items[].id`(包装项位于 `items[].info.id`),完整详情位于 `infos[].info.id`;`--view summary` / `--view detail` 的 `items[]` 同时包含 `id` 和 `fid`。
58
70
 
71
+ 列表和详情的完整 / 语义视图同时返回 `fyn`(费用类型中文名称)和 `travel_ids`(相关凭证列表,无关联为 `[]`)。完整输出保留原 `fylx` ID;CLI 对每次查询并行调用一次 `/api/inc/syncFylx`(`start_pos=0,page_size=200,uc=0,mask=1023`),整批按 `fyid → fyn` 映射,不逐张查字典或补查凭证。辅助字典超时为 5 秒;字典故障或未匹配时名称为 `null` 并附 envelope `warnings`,发票与凭证继续返回,认证及主请求错误仍报错。并行请求共用正在获取的发票 Token,避免冷启动重复换取。`travel_ids` 与发票自身附件分开,保留服务端的凭证 ID、文件、金额、日期与状态,不重复计入发票合计。
72
+
73
+ AI 报销规则以 `reim-preapproval-rules.md`、`reim-eligibility-rules.md` 及 `reim-customer-search.md` 为准:查票时一并返回普通事前申请池,先核验登记申请,无有效登记才筛选随票最近一个月适用类型候选,多条由用户选、无则提醒创建并暂停;差旅 `746`、员工活动 `418`、招待 `046`、借款 / 垫付 `045` 分别匹配完整固定 ID。申请确认后,差旅中的滴滴及其他网约车须关联对应行程单,酒店 / 宾馆住宿须关联对应住宿结账单(水单);非差旅按原凭证范围执行。通行 / 过路费沿用票据汇总单,普通巡游出租车、公交 / 地铁及城际交通不新增行程单;七类行程费用仍须适用申请。仅 `046` 餐饮强制小票,其他合规非招待餐饮免相关凭证;所有餐饮仍只允许普通发票。普通报销各场景的客户、项目、发票及事前申请四项都须真实值并显式填写,员工活动及其他费用均不能省略;缺真实关联先补齐并暂停。福利话费 / 油费沿用专项且无合规票即停。实际租车服务不要求关联凭证,不因 travel_ids 为空拦截,也不套用网约车行程单门槛;其他报销条件按实际场景执行。
74
+
59
75
  ## Operation 目录
60
76
 
77
+ AI 报销事前申请:已提交并处于审批中的申请即可使用,审批完成同样有效,不必等待审批通过或流程结束;草稿 / 未提交不可用。仍须核验本人归属、工作流类型、用途及适用日期,不只接受 `flowStatus=6`。候选池 `complete` 表示数据读取完整,不代表申请已审批完成。
78
+
79
+ `invoice.list`、`invoice.enterprise.list`、`invoice.get` 和 `invoice.reim.candidates.list` 默认随票返回顶层 `preApprovals`,由 AI 匹配本次报销。候选窗口固定为北京时间今天前一个日历月至今天,与查票日期独立;只包括差旅、招待、员工活动和借款四类型。CLI 每批自动分页并按申请 ID 去重,最多 20 页、每页 100 条;summary/detail 同样保留该实体。`status=complete` 表示读取完整,`partial` / `unavailable` 不能用于判定唯一或无申请;失败保留发票和明确 warning,认证错误仍报错。`skipped` 及未开始成功读取时 `items:null`,不冒充已查零条。候选不自动绑定,AI仍优先核验登记及用途/提交状态,多条让用户选。
80
+
81
+ 话费 / 油费专项的发票查询传 `includePreApprovals:false`,保留其既有申请及直接提交链;纯话费 / 油费和空发票结果也会自动跳过普通候选。该开关只控制本地聚合,不发给发票接口;本轮已有候选池后的补查详情、凭证或续发票页也可关闭并复用原池。
82
+
61
83
  | Operation | 风险 | 固定规则 |
62
84
  | --- | --- | --- |
63
85
  | `invoice.list` | 只读 | 个人票夹固定 `flag=0`;报销默认按消费日期 `consumption_tm_begin` / `consumption_tm_end` 筛选,CLI 将日期转成秒级时间戳 |
@@ -73,21 +95,42 @@ weaver-work-cli --json invoice list --fields number,detailUrl
73
95
  | `invoice.delete.prepare/apply` | 高风险写 | 固定软删除 `flag=0`,确认后执行并回查 |
74
96
  | `invoice.reim.file-ocr.preview` | 文件识别预览 | 对 E10 fileId 调用报销场景的发票识别接口,只保留成功项 |
75
97
  | `invoice.reim.requests.list` | 只读 | 查询事前申请流程列表,默认 `pageNo=1`、`pageSize=100`;结束日取传入的 `cusCreateDateEnd` 或东八区当天,发给接口时再 + 1 天;未传 `cusCreateDateStart` 时取结束日前 7 天,第 1 页为空自动放宽到结束日前 1 个月再查一次,`scene="phone"`(话费)时取结束日前 90 天且不放宽;列表在 `data.result.data`,另有 `data.query`(实际 `cusCreateDateStart`、业务结束日 `cusCreateDateEnd`、`widened`);每条只输出 `requestid` / `workflowid` / `requestname` / `flowStatus` / `creatorId` / `creatorName` / `createTime` |
76
- | `invoice.reim.workflow.resolve` | 只读 | 根据事前申请 ID 获取报销工作流;无事前申请时传空数组 |
77
- | `invoice.reim.candidates.list` | 只读 | 按日期自动翻页拉取未报销发票,分成 `available`(可报)/ `assigned`(已挂单)两组并给出金额合计 |
78
- | `invoice.reim.employee-superiors` | 只读 | 获取当前人员和上级信息 |
79
- | `invoice.reim.field.search` | 只读 | `GET /api/government/formStructure/fieldRelateSearch`;按名称模糊搜相关客户或相关项目。返回 `match=unique/multiple/none`:一条直接填 `名称(ID)`,多条让用户选。报销时客户和项目必须在建草稿前确认 |
80
- | `invoice.reim.relation.search` | 只读 | 上传发票登记前按名称模糊搜相关客户 / 相关项目,不需要报销表单。入参 `target`(`customer`/`project`)、`keywords`。客户走 `POST /api/ebuilder/coms/nlist/getData`(multipart,`ebbusinessid` / `pageId` `1218181956452048911`,按客户「名称」`field_1173221220888062665` 过滤);项目走 `POST /api/ebuilder/form/common/browser/data/ebuilder`(`quickSearchDatas.field_1020275734718578690` 传项目名称,`formParam` 固定为总部费用报销的项目浏览框),停用项目不返回。每页 20 条。返回 `match`、`items[]`(只有 `id`、`name`)、`selected`(唯一或名称完全一致时给出) |
98
+ | `invoice.reim.workflow.resolve` | 只读 | 根据事前申请 ID 获取报销工作流;CLI 保留空数组查询候选,普通报销不得绕过适用申请要求 |
99
+ | `invoice.reim.candidates.list` | 只读 | 按日期自动翻页拉取未报销发票,分成 `available`(未挂单)/ `assigned`(已挂单)两组并给出金额合计;每项含消费内容 `content` 和已关联凭证 `travel_ids`(无关联为 `[]`),`available` 仍须通过凭证、餐饮票种和事前申请准入 |
100
+ | `invoice.reim.customer.search` | 只读 | 只传 keywords,按名称模糊查客户。完整客户列表逐个以本行客户 ID 直接调用项目基础列表接口,结果挂各自 relatedProject;每客户独立分页和去重,最多四客户并发。每项目仅 relatedProjectName 和 relatedProjectId;项目失败本行null+projectsError,不混合其他客户候选 |
101
+
102
+
81
103
  | `invoice.reim.relation.save` | 写入(尽力而为) | 发票上传后登记相关客户、相关项目、事前申请:`POST /api/esb/server/event/triggerActionFlow`(`esbFlowId` 固定 `908258457763844096`,`moduleSource="-1"`),每张发票一次,`invoiceId` 取 `fid`。入参 `fid`/`fids`,可选 `customerId`+`customerName`、`projectId`+`projectName`(成对)、`flowId`(事前申请 requestid),至少给一项。`mainTable.msg` 含「关联成功」才算成功;接口失败、超时、返回其他内容只记为 `saved=false`,命令不报错、不重试。返回 `saved`、`savedCount`、`failedCount`、`results[]` |
82
- | `invoice.reim.relation.list` | 只读 | 报销时读回发票上传时登记的关联信息:`POST /api/ebuilder/form/eblist/getData`(发票附加信息表,按「单子发票ID」精确过滤),同一张登记多次取最新。入参 `fid`/`fids`。返回 `items[]`(`customer`/`project` 为 `{id,name,value}`,`preApproval` 为 `{requestId,requestName,value,...}`,`value` 已是 `名称(ID)`)、按取值分组的 `groups`、查询失败的 `failed[]` 和 `summary` |
104
+ | `invoice.reim.relation.list` | 只读 | 报销时读回发票上传时登记的关联信息:`POST /api/ebuilder/form/eblist/getData`(发票附加信息表,按「单子发票ID」精确过滤),同一张登记多次取最新。入参 `fid`/`fids`。返回 `items[]`(`customer`/`project` 为 `{id,name,value}`,`preApproval` 为 `{requestId,requestName,value,...}`,`value` 是 `名称(ID)` 展示值,报销页面另取真实 ID 编码为 `##ID`)、按取值分组的 `groups`、查询失败的 `failed[]` 和 `summary` |
83
105
  | `invoice.reim.subsidy.submit` | 高风险写入 | 话费 / 油费补贴报销直接创建并提交流程:`POST /api/secondev/fna/expense/reimbursement/aiCreateWf`,固定 `autoCommit="1"`,`currentEmpId` 取登录会话。入参 `processTitle`、`reason`、`relatedProcessId`(事前申请 requestId)、`invoices`(`[{fid,total,date}]`,`date` 为真实开票日期;仅允许最近 30 天,即北京时间今天及前 29 天,含首尾;缺失、无效、超期或未来日期在提交前拒绝,每张一行明细),可选 `monthlyAllowance`(月补贴额度;CLI 给每行明细算 `reimbursedAmount`:所有行加起来不超过额度,超过时最后一行 = 额度 − 前面行累加金额,额度用完后剩下的发票不进明细,返回在 `skippedInvoices`)、`customerId`(不传默认泛微上海 `100504500000311504`)、`projectId`(不传发空字符串)。返回 `requestId`、`url`(`{baseUrl}/sp/workflow/flowpage/view/{requestId}`)、`finalMarkdown`(包含成功提示、报销事由、实际报销金额、已使用发票张数及票面合计、开票日期、已知月补贴额度、超额 / 未纳入发票说明〔有则展示〕及流程链接,原样展示给用户;不能只给成功提示和链接)。连接中断或成功但没有 `requestId` 时返回 `partial/write_uncertain`,禁止自动重试 |
84
106
  | `invoice.issuing.contracts.list` | 只读 | 入参 `cards`(`workflow.search` 返回的 `data.cards`,原样传入)或 `requestIds`,二选一,最多 50 条。对每个 `requestId` 调一次 `POST /api/ebuilder/form/eblist/getData`(合同虚拟表,按「合同审批流程」过滤,明细按 100 行一页取完),把结果拼回卡片:`invoiced`(查不到明细为 `true`,即已开票)、`contractNo`、`customerName`、`buyerTaxNo`、`sellerName`、`invoiceAmount`(全部明细金额之和,两位小数)、`invoiceGroups[]`(按分组标识汇总 `group` / `amount` / `items[]`);顶层返回 `count`、`pendingCount`、`invoicedCount`。AI 开票先用 `weaver-e10-workflow` 的 `workflow.search` 查三个合同审批流程(用户点名检索词时追加 `requestName`,按流程标题模糊搜索;不传则不带该字段),再用本命令列出待开票合同 |
85
107
  | `invoice.issuing.contract.detail` | 只读 | 入参 `requestId`(用户选定的合同审批流程)。`POST /api/workflow/core/paService/v1/getWorkflowRequest`(`isReadRequest=false`,不标记已读),只取主表:`customer`(「客户名称」Ebuilder 的 `{id, name}`,没有时取「最终用户卡片」)、`customerSource`、`contractDocuments[]`(「合同正文及附件」每个文件的 `docId` / `fileId` / `name`)、`contractDocIds`(全部 `docId` 逗号连接)。AI 开票「合同客户」填 `customer` 的 `{id, name}`;「合同文本」与合同流程一样,按每个文件的 `docId`、`name` 填 `{id, name}`,多个文件传数组,不要填 `contractDocIds` 逗号串或纯数字 id |
108
+ | `invoice.issuing.red.requests.list` | 只读 | 按用户输入的 `customerName` 查询可选择的蓝字开票申请,`current` 默认 1、`pageSize` 默认 10。`POST /api/workflow/core/common/browser/data/wfcRequest`,固定查询「合同收款发票开具及快递申请」`100003460000000214`,`quickSearchDatas.requestname` 和 `requestmark` 均使用客户名称。返回 `items`(含 `requestId`、`requestName`、`title`、`workflowId`、`flowStatus` 等)及本页 `count`、`current`、`pageSize`、`hasMore`;没有明确总数时不推算 `total`。选定项的 `requestId` 是蓝字开票申请流程 ID,用于预填「合同开票冲红流程」`887410479139758085` 的「蓝字发票开票流程」,不是合同审批流程 ID |
86
109
 
87
- > 报销单的创建与修改统一走 `weaver-e10-workflow`(`workflow.createForm` / `workflow.createRequest` / `workflow.edit*`),旧的 `invoice.reim.form.structure`、`invoice.reim.row-info`、`invoice.reim.row-info-batch`、`invoice.reim.flow.create.prepare/apply`、`invoice.reim.flow.update.prepare/apply`、`invoice.reim.template.build`、`invoice.reim.flow.create.auto-prepare` 已移除;`invoice.issuing.qys.list` 也已由 `invoice.issuing.contracts.list` / `invoice.issuing.contract.detail` 取代;`invoice.validate.preview` 已下线,发票文件统一走 `invoice.upload-and-validate`。调用这些旧 operation 会返回 `validation/operation_retired`(退出码 2),`error.details` 给出 `replacement`(替代链路)和 `reference`(skill 文档),完整清单见 `invoice schema` 的 `retiredOperations`。
110
+ > 普通报销使用 `workflow.createRequestDirect` 取字段后按技能契约交付页面预填,先展示本次填写汇总,再输出完整 browsertool 标签及 JSON;标签不包代码块,闭合后不追加文字,由用户在页面核对保存;主流程与填值规则已合并,按查票、填单、已保存修改阶段分段读取,上传登记独立按需读取;依赖契约用到时补齐、已读复用,已保存单据修改使用 `workflow.edit*`,旧的 `invoice.reim.form.structure`、`invoice.reim.row-info`、`invoice.reim.row-info-batch`、`invoice.reim.flow.create.prepare/apply`、`invoice.reim.flow.update.prepare/apply`、`invoice.reim.template.build`、`invoice.reim.flow.create.auto-prepare` 已移除;`invoice.issuing.qys.list` 也已由 `invoice.issuing.contracts.list` / `invoice.issuing.contract.detail` 取代;`invoice.validate.preview` 已下线,发票文件统一走 `invoice.upload-and-validate`。调用这些旧 operation 会返回 `validation/operation_retired`(退出码 2),`error.details` 给出 `replacement`(替代链路)和 `reference`(skill 文档),完整清单见 `invoice schema` 的 `retiredOperations`。
88
111
 
89
112
  共享、转让和标签仍暂不暴露给 Agent:新版源资料给出了提交接口,但还缺少稳定的接收人 `appid/cid/uid` 解析来源、标签关系查询和写后回查契约。
90
113
 
114
+ ## 统一查询客户、项目及承担主体
115
+
116
+ 本技能按完整或模糊客户名称检索客户,统一用 `invoice.reim.customer.search`,一次返回客户、承担主体及各客户自己的相关项目。先选客户,再使用该客户本行 relatedProject,不能合并多客户项目。认证由 CLI 托管,入参只传 keywords,不传示例凭据。客户及每客户项目每页10条、各最多20页;项目直接按客户业务ID查询,不读历史报销。
117
+
118
+ Windows PowerShell:
119
+
120
+ ```powershell
121
+ weaver-work-cli --json invoice run invoice.reim.customer.search --input-json '{"keywords":"星辰"}'
122
+ ```
123
+
124
+ macOS/Linux(bash/zsh):
125
+
126
+ ```bash
127
+ weaver-work-cli --json invoice run invoice.reim.customer.search --input-json '{"keywords":"星辰"}'
128
+ ```
129
+
130
+ 客户、项目及承担主体只使用上述统一入口。多客户先选客户,项目只从选定客户本行完整relatedProject选择,缺少所属客户名称时先补充客户。仅项目名、旧登记项目或未在本客户列表中的项目不再触发名称搜索或独立历史查询;可核实客户或改选当前客户候选。
131
+
132
+ 普通报销、福利指定关联及上传登记使用同一查询数据结构;普通报销客户及项目均须填写,其他分支授权及采集规则、补贴专用提交保持各自契约。关联登记保存和读取继续使用relation.save/list,不删除发票与业务对象的已有关联数据。
133
+
91
134
  ## 常用命令
92
135
 
93
136
  ```text
@@ -124,7 +167,15 @@ weaver-work-cli --json invoice import apply --input-json '{"file":"./invoice.pdf
124
167
 
125
168
  上传发票文件或远程 URL 时,面向 Agent 的默认链路是 `invoice.upload-and-validate` 一步完成上传、识别、查验。只有要设字段(`fieldKey` / `filedMap`)或用户明确要求跳过查验、离线导入时,才走 `invoice.ocr.preview` -> `invoice.import.prepare` -> `invoice.import.apply`,且只有明确跳过查验时才传 `validate=false`;`validate=false` 表示跳过查验,不能描述为“查验通过”。`filedMap`、嵌套字段映射等 JSON 参数在 `--input-json` 中保持对象,CLI 只在 multipart 提交前序列化。
126
169
 
127
- 报销单由 Agent 按 Skill 规则组装 `data` 后,通过 `weaver-e10-workflow` 存草稿;待开票合同由 `workflow.search` 查出合同审批流程后(用户点名检索词时追加 `requestName` 做标题模糊搜索),交给 `invoice.issuing.contracts.list` 补齐开票信息;用户选定并确认后,按销售方通过 `weaver-e10-workflow` 创建「合同收款发票开具及快递申请」或「契约锁合同收款发票开具及快递申请」草稿,不提交。发票与事前申请只按时间关联,一张发票同时落在多条事前申请上时由用户选择。CLI 不负责猜测出差客户或税率;这些规则在 Skill reference 中指导 Agent 组装。当前修正资料包没有客户档案查询或红字发票红冲接口,`invoice.customer.*` 和 `invoice.red.*` 不暴露为 operation,Agent 不能绕过 CLI 调用原始接口。写操作出现网络中断、部分成功、缺少回执 ID 或回查失败时,CLI 返回 `partial/write_uncertain`,Agent 禁止自动重复提交。
170
+ 普通报销用 `workflow.createRequestDirect` 只读字段,Agent 按 Skill 规则组装页面参数,先展示报销汇总,再输出完整 `browsertool` 指令,由用户在页面核对保存,不由 Agent 或 CLI 自动保存或提交。待开票合同由 `workflow.search` 查出合同审批流程后(用户点名检索词时追加 `requestName` 做标题模糊搜索),交给 `invoice.issuing.contracts.list` 补齐开票信息;用户选定并确认后,按销售方选定开票申请工作流,用 `workflow.createRequestDirect` 取字段并预填页面,仍由用户核对保存,不自动保存或提交。申请候选已合并到四个发票读取入口;AI优先核验发票登记关联,无有效登记才筛选随票近一个月对应业务类型候选;多条由用户选择,无可用申请不得继续报销。普通报销四项关联均须查询核验并显式填入真实字段;完整 arguments.sdkOptions 不得漏掉,params.customParams、fieldAssignKeys 和 src 同源一致,即使与默认相同也不省略。交付前由 Agent 按本技能 reim-fill-validation.md 逐项核对,通过后输出同一份页面 JSON。CLI 不负责猜测出差客户或税率;这些规则在 Skill reference 中指导 Agent 组装。客户档案查询 `invoice.customer.*` 以及税务端实际开红票、红字发票查询和确认的 `invoice.red.*` 仍不暴露为 operation,Agent 不能绕过 CLI 调用原始接口。写操作出现网络中断、部分成功、缺少回执 ID 或回查失败时,CLI 返回 `partial/write_uncertain`,Agent 禁止自动重复提交。
171
+
172
+ 合同开票冲红申请按 `invoice-red-workflow.md`:发票语境下的「退票 / 红冲 / 开错票了 / 开红票」先取得客户名称,已有名称直接调用 `invoice.issuing.red.requests.list`。多个候选让用户选择,唯一项回显采用,零条停止;分页保留原客户名称,不自行换词或扩大工作流,不按审批中或结束状态排除候选。选定蓝字开票申请后,固定对 `合同开票冲红流程(887410479139758085)` 调用 `workflow.createRequestDirect`,按本次真实可写主表字段定位「蓝字发票开票流程」,仅将所选 `requestId` 作为 `##requestId` 赋值,`src` 对应 `%23%23requestId`。其他字段交给页面默认值或联动;不走普通开票的合同详情、销售方分流或预计收款时间采集。先展示填写汇总,再输出完整 `browsertool`,由用户核对保存;预填不代表已经保存、提交或完成红冲。机票 / 火车票退票及退票费报销继续按其业务处理,不自动转入本分支。
173
+
174
+ 报销页面逐票对齐:当前组 N 张正式发票对应 N 个完整的 `##fid`,每个 fid 独立加前缀后用英文分号分行,不以浏览按钮标记为条件。相关事前申请流程同样逐票传 N 个 `##requestId`,相同申请也重复,例如 4 张票传 `##A;##A;##A;##A`;不因字段位于主表而只传一个值,不使用逗号或开头顿号。客户、项目和承担主体各只传单一 `##真实ID`,即使元数据标记为多选或明细,也不扩成逗号或分号多值串。若真实元数据无法承载该格式,说明并暂停,不擅自改写。无需填写的字段按业务规则处理,不构造占位数据,其余联动列不新增赋值。交付前由 Agent 按 `reim-fill-validation.md` 逐项核对完整 `arguments.sdkOptions`、四项真实关联、URL 正确转义后与 `customParams` 同值同序,以及 `fieldAssignKeys` 完整;核对通过后交付同一份页面 JSON。
175
+
176
+ AI 报销页面浏览 / 引用字段使用带 `##` 前缀的真实 ID,`src` 中对应 `%23%23真实ID`,URL 解码后与 `customParams` 同值。客户、项目、承担主体各严格单值,不传裸 ID,不使用逗号或分号拼接多个 ID;发票和相关事前申请流程按 N 张正式发票逐项加前缀、用英文分号分行,相同申请也逐票重复 N 次。客户名、项目名、承担主体名和流程标题仅用于候选及汇总,不附加到 ID 后,也不直接使用登记 `value` 的 `名称(ID)` 展示串。保留完整 SDK;实际登记 API 的名称字段和查询返回结构不因页面编码改变。
177
+
178
+ 差旅 / 打车 / 住宿 / 通行费无适用事前申请时,按 `travel-application-fill.md` 补建 `出差/外出流程(100003460000000746)`:收集出差起始与结束日期、原因、是否本地出差、出差 / 外出类型、客户服务方式,读取真实字段及选项后复用报销页面预填契约。仅准备申请页面,由用户核对保存并提交,核验真实已提交后才恢复报销。
128
179
 
129
180
  ## 编辑白名单
130
181
 
package/docs/project.md CHANGED
@@ -7,7 +7,7 @@
7
7
  - 查询项目/任务列表和详情,默认第 1 页 10 条;未指定状态时仅返回未开始、进行中。- 查询项目/任务类型、状态、紧急程度字典。
8
8
  - 按姓名解析员工、部门、分部 ID;按 Ebuilder 表单字段解析关联对象。
9
9
  - 创建、修改、删除项目和任务,全部使用 `prepare -> apply` 确认链。
10
- - 仅在接口异常或用户主动询问版本时调用 `project.version.check`,最低版本为 `20.6.11`。
10
+ - 仅在接口异常或用户主动询问版本时调用 `project.version.check`,最低版本为 `20.6.11`;返回 `status`(`OK` / `NOT_INSTALLED` / `VERSION_TOO_LOW`)用于处置,应用缺失时带 `reason=app_not_found`,版本接口失败不抛错。
11
11
 
12
12
  ## operation
13
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weaver-work-cli",
3
- "version": "0.1.75",
3
+ "version": "0.1.78",
4
4
  "description": "面向泛微工作工具链的可扩展 TypeScript CLI 基础框架(E10 业票通等能力)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",