weaver-work-cli 0.1.54 → 0.1.57
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-ZQ4A4TV6.js → archive-4SQAVTIB.js} +3 -2
- package/dist/chunks/{archive-oa-57R2FYHV.js → archive-oa-W2UEJ67L.js} +137 -8
- package/dist/chunks/{asset-ZOJVBWZH.js → asset-EGZEABBI.js} +3 -2
- package/dist/chunks/{asset-idle-XGB5IPGT.js → asset-idle-EBUZBB6M.js} +3 -2
- package/dist/chunks/{attachment-content-2EPEI4HV.js → attachment-content-QGM5MLQE.js} +4 -3
- package/dist/chunks/{blog-QSHLZSFW.js → blog-2YKMWOWI.js} +3 -2
- package/dist/chunks/{caizhilian-KCQYFH72.js → caizhilian-QJ4FLSQJ.js} +5 -4
- package/dist/chunks/{calendar-DLGMRJQA.js → calendar-H4QTJCUY.js} +3 -2
- package/dist/chunks/{chunk-XPQN4E5O.js → chunk-44KJ7WFA.js} +300 -55
- package/dist/chunks/{chunk-CZNZKOHR.js → chunk-4GG72JAT.js} +2 -2
- package/dist/chunks/{chunk-YIKSL36S.js → chunk-5N222HK6.js} +2 -2
- package/dist/chunks/{chunk-XHMJBRLZ.js → chunk-6DVL5IN5.js} +4 -1
- package/dist/chunks/{chunk-JJRIT2ZN.js → chunk-6MS3RLPO.js} +5 -334
- package/dist/chunks/{chunk-QUDHSMG3.js → chunk-7EBV7Q3R.js} +112 -27
- package/dist/chunks/{chunk-CNVZETM5.js → chunk-AHJZIMCX.js} +1 -1
- package/dist/chunks/{chunk-TGAGQV4I.js → chunk-CQ4OVCKG.js} +2 -2
- package/dist/chunks/{chunk-2BQESR2U.js → chunk-DVR2EDUU.js} +99 -34
- package/dist/chunks/{chunk-7KKI5KDY.js → chunk-FDAJC7R4.js} +4 -4
- package/dist/chunks/{chunk-GR76ZDDX.js → chunk-FMNCSYIG.js} +2 -2
- package/dist/chunks/{chunk-6LGLI46Q.js → chunk-L2LMBFG5.js} +1 -1
- package/dist/chunks/{chunk-DLY5GUXX.js → chunk-PH7N4UFT.js} +1 -1
- package/dist/chunks/{chunk-U6R6FZHD.js → chunk-SFM3M2L3.js} +286 -93
- package/dist/chunks/chunk-SHYQUBY3.js +48 -0
- package/dist/chunks/{chunk-HFXK54M4.js → chunk-TGM7BWEH.js} +2 -2
- package/dist/chunks/{chunk-Z7B7QSR2.js → chunk-TJUAGZU7.js} +11 -11
- package/dist/chunks/{chunk-LYOFRYC4.js → chunk-UI66EMOR.js} +4 -4
- package/dist/chunks/{chunk-762M5XJS.js → chunk-VMCCRWFO.js} +2 -2
- package/dist/chunks/{chunk-FE3CQAAM.js → chunk-WHJIUKJW.js} +681 -48
- package/dist/chunks/{chunk-PGO4ILMQ.js → chunk-WMB3SMXI.js} +1 -1
- package/dist/chunks/chunk-WMRNO6IU.js +337 -0
- package/dist/chunks/{chunk-6NXT4ICB.js → chunk-WVH5ESDA.js} +1 -1
- package/dist/chunks/{chunk-O6RIBG5E.js → chunk-XU3FL3AW.js} +4 -4
- package/dist/chunks/{chunk-Z6UUBY37.js → chunk-Z4IPY5GV.js} +2 -2
- package/dist/chunks/{conflict-K2IAKKFR.js → conflict-VAFFPUY3.js} +2 -2
- package/dist/chunks/{contract-LJRAXVZU.js → contract-LLRKMLQQ.js} +2655 -1319
- package/dist/chunks/{cowork-3ACICHDQ.js → cowork-2RDFBZWB.js} +3 -2
- package/dist/chunks/{create-flow-UL37MZGP.js → create-flow-TVYE3IOH.js} +6 -6
- package/dist/chunks/{data-WK5CQXNF.js → data-WVICO3DT.js} +57 -11
- package/dist/chunks/{ebuilder-form-CBYI6CQ6.js → ebuilder-form-TWSXS5NA.js} +7 -6
- package/dist/chunks/{ehr-XI4BIVR2.js → ehr-52GBKNJR.js} +3 -2
- package/dist/chunks/{env-BZDB5OVZ.js → env-BVVFIN4P.js} +2 -2
- package/dist/chunks/{esb-4BQHNP5C.js → esb-HJSXCEOM.js} +5 -4
- package/dist/chunks/{factory-VD3YI6N7.js → factory-RCQ36LLE.js} +1 -1
- package/dist/chunks/{fna-ECOYBQYL.js → fna-OBACRT3J.js} +72 -3
- package/dist/chunks/{group-chat-DHNVO76L.js → group-chat-YFZDUUY3.js} +3 -3
- package/dist/chunks/{host-TUOIOEMC.js → host-2BKMPWDH.js} +4 -3
- package/dist/chunks/{host-3TNBMDTR.js → host-KJT3G5D2.js} +4 -3
- package/dist/chunks/{host-7OWWPLM4.js → host-KOWUMNAY.js} +4 -3
- package/dist/chunks/{host-M4XP5URR.js → host-MFXRA2MY.js} +4 -3
- package/dist/chunks/{host-7NTIBSPK.js → host-TTSGY5NZ.js} +4 -3
- package/dist/chunks/{host-G3VU7SDW.js → host-W4JCNRFS.js} +4 -3
- package/dist/chunks/{hrm-YGIR3HGF.js → hrm-AK3WGBMN.js} +4 -3
- package/dist/chunks/{im-TN2JYVGJ.js → im-JZSBPO4Z.js} +4 -3
- package/dist/chunks/{invoice-V7ZTITUO.js → invoice-7JGSEWT5.js} +22 -9
- package/dist/chunks/{jiuchuanhui-ASFZBMPU.js → jiuchuanhui-K4EQU6GK.js} +3 -2
- package/dist/chunks/{lazy-dispatch-XSAHDK6Z.js → lazy-dispatch-JHGFCKJN.js} +5 -4
- package/dist/chunks/{mail-M3HJF5ER.js → mail-IKVCQCVZ.js} +3 -2
- package/dist/chunks/{meeting-OWG4O2XH.js → meeting-JOHV4RH3.js} +14 -12
- package/dist/chunks/minute-doc-JLS4KMFZ.js +156 -0
- package/dist/chunks/{okr-EVX7FB5G.js → okr-KV43FPPX.js} +3 -2
- package/dist/chunks/{operations-J7PUIVWZ.js → operations-ZPWBMYKE.js} +5 -4
- package/dist/chunks/{plan-2QJQEPBO.js → plan-WOYR4WEG.js} +3 -2
- package/dist/chunks/{project-XELELW2T.js → project-CQJKBUIL.js} +3 -2
- package/dist/chunks/{reception-QGPNTGHG.js → reception-MPBU3JXC.js} +3 -2
- package/dist/chunks/{recruit-stage-XCMVEQA2.js → recruit-stage-USTTRHOX.js} +3 -2
- package/dist/chunks/{registry-CJOVECZD.js → registry-GURQG4ZV.js} +3 -2
- package/dist/chunks/{registry-ASYCWF2U.js → registry-LITYOH2W.js} +12 -10
- package/dist/chunks/{registry-QJCZ2GVG.js → registry-SS5J2FZQ.js} +5 -4
- package/dist/chunks/{room-recommend-LSVAMGKV.js → room-recommend-62MECG4J.js} +4 -4
- package/dist/chunks/{schedule-7QOPRUU4.js → schedule-6QRXIBGU.js} +4 -4
- package/dist/chunks/{smart-extract-FOUYNIG3.js → smart-extract-APX2PNIN.js} +3 -2
- package/dist/chunks/{workflow-YHXFIU63.js → workflow-WMPW3WSB.js} +5 -4
- package/dist/index.js +33 -32
- package/dist/internal/e10/auth/agent-host-key.js +68 -0
- package/dist/internal/e10/auth/agent-hosts.js +250 -0
- package/dist/internal/e10/auth/commands.js +99 -30
- package/dist/internal/e10/auth/paths.js +9 -0
- package/dist/internal/e10/auth/session.js +17 -0
- package/dist/internal/e10/auth/xiaoe.js +37 -3
- package/dist/shortcuts/archive-oa/operations/contract-modules.js +106 -0
- package/dist/shortcuts/archive-oa/operations/contract.js +38 -4
- package/dist/shortcuts/archive-oa/operations/registry.js +2 -1
- package/dist/shortcuts/contract/index.js +6 -7
- package/dist/shortcuts/contract/manifest.js +101 -24
- package/dist/shortcuts/contract/ooxml/docx-table.js +75 -3
- package/dist/shortcuts/contract/ooxml/xlsx.js +49 -13
- package/dist/shortcuts/contract/operations/card-action.js +113 -12
- package/dist/shortcuts/contract/operations/card-ebdf-list.js +29 -7
- package/dist/shortcuts/contract/operations/card-plan.js +75 -9
- package/dist/shortcuts/contract/operations/card-risk-report.js +2 -2
- package/dist/shortcuts/contract/operations/card.js +1 -1
- package/dist/shortcuts/contract/operations/clause-library.js +88 -16
- package/dist/shortcuts/contract/operations/compare-screen.js +378 -0
- package/dist/shortcuts/contract/operations/compare.js +1 -1
- package/dist/shortcuts/contract/operations/credit-page.js +1 -1
- package/dist/shortcuts/contract/operations/docx-slots.js +1000 -0
- package/dist/shortcuts/contract/operations/flow.js +2 -2
- package/dist/shortcuts/contract/operations/quote-to-contract.js +495 -0
- package/dist/shortcuts/contract/operations/quote.js +2 -229
- package/dist/shortcuts/contract/operations/recommend.js +1 -1
- package/dist/shortcuts/contract/operations/registry.js +6 -2
- package/dist/shortcuts/contract/operations/review.js +230 -4
- package/dist/shortcuts/contract/operations/save-recognize.js +122 -3
- package/dist/shortcuts/contract/operations/template.js +11 -10
- package/dist/shortcuts/data/operations/ds.js +5 -5
- package/dist/shortcuts/data/operations/shared.js +76 -4
- package/dist/shortcuts/fna/manifest.js +7 -2
- package/dist/shortcuts/fna/operations/budget.js +68 -0
- package/dist/shortcuts/invoice/manifest.js +8 -3
- package/dist/shortcuts/invoice/operations/reim.js +10 -3
- package/dist/shortcuts/meeting/minute-doc.js +153 -0
- package/dist/shortcuts/meeting/operations/compose-outcome.js +176 -0
- package/dist/shortcuts/meeting/operations/eb/catalog.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +26 -0
- package/dist/shortcuts/meeting/operations/eb/decision-task-batch.js +144 -0
- package/dist/shortcuts/meeting/operations/eb/decision.js +92 -4
- package/dist/shortcuts/meeting/operations/eb/index.js +133 -4
- package/dist/shortcuts/meeting/operations/eb/meeting-link.js +90 -0
- package/dist/shortcuts/meeting/operations/from-group-chat.js +46 -0
- package/dist/shortcuts/meeting/operations/minute-content.js +61 -0
- package/dist/shortcuts/meeting/operations/registry.js +14 -1
- package/dist/shortcuts/meeting/operations/self-check.js +49 -0
- package/dist/shortcuts/workflow/endpoints.js +2 -0
- package/dist/shortcuts/workflow/operations/read.js +114 -8
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +72 -46
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +41 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +46 -11
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +18 -1
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroupAdd.js +51 -0
- package/docs/e10-auth.md +78 -0
- package/docs/fna.md +8 -3
- package/docs/invoice.md +1 -1
- package/package.json +4 -2
- package/scripts/pack-offline.mjs +228 -0
- package/scripts/package-skill.mjs +14 -5
- package/skill-template/business-info.json +3 -0
- package/skill-template/domains/qiyecheng.md +4 -3
- package/skills/weaver-e10-archive-oa/SKILL.md +6 -1
- package/skills/weaver-e10-archive-oa/references/contract-search.md +91 -4
- package/skills/weaver-e10-jinchengda/SKILL.md +100 -81
- package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +11 -6
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +5 -4
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +38 -12
- package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +20 -6
- package/skills/weaver-e10-jinchengda/references/contract-card-render-internals.md +8 -3
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +56 -13
- package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +7 -0
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +11 -5
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +38 -7
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +13 -25
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +9 -8
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +8 -6
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +10 -7
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +3 -1
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +26 -18
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +4 -4
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +18 -13
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +5 -3
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +105 -49
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +3 -6
- package/skills/weaver-e10-meeting/SKILL.md +47 -9
- package/skills/weaver-e10-qiyecheng/SKILL.md +16 -7
- package/skills/weaver-e10-qiyecheng/references/budget.md +77 -3
- package/skills/weaver-e10-qiyecheng/references/catalog.md +6 -4
- package/skills/weaver-e10-qiyecheng/references/getEnabledTemplate-api.md +255 -0
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +70 -25
- package/skills/weaver-e10-workflow/SKILL.md +54 -40
- package/skills/weaver-e10-workflow/references/todo-dialogue.md +134 -0
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +102 -80
- package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +23 -13
- package/skills/weaver-e10-workflow/references/workflow-query.md +68 -46
- package/skills/weaver-e10-workflow/references/workflow-view.md +21 -13
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +317 -332
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +1 -0
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +23 -13
- package/skills/weaver-e10-yepiaotong.zip +0 -0
- package/dist/shortcuts/contract/ooxml/docx.js +0 -295
- package/dist/shortcuts/contract/operations/docx-fillfromquote.js +0 -532
- package/skills/weaver-e10-jinchengda/references/contract-risk-report-template.html +0 -178
- package/skills/weaver-e10-jinchengda/references/source-manifest.json +0 -1270
- package/skills/weaver-e10-jinchengda/scripts/fill_plan.py +0 -998
- package/skills/weaver-e10-workflow/tools/todo-serve.cjs +0 -327
|
@@ -81,6 +81,86 @@ function businessFailed(response, interfacePk) {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
/** 决议明细最少 1 条:没有明细就不会有决议任务,等于白建。 */
|
|
84
|
+
/**
|
|
85
|
+
* 决议明细的人员字段(executors / rummager):**允许传姓名,自动换员工 id**。
|
|
86
|
+
*
|
|
87
|
+
* 2026-11-16 真机:模型按姓名传 `executors:"易鹏"`,服务端只认 id → 整行执行人被丢弃
|
|
88
|
+
* (多人甚至只剩 ",,")。检查人没传时也全空。
|
|
89
|
+
* 现在:姓名→id 自动解析;`rummager` 缺省填当前登录人(会议召集人默认就是检查人)。
|
|
90
|
+
*/
|
|
91
|
+
async function resolveDecisionPeople(env, input, ownerId) {
|
|
92
|
+
const rows = Array.isArray(input) ? input : [];
|
|
93
|
+
const tokensOf = (value) => String(value ?? '')
|
|
94
|
+
.split(/[,;,;\s]+/)
|
|
95
|
+
.map((item) => item.trim())
|
|
96
|
+
.filter((item) => item !== '');
|
|
97
|
+
const nameTokens = new Set();
|
|
98
|
+
for (const row of rows) {
|
|
99
|
+
const source = (row && typeof row === 'object' ? row : {});
|
|
100
|
+
for (const key of ['executors', 'rummager']) {
|
|
101
|
+
for (const token of tokensOf(source[key])) {
|
|
102
|
+
if (!/^\d+$/.test(token))
|
|
103
|
+
nameTokens.add(token);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
let nameToId = new Map();
|
|
108
|
+
if (nameTokens.size > 0) {
|
|
109
|
+
const { resolveMemberIdsByName } = await import('./schedule.js');
|
|
110
|
+
nameToId = await resolveMemberIdsByName(env, [...nameTokens]).catch(() => new Map());
|
|
111
|
+
}
|
|
112
|
+
const unresolved = [];
|
|
113
|
+
let rummagerDefaulted = false;
|
|
114
|
+
const resolved = rows.map((row) => {
|
|
115
|
+
const source = { ...row };
|
|
116
|
+
const convert = (value, field) => tokensOf(value).map((token) => {
|
|
117
|
+
if (/^\d+$/.test(token))
|
|
118
|
+
return token;
|
|
119
|
+
const id = nameToId.get(token);
|
|
120
|
+
if (!id) {
|
|
121
|
+
if (!unresolved.includes(token))
|
|
122
|
+
unresolved.push(token);
|
|
123
|
+
return '';
|
|
124
|
+
}
|
|
125
|
+
return id;
|
|
126
|
+
}).filter((id) => id !== '').join(',');
|
|
127
|
+
if (source.executors !== undefined)
|
|
128
|
+
source.executors = convert(source.executors, 'executors');
|
|
129
|
+
// 日期容错:2026-11-11 / 2026-11-11T09:00 / 2026-11-11 9:00 都归一成 yyyy-MM-dd HH:mm
|
|
130
|
+
for (const key of ['begin_datetime', 'end_datetime']) {
|
|
131
|
+
const raw = String(source[key] ?? '').trim();
|
|
132
|
+
if (raw === '')
|
|
133
|
+
continue;
|
|
134
|
+
if (/^\d{4}-\d{2}-\d{2}$/.test(raw)) {
|
|
135
|
+
source[key] = `${raw} 09:00`;
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
source[key] = raw.replace('T', ' ').replace(/:\d{2}\.\d+/, '');
|
|
139
|
+
}
|
|
140
|
+
if (source.rummager === undefined || String(source.rummager).trim() === '') {
|
|
141
|
+
if (ownerId) {
|
|
142
|
+
source.rummager = ownerId;
|
|
143
|
+
rummagerDefaulted = true;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
source.rummager = convert(source.rummager, 'rummager');
|
|
148
|
+
}
|
|
149
|
+
return source;
|
|
150
|
+
});
|
|
151
|
+
return { rows: resolved, unresolved, rummagerDefaulted };
|
|
152
|
+
}
|
|
153
|
+
/** 决议概述没传时,用明细标题自动汇总(避免"补 mt_content 再提交"多一轮)。 */
|
|
154
|
+
function autoDecisionSummary(input) {
|
|
155
|
+
const rows = Array.isArray(input) ? input : [];
|
|
156
|
+
const titles = rows
|
|
157
|
+
.map((row) => String(row?.decision_title ?? '').trim())
|
|
158
|
+
.filter((title) => title !== '');
|
|
159
|
+
if (titles.length === 0)
|
|
160
|
+
return '本次会议已形成决议,详见决议明细';
|
|
161
|
+
const brief = titles.slice(0, 6).join(';');
|
|
162
|
+
return `本次会议共形成 ${titles.length} 项决议:${brief}${titles.length > 6 ? '…' : ''}`.slice(0, 300);
|
|
163
|
+
}
|
|
84
164
|
function normalizeDecisionRows(input) {
|
|
85
165
|
if (input === undefined || input === null) {
|
|
86
166
|
throw meetingValidationError('missing_required_field', '缺少决议明细 detail1:至少 1 条(每条决议明细会由 ESB 联动生成一条决议任务)', { node: 'detail1', minRows: 1 });
|
|
@@ -113,7 +193,7 @@ const decisionPublishPrepare = {
|
|
|
113
193
|
additionalProperties: false,
|
|
114
194
|
properties: {
|
|
115
195
|
mt_id: { type: 'string', description: '会议 id(必填)' },
|
|
116
|
-
mt_content: { type: 'string', description: '
|
|
196
|
+
mt_content: { type: 'string', description: '决议概述文本:省略时由 CLI 用 detail1 的决策标题自动汇总,不再回问用户' },
|
|
117
197
|
detail1: {
|
|
118
198
|
type: 'array',
|
|
119
199
|
minItems: 1,
|
|
@@ -138,16 +218,17 @@ const decisionPublishPrepare = {
|
|
|
138
218
|
},
|
|
139
219
|
mt_status: { type: 'string', description: `写回会议状态,默认 ${MT_STATUS_OVER}(结束);产生决议即视为会议结束` },
|
|
140
220
|
},
|
|
141
|
-
required: ['mt_id', '
|
|
221
|
+
required: ['mt_id', 'detail1'],
|
|
142
222
|
},
|
|
143
223
|
handler: async (args, env) => {
|
|
144
224
|
const session = await env.host.getSession();
|
|
225
|
+
const people = await resolveDecisionPeople(env, args.detail1, String(session.userId ?? ''));
|
|
145
226
|
const create = normalizeEbWrite(requireEndpoint('create_mt_decision'), {
|
|
146
227
|
mt_id: args.mt_id,
|
|
147
|
-
mt_content: args.mt_content,
|
|
228
|
+
mt_content: String(args.mt_content ?? '').trim() || autoDecisionSummary(args.detail1),
|
|
148
229
|
// 注意:**不要传 data_status** —— 2026-09-21 真机实测该接口拒绝该字段
|
|
149
230
|
// (DataError:dataKey:data_status,该字段不存在),提交状态由系统自动置 1。
|
|
150
|
-
detail1: normalizeDecisionRows(
|
|
231
|
+
detail1: normalizeDecisionRows(people.rows),
|
|
151
232
|
}, session.userId);
|
|
152
233
|
const mtStatus = args.mt_status === undefined || args.mt_status === null || args.mt_status === ''
|
|
153
234
|
? MT_STATUS_OVER
|
|
@@ -187,6 +268,10 @@ const decisionPublishPrepare = {
|
|
|
187
268
|
notes: [
|
|
188
269
|
'第 1 步写入决议概述与明细,第 2 步把会议写回为「已决议(is_decision=2)」并置会议状态。',
|
|
189
270
|
'决议任务由 ESB 联动按明细生成,本操作不直接写任务表。',
|
|
271
|
+
...(people.unresolved.length > 0
|
|
272
|
+
? [`以下人员没解析到员工 id,对应执行人/检查人会被服务端丢弃:${people.unresolved.join('、')}`]
|
|
273
|
+
: []),
|
|
274
|
+
...(people.rummagerDefaulted ? ['检查人未指定,已默认填当前登录人(召集人)'] : []),
|
|
190
275
|
],
|
|
191
276
|
},
|
|
192
277
|
});
|
|
@@ -212,6 +297,7 @@ const decisionPublishApply = {
|
|
|
212
297
|
},
|
|
213
298
|
handler: async (args, env) => {
|
|
214
299
|
const applyName = 'meeting.eb.decision.publish.apply';
|
|
300
|
+
const startedAt = Date.now();
|
|
215
301
|
requireConfirm(args, applyName);
|
|
216
302
|
const lease = await verifyLease(args, applyName, env);
|
|
217
303
|
const payload = lease.payload;
|
|
@@ -223,6 +309,7 @@ const decisionPublishApply = {
|
|
|
223
309
|
}
|
|
224
310
|
const session = await env.host.getSession();
|
|
225
311
|
const { create, mtId, mtStatus } = payload;
|
|
312
|
+
let writeMs = 0;
|
|
226
313
|
// 被取消过的会议:两步之间必须留间隔,否则 ESB 会把同一批明细生成两轮任务(见 CANCELLED_MARK_DELAY_MS)
|
|
227
314
|
const cancelled = await isCancelledMeeting(env, mtId);
|
|
228
315
|
const warnings = [];
|
|
@@ -261,6 +348,7 @@ const decisionPublishApply = {
|
|
|
261
348
|
throw meetingPartialError('决议概述可能已写入,但接口未返回 dataIds(拿不到决议 id),无法自动写回会议。'
|
|
262
349
|
+ `请先用 meeting.eb.decision.list({ mt_id: "${mtId}" }) 回查该会议是否已生成决议,再决定是否单独调用 meeting.eb.meeting.markDecided 标记;**不要**重复创建决议。`, { mtId, attempted: { interfacePk: 'create_mt_decision', body: create } }, { stage: applyName });
|
|
263
350
|
}
|
|
351
|
+
writeMs = Date.now() - startedAt;
|
|
264
352
|
// 第 2 步:写回会议(关联决议 + 决议状态 + 会议状态)
|
|
265
353
|
// ⚠️ 曾取消的会议:紧接着调用会让 ESB 触发两轮(真机:1 条明细 → 2 条任务)。
|
|
266
354
|
// 实测 500ms 即够,这里留 800ms 余量;正常会议不走这个分支,不增加耗时。
|
|
@@ -9,6 +9,8 @@ import { meetingEbScheduleOperations } from './schedule.js';
|
|
|
9
9
|
import { meetingEbCrmOperations } from './crm-search.js';
|
|
10
10
|
import { meetingEbCreateFlowOperations } from './create-flow.js';
|
|
11
11
|
import { meetingEbGroupChatOperations } from './group-chat.js';
|
|
12
|
+
import { attachMeetingUrls } from './meeting-link.js';
|
|
13
|
+
import { meetingEbDecisionTaskBatchOperations } from './decision-task-batch.js';
|
|
12
14
|
/**
|
|
13
15
|
* 会议 EB 版(eBuilder)operations。
|
|
14
16
|
*
|
|
@@ -161,13 +163,140 @@ const ebAutoInvitationAfterWrite = async (context) => {
|
|
|
161
163
|
};
|
|
162
164
|
}
|
|
163
165
|
};
|
|
166
|
+
const ebBaseOperations = buildEbOperations(EB_ENDPOINTS, {
|
|
167
|
+
preflight: ebAutoRoomPreflight,
|
|
168
|
+
afterWrite: ebAutoInvitationAfterWrite,
|
|
169
|
+
});
|
|
170
|
+
/**
|
|
171
|
+
* 查询类 operation 自动补会议链接(用户要求:会议名必须可点击,模型不许再漏)。
|
|
172
|
+
* `meeting.eb.meeting.list` 额外支持 `date`(yyyy-MM-dd):自动换算成服务端区间,
|
|
173
|
+
* 避免模型"拉全量再本地筛"(实测全量 15 万条)。
|
|
174
|
+
*/
|
|
175
|
+
const ebOperationsWithLinks = ebBaseOperations.map((operation) => {
|
|
176
|
+
const isList = operation.name === 'meeting.eb.meeting.list';
|
|
177
|
+
const needsUrl = isList || operation.name === 'meeting.eb.meeting.detail';
|
|
178
|
+
if (!needsUrl)
|
|
179
|
+
return operation;
|
|
180
|
+
return {
|
|
181
|
+
...operation,
|
|
182
|
+
handler: async (args, env) => {
|
|
183
|
+
let nextArgs = args;
|
|
184
|
+
// 查「我的会议」:直接用服务端 hrmmember(实测 3s / 当天全量 30s+本地筛)
|
|
185
|
+
if (isList && args?.mine === true && !args?.hrmmember && !args?.hrm_member) {
|
|
186
|
+
const session = await env.host.getSession().catch(() => null);
|
|
187
|
+
const uid = String(session?.userId ?? '').trim();
|
|
188
|
+
if (uid)
|
|
189
|
+
nextArgs = { ...(nextArgs ?? {}), hrmmember: uid };
|
|
190
|
+
}
|
|
191
|
+
// 查「别人的会议」:member 支持姓名或 id,解析后同样走服务端 hrmmember
|
|
192
|
+
if (isList && args?.member && !args?.hrmmember && !args?.hrm_member) {
|
|
193
|
+
const raw = String(args.member).trim();
|
|
194
|
+
let uid = /^\d+$/.test(raw) ? raw : '';
|
|
195
|
+
if (!uid) {
|
|
196
|
+
const { resolveMemberIdsByName } = await import('./schedule.js');
|
|
197
|
+
const map = await resolveMemberIdsByName(env, [raw]).catch(() => new Map());
|
|
198
|
+
uid = String(map.get(raw) ?? '');
|
|
199
|
+
}
|
|
200
|
+
if (uid) {
|
|
201
|
+
const { member: _member, ...rest } = (nextArgs ?? args);
|
|
202
|
+
nextArgs = { ...rest, hrmmember: uid };
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (isList && args?.date && !args?.begin_datetime && !args?.begindatetime) {
|
|
206
|
+
const day = String(args.date).trim();
|
|
207
|
+
const start = new Date(`${day}T00:00:00`);
|
|
208
|
+
if (!Number.isNaN(start.getTime())) {
|
|
209
|
+
const end = new Date(start);
|
|
210
|
+
end.setDate(end.getDate() + 1);
|
|
211
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
212
|
+
const fmt = (d) => `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())} 00:00`;
|
|
213
|
+
const { date: _date, ...rest } = nextArgs ?? args;
|
|
214
|
+
nextArgs = { ...rest, begindatetime: fmt(start), enddatetime: fmt(end) };
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
const result = await operation.handler(nextArgs, env);
|
|
218
|
+
if (result?.data && needsUrl)
|
|
219
|
+
await attachMeetingUrls(env, result.data);
|
|
220
|
+
return result;
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
});
|
|
224
|
+
/** 兼容漏写 `.eb` 的调用(模型常写 meeting.decision.publish):注册同义别名,避免被当成"接口不可用"。 */
|
|
225
|
+
const decisionPublishAliases = meetingEbDecisionOperations
|
|
226
|
+
.filter((operation) => operation.name.startsWith('meeting.eb.decision.publish.'))
|
|
227
|
+
.map((operation) => ({ ...operation, name: operation.name.replace('meeting.eb.', 'meeting.') }));
|
|
228
|
+
/** minute.create 直接带正文创建时也要挂纪要文档(这条路径以前被漏掉)。 */
|
|
229
|
+
/** 智能纪要页面 id(本租户固定):create 没传时自动补,避免生成后 AI 页面空白。 */
|
|
230
|
+
const DEFAULT_AI_MINUTE_PAGE = '1250830691712172036';
|
|
231
|
+
const ebOperationsWithMinuteDoc = ebOperationsWithLinks.map((operation) => {
|
|
232
|
+
if (operation.name === 'meeting.eb.minute.create.prepare') {
|
|
233
|
+
return {
|
|
234
|
+
...operation,
|
|
235
|
+
handler: async (args, env) => {
|
|
236
|
+
const nextArgs = { ...(args ?? {}) };
|
|
237
|
+
if (!nextArgs.mt_minutes_ai_page)
|
|
238
|
+
nextArgs.mt_minutes_ai_page = DEFAULT_AI_MINUTE_PAGE;
|
|
239
|
+
// 主题必填,但不该回问用户:用会议名自动拼「<会议名> 会议纪要」
|
|
240
|
+
if (!String(nextArgs.mt_minutes_subject ?? '').trim() && nextArgs.mt_id) {
|
|
241
|
+
let meetingName = '';
|
|
242
|
+
try {
|
|
243
|
+
const { getMeetingOperation } = await import('../registry.js');
|
|
244
|
+
const detailOp = getMeetingOperation('meeting.eb.meeting.detail');
|
|
245
|
+
const detail = await detailOp.handler({ id: String(nextArgs.mt_id) }, env);
|
|
246
|
+
const row = detail?.data?.data ?? {};
|
|
247
|
+
meetingName = String(row.name ?? row.mt_name ?? '').trim();
|
|
248
|
+
}
|
|
249
|
+
catch {
|
|
250
|
+
meetingName = '';
|
|
251
|
+
}
|
|
252
|
+
nextArgs.mt_minutes_subject = `${meetingName || '会议'} 会议纪要`;
|
|
253
|
+
}
|
|
254
|
+
return operation.handler(nextArgs, env);
|
|
255
|
+
},
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
if (operation.name !== 'meeting.eb.minute.create.apply')
|
|
259
|
+
return operation;
|
|
260
|
+
return {
|
|
261
|
+
...operation,
|
|
262
|
+
handler: async (args, env) => {
|
|
263
|
+
const result = await operation.handler(args, env);
|
|
264
|
+
try {
|
|
265
|
+
const { getMeetingOperation } = await import('../registry.js');
|
|
266
|
+
const { ensureMinuteDoc } = await import('../../minute-doc.js');
|
|
267
|
+
const minuteId = String((result?.data?.dataIds ?? [])[0] ?? '').trim();
|
|
268
|
+
if (minuteId) {
|
|
269
|
+
const detail = await getMeetingOperation('meeting.eb.minute.detail').handler({ id: minuteId }, env);
|
|
270
|
+
const row = detail?.data?.data ?? {};
|
|
271
|
+
const doc = await ensureMinuteDoc(env, {
|
|
272
|
+
id: minuteId,
|
|
273
|
+
mtId: String(row.mt_id ?? ''),
|
|
274
|
+
subject: String(row.mt_minutes_subject ?? ''),
|
|
275
|
+
content: String(row.parse_content || row.minutes_content || ''),
|
|
276
|
+
});
|
|
277
|
+
if (doc)
|
|
278
|
+
result.data.minuteDoc = doc;
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
catch (error) {
|
|
282
|
+
const message = String(error?.message ?? error).slice(0, 120);
|
|
283
|
+
result.warnings = [...(result.warnings ?? []), `纪要文档生成失败(正文不受影响):${message}`];
|
|
284
|
+
}
|
|
285
|
+
return result;
|
|
286
|
+
},
|
|
287
|
+
};
|
|
288
|
+
});
|
|
289
|
+
/** 兼容漏写 .eb 的纪要创建调用(模型常写 meeting.minute.create.prepare)。 */
|
|
290
|
+
const minuteCreateAliases = ebOperationsWithMinuteDoc
|
|
291
|
+
.filter((operation) => operation.name.startsWith('meeting.eb.minute.create.'))
|
|
292
|
+
.map((operation) => ({ ...operation, name: operation.name.replace('meeting.eb.', 'meeting.') }));
|
|
164
293
|
export const meetingEbOperations = [
|
|
165
|
-
...
|
|
166
|
-
preflight: ebAutoRoomPreflight,
|
|
167
|
-
afterWrite: ebAutoInvitationAfterWrite,
|
|
168
|
-
}),
|
|
294
|
+
...ebOperationsWithMinuteDoc,
|
|
169
295
|
...meetingEbConflictOperations,
|
|
170
296
|
...meetingEbDecisionOperations,
|
|
297
|
+
...decisionPublishAliases,
|
|
298
|
+
...minuteCreateAliases,
|
|
299
|
+
...meetingEbDecisionTaskBatchOperations,
|
|
171
300
|
...meetingEbScheduleOperations,
|
|
172
301
|
...meetingEbCrmOperations,
|
|
173
302
|
...meetingEbCreateFlowOperations,
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 自动补会议详情链接(2026-11-16 用户要求 B 方案)。
|
|
3
|
+
*
|
|
4
|
+
* 背景:文档要求"所有会议名称必须可点击",但模型经常忘调 `meeting.link`,
|
|
5
|
+
* 于是查询结果里会议名裸着。这里在返回层直接补 `url` 字段:
|
|
6
|
+
* - `meeting.eb.meeting.list` → 每行加 `url`
|
|
7
|
+
* - `meeting.eb.meeting.detail` → mainTable 加 `url`
|
|
8
|
+
* - 建会成功 → 返回里加 `meetingUrl`
|
|
9
|
+
*
|
|
10
|
+
* 只调**一次** `meeting.link`(批量 dataIds),失败只加 warning,不影响主结果。
|
|
11
|
+
*/
|
|
12
|
+
function collectIds(payload) {
|
|
13
|
+
const ids = [];
|
|
14
|
+
const push = (value) => {
|
|
15
|
+
const id = String(value ?? '').trim();
|
|
16
|
+
if (id !== '' && !ids.includes(id))
|
|
17
|
+
ids.push(id);
|
|
18
|
+
};
|
|
19
|
+
const rows = payload?.rows ?? payload?.items;
|
|
20
|
+
if (Array.isArray(rows)) {
|
|
21
|
+
for (const row of rows) {
|
|
22
|
+
const main = row?.mainTable ?? row;
|
|
23
|
+
push(main?.id ?? main?.mt_id ?? row?.id ?? row?.dataId);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const main = payload?.mainTable;
|
|
27
|
+
if (main && typeof main === 'object')
|
|
28
|
+
push(main.id ?? main.mt_id);
|
|
29
|
+
push(payload?.id);
|
|
30
|
+
if (payload?.data && typeof payload.data === 'object')
|
|
31
|
+
push(payload.data.id ?? payload.data.mt_id);
|
|
32
|
+
return ids;
|
|
33
|
+
}
|
|
34
|
+
export async function meetingUrlMap(env, ids) {
|
|
35
|
+
const out = new Map();
|
|
36
|
+
const unique = [...new Set(ids.map((id) => String(id).trim()).filter((id) => id !== ''))];
|
|
37
|
+
if (unique.length === 0)
|
|
38
|
+
return out;
|
|
39
|
+
try {
|
|
40
|
+
const { getMeetingOperation } = await import('../registry.js');
|
|
41
|
+
const link = getMeetingOperation('meeting.link');
|
|
42
|
+
const result = await link.handler({ type: 'meeting', dataIds: unique }, env);
|
|
43
|
+
const rows = (result?.data?.items ?? result?.data?.links ?? []);
|
|
44
|
+
for (const row of rows) {
|
|
45
|
+
const id = String(row?.dataId ?? row?.id ?? '').trim();
|
|
46
|
+
const url = String(row?.url ?? '').trim();
|
|
47
|
+
if (id && url)
|
|
48
|
+
out.set(id, url);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// 拿不到链接就不加,主结果照常返回
|
|
53
|
+
}
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
/** 给 list/detail 的返回值补 url(原地修改并返回)。 */
|
|
57
|
+
export async function attachMeetingUrls(env, payload) {
|
|
58
|
+
if (!payload || typeof payload !== 'object')
|
|
59
|
+
return payload;
|
|
60
|
+
const ids = collectIds(payload);
|
|
61
|
+
if (ids.length === 0)
|
|
62
|
+
return payload;
|
|
63
|
+
const map = await meetingUrlMap(env, ids);
|
|
64
|
+
if (map.size === 0)
|
|
65
|
+
return payload;
|
|
66
|
+
const apply = (row) => {
|
|
67
|
+
if (!row || typeof row !== 'object')
|
|
68
|
+
return;
|
|
69
|
+
const target = row.mainTable ?? row;
|
|
70
|
+
const id = String(target.id ?? target.mt_id ?? '').trim();
|
|
71
|
+
const url = map.get(id);
|
|
72
|
+
if (url && !target.url)
|
|
73
|
+
target.url = url;
|
|
74
|
+
};
|
|
75
|
+
if (Array.isArray(payload.rows))
|
|
76
|
+
payload.rows.forEach(apply);
|
|
77
|
+
if (Array.isArray(payload.items))
|
|
78
|
+
payload.items.forEach(apply);
|
|
79
|
+
apply(payload.mainTable);
|
|
80
|
+
apply(payload.data);
|
|
81
|
+
apply(payload);
|
|
82
|
+
return payload;
|
|
83
|
+
}
|
|
84
|
+
export async function meetingUrlFor(env, meetingId) {
|
|
85
|
+
const id = String(meetingId ?? '').trim();
|
|
86
|
+
if (!id)
|
|
87
|
+
return null;
|
|
88
|
+
const map = await meetingUrlMap(env, [id]);
|
|
89
|
+
return map.get(id) ?? null;
|
|
90
|
+
}
|
|
@@ -308,6 +308,11 @@ const meetingMinuteFromGroupChat = {
|
|
|
308
308
|
description: 'text=只拼原文写进纪要(默认,最快);minutes=继续调 ESB 生成纪要文案;document=再生成文档上传 OA',
|
|
309
309
|
},
|
|
310
310
|
employeeId: { type: 'string', description: 'ESB 触发人 id,省略时用当前登录人' },
|
|
311
|
+
with_doc: {
|
|
312
|
+
type: 'boolean',
|
|
313
|
+
description: '是否生成纪要 docx 并挂到 doc_file(默认 true)。系统不会根据正文自动出文档,'
|
|
314
|
+
+ '不生成的话纪要文件字段会一直空着;传 false 可跳过',
|
|
315
|
+
},
|
|
311
316
|
aiPageId: {
|
|
312
317
|
type: 'string',
|
|
313
318
|
description: '智能纪要页面 id(mt_minutes_ai_page)。省略时从该会议已有纪要反查',
|
|
@@ -605,6 +610,47 @@ const meetingMinuteFromGroupChat = {
|
|
|
605
610
|
const row = final?.data?.data ?? {};
|
|
606
611
|
result.finalStatus = textOf(row.minutes_status);
|
|
607
612
|
result.parseContentLength = textOf(row.parse_content).length;
|
|
613
|
+
// ⑧ 生成纪要 docx 并挂到 doc_file(默认开;with_doc:false 关)
|
|
614
|
+
if (args.with_doc !== false) {
|
|
615
|
+
const docStarted = Date.now();
|
|
616
|
+
try {
|
|
617
|
+
const { buildMinuteDocx } = await import('../minute-doc.js');
|
|
618
|
+
const { meetingStateDir } = await import('./env.js');
|
|
619
|
+
const { mkdir, writeFile } = await import('node:fs/promises');
|
|
620
|
+
const { join } = await import('node:path');
|
|
621
|
+
const body = textOf(row.parse_content) || textOf(row.minutes_content) || transcript;
|
|
622
|
+
const meta = [
|
|
623
|
+
`会议:${textOf(meeting.mt_name)}`,
|
|
624
|
+
...(meeting.begin_datetime
|
|
625
|
+
? [`时间:${textOf(meeting.begin_datetime)} ~ ${textOf(meeting.end_datetime)}`]
|
|
626
|
+
: []),
|
|
627
|
+
...(meeting.address ? [`地点:${textOf(meeting.address)}`] : []),
|
|
628
|
+
];
|
|
629
|
+
const buf = buildMinuteDocx({ title: subject, meta, content: body });
|
|
630
|
+
const dir = join(meetingStateDir(env.ctx), 'minute-docs');
|
|
631
|
+
await mkdir(dir, { recursive: true });
|
|
632
|
+
const filePath = join(dir, `${minuteId}.docx`);
|
|
633
|
+
await writeFile(filePath, buf);
|
|
634
|
+
const upload = await getMeetingOperation('meeting.attachment.upload').handler({ file: filePath, name: `${subject.replace(/[\\/:*?"<>|]+/g, '-')}.docx`, module: 'meeting', refId: mtId }, env);
|
|
635
|
+
const fileId = textOf(upload?.data?.fileId);
|
|
636
|
+
if (!fileId) {
|
|
637
|
+
warnings.push('纪要文档已生成但上传未返回 fileId,doc_file 仍为空');
|
|
638
|
+
}
|
|
639
|
+
else {
|
|
640
|
+
const updatePrepared = await getMeetingOperation('meeting.eb.minute.update.prepare').handler({ id: minuteId, mt_id: mtId, doc_file: fileId, mt_minutes: fileId, file_type: '0' }, env);
|
|
641
|
+
await getMeetingOperation('meeting.eb.minute.update.apply').handler({ confirm: true, continuation: updatePrepared?.data?.continuation }, env);
|
|
642
|
+
const afterDoc = await getMeetingOperation('meeting.eb.minute.detail').handler({ id: minuteId }, env);
|
|
643
|
+
const attached = textOf((afterDoc?.data?.data ?? {}).doc_file) === fileId;
|
|
644
|
+
result.minuteDoc = { fileId, name: `${subject}.docx`, size: buf.length, attached };
|
|
645
|
+
if (!attached)
|
|
646
|
+
warnings.push('纪要文档已上传,但 doc_file 回读为空(可能被服务端覆盖),可稍后重试');
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
catch (error) {
|
|
650
|
+
warnings.push(`纪要文档生成失败(正文不受影响):${String(error?.message ?? error).slice(0, 120)}`);
|
|
651
|
+
}
|
|
652
|
+
mark('minuteDoc', docStarted);
|
|
653
|
+
}
|
|
608
654
|
result.documentId = textOf(row.mt_minutes) || documentIdFromFlow || null;
|
|
609
655
|
result.timings = { ...timings, total: Date.now() - startedAt };
|
|
610
656
|
return meetingSuccess('meeting.minute.fromGroupChat', result, warnings.length > 0 ? { warnings } : undefined);
|
|
@@ -90,6 +90,11 @@ const meetingMinuteWriteContent = {
|
|
|
90
90
|
enum: ['0', '1', '2', '3', '4'],
|
|
91
91
|
description: '显式指定状态(一般不要传,交给自动规则)。传了以你为准',
|
|
92
92
|
},
|
|
93
|
+
with_doc: {
|
|
94
|
+
type: 'boolean',
|
|
95
|
+
description: '写完内容后是否生成 docx 并挂到 doc_file(默认 true)。系统不会根据正文自动出文档,'
|
|
96
|
+
+ '不生成纪要文件字段就一直空着;传 false 可跳过',
|
|
97
|
+
},
|
|
93
98
|
},
|
|
94
99
|
required: ['id', 'mt_id'],
|
|
95
100
|
},
|
|
@@ -150,6 +155,61 @@ const meetingMinuteWriteContent = {
|
|
|
150
155
|
if (textOf(after.minutes_content) !== textOf(patch.minutes_content ?? after.minutes_content)) {
|
|
151
156
|
warnings.push('minutes_content 回读与写入值不一致,建议人工核对(服务端可能做了富文本处理)');
|
|
152
157
|
}
|
|
158
|
+
// 纪要文件(doc_file)默认自动生成并挂上:writeContent 这条路径以前不生成文档,
|
|
159
|
+
// 导致"正文有内容、纪要文件字段空"(2026-11-16 真机)。
|
|
160
|
+
let minuteDoc = null;
|
|
161
|
+
if (args.with_doc !== false) {
|
|
162
|
+
try {
|
|
163
|
+
const { buildMinuteDocx } = await import('../minute-doc.js');
|
|
164
|
+
const { meetingStateDir } = await import('./env.js');
|
|
165
|
+
const { mkdir, writeFile } = await import('node:fs/promises');
|
|
166
|
+
const { join } = await import('node:path');
|
|
167
|
+
const subject = textOf(after.mt_minutes_subject).trim() || `会议纪要-${mtId}`;
|
|
168
|
+
const body = textOf(after.parse_content) || textOf(after.minutes_content);
|
|
169
|
+
const buf = buildMinuteDocx({ title: subject, meta: [`会议 id:${mtId}`], content: body });
|
|
170
|
+
const dir = join(meetingStateDir(env.ctx), 'minute-docs');
|
|
171
|
+
await mkdir(dir, { recursive: true });
|
|
172
|
+
const filePath = join(dir, `${id}.docx`);
|
|
173
|
+
await writeFile(filePath, buf);
|
|
174
|
+
const upload = await getMeetingOperation('meeting.attachment.upload').handler({ file: filePath, name: `${subject.replace(/[\\/:*?"<>|]+/g, '-')}.docx`, module: 'meeting', refId: mtId }, env);
|
|
175
|
+
const fileId = textOf(upload?.data?.fileId);
|
|
176
|
+
if (!fileId) {
|
|
177
|
+
warnings.push('纪要文档已生成但上传未返回 fileId,doc_file 仍为空');
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
const docPrepared = await getMeetingOperation('meeting.eb.minute.update.prepare').handler({ id, mt_id: mtId, doc_file: fileId, mt_minutes: fileId, file_type: '0', minutes_status: '2' }, env);
|
|
181
|
+
await getMeetingOperation('meeting.eb.minute.update.apply').handler({ confirm: true, continuation: docPrepared?.data?.continuation }, env);
|
|
182
|
+
const check = await readMinute(env, id);
|
|
183
|
+
const attached = textOf(check.doc_file) === fileId;
|
|
184
|
+
minuteDoc = { fileId, name: `${subject}.docx`, size: buf.length, attached };
|
|
185
|
+
if (!attached)
|
|
186
|
+
warnings.push('纪要文档已上传,但 doc_file 回读为空(可能被服务端覆盖),可稍后重试');
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
warnings.push(`纪要文档生成失败(正文不受影响):${String(error?.message ?? error).slice(0, 120)}`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// 统一走 ensureMinuteDoc:它会把 docx 同时发成"文档中心文档"并写 mt_minutes
|
|
194
|
+
// (mt_minutes 是文档组件,只认文档 id;塞附件 fileId 会被静默丢弃)。
|
|
195
|
+
if (args.with_doc !== false) {
|
|
196
|
+
try {
|
|
197
|
+
const { ensureMinuteDoc } = await import('../minute-doc.js');
|
|
198
|
+
const better = await ensureMinuteDoc(env, {
|
|
199
|
+
id,
|
|
200
|
+
mtId,
|
|
201
|
+
subject: textOf(after.mt_minutes_subject) || `会议纪要-${mtId}`,
|
|
202
|
+
content: textOf(after.parse_content) || textOf(after.minutes_content),
|
|
203
|
+
});
|
|
204
|
+
if (better)
|
|
205
|
+
minuteDoc = better;
|
|
206
|
+
if (better && better.docId === '')
|
|
207
|
+
warnings.push('纪要文档已挂到附件,但未生成文档中心文档(mt_minutes 可能仍为空)');
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
warnings.push(`纪要文档生成失败(正文不受影响):${String(error?.message ?? error).slice(0, 120)}`);
|
|
211
|
+
}
|
|
212
|
+
}
|
|
153
213
|
return meetingSuccess('meeting.minute.writeContent', {
|
|
154
214
|
id,
|
|
155
215
|
mtId,
|
|
@@ -163,6 +223,7 @@ const meetingMinuteWriteContent = {
|
|
|
163
223
|
videoTaskId: textOf(after.video_taskId),
|
|
164
224
|
videoTaskResult: textOf(after.video_taskResult),
|
|
165
225
|
applyResult: applied?.data ?? null,
|
|
226
|
+
...(minuteDoc ? { minuteDoc } : {}),
|
|
166
227
|
}, warnings.length > 0 ? { warnings } : undefined);
|
|
167
228
|
},
|
|
168
229
|
};
|
|
@@ -23,6 +23,8 @@ import { meetingQrOperations } from './qrcode.js';
|
|
|
23
23
|
import { meetingSummaryOperations } from './summary.js';
|
|
24
24
|
import { meetingFormFieldOperations } from './form-fields.js';
|
|
25
25
|
import { meetingEbOperations } from './eb/index.js';
|
|
26
|
+
import { meetingSelfCheckOperations } from './self-check.js';
|
|
27
|
+
import { meetingOutcomeComposeOperations } from './compose-outcome.js';
|
|
26
28
|
function buildRegistry() {
|
|
27
29
|
const registry = new Map();
|
|
28
30
|
const definitions = [
|
|
@@ -50,6 +52,8 @@ function buildRegistry() {
|
|
|
50
52
|
...meetingSummaryOperations,
|
|
51
53
|
...meetingFormFieldOperations,
|
|
52
54
|
...meetingEbOperations,
|
|
55
|
+
...meetingSelfCheckOperations,
|
|
56
|
+
...meetingOutcomeComposeOperations,
|
|
53
57
|
];
|
|
54
58
|
for (const definition of definitions) {
|
|
55
59
|
if (registry.has(definition.name)) {
|
|
@@ -66,7 +70,16 @@ export function meetingOperationDefinitions() {
|
|
|
66
70
|
export function getMeetingOperation(operation) {
|
|
67
71
|
const definition = meetingOperationRegistry.get(operation);
|
|
68
72
|
if (!definition) {
|
|
69
|
-
|
|
73
|
+
// 常见误用:EB 环境漏写 `.eb`(如 meeting.decision.publish)。直接给出正确操作名,
|
|
74
|
+
// 避免被调用方读成"接口不可用"而降级到更慢的手工链路。
|
|
75
|
+
const candidate = operation.startsWith('meeting.eb.')
|
|
76
|
+
? operation.replace('meeting.eb.', 'meeting.')
|
|
77
|
+
: operation.replace(/^meeting\./, 'meeting.eb.');
|
|
78
|
+
const prepareCandidate = `${operation}.prepare`;
|
|
79
|
+
const hint = meetingOperationRegistry.has(candidate)
|
|
80
|
+
? `;是否想用 ${candidate}?`
|
|
81
|
+
: (meetingOperationRegistry.has(prepareCandidate) ? `;该操作需要先 prepare 再 apply,试试 ${prepareCandidate} 和 ${operation}.apply` : '');
|
|
82
|
+
throw meetingValidationError('operation_unknown', `会议模块不支持操作:${operation}${hint}`);
|
|
70
83
|
}
|
|
71
84
|
return definition;
|
|
72
85
|
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 自检:一眼确认"小E 到底跑的哪版 CLI、有没有今天这批能力"。
|
|
3
|
+
* 版本号可能被复用(同号不同码),所以同时报能力清单,避免再靠猜。
|
|
4
|
+
*/
|
|
5
|
+
import { readFileSync } from 'node:fs';
|
|
6
|
+
import { packagePath } from '../../../core/package-paths.js';
|
|
7
|
+
import { hasMeetingOperation } from './registry.js';
|
|
8
|
+
import { meetingSuccess } from './types.js';
|
|
9
|
+
const selfCheck = {
|
|
10
|
+
name: 'meeting.selfCheck',
|
|
11
|
+
resource: 'self',
|
|
12
|
+
method: 'selfCheck',
|
|
13
|
+
action: 'meeting.selfCheck',
|
|
14
|
+
summary: '自检:返回 CLI 版本与关键能力清单(判断"是不是最新包"用这个,不要只看版本号)',
|
|
15
|
+
capability: 'read',
|
|
16
|
+
risk: 'read',
|
|
17
|
+
inputSchema: { type: 'object', additionalProperties: false, properties: {} },
|
|
18
|
+
handler: async () => {
|
|
19
|
+
let version = '0.0.0';
|
|
20
|
+
try {
|
|
21
|
+
const pkg = JSON.parse(readFileSync(packagePath('package.json'), 'utf-8'));
|
|
22
|
+
version = String(pkg.version ?? '0.0.0');
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
version = '0.0.0';
|
|
26
|
+
}
|
|
27
|
+
// 不看版本号(版本号由发布方维护,可能不变),直接看操作在不在
|
|
28
|
+
const capabilities = {
|
|
29
|
+
composeOutcome: hasMeetingOperation('meeting.outcome.compose'),
|
|
30
|
+
deleteTasksWithDecision: hasMeetingOperation('meeting.eb.decisionTask.deleteMany'),
|
|
31
|
+
selfCheck: hasMeetingOperation('meeting.selfCheck'),
|
|
32
|
+
minuteCreateAlias: hasMeetingOperation('meeting.minute.create.prepare'),
|
|
33
|
+
decisionPublishAlias: hasMeetingOperation('meeting.decision.publish.prepare'),
|
|
34
|
+
memberExpand: hasMeetingOperation('meeting.member.expand'),
|
|
35
|
+
};
|
|
36
|
+
const missing = Object.entries(capabilities)
|
|
37
|
+
.filter(([, ok]) => !ok)
|
|
38
|
+
.map(([name]) => name);
|
|
39
|
+
return meetingSuccess('meeting.selfCheck', {
|
|
40
|
+
version,
|
|
41
|
+
capabilities,
|
|
42
|
+
verdict: missing.length === 0
|
|
43
|
+
? '已是最新能力集'
|
|
44
|
+
: `缺少 ${missing.length} 项较早能力,建议升级 CLI(当前 ${version})`,
|
|
45
|
+
note: '判断是否最新请看 capabilities 全为 true,不要只看版本号(同号可能是不同构建)',
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
export const meetingSelfCheckOperations = [selfCheck];
|
|
@@ -44,6 +44,8 @@ export const WORKFLOW_ENDPOINTS = {
|
|
|
44
44
|
TODO_LIST: '/api/workflow/list/data/getTodoListData',
|
|
45
45
|
/** 待办分组计数(按工作流/参与节点/参与身份三元组) */
|
|
46
46
|
TODO_GROUP_STAT: '/api/workflow/list/count/getTodoGroupCount',
|
|
47
|
+
/** 智能分组:AI 待办汇总产物落库(返回落库主键 id;2026-11-13 用户定稿) */
|
|
48
|
+
SMART_GROUP_ADD: '/api/workflow/list/smartgroup/add',
|
|
47
49
|
/** 已办总数 / 列表 */
|
|
48
50
|
DONE_TOTAL: '/api/workflow/list/total/getDoneListTotal',
|
|
49
51
|
DONE_LIST: '/api/workflow/list/data/getDoneListData',
|