weaver-work-cli 0.1.45 → 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 (110) 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-T4MWQAQB.js → chunk-JFAWZX53.js} +128 -9
  11. package/dist/chunks/{chunk-DGMYACGJ.js → chunk-OXHHJWNC.js} +1 -1
  12. package/dist/chunks/{chunk-LXFVWZLM.js → chunk-PSOMGA3U.js} +3 -3
  13. package/dist/chunks/{chunk-LRCPNDZA.js → chunk-UFIFZ4YC.js} +10 -8
  14. package/dist/chunks/{conflict-IYJETSGT.js → conflict-H7EHQXYY.js} +2 -2
  15. package/dist/chunks/{create-flow-7JLC7UID.js → create-flow-VRVJEOBX.js} +6 -6
  16. package/dist/chunks/{ehr-MYRDCHZ4.js → ehr-SH2LM3NK.js} +528 -40
  17. package/dist/chunks/{env-3MBHAWBL.js → env-66FPSJDV.js} +2 -2
  18. package/dist/chunks/{factory-TZEVU4DU.js → factory-UH2TZBVA.js} +1 -1
  19. package/dist/chunks/{group-chat-KL3HFKRM.js → group-chat-CAKMMV7K.js} +3 -3
  20. package/dist/chunks/{lazy-dispatch-UH6HGK2I.js → lazy-dispatch-DD6ULZ3I.js} +1 -1
  21. package/dist/chunks/{meeting-C67EHQ4Z.js → meeting-VTBFW4HI.js} +10 -10
  22. package/dist/chunks/{recruit-stage-AHY5QAMF.js → recruit-stage-CAKZTUA7.js} +917 -85
  23. package/dist/chunks/{registry-XPWPGHYE.js → registry-JVQBLFQ5.js} +10 -10
  24. package/dist/chunks/{room-recommend-CNWE5WQK.js → room-recommend-5U55FMXZ.js} +4 -4
  25. package/dist/chunks/{schedule-YYNYBQIE.js → schedule-IDETODCA.js} +4 -4
  26. package/dist/cmd/action.js +14 -10
  27. package/dist/index.js +5 -5
  28. package/dist/shortcuts/ehr/host.js +2 -2
  29. package/dist/shortcuts/ehr/index.js +14 -3
  30. package/dist/shortcuts/ehr/manifest.js +5 -1
  31. package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +40 -10
  32. package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +258 -0
  33. package/dist/shortcuts/ehr/operations/recruit-position.js +10 -8
  34. package/dist/shortcuts/ehr/operations/recruit-stats.js +14 -1
  35. package/dist/shortcuts/ehr/operations/recruit-tag.js +173 -0
  36. package/dist/shortcuts/ehr/operations/recruit-write.js +137 -18
  37. package/dist/shortcuts/ehr/operations/recruit.js +180 -8
  38. package/dist/shortcuts/ehr/operations/registry.js +4 -0
  39. package/dist/shortcuts/ehr/operations.js +24 -0
  40. package/dist/shortcuts/ehr/recruit-stage/batch-store.js +78 -0
  41. package/dist/shortcuts/ehr/recruit-stage/context.js +231 -0
  42. package/dist/shortcuts/ehr/recruit-stage/continuation.js +74 -0
  43. package/dist/shortcuts/ehr/recruit-stage/errors.js +65 -0
  44. package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +165 -0
  45. package/dist/shortcuts/ehr/recruit-stage/host.js +109 -0
  46. package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +1049 -0
  47. package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +295 -0
  48. package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +961 -0
  49. package/dist/shortcuts/ehr/recruit-stage/operations/list.js +431 -0
  50. package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +50 -0
  51. package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +1647 -0
  52. package/dist/shortcuts/ehr/recruit-stage/operations/search.js +158 -0
  53. package/dist/shortcuts/ehr/recruit-stage/operations/types.js +34 -0
  54. package/dist/shortcuts/ehr/recruit-stage/runtime.js +31 -0
  55. package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +318 -0
  56. package/dist/shortcuts/ehr/recruit-stage/shared.js +805 -0
  57. package/dist/shortcuts/meeting/operations/eb/create-flow.js +93 -18
  58. package/dist/shortcuts/meeting/operations/eb/factory.js +5 -8
  59. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +2 -13
  60. package/dist/shortcuts/meeting/operations/invitation.js +27 -4
  61. package/dist/shortcuts/recruit-stage/batch-store.js +78 -0
  62. package/dist/shortcuts/recruit-stage/fs-scan.js +165 -0
  63. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +277 -20
  64. package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +31 -7
  65. package/dist/shortcuts/recruit-stage/operations/jd-create.js +106 -16
  66. package/dist/shortcuts/recruit-stage/operations/registry.js +12 -0
  67. package/dist/shortcuts/recruit-stage/operations/resume-import.js +273 -6
  68. package/dist/shortcuts/recruit-stage/operations/types.js +9 -0
  69. package/dist/shortcuts/recruit-stage/shared.js +60 -6
  70. package/package.json +1 -1
  71. package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +2 -2
  72. package/skills/weaver-e10-jucailin/SKILL.md +12 -3
  73. package/skills/weaver-e10-jucailin/archive/LEGACY-README.md +18 -0
  74. package/skills/weaver-e10-jucailin/archive/LEGACY-SKILL.md +239 -0
  75. package/skills/weaver-e10-jucailin/archive/LEGACY-openai.yaml +131 -0
  76. package/skills/weaver-e10-jucailin/archive/LEGACY-position-templates.md +221 -0
  77. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +334 -0
  78. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +127 -0
  79. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +65 -0
  80. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +63 -0
  81. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +142 -0
  82. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +114 -0
  83. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +56 -0
  84. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +101 -0
  85. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +148 -0
  86. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +77 -0
  87. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +72 -0
  88. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +69 -0
  89. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +241 -0
  90. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +457 -0
  91. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +128 -0
  92. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +146 -0
  93. package/skills/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +69 -0
  94. package/skills/weaver-e10-jucailin/lib/recruit-xiaoe-file.mjs +192 -0
  95. package/skills/weaver-e10-jucailin/lib/xiaoe-session.mjs +66 -0
  96. package/skills/weaver-e10-jucailin/references/recruit-create.md +19 -93
  97. package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +64 -0
  98. package/skills/weaver-e10-jucailin/references/recruit-read.md +63 -1
  99. package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +95 -0
  100. package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +89 -0
  101. package/skills/weaver-e10-jucailin/references/recruit-tag.md +81 -0
  102. package/skills/weaver-e10-jucailin/references/recruit-write.md +53 -9
  103. package/skills/weaver-e10-meeting/SKILL.md +48 -4
  104. package/skills/weaver-e10-meeting/references/meeting-eb.md +1 -1
  105. package/skills/weaver-e10-recruit-stage/SKILL.md +8 -5
  106. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +16 -6
  107. package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +5 -1
  108. package/skills/weaver-e10-recruit-stage/references/position-templates.md +20 -1
  109. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +21 -0
  110. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +4 -0
@@ -3,6 +3,7 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  EHR_PAGES,
5
5
  EhrCliError,
6
+ LIST_TYPES,
6
7
  READ,
7
8
  SCHEMA_DATE,
8
9
  SCHEMA_ID,
@@ -27,6 +28,7 @@ import {
27
28
  ehrSuccess,
28
29
  ehrValidationError,
29
30
  fetchListRows,
31
+ namesOf,
30
32
  normalizePaged,
31
33
  pickDefined,
32
34
  recruitOperations,
@@ -37,9 +39,10 @@ import {
37
39
  toNumber,
38
40
  toPageQuery,
39
41
  toPositiveInt
40
- } from "./chunk-T4MWQAQB.js";
42
+ } from "./chunk-JFAWZX53.js";
41
43
  import {
42
- reportPlatformError
44
+ shouldReportPlatformError,
45
+ toPlatformError
43
46
  } from "./chunk-6N4JPNFL.js";
44
47
  import {
45
48
  CONTINUATION_TTL_MS,
@@ -244,7 +247,8 @@ function createEhrHost(ctx, dependencies = {}) {
244
247
  form,
245
248
  multipart,
246
249
  headers: extraHeaders = {},
247
- timeoutMs = 3e4
250
+ timeoutMs = 3e4,
251
+ skipBusinessCheck = false
248
252
  } = request2;
249
253
  assertPath(path);
250
254
  const resolvedMethod = method || (body === void 0 && form === void 0 && multipart === void 0 ? "GET" : "POST");
@@ -293,7 +297,7 @@ function createEhrHost(ctx, dependencies = {}) {
293
297
  exitCode: 1
294
298
  });
295
299
  }
296
- if (!isBusinessSuccess(response.value)) {
300
+ if (!skipBusinessCheck && !isBusinessSuccess(response.value)) {
297
301
  throw new EhrCliError("api", "business_error", businessMessage(response.value), {
298
302
  code: businessCode(response.value),
299
303
  details: { code: businessCode(response.value), message: businessMessage(response.value) },
@@ -2283,6 +2287,11 @@ async function verifyLease2(args, action, env) {
2283
2287
  if (lease.baseUrl !== session.baseUrl || lease.profile !== session.profile || lease.userId !== session.userId) {
2284
2288
  throw ehrValidationError("context_mismatch", "\u786E\u8BA4\u4E0A\u4E0B\u6587\u5DF2\u53D8\u5316\uFF08\u79DF\u6237\u6216\u767B\u5F55\u8D26\u53F7\u4E0D\u540C\uFF09\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C prepare");
2285
2289
  }
2290
+ const snap = lease.payload && typeof lease.payload === "object" ? lease.payload : {};
2291
+ for (const [k, v] of Object.entries(snap)) {
2292
+ if (k === "formId" || k === "objId" || k === "dataDetails") continue;
2293
+ if (args[k] === void 0 || args[k] === null || args[k] === "") args[k] = v;
2294
+ }
2286
2295
  return lease;
2287
2296
  }
2288
2297
  function isNetworkError2(error) {
@@ -2452,14 +2461,62 @@ async function getDsOptions(host, objId, fieldId, groupId) {
2452
2461
  }
2453
2462
  return map;
2454
2463
  }
2455
- async function resolvePersonId(host, fieldId, keyword) {
2464
+ async function resolvePersonId(host, _fieldId, keyword) {
2465
+ const kw = String(keyword || "").trim();
2466
+ if (!kw) return null;
2467
+ const formDatas = {
2468
+ status: [{ statusSelect: ["normal"] }],
2469
+ subcompany: [{ subcompanyOpt: "in" }],
2470
+ department: [{ departmentOpt: "in" }],
2471
+ role: [{ roleOpt: "in" }],
2472
+ position: [{ positionOpt: "in" }],
2473
+ superior: [{ superiorOpt: "in" }]
2474
+ };
2475
+ if (/@/.test(kw)) formDatas.email = [{ emailOpt: "in", emailInput: kw }];
2476
+ else if (/^\d{11}$/.test(kw)) formDatas.mobile = [{ mobileOpt: "in", mobileInput: kw }];
2477
+ else formDatas.username = [{ usernameOpt: "in", usernameInput: kw }];
2456
2478
  const response = await host.request({
2457
- path: "/api/ebuilder/form/common/browser/complete/resource",
2458
- body: { formParam: { fieldId, searchValue: keyword }, "formParam.fieldId": fieldId, "formParam.searchValue": keyword }
2479
+ path: "/api/hrm/common/browser/data/resource",
2480
+ body: {
2481
+ browserMultiple: true,
2482
+ authWecahtBook: false,
2483
+ wxDepNeedConvertCount: 0,
2484
+ wxEmpNeedConvertCount: 0,
2485
+ wxTotalNeedConvertCount: 0,
2486
+ ...formDatas,
2487
+ cmd: "all",
2488
+ formDatas,
2489
+ quickSearchDatas: {},
2490
+ type: "and",
2491
+ current: 1,
2492
+ pageSize: 200,
2493
+ containsNoneAccount: false,
2494
+ containsPartTimeEmployee: false,
2495
+ containsDls: false
2496
+ }
2459
2497
  });
2460
- const list = response?.data?.data || response?.data || [];
2461
- const first = list[0];
2462
- return first ? String(first.id || first.value || "") || null : null;
2498
+ const rows = (response?.data?.data ?? []).filter((r) => r && (r.id || r.value) && r.name);
2499
+ if (!rows.length) return null;
2500
+ const nameOf = (x) => String(x.name || "").trim();
2501
+ const idOf = (x) => String(x.id ?? x.value ?? "");
2502
+ const exact = rows.filter((r) => nameOf(r) === kw);
2503
+ if (exact.length === 1) return idOf(exact[0]) || null;
2504
+ if (exact.length > 1) throw ambiguousPerson(kw, exact);
2505
+ if (rows.length === 1) return idOf(rows[0]) || null;
2506
+ throw ambiguousPerson(kw, rows);
2507
+ }
2508
+ function ambiguousPerson(keyword, rows) {
2509
+ const candidates = rows.slice(0, 20).map((r) => ({
2510
+ id: String(r.id ?? r.value ?? ""),
2511
+ name: String(r.name ?? ""),
2512
+ department: String(r.department ?? ""),
2513
+ position: String(r.position ?? "")
2514
+ }));
2515
+ return ehrValidationError(
2516
+ "person_ambiguous",
2517
+ `\u4EBA\u5458\u300C${keyword}\u300D\u547D\u4E2D ${rows.length} \u4EBA\uFF0C\u8BF7\u6307\u660E\u5177\u4F53\u662F\u54EA\u4E00\u4F4D\uFF1A${candidates.map((c) => `${c.name}${c.department ? `\uFF08${c.department}\uFF09` : ""}`).join("\u3001")}`,
2518
+ { candidates }
2519
+ );
2463
2520
  }
2464
2521
  async function saveFormData(host, params) {
2465
2522
  const layoutId = params.layoutId || params.formId;
@@ -2688,12 +2745,14 @@ var candidateCreateApply = {
2688
2745
  confirm: { const: true },
2689
2746
  continuation: { type: "string", minLength: 1 }
2690
2747
  },
2691
- { required: ["name", "mobile", "confirm", "continuation"] }
2748
+ // name/mobile 不再列入 required(2026-11-07):prepare 已把它们签进 continuation,
2749
+ // apply 只带 confirm + continuation 即可;仍传则用于与快照比对防偷改。
2750
+ { required: ["confirm", "continuation"] }
2692
2751
  ),
2693
2752
  handler: async (args, env) => {
2694
2753
  requireConfirm2(args, "ehr.recruit.candidate.create.apply");
2695
- const { name, mobile } = validateNameMobile(args.name, args.mobile);
2696
2754
  const lease = await verifyLease2(args, "ehr.recruit.candidate.create.apply", env);
2755
+ const { name, mobile } = validateNameMobile(args.name, args.mobile);
2697
2756
  const payload = lease.payload || {};
2698
2757
  const channelName = args.channel !== void 0 && args.channel !== null && String(args.channel).trim() !== "" ? String(args.channel).trim() : null;
2699
2758
  const currentFingerprint = fingerprint2({ name, mobile, channel: channelName, dataDetails: payload.dataDetails });
@@ -2800,11 +2859,12 @@ var INTERVIEW_DATAKEYS = [
2800
2859
  "interview_location",
2801
2860
  "notice_mould"
2802
2861
  ];
2803
- function defaultInterviewWindow() {
2862
+ function defaultInterviewWindow(isAI = false) {
2804
2863
  const pad = (n) => String(n).padStart(2, "0");
2805
2864
  const now = /* @__PURE__ */ new Date();
2806
2865
  const fmt = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} ${pad(d.getHours())}:${pad(d.getMinutes())}`;
2807
- const end = new Date(now.getTime() + 60 * 60 * 1e3);
2866
+ const spanMs = isAI ? 7 * 24 * 60 * 60 * 1e3 : 60 * 60 * 1e3;
2867
+ const end = new Date(now.getTime() + spanMs);
2808
2868
  return { start: fmt(now), end: fmt(end) };
2809
2869
  }
2810
2870
  async function resolveCurrentUserForWrite(host) {
@@ -2985,7 +3045,7 @@ async function buildInterviewPlan(env, cache, args) {
2985
3045
  if (interviewerInput) {
2986
3046
  interviewerId = await resolvePersonId(host, fieldIdOf("interviewer"), interviewerInput);
2987
3047
  if (!interviewerId) {
2988
- throw ehrValidationError("interviewer_not_found", `\u9762\u8BD5\u5B98\u300C${interviewerInput}\u300D\u89E3\u6790\u4E0D\u5230 userId\uFF08browser/complete/resource \u65E0\u5339\u914D\uFF09`);
3048
+ throw ehrValidationError("interviewer_not_found", `\u9762\u8BD5\u5B98\u300C${interviewerInput}\u300D\u5728\u4EBA\u5458\u5E93\u4E2D\u67E5\u4E0D\u5230\uFF08\u53EF\u80FD\u59D3\u540D\u5199\u9519\u3001\u4E0D\u5728\u672C\u79DF\u6237\uFF0C\u6216\u4E0D\u662F\u5728\u804C\u4EBA\u5458\uFF09`);
2989
3049
  }
2990
3050
  } else {
2991
3051
  const me = await resolveCurrentUserForWrite(host);
@@ -3043,7 +3103,7 @@ async function buildInterviewPlan(env, cache, args) {
3043
3103
  throw ehrValidationError("email_invalid", `\u5019\u9009\u4EBA\u90AE\u7BB1\u683C\u5F0F\u4E0D\u6B63\u786E\uFF1A${email}`);
3044
3104
  }
3045
3105
  }
3046
- const window = defaultInterviewWindow();
3106
+ const window = defaultInterviewWindow(isAI);
3047
3107
  const start = typeof args.startTime === "string" && args.startTime.trim() ? args.startTime.trim() : window.start;
3048
3108
  const end = typeof args.endTime === "string" && args.endTime.trim() ? args.endTime.trim() : window.end;
3049
3109
  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)) {
@@ -3071,6 +3131,7 @@ async function buildInterviewPlan(env, cache, args) {
3071
3131
  candidateName: candidate.name,
3072
3132
  positionName: candidate.positionName,
3073
3133
  interviewTime: `${start} ~ ${end}`,
3134
+ timeFieldIds: { start: fieldIdOf("start_time"), end: fieldIdOf("end_time") },
3074
3135
  interviewer,
3075
3136
  email: email || void 0,
3076
3137
  mobile: mobile || void 0,
@@ -3152,14 +3213,28 @@ var interviewArrangeApply = {
3152
3213
  requiresConfirmation: true,
3153
3214
  inputSchema: schemaOf(
3154
3215
  { ...interviewArrangeSchema, confirm: { const: true }, continuation: { type: "string", minLength: 1 } },
3155
- { required: ["talentId", "interviewer", "confirm", "continuation"] }
3216
+ // 业务参数(talentId/interviewer)已由 prepare 签进 continuation,apply 只需两项;
3217
+ // 显式传仍作数(与快照比对,用于防偷改)。
3218
+ { required: ["confirm", "continuation"] }
3156
3219
  ),
3157
3220
  handler: async (args, env) => {
3158
3221
  requireConfirm2(args, "ehr.recruit.candidate.interview.arrange.apply");
3159
3222
  const lease = await verifyLease2(args, "ehr.recruit.candidate.interview.arrange.apply", env);
3160
3223
  const payload = lease.payload || {};
3161
3224
  const cache = await requireRecruitCache(env);
3225
+ const explicitTime = args.startTime !== void 0 || args.endTime !== void 0;
3162
3226
  const plan = await buildInterviewPlan(env, cache, args);
3227
+ if (!explicitTime && Array.isArray(payload.dataDetails) && payload.dataDetails.length) {
3228
+ const snap = payload.dataDetails;
3229
+ plan.dataDetails = snap;
3230
+ const pick = (fid) => {
3231
+ const hit = snap.find((d) => String(d?.formField?.id || "") === fid);
3232
+ return typeof hit?.content === "string" ? hit.content : null;
3233
+ };
3234
+ const s = pick(plan.timeFieldIds.start);
3235
+ const e = pick(plan.timeFieldIds.end);
3236
+ if (s && e) plan.interviewTime = `${s} ~ ${e}`;
3237
+ }
3163
3238
  if (fingerprint2({ dataDetails: plan.dataDetails, notify: args.notify === true }) !== lease.fingerprint) {
3164
3239
  throw ehrValidationError("target_changed", "\u8F93\u5165\u4E0E prepare \u65F6\u7684\u5FEB\u7167\u4E0D\u4E00\u81F4\uFF08\u5019\u9009\u4EBA/\u9762\u8BD5\u5B98/\u65F6\u95F4\u7B49\u88AB\u4FEE\u6539\uFF09\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C prepare");
3165
3240
  }
@@ -3210,6 +3285,16 @@ var interviewArrangeApply = {
3210
3285
  return ehrSuccess("ehr.recruit.candidate.interview.arrange.apply", {
3211
3286
  status: "COMPLETE",
3212
3287
  interviewFormId: planFormId,
3288
+ // 🔴 两入口产出不同质,必须显式标注(2026-11-07 实测):本入口只做「建面试单 + assignedInterview」,
3289
+ // 额外动作仅在 notify=true 时补跑「新建日程」esb;**不**执行页面那一整串按钮动作流。
3290
+ // 而 ehr.recruit.stage.interview.arrange.apply 会无条件跑 prepare 侧解析到的全部 saveActions
3291
+ // (含「新建EB日程」「安排面试后续动作API」「AI面试时发送提醒」等)。要完整页面效果就用 stage 入口。
3292
+ sideEffects: {
3293
+ executesFormButtonActions: false,
3294
+ onlyAction: "assignedInterview",
3295
+ scheduleCreation: notify ? "runEsb:\u65B0\u5EFA\u65E5\u7A0B" : "skipped\uFF08notify=false\uFF09"
3296
+ },
3297
+ consistencyNote: "\u672C\u5165\u53E3\u5199\u5165\u7684\u9762\u8BD5\u5355\u4E0D\u89E6\u53D1\u9875\u9762\u6309\u94AE\u52A8\u4F5C\u6D41\uFF08\u65E0\u300C\u65B0\u5EFAEB\u65E5\u7A0B/AI\u9762\u8BD5\u63D0\u9192/\u540E\u7EED\u52A8\u4F5C\u300D\uFF09\uFF1B\u843D\u5E93\u7684\u300C\u72B6\u6001(union_status)\u300D\u4E5F\u4E0D\u7531\u672C\u5165\u53E3\u8BBE\u7F6E\u3002\u82E5\u9700\u8981\u4E0E\u9875\u9762\u624B\u5DE5\u300C\u5B89\u6392\u9762\u8BD5\u300D\u5B8C\u5168\u4E00\u81F4\u7684\u526F\u4F5C\u7528\uFF0C\u8BF7\u6539\u7528 ehr.recruit.stage.interview.arrange.prepare/apply\uFF0C\u5E76\u5728\u6458\u8981\u91CC\u6838\u5BF9 saveActions \u5217\u8868\u3002",
3213
3298
  notify: notifyResult,
3214
3299
  assigned: assigned?.data || {},
3215
3300
  candidate: `${plan.candidateName}\uFF08talentId=${args.talentId}\uFF09`,
@@ -3260,7 +3345,10 @@ async function resolveOfferTemplate(host, cache, templateName) {
3260
3345
  }
3261
3346
  const allData = await host.request({
3262
3347
  path: "/api/ebuilder/form/dataset/v2/getAllData",
3263
- body: { datajson: { header: { objId: mouldObjId }, mainTable: {}, pageInfo: { pageNo: 1, pageSize: 200 } } }
3348
+ body: { datajson: { header: { objId: mouldObjId }, mainTable: {}, pageInfo: { pageNo: 1, pageSize: 200 } } },
3349
+ // EB OpenAPI 族顶层无 code/status(message.code 为 "0"),跳过通用业务判定;
3350
+ // 是否成功由下面读取 `data.datajson.datas` 的调用方按数据自身判断。
3351
+ skipBusinessCheck: true
3264
3352
  });
3265
3353
  const datas = allData?.data?.datajson?.datas || [];
3266
3354
  const hit = datas.find((item) => {
@@ -3399,7 +3487,7 @@ var offerSendApply = {
3399
3487
  requiresConfirmation: true,
3400
3488
  inputSchema: schemaOf(
3401
3489
  { ...offerSendSchema, confirm: { const: true }, continuation: { type: "string", minLength: 1 } },
3402
- { required: ["talentId", "confirm", "continuation"] }
3490
+ { required: ["confirm", "continuation"] }
3403
3491
  ),
3404
3492
  handler: async (args, env) => {
3405
3493
  requireConfirm2(args, "ehr.recruit.offer.send.apply");
@@ -3671,7 +3759,7 @@ var entryProcessApply = {
3671
3759
  requiresConfirmation: true,
3672
3760
  inputSchema: schemaOf(
3673
3761
  { ...entryProcessSchema, confirm: { const: true }, continuation: { type: "string", minLength: 1 } },
3674
- { required: ["talentId", "departmentId", "positionRankId", "confirm", "continuation"] }
3762
+ { required: ["confirm", "continuation"] }
3675
3763
  ),
3676
3764
  handler: async (args, env) => {
3677
3765
  requireConfirm2(args, "ehr.recruit.entry.process.apply");
@@ -3919,7 +4007,7 @@ var feedbackEditApply = {
3919
4007
  requiresConfirmation: true,
3920
4008
  inputSchema: schemaOf(
3921
4009
  { ...feedbackEditSchema, confirm: { const: true }, continuation: { type: "string", minLength: 1 } },
3922
- { required: ["talentId", "confirm", "continuation"] }
4010
+ { required: ["confirm", "continuation"] }
3923
4011
  ),
3924
4012
  handler: async (args, env) => {
3925
4013
  requireConfirm2(args, "ehr.recruit.candidate.interview.feedback.edit.apply");
@@ -4092,7 +4180,7 @@ var feedbackUrgeApply = {
4092
4180
  requiresConfirmation: true,
4093
4181
  inputSchema: schemaOf(
4094
4182
  { ...feedbackUrgeSchema, confirm: { const: true }, continuation: { type: "string", minLength: 1 } },
4095
- { required: ["talentId", "confirm", "continuation"] }
4183
+ { required: ["confirm", "continuation"] }
4096
4184
  ),
4097
4185
  handler: async (args, env) => {
4098
4186
  requireConfirm2(args, "ehr.recruit.candidate.interview.feedback.urge.apply");
@@ -4177,26 +4265,39 @@ async function countModule(env, cache, key, pageSize, maxPages) {
4177
4265
  let scanned = 0;
4178
4266
  let total = null;
4179
4267
  let totalExact = false;
4268
+ let countSource = "unknown";
4180
4269
  let note = cfg.note;
4181
4270
  for (let current = 1; current <= maxPages; current++) {
4182
4271
  const page = await fetchListRows(env.host, objId, list.listId, { ...baseBody, current, pageSize });
4183
4272
  if (current === 1 && page.total !== null && page.totalExact) {
4184
4273
  total = page.total;
4185
4274
  totalExact = true;
4275
+ countSource = "count-api";
4186
4276
  break;
4187
4277
  }
4188
4278
  scanned += page.rows.length;
4189
4279
  if (page.rows.length < pageSize) {
4190
4280
  total = scanned;
4191
4281
  totalExact = true;
4282
+ countSource = "full-scan";
4192
4283
  break;
4193
4284
  }
4194
4285
  }
4195
4286
  if (total === null) {
4196
4287
  totalExact = false;
4288
+ countSource = "unknown";
4197
4289
  note = `\u8BA1\u6570\u63A5\u53E3\u4E0D\u53EF\u7528\u4E14\u8FBE\u626B\u63CF\u4E0A\u9650\uFF08${maxPages} \u9875 \xD7 ${pageSize} \u884C\uFF09\u4ECD\u672A\u53D6\u5B8C\uFF0C\u603B\u6570\u4E0D\u53EF\u77E5\uFF1B\u53EF\u8C03\u5927 pageSize/maxPages \u91CD\u8BD5`;
4198
4290
  }
4199
- return { key, module: cfg.title, available: true, total, totalExact, scannedRows: scanned, ...note ? { note } : {} };
4291
+ return {
4292
+ key,
4293
+ module: cfg.title,
4294
+ available: true,
4295
+ total,
4296
+ totalExact,
4297
+ scannedRows: scanned,
4298
+ countSource,
4299
+ ...note ? { note } : {}
4300
+ };
4200
4301
  }
4201
4302
  var recruitStats = {
4202
4303
  name: "ehr.recruit.stats",
@@ -4259,11 +4360,8 @@ var MTEXT_KEYS = ["position_duty", "work_request"];
4259
4360
  var PERSON_DEFAULT_KEYS = ["recr_principal", "employ_manager"];
4260
4361
  var REF_COPY_KEYS = [
4261
4362
  "position_nature",
4262
- "job_category",
4263
4363
  "education",
4264
4364
  "work_years",
4265
- "salary_min",
4266
- "salary_max",
4267
4365
  "recruit_flow"
4268
4366
  ];
4269
4367
  var DEFAULT_WORK_LOCATION = "\u6D66\u6C5F\u9547\u4E09\u9C81\u516C\u8DEF3419\u53F7\u6CDB\u5FAE\u8F6F\u4EF6\u56ED";
@@ -4705,8 +4803,8 @@ var positionCreateApply = {
4705
4803
  if (lease.baseUrl !== session.baseUrl || lease.profile !== session.profile || lease.userId !== session.userId) {
4706
4804
  throw ehrValidationError("context_mismatch", "\u786E\u8BA4\u4E0A\u4E0B\u6587\u5DF2\u53D8\u5316\uFF08\u79DF\u6237\u6216\u767B\u5F55\u8D26\u53F7\u4E0D\u540C\uFF09\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C prepare");
4707
4805
  }
4708
- const positionName = String(args.positionName ?? "").trim();
4709
4806
  const payload = lease.payload || {};
4807
+ const positionName = String(args.positionName ?? payload.positionName ?? "").trim();
4710
4808
  if (payload.positionName !== positionName) {
4711
4809
  throw ehrValidationError("target_changed", "\u804C\u4F4D\u540D\u79F0\u4E0E prepare \u65F6\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C prepare");
4712
4810
  }
@@ -4902,7 +5000,10 @@ function normalizeImportDates(input, warnings) {
4902
5000
  }
4903
5001
  if (Array.isArray(input.academicInformations)) {
4904
5002
  input.academicInformations.forEach((r, i) => {
4905
- if (!r || typeof r !== "object" || r.study_date === void 0) return;
5003
+ if (!r || typeof r !== "object") return;
5004
+ if (r.start_date !== void 0 && r.start_date !== null) r.start_date = one(`academicInformations[${i}].start_date`, r.start_date, false);
5005
+ if (r.end_date !== void 0 && r.end_date !== null) r.end_date = one(`academicInformations[${i}].end_date`, r.end_date, true);
5006
+ if (r.study_date === void 0) return;
4906
5007
  const before = String(r.study_date ?? "").trim();
4907
5008
  if (!before) return;
4908
5009
  const after = normDateRange(before);
@@ -5032,9 +5133,9 @@ function buildSubDetails(structured, meta, nodeOfTable, resolveDict) {
5032
5133
  const parts = Array.isArray(value) ? value : String(value).split(/[,~]/);
5033
5134
  const start = String(parts[0] ?? "").trim();
5034
5135
  const end = String(parts[1] ?? "").trim();
5035
- if (!start || !end) continue;
5036
- out[column.startKey] = start;
5037
- out[column.endKey] = end;
5136
+ if (!start && !end) continue;
5137
+ if (start) out[column.startKey] = start;
5138
+ if (end) out[column.endKey] = end;
5038
5139
  continue;
5039
5140
  }
5040
5141
  out[colKey] = String(value);
@@ -5072,7 +5173,11 @@ async function datasetSaveFormData(env, objId, mainTable, details) {
5072
5173
  operationinfo: { fieldNoFindIgnore: "true", doAction: "false" }
5073
5174
  }
5074
5175
  },
5075
- operation: "ehr.recruit.candidate.import.apply"
5176
+ operation: "ehr.recruit.candidate.import.apply",
5177
+ // EB OpenAPI 族(dataset/v2/*)顶层没有 code/status,业务结果在
5178
+ // `data.datajson.status` + `data.datajson.message`,且外层 `message.code` 恒为 "0"。
5179
+ // 交给下面的 `ok` 判定按 datajson 自查,不走通用业务判定。
5180
+ skipBusinessCheck: true
5076
5181
  });
5077
5182
  const datajson = response?.data?.datajson || {};
5078
5183
  const code = response?.message?.code;
@@ -5315,8 +5420,10 @@ async function buildImportPlan(env, cache, args) {
5315
5420
  }
5316
5421
  }
5317
5422
  if (fields.is_blacklist) {
5318
- const noId = resolveDict("\u5426", "\u9ED1\u540D\u5355");
5319
- if (noId) main.is_blacklist = noId;
5423
+ const opts = await getDsOptions(env.host, objId, fields.is_blacklist, "").catch(() => ({}));
5424
+ const noId = opts["\u5426"];
5425
+ if (noId) main.is_blacklist = String(noId);
5426
+ else warnings.push("\u9ED1\u540D\u5355\u5B57\u6BB5\u672A\u53D6\u5230\u300C\u5426\u300D\u9009\u9879\uFF0C\u8BE5\u5B57\u6BB5\u7559\u7A7A\uFF08\u7531\u7CFB\u7EDF\u9ED8\u8BA4\u503C\u515C\u5E95\uFF09");
5320
5427
  }
5321
5428
  let subStats = {};
5322
5429
  let detailNodes = {};
@@ -5325,7 +5432,11 @@ async function buildImportPlan(env, cache, args) {
5325
5432
  const mappingResponse = await env.host.request({
5326
5433
  path: `/api/ebuilder/form/dataset/v1/getTableMapping?objId=${encodeURIComponent(objId)}`,
5327
5434
  method: "GET",
5328
- operation: "ehr.recruit.candidate.import.prepare"
5435
+ operation: "ehr.recruit.candidate.import.prepare",
5436
+ // EB OpenAPI 族成功标识在 `data` 里(顶层 message.code 是 "0"),
5437
+ // 走通用业务判定会被误判成 business_error,导致「明细表未写入」。
5438
+ // 真正的判据交给下面的 `mapping.mainTable` 断言。
5439
+ skipBusinessCheck: true
5329
5440
  });
5330
5441
  const mapping = mappingResponse?.data;
5331
5442
  if (!mapping?.mainTable) throw new Error("getTableMapping \u672A\u8FD4\u56DE mainTable");
@@ -5521,7 +5632,9 @@ var candidateImportApply = {
5521
5632
  throw ehrValidationError("context_mismatch", "\u786E\u8BA4\u4E0A\u4E0B\u6587\u5DF2\u53D8\u5316\uFF08\u79DF\u6237\u6216\u767B\u5F55\u8D26\u53F7\u4E0D\u540C\uFF09\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C prepare");
5522
5633
  }
5523
5634
  const payload = lease.payload || {};
5524
- if (payload.candidateName !== str(args.candidateName) || payload.telephone !== str(args.telephone)) {
5635
+ const candidateName = str(args.candidateName) || str(payload.candidateName);
5636
+ const telephone = str(args.telephone) || str(payload.telephone);
5637
+ if (payload.candidateName !== candidateName || payload.telephone !== telephone) {
5525
5638
  throw ehrValidationError("target_changed", "\u59D3\u540D\u6216\u624B\u673A\u53F7\u4E0E prepare \u65F6\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0\u6267\u884C prepare");
5526
5639
  }
5527
5640
  const cache = await requireCache2(env);
@@ -5648,6 +5761,360 @@ var recruitCandidateImportOperations = [
5648
5761
  candidateImportApply
5649
5762
  ];
5650
5763
 
5764
+ // src/shortcuts/ehr/operations/recruit-tag.ts
5765
+ var TAG_QUERY_PATH = "/api/my/tag/query";
5766
+ var MAX_PAGE_SIZE = 100;
5767
+ var DEFAULT_LIMIT = 100;
5768
+ var MAX_LIMIT = 2e3;
5769
+ function normalizeTag(row) {
5770
+ const tagId = String(row?.tagId ?? row?.id ?? "").trim();
5771
+ const name = String(row?.name ?? row?.tagName ?? "").trim();
5772
+ if (!tagId || !name) return null;
5773
+ return {
5774
+ tagId,
5775
+ name,
5776
+ groupId: String(row?.groupId ?? "0"),
5777
+ type: Number(row?.type ?? 0),
5778
+ available: row?.available !== false
5779
+ };
5780
+ }
5781
+ async function queryPage(env, params) {
5782
+ const body = {
5783
+ type: params.type,
5784
+ name: params.keyword,
5785
+ order: 8,
5786
+ pageSize: params.pageSize,
5787
+ pageNo: params.pageNo,
5788
+ search: 1,
5789
+ tagGroup: 0,
5790
+ tagModules: ["ebuilderform"]
5791
+ };
5792
+ if (params.groupId !== void 0) body.groupId = params.groupId;
5793
+ const res = await env.host.request({
5794
+ path: TAG_QUERY_PATH,
5795
+ method: "POST",
5796
+ body,
5797
+ operation: "ehr.recruit.tag.list"
5798
+ });
5799
+ const d = res?.data ?? {};
5800
+ return {
5801
+ total: typeof d.total === "number" ? d.total : null,
5802
+ rows: Array.isArray(d.data) ? d.data : []
5803
+ };
5804
+ }
5805
+ async function listTags(args, env) {
5806
+ const keyword = args.keyword === void 0 ? "" : String(args.keyword).trim();
5807
+ const groupId = args.groupId === void 0 || args.groupId === null ? void 0 : String(args.groupId);
5808
+ const limitRaw = Number(args.limit ?? DEFAULT_LIMIT);
5809
+ const limit = Number.isFinite(limitRaw) ? Math.min(MAX_LIMIT, Math.max(1, Math.trunc(limitRaw))) : DEFAULT_LIMIT;
5810
+ const includeUnavailable = args.includeUnavailable === true;
5811
+ const withGroupStats = args.withGroupStats !== false;
5812
+ const typeArg = args.type;
5813
+ if (typeArg !== void 0 && typeArg !== "all" && typeArg !== 0 && typeArg !== 1) {
5814
+ throw ehrValidationError("invalid_type", 'type \u53EA\u80FD\u662F 0\uFF08\u516C\u5171\u6807\u7B7E\uFF09\u30011\uFF08\u79C1\u6709\u6807\u7B7E\uFF09\u6216 "all"');
5815
+ }
5816
+ const types = typeArg === "all" ? [0, 1] : [Number(typeArg ?? 0)];
5817
+ const collected = [];
5818
+ const seen = /* @__PURE__ */ new Set();
5819
+ let reportedTotal = 0;
5820
+ for (const type of types) {
5821
+ let pageNo = 1;
5822
+ let total = null;
5823
+ while (true) {
5824
+ const page = await queryPage(env, { type, keyword, groupId, pageNo, pageSize: MAX_PAGE_SIZE });
5825
+ if (page.total !== null) total = page.total;
5826
+ for (const raw of page.rows) {
5827
+ const item = normalizeTag(raw);
5828
+ if (!item) continue;
5829
+ if (groupId !== void 0 && item.groupId !== groupId) continue;
5830
+ if (!includeUnavailable && !item.available) continue;
5831
+ const key = `${item.type}:${item.tagId}`;
5832
+ if (seen.has(key)) continue;
5833
+ seen.add(key);
5834
+ collected.push(item);
5835
+ }
5836
+ if (!page.rows.length) break;
5837
+ if (collected.length >= limit) break;
5838
+ if (total !== null && pageNo * MAX_PAGE_SIZE >= total) break;
5839
+ pageNo += 1;
5840
+ if (pageNo > 30) break;
5841
+ }
5842
+ reportedTotal += total ?? 0;
5843
+ }
5844
+ const items = collected.slice(0, limit);
5845
+ const groupStats = withGroupStats ? [...new Map(items.reduce((m, x) => {
5846
+ m.set(x.groupId, (m.get(x.groupId) ?? 0) + 1);
5847
+ return m;
5848
+ }, /* @__PURE__ */ new Map()).entries())].map(([groupId2, count]) => ({ groupId: groupId2, count })).sort((a, b) => b.count - a.count) : void 0;
5849
+ const notes = [];
5850
+ if (groupId === void 0 && keyword === "" && groupStats && groupStats.length) {
5851
+ const top = groupStats[0];
5852
+ const topShare = items.length ? top.count / items.length : 0;
5853
+ if (topShare >= 0.7) {
5854
+ const truncated = reportedTotal > 0 && items.length < reportedTotal;
5855
+ const scope = truncated ? `\u672C\u6B21\u8FD4\u56DE\u7684 ${items.length} \u6761\u6837\u672C\uFF08\u975E\u5168\u91CF\uFF09` : "\u5168\u90E8\u7ED3\u679C";
5856
+ notes.push(
5857
+ `\u6807\u7B7E\u6C60\u672A\u6309\u4E1A\u52A1\u5206\u7EC4\uFF1AgroupId=${top.groupId} \u5360${scope}\u7684 ${top.count}/${items.length}\u3002\u62DB\u8058\u6807\u7B7E\u4E0E\u5BA2\u6237/\u9879\u76EE\u7B49\u5176\u4ED6\u4E1A\u52A1\u6807\u7B7E\u6DF7\u5728\u540C\u4E00\u6C60\u5B50\u91CC\uFF0C\u8981\u771F\u6B63\u9694\u79BB\u9700\u5728 EB \u4FA7\u65B0\u5EFA\u62DB\u8058\u6807\u7B7E\u7EC4\uFF0C\u518D\u6309 groupId \u8FC7\u6EE4\u3002` + (truncated ? " \u60F3\u770B\u5168\u91CF\u7EC4\u5206\u5E03\u8BF7\u8C03\u5927 limit\u3002" : "")
5858
+ );
5859
+ }
5860
+ }
5861
+ if (keyword) notes.push(`\u5DF2\u6309\u540D\u79F0\u5305\u542B\u5339\u914D\u300C${keyword}\u300D\uFF1B\u670D\u52A1\u7AEF name \u53C2\u6570\u5B9E\u6D4B\u6709\u6548\u3002`);
5862
+ if (groupId !== void 0) notes.push(`\u5DF2\u6309 groupId=${groupId} \u8FC7\u6EE4\uFF08\u670D\u52A1\u7AEF\u53C2\u6570\u5B9E\u6D4B\u6709\u6548\uFF0C\u5BA2\u6237\u7AEF\u518D\u515C\u4E00\u5C42\u6821\u9A8C\uFF09\u3002`);
5863
+ if (reportedTotal && items.length < reportedTotal) {
5864
+ notes.push(`\u547D\u4E2D ${reportedTotal} \u6761\uFF0C\u672C\u6B21\u8FD4\u56DE ${items.length} \u6761\uFF08\u53D7 limit=${limit} \u9650\u5236\uFF0C\u53EF\u8C03\u5927 limit \u6216\u7528 keyword/groupId \u6536\u7A84\uFF09\u3002`);
5865
+ }
5866
+ return ehrSuccess("ehr.recruit.tag.list", {
5867
+ keyword: keyword || null,
5868
+ groupId: groupId ?? null,
5869
+ types,
5870
+ total: reportedTotal || null,
5871
+ returned: items.length,
5872
+ items,
5873
+ groupStats,
5874
+ note: notes.length ? notes.join(" ") : void 0
5875
+ });
5876
+ }
5877
+ var recruitTagOperations = [
5878
+ {
5879
+ name: "ehr.recruit.tag.list",
5880
+ resource: "recruit.tag",
5881
+ method: "list",
5882
+ action: "tag.list",
5883
+ summary: "\u5217\u62DB\u8058\u53EF\u7528\u7684\u5E73\u53F0\u6807\u7B7E\uFF08\u53EA\u8BFB\uFF09\uFF1A\u652F\u6301\u6309\u540D\u79F0\u5173\u952E\u8BCD\u3001groupId \u7CBE\u786E\u8FC7\u6EE4\uFF0C\u5E76\u7ED9\u51FA\u7EC4\u5206\u5E03\u4EE5\u4FBF\u5224\u65AD\u6807\u7B7E\u6C60\u662F\u5426\u5DF2\u5206\u7EC4\u6CBB\u7406",
5884
+ capability: "recruit.tag.list",
5885
+ risk: READ,
5886
+ inputSchema: schemaOf(
5887
+ {
5888
+ keyword: { type: "string", description: "\u6807\u7B7E\u540D\u79F0\u5173\u952E\u8BCD\uFF08\u670D\u52A1\u7AEF\u4E3A\u5305\u542B\u5339\u914D\uFF0C\u5B9E\u6D4B\u6709\u6548\uFF09\u3002\u5982\u300C\u672C\u79D1\u300D\u300C\u6280\u672F\u300D" },
5889
+ groupId: { type: "string", description: '\u6807\u7B7E\u7EC4 id\uFF08\u670D\u52A1\u7AEF\u552F\u4E00\u751F\u6548\u7684\u8FC7\u6EE4\u53C2\u6570\uFF1BtagGroup \u65E0\u6548\uFF09\u3002\u5982 "1"' },
5890
+ type: {
5891
+ oneOf: [{ type: "integer", enum: [0, 1] }, { type: "string", enum: ["all"] }],
5892
+ description: '0=\u516C\u5171\u6807\u7B7E\uFF08\u9ED8\u8BA4\uFF09\u30011=\u79C1\u6709\u6807\u7B7E\u3001"all"=\u4E24\u8005\u90FD\u8981'
5893
+ },
5894
+ limit: { type: "integer", minimum: 1, maximum: MAX_LIMIT, description: `\u6700\u591A\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA4 ${DEFAULT_LIMIT}` },
5895
+ includeUnavailable: { type: "boolean", description: "\u662F\u5426\u5305\u542B\u5DF2\u505C\u7528\u6807\u7B7E\uFF0C\u9ED8\u8BA4 false" },
5896
+ withGroupStats: { type: "boolean", description: "\u662F\u5426\u8FD4\u56DE\u7EC4\u5206\u5E03\uFF0C\u9ED8\u8BA4 true" }
5897
+ },
5898
+ { description: "\u53EA\u8BFB\u67E5\u8BE2\uFF0C\u4E0D\u521B\u5EFA\u3001\u4E0D\u4FEE\u6539\u4EFB\u4F55\u6807\u7B7E" }
5899
+ ),
5900
+ handler: listTags
5901
+ }
5902
+ ];
5903
+
5904
+ // src/shortcuts/ehr/operations/recruit-interview-overview.ts
5905
+ var DEFAULT_DAYS = 7;
5906
+ var DEFAULT_MAX_PAGES = 100;
5907
+ var SERVER_PAGE_SIZE = 10;
5908
+ function ymd(d) {
5909
+ const y = d.getFullYear();
5910
+ const m = String(d.getMonth() + 1).padStart(2, "0");
5911
+ const day = String(d.getDate()).padStart(2, "0");
5912
+ return `${y}-${m}-${day}`;
5913
+ }
5914
+ function parseYmd(v, field) {
5915
+ if (typeof v !== "string" || !/^\d{4}-\d{2}-\d{2}$/.test(v)) {
5916
+ if (v === void 0 || v === null) return null;
5917
+ throw ehrValidationError("invalid_date", `${field} \u683C\u5F0F\u5FC5\u987B\u662F YYYY-MM-DD`);
5918
+ }
5919
+ const d = /* @__PURE__ */ new Date(`${v}T00:00:00`);
5920
+ if (Number.isNaN(d.getTime())) throw ehrValidationError("invalid_date", `${field} \u4E0D\u662F\u6709\u6548\u65E5\u671F`);
5921
+ return v;
5922
+ }
5923
+ function normalizeStartTime(v) {
5924
+ if (v === void 0 || v === null) return null;
5925
+ const s = String(v).trim();
5926
+ if (!s) return null;
5927
+ const m = s.match(/^(\d{4}-\d{2}-\d{2})(?:\s+(\d{2}:\d{2}))?/);
5928
+ if (!m) return null;
5929
+ return `${m[1]} ${m[2] || "00:00"}`;
5930
+ }
5931
+ async function listInterviewPage(env, params) {
5932
+ const body = buildListBody({
5933
+ listId: params.listId,
5934
+ cusMenuId: params.cusMenuId,
5935
+ menuName: params.menuName,
5936
+ title: LIST_TYPES.interview.title,
5937
+ current: params.current,
5938
+ pageSize: SERVER_PAGE_SIZE
5939
+ });
5940
+ const { rows, total } = await fetchListRows(env.host, params.objId, params.listId, body);
5941
+ return { rows, total };
5942
+ }
5943
+ async function interviewOverview(args, env) {
5944
+ if (!env.recruitContext) {
5945
+ throw ehrValidationError("recruit_context_unavailable", "\u62DB\u8058\u4E0A\u4E0B\u6587\u52A0\u8F7D\u5668\u672A\u521D\u59CB\u5316");
5946
+ }
5947
+ const today = /* @__PURE__ */ new Date();
5948
+ const endDate = parseYmd(args.endDate, "endDate") ?? ymd(today);
5949
+ let startDate = parseYmd(args.startDate, "startDate");
5950
+ if (!startDate) {
5951
+ const daysRaw = Number(args.days ?? DEFAULT_DAYS);
5952
+ if (!Number.isFinite(daysRaw) || daysRaw < 1) {
5953
+ throw ehrValidationError("invalid_days", "days \u5FC5\u987B\u662F \u22651 \u7684\u6574\u6570");
5954
+ }
5955
+ const days = Math.trunc(daysRaw);
5956
+ const s = /* @__PURE__ */ new Date(`${endDate}T00:00:00`);
5957
+ s.setDate(s.getDate() - (days - 1));
5958
+ startDate = ymd(s);
5959
+ }
5960
+ if (startDate > endDate) {
5961
+ throw ehrValidationError("invalid_range", "startDate \u4E0D\u80FD\u665A\u4E8E endDate");
5962
+ }
5963
+ const windowStart = `${startDate} 00:00`;
5964
+ const windowEnd = `${endDate} 23:59`;
5965
+ const maxPagesRaw = Number(args.maxPages ?? DEFAULT_MAX_PAGES);
5966
+ const maxPages = Number.isFinite(maxPagesRaw) && maxPagesRaw >= 1 ? Math.trunc(maxPagesRaw) : DEFAULT_MAX_PAGES;
5967
+ const includeRows = args.includeRows !== false;
5968
+ const rowLimitRaw = Number(args.rowLimit ?? 20);
5969
+ const rowLimit = Number.isFinite(rowLimitRaw) && rowLimitRaw >= 1 ? Math.trunc(rowLimitRaw) : 20;
5970
+ const interviewerLimitRaw = Number(args.interviewerLimit ?? 10);
5971
+ const interviewerLimit = Number.isFinite(interviewerLimitRaw) && interviewerLimitRaw >= 1 ? Math.trunc(interviewerLimitRaw) : 10;
5972
+ const cache = await env.recruitContext.load(env.host);
5973
+ const listType = LIST_TYPES.interview;
5974
+ const listParam = cache.lists[listType.listKey];
5975
+ if (!listParam?.listId) {
5976
+ throw ehrValidationError(
5977
+ "recruit_list_unavailable",
5978
+ `\u5F53\u524D\u73AF\u5883\u672A\u542F\u7528\u300C${listType.title}\u300D\u529F\u80FD\uFF08\u672A\u627E\u5230\u5BF9\u5E94\u83DC\u5355/\u5217\u8868\u53C2\u6570\uFF0C\u6309\u80FD\u529B\u63A2\u6D4B\u62E6\u622A\uFF09\u3002`
5979
+ );
5980
+ }
5981
+ const objId = cache.forms[listType.formType]?.objId;
5982
+ if (!objId) {
5983
+ throw ehrValidationError("recruit_context_missing", `\u672A\u89E3\u6790\u5230\u300C${listType.title}\u300D\u5BF9\u5E94\u8868\u5355\uFF0C\u65E0\u6CD5\u67E5\u8BE2\u3002`);
5984
+ }
5985
+ const counts = { \u672A\u5F00\u59CB: 0, \u5F85\u67E5\u770B: 0, \u5F85\u53CD\u9988: 0, \u5DF2\u53CD\u9988: 0 };
5986
+ const otherStatusCounts = /* @__PURE__ */ new Map();
5987
+ const byInterviewer = /* @__PURE__ */ new Map();
5988
+ const matched = [];
5989
+ let scanned = 0;
5990
+ let listTotal = null;
5991
+ let earlyStop = false;
5992
+ let reachedEnd = false;
5993
+ let consecutiveBefore = 0;
5994
+ for (let current = 1; current <= maxPages; current++) {
5995
+ const page = await listInterviewPage(env, {
5996
+ objId,
5997
+ listId: listParam.listId,
5998
+ cusMenuId: listParam.cusMenuId || "",
5999
+ menuName: listParam.menuName || listType.title,
6000
+ current
6001
+ });
6002
+ if (listTotal === null) listTotal = page.total;
6003
+ if (!page.rows.length) {
6004
+ reachedEnd = true;
6005
+ break;
6006
+ }
6007
+ scanned += page.rows.length;
6008
+ for (const row of page.rows) {
6009
+ const st = normalizeStartTime(row?.start_time);
6010
+ if (!st) continue;
6011
+ if (st > windowEnd) continue;
6012
+ if (st < windowStart) {
6013
+ consecutiveBefore += 1;
6014
+ continue;
6015
+ }
6016
+ consecutiveBefore = 0;
6017
+ const status = String(row?.union_status ?? "").trim();
6018
+ if (status === "\u672A\u5F00\u59CB" || status === "\u5F85\u67E5\u770B" || status === "\u5F85\u53CD\u9988" || status === "\u5DF2\u53CD\u9988") {
6019
+ counts[status] += 1;
6020
+ } else {
6021
+ const key = status || "(\u7A7A)";
6022
+ otherStatusCounts.set(key, (otherStatusCounts.get(key) ?? 0) + 1);
6023
+ }
6024
+ if (status === "\u5F85\u53CD\u9988" || status === "\u5F85\u67E5\u770B") {
6025
+ const who = namesOf(row?.interviewer) || "(\u672A\u6307\u5B9A\u9762\u8BD5\u5B98)";
6026
+ const rec = byInterviewer.get(who) ?? { pendingFeedback: 0, pendingView: 0 };
6027
+ if (status === "\u5F85\u53CD\u9988") rec.pendingFeedback += 1;
6028
+ else rec.pendingView += 1;
6029
+ byInterviewer.set(who, rec);
6030
+ }
6031
+ matched.push({
6032
+ startTime: st,
6033
+ status: status || "(\u7A7A)",
6034
+ // 行内 talent_id / position_manage_id / interviewer 放的是人名或门户结构,不是 id;
6035
+ // 门户结构是 JSON 字符串,必须用 namesOf 解析,否则整段 JSON 会被人当成人名
6036
+ candidate: namesOf(row?.talent_id) || "",
6037
+ position: namesOf(row?.position_manage_id) || "",
6038
+ interviewer: namesOf(row?.interviewer) || "",
6039
+ type: namesOf(row?.interview_type) || "",
6040
+ session: namesOf(row?.interview_session) || "",
6041
+ rounds: namesOf(row?.interview_rounds) || "",
6042
+ formDataId: String(row?.form_data_id ?? "").trim(),
6043
+ candidateManageId: String(row?.candidate_manage_id ?? "").trim()
6044
+ });
6045
+ }
6046
+ if (consecutiveBefore >= 3) {
6047
+ earlyStop = true;
6048
+ break;
6049
+ }
6050
+ }
6051
+ const truncated = !earlyStop && !reachedEnd;
6052
+ const notes = [];
6053
+ notes.push(
6054
+ "\u72B6\u6001\u540D\uFF08\u672A\u5F00\u59CB/\u5F85\u67E5\u770B/\u5F85\u53CD\u9988/\u5DF2\u53CD\u9988\uFF09\u6309\u7CFB\u7EDF\u539F\u503C\u76F4\u51FA\uFF0C\u8BED\u4E49\u4EE5\u62DB\u8058\u4E1A\u52A1\u53E3\u5F84\u4E3A\u51C6\uFF1B\u300C\u5F85\u53CD\u9988\u300D= \u9762\u8BD5\u5DF2\u7ED3\u675F\u3001\u7B49\u9762\u8BD5\u5B98/HR \u586B\u8BC4\u4EF7\uFF0C\u662F HR \u6700\u9700\u8981\u8DDF\u8FDB\u7684\u4E00\u7C7B\u3002"
6055
+ );
6056
+ if (earlyStop) {
6057
+ notes.push(`\u5DF2\u6309 start_time \u5012\u5E8F\u626B\u63CF\u81F3\u7A97\u53E3\u4E0B\u754C\uFF0C${startDate}~${endDate} \u7A97\u53E3\u5185\u5E94\u65E0\u9057\u6F0F\u3002`);
6058
+ } else if (reachedEnd) {
6059
+ notes.push("\u5217\u8868\u5DF2\u7FFB\u5230\u672B\u9875\uFF0C\u7ED3\u679C\u5B8C\u6574\u3002");
6060
+ } else {
6061
+ notes.push(
6062
+ `\u26A0\uFE0F \u5DF2\u8FBE maxPages=${maxPages}\uFF08\u626B\u63CF ${scanned} \u6761\uFF09\u4ECD\u672A\u626B\u5230 ${startDate} \u4E0B\u754C\uFF0C\u7ED3\u679C\u53EF\u80FD\u4E0D\u5B8C\u6574\uFF0C\u53EF\u8C03\u5927 maxPages \u6216\u7F29\u5C0F\u65F6\u95F4\u7A97\u540E\u91CD\u8BD5\u3002\u8FD9\u6761\u6E05\u5355\u4E0D\u80FD\u5F53\u4F5C\u5168\u91CF\u4EA4\u4ED8\u3002`
6063
+ );
6064
+ }
6065
+ if (otherStatusCounts.size) {
6066
+ const total = [...otherStatusCounts.values()].reduce((a, b) => a + b, 0);
6067
+ notes.push(`\u53E6\u6709 ${total} \u6761\u72B6\u6001\u4E3A\u975E\u5E38\u89C4\u503C\uFF08\u89C1 otherStatusCounts\uFF09\uFF0C\u672A\u8BA1\u5165\u56DB\u4E2A\u6807\u51C6\u72B6\u6001\uFF0C\u8BF7\u6309\u9700\u4EBA\u5DE5\u6838\u5BF9\u3002`);
6068
+ }
6069
+ const actionRows = matched.filter((r) => r.status === "\u5F85\u53CD\u9988" || r.status === "\u5F85\u67E5\u770B");
6070
+ const byInterviewerSorted = [...byInterviewer.entries()].map(([interviewer, v]) => ({ interviewer, ...v, total: v.pendingFeedback + v.pendingView })).sort((a, b) => b.total - a.total);
6071
+ notes.push("\u9010\u4EBA\u6E05\u5355\u53EA\u5217\u5F85\u8DDF\u8FDB\uFF08\u5F85\u53CD\u9988/\u5F85\u67E5\u770B\uFF09\uFF0C\u5DF2\u53CD\u9988\u4E0D\u5217\u51FA\uFF1B\u5168\u91CF\u660E\u7EC6\u8BF7\u7528 ehr.recruit.candidate.list type=interview \u7FFB\u9875\u3002");
6072
+ if (byInterviewerSorted.length > interviewerLimit) {
6073
+ notes.push(
6074
+ `\u6309\u9762\u8BD5\u5B98\u7EDF\u8BA1\u5171 ${byInterviewerSorted.length} \u4EBA\uFF0C\u4EC5\u5217\u524D ${interviewerLimit} \u540D\uFF08\u53EF\u8C03 interviewerLimit\uFF09\uFF1B\u56E0\u6B64\u8FD9\u90E8\u5206\u5408\u8BA1\u5C0F\u4E8E actionNeeded \u662F\u6B63\u5E38\u7684\uFF0C\u4E0D\u662F\u6F0F\u8BA1\u3002`
6075
+ );
6076
+ }
6077
+ return ehrSuccess("ehr.recruit.interview.overview", {
6078
+ window: { startDate, endDate, days: args.days ?? null },
6079
+ listTotal,
6080
+ scanned,
6081
+ matched: matched.length,
6082
+ truncated,
6083
+ statusCounts: counts,
6084
+ otherStatusCounts: otherStatusCounts.size ? Object.fromEntries([...otherStatusCounts.entries()].sort((a, b) => b[1] - a[1])) : void 0,
6085
+ actionNeeded: counts.\u5F85\u53CD\u9988 + counts.\u5F85\u67E5\u770B,
6086
+ byInterviewer: byInterviewerSorted.slice(0, interviewerLimit),
6087
+ byInterviewerTotal: byInterviewerSorted.length,
6088
+ rows: includeRows ? actionRows.slice(0, rowLimit) : void 0,
6089
+ rowsNote: includeRows && actionRows.length > rowLimit ? `\u5F85\u8DDF\u8FDB\u5171 ${actionRows.length} \u6761\uFF0C\u4EC5\u5217\u6700\u8FD1 ${rowLimit} \u6761\uFF1B\u5168\u90E8\u660E\u7EC6\u8BF7\u7528 ehr.recruit.candidate.list type=interview \u7FFB\u9875` : void 0,
6090
+ note: notes.join(" ")
6091
+ });
6092
+ }
6093
+ var recruitInterviewOverviewOperations = [
6094
+ {
6095
+ name: "ehr.recruit.interview.overview",
6096
+ resource: "recruit.interview",
6097
+ method: "overview",
6098
+ action: "interview.overview",
6099
+ summary: "\u9762\u8BD5\u8FDB\u5C55\u5168\u5C40\u6C47\u603B\uFF08\u53EA\u8BFB\uFF09\uFF1A\u6309\u65F6\u95F4\u7A97\u7EDF\u8BA1\u5404\u72B6\u6001\uFF08\u672A\u5F00\u59CB/\u5F85\u67E5\u770B/\u5F85\u53CD\u9988/\u5DF2\u53CD\u9988\uFF09\u573A\u6B21\uFF0C\u7ED9\u51FA\u9700 HR \u8DDF\u8FDB\u7684\u4EBA\u6B21\u4E0E\u6309\u9762\u8BD5\u5B98\u7684\u5F85\u529E\u5206\u5E03",
6100
+ capability: "recruit.interview.overview",
6101
+ risk: READ,
6102
+ inputSchema: schemaOf(
6103
+ {
6104
+ days: { type: "integer", minimum: 1, description: `\u6700\u8FD1 N \u5929\uFF08\u542B\u4ECA\u5929\uFF09\uFF0C\u9ED8\u8BA4 ${DEFAULT_DAYS}\uFF1B\u4E0E startDate \u4E8C\u9009\u4E00` },
6105
+ startDate: { type: "string", pattern: "^\\d{4}-\\d{2}-\\d{2}$", description: "\u7A97\u53E3\u8D77\u59CB\u65E5 YYYY-MM-DD\uFF0C\u4F18\u5148\u4E8E days" },
6106
+ endDate: { type: "string", pattern: "^\\d{4}-\\d{2}-\\d{2}$", description: "\u7A97\u53E3\u7ED3\u675F\u65E5 YYYY-MM-DD\uFF0C\u9ED8\u8BA4\u4ECA\u5929" },
6107
+ maxPages: { type: "integer", minimum: 1, description: `\u6700\u591A\u7FFB\u9875\u6570\uFF0C\u9ED8\u8BA4 ${DEFAULT_MAX_PAGES}\uFF08\u6BCF\u9875 10 \u6761\uFF09` },
6108
+ includeRows: { type: "boolean", description: "\u662F\u5426\u8FD4\u56DE\u5F85\u8DDF\u8FDB\u9010\u4EBA\u6E05\u5355\uFF0C\u9ED8\u8BA4 true" },
6109
+ rowLimit: { type: "integer", minimum: 1, description: "\u5F85\u8DDF\u8FDB\u6E05\u5355\u6700\u591A\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA4 20" },
6110
+ interviewerLimit: { type: "integer", minimum: 1, description: "\u6309\u9762\u8BD5\u5B98\u7EDF\u8BA1\u6700\u591A\u8FD4\u56DE\u524D N \u540D\uFF0C\u9ED8\u8BA4 10" }
6111
+ },
6112
+ { description: "\u53EA\u8BFB\u7EDF\u8BA1\uFF0C\u4E0D\u6539\u4EFB\u4F55\u9762\u8BD5\u8BB0\u5F55" }
6113
+ ),
6114
+ handler: interviewOverview
6115
+ }
6116
+ ];
6117
+
5651
6118
  // src/shortcuts/ehr/operations/salary.ts
5652
6119
  function requireMonthRange(value, field) {
5653
6120
  if (!Array.isArray(value) || value.length === 0) {
@@ -5832,7 +6299,9 @@ function buildRegistry() {
5832
6299
  ...recruitWriteOperations,
5833
6300
  ...recruitStatsOperations,
5834
6301
  ...recruitPositionOperations,
5835
- ...recruitCandidateImportOperations
6302
+ ...recruitCandidateImportOperations,
6303
+ ...recruitTagOperations,
6304
+ ...recruitInterviewOverviewOperations
5836
6305
  ];
5837
6306
  for (const definition of definitions) {
5838
6307
  if (registry.has(definition.name)) {
@@ -5860,7 +6329,7 @@ var RECRUIT_WITHHELD = [
5860
6329
  ];
5861
6330
  var MOBILE_CARD_WITHHELD = ["attend.card.sign.mobile"];
5862
6331
  function buildOperations() {
5863
- return ehrOperationDefinitions().map((definition) => ({
6332
+ const standard = ehrOperationDefinitions().map((definition) => ({
5864
6333
  name: definition.name,
5865
6334
  resource: definition.resource,
5866
6335
  summary: definition.summary,
@@ -5869,6 +6338,7 @@ function buildOperations() {
5869
6338
  ...definition.requiresConfirmation ? { requiresConfirmation: true } : {},
5870
6339
  inputSchema: definition.inputSchema
5871
6340
  }));
6341
+ return standard;
5872
6342
  }
5873
6343
  var ehrManifest = {
5874
6344
  schemaVersion: 1,
@@ -5895,10 +6365,23 @@ var ehrManifest = {
5895
6365
  };
5896
6366
 
5897
6367
  // src/shortcuts/ehr/operations.ts
6368
+ function assertKnownArguments(definition, input) {
6369
+ const schema = definition.inputSchema;
6370
+ if (!schema || schema.additionalProperties !== false) return;
6371
+ const props = schema.properties || {};
6372
+ const known = Object.keys(props);
6373
+ const unknown = Object.keys(input).filter((key) => !known.includes(key));
6374
+ if (unknown.length === 0) return;
6375
+ throw ehrValidationError(
6376
+ "unknown_argument",
6377
+ `\u672A\u77E5\u53C2\u6570\uFF1A${unknown.join("\u3001")}\u3002\u672C\u64CD\u4F5C\u652F\u6301\u7684\u53C2\u6570\uFF1A${known.length ? known.join("\u3001") : "\uFF08\u65E0\uFF09"}\u3002\u53C2\u6570\u540D\u5199\u9519\u4F1A\u88AB\u9759\u9ED8\u5FFD\u7565\u5E76\u8FD4\u56DE\u770B\u4F3C\u6B63\u5E38\u7684\u7ED3\u679C\uFF0C\u8BF7\u6309\u4E0A\u9762\u7684\u53C2\u6570\u540D\u91CD\u4F20\u3002`
6378
+ );
6379
+ }
5898
6380
  async function executeEhrOperation(operation, rawInput, context) {
5899
6381
  const definition = getEhrOperation(operation);
5900
6382
  const input = asObject(rawInput);
5901
6383
  assertNoForbiddenKeys(input);
6384
+ assertKnownArguments(definition, input);
5902
6385
  const host = {
5903
6386
  request(request) {
5904
6387
  return context.host.request({
@@ -5995,8 +6478,13 @@ async function executeAndPrint(ctx, operation, input) {
5995
6478
  });
5996
6479
  ctx.output.write(successEnvelope(operation, result), { json: true });
5997
6480
  } catch (error) {
5998
- reportPlatformError(error);
5999
- console.error(JSON.stringify(failureEnvelope(error), null, 2));
6481
+ const env = failureEnvelope(error);
6482
+ if (shouldReportPlatformError(error)) {
6483
+ const pe = toPlatformError(error);
6484
+ console.error(JSON.stringify({ ...env, code: pe.code, message: pe.message }, null, 2));
6485
+ } else {
6486
+ console.error(JSON.stringify(env, null, 2));
6487
+ }
6000
6488
  process.exitCode = isCliError(error) ? error.exitCode : 1 /* GeneralError */;
6001
6489
  }
6002
6490
  }