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
@@ -20,10 +20,10 @@ const listProperties = {
20
20
  total_end: { type: 'string', pattern: '^\\d+(\\.\\d{1,2})?$' },
21
21
  attribute: { type: 'integer', enum: [0, 1, 2] },
22
22
  sreim: {
23
- type: 'integer',
24
- enum: [0, 1, 2, 3, 4],
25
- default: 3,
26
- description: '报销状态:0=全部发票,1=发票报销中,2=报销完成,3=未报销发票,4=不可报销',
23
+ type: 'string',
24
+ enum: ['0', '1', '2', '3', '4'],
25
+ default: '3',
26
+ description: '报销状态筛选。默认不要传本字段,CLI 会使用 "3"=未报销发票;只有用户明确要求全部/报销中/已报销/不可报销时才传。取值:"0"=全部发票,"1"=发票报销中,"2"=报销完成,"3"=未报销发票,"4"=不可报销',
27
27
  },
28
28
  valids: { type: 'array', items: { type: 'integer', enum: [0, 1, 2, 3, 4, 5] } },
29
29
  sources: { type: 'array', items: { type: 'integer' } },
@@ -43,21 +43,29 @@ const listProperties = {
43
43
  required: ['sort_type', 'sort'],
44
44
  },
45
45
  },
46
- bill_type: { type: 'integer' },
46
+ bill_type: {
47
+ type: 'integer',
48
+ enum: [0, 1],
49
+ default: 0,
50
+ description: '票据类型:0=发票,1=凭证。默认不要传本字段,CLI 会使用 0 查询发票;只有用户明确要求查凭证时才传 1。',
51
+ },
47
52
  };
53
+ const positiveId = { type: 'string', pattern: '^[1-9]\\d*$' };
54
+ const positiveIdArray = { type: 'array', minItems: 1, maxItems: 100, items: positiveId };
55
+ const requestPayload = { type: 'object', minProperties: 1 };
48
56
  export const invoiceOperations = [
49
57
  {
50
58
  name: 'invoice.list',
51
59
  risk: 'read',
52
60
  scope: 'personal',
53
- fixed: { flag: 0, defaultSreim: 3 },
61
+ fixed: { flag: 0, defaultSreim: '3', defaultBillType: 0 },
54
62
  inputSchema: { type: 'object', additionalProperties: false, properties: listProperties },
55
63
  },
56
64
  {
57
65
  name: 'invoice.enterprise.list',
58
66
  risk: 'read',
59
67
  scope: 'enterprise',
60
- fixed: { flag: 6, defaultSreim: 3 },
68
+ fixed: { flag: 6, defaultSreim: '3', defaultBillType: 0 },
61
69
  inputSchema: { type: 'object', additionalProperties: false, properties: listProperties },
62
70
  },
63
71
  {
@@ -76,7 +84,7 @@ export const invoiceOperations = [
76
84
  {
77
85
  name: 'invoice.upload',
78
86
  risk: 'external-artifact',
79
- fixed: { ocr: 1 },
87
+ fixed: { ocr: 0 },
80
88
  inputSchema: {
81
89
  type: 'object',
82
90
  additionalProperties: false,
@@ -106,7 +114,7 @@ export const invoiceOperations = [
106
114
  {
107
115
  name: 'invoice.validate.preview',
108
116
  risk: 'external-read',
109
- fixed: { flag: 100, is_save: 1, needLog: false },
117
+ fixed: { flag: 100, is_save: 1, needLog: true },
110
118
  inputSchema: {
111
119
  type: 'object',
112
120
  additionalProperties: false,
@@ -125,8 +133,14 @@ export const invoiceOperations = [
125
133
  additionalProperties: false,
126
134
  properties: {
127
135
  file: { type: 'string', minLength: 1 },
128
- validate: { type: 'boolean' },
129
- syncToOa: { type: 'boolean' },
136
+ validate: {
137
+ type: 'boolean',
138
+ description: '是否在导入时请求服务端查验。正常上传发票流程默认应传 true;只有用户明确要求跳过查验时才传 false。',
139
+ },
140
+ syncToOa: {
141
+ type: 'boolean',
142
+ description: '是否同步到 OA。validate=true 时必须为 true;正常导入推荐传 true。',
143
+ },
130
144
  },
131
145
  required: ['file', 'validate', 'syncToOa'],
132
146
  },
@@ -258,6 +272,200 @@ export const invoiceOperations = [
258
272
  required: ['continuation', 'confirm'],
259
273
  },
260
274
  },
275
+ {
276
+ name: 'invoice.browse-field.data',
277
+ risk: 'read',
278
+ fixed: { source: 'POST /api/inc/get', mask: 0, userFlag: '1', isDelFlag: '1' },
279
+ inputSchema: {
280
+ type: 'object',
281
+ additionalProperties: false,
282
+ properties: {
283
+ fid: positiveId,
284
+ fids: positiveIdArray,
285
+ detail: { type: 'object' },
286
+ },
287
+ oneOf: [{ required: ['fid'] }, { required: ['fids'] }, { required: ['detail'] }],
288
+ },
289
+ },
290
+ {
291
+ name: 'invoice.reim.file-ocr.preview',
292
+ risk: 'read-with-upload',
293
+ fixed: { path: '/api/inc/book/fileIdToInvoicesAndOcr' },
294
+ inputSchema: {
295
+ type: 'object',
296
+ additionalProperties: false,
297
+ properties: {
298
+ fileId: { type: 'string', pattern: '^[1-9]\\d*(,[1-9]\\d*)*$' },
299
+ fileIds: positiveIdArray,
300
+ },
301
+ oneOf: [{ required: ['fileId'] }, { required: ['fileIds'] }],
302
+ },
303
+ },
304
+ {
305
+ name: 'invoice.reim.requests.list',
306
+ risk: 'read',
307
+ fixed: { path: '/api/inc/book/getRequestListByTabId', defaultPageNo: 1, defaultPageSize: 20 },
308
+ inputSchema: {
309
+ type: 'object',
310
+ additionalProperties: false,
311
+ properties: {
312
+ pageNo: { type: 'integer', minimum: 1, maximum: 10000, default: 1 },
313
+ pageSize: { type: 'integer', minimum: 1, maximum: 200, default: 20 },
314
+ requestname: { type: 'string', minLength: 1 },
315
+ cusCreateDateStart: { type: 'string', pattern: '^\\d{4}-\\d{2}-\\d{2}$' },
316
+ cusCreateDateEnd: { type: 'string', pattern: '^\\d{4}-\\d{2}-\\d{2}$' },
317
+ },
318
+ },
319
+ },
320
+ {
321
+ name: 'invoice.reim.workflow.resolve',
322
+ risk: 'read',
323
+ fixed: { path: '/api/inc/book/getReimburseWorkflowByRequestIds' },
324
+ inputSchema: {
325
+ type: 'object',
326
+ additionalProperties: false,
327
+ properties: {
328
+ requestIds: { type: 'array', maxItems: 100, items: positiveId, default: [] },
329
+ },
330
+ },
331
+ },
332
+ {
333
+ name: 'invoice.reim.form.structure',
334
+ risk: 'read',
335
+ fixed: { path: '/api/inc/book/getFormStructure', defaultNodeId: '1' },
336
+ inputSchema: {
337
+ type: 'object',
338
+ additionalProperties: false,
339
+ properties: {
340
+ workflowId: positiveId,
341
+ nodeId: { type: 'string', minLength: 1, default: '1' },
342
+ },
343
+ required: ['workflowId'],
344
+ },
345
+ },
346
+ {
347
+ name: 'invoice.reim.row-info',
348
+ risk: 'read',
349
+ fixed: { path: '/api/secondev/fna/expense/dataInfo/getRowInfo', sf_request_type: 'fetch' },
350
+ inputSchema: {
351
+ type: 'object',
352
+ additionalProperties: false,
353
+ properties: {
354
+ invoiceId: positiveId,
355
+ requestid: { type: 'string' },
356
+ cdzt: positiveId,
357
+ },
358
+ required: ['invoiceId'],
359
+ },
360
+ },
361
+ {
362
+ name: 'invoice.reim.employee-superiors',
363
+ risk: 'read',
364
+ fixed: { path: '/api/inc/book/getEmployeeSuperiors' },
365
+ inputSchema: {
366
+ type: 'object',
367
+ additionalProperties: false,
368
+ properties: {},
369
+ },
370
+ },
371
+ {
372
+ name: 'invoice.reim.field.search',
373
+ risk: 'read',
374
+ fixed: { path: '/api/government/formStructure/fieldRelateSearch', formModeType: 'wf', defaultNodeId: '100004140000000271' },
375
+ inputSchema: {
376
+ type: 'object',
377
+ additionalProperties: false,
378
+ properties: {
379
+ keywords: { type: 'string', minLength: 1 },
380
+ fieldId: positiveId,
381
+ workflowId: positiveId,
382
+ nodeId: { type: 'string', minLength: 1, default: '100004140000000271' },
383
+ },
384
+ required: ['keywords', 'fieldId', 'workflowId'],
385
+ },
386
+ },
387
+ {
388
+ name: 'invoice.reim.flow.create.prepare',
389
+ risk: 'read-before-write',
390
+ fixed: { path: '/api/inc/book/createFlowNew' },
391
+ inputSchema: {
392
+ type: 'object',
393
+ additionalProperties: false,
394
+ properties: { payload: requestPayload },
395
+ required: ['payload'],
396
+ },
397
+ },
398
+ {
399
+ name: 'invoice.reim.flow.create.apply',
400
+ risk: 'high-risk-write',
401
+ inputSchema: {
402
+ type: 'object',
403
+ additionalProperties: false,
404
+ properties: {
405
+ payload: requestPayload,
406
+ continuation: { type: 'string', minLength: 1 },
407
+ confirm: { const: true },
408
+ },
409
+ required: ['payload', 'continuation', 'confirm'],
410
+ },
411
+ },
412
+ {
413
+ name: 'invoice.reim.flow.update.prepare',
414
+ risk: 'read-before-write',
415
+ fixed: { path: '/api/inc/book/updateFlow' },
416
+ inputSchema: {
417
+ type: 'object',
418
+ additionalProperties: false,
419
+ properties: { payload: requestPayload },
420
+ required: ['payload'],
421
+ },
422
+ },
423
+ {
424
+ name: 'invoice.reim.flow.update.apply',
425
+ risk: 'high-risk-write',
426
+ inputSchema: {
427
+ type: 'object',
428
+ additionalProperties: false,
429
+ properties: {
430
+ payload: requestPayload,
431
+ continuation: { type: 'string', minLength: 1 },
432
+ confirm: { const: true },
433
+ },
434
+ required: ['payload', 'continuation', 'confirm'],
435
+ },
436
+ },
437
+ {
438
+ name: 'invoice.issuing.make.prepare',
439
+ risk: 'read-before-write',
440
+ fixed: {
441
+ path: '/api/inc/book/open/makeInvoice',
442
+ sellerName: '上海泛微网络科技股份有限公司',
443
+ taxNo: '9131000070322836XD',
444
+ },
445
+ inputSchema: {
446
+ type: 'object',
447
+ additionalProperties: false,
448
+ properties: {
449
+ mode: { type: 'string', enum: ['issue', 'ledger'] },
450
+ payload: requestPayload,
451
+ },
452
+ required: ['mode', 'payload'],
453
+ },
454
+ },
455
+ {
456
+ name: 'invoice.issuing.make.apply',
457
+ risk: 'high-risk-write',
458
+ inputSchema: {
459
+ type: 'object',
460
+ additionalProperties: false,
461
+ properties: {
462
+ payload: requestPayload,
463
+ continuation: { type: 'string', minLength: 1 },
464
+ confirm: { const: true },
465
+ },
466
+ required: ['payload', 'continuation', 'confirm'],
467
+ },
468
+ },
261
469
  ];
262
470
  export const invoiceManifest = {
263
471
  schemaVersion: 1,
@@ -271,15 +479,15 @@ export const invoiceManifest = {
271
479
  withheldOperations: [
272
480
  {
273
481
  name: 'invoice.share',
274
- reason: '缺少接收人 appid/cid/uid 的稳定解析来源和共享关系回查契约。',
482
+ reason: '新增源资料给出 /api/inc/shareUsers 请求体,但仍缺少接收人 appid/cid/uid 的 CLI 解析来源和共享关系回查契约。',
275
483
  },
276
484
  {
277
485
  name: 'invoice.transfer',
278
- reason: '缺少接收人归属回查契约,转让会改变发票持有人,暂不让 Agent 猜测。',
486
+ reason: '新增源资料给出 /api/inc/transferFpyUser 请求体,但转让会改变发票持有人,仍缺少接收人侧归属回查契约。',
279
487
  },
280
488
  {
281
489
  name: 'invoice.tag',
282
- reason: '缺少标签定义来源、当前关系查询和移除/替换语义。',
490
+ reason: '新增源资料给出 /api/my/tag/common/batchAddEntityTag 请求体,但仍缺少标签定义查询、当前标签关系回查和移除/替换语义。',
283
491
  },
284
492
  ],
285
493
  };
@@ -0,0 +1,17 @@
1
+ import { asObject, browseFieldData, getDetailsByFids, normalizeFids, workflow, } from './shared.js';
2
+ export class InvoiceBrowseFieldDataOperation {
3
+ name = 'invoice.browse-field.data';
4
+ async execute(input, { host }) {
5
+ const detail = input.detail === undefined
6
+ ? asObject(await getDetailsByFids(normalizeFids(input), host), 'detail')
7
+ : asObject(input.detail, 'detail');
8
+ const data = browseFieldData(detail);
9
+ return {
10
+ status: data.errors.length ? 'PARTIAL' : 'COMPLETE',
11
+ data: {
12
+ ...data,
13
+ workflow: workflow('invoice.browse-field.data', data.errors.length ? 'PARTIAL' : 'COMPLETE'),
14
+ },
15
+ };
16
+ }
17
+ }
@@ -0,0 +1,198 @@
1
+ import { invoiceConfirmationError, invoicePartialError, invoiceValidationError, isInvoiceNetworkError } from '../errors.js';
2
+ import { asNonEmptyString, asObject, assertBusinessSuccess, objectFingerprint, sessionMatches, workflow, } from './shared.js';
3
+ const SELLER_TAX_NO = '9131000070322836XD';
4
+ const SELLER_NAME = '上海泛微网络科技股份有限公司';
5
+ const TAX_RATES = new Set([0, 0.01, 0.03, 0.05, 0.06, 0.09, 0.13]);
6
+ function optionalText(value, name) {
7
+ if (value === undefined || value === null || value === '')
8
+ return undefined;
9
+ return asNonEmptyString(value, name);
10
+ }
11
+ function money(value, name) {
12
+ if (typeof value === 'number') {
13
+ if (!Number.isFinite(value) || value < 0)
14
+ throw invoiceValidationError('input_invalid', `${name} 必须是非负金额`);
15
+ return value;
16
+ }
17
+ if (typeof value !== 'string' || !/^\d+(?:\.\d+)?$/u.test(value)) {
18
+ throw invoiceValidationError('input_invalid', `${name} 必须是非负金额`);
19
+ }
20
+ return value;
21
+ }
22
+ function taxRate(value, name) {
23
+ const parsed = typeof value === 'number' ? value : Number(value);
24
+ if (!Number.isFinite(parsed) || !TAX_RATES.has(parsed)) {
25
+ throw invoiceValidationError('input_invalid', `${name} 必须是合法税率:0、0.01、0.03、0.05、0.06、0.09 或 0.13`);
26
+ }
27
+ return typeof value === 'number' ? value : String(value);
28
+ }
29
+ function taxNo(value, name, { required = false } = {}) {
30
+ const text = optionalText(value, name);
31
+ if (text === undefined) {
32
+ if (required)
33
+ throw invoiceValidationError('input_invalid', `${name} 必填`);
34
+ return undefined;
35
+ }
36
+ if (!/^[0-9A-Z]{15,20}$/u.test(text)) {
37
+ throw invoiceValidationError('input_invalid', `${name} 必须是 15-20 位数字或大写字母`);
38
+ }
39
+ return text;
40
+ }
41
+ function normalizeMode(value) {
42
+ if (value !== 'issue' && value !== 'ledger') {
43
+ throw invoiceValidationError('input_invalid', 'mode 必须是 issue 或 ledger');
44
+ }
45
+ return value;
46
+ }
47
+ function normalizeDetail(value, index) {
48
+ const detail = structuredClone(asObject(value, `payload.details[${index}]`));
49
+ detail.goodsName = asNonEmptyString(detail.goodsName, `payload.details[${index}].goodsName`);
50
+ detail.taxRate = taxRate(detail.taxRate, `payload.details[${index}].taxRate`);
51
+ detail.amount = money(detail.amount, `payload.details[${index}].amount`);
52
+ detail.amountWithTax = money(detail.amountWithTax, `payload.details[${index}].amountWithTax`);
53
+ if (detail.taxAmount !== undefined)
54
+ detail.taxAmount = money(detail.taxAmount, `payload.details[${index}].taxAmount`);
55
+ if (detail.revenueCode !== undefined && !/^\d{4,19}$/u.test(String(detail.revenueCode))) {
56
+ throw invoiceValidationError('input_invalid', `payload.details[${index}].revenueCode 必须是数字编码`);
57
+ }
58
+ for (const key of ['quantity', 'unitPrice', 'unit', 'specification']) {
59
+ if (detail[key] !== undefined && detail[key] !== null)
60
+ detail[key] = String(detail[key]);
61
+ }
62
+ return detail;
63
+ }
64
+ function normalizeMakeInvoicePayload(rawPayload, mode) {
65
+ const payload = structuredClone(asObject(rawPayload, 'payload'));
66
+ const purchaserName = asNonEmptyString(payload.purchaserName, 'payload.purchaserName');
67
+ const invoiceType = asNonEmptyString(payload.invoiceType, 'payload.invoiceType');
68
+ if (!['7', '8', '9', '10'].includes(invoiceType)) {
69
+ throw invoiceValidationError('input_invalid', 'payload.invoiceType 必须是 7、8、9 或 10');
70
+ }
71
+ const specialInvoice = invoiceType === '8' || invoiceType === '10';
72
+ const purchaserTaxNo = taxNo(payload.purchaserTaxNo, 'payload.purchaserTaxNo', { required: specialInvoice });
73
+ if (!Array.isArray(payload.details) || !payload.details.length) {
74
+ throw invoiceValidationError('input_invalid', 'payload.details 必须是非空数组');
75
+ }
76
+ const details = payload.details.map((item, index) => normalizeDetail(item, index));
77
+ const normalized = {
78
+ ...payload,
79
+ taxNo: SELLER_TAX_NO,
80
+ sellerName: SELLER_NAME,
81
+ billingType: payload.billingType || '0',
82
+ invoiceType,
83
+ externalDocumentNo: asNonEmptyString(payload.externalDocumentNo, 'payload.externalDocumentNo'),
84
+ sourceType: payload.sourceType || '4',
85
+ asyncCallFlag: payload.asyncCallFlag || '1',
86
+ invoiceMethod: payload.invoiceMethod || '5',
87
+ taxSign: payload.taxSign || '1',
88
+ personLogo: payload.personLogo || (purchaserTaxNo ? '0' : '1'),
89
+ purchaserName,
90
+ details,
91
+ totalAmount: money(payload.totalAmount, 'payload.totalAmount'),
92
+ taxAmount: money(payload.taxAmount, 'payload.taxAmount'),
93
+ totalAmountWithTax: money(payload.totalAmountWithTax, 'payload.totalAmountWithTax'),
94
+ };
95
+ if (purchaserTaxNo !== undefined)
96
+ normalized.purchaserTaxNo = purchaserTaxNo;
97
+ for (const key of ['purchaserAddress', 'purchaserTel', 'purchaserBankName', 'purchaserBankAccount', 'remark', 'invoiceDate']) {
98
+ if (payload[key] !== undefined && payload[key] !== null)
99
+ normalized[key] = String(payload[key]);
100
+ }
101
+ if (mode === 'ledger')
102
+ normalized.operateType = '5';
103
+ else
104
+ delete normalized.operateType;
105
+ return normalized;
106
+ }
107
+ function makeInvoicePreview(payload, mode) {
108
+ return {
109
+ mode,
110
+ purchaserName: payload.purchaserName,
111
+ purchaserTaxNo: payload.purchaserTaxNo || '',
112
+ invoiceType: payload.invoiceType,
113
+ externalDocumentNo: payload.externalDocumentNo,
114
+ totalAmount: payload.totalAmount,
115
+ taxAmount: payload.taxAmount,
116
+ totalAmountWithTax: payload.totalAmountWithTax,
117
+ detailCount: Array.isArray(payload.details) ? payload.details.length : 0,
118
+ };
119
+ }
120
+ export class InvoiceIssuingMakePrepareOperation {
121
+ name = 'invoice.issuing.make.prepare';
122
+ async execute(input, { host, continuation }) {
123
+ const mode = normalizeMode(input.mode);
124
+ const payload = normalizeMakeInvoicePayload(input.payload, mode);
125
+ const session = await host.getSession();
126
+ const preview = makeInvoicePreview(payload, mode);
127
+ const continuationToken = await continuation.issue({
128
+ operation: 'invoice.issuing.make.apply',
129
+ workflow: workflow('invoice.issuing.make', 'AWAITING_CONFIRMATION'),
130
+ baseUrl: session.baseUrl,
131
+ profile: session.profile,
132
+ userId: session.userId,
133
+ mode,
134
+ fingerprint: objectFingerprint(payload),
135
+ preview,
136
+ });
137
+ return {
138
+ status: 'AWAITING_CONFIRMATION',
139
+ data: {
140
+ preview,
141
+ normalizedPayload: payload,
142
+ continuation: continuationToken,
143
+ expiresInSeconds: 600,
144
+ workflow: workflow('invoice.issuing.make', 'AWAITING_CONFIRMATION'),
145
+ },
146
+ };
147
+ }
148
+ }
149
+ export class InvoiceIssuingMakeApplyOperation {
150
+ name = 'invoice.issuing.make.apply';
151
+ async execute(input, { host, continuation }) {
152
+ if (input.confirm !== true)
153
+ throw invoiceConfirmationError('invoice.issuing.make.apply', { hint: '重新调用时传入 confirm=true' });
154
+ const lease = await continuation.verify(input.continuation, 'invoice.issuing.make.apply');
155
+ const mode = normalizeMode(lease.mode);
156
+ const payload = normalizeMakeInvoicePayload(input.payload, mode);
157
+ if (typeof lease.fingerprint !== 'string')
158
+ throw invoiceValidationError('continuation_invalid', '开票 continuation 缺少 payload 指纹');
159
+ if (objectFingerprint(payload) !== lease.fingerprint)
160
+ throw invoiceValidationError('target_changed', '开票载荷与确认时不一致,请重新准备');
161
+ const session = await host.getSession();
162
+ if (!sessionMatches(lease, session))
163
+ throw invoiceValidationError('context_mismatch', '确认上下文已变化,请重新准备开票');
164
+ let result;
165
+ try {
166
+ result = await host.invoiceRequest({ path: '/api/inc/book/open/makeInvoice', method: 'POST', body: payload, operation: this.name, timeoutMs: 90_000 });
167
+ }
168
+ catch (error) {
169
+ if (isInvoiceNetworkError(error)) {
170
+ throw invoicePartialError('开票请求发送后连接中断,结果不确定,禁止自动重试', {
171
+ preview: lease.preview,
172
+ workflow: workflow('invoice.issuing.make', 'EXECUTING'),
173
+ }, { stage: 'issuing-make' });
174
+ }
175
+ throw error;
176
+ }
177
+ assertBusinessSuccess(result, 'issuing_make_failed', '开票或存台账失败');
178
+ const data = result?.data || {};
179
+ if (!data.serialNo && !data.orderNo && mode === 'issue') {
180
+ throw invoicePartialError('开票接口返回成功但缺少流水号,结果不确定', {
181
+ preview: lease.preview,
182
+ result,
183
+ workflow: workflow('invoice.issuing.make', 'VERIFYING'),
184
+ }, { stage: 'issuing-make-response' });
185
+ }
186
+ return {
187
+ status: 'COMPLETE',
188
+ data: {
189
+ mode,
190
+ serialNo: data.serialNo,
191
+ orderNo: data.orderNo,
192
+ ledgerOnly: mode === 'ledger',
193
+ result,
194
+ workflow: workflow('invoice.issuing.make', 'COMPLETE'),
195
+ },
196
+ };
197
+ }
198
+ }
@@ -1,4 +1,5 @@
1
1
  import { InvoiceCliError, invoiceValidationError } from '../errors.js';
2
+ import { toErrorEnvelope } from '../../../core/errors.js';
2
3
  import { previewOcr, uploadFromInput, uploadInvoiceFile, workflow } from './shared.js';
3
4
  export class InvoiceOcrPreviewOperation {
4
5
  name = 'invoice.ocr.preview';
@@ -10,16 +11,18 @@ export class InvoiceOcrPreviewOperation {
10
11
  throw invoiceValidationError('input_ambiguous', 'upload 与 file/url 只能选择一种来源');
11
12
  }
12
13
  const suppliedUpload = uploadFromInput(input);
13
- const upload = suppliedUpload || await uploadInvoiceFile(input, host);
14
+ const upload = suppliedUpload || await uploadInvoiceFile(input, host, { ocr: true });
14
15
  let ocr;
15
16
  try {
16
17
  ocr = await previewOcr(upload, host);
17
18
  }
18
19
  catch (error) {
19
20
  if (!suppliedUpload) {
20
- throw new InvoiceCliError('partial', 'artifact_uploaded', '文件已上传但 OCR 预览失败,不能自动重复上传', {
21
+ const cause = toErrorEnvelope(error);
22
+ throw new InvoiceCliError('partial', 'artifact_uploaded', `文件已上传但 OCR 预览失败:${cause.message}`, {
23
+ code: cause.code,
21
24
  partialData: { upload, workflow: workflow('invoice.ocr.preview', 'OCR_RUNNING') },
22
- details: { stage: 'ocr' },
25
+ details: { stage: 'ocr', cause },
23
26
  exitCode: 11,
24
27
  });
25
28
  }
@@ -1,12 +1,15 @@
1
1
  import { invoiceValidationError } from '../errors.js';
2
2
  import { invoiceOperations } from '../manifest.js';
3
3
  import { InvoiceAddApplyOperation, InvoiceAddPrepareOperation } from './add.js';
4
+ import { InvoiceBrowseFieldDataOperation } from './browse-field.js';
4
5
  import { InvoiceDeleteApplyOperation, InvoiceDeletePrepareOperation } from './delete.js';
5
6
  import { InvoiceDownloadOperation } from './download.js';
6
7
  import { InvoiceGetOperation } from './get.js';
7
8
  import { InvoiceImportApplyOperation, InvoiceImportPrepareOperation } from './import.js';
9
+ import { InvoiceIssuingMakeApplyOperation, InvoiceIssuingMakePrepareOperation } from './issuing.js';
8
10
  import { InvoiceListOperation } from './list.js';
9
11
  import { InvoiceOcrPreviewOperation } from './ocr-preview.js';
12
+ import { InvoiceReimEmployeeSuperiorsOperation, InvoiceReimFieldSearchOperation, InvoiceReimFileOcrPreviewOperation, InvoiceReimFlowCreateApplyOperation, InvoiceReimFlowCreatePrepareOperation, InvoiceReimFlowUpdateApplyOperation, InvoiceReimFlowUpdatePrepareOperation, InvoiceReimFormStructureOperation, InvoiceReimRequestsListOperation, InvoiceReimRowInfoOperation, InvoiceReimWorkflowResolveOperation, } from './reim.js';
10
13
  import { InvoiceUpdateApplyOperation, InvoiceUpdatePrepareOperation } from './update.js';
11
14
  import { InvoiceUploadOperation } from './upload.js';
12
15
  import { InvoiceValidatePreviewOperation } from './validate-preview.js';
@@ -28,6 +31,20 @@ function buildRegistry() {
28
31
  new InvoiceDownloadOperation(),
29
32
  new InvoiceDeletePrepareOperation(),
30
33
  new InvoiceDeleteApplyOperation(),
34
+ new InvoiceBrowseFieldDataOperation(),
35
+ new InvoiceReimFileOcrPreviewOperation(),
36
+ new InvoiceReimRequestsListOperation(),
37
+ new InvoiceReimWorkflowResolveOperation(),
38
+ new InvoiceReimFormStructureOperation(),
39
+ new InvoiceReimRowInfoOperation(),
40
+ new InvoiceReimEmployeeSuperiorsOperation(),
41
+ new InvoiceReimFieldSearchOperation(),
42
+ new InvoiceReimFlowCreatePrepareOperation(),
43
+ new InvoiceReimFlowCreateApplyOperation(),
44
+ new InvoiceReimFlowUpdatePrepareOperation(),
45
+ new InvoiceReimFlowUpdateApplyOperation(),
46
+ new InvoiceIssuingMakePrepareOperation(),
47
+ new InvoiceIssuingMakeApplyOperation(),
31
48
  ];
32
49
  for (const handler of handlers) {
33
50
  if (registry.has(handler.name))