weaver-work-cli 0.1.54 → 0.1.56
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-V6KD4TZE.js} +4 -3
- 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/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/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/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
|
@@ -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',
|
|
@@ -323,6 +323,28 @@ const SYSTEM_FIELDS = {
|
|
|
323
323
|
creatordept: { endpoint: WORKFLOW_ENDPOINTS.DEPT_BROWSER, extra: { browserMultiple: true } },
|
|
324
324
|
creatorsubcom: { endpoint: WORKFLOW_ENDPOINTS.SUBCOMPANY_BROWSER, extra: { browserMultiple: true } },
|
|
325
325
|
workflowtype: { endpoint: WORKFLOW_ENDPOINTS.WORKFLOW_TYPE_BROWSER, extra: { browserMultiple: true } },
|
|
326
|
+
// 未操作者 / 来源:服务端 RequestListSearchAdItemEnum 里都是 BROWSER / SINGLE_BROWSER_SELECT 的
|
|
327
|
+
// 人员浏览按钮(与 creator 同款控件)⇒ 报文形态同 creator:`[{browserDatas:[{id,name}]}]`。
|
|
328
|
+
unoperator: {
|
|
329
|
+
endpoint: WORKFLOW_ENDPOINTS.RESOURCE_BROWSER,
|
|
330
|
+
extra: {
|
|
331
|
+
browserMultiple: true,
|
|
332
|
+
authWecahtBook: false,
|
|
333
|
+
wxDepNeedConvertCount: 0,
|
|
334
|
+
wxEmpNeedConvertCount: 0,
|
|
335
|
+
wxTotalNeedConvertCount: 0,
|
|
336
|
+
},
|
|
337
|
+
},
|
|
338
|
+
sourceUserid: {
|
|
339
|
+
endpoint: WORKFLOW_ENDPOINTS.RESOURCE_BROWSER,
|
|
340
|
+
extra: {
|
|
341
|
+
browserMultiple: true,
|
|
342
|
+
authWecahtBook: false,
|
|
343
|
+
wxDepNeedConvertCount: 0,
|
|
344
|
+
wxEmpNeedConvertCount: 0,
|
|
345
|
+
wxTotalNeedConvertCount: 0,
|
|
346
|
+
},
|
|
347
|
+
},
|
|
326
348
|
};
|
|
327
349
|
/**
|
|
328
350
|
* 调 browser complete 做名称转 ID,返回**全部**候选 `{id, name}`(0/1/多)。
|
|
@@ -364,6 +386,50 @@ async function resolveNameCandidates(env, config, keyword) {
|
|
|
364
386
|
}
|
|
365
387
|
/** 发起人自称词(= 当前用户,跳过名称匹配;来源:Python SELF_KEYWORDS)。 */
|
|
366
388
|
const CREATOR_SELF_TERMS = new Set(['我', '我的', '本人', '我自己', '当前用户', '自己']);
|
|
389
|
+
/** 部门/分部自称词(2026-11-15 用户定稿):creatorDept/creatorSubcom 支持「我的部门/本部门」「我的分部/本分部」。 */
|
|
390
|
+
const DEPT_SELF_TERMS = new Set(['我的部门', '本部门', '我部门']);
|
|
391
|
+
const SUBCOM_SELF_TERMS = new Set(['我的分部', '本分部', '我分部']);
|
|
392
|
+
const isSelfTerm = (raw, terms) => {
|
|
393
|
+
const text = asString(raw);
|
|
394
|
+
return Boolean(text) && terms.has(String(text).trim());
|
|
395
|
+
};
|
|
396
|
+
/** 当前登录人 userId(「我」语义的人员条件直接用;惰性取一次会话,缺失即报错停止)。 */
|
|
397
|
+
async function selfUserId(env) {
|
|
398
|
+
const session = await env.host.getSession();
|
|
399
|
+
const userId = asString(session.userId);
|
|
400
|
+
if (!userId) {
|
|
401
|
+
throw workflowValidationError('self_user_missing', '当前会话未提供登录人 userId,无法把「我」条件解析成当前登录人。');
|
|
402
|
+
}
|
|
403
|
+
return userId;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* 「我的部门/本分部」类自称词 → 当前登录人部门/分部 ID。
|
|
407
|
+
*
|
|
408
|
+
* 会话里存的是名称(如「开发组」),走同款浏览按钮解析成 ID;找不到唯一命中即报错停止
|
|
409
|
+
* (静默丢弃会让「本部门发起的」退化成全量查询)。
|
|
410
|
+
*/
|
|
411
|
+
async function selfOrgId(env, systemKey, label) {
|
|
412
|
+
const session = await env.host.getSession();
|
|
413
|
+
const orgName = asString(systemKey === 'creatordept' ? session.department : session.subcompany);
|
|
414
|
+
if (!orgName) {
|
|
415
|
+
throw workflowValidationError('self_org_missing', `当前会话未提供登录人${label}信息,无法把「${label}」条件解析成当前登录人${label}。`);
|
|
416
|
+
}
|
|
417
|
+
const candidates = await resolveNameCandidates(env, SYSTEM_FIELDS[systemKey], orgName);
|
|
418
|
+
const exact = candidates.filter((item) => item.name.trim() === orgName.trim());
|
|
419
|
+
const hit = exact[0] ?? (candidates.length === 1 ? candidates[0] : null);
|
|
420
|
+
if (!hit) {
|
|
421
|
+
throw workflowValidationError('self_org_not_resolved', `登录人${label}「${orgName}」${candidates.length > 1 ? `匹配到 ${candidates.length} 个候选,无法唯一定位` : '未匹配到任何对象'},`
|
|
422
|
+
+ `无法生成「我的${label}」条件。本次查询已停止。`, candidates.length > 1 ? { candidates: clarificationCandidates(candidates, 10) } : undefined);
|
|
423
|
+
}
|
|
424
|
+
return hit;
|
|
425
|
+
}
|
|
426
|
+
/** 部门/分部条件统一入口:自称词(我的部门/本部门/我的分部/本分部)走会话解析,否则走名称解析。 */
|
|
427
|
+
async function resolveSelfOrgOrTerm(env, rawValue, systemKey, label, selfTerms) {
|
|
428
|
+
if (isSelfTerm(rawValue, selfTerms)) {
|
|
429
|
+
return selfOrgId(env, systemKey, label.replace('发起人', ''));
|
|
430
|
+
}
|
|
431
|
+
return resolveTerm(env, systemKey, rawValue, label);
|
|
432
|
+
}
|
|
367
433
|
/**
|
|
368
434
|
* 系统字段 → 澄清标识(对齐 V11.3 `name2id_clarification`,L8244:
|
|
369
435
|
* `clarificationType = f"system_relate_name2id_{system_field}"`)。
|
|
@@ -377,6 +443,8 @@ const SYSTEM_CLARIFICATION_TYPES = {
|
|
|
377
443
|
creatordept: 'system_relate_name2id_creatordept',
|
|
378
444
|
creatorsubcom: 'system_relate_name2id_creatorsubcom',
|
|
379
445
|
workflowtype: 'system_relate_name2id_workflowtype',
|
|
446
|
+
unoperator: 'system_relate_name2id_unoperator',
|
|
447
|
+
sourceUserid: 'system_relate_name2id_sourceUserid',
|
|
380
448
|
};
|
|
381
449
|
/** 候选 → 澄清载荷(`display` 即用户确认后回传的 `名称(ID)` 格式)。 */
|
|
382
450
|
function clarificationCandidates(items, limit) {
|
|
@@ -991,15 +1059,42 @@ export async function buildSearchQuery(env, args, mode) {
|
|
|
991
1059
|
const formDatas = { ...compact(query.searchParams?.formDatas || {}) };
|
|
992
1060
|
// 发起人 / 发起人部门 / 发起人分部 / 工作流类型 / 工作流(支持 "名称(ID)" 直取或多值)
|
|
993
1061
|
// 解析失败一律抛错,不静默丢弃条件(否则条件不生效会退化为全量查询)
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1062
|
+
// 「我」语义(2026-11-15 用户定稿):值为「我/我的/本人/当前用户/自己」⇒ 当前登录人。
|
|
1063
|
+
// creator 用服务端原生 hrmOpt:"currentUser"(RequestListSearchAdUtil 实证:走 getCreatorIds,自动含兼岗判断);
|
|
1064
|
+
// unoperator/sourceUserid 服务端无 hrmOpt 特判 ⇒ CLI 直接把当前 userId 填进 browserDatas。
|
|
1065
|
+
if (isSelfTerm(args.creator, CREATOR_SELF_TERMS)) {
|
|
1066
|
+
formDatas.creator = [{ browserDatas: [{ id: 'currentUser', name: '我' }], hrmOpt: 'currentUser' }];
|
|
1067
|
+
}
|
|
1068
|
+
else {
|
|
1069
|
+
const creator = await resolveTerm(env, 'creator', args.creator, '发起人');
|
|
1070
|
+
if (creator)
|
|
1071
|
+
formDatas.creator = [{ browserDatas: [{ id: creator.id, name: creator.name }] }];
|
|
1072
|
+
}
|
|
1073
|
+
const creatorDept = await resolveSelfOrgOrTerm(env, args.creatorDept, 'creatordept', '发起人部门', DEPT_SELF_TERMS);
|
|
998
1074
|
if (creatorDept)
|
|
999
1075
|
formDatas.creatordept = [{ browserDatas: [{ id: creatorDept.id, name: creatorDept.name }] }];
|
|
1000
|
-
const creatorSubcom = await
|
|
1076
|
+
const creatorSubcom = await resolveSelfOrgOrTerm(env, args.creatorSubcom, 'creatorsubcom', '发起人分部', SUBCOM_SELF_TERMS);
|
|
1001
1077
|
if (creatorSubcom)
|
|
1002
1078
|
formDatas.creatorsubcom = [{ browserDatas: [{ id: creatorSubcom.id, name: creatorSubcom.name }] }];
|
|
1079
|
+
// 未操作者 / 来源(2026-11-15 用户定稿新增):服务端 RequestListSearchAdItemEnum 均为
|
|
1080
|
+
// BROWSER/SINGLE_BROWSER_SELECT 人员浏览按钮 ⇒ 报文与 creator 同款 `[{browserDatas:[{id,name}]}]`。
|
|
1081
|
+
// 支持「我」⇒ 当前登录人 userId。
|
|
1082
|
+
if (isSelfTerm(args.unoperator, CREATOR_SELF_TERMS)) {
|
|
1083
|
+
formDatas.unoperator = [{ browserDatas: [{ id: await selfUserId(env), name: '我' }] }];
|
|
1084
|
+
}
|
|
1085
|
+
else {
|
|
1086
|
+
const unoperator = await resolveTerm(env, 'unoperator', args.unoperator, '未操作者');
|
|
1087
|
+
if (unoperator)
|
|
1088
|
+
formDatas.unoperator = [{ browserDatas: [{ id: unoperator.id, name: unoperator.name }] }];
|
|
1089
|
+
}
|
|
1090
|
+
if (isSelfTerm(args.sourceUserid, CREATOR_SELF_TERMS)) {
|
|
1091
|
+
formDatas.sourceUserid = [{ browserDatas: [{ id: await selfUserId(env), name: '我' }] }];
|
|
1092
|
+
}
|
|
1093
|
+
else {
|
|
1094
|
+
const sourceUserid = await resolveTerm(env, 'sourceUserid', args.sourceUserid, '来源');
|
|
1095
|
+
if (sourceUserid)
|
|
1096
|
+
formDatas.sourceUserid = [{ browserDatas: [{ id: sourceUserid.id, name: sourceUserid.name }] }];
|
|
1097
|
+
}
|
|
1003
1098
|
const workflowType = await resolveTerm(env, 'workflowtype', args.workflowType, '工作流类型');
|
|
1004
1099
|
if (workflowType)
|
|
1005
1100
|
formDatas.workflowtype = [{ browserDatas: [{ id: workflowType.id, name: workflowType.name }] }];
|
|
@@ -1050,6 +1145,13 @@ export async function buildSearchQuery(env, args, mode) {
|
|
|
1050
1145
|
const term = asString(args.requestMarkTerm) || 'like';
|
|
1051
1146
|
formDatas.requestmark = [{ content: requestMark, term }];
|
|
1052
1147
|
}
|
|
1148
|
+
// 发起人工号(2026-11-15 用户定稿新增):服务端 RequestListSearchAdItemEnum 为 INPUT/INPUT_TEXT
|
|
1149
|
+
// ⇒ 文本条件,报文与 requestname/requestmark 同款 `[{content, term}]`。
|
|
1150
|
+
const creatorCode = asString(args.creatorcode);
|
|
1151
|
+
if (creatorCode) {
|
|
1152
|
+
const term = asString(args.creatorcodeTerm) || 'like';
|
|
1153
|
+
formDatas.creatorcode = [{ content: creatorCode, term }];
|
|
1154
|
+
}
|
|
1053
1155
|
// 紧急程度
|
|
1054
1156
|
const requestLevel = await resolveRequestLevel(env, args.requestLevel);
|
|
1055
1157
|
if (requestLevel)
|
|
@@ -1600,9 +1702,13 @@ const workflowSearch = {
|
|
|
1600
1702
|
tabid: { type: 'string', description: '细分子类 tabid' },
|
|
1601
1703
|
tabName: { type: 'string', description: '细分子类名称' },
|
|
1602
1704
|
subCategory: { type: 'string', description: '细分子类名称或 tabid' },
|
|
1603
|
-
creator: { type: 'string', description: '发起人姓名,支持 "名称(ID)"
|
|
1604
|
-
creatorDept: { type: 'string', description: '
|
|
1605
|
-
creatorSubcom: { type: 'string', description: '
|
|
1705
|
+
creator: { type: 'string', description: '发起人姓名,支持 "名称(ID)";支持 "我"(=当前登录人);纯名称多命中返回澄清候选,0 命中报错(对齐 V11.3)' },
|
|
1706
|
+
creatorDept: { type: 'string', description: '发起人部门;支持 "我的部门"/"本部门"(=当前登录人部门);纯名称多命中返回澄清候选,0 命中报错' },
|
|
1707
|
+
creatorSubcom: { type: 'string', description: '发起人分部;支持 "我的分部"/"本分部"(=当前登录人分部);纯名称多命中返回澄清候选,0 命中报错' },
|
|
1708
|
+
unoperator: { type: 'string', description: '未操作者姓名(人员浏览按钮条件),支持 "名称(ID)" 与 "我"(=当前登录人);纯名称多命中返回澄清候选,0 命中报错' },
|
|
1709
|
+
sourceUserid: { type: 'string', description: '来源(人员浏览按钮条件),支持 "名称(ID)" 与 "我"(=当前登录人);纯名称多命中返回澄清候选,0 命中报错' },
|
|
1710
|
+
creatorcode: { type: 'string', description: '发起人工号(文本条件)' },
|
|
1711
|
+
creatorcodeTerm: { type: 'string', enum: ['in', 'notin', 'eq', 'ne'] },
|
|
1606
1712
|
workflowType: { type: 'string', description: '工作流类型;纯名称多命中返回澄清候选,0 命中报错' },
|
|
1607
1713
|
workflow: { type: 'array', items: { type: 'string' }, description: '工作流条件,多个 or;支持 "名称(ID)";纯名称未匹配到/匹配到多个且无全名精确匹配时返回澄清(候选见 candidates),确认后由你按「名称(ID)」重发(只问用户完整名称,不要向用户索取 ID)' },
|
|
1608
1714
|
workflowTerm: { type: 'string', enum: ['in', 'notin'] },
|