weaver-work-cli 0.1.45 → 0.1.47

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 (129) hide show
  1. package/dist/chunks/{attachment-content-CE3GMWTS.js → attachment-content-MCXQBD6N.js} +3 -3
  2. package/dist/chunks/{chunk-VIMCY4DI.js → chunk-4RWS2YYL.js} +2 -2
  3. package/dist/chunks/{chunk-4EXOIQDI.js → chunk-6AXKWFKG.js} +4 -14
  4. package/dist/chunks/{chunk-JWWTI63L.js → chunk-6V5ZPKHV.js} +2 -8
  5. package/dist/chunks/{chunk-3ZMAQQ3W.js → chunk-76H3IKH6.js} +39 -26
  6. package/dist/chunks/{chunk-LGKWL4OH.js → chunk-AD46OMQK.js} +86 -25
  7. package/dist/chunks/{chunk-3WBIQLMB.js → chunk-GSZTA43P.js} +2 -2
  8. package/dist/chunks/{chunk-OAE3AZBQ.js → chunk-IP4CWQCF.js} +6 -6
  9. package/dist/chunks/{chunk-77YP6I52.js → chunk-IRMIEDXN.js} +1 -1
  10. package/dist/chunks/{chunk-LRCPNDZA.js → chunk-J2VEB5K3.js} +11 -9
  11. package/dist/chunks/{chunk-T4MWQAQB.js → chunk-JFAWZX53.js} +128 -9
  12. package/dist/chunks/{chunk-GR76ZDDX.js → chunk-LIEQJIGM.js} +3 -0
  13. package/dist/chunks/{chunk-DGMYACGJ.js → chunk-OXHHJWNC.js} +1 -1
  14. package/dist/chunks/{chunk-LXFVWZLM.js → chunk-PSOMGA3U.js} +3 -3
  15. package/dist/chunks/{conflict-IYJETSGT.js → conflict-H7EHQXYY.js} +2 -2
  16. package/dist/chunks/{create-flow-7JLC7UID.js → create-flow-VRVJEOBX.js} +6 -6
  17. package/dist/chunks/{ehr-MYRDCHZ4.js → ehr-SH2LM3NK.js} +528 -40
  18. package/dist/chunks/{env-3MBHAWBL.js → env-66FPSJDV.js} +2 -2
  19. package/dist/chunks/{factory-TZEVU4DU.js → factory-UH2TZBVA.js} +1 -1
  20. package/dist/chunks/{group-chat-KL3HFKRM.js → group-chat-CAKMMV7K.js} +3 -3
  21. package/dist/chunks/{invoice-OQP3TMKQ.js → invoice-UEAHSYAE.js} +279 -1
  22. package/dist/chunks/{lazy-dispatch-UH6HGK2I.js → lazy-dispatch-25XGTXLM.js} +2 -2
  23. package/dist/chunks/{meeting-C67EHQ4Z.js → meeting-VTBFW4HI.js} +10 -10
  24. package/dist/chunks/{recruit-stage-AHY5QAMF.js → recruit-stage-CAKZTUA7.js} +917 -85
  25. package/dist/chunks/{registry-XPWPGHYE.js → registry-JVQBLFQ5.js} +10 -10
  26. package/dist/chunks/{room-recommend-CNWE5WQK.js → room-recommend-5U55FMXZ.js} +4 -4
  27. package/dist/chunks/{schedule-YYNYBQIE.js → schedule-IDETODCA.js} +4 -4
  28. package/dist/cmd/action.js +14 -10
  29. package/dist/index.js +7 -7
  30. package/dist/shortcuts/ehr/host.js +2 -2
  31. package/dist/shortcuts/ehr/index.js +14 -3
  32. package/dist/shortcuts/ehr/manifest.js +5 -1
  33. package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +40 -10
  34. package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +258 -0
  35. package/dist/shortcuts/ehr/operations/recruit-position.js +10 -8
  36. package/dist/shortcuts/ehr/operations/recruit-stats.js +14 -1
  37. package/dist/shortcuts/ehr/operations/recruit-tag.js +173 -0
  38. package/dist/shortcuts/ehr/operations/recruit-write.js +137 -18
  39. package/dist/shortcuts/ehr/operations/recruit.js +180 -8
  40. package/dist/shortcuts/ehr/operations/registry.js +4 -0
  41. package/dist/shortcuts/ehr/operations.js +24 -0
  42. package/dist/shortcuts/ehr/recruit-stage/batch-store.js +78 -0
  43. package/dist/shortcuts/ehr/recruit-stage/context.js +231 -0
  44. package/dist/shortcuts/ehr/recruit-stage/continuation.js +74 -0
  45. package/dist/shortcuts/ehr/recruit-stage/errors.js +65 -0
  46. package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +165 -0
  47. package/dist/shortcuts/ehr/recruit-stage/host.js +109 -0
  48. package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +1049 -0
  49. package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +295 -0
  50. package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +961 -0
  51. package/dist/shortcuts/ehr/recruit-stage/operations/list.js +431 -0
  52. package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +50 -0
  53. package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +1647 -0
  54. package/dist/shortcuts/ehr/recruit-stage/operations/search.js +158 -0
  55. package/dist/shortcuts/ehr/recruit-stage/operations/types.js +34 -0
  56. package/dist/shortcuts/ehr/recruit-stage/runtime.js +31 -0
  57. package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +318 -0
  58. package/dist/shortcuts/ehr/recruit-stage/shared.js +805 -0
  59. package/dist/shortcuts/invoice/host.js +3 -0
  60. package/dist/shortcuts/invoice/manifest.js +61 -0
  61. package/dist/shortcuts/invoice/operations/registry.js +2 -0
  62. package/dist/shortcuts/invoice/operations/reim-subsidy.js +233 -0
  63. package/dist/shortcuts/meeting/operations/eb/create-flow.js +93 -18
  64. package/dist/shortcuts/meeting/operations/eb/factory.js +5 -8
  65. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +2 -13
  66. package/dist/shortcuts/meeting/operations/invitation.js +27 -4
  67. package/dist/shortcuts/recruit-stage/batch-store.js +78 -0
  68. package/dist/shortcuts/recruit-stage/fs-scan.js +165 -0
  69. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +277 -20
  70. package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +31 -7
  71. package/dist/shortcuts/recruit-stage/operations/jd-create.js +106 -16
  72. package/dist/shortcuts/recruit-stage/operations/registry.js +12 -0
  73. package/dist/shortcuts/recruit-stage/operations/resume-import.js +273 -6
  74. package/dist/shortcuts/recruit-stage/operations/types.js +9 -0
  75. package/dist/shortcuts/recruit-stage/shared.js +60 -6
  76. package/docs/invoice.md +1 -0
  77. package/package.json +1 -1
  78. package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +2 -2
  79. package/skills/weaver-e10-jucailin/SKILL.md +12 -3
  80. package/skills/weaver-e10-jucailin/archive/LEGACY-README.md +18 -0
  81. package/skills/weaver-e10-jucailin/archive/LEGACY-SKILL.md +239 -0
  82. package/skills/weaver-e10-jucailin/archive/LEGACY-openai.yaml +131 -0
  83. package/skills/weaver-e10-jucailin/archive/LEGACY-position-templates.md +221 -0
  84. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +334 -0
  85. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +127 -0
  86. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +65 -0
  87. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +63 -0
  88. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +142 -0
  89. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +114 -0
  90. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +56 -0
  91. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +101 -0
  92. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +148 -0
  93. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +77 -0
  94. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +72 -0
  95. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +69 -0
  96. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +241 -0
  97. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +457 -0
  98. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +128 -0
  99. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +146 -0
  100. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +69 -0
  101. package/skills/weaver-e10-jucailin/lib/recruit-xiaoe-file.mjs +192 -0
  102. package/skills/weaver-e10-jucailin/lib/xiaoe-session.mjs +66 -0
  103. package/skills/weaver-e10-jucailin/references/recruit-create.md +19 -93
  104. package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +64 -0
  105. package/skills/weaver-e10-jucailin/references/recruit-read.md +63 -1
  106. package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +95 -0
  107. package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +89 -0
  108. package/skills/weaver-e10-jucailin/references/recruit-tag.md +81 -0
  109. package/skills/weaver-e10-jucailin/references/recruit-write.md +53 -9
  110. package/skills/weaver-e10-meeting/SKILL.md +48 -4
  111. package/skills/weaver-e10-meeting/references/meeting-eb.md +1 -1
  112. package/skills/weaver-e10-recruit-stage/SKILL.md +8 -5
  113. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +16 -6
  114. package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +5 -1
  115. package/skills/weaver-e10-recruit-stage/references/position-templates.md +20 -1
  116. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +21 -0
  117. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +4 -0
  118. package/skills/weaver-e10-yepiaotong/SKILL.md +7 -5
  119. package/skills/weaver-e10-yepiaotong/references/invoice-import.md +1 -1
  120. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +9 -2
  121. package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +2 -0
  122. package/skills/weaver-e10-yepiaotong/references/invoice-validation-preview.md +2 -0
  123. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +68 -6
  124. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +3 -3
  125. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +8 -15
  126. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +6 -5
  127. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +206 -92
  128. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +26 -21
  129. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +35 -0
@@ -4,16 +4,16 @@ import {
4
4
  getMeetingOperation,
5
5
  hasMeetingOperation,
6
6
  meetingOperationDefinitions
7
- } from "./chunk-3ZMAQQ3W.js";
8
- import "./chunk-OAE3AZBQ.js";
9
- import "./chunk-LGKWL4OH.js";
10
- import "./chunk-4EXOIQDI.js";
11
- import "./chunk-VIMCY4DI.js";
12
- import "./chunk-DGMYACGJ.js";
13
- import "./chunk-LXFVWZLM.js";
14
- import "./chunk-3WBIQLMB.js";
15
- import "./chunk-77YP6I52.js";
16
- import "./chunk-JWWTI63L.js";
7
+ } from "./chunk-76H3IKH6.js";
8
+ import "./chunk-IP4CWQCF.js";
9
+ import "./chunk-AD46OMQK.js";
10
+ import "./chunk-6AXKWFKG.js";
11
+ import "./chunk-4RWS2YYL.js";
12
+ import "./chunk-OXHHJWNC.js";
13
+ import "./chunk-PSOMGA3U.js";
14
+ import "./chunk-GSZTA43P.js";
15
+ import "./chunk-IRMIEDXN.js";
16
+ import "./chunk-6V5ZPKHV.js";
17
17
  import "./chunk-7BDPM5ST.js";
18
18
  import "./chunk-UG5G54VL.js";
19
19
  import "./chunk-BUSC6UAE.js";
@@ -7,10 +7,10 @@ import {
7
7
  loadRooms,
8
8
  recommendRooms,
9
9
  rememberFrequentRoom
10
- } from "./chunk-4EXOIQDI.js";
11
- import "./chunk-DGMYACGJ.js";
12
- import "./chunk-77YP6I52.js";
13
- import "./chunk-JWWTI63L.js";
10
+ } from "./chunk-6AXKWFKG.js";
11
+ import "./chunk-OXHHJWNC.js";
12
+ import "./chunk-IRMIEDXN.js";
13
+ import "./chunk-6V5ZPKHV.js";
14
14
  import "./chunk-7BDPM5ST.js";
15
15
  import "./chunk-UG5G54VL.js";
16
16
  import "./chunk-BUSC6UAE.js";
@@ -8,10 +8,10 @@ import {
8
8
  resolveMeetingScheduleTypeIds,
9
9
  resolveMemberIdsByName,
10
10
  runScheduleConflictFlow
11
- } from "./chunk-VIMCY4DI.js";
12
- import "./chunk-DGMYACGJ.js";
13
- import "./chunk-77YP6I52.js";
14
- import "./chunk-JWWTI63L.js";
11
+ } from "./chunk-4RWS2YYL.js";
12
+ import "./chunk-OXHHJWNC.js";
13
+ import "./chunk-IRMIEDXN.js";
14
+ import "./chunk-6V5ZPKHV.js";
15
15
  import "./chunk-7BDPM5ST.js";
16
16
  import "./chunk-UG5G54VL.js";
17
17
  import "./chunk-BUSC6UAE.js";
@@ -90,20 +90,24 @@ export function createAction(ctx) {
90
90
  }
91
91
  catch (error) {
92
92
  await commandCtx.hooks.onError(commandCtx, error);
93
- // 平台型连接器(千问办公等)要求 stderr 有统一的 {"code":"E-XXXX","message":"…"}。
94
- // 这里**只追加一行**,既有的错误消息与退出码一律不变。
95
- if (shouldReportPlatformError(error)) {
96
- process.stderr.write(JSON.stringify(toPlatformError(error)) + '\n');
97
- }
98
93
  if (commandCtx.getGlobalOptions().json) {
99
- console.error(JSON.stringify({
100
- schemaVersion: 1,
101
- ok: false,
102
- error: toErrorEnvelope(error),
103
- }, null, 2));
94
+ // --json:stderr 只写一个 JSON 对象,顶层带平台型连接器要求的 code/message。
95
+ // 之前先写平台错误行再写完整信封,两段 JSON 相连 → 一次 JSON.parse 必报 Extra data。
96
+ const env = { schemaVersion: 1, ok: false, error: toErrorEnvelope(error) };
97
+ if (shouldReportPlatformError(error)) {
98
+ const pe = toPlatformError(error);
99
+ env.code = pe.code;
100
+ env.message = pe.message;
101
+ }
102
+ console.error(JSON.stringify(env, null, 2));
104
103
  process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
105
104
  return;
106
105
  }
106
+ // 平台型连接器(千问办公等)要求 stderr 有统一的 {"code":"E-XXXX","message":"…"}。
107
+ // 非 --json 模式仍单独追加一行,既有的错误消息与退出码一律不变。
108
+ if (shouldReportPlatformError(error)) {
109
+ process.stderr.write(JSON.stringify(toPlatformError(error)) + '\n');
110
+ }
107
111
  if (isCliError(error)) {
108
112
  commandCtx.logger.error(error.message);
109
113
  process.exitCode = error.exitCode;
package/dist/index.js CHANGED
@@ -7,9 +7,9 @@ import {
7
7
  firstPositionalToken,
8
8
  registerCommands,
9
9
  toCommandMetadata
10
- } from "./chunks/chunk-LRCPNDZA.js";
10
+ } from "./chunks/chunk-J2VEB5K3.js";
11
11
  import "./chunks/chunk-727FH2NI.js";
12
- import "./chunks/chunk-GR76ZDDX.js";
12
+ import "./chunks/chunk-LIEQJIGM.js";
13
13
  import "./chunks/chunk-AJ62BGAW.js";
14
14
  import "./chunks/chunk-6N4JPNFL.js";
15
15
  import "./chunks/chunk-6NXT4ICB.js";
@@ -30,7 +30,7 @@ function lazyShortcut(definition) {
30
30
  placeholder.allowExcessArguments(true);
31
31
  placeholder.helpOption(false);
32
32
  placeholder.action(async () => {
33
- const { dispatchLazyShortcut } = await import("./chunks/lazy-dispatch-UH6HGK2I.js");
33
+ const { dispatchLazyShortcut } = await import("./chunks/lazy-dispatch-25XGTXLM.js");
34
34
  await dispatchLazyShortcut(definition, shortcutMetadata());
35
35
  });
36
36
  }
@@ -40,17 +40,17 @@ var builtinShortcuts = [
40
40
  lazyShortcut({
41
41
  name: "invoice",
42
42
  description: "E10 \u4E1A\u7968\u901A\u53D1\u7968\u7BA1\u7406 CLI",
43
- load: async () => (await import("./chunks/invoice-OQP3TMKQ.js")).invoiceShortcut
43
+ load: async () => (await import("./chunks/invoice-UEAHSYAE.js")).invoiceShortcut
44
44
  }),
45
45
  lazyShortcut({
46
46
  name: "ehr",
47
47
  description: "\u6CDB\u5FAEE10\u805A\u624D\u6797\uFF08\u4EBA\u4E8B/\u51FA\u52E4/\u85AA\u916C\uFF09CLI",
48
- load: async () => (await import("./chunks/ehr-MYRDCHZ4.js")).ehrShortcut
48
+ load: async () => (await import("./chunks/ehr-SH2LM3NK.js")).ehrShortcut
49
49
  }),
50
50
  lazyShortcut({
51
51
  name: "recruit-stage",
52
52
  description: "\u6CDB\u5FAEE10\u62DB\u8058\u52A9\u624B\uFF08JD\u751F\u6210/\u7B80\u5386\u5EFA\u6863/AI\u9762\u8BD5\u9080\u7EA6\uFF09CLI",
53
- load: async () => (await import("./chunks/recruit-stage-AHY5QAMF.js")).recruitStageShortcut
53
+ load: async () => (await import("./chunks/recruit-stage-CAKZTUA7.js")).recruitStageShortcut
54
54
  }),
55
55
  lazyShortcut({
56
56
  name: "cowork",
@@ -90,7 +90,7 @@ var builtinShortcuts = [
90
90
  lazyShortcut({
91
91
  name: "meeting",
92
92
  description: "\u6CDB\u5FAEE10\u4F1A\u8BAE\u7BA1\u7406 CLI\uFF08\u6807\u51C6\u7248\uFF1A\u67E5\u8BE2/\u51B2\u7A81/\u9884\u7EA6/\u56DE\u6267/\u7B7E\u5230\uFF09",
93
- load: async () => (await import("./chunks/meeting-C67EHQ4Z.js")).meetingShortcut
93
+ load: async () => (await import("./chunks/meeting-VTBFW4HI.js")).meetingShortcut
94
94
  }),
95
95
  lazyShortcut({
96
96
  name: "okr",
@@ -145,7 +145,7 @@ export function createEhrHost(ctx, dependencies = {}) {
145
145
  });
146
146
  }
147
147
  async function request(request) {
148
- const { method, path, query, body, operation, form, multipart, headers: extraHeaders = {}, timeoutMs = 30_000, } = request;
148
+ const { method, path, query, body, operation, form, multipart, headers: extraHeaders = {}, timeoutMs = 30_000, skipBusinessCheck = false, } = request;
149
149
  assertPath(path);
150
150
  const resolvedMethod = method || (body === undefined && form === undefined && multipart === undefined ? 'GET' : 'POST');
151
151
  let response;
@@ -197,7 +197,7 @@ export function createEhrHost(ctx, dependencies = {}) {
197
197
  exitCode: 1,
198
198
  });
199
199
  }
200
- if (!isBusinessSuccess(response.value)) {
200
+ if (!skipBusinessCheck && !isBusinessSuccess(response.value)) {
201
201
  throw new EhrCliError('api', 'business_error', businessMessage(response.value), {
202
202
  code: businessCode(response.value),
203
203
  details: { code: businessCode(response.value), message: businessMessage(response.value) },
@@ -1,6 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
3
- import { reportPlatformError } from '../../core/error-codes.js';
3
+ import { shouldReportPlatformError, toPlatformError } from '../../core/error-codes.js';
4
4
  import { createEhrContinuationSigner } from './continuation.js';
5
5
  import { createEhrHost } from './host.js';
6
6
  import { ehrManifest } from './manifest.js';
@@ -82,6 +82,8 @@ function failureEnvelope(error) {
82
82
  }
83
83
  async function executeAndPrint(ctx, operation, input) {
84
84
  try {
85
+ // 招聘助手能力已并入本模块:operation 名 `ehr.recruit.stage.*` 走其专用运行时,
86
+ // 其余走 ehr 标准运行时。两者 envelope 同构,输出格式统一。
85
87
  const result = await executeEhrOperation(operation, input, {
86
88
  ctx,
87
89
  host: createEhrHost(ctx),
@@ -90,8 +92,17 @@ async function executeAndPrint(ctx, operation, input) {
90
92
  ctx.output.write(successEnvelope(operation, result), { json: true });
91
93
  }
92
94
  catch (error) {
93
- reportPlatformError(error);
94
- console.error(JSON.stringify(failureEnvelope(error), null, 2));
95
+ // stderr 只写一个 JSON 对象:既满足平台型连接器「顶层必有 code/message」的契约,
96
+ // 又保证整段 stderr 可被一次 JSON.parse 解析(此前先写平台错误行再写完整信封,
97
+ // 两段 JSON 相连导致解析必然报 Extra data)。
98
+ const env = failureEnvelope(error);
99
+ if (shouldReportPlatformError(error)) {
100
+ const pe = toPlatformError(error);
101
+ console.error(JSON.stringify({ ...env, code: pe.code, message: pe.message }, null, 2));
102
+ }
103
+ else {
104
+ console.error(JSON.stringify(env, null, 2));
105
+ }
95
106
  process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
96
107
  }
97
108
  }
@@ -12,7 +12,7 @@ const RECRUIT_WITHHELD = [
12
12
  /** 移动端考勤打卡:Agent 无法获取真实定位/WiFi/设备凭证,服务端必拒,严禁伪造参数。 */
13
13
  const MOBILE_CARD_WITHHELD = ['attend.card.sign.mobile'];
14
14
  function buildOperations() {
15
- return ehrOperationDefinitions().map((definition) => ({
15
+ const standard = ehrOperationDefinitions().map((definition) => ({
16
16
  name: definition.name,
17
17
  resource: definition.resource,
18
18
  summary: definition.summary,
@@ -21,6 +21,10 @@ function buildOperations() {
21
21
  ...(definition.requiresConfirmation ? { requiresConfirmation: true } : {}),
22
22
  inputSchema: definition.inputSchema,
23
23
  }));
24
+ // 招聘助手(JD 生成 / 简历建档 / AI 面试邀约)已恢复为独立 CLI 模块 `recruit-stage`(2026-11-07),
25
+ // 其 17 个能力不再并入 ehr,避免两边同时暴露造成 Agent 选择重叠。
26
+ // 代码保留在 ./recruit-stage/ 下(未删除),如需切回只恢复本行合并与 index.ts 分流即可。
27
+ return standard;
24
28
  }
25
29
  export const ehrManifest = {
26
30
  schemaVersion: 1,
@@ -4,7 +4,7 @@ import { readFile, stat } from 'node:fs/promises';
4
4
  import { basename } from 'node:path';
5
5
  import { ehrConfirmationError, ehrPartialError, ehrValidationError } from '../errors.js';
6
6
  import { WRITE, ehrSuccess, schemaOf, } from './types.js';
7
- import { checkDuplicateByMobile } from './recruit-write.js';
7
+ import { checkDuplicateByMobile, getDsOptions } from './recruit-write.js';
8
8
  /**
9
9
  * 简历导入建人才:主表 + 6 张明细 + 原件附件 + 人才批次 + 平台标签 + 双链接。
10
10
  *
@@ -186,7 +186,15 @@ export function normalizeImportDates(input, warnings) {
186
186
  }
187
187
  if (Array.isArray(input.academicInformations)) {
188
188
  input.academicInformations.forEach((r, i) => {
189
- if (!r || typeof r !== 'object' || r.study_date === undefined)
189
+ if (!r || typeof r !== 'object')
190
+ return;
191
+ // start_date / end_date 也会落到明细列 study_date_0 / study_date_1,
192
+ // 同样必须归一(实测漏掉这条会让整批 saveFormData 报「不满足 yyyy-MM-dd」)。
193
+ if (r.start_date !== undefined && r.start_date !== null)
194
+ r.start_date = one(`academicInformations[${i}].start_date`, r.start_date, false);
195
+ if (r.end_date !== undefined && r.end_date !== null)
196
+ r.end_date = one(`academicInformations[${i}].end_date`, r.end_date, true);
197
+ if (r.study_date === undefined)
190
198
  return;
191
199
  const before = String(r.study_date ?? '').trim();
192
200
  if (!before)
@@ -338,15 +346,19 @@ function buildSubDetails(structured, meta, nodeOfTable, resolveDict) {
338
346
  if (!value)
339
347
  continue;
340
348
  }
341
- // 日期区间:一个组件对应两个物理列,必须拆成 startKey / endKey 两键提交
349
+ // 日期区间:一个组件对应两个物理列,必须拆成 startKey / endKey 两键提交。
350
+ // 只传了起始(end 为空,如「至今」「在职」被归一为空)时只写 startKey——不能整列丢弃,
351
+ // 否则在职中的工作经历日期会全空(实测就是这个表现)。
342
352
  if (column.startKey && column.endKey) {
343
353
  const parts = Array.isArray(value) ? value : String(value).split(/[,~]/);
344
354
  const start = String(parts[0] ?? '').trim();
345
355
  const end = String(parts[1] ?? '').trim();
346
- if (!start || !end)
356
+ if (!start && !end)
347
357
  continue;
348
- out[column.startKey] = start;
349
- out[column.endKey] = end;
358
+ if (start)
359
+ out[column.startKey] = start;
360
+ if (end)
361
+ out[column.endKey] = end;
350
362
  continue;
351
363
  }
352
364
  out[colKey] = String(value);
@@ -387,6 +399,10 @@ async function datasetSaveFormData(env, objId, mainTable, details) {
387
399
  },
388
400
  },
389
401
  operation: 'ehr.recruit.candidate.import.apply',
402
+ // EB OpenAPI 族(dataset/v2/*)顶层没有 code/status,业务结果在
403
+ // `data.datajson.status` + `data.datajson.message`,且外层 `message.code` 恒为 "0"。
404
+ // 交给下面的 `ok` 判定按 datajson 自查,不走通用业务判定。
405
+ skipBusinessCheck: true,
390
406
  }));
391
407
  const datajson = response?.data?.datajson || {};
392
408
  const code = response?.message?.code;
@@ -659,11 +675,16 @@ async function buildImportPlan(env, cache, args) {
659
675
  main.channel = id;
660
676
  }
661
677
  }
662
- // 黑名单默认「否」(选项 id 运行时反查)
678
+ // 黑名单默认「否」:必须读**该字段自己的**枚举(common/ds/options),
679
+ // 不能查全局 dict.by_name——实测「否」不在全局字典索引里(is_blacklist 的选项
680
+ // 只挂在字段级 option 上),按全局查会误报「字典中不存在」并跳过不写。
663
681
  if (fields.is_blacklist) {
664
- const noId = resolveDict('否', '黑名单');
682
+ const opts = await getDsOptions(env.host, objId, fields.is_blacklist, '').catch(() => ({}));
683
+ const noId = opts['否'];
665
684
  if (noId)
666
- main.is_blacklist = noId;
685
+ main.is_blacklist = String(noId);
686
+ else
687
+ warnings.push('黑名单字段未取到「否」选项,该字段留空(由系统默认值兜底)');
667
688
  }
668
689
  // 明细表:getTableMapping 解析 detailN,再按布局列构建行
669
690
  let subStats = {};
@@ -674,6 +695,10 @@ async function buildImportPlan(env, cache, args) {
674
695
  path: `/api/ebuilder/form/dataset/v1/getTableMapping?objId=${encodeURIComponent(objId)}`,
675
696
  method: 'GET',
676
697
  operation: 'ehr.recruit.candidate.import.prepare',
698
+ // EB OpenAPI 族成功标识在 `data` 里(顶层 message.code 是 "0"),
699
+ // 走通用业务判定会被误判成 business_error,导致「明细表未写入」。
700
+ // 真正的判据交给下面的 `mapping.mainTable` 断言。
701
+ skipBusinessCheck: true,
677
702
  }));
678
703
  const mapping = mappingResponse?.data;
679
704
  if (!mapping?.mainTable)
@@ -873,7 +898,12 @@ const candidateImportApply = {
873
898
  throw ehrValidationError('context_mismatch', '确认上下文已变化(租户或登录账号不同),请重新执行 prepare');
874
899
  }
875
900
  const payload = lease.payload || {};
876
- if (payload.candidateName !== str(args.candidateName) || payload.telephone !== str(args.telephone)) {
901
+ // 🔴 2026-11-07 修复(同 jd.create / position.create 的同类缺陷):candidateName/telephone 本来就在 payload 里,
902
+ // 但 apply 只从 args 取——「只带 confirm + continuation」时拿到空串,随后与 payload 比对必然报 target_changed。
903
+ // 改为 args 优先、缺失时回退 payload;比对保留,用于发现显式传了不同值的偷改。
904
+ const candidateName = str(args.candidateName) || str(payload.candidateName);
905
+ const telephone = str(args.telephone) || str(payload.telephone);
906
+ if (payload.candidateName !== candidateName || payload.telephone !== telephone) {
877
907
  throw ehrValidationError('target_changed', '姓名或手机号与 prepare 时不一致,请重新执行 prepare');
878
908
  }
879
909
  const cache = await requireCache(env);
@@ -0,0 +1,258 @@
1
+ import { READ, ehrSuccess, schemaOf, } from './types.js';
2
+ import { ehrValidationError } from '../errors.js';
3
+ import { buildListBody, fetchListRows, namesOf, LIST_TYPES } from './recruit.js';
4
+ /**
5
+ * 面试进展全局汇总(只读)。
6
+ *
7
+ * 需求来源:系统只给单条面试提醒,HR 要自己进页面逐条看候选人是否确认/完成,缺全局视图。
8
+ *
9
+ * 关键实测前提(2026-11-07):
10
+ * 1. `candidate.list type=interview` 的 total 是 168784,**不可能全量扫描**;
11
+ * 2. 该列表按 `start_time` **倒序**返回(页1 11-29→11-09,页2 11-05,页3 11-03,页4 11-02),
12
+ * 因此按时间窗扫描时,一旦读到早于窗口下界的行即可停止,无需翻到底;
13
+ * 3. 服务端把 `pageSize` 压到 **10 条/页**(传 100 也只回 10),所以必须逐页递增;
14
+ * 4. 行内 `union_status` 枚举实测:`未开始` / `待查看` / `待反馈` / `已反馈`。
15
+ *
16
+ * 诚实约束:只有「按倒序扫到窗口下界」才算该窗口完整;达到 maxPages 上限仍未扫到下界时,
17
+ * 必须标 `truncated:true` 并在 note 里说明"可能仍有未覆盖记录",不得当作全量交付。
18
+ */
19
+ const STATUS_KEYS = ['未开始', '待查看', '待反馈', '已反馈'];
20
+ /** 需要 HR 主动处理的两种状态(待反馈=面试已完成等评价;待查看=需 HR 确认/跟进) */
21
+ const ACTION_STATUSES = ['待反馈', '待查看'];
22
+ const DEFAULT_DAYS = 7;
23
+ /** 本环境实测每天约 100 场面试,7 天 ≈ 700 条 ≈ 70 页;默认留到 100 页把 7 天窗口扫完 */
24
+ const DEFAULT_MAX_PAGES = 100;
25
+ const SERVER_PAGE_SIZE = 10;
26
+ function ymd(d) {
27
+ const y = d.getFullYear();
28
+ const m = String(d.getMonth() + 1).padStart(2, '0');
29
+ const day = String(d.getDate()).padStart(2, '0');
30
+ return `${y}-${m}-${day}`;
31
+ }
32
+ function parseYmd(v, field) {
33
+ if (typeof v !== 'string' || !/^\d{4}-\d{2}-\d{2}$/.test(v)) {
34
+ if (v === undefined || v === null)
35
+ return null;
36
+ throw ehrValidationError('invalid_date', `${field} 格式必须是 YYYY-MM-DD`);
37
+ }
38
+ const d = new Date(`${v}T00:00:00`);
39
+ if (Number.isNaN(d.getTime()))
40
+ throw ehrValidationError('invalid_date', `${field} 不是有效日期`);
41
+ return v;
42
+ }
43
+ /** `start_time` 形如 "2026-11-29 10:00";同格式字符串可直接按字典序比较时间。 */
44
+ function normalizeStartTime(v) {
45
+ if (v === undefined || v === null)
46
+ return null;
47
+ const s = String(v).trim();
48
+ if (!s)
49
+ return null;
50
+ // 兼容 "YYYY-MM-DD HH:mm" 与 "YYYY-MM-DD"
51
+ const m = s.match(/^(\d{4}-\d{2}-\d{2})(?:\s+(\d{2}:\d{2}))?/);
52
+ if (!m)
53
+ return null;
54
+ return `${m[1]} ${m[2] || '00:00'}`;
55
+ }
56
+ async function listInterviewPage(env, params) {
57
+ const body = buildListBody({
58
+ listId: params.listId,
59
+ cusMenuId: params.cusMenuId,
60
+ menuName: params.menuName,
61
+ title: LIST_TYPES.interview.title,
62
+ current: params.current,
63
+ pageSize: SERVER_PAGE_SIZE,
64
+ });
65
+ // 复用 candidate.list 的读取通道:displayData 优先、原始层兜底、total 三态降级都在里面,
66
+ // 自己另写一套响应解析会漏掉 displayData 分支(行字段就取不到 union_status)。
67
+ const { rows, total } = await fetchListRows(env.host, params.objId, params.listId, body);
68
+ return { rows, total };
69
+ }
70
+ async function interviewOverview(args, env) {
71
+ if (!env.recruitContext) {
72
+ throw ehrValidationError('recruit_context_unavailable', '招聘上下文加载器未初始化');
73
+ }
74
+ // ---- 时间窗 ----
75
+ const today = new Date();
76
+ const endDate = parseYmd(args.endDate, 'endDate') ?? ymd(today);
77
+ let startDate = parseYmd(args.startDate, 'startDate');
78
+ if (!startDate) {
79
+ const daysRaw = Number(args.days ?? DEFAULT_DAYS);
80
+ if (!Number.isFinite(daysRaw) || daysRaw < 1) {
81
+ throw ehrValidationError('invalid_days', 'days 必须是 ≥1 的整数');
82
+ }
83
+ const days = Math.trunc(daysRaw);
84
+ const s = new Date(`${endDate}T00:00:00`);
85
+ s.setDate(s.getDate() - (days - 1));
86
+ startDate = ymd(s);
87
+ }
88
+ if (startDate > endDate) {
89
+ throw ehrValidationError('invalid_range', 'startDate 不能晚于 endDate');
90
+ }
91
+ const windowStart = `${startDate} 00:00`;
92
+ const windowEnd = `${endDate} 23:59`;
93
+ const maxPagesRaw = Number(args.maxPages ?? DEFAULT_MAX_PAGES);
94
+ const maxPages = Number.isFinite(maxPagesRaw) && maxPagesRaw >= 1 ? Math.trunc(maxPagesRaw) : DEFAULT_MAX_PAGES;
95
+ const includeRows = args.includeRows !== false;
96
+ // 注意:CLI 输出层有 24KB 预算,超了会把每个数组逐档压到 10/5/2/1 条(core/output.ts COMPACT_TIERS)。
97
+ // 所以明细默认只给「待跟进」的少量,想全量看请用 candidate.list 翻页或收窄窗口,别指望 rows 承载几百条。
98
+ const rowLimitRaw = Number(args.rowLimit ?? 20);
99
+ const rowLimit = Number.isFinite(rowLimitRaw) && rowLimitRaw >= 1 ? Math.trunc(rowLimitRaw) : 20;
100
+ const interviewerLimitRaw = Number(args.interviewerLimit ?? 10);
101
+ const interviewerLimit = Number.isFinite(interviewerLimitRaw) && interviewerLimitRaw >= 1 ? Math.trunc(interviewerLimitRaw) : 10;
102
+ // ---- 列表参数 ----
103
+ const cache = await env.recruitContext.load(env.host);
104
+ const listType = LIST_TYPES.interview;
105
+ const listParam = cache.lists[listType.listKey];
106
+ if (!listParam?.listId) {
107
+ throw ehrValidationError('recruit_list_unavailable', `当前环境未启用「${listType.title}」功能(未找到对应菜单/列表参数,按能力探测拦截)。`);
108
+ }
109
+ const objId = cache.forms[listType.formType]?.objId;
110
+ if (!objId) {
111
+ throw ehrValidationError('recruit_context_missing', `未解析到「${listType.title}」对应表单,无法查询。`);
112
+ }
113
+ // ---- 按 start_time 倒序扫描,越过窗口下界即停 ----
114
+ const counts = { 未开始: 0, 待查看: 0, 待反馈: 0, 已反馈: 0 };
115
+ /** 非标准状态(空值、已失效、已取消等)按原值明细计数 */
116
+ const otherStatusCounts = new Map();
117
+ const byInterviewer = new Map();
118
+ const matched = [];
119
+ let scanned = 0;
120
+ let listTotal = null;
121
+ let earlyStop = false;
122
+ let reachedEnd = false;
123
+ let consecutiveBefore = 0;
124
+ for (let current = 1; current <= maxPages; current++) {
125
+ const page = await listInterviewPage(env, {
126
+ objId,
127
+ listId: listParam.listId,
128
+ cusMenuId: listParam.cusMenuId || '',
129
+ menuName: listParam.menuName || listType.title,
130
+ current,
131
+ });
132
+ if (listTotal === null)
133
+ listTotal = page.total;
134
+ if (!page.rows.length) {
135
+ reachedEnd = true;
136
+ break;
137
+ }
138
+ scanned += page.rows.length;
139
+ for (const row of page.rows) {
140
+ const st = normalizeStartTime(row?.start_time);
141
+ if (!st)
142
+ continue; // 无时间无法归窗,跳过(计数体现在 rows 里)
143
+ if (st > windowEnd)
144
+ continue; // 晚于窗口上界(未来面试),不计入
145
+ if (st < windowStart) {
146
+ consecutiveBefore += 1;
147
+ continue;
148
+ }
149
+ consecutiveBefore = 0;
150
+ const status = String(row?.union_status ?? '').trim();
151
+ if (status === '未开始' || status === '待查看' || status === '待反馈' || status === '已反馈') {
152
+ counts[status] += 1;
153
+ }
154
+ else {
155
+ // 空值/已失效/已取消等不硬塞进「其他」,按原值明细暴露,避免掩盖脏数据
156
+ const key = status || '(空)';
157
+ otherStatusCounts.set(key, (otherStatusCounts.get(key) ?? 0) + 1);
158
+ }
159
+ if (status === '待反馈' || status === '待查看') {
160
+ const who = namesOf(row?.interviewer) || '(未指定面试官)';
161
+ const rec = byInterviewer.get(who) ?? { pendingFeedback: 0, pendingView: 0 };
162
+ if (status === '待反馈')
163
+ rec.pendingFeedback += 1;
164
+ else
165
+ rec.pendingView += 1;
166
+ byInterviewer.set(who, rec);
167
+ }
168
+ matched.push({
169
+ startTime: st,
170
+ status: status || '(空)',
171
+ // 行内 talent_id / position_manage_id / interviewer 放的是人名或门户结构,不是 id;
172
+ // 门户结构是 JSON 字符串,必须用 namesOf 解析,否则整段 JSON 会被人当成人名
173
+ candidate: namesOf(row?.talent_id) || '',
174
+ position: namesOf(row?.position_manage_id) || '',
175
+ interviewer: namesOf(row?.interviewer) || '',
176
+ type: namesOf(row?.interview_type) || '',
177
+ session: namesOf(row?.interview_session) || '',
178
+ rounds: namesOf(row?.interview_rounds) || '',
179
+ formDataId: String(row?.form_data_id ?? '').trim(),
180
+ candidateManageId: String(row?.candidate_manage_id ?? '').trim(),
181
+ });
182
+ }
183
+ // 倒序列表:连续 3 行都早于窗口下界,判定已越过窗口(容忍个别脏时间)
184
+ if (consecutiveBefore >= 3) {
185
+ earlyStop = true;
186
+ break;
187
+ }
188
+ }
189
+ const truncated = !earlyStop && !reachedEnd;
190
+ const notes = [];
191
+ notes.push('状态名(未开始/待查看/待反馈/已反馈)按系统原值直出,语义以招聘业务口径为准;' +
192
+ '「待反馈」= 面试已结束、等面试官/HR 填评价,是 HR 最需要跟进的一类。');
193
+ if (earlyStop) {
194
+ notes.push(`已按 start_time 倒序扫描至窗口下界,${startDate}~${endDate} 窗口内应无遗漏。`);
195
+ }
196
+ else if (reachedEnd) {
197
+ notes.push('列表已翻到末页,结果完整。');
198
+ }
199
+ else {
200
+ notes.push(`⚠️ 已达 maxPages=${maxPages}(扫描 ${scanned} 条)仍未扫到 ${startDate} 下界,结果可能不完整,` +
201
+ '可调大 maxPages 或缩小时间窗后重试。这条清单不能当作全量交付。');
202
+ }
203
+ if (otherStatusCounts.size) {
204
+ const total = [...otherStatusCounts.values()].reduce((a, b) => a + b, 0);
205
+ notes.push(`另有 ${total} 条状态为非常规值(见 otherStatusCounts),未计入四个标准状态,请按需人工核对。`);
206
+ }
207
+ // 逐人清单只放「待跟进」(待反馈/待查看):已反馈的对 HR 没有动作价值,
208
+ // 全量明细请用 candidate.list 翻页;这样也避开了输出层 24KB 压缩把清单压到 10 条。
209
+ const actionRows = matched.filter((r) => r.status === '待反馈' || r.status === '待查看');
210
+ const byInterviewerSorted = [...byInterviewer.entries()]
211
+ .map(([interviewer, v]) => ({ interviewer, ...v, total: v.pendingFeedback + v.pendingView }))
212
+ .sort((a, b) => b.total - a.total);
213
+ notes.push('逐人清单只列待跟进(待反馈/待查看),已反馈不列出;全量明细请用 ehr.recruit.candidate.list type=interview 翻页。');
214
+ if (byInterviewerSorted.length > interviewerLimit) {
215
+ notes.push(`按面试官统计共 ${byInterviewerSorted.length} 人,仅列前 ${interviewerLimit} 名(可调 interviewerLimit);` +
216
+ '因此这部分合计小于 actionNeeded 是正常的,不是漏计。');
217
+ }
218
+ return ehrSuccess('ehr.recruit.interview.overview', {
219
+ window: { startDate, endDate, days: args.days ?? null },
220
+ listTotal,
221
+ scanned,
222
+ matched: matched.length,
223
+ truncated,
224
+ statusCounts: counts,
225
+ otherStatusCounts: otherStatusCounts.size
226
+ ? Object.fromEntries([...otherStatusCounts.entries()].sort((a, b) => b[1] - a[1]))
227
+ : undefined,
228
+ actionNeeded: counts.待反馈 + counts.待查看,
229
+ byInterviewer: byInterviewerSorted.slice(0, interviewerLimit),
230
+ byInterviewerTotal: byInterviewerSorted.length,
231
+ rows: includeRows ? actionRows.slice(0, rowLimit) : undefined,
232
+ rowsNote: includeRows && actionRows.length > rowLimit
233
+ ? `待跟进共 ${actionRows.length} 条,仅列最近 ${rowLimit} 条;全部明细请用 ehr.recruit.candidate.list type=interview 翻页`
234
+ : undefined,
235
+ note: notes.join(' '),
236
+ });
237
+ }
238
+ export const recruitInterviewOverviewOperations = [
239
+ {
240
+ name: 'ehr.recruit.interview.overview',
241
+ resource: 'recruit.interview',
242
+ method: 'overview',
243
+ action: 'interview.overview',
244
+ summary: '面试进展全局汇总(只读):按时间窗统计各状态(未开始/待查看/待反馈/已反馈)场次,给出需 HR 跟进的人次与按面试官的待办分布',
245
+ capability: 'recruit.interview.overview',
246
+ risk: READ,
247
+ inputSchema: schemaOf({
248
+ days: { type: 'integer', minimum: 1, description: `最近 N 天(含今天),默认 ${DEFAULT_DAYS};与 startDate 二选一` },
249
+ startDate: { type: 'string', pattern: '^\\d{4}-\\d{2}-\\d{2}$', description: '窗口起始日 YYYY-MM-DD,优先于 days' },
250
+ endDate: { type: 'string', pattern: '^\\d{4}-\\d{2}-\\d{2}$', description: '窗口结束日 YYYY-MM-DD,默认今天' },
251
+ maxPages: { type: 'integer', minimum: 1, description: `最多翻页数,默认 ${DEFAULT_MAX_PAGES}(每页 10 条)` },
252
+ includeRows: { type: 'boolean', description: '是否返回待跟进逐人清单,默认 true' },
253
+ rowLimit: { type: 'integer', minimum: 1, description: '待跟进清单最多返回条数,默认 20' },
254
+ interviewerLimit: { type: 'integer', minimum: 1, description: '按面试官统计最多返回前 N 名,默认 10' },
255
+ }, { description: '只读统计,不改任何面试记录' }),
256
+ handler: interviewOverview,
257
+ },
258
+ ];
@@ -27,17 +27,16 @@ const TEXT_KEYS = ['position_name'];
27
27
  const MTEXT_KEYS = ['position_duty', 'work_request'];
28
28
  const ASSOC_KEYS = ['demand'];
29
29
  const PERSON_DEFAULT_KEYS = ['recr_principal', 'employ_manager'];
30
- // 🔴 薪资(salary_min / salary_max)必须沿用现值,不能留空:
31
- // 这两个字段是**表单必填项**,不传就会导致后端必填校验失败、整个建职位流程直接报错。
32
- // 但历史职位薪资确实可能是脏数据(实测抓到过 300 元月薪),因此不静默使用——
33
- // 通过 summary.inheritedFromRef 逐项暴露给用户核对,并对明显偏低的值追加 inheritedSalaryWarnings 提示。
30
+ // 🔴 2026-11-07 实测修正:不再从参考职位继承以下三项(与 stage 入口同源问题)
31
+ // · job_category(职位序列):每个职位各不相同,继承会把上一职位的「销售」带进新职位(卡片页已坐实);
32
+ // · salary_min / salary_max:继承会把历史脏值「0.00」写成新职位的正式薪酬(卡片页已坐实)。
33
+ // 三个字段在自用 EB 包里 required 均未开启(ebdf_field 实测 required=None),留空可保存;
34
+ // 需要时用 jobCategory / salaryMin / salaryMax 显式传,不再拿脏值填坑。
35
+ // 仅保留「职位属性 / 学历要求 / 工作年限 / 招聘流程」四项偏公司统一口径的字段继承。
34
36
  const REF_COPY_KEYS = [
35
37
  'position_nature',
36
- 'job_category',
37
38
  'education',
38
39
  'work_years',
39
- 'salary_min',
40
- 'salary_max',
41
40
  'recruit_flow',
42
41
  ];
43
42
  // 默认办公地点用详细地址名称声明,不写死记录 id:运行时到「办公地点」列表按「启用」状态精确解析。
@@ -546,8 +545,11 @@ const positionCreateApply = {
546
545
  if (lease.baseUrl !== session.baseUrl || lease.profile !== session.profile || lease.userId !== session.userId) {
547
546
  throw ehrValidationError('context_mismatch', '确认上下文已变化(租户或登录账号不同),请重新执行 prepare');
548
547
  }
549
- const positionName = String(args.positionName ?? '').trim();
550
548
  const payload = lease.payload || {};
549
+ // 🔴 2026-11-07 修复:positionName 本来就在 payload 里,但 apply 只从 args 取——
550
+ // 只带 confirm + continuation 时拿到空串,随后与 payload 比对必然报 target_changed(文档写法跑不通)。
551
+ // 改为 args 优先、缺失时回退 payload;后面的比对保留,用于发现「显式传了不同名字」的偷改。
552
+ const positionName = String(args.positionName ?? payload.positionName ?? '').trim();
551
553
  if (payload.positionName !== positionName) {
552
554
  throw ehrValidationError('target_changed', '职位名称与 prepare 时不一致,请重新执行 prepare');
553
555
  }