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
|
@@ -99,7 +99,7 @@ export const receptionShortcut = {
|
|
|
99
99
|
await runOperation(ctx, String(operation), input, opts);
|
|
100
100
|
}));
|
|
101
101
|
reception.command('ask')
|
|
102
|
-
.description('
|
|
102
|
+
.description('出交互面板(缺项才出屏,最多 3 屏:客户需求 / 接待细节 / 是否会议)')
|
|
103
103
|
.option('--known <json>', '7 项抽取结果(内联 JSON)')
|
|
104
104
|
.option('--known-file <path>', '7 项抽取结果(JSON 文件,推荐)')
|
|
105
105
|
.option('--user <names>', '陪同人员姓名,多人逗号分隔;不传用当前登录人兜底')
|
|
@@ -128,6 +128,7 @@ export const receptionShortcut = {
|
|
|
128
128
|
.option('--answers <json>', '面板回填值(内联 JSON)')
|
|
129
129
|
.option('--answers-file <path>', '面板回填值(JSON 文件,推荐)')
|
|
130
130
|
.option('--cases-file <path>', '案例 + 专家检索结果 JSON')
|
|
131
|
+
.option('--restaurant-rooms-file <path>', '小食堂包厢候选(e10-data ds list 原始输出或 [{name,capacity}])')
|
|
131
132
|
.option('--workflow <name>', '目标流程名')
|
|
132
133
|
.option('--out-dir <dir>', '产物输出目录')
|
|
133
134
|
.option('--snapshot <path>', '字段快照路径(同时用于推导 render.py)')
|
|
@@ -140,6 +141,7 @@ export const receptionShortcut = {
|
|
|
140
141
|
known: jsonArg(opts, 'known', { code: 'KNOWN' }) || undefined,
|
|
141
142
|
answers: parseAnswers(opts) || undefined,
|
|
142
143
|
casesFile: textOf(opts, 'casesFile') || undefined,
|
|
144
|
+
restaurantRoomsFile: textOf(opts, 'restaurantRoomsFile') || undefined,
|
|
143
145
|
workflow: textOf(opts, 'workflow') || undefined,
|
|
144
146
|
outDir: textOf(opts, 'outDir') || undefined,
|
|
145
147
|
snapshot: textOf(opts, 'snapshot') || undefined,
|
|
@@ -155,6 +157,7 @@ export const receptionShortcut = {
|
|
|
155
157
|
.option('--attachment-fileid <ids>', '附件 fileid,多个逗号分隔')
|
|
156
158
|
.option('--sdk-render <type>', '打开形态:inline / popup / drawer(默认 drawer)')
|
|
157
159
|
.option('--snapshot <path>', '字段快照路径')
|
|
160
|
+
.option('--allow-missing-restaurant', '提了小餐厅但没包厢号时仍放行(明细留空进待办)')
|
|
158
161
|
.action(action(async (ctx, options) => {
|
|
159
162
|
const opts = asOptions(options);
|
|
160
163
|
await runOperation(ctx, 'reception.render', {
|
|
@@ -163,6 +166,20 @@ export const receptionShortcut = {
|
|
|
163
166
|
attachmentFileid: textOf(opts, 'attachmentFileid') || undefined,
|
|
164
167
|
sdkRender: textOf(opts, 'sdkRender') || undefined,
|
|
165
168
|
snapshot: textOf(opts, 'snapshot') || undefined,
|
|
169
|
+
allowMissingRestaurant: opts.allowMissingRestaurant === true,
|
|
170
|
+
}, opts);
|
|
171
|
+
}));
|
|
172
|
+
reception.command('restaurant-rooms')
|
|
173
|
+
.description('只读查询「小食堂包厢」(建模表单实查,仅上海),产出可直接传给 doc-render 的候选')
|
|
174
|
+
.option('--page-size <n>', '单页条数,默认 200(后端 name 过滤无效,靠多抓本地筛)')
|
|
175
|
+
.option('--out <path>', '把候选清单写到该 JSON 文件,便于直接传给 --restaurant-rooms-file')
|
|
176
|
+
.option('--timeout-ms <n>', '超时毫秒,默认 30000')
|
|
177
|
+
.action(action(async (ctx, options) => {
|
|
178
|
+
const opts = asOptions(options);
|
|
179
|
+
await runOperation(ctx, 'reception.restaurantRooms', {
|
|
180
|
+
pageSize: textOf(opts, 'pageSize') ? Number(textOf(opts, 'pageSize')) : undefined,
|
|
181
|
+
out: textOf(opts, 'out') || undefined,
|
|
182
|
+
timeoutMs: textOf(opts, 'timeoutMs') ? Number(textOf(opts, 'timeoutMs')) : undefined,
|
|
166
183
|
}, opts);
|
|
167
184
|
}));
|
|
168
185
|
reception.command('doc-render')
|
|
@@ -173,11 +190,13 @@ export const receptionShortcut = {
|
|
|
173
190
|
.option('--answers <json>', '面板回填值(内联 JSON)')
|
|
174
191
|
.option('--answers-file <path>', '面板回填值(JSON 文件,推荐)')
|
|
175
192
|
.option('--cases-file <path>', '案例 + 专家检索结果 JSON')
|
|
193
|
+
.option('--restaurant-rooms-file <path>', '小食堂包厢候选(e10-data ds list 原始输出或 [{name,capacity}])')
|
|
176
194
|
.option('--workflow <name>', '目标流程名')
|
|
177
195
|
.option('--out-dir <dir>', '产物输出目录')
|
|
178
196
|
.option('--snapshot <path>', '字段快照路径(同时用于推导 render.py)')
|
|
179
197
|
.option('--render-py <path>', '显式指定 render.py')
|
|
180
198
|
.option('--no-upload', '跳过附件上传,只出本地文件')
|
|
199
|
+
.option('--allow-missing-restaurant', '提了小餐厅但没包厢号时仍放行(明细留空进待办)')
|
|
181
200
|
.option('--sdk-render <type>', '打开形态:inline / popup / drawer(默认 drawer)')
|
|
182
201
|
.action(action(async (ctx, options) => {
|
|
183
202
|
const opts = asOptions(options);
|
|
@@ -186,11 +205,13 @@ export const receptionShortcut = {
|
|
|
186
205
|
known: jsonArg(opts, 'known', { code: 'KNOWN' }) || undefined,
|
|
187
206
|
answers: parseAnswers(opts) || undefined,
|
|
188
207
|
casesFile: textOf(opts, 'casesFile') || undefined,
|
|
208
|
+
restaurantRoomsFile: textOf(opts, 'restaurantRoomsFile') || undefined,
|
|
189
209
|
workflow: textOf(opts, 'workflow') || undefined,
|
|
190
210
|
outDir: textOf(opts, 'outDir') || undefined,
|
|
191
211
|
snapshot: textOf(opts, 'snapshot') || undefined,
|
|
192
212
|
renderPy: textOf(opts, 'renderPy') || undefined,
|
|
193
213
|
noUpload: opts.upload === false,
|
|
214
|
+
allowMissingRestaurant: opts.allowMissingRestaurant === true,
|
|
194
215
|
sdkRender: textOf(opts, 'sdkRender') || undefined,
|
|
195
216
|
}, opts);
|
|
196
217
|
}));
|
|
@@ -3,7 +3,7 @@ export const receptionOperations = [
|
|
|
3
3
|
{
|
|
4
4
|
name: 'reception.ask',
|
|
5
5
|
risk: 'read',
|
|
6
|
-
summary: '按 7
|
|
6
|
+
summary: '按 7 项抽取结果出交互面板:客户需求(已明确则跳过)+ 接待细节(常驻)+ 是否会议(必问,原话明确提及会议室才跳过)。返回 runId 供 doc 使用。',
|
|
7
7
|
inputSchema: {
|
|
8
8
|
type: 'object',
|
|
9
9
|
additionalProperties: false,
|
|
@@ -11,8 +11,25 @@ export const receptionOperations = [
|
|
|
11
11
|
properties: {
|
|
12
12
|
known: {
|
|
13
13
|
type: 'object',
|
|
14
|
-
description: '
|
|
14
|
+
description: '模型从原话抽取的字段。7 项主字段 + 4 个关键字(escorts/customerNeed/meeting/meetingExplicit),后四个以前是隐式的,这里显式声明。',
|
|
15
15
|
additionalProperties: true,
|
|
16
|
+
properties: {
|
|
17
|
+
customer: { type: 'string', description: '客户名称' },
|
|
18
|
+
headcount: { type: 'string', description: '来访人数,支持「6-10人」这类区间' },
|
|
19
|
+
visitDate: { type: 'string', description: '参观日期 yyyy-MM-dd' },
|
|
20
|
+
visitType: { type: 'string', description: '参观类型:参观上海总部 / 参观典型客户' },
|
|
21
|
+
escorts: {
|
|
22
|
+
type: ['string', 'array'],
|
|
23
|
+
description: '主联络人(对接人),优先级最高;不传则用当前登录人。禁止把主联络人写进 companions',
|
|
24
|
+
},
|
|
25
|
+
companions: { type: ['string', 'array'], description: '陪同人员;仅用于「参与人员」,不参与主联络人取值' },
|
|
26
|
+
demand: { type: 'string', description: '客户需求(旧字段名,customerNeed 优先)' },
|
|
27
|
+
customerNeed: { type: 'string', description: '客户需求原文;已给则不再出「客户需求」面板,并写入表单客户需求字段' },
|
|
28
|
+
meeting: { type: 'string', enum: ['是', '否'], description: '是否需要会议室座谈;必须与 meetingExplicit 一起传才生效' },
|
|
29
|
+
meetingExplicit: { type: 'boolean', description: '原话是否明确提及预定会议室(会议室/订会议室/座谈场地/汇报场地,或指定 129/130/131)。只有 true 才跳过会议屏;「晚上订小餐厅」不算,不得据此推断' },
|
|
30
|
+
restaurantIntent: { type: 'boolean', description: '原话是否提到小餐厅/包厢;true 则必须带 --restaurant-rooms-file' },
|
|
31
|
+
logistics: { type: 'string', description: '接待细节原文:人数/接送/用餐/住宿/伴手礼/手机' },
|
|
32
|
+
},
|
|
16
33
|
},
|
|
17
34
|
user: { type: 'string', description: '陪同人员姓名,多人用逗号分隔;不传则用当前登录人兜底' },
|
|
18
35
|
customer: { type: 'string', description: '客户名称(覆盖 known.customer)' },
|
|
@@ -41,6 +58,10 @@ export const receptionOperations = [
|
|
|
41
58
|
known: { type: 'object', description: 'run 失效时的 7 项抽取结果,用于现场重建 run' },
|
|
42
59
|
answers: { type: 'object', description: 'ask_user 面板回填值:{customer_need, logistics, fields}' },
|
|
43
60
|
casesFile: { type: 'string', description: '案例 + 专家检索结果 JSON 文件路径(软依赖,缺省则不注入)' },
|
|
61
|
+
restaurantRoomsFile: {
|
|
62
|
+
type: 'string',
|
|
63
|
+
description: '小食堂包厢候选清单(e10-data ds list 原始输出或 [{name,capacity}]);提了小餐厅但没给,明细会留空并进待办',
|
|
64
|
+
},
|
|
44
65
|
workflow: { type: 'string', description: '目标流程名' },
|
|
45
66
|
outDir: { type: 'string', description: '产物输出目录' },
|
|
46
67
|
noUpload: { type: 'boolean', description: '跳过附件上传,只出本地文件' },
|
|
@@ -84,6 +105,10 @@ export const receptionOperations = [
|
|
|
84
105
|
description: '打开形态:drawer 为右侧抽屉(默认)',
|
|
85
106
|
},
|
|
86
107
|
snapshot: { type: 'string', description: '字段快照路径' },
|
|
108
|
+
allowMissingRestaurant: {
|
|
109
|
+
type: 'boolean',
|
|
110
|
+
description: '提了小餐厅但没包厢号时仍放行(明细留空进待办);默认 false,缺包厢号直接报错',
|
|
111
|
+
},
|
|
87
112
|
},
|
|
88
113
|
},
|
|
89
114
|
outputSchema: {
|
|
@@ -115,10 +140,12 @@ export const receptionOperations = [
|
|
|
115
140
|
known: { type: 'object', description: 'run 失效时的 7 项抽取结果,用于现场重建 run' },
|
|
116
141
|
answers: { type: 'object', description: 'ask_user 面板回填值:{customer_need, logistics, fields}' },
|
|
117
142
|
casesFile: { type: 'string', description: '案例 + 专家检索结果 JSON 文件路径(软依赖)' },
|
|
143
|
+
restaurantRoomsFile: { type: 'string', description: '小食堂包厢候选清单(e10-api ds list 原始输出或 [{name,capacity}])' },
|
|
118
144
|
workflow: { type: 'string', description: '目标流程名' },
|
|
119
145
|
outDir: { type: 'string', description: '产物输出目录' },
|
|
120
146
|
noUpload: { type: 'boolean', description: '跳过附件上传,只出本地文件' },
|
|
121
147
|
snapshot: { type: 'string', description: '字段快照路径;同时用于推导技能包内 render.py 位置' },
|
|
148
|
+
allowMissingRestaurant: { type: 'boolean', description: '提了小餐厅但确实拿不到包厢号时放行(明细留空进待办),默认 false 直接报 RESTAURANT_DETAIL_MISSING' },
|
|
122
149
|
renderPy: { type: 'string', description: '显式指定 render.py 路径' },
|
|
123
150
|
sdkRender: {
|
|
124
151
|
type: 'string',
|
|
@@ -140,6 +167,7 @@ export const receptionOperations = [
|
|
|
140
167
|
attachments: { type: 'array', items: { type: 'object' } },
|
|
141
168
|
attachmentPending: { type: 'boolean' },
|
|
142
169
|
uploadDiagnostics: { type: 'array', items: { type: 'object' } },
|
|
170
|
+
restaurant: { type: ['object', 'null'], description: '小餐厅预定明细(含 roomState / 候选);null 表示没提这件事' },
|
|
143
171
|
customParams: { type: 'object' },
|
|
144
172
|
fieldAssignKeys: { type: 'string' },
|
|
145
173
|
detailRowCount: { type: 'integer' },
|
|
@@ -152,6 +180,31 @@ export const receptionOperations = [
|
|
|
152
180
|
},
|
|
153
181
|
},
|
|
154
182
|
},
|
|
183
|
+
{
|
|
184
|
+
name: 'reception.restaurantRooms',
|
|
185
|
+
risk: 'read',
|
|
186
|
+
summary: '只读查询「小食堂包厢」(建模表单实查,仅上海),产出可直接传给 doc-render 的 --restaurant-rooms-file 候选清单。包厢是业务数据,文档检索搜不到。',
|
|
187
|
+
inputSchema: {
|
|
188
|
+
type: 'object',
|
|
189
|
+
additionalProperties: false,
|
|
190
|
+
properties: {
|
|
191
|
+
pageSize: { type: 'integer', description: '单页条数,默认 200(后端 name 过滤当前无效,靠多抓本地筛)' },
|
|
192
|
+
out: { type: 'string', description: '把候选清单写到该路径的 JSON 文件,便于直接传给 --restaurant-rooms-file' },
|
|
193
|
+
timeoutMs: { type: 'integer', description: '超时毫秒,默认 30000' },
|
|
194
|
+
},
|
|
195
|
+
},
|
|
196
|
+
outputSchema: {
|
|
197
|
+
type: 'object',
|
|
198
|
+
properties: {
|
|
199
|
+
rooms: { type: 'array', items: { type: 'object' } },
|
|
200
|
+
total: { type: 'integer' },
|
|
201
|
+
rawCount: { type: 'integer' },
|
|
202
|
+
file: { type: 'string' },
|
|
203
|
+
maxCapacity: { type: 'integer' },
|
|
204
|
+
timings: { type: 'object' },
|
|
205
|
+
},
|
|
206
|
+
},
|
|
207
|
+
},
|
|
155
208
|
];
|
|
156
209
|
export const receptionManifest = {
|
|
157
210
|
schemaVersion: 1,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_WORKFLOW } from '../constants.js';
|
|
2
|
-
import { buildPanels } from './panels.js';
|
|
2
|
+
import { buildPanels, normalizeDemand, parseLogistics, setCompanionMobile } from './panels.js';
|
|
3
3
|
import { newRunId, saveRun } from './runs.js';
|
|
4
|
+
import { normalizeMeeting } from './leads.js';
|
|
4
5
|
import { nameList } from './shared.js';
|
|
5
6
|
export async function ask(input, ctx) {
|
|
6
7
|
const startedAt = Date.now();
|
|
@@ -13,6 +14,39 @@ export async function ask(input, ctx) {
|
|
|
13
14
|
// 一个都没有时,compose 用 empId(当前登录人)兜底填「参与人员」。
|
|
14
15
|
const data = { ...known };
|
|
15
16
|
delete data.customerId;
|
|
17
|
+
// 房间只能由 CLI 按人数选,known 里带的房间/后勤一律不采信
|
|
18
|
+
delete data.meetingRoom;
|
|
19
|
+
delete data.meetingRoomMeta;
|
|
20
|
+
// known.logistics 是「接待细节原文」,先拆成 6 个子项再丢原文:
|
|
21
|
+
// 不拆的话面板 prefilled 是空的,用户会被要求把已经说过的话重填一遍。
|
|
22
|
+
if (typeof data.logistics === 'string' && data.logistics.trim()) {
|
|
23
|
+
const parsed = parseLogistics(data.logistics);
|
|
24
|
+
const mobile = parsed.mobile;
|
|
25
|
+
delete parsed.mobile;
|
|
26
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
27
|
+
if (!data[key])
|
|
28
|
+
data[key] = value;
|
|
29
|
+
}
|
|
30
|
+
if (mobile)
|
|
31
|
+
setCompanionMobile(data, mobile);
|
|
32
|
+
}
|
|
33
|
+
delete data.logistics;
|
|
34
|
+
delete data.customer_need;
|
|
35
|
+
// 客户需求来源归一:SKILL 让模型写 `customerNeed`,而面板与缺口判定只认 `demand`,
|
|
36
|
+
// 两处不统一就会出现「原话已明确需求、面板仍追问」。这里只保留 demand 一个来源。
|
|
37
|
+
normalizeDemand(data);
|
|
38
|
+
// 会议表态必须带 meetingExplicit,否则视为「没说过」:清掉推断值,留给会议屏去问。
|
|
39
|
+
// 值本身也要归一(需要/要/安排 → 是),否则 compose 里的 `=== '是'` 会静默漏填。
|
|
40
|
+
if (data.meetingExplicit === true) {
|
|
41
|
+
const meeting = normalizeMeeting(data.meeting);
|
|
42
|
+
if (meeting)
|
|
43
|
+
data.meeting = meeting;
|
|
44
|
+
else
|
|
45
|
+
delete data.meeting;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
delete data.meeting;
|
|
49
|
+
}
|
|
16
50
|
if (customerKeyword)
|
|
17
51
|
data.customer = customerKeyword;
|
|
18
52
|
// 主联络人优先级:`known.escorts`(明确指定的对接人)> `--user`(陪同)> `known.companions` > 登录人兜底。
|
|
@@ -52,6 +86,8 @@ export async function ask(input, ctx) {
|
|
|
52
86
|
customer: data.customer || '',
|
|
53
87
|
visitDate: data.visitDate || '',
|
|
54
88
|
visitType: data.visitType || '',
|
|
89
|
+
demand: data.demand || '',
|
|
90
|
+
meeting: data.meeting || '',
|
|
55
91
|
companions: data.companions || [],
|
|
56
92
|
// 兜底由 render 阶段补:ask 不读会话,这里恒为空
|
|
57
93
|
contactFallback: '',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { buildCustomParams } from './customparams.js';
|
|
2
|
-
import {
|
|
2
|
+
import { meetingRoomId, normalizeMeeting, normalizeMeetingRoom } from './leads.js';
|
|
3
|
+
import { hhmmPlus, normalizeScheduleRows } from './schedule.js';
|
|
3
4
|
import { nameList } from './shared.js';
|
|
4
5
|
/**
|
|
5
6
|
* 把「接待数据 + 字段快照」合成 customParams(纯本地、零网络)。
|
|
@@ -41,8 +42,17 @@ export function composeInitialValues(options) {
|
|
|
41
42
|
case '客户到达日期':
|
|
42
43
|
case '客户参观日期':
|
|
43
44
|
return data.visitDate || data.arrivalDate || '';
|
|
44
|
-
case '客户需求':
|
|
45
|
-
|
|
45
|
+
case '客户需求': {
|
|
46
|
+
// 三处来源按优先级取:面板手输 > 原话抽取的 customerNeed > 兼容旧字段 demand。
|
|
47
|
+
// 以前只认 demand,面板选了或传了 customerNeed 都写不进表单,必填项就空着。
|
|
48
|
+
const picked = String(data.customer_need || '').trim();
|
|
49
|
+
const need = String(data.customerNeed || '').trim();
|
|
50
|
+
const legacy = String(data.demand || '').trim();
|
|
51
|
+
// 面板选的是固定四选项时,把原话补充拼在括号里,避免只剩一句泛化文案
|
|
52
|
+
if (picked && need && !picked.includes(need))
|
|
53
|
+
return `${picked}(客户关注:${need})`;
|
|
54
|
+
return picked || need || legacy;
|
|
55
|
+
}
|
|
46
56
|
case '客户性质':
|
|
47
57
|
return pick(codes['客户性质'], data.nature) || data.nature || '';
|
|
48
58
|
case '项目金额(万元)':
|
|
@@ -53,6 +63,10 @@ export function composeInitialValues(options) {
|
|
|
53
63
|
const escorts = nameList(data.escorts);
|
|
54
64
|
if (escorts.length)
|
|
55
65
|
return escorts;
|
|
66
|
+
// 主联络人默认就是当前登录人;companions 只是陪同,不能拿来做主联络人——
|
|
67
|
+
// 之前把「懂 AI 的高层」这类模糊描述写进 companions,字段就被填成一句人话,页面匹配不到人。
|
|
68
|
+
if (data.empId)
|
|
69
|
+
return [String(data.empId)];
|
|
56
70
|
const list = Array.isArray(data.companions) ? data.companions : [];
|
|
57
71
|
const names = list
|
|
58
72
|
.map((item) => (typeof item === 'string' ? item : item && (item.name || item.id)))
|
|
@@ -66,6 +80,20 @@ export function composeInitialValues(options) {
|
|
|
66
80
|
return pick(codes['是否需要高层参与'], data.senior) || data.senior || '';
|
|
67
81
|
case '客户带队人':
|
|
68
82
|
return data.leader || '';
|
|
83
|
+
// 以下字段在 2026-11 的新布局里才有承载位(旧布局只有 10 个主表字段),
|
|
84
|
+
// 之前这些信息只能写进附件文档;现在有地方就直接落表单。
|
|
85
|
+
case '客户人数':
|
|
86
|
+
return data.headcount === 0 || data.headcount ? data.headcount : '';
|
|
87
|
+
case '用餐人数':
|
|
88
|
+
return data.mealHeadcount || (data.restaurant && data.restaurant.headcount) || '';
|
|
89
|
+
case '客户接送要求(是否需要前往机场、车站接送客户,如需要请写明接送时间、人数及特殊要求)':
|
|
90
|
+
return data.pickup || '';
|
|
91
|
+
case '是否需要购买礼品(如需购买应写明礼品类别、价位、需要时间等)':
|
|
92
|
+
return data.gift || '';
|
|
93
|
+
case '预定酒店':
|
|
94
|
+
return data.hotel || '';
|
|
95
|
+
case '欢迎字幕中的客户名称':
|
|
96
|
+
return data.customer || '';
|
|
69
97
|
case '客户参观接待行程单(由行政经理汇总后反馈)':
|
|
70
98
|
// doNotWrite,走下方挂载字段
|
|
71
99
|
return '';
|
|
@@ -108,6 +136,94 @@ export function composeInitialValues(options) {
|
|
|
108
136
|
}
|
|
109
137
|
if (!rows.length)
|
|
110
138
|
warnings.push('日程明细为 0 行:页面上明细会是空的');
|
|
139
|
+
// 会议字段(主表 6 项):只在「安排会议」且会议室是法定原文时填。
|
|
140
|
+
// 页面下拉只认三个原文,传脏值整组丢弃——宁可留空,也不要填半套。
|
|
141
|
+
const meeting = (snapshot && snapshot.meeting) || null;
|
|
142
|
+
const wantsMeeting = normalizeMeeting(data.meeting) === '是';
|
|
143
|
+
if (wantsMeeting && (!meeting || !meeting.fields)) {
|
|
144
|
+
warnings.push('会议字段未填:字段快照缺少 meeting 节点,技能包版本过旧,需更新 data/fields-snapshot.json');
|
|
145
|
+
}
|
|
146
|
+
if (meeting && meeting.fields && wantsMeeting) {
|
|
147
|
+
const room = normalizeMeetingRoom(data.meetingRoom);
|
|
148
|
+
const options = Array.isArray(meeting.roomOptions) ? meeting.roomOptions : [];
|
|
149
|
+
if (!room || (options.length > 0 && !options.includes(room))) {
|
|
150
|
+
warnings.push(`会议字段未填:会议室「${String(data.meetingRoom || '').trim() || '空'}」不在 ${options.join(' / ') || '候选'} 内`);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
// 会议落在「方案介绍」环节:有第二行就从第二行起,否则退回第一行;
|
|
154
|
+
// 结束取最后一个环节,按该环节默认时长(30 分钟)收尾,避免把整场参观都算成会议。
|
|
155
|
+
const first = rows[0] || {};
|
|
156
|
+
const second = rows[1] || first;
|
|
157
|
+
const last = rows[rows.length - 1] || first;
|
|
158
|
+
const date = String(data.visitDate || data.arrivalDate || first.date || '');
|
|
159
|
+
const startTime = String(data.meetingStartTime || second.time || first.time || '');
|
|
160
|
+
const endTime = String(data.meetingEndTime
|
|
161
|
+
|| (last.time ? hhmmPlus(last.time, 30) : ''));
|
|
162
|
+
const putMeeting = (id, value) => {
|
|
163
|
+
if (id && value !== '' && value !== null && value !== undefined) {
|
|
164
|
+
items.push({ fieldId: id, value: String(value) });
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
// 表单下拉的取值是 `##<optionId>`(前缀读快照,缺省 ##);快照没配 id 时退回名称
|
|
168
|
+
const roomId = pick(meeting.roomOptionIds, room) || meetingRoomId(room);
|
|
169
|
+
const roomPrefix = String(meeting.roomValuePrefix ?? '##');
|
|
170
|
+
putMeeting(meeting.fields.room, roomId ? `${roomPrefix}${roomId}` : room);
|
|
171
|
+
putMeeting(meeting.fields.title, data.meetingTitle || `${data.customer || '客户'}来访交流`);
|
|
172
|
+
putMeeting(meeting.fields.startDate, date);
|
|
173
|
+
putMeeting(meeting.fields.startTime, startTime);
|
|
174
|
+
putMeeting(meeting.fields.endDate, data.meetingEndDate || date);
|
|
175
|
+
putMeeting(meeting.fields.endTime, endTime);
|
|
176
|
+
if (!startTime || !endTime)
|
|
177
|
+
warnings.push('会议开始/结束时间未能从日程推算,请在页面补充');
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
// 小餐厅预定明细(独立子表单,单行):只在提到小餐厅/包厢时填。
|
|
181
|
+
// 包厢号必须是「小食堂包厢」建模表单的实查结果;拿不到就整行不填,绝不编一个。
|
|
182
|
+
const restaurant = (snapshot && snapshot.restaurant) || null;
|
|
183
|
+
if (data.restaurant && data.restaurant.booked && (!restaurant || !restaurant.fields)) {
|
|
184
|
+
// 快照里没有小餐厅节点 = 表单没有承载位(旧版布局就是这样)。
|
|
185
|
+
// 静默丢弃是最糟的结果:文档里写了、表单里没有,只能靠人工比对才发现。
|
|
186
|
+
warnings.push('小餐厅信息无对应字段(字段快照缺少 restaurant 节点),已仅写入附件文档');
|
|
187
|
+
todos.push('小餐厅信息无字段承载,请在流程备注或附件中补充');
|
|
188
|
+
}
|
|
189
|
+
else if (data.restaurant && data.restaurant.booked && restaurant && restaurant.fields) {
|
|
190
|
+
const roomNo = String(data.restaurant.roomNo || '').trim();
|
|
191
|
+
const state = String(data.restaurant.roomState || '');
|
|
192
|
+
if (!roomNo) {
|
|
193
|
+
// 区分「数据源没取到」和「取到了但装不下」,用户才知道找系统还是找行政
|
|
194
|
+
const why = state === 'no-candidates'
|
|
195
|
+
? '包厢数据源未取到(建模表单「小食堂包厢」无返回)'
|
|
196
|
+
: state === 'candidates-unparsed'
|
|
197
|
+
? `包厢候选解析失败:${data.restaurant.roomReason || '认不出包厢名'}`
|
|
198
|
+
: '包厢号为空';
|
|
199
|
+
warnings.push(`小餐厅预定明细未填:${why}`);
|
|
200
|
+
todos.push(`小餐厅包厢待行政确认(${why})`);
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
if (state === 'overflow') {
|
|
204
|
+
const cap = Number(data.restaurant.roomCapacity) || 0;
|
|
205
|
+
warnings.push(`小餐厅包厢已按最大间预留(${cap} 人),本次 ${data.restaurant.headcount || '?'} 人需另行安排`);
|
|
206
|
+
todos.push(`小餐厅现有包厢最大 ${cap} 人,本次人数超出,需另行安排`);
|
|
207
|
+
}
|
|
208
|
+
const putRest = (id, value) => {
|
|
209
|
+
if (id && value !== '' && value !== null && value !== undefined) {
|
|
210
|
+
items.push({ fieldId: id, value: String(value), dataIndex: 0 });
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
putRest(restaurant.fields.roomNo, roomNo);
|
|
214
|
+
putRest(restaurant.fields.headcount, data.restaurant.headcount || '');
|
|
215
|
+
putRest(restaurant.fields.startDate, data.restaurant.startDate || '');
|
|
216
|
+
putRest(restaurant.fields.startTime, data.restaurant.startTime || '');
|
|
217
|
+
putRest(restaurant.fields.endDate, data.restaurant.endDate || '');
|
|
218
|
+
putRest(restaurant.fields.endTime, data.restaurant.endTime || '');
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
else if (data.restaurant) {
|
|
222
|
+
// 有餐厅入参却没归一成 booking(缺 booked):不能静默跳过。
|
|
223
|
+
// 「文档里写了包厢、页面上没有」这种矛盾,只能靠人工比对才发现,代价太高。
|
|
224
|
+
warnings.push('小餐厅明细未写入:入参未归一(缺少 booked),请确认包厢与用餐时间后手工补填');
|
|
225
|
+
todos.push('小餐厅预定明细待补填(包厢、人数、时间)');
|
|
226
|
+
}
|
|
111
227
|
const built = buildCustomParams(items);
|
|
112
228
|
params.values = built.values;
|
|
113
229
|
params.keys = built.keys;
|
|
@@ -117,6 +233,11 @@ export function composeInitialValues(options) {
|
|
|
117
233
|
todos.push('陪同人员未填');
|
|
118
234
|
if (!data.demand)
|
|
119
235
|
todos.push('客户需求未填');
|
|
236
|
+
// 会议没表态时不造数据,但也不能让它悄悄漏掉:接待细节里没写就进待办,
|
|
237
|
+
// 由行政在页面上确认,避免「会议室整段空着还没人发现」。
|
|
238
|
+
if (!normalizeMeeting(data.meeting)) {
|
|
239
|
+
todos.push('是否需要会议未表态:会议室未预留,提交前请行政确认');
|
|
240
|
+
}
|
|
120
241
|
return {
|
|
121
242
|
values: params.values,
|
|
122
243
|
keys: params.keys,
|
|
@@ -2,7 +2,9 @@ import { readFileSync } from 'node:fs';
|
|
|
2
2
|
import { basename, join } from 'node:path';
|
|
3
3
|
import { DEFAULT_WORKFLOW } from '../constants.js';
|
|
4
4
|
import { receptionValidationError } from '../errors.js';
|
|
5
|
+
import { applyMeetingPolicy, normalizeMeeting } from './leads.js';
|
|
5
6
|
import { mergeAnswers } from './panels.js';
|
|
7
|
+
import { normalizeRestaurant } from './restaurant.js';
|
|
6
8
|
import { requirePython, renderBoth, resolveRenderPy } from './render-assets.js';
|
|
7
9
|
import { newRunId, saveRun, tryLoadRun } from './runs.js';
|
|
8
10
|
import { canonical, ensureDir, parseJsonText, sha256, writeJson } from './shared.js';
|
|
@@ -50,6 +52,35 @@ function applyCases(data, casesFile) {
|
|
|
50
52
|
data.expertsQuery = String(expertsQuery);
|
|
51
53
|
}
|
|
52
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* 读「小食堂包厢」候选文件。
|
|
57
|
+
*
|
|
58
|
+
* 允许直接丢 `e10-data ds list` 的原始输出(裸数组 / 裹在 data.list 里 / field_xxx 键),
|
|
59
|
+
* 归一交给 normalizeRoomCandidates;这里只负责把 JSON 读进来并给出可定位的报错。
|
|
60
|
+
*/
|
|
61
|
+
function readRoomsFile(path) {
|
|
62
|
+
let raw;
|
|
63
|
+
try {
|
|
64
|
+
raw = readFileSync(path, 'utf8');
|
|
65
|
+
}
|
|
66
|
+
catch (error) {
|
|
67
|
+
throw receptionValidationError('RESTAURANT_ROOMS_UNREADABLE', `读不到 --restaurant-rooms-file:${path}`, {
|
|
68
|
+
path,
|
|
69
|
+
detail: error.message,
|
|
70
|
+
hint: '传「小食堂包厢」ds list 的原始输出,或 [{name,capacity}] 数组',
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
const parsed = parseJsonText(raw);
|
|
74
|
+
if (!parsed.ok) {
|
|
75
|
+
throw receptionValidationError('RESTAURANT_ROOMS_INVALID', `--restaurant-rooms-file 不是合法 JSON:${parsed.error}`, {
|
|
76
|
+
path,
|
|
77
|
+
preview: parsed.preview,
|
|
78
|
+
hasBom: parsed.hasBom,
|
|
79
|
+
hint: '常见原因:UTF-8 BOM、中文引号、尾随逗号;修 JSON 本身,不要换传参方式',
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return parsed.value;
|
|
83
|
+
}
|
|
53
84
|
export async function doc(input, ctx) {
|
|
54
85
|
const startedAt = Date.now();
|
|
55
86
|
const runIdArg = String(input.runId || '').trim();
|
|
@@ -83,6 +114,34 @@ export async function doc(input, ctx) {
|
|
|
83
114
|
const data = mergeAnswers(run, answers);
|
|
84
115
|
if (input.casesFile)
|
|
85
116
|
applyCases(data, input.casesFile);
|
|
117
|
+
// 定房必须发生在出件之前:md/docx 在 doc 阶段一次成文,
|
|
118
|
+
// 若只在 render 里跑 applyMeetingPolicy,参考文档里永远写「场地待定」,
|
|
119
|
+
// 而填单页却有房间——两份产物互相打脸。
|
|
120
|
+
applyMeetingPolicy(data);
|
|
121
|
+
// 小餐厅:只有用户明确提到才归一(内部按触发词判定),候选来自「小食堂包厢」实查结果。
|
|
122
|
+
// 以前 --restaurant-rooms-file 只被 CLI 接收、无人消费,data.restaurant 恒不存在,
|
|
123
|
+
// 子表、md 段落、缺包厢号的硬校验三处一起失效。
|
|
124
|
+
const booking = normalizeRestaurant({
|
|
125
|
+
data,
|
|
126
|
+
rooms: input.restaurantRoomsFile ? readRoomsFile(input.restaurantRoomsFile) : null,
|
|
127
|
+
});
|
|
128
|
+
if (booking)
|
|
129
|
+
data.restaurant = booking;
|
|
130
|
+
// md 的「待确认事项」读 data.todo(不是 compose 的 todos):会议没表态、包厢没定,
|
|
131
|
+
// 都要在文档里写明,不能出现「场地待定」却把待确认事项写成「无」。
|
|
132
|
+
const todo = Array.isArray(data.todo) ? [...data.todo] : [];
|
|
133
|
+
const addTodo = (item) => {
|
|
134
|
+
if (item && !todo.includes(item))
|
|
135
|
+
todo.push(item);
|
|
136
|
+
};
|
|
137
|
+
if (!normalizeMeeting(data.meeting)) {
|
|
138
|
+
addTodo('是否需要会议未表态:会议室未预留,请行政确认后回填');
|
|
139
|
+
}
|
|
140
|
+
if (booking && booking.booked && !String(booking.roomNo || '').trim()) {
|
|
141
|
+
addTodo(`小餐厅包厢待确认:${booking.roomReason || '未取到可用包厢'}`);
|
|
142
|
+
}
|
|
143
|
+
if (todo.length)
|
|
144
|
+
data.todo = todo;
|
|
86
145
|
const outDir = input.outDir || run.outDir || ctx.outDir;
|
|
87
146
|
ensureDir(outDir);
|
|
88
147
|
const warnings = [];
|
|
@@ -18,7 +18,31 @@ export async function docRender(input, ctx) {
|
|
|
18
18
|
const runId = String((docResult.data || {}).runId || input.runId || '');
|
|
19
19
|
// answers / snapshotPath 已经由 doc 写进 run,这里只传 runId;
|
|
20
20
|
// sdkRender 属于 render 自己的入参,透传即可。
|
|
21
|
-
|
|
21
|
+
let renderResult;
|
|
22
|
+
try {
|
|
23
|
+
renderResult = await render({
|
|
24
|
+
runId,
|
|
25
|
+
sdkRender: input.sdkRender,
|
|
26
|
+
// answers 与 allowMissingRestaurant 必须透传:
|
|
27
|
+
// render 虽然会回落到 run.answers,但「同一 run 二次调用带新 answers」只能靠这里;
|
|
28
|
+
// 漏传 allowMissingRestaurant 会让 doc-render 上的放行开关整个失效。
|
|
29
|
+
answers: input.answers,
|
|
30
|
+
allowMissingRestaurant: input.allowMissingRestaurant === true,
|
|
31
|
+
}, ctx);
|
|
32
|
+
}
|
|
33
|
+
catch (error) {
|
|
34
|
+
// 出件已成功、只有填单参数被拦(典型:提了小餐厅却没给包厢号)。
|
|
35
|
+
// 把产物路径带进错误,调用方才知道「文件已经在本地,补参数重跑本条即可」,
|
|
36
|
+
// 不必重新出件、更不用重新检索案例。
|
|
37
|
+
const err = error;
|
|
38
|
+
const files = (docResult.data || {}).files;
|
|
39
|
+
if (err && err.details && typeof err.details === 'object' && Array.isArray(files) && files.length) {
|
|
40
|
+
err.details.files = files;
|
|
41
|
+
err.details.runId = runId;
|
|
42
|
+
err.details.note = '行程单与参考文档已生成,补齐后重跑 doc-render --run-id 即可,不必重出件';
|
|
43
|
+
}
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
22
46
|
return {
|
|
23
47
|
state: renderResult.state,
|
|
24
48
|
ok: renderResult.ok,
|