weaver-work-cli 0.1.71 → 0.1.73

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 (140) hide show
  1. package/dist/chunks/{archive-5P33NAUN.js → archive-THZV4ND4.js} +2 -2
  2. package/dist/chunks/{archive-oa-YTY5D7DG.js → archive-oa-PQ23OLEV.js} +2 -2
  3. package/dist/chunks/{asset-3Q5MFQBX.js → asset-RGPROZYH.js} +2 -2
  4. package/dist/chunks/{asset-idle-PQPNYIS7.js → asset-idle-Z2PDX7NA.js} +2 -2
  5. package/dist/chunks/{attachment-content-7CN7JB6B.js → attachment-content-R3RPVOYE.js} +3 -3
  6. package/dist/chunks/{blog-MFHHK6ZR.js → blog-7U3QZPIF.js} +2 -2
  7. package/dist/chunks/{caizhilian-OZ435AYW.js → caizhilian-3AB42GCV.js} +4 -4
  8. package/dist/chunks/{calendar-TNJXS5UC.js → calendar-KINM64E4.js} +2 -2
  9. package/dist/chunks/{chunk-VMVMEIL3.js → chunk-2CHGUYMG.js} +4 -4
  10. package/dist/chunks/{chunk-G7ZM2VOX.js → chunk-2XED2FKY.js} +34 -34
  11. package/dist/chunks/{chunk-SKWKCLJX.js → chunk-4BXR6CNB.js} +2 -2
  12. package/dist/chunks/{chunk-EJLP63UO.js → chunk-4I26YMBY.js} +1 -1
  13. package/dist/chunks/{chunk-OFCF23FY.js → chunk-4YXAK6OA.js} +15 -4
  14. package/dist/chunks/{chunk-6MMSLE6K.js → chunk-54ST55IJ.js} +5 -1
  15. package/dist/chunks/{chunk-SSS75WXW.js → chunk-6HT73VOI.js} +2 -2
  16. package/dist/chunks/{chunk-XLSJC6JZ.js → chunk-7QFVXP2X.js} +6 -6
  17. package/dist/chunks/{chunk-SUWR5QEG.js → chunk-AMAPQVBT.js} +1 -0
  18. package/dist/chunks/{chunk-ICNUOWLL.js → chunk-BWYVS62Z.js} +4 -4
  19. package/dist/chunks/{chunk-UPVAQJKS.js → chunk-DRUND2PJ.js} +130 -79
  20. package/dist/chunks/{chunk-Q3EXRNB4.js → chunk-F4HM25K4.js} +1 -1
  21. package/dist/chunks/{chunk-P3AFNAJ6.js → chunk-GAMGDNTF.js} +1 -1
  22. package/dist/chunks/{chunk-2DNCKZRX.js → chunk-GWJLAF6B.js} +2 -2
  23. package/dist/chunks/{chunk-VJWVB55R.js → chunk-IBSJJGXL.js} +2 -2
  24. package/dist/chunks/{chunk-MZVQKQP5.js → chunk-ICP53R52.js} +4 -4
  25. package/dist/chunks/{chunk-DRJYPXKC.js → chunk-IU6UB2TD.js} +1 -1
  26. package/dist/chunks/{chunk-OZ7CJC7W.js → chunk-JMJBPP4B.js} +2 -2
  27. package/dist/chunks/{chunk-B4NINGP2.js → chunk-L7TYG5SN.js} +2 -2
  28. package/dist/chunks/{chunk-FRMDHZSN.js → chunk-LLCMOZ5L.js} +11 -11
  29. package/dist/chunks/{chunk-YN5SD4TX.js → chunk-NUP4RYZK.js} +2 -2
  30. package/dist/chunks/{chunk-OPTJ6IF7.js → chunk-PAFOLIYQ.js} +1 -1
  31. package/dist/chunks/{chunk-GB2MCJPG.js → chunk-R3MK2RBN.js} +1 -1
  32. package/dist/chunks/{chunk-X2C5CGGM.js → chunk-TV46Q4NY.js} +50 -50
  33. package/dist/chunks/{chunk-LU2SPJYY.js → chunk-XZBYRYWX.js} +2 -2
  34. package/dist/chunks/{chunk-MD5RXRI3.js → chunk-ZWLWXHJC.js} +2 -2
  35. package/dist/chunks/{conflict-Y4PXZ2YQ.js → conflict-VPAR7E6F.js} +2 -2
  36. package/dist/chunks/{contract-C3BGUMBM.js → contract-DDXAO2DZ.js} +2 -2
  37. package/dist/chunks/{cowork-2AWG4QLA.js → cowork-34QCHMDD.js} +2 -2
  38. package/dist/chunks/{create-flow-LOUOK46Z.js → create-flow-52PU2OBI.js} +6 -6
  39. package/dist/chunks/{data-BSFYMXVO.js → data-CLQ62QGD.js} +2 -2
  40. package/dist/chunks/{ebuilder-form-LAAMTD2Y.js → ebuilder-form-W5R7Q22S.js} +3 -3
  41. package/dist/chunks/{ehr-36KEX5SH.js → ehr-LCNAVMK5.js} +7 -6
  42. package/dist/chunks/{entry-mode-6N2IGCS4.js → entry-mode-6Z3ZV3DE.js} +3 -3
  43. package/dist/chunks/{env-QYLS3EB3.js → env-RDKWAARB.js} +2 -2
  44. package/dist/chunks/{esb-PTYS3E67.js → esb-ANKPUU65.js} +4 -4
  45. package/dist/chunks/{factory-LPFPKZ4T.js → factory-434B7RAT.js} +1 -1
  46. package/dist/chunks/{fna-JNHCLRDE.js → fna-AKBSG5HI.js} +2 -2
  47. package/dist/chunks/{group-chat-QP2WX4QJ.js → group-chat-PROTW22R.js} +3 -3
  48. package/dist/chunks/{host-7BVR7CQ3.js → host-5R2SNFWD.js} +3 -3
  49. package/dist/chunks/{host-57LSRSE7.js → host-7FJW4E7R.js} +3 -3
  50. package/dist/chunks/{host-K2ZKNXME.js → host-CGXUFQO4.js} +3 -3
  51. package/dist/chunks/{host-NS36QFLR.js → host-PDJAKCT7.js} +3 -3
  52. package/dist/chunks/{host-C2BLBIID.js → host-WO4L5G5I.js} +3 -3
  53. package/dist/chunks/{host-QXFKQXNX.js → host-XIYG4F4B.js} +3 -3
  54. package/dist/chunks/{hrm-FSGO4NSH.js → hrm-WGODDTEH.js} +3 -3
  55. package/dist/chunks/{im-2BFGS2XO.js → im-YKTKAJU3.js} +3 -3
  56. package/dist/chunks/{invoice-JKLTTHSZ.js → invoice-PVYCCCVM.js} +3 -3
  57. package/dist/chunks/{jiuchuanhui-PTABJE7V.js → jiuchuanhui-RKOQW7BY.js} +3 -3
  58. package/dist/chunks/{lazy-dispatch-YN2ZP3CS.js → lazy-dispatch-DW45AFQ5.js} +5 -5
  59. package/dist/chunks/{mail-YNO7ZZUK.js → mail-BNB5S4NW.js} +2 -2
  60. package/dist/chunks/{meeting-NIDHDBCB.js → meeting-O2KDJH66.js} +13 -13
  61. package/dist/chunks/{minute-doc-G3QAT7DE.js → minute-doc-JUCG56GY.js} +4 -4
  62. package/dist/chunks/{okr-QC52G6AJ.js → okr-LWFGWOE7.js} +2 -2
  63. package/dist/chunks/{operations-MQV32ITT.js → operations-532PN5OB.js} +4 -4
  64. package/dist/chunks/{performance-3MQ3AHDQ.js → performance-7W5COCFU.js} +2 -2
  65. package/dist/chunks/{plan-ISINIEPY.js → plan-ZVY3IYTL.js} +2 -2
  66. package/dist/chunks/{project-IJ6DVKT7.js → project-SA62B7MH.js} +2 -2
  67. package/dist/chunks/{reception-3H5LUG2I.js → reception-NGIONPQ3.js} +113 -44
  68. package/dist/chunks/{recruit-stage-MIOJXP6W.js → recruit-stage-WOSN6MGP.js} +868 -128
  69. package/dist/chunks/{registry-NHHKOEU3.js → registry-N7P3W2RD.js} +4 -4
  70. package/dist/chunks/{registry-3S7AVMXR.js → registry-R72GWXOG.js} +3 -3
  71. package/dist/chunks/{registry-3GQRYP2R.js → registry-RIQ67ZT7.js} +12 -12
  72. package/dist/chunks/{room-recommend-IOKBJVYP.js → room-recommend-KCGIVUFR.js} +4 -4
  73. package/dist/chunks/{schedule-IB6EUARH.js → schedule-6UP27HQ4.js} +4 -4
  74. package/dist/chunks/{smart-extract-N2TK3CEF.js → smart-extract-DDOQSPRB.js} +3 -3
  75. package/dist/chunks/{workflow-RINBAL2M.js → workflow-V5ALD6QZ.js} +5 -5
  76. package/dist/core/output.js +4 -0
  77. package/dist/index.js +34 -34
  78. package/dist/shortcuts/ehr/operations/recruit-position.js +4 -3
  79. package/dist/shortcuts/ehr/operations/recruit-short-cache.js +6 -2
  80. package/dist/shortcuts/ehr/operations/recruit-write.js +3 -3
  81. package/dist/shortcuts/ehr/operations/recruit.js +206 -82
  82. package/dist/shortcuts/ehr/operations/shared.js +31 -0
  83. package/dist/shortcuts/reception/constants.js +22 -0
  84. package/dist/shortcuts/reception/index.js +4 -0
  85. package/dist/shortcuts/reception/manifest.js +15 -1
  86. package/dist/shortcuts/reception/operations/doc.js +24 -11
  87. package/dist/shortcuts/reception/operations/docrender.js +18 -1
  88. package/dist/shortcuts/reception/operations/render-assets.js +93 -22
  89. package/dist/shortcuts/recruit-stage/context.js +12 -6
  90. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +19 -10
  91. package/dist/shortcuts/recruit-stage/operations/jd-create.js +454 -22
  92. package/dist/shortcuts/recruit-stage/operations/list.js +72 -1
  93. package/dist/shortcuts/recruit-stage/operations/profile.js +13 -5
  94. package/dist/shortcuts/recruit-stage/operations/registry.js +18 -2
  95. package/dist/shortcuts/recruit-stage/operations/resume-import.js +192 -26
  96. package/dist/shortcuts/recruit-stage/operations/search.js +78 -14
  97. package/dist/shortcuts/recruit-stage/operations/shortlist.js +122 -0
  98. package/dist/shortcuts/recruit-stage/shared.js +147 -3
  99. package/dist/shortcuts/workflow/operations/form.js +36 -2
  100. package/package.json +1 -1
  101. package/skills/weaver-e10-jucailin/SKILL.md +7 -3
  102. package/skills/weaver-e10-jucailin/references/recruit-output-links.md +33 -0
  103. package/skills/weaver-e10-jucailin/references/recruit-write.md +2 -0
  104. package/skills/weaver-e10-reception-flow/SKILL.md +97 -41
  105. package/skills/weaver-e10-reception-flow/references/guide.md +3 -1
  106. package/skills/weaver-e10-recruit-stage/SKILL.md +499 -122
  107. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +67 -44
  108. package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +279 -0
  109. package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +198 -0
  110. package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +697 -0
  111. package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +159 -11
  112. package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +2 -2
  113. package/skills/weaver-e10-recruit-stage/references/position-templates.md +19 -18
  114. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +19 -18
  115. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +1 -1
  116. package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +1 -1
  117. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +15 -2
  118. package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +37 -0
  119. package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +4 -4
  120. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +62 -33
  121. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +43 -2
  122. package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +41 -0
  123. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +4 -4
  124. package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +2 -2
  125. package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +25 -7
  126. package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +51 -0
  127. package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +63 -0
  128. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +4 -4
  129. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +2 -2
  130. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +58 -33
  131. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +4 -4
  132. package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +5 -5
  133. package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +2 -2
  134. package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +10 -10
  135. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +2 -2
  136. package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
  137. package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +106 -0
  138. package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +325 -0
  139. package/skills/weaver-e10-recruit-stage/templates/match-report.html +161 -73
  140. package/skills/weaver-e10-jucailin/references/source-manifest.json +0 -152
@@ -27,6 +27,69 @@ const TYPES = {
27
27
  * 未命中则回退 `cache.lists.interview`,不因缺列表而报错。
28
28
  */
29
29
  const FEEDBACK_TODO_MENU_NAMES = ['我的面试', '我的面试安排', '我参与的面试'];
30
+ /**
31
+ * 面试「参与方式」解析 —— 按面试方式取对应字段,不要笼统当成"地点"。
32
+ *
33
+ * 🔴 2026-11-28 用户口径:**只有现场面试才有地点**;视频面试是视频链接/会议号,
34
+ * AI 面试是小程序码,这三类在面试表单里是**三个不同字段**:
35
+ * · 现场面试 → `interview_location`(面试地点)
36
+ * · 视频面试 → `video_url_info` / `meeting_vedio` / `meeting_id`(视频链接/会议号)
37
+ * · AI 面试 → `applet_code`(小程序码)
38
+ * 旧实现统一叫"地点",视频/AI 面试永远给不出有意义的值。
39
+ *
40
+ * ⚠️ 这些字段默认**不在列表 displayData 里**(只有姓名/手机/时间等基础列),
41
+ * 需在 E10 后台把对应列加入「面试管理」列表显示配置,列表才带得回来。
42
+ * 取不到时返回 value=null + note 说明原因,**不静默当成"没有"**,避免调用方误判。
43
+ */
44
+ export function participationOf(r) {
45
+ const tp = String(r?.interview_type_key || r?.interview_type || '').trim();
46
+ const pick = (...keys) => {
47
+ for (const k of keys) {
48
+ const v = r?.[k];
49
+ if (v === undefined || v === null)
50
+ continue;
51
+ const s = String(v).trim();
52
+ if (s)
53
+ return { key: k, val: s };
54
+ }
55
+ return null;
56
+ };
57
+ if (/现场/.test(tp)) {
58
+ const got = pick('interview_location');
59
+ return {
60
+ mode: '现场面试',
61
+ field: 'interview_location',
62
+ value: got?.val ?? null,
63
+ ...(got ? {} : { note: '列表未返回面试地点;需在 E10 后台把「面试地点」加入面试管理列表显示列' }),
64
+ };
65
+ }
66
+ if (/AI\s*面试/i.test(tp)) {
67
+ const got = pick('applet_code');
68
+ return {
69
+ mode: 'AI面试',
70
+ field: 'applet_code',
71
+ value: got?.val ?? null,
72
+ ...(got ? {} : { note: 'AI 面试以小程序码/链接邀约,本身没有地点' }),
73
+ };
74
+ }
75
+ if (/视频/.test(tp)) {
76
+ const got = pick('video_url_info', 'meeting_vedio', 'meeting_id');
77
+ return {
78
+ mode: '视频面试',
79
+ field: got?.key ?? 'video_url_info',
80
+ value: got?.val ?? null,
81
+ ...(got ? {} : { note: '视频面试以视频链接/会议号邀约,本身没有地点' }),
82
+ };
83
+ }
84
+ // 电话面试或未填方式:仍按地点尝试,取不到就说明
85
+ const got = pick('interview_location');
86
+ return {
87
+ mode: tp || '未填面试方式',
88
+ field: 'interview_location',
89
+ value: got?.val ?? null,
90
+ ...(got ? {} : { note: '该面试方式未配置参与方式字段,或列表未返回' }),
91
+ };
92
+ }
30
93
  // 跨基线列名归一:只在主字段缺失时用别名补展示值,不覆盖已有值
31
94
  const DISPLAY_ALIASES = {
32
95
  candidate_name: ['talent_id', 'name'],
@@ -478,6 +541,11 @@ async function runList(env, args, feedbackTodoMode) {
478
541
  break;
479
542
  }
480
543
  }
544
+ // 🔴 面试类型补「参与方式」:现场=地点 / 视频=视频链接 / AI=小程序码。
545
+ // 用原始行 r 取值(displayData 默认不含这些列,取不到会带 note 说明)。
546
+ if (type === 'interview') {
547
+ row.participation = participationOf(r);
548
+ }
481
549
  outRows.push(row);
482
550
  }
483
551
  // feedbackTodo:从当前结果集派生两个待办视图
@@ -499,6 +567,8 @@ async function runList(env, args, feedbackTodoMode) {
499
567
  mobile: r.mobile,
500
568
  talent_id: r.talent_id,
501
569
  position_manage_id: r.position_manage_id,
570
+ // 参与方式按面试方式取值(现场=地点 / 视频=链接 / AI=小程序码),不要统一当"地点"
571
+ participation: participationOf(r),
502
572
  });
503
573
  // 服务端已按「待反馈 + 面试官=我」筛过则直接用;兜底路径才做客户端二次筛
504
574
  const pending = serverFilterApplied ? outRows : outRows.filter((r) => /待反馈/.test(st(r)));
@@ -693,6 +763,8 @@ async function runInterviewNotAttended(env, args) {
693
763
  // recruit-read.md);下游编排一律用 candidate_manage_id / form_data_id,故此处不透传 talent_id。
694
764
  candidate_manage_id: r.candidate_manage_id || null,
695
765
  form_data_id: r.form_data_id || null,
766
+ // 参与方式按面试方式取值(现场=地点 / 视频=链接 / AI=小程序码)
767
+ participation: participationOf(r),
696
768
  };
697
769
  };
698
770
  // 截断可见性(强制):面试列表服务端筛选不可用,只能翻页后客户端筛
@@ -726,7 +798,6 @@ async function runInterviewNotAttended(env, args) {
726
798
  rows: notAttended.map(slim),
727
799
  listUrl,
728
800
  listLocateLink: listUrl ? { title: '打开我发起的面试列表', url: listUrl } : null,
729
- agentNote: '产物 = 统计结论 + 一个 Markdown 链接(listLocateLink)。若技能「固定参数表」配置了本租户的固定页面路由,按 recruit-output-links.md 覆盖规则替换 path 段(origin 取自 listUrl);调用时直接传 listId 更稳。不输出半截链接。',
730
801
  note: notes.join(';'),
731
802
  };
732
803
  }
@@ -10,13 +10,17 @@ function makeDictLookup(cache) {
10
10
  return (id) => byId.get(String(id)) || '';
11
11
  }
12
12
  /** 从 dataDetails 提取展示值:dataOptions.content > dataText.content > content */
13
- function detailDisplayValue(d, dictName) {
13
+ export function detailDisplayValue(d, dictName) {
14
14
  if (!d)
15
15
  return '';
16
- // 关联/选择字段:dataOptions[0].content 是展示名
16
+ // 关联/选择字段:取全部 dataOptions 的 content 用逗号连接。
17
+ // 🔴 2026-11-28 修「多选字段丢值」:原实现只取 dataOptions[0],多选字段(多个标签/技能等)
18
+ // 在档案里只显示第一个,匹配度评估会漏信息;与 shared.ts 的取值口径对齐。
17
19
  if (Array.isArray(d.dataOptions) && d.dataOptions.length) {
18
- const o = d.dataOptions[0];
19
- return String(o?.content ?? o?.optionId ?? '');
20
+ const names = d.dataOptions.map((o) => String(o?.content ?? '')).filter(Boolean);
21
+ if (names.length)
22
+ return names.join(',');
23
+ return String(d.dataOptions[0]?.optionId ?? '');
20
24
  }
21
25
  // 长文本
22
26
  if (d.dataText?.content != null)
@@ -30,7 +34,11 @@ function detailDisplayValue(d, dictName) {
30
34
  }
31
35
  return '';
32
36
  }
33
- async function handlerProfile(args, env) {
37
+ /**
38
+ * 导出给 candidate.shortlist 复用(2026-11-28):批量匹配需要并发拉多份档案,
39
+ * 复用本 handler 可保证明细表归类 / 未归类告警 / 字段回退口径与单查完全一致。
40
+ */
41
+ export async function handlerProfile(args, env) {
34
42
  const host = env.host;
35
43
  const session = await host.getSession();
36
44
  const ctx = { host, baseUrl: session.baseUrl.replace(/\/+$/, ''), appId: '', cache: await env.recruitContext() };
@@ -7,9 +7,11 @@ import { listOperations } from './list.js';
7
7
  import { searchOperations } from './search.js';
8
8
  import { tagOperations } from './tag.js';
9
9
  import { profileOperations } from './profile.js';
10
+ import { shortlistOperations } from './shortlist.js';
10
11
  const definitions = [
11
12
  ...searchOperations,
12
13
  ...profileOperations,
14
+ ...shortlistOperations,
13
15
  ...listOperations,
14
16
  ...tagOperations,
15
17
  ...jdCreateOperations,
@@ -38,17 +40,31 @@ export function getRecruitStageOperation(operation) {
38
40
  }
39
41
  export async function executeRecruitStageOperation(operation, input, env) {
40
42
  const definition = getRecruitStageOperation(operation);
43
+ // debugTimings 是诊断开关(随回执返回 meta.timings),不属于业务参数,
44
+ // 不参与下面的「未知参数」校验,也不下发到业务 schema。
45
+ const debugTimings = input.debugTimings === true;
46
+ const validated = debugTimings
47
+ ? Object.fromEntries(Object.entries(input).filter(([k]) => k !== 'debugTimings'))
48
+ : input;
41
49
  // 拒绝未声明参数(2026-11-07):与 ehr 标准入口一致,防「参数名写错被静默忽略」。
42
50
  // 例:candidate.interview.arrange.* 的时间参数是 startTime/endTime,stage.interview.arrange.* 是 start/end,
43
51
  // 传错时摘要里的 time 会变成 null 而不报错。
44
52
  const schema = definition.inputSchema;
45
53
  if (schema && schema.additionalProperties === false) {
46
54
  const known = Object.keys((schema.properties || {}));
47
- const unknown = Object.keys(input || {}).filter((key) => !known.includes(key));
55
+ const unknown = Object.keys(validated || {}).filter((key) => !known.includes(key));
48
56
  if (unknown.length > 0) {
49
57
  throw new RecruitStageCliError('validation', 'unknown_argument', `未知参数:${unknown.join('、')}。本操作支持的参数:${known.length ? known.join('、') : '(无)'}。`
50
58
  + '参数名写错会被静默忽略并返回看似正常的结果,请按上面的参数名重传。', { exitCode: 1 });
51
59
  }
52
60
  }
53
- return definition.handler(input, env);
61
+ const startedAt = Date.now();
62
+ const result = await definition.handler(validated, env);
63
+ // 诊断耗时:默认不返回,避免污染正常输出;debugTimings:true 时随 meta.timings 返回。
64
+ // 分段打点由各操作往 env.__recruitTimings 写(可选),这里补全 totalMs。
65
+ if (debugTimings && result && typeof result === 'object') {
66
+ const marks = { ...(env?.__recruitTimings ?? {}) };
67
+ result.meta = { ...(result.meta ?? {}), timings: { ...marks, totalMs: Date.now() - startedAt } };
68
+ }
69
+ return result;
54
70
  }
@@ -134,7 +134,12 @@ function snapshotParsedResume(s) {
134
134
  * 因此超过阈值就不签入:apply 自动回退到 buildImport(多花几个请求,但保证可用)。
135
135
  * structured 已在 parsedResume 里单独签入,这里排除以免重复占体积。
136
136
  */
137
- const BUILT_SNAPSHOT_LIMIT = 48 * 1024;
137
+ // 🔴 2026-11-28 实测修正:原 48KB 阈值对真实简历偏小(fields 字段映射 + subMeta 明细表元数据
138
+ // + dataDetails + detailsPayload 很容易顶到边界),一旦超限就**静默**回退成全量 buildImport,
139
+ // 表现为「优化写了但没生效」,且无任何提示。写操作一律走 helper(参数与 token 均落文件,
140
+ // 不受 Windows 8191 字符命令上限约束),故放大到 512KB:helper 场景真正享受提速,
141
+ // 直调 CLI 内联传参的超限情况仍由闸门兜底回退,不会截断 token。
142
+ export const BUILT_SNAPSHOT_LIMIT = 512 * 1024;
138
143
  function snapshotBuilt(built) {
139
144
  if (!built || typeof built !== 'object')
140
145
  return undefined;
@@ -266,6 +271,12 @@ async function resolveSubTableMeta(ctx) {
266
271
  if (cfg.start && cfg.end && cfg.start.dataKey && cfg.end.dataKey) {
267
272
  col.startKey = String(cfg.start.dataKey);
268
273
  col.endKey = String(cfg.end.dataKey);
274
+ // form/core subForm 格子要用 start/end 的**物理 fieldId**(dataset 通道只需 dataKey);
275
+ // 见 references/recruit-resume-import.md「日期区间」表(study_date_0 → fieldId …709)
276
+ if (cfg.start.fieldId)
277
+ col.startFieldId = String(cfg.start.fieldId);
278
+ if (cfg.end.fieldId)
279
+ col.endFieldId = String(cfg.end.fieldId);
269
280
  }
270
281
  cols[String(cfg.dataKey)] = col;
271
282
  }
@@ -497,6 +508,126 @@ async function readTalentSnapshot(ctx, opts) {
497
508
  subRows[dk] = s.size;
498
509
  return { main, subRows, subCells };
499
510
  }
511
+ // 读人才记录最新乐观锁/布局/子表行 id(form/core 更新前置):
512
+ // updateTimeStamp 是并发覆盖保护;子表行 rowId 用于明细「原地覆盖」对位。
513
+ // 🔴 2026-11-27 实证:dataset v2 OpenAPI 对人才表单整体失明(detail/query 一律 0 行,
514
+ // updateFormData 报「没有符合更新条件的数据」;同环境面试/职位表 dataset 正常),
515
+ // 更新通道自此改走 form/core saveFormData(与面试反馈编辑同款样板)。
516
+ async function readTalentRecordMeta(ctx, opts) {
517
+ const L = await getFormLayoutMeta(ctx.host, opts.formId);
518
+ const r = await ctx.host.request({
519
+ path: '/api/ebuilder/form/form/core/getFormDataAndLayout', method: 'POST',
520
+ body: {
521
+ terminalType: 'PC', dataId: opts.dataId, formId: opts.formId, module: 'ebuilderform', newLayout: true,
522
+ layoutId: L?.formLayout?.id, layoutMultiId: L?.formLayoutMultiple?.id, dataCrossLayout: false,
523
+ permissionId: '', allReadOnly: true, initialDatas: [], dynamicData: false, cost: false,
524
+ customParam: { objId: opts.objId, dataId: opts.dataId },
525
+ },
526
+ });
527
+ const dets = r?.data?.formData?.dataDetails || [];
528
+ const rowIdsBySubForm = {};
529
+ for (const d of dets) {
530
+ if (!d.subFormId)
531
+ continue;
532
+ const sid = String(d.subFormId);
533
+ const idx = Number(d.dataIndex || 0);
534
+ if (idx < 1)
535
+ continue;
536
+ const arr = (rowIdsBySubForm[sid] = rowIdsBySubForm[sid] || []);
537
+ if (!arr[idx - 1])
538
+ arr[idx - 1] = String(d.rowId || '');
539
+ }
540
+ return {
541
+ updateTimeStamp: String(r?.data?.formData?.updateTimeStamp || ''),
542
+ formLayoutId: String(r?.data?.formLayout?.id || L?.formLayout?.id || ''),
543
+ rowIdsBySubForm,
544
+ };
545
+ }
546
+ // 门控调试(E10_RS_DEBUG_CELLS=1):stderr 输出明细格子构造实况(列类型/rowId 对位/行值),不影响 stdout 契约
547
+ function debugDumpSubCells(built, rowIdsBySubForm) {
548
+ for (const [dk, node] of Object.entries(built.detailNodes)) {
549
+ const sub = (built.subMeta || {})[dk];
550
+ const rows = (built.detailsPayload || {})[node] || [];
551
+ const sid = sub ? String(sub.subFormId) : '';
552
+ const oldIds = rowIdsBySubForm[sid] || [];
553
+ const cols = Object.entries(sub?.columns || {}).map(([k, c]) => `${k}:${c.type}@${c.id}${c.startKey ? `(s=${c.startKey},e=${c.endKey})` : ''}`).join(' | ');
554
+ console.error(`[debug-cells] ${dk} node=${node} subFormId=${sid} oldRows=${oldIds.length} newRows=${rows.length} cols=${cols}`);
555
+ rows.forEach((r, i) => console.error(`[debug-cells] row${i + 1} rowId=${oldIds[i] || ''} json=${JSON.stringify(r)}`));
556
+ }
557
+ }
558
+ // 日期列(col.type 含 Date:Date/DateRange 拆键列):E10 日期列只收完整 yyyy-MM-dd,
559
+ // 解析常给 yyyy-MM 或 yyyy → 补 01(实测 2026-11-27:yyyy-MM 直接丢格,教育经历 8 格只落 6 格)。
560
+ // 非日期值(如「至今」残留)返回 null → 不写,避免脏值。
561
+ export function normDateCell(colType, v) {
562
+ if (!/date/i.test(String(colType || '')))
563
+ return v;
564
+ const s = String(v || '').trim().replace(/\//g, '-');
565
+ // 完整日期也补零:E10 日期列只收 yyyy-MM-dd,'2023-9-1' 会被判非法值(静默丢格)
566
+ const m0 = s.match(/^(\d{4})-(\d{1,2})-(\d{1,2})$/);
567
+ if (m0)
568
+ return `${m0[1]}-${String(m0[2]).padStart(2, '0')}-${String(m0[3]).padStart(2, '0')}`;
569
+ const m = s.match(/^(\d{4})-(\d{1,2})$/);
570
+ if (m)
571
+ return `${m[1]}-${String(m[2]).padStart(2, '0')}-01`;
572
+ const y = s.match(/^(\d{4})$/);
573
+ if (y)
574
+ return `${y[1]}-01-01`;
575
+ return null;
576
+ }
577
+ // 明细 → form/core subForm 格子(页面编辑保存同款:一行一格一条 dataDetail)。
578
+ // rowId 对位旧行 = 原地覆盖;rowId 留空 = 追加(旧行不足时);旧行多于新行无法经此通道删除 → skippedOldRows 如实上报。
579
+ // 值形态:字典 id(6+ 位纯数字且在字典里能反查到名称)→ dataOptions 格子;其余 → content 文本格子(日期列先归一化)。
580
+ export function buildSubFormCells(built, rowIdsBySubForm, dictName) {
581
+ const cells = [];
582
+ const skippedOldRows = [];
583
+ const droppedCells = [];
584
+ if (process.env.E10_RS_DEBUG_CELLS === '1')
585
+ debugDumpSubCells(built, rowIdsBySubForm);
586
+ for (const [dk, node] of Object.entries(built.detailNodes)) {
587
+ const sub = (built.subMeta || {})[dk];
588
+ const rows = (built.detailsPayload || {})[node] || [];
589
+ if (!sub || !rows.length)
590
+ continue;
591
+ const sid = String(sub.subFormId);
592
+ const oldIds = rowIdsBySubForm[sid] || [];
593
+ // 列解析表:dataKey → {fieldId, date}。日期区间容器列的物理子键(xxx_0 / xxx_1)
594
+ // 在布局里**没有独立 column**,必须由容器的 startKey/endKey 映射到 startFieldId/endFieldId,
595
+ // 否则这些格子会被 `!col` 静默跳过(实测:教育经历 8 格只落 6 格,缺的正是起止日期)。
596
+ const keyMap = {};
597
+ for (const [ck0, c0] of Object.entries((sub.columns || {}))) {
598
+ if (c0?.id)
599
+ keyMap[ck0] = { fieldId: String(c0.id), date: /date/i.test(String(c0.type || '')) };
600
+ if (c0?.startKey && c0?.startFieldId)
601
+ keyMap[String(c0.startKey)] = { fieldId: String(c0.startFieldId), date: true };
602
+ if (c0?.endKey && c0?.endFieldId)
603
+ keyMap[String(c0.endKey)] = { fieldId: String(c0.endFieldId), date: true };
604
+ }
605
+ rows.forEach((row, i) => {
606
+ const rowId = i < oldIds.length ? (oldIds[i] || '') : '';
607
+ for (const [ck, v] of Object.entries(row)) {
608
+ const col = keyMap[ck];
609
+ if (!col) {
610
+ droppedCells.push(`${dk}#${i + 1}.${ck} 无对应列(布局未解析到 fieldId),已跳过`);
611
+ continue;
612
+ }
613
+ const sv = String(v ?? '');
614
+ const dateVal = col.date ? normDateCell('Date', sv) : sv;
615
+ if (dateVal === null) {
616
+ droppedCells.push(`${dk}#${i + 1}.${ck}「${sv}」非日期值,已跳过`);
617
+ continue;
618
+ }
619
+ const isOption = /^\d{6,}$/.test(sv) && !!dictName(sv);
620
+ cells.push(isOption
621
+ ? { dataIndex: i + 1, rowId, formField: { id: col.fieldId }, subForm: { id: sid }, dataOptions: [{ optionId: sv, content: dictName(sv) }] }
622
+ : { dataIndex: i + 1, rowId, formField: { id: col.fieldId }, subForm: { id: sid }, content: dateVal });
623
+ }
624
+ });
625
+ if (oldIds.length > rows.length) {
626
+ skippedOldRows.push(`${dk}:原表 ${oldIds.length} 行 > 本次解析 ${rows.length} 行,多出的旧行无法经本通道删除,需页面手工处理`);
627
+ }
628
+ }
629
+ return { cells, skippedOldRows, droppedCells };
630
+ }
500
631
  // ── 标签链路 ──
501
632
  // a) 触发后台「人才自动标签」规则匹配(talentId 走 query,body 为空)
502
633
  async function matchTalentLabel(host, talentId) {
@@ -970,6 +1101,19 @@ async function prepare(args, env, opts = {}) {
970
1101
  const fp = fingerprint(willSubmit);
971
1102
  const continuation = await env.continuation.issue({ operation: 'recruit-stage.resume.import.apply', fingerprint: fp,
972
1103
  enumMaps: await dsOptionsSnapshot(),
1104
+ // 🔴 2026-11-28 修复「提速失效」:新建模式此前**从未签入 built**(只有更新通道签了),
1105
+ // 导致 apply 每次都重跑 buildImport(~6 HTTP)与 findExistingTalents(2 HTTP),
1106
+ // 优化写了但完全没生效。现补上;同时把 prepare 的查重结果签入 dupCheck,
1107
+ // 让 apply 能据此决策:unique=true 才跳过 HTTP 查重,unique=false 直接拒绝写入。
1108
+ built: snapshotBuilt(built),
1109
+ dupCheck: {
1110
+ checked: dupInfo.checked,
1111
+ unique: dupInfo.unique,
1112
+ conflictCount: dupInfo.formConflicts.existing.length,
1113
+ unreadableCount: dupInfo.formConflicts.unreadable.length,
1114
+ byPhoneTalentId: dupInfo.byPhone?.talentId || null,
1115
+ byPhoneCandidateId: dupInfo.byPhone?.candidateId || null,
1116
+ },
973
1117
  // 🔴 2026-11-07 修复(同 arrange / jd.create / position.create 的同类缺陷):apply 只带
974
1118
  // confirm + continuation 时,buildImport 需要的简历来源参数必须能从快照恢复,
975
1119
  // 否则会报 resume_source_required(文档写法跑不通)。
@@ -1053,9 +1197,17 @@ async function applyCore(args, env, payload) {
1053
1197
  if (payload.fingerprint !== fingerprint(willSubmit)) {
1054
1198
  throw rsValidationError('fingerprint_mismatch', '待提交内容与 prepare 确认摘要不一致,请重新 prepare 确认后再 apply');
1055
1199
  }
1056
- await datasetUpdateFormData(host, {
1057
- objId: built.objId, dataId: updateTalentId, mainTable: upMain,
1058
- details: built.detailsPayload, coverDetails: Object.keys(built.detailsPayload),
1200
+ // 🔴 2026-11-27 更新通道改造:dataset v2 对人才表单失明(readTalentRecordMeta 注释有实证链),
1201
+ // 改走 form/core saveFormData 更新(formDataId + updateTimeStamp 乐观锁 + layoutId,feedback 同款),
1202
+ // 主表格子与明细 subForm 格子一次提交;明细 rowId 对位旧行实现原地覆盖。
1203
+ const fresh = await readTalentRecordMeta(ctx, { formId: built.formId, objId: built.objId, dataId: updateTalentId });
1204
+ const subCells = buildSubFormCells(built, fresh.rowIdsBySubForm, makeDictLookup(ctx.cache));
1205
+ const savedId = await saveFormData(ctx.host, {
1206
+ appId: ctx.appId, formId: built.formId, objId: built.objId,
1207
+ name: built.structured.candidateName || undefined,
1208
+ dataDetails: [...built.dataDetails, ...subCells.cells],
1209
+ rightType: '2', formDataId: updateTalentId,
1210
+ updateTimeStamp: fresh.updateTimeStamp || undefined, layoutId: fresh.formLayoutId || undefined,
1059
1211
  });
1060
1212
  // 可选头像:用户主动给图才写;失败只记在 avatar.warning,不并入 verifyWarnings(不改变 result)
1061
1213
  const avatarRes = await writeAvatarIfProvided(ctx, {
@@ -1077,16 +1229,17 @@ async function applyCore(args, env, payload) {
1077
1229
  return out;
1078
1230
  };
1079
1231
  let after = await readTalentSnapshot(ctx, { formId: built.formId, objId: built.objId, fields: built.fields, subMeta: built.subMeta, dataId: updateTalentId });
1080
- let verifyWarnings = checkAfter(after);
1232
+ let verifyWarnings = [...subCells.skippedOldRows, ...subCells.droppedCells, ...checkAfter(after)];
1081
1233
  if (verifyWarnings.length) {
1082
1234
  await new Promise((r) => setTimeout(r, 600));
1083
1235
  after = await readTalentSnapshot(ctx, { formId: built.formId, objId: built.objId, fields: built.fields, subMeta: built.subMeta, dataId: updateTalentId });
1084
- verifyWarnings = checkAfter(after);
1236
+ verifyWarnings = [...subCells.skippedOldRows, ...subCells.droppedCells, ...checkAfter(after)];
1085
1237
  }
1086
1238
  return rsSuccess('recruit-stage.resume.import.apply', {
1087
1239
  // 更新模式同理:明细行/格数对不上时只能报 partial,不能因主表写入成功就报 success
1088
1240
  mode: 'update', result: verifyWarnings.length ? 'partial' : 'success',
1089
1241
  detailsState: verifyWarnings.length ? 'missing' : 'complete',
1242
+ writeChannel: 'form/core saveFormData(formDataId+乐观锁;dataset v2 对人才表失明已弃用)',
1090
1243
  talentId: updateTalentId,
1091
1244
  afterSummary: { mainFieldCount: Object.keys(after.main).length, subRows: after.subRows, subCells: after.subCells },
1092
1245
  verifyWarnings: verifyWarnings.length ? verifyWarnings : undefined,
@@ -1099,8 +1252,30 @@ async function applyCore(args, env, payload) {
1099
1252
  });
1100
1253
  }
1101
1254
  // 新建模式:查重阻断
1102
- // 🔴 2026-11-27 优化:prepare 已查重且 unique=true,payload.built 存在时跳过重复查重(省 2 HTTP)
1103
- if (!payload.built) {
1255
+ // 🔴 2026-11-28:优先用 prepare 签入的 dupCheck 决策——
1256
+ // ① unique=false → 直接拒绝写入(防止「built 跳过查重」变成重复建档漏洞)
1257
+ // ② unique=true → 跳过 HTTP 查重(这才让原计划的提速真正生效)
1258
+ // ③ 旧 continuation(无 built / 无 dupCheck)→ 回退完整查重(兜底,行为与旧版一致)
1259
+ // 🔴 2026-11-28 补洞:只有 prepare **真的查过**(checked=true)才能用签入结论跳过查重。
1260
+ // findExistingTalents 的兜底结构是 { checked:false, unique:true }(没查过 = 当唯一),
1261
+ // 若网络/权限异常导致查重没执行,旧写法会把「没查过」当成「唯一」→ 跳过查重 → 重复建档。
1262
+ const signedDup = (payload.built && payload.dupCheck && payload.dupCheck.checked === true) ? payload.dupCheck : null;
1263
+ if (signedDup && signedDup.unique === false) {
1264
+ const hasBatch = !!(signedDup.byPhoneCandidateId || signedDup.byPhoneTalentId);
1265
+ return rsSuccess('recruit-stage.resume.import.apply', {
1266
+ mode: 'apply', result: 'duplicate',
1267
+ message: hasBatch
1268
+ ? '当前手机号已绑定人才信息,按页面规则不新建(未写入任何数据)'
1269
+ : '手机号在人才库已存在(表单唯一性命中,但无应聘批次),不新建(未写入任何数据)',
1270
+ existingTalent: hasBatch ? {
1271
+ talentId: signedDup.byPhoneTalentId || '',
1272
+ candidateId: signedDup.byPhoneCandidateId || '',
1273
+ } : undefined,
1274
+ parsed: { name: built.structured.candidateName, mobile: built.structured.telephone },
1275
+ nextStep: '如需按这份简历更新该人才,明确说明即可(updateTalentId 走更新通道)',
1276
+ });
1277
+ }
1278
+ if (!signedDup) {
1104
1279
  const dupInfo = await findExistingTalents(ctx, { objId: built.objId, formId: built.formId, fields: built.fields, mobile: built.structured.telephone });
1105
1280
  if (dupInfo.byPhone?.candidateId || dupInfo.byPhone?.talentId) {
1106
1281
  const b = dupInfo.byPhone;
@@ -1126,8 +1301,10 @@ async function applyCore(args, env, payload) {
1126
1301
  if (!dupInfo.unique && dupInfo.formConflicts.unreadable.length) {
1127
1302
  throw rsFail('手机号被 ' + dupInfo.formConflicts.unreadable.length + ' 条已删除记录占用(平台唯一性校验仍拦新建,id=' + dupInfo.formConflicts.unreadable.join(',') + '):请先在回收站清理,或改为更新已有人才');
1128
1303
  }
1129
- } // end if (!payload.built) — 跳过查重
1130
- // 建人才:① 首选数据集通道(主表+明细一次写入);② 被拦时回退页面级主表 + 数据集 update 补明细
1304
+ } // end if (!signedDup) — 无签入结果时才走完整查重(兜底)
1305
+ // 建人才:① 首选数据集通道(主表+明细一次写入);② 被拦时回退页面级通道——
1306
+ // 主表+明细 subForm 格子并入同一次 form/core saveFormData(新建记录明细为空 → rowId 留空=追加)。
1307
+ // 🔴 2026-11-27:回退段原「dataset update 补明细」对人才表单失效(数据集失明,实证见 readTalentRecordMeta 注释),弃用。
1131
1308
  mark('apply.查重完成');
1132
1309
  const datasetMain = toDatasetMainTable(built.dataDetails, built.fields);
1133
1310
  let newId = '';
@@ -1139,18 +1316,11 @@ async function applyCore(args, env, payload) {
1139
1316
  writeChannel = 'dataset/v2/saveFormData(主表 + 明细一次写入)';
1140
1317
  }
1141
1318
  catch (e) {
1142
- writeWarnings.push('数据集新增未通过(' + e.message + '),改为建主表后用数据集 update 补明细');
1143
- newId = await saveFormData(host, { appId: ctx.appId, formId: built.formId, objId: built.objId, name: built.structured.candidateName || '简历导入', dataDetails: built.dataDetails });
1144
- writeChannel = 'form/core/saveFormData(主表)+ dataset/v2/updateFormData(明细)';
1145
- if (Object.keys(built.detailsPayload).length) {
1146
- try {
1147
- // 新建记录的明细必然为空 → 走「追加」即可。不用 cover:实测 cover 会重建整行,把 EBuilder(关联)列清空。
1148
- await datasetUpdateFormData(host, { objId: built.objId, dataId: newId, mainTable: {}, details: built.detailsPayload });
1149
- }
1150
- catch (e2) {
1151
- writeWarnings.push('回退后补明细失败:' + e2.message);
1152
- }
1153
- }
1319
+ writeWarnings.push('数据集新增未通过(' + e.message + '),回退页面级通道:主表+明细一次写入');
1320
+ const subCells = buildSubFormCells(built, {}, makeDictLookup(ctx.cache));
1321
+ newId = await saveFormData(host, { appId: ctx.appId, formId: built.formId, objId: built.objId, name: built.structured.candidateName || '简历导入', dataDetails: [...built.dataDetails, ...subCells.cells] });
1322
+ writeChannel = 'form/core/saveFormData(主表 + 明细 subForm 一次写入)';
1323
+ writeWarnings.push(...subCells.droppedCells);
1154
1324
  }
1155
1325
  mark('apply.saveFormData');
1156
1326
  const r2 = await host.request({ path: '/api/recruit/candidate/initTalentBatch?formDataId=' + newId, method: 'POST' });
@@ -1279,7 +1449,6 @@ async function applyCore(args, env, payload) {
1279
1449
  // 产物链接(Agent 原样搬运:① 人才卡片单页 ② 人才库列表;缺失哪个只给另一个)
1280
1450
  viewLink: talentCardUrl ? `[查看 ${built.structured.candidateName || '新人才'} 的人才卡片](${talentCardUrl})` : null,
1281
1451
  listLocateLink: talentListLocateUrl ? `[打开人才库列表](${talentListLocateUrl})` : null,
1282
- agentNote: '正文给两个 Markdown 链接——① [查看 <姓名> 的人才卡片](talentCardUrl) 详情单页 ② [打开人才库列表](talentListLocateUrl) 只打开列表、不打开详情;缺失哪个就只给另一个,不输出半截。不要用 artifact / browsertool。',
1283
1452
  parsed: {
1284
1453
  name: built.structured.candidateName, mobile: built.structured.telephone, email: built.structured.email || '(空)',
1285
1454
  gender: built.structured.genderName, degree: built.structured.highest_degree_name, college: built.structured.college,
@@ -1523,9 +1692,6 @@ async function batchApply(args, env) {
1523
1692
  skippedTotal: blockedAtPrepare + skipped,
1524
1693
  items: results,
1525
1694
  resultTable: lines.join('\n'),
1526
- agentNote: '把 resultTable 原样放回答正文。汇总必须说全四类:成功 / 部分成功 / 跳过(重复,不新建)/ 失败;'
1527
- + '跳过数 = skippedAtPrepare(准备阶段查重)+ skipped(建档时发现重复);'
1528
- + '失败或部分成功要带 message 原因,不要只报总数。末尾附「人才库」固定地址一个链接。',
1529
1695
  });
1530
1696
  }
1531
1697
  export const resumeImportOperations = [