weaver-work-cli 0.1.42 → 0.1.45

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 (401) hide show
  1. package/README.md +21 -0
  2. package/dist/chunks/{archive-J4I6MCKF.js → archive-ZQ4A4TV6.js} +399 -47
  3. package/dist/chunks/{archive-oa-BRZKKTO4.js → archive-oa-BBDP7AKJ.js} +12 -5
  4. package/dist/chunks/{asset-L7D4FAOZ.js → asset-ZOJVBWZH.js} +11 -4
  5. package/dist/chunks/{asset-idle-DADLLV75.js → asset-idle-XGB5IPGT.js} +7 -3
  6. package/dist/chunks/{attachment-content-K4C7VLWQ.js → attachment-content-CE3GMWTS.js} +5 -4
  7. package/dist/chunks/{blog-BVGQ7NZL.js → blog-QSHLZSFW.js} +11 -4
  8. package/dist/chunks/caizhilian-KCQYFH72.js +204 -0
  9. package/dist/chunks/{calendar-Q7NQY5Z2.js → calendar-DLGMRJQA.js} +12 -5
  10. package/dist/chunks/{chunk-W7BEHOSR.js → chunk-3WBIQLMB.js} +2 -2
  11. package/dist/chunks/{chunk-4PD5NWAX.js → chunk-3YV7PKRL.js} +2 -2
  12. package/dist/chunks/{chunk-JPRO6ER2.js → chunk-3ZMAQQ3W.js} +185 -60
  13. package/dist/chunks/{chunk-R4CHUSKC.js → chunk-4EXOIQDI.js} +40 -10
  14. package/dist/chunks/{chunk-OOUTBLZ4.js → chunk-56EZERK4.js} +1 -1
  15. package/dist/chunks/chunk-6N4JPNFL.js +76 -0
  16. package/dist/chunks/{chunk-SA6VBIHY.js → chunk-6NXT4ICB.js} +342 -17
  17. package/dist/chunks/{chunk-ZUX3P6BQ.js → chunk-727FH2NI.js} +1 -1
  18. package/dist/chunks/chunk-762M5XJS.js +215 -0
  19. package/dist/chunks/{chunk-GEWYMQME.js → chunk-77YP6I52.js} +1 -1
  20. package/dist/chunks/chunk-7BDPM5ST.js +11 -0
  21. package/dist/chunks/{chunk-G4UR6NXN.js → chunk-CZNZKOHR.js} +3 -3
  22. package/dist/chunks/{chunk-GHXCDPTM.js → chunk-DGMYACGJ.js} +1 -1
  23. package/dist/chunks/{chunk-4RAE6JXP.js → chunk-DLY5GUXX.js} +6 -3
  24. package/dist/chunks/{chunk-BYBSCN4X.js → chunk-G7PQWD4L.js} +6 -3
  25. package/dist/chunks/{chunk-EKWAQSLU.js → chunk-GR76ZDDX.js} +432 -2248
  26. package/dist/chunks/{chunk-APVFJUQH.js → chunk-HFXK54M4.js} +3 -3
  27. package/dist/chunks/{chunk-EZALDOQH.js → chunk-HP7JIYMT.js} +5 -2
  28. package/dist/chunks/{chunk-ZEDWSH32.js → chunk-IC62NFM5.js} +1 -1
  29. package/dist/chunks/{chunk-3KTFS4IA.js → chunk-JB34OE7R.js} +808 -85
  30. package/dist/chunks/{chunk-72CKAUAG.js → chunk-JWWTI63L.js} +59 -7
  31. package/dist/chunks/{chunk-P26ZWSKU.js → chunk-KIHNAS25.js} +5 -2
  32. package/dist/chunks/{chunk-NKZRQXST.js → chunk-LGKWL4OH.js} +200 -47
  33. package/dist/chunks/chunk-LRCPNDZA.js +2529 -0
  34. package/dist/chunks/{chunk-QKNKR4RH.js → chunk-LXFVWZLM.js} +4 -4
  35. package/dist/chunks/{chunk-NOODWMCL.js → chunk-O6CMPO65.js} +25 -2
  36. package/dist/chunks/{chunk-BIPYLLVS.js → chunk-OAE3AZBQ.js} +15 -15
  37. package/dist/chunks/chunk-P5GQRWDC.js +60 -0
  38. package/dist/chunks/{caizhilian-SAADNFD6.js → chunk-PGO4ILMQ.js} +44 -517
  39. package/dist/chunks/{chunk-2LV74IWP.js → chunk-Q4OYAQYH.js} +1 -1
  40. package/dist/chunks/{chunk-LDZQPUIA.js → chunk-T4MWQAQB.js} +8 -6
  41. package/dist/chunks/{chunk-BBKDXQEC.js → chunk-TGAGQV4I.js} +3 -3
  42. package/dist/chunks/{chunk-GPMFD4RD.js → chunk-TXUG266F.js} +1 -1
  43. package/dist/chunks/{chunk-FOAA27U5.js → chunk-U6R6FZHD.js} +184 -18
  44. package/dist/chunks/{chunk-LUSPKZKY.js → chunk-UG5G54VL.js} +1 -0
  45. package/dist/chunks/{chunk-NIAJ5ZCG.js → chunk-UL5XUQ25.js} +5 -2
  46. package/dist/chunks/{chunk-IZ7S7QUS.js → chunk-VIMCY4DI.js} +6 -6
  47. package/dist/chunks/chunk-VRPH24IC.js +76 -0
  48. package/dist/chunks/{chunk-FMPJJYYI.js → chunk-WRXSAVKO.js} +1 -1
  49. package/dist/chunks/{chunk-YRSZQUD2.js → chunk-YIKSL36S.js} +3 -3
  50. package/dist/chunks/{chunk-3SO6QL6U.js → chunk-YWX377BY.js} +5 -2
  51. package/dist/chunks/{chunk-BYATLLEF.js → chunk-Z3GDFVJR.js} +1 -1
  52. package/dist/chunks/{chunk-LADPYOWC.js → chunk-Z6UUBY37.js} +3 -3
  53. package/dist/chunks/{conflict-F2OMZRTO.js → conflict-IYJETSGT.js} +4 -3
  54. package/dist/chunks/{continuation-2CKSBLA6.js → continuation-3S37AUSH.js} +4 -3
  55. package/dist/chunks/{continuation-RN6PZN2M.js → continuation-3XLYYTKV.js} +4 -3
  56. package/dist/chunks/continuation-GW6PRWK3.js +12 -0
  57. package/dist/chunks/{continuation-HZIZRZBX.js → continuation-HFW2YT5S.js} +4 -3
  58. package/dist/chunks/{continuation-NLECEJPX.js → continuation-KI7DRRZN.js} +4 -3
  59. package/dist/chunks/{contract-5BETHRSG.js → contract-3QLAGYQL.js} +5803 -4593
  60. package/dist/chunks/{cowork-3MN6EQQO.js → cowork-3ACICHDQ.js} +11 -4
  61. package/dist/chunks/{create-flow-5FQNNMVO.js → create-flow-7JLC7UID.js} +8 -7
  62. package/dist/chunks/{ebuilder-form-SBHOYBUD.js → ebuilder-form-GWDTKEI2.js} +14 -9
  63. package/dist/chunks/{ehr-KMOJULKG.js → ehr-MYRDCHZ4.js} +357 -43
  64. package/dist/chunks/{employee-SAK2QYXX.js → employee-NOHNXC46.js} +3 -3
  65. package/dist/chunks/{env-LB7NBL2O.js → env-3MBHAWBL.js} +4 -3
  66. package/dist/chunks/{esb-W2PJCFCX.js → esb-4BQHNP5C.js} +12 -7
  67. package/dist/chunks/{factory-6ZFQXQ46.js → factory-TZEVU4DU.js} +3 -2
  68. package/dist/chunks/{fna-ZQPCUV4R.js → fna-ZVB2IILI.js} +14 -8
  69. package/dist/chunks/{group-chat-2HHAJN46.js → group-chat-KL3HFKRM.js} +5 -4
  70. package/dist/chunks/{host-YTODKMSL.js → host-3TNBMDTR.js} +5 -5
  71. package/dist/chunks/host-7NTIBSPK.js +25 -0
  72. package/dist/chunks/{host-4CBHGOHT.js → host-7OWWPLM4.js} +5 -5
  73. package/dist/chunks/{host-ATKVNZAT.js → host-G3VU7SDW.js} +5 -5
  74. package/dist/chunks/{host-BQH22NTQ.js → host-M4XP5URR.js} +5 -5
  75. package/dist/chunks/{host-X2CSLFM6.js → host-TUOIOEMC.js} +5 -5
  76. package/dist/chunks/{hrm-FFM4UJFS.js → hrm-UNKCCCGP.js} +11 -7
  77. package/dist/chunks/{im-VEHKDQPB.js → im-NJB7ZYMH.js} +8 -7
  78. package/dist/chunks/{invoice-LVIKSIIF.js → invoice-OQP3TMKQ.js} +636 -1768
  79. package/dist/chunks/{jiuchuanhui-X6DINO5P.js → jiuchuanhui-ASFZBMPU.js} +14 -6
  80. package/dist/chunks/{lazy-dispatch-KSWTN5L6.js → lazy-dispatch-UH6HGK2I.js} +7 -6
  81. package/dist/chunks/{mail-VDKRGUD3.js → mail-M3HJF5ER.js} +16 -14
  82. package/dist/chunks/{meeting-CLC6HP3Z.js → meeting-C67EHQ4Z.js} +21 -14
  83. package/dist/chunks/{okr-CHG4OO3U.js → okr-EVX7FB5G.js} +12 -5
  84. package/dist/chunks/{operations-5QL3AECO.js → operations-62N6EP3C.js} +4 -3
  85. package/dist/chunks/operations-J7PUIVWZ.js +15 -0
  86. package/dist/chunks/{plan-XWR75667.js → plan-2QJQEPBO.js} +12 -5
  87. package/dist/chunks/{project-5BXOOKMG.js → project-XELELW2T.js} +11 -4
  88. package/dist/chunks/reception-5WITA44R.js +1899 -0
  89. package/dist/chunks/{recruit-stage-DGMFNNDE.js → recruit-stage-AHY5QAMF.js} +745 -149
  90. package/dist/chunks/{registry-RHMW6ANW.js → registry-AQVGHUM6.js} +7 -6
  91. package/dist/chunks/{registry-OZSMDVPP.js → registry-PVUZQDDQ.js} +3 -3
  92. package/dist/chunks/{registry-7FFOXIAW.js → registry-QJCZ2GVG.js} +7 -6
  93. package/dist/chunks/{registry-Z43434VG.js → registry-VWXWPVAG.js} +4 -4
  94. package/dist/chunks/registry-XPWPGHYE.js +24 -0
  95. package/dist/chunks/{room-recommend-62H7ZQQ6.js → room-recommend-CNWE5WQK.js} +8 -5
  96. package/dist/chunks/{schedule-FNXKH3DQ.js → schedule-YYNYBQIE.js} +6 -5
  97. package/dist/chunks/{workflow-ADHKCAJK.js → workflow-BSYT5TGL.js} +15 -8
  98. package/dist/cmd/action.js +6 -0
  99. package/dist/cmd/identity/index.js +45 -0
  100. package/dist/cmd/index.js +2 -0
  101. package/dist/core/continuation-ttl.js +18 -0
  102. package/dist/core/error-codes.js +85 -0
  103. package/dist/core/logger.js +11 -0
  104. package/dist/index.js +37 -31
  105. package/dist/internal/e10/auth/commands.js +195 -8
  106. package/dist/internal/e10/auth/error-log.js +312 -0
  107. package/dist/internal/e10/auth/session.js +17 -3
  108. package/dist/internal/e10/auth/xiaoe.js +176 -13
  109. package/dist/internal/e10/auth-recovery.js +39 -12
  110. package/dist/internal/e10/context.js +29 -3
  111. package/dist/internal/skills/install.js +9 -1
  112. package/dist/shortcuts/archive/continuation.js +2 -1
  113. package/dist/shortcuts/archive/index.js +3 -0
  114. package/dist/shortcuts/archive/operations/borrow-list.js +105 -14
  115. package/dist/shortcuts/archive/operations/confirm.js +2 -1
  116. package/dist/shortcuts/archive/operations/flow-url.js +182 -22
  117. package/dist/shortcuts/archive/operations/getPageUrl.js +75 -0
  118. package/dist/shortcuts/archive/operations/prelib.js +33 -4
  119. package/dist/shortcuts/archive/operations/shared.js +52 -0
  120. package/dist/shortcuts/archive-oa/continuation.js +2 -1
  121. package/dist/shortcuts/archive-oa/index.js +2 -0
  122. package/dist/shortcuts/archive-oa/operations/confirm.js +2 -1
  123. package/dist/shortcuts/asset/continuation.js +2 -1
  124. package/dist/shortcuts/asset/index.js +2 -0
  125. package/dist/shortcuts/asset-idle/index.js +2 -0
  126. package/dist/shortcuts/blog/continuation.js +2 -1
  127. package/dist/shortcuts/blog/index.js +2 -0
  128. package/dist/shortcuts/caizhilian/continuation.js +2 -1
  129. package/dist/shortcuts/caizhilian/index.js +2 -0
  130. package/dist/shortcuts/caizhilian/operations/confirm.js +3 -2
  131. package/dist/shortcuts/calendar/continuation.js +2 -1
  132. package/dist/shortcuts/calendar/index.js +2 -0
  133. package/dist/shortcuts/calendar/operations/write.js +1 -1
  134. package/dist/shortcuts/contract/continuation.js +2 -1
  135. package/dist/shortcuts/contract/host.js +111 -4
  136. package/dist/shortcuts/contract/index.js +21 -0
  137. package/dist/shortcuts/contract/manifest.js +125 -0
  138. package/dist/shortcuts/contract/ooxml/clause-insert.js +249 -0
  139. package/dist/shortcuts/contract/operations/clause-insert.js +56 -0
  140. package/dist/shortcuts/contract/operations/customer.js +192 -0
  141. package/dist/shortcuts/contract/operations/file-download.js +75 -0
  142. package/dist/shortcuts/contract/operations/flow.js +44 -2
  143. package/dist/shortcuts/contract/operations/form-info.js +162 -62
  144. package/dist/shortcuts/contract/operations/registry.js +8 -0
  145. package/dist/shortcuts/contract/operations/review.js +116 -1
  146. package/dist/shortcuts/contract/operations/summary.js +177 -0
  147. package/dist/shortcuts/contract/operations/upload.js +64 -4
  148. package/dist/shortcuts/contract/operations/write.js +2 -1
  149. package/dist/shortcuts/contract/upload-cache.js +104 -0
  150. package/dist/shortcuts/cowork/continuation.js +2 -1
  151. package/dist/shortcuts/cowork/index.js +2 -0
  152. package/dist/shortcuts/ebuilder-form/continuation.js +2 -1
  153. package/dist/shortcuts/ebuilder-form/index.js +2 -0
  154. package/dist/shortcuts/ebuilder-form/operations/write.js +3 -2
  155. package/dist/shortcuts/ehr/continuation.js +2 -1
  156. package/dist/shortcuts/ehr/index.js +2 -0
  157. package/dist/shortcuts/ehr/operations/attend-write.js +1 -1
  158. package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +186 -5
  159. package/dist/shortcuts/ehr/operations/recruit-position.js +239 -6
  160. package/dist/shortcuts/ehr/operations/recruit-write.js +18 -19
  161. package/dist/shortcuts/ehr/operations/recruit.js +17 -5
  162. package/dist/shortcuts/esb/continuation.js +2 -1
  163. package/dist/shortcuts/esb/index.js +2 -0
  164. package/dist/shortcuts/esb/operations/trigger.js +2 -1
  165. package/dist/shortcuts/fna/continuation.js +2 -1
  166. package/dist/shortcuts/fna/index.js +2 -0
  167. package/dist/shortcuts/fna/operations/invoice-writeoff.js +1 -1
  168. package/dist/shortcuts/fna/operations/loan.js +1 -1
  169. package/dist/shortcuts/hrm/index.js +2 -0
  170. package/dist/shortcuts/hrm/operations/employee.js +29 -1
  171. package/dist/shortcuts/im/continuation.js +2 -1
  172. package/dist/shortcuts/index.js +5 -0
  173. package/dist/shortcuts/invoice/continuation.js +2 -1
  174. package/dist/shortcuts/invoice/index.js +14 -15
  175. package/dist/shortcuts/invoice/invoice-record.js +93 -0
  176. package/dist/shortcuts/invoice/manifest.js +190 -393
  177. package/dist/shortcuts/invoice/operations/add.js +2 -1
  178. package/dist/shortcuts/invoice/operations/delete.js +2 -1
  179. package/dist/shortcuts/invoice/operations/import.js +2 -1
  180. package/dist/shortcuts/invoice/operations/issuing-contract-detail.js +86 -0
  181. package/dist/shortcuts/invoice/operations/issuing-contracts.js +210 -0
  182. package/dist/shortcuts/invoice/operations/registry.js +17 -17
  183. package/dist/shortcuts/invoice/operations/reim-auto.js +4 -569
  184. package/dist/shortcuts/invoice/operations/reim.js +52 -341
  185. package/dist/shortcuts/invoice/operations/shared.js +21 -4
  186. package/dist/shortcuts/invoice/operations/update.js +2 -1
  187. package/dist/shortcuts/invoice/projection.js +10 -62
  188. package/dist/shortcuts/jiuchuanhui/continuation.js +2 -1
  189. package/dist/shortcuts/jiuchuanhui/index.js +2 -0
  190. package/dist/shortcuts/jiuchuanhui/operations/datajson.js +2 -1
  191. package/dist/shortcuts/jiuchuanhui/operations/esb.js +2 -1
  192. package/dist/shortcuts/mail/continuation.js +2 -1
  193. package/dist/shortcuts/mail/index.js +2 -0
  194. package/dist/shortcuts/mail/operations/mail-blacklist.js +1 -1
  195. package/dist/shortcuts/mail/operations/mail-contacts.js +1 -1
  196. package/dist/shortcuts/mail/operations/mail-send.js +1 -1
  197. package/dist/shortcuts/mail/operations/mail-sign.js +1 -1
  198. package/dist/shortcuts/mail/operations/mail-template.js +1 -1
  199. package/dist/shortcuts/meeting/continuation.js +2 -1
  200. package/dist/shortcuts/meeting/index.js +2 -0
  201. package/dist/shortcuts/meeting/operations/change.js +1 -1
  202. package/dist/shortcuts/meeting/operations/create.js +1 -1
  203. package/dist/shortcuts/meeting/operations/eb/create-flow.js +198 -65
  204. package/dist/shortcuts/meeting/operations/eb/decision.js +1 -1
  205. package/dist/shortcuts/meeting/operations/eb/draft-memory.js +56 -0
  206. package/dist/shortcuts/meeting/operations/eb/factory.js +59 -4
  207. package/dist/shortcuts/meeting/operations/eb/person-cache.js +2 -2
  208. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +47 -5
  209. package/dist/shortcuts/meeting/operations/invitation-publish.js +132 -0
  210. package/dist/shortcuts/meeting/operations/lifecycle.js +1 -1
  211. package/dist/shortcuts/meeting/operations/receipts.js +1 -1
  212. package/dist/shortcuts/meeting/operations/registry.js +2 -0
  213. package/dist/shortcuts/meeting/operations/signs.js +1 -1
  214. package/dist/shortcuts/okr/continuation.js +2 -1
  215. package/dist/shortcuts/okr/index.js +2 -0
  216. package/dist/shortcuts/okr/operations/write.js +1 -1
  217. package/dist/shortcuts/plan/continuation.js +2 -1
  218. package/dist/shortcuts/plan/index.js +2 -0
  219. package/dist/shortcuts/plan/operations/write.js +1 -1
  220. package/dist/shortcuts/project/continuation.js +2 -1
  221. package/dist/shortcuts/project/index.js +2 -0
  222. package/dist/shortcuts/reception/constants.js +53 -0
  223. package/dist/shortcuts/reception/errors.js +54 -0
  224. package/dist/shortcuts/reception/host.js +125 -0
  225. package/dist/shortcuts/reception/index.js +198 -0
  226. package/dist/shortcuts/reception/manifest.js +177 -0
  227. package/dist/shortcuts/reception/operations/ask.js +71 -0
  228. package/dist/shortcuts/reception/operations/browsertool.js +58 -0
  229. package/dist/shortcuts/reception/operations/compose.js +129 -0
  230. package/dist/shortcuts/reception/operations/customparams.js +74 -0
  231. package/dist/shortcuts/reception/operations/doc.js +238 -0
  232. package/dist/shortcuts/reception/operations/docrender.js +36 -0
  233. package/dist/shortcuts/reception/operations/panels.js +179 -0
  234. package/dist/shortcuts/reception/operations/registry.js +26 -0
  235. package/dist/shortcuts/reception/operations/render-assets.js +184 -0
  236. package/dist/shortcuts/reception/operations/render.js +123 -0
  237. package/dist/shortcuts/reception/operations/runs.js +38 -0
  238. package/dist/shortcuts/reception/operations/schedule.js +127 -0
  239. package/dist/shortcuts/reception/operations/shared.js +196 -0
  240. package/dist/shortcuts/reception/operations/snapshot.js +68 -0
  241. package/dist/shortcuts/reception/operations/types.js +1 -0
  242. package/dist/shortcuts/reception/operations.js +33 -0
  243. package/dist/shortcuts/reception/upload.js +218 -0
  244. package/dist/shortcuts/recruit-stage/context.js +145 -33
  245. package/dist/shortcuts/recruit-stage/continuation.js +2 -1
  246. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +86 -16
  247. package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +6 -4
  248. package/dist/shortcuts/recruit-stage/operations/jd-create.js +289 -48
  249. package/dist/shortcuts/recruit-stage/operations/resume-import.js +207 -25
  250. package/dist/shortcuts/recruit-stage/shared.js +161 -18
  251. package/dist/shortcuts/workflow/continuation.js +2 -1
  252. package/dist/shortcuts/workflow/index.js +4 -0
  253. package/dist/shortcuts/workflow/operations/form.js +32 -8
  254. package/dist/shortcuts/workflow/operations/read.js +8 -3
  255. package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +92 -5
  256. package/dist/shortcuts/workflow/operations/todoSmartConvert/priorityExpr.js +509 -0
  257. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +22 -1
  258. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +32 -6
  259. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +57 -11
  260. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +165 -52
  261. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +57 -14
  262. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +44 -18
  263. package/dist/shortcuts/workflow/operations/write.js +1 -1
  264. package/docs/_catalog.md +3 -0
  265. package/docs/agent-invoice.md +1 -1
  266. package/docs/archive-oa.md +1 -1
  267. package/docs/caizhilian.md +1 -1
  268. package/docs/calendar.md +1 -1
  269. package/docs/contract.md +2 -1
  270. package/docs/e10-auth.md +19 -1
  271. package/docs/ehr.md +2 -2
  272. package/docs/esb.md +1 -1
  273. package/docs/im.md +1 -1
  274. package/docs/invoice.md +8 -12
  275. package/docs/okr.md +1 -1
  276. package/docs/reception.md +119 -0
  277. package/docs/todo-smart-convert/data-contract.md +7 -0
  278. package/package.json +1 -1
  279. package/scripts/clean.mjs +43 -2
  280. package/skill-template/business-info.json +18 -2
  281. package/skill-template/domains/caizhilian.md +1 -1
  282. package/skill-template/domains/jinchengda.md +2 -0
  283. package/skill-template/domains/reception-flow.md +18 -0
  284. package/skill-template/domains/yepiaotong.md +4 -7
  285. package/skills/weaver-e10-archive-oa/references/source-manifest.json +14 -14
  286. package/skills/weaver-e10-blog/references/blog-publish.md +1 -1
  287. package/skills/weaver-e10-blog/references/source-manifest.json +7 -7
  288. package/skills/weaver-e10-caizhilian/references/source-manifest.json +21 -21
  289. package/skills/weaver-e10-caizhilian/references/write-protocol.md +2 -2
  290. package/skills/weaver-e10-calendar/references/calendar-write.md +1 -1
  291. package/skills/weaver-e10-cowork/SKILL.md +1 -1
  292. package/skills/weaver-e10-ebuilder-form/SKILL.md +1 -1
  293. package/skills/weaver-e10-ebuilder-form/references/custom-api.md +1 -1
  294. package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +1 -1
  295. package/skills/weaver-e10-esb/SKILL.md +2 -2
  296. package/skills/weaver-e10-esb/references/source-manifest.json +22 -22
  297. package/skills/weaver-e10-esb/references/trigger.md +2 -2
  298. package/skills/weaver-e10-jinchengda/SKILL.md +198 -205
  299. package/skills/weaver-e10-jinchengda/references/contract-action-card.md +759 -0
  300. package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +250 -0
  301. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +146 -7
  302. package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +178 -0
  303. package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +1 -1
  304. package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +1 -1
  305. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +75 -0
  306. package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +137 -0
  307. package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +163 -0
  308. package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +52 -3
  309. package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +92 -5
  310. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +602 -0
  311. package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +209 -0
  312. package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +126 -0
  313. package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +312 -0
  314. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +555 -0
  315. package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +47 -12
  316. package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +469 -0
  317. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +154 -1
  318. package/skills/weaver-e10-jinchengda/references/contract-request-write.md +1 -1
  319. package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +224 -0
  320. package/skills/weaver-e10-jinchengda/references/orchestration.md +355 -0
  321. package/skills/weaver-e10-jinchengda/references/source-manifest.json +29 -29
  322. package/skills/weaver-e10-jucailin/SKILL.md +1 -1
  323. package/skills/weaver-e10-jucailin/references/attend-write.md +2 -2
  324. package/skills/weaver-e10-jucailin/references/recruit-create.md +15 -4
  325. package/skills/weaver-e10-jucailin/references/recruit-write.md +3 -3
  326. package/skills/weaver-e10-meeting/SKILL.md +64 -14
  327. package/skills/weaver-e10-meeting/references/meeting-change.md +1 -1
  328. package/skills/weaver-e10-meeting/references/meeting-create.md +1 -1
  329. package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +1 -1
  330. package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
  331. package/skills/weaver-e10-okr/references/okr-align.md +1 -1
  332. package/skills/weaver-e10-okr/references/okr-keyresult.md +1 -1
  333. package/skills/weaver-e10-okr/references/okr-write.md +1 -1
  334. package/skills/weaver-e10-okr/references/source-manifest.json +8 -8
  335. package/skills/weaver-e10-plan/references/plan-report-write.md +1 -1
  336. package/skills/weaver-e10-plan/references/source-manifest.json +20 -20
  337. package/skills/weaver-e10-qiyecheng/references/loan-management.md +1 -1
  338. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +18 -18
  339. package/skills/weaver-e10-reception-flow/SKILL.md +173 -0
  340. package/skills/weaver-e10-reception-flow/assets//350/241/214/347/250/213/345/215/225/346/250/241/346/235/277-/346/263/233/345/276/256.docx +0 -0
  341. package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +213 -0
  342. package/skills/weaver-e10-reception-flow/references/browsertool.md +68 -0
  343. package/skills/weaver-e10-reception-flow/references/env-pitfalls.md +51 -0
  344. package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +227 -0
  345. package/skills/weaver-e10-reception-flow/references/guide.md +179 -0
  346. package/skills/weaver-e10-reception-flow/scripts/locate.sh +14 -0
  347. package/skills/weaver-e10-reception-flow/scripts/render.py +724 -0
  348. package/skills/weaver-e10-recruit-stage/SKILL.md +19 -10
  349. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +10 -2
  350. package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +1 -1
  351. package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +66 -0
  352. package/skills/weaver-e10-recruit-stage/references/position-templates.md +204 -0
  353. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +13 -1
  354. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +29 -6
  355. package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +27 -14
  356. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +21 -2
  357. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +9 -1
  358. package/skills/weaver-e10-shijingran/SKILL.md +5 -5
  359. package/skills/weaver-e10-shijingran/references/source-manifest.json +37 -36
  360. package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +2 -0
  361. package/skills/weaver-e10-wenshuding/SKILL.md +17 -7
  362. package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +28 -0
  363. package/skills/weaver-e10-wenshuding/references/archive-flow.md +24 -8
  364. package/skills/weaver-e10-wenshuding/references/archive-prelib-list.md +3 -0
  365. package/skills/weaver-e10-wenshuding/references/archive-prelib-open.md +4 -0
  366. package/skills/weaver-e10-wenshuding/references/archive-search.md +3 -1
  367. package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
  368. package/skills/weaver-e10-workflow/SKILL.md +19 -17
  369. package/skills/weaver-e10-workflow/aigroup/default.json +10 -6
  370. package/skills/weaver-e10-workflow/references/source-manifest.json +32 -32
  371. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +36 -3
  372. package/skills/weaver-e10-workflow/references/workflow-memory.md +1 -1
  373. package/skills/weaver-e10-workflow/references/workflow-query.md +9 -6
  374. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +152 -1
  375. package/skills/weaver-e10-yepiaotong/SKILL.md +19 -26
  376. package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +13 -10
  377. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +2 -0
  378. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +194 -155
  379. package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +28 -32
  380. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +5 -1
  381. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +8 -10
  382. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +211 -616
  383. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +149 -117
  384. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +17 -20
  385. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +20 -39
  386. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +55 -22
  387. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +7 -17
  388. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +88 -92
  389. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +144 -354
  390. package/skills/weaver-e10-yimiaoban/SKILL.md +18 -6
  391. package/skills/weaver-e10-yimiaoban/references/msg-write.md +31 -1
  392. package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
  393. package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +72 -0
  394. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +11 -11
  395. package/dist/chunks/chunk-TTPJJJC4.js +0 -465
  396. package/dist/chunks/registry-BKBZPBAJ.js +0 -23
  397. package/dist/shortcuts/invoice/markdown.js +0 -172
  398. package/dist/shortcuts/invoice/operations/issuing-qys.js +0 -424
  399. package/skills/weaver-e10-meeting.zip +0 -0
  400. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +0 -131
  401. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-form-fill-rules.md +0 -179
@@ -2,6 +2,7 @@ import { createHash } from 'node:crypto';
2
2
  import { readFile, stat } from 'node:fs/promises';
3
3
  import { basename, resolve } from 'node:path';
4
4
  import { contractPolicyError, contractValidationError } from '../errors.js';
5
+ import { fingerprintKey, isCacheEnabled, lookupUpload, rememberUpload, sha256Of, } from '../upload-cache.js';
5
6
  const MAX_FILE_BYTES = 200 * 1024 * 1024;
6
7
  const DEFAULT_UPLOAD_TIMEOUT_MS = 120_000;
7
8
  const DOC_EXTENSIONS = new Set(['.doc', '.docx']);
@@ -38,6 +39,37 @@ export async function uploadFile(host, options) {
38
39
  const buffer = await readFile(absolutePath);
39
40
  const md5 = createHash('md5').update(buffer).digest('hex');
40
41
  const modified = String(Math.trunc(info.mtimeMs));
42
+ const sha256 = sha256Of(buffer);
43
+ // ---- 本地指纹复用:同一份文件在同一 module / 环境 / 用户下只真正上传一次 ----
44
+ // E10 的 preUploadCheck 在 ebContract 下不按 MD5 秒传,重传必产生新 fileId(实测),
45
+ // 因此去重只能在这里做。缓存不可用时静默跳过,不影响上传。
46
+ let reuseKey = null;
47
+ if (isCacheEnabled()) {
48
+ try {
49
+ const session = await host.getSession();
50
+ reuseKey = fingerprintKey({
51
+ sha256,
52
+ module: options.module,
53
+ baseUrl: session.baseUrl,
54
+ userId: session.userId ?? '',
55
+ });
56
+ const hit = await lookupUpload(reuseKey);
57
+ if (hit) {
58
+ return {
59
+ fileId: hit.fileId,
60
+ docId: hit.docId,
61
+ name: hit.name || name,
62
+ size: hit.size,
63
+ md5: hit.md5,
64
+ sha256,
65
+ reused: true,
66
+ };
67
+ }
68
+ }
69
+ catch {
70
+ reuseKey = null;
71
+ }
72
+ }
41
73
  const form = {
42
74
  compressImg: 'false',
43
75
  module: options.module,
@@ -61,12 +93,26 @@ export async function uploadFile(host, options) {
61
93
  const precheckData = (precheck?.data ?? {});
62
94
  const secondUploadId = pickFileId(precheckData);
63
95
  if (secondUploadId) {
96
+ const reusedDocId = text(precheckData.docId) ?? text(precheckData.uploadModuleDto?.docId);
97
+ const reusedName = text(precheckData.name) ?? text(precheckData.uploadModuleDto?.name) ?? name;
98
+ if (reuseKey) {
99
+ await rememberUpload(reuseKey, {
100
+ fileId: secondUploadId,
101
+ docId: reusedDocId,
102
+ name: reusedName,
103
+ size: buffer.length,
104
+ md5,
105
+ sha256,
106
+ });
107
+ }
64
108
  return {
65
109
  fileId: secondUploadId,
66
- docId: text(precheckData.docId) ?? text(precheckData.uploadModuleDto?.docId),
67
- name: text(precheckData.name) ?? text(precheckData.uploadModuleDto?.name) ?? name,
110
+ docId: reusedDocId,
111
+ name: reusedName,
68
112
  size: buffer.length,
69
113
  md5,
114
+ sha256,
115
+ reused: false,
70
116
  };
71
117
  }
72
118
  const preUploadId = text(precheckData.preUploadId);
@@ -90,12 +136,26 @@ export async function uploadFile(host, options) {
90
136
  if (!fileId) {
91
137
  throw contractPolicyError('upload_no_fileid', '上传接口未返回 fileId,上传未完成;请核对登录态、module 与文件本体是否随请求发送', { module: options.module });
92
138
  }
139
+ const finalDocId = text(uploadData.docId) ?? text(uploadData.uploadModuleDto?.docId);
140
+ const finalName = text(uploadData.name) ?? name;
141
+ if (reuseKey) {
142
+ await rememberUpload(reuseKey, {
143
+ fileId,
144
+ docId: finalDocId,
145
+ name: finalName,
146
+ size: buffer.length,
147
+ md5,
148
+ sha256,
149
+ });
150
+ }
93
151
  return {
94
152
  fileId,
95
- docId: text(uploadData.docId) ?? text(uploadData.uploadModuleDto?.docId),
96
- name: text(uploadData.name) ?? name,
153
+ docId: finalDocId,
154
+ name: finalName,
97
155
  size: buffer.length,
98
156
  md5,
157
+ sha256,
158
+ reused: false,
99
159
  };
100
160
  }
101
161
  export function assertContractDocument(path) {
@@ -1,3 +1,4 @@
1
+ import { CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
1
2
  import { ContractCliError, contractConfirmationError, contractPartialError, contractValidationError } from '../errors.js';
2
3
  import { objectFingerprint, sessionMatches } from './shared.js';
3
4
  import { CONTRACT_WORKFLOW } from './types.js';
@@ -37,7 +38,7 @@ export class ContractWritePrepareOperation {
37
38
  data: {
38
39
  preview,
39
40
  continuation: continuationToken,
40
- expiresInSeconds: 600,
41
+ expiresInSeconds: CONTINUATION_TTL_SECONDS,
41
42
  workflow: CONTRACT_WORKFLOW.awaitingConfirmation(baseName),
42
43
  ...(precheck ? { precheck } : {}),
43
44
  },
@@ -0,0 +1,104 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { mkdir, readFile, writeFile } from 'node:fs/promises';
3
+ import { homedir } from 'node:os';
4
+ import { dirname, resolve } from 'node:path';
5
+ const CACHE_VERSION = 1;
6
+ const MAX_ENTRIES = 200;
7
+ const DEFAULT_TTL_MS = 24 * 60 * 60 * 1000;
8
+ function cacheRoot() {
9
+ const home = process.env.WEAVER_WORK_CLI_HOME
10
+ || process.env.WORK_CLI_HOME
11
+ || resolve(homedir(), '.weaver-work-cli');
12
+ return resolve(home, 'contract');
13
+ }
14
+ export function cacheFilePath() {
15
+ return resolve(cacheRoot(), 'upload-cache.json');
16
+ }
17
+ /** TTL 可由环境变量覆盖,0 表示禁用缓存。 */
18
+ function ttlMs() {
19
+ const raw = process.env.WEAVER_CONTRACT_UPLOAD_CACHE_TTL_MS;
20
+ if (raw === undefined)
21
+ return DEFAULT_TTL_MS;
22
+ const parsed = Number(raw);
23
+ return Number.isFinite(parsed) && parsed >= 0 ? parsed : DEFAULT_TTL_MS;
24
+ }
25
+ export function isCacheEnabled() {
26
+ return ttlMs() > 0;
27
+ }
28
+ /** 指纹键:内容哈希 + module + 环境 + 用户,任一不同都不复用。 */
29
+ export function fingerprintKey(input) {
30
+ return createHash('sha256')
31
+ .update(`${input.sha256}|${input.module}|${input.baseUrl}|${input.userId}`)
32
+ .digest('hex');
33
+ }
34
+ export function sha256Of(buffer) {
35
+ return createHash('sha256').update(buffer).digest('hex');
36
+ }
37
+ async function readCache() {
38
+ try {
39
+ const raw = (await readFile(cacheFilePath(), 'utf8')).replace(/^\uFEFF/u, '');
40
+ const parsed = JSON.parse(raw);
41
+ if (!parsed || parsed.version !== CACHE_VERSION || typeof parsed.entries !== 'object') {
42
+ return { version: CACHE_VERSION, entries: {} };
43
+ }
44
+ return parsed;
45
+ }
46
+ catch {
47
+ return { version: CACHE_VERSION, entries: {} };
48
+ }
49
+ }
50
+ async function writeCache(cache) {
51
+ try {
52
+ const path = cacheFilePath();
53
+ await mkdir(dirname(path), { recursive: true });
54
+ await writeFile(path, JSON.stringify(cache), 'utf8');
55
+ }
56
+ catch {
57
+ // 缓存写不进去不影响业务:下一次只是重新上传而已。
58
+ }
59
+ }
60
+ /** 命中则返回条目(并累加命中次数),未命中或过期返回 null。 */
61
+ export async function lookupUpload(key) {
62
+ if (!isCacheEnabled())
63
+ return null;
64
+ const cache = await readCache();
65
+ const entry = cache.entries[key];
66
+ if (!entry)
67
+ return null;
68
+ const age = Date.now() - entry.updatedAt;
69
+ if (age > ttlMs()) {
70
+ delete cache.entries[key];
71
+ await writeCache(cache);
72
+ return null;
73
+ }
74
+ entry.hits = (entry.hits ?? 0) + 1;
75
+ await writeCache(cache);
76
+ return entry;
77
+ }
78
+ /** 上传成功后登记指纹;同一键覆盖,并按 updatedAt 做容量裁剪。 */
79
+ export async function rememberUpload(key, entry) {
80
+ if (!isCacheEnabled())
81
+ return;
82
+ const cache = await readCache();
83
+ const previous = cache.entries[key];
84
+ cache.entries[key] = {
85
+ ...entry,
86
+ updatedAt: Date.now(),
87
+ hits: previous?.hits ?? 0,
88
+ };
89
+ const keys = Object.keys(cache.entries);
90
+ if (keys.length > MAX_ENTRIES) {
91
+ keys
92
+ .sort((a, b) => cache.entries[a].updatedAt - cache.entries[b].updatedAt)
93
+ .slice(0, keys.length - MAX_ENTRIES)
94
+ .forEach((stale) => delete cache.entries[stale]);
95
+ }
96
+ await writeCache(cache);
97
+ }
98
+ /** 清空缓存,供显式刷新或多份副本排查时使用。 */
99
+ export async function clearUploadCache() {
100
+ const cache = await readCache();
101
+ const count = Object.keys(cache.entries).length;
102
+ await writeCache({ version: CACHE_VERSION, entries: {} });
103
+ return count;
104
+ }
@@ -1,3 +1,4 @@
1
+ import { CONTINUATION_TTL_MS } from '../../core/continuation-ttl.js';
1
2
  import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
2
3
  import { existsSync } from 'node:fs';
3
4
  import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
@@ -35,7 +36,7 @@ function signature(payload, key) {
35
36
  }
36
37
  export function createCoworkContinuationSigner(ctx) {
37
38
  return {
38
- async issue(payload, ttlMs = 10 * 60_000) {
39
+ async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
39
40
  const issuedAt = Date.now();
40
41
  const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
41
42
  const sig = signature(body, await loadKey(ctx));
@@ -1,5 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
3
+ import { reportPlatformError } from '../../core/error-codes.js';
3
4
  import { createCoworkContinuationSigner } from './continuation.js';
4
5
  import { createCoworkHost } from './host.js';
5
6
  import { coworkManifest } from './manifest.js';
@@ -84,6 +85,7 @@ async function executeAndPrint(ctx, operation, input) {
84
85
  ctx.output.write(successEnvelope(operation, result), { json: true });
85
86
  }
86
87
  catch (error) {
88
+ reportPlatformError(error);
87
89
  console.error(JSON.stringify(failureEnvelope(error), null, 2));
88
90
  process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
89
91
  }
@@ -1,3 +1,4 @@
1
+ import { CONTINUATION_TTL_MS } from '../../core/continuation-ttl.js';
1
2
  import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
2
3
  import { existsSync } from 'node:fs';
3
4
  import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
@@ -35,7 +36,7 @@ function signature(payload, key) {
35
36
  }
36
37
  export function createEbuilderFormContinuationSigner(ctx) {
37
38
  return {
38
- async issue(payload, ttlMs = 10 * 60_000) {
39
+ async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
39
40
  const issuedAt = Date.now();
40
41
  const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
41
42
  const sig = signature(body, await loadKey(ctx));
@@ -1,5 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
3
+ import { reportPlatformError } from '../../core/error-codes.js';
3
4
  import { createEbuilderFormContinuationSigner } from './continuation.js';
4
5
  import { ebuilderValidationError } from './errors.js';
5
6
  import { createEbuilderFormHost } from './host.js';
@@ -81,6 +82,7 @@ async function executeAndPrint(ctx, operation, input) {
81
82
  ctx.output.write(successEnvelope(operation, result), { json: true });
82
83
  }
83
84
  catch (error) {
85
+ reportPlatformError(error);
84
86
  console.error(JSON.stringify(failureEnvelope(error), null, 2));
85
87
  process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
86
88
  }
@@ -1,3 +1,4 @@
1
+ import { CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
1
2
  import { ebuilderConfirmationError, ebuilderValidationError } from '../errors.js';
2
3
  import { ebuilderSuccess } from './types.js';
3
4
  import { asObject, assertKnownKeys, assertNoForbiddenKeys, optionalArray, optionalObject, optionalString, requiredArray, requiredString, sha256VisibleFingerprint, } from './shared.js';
@@ -51,7 +52,7 @@ export class EbuilderOpenapiPrepareOperation {
51
52
  target: prepared.target,
52
53
  requestPreview: { datajson: prepared.datajson },
53
54
  continuation,
54
- expiresInSeconds: 600,
55
+ expiresInSeconds: CONTINUATION_TTL_SECONDS,
55
56
  }, { status: 'PREPARED' }, prepared.warnings);
56
57
  }
57
58
  }
@@ -110,7 +111,7 @@ export class EbuilderCustomPrepareOperation {
110
111
  target: prepared.target,
111
112
  requestPreview: { datajson: prepared.datajson },
112
113
  continuation,
113
- expiresInSeconds: 600,
114
+ expiresInSeconds: CONTINUATION_TTL_SECONDS,
114
115
  }, { status: 'PREPARED' }, prepared.warnings);
115
116
  }
116
117
  }
@@ -1,3 +1,4 @@
1
+ import { CONTINUATION_TTL_MS } from '../../core/continuation-ttl.js';
1
2
  import { createHmac, randomBytes, timingSafeEqual } from 'node:crypto';
2
3
  import { existsSync } from 'node:fs';
3
4
  import { chmod, mkdir, readFile, writeFile } from 'node:fs/promises';
@@ -35,7 +36,7 @@ function signature(payload, key) {
35
36
  }
36
37
  export function createEhrContinuationSigner(ctx) {
37
38
  return {
38
- async issue(payload, ttlMs = 10 * 60_000) {
39
+ async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
39
40
  const issuedAt = Date.now();
40
41
  const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
41
42
  const sig = signature(body, await loadKey(ctx));
@@ -1,5 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
3
+ import { reportPlatformError } from '../../core/error-codes.js';
3
4
  import { createEhrContinuationSigner } from './continuation.js';
4
5
  import { createEhrHost } from './host.js';
5
6
  import { ehrManifest } from './manifest.js';
@@ -89,6 +90,7 @@ async function executeAndPrint(ctx, operation, input) {
89
90
  ctx.output.write(successEnvelope(operation, result), { json: true });
90
91
  }
91
92
  catch (error) {
93
+ reportPlatformError(error);
92
94
  console.error(JSON.stringify(failureEnvelope(error), null, 2));
93
95
  process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
94
96
  }
@@ -1,8 +1,8 @@
1
+ import { CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
1
2
  import { createHash } from 'node:crypto';
2
3
  import { ehrConfirmationError, ehrPartialError, ehrValidationError, EhrCliError } from '../errors.js';
3
4
  import { READ, SCHEMA_DATE, SCHEMA_ID, ehrSuccess, schemaOf, WRITE, } from './types.js';
4
5
  import { assertEnum, assertEnumArray, compact, pickDefined, toIdList, EHR_PAGES, ehrPageUrl, addDays } from './shared.js';
5
- const CONTINUATION_TTL_SECONDS = 600;
6
6
  const CARD_TYPES = ['CHECKIN', 'CHECKOUT', 'LEAVE', 'RETURN', 'CHECKIN_AND_RETURN', 'CHECKOUT_AND_LEAVE'];
7
7
  const APPEAL_TYPES = [
8
8
  'leave',
@@ -1,3 +1,4 @@
1
+ import { CONTINUATION_TTL_MS, CONTINUATION_TTL_SECONDS } from '../../../core/continuation-ttl.js';
1
2
  import { createHash } from 'node:crypto';
2
3
  import { readFile, stat } from 'node:fs/promises';
3
4
  import { basename } from 'node:path';
@@ -100,6 +101,133 @@ function joinRange(start, end) {
100
101
  return undefined;
101
102
  return `${s},${e}`;
102
103
  }
104
+ // ── 日期格式预检与归一(2026-11-05 与 recruit-stage 同步修复)──
105
+ // 人才表单接口只接受 yyyy-MM-dd。模型常给「2020.11」「2008-08」「2004.09-2008.07」,
106
+ // 会让 dataset 新增整批校验失败 → 回退建主表 → 补明细又被同一格式拦下 → 明细全丢。
107
+ // 规则同 recruit-stage:只有年月时开始补 -01、结束补当月最后一天;「至今」归一为空(不伪造结束日);
108
+ // 无法识别则跳过该字段并在 warnings 明示,绝不静默改写。
109
+ const DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
110
+ const ONGOING_RE = /至今|现在|今|now|present/i;
111
+ const RE_RANGE_FULL = /^\s*(\d{4}[.\-/年]\d{1,2}[.\-/月]\d{1,2}\s*日?)\s*[-–—~至,,]\s*(\d{4}[.\-/年]\d{1,2}[.\-/月]\d{1,2}\s*日?|至今|现在|今)\s*$/;
112
+ const RE_RANGE_YM = /^\s*(\d{4}[.\-/年]\d{1,2})\s*[-–—~至,,]\s*(\d{4}[.\-/年]\d{1,2}|至今|现在|今)\s*$/;
113
+ /** 单日期片段 → yyyy-MM-dd;isEnd=true 且缺日时补该月最后一天。无法解析返回 ''。 */
114
+ function normDatePart(raw, isEnd) {
115
+ const s = String(raw ?? '').trim();
116
+ if (!s)
117
+ return '';
118
+ if (ONGOING_RE.test(s))
119
+ return '';
120
+ if (DATE_ONLY_RE.test(s))
121
+ return s;
122
+ const m = s.match(/^(\d{4})\s*[.\-/年]?\s*(\d{1,2})?\s*[.\-/月]?\s*(\d{1,2})?\s*日?$/);
123
+ if (!m)
124
+ return '';
125
+ const y = Number(m[1]);
126
+ const mo = m[2] ? Number(m[2]) : 1;
127
+ if (!y || mo < 1 || mo > 12)
128
+ return '';
129
+ const lastDay = new Date(y, mo, 0).getDate();
130
+ let d;
131
+ if (m[3]) {
132
+ d = Number(m[3]);
133
+ if (d < 1 || d > lastDay)
134
+ return '';
135
+ }
136
+ else {
137
+ d = isEnd ? lastDay : 1;
138
+ }
139
+ return `${y}-${String(mo).padStart(2, '0')}-${String(d).padStart(2, '0')}`;
140
+ }
141
+ /** 日期区间 → "start,end";单值原样归一。 */
142
+ function normDateRange(raw) {
143
+ const s = Array.isArray(raw)
144
+ ? raw.map((x) => String(x ?? '').trim()).filter(Boolean).join(',')
145
+ : String(raw ?? '').trim();
146
+ if (!s)
147
+ return '';
148
+ const m = s.match(RE_RANGE_FULL) || s.match(RE_RANGE_YM);
149
+ if (m) {
150
+ const a = normDatePart(m[1], false);
151
+ if (!a)
152
+ return '';
153
+ const b = normDatePart(m[2], true);
154
+ return b ? `${a},${b}` : a;
155
+ }
156
+ return normDatePart(s, false);
157
+ }
158
+ /**
159
+ * 就地归一简历入参里的全部日期字段,把每处改动写入 warnings(不静默改写)。
160
+ * 覆盖:joinworkdate / graduate_date / birthday;academicInformations[].study_date;
161
+ * jobInformations|workExperiences|projectExperiences 的 start_date/end_date;
162
+ * internshipExperiences[].entry_time;awardExperiences[].award_date。
163
+ */
164
+ export function normalizeImportDates(input, warnings) {
165
+ if (!input || typeof input !== 'object')
166
+ return;
167
+ const one = (label, val, isEnd = false) => {
168
+ const before = String(val ?? '').trim();
169
+ if (!before)
170
+ return '';
171
+ if (ONGOING_RE.test(before))
172
+ return '';
173
+ const after = normDatePart(before, isEnd);
174
+ if (!after) {
175
+ warnings.push(`日期无法识别,已跳过该字段(避免接口整批校验失败):${label} = 「${before}」`);
176
+ return '';
177
+ }
178
+ if (after !== before)
179
+ warnings.push(`日期已规范化:${label} 「${before}」→「${after}」`);
180
+ return after;
181
+ };
182
+ for (const k of ['joinworkdate', 'graduate_date', 'birthday']) {
183
+ if (input[k] === undefined || input[k] === null)
184
+ continue;
185
+ input[k] = one(k, input[k], false);
186
+ }
187
+ if (Array.isArray(input.academicInformations)) {
188
+ input.academicInformations.forEach((r, i) => {
189
+ if (!r || typeof r !== 'object' || r.study_date === undefined)
190
+ return;
191
+ const before = String(r.study_date ?? '').trim();
192
+ if (!before)
193
+ return;
194
+ const after = normDateRange(before);
195
+ if (!after) {
196
+ warnings.push(`日期区间无法识别,已跳过:academicInformations[${i}].study_date = 「${before}」`);
197
+ r.study_date = '';
198
+ }
199
+ else {
200
+ if (after !== before)
201
+ warnings.push(`日期已规范化:academicInformations[${i}].study_date 「${before}」→「${after}」`);
202
+ r.study_date = after;
203
+ }
204
+ });
205
+ }
206
+ for (const key of ['jobInformations', 'workExperiences', 'projectExperiences']) {
207
+ const arr = input[key];
208
+ if (!Array.isArray(arr))
209
+ continue;
210
+ arr.forEach((r, i) => {
211
+ if (!r || typeof r !== 'object')
212
+ return;
213
+ if (r.start_date !== undefined && r.start_date !== null)
214
+ r.start_date = one(`${key}[${i}].start_date`, r.start_date, false);
215
+ if (r.end_date !== undefined && r.end_date !== null)
216
+ r.end_date = one(`${key}[${i}].end_date`, r.end_date, true);
217
+ });
218
+ }
219
+ for (const [key, field] of [['internshipExperiences', 'entry_time'], ['awardExperiences', 'award_date']]) {
220
+ const arr = input[key];
221
+ if (!Array.isArray(arr))
222
+ continue;
223
+ arr.forEach((r, i) => {
224
+ if (!r || typeof r !== 'object')
225
+ return;
226
+ if (r[field] !== undefined && r[field] !== null)
227
+ r[field] = one(`${key}[${i}].${field}`, r[field], false);
228
+ });
229
+ }
230
+ }
103
231
  async function resolveSubTableMeta(env, formId) {
104
232
  let data = null;
105
233
  try {
@@ -464,6 +592,9 @@ function str(value) {
464
592
  }
465
593
  async function buildImportPlan(env, cache, args) {
466
594
  const warnings = [];
595
+ // 日期格式预检与归一:必须在构建主表/明细之前执行。原实现直接把模型给的
596
+ // 「2020.11」「2004.09-2008.07」写进接口,导致 dataset 整批校验失败、明细全丢。
597
+ normalizeImportDates(args, warnings);
467
598
  const talent = cache.forms.talent_pool;
468
599
  const objId = talent?.objId;
469
600
  const formId = talent?.formId || objId;
@@ -691,7 +822,7 @@ const candidateImportPrepare = {
691
822
  candidateName: plan.talentName,
692
823
  telephone: plan.mobile,
693
824
  },
694
- }, 10 * 60 * 1000);
825
+ }, CONTINUATION_TTL_MS);
695
826
  return ehrSuccess('ehr.recruit.candidate.import.prepare', {
696
827
  status: 'AWAITING_CONFIRMATION',
697
828
  preview: {
@@ -709,7 +840,7 @@ const candidateImportPrepare = {
709
840
  },
710
841
  ...(tagCheck ? { tagCheck } : {}),
711
842
  continuation,
712
- expiresInSeconds: 600,
843
+ expiresInSeconds: CONTINUATION_TTL_SECONDS,
713
844
  });
714
845
  },
715
846
  };
@@ -799,23 +930,73 @@ const candidateImportApply = {
799
930
  // ⑥ 产物链接:人才卡片单页 + 人才库列表定位(自用系统追加 recruitType=useSelf)
800
931
  const baseUrl = session.baseUrl.replace(/\/+$/, '');
801
932
  const extra = String(cache.selfUse) === '1' ? '&recruitType=useSelf' : '';
933
+ const talentObjId = String(cache.forms?.talent_pool?.objId || cache.forms?.talent?.objId || '');
802
934
  const talentCardUrl = cache.ebdDetailPageId
803
935
  ? `${baseUrl}/sp/ebdpage/view/${cache.ebdDetailPageId}?talentId=${talentId}${extra}`
804
- : null;
936
+ : (talentObjId ? `${baseUrl}/sp/ebdfpage/card/0/${talentObjId}/${talentId}` : null);
805
937
  const talentListId = cache.lists.talent?.listId;
938
+ // 列表只打开列表(2026-11-06 用户定稿);人才卡片单页由 talentCardUrl 单独给出。
806
939
  const talentListLocateUrl = talentListId
807
- ? `${baseUrl}/sp/ebdfpage/list/${talentListId}?talentId=${talentId}${extra}`
940
+ ? `${baseUrl}/sp/ebdfpage/list/${talentListId}`
808
941
  : null;
809
942
  const warnings = [...(payload.warnings || [])];
810
943
  if (batchNote)
811
944
  warnings.push(batchNote);
945
+ // 明细完整性判定(2026-11-05 与 recruit-stage 同步修复):
946
+ // 主表建成 ≠ 建档成功。原实现 result 硬编码 'success' 且从不回读明细,
947
+ // 一旦日期格式等原因导致明细整批被拒,会出现「人才已建、经历全空」却仍报成功的静默事故。
948
+ // 规则:期望行数 > 0 时读回行数必须 >= 期望,否则 result 只能报 partial;回读失败标 unverified。
949
+ let detailsState = 'complete';
950
+ const expectedDetailRows = Object.values(payload.subStats || {}).reduce((sum, n) => sum + Number(n || 0), 0);
951
+ if (expectedDetailRows > 0) {
952
+ try {
953
+ const snapshot = (await env.host.request({
954
+ path: '/api/ebuilder/form/form/core/getFormDataAndLayout',
955
+ method: 'POST',
956
+ body: {
957
+ terminalType: 'PC',
958
+ dataId: talentId,
959
+ formId,
960
+ module: 'ebuilderform',
961
+ newLayout: true,
962
+ dataCrossLayout: false,
963
+ permissionId: '',
964
+ allReadOnly: true,
965
+ initialDatas: [],
966
+ dynamicData: false,
967
+ cost: false,
968
+ customParam: { objId, dataId: talentId },
969
+ },
970
+ operation: 'ehr.recruit.candidate.import.apply',
971
+ }));
972
+ const detailData = snapshot?.data?.formData?.dataDetails || [];
973
+ const seenRows = {};
974
+ for (const d of detailData) {
975
+ if (!d?.subFormId)
976
+ continue;
977
+ const key = String(d.subFormId);
978
+ (seenRows[key] = seenRows[key] || new Set()).add(String(d.dataIndex));
979
+ }
980
+ const gotRows = Object.values(seenRows).reduce((sum, set) => sum + set.size, 0);
981
+ if (gotRows < expectedDetailRows) {
982
+ detailsState = 'missing';
983
+ warnings.push(`明细行未完整落库(期望 ${expectedDetailRows} 行,读回 ${gotRows} 行):主表已写入,请核对后补齐明细`);
984
+ }
985
+ }
986
+ catch (error) {
987
+ detailsState = 'unverified';
988
+ warnings.push(`明细读回校验失败(无法确认明细是否落库):${error?.message || '未知错误'}`);
989
+ }
990
+ }
812
991
  return ehrSuccess('ehr.recruit.candidate.import.apply', {
813
- result: 'success',
992
+ result: detailsState === 'complete' ? 'success' : 'partial',
993
+ detailsState,
814
994
  talentId,
815
995
  candidateName: payload.candidateName,
816
996
  telephone: payload.telephone,
817
997
  mainTableFields: Object.keys(mainTable).length,
818
998
  detailRows: payload.subStats || undefined,
999
+ detailRowsExpected: expectedDetailRows || undefined,
819
1000
  attachment: uploaded ? { name: uploaded.name, size: uploaded.size } : null,
820
1001
  batch: { ok: batchOk, note: batchNote },
821
1002
  labelMatch,