weaver-work-cli 0.1.70 → 0.1.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{archive-VUTREF3P.js → archive-THZV4ND4.js} +22 -5
- package/dist/chunks/{archive-oa-VXXO4RTB.js → archive-oa-PQ23OLEV.js} +17 -5
- package/dist/chunks/{asset-45U6TY7I.js → asset-RGPROZYH.js} +22 -5
- package/dist/chunks/{asset-idle-YCRBMTIT.js → asset-idle-Z2PDX7NA.js} +15 -5
- package/dist/chunks/{attachment-content-DMU7KNZ7.js → attachment-content-R3RPVOYE.js} +3 -3
- package/dist/chunks/{blog-5AML4WMG.js → blog-7U3QZPIF.js} +25 -5
- package/dist/chunks/{caizhilian-3P7BUNHT.js → caizhilian-3AB42GCV.js} +22 -8
- package/dist/chunks/{calendar-2HUXM3CZ.js → calendar-KINM64E4.js} +15 -5
- package/dist/chunks/{chunk-EHH363SP.js → chunk-2CHGUYMG.js} +4 -4
- package/dist/chunks/{chunk-GWM5TLIK.js → chunk-2XED2FKY.js} +34 -34
- package/dist/chunks/{chunk-DVFA3ODS.js → chunk-35A56FJ7.js} +12 -0
- package/dist/chunks/{chunk-QYDSTYGG.js → chunk-4BXR6CNB.js} +3 -3
- package/dist/chunks/{chunk-KDOJW5LH.js → chunk-4I26YMBY.js} +1 -1
- package/dist/chunks/{chunk-X6PMJQGO.js → chunk-4YXAK6OA.js} +19 -8
- package/dist/chunks/{chunk-HG6INLH6.js → chunk-54ST55IJ.js} +28 -7
- package/dist/chunks/{chunk-DSBV4GRK.js → chunk-6HT73VOI.js} +3 -3
- package/dist/chunks/{chunk-4W6BSNIL.js → chunk-7QFVXP2X.js} +6 -6
- package/dist/chunks/{chunk-I5XB4MZT.js → chunk-AMAPQVBT.js} +95 -65
- package/dist/chunks/{chunk-L2A3COWV.js → chunk-BWYVS62Z.js} +4 -4
- package/dist/chunks/{chunk-UPVAQJKS.js → chunk-DRUND2PJ.js} +130 -79
- package/dist/chunks/{chunk-LJE7RZNC.js → chunk-F4HM25K4.js} +1 -1
- package/dist/chunks/{chunk-T24EBWAZ.js → chunk-GAMGDNTF.js} +48 -21
- package/dist/chunks/{chunk-H2NRTGZR.js → chunk-GWJLAF6B.js} +3 -3
- package/dist/chunks/{chunk-XIBMZEDB.js → chunk-IBSJJGXL.js} +2 -2
- package/dist/chunks/{chunk-VZUH3LKI.js → chunk-ICP53R52.js} +167 -157
- package/dist/chunks/{chunk-LRKKKO5A.js → chunk-IU6UB2TD.js} +3 -4
- package/dist/chunks/{chunk-GTAFCAVP.js → chunk-IZCQU5D5.js} +1 -1
- package/dist/chunks/{chunk-727VKJQK.js → chunk-JMJBPP4B.js} +2 -2
- package/dist/chunks/{chunk-UVWW5ABZ.js → chunk-L7TYG5SN.js} +3 -3
- package/dist/chunks/{chunk-HAORST2G.js → chunk-LLCMOZ5L.js} +11 -11
- package/dist/chunks/{chunk-U3OO3IZF.js → chunk-NUP4RYZK.js} +20 -7
- package/dist/chunks/{chunk-IVCOZCAW.js → chunk-PAFOLIYQ.js} +1 -1
- package/dist/chunks/{chunk-LSVA7QA6.js → chunk-R3MK2RBN.js} +3 -1
- package/dist/chunks/{chunk-GFOFUH6O.js → chunk-TV46Q4NY.js} +52 -51
- package/dist/chunks/chunk-WM33BSIL.js +136 -0
- package/dist/chunks/{chunk-7CINV2BU.js → chunk-XZBYRYWX.js} +2 -2
- package/dist/chunks/{chunk-E7VWE2XI.js → chunk-ZWLWXHJC.js} +3 -3
- package/dist/chunks/{conflict-YW5BULJ3.js → conflict-VPAR7E6F.js} +2 -2
- package/dist/chunks/{contract-3PMHUASH.js → contract-DDXAO2DZ.js} +48 -5
- package/dist/chunks/{cowork-FZBTTBYX.js → cowork-34QCHMDD.js} +37 -8
- package/dist/chunks/{create-flow-5OBS3B3V.js → create-flow-52PU2OBI.js} +6 -6
- package/dist/chunks/{data-2YZ6A6TL.js → data-CLQ62QGD.js} +99 -184
- package/dist/chunks/{ebuilder-form-AWPTMZBZ.js → ebuilder-form-W5R7Q22S.js} +17 -7
- package/dist/chunks/{ehr-MNPR4TE5.js → ehr-LCNAVMK5.js} +67 -17
- package/dist/chunks/{entry-mode-L65OWPFM.js → entry-mode-6Z3ZV3DE.js} +3 -3
- package/dist/chunks/{env-XW7LYIME.js → env-RDKWAARB.js} +2 -2
- package/dist/chunks/{esb-GSB5QCEX.js → esb-ANKPUU65.js} +17 -7
- package/dist/chunks/{factory-MHFZZAGH.js → factory-434B7RAT.js} +1 -1
- package/dist/chunks/{fna-XBSNUS2V.js → fna-AKBSG5HI.js} +15 -5
- package/dist/chunks/{group-chat-EEOLO5NM.js → group-chat-PROTW22R.js} +3 -3
- package/dist/chunks/{host-NVDG3NC6.js → host-5R2SNFWD.js} +4 -4
- package/dist/chunks/{host-2UMNXX5H.js → host-7FJW4E7R.js} +4 -4
- package/dist/chunks/{host-XVWBOSEN.js → host-CGXUFQO4.js} +4 -4
- package/dist/chunks/{host-R7BP3CTI.js → host-PDJAKCT7.js} +6 -4
- package/dist/chunks/{host-SYPCA63D.js → host-WO4L5G5I.js} +4 -4
- package/dist/chunks/{host-BD44ASOD.js → host-XIYG4F4B.js} +4 -4
- package/dist/chunks/{hrm-FZUDJAND.js → hrm-WGODDTEH.js} +15 -6
- package/dist/chunks/{im-F5NENPD7.js → im-YKTKAJU3.js} +16 -6
- package/dist/chunks/{invoice-DS6FLU55.js → invoice-PVYCCCVM.js} +27 -6
- package/dist/chunks/{jiuchuanhui-JCBUR563.js → jiuchuanhui-RKOQW7BY.js} +19 -6
- package/dist/chunks/{lazy-dispatch-F6O2EPGR.js → lazy-dispatch-DW45AFQ5.js} +6 -6
- package/dist/chunks/{mail-ZEOSANEJ.js → mail-BNB5S4NW.js} +116 -97
- package/dist/chunks/{meeting-PCD5EPBF.js → meeting-O2KDJH66.js} +29 -16
- package/dist/chunks/{minute-doc-WTZJVCHG.js → minute-doc-JUCG56GY.js} +4 -4
- package/dist/chunks/{okr-OZUMTMCL.js → okr-LWFGWOE7.js} +15 -5
- package/dist/chunks/{operations-LQY3FTPH.js → operations-2WHIF5WV.js} +1 -1
- package/dist/chunks/{operations-UTUWFJTX.js → operations-532PN5OB.js} +5 -5
- package/dist/chunks/{performance-SMVTPK6T.js → performance-7W5COCFU.js} +92 -7
- package/dist/chunks/{plan-C2NENH42.js → plan-ZVY3IYTL.js} +15 -5
- package/dist/chunks/{project-FAJ2P3UR.js → project-SA62B7MH.js} +18 -5
- package/dist/chunks/{reception-NH6MJFPR.js → reception-NGIONPQ3.js} +128 -49
- package/dist/chunks/{recruit-stage-DPEFHLSE.js → recruit-stage-WOSN6MGP.js} +1264 -197
- package/dist/chunks/{registry-FTPUUHWC.js → registry-N7P3W2RD.js} +5 -5
- package/dist/chunks/{registry-3B3OAJYX.js → registry-R72GWXOG.js} +4 -4
- package/dist/chunks/{registry-ZQ7OONCB.js → registry-RIQ67ZT7.js} +12 -12
- package/dist/chunks/{room-recommend-73NBN3RU.js → room-recommend-KCGIVUFR.js} +4 -4
- package/dist/chunks/{schedule-SDBOBBUQ.js → schedule-6UP27HQ4.js} +4 -4
- package/dist/chunks/{smart-extract-GTYKF5TJ.js → smart-extract-DDOQSPRB.js} +19 -6
- package/dist/chunks/{workflow-OWHWLAOX.js → workflow-V5ALD6QZ.js} +22 -8
- package/dist/cmd/auth/index.js +23 -0
- package/dist/cmd/e10/index.js +2 -1
- package/dist/cmd/index.js +2 -0
- package/dist/core/manifest-view.js +207 -0
- package/dist/core/output.js +42 -8
- package/dist/index.js +35 -35
- package/dist/internal/e10/auth/crypto.js +18 -8
- package/dist/internal/e10/auth/error-log.js +1 -2
- package/dist/internal/e10/auth/messages.js +2 -3
- package/dist/internal/e10/auth/xiaoe.js +1 -1
- package/dist/internal/e10/tls-policy.js +61 -13
- package/dist/shortcuts/archive/index.js +11 -2
- package/dist/shortcuts/archive/operations/download.js +1 -0
- package/dist/shortcuts/archive/operations/flow-url.js +3 -0
- package/dist/shortcuts/archive/operations/prelib.js +2 -0
- package/dist/shortcuts/archive/operations/upload.js +1 -0
- package/dist/shortcuts/archive-oa/index.js +11 -2
- package/dist/shortcuts/archive-oa/operations/borrow-car.js +2 -0
- package/dist/shortcuts/asset/index.js +11 -2
- package/dist/shortcuts/asset/manifest.js +7 -0
- package/dist/shortcuts/asset-idle/index.js +11 -2
- package/dist/shortcuts/blog/index.js +11 -2
- package/dist/shortcuts/blog/manifest.js +10 -0
- package/dist/shortcuts/caizhilian/host.js +20 -4
- package/dist/shortcuts/caizhilian/index.js +12 -2
- package/dist/shortcuts/caizhilian/manifest.js +4 -25
- package/dist/shortcuts/caizhilian/operations/handlers/search.js +34 -0
- package/dist/shortcuts/caizhilian/operations/registry.js +25 -1
- package/dist/shortcuts/calendar/index.js +11 -2
- package/dist/shortcuts/contract/index.js +11 -2
- package/dist/shortcuts/contract/manifest.js +32 -0
- package/dist/shortcuts/contract/operations/write.js +3 -0
- package/dist/shortcuts/cowork/index.js +21 -5
- package/dist/shortcuts/cowork/manifest.js +3 -0
- package/dist/shortcuts/cowork/operations/discuss-write.js +2 -0
- package/dist/shortcuts/cowork/operations/item-write.js +3 -0
- package/dist/shortcuts/cowork/operations/member-write.js +2 -0
- package/dist/shortcuts/cowork/operations/permission-write.js +2 -0
- package/dist/shortcuts/cowork/operations/review-write.js +1 -0
- package/dist/shortcuts/data/errors.js +16 -29
- package/dist/shortcuts/data/host.js +16 -7
- package/dist/shortcuts/data/index.js +12 -41
- package/dist/shortcuts/data/manifest.js +5 -44
- package/dist/shortcuts/data/operations/attend.js +2 -2
- package/dist/shortcuts/data/operations/conf.js +0 -88
- package/dist/shortcuts/data/operations/ds.js +4 -4
- package/dist/shortcuts/data/operations/index.js +1 -5
- package/dist/shortcuts/data/operations/module.js +40 -14
- package/dist/shortcuts/data/operations/query.js +2 -2
- package/dist/shortcuts/ebuilder-form/index.js +11 -2
- package/dist/shortcuts/ebuilder-form/manifest.js +12 -0
- package/dist/shortcuts/ehr/index.js +11 -2
- package/dist/shortcuts/ehr/operations/attend-write.js +51 -8
- package/dist/shortcuts/ehr/operations/recruit-position.js +4 -3
- package/dist/shortcuts/ehr/operations/recruit-short-cache.js +6 -2
- package/dist/shortcuts/ehr/operations/recruit-write.js +3 -3
- package/dist/shortcuts/ehr/operations/recruit.js +206 -82
- package/dist/shortcuts/ehr/operations/shared.js +31 -0
- package/dist/shortcuts/esb/index.js +11 -2
- package/dist/shortcuts/esb/manifest.js +2 -0
- package/dist/shortcuts/fna/index.js +11 -2
- package/dist/shortcuts/hrm/index.js +11 -1
- package/dist/shortcuts/im/index.js +11 -2
- package/dist/shortcuts/invoice/index.js +11 -2
- package/dist/shortcuts/invoice/manifest.js +8 -0
- package/dist/shortcuts/jiuchuanhui/index.js +15 -1
- package/dist/shortcuts/jiuchuanhui/manifest.js +2 -0
- package/dist/shortcuts/mail/errors.js +14 -0
- package/dist/shortcuts/mail/index.js +23 -6
- package/dist/shortcuts/mail/manifest.js +11 -4
- package/dist/shortcuts/mail/operations/mail-blacklist.js +6 -6
- package/dist/shortcuts/mail/operations/mail-contacts.js +10 -10
- package/dist/shortcuts/mail/operations/mail-manage.js +15 -14
- package/dist/shortcuts/mail/operations/mail-read.js +7 -25
- package/dist/shortcuts/mail/operations/mail-send.js +12 -12
- package/dist/shortcuts/mail/operations/mail-sign.js +10 -10
- package/dist/shortcuts/mail/operations/mail-template.js +10 -10
- package/dist/shortcuts/meeting/index.js +11 -2
- package/dist/shortcuts/meeting/operations/invitation-publish.js +1 -0
- package/dist/shortcuts/okr/index.js +11 -2
- package/dist/shortcuts/performance/index.js +62 -3
- package/dist/shortcuts/performance/scheme-validate.js +7 -0
- package/dist/shortcuts/performance/shared.js +40 -2
- package/dist/shortcuts/plan/index.js +11 -2
- package/dist/shortcuts/project/index.js +11 -2
- package/dist/shortcuts/project/operations/write.js +3 -0
- package/dist/shortcuts/reception/constants.js +22 -0
- package/dist/shortcuts/reception/index.js +15 -2
- package/dist/shortcuts/reception/manifest.js +17 -3
- package/dist/shortcuts/reception/operations/ask.js +3 -0
- package/dist/shortcuts/reception/operations/doc.js +24 -11
- package/dist/shortcuts/reception/operations/docrender.js +18 -1
- package/dist/shortcuts/reception/operations/render-assets.js +93 -22
- package/dist/shortcuts/recruit-stage/context.js +12 -6
- package/dist/shortcuts/recruit-stage/index.js +22 -3
- package/dist/shortcuts/recruit-stage/manifest.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +19 -10
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +487 -38
- package/dist/shortcuts/recruit-stage/operations/list.js +72 -1
- package/dist/shortcuts/recruit-stage/operations/profile.js +194 -0
- package/dist/shortcuts/recruit-stage/operations/registry.js +20 -2
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +258 -63
- package/dist/shortcuts/recruit-stage/operations/search.js +226 -27
- package/dist/shortcuts/recruit-stage/operations/shortlist.js +122 -0
- package/dist/shortcuts/recruit-stage/operations/tag.js +17 -3
- package/dist/shortcuts/recruit-stage/shared.js +158 -4
- package/dist/shortcuts/smart-extract/index.js +11 -2
- package/dist/shortcuts/smart-extract/manifest.js +1 -0
- package/dist/shortcuts/smart-extract/operations/save.js +2 -0
- package/dist/shortcuts/workflow/index.js +21 -1
- package/dist/shortcuts/workflow/operations/form.js +36 -2
- package/dist/shortcuts/workflow/operations/read.js +2 -2
- package/dist/shortcuts/workflow/operations/write.js +1 -1
- package/docs/caizhilian.md +1 -1
- package/docs/contract.md +1 -0
- package/docs/data.md +22 -22
- package/docs/e10-auth.md +41 -33
- package/docs/ehr.md +2 -0
- package/docs/reception.md +4 -3
- package/package.json +1 -1
- package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
- package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
- package/scripts/pysite/sitecustomize.py +41 -0
- package/skill-template/domains/data.md +4 -4
- package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
- package/skills/weaver-e10-caizhilian/references/org-browser.md +1 -0
- package/skills/weaver-e10-cowork/SKILL.md +3 -1
- package/skills/weaver-e10-data/SKILL.md +12 -16
- package/skills/weaver-e10-data/references/config-center.md +6 -7
- package/skills/weaver-e10-data/references/datasource.md +1 -1
- package/skills/weaver-e10-data/references/scene-and-misc.md +2 -2
- package/skills/weaver-e10-jiuchuanhui/SKILL.md +6 -4
- package/skills/weaver-e10-jiuchuanhui/references/clue.md +2 -2
- package/skills/weaver-e10-jiuchuanhui/references/customer.md +18 -8
- package/skills/weaver-e10-jiuchuanhui/references/sale.md +2 -2
- package/skills/weaver-e10-jucailin/SKILL.md +7 -3
- package/skills/weaver-e10-jucailin/references/attend-write.md +1 -1
- package/skills/weaver-e10-jucailin/references/recruit-output-links.md +33 -0
- package/skills/weaver-e10-jucailin/references/recruit-write.md +2 -0
- package/skills/weaver-e10-mail/SKILL.md +4 -1
- package/skills/weaver-e10-mail/references/mail-read.md +4 -2
- package/skills/weaver-e10-mail/references/safety-boundaries.md +1 -0
- package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
- package/skills/weaver-e10-performance/SKILL.md +8 -6
- package/skills/weaver-e10-reception-flow/SKILL.md +97 -41
- package/skills/weaver-e10-reception-flow/references/guide.md +3 -1
- package/skills/weaver-e10-recruit-stage/SKILL.md +557 -75
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +67 -44
- package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +279 -0
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +198 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +697 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +507 -0
- package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +87 -0
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +19 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +19 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +15 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +37 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +64 -28
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +43 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +41 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +25 -7
- package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +51 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +63 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +58 -33
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +5 -5
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +11 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
- package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +106 -0
- package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +325 -0
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +265 -0
- package/skills/weaver-e10-shared/SKILL.md +22 -1
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +2 -2
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
- package/skills/weaver-e10-jucailin/references/source-manifest.json +0 -152
|
@@ -50,7 +50,49 @@ async function resolvePureIds(host, ids) {
|
|
|
50
50
|
}
|
|
51
51
|
return map;
|
|
52
52
|
}
|
|
53
|
-
|
|
53
|
+
/** pageSize 归一:默认 10,范围 1~200(服务端单页上限 200,超出会被静默截断且不报错)。 */
|
|
54
|
+
function clampPageSize(v) {
|
|
55
|
+
const n = Number(v);
|
|
56
|
+
if (!Number.isFinite(n) || n <= 0)
|
|
57
|
+
return 10;
|
|
58
|
+
return Math.min(200, Math.trunc(n));
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* 台账视图 objId 解析(进程内 memo,同一 listId 只反查一次)。
|
|
62
|
+
*
|
|
63
|
+
* 🔴 2026-11-28 统一口径:getListDatas / getListDataCount 的 `passid` / `cid`
|
|
64
|
+
* 必须是**台账视图 objId**(`listInit.data.objid`),不是表单 objId。
|
|
65
|
+
* 本文件原先只有 searchByTag 做了这次反查,candidate.search 直接用表单 objId——
|
|
66
|
+
* 自用环境两者恰好相同(实测均为 840741476223959040)所以没暴露,
|
|
67
|
+
* 但**其他环境两者不同,用错会查到别的台账数据且不报错**(静默错数据,最难排查)。
|
|
68
|
+
* 现统一走此函数,与 searchByTag 共用同一口径。
|
|
69
|
+
* 反查失败时回退表单 objId(保持旧行为,不因一次 listInit 失败而整体不可用)。
|
|
70
|
+
*/
|
|
71
|
+
const ledgerObjIdMemo = new Map();
|
|
72
|
+
export async function resolveLedgerObjId(host, listId, fallbackObjId) {
|
|
73
|
+
const key = String(listId || '');
|
|
74
|
+
if (!key)
|
|
75
|
+
return String(fallbackObjId);
|
|
76
|
+
const cached = ledgerObjIdMemo.get(key);
|
|
77
|
+
if (cached)
|
|
78
|
+
return cached;
|
|
79
|
+
try {
|
|
80
|
+
const li = await host.request({ path: '/api/ebuilder/form/list/listInit', body: { listId: key } });
|
|
81
|
+
const v = String(li?.data?.objid || '');
|
|
82
|
+
if (v) {
|
|
83
|
+
ledgerObjIdMemo.set(key, v);
|
|
84
|
+
return v;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch { /* 回退表单 objId */ }
|
|
88
|
+
return String(fallbackObjId);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* 导出给 candidate.shortlist 复用(2026-11-28):批量匹配需要「搜索 + 逐人档案」一次完成,
|
|
92
|
+
* 复用本 handler 可避免关键词字段解析 / 台账 objId 口径 / 时间过滤逻辑出现第二份实现。
|
|
93
|
+
* 注意签名保持 (args, env) 不变,外部调用直接传同一个 env 即可共享 recruitContext 缓存。
|
|
94
|
+
*/
|
|
95
|
+
export async function candidateSearchHandler(args, env) {
|
|
54
96
|
const host = env.host;
|
|
55
97
|
const session = await host.getSession();
|
|
56
98
|
const baseUrl = session.baseUrl.replace(/\/+$/, '');
|
|
@@ -64,21 +106,83 @@ async function handler(args, env) {
|
|
|
64
106
|
const cusMenuId = talent.cusMenuId;
|
|
65
107
|
const menuName = talent.menuName || '人才管理';
|
|
66
108
|
const fields = cache.fields[objId] || {};
|
|
109
|
+
// 🔴 2026-11-28:passid/cid 必须用**台账视图 objId**(listInit.data.objid),不是表单 objId。
|
|
110
|
+
// 自用环境两者相同故旧实现未暴露,但其他环境不同,用错会静默查到别的台账数据。
|
|
111
|
+
// 与 searchByTag 共用同一 memo 化解析,首次多 1 个 HTTP,同 listId 后续复用。
|
|
112
|
+
const ledgerObjId = await resolveLedgerObjId(host, String(listId), String(objId));
|
|
67
113
|
const nameField = 'field_' + (fields.candidate_name || fields.name);
|
|
68
114
|
const mobileField = 'field_' + fields.telephone;
|
|
69
115
|
const name = args.name ? String(args.name) : '';
|
|
70
116
|
const mobile = args.mobile ? String(args.mobile) : '';
|
|
117
|
+
const keyword = args.keyword ? String(args.keyword) : '';
|
|
118
|
+
const createdAfter = args.createdAfter ? String(args.createdAfter) : '';
|
|
71
119
|
const conds = {};
|
|
72
120
|
if (name)
|
|
73
121
|
conds[nameField] = [{ [nameField]: name, [nameField + '_condition_type']: 'like' }];
|
|
74
122
|
if (mobile)
|
|
75
123
|
conds[mobileField] = [{ [mobileField]: mobile, [mobileField + '_condition_type']: 'like' }];
|
|
124
|
+
// 🔴 2026-11-27 关键词跨字段搜索(已按 builder 指南修正方法):
|
|
125
|
+
// · `quickSearchFields` 的 key 必须是**列表已配置的快捷搜索字段 id**,不是任意自定义键;
|
|
126
|
+
// 实测传 `{searchKeyword:"投资"}` 完全无效(total=774291 全库),故不用该通道。
|
|
127
|
+
// · 走 `commonSearchFields` + 多字段 + `type:'or'`,字段清单见 KEYWORD_TEXT_FIELDS,
|
|
128
|
+
// 每项都经 `cache.fields[objId]` 校验存在才用(环境没有就跳过,不拼无效 fieldId)。
|
|
129
|
+
// · 操作符按 `getListSearch` 返回的 conditionType 第一项取,**不再一律 like**
|
|
130
|
+
// (guide-list.md §搜索便捷配置明确告诫)。
|
|
131
|
+
// · 关键词与 name/mobile 互斥:有关键词时忽略 name/mobile,跨多字段 or 匹配。
|
|
132
|
+
// · 组合搜索(keyword + tag)不支持同一请求内混用:commonSearchFields 只有一个 type,
|
|
133
|
+
// or/in 不能同存,需分两步搜。
|
|
134
|
+
let searchType = 'and';
|
|
135
|
+
let searchFields;
|
|
136
|
+
let searchNote;
|
|
137
|
+
// 🔴 A6:keyword 与 name/mobile 同传互斥(commonSearchFields 只有一个 type,or/in 不能同存)。
|
|
138
|
+
// 旧实现静默丢弃 keyword 且回执无提示;现保留 name/mobile 优先,并在回执显式注明。
|
|
139
|
+
let keywordIgnored;
|
|
140
|
+
if (keyword && (name || mobile)) {
|
|
141
|
+
keywordIgnored = {
|
|
142
|
+
keyword,
|
|
143
|
+
reason: 'keyword 与 name/mobile 互斥:本次按 name/mobile 精确条件过滤,keyword 已忽略;如需跨字段关键词搜索,请不要同时传姓名/手机号',
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
if (keyword && !name && !mobile) {
|
|
147
|
+
searchType = 'or';
|
|
148
|
+
const meta = await resolveListSearchMeta(host, String(listId));
|
|
149
|
+
const used = [];
|
|
150
|
+
const fellBack = [];
|
|
151
|
+
for (const dk of KEYWORD_TEXT_FIELDS) {
|
|
152
|
+
const fid = fields[dk];
|
|
153
|
+
if (!fid)
|
|
154
|
+
continue;
|
|
155
|
+
const bare = String(fid);
|
|
156
|
+
const mk = 'field_' + bare;
|
|
157
|
+
const norm = normalizeListOperator(meta.operators[bare]);
|
|
158
|
+
if (norm.fellBack)
|
|
159
|
+
fellBack.push(meta.labels[bare] || dk);
|
|
160
|
+
conds[mk] = [{ [mk]: keyword, [mk + '_condition_type']: norm.op }];
|
|
161
|
+
used.push({ field: dk, label: meta.labels[bare] || dk, operator: norm.op, ...(norm.fellBack ? { operatorFallback: true } : {}) });
|
|
162
|
+
}
|
|
163
|
+
searchFields = used;
|
|
164
|
+
// 🔴 一个字段都没命中时不能静默返回全库:那会让调用方以为"搜到了很多人",
|
|
165
|
+
// 实际是条件为空。显式点名,由调用方决定是否改用 name/mobile 或检查环境字段。
|
|
166
|
+
if (!used.length) {
|
|
167
|
+
searchNote = '关键词搜索未定位到任何可用字段(环境缓存 fields 与目标字段清单无交集),本次未做关键词过滤,返回的是全库分页结果;请改用 name/mobile 精确搜索';
|
|
168
|
+
}
|
|
169
|
+
else if (fellBack.length) {
|
|
170
|
+
searchNote = `字段「${fellBack.join('、')}」配置的操作符不在列表查询已知集合内,已回退 like;如需精确匹配请改用 name/mobile`;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// 🔴 2026-11-27 实测修正:`create_time` 是**系统字段**,不在表单 fields 映射里,
|
|
174
|
+
// 服务端 commonSearchFields 对它完全无效——实测单传 createdAfter 时 total=774293(=全库),
|
|
175
|
+
// 与不传时逐字相同;原实现回退拼出的 'field_create_time' 是无效标记,被服务端静默忽略。
|
|
176
|
+
// 这类"条件被吞但不报错"最危险:调用方以为筛过时间,实际拿到全时段数据。
|
|
177
|
+
// 改为**客户端按返回行的 createTime 过滤**,并在有该条件时放大取数量,避免筛后不足。
|
|
178
|
+
const wantPageSize = clampPageSize(args.pageSize);
|
|
179
|
+
const fetchPageSize = createdAfter ? Math.min(200, Math.max(wantPageSize * 5, 50)) : wantPageSize;
|
|
76
180
|
const baseBody = {
|
|
77
181
|
current: Number(args.current || 1),
|
|
78
|
-
pageSize:
|
|
182
|
+
pageSize: fetchPageSize,
|
|
79
183
|
tableuid: randHex32(),
|
|
80
184
|
listId,
|
|
81
|
-
searchParamData: { searchType: '3', commonSearchFields: conds, type:
|
|
185
|
+
searchParamData: { searchType: '3', commonSearchFields: conds, type: searchType },
|
|
82
186
|
terminal: 'PC', browser: 'Chrome',
|
|
83
187
|
requiredMatch: 1, mapResult: 1, recheckQuery: 1,
|
|
84
188
|
isFollow: 0, isShareToMe: 0, filterCondition: {},
|
|
@@ -91,11 +195,11 @@ async function handler(args, env) {
|
|
|
91
195
|
// 列表 + 计数并行(计数失败用行数兜底)
|
|
92
196
|
const [resp, c] = await Promise.all([
|
|
93
197
|
host.request({
|
|
94
|
-
path: '/api/ebuilder/form/list/getListDatas?passid=' +
|
|
198
|
+
path: '/api/ebuilder/form/list/getListDatas?passid=' + ledgerObjId + '&cid=' + ledgerObjId,
|
|
95
199
|
body: baseBody, headers: extra,
|
|
96
200
|
}),
|
|
97
201
|
host.request({
|
|
98
|
-
path: '/api/ebuilder/form/list/getListDataCount?passid=' +
|
|
202
|
+
path: '/api/ebuilder/form/list/getListDataCount?passid=' + ledgerObjId + '&cid=' + ledgerObjId,
|
|
99
203
|
body: cntBody, headers: extra,
|
|
100
204
|
}).catch(() => null),
|
|
101
205
|
]);
|
|
@@ -111,7 +215,15 @@ async function handler(args, env) {
|
|
|
111
215
|
if (item.option_id && item.selection_name)
|
|
112
216
|
dictNameMap[item.option_id] = item.selection_name;
|
|
113
217
|
}
|
|
114
|
-
const out = {
|
|
218
|
+
const out = {
|
|
219
|
+
env: new URL(baseUrl).hostname, total,
|
|
220
|
+
// 🔴 显式回执「本次关键词实际搜了哪些字段、各用什么操作符」:
|
|
221
|
+
// 条件被服务端静默忽略时(total 与全库相同)调用方无从判断,有了这个清单才能自查。
|
|
222
|
+
...(searchFields ? { keyword, searchFields } : {}),
|
|
223
|
+
...(searchNote ? { searchNote } : {}),
|
|
224
|
+
...(keywordIgnored ? { keywordIgnored } : {}),
|
|
225
|
+
rows: [],
|
|
226
|
+
};
|
|
115
227
|
const outRows = out.rows;
|
|
116
228
|
const inlineNames = rows.map((r) => parsePortalName(r.creator));
|
|
117
229
|
const pureIds = [];
|
|
@@ -137,6 +249,37 @@ async function handler(args, env) {
|
|
|
137
249
|
createTime: r.create_time || null,
|
|
138
250
|
});
|
|
139
251
|
});
|
|
252
|
+
// 🔴 客户端时间过滤:服务端不支持 create_time 条件(实测被静默忽略,见上方注释),
|
|
253
|
+
// 只能在取回的行上按 createTime 筛。
|
|
254
|
+
if (createdAfter) {
|
|
255
|
+
const cutoff = Date.parse(String(createdAfter).replace(/-/g, '/'));
|
|
256
|
+
const fetched = outRows.length;
|
|
257
|
+
if (Number.isNaN(cutoff)) {
|
|
258
|
+
out.timeFilter = {
|
|
259
|
+
createdAfter, mode: 'client', applied: false, fetched, matched: fetched,
|
|
260
|
+
note: 'createdAfter 无法解析为日期(应为 YYYY-MM-DD),本次未做时间过滤,返回的是全时段结果',
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
const kept = outRows.filter((r) => {
|
|
265
|
+
const t = Date.parse(String(r.createTime || '').replace(/-/g, '/'));
|
|
266
|
+
return !Number.isNaN(t) && t >= cutoff;
|
|
267
|
+
});
|
|
268
|
+
out.rows = kept;
|
|
269
|
+
out.returned = kept.length;
|
|
270
|
+
out.timeFilter = {
|
|
271
|
+
createdAfter, mode: 'client', applied: true, fetched, matched: kept.length, fetchPageSize,
|
|
272
|
+
// 🔴 2026-11-28 修「total 语义歧义」:顶层 total 是**服务端未过滤**的总数(关键词命中全量),
|
|
273
|
+
// 不是时间段内的数量。这里显式带出,避免调用方把 total 当成「半年内有多少人」。
|
|
274
|
+
totalUnfiltered: total,
|
|
275
|
+
// 🔴 必须显式声明「命中数 ≠ 该时间段全库总数」:客户端只能筛已取回的行,
|
|
276
|
+
// 不写清会让调用方把 matched 当成真实总数,进而误判「半年内只有这么多人」。
|
|
277
|
+
note: kept.length < wantPageSize
|
|
278
|
+
? `服务端不支持按创建时间过滤,已客户端筛选:取回 ${fetched} 行、命中 ${kept.length} 行(少于期望 ${wantPageSize})。命中数不代表该时间段全库总数,可加大 pageSize 或翻页后重查`
|
|
279
|
+
: `服务端不支持按创建时间过滤,已客户端筛选:取回 ${fetched} 行、命中 ${kept.length} 行`,
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
}
|
|
140
283
|
return rsSuccess('recruit-stage.candidate.search', out);
|
|
141
284
|
}
|
|
142
285
|
/* ══════════ recruit-stage.candidate.searchByTag —— 按标签搜人才(2026-11-12 新增) ══════════
|
|
@@ -168,11 +311,45 @@ function clampInt(v, min, max, fallback) {
|
|
|
168
311
|
return Math.min(max, Math.max(min, Math.trunc(n)));
|
|
169
312
|
}
|
|
170
313
|
function normTag(s) { return String(s == null ? '' : s).trim().toLowerCase(); }
|
|
171
|
-
/**
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
314
|
+
/** 列表查询已知操作符码;配置返回空或不在集合内时回退 like(回执标注 operatorFallback)。 */
|
|
315
|
+
// 🔴 2026-11-28 修复:集合键统一小写。原集合写的是 'inC',但入参先 toLowerCase 变 'inc',
|
|
316
|
+
// 永远命中不了 → inC 条件被静默降级成 like。命中后 op 返回**原样大小写**(后端按原码接收)。
|
|
317
|
+
export const LIST_QUERY_OPS = new Set(['like', 'eq', 'neq', 'ne', 'in', 'between', 'inc', 'contains', 'notlike', 'uncontains']);
|
|
318
|
+
export function normalizeListOperator(raw) {
|
|
319
|
+
const rawStr = String(raw ?? '').trim();
|
|
320
|
+
const s = rawStr.toLowerCase();
|
|
321
|
+
if (s && LIST_QUERY_OPS.has(s))
|
|
322
|
+
return { op: rawStr, fellBack: false };
|
|
323
|
+
return { op: 'like', fellBack: true };
|
|
324
|
+
}
|
|
325
|
+
/** 从 conditionType / conditionTypeValue 里取第一个可用操作符码(形态跨版本不一,逐个兼容)。 */
|
|
326
|
+
function firstConditionType(it) {
|
|
327
|
+
const ct = it?.conditionType ?? it?.conditionTypeValue ?? it?.conditionTypes ?? it?.conditions;
|
|
328
|
+
const pick = (v) => {
|
|
329
|
+
if (typeof v === 'string')
|
|
330
|
+
return v;
|
|
331
|
+
if (v && typeof v === 'object')
|
|
332
|
+
return String(v.value ?? v.key ?? v.code ?? v.conditionType ?? '');
|
|
333
|
+
return '';
|
|
334
|
+
};
|
|
335
|
+
if (Array.isArray(ct)) {
|
|
336
|
+
for (const x of ct) {
|
|
337
|
+
const s = pick(x);
|
|
338
|
+
if (s)
|
|
339
|
+
return s;
|
|
340
|
+
}
|
|
341
|
+
return '';
|
|
342
|
+
}
|
|
343
|
+
return pick(ct);
|
|
344
|
+
}
|
|
345
|
+
async function resolveListSearchMeta(host, listId) {
|
|
346
|
+
const meta = {
|
|
347
|
+
publicKey: FALLBACK_TAG_FIELDS.public,
|
|
348
|
+
privateKey: FALLBACK_TAG_FIELDS.private,
|
|
349
|
+
fromConfig: false,
|
|
350
|
+
operators: {},
|
|
351
|
+
labels: {},
|
|
352
|
+
};
|
|
176
353
|
try {
|
|
177
354
|
const r = await host.request({
|
|
178
355
|
path: '/api/ebuilder/form/listSearch/getListSearch/' + encodeURIComponent(listId),
|
|
@@ -185,21 +362,45 @@ async function resolveTagFields(host, listId) {
|
|
|
185
362
|
continue;
|
|
186
363
|
const raw = String(it.id);
|
|
187
364
|
const key = raw.indexOf('field_') === 0 ? raw : 'field_' + raw;
|
|
188
|
-
const
|
|
365
|
+
const bare = key.slice('field_'.length);
|
|
366
|
+
const label = String(it.label || it.showName || it.fieldName || '');
|
|
367
|
+
if (label)
|
|
368
|
+
meta.labels[bare] = label;
|
|
189
369
|
if (label === '公共标签') {
|
|
190
|
-
publicKey = key;
|
|
191
|
-
fromConfig = true;
|
|
370
|
+
meta.publicKey = key;
|
|
371
|
+
meta.fromConfig = true;
|
|
192
372
|
}
|
|
193
373
|
else if (label === '我的标签') {
|
|
194
|
-
privateKey = key;
|
|
195
|
-
fromConfig = true;
|
|
374
|
+
meta.privateKey = key;
|
|
375
|
+
meta.fromConfig = true;
|
|
196
376
|
}
|
|
377
|
+
const op = firstConditionType(it);
|
|
378
|
+
if (op)
|
|
379
|
+
meta.operators[bare] = op;
|
|
197
380
|
}
|
|
198
381
|
}
|
|
199
382
|
}
|
|
200
|
-
catch { /*
|
|
201
|
-
return
|
|
383
|
+
catch { /* 配置读不到就用兜底:标签走平台常量、操作符走 like;后面负样本仍会校验 */ }
|
|
384
|
+
return meta;
|
|
202
385
|
}
|
|
386
|
+
/**
|
|
387
|
+
* 关键词搜索的目标字段(业务语义清单)。
|
|
388
|
+
* 🔴 每一项都必须经 `cache.fields[objId]` 校验存在才使用——环境没有该字段就跳过,
|
|
389
|
+
* 绝不拼一个无效 fieldId 让服务端静默忽略(那会造成"搜了但没筛"的假成功)。
|
|
390
|
+
* 🔴 实测(2026-11-27 自用环境):BOSS直聘等渠道导入的人才,现职/现公司落在
|
|
391
|
+
* `last_position_id` / `last_company_id`,而 `current_position` / `current_industry` 常为空
|
|
392
|
+
* (后者只在 OCR 解析出 jobInformations[0] 时才写)。两组都搜,否则按职位关键词会大面积漏人。
|
|
393
|
+
*/
|
|
394
|
+
const KEYWORD_TEXT_FIELDS = [
|
|
395
|
+
'candidate_name', // 姓名
|
|
396
|
+
'intend_position', // 期望职位
|
|
397
|
+
'current_position', // 当前职位(OCR 建档才有)
|
|
398
|
+
'last_position_id', // 最近职位(渠道导入常有)
|
|
399
|
+
'current_industry', // 当前公司(OCR 建档才有)
|
|
400
|
+
'last_company_id', // 最近公司(渠道导入常有)
|
|
401
|
+
'college', // 毕业院校
|
|
402
|
+
'self_desc', // 自我评价
|
|
403
|
+
];
|
|
203
404
|
/** 构造标签条件:any = 单条件对象多值(并集);all = 多条件对象(交集) */
|
|
204
405
|
function buildTagCond(ids, keys, mode) {
|
|
205
406
|
const groups = [];
|
|
@@ -284,16 +485,12 @@ async function handlerSearchByTag(args, env) {
|
|
|
284
485
|
via: 'none', total: 0, countFrom: 'local', current, pageSize, rows: [],
|
|
285
486
|
});
|
|
286
487
|
}
|
|
287
|
-
|
|
488
|
+
// 与 candidate.search 共用同一份列表搜索配置解析(标签列 fieldId + 操作符),避免两处实现漂移
|
|
489
|
+
const keys = await resolveListSearchMeta(host, String(listId));
|
|
288
490
|
// getListDatas 的 passid/cid 必须是**台账视图 objId**(listInit.data.objid),不是表单 objId;
|
|
289
491
|
// 两者在某些环境不同,用错会查错台账(forge §19)。失败才回退 context 里的表单 objId。
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
const li = await host.request({ path: '/api/ebuilder/form/list/listInit', body: { listId: String(listId) } });
|
|
293
|
-
if (li?.data?.objid)
|
|
294
|
-
ledgerObjId = String(li.data.objid);
|
|
295
|
-
}
|
|
296
|
-
catch { /* 回退 */ }
|
|
492
|
+
// 与 candidate.search 共用同一个 memo 化解析,避免重复实现与重复 HTTP。
|
|
493
|
+
const ledgerObjId = await resolveLedgerObjId(host, String(listId), String(objId));
|
|
297
494
|
const listPath = '/api/ebuilder/form/list/getListDatas?passid=' + ledgerObjId + '&cid=' + ledgerObjId;
|
|
298
495
|
const countPath = '/api/ebuilder/form/list/getListDataCount?passid=' + ledgerObjId + '&cid=' + ledgerObjId;
|
|
299
496
|
const headers = { ebBusinessId: listId };
|
|
@@ -481,10 +678,12 @@ export const searchOperations = [
|
|
|
481
678
|
inputSchema: schemaOf({
|
|
482
679
|
name: { type: 'string', description: '姓名关键词(like)' },
|
|
483
680
|
mobile: { type: 'string', pattern: '^\\d{6,20}$', description: '手机号(like)' },
|
|
681
|
+
keyword: { type: 'string', description: '跨字段关键词搜索(E10 列表快捷搜索,匹配姓名/职位/公司/院校等)' },
|
|
682
|
+
createdAfter: { type: 'string', description: '创建时间过滤起始日期(YYYY-MM-DD,按 create_time gte 过滤)' },
|
|
484
683
|
pageSize: { type: 'integer', minimum: 1, maximum: 100 },
|
|
485
684
|
current: { type: 'integer', minimum: 1 },
|
|
486
685
|
}, {}),
|
|
487
|
-
handler,
|
|
686
|
+
handler: candidateSearchHandler,
|
|
488
687
|
},
|
|
489
688
|
{
|
|
490
689
|
name: 'recruit-stage.candidate.searchByTag',
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { rsSuccess, schemaOf } from './types.js';
|
|
2
|
+
import { rsFail } from '../errors.js';
|
|
3
|
+
import { candidateSearchHandler } from './search.js';
|
|
4
|
+
import { handlerProfile } from './profile.js';
|
|
5
|
+
function clampInt(v, min, max, fallback) {
|
|
6
|
+
const n = Number(v);
|
|
7
|
+
if (!Number.isFinite(n))
|
|
8
|
+
return fallback;
|
|
9
|
+
return Math.min(max, Math.max(min, Math.trunc(n)));
|
|
10
|
+
}
|
|
11
|
+
/** 精简档案:只留匹配评估真正要读的字段,剥掉 rawMain 等大对象,控制回包体积。 */
|
|
12
|
+
function slimProfile(profile, full) {
|
|
13
|
+
if (full)
|
|
14
|
+
return profile || {};
|
|
15
|
+
const basic = profile?.basic || {};
|
|
16
|
+
const rawMain = profile?.rawMain || {};
|
|
17
|
+
return {
|
|
18
|
+
talentId: profile?.talentId || '',
|
|
19
|
+
name: basic.name || '',
|
|
20
|
+
degree: basic.degree || '',
|
|
21
|
+
college: basic.college || '',
|
|
22
|
+
current_position: basic.current_position || '',
|
|
23
|
+
current_industry: basic.current_industry || '',
|
|
24
|
+
intend_position: basic.intend_position || '',
|
|
25
|
+
expect_salary: basic.expect_salary || '',
|
|
26
|
+
location_area: basic.location_area || '',
|
|
27
|
+
graduate_date: basic.graduate_date || '',
|
|
28
|
+
recruit_status: basic.recruit_status || '',
|
|
29
|
+
// 渠道导入的人才,工作年限常只落在 rawMain.work_exp,这里提出到顶层方便直接读
|
|
30
|
+
work_exp: rawMain.work_exp || '',
|
|
31
|
+
education: profile?.education || [],
|
|
32
|
+
workExperience: profile?.workExperience || [],
|
|
33
|
+
projectExperience: profile?.projectExperience || [],
|
|
34
|
+
subTableStats: profile?.subTableStats || {},
|
|
35
|
+
...(profile?.warnings ? { warnings: profile.warnings } : {}),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
async function handlerShortlist(args, env) {
|
|
39
|
+
const keyword = String(args.keyword || '').trim();
|
|
40
|
+
// 🔴 不做任何关键词改写(2026-11-28 实测撤回折叠逻辑):
|
|
41
|
+
// 岗位名的语义拆槽(行业/职能/层级)属 Agent 侧职责,CLI 只负责按原词取数。
|
|
42
|
+
// 实测折叠内部空格会把多槽 AND 查询降级成子串匹配——「制造业 解决方案 经理」折叠后命中 0,
|
|
43
|
+
// 而拆槽多探针可召回 54 人并把最佳人选排到第 1。详见 SKILL.md §6.7。
|
|
44
|
+
if (!keyword) {
|
|
45
|
+
throw rsFail('keyword 必填:请提供要检索的关键词,例如 {"keyword":"Java开发"}');
|
|
46
|
+
}
|
|
47
|
+
const limit = clampInt(args.limit, 1, 10, 5);
|
|
48
|
+
const concurrency = clampInt(args.concurrency, 1, 10, 5);
|
|
49
|
+
const full = args.full === true;
|
|
50
|
+
const startedAt = Date.now();
|
|
51
|
+
// ① 搜索:只取 limit 行。不传 createdAfter——该条件由客户端筛选并会放大取量,批量场景不需要。
|
|
52
|
+
const tSearch = Date.now();
|
|
53
|
+
const searchEnv = await candidateSearchHandler({
|
|
54
|
+
keyword,
|
|
55
|
+
pageSize: limit,
|
|
56
|
+
...(args.current ? { current: Number(args.current) } : {}),
|
|
57
|
+
}, env);
|
|
58
|
+
const sdata = searchEnv?.data || {};
|
|
59
|
+
const rows = (sdata.rows || []).slice(0, limit);
|
|
60
|
+
const searchMs = Date.now() - tSearch;
|
|
61
|
+
// ② 并发拉详情:按 concurrency 分批,Promise.allSettled 保证单点失败不拖垮整批
|
|
62
|
+
// 🔴 保序约束(2026-11-28 实测):Promise.allSettled 的返回数组与输入 batch 严格同序,
|
|
63
|
+
// 下面按 idx 回填即等价于搜索返回顺序,candidates 天然保持稳定顺序。
|
|
64
|
+
// 禁止改成 Promise.race、全量无序 push 或按完成回调追加——那会让「取前 N 人」每次结果不同。
|
|
65
|
+
const tProfiles = Date.now();
|
|
66
|
+
const candidates = [];
|
|
67
|
+
const errors = [];
|
|
68
|
+
for (let i = 0; i < rows.length; i += concurrency) {
|
|
69
|
+
const batch = rows.slice(i, i + concurrency);
|
|
70
|
+
const settled = await Promise.allSettled(batch.map((r) => handlerProfile({ talentId: r.talentId }, env)));
|
|
71
|
+
settled.forEach((s, idx) => {
|
|
72
|
+
const src = batch[idx] || {};
|
|
73
|
+
if (s.status === 'fulfilled') {
|
|
74
|
+
const data = s.value?.data || {};
|
|
75
|
+
candidates.push(slimProfile(data, full));
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
const reason = s.reason;
|
|
79
|
+
errors.push({
|
|
80
|
+
talentId: src.talentId || null,
|
|
81
|
+
name: src.name || null,
|
|
82
|
+
message: String((reason && reason.message) || reason || '未知错误'),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
const profilesMs = Date.now() - tProfiles;
|
|
88
|
+
return rsSuccess('recruit-stage.candidate.shortlist', {
|
|
89
|
+
keyword,
|
|
90
|
+
// total 是服务端关键词命中总数(不是本次取回数),returned/shown 才是本次实际处理量
|
|
91
|
+
total: Number(sdata.total) || 0,
|
|
92
|
+
returned: rows.length,
|
|
93
|
+
shown: candidates.length,
|
|
94
|
+
limit,
|
|
95
|
+
concurrency,
|
|
96
|
+
...(sdata.searchFields ? { searchFields: sdata.searchFields } : {}),
|
|
97
|
+
...(sdata.searchNote ? { searchNote: sdata.searchNote } : {}),
|
|
98
|
+
listRows: rows,
|
|
99
|
+
candidates,
|
|
100
|
+
...(errors.length ? { errors } : {}),
|
|
101
|
+
timing: { searchMs, profilesMs, totalMs: Date.now() - startedAt },
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
export const shortlistOperations = [
|
|
105
|
+
{
|
|
106
|
+
name: 'recruit-stage.candidate.shortlist',
|
|
107
|
+
resource: 'recruit.candidate',
|
|
108
|
+
method: 'query',
|
|
109
|
+
action: 'candidate.shortlist',
|
|
110
|
+
summary: '关键词一次完成「搜索 + 逐人档案」:只取前 limit 人并并发拉取档案,返回精简档案(工作/项目经历)与分段耗时。用于简历检索与人岗匹配,替代「先 search 再逐人 profile」的多次往返',
|
|
111
|
+
capability: 'recruit.candidate.shortlist',
|
|
112
|
+
risk: 'read',
|
|
113
|
+
inputSchema: schemaOf({
|
|
114
|
+
keyword: { type: 'string', description: '跨字段关键词(匹配姓名/期望职位/当前职位/最近职位/公司/院校/自我评价)' },
|
|
115
|
+
limit: { type: 'integer', minimum: 1, maximum: 10, description: '取前 N 人,默认 5,上限 10' },
|
|
116
|
+
current: { type: 'integer', minimum: 1, description: '搜索结果起始页,默认 1' },
|
|
117
|
+
concurrency: { type: 'integer', minimum: 1, maximum: 10, description: '档案并发数,默认 5' },
|
|
118
|
+
full: { type: 'boolean', description: 'true=返回完整档案(含 rawMain 全字段);默认 false 返回精简档案' },
|
|
119
|
+
}, { required: ['keyword'] }),
|
|
120
|
+
handler: handlerShortlist,
|
|
121
|
+
},
|
|
122
|
+
];
|
|
@@ -125,12 +125,26 @@ function listOperation() {
|
|
|
125
125
|
if (type === 0)
|
|
126
126
|
body.tagModules = ['recruit'];
|
|
127
127
|
const r = await env.host.request({ path: '/api/my/tag/query', method: 'POST', body });
|
|
128
|
-
const
|
|
129
|
-
|
|
128
|
+
const payload = r?.data;
|
|
129
|
+
const list = payload?.data;
|
|
130
|
+
// 🔴 空结果 ≠ 失败(2026-11-27 修):上游「成功但没有标签」时只回 total=0、不带数组。
|
|
131
|
+
// 实测 {code:200,status:true,fail:false,msg:"接口返回成功",data:{total:0}};
|
|
132
|
+
// 以前一律 throw,导致「任何关键词零命中」都被判成查询失败,标签推荐第一步就断。
|
|
133
|
+
const upstreamFailed = r?.status === false
|
|
134
|
+
|| r?.fail === true
|
|
135
|
+
|| (typeof r?.code === 'number' && r.code !== 200);
|
|
136
|
+
if (upstreamFailed)
|
|
130
137
|
throw rsFail('标签库查询失败:' + (r?.msg || '无返回'), { response: r });
|
|
138
|
+
if (!Array.isArray(list)) {
|
|
139
|
+
const total = Number(payload?.total ?? 0);
|
|
140
|
+
if (Number.isFinite(total) && total > 0) {
|
|
141
|
+
throw rsFail('标签库查询失败:返回结构异常(total=' + total + ' 但没有标签数组)', { response: r });
|
|
142
|
+
}
|
|
143
|
+
return rsSuccess('tag.list', { type: type === 0 ? 'public' : 'personal', total: 0, tags: [] });
|
|
144
|
+
}
|
|
131
145
|
return rsSuccess('tag.list', {
|
|
132
146
|
type: type === 0 ? 'public' : 'personal',
|
|
133
|
-
total: Number(
|
|
147
|
+
total: Number(payload?.total ?? list.length),
|
|
134
148
|
tags: list.map((t) => ({
|
|
135
149
|
tagId: String(t.tagId), name: String(t.name), type: Number(t.type ?? 0),
|
|
136
150
|
color: t.color || '', creator: t.creator || '',
|