weaver-work-cli 0.1.40 → 0.1.44

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 +17 -0
  2. package/dist/chunks/{archive-JHTONRST.js → archive-P6TBQGKL.js} +13 -5
  3. package/dist/chunks/{archive-oa-FCHLCPHC.js → archive-oa-7TQ2NXOH.js} +12 -5
  4. package/dist/chunks/{asset-RLIHC7DB.js → asset-3ELRG37G.js} +11 -4
  5. package/dist/chunks/{asset-idle-KVOFTLCP.js → asset-idle-WIGMUFMD.js} +7 -3
  6. package/dist/chunks/{attachment-content-RZYDB3MB.js → attachment-content-E3276UOV.js} +5 -4
  7. package/dist/chunks/{blog-42OZTJNP.js → blog-C5NMZAAC.js} +11 -4
  8. package/dist/chunks/{caizhilian-KRK547K5.js → caizhilian-5XSM2DFP.js} +13 -6
  9. package/dist/chunks/{calendar-RTWAMKHD.js → calendar-FI2WNSBO.js} +71 -26
  10. package/dist/chunks/{chunk-CXRQWOZ5.js → chunk-3YBDYOC4.js} +3 -3
  11. package/dist/chunks/{chunk-OOUTBLZ4.js → chunk-56EZERK4.js} +1 -1
  12. package/dist/chunks/chunk-6N4JPNFL.js +76 -0
  13. package/dist/chunks/{chunk-ZUX3P6BQ.js → chunk-727FH2NI.js} +1 -1
  14. package/dist/chunks/chunk-7BDPM5ST.js +11 -0
  15. package/dist/chunks/{chunk-LN447PY2.js → chunk-BCVYBYYT.js} +432 -2247
  16. package/dist/chunks/{chunk-7E6MUOEK.js → chunk-CWYGFU5B.js} +2 -2
  17. package/dist/chunks/{chunk-NOODWMCL.js → chunk-D4ADSZ7H.js} +1 -1
  18. package/dist/chunks/{chunk-WFFNM65B.js → chunk-ETNJSKMM.js} +281 -29
  19. package/dist/chunks/{chunk-CAQNBBQA.js → chunk-F4E4EM35.js} +3 -3
  20. package/dist/chunks/{chunk-4CTESSKI.js → chunk-FAZTGX7S.js} +6 -6
  21. package/dist/chunks/chunk-FRZKBMSW.js +2562 -0
  22. package/dist/chunks/{chunk-BYBSCN4X.js → chunk-G7PQWD4L.js} +6 -3
  23. package/dist/chunks/{chunk-NJKREDA3.js → chunk-GAMZLAG2.js} +1 -1
  24. package/dist/chunks/{chunk-FLS4DPGP.js → chunk-GM6J7Q4B.js} +28 -15
  25. package/dist/chunks/{chunk-NETCCARD.js → chunk-GRDRG6HP.js} +3 -3
  26. package/dist/chunks/chunk-HIT4Y6OI.js +1238 -0
  27. package/dist/chunks/{chunk-EZALDOQH.js → chunk-HP7JIYMT.js} +5 -2
  28. package/dist/chunks/{chunk-IZSSVYAG.js → chunk-IAZ3UPY6.js} +3 -3
  29. package/dist/chunks/{chunk-ZEDWSH32.js → chunk-IC62NFM5.js} +1 -1
  30. package/dist/chunks/{chunk-P26ZWSKU.js → chunk-KIHNAS25.js} +5 -2
  31. package/dist/chunks/{chunk-57IECMWX.js → chunk-N4M2DDFE.js} +29 -15
  32. package/dist/chunks/{chunk-JWRZM2H2.js → chunk-OF4S23UB.js} +4 -4
  33. package/dist/chunks/{chunk-VNBU55SL.js → chunk-PC7VKEB5.js} +80 -2458
  34. package/dist/chunks/{chunk-G2JSIUWF.js → chunk-PUQS5MWL.js} +91 -2
  35. package/dist/chunks/{chunk-E7OK5WD5.js → chunk-Q4OYAQYH.js} +5 -5
  36. package/dist/chunks/{chunk-7BRU4EFH.js → chunk-QVSWRLLU.js} +35 -6
  37. package/dist/chunks/{chunk-T6EGVBKU.js → chunk-TA7FXXJD.js} +6 -3
  38. package/dist/chunks/{chunk-GPMFD4RD.js → chunk-TXUG266F.js} +1 -1
  39. package/dist/chunks/{chunk-4TEDNCON.js → chunk-UFIT2UU3.js} +354 -56
  40. package/dist/chunks/{chunk-LUSPKZKY.js → chunk-UG5G54VL.js} +1 -0
  41. package/dist/chunks/{chunk-NIAJ5ZCG.js → chunk-UL5XUQ25.js} +5 -2
  42. package/dist/chunks/{chunk-FMPJJYYI.js → chunk-WRXSAVKO.js} +1 -1
  43. package/dist/chunks/{chunk-7U577Q7U.js → chunk-WSF4NNMR.js} +3 -3
  44. package/dist/chunks/chunk-XHK4MDR5.js +2497 -0
  45. package/dist/chunks/{chunk-LFMSDBZN.js → chunk-XNIK66I4.js} +326 -161
  46. package/dist/chunks/{chunk-3SO6QL6U.js → chunk-YWX377BY.js} +5 -2
  47. package/dist/chunks/{chunk-BYATLLEF.js → chunk-Z3GDFVJR.js} +1 -1
  48. package/dist/chunks/{chunk-I566ZYNF.js → chunk-Z7VYWPZV.js} +1 -1
  49. package/dist/chunks/{conflict-VR55AOOO.js → conflict-ARLSZJ6V.js} +4 -3
  50. package/dist/chunks/{continuation-2CKSBLA6.js → continuation-3S37AUSH.js} +4 -3
  51. package/dist/chunks/{continuation-RN6PZN2M.js → continuation-3XLYYTKV.js} +4 -3
  52. package/dist/chunks/{continuation-HZIZRZBX.js → continuation-HFW2YT5S.js} +4 -3
  53. package/dist/chunks/{continuation-NLECEJPX.js → continuation-KI7DRRZN.js} +4 -3
  54. package/dist/chunks/{contract-HI4FNPYE.js → contract-DNIIW5VJ.js} +13 -5
  55. package/dist/chunks/{cowork-HJLI353D.js → cowork-GMLRGVIW.js} +31 -14
  56. package/dist/chunks/create-flow-J22BO65E.js +56 -0
  57. package/dist/chunks/{ebuilder-form-HTGI63UU.js → ebuilder-form-ANV2FHYV.js} +12 -7
  58. package/dist/chunks/{ehr-GYXIYH3A.js → ehr-GSTGAIY3.js} +695 -1255
  59. package/dist/chunks/{employee-SAK2QYXX.js → employee-22BGJ3QS.js} +3 -3
  60. package/dist/chunks/{env-DW3G4HUO.js → env-BX3VRFS7.js} +4 -3
  61. package/dist/chunks/{esb-I5INCEFE.js → esb-ATAIASX2.js} +12 -7
  62. package/dist/chunks/{factory-TKXGXS6L.js → factory-PETTFME6.js} +3 -2
  63. package/dist/chunks/{fna-K2MHTQ24.js → fna-YEKBSFSX.js} +14 -8
  64. package/dist/chunks/{group-chat-VYBNMJLG.js → group-chat-BFVXAYFX.js} +7 -4
  65. package/dist/chunks/{host-D5SERMAJ.js → host-HRBXEPDQ.js} +5 -5
  66. package/dist/chunks/{host-JM4YVHFM.js → host-LR55CTHP.js} +5 -5
  67. package/dist/chunks/{host-L3VLITMT.js → host-SUOY6VYQ.js} +5 -5
  68. package/dist/chunks/{host-ZUQTJYYK.js → host-SZGV4UNT.js} +5 -5
  69. package/dist/chunks/{host-256GVCAH.js → host-WIKN2EJ5.js} +5 -5
  70. package/dist/chunks/{hrm-VLRBKTZB.js → hrm-NRDO4W5G.js} +11 -7
  71. package/dist/chunks/{im-QK3VTLXK.js → im-IQ2HN23S.js} +11 -10
  72. package/dist/chunks/{invoice-T5JTA32H.js → invoice-MNRW76PP.js} +636 -1768
  73. package/dist/chunks/{jiuchuanhui-P2FNEQVZ.js → jiuchuanhui-DTRBAX4N.js} +14 -6
  74. package/dist/chunks/{lazy-dispatch-XRRI46M6.js → lazy-dispatch-ZVWAI25B.js} +7 -6
  75. package/dist/chunks/{mail-3Y7MJ6PS.js → mail-ZVAUXOJA.js} +16 -14
  76. package/dist/chunks/{meeting-M7LTXGJE.js → meeting-FEVPZ67S.js} +21 -13
  77. package/dist/chunks/{okr-OBC6S67L.js → okr-SDH3E5RA.js} +12 -5
  78. package/dist/chunks/{operations-5QL3AECO.js → operations-62N6EP3C.js} +4 -3
  79. package/dist/chunks/{plan-5H6I53SK.js → plan-E35JFDI7.js} +12 -5
  80. package/dist/chunks/{project-L75QZV4S.js → project-73QXBAB2.js} +49 -25
  81. package/dist/chunks/reception-UWZVACBN.js +1899 -0
  82. package/dist/chunks/recruit-stage-4MAOCKFY.js +4770 -0
  83. package/dist/chunks/registry-IM5G23LS.js +24 -0
  84. package/dist/chunks/{registry-UGRBCBHO.js → registry-JDUS4E7D.js} +7 -6
  85. package/dist/chunks/{registry-RXPN6BBT.js → registry-KNKSCJNT.js} +7 -6
  86. package/dist/chunks/{registry-NYPYMZXG.js → registry-PO7SI256.js} +4 -4
  87. package/dist/chunks/{registry-QGHFNUWS.js → registry-PVUZQDDQ.js} +3 -3
  88. package/dist/chunks/{room-recommend-A3UDC3CA.js → room-recommend-H7KLXA5R.js} +6 -5
  89. package/dist/chunks/{schedule-5GCACCK7.js → schedule-ESZIBAUO.js} +6 -5
  90. package/dist/chunks/{workflow-M5ZJ7DWF.js → workflow-CWJFJLQU.js} +15 -10
  91. package/dist/cmd/action.js +6 -0
  92. package/dist/cmd/identity/index.js +45 -0
  93. package/dist/cmd/index.js +2 -0
  94. package/dist/core/continuation-ttl.js +18 -0
  95. package/dist/core/error-codes.js +85 -0
  96. package/dist/core/logger.js +11 -0
  97. package/dist/index.js +41 -30
  98. package/dist/internal/e10/auth/commands.js +164 -8
  99. package/dist/internal/e10/auth/error-log.js +182 -0
  100. package/dist/internal/e10/auth/messages.js +6 -0
  101. package/dist/internal/e10/auth/session.js +34 -3
  102. package/dist/internal/e10/auth/xiaoe.js +286 -44
  103. package/dist/internal/e10/auth-recovery.js +72 -14
  104. package/dist/internal/e10/context.js +72 -13
  105. package/dist/internal/e10/index.js +1 -1
  106. package/dist/internal/e10/network-error.js +93 -0
  107. package/dist/internal/e10/request-runtime.js +6 -0
  108. package/dist/internal/skills/install.js +9 -1
  109. package/dist/shortcuts/archive/continuation.js +2 -1
  110. package/dist/shortcuts/archive/index.js +3 -0
  111. package/dist/shortcuts/archive/operations/confirm.js +2 -1
  112. package/dist/shortcuts/archive-oa/continuation.js +2 -1
  113. package/dist/shortcuts/archive-oa/index.js +2 -0
  114. package/dist/shortcuts/archive-oa/operations/confirm.js +2 -1
  115. package/dist/shortcuts/asset/continuation.js +2 -1
  116. package/dist/shortcuts/asset/index.js +2 -0
  117. package/dist/shortcuts/asset-idle/index.js +2 -0
  118. package/dist/shortcuts/blog/continuation.js +2 -1
  119. package/dist/shortcuts/blog/index.js +2 -0
  120. package/dist/shortcuts/caizhilian/continuation.js +2 -1
  121. package/dist/shortcuts/caizhilian/index.js +2 -0
  122. package/dist/shortcuts/caizhilian/operations/confirm.js +3 -2
  123. package/dist/shortcuts/calendar/continuation.js +2 -1
  124. package/dist/shortcuts/calendar/index.js +2 -0
  125. package/dist/shortcuts/calendar/operations/read.js +31 -22
  126. package/dist/shortcuts/calendar/operations/write.js +46 -2
  127. package/dist/shortcuts/contract/continuation.js +2 -1
  128. package/dist/shortcuts/contract/index.js +2 -0
  129. package/dist/shortcuts/contract/operations/write.js +2 -1
  130. package/dist/shortcuts/cowork/continuation.js +2 -1
  131. package/dist/shortcuts/cowork/index.js +2 -0
  132. package/dist/shortcuts/cowork/operations/discuss-write.js +5 -1
  133. package/dist/shortcuts/cowork/operations/item-write.js +1 -7
  134. package/dist/shortcuts/cowork/operations/member-write.js +3 -1
  135. package/dist/shortcuts/cowork/operations/permission-write.js +5 -1
  136. package/dist/shortcuts/cowork/operations/shared.js +7 -0
  137. package/dist/shortcuts/ebuilder-form/continuation.js +2 -1
  138. package/dist/shortcuts/ebuilder-form/index.js +2 -0
  139. package/dist/shortcuts/ebuilder-form/operations/write.js +3 -2
  140. package/dist/shortcuts/ehr/continuation.js +2 -1
  141. package/dist/shortcuts/ehr/index.js +2 -0
  142. package/dist/shortcuts/ehr/operations/attend-write.js +44 -2
  143. package/dist/shortcuts/ehr/operations/hr-contact.js +7 -4
  144. package/dist/shortcuts/ehr/operations/hr-report.js +13 -7
  145. package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +317 -63
  146. package/dist/shortcuts/ehr/operations/recruit-position.js +134 -2
  147. package/dist/shortcuts/ehr/operations/recruit-write.js +263 -18
  148. package/dist/shortcuts/ehr/operations/recruit.js +10 -4
  149. package/dist/shortcuts/ehr/operations/shared.js +47 -0
  150. package/dist/shortcuts/esb/continuation.js +2 -1
  151. package/dist/shortcuts/esb/index.js +2 -0
  152. package/dist/shortcuts/esb/operations/trigger.js +2 -1
  153. package/dist/shortcuts/fna/continuation.js +2 -1
  154. package/dist/shortcuts/fna/index.js +2 -0
  155. package/dist/shortcuts/fna/operations/invoice-writeoff.js +1 -1
  156. package/dist/shortcuts/fna/operations/loan.js +1 -1
  157. package/dist/shortcuts/hrm/index.js +2 -0
  158. package/dist/shortcuts/hrm/operations/org.js +118 -0
  159. package/dist/shortcuts/im/continuation.js +2 -1
  160. package/dist/shortcuts/index.js +10 -0
  161. package/dist/shortcuts/invoice/continuation.js +2 -1
  162. package/dist/shortcuts/invoice/index.js +14 -15
  163. package/dist/shortcuts/invoice/invoice-record.js +93 -0
  164. package/dist/shortcuts/invoice/manifest.js +190 -393
  165. package/dist/shortcuts/invoice/operations/add.js +2 -1
  166. package/dist/shortcuts/invoice/operations/delete.js +2 -1
  167. package/dist/shortcuts/invoice/operations/import.js +2 -1
  168. package/dist/shortcuts/invoice/operations/issuing-contract-detail.js +86 -0
  169. package/dist/shortcuts/invoice/operations/issuing-contracts.js +210 -0
  170. package/dist/shortcuts/invoice/operations/registry.js +17 -17
  171. package/dist/shortcuts/invoice/operations/reim-auto.js +4 -569
  172. package/dist/shortcuts/invoice/operations/reim.js +52 -341
  173. package/dist/shortcuts/invoice/operations/shared.js +21 -4
  174. package/dist/shortcuts/invoice/operations/update.js +2 -1
  175. package/dist/shortcuts/invoice/projection.js +10 -62
  176. package/dist/shortcuts/jiuchuanhui/continuation.js +2 -1
  177. package/dist/shortcuts/jiuchuanhui/index.js +2 -0
  178. package/dist/shortcuts/jiuchuanhui/operations/datajson.js +2 -1
  179. package/dist/shortcuts/jiuchuanhui/operations/esb.js +2 -1
  180. package/dist/shortcuts/mail/continuation.js +2 -1
  181. package/dist/shortcuts/mail/index.js +2 -0
  182. package/dist/shortcuts/mail/operations/mail-blacklist.js +1 -1
  183. package/dist/shortcuts/mail/operations/mail-contacts.js +1 -1
  184. package/dist/shortcuts/mail/operations/mail-send.js +1 -1
  185. package/dist/shortcuts/mail/operations/mail-sign.js +1 -1
  186. package/dist/shortcuts/mail/operations/mail-template.js +1 -1
  187. package/dist/shortcuts/meeting/continuation.js +2 -1
  188. package/dist/shortcuts/meeting/index.js +2 -0
  189. package/dist/shortcuts/meeting/operations/change.js +1 -1
  190. package/dist/shortcuts/meeting/operations/create.js +1 -1
  191. package/dist/shortcuts/meeting/operations/eb/catalog.js +4 -1
  192. package/dist/shortcuts/meeting/operations/eb/create-flow.js +101 -35
  193. package/dist/shortcuts/meeting/operations/eb/decision.js +1 -1
  194. package/dist/shortcuts/meeting/operations/eb/factory.js +34 -1
  195. package/dist/shortcuts/meeting/operations/eb/group-chat.js +25 -3
  196. package/dist/shortcuts/meeting/operations/eb/person-cache.js +96 -0
  197. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +33 -11
  198. package/dist/shortcuts/meeting/operations/lifecycle.js +1 -1
  199. package/dist/shortcuts/meeting/operations/receipts.js +1 -1
  200. package/dist/shortcuts/meeting/operations/signs.js +1 -1
  201. package/dist/shortcuts/okr/continuation.js +2 -1
  202. package/dist/shortcuts/okr/index.js +2 -0
  203. package/dist/shortcuts/okr/operations/write.js +1 -1
  204. package/dist/shortcuts/plan/continuation.js +2 -1
  205. package/dist/shortcuts/plan/index.js +2 -0
  206. package/dist/shortcuts/plan/operations/write.js +1 -1
  207. package/dist/shortcuts/project/continuation.js +2 -1
  208. package/dist/shortcuts/project/index.js +2 -0
  209. package/dist/shortcuts/project/operations/read.js +6 -25
  210. package/dist/shortcuts/project/operations/shared.js +22 -0
  211. package/dist/shortcuts/project/operations/write.js +28 -2
  212. package/dist/shortcuts/reception/constants.js +53 -0
  213. package/dist/shortcuts/reception/errors.js +54 -0
  214. package/dist/shortcuts/reception/host.js +125 -0
  215. package/dist/shortcuts/reception/index.js +198 -0
  216. package/dist/shortcuts/reception/manifest.js +177 -0
  217. package/dist/shortcuts/reception/operations/ask.js +71 -0
  218. package/dist/shortcuts/reception/operations/browsertool.js +58 -0
  219. package/dist/shortcuts/reception/operations/compose.js +129 -0
  220. package/dist/shortcuts/reception/operations/customparams.js +74 -0
  221. package/dist/shortcuts/reception/operations/doc.js +238 -0
  222. package/dist/shortcuts/reception/operations/docrender.js +36 -0
  223. package/dist/shortcuts/reception/operations/panels.js +179 -0
  224. package/dist/shortcuts/reception/operations/registry.js +26 -0
  225. package/dist/shortcuts/reception/operations/render-assets.js +184 -0
  226. package/dist/shortcuts/reception/operations/render.js +123 -0
  227. package/dist/shortcuts/reception/operations/runs.js +38 -0
  228. package/dist/shortcuts/reception/operations/schedule.js +127 -0
  229. package/dist/shortcuts/reception/operations/shared.js +196 -0
  230. package/dist/shortcuts/reception/operations/snapshot.js +68 -0
  231. package/dist/shortcuts/reception/operations/types.js +1 -0
  232. package/dist/shortcuts/reception/operations.js +33 -0
  233. package/dist/shortcuts/reception/upload.js +218 -0
  234. package/dist/shortcuts/recruit-stage/context.js +231 -0
  235. package/dist/shortcuts/recruit-stage/continuation.js +74 -0
  236. package/dist/shortcuts/recruit-stage/errors.js +65 -0
  237. package/dist/shortcuts/recruit-stage/host.js +109 -0
  238. package/dist/shortcuts/recruit-stage/index.js +115 -0
  239. package/dist/shortcuts/recruit-stage/manifest.js +29 -0
  240. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +722 -0
  241. package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +269 -0
  242. package/dist/shortcuts/recruit-stage/operations/jd-create.js +719 -0
  243. package/dist/shortcuts/recruit-stage/operations/list.js +431 -0
  244. package/dist/shortcuts/recruit-stage/operations/registry.js +38 -0
  245. package/dist/shortcuts/recruit-stage/operations/resume-import.js +1354 -0
  246. package/dist/shortcuts/recruit-stage/operations/search.js +158 -0
  247. package/dist/shortcuts/recruit-stage/operations/types.js +25 -0
  248. package/dist/shortcuts/recruit-stage/school-tiers.json +318 -0
  249. package/dist/shortcuts/recruit-stage/shared.js +608 -0
  250. package/dist/shortcuts/workflow/continuation.js +2 -1
  251. package/dist/shortcuts/workflow/index.js +2 -0
  252. package/dist/shortcuts/workflow/operations/form.js +32 -8
  253. package/dist/shortcuts/workflow/operations/todoSmartConvert/detailFieldRules.js +4 -2
  254. package/dist/shortcuts/workflow/operations/todoSmartConvert/summaryCache.js +13 -6
  255. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailCache.js +17 -24
  256. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoDetailFetcher.js +14 -9
  257. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +50 -8
  258. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +2 -1
  259. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.detail.js +17 -11
  260. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +7 -39
  261. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.groupSummary.js +3 -2
  262. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +51 -15
  263. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.pipeline.js +16 -1
  264. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +151 -63
  265. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.subGroup.js +56 -0
  266. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.summary.js +39 -14
  267. package/dist/shortcuts/workflow/operations/write.js +1 -1
  268. package/docs/_catalog.md +3 -0
  269. package/docs/agent-invoice.md +1 -1
  270. package/docs/archive-oa.md +1 -1
  271. package/docs/caizhilian.md +1 -1
  272. package/docs/calendar.md +1 -1
  273. package/docs/contract.md +1 -1
  274. package/docs/e10-auth.md +23 -1
  275. package/docs/ehr.md +2 -2
  276. package/docs/esb.md +1 -1
  277. package/docs/im.md +1 -1
  278. package/docs/invoice.md +8 -12
  279. package/docs/okr.md +1 -1
  280. package/docs/operation-manual.md +8 -0
  281. package/docs/reception.md +119 -0
  282. package/package.json +1 -1
  283. package/scripts/clean.mjs +43 -2
  284. package/scripts/install-skill-to-xiaoe.mjs +105 -0
  285. package/scripts/package-skill.mjs +4 -2
  286. package/skill-template/business-info.json +42 -2
  287. package/skill-template/domains/caizhilian.md +1 -1
  288. package/skill-template/domains/reception-flow.md +18 -0
  289. package/skill-template/domains/recruit-stage.md +29 -0
  290. package/skill-template/domains/yepiaotong.md +4 -7
  291. package/skills/weaver-e10-archive-oa/references/source-manifest.json +14 -14
  292. package/skills/weaver-e10-blog/references/blog-publish.md +1 -1
  293. package/skills/weaver-e10-blog/references/source-manifest.json +7 -7
  294. package/skills/weaver-e10-caizhilian/references/source-manifest.json +21 -21
  295. package/skills/weaver-e10-caizhilian/references/write-protocol.md +2 -2
  296. package/skills/weaver-e10-calendar/SKILL.md +2 -1
  297. package/skills/weaver-e10-calendar/references/calendar-write.md +55 -1
  298. package/skills/weaver-e10-cowork/SKILL.md +1 -1
  299. package/skills/weaver-e10-cowork/references/cowork-write.md +3 -1
  300. package/skills/weaver-e10-ebuilder-form/SKILL.md +1 -1
  301. package/skills/weaver-e10-ebuilder-form/references/custom-api.md +1 -1
  302. package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +1 -1
  303. package/skills/weaver-e10-esb/SKILL.md +2 -2
  304. package/skills/weaver-e10-esb/references/source-manifest.json +22 -22
  305. package/skills/weaver-e10-esb/references/trigger.md +2 -2
  306. package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +1 -1
  307. package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +1 -1
  308. package/skills/weaver-e10-jinchengda/references/contract-request-write.md +1 -1
  309. package/skills/weaver-e10-jinchengda/references/source-manifest.json +29 -29
  310. package/skills/weaver-e10-jucailin/SKILL.md +1 -1
  311. package/skills/weaver-e10-jucailin/references/attend-write.md +10 -2
  312. package/skills/weaver-e10-jucailin/references/hr-contact.md +8 -0
  313. package/skills/weaver-e10-jucailin/references/hr-report.md +8 -0
  314. package/skills/weaver-e10-jucailin/references/recruit-create.md +14 -5
  315. package/skills/weaver-e10-jucailin/references/recruit-read.md +1 -1
  316. package/skills/weaver-e10-jucailin/references/recruit-write.md +5 -4
  317. package/skills/weaver-e10-mail/SKILL.md +1 -1
  318. package/skills/weaver-e10-meeting/SKILL.md +39 -7
  319. package/skills/weaver-e10-meeting/references/meeting-change.md +1 -1
  320. package/skills/weaver-e10-meeting/references/meeting-create.md +1 -1
  321. package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +1 -1
  322. package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
  323. package/skills/weaver-e10-okr/references/okr-align.md +1 -1
  324. package/skills/weaver-e10-okr/references/okr-keyresult.md +1 -1
  325. package/skills/weaver-e10-okr/references/okr-write.md +1 -1
  326. package/skills/weaver-e10-okr/references/source-manifest.json +8 -8
  327. package/skills/weaver-e10-plan/references/plan-report-write.md +1 -1
  328. package/skills/weaver-e10-plan/references/source-manifest.json +20 -20
  329. package/skills/weaver-e10-qiyecheng/references/loan-management.md +1 -1
  330. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +18 -18
  331. package/skills/weaver-e10-reception-flow/SKILL.md +173 -0
  332. 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
  333. package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +213 -0
  334. package/skills/weaver-e10-reception-flow/references/browsertool.md +68 -0
  335. package/skills/weaver-e10-reception-flow/references/env-pitfalls.md +51 -0
  336. package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +227 -0
  337. package/skills/weaver-e10-reception-flow/references/guide.md +179 -0
  338. package/skills/weaver-e10-reception-flow/scripts/locate.sh +14 -0
  339. package/skills/weaver-e10-reception-flow/scripts/render.py +724 -0
  340. package/skills/weaver-e10-recruit-stage/SKILL.md +230 -0
  341. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +119 -0
  342. package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +188 -0
  343. package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +66 -0
  344. package/skills/weaver-e10-recruit-stage/references/position-templates.md +202 -0
  345. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +322 -0
  346. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +127 -0
  347. package/skills/weaver-e10-recruit-stage/references/recruit-check-install.md +65 -0
  348. package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +63 -0
  349. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +142 -0
  350. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +95 -0
  351. package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +56 -0
  352. package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +101 -0
  353. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +148 -0
  354. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +77 -0
  355. package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +59 -0
  356. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-creator.md +69 -0
  357. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +241 -0
  358. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +451 -0
  359. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +128 -0
  360. package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +146 -0
  361. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +69 -0
  362. package/skills/weaver-e10-shared/SKILL.md +1 -1
  363. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +10 -2
  364. package/skills/weaver-e10-shijingran/SKILL.md +7 -6
  365. package/skills/weaver-e10-shijingran/references/operations.md +3 -1
  366. package/skills/weaver-e10-shijingran/references/source-manifest.json +30 -28
  367. package/skills/weaver-e10-shijingran/references/write-operations.md +2 -0
  368. package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +2 -0
  369. package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
  370. package/skills/weaver-e10-workflow/SKILL.md +4 -2
  371. package/skills/weaver-e10-workflow/aigroup/default.json +11 -9
  372. package/skills/weaver-e10-workflow/references/source-manifest.json +32 -32
  373. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +23 -13
  374. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +62 -20
  375. package/skills/weaver-e10-yepiaotong/SKILL.md +28 -36
  376. package/skills/weaver-e10-yepiaotong/references/invoice-agent-entry.md +6 -3
  377. package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +13 -10
  378. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +2 -0
  379. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +194 -155
  380. package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +28 -32
  381. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +5 -1
  382. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +8 -10
  383. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +211 -616
  384. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +149 -117
  385. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +17 -20
  386. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +20 -39
  387. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +55 -22
  388. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +7 -17
  389. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +88 -92
  390. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +144 -354
  391. package/skills/weaver-e10-yimiaoban/SKILL.md +1 -1
  392. package/skills/weaver-e10-yimiaoban/references/msg-write.md +1 -1
  393. package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
  394. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +7 -7
  395. package/dist/chunks/chunk-SPRHHSVC.js +0 -465
  396. package/dist/chunks/registry-KMHCPAAD.js +0 -22
  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
@@ -0,0 +1,608 @@
1
+ /**
2
+ * recruit-stage 共享写操作库(自技能版 scripts/write-op.mjs 1:1 移植)。
3
+ *
4
+ * 封装 EB 写操作公共能力:表单/布局解析、saveFormData、runEsb、按钮配置解析
5
+ * (getFormButtons/getListButtons)。全部运行时解析,不写死 esbActionIds/表单 id;
6
+ * 认证由 CLI 宿主注入(host.request),环境上下文经 recruit-stage/context.ts 加载。
7
+ *
8
+ * 与脚本版的机制差异(其余逻辑逐行对应):
9
+ * - 请求层:脚本版 request({path,body,...}) → host.request({path,body,...});
10
+ * 401 判定/续期由 CLI 运行时统一处理;响应大整数已被 parseJsonPreservingBigInts
11
+ * 加引号保精度(脚本版"从原文提取 formDataIds"的兜底不再需要,但保留兼容读取)。
12
+ * - 环境缓存:脚本版 ensureEnvCache(<appId>.json)→ 复用 ehr 模块 RecruitContextLoader
13
+ * (同构五层解析,磁盘缓存目录一致,可直接命中脚本版播种的缓存)。
14
+ */
15
+ import { randomUUID } from 'node:crypto';
16
+ import { rsFail } from './errors.js';
17
+ export function randHex32() {
18
+ return randomUUID().replace(/-/g, '');
19
+ }
20
+ // 表单 objId(tag 解析,缓存优先)
21
+ export function objIdOf(cache, key) {
22
+ const fo = cache.forms[key];
23
+ if (!fo?.objId)
24
+ throw rsFail('环境缓存缺少表单 ' + key + ' 的 objId(该表单可能未启用)');
25
+ return String(fo.objId);
26
+ }
27
+ export function formIdOf(cache, key) {
28
+ const fo = cache.forms[key];
29
+ if (!fo?.formId)
30
+ return objIdOf(cache, key);
31
+ return String(fo.formId);
32
+ }
33
+ // 表单布局完整数据:GET 优先,失败回退 POST(部分版本需 POST + module 参数,缺 module 会 500)
34
+ // 进程内 memo:同 formId 同进程只拉一次(getFormLayout/getFormLayoutMeta 共享);失败即剔除可重试
35
+ const __layoutMemo = new Map();
36
+ function fetchLayoutData(host, formId) {
37
+ if (!__layoutMemo.has(formId)) {
38
+ const p = fetchLayoutDataRaw(host, formId).catch((e) => { __layoutMemo.delete(formId); throw e; });
39
+ __layoutMemo.set(formId, p);
40
+ }
41
+ return __layoutMemo.get(formId);
42
+ }
43
+ async function fetchLayoutDataRaw(host, formId) {
44
+ try {
45
+ const r = await host.request({ path: '/api/ebuilder/form/form/core/getFormLayout?formId=' + formId, method: 'GET' });
46
+ if (r?.data)
47
+ return r.data;
48
+ }
49
+ catch { /* 回退 POST */ }
50
+ try {
51
+ const r = await host.request({
52
+ path: '/api/ebuilder/form/form/core/getFormLayout',
53
+ method: 'POST',
54
+ body: { module: 'ebuilderform', formId, terminalType: 'PC' },
55
+ });
56
+ if (r?.data)
57
+ return r.data;
58
+ }
59
+ catch { /* ignore */ }
60
+ return null;
61
+ }
62
+ // 表单布局 id:布局数据 formLayout.id;失败回退 formId
63
+ export async function getFormLayout(host, formId) {
64
+ const d = await fetchLayoutData(host, formId);
65
+ return d?.formLayout?.id || d?.id || formId;
66
+ }
67
+ // 表单布局完整元数据:viewRelateConfig(字段级 required/readOnly)+ viewLinkages(条件必填/显隐)
68
+ export async function getFormLayoutMeta(host, formId) {
69
+ return fetchLayoutData(host, formId);
70
+ }
71
+ // 表单类 esb 按钮解析:POST getFormButtons(body objId[, layoutId]) → 扁平 actions[](带 _btn=按钮名)
72
+ export async function getFormButtons(host, objId, layoutId) {
73
+ const body = {
74
+ layoutType: 'formLayout', objId, dataId: '', formDataId: '',
75
+ type: '1', fromRecycle: false, otherOperator: '', objectAppId: '',
76
+ browser: 'Chrome', isTamper: '0',
77
+ };
78
+ if (layoutId)
79
+ body.layoutId = layoutId;
80
+ const r = await host.request({ path: '/api/ebuilder/form/data/getFormButtons', body });
81
+ const btns = r?.data?.buttons || r?.data || [];
82
+ const actions = [];
83
+ for (const b of btns) {
84
+ for (const a of b?.actions || []) {
85
+ actions.push({ ...a, _btn: b.name, _buttonKey: b.buttonKey, _buttonId: b.id, _buttonOrder: b.showOrder });
86
+ }
87
+ }
88
+ return actions;
89
+ }
90
+ // 取「保存」按钮下的**已启用**动作链(按 showOrder 升序)——页面点「保存」时依次执行的就是这一串。
91
+ // 跨环境自适应:按钮 id / 动作 id / 动作数量 / 名称均运行时解析,不写死。
92
+ // enable=0 的动作页面不会执行(实测:人才表单 7 条动作里 3 条为禁用态),一律排除。
93
+ export function pickSaveButtonActions(actions, { includeDisabled = false } = {}) {
94
+ const all = actions || [];
95
+ let own = all.filter((a) => a._buttonKey === 'save');
96
+ if (!own.length) {
97
+ const names = new Set(all.filter((a) => a.actionType === 'system' && a._btn).map((a) => a._btn));
98
+ own = all.filter((a) => a._btn && names.has(a._btn));
99
+ }
100
+ const sorted = [...own].sort((x, y) => (x.showOrder ?? 0) - (y.showOrder ?? 0));
101
+ if (includeDisabled)
102
+ return sorted;
103
+ return sorted.filter((a) => a.enable === undefined || a.enable === null || Number(a.enable) !== 0);
104
+ }
105
+ // 列表类 esb 按钮解析(催评):GET getListButtons/{listId}?passid → buttons[].actions[]
106
+ export async function getListButtons(host, listId, passid) {
107
+ const r = await host.request({ path: '/api/ebuilder/form/list/getListButtons/' + listId + '?passid=' + passid, method: 'GET' });
108
+ const btns = r?.data?.buttons || r?.data || [];
109
+ const actions = [];
110
+ for (const b of btns)
111
+ for (const a of b?.actions || [])
112
+ actions.push({ ...a, _btn: b.name });
113
+ return actions;
114
+ }
115
+ // 从 actions 里挑 actionType=esb 且名称匹配(含关键词、排除词)的按钮 id
116
+ export function pickEsb(actions, include, exclude = []) {
117
+ const match = (name) => {
118
+ if (!name)
119
+ return false;
120
+ if (exclude.some((e) => name.includes(e)))
121
+ return false;
122
+ return include.some((i) => name.includes(i));
123
+ };
124
+ for (const a of actions) {
125
+ if (a.actionType === 'esb' && match(a.name || a._btn || a.text))
126
+ return a.id;
127
+ }
128
+ return null;
129
+ }
130
+ // saveFormData:新建(rightType 0)或更新(rightType 2,带 formDataId/updateTimeStamp)
131
+ export async function saveFormData(host, opts) {
132
+ const { appId, formId, objId, name, dataDetails, rightType = '0', formDataId, updateTimeStamp, layoutId, extraCustomParam = {} } = opts;
133
+ const finalLayout = layoutId || await getFormLayout(host, formId);
134
+ const customParam = {
135
+ objId, name: name || '', firstDataName: name || '',
136
+ isFlowEnd: false, otherOperator: '', dataStatus: 'submit', rightType,
137
+ appId, ...extraCustomParam,
138
+ };
139
+ const formData = {
140
+ module: 'ebuilderform', client: 'pc', dataStatus: 'submit',
141
+ form: { id: formId }, formLayout: { id: finalLayout },
142
+ };
143
+ if (formDataId)
144
+ formData.id = formDataId;
145
+ if (updateTimeStamp)
146
+ formData.updateTimeStamp = updateTimeStamp;
147
+ if (dataDetails)
148
+ formData.dataDetails = dataDetails;
149
+ const r = await host.request({
150
+ path: '/api/ebuilder/form/form/core/saveFormData?formId=' + formId,
151
+ body: { module: 'ebuilderform', appId, customParam, formData },
152
+ });
153
+ if (!r?.status && r?.code !== 200) {
154
+ throw rsFail('saveFormData 失败: ' + (r?.msg || JSON.stringify(r).slice(0, 200)));
155
+ }
156
+ return String(r?.data?.id);
157
+ }
158
+ // ── 招聘业务查重(页面新建人才时用的就是它)──────────────────────────────
159
+ // 页面代码块逻辑:手机号 → POST getCandidateByPhone → data.candidateId 有值即「已绑定人才」。
160
+ // 注意 candidateId 是**应聘批次 id**(= batchNo),不是 talentId;两者都返回。未命中时 data = {}。
161
+ export async function getCandidateByPhone(host, phone) {
162
+ const r = await host.request({ path: '/api/recruit/candidate/getCandidateByPhone', method: 'POST', body: { phone: String(phone) } });
163
+ const d = r?.data || {};
164
+ return {
165
+ talentId: d.talentId ? String(d.talentId) : '',
166
+ candidateId: d.candidateId ? String(d.candidateId) : '',
167
+ batchNo: d.batchNo ? String(d.batchNo) : '',
168
+ };
169
+ }
170
+ // 人才查看页(页面代码块弹窗跳转地址,recruitType=useSelf 表示租户人才库)
171
+ export function buildTalentViewUrl(baseUrl, candidateId) {
172
+ return `${baseUrl}/sp/recruit/talentView?batchId=${candidateId}&recruitType=useSelf`;
173
+ }
174
+ // 人才类链接的自用系统追加参数:环境缓存 selfUse(config_key=-9999)='1' → 追加 &recruitType=useSelf。
175
+ // 仅人才类链接需要;职位/面试等非人才链接不需要。
176
+ export function talentLinkExtra(cache) {
177
+ return String(cache && cache.selfUse) === '1' ? '&recruitType=useSelf' : '';
178
+ }
179
+ // ── 唯一性校验(页面新建/编辑时调用的查重接口)────────────────────────────────
180
+ // 返回 formDataIds = 已存在记录 id 列表;含已软删除记录(平台仍视为占用,会拦新建)。
181
+ // CLI 运行时已对 16+ 位整数保精度(字符串形态),此处仍保留正则兜底提取以兼容极端情况。
182
+ export async function checkUnique(host, opts) {
183
+ const { objId, fieldId, value, dataId } = opts;
184
+ const dataDetail = { content: String(value), formField: { id: String(fieldId) } };
185
+ const customParam = { objId: String(objId) };
186
+ if (dataId) {
187
+ dataDetail.formData = { id: String(dataId) };
188
+ customParam.dataId = String(dataId);
189
+ }
190
+ const r = await host.request({
191
+ path: '/api/ebuilder/form/form/core/checkUnique', method: 'POST',
192
+ body: { dataDetail, module: 'ebuilderform', customParam },
193
+ });
194
+ const d = r?.data || {};
195
+ let ids = [];
196
+ const rawList = d.formDataIds;
197
+ if (Array.isArray(rawList))
198
+ ids = rawList.map((x) => String(x)).filter((x) => /^\d{10,}$/.test(x));
199
+ if (!ids.length) {
200
+ // 兜底:宿主未保精度时从原文提取(与脚本版同构)
201
+ const text = typeof r?.__raw === 'string' ? r.__raw : '';
202
+ const m = text.match(/"formDataIds"\s*:\s*\[([^\]]*)\]/);
203
+ if (m)
204
+ ids = m[1].match(/\d{10,}/g) || [];
205
+ }
206
+ return { unique: d.unique !== false, formDataIds: [...new Set(ids)] };
207
+ }
208
+ // ── OpenAPI 数据集接口(唯一支持明细表的写入通道)────────────────────────────
209
+ // `form/core/saveFormData` 的 dataDetails 不接收 DetailTable(实测 9 种结构全被忽略),
210
+ // 明细表只能走 /api/ebuilder/form/dataset/v2/saveFormData(detail1..detailN)。
211
+ // 主表 ↔ 明细节点映射:{mainTable: mainObjId, detail1: subFormId, ...}
212
+ // 明细编号顺序 ≠ 布局顺序,必须运行时解析。
213
+ export async function getTableMapping(host, objId) {
214
+ const r = await host.request({ path: '/api/ebuilder/form/dataset/v1/getTableMapping?objId=' + encodeURIComponent(objId), method: 'GET' });
215
+ const d = r?.data;
216
+ if (!d || !d.mainTable)
217
+ throw rsFail('getTableMapping 未返回映射(objId=' + objId + '):' + JSON.stringify(r).slice(0, 200));
218
+ return d;
219
+ }
220
+ // 反向映射:subFormId → detailN
221
+ export function invertTableMapping(mapping) {
222
+ const out = {};
223
+ for (const [node, tableId] of Object.entries(mapping || {})) {
224
+ if (node === 'mainTable')
225
+ continue;
226
+ out[String(tableId)] = node;
227
+ }
228
+ return out;
229
+ }
230
+ // OpenAPI 新增(主表 + 明细一次写入)。键必须用 config.dataKey(name 可能等于 id,会被静默忽略)。
231
+ export async function datasetSaveFormData(host, opts) {
232
+ const { objId, mainTable, details, doAction = false, fieldNoFindIgnore = true } = opts;
233
+ const record = { mainTable };
234
+ for (const [node, rows] of Object.entries(details || {})) {
235
+ if (Array.isArray(rows) && rows.length)
236
+ record[node] = rows;
237
+ }
238
+ const r = await host.request({
239
+ path: '/api/ebuilder/form/dataset/v2/saveFormData',
240
+ method: 'POST',
241
+ body: {
242
+ datajson: {
243
+ datas: [record],
244
+ header: { objId },
245
+ operationinfo: {
246
+ fieldNoFindIgnore: fieldNoFindIgnore ? 'true' : 'false',
247
+ doAction: doAction ? 'true' : 'false',
248
+ },
249
+ },
250
+ },
251
+ });
252
+ const dj = r?.data?.datajson || {};
253
+ const code = r?.message?.code;
254
+ const ok = (code === undefined || String(code) === '0') && dj.status !== false;
255
+ if (!ok) {
256
+ // 业务失败信息在 data.datajson.message(如平台查重),外层 message.msg 恒为 success
257
+ throw rsFail('dataset saveFormData 失败:' + (dj.message || r?.message?.msg || JSON.stringify(r).slice(0, 300)));
258
+ }
259
+ const ids = Array.isArray(dj.dataIds) ? dj.dataIds.map(String) : [];
260
+ if (!ids.length)
261
+ throw rsFail('dataset saveFormData 未返回 dataIds:' + JSON.stringify(r).slice(0, 300));
262
+ return { dataId: ids[0], dataIds: ids };
263
+ }
264
+ // OpenAPI 修改(支持明细覆盖:operateType={detailN:'cover'})
265
+ export async function datasetUpdateFormData(host, opts) {
266
+ const { objId, dataId, mainTable, details, coverDetails = [] } = opts;
267
+ const record = { mainTable: { id: String(dataId), ...(mainTable || {}) } };
268
+ const operateType = {};
269
+ for (const [node, rows] of Object.entries(details || {})) {
270
+ if (!Array.isArray(rows))
271
+ continue;
272
+ record[node] = rows;
273
+ if (coverDetails.includes(node))
274
+ operateType[node] = 'cover';
275
+ }
276
+ const operationinfo = { updateType: 'ids', fieldNoFindIgnore: 'true', needAdd: 'false', doAction: 'false' };
277
+ if (Object.keys(operateType).length)
278
+ operationinfo.operateType = operateType;
279
+ const r = await host.request({
280
+ path: '/api/ebuilder/form/dataset/v2/updateFormData',
281
+ method: 'POST',
282
+ body: { datajson: { datas: [record], header: { objId }, operationinfo } },
283
+ });
284
+ const dj = r?.data?.datajson || {};
285
+ const ok = (r?.message?.code === undefined || String(r?.message?.code) === '0') && dj.status !== false;
286
+ if (!ok)
287
+ throw rsFail('dataset updateFormData 失败:' + (dj.message || r?.message?.msg || JSON.stringify(r).slice(0, 300)));
288
+ return { dataIds: (dj.dataIds || []).map(String) };
289
+ }
290
+ // runEsb:触发动作流(dataIds = 目标记录 id;esbActionIds = 按钮配置解析)
291
+ export async function runEsb(host, opts) {
292
+ const r = await host.request({
293
+ path: '/api/ebuilder/form/esb/runEsb?objId=' + opts.objId,
294
+ body: { dataIds: opts.dataIds, esbActionIds: opts.esbActionIds, objId: opts.objId },
295
+ });
296
+ return r?.data || {};
297
+ }
298
+ // 通用:执行「保存」按钮配置里的 esb 动作流。没有配 esb 时返回空数组(不报错)。
299
+ export async function runSaveButtonEsbActions(host, opts) {
300
+ const { objId, formId, dataId } = opts;
301
+ const layoutId = await getFormLayout(host, formId);
302
+ const acts = pickSaveButtonActions(await getFormButtons(host, objId, layoutId));
303
+ const done = [];
304
+ for (const a of acts) {
305
+ if (a.actionType !== 'esb')
306
+ continue;
307
+ const r = await runEsb(host, { objId, dataIds: dataId, esbActionIds: a.id });
308
+ const ok = r?.status !== false;
309
+ done.push({ order: a.showOrder, name: a.name, ok, msg: r?.successMsg || r?.failMsg || '' });
310
+ if (!ok)
311
+ throw rsFail('「保存」后续动作「' + (a.name || a.id) + '」执行失败:' + (r?.failMsg || '未知原因'));
312
+ }
313
+ return done;
314
+ }
315
+ /**
316
+ * 当前登录用户(跨环境取法:teamsCheck 返回 currentUser)。
317
+ * 用途:人员型字段的"默认 = 当前人"(招聘负责人/用人经理/面试官),
318
+ * 避免用"人员候选列表第一条"当默认(可能是任意人)。
319
+ */
320
+ export async function resolveCurrentUser(host) {
321
+ try {
322
+ const r = await host.request({ path: '/api/baseserver/layout/teamsCheck', method: 'POST', body: {} });
323
+ const cu = (r && (r.currentUser || (r.data && r.data.currentUser))) || null;
324
+ return cu && cu.id ? { id: String(cu.id), name: cu.username || String(cu.id) } : null;
325
+ }
326
+ catch {
327
+ return null;
328
+ }
329
+ }
330
+ // 人员名称 → userId(门户字段 browser/complete/resource)
331
+ export async function resolvePersonId(host, fieldId, keyword) {
332
+ const r = await host.request({
333
+ path: '/api/ebuilder/form/common/browser/complete/resource',
334
+ body: { formParam: { fieldId, searchValue: keyword }, 'formParam.fieldId': fieldId, 'formParam.searchValue': keyword },
335
+ });
336
+ const list = r?.data?.data || r?.data || [];
337
+ return list[0]?.id || list[0]?.value || null;
338
+ }
339
+ // ds/options 运行时解析枚举(面试方式/轮次/状态等):name → optionId
340
+ export async function getDsOptions(host, objId, fieldId, groupId) {
341
+ const r = await host.request({
342
+ path: '/api/ebuilder/common/ds/options?fieldName=' + fieldId + '&objId=' + objId + '&sourceType=FORM&groupId=' + groupId,
343
+ method: 'GET',
344
+ });
345
+ const list = r?.data || [];
346
+ const map = {};
347
+ for (const x of list)
348
+ map[x.name] = x.id;
349
+ return map;
350
+ }
351
+ // 环境缓存 field_options({optionId: 名称})反转成 getDsOptions 同款 {名称: optionId};未覆盖返回 null 由调用方回源
352
+ export function cachedDsMap(cache, objId, fieldKey) {
353
+ const fidv = (cache.fields[objId] || {})[fieldKey];
354
+ const opts = fidv && cache.field_options?.[objId] && cache.field_options[objId][fidv];
355
+ if (!opts || !Object.keys(opts).length)
356
+ return null;
357
+ const map = {};
358
+ for (const [id, name] of Object.entries(opts))
359
+ map[name] = id;
360
+ return map;
361
+ }
362
+ /* ============ 按钮动作智能解析(数据页按钮 → 粗定位 → 精核验 → 动作拆解) ============ */
363
+ // 数据页按钮:POST getFormButtons(type=2,带 dataId)→ 返回按钮数组(含 actions)
364
+ export async function getFormButtonsForData(host, objId, formId, dataId, layoutId) {
365
+ const body = {
366
+ layoutType: 'formLayout', objId, dataId, formDataId: dataId,
367
+ type: '2', fromRecycle: false, otherOperator: '', objectAppId: '',
368
+ browser: 'Chrome', isTamper: '0',
369
+ };
370
+ if (layoutId)
371
+ body.layoutId = layoutId;
372
+ const r = await host.request({ path: '/api/ebuilder/form/data/getFormButtons', body });
373
+ const data = r?.data;
374
+ const btns = Array.isArray(data) ? data : (data?.buttons || []);
375
+ return btns;
376
+ }
377
+ // 粗定位:找「带保存动作」的按钮(actionType=system 或 buttonKey=editSave)
378
+ export function findSubmitButton(btns) {
379
+ for (const b of btns || []) {
380
+ const acts = b?.actions || [];
381
+ if (acts.some((a) => a.actionType === 'system') || b?.buttonKey === 'editSave')
382
+ return b;
383
+ }
384
+ return null;
385
+ }
386
+ // 从 jsCode 的 ecode(内联 JS)静态提取后端 API 调用(url/method/data 参数名)
387
+ export function extractJsRequests(ecode) {
388
+ if (!ecode)
389
+ return [];
390
+ const calls = [];
391
+ const re = /(?:weappUtils\.request|\$\.ajax|axios\.\w+|fetch)\s*\(\s*\{[\s\S]*?\}/g;
392
+ let m;
393
+ while ((m = re.exec(ecode))) {
394
+ const block = m[0];
395
+ const url = (block.match(/url\s*:\s*["']([^"']+)["']/) || [])[1];
396
+ if (!url)
397
+ continue;
398
+ const method = (block.match(/method\s*:\s*["']([^"']+)["']/) || [])[1] || 'post';
399
+ const data = {};
400
+ const dm = block.match(/data\s*:\s*\{([\s\S]*?)\}/);
401
+ if (dm) {
402
+ for (const kv of dm[1].split(',')) {
403
+ const kk = kv.match(/["']?([A-Za-z_][A-Za-z0-9_]*)["']?\s*:/);
404
+ if (kk)
405
+ data[kk[1]] = kv.split(':').slice(1).join(':').trim().slice(0, 60);
406
+ }
407
+ }
408
+ calls.push({ url, method, data });
409
+ }
410
+ return calls;
411
+ }
412
+ // 精核验:分析按钮全部 actions → { system, esbIds, jsCalls, names }
413
+ export function analyzeButtonActions(btn) {
414
+ const acts = btn?.actions || [];
415
+ const esbIds = acts.filter((a) => a.actionType === 'esb').map((a) => String(a.id));
416
+ const jsCalls = [];
417
+ for (const a of acts) {
418
+ if (a.actionType === 'jsCode' && a.ecode)
419
+ jsCalls.push(...extractJsRequests(a.ecode));
420
+ }
421
+ return {
422
+ system: acts.some((a) => a.actionType === 'system'),
423
+ esbIds,
424
+ jsCalls,
425
+ names: acts.map((a) => (a.actionType === 'jsCode' ? `jsCode(${a.name})` : `${a.actionType}(${a.name})`)),
426
+ };
427
+ }
428
+ // 取数据页表单记录(含 updateTimeStamp 乐观锁 + dataDetails 全字段)
429
+ export async function getFormDataRecord(host, formId, dataId, objId, layoutId) {
430
+ const r = await host.request({
431
+ path: '/api/ebuilder/form/form/core/getFormDataAndLayout?formId=' + formId + '&dataId=' + dataId,
432
+ method: 'POST',
433
+ body: {
434
+ terminalType: 'PC', dataId, formId, module: 'ebuilderform', newLayout: true,
435
+ cacheUid: '', layoutMultiId: '', dataCrossLayout: false, permissionId: '',
436
+ allReadOnly: false, initialDatas: [], dynamicData: false, cost: false,
437
+ ...(layoutId ? { layoutId } : {}),
438
+ customParam: { objId },
439
+ },
440
+ });
441
+ const fd = r?.data?.formData || {};
442
+ const fl = r?.data?.formLayout || {};
443
+ return { id: fd.id, updateTimeStamp: fd.updateTimeStamp, dataDetails: fd.dataDetails || [], formLayoutId: fl.id };
444
+ }
445
+ // dataDetails 转换:getFormDataAndLayout 返回 {fieldId, dataOptions|dataText} → saveFormData 提交形态
446
+ export function toSubmitDetails(details) {
447
+ const out = [];
448
+ for (const x of details || []) {
449
+ const fid = x.fieldId || x.formField?.id;
450
+ if (!fid)
451
+ continue;
452
+ const o = { formField: { id: fid } };
453
+ if (x.dataOptions)
454
+ o.dataOptions = x.dataOptions;
455
+ if (x.dataText)
456
+ o.dataText = x.dataText;
457
+ if (x.value !== undefined)
458
+ o.dataText = { content: String(x.value) };
459
+ if (!o.dataOptions && !o.dataText)
460
+ continue;
461
+ out.push(o);
462
+ }
463
+ return out;
464
+ }
465
+ /**
466
+ * 跨环境菜单解析(同一功能在不同环境叫法不同)。
467
+ * 匹配顺序:① 精确名 ② 包含名;均可叠加 filter 校验。
468
+ * 未命中返回 null —— 调用方应视为「该环境无此菜单」并提示,不得臆造 URL。
469
+ */
470
+ export function findMenuNode(menus, aliases, filter) {
471
+ const list = Array.isArray(menus) ? menus : [];
472
+ const nameOf = (m) => String((m && m.menuName) || '').trim();
473
+ const ok = (m) => (typeof filter === 'function' ? !!filter(m) : true);
474
+ for (const a of aliases || []) {
475
+ const hit = list.find((m) => nameOf(m) === a && ok(m));
476
+ if (hit)
477
+ return hit;
478
+ }
479
+ for (const a of aliases || []) {
480
+ const hit = list.find((m) => nameOf(m).includes(a) && ok(m));
481
+ if (hit)
482
+ return hit;
483
+ }
484
+ return null;
485
+ }
486
+ /**
487
+ * 由表单布局元数据推导「当前取值下必填、但未提供且无默认值」的字段(纯函数)。
488
+ * - 静态必填:viewRelateConfig[].required
489
+ * - 条件必填:viewLinkages[] 中条件只涉及「面试方式」一维时,命中当前取值则 required 生效
490
+ * - 排除 defaultDetails 里带默认值的字段
491
+ *
492
+ * 枚举改名/换 id 的兼容(实测坑):
493
+ * ① 条件 optionId 在当前枚举里 → 严格按当前枚举名比较;
494
+ * ② 条件 optionId 不在当前枚举 → 按条件文本去括号后比较(AI面试(数字人) → AI面试)。
495
+ */
496
+ export function computeRequiredHint(opts) {
497
+ const { meta, fields, typeName, typeOptionId, typeOptions, dataDetails } = opts;
498
+ const rev = {};
499
+ for (const [dk, fid] of Object.entries(fields || {}))
500
+ rev[String(fid)] = dk;
501
+ const nm = (fid) => rev[String(fid)] || String(fid);
502
+ const curName = (id) => (typeOptions || {})[String(id)] || '';
503
+ const norm = (s) => String(s || '').replace(/[((][^))]*[))]/g, '').trim();
504
+ const matchTypeCondition = (cd) => {
505
+ if (!cd)
506
+ return false;
507
+ let optId = '';
508
+ let optText = '';
509
+ try {
510
+ const sj = JSON.parse(cd.sourceContent || '{}');
511
+ const o = (sj.dataOptions || [])[0];
512
+ if (o) {
513
+ optId = String(o.optionId || '');
514
+ optText = String(o.content || '');
515
+ }
516
+ if (!optText)
517
+ optText = String(sj.content || '');
518
+ }
519
+ catch { /* ignore */ }
520
+ const actual = curName(optId);
521
+ let eq;
522
+ if (actual) {
523
+ eq = actual === typeName;
524
+ }
525
+ else {
526
+ eq = !/[((]/.test(String(typeName || '')) && norm(optText) === norm(typeName);
527
+ }
528
+ if (cd.detailSymbol === 'UN_EQUAL')
529
+ return !eq;
530
+ if (cd.detailSymbol === 'IN') {
531
+ const names = optText.split(',').map((s) => norm(s));
532
+ return names.includes(norm(typeName)) || Boolean(typeOptionId && optId === String(typeOptionId));
533
+ }
534
+ return eq;
535
+ };
536
+ const required = new Set();
537
+ for (const x of meta?.viewRelateConfig || []) {
538
+ if (x.required)
539
+ required.add(nm(x.fieldId));
540
+ }
541
+ const typeFid = String((fields || {}).interview_type || '');
542
+ for (const lk of meta?.viewLinkages || []) {
543
+ const details = (lk.condition || {}).conditionDetails || [];
544
+ if (!details.length)
545
+ continue;
546
+ let hit = true;
547
+ for (const cd of details) {
548
+ if (!typeFid || String(cd.targetId) !== typeFid) {
549
+ hit = false;
550
+ break;
551
+ }
552
+ if (!matchTypeCondition(cd)) {
553
+ hit = false;
554
+ break;
555
+ }
556
+ }
557
+ if (!hit)
558
+ continue;
559
+ for (const ld of lk.linkageDetails || []) {
560
+ if (ld.linkageProp === 'required') {
561
+ for (const v of String(ld.linkageValue || '').split(','))
562
+ if (v.trim())
563
+ required.add(nm(v.trim()));
564
+ }
565
+ }
566
+ }
567
+ const filled = new Set((dataDetails || []).map((d) => nm((d.formField || {}).id)));
568
+ const defaults = new Set((meta?.defaultDetails || []).map((x) => nm(x.fieldId)));
569
+ const defaultValues = {};
570
+ for (const x of meta?.defaultDetails || []) {
571
+ const dk = nm(x.fieldId);
572
+ const o = (x.dataOptions || [])[0];
573
+ defaultValues[dk] = o
574
+ ? { optionId: String(o.optionId || ''), content: o.content || '' }
575
+ : { optionId: '', content: x.content || '' };
576
+ }
577
+ let missing = [...required].filter((k) => !filled.has(k) && !defaults.has(k));
578
+ // 业务裁定(2026-10-21 用户确认):「AI面试」= 数字人面试;「AI面试(小程序)」才是试卷+渠道形态。
579
+ // 对「AI面试」显式剔除这两项(required 原样保留以反映配置事实,只避免误报缺失)。
580
+ const DIGITAL_EXCLUDE = ['interview_paper_id', 'send_channel'];
581
+ const isDigitalHuman = String(typeName || '').trim() === 'AI面试';
582
+ let excludedByBusiness = [];
583
+ if (isDigitalHuman) {
584
+ excludedByBusiness = missing.filter((k) => DIGITAL_EXCLUDE.includes(k));
585
+ missing = missing.filter((k) => !DIGITAL_EXCLUDE.includes(k));
586
+ }
587
+ return { available: true, required: [...required], missing, hasDefault: [...defaults], defaultValues, excludedByBusiness };
588
+ }
589
+ /**
590
+ * EB 记录「卡片单页」URL:{baseUrl}/sp/ebdfpage/card/0/{objId}/{dataId}
591
+ * objId 来自环境缓存(跨环境不同,不得写死);dataId = saveFormData 返回的记录 id。
592
+ */
593
+ export function buildCardUrl(baseUrl, objId, dataId) {
594
+ if (!baseUrl || !objId || !dataId)
595
+ return null;
596
+ return String(baseUrl).replace(/\/+$/, '') + '/sp/ebdfpage/card/0/' + objId + '/' + dataId;
597
+ }
598
+ /**
599
+ * 「列表 + 滑出该记录卡片」组合地址(2026-10-21 实测可用,简化版无需
600
+ * EbdfListToCardKey/targetConditionId——它们是页面会话态/已存条件 id,运行时组不出来也不需要):
601
+ * {base}/sp/ebdfpage/list/{listId}/card/0/{objId}/{dataId}/{listId}?id={dataId}&openSource=field&openSourceId={dataId}&openSourceAppId={appId}
602
+ */
603
+ export function buildListLocateUrl(baseUrl, appId, listId, objId, dataId) {
604
+ if (!baseUrl || !listId || !objId || !dataId)
605
+ return null;
606
+ const base = String(baseUrl).replace(/\/+$/, '');
607
+ return `${base}/sp/ebdfpage/list/${listId}/card/0/${objId}/${dataId}/${listId}?id=${dataId}&openSource=field&openSourceId=${dataId}&openSourceAppId=${appId}`;
608
+ }
@@ -1,10 +1,11 @@
1
+ import { CONTINUATION_TTL_MS } from '../../core/continuation-ttl.js';
1
2
  import { createHash, createHmac, randomBytes, randomUUID, timingSafeEqual } from 'node:crypto';
2
3
  import { existsSync } from 'node:fs';
3
4
  import { chmod, mkdir, readFile, readdir, unlink, writeFile } from 'node:fs/promises';
4
5
  import { homedir, hostname } from 'node:os';
5
6
  import { resolve } from 'node:path';
6
7
  import { workflowAlreadyAppliedError, workflowPartialError, workflowValidationError, } from './errors.js';
7
- const DEFAULT_TTL_MS = 10 * 60_000;
8
+ const DEFAULT_TTL_MS = CONTINUATION_TTL_MS;
8
9
  /**
9
10
  * 「上一次只抢到句柄、还没发出写入」的**安全重占宽限期**。
10
11
  *
@@ -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 { createWorkflowContinuationSigner } from './continuation.js';
4
5
  import { createWorkflowHost } from './host.js';
5
6
  import { workflowManifest } from './manifest.js';
@@ -113,6 +114,7 @@ async function executeAndPrint(ctx, operation, input) {
113
114
  printWorkflowResult(ctx, operation, result);
114
115
  }
115
116
  catch (error) {
117
+ reportPlatformError(error);
116
118
  console.error(JSON.stringify(failureEnvelope(error), null, 2));
117
119
  process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
118
120
  }