weaver-work-cli 0.1.71 → 0.1.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{archive-5P33NAUN.js → archive-THZV4ND4.js} +2 -2
- package/dist/chunks/{archive-oa-YTY5D7DG.js → archive-oa-PQ23OLEV.js} +2 -2
- package/dist/chunks/{asset-3Q5MFQBX.js → asset-RGPROZYH.js} +2 -2
- package/dist/chunks/{asset-idle-PQPNYIS7.js → asset-idle-Z2PDX7NA.js} +2 -2
- package/dist/chunks/{attachment-content-7CN7JB6B.js → attachment-content-R3RPVOYE.js} +3 -3
- package/dist/chunks/{blog-MFHHK6ZR.js → blog-7U3QZPIF.js} +2 -2
- package/dist/chunks/{caizhilian-OZ435AYW.js → caizhilian-3AB42GCV.js} +4 -4
- package/dist/chunks/{calendar-TNJXS5UC.js → calendar-KINM64E4.js} +2 -2
- package/dist/chunks/{chunk-VMVMEIL3.js → chunk-2CHGUYMG.js} +4 -4
- package/dist/chunks/{chunk-G7ZM2VOX.js → chunk-2XED2FKY.js} +34 -34
- package/dist/chunks/{chunk-SKWKCLJX.js → chunk-4BXR6CNB.js} +2 -2
- package/dist/chunks/{chunk-EJLP63UO.js → chunk-4I26YMBY.js} +1 -1
- package/dist/chunks/{chunk-OFCF23FY.js → chunk-4YXAK6OA.js} +15 -4
- package/dist/chunks/{chunk-6MMSLE6K.js → chunk-54ST55IJ.js} +5 -1
- package/dist/chunks/{chunk-SSS75WXW.js → chunk-6HT73VOI.js} +2 -2
- package/dist/chunks/{chunk-XLSJC6JZ.js → chunk-7QFVXP2X.js} +6 -6
- package/dist/chunks/{chunk-SUWR5QEG.js → chunk-AMAPQVBT.js} +1 -0
- package/dist/chunks/{chunk-ICNUOWLL.js → chunk-BWYVS62Z.js} +4 -4
- package/dist/chunks/{chunk-UPVAQJKS.js → chunk-DRUND2PJ.js} +130 -79
- package/dist/chunks/{chunk-Q3EXRNB4.js → chunk-F4HM25K4.js} +1 -1
- package/dist/chunks/{chunk-P3AFNAJ6.js → chunk-GAMGDNTF.js} +1 -1
- package/dist/chunks/{chunk-2DNCKZRX.js → chunk-GWJLAF6B.js} +2 -2
- package/dist/chunks/{chunk-VJWVB55R.js → chunk-IBSJJGXL.js} +2 -2
- package/dist/chunks/{chunk-MZVQKQP5.js → chunk-ICP53R52.js} +4 -4
- package/dist/chunks/{chunk-DRJYPXKC.js → chunk-IU6UB2TD.js} +1 -1
- package/dist/chunks/{chunk-OZ7CJC7W.js → chunk-JMJBPP4B.js} +2 -2
- package/dist/chunks/{chunk-B4NINGP2.js → chunk-L7TYG5SN.js} +2 -2
- package/dist/chunks/{chunk-FRMDHZSN.js → chunk-LLCMOZ5L.js} +11 -11
- package/dist/chunks/{chunk-YN5SD4TX.js → chunk-NUP4RYZK.js} +2 -2
- package/dist/chunks/{chunk-OPTJ6IF7.js → chunk-PAFOLIYQ.js} +1 -1
- package/dist/chunks/{chunk-GB2MCJPG.js → chunk-R3MK2RBN.js} +1 -1
- package/dist/chunks/{chunk-X2C5CGGM.js → chunk-TV46Q4NY.js} +50 -50
- package/dist/chunks/{chunk-LU2SPJYY.js → chunk-XZBYRYWX.js} +2 -2
- package/dist/chunks/{chunk-MD5RXRI3.js → chunk-ZWLWXHJC.js} +2 -2
- package/dist/chunks/{conflict-Y4PXZ2YQ.js → conflict-VPAR7E6F.js} +2 -2
- package/dist/chunks/{contract-C3BGUMBM.js → contract-DDXAO2DZ.js} +2 -2
- package/dist/chunks/{cowork-2AWG4QLA.js → cowork-34QCHMDD.js} +2 -2
- package/dist/chunks/{create-flow-LOUOK46Z.js → create-flow-52PU2OBI.js} +6 -6
- package/dist/chunks/{data-BSFYMXVO.js → data-CLQ62QGD.js} +2 -2
- package/dist/chunks/{ebuilder-form-LAAMTD2Y.js → ebuilder-form-W5R7Q22S.js} +3 -3
- package/dist/chunks/{ehr-36KEX5SH.js → ehr-LCNAVMK5.js} +7 -6
- package/dist/chunks/{entry-mode-6N2IGCS4.js → entry-mode-6Z3ZV3DE.js} +3 -3
- package/dist/chunks/{env-QYLS3EB3.js → env-RDKWAARB.js} +2 -2
- package/dist/chunks/{esb-PTYS3E67.js → esb-ANKPUU65.js} +4 -4
- package/dist/chunks/{factory-LPFPKZ4T.js → factory-434B7RAT.js} +1 -1
- package/dist/chunks/{fna-JNHCLRDE.js → fna-AKBSG5HI.js} +2 -2
- package/dist/chunks/{group-chat-QP2WX4QJ.js → group-chat-PROTW22R.js} +3 -3
- package/dist/chunks/{host-7BVR7CQ3.js → host-5R2SNFWD.js} +3 -3
- package/dist/chunks/{host-57LSRSE7.js → host-7FJW4E7R.js} +3 -3
- package/dist/chunks/{host-K2ZKNXME.js → host-CGXUFQO4.js} +3 -3
- package/dist/chunks/{host-NS36QFLR.js → host-PDJAKCT7.js} +3 -3
- package/dist/chunks/{host-C2BLBIID.js → host-WO4L5G5I.js} +3 -3
- package/dist/chunks/{host-QXFKQXNX.js → host-XIYG4F4B.js} +3 -3
- package/dist/chunks/{hrm-FSGO4NSH.js → hrm-WGODDTEH.js} +3 -3
- package/dist/chunks/{im-2BFGS2XO.js → im-YKTKAJU3.js} +3 -3
- package/dist/chunks/{invoice-JKLTTHSZ.js → invoice-PVYCCCVM.js} +3 -3
- package/dist/chunks/{jiuchuanhui-PTABJE7V.js → jiuchuanhui-RKOQW7BY.js} +3 -3
- package/dist/chunks/{lazy-dispatch-YN2ZP3CS.js → lazy-dispatch-DW45AFQ5.js} +5 -5
- package/dist/chunks/{mail-YNO7ZZUK.js → mail-BNB5S4NW.js} +2 -2
- package/dist/chunks/{meeting-NIDHDBCB.js → meeting-O2KDJH66.js} +13 -13
- package/dist/chunks/{minute-doc-G3QAT7DE.js → minute-doc-JUCG56GY.js} +4 -4
- package/dist/chunks/{okr-QC52G6AJ.js → okr-LWFGWOE7.js} +2 -2
- package/dist/chunks/{operations-MQV32ITT.js → operations-532PN5OB.js} +4 -4
- package/dist/chunks/{performance-3MQ3AHDQ.js → performance-7W5COCFU.js} +2 -2
- package/dist/chunks/{plan-ISINIEPY.js → plan-ZVY3IYTL.js} +2 -2
- package/dist/chunks/{project-IJ6DVKT7.js → project-SA62B7MH.js} +2 -2
- package/dist/chunks/{reception-3H5LUG2I.js → reception-NGIONPQ3.js} +113 -44
- package/dist/chunks/{recruit-stage-MIOJXP6W.js → recruit-stage-WOSN6MGP.js} +868 -128
- package/dist/chunks/{registry-NHHKOEU3.js → registry-N7P3W2RD.js} +4 -4
- package/dist/chunks/{registry-3S7AVMXR.js → registry-R72GWXOG.js} +3 -3
- package/dist/chunks/{registry-3GQRYP2R.js → registry-RIQ67ZT7.js} +12 -12
- package/dist/chunks/{room-recommend-IOKBJVYP.js → room-recommend-KCGIVUFR.js} +4 -4
- package/dist/chunks/{schedule-IB6EUARH.js → schedule-6UP27HQ4.js} +4 -4
- package/dist/chunks/{smart-extract-N2TK3CEF.js → smart-extract-DDOQSPRB.js} +3 -3
- package/dist/chunks/{workflow-RINBAL2M.js → workflow-V5ALD6QZ.js} +5 -5
- package/dist/core/output.js +4 -0
- package/dist/index.js +34 -34
- 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/reception/constants.js +22 -0
- package/dist/shortcuts/reception/index.js +4 -0
- package/dist/shortcuts/reception/manifest.js +15 -1
- 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/operations/interview-arrange.js +19 -10
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +454 -22
- package/dist/shortcuts/recruit-stage/operations/list.js +72 -1
- package/dist/shortcuts/recruit-stage/operations/profile.js +13 -5
- package/dist/shortcuts/recruit-stage/operations/registry.js +18 -2
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +192 -26
- package/dist/shortcuts/recruit-stage/operations/search.js +78 -14
- package/dist/shortcuts/recruit-stage/operations/shortlist.js +122 -0
- package/dist/shortcuts/recruit-stage/shared.js +147 -3
- package/dist/shortcuts/workflow/operations/form.js +36 -2
- package/package.json +1 -1
- package/skills/weaver-e10-jucailin/SKILL.md +7 -3
- 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-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 +499 -122
- 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 +159 -11
- package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +2 -2
- 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 +62 -33
- 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 +10 -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 +161 -73
- package/skills/weaver-e10-jucailin/references/source-manifest.json +0 -152
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { randomBytes, randomUUID } from 'node:crypto';
|
|
2
|
-
import { existsSync, mkdirSync, readFileSync,
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
3
3
|
import { homedir } from 'node:os';
|
|
4
4
|
import { join, resolve } from 'node:path';
|
|
5
5
|
import { ehrValidationError } from '../errors.js';
|
|
6
6
|
import { READ, SCHEMA_ID, ehrSuccess, schemaOf, } from './types.js';
|
|
7
|
-
import { compact, normalizePaged, toNumber, toPageQuery, toPositiveInt } from './shared.js';
|
|
7
|
+
import { compact, normalizePaged, toMenuList, toNumber, toPageQuery, toPositiveInt } from './shared.js';
|
|
8
|
+
import { isXiaoECloudRuntime } from '../../../internal/e10/auth/xiaoe.js';
|
|
8
9
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
9
10
|
// 五层运行时解析(迁移自 ehr 技能 _init_env_cache.mjs,真机验证过)
|
|
10
11
|
// getAppIds -> getObjsByTag -> allMenus -> ds/fields -> ds/options
|
|
@@ -14,9 +15,41 @@ import { compact, normalizePaged, toNumber, toPageQuery, toPositiveInt } from '.
|
|
|
14
15
|
// 设同一 E10_SKILL_CACHE_DIR 即可共享缓存)。菜单名跨版本不同,解析不到必须报错,禁止臆造。
|
|
15
16
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
16
17
|
const RECRUIT_APP_TAG = 'weaver-recruit-service';
|
|
18
|
+
/**
|
|
19
|
+
* 自用系统租户标识(2026-11-28 用户指定,租户 key 唯一)。
|
|
20
|
+
*
|
|
21
|
+
* 判「是否自用环境」原有两条依据,都不够稳:
|
|
22
|
+
* · selfUse:来自业务配置表 config_key=-9999,配置表读不到/无权限时恒为 '0';
|
|
23
|
+
* · 域名:同一套自用环境可能有多个入口(www.e-cology.com.cn / 内网 IP / 带端口),
|
|
24
|
+
* 域名不匹配就漏判,但底层数据其实是同一套。
|
|
25
|
+
* tenantKey 是平台级唯一标识,与入口地址、菜单权限、配置表都无关,作为主判据最可靠。
|
|
26
|
+
* 这里只列自用租户;匹配不到仍按原逻辑判断,不影响其他环境。
|
|
27
|
+
*/
|
|
28
|
+
export const SELF_TENANT_KEYS = new Set(['t7akvdnf84']);
|
|
29
|
+
/** 是否自用租户:tenantKey 唯一命中即认定 */
|
|
30
|
+
export function isSelfTenant(tenantKey) {
|
|
31
|
+
const key = String(tenantKey || '').trim();
|
|
32
|
+
return !!key && SELF_TENANT_KEYS.has(key);
|
|
33
|
+
}
|
|
17
34
|
/** 逻辑名 -> objTag(权威映射,与 _init_env_cache.mjs 一致) */
|
|
18
|
-
/**
|
|
19
|
-
|
|
35
|
+
/**
|
|
36
|
+
* 环境缓存结构版本:新增/变更解析字段时 +1,旧缓存自动失效重建。
|
|
37
|
+
*
|
|
38
|
+
* v5(2026-11-28 缓存治理):① 新增 savedAt/degraded 字段;② 命中规则改为
|
|
39
|
+
* 「先闸门取 appId → 精确读 <appId>.json」,旧遍历命中废除;③ 新增 12h TTL。
|
|
40
|
+
* 升版后所有旧缓存(含另一台机器上「菜单失败→字典空」固化的 v4 缓存)自动作废,
|
|
41
|
+
* 无需用户手工删除。
|
|
42
|
+
*/
|
|
43
|
+
export const RECRUIT_CACHE_VERSION = 5;
|
|
44
|
+
/**
|
|
45
|
+
* 磁盘缓存 TTL(2026-11-28 新增)。
|
|
46
|
+
*
|
|
47
|
+
* 旧实现磁盘缓存**永不过期**(实测 19.6 天前的缓存仍在用),菜单改名/字段调整/
|
|
48
|
+
* 字典更新不会被感知,只能手工 cacheVersion+1。快照虽有 12h TTL + 双探针,
|
|
49
|
+
* 但它只在主缓存 miss 后才走——主缓存命中即 return,快照的时效保护被完全短路。
|
|
50
|
+
* 现在主缓存与快照统一 12h:过期 → 快照双探针 → 全量重建,配置漂移最多 12h 自愈。
|
|
51
|
+
*/
|
|
52
|
+
const RECRUIT_CACHE_TTL_MS = 12 * 60 * 60 * 1000;
|
|
20
53
|
/**
|
|
21
54
|
* 关键表单:解析不到字段列表即判定招聘上下文不可用。
|
|
22
55
|
*
|
|
@@ -33,7 +66,15 @@ const RECRUIT_CRITICAL_FORM_LABELS = {
|
|
|
33
66
|
talent_pool: '人才库',
|
|
34
67
|
interview_plan: '面试管理',
|
|
35
68
|
};
|
|
36
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* 磁盘缓存健康检查(2026-11-28 缓存治理后共三条,任一不满足即判坏必须重建):
|
|
71
|
+
* ① 关键表单必须解析到 objId 且字段表非空(原有,11-06 修复);
|
|
72
|
+
* ② degraded 非空 → 本次解析有可选依赖失败(菜单/字典/枚举),上下文残缺;
|
|
73
|
+
* ③(2026-11-28 修订)**已移除**「关键业务列表必须解析到」这一条:菜单接口失败已由
|
|
74
|
+
* degraded 承担;「菜单正常但租户改名/缺项」属环境配置问题,判坏只会让该环境
|
|
75
|
+
* 每次都全量解析(永久慢 2.4 s)而列表功能照样报错,不落盘无收益。
|
|
76
|
+
* 这类环境由 12 h TTL 兜底:配置修正后最迟 12 h 自动重建。
|
|
77
|
+
*/
|
|
37
78
|
function hasCriticalFields(cache) {
|
|
38
79
|
for (const logic of RECRUIT_CRITICAL_FORMS) {
|
|
39
80
|
const objId = cache?.forms?.[logic]?.objId;
|
|
@@ -46,6 +87,13 @@ function hasCriticalFields(cache) {
|
|
|
46
87
|
if (!Object.keys(fmap).length)
|
|
47
88
|
return false;
|
|
48
89
|
}
|
|
90
|
+
// ② 降级标记:非空 = 残缺上下文,绝不复用(防御旧版本/外部写入的 degraded 缓存)
|
|
91
|
+
if (Array.isArray(cache?.degraded) && cache.degraded.length)
|
|
92
|
+
return false;
|
|
93
|
+
// ③(2026-11-28 修订,采纳小E 复审意见):不再强制 candidate/position listId。
|
|
94
|
+
// 「菜单接口失败」已由 degraded 承担;「菜单正常但租户菜单改名/缺项」属环境配置问题,
|
|
95
|
+
// 判坏只会让该环境每次全量解析(永久慢 2.4s)而列表功能照样报错,不落盘无收益。
|
|
96
|
+
// 落盘后由 12h TTL 兜底:环境配置修正后最多 12h 自动重建。
|
|
49
97
|
return true;
|
|
50
98
|
}
|
|
51
99
|
const RECRUIT_TAGS = {
|
|
@@ -131,6 +179,8 @@ function snapshotPathFor(baseUrl) {
|
|
|
131
179
|
return join(cacheDirFor(baseUrl), '..', '_recruit-stage', `context-snapshot-${host}.json`);
|
|
132
180
|
}
|
|
133
181
|
function readContextSnapshot(baseUrl) {
|
|
182
|
+
if (isXiaoECloudRuntime())
|
|
183
|
+
return null; /* 云端容器不持久,读快照无意义 */
|
|
134
184
|
try {
|
|
135
185
|
const raw = JSON.parse(readFileSync(snapshotPathFor(baseUrl), 'utf8'));
|
|
136
186
|
if (!raw?.at || raw.cacheVersion !== RECRUIT_CACHE_VERSION)
|
|
@@ -146,6 +196,11 @@ function readContextSnapshot(baseUrl) {
|
|
|
146
196
|
}
|
|
147
197
|
}
|
|
148
198
|
function writeContextSnapshot(baseUrl, appId, resolved) {
|
|
199
|
+
// 与 persistContextCache 同口径:残缺上下文不写快照(否则快照文件成为永不过期的残缺源)
|
|
200
|
+
if (Array.isArray(resolved?.degraded) && resolved.degraded.length)
|
|
201
|
+
return;
|
|
202
|
+
if (isXiaoECloudRuntime())
|
|
203
|
+
return; /* 云端容器不持久,写快照无意义 */
|
|
149
204
|
try {
|
|
150
205
|
const path = snapshotPathFor(baseUrl);
|
|
151
206
|
mkdirSync(join(path, '..'), { recursive: true });
|
|
@@ -256,6 +311,8 @@ async function fetchFormFields(host, appId, objId) {
|
|
|
256
311
|
}
|
|
257
312
|
/** 五层解析主流程(磁盘缓存缺失时执行;每层失败必须报错,禁止臆造) */
|
|
258
313
|
async function resolveRecruitEnv(host, appId) {
|
|
314
|
+
// 解析降级标记:可选依赖(菜单/字典/枚举)失败时留痕,残缺上下文不落盘不命中(见 hasCriticalFields)
|
|
315
|
+
const degraded = [];
|
|
259
316
|
// L2:tag 解析各表单 objId/formId(顺带 tenantKey)
|
|
260
317
|
// 🔴 2026-11-18 提速:14 个 tag 由串行改并发(原实现逐个 await,冷启动白等 13 个 RTT)。
|
|
261
318
|
// 保持原语义:① 任一请求失败仍向上抛(Promise.all 不吞异常,与原串行一致);
|
|
@@ -285,22 +342,46 @@ async function resolveRecruitEnv(host, appId) {
|
|
|
285
342
|
continue;
|
|
286
343
|
throw new RecruitContextError('recruit_form_unresolved', `当前环境未解析到「${RECRUIT_CRITICAL_FORM_LABELS[logic] || logic}」表单(getObjsByTag 返回空),已中止且未写入缓存;请确认招聘应用已安装、账号对该表单有权限后重试。`);
|
|
287
344
|
}
|
|
345
|
+
// 🔴 2026-11-28:字典表(uf_rcrt_dictionary)是简历来源等字典引用字段的唯一取值源,
|
|
346
|
+
// 解析不到时字典必空——与「字典拉取失败」同性质,必须留痕,否则残缺 dict 落盘固化,
|
|
347
|
+
// 简历录入永远拦在「缺手动录入」。业务配置表(biz_config)有 page/list 兜底,不强制。
|
|
348
|
+
if (!forms.dictionary?.objId)
|
|
349
|
+
degraded.push('dict');
|
|
288
350
|
// L3:allMenus 菜单树 -> SEARCH 列表 + PAGE 页面
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
351
|
+
// 🔴 菜单是「可选依赖」:只用于定位列表/页面入口,页面地址另有固定路由兜底。
|
|
352
|
+
// 接口失败或返回结构不可控(数组 / 包装对象 / 空对象 / 缺字段)都必须降级为空菜单继续,
|
|
353
|
+
// 不得阻断上下文解析——否则一旦失败整份上下文就不会落缓存,换机器后会陷入
|
|
354
|
+
// 「每次冷启动都在同一处失败、且永远不再生成缓存」的死循环。
|
|
355
|
+
//
|
|
356
|
+
// 🔴 2026-11-28 缓存治理:降级必须**留痕**(degraded 标记)。只降级不留痕的话,
|
|
357
|
+
// 「菜单失败 → 数据字典菜单找不到 → 字典整段跳过 → 残缺上下文被判健康落盘」,
|
|
358
|
+
// 之后每次录入都在「简历来源缺手动录入」处被拦(2026-11-28 另一台电脑的事故现场)。
|
|
359
|
+
// 有 degraded 标记的解析结果不落盘、不命中(见 hasCriticalFields),下次自动重建。
|
|
293
360
|
const flat = [];
|
|
294
361
|
const walk = (nodes) => {
|
|
295
|
-
for (const node of nodes
|
|
362
|
+
for (const node of toMenuList(nodes)) {
|
|
296
363
|
if (node && typeof node === 'object') {
|
|
297
364
|
flat.push(node);
|
|
298
|
-
walk(node.children
|
|
365
|
+
walk(node.children ?? node.childs);
|
|
299
366
|
}
|
|
300
367
|
}
|
|
301
368
|
};
|
|
302
|
-
|
|
303
|
-
|
|
369
|
+
let menuFailed = false;
|
|
370
|
+
try {
|
|
371
|
+
const menuResponse = (await host.request({
|
|
372
|
+
path: '/api/cusapp/app/allMenus',
|
|
373
|
+
query: { isFront: 1, appId, terminalType: 'PC' },
|
|
374
|
+
}));
|
|
375
|
+
// 只传 data:由 toMenuList 自行识别 cusAppMenus 包装;不要再 `|| menuData` 把整个对象塞进遍历
|
|
376
|
+
walk(menuResponse?.data);
|
|
377
|
+
}
|
|
378
|
+
catch {
|
|
379
|
+
menuFailed = true; /* 菜单不可用:降级为空菜单,后续解析与业务链路照常继续 */
|
|
380
|
+
}
|
|
381
|
+
// 接口成功但展开后 0 节点同样按失败处理:招聘应用不可能没有菜单,
|
|
382
|
+
// 0 节点说明返回结构异常或权限不足,字典/列表解析必残缺。
|
|
383
|
+
if (menuFailed || !flat.length)
|
|
384
|
+
degraded.push('menus');
|
|
304
385
|
const searchMenus = [];
|
|
305
386
|
const pages = [];
|
|
306
387
|
for (const node of flat) {
|
|
@@ -328,49 +409,60 @@ async function resolveRecruitEnv(host, appId) {
|
|
|
328
409
|
fieldOptions[entry.objId] = omap;
|
|
329
410
|
}));
|
|
330
411
|
// L5:数据字典表全量映射(字典引用类字段如渠道的 optionId 来源)
|
|
412
|
+
// 🔴 2026-11-28:字典是简历录入「固定来源(手动录入)」的唯一取值通道,
|
|
413
|
+
// 拉取失败必须降级留痕(degraded)——否则残缺 dict 落盘固化后,录入永远被拦。
|
|
331
414
|
const dictByName = {};
|
|
332
415
|
const dictRaw = [];
|
|
333
416
|
const dictMenu = searchMenus.find((m) => (m.menuName || '').trim() === '数据字典') || null;
|
|
334
417
|
const dictObjId = forms.dictionary?.objId || '';
|
|
335
418
|
if (dictObjId && dictMenu) {
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
(
|
|
364
|
-
|
|
419
|
+
try {
|
|
420
|
+
const size = 500;
|
|
421
|
+
// 🔴 2026-11-18 提速:批内并发、批间串行(原 for(;;) 逐页 await,N 页线性叠加)。
|
|
422
|
+
// 保留原语义:遇到不满页即判定末页并停止;字典条目按页序消费,dictByName 首次命中顺序不变。
|
|
423
|
+
const CONCURRENCY = 6;
|
|
424
|
+
const fetchDictPage = (pageNo) => host.request({
|
|
425
|
+
path: `/api/ebuilder/form/list/getListDatas?passid=${dictObjId}&cid=${dictObjId}`,
|
|
426
|
+
body: {
|
|
427
|
+
current: pageNo, pageSize: size, tableuid: randHex32(),
|
|
428
|
+
listId: dictMenu.listId,
|
|
429
|
+
searchParamData: { searchType: '3', type: 'and' },
|
|
430
|
+
terminal: 'PC', browser: 'Chrome', requiredMatch: 1, mapResult: 1,
|
|
431
|
+
recheckQuery: 1, isFollow: 0, isShareToMe: 0, filterCondition: {},
|
|
432
|
+
cusMenuId: dictMenu.cusMenuId, urlPageTitle: '数据字典', menuName: '数据字典',
|
|
433
|
+
},
|
|
434
|
+
headers: { ebBusinessId: dictMenu.listId },
|
|
435
|
+
});
|
|
436
|
+
let pageNo = 1;
|
|
437
|
+
let reachedEnd = false;
|
|
438
|
+
while (!reachedEnd) {
|
|
439
|
+
const batchPages = Array.from({ length: CONCURRENCY }, (_, i) => pageNo + i);
|
|
440
|
+
const responses = await Promise.all(batchPages.map((p) => fetchDictPage(p)));
|
|
441
|
+
for (const response of responses) {
|
|
442
|
+
const rows = response?.data?.data || [];
|
|
443
|
+
for (const row of rows) {
|
|
444
|
+
const name = row.selection_name;
|
|
445
|
+
const optionId = row.form_data_id;
|
|
446
|
+
if (name && optionId) {
|
|
447
|
+
(dictByName[String(name)] ||= []).push(String(optionId));
|
|
448
|
+
dictRaw.push({ selection_name: String(name), option_id: String(optionId), dict_type: row.dict_type, browser_key: row.browser_key });
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
if (rows.length < size) {
|
|
452
|
+
reachedEnd = true;
|
|
453
|
+
break;
|
|
365
454
|
}
|
|
366
455
|
}
|
|
367
|
-
|
|
368
|
-
reachedEnd = true;
|
|
369
|
-
break;
|
|
370
|
-
}
|
|
456
|
+
pageNo += CONCURRENCY;
|
|
371
457
|
}
|
|
372
|
-
pageNo += CONCURRENCY;
|
|
373
458
|
}
|
|
459
|
+
catch {
|
|
460
|
+
degraded.push('dict'); /* 字典拉取失败:留痕降级,残缺 dict 不落盘 */
|
|
461
|
+
}
|
|
462
|
+
// 菜单在、表单在、但一条字典都没拉到:要么接口静默失败,要么字典表真没配。
|
|
463
|
+
// 两种都按残缺处理——环境配好后下次重建即恢复。
|
|
464
|
+
if (!Object.keys(dictByName).length)
|
|
465
|
+
degraded.push('dict');
|
|
374
466
|
}
|
|
375
467
|
// 人才卡片页面 id(L1 业务配置表 config_key=28 前台可查;L2 page/list 兜底,失败不阻塞)+ 泛微自用标记
|
|
376
468
|
let ebdDetailPageId = '';
|
|
@@ -431,6 +523,11 @@ async function resolveRecruitEnv(host, appId) {
|
|
|
431
523
|
}
|
|
432
524
|
catch { /* 配置表权限不足不阻塞,保持空 */ }
|
|
433
525
|
}
|
|
526
|
+
// 🔴 自用租户兜底(2026-11-28):tenantKey 命中自用租户即认定,不再依赖业务配置表。
|
|
527
|
+
// 业务配置表要经菜单+表单权限才能读,任一环节缺失 selfUse 就恒为 '0',
|
|
528
|
+
// 导致下游(人才卡片链接、简历导入、面试反馈)漏拼 &recruitType=useSelf 而取错数据。
|
|
529
|
+
if (isSelfTenant(tenantKey))
|
|
530
|
+
selfUse = '1';
|
|
434
531
|
if (!ebdDetailPageId) {
|
|
435
532
|
try {
|
|
436
533
|
const response = (await host.request({
|
|
@@ -447,22 +544,28 @@ async function resolveRecruitEnv(host, appId) {
|
|
|
447
544
|
catch { /* 后台权限不足不阻塞,保持空 */ }
|
|
448
545
|
}
|
|
449
546
|
// ds/options 兼容通道(人才库 recruit_status/channel;字典引用类返回空则跳过)
|
|
547
|
+
// 🔴 2026-11-28:拉取失败从「炸整链」改为降级留痕——枚举失败不该让上下文解析整体失败。
|
|
450
548
|
const options = {};
|
|
451
549
|
for (const [dataKey, logic] of [['recruit_status', 'talent_pool'], ['channel', 'talent_pool']]) {
|
|
452
550
|
const entry = forms[logic] || { objId: '', formId: '', objName: '' };
|
|
453
551
|
const fieldId = (fields[entry.objId] || {})[dataKey] || '';
|
|
454
552
|
if (fieldId && entry.objId) {
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
553
|
+
try {
|
|
554
|
+
const response = (await host.request({
|
|
555
|
+
path: '/api/ebuilder/common/ds/options',
|
|
556
|
+
query: { fieldName: fieldId, objId: entry.objId, sourceType: 'FORM', groupId: appId },
|
|
557
|
+
}));
|
|
558
|
+
if (Array.isArray(response?.data)) {
|
|
559
|
+
options[dataKey] = {};
|
|
560
|
+
for (const option of response.data) {
|
|
561
|
+
if (option?.id)
|
|
562
|
+
options[dataKey][String(option.id)] = option.name;
|
|
563
|
+
}
|
|
464
564
|
}
|
|
465
565
|
}
|
|
566
|
+
catch {
|
|
567
|
+
degraded.push(`options:${dataKey}`); /* 枚举拉取失败:留痕降级 */
|
|
568
|
+
}
|
|
466
569
|
}
|
|
467
570
|
}
|
|
468
571
|
const lists = {
|
|
@@ -481,6 +584,7 @@ async function resolveRecruitEnv(host, appId) {
|
|
|
481
584
|
return {
|
|
482
585
|
appId,
|
|
483
586
|
tenantKey,
|
|
587
|
+
degraded,
|
|
484
588
|
forms,
|
|
485
589
|
lists,
|
|
486
590
|
fields,
|
|
@@ -497,32 +601,20 @@ export function createRecruitContextLoader() {
|
|
|
497
601
|
const session = await host.getSession();
|
|
498
602
|
const baseUrl = session.baseUrl.replace(/\/+$/, '');
|
|
499
603
|
const memoKey = baseUrl;
|
|
500
|
-
//
|
|
501
|
-
//
|
|
604
|
+
// 进程内 memo:同一进程多次 load 直接复用(CLI 单次调用通常只跑一个 operation,
|
|
605
|
+
// memo 主要惠及单次调用内的多次 load 与测试场景)。
|
|
502
606
|
let cached = memo.get(memoKey);
|
|
503
607
|
if (cached)
|
|
504
608
|
return cached;
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
appId = files[0].replace(/\.json$/, '');
|
|
515
|
-
diskCache = JSON.parse(readFileSync(join(dir, files[0]), 'utf8'));
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
catch { /* 缓存读取失败回退闸门链路 */ }
|
|
520
|
-
// 命中缓存前必须校验关键表单字段;版本对但字段表为空的坏缓存不复用,继续走闸门重建。
|
|
521
|
-
if (diskCache && diskCache.cacheVersion === RECRUIT_CACHE_VERSION && hasCriticalFields(diskCache)) {
|
|
522
|
-
memo.set(memoKey, diskCache);
|
|
523
|
-
return diskCache;
|
|
524
|
-
}
|
|
525
|
-
// 安装闸门:getAppIds(tag) 取 appId(空=未安装招聘服务,必须明确报错)
|
|
609
|
+
// 🔴 2026-11-28 缓存治理:网页端/沙箱(XIAOE_CLIENT_TYPE=cloud/web/browser)容器不持久,
|
|
610
|
+
// 写盘永不命中、只读盘还会抛错——一律跳过磁盘缓存,只留进程内 memo。
|
|
611
|
+
// 每次全量解析 ~2.4s(11-28 实测口径),属设计内成本;不要为它加预热调用(prewarm 已证伪无收益)。
|
|
612
|
+
const cloudRuntime = isXiaoECloudRuntime();
|
|
613
|
+
// 安装闸门前置(2026-11-28 改序):先 getAppIds 拿到「当前环境的正确 appId」,
|
|
614
|
+
// 再按 appId 精确读 <appId>.json。旧实现「先遍历目录命中、闸门在命中之后」有结构性缺陷:
|
|
615
|
+
// 命中时根本不知道当前 appId,只能靠「目录内恰好 1 个 json」间接保证;多份缓存
|
|
616
|
+
// (换 appId / 重装 / 另一套工具写入)时会随机命中错误的 appId。前置闸门只多花
|
|
617
|
+
// 1 个 RTT(相对全量解析 46 个请求可忽略),换来归属确定性。
|
|
526
618
|
const gate = (await host.request({
|
|
527
619
|
path: '/api/bs/ebuilder/app/tags/getAppIds',
|
|
528
620
|
query: { tag: RECRUIT_APP_TAG },
|
|
@@ -531,8 +623,25 @@ export function createRecruitContextLoader() {
|
|
|
531
623
|
if (!Array.isArray(appIds) || !appIds.length) {
|
|
532
624
|
throw new RecruitContextError('recruit_service_not_installed', '当前租户未安装招聘服务(weaver-recruit-service),无法使用招聘能力。请先在 E10 应用市场安装「招聘」应用。');
|
|
533
625
|
}
|
|
534
|
-
appId = String(appIds[0]);
|
|
535
|
-
//
|
|
626
|
+
const appId = String(appIds[0]);
|
|
627
|
+
// 磁盘缓存:按 appId 精确读(不再遍历目录)。命中条件 = 版本一致 + 通过健康检查 + 未过 TTL。
|
|
628
|
+
// 残缺/过期/降版文件留在盘上作诊断证据,重建成功后被同名覆盖。
|
|
629
|
+
if (!cloudRuntime) {
|
|
630
|
+
try {
|
|
631
|
+
const file = join(cacheDirFor(baseUrl), `${appId}.json`);
|
|
632
|
+
if (existsSync(file)) {
|
|
633
|
+
const candidate = JSON.parse(readFileSync(file, 'utf8'));
|
|
634
|
+
const savedAt = Number(candidate?.savedAt || 0);
|
|
635
|
+
const fresh = savedAt > 0 && (Date.now() - savedAt) <= RECRUIT_CACHE_TTL_MS;
|
|
636
|
+
if (candidate && candidate.cacheVersion === RECRUIT_CACHE_VERSION && fresh && hasCriticalFields(candidate)) {
|
|
637
|
+
memo.set(memoKey, candidate);
|
|
638
|
+
return candidate;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
catch { /* 缓存读取失败回退快照/全量链路 */ }
|
|
643
|
+
}
|
|
644
|
+
// 冷启动快照试用:闸门已确认 appId,再用 1 个 tag 探针确认「表单 objId 未变」,
|
|
536
645
|
// 两条都过就采用快照(省掉 allMenus / 13 份字段表 / 字典分页 / 选项 ≈ 2 s)。
|
|
537
646
|
const snapshot = readContextSnapshot(baseUrl);
|
|
538
647
|
if (snapshot && snapshot.appId === appId && !process.env.E10_RS_NO_CTX_SNAPSHOT) {
|
|
@@ -567,6 +676,19 @@ export function createRecruitContextLoader() {
|
|
|
567
676
|
}
|
|
568
677
|
/** 写环境上下文磁盘缓存(结构同 ehr 技能 v5);失败不阻塞,可经 WEAVER_CLI_DEBUG_CACHE=1 诊断。 */
|
|
569
678
|
function persistContextCache(baseUrl, appId, cache) {
|
|
679
|
+
// 🔴 2026-11-28:残缺上下文(degraded 非空)绝不落盘——「菜单失败→字典空」的残缺缓存
|
|
680
|
+
// 一旦固化,录入会在「简历来源缺手动录入」处永远被拦(2026-11-28 另一台电脑事故)。
|
|
681
|
+
// 快照采纳路径(load 内 tagStillMatches)不会带 degraded:快照写入时若 resolved 残缺,
|
|
682
|
+
// resolveRecruitEnv 的返回值本身带标记,此处同样拦截。
|
|
683
|
+
if (Array.isArray(cache?.degraded) && cache.degraded.length) {
|
|
684
|
+
if (process.env.WEAVER_CLI_DEBUG_CACHE) {
|
|
685
|
+
console.error('[recruit-context] 解析存在降级(', cache.degraded.join(','), '),本次不落盘,下次调用将全量重建');
|
|
686
|
+
}
|
|
687
|
+
return;
|
|
688
|
+
}
|
|
689
|
+
// 🔴 2026-11-28:网页端/沙箱容器不持久,写盘永不命中还可能只读失败——直接跳过。
|
|
690
|
+
if (isXiaoECloudRuntime())
|
|
691
|
+
return;
|
|
570
692
|
try {
|
|
571
693
|
const dir = cacheDirFor(baseUrl);
|
|
572
694
|
mkdirSync(dir, { recursive: true });
|
|
@@ -576,8 +698,10 @@ function persistContextCache(baseUrl, appId, cache) {
|
|
|
576
698
|
note: 'recruit-ops 环境参数缓存(weaver-work-cli 运行时解析产物,不含认证字段)',
|
|
577
699
|
},
|
|
578
700
|
envKey: `${dir.split(/[\\/]/).pop()}|${appId}`,
|
|
579
|
-
cacheVersion: RECRUIT_CACHE_VERSION,
|
|
580
701
|
...cache,
|
|
702
|
+
cacheVersion: RECRUIT_CACHE_VERSION,
|
|
703
|
+
// 🔴 savedAt 必须在 ...cache 之后:防止调用方携带旧 savedAt 把新写入标成过期
|
|
704
|
+
savedAt: Date.now(),
|
|
581
705
|
}, null, 2), 'utf8');
|
|
582
706
|
}
|
|
583
707
|
catch (error) {
|
|
@@ -7,6 +7,37 @@ export function asObject(value) {
|
|
|
7
7
|
}
|
|
8
8
|
return value;
|
|
9
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* 菜单接口返回结构归一化。
|
|
12
|
+
*
|
|
13
|
+
* /api/cusapp/app/allMenus 的 data 形态在不同环境/版本间不一致:可能是数组,
|
|
14
|
+
* 也可能是 { cusAppMenus: [...] } 的包装对象,甚至是空对象或缺字段。
|
|
15
|
+
* 这里把「结构不可控」统一收敛为「拿到数组」,实在取不到就返回空数组。
|
|
16
|
+
*
|
|
17
|
+
* 🔴 原则:结构异常等价于「没拿到菜单」,绝不能抛出异常。
|
|
18
|
+
* 菜单只用于定位列表/页面入口,属于可选依赖(页面地址有固定路由兜底),
|
|
19
|
+
* 取不到应由调用方降级继续,而不是阻断整条上下文解析。
|
|
20
|
+
*
|
|
21
|
+
* 🔴 顶层只识别「容器语义」的键(cusAppMenus/menus/allMenus/data/list)。
|
|
22
|
+
* children/childs 是「节点 → 子节点」的递归键,由调用方 walk 时显式传入;
|
|
23
|
+
* 若也列入顶层键,单个菜单节点对象会被误当容器、返回其子集并漏掉节点自身。
|
|
24
|
+
*
|
|
25
|
+
* 🔴 `allMenus` 这一支与 ecode 页面层(`app/resolve.js` 的 listMenus)对齐:
|
|
26
|
+
* 页面侧认 cusAppMenus / menus / allMenus 三种容器,CLI 少认一个就会出现
|
|
27
|
+
* 「页面能定位台账、CLI 判菜单为空(degraded=menus、lists 全空)」的环境差异。
|
|
28
|
+
*/
|
|
29
|
+
export function toMenuList(value) {
|
|
30
|
+
if (Array.isArray(value))
|
|
31
|
+
return value;
|
|
32
|
+
if (value && typeof value === 'object') {
|
|
33
|
+
const obj = value;
|
|
34
|
+
for (const key of ['cusAppMenus', 'menus', 'allMenus', 'data', 'list']) {
|
|
35
|
+
if (Array.isArray(obj[key]))
|
|
36
|
+
return obj[key];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return [];
|
|
40
|
+
}
|
|
10
41
|
export function assertNoForbiddenKeys(input) {
|
|
11
42
|
for (const key of Object.keys(input)) {
|
|
12
43
|
if (FORBIDDEN_KEYS.has(key)) {
|
|
@@ -54,6 +54,28 @@ export const MEETING_OPTIONS = [
|
|
|
54
54
|
{ label: '是,安排会议室', value: '是' },
|
|
55
55
|
{ label: '否,不需要', value: '否' },
|
|
56
56
|
];
|
|
57
|
+
/**
|
|
58
|
+
* 出件范围。
|
|
59
|
+
*
|
|
60
|
+
* - `flow`:完整链路——内部参考文档 md + 对外行程单 docx + 上传附件 + 填单页 browsertool。
|
|
61
|
+
* - `plan`:只出内部参考文档 md——不渲染 docx、不上传附件、不跑 render(因此也不出 browsertool,
|
|
62
|
+
* 不做会议未表态与小餐厅缺包厢的硬校验,那两条只对填单页有意义)。
|
|
63
|
+
*
|
|
64
|
+
* 为什么要有它:用户只说「出个接待方案」时,行程单与填单页都不该出现;
|
|
65
|
+
* 而 docx 渲染要 5~7s 且强依赖 python-docx,白跑一份再丢掉纯属浪费。
|
|
66
|
+
*/
|
|
67
|
+
export const RECEPTION_MODES = ['plan', 'flow'];
|
|
68
|
+
/** 默认按完整链路走,保持老调用方(不传 --mode)行为不变。 */
|
|
69
|
+
export const DEFAULT_RECEPTION_MODE = 'flow';
|
|
70
|
+
/** 把入参归一到 'plan' | 'flow';认不出的写法按默认处理,不报错打断链路。 */
|
|
71
|
+
export function normalizeReceptionMode(value) {
|
|
72
|
+
const text = String(value ?? '').trim().toLowerCase();
|
|
73
|
+
if (text === 'plan' || text === '方案' || text === 'document' || text === 'doc')
|
|
74
|
+
return 'plan';
|
|
75
|
+
if (text === 'flow' || text === '流程' || text === 'handbook' || text === 'manual')
|
|
76
|
+
return 'flow';
|
|
77
|
+
return DEFAULT_RECEPTION_MODE;
|
|
78
|
+
}
|
|
57
79
|
/** 快照文件的 kind 标识,用于拒收无关 JSON。 */
|
|
58
80
|
export const SNAPSHOT_KIND = 'reception-fields-snapshot';
|
|
59
81
|
/** python 探测结果的缓存时长(7 天)。 */
|
|
@@ -143,6 +143,7 @@ export const receptionShortcut = {
|
|
|
143
143
|
.option('--snapshot <path>', '字段快照路径(同时用于推导 render.py)')
|
|
144
144
|
.option('--render-py <path>', '显式指定 render.py')
|
|
145
145
|
.option('--no-upload', '跳过附件上传,只出本地文件')
|
|
146
|
+
.option('--mode <mode>', '出件范围:plan=只出内部参考文档 md(不渲染 docx、不上传);flow=完整链路(默认)')
|
|
146
147
|
.action(action(async (ctx, options) => {
|
|
147
148
|
const opts = asOptions(options);
|
|
148
149
|
await runOperation(ctx, 'reception.doc', {
|
|
@@ -156,6 +157,7 @@ export const receptionShortcut = {
|
|
|
156
157
|
snapshot: textOf(opts, 'snapshot') || undefined,
|
|
157
158
|
renderPy: textOf(opts, 'renderPy') || undefined,
|
|
158
159
|
noUpload: opts.upload === false,
|
|
160
|
+
mode: textOf(opts, 'mode') || undefined,
|
|
159
161
|
}, opts);
|
|
160
162
|
}));
|
|
161
163
|
reception.command('render')
|
|
@@ -207,6 +209,7 @@ export const receptionShortcut = {
|
|
|
207
209
|
.option('--no-upload', '跳过附件上传,只出本地文件')
|
|
208
210
|
.option('--allow-missing-restaurant', '提了小餐厅但没包厢号时仍放行(明细留空进待办)')
|
|
209
211
|
.option('--sdk-render <type>', '打开形态:inline / popup / drawer(默认 drawer)')
|
|
212
|
+
.option('--mode <mode>', '出件范围:plan=只出内部参考文档 md(不打开填单页);flow=完整链路(默认)')
|
|
210
213
|
.action(action(async (ctx, options) => {
|
|
211
214
|
const opts = asOptions(options);
|
|
212
215
|
await runOperation(ctx, 'reception.docRender', {
|
|
@@ -222,6 +225,7 @@ export const receptionShortcut = {
|
|
|
222
225
|
noUpload: opts.upload === false,
|
|
223
226
|
allowMissingRestaurant: opts.allowMissingRestaurant === true,
|
|
224
227
|
sdkRender: textOf(opts, 'sdkRender') || undefined,
|
|
228
|
+
mode: textOf(opts, 'mode') || undefined,
|
|
225
229
|
}, opts);
|
|
226
230
|
}));
|
|
227
231
|
},
|
|
@@ -65,6 +65,11 @@ export const receptionOperations = [
|
|
|
65
65
|
workflow: { type: 'string', description: '目标流程名' },
|
|
66
66
|
outDir: { type: 'string', description: '产物输出目录' },
|
|
67
67
|
noUpload: { type: 'boolean', description: '跳过附件上传,只出本地文件' },
|
|
68
|
+
mode: {
|
|
69
|
+
type: 'string',
|
|
70
|
+
enum: ['plan', 'flow'],
|
|
71
|
+
description: '出件范围:plan=只出内部参考文档 md(不渲染 docx、不上传附件);flow=完整链路。默认 flow',
|
|
72
|
+
},
|
|
68
73
|
snapshot: { type: 'string', description: '字段快照路径;同时用于推导技能包内 render.py 位置' },
|
|
69
74
|
renderPy: { type: 'string', description: '显式指定 render.py 路径' },
|
|
70
75
|
},
|
|
@@ -74,6 +79,7 @@ export const receptionOperations = [
|
|
|
74
79
|
type: 'object',
|
|
75
80
|
properties: {
|
|
76
81
|
runId: { type: 'string' },
|
|
82
|
+
mode: { type: 'string', description: '本次实际生效的出件范围:plan / flow' },
|
|
77
83
|
rebuilt: { type: 'boolean' },
|
|
78
84
|
files: { type: 'array', items: { type: 'object' } },
|
|
79
85
|
internalDoc: {
|
|
@@ -132,7 +138,8 @@ export const receptionOperations = [
|
|
|
132
138
|
name: 'reception.docRender',
|
|
133
139
|
risk: 'read',
|
|
134
140
|
summary: '一次完成 doc + render:出 docx/md、上传附件、拼 customParams、落 browsertool。'
|
|
135
|
-
+ '两者之间没有人工确认点,合并只为省一次工具往返;失败语义与分开调用一致。'
|
|
141
|
+
+ '两者之间没有人工确认点,合并只为省一次工具往返;失败语义与分开调用一致。'
|
|
142
|
+
+ '--mode plan 只出内部参考文档 md,跳过 render(不出 browsertool、不做填单硬校验)。',
|
|
136
143
|
inputSchema: {
|
|
137
144
|
type: 'object',
|
|
138
145
|
additionalProperties: false,
|
|
@@ -145,6 +152,11 @@ export const receptionOperations = [
|
|
|
145
152
|
workflow: { type: 'string', description: '目标流程名' },
|
|
146
153
|
outDir: { type: 'string', description: '产物输出目录' },
|
|
147
154
|
noUpload: { type: 'boolean', description: '跳过附件上传,只出本地文件' },
|
|
155
|
+
mode: {
|
|
156
|
+
type: 'string',
|
|
157
|
+
enum: ['plan', 'flow'],
|
|
158
|
+
description: '出件范围:plan=只出内部参考文档 md(不渲染 docx、不上传附件、不打开填单页);flow=完整链路。默认 flow',
|
|
159
|
+
},
|
|
148
160
|
snapshot: { type: 'string', description: '字段快照路径;同时用于推导技能包内 render.py 位置' },
|
|
149
161
|
allowMissingRestaurant: { type: 'boolean', description: '提了小餐厅但确实拿不到包厢号时放行(明细留空进待办),默认 false 直接报 RESTAURANT_DETAIL_MISSING' },
|
|
150
162
|
renderPy: { type: 'string', description: '显式指定 render.py 路径' },
|
|
@@ -160,6 +172,8 @@ export const receptionOperations = [
|
|
|
160
172
|
type: 'object',
|
|
161
173
|
properties: {
|
|
162
174
|
runId: { type: 'string' },
|
|
175
|
+
mode: { type: 'string', description: '本次实际生效的出件范围:plan / flow' },
|
|
176
|
+
renderSkipped: { type: 'boolean', description: 'plan 模式恒为 true:没有调 render,回包里不会有 browsertool' },
|
|
163
177
|
rebuilt: { type: 'boolean' },
|
|
164
178
|
files: { type: 'array', items: { type: 'object' } },
|
|
165
179
|
internalDoc: {
|