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,22 +2,25 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  createRecruitContextLoader
5
- } from "./chunk-LDZQPUIA.js";
5
+ } from "./chunk-T4MWQAQB.js";
6
+ import {
7
+ CONTINUATION_TTL_MS
8
+ } from "./chunk-7BDPM5ST.js";
6
9
  import {
7
10
  E10ApiError,
8
11
  createE10RequestRuntime,
9
12
  isE10SessionExpiredResponse,
10
13
  requireE10Session
11
- } from "./chunk-SA6VBIHY.js";
14
+ } from "./chunk-6NXT4ICB.js";
12
15
  import {
13
16
  E10_SESSION_EXPIRED_MESSAGE,
14
17
  getActiveProfile
15
- } from "./chunk-FOAA27U5.js";
18
+ } from "./chunk-U6R6FZHD.js";
16
19
  import {
17
20
  CliError,
18
21
  isCliError,
19
22
  toErrorEnvelope
20
- } from "./chunk-LUSPKZKY.js";
23
+ } from "./chunk-UG5G54VL.js";
21
24
  import "./chunk-BUSC6UAE.js";
22
25
 
23
26
  // src/shortcuts/recruit-stage/index.ts
@@ -111,7 +114,7 @@ function signature(payload, key) {
111
114
  }
112
115
  function createRecruitStageContinuationSigner(ctx) {
113
116
  return {
114
- async issue(payload, ttlMs = 10 * 6e4) {
117
+ async issue(payload, ttlMs = CONTINUATION_TTL_MS) {
115
118
  const issuedAt = Date.now();
116
119
  const body = encode({ ...payload, issuedAt, expiresAt: issuedAt + ttlMs });
117
120
  const sig = signature(body, await loadKey(ctx));
@@ -272,6 +275,9 @@ function schemaOf(properties, options = {}) {
272
275
 
273
276
  // src/shortcuts/recruit-stage/shared.ts
274
277
  import { randomUUID } from "node:crypto";
278
+ import { unlinkSync } from "node:fs";
279
+ import { homedir as homedir2 } from "node:os";
280
+ import { join, resolve as resolvePath } from "node:path";
275
281
  function randHex32() {
276
282
  return randomUUID().replace(/-/g, "");
277
283
  }
@@ -344,6 +350,32 @@ async function getFormButtons(host, objId, layoutId) {
344
350
  }
345
351
  return actions;
346
352
  }
353
+ async function probeCreatePermission(host, objId) {
354
+ try {
355
+ const r = await host.request({
356
+ path: "/api/ebuilder/form/data/getFormButtons",
357
+ body: {
358
+ layoutType: "formLayout",
359
+ objId,
360
+ dataId: "",
361
+ formDataId: "",
362
+ type: "1",
363
+ fromRecycle: false,
364
+ otherOperator: "",
365
+ objectAppId: "",
366
+ browser: "Chrome",
367
+ isTamper: "0"
368
+ }
369
+ });
370
+ const d = r?.data;
371
+ const btns = Array.isArray(d) ? d : d?.buttons || [];
372
+ if (!Array.isArray(btns) || !btns.length) return "unknown";
373
+ const hasSave = btns.some((b) => String(b?.buttonKey || "").toLowerCase().includes("save") || String(b?.name || "").includes("\u4FDD\u5B58"));
374
+ return hasSave ? "ok" : "denied";
375
+ } catch {
376
+ return "unknown";
377
+ }
378
+ }
347
379
  function pickSaveButtonActions(actions, { includeDisabled = false } = {}) {
348
380
  const all = actions || [];
349
381
  let own = all.filter((a) => a._buttonKey === "save");
@@ -530,23 +562,114 @@ async function resolvePersonId(host, fieldId, keyword) {
530
562
  const list = r?.data?.data || r?.data || [];
531
563
  return list[0]?.id || list[0]?.value || null;
532
564
  }
533
- async function getDsOptions(host, objId, fieldId, groupId) {
534
- const r = await host.request({
535
- path: "/api/ebuilder/common/ds/options?fieldName=" + fieldId + "&objId=" + objId + "&sourceType=FORM&groupId=" + groupId,
536
- method: "GET"
537
- });
538
- const list = r?.data || [];
539
- const map = {};
540
- for (const x of list) map[x.name] = x.id;
541
- return map;
565
+ var dsOptionsMemo = /* @__PURE__ */ new Map();
566
+ function restoreDsOptions(snapshot) {
567
+ for (const [key, value] of Object.entries(snapshot || {})) {
568
+ if (value && typeof value === "object" && Object.keys(value).length) {
569
+ dsOptionsMemo.set(key, Promise.resolve(value));
570
+ }
571
+ }
542
572
  }
543
- function cachedDsMap(cache, objId, fieldKey) {
544
- const fidv = (cache.fields[objId] || {})[fieldKey];
545
- const opts = fidv && cache.field_options?.[objId] && cache.field_options[objId][fidv];
546
- if (!opts || !Object.keys(opts).length) return null;
547
- const map = {};
548
- for (const [id, name] of Object.entries(opts)) map[name] = id;
549
- return map;
573
+ async function dsOptionsSnapshot() {
574
+ const out = {};
575
+ await Promise.all([...dsOptionsMemo.entries()].map(async ([key, task]) => {
576
+ try {
577
+ const value = await task;
578
+ if (value && Object.keys(value).length) out[key] = value;
579
+ } catch {
580
+ }
581
+ }));
582
+ return out;
583
+ }
584
+ function expectedFields(details, fields, keys, nonEmptyOnly = [], optionalKeys = []) {
585
+ const out = [];
586
+ for (const k of keys) {
587
+ const fid = fields[k];
588
+ if (!fid) continue;
589
+ const d = (details || []).find((x) => String(x?.formField?.id) === String(fid));
590
+ if (!d) continue;
591
+ const value = String((d.dataOptions || [])[0]?.optionId ?? d.content ?? d.dataText?.content ?? d.value ?? "");
592
+ const optional = optionalKeys.includes(k);
593
+ if (nonEmptyOnly.includes(k)) out.push({ fieldId: String(fid), label: k, expected: "*", optional });
594
+ else if (value) out.push({ fieldId: String(fid), label: k, expected: value, optional });
595
+ }
596
+ return out;
597
+ }
598
+ async function verifySubmitted(opts) {
599
+ const { host, formId, objId, dataId, expected } = opts;
600
+ if (!expected.length) return { checked: 0, mismatches: [] };
601
+ let details = [];
602
+ try {
603
+ const r = await host.request({
604
+ path: "/api/ebuilder/form/form/core/getFormDataAndLayout?formId=" + encodeURIComponent(formId) + "&dataId=" + encodeURIComponent(dataId),
605
+ method: "POST",
606
+ body: {
607
+ terminalType: "PC",
608
+ dataId,
609
+ formId,
610
+ module: "ebuilderform",
611
+ newLayout: true,
612
+ cacheUid: "",
613
+ layoutMultiId: "",
614
+ dataCrossLayout: false,
615
+ permissionId: "",
616
+ allReadOnly: false,
617
+ initialDatas: [],
618
+ dynamicData: false,
619
+ cost: false,
620
+ customParam: { objId }
621
+ }
622
+ });
623
+ details = r?.data?.formData?.dataDetails || [];
624
+ } catch (e) {
625
+ return { checked: 0, mismatches: [], unavailable: e?.message || "\u56DE\u67E5\u63A5\u53E3\u4E0D\u53EF\u7528" };
626
+ }
627
+ const byId = /* @__PURE__ */ new Map();
628
+ for (const d of details) {
629
+ const fid = String(d?.fieldId || d?.formField?.id || "");
630
+ if (fid) byId.set(fid, d);
631
+ }
632
+ const mismatches = [];
633
+ for (const e of expected) {
634
+ const d = byId.get(e.fieldId);
635
+ if (!d && e.optional) continue;
636
+ const actual = d ? String((d.dataOptions || [])[0]?.optionId ?? d.content ?? d.dataText?.content ?? d.value ?? "") : "";
637
+ const bad = e.expected === "*" ? !actual : actual !== e.expected;
638
+ if (bad) mismatches.push({ label: e.label, expected: e.expected === "*" ? "\uFF08\u975E\u7A7A\uFF09" : e.expected, actual: actual || "\uFF08\u7A7A\uFF09" });
639
+ }
640
+ return { checked: expected.length, mismatches };
641
+ }
642
+ function invalidateEnvCache(baseUrl, appId) {
643
+ dsOptionsMemo.clear();
644
+ if (!baseUrl || !appId) return;
645
+ try {
646
+ const host = baseUrl.replace(/^https?:\/\//, "").replace(/\/+$/, "").replace(/:/g, "_");
647
+ const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolvePath(homedir2(), ".weaver-work-cli");
648
+ const root = process.env.E10_SKILL_CACHE_DIR || join(home, "env-cache", "recruit-ops");
649
+ unlinkSync(join(root, host, appId + ".json"));
650
+ } catch {
651
+ }
652
+ }
653
+ async function getDsOptions(host, objId, fieldId, groupId = "") {
654
+ const key = objId + ":" + fieldId;
655
+ const hit = dsOptionsMemo.get(key);
656
+ if (hit) return hit;
657
+ const task = (async () => {
658
+ const r = await host.request({
659
+ path: "/api/ebuilder/common/ds/options?fieldName=" + fieldId + "&objId=" + objId + "&sourceType=FORM" + (groupId ? "&groupId=" + groupId : ""),
660
+ method: "GET"
661
+ });
662
+ const list = r?.data || [];
663
+ const map = {};
664
+ for (const x of list) if (x?.name && x?.id) map[String(x.name)] = String(x.id);
665
+ if (!Object.keys(map).length) dsOptionsMemo.delete(key);
666
+ return map;
667
+ })();
668
+ dsOptionsMemo.set(key, task);
669
+ task.catch(() => {
670
+ dsOptionsMemo.delete(key);
671
+ });
672
+ return task;
550
673
  }
551
674
  async function getFormButtonsForData(host, objId, formId, dataId, layoutId) {
552
675
  const body = {
@@ -747,10 +870,9 @@ function buildCardUrl(baseUrl, objId, dataId) {
747
870
  if (!baseUrl || !objId || !dataId) return null;
748
871
  return String(baseUrl).replace(/\/+$/, "") + "/sp/ebdfpage/card/0/" + objId + "/" + dataId;
749
872
  }
750
- function buildListLocateUrl(baseUrl, appId, listId, objId, dataId) {
751
- if (!baseUrl || !listId || !objId || !dataId) return null;
752
- const base = String(baseUrl).replace(/\/+$/, "");
753
- return `${base}/sp/ebdfpage/list/${listId}/card/0/${objId}/${dataId}/${listId}?id=${dataId}&openSource=field&openSourceId=${dataId}&openSourceAppId=${appId}`;
873
+ function buildListUrl(baseUrl, listId) {
874
+ if (!baseUrl || !listId) return null;
875
+ return String(baseUrl).replace(/\/+$/, "") + "/sp/ebdfpage/list/" + listId;
754
876
  }
755
877
 
756
878
  // src/shortcuts/recruit-stage/operations/jd-create.ts
@@ -765,11 +887,11 @@ var DEF_FROM_REF = [
765
887
  "job_category",
766
888
  "education",
767
889
  "work_years",
768
- "work_location",
769
890
  "salary_min",
770
891
  "salary_max"
771
892
  ];
772
893
  var DEF_STATUS = "\u62DB\u8058\u4E2D";
894
+ var DEFAULT_WORK_LOCATION = "\u6D66\u6C5F\u9547\u4E09\u9C81\u516C\u8DEF3419\u53F7\u6CDB\u5FAE\u8F6F\u4EF6\u56ED";
773
895
  var NUM_KEYS = /* @__PURE__ */ new Set(["recruit_count", "number_of_pay_months", "salary_min", "salary_max", "internship_duration", "working_days"]);
774
896
  var PERSON_KEYS = /* @__PURE__ */ new Set(["recr_principal", "recr_helper", "employ_manager", "interviewer"]);
775
897
  var OPTION_KEYS = /* @__PURE__ */ new Set(["salary_type", "recruit_type", "status"]);
@@ -842,46 +964,143 @@ function refToSubmit(d) {
842
964
  else return null;
843
965
  return o;
844
966
  }
845
- async function resolveWorkLocation(ctx, value) {
967
+ var WORK_PLACE_NAMES = ["\u529E\u516C\u5730\u70B9", "\u5DE5\u4F5C\u5730\u70B9"];
968
+ async function findWorkPlaceMenu(ctx) {
846
969
  const { host, appId, cache } = ctx;
847
- const t = await host.request({ path: `/api/ebuilder/form/obj/getObjsByTag?appId=${appId}&tag=uf_rcrt_work_place`, method: "GET" });
848
- const d = t?.data;
849
- const pObj = Array.isArray(d) && d[0] ? String(d[0].id || "") : "";
850
- const menu = findMenuNode(cache.menus || [], ["\u529E\u516C\u5730\u70B9", "\u5DE5\u4F5C\u5730\u70B9"], (m) => m.listId && m.cusMenuId);
851
- if (!pObj || !menu) return null;
852
- const body = {
853
- current: 1,
854
- pageSize: 200,
855
- tableuid: randHex32(),
856
- listId: menu.listId,
857
- searchParamData: { searchType: "3", type: "and" },
858
- terminal: "PC",
859
- browser: "Chrome",
860
- requiredMatch: 1,
861
- mapResult: 1,
862
- recheckQuery: 1,
863
- isFollow: 0,
864
- isShareToMe: 0,
865
- filterCondition: {},
866
- cusMenuId: menu.cusMenuId,
867
- urlPageTitle: menu.menuName,
868
- menuName: menu.menuName
869
- };
870
- const r = await host.request({ path: `/api/ebuilder/form/list/getListDatas?passid=${pObj}&cid=${pObj}`, body, headers: { ebBusinessId: menu.listId } });
871
- const rows = r?.data?.data || [];
970
+ const ok = (m) => m && m.listId;
971
+ const allSearch = (cache.lists || {}).all_search || [];
972
+ const hit1 = allSearch.find((m) => ok(m) && WORK_PLACE_NAMES.some((n) => String(m.menuName || "").includes(n)));
973
+ if (hit1) return { listId: String(hit1.listId), cusMenuId: String(hit1.cusMenuId || ""), menuName: String(hit1.menuName || "") };
974
+ const hit2 = findMenuNode(cache.menus || [], WORK_PLACE_NAMES, (m) => ok(m));
975
+ if (hit2) return { listId: String(hit2.listId), cusMenuId: String(hit2.cusMenuId || ""), menuName: String(hit2.menuName || "") };
976
+ try {
977
+ const r = await host.request({ path: `/api/cusapp/app/allMenus?isFront=1&appId=${appId}&terminalType=PC`, method: "GET" });
978
+ const flat = [];
979
+ (function walk(ns) {
980
+ for (const n of ns || []) if (n && typeof n === "object") {
981
+ flat.push(n);
982
+ walk(n.children || n.childs);
983
+ }
984
+ })(r?.data?.cusAppMenus || r?.data);
985
+ const hit3 = findMenuNode(flat, WORK_PLACE_NAMES, (m) => ok(m));
986
+ if (hit3) return { listId: String(hit3.listId), cusMenuId: String(hit3.cusMenuId || ""), menuName: String(hit3.menuName || "") };
987
+ } catch {
988
+ }
989
+ return null;
990
+ }
991
+ var workPlaceMemo = /* @__PURE__ */ new Map();
992
+ function stripHtml(s) {
993
+ return String(s ?? "").replace(/<[^>]*>/g, "").trim();
994
+ }
995
+ function parseSpans(raw) {
996
+ try {
997
+ const v = Array.isArray(raw) ? raw : JSON.parse(String(raw || "[]"));
998
+ return Array.isArray(v) ? v : [];
999
+ } catch {
1000
+ return [];
1001
+ }
1002
+ }
1003
+ function isEnabledText(s) {
1004
+ const t = stripHtml(s);
1005
+ return t.includes("\u542F\u7528") && !t.includes("\u7981\u7528");
1006
+ }
1007
+ async function loadWorkPlaces(ctx) {
1008
+ const { host, appId } = ctx;
1009
+ const menu = await findWorkPlaceMenu(ctx);
1010
+ if (!menu) return { rows: [], statusFiltered: false };
1011
+ const key = appId + "|" + menu.listId;
1012
+ const cached = workPlaceMemo.get(key);
1013
+ if (cached) return cached;
1014
+ const [tagObjId] = await Promise.all([
1015
+ host.request({ path: `/api/ebuilder/form/obj/getObjsByTag?appId=${appId}&tag=uf_rcrt_work_place`, method: "GET" }).then((t) => Array.isArray(t?.data) && t.data[0] ? String(t.data[0].id || "") : "").catch(() => "")
1016
+ ]);
1017
+ const pObj = tagObjId || String(menu.objId || "");
1018
+ if (!pObj) return { rows: [], statusFiltered: false };
1019
+ const pageSize = 200;
1020
+ const rawRows = [];
1021
+ const dispRows = [];
1022
+ for (let page = 1; page <= 5; page++) {
1023
+ const body = {
1024
+ current: page,
1025
+ pageSize,
1026
+ tableuid: randHex32(),
1027
+ listId: menu.listId,
1028
+ searchParamData: { searchType: "3", type: "and" },
1029
+ terminal: "PC",
1030
+ browser: "Chrome",
1031
+ requiredMatch: 1,
1032
+ mapResult: 1,
1033
+ recheckQuery: 1,
1034
+ isFollow: 0,
1035
+ isShareToMe: 0,
1036
+ filterCondition: {},
1037
+ cusMenuId: menu.cusMenuId,
1038
+ urlPageTitle: menu.menuName,
1039
+ menuName: menu.menuName
1040
+ };
1041
+ const r = await host.request({
1042
+ path: `/api/ebuilder/form/list/getListDatas?passid=${pObj}&cid=${pObj}`,
1043
+ body,
1044
+ headers: { ebBusinessId: menu.listId }
1045
+ });
1046
+ const batch = r?.data?.data || r?.data?.displayData || [];
1047
+ rawRows.push(...batch);
1048
+ dispRows.push(...r?.data?.displayData || []);
1049
+ if (batch.length < pageSize) break;
1050
+ }
1051
+ const enabledStatusIds = /* @__PURE__ */ new Set();
1052
+ const enabledRowIds = /* @__PURE__ */ new Set();
1053
+ for (const d of dispRows) {
1054
+ const rid = String(d?.form_data_id || d?.id || "");
1055
+ if (isEnabledText(d?.place_status) && rid) enabledRowIds.add(rid);
1056
+ for (const s of parseSpans(d?.place_statusSpan)) {
1057
+ if (isEnabledText(s?.name) && s?.id) enabledStatusIds.add(String(s.id));
1058
+ }
1059
+ }
1060
+ const statusFiltered = enabledRowIds.size > 0 || enabledStatusIds.size > 0;
1061
+ const rows = rawRows.filter((x) => !statusFiltered || enabledRowIds.has(String(x?.form_data_id || x?.id || "")) || enabledStatusIds.has(String(x?.place_status || ""))).map((x) => ({
1062
+ id: String(x?.form_data_id || x?.id || ""),
1063
+ name: String(x?.name || ""),
1064
+ detail: String(x?.detail_location || ""),
1065
+ area: String(x?.area_text || ""),
1066
+ city: String(x?.city || "")
1067
+ })).filter((x) => !!x.id);
1068
+ const out = { rows, statusFiltered };
1069
+ workPlaceMemo.set(key, out);
1070
+ return out;
1071
+ }
1072
+ function matchWorkPlace(rows, value) {
872
1073
  const v = String(value).trim();
873
- const hit = rows.find((x) => {
874
- const name = String(x.name || ""), detail = String(x.detail_location || ""), area = String(x.area_text || "");
875
- return name.includes(v) || detail.includes(v) || area.includes(v) || detail && v.includes(detail);
876
- });
877
- return hit ? { id: String(hit.form_data_id || hit.id), name: String(hit.detail_location || hit.name || v) } : null;
1074
+ if (!v || !rows.length) return null;
1075
+ const exact = rows.find((r) => r.detail === v) || rows.find((r) => r.name === v);
1076
+ if (exact) return exact;
1077
+ const valid = (s) => s.length >= 4 && !/^\d+$/.test(s);
1078
+ return rows.find((r) => r.detail.includes(v) && valid(r.detail) || r.name.includes(v) && valid(r.name) || r.area.includes(v) && valid(r.area) || v.includes(r.detail) && valid(r.detail)) || null;
1079
+ }
1080
+ async function resolveWorkLocation(ctx, value) {
1081
+ if (!String(value).trim()) return null;
1082
+ const { rows } = await loadWorkPlaces(ctx);
1083
+ const hit = matchWorkPlace(rows, value);
1084
+ return hit ? { id: hit.id, name: hit.detail || hit.name || String(value) } : null;
1085
+ }
1086
+ async function resolveDefaultWorkLocation(ctx) {
1087
+ return resolveWorkLocation(ctx, DEFAULT_WORK_LOCATION);
878
1088
  }
879
1089
  async function resolveSetValue(ctx, key, value, refByFid) {
880
1090
  const { host, appId, cache } = ctx;
881
1091
  const objId = objIdOf(cache, "position_manage");
882
1092
  const id = (cache.fields[objId] || {})[key];
883
1093
  if (!id) return null;
884
- if (NUM_KEYS.has(key)) return { formField: { id }, content: String(value) };
1094
+ if (NUM_KEYS.has(key)) {
1095
+ if (key === "salary_min" || key === "salary_max") {
1096
+ const n = Number(String(value).replace(/,/g, ""));
1097
+ if (Number.isFinite(n) && n > 0) {
1098
+ const k = n / 1e3;
1099
+ return { formField: { id }, content: String(Number.isInteger(k) ? k : Number(k.toFixed(3))) };
1100
+ }
1101
+ }
1102
+ return { formField: { id }, content: String(value) };
1103
+ }
885
1104
  if (MTEXT_KEYS.has(key)) return { formField: { id }, dataText: { content: String(value) } };
886
1105
  if (key === "position_name") return { formField: { id }, content: String(value) };
887
1106
  if (PERSON_KEYS.has(key)) {
@@ -889,7 +1108,7 @@ async function resolveSetValue(ctx, key, value, refByFid) {
889
1108
  return uid ? { formField: { id }, dataOptions: [{ optionId: String(uid), content: value }] } : null;
890
1109
  }
891
1110
  if (OPTION_KEYS.has(key)) {
892
- const m = cachedDsMap(cache, objId, key) || await getDsOptions(host, objId, id, appId);
1111
+ const m = await getDsOptions(host, objId, id);
893
1112
  const oid = m[value];
894
1113
  return oid ? { formField: { id }, dataOptions: [{ optionId: String(oid), content: value }] } : null;
895
1114
  }
@@ -1042,6 +1261,7 @@ async function buildJd(opts) {
1042
1261
  const fid = (k) => fields[k];
1043
1262
  for (const k of DATAKEYS_TEXT) if (!fid(k)) throw rsFail("\u804C\u4F4D\u7BA1\u7406\u7F3A\u5C11\u5B57\u6BB5 " + k + "\uFF08ds/fields \u89E3\u6790\u4E0D\u5230\uFF09");
1044
1263
  for (const k of DATAKEYS_MTEXT) if (!fid(k)) throw rsFail("\u804C\u4F4D\u7BA1\u7406\u7F3A\u5C11\u5B57\u6BB5 " + k + "\uFF08ds/fields \u89E3\u6790\u4E0D\u5230\uFF09");
1264
+ const currentUserPromise = resolveCurrentUser(host).catch(() => null);
1045
1265
  const refByFid = await fetchRefByFid(ctx);
1046
1266
  const map = /* @__PURE__ */ new Map();
1047
1267
  const put = (d) => {
@@ -1060,8 +1280,10 @@ async function buildJd(opts) {
1060
1280
  }
1061
1281
  const appliedSets = [];
1062
1282
  const skippedSets = [];
1063
- for (const [k, v] of sets) {
1064
- const d = await resolveSetValue(ctx, k, v, refByFid);
1283
+ const resolvedSets = await Promise.all(
1284
+ sets.map(async ([k, v]) => ({ k, v, d: await resolveSetValue(ctx, k, v, refByFid).catch(() => null) }))
1285
+ );
1286
+ for (const { k, v, d } of resolvedSets) {
1065
1287
  if (d) {
1066
1288
  put(d);
1067
1289
  appliedSets.push(k + "=" + v);
@@ -1071,7 +1293,7 @@ async function buildJd(opts) {
1071
1293
  }
1072
1294
  if (!hasKey("status")) {
1073
1295
  if (!fid("status")) throw rsFail("\u804C\u4F4D\u7BA1\u7406\u7F3A\u5C11\u5B57\u6BB5 status\uFF08ds/fields \u89E3\u6790\u4E0D\u5230\uFF09");
1074
- const statusMap = cachedDsMap(cache, objId, "status") || await getDsOptions(host, objId, fid("status"), appId);
1296
+ const statusMap = await getDsOptions(host, objId, fid("status"));
1075
1297
  const statusId = statusMap[DEF_STATUS];
1076
1298
  if (!statusId) throw rsFail("\u804C\u4F4D\u7BA1\u7406\u300C\u62DB\u8058\u72B6\u6001\u300D\u672A\u89E3\u6790\u5230\u300C" + DEF_STATUS + "\u300D\u9009\u9879\uFF08ds/options \u8FD4\u56DE\u4E3A\u7A7A\uFF09");
1077
1299
  put({ formField: { id: fid("status") }, dataOptions: [{ optionId: String(statusId), content: DEF_STATUS }] });
@@ -1083,7 +1305,7 @@ async function buildJd(opts) {
1083
1305
  const filled = [];
1084
1306
  let currentUser = null;
1085
1307
  if (DEF_CURRENT_USER.some((k) => fid(k) && !hasKey(k))) {
1086
- currentUser = await resolveCurrentUser(host);
1308
+ currentUser = await currentUserPromise;
1087
1309
  if (currentUser && currentUser.id) {
1088
1310
  for (const k of DEF_CURRENT_USER) {
1089
1311
  if (fid(k) && !hasKey(k)) {
@@ -1101,7 +1323,7 @@ async function buildJd(opts) {
1101
1323
  }
1102
1324
  for (const [k, name] of Object.entries(DEF_OPTION)) {
1103
1325
  if (fid(k) && !hasKey(k)) {
1104
- const m = cachedDsMap(cache, objId, k) || await getDsOptions(host, objId, fid(k), appId);
1326
+ const m = await getDsOptions(host, objId, fid(k));
1105
1327
  const oid = m[name];
1106
1328
  if (oid) {
1107
1329
  put({ formField: { id: fid(k) }, dataOptions: [{ optionId: String(oid), content: name }] });
@@ -1109,6 +1331,7 @@ async function buildJd(opts) {
1109
1331
  }
1110
1332
  }
1111
1333
  }
1334
+ const inheritedFromRef = [];
1112
1335
  for (const k of DEF_FROM_REF) {
1113
1336
  const id = fid(k);
1114
1337
  if (id && !map.has(String(id)) && refByFid[String(id)]) {
@@ -1116,9 +1339,31 @@ async function buildJd(opts) {
1116
1339
  if (d) {
1117
1340
  put(d);
1118
1341
  filled.push(k);
1342
+ inheritedFromRef.push({ field: k, value: detailValueId(refByFid[String(id)]) });
1119
1343
  }
1120
1344
  }
1121
1345
  }
1346
+ const inheritedSalaryWarnings = [];
1347
+ for (const key of ["salary_min", "salary_max"]) {
1348
+ const hit = inheritedFromRef.find((x) => x.field === key);
1349
+ if (!hit) continue;
1350
+ const num = Number(String(hit.value).replace(/[^\d.]/g, ""));
1351
+ if (hit.value && Number.isFinite(num) && (num < 1 || num > 100)) {
1352
+ inheritedSalaryWarnings.push(key + " \u7EE7\u627F\u503C\u300C" + hit.value + "\u300D\uFF08\u5343\u5143\uFF09\u660E\u663E\u5F02\u5E38\uFF0C\u8BF7\u4EBA\u5DE5\u6838\u5BF9\u540E\u518D\u63D0\u4EA4");
1353
+ }
1354
+ }
1355
+ let workLocationDefault = null;
1356
+ let workLocationWarning = null;
1357
+ if (!hasKey("work_location") && fid("work_location")) {
1358
+ const loc = await resolveDefaultWorkLocation(ctx).catch(() => null);
1359
+ if (loc) {
1360
+ put({ formField: { id: fid("work_location") }, dataOptions: [{ optionId: loc.id, content: loc.name }] });
1361
+ filled.push("work_location");
1362
+ workLocationDefault = loc.name;
1363
+ } else {
1364
+ workLocationWarning = `\u672A\u5728\u300C\u529E\u516C\u5730\u70B9\u300D\u5217\u8868\u627E\u5230\u542F\u7528\u72B6\u6001\u7684\u9ED8\u8BA4\u5730\u70B9\u300C${DEFAULT_WORK_LOCATION}\u300D\uFF0C\u672C\u6B21\u4E0D\u5199 work_location\uFF1B\u8BF7\u7528 sets \u6307\u5B9A`;
1365
+ }
1366
+ }
1122
1367
  const inv = {};
1123
1368
  for (const [k, v] of Object.entries(fields)) inv[String(v)] = k;
1124
1369
  const requiredDefaultsFilled = [...map.keys()].map((f) => inv[f] || f).filter((k) => filled.includes(k));
@@ -1134,10 +1379,18 @@ async function buildJd(opts) {
1134
1379
  requestLen: (requestText || "").length,
1135
1380
  demand: demandId ? demandName || demandId : "\uFF08\u672A\u5173\u8054\u9700\u6C42\uFF09",
1136
1381
  status: DEF_STATUS,
1137
- recruitFlow: defFlow && defFlow.id ? defFlow.name : "\uFF08\u672A\u89E3\u6790\u5230\u9ED8\u8BA4\u6D41\u7A0B\uFF09",
1382
+ // 解析不到环境默认流程时不写该字段,表单自身默认值生效;文案按实际行为表述,避免误导。
1383
+ recruitFlow: defFlow && defFlow.id ? defFlow.name : "\uFF08\u6CBF\u7528\u8868\u5355\u9ED8\u8BA4\u503C\uFF09",
1138
1384
  currentUser: currentUser ? currentUser.name : null,
1139
1385
  setApplied: appliedSets,
1140
1386
  setSkipped: skippedSets,
1387
+ // 明示哪些字段值继承自「环境内最近一条职位记录」——这些不是用户指定的,可能来自脏数据,
1388
+ // 必须在确认摘要里人工核对(工作地点不参与继承,见 workLocationDefault)
1389
+ inheritedFromRef: inheritedFromRef.length ? inheritedFromRef : void 0,
1390
+ inheritedSalaryWarnings: inheritedSalaryWarnings.length ? inheritedSalaryWarnings : void 0,
1391
+ inheritedNote: inheritedFromRef.length ? "\u4EE5\u4E0A\u5B57\u6BB5\u672A\u6307\u5B9A\uFF0C\u503C\u7EE7\u627F\u81EA\u73AF\u5883\u5185\u6700\u8FD1\u4E00\u6761\u804C\u4F4D\u8BB0\u5F55\uFF0C\u53EF\u80FD\u542B\u5386\u53F2\u810F\u6570\u636E\uFF0C\u8BF7\u6838\u5BF9\u540E\u518D\u63D0\u4EA4\uFF08\u5DE5\u4F5C\u5730\u70B9\u4E0D\u53C2\u4E0E\u7EE7\u627F\uFF09" : void 0,
1392
+ workLocationDefault: workLocationDefault || void 0,
1393
+ workLocationWarning: workLocationWarning || void 0,
1141
1394
  requiredDefaultsFilled
1142
1395
  }
1143
1396
  };
@@ -1164,6 +1417,8 @@ async function prepare(args, env) {
1164
1417
  const session = await host.getSession();
1165
1418
  const ctx = { host, baseUrl: session.baseUrl.replace(/\/+$/, ""), appId: "", cache: await env.recruitContext() };
1166
1419
  ctx.appId = ctx.cache.appId;
1420
+ const perm = await probeCreatePermission(ctx.host, objIdOf(ctx.cache, "position_manage"));
1421
+ if (perm === "denied") throw rsFail("\u5F53\u524D\u8D26\u53F7\u6CA1\u6709\u300C\u804C\u4F4D\u7BA1\u7406\u300D\u8868\u5355\u7684\u521B\u5EFA\u6743\u9650\uFF0C\u5DF2\u963B\u65AD\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09");
1167
1422
  const positionName = String(args.positionName || "").trim();
1168
1423
  if (!positionName) throw rsValidationError("position_name_required", "positionName \u5FC5\u586B");
1169
1424
  const jd = await buildJd({
@@ -1175,16 +1430,36 @@ async function prepare(args, env) {
1175
1430
  demandName: args.demandName ? String(args.demandName) : void 0,
1176
1431
  sets: setsOf(args)
1177
1432
  });
1178
- const refs = await fetchRecentReferences(ctx, jd, String(args.referenceKeyword || positionName)).catch((e) => ({ available: false, reason: e.message, items: [] }));
1433
+ const refs = args.referenceKeyword ? await fetchRecentReferences(ctx, jd, String(args.referenceKeyword)).catch((e) => ({ available: false, reason: e.message, items: [] })) : {
1434
+ available: false,
1435
+ skipped: true,
1436
+ reason: "\u672A\u663E\u5F0F\u6307\u5B9A referenceKeyword\uFF0C\u5DF2\u8DF3\u8FC7\u540C\u7C7B\u804C\u4F4D\u53C2\u8003\u68C0\u7D22\uFF08\u6539\u7528 references/position-templates.md \u7684\u5C97\u4F4D\u6A21\u677F\uFF09",
1437
+ items: []
1438
+ };
1179
1439
  const willSubmit = { formId: jd.formId, objId: jd.objId, dataDetails: jd.dataDetails };
1180
1440
  const fp = fingerprint(willSubmit);
1181
- const continuation = await env.continuation.issue({ operation: "recruit-stage.jd.create.apply", fingerprint: fp });
1441
+ const continuation = await env.continuation.issue({
1442
+ operation: "recruit-stage.jd.create.apply",
1443
+ fingerprint: fp,
1444
+ enumMaps: await dsOptionsSnapshot()
1445
+ });
1446
+ const invFieldKeys = {};
1447
+ for (const [k, v] of Object.entries(ctx.cache.fields[jd.objId] || {})) invFieldKeys[String(v)] = k;
1182
1448
  return rsSuccess("recruit-stage.jd.create.prepare", {
1183
1449
  mode: "prepare",
1450
+ continuation,
1451
+ fingerprint: fp,
1184
1452
  ...jd.summary,
1185
1453
  recentReferences: refs.items,
1186
- recentReferencesNote: refs.available ? `\u5DF2\u6309\u300C${refs.keyword}\u300D\u5728\u5F53\u524D\u73AF\u5883\u804C\u4F4D\u5217\u8868\u4E2D\u68C0\u7D22\uFF08\u626B\u63CF ${refs.scanned} \u6761\uFF0C\u547D\u4E2D ${refs.items.length} \u6761\uFF09\u2014\u2014\u8BF7\u5BF9\u6807\u8FD9\u4E9B\u540C\u7C7B\u804C\u4F4D\u7684\u85AA\u916C/\u4EBA\u6570/\u8981\u6C42\u7ED9\u51FA\u63A8\u8350\u503C\uFF0C\u4E00\u5E76\u653E\u8FDB\u786E\u8BA4\u6458\u8981\uFF0C\u4E0D\u8981\u9010\u5B57\u6BB5\u8BE2\u95EE\u7528\u6237` : "\u53C2\u8003\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A" + (refs.reason || ""),
1187
- willSubmit
1454
+ recentReferencesNote: refs.skipped ? refs.reason : refs.available ? `\u5DF2\u6309\u300C${refs.keyword}\u300D\u5728\u5F53\u524D\u73AF\u5883\u804C\u4F4D\u5217\u8868\u4E2D\u68C0\u7D22\uFF08\u626B\u63CF ${refs.scanned} \u6761\uFF0C\u547D\u4E2D ${refs.items.length} \u6761\uFF09\u2014\u2014\u8BF7\u5BF9\u6807\u8FD9\u4E9B\u540C\u7C7B\u804C\u4F4D\u7684\u85AA\u916C/\u4EBA\u6570/\u8981\u6C42\u7ED9\u51FA\u63A8\u8350\u503C\uFF0C\u4E00\u5E76\u653E\u8FDB\u786E\u8BA4\u6458\u8981\uFF0C\u4E0D\u8981\u9010\u5B57\u6BB5\u8BE2\u95EE\u7528\u6237` : "\u53C2\u8003\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A" + (refs.reason || ""),
1455
+ willSubmit: {
1456
+ formId: willSubmit.formId,
1457
+ objId: willSubmit.objId,
1458
+ fieldCount: willSubmit.dataDetails.length,
1459
+ fields: willSubmit.dataDetails.map(
1460
+ (d) => invFieldKeys[String(d.formField && d.formField.id)] || String(d.formField && d.formField.id)
1461
+ )
1462
+ }
1188
1463
  }, {
1189
1464
  continuation,
1190
1465
  fingerprint: fp,
@@ -1195,6 +1470,7 @@ async function apply(args, env) {
1195
1470
  if (args.confirm !== true) throw rsConfirmationError("recruit-stage.jd.create.apply", { hint: "\u5199\u64CD\u4F5C\u5FC5\u987B\u663E\u5F0F confirm:true" });
1196
1471
  if (!args.continuation) throw rsValidationError("continuation_required", "\u7F3A\u5C11 continuation\uFF08\u6765\u81EA prepare \u7684 meta\uFF09");
1197
1472
  const payload = await env.continuation.verify(String(args.continuation), "recruit-stage.jd.create.apply");
1473
+ restoreDsOptions(payload.enumMaps);
1198
1474
  const host = env.host;
1199
1475
  const session = await host.getSession();
1200
1476
  const ctx = { host, baseUrl: session.baseUrl.replace(/\/+$/, ""), appId: "", cache: await env.recruitContext() };
@@ -1226,24 +1502,42 @@ async function apply(args, env) {
1226
1502
  const positionPostId = data.positionPostId;
1227
1503
  const checkRpa = data.checkRpa;
1228
1504
  const rpaValidMsg = data.rpaValidMsg || null;
1229
- const created = r2?.status !== false && !!positionPostId;
1230
- const listUrl = await resolvePositionNewUrl(ctx).catch(() => null);
1505
+ const okByResponse = r2?.status !== false && r2?.fail !== false && data.fail !== true;
1506
+ const verification = await verifySubmitted({
1507
+ host,
1508
+ formId: jd.formId,
1509
+ objId: jd.objId,
1510
+ dataId: formDataId,
1511
+ expected: expectedFields(
1512
+ jd.dataDetails,
1513
+ ctx.cache.fields[jd.objId] || {},
1514
+ ["position_name", "status", "salary_min", "salary_max", "work_location"],
1515
+ ["position_name", "status"],
1516
+ ["salary_min", "salary_max", "work_location"]
1517
+ )
1518
+ });
1519
+ if (verification.mismatches.length) invalidateEnvCache(ctx.baseUrl, ctx.appId);
1520
+ const recordOk = verification.unavailable ? okByResponse : verification.mismatches.length === 0;
1521
+ const created = okByResponse && recordOk;
1522
+ const result = !created ? "failed" : verification.mismatches.length ? "partial" : "success";
1523
+ const listUrl = buildListUrl(ctx.baseUrl, ctx.cache.lists?.position?.listId || "");
1231
1524
  const cardUrl = buildCardUrl(ctx.baseUrl, jd.objId, formDataId);
1232
- const locateUrl = buildListLocateUrl(ctx.baseUrl, ctx.appId, ctx.cache.lists?.position?.listId || "", jd.objId, formDataId);
1233
1525
  return rsSuccess("recruit-stage.jd.create.apply", {
1234
1526
  mode: "apply",
1235
- result: created ? "success" : "failed",
1527
+ result,
1236
1528
  formDataId,
1237
1529
  positionPostId: positionPostId || null,
1238
1530
  rpaChecked: checkRpa === void 0 ? null : !!checkRpa,
1239
1531
  rpaValidMsg,
1240
- positionListUrl: listUrl || null,
1532
+ verification: { checked: verification.checked, mismatches: verification.mismatches, unavailable: verification.unavailable || null },
1533
+ verifyWarnings: verification.mismatches.map((m) => "\u843D\u5E93\u56DE\u67E5\u4E0D\u4E00\u81F4\uFF1A" + m.label + " \u671F\u671B " + m.expected + "\uFF0C\u5B9E\u9645 " + m.actual),
1534
+ positionListUrl: listUrl,
1241
1535
  positionCardUrl: cardUrl,
1242
- positionListLocateUrl: locateUrl,
1536
+ positionListLocateUrl: listUrl,
1243
1537
  // 产物链接(Agent 原样搬运成 Markdown 链接,按顺序:详情在前、列表在后)
1244
1538
  viewLink: cardUrl ? `[\u67E5\u770B ${jd.summary.positionName || "\u65B0\u5EFA\u804C\u4F4D"} \u804C\u4F4D\u8BE6\u60C5](${cardUrl})` : null,
1245
- listLocateLink: locateUrl || listUrl ? `[\u6253\u5F00\u62DB\u8058\u5C97\u4F4D\u5217\u8868\uFF08\u5DF2\u5B9A\u4F4D\u65B0\u5EFA\u804C\u4F4D\uFF09](${locateUrl || listUrl})` : null,
1246
- agentNote: "\u67E5\u770B\u5165\u53E3 = \u4E24\u4E2A Markdown \u94FE\u63A5\uFF08\u5E73\u53F0\u5B9E\u8BC1\u53EF\u70B9\u51FB\uFF09\uFF1A\u6309\u987A\u5E8F\u539F\u6837\u642C\u8FD0 viewLink \u4E0E listLocateLink\uFF1B\u4E0D\u8981\u5305 browsertool \u6807\u7B7E\u3002\u94FE\u63A5\u53EA\u662F\u67E5\u770B\u5165\u53E3\uFF0C\u91CD\u590D\u70B9\u51FB\u4E0D\u4F1A\u91CD\u590D\u521B\u5EFA\u3002",
1539
+ listLocateLink: listUrl ? `[\u6253\u5F00\u804C\u4F4D\u5217\u8868](${listUrl})` : null,
1540
+ agentNote: "\u67E5\u770B\u5165\u53E3 = \u4E24\u4E2A Markdown \u94FE\u63A5\uFF1A\u2460 viewLink \u804C\u4F4D\u8BE6\u60C5\u5355\u9875 \u2461 listLocateLink \u804C\u4F4D\u5217\u8868\uFF08\u53EA\u6253\u5F00\u5217\u8868\uFF0C\u4E0D\u6253\u5F00\u8BE6\u60C5\uFF09\u3002\u6309\u987A\u5E8F\u539F\u6837\u642C\u8FD0\uFF0C\u4E0D\u8981\u5305 browsertool \u6807\u7B7E\uFF1B\u7F3A\u54EA\u4E2A\u53EA\u7ED9\u53E6\u4E00\u4E2A\u3002\u94FE\u63A5\u53EA\u662F\u67E5\u770B\u5165\u53E3\uFF0C\u91CD\u590D\u70B9\u51FB\u4E0D\u4F1A\u91CD\u590D\u521B\u5EFA\u3002",
1247
1541
  ...jd.summary
1248
1542
  });
1249
1543
  }
@@ -1832,9 +2126,9 @@ function buildSubDetails(structured, subs, cache) {
1832
2126
  const parts = Array.isArray(v) ? v : String(v).split(/[,~]/);
1833
2127
  const s = String(parts[0] || "").trim();
1834
2128
  const e = String(parts[1] || "").trim();
1835
- if (!s || !e) continue;
1836
- row[col.startKey] = s;
1837
- row[col.endKey] = e;
2129
+ if (s) row[col.startKey] = s;
2130
+ if (e) row[col.endKey] = e;
2131
+ if (!s && !e) continue;
1838
2132
  continue;
1839
2133
  }
1840
2134
  const scalar = typeof v === "object" ? String(v.optionId ?? v.content ?? "") : String(v);
@@ -1942,13 +2236,17 @@ function makeBriefReader(ctx, formId, objId, fields) {
1942
2236
  }
1943
2237
  function resolveTalentCardUrl(ctx, talentId) {
1944
2238
  const pid = ctx.cache.ebdDetailPageId;
1945
- if (!pid) return null;
2239
+ if (!pid || !talentId) {
2240
+ const forms = ctx.cache.forms || {};
2241
+ const tobj = String(forms.talent_pool?.objId || forms.talent?.objId || "");
2242
+ return tobj && talentId ? buildCardUrl(ctx.baseUrl, tobj, String(talentId)) : null;
2243
+ }
1946
2244
  return `${ctx.baseUrl}/sp/ebdpage/view/${pid}?talentId=${talentId}${talentLinkExtra(ctx.cache)}`;
1947
2245
  }
1948
- function resolveTalentListLocateUrl(ctx, talentId) {
2246
+ function resolveTalentListLocateUrl(ctx, _talentId) {
1949
2247
  const listId = ctx.cache.lists?.talent?.listId;
1950
- if (!listId || !talentId) return null;
1951
- return `${ctx.baseUrl}/sp/ebdfpage/list/${listId}?talentId=${talentId}${talentLinkExtra(ctx.cache)}`;
2248
+ if (!listId) return null;
2249
+ return `${ctx.baseUrl.replace(/\/+$/, "")}/sp/ebdfpage/list/${listId}`;
1952
2250
  }
1953
2251
  async function readTalentSnapshot(ctx, opts) {
1954
2252
  const { host, formId, objId, fields, subMeta, dataId } = opts;
@@ -2191,6 +2489,100 @@ function normalizeTextStructured(cache, s, warnings) {
2191
2489
  fixRows(s.languageAbilities, ["mastery", "ls_ability", "literacy"]);
2192
2490
  return s;
2193
2491
  }
2492
+ var DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
2493
+ var ONGOING_RE = /至今|现在|今|now|present/i;
2494
+ var 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*$/;
2495
+ var RE_RANGE_YM = /^\s*(\d{4}[.\-/年]\d{1,2})\s*[-–—~至,,]\s*(\d{4}[.\-/年]\d{1,2}|至今|现在|今)\s*$/;
2496
+ function normDatePart(raw, isEnd) {
2497
+ const s = String(raw ?? "").trim();
2498
+ if (!s) return "";
2499
+ if (ONGOING_RE.test(s)) return "";
2500
+ if (DATE_ONLY_RE.test(s)) return s;
2501
+ const m = s.match(/^(\d{4})\s*[.\-/年]?\s*(\d{1,2})?\s*[.\-/月]?\s*(\d{1,2})?\s*日?$/);
2502
+ if (!m) return "";
2503
+ const y = Number(m[1]);
2504
+ const mo = m[2] ? Number(m[2]) : 1;
2505
+ if (!y || mo < 1 || mo > 12) return "";
2506
+ const lastDay = new Date(y, mo, 0).getDate();
2507
+ let d;
2508
+ if (m[3]) {
2509
+ d = Number(m[3]);
2510
+ if (d < 1 || d > lastDay) return "";
2511
+ } else {
2512
+ d = isEnd ? lastDay : 1;
2513
+ }
2514
+ return y + "-" + String(mo).padStart(2, "0") + "-" + String(d).padStart(2, "0");
2515
+ }
2516
+ function normDateRange(raw) {
2517
+ const s = Array.isArray(raw) ? raw.map((x) => String(x ?? "").trim()).filter(Boolean).join(",") : String(raw ?? "").trim();
2518
+ if (!s) return "";
2519
+ const m = s.match(RE_RANGE_FULL) || s.match(RE_RANGE_YM);
2520
+ if (m) {
2521
+ const a = normDatePart(m[1], false);
2522
+ if (!a) return "";
2523
+ const b = normDatePart(m[2], true);
2524
+ return b ? a + "," + b : a;
2525
+ }
2526
+ return normDatePart(s, false);
2527
+ }
2528
+ function normalizeDates(s, warnings) {
2529
+ if (!s || typeof s !== "object") return;
2530
+ const one = (label, val, isEnd = false) => {
2531
+ const before = String(val ?? "").trim();
2532
+ if (!before) return "";
2533
+ if (ONGOING_RE.test(before)) return "";
2534
+ const after = normDatePart(before, isEnd);
2535
+ if (!after) {
2536
+ warnings.push("\u65E5\u671F\u65E0\u6CD5\u8BC6\u522B\uFF0C\u5DF2\u8DF3\u8FC7\u8BE5\u5B57\u6BB5\uFF08\u907F\u514D\u63A5\u53E3\u6574\u6279\u6821\u9A8C\u5931\u8D25\uFF09\uFF1A" + label + " = \u300C" + before + "\u300D");
2537
+ return "";
2538
+ }
2539
+ if (after !== before) warnings.push("\u65E5\u671F\u5DF2\u89C4\u8303\u5316\uFF1A" + label + " \u300C" + before + "\u300D\u2192\u300C" + after + "\u300D");
2540
+ return after;
2541
+ };
2542
+ for (const k of ["joinworkdate", "graduate_date", "birthday"]) {
2543
+ if (s[k] === void 0 || s[k] === null) continue;
2544
+ s[k] = one(k, s[k], false);
2545
+ }
2546
+ if (Array.isArray(s.academicInformations)) {
2547
+ for (let i = 0; i < s.academicInformations.length; i++) {
2548
+ const r = s.academicInformations[i];
2549
+ if (!r || typeof r !== "object" || r.study_date === void 0) continue;
2550
+ const before = String(r.study_date ?? "").trim();
2551
+ if (!before) continue;
2552
+ const after = normDateRange(before);
2553
+ if (!after) {
2554
+ warnings.push("\u65E5\u671F\u533A\u95F4\u65E0\u6CD5\u8BC6\u522B\uFF0C\u5DF2\u8DF3\u8FC7\uFF08\u907F\u514D\u63A5\u53E3\u6574\u6279\u6821\u9A8C\u5931\u8D25\uFF09\uFF1AacademicInformations[" + i + "].study_date = \u300C" + before + "\u300D");
2555
+ r.study_date = "";
2556
+ } else {
2557
+ if (after !== before) warnings.push("\u65E5\u671F\u5DF2\u89C4\u8303\u5316\uFF1AacademicInformations[" + i + "].study_date \u300C" + before + "\u300D\u2192\u300C" + after + "\u300D");
2558
+ r.study_date = after;
2559
+ }
2560
+ }
2561
+ }
2562
+ for (const key of ["jobInformations", "workExperiences", "projectExperiences"]) {
2563
+ const arr = s[key];
2564
+ if (!Array.isArray(arr)) continue;
2565
+ for (let i = 0; i < arr.length; i++) {
2566
+ const r = arr[i];
2567
+ if (!r || typeof r !== "object") continue;
2568
+ if (r.start_date !== void 0 && r.start_date !== null) {
2569
+ r.start_date = one(key + "[" + i + "].start_date", r.start_date, false);
2570
+ }
2571
+ if (r.end_date !== void 0 && r.end_date !== null) {
2572
+ r.end_date = one(key + "[" + i + "].end_date", r.end_date, true);
2573
+ }
2574
+ }
2575
+ }
2576
+ for (const [key, field] of [["internshipExperiences", "entry_time"], ["awardExperiences", "award_date"]]) {
2577
+ const arr = s[key];
2578
+ if (!Array.isArray(arr)) continue;
2579
+ for (let i = 0; i < arr.length; i++) {
2580
+ const r = arr[i];
2581
+ if (!r || typeof r !== "object") continue;
2582
+ if (r[field] !== void 0 && r[field] !== null) r[field] = one(key + "[" + i + "]." + field, r[field], false);
2583
+ }
2584
+ }
2585
+ }
2194
2586
  async function verifySubRows(ctx, formId, objId, dataId) {
2195
2587
  const L = await getFormLayoutMeta(ctx.host, formId);
2196
2588
  const r = await ctx.host.request({
@@ -2236,7 +2628,9 @@ async function loadStructured(ctx, args) {
2236
2628
  if (!String(s.telephone || "").trim() && !String(s.candidateName || "").trim()) {
2237
2629
  throw rsValidationError("structured_invalid", "\u7ED3\u6784\u5316\u7B80\u5386\u7F3A\u5C11 telephone \u4E0E candidateName\uFF08\u81F3\u5C11\u8981\u6709\u624B\u673A\u53F7\u6216\u59D3\u540D\uFF0C\u5426\u5219\u65E0\u6CD5\u67E5\u91CD\u5EFA\u6863\uFF09");
2238
2630
  }
2239
- return { structured: normalizeTextStructured(ctx.cache, s, warnings), textMode: true, warnings };
2631
+ const normalizedInline = normalizeTextStructured(ctx.cache, s, warnings);
2632
+ normalizeDates(normalizedInline, warnings);
2633
+ return { structured: normalizedInline, textMode: true, warnings };
2240
2634
  }
2241
2635
  if (args.structuredFile) {
2242
2636
  const p = path.resolve(String(args.structuredFile));
@@ -2245,7 +2639,9 @@ async function loadStructured(ctx, args) {
2245
2639
  if (!String(s.telephone || "").trim() && !String(s.candidateName || "").trim()) {
2246
2640
  throw rsValidationError("structured_invalid", "\u7ED3\u6784\u5316\u7B80\u5386\u7F3A\u5C11 telephone \u4E0E candidateName");
2247
2641
  }
2248
- return { structured: normalizeTextStructured(ctx.cache, s, warnings), textMode: true, warnings };
2642
+ const normalizedFile = normalizeTextStructured(ctx.cache, s, warnings);
2643
+ normalizeDates(normalizedFile, warnings);
2644
+ return { structured: normalizedFile, textMode: true, warnings };
2249
2645
  }
2250
2646
  return { structured: null, textMode: false, warnings };
2251
2647
  }
@@ -2294,8 +2690,8 @@ async function buildImport(ctx, args) {
2294
2690
  channelLabel = "\u624B\u52A8\u5F55\u5165\uFF08\u56FA\u5B9A\uFF09";
2295
2691
  }
2296
2692
  if (fields.is_blacklist) {
2297
- const opt = (cache.field_options?.[objId] || {})[fields.is_blacklist] || {};
2298
- const noId = Object.keys(opt).find((k) => opt[k] === "\u5426");
2693
+ const opt = await getDsOptions(host, objId, fields.is_blacklist).catch(() => ({}));
2694
+ const noId = opt["\u5426"];
2299
2695
  if (noId) dataDetails.push({ formField: { id: fields.is_blacklist }, dataOptions: [{ optionId: String(noId), content: "\u5426" }] });
2300
2696
  }
2301
2697
  let subBuild = { byTable: {}, stats: {} };
@@ -2421,6 +2817,8 @@ async function prepare2(args, env) {
2421
2817
  const session = await host.getSession();
2422
2818
  const ctx = { host, baseUrl: session.baseUrl.replace(/\/+$/, ""), appId: "", cache: await env.recruitContext() };
2423
2819
  ctx.appId = ctx.cache.appId;
2820
+ const perm = await probeCreatePermission(ctx.host, objIdOf(ctx.cache, "talent_pool"));
2821
+ if (perm === "denied") throw rsFail("\u5F53\u524D\u8D26\u53F7\u6CA1\u6709\u300C\u4EBA\u624D\u5E93\u300D\u8868\u5355\u7684\u521B\u5EFA\u6743\u9650\uFF0C\u5DF2\u963B\u65AD\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09");
2424
2822
  const argsT = args;
2425
2823
  if (!argsT.structured && !argsT.structuredFile && !argsT.fileId && !argsT.resumeFile) {
2426
2824
  throw rsValidationError("input_required", "\u9700\u8981 structured/structuredFile/fileId/resumeFile \u4E4B\u4E00");
@@ -2476,7 +2874,11 @@ async function prepare2(args, env) {
2476
2874
  }
2477
2875
  const willSubmit2 = { updateTalentId, mainTable: fingerprintMainTable(upMain), details: built.detailsPayload };
2478
2876
  const fp2 = fingerprint2(willSubmit2);
2479
- const continuation2 = await env.continuation.issue({ operation: "recruit-stage.resume.import.apply", fingerprint: fp2 });
2877
+ const continuation2 = await env.continuation.issue({
2878
+ operation: "recruit-stage.resume.import.apply",
2879
+ fingerprint: fp2,
2880
+ enumMaps: await dsOptionsSnapshot()
2881
+ });
2480
2882
  return rsSuccess("recruit-stage.resume.import.prepare", {
2481
2883
  mode: "prepare-update",
2482
2884
  action: "\u6309\u7B80\u5386\u66F4\u65B0\u5DF2\u6709\u4EBA\u624D",
@@ -2544,7 +2946,11 @@ async function prepare2(args, env) {
2544
2946
  };
2545
2947
  const willSubmit = { formId: built.formId, objId: built.objId, mainTable: fingerprintMainTable(toDatasetMainTable(built.dataDetails, built.fields)), details: built.detailsPayload };
2546
2948
  const fp = fingerprint2(willSubmit);
2547
- const continuation = await env.continuation.issue({ operation: "recruit-stage.resume.import.apply", fingerprint: fp });
2949
+ const continuation = await env.continuation.issue({
2950
+ operation: "recruit-stage.resume.import.apply",
2951
+ fingerprint: fp,
2952
+ enumMaps: await dsOptionsSnapshot()
2953
+ });
2548
2954
  return rsSuccess("recruit-stage.resume.import.prepare", {
2549
2955
  mode: "prepare",
2550
2956
  ...summary,
@@ -2558,6 +2964,7 @@ async function apply2(args, env) {
2558
2964
  if (args.confirm !== true) throw rsConfirmationError("recruit-stage.resume.import.apply", { hint: "\u5199\u64CD\u4F5C\u5FC5\u987B\u663E\u5F0F confirm:true" });
2559
2965
  if (!args.continuation) throw rsValidationError("continuation_required", "\u7F3A\u5C11 continuation\uFF08\u6765\u81EA prepare \u7684 meta\uFF09");
2560
2966
  const payload = await env.continuation.verify(String(args.continuation), "recruit-stage.resume.import.apply");
2967
+ restoreDsOptions(payload.enumMaps);
2561
2968
  const host = env.host;
2562
2969
  const session = await host.getSession();
2563
2970
  const ctx = { host, baseUrl: session.baseUrl.replace(/\/+$/, ""), appId: "", cache: await env.recruitContext() };
@@ -2600,11 +3007,11 @@ async function apply2(args, env) {
2600
3007
  verifyWarnings = checkAfter(after);
2601
3008
  }
2602
3009
  return rsSuccess("recruit-stage.resume.import.apply", {
3010
+ // 更新模式同理:明细行/格数对不上时只能报 partial,不能因主表写入成功就报 success
2603
3011
  mode: "update",
2604
- result: "success",
3012
+ result: verifyWarnings.length ? "partial" : "success",
3013
+ detailsState: verifyWarnings.length ? "missing" : "complete",
2605
3014
  talentId: updateTalentId,
2606
- applied: verifyWarnings,
2607
- // placeholder replaced below
2608
3015
  afterSummary: { mainFieldCount: Object.keys(after.main).length, subRows: after.subRows, subCells: after.subCells },
2609
3016
  verifyWarnings: verifyWarnings.length ? verifyWarnings : void 0,
2610
3017
  talentCardUrl: resolveTalentCardUrl(ctx, updateTalentId),
@@ -2680,21 +3087,43 @@ async function apply2(args, env) {
2680
3087
  )
2681
3088
  ]);
2682
3089
  const subTableVerify = verifyRes.ok ? verifyRes.v : { error: verifyRes.e?.message };
2683
- if (subTableVerify && subTableVerify.rowTotal === 0 && built.subRowTotal > 0) {
2684
- writeWarnings.push("\u660E\u7EC6\u884C\u672A\u843D\u5E93\uFF08\u671F\u671B " + built.subRowTotal + " \u884C\uFF0C\u8BFB\u56DE 0 \u884C\uFF09");
3090
+ let detailsState = "complete";
3091
+ if (!verifyRes.ok) {
3092
+ detailsState = "unverified";
3093
+ writeWarnings.push("\u660E\u7EC6\u8BFB\u56DE\u6821\u9A8C\u5931\u8D25\uFF08\u65E0\u6CD5\u786E\u8BA4\u660E\u7EC6\u662F\u5426\u843D\u5E93\uFF09\uFF1A" + (verifyRes.e?.message || ""));
3094
+ } else if (built.subRowTotal > 0) {
3095
+ const gotRows = Number(subTableVerify?.rowTotal || 0);
3096
+ if (gotRows < built.subRowTotal) {
3097
+ detailsState = "missing";
3098
+ writeWarnings.push("\u660E\u7EC6\u884C\u672A\u5B8C\u6574\u843D\u5E93\uFF08\u671F\u671B " + built.subRowTotal + " \u884C\uFF0C\u8BFB\u56DE " + gotRows + " \u884C\uFF09\uFF1A\u4E3B\u8868\u5DF2\u5199\u5165\uFF0C\u8BF7\u6309 writeWarnings \u4FEE\u6B63\u540E\u8D70 updateTalentId \u8865\u660E\u7EC6");
3099
+ }
2685
3100
  }
2686
3101
  const saveEsbActions = esbRes.ok ? esbRes.v : { error: esbRes.e?.message };
2687
3102
  const labelMatch = labelRes.ok ? labelRes.v : "ERR:" + (labelRes.e?.message || "");
2688
3103
  const tagResult = tagRes.ok ? tagRes.v : { applied: [], skipped: built.tagNames, error: tagRes.e?.message };
2689
3104
  const tags = await queryEntityTags(host, talentId).catch(() => []);
3105
+ const verification = await verifySubmitted({
3106
+ host,
3107
+ formId: built.formId,
3108
+ objId: built.objId,
3109
+ dataId: newId,
3110
+ expected: expectedFields(built.dataDetails, built.fields, ["candidate_name", "telephone", "email"], [], ["email"])
3111
+ });
3112
+ if (verification.mismatches.length) {
3113
+ invalidateEnvCache(ctx.baseUrl, ctx.appId);
3114
+ for (const m of verification.mismatches) writeWarnings.push("\u843D\u5E93\u56DE\u67E5\u4E0D\u4E00\u81F4\uFF1A" + m.label + " \u671F\u671B " + m.expected + "\uFF0C\u5B9E\u9645 " + m.actual);
3115
+ }
3116
+ const result = detailsState === "complete" && !verification.mismatches.length ? "success" : "partial";
2690
3117
  const talentCardUrl = resolveTalentCardUrl(ctx, talentId);
2691
3118
  const talentListLocateUrl = resolveTalentListLocateUrl(ctx, talentId);
2692
3119
  return rsSuccess("recruit-stage.resume.import.apply", {
2693
3120
  mode: "apply",
2694
- result: "success",
3121
+ result,
3122
+ detailsState,
2695
3123
  newCandidateFormDataId: newId,
2696
3124
  talentId,
2697
3125
  writeChannel,
3126
+ verification: { checked: verification.checked, mismatches: verification.mismatches, unavailable: verification.unavailable || null },
2698
3127
  writeWarnings: writeWarnings.length ? writeWarnings : void 0,
2699
3128
  subTablesExpected: built.subBuild.stats,
2700
3129
  subTableVerify,
@@ -2707,10 +3136,10 @@ async function apply2(args, env) {
2707
3136
  tags,
2708
3137
  talentCardUrl,
2709
3138
  talentListLocateUrl,
2710
- // 产物链接(Agent 原样搬运:① 人才卡片 ② 人才库定位;缺失哪个只给另一个)
3139
+ // 产物链接(Agent 原样搬运:① 人才卡片单页 ② 人才库列表;缺失哪个只给另一个)
2711
3140
  viewLink: talentCardUrl ? `[\u67E5\u770B ${built.structured.candidateName || "\u65B0\u4EBA\u624D"} \u7684\u4EBA\u624D\u5361\u7247](${talentCardUrl})` : null,
2712
- listLocateLink: talentListLocateUrl ? `[\u5728\u4EBA\u624D\u5E93\u4E2D\u6253\u5F00](${talentListLocateUrl})` : null,
2713
- agentNote: "\u6B63\u6587\u7ED9\u4E24\u4E2A Markdown \u94FE\u63A5\u2014\u2014\u2460 [\u67E5\u770B <\u59D3\u540D> \u7684\u4EBA\u624D\u5361\u7247](talentCardUrl) \u2461 [\u5728\u4EBA\u624D\u5E93\u4E2D\u6253\u5F00](talentListLocateUrl)\uFF1B\u7F3A\u5931\u54EA\u4E2A\u5C31\u53EA\u7ED9\u53E6\u4E00\u4E2A\uFF0C\u4E0D\u8F93\u51FA\u534A\u622A\u3002\u4E0D\u8981\u7528 artifact / browsertool\u3002",
3141
+ listLocateLink: talentListLocateUrl ? `[\u6253\u5F00\u4EBA\u624D\u5E93\u5217\u8868](${talentListLocateUrl})` : null,
3142
+ agentNote: "\u6B63\u6587\u7ED9\u4E24\u4E2A Markdown \u94FE\u63A5\u2014\u2014\u2460 [\u67E5\u770B <\u59D3\u540D> \u7684\u4EBA\u624D\u5361\u7247](talentCardUrl) \u8BE6\u60C5\u5355\u9875 \u2461 [\u6253\u5F00\u4EBA\u624D\u5E93\u5217\u8868](talentListLocateUrl) \u53EA\u6253\u5F00\u5217\u8868\u3001\u4E0D\u6253\u5F00\u8BE6\u60C5\uFF1B\u7F3A\u5931\u54EA\u4E2A\u5C31\u53EA\u7ED9\u53E6\u4E00\u4E2A\uFF0C\u4E0D\u8F93\u51FA\u534A\u622A\u3002\u4E0D\u8981\u7528 artifact / browsertool\u3002",
2714
3143
  parsed: {
2715
3144
  name: built.structured.candidateName,
2716
3145
  mobile: built.structured.telephone,
@@ -2986,7 +3415,7 @@ function planBrief(items) {
2986
3415
  return (items || []).map((x) => x.name + (x.position ? "\uFF08\u5C97\u4F4D\uFF1A" + x.position + "\uFF09" : "") + " [id=" + x.id + "]").join("\uFF1B");
2987
3416
  }
2988
3417
  async function buildPlan(opts) {
2989
- const { ctx, talentId, positionId, interviewer, type, session, start, end, email, mobile, aiPlan } = opts;
3418
+ const { ctx, talentId, positionId, interviewer, type, session, start, end, email, mobile, aiPlan, rounds } = opts;
2990
3419
  const { host, appId, cache } = ctx;
2991
3420
  const objId = objIdOf(cache, "interview_plan");
2992
3421
  const formId = formIdOf(cache, "interview_plan");
@@ -3000,8 +3429,10 @@ async function buildPlan(opts) {
3000
3429
  }
3001
3430
  const candManageId = cand.candidateManageId ? String(cand.candidateManageId) : "";
3002
3431
  if (!candManageId) throw rsFail("\u672A\u5B9A\u4F4D\u5230\u5E94\u8058\u7BA1\u7406\u8BB0\u5F55\uFF08candidateManageId\uFF09\uFF0C\u8BF7\u786E\u8BA4\u5019\u9009\u4EBA\u5DF2\u6709\u5E94\u8058\u6279\u6B21");
3003
- const typeMap = cachedDsMap(cache, objId, "interview_type") || await getDsOptions(host, objId, fid("interview_type"), appId);
3004
- const sessionMap = cachedDsMap(cache, objId, "interview_session") || await getDsOptions(host, objId, fid("interview_session"), appId);
3432
+ const [typeMap, sessionMap] = await Promise.all([
3433
+ getDsOptions(host, objId, fid("interview_type")),
3434
+ getDsOptions(host, objId, fid("interview_session"))
3435
+ ]);
3005
3436
  const typeId = typeMap[type];
3006
3437
  if (!typeId) throw rsFail("\u9762\u8BD5\u65B9\u5F0F\u300C" + type + "\u300D\u4E0D\u5728\u679A\u4E3E\u4E2D\uFF08" + Object.keys(typeMap).join("/") + "\uFF09");
3007
3438
  const sessionId = sessionMap[session];
@@ -3083,6 +3514,32 @@ async function buildPlan(opts) {
3083
3514
  if (aiPlanPicked) {
3084
3515
  dataDetails.push({ formField: { id: digitalFid }, dataOptions: [{ optionId: aiPlanPicked.id, content: aiPlanPicked.name }] });
3085
3516
  }
3517
+ const meta = await getFormLayoutMeta(host, formId).catch(() => null);
3518
+ const invFields = {};
3519
+ for (const [k, v] of Object.entries(fields)) invFields[String(v)] = k;
3520
+ const EXCLUDE_DEFAULTS = /* @__PURE__ */ new Set(["digital_id", "interview_type", "interview_paper_id", "send_channel"]);
3521
+ const defaultsApplied = [];
3522
+ for (const d of meta?.defaultDetails || []) {
3523
+ const did = String(d.fieldId || "");
3524
+ if (!did || dataDetails.some((x) => String(x.formField.id) === did)) continue;
3525
+ const dk = invFields[did] || "";
3526
+ if (EXCLUDE_DEFAULTS.has(dk)) continue;
3527
+ const o = (d.dataOptions || [])[0];
3528
+ if (o?.optionId) dataDetails.push({ formField: { id: did }, dataOptions: [{ optionId: String(o.optionId), content: o.content || "" }] });
3529
+ else if (d.content !== void 0 && d.content !== "") dataDetails.push({ formField: { id: did }, content: String(d.content) });
3530
+ else continue;
3531
+ defaultsApplied.push(dk || did);
3532
+ }
3533
+ const roundsName = String(rounds || "\u7B2C\u4E00\u8F6E").trim();
3534
+ let roundsWarning = null;
3535
+ const roundsFid = fid("interview_rounds");
3536
+ if (roundsFid && !dataDetails.some((x) => String(x.formField.id) === String(roundsFid))) {
3537
+ const hit = (cache.dict?.raw || []).find(
3538
+ (r) => String(r.selection_name || "").trim() === roundsName && ["one", "two", "three", "four"].includes(String(r.browser_key || ""))
3539
+ );
3540
+ if (hit) dataDetails.push({ formField: { id: roundsFid }, dataOptions: [{ optionId: String(hit.option_id), content: roundsName }] });
3541
+ else roundsWarning = "\u6570\u636E\u5B57\u5178\u672A\u627E\u5230\u8F6E\u6B21\u300C" + roundsName + "\u300D\uFF08browserKey one/two/three/four\uFF09\uFF0C\u5DF2\u8DF3\u8FC7\u8BE5\u5B57\u6BB5\uFF0C\u4E0D\u81C6\u9020";
3542
+ }
3086
3543
  return {
3087
3544
  host: ctx.host,
3088
3545
  objId,
@@ -3109,6 +3566,9 @@ async function buildPlan(opts) {
3109
3566
  mobile: cand.mobile + "\uFF08\u6765\u6E90\uFF1A" + (mobileSource === "user" ? "\u672C\u6B21\u6307\u5B9A" : "\u4EBA\u624D\u8D44\u6599") + "\uFF09",
3110
3567
  email: (cand.email || "\uFF08\u672A\u63D0\u4F9B\uFF09") + "\uFF08\u6765\u6E90\uFF1A" + (emailSource === "user" ? "\u672C\u6B21\u6307\u5B9A" : emailSource === "talent" ? "\u4EBA\u624D\u8D44\u6599" : "\u7F3A\u5931") + "\uFF09",
3111
3568
  aiPlan: isAI ? aiPlanPicked ? aiPlanPicked.name + "\uFF08id=" + aiPlanPicked.id + "\uFF09" : "\u672A\u9009\u62E9\uFF08AI\u9762\u8BD5\u5FC5\u586B\uFF0C\u9700\u7528\u6237\u6307\u5B9A\uFF09" : "\uFF08\u975E AI \u9762\u8BD5\uFF0C\u4E0D\u9002\u7528\uFF09",
3569
+ rounds: roundsName,
3570
+ defaultsApplied: defaultsApplied.length ? defaultsApplied : void 0,
3571
+ roundsWarning: roundsWarning || void 0,
3112
3572
  isAIInterview: isAI
3113
3573
  }
3114
3574
  };
@@ -3178,7 +3638,11 @@ async function resolveRequiredHint(plan, ctx) {
3178
3638
  }
3179
3639
  function resolveTalentCardUrl2(ctx, talentId) {
3180
3640
  const pid = ctx.cache.ebdDetailPageId;
3181
- if (!pid) return null;
3641
+ if (!pid || !talentId) {
3642
+ const forms = ctx.cache.forms || {};
3643
+ const tobj = String(forms.talent_pool?.objId || forms.talent?.objId || "");
3644
+ return tobj && talentId ? buildCardUrl(ctx.baseUrl, tobj, String(talentId)) : null;
3645
+ }
3182
3646
  return `${ctx.baseUrl}/sp/ebdpage/view/${pid}?talentId=${talentId}${talentLinkExtra(ctx.cache)}`;
3183
3647
  }
3184
3648
  async function resolveInterviewListUrl(ctx) {
@@ -3246,7 +3710,8 @@ var baseInput3 = {
3246
3710
  positionId: { type: "string", description: "\u5E94\u8058\u804C\u4F4D id\uFF08\u7B80\u5386\u6C60\u4EBA\u624D\u5FC5\u586B\uFF09" },
3247
3711
  interviewer: { type: "string", description: "\u9762\u8BD5\u5B98\u59D3\u540D\uFF08\u7F3A\u7701=\u5F53\u524D\u767B\u5F55\u7528\u6237\uFF09" },
3248
3712
  type: { type: "string", description: "\u9762\u8BD5\u65B9\u5F0F\uFF08\u73B0\u573A\u9762\u8BD5/\u89C6\u9891\u9762\u8BD5/\u7535\u8BDD\u9762\u8BD5/AI\u9762\u8BD5\uFF1B\u542B AI \u65F6\u90AE\u7BB1\u4E0E\u65B9\u6848\u5FC5\u586B\uFF09" },
3249
- session: { type: "string", description: "\u9762\u8BD5\u8F6E\u6B21\uFF08\u521D\u8BD5/\u590D\u8BD5/\u2026\uFF09" },
3713
+ session: { type: "string", description: "\u9762\u8BD5\u9636\u6BB5\uFF08\u521D\u8BD5/\u590D\u8BD5/\u2026\uFF09" },
3714
+ rounds: { type: "string", description: "\u9762\u8BD5\u8F6E\u6B21\uFF08\u7B2C\u4E00\u8F6E/\u7B2C\u4E8C\u8F6E/\u7B2C\u4E09\u8F6E/\u7B2C\u56DB\u8F6E\uFF1B\u7F3A\u7701=\u9875\u9762\u9ED8\u8BA4\u503C\u6216\u7B2C\u4E00\u8F6E\uFF0C\u6309\u6570\u636E\u5B57\u5178\u8FD0\u884C\u65F6\u89E3\u6790\uFF09" },
3250
3715
  start: { type: "string", pattern: "^\\d{4}-\\d{1,2}-\\d{1,2}[ T]\\d{1,2}:\\d{2}$", description: "\u5F00\u59CB\u65F6\u95F4 YYYY-MM-DD HH:mm\uFF08\u7F3A\u7701=\u5F53\u524D\u65F6\u95F4\uFF09" },
3251
3716
  end: { type: "string", pattern: "^\\d{4}-\\d{1,2}-\\d{1,2}[ T]\\d{1,2}:\\d{2}$", description: "\u7ED3\u675F\u65F6\u95F4\uFF08\u7F3A\u7701=AI +7\u5929 / \u5176\u5B83 +1\u5C0F\u65F6\uFF09" },
3252
3717
  email: { type: "string", description: "\u5019\u9009\u4EBA\u90AE\u7BB1\uFF08AI \u9762\u8BD5\u5FC5\u586B\uFF1B\u8865\u5F55\u503C\u4F18\u5148\u4E8E\u4EBA\u624D\u8D44\u6599\uFF09" },
@@ -3254,6 +3719,8 @@ var baseInput3 = {
3254
3719
  };
3255
3720
  async function prepare3(args, env) {
3256
3721
  const ctx = await makeCtx(env);
3722
+ const perm = await probeCreatePermission(ctx.host, objIdOf(ctx.cache, "interview_plan"));
3723
+ if (perm === "denied") throw rsFail("\u5F53\u524D\u8D26\u53F7\u6CA1\u6709\u300C\u9762\u8BD5\u8BA1\u5212\u300D\u8868\u5355\u7684\u521B\u5EFA\u6743\u9650\uFF0C\u5DF2\u963B\u65AD\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09");
3257
3724
  const talentId = await locateTalentId(ctx, args);
3258
3725
  const auto = nowAndEnd(args.type || "\u73B0\u573A\u9762\u8BD5");
3259
3726
  const startTime = args.start || auto.s;
@@ -3269,7 +3736,8 @@ async function prepare3(args, env) {
3269
3736
  end: String(endTime),
3270
3737
  email: args.email ? String(args.email) : void 0,
3271
3738
  mobile: args.mobile ? String(args.mobile) : void 0,
3272
- aiPlan: args.aiPlan ? String(args.aiPlan) : void 0
3739
+ aiPlan: args.aiPlan ? String(args.aiPlan) : void 0,
3740
+ rounds: args.rounds ? String(args.rounds) : void 0
3273
3741
  });
3274
3742
  plan.host = ctx.host;
3275
3743
  const aiPlanCandidates = plan.isAI ? (plan.aiPlanOptions.items || []).map((x) => ({ id: x.id, name: x.name, position: x.position })) : [];
@@ -3283,7 +3751,12 @@ async function prepare3(args, env) {
3283
3751
  const willSubmit = { formId: plan.formId, objId: plan.objId, dataDetails: plan.dataDetails };
3284
3752
  const { createHash: createHash3 } = await import("node:crypto");
3285
3753
  const fp = createHash3("sha256").update(JSON.stringify(willSubmit)).digest("hex");
3286
- const continuation = await env.continuation.issue({ operation: "recruit-stage.interview.arrange.apply", fingerprint: fp });
3754
+ const continuation = await env.continuation.issue({
3755
+ operation: "recruit-stage.interview.arrange.apply",
3756
+ fingerprint: fp,
3757
+ enumMaps: await dsOptionsSnapshot(),
3758
+ timeWindow: { start: String(startTime), end: String(endTime) }
3759
+ });
3287
3760
  return rsSuccess("recruit-stage.interview.arrange.prepare", {
3288
3761
  mode: "prepare",
3289
3762
  ...plan.summary,
@@ -3303,11 +3776,12 @@ async function apply3(args, env) {
3303
3776
  if (args.confirm !== true) throw rsConfirmationError("recruit-stage.interview.arrange.apply", { hint: "\u5199\u64CD\u4F5C\u5FC5\u987B\u663E\u5F0F confirm:true" });
3304
3777
  if (!args.continuation) throw rsValidationError("continuation_required", "\u7F3A\u5C11 continuation\uFF08\u6765\u81EA prepare \u7684 meta\uFF09");
3305
3778
  const payload = await env.continuation.verify(String(args.continuation), "recruit-stage.interview.arrange.apply");
3779
+ restoreDsOptions(payload.enumMaps);
3306
3780
  const ctx = await makeCtx(env);
3307
3781
  const talentId = await locateTalentId(ctx, args);
3308
3782
  const auto = nowAndEnd(args.type || "\u73B0\u573A\u9762\u8BD5");
3309
- const startTime = args.start || auto.s;
3310
- const endTime = args.end || (args.start ? shiftTime(String(args.start), auto.isAI ? 7 * 24 * 3600 * 1e3 : 3600 * 1e3) || auto.e : auto.e);
3783
+ const startTime = args.start || payload.timeWindow?.start || auto.s;
3784
+ const endTime = args.end || (args.start ? shiftTime(String(args.start), auto.isAI ? 7 * 24 * 3600 * 1e3 : 3600 * 1e3) || auto.e : payload.timeWindow?.end || auto.e);
3311
3785
  const plan = await buildPlan({
3312
3786
  ctx,
3313
3787
  talentId,
@@ -3319,7 +3793,8 @@ async function apply3(args, env) {
3319
3793
  end: String(endTime),
3320
3794
  email: args.email ? String(args.email) : void 0,
3321
3795
  mobile: args.mobile ? String(args.mobile) : void 0,
3322
- aiPlan: args.aiPlan ? String(args.aiPlan) : void 0
3796
+ aiPlan: args.aiPlan ? String(args.aiPlan) : void 0,
3797
+ rounds: args.rounds ? String(args.rounds) : void 0
3323
3798
  });
3324
3799
  plan.host = ctx.host;
3325
3800
  if (plan.isAI && !plan.aiPlanPicked) {
@@ -3338,19 +3813,36 @@ async function apply3(args, env) {
3338
3813
  dataDetails: plan.dataDetails
3339
3814
  });
3340
3815
  const actionsRun = await execSaveActions(plan, formDataId);
3816
+ const verification = await verifySubmitted({
3817
+ host: ctx.host,
3818
+ formId: plan.formId,
3819
+ objId: plan.objId,
3820
+ dataId: formDataId,
3821
+ expected: expectedFields(
3822
+ plan.dataDetails,
3823
+ ctx.cache.fields[plan.objId] || {},
3824
+ ["interview_type", "interview_session", "interview_rounds", "digital_id", "email", "union_status"],
3825
+ ["union_status"]
3826
+ )
3827
+ });
3828
+ if (verification.mismatches.length) invalidateEnvCache(ctx.baseUrl, ctx.appId);
3829
+ const verifyWarnings = verification.mismatches.map(
3830
+ (m) => "\u843D\u5E93\u56DE\u67E5\u4E0D\u4E00\u81F4\uFF1A" + m.label + " \u671F\u671B " + m.expected + "\uFF0C\u5B9E\u9645 " + m.actual + "\uFF08\u8BE5\u5B57\u6BB5\u53EF\u80FD\u672A\u5199\u5165\uFF09"
3831
+ );
3341
3832
  const detailUrl = buildCardUrl(ctx.baseUrl, plan.objId, formDataId);
3342
- const listLocateUrl = buildListLocateUrl(ctx.baseUrl, ctx.appId, ctx.cache.lists?.interview?.listId || "", plan.objId, formDataId);
3833
+ const listLocateUrl = buildListUrl(ctx.baseUrl, ctx.cache.lists?.interview?.listId || "");
3343
3834
  return rsSuccess("recruit-stage.interview.arrange.apply", {
3344
3835
  mode: "apply",
3345
- result: "success",
3836
+ result: verification.mismatches.length ? "partial" : "success",
3346
3837
  interviewFormId: formDataId,
3347
3838
  interviewCardUrl: detailUrl,
3348
3839
  viewLink: detailUrl ? `[\u67E5\u770B ${plan.cand.name || ""} \u7684\u9762\u8BD5\u5B89\u6392\u8BE6\u60C5](${detailUrl})` : null,
3349
- listLocateLink: listLocateUrl ? `[\u6253\u5F00\u9762\u8BD5\u7BA1\u7406\u5217\u8868\uFF08\u5DF2\u5B9A\u4F4D\u672C\u6B21\u9762\u8BD5\u5B89\u6392\uFF09](${listLocateUrl})` : null,
3350
- agentNote: "\u4EA7\u7269 = \u4E24\u4E2A Markdown \u94FE\u63A5\uFF08\u5E73\u53F0\u5B9E\u8BC1\u53EF\u70B9\u51FB\uFF09\uFF1A\u2460 viewLink \u9762\u8BD5\u5B89\u6392\u8BE6\u60C5\u9875 \u2461 listLocateLink \u9762\u8BD5\u7BA1\u7406\u5217\u8868\u5E76\u53F3\u4FA7\u6ED1\u51FA\u672C\u6B21\u9762\u8BD5\u5B89\u6392\uFF1B\u6309\u987A\u5E8F\u539F\u6837\u653E\u56DE\u7B54\u6B63\u6587\uFF0C\u7F3A\u54EA\u4E2A\u53EA\u7ED9\u53E6\u4E00\u4E2A\u3001\u4E0D\u8F93\u51FA\u534A\u622A\u3002\u4E0D\u8981\u5305 browsertool / <artifact> \u6807\u7B7E\u3002",
3840
+ listLocateLink: listLocateUrl ? `[\u6253\u5F00\u9762\u8BD5\u7BA1\u7406\u5217\u8868](${listLocateUrl})` : null,
3841
+ agentNote: "\u4EA7\u7269 = \u4E24\u4E2A Markdown \u94FE\u63A5\uFF08\u5E73\u53F0\u5B9E\u8BC1\u53EF\u70B9\u51FB\uFF09\uFF1A\u2460 viewLink \u9762\u8BD5\u5B89\u6392\u8BE6\u60C5\u5355\u9875 \u2461 listLocateLink \u9762\u8BD5\u7BA1\u7406\u5217\u8868\uFF08\u53EA\u6253\u5F00\u5217\u8868\uFF0C\u4E0D\u6253\u5F00\u8BE6\u60C5\uFF09\u3002\u6309\u987A\u5E8F\u539F\u6837\u653E\u56DE\u7B54\u6B63\u6587\uFF0C\u7F3A\u54EA\u4E2A\u53EA\u7ED9\u53E6\u4E00\u4E2A\u3001\u4E0D\u8F93\u51FA\u534A\u622A\u3002\u4E0D\u8981\u5305 browsertool / <artifact> \u6807\u7B7E\u3002",
3351
3842
  aiPlan: plan.isAI && plan.aiPlanPicked ? { id: plan.aiPlanPicked.id, name: plan.aiPlanPicked.name } : void 0,
3352
3843
  saveActions: actionsRun.executed,
3353
- warnings: actionsRun.warnings,
3844
+ verification: { checked: verification.checked, mismatches: verification.mismatches, unavailable: verification.unavailable || null },
3845
+ warnings: [...actionsRun.warnings || [], ...verifyWarnings],
3354
3846
  assigned: actionsRun.assigned || {}
3355
3847
  });
3356
3848
  }
@@ -3363,7 +3855,7 @@ async function prefill2(args, env) {
3363
3855
  const typeKey = String(args.type || "AI\u9762\u8BD5");
3364
3856
  const typeFid = fields.interview_type;
3365
3857
  if (!typeFid) throw rsFail("\u9762\u8BD5\u8BA1\u5212\u7F3A\u5C11\u5B57\u6BB5 interview_type\uFF08ds/fields \u89E3\u6790\u4E0D\u5230\uFF09");
3366
- const typeMap = cachedDsMap(ctx.cache, objId, "interview_type") || await getDsOptions(ctx.host, objId, typeFid, ctx.appId);
3858
+ const typeMap = await getDsOptions(ctx.host, objId, typeFid);
3367
3859
  const typeId = typeMap[typeKey];
3368
3860
  if (!typeId) throw rsFail("\u9762\u8BD5\u65B9\u5F0F\u300C" + typeKey + "\u300D\u4E0D\u5728\u679A\u4E3E\u4E2D\uFF08" + Object.keys(typeMap).join("/") + "\uFF09");
3369
3861
  const cardUrl = resolveTalentCardUrl2(ctx, talentId);
@@ -3526,7 +4018,7 @@ async function prepare4(args, env) {
3526
4018
  const analysis = submitBtn ? analyzeButtonActions(submitBtn) : null;
3527
4019
  let newOptionId = null;
3528
4020
  if (args.result) {
3529
- const opts = cachedDsMap(t.cache, t.objId, "result") || await getDsOptions(t.host, t.objId, t.resultFid, t.appId);
4021
+ const opts = await getDsOptions(t.host, t.objId, t.resultFid);
3530
4022
  newOptionId = opts[String(args.result)];
3531
4023
  if (!newOptionId) throw rsFail("\u672A\u8BC6\u522B\u7684\u9762\u8BD5\u7ED3\u679C\u300C" + args.result + "\u300D\uFF0C\u53EF\u9009\uFF1A" + Object.keys(opts).join("/"));
3532
4024
  }
@@ -3535,7 +4027,11 @@ async function prepare4(args, env) {
3535
4027
  const willSubmit = { feedbackId: String(t.target.feedbackId), result: newResultName, comment: newComment };
3536
4028
  const { createHash: createHash3 } = await import("node:crypto");
3537
4029
  const fp = createHash3("sha256").update(JSON.stringify(willSubmit)).digest("hex");
3538
- const continuation = await env.continuation.issue({ operation: "recruit-stage.interview.feedback.edit.apply", fingerprint: fp });
4030
+ const continuation = await env.continuation.issue({
4031
+ operation: "recruit-stage.interview.feedback.edit.apply",
4032
+ fingerprint: fp,
4033
+ enumMaps: await dsOptionsSnapshot()
4034
+ });
3539
4035
  return rsSuccess("recruit-stage.interview.feedback.edit.prepare", {
3540
4036
  mode: "prepare",
3541
4037
  talentId: t.talentId,
@@ -3557,12 +4053,13 @@ async function apply4(args, env) {
3557
4053
  if (args.confirm !== true) throw rsConfirmationError("recruit-stage.interview.feedback.edit.apply", { hint: "\u5199\u64CD\u4F5C\u5FC5\u987B\u663E\u5F0F confirm:true" });
3558
4054
  if (!args.continuation) throw rsValidationError("continuation_required", "\u7F3A\u5C11 continuation\uFF08\u6765\u81EA prepare \u7684 meta\uFF09");
3559
4055
  const payload = await env.continuation.verify(String(args.continuation), "recruit-stage.interview.feedback.edit.apply");
4056
+ restoreDsOptions(payload.enumMaps);
3560
4057
  const t = await buildTarget(env, args);
3561
4058
  const rec2 = await getFormDataRecord(t.host, t.formId, String(t.target.feedbackId), t.objId);
3562
4059
  const details2 = toSubmitDetails(rec2.dataDetails);
3563
4060
  let newOptionId = null;
3564
4061
  if (args.result) {
3565
- const opts = cachedDsMap(t.cache, t.objId, "result") || await getDsOptions(t.host, t.objId, t.resultFid, t.appId);
4062
+ const opts = await getDsOptions(t.host, t.objId, t.resultFid);
3566
4063
  newOptionId = opts[String(args.result)];
3567
4064
  if (!newOptionId) throw rsFail("\u672A\u8BC6\u522B\u7684\u9762\u8BD5\u7ED3\u679C\u300C" + args.result + "\u300D\uFF0C\u53EF\u9009\uFF1A" + Object.keys(opts).join("/"));
3568
4065
  }
@@ -4314,40 +4811,75 @@ var recruitStageManifest = {
4314
4811
  };
4315
4812
 
4316
4813
  // src/shortcuts/recruit-stage/context.ts
4317
- import { join, resolve as resolve2 } from "node:path";
4814
+ import { join as join2, resolve as resolve2 } from "node:path";
4318
4815
  import { existsSync as existsSync2 } from "node:fs";
4319
4816
  import { readFile as readFile2 } from "node:fs/promises";
4320
- import { homedir as homedir2 } from "node:os";
4817
+ import { homedir as homedir3 } from "node:os";
4321
4818
  var flowMemo = /* @__PURE__ */ new Map();
4819
+ var SELFUSE_DEFAULT_FLOW = {
4820
+ selfUseHost: "www.e-cology.com.cn",
4821
+ id: "874896524979806209",
4822
+ name: "\u521D\u7B5B+\u9762\u8BD5+offer\u9636\u6BB5"
4823
+ };
4322
4824
  var digitalMenuMemo = /* @__PURE__ */ new Map();
4323
4825
  function cacheDirFor(baseUrl) {
4324
4826
  const url = new URL(baseUrl);
4325
4827
  const host = url.hostname + (url.port ? `_${url.port}` : "");
4326
4828
  const envRoot = process.env.E10_SKILL_CACHE_DIR;
4327
- if (envRoot) return join(envRoot, host);
4328
- const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolve2(homedir2(), ".weaver-work-cli");
4329
- return join(home, "env-cache", "recruit-ops", host);
4829
+ if (envRoot) return join2(envRoot, host);
4830
+ const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolve2(homedir3(), ".weaver-work-cli");
4831
+ return join2(home, "env-cache", "recruit-ops", host);
4330
4832
  }
4331
4833
  async function readLegacyCacheExtra(baseUrl) {
4332
4834
  try {
4333
4835
  const dir = cacheDirFor(baseUrl);
4334
4836
  if (!existsSync2(dir)) return { defaultRecruitFlow: null, digitalHumanMenu: null };
4335
- const files = (await import("node:fs/promises")).readdir(dir);
4336
- const jsonFiles = (await files).filter((f) => f.endsWith(".json"));
4337
- if (jsonFiles.length !== 1) return { defaultRecruitFlow: null, digitalHumanMenu: null };
4338
- const raw = JSON.parse(await readFile2(join(dir, jsonFiles[0]), "utf8"));
4339
- const flow = raw?.defaultRecruitFlow && raw.defaultRecruitFlow.id ? { id: String(raw.defaultRecruitFlow.id), name: String(raw.defaultRecruitFlow.name || "") } : null;
4340
- const dh = raw?.lists?.digital_human?.listId ? {
4341
- menuName: String(raw.lists.digital_human.menuName || "\u9762\u8BD5\u6570\u5B57\u4EBA\u914D\u7F6E"),
4342
- listId: String(raw.lists.digital_human.listId),
4343
- cusMenuId: String(raw.lists.digital_human.cusMenuId || "")
4344
- } : null;
4837
+ const files = await (await import("node:fs/promises")).readdir(dir);
4838
+ const jsonFiles = files.filter((f) => f.endsWith(".json"));
4839
+ let flow = null;
4840
+ let dh = null;
4841
+ for (const f of jsonFiles) {
4842
+ let raw;
4843
+ try {
4844
+ raw = JSON.parse(await readFile2(join2(dir, f), "utf8"));
4845
+ } catch {
4846
+ continue;
4847
+ }
4848
+ if (!flow && raw?.defaultRecruitFlow && raw.defaultRecruitFlow.id) {
4849
+ flow = { id: String(raw.defaultRecruitFlow.id), name: String(raw.defaultRecruitFlow.name || "") };
4850
+ }
4851
+ if (!dh && raw?.lists?.digital_human?.listId) {
4852
+ dh = {
4853
+ menuName: String(raw.lists.digital_human.menuName || "\u9762\u8BD5\u6570\u5B57\u4EBA\u914D\u7F6E"),
4854
+ listId: String(raw.lists.digital_human.listId),
4855
+ cusMenuId: String(raw.lists.digital_human.cusMenuId || "")
4856
+ };
4857
+ }
4858
+ if (flow && dh) break;
4859
+ }
4345
4860
  return { defaultRecruitFlow: flow, digitalHumanMenu: dh };
4346
4861
  } catch {
4347
4862
  return { defaultRecruitFlow: null, digitalHumanMenu: null };
4348
4863
  }
4349
4864
  }
4350
- async function resolveDefaultRecruitFlow(host, baseUrl, appId) {
4865
+ function findFlowMenu(cache) {
4866
+ const all = (cache.lists || {}).all_search || [];
4867
+ const hit = all.find((m) => m && m.listId && /招聘流程/.test(String(m.menuName || "")));
4868
+ if (hit) {
4869
+ return { listId: String(hit.listId), cusMenuId: String(hit.cusMenuId || ""), menuName: String(hit.menuName || "\u62DB\u8058\u6D41\u7A0B") };
4870
+ }
4871
+ return null;
4872
+ }
4873
+ function isDefaultFlowRow(x) {
4874
+ if (!x) return false;
4875
+ const cands = [x.is_default, x.isDefault, x.default_flow, x.defaultFlow, x.is_enable, x.enabled, x.status];
4876
+ for (const v of cands) {
4877
+ if (v === true || v === 1 || v === "1") return true;
4878
+ if (String(v) === "\u662F" || String(v) === "\u542F\u7528" || String(v) === "\u9ED8\u8BA4") return true;
4879
+ }
4880
+ return false;
4881
+ }
4882
+ async function resolveDefaultRecruitFlow(host, baseUrl, appId, cache) {
4351
4883
  const memoKey = baseUrl;
4352
4884
  if (flowMemo.has(memoKey)) return flowMemo.get(memoKey) ?? null;
4353
4885
  const legacy = await readLegacyCacheExtra(baseUrl);
@@ -4356,22 +4888,86 @@ async function resolveDefaultRecruitFlow(host, baseUrl, appId) {
4356
4888
  return legacy.defaultRecruitFlow;
4357
4889
  }
4358
4890
  let result = null;
4359
- try {
4360
- const r = await host.request({
4361
- path: "/api/recruit/position/recruitFlow/list",
4362
- method: "POST",
4363
- body: { appId, current: 1, pageSize: 50 },
4364
- operation: "context.defaultRecruitFlow"
4365
- });
4366
- const rows = r?.data?.list || r?.data?.rows || r?.data || [];
4367
- const list = Array.isArray(rows) ? rows : [];
4368
- const enabled = list.find((x) => x && (x.isDefault === true || Number(x.isDefault) === 1 || x.default_flow === "1")) || list.find((x) => x && x.id);
4369
- if (enabled?.id) {
4370
- result = { id: String(enabled.id), name: String(enabled.name || enabled.flow_name || "") };
4891
+ const menu = findFlowMenu(cache);
4892
+ if (menu) {
4893
+ try {
4894
+ let flowObjId = "";
4895
+ try {
4896
+ const liBody = {
4897
+ cusMenuId: menu.cusMenuId,
4898
+ listId: menu.listId,
4899
+ urlPageTitle: menu.menuName
4900
+ };
4901
+ liBody["appId_" + menu.listId] = appId;
4902
+ const li = await host.request({ path: "/api/ebuilder/form/list/listInit", body: liBody });
4903
+ flowObjId = String(li?.data?.objid || "");
4904
+ } catch {
4905
+ }
4906
+ if (flowObjId) {
4907
+ const body = {
4908
+ current: 1,
4909
+ pageSize: 50,
4910
+ tableuid: Math.random().toString(16).slice(2, 34),
4911
+ listId: menu.listId,
4912
+ searchParamData: { searchType: "3", type: "and" },
4913
+ terminal: "PC",
4914
+ browser: "Chrome",
4915
+ requiredMatch: 1,
4916
+ mapResult: 1,
4917
+ recheckQuery: 1,
4918
+ isFollow: 0,
4919
+ isShareToMe: 0,
4920
+ filterCondition: {},
4921
+ cusMenuId: menu.cusMenuId,
4922
+ urlPageTitle: menu.menuName,
4923
+ menuName: menu.menuName
4924
+ };
4925
+ const r = await host.request({
4926
+ path: `/api/ebuilder/form/list/getListDatas?passid=${flowObjId}&cid=${flowObjId}`,
4927
+ body,
4928
+ headers: { ebBusinessId: menu.listId }
4929
+ });
4930
+ const rows = r?.data?.data || r?.data?.displayData || [];
4931
+ const pick = rows.find(isDefaultFlowRow) || (rows.length === 1 ? rows[0] : null);
4932
+ if (pick) {
4933
+ const id = String(pick.form_data_id || pick.id || "");
4934
+ const name = String(pick.name || pick.flow_name || pick.content || "");
4935
+ if (id && name) result = { id, name };
4936
+ }
4937
+ }
4938
+ } catch {
4939
+ }
4940
+ }
4941
+ if (!result) {
4942
+ try {
4943
+ const r = await host.request({
4944
+ path: "/api/recruit/position/recruitFlow/list",
4945
+ method: "POST",
4946
+ body: { appId, current: 1, pageSize: 50 },
4947
+ operation: "context.defaultRecruitFlow"
4948
+ });
4949
+ const rows = r?.data?.list || r?.data?.rows || r?.data || [];
4950
+ const list = Array.isArray(rows) ? rows : [];
4951
+ const enabled = list.find(isDefaultFlowRow) || null;
4952
+ if (enabled?.id) {
4953
+ result = { id: String(enabled.id), name: String(enabled.name || enabled.flow_name || "") };
4954
+ }
4955
+ } catch {
4956
+ }
4957
+ }
4958
+ if (!result) {
4959
+ const isSelfUse = String(cache?.selfUse || "") === "1";
4960
+ let host2 = "";
4961
+ try {
4962
+ host2 = new URL(baseUrl).hostname;
4963
+ } catch {
4964
+ host2 = "";
4965
+ }
4966
+ if (isSelfUse && host2 === SELFUSE_DEFAULT_FLOW.selfUseHost) {
4967
+ result = { id: SELFUSE_DEFAULT_FLOW.id, name: SELFUSE_DEFAULT_FLOW.name };
4371
4968
  }
4372
- } catch {
4373
4969
  }
4374
- flowMemo.set(memoKey, result);
4970
+ if (result) flowMemo.set(memoKey, result);
4375
4971
  return result;
4376
4972
  }
4377
4973
  async function resolveDigitalHumanMenu(host, baseUrl, cache) {
@@ -4396,7 +4992,7 @@ function createRecruitStageContext() {
4396
4992
  const cache = await loaders.get(loaderKey).load(host);
4397
4993
  const baseUrl = (await host.getSession()).baseUrl.replace(/\/+$/, "");
4398
4994
  const [defaultRecruitFlow, digitalHumanMenu] = await Promise.all([
4399
- resolveDefaultRecruitFlow(host, baseUrl, cache.appId),
4995
+ resolveDefaultRecruitFlow(host, baseUrl, cache.appId, cache),
4400
4996
  resolveDigitalHumanMenu(host, baseUrl, cache)
4401
4997
  ]);
4402
4998
  return { ...cache, defaultRecruitFlow, digitalHumanMenu };