weaver-work-cli 0.1.48 → 0.1.50
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-EDJDU3V4.js → archive-oa-57R2FYHV.js} +111 -12
- package/dist/chunks/{attachment-content-4KSNBPRO.js → attachment-content-EJYIOJPH.js} +3 -3
- package/dist/chunks/{chunk-FEP6ELMR.js → chunk-3NCFFHB2.js} +1 -1
- package/dist/chunks/chunk-5QYE52LG.js +223 -0
- package/dist/chunks/{chunk-3YV7PKRL.js → chunk-6QYNE6HE.js} +12 -212
- package/dist/chunks/{chunk-NBEWUR7L.js → chunk-6T53BSWZ.js} +158 -44
- package/dist/chunks/{chunk-OCYRVZGN.js → chunk-7AYQJSFY.js} +2 -2
- package/dist/chunks/{chunk-5B5JXTY2.js → chunk-7ECB22G3.js} +221 -30
- package/dist/chunks/{chunk-72MI3MBX.js → chunk-ATEXBEPD.js} +55 -15
- package/dist/chunks/{chunk-WMSAWAWZ.js → chunk-BFKLQLBK.js} +8 -8
- package/dist/chunks/{chunk-EFOUMXIX.js → chunk-HARQF5IP.js} +28 -28
- package/dist/chunks/{chunk-O6CMPO65.js → chunk-IW7A2IQY.js} +16 -146
- package/dist/chunks/chunk-JEQHNNSS.js +158 -0
- package/dist/chunks/{chunk-NK74RE5F.js → chunk-K67FODVC.js} +3 -3
- package/dist/chunks/{chunk-YLCYX7LE.js → chunk-KMRT7NAT.js} +18 -5
- package/dist/chunks/{chunk-BCACE6VV.js → chunk-MCZG6HPM.js} +3 -3
- package/dist/chunks/{chunk-SVFG6EMV.js → chunk-RYFRGTUV.js} +5 -5
- package/dist/chunks/{chunk-PSPOFLSU.js → chunk-WNJUGI2F.js} +1 -1
- package/dist/chunks/{chunk-R2HHLJNN.js → chunk-YB3AJYPY.js} +4 -4
- package/dist/chunks/{conflict-APGSD5E7.js → conflict-C4UDHCWV.js} +2 -2
- package/dist/chunks/{contract-N6P2HIIE.js → contract-VUC6JOPG.js} +464 -9
- package/dist/chunks/{create-flow-5TXFOC7X.js → create-flow-6OG2LYBD.js} +6 -6
- package/dist/chunks/data-QO7QWOIV.js +2525 -0
- package/dist/chunks/{employee-NOHNXC46.js → employee-DR5Y64TI.js} +2 -1
- package/dist/chunks/{env-B6GKA2J3.js → env-WP57TF2S.js} +2 -2
- package/dist/chunks/{factory-MFCKLUT6.js → factory-VUXI7N5C.js} +1 -1
- package/dist/chunks/{fna-ZVB2IILI.js → fna-ECOYBQYL.js} +328 -5
- package/dist/chunks/{group-chat-YE7WIBFO.js → group-chat-UQRGXILK.js} +3 -3
- package/dist/chunks/{hrm-UNKCCCGP.js → hrm-YGIR3HGF.js} +4 -2
- package/dist/chunks/{im-3RCNL5GT.js → im-TN2JYVGJ.js} +2 -2
- package/dist/chunks/{invoice-FXWH5GPO.js → invoice-E7GOITEU.js} +1 -1
- package/dist/chunks/{meeting-RYZV2JTQ.js → meeting-4BBLVAWM.js} +10 -10
- package/dist/chunks/{msg-parse-4GSQ2WTO.js → msg-parse-FPFVPMYI.js} +5 -1
- package/dist/chunks/org-NFE7X7FK.js +12 -0
- package/dist/chunks/{reception-VL6TKVAW.js → reception-QGPNTGHG.js} +526 -175
- package/dist/chunks/{recruit-stage-ERZD3ZNB.js → recruit-stage-FKWS5UQF.js} +66 -13
- package/dist/chunks/{registry-VWXWPVAG.js → registry-3UGIWH53.js} +4 -2
- package/dist/chunks/{registry-22O6UG4I.js → registry-5CRCN2TV.js} +10 -10
- package/dist/chunks/{registry-BUTEDK3C.js → registry-E5RQJVWN.js} +2 -2
- package/dist/chunks/{registry-7VZ6YJUF.js → registry-V4CHRQDI.js} +1 -1
- package/dist/chunks/{room-recommend-IMZPJMYB.js → room-recommend-AYR3UG7R.js} +4 -4
- package/dist/chunks/{schedule-SPPAHER2.js → schedule-JZEFIXUS.js} +4 -4
- package/dist/chunks/{workflow-WVEFJ6KC.js → workflow-3ZAF2J5E.js} +4 -4
- package/dist/index.js +16 -11
- 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/registry.js +4 -1
- package/dist/shortcuts/archive-oa/operations/shared.js +41 -5
- package/dist/shortcuts/contract/host.js +11 -0
- package/dist/shortcuts/contract/index.js +13 -0
- package/dist/shortcuts/contract/manifest.js +53 -0
- package/dist/shortcuts/contract/operations/performance.js +58 -7
- package/dist/shortcuts/contract/operations/quote.js +283 -1
- package/dist/shortcuts/contract/operations/registry.js +2 -0
- package/dist/shortcuts/contract/operations/save-recognize.js +151 -0
- 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/recruit-stage/operations/interview-arrange.js +12 -5
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/ehr/recruit-stage/shared.js +57 -0
- package/dist/shortcuts/fna/host.js +4 -2
- package/dist/shortcuts/fna/manifest.js +14 -5
- package/dist/shortcuts/fna/operations/audit.js +334 -0
- package/dist/shortcuts/fna/operations/registry.js +2 -0
- package/dist/shortcuts/im/operations/at-mention.js +6 -3
- package/dist/shortcuts/im/operations/msg-parse.js +35 -5
- package/dist/shortcuts/im/operations/msg-sync.js +3 -1
- package/dist/shortcuts/im/operations/msg-write.js +57 -9
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/manifest.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/member-expand.js +200 -0
- package/dist/shortcuts/meeting/operations/from-group-chat.js +16 -2
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/reception/constants.js +13 -6
- package/dist/shortcuts/reception/index.js +3 -1
- package/dist/shortcuts/reception/manifest.js +3 -2
- package/dist/shortcuts/reception/operations/ask.js +20 -2
- package/dist/shortcuts/reception/operations/compose.js +11 -0
- 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 +31 -7
- package/dist/shortcuts/reception/operations/panels.js +86 -22
- package/dist/shortcuts/reception/operations/render.js +40 -0
- package/dist/shortcuts/reception/operations/restaurant.js +17 -4
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +12 -5
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/recruit-stage/shared.js +57 -0
- package/dist/shortcuts/workflow/operations/read.js +58 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +140 -24
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +42 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +4 -6
- package/docs/SKILL.md +2 -1
- package/docs/_catalog.md +4 -1
- package/docs/data.md +149 -0
- package/docs/fna.md +11 -4
- 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 +29 -1
- package/skill-template/domains/data.md +15 -0
- package/skill-template/domains/qiyecheng.md +4 -2
- package/skills/weaver-e10-archive-oa/SKILL.md +7 -6
- package/skills/weaver-e10-archive-oa/references/contract-search.md +83 -14
- package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +1 -1
- package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +35 -11
- 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 +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +5 -5
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +44 -2
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +219 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +50 -30
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +24 -15
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +96 -2
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +43 -0
- package/skills/weaver-e10-jinchengda/scripts/fill_plan.py +997 -0
- package/skills/weaver-e10-jinchengda/scripts/render_ebdf_list_card.py +265 -0
- package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +83 -0
- package/skills/weaver-e10-jinchengda/scripts/verify_docx_placeholders.py +118 -0
- package/skills/weaver-e10-meeting/SKILL.md +39 -7
- package/skills/weaver-e10-qiyecheng/SKILL.md +21 -7
- package/skills/weaver-e10-qiyecheng/references/ai-check-audit.md +104 -0
- package/skills/weaver-e10-qiyecheng/references/catalog.md +17 -3
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +136 -30
- package/skills/weaver-e10-reception-flow/SKILL.md +70 -19
- package/skills/weaver-e10-reception-flow/references/guide.md +5 -4
- package/skills/weaver-e10-reception-flow/scripts/render.py +5 -3
- package/skills/weaver-e10-recruit-stage/SKILL.md +1 -1
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +26 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +3 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +6 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +3 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +53 -11
- package/skills/weaver-e10-workflow/SKILL.md +2 -1
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +29 -6
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +162 -10
- package/skills/weaver-e10-yepiaotong/SKILL.md +10 -5
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +19 -32
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +6 -45
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +5 -5
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +4 -37
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +2 -2
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +4 -4
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +22 -35
- package/skills/weaver-e10-yimiaoban/SKILL.md +8 -6
- package/skills/weaver-e10-yimiaoban/references/msg-read.md +20 -0
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +7 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +18 -15
- package/dist/chunks/{ebuilder-form-I5ZIX4WO.js → ebuilder-form-CBYI6CQ6.js} +4 -4
|
@@ -44,11 +44,10 @@ var LOGISTICS_HINT = [
|
|
|
44
44
|
"\u4F34\u624B\u793C\uFF1A\u5982\u300C\u793C\u76D2\u6BCF\u4EBA1\u4EFD\u300D\u6216\u300C\u4E0D\u7528\u300D",
|
|
45
45
|
"\u624B\u673A\uFF1A11 \u4F4D\uFF0C\u53EA\u7528\u4E8E\u884C\u7A0B\u5355\u663E\u793A\u63A5\u5F85\u4EBA\u8054\u7CFB\u65B9\u5F0F\uFF08\u7CFB\u7EDF\u4E0D\u67E5\u5458\u5DE5\u624B\u673A\u53F7\uFF09"
|
|
46
46
|
].join("\n");
|
|
47
|
-
var
|
|
48
|
-
|
|
49
|
-
"\
|
|
50
|
-
"\
|
|
51
|
-
"\u6682\u672A\u786E\u5B9A\uFF0C\u5148\u8FDB\u5F85\u529E"
|
|
47
|
+
var MEETING_TITLE = "\u662F\u5426\u5B89\u6392\u4F1A\u8BAE\uFF08\u9700\u9884\u7559\u573A\u5730\uFF09";
|
|
48
|
+
var MEETING_OPTIONS = [
|
|
49
|
+
{ label: "\u662F\uFF0C\u5B89\u6392\u4F1A\u8BAE\u5BA4", value: "\u662F" },
|
|
50
|
+
{ label: "\u5426\uFF0C\u4E0D\u9700\u8981", value: "\u5426" }
|
|
52
51
|
];
|
|
53
52
|
var SNAPSHOT_KIND = "reception-fields-snapshot";
|
|
54
53
|
var PYTHON_CACHE_TTL_MS = 7 * 24 * 3600 * 1e3;
|
|
@@ -577,6 +576,103 @@ function createReceptionHost(ctx) {
|
|
|
577
576
|
return { getSession, requireRuntime, uploadFile, fetchRestaurantRooms: fetchRestaurantRooms2 };
|
|
578
577
|
}
|
|
579
578
|
|
|
579
|
+
// src/shortcuts/reception/operations/leads.ts
|
|
580
|
+
var MEETING_ROOMS = [
|
|
581
|
+
{ id: "100502820000000225", name: "130\u4F1A\u8BAE\u5BA4\uFF08\u4E2D\u5EAD\u5DE6\u4FA7\uFF09", no: "130", where: "\u4E2D\u5EAD\u5DE6\u4FA7", capacity: 12, desc: "\u4FE1\u521B\u4F1A\u8BAE\u5BA4\uFF0C\u63A5\u5F85\u91CD\u8981\u5BA2\u6237\u4F7F\u7528" },
|
|
582
|
+
{ id: "100502820000000227", name: "131\u4F1A\u8BAE\u5BA4\uFF08\u524D\u5EAD\u5DE6\u4FA7\uFF09", no: "131", where: "\u524D\u5EAD\u5DE6\u4FA7", capacity: 20, desc: "\u4FE1\u521B\u4F1A\u8BAE\u5BA4\uFF0C\u63A5\u5F85\u91CD\u8981\u5BA2\u6237\u4F7F\u7528" },
|
|
583
|
+
{ id: "100502820000000224", name: "129\u4F1A\u8BAE\u5BA4\uFF08\u4E2D\u5EAD\u5DE6\u4FA7\uFF09", no: "129", where: "\u4E2D\u5EAD\u5DE6\u4FA7", capacity: 20, desc: "\u4FE1\u521B\u4F1A\u8BAE\u5BA4\uFF0C\u63A5\u5F85\u91CD\u8981\u5BA2\u6237\u4F7F\u7528" }
|
|
584
|
+
];
|
|
585
|
+
function normalizeMeetingRoom(value) {
|
|
586
|
+
const text = String(value || "").trim();
|
|
587
|
+
if (!text) return "";
|
|
588
|
+
const exact = MEETING_ROOMS.find((room) => room.name === text);
|
|
589
|
+
if (exact) return exact.name;
|
|
590
|
+
const byId = MEETING_ROOMS.find((room) => room.id === text);
|
|
591
|
+
if (byId) return byId.name;
|
|
592
|
+
const no = text.match(/(?:总部\s*)?(129|130|131)/);
|
|
593
|
+
if (!no) return "";
|
|
594
|
+
const hit = MEETING_ROOMS.find((room) => room.no === no[1]);
|
|
595
|
+
return hit ? hit.name : "";
|
|
596
|
+
}
|
|
597
|
+
function meetingRoomId(value) {
|
|
598
|
+
const name = normalizeMeetingRoom(value);
|
|
599
|
+
const hit = MEETING_ROOMS.find((room) => room.name === name);
|
|
600
|
+
return hit ? hit.id : "";
|
|
601
|
+
}
|
|
602
|
+
function normalizeMeeting(value) {
|
|
603
|
+
const raw = typeof value === "boolean" ? value ? "\u662F" : "\u5426" : String(value ?? "").trim();
|
|
604
|
+
if (!raw) return "";
|
|
605
|
+
if (/^(否|不|无|没|no|n|false|0)/i.test(raw)) return "\u5426";
|
|
606
|
+
if (/^(是|要|需要|安排|定|订|有|yes|y|true|1)/i.test(raw)) return "\u662F";
|
|
607
|
+
if (/(不需要|不用|无需|不安排|不定|不订)/.test(raw)) return "\u5426";
|
|
608
|
+
if (/(需要|安排|预定|预订|定会|开会|座谈)/.test(raw)) return "\u662F";
|
|
609
|
+
return "";
|
|
610
|
+
}
|
|
611
|
+
function applyMeetingPolicy(data) {
|
|
612
|
+
const declared = normalizeMeeting(data.meeting);
|
|
613
|
+
const room = normalizeMeetingRoom(data.meetingRoom);
|
|
614
|
+
const meeting = declared || (room ? "\u662F" : "");
|
|
615
|
+
if (meeting === "\u662F") {
|
|
616
|
+
data.meeting = "\u662F";
|
|
617
|
+
if (room) {
|
|
618
|
+
const hit = MEETING_ROOMS.find((item) => item.name === room);
|
|
619
|
+
const prev = data.meetingRoomMeta || {};
|
|
620
|
+
data.meetingRoom = room;
|
|
621
|
+
data.meetingRoomMeta = {
|
|
622
|
+
...hit || {},
|
|
623
|
+
...prev.capacity ? prev : {},
|
|
624
|
+
name: room,
|
|
625
|
+
reason: prev.capacity ? prev.reason || "\u6309\u6307\u5B9A\u623F\u95F4\u9884\u7559" : "\u6309\u6307\u5B9A\u623F\u95F4\u9884\u7559"
|
|
626
|
+
};
|
|
627
|
+
} else {
|
|
628
|
+
const picked = pickMeetingRoom(data.headcount, data.headcountMax);
|
|
629
|
+
data.meetingRoom = picked.name;
|
|
630
|
+
data.meetingRoomMeta = { ...picked };
|
|
631
|
+
}
|
|
632
|
+
return data;
|
|
633
|
+
}
|
|
634
|
+
if (meeting === "\u5426") {
|
|
635
|
+
data.meeting = "\u5426";
|
|
636
|
+
data.meetingRoom = "\u4E0D\u9700\u4F1A\u8BAE\u5BA4";
|
|
637
|
+
data.meetingRoomMeta = { name: "\u4E0D\u9700\u4F1A\u8BAE\u5BA4", where: "", capacity: 0, desc: "", reason: "\u672C\u6B21\u4E0D\u5B89\u6392\u4F1A\u8BAE" };
|
|
638
|
+
return data;
|
|
639
|
+
}
|
|
640
|
+
delete data.meetingRoom;
|
|
641
|
+
delete data.meetingRoomMeta;
|
|
642
|
+
return data;
|
|
643
|
+
}
|
|
644
|
+
function pickMeetingRoom(headcount, headcountMax) {
|
|
645
|
+
const upper = Number(headcountMax) || Number(headcount) || 0;
|
|
646
|
+
if (!upper) return { ...MEETING_ROOMS[1], reason: "\u4EBA\u6570\u672A\u5B9A\uFF0C\u9ED8\u8BA4\u9884\u7559 20 \u4EBA\u95F4" };
|
|
647
|
+
const fits = [...MEETING_ROOMS].filter((room) => room.capacity >= upper).sort((a, b) => a.capacity - b.capacity);
|
|
648
|
+
if (!fits.length) {
|
|
649
|
+
return { ...MEETING_ROOMS[1], reason: `\u6700\u591A ${upper} \u4EBA\uFF0C\u8D85\u51FA 20 \u4EBA\u4E0A\u9650\uFF0C\u9700\u53E6\u627E\u573A\u5730` };
|
|
650
|
+
}
|
|
651
|
+
return { ...fits[0], reason: `\u6700\u591A ${upper} \u4EBA\uFF0C${fits[0].capacity} \u4EBA\u95F4\u53EF\u5BB9\u7EB3` };
|
|
652
|
+
}
|
|
653
|
+
function isGovClient(data = {}) {
|
|
654
|
+
const nature = String(data.nature || "");
|
|
655
|
+
if (/(政府|事业|国企)/.test(nature)) return true;
|
|
656
|
+
return /(局|委|厅|办公室|管委会|街道办|人民政府|法院|检察院|税务|政务)/.test(String(data.customer || ""));
|
|
657
|
+
}
|
|
658
|
+
function solutionLabel(data = {}) {
|
|
659
|
+
if (isGovClient(data)) return "\u6570\u667A\u516C\u6587";
|
|
660
|
+
const name = String(data.customer || "");
|
|
661
|
+
if (/航空|铁路|电力|电网|石油|石化|燃气|水务|烟草|邮政|电信|移动通信|联通|银行|保险|证券/.test(name)) {
|
|
662
|
+
return "\u6570\u667A\u516C\u6587";
|
|
663
|
+
}
|
|
664
|
+
if (/科技|信息技术|网络|软件|互联网|智能|数字|数据/.test(name)) return "AI\u667A\u80FD\u5316";
|
|
665
|
+
return "\u6570\u667A\u4E1A\u8D22";
|
|
666
|
+
}
|
|
667
|
+
function buildNeedOptions(data = {}) {
|
|
668
|
+
return [
|
|
669
|
+
"\u53C2\u89C2\u516C\u53F8\u603B\u90E8\uFF0C\u4E86\u89E3\u516C\u53F8\u5B9E\u529B",
|
|
670
|
+
`\u4E86\u89E3\u6CDB\u5FAE\u4EA7\u54C1\uFF0C\u4E0E${solutionLabel(data)}\u89E3\u51B3\u65B9\u6848`,
|
|
671
|
+
"\u63A8\u8FDB\u9879\u76EE\u8FDB\u5EA6\uFF0C\u4EA4\u6D41\u5B9E\u65BD\u7EC6\u8282",
|
|
672
|
+
"\u6682\u672A\u660E\u786E"
|
|
673
|
+
];
|
|
674
|
+
}
|
|
675
|
+
|
|
580
676
|
// src/shortcuts/reception/operations/panels.ts
|
|
581
677
|
function parseLogistics(text) {
|
|
582
678
|
const raw = String(text || "").trim();
|
|
@@ -589,7 +685,12 @@ function parseLogistics(text) {
|
|
|
589
685
|
if (mobile) out.mobile = mobile[0];
|
|
590
686
|
const segs = raw.replace(/[①②③④⑤⑥⑦⑧⑨]/g, "\n").replace(/[((]\s*\d\s*[))]/g, "\n").replace(/(^|[\s||;;,,。])\d\s*[.))、]/g, "\n").replace(/总部\s*(\d{3})/g, "\u603B\u90E8$1").replace(/(\d)\s*[人名位]/g, "$1\u4EBA").replace(/(\d)\s*间/g, "$1\u95F4").split(/[\n||;;,,。、]+/).map((item) => item.trim()).filter(Boolean);
|
|
591
687
|
for (const part of segs) {
|
|
592
|
-
|
|
688
|
+
const noMeeting = /(不需要|不用|无需|不安排|不订|不要|取消|没有)\s*(订|定|预)?\s*(会议|会议室|开会|座谈|汇报)/.test(part);
|
|
689
|
+
if (noMeeting) {
|
|
690
|
+
if (!out.meeting) out.meeting = "\u5426";
|
|
691
|
+
if (!out.meetingRoom) out.meetingRoom = "\u4E0D\u9700\u4F1A\u8BAE\u5BA4";
|
|
692
|
+
}
|
|
693
|
+
if (!out.meetingRoom && !noMeeting) {
|
|
593
694
|
const room = part.match(/(?:总部\s*)?(?<!\d)(129|130|131)(?!\d)\s*会议室/) || part.match(/总部\s*(?<!\d)(129|130|131)(?!\d)/);
|
|
594
695
|
if (room) out.meetingRoom = `\u603B\u90E8${room[1]}\u4F1A\u8BAE\u5BA4`;
|
|
595
696
|
else if (/(不需要|不用|无需|没有)会议室/.test(part)) out.meetingRoom = "\u4E0D\u9700\u4F1A\u8BAE\u5BA4";
|
|
@@ -630,6 +731,11 @@ function parseLogistics(text) {
|
|
|
630
731
|
out.gift = part;
|
|
631
732
|
}
|
|
632
733
|
}
|
|
734
|
+
if (!out.meeting && !noMeeting) {
|
|
735
|
+
if (/(要|需要|安排|预定|预订|订|开|有)\s*(会议|开会|座谈|汇报)|会议|开会|座谈/.test(part)) {
|
|
736
|
+
out.meeting = "\u662F";
|
|
737
|
+
}
|
|
738
|
+
}
|
|
633
739
|
}
|
|
634
740
|
return out;
|
|
635
741
|
}
|
|
@@ -646,10 +752,22 @@ function setCompanionMobile(data, mobile) {
|
|
|
646
752
|
data.mobile = value;
|
|
647
753
|
}
|
|
648
754
|
}
|
|
755
|
+
function normalizeDemand(data) {
|
|
756
|
+
const need = String(data.customerNeed ?? "").trim();
|
|
757
|
+
if (need) data.demand = need;
|
|
758
|
+
delete data.customerNeed;
|
|
759
|
+
}
|
|
649
760
|
function mergeAnswers(run, answers = {}) {
|
|
650
761
|
const data = { ...run.data || {} };
|
|
762
|
+
normalizeDemand(data);
|
|
651
763
|
if (answers && typeof answers === "object") {
|
|
652
|
-
if (answers.fields && typeof answers.fields === "object")
|
|
764
|
+
if (answers.fields && typeof answers.fields === "object") {
|
|
765
|
+
const { restaurant: rawRestaurant, ...rest } = answers.fields;
|
|
766
|
+
Object.assign(data, rest);
|
|
767
|
+
if (rawRestaurant && typeof rawRestaurant === "object" && !Array.isArray(rawRestaurant)) {
|
|
768
|
+
data.restaurant = { ...data.restaurant || {}, ...rawRestaurant };
|
|
769
|
+
}
|
|
770
|
+
}
|
|
653
771
|
if (answers.customer_need) data.demand = String(answers.customer_need);
|
|
654
772
|
if (answers.logistics) {
|
|
655
773
|
const raw = String(answers.logistics).trim();
|
|
@@ -668,7 +786,8 @@ function mergeAnswers(run, answers = {}) {
|
|
|
668
786
|
}
|
|
669
787
|
function buildPanels(data) {
|
|
670
788
|
const panels = [];
|
|
671
|
-
|
|
789
|
+
const hasDemand = Boolean(String(data.demand || data.customerNeed || "").trim());
|
|
790
|
+
if (!hasDemand) {
|
|
672
791
|
panels.push({
|
|
673
792
|
id: "customer_need",
|
|
674
793
|
// 同样受「标题单行」约束:不写 ①②③ 追问清单,只留一句
|
|
@@ -676,25 +795,34 @@ function buildPanels(data) {
|
|
|
676
795
|
inputType: "single",
|
|
677
796
|
required: false,
|
|
678
797
|
allowCustomInput: true,
|
|
679
|
-
options:
|
|
798
|
+
options: buildNeedOptions(data).map((item) => ({ label: item, value: item }))
|
|
680
799
|
});
|
|
681
800
|
}
|
|
682
|
-
const missing = LOGISTICS_FIELDS.filter((key) => !data[key]);
|
|
683
801
|
const mobile = ((data.companions || []).find((item) => item && item.mobile) || {}).mobile || "";
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
hint: known.length ? `\u5DF2\u8BC6\u522B\uFF1A${known.join("\uFF1B")}
|
|
802
|
+
const known = LOGISTICS_FIELDS.filter((key) => data[key]).map((key) => `${LOGISTICS_LABEL[key]}\uFF1A${data[key]}`);
|
|
803
|
+
if (mobile) known.push(`${LOGISTICS_LABEL.mobile}\uFF1A${mobile}`);
|
|
804
|
+
panels.push({
|
|
805
|
+
id: "logistics",
|
|
806
|
+
// 标题严格单行:不拼字段清单、不拼已识别项、不讲规则——拼了必被截断成「…」
|
|
807
|
+
title: LOGISTICS_TITLE,
|
|
808
|
+
inputType: "text",
|
|
809
|
+
required: false,
|
|
810
|
+
allowCustomInput: true,
|
|
811
|
+
hint: known.length ? `\u5DF2\u8BC6\u522B\uFF1A${known.join("\uFF1B")}
|
|
695
812
|
\u8865\u6CA1\u5199\u7684\u5C31\u884C\u3002
|
|
696
813
|
${LOGISTICS_HINT}` : LOGISTICS_HINT,
|
|
697
|
-
|
|
814
|
+
placeholder: LOGISTICS_PLACEHOLDER,
|
|
815
|
+
prefilled: known
|
|
816
|
+
});
|
|
817
|
+
const meetingAnswered = data.meeting === "\u662F" || data.meeting === "\u5426";
|
|
818
|
+
if (!meetingAnswered) {
|
|
819
|
+
panels.push({
|
|
820
|
+
id: "meeting",
|
|
821
|
+
title: MEETING_TITLE,
|
|
822
|
+
inputType: "single",
|
|
823
|
+
required: true,
|
|
824
|
+
allowCustomInput: false,
|
|
825
|
+
options: MEETING_OPTIONS.map((item) => ({ label: item.label, value: item.value }))
|
|
698
826
|
});
|
|
699
827
|
}
|
|
700
828
|
return panels;
|
|
@@ -861,81 +989,6 @@ function tryLoadRun(stateDir, runId) {
|
|
|
861
989
|
return readJson(runPath(stateDir, runId));
|
|
862
990
|
}
|
|
863
991
|
|
|
864
|
-
// src/shortcuts/reception/operations/leads.ts
|
|
865
|
-
var MEETING_ROOMS = [
|
|
866
|
-
{ id: "100502820000000225", name: "130\u4F1A\u8BAE\u5BA4\uFF08\u4E2D\u5EAD\u5DE6\u4FA7\uFF09", no: "130", where: "\u4E2D\u5EAD\u5DE6\u4FA7", capacity: 12, desc: "\u4FE1\u521B\u4F1A\u8BAE\u5BA4\uFF0C\u63A5\u5F85\u91CD\u8981\u5BA2\u6237\u4F7F\u7528" },
|
|
867
|
-
{ id: "100502820000000227", name: "131\u4F1A\u8BAE\u5BA4\uFF08\u524D\u5EAD\u5DE6\u4FA7\uFF09", no: "131", where: "\u524D\u5EAD\u5DE6\u4FA7", capacity: 20, desc: "\u4FE1\u521B\u4F1A\u8BAE\u5BA4\uFF0C\u63A5\u5F85\u91CD\u8981\u5BA2\u6237\u4F7F\u7528" },
|
|
868
|
-
{ id: "100502820000000224", name: "129\u4F1A\u8BAE\u5BA4\uFF08\u4E2D\u5EAD\u5DE6\u4FA7\uFF09", no: "129", where: "\u4E2D\u5EAD\u5DE6\u4FA7", capacity: 20, desc: "\u4FE1\u521B\u4F1A\u8BAE\u5BA4\uFF0C\u63A5\u5F85\u91CD\u8981\u5BA2\u6237\u4F7F\u7528" }
|
|
869
|
-
];
|
|
870
|
-
function normalizeMeetingRoom(value) {
|
|
871
|
-
const text = String(value || "").trim();
|
|
872
|
-
if (!text) return "";
|
|
873
|
-
const exact = MEETING_ROOMS.find((room) => room.name === text);
|
|
874
|
-
if (exact) return exact.name;
|
|
875
|
-
const byId = MEETING_ROOMS.find((room) => room.id === text);
|
|
876
|
-
if (byId) return byId.name;
|
|
877
|
-
const no = text.match(/(?:总部\s*)?(129|130|131)/);
|
|
878
|
-
if (!no) return "";
|
|
879
|
-
const hit = MEETING_ROOMS.find((room) => room.no === no[1]);
|
|
880
|
-
return hit ? hit.name : "";
|
|
881
|
-
}
|
|
882
|
-
function meetingRoomId(value) {
|
|
883
|
-
const name = normalizeMeetingRoom(value);
|
|
884
|
-
const hit = MEETING_ROOMS.find((room) => room.name === name);
|
|
885
|
-
return hit ? hit.id : "";
|
|
886
|
-
}
|
|
887
|
-
function normalizeMeeting(value) {
|
|
888
|
-
const raw = typeof value === "boolean" ? value ? "\u662F" : "\u5426" : String(value ?? "").trim();
|
|
889
|
-
if (!raw) return "";
|
|
890
|
-
if (/^(否|不|无|没|no|n|false|0)/i.test(raw)) return "\u5426";
|
|
891
|
-
if (/^(是|要|需要|安排|定|订|有|yes|y|true|1)/i.test(raw)) return "\u662F";
|
|
892
|
-
if (/(不需要|不用|无需|不安排|不定|不订)/.test(raw)) return "\u5426";
|
|
893
|
-
if (/(需要|安排|预定|预订|定会|开会|座谈)/.test(raw)) return "\u662F";
|
|
894
|
-
return "";
|
|
895
|
-
}
|
|
896
|
-
function applyMeetingPolicy(data) {
|
|
897
|
-
const declared = normalizeMeeting(data.meeting);
|
|
898
|
-
const room = normalizeMeetingRoom(data.meetingRoom);
|
|
899
|
-
const meeting = declared || (room ? "\u662F" : "");
|
|
900
|
-
if (meeting === "\u662F") {
|
|
901
|
-
data.meeting = "\u662F";
|
|
902
|
-
if (room) {
|
|
903
|
-
const hit = MEETING_ROOMS.find((item) => item.name === room);
|
|
904
|
-
const prev = data.meetingRoomMeta || {};
|
|
905
|
-
data.meetingRoom = room;
|
|
906
|
-
data.meetingRoomMeta = {
|
|
907
|
-
...hit || {},
|
|
908
|
-
...prev.capacity ? prev : {},
|
|
909
|
-
name: room,
|
|
910
|
-
reason: prev.capacity ? prev.reason || "\u6309\u6307\u5B9A\u623F\u95F4\u9884\u7559" : "\u6309\u6307\u5B9A\u623F\u95F4\u9884\u7559"
|
|
911
|
-
};
|
|
912
|
-
} else {
|
|
913
|
-
const picked = pickMeetingRoom(data.headcount, data.headcountMax);
|
|
914
|
-
data.meetingRoom = picked.name;
|
|
915
|
-
data.meetingRoomMeta = { ...picked };
|
|
916
|
-
}
|
|
917
|
-
return data;
|
|
918
|
-
}
|
|
919
|
-
if (meeting === "\u5426") {
|
|
920
|
-
data.meeting = "\u5426";
|
|
921
|
-
data.meetingRoom = "\u4E0D\u9700\u4F1A\u8BAE\u5BA4";
|
|
922
|
-
data.meetingRoomMeta = { name: "\u4E0D\u9700\u4F1A\u8BAE\u5BA4", where: "", capacity: 0, desc: "", reason: "\u672C\u6B21\u4E0D\u5B89\u6392\u4F1A\u8BAE" };
|
|
923
|
-
return data;
|
|
924
|
-
}
|
|
925
|
-
delete data.meetingRoom;
|
|
926
|
-
delete data.meetingRoomMeta;
|
|
927
|
-
return data;
|
|
928
|
-
}
|
|
929
|
-
function pickMeetingRoom(headcount, headcountMax) {
|
|
930
|
-
const upper = Number(headcountMax) || Number(headcount) || 0;
|
|
931
|
-
if (!upper) return { ...MEETING_ROOMS[1], reason: "\u4EBA\u6570\u672A\u5B9A\uFF0C\u9ED8\u8BA4\u9884\u7559 20 \u4EBA\u95F4" };
|
|
932
|
-
const fits = [...MEETING_ROOMS].filter((room) => room.capacity >= upper).sort((a, b) => a.capacity - b.capacity);
|
|
933
|
-
if (!fits.length) {
|
|
934
|
-
return { ...MEETING_ROOMS[1], reason: `\u6700\u591A ${upper} \u4EBA\uFF0C\u8D85\u51FA 20 \u4EBA\u4E0A\u9650\uFF0C\u9700\u53E6\u627E\u573A\u5730` };
|
|
935
|
-
}
|
|
936
|
-
return { ...fits[0], reason: `\u6700\u591A ${upper} \u4EBA\uFF0C${fits[0].capacity} \u4EBA\u95F4\u53EF\u5BB9\u7EB3` };
|
|
937
|
-
}
|
|
938
|
-
|
|
939
992
|
// src/shortcuts/reception/operations/ask.ts
|
|
940
993
|
async function ask(input, ctx) {
|
|
941
994
|
const startedAt = Date.now();
|
|
@@ -947,8 +1000,18 @@ async function ask(input, ctx) {
|
|
|
947
1000
|
delete data.customerId;
|
|
948
1001
|
delete data.meetingRoom;
|
|
949
1002
|
delete data.meetingRoomMeta;
|
|
1003
|
+
if (typeof data.logistics === "string" && data.logistics.trim()) {
|
|
1004
|
+
const parsed = parseLogistics(data.logistics);
|
|
1005
|
+
const mobile = parsed.mobile;
|
|
1006
|
+
delete parsed.mobile;
|
|
1007
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
1008
|
+
if (!data[key]) data[key] = value;
|
|
1009
|
+
}
|
|
1010
|
+
if (mobile) setCompanionMobile(data, mobile);
|
|
1011
|
+
}
|
|
950
1012
|
delete data.logistics;
|
|
951
1013
|
delete data.customer_need;
|
|
1014
|
+
normalizeDemand(data);
|
|
952
1015
|
if (data.meetingExplicit === true) {
|
|
953
1016
|
const meeting = normalizeMeeting(data.meeting);
|
|
954
1017
|
if (meeting) data.meeting = meeting;
|
|
@@ -985,6 +1048,8 @@ async function ask(input, ctx) {
|
|
|
985
1048
|
customer: data.customer || "",
|
|
986
1049
|
visitDate: data.visitDate || "",
|
|
987
1050
|
visitType: data.visitType || "",
|
|
1051
|
+
demand: data.demand || "",
|
|
1052
|
+
meeting: data.meeting || "",
|
|
988
1053
|
companions: data.companions || [],
|
|
989
1054
|
// 兜底由 render 阶段补:ask 不读会话,这里恒为空
|
|
990
1055
|
contactFallback: ""
|
|
@@ -1007,6 +1072,262 @@ var askOperation = {
|
|
|
1007
1072
|
import { readFileSync as readFileSync2 } from "node:fs";
|
|
1008
1073
|
import { basename as basename2, join as join4 } from "node:path";
|
|
1009
1074
|
|
|
1075
|
+
// src/shortcuts/reception/operations/schedule.ts
|
|
1076
|
+
var STANDARD_AGENDA = [
|
|
1077
|
+
{ offset: 0, item: "\u516C\u53F8\u53C2\u89C2", activity: "\u53C2\u89C2\u6CDB\u5FAE\u4E0A\u6D77\u603B\u90E8\u5C55\u5385\u4E0E\u529E\u516C\u533A\uFF0C\u4E86\u89E3\u516C\u53F8\u53D1\u5C55\u5386\u7A0B\u4E0E\u4EA7\u54C1\u80FD\u529B" },
|
|
1078
|
+
{ offset: 45, item: "\u65B9\u6848\u4ECB\u7ECD", activity: "" },
|
|
1079
|
+
{ offset: 120, item: "\u8BA8\u8BBA\u4EA4\u6D41", activity: "\u53CC\u65B9\u56F4\u7ED5\u5173\u6CE8\u70B9\u4EA4\u6D41\u7B54\u7591\uFF0C\u660E\u786E\u540E\u7EED\u63A8\u8FDB\u8282\u594F" }
|
|
1080
|
+
];
|
|
1081
|
+
var SEVEN = ["date", "time", "item", "place", "person", "activity", "remark"];
|
|
1082
|
+
function hhmmPlus(start, mins) {
|
|
1083
|
+
const base = /^\d{1,2}:\d{2}$/.test(String(start || "")) ? String(start) : "09:30";
|
|
1084
|
+
const [hour, minute] = base.split(":").map(Number);
|
|
1085
|
+
const total = ((hour * 60 + minute + mins) % 1440 + 1440) % 1440;
|
|
1086
|
+
return `${String(Math.floor(total / 60)).padStart(2, "0")}:${String(total % 60).padStart(2, "0")}`;
|
|
1087
|
+
}
|
|
1088
|
+
function pick7(row) {
|
|
1089
|
+
if (!row || typeof row !== "object" || Array.isArray(row)) return null;
|
|
1090
|
+
const source = row;
|
|
1091
|
+
const out = {};
|
|
1092
|
+
for (const key of SEVEN) {
|
|
1093
|
+
const value = source[key];
|
|
1094
|
+
if (value !== null && value !== void 0 && String(value).trim()) out[key] = String(value).trim();
|
|
1095
|
+
}
|
|
1096
|
+
return Object.keys(out).length ? out : null;
|
|
1097
|
+
}
|
|
1098
|
+
function normalizeScheduleRows(data = {}) {
|
|
1099
|
+
const rows = [];
|
|
1100
|
+
const push = (row) => {
|
|
1101
|
+
if (row) rows.push(row);
|
|
1102
|
+
};
|
|
1103
|
+
const companions = Array.isArray(data.companions) ? data.companions : [];
|
|
1104
|
+
const escortNames = nameList(data.escorts);
|
|
1105
|
+
const mainPerson = escortNames[0] || companions.map((item) => typeof item === "string" ? item : item && item.name || "").filter(Boolean)[0] || data.contact || "";
|
|
1106
|
+
if (Array.isArray(data.scheduleRows)) data.scheduleRows.forEach((row) => push(pick7(row)));
|
|
1107
|
+
if (!rows.length && Array.isArray(data.schedule)) {
|
|
1108
|
+
data.schedule.forEach((row) => {
|
|
1109
|
+
if (Array.isArray(row)) {
|
|
1110
|
+
const [time, item, place] = row;
|
|
1111
|
+
push(pick7({ date: data.visitDate || data.arrivalDate || "", time, item, place, person: mainPerson }));
|
|
1112
|
+
} else {
|
|
1113
|
+
push(pick7(row));
|
|
1114
|
+
}
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
if (!rows.length && Array.isArray(data.agenda)) {
|
|
1118
|
+
data.agenda.forEach((row) => push(pick7({
|
|
1119
|
+
date: data.visitDate || data.arrivalDate || "",
|
|
1120
|
+
time: row && (row.start || row.time) || "",
|
|
1121
|
+
item: row && row.item,
|
|
1122
|
+
place: row && row.place,
|
|
1123
|
+
person: row && row.person || mainPerson,
|
|
1124
|
+
activity: row && row.activity,
|
|
1125
|
+
remark: row && row.remark
|
|
1126
|
+
})));
|
|
1127
|
+
}
|
|
1128
|
+
if (!rows.length) {
|
|
1129
|
+
const date = data.visitDate || data.arrivalDate || "";
|
|
1130
|
+
const start = /^\d{1,2}:\d{2}$/.test(String(data.agendaStart || "")) ? String(data.agendaStart) : "09:30";
|
|
1131
|
+
const venue = String(data.venue || "\u6CDB\u5FAE\u4E0A\u6D77\u603B\u90E8");
|
|
1132
|
+
const room = normalizeMeeting(data.meeting) === "\u662F" ? normalizeMeetingRoom(data.meetingRoom) || venue : venue;
|
|
1133
|
+
for (const item of STANDARD_AGENDA) {
|
|
1134
|
+
push(pick7({
|
|
1135
|
+
date,
|
|
1136
|
+
time: hhmmPlus(start, item.offset),
|
|
1137
|
+
item: item.item,
|
|
1138
|
+
place: item.item === "\u516C\u53F8\u53C2\u89C2" ? "\u6CDB\u5FAE\u4E0A\u6D77\u603B\u90E8" : room,
|
|
1139
|
+
person: mainPerson,
|
|
1140
|
+
activity: item.item === "\u65B9\u6848\u4ECB\u7ECD" ? data.demand || "\u4EA7\u54C1\u4E0E\u65B9\u6848\u4ECB\u7ECD" : item.activity
|
|
1141
|
+
}));
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
for (const row of rows) if (!row.person && mainPerson) row.person = mainPerson;
|
|
1145
|
+
return rows;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
// src/shortcuts/reception/operations/restaurant.ts
|
|
1149
|
+
var RESTAURANT_DETAIL = {
|
|
1150
|
+
name: "\u5C0F\u9910\u5385\u9884\u5B9A\u660E\u7EC6",
|
|
1151
|
+
subFormId: "1328260727015997527",
|
|
1152
|
+
dataKey: "formtable__xctydmx",
|
|
1153
|
+
fields: {
|
|
1154
|
+
roomNo: "1329411121197875201",
|
|
1155
|
+
headcount: "1328336675122282515",
|
|
1156
|
+
startDate: "1328336675122282518",
|
|
1157
|
+
startTime: "1328337576855699719",
|
|
1158
|
+
endDate: "1328336675122282519",
|
|
1159
|
+
endTime: "1328337576855699720"
|
|
1160
|
+
},
|
|
1161
|
+
defaultDurationMinutes: 90
|
|
1162
|
+
};
|
|
1163
|
+
var TRIGGER = /小餐厅|包厢|包间|小食堂|内部餐厅/;
|
|
1164
|
+
var ROOM_FIELDS = {
|
|
1165
|
+
roomNo: "field_840360795890851870",
|
|
1166
|
+
title: "field_840360795890851873",
|
|
1167
|
+
region: "field_841962208930570241",
|
|
1168
|
+
desc: "field_840360795890851871"
|
|
1169
|
+
};
|
|
1170
|
+
var pickStr2 = (value) => (value === null || value === void 0 ? "" : String(value)).trim();
|
|
1171
|
+
function capacityFromText2(text) {
|
|
1172
|
+
const s = pickStr2(text);
|
|
1173
|
+
const matched = /可容纳\s*(\d{1,3})\s*人/.exec(s) || /[((]\s*(\d{1,3})\s*人/.exec(s) || /(\d{1,3})\s*人/.exec(s);
|
|
1174
|
+
const n = matched ? Number(matched[1]) : 0;
|
|
1175
|
+
return Number.isFinite(n) && n > 0 && n < 500 ? n : 0;
|
|
1176
|
+
}
|
|
1177
|
+
function regionText2(value) {
|
|
1178
|
+
if (Array.isArray(value)) {
|
|
1179
|
+
return value.map((item) => pickStr2(item && typeof item === "object" ? item.name || item.label : item)).filter(Boolean).join("/");
|
|
1180
|
+
}
|
|
1181
|
+
if (value && typeof value === "object") {
|
|
1182
|
+
const node = value;
|
|
1183
|
+
return pickStr2(node.name || node.label || node.text);
|
|
1184
|
+
}
|
|
1185
|
+
return pickStr2(value);
|
|
1186
|
+
}
|
|
1187
|
+
function unwrapRoomRows(input) {
|
|
1188
|
+
if (Array.isArray(input)) return input;
|
|
1189
|
+
if (!input || typeof input !== "object") return [];
|
|
1190
|
+
const node = input;
|
|
1191
|
+
const candidate = node.rooms || node.items || node.list || node.records || node.rows || node.data && (node.data.list || node.data.records || node.data.rows || node.data.items) || (Array.isArray(node.data) ? node.data : null);
|
|
1192
|
+
return Array.isArray(candidate) ? candidate : [];
|
|
1193
|
+
}
|
|
1194
|
+
function normalizeRoomCandidates(input) {
|
|
1195
|
+
const list = unwrapRoomRows(input);
|
|
1196
|
+
const out = [];
|
|
1197
|
+
for (const row of list) {
|
|
1198
|
+
if (!row) continue;
|
|
1199
|
+
const item = typeof row === "string" ? { name: row } : row;
|
|
1200
|
+
const name = pickStr2(
|
|
1201
|
+
item.name || item.roomNo || item.title || item.label || item[ROOM_FIELDS.roomNo] || item[ROOM_FIELDS.title]
|
|
1202
|
+
);
|
|
1203
|
+
if (!name) continue;
|
|
1204
|
+
const desc = pickStr2(item.desc || item.description || item.remark || item[ROOM_FIELDS.desc]);
|
|
1205
|
+
const region = regionText2(item.region || item.area || item.location || item[ROOM_FIELDS.region]);
|
|
1206
|
+
if (region && !/上海/.test(region)) continue;
|
|
1207
|
+
out.push({
|
|
1208
|
+
name,
|
|
1209
|
+
capacity: Number(item.capacity || item.seats || item.maxPeople || item.size || 0) || capacityFromText2(`${desc} ${name}`),
|
|
1210
|
+
where: region,
|
|
1211
|
+
type: pickStr2(item.type || item.kind)
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
return out;
|
|
1215
|
+
}
|
|
1216
|
+
function timesIn(text) {
|
|
1217
|
+
const out = [];
|
|
1218
|
+
const re = /(\d{1,2})\s*[::]\s*(\d{2})/g;
|
|
1219
|
+
let matched;
|
|
1220
|
+
const source = String(text || "");
|
|
1221
|
+
while ((matched = re.exec(source)) !== null) {
|
|
1222
|
+
const hour = Number(matched[1]);
|
|
1223
|
+
const minute = Number(matched[2]);
|
|
1224
|
+
if (hour <= 23 && minute <= 59) {
|
|
1225
|
+
out.push(`${String(hour).padStart(2, "0")}:${String(minute).padStart(2, "0")}`);
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
return out;
|
|
1229
|
+
}
|
|
1230
|
+
function nextDay(date) {
|
|
1231
|
+
const matched = /^(\d{4})-(\d{2})-(\d{2})$/.exec(String(date || ""));
|
|
1232
|
+
if (!matched) return date || "";
|
|
1233
|
+
const d = new Date(Date.UTC(Number(matched[1]), Number(matched[2]) - 1, Number(matched[3]) + 1));
|
|
1234
|
+
return d.toISOString().slice(0, 10);
|
|
1235
|
+
}
|
|
1236
|
+
var RANK = { private: 0, combo: 1, tea: 2, entertainment: 3 };
|
|
1237
|
+
var KIND_LABEL = {
|
|
1238
|
+
private: "\u5305\u53A2",
|
|
1239
|
+
combo: "\u901A\u5305",
|
|
1240
|
+
tea: "\u8336\u5BA4",
|
|
1241
|
+
entertainment: "\u5A31\u4E50\u573A\u5730"
|
|
1242
|
+
};
|
|
1243
|
+
function kindOf(room) {
|
|
1244
|
+
const explicit = pickStr2(room.type);
|
|
1245
|
+
if (explicit && RANK[explicit] !== void 0) return explicit;
|
|
1246
|
+
const name = pickStr2(room.name);
|
|
1247
|
+
if (/卡拉|KTV|ktv|烧烤|娱乐|棋牌/.test(name)) return "entertainment";
|
|
1248
|
+
if (/茶室|茶座/.test(name)) return "tea";
|
|
1249
|
+
if (/通包|联通/.test(name)) return "combo";
|
|
1250
|
+
return "private";
|
|
1251
|
+
}
|
|
1252
|
+
function pickRestaurantRoom(rooms = [], headcount = 0) {
|
|
1253
|
+
const list = normalizeRoomCandidates(rooms);
|
|
1254
|
+
if (!list.length) return null;
|
|
1255
|
+
const count = Number(headcount) || 0;
|
|
1256
|
+
const rank = (room) => RANK[kindOf(room)] ?? RANK.private;
|
|
1257
|
+
const fitSort = (a, b) => a.capacity - b.capacity || rank(a) - rank(b);
|
|
1258
|
+
const overSort = (a, b) => b.capacity - a.capacity || rank(a) - rank(b);
|
|
1259
|
+
const playable = list.filter((room) => kindOf(room) !== "entertainment");
|
|
1260
|
+
const label = (room) => KIND_LABEL[kindOf(room)] || "\u5305\u53A2";
|
|
1261
|
+
if (count) {
|
|
1262
|
+
for (const group of [playable, list]) {
|
|
1263
|
+
const fit = group.filter((room) => room.capacity && room.capacity >= count).sort(fitSort);
|
|
1264
|
+
if (fit.length) {
|
|
1265
|
+
return { ...fit[0], reason: `${count} \u4EBA\uFF0C${fit[0].capacity} \u4EBA${label(fit[0])}\u53EF\u5BB9\u7EB3` };
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
const pool = playable.filter((room) => room.capacity).length ? playable.filter((room) => room.capacity) : list.filter((room) => room.capacity);
|
|
1270
|
+
if (pool.length) {
|
|
1271
|
+
const top = pool.sort(overSort)[0];
|
|
1272
|
+
return {
|
|
1273
|
+
...top,
|
|
1274
|
+
reason: count ? `${count} \u4EBA\u8D85\u51FA\u53EF\u7528${label(top)}\u4E0A\u9650\uFF08${top.capacity} \u4EBA\uFF09\uFF0C\u6309\u6700\u5927\u95F4\u9884\u7559` : `\u672A\u7ED9\u4EBA\u6570\uFF0C\u6309\u6700\u5927 ${top.capacity} \u4EBA\u9884\u7559`
|
|
1275
|
+
};
|
|
1276
|
+
}
|
|
1277
|
+
return { ...list[0], reason: "\u68C0\u7D22\u7ED3\u679C\u672A\u6807\u5BB9\u91CF\uFF0C\u53D6\u7B2C\u4E00\u6761" };
|
|
1278
|
+
}
|
|
1279
|
+
function rawCandidateCount(input) {
|
|
1280
|
+
return unwrapRoomRows(input).length;
|
|
1281
|
+
}
|
|
1282
|
+
function normalizeRestaurant(options = {}) {
|
|
1283
|
+
const data = options.data || {};
|
|
1284
|
+
const rawRestaurant = data.restaurant && typeof data.restaurant === "object" && !Array.isArray(data.restaurant) && data.restaurant.booked !== true ? data.restaurant : {};
|
|
1285
|
+
const explicit = {
|
|
1286
|
+
...rawRestaurant,
|
|
1287
|
+
...options.explicit && typeof options.explicit === "object" ? options.explicit : {}
|
|
1288
|
+
};
|
|
1289
|
+
const rooms = options.rooms ?? null;
|
|
1290
|
+
const hay = [data.restaurantRaw, data.logisticsRaw, data.meal, explicit.raw, explicit.note].filter(Boolean).join(" ");
|
|
1291
|
+
const mentioned = Boolean(data.restaurant) || data.restaurantIntent === true || Object.keys(explicit).length > 0 || TRIGGER.test(hay);
|
|
1292
|
+
if (!mentioned) return null;
|
|
1293
|
+
const visit = Number(data.headcountMax || data.headcount || 0) || 0;
|
|
1294
|
+
const headcount = Number(explicit.headcount || data.restaurantHeadcount || visit || 10) || 10;
|
|
1295
|
+
const baseDate = pickStr2(explicit.startDate || data.visitDate || "");
|
|
1296
|
+
const noon = /中午|午餐|午宴|午饭/.test(hay);
|
|
1297
|
+
const evening = /晚上|晚宴|晚餐|夜里|今晚/.test(hay);
|
|
1298
|
+
const inText = timesIn(hay);
|
|
1299
|
+
const textTime = pickStr2(inText[0]);
|
|
1300
|
+
const explicitStart = pickStr2(explicit.startTime);
|
|
1301
|
+
const duration = Number(explicit.durationMinutes || RESTAURANT_DETAIL.defaultDurationMinutes) || 90;
|
|
1302
|
+
const startTime = explicitStart || textTime || (noon ? "11:30" : "18:00");
|
|
1303
|
+
const endTime = pickStr2(explicit.endTime) || (explicitStart || textTime ? hhmmPlus(startTime, duration) : noon ? "13:30" : "21:00");
|
|
1304
|
+
const mealPeriod = noon ? "\u4E2D\u5348" : evening ? "\u665A\u4E0A" : "\u665A\u4E0A";
|
|
1305
|
+
let endDate = pickStr2(explicit.endDate) || baseDate;
|
|
1306
|
+
if (!pickStr2(explicit.endDate) && endTime <= startTime && endDate) endDate = nextDay(endDate);
|
|
1307
|
+
const explicitRoom = pickStr2(explicit.roomNo || explicit.room || explicit.roomName);
|
|
1308
|
+
const candidates = normalizeRoomCandidates(rooms || []);
|
|
1309
|
+
const prev = data.restaurant && typeof data.restaurant === "object" ? data.restaurant : null;
|
|
1310
|
+
const picked = explicitRoom ? { name: explicitRoom, capacity: 0, reason: "\u6309\u6307\u5B9A\u5305\u53A2" } : pickRestaurantRoom(candidates, headcount) || (prev && prev.roomNo ? { name: prev.roomNo, capacity: prev.roomCapacity || 0, reason: prev.roomReason || "\u6CBF\u7528\u4E0A\u4E00\u8F6E\u7ED3\u679C" } : null);
|
|
1311
|
+
const rawCount = rawCandidateCount(rooms);
|
|
1312
|
+
const roomState = picked ? picked.capacity && headcount > picked.capacity ? "overflow" : "ok" : rawCount ? "candidates-unparsed" : "no-candidates";
|
|
1313
|
+
return {
|
|
1314
|
+
booked: true,
|
|
1315
|
+
roomNo: picked ? picked.name : "",
|
|
1316
|
+
roomState,
|
|
1317
|
+
roomCapacity: picked && picked.capacity ? picked.capacity : 0,
|
|
1318
|
+
roomReason: picked ? picked.reason : rawCount ? `\u7ED9\u4E86 ${rawCount} \u6761\u5019\u9009\u4F46\u8BA4\u4E0D\u51FA\u5305\u53A2\u540D/\u5BB9\u91CF\uFF08\u68C0\u67E5\u5B57\u6BB5\u6620\u5C04\uFF09` : "\u7F3A\u5305\u53A2\u53F7\uFF1A\u6CA1\u62FF\u5230\u53EF\u7528\u5305\u53A2\u6E05\u5355",
|
|
1319
|
+
headcount,
|
|
1320
|
+
startDate: baseDate,
|
|
1321
|
+
startTime,
|
|
1322
|
+
endDate,
|
|
1323
|
+
endTime,
|
|
1324
|
+
mealPeriod,
|
|
1325
|
+
// 候选清单只留名字与容量,用于「订不上时把可选项告诉用户」
|
|
1326
|
+
candidates: (candidates.length ? candidates : prev && Array.isArray(prev.candidates) ? prev.candidates : []).slice(0, 20).map((room) => ({ name: room.name, capacity: room.capacity })),
|
|
1327
|
+
raw: pickStr2(hay).slice(0, 200)
|
|
1328
|
+
};
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1010
1331
|
// src/shortcuts/reception/operations/render-assets.ts
|
|
1011
1332
|
import { spawnSync, execFile } from "node:child_process";
|
|
1012
1333
|
import { existsSync } from "node:fs";
|
|
@@ -1221,6 +1542,28 @@ function applyCases(data, casesFile) {
|
|
|
1221
1542
|
if (expertsQuery) data.expertsQuery = String(expertsQuery);
|
|
1222
1543
|
}
|
|
1223
1544
|
}
|
|
1545
|
+
function readRoomsFile(path) {
|
|
1546
|
+
let raw;
|
|
1547
|
+
try {
|
|
1548
|
+
raw = readFileSync2(path, "utf8");
|
|
1549
|
+
} catch (error) {
|
|
1550
|
+
throw receptionValidationError("RESTAURANT_ROOMS_UNREADABLE", `\u8BFB\u4E0D\u5230 --restaurant-rooms-file\uFF1A${path}`, {
|
|
1551
|
+
path,
|
|
1552
|
+
detail: error.message,
|
|
1553
|
+
hint: "\u4F20\u300C\u5C0F\u98DF\u5802\u5305\u53A2\u300Dds list \u7684\u539F\u59CB\u8F93\u51FA\uFF0C\u6216 [{name,capacity}] \u6570\u7EC4"
|
|
1554
|
+
});
|
|
1555
|
+
}
|
|
1556
|
+
const parsed = parseJsonText(raw);
|
|
1557
|
+
if (!parsed.ok) {
|
|
1558
|
+
throw receptionValidationError("RESTAURANT_ROOMS_INVALID", `--restaurant-rooms-file \u4E0D\u662F\u5408\u6CD5 JSON\uFF1A${parsed.error}`, {
|
|
1559
|
+
path,
|
|
1560
|
+
preview: parsed.preview,
|
|
1561
|
+
hasBom: parsed.hasBom,
|
|
1562
|
+
hint: "\u5E38\u89C1\u539F\u56E0\uFF1AUTF-8 BOM\u3001\u4E2D\u6587\u5F15\u53F7\u3001\u5C3E\u968F\u9017\u53F7\uFF1B\u4FEE JSON \u672C\u8EAB\uFF0C\u4E0D\u8981\u6362\u4F20\u53C2\u65B9\u5F0F"
|
|
1563
|
+
});
|
|
1564
|
+
}
|
|
1565
|
+
return parsed.value;
|
|
1566
|
+
}
|
|
1224
1567
|
async function doc(input, ctx) {
|
|
1225
1568
|
const startedAt = Date.now();
|
|
1226
1569
|
const runIdArg = String(input.runId || "").trim();
|
|
@@ -1260,6 +1603,23 @@ async function doc(input, ctx) {
|
|
|
1260
1603
|
const answers = input.answers ?? run.answers ?? {};
|
|
1261
1604
|
const data = mergeAnswers(run, answers);
|
|
1262
1605
|
if (input.casesFile) applyCases(data, input.casesFile);
|
|
1606
|
+
applyMeetingPolicy(data);
|
|
1607
|
+
const booking = normalizeRestaurant({
|
|
1608
|
+
data,
|
|
1609
|
+
rooms: input.restaurantRoomsFile ? readRoomsFile(input.restaurantRoomsFile) : null
|
|
1610
|
+
});
|
|
1611
|
+
if (booking) data.restaurant = booking;
|
|
1612
|
+
const todo = Array.isArray(data.todo) ? [...data.todo] : [];
|
|
1613
|
+
const addTodo = (item) => {
|
|
1614
|
+
if (item && !todo.includes(item)) todo.push(item);
|
|
1615
|
+
};
|
|
1616
|
+
if (!normalizeMeeting(data.meeting)) {
|
|
1617
|
+
addTodo("\u662F\u5426\u9700\u8981\u4F1A\u8BAE\u672A\u8868\u6001\uFF1A\u4F1A\u8BAE\u5BA4\u672A\u9884\u7559\uFF0C\u8BF7\u884C\u653F\u786E\u8BA4\u540E\u56DE\u586B");
|
|
1618
|
+
}
|
|
1619
|
+
if (booking && booking.booked && !String(booking.roomNo || "").trim()) {
|
|
1620
|
+
addTodo(`\u5C0F\u9910\u5385\u5305\u53A2\u5F85\u786E\u8BA4\uFF1A${booking.roomReason || "\u672A\u53D6\u5230\u53EF\u7528\u5305\u53A2"}`);
|
|
1621
|
+
}
|
|
1622
|
+
if (todo.length) data.todo = todo;
|
|
1263
1623
|
const outDir = input.outDir || run.outDir || ctx.outDir;
|
|
1264
1624
|
ensureDir(outDir);
|
|
1265
1625
|
const warnings = [];
|
|
@@ -1497,79 +1857,6 @@ function buildCustomParams(items = []) {
|
|
|
1497
1857
|
return { values, keys: ordered };
|
|
1498
1858
|
}
|
|
1499
1859
|
|
|
1500
|
-
// src/shortcuts/reception/operations/schedule.ts
|
|
1501
|
-
var STANDARD_AGENDA = [
|
|
1502
|
-
{ offset: 0, item: "\u516C\u53F8\u53C2\u89C2", activity: "\u53C2\u89C2\u6CDB\u5FAE\u4E0A\u6D77\u603B\u90E8\u5C55\u5385\u4E0E\u529E\u516C\u533A\uFF0C\u4E86\u89E3\u516C\u53F8\u53D1\u5C55\u5386\u7A0B\u4E0E\u4EA7\u54C1\u80FD\u529B" },
|
|
1503
|
-
{ offset: 45, item: "\u65B9\u6848\u4ECB\u7ECD", activity: "" },
|
|
1504
|
-
{ offset: 120, item: "\u8BA8\u8BBA\u4EA4\u6D41", activity: "\u53CC\u65B9\u56F4\u7ED5\u5173\u6CE8\u70B9\u4EA4\u6D41\u7B54\u7591\uFF0C\u660E\u786E\u540E\u7EED\u63A8\u8FDB\u8282\u594F" }
|
|
1505
|
-
];
|
|
1506
|
-
var SEVEN = ["date", "time", "item", "place", "person", "activity", "remark"];
|
|
1507
|
-
function hhmmPlus(start, mins) {
|
|
1508
|
-
const base = /^\d{1,2}:\d{2}$/.test(String(start || "")) ? String(start) : "09:30";
|
|
1509
|
-
const [hour, minute] = base.split(":").map(Number);
|
|
1510
|
-
const total = ((hour * 60 + minute + mins) % 1440 + 1440) % 1440;
|
|
1511
|
-
return `${String(Math.floor(total / 60)).padStart(2, "0")}:${String(total % 60).padStart(2, "0")}`;
|
|
1512
|
-
}
|
|
1513
|
-
function pick7(row) {
|
|
1514
|
-
if (!row || typeof row !== "object" || Array.isArray(row)) return null;
|
|
1515
|
-
const source = row;
|
|
1516
|
-
const out = {};
|
|
1517
|
-
for (const key of SEVEN) {
|
|
1518
|
-
const value = source[key];
|
|
1519
|
-
if (value !== null && value !== void 0 && String(value).trim()) out[key] = String(value).trim();
|
|
1520
|
-
}
|
|
1521
|
-
return Object.keys(out).length ? out : null;
|
|
1522
|
-
}
|
|
1523
|
-
function normalizeScheduleRows(data = {}) {
|
|
1524
|
-
const rows = [];
|
|
1525
|
-
const push = (row) => {
|
|
1526
|
-
if (row) rows.push(row);
|
|
1527
|
-
};
|
|
1528
|
-
const companions = Array.isArray(data.companions) ? data.companions : [];
|
|
1529
|
-
const escortNames = nameList(data.escorts);
|
|
1530
|
-
const mainPerson = escortNames[0] || companions.map((item) => typeof item === "string" ? item : item && item.name || "").filter(Boolean)[0] || data.contact || "";
|
|
1531
|
-
if (Array.isArray(data.scheduleRows)) data.scheduleRows.forEach((row) => push(pick7(row)));
|
|
1532
|
-
if (!rows.length && Array.isArray(data.schedule)) {
|
|
1533
|
-
data.schedule.forEach((row) => {
|
|
1534
|
-
if (Array.isArray(row)) {
|
|
1535
|
-
const [time, item, place] = row;
|
|
1536
|
-
push(pick7({ date: data.visitDate || data.arrivalDate || "", time, item, place, person: mainPerson }));
|
|
1537
|
-
} else {
|
|
1538
|
-
push(pick7(row));
|
|
1539
|
-
}
|
|
1540
|
-
});
|
|
1541
|
-
}
|
|
1542
|
-
if (!rows.length && Array.isArray(data.agenda)) {
|
|
1543
|
-
data.agenda.forEach((row) => push(pick7({
|
|
1544
|
-
date: data.visitDate || data.arrivalDate || "",
|
|
1545
|
-
time: row && (row.start || row.time) || "",
|
|
1546
|
-
item: row && row.item,
|
|
1547
|
-
place: row && row.place,
|
|
1548
|
-
person: row && row.person || mainPerson,
|
|
1549
|
-
activity: row && row.activity,
|
|
1550
|
-
remark: row && row.remark
|
|
1551
|
-
})));
|
|
1552
|
-
}
|
|
1553
|
-
if (!rows.length) {
|
|
1554
|
-
const date = data.visitDate || data.arrivalDate || "";
|
|
1555
|
-
const start = /^\d{1,2}:\d{2}$/.test(String(data.agendaStart || "")) ? String(data.agendaStart) : "09:30";
|
|
1556
|
-
const venue = String(data.venue || "\u6CDB\u5FAE\u4E0A\u6D77\u603B\u90E8");
|
|
1557
|
-
const room = normalizeMeeting(data.meeting) === "\u662F" ? normalizeMeetingRoom(data.meetingRoom) || venue : venue;
|
|
1558
|
-
for (const item of STANDARD_AGENDA) {
|
|
1559
|
-
push(pick7({
|
|
1560
|
-
date,
|
|
1561
|
-
time: hhmmPlus(start, item.offset),
|
|
1562
|
-
item: item.item,
|
|
1563
|
-
place: item.item === "\u516C\u53F8\u53C2\u89C2" ? "\u6CDB\u5FAE\u4E0A\u6D77\u603B\u90E8" : room,
|
|
1564
|
-
person: mainPerson,
|
|
1565
|
-
activity: item.item === "\u65B9\u6848\u4ECB\u7ECD" ? data.demand || "\u4EA7\u54C1\u4E0E\u65B9\u6848\u4ECB\u7ECD" : item.activity
|
|
1566
|
-
}));
|
|
1567
|
-
}
|
|
1568
|
-
}
|
|
1569
|
-
for (const row of rows) if (!row.person && mainPerson) row.person = mainPerson;
|
|
1570
|
-
return rows;
|
|
1571
|
-
}
|
|
1572
|
-
|
|
1573
1860
|
// src/shortcuts/reception/operations/compose.ts
|
|
1574
1861
|
var pick = (map, key) => key && map && map[String(key)] !== void 0 ? String(map[String(key)]) : "";
|
|
1575
1862
|
function normAttachmentIds(list, single = "") {
|
|
@@ -1735,6 +2022,9 @@ function composeInitialValues(options) {
|
|
|
1735
2022
|
putRest(restaurant.fields.endDate, data.restaurant.endDate || "");
|
|
1736
2023
|
putRest(restaurant.fields.endTime, data.restaurant.endTime || "");
|
|
1737
2024
|
}
|
|
2025
|
+
} else if (data.restaurant) {
|
|
2026
|
+
warnings.push("\u5C0F\u9910\u5385\u660E\u7EC6\u672A\u5199\u5165\uFF1A\u5165\u53C2\u672A\u5F52\u4E00\uFF08\u7F3A\u5C11 booked\uFF09\uFF0C\u8BF7\u786E\u8BA4\u5305\u53A2\u4E0E\u7528\u9910\u65F6\u95F4\u540E\u624B\u5DE5\u8865\u586B");
|
|
2027
|
+
todos.push("\u5C0F\u9910\u5385\u9884\u5B9A\u660E\u7EC6\u5F85\u8865\u586B\uFF08\u5305\u53A2\u3001\u4EBA\u6570\u3001\u65F6\u95F4\uFF09");
|
|
1738
2028
|
}
|
|
1739
2029
|
const built = buildCustomParams(items);
|
|
1740
2030
|
params.values = built.values;
|
|
@@ -1742,6 +2032,9 @@ function composeInitialValues(options) {
|
|
|
1742
2032
|
if (attachmentPending) todos.push("\u884C\u7A0B\u5355\u9644\u4EF6\u672A\u4E0A\u4F20\uFF08\u53EF\u5728\u9875\u9762\u624B\u52A8\u6DFB\u52A0\uFF09");
|
|
1743
2033
|
if (!data.companions || !data.companions.length) todos.push("\u966A\u540C\u4EBA\u5458\u672A\u586B");
|
|
1744
2034
|
if (!data.demand) todos.push("\u5BA2\u6237\u9700\u6C42\u672A\u586B");
|
|
2035
|
+
if (!normalizeMeeting(data.meeting)) {
|
|
2036
|
+
todos.push("\u662F\u5426\u9700\u8981\u4F1A\u8BAE\u672A\u8868\u6001\uFF1A\u4F1A\u8BAE\u5BA4\u672A\u9884\u7559\uFF0C\u63D0\u4EA4\u524D\u8BF7\u884C\u653F\u786E\u8BA4");
|
|
2037
|
+
}
|
|
1745
2038
|
return {
|
|
1746
2039
|
values: params.values,
|
|
1747
2040
|
keys: params.keys,
|
|
@@ -1787,6 +2080,16 @@ async function render(input, ctx) {
|
|
|
1787
2080
|
);
|
|
1788
2081
|
}
|
|
1789
2082
|
applyMeetingPolicy(data);
|
|
2083
|
+
if (!normalizeMeeting(data.meeting)) {
|
|
2084
|
+
throw receptionBusinessError(
|
|
2085
|
+
"MEETING_UNCONFIRMED",
|
|
2086
|
+
"\u662F\u5426\u9700\u8981\u4F1A\u8BAE\u672A\u786E\u8BA4\uFF0C\u8BF7\u5148\u8865\u95EE\u518D\u51FA\u586B\u5355\u9875",
|
|
2087
|
+
{
|
|
2088
|
+
headcount: data.headcount || "",
|
|
2089
|
+
hint: '\u5148\u5411\u7528\u6237\u786E\u8BA4\u300C\u662F\u5426\u9700\u8981\u4F1A\u8BAE\u5BA4\u5EA7\u8C08\u300D\uFF0C\u62FF\u5230\u7B54\u6848\u540E\u653E\u8FDB answers.fields.meeting\uFF08"\u662F"/"\u5426"\uFF09\u91CD\u8DD1\u672C\u6761\uFF1B\u63D0\u4E86\u5C0F\u9910\u5385\u4E0D\u4EE3\u8868\u8981\u5F00\u4F1A\uFF0C\u4E0D\u5F97\u636E\u6B64\u63A8\u65AD'
|
|
2090
|
+
}
|
|
2091
|
+
);
|
|
2092
|
+
}
|
|
1790
2093
|
if (normalizeMeeting(data.meeting) === "\u662F") {
|
|
1791
2094
|
if (!Number(data.headcount)) {
|
|
1792
2095
|
data.todos = [...Array.isArray(data.todos) ? data.todos : [], "\u4EBA\u6570\u672A\u586B\uFF0C\u4F1A\u8BAE\u5BA4\u6309\u9ED8\u8BA4\u9884\u7559"];
|
|
@@ -1804,6 +2107,31 @@ async function render(input, ctx) {
|
|
|
1804
2107
|
data.empId = session.userId || "";
|
|
1805
2108
|
if (!data.empId) composedWarnings.push("\u4E3B\u8054\u7EDC\u4EBA\u672A\u53D6\u5230\u767B\u5F55\u4EBA\uFF0C\u8BF7\u5728\u9875\u9762\u4E0A\u624B\u52A8\u9009\u62E9");
|
|
1806
2109
|
}
|
|
2110
|
+
const defaultsApplied = [];
|
|
2111
|
+
const headcountKnown = Number(data.headcount) > 0;
|
|
2112
|
+
if (normalizeMeeting(data.meeting) === "\u662F" && !headcountKnown) {
|
|
2113
|
+
defaultsApplied.push({
|
|
2114
|
+
field: "meetingRoom",
|
|
2115
|
+
value: String(data.meetingRoom || ""),
|
|
2116
|
+
reason: String(data.meetingRoomMeta && data.meetingRoomMeta.reason || "\u4EBA\u6570\u672A\u586B\uFF0C\u4F1A\u8BAE\u5BA4\u6309\u9ED8\u8BA4\u9884\u7559")
|
|
2117
|
+
});
|
|
2118
|
+
}
|
|
2119
|
+
if (data.restaurant && data.restaurant.booked) {
|
|
2120
|
+
if (!headcountKnown) {
|
|
2121
|
+
defaultsApplied.push({
|
|
2122
|
+
field: "customerCount",
|
|
2123
|
+
value: String(data.restaurant.headcount || ""),
|
|
2124
|
+
reason: "\u4EBA\u6570\u672A\u586B\uFF0C\u5C0F\u9910\u5385\u6309 10 \u4EBA\u9884\u7559"
|
|
2125
|
+
});
|
|
2126
|
+
}
|
|
2127
|
+
if (data.restaurant.roomNo && !/按指定包厢/.test(String(data.restaurant.roomReason || ""))) {
|
|
2128
|
+
defaultsApplied.push({
|
|
2129
|
+
field: "restaurantRoom",
|
|
2130
|
+
value: String(data.restaurant.roomNo),
|
|
2131
|
+
reason: String(data.restaurant.roomReason || "\u6309\u5BB9\u91CF\u5339\u914D")
|
|
2132
|
+
});
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
1807
2135
|
const composed = composeInitialValues({
|
|
1808
2136
|
snapshot: resolved.snapshot,
|
|
1809
2137
|
data,
|
|
@@ -1863,6 +2191,7 @@ async function render(input, ctx) {
|
|
|
1863
2191
|
attachmentPending: composed.attachmentPending,
|
|
1864
2192
|
sdkRenderType: resolveRenderType(input.sdkRender),
|
|
1865
2193
|
todos: composed.todos,
|
|
2194
|
+
defaultsApplied,
|
|
1866
2195
|
browsertool,
|
|
1867
2196
|
browsertoolFile,
|
|
1868
2197
|
browsertoolRef: browsertoolFile ? `<browsertool-file path="${browsertoolFile}" />` : "",
|
|
@@ -1884,7 +2213,27 @@ async function docRender(input, ctx) {
|
|
|
1884
2213
|
const docResult = await doc(input, ctx);
|
|
1885
2214
|
if (!docResult.ok) return docResult;
|
|
1886
2215
|
const runId = String((docResult.data || {}).runId || input.runId || "");
|
|
1887
|
-
|
|
2216
|
+
let renderResult;
|
|
2217
|
+
try {
|
|
2218
|
+
renderResult = await render({
|
|
2219
|
+
runId,
|
|
2220
|
+
sdkRender: input.sdkRender,
|
|
2221
|
+
// answers 与 allowMissingRestaurant 必须透传:
|
|
2222
|
+
// render 虽然会回落到 run.answers,但「同一 run 二次调用带新 answers」只能靠这里;
|
|
2223
|
+
// 漏传 allowMissingRestaurant 会让 doc-render 上的放行开关整个失效。
|
|
2224
|
+
answers: input.answers,
|
|
2225
|
+
allowMissingRestaurant: input.allowMissingRestaurant === true
|
|
2226
|
+
}, ctx);
|
|
2227
|
+
} catch (error) {
|
|
2228
|
+
const err = error;
|
|
2229
|
+
const files = (docResult.data || {}).files;
|
|
2230
|
+
if (err && err.details && typeof err.details === "object" && Array.isArray(files) && files.length) {
|
|
2231
|
+
err.details.files = files;
|
|
2232
|
+
err.details.runId = runId;
|
|
2233
|
+
err.details.note = "\u884C\u7A0B\u5355\u4E0E\u53C2\u8003\u6587\u6863\u5DF2\u751F\u6210\uFF0C\u8865\u9F50\u540E\u91CD\u8DD1 doc-render --run-id \u5373\u53EF\uFF0C\u4E0D\u5FC5\u91CD\u51FA\u4EF6";
|
|
2234
|
+
}
|
|
2235
|
+
throw error;
|
|
2236
|
+
}
|
|
1888
2237
|
return {
|
|
1889
2238
|
state: renderResult.state,
|
|
1890
2239
|
ok: renderResult.ok,
|
|
@@ -1962,7 +2311,7 @@ var receptionOperations = [
|
|
|
1962
2311
|
{
|
|
1963
2312
|
name: "reception.ask",
|
|
1964
2313
|
risk: "read",
|
|
1965
|
-
summary: "\u6309 7 \u9879\u62BD\u53D6\u7ED3\u679C\u51FA\u4EA4\u4E92\u9762\u677F\uFF1A\
|
|
2314
|
+
summary: "\u6309 7 \u9879\u62BD\u53D6\u7ED3\u679C\u51FA\u4EA4\u4E92\u9762\u677F\uFF1A\u5BA2\u6237\u9700\u6C42\uFF08\u5DF2\u660E\u786E\u5219\u8DF3\u8FC7\uFF09+ \u63A5\u5F85\u7EC6\u8282\uFF08\u5E38\u9A7B\uFF09+ \u662F\u5426\u4F1A\u8BAE\uFF08\u5FC5\u95EE\uFF0C\u539F\u8BDD\u660E\u786E\u63D0\u53CA\u4F1A\u8BAE\u5BA4\u624D\u8DF3\u8FC7\uFF09\u3002\u8FD4\u56DE runId \u4F9B doc \u4F7F\u7528\u3002",
|
|
1966
2315
|
inputSchema: {
|
|
1967
2316
|
type: "object",
|
|
1968
2317
|
additionalProperties: false,
|
|
@@ -1985,7 +2334,7 @@ var receptionOperations = [
|
|
|
1985
2334
|
demand: { type: "string", description: "\u5BA2\u6237\u9700\u6C42\uFF08\u65E7\u5B57\u6BB5\u540D\uFF0CcustomerNeed \u4F18\u5148\uFF09" },
|
|
1986
2335
|
customerNeed: { type: "string", description: "\u5BA2\u6237\u9700\u6C42\u539F\u6587\uFF1B\u5DF2\u7ED9\u5219\u4E0D\u518D\u51FA\u300C\u5BA2\u6237\u9700\u6C42\u300D\u9762\u677F\uFF0C\u5E76\u5199\u5165\u8868\u5355\u5BA2\u6237\u9700\u6C42\u5B57\u6BB5" },
|
|
1987
2336
|
meeting: { type: "string", enum: ["\u662F", "\u5426"], description: "\u662F\u5426\u9700\u8981\u4F1A\u8BAE\u5BA4\u5EA7\u8C08\uFF1B\u5FC5\u987B\u4E0E meetingExplicit \u4E00\u8D77\u4F20\u624D\u751F\u6548" },
|
|
1988
|
-
meetingExplicit: { type: "boolean", description: "\
|
|
2337
|
+
meetingExplicit: { type: "boolean", description: "\u539F\u8BDD\u662F\u5426\u660E\u786E\u63D0\u53CA\u9884\u5B9A\u4F1A\u8BAE\u5BA4\uFF08\u4F1A\u8BAE\u5BA4/\u8BA2\u4F1A\u8BAE\u5BA4/\u5EA7\u8C08\u573A\u5730/\u6C47\u62A5\u573A\u5730\uFF0C\u6216\u6307\u5B9A 129/130/131\uFF09\u3002\u53EA\u6709 true \u624D\u8DF3\u8FC7\u4F1A\u8BAE\u5C4F\uFF1B\u300C\u665A\u4E0A\u8BA2\u5C0F\u9910\u5385\u300D\u4E0D\u7B97\uFF0C\u4E0D\u5F97\u636E\u6B64\u63A8\u65AD" },
|
|
1989
2338
|
restaurantIntent: { type: "boolean", description: "\u539F\u8BDD\u662F\u5426\u63D0\u5230\u5C0F\u9910\u5385/\u5305\u53A2\uFF1Btrue \u5219\u5FC5\u987B\u5E26 --restaurant-rooms-file" },
|
|
1990
2339
|
logistics: { type: "string", description: "\u63A5\u5F85\u7EC6\u8282\u539F\u6587\uFF1A\u4EBA\u6570/\u63A5\u9001/\u7528\u9910/\u4F4F\u5BBF/\u4F34\u624B\u793C/\u624B\u673A" }
|
|
1991
2340
|
}
|
|
@@ -2103,6 +2452,7 @@ var receptionOperations = [
|
|
|
2103
2452
|
outDir: { type: "string", description: "\u4EA7\u7269\u8F93\u51FA\u76EE\u5F55" },
|
|
2104
2453
|
noUpload: { type: "boolean", description: "\u8DF3\u8FC7\u9644\u4EF6\u4E0A\u4F20\uFF0C\u53EA\u51FA\u672C\u5730\u6587\u4EF6" },
|
|
2105
2454
|
snapshot: { type: "string", description: "\u5B57\u6BB5\u5FEB\u7167\u8DEF\u5F84\uFF1B\u540C\u65F6\u7528\u4E8E\u63A8\u5BFC\u6280\u80FD\u5305\u5185 render.py \u4F4D\u7F6E" },
|
|
2455
|
+
allowMissingRestaurant: { type: "boolean", description: "\u63D0\u4E86\u5C0F\u9910\u5385\u4F46\u786E\u5B9E\u62FF\u4E0D\u5230\u5305\u53A2\u53F7\u65F6\u653E\u884C\uFF08\u660E\u7EC6\u7559\u7A7A\u8FDB\u5F85\u529E\uFF09\uFF0C\u9ED8\u8BA4 false \u76F4\u63A5\u62A5 RESTAURANT_DETAIL_MISSING" },
|
|
2106
2456
|
renderPy: { type: "string", description: "\u663E\u5F0F\u6307\u5B9A render.py \u8DEF\u5F84" },
|
|
2107
2457
|
sdkRender: {
|
|
2108
2458
|
type: "string",
|
|
@@ -2282,7 +2632,7 @@ var receptionShortcut = {
|
|
|
2282
2632
|
}
|
|
2283
2633
|
await runOperation(ctx, String(operation), input, opts);
|
|
2284
2634
|
}));
|
|
2285
|
-
reception.command("ask").description("\u51FA\u4EA4\u4E92\u9762\u677F\uFF08\u7F3A\u9879\u624D\u51FA\u5C4F\uFF0C\
|
|
2635
|
+
reception.command("ask").description("\u51FA\u4EA4\u4E92\u9762\u677F\uFF08\u7F3A\u9879\u624D\u51FA\u5C4F\uFF0C\u6700\u591A 3 \u5C4F\uFF1A\u5BA2\u6237\u9700\u6C42 / \u63A5\u5F85\u7EC6\u8282 / \u662F\u5426\u4F1A\u8BAE\uFF09").option("--known <json>", "7 \u9879\u62BD\u53D6\u7ED3\u679C\uFF08\u5185\u8054 JSON\uFF09").option("--known-file <path>", "7 \u9879\u62BD\u53D6\u7ED3\u679C\uFF08JSON \u6587\u4EF6\uFF0C\u63A8\u8350\uFF09").option("--user <names>", "\u966A\u540C\u4EBA\u5458\u59D3\u540D\uFF0C\u591A\u4EBA\u9017\u53F7\u5206\u9694\uFF1B\u4E0D\u4F20\u7528\u5F53\u524D\u767B\u5F55\u4EBA\u515C\u5E95").option("--customer <name>", "\u5BA2\u6237\u540D\u79F0\uFF0C\u8986\u76D6 known.customer").option("--workflow <name>", `\u76EE\u6807\u6D41\u7A0B\u540D\uFF0C\u9ED8\u8BA4\u300C${DEFAULT_WORKFLOW}\u300D`).option("--out-dir <dir>", "\u4EA7\u7269\u8F93\u51FA\u76EE\u5F55").action(action(async (ctx, options) => {
|
|
2286
2636
|
const opts = asOptions(options);
|
|
2287
2637
|
const known = jsonArg(opts, "known", {
|
|
2288
2638
|
code: "KNOWN",
|
|
@@ -2330,7 +2680,7 @@ var receptionShortcut = {
|
|
|
2330
2680
|
timeoutMs: textOf(opts, "timeoutMs") ? Number(textOf(opts, "timeoutMs")) : void 0
|
|
2331
2681
|
}, opts);
|
|
2332
2682
|
}));
|
|
2333
|
-
reception.command("doc-render").description("\u4E00\u6B21\u5B8C\u6210\u300C\u51FA\u4EF6 + \u4F20\u9644\u4EF6 + \u62FC\u586B\u5355\u53C2\u6570\u300D\uFF08doc \u4E0E render \u5408\u5E76\uFF0C\u7701\u4E00\u6B21\u5DE5\u5177\u5F80\u8FD4\uFF09").option("--run-id <id>", "ask \u8FD4\u56DE\u7684 runId").option("--known <json>", "run \u5931\u6548\u65F6\u7528\u4E8E\u73B0\u573A\u91CD\u5EFA\u7684 7 \u9879\u62BD\u53D6\u7ED3\u679C").option("--known-file <path>", "\u540C\u4E0A\uFF0CJSON \u6587\u4EF6").option("--answers <json>", "\u9762\u677F\u56DE\u586B\u503C\uFF08\u5185\u8054 JSON\uFF09").option("--answers-file <path>", "\u9762\u677F\u56DE\u586B\u503C\uFF08JSON \u6587\u4EF6\uFF0C\u63A8\u8350\uFF09").option("--cases-file <path>", "\u6848\u4F8B + \u4E13\u5BB6\u68C0\u7D22\u7ED3\u679C JSON").option("--restaurant-rooms-file <path>", "\u5C0F\u98DF\u5802\u5305\u53A2\u5019\u9009\uFF08e10-data ds list \u539F\u59CB\u8F93\u51FA\u6216 [{name,capacity}]\uFF09").option("--workflow <name>", "\u76EE\u6807\u6D41\u7A0B\u540D").option("--out-dir <dir>", "\u4EA7\u7269\u8F93\u51FA\u76EE\u5F55").option("--snapshot <path>", "\u5B57\u6BB5\u5FEB\u7167\u8DEF\u5F84\uFF08\u540C\u65F6\u7528\u4E8E\u63A8\u5BFC render.py\uFF09").option("--render-py <path>", "\u663E\u5F0F\u6307\u5B9A render.py").option("--no-upload", "\u8DF3\u8FC7\u9644\u4EF6\u4E0A\u4F20\uFF0C\u53EA\u51FA\u672C\u5730\u6587\u4EF6").option("--sdk-render <type>", "\u6253\u5F00\u5F62\u6001\uFF1Ainline / popup / drawer\uFF08\u9ED8\u8BA4 drawer\uFF09").action(action(async (ctx, options) => {
|
|
2683
|
+
reception.command("doc-render").description("\u4E00\u6B21\u5B8C\u6210\u300C\u51FA\u4EF6 + \u4F20\u9644\u4EF6 + \u62FC\u586B\u5355\u53C2\u6570\u300D\uFF08doc \u4E0E render \u5408\u5E76\uFF0C\u7701\u4E00\u6B21\u5DE5\u5177\u5F80\u8FD4\uFF09").option("--run-id <id>", "ask \u8FD4\u56DE\u7684 runId").option("--known <json>", "run \u5931\u6548\u65F6\u7528\u4E8E\u73B0\u573A\u91CD\u5EFA\u7684 7 \u9879\u62BD\u53D6\u7ED3\u679C").option("--known-file <path>", "\u540C\u4E0A\uFF0CJSON \u6587\u4EF6").option("--answers <json>", "\u9762\u677F\u56DE\u586B\u503C\uFF08\u5185\u8054 JSON\uFF09").option("--answers-file <path>", "\u9762\u677F\u56DE\u586B\u503C\uFF08JSON \u6587\u4EF6\uFF0C\u63A8\u8350\uFF09").option("--cases-file <path>", "\u6848\u4F8B + \u4E13\u5BB6\u68C0\u7D22\u7ED3\u679C JSON").option("--restaurant-rooms-file <path>", "\u5C0F\u98DF\u5802\u5305\u53A2\u5019\u9009\uFF08e10-data ds list \u539F\u59CB\u8F93\u51FA\u6216 [{name,capacity}]\uFF09").option("--workflow <name>", "\u76EE\u6807\u6D41\u7A0B\u540D").option("--out-dir <dir>", "\u4EA7\u7269\u8F93\u51FA\u76EE\u5F55").option("--snapshot <path>", "\u5B57\u6BB5\u5FEB\u7167\u8DEF\u5F84\uFF08\u540C\u65F6\u7528\u4E8E\u63A8\u5BFC render.py\uFF09").option("--render-py <path>", "\u663E\u5F0F\u6307\u5B9A render.py").option("--no-upload", "\u8DF3\u8FC7\u9644\u4EF6\u4E0A\u4F20\uFF0C\u53EA\u51FA\u672C\u5730\u6587\u4EF6").option("--allow-missing-restaurant", "\u63D0\u4E86\u5C0F\u9910\u5385\u4F46\u6CA1\u5305\u53A2\u53F7\u65F6\u4ECD\u653E\u884C\uFF08\u660E\u7EC6\u7559\u7A7A\u8FDB\u5F85\u529E\uFF09").option("--sdk-render <type>", "\u6253\u5F00\u5F62\u6001\uFF1Ainline / popup / drawer\uFF08\u9ED8\u8BA4 drawer\uFF09").action(action(async (ctx, options) => {
|
|
2334
2684
|
const opts = asOptions(options);
|
|
2335
2685
|
await runOperation(ctx, "reception.docRender", {
|
|
2336
2686
|
runId: textOf(opts, "runId") || void 0,
|
|
@@ -2343,6 +2693,7 @@ var receptionShortcut = {
|
|
|
2343
2693
|
snapshot: textOf(opts, "snapshot") || void 0,
|
|
2344
2694
|
renderPy: textOf(opts, "renderPy") || void 0,
|
|
2345
2695
|
noUpload: opts.upload === false,
|
|
2696
|
+
allowMissingRestaurant: opts.allowMissingRestaurant === true,
|
|
2346
2697
|
sdkRender: textOf(opts, "sdkRender") || void 0
|
|
2347
2698
|
}, opts);
|
|
2348
2699
|
}));
|