weaver-work-cli 0.1.59 → 0.1.61
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-4SQAVTIB.js → archive-S2VKZWQ3.js} +2 -2
- package/dist/chunks/{archive-oa-W2UEJ67L.js → archive-oa-HEDSIUUY.js} +2 -2
- package/dist/chunks/{asset-EGZEABBI.js → asset-HYH4W357.js} +2 -2
- package/dist/chunks/{asset-idle-EBUZBB6M.js → asset-idle-N7REBNGL.js} +2 -2
- package/dist/chunks/{attachment-content-TP6WDNC6.js → attachment-content-VYYA75FR.js} +3 -3
- package/dist/chunks/{blog-2YKMWOWI.js → blog-SLMZZICV.js} +2 -2
- package/dist/chunks/{caizhilian-5NM4X5HG.js → caizhilian-RV43KKBT.js} +4 -4
- package/dist/chunks/{calendar-H4QTJCUY.js → calendar-DMVZ4OLY.js} +2 -2
- package/dist/chunks/{chunk-QNPIY5R6.js → chunk-6XSSAUNW.js} +4 -4
- package/dist/chunks/{chunk-AQOPPNTR.js → chunk-BIA2NKUG.js} +4 -4
- package/dist/chunks/{chunk-VMCCRWFO.js → chunk-BQYX2UX5.js} +2 -2
- package/dist/chunks/{chunk-CI2RF3AJ.js → chunk-DTCQFTHW.js} +1 -1
- package/dist/chunks/{chunk-I3BFBBP2.js → chunk-E5YD5JWR.js} +1 -1
- package/dist/chunks/{chunk-PH7N4UFT.js → chunk-EGANE35F.js} +1 -1
- package/dist/chunks/{chunk-Z4IPY5GV.js → chunk-H6YOMI3U.js} +2 -2
- package/dist/chunks/{chunk-U2DWV6JC.js → chunk-ILALC2N6.js} +1 -1
- package/dist/chunks/{chunk-WINR2Q6K.js → chunk-KXJA42EA.js} +86 -19
- package/dist/chunks/{chunk-CQ4OVCKG.js → chunk-KY3R42RS.js} +2 -2
- package/dist/chunks/{chunk-WVH5ESDA.js → chunk-NRYDJN4J.js} +1 -1
- package/dist/chunks/{chunk-TGM7BWEH.js → chunk-P6TXQK75.js} +2 -2
- package/dist/chunks/{chunk-6YWHRXEQ.js → chunk-QBDXJS2W.js} +119 -9
- package/dist/chunks/{chunk-2IGZUMNG.js → chunk-SHX7XBYR.js} +180 -18
- package/dist/chunks/{chunk-XR5BGFNT.js → chunk-T2KVJFWJ.js} +10 -4
- package/dist/chunks/{chunk-FMNCSYIG.js → chunk-TEZHIB6T.js} +2 -2
- package/dist/chunks/{chunk-2FHP4PYS.js → chunk-UBGWIXU3.js} +116 -40
- package/dist/chunks/{chunk-5N222HK6.js → chunk-UBRWONP4.js} +2 -2
- package/dist/chunks/{chunk-MQBMMJUV.js → chunk-UQFPF4EX.js} +2 -2
- package/dist/chunks/{chunk-4GG72JAT.js → chunk-V2LASYKO.js} +2 -2
- package/dist/chunks/{chunk-FM7B5BIR.js → chunk-VBFBMM7G.js} +61 -53
- package/dist/chunks/{chunk-ZHPCNM2S.js → chunk-VNYOUAWV.js} +11 -11
- package/dist/chunks/{chunk-SFM3M2L3.js → chunk-WIWDVETN.js} +19 -3
- package/dist/chunks/{chunk-44KJ7WFA.js → chunk-XT77MP54.js} +2 -2
- package/dist/chunks/chunk-YI2YMW5N.js +111 -0
- package/dist/chunks/{conflict-Y3ESXYIA.js → conflict-GFJRS6I7.js} +2 -2
- package/dist/chunks/{contract-LLRKMLQQ.js → contract-U3ZGNRWB.js} +2 -2
- package/dist/chunks/{cowork-2RDFBZWB.js → cowork-EX7PKIDK.js} +2 -2
- package/dist/chunks/{create-flow-JHQSA6JF.js → create-flow-EJZD434E.js} +6 -6
- package/dist/chunks/{data-ZVS3BWPT.js → data-FOODGAMF.js} +278 -123
- package/dist/chunks/{ebuilder-form-TWSXS5NA.js → ebuilder-form-I2EOKODG.js} +5 -5
- package/dist/chunks/{ehr-52GBKNJR.js → ehr-TE4RFNID.js} +2 -2
- package/dist/chunks/entry-mode-ZOLSXEGX.js +19 -0
- package/dist/chunks/{env-LQBLL3MZ.js → env-TID5NFR6.js} +2 -2
- package/dist/chunks/{esb-HJSXCEOM.js → esb-7L6MHYLB.js} +4 -4
- package/dist/chunks/{factory-X7PN6B3B.js → factory-OG7BPMH5.js} +1 -1
- package/dist/chunks/{fna-OBACRT3J.js → fna-6V2ENR3Y.js} +2 -2
- package/dist/chunks/{group-chat-PPFY7SPV.js → group-chat-5DKPWIHL.js} +3 -3
- package/dist/chunks/{host-TTSGY5NZ.js → host-3DLYA54R.js} +3 -3
- package/dist/chunks/{host-KJT3G5D2.js → host-GOJHHTPY.js} +3 -3
- package/dist/chunks/{host-KOWUMNAY.js → host-OGBHL75G.js} +3 -3
- package/dist/chunks/{host-MFXRA2MY.js → host-ONZC6AE7.js} +3 -3
- package/dist/chunks/{host-W4JCNRFS.js → host-TJ5VVHM7.js} +3 -3
- package/dist/chunks/{host-2BKMPWDH.js → host-VTPAWDZV.js} +3 -3
- package/dist/chunks/{hrm-AK3WGBMN.js → hrm-2N7NFQDZ.js} +3 -3
- package/dist/chunks/{im-JZSBPO4Z.js → im-XCH47ZBN.js} +3 -3
- package/dist/chunks/{invoice-6XDMPCWB.js → invoice-XQRKMGNY.js} +3 -3
- package/dist/chunks/{jiuchuanhui-K4EQU6GK.js → jiuchuanhui-PL6DRPBM.js} +2 -2
- package/dist/chunks/{lazy-dispatch-GCA6HDOB.js → lazy-dispatch-UATEN7H7.js} +5 -5
- package/dist/chunks/{mail-IKVCQCVZ.js → mail-Q7Z4CQ4D.js} +2 -2
- package/dist/chunks/{meeting-GMRQZFJP.js → meeting-5E3BNARL.js} +13 -12
- package/dist/chunks/{minute-doc-JXH3MNC7.js → minute-doc-NXRE5C77.js} +4 -4
- package/dist/chunks/{okr-KV43FPPX.js → okr-3O3XNYOK.js} +2 -2
- package/dist/chunks/{operations-6NXJ7RTE.js → operations-EZWG72FH.js} +4 -4
- package/dist/chunks/performance-Y7CPNSOR.js +1295 -0
- package/dist/chunks/{plan-WOYR4WEG.js → plan-BLGPZF5M.js} +2 -2
- package/dist/chunks/{project-CQJKBUIL.js → project-6MZMLJMP.js} +2 -2
- package/dist/chunks/{reception-MPBU3JXC.js → reception-F2VT2X52.js} +2 -2
- package/dist/chunks/{recruit-stage-USTTRHOX.js → recruit-stage-4ETIBMIW.js} +2 -2
- package/dist/chunks/{registry-GURQG4ZV.js → registry-3FYSWV3U.js} +3 -3
- package/dist/chunks/{registry-SS5J2FZQ.js → registry-7RS74TCK.js} +4 -4
- package/dist/chunks/{registry-WZCCBI5L.js → registry-I4DVPDMU.js} +11 -10
- package/dist/chunks/{room-recommend-CKU5NF2E.js → room-recommend-GWCVKCXW.js} +4 -4
- package/dist/chunks/{schedule-DEFAO2RY.js → schedule-6AN63MJQ.js} +4 -4
- package/dist/chunks/{smart-extract-APX2PNIN.js → smart-extract-SR4SJJKN.js} +3 -3
- package/dist/chunks/{workflow-WMPW3WSB.js → workflow-KF7FA2UQ.js} +7 -7
- package/dist/cmd/refs/index.js +124 -4
- package/dist/core/output.js +199 -26
- package/dist/core/refs.js +36 -0
- package/dist/index.js +38 -33
- package/dist/internal/e10/auth/xiaoe.js +25 -3
- package/dist/shortcuts/caizhilian/operations/files.js +86 -15
- package/dist/shortcuts/data/index.js +12 -2
- package/dist/shortcuts/data/manifest.js +4 -2
- package/dist/shortcuts/data/operations/attribution.js +229 -0
- package/dist/shortcuts/data/operations/ds.js +87 -92
- package/dist/shortcuts/data/operations/index.js +3 -1
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +111 -12
- package/dist/shortcuts/meeting/operations/eb/entry-mode.js +116 -0
- package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
- package/dist/shortcuts/meeting/operations/eb/room-recommend.js +11 -0
- package/dist/shortcuts/meeting/operations/registry.js +4 -0
- package/dist/shortcuts/performance/continuation.js +74 -0
- package/dist/shortcuts/performance/errors.js +65 -0
- package/dist/shortcuts/performance/host.js +105 -0
- package/dist/shortcuts/performance/index.js +109 -0
- package/dist/shortcuts/performance/manifest.js +30 -0
- package/dist/shortcuts/performance/operations/hrm-resolve.js +114 -0
- package/dist/shortcuts/performance/operations/registry.js +44 -0
- package/dist/shortcuts/performance/operations/scheme-detail.js +70 -0
- package/dist/shortcuts/performance/operations/scheme-draft.js +116 -0
- package/dist/shortcuts/performance/operations/scheme-publish.js +158 -0
- package/dist/shortcuts/performance/operations/types.js +32 -0
- package/dist/shortcuts/performance/scheme-validate.js +307 -0
- package/dist/shortcuts/performance/shared.js +158 -0
- package/docs/agent-io-channel-design.md +67 -3
- package/docs/data.md +2 -1
- package/package.json +1 -1
- package/scripts/xiaoe_env.py +6 -1
- package/skill-template/business-info.json +19 -0
- package/skill-template/domains/performance.md +18 -0
- package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
- package/skills/weaver-e10-data/references/datasource.md +2 -1
- package/skills/weaver-e10-meeting/SKILL.md +16 -3
- package/skills/weaver-e10-performance/SKILL.md +202 -0
- package/skills/weaver-e10-performance/agents/openai.yaml +74 -0
- package/skills/weaver-e10-performance/references/default-assembly.md +108 -0
- package/skills/weaver-e10-performance/references/entity-resolution.md +69 -0
- package/skills/weaver-e10-performance/references/enums-and-normalization.md +80 -0
- package/skills/weaver-e10-performance/references/examples.md +146 -0
- package/skills/weaver-e10-performance/references/extraction-guide.md +144 -0
- package/skills/weaver-e10-performance/references/scheme-edit-req-fields.md +185 -0
- package/skills/weaver-e10-performance/references/scheme-setting-page.md +62 -0
- package/skills/weaver-e10-performance/scripts/parse_appraisal_doc.py +483 -0
- package/skills/weaver-e10-shared/references/json-output-contract.md +5 -0
|
@@ -1,70 +1,48 @@
|
|
|
1
1
|
import { needArg } from '../host.js';
|
|
2
|
-
import { dataValidationError } from '../errors.js';
|
|
2
|
+
import { dataApiError, dataValidationError } from '../errors.js';
|
|
3
3
|
import { applyAppId, baseDto, parseOrder, parseStat, parseWhereArg, readListArg, renderTable, scanTips, tipsLines, } from './shared.js';
|
|
4
4
|
// ---------------------------------------------------------------- 分组清单
|
|
5
5
|
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
[38, '邮件', 'weaver-mail-base-service', 'email'],
|
|
47
|
-
[39, '薪酬', 'weaver-hrm-salary', 'hrmsalary'],
|
|
48
|
-
[40, '系统安全', 'weaver-security-framework-service', 'security'],
|
|
49
|
-
[41, '公文交换中心', 'weaver-odocexchange-service', 'odocexchange'],
|
|
50
|
-
[42, '招聘管理', 'weaver-recruit-service', 'recruit'],
|
|
51
|
-
[43, '微搜', 'weaver-esearch-search-service', null],
|
|
52
|
-
[44, '统一审批中心', 'weaver-intunifytodo-server-config-service', 'intunifytodos'],
|
|
53
|
-
[45, '公共数据源', 'weaver-component-web-service', 'common'],
|
|
54
|
-
[46, '数据分析', 'weaver-analyze-service', 'analyze'],
|
|
55
|
-
[47, '财务模块', 'weaver-fna-expense-servicefexs', 'fna'],
|
|
56
|
-
[48, 'ESB连接器', 'weaver-esb-setting-serviceesbConnect', 'esb'],
|
|
57
|
-
[49, 'AI连接器', 'weaver-ai-application-service', 'ai'],
|
|
58
|
-
[50, '外部流程', 'weaver-workflow-core-serviceworkflowCoreOuterwf', 'workflow'],
|
|
59
|
-
[51, '绩效考核', 'weaver-wr-performance-eb-service', 'ebuilder'],
|
|
60
|
-
[52, '问题定位平台', 'weaver-tissot-service', 'tissot'],
|
|
61
|
-
[53, '工作流基础效率', 'weaver-workflow-report-serviceworkflowEffReport', 'workflow'],
|
|
62
|
-
[54, '工作流操作者效率', 'weaver-workflow-report-serviceworkflowEffOperateReport', 'workflow'],
|
|
63
|
-
[55, '工作流节点效率', 'weaver-workflow-report-serviceworkflowEffNodeReport', 'workflow'],
|
|
64
|
-
[56, '规则引擎', 'weaver-logicflow-service', 'logicflow'],
|
|
65
|
-
[57, '工作流表单', 'weaver-workflow-report-serviceworkflowFormReport', 'workflow'],
|
|
66
|
-
[58, '统一认证中心', 'weaver-intunifyauth-server-base-service', null],
|
|
67
|
-
];
|
|
6
|
+
// 分组一律以 `/api/dw/ds/group` 的实时返回为准(sourceType 固定 LOGIC),
|
|
7
|
+
// 本文件不再内置任何分组常量:接口返回什么就是什么,随环境增减。
|
|
8
|
+
// `DS_CORE_GROUPS` / `DS_FIND_SEMANTIC_RULES` 只是「扫描优先级偏好」,
|
|
9
|
+
// 使用前必须与实时分组取交集,不得据此扩大扫描范围。
|
|
10
|
+
const DS_GROUPS_PATH = '/api/dw/ds/group';
|
|
11
|
+
/** 后端大小写敏感(传 `logic` ⇒ code=400),且不接受空串(⇒ code=500)。 */
|
|
12
|
+
const DS_GROUPS_SOURCE_TYPE = 'LOGIC';
|
|
13
|
+
/** 接口的 serviceMark 可能是 `""` 或直接缺字段 ⇒ 统一归一为 null。 */
|
|
14
|
+
function normalizeServiceMark(raw) {
|
|
15
|
+
return typeof raw === 'string' && raw.trim() !== '' ? raw : null;
|
|
16
|
+
}
|
|
17
|
+
function groupIndex(groups) {
|
|
18
|
+
return new Map(groups.map((group) => [group.groupId, group]));
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* 实时分组清单。单次命令内只取一次、由调用方把结果下传;不做模块级缓存
|
|
22
|
+
* (分组随环境变动,宁可贵一次也不留陈旧数据)。
|
|
23
|
+
*/
|
|
24
|
+
async function fetchGroups(host) {
|
|
25
|
+
const response = await host.request({
|
|
26
|
+
method: 'GET',
|
|
27
|
+
path: DS_GROUPS_PATH,
|
|
28
|
+
query: { sourceType: DS_GROUPS_SOURCE_TYPE },
|
|
29
|
+
operation: 'ds.groups',
|
|
30
|
+
});
|
|
31
|
+
const rows = response?.data;
|
|
32
|
+
if (response?.code !== undefined && response.code !== 200) {
|
|
33
|
+
throw dataApiError('groups_failed', `分组清单接口返回失败:${response?.msg || `code=${response.code}`}`, { code: response.code, details: { sourceType: DS_GROUPS_SOURCE_TYPE } });
|
|
34
|
+
}
|
|
35
|
+
if (!Array.isArray(rows)) {
|
|
36
|
+
throw dataApiError('groups_failed', `分组清单接口异常:${response?.msg || '未返回 data 数组'}`, { code: response?.code, details: { sourceType: DS_GROUPS_SOURCE_TYPE } });
|
|
37
|
+
}
|
|
38
|
+
return rows
|
|
39
|
+
.filter((row) => row && typeof row.id === 'string' && row.id !== '')
|
|
40
|
+
.map((row) => ({
|
|
41
|
+
groupId: row.id,
|
|
42
|
+
label: String(row.name ?? ''),
|
|
43
|
+
serviceMark: normalizeServiceMark(row.serviceMark),
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
68
46
|
const DS_CORE_GROUPS = [
|
|
69
47
|
'weaver-formreport-service',
|
|
70
48
|
'weaver-ebuilder-form-service',
|
|
@@ -76,7 +54,6 @@ const DS_FIND_SEMANTIC_RULES = [
|
|
|
76
54
|
{ tag: '日报/周报', re: /日报|周报|月报|年报|工作总结/, groups: ['weaver-blog-service', 'weaver-wr-plan-service'] },
|
|
77
55
|
{ tag: '文档/附件', re: /文档|附件|文件夹|共享|资料/, groups: ['weaver-doc-servicedocument', 'weaver-doc-service', 'weaver-file-service'] },
|
|
78
56
|
{ tag: '项目/任务', re: /项目|任务|工时|里程碑|延期|验收/, groups: ['weaver-project-service', 'weaver-project-servicetask'] },
|
|
79
|
-
{ tag: '客户/商机', re: /客户|商机|线索|联系人|公海|销售|CRM|营销/i, groups: ['weaver-crm-service', 'weaver-crm-market-service'] },
|
|
80
57
|
{ tag: '会议/日程', re: /会议|日程|日历|预约|会议室|预定/, groups: ['weaver-meeting-service', 'weaver-calendar-service'] },
|
|
81
58
|
{ tag: '人事/招聘', re: /招聘|入职|离职|offer|人才|员工|人员|通讯录|调岗|组织/i, groups: ['weaver-recruit-service', 'weaver-hr-service', 'weaver-hrm-service'] },
|
|
82
59
|
{ tag: '薪酬/绩效', re: /薪酬|薪资|工资|社保|公积金|绩效|考核|KPI|OKR/i, groups: ['weaver-hrm-salary', 'weaver-wr-performance-service', 'weaver-wr-goal-service'] },
|
|
@@ -84,13 +61,11 @@ const DS_FIND_SEMANTIC_RULES = [
|
|
|
84
61
|
{ tag: '邮件/公文', re: /邮件|收件箱|公文|发文|档案|借阅/, groups: ['weaver-mail-base-service', 'weaver-odoc-service'] },
|
|
85
62
|
{ tag: '资产/日志', re: /资产|台账|日志|动作流|自动化/, groups: ['weaver-elog-service', 'weaver-esb-setting-serviceesbCustom'] },
|
|
86
63
|
];
|
|
87
|
-
function groupLabel(groupId) {
|
|
88
|
-
|
|
89
|
-
return hit ? hit[1] : null;
|
|
64
|
+
function groupLabel(index, groupId) {
|
|
65
|
+
return index?.get(groupId)?.label ?? null;
|
|
90
66
|
}
|
|
91
|
-
function groupMark(groupId) {
|
|
92
|
-
|
|
93
|
-
return hit ? hit[3] : null;
|
|
67
|
+
function groupMark(index, groupId) {
|
|
68
|
+
return index?.get(groupId)?.serviceMark ?? null;
|
|
94
69
|
}
|
|
95
70
|
function explicitAppId(input) {
|
|
96
71
|
const appId = input.app_id;
|
|
@@ -136,19 +111,28 @@ function renderFields(response) {
|
|
|
136
111
|
return lines.length ? lines.join('\n') : '(空:未返回字段)';
|
|
137
112
|
}
|
|
138
113
|
// ---------------------------------------------------------------- 命令
|
|
139
|
-
export async function dsGroups(input) {
|
|
114
|
+
export async function dsGroups(input, host) {
|
|
140
115
|
const pattern = input.pattern ? String(input.pattern) : null;
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
.
|
|
116
|
+
const live = await fetchGroups(host);
|
|
117
|
+
const groups = live.filter((item) => !pattern
|
|
118
|
+
|| item.groupId.includes(pattern)
|
|
119
|
+
|| item.label.includes(pattern));
|
|
120
|
+
const liveIds = new Set(live.map((item) => item.groupId));
|
|
144
121
|
const data = {
|
|
145
122
|
count: groups.length,
|
|
146
123
|
groups,
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
124
|
+
sourceType: DS_GROUPS_SOURCE_TYPE,
|
|
125
|
+
coreGroups: DS_CORE_GROUPS.filter((groupId) => liveIds.has(groupId)),
|
|
126
|
+
semanticRules: DS_FIND_SEMANTIC_RULES
|
|
127
|
+
.map((rule) => ({ tag: rule.tag, groups: rule.groups.filter((groupId) => liveIds.has(groupId)) }))
|
|
128
|
+
.filter((rule) => rule.groups.length > 0),
|
|
129
|
+
note: `分组清单来自 ${DS_GROUPS_PATH} 实时返回(sourceType=${DS_GROUPS_SOURCE_TYPE}),接口返回什么就是什么、随环境增减;`
|
|
130
|
+
+ 'ds find 的默认扫描候选同样只取实时分组,需缩小范围时用 --groups 显式指定',
|
|
131
|
+
};
|
|
132
|
+
return {
|
|
133
|
+
data,
|
|
134
|
+
text: renderTable(`分组清单 ${groups.length} 个(实时)`, groups, ['groupId', 'label', 'serviceMark']),
|
|
150
135
|
};
|
|
151
|
-
return { data, text: renderTable(`内置分组清单 ${groups.length} 个`, groups, ['groupId', 'label', 'serviceMark']) };
|
|
152
136
|
}
|
|
153
137
|
export async function dsTables(input, host) {
|
|
154
138
|
const groupId = needArg(input, 'group');
|
|
@@ -273,16 +257,17 @@ export async function dsCount(input, host) {
|
|
|
273
257
|
};
|
|
274
258
|
}
|
|
275
259
|
// ---------------------------------------------------------------- find / describe
|
|
276
|
-
function pickFindGroups(input, keyword) {
|
|
260
|
+
function pickFindGroups(input, keyword, live) {
|
|
277
261
|
if (input.groups) {
|
|
278
262
|
return { mode: 'explicit', groups: String(input.groups).split(',').map((item) => item.trim()).filter(Boolean) };
|
|
279
263
|
}
|
|
280
264
|
if (input.all_groups)
|
|
281
|
-
return { mode: 'all', groups:
|
|
265
|
+
return { mode: 'all', groups: live.map((item) => item.groupId) };
|
|
282
266
|
const max = Math.max(Number(input.max_groups || '6') || 6, DS_CORE_GROUPS.length);
|
|
267
|
+
const liveIds = new Set(live.map((item) => item.groupId));
|
|
283
268
|
const picked = [];
|
|
284
269
|
const push = (groupId) => {
|
|
285
|
-
if (groupId && !picked.includes(groupId))
|
|
270
|
+
if (groupId && liveIds.has(groupId) && !picked.includes(groupId))
|
|
286
271
|
picked.push(groupId);
|
|
287
272
|
};
|
|
288
273
|
for (const groupId of DS_CORE_GROUPS)
|
|
@@ -308,12 +293,12 @@ async function mapLimit(items, limit, fn) {
|
|
|
308
293
|
await Promise.all(workers);
|
|
309
294
|
return out;
|
|
310
295
|
}
|
|
311
|
-
async function scanGroups(host, groupIds, keyword, sourceType, pageSize, concurrency, appId, pages) {
|
|
296
|
+
async function scanGroups(host, index, groupIds, keyword, sourceType, pageSize, concurrency, appId, pages) {
|
|
312
297
|
return mapLimit(groupIds, concurrency, async (groupId) => {
|
|
313
298
|
const result = {
|
|
314
299
|
groupId,
|
|
315
|
-
label: groupLabel(groupId),
|
|
316
|
-
serviceMark: groupMark(groupId),
|
|
300
|
+
label: groupLabel(index, groupId),
|
|
301
|
+
serviceMark: groupMark(index, groupId),
|
|
317
302
|
records: [],
|
|
318
303
|
error: null,
|
|
319
304
|
total: null,
|
|
@@ -417,7 +402,7 @@ function routeHint(candidates) {
|
|
|
417
402
|
return { channel: 'BLOG_DAILY', desc: 'BLOG_DAILY 模块配置通道(日报)', reason: '命中日报分组' };
|
|
418
403
|
if (has((c) => c.serviceMark === 'document'))
|
|
419
404
|
return { channel: 'DOCUMENT', desc: 'DOCUMENT 模块配置通道(文档)', reason: '命中文档分组' };
|
|
420
|
-
if (has((c) => c.serviceMark === 'customer' || c.serviceMark === 'scrm')) {
|
|
405
|
+
if (has((c) => c.serviceMark === 'customer' || c.serviceMark === 'crm' || c.serviceMark === 'scrm')) {
|
|
421
406
|
return { channel: 'CRM', desc: 'CRM 模块配置通道(客户/商机/线索)', reason: '命中 CRM 分组' };
|
|
422
407
|
}
|
|
423
408
|
if (has((c) => c.serviceMark === 'esb'))
|
|
@@ -433,9 +418,11 @@ export async function dsFind(input, host) {
|
|
|
433
418
|
const pages = Math.min(Math.max(Number(input.pages || '1') || 1, 1), 50);
|
|
434
419
|
const concurrency = Math.max(1, Number(input.concurrency || '10') || 10);
|
|
435
420
|
const appId = explicitAppId(input);
|
|
436
|
-
const
|
|
421
|
+
const live = await fetchGroups(host);
|
|
422
|
+
const index = groupIndex(live);
|
|
423
|
+
const picked = pickFindGroups(input, keyword, live);
|
|
437
424
|
const startedAt = Date.now();
|
|
438
|
-
let scan = await scanGroups(host, picked.groups, keyword, sourceType, pageSize, concurrency, appId, pages);
|
|
425
|
+
let scan = await scanGroups(host, index, picked.groups, keyword, sourceType, pageSize, concurrency, appId, pages);
|
|
439
426
|
const keywordNorm = keyword.replace(/\s+/g, '').toLowerCase();
|
|
440
427
|
const looseSample = [];
|
|
441
428
|
let looseDropped = 0;
|
|
@@ -464,8 +451,8 @@ export async function dsFind(input, host) {
|
|
|
464
451
|
if (!scan.some((result) => result.records.length) && picked.mode === 'core' && !input.no_escalate && escalateOk) {
|
|
465
452
|
escalated = true;
|
|
466
453
|
const seen = new Set(picked.groups);
|
|
467
|
-
const extra =
|
|
468
|
-
scan = scan.concat(applyStrict(await scanGroups(host, extra, keyword, sourceType, pageSize, concurrency, appId, pages)));
|
|
454
|
+
const extra = live.map((item) => item.groupId).filter((groupId) => !seen.has(groupId));
|
|
455
|
+
scan = scan.concat(applyStrict(await scanGroups(host, index, extra, keyword, sourceType, pageSize, concurrency, appId, pages)));
|
|
469
456
|
}
|
|
470
457
|
const elapsedMs = Date.now() - startedAt;
|
|
471
458
|
const okScan = scan.filter((result) => !result.error);
|
|
@@ -598,6 +585,14 @@ export async function dsDescribe(input, host) {
|
|
|
598
585
|
const tableId = String(needArg(input, 'table'));
|
|
599
586
|
const sourceType = String(input.source_type || 'LOGIC');
|
|
600
587
|
const startedAt = Date.now();
|
|
588
|
+
// 分组名 / serviceMark 仅用于输出提示:取不到时降级为 null,不影响 describe 主流程。
|
|
589
|
+
let index = null;
|
|
590
|
+
try {
|
|
591
|
+
index = groupIndex(await fetchGroups(host));
|
|
592
|
+
}
|
|
593
|
+
catch {
|
|
594
|
+
index = null;
|
|
595
|
+
}
|
|
601
596
|
const branches = await Promise.all([
|
|
602
597
|
(async () => {
|
|
603
598
|
try {
|
|
@@ -653,7 +648,7 @@ export async function dsDescribe(input, host) {
|
|
|
653
648
|
}
|
|
654
649
|
})(),
|
|
655
650
|
]);
|
|
656
|
-
const data = { groupId, groupLabel: groupLabel(groupId), tableId, sourceType, branches: branches.length };
|
|
651
|
+
const data = { groupId, groupLabel: groupLabel(index, groupId), tableId, sourceType, branches: branches.length };
|
|
657
652
|
const errors = [];
|
|
658
653
|
for (const branch of branches) {
|
|
659
654
|
if (branch.error) {
|
|
@@ -665,7 +660,7 @@ export async function dsDescribe(input, host) {
|
|
|
665
660
|
}
|
|
666
661
|
}
|
|
667
662
|
data.relatedFields = relatedHint(groupId, data.fields?.detailCount || 0);
|
|
668
|
-
data.channelHint = routeHint([{ groupId, serviceMark: groupMark(groupId) }]);
|
|
663
|
+
data.channelHint = routeHint([{ groupId, serviceMark: groupMark(index, groupId) }]);
|
|
669
664
|
data.permissionNote = groupId === 'weaver-ebuilder-form-service'
|
|
670
665
|
? '该分组是 EB 建模表单:取数不再做权限前置校验,--app-id 直接取 ebdf_obj.app_id(obj_id = ebdf_obj.id = 数据源 tableId)'
|
|
671
666
|
: '非 EB 分组,数据源通道无需 appId';
|
|
@@ -683,4 +678,4 @@ export async function dsDescribe(input, host) {
|
|
|
683
678
|
lines.push(`权限: ${data.permissionNote}`);
|
|
684
679
|
return { data, text: lines.join('\n') };
|
|
685
680
|
}
|
|
686
|
-
export {
|
|
681
|
+
export { groupLabel, groupMark };
|
|
@@ -4,12 +4,13 @@ import { dsChart, dsCount, dsDescribe, dsFields, dsFieldsDsl, dsFind, dsGroups,
|
|
|
4
4
|
import { attendStatis } from './attend.js';
|
|
5
5
|
import { fieldName2id, fieldOptions } from './field.js';
|
|
6
6
|
import { nounList, nounScope } from './noun.js';
|
|
7
|
+
import { attributionMetric } from './attribution.js';
|
|
7
8
|
import { confAdd, confAddFile, confBatch, confBatchFile, confDelete, confGet, confGroup, confGroupFile, confResolve, confResolveFile, confUpdate, } from './conf.js';
|
|
8
9
|
import { moduleCall } from './module.js';
|
|
9
10
|
import { sceneGroups, sceneItems, sceneSearch } from './scene.js';
|
|
10
11
|
const DEFINITIONS = [
|
|
11
12
|
{ name: 'data.dsl.query', summary: '直接执行 DSL 查询(executeQueryDsl;与 ds list/chart/stat/count 为独立通道)', capability: 'dsl', handler: executeQuery, command: 'query' },
|
|
12
|
-
{ name: 'data.ds.groups', summary: '
|
|
13
|
+
{ name: 'data.ds.groups', summary: '数据源分组清单(实时 /api/dw/ds/group,sourceType=LOGIC)', capability: 'discovery', handler: dsGroups, command: 'ds groups' },
|
|
13
14
|
{ name: 'data.ds.find', summary: '按关键词跨分组找表(进程内并发扇出 + 本地过滤 + 路由建议)', capability: 'discovery', handler: dsFind, command: 'ds find' },
|
|
14
15
|
{ name: 'data.ds.describe', summary: '一次并发取回字段元数据 + 词库,并给出关联字段/通道提示', capability: 'discovery', handler: dsDescribe, command: 'ds describe' },
|
|
15
16
|
{ name: 'data.ds.tables', summary: '列某个分组下的数据集(表)清单', capability: 'metadata', handler: dsTables, command: 'ds tables' },
|
|
@@ -21,6 +22,7 @@ const DEFINITIONS = [
|
|
|
21
22
|
{ name: 'data.ds.count', summary: '计数(getCountData)', capability: 'fetch', handler: dsCount, command: 'ds count' },
|
|
22
23
|
{ name: 'data.noun.list', summary: '按 skill 取词库(ChatBI 名词解释)', capability: 'lexicon', handler: nounList, command: 'noun list' },
|
|
23
24
|
{ name: 'data.noun.scope', summary: '按数据集生效范围批量取词库(getChatBiDocByScopeId)', capability: 'lexicon', handler: nounScope, command: 'noun scope' },
|
|
25
|
+
{ name: 'data.attribution.metric', summary: '按生效范围批量取归因分析设置(getAttributionMetricByScopeId;分组级 / 条目级绑定)', capability: 'attribution', handler: attributionMetric, command: 'attribution metric' },
|
|
24
26
|
{ name: 'data.field.name2id', summary: '名称 → 字段值 id 候选(浏览按钮类字段)', capability: 'field', handler: fieldName2id, command: 'field name2id' },
|
|
25
27
|
{ name: 'data.field.options', summary: 'Select/Radio/Checkbox 选项值字典(id↔name)', capability: 'field', handler: fieldOptions, command: 'field options' },
|
|
26
28
|
{ name: 'data.conf.get', summary: '按 confKey 取单条配置(confType 由前缀推导或 --type 指定)', capability: 'config', handler: confGet, command: 'conf get' },
|
package/dist/shortcuts/index.js
CHANGED
|
@@ -40,6 +40,11 @@ export const builtinShortcuts = [
|
|
|
40
40
|
description: '泛微E10招聘助手(JD生成/简历建档/AI面试邀约)CLI',
|
|
41
41
|
load: async () => (await import('./recruit-stage/index.js')).recruitStageShortcut,
|
|
42
42
|
}),
|
|
43
|
+
lazyShortcut({
|
|
44
|
+
name: 'performance',
|
|
45
|
+
description: '泛微E10绩效方案(文档导入/实体解析/落草稿/确认发布)CLI',
|
|
46
|
+
load: async () => (await import('./performance/index.js')).performanceShortcut,
|
|
47
|
+
}),
|
|
43
48
|
lazyShortcut({
|
|
44
49
|
name: 'cowork',
|
|
45
50
|
description: '泛微E10协作区(协作事项/讨论/审批/共享权限)CLI',
|
|
@@ -280,7 +280,7 @@ async function resolveRoomValue(env, input) {
|
|
|
280
280
|
* getRelateData 里匹配,匹配不到就返回 NEEDS_CONFIRMATION("无法唯一解析的选项")——
|
|
281
281
|
* 看起来像"流程建会走不通",其实是值格式不对。这里统一补成对象。
|
|
282
282
|
*/
|
|
283
|
-
export async function shapeBrowserValues(env, values) {
|
|
283
|
+
export async function shapeBrowserValues(env, values, options = {}) {
|
|
284
284
|
const notes = [];
|
|
285
285
|
const shaped = { ...values };
|
|
286
286
|
const readable = {};
|
|
@@ -420,11 +420,21 @@ export async function shapeBrowserValues(env, values) {
|
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
const unresolved = rows.filter((row) => row.id === '');
|
|
423
|
-
if (unresolved.length > 0) {
|
|
423
|
+
if (unresolved.length > 0 && options.crmAutoPick === true) {
|
|
424
|
+
// 直接发起流程:客户查不到就不带,不阻断、不追问。
|
|
425
|
+
notes.push(`客户未建档,已跳过:${unresolved.map((row) => row.name).join('、')}`);
|
|
426
|
+
for (let i = rows.length - 1; i >= 0; i -= 1)
|
|
427
|
+
if (rows[i].id === '')
|
|
428
|
+
rows.splice(i, 1);
|
|
429
|
+
}
|
|
430
|
+
else if (unresolved.length > 0) {
|
|
424
431
|
throw meetingValidationError('crm_not_found', `参会客户有 ${unresolved.length} 个在 CRM 里查不到:${unresolved.map((row) => row.name).join('、')}。`
|
|
425
432
|
+ '请确认客户名称,或先到客户表建档;也可以改用「客户名(客户id)」或 `[{id,name}]` 传 crm_members。');
|
|
426
433
|
}
|
|
427
|
-
|
|
434
|
+
if (rows.length > 0)
|
|
435
|
+
shaped.crm_members = rows;
|
|
436
|
+
else
|
|
437
|
+
delete shaped.crm_members;
|
|
428
438
|
readable.crm_members = rows.map((row) => row.name || row.id).join('、');
|
|
429
439
|
notes.push(`参会客户按客户浏览按钮格式提交:${rows.length} 个客户`);
|
|
430
440
|
/**
|
|
@@ -436,7 +446,13 @@ export async function shapeBrowserValues(env, values) {
|
|
|
436
446
|
* ⇒ 这里直接拒绝,并给出可用写法;客户名可从 `meeting.eb.crm.search` 的 `items[].name` 拿。
|
|
437
447
|
*/
|
|
438
448
|
const missingNames = rows.filter((row) => row.name === '');
|
|
439
|
-
if (missingNames.length > 0) {
|
|
449
|
+
if (missingNames.length > 0 && options.crmAutoPick === true) {
|
|
450
|
+
notes.push('有客户只给了 id 没有名称,已跳过,避免写成空值');
|
|
451
|
+
for (let i = rows.length - 1; i >= 0; i -= 1)
|
|
452
|
+
if (rows[i].name === '')
|
|
453
|
+
rows.splice(i, 1);
|
|
454
|
+
}
|
|
455
|
+
else if (missingNames.length > 0) {
|
|
440
456
|
throw meetingValidationError('crm_name_required', `参会客户有 ${missingNames.length} 个只给了 id、没有客户名称:${missingNames.map((row) => row.id).join('、')}。`
|
|
441
457
|
+ '客户浏览按钮必须带名称才能写入(只给 id 会被服务端静默存成空值)。'
|
|
442
458
|
+ '请先用 `meeting.eb.crm.search` 按客户名查到 `{ customerId, name }`,'
|
|
@@ -1311,6 +1327,77 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1311
1327
|
}, { required: ['mt_name'] }),
|
|
1312
1328
|
handler: async (args, env) => {
|
|
1313
1329
|
// 预检各阶段耗时(debugTimings:true 时随结果返回)
|
|
1330
|
+
// 发起流程优先:明确要"发起/创建流程"时不做预检与推荐,只填单。
|
|
1331
|
+
let skipPreflight = args.skipPreflight === true;
|
|
1332
|
+
// 上游流程工具已让用户选过「直接发起表单」时,模型会带 entryMode=direct_form,等价于 skipPreflight。
|
|
1333
|
+
if (args.entryMode === 'direct_form') {
|
|
1334
|
+
args = { ...args, skipPreflight: true };
|
|
1335
|
+
skipPreflight = true;
|
|
1336
|
+
}
|
|
1337
|
+
// 会话内入口标记:流程工具已问过时,这里不再弹入口选项。
|
|
1338
|
+
// entryMode 必须带本轮令牌(由下面的选项 value 下发),否则视为模型自填,无效。
|
|
1339
|
+
let entryResolved = '';
|
|
1340
|
+
const rawEntry = String(args.entryMode ?? '').trim();
|
|
1341
|
+
if (rawEntry === 'assist' || rawEntry === 'direct_form') {
|
|
1342
|
+
const { verifyEntryToken } = await import('./entry-mode.js');
|
|
1343
|
+
if (await verifyEntryToken(env, String(args.entryToken ?? ''), rawEntry).catch(() => false)) {
|
|
1344
|
+
entryResolved = rawEntry;
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
if (!entryResolved) {
|
|
1348
|
+
const { readEntryChoice } = await import('./entry-mode.js');
|
|
1349
|
+
const mark = await readEntryChoice(env).catch(() => null);
|
|
1350
|
+
if (mark?.choice)
|
|
1351
|
+
entryResolved = mark.choice;
|
|
1352
|
+
}
|
|
1353
|
+
if (entryResolved)
|
|
1354
|
+
args = { ...args, entryMode: entryResolved };
|
|
1355
|
+
env.__entryResolved = entryResolved || undefined;
|
|
1356
|
+
if (entryResolved === 'direct_form') {
|
|
1357
|
+
args = { ...args, skipPreflight: true };
|
|
1358
|
+
skipPreflight = true;
|
|
1359
|
+
}
|
|
1360
|
+
// 四要素已齐(人 + 时间含上午/下午/晚上 + 地点)⇒ 直接发起,不预检、不问入口。
|
|
1361
|
+
const beginRaw = String(args.begin_datetime ?? '').trim();
|
|
1362
|
+
const timeReady = /^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}/.test(beginRaw)
|
|
1363
|
+
|| (String(args.time_slot ?? '').trim() !== ''
|
|
1364
|
+
&& (String(args.dateFrom ?? '').trim() !== '' || /^\d{4}-\d{2}-\d{2}/.test(beginRaw)));
|
|
1365
|
+
const placeReady = String(args.address ?? args.customize_address ?? '').trim() !== '';
|
|
1366
|
+
const peopleReady = String(args.hrm_members ?? '').trim() !== '';
|
|
1367
|
+
const autoDirect = timeReady && placeReady && peopleReady;
|
|
1368
|
+
if (autoDirect) {
|
|
1369
|
+
args = { ...args, skipPreflight: true };
|
|
1370
|
+
skipPreflight = true;
|
|
1371
|
+
}
|
|
1372
|
+
// 入口确认:没有 entryMode、没有会话标记、也不是直接发起 → 必须先让用户选一次。
|
|
1373
|
+
if (!entryResolved && args.skipPreflight !== true) {
|
|
1374
|
+
const { createEntryToken } = await import('./entry-mode.js');
|
|
1375
|
+
const tokenDirect = await createEntryToken(env, 'direct_form');
|
|
1376
|
+
const tokenAssist = await createEntryToken(env, 'assist');
|
|
1377
|
+
return meetingSuccess('meeting.eb.meeting.create.flow.prepare', {
|
|
1378
|
+
status: 'NEEDS_SELECTION',
|
|
1379
|
+
selectionType: 'entry',
|
|
1380
|
+
ui: { component: 'choice', multiple: false, recommendedKey: 'A' },
|
|
1381
|
+
message: '预定会议有两种方式:直接发起流程表单,或由我先推荐会议室、检测冲突。请让用户选一个。',
|
|
1382
|
+
options: [
|
|
1383
|
+
{ key: 'A', label: '直接发起流程', reason: '打开会议申请表单,只回填已知信息', value: { entryMode: 'direct_form', entryToken: tokenDirect } },
|
|
1384
|
+
{ key: 'B', label: '推荐会议室/检测冲突', reason: '先确认时间地点,再提交', value: { entryMode: 'assist', entryToken: tokenAssist } },
|
|
1385
|
+
],
|
|
1386
|
+
hint: '用户点选后把 value 原样带回(含 entryMode),不要自己替用户选。',
|
|
1387
|
+
}, { meta: { notes: ['入口确认:用户未表态时必须先问一次'] } });
|
|
1388
|
+
}
|
|
1389
|
+
if (args.skipPreflight === true) {
|
|
1390
|
+
// 直接发起流程:仍要推荐会议室(自动选最优),但不弹时段/房间候选、不等待确认。
|
|
1391
|
+
// 四要素已齐(人+时间+地点)时地点由用户给定,跳过推荐与冲突查询,只填单。
|
|
1392
|
+
const hasAddress = String(args.address ?? args.customize_address ?? '').trim() !== '';
|
|
1393
|
+
args = {
|
|
1394
|
+
...args,
|
|
1395
|
+
timeConfirmed: true,
|
|
1396
|
+
autoRoom: autoDirect !== true,
|
|
1397
|
+
enrich: autoDirect !== true,
|
|
1398
|
+
...(hasAddress ? { roomConfirmed: true } : {}),
|
|
1399
|
+
};
|
|
1400
|
+
}
|
|
1314
1401
|
const marks = (env.__meetingTimings ??= {});
|
|
1315
1402
|
const mark = (key, from) => { marks[key] = (marks[key] ?? 0) + (Date.now() - from); };
|
|
1316
1403
|
// ⚠️ 2026-10-30 顺序调整:**先确认四要素(名称 / 时间 / 参会人 / 地点),最后才定流程**。
|
|
@@ -1325,6 +1412,8 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1325
1412
|
// enrich=false:只做"建会必需"的事(载入表单 + 填字段 + 提交),跳过会议室推荐/冲突检测/空闲时段。
|
|
1326
1413
|
// 适用场景:人、时间、房间都已经确定,只想尽快把会建出来(可省掉 3 组额外请求与一次 ESB 调用)。
|
|
1327
1414
|
const enrich = args.enrich !== false;
|
|
1415
|
+
// 直接发起且指定了房间:只查该房间占用(用于被占时自动换房),不做推荐/人员冲突。
|
|
1416
|
+
const roomCheckOnly = args.skipPreflight === true && String(args.address ?? '').trim() !== '';
|
|
1328
1417
|
let beginText = String(args.begin_datetime ?? '').trim();
|
|
1329
1418
|
let endText = String(args.end_datetime ?? '').trim();
|
|
1330
1419
|
/**
|
|
@@ -1488,7 +1577,7 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1488
1577
|
if (Number.isFinite(startMs))
|
|
1489
1578
|
endText = formatMinute(new Date(startMs + duration * 60000));
|
|
1490
1579
|
}
|
|
1491
|
-
if (!beginHasTime || !timeConfirmed) {
|
|
1580
|
+
if (!skipPreflight && (!beginHasTime || !timeConfirmed)) {
|
|
1492
1581
|
const day = /^\d{4}-\d{2}-\d{2}/.test(beginText)
|
|
1493
1582
|
? beginText.slice(0, 10)
|
|
1494
1583
|
: (String(args.dateFrom ?? '').trim().slice(0, 10) || tomorrowIso());
|
|
@@ -1639,7 +1728,7 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1639
1728
|
const floorHint = floorArg ?? (/楼|层|\d+\s*F/iu.test(String(args.address ?? ''))
|
|
1640
1729
|
? inferRoomFloor(String(args.address ?? ''))
|
|
1641
1730
|
: null);
|
|
1642
|
-
const roomTask = (enrich && beginText && endText)
|
|
1731
|
+
const roomTask = ((enrich || roomCheckOnly) && beginText && endText)
|
|
1643
1732
|
? (async () => {
|
|
1644
1733
|
const usageData = await dayUsagesTask;
|
|
1645
1734
|
return recommendRooms(env, {
|
|
@@ -1709,13 +1798,13 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1709
1798
|
checkNotices.push(`空闲校验沿用 ${Math.round((Date.now() - cachedChecks.checkedAt) / 1000)} 秒前的结论`
|
|
1710
1799
|
+ '(时间/参会人/会议室都没变,未重复查询)。');
|
|
1711
1800
|
}
|
|
1712
|
-
const roomConflictTask = cachedChecks
|
|
1801
|
+
const roomConflictTask = (cachedChecks && !roomCheckOnly && !roomConfirmed)
|
|
1713
1802
|
? Promise.resolve({
|
|
1714
1803
|
room: cachedChecks.roomRecord,
|
|
1715
1804
|
hasConflict: cachedChecks.roomHasConflict === true,
|
|
1716
1805
|
conflicts: (cachedChecks.roomConflicts ?? []),
|
|
1717
1806
|
})
|
|
1718
|
-
: (enrich && beginText && endText && addressId !== '')
|
|
1807
|
+
: ((enrich || roomCheckOnly) && beginText && endText && addressId !== '')
|
|
1719
1808
|
? (async () => {
|
|
1720
1809
|
const room = await resolveAddressRoom(env, addressId);
|
|
1721
1810
|
// 名称对不上任何房间 → 直接判"没这间房",别把一串文本丢进表单等提交时才报错
|
|
@@ -1819,8 +1908,8 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1819
1908
|
// ① 指定的会议室该时段已被占用 → 不替用户改,但必须拦下来并给替代候选。
|
|
1820
1909
|
const roomConflictData = roomConflict;
|
|
1821
1910
|
const resolvedAddress = roomConflictData?.room ?? null;
|
|
1822
|
-
|
|
1823
|
-
|
|
1911
|
+
let resolvedAddressId = resolvedAddress?.id || addressId;
|
|
1912
|
+
let addressDisplay = resolvedAddress?.name || addressId;
|
|
1824
1913
|
// ①-a 名称对不上任何房间。
|
|
1825
1914
|
// ⛔ 2026-10-31 真机:以前这种会一路走到 AWAITING_CONFIRMATION,地点按纯文本塞进表单,
|
|
1826
1915
|
// 用户到流程页面提交时才被工作流打回「请按名称选择」—— 报错位置离真实原因太远。
|
|
@@ -1880,7 +1969,16 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1880
1969
|
});
|
|
1881
1970
|
}
|
|
1882
1971
|
// 只有"用户已确认这间房"时才按占用拦截;未确认的只是候选,交给下面的选房分支处理。
|
|
1883
|
-
|
|
1972
|
+
// 直接发起流程:指定房被占时自动改用首选空闲房,不追问(普通链路仍走选项)。
|
|
1973
|
+
if (skipPreflight && addressInput && roomConfirmed && roomConflictData?.hasConflict === true && roomOptions.length > 0) {
|
|
1974
|
+
const fallback = roomOptions[0].value ?? {};
|
|
1975
|
+
const from = { id: resolvedAddressId, name: addressDisplay };
|
|
1976
|
+
resolvedAddressId = String(fallback.id ?? '');
|
|
1977
|
+
addressDisplay = String(fallback.name ?? addressDisplay);
|
|
1978
|
+
addressInput = resolvedAddressId;
|
|
1979
|
+
decisions.roomAutoSwitched = { reason: '指定房被占,自动改用首选空闲房', from, to: { id: resolvedAddressId, name: addressDisplay } };
|
|
1980
|
+
}
|
|
1981
|
+
if (addressInput && roomConfirmed && roomConflictData?.hasConflict === true && !(skipPreflight && roomOptions.length > 0)) {
|
|
1884
1982
|
const busy = Array.isArray(roomConflictData.conflicts) ? roomConflictData.conflicts : [];
|
|
1885
1983
|
decisions.roomConflict = {
|
|
1886
1984
|
address: resolvedAddressId,
|
|
@@ -2251,7 +2349,7 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
2251
2349
|
...(args.extraFields && typeof args.extraFields === 'object' && !Array.isArray(args.extraFields)
|
|
2252
2350
|
? args.extraFields
|
|
2253
2351
|
: {}),
|
|
2254
|
-
});
|
|
2352
|
+
}, { crmAutoPick: skipPreflight });
|
|
2255
2353
|
// datakey 固化:上次解析出的「语义键 → fieldId」直接复用(表单字段改名也不影响),
|
|
2256
2354
|
// 本次解析结果再写回,形成"猜一次、之后一直用 datakey"的效果。
|
|
2257
2355
|
const preferredFields = await readFlowFieldMap(env, workflowId);
|
|
@@ -2617,6 +2715,7 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
2617
2715
|
}).catch(() => undefined);
|
|
2618
2716
|
return meetingSuccess('meeting.eb.meeting.create.flow.prepare', {
|
|
2619
2717
|
status: 'AWAITING_CONFIRMATION',
|
|
2718
|
+
...(entryResolved ? { entryResolved } : {}),
|
|
2620
2719
|
preview: {
|
|
2621
2720
|
workflowId,
|
|
2622
2721
|
workflowCandidates: candidates,
|