weaver-work-cli 0.1.47 → 0.1.49
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-oa-BBDP7AKJ.js → archive-oa-57R2FYHV.js} +565 -17
- package/dist/chunks/{attachment-content-MCXQBD6N.js → attachment-content-MU2LPI5P.js} +3 -3
- package/dist/chunks/{chunk-J2VEB5K3.js → chunk-2BQESR2U.js} +2 -2
- package/dist/chunks/{chunk-727FH2NI.js → chunk-2IGZUMNG.js} +15 -2
- package/dist/chunks/{chunk-IP4CWQCF.js → chunk-3NV2ETZR.js} +8 -8
- package/dist/chunks/{chunk-OXHHJWNC.js → chunk-3X7VOSBA.js} +1 -1
- package/dist/chunks/chunk-5QYE52LG.js +223 -0
- package/dist/chunks/{chunk-IRMIEDXN.js → chunk-6GWU63YF.js} +1 -1
- package/dist/chunks/{chunk-3YV7PKRL.js → chunk-6QYNE6HE.js} +12 -212
- package/dist/chunks/{chunk-Q4OYAQYH.js → chunk-72MI3MBX.js} +4 -0
- package/dist/chunks/{chunk-AD46OMQK.js → chunk-BRRW7CWA.js} +121 -46
- package/dist/chunks/{chunk-76H3IKH6.js → chunk-D2QRZUW4.js} +221 -37
- package/dist/chunks/{chunk-GSZTA43P.js → chunk-EJVA5ZVB.js} +2 -2
- package/dist/chunks/{chunk-4RWS2YYL.js → chunk-GEOMANP7.js} +3 -3
- package/dist/chunks/{chunk-LIEQJIGM.js → chunk-GR76ZDDX.js} +0 -3
- package/dist/chunks/{chunk-O6CMPO65.js → chunk-IW7A2IQY.js} +16 -146
- package/dist/chunks/chunk-JEQHNNSS.js +158 -0
- package/dist/chunks/{chunk-6V5ZPKHV.js → chunk-K3BT54CU.js} +4 -4
- package/dist/chunks/{chunk-6AXKWFKG.js → chunk-KV5SOWMS.js} +4 -4
- package/dist/chunks/{chunk-JB34OE7R.js → chunk-NBEWUR7L.js} +1 -1
- package/dist/chunks/{chunk-PSOMGA3U.js → chunk-ZKEUGS2U.js} +36 -7
- package/dist/chunks/{conflict-H7EHQXYY.js → conflict-6347A7YK.js} +2 -2
- package/dist/chunks/{contract-3QLAGYQL.js → contract-N6P2HIIE.js} +425 -187
- package/dist/chunks/{create-flow-VRVJEOBX.js → create-flow-7WG7LVX5.js} +6 -6
- package/dist/chunks/data-QO7QWOIV.js +2525 -0
- package/dist/chunks/{ehr-SH2LM3NK.js → ehr-XI4BIVR2.js} +16 -5
- package/dist/chunks/{employee-NOHNXC46.js → employee-DR5Y64TI.js} +2 -1
- package/dist/chunks/{env-66FPSJDV.js → env-LHRKSLG6.js} +2 -2
- package/dist/chunks/{factory-UH2TZBVA.js → factory-2H7Z4RWJ.js} +1 -1
- package/dist/chunks/{group-chat-CAKMMV7K.js → group-chat-EW6PNDDT.js} +3 -3
- package/dist/chunks/{hrm-UNKCCCGP.js → hrm-YGIR3HGF.js} +4 -2
- package/dist/chunks/{im-NJB7ZYMH.js → im-3RCNL5GT.js} +107 -1
- package/dist/chunks/{invoice-UEAHSYAE.js → invoice-FXWH5GPO.js} +2 -71
- package/dist/chunks/{lazy-dispatch-25XGTXLM.js → lazy-dispatch-XSAHDK6Z.js} +3 -3
- package/dist/chunks/{meeting-VTBFW4HI.js → meeting-N2FQBHXI.js} +10 -10
- package/dist/chunks/org-NFE7X7FK.js +12 -0
- package/dist/chunks/{reception-5WITA44R.js → reception-MYOKJULO.js} +905 -116
- package/dist/chunks/{recruit-stage-CAKZTUA7.js → recruit-stage-FKWS5UQF.js} +118 -29
- package/dist/chunks/{registry-VWXWPVAG.js → registry-3UGIWH53.js} +4 -2
- package/dist/chunks/{registry-AQVGHUM6.js → registry-7VZ6YJUF.js} +2 -2
- package/dist/chunks/{registry-PVUZQDDQ.js → registry-BUTEDK3C.js} +1 -1
- package/dist/chunks/{registry-JVQBLFQ5.js → registry-CKUVBS53.js} +10 -10
- package/dist/chunks/{room-recommend-5U55FMXZ.js → room-recommend-MBCYENQ2.js} +4 -4
- package/dist/chunks/{schedule-IDETODCA.js → schedule-5IFMCXME.js} +4 -4
- package/dist/chunks/{workflow-BSYT5TGL.js → workflow-2TRU2ZSP.js} +5 -5
- package/dist/core/refs.js +19 -2
- package/dist/index.js +20 -15
- package/dist/shortcuts/archive-oa/constants.js +42 -0
- package/dist/shortcuts/archive-oa/host.js +2 -2
- package/dist/shortcuts/archive-oa/index.js +38 -0
- package/dist/shortcuts/archive-oa/operations/borrow-car.js +117 -3
- package/dist/shortcuts/archive-oa/operations/contract-modules.js +57 -0
- package/dist/shortcuts/archive-oa/operations/contract.js +23 -8
- package/dist/shortcuts/archive-oa/operations/my-borrow-contract.js +271 -0
- package/dist/shortcuts/archive-oa/operations/registry.js +9 -4
- package/dist/shortcuts/archive-oa/operations/shared.js +41 -5
- package/dist/shortcuts/contract/index.js +9 -1
- package/dist/shortcuts/contract/manifest.js +14 -2
- package/dist/shortcuts/contract/operations/card.js +231 -0
- package/dist/shortcuts/contract/operations/registry.js +2 -0
- package/dist/shortcuts/contract/operations/review.js +16 -5
- package/dist/shortcuts/contract/operations/summary.js +25 -17
- package/dist/shortcuts/data/errors.js +64 -0
- package/dist/shortcuts/data/host.js +140 -0
- package/dist/shortcuts/data/index.js +429 -0
- package/dist/shortcuts/data/manifest.js +133 -0
- package/dist/shortcuts/data/operations/attend.js +62 -0
- package/dist/shortcuts/data/operations/conf.js +384 -0
- package/dist/shortcuts/data/operations/ds.js +686 -0
- package/dist/shortcuts/data/operations/field.js +68 -0
- package/dist/shortcuts/data/operations/index.js +65 -0
- package/dist/shortcuts/data/operations/module.js +383 -0
- package/dist/shortcuts/data/operations/noun.js +102 -0
- package/dist/shortcuts/data/operations/query.js +85 -0
- package/dist/shortcuts/data/operations/scene.js +235 -0
- package/dist/shortcuts/data/operations/shared.js +279 -0
- package/dist/shortcuts/ehr/operations/recruit-write.js +22 -5
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +28 -12
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/ehr/recruit-stage/shared.js +90 -8
- package/dist/shortcuts/im/index.js +128 -0
- package/dist/shortcuts/im/operations/session.js +6 -0
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/host.js +0 -3
- package/dist/shortcuts/invoice/manifest.js +0 -1
- package/dist/shortcuts/invoice/operations/reim-subsidy.js +1 -71
- package/dist/shortcuts/meeting/operations/eb/conflict.js +26 -3
- package/dist/shortcuts/meeting/operations/eb/continuation-alias.js +63 -0
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +71 -12
- package/dist/shortcuts/meeting/operations/eb/factory.js +5 -3
- package/dist/shortcuts/meeting/operations/eb/member-expand.js +200 -0
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/reception/constants.js +11 -0
- package/dist/shortcuts/reception/host.js +33 -1
- package/dist/shortcuts/reception/index.js +22 -1
- package/dist/shortcuts/reception/manifest.js +55 -2
- package/dist/shortcuts/reception/operations/ask.js +37 -1
- package/dist/shortcuts/reception/operations/compose.js +124 -3
- package/dist/shortcuts/reception/operations/doc.js +59 -0
- package/dist/shortcuts/reception/operations/docrender.js +25 -1
- package/dist/shortcuts/reception/operations/leads.js +245 -0
- package/dist/shortcuts/reception/operations/markdown.js +22 -0
- package/dist/shortcuts/reception/operations/panels.js +84 -21
- package/dist/shortcuts/reception/operations/registry.js +2 -0
- package/dist/shortcuts/reception/operations/render.js +76 -3
- package/dist/shortcuts/reception/operations/restaurant-rooms.js +118 -0
- package/dist/shortcuts/reception/operations/restaurant.js +264 -0
- package/dist/shortcuts/reception/operations/restaurantrooms.js +42 -0
- package/dist/shortcuts/reception/operations/schedule.js +7 -1
- package/dist/shortcuts/reception/upload.js +22 -6
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +28 -12
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/recruit-stage/shared.js +99 -14
- package/docs/SKILL.md +1 -0
- package/docs/_catalog.md +3 -0
- package/docs/archive-oa.md +4 -2
- package/docs/data.md +149 -0
- package/docs/reception.md +59 -5
- package/package.json +1 -1
- package/scripts/check-skill-sync.mjs +188 -0
- package/scripts/package-skill.mjs +17 -3
- package/skill-template/business-info.json +23 -0
- package/skill-template/domains/archive-oa.md +2 -1
- package/skill-template/domains/data.md +15 -0
- package/skill-template/master-skill-template.md +1 -0
- package/skill-template/skill-template.md +1 -0
- package/skills/weaver-e10-archive-oa/SKILL.md +35 -7
- package/skills/weaver-e10-archive-oa/references/borrow-car.md +32 -7
- package/skills/weaver-e10-archive-oa/references/contract-search.md +105 -4
- package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +2 -2
- package/skills/weaver-e10-archive-oa/references/my-borrow-contract.md +97 -0
- package/skills/weaver-e10-archive-oa/references/my-borrow.md +6 -1
- package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +48 -2
- package/skills/weaver-e10-calendar/SKILL.md +1 -1
- package/skills/weaver-e10-calendar/references/calendar-query.md +1 -1
- package/skills/weaver-e10-calendar/references/calendar-write.md +9 -9
- package/skills/weaver-e10-cowork/SKILL.md +9 -6
- package/skills/weaver-e10-data/SKILL.md +118 -0
- package/skills/weaver-e10-data/references/config-center.md +90 -0
- package/skills/weaver-e10-data/references/datasource.md +136 -0
- package/skills/weaver-e10-data/references/scene-and-misc.md +82 -0
- package/skills/weaver-e10-jinchengda/SKILL.md +10 -7
- package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +17 -0
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +263 -35
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +8 -5
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +175 -22
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +124 -19
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +6 -0
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-risk-report-template.html +178 -0
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
- package/skills/weaver-e10-jinchengda/references/orchestration.md +7 -7
- package/skills/weaver-e10-jinchengda/scripts/plan_actions.py +279 -0
- package/skills/weaver-e10-jinchengda/scripts/render_action_card.py +450 -0
- package/skills/weaver-e10-jinchengda/scripts/render_risk_report.py +358 -0
- package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +505 -0
- package/skills/weaver-e10-jucailin/SKILL.md +7 -4
- package/skills/weaver-e10-jucailin/references/recruit-create.md +3 -2
- package/skills/weaver-e10-jucailin/references/recruit-read.md +2 -1
- package/skills/weaver-e10-jucailin/references/recruit-stage-ops.md +3 -3
- package/skills/weaver-e10-jucailin/references/safety-boundaries.md +30 -2
- package/skills/weaver-e10-mail/SKILL.md +17 -4
- package/skills/weaver-e10-meeting/SKILL.md +129 -412
- package/skills/weaver-e10-meeting/references/create-flow.md +188 -0
- package/skills/weaver-e10-meeting/references/create-guardrails.md +234 -0
- package/skills/weaver-e10-meeting/references/pitfalls.md +40 -0
- package/skills/weaver-e10-reception-flow/SKILL.md +77 -19
- package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +628 -26
- package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +96 -26
- package/skills/weaver-e10-reception-flow/references/guide.md +4 -3
- package/skills/weaver-e10-reception-flow/scripts/render.py +84 -3
- package/skills/weaver-e10-recruit-stage/SKILL.md +45 -12
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +78 -8
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +5 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +40 -11
- package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +16 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +169 -0
- package/skills/weaver-e10-shijingran/SKILL.md +6 -2
- package/skills/weaver-e10-shijingran/references/source-manifest.json +5 -4
- package/skills/weaver-e10-workflow/SKILL.md +1 -1
- package/skills/weaver-e10-yepiaotong/SKILL.md +8 -4
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +2 -2
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +1 -0
- package/skills/weaver-e10-yimiaoban/SKILL.md +2 -1
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +32 -0
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +3 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +11 -11
- package/dist/chunks/{ebuilder-form-GWDTKEI2.js → ebuilder-form-CBYI6CQ6.js} +3 -3
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-README.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-SKILL.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-openai.yaml +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-position-templates.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-arrange-interview.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-capability-check.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-check-install.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-detail-process.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-edit-interview-feedback.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-create.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-jd-template.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-candidate.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-list-interview.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-match-candidates.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-output-links.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-creator.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resolve-metadata.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-import.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-resume-parse.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-search-candidate.md +0 -0
- /package/{skills → docs/legacy}/weaver-e10-jucailin/archive/LEGACY-recruit-urge-feedback.md +0 -0
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 接待口径的两块业务规则:会议室分配 与 陪访领导推荐。
|
|
3
|
+
*
|
|
4
|
+
* 这两块以前散在 SKILL.md 里让模型自己判断,结果每轮口径都不一样。
|
|
5
|
+
* 现在收敛成纯函数:输入 `data`(known + answers),输出确定结果,
|
|
6
|
+
* 模型只负责把结果原样呈现,不再自己挑房间或点将。
|
|
7
|
+
*
|
|
8
|
+
* 移植自 `@weaver/reception-cli@0.7.6` 的 `lib/commands.js`,口径保持一致。
|
|
9
|
+
*/
|
|
10
|
+
/** 会议室候选:capacity 是硬约束,超出容量的房间不推荐;id 是表单下拉的真实取值。 */
|
|
11
|
+
export const MEETING_ROOMS = [
|
|
12
|
+
{ id: '100502820000000225', name: '130会议室(中庭左侧)', no: '130', where: '中庭左侧', capacity: 12, desc: '信创会议室,接待重要客户使用' },
|
|
13
|
+
{ id: '100502820000000227', name: '131会议室(前庭左侧)', no: '131', where: '前庭左侧', capacity: 20, desc: '信创会议室,接待重要客户使用' },
|
|
14
|
+
{ id: '100502820000000224', name: '129会议室(中庭左侧)', no: '129', where: '中庭左侧', capacity: 20, desc: '信创会议室,接待重要客户使用' },
|
|
15
|
+
];
|
|
16
|
+
/**
|
|
17
|
+
* 把任意写法归一到三个合法值之一;归一不了返回空串。
|
|
18
|
+
*
|
|
19
|
+
* 认得的写法:原文、`总部131会议室`、`131`、`131会议室`、以及会议室 id 本身。
|
|
20
|
+
* 表单下拉只认这三个原文,传「总部131会议室」这种脏值会整组丢弃。
|
|
21
|
+
*/
|
|
22
|
+
export function normalizeMeetingRoom(value) {
|
|
23
|
+
const text = String(value || '').trim();
|
|
24
|
+
if (!text)
|
|
25
|
+
return '';
|
|
26
|
+
const exact = MEETING_ROOMS.find((room) => room.name === text);
|
|
27
|
+
if (exact)
|
|
28
|
+
return exact.name;
|
|
29
|
+
const byId = MEETING_ROOMS.find((room) => room.id === text);
|
|
30
|
+
if (byId)
|
|
31
|
+
return byId.name;
|
|
32
|
+
const no = text.match(/(?:总部\s*)?(129|130|131)/);
|
|
33
|
+
if (!no)
|
|
34
|
+
return '';
|
|
35
|
+
const hit = MEETING_ROOMS.find((room) => room.no === no[1]);
|
|
36
|
+
return hit ? hit.name : '';
|
|
37
|
+
}
|
|
38
|
+
/** 会议室名称 → 表单下拉的真实取值(id)。名称不合法时返回空串。 */
|
|
39
|
+
export function meetingRoomId(value) {
|
|
40
|
+
const name = normalizeMeetingRoom(value);
|
|
41
|
+
const hit = MEETING_ROOMS.find((room) => room.name === name);
|
|
42
|
+
return hit ? hit.id : '';
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* 会议室 → customParams 里该写的值:。
|
|
46
|
+
*
|
|
47
|
+
* E10 下拉靠 `##` 前缀识别 option id,只给 id 页面不会选中,看起来就像没填。
|
|
48
|
+
* 认不出房间时退回名称(旧技能包 / 快照没配 id),至少不会写出一个假 id。
|
|
49
|
+
*/
|
|
50
|
+
export function meetingRoomValue(value, prefix = '##') {
|
|
51
|
+
const id = meetingRoomId(value);
|
|
52
|
+
return id ? `${prefix}${id}` : normalizeMeetingRoom(value);
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 会议表态归一:只输出 `是` / `否` / 空串。
|
|
56
|
+
*
|
|
57
|
+
* 模型的写法五花八门(需要、要、安排、定会、true……),各环节若只写 `=== '是'`,
|
|
58
|
+
* 「需要」这类值就会静默漏填——会议 6 个字段全空的根因之一。
|
|
59
|
+
*/
|
|
60
|
+
export function normalizeMeeting(value) {
|
|
61
|
+
const raw = typeof value === 'boolean' ? (value ? '是' : '否') : String(value ?? '').trim();
|
|
62
|
+
if (!raw)
|
|
63
|
+
return '';
|
|
64
|
+
// 否定必须先判:「不需要」里含「需要」,「不安排」里含「安排」
|
|
65
|
+
if (/^(否|不|无|没|no|n|false|0)/i.test(raw))
|
|
66
|
+
return '否';
|
|
67
|
+
if (/^(是|要|需要|安排|定|订|有|yes|y|true|1)/i.test(raw))
|
|
68
|
+
return '是';
|
|
69
|
+
if (/(不需要|不用|无需|不安排|不定|不订)/.test(raw))
|
|
70
|
+
return '否';
|
|
71
|
+
if (/(需要|安排|预定|预订|定会|开会|座谈)/.test(raw))
|
|
72
|
+
return '是';
|
|
73
|
+
return '';
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* 会议三态收口:known / 面板 / fields 三条来源统一走这里,只跑一次判定。
|
|
77
|
+
*
|
|
78
|
+
* - 明确「是」:有合法房间就沿用,否则按人数上界自动定;
|
|
79
|
+
* - 明确「否」:房间清成「不需会议室」,6 个字段都不填;
|
|
80
|
+
* - 只给了合法房间、没表态:视为要开会(已经点名房间,不该再问一次);
|
|
81
|
+
* - 什么都没有:不造数据,留给会议屏去问;没答就被 render 的 MEETING_UNCONFIRMED 拦住
|
|
82
|
+
*/
|
|
83
|
+
export function applyMeetingPolicy(data) {
|
|
84
|
+
const declared = normalizeMeeting(data.meeting);
|
|
85
|
+
const room = normalizeMeetingRoom(data.meetingRoom);
|
|
86
|
+
const meeting = declared || (room ? '是' : '');
|
|
87
|
+
if (meeting === '是') {
|
|
88
|
+
data.meeting = '是';
|
|
89
|
+
if (room) {
|
|
90
|
+
const hit = MEETING_ROOMS.find((item) => item.name === room);
|
|
91
|
+
const prev = data.meetingRoomMeta || {};
|
|
92
|
+
data.meetingRoom = room;
|
|
93
|
+
data.meetingRoomMeta = {
|
|
94
|
+
...(hit || {}),
|
|
95
|
+
...(prev.capacity ? prev : {}),
|
|
96
|
+
name: room,
|
|
97
|
+
reason: prev.capacity ? (prev.reason || '按指定房间预留') : '按指定房间预留',
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
const picked = pickMeetingRoom(data.headcount, data.headcountMax);
|
|
102
|
+
data.meetingRoom = picked.name;
|
|
103
|
+
data.meetingRoomMeta = { ...picked };
|
|
104
|
+
}
|
|
105
|
+
return data;
|
|
106
|
+
}
|
|
107
|
+
if (meeting === '否') {
|
|
108
|
+
data.meeting = '否';
|
|
109
|
+
data.meetingRoom = '不需会议室';
|
|
110
|
+
data.meetingRoomMeta = { name: '不需会议室', where: '', capacity: 0, desc: '', reason: '本次不安排会议' };
|
|
111
|
+
return data;
|
|
112
|
+
}
|
|
113
|
+
delete data.meetingRoom;
|
|
114
|
+
delete data.meetingRoomMeta;
|
|
115
|
+
return data;
|
|
116
|
+
}
|
|
117
|
+
/** 产品线 → 对应事业部总经理。 */
|
|
118
|
+
const LEADER_BY_PRODUCT = {
|
|
119
|
+
公文: { name: '陈驰', title: '文书定事业部总经理' },
|
|
120
|
+
合同: { name: '汪洋', title: '今承达事业部总经理' },
|
|
121
|
+
采购: { name: '赵超平', title: '京桥通事业部总经理' },
|
|
122
|
+
档案: { name: '郭衍敏', title: '资管家事业部总经理' },
|
|
123
|
+
人事: { name: '李勤', title: '聚才林事业部总经理' },
|
|
124
|
+
客服: { name: '隋清', title: '睦客邻事业部总经理兼EBU客服总监' },
|
|
125
|
+
印章: { name: '王栋(西安)', title: '令信通事业部总经理' },
|
|
126
|
+
知识: { name: '刘鹏(上海)', title: '采知连事业部业务总经理' },
|
|
127
|
+
低代码: { name: '康渊炎', title: '易秒办事业部总经理' },
|
|
128
|
+
项目: { name: '严玥宸', title: '事井然事业部总经理兼EBU项目总监' },
|
|
129
|
+
费控: { name: '贺庆龙', title: '齐业成事业部总经理' },
|
|
130
|
+
业财: { name: '邓果成', title: '业票通事业部总经理' },
|
|
131
|
+
AI: { name: '杨国生', title: '千里聆信息采集总经理兼技术研究院负责' },
|
|
132
|
+
培训: { name: '刘锦波', title: '青蓝阁事业部业务总经理' },
|
|
133
|
+
政务: { name: '李超(政务)', title: '信创及政务事业群总经理' },
|
|
134
|
+
};
|
|
135
|
+
const LEADER_VP = { name: '王晨志', title: 'EBU本部总经理兼副总裁' };
|
|
136
|
+
const LEADER_RD = { name: '熊学武', title: '产品研发中心总经理' };
|
|
137
|
+
// 技术总监有两位在册(周军锋、胡波),推荐时取首位,另一位由事业部按档期自选
|
|
138
|
+
const LEADER_TECH = { name: '周军锋', title: '技术总监' };
|
|
139
|
+
const PRODUCT_HINTS = [
|
|
140
|
+
{ product: '公文', re: /公文|文书|签批|办文|拟稿|协同办公|OA/i },
|
|
141
|
+
{ product: '合同', re: /合同|合约|法务/i },
|
|
142
|
+
{ product: '采购', re: /采购|招采|询价|供应商/i },
|
|
143
|
+
{ product: '档案', re: /档案|归档|电子文件/i },
|
|
144
|
+
{ product: '人事', re: /人事|人力|招聘|绩效|考勤|薪酬/i },
|
|
145
|
+
{ product: '客服', re: /客服|工单|售后|服务台/i },
|
|
146
|
+
{ product: '印章', re: /印章|用印|签章/i },
|
|
147
|
+
{ product: '知识', re: /知识库|知识管理|知识图谱/i },
|
|
148
|
+
{ product: '费控', re: /费控|费用|报销|预算/i },
|
|
149
|
+
{ product: '项目', re: /项目管理|项目管控|工程管理/i },
|
|
150
|
+
{ product: '低代码', re: /低代码|建模|表单引擎|零代码/i },
|
|
151
|
+
{ product: 'AI', re: /AI|人工智能|大模型|智能体|千里聆|信息采集|数智化/i },
|
|
152
|
+
{ product: '业财', re: /业财|票据|票通|财务|结算|开票/i },
|
|
153
|
+
];
|
|
154
|
+
const INDUSTRY_HINTS = [
|
|
155
|
+
{ industry: '政务', re: /政府|政务|公安|法院|检察|税务|财政|人社|住建|城管|审批|委办局|管委会|街道/ },
|
|
156
|
+
{ industry: '制造', re: /制造|工厂|工业|生产|装备|汽车|电子|化工|钢铁|机械/ },
|
|
157
|
+
{ industry: '金融', re: /金融|银行|保险|证券|基金|信托|农商|信用社/ },
|
|
158
|
+
{ industry: '地产', re: /地产|置业|物业|房产/ },
|
|
159
|
+
{ industry: '工程', re: /工程|建设|设计|咨询|勘察|监理|建筑/ },
|
|
160
|
+
{ industry: '医疗', re: /医疗|医药|医院|生物|健康/ },
|
|
161
|
+
{ industry: '教育', re: /教育|学校|大学|学院/ },
|
|
162
|
+
{ industry: '能源', re: /能源|电力|电网|石油|石化|燃气|水务|新能源/ },
|
|
163
|
+
{ industry: '交通', re: /交通|物流|航运|港口|铁路|航空/ },
|
|
164
|
+
{ industry: '零售', re: /零售|商贸|百货|超市|连锁/ },
|
|
165
|
+
];
|
|
166
|
+
/**
|
|
167
|
+
* 按容纳人数挑会议室:取人数区间**上界**,选装得下的最小间。
|
|
168
|
+
*
|
|
169
|
+
* 用上界是为了不把人塞爆:用户写「6-10人」时按 10 人算,直接给 12 人间。
|
|
170
|
+
* 超过 20 人仍给 20 人间,但 reason 里写明超限,让模型如实转述。
|
|
171
|
+
*/
|
|
172
|
+
export function pickMeetingRoom(headcount, headcountMax) {
|
|
173
|
+
const upper = Number(headcountMax) || Number(headcount) || 0;
|
|
174
|
+
if (!upper)
|
|
175
|
+
return { ...MEETING_ROOMS[1], reason: '人数未定,默认预留 20 人间' };
|
|
176
|
+
const fits = [...MEETING_ROOMS]
|
|
177
|
+
.filter((room) => room.capacity >= upper)
|
|
178
|
+
.sort((a, b) => a.capacity - b.capacity);
|
|
179
|
+
if (!fits.length) {
|
|
180
|
+
return { ...MEETING_ROOMS[1], reason: `最多 ${upper} 人,超出 20 人上限,需另找场地` };
|
|
181
|
+
}
|
|
182
|
+
return { ...fits[0], reason: `最多 ${upper} 人,${fits[0].capacity} 人间可容纳` };
|
|
183
|
+
}
|
|
184
|
+
/** 政企判定:性质命中,或客户名带机关后缀(大数据管理局、管委会、街道办这类不能当科技公司)。 */
|
|
185
|
+
export function isGovClient(data = {}) {
|
|
186
|
+
const nature = String(data.nature || '');
|
|
187
|
+
if (/(政府|事业|国企)/.test(nature))
|
|
188
|
+
return true;
|
|
189
|
+
return /(局|委|厅|办公室|管委会|街道办|人民政府|法院|检察院|税务|政务)/.test(String(data.customer || ''));
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* 从第一轮输入里认产品与行业;认不到按性质兜底(政企→公文、科技公司→AI、其余→业财)。
|
|
193
|
+
*
|
|
194
|
+
* 顺序很关键:先认具名产品,再判政企,最后才判科技公司。
|
|
195
|
+
* 「某某大数据管理局」含「数据」,如果不先判政企就会被推成 AI,口径就错了。
|
|
196
|
+
*/
|
|
197
|
+
export function detectProductIndustry(data = {}, raw = '') {
|
|
198
|
+
const hay = `${raw} ${data.customer || ''} ${data.demand || ''} ${data.nature || ''} ${data.leader || ''}`;
|
|
199
|
+
const industry = (INDUSTRY_HINTS.find((item) => item.re.test(hay)) || {}).industry || '';
|
|
200
|
+
const hit = PRODUCT_HINTS.find((item) => item.re.test(hay));
|
|
201
|
+
if (hit) {
|
|
202
|
+
return { product: hit.product, industry: industry || (isGovClient(data) ? '政务' : '') };
|
|
203
|
+
}
|
|
204
|
+
if (isGovClient(data))
|
|
205
|
+
return { product: '公文', industry: industry || '政务' };
|
|
206
|
+
if (/科技|信息技术|网络|软件|互联网|智能/.test(`${data.customer || ''} ${raw}`)) {
|
|
207
|
+
return { product: 'AI', industry };
|
|
208
|
+
}
|
|
209
|
+
return { product: '业财', industry };
|
|
210
|
+
}
|
|
211
|
+
/** 需求面板四个选项;第 2 项按产品与行业动态拼。 */
|
|
212
|
+
export function buildNeedOptions(data = {}) {
|
|
213
|
+
const { product, industry } = detectProductIndustry(data);
|
|
214
|
+
const second = industry
|
|
215
|
+
? `了解泛微${product}与${industry}行业解决方案`
|
|
216
|
+
: `了解泛微${product}产品解决方案`;
|
|
217
|
+
return ['参观公司总部,了解公司实力', second, '推进项目进度', '暂未明确'];
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* 推荐陪访领导:产品线总经理为主,政务加政务群总,技术交流加技术总监,重要客户加副总裁。
|
|
221
|
+
*
|
|
222
|
+
* 只作「建议邀请」口径,**不写进人员分工表**——档期与出席是各事业部的事,
|
|
223
|
+
* 写成确定分工既不准确也不礼貌。
|
|
224
|
+
*/
|
|
225
|
+
export function recommendLeaders(data = {}) {
|
|
226
|
+
const { product, industry } = detectProductIndustry(data);
|
|
227
|
+
const out = [];
|
|
228
|
+
const push = (who, reason) => {
|
|
229
|
+
if (who?.name && !out.some((item) => item.name === who.name))
|
|
230
|
+
out.push({ ...who, reason });
|
|
231
|
+
};
|
|
232
|
+
push(LEADER_BY_PRODUCT[product], `客户关注${product},对应事业部总经理可直接对话`);
|
|
233
|
+
if (industry === '政务' || /(政府|事业|国企)/.test(String(data.nature || ''))) {
|
|
234
|
+
push(LEADER_BY_PRODUCT['政务'], '政企客户,信创与政务口径需专业对口');
|
|
235
|
+
}
|
|
236
|
+
if (/技术|方案|演示|架构|集成|对接|POC/i.test(String(data.demand || ''))) {
|
|
237
|
+
push(LEADER_TECH, '需求含技术交流,需技术负责人现场应答');
|
|
238
|
+
}
|
|
239
|
+
if (String(data.senior) === '是' || Number(data.headcount) >= 10) {
|
|
240
|
+
push(LEADER_VP, Number(data.headcount) >= 10 ? '来访规模较大,建议副总裁级别出席' : '客户要求高层参与');
|
|
241
|
+
}
|
|
242
|
+
if (out.length < 2)
|
|
243
|
+
push(LEADER_RD, '补充产品能力介绍口径');
|
|
244
|
+
return out;
|
|
245
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 磁盘上的 Markdown → 对话里直接贴的版本。
|
|
3
|
+
*
|
|
4
|
+
* 宿主渲染 `#` / `##` 标题时字号大但颜色偏淡、行距也散,贴出来观感不如纯加粗。
|
|
5
|
+
* 这里只做两件事:标题行降级成 `**加粗**`、多余空行收敛成一行。
|
|
6
|
+
* 表格、列表、引用块一律保持原样——它们在对话里是能正常渲染的。
|
|
7
|
+
*
|
|
8
|
+
* 只影响 `data.internalDoc.content`;磁盘上的 .md 与 .docx 保留标题层级,不做转换。
|
|
9
|
+
*/
|
|
10
|
+
export function toChatMarkdown(md) {
|
|
11
|
+
const lines = String(md || '').replace(/\r\n/g, '\n').split('\n');
|
|
12
|
+
const out = [];
|
|
13
|
+
for (const line of lines) {
|
|
14
|
+
const heading = line.match(/^\s{0,3}#{1,6}\s+(.*?)\s*#*\s*$/);
|
|
15
|
+
if (heading && heading[1].trim()) {
|
|
16
|
+
out.push(`**${heading[1].trim()}**`);
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
out.push(line.replace(/[ \t]+$/, ''));
|
|
20
|
+
}
|
|
21
|
+
return `${out.join('\n').replace(/\n{3,}/g, '\n\n').trim()}\n`;
|
|
22
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CUSTOMER_NEED_OPTIONS, LOGISTICS_FIELDS, LOGISTICS_HINT, LOGISTICS_LABEL, LOGISTICS_PLACEHOLDER, LOGISTICS_TITLE, } from '../constants.js';
|
|
1
|
+
import { CUSTOMER_NEED_OPTIONS, LOGISTICS_FIELDS, LOGISTICS_HINT, LOGISTICS_LABEL, LOGISTICS_PLACEHOLDER, LOGISTICS_TITLE, MEETING_OPTIONS, MEETING_TITLE, } from '../constants.js';
|
|
2
2
|
/**
|
|
3
3
|
* 后勤与人数自由文本 → 6 个子项。
|
|
4
4
|
*
|
|
@@ -32,8 +32,18 @@ export function parseLogistics(text) {
|
|
|
32
32
|
.map((item) => item.trim())
|
|
33
33
|
.filter(Boolean);
|
|
34
34
|
for (const part of segs) {
|
|
35
|
+
// 会议否定必须先于房间识别:「不用订会议室」「不安排会议」里既没有房间号,
|
|
36
|
+
// 也不能让后面的 named 兜底把它吞成一个叫「不用订会议室」的脏房间。
|
|
37
|
+
// 中间动词(订/定/预)要容忍,否则 SKILL 自己举的例子都认不出来。
|
|
38
|
+
const noMeeting = /(不需要|不用|无需|不安排|不订|不要|取消|没有)\s*(订|定|预)?\s*(会议|会议室|开会|座谈|汇报)/.test(part);
|
|
39
|
+
if (noMeeting) {
|
|
40
|
+
if (!out.meeting)
|
|
41
|
+
out.meeting = '否';
|
|
42
|
+
if (!out.meetingRoom)
|
|
43
|
+
out.meetingRoom = '不需会议室';
|
|
44
|
+
}
|
|
35
45
|
// 一个片段可能同时含多个子项(如「10人 总部130会议室」),因此逐项独立判断,不 continue
|
|
36
|
-
if (!out.meetingRoom) {
|
|
46
|
+
if (!out.meetingRoom && !noMeeting) {
|
|
37
47
|
// 兼容「总部131」「131会议室」「总部131会议室」三种写法;
|
|
38
48
|
// 数字前后不能紧邻数字,否则会从手机号里捞出 131。
|
|
39
49
|
const room = part.match(/(?:总部\s*)?(?<!\d)(129|130|131)(?!\d)\s*会议室/)
|
|
@@ -90,6 +100,15 @@ export function parseLogistics(text) {
|
|
|
90
100
|
out.gift = part;
|
|
91
101
|
}
|
|
92
102
|
}
|
|
103
|
+
if (!out.meeting && !noMeeting) {
|
|
104
|
+
// placeholder 里一直写着「是否会议」,但此前没有任何分支解析它:
|
|
105
|
+
// 用户手写「要开会」「不用订会议室」等于白写,会议字段只能靠 known 里猜。
|
|
106
|
+
// 否定已在片段开头处理(noMeeting),这里只判「要开会」这一侧。
|
|
107
|
+
if (/(要|需要|安排|预定|预订|订|开|有)\s*(会议|开会|座谈|汇报)|会议|开会|座谈/.test(part)) {
|
|
108
|
+
// 点名了房间(总部130会议室)也落到这里:已经给房间就是要开会
|
|
109
|
+
out.meeting = '是';
|
|
110
|
+
}
|
|
111
|
+
}
|
|
93
112
|
}
|
|
94
113
|
return out;
|
|
95
114
|
}
|
|
@@ -109,12 +128,36 @@ export function setCompanionMobile(data, mobile) {
|
|
|
109
128
|
data.mobile = value;
|
|
110
129
|
}
|
|
111
130
|
}
|
|
131
|
+
/**
|
|
132
|
+
* 客户需求来源归一:`customerNeed`(SKILL 口径)→ `demand`(内部字段)。
|
|
133
|
+
*
|
|
134
|
+
* 两个字段并存过一段时间:面板与缺口判定只认 `demand`,而 SKILL 让模型写 `customerNeed`,
|
|
135
|
+
* 于是「原话已经说清需求」仍然被追问一屏。统一在入口处收敛,下游只认一个字段。
|
|
136
|
+
*/
|
|
137
|
+
export function normalizeDemand(data) {
|
|
138
|
+
const need = String(data.customerNeed ?? '').trim();
|
|
139
|
+
if (need)
|
|
140
|
+
data.demand = need;
|
|
141
|
+
delete data.customerNeed;
|
|
142
|
+
}
|
|
112
143
|
/** 合并 run 上下文与 ask_user 的 answers。 */
|
|
113
144
|
export function mergeAnswers(run, answers = {}) {
|
|
114
145
|
const data = { ...(run.data || {}) };
|
|
146
|
+
// run 重建(doc --known)走不到 ask,这里补一次归一,md 才不会丢掉客户需求
|
|
147
|
+
normalizeDemand(data);
|
|
115
148
|
if (answers && typeof answers === 'object') {
|
|
116
|
-
if (answers.fields && typeof answers.fields === 'object')
|
|
117
|
-
|
|
149
|
+
if (answers.fields && typeof answers.fields === 'object') {
|
|
150
|
+
// 小餐厅是 CLI 归一后的产物(booked / roomState / roomNo / 时间),
|
|
151
|
+
// answers.fields 里那份通常还是原始入参(没有 booked)。整体 assign 会把归一结果冲掉:
|
|
152
|
+
// 下游 compose 判定「没订餐」整段跳过,render 的缺包厢号硬校验也因为 booked 丢失而失效,
|
|
153
|
+
// 表现就是「文档写了包厢、页面上一行没有、还没有告警」。
|
|
154
|
+
// 因此只逐字段并入,派生字段(booked 等)保留。
|
|
155
|
+
const { restaurant: rawRestaurant, ...rest } = answers.fields;
|
|
156
|
+
Object.assign(data, rest);
|
|
157
|
+
if (rawRestaurant && typeof rawRestaurant === 'object' && !Array.isArray(rawRestaurant)) {
|
|
158
|
+
data.restaurant = { ...(data.restaurant || {}), ...rawRestaurant };
|
|
159
|
+
}
|
|
160
|
+
}
|
|
118
161
|
if (answers.customer_need)
|
|
119
162
|
data.demand = String(answers.customer_need);
|
|
120
163
|
if (answers.logistics) {
|
|
@@ -141,11 +184,18 @@ export function mergeAnswers(run, answers = {}) {
|
|
|
141
184
|
*
|
|
142
185
|
* 硬约束(宿主实测):title 严格单行、超长截断成「…」;placeholder 正常渲染;hint 不渲染。
|
|
143
186
|
* 因此标题只留一句短话,完整清单放 placeholder,口径放 hint。
|
|
144
|
-
*
|
|
187
|
+
*
|
|
188
|
+
* 三屏,顺序固定:客户需求 → 接待细节 → 是否会议。
|
|
189
|
+
* - 客户需求:原话点到具体产品/场景/主题就不出;
|
|
190
|
+
* - 接待细节:**常驻**,已识别项作预填说明,不因信息齐全省略这一屏;
|
|
191
|
+
* - 是否会议:必问项,只有原话明确提及会议室才跳过。
|
|
145
192
|
*/
|
|
146
193
|
export function buildPanels(data) {
|
|
147
194
|
const panels = [];
|
|
148
|
-
|
|
195
|
+
// 双判:正常路径已由 normalizeDemand 收敛过,这里兜住直接调 buildPanels 的调用方,
|
|
196
|
+
// 免得只传 customerNeed 时又弹一屏「客户需求」。
|
|
197
|
+
const hasDemand = Boolean(String(data.demand || data.customerNeed || '').trim());
|
|
198
|
+
if (!hasDemand) {
|
|
149
199
|
panels.push({
|
|
150
200
|
id: 'customer_need',
|
|
151
201
|
// 同样受「标题单行」约束:不写 ①②③ 追问清单,只留一句
|
|
@@ -156,23 +206,36 @@ export function buildPanels(data) {
|
|
|
156
206
|
options: CUSTOMER_NEED_OPTIONS.map((item) => ({ label: item, value: item })),
|
|
157
207
|
});
|
|
158
208
|
}
|
|
159
|
-
|
|
209
|
+
// 接待细节常驻:原话已经写全了也照出,已识别项进 prefilled,由模型在问之前先说一遍。
|
|
210
|
+
// 省略这一屏的代价是「默认值静默生效」——用户不知道系统替他定了什么。
|
|
160
211
|
const mobile = ((data.companions || []).find((item) => item && item.mobile) || {}).mobile || '';
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
212
|
+
const known = LOGISTICS_FIELDS
|
|
213
|
+
.filter((key) => data[key])
|
|
214
|
+
.map((key) => `${LOGISTICS_LABEL[key]}:${data[key]}`);
|
|
215
|
+
if (mobile)
|
|
216
|
+
known.push(`${LOGISTICS_LABEL.mobile}:${mobile}`);
|
|
217
|
+
panels.push({
|
|
218
|
+
id: 'logistics',
|
|
219
|
+
// 标题严格单行:不拼字段清单、不拼已识别项、不讲规则——拼了必被截断成「…」
|
|
220
|
+
title: LOGISTICS_TITLE,
|
|
221
|
+
inputType: 'text',
|
|
222
|
+
required: false,
|
|
223
|
+
allowCustomInput: true,
|
|
224
|
+
hint: known.length ? `已识别:${known.join(';')}\n补没写的就行。\n${LOGISTICS_HINT}` : LOGISTICS_HINT,
|
|
225
|
+
placeholder: LOGISTICS_PLACEHOLDER,
|
|
226
|
+
prefilled: known,
|
|
227
|
+
});
|
|
228
|
+
// 第 3 问:是否会议。只有已知值(面板回传过,或原话明确表态)才跳过。
|
|
229
|
+
// 不在这里做任何推断:写着「晚上订小餐厅」也只算用餐场地,不算表态。
|
|
230
|
+
const meetingAnswered = data.meeting === '是' || data.meeting === '否';
|
|
231
|
+
if (!meetingAnswered) {
|
|
167
232
|
panels.push({
|
|
168
|
-
id: '
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
hint: known.length ? `已识别:${known.join(';')}\n补没写的就行。\n${LOGISTICS_HINT}` : LOGISTICS_HINT,
|
|
175
|
-
placeholder: LOGISTICS_PLACEHOLDER,
|
|
233
|
+
id: 'meeting',
|
|
234
|
+
title: MEETING_TITLE,
|
|
235
|
+
inputType: 'single',
|
|
236
|
+
required: true,
|
|
237
|
+
allowCustomInput: false,
|
|
238
|
+
options: MEETING_OPTIONS.map((item) => ({ label: item.label, value: item.value })),
|
|
176
239
|
});
|
|
177
240
|
}
|
|
178
241
|
return panels;
|
|
@@ -2,6 +2,7 @@ import { askOperation } from './ask.js';
|
|
|
2
2
|
import { docOperation } from './doc.js';
|
|
3
3
|
import { docRenderOperation } from './docrender.js';
|
|
4
4
|
import { renderOperation } from './render.js';
|
|
5
|
+
import { restaurantRoomsOperation } from './restaurantrooms.js';
|
|
5
6
|
/**
|
|
6
7
|
* operation 名 → handler。
|
|
7
8
|
*
|
|
@@ -15,6 +16,7 @@ const REGISTRY = new Map([
|
|
|
15
16
|
['reception.doc', docOperation],
|
|
16
17
|
['reception.docRender', docRenderOperation],
|
|
17
18
|
['reception.render', renderOperation],
|
|
19
|
+
['reception.restaurantRooms', restaurantRoomsOperation],
|
|
18
20
|
]);
|
|
19
21
|
export function getReceptionOperation(name) {
|
|
20
22
|
const hit = REGISTRY.get(name);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
import { receptionEnvironmentError } from '../errors.js';
|
|
3
|
+
import { receptionBusinessError, receptionEnvironmentError } from '../errors.js';
|
|
4
4
|
import { renderBrowsertool, resolveRenderType } from './browsertool.js';
|
|
5
5
|
import { composeInitialValues } from './compose.js';
|
|
6
6
|
import { mergeAnswers } from './panels.js';
|
|
7
7
|
import { loadRun, runsDir } from './runs.js';
|
|
8
|
+
import { applyMeetingPolicy, normalizeMeeting } from './leads.js';
|
|
8
9
|
import { nameList } from './shared.js';
|
|
9
10
|
import { resolveSnapshot } from './snapshot.js';
|
|
10
11
|
export async function render(input, ctx) {
|
|
@@ -19,18 +20,87 @@ export async function render(input, ctx) {
|
|
|
19
20
|
snapshotPath,
|
|
20
21
|
});
|
|
21
22
|
}
|
|
23
|
+
const composedWarnings = [];
|
|
22
24
|
const answers = input.answers ?? run.answers ?? {};
|
|
23
25
|
const data = mergeAnswers(run, answers);
|
|
24
26
|
// 附件:显式 --attachment-fileid(可逗号分隔多个)优先,否则用 doc 落盘的附件数组
|
|
25
27
|
const argAttachment = String(input.attachmentFileid || '').trim();
|
|
26
28
|
const runAttachments = Array.isArray(run.attachmentFileids) ? run.attachmentFileids : [];
|
|
29
|
+
// 小餐厅硬校验:提了小餐厅却没拿到包厢号,填单页就会缺这一行——
|
|
30
|
+
// 与其静默交付半成品,不如直接拒绝出 browsertool,让问题在交付前暴露。
|
|
31
|
+
if (data.restaurant && data.restaurant.booked && !String(data.restaurant.roomNo || '').trim()
|
|
32
|
+
&& input.allowMissingRestaurant !== true) {
|
|
33
|
+
throw receptionBusinessError('RESTAURANT_DETAIL_MISSING', '提了小餐厅,但没拿到可用包厢号,填单页会缺「小餐厅预定明细」', {
|
|
34
|
+
roomState: data.restaurant.roomState,
|
|
35
|
+
roomReason: data.restaurant.roomReason,
|
|
36
|
+
candidates: data.restaurant.candidates || [],
|
|
37
|
+
hint: '用 --restaurant-rooms-file 传「小食堂包厢」候选(e10-data ds list 原始输出即可);'
|
|
38
|
+
+ '确实没有可用包厢时加 --allow-missing-restaurant 放行,明细会留空进待办',
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
// 会议与定房:known / 面板 / fields 三条来源都可能在,统一在 applyMeetingPolicy 收口。
|
|
42
|
+
// 以前只在「房间为空」时才定房,房间是脏值(如「总部130会议室」)就整组丢字段,
|
|
43
|
+
// 表现就是「有时完全不填会议信息」;反过来「已推荐房间却仍写三选一」也是同一处漏的。
|
|
44
|
+
applyMeetingPolicy(data);
|
|
45
|
+
// 会议是必问项:没表态就不出填单页。
|
|
46
|
+
// 这一条不依赖模型自觉——绕过面板直接调 doc-render 也会被拦,
|
|
47
|
+
// 否则会议室与 6 个会议字段会静默全空,只剩一行待办,提交时没人会注意。
|
|
48
|
+
// 「提了小餐厅」不构成表态:小餐厅是晚餐场地,与会议室预定是两条独立线索。
|
|
49
|
+
if (!normalizeMeeting(data.meeting)) {
|
|
50
|
+
throw receptionBusinessError('MEETING_UNCONFIRMED', '是否需要会议未确认,请先补问再出填单页', {
|
|
51
|
+
headcount: data.headcount || '',
|
|
52
|
+
hint: '先向用户确认「是否需要会议室座谈」,拿到答案后放进 answers.fields.meeting("是"/"否")重跑本条;'
|
|
53
|
+
+ '提了小餐厅不代表要开会,不得据此推断',
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (normalizeMeeting(data.meeting) === '是') {
|
|
57
|
+
if (!Number(data.headcount)) {
|
|
58
|
+
data.todos = [...(Array.isArray(data.todos) ? data.todos : []), '人数未填,会议室按默认预留'];
|
|
59
|
+
}
|
|
60
|
+
// 超限判断独立于「谁定的房」:mergeAnswers 里定过的房同样要检查
|
|
61
|
+
const meta = data.meetingRoomMeta || {};
|
|
62
|
+
if (meta.capacity && Number(data.headcount) > Number(meta.capacity)) {
|
|
63
|
+
composedWarnings.push(`会议室按最大间预留(${meta.capacity} 人),本次 ${data.headcount} 人超出,需另行安排`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
27
66
|
// 「参与人员」兜底:一个人名都没有时,才用当前登录人填。
|
|
28
67
|
// 读会话要解 keyring(~300ms),有人名的正常流程不该为它付代价。
|
|
29
|
-
|
|
68
|
+
// 主联络人兜底只看 escorts:companions 是陪同,不该影响主联络人取值。
|
|
69
|
+
// 没指定对接人就一定要拿到登录人 id,否则主联络人这个必填项会空着。
|
|
30
70
|
const hasEscorts = nameList(data.escorts).length > 0;
|
|
31
|
-
if (!data.empId && !
|
|
71
|
+
if (!data.empId && !hasEscorts) {
|
|
32
72
|
const session = await ctx.host.getSession();
|
|
33
73
|
data.empId = session.userId || '';
|
|
74
|
+
if (!data.empId)
|
|
75
|
+
composedWarnings.push('主联络人未取到登录人,请在页面上手动选择');
|
|
76
|
+
}
|
|
77
|
+
// 默认值回显:凡用户没给、由 CLI 兜底填的,都要在回包里点名。
|
|
78
|
+
// 默认值静默生效比缺字段更危险——用户会以为那是他自己确认过的。
|
|
79
|
+
const defaultsApplied = [];
|
|
80
|
+
const headcountKnown = Number(data.headcount) > 0;
|
|
81
|
+
if (normalizeMeeting(data.meeting) === '是' && !headcountKnown) {
|
|
82
|
+
defaultsApplied.push({
|
|
83
|
+
field: 'meetingRoom',
|
|
84
|
+
value: String(data.meetingRoom || ''),
|
|
85
|
+
reason: String((data.meetingRoomMeta && data.meetingRoomMeta.reason) || '人数未填,会议室按默认预留'),
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
if (data.restaurant && data.restaurant.booked) {
|
|
89
|
+
if (!headcountKnown) {
|
|
90
|
+
defaultsApplied.push({
|
|
91
|
+
field: 'customerCount',
|
|
92
|
+
value: String(data.restaurant.headcount || ''),
|
|
93
|
+
reason: '人数未填,小餐厅按 10 人预留',
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
// 用户点名包厢(reason=按指定包厢)不算默认值,其余都是 CLI 按容量挑的
|
|
97
|
+
if (data.restaurant.roomNo && !/按指定包厢/.test(String(data.restaurant.roomReason || ''))) {
|
|
98
|
+
defaultsApplied.push({
|
|
99
|
+
field: 'restaurantRoom',
|
|
100
|
+
value: String(data.restaurant.roomNo),
|
|
101
|
+
reason: String(data.restaurant.roomReason || '按容量匹配'),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
34
104
|
}
|
|
35
105
|
const composed = composeInitialValues({
|
|
36
106
|
snapshot: resolved.snapshot,
|
|
@@ -52,6 +122,8 @@ export async function render(input, ctx) {
|
|
|
52
122
|
'请在页面上核对「泛微分支机构参与人员(主联络人)」字段。',
|
|
53
123
|
].join(''));
|
|
54
124
|
}
|
|
125
|
+
if (composedWarnings.length)
|
|
126
|
+
composed.warnings.push(...composedWarnings);
|
|
55
127
|
if (!composed.keys.length) {
|
|
56
128
|
return {
|
|
57
129
|
state: 'empty',
|
|
@@ -106,6 +178,7 @@ export async function render(input, ctx) {
|
|
|
106
178
|
attachmentPending: composed.attachmentPending,
|
|
107
179
|
sdkRenderType: resolveRenderType(input.sdkRender),
|
|
108
180
|
todos: composed.todos,
|
|
181
|
+
defaultsApplied,
|
|
109
182
|
browsertool,
|
|
110
183
|
browsertoolFile,
|
|
111
184
|
browsertoolRef: browsertoolFile ? `<browsertool-file path="${browsertoolFile}" />` : '',
|