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
@@ -17,6 +17,17 @@ async function verifyLease(args, action, env) {
17
17
  if (lease.baseUrl !== session.baseUrl || lease.profile !== session.profile || lease.userId !== session.userId) {
18
18
  throw ehrValidationError('context_mismatch', '确认上下文已变化(租户或登录账号不同),请重新执行 prepare');
19
19
  }
20
+ // 🔴 2026-11-07 修复(真机发现):prepare 早已把完整业务参数存进 payload({...args, formId, objId, dataDetails}),
21
+ // 但各 apply 处理器此前只从 args 取 talentId/type/...,导致 Agent 按协议文档「apply 只带 confirm + continuation」
22
+ // 必然报 talent_id_required —— 文档写法与实际行为冲突。这里把 payload 里的业务参数补回 args(显式传的优先),
23
+ // 使 apply 真正可以只带这两项;formId/objId/dataDetails 属内部产物,不回填以免覆盖。
24
+ const snap = (lease.payload && typeof lease.payload === 'object') ? lease.payload : {};
25
+ for (const [k, v] of Object.entries(snap)) {
26
+ if (k === 'formId' || k === 'objId' || k === 'dataDetails')
27
+ continue;
28
+ if (args[k] === undefined || args[k] === null || args[k] === '')
29
+ args[k] = v;
30
+ }
20
31
  return lease;
21
32
  }
22
33
  function isNetworkError(error) {
@@ -29,29 +40,28 @@ async function requireRecruitCache(env) {
29
40
  return env.recruitContext.load(env.host);
30
41
  }
31
42
  // ── 产物链接(2026-10-29 周军锋要求:写操作完成后自动生成链接返回对话框)──
32
- // URL 模板与 recruit-stage 脚本同源:人才卡片 /sp/ebdpage/view/{ebdDetailPageId}?talentId=(实证);
33
- // 列表滑出 /sp/ebdfpage/list/{listId}/card/0/{objId}/{dataId}/{listId}?id={dataId}&openSource=field&openSourceId={dataId}&openSourceAppId={appId}(面试管理实证,offer/entry 同构未单独实测);
34
- // 列表直开 /sp/ebdfpage/list/{listId}[?talentId=](candidate.import 同构)。全部取自环境缓存,id 缺失返回 null 不编造。
43
+ // URL 模板与 recruit-stage 同源:详情单页 /sp/ebdpage/view/{ebdDetailPageId}?talentId=(实证)或 /sp/ebdfpage/card/0/{objId}/{dataId};
44
+ // 列表 /sp/ebdfpage/list/{listId} —— **只打开列表**(2026-11-06 用户定稿)。
45
+ // 停用旧「列表 + 滑出详情」形态 .../list/{listId}/card/0/{objId}/{dataId}/...:它会在打开列表时一同打开记录详情单页。
46
+ // 详情与列表由两个独立链接分别给出;listId 取环境缓存,id 缺失返回 null 不编造。
35
47
  function recruitTalentCardUrl(cache, baseUrl, talentId) {
36
- if (!cache.ebdDetailPageId || !talentId)
37
- return null;
38
- const extra = String(cache.selfUse) === "1" ? "&recruitType=useSelf" : "";
39
- return `${baseUrl.replace(/\/+$/, "")}/sp/ebdpage/view/${cache.ebdDetailPageId}?talentId=${talentId}${extra}`;
40
- }
41
- function recruitSlideLocateUrl(cache, baseUrl, listKey, formKey, dataId) {
42
- const listId = cache.lists?.[listKey]?.listId;
43
- const objId = cache.forms?.[formKey]?.objId;
44
- if (!listId || !objId || !dataId || !cache.appId)
48
+ if (!talentId)
45
49
  return null;
46
50
  const base = baseUrl.replace(/\/+$/, "");
47
- return `${base}/sp/ebdfpage/list/${listId}/card/0/${objId}/${dataId}/${listId}?id=${dataId}&openSource=field&openSourceId=${dataId}&openSourceAppId=${cache.appId}`;
51
+ if (cache.ebdDetailPageId) {
52
+ const extra = String(cache.selfUse) === "1" ? "&recruitType=useSelf" : "";
53
+ return `${base}/sp/ebdpage/view/${cache.ebdDetailPageId}?talentId=${talentId}${extra}`;
54
+ }
55
+ // 缓存缺页面 id 时退化为 EB 卡片单页,objId 运行时解析,禁止返回 null
56
+ const objId = String(cache.forms?.talent_pool?.objId || cache.forms?.talent?.objId || "");
57
+ return objId ? `${base}/sp/ebdfpage/card/0/${objId}/${talentId}` : null;
48
58
  }
49
- function recruitOpenListUrl(cache, baseUrl, listKey, talentId) {
59
+ /** 只打开列表页:不带 /card/... 段、不带记录 id query,避免一同滑出详情单页。 */
60
+ function recruitOpenListUrl(cache, baseUrl, listKey) {
50
61
  const menu = cache.lists?.[listKey];
51
62
  if (!menu?.listId)
52
63
  return null;
53
- const extra = talentId ? `?talentId=${talentId}${String(cache.selfUse) === "1" ? "&recruitType=useSelf" : ""}` : "";
54
- return `${baseUrl.replace(/\/+$/, "")}/sp/ebdfpage/list/${menu.listId}${extra}`;
64
+ return `${baseUrl.replace(/\/+$/, "")}/sp/ebdfpage/list/${menu.listId}`;
55
65
  }
56
66
  /** 建前查重:按手机号搜人才库(total 恒 0 平台缺陷,以 data.data[] 非空为准)。 */
57
67
  export async function checkDuplicateByMobile(env, cache, mobile) {
@@ -195,15 +205,72 @@ export async function getDsOptions(host, objId, fieldId, groupId) {
195
205
  }
196
206
  return map;
197
207
  }
198
- /** 人员名称 → userId(门户字段 browser/complete/resource) */
199
- export async function resolvePersonId(host, fieldId, keyword) {
208
+ /**
209
+ * 人员名称 → userId。
210
+ *
211
+ * 主通道:`POST /api/hrm/common/browser/data/resource`——真正按关键词过滤的人员搜索
212
+ * (2026-11-07 实测:搜「李伟」返回 4 人「李伟(上海)/李伟(北京)/李伟松(惠州)/李伟(TJ)」,
213
+ * 搜「顾梦瑶」返回 0 条,说明它确实按关键字过滤,而不是返回默认列表)。
214
+ *
215
+ * 不要再退回 `browser/complete/resource`:那个接口在没有完整选择器上下文时**不按关键词过滤**,
216
+ * 只返回默认人员前 10 位(第一条常为当前登录用户),旧实现取 list[0] 导致面试官一律被写成当前用户。
217
+ *
218
+ * 匹配规则:姓名完全相同且唯一 → 用它;无完全匹配时,包含匹配唯一 → 用它;
219
+ * 命中多个则抛 `person_ambiguous`(附候选,由调用方让用户选),**绝不静默取第一条**。
220
+ * 完全没有命中返回 null,由调用方报"找不到"。
221
+ */
222
+ export async function resolvePersonId(host, _fieldId, keyword) {
223
+ const kw = String(keyword || '').trim();
224
+ if (!kw)
225
+ return null;
226
+ const formDatas = {
227
+ status: [{ statusSelect: ['normal'] }],
228
+ subcompany: [{ subcompanyOpt: 'in' }],
229
+ department: [{ departmentOpt: 'in' }],
230
+ role: [{ roleOpt: 'in' }],
231
+ position: [{ positionOpt: 'in' }],
232
+ superior: [{ superiorOpt: 'in' }],
233
+ };
234
+ if (/@/.test(kw))
235
+ formDatas.email = [{ emailOpt: 'in', emailInput: kw }];
236
+ else if (/^\d{11}$/.test(kw))
237
+ formDatas.mobile = [{ mobileOpt: 'in', mobileInput: kw }];
238
+ else
239
+ formDatas.username = [{ usernameOpt: 'in', usernameInput: kw }];
200
240
  const response = (await host.request({
201
- path: '/api/ebuilder/form/common/browser/complete/resource',
202
- body: { formParam: { fieldId, searchValue: keyword }, 'formParam.fieldId': fieldId, 'formParam.searchValue': keyword },
241
+ path: '/api/hrm/common/browser/data/resource',
242
+ body: {
243
+ browserMultiple: true, authWecahtBook: false,
244
+ wxDepNeedConvertCount: 0, wxEmpNeedConvertCount: 0, wxTotalNeedConvertCount: 0,
245
+ ...formDatas,
246
+ cmd: 'all', formDatas, quickSearchDatas: {}, type: 'and', current: 1, pageSize: 200,
247
+ containsNoneAccount: false, containsPartTimeEmployee: false, containsDls: false,
248
+ },
249
+ }));
250
+ const rows = (response?.data?.data ?? [])
251
+ .filter((r) => r && (r.id || r.value) && r.name);
252
+ if (!rows.length)
253
+ return null;
254
+ const nameOf = (x) => String(x.name || '').trim();
255
+ const idOf = (x) => String(x.id ?? x.value ?? '');
256
+ const exact = rows.filter((r) => nameOf(r) === kw);
257
+ if (exact.length === 1)
258
+ return idOf(exact[0]) || null;
259
+ if (exact.length > 1)
260
+ throw ambiguousPerson(kw, exact);
261
+ if (rows.length === 1)
262
+ return idOf(rows[0]) || null;
263
+ throw ambiguousPerson(kw, rows);
264
+ }
265
+ /** 多人命中:把候选摆出来让用户选,禁止自动取第一条。 */
266
+ function ambiguousPerson(keyword, rows) {
267
+ const candidates = rows.slice(0, 20).map((r) => ({
268
+ id: String(r.id ?? r.value ?? ''),
269
+ name: String(r.name ?? ''),
270
+ department: String(r.department ?? ''),
271
+ position: String(r.position ?? ''),
203
272
  }));
204
- const list = response?.data?.data || response?.data || [];
205
- const first = list[0];
206
- return first ? String(first.id || first.value || '') || null : null;
273
+ return ehrValidationError('person_ambiguous', `人员「${keyword}」命中 ${rows.length} 人,请指明具体是哪一位:${candidates.map((c) => `${c.name}${c.department ? `(${c.department})` : ''}`).join('、')}`, { candidates });
207
274
  }
208
275
  /** saveFormData:新建(rightType 0)或更新(rightType 2,带 formDataId/updateTimeStamp/layoutId) */
209
276
  export async function saveFormData(host, params) {
@@ -445,11 +512,16 @@ const candidateCreateApply = {
445
512
  ...candidateCreateSchema,
446
513
  confirm: { const: true },
447
514
  continuation: { type: 'string', minLength: 1 },
448
- }, { required: ['name', 'mobile', 'confirm', 'continuation'] }),
515
+ },
516
+ // name/mobile 不再列入 required(2026-11-07):prepare 已把它们签进 continuation,
517
+ // apply 只带 confirm + continuation 即可;仍传则用于与快照比对防偷改。
518
+ { required: ['confirm', 'continuation'] }),
449
519
  handler: async (args, env) => {
450
520
  requireConfirm(args, 'ehr.recruit.candidate.create.apply');
451
- const { name, mobile } = validateNameMobile(args.name, args.mobile);
521
+ // 🔴 顺序很重要:先 verifyLease(把 payload 里的 name/mobile/channel 补回 args),再校验。
522
+ // 反过来写会导致「只带 continuation」时报 name_required——即文档写法和实现对不上。
452
523
  const lease = await verifyLease(args, 'ehr.recruit.candidate.create.apply', env);
524
+ const { name, mobile } = validateNameMobile(args.name, args.mobile);
453
525
  const payload = (lease.payload || {});
454
526
  // 指纹校验:apply 入参必须与 prepare 快照一致(防确认后偷改目标)
455
527
  const channelName = args.channel !== undefined && args.channel !== null && String(args.channel).trim() !== ''
@@ -534,7 +606,7 @@ const candidateCreateApply = {
534
606
  initTalentBatch: initMsg,
535
607
  searchHint: `可用 ehr.recruit.candidate.search 按 name=${name} 或 mobile=${mobile} 回查`,
536
608
  talentCardUrl: recruitTalentCardUrl(cache, lease.baseUrl, newId),
537
- talentListLocateUrl: recruitOpenListUrl(cache, lease.baseUrl, 'talent', newId),
609
+ talentListLocateUrl: recruitOpenListUrl(cache, lease.baseUrl, 'talent'),
538
610
  });
539
611
  },
540
612
  };
@@ -546,11 +618,20 @@ const INTERVIEW_TYPES = ['现场面试', '视频面试', '电话面试', 'AI面
546
618
  const AI_DEFAULT_PLAN_NAME = '大模型面试';
547
619
  const INTERVIEW_DATAKEYS = ['subject', 'start_time', 'end_time', 'interview_type', 'interview_session', 'interviewer',
548
620
  'position_manage_id', 'talent_id', 'candidate_manage_id', 'mobile', 'email', 'interview_location', 'notice_mould'];
549
- function defaultInterviewWindow() {
621
+ /**
622
+ * 默认面试时间窗。
623
+ * 🔴 AI 面试的 end_time 语义是「面试截止时间」不是「结束时间」(2026-11-07 真机实测):
624
+ * 自用环境真实 AI 面试记录全部是 start ~ start+7 天,页面的 `aimszztznr` 通知文案也写着
625
+ * 「面试截止时间为:<start+7天>」。若按 1 小时写,候选人过了 1 小时就进不去 AI 面试。
626
+ * 落库后系统**不会**自动纠正成 7 天(已实测:技能建的 1335053505679089688 落库就是 1 小时)。
627
+ * stage 入口(recruit-stage/operations/interview-arrange.ts)本来就是 7 天,两入口必须一致。
628
+ */
629
+ function defaultInterviewWindow(isAI = false) {
550
630
  const pad = (n) => String(n).padStart(2, '0');
551
631
  const now = new Date();
552
632
  const fmt = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}`;
553
- const end = new Date(now.getTime() + 60 * 60 * 1000);
633
+ const spanMs = isAI ? 7 * 24 * 60 * 60 * 1000 : 60 * 60 * 1000;
634
+ const end = new Date(now.getTime() + spanMs);
554
635
  return { start: fmt(now), end: fmt(end) };
555
636
  }
556
637
  /** 当前登录人(teamsCheck → currentUser.id/username):面试官未指定时的默认值。
@@ -763,7 +844,7 @@ async function buildInterviewPlan(env, cache, args) {
763
844
  if (interviewerInput) {
764
845
  interviewerId = await resolvePersonId(host, fieldIdOf('interviewer'), interviewerInput);
765
846
  if (!interviewerId) {
766
- throw ehrValidationError('interviewer_not_found', `面试官「${interviewerInput}」解析不到 userId(browser/complete/resource 无匹配)`);
847
+ throw ehrValidationError('interviewer_not_found', `面试官「${interviewerInput}」在人员库中查不到(可能姓名写错、不在本租户,或不是在职人员)`);
767
848
  }
768
849
  }
769
850
  else {
@@ -814,7 +895,7 @@ async function buildInterviewPlan(env, cache, args) {
814
895
  throw ehrValidationError('email_invalid', `候选人邮箱格式不正确:${email}`);
815
896
  }
816
897
  }
817
- const window = defaultInterviewWindow();
898
+ const window = defaultInterviewWindow(isAI);
818
899
  const start = typeof args.startTime === 'string' && args.startTime.trim() ? args.startTime.trim() : window.start;
819
900
  const end = typeof args.endTime === 'string' && args.endTime.trim() ? args.endTime.trim() : window.end;
820
901
  if (!/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(start) || !/^\d{4}-\d{2}-\d{2} \d{2}:\d{2}$/.test(end)) {
@@ -840,6 +921,7 @@ async function buildInterviewPlan(env, cache, args) {
840
921
  candidateName: candidate.name,
841
922
  positionName: candidate.positionName,
842
923
  interviewTime: `${start} ~ ${end}`,
924
+ timeFieldIds: { start: fieldIdOf('start_time'), end: fieldIdOf('end_time') },
843
925
  interviewer,
844
926
  email: email || undefined,
845
927
  mobile: mobile || undefined,
@@ -918,13 +1000,34 @@ const interviewArrangeApply = {
918
1000
  capability: 'recruit',
919
1001
  risk: WRITE,
920
1002
  requiresConfirmation: true,
921
- inputSchema: schemaOf({ ...interviewArrangeSchema, confirm: { const: true }, continuation: { type: 'string', minLength: 1 } }, { required: ['talentId', 'interviewer', 'confirm', 'continuation'] }),
1003
+ inputSchema: schemaOf({ ...interviewArrangeSchema, confirm: { const: true }, continuation: { type: 'string', minLength: 1 } },
1004
+ // 业务参数(talentId/interviewer)已由 prepare 签进 continuation,apply 只需两项;
1005
+ // 显式传仍作数(与快照比对,用于防偷改)。
1006
+ { required: ['confirm', 'continuation'] }),
922
1007
  handler: async (args, env) => {
923
1008
  requireConfirm(args, 'ehr.recruit.candidate.interview.arrange.apply');
924
1009
  const lease = await verifyLease(args, 'ehr.recruit.candidate.interview.arrange.apply', env);
925
1010
  const payload = (lease.payload || {});
926
1011
  const cache = await requireRecruitCache(env);
1012
+ // 🔴 默认时间漂移修复(2026-11-07 实测):不加 startTime/endTime 时,prepare 与 apply 各自
1013
+ // 按「当前时刻 +1h」重算,两次执行必然差几分钟 → 指纹必然不一致 → apply 恒报 target_changed,
1014
+ // 真实「看摘要→确认→apply」流程根本无法完成。这里在调用方未显式传时间时复用 prepare 快照。
1015
+ const explicitTime = args.startTime !== undefined || args.endTime !== undefined;
927
1016
  const plan = await buildInterviewPlan(env, cache, args);
1017
+ if (!explicitTime && Array.isArray(payload.dataDetails) && payload.dataDetails.length) {
1018
+ const snap = payload.dataDetails;
1019
+ plan.dataDetails = snap;
1020
+ // 复用快照时同步修正输出时间:否则落库用快照时间、输出仍显示 apply 时刻重算的时间
1021
+ // (实测 2026-11-07:落库 14:44、apply 输出 14:46,差 2 分钟,Agent 会把错的时间回给用户)
1022
+ const pick = (fid) => {
1023
+ const hit = snap.find((d) => String(d?.formField?.id || '') === fid);
1024
+ return typeof hit?.content === 'string' ? hit.content : null;
1025
+ };
1026
+ const s = pick(plan.timeFieldIds.start);
1027
+ const e = pick(plan.timeFieldIds.end);
1028
+ if (s && e)
1029
+ plan.interviewTime = `${s} ~ ${e}`;
1030
+ }
928
1031
  if (fingerprint({ dataDetails: plan.dataDetails, notify: args.notify === true }) !== lease.fingerprint) {
929
1032
  throw ehrValidationError('target_changed', '输入与 prepare 时的快照不一致(候选人/面试官/时间等被修改),请重新执行 prepare');
930
1033
  }
@@ -980,13 +1083,25 @@ const interviewArrangeApply = {
980
1083
  return ehrSuccess('ehr.recruit.candidate.interview.arrange.apply', {
981
1084
  status: 'COMPLETE',
982
1085
  interviewFormId: planFormId,
1086
+ // 🔴 两入口产出不同质,必须显式标注(2026-11-07 实测):本入口只做「建面试单 + assignedInterview」,
1087
+ // 额外动作仅在 notify=true 时补跑「新建日程」esb;**不**执行页面那一整串按钮动作流。
1088
+ // 而 ehr.recruit.stage.interview.arrange.apply 会无条件跑 prepare 侧解析到的全部 saveActions
1089
+ // (含「新建EB日程」「安排面试后续动作API」「AI面试时发送提醒」等)。要完整页面效果就用 stage 入口。
1090
+ sideEffects: {
1091
+ executesFormButtonActions: false,
1092
+ onlyAction: 'assignedInterview',
1093
+ scheduleCreation: notify ? 'runEsb:新建日程' : 'skipped(notify=false)',
1094
+ },
1095
+ consistencyNote: '本入口写入的面试单不触发页面按钮动作流(无「新建EB日程/AI面试提醒/后续动作」);'
1096
+ + '落库的「状态(union_status)」也不由本入口设置。若需要与页面手工「安排面试」完全一致的副作用,'
1097
+ + '请改用 ehr.recruit.stage.interview.arrange.prepare/apply,并在摘要里核对 saveActions 列表。',
983
1098
  notify: notifyResult,
984
1099
  assigned: assigned?.data || {},
985
1100
  candidate: `${plan.candidateName}(talentId=${args.talentId})`,
986
1101
  time: plan.interviewTime,
987
1102
  interviewer: plan.interviewer,
988
1103
  talentCardUrl: recruitTalentCardUrl(cache, lease.baseUrl, args.talentId),
989
- interviewLocateUrl: recruitSlideLocateUrl(cache, lease.baseUrl, 'interview', 'interview_plan', planFormId),
1104
+ interviewLocateUrl: recruitOpenListUrl(cache, lease.baseUrl, 'interview'),
990
1105
  });
991
1106
  },
992
1107
  };
@@ -1034,6 +1149,9 @@ async function resolveOfferTemplate(host, cache, templateName) {
1034
1149
  const allData = (await host.request({
1035
1150
  path: '/api/ebuilder/form/dataset/v2/getAllData',
1036
1151
  body: { datajson: { header: { objId: mouldObjId }, mainTable: {}, pageInfo: { pageNo: 1, pageSize: 200 } } },
1152
+ // EB OpenAPI 族顶层无 code/status(message.code 为 "0"),跳过通用业务判定;
1153
+ // 是否成功由下面读取 `data.datajson.datas` 的调用方按数据自身判断。
1154
+ skipBusinessCheck: true,
1037
1155
  }));
1038
1156
  const datas = allData?.data?.datajson?.datas || [];
1039
1157
  const hit = datas.find((item) => {
@@ -1162,7 +1280,7 @@ const offerSendApply = {
1162
1280
  capability: 'recruit',
1163
1281
  risk: WRITE,
1164
1282
  requiresConfirmation: true,
1165
- inputSchema: schemaOf({ ...offerSendSchema, confirm: { const: true }, continuation: { type: 'string', minLength: 1 } }, { required: ['talentId', 'confirm', 'continuation'] }),
1283
+ inputSchema: schemaOf({ ...offerSendSchema, confirm: { const: true }, continuation: { type: 'string', minLength: 1 } }, { required: ['confirm', 'continuation'] }),
1166
1284
  handler: async (args, env) => {
1167
1285
  requireConfirm(args, 'ehr.recruit.offer.send.apply');
1168
1286
  const lease = await verifyLease(args, 'ehr.recruit.offer.send.apply', env);
@@ -1439,7 +1557,7 @@ const entryProcessApply = {
1439
1557
  capability: 'recruit',
1440
1558
  risk: WRITE,
1441
1559
  requiresConfirmation: true,
1442
- inputSchema: schemaOf({ ...entryProcessSchema, confirm: { const: true }, continuation: { type: 'string', minLength: 1 } }, { required: ['talentId', 'departmentId', 'positionRankId', 'confirm', 'continuation'] }),
1560
+ inputSchema: schemaOf({ ...entryProcessSchema, confirm: { const: true }, continuation: { type: 'string', minLength: 1 } }, { required: ['confirm', 'continuation'] }),
1443
1561
  handler: async (args, env) => {
1444
1562
  requireConfirm(args, 'ehr.recruit.entry.process.apply');
1445
1563
  const lease = await verifyLease(args, 'ehr.recruit.entry.process.apply', env);
@@ -1674,7 +1792,7 @@ const feedbackEditApply = {
1674
1792
  capability: 'recruit',
1675
1793
  risk: WRITE,
1676
1794
  requiresConfirmation: true,
1677
- inputSchema: schemaOf({ ...feedbackEditSchema, confirm: { const: true }, continuation: { type: 'string', minLength: 1 } }, { required: ['talentId', 'confirm', 'continuation'] }),
1795
+ inputSchema: schemaOf({ ...feedbackEditSchema, confirm: { const: true }, continuation: { type: 'string', minLength: 1 } }, { required: ['confirm', 'continuation'] }),
1678
1796
  handler: async (args, env) => {
1679
1797
  requireConfirm(args, 'ehr.recruit.candidate.interview.feedback.edit.apply');
1680
1798
  const lease = await verifyLease(args, 'ehr.recruit.candidate.interview.feedback.edit.apply', env);
@@ -1854,7 +1972,7 @@ const feedbackUrgeApply = {
1854
1972
  capability: 'recruit',
1855
1973
  risk: WRITE,
1856
1974
  requiresConfirmation: true,
1857
- inputSchema: schemaOf({ ...feedbackUrgeSchema, confirm: { const: true }, continuation: { type: 'string', minLength: 1 } }, { required: ['talentId', 'confirm', 'continuation'] }),
1975
+ inputSchema: schemaOf({ ...feedbackUrgeSchema, confirm: { const: true }, continuation: { type: 'string', minLength: 1 } }, { required: ['confirm', 'continuation'] }),
1858
1976
  handler: async (args, env) => {
1859
1977
  requireConfirm(args, 'ehr.recruit.candidate.interview.feedback.urge.apply');
1860
1978
  const lease = await verifyLease(args, 'ehr.recruit.candidate.interview.feedback.urge.apply', env);