weaver-work-cli 0.1.44 → 0.1.46

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 (241) hide show
  1. package/README.md +9 -5
  2. package/dist/chunks/{archive-P6TBQGKL.js → archive-ZQ4A4TV6.js} +388 -44
  3. package/dist/chunks/{archive-oa-7TQ2NXOH.js → archive-oa-BBDP7AKJ.js} +2 -2
  4. package/dist/chunks/{asset-3ELRG37G.js → asset-ZOJVBWZH.js} +2 -2
  5. package/dist/chunks/{asset-idle-WIGMUFMD.js → asset-idle-XGB5IPGT.js} +2 -2
  6. package/dist/chunks/{attachment-content-E3276UOV.js → attachment-content-MCXQBD6N.js} +3 -3
  7. package/dist/chunks/{blog-C5NMZAAC.js → blog-QSHLZSFW.js} +2 -2
  8. package/dist/chunks/caizhilian-KCQYFH72.js +204 -0
  9. package/dist/chunks/{calendar-FI2WNSBO.js → calendar-DLGMRJQA.js} +2 -2
  10. package/dist/chunks/{chunk-PUQS5MWL.js → chunk-3YV7PKRL.js} +1 -1
  11. package/dist/chunks/{chunk-FAZTGX7S.js → chunk-4RWS2YYL.js} +5 -5
  12. package/dist/chunks/{chunk-GM6J7Q4B.js → chunk-6AXKWFKG.js} +32 -12
  13. package/dist/chunks/{chunk-ETNJSKMM.js → chunk-6NXT4ICB.js} +148 -21
  14. package/dist/chunks/{chunk-QVSWRLLU.js → chunk-6V5ZPKHV.js} +56 -12
  15. package/dist/chunks/chunk-762M5XJS.js +215 -0
  16. package/dist/chunks/{chunk-PC7VKEB5.js → chunk-76H3IKH6.js} +178 -37
  17. package/dist/chunks/{chunk-FRZKBMSW.js → chunk-AD46OMQK.js} +239 -41
  18. package/dist/chunks/{chunk-WSF4NNMR.js → chunk-CZNZKOHR.js} +2 -2
  19. package/dist/chunks/{chunk-TA7FXXJD.js → chunk-DLY5GUXX.js} +1 -1
  20. package/dist/chunks/{chunk-BCVYBYYT.js → chunk-GR76ZDDX.js} +2 -2
  21. package/dist/chunks/{chunk-CWYGFU5B.js → chunk-GSZTA43P.js} +2 -2
  22. package/dist/chunks/{chunk-GRDRG6HP.js → chunk-HFXK54M4.js} +2 -2
  23. package/dist/chunks/{chunk-N4M2DDFE.js → chunk-IP4CWQCF.js} +11 -11
  24. package/dist/chunks/{chunk-GAMZLAG2.js → chunk-IRMIEDXN.js} +1 -1
  25. package/dist/chunks/{chunk-XNIK66I4.js → chunk-JB34OE7R.js} +790 -77
  26. package/dist/chunks/{chunk-HIT4Y6OI.js → chunk-JFAWZX53.js} +134 -13
  27. package/dist/chunks/{chunk-D4ADSZ7H.js → chunk-O6CMPO65.js} +24 -1
  28. package/dist/chunks/{chunk-Z7VYWPZV.js → chunk-OXHHJWNC.js} +1 -1
  29. package/dist/chunks/chunk-P5GQRWDC.js +60 -0
  30. package/dist/chunks/{caizhilian-5XSM2DFP.js → chunk-PGO4ILMQ.js} +41 -521
  31. package/dist/chunks/{chunk-OF4S23UB.js → chunk-PSOMGA3U.js} +4 -4
  32. package/dist/chunks/{chunk-F4E4EM35.js → chunk-TGAGQV4I.js} +2 -2
  33. package/dist/chunks/{chunk-UFIT2UU3.js → chunk-U6R6FZHD.js} +168 -14
  34. package/dist/chunks/{chunk-XHK4MDR5.js → chunk-UFIFZ4YC.js} +48 -14
  35. package/dist/chunks/chunk-VRPH24IC.js +76 -0
  36. package/dist/chunks/{chunk-3YBDYOC4.js → chunk-YIKSL36S.js} +2 -2
  37. package/dist/chunks/{chunk-IAZ3UPY6.js → chunk-Z6UUBY37.js} +2 -2
  38. package/dist/chunks/{conflict-ARLSZJ6V.js → conflict-H7EHQXYY.js} +2 -2
  39. package/dist/chunks/continuation-GW6PRWK3.js +12 -0
  40. package/dist/chunks/{contract-DNIIW5VJ.js → contract-3QLAGYQL.js} +5793 -4591
  41. package/dist/chunks/{cowork-GMLRGVIW.js → cowork-3ACICHDQ.js} +2 -2
  42. package/dist/chunks/{create-flow-J22BO65E.js → create-flow-VRVJEOBX.js} +6 -6
  43. package/dist/chunks/{ebuilder-form-ANV2FHYV.js → ebuilder-form-GWDTKEI2.js} +5 -5
  44. package/dist/chunks/{ehr-GSTGAIY3.js → ehr-SH2LM3NK.js} +648 -88
  45. package/dist/chunks/{employee-22BGJ3QS.js → employee-NOHNXC46.js} +1 -1
  46. package/dist/chunks/{env-BX3VRFS7.js → env-66FPSJDV.js} +2 -2
  47. package/dist/chunks/{esb-ATAIASX2.js → esb-4BQHNP5C.js} +4 -4
  48. package/dist/chunks/{factory-PETTFME6.js → factory-UH2TZBVA.js} +1 -1
  49. package/dist/chunks/{fna-YEKBSFSX.js → fna-ZVB2IILI.js} +2 -2
  50. package/dist/chunks/{group-chat-BFVXAYFX.js → group-chat-CAKMMV7K.js} +3 -3
  51. package/dist/chunks/{host-WIKN2EJ5.js → host-3TNBMDTR.js} +3 -3
  52. package/dist/chunks/host-7NTIBSPK.js +25 -0
  53. package/dist/chunks/{host-SZGV4UNT.js → host-7OWWPLM4.js} +3 -3
  54. package/dist/chunks/{host-HRBXEPDQ.js → host-G3VU7SDW.js} +3 -3
  55. package/dist/chunks/{host-LR55CTHP.js → host-M4XP5URR.js} +3 -3
  56. package/dist/chunks/{host-SUOY6VYQ.js → host-TUOIOEMC.js} +3 -3
  57. package/dist/chunks/{hrm-NRDO4W5G.js → hrm-UNKCCCGP.js} +5 -5
  58. package/dist/chunks/{im-IQ2HN23S.js → im-NJB7ZYMH.js} +3 -3
  59. package/dist/chunks/{invoice-MNRW76PP.js → invoice-OQP3TMKQ.js} +3 -3
  60. package/dist/chunks/{jiuchuanhui-DTRBAX4N.js → jiuchuanhui-ASFZBMPU.js} +2 -2
  61. package/dist/chunks/{lazy-dispatch-ZVWAI25B.js → lazy-dispatch-DD6ULZ3I.js} +4 -4
  62. package/dist/chunks/{mail-ZVAUXOJA.js → mail-M3HJF5ER.js} +2 -2
  63. package/dist/chunks/{meeting-FEVPZ67S.js → meeting-VTBFW4HI.js} +12 -12
  64. package/dist/chunks/{okr-SDH3E5RA.js → okr-EVX7FB5G.js} +2 -2
  65. package/dist/chunks/operations-J7PUIVWZ.js +15 -0
  66. package/dist/chunks/{plan-E35JFDI7.js → plan-2QJQEPBO.js} +2 -2
  67. package/dist/chunks/{project-73QXBAB2.js → project-XELELW2T.js} +2 -2
  68. package/dist/chunks/{reception-UWZVACBN.js → reception-5WITA44R.js} +2 -2
  69. package/dist/chunks/{recruit-stage-4MAOCKFY.js → recruit-stage-CAKZTUA7.js} +1343 -178
  70. package/dist/chunks/{registry-JDUS4E7D.js → registry-AQVGHUM6.js} +2 -2
  71. package/dist/chunks/{registry-IM5G23LS.js → registry-JVQBLFQ5.js} +10 -10
  72. package/dist/chunks/{registry-KNKSCJNT.js → registry-QJCZ2GVG.js} +4 -4
  73. package/dist/chunks/{registry-PO7SI256.js → registry-VWXWPVAG.js} +2 -2
  74. package/dist/chunks/{room-recommend-H7KLXA5R.js → room-recommend-5U55FMXZ.js} +6 -4
  75. package/dist/chunks/{schedule-ESZIBAUO.js → schedule-IDETODCA.js} +4 -4
  76. package/dist/chunks/{workflow-CWJFJLQU.js → workflow-BSYT5TGL.js} +6 -4
  77. package/dist/cmd/action.js +14 -10
  78. package/dist/index.js +30 -30
  79. package/dist/internal/e10/auth/commands.js +32 -0
  80. package/dist/internal/e10/auth/error-log.js +156 -26
  81. package/dist/internal/e10/auth/xiaoe.js +176 -13
  82. package/dist/internal/e10/context.js +12 -1
  83. package/dist/shortcuts/archive/operations/borrow-list.js +105 -14
  84. package/dist/shortcuts/archive/operations/flow-url.js +182 -22
  85. package/dist/shortcuts/archive/operations/getPageUrl.js +75 -0
  86. package/dist/shortcuts/archive/operations/prelib.js +33 -4
  87. package/dist/shortcuts/archive/operations/shared.js +52 -0
  88. package/dist/shortcuts/contract/host.js +111 -4
  89. package/dist/shortcuts/contract/index.js +19 -0
  90. package/dist/shortcuts/contract/manifest.js +125 -0
  91. package/dist/shortcuts/contract/ooxml/clause-insert.js +249 -0
  92. package/dist/shortcuts/contract/operations/clause-insert.js +56 -0
  93. package/dist/shortcuts/contract/operations/customer.js +192 -0
  94. package/dist/shortcuts/contract/operations/file-download.js +75 -0
  95. package/dist/shortcuts/contract/operations/flow.js +44 -2
  96. package/dist/shortcuts/contract/operations/form-info.js +162 -62
  97. package/dist/shortcuts/contract/operations/registry.js +8 -0
  98. package/dist/shortcuts/contract/operations/review.js +116 -1
  99. package/dist/shortcuts/contract/operations/summary.js +177 -0
  100. package/dist/shortcuts/contract/operations/upload.js +64 -4
  101. package/dist/shortcuts/contract/upload-cache.js +104 -0
  102. package/dist/shortcuts/ehr/host.js +2 -2
  103. package/dist/shortcuts/ehr/index.js +14 -3
  104. package/dist/shortcuts/ehr/manifest.js +5 -1
  105. package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +44 -12
  106. package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +258 -0
  107. package/dist/shortcuts/ehr/operations/recruit-position.js +146 -43
  108. package/dist/shortcuts/ehr/operations/recruit-stats.js +14 -1
  109. package/dist/shortcuts/ehr/operations/recruit-tag.js +173 -0
  110. package/dist/shortcuts/ehr/operations/recruit-write.js +154 -36
  111. package/dist/shortcuts/ehr/operations/recruit.js +196 -12
  112. package/dist/shortcuts/ehr/operations/registry.js +4 -0
  113. package/dist/shortcuts/ehr/operations.js +24 -0
  114. package/dist/shortcuts/ehr/recruit-stage/batch-store.js +78 -0
  115. package/dist/shortcuts/ehr/recruit-stage/context.js +231 -0
  116. package/dist/shortcuts/ehr/recruit-stage/continuation.js +74 -0
  117. package/dist/shortcuts/ehr/recruit-stage/errors.js +65 -0
  118. package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +165 -0
  119. package/dist/shortcuts/ehr/recruit-stage/host.js +109 -0
  120. package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +1049 -0
  121. package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +295 -0
  122. package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +961 -0
  123. package/dist/shortcuts/ehr/recruit-stage/operations/list.js +431 -0
  124. package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +50 -0
  125. package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +1647 -0
  126. package/dist/shortcuts/ehr/recruit-stage/operations/search.js +158 -0
  127. package/dist/shortcuts/ehr/recruit-stage/operations/types.js +34 -0
  128. package/dist/shortcuts/ehr/recruit-stage/runtime.js +31 -0
  129. package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +318 -0
  130. package/dist/shortcuts/ehr/recruit-stage/shared.js +805 -0
  131. package/dist/shortcuts/hrm/operations/employee.js +29 -1
  132. package/dist/shortcuts/meeting/operations/eb/create-flow.js +274 -75
  133. package/dist/shortcuts/meeting/operations/eb/draft-memory.js +56 -0
  134. package/dist/shortcuts/meeting/operations/eb/factory.js +63 -11
  135. package/dist/shortcuts/meeting/operations/eb/person-cache.js +2 -2
  136. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +38 -7
  137. package/dist/shortcuts/meeting/operations/invitation-publish.js +132 -0
  138. package/dist/shortcuts/meeting/operations/invitation.js +27 -4
  139. package/dist/shortcuts/meeting/operations/registry.js +2 -0
  140. package/dist/shortcuts/recruit-stage/batch-store.js +78 -0
  141. package/dist/shortcuts/recruit-stage/fs-scan.js +165 -0
  142. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +356 -29
  143. package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +36 -10
  144. package/dist/shortcuts/recruit-stage/operations/jd-create.js +309 -67
  145. package/dist/shortcuts/recruit-stage/operations/registry.js +12 -0
  146. package/dist/shortcuts/recruit-stage/operations/resume-import.js +310 -17
  147. package/dist/shortcuts/recruit-stage/operations/types.js +9 -0
  148. package/dist/shortcuts/recruit-stage/shared.js +221 -24
  149. package/dist/shortcuts/workflow/index.js +2 -0
  150. package/dist/shortcuts/workflow/operations/read.js +8 -3
  151. package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +92 -5
  152. package/dist/shortcuts/workflow/operations/todoSmartConvert/priorityExpr.js +509 -0
  153. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +22 -1
  154. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +32 -6
  155. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +57 -11
  156. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +165 -52
  157. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +57 -14
  158. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +44 -18
  159. package/docs/contract.md +1 -0
  160. package/docs/e10-auth.md +4 -2
  161. package/docs/todo-smart-convert/data-contract.md +7 -0
  162. package/package.json +1 -1
  163. package/skill-template/domains/jinchengda.md +2 -0
  164. package/skills/weaver-e10-jinchengda/SKILL.md +198 -205
  165. package/skills/weaver-e10-jinchengda/references/contract-action-card.md +759 -0
  166. package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +250 -0
  167. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +146 -7
  168. package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +178 -0
  169. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +75 -0
  170. package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +137 -0
  171. package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +163 -0
  172. package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +52 -3
  173. package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +92 -5
  174. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +602 -0
  175. package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +209 -0
  176. package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +126 -0
  177. package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +312 -0
  178. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +555 -0
  179. package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +47 -12
  180. package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +469 -0
  181. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +154 -1
  182. package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +224 -0
  183. package/skills/weaver-e10-jinchengda/references/orchestration.md +355 -0
  184. package/skills/weaver-e10-jucailin/SKILL.md +12 -3
  185. package/skills/weaver-e10-jucailin/archive/LEGACY-README.md +18 -0
  186. package/skills/weaver-e10-jucailin/archive/LEGACY-SKILL.md +239 -0
  187. package/skills/weaver-e10-jucailin/archive/LEGACY-openai.yaml +131 -0
  188. package/skills/weaver-e10-jucailin/archive/LEGACY-position-templates.md +221 -0
  189. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +334 -0
  190. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +127 -0
  191. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +65 -0
  192. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +63 -0
  193. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +142 -0
  194. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +114 -0
  195. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +56 -0
  196. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +101 -0
  197. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +148 -0
  198. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +77 -0
  199. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +72 -0
  200. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +69 -0
  201. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +241 -0
  202. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +457 -0
  203. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +128 -0
  204. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +146 -0
  205. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +69 -0
  206. package/skills/weaver-e10-jucailin/lib/recruit-xiaoe-file.mjs +192 -0
  207. package/skills/weaver-e10-jucailin/lib/xiaoe-session.mjs +66 -0
  208. package/skills/weaver-e10-jucailin/references/recruit-create.md +19 -91
  209. package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +64 -0
  210. package/skills/weaver-e10-jucailin/references/recruit-read.md +63 -1
  211. package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +95 -0
  212. package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +89 -0
  213. package/skills/weaver-e10-jucailin/references/recruit-tag.md +81 -0
  214. package/skills/weaver-e10-jucailin/references/recruit-write.md +55 -11
  215. package/skills/weaver-e10-meeting/SKILL.md +103 -11
  216. package/skills/weaver-e10-meeting/references/meeting-eb.md +1 -1
  217. package/skills/weaver-e10-recruit-stage/SKILL.md +19 -11
  218. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +26 -8
  219. package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +5 -1
  220. package/skills/weaver-e10-recruit-stage/references/position-templates.md +23 -2
  221. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +13 -1
  222. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +40 -18
  223. package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +27 -14
  224. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +11 -1
  225. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +4 -2
  226. package/skills/weaver-e10-wenshuding/SKILL.md +17 -7
  227. package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +28 -0
  228. package/skills/weaver-e10-wenshuding/references/archive-flow.md +24 -8
  229. package/skills/weaver-e10-wenshuding/references/archive-prelib-list.md +3 -0
  230. package/skills/weaver-e10-wenshuding/references/archive-prelib-open.md +4 -0
  231. package/skills/weaver-e10-wenshuding/references/archive-search.md +3 -1
  232. package/skills/weaver-e10-workflow/SKILL.md +19 -17
  233. package/skills/weaver-e10-workflow/aigroup/default.json +10 -6
  234. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +36 -3
  235. package/skills/weaver-e10-workflow/references/workflow-memory.md +1 -1
  236. package/skills/weaver-e10-workflow/references/workflow-query.md +9 -6
  237. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +152 -1
  238. package/skills/weaver-e10-yimiaoban/SKILL.md +17 -5
  239. package/skills/weaver-e10-yimiaoban/references/msg-write.md +30 -0
  240. package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +72 -0
  241. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +7 -7
@@ -22,7 +22,9 @@ import path from 'node:path';
22
22
  import schoolTiers from '../school-tiers.json';
23
23
  import { rsSuccess, schemaOf } from './types.js';
24
24
  import { rsFail, rsValidationError, rsConfirmationError } from '../errors.js';
25
- import { objIdOf, formIdOf, saveFormData, getFormLayoutMeta, runSaveButtonEsbActions, getTableMapping, invertTableMapping, datasetSaveFormData, datasetUpdateFormData, checkUnique, getCandidateByPhone, buildCardUrl, buildTalentViewUrl, talentLinkExtra, findMenuNode, randHex32, } from '../shared.js';
25
+ import { objIdOf, formIdOf, saveFormData, getFormLayoutMeta, runSaveButtonEsbActions, getTableMapping, invertTableMapping, datasetSaveFormData, datasetUpdateFormData, checkUnique, getCandidateByPhone, buildCardUrl, buildTalentViewUrl, talentLinkExtra, findMenuNode, randHex32, getDsOptions, dsOptionsSnapshot, restoreDsOptions, invalidateEnvCache, verifySubmitted, expectedFields, probeCreatePermission, } from '../shared.js';
26
+ import { scanResumeSource, findStructuredJson } from '../fs-scan.js';
27
+ import { saveBatchItems, loadBatchItems } from '../batch-store.js';
26
28
  // 更新时不允许简历覆盖的字段(人工判定/流程状态,简历无权改写)
27
29
  const PROTECTED_UPDATE_KEYS = ['is_blacklist', 'recruit_status', 'candidate_status', 'data_status'];
28
30
  // ── 上传简历文件(两步:preUploadCheck 取 preUploadId → module/upload 带 file)→ fileid ──
@@ -339,16 +341,24 @@ function makeBriefReader(ctx, formId, objId, fields) {
339
341
  // 人才卡片 URL(环境缓存 ebdDetailPageId;自用系统追加 recruitType=useSelf)
340
342
  function resolveTalentCardUrl(ctx, talentId) {
341
343
  const pid = ctx.cache.ebdDetailPageId;
342
- if (!pid)
343
- return null;
344
+ if (!pid || !talentId) {
345
+ // 缓存缺 ebdDetailPageId(首次运行/换环境)时禁止返回 null:退化为 EB 卡片单页,
346
+ // objId 从环境缓存 talent_pool 取,跨环境动态解析,绝不写死。
347
+ const forms = ctx.cache.forms || {};
348
+ const tobj = String(forms.talent_pool?.objId || forms.talent?.objId || '');
349
+ return tobj && talentId ? buildCardUrl(ctx.baseUrl, tobj, String(talentId)) : null;
350
+ }
344
351
  return `${ctx.baseUrl}/sp/ebdpage/view/${pid}?talentId=${talentId}${talentLinkExtra(ctx.cache)}`;
345
352
  }
346
- // 人才库列表并打开指定人才:{baseUrl}/sp/ebdfpage/list/{listId}?talentId={id}&recruitType=useSelf
347
- function resolveTalentListLocateUrl(ctx, talentId) {
353
+ // 人才库列表(只打开列表):{baseUrl}/sp/ebdfpage/list/{listId}
354
+ // 2026-11-06 用户定稿:列表链接不携带 /card/... 段,也不拼 talentId 等 query,
355
+ // 避免打开列表时一同滑出人才详情单页;人才卡片由 talentCardUrl 单独给出。
356
+ // listId 取环境缓存 lists.talent.listId(运行时解析,跨环境不写死)。
357
+ function resolveTalentListLocateUrl(ctx, _talentId) {
348
358
  const listId = ctx.cache.lists?.talent?.listId;
349
- if (!listId || !talentId)
359
+ if (!listId)
350
360
  return null;
351
- return `${ctx.baseUrl}/sp/ebdfpage/list/${listId}?talentId=${talentId}${talentLinkExtra(ctx.cache)}`;
361
+ return `${ctx.baseUrl.replace(/\/+$/, '')}/sp/ebdfpage/list/${listId}`;
352
362
  }
353
363
  // 读记录快照(更新前算 diff):主表 {dataKey: 展示值} + 各子表行数/格数
354
364
  async function readTalentSnapshot(ctx, opts) {
@@ -883,10 +893,10 @@ async function buildImport(ctx, args) {
883
893
  dataDetails.push({ formField: { id: fields.channel }, dataOptions: [{ optionId: String(manualId), content: '手动录入' }] });
884
894
  channelLabel = '手动录入(固定)';
885
895
  }
886
- // 是否黑名单:固定「否」(选项 id 运行时按名称反查)
896
+ // 是否黑名单:固定「否」——写路径按缓存方案 A 走权威 ds/options(不读盘 field_options)
887
897
  if (fields.is_blacklist) {
888
- const opt = (cache.field_options?.[objId] || {})[fields.is_blacklist] || {};
889
- const noId = Object.keys(opt).find((k) => opt[k] === '否');
898
+ const opt = await getDsOptions(host, objId, fields.is_blacklist).catch(() => ({}));
899
+ const noId = opt['否'];
890
900
  if (noId)
891
901
  dataDetails.push({ formField: { id: fields.is_blacklist }, dataOptions: [{ optionId: String(noId), content: '否' }] });
892
902
  }
@@ -1003,11 +1013,16 @@ const baseInput = {
1003
1013
  noSchoolTags: { type: 'boolean', description: '关闭学校归属标签自动推导' },
1004
1014
  updateTalentId: { type: 'string', description: '按简历更新已有人才(主表全量覆盖+明细整表覆盖;先 prepare 看差异)' },
1005
1015
  };
1006
- async function prepare(args, env) {
1016
+ async function prepare(args, env, opts = {}) {
1007
1017
  const host = env.host;
1008
1018
  const session = await host.getSession();
1009
1019
  const ctx = { host, baseUrl: session.baseUrl.replace(/\/+$/, ''), appId: '', cache: await env.recruitContext() };
1010
1020
  ctx.appId = ctx.cache.appId;
1021
+ if (!opts.skipPermissionProbe) {
1022
+ const perm = await probeCreatePermission(ctx.host, objIdOf(ctx.cache, 'talent_pool'));
1023
+ if (perm === 'denied')
1024
+ throw rsFail('当前账号没有「人才库」表单的创建权限,已阻断(未写入任何数据)');
1025
+ }
1011
1026
  const argsT = args;
1012
1027
  if (!argsT.structured && !argsT.structuredFile && !argsT.fileId && !argsT.resumeFile) {
1013
1028
  throw rsValidationError('input_required', '需要 structured/structuredFile/fileId/resumeFile 之一');
@@ -1067,7 +1082,23 @@ async function prepare(args, env) {
1067
1082
  catch { /* 查不到批次不影响更新 */ }
1068
1083
  const willSubmit = { updateTalentId, mainTable: fingerprintMainTable(upMain), details: built.detailsPayload };
1069
1084
  const fp = fingerprint(willSubmit);
1070
- const continuation = await env.continuation.issue({ operation: 'recruit-stage.resume.import.apply', fingerprint: fp });
1085
+ const continuation = await env.continuation.issue({ operation: 'recruit-stage.resume.import.apply', fingerprint: fp,
1086
+ enumMaps: await dsOptionsSnapshot(),
1087
+ // 🔴 2026-11-07 修复(同 arrange / jd.create / position.create 的同类缺陷):apply 只带
1088
+ // confirm + continuation 时,buildImport 需要的简历来源参数必须能从快照恢复,
1089
+ // 否则会报 resume_source_required(文档写法跑不通)。
1090
+ argsSnapshot: {
1091
+ file: args.file ? String(args.file) : undefined,
1092
+ structuredFile: args.structuredFile ? String(args.structuredFile) : undefined,
1093
+ fileId: args.fileId ? String(args.fileId) : undefined,
1094
+ resumeFile: args.resumeFile ? String(args.resumeFile) : undefined,
1095
+ channel: args.channel ? String(args.channel) : undefined,
1096
+ updateTalentId: args.updateTalentId ? String(args.updateTalentId) : undefined,
1097
+ useOcr: args.useOcr === true,
1098
+ noSchoolTags: args.noSchoolTags === true,
1099
+ structured: args.structured,
1100
+ tags: args.tags,
1101
+ } });
1071
1102
  return rsSuccess('recruit-stage.resume.import.prepare', {
1072
1103
  mode: 'prepare-update',
1073
1104
  action: '按简历更新已有人才',
@@ -1081,6 +1112,16 @@ async function prepare(args, env) {
1081
1112
  protectedSkipped,
1082
1113
  talentViewUrl: viewUrl,
1083
1114
  note: '以上为将写入的差异。确认后 apply 执行;全量覆盖会改掉人工修正过的值',
1115
+ // 🔴 2026-11-07:本 op 此前无 preview(与 jd.create 同类缺陷)。更新场景最关键的是「改哪些字段、跳过哪些」。
1116
+ preview: {
1117
+ action: '按简历更新已有人才(全量覆盖)',
1118
+ talentId: updateTalentId,
1119
+ 变更字段数: Array.isArray(changed) ? changed.length : 0,
1120
+ 变更明细: changed,
1121
+ 未变字段数: fieldDiff.filter((x) => x.change === 'same').length,
1122
+ 保护未覆盖: protectedSkipped,
1123
+ note: '全量覆盖会改掉人工修正过的值;确认逐项变更后再 apply',
1124
+ },
1084
1125
  }, { continuation, fingerprint: fp, confirmHint: '用户明确确认后,携带 confirm:true 与 continuation 调用 apply' });
1085
1126
  }
1086
1127
  // 查重与标签预检互不依赖 → 并行(标签清单分页通常多 RTT,与查重力求重叠)。
@@ -1138,13 +1179,36 @@ async function prepare(args, env) {
1138
1179
  };
1139
1180
  const willSubmit = { formId: built.formId, objId: built.objId, mainTable: fingerprintMainTable(toDatasetMainTable(built.dataDetails, built.fields)), details: built.detailsPayload };
1140
1181
  const fp = fingerprint(willSubmit);
1141
- const continuation = await env.continuation.issue({ operation: 'recruit-stage.resume.import.apply', fingerprint: fp });
1182
+ const continuation = await env.continuation.issue({ operation: 'recruit-stage.resume.import.apply', fingerprint: fp,
1183
+ enumMaps: await dsOptionsSnapshot(),
1184
+ // 🔴 2026-11-07 修复(同 arrange / jd.create / position.create 的同类缺陷):apply 只带
1185
+ // confirm + continuation 时,buildImport 需要的简历来源参数必须能从快照恢复,
1186
+ // 否则会报 resume_source_required(文档写法跑不通)。
1187
+ argsSnapshot: {
1188
+ file: args.file ? String(args.file) : undefined,
1189
+ structuredFile: args.structuredFile ? String(args.structuredFile) : undefined,
1190
+ fileId: args.fileId ? String(args.fileId) : undefined,
1191
+ resumeFile: args.resumeFile ? String(args.resumeFile) : undefined,
1192
+ channel: args.channel ? String(args.channel) : undefined,
1193
+ updateTalentId: args.updateTalentId ? String(args.updateTalentId) : undefined,
1194
+ useOcr: args.useOcr === true,
1195
+ noSchoolTags: args.noSchoolTags === true,
1196
+ structured: args.structured,
1197
+ tags: args.tags,
1198
+ } });
1142
1199
  return rsSuccess('recruit-stage.resume.import.prepare', {
1143
1200
  mode: 'prepare', ...summary,
1144
1201
  willSubmit,
1145
1202
  tagCheck,
1146
1203
  schoolTags: built.schoolTagInfo,
1147
1204
  onCommit: '提交后将:① dataset/v2/saveFormData 建人才(主表+明细一次写入)② 初始化人才批次 ③ 触发人才自动标签规则匹配 ④ 按标签(含学校归属自动推导)写入平台标签 ⑤ 输出人才卡片/人才库定位链接',
1205
+ // 🔴 2026-11-07:本 op 此前无 preview(与 jd.create 同类缺陷)。新建场景要把「建档字段 + 标签预检结果」一起给出来。
1206
+ preview: {
1207
+ ...summary,
1208
+ tagCheck,
1209
+ schoolTags: built.schoolTagInfo,
1210
+ onCommit: '提交后将:建人才 → 初始化批次 → 自动标签匹配 → 写平台标签 → 输出卡片与人才库链接',
1211
+ },
1148
1212
  }, { continuation, fingerprint: fp, confirmHint: '用户明确确认后,携带 confirm:true 与 continuation 调用 apply' });
1149
1213
  }
1150
1214
  async function apply(args, env) {
@@ -1153,6 +1217,12 @@ async function apply(args, env) {
1153
1217
  if (!args.continuation)
1154
1218
  throw rsValidationError('continuation_required', '缺少 continuation(来自 prepare 的 meta)');
1155
1219
  const payload = await env.continuation.verify(String(args.continuation), 'recruit-stage.resume.import.apply');
1220
+ // 合并 prepare 快照(显式传的优先),使 apply 只带 confirm + continuation 也能执行
1221
+ return applyCore({ ...(payload.argsSnapshot || {}), ...args }, env, payload);
1222
+ }
1223
+ /** 单份简历的落库执行体(供单条 apply 与批量 apply 复用;payload 由调用方校验)。 */
1224
+ async function applyCore(args, env, payload) {
1225
+ restoreDsOptions(payload.enumMaps);
1156
1226
  const host = env.host;
1157
1227
  const session = await host.getSession();
1158
1228
  const ctx = { host, baseUrl: session.baseUrl.replace(/\/+$/, ''), appId: '', cache: await env.recruitContext() };
@@ -1294,14 +1364,26 @@ async function apply(args, env) {
1294
1364
  : { applied: [], skipped: built.tagNames, error: tagRes.e?.message };
1295
1365
  // 标签回读依赖写入结果,放在并行组之后(写操作可验证优先)
1296
1366
  const tags = await queryEntityTags(host, talentId).catch(() => []);
1367
+ // 第三层门禁:主表关键字段落库回查(明细行由 verifySubRows 单独校验)
1368
+ const verification = await verifySubmitted({
1369
+ host, formId: built.formId, objId: built.objId, dataId: newId,
1370
+ expected: expectedFields(built.dataDetails, built.fields, ['candidate_name', 'telephone', 'email'], [], ['email']),
1371
+ });
1372
+ if (verification.mismatches.length) {
1373
+ invalidateEnvCache(ctx.baseUrl, ctx.appId);
1374
+ for (const m of verification.mismatches)
1375
+ writeWarnings.push('落库回查不一致:' + m.label + ' 期望 ' + m.expected + ',实际 ' + m.actual);
1376
+ }
1377
+ const result = detailsState === 'complete' && !verification.mismatches.length ? 'success' : 'partial';
1297
1378
  const talentCardUrl = resolveTalentCardUrl(ctx, talentId);
1298
1379
  const talentListLocateUrl = resolveTalentListLocateUrl(ctx, talentId);
1299
1380
  return rsSuccess('recruit-stage.resume.import.apply', {
1300
- mode: 'apply', result: detailsState === 'complete' ? 'success' : 'partial',
1381
+ mode: 'apply', result,
1301
1382
  detailsState,
1302
1383
  newCandidateFormDataId: newId,
1303
1384
  talentId,
1304
1385
  writeChannel,
1386
+ verification: { checked: verification.checked, mismatches: verification.mismatches, unavailable: verification.unavailable || null },
1305
1387
  writeWarnings: writeWarnings.length ? writeWarnings : undefined,
1306
1388
  subTablesExpected: built.subBuild.stats,
1307
1389
  subTableVerify,
@@ -1314,16 +1396,195 @@ async function apply(args, env) {
1314
1396
  tags,
1315
1397
  talentCardUrl,
1316
1398
  talentListLocateUrl,
1317
- // 产物链接(Agent 原样搬运:① 人才卡片 ② 人才库定位;缺失哪个只给另一个)
1399
+ // 产物链接(Agent 原样搬运:① 人才卡片单页 ② 人才库列表;缺失哪个只给另一个)
1318
1400
  viewLink: talentCardUrl ? `[查看 ${built.structured.candidateName || '新人才'} 的人才卡片](${talentCardUrl})` : null,
1319
- listLocateLink: talentListLocateUrl ? `[在人才库中打开](${talentListLocateUrl})` : null,
1320
- agentNote: '正文给两个 Markdown 链接——① [查看 <姓名> 的人才卡片](talentCardUrl) ② [在人才库中打开](talentListLocateUrl);缺失哪个就只给另一个,不输出半截。不要用 artifact / browsertool。',
1401
+ listLocateLink: talentListLocateUrl ? `[打开人才库列表](${talentListLocateUrl})` : null,
1402
+ agentNote: '正文给两个 Markdown 链接——① [查看 <姓名> 的人才卡片](talentCardUrl) 详情单页 ② [打开人才库列表](talentListLocateUrl) 只打开列表、不打开详情;缺失哪个就只给另一个,不输出半截。不要用 artifact / browsertool。',
1321
1403
  parsed: {
1322
1404
  name: built.structured.candidateName, mobile: built.structured.telephone, email: built.structured.email || '(空)',
1323
1405
  gender: built.structured.genderName, degree: built.structured.highest_degree_name, college: built.structured.college,
1324
1406
  },
1325
1407
  });
1326
1408
  }
1409
+ // ── 批量简历导入(2026-11-06)────────────────────────────────────────────────
1410
+ // 输入可以是「一个文件夹」或「一个 zip 包」,也可以直接给 items(每项自带 structured)。
1411
+ // 逐份走与单条完全相同的 prepare → apply(上传原件 / 查重 / 明细写入 / 标签 / 回查),
1412
+ // 最后汇总成一张结果表。解析口径不变:structured 优先,useOcr 只在显式开启时兜底。
1413
+ const IMPORT_BATCH_MAX = 50;
1414
+ async function batchPrepare(args, env) {
1415
+ const explicit = Array.isArray(args.items) ? args.items : null;
1416
+ const scan = !explicit && args.source ? scanResumeSource(String(args.source)) : null;
1417
+ if (!explicit && !scan) {
1418
+ throw rsValidationError('source_required', '需要 source(文件夹或 .zip 路径)或 items([{file, structured?}])之一');
1419
+ }
1420
+ const structuredDir = args.structuredDir ? String(args.structuredDir) : undefined;
1421
+ const shared = {};
1422
+ for (const k of ['channel', 'useOcr', 'noSchoolTags'])
1423
+ if (args[k] !== undefined)
1424
+ shared[k] = args[k];
1425
+ if (Array.isArray(args.tags))
1426
+ shared.tags = args.tags;
1427
+ const entries = (explicit || scan.files).map((x, i) => {
1428
+ if (explicit) {
1429
+ const file = x?.file ? path.resolve(String(x.file)) : '';
1430
+ return {
1431
+ file, name: file ? path.basename(file) : `第${i + 1}项`,
1432
+ structured: x?.structured, structuredFile: x?.structuredFile,
1433
+ };
1434
+ }
1435
+ return { file: x.path, name: x.name, structured: undefined, structuredFile: undefined };
1436
+ });
1437
+ if (entries.length > IMPORT_BATCH_MAX) {
1438
+ throw rsValidationError('batch_too_many', `一次最多 ${IMPORT_BATCH_MAX} 份(当前 ${entries.length} 份);请分批执行`);
1439
+ }
1440
+ if (!entries.length) {
1441
+ throw rsValidationError('no_resume_files', '没有找到简历文件(支持 pdf/doc/docx/rtf/txt/wps;目录最多向下 4 层)');
1442
+ }
1443
+ const items = [];
1444
+ const ready = [];
1445
+ for (let i = 0; i < entries.length; i++) {
1446
+ const e = entries[i];
1447
+ const row = { index: i + 1, file: e.name, path: e.file || undefined };
1448
+ try {
1449
+ let structured = e.structured;
1450
+ let structuredFile = e.structuredFile ? path.resolve(String(e.structuredFile)) : '';
1451
+ if (!structured && !structuredFile && e.file) {
1452
+ const hit = findStructuredJson({ path: e.file, name: e.name, size: 0 }, structuredDir);
1453
+ if (hit)
1454
+ structuredFile = hit;
1455
+ }
1456
+ if (!structured && !structuredFile && !shared.useOcr) {
1457
+ row.status = 'needs_parse';
1458
+ row.message = '缺少结构化数据:请由大模型解析后以 items[].structured(或同名 .json)提供;扫描件可显式 useOcr:true';
1459
+ items.push(row);
1460
+ continue;
1461
+ }
1462
+ const r = await prepare({ ...shared, resumeFile: e.file || undefined, structured, structuredFile: structuredFile || undefined }, env, { skipPermissionProbe: i > 0 });
1463
+ const d = r.data || {};
1464
+ const meta = r.meta || {};
1465
+ const dup = d.duplicate || {};
1466
+ const blocked = dup.unique === false;
1467
+ row.name = d.parsed?.name;
1468
+ row.mobile = d.parsed?.mobile;
1469
+ row.hasStructured = !!(structured || structuredFile);
1470
+ row.duplicateNote = dup.note;
1471
+ if (blocked) {
1472
+ row.status = 'blocked';
1473
+ row.message = '查重未通过:' + (dup.note || '已存在同手机号人才');
1474
+ items.push(row);
1475
+ continue;
1476
+ }
1477
+ row.status = 'ready';
1478
+ items.push(row);
1479
+ ready.push({ index: i + 1, label: row.name || e.name, file: e.file, args: { ...shared, resumeFile: e.file || undefined, structured, structuredFile: structuredFile || undefined }, fingerprint: String(meta.fingerprint || '') });
1480
+ }
1481
+ catch (err) {
1482
+ row.status = 'failed';
1483
+ row.message = err?.message || 'prepare 失败';
1484
+ items.push(row);
1485
+ }
1486
+ }
1487
+ if (!ready.length) {
1488
+ return rsSuccess('recruit-stage.resume.import.batch.prepare', {
1489
+ mode: 'batch-prepare',
1490
+ total: items.length, ready: 0,
1491
+ blocked: items.filter((x) => x.status === 'blocked').length,
1492
+ needsParse: items.filter((x) => x.status === 'needs_parse').length,
1493
+ failed: items.filter((x) => x.status === 'failed').length,
1494
+ scanned: scan ? { root: scan.root, files: scan.files.length, warnings: scan.warnings } : undefined,
1495
+ items,
1496
+ hint: '没有可执行项,逐条看 items[].message(常见:缺少结构化 JSON、查重命中、格式不支持)',
1497
+ // 🔴 2026-11-07:本 op 此前无 preview。文件清单可能很大,preview 只保留「文件 + 状态 + 原因」。
1498
+ preview: {
1499
+ action: '批量简历导入 — 无可执行项',
1500
+ total: items.length,
1501
+ blocked: items.filter((x) => x.status === 'blocked').length,
1502
+ needsParse: items.filter((x) => x.status === 'needs_parse').length,
1503
+ failed: items.filter((x) => x.status === 'failed').length,
1504
+ reasons: items.map((x) => `${x.file}:${x.message || x.status}`),
1505
+ },
1506
+ });
1507
+ }
1508
+ const fp = createHash('sha256').update(JSON.stringify(ready.map((x) => [x.file, x.fingerprint]))).digest('hex');
1509
+ // 清单可能很大(每项带 structured),落盘暂存;token 只带路径与内容指纹
1510
+ const store = saveBatchItems('resume-import', ready);
1511
+ const continuation = await env.continuation.issue({
1512
+ operation: 'recruit-stage.resume.import.batch.apply',
1513
+ fingerprint: fp,
1514
+ enumMaps: await dsOptionsSnapshot(),
1515
+ batchFile: store.file,
1516
+ batchFingerprint: store.fingerprint,
1517
+ });
1518
+ return rsSuccess('recruit-stage.resume.import.batch.prepare', {
1519
+ mode: 'batch-prepare',
1520
+ total: items.length,
1521
+ ready: ready.length,
1522
+ blocked: items.filter((x) => x.status === 'blocked').length,
1523
+ needsParse: items.filter((x) => x.status === 'needs_parse').length,
1524
+ failed: items.filter((x) => x.status === 'failed').length,
1525
+ scanned: scan ? { root: scan.root, files: scan.files.length, warnings: scan.warnings } : undefined,
1526
+ items,
1527
+ note: '确认后带 confirm:true 与 meta.continuation 调 batch.apply;逐份建档,可能是 partial',
1528
+ // 🔴 2026-11-07:本 op 此前无 preview。preview 只列「文件 + 状态」,不复制 structured(体积会爆)。
1529
+ preview: {
1530
+ action: '批量简历导入(逐份建档,结果可能 partial)',
1531
+ total: items.length,
1532
+ ready: ready.length,
1533
+ blocked: items.filter((x) => x.status === 'blocked').length,
1534
+ needsParse: items.filter((x) => x.status === 'needs_parse').length,
1535
+ failed: items.filter((x) => x.status === 'failed').length,
1536
+ files: items.map((x) => `${x.file} — ${x.status}${x.message ? ':' + x.message : ''}`),
1537
+ scanned: scan ? { root: scan.root, files: scan.files.length, warnings: scan.warnings } : undefined,
1538
+ },
1539
+ }, {
1540
+ continuation,
1541
+ fingerprint: fp,
1542
+ confirmHint: '用户确认整批名单后,携带 confirm:true 与本 continuation 调用 recruit-stage.resume.import.batch.apply',
1543
+ });
1544
+ }
1545
+ async function batchApply(args, env) {
1546
+ if (args.confirm !== true) {
1547
+ throw rsConfirmationError('recruit-stage.resume.import.batch.apply', { hint: '批量写操作必须显式 confirm:true' });
1548
+ }
1549
+ if (!args.continuation)
1550
+ throw rsValidationError('continuation_required', '缺少 continuation(来自 batch.prepare 的 meta)');
1551
+ const batch = await env.continuation.verify(String(args.continuation), 'recruit-stage.resume.import.batch.apply');
1552
+ const items = loadBatchItems(batch.batchFile, batch.batchFingerprint);
1553
+ if (!items.length)
1554
+ throw rsValidationError('batch_empty', 'continuation 中没有可执行的简历');
1555
+ const results = [];
1556
+ for (const it of items) {
1557
+ try {
1558
+ const r = await applyCore({ ...(it.args || {}), confirm: true }, env, { fingerprint: it.fingerprint, enumMaps: batch.enumMaps });
1559
+ const d = r.data || {};
1560
+ results.push({
1561
+ index: it.index, file: path.basename(String(it.file || '')), name: it.label,
1562
+ status: d.result === 'partial' ? 'partial' : 'success',
1563
+ talentId: d.talentId, cardUrl: d.talentCardUrl, viewLink: d.viewLink,
1564
+ warnings: d.verifyWarnings && d.verifyWarnings.length ? d.verifyWarnings : undefined,
1565
+ });
1566
+ }
1567
+ catch (e) {
1568
+ results.push({ index: it.index, file: path.basename(String(it.file || '')), name: it.label, status: 'failed', message: e?.message || '执行失败' });
1569
+ }
1570
+ }
1571
+ const ok = results.filter((x) => x.status === 'success').length;
1572
+ const partial = results.filter((x) => x.status === 'partial').length;
1573
+ const failed = results.filter((x) => x.status === 'failed').length;
1574
+ const lines = [
1575
+ '| # | 文件 | 姓名 | 结果 | 说明 |',
1576
+ '|---|---|---|---|---|',
1577
+ ...results.map((x) => `| ${x.index} | ${x.file} | ${x.name || '-'} | ${x.status === 'success' ? '成功' : x.status === 'partial' ? '部分成功' : '失败'} | ${x.message || (x.warnings?.length ? x.warnings.join(';') : x.cardUrl ? '已建档' : '')} |`),
1578
+ ];
1579
+ return rsSuccess('recruit-stage.resume.import.batch.apply', {
1580
+ mode: 'batch-apply',
1581
+ result: failed || partial ? 'partial' : 'success',
1582
+ total: results.length, succeeded: ok, partial, failed,
1583
+ items: results,
1584
+ resultTable: lines.join('\n'),
1585
+ agentNote: '把 resultTable 原样放回答正文;失败/部分成功的条目要带 message 说明原因,不要只报总数。',
1586
+ });
1587
+ }
1327
1588
  export const resumeImportOperations = [
1328
1589
  {
1329
1590
  name: 'recruit-stage.resume.import.prepare',
@@ -1349,6 +1610,38 @@ export const resumeImportOperations = [
1349
1610
  inputSchema: schemaOf({ ...baseInput, confirm: { type: 'boolean' }, continuation: { type: 'string' } }, {}),
1350
1611
  handler: apply,
1351
1612
  },
1613
+ {
1614
+ name: 'recruit-stage.resume.import.batch.prepare',
1615
+ resource: 'recruit.resume',
1616
+ method: 'prepare',
1617
+ action: 'resume.import.batch.prepare',
1618
+ summary: '批量简历导入确认摘要:扫描文件夹或 zip、逐份上传/查重/字段映射,输出可执行/查重拦截/待解析清单(不建档);一次最多 50 份',
1619
+ capability: 'recruit.resume.import',
1620
+ risk: 'write',
1621
+ requiresConfirmation: true,
1622
+ inputSchema: schemaOf({
1623
+ source: { type: 'string', description: '简历文件夹或 .zip 包路径(与 items 二选一)' },
1624
+ items: { type: 'array', description: '显式清单 [{file, structured?, structuredFile?}],与 source 二选一', items: { type: 'object' } },
1625
+ structuredDir: { type: 'string', description: '结构化 JSON 目录(按同名 .json 自动匹配,可选)' },
1626
+ tags: { type: 'array', description: '统一追加的标签名', items: { type: 'string' } },
1627
+ channel: { type: 'string', description: '渠道(可选)' },
1628
+ useOcr: { type: 'boolean', description: '显式开启 OCR 兜底解析(闸门=checkResumeExtraction)' },
1629
+ noSchoolTags: { type: 'boolean', description: '不自动推导学校归属标签' },
1630
+ }, {}),
1631
+ handler: batchPrepare,
1632
+ },
1633
+ {
1634
+ name: 'recruit-stage.resume.import.batch.apply',
1635
+ resource: 'recruit.resume',
1636
+ method: 'apply',
1637
+ action: 'resume.import.batch.apply',
1638
+ summary: '用户确认后逐份建档(上传原件+主表明细+批次+标签+回查),返回逐份结果与 Markdown 表格;非原子批量,结果可能为 partial',
1639
+ capability: 'recruit.resume.import',
1640
+ risk: 'write',
1641
+ requiresConfirmation: true,
1642
+ inputSchema: schemaOf({ confirm: { type: 'boolean' }, continuation: { type: 'string' } }, { required: ['confirm', 'continuation'] }),
1643
+ handler: batchApply,
1644
+ },
1352
1645
  ];
1353
1646
  void findMenuNode;
1354
1647
  void randHex32;
@@ -5,6 +5,15 @@ export function rsSuccess(action, data, meta) {
5
5
  const payload = { ok: true, action, data };
6
6
  if (meta && Object.keys(meta).length > 0)
7
7
  payload.meta = meta;
8
+ // 兼容两套读法:常规组(candidate.*)把 continuation 放在 data.continuation,
9
+ // stage.* 组放在顶层 meta.continuation。这里把 meta 里的 continuation 镜像到 data,
10
+ // 使「读 data.continuation」与「读 meta.continuation」都能取到同一个值。
11
+ const cont = meta?.continuation;
12
+ if (typeof cont === 'string' && data && typeof data === 'object' && !Array.isArray(data)) {
13
+ const obj = data;
14
+ if (!(typeof obj.continuation === 'string' && obj.continuation))
15
+ obj.continuation = cont;
16
+ }
8
17
  return payload;
9
18
  }
10
19
  /** 构造「对象类型 + 严格禁止额外字段」的 JSON Schema。 */