weaver-work-cli 0.1.46 → 0.1.48
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-EDJDU3V4.js} +454 -5
- package/dist/chunks/{attachment-content-MCXQBD6N.js → attachment-content-4KSNBPRO.js} +3 -3
- package/dist/chunks/{chunk-UFIFZ4YC.js → chunk-2BQESR2U.js} +1 -1
- package/dist/chunks/{chunk-727FH2NI.js → chunk-2IGZUMNG.js} +15 -2
- package/dist/chunks/{chunk-76H3IKH6.js → chunk-5B5JXTY2.js} +35 -35
- package/dist/chunks/{chunk-Q4OYAQYH.js → chunk-72MI3MBX.js} +4 -0
- package/dist/chunks/{chunk-4RWS2YYL.js → chunk-BCACE6VV.js} +2 -2
- package/dist/chunks/{chunk-AD46OMQK.js → chunk-EFOUMXIX.js} +119 -44
- package/dist/chunks/{chunk-IRMIEDXN.js → chunk-FEP6ELMR.js} +1 -1
- package/dist/chunks/{chunk-JB34OE7R.js → chunk-NBEWUR7L.js} +1 -1
- package/dist/chunks/{chunk-6V5ZPKHV.js → chunk-NK74RE5F.js} +2 -2
- package/dist/chunks/{chunk-GSZTA43P.js → chunk-OCYRVZGN.js} +2 -2
- package/dist/chunks/{chunk-OXHHJWNC.js → chunk-PSPOFLSU.js} +1 -1
- package/dist/chunks/{chunk-6AXKWFKG.js → chunk-R2HHLJNN.js} +4 -4
- package/dist/chunks/{chunk-PSOMGA3U.js → chunk-SVFG6EMV.js} +35 -6
- package/dist/chunks/{chunk-IP4CWQCF.js → chunk-WMSAWAWZ.js} +8 -8
- package/dist/chunks/{conflict-H7EHQXYY.js → conflict-APGSD5E7.js} +2 -2
- package/dist/chunks/{contract-3QLAGYQL.js → contract-N6P2HIIE.js} +425 -187
- package/dist/chunks/{create-flow-VRVJEOBX.js → create-flow-5TXFOC7X.js} +6 -6
- package/dist/chunks/{ehr-SH2LM3NK.js → ehr-XI4BIVR2.js} +16 -5
- package/dist/chunks/{env-66FPSJDV.js → env-B6GKA2J3.js} +2 -2
- package/dist/chunks/{factory-UH2TZBVA.js → factory-MFCKLUT6.js} +1 -1
- package/dist/chunks/{group-chat-CAKMMV7K.js → group-chat-YE7WIBFO.js} +3 -3
- package/dist/chunks/{im-NJB7ZYMH.js → im-3RCNL5GT.js} +107 -1
- package/dist/chunks/{invoice-OQP3TMKQ.js → invoice-FXWH5GPO.js} +209 -0
- package/dist/chunks/{lazy-dispatch-DD6ULZ3I.js → lazy-dispatch-XSAHDK6Z.js} +2 -2
- package/dist/chunks/{meeting-VTBFW4HI.js → meeting-RYZV2JTQ.js} +10 -10
- package/dist/chunks/{reception-5WITA44R.js → reception-VL6TKVAW.js} +480 -26
- package/dist/chunks/{recruit-stage-CAKZTUA7.js → recruit-stage-ERZD3ZNB.js} +52 -16
- package/dist/chunks/{registry-JVQBLFQ5.js → registry-22O6UG4I.js} +10 -10
- 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/{room-recommend-5U55FMXZ.js → room-recommend-IMZPJMYB.js} +4 -4
- package/dist/chunks/{schedule-IDETODCA.js → schedule-SPPAHER2.js} +4 -4
- package/dist/chunks/{workflow-BSYT5TGL.js → workflow-WVEFJ6KC.js} +2 -2
- package/dist/core/refs.js +19 -2
- package/dist/index.js +13 -13
- 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/my-borrow-contract.js +271 -0
- package/dist/shortcuts/archive-oa/operations/registry.js +5 -3
- 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/ehr/operations/recruit-write.js +22 -5
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +17 -8
- package/dist/shortcuts/ehr/recruit-stage/shared.js +33 -8
- package/dist/shortcuts/im/index.js +128 -0
- package/dist/shortcuts/im/operations/session.js +6 -0
- package/dist/shortcuts/invoice/manifest.js +60 -0
- package/dist/shortcuts/invoice/operations/registry.js +2 -0
- package/dist/shortcuts/invoice/operations/reim-subsidy.js +163 -0
- 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/reception/host.js +33 -1
- package/dist/shortcuts/reception/index.js +19 -0
- package/dist/shortcuts/reception/manifest.js +53 -1
- package/dist/shortcuts/reception/operations/ask.js +18 -0
- package/dist/shortcuts/reception/operations/compose.js +113 -3
- package/dist/shortcuts/reception/operations/leads.js +245 -0
- package/dist/shortcuts/reception/operations/markdown.js +22 -0
- package/dist/shortcuts/reception/operations/registry.js +2 -0
- package/dist/shortcuts/reception/operations/render.js +36 -3
- package/dist/shortcuts/reception/operations/restaurant-rooms.js +118 -0
- package/dist/shortcuts/reception/operations/restaurant.js +251 -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 +17 -8
- package/dist/shortcuts/recruit-stage/shared.js +42 -14
- package/docs/archive-oa.md +4 -2
- package/docs/invoice.md +1 -0
- package/package.json +1 -1
- package/skill-template/domains/archive-oa.md +2 -1
- 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 +33 -6
- package/skills/weaver-e10-archive-oa/references/borrow-car.md +32 -7
- package/skills/weaver-e10-archive-oa/references/contract-search.md +32 -0
- package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +1 -1
- 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 +22 -0
- 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-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 +94 -409
- 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 +62 -18
- 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/scripts/render.py +81 -2
- package/skills/weaver-e10-recruit-stage/SKILL.md +45 -12
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +58 -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 +127 -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 +14 -8
- package/skills/weaver-e10-yepiaotong/references/invoice-import.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +10 -3
- package/skills/weaver-e10-yepiaotong/references/invoice-upload-and-validate.md +2 -0
- package/skills/weaver-e10-yepiaotong/references/invoice-validation-preview.md +2 -0
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +69 -7
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +3 -3
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +9 -16
- package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +6 -5
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +206 -92
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +27 -21
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +35 -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-I5ZIX4WO.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
|
@@ -518,16 +518,37 @@ const ebConflictRoom = {
|
|
|
518
518
|
properties: {
|
|
519
519
|
beginDatetime: { ...SCHEMA_DATETIME_MINUTE, description: '开始时间(必填,yyyy-MM-dd HH:mm)' },
|
|
520
520
|
endDatetime: { ...SCHEMA_DATETIME_MINUTE, description: '结束时间(必填,yyyy-MM-dd HH:mm)' },
|
|
521
|
-
address: { ...SCHEMA_ID, description: '会议室 id
|
|
521
|
+
address: { ...SCHEMA_ID, description: '会议室 id;与 room_name 二选一(推荐直接传 room_name)' },
|
|
522
|
+
room_name: { type: 'string', description: '会议室名称(如「317」「317会议室」):内部解析成 id,省掉先查列表这一步' },
|
|
522
523
|
mtId: { ...SCHEMA_ID, description: '变更会议时排除自身' },
|
|
523
524
|
},
|
|
524
|
-
required: ['beginDatetime', 'endDatetime'
|
|
525
|
+
required: ['beginDatetime', 'endDatetime'],
|
|
525
526
|
},
|
|
526
527
|
handler: async (args, env) => {
|
|
528
|
+
// ⛔ 2026-11-09:以前只收 id,调用方要先拉全量清单找 id(155 间 × 多页,耗时上百秒)。
|
|
529
|
+
// 现在允许直接传 room_name,内部一次性解析,省掉“查清单 → 找 id → 再查冲突”的绕路。
|
|
530
|
+
let addressId = String(args.address ?? '').trim();
|
|
531
|
+
let resolvedRoom = null;
|
|
532
|
+
if (!addressId && String(args.room_name ?? '').trim()) {
|
|
533
|
+
const { resolveAddressRoom } = await import('./create-flow.js');
|
|
534
|
+
const resolved = await resolveAddressRoom(env, String(args.room_name));
|
|
535
|
+
if (!resolved?.id) {
|
|
536
|
+
throw meetingValidationError('room_not_found', `找不到名为「${String(args.room_name)}」的会议室,请用 meeting.eb.room.list 核对名称`);
|
|
537
|
+
}
|
|
538
|
+
addressId = String(resolved.id);
|
|
539
|
+
resolvedRoom = { id: String(resolved.id), name: String(resolved.name ?? ''), ...(resolved.status ? { status: String(resolved.status) } : {}) };
|
|
540
|
+
}
|
|
541
|
+
if (!addressId) {
|
|
542
|
+
// room_name 命中多间 / 找不到 → 明确报错,别拿一个假 id 去查出一片“空闲”
|
|
543
|
+
throw meetingValidationError('room_ambiguous', `「${String(args.room_name ?? '')}」匹配不到唯一会议室:请用 meeting.eb.room.list 查到准确名称/ID,或改用 address 传 id`);
|
|
544
|
+
}
|
|
545
|
+
if (!String(args.address ?? '').trim() && resolvedRoom?.status === 'unknown') {
|
|
546
|
+
throw meetingValidationError('room_unresolved', `「${String(args.room_name ?? '')}」在台账里找不到对应会议室(解析到 id=${addressId}),不能据此判断空闲`);
|
|
547
|
+
}
|
|
527
548
|
const outcome = await runEbConflictCheck({
|
|
528
549
|
beginDatetime: args.beginDatetime,
|
|
529
550
|
endDatetime: args.endDatetime,
|
|
530
|
-
address:
|
|
551
|
+
address: addressId,
|
|
531
552
|
...(args.mtId !== undefined ? { excludeMtId: String(args.mtId) } : {}),
|
|
532
553
|
}, env, 'meeting.eb.conflict.room', { throwOnReject: false });
|
|
533
554
|
const room = outcome.room ?? { skipped: true, hasConflict: false, conflicts: [], requests: 0 };
|
|
@@ -539,6 +560,8 @@ const ebConflictRoom = {
|
|
|
539
560
|
? 'rejected'
|
|
540
561
|
: 'warn';
|
|
541
562
|
return meetingSuccess('meeting.eb.conflict.room', {
|
|
563
|
+
// 透明化:告诉调用方 room_name 到底解析成了哪一间,避免「查了别间还以为查对了」
|
|
564
|
+
resolvedRoom,
|
|
542
565
|
verdict,
|
|
543
566
|
hasConflict: room.hasConflict,
|
|
544
567
|
skipped: room.skipped,
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* continuation 短句柄(2026-11-09)。
|
|
3
|
+
*
|
|
4
|
+
* 问题:`create.flow.prepare` 返回的 continuation 是一串很长的 base64,
|
|
5
|
+
* 模型在对话里转述/重打时会被截断("确认凭证已失效,我在传递时被截断了"),
|
|
6
|
+
* 于是又跑一次预检 —— 用户看到的就是"又预检了一遍"。
|
|
7
|
+
*
|
|
8
|
+
* 方案:签发时同时落一个 8 位短 id,apply 只要传 `continuationId` 就能取回原 token。
|
|
9
|
+
* 短 id 只是本地索引,token 本身仍然校验签名/租户/账号,安全性不变。
|
|
10
|
+
*/
|
|
11
|
+
import { randomBytes } from 'node:crypto';
|
|
12
|
+
import { mkdir, readFile, writeFile, readdir, stat, unlink } from 'node:fs/promises';
|
|
13
|
+
import { homedir } from 'node:os';
|
|
14
|
+
import { join } from 'node:path';
|
|
15
|
+
function storeDir() {
|
|
16
|
+
return join(homedir(), '.weaver-work-cli', 'meeting', 'state', 'continuations');
|
|
17
|
+
}
|
|
18
|
+
export async function saveContinuationAlias(token, ttlMs) {
|
|
19
|
+
const id = randomBytes(4).toString('hex');
|
|
20
|
+
const dir = storeDir();
|
|
21
|
+
await mkdir(dir, { recursive: true });
|
|
22
|
+
await writeFile(join(dir, `${id}.json`), JSON.stringify({ token, exp: Date.now() + ttlMs }), 'utf8');
|
|
23
|
+
// 顺手清理过期文件,避免无限增长
|
|
24
|
+
void pruneExpired(dir);
|
|
25
|
+
return id;
|
|
26
|
+
}
|
|
27
|
+
export async function resolveContinuationAlias(id) {
|
|
28
|
+
const text = String(id ?? '').trim();
|
|
29
|
+
if (!/^[0-9a-f]{8}$/u.test(text))
|
|
30
|
+
return null;
|
|
31
|
+
try {
|
|
32
|
+
const raw = await readFile(join(storeDir(), `${text}.json`), 'utf8');
|
|
33
|
+
const parsed = JSON.parse(raw);
|
|
34
|
+
if (!parsed.token || Number(parsed.exp ?? 0) <= Date.now())
|
|
35
|
+
return null;
|
|
36
|
+
return parsed.token;
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async function pruneExpired(dir) {
|
|
43
|
+
try {
|
|
44
|
+
const names = await readdir(dir);
|
|
45
|
+
const now = Date.now();
|
|
46
|
+
for (const name of names) {
|
|
47
|
+
if (!name.endsWith('.json'))
|
|
48
|
+
continue;
|
|
49
|
+
const full = join(dir, name);
|
|
50
|
+
try {
|
|
51
|
+
const info = await stat(full);
|
|
52
|
+
if (now - info.mtimeMs > 24 * 60 * 60 * 1000)
|
|
53
|
+
await unlink(full);
|
|
54
|
+
}
|
|
55
|
+
catch {
|
|
56
|
+
/* 清理失败忽略 */
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
/* 目录不存在等忽略 */
|
|
62
|
+
}
|
|
63
|
+
}
|
|
@@ -11,6 +11,7 @@ import { inferRoomFloor, loadRooms, recommendRooms } from './room-recommend.js';
|
|
|
11
11
|
import { dayOf, filterUsages, invalidateDayUsages, loadDayUsages } from './usage-cache.js';
|
|
12
12
|
import { pickRememberedFlow, readFlowPick, rememberFlowPick } from './flow-memory.js';
|
|
13
13
|
import { clearMeetingDraft, loadMeetingDraft, saveMeetingDraft } from './draft-memory.js';
|
|
14
|
+
import { resolveContinuationAlias, saveContinuationAlias } from './continuation-alias.js';
|
|
14
15
|
import { resolveNamesCached } from './person-cache.js';
|
|
15
16
|
/**
|
|
16
17
|
* 通过**流程**新建 EB 会议(`meeting.eb.meeting.create.flow`)。
|
|
@@ -227,7 +228,20 @@ export async function resolveAddressRoom(env, input) {
|
|
|
227
228
|
?? (ref.name ? rooms.find((room) => room.name === ref.name) : undefined);
|
|
228
229
|
if (hit)
|
|
229
230
|
return { id: hit.id, name: hit.name, status: hit.status, statusText: hit.statusText };
|
|
230
|
-
//
|
|
231
|
+
// ⛔ 2026-11-09:用户说「317」时,parseRoomRef 会当成 id=317(台账根本没有这个 id),
|
|
232
|
+
// 旧逻辑直接原样返回 {id:'317'},占用接口查不到任何记录 → 假「ok 没冲突」。
|
|
233
|
+
// 这里补一层「名称包含」匹配:唯一命中就用它;命中多间则返回 null 让调用方去问。
|
|
234
|
+
const keyword = (ref.name ?? text).trim();
|
|
235
|
+
if (keyword) {
|
|
236
|
+
const loose = rooms.filter((room) => room.name.includes(keyword));
|
|
237
|
+
if (loose.length === 1) {
|
|
238
|
+
const only = loose[0];
|
|
239
|
+
return { id: only.id, name: only.name, status: only.status, statusText: only.statusText };
|
|
240
|
+
}
|
|
241
|
+
if (loose.length > 1)
|
|
242
|
+
return null;
|
|
243
|
+
}
|
|
244
|
+
// 纯 id 且台账里没有(刚建/缓存旧)→ 保留 id 继续走,但标记 unknown 让调用方别当“已确认空闲”
|
|
231
245
|
if (ref.id)
|
|
232
246
|
return { id: ref.id, name: ref.name ?? '', status: 'unknown' };
|
|
233
247
|
return null;
|
|
@@ -1175,13 +1189,15 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1175
1189
|
description: '结束时间(yyyy-MM-dd HH:mm);不传则按 durationMinutes 从开始时间推算(默认 60 分钟)',
|
|
1176
1190
|
},
|
|
1177
1191
|
mt_desc: { type: 'string', description: '会议内容/说明' },
|
|
1192
|
+
equipments: { type: 'string', description: '设备要求关键词(投影/视频/白板等):参与会议室推荐筛选;用户没说就不传' },
|
|
1178
1193
|
agenda: { type: 'string', description: '邀请函议程(AI 按会议名称+内容分析后生成):每行「议程安排|议程内容|议程时间」,换行分隔;不传则用会议议题或模板示例行' },
|
|
1179
1194
|
address: { type: 'string', description: '会议室(名称或 id);也可直接写楼层("一楼/1F/3层"),CLI 会按楼层给候选' },
|
|
1180
1195
|
floor: { type: 'number', description: '楼层(1=一楼):和 address 二选一,按名称推断楼层过滤候选(120会议室=1楼、1007=10楼)' },
|
|
1181
1196
|
askRoom: { type: 'boolean', description: '默认 false:不指定地点时 CLI 直接按推荐算法定一间;传 true 才返回候选让用户挑' },
|
|
1182
1197
|
customize_address: { type: 'string', description: '自定义会议地点' },
|
|
1183
1198
|
hrm_members: { type: 'string', description: '参会人员(逗号分隔员工 id 或姓名,按流程表单要求)' },
|
|
1184
|
-
total_member: { type: 'number', description: '
|
|
1199
|
+
total_member: { type: 'number', description: '参会人数(用户直接说总数时才传)' },
|
|
1200
|
+
our_member_count: { type: 'number', description: '我方声明人数(用户说"我们也 3 个人"但没给姓名时传 3):CLI 会与 crm_member_count 相加作为参会人数' },
|
|
1185
1201
|
crm_members: {
|
|
1186
1202
|
oneOf: [{ type: 'string' }, { type: 'array', items: { oneOf: [{ type: 'string' }, { type: 'object' }] } }],
|
|
1187
1203
|
description: '参会客户:**必须带客户名称**,写法 `[{id,name}]` 或「客户名(客户id)」或逗号分隔的这两种。'
|
|
@@ -1544,8 +1560,22 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1544
1560
|
const declaredTotal = Number(args.total_member) > 0 ? Number(args.total_member) : null;
|
|
1545
1561
|
const callerToken = String(args.caller ?? '').trim();
|
|
1546
1562
|
const callerInMembers = callerToken !== '' && (rawMembers.includes(callerToken) || memberIds.includes(callerToken));
|
|
1547
|
-
|
|
1548
|
-
|
|
1563
|
+
// 我方人数(含召集人);客户人数取「应到客户数」(用户说"他们来 3 个人" → 传 crm_member_count:3)
|
|
1564
|
+
const declaredOurCount = Number(args.our_member_count) > 0
|
|
1565
|
+
? Number(args.our_member_count)
|
|
1566
|
+
: 0;
|
|
1567
|
+
const ourSideCount = declaredOurCount > 0
|
|
1568
|
+
? declaredOurCount
|
|
1569
|
+
: (memberIds.length > 0 ? memberIds.length + (callerInMembers ? 0 : 1) : 0);
|
|
1570
|
+
const clientSideCount = Number(args.crm_member_count) > 0 ? Number(args.crm_member_count) : 0;
|
|
1571
|
+
// ⛔ 2026-11-09 用户反馈:说了"他们 3 个、我们 3 个",表单「参会人数」却是空的。
|
|
1572
|
+
// 规则:没显式传 total_member 时 = 我方人数 + 客户人数,自动补进表单与容量判断。
|
|
1573
|
+
const autoTotalMember = declaredTotal
|
|
1574
|
+
?? (ourSideCount + clientSideCount > 0 ? ourSideCount + clientSideCount : null);
|
|
1575
|
+
if (autoTotalMember !== null && !(Number(args.total_member) > 0)) {
|
|
1576
|
+
args.total_member = autoTotalMember;
|
|
1577
|
+
}
|
|
1578
|
+
const roomMemberCount = autoTotalMember ?? undefined;
|
|
1549
1579
|
// 有没有客户:决定要不要优先推接待类会议室(crm_members 可能是数组、"id,id" 或名称)
|
|
1550
1580
|
// 2026-11-04 补:用户只在话里说了「接待某某客户」、没传 crm_members 时,也要识别出来 ——
|
|
1551
1581
|
// 否则"带客户优先接待类"这条规则永远不生效(用户实测推荐了 3 间普通会议室)。
|
|
@@ -1582,6 +1612,10 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1582
1612
|
...(hasCustomer ? { hasCustomer: true } : {}),
|
|
1583
1613
|
// 「一楼」这类楼层诉求:按楼层过滤候选(2026-11-06)
|
|
1584
1614
|
...(floorHint !== null ? { floor: Number(floorHint) } : {}),
|
|
1615
|
+
// ⛔ 设备诉求必须放在 requirement 里(顶层会被忽略,2026-11-09 踩到:传了投影仍推出没投影的房)
|
|
1616
|
+
...(String(args.equipments ?? '').trim()
|
|
1617
|
+
? { requirement: { equipmentsKeyword: String(args.equipments).trim() } }
|
|
1618
|
+
: {}),
|
|
1585
1619
|
// 2026-11-03 用户批准松绑:不再每次强制重拉台账(省 ~1s + 2 请求)。
|
|
1586
1620
|
// 兜底在 recommendRooms 内部:24h 缓存凑不出候选时自动强制重拉一次再算;
|
|
1587
1621
|
// 代价是刚导入的会议室在缓存期可能按名称查不到(按 id 指定不受影响)。
|
|
@@ -1759,8 +1793,14 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1759
1793
|
selectionType: 'room',
|
|
1760
1794
|
ui: { component: 'choice', multiple: false, recommendedKey: 'R1' },
|
|
1761
1795
|
message: floorHint !== null
|
|
1762
|
-
? `「${addressId}
|
|
1763
|
-
+ (roomOptions.length > 0
|
|
1796
|
+
? `「${addressId}」是楼层,不是房间名;`
|
|
1797
|
+
+ (roomOptions.length > 0
|
|
1798
|
+
? `下面是 ${floorHint} 楼在该时段空闲的会议室,请选一间`
|
|
1799
|
+
: `该楼层没有符合条件的会议室`
|
|
1800
|
+
+ (String(args.equipments ?? '').trim()
|
|
1801
|
+
? `(设备要求:${String(args.equipments)};该层台账未标注此设备)`
|
|
1802
|
+
: '')
|
|
1803
|
+
+ ',请改楼层 / 去掉设备要求 / 改时间')
|
|
1764
1804
|
: `没找到名为「${addressId}」的会议室(会议室台账里没有这个名字),本次**没有提交**。`
|
|
1765
1805
|
+ (roomOptions.length > 0
|
|
1766
1806
|
? `请从下面 ${roomOptions.length} 个在该时段空闲的会议室里选一间,或核对一下会议室名称`
|
|
@@ -2178,7 +2218,12 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
2178
2218
|
*/
|
|
2179
2219
|
let invitationDocInfo = null;
|
|
2180
2220
|
const inviteDocWarnings = [];
|
|
2181
|
-
|
|
2221
|
+
// ⛔ 2026-11-09 用户明确:**没有客户就不生成邀请函**(对话里不贴、文档也不建)。
|
|
2222
|
+
const hasLinkedCustomer = (Array.isArray(args.crm_members)
|
|
2223
|
+
? args.crm_members.length > 0
|
|
2224
|
+
: String(args.crm_members ?? '').trim() !== '')
|
|
2225
|
+
|| Number(args.crm_member_count) > 0;
|
|
2226
|
+
if (args.invitation_doc !== false && hasLinkedCustomer) {
|
|
2182
2227
|
const inviteField = form.fields.find((field) => String(field?.name ?? '') === '邀请函');
|
|
2183
2228
|
if (inviteField) {
|
|
2184
2229
|
const existing = main[String(inviteField.id)];
|
|
@@ -2474,6 +2519,8 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
2474
2519
|
})(),
|
|
2475
2520
|
} } : {}),
|
|
2476
2521
|
},
|
|
2522
|
+
// 没有客户时不生成邀请函(apply 里的两处生成点都看这个标记)
|
|
2523
|
+
hasCustomer: hasLinkedCustomer,
|
|
2477
2524
|
fingerprint: JSON.stringify({ workflowId, main, ...(detailPayload ? { details: detailPayload } : {}) }),
|
|
2478
2525
|
}, CONTINUATION_TTL_MS);
|
|
2479
2526
|
// 记住本轮已确认的要素(30 分钟内同一场会再调 prepare 时,缺字段就沿用,避免重复追问)
|
|
@@ -2527,6 +2574,7 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
2527
2574
|
...(Object.keys(decisions).length > 0 ? { decisions } : {}),
|
|
2528
2575
|
},
|
|
2529
2576
|
continuation,
|
|
2577
|
+
continuationId: await saveContinuationAlias(continuation, CONTINUATION_TTL_MS).catch(() => null),
|
|
2530
2578
|
expiresInSeconds: CONTINUATION_TTL_SECONDS,
|
|
2531
2579
|
}, warnings.length > 0 ? { warnings } : {});
|
|
2532
2580
|
},
|
|
@@ -2658,7 +2706,8 @@ const ebMeetingCreateFlowApply = {
|
|
|
2658
2706
|
risk: 'high-risk-write',
|
|
2659
2707
|
requiresConfirmation: true,
|
|
2660
2708
|
inputSchema: schemaOf({
|
|
2661
|
-
continuation: { type: 'string', description: 'prepare
|
|
2709
|
+
continuation: { type: 'string', description: 'prepare 返回的确认票据;太长时可用 continuationId 代替(二选一)' },
|
|
2710
|
+
continuationId: { type: 'string', description: 'prepare 返回的 8 位短句柄:不想复制长 token 时传这个' },
|
|
2662
2711
|
confirm: { type: 'boolean', description: '必须显式传 true' },
|
|
2663
2712
|
submit_mode: {
|
|
2664
2713
|
type: 'string',
|
|
@@ -2668,12 +2717,17 @@ const ebMeetingCreateFlowApply = {
|
|
|
2668
2717
|
+ '只有用户明确说"不用我确认,直接建"时才传 direct',
|
|
2669
2718
|
},
|
|
2670
2719
|
waitSeconds: { type: 'number', description: '提交后等待会议生成的最长秒数(默认 60,0 = 不等待)' },
|
|
2671
|
-
}, { required: ['
|
|
2720
|
+
}, { required: ['confirm'] }),
|
|
2672
2721
|
handler: async (args, env) => {
|
|
2673
2722
|
if (args.confirm !== true) {
|
|
2674
2723
|
throw meetingValidationError('confirmation_required', '流程建会属于高影响写操作,必须显式传 confirm=true');
|
|
2675
2724
|
}
|
|
2676
|
-
|
|
2725
|
+
// 模型常把长 token 截断 → 允许只传短句柄 continuationId
|
|
2726
|
+
let continuationToken = String(args.continuation ?? '').trim();
|
|
2727
|
+
if (!continuationToken && String(args.continuationId ?? '').trim()) {
|
|
2728
|
+
continuationToken = String(await resolveContinuationAlias(String(args.continuationId)) ?? '');
|
|
2729
|
+
}
|
|
2730
|
+
const lease = await env.continuation.verify(continuationToken, 'meeting.eb.meeting.create.flow.apply');
|
|
2677
2731
|
const session = await env.host.getSession();
|
|
2678
2732
|
if (lease.baseUrl !== session.baseUrl || lease.userId !== session.userId) {
|
|
2679
2733
|
throw meetingValidationError('context_mismatch', '确认上下文已变化(租户或登录账号不同),请重新执行 prepare');
|
|
@@ -2729,7 +2783,9 @@ const ebMeetingCreateFlowApply = {
|
|
|
2729
2783
|
// 所以这里永远拿不到 requestId / 会议 id —— 这不是失败,但也**不是"流程已提交"**,
|
|
2730
2784
|
// 不能报错把整轮卡死(用户要的表单就在 finalMarkdown 里)。
|
|
2731
2785
|
// ⛔ 邀请函必须照给:它是预置函,按申请单已知信息生成,不依赖会议是否已生成。
|
|
2732
|
-
const pre =
|
|
2786
|
+
const pre = payload?.hasCustomer === true
|
|
2787
|
+
? await renderPreInvitation(payload, env)
|
|
2788
|
+
: { invitation: { skipped: true, reason: 'no_customer' }, ms: 0 };
|
|
2733
2789
|
// 建群:这一档服务端没有单据、也没有会议 id,只能先把群建出来(回写等会议生成后再补)。
|
|
2734
2790
|
// 用户口径是「发起流程时就同步建群」,表单都递到手上了,群该先建好。
|
|
2735
2791
|
let groupChat;
|
|
@@ -2959,7 +3015,9 @@ const ebMeetingCreateFlowApply = {
|
|
|
2959
3015
|
// ⛔ 不等于"没有邀请函"。邀请函本质是**预置函**(项目人员下载后自己改、自己发,
|
|
2960
3016
|
// 2026-10-30 用户明确要求),所以会议还在审批、尚未生成时,也要用申请单已知信息
|
|
2961
3017
|
// 先出一份,取不到的字段渲染成【待补充】。这样调用方/用户提交完立刻就能拿到文件。
|
|
2962
|
-
const pre =
|
|
3018
|
+
const pre = payload?.hasCustomer === true
|
|
3019
|
+
? await renderPreInvitation(payload, env)
|
|
3020
|
+
: { invitation: { skipped: true, reason: 'no_customer' }, ms: 0 };
|
|
2963
3021
|
invitation = pre.invitation;
|
|
2964
3022
|
timings.invitationMs = pre.ms;
|
|
2965
3023
|
warnings.push(`流程已提交(requestId=${requestId || '未返回'}),但 ${waitSeconds}s 内没在会议表里查到「${payload.mtName}」——`
|
|
@@ -3033,6 +3091,7 @@ const ebMeetingCreateFlowQuick = {
|
|
|
3033
3091
|
description: '结束时间(yyyy-MM-dd HH:mm);不传则按 durationMinutes 从开始时间推算(默认 60 分钟)',
|
|
3034
3092
|
},
|
|
3035
3093
|
mt_desc: { type: 'string', description: '会议内容/说明' },
|
|
3094
|
+
equipments: { type: 'string', description: '设备要求关键词(投影/视频/白板等):参与会议室推荐筛选;用户没说就不传' },
|
|
3036
3095
|
address: { type: 'string', description: '会议室(id 或名称;不传则返回候选让用户选,不会自动决定)' },
|
|
3037
3096
|
customize_address: { type: 'string', description: '自定义会议地点' },
|
|
3038
3097
|
hrm_members: { type: 'string', description: '参会人员 id,逗号分隔' },
|
|
@@ -512,9 +512,11 @@ function buildReadOperation(endpoint) {
|
|
|
512
512
|
+ `需要全量请翻页(pageNo=${pageNo + 1} 起)或加大 pageSize,或收窄筛选条件`);
|
|
513
513
|
}
|
|
514
514
|
if (fallback) {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
515
|
+
// ⛔ 2026-11-09:旧文案以「0 条」开头,模型扫一眼就判“没查到”(实际命中了)。
|
|
516
|
+
// 现在结果先行,把命中数放最前面。
|
|
517
|
+
pageWarnings.push(rows.length > 0
|
|
518
|
+
? `已命中 ${rows.length} 条(服务端精确匹配 0 条,CLI 自动翻页扫描 ${fallback.scanned} 条 / ${fallback.pages} 页后按「包含」筛出)`
|
|
519
|
+
: `未命中:服务端精确匹配 0 条,且翻页扫描 ${fallback.scanned} 条(${fallback.pages} 页)后按「包含」也没找到 —— 这个名称可能确实不存在`);
|
|
518
520
|
}
|
|
519
521
|
return meetingSuccess(endpoint.operation, {
|
|
520
522
|
total: effectiveTotal,
|
|
@@ -2,6 +2,7 @@ import { getE10Session } from '../../internal/e10/context.js';
|
|
|
2
2
|
import { E10ApiError, createE10RequestRuntime, } from '../../internal/e10/request-runtime.js';
|
|
3
3
|
import { receptionBusinessError, receptionEnvironmentError } from './errors.js';
|
|
4
4
|
import { UploadProtocolError, uploadToFileService } from './upload.js';
|
|
5
|
+
import { fetchRestaurantRooms as fetchRooms } from './operations/restaurant-rooms.js';
|
|
5
6
|
/** 单次上传的总时限。分片上传是多轮请求,留足 3 分钟。 */
|
|
6
7
|
const UPLOAD_TIMEOUT_MS = 180_000;
|
|
7
8
|
export function createReceptionHost(ctx) {
|
|
@@ -100,6 +101,18 @@ export function createReceptionHost(ctx) {
|
|
|
100
101
|
contentType: error.contentType,
|
|
101
102
|
detail: error.detail,
|
|
102
103
|
hint: `链路 teamsCheck → preUploadCheck → module/upload,module=${module}`,
|
|
104
|
+
failedAt: error.failedAt,
|
|
105
|
+
// 请求侧只暴露「带了哪些头、凭据在不在」,值一律不打印
|
|
106
|
+
request: {
|
|
107
|
+
method: error.request?.method || 'POST',
|
|
108
|
+
path: error.request?.path || '',
|
|
109
|
+
headers: ['eteamsid', 'cookie', 'langtype', 'referer'],
|
|
110
|
+
auth: {
|
|
111
|
+
eteamsid: info.userId ? 'sent' : 'missing',
|
|
112
|
+
cookie: info.userId ? 'sent' : 'missing',
|
|
113
|
+
userid: info.userId ? String(info.userId) : 'missing',
|
|
114
|
+
},
|
|
115
|
+
},
|
|
103
116
|
};
|
|
104
117
|
}
|
|
105
118
|
if (error instanceof E10ApiError) {
|
|
@@ -113,7 +126,26 @@ export function createReceptionHost(ctx) {
|
|
|
113
126
|
};
|
|
114
127
|
}
|
|
115
128
|
}
|
|
116
|
-
|
|
129
|
+
/**
|
|
130
|
+
* 查「小食堂包厢」。
|
|
131
|
+
* eteamsId / tenantKey 只在这里取用并塞进请求体,不返回给调用方。
|
|
132
|
+
*/
|
|
133
|
+
async function fetchRestaurantRooms(options = {}) {
|
|
134
|
+
const { e10 } = await resolve();
|
|
135
|
+
if (!e10) {
|
|
136
|
+
throw receptionEnvironmentError('NO_SESSION', '未取得 E10 会话,无法查询小食堂包厢');
|
|
137
|
+
}
|
|
138
|
+
const runtime = createE10RequestRuntime(ctx, e10);
|
|
139
|
+
return fetchRooms(runtime, {
|
|
140
|
+
...options,
|
|
141
|
+
context: {
|
|
142
|
+
eteamsId: e10.eteamsId,
|
|
143
|
+
userId: e10.userId,
|
|
144
|
+
tenantKey: e10.tenantKey,
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
return { getSession, requireRuntime, uploadFile, fetchRestaurantRooms };
|
|
117
149
|
}
|
|
118
150
|
/** 未登录时不该静默继续的场景,统一用它取 baseUrl 并给出可读错误。 */
|
|
119
151
|
export async function requireBaseUrl(host) {
|
|
@@ -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,6 +190,7 @@ 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)')
|
|
@@ -186,6 +204,7 @@ export const receptionShortcut = {
|
|
|
186
204
|
known: jsonArg(opts, 'known', { code: 'KNOWN' }) || undefined,
|
|
187
205
|
answers: parseAnswers(opts) || undefined,
|
|
188
206
|
casesFile: textOf(opts, 'casesFile') || undefined,
|
|
207
|
+
restaurantRoomsFile: textOf(opts, 'restaurantRoomsFile') || undefined,
|
|
189
208
|
workflow: textOf(opts, 'workflow') || undefined,
|
|
190
209
|
outDir: textOf(opts, 'outDir') || undefined,
|
|
191
210
|
snapshot: textOf(opts, 'snapshot') || undefined,
|
|
@@ -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: '会议表态是否来自原话明确表述;false/缺省视为未表态,第三屏照问' },
|
|
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,6 +140,7 @@ 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: '跳过附件上传,只出本地文件' },
|
|
@@ -140,6 +166,7 @@ export const receptionOperations = [
|
|
|
140
166
|
attachments: { type: 'array', items: { type: 'object' } },
|
|
141
167
|
attachmentPending: { type: 'boolean' },
|
|
142
168
|
uploadDiagnostics: { type: 'array', items: { type: 'object' } },
|
|
169
|
+
restaurant: { type: ['object', 'null'], description: '小餐厅预定明细(含 roomState / 候选);null 表示没提这件事' },
|
|
143
170
|
customParams: { type: 'object' },
|
|
144
171
|
fieldAssignKeys: { type: 'string' },
|
|
145
172
|
detailRowCount: { type: 'integer' },
|
|
@@ -152,6 +179,31 @@ export const receptionOperations = [
|
|
|
152
179
|
},
|
|
153
180
|
},
|
|
154
181
|
},
|
|
182
|
+
{
|
|
183
|
+
name: 'reception.restaurantRooms',
|
|
184
|
+
risk: 'read',
|
|
185
|
+
summary: '只读查询「小食堂包厢」(建模表单实查,仅上海),产出可直接传给 doc-render 的 --restaurant-rooms-file 候选清单。包厢是业务数据,文档检索搜不到。',
|
|
186
|
+
inputSchema: {
|
|
187
|
+
type: 'object',
|
|
188
|
+
additionalProperties: false,
|
|
189
|
+
properties: {
|
|
190
|
+
pageSize: { type: 'integer', description: '单页条数,默认 200(后端 name 过滤当前无效,靠多抓本地筛)' },
|
|
191
|
+
out: { type: 'string', description: '把候选清单写到该路径的 JSON 文件,便于直接传给 --restaurant-rooms-file' },
|
|
192
|
+
timeoutMs: { type: 'integer', description: '超时毫秒,默认 30000' },
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
outputSchema: {
|
|
196
|
+
type: 'object',
|
|
197
|
+
properties: {
|
|
198
|
+
rooms: { type: 'array', items: { type: 'object' } },
|
|
199
|
+
total: { type: 'integer' },
|
|
200
|
+
rawCount: { type: 'integer' },
|
|
201
|
+
file: { type: 'string' },
|
|
202
|
+
maxCapacity: { type: 'integer' },
|
|
203
|
+
timings: { type: 'object' },
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
},
|
|
155
207
|
];
|
|
156
208
|
export const receptionManifest = {
|
|
157
209
|
schemaVersion: 1,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DEFAULT_WORKFLOW } from '../constants.js';
|
|
2
2
|
import { buildPanels } 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,23 @@ 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
|
+
delete data.logistics;
|
|
21
|
+
delete data.customer_need;
|
|
22
|
+
// 会议表态必须带 meetingExplicit,否则视为「没说过」:清掉推断值,让第三屏问出来。
|
|
23
|
+
// 值本身也要归一(需要/要/安排 → 是),否则 compose 里的 `=== '是'` 会静默漏填。
|
|
24
|
+
if (data.meetingExplicit === true) {
|
|
25
|
+
const meeting = normalizeMeeting(data.meeting);
|
|
26
|
+
if (meeting)
|
|
27
|
+
data.meeting = meeting;
|
|
28
|
+
else
|
|
29
|
+
delete data.meeting;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
delete data.meeting;
|
|
33
|
+
}
|
|
16
34
|
if (customerKeyword)
|
|
17
35
|
data.customer = customerKeyword;
|
|
18
36
|
// 主联络人优先级:`known.escorts`(明确指定的对接人)> `--user`(陪同)> `known.companions` > 登录人兜底。
|