weaver-work-cli 0.1.1 → 0.1.4

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 (351) hide show
  1. package/README.md +187 -76
  2. package/dist/cmd/setup/index.js +5 -5
  3. package/dist/cmd/skills/index.js +1 -1
  4. package/dist/core/hooks.js +7 -0
  5. package/dist/index.js +0 -0
  6. package/dist/internal/e10/auth/commands.js +160 -55
  7. package/dist/internal/e10/auth/crypto.js +7 -22
  8. package/dist/internal/e10/auth/session.js +1 -1
  9. package/dist/internal/e10/auth/xiaoe.js +268 -0
  10. package/dist/internal/e10/context.js +16 -2
  11. package/dist/internal/e10/index.js +1 -0
  12. package/dist/internal/e10/request-runtime.js +344 -0
  13. package/dist/internal/skills/install.js +48 -6
  14. package/dist/internal/skills/reader.js +27 -0
  15. package/dist/shortcuts/archive/continuation.js +70 -0
  16. package/dist/shortcuts/archive/errors.js +53 -0
  17. package/dist/shortcuts/archive/host.js +197 -0
  18. package/dist/shortcuts/archive/index.js +363 -0
  19. package/dist/shortcuts/archive/manifest.js +45 -0
  20. package/dist/shortcuts/archive/operations/archive-info.js +55 -0
  21. package/dist/shortcuts/archive/operations/borrow-car.js +146 -0
  22. package/dist/shortcuts/archive/operations/borrow-list.js +200 -0
  23. package/dist/shortcuts/archive/operations/confirm.js +46 -0
  24. package/dist/shortcuts/archive/operations/download.js +238 -0
  25. package/dist/shortcuts/archive/operations/flow-url.js +240 -0
  26. package/dist/shortcuts/archive/operations/fonds.js +95 -0
  27. package/dist/shortcuts/archive/operations/getPageUrl.js +137 -0
  28. package/dist/shortcuts/archive/operations/registry.js +43 -0
  29. package/dist/shortcuts/archive/operations/search.js +88 -0
  30. package/dist/shortcuts/archive/operations/shared.js +120 -0
  31. package/dist/shortcuts/archive/operations/types.js +23 -0
  32. package/dist/shortcuts/archive/operations/upload.js +182 -0
  33. package/dist/shortcuts/archive/operations.js +13 -0
  34. package/dist/shortcuts/archive/render/search-format.js +276 -0
  35. package/dist/shortcuts/archive/render/search-view.js +125 -0
  36. package/dist/shortcuts/asset/continuation.js +70 -0
  37. package/dist/shortcuts/asset/errors.js +67 -0
  38. package/dist/shortcuts/asset/host.js +438 -0
  39. package/dist/shortcuts/asset/index.js +255 -0
  40. package/dist/shortcuts/asset/manifest.js +471 -0
  41. package/dist/shortcuts/asset/operations/query.js +249 -0
  42. package/dist/shortcuts/asset/operations/registry.js +85 -0
  43. package/dist/shortcuts/asset/operations/shared.js +100 -0
  44. package/dist/shortcuts/asset/operations/type-cache.js +49 -0
  45. package/dist/shortcuts/asset/operations/types.js +1 -0
  46. package/dist/shortcuts/asset/operations/viewlink.js +117 -0
  47. package/dist/shortcuts/asset/operations/write.js +435 -0
  48. package/dist/shortcuts/asset/operations.js +9 -0
  49. package/dist/shortcuts/calendar/continuation.js +70 -0
  50. package/dist/shortcuts/calendar/errors.js +53 -0
  51. package/dist/shortcuts/calendar/host.js +148 -0
  52. package/dist/shortcuts/calendar/index.js +125 -0
  53. package/dist/shortcuts/calendar/manifest.js +26 -0
  54. package/dist/shortcuts/calendar/operations/read.js +259 -0
  55. package/dist/shortcuts/calendar/operations/registry.js +31 -0
  56. package/dist/shortcuts/calendar/operations/shared.js +132 -0
  57. package/dist/shortcuts/calendar/operations/types.js +25 -0
  58. package/dist/shortcuts/calendar/operations/write.js +439 -0
  59. package/dist/shortcuts/calendar/operations.js +8 -0
  60. package/dist/shortcuts/ehr/continuation.js +70 -0
  61. package/dist/shortcuts/ehr/errors.js +53 -0
  62. package/dist/shortcuts/ehr/host.js +213 -0
  63. package/dist/shortcuts/ehr/index.js +205 -0
  64. package/dist/shortcuts/ehr/manifest.js +47 -0
  65. package/dist/shortcuts/ehr/operations/attend-read.js +373 -0
  66. package/dist/shortcuts/ehr/operations/attend-write.js +514 -0
  67. package/dist/shortcuts/ehr/operations/hr-contact.js +363 -0
  68. package/dist/shortcuts/ehr/operations/hr-ds.js +298 -0
  69. package/dist/shortcuts/ehr/operations/hr-report.js +386 -0
  70. package/dist/shortcuts/ehr/operations/recruit-write.js +1629 -0
  71. package/dist/shortcuts/ehr/operations/recruit.js +803 -0
  72. package/dist/shortcuts/ehr/operations/registry.js +43 -0
  73. package/dist/shortcuts/ehr/operations/salary.js +319 -0
  74. package/dist/shortcuts/ehr/operations/shared.js +246 -0
  75. package/dist/shortcuts/ehr/operations/types.js +25 -0
  76. package/dist/shortcuts/ehr/operations.js +25 -0
  77. package/dist/shortcuts/esb/continuation.js +70 -0
  78. package/dist/shortcuts/esb/errors.js +65 -0
  79. package/dist/shortcuts/esb/host.js +187 -0
  80. package/dist/shortcuts/esb/index.js +112 -0
  81. package/dist/shortcuts/esb/manifest.js +91 -0
  82. package/dist/shortcuts/esb/operations/input-format.js +31 -0
  83. package/dist/shortcuts/esb/operations/registry.js +48 -0
  84. package/dist/shortcuts/esb/operations/shared.js +152 -0
  85. package/dist/shortcuts/esb/operations/trigger.js +76 -0
  86. package/dist/shortcuts/esb/operations/types.js +21 -0
  87. package/dist/shortcuts/esb/operations.js +15 -0
  88. package/dist/shortcuts/fna/continuation.js +70 -0
  89. package/dist/shortcuts/fna/errors.js +59 -0
  90. package/dist/shortcuts/fna/host.js +146 -0
  91. package/dist/shortcuts/fna/index.js +111 -0
  92. package/dist/shortcuts/fna/manifest.js +41 -0
  93. package/dist/shortcuts/fna/operations/budget.js +124 -0
  94. package/dist/shortcuts/fna/operations/expense-center.js +148 -0
  95. package/dist/shortcuts/fna/operations/invoice-writeoff.js +212 -0
  96. package/dist/shortcuts/fna/operations/loan.js +195 -0
  97. package/dist/shortcuts/fna/operations/registry.js +35 -0
  98. package/dist/shortcuts/fna/operations/shared.js +210 -0
  99. package/dist/shortcuts/fna/operations/types.js +25 -0
  100. package/dist/shortcuts/fna/operations.js +19 -0
  101. package/dist/shortcuts/hrm/errors.js +38 -0
  102. package/dist/shortcuts/hrm/host.js +156 -0
  103. package/dist/shortcuts/hrm/index.js +111 -0
  104. package/dist/shortcuts/hrm/manifest.js +32 -0
  105. package/dist/shortcuts/hrm/operations/employee.js +338 -0
  106. package/dist/shortcuts/hrm/operations/org.js +110 -0
  107. package/dist/shortcuts/hrm/operations/position.js +176 -0
  108. package/dist/shortcuts/hrm/operations/registry.js +33 -0
  109. package/dist/shortcuts/hrm/operations/shared.js +143 -0
  110. package/dist/shortcuts/hrm/operations/types.js +23 -0
  111. package/dist/shortcuts/hrm/operations.js +19 -0
  112. package/dist/shortcuts/index.js +20 -0
  113. package/dist/shortcuts/invoice/host.js +99 -94
  114. package/dist/shortcuts/invoice/index.js +65 -61
  115. package/dist/shortcuts/invoice/manifest.js +222 -14
  116. package/dist/shortcuts/invoice/operations/browse-field.js +17 -0
  117. package/dist/shortcuts/invoice/operations/issuing.js +198 -0
  118. package/dist/shortcuts/invoice/operations/ocr-preview.js +6 -3
  119. package/dist/shortcuts/invoice/operations/registry.js +17 -0
  120. package/dist/shortcuts/invoice/operations/reim.js +401 -0
  121. package/dist/shortcuts/invoice/operations/shared.js +271 -6
  122. package/dist/shortcuts/invoice/operations/validate-preview.js +1 -1
  123. package/dist/shortcuts/jiuchuanhui/cache.js +441 -0
  124. package/dist/shortcuts/jiuchuanhui/continuation.js +70 -0
  125. package/dist/shortcuts/jiuchuanhui/errors.js +59 -0
  126. package/dist/shortcuts/jiuchuanhui/host.js +159 -0
  127. package/dist/shortcuts/jiuchuanhui/index.js +109 -0
  128. package/dist/shortcuts/jiuchuanhui/manifest.js +469 -0
  129. package/dist/shortcuts/jiuchuanhui/operations/datajson.js +214 -0
  130. package/dist/shortcuts/jiuchuanhui/operations/esb.js +157 -0
  131. package/dist/shortcuts/jiuchuanhui/operations/generic.js +146 -0
  132. package/dist/shortcuts/jiuchuanhui/operations/registry.js +133 -0
  133. package/dist/shortcuts/jiuchuanhui/operations/shared.js +158 -0
  134. package/dist/shortcuts/jiuchuanhui/operations/types.js +1 -0
  135. package/dist/shortcuts/jiuchuanhui/operations.js +8 -0
  136. package/dist/shortcuts/mail/continuation.js +70 -0
  137. package/dist/shortcuts/mail/errors.js +53 -0
  138. package/dist/shortcuts/mail/host.js +182 -0
  139. package/dist/shortcuts/mail/index.js +519 -0
  140. package/dist/shortcuts/mail/manifest.js +38 -0
  141. package/dist/shortcuts/mail/operations/mail-blacklist.js +79 -0
  142. package/dist/shortcuts/mail/operations/mail-contacts.js +195 -0
  143. package/dist/shortcuts/mail/operations/mail-manage.js +335 -0
  144. package/dist/shortcuts/mail/operations/mail-read.js +508 -0
  145. package/dist/shortcuts/mail/operations/mail-send.js +474 -0
  146. package/dist/shortcuts/mail/operations/mail-sign.js +203 -0
  147. package/dist/shortcuts/mail/operations/mail-template.js +170 -0
  148. package/dist/shortcuts/mail/operations/registry.js +41 -0
  149. package/dist/shortcuts/mail/operations/shared.js +64 -0
  150. package/dist/shortcuts/mail/operations/types.js +27 -0
  151. package/dist/shortcuts/mail/operations.js +19 -0
  152. package/dist/shortcuts/plan/continuation.js +70 -0
  153. package/dist/shortcuts/plan/errors.js +70 -0
  154. package/dist/shortcuts/plan/host.js +180 -0
  155. package/dist/shortcuts/plan/index.js +150 -0
  156. package/dist/shortcuts/plan/manifest.js +53 -0
  157. package/dist/shortcuts/plan/operations/link.js +256 -0
  158. package/dist/shortcuts/plan/operations/read.js +259 -0
  159. package/dist/shortcuts/plan/operations/registry.js +33 -0
  160. package/dist/shortcuts/plan/operations/shared.js +246 -0
  161. package/dist/shortcuts/plan/operations/types.js +49 -0
  162. package/dist/shortcuts/plan/operations/version.js +49 -0
  163. package/dist/shortcuts/plan/operations/write.js +710 -0
  164. package/dist/shortcuts/plan/operations.js +8 -0
  165. package/docs/SKILL.md +11 -7
  166. package/docs/_catalog.md +23 -5
  167. package/docs/agent-invoice.md +31 -10
  168. package/docs/agent-skill-install.md +211 -0
  169. package/docs/calendar.md +87 -0
  170. package/docs/e10-auth.md +28 -9
  171. package/docs/ehr.md +186 -0
  172. package/docs/esb.md +64 -0
  173. package/docs/fna.md +72 -0
  174. package/docs/hrm.md +89 -0
  175. package/docs/invoice.md +66 -20
  176. package/docs/jiuchuanhui.md +131 -0
  177. package/docs/operation-manual.md +443 -0
  178. package/docs/plan.md +82 -0
  179. package/docs/wenshuding.md +129 -0
  180. package/docs/ziguanjia.md +89 -0
  181. package/package.json +4 -4
  182. package/scripts/package-skill.mjs +127 -34
  183. package/scripts/postbuild.mjs +13 -0
  184. package/skill-template/business-info.json +13 -2
  185. package/skill-template/domains/calendar.md +15 -0
  186. package/skill-template/domains/esb.md +13 -0
  187. package/skill-template/domains/hrm.md +16 -0
  188. package/skill-template/domains/jiuchuanhui.md +23 -0
  189. package/skill-template/domains/jucailin.md +22 -0
  190. package/skill-template/domains/mail.md +21 -0
  191. package/skill-template/domains/plan.md +17 -0
  192. package/skill-template/domains/qiyecheng.md +17 -0
  193. package/skill-template/domains/shared.md +9 -3
  194. package/skill-template/domains/skill-maker.md +10 -0
  195. package/skill-template/domains/wenshuding.md +22 -0
  196. package/skill-template/domains/{invoice.md → yepiaotong.md} +4 -0
  197. package/skill-template/domains/ziguanjia.md +21 -0
  198. package/skill-template/master-skill-template.md +12 -6
  199. package/skill-template/skill-template.md +40 -9
  200. package/skills/weaver-e10-calendar/SKILL.md +101 -0
  201. package/skills/weaver-e10-calendar/product.json +8 -0
  202. package/skills/weaver-e10-calendar/references/calendar-app-check.md +65 -0
  203. package/skills/weaver-e10-calendar/references/calendar-dict.md +55 -0
  204. package/skills/weaver-e10-calendar/references/calendar-query.md +70 -0
  205. package/skills/weaver-e10-calendar/references/calendar-write.md +97 -0
  206. package/skills/weaver-e10-calendar/references/source-manifest.json +54 -0
  207. package/skills/weaver-e10-esb/SKILL.md +102 -0
  208. package/skills/weaver-e10-esb/product.json +8 -0
  209. package/skills/weaver-e10-esb/references/input-format.md +52 -0
  210. package/skills/weaver-e10-esb/references/source-manifest.json +242 -0
  211. package/skills/weaver-e10-esb/references/trigger.md +99 -0
  212. package/skills/weaver-e10-hrm/SKILL.md +87 -0
  213. package/skills/weaver-e10-hrm/product.json +8 -0
  214. package/skills/weaver-e10-hrm/references/employee.md +109 -0
  215. package/skills/weaver-e10-hrm/references/org.md +95 -0
  216. package/skills/weaver-e10-hrm/references/position.md +95 -0
  217. package/skills/weaver-e10-hrm/references/source-manifest.json +121 -0
  218. package/skills/weaver-e10-jiuchuanhui/SKILL.md +174 -0
  219. package/skills/weaver-e10-jiuchuanhui/product.json +8 -0
  220. package/skills/weaver-e10-jiuchuanhui/references/cache.md +110 -0
  221. package/skills/weaver-e10-jiuchuanhui/references/clue.md +61 -0
  222. package/skills/weaver-e10-jiuchuanhui/references/contact-plan.md +56 -0
  223. package/skills/weaver-e10-jiuchuanhui/references/contact-records.md +48 -0
  224. package/skills/weaver-e10-jiuchuanhui/references/contact.md +56 -0
  225. package/skills/weaver-e10-jiuchuanhui/references/customer.md +69 -0
  226. package/skills/weaver-e10-jiuchuanhui/references/disabled-capabilities.md +24 -0
  227. package/skills/weaver-e10-jiuchuanhui/references/discovery-config.md +60 -0
  228. package/skills/weaver-e10-jiuchuanhui/references/general-helpers.md +59 -0
  229. package/skills/weaver-e10-jiuchuanhui/references/jiuchuanhui-entry.md +60 -0
  230. package/skills/weaver-e10-jiuchuanhui/references/sale.md +72 -0
  231. package/skills/weaver-e10-jiuchuanhui/references/source-manifest.json +2632 -0
  232. package/skills/weaver-e10-jucailin/SKILL.md +101 -0
  233. package/skills/weaver-e10-jucailin/product.json +8 -0
  234. package/skills/weaver-e10-jucailin/references/attend-read.md +73 -0
  235. package/skills/weaver-e10-jucailin/references/attend-write.md +82 -0
  236. package/skills/weaver-e10-jucailin/references/hr-contact.md +92 -0
  237. package/skills/weaver-e10-jucailin/references/hr-datasource.md +104 -0
  238. package/skills/weaver-e10-jucailin/references/hr-report.md +76 -0
  239. package/skills/weaver-e10-jucailin/references/recruit-read.md +76 -0
  240. package/skills/weaver-e10-jucailin/references/recruit-write.md +70 -0
  241. package/skills/weaver-e10-jucailin/references/safety-boundaries.md +35 -0
  242. package/skills/weaver-e10-jucailin/references/salary.md +110 -0
  243. package/skills/weaver-e10-jucailin/references/source-manifest.json +152 -0
  244. package/skills/weaver-e10-mail/SKILL.md +151 -0
  245. package/skills/weaver-e10-mail/product.json +8 -0
  246. package/skills/weaver-e10-mail/references/mail-agent-entry.md +47 -0
  247. package/skills/weaver-e10-mail/references/mail-attachment.md +30 -0
  248. package/skills/weaver-e10-mail/references/mail-blacklist.md +27 -0
  249. package/skills/weaver-e10-mail/references/mail-contacts.md +33 -0
  250. package/skills/weaver-e10-mail/references/mail-manage.md +44 -0
  251. package/skills/weaver-e10-mail/references/mail-read.md +76 -0
  252. package/skills/weaver-e10-mail/references/mail-send.md +43 -0
  253. package/skills/weaver-e10-mail/references/mail-sign.md +33 -0
  254. package/skills/weaver-e10-mail/references/mail-template.md +31 -0
  255. package/skills/weaver-e10-mail/references/safety-boundaries.md +32 -0
  256. package/skills/weaver-e10-plan/SKILL.md +139 -0
  257. package/skills/weaver-e10-plan/product.json +8 -0
  258. package/skills/weaver-e10-plan/references/plan-collect-and-compose.md +123 -0
  259. package/skills/weaver-e10-plan/references/plan-overview-and-routing.md +138 -0
  260. package/skills/weaver-e10-plan/references/plan-report-query.md +154 -0
  261. package/skills/weaver-e10-plan/references/plan-report-remind.md +104 -0
  262. package/skills/weaver-e10-plan/references/plan-report-write.md +162 -0
  263. package/skills/weaver-e10-plan/references/source-manifest.json +858 -0
  264. package/skills/weaver-e10-qiyecheng/SKILL.md +118 -0
  265. package/skills/weaver-e10-qiyecheng/product.json +8 -0
  266. package/skills/weaver-e10-qiyecheng/references/budget.md +65 -0
  267. package/skills/weaver-e10-qiyecheng/references/catalog.md +56 -0
  268. package/skills/weaver-e10-qiyecheng/references/expense-center.md +51 -0
  269. package/skills/weaver-e10-qiyecheng/references/invoice-writeoff.md +57 -0
  270. package/skills/weaver-e10-qiyecheng/references/loan-management.md +59 -0
  271. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +698 -0
  272. package/skills/weaver-e10-shared/SKILL.md +86 -0
  273. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +127 -0
  274. package/skills/weaver-e10-shared/references/json-output-contract.md +120 -0
  275. package/skills/weaver-e10-shared/references/weaver-e10-installation.md +110 -0
  276. package/skills/weaver-e10-skill-maker/SKILL.md +77 -0
  277. package/skills/weaver-e10-skill-maker/product.json +8 -0
  278. package/skills/weaver-e10-skill-maker/references/business-skill-generation.md +124 -0
  279. package/skills/weaver-e10-skill-maker/references/detector-validation.md +101 -0
  280. package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +230 -0
  281. package/skills/weaver-e10-skill-maker/references/post-generation-install.md +105 -0
  282. package/skills/weaver-e10-skill-maker/references/source-update-detection.md +261 -0
  283. package/skills/weaver-e10-skill-maker/references/weaver-skill-style.md +141 -0
  284. package/skills/weaver-e10-wenshuding/SKILL.md +157 -0
  285. package/skills/weaver-e10-wenshuding/product.json +8 -0
  286. package/skills/weaver-e10-wenshuding/references/archive-agent-entry.md +63 -0
  287. package/skills/weaver-e10-wenshuding/references/archive-borrow-car.md +52 -0
  288. package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +52 -0
  289. package/skills/weaver-e10-wenshuding/references/archive-disabled-capabilities.md +22 -0
  290. package/skills/weaver-e10-wenshuding/references/archive-download.md +48 -0
  291. package/skills/weaver-e10-wenshuding/references/archive-flow.md +46 -0
  292. package/skills/weaver-e10-wenshuding/references/archive-fonds.md +34 -0
  293. package/skills/weaver-e10-wenshuding/references/archive-info.md +33 -0
  294. package/skills/weaver-e10-wenshuding/references/archive-search.md +52 -0
  295. package/skills/weaver-e10-wenshuding/references/archive-upload.md +41 -0
  296. package/skills/weaver-e10-wenshuding/references/source-manifest.json +517 -0
  297. package/skills/weaver-e10-yepiaotong/SKILL.md +184 -0
  298. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-add.md +1 -1
  299. package/skills/weaver-e10-yepiaotong/references/invoice-agent-entry.md +47 -0
  300. package/skills/weaver-e10-yepiaotong/references/invoice-browse-field-data.md +204 -0
  301. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-delete.md +1 -1
  302. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-detail.md +13 -5
  303. package/skills/weaver-e10-yepiaotong/references/invoice-disabled-capabilities.md +28 -0
  304. package/skills/weaver-e10-yepiaotong/references/invoice-download.md +31 -0
  305. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +45 -0
  306. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-file-upload.md +15 -4
  307. package/skills/weaver-e10-yepiaotong/references/invoice-import.md +45 -0
  308. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +120 -0
  309. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-field-rules.md +161 -0
  310. package/skills/weaver-e10-yepiaotong/references/invoice-issuing.md +99 -0
  311. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-ocr-preview.md +14 -4
  312. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +58 -0
  313. package/skills/weaver-e10-yepiaotong/references/invoice-red.md +261 -0
  314. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +97 -0
  315. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-update.md +1 -1
  316. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-validation-preview.md +10 -3
  317. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +1340 -0
  318. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +845 -0
  319. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +94 -0
  320. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +449 -0
  321. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +266 -0
  322. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +494 -0
  323. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +1103 -0
  324. package/skills/weaver-e10-ziguanjia/SKILL.md +162 -0
  325. package/skills/weaver-e10-ziguanjia/product.json +8 -0
  326. package/skills/weaver-e10-ziguanjia/references/source-manifest.json +147 -0
  327. package/skills/weaver-e10-ziguanjia/references/ziguanjia-agent-entry.md +65 -0
  328. package/skills/weaver-e10-ziguanjia/references/ziguanjia-create.md +45 -0
  329. package/skills/weaver-e10-ziguanjia/references/ziguanjia-depre.md +48 -0
  330. package/skills/weaver-e10-ziguanjia/references/ziguanjia-disabled-capabilities.md +22 -0
  331. package/skills/weaver-e10-ziguanjia/references/ziguanjia-purch.md +57 -0
  332. package/skills/weaver-e10-ziguanjia/references/ziguanjia-query.md +62 -0
  333. package/skills/weaver-e10-ziguanjia/references/ziguanjia-repair.md +83 -0
  334. package/skills/weaver-e10-ziguanjia/references/ziguanjia-resolve.md +49 -0
  335. package/skills/weaver-e10-ziguanjia/references/ziguanjia-return.md +70 -0
  336. package/skills/weaver-e10-ziguanjia/references/ziguanjia-update.md +45 -0
  337. package/skills/weaver-e10-ziguanjia/references/ziguanjia-use.md +60 -0
  338. package/skills/weaver-e10-ziguanjia/references/ziguanjia-viewlink.md +81 -0
  339. package/skills/weaver-work-cli-invoice/SKILL.md +0 -103
  340. package/skills/weaver-work-cli-invoice/references/invoice-agent-entry.md +0 -38
  341. package/skills/weaver-work-cli-invoice/references/invoice-disabled-capabilities.md +0 -26
  342. package/skills/weaver-work-cli-invoice/references/invoice-download.md +0 -22
  343. package/skills/weaver-work-cli-invoice/references/invoice-enterprise-list.md +0 -35
  344. package/skills/weaver-work-cli-invoice/references/invoice-import.md +0 -28
  345. package/skills/weaver-work-cli-invoice/references/invoice-personal-list.md +0 -47
  346. package/skills/weaver-work-cli-shared/SKILL.md +0 -53
  347. package/skills/weaver-work-cli-shared/references/e10-auth-and-session.md +0 -83
  348. package/skills/weaver-work-cli-shared/references/json-output-contract.md +0 -61
  349. package/skills/weaver-work-cli-shared/references/weaver-work-cli-installation.md +0 -61
  350. /package/skills/{weaver-work-cli-shared → weaver-e10-shared}/references/high-risk-write.md +0 -0
  351. /package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/product.json +0 -0
@@ -0,0 +1,845 @@
1
+ # 完整端到端示例
2
+
3
+ > 所有操作通过 `weaver-work-cli --json invoice run <operation> --input-json '<json>'` 执行。
4
+ > 认证由 `weaver-work-cli auth` 管理,无需手动传 token/eteamsId。
5
+ > 复杂 JSON 建议先写入 UTF-8 文件再用 `--input <path>` 传入。
6
+
7
+ ---
8
+
9
+ ## 示例0:用户提供 fileId → 发票识别 → 自动报销
10
+
11
+ 用户说:"帮我报销这个文件 1290156133724692482,1290156133724692483"
12
+
13
+ ### Step 0: 文件ID转发票识别
14
+
15
+ 切割 fileId,调用 `invoice.reim.file-ocr.preview`:
16
+
17
+ **命令:**
18
+
19
+ Windows PowerShell:
20
+
21
+ ```powershell
22
+ weaver-work-cli --json invoice run invoice.reim.file-ocr.preview --input-json '{"fileIds":["1290156133724692482","1290156133724692483"]}'
23
+ ```
24
+
25
+ macOS/Linux(bash/zsh):
26
+
27
+ ```bash
28
+ weaver-work-cli --json invoice run invoice.reim.file-ocr.preview --input-json '{"fileIds":["1290156133724692482","1290156133724692483"]}'
29
+ ```
30
+
31
+ **返回:**
32
+
33
+ ```json
34
+ {
35
+ "code": 200,
36
+ "msg": "接口返回成功",
37
+ "status": true,
38
+ "data": [
39
+ {
40
+ "fileId": "1290156133724692482",
41
+ "fileName": "滴滴出行电子发票.pdf",
42
+ "status": "success",
43
+ "errorMsg": "识别成功",
44
+ "invoiceId": "1290156159548506113",
45
+ "invoiceType": "增值税电子普通发票",
46
+ "invoiceTypeCode": 3,
47
+ "amount": "85.60",
48
+ "consumeContent": "*运输服务*客运服务费",
49
+ "invoiceDate": "2026-07-28",
50
+ "invoiceNumber": "36901200",
51
+ "buyerName": "上海亘岩网络科技有限公司",
52
+ "sellerName": "北京滴滴出行科技有限公司",
53
+ "expenseType": "市内交通"
54
+ },
55
+ {
56
+ "fileId": "1290156133724692483",
57
+ "fileName": "如家酒店发票.pdf",
58
+ "status": "success",
59
+ "errorMsg": "识别成功",
60
+ "invoiceId": "1290156159548506114",
61
+ "invoiceType": "增值税电子普通发票",
62
+ "invoiceTypeCode": 3,
63
+ "amount": "380.00",
64
+ "consumeContent": "*住宿服务*住宿费",
65
+ "invoiceDate": "2026-07-29",
66
+ "invoiceNumber": "36901201",
67
+ "buyerName": "上海亘岩网络科技有限公司",
68
+ "sellerName": "如家酒店管理有限公司",
69
+ "expenseType": "住宿"
70
+ }
71
+ ],
72
+ "fail": false
73
+ }
74
+ ```
75
+
76
+ 过滤 `status="success"` 的数据,得到 2 张发票。
77
+
78
+ ### 后续流程
79
+
80
+ 已获取发票数据 → **跳过 Step 1A**(不调用 `invoice.list`)
81
+
82
+ 利用发票的 `invoiceDate`(2026-07-28 ~ 2026-07-29)筛选事前申请:
83
+ - `cusCreateDateStart` = "2026-04-29"(往前推90天)
84
+ - `cusCreateDateEnd` = "2026-07-29"
85
+
86
+ → 继续 Step 1B → Step 2 匹配 → Step 2.5 → Step 3 → Step 4 → Step 5(流程同示例1/2)
87
+
88
+ ---
89
+
90
+ ## 示例1:单张发票 + 有事前申请(完整流程)
91
+
92
+ ### Step 1A: 获取发票
93
+
94
+ **第一步:按内联公式计算最近一周时间戳参数**
95
+
96
+ AI 直接计算(UTC+8):begin = 今天00:00:00秒时间戳 - 7*86400, end = 今天23:59:59秒时间戳
97
+
98
+ 生成 `invoice.list` 入参(只传必要字段;`sreim`/`bill_type` 由 CLI 默认):
99
+
100
+ ```json
101
+ {
102
+ "page_size": 10,
103
+ "start_pos": 0,
104
+ "date_begin": 1786291200,
105
+ "date_end": 1786982399
106
+ }
107
+ ```
108
+
109
+ **第二步:调用 CLI 查询发票**
110
+
111
+ Windows PowerShell:
112
+
113
+ ```powershell
114
+ weaver-work-cli --json invoice run invoice.list --input-json '{"page_size":10,"start_pos":0,"date_begin":1786291200,"date_end":1786982399}'
115
+ ```
116
+
117
+ macOS/Linux(bash/zsh):
118
+
119
+ ```bash
120
+ weaver-work-cli --json invoice run invoice.list --input-json '{"page_size":10,"start_pos":0,"date_begin":1786291200,"date_end":1786982399}'
121
+ ```
122
+
123
+ **返回(CLI 信封中列表在 `data.items`,下面是单条票面结构):**
124
+
125
+ ```json
126
+ {
127
+ "infos": [
128
+ {
129
+ "info": {
130
+ "id": "1295366637717012482",
131
+ "fid": "1295366637717012482",
132
+ "code": "",
133
+ "number": "36901189",
134
+ "ext": "{\"content\":\"*运输服务*客运服务费\",\"products\":[{\"name\":\"*运输服务*客运服务费\",\"amount\":\"108.2\"}],\"category\":\"增值税电子普通发票\"}",
135
+ "fylx": "897092516517920775",
136
+ "currency": "CNY",
137
+ "province": "上海市",
138
+ "modify_info": { "ctm": 1786168444, "utm": 1786168444, "cstm": 1722268800, "source": 4 },
139
+ "comm_info": {
140
+ "pro": { "cname": "增值税电子普通发票", "type": 3, "date": "2026-07-30", "status": 0 },
141
+ "price": { "amount": "102.08", "total": "108.2" },
142
+ "buyer": { "tcode": "xxx", "company": "上海亘岩网络科技有限公司" },
143
+ "payer": { "tcode": "xxx", "company": "北京滴滴出行科技有限公司" }
144
+ },
145
+ "relative_fids": [],
146
+ "bill_type": 0
147
+ },
148
+ "ret": { "trace": "", "ret": 0, "message": "执行成功" },
149
+ "is_valid": 0
150
+ }
151
+ ],
152
+ "res_base": { "trace": "", "ret": 0, "message": "执行成功" }
153
+ }
154
+ ```
155
+
156
+ **字段映射提取:**
157
+ - `invoiceId` = `info.fid` = `"1295366637717012482"`
158
+ - `invoiceNumber` = `info.number` = `"36901189"`
159
+ - `invoiceType` = `info.comm_info.pro.cname` = `"增值税电子普通发票"`
160
+ - `invoiceTypeCode` = `info.comm_info.pro.type` = `3`
161
+ - `invoiceDate` = `info.comm_info.pro.date` = `"2026-07-30"`
162
+ - `amount` = `info.comm_info.price.total` = `"108.2"`
163
+ - `buyerName` = `info.comm_info.buyer.company` = `"上海亘岩网络科技有限公司"`
164
+ - `sellerName` = `info.comm_info.payer.company` = `"北京滴滴出行科技有限公司"`
165
+ - `consumeContent` = `JSON.parse(ext).content` = `"*运输服务*客运服务费"`
166
+ - `expenseType` = 根据 `info.fylx` 查名称 → `"市内交通"`
167
+
168
+ ### Step 1C: 展示发票汇总,等待用户确认
169
+
170
+ > 用户说"帮我报销",未指定日期 → 使用默认最近一周范围,**必须告知用户查询范围**
171
+
172
+ **AI 展示给用户:**
173
+
174
+ ```markdown
175
+ 已为您查询最近一周(2026-07-24 ~ 2026-07-30)的发票数据,共找到 1 张未报销发票,汇总金额 ¥108.20:
176
+
177
+ | # | 发票类型 | 开票日期 | 发票号码 | 金额 | 销方名称 | 费用类型 |
178
+ |---|----------|----------|----------|------|----------|----------|
179
+ | 1 | 增值税电子普通发票 | 2026-07-30 | 36901189 | ¥108.20 | 北京滴滴出行科技有限公司 | 市内交通 |
180
+
181
+ 请确认是否使用以上发票进行报销?如需查询其他日期范围的发票,请告诉我。
182
+ ```
183
+
184
+ 用户回复"确认" → 继续后续流程
185
+
186
+ ### Step 1B: 获取事前申请(基于发票日期预筛选)
187
+
188
+ > 已知发票 invoiceDate = "2026-07-30"
189
+ > 事前申请日期一定在开票日期之前 → cusCreateDateEnd = "2026-07-30"
190
+ > 往前推90天 → cusCreateDateStart = "2026-05-01"
191
+
192
+ **命令:**
193
+
194
+ Windows PowerShell:
195
+
196
+ ```powershell
197
+ weaver-work-cli --json invoice run invoice.reim.requests.list --input-json '{"pageNo":1,"pageSize":20,"cusCreateDateStart":"2026-05-01","cusCreateDateEnd":"2026-07-30"}'
198
+ ```
199
+
200
+ macOS/Linux(bash/zsh):
201
+
202
+ ```bash
203
+ weaver-work-cli --json invoice run invoice.reim.requests.list --input-json '{"pageNo":1,"pageSize":20,"cusCreateDateStart":"2026-05-01","cusCreateDateEnd":"2026-07-30"}'
204
+ ```
205
+
206
+ **返回:**
207
+
208
+ ```json
209
+ {
210
+ "code": 200,
211
+ "data": [
212
+ {
213
+ "requestid": "1298294241967177729",
214
+ "workflowid": "1181057526276915214",
215
+ "requestname": "交通费报销-后端开发111-2026-07-25",
216
+ "requestnametitle": "交通费报销-后端开发111-2026-07-25 (相关客户:, 相关项目:, 承担主体: , 流程编号:Weaver-FYBX202607000069, 报销总金额:14.47 , 费用承担公司:)",
217
+ "flowStatus": 6,
218
+ "creatorId": "1201729946891231232",
219
+ "creatorName": "后端开发111",
220
+ "creatorDepartmentId": "1201729461554241537",
221
+ "nodeid": "1181057741029220917",
222
+ "createTime": "2026-07-25 10:30:00"
223
+ }
224
+ ]
225
+ }
226
+ ```
227
+
228
+ ### Step 2: 匹配绑定
229
+
230
+ 根据匹配规则分析(硬约束:invoiceDate >= createTime):
231
+ - 时间硬约束:invoiceDate "2026-07-30" >= createTime "2026-07-25" → ✅ 满足
232
+ - 费用类型匹配:发票 expenseType="市内交通" ↔ 事前申请 requestname 含"交通费" → +40
233
+ - 时间匹配:invoiceDate 在 createTime 后 5 天(7天内) → +30
234
+ - 同一申请人 → +10
235
+ - 总分 80 → confidence = "high"
236
+
237
+ 匹配结果:
238
+
239
+ ```json
240
+ {
241
+ "matchResults": [
242
+ {
243
+ "invoiceId": "1295366637717012482",
244
+ "preApprovalId": "1298294241967177729",
245
+ "preApprovalWorkflowId": "1181057526276915214",
246
+ "matchConfidence": "high",
247
+ "matchScore": 80,
248
+ "matchReasons": ["费用类型匹配:交通费", "时间匹配:开票日期在事前申请后5天内", "同一申请人"]
249
+ }
250
+ ],
251
+ "unmatchedInvoices": [],
252
+ "unmatchedApprovals": []
253
+ }
254
+ ```
255
+
256
+ ### Step 2.5: 获取报销单工作流ID
257
+
258
+ **命令:**
259
+
260
+ Windows PowerShell:
261
+
262
+ ```powershell
263
+ weaver-work-cli --json invoice run invoice.reim.workflow.resolve --input-json '{"requestIds":["1298294241967177729"]}'
264
+ ```
265
+
266
+ macOS/Linux(bash/zsh):
267
+
268
+ ```bash
269
+ weaver-work-cli --json invoice run invoice.reim.workflow.resolve --input-json '{"requestIds":["1298294241967177729"]}'
270
+ ```
271
+
272
+ **返回:**
273
+
274
+ ```json
275
+ {
276
+ "code": 200,
277
+ "data": {
278
+ "requestWorkflowMap": {
279
+ "1298294241967177729": {
280
+ "workFlowId": "1181057526276915214",
281
+ "workFlowName": "交通费报销"
282
+ }
283
+ }
284
+ }
285
+ }
286
+ ```
287
+
288
+ **决策:** 有事前申请 → 直接取 `workFlowId = "1181057526276915214"`
289
+
290
+ ### Step 3: 获取表单结构
291
+
292
+ **命令:**
293
+
294
+ Windows PowerShell:
295
+
296
+ ```powershell
297
+ weaver-work-cli --json invoice run invoice.reim.form.structure --input-json '{"workflowId":"1181057526276915214"}'
298
+ ```
299
+
300
+ macOS/Linux(bash/zsh):
301
+
302
+ ```bash
303
+ weaver-work-cli --json invoice run invoice.reim.form.structure --input-json '{"workflowId":"1181057526276915214"}'
304
+ ```
305
+
306
+ **返回(简化):**
307
+
308
+ ```json
309
+ {
310
+ "code": 200,
311
+ "data": {
312
+ "mainFormId": "1181057741029226975",
313
+ "mainFields": [
314
+ {"fieldId": "1181057741029227445", "fieldName": "申请人", "fieldType": "Employee", "single": true, "marked": true},
315
+ {"fieldId": "1181057741029227446", "fieldName": "部门", "fieldType": "Department", "single": true, "marked": true},
316
+ {"fieldId": "1181057741029227447", "fieldName": "报销日期", "fieldType": "DateComponent", "single": true, "marked": false},
317
+ {"fieldId": "1181057741029227454", "fieldName": "报销方式", "fieldType": "Select", "single": true, "marked": false, "options": [
318
+ {"optionId": "1181057741029227903", "optionName": "银行(个人报销)", "optionValue": "7"},
319
+ {"optionId": "1181057741029227900", "optionName": "冲销借款", "optionValue": "4"},
320
+ {"optionId": "1181057741029227904", "optionName": "银行(付公司)", "optionValue": "6"}
321
+ ]},
322
+ {"fieldId": "1181057741029227456", "fieldName": "报销事由", "fieldType": "TextArea", "single": false, "marked": false},
323
+ {"fieldId": "1181057741029227470", "fieldName": "相关流程", "fieldType": "Workflow", "single": false, "marked": true}
324
+ ],
325
+ "subTables": [
326
+ {
327
+ "subFormId": "1181057741029227992",
328
+ "subFormName": "费用明细",
329
+ "subFields": [
330
+ {"fieldId": "1181057741029227449", "fieldName": "相关客户", "fieldType": "Ebuilder", "single": true, "marked": true},
331
+ {"fieldId": "1181057741029227450", "fieldName": "相关项目", "fieldType": "Ebuilder", "single": true, "marked": true},
332
+ {"fieldId": "1181057741029227459", "fieldName": "实报金额", "fieldType": "Money", "single": true, "marked": false},
333
+ {"fieldId": "1181057741029227463", "fieldName": "费用类型(科目)", "fieldType": "RelateBrowser", "single": true, "marked": true},
334
+ {"fieldId": "1181057741029227464", "fieldName": "费用说明", "fieldType": "Text", "single": false, "marked": false},
335
+ {"fieldId": "1181057741029227465", "fieldName": "附件数", "fieldType": "NumberComponent", "single": true, "marked": false},
336
+ {"fieldId": "1181057741029227467", "fieldName": "费用日期", "fieldType": "DateComponent", "single": true, "marked": false},
337
+ {"fieldId": "1181057741029227468", "fieldName": "相关发票", "fieldType": "EinvoiceComponent", "single": false, "marked": false},
338
+ {"fieldId": "1181057741029227469", "fieldName": "相关凭证", "fieldType": "EinvoiceComponent", "single": true, "marked": false}
339
+ ]
340
+ }
341
+ ]
342
+ }
343
+ }
344
+ ```
345
+
346
+ ### Step 3.5: 获取预填信息 + 费用科目匹配
347
+
348
+ > **自动填单时不调用 `invoice.reim.field.search`**,费用科目通过 `invoice.reim.row-info` 返回的 subjectId 或静态科目列表匹配获取。
349
+
350
+ **调用 `invoice.reim.row-info` 获取预填信息:**
351
+
352
+ Windows PowerShell:
353
+
354
+ ```powershell
355
+ weaver-work-cli --json invoice run invoice.reim.row-info --input-json '{"invoiceId":"1295366637717012482","requestid":"1298294241967177729","cdzt":"1201729946891231232"}'
356
+ ```
357
+
358
+ macOS/Linux(bash/zsh):
359
+
360
+ ```bash
361
+ weaver-work-cli --json invoice run invoice.reim.row-info --input-json '{"invoiceId":"1295366637717012482","requestid":"1298294241967177729","cdzt":"1201729946891231232"}'
362
+ ```
363
+
364
+ **返回:**
365
+
366
+ ```json
367
+ {
368
+ "code": 200,
369
+ "status": true,
370
+ "data": {
371
+ "date": "2026-07-30",
372
+ "fysm": "交通运输服务",
373
+ "itinerary": "",
374
+ "subjectId": "100502270000000006"
375
+ }
376
+ }
377
+ ```
378
+
379
+ `invoice.reim.row-info` 返回 `subjectId = "100502270000000006"`(市内交通费)→ 直接使用。
380
+
381
+ > 如果 `subjectId` 为空,则按 [expense-subject-rules.md](reim-expense-subject-rules.md) 静态科目列表匹配:
382
+ > `sellerName` 含"滴滴" → `"100502270000000173"`;`expenseType`="市内交通" → `"100502270000000006"`;匹配不到 → 兜底 `"100502270000000104"`。
383
+
384
+ ### Step 4: 组装填单 JSON
385
+
386
+ ```json
387
+ {
388
+ "work_flow_id": "1181057526276915214",
389
+ "mainFormId": "1181057741029226975",
390
+ "request_name": "交通费报销-后端开发111-2026-08-04(共1笔)",
391
+ "main_fields": [
392
+ {"fieldId": "1181057741029227445", "value": "1201729946891231232", "fieldName": "申请人"},
393
+ {"fieldId": "1181057741029227446", "value": "1201729461554241537", "fieldName": "部门"},
394
+ {"fieldId": "1181057741029227447", "value": "2026-08-04", "fieldName": "报销日期"},
395
+ {"fieldId": "1181057741029227454", "optionValue": "7", "fieldName": "报销方式"},
396
+ {"fieldId": "1181057741029227456", "value": "2026-07-30 市内交通 - 滴滴出行", "fieldName": "报销事由"},
397
+ {"fieldId": "1181057741029227470", "value": "1298294241967177729", "fieldName": "相关流程"}
398
+ ],
399
+ "detail_rows": [
400
+ {
401
+ "dataIndex": 1,
402
+ "subFormId": "1181057741029227992",
403
+ "invoiceId": "1295366637717012482",
404
+ "fields": [
405
+ {"fieldId": "1181057741029227467", "value": "2026-07-30", "fieldName": "费用日期"},
406
+ {"fieldId": "1181057741029227459", "value": "108.2", "fieldName": "实报金额"},
407
+ {"fieldId": "1181057741029227463", "value": "100502270000000006", "fieldName": "费用类型(科目)"},
408
+ {"fieldId": "1181057741029227464", "value": "交通运输服务", "fieldName": "费用说明"},
409
+ {"fieldId": "1181057741029227465", "value": "1", "fieldName": "附件数"},
410
+ {"fieldId": "1181057741029227468", "value": "1295366637717012482", "fieldName": "相关发票"},
411
+ {"fieldId": "1181057741029227449", "value": "100504500000311504", "fieldName": "相关客户"}
412
+ ]
413
+ }
414
+ ],
415
+ "need_user_confirm": [],
416
+ "unable_to_fill": [
417
+ {"fieldId": "1181057741029227450", "fieldName": "相关项目", "reason": "事前申请中无相关项目信息"}
418
+ ]
419
+ }
420
+ ```
421
+
422
+ ### Step 5: 调用 CLI 创建报销单(prepare → 用户确认 → apply)
423
+
424
+ **第一步:prepare(将 Step 4 的 JSON 写入文件后传入)**
425
+
426
+ Windows PowerShell:
427
+
428
+ ```powershell
429
+ weaver-work-cli --json invoice run invoice.reim.flow.create.prepare --input .\reim-create.json
430
+ ```
431
+
432
+ macOS/Linux(bash/zsh):
433
+
434
+ ```bash
435
+ weaver-work-cli --json invoice run invoice.reim.flow.create.prepare --input ./reim-create.json
436
+ ```
437
+
438
+ > prepare 返回 `continuation` token 和 `preview` 摘要,展示给用户确认。
439
+
440
+ **第二步:用户确认后,调用 apply**
441
+
442
+ Windows PowerShell:
443
+
444
+ ```powershell
445
+ weaver-work-cli --json invoice run invoice.reim.flow.create.apply --input .\reim-create-apply.json
446
+ ```
447
+
448
+ macOS/Linux(bash/zsh):
449
+
450
+ ```bash
451
+ weaver-work-cli --json invoice run invoice.reim.flow.create.apply --input ./reim-create-apply.json
452
+ ```
453
+
454
+ > apply 的 JSON 需包含 `payload`(与 prepare 一致)、`continuation`(prepare 返回的 token)、`confirm: true`。
455
+
456
+ **返回:**
457
+
458
+ ```json
459
+ {
460
+ "code": 200,
461
+ "msg": "接口返回成功",
462
+ "status": true,
463
+ "data": {
464
+ "requestId": "1300266422434136064"
465
+ }
466
+ }
467
+ ```
468
+
469
+ **AI 展示给用户:**
470
+
471
+ ```markdown
472
+ ✅ 报销单创建成功!
473
+
474
+ ---
475
+
476
+ **报销标题**:交通费报销-后端开发111-2026-08-04(共1笔)
477
+ **报销事由**:2026-07-30 市内交通 - 滴滴出行
478
+ **汇总金额**:¥108.20
479
+ **查看链接**:[点击查看报销单](viewUrl)
480
+
481
+ | # | 发票号码 | 发票金额 | 费用类型 | 发生地点 | 关联凭证 |
482
+ |---|----------|----------|----------|----------|----------|
483
+ | 1 | 36901189 | ¥108.20 | 市内交通 | 仁济医院南院→浦江瑞和城 | ❌ 无凭证 |
484
+
485
+ ---
486
+
487
+ ⚠️ 以下字段无法自动填写,请手动补充:
488
+ - **相关项目**:事前申请中无相关项目信息
489
+ ```
490
+
491
+ ---
492
+
493
+ ## 示例2:多张发票 + 有事前申请(要点说明)
494
+
495
+ > 与示例1 流程一致,此处仅说明多发票场景的差异点。
496
+
497
+ **场景**:2 张发票(交通+住宿)均匹配到同一条出差事前申请。
498
+
499
+ **出差拦截**:`workFlowName` 含「差旅」或事前申请名称含「出差」→ **必须先提醒用户填写相关客户**。
500
+
501
+ ```markdown
502
+ 当前为出差报销,必须填写相关客户。请提供本次出差对应的具体客户名称,否则无法继续报销。
503
+ ```
504
+
505
+ 用户给出客户名称(如「XX科技」)→ `invoice.reim.field.search` 搜索到唯一 ID → 填入主表和明细「相关客户」→ 才允许调用 `invoice.reim.flow.create.prepare/apply`。
506
+ 用户不提供 → **不允许报销,不创建报销单**。
507
+
508
+ **填单 JSON 关键点**:
509
+
510
+ ```json
511
+ {
512
+ "work_flow_id": "来自 invoice.reim.workflow.resolve",
513
+ "request_name": "北京出差报销-张三-2026-08-04(共2笔)",
514
+ "main_fields": [
515
+ {"fieldId": "...", "value": "事前申请的creatorId", "fieldName": "申请人"},
516
+ {"fieldId": "...", "value": "事前申请的requestid", "fieldName": "相关流程"}
517
+ ],
518
+ "detail_rows": [
519
+ {
520
+ "dataIndex": 1, "subFormId": "...", "invoiceId": "INV001",
521
+ "fields": [
522
+ {"fieldId": "...", "value": "INV001", "fieldName": "相关发票(EinvoiceComponent+single=false)"},
523
+ {"fieldId": "...", "value": "76.80", "fieldName": "实报金额"}
524
+ ]
525
+ },
526
+ {
527
+ "dataIndex": 2, "subFormId": "...", "invoiceId": "INV002",
528
+ "fields": [
529
+ {"fieldId": "...", "value": "INV002", "fieldName": "相关发票(EinvoiceComponent+single=false)"},
530
+ {"fieldId": "...", "value": "480.00", "fieldName": "实报金额"}
531
+ ]
532
+ }
533
+ ]
534
+ }
535
+ ```
536
+
537
+ **要点**:
538
+ - `dataIndex` 从 1 递增,两行 `subFormId` 相同
539
+ - 两行都绑定同一个事前申请 requestid
540
+ - 每行 `invoiceId` 必须同时写入 `fields` 中 `EinvoiceComponent`+`single=false` 的字段
541
+
542
+ ---
543
+
544
+ ## 示例3:无事前申请(要点说明)
545
+
546
+ **场景**:无事前申请,`invoice.reim.workflow.resolve` 传空 requestIds `[]`,返回候选工作流列表。
547
+
548
+ **差异点**:
549
+ - 候选只有1个 → 直接使用;多个 → 自动匹配最相关的
550
+ - `相关流程`字段留空
551
+ - 其他流程与示例1 一致
552
+
553
+ ---
554
+
555
+ ## 示例4:模糊搜索返回多个候选
556
+
557
+ > **注意:非出差流程的相关客户固定填 `"100504500000311504"`(泛微上海)。出差/差旅流程必须先让用户提供具体客户,未提供则不允许报销。以下以"相关项目"字段为例说明多候选处理。**
558
+
559
+ 当搜索"相关项目"字段返回多个结果时:
560
+
561
+ **搜索命令:**
562
+
563
+ Windows PowerShell:
564
+
565
+ ```powershell
566
+ weaver-work-cli --json invoice run invoice.reim.field.search --input-json '{"keywords":"智慧园区","fieldId":"1181057741029227450","workflowId":"1181057526276915214"}'
567
+ ```
568
+
569
+ macOS/Linux(bash/zsh):
570
+
571
+ ```bash
572
+ weaver-work-cli --json invoice run invoice.reim.field.search --input-json '{"keywords":"智慧园区","fieldId":"1181057741029227450","workflowId":"1181057526276915214"}'
573
+ ```
574
+
575
+ **返回:**
576
+
577
+ ```json
578
+ {
579
+ "code": 200,
580
+ "data": [
581
+ {"name": "智慧园区一期", "id": "P001", "value": "P001"},
582
+ {"name": "智慧园区二期", "id": "P002", "value": "P002"},
583
+ {"name": "智慧园区运维", "id": "P003", "value": "P003"}
584
+ ]
585
+ }
586
+ ```
587
+
588
+ **处理方式**:该字段不放入 main_fields/detail_rows 的 fields 中,而是放入 `need_user_confirm`:
589
+
590
+ ```json
591
+ {
592
+ "need_user_confirm": [
593
+ {
594
+ "fieldId": "1181057741029227450",
595
+ "fieldName": "相关项目",
596
+ "dataIndex": 1,
597
+ "reason": "模糊搜索返回多个候选",
598
+ "candidates": [
599
+ {"id": "P001", "name": "智慧园区一期"},
600
+ {"id": "P002", "name": "智慧园区二期"},
601
+ {"id": "P003", "name": "智慧园区运维"}
602
+ ]
603
+ }
604
+ ]
605
+ }
606
+ ```
607
+
608
+ 用户选择后,将选中的 `id` 作为 `value` 补充到对应的 fields 中。
609
+
610
+ ---
611
+
612
+ ## 示例5:多候选报销单工作流自动匹配
613
+
614
+ 无事前申请,`invoice.reim.workflow.resolve` 返回 3 个候选工作流。
615
+
616
+ **自动匹配过程**(已有发票 expenseType="市内交通"):
617
+ 1. "报销流程666【活动版本V1】" — 无关键词命中
618
+ 2. "差旅费用报销" — "差旅"与交通类费用强相关 → **命中**
619
+ 3. "日常费用报销" — "日常"弱相关
620
+
621
+ → 自动选择 `workFlowId = "1250064959163990031"`(差旅费用报销),继续后续流程。
622
+
623
+ ---
624
+
625
+ ## 示例6:创建后更新报销单(Step 6 update)
626
+
627
+ 假设 Step 5 `invoice.reim.flow.create.apply` 成功,返回 `requestId = "1250065066476052001"`。
628
+
629
+ AI 已向用户展示可点击链接,使用 CLI 返回的 `viewUrl`。
630
+
631
+ ### 场景A:用户确认 need_user_confirm 中的字段
632
+
633
+ Step 5 创建时,"相关项目"字段有多个候选,放入了 `need_user_confirm`:
634
+
635
+ ```json
636
+ {
637
+ "need_user_confirm": [
638
+ {
639
+ "fieldId": "1181057741029227450",
640
+ "fieldName": "相关项目",
641
+ "dataIndex": 1,
642
+ "reason": "模糊搜索返回多个候选",
643
+ "candidates": [
644
+ {"id": "P001", "name": "智慧园区一期"},
645
+ {"id": "P002", "name": "智慧园区二期"}
646
+ ]
647
+ }
648
+ ]
649
+ }
650
+ ```
651
+
652
+ 用户选择了"智慧园区一期"(id=P001),调用 `invoice.reim.flow.update.prepare` → 用户确认 → `invoice.reim.flow.update.apply` 补充:
653
+
654
+ > 将以下 JSON 写入 `reim-update.json`,然后执行 `weaver-work-cli --json invoice run invoice.reim.flow.update.prepare --input ./reim-update.json`,用户确认后再执行 `.apply`(传入 payload + continuation + confirm:true)。
655
+
656
+ ```json
657
+ {
658
+ "requestId": 1300266422434136064,
659
+ "mainFormId": "1181057741029226975",
660
+ "detail_rows": [
661
+ {
662
+ "subFormId": "1181057741029227992",
663
+ "dataIndex": 1,
664
+ "fields": [
665
+ {"fieldId": "1181057741029227450", "fieldName": "相关项目", "value": "P001"}
666
+ ]
667
+ }
668
+ ]
669
+ }
670
+ ```
671
+
672
+ ### 场景B:用户要求修改金额 + 删除第2行明细
673
+
674
+ 用户说"第1行金额改成 120 元,第2行明细删掉":
675
+
676
+ ```json
677
+ {
678
+ "requestId": 1300266422434136064,
679
+ "mainFormId": "1181057741029226975",
680
+ "deleteDetailRows": [
681
+ {"subFormId": "1181057741029227992", "dataIndex": 2}
682
+ ],
683
+ "detail_rows": [
684
+ {
685
+ "subFormId": "1181057741029227992",
686
+ "dataIndex": 1,
687
+ "fields": [
688
+ {"fieldId": "1181057741029227459", "fieldName": "实报金额", "value": "120.00"}
689
+ ]
690
+ }
691
+ ]
692
+ }
693
+ ```
694
+
695
+ ### 场景C:用户补充 unable_to_fill 中的主表字段
696
+
697
+ Step 5 创建时,"报销事由"无法自动推断:
698
+
699
+ ```json
700
+ {"unable_to_fill": [{"fieldId": "1181057741029227456", "fieldName": "报销事由", "reason": "无法推断报销事由"}]}
701
+ ```
702
+
703
+ 用户提供了报销事由"7月份上海出差交通费":
704
+
705
+ ```json
706
+ {
707
+ "requestId": 1300266422434136064,
708
+ "mainFormId": "1181057741029226975",
709
+ "main_fields": [
710
+ {"fieldId": "1181057741029227456", "fieldName": "报销事由", "value": "7月份上海出差交通费"}
711
+ ]
712
+ }
713
+ ```
714
+
715
+ ### 场景D:删除某明细表全部行后重新填写
716
+
717
+ ```json
718
+ {
719
+ "requestId": 1300266422434136064,
720
+ "mainFormId": "1181057741029226975",
721
+ "deleteDetailRows": [
722
+ {"subFormId": "1181057741029227992", "dataIndex": -1}
723
+ ],
724
+ "detail_rows": [
725
+ {
726
+ "subFormId": "1181057741029227992",
727
+ "dataIndex": 1,
728
+ "fields": [
729
+ {"fieldId": "1181057741029227467", "fieldName": "费用日期", "value": "2026-07-30"},
730
+ {"fieldId": "1181057741029227459", "fieldName": "实报金额", "value": "108.20"},
731
+ {"fieldId": "1181057741029227468", "fieldName": "相关发票", "value": "1295366637717012482"}
732
+ ]
733
+ }
734
+ ]
735
+ }
736
+ ```
737
+
738
+ ### 返回结果
739
+
740
+ ```json
741
+ {
742
+ "code": 200,
743
+ "status": true,
744
+ "msg": "更新成功",
745
+ "data": {
746
+ "requestId": "1300266422434136064",
747
+ "deleteDetailSuccess": true,
748
+ "updateFormSuccess": true
749
+ }
750
+ }
751
+ ```
752
+
753
+ ---
754
+
755
+ ## 示例7-10:多轮对话与组合条件(精简)
756
+
757
+ > 以下示例说明多轮对话和上下文复用的处理逻辑。
758
+
759
+ ### 示例7:先查发票再报销
760
+
761
+ | 轮次 | 用户 | AI 操作 |
762
+ |------|------|---------|
763
+ | 1 | "查下我最近的发票" | 内联计算最近一周时间戳 → 调用 `invoice.list`,无结果则扩大到一个月 → 告知用户查询范围,展示发票列表,**不进入报销流程** |
764
+ | 2 | "帮我报销" | 上下文已有发票 → 跳过 1A,展示发票汇总(Step 1C)→ 用户确认 → 用发票日期筛选事前申请 → Step 2 → 2.5 → 3 → 4 → 5 |
765
+
766
+ ### 示例8:查事前申请 → 查发票 → 报销
767
+
768
+ | 轮次 | 用户 | AI 操作 |
769
+ |------|------|---------|
770
+ | 1 | "查下我的事前申请" | 调用 `invoice.reim.requests.list`,展示列表 |
771
+ | 2 | "查下对应的发票" | 复用事前申请日期,`date_begin` = 最早 createTime 的秒级时间戳,调用 `invoice.list` 展示 |
772
+ | 3 | "报销吧" | 上下文已有两组数据 → 跳过 1A/1B,直接 Step 2 → 2.5 → 3 → 4 → 5 |
773
+
774
+ ### 示例9:查询后选部分报销
775
+
776
+ | 轮次 | 用户 | AI 操作 |
777
+ |------|------|---------|
778
+ | 1 | "查下我的发票" | 查到 5 张发票并展示 |
779
+ | 2 | "只报第1张和第3张" | 从上下文取第 1、3 张发票 → 用其日期筛选事前申请 → Step 1B → 2 → ... → 5 |
780
+
781
+ ### 示例10:组合条件报销
782
+
783
+ 用户说:"报销上个月滴滴和住宿的发票"
784
+
785
+ AI 操作:
786
+ 1. 内联计算 2026-07-01 ~ 2026-07-31 的秒级时间戳,并设置 `content="滴滴"` 组装请求参数
787
+ 2. 调用 `invoice.list` 查询(CLI 支持服务端筛选,减少返回数据量)
788
+ 3. 展示发票汇总(Step 1C),用户确认后走 Step 1B → 2 → 2.5 → 3 → 4 → 5
789
+
790
+ ### 示例11:默认查询 fallback(一周无结果,自动扩到一个月)
791
+
792
+ 用户说:"帮我报销"
793
+
794
+ AI 操作:
795
+ 1. 内联计算最近一周时间戳参数
796
+ 2. 调用 `invoice.list` → 返回空(无结果)
797
+ 3. 自动内联计算最近一个月时间戳参数
798
+ 4. 再次调用 `invoice.list` → 返回 3 张发票
799
+ 5. 展示 Step 1C:
800
+
801
+ ```markdown
802
+ 最近一周(2026-08-10 ~ 2026-08-17)未找到发票,已自动扩大到最近一个月(2026-07-18 ~ 2026-08-17),共找到 3 张未报销发票,汇总金额 ¥1,288.20:
803
+
804
+ | # | 发票类型 | 开票日期 | 发票号码 | 金额 | 销方名称 | 费用类型 |
805
+ |---|----------|----------|----------|------|----------|----------|
806
+ | 1 | 增值税电子普通发票 | 2026-07-25 | 36901189 | ¥108.20 | 北京滴滴出行科技有限公司 | 市内交通 |
807
+ | 2 | 电子发票(普通发票) | 2026-07-22 | 26467088 | ¥800.00 | 如家酒店管理有限公司 | 住宿 |
808
+ | 3 | 电子发票(铁路电子客票) | 2026-07-20 | 88990001 | ¥380.00 | 铁路客运 | 市内交通 |
809
+
810
+ 请确认是否使用以上发票进行报销?如需查询其他日期范围,请告诉我。
811
+ ```
812
+
813
+ 6. 用户确认后 → Step 1B → 2 → 2.5 → 3 → 4 → 5
814
+
815
+ ---
816
+
817
+ ## 关键检查清单
818
+
819
+ 组装填单 JSON 前确认:
820
+
821
+ 1. [ ] `work_flow_id` 已设置(来自 Step 2.5 `invoice.reim.workflow.resolve` 返回)
822
+ 2. [ ] `mainFormId` 已设置(来自 Step 3 `invoice.reim.form.structure` 返回的 `mainFormId`)
823
+ 3. [ ] `request_name` 按规则生成,不超过30字
824
+ 3. [ ] 所有字段的 `fieldId` 来自 `invoice.reim.form.structure` 返回,不能自己编造
825
+ 4. [ ] Select 类型字段使用 `optionValue`(不是 `value`),值为选项的 optionValue
826
+ 5. [ ] 非 Select 类型使用 `value`
827
+ 6. [ ] marked=true 的字段 `value` 是数据ID,不是名称文本
828
+ 7. [ ] detail_rows 的 `dataIndex` 从 1 开始递增
829
+ 8. [ ] 每行明细的 `invoiceId` 对应正确的发票
830
+ 9. [ ] 每行明细的 `invoiceId` 同时赋值到 `fields` 中 `fieldType="EinvoiceComponent"` 且 `single=false` 的字段
831
+ 10. [ ] 模糊搜索多候选的字段放入 `need_user_confirm`
832
+ 11. [ ] 无法推断的字段放入 `unable_to_fill` 并说明原因
833
+ 11.5. [ ] **出差/差旅流程:相关客户已由用户提供具体名称并搜索到 ID;未提供则不允许调用 `invoice.reim.flow.create.prepare/apply`**
834
+ 12. [ ] 非出差流程:相关客户填固定值 `"100504500000311504"`
835
+
836
+ 调用 `invoice.reim.flow.update.prepare/apply` 前确认:
837
+
838
+ 12. [ ] `requestId` 来自 `invoice.reim.flow.create.apply` 的返回结果
839
+ 13. [ ] `mainFormId` 来自 `invoice.reim.form.structure` 返回的 `mainFormId`
840
+ 14. [ ] `deleteDetailRows` 推荐使用 `{subFormId, dataIndex}` 对象数组格式
841
+ 14. [ ] `detail_rows` 中每行必须包含 `subFormId`(明细表ID)
842
+ 15. [ ] `dataIndex` 是 1-based,`-1` 表示删除该明细表全部行
843
+ 16. [ ] 只传需要更新的字段,无需传完整表单
844
+ 17. [ ] `fieldName` 仅用于可读性,不影响逻辑
845
+ 18. [ ] `value` 为空 / `unable_to_fill=true` / `need_search=true` 的字段会被跳过