weaver-work-cli 0.1.63 → 0.1.65
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-BLDYBZDX.js → archive-WUZKAEZ6.js} +2 -2
- package/dist/chunks/{archive-oa-3GJ3TWXR.js → archive-oa-PN46RTI2.js} +2 -2
- package/dist/chunks/{asset-AFXJN4CK.js → asset-ZPC5VWZM.js} +2 -2
- package/dist/chunks/{asset-idle-VUJXWGWJ.js → asset-idle-DHGP3NYY.js} +2 -2
- package/dist/chunks/{attachment-content-VMJA7NSQ.js → attachment-content-QUM27QNB.js} +3 -3
- package/dist/chunks/{blog-EREB35VU.js → blog-JC47AIXK.js} +2 -2
- package/dist/chunks/{caizhilian-ATM2JO5S.js → caizhilian-IKIHM77A.js} +4 -4
- package/dist/chunks/{calendar-E26ZIH7S.js → calendar-GZTSJ57Y.js} +2 -2
- package/dist/chunks/{chunk-OMAGCLUE.js → chunk-26FCCU5O.js} +2 -2
- package/dist/chunks/{chunk-EOZHSNND.js → chunk-3W5NMGDS.js} +2 -2
- package/dist/chunks/{chunk-SHBDXEUE.js → chunk-6AW5LW4T.js} +4 -4
- package/dist/chunks/{chunk-C5PIGPGX.js → chunk-6T5X6YWX.js} +2 -2
- package/dist/chunks/{chunk-WPBZQVLS.js → chunk-AFZTMYGC.js} +1 -1
- package/dist/chunks/{chunk-LOVAIGM2.js → chunk-CUY64WP4.js} +50 -50
- package/dist/chunks/{chunk-IGICM3WJ.js → chunk-D6SWOUUP.js} +2 -2
- package/dist/chunks/{chunk-BY3WDJO5.js → chunk-E3OQSNF5.js} +1 -1
- package/dist/chunks/{chunk-G3ZM57PD.js → chunk-F4ME3CGS.js} +2 -2
- package/dist/chunks/{chunk-6VCQLZXE.js → chunk-FDBAFANU.js} +1 -0
- package/dist/chunks/{chunk-RV2JAA5I.js → chunk-FJUOUSV3.js} +1 -1
- package/dist/chunks/{chunk-6G2JARDK.js → chunk-HLT6B26P.js} +1 -1
- package/dist/chunks/{chunk-THMBDCRA.js → chunk-HWA2A25Y.js} +2 -2
- package/dist/chunks/{chunk-HEJPVXD3.js → chunk-IJDZ7VDC.js} +4 -4
- package/dist/chunks/{chunk-GOBNIGWS.js → chunk-IT3SB7RV.js} +89 -16
- package/dist/chunks/{chunk-TNFIUZ4H.js → chunk-JDZOYHAL.js} +1 -1
- package/dist/chunks/{chunk-QZYKZ7MQ.js → chunk-K7QKQRSL.js} +155 -57
- package/dist/chunks/{chunk-QAMIIFP6.js → chunk-LRK7YND4.js} +11 -11
- package/dist/chunks/{chunk-4OB22YKE.js → chunk-NZLFKBEM.js} +6 -6
- package/dist/chunks/{chunk-RR45ELVE.js → chunk-Q6D6PSMH.js} +2 -2
- package/dist/chunks/{chunk-5CY37VLS.js → chunk-QT7GGCSY.js} +45 -43
- package/dist/chunks/{chunk-GQK6WLOS.js → chunk-VLY5RTVO.js} +2 -2
- package/dist/chunks/{chunk-SDPC7BG2.js → chunk-WSHIOSGM.js} +2 -2
- package/dist/chunks/{chunk-I4C2KR2G.js → chunk-ZV3TYANI.js} +1 -1
- package/dist/chunks/{conflict-AMNTM3FV.js → conflict-76ZUL3E7.js} +2 -2
- package/dist/chunks/{contract-PLO2V2NO.js → contract-INMS7SYQ.js} +846 -199
- package/dist/chunks/{cowork-FZAXE6FO.js → cowork-34CBYVQP.js} +2 -2
- package/dist/chunks/{create-flow-2DAUN7HU.js → create-flow-7WGKLRHH.js} +8 -6
- package/dist/chunks/{data-7NXMWET4.js → data-QKWI5325.js} +13 -2
- package/dist/chunks/{ebuilder-form-DEYHX6M7.js → ebuilder-form-ZONRROK4.js} +3 -3
- package/dist/chunks/{ehr-QQH2DYYA.js → ehr-2CONM7R6.js} +2 -2
- package/dist/chunks/{entry-mode-2JTVEKMP.js → entry-mode-3UMMMK6Z.js} +3 -3
- package/dist/chunks/{env-2JZMXC6I.js → env-7EGXNZR2.js} +2 -2
- package/dist/chunks/{esb-I5ZFHJUK.js → esb-FQASCY2H.js} +4 -4
- package/dist/chunks/{factory-XIATYHU6.js → factory-BDERKTYX.js} +1 -1
- package/dist/chunks/{fna-3V2TL6B2.js → fna-FCLVIWAS.js} +2 -2
- package/dist/chunks/{group-chat-CVYUZCOQ.js → group-chat-4E7EZMTJ.js} +3 -3
- package/dist/chunks/{host-CBONEAZS.js → host-2ED2KC4X.js} +3 -3
- package/dist/chunks/{host-4DP7C7YQ.js → host-2UYZEY2V.js} +3 -3
- package/dist/chunks/{host-4KQCAEWA.js → host-46NYKDQP.js} +3 -3
- package/dist/chunks/{host-BD7NAM33.js → host-7IPZKIM4.js} +3 -3
- package/dist/chunks/{host-L37QVNIV.js → host-P7G22WNM.js} +3 -3
- package/dist/chunks/{host-4X2F3JPQ.js → host-XLCBLNJD.js} +3 -3
- package/dist/chunks/{hrm-OL3IKN7C.js → hrm-XKL27NX2.js} +3 -3
- package/dist/chunks/{im-YXQWUF3R.js → im-NDYIMASG.js} +3 -3
- package/dist/chunks/{invoice-4WY32PR2.js → invoice-MOGNB6HN.js} +3 -3
- package/dist/chunks/{jiuchuanhui-L6SHLONH.js → jiuchuanhui-3T5X7SB7.js} +2 -2
- package/dist/chunks/{lazy-dispatch-OYE6QV24.js → lazy-dispatch-4WOIL3ZQ.js} +4 -4
- package/dist/chunks/{mail-PZV2KNRU.js → mail-P7VMUKQW.js} +2 -2
- package/dist/chunks/{meeting-6SOBCC6N.js → meeting-2FMYZXG5.js} +13 -13
- package/dist/chunks/{minute-doc-KSJSJNOH.js → minute-doc-3DHMYMBE.js} +4 -4
- package/dist/chunks/{okr-B76FW5M2.js → okr-VZXRQGS4.js} +2 -2
- package/dist/chunks/{operations-YOMEGFLV.js → operations-MI2BSKZX.js} +4 -4
- package/dist/chunks/{performance-4VBKUPFO.js → performance-OPEQNW7Y.js} +870 -15
- package/dist/chunks/{plan-HBNZRQTI.js → plan-TJAS4N5X.js} +2 -2
- package/dist/chunks/{project-IV6FWK74.js → project-CYBGU6K6.js} +2 -2
- package/dist/chunks/{reception-BR5YURT6.js → reception-3FT2F66K.js} +2 -2
- package/dist/chunks/{recruit-stage-4HQ6OGXT.js → recruit-stage-WPGB5BDJ.js} +2 -2
- package/dist/chunks/{registry-JFQEFC7E.js → registry-6UGQO35C.js} +2 -2
- package/dist/chunks/{registry-MZJQX65Q.js → registry-QRMXRSCT.js} +4 -4
- package/dist/chunks/{registry-7LICMV5J.js → registry-XXFMYPBM.js} +12 -12
- package/dist/chunks/{room-recommend-43GLLE7Y.js → room-recommend-7LD2OHL5.js} +4 -4
- package/dist/chunks/{schedule-ZQ42BEW6.js → schedule-ZAYMZKTQ.js} +4 -4
- package/dist/chunks/{smart-extract-QKAEAZGM.js → smart-extract-FOBSVNYW.js} +2 -2
- package/dist/chunks/{workflow-6HV7H5PC.js → workflow-NYJJIT3D.js} +4 -4
- package/dist/index.js +33 -33
- package/dist/internal/e10/auth/commands.js +182 -43
- package/dist/shortcuts/contract/error-actions.js +112 -0
- package/dist/shortcuts/contract/errors.js +9 -1
- package/dist/shortcuts/contract/manifest.js +18 -7
- package/dist/shortcuts/contract/operations/docx-slots.js +112 -5
- package/dist/shortcuts/contract/operations/docx-verify.js +2 -70
- package/dist/shortcuts/contract/operations/elements-build.js +82 -56
- package/dist/shortcuts/contract/operations/elements-spec.js +140 -3
- package/dist/shortcuts/contract/operations/ledger-card.js +25 -2
- package/dist/shortcuts/contract/operations/ledger.js +33 -5
- package/dist/shortcuts/contract/operations/money.js +90 -0
- package/dist/shortcuts/contract/operations/placeholder-scan.js +104 -0
- package/dist/shortcuts/contract/operations/quote-recognize.js +54 -17
- package/dist/shortcuts/contract/operations/quote-ref.js +179 -0
- package/dist/shortcuts/contract/operations/quote-submit.js +20 -3
- package/dist/shortcuts/contract/operations/quote.js +66 -12
- package/dist/shortcuts/contract/operations/solutions-spec.js +79 -0
- package/dist/shortcuts/contract/operations/triage.js +55 -9
- package/dist/shortcuts/data/operations/shared.js +14 -1
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +25 -11
- package/dist/shortcuts/performance/flow-utils.js +363 -0
- package/dist/shortcuts/performance/manifest.js +2 -2
- package/dist/shortcuts/performance/operations/flow-detail.js +85 -0
- package/dist/shortcuts/performance/operations/flow-list.js +213 -0
- package/dist/shortcuts/performance/operations/flow-score.js +241 -0
- package/dist/shortcuts/performance/operations/registry.js +6 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.categoryCounts.js +64 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +15 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +4 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +4 -0
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +4 -0
- package/docs/e10-auth.md +27 -2
- package/package.json +1 -1
- package/skills/weaver-e10-jinchengda/SKILL.md +87 -39
- package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +29 -29
- package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +29 -7
- package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +3 -3
- package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +5 -5
- package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +22 -25
- package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +53 -314
- package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +6 -5
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +19 -11
- package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +3 -3
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +43 -25
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +103 -212
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +7 -7
- package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +7 -6
- package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +34 -21
- package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +6 -6
- package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +3 -3
- package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +6 -6
- package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +22 -22
- package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +21 -19
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +6 -5
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +132 -95
- package/skills/weaver-e10-jinchengda/references/contract-request-status.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-request-write.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +12 -12
- package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +1 -1
- package/skills/weaver-e10-jinchengda/references/orchestration.md +5 -5
- package/skills/weaver-e10-meeting/SKILL.md +8 -7
- package/skills/weaver-e10-meeting/references/create-commands.md +2 -2
- package/skills/weaver-e10-meeting/references/create-flow.md +6 -6
- package/skills/weaver-e10-meeting/references/create-guardrails.md +10 -10
- package/skills/weaver-e10-meeting/references/invitation.md +1 -1
- package/skills/weaver-e10-meeting/references/meeting-eb.md +26 -26
- package/skills/weaver-e10-meeting/references/meeting-invitation.md +2 -2
- package/skills/weaver-e10-meeting/references/meeting-minute-file.md +2 -2
- package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
- package/skills/weaver-e10-performance/SKILL.md +45 -5
- package/skills/weaver-e10-performance/agents/openai.yaml +26 -2
- package/skills/weaver-e10-performance/references/flow-api.md +128 -0
- package/skills/weaver-e10-performance/references/flow-assess.md +149 -0
- package/skills/weaver-e10-workflow/SKILL.md +40 -16
- package/skills/weaver-e10-workflow/aigroup/default.json +1 -1
- package/skills/weaver-e10-workflow/references/todo-dialogue.md +30 -27
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +90 -22
- package/skills/weaver-e10-workflow/references/workflow-view.md +18 -2
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +240 -43
- package/skills/weaver-e10-yimiaoban/SKILL.md +8 -5
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
|
@@ -115,6 +115,7 @@ function cliEnv() {
|
|
|
115
115
|
// schema 不可用时使用既有协议;业务阶段仍只执行一次,失败直接交给原有错误处理。
|
|
116
116
|
let outputModeCapability;
|
|
117
117
|
let prepareQueryCapability = false;
|
|
118
|
+
let categoryCountsCapability = false;
|
|
118
119
|
function supportsOutputMode() {
|
|
119
120
|
if (outputModeCapability !== undefined) return outputModeCapability;
|
|
120
121
|
outputModeCapability = false;
|
|
@@ -134,6 +135,7 @@ function supportsOutputMode() {
|
|
|
134
135
|
outputModeCapability = Array.isArray(modes) && modes.includes('query') && modes.includes('summary');
|
|
135
136
|
prepareQueryCapability = Array.isArray(schema?.properties?.stage?.enum)
|
|
136
137
|
&& schema.properties.stage.enum.includes('prepareQuery');
|
|
138
|
+
categoryCountsCapability = schema?.properties?.includeCategoryCounts?.type === 'boolean';
|
|
137
139
|
}
|
|
138
140
|
} catch {
|
|
139
141
|
// 仅 schema 读取失败允许兼容既有协议;不要捕获或重试任何真实业务调用。
|
|
@@ -324,9 +326,11 @@ function resolveBaseUrl(state, dir) {
|
|
|
324
326
|
|
|
325
327
|
/**
|
|
326
328
|
* 把最终三键对象包成 browsertool 组件载荷(用户 2026-10-27 要求;2026-11-13 改为 id 传参)。
|
|
327
|
-
* -
|
|
329
|
+
* - 每轮组件使用唯一 callId/panelKey;本轮工作流分布、分类及全部链接共用 callId,
|
|
330
|
+
* 按过滤目标派生不同 panelKey,更新已注册实例;
|
|
331
|
+
* toolId 固定 fill_form;
|
|
328
332
|
* - `arguments` 层新增 `displayMode: "tabs"` 与 `panelKey`(2026-11-10 用户要求,层级同 title/src):
|
|
329
|
-
* panelKey = `todo_summary_
|
|
333
|
+
* panelKey = `todo_summary_<当前时间戳>_<随机串>`,独立查询使用不同面板;
|
|
330
334
|
* - 摘要的 `params.data` 带 `{"id": "<smartgroup/add 落库返回的主键>"}`(2026-11-13 用户定稿,
|
|
331
335
|
* 取代旧的 `params.data.dataSource` 本地服务地址)。id 按服务端响应的**原样数字串**内嵌
|
|
332
336
|
* (字符串形态,防雪花 id 超出 JS Number 安全整数范围丢精度);组件侧拿 id 走服务端读回链路;
|
|
@@ -336,13 +340,20 @@ function resolveBaseUrl(state, dir) {
|
|
|
336
340
|
*/
|
|
337
341
|
function wrapBrowseToolPayload(baseUrl, smartGroupId, title = '待办摘要汇总', options = {}) {
|
|
338
342
|
const src = `${String(baseUrl).replace(/\/+$/, '')}/workflow/list/todo`;
|
|
339
|
-
const panelKey = `todo_summary_${Date.now()}`;
|
|
343
|
+
const panelKey = `todo_summary_${Date.now()}_${Math.random().toString(36).slice(2, 10).padEnd(8, '0')}`;
|
|
340
344
|
const data = smartGroupId && typeof smartGroupId === 'object' ? smartGroupId : { id: String(smartGroupId) };
|
|
345
|
+
const compConfig = {};
|
|
346
|
+
for (const key of ['queryName', 'queryScope']) {
|
|
347
|
+
if (typeof options[key] === 'string' && options[key].trim()) compConfig[key] = options[key].trim();
|
|
348
|
+
}
|
|
349
|
+
if (['browser', 'tabs'].includes(options.detailOpenMode)) compConfig.detailOpenMode = options.detailOpenMode;
|
|
350
|
+
if (typeof options.autoOpenWfAIAssistant === 'boolean') compConfig.autoOpenWfAIAssistant = options.autoOpenWfAIAssistant;
|
|
351
|
+
const queryName = Object.keys(compConfig).length > 0;
|
|
341
352
|
const inline = Number.isInteger(options.totalCount) && options.totalCount >= 0 && options.totalCount < 5;
|
|
342
353
|
const text = [
|
|
343
354
|
'{',
|
|
344
355
|
' "version": "1.0",',
|
|
345
|
-
|
|
356
|
+
` "callId": ${JSON.stringify(panelKey)},`,
|
|
346
357
|
' "toolId": "fill_form",',
|
|
347
358
|
' "arguments": {',
|
|
348
359
|
' "type": "e10",',
|
|
@@ -359,7 +370,8 @@ function wrapBrowseToolPayload(baseUrl, smartGroupId, title = '待办摘要汇
|
|
|
359
370
|
' "params_pc": { "app": "@weapp/workflow", "compName": "Comp.WflTodoSummary", "clientType": "pc" },',
|
|
360
371
|
' "params_mobile": { "app": "@weapp/workflow", "compName": "Comp.WflTodoSummary", "clientType": "mobile" },',
|
|
361
372
|
' "params": {',
|
|
362
|
-
` "data": ${JSON.stringify(data)}`,
|
|
373
|
+
` "data": ${JSON.stringify(data)}${queryName ? ',' : ''}`,
|
|
374
|
+
...(queryName ? [` "compConfig": ${JSON.stringify(compConfig)}`] : []),
|
|
363
375
|
' }',
|
|
364
376
|
' }',
|
|
365
377
|
' }',
|
|
@@ -369,6 +381,64 @@ function wrapBrowseToolPayload(baseUrl, smartGroupId, title = '待办摘要汇
|
|
|
369
381
|
return `${text}\n`;
|
|
370
382
|
}
|
|
371
383
|
|
|
384
|
+
/** 对话分布只输出经过转义的纯文本名称。 */
|
|
385
|
+
function componentWorkflowLink(browserTool, workflowId, label) {
|
|
386
|
+
return String(label ?? '').replace(/[\r\n\t]+/g, ' ')
|
|
387
|
+
.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"')
|
|
388
|
+
.replace(/[|\\\x60*_[\]]/g, value => `&#${value.charCodeAt(0)};`);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/** 分类切换复用本轮 callId 和标准请求,按分类区分 panelKey;丢弃上一范围旧数据。 */
|
|
392
|
+
function componentCategoryLink(browserTool, listQuery, limit, tabid, label) {
|
|
393
|
+
const text = String(label ?? '').replace(/[\r\n\t]+/g, ' ')
|
|
394
|
+
.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"')
|
|
395
|
+
.replace(/[|\\`*_[\]]/g, value => `&#${value.charCodeAt(0)};`);
|
|
396
|
+
const linkPayload = JSON.parse(JSON.stringify(browserTool));
|
|
397
|
+
const basePanelKey = browserTool.arguments.panelKey || `e10-link:${browserTool.callId}`;
|
|
398
|
+
linkPayload.arguments.panelKey = `${basePanelKey}_category_${tabid}`;
|
|
399
|
+
const queryBody = JSON.parse(JSON.stringify(listQuery));
|
|
400
|
+
queryBody.params = { ...queryBody.params, tabid: String(tabid) };
|
|
401
|
+
delete queryBody.params.flowSpareType;
|
|
402
|
+
queryBody.customDisplayPage = { ...queryBody.customDisplayPage, current: 1, size: 500 };
|
|
403
|
+
const sdkOptions = linkPayload.arguments.sdkOptions;
|
|
404
|
+
const params = { ...sdkOptions.params, data: { listQuery: queryBody, limit } };
|
|
405
|
+
// 这些旧顶层输入会使组件继续优先展示摘要/旧数据,或复用上一范围的总数。
|
|
406
|
+
for (const key of ['id', 'dataSource', 'wfIdGroup', 'smartSummaryTitle', 'totalCount']) delete params[key];
|
|
407
|
+
params.compConfig = { ...params.compConfig };
|
|
408
|
+
if (params.compConfig.type === 'summary') delete params.compConfig.type;
|
|
409
|
+
delete params.compConfig.queryName;
|
|
410
|
+
const queryName = { '7': '待处理流程', '5': '待阅流程', '8': '被退回流程', '6': '超时流程', '1': '未读流程' }[String(tabid)];
|
|
411
|
+
if (queryName) params.compConfig.queryName = queryName;
|
|
412
|
+
sdkOptions.params = params;
|
|
413
|
+
const query = new URLSearchParams({ browsertool: JSON.stringify(linkPayload) });
|
|
414
|
+
return `[${text}](xiaoe://e10?${query.toString()})`;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/** 没有完整标准请求,或存在未由请求表达的本地排除时,不生成会扩大范围的入口。 */
|
|
418
|
+
function buildCategoryNavigation() {
|
|
419
|
+
return '';
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
/** 初始普通查询只从已解析的单工作流条件或实际分类取展示名,不按提示词猜测。 */
|
|
423
|
+
function resolveQueryName(data, state = {}) {
|
|
424
|
+
const listQuery = data?.listQuery ?? state.queryMeta?.listQuery;
|
|
425
|
+
if (!listQuery || typeof listQuery !== 'object' || Array.isArray(listQuery)) return '';
|
|
426
|
+
const searchParams = listQuery.searchParams;
|
|
427
|
+
const conditions = searchParams?.formDatas?.workflowid;
|
|
428
|
+
if (searchParams?.type !== 'or' && Array.isArray(conditions) && conditions.length === 1
|
|
429
|
+
&& conditions[0]?.term === 'in' && Array.isArray(conditions[0].browserDatas)) {
|
|
430
|
+
const entries = conditions[0].browserDatas;
|
|
431
|
+
const valid = entries.length > 0 && entries.every(entry => entry
|
|
432
|
+
&& ((typeof entry.id === 'string' && entry.id.trim()) || Number.isSafeInteger(entry.id))
|
|
433
|
+
&& typeof entry.name === 'string' && entry.name.trim() && entry.name.trim() !== '未提供名称');
|
|
434
|
+
if (valid && new Set(entries.map(entry => String(entry.id).trim())).size === 1) {
|
|
435
|
+
const name = entries[0].name.replace(/[\r\n\t]+/g, ' ').trim();
|
|
436
|
+
return name.endsWith('流程') ? name : `${name}流程`;
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
return { '7': '待处理流程', '5': '待阅流程', '8': '被退回流程', '6': '超时流程', '1': '未读流程' }[String(listQuery.params?.tabid)] || '';
|
|
440
|
+
}
|
|
441
|
+
|
|
372
442
|
/** 仅使用与交付范围一致的真实总数;已读取条数不能证明已覆盖全部。 */
|
|
373
443
|
function resolveMatchingTotal(state, displayedCount) {
|
|
374
444
|
if (state.dropped > 0) return null;
|
|
@@ -388,7 +458,7 @@ function resolveMatchingTotal(state, displayedCount) {
|
|
|
388
458
|
* ① 总数/降级说明行 —— 总数取 collect 首轮 getTodoListTotal 的结果(state.degrade.steps[0].total);
|
|
389
459
|
* 新模式由 windowDays / terminal 和最后一步 scope 描述实际范围(最低近7天);
|
|
390
460
|
* 历史无上述字段时保留 level=5 对应近1个月终点级的解释;
|
|
391
|
-
* ②
|
|
461
|
+
* ② 优先组条目表格:流程标题 + 操作,查看详情链接带 data-xiaoe-open="external";
|
|
392
462
|
* 超过5条截前5条并在标题提示「(前5条)」,不超过不带括号;
|
|
393
463
|
* ③ 工作流分组表格:排除优先组,只有多个工作流时展示,按组内条数降序。
|
|
394
464
|
*/
|
|
@@ -458,21 +528,73 @@ function buildReplyPrologue(state, payload, opts) {
|
|
|
458
528
|
}
|
|
459
529
|
}
|
|
460
530
|
if (priorityRows.length > 0) {
|
|
461
|
-
//
|
|
531
|
+
// 摘要正文展示标题和浏览器详情入口;只改正文,不改组件数据。
|
|
462
532
|
const capText = priorityRows.length > 5 ? '(前 5 条)' : '';
|
|
463
533
|
lines.push('', `**建议您优先处理**${capText}:`, '');
|
|
464
|
-
lines.push('| 流程标题 |', '| --- |');
|
|
534
|
+
lines.push('| 流程标题 | 操作 |', '| --- | --- |');
|
|
535
|
+
const linkBase = String(opts.baseUrl || '').replace(/\/+$/, '');
|
|
536
|
+
const escapeHtml = (text) => String(text).replace(/&/g, '&').replace(/"/g, '"')
|
|
537
|
+
.replace(/</g, '<').replace(/>/g, '>');
|
|
465
538
|
const clean = (text) => String(text ?? '').replace(/\s+/g, ' ').replace(/[[\]]/g, '').trim();
|
|
466
539
|
priorityRows.slice(0, 5).forEach((row) => {
|
|
467
|
-
const requestId = String(row.requestId || '');
|
|
540
|
+
const requestId = String(row.requestId || '').trim();
|
|
541
|
+
const userMasterId = String(row.userMasterId || '').trim();
|
|
542
|
+
const link = requestId && /^https?:\/\//i.test(linkBase)
|
|
543
|
+
? `${linkBase}/sp/workflow/flowpage/view/${encodeURIComponent(requestId)}`
|
|
544
|
+
+ (userMasterId ? `?secondEmpId=${encodeURIComponent(userMasterId)}&requestId=${encodeURIComponent(requestId)}` : '')
|
|
545
|
+
: '';
|
|
468
546
|
const title = clean(row.requestNameTitle) || requestId || '—';
|
|
469
|
-
|
|
547
|
+
const action = link ? `<a href="${escapeHtml(link)}" data-xiaoe-open="external" style="cursor: pointer;">查看详情</a>` : '—';
|
|
548
|
+
lines.push(`| ${escapeHtml(title).replace(/\|/g, '\\|')} | ${action} |`);
|
|
470
549
|
});
|
|
471
550
|
}
|
|
472
551
|
|
|
473
|
-
|
|
552
|
+
// 摘要可按同名合组,分布筛选必须回到每条流程的真实工作流 ID。
|
|
553
|
+
const workflowRows = new Map((Array.isArray(opts.workflowRows) ? opts.workflowRows : [])
|
|
554
|
+
.filter(row => row && row.requestId)
|
|
555
|
+
.map(row => [String(row.requestId).trim(), row]));
|
|
556
|
+
const requests = new Map();
|
|
557
|
+
let missingRequestId = false;
|
|
558
|
+
for (const group of groups) {
|
|
559
|
+
for (const item of group.displayItems || []) {
|
|
560
|
+
const rows = item.type === 'request' ? [item.requestData] : (item.requestDatas || []);
|
|
561
|
+
for (const row of rows) {
|
|
562
|
+
const requestId = String(row?.requestId || '').trim();
|
|
563
|
+
if (!requestId) {
|
|
564
|
+
missingRequestId = true;
|
|
565
|
+
continue;
|
|
566
|
+
}
|
|
567
|
+
const known = workflowRows.get(requestId) || {};
|
|
568
|
+
const workflowId = String(row.workflowId || known.workflowId || '').trim();
|
|
569
|
+
const workflowName = String(row.workflowName || known.workflowName || '').trim();
|
|
570
|
+
const groupTitle = isPriority(group) ? '' : String(group.title || '').trim();
|
|
571
|
+
const existing = requests.get(requestId);
|
|
572
|
+
if (existing) {
|
|
573
|
+
if (!existing.workflowId) existing.workflowId = workflowId;
|
|
574
|
+
if (!existing.workflowName) existing.workflowName = workflowName;
|
|
575
|
+
if (!existing.groupTitle) existing.groupTitle = groupTitle;
|
|
576
|
+
} else requests.set(requestId, { workflowId, workflowName, groupTitle });
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
const hasWorkflowMetadata = !missingRequestId && requests.size > 0 && requests.size === totalCount
|
|
581
|
+
&& [...requests.values()].every(row => row.workflowId);
|
|
582
|
+
const distribution = new Map();
|
|
583
|
+
if (hasWorkflowMetadata) {
|
|
584
|
+
for (const row of requests.values()) {
|
|
585
|
+
const title = row.workflowName || row.groupTitle || '未提供名称';
|
|
586
|
+
const key = row.workflowName && row.workflowName !== '未提供名称' ? `name:${row.workflowName}` : `id:${row.workflowId}`;
|
|
587
|
+
const existing = distribution.get(key);
|
|
588
|
+
if (existing) {
|
|
589
|
+
existing.count += 1;
|
|
590
|
+
if (existing.title === '未提供名称' && title !== '未提供名称') existing.title = title;
|
|
591
|
+
} else distribution.set(key, { title, count: 1 });
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
// 老成品缺少标识时保留原统计,不把分组 ID 猜成工作流 ID。
|
|
595
|
+
const tableRows = (hasWorkflowMetadata ? [...distribution.values()] : groups
|
|
474
596
|
.filter((g) => !isPriority(g))
|
|
475
|
-
.map((g) => ({ title: String(g.title || ''), count: Number(g.count) || 0 }))
|
|
597
|
+
.map((g) => ({ title: String(g.title || ''), count: Number(g.count) || 0 })))
|
|
476
598
|
.sort((a, b) => b.count - a.count);
|
|
477
599
|
if (tableRows.length > 1) {
|
|
478
600
|
// 2026-11-11 用户定稿:①表格加标题(与「建议您优先处理」同一样式的粗体标题行,15:53 定稿文案
|
|
@@ -483,12 +605,15 @@ function buildReplyPrologue(state, payload, opts) {
|
|
|
483
605
|
lines.push('', opts.tablesOnly ? '**工作流分布情况(本次展示)**:' : `**工作流分布情况${scope}**:`);
|
|
484
606
|
lines.push('| 工作流 | 总数 |', '| --- | --- |');
|
|
485
607
|
for (const row of tableRows.slice(0, 10)) {
|
|
486
|
-
|
|
608
|
+
const label = componentWorkflowLink(row.workflowId ? opts.browserTool : undefined, row.workflowId, row.title);
|
|
609
|
+
lines.push(`| ${label} | ${row.count} |`);
|
|
487
610
|
}
|
|
488
611
|
if (tableRows.length > 10) {
|
|
489
612
|
const restCount = tableRows.slice(10).reduce((sum, row) => sum + row.count, 0);
|
|
490
613
|
lines.push(`| 其它 | ${restCount} |`);
|
|
491
614
|
}
|
|
615
|
+
const coveredCount = hasWorkflowMetadata ? requests.size : totalCount;
|
|
616
|
+
lines.push(`| ${componentWorkflowLink(opts.browserTool, undefined, '全部')} | ${coveredCount} |`);
|
|
492
617
|
}
|
|
493
618
|
return lines;
|
|
494
619
|
}
|
|
@@ -660,6 +785,7 @@ function exportFinal(result, dir, state, kept, opts = {}) {
|
|
|
660
785
|
// 产物落库(2026-11-13 用户定稿):三键 JSON 不落物理文件,经 CLI stage=smartGroupAdd 调
|
|
661
786
|
// POST /api/workflow/list/smartgroup/add 存 E10 服务端,拿回落库主键 id 给组件载荷用。
|
|
662
787
|
// 失败口径:不降级、不回退——CLI 抛错即 exit 1,skill 不再继续(2026-11-13 用户定稿)。
|
|
788
|
+
const queryScope = buildQueryScope(state, payload.totalCount);
|
|
663
789
|
let smartGroupId = '';
|
|
664
790
|
try {
|
|
665
791
|
smartGroupId = persistPayload(payload, dir, opts.queryPrompt);
|
|
@@ -671,11 +797,19 @@ function exportFinal(result, dir, state, kept, opts = {}) {
|
|
|
671
797
|
}
|
|
672
798
|
// 交付正文与 stdout 共用同一份;`params.data.id` = 落库主键(原样数字串,保雪花精度)。
|
|
673
799
|
const knownTotal = resolveMatchingTotal(state, payload.totalCount);
|
|
674
|
-
const finalText = wrapBrowseToolPayload(baseUrl, smartGroupId, '待办摘要汇总', {
|
|
800
|
+
const finalText = wrapBrowseToolPayload(baseUrl, smartGroupId, '待办摘要汇总', {
|
|
801
|
+
totalCount: knownTotal, queryScope, detailOpenMode: state.detailOpenMode,
|
|
802
|
+
autoOpenWfAIAssistant: state.autoOpenWfAIAssistant,
|
|
803
|
+
});
|
|
675
804
|
// 交付 = 回复正文(总数/降级说明 + 优先组前 5 列表 + 工作流表格 + <browsertool> 块)。
|
|
676
805
|
// 2026-11-10 用户定稿:正文不再是只有组件块,前段由脚本产出、模型原样粘贴(勿增删改写)。
|
|
806
|
+
const browserTool = JSON.parse(finalText);
|
|
677
807
|
const delivery = `<browsertool>\n${finalText.trimEnd()}\n</browsertool>`;
|
|
678
|
-
const prologueLines = buildReplyPrologue(state, payload, {
|
|
808
|
+
const prologueLines = buildReplyPrologue(state, payload, {
|
|
809
|
+
tablesOnly: false, baseUrl, browserTool, workflowRows: kept,
|
|
810
|
+
});
|
|
811
|
+
const categoryNavigation = buildCategoryNavigation(browserTool, state);
|
|
812
|
+
if (categoryNavigation) prologueLines.splice(1, 0, '', categoryNavigation);
|
|
679
813
|
const replyBody = [...prologueLines, '', delivery].join('\n');
|
|
680
814
|
fs.writeFileSync(path.join(dir, 'reply.md'), replyBody);
|
|
681
815
|
console.log('\n[JSON_BEGIN]');
|
|
@@ -924,6 +1058,7 @@ function readOutputLimit(args, outputMode) {
|
|
|
924
1058
|
|
|
925
1059
|
function cmdPrep(args) {
|
|
926
1060
|
const outputMode = args._query === true ? 'query' : 'summary';
|
|
1061
|
+
const presentation = readPresentationArgs(args);
|
|
927
1062
|
const limit = readOutputLimit(args, outputMode);
|
|
928
1063
|
const days = Number(args.days || 0);
|
|
929
1064
|
const exclude = args.exclude && args.exclude !== true ? String(args.exclude).split(',').map((x) => x.trim()).filter(Boolean) : [];
|
|
@@ -943,6 +1078,7 @@ function cmdPrep(args) {
|
|
|
943
1078
|
|
|
944
1079
|
const startedAt = nowIso();
|
|
945
1080
|
const input = { stage: args._prepareQuery === true ? 'prepareQuery' : 'collect', outputMode, limit };
|
|
1081
|
+
supportsOutputMode();
|
|
946
1082
|
// 2026-11-11 用户定稿:排除清单必须进 CLI 查询条件——首轮 getTodoListTotal 要带上
|
|
947
1083
|
// 提示词中的**完整条件**(含排除项),否则交付正文的「您共 X 条待办」与实际纳入条数
|
|
948
1084
|
// 口径对不上(实测 223 vs 53)。本地剔除保留作兜底(正常情况下 CLI 已排除,dropped=0)。
|
|
@@ -1126,7 +1262,9 @@ function cmdPrep(args) {
|
|
|
1126
1262
|
}
|
|
1127
1263
|
|
|
1128
1264
|
fs.writeFileSync(path.join(dir, 'state.json'), JSON.stringify({
|
|
1129
|
-
dir, startedAt, outputMode, limit, days, from: args.from || null, to: args.to || null, exclude,
|
|
1265
|
+
dir, startedAt, outputMode, ...presentation, limit, days, from: args.from || null, to: args.to || null, exclude,
|
|
1266
|
+
localWorkflowExclusion: Boolean(hasLocalWorkflowExclusion(args)),
|
|
1267
|
+
subCategory: input.subCategory || null, collectMs, collectWallMs,
|
|
1130
1268
|
// 记录本次取数实际能力,降级范围仍以 queryMeta/degrade 为准。后续进程会重新探测入口。
|
|
1131
1269
|
cliCapabilities: { outputMode: supportsOutputMode() },
|
|
1132
1270
|
// 编排标记(2026-11-16 入口自检):build/finish 只允许消费由本脚本 run 产出的目录;
|
|
@@ -1249,6 +1387,7 @@ function cmdBuild(args) {
|
|
|
1249
1387
|
guardOrchestrated(args, dir, 'build');
|
|
1250
1388
|
const planFile = args.plan !== undefined && args.plan !== true ? String(args.plan) : '';
|
|
1251
1389
|
const state = readJson(path.join(dir, 'state.json'));
|
|
1390
|
+
Object.assign(state, readPresentationArgs(args, state));
|
|
1252
1391
|
const kept = readJson(path.join(dir, 'items.json'));
|
|
1253
1392
|
const planGroups = state.planGroups || [];
|
|
1254
1393
|
const countById = new Map(planGroups.map((g) => [g.groupId, g.count]));
|
|
@@ -1340,6 +1479,11 @@ function cmdFinish(args) {
|
|
|
1340
1479
|
const dir = String(args.dir);
|
|
1341
1480
|
guardOrchestrated(args, dir, 'finish');
|
|
1342
1481
|
const state = readJson(path.join(dir, 'state.json'));
|
|
1482
|
+
const presentation = readPresentationArgs(args, state);
|
|
1483
|
+
if (Object.keys(presentation).length) {
|
|
1484
|
+
Object.assign(state, presentation);
|
|
1485
|
+
fs.writeFileSync(path.join(dir, 'state.json'), JSON.stringify(state));
|
|
1486
|
+
}
|
|
1343
1487
|
const kept = readJson(path.join(dir, 'items.json'));
|
|
1344
1488
|
// `aiGroups.json` 可能不存在(build 没传 --plan 时就是确定性分组),此时按「未传 aiGroups」处理。
|
|
1345
1489
|
const planPath = path.join(dir, 'aiGroups.json');
|
|
@@ -1467,6 +1611,7 @@ function cmdFinish(args) {
|
|
|
1467
1611
|
* 有待写摘要时会停下并打印素材:那部分必须模型写,写完跑 `finish` 即可,不用重跑取数与分组。
|
|
1468
1612
|
*/
|
|
1469
1613
|
function cmdRun(args) {
|
|
1614
|
+
readPresentationArgs(args);
|
|
1470
1615
|
const dir = args.out && args.out !== true
|
|
1471
1616
|
? String(args.out)
|
|
1472
1617
|
: fs.mkdtempSync(path.join(os.tmpdir(), 'todo-summary-'));
|
|
@@ -1557,26 +1702,31 @@ function hasLocalWorkflowExclusion(args) {
|
|
|
1557
1702
|
}
|
|
1558
1703
|
|
|
1559
1704
|
/** 仅将确定性计数放入会话正文,不改变组件数据源或生成 AI 分组。 */
|
|
1560
|
-
function buildQueryDistribution(distribution, total) {
|
|
1705
|
+
function buildQueryDistribution(distribution, total, browserTool) {
|
|
1561
1706
|
if (!distribution || !Array.isArray(distribution.items)) return [];
|
|
1562
|
-
const
|
|
1563
|
-
|
|
1564
|
-
.
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
const
|
|
1572
|
-
|
|
1573
|
-
const
|
|
1574
|
-
|
|
1575
|
-
|
|
1707
|
+
const merged = new Map();
|
|
1708
|
+
for (const row of distribution.items) {
|
|
1709
|
+
if (!row || !Number.isInteger(row.count) || row.count <= 0) continue;
|
|
1710
|
+
const name = typeof row.workflowName === 'string' ? row.workflowName.trim() : '';
|
|
1711
|
+
const key = name && name !== '未提供名称' ? `name:${name}` : `id:${String(row.workflowId || merged.size)}`;
|
|
1712
|
+
const previous = merged.get(key);
|
|
1713
|
+
if (previous) previous.count += row.count;
|
|
1714
|
+
else merged.set(key, { title: name || '未提供名称', count: row.count });
|
|
1715
|
+
}
|
|
1716
|
+
const rows = [...merged.values()].sort((a, b) => b.count - a.count);
|
|
1717
|
+
if (rows.length <= 1) return [];
|
|
1718
|
+
const counted = rows.reduce((count, row) => count + row.count, 0);
|
|
1719
|
+
const readCount = Number.isInteger(distribution.readCount) && distribution.readCount >= counted ? distribution.readCount : counted;
|
|
1720
|
+
const complete = distribution.complete === true && distribution.truncated !== true && total !== null && readCount === total && counted === readCount;
|
|
1721
|
+
const lines = ['', complete ? '**工作流分布情况**:' : `**工作流分布情况(本次读取${readCount}条)**:`, '| 工作流 | 总数 |', '| --- | --- |'];
|
|
1722
|
+
for (const row of rows.slice(0, 10)) lines.push(`| ${componentWorkflowLink(undefined, undefined, row.title)} | ${row.count} |`);
|
|
1723
|
+
if (rows.length > 10) lines.push(`| 其它 | ${rows.slice(10).reduce((count, row) => count + row.count, 0)} |`);
|
|
1724
|
+
lines.push(`| 全部 | ${counted} |`);
|
|
1576
1725
|
return lines;
|
|
1577
1726
|
}
|
|
1578
1727
|
|
|
1579
1728
|
function cmdQuery(args) {
|
|
1729
|
+
const presentation = readPresentationArgs(args);
|
|
1580
1730
|
const limit = readOutputLimit(args, 'query');
|
|
1581
1731
|
const dir = args.out && args.out !== true
|
|
1582
1732
|
? String(args.out)
|
|
@@ -1595,7 +1745,7 @@ function cmdQuery(args) {
|
|
|
1595
1745
|
}
|
|
1596
1746
|
const totalValue = Object.prototype.hasOwnProperty.call(prepared.data, 'totalCount')
|
|
1597
1747
|
? prepared.data.totalCount : query.totalAvailable;
|
|
1598
|
-
const state = { outputMode: 'query', queryMeta: { ...query, totalAvailable: totalValue } };
|
|
1748
|
+
const state = { outputMode: 'query', ...presentation, queryMeta: { ...query, totalAvailable: totalValue } };
|
|
1599
1749
|
const total = resolveMatchingTotal(state, 0);
|
|
1600
1750
|
const warnings = Array.isArray(prepared.data.warnings)
|
|
1601
1751
|
? prepared.data.warnings.filter(value => typeof value === 'string' && value.trim()).map(value => `注意:${value.trim()}`) : [];
|
|
@@ -1607,8 +1757,7 @@ function cmdQuery(args) {
|
|
|
1607
1757
|
const data = { listQuery: query.listQuery, limit, ...(total === null ? {} : { totalCount: total }) };
|
|
1608
1758
|
const lines = [...warnings, total === null ? `待办列表如下,本次最多展示${limit}条。`
|
|
1609
1759
|
: `本次共匹配${total}条待办${total > limit ? `,本次最多展示${limit}条` : ''},清单如下:`];
|
|
1610
|
-
lines
|
|
1611
|
-
deliverQuery(data, state, dir, total, lines);
|
|
1760
|
+
deliverQuery(data, state, dir, total, lines, prepared.data.distribution);
|
|
1612
1761
|
}
|
|
1613
1762
|
|
|
1614
1763
|
/** 旧 CLI 缺少准备查询阶段时保留原交付,业务失败不重试或切换路径。 */
|
|
@@ -1672,16 +1821,15 @@ function cmdLegacyQuery(args, dir, limit) {
|
|
|
1672
1821
|
if (existing) existing.count += 1;
|
|
1673
1822
|
else distribution.set(workflowId, { workflowId, workflowName: requestData.workflowName, count: 1 });
|
|
1674
1823
|
}
|
|
1675
|
-
lines.push(...buildQueryDistribution({ items: [...distribution.values()], readCount: count,
|
|
1676
|
-
complete: total === count, truncated: state.truncated > 0 }, total));
|
|
1677
1824
|
const nativeQuery = !hasLocalWorkflowExclusion(args) && state.queryMeta?.listQuery;
|
|
1678
1825
|
const data = nativeQuery ? { listQuery: nativeQuery, limit, ...(total === null ? {} : { totalCount: total }) }
|
|
1679
1826
|
: persistPayload(payload, dir, state.prompt);
|
|
1680
1827
|
fs.writeFileSync(path.join(dir, 'final.data.json'), JSON.stringify(payload));
|
|
1681
|
-
deliverQuery(data, state, dir, total, lines)
|
|
1828
|
+
deliverQuery(data, state, dir, total, lines, { items: [...distribution.values()], readCount: count,
|
|
1829
|
+
complete: total === count, truncated: state.truncated > 0 });
|
|
1682
1830
|
}
|
|
1683
1831
|
|
|
1684
|
-
function deliverQuery(data, state, dir, total, lines) {
|
|
1832
|
+
function deliverQuery(data, state, dir, total, lines, distribution) {
|
|
1685
1833
|
const listQuery = data?.listQuery;
|
|
1686
1834
|
if (listQuery?.params && typeof listQuery.params === 'object' && !Array.isArray(listQuery.params)) {
|
|
1687
1835
|
const params = { ...listQuery.params };
|
|
@@ -1689,13 +1837,60 @@ function deliverQuery(data, state, dir, total, lines) {
|
|
|
1689
1837
|
data = { ...data, listQuery: { ...listQuery, params } };
|
|
1690
1838
|
}
|
|
1691
1839
|
const baseUrl = resolveBaseUrl(state, dir);
|
|
1692
|
-
const
|
|
1693
|
-
|
|
1840
|
+
const finalText = wrapBrowseToolPayload(baseUrl, data, '待办列表', {
|
|
1841
|
+
totalCount: total, queryName: resolveQueryName(data, state), queryScope: buildQueryScope(state), detailOpenMode: state.detailOpenMode,
|
|
1842
|
+
autoOpenWfAIAssistant: state.autoOpenWfAIAssistant,
|
|
1843
|
+
});
|
|
1844
|
+
const browserTool = JSON.parse(finalText);
|
|
1845
|
+
const categoryNavigation = buildCategoryNavigation(browserTool, state);
|
|
1846
|
+
const categoryLines = categoryNavigation ? ['', categoryNavigation] : [];
|
|
1847
|
+
const distributionLines = buildQueryDistribution(distribution, total, browserTool);
|
|
1848
|
+
const delivery = `<browsertool>\n${finalText.trimEnd()}\n</browsertool>`;
|
|
1849
|
+
const replyBody = [...lines, ...categoryLines, ...distributionLines, '', delivery].join('\n');
|
|
1694
1850
|
fs.writeFileSync(path.join(dir, 'reply.md'), replyBody);
|
|
1695
1851
|
console.log('\n[JSON_BEGIN]\n%s\n[JSON_END]', replyBody);
|
|
1696
1852
|
console.log('交付正文已落盘:%s(原样粘贴正文与 browsertool,勿改写为旧卡片列表)', path.join(dir, 'reply.md'));
|
|
1697
1853
|
}
|
|
1698
1854
|
|
|
1855
|
+
function normalizeQueryScope(value) {
|
|
1856
|
+
if (typeof value !== 'string') throw Error('--query-scope 必填,请提供实际筛选范围');
|
|
1857
|
+
let scope = value.replace(/\s+/g, ' ').trim();
|
|
1858
|
+
while (/^筛选范围\s*[::]/u.test(scope)) scope = scope.replace(/^筛选范围\s*[::]\s*/u, '').trim();
|
|
1859
|
+
if (!scope || scope === '筛选范围') throw Error('--query-scope 不能为空或只有前缀,请提供实际筛选范围');
|
|
1860
|
+
return scope;
|
|
1861
|
+
}
|
|
1862
|
+
|
|
1863
|
+
function readPresentationArgs(args, state = {}) {
|
|
1864
|
+
const presentation = {
|
|
1865
|
+
queryScope: normalizeQueryScope(args['query-scope'] === undefined ? state.queryScope : args['query-scope']),
|
|
1866
|
+
};
|
|
1867
|
+
if (args['detail-open-mode'] !== undefined) {
|
|
1868
|
+
if (!['browser', 'tabs'].includes(args['detail-open-mode'])) throw Error('--detail-open-mode 仅支持 browser 或 tabs');
|
|
1869
|
+
presentation.detailOpenMode = args['detail-open-mode'];
|
|
1870
|
+
}
|
|
1871
|
+
const autoOpenWfAIAssistant = args['auto-open-wf-ai-assistant'];
|
|
1872
|
+
if (autoOpenWfAIAssistant !== undefined) {
|
|
1873
|
+
if (autoOpenWfAIAssistant !== 'true' && autoOpenWfAIAssistant !== 'false') {
|
|
1874
|
+
throw Error('--auto-open-wf-ai-assistant 仅支持 true 或 false');
|
|
1875
|
+
}
|
|
1876
|
+
presentation.autoOpenWfAIAssistant = autoOpenWfAIAssistant === 'true';
|
|
1877
|
+
} else if (typeof state.autoOpenWfAIAssistant === 'boolean') {
|
|
1878
|
+
presentation.autoOpenWfAIAssistant = state.autoOpenWfAIAssistant;
|
|
1879
|
+
}
|
|
1880
|
+
return presentation;
|
|
1881
|
+
}
|
|
1882
|
+
|
|
1883
|
+
function buildQueryScope(state = {}, count) {
|
|
1884
|
+
const parts = [normalizeQueryScope(state.queryScope)];
|
|
1885
|
+
if (state.degrade?.applied) parts.push(`实际${state.outputMode === 'summary' ? '摘要' : '查询'}范围:${describeDegradeWindow(state.degrade)}`);
|
|
1886
|
+
if (state.outputMode === 'summary' && Number.isInteger(count) && count >= 0) {
|
|
1887
|
+
const total = resolveMatchingTotal(state, count);
|
|
1888
|
+
if ((total !== null && total > count) || state.truncated > 0) parts.push(`本次仅汇总前${count}条${total === null ? '' : `(匹配${total}条)`}`);
|
|
1889
|
+
else if (total === null && Number.isInteger(state.limit) && count >= state.limit) parts.push(`本次已汇总${count}条,尚未确认覆盖全部`);
|
|
1890
|
+
}
|
|
1891
|
+
return `筛选范围:${parts.join(';')}`;
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1699
1894
|
const args = parseArgs(process.argv.slice(2));
|
|
1700
1895
|
const cmd = args._[0];
|
|
1701
1896
|
if (cmd === 'query') cmdQuery(args);
|
|
@@ -1705,11 +1900,13 @@ else if (cmd === 'finish') cmdFinish(args);
|
|
|
1705
1900
|
else if (cmd === 'run') cmdRun(args);
|
|
1706
1901
|
else {
|
|
1707
1902
|
console.log('用法:node ' + path.basename(__filename) + ' <query|run|prep|build|finish> [options]');
|
|
1708
|
-
console.log(' query [--limit 1000] [筛选条件] [--out DIR] [--prompt "用户完整提示词"] # 标题清单组件,每页500条;不生成 AI 摘要或二次分组;limit 为 1~1000,默认 1000');
|
|
1709
|
-
console.log(' run [--days N | --from A --to B] [--limit 100] [--out DIR] [--timing-report] [--prompt "用户完整提示词"] # 摘要默认/最多100条,沿用原工作流规则');
|
|
1710
|
-
console.log(' prep --limit 100 [--exclude 内部留言] [--days 1460] [--sub-category 待处理] [--tabid 7] [--isremarks 1,2] [--out DIR] # 小分类:--sub-category/--tabid(显式 tabid 优先);isremarks=备注筛选(数字逗号拼接)');
|
|
1903
|
+
console.log(' query --query-scope "本轮有效筛选范围" [--limit 1000] [筛选条件] [--out DIR] [--prompt "用户完整提示词"] # 标题清单组件,每页500条;不生成 AI 摘要或二次分组;limit 为 1~1000,默认 1000');
|
|
1904
|
+
console.log(' run --query-scope "本轮有效筛选范围" [--days N | --from A --to B] [--limit 100] [--out DIR] [--timing-report] [--prompt "用户完整提示词"] # 摘要默认/最多100条,沿用原工作流规则');
|
|
1905
|
+
console.log(' prep --query-scope "本轮有效筛选范围" --limit 100 [--exclude 内部留言] [--days 1460] [--sub-category 待处理] [--tabid 7] [--isremarks 1,2] [--out DIR] # 小分类:--sub-category/--tabid(显式 tabid 优先);isremarks=备注筛选(数字逗号拼接)');
|
|
1711
1906
|
console.log(' build --dir DIR [--plan aiGroups.json] # aiGroups 可先落盘(不传也行):build 只做首次分组+平铺,二次分组在 finish');
|
|
1712
1907
|
console.log(' finish --dir DIR [--summaries aiSummaries.json] [--group-summaries aiGroupSummaries.json] [--timing-report]');
|
|
1908
|
+
console.log(' 筛选范围:只描述实际生效条件;无额外筛选传“全部待办”。finish/build 复用已存范围,旧材料缺少时用 --query-scope 补填,不重新取数。');
|
|
1909
|
+
console.log(' 详情助手:--auto-open-wf-ai-assistant true|false,仅控制组件详情URL是否带助手参数;缺省沿用开启,finish/build 复用已存配置。');
|
|
1713
1910
|
console.log(' 规则新鲜度:finish 导出前比对 aigroup 指纹——规则在取数后被改过即拦截(新规则+旧数据出不了文件);确要带旧口径出文件加 --allow-stale-rules');
|
|
1714
1911
|
console.log(' 待写摘要素材:build/ run 停下时写 <out>/need-summaries.json(无损),控制台只留批次索引;写 aiSummaries.json 后 finish --summaries 回填');
|
|
1715
1912
|
console.log(' 组摘要未回填:以 exit 0 + NEEDS_GROUP_SUMMARIES 返回(不导出),完整素材在 <out>/need-group-summaries.json;');
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
name: weaver-e10-yimiaoban
|
|
3
3
|
display_name: 泛微易秒办
|
|
4
4
|
display_name_en: Weaver E10 Yimiaoban IM
|
|
5
|
-
description: 泛微 E10 易秒办即时通讯能力(单聊/群聊消息、发送与必达、群组管理、会话与系统消息),通过 weaver-work-cli im
|
|
6
|
-
description_zh: 泛微 E10 易秒办即时通讯能力:拉取单聊/群聊/系统消息、发送与撤回消息、发必达、群组管理(建群/邀人/踢人/退群/解散/公告)、会话列表、文件上传下载与人员解析,全部通过 weaver-work-cli im 命令执行,写操作走 prepare→apply
|
|
7
|
-
description_en: Weaver E10 Yimiaoban (IM) capabilities - fetching single/group/system messages, sending, withdrawing and ding messages, group management, sessions, file upload/download and people resolution, executed through the weaver-work-cli im command with a prepare-then-apply confirmation chain for writes.
|
|
8
|
-
version: 1.1.
|
|
5
|
+
description: 泛微 E10 易秒办即时通讯能力(单聊/群聊消息、发送与必达、群组管理、会话与系统消息),通过 weaver-work-cli im 命令执行。易秒办又称 em、emobile、emobile10、E10 IM、E10 即时通讯,提及这些称呼均指本技能。
|
|
6
|
+
description_zh: 泛微 E10 易秒办即时通讯能力:拉取单聊/群聊/系统消息、发送与撤回消息、发必达、群组管理(建群/邀人/踢人/退群/解散/公告)、会话列表、文件上传下载与人员解析,全部通过 weaver-work-cli im 命令执行,写操作走 prepare→apply 确认链。易秒办常见称呼(别名):em、emobile、emobile10、E10 IM、E10 即时通讯。
|
|
7
|
+
description_en: Weaver E10 Yimiaoban (IM) capabilities - fetching single/group/system messages, sending, withdrawing and ding messages, group management, sessions, file upload/download and people resolution, executed through the weaver-work-cli im command with a prepare-then-apply confirmation chain for writes. Yimiaoban is also known as em, emobile, emobile10, E10 IM, or E10 instant messaging.
|
|
8
|
+
version: 1.1.15
|
|
9
9
|
author: 泛微网络科技股份有限公司
|
|
10
10
|
agent_created: true
|
|
11
11
|
requires:
|
|
@@ -15,7 +15,7 @@ dependencies:
|
|
|
15
15
|
cliHelp: "weaver-work-cli im --help"
|
|
16
16
|
---
|
|
17
17
|
|
|
18
|
-
# 泛微易秒办(im)
|
|
18
|
+
# 泛微易秒办(im;又称 em / emobile / emobile10 / E10 IM)
|
|
19
19
|
|
|
20
20
|
**CRITICAL — 开始前 MUST 先用 Read 工具读取 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md),其中包含安装、E10 认证、JSON 输出和高风险写入规则。若共享规则不存在、CLI 未安装或读取失败,说明本技能的必需依赖缺失,必须调用宿主提供的提问/确认弹框,向用户说明必须补齐 `weaver-work-cli` 与共享 skill `weaver-e10-shared`(不补齐本技能无法执行)及补齐计划,并把下面两条待执行命令原样完整展示在确认信息中;Agent 不能在未确认时自行安装。用户明确确认后,Agent 必须直接代为按顺序执行且每条仅执行一次,不得要求或引导用户手动执行:① 缺 CLI 时执行 `npm install -g weaver-work-cli`;② 再执行 `weaver-work-cli skills install shared --target-dir <SKILLS_ROOT>` 装回共享 skill,`<SKILLS_ROOT>` 取本 SKILL.md 所在目录的上一级绝对目录(即与本技能同级的 skills 根目录),不要省略 `--target-dir`——省略会装进默认目录,导致本技能依然读不到共享规则。命令均成功后重新读取共享规则;仍读不到就停止并把结果报告用户,不得凭猜测继续。**
|
|
21
21
|
**`--is-connector` 判据**:用户明确使用连接器、或上下文要求用连接器完成任务 → 传 `true`;本次任务或上下文直接选择单独技能 → 不传;用户没有明确说明时,按**正在运行的这份 Skill 是哪一级**定——**用户级(条目标 `(user)`)不传,连接器级(标 `(connector)`)传**(同名 Skill 只会运行用户级那一份)。传 `true` 时不要再写 `--profile` / `--base-url`。完整规则见 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md)。
|
|
@@ -34,11 +34,14 @@ cliHelp: "weaver-work-cli im --help"
|
|
|
34
34
|
|
|
35
35
|
## 路由优先级(先判断是不是易秒办 IM,再选 operation)
|
|
36
36
|
|
|
37
|
+
**名称别名**:易秒办在泛微产品体系中还有以下称呼,用户提到任一称呼且语义是 E10 即时通讯时,均路由到本 Skill——**em、emobile、emobile10、E10 IM、E10 即时通讯**。
|
|
38
|
+
|
|
37
39
|
易秒办不是通用 E10 对象。**只要用户的核心对象是 E10 即时通讯(消息、群、会话、必达),就优先使用 `weaver-e10-yimiaoban`。**
|
|
38
40
|
|
|
39
41
|
出现以下任一语义时,优先走本 Skill:
|
|
40
42
|
|
|
41
43
|
- 单聊 / 群聊 / 聊天记录 / 拉消息 / 历史消息 / 置顶消息 / 已读未读
|
|
44
|
+
- 提到「易秒办 / em / emobile / emobile10」且涉及消息、群、会话、必达等即时通讯动作
|
|
42
45
|
- 发消息 / 发图片 / 发文件 / 撤回 / 转发必达 / 必达消息 / 催办
|
|
43
46
|
- 建群 / 拉群 / 邀人 / 踢人 / 退群 / 解散群 / 群公告 / 群主 / 群管理员 / 群成员
|
|
44
47
|
- 会话列表 / 系统消息 / 消息提醒 / 免打扰
|
|
@@ -2273,7 +2273,7 @@
|
|
|
2273
2273
|
}
|
|
2274
2274
|
},
|
|
2275
2275
|
"artifactBaseline": {
|
|
2276
|
-
"aggregateSha256": "
|
|
2276
|
+
"aggregateSha256": "3fb342f20a5f28262460175a66d0f4a984d1b89e1508322620588d73e94b6ba8",
|
|
2277
2277
|
"files": [
|
|
2278
2278
|
{
|
|
2279
2279
|
"path": "docs/im.md",
|
|
@@ -2362,8 +2362,8 @@
|
|
|
2362
2362
|
{
|
|
2363
2363
|
"path": "skills/weaver-e10-yimiaoban/SKILL.md",
|
|
2364
2364
|
"role": "generated-reference",
|
|
2365
|
-
"size":
|
|
2366
|
-
"sha256": "
|
|
2365
|
+
"size": 34374,
|
|
2366
|
+
"sha256": "18b9bbaff5975586f959270b937b29814d1edf00caf2b21bd5b5e7928ec14a5e"
|
|
2367
2367
|
},
|
|
2368
2368
|
{
|
|
2369
2369
|
"path": "src/shortcuts/im/continuation.ts",
|