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
@@ -1,8 +1,9 @@
1
1
  import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
- createRecruitContextLoader
5
- } from "./chunk-T4MWQAQB.js";
4
+ createRecruitContextLoader,
5
+ ehrValidationError
6
+ } from "./chunk-JFAWZX53.js";
6
7
  import {
7
8
  CONTINUATION_TTL_MS
8
9
  } from "./chunk-7BDPM5ST.js";
@@ -261,6 +262,11 @@ import { createHash, randomBytes as randomBytes2 } from "node:crypto";
261
262
  function rsSuccess(action, data, meta) {
262
263
  const payload = { ok: true, action, data };
263
264
  if (meta && Object.keys(meta).length > 0) payload.meta = meta;
265
+ const cont = meta?.continuation;
266
+ if (typeof cont === "string" && data && typeof data === "object" && !Array.isArray(data)) {
267
+ const obj = data;
268
+ if (!(typeof obj.continuation === "string" && obj.continuation)) obj.continuation = cont;
269
+ }
264
270
  return payload;
265
271
  }
266
272
  function schemaOf(properties, options = {}) {
@@ -554,13 +560,62 @@ async function resolveCurrentUser(host) {
554
560
  return null;
555
561
  }
556
562
  }
557
- async function resolvePersonId(host, fieldId, keyword) {
563
+ async function resolvePersonId(host, _fieldId, keyword) {
564
+ const kw = String(keyword || "").trim();
565
+ if (!kw) return null;
566
+ const formDatas = {
567
+ status: [{ statusSelect: ["normal"] }],
568
+ subcompany: [{ subcompanyOpt: "in" }],
569
+ department: [{ departmentOpt: "in" }],
570
+ role: [{ roleOpt: "in" }],
571
+ position: [{ positionOpt: "in" }],
572
+ superior: [{ superiorOpt: "in" }]
573
+ };
574
+ if (/@/.test(kw)) formDatas.email = [{ emailOpt: "in", emailInput: kw }];
575
+ else if (/^\d{11}$/.test(kw)) formDatas.mobile = [{ mobileOpt: "in", mobileInput: kw }];
576
+ else formDatas.username = [{ usernameOpt: "in", usernameInput: kw }];
558
577
  const r = await host.request({
559
- path: "/api/ebuilder/form/common/browser/complete/resource",
560
- body: { formParam: { fieldId, searchValue: keyword }, "formParam.fieldId": fieldId, "formParam.searchValue": keyword }
578
+ path: "/api/hrm/common/browser/data/resource",
579
+ body: {
580
+ browserMultiple: true,
581
+ authWecahtBook: false,
582
+ wxDepNeedConvertCount: 0,
583
+ wxEmpNeedConvertCount: 0,
584
+ wxTotalNeedConvertCount: 0,
585
+ ...formDatas,
586
+ cmd: "all",
587
+ formDatas,
588
+ quickSearchDatas: {},
589
+ type: "and",
590
+ current: 1,
591
+ pageSize: 200,
592
+ containsNoneAccount: false,
593
+ containsPartTimeEmployee: false,
594
+ containsDls: false
595
+ }
561
596
  });
562
- const list = r?.data?.data || r?.data || [];
563
- return list[0]?.id || list[0]?.value || null;
597
+ const rows = (r?.data?.data ?? []).filter((x) => x && (x.id || x.value) && x.name);
598
+ if (!rows.length) return null;
599
+ const nameOf = (x) => String(x.name || "").trim();
600
+ const idOf = (x) => String(x.id ?? x.value ?? "");
601
+ const exact = rows.filter((x) => nameOf(x) === kw);
602
+ if (exact.length === 1) return idOf(exact[0]) || null;
603
+ if (exact.length > 1) throw ambiguousPerson(kw, exact);
604
+ if (rows.length === 1) return idOf(rows[0]) || null;
605
+ throw ambiguousPerson(kw, rows);
606
+ }
607
+ function ambiguousPerson(keyword, rows) {
608
+ const candidates = rows.slice(0, 20).map((r) => ({
609
+ id: String(r.id ?? r.value ?? ""),
610
+ name: String(r.name ?? ""),
611
+ department: String(r.department ?? ""),
612
+ position: String(r.position ?? "")
613
+ }));
614
+ return ehrValidationError(
615
+ "person_ambiguous",
616
+ `\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")}`,
617
+ { candidates }
618
+ );
564
619
  }
565
620
  var dsOptionsMemo = /* @__PURE__ */ new Map();
566
621
  function restoreDsOptions(snapshot) {
@@ -884,11 +939,8 @@ var DEF_OPTION = { salary_type: "\u6708\u85AA", recruit_type: "\u793E\u4F1A\u62D
884
939
  var DEF_CURRENT_USER = ["recr_principal", "employ_manager"];
885
940
  var DEF_FROM_REF = [
886
941
  "position_nature",
887
- "job_category",
888
942
  "education",
889
- "work_years",
890
- "salary_min",
891
- "salary_max"
943
+ "work_years"
892
944
  ];
893
945
  var DEF_STATUS = "\u62DB\u8058\u4E2D";
894
946
  var DEFAULT_WORK_LOCATION = "\u6D66\u6C5F\u9547\u4E09\u9C81\u516C\u8DEF3419\u53F7\u6CDB\u5FAE\u8F6F\u4EF6\u56ED";
@@ -976,10 +1028,10 @@ async function findWorkPlaceMenu(ctx) {
976
1028
  try {
977
1029
  const r = await host.request({ path: `/api/cusapp/app/allMenus?isFront=1&appId=${appId}&terminalType=PC`, method: "GET" });
978
1030
  const flat = [];
979
- (function walk(ns) {
1031
+ (function walk2(ns) {
980
1032
  for (const n of ns || []) if (n && typeof n === "object") {
981
1033
  flat.push(n);
982
- walk(n.children || n.childs);
1034
+ walk2(n.children || n.childs);
983
1035
  }
984
1036
  })(r?.data?.cusAppMenus || r?.data);
985
1037
  const hit3 = findMenuNode(flat, WORK_PLACE_NAMES, (m) => ok(m));
@@ -1145,10 +1197,10 @@ async function resolvePositionNewUrl(ctx) {
1145
1197
  if (!node) {
1146
1198
  const r = await host.request({ path: `/api/cusapp/app/allMenus?isFront=1&appId=${appId}&terminalType=PC`, method: "GET" });
1147
1199
  const flat = [];
1148
- (function walk(ns) {
1200
+ (function walk2(ns) {
1149
1201
  for (const n of ns || []) if (n && typeof n === "object") {
1150
1202
  flat.push(n);
1151
- walk(n.children || n.childs);
1203
+ walk2(n.children || n.childs);
1152
1204
  }
1153
1205
  })(r?.data?.cusAppMenus || r?.data);
1154
1206
  node = findMenuNode(flat, ["\u62DB\u8058\u804C\u4F4D", "\u804C\u4F4D\u5217\u8868", "\u804C\u4F4D\u7BA1\u7406"], (n) => n.combinationId && n.id && n.pageId);
@@ -1160,10 +1212,10 @@ async function resolveHomePageUrl(ctx) {
1160
1212
  const { host, appId, baseUrl } = ctx;
1161
1213
  const r = await host.request({ path: `/api/cusapp/app/allMenus?isFront=1&appId=${appId}&terminalType=PC`, method: "GET" });
1162
1214
  const flat = [];
1163
- (function walk(ns) {
1215
+ (function walk2(ns) {
1164
1216
  for (const n of ns || []) if (n && typeof n === "object") {
1165
1217
  flat.push(n);
1166
- walk(n.children || n.childs);
1218
+ walk2(n.children || n.childs);
1167
1219
  }
1168
1220
  })(r?.data?.cusAppMenus || r?.data);
1169
1221
  const node = findMenuNode(flat, ["\u62DB\u8058\u9996\u9875", "\u62DB\u8058\u4E3B\u9875"], (n) => n.pageType === "PAGE" && n.pageId && n.id) || flat.find((n) => n.pageType === "PAGE" && String(n.menuName || "").includes("\u9996\u9875"));
@@ -1433,7 +1485,7 @@ async function prepare(args, env) {
1433
1485
  const refs = args.referenceKeyword ? await fetchRecentReferences(ctx, jd, String(args.referenceKeyword)).catch((e) => ({ available: false, reason: e.message, items: [] })) : {
1434
1486
  available: false,
1435
1487
  skipped: true,
1436
- reason: "\u672A\u663E\u5F0F\u6307\u5B9A referenceKeyword\uFF0C\u5DF2\u8DF3\u8FC7\u540C\u7C7B\u804C\u4F4D\u53C2\u8003\u68C0\u7D22\uFF08\u6539\u7528 references/position-templates.md \u7684\u5C97\u4F4D\u6A21\u677F\uFF09",
1488
+ reason: "\u672A\u663E\u5F0F\u6307\u5B9A referenceKeyword\uFF0C\u5DF2\u8DF3\u8FC7\u540C\u7C7B\u804C\u4F4D\u53C2\u8003\u68C0\u7D22\uFF1B\u8BF7\u6539\u7528 references/recruit-stage/position-templates.md \u7684\u5C97\u4F4D\u8303\u5F0F\u8865\u9F50 positionDuty / workRequest\uFF08\u8BE5\u6587\u4EF6\u672A\u8986\u76D6\u7684\u804C\u4F4D\u65CF\u987B\u7531\u7528\u6237\u63D0\u4F9B\uFF09",
1437
1489
  items: []
1438
1490
  };
1439
1491
  const willSubmit = { formId: jd.formId, objId: jd.objId, dataDetails: jd.dataDetails };
@@ -1441,24 +1493,77 @@ async function prepare(args, env) {
1441
1493
  const continuation = await env.continuation.issue({
1442
1494
  operation: "recruit-stage.jd.create.apply",
1443
1495
  fingerprint: fp,
1444
- enumMaps: await dsOptionsSnapshot()
1496
+ enumMaps: await dsOptionsSnapshot(),
1497
+ // 🔴 2026-11-07 修复:协议文档写「apply 带 confirm + continuation」,但 apply 原来只从 args 取
1498
+ // positionName/positionDuty/...,Agent 少传 positionName 就直接报 position_name_required。
1499
+ // 现把 prepare 用过的业务参数一并签进 continuation;apply 显式传的仍优先。
1500
+ argsSnapshot: {
1501
+ positionName: String(args.positionName || ""),
1502
+ positionDuty: args.positionDuty ? String(args.positionDuty) : void 0,
1503
+ workRequest: args.workRequest ? String(args.workRequest) : void 0,
1504
+ demandId: args.demandId ? String(args.demandId) : void 0,
1505
+ demandName: args.demandName ? String(args.demandName) : void 0
1506
+ }
1445
1507
  });
1446
1508
  const invFieldKeys = {};
1447
1509
  for (const [k, v] of Object.entries(ctx.cache.fields[jd.objId] || {})) invFieldKeys[String(v)] = k;
1510
+ const briefValue = (d) => {
1511
+ let raw;
1512
+ if (d?.dataText && d.dataText.content !== void 0 && d.dataText.content !== null) raw = d.dataText.content;
1513
+ else if (d?.content !== void 0 && d?.content !== null) raw = d.content;
1514
+ else if (Array.isArray(d?.dataOptions) && d.dataOptions.length) raw = d.dataOptions[0]?.content ?? d.dataOptions[0]?.id;
1515
+ if (typeof raw === "string") return raw.length > 60 ? raw.slice(0, 60) + "\u2026" : raw;
1516
+ return raw === void 0 ? null : raw;
1517
+ };
1518
+ const fieldTextOf = (name) => {
1519
+ const fid = String((ctx.cache.fields[jd.objId] || {})[name] || "");
1520
+ if (!fid) return "";
1521
+ const d = willSubmit.dataDetails.find((x) => String(x?.formField?.id) === fid);
1522
+ const raw = d?.dataText?.content ?? d?.content;
1523
+ return typeof raw === "string" ? raw : "";
1524
+ };
1525
+ const clip = (s, n) => s.length > n ? s.slice(0, n) + "\u2026" : s;
1526
+ const dutyText = fieldTextOf("position_duty");
1527
+ const requestText = fieldTextOf("work_request");
1528
+ const missingBody = jd.summary.dutyLen === 0 || jd.summary.requestLen === 0;
1529
+ const jdWarning = missingBody ? `JD \u6B63\u6587\u4E0D\u5B8C\u6574\uFF08\u804C\u8D23 ${jd.summary.dutyLen} \u5B57 / \u4EFB\u804C\u8981\u6C42 ${jd.summary.requestLen} \u5B57\uFF09\u3002\u8BF7\u8865 positionDuty / workRequest \u540E\u91CD\u65B0 prepare\uFF0C\u6216\u6309 references/recruit-stage/position-templates.md \u5BF9\u5E94\u804C\u4F4D\u65CF\u8865\u9F50\uFF1B\u4EE5\u5F53\u524D\u5185\u5BB9 apply \u4F1A\u521B\u5EFA\u4E00\u6761\u6CA1\u6709\u804C\u8D23\u4E0E\u8981\u6C42\u7684\u804C\u4F4D\u8BB0\u5F55\u3002` : void 0;
1530
+ const preview = {
1531
+ action: jd.summary.action,
1532
+ positionName: jd.summary.positionName,
1533
+ positionDuty: dutyText ? clip(dutyText, 100) : "\uFF08\u7A7A\uFF0C\u89C1 warning\uFF09",
1534
+ workRequest: requestText ? clip(requestText, 100) : "\uFF08\u7A7A\uFF0C\u89C1 warning\uFF09",
1535
+ demand: jd.summary.demand,
1536
+ status: jd.summary.status,
1537
+ recruitFlow: jd.summary.recruitFlow,
1538
+ currentUser: jd.summary.currentUser,
1539
+ setApplied: jd.summary.setApplied,
1540
+ setSkipped: jd.summary.setSkipped,
1541
+ inheritedFromRef: jd.summary.inheritedFromRef,
1542
+ inheritedSalaryWarnings: jd.summary.inheritedSalaryWarnings,
1543
+ inheritedNote: jd.summary.inheritedNote,
1544
+ workLocationDefault: jd.summary.workLocationDefault,
1545
+ workLocationWarning: jd.summary.workLocationWarning,
1546
+ requiredDefaultsFilled: jd.summary.requiredDefaultsFilled,
1547
+ fieldCount: willSubmit.dataDetails.length,
1548
+ warning: jdWarning
1549
+ };
1448
1550
  return rsSuccess("recruit-stage.jd.create.prepare", {
1449
1551
  mode: "prepare",
1450
1552
  continuation,
1451
1553
  fingerprint: fp,
1452
1554
  ...jd.summary,
1555
+ preview,
1556
+ jdWarning,
1453
1557
  recentReferences: refs.items,
1454
1558
  recentReferencesNote: refs.skipped ? refs.reason : refs.available ? `\u5DF2\u6309\u300C${refs.keyword}\u300D\u5728\u5F53\u524D\u73AF\u5883\u804C\u4F4D\u5217\u8868\u4E2D\u68C0\u7D22\uFF08\u626B\u63CF ${refs.scanned} \u6761\uFF0C\u547D\u4E2D ${refs.items.length} \u6761\uFF09\u2014\u2014\u8BF7\u5BF9\u6807\u8FD9\u4E9B\u540C\u7C7B\u804C\u4F4D\u7684\u85AA\u916C/\u4EBA\u6570/\u8981\u6C42\u7ED9\u51FA\u63A8\u8350\u503C\uFF0C\u4E00\u5E76\u653E\u8FDB\u786E\u8BA4\u6458\u8981\uFF0C\u4E0D\u8981\u9010\u5B57\u6BB5\u8BE2\u95EE\u7528\u6237` : "\u53C2\u8003\u68C0\u7D22\u4E0D\u53EF\u7528\uFF1A" + (refs.reason || ""),
1455
1559
  willSubmit: {
1456
1560
  formId: willSubmit.formId,
1457
1561
  objId: willSubmit.objId,
1458
1562
  fieldCount: willSubmit.dataDetails.length,
1459
- fields: willSubmit.dataDetails.map(
1460
- (d) => invFieldKeys[String(d.formField && d.formField.id)] || String(d.formField && d.formField.id)
1461
- )
1563
+ fields: willSubmit.dataDetails.map((d) => {
1564
+ const fid = String(d?.formField?.id || "");
1565
+ return { key: invFieldKeys[fid] || fid, fieldId: fid, value: briefValue(d) };
1566
+ })
1462
1567
  }
1463
1568
  }, {
1464
1569
  continuation,
@@ -1471,20 +1576,21 @@ async function apply(args, env) {
1471
1576
  if (!args.continuation) throw rsValidationError("continuation_required", "\u7F3A\u5C11 continuation\uFF08\u6765\u81EA prepare \u7684 meta\uFF09");
1472
1577
  const payload = await env.continuation.verify(String(args.continuation), "recruit-stage.jd.create.apply");
1473
1578
  restoreDsOptions(payload.enumMaps);
1579
+ const merged = { ...payload.argsSnapshot || {}, ...args };
1474
1580
  const host = env.host;
1475
1581
  const session = await host.getSession();
1476
1582
  const ctx = { host, baseUrl: session.baseUrl.replace(/\/+$/, ""), appId: "", cache: await env.recruitContext() };
1477
1583
  ctx.appId = ctx.cache.appId;
1478
- const positionName = String(args.positionName || "").trim();
1584
+ const positionName = String(merged.positionName || "").trim();
1479
1585
  if (!positionName) throw rsValidationError("position_name_required", "positionName \u5FC5\u586B");
1480
1586
  const jd = await buildJd({
1481
1587
  ctx,
1482
1588
  positionName,
1483
- duty: args.positionDuty ? String(args.positionDuty) : void 0,
1484
- requestText: args.workRequest ? String(args.workRequest) : void 0,
1485
- demandId: args.demandId ? String(args.demandId) : void 0,
1486
- demandName: args.demandName ? String(args.demandName) : void 0,
1487
- sets: setsOf(args)
1589
+ duty: merged.positionDuty ? String(merged.positionDuty) : void 0,
1590
+ requestText: merged.workRequest ? String(merged.workRequest) : void 0,
1591
+ demandId: merged.demandId ? String(merged.demandId) : void 0,
1592
+ demandName: merged.demandName ? String(merged.demandName) : void 0,
1593
+ sets: setsOf(merged)
1488
1594
  });
1489
1595
  const willSubmit = { formId: jd.formId, objId: jd.objId, dataDetails: jd.dataDetails };
1490
1596
  if (payload.fingerprint !== fingerprint(willSubmit)) {
@@ -1502,7 +1608,7 @@ async function apply(args, env) {
1502
1608
  const positionPostId = data.positionPostId;
1503
1609
  const checkRpa = data.checkRpa;
1504
1610
  const rpaValidMsg = data.rpaValidMsg || null;
1505
- const okByResponse = r2?.status !== false && r2?.fail !== false && data.fail !== true;
1611
+ const okByResponse = r2?.status !== false && r2?.fail !== true && data.fail !== true;
1506
1612
  const verification = await verifySubmitted({
1507
1613
  host,
1508
1614
  formId: jd.formId,
@@ -1511,7 +1617,7 @@ async function apply(args, env) {
1511
1617
  expected: expectedFields(
1512
1618
  jd.dataDetails,
1513
1619
  ctx.cache.fields[jd.objId] || {},
1514
- ["position_name", "status", "salary_min", "salary_max", "work_location"],
1620
+ ["position_name", "position_duty", "work_request", "status", "salary_min", "salary_max", "work_location"],
1515
1621
  ["position_name", "status"],
1516
1622
  ["salary_min", "salary_max", "work_location"]
1517
1623
  )
@@ -1632,7 +1738,7 @@ var jdCreateOperations = [
1632
1738
  ];
1633
1739
 
1634
1740
  // src/shortcuts/recruit-stage/operations/resume-import.ts
1635
- import { createHash as createHash2 } from "node:crypto";
1741
+ import { createHash as createHash3 } from "node:crypto";
1636
1742
  import fs from "node:fs";
1637
1743
  import path from "node:path";
1638
1744
 
@@ -1956,6 +2062,202 @@ var school_tiers_default = {
1956
2062
  ]
1957
2063
  };
1958
2064
 
2065
+ // src/shortcuts/recruit-stage/fs-scan.ts
2066
+ import { mkdtempSync, readdirSync, readFileSync, statSync, mkdirSync, writeFileSync } from "node:fs";
2067
+ import { tmpdir } from "node:os";
2068
+ import { basename, dirname, extname, join as join2, resolve as resolve2 } from "node:path";
2069
+ import { inflateRawSync } from "node:zlib";
2070
+ var RESUME_EXTS = /* @__PURE__ */ new Set([".pdf", ".doc", ".docx", ".rtf", ".txt", ".wps"]);
2071
+ function decodeName(bytes, utf8Flag) {
2072
+ if (utf8Flag) return bytes.toString("utf8");
2073
+ try {
2074
+ return new TextDecoder("gbk").decode(bytes);
2075
+ } catch {
2076
+ return bytes.toString("utf8");
2077
+ }
2078
+ }
2079
+ function extractZip(zipPath) {
2080
+ const buf = readFileSync(zipPath);
2081
+ let eocd = -1;
2082
+ const floor = Math.max(0, buf.length - 22 - 65535);
2083
+ for (let i = buf.length - 22; i >= floor; i--) {
2084
+ if (buf.readUInt32LE(i) === 101010256) {
2085
+ eocd = i;
2086
+ break;
2087
+ }
2088
+ }
2089
+ if (eocd < 0) throw new Error("\u4E0D\u662F\u6709\u6548\u7684 zip \u6587\u4EF6\uFF08\u627E\u4E0D\u5230\u4E2D\u592E\u76EE\u5F55\u7ED3\u5C3E\u6807\u8BB0\uFF09");
2090
+ const count = buf.readUInt16LE(eocd + 10);
2091
+ let off = buf.readUInt32LE(eocd + 16);
2092
+ if (count === 65535 || off === 4294967295) {
2093
+ throw new Error("\u6682\u4E0D\u652F\u6301 ZIP64\uFF08\u8D85\u5927\u538B\u7F29\u5305\uFF09\uFF0C\u8BF7\u62C6\u5206\u6210\u591A\u4E2A\u666E\u901A zip \u540E\u91CD\u8BD5");
2094
+ }
2095
+ const dest = mkdtempSync(join2(tmpdir(), "e10-resume-"));
2096
+ let written = 0;
2097
+ for (let i = 0; i < count; i++) {
2098
+ if (off + 46 > buf.length || buf.readUInt32LE(off) !== 33639248) break;
2099
+ const flags = buf.readUInt16LE(off + 8);
2100
+ const method = buf.readUInt16LE(off + 10);
2101
+ const compSize = buf.readUInt32LE(off + 20);
2102
+ const nameLen = buf.readUInt16LE(off + 28);
2103
+ const extraLen = buf.readUInt16LE(off + 30);
2104
+ const commentLen = buf.readUInt16LE(off + 32);
2105
+ const localOff = buf.readUInt32LE(off + 42);
2106
+ const rawName = buf.subarray(off + 46, off + 46 + nameLen);
2107
+ const name = decodeName(rawName, (flags & 2048) !== 0);
2108
+ off += 46 + nameLen + extraLen + commentLen;
2109
+ if (!name || name.endsWith("/") || name.startsWith("__MACOSX/")) continue;
2110
+ const rawParts = name.replace(/\\/g, "/").split("/");
2111
+ if (rawParts.some((s) => s === "..")) continue;
2112
+ const parts = rawParts.filter((s) => s && s !== "." && !/^[a-zA-Z]:$/.test(s));
2113
+ if (!parts.length) continue;
2114
+ if (method !== 0 && method !== 8) continue;
2115
+ const lNameLen = buf.readUInt16LE(localOff + 26);
2116
+ const lExtraLen = buf.readUInt16LE(localOff + 28);
2117
+ const dataStart = localOff + 30 + lNameLen + lExtraLen;
2118
+ if (dataStart + compSize > buf.length) continue;
2119
+ const raw = buf.subarray(dataStart, dataStart + compSize);
2120
+ let out;
2121
+ try {
2122
+ out = method === 0 ? raw : inflateRawSync(raw);
2123
+ } catch {
2124
+ continue;
2125
+ }
2126
+ const target = join2(dest, ...parts);
2127
+ mkdirSync(dirname(target), { recursive: true });
2128
+ writeFileSync(target, out);
2129
+ written++;
2130
+ }
2131
+ if (!written) throw new Error("zip \u5185\u6CA1\u6709\u53EF\u8BFB\u53D6\u7684\u6587\u4EF6\uFF08\u53EF\u80FD\u4E3A\u7A7A\u5305\u6216\u4F7F\u7528\u4E86\u4E0D\u652F\u6301\u7684\u538B\u7F29\u65B9\u5F0F\uFF09");
2132
+ return dest;
2133
+ }
2134
+ function walk(dir, root, out, warnings, depth) {
2135
+ if (depth > 4) return;
2136
+ let entries;
2137
+ try {
2138
+ entries = readdirSync(dir);
2139
+ } catch (e) {
2140
+ warnings.push(`\u76EE\u5F55\u4E0D\u53EF\u8BFB\uFF1A${dir}\uFF08${e?.message || "\u672A\u77E5\u539F\u56E0"}\uFF09`);
2141
+ return;
2142
+ }
2143
+ for (const name of entries) {
2144
+ const p = join2(dir, name);
2145
+ let st;
2146
+ try {
2147
+ st = statSync(p);
2148
+ } catch {
2149
+ continue;
2150
+ }
2151
+ if (st.isDirectory()) {
2152
+ if (name === "__MACOSX" || name.startsWith(".")) continue;
2153
+ walk(p, root, out, warnings, depth + 1);
2154
+ continue;
2155
+ }
2156
+ if (!RESUME_EXTS.has(extname(name).toLowerCase())) continue;
2157
+ out.push({ path: p, name, size: st.size });
2158
+ }
2159
+ }
2160
+ function scanResumeSource(source) {
2161
+ const warnings = [];
2162
+ const abs = resolve2(source);
2163
+ let st;
2164
+ try {
2165
+ st = statSync(abs);
2166
+ } catch {
2167
+ throw new Error(`\u8DEF\u5F84\u4E0D\u5B58\u5728\u6216\u4E0D\u53EF\u8BFB\uFF1A${source}`);
2168
+ }
2169
+ let root = abs;
2170
+ let tempDir;
2171
+ if (st.isFile()) {
2172
+ if (extname(abs).toLowerCase() !== ".zip") {
2173
+ throw new Error("source \u53EA\u652F\u6301\u6587\u4EF6\u5939\u6216 .zip \u538B\u7F29\u5305");
2174
+ }
2175
+ tempDir = extractZip(abs);
2176
+ root = tempDir;
2177
+ } else if (!st.isDirectory()) {
2178
+ throw new Error("source \u53EA\u652F\u6301\u6587\u4EF6\u5939\u6216 .zip \u538B\u7F29\u5305");
2179
+ }
2180
+ const files = [];
2181
+ walk(root, root, files, warnings, 0);
2182
+ files.sort((a, b) => a.name.localeCompare(b.name, "zh-Hans-CN"));
2183
+ return { root, files, warnings, tempDir };
2184
+ }
2185
+ function findStructuredJson(file, structuredDir) {
2186
+ const base = basename(file.name, extname(file.name));
2187
+ const candidates = [
2188
+ join2(dirname(file.path), base + ".json"),
2189
+ ...structuredDir ? [join2(resolve2(structuredDir), base + ".json")] : []
2190
+ ];
2191
+ for (const c of candidates) {
2192
+ try {
2193
+ if (statSync(c).isFile()) return c;
2194
+ } catch {
2195
+ }
2196
+ }
2197
+ return null;
2198
+ }
2199
+
2200
+ // src/shortcuts/recruit-stage/batch-store.ts
2201
+ import { createHash as createHash2 } from "node:crypto";
2202
+ import { chmodSync, mkdirSync as mkdirSync2, readFileSync as readFileSync2, readdirSync as readdirSync2, statSync as statSync2, unlinkSync as unlinkSync2, writeFileSync as writeFileSync2 } from "node:fs";
2203
+ import { homedir as homedir3 } from "node:os";
2204
+ import { join as join3, resolve as resolve3, sep } from "node:path";
2205
+ function batchDir() {
2206
+ const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolve3(homedir3(), ".weaver-work-cli");
2207
+ const dir = join3(home, "batch");
2208
+ mkdirSync2(dir, { recursive: true, mode: 448 });
2209
+ return dir;
2210
+ }
2211
+ function digest(value) {
2212
+ return createHash2("sha256").update(JSON.stringify(value)).digest("hex");
2213
+ }
2214
+ function cleanup(dir) {
2215
+ try {
2216
+ const now = Date.now();
2217
+ for (const f of readdirSync2(dir)) {
2218
+ if (!f.endsWith(".json")) continue;
2219
+ const p = join3(dir, f);
2220
+ try {
2221
+ if (now - statSync2(p).mtimeMs > 24 * 3600 * 1e3) unlinkSync2(p);
2222
+ } catch {
2223
+ }
2224
+ }
2225
+ } catch {
2226
+ }
2227
+ }
2228
+ function saveBatchItems(kind, items) {
2229
+ const dir = batchDir();
2230
+ cleanup(dir);
2231
+ const fingerprint3 = digest(items);
2232
+ const file = join3(dir, `${kind}-${fingerprint3.slice(0, 16)}.json`);
2233
+ writeFileSync2(file, JSON.stringify(items), { mode: 384 });
2234
+ try {
2235
+ chmodSync(file, 384);
2236
+ } catch {
2237
+ }
2238
+ return { file, fingerprint: fingerprint3 };
2239
+ }
2240
+ function loadBatchItems(file, expectedFingerprint) {
2241
+ const dir = resolve3(batchDir());
2242
+ const target = resolve3(String(file || ""));
2243
+ if (!target.startsWith(dir + sep)) {
2244
+ throw rsValidationError("batch_file_invalid", "\u6279\u91CF\u6E05\u5355\u8DEF\u5F84\u975E\u6CD5\uFF08\u5FC5\u987B\u4F4D\u4E8E CLI \u7684 batch \u76EE\u5F55\u5185\uFF09");
2245
+ }
2246
+ let items;
2247
+ try {
2248
+ items = JSON.parse(readFileSync2(target, "utf8"));
2249
+ } catch {
2250
+ throw rsValidationError("batch_file_missing", "\u6279\u91CF\u6E05\u5355\u5DF2\u5931\u6548\uFF08\u6587\u4EF6\u88AB\u79FB\u52A8\u6216\u5220\u9664\uFF09\uFF0C\u8BF7\u91CD\u65B0 prepare");
2251
+ }
2252
+ if (!Array.isArray(items)) {
2253
+ throw rsValidationError("batch_file_invalid", "\u6279\u91CF\u6E05\u5355\u683C\u5F0F\u4E0D\u6B63\u786E\uFF0C\u8BF7\u91CD\u65B0 prepare");
2254
+ }
2255
+ if (digest(items) !== String(expectedFingerprint || "")) {
2256
+ throw rsValidationError("batch_file_tampered", "\u6279\u91CF\u6E05\u5355\u4E0E\u786E\u8BA4\u65F6\u4E0D\u4E00\u81F4\uFF08\u6587\u4EF6\u88AB\u4FEE\u6539\uFF09\uFF0C\u5DF2\u62D2\u7EDD\u6267\u884C\uFF0C\u8BF7\u91CD\u65B0 prepare");
2257
+ }
2258
+ return items;
2259
+ }
2260
+
1959
2261
  // src/shortcuts/recruit-stage/operations/resume-import.ts
1960
2262
  var PROTECTED_UPDATE_KEYS = ["is_blacklist", "recruit_status", "candidate_status", "data_status"];
1961
2263
  async function uploadResume(host, baseUrl, filePath, fieldId, formId) {
@@ -1992,7 +2294,7 @@ async function uploadResume(host, baseUrl, filePath, fieldId, formId) {
1992
2294
  const uploadType = c?.data?.uploadType || "common";
1993
2295
  if (!preUploadId) throw rsFail("\u7B80\u5386\u9884\u4E0A\u4F20\u68C0\u67E5\u5931\u8D25\uFF1A" + JSON.stringify(c || {}).slice(0, 200));
1994
2296
  const fd = baseForm();
1995
- const md5 = createHash2("md5").update(buf).digest("hex");
2297
+ const md5 = createHash3("md5").update(buf).digest("hex");
1996
2298
  const lm = String(Math.round(fs.statSync(filePath).mtimeMs || Date.now()));
1997
2299
  fd.append("name", filename);
1998
2300
  fd.append("MD5", md5);
@@ -2794,7 +3096,7 @@ async function findExistingTalents(ctx, opts) {
2794
3096
  return { checked: true, unique: !hit, byPhone: byPhone && !byPhone.error ? byPhone : null, byPhoneError: byPhone?.error, formConflicts, ids };
2795
3097
  }
2796
3098
  function fingerprint2(value) {
2797
- return createHash2("sha256").update(JSON.stringify(value)).digest("hex");
3099
+ return createHash3("sha256").update(JSON.stringify(value)).digest("hex");
2798
3100
  }
2799
3101
  function fingerprintMainTable(mainTable) {
2800
3102
  const copy = { ...mainTable };
@@ -2812,13 +3114,15 @@ var baseInput2 = {
2812
3114
  noSchoolTags: { type: "boolean", description: "\u5173\u95ED\u5B66\u6821\u5F52\u5C5E\u6807\u7B7E\u81EA\u52A8\u63A8\u5BFC" },
2813
3115
  updateTalentId: { type: "string", description: "\u6309\u7B80\u5386\u66F4\u65B0\u5DF2\u6709\u4EBA\u624D\uFF08\u4E3B\u8868\u5168\u91CF\u8986\u76D6+\u660E\u7EC6\u6574\u8868\u8986\u76D6\uFF1B\u5148 prepare \u770B\u5DEE\u5F02\uFF09" }
2814
3116
  };
2815
- async function prepare2(args, env) {
3117
+ async function prepare2(args, env, opts = {}) {
2816
3118
  const host = env.host;
2817
3119
  const session = await host.getSession();
2818
3120
  const ctx = { host, baseUrl: session.baseUrl.replace(/\/+$/, ""), appId: "", cache: await env.recruitContext() };
2819
3121
  ctx.appId = ctx.cache.appId;
2820
- const perm = await probeCreatePermission(ctx.host, objIdOf(ctx.cache, "talent_pool"));
2821
- if (perm === "denied") throw rsFail("\u5F53\u524D\u8D26\u53F7\u6CA1\u6709\u300C\u4EBA\u624D\u5E93\u300D\u8868\u5355\u7684\u521B\u5EFA\u6743\u9650\uFF0C\u5DF2\u963B\u65AD\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09");
3122
+ if (!opts.skipPermissionProbe) {
3123
+ const perm = await probeCreatePermission(ctx.host, objIdOf(ctx.cache, "talent_pool"));
3124
+ if (perm === "denied") throw rsFail("\u5F53\u524D\u8D26\u53F7\u6CA1\u6709\u300C\u4EBA\u624D\u5E93\u300D\u8868\u5355\u7684\u521B\u5EFA\u6743\u9650\uFF0C\u5DF2\u963B\u65AD\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09");
3125
+ }
2822
3126
  const argsT = args;
2823
3127
  if (!argsT.structured && !argsT.structuredFile && !argsT.fileId && !argsT.resumeFile) {
2824
3128
  throw rsValidationError("input_required", "\u9700\u8981 structured/structuredFile/fileId/resumeFile \u4E4B\u4E00");
@@ -2877,7 +3181,22 @@ async function prepare2(args, env) {
2877
3181
  const continuation2 = await env.continuation.issue({
2878
3182
  operation: "recruit-stage.resume.import.apply",
2879
3183
  fingerprint: fp2,
2880
- enumMaps: await dsOptionsSnapshot()
3184
+ enumMaps: await dsOptionsSnapshot(),
3185
+ // 🔴 2026-11-07 修复(同 arrange / jd.create / position.create 的同类缺陷):apply 只带
3186
+ // confirm + continuation 时,buildImport 需要的简历来源参数必须能从快照恢复,
3187
+ // 否则会报 resume_source_required(文档写法跑不通)。
3188
+ argsSnapshot: {
3189
+ file: args.file ? String(args.file) : void 0,
3190
+ structuredFile: args.structuredFile ? String(args.structuredFile) : void 0,
3191
+ fileId: args.fileId ? String(args.fileId) : void 0,
3192
+ resumeFile: args.resumeFile ? String(args.resumeFile) : void 0,
3193
+ channel: args.channel ? String(args.channel) : void 0,
3194
+ updateTalentId: args.updateTalentId ? String(args.updateTalentId) : void 0,
3195
+ useOcr: args.useOcr === true,
3196
+ noSchoolTags: args.noSchoolTags === true,
3197
+ structured: args.structured,
3198
+ tags: args.tags
3199
+ }
2881
3200
  });
2882
3201
  return rsSuccess("recruit-stage.resume.import.prepare", {
2883
3202
  mode: "prepare-update",
@@ -2891,7 +3210,17 @@ async function prepare2(args, env) {
2891
3210
  keptTables,
2892
3211
  protectedSkipped,
2893
3212
  talentViewUrl: viewUrl,
2894
- note: "\u4EE5\u4E0A\u4E3A\u5C06\u5199\u5165\u7684\u5DEE\u5F02\u3002\u786E\u8BA4\u540E apply \u6267\u884C\uFF1B\u5168\u91CF\u8986\u76D6\u4F1A\u6539\u6389\u4EBA\u5DE5\u4FEE\u6B63\u8FC7\u7684\u503C"
3213
+ note: "\u4EE5\u4E0A\u4E3A\u5C06\u5199\u5165\u7684\u5DEE\u5F02\u3002\u786E\u8BA4\u540E apply \u6267\u884C\uFF1B\u5168\u91CF\u8986\u76D6\u4F1A\u6539\u6389\u4EBA\u5DE5\u4FEE\u6B63\u8FC7\u7684\u503C",
3214
+ // 🔴 2026-11-07:本 op 此前无 preview(与 jd.create 同类缺陷)。更新场景最关键的是「改哪些字段、跳过哪些」。
3215
+ preview: {
3216
+ action: "\u6309\u7B80\u5386\u66F4\u65B0\u5DF2\u6709\u4EBA\u624D\uFF08\u5168\u91CF\u8986\u76D6\uFF09",
3217
+ talentId: updateTalentId,
3218
+ \u53D8\u66F4\u5B57\u6BB5\u6570: Array.isArray(changed) ? changed.length : 0,
3219
+ \u53D8\u66F4\u660E\u7EC6: changed,
3220
+ \u672A\u53D8\u5B57\u6BB5\u6570: fieldDiff.filter((x) => x.change === "same").length,
3221
+ \u4FDD\u62A4\u672A\u8986\u76D6: protectedSkipped,
3222
+ note: "\u5168\u91CF\u8986\u76D6\u4F1A\u6539\u6389\u4EBA\u5DE5\u4FEE\u6B63\u8FC7\u7684\u503C\uFF1B\u786E\u8BA4\u9010\u9879\u53D8\u66F4\u540E\u518D apply"
3223
+ }
2895
3224
  }, { continuation: continuation2, fingerprint: fp2, confirmHint: "\u7528\u6237\u660E\u786E\u786E\u8BA4\u540E\uFF0C\u643A\u5E26 confirm:true \u4E0E continuation \u8C03\u7528 apply" });
2896
3225
  }
2897
3226
  const tagCheckTask = (async () => {
@@ -2949,7 +3278,22 @@ async function prepare2(args, env) {
2949
3278
  const continuation = await env.continuation.issue({
2950
3279
  operation: "recruit-stage.resume.import.apply",
2951
3280
  fingerprint: fp,
2952
- enumMaps: await dsOptionsSnapshot()
3281
+ enumMaps: await dsOptionsSnapshot(),
3282
+ // 🔴 2026-11-07 修复(同 arrange / jd.create / position.create 的同类缺陷):apply 只带
3283
+ // confirm + continuation 时,buildImport 需要的简历来源参数必须能从快照恢复,
3284
+ // 否则会报 resume_source_required(文档写法跑不通)。
3285
+ argsSnapshot: {
3286
+ file: args.file ? String(args.file) : void 0,
3287
+ structuredFile: args.structuredFile ? String(args.structuredFile) : void 0,
3288
+ fileId: args.fileId ? String(args.fileId) : void 0,
3289
+ resumeFile: args.resumeFile ? String(args.resumeFile) : void 0,
3290
+ channel: args.channel ? String(args.channel) : void 0,
3291
+ updateTalentId: args.updateTalentId ? String(args.updateTalentId) : void 0,
3292
+ useOcr: args.useOcr === true,
3293
+ noSchoolTags: args.noSchoolTags === true,
3294
+ structured: args.structured,
3295
+ tags: args.tags
3296
+ }
2953
3297
  });
2954
3298
  return rsSuccess("recruit-stage.resume.import.prepare", {
2955
3299
  mode: "prepare",
@@ -2957,13 +3301,23 @@ async function prepare2(args, env) {
2957
3301
  willSubmit,
2958
3302
  tagCheck,
2959
3303
  schoolTags: built.schoolTagInfo,
2960
- onCommit: "\u63D0\u4EA4\u540E\u5C06\uFF1A\u2460 dataset/v2/saveFormData \u5EFA\u4EBA\u624D\uFF08\u4E3B\u8868+\u660E\u7EC6\u4E00\u6B21\u5199\u5165\uFF09\u2461 \u521D\u59CB\u5316\u4EBA\u624D\u6279\u6B21 \u2462 \u89E6\u53D1\u4EBA\u624D\u81EA\u52A8\u6807\u7B7E\u89C4\u5219\u5339\u914D \u2463 \u6309\u6807\u7B7E\uFF08\u542B\u5B66\u6821\u5F52\u5C5E\u81EA\u52A8\u63A8\u5BFC\uFF09\u5199\u5165\u5E73\u53F0\u6807\u7B7E \u2464 \u8F93\u51FA\u4EBA\u624D\u5361\u7247/\u4EBA\u624D\u5E93\u5B9A\u4F4D\u94FE\u63A5"
3304
+ onCommit: "\u63D0\u4EA4\u540E\u5C06\uFF1A\u2460 dataset/v2/saveFormData \u5EFA\u4EBA\u624D\uFF08\u4E3B\u8868+\u660E\u7EC6\u4E00\u6B21\u5199\u5165\uFF09\u2461 \u521D\u59CB\u5316\u4EBA\u624D\u6279\u6B21 \u2462 \u89E6\u53D1\u4EBA\u624D\u81EA\u52A8\u6807\u7B7E\u89C4\u5219\u5339\u914D \u2463 \u6309\u6807\u7B7E\uFF08\u542B\u5B66\u6821\u5F52\u5C5E\u81EA\u52A8\u63A8\u5BFC\uFF09\u5199\u5165\u5E73\u53F0\u6807\u7B7E \u2464 \u8F93\u51FA\u4EBA\u624D\u5361\u7247/\u4EBA\u624D\u5E93\u5B9A\u4F4D\u94FE\u63A5",
3305
+ // 🔴 2026-11-07:本 op 此前无 preview(与 jd.create 同类缺陷)。新建场景要把「建档字段 + 标签预检结果」一起给出来。
3306
+ preview: {
3307
+ ...summary,
3308
+ tagCheck,
3309
+ schoolTags: built.schoolTagInfo,
3310
+ onCommit: "\u63D0\u4EA4\u540E\u5C06\uFF1A\u5EFA\u4EBA\u624D \u2192 \u521D\u59CB\u5316\u6279\u6B21 \u2192 \u81EA\u52A8\u6807\u7B7E\u5339\u914D \u2192 \u5199\u5E73\u53F0\u6807\u7B7E \u2192 \u8F93\u51FA\u5361\u7247\u4E0E\u4EBA\u624D\u5E93\u94FE\u63A5"
3311
+ }
2961
3312
  }, { continuation, fingerprint: fp, confirmHint: "\u7528\u6237\u660E\u786E\u786E\u8BA4\u540E\uFF0C\u643A\u5E26 confirm:true \u4E0E continuation \u8C03\u7528 apply" });
2962
3313
  }
2963
3314
  async function apply2(args, env) {
2964
3315
  if (args.confirm !== true) throw rsConfirmationError("recruit-stage.resume.import.apply", { hint: "\u5199\u64CD\u4F5C\u5FC5\u987B\u663E\u5F0F confirm:true" });
2965
3316
  if (!args.continuation) throw rsValidationError("continuation_required", "\u7F3A\u5C11 continuation\uFF08\u6765\u81EA prepare \u7684 meta\uFF09");
2966
3317
  const payload = await env.continuation.verify(String(args.continuation), "recruit-stage.resume.import.apply");
3318
+ return applyCore({ ...payload.argsSnapshot || {}, ...args }, env, payload);
3319
+ }
3320
+ async function applyCore(args, env, payload) {
2967
3321
  restoreDsOptions(payload.enumMaps);
2968
3322
  const host = env.host;
2969
3323
  const session = await host.getSession();
@@ -3150,6 +3504,182 @@ async function apply2(args, env) {
3150
3504
  }
3151
3505
  });
3152
3506
  }
3507
+ var IMPORT_BATCH_MAX = 50;
3508
+ async function batchPrepare(args, env) {
3509
+ const explicit = Array.isArray(args.items) ? args.items : null;
3510
+ const scan = !explicit && args.source ? scanResumeSource(String(args.source)) : null;
3511
+ if (!explicit && !scan) {
3512
+ throw rsValidationError("source_required", "\u9700\u8981 source\uFF08\u6587\u4EF6\u5939\u6216 .zip \u8DEF\u5F84\uFF09\u6216 items\uFF08[{file, structured?}]\uFF09\u4E4B\u4E00");
3513
+ }
3514
+ const structuredDir = args.structuredDir ? String(args.structuredDir) : void 0;
3515
+ const shared = {};
3516
+ for (const k of ["channel", "useOcr", "noSchoolTags"]) if (args[k] !== void 0) shared[k] = args[k];
3517
+ if (Array.isArray(args.tags)) shared.tags = args.tags;
3518
+ const entries = (explicit || scan.files).map((x, i) => {
3519
+ if (explicit) {
3520
+ const file = x?.file ? path.resolve(String(x.file)) : "";
3521
+ return {
3522
+ file,
3523
+ name: file ? path.basename(file) : `\u7B2C${i + 1}\u9879`,
3524
+ structured: x?.structured,
3525
+ structuredFile: x?.structuredFile
3526
+ };
3527
+ }
3528
+ return { file: x.path, name: x.name, structured: void 0, structuredFile: void 0 };
3529
+ });
3530
+ if (entries.length > IMPORT_BATCH_MAX) {
3531
+ throw rsValidationError("batch_too_many", `\u4E00\u6B21\u6700\u591A ${IMPORT_BATCH_MAX} \u4EFD\uFF08\u5F53\u524D ${entries.length} \u4EFD\uFF09\uFF1B\u8BF7\u5206\u6279\u6267\u884C`);
3532
+ }
3533
+ if (!entries.length) {
3534
+ throw rsValidationError("no_resume_files", "\u6CA1\u6709\u627E\u5230\u7B80\u5386\u6587\u4EF6\uFF08\u652F\u6301 pdf/doc/docx/rtf/txt/wps\uFF1B\u76EE\u5F55\u6700\u591A\u5411\u4E0B 4 \u5C42\uFF09");
3535
+ }
3536
+ const items = [];
3537
+ const ready = [];
3538
+ for (let i = 0; i < entries.length; i++) {
3539
+ const e = entries[i];
3540
+ const row = { index: i + 1, file: e.name, path: e.file || void 0 };
3541
+ try {
3542
+ let structured = e.structured;
3543
+ let structuredFile = e.structuredFile ? path.resolve(String(e.structuredFile)) : "";
3544
+ if (!structured && !structuredFile && e.file) {
3545
+ const hit = findStructuredJson({ path: e.file, name: e.name, size: 0 }, structuredDir);
3546
+ if (hit) structuredFile = hit;
3547
+ }
3548
+ if (!structured && !structuredFile && !shared.useOcr) {
3549
+ row.status = "needs_parse";
3550
+ row.message = "\u7F3A\u5C11\u7ED3\u6784\u5316\u6570\u636E\uFF1A\u8BF7\u7531\u5927\u6A21\u578B\u89E3\u6790\u540E\u4EE5 items[].structured\uFF08\u6216\u540C\u540D .json\uFF09\u63D0\u4F9B\uFF1B\u626B\u63CF\u4EF6\u53EF\u663E\u5F0F useOcr:true";
3551
+ items.push(row);
3552
+ continue;
3553
+ }
3554
+ const r = await prepare2({ ...shared, resumeFile: e.file || void 0, structured, structuredFile: structuredFile || void 0 }, env, { skipPermissionProbe: i > 0 });
3555
+ const d = r.data || {};
3556
+ const meta = r.meta || {};
3557
+ const dup = d.duplicate || {};
3558
+ const blocked = dup.unique === false;
3559
+ row.name = d.parsed?.name;
3560
+ row.mobile = d.parsed?.mobile;
3561
+ row.hasStructured = !!(structured || structuredFile);
3562
+ row.duplicateNote = dup.note;
3563
+ if (blocked) {
3564
+ row.status = "blocked";
3565
+ row.message = "\u67E5\u91CD\u672A\u901A\u8FC7\uFF1A" + (dup.note || "\u5DF2\u5B58\u5728\u540C\u624B\u673A\u53F7\u4EBA\u624D");
3566
+ items.push(row);
3567
+ continue;
3568
+ }
3569
+ row.status = "ready";
3570
+ items.push(row);
3571
+ ready.push({ index: i + 1, label: row.name || e.name, file: e.file, args: { ...shared, resumeFile: e.file || void 0, structured, structuredFile: structuredFile || void 0 }, fingerprint: String(meta.fingerprint || "") });
3572
+ } catch (err) {
3573
+ row.status = "failed";
3574
+ row.message = err?.message || "prepare \u5931\u8D25";
3575
+ items.push(row);
3576
+ }
3577
+ }
3578
+ if (!ready.length) {
3579
+ return rsSuccess("recruit-stage.resume.import.batch.prepare", {
3580
+ mode: "batch-prepare",
3581
+ total: items.length,
3582
+ ready: 0,
3583
+ blocked: items.filter((x) => x.status === "blocked").length,
3584
+ needsParse: items.filter((x) => x.status === "needs_parse").length,
3585
+ failed: items.filter((x) => x.status === "failed").length,
3586
+ scanned: scan ? { root: scan.root, files: scan.files.length, warnings: scan.warnings } : void 0,
3587
+ items,
3588
+ hint: "\u6CA1\u6709\u53EF\u6267\u884C\u9879\uFF0C\u9010\u6761\u770B items[].message\uFF08\u5E38\u89C1\uFF1A\u7F3A\u5C11\u7ED3\u6784\u5316 JSON\u3001\u67E5\u91CD\u547D\u4E2D\u3001\u683C\u5F0F\u4E0D\u652F\u6301\uFF09",
3589
+ // 🔴 2026-11-07:本 op 此前无 preview。文件清单可能很大,preview 只保留「文件 + 状态 + 原因」。
3590
+ preview: {
3591
+ action: "\u6279\u91CF\u7B80\u5386\u5BFC\u5165 \u2014 \u65E0\u53EF\u6267\u884C\u9879",
3592
+ total: items.length,
3593
+ blocked: items.filter((x) => x.status === "blocked").length,
3594
+ needsParse: items.filter((x) => x.status === "needs_parse").length,
3595
+ failed: items.filter((x) => x.status === "failed").length,
3596
+ reasons: items.map((x) => `${x.file}\uFF1A${x.message || x.status}`)
3597
+ }
3598
+ });
3599
+ }
3600
+ const fp = createHash3("sha256").update(JSON.stringify(ready.map((x) => [x.file, x.fingerprint]))).digest("hex");
3601
+ const store = saveBatchItems("resume-import", ready);
3602
+ const continuation = await env.continuation.issue({
3603
+ operation: "recruit-stage.resume.import.batch.apply",
3604
+ fingerprint: fp,
3605
+ enumMaps: await dsOptionsSnapshot(),
3606
+ batchFile: store.file,
3607
+ batchFingerprint: store.fingerprint
3608
+ });
3609
+ return rsSuccess("recruit-stage.resume.import.batch.prepare", {
3610
+ mode: "batch-prepare",
3611
+ total: items.length,
3612
+ ready: ready.length,
3613
+ blocked: items.filter((x) => x.status === "blocked").length,
3614
+ needsParse: items.filter((x) => x.status === "needs_parse").length,
3615
+ failed: items.filter((x) => x.status === "failed").length,
3616
+ scanned: scan ? { root: scan.root, files: scan.files.length, warnings: scan.warnings } : void 0,
3617
+ items,
3618
+ note: "\u786E\u8BA4\u540E\u5E26 confirm:true \u4E0E meta.continuation \u8C03 batch.apply\uFF1B\u9010\u4EFD\u5EFA\u6863\uFF0C\u53EF\u80FD\u662F partial",
3619
+ // 🔴 2026-11-07:本 op 此前无 preview。preview 只列「文件 + 状态」,不复制 structured(体积会爆)。
3620
+ preview: {
3621
+ action: "\u6279\u91CF\u7B80\u5386\u5BFC\u5165\uFF08\u9010\u4EFD\u5EFA\u6863\uFF0C\u7ED3\u679C\u53EF\u80FD partial\uFF09",
3622
+ total: items.length,
3623
+ ready: ready.length,
3624
+ blocked: items.filter((x) => x.status === "blocked").length,
3625
+ needsParse: items.filter((x) => x.status === "needs_parse").length,
3626
+ failed: items.filter((x) => x.status === "failed").length,
3627
+ files: items.map((x) => `${x.file} \u2014 ${x.status}${x.message ? "\uFF1A" + x.message : ""}`),
3628
+ scanned: scan ? { root: scan.root, files: scan.files.length, warnings: scan.warnings } : void 0
3629
+ }
3630
+ }, {
3631
+ continuation,
3632
+ fingerprint: fp,
3633
+ confirmHint: "\u7528\u6237\u786E\u8BA4\u6574\u6279\u540D\u5355\u540E\uFF0C\u643A\u5E26 confirm:true \u4E0E\u672C continuation \u8C03\u7528 recruit-stage.resume.import.batch.apply"
3634
+ });
3635
+ }
3636
+ async function batchApply(args, env) {
3637
+ if (args.confirm !== true) {
3638
+ throw rsConfirmationError("recruit-stage.resume.import.batch.apply", { hint: "\u6279\u91CF\u5199\u64CD\u4F5C\u5FC5\u987B\u663E\u5F0F confirm:true" });
3639
+ }
3640
+ if (!args.continuation) throw rsValidationError("continuation_required", "\u7F3A\u5C11 continuation\uFF08\u6765\u81EA batch.prepare \u7684 meta\uFF09");
3641
+ const batch = await env.continuation.verify(String(args.continuation), "recruit-stage.resume.import.batch.apply");
3642
+ const items = loadBatchItems(batch.batchFile, batch.batchFingerprint);
3643
+ if (!items.length) throw rsValidationError("batch_empty", "continuation \u4E2D\u6CA1\u6709\u53EF\u6267\u884C\u7684\u7B80\u5386");
3644
+ const results = [];
3645
+ for (const it of items) {
3646
+ try {
3647
+ const r = await applyCore({ ...it.args || {}, confirm: true }, env, { fingerprint: it.fingerprint, enumMaps: batch.enumMaps });
3648
+ const d = r.data || {};
3649
+ results.push({
3650
+ index: it.index,
3651
+ file: path.basename(String(it.file || "")),
3652
+ name: it.label,
3653
+ status: d.result === "partial" ? "partial" : "success",
3654
+ talentId: d.talentId,
3655
+ cardUrl: d.talentCardUrl,
3656
+ viewLink: d.viewLink,
3657
+ warnings: d.verifyWarnings && d.verifyWarnings.length ? d.verifyWarnings : void 0
3658
+ });
3659
+ } catch (e) {
3660
+ results.push({ index: it.index, file: path.basename(String(it.file || "")), name: it.label, status: "failed", message: e?.message || "\u6267\u884C\u5931\u8D25" });
3661
+ }
3662
+ }
3663
+ const ok = results.filter((x) => x.status === "success").length;
3664
+ const partial = results.filter((x) => x.status === "partial").length;
3665
+ const failed = results.filter((x) => x.status === "failed").length;
3666
+ const lines = [
3667
+ "| # | \u6587\u4EF6 | \u59D3\u540D | \u7ED3\u679C | \u8BF4\u660E |",
3668
+ "|---|---|---|---|---|",
3669
+ ...results.map((x) => `| ${x.index} | ${x.file} | ${x.name || "-"} | ${x.status === "success" ? "\u6210\u529F" : x.status === "partial" ? "\u90E8\u5206\u6210\u529F" : "\u5931\u8D25"} | ${x.message || (x.warnings?.length ? x.warnings.join("\uFF1B") : x.cardUrl ? "\u5DF2\u5EFA\u6863" : "")} |`)
3670
+ ];
3671
+ return rsSuccess("recruit-stage.resume.import.batch.apply", {
3672
+ mode: "batch-apply",
3673
+ result: failed || partial ? "partial" : "success",
3674
+ total: results.length,
3675
+ succeeded: ok,
3676
+ partial,
3677
+ failed,
3678
+ items: results,
3679
+ resultTable: lines.join("\n"),
3680
+ agentNote: "\u628A resultTable \u539F\u6837\u653E\u56DE\u7B54\u6B63\u6587\uFF1B\u5931\u8D25/\u90E8\u5206\u6210\u529F\u7684\u6761\u76EE\u8981\u5E26 message \u8BF4\u660E\u539F\u56E0\uFF0C\u4E0D\u8981\u53EA\u62A5\u603B\u6570\u3002"
3681
+ });
3682
+ }
3153
3683
  var resumeImportOperations = [
3154
3684
  {
3155
3685
  name: "recruit-stage.resume.import.prepare",
@@ -3174,6 +3704,38 @@ var resumeImportOperations = [
3174
3704
  requiresConfirmation: true,
3175
3705
  inputSchema: schemaOf({ ...baseInput2, confirm: { type: "boolean" }, continuation: { type: "string" } }, {}),
3176
3706
  handler: apply2
3707
+ },
3708
+ {
3709
+ name: "recruit-stage.resume.import.batch.prepare",
3710
+ resource: "recruit.resume",
3711
+ method: "prepare",
3712
+ action: "resume.import.batch.prepare",
3713
+ summary: "\u6279\u91CF\u7B80\u5386\u5BFC\u5165\u786E\u8BA4\u6458\u8981\uFF1A\u626B\u63CF\u6587\u4EF6\u5939\u6216 zip\u3001\u9010\u4EFD\u4E0A\u4F20/\u67E5\u91CD/\u5B57\u6BB5\u6620\u5C04\uFF0C\u8F93\u51FA\u53EF\u6267\u884C/\u67E5\u91CD\u62E6\u622A/\u5F85\u89E3\u6790\u6E05\u5355\uFF08\u4E0D\u5EFA\u6863\uFF09\uFF1B\u4E00\u6B21\u6700\u591A 50 \u4EFD",
3714
+ capability: "recruit.resume.import",
3715
+ risk: "write",
3716
+ requiresConfirmation: true,
3717
+ inputSchema: schemaOf({
3718
+ source: { type: "string", description: "\u7B80\u5386\u6587\u4EF6\u5939\u6216 .zip \u5305\u8DEF\u5F84\uFF08\u4E0E items \u4E8C\u9009\u4E00\uFF09" },
3719
+ items: { type: "array", description: "\u663E\u5F0F\u6E05\u5355 [{file, structured?, structuredFile?}]\uFF0C\u4E0E source \u4E8C\u9009\u4E00", items: { type: "object" } },
3720
+ structuredDir: { type: "string", description: "\u7ED3\u6784\u5316 JSON \u76EE\u5F55\uFF08\u6309\u540C\u540D .json \u81EA\u52A8\u5339\u914D\uFF0C\u53EF\u9009\uFF09" },
3721
+ tags: { type: "array", description: "\u7EDF\u4E00\u8FFD\u52A0\u7684\u6807\u7B7E\u540D", items: { type: "string" } },
3722
+ channel: { type: "string", description: "\u6E20\u9053\uFF08\u53EF\u9009\uFF09" },
3723
+ useOcr: { type: "boolean", description: "\u663E\u5F0F\u5F00\u542F OCR \u515C\u5E95\u89E3\u6790\uFF08\u95F8\u95E8=checkResumeExtraction\uFF09" },
3724
+ noSchoolTags: { type: "boolean", description: "\u4E0D\u81EA\u52A8\u63A8\u5BFC\u5B66\u6821\u5F52\u5C5E\u6807\u7B7E" }
3725
+ }, {}),
3726
+ handler: batchPrepare
3727
+ },
3728
+ {
3729
+ name: "recruit-stage.resume.import.batch.apply",
3730
+ resource: "recruit.resume",
3731
+ method: "apply",
3732
+ action: "resume.import.batch.apply",
3733
+ summary: "\u7528\u6237\u786E\u8BA4\u540E\u9010\u4EFD\u5EFA\u6863\uFF08\u4E0A\u4F20\u539F\u4EF6+\u4E3B\u8868\u660E\u7EC6+\u6279\u6B21+\u6807\u7B7E+\u56DE\u67E5\uFF09\uFF0C\u8FD4\u56DE\u9010\u4EFD\u7ED3\u679C\u4E0E Markdown \u8868\u683C\uFF1B\u975E\u539F\u5B50\u6279\u91CF\uFF0C\u7ED3\u679C\u53EF\u80FD\u4E3A partial",
3734
+ capability: "recruit.resume.import",
3735
+ risk: "write",
3736
+ requiresConfirmation: true,
3737
+ inputSchema: schemaOf({ confirm: { type: "boolean" }, continuation: { type: "string" } }, { required: ["confirm", "continuation"] }),
3738
+ handler: batchApply
3177
3739
  }
3178
3740
  ];
3179
3741
 
@@ -3457,7 +4019,9 @@ async function buildPlan(opts) {
3457
4019
  }
3458
4020
  const interviewerTask = (async () => {
3459
4021
  if (interviewer) {
3460
- return { id: await resolvePersonId(host, fid("interviewer"), interviewer), name: interviewer };
4022
+ const id = await resolvePersonId(host, fid("interviewer"), interviewer);
4023
+ if (!id) throw rsFail(`\u9762\u8BD5\u5B98\u300C${interviewer}\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`);
4024
+ return { id, name: interviewer };
3461
4025
  }
3462
4026
  const cu = await resolveCurrentUser(host);
3463
4027
  return cu ? { id: cu.id, name: cu.name } : { id: null, name: interviewer };
@@ -3557,6 +4121,10 @@ async function buildPlan(opts) {
3557
4121
  aiPlanOptions,
3558
4122
  summary: {
3559
4123
  action: "\u5B89\u6392\u9762\u8BD5",
4124
+ talentId,
4125
+ // 单独给一个纯姓名字段:batch 结果表必须用人名,不能拿 talentId 充当「候选人」
4126
+ // (W8:旧版 batch.apply 的 resultTable 显示 100005840000020214,同条 viewLink 却写「李伟」)
4127
+ candidateName: cand.name,
3560
4128
  talent: cand.name + "\uFF08talentId=" + talentId + "\uFF09",
3561
4129
  position: cand.positionName,
3562
4130
  type,
@@ -3653,16 +4221,17 @@ async function resolveInterviewListUrl(ctx) {
3653
4221
  }
3654
4222
  const r = await host.request({ path: `/api/cusapp/app/allMenus?isFront=1&appId=${appId}&terminalType=PC`, method: "GET" });
3655
4223
  const flat = [];
3656
- (function walk(ns) {
4224
+ (function walk2(ns) {
3657
4225
  for (const n of ns || []) if (n && typeof n === "object") {
3658
4226
  flat.push(n);
3659
- walk(n.children || n.childs);
4227
+ walk2(n.children || n.childs);
3660
4228
  }
3661
4229
  })(r?.data?.cusAppMenus || r?.data);
3662
4230
  const node = findMenuNode(flat, ["\u9762\u8BD5\u7BA1\u7406", "\u9762\u8BD5\u5B89\u6392\u5217\u8868", "\u9762\u8BD5\u5B89\u6392"], (n) => n.combinationId && n.id && n.pageId);
3663
4231
  if (!node) return null;
3664
4232
  return `${baseUrl}/ebdapp/view/${appId}/combination/${node.combinationId}-${node.id}/search/${node.pageId}?terminal=PC&cusMenuId=${node.id}`;
3665
4233
  }
4234
+ var DEFAULT_INTERVIEW_TYPE = "\u73B0\u573A\u9762\u8BD5";
3666
4235
  function nowAndEnd(type) {
3667
4236
  const isAI = /AI|人工智能/i.test(String(type || ""));
3668
4237
  const d = /* @__PURE__ */ new Date();
@@ -3717,12 +4286,14 @@ var baseInput3 = {
3717
4286
  email: { type: "string", description: "\u5019\u9009\u4EBA\u90AE\u7BB1\uFF08AI \u9762\u8BD5\u5FC5\u586B\uFF1B\u8865\u5F55\u503C\u4F18\u5148\u4E8E\u4EBA\u624D\u8D44\u6599\uFF09" },
3718
4287
  aiPlan: { type: "string", description: "AI \u9762\u8BD5\u65B9\u6848\u540D\u6216 id\uFF08AI \u9762\u8BD5\u5FC5\u586B\uFF1B\u4E0D\u4F20\u5219 prepare \u5217\u51FA\u5019\u9009\uFF09" }
3719
4288
  };
3720
- async function prepare3(args, env) {
4289
+ async function prepare3(args, env, opts = {}) {
3721
4290
  const ctx = await makeCtx(env);
3722
- const perm = await probeCreatePermission(ctx.host, objIdOf(ctx.cache, "interview_plan"));
3723
- if (perm === "denied") throw rsFail("\u5F53\u524D\u8D26\u53F7\u6CA1\u6709\u300C\u9762\u8BD5\u8BA1\u5212\u300D\u8868\u5355\u7684\u521B\u5EFA\u6743\u9650\uFF0C\u5DF2\u963B\u65AD\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09");
4291
+ if (!opts.skipPermissionProbe) {
4292
+ const perm = await probeCreatePermission(ctx.host, objIdOf(ctx.cache, "interview_plan"));
4293
+ if (perm === "denied") throw rsFail("\u5F53\u524D\u8D26\u53F7\u6CA1\u6709\u300C\u9762\u8BD5\u8BA1\u5212\u300D\u8868\u5355\u7684\u521B\u5EFA\u6743\u9650\uFF0C\u5DF2\u963B\u65AD\uFF08\u672A\u5199\u5165\u4EFB\u4F55\u6570\u636E\uFF09");
4294
+ }
3724
4295
  const talentId = await locateTalentId(ctx, args);
3725
- const auto = nowAndEnd(args.type || "\u73B0\u573A\u9762\u8BD5");
4296
+ const auto = nowAndEnd(String(args.type || DEFAULT_INTERVIEW_TYPE));
3726
4297
  const startTime = args.start || auto.s;
3727
4298
  const endTime = args.end || (args.start ? shiftTime(String(args.start), auto.isAI ? 7 * 24 * 3600 * 1e3 : 3600 * 1e3) || auto.e : auto.e);
3728
4299
  const plan = await buildPlan({
@@ -3730,7 +4301,7 @@ async function prepare3(args, env) {
3730
4301
  talentId,
3731
4302
  positionId: args.positionId ? String(args.positionId) : void 0,
3732
4303
  interviewer: args.interviewer ? String(args.interviewer) : void 0,
3733
- type: String(args.type || "\u73B0\u573A\u9762\u8BD5"),
4304
+ type: String(args.type || DEFAULT_INTERVIEW_TYPE),
3734
4305
  session: String(args.session || "\u521D\u8BD5"),
3735
4306
  start: String(startTime),
3736
4307
  end: String(endTime),
@@ -3749,13 +4320,28 @@ async function prepare3(args, env) {
3749
4320
  }
3750
4321
  const defaultAiPlan = defPlan?.optionId ? { id: defPlan.optionId, name: defPlan.content } : void 0;
3751
4322
  const willSubmit = { formId: plan.formId, objId: plan.objId, dataDetails: plan.dataDetails };
3752
- const { createHash: createHash3 } = await import("node:crypto");
3753
- const fp = createHash3("sha256").update(JSON.stringify(willSubmit)).digest("hex");
4323
+ const { createHash: createHash4 } = await import("node:crypto");
4324
+ const fp = createHash4("sha256").update(JSON.stringify(willSubmit)).digest("hex");
3754
4325
  const continuation = await env.continuation.issue({
3755
4326
  operation: "recruit-stage.interview.arrange.apply",
3756
4327
  fingerprint: fp,
3757
4328
  enumMaps: await dsOptionsSnapshot(),
3758
- timeWindow: { start: String(startTime), end: String(endTime) }
4329
+ timeWindow: { start: String(startTime), end: String(endTime) },
4330
+ // 🔴 参数快照(2026-11-07 修复):协议文档写的是「apply 带 confirm:true + continuation」,
4331
+ // 但 applyCore 原来只从 args 取 talentId/type/session…,Agent 少传任一项就直接报 talent_required。
4332
+ // 现把 prepare 用过的参数一并签进 continuation,apply 可只带 confirm + continuation;
4333
+ // 若 apply 显式传了同名字段,仍以显式值为准(batch 场景每人 talentId 不同,靠这条生效)。
4334
+ argsSnapshot: {
4335
+ talentId,
4336
+ type: String(args.type || DEFAULT_INTERVIEW_TYPE),
4337
+ session: String(args.session || "\u521D\u8BD5"),
4338
+ positionId: args.positionId ? String(args.positionId) : void 0,
4339
+ interviewer: args.interviewer ? String(args.interviewer) : void 0,
4340
+ aiPlan: args.aiPlan ? String(args.aiPlan) : void 0,
4341
+ email: args.email ? String(args.email) : void 0,
4342
+ mobile: args.mobile ? String(args.mobile) : void 0,
4343
+ rounds: args.rounds ? String(args.rounds) : void 0
4344
+ }
3759
4345
  });
3760
4346
  return rsSuccess("recruit-stage.interview.arrange.prepare", {
3761
4347
  mode: "prepare",
@@ -3765,7 +4351,19 @@ async function prepare3(args, env) {
3765
4351
  defaultAiPlan,
3766
4352
  aiPlanHint: plan.isAI && !plan.aiPlanPicked ? "AI\u9762\u8BD5\u65B9\u6848\u4E3A\u5FC5\u586B\uFF1A\u8BF7\u628A aiPlans \u5217\u7ED9\u7528\u6237\u9009\u62E9\uFF08isDefault=true \u4E3A\u9875\u9762\u9ED8\u8BA4\u65B9\u6848\uFF09\uFF0C\u786E\u8BA4\u540E\u5E26 aiPlan \u91CD\u8DD1 apply" : void 0,
3767
4353
  requiredHint,
3768
- willSubmit
4354
+ // 面试方式来源透明化:不传 type 时用 CLI 统一默认,同时把表单默认值一并给出,
4355
+ // 两者不同就给 typeNote,避免"摘要说现场面试、表单默认写视频面试"这种自相矛盾没人发现。
4356
+ typeSource: args.type ? "explicit" : "default",
4357
+ formDefaultInterviewType: requiredHint?.defaultValues?.interview_type?.content,
4358
+ typeNote: !args.type && requiredHint?.defaultValues?.interview_type?.content && String(requiredHint.defaultValues.interview_type.content) !== DEFAULT_INTERVIEW_TYPE ? `\u672C\u6B21\u672A\u6307\u5B9A type\uFF0C\u6309 CLI \u9ED8\u8BA4\u300C${DEFAULT_INTERVIEW_TYPE}\u300D\u63D0\u4EA4\uFF1B\u9875\u9762\u8868\u5355\u9ED8\u8BA4\u662F\u300C${requiredHint.defaultValues.interview_type.content}\u300D\uFF0C\u5982\u9700\u4E0E\u8BE5\u9ED8\u8BA4\u4E00\u81F4\u8BF7\u663E\u5F0F\u4F20 type` : void 0,
4359
+ willSubmit,
4360
+ // 🔴 2026-11-07:prepare 协议约定 preview(人类可读确认摘要),本 op 此前未提供,
4361
+ // 确认链只剩 willSubmit 明细。这里用 summary 全量 + 两处需用户裁决的提示拼出预览。
4362
+ preview: {
4363
+ ...plan.summary,
4364
+ needAiPlan: plan.isAI && !plan.aiPlanPicked,
4365
+ note: plan.isAI && !plan.aiPlanPicked ? "AI \u9762\u8BD5\u65B9\u6848\u672A\u9009\u5B9A\uFF1Aapply \u4F1A\u9010\u4EBA\u963B\u65AD\uFF0C\u9700\u5148\u9009 aiPlan \u91CD\u65B0 prepare" : "\u786E\u8BA4\u59D3\u540D\u3001\u804C\u4F4D\u3001\u9762\u8BD5\u65B9\u5F0F\u3001\u8F6E\u6B21\u3001\u9762\u8BD5\u5B98\u4E0E\u65F6\u95F4\u7A97\u540E\u518D apply"
4366
+ }
3769
4367
  }, {
3770
4368
  continuation,
3771
4369
  fingerprint: fp,
@@ -3776,33 +4374,37 @@ async function apply3(args, env) {
3776
4374
  if (args.confirm !== true) throw rsConfirmationError("recruit-stage.interview.arrange.apply", { hint: "\u5199\u64CD\u4F5C\u5FC5\u987B\u663E\u5F0F confirm:true" });
3777
4375
  if (!args.continuation) throw rsValidationError("continuation_required", "\u7F3A\u5C11 continuation\uFF08\u6765\u81EA prepare \u7684 meta\uFF09");
3778
4376
  const payload = await env.continuation.verify(String(args.continuation), "recruit-stage.interview.arrange.apply");
4377
+ return applyCore2(args, env, payload);
4378
+ }
4379
+ async function applyCore2(args, env, payload) {
3779
4380
  restoreDsOptions(payload.enumMaps);
3780
4381
  const ctx = await makeCtx(env);
3781
- const talentId = await locateTalentId(ctx, args);
3782
- const auto = nowAndEnd(args.type || "\u73B0\u573A\u9762\u8BD5");
3783
- const startTime = args.start || payload.timeWindow?.start || auto.s;
3784
- const endTime = args.end || (args.start ? shiftTime(String(args.start), auto.isAI ? 7 * 24 * 3600 * 1e3 : 3600 * 1e3) || auto.e : payload.timeWindow?.end || auto.e);
4382
+ const merged = { ...payload.argsSnapshot || {}, ...args };
4383
+ const talentId = await locateTalentId(ctx, merged);
4384
+ const auto = nowAndEnd(String(merged.type || DEFAULT_INTERVIEW_TYPE));
4385
+ const startTime = merged.start || payload.timeWindow?.start || auto.s;
4386
+ const endTime = merged.end || (merged.start ? shiftTime(String(merged.start), auto.isAI ? 7 * 24 * 3600 * 1e3 : 3600 * 1e3) || auto.e : payload.timeWindow?.end || auto.e);
3785
4387
  const plan = await buildPlan({
3786
4388
  ctx,
3787
4389
  talentId,
3788
- positionId: args.positionId ? String(args.positionId) : void 0,
3789
- interviewer: args.interviewer ? String(args.interviewer) : void 0,
3790
- type: String(args.type || "\u73B0\u573A\u9762\u8BD5"),
3791
- session: String(args.session || "\u521D\u8BD5"),
4390
+ positionId: merged.positionId ? String(merged.positionId) : void 0,
4391
+ interviewer: merged.interviewer ? String(merged.interviewer) : void 0,
4392
+ type: String(merged.type || DEFAULT_INTERVIEW_TYPE),
4393
+ session: String(merged.session || "\u521D\u8BD5"),
3792
4394
  start: String(startTime),
3793
4395
  end: String(endTime),
3794
- email: args.email ? String(args.email) : void 0,
3795
- mobile: args.mobile ? String(args.mobile) : void 0,
3796
- aiPlan: args.aiPlan ? String(args.aiPlan) : void 0,
3797
- rounds: args.rounds ? String(args.rounds) : void 0
4396
+ email: merged.email ? String(merged.email) : void 0,
4397
+ mobile: merged.mobile ? String(merged.mobile) : void 0,
4398
+ aiPlan: merged.aiPlan ? String(merged.aiPlan) : void 0,
4399
+ rounds: merged.rounds ? String(merged.rounds) : void 0
3798
4400
  });
3799
4401
  plan.host = ctx.host;
3800
4402
  if (plan.isAI && !plan.aiPlanPicked) {
3801
4403
  throw rsFail("AI\u9762\u8BD5\u5FC5\u987B\u9009\u62E9\u300CAI\u9762\u8BD5\u65B9\u6848\u300D\uFF08\u5FC5\u586B\uFF09\uFF0C\u5F53\u524D\u672A\u6307\u5B9A\u3002\u53EF\u9009\u65B9\u6848\uFF1A" + (plan.aiPlanOptions.items?.length ? planBrief(plan.aiPlanOptions.items) : "\uFF08\u65E0\uFF09") + "\u3002\u8BF7\u8BA9\u7528\u6237\u9009\u62E9\u540E\u5E26 aiPlan \u91CD\u8BD5\u3002");
3802
4404
  }
3803
4405
  const willSubmit = { formId: plan.formId, objId: plan.objId, dataDetails: plan.dataDetails };
3804
- const { createHash: createHash3 } = await import("node:crypto");
3805
- if (payload.fingerprint !== createHash3("sha256").update(JSON.stringify(willSubmit)).digest("hex")) {
4406
+ const { createHash: createHash4 } = await import("node:crypto");
4407
+ if (payload.fingerprint !== createHash4("sha256").update(JSON.stringify(willSubmit)).digest("hex")) {
3806
4408
  throw rsValidationError("fingerprint_mismatch", "\u5F85\u63D0\u4EA4\u5185\u5BB9\u4E0E prepare \u786E\u8BA4\u6458\u8981\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0 prepare \u786E\u8BA4\u540E\u518D apply");
3807
4409
  }
3808
4410
  const formDataId = await saveFormData(ctx.host, {
@@ -3836,6 +4438,15 @@ async function apply3(args, env) {
3836
4438
  result: verification.mismatches.length ? "partial" : "success",
3837
4439
  interviewFormId: formDataId,
3838
4440
  interviewCardUrl: detailUrl,
4441
+ // 🔴 回填落库实际采用的关键值(W9):旧版 apply 输出里没有 time,Agent 无法核对
4442
+ // 「输出时间 vs 落库时间」,曾出现差 2 分钟而无人发现。现在 time 直接取本次提交进表单的
4443
+ // dataDetails 时间值(与回查同一来源),所以与落库一致。
4444
+ time: plan.summary.time,
4445
+ talent: plan.summary.talent,
4446
+ position: plan.summary.position,
4447
+ type: plan.summary.type,
4448
+ session: plan.summary.session,
4449
+ interviewer: plan.summary.interviewer,
3839
4450
  viewLink: detailUrl ? `[\u67E5\u770B ${plan.cand.name || ""} \u7684\u9762\u8BD5\u5B89\u6392\u8BE6\u60C5](${detailUrl})` : null,
3840
4451
  listLocateLink: listLocateUrl ? `[\u6253\u5F00\u9762\u8BD5\u7BA1\u7406\u5217\u8868](${listLocateUrl})` : null,
3841
4452
  agentNote: "\u4EA7\u7269 = \u4E24\u4E2A Markdown \u94FE\u63A5\uFF08\u5E73\u53F0\u5B9E\u8BC1\u53EF\u70B9\u51FB\uFF09\uFF1A\u2460 viewLink \u9762\u8BD5\u5B89\u6392\u8BE6\u60C5\u5355\u9875 \u2461 listLocateLink \u9762\u8BD5\u7BA1\u7406\u5217\u8868\uFF08\u53EA\u6253\u5F00\u5217\u8868\uFF0C\u4E0D\u6253\u5F00\u8BE6\u60C5\uFF09\u3002\u6309\u987A\u5E8F\u539F\u6837\u653E\u56DE\u7B54\u6B63\u6587\uFF0C\u7F3A\u54EA\u4E2A\u53EA\u7ED9\u53E6\u4E00\u4E2A\u3001\u4E0D\u8F93\u51FA\u534A\u622A\u3002\u4E0D\u8981\u5305 browsertool / <artifact> \u6807\u7B7E\u3002",
@@ -3852,7 +4463,7 @@ async function prefill2(args, env) {
3852
4463
  const objId = objIdOf(ctx.cache, "interview_plan");
3853
4464
  const formId = formIdOf(ctx.cache, "interview_plan");
3854
4465
  const fields = ctx.cache.fields[objId] || {};
3855
- const typeKey = String(args.type || "AI\u9762\u8BD5");
4466
+ const typeKey = String(args.type || DEFAULT_INTERVIEW_TYPE);
3856
4467
  const typeFid = fields.interview_type;
3857
4468
  if (!typeFid) throw rsFail("\u9762\u8BD5\u8BA1\u5212\u7F3A\u5C11\u5B57\u6BB5 interview_type\uFF08ds/fields \u89E3\u6790\u4E0D\u5230\uFF09");
3858
4469
  const typeMap = await getDsOptions(ctx.host, objId, typeFid);
@@ -3880,6 +4491,166 @@ async function prefill2(args, env) {
3880
4491
  ]
3881
4492
  });
3882
4493
  }
4494
+ var BATCH_MAX = 30;
4495
+ function normalizeCandidateList(raw) {
4496
+ if (!Array.isArray(raw) || !raw.length) {
4497
+ throw rsValidationError("candidates_required", "candidates \u5FC5\u987B\u662F\u975E\u7A7A\u6570\u7EC4\uFF0C\u5143\u7D20\u5F62\u5982 {talentId} / {mobile} / {name}");
4498
+ }
4499
+ if (raw.length > BATCH_MAX) {
4500
+ throw rsValidationError("candidates_too_many", `\u4E00\u6B21\u6700\u591A\u5904\u7406 ${BATCH_MAX} \u4EBA\uFF08\u5F53\u524D ${raw.length} \u4EBA\uFF09\uFF1B\u8BF7\u5206\u6279\u6267\u884C`);
4501
+ }
4502
+ return raw.map((x, i) => {
4503
+ const o = x && typeof x === "object" ? x : {};
4504
+ if (!o.talentId && !o.mobile && !o.name) {
4505
+ throw rsValidationError("candidate_invalid", `\u7B2C ${i + 1} \u4E2A\u5019\u9009\u4EBA\u7F3A\u5C11 talentId/mobile/name`);
4506
+ }
4507
+ return o;
4508
+ });
4509
+ }
4510
+ async function batchPrepare2(args, env) {
4511
+ const list = normalizeCandidateList(args.candidates);
4512
+ const type = String(args.type || DEFAULT_INTERVIEW_TYPE);
4513
+ const auto = nowAndEnd(type);
4514
+ const startTime = String(args.start || auto.s);
4515
+ const endTime = String(args.end || (args.start ? shiftTime(String(args.start), auto.isAI ? 7 * 24 * 3600 * 1e3 : 3600 * 1e3) || auto.e : auto.e));
4516
+ const shared = {};
4517
+ for (const k of ["positionId", "interviewer", "type", "session", "rounds", "aiPlan", "email"]) {
4518
+ if (args[k] !== void 0 && args[k] !== null && String(args[k]).trim() !== "") shared[k] = String(args[k]);
4519
+ }
4520
+ shared.type = type;
4521
+ shared.start = startTime;
4522
+ shared.end = endTime;
4523
+ const items = [];
4524
+ const seen = /* @__PURE__ */ new Set();
4525
+ for (let i = 0; i < list.length; i++) {
4526
+ const c = list[i];
4527
+ const label = String(c.name || c.mobile || c.talentId || `\u7B2C${i + 1}\u4EBA`);
4528
+ try {
4529
+ const r = await prepare3({ ...shared, ...c }, env, { skipPermissionProbe: i > 0 });
4530
+ const d = r.data || {};
4531
+ const talentId = String(d.talentId || "");
4532
+ if (talentId && seen.has(talentId)) {
4533
+ items.push({ index: i + 1, label, talentId, status: "duplicate", message: "\u4E0E\u524D\u9762\u7684\u5019\u9009\u4EBA\u91CD\u590D\uFF0C\u5DF2\u8DF3\u8FC7" });
4534
+ continue;
4535
+ }
4536
+ if (talentId) seen.add(talentId);
4537
+ const meta = r.meta || {};
4538
+ const resolvedName = String(d.candidateName || "").trim();
4539
+ items.push({
4540
+ index: i + 1,
4541
+ label: resolvedName || label,
4542
+ talentId,
4543
+ status: "ready",
4544
+ args: { ...shared, ...c },
4545
+ fingerprint: String(meta.fingerprint || ""),
4546
+ timeWindow: { start: startTime, end: endTime },
4547
+ message: d.needAiPlan ? "AI\u9762\u8BD5\u65B9\u6848\u672A\u9009\uFF08apply \u4F1A\u963B\u65AD\uFF09" : void 0
4548
+ });
4549
+ } catch (e) {
4550
+ items.push({ index: i + 1, label, status: "failed", message: e?.message || "prepare \u5931\u8D25" });
4551
+ }
4552
+ }
4553
+ const ready = items.filter((x) => x.status === "ready");
4554
+ if (!ready.length) {
4555
+ return rsSuccess("recruit-stage.interview.arrange.batch.prepare", {
4556
+ mode: "batch-prepare",
4557
+ total: items.length,
4558
+ ready: 0,
4559
+ failed: items.length,
4560
+ items: items.map(({ args: args2, fingerprint: fingerprint3, timeWindow, ...rest }) => rest),
4561
+ hint: "\u6CA1\u6709\u4EFB\u4F55\u5019\u9009\u4EBA\u53EF\u6267\u884C\uFF0C\u9010\u6761\u770B items[].message \u4FEE\u6B63\u540E\u91CD\u8BD5",
4562
+ preview: {
4563
+ action: "\u6279\u91CF\u5B89\u6392\u9762\u8BD5 \u2014 \u65E0\u53EF\u6267\u884C\u9879",
4564
+ total: items.length,
4565
+ ready: 0,
4566
+ failed: items.length,
4567
+ reasons: items.map((x) => `${x.index}. ${x.label}\uFF1A${x.message || x.status}`)
4568
+ }
4569
+ });
4570
+ }
4571
+ const { createHash: createHash4 } = await import("node:crypto");
4572
+ const fp = createHash4("sha256").update(JSON.stringify(ready.map((x) => [x.talentId, x.fingerprint]))).digest("hex");
4573
+ const continuation = await env.continuation.issue({
4574
+ operation: "recruit-stage.interview.arrange.batch.apply",
4575
+ fingerprint: fp,
4576
+ enumMaps: await dsOptionsSnapshot(),
4577
+ items: ready.map((x) => ({ index: x.index, label: x.label, talentId: x.talentId, args: x.args, fingerprint: x.fingerprint, timeWindow: x.timeWindow }))
4578
+ });
4579
+ return rsSuccess("recruit-stage.interview.arrange.batch.prepare", {
4580
+ mode: "batch-prepare",
4581
+ total: items.length,
4582
+ ready: ready.length,
4583
+ failed: items.filter((x) => x.status === "failed").length,
4584
+ duplicates: items.filter((x) => x.status === "duplicate").length,
4585
+ shared: { type, session: shared.session, rounds: shared.rounds, interviewer: shared.interviewer, time: startTime + " ~ " + endTime, aiPlan: shared.aiPlan },
4586
+ items: items.map(({ args: args2, fingerprint: fingerprint3, timeWindow, ...rest }) => rest),
4587
+ note: "\u786E\u8BA4\u6458\u8981\u540E\u5E26 confirm:true \u4E0E meta.continuation \u8C03 batch.apply\uFF1B\u9010\u4EBA\u6267\u884C\uFF0C\u53EF\u80FD\u662F partial",
4588
+ // 🔴 2026-11-07:本 op 此前无 preview。批量场景用户要看的是「这批到底谁会被约、谁被跳过、为什么」,
4589
+ // 所以 preview 用逐行名单而不是数字汇总。
4590
+ preview: {
4591
+ action: "\u6279\u91CF\u5B89\u6392\u9762\u8BD5\uFF08\u9010\u4EBA\u6267\u884C\uFF0C\u7ED3\u679C\u53EF\u80FD partial\uFF09",
4592
+ total: items.length,
4593
+ ready: ready.length,
4594
+ failed: items.filter((x) => x.status === "failed").length,
4595
+ duplicates: items.filter((x) => x.status === "duplicate").length,
4596
+ shared: { type, session: shared.session, rounds: shared.rounds, interviewer: shared.interviewer, time: startTime + " ~ " + endTime, aiPlan: shared.aiPlan },
4597
+ candidates: items.map((x) => `${x.index}. ${x.label} \u2014 ${x.status}${x.message ? "\uFF1A" + x.message : ""}`)
4598
+ }
4599
+ }, {
4600
+ continuation,
4601
+ fingerprint: fp,
4602
+ confirmHint: "\u7528\u6237\u660E\u786E\u786E\u8BA4\u6574\u6279\u540D\u5355\u540E\uFF0C\u643A\u5E26 confirm:true \u4E0E\u672C continuation \u8C03\u7528 recruit-stage.interview.arrange.batch.apply"
4603
+ });
4604
+ }
4605
+ async function batchApply2(args, env) {
4606
+ if (args.confirm !== true) {
4607
+ throw rsConfirmationError("recruit-stage.interview.arrange.batch.apply", { hint: "\u6279\u91CF\u5199\u64CD\u4F5C\u5FC5\u987B\u663E\u5F0F confirm:true" });
4608
+ }
4609
+ if (!args.continuation) throw rsValidationError("continuation_required", "\u7F3A\u5C11 continuation\uFF08\u6765\u81EA batch.prepare \u7684 meta\uFF09");
4610
+ const batch = await env.continuation.verify(String(args.continuation), "recruit-stage.interview.arrange.batch.apply");
4611
+ const items = Array.isArray(batch.items) ? batch.items : [];
4612
+ if (!items.length) throw rsValidationError("batch_empty", "continuation \u4E2D\u6CA1\u6709\u53EF\u6267\u884C\u7684\u5019\u9009\u4EBA");
4613
+ const results = [];
4614
+ for (const it of items) {
4615
+ const payload = { fingerprint: it.fingerprint, timeWindow: it.timeWindow, enumMaps: batch.enumMaps };
4616
+ try {
4617
+ const r = await applyCore2({ ...it.args || {}, confirm: true }, env, payload);
4618
+ const d = r.data || {};
4619
+ results.push({
4620
+ index: it.index,
4621
+ talentId: it.talentId,
4622
+ name: it.label,
4623
+ candidateName: it.label,
4624
+ status: d.result === "partial" ? "partial" : "success",
4625
+ interviewFormId: d.interviewFormId,
4626
+ cardUrl: d.interviewCardUrl,
4627
+ viewLink: d.viewLink,
4628
+ warnings: d.warnings && d.warnings.length ? d.warnings : void 0
4629
+ });
4630
+ } catch (e) {
4631
+ results.push({ index: it.index, talentId: it.talentId, name: it.label, candidateName: it.label, status: "failed", message: e?.message || "\u6267\u884C\u5931\u8D25" });
4632
+ }
4633
+ }
4634
+ const ok = results.filter((x) => x.status === "success").length;
4635
+ const partial = results.filter((x) => x.status === "partial").length;
4636
+ const failed = results.filter((x) => x.status === "failed").length;
4637
+ const lines = [
4638
+ "| # | \u5019\u9009\u4EBA | \u7ED3\u679C | \u8BF4\u660E |",
4639
+ "|---|---|---|---|",
4640
+ ...results.map((x) => `| ${x.index} | ${x.name} | ${x.status === "success" ? "\u6210\u529F" : x.status === "partial" ? "\u90E8\u5206\u6210\u529F" : "\u5931\u8D25"} | ${x.message || (x.warnings?.length ? x.warnings.join("\uFF1B") : x.cardUrl ? "\u5DF2\u521B\u5EFA\u9762\u8BD5\u5B89\u6392" : "")} |`)
4641
+ ];
4642
+ return rsSuccess("recruit-stage.interview.arrange.batch.apply", {
4643
+ mode: "batch-apply",
4644
+ result: failed || partial ? "partial" : "success",
4645
+ total: results.length,
4646
+ succeeded: ok,
4647
+ partial,
4648
+ failed,
4649
+ items: results,
4650
+ resultTable: lines.join("\n"),
4651
+ agentNote: "\u628A resultTable \u539F\u6837\u653E\u56DE\u7B54\u6B63\u6587\uFF08\u8FD9\u662F\u672C\u6B21\u6279\u91CF\u7EA6\u9762\u7684\u7ED3\u679C\u6E05\u5355\uFF09\uFF1B\u5931\u8D25/\u90E8\u5206\u6210\u529F\u7684\u6761\u76EE\u8981\u8FDE\u540C message \u4E00\u8D77\u8BF4\u6E05\u695A\uFF0C\u4E0D\u8981\u53EA\u62A5\u603B\u6570\u3002"
4652
+ });
4653
+ }
3883
4654
  var interviewArrangeOperations = [
3884
4655
  {
3885
4656
  name: "recruit-stage.interview.arrange.prepare",
@@ -3915,6 +4686,33 @@ var interviewArrangeOperations = [
3915
4686
  risk: "read",
3916
4687
  inputSchema: schemaOf(baseInput3, {}),
3917
4688
  handler: prefill2
4689
+ },
4690
+ {
4691
+ name: "recruit-stage.interview.arrange.batch.prepare",
4692
+ resource: "recruit.interview",
4693
+ method: "prepare",
4694
+ action: "interview.arrange.batch.prepare",
4695
+ summary: "\u6279\u91CF\u7EA6\u9762\u786E\u8BA4\u6458\u8981\uFF1A\u9010\u4EBA\u5B9A\u4F4D\u5019\u9009\u4EBA\u3001\u89E3\u6790\u9762\u8BD5\u65B9\u5F0F/\u8F6E\u6B21\u4E0E\u5FC5\u586B\u9879\uFF0C\u8F93\u51FA\u540D\u5355\u4E0E\u5931\u8D25\u539F\u56E0\uFF08\u91CD\u590D\u81EA\u52A8\u8DF3\u8FC7\uFF09\uFF0C\u4E0D\u5199\u5165\uFF1B\u4E00\u6B21\u6700\u591A 30 \u4EBA",
4696
+ capability: "recruit.interview.arrange",
4697
+ risk: "write",
4698
+ requiresConfirmation: true,
4699
+ inputSchema: schemaOf({
4700
+ candidates: { type: "array", description: "\u5019\u9009\u4EBA\u6570\u7EC4\uFF0C\u5143\u7D20\u4E3A {talentId} / {mobile} / {name} \u4E4B\u4E00\uFF1B\u6700\u591A 30 \u4EBA", items: { type: "object" } },
4701
+ ...baseInput3
4702
+ }, { required: ["candidates"] }),
4703
+ handler: batchPrepare2
4704
+ },
4705
+ {
4706
+ name: "recruit-stage.interview.arrange.batch.apply",
4707
+ resource: "recruit.interview",
4708
+ method: "apply",
4709
+ action: "interview.arrange.batch.apply",
4710
+ summary: "\u7528\u6237\u786E\u8BA4\u540D\u5355\u540E\u9010\u4EBA\u5B89\u6392\u9762\u8BD5\uFF08\u540C\u4E00\u5957\u4FDD\u5B58+\u52A8\u4F5C\u94FE+\u843D\u5E93\u56DE\u67E5\uFF09\uFF0C\u8FD4\u56DE\u9010\u4EBA\u7ED3\u679C\u6E05\u5355\u4E0E Markdown \u8868\u683C\uFF1B\u975E\u539F\u5B50\u6279\u91CF\uFF0C\u7ED3\u679C\u53EF\u80FD\u4E3A partial",
4711
+ capability: "recruit.interview.arrange",
4712
+ risk: "write",
4713
+ requiresConfirmation: true,
4714
+ inputSchema: schemaOf({ confirm: { type: "boolean" }, continuation: { type: "string" } }, { required: ["confirm", "continuation"] }),
4715
+ handler: batchApply2
3918
4716
  }
3919
4717
  ];
3920
4718
 
@@ -4025,12 +4823,20 @@ async function prepare4(args, env) {
4025
4823
  const newComment = args.comment !== void 0 ? String(args.comment) : t.target.judgement;
4026
4824
  const newResultName = args.result ? String(args.result) : t.target.result;
4027
4825
  const willSubmit = { feedbackId: String(t.target.feedbackId), result: newResultName, comment: newComment };
4028
- const { createHash: createHash3 } = await import("node:crypto");
4029
- const fp = createHash3("sha256").update(JSON.stringify(willSubmit)).digest("hex");
4826
+ const { createHash: createHash4 } = await import("node:crypto");
4827
+ const fp = createHash4("sha256").update(JSON.stringify(willSubmit)).digest("hex");
4030
4828
  const continuation = await env.continuation.issue({
4031
4829
  operation: "recruit-stage.interview.feedback.edit.apply",
4032
4830
  fingerprint: fp,
4033
- enumMaps: await dsOptionsSnapshot()
4831
+ enumMaps: await dsOptionsSnapshot(),
4832
+ // 🔴 2026-11-07 修复(同 arrange/jd.create 的同类缺陷):apply 原来只从 args 取 talentId/result/comment,
4833
+ // 导致「只带 confirm + continuation」时定位不到目标或指纹不符。现将这些参数签进 continuation。
4834
+ argsSnapshot: {
4835
+ talentId: t.talentId,
4836
+ feedbackId: args.feedbackId ? String(args.feedbackId) : String(t.target.feedbackId),
4837
+ result: args.result ? String(args.result) : void 0,
4838
+ comment: args.comment !== void 0 ? String(args.comment) : void 0
4839
+ }
4034
4840
  });
4035
4841
  return rsSuccess("recruit-stage.interview.feedback.edit.prepare", {
4036
4842
  mode: "prepare",
@@ -4046,7 +4852,19 @@ async function prepare4(args, env) {
4046
4852
  \u52A8\u4F5C\u6D41: analysis.esbIds.length ? analysis.esbIds : "\uFF08\u8BE5\u6309\u94AE\u65E0 esb \u52A8\u4F5C\u6D41\uFF09",
4047
4853
  \u62DB\u8058API: analysis.jsCalls.map((c) => c.url + (Object.keys(c.data).length ? " data=" + Object.keys(c.data).join(",") : ""))
4048
4854
  } : "\u26A0\uFE0F \u672A\u5B9A\u4F4D\u5230\u300C\u63D0\u4EA4\u8BC4\u4EF7\u300D\u6309\u94AE\uFF08getFormButtons \u672A\u53D6\u5230\u4FDD\u5B58\u6309\u94AE\uFF09\uFF0C\u4EC5\u80FD\u6267\u884C\u4FDD\u5B58+\u5199\u8FC7\u7A0B\u65E5\u5FD7",
4049
- willSubmit
4855
+ willSubmit,
4856
+ // 🔴 2026-11-07:本 op 此前无 preview(与 jd.create 同类缺陷)。把上方的中文字段收进 preview,
4857
+ // 让「确认」这一步有统一的机器可读摘要,而不是只能靠人读散装字段。
4858
+ preview: {
4859
+ action: "\u63D0\u4EA4/\u4FEE\u6539\u9762\u8BD5\u53CD\u9988",
4860
+ \u5019\u9009\u4EBA: t.talentId,
4861
+ \u9762\u8BD5: t.target.planName,
4862
+ \u9762\u8BD5\u5B98: t.target.interviewer,
4863
+ \u53CD\u9988\u8BB0\u5F55Id: t.target.feedbackId,
4864
+ \u5F53\u524D\u53CD\u9988: (t.target.result ? "\u7ED3\u679C " + t.target.result : "") + (t.target.judgement ? "\uFF1B\u8BC4\u4EF7 " + t.target.judgement : ""),
4865
+ \u65B0\u53CD\u9988: (args.result ? "\u7ED3\u679C " + newResultName : "") + (args.comment !== void 0 ? "\uFF1B\u8BC4\u4EF7 " + newComment : ""),
4866
+ \u5C06\u6267\u884C\u52A8\u4F5C: analysis ? { \u4FDD\u5B58\u53CD\u9988\u8868\u5355: "saveFormData\uFF08\u5168\u5B57\u6BB5\u96C6 + updateTimeStamp \u4E50\u89C2\u9501\uFF09", \u52A8\u4F5C\u6D41: analysis.esbIds.length ? analysis.esbIds : "\uFF08\u8BE5\u6309\u94AE\u65E0 esb \u52A8\u4F5C\u6D41\uFF09", \u62DB\u8058API: analysis.jsCalls.map((c) => c.url) } : "\u26A0\uFE0F \u672A\u5B9A\u4F4D\u5230\u300C\u63D0\u4EA4\u8BC4\u4EF7\u300D\u6309\u94AE\uFF0C\u4EC5\u80FD\u6267\u884C\u4FDD\u5B58+\u5199\u8FC7\u7A0B\u65E5\u5FD7"
4867
+ }
4050
4868
  }, { continuation, fingerprint: fp, confirmHint: "\u7528\u6237\u660E\u786E\u786E\u8BA4\u540E\uFF0C\u643A\u5E26 confirm:true \u4E0E continuation \u8C03\u7528 apply" });
4051
4869
  }
4052
4870
  async function apply4(args, env) {
@@ -4054,20 +4872,21 @@ async function apply4(args, env) {
4054
4872
  if (!args.continuation) throw rsValidationError("continuation_required", "\u7F3A\u5C11 continuation\uFF08\u6765\u81EA prepare \u7684 meta\uFF09");
4055
4873
  const payload = await env.continuation.verify(String(args.continuation), "recruit-stage.interview.feedback.edit.apply");
4056
4874
  restoreDsOptions(payload.enumMaps);
4057
- const t = await buildTarget(env, args);
4875
+ const merged = { ...payload.argsSnapshot || {}, ...args };
4876
+ const t = await buildTarget(env, merged);
4058
4877
  const rec2 = await getFormDataRecord(t.host, t.formId, String(t.target.feedbackId), t.objId);
4059
4878
  const details2 = toSubmitDetails(rec2.dataDetails);
4060
4879
  let newOptionId = null;
4061
- if (args.result) {
4880
+ if (merged.result) {
4062
4881
  const opts = await getDsOptions(t.host, t.objId, t.resultFid);
4063
- newOptionId = opts[String(args.result)];
4064
- if (!newOptionId) throw rsFail("\u672A\u8BC6\u522B\u7684\u9762\u8BD5\u7ED3\u679C\u300C" + args.result + "\u300D\uFF0C\u53EF\u9009\uFF1A" + Object.keys(opts).join("/"));
4882
+ newOptionId = opts[String(merged.result)];
4883
+ if (!newOptionId) throw rsFail("\u672A\u8BC6\u522B\u7684\u9762\u8BD5\u7ED3\u679C\u300C" + merged.result + "\u300D\uFF0C\u53EF\u9009\uFF1A" + Object.keys(opts).join("/"));
4065
4884
  }
4066
- const newComment = args.comment !== void 0 ? String(args.comment) : t.target.judgement;
4067
- const newResultName = args.result ? String(args.result) : t.target.result;
4885
+ const newComment = merged.comment !== void 0 ? String(merged.comment) : t.target.judgement;
4886
+ const newResultName = merged.result ? String(merged.result) : t.target.result;
4068
4887
  const willSubmit = { feedbackId: String(t.target.feedbackId), result: newResultName, comment: newComment };
4069
- const { createHash: createHash3 } = await import("node:crypto");
4070
- if (payload.fingerprint !== createHash3("sha256").update(JSON.stringify(willSubmit)).digest("hex")) {
4888
+ const { createHash: createHash4 } = await import("node:crypto");
4889
+ if (payload.fingerprint !== createHash4("sha256").update(JSON.stringify(willSubmit)).digest("hex")) {
4071
4890
  throw rsValidationError("fingerprint_mismatch", "\u5F85\u63D0\u4EA4\u5185\u5BB9\u4E0E prepare \u786E\u8BA4\u6458\u8981\u4E0D\u4E00\u81F4\uFF0C\u8BF7\u91CD\u65B0 prepare \u786E\u8BA4\u540E\u518D apply");
4072
4891
  }
4073
4892
  const newDetails = details2.map((x) => {
@@ -4782,6 +5601,19 @@ function getRecruitStageOperation(operation) {
4782
5601
  }
4783
5602
  async function executeRecruitStageOperation(operation, input, env) {
4784
5603
  const definition = getRecruitStageOperation(operation);
5604
+ const schema = definition.inputSchema;
5605
+ if (schema && schema.additionalProperties === false) {
5606
+ const known = Object.keys(schema.properties || {});
5607
+ const unknown = Object.keys(input || {}).filter((key) => !known.includes(key));
5608
+ if (unknown.length > 0) {
5609
+ throw new RecruitStageCliError(
5610
+ "validation",
5611
+ "unknown_argument",
5612
+ `\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`,
5613
+ { exitCode: 1 }
5614
+ );
5615
+ }
5616
+ }
4785
5617
  return definition.handler(input, env);
4786
5618
  }
4787
5619
 
@@ -4811,10 +5643,10 @@ var recruitStageManifest = {
4811
5643
  };
4812
5644
 
4813
5645
  // src/shortcuts/recruit-stage/context.ts
4814
- import { join as join2, resolve as resolve2 } from "node:path";
5646
+ import { join as join4, resolve as resolve4 } from "node:path";
4815
5647
  import { existsSync as existsSync2 } from "node:fs";
4816
5648
  import { readFile as readFile2 } from "node:fs/promises";
4817
- import { homedir as homedir3 } from "node:os";
5649
+ import { homedir as homedir4 } from "node:os";
4818
5650
  var flowMemo = /* @__PURE__ */ new Map();
4819
5651
  var SELFUSE_DEFAULT_FLOW = {
4820
5652
  selfUseHost: "www.e-cology.com.cn",
@@ -4826,9 +5658,9 @@ function cacheDirFor(baseUrl) {
4826
5658
  const url = new URL(baseUrl);
4827
5659
  const host = url.hostname + (url.port ? `_${url.port}` : "");
4828
5660
  const envRoot = process.env.E10_SKILL_CACHE_DIR;
4829
- if (envRoot) return join2(envRoot, host);
4830
- const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolve2(homedir3(), ".weaver-work-cli");
4831
- return join2(home, "env-cache", "recruit-ops", host);
5661
+ if (envRoot) return join4(envRoot, host);
5662
+ const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolve4(homedir4(), ".weaver-work-cli");
5663
+ return join4(home, "env-cache", "recruit-ops", host);
4832
5664
  }
4833
5665
  async function readLegacyCacheExtra(baseUrl) {
4834
5666
  try {
@@ -4841,7 +5673,7 @@ async function readLegacyCacheExtra(baseUrl) {
4841
5673
  for (const f of jsonFiles) {
4842
5674
  let raw;
4843
5675
  try {
4844
- raw = JSON.parse(await readFile2(join2(dir, f), "utf8"));
5676
+ raw = JSON.parse(await readFile2(join4(dir, f), "utf8"));
4845
5677
  } catch {
4846
5678
  continue;
4847
5679
  }