weaver-work-cli 0.1.48 → 0.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{archive-oa-EDJDU3V4.js → archive-oa-57R2FYHV.js} +111 -12
- package/dist/chunks/{attachment-content-4KSNBPRO.js → attachment-content-EJYIOJPH.js} +3 -3
- package/dist/chunks/{chunk-FEP6ELMR.js → chunk-3NCFFHB2.js} +1 -1
- package/dist/chunks/chunk-5QYE52LG.js +223 -0
- package/dist/chunks/{chunk-3YV7PKRL.js → chunk-6QYNE6HE.js} +12 -212
- package/dist/chunks/{chunk-NBEWUR7L.js → chunk-6T53BSWZ.js} +158 -44
- package/dist/chunks/{chunk-OCYRVZGN.js → chunk-7AYQJSFY.js} +2 -2
- package/dist/chunks/{chunk-5B5JXTY2.js → chunk-7ECB22G3.js} +221 -30
- package/dist/chunks/{chunk-72MI3MBX.js → chunk-ATEXBEPD.js} +55 -15
- package/dist/chunks/{chunk-WMSAWAWZ.js → chunk-BFKLQLBK.js} +8 -8
- package/dist/chunks/{chunk-EFOUMXIX.js → chunk-HARQF5IP.js} +28 -28
- package/dist/chunks/{chunk-O6CMPO65.js → chunk-IW7A2IQY.js} +16 -146
- package/dist/chunks/chunk-JEQHNNSS.js +158 -0
- package/dist/chunks/{chunk-NK74RE5F.js → chunk-K67FODVC.js} +3 -3
- package/dist/chunks/{chunk-YLCYX7LE.js → chunk-KMRT7NAT.js} +18 -5
- package/dist/chunks/{chunk-BCACE6VV.js → chunk-MCZG6HPM.js} +3 -3
- package/dist/chunks/{chunk-SVFG6EMV.js → chunk-RYFRGTUV.js} +5 -5
- package/dist/chunks/{chunk-PSPOFLSU.js → chunk-WNJUGI2F.js} +1 -1
- package/dist/chunks/{chunk-R2HHLJNN.js → chunk-YB3AJYPY.js} +4 -4
- package/dist/chunks/{conflict-APGSD5E7.js → conflict-C4UDHCWV.js} +2 -2
- package/dist/chunks/{contract-N6P2HIIE.js → contract-VUC6JOPG.js} +464 -9
- package/dist/chunks/{create-flow-5TXFOC7X.js → create-flow-6OG2LYBD.js} +6 -6
- package/dist/chunks/data-QO7QWOIV.js +2525 -0
- package/dist/chunks/{employee-NOHNXC46.js → employee-DR5Y64TI.js} +2 -1
- package/dist/chunks/{env-B6GKA2J3.js → env-WP57TF2S.js} +2 -2
- package/dist/chunks/{factory-MFCKLUT6.js → factory-VUXI7N5C.js} +1 -1
- package/dist/chunks/{fna-ZVB2IILI.js → fna-ECOYBQYL.js} +328 -5
- package/dist/chunks/{group-chat-YE7WIBFO.js → group-chat-UQRGXILK.js} +3 -3
- package/dist/chunks/{hrm-UNKCCCGP.js → hrm-YGIR3HGF.js} +4 -2
- package/dist/chunks/{im-3RCNL5GT.js → im-TN2JYVGJ.js} +2 -2
- package/dist/chunks/{invoice-FXWH5GPO.js → invoice-E7GOITEU.js} +1 -1
- package/dist/chunks/{meeting-RYZV2JTQ.js → meeting-4BBLVAWM.js} +10 -10
- package/dist/chunks/{msg-parse-4GSQ2WTO.js → msg-parse-FPFVPMYI.js} +5 -1
- package/dist/chunks/org-NFE7X7FK.js +12 -0
- package/dist/chunks/{reception-VL6TKVAW.js → reception-QGPNTGHG.js} +526 -175
- package/dist/chunks/{recruit-stage-ERZD3ZNB.js → recruit-stage-FKWS5UQF.js} +66 -13
- package/dist/chunks/{registry-VWXWPVAG.js → registry-3UGIWH53.js} +4 -2
- package/dist/chunks/{registry-22O6UG4I.js → registry-5CRCN2TV.js} +10 -10
- package/dist/chunks/{registry-BUTEDK3C.js → registry-E5RQJVWN.js} +2 -2
- package/dist/chunks/{registry-7VZ6YJUF.js → registry-V4CHRQDI.js} +1 -1
- package/dist/chunks/{room-recommend-IMZPJMYB.js → room-recommend-AYR3UG7R.js} +4 -4
- package/dist/chunks/{schedule-SPPAHER2.js → schedule-JZEFIXUS.js} +4 -4
- package/dist/chunks/{workflow-WVEFJ6KC.js → workflow-3ZAF2J5E.js} +4 -4
- package/dist/index.js +16 -11
- package/dist/shortcuts/archive-oa/operations/contract-modules.js +57 -0
- package/dist/shortcuts/archive-oa/operations/contract.js +23 -8
- package/dist/shortcuts/archive-oa/operations/registry.js +4 -1
- package/dist/shortcuts/archive-oa/operations/shared.js +41 -5
- package/dist/shortcuts/contract/host.js +11 -0
- package/dist/shortcuts/contract/index.js +13 -0
- package/dist/shortcuts/contract/manifest.js +53 -0
- package/dist/shortcuts/contract/operations/performance.js +58 -7
- package/dist/shortcuts/contract/operations/quote.js +283 -1
- package/dist/shortcuts/contract/operations/registry.js +2 -0
- package/dist/shortcuts/contract/operations/save-recognize.js +151 -0
- package/dist/shortcuts/data/errors.js +64 -0
- package/dist/shortcuts/data/host.js +140 -0
- package/dist/shortcuts/data/index.js +429 -0
- package/dist/shortcuts/data/manifest.js +133 -0
- package/dist/shortcuts/data/operations/attend.js +62 -0
- package/dist/shortcuts/data/operations/conf.js +384 -0
- package/dist/shortcuts/data/operations/ds.js +686 -0
- package/dist/shortcuts/data/operations/field.js +68 -0
- package/dist/shortcuts/data/operations/index.js +65 -0
- package/dist/shortcuts/data/operations/module.js +383 -0
- package/dist/shortcuts/data/operations/noun.js +102 -0
- package/dist/shortcuts/data/operations/query.js +85 -0
- package/dist/shortcuts/data/operations/scene.js +235 -0
- package/dist/shortcuts/data/operations/shared.js +279 -0
- package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +12 -5
- package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/ehr/recruit-stage/shared.js +57 -0
- package/dist/shortcuts/fna/host.js +4 -2
- package/dist/shortcuts/fna/manifest.js +14 -5
- package/dist/shortcuts/fna/operations/audit.js +334 -0
- package/dist/shortcuts/fna/operations/registry.js +2 -0
- package/dist/shortcuts/im/operations/at-mention.js +6 -3
- package/dist/shortcuts/im/operations/msg-parse.js +35 -5
- package/dist/shortcuts/im/operations/msg-sync.js +3 -1
- package/dist/shortcuts/im/operations/msg-write.js +57 -9
- package/dist/shortcuts/index.js +5 -0
- package/dist/shortcuts/invoice/manifest.js +1 -1
- package/dist/shortcuts/meeting/operations/eb/member-expand.js +200 -0
- package/dist/shortcuts/meeting/operations/from-group-chat.js +16 -2
- package/dist/shortcuts/meeting/operations/registry.js +2 -0
- package/dist/shortcuts/reception/constants.js +13 -6
- package/dist/shortcuts/reception/index.js +3 -1
- package/dist/shortcuts/reception/manifest.js +3 -2
- package/dist/shortcuts/reception/operations/ask.js +20 -2
- package/dist/shortcuts/reception/operations/compose.js +11 -0
- package/dist/shortcuts/reception/operations/doc.js +59 -0
- package/dist/shortcuts/reception/operations/docrender.js +25 -1
- package/dist/shortcuts/reception/operations/leads.js +31 -7
- package/dist/shortcuts/reception/operations/panels.js +86 -22
- package/dist/shortcuts/reception/operations/render.js +40 -0
- package/dist/shortcuts/reception/operations/restaurant.js +17 -4
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +12 -5
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +21 -13
- package/dist/shortcuts/recruit-stage/shared.js +57 -0
- package/dist/shortcuts/workflow/operations/read.js +58 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +140 -24
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +42 -14
- package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +4 -6
- package/docs/SKILL.md +2 -1
- package/docs/_catalog.md +4 -1
- package/docs/data.md +149 -0
- package/docs/fna.md +11 -4
- package/docs/reception.md +59 -5
- package/package.json +1 -1
- package/scripts/check-skill-sync.mjs +188 -0
- package/scripts/package-skill.mjs +17 -3
- package/skill-template/business-info.json +29 -1
- package/skill-template/domains/data.md +15 -0
- package/skill-template/domains/qiyecheng.md +4 -2
- package/skills/weaver-e10-archive-oa/SKILL.md +7 -6
- package/skills/weaver-e10-archive-oa/references/contract-search.md +83 -14
- package/skills/weaver-e10-archive-oa/references/disabled-capabilities.md +1 -1
- package/skills/weaver-e10-archive-oa/references/qys-contract-search.md +35 -11
- package/skills/weaver-e10-data/SKILL.md +118 -0
- package/skills/weaver-e10-data/references/config-center.md +90 -0
- package/skills/weaver-e10-data/references/datasource.md +136 -0
- package/skills/weaver-e10-data/references/scene-and-misc.md +82 -0
- package/skills/weaver-e10-jinchengda/SKILL.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-action-card.md +5 -5
- package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +44 -2
- package/skills/weaver-e10-jinchengda/references/contract-command-index.md +2 -2
- package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +219 -0
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +50 -30
- package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +24 -15
- package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +1 -1
- package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +96 -2
- package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +43 -0
- package/skills/weaver-e10-jinchengda/scripts/fill_plan.py +997 -0
- package/skills/weaver-e10-jinchengda/scripts/render_ebdf_list_card.py +265 -0
- package/skills/weaver-e10-jinchengda/scripts/validate_action_card.py +83 -0
- package/skills/weaver-e10-jinchengda/scripts/verify_docx_placeholders.py +118 -0
- package/skills/weaver-e10-meeting/SKILL.md +39 -7
- package/skills/weaver-e10-qiyecheng/SKILL.md +21 -7
- package/skills/weaver-e10-qiyecheng/references/ai-check-audit.md +104 -0
- package/skills/weaver-e10-qiyecheng/references/catalog.md +17 -3
- package/skills/weaver-e10-qiyecheng/references/source-manifest.json +136 -30
- package/skills/weaver-e10-reception-flow/SKILL.md +70 -19
- package/skills/weaver-e10-reception-flow/references/guide.md +5 -4
- package/skills/weaver-e10-reception-flow/scripts/render.py +5 -3
- package/skills/weaver-e10-recruit-stage/SKILL.md +1 -1
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +26 -6
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +3 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +6 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +3 -3
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +53 -11
- package/skills/weaver-e10-workflow/SKILL.md +2 -1
- package/skills/weaver-e10-workflow/references/todo-smart-convert.md +29 -6
- package/skills/weaver-e10-workflow/tools/todo-summary.cjs +162 -10
- package/skills/weaver-e10-yepiaotong/SKILL.md +10 -5
- package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +19 -32
- package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +6 -45
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +5 -5
- package/skills/weaver-e10-yepiaotong/references/reim-examples.md +4 -37
- package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +2 -2
- package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +4 -4
- package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +22 -35
- package/skills/weaver-e10-yimiaoban/SKILL.md +8 -6
- package/skills/weaver-e10-yimiaoban/references/msg-read.md +20 -0
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +7 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +18 -15
- package/dist/chunks/{ebuilder-form-I5ZIX4WO.js → ebuilder-form-CBYI6CQ6.js} +4 -4
|
@@ -818,6 +818,63 @@ export function buildCardUrl(baseUrl, objId, dataId) {
|
|
|
818
818
|
return null;
|
|
819
819
|
return String(baseUrl).replace(/\/+$/, '') + '/sp/ebdfpage/card/0/' + objId + '/' + dataId;
|
|
820
820
|
}
|
|
821
|
+
// ── 人才库 ecode 页面(recruit-talent-ui)优先 ────────────────────────────────
|
|
822
|
+
// 2026-11-10 用户定稿:「安排面试后返回的列表链接可以改;返回的人才卡片和人才列表也改,
|
|
823
|
+
// 改为新做的页面地址」。新页面是 ecode 独立页面(101 已发布,路由见该工程 entry.js)。
|
|
824
|
+
//
|
|
825
|
+
// 🔴 但不能硬用:自用等环境装不了这套 ecode(应用锁定),必须回退原生页。所以先探测再选。
|
|
826
|
+
// 探测判据(101 实测):/api/ecode/project/searchAll 的项目里有 projectName 以 recruit-talent-ui 开头。
|
|
827
|
+
// ❌ 不能拿页面 URL 的 HTTP 状态判:实测不存在的 /sp/custom/ecode/__no_such_app_xyz__ 也返回
|
|
828
|
+
// 200 + 完全相同的壳(3189 字节),会假绿。
|
|
829
|
+
export const TALENT_UI_ROUTE = '/sp/custom/ecode/recruit-talent';
|
|
830
|
+
/** 探测当前环境是否装了人才库 ecode 页面;结果缓存进 cache.talentUi('1'/'0'),一次运行只探一次。 */
|
|
831
|
+
export async function detectTalentUi(host, cache) {
|
|
832
|
+
const flag = String(cache.talentUi || '');
|
|
833
|
+
if (flag === '1')
|
|
834
|
+
return true;
|
|
835
|
+
if (flag === '0')
|
|
836
|
+
return false;
|
|
837
|
+
let installed = false;
|
|
838
|
+
try {
|
|
839
|
+
const r = await host.request({
|
|
840
|
+
path: '/api/ecode/project/searchAll',
|
|
841
|
+
method: 'GET',
|
|
842
|
+
query: { page: 1, size: 100 },
|
|
843
|
+
operation: 'detect-talent-ui',
|
|
844
|
+
});
|
|
845
|
+
const list = ((r && r.data && r.data.list) || (r && r.list) || []);
|
|
846
|
+
installed = Array.isArray(list)
|
|
847
|
+
&& list.some((x) => String((x && x.projectName) || '').startsWith('recruit-talent-ui'));
|
|
848
|
+
}
|
|
849
|
+
catch {
|
|
850
|
+
// 探测失败按「没装」处理:宁可回退到原生页,也不要给出打不开的链接。
|
|
851
|
+
installed = false;
|
|
852
|
+
}
|
|
853
|
+
cache.talentUi = installed ? '1' : '0';
|
|
854
|
+
return installed;
|
|
855
|
+
}
|
|
856
|
+
/** 人才库列表:装了 ecode 页面 → 新页面;否则原生台账列表。 */
|
|
857
|
+
export async function resolveTalentListUrl(host, cache, baseUrl, fallbackListId) {
|
|
858
|
+
if (await detectTalentUi(host, cache)) {
|
|
859
|
+
return String(baseUrl).replace(/\/+$/, '') + TALENT_UI_ROUTE;
|
|
860
|
+
}
|
|
861
|
+
return buildListUrl(baseUrl, fallbackListId);
|
|
862
|
+
}
|
|
863
|
+
/** 面试进展:装了 ecode 页面 → 新面试进展页;否则原生面试台账列表。 */
|
|
864
|
+
export async function resolveInterviewListUrlOrNative(host, cache, baseUrl, fallbackListId) {
|
|
865
|
+
if (await detectTalentUi(host, cache)) {
|
|
866
|
+
return String(baseUrl).replace(/\/+$/, '') + TALENT_UI_ROUTE + '/interview';
|
|
867
|
+
}
|
|
868
|
+
return buildListUrl(baseUrl, fallbackListId);
|
|
869
|
+
}
|
|
870
|
+
/** 人才卡片:装了 ecode 页面 → /card?talentId=;返回 null 表示该环境用原生页(调用方走原逻辑)。 */
|
|
871
|
+
export async function talentUiCardUrl(host, cache, baseUrl, talentId) {
|
|
872
|
+
if (!talentId)
|
|
873
|
+
return null;
|
|
874
|
+
if (!(await detectTalentUi(host, cache)))
|
|
875
|
+
return null;
|
|
876
|
+
return String(baseUrl).replace(/\/+$/, '') + TALENT_UI_ROUTE + '/card?talentId=' + encodeURIComponent(String(talentId));
|
|
877
|
+
}
|
|
821
878
|
/**
|
|
822
879
|
* 「只打开列表」URL:{base}/sp/ebdfpage/list/{listId}(2026-11-06 用户定稿)。
|
|
823
880
|
*
|
|
@@ -430,6 +430,34 @@ async function resolveTerm(env, systemKey, rawValue, label) {
|
|
|
430
430
|
return selected[0];
|
|
431
431
|
throw workflowClarificationError(clarificationType, text, `${label}「${text}」匹配到 ${selected.length} 个候选项,请确认要查询的具体${label}。`, clarificationCandidates(selected, 10));
|
|
432
432
|
}
|
|
433
|
+
/**
|
|
434
|
+
* `workflowTerm=notin`(**排除**语义)的名称解析(2026-11-11 用户定稿)。
|
|
435
|
+
*
|
|
436
|
+
* 与 `resolveTerm`(in / 查询语义)的差异——
|
|
437
|
+
* - **同名多命中 ⇒ 全部纳入排除集合,不澄清**:系统里同名工作流(实测 4 个同名「内部留言」)
|
|
438
|
+
* 在"XX除外"场景下应全部被排除,让用户挑一个没有意义(实测 todoSmartConvert 被候选澄清拦死);
|
|
439
|
+
* - **0 命中 ⇒ 返回空集**(排除一个不存在的流程 = 无操作,不应拦死整个查询),调用方给 warning;
|
|
440
|
+
* - 无全名精确匹配但候选唯一 ⇒ 收唯一候选;
|
|
441
|
+
* - 无全名精确匹配且候选多个 ⇒ 仍澄清——宽排除会把「报销」这类模糊词扩散到所有含该词的流程,
|
|
442
|
+
* 语义不明必须确认。
|
|
443
|
+
*/
|
|
444
|
+
async function resolveTermForNotin(env, systemKey, rawValue, label) {
|
|
445
|
+
const text = asString(rawValue);
|
|
446
|
+
if (!text)
|
|
447
|
+
return [];
|
|
448
|
+
const parsed = parseNameWithId(text);
|
|
449
|
+
if (parsed.id)
|
|
450
|
+
return [{ id: parsed.id, name: parsed.name || text }];
|
|
451
|
+
const candidates = await resolveNameCandidates(env, SYSTEM_FIELDS[systemKey], text);
|
|
452
|
+
if (!candidates.length)
|
|
453
|
+
return [];
|
|
454
|
+
const exact = candidates.filter((item) => item.name.trim().toLowerCase() === text.trim().toLowerCase());
|
|
455
|
+
if (exact.length >= 1)
|
|
456
|
+
return exact;
|
|
457
|
+
if (candidates.length === 1)
|
|
458
|
+
return candidates;
|
|
459
|
+
throw workflowClarificationError(SYSTEM_CLARIFICATION_TYPES[systemKey], text, `${label}「${text}」匹配到 ${candidates.length} 个候选项且无全名精确匹配,排除范围不明确,请确认要排除的具体${label}。`, clarificationCandidates(candidates, 10));
|
|
460
|
+
}
|
|
433
461
|
/**
|
|
434
462
|
* 读取当前环境的紧急程度列表(来源:Python QUERY_DEPENDENCY → data.requestLevelList)。
|
|
435
463
|
*
|
|
@@ -978,26 +1006,34 @@ export async function buildSearchQuery(env, args, mode) {
|
|
|
978
1006
|
const workflows = asStringArray(args.workflow, 'workflow') ?? splitCsv(args.workflow).map((w) => [w]).flat();
|
|
979
1007
|
// 解析后的工作流成员提升到外层:表单字段条件必须限定到单个工作流,需要在此消费同一份结果
|
|
980
1008
|
const resolvedWorkflows = [];
|
|
1009
|
+
const workflowTerm = asString(args.workflowTerm) === 'notin' ? 'notin' : 'in';
|
|
1010
|
+
// notin(排除)语义下是否有人跳过名称解析(0 命中 = 排除对象不存在 = 无操作),收集词给 warning。
|
|
1011
|
+
const notinMisses = [];
|
|
981
1012
|
if (workflows && workflows.length) {
|
|
982
1013
|
const seenWorkflowIds = new Set();
|
|
983
1014
|
for (const w of workflows) {
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1015
|
+
// 2026-11-11:notin(排除)走专用解析——同名多命中全收、0 命中跳过(见 resolveTermForNotin)。
|
|
1016
|
+
const resolvedList = workflowTerm === 'notin'
|
|
1017
|
+
? await resolveTermForNotin(env, 'workflowid', w, '工作流')
|
|
1018
|
+
: [await resolveTerm(env, 'workflowid', w, '工作流')].filter((resolved) => resolved !== null);
|
|
1019
|
+
if (workflowTerm === 'notin' && resolvedList.length === 0)
|
|
1020
|
+
notinMisses.push(String(w));
|
|
1021
|
+
for (const resolved of resolvedList) {
|
|
1022
|
+
if (resolved.id && seenWorkflowIds.has(resolved.id))
|
|
1023
|
+
continue;
|
|
1024
|
+
if (resolved.id)
|
|
1025
|
+
seenWorkflowIds.add(resolved.id);
|
|
1026
|
+
resolvedWorkflows.push(resolved);
|
|
1027
|
+
}
|
|
992
1028
|
}
|
|
993
1029
|
if (resolvedWorkflows.length) {
|
|
994
1030
|
// 多值必须合并为「单个条件项 + 多 browserDatas」(term 统一),逐值拆成多个条件项会被
|
|
995
1031
|
// 服务端按 AND 处理 → 多工作流查询恒 0 条(来源:Python _plan_workflow_form_datas / build_workflow_condition)
|
|
996
|
-
|
|
997
|
-
formDatas.workflowid = [{ term, browserDatas: resolvedWorkflows }];
|
|
1032
|
+
formDatas.workflowid = [{ term: workflowTerm, browserDatas: resolvedWorkflows }];
|
|
998
1033
|
// workflowid 条件唯一时,取其首个 id 作为 params.searchAdWorkflowid
|
|
999
|
-
// (来源:Python normalize_query_shape,list/total
|
|
1000
|
-
|
|
1034
|
+
// (来源:Python normalize_query_shape,list/total 两种请求体共用)。
|
|
1035
|
+
// 仅 in(查询限定)注入——notin 是排除范围,把排除对象塞进范围参数会反转语义。
|
|
1036
|
+
const firstWorkflowId = workflowTerm === 'in' ? asString(resolvedWorkflows[0]?.id) ?? '' : '';
|
|
1001
1037
|
if (firstWorkflowId) {
|
|
1002
1038
|
query.params = { ...(query.params || {}), searchAdWorkflowid: firstWorkflowId };
|
|
1003
1039
|
}
|
|
@@ -1133,7 +1169,14 @@ export async function buildSearchQuery(env, args, mode) {
|
|
|
1133
1169
|
if (items.length)
|
|
1134
1170
|
query.sortParams = items;
|
|
1135
1171
|
}
|
|
1136
|
-
return {
|
|
1172
|
+
return {
|
|
1173
|
+
query,
|
|
1174
|
+
tabid,
|
|
1175
|
+
// 2026-11-11:notin(排除)语义下 0 命中被跳过的词要透出(不静默丢弃条件)。
|
|
1176
|
+
...(notinMisses.length > 0
|
|
1177
|
+
? { warnings: notinMisses.map((word) => `排除对象「${word}」未匹配到任何工作流,该排除条件未生效`) }
|
|
1178
|
+
: {}),
|
|
1179
|
+
};
|
|
1137
1180
|
}
|
|
1138
1181
|
function safeJsonArray(value) {
|
|
1139
1182
|
try {
|
|
@@ -2268,7 +2311,8 @@ async function highestRequestLevelProbe(env) {
|
|
|
2268
2311
|
}
|
|
2269
2312
|
return null;
|
|
2270
2313
|
}
|
|
2271
|
-
|
|
2314
|
+
/** 从总数接口响应中解析总数;解析不出返回 null(五种字段形态兼容,与 workflow.search 同口径)。 */
|
|
2315
|
+
export function extractTotal(response) {
|
|
2272
2316
|
const record = responseData(response);
|
|
2273
2317
|
const candidates = [record?.total, record?.count, record?.totalCount, record?.data?.total, record?.data?.totalCount];
|
|
2274
2318
|
for (const c of candidates) {
|
|
@@ -4,24 +4,29 @@ import { tmpdir } from 'node:os';
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { WORKFLOW_ENDPOINTS } from '../../endpoints.js';
|
|
6
6
|
import { saveSearchIndex } from '../../state.js';
|
|
7
|
-
import { buildSearchQuery } from '../read.js';
|
|
7
|
+
import { buildSearchQuery, extractTotal } from '../read.js';
|
|
8
8
|
import { projectDisplayRows } from './todoListRows.js';
|
|
9
9
|
import { responseData } from '../shared.js';
|
|
10
10
|
import { openSummaryCache, promptTagOf, SUMMARY_CACHE_FILE_NAME } from './summaryCache.js';
|
|
11
11
|
import { openDetailCache, detailMaterialTagOf } from './todoDetailCache.js';
|
|
12
12
|
import { fetchDetailFacts, stampsOfRows } from './todoSmartConvert.detail.js';
|
|
13
13
|
import { GROUP_MIN_ITEMS_FOR_SUBGROUP, isExpiringTodayRow, isOverdueRow, runGroup, } from './todoSmartConvert.group.js';
|
|
14
|
-
import { COLLECT_FILTER_KEYS, COLLECT_ORDER_KEYS, DEFAULT_TABID, FETCH_PAGE_SIZE, LIST_ENDPOINT_BY_CATEGORY,
|
|
14
|
+
import { COLLECT_FILTER_KEYS, COLLECT_ORDER_KEYS, DEFAULT_CATEGORY, DEFAULT_TABID, DEGRADE_TABID, DEGRADE_TOTAL_THRESHOLD, DEGRADE_WINDOW_DAYS, DEGRADE_WINDOW_LABELS, FETCH_PAGE_SIZE, LIST_ENDPOINT_BY_CATEGORY, TIME_FILTER_KEYS, guardListOnlyHost, readBoundedInt, readCategory, readFetchLimit, readPageSize, rowFromAny, totalEndpointFor, } from './todoSmartConvert.core.js';
|
|
15
15
|
const DEFAULT_REQUEST_SUMMARY_MAX = 50;
|
|
16
16
|
export async function collectRawTodos(args, env) {
|
|
17
17
|
const category = readCategory(args.category);
|
|
18
18
|
// 优先组表达式引用到的原始字段(2026-11-05):只保留这些字段,其余照旧按白名单丢弃。
|
|
19
19
|
// 空集 = 规则没配 / 没引用白名单外的字段 ⇒ 取数行为与历史完全一致。
|
|
20
20
|
const priorityFields = priorityRuleFields();
|
|
21
|
-
const
|
|
21
|
+
const readLimit = readFetchLimit(args.limit);
|
|
22
|
+
// 2026-11-11 用户定稿:`limit` 不传 = 不限条数(翻页取完为止);传了则原样生效(500 上限已废除)。
|
|
23
|
+
const requestedLimit = readLimit.limit;
|
|
24
|
+
const limit = readLimit.limit;
|
|
22
25
|
const pageSize = readPageSize(limit);
|
|
23
|
-
//
|
|
24
|
-
const plannedPages =
|
|
26
|
+
// 计划请求次数:limit 为 null(不限条数)时无法预算,翻页按需进行,只在留痕里记 null。
|
|
27
|
+
const plannedPages = limit === null
|
|
28
|
+
? null
|
|
29
|
+
: Math.max(1, Math.ceil(limit / pageSize));
|
|
25
30
|
// 取数阶段只允许 getTodoListData,getTodo* 分页/统计接口一律拦掉。
|
|
26
31
|
const listEnv = guardListOnlyHost(env);
|
|
27
32
|
const searchArgs = { category };
|
|
@@ -49,17 +54,10 @@ export async function collectRawTodos(args, env) {
|
|
|
49
54
|
warnings.push(`已按通用规则默认排除抄送类身份(isremarks=${defaultIsremarks});如需包含抄送,请在提示词中说明`);
|
|
50
55
|
}
|
|
51
56
|
}
|
|
52
|
-
if (cappedFrom !== undefined) {
|
|
53
|
-
// 超过上限时显式告知,避免调用方误以为已取全量。
|
|
54
|
-
warnings.push(`单次最多只能取 ${MAX_FETCH_LIMIT} 条(${MAX_FETCH_PAGES} 次请求 × ${FETCH_PAGE_SIZE} 条),`
|
|
55
|
-
+ `你要求的 ${cappedFrom} 条已按上限 ${MAX_FETCH_LIMIT} 条处理;`
|
|
56
|
-
+ '如需覆盖更多,请缩小筛选条件(如按工作流、时间范围分批)后再汇总');
|
|
57
|
-
}
|
|
58
57
|
const requestedPageSize = args.pageSize;
|
|
59
58
|
if (requestedPageSize !== undefined && requestedPageSize !== null && requestedPageSize !== ''
|
|
60
59
|
&& Number(requestedPageSize) !== pageSize) {
|
|
61
|
-
warnings.push(`单页条数已按 limit 推导为 ${pageSize}
|
|
62
|
-
+ `忽略传入的 pageSize=${String(requestedPageSize)}`);
|
|
60
|
+
warnings.push(`单页条数已按 limit 推导为 ${pageSize},忽略传入的 pageSize=${String(requestedPageSize)}`);
|
|
63
61
|
}
|
|
64
62
|
// 自定义排序(2026-11-06):与 workflow.search 同口径透传,每页带同一份 sortParams。
|
|
65
63
|
// 翻页是按 current 递增找服务端要的,排序键同值较多时相邻页边界可能重复/漏项——
|
|
@@ -69,15 +67,121 @@ export async function collectRawTodos(args, env) {
|
|
|
69
67
|
warnings.push(`已按自定义排序取数(sort=${sortText});跨页按 requestId 去重,`
|
|
70
68
|
+ '排序键同值较多时相邻页可能重复或漏项,建议配合时间 / 工作流条件缩小范围');
|
|
71
69
|
}
|
|
70
|
+
// ===== 无时间条件时的查询降级(2026-11-11 用户定稿,取代 2026-11-10 版)=====
|
|
71
|
+
// 触发面:仅 category=todo,且四个时间筛选键(TIME_FILTER_KEYS)全部缺失 —— prep 的
|
|
72
|
+
// --days / --from/--to 会推导成 receiveTime,天然被覆盖;「汇总我的待办」这类裸查询才会进来。
|
|
73
|
+
// 链路(每级先探总数,总数 ≤ 200 即按该级取数):
|
|
74
|
+
// 接收时间近一年 → 近 6 个月 → 近 3 个月 → 近 1 个月 → 近 1 个月 + 待处理(tabid=7)。
|
|
75
|
+
// 最后一级是终点级:不探数、不再降级、**不设前 N 条截断**,取到多少处理多少。
|
|
76
|
+
// 总数接口调用失败 / 解析不出总数 ⇒ 直接按终点级走(用户 2026-11-10 定的精神保留);
|
|
77
|
+
// 探数时的**报文构造**失败(如工作流名待澄清)不在这里吞,照常向上抛 —— 只有网络请求与
|
|
78
|
+
// 响应解析算「总数不可得」。用户显式给了页签/子分类(explicitTab)时不覆盖页签,窗口链照走。
|
|
79
|
+
// 带任一时间条件 ⇒ 完全不降级、不限条数,范围内数据全部取出(2026-11-11 用户定)。
|
|
80
|
+
const listPath = LIST_ENDPOINT_BY_CATEGORY[category] ?? WORKFLOW_ENDPOINTS.TODO_LIST;
|
|
81
|
+
const degradeSteps = [];
|
|
82
|
+
let degradeApplied = false;
|
|
83
|
+
/** 降级级别:0=未降级、1..4=近一年/近6个月/近3个月/近1个月、5=近1个月+待处理(终点级)。 */
|
|
84
|
+
let degradeLevel = 0;
|
|
85
|
+
const hasTimeCondition = TIME_FILTER_KEYS.some((key) => {
|
|
86
|
+
const value = searchArgs[key];
|
|
87
|
+
return value !== undefined && value !== null && String(value).trim() !== '';
|
|
88
|
+
});
|
|
89
|
+
// 接收时间窗口:与 prep --days 的「近 N 天」同口径(按天回看),日期取本地时区。
|
|
90
|
+
const receiveTimeWindow = (days) => {
|
|
91
|
+
const end = new Date();
|
|
92
|
+
const start = new Date(end.getTime() - days * 24 * 3600 * 1000);
|
|
93
|
+
const fmt = (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, '0')}-${String(d.getDate()).padStart(2, '0')}`;
|
|
94
|
+
return `${fmt(start)} ${fmt(end)}`;
|
|
95
|
+
};
|
|
96
|
+
// 探总数:报文与列表取数完全一致(去掉 customDisplayPage),路径换成同分类的总数接口。
|
|
97
|
+
const probeTodoTotal = async () => {
|
|
98
|
+
const { query } = await buildSearchQuery(listEnv, { ...searchArgs, current: 1, pageSize }, 'list');
|
|
99
|
+
const totalBody = JSON.parse(JSON.stringify(query));
|
|
100
|
+
delete totalBody.customDisplayPage;
|
|
101
|
+
try {
|
|
102
|
+
const response = await listEnv.host.workflowRequest({
|
|
103
|
+
method: 'POST',
|
|
104
|
+
path: totalEndpointFor(listPath),
|
|
105
|
+
operation: 'workflow.todoSmartConvert.total',
|
|
106
|
+
body: totalBody,
|
|
107
|
+
});
|
|
108
|
+
return extractTotal(response);
|
|
109
|
+
}
|
|
110
|
+
catch {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
if (category === DEFAULT_CATEGORY) {
|
|
115
|
+
// 首轮总数**每次都探**(交付正文第一行要展示首轮总数);降级链路只在无时间条件时走。
|
|
116
|
+
const initialTotal = await probeTodoTotal();
|
|
117
|
+
degradeSteps.push({ level: 'initial', scope: '用户条件原样', total: initialTotal });
|
|
118
|
+
if (!hasTimeCondition && (initialTotal === null || initialTotal > DEGRADE_TOTAL_THRESHOLD)) {
|
|
119
|
+
if (initialTotal === null) {
|
|
120
|
+
// 总数不可得(接口失败/解析不出)⇒ 不再重复探,直接按终点级兜底(2026-11-10 定的精神保留)。
|
|
121
|
+
searchArgs.receiveTime = receiveTimeWindow(DEGRADE_WINDOW_DAYS[DEGRADE_WINDOW_DAYS.length - 1]);
|
|
122
|
+
if (!explicitTab)
|
|
123
|
+
searchArgs.tabid = DEGRADE_TABID;
|
|
124
|
+
degradeApplied = true;
|
|
125
|
+
degradeLevel = DEGRADE_WINDOW_DAYS.length + 1;
|
|
126
|
+
const scope = explicitTab
|
|
127
|
+
? `接收时间近1个月(保持用户指定页签)`
|
|
128
|
+
: `接收时间近1个月 + 待处理(tabid=${DEGRADE_TABID})`;
|
|
129
|
+
degradeSteps.push({ level: 'final', scope, total: null });
|
|
130
|
+
warnings.push('待办总数接口(getTodoListTotal)调用失败或无法解析总数,'
|
|
131
|
+
+ `已直接按最严降级走:「${scope}」;这是最后一级,取到多少处理多少,不再截断`);
|
|
132
|
+
}
|
|
133
|
+
else {
|
|
134
|
+
// 窗口降级链:写入 receiveTime 后再探该窗口的总数,≤ 200 即按该级取数。
|
|
135
|
+
// (receiveTime 每级覆盖前一级;链走完后留下的一定是入选窗口或终点级窗口。)
|
|
136
|
+
let matched = false;
|
|
137
|
+
for (let i = 0; i < DEGRADE_WINDOW_DAYS.length; i += 1) {
|
|
138
|
+
searchArgs.receiveTime = receiveTimeWindow(DEGRADE_WINDOW_DAYS[i]);
|
|
139
|
+
const scope = `接收时间${DEGRADE_WINDOW_LABELS[i]}`;
|
|
140
|
+
const total = await probeTodoTotal();
|
|
141
|
+
degradeSteps.push({ level: `window${i + 1}`, scope, total });
|
|
142
|
+
if (total !== null && total <= DEGRADE_TOTAL_THRESHOLD) {
|
|
143
|
+
degradeApplied = true;
|
|
144
|
+
degradeLevel = i + 1;
|
|
145
|
+
warnings.push(`无时间条件且待办总数 ${initialTotal} 条 > ${DEGRADE_TOTAL_THRESHOLD},`
|
|
146
|
+
+ `已降级为「${scope}」;该范围总数 ${total} 条在阈值内,按该范围取数`);
|
|
147
|
+
matched = true;
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
if (total === null)
|
|
151
|
+
break; // 总数不可得 ⇒ 跳终点级兜底
|
|
152
|
+
}
|
|
153
|
+
if (!matched) {
|
|
154
|
+
// 终点级:近 1 个月 + 待处理(tabid=7)。不探数、不再降级、不截断,取到多少处理多少。
|
|
155
|
+
searchArgs.receiveTime = receiveTimeWindow(DEGRADE_WINDOW_DAYS[DEGRADE_WINDOW_DAYS.length - 1]);
|
|
156
|
+
if (!explicitTab)
|
|
157
|
+
searchArgs.tabid = DEGRADE_TABID;
|
|
158
|
+
degradeApplied = true;
|
|
159
|
+
degradeLevel = DEGRADE_WINDOW_DAYS.length + 1;
|
|
160
|
+
const scope = explicitTab
|
|
161
|
+
? `接收时间近1个月(保持用户指定页签)`
|
|
162
|
+
: `接收时间近1个月 + 待处理(tabid=${DEGRADE_TABID})`;
|
|
163
|
+
degradeSteps.push({ level: 'final', scope, total: null });
|
|
164
|
+
warnings.push(`无时间条件且各降级窗口总数均 > ${DEGRADE_TOTAL_THRESHOLD},`
|
|
165
|
+
+ `已降级为「${scope}」;这是最后一级,取到多少处理多少,不再截断`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
72
170
|
const seen = new Set();
|
|
73
171
|
const items = [];
|
|
74
172
|
let duplicateCount = 0;
|
|
75
173
|
let totalAvailable = null;
|
|
76
174
|
let pages = 0;
|
|
77
175
|
let stoppedEarly = false;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
176
|
+
// 翻页:按 current 递增,取到「累计达到 limit(若传)/ 空页 / 页不满」为止;
|
|
177
|
+
// limit 不传(不限条数)时翻到数据取完为止(2026-11-11 用户定稿:不再有页数/条数上限)。
|
|
178
|
+
for (let pageNo = 1; limit === null || pageNo <= (plannedPages ?? 0); pageNo += 1) {
|
|
179
|
+
const { query, warnings: buildWarnings } = await buildSearchQuery(listEnv, { ...searchArgs, current: pageNo, pageSize }, 'list');
|
|
180
|
+
// notin(排除)语义下 0 命中被跳过的词(2026-11-11):透出,不静默。
|
|
181
|
+
for (const warning of buildWarnings ?? []) {
|
|
182
|
+
if (!warnings.includes(warning))
|
|
183
|
+
warnings.push(warning);
|
|
184
|
+
}
|
|
81
185
|
// 2026-11-02:isremarks(备注筛选,多个数字英文逗号拼接)只由汇总链路透传,放 params 层。
|
|
82
186
|
// 注入点故意放在 collect 内部而非共享的 buildSearchQuery,保证 workflow.search 的代码路径零改动。
|
|
83
187
|
const isremarks = String(searchArgs.isremarks ?? '').trim();
|
|
@@ -141,8 +245,8 @@ export async function collectRawTodos(args, env) {
|
|
|
141
245
|
}
|
|
142
246
|
if (added === 0)
|
|
143
247
|
break;
|
|
144
|
-
//
|
|
145
|
-
if (items.length >= limit)
|
|
248
|
+
// 累计到目标条数即停(limit 不传 = 不限条数,跳过该判断):`limit` 是阈值,不是「最多取一页」。
|
|
249
|
+
if (limit !== null && items.length >= limit)
|
|
146
250
|
break;
|
|
147
251
|
// 这一页不满 pageSize ⇒ 已经没有下一页,不必再请求。
|
|
148
252
|
if (pageRows.length < pageSize)
|
|
@@ -213,7 +317,7 @@ export async function collectRawTodos(args, env) {
|
|
|
213
317
|
if (stoppedEarly && items.length === 0) {
|
|
214
318
|
warnings.push('列表接口没有返回任何明细,请确认筛选条件是否过窄');
|
|
215
319
|
}
|
|
216
|
-
if (totalAvailable !== null && items.length < totalAvailable) {
|
|
320
|
+
if (limit !== null && totalAvailable !== null && items.length < totalAvailable) {
|
|
217
321
|
warnings.push(`共 ${totalAvailable} 条待办,本次按 ${pages} 次请求(每次最多 ${FETCH_PAGE_SIZE} 条)取到 ${items.length} 条;`
|
|
218
322
|
+ `已到本次 limit=${limit} 的阈值——`
|
|
219
323
|
+ '需要覆盖更多请调大 limit,或缩小筛选条件(工作流 / 时间范围)分批汇总');
|
|
@@ -352,19 +456,31 @@ export async function collectRawTodos(args, env) {
|
|
|
352
456
|
query: {
|
|
353
457
|
category,
|
|
354
458
|
...(scope ? { tabid: searchArgs.tabid } : {}),
|
|
355
|
-
/**
|
|
356
|
-
requestedLimit
|
|
357
|
-
/**
|
|
459
|
+
/** 用户原始诉求;不传 = null(不限条数,翻页取完为止)。 */
|
|
460
|
+
requestedLimit,
|
|
461
|
+
/** 计划请求次数;limit 不传(不限条数)时为 null(按需翻页,无上限)。 */
|
|
358
462
|
plannedPages,
|
|
359
463
|
/** 实际发出的列表请求次数 */
|
|
360
464
|
pages,
|
|
361
465
|
/** 单页大小(limit ≤ 100 时等于 limit,否则固定 100) */
|
|
362
466
|
pageSize,
|
|
363
|
-
/** 计划能覆盖的条数上限 = 计划页数 ×
|
|
364
|
-
appliedLimit: plannedPages * pageSize,
|
|
467
|
+
/** 计划能覆盖的条数上限 = 计划页数 × 单页(实际可能更少,取决于服务端还有没有数据);不限条数时为 null。 */
|
|
468
|
+
appliedLimit: plannedPages === null ? null : plannedPages * pageSize,
|
|
365
469
|
totalAvailable,
|
|
366
470
|
/** 取数只用了这一个接口(照实写出来,便于核对「有没有偷偷调别的」) */
|
|
367
471
|
endpoint: listPath,
|
|
472
|
+
/** 无时间条件时的查询降级留痕(2026-11-11 新链路):steps 按探数顺序记录每级的范围与总数;
|
|
473
|
+
* level 0=未降级、1..4=接收时间近一年/近6个月/近3个月/近1个月、5=近1个月+待处理(终点级,
|
|
474
|
+
* 不再截断)。首轮探数对带时间条件的查询也会做(2026-11-10 起),此时 applied=false、level=0,
|
|
475
|
+
* 总数供交付正文展示。 */
|
|
476
|
+
...(degradeSteps.length > 0 ? {
|
|
477
|
+
degrade: {
|
|
478
|
+
threshold: DEGRADE_TOTAL_THRESHOLD,
|
|
479
|
+
applied: degradeApplied,
|
|
480
|
+
level: degradeLevel,
|
|
481
|
+
steps: degradeSteps,
|
|
482
|
+
},
|
|
483
|
+
} : {}),
|
|
368
484
|
/** 自定义排序原文(不在 filters 里:它是排序不是筛选条件) */
|
|
369
485
|
...(sortText ? { sort: sortText } : {}),
|
|
370
486
|
filters: Object.fromEntries(Object.entries(searchArgs).filter(([key]) => !['category', 'tabid', 'sort'].includes(key))),
|
|
@@ -195,14 +195,13 @@ export const RESUME_INPUT_KEYS = [
|
|
|
195
195
|
'skillTiming',
|
|
196
196
|
'smartSmmaryTitle',
|
|
197
197
|
];
|
|
198
|
-
/**
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
198
|
+
/**
|
|
199
|
+
* collect 的取数条数语义(2026-11-11 用户定稿,取代 2026-11-10 的「默认 200 / 上限 500」):
|
|
200
|
+
* `limit` 不传 = **不限条数**,翻页取到空页为止;用户显式传 `limit` 时按用户值截停。
|
|
201
|
+
* 无时间条件时的取数范围由降级链收窄(见 `DEGRADE_WINDOW_DAYS`),不再用条数上限兜底。
|
|
202
|
+
*/
|
|
202
203
|
/** 列表接口单页上限。 */
|
|
203
204
|
export const FETCH_PAGE_SIZE = 100;
|
|
204
|
-
/** 安全上限:最多 5 次请求(`current` 1..5),覆盖 500 条。 */
|
|
205
|
-
export const MAX_FETCH_PAGES = 5;
|
|
206
205
|
/** 分类 → 列表接口。collect 只使用列表接口,不调总数或详情接口。 */
|
|
207
206
|
export const LIST_ENDPOINT_BY_CATEGORY = {
|
|
208
207
|
todo: WORKFLOW_ENDPOINTS.TODO_LIST,
|
|
@@ -213,16 +212,42 @@ export const LIST_ENDPOINT_BY_CATEGORY = {
|
|
|
213
212
|
export const DEFAULT_CATEGORY = 'todo';
|
|
214
213
|
/** 默认「全部待办」使用 tabid 0,确保列表接口返回平铺数据。 */
|
|
215
214
|
export const DEFAULT_TABID = '0';
|
|
215
|
+
// ===== 无时间条件时的查询降级(2026-11-11 用户定稿,取代 2026-11-10 版)=====
|
|
216
|
+
// 触发面:仅 category=todo,且四个时间筛选键全部缺失(判定口径见 TIME_FILTER_KEYS)。
|
|
217
|
+
// 链路(每级先探总数,总数 ≤ 200 即按该级取数):
|
|
218
|
+
// 接收时间近一年 → 近 6 个月 → 近 3 个月 → 近 1 个月 → 近 1 个月 + 待处理(tabid=7)。
|
|
219
|
+
// 最后一级是**终点级**:不探数、不再降级、不设前 N 条截断,取到多少处理多少。
|
|
220
|
+
// 带任一时间条件 ⇒ 完全不降级、不限条数,范围内数据全部取出。
|
|
221
|
+
/** 降级触发阈值:探到的总数超过它才降下一级。 */
|
|
222
|
+
export const DEGRADE_TOTAL_THRESHOLD = 200;
|
|
223
|
+
/** 降级链的接收时间回看窗口(天):近一年 → 近 6 个月 → 近 3 个月 → 近 1 个月。 */
|
|
224
|
+
export const DEGRADE_WINDOW_DAYS = [365, 180, 90, 30];
|
|
225
|
+
/** 窗口级(1..4)的中文范围说明,与 DEGRADE_WINDOW_DAYS 一一对应。 */
|
|
226
|
+
export const DEGRADE_WINDOW_LABELS = ['近一年', '近6个月', '近3个月', '近1个月'];
|
|
227
|
+
/** 终点级追加的页签:待处理。 */
|
|
228
|
+
export const DEGRADE_TABID = '7';
|
|
229
|
+
/** 判定「用户带时间条件」的筛选键:任一存在即不做降级(prep 的 --days/--from/--to 会推导成 receiveTime,天然覆盖)。 */
|
|
230
|
+
export const TIME_FILTER_KEYS = ['createTime', 'operateTime', 'receiveTime', 'finishTime'];
|
|
231
|
+
/** 列表接口路径 → 同分类的总数接口路径(`/data/getXxxListData` → `/total/getXxxListTotal`)。 */
|
|
232
|
+
export function totalEndpointFor(listPath) {
|
|
233
|
+
const totalPath = listPath.replace('/data/', '/total/').replace(/Data$/u, 'Total');
|
|
234
|
+
if (totalPath === listPath) {
|
|
235
|
+
throw workflowValidationError('total_endpoint_unknown', `无法从列表接口推导总数接口:${listPath}`);
|
|
236
|
+
}
|
|
237
|
+
return totalPath;
|
|
238
|
+
}
|
|
216
239
|
export const CATEGORY_VALUES = ['todo', 'done', 'mine', 'all'];
|
|
240
|
+
/**
|
|
241
|
+
* collect 目标条数(2026-11-11 用户定稿):不传 = `null`(**不限条数**,翻页取完为止);
|
|
242
|
+
* 传了则必须是 ≥1 的整数,原样生效(不再有 500 上限压缩)。
|
|
243
|
+
*/
|
|
217
244
|
export function readFetchLimit(value) {
|
|
218
245
|
if (value === undefined || value === null || value === '')
|
|
219
|
-
return { limit:
|
|
246
|
+
return { limit: null };
|
|
220
247
|
const parsed = Number(value);
|
|
221
248
|
if (!Number.isInteger(parsed) || parsed < 1) {
|
|
222
249
|
throw workflowValidationError('limit_invalid', `limit 必须是 ≥1 的整数,收到 ${String(value)}`);
|
|
223
250
|
}
|
|
224
|
-
if (parsed > MAX_FETCH_LIMIT)
|
|
225
|
-
return { limit: MAX_FETCH_LIMIT, cappedFrom: parsed };
|
|
226
251
|
return { limit: parsed };
|
|
227
252
|
}
|
|
228
253
|
export function readCategory(value) {
|
|
@@ -237,12 +262,15 @@ export function readCategory(value) {
|
|
|
237
262
|
/**
|
|
238
263
|
* 单页大小:**由 limit 推导,不再接受外部指定**。
|
|
239
264
|
*
|
|
265
|
+
* - `limit` 不传(不限条数)→ 固定 100,靠 `current` 递增翻页取到空页为止;
|
|
240
266
|
* - `limit ≤ 100` → 单页就是 limit(用户说 30 条就只请求 30 条,不多拿 70 条);
|
|
241
|
-
* - `limit > 100` → 固定 100,靠 `current` 递增翻页直到累计到 limit
|
|
267
|
+
* - `limit > 100` → 固定 100,靠 `current` 递增翻页直到累计到 limit。
|
|
242
268
|
*
|
|
243
269
|
* 显式传 `pageSize` 不采用:页大小必须和「累计到 limit 即停」配套,否则同一份 plan 会翻错页。
|
|
244
270
|
*/
|
|
245
271
|
export function readPageSize(limit) {
|
|
272
|
+
if (limit === null)
|
|
273
|
+
return FETCH_PAGE_SIZE;
|
|
246
274
|
return limit <= FETCH_PAGE_SIZE ? limit : FETCH_PAGE_SIZE;
|
|
247
275
|
}
|
|
248
276
|
/** collect 阶段只允许列表数据接口,避免隐式增加总数或辅助统计请求。 */
|
|
@@ -253,7 +281,9 @@ export function guardListOnlyHost(env) {
|
|
|
253
281
|
if (prop === 'workflowRequest') {
|
|
254
282
|
return async (request) => {
|
|
255
283
|
const path = String(request?.path ?? '');
|
|
256
|
-
|
|
284
|
+
// 2026-11-10:放行 getTodoListTotal —— 无时间条件时的查询降级需要先探总数
|
|
285
|
+
// (入参与 getTodoListData 一致,见 collect 的降级块);其余 getTodo* 分页/统计接口照旧拦掉。
|
|
286
|
+
if (/getTodo(?!List(?:Data|Total))/u.test(path)) {
|
|
257
287
|
throw workflowValidationError('forbidden_endpoint', `取数阶段只允许调用 getTodoListData;${path} 属于 getTodo* 分页/统计辅助接口,已禁止`, { retryAllowed: false, details: { path } });
|
|
258
288
|
}
|
|
259
289
|
return target.workflowRequest(request);
|
|
@@ -403,9 +433,7 @@ export function readItems(rawItems) {
|
|
|
403
433
|
if (rawItems.length === 0) {
|
|
404
434
|
throw workflowValidationError('items_empty', 'items 为空数组,没有可汇总的待办');
|
|
405
435
|
}
|
|
406
|
-
|
|
407
|
-
throw workflowValidationError('items_too_many', `单次最多 500 条,收到 ${rawItems.length} 条;请先分页缩减范围`);
|
|
408
|
-
}
|
|
436
|
+
// 2026-11-11:条数上限已废除(与 collect「查所有」对齐),只保留非空校验与去重。
|
|
409
437
|
const seen = new Set();
|
|
410
438
|
const rows = [];
|
|
411
439
|
let duplicateCount = 0;
|
|
@@ -2,7 +2,7 @@ import { workflowValidationError } from '../../errors.js';
|
|
|
2
2
|
import { FLOW_STATUS_HINT } from '../flow-status.js';
|
|
3
3
|
import { TIME_DESCRIPTIONS, SORT_OPTIONS } from '../read.js';
|
|
4
4
|
import { planTodoOutput } from './todoOutputPlanner.js';
|
|
5
|
-
import { assertKnownKeys, buildSkillTiming, CATEGORY_VALUES, DEFAULT_CATEGORY,
|
|
5
|
+
import { assertKnownKeys, buildSkillTiming, CATEGORY_VALUES, DEFAULT_CATEGORY, DEFAULT_TOP_N, FETCH_PAGE_SIZE, GROUP_BY_VALUES, STAGE_VALUES, workflowSuccess, } from './todoSmartConvert.core.js';
|
|
6
6
|
import { collectRawTodos } from './todoSmartConvert.collect.js';
|
|
7
7
|
import { runSmartConvert } from './todoSmartConvert.aggregate.js';
|
|
8
8
|
import { runGroup } from './todoSmartConvert.group.js';
|
|
@@ -22,8 +22,7 @@ const inputSchema = schemaOf({
|
|
|
22
22
|
items: {
|
|
23
23
|
type: 'array',
|
|
24
24
|
minItems: 1,
|
|
25
|
-
|
|
26
|
-
description: '待办条目。未传时 collect 出网取数;传入后只做本地归一、分组或摘要回填。',
|
|
25
|
+
description: '待办条目。未传时 collect 出网取数;传入后只做本地归一、分组或摘要回填。条数不设上限(2026-11-11:与 collect「查所有」对齐)。',
|
|
27
26
|
items: { type: 'object' },
|
|
28
27
|
},
|
|
29
28
|
aiGroups: {
|
|
@@ -70,9 +69,8 @@ const inputSchema = schemaOf({
|
|
|
70
69
|
limit: {
|
|
71
70
|
type: 'integer',
|
|
72
71
|
minimum: 1,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
description: 'collect 目标条数;单页最多 ' + FETCH_PAGE_SIZE + ' 条,最多 ' + MAX_FETCH_PAGES + ' 页。',
|
|
72
|
+
description: 'collect 目标条数;不传 = 不限条数(翻页取完为止,无时间条件时按降级链自动收窄范围);'
|
|
73
|
+
+ '传了则累计到该条数即停。单页最多 ' + FETCH_PAGE_SIZE + ' 条。(2026-11-11:原 500 上限已废除)',
|
|
76
74
|
},
|
|
77
75
|
pageSize: {
|
|
78
76
|
type: 'integer',
|
package/docs/SKILL.md
CHANGED
|
@@ -32,8 +32,9 @@ skills/weaver-e10-<name>/
|
|
|
32
32
|
## 已内置业务模块
|
|
33
33
|
|
|
34
34
|
- `invoice`:E10 业票通发票管理。源码说明先读 `docs/invoice.md`;面向 Agent 时先读 `skills/weaver-e10-yepiaotong/SKILL.md`,再按入口路由读取对应 reference。
|
|
35
|
-
- `fna`:E10 齐业成费控中心(预算查询/费用中心/报销报表 AI
|
|
35
|
+
- `fna`:E10 齐业成费控中心(预算查询/费用中心/报销报表 AI 问答/AI 规则预审/借款管理/发票核销)。源码说明先读 `docs/fna.md`;面向 Agent 时先读 `skills/weaver-e10-qiyecheng/SKILL.md`,再按入口路由读取对应 reference。写操作(提醒还款/催票/AI 预审)走 prepare/apply 确认链。
|
|
36
36
|
- `plan`:E10 计划报告(报告查询/新建/修改/发布/撤回/提交提醒/评论),自动适配标准版与 e10-ebuilder 两套报告接口链路。源码说明先读 `docs/plan.md`;面向 Agent 时先读 `skills/weaver-e10-plan/SKILL.md`,再按入口路由读取对应 reference。写操作走 prepare/apply 确认链。
|
|
37
|
+
- `data`:E10 问数聚合命令(DSL 查询 / 数据源发现与取数 / 词库 / 字段值翻译 / 配置中心 / 场景定位 / 模块接口调用 / 考勤),31 个 operation 全部只读,由原独立 CLI `e10-data` 迁移而来,参数名与输出口径逐字保留。源码说明先读 `docs/data.md`;面向 Agent 时先读 `skills/weaver-e10-data/SKILL.md`,再按入口路由读取对应 reference。`doc` 系列、`field.id2name`、`refusal`、`exp` 列为禁用边界(走配置中心 DOCUMENT / `field options` / 宿主平台 / `skills repo`)。
|
|
37
38
|
- `esb`:E10 ESB 中心自定义触发动作流(入参模板查询 + 触发)。源码说明先读 `docs/esb.md`;面向 Agent 时先读 `skills/weaver-e10-esb/SKILL.md`,再按入口路由读取对应 reference。触发动作流是写操作,走 prepare/apply 确认链。
|
|
38
39
|
- `okr`:E10 OKR 目标管理(目标分页查询/详情、关键成果查询与保存、目标对齐、目标评论、详情页链接),按 `ver_name` 自动适配 e10 标准版与 e10-ebuilder 两套接口链路。源码说明先读 `docs/okr.md`;面向 Agent 时先读 `skills/weaver-e10-okr/SKILL.md`,再按入口路由读取对应 reference。写操作(新建/编辑目标、保存关键成果、添加目标对齐)走 prepare/apply 确认链。
|
|
39
40
|
- `ebuilder-form`:E10 eBuilder 表单(菜单定位、List/NList 分页和配置、字段/选项/浏览字段解析、OpenAPI 与已发布自定义接口读写)。源码说明先读 `docs/ebuilder-form.md`;面向 Agent 时先读 `skills/weaver-e10-ebuilder-form/SKILL.md`,再按入口路由读取对应 reference。写操作走 prepare/apply 确认链。
|
package/docs/_catalog.md
CHANGED
|
@@ -7,10 +7,13 @@
|
|
|
7
7
|
| Agent Skill 模板、业务域关键词、入口和 reference 拆分方式 | `skill-template/` |
|
|
8
8
|
| Agent 共享规则、安装检查、JSON 输出、高风险写入 | `skills/weaver-e10-shared/SKILL.md` |
|
|
9
9
|
| Agent 共享规则细节:安装、E10 登录、JSON 输出、写入协议 | `skills/weaver-e10-shared/references/` |
|
|
10
|
+
| 泛微 E10 问数(数据源取数/配置中心/场景定位/模块接口调用)、data operation、31 个 operation 与 6 条禁用边界 | `docs/data.md` |
|
|
11
|
+
| Agent 调用 E10 数据助手 CLI 的入口路由 | `skills/weaver-e10-data/SKILL.md` |
|
|
12
|
+
| Agent 调用 E10 数据助手 CLI 的具体 reference(取数纪律/配置中心组参/场景与杂项) | `skills/weaver-e10-data/references/` |
|
|
10
13
|
| 业票通发票管理、报销填单、智能开票、invoice operation、写操作 prepare/apply | `docs/invoice.md` |
|
|
11
14
|
| E10 会议管理(标准版:查询/冲突/预约/回执/签到)、meeting operation、写操作 prepare/apply | `docs/meeting.md` |
|
|
12
15
|
| 聚才林人事云(人事档案/出勤/薪酬)、ehr operation、写操作 prepare/apply | `docs/ehr.md` |
|
|
13
|
-
| 齐业成费控中心(预算/费用中心/报销报表 AI
|
|
16
|
+
| 齐业成费控中心(预算/费用中心/报销报表 AI 问答/AI 规则预审/借款管理/发票核销)、fna operation、提醒还款/催票/AI 预审 prepare/apply | `docs/fna.md` |
|
|
14
17
|
| 文书定档案管理(全宗/检索/借阅车/借阅单/发起借阅/预归档上传)、wenshuding operation | `docs/wenshuding.md` |
|
|
15
18
|
| 计划报告管理(报告查询/新建/修改/发布/撤回/提交提醒/评论)、plan operation、写操作 prepare/apply | `docs/plan.md` |
|
|
16
19
|
| 客户参观接待(面板/行程单与内部方案/填单页预填)、reception operation、零写请求 | `docs/reception.md` |
|