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
|
@@ -1,225 +1,25 @@
|
|
|
1
1
|
import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
|
+
import {
|
|
4
|
+
hrmEmployeeOperations
|
|
5
|
+
} from "./chunk-IW7A2IQY.js";
|
|
6
|
+
import {
|
|
7
|
+
hrmOrgOperations
|
|
8
|
+
} from "./chunk-5QYE52LG.js";
|
|
3
9
|
import {
|
|
4
10
|
READ,
|
|
5
11
|
SCHEMA_ID,
|
|
6
|
-
SCHEMA_PAGE,
|
|
7
12
|
browserBaseBody,
|
|
8
|
-
hrmEmployeeOperations,
|
|
9
13
|
hrmSuccess,
|
|
10
14
|
orgLink,
|
|
11
|
-
pickDefined,
|
|
12
15
|
positionLink,
|
|
13
16
|
schemaOf,
|
|
14
|
-
toNumber
|
|
15
|
-
|
|
16
|
-
toStringIdList
|
|
17
|
-
} from "./chunk-O6CMPO65.js";
|
|
17
|
+
toNumber
|
|
18
|
+
} from "./chunk-JEQHNNSS.js";
|
|
18
19
|
import {
|
|
19
20
|
hrmValidationError
|
|
20
21
|
} from "./chunk-56EZERK4.js";
|
|
21
22
|
|
|
22
|
-
// src/shortcuts/hrm/operations/org.ts
|
|
23
|
-
var ORG_TYPES = ["subcompany", "department"];
|
|
24
|
-
var orgQuery = {
|
|
25
|
-
name: "hrm.org.query",
|
|
26
|
-
resource: "org",
|
|
27
|
-
method: "org.query",
|
|
28
|
-
action: "hrm.org.query",
|
|
29
|
-
summary: "\u6309\u540D\u79F0/\u7F16\u53F7/\u4E0A\u7EA7\u7EC4\u7EC7\u67E5\u8BE2\u5206\u90E8\u6216\u90E8\u95E8\uFF08type \u533A\u5206\uFF1B\u4E0D\u4F20 type \u65F6\u9ED8\u8BA4\u90E8\u95E8\uFF0C\u53EF\u7528 type \u5207\u5206\u90E8\u5206\u90E8\uFF09",
|
|
30
|
-
risk: READ,
|
|
31
|
-
inputSchema: schemaOf({
|
|
32
|
-
type: { type: "string", enum: [...ORG_TYPES], description: "subcompany \u5206\u90E8 / department \u90E8\u95E8\uFF1B\u4E0D\u4F20\u9ED8\u8BA4 department" },
|
|
33
|
-
name: { type: "string", description: "\u540D\u79F0\uFF08\u6A21\u7CCA\u5305\u542B\u5339\u914D\uFF09" },
|
|
34
|
-
code: { type: "string", description: "\u7F16\u53F7\uFF08\u6A21\u7CCA\u5305\u542B\u5339\u914D\uFF09" },
|
|
35
|
-
parent: { type: "array", items: SCHEMA_ID, description: "\u4E0A\u7EA7\u90E8\u95E8 id \u6570\u7EC4\uFF08\u90E8\u95E8\u6302\u5728\u90E8\u95E8\u4E0B\uFF0Cdepartment\uFF09" },
|
|
36
|
-
subcompany: { type: "array", items: SCHEMA_ID, description: "\u4E0A\u7EA7\u5206\u90E8 id \u6570\u7EC4\uFF08\u90E8\u95E8\u6302\u5728\u5206\u90E8\u4E0B\uFF0Cdepartment\uFF09" },
|
|
37
|
-
supSubDepartment: { type: "array", items: SCHEMA_ID, description: "\u4E0A\u7EA7\u5206\u90E8 id \u6570\u7EC4\uFF08\u5206\u90E8\u6302\u5728\u5206\u90E8\u4E0B\uFF0Csubcompany\uFF09" },
|
|
38
|
-
...SCHEMA_PAGE
|
|
39
|
-
}),
|
|
40
|
-
handler: async (args, { host }) => {
|
|
41
|
-
const type = args.type === void 0 ? "department" : String(args.type);
|
|
42
|
-
if (!ORG_TYPES.includes(type)) {
|
|
43
|
-
throw hrmValidationError("enum_invalid", `type \u53D6\u503C\u5FC5\u987B\u662F ${ORG_TYPES.join(" / ")} \u4E4B\u4E00`);
|
|
44
|
-
}
|
|
45
|
-
const name = args.name === void 0 ? "" : String(args.name).trim();
|
|
46
|
-
const code = args.code === void 0 ? "" : String(args.code).trim();
|
|
47
|
-
const parentIds = toStringIdList(args.parent, "parent");
|
|
48
|
-
const subcompanyIds = toStringIdList(args.subcompany, "subcompany");
|
|
49
|
-
const supSubDepartmentIds = toStringIdList(args.supSubDepartment, "supSubDepartment");
|
|
50
|
-
const hasText = name !== "" || code !== "";
|
|
51
|
-
const hasOrg = Boolean(parentIds?.length || subcompanyIds?.length || supSubDepartmentIds?.length);
|
|
52
|
-
if (!hasText && !hasOrg) {
|
|
53
|
-
throw hrmValidationError("empty_condition", "\u7EC4\u7EC7\u67E5\u8BE2\u5FC5\u987B\u643A\u5E26\u81F3\u5C11\u4E00\u4E2A\u6536\u655B\u6761\u4EF6\uFF1Aname / code / parent / subcompany / supSubDepartment");
|
|
54
|
-
}
|
|
55
|
-
const formDatas = {};
|
|
56
|
-
if (name) formDatas.name = [{ nameCondition: { id: "in", content: "\u5305\u542B", disabled: false }, name }];
|
|
57
|
-
if (code) formDatas.code = [{ codeCondition: { id: "in", content: "\u5305\u542B", disabled: false }, code }];
|
|
58
|
-
if (parentIds?.length) {
|
|
59
|
-
formDatas.parent = [{ parentCondition: { id: "eq", content: "\u7B49\u4E8E", disabled: false }, parent: parentIds.map((id) => ({ id })) }];
|
|
60
|
-
}
|
|
61
|
-
if (subcompanyIds?.length) {
|
|
62
|
-
formDatas.subcompany = [{ subcompanyCondition: { id: "eq", content: "\u7B49\u4E8E", disabled: false }, subcompany: subcompanyIds.map((id) => ({ id })) }];
|
|
63
|
-
}
|
|
64
|
-
if (supSubDepartmentIds?.length) {
|
|
65
|
-
formDatas.supSubDepartment = [{ supSubDepartmentCondition: { id: "eq", content: "\u7B49\u4E8E", disabled: false }, supSubDepartment: supSubDepartmentIds.map((id) => ({ id })) }];
|
|
66
|
-
}
|
|
67
|
-
const body = {
|
|
68
|
-
...browserBaseBody(),
|
|
69
|
-
virtualType: "ALL",
|
|
70
|
-
cmd: "list",
|
|
71
|
-
formDatas,
|
|
72
|
-
quickSearchDatas: {},
|
|
73
|
-
type: "and",
|
|
74
|
-
stopDepartment: false
|
|
75
|
-
};
|
|
76
|
-
const current = toPositiveInt(args.current, "current") ?? 1;
|
|
77
|
-
const pageSize = toNumber(args.pageSize, "pageSize") ?? 200;
|
|
78
|
-
body.current = current;
|
|
79
|
-
body.pageSize = pageSize;
|
|
80
|
-
const path = type === "subcompany" ? "/api/hrm/common/browser/data/subcompany" : "/api/hrm/common/browser/data/department";
|
|
81
|
-
const resp = await host.request({ method: "POST", path, body });
|
|
82
|
-
const d = resp?.data ?? {};
|
|
83
|
-
const rawRows = Array.isArray(d.data) ? d.data : [];
|
|
84
|
-
const session = await host.getSession();
|
|
85
|
-
const baseUrl = session.baseUrl.replace(/\/+$/, "");
|
|
86
|
-
const rows = rawRows.map((r) => ({ ...r, link: orgLink(baseUrl, r.id) }));
|
|
87
|
-
return hrmSuccess("hrm.org.query", { rows, total: Number(d.total ?? rows.length), type }, { current, pageSize });
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
var orgDetail = {
|
|
91
|
-
name: "hrm.org.detail",
|
|
92
|
-
resource: "org",
|
|
93
|
-
method: "org.detail",
|
|
94
|
-
action: "hrm.org.detail",
|
|
95
|
-
summary: "\u6309\u7EC4\u7EC7\u8282\u70B9 id \u53D6\u90E8\u95E8/\u5206\u90E8\u8BE6\u60C5\u8868\u5355\uFF08\u7C7B\u578B\u7531\u670D\u52A1\u7AEF\u6309\u8BB0\u5F55\u81EA\u52A8\u5224\u65AD\uFF1B\u542B\u5168\u8DEF\u5F84 fullPath \u4E0E\u4EBA\u5458\u7EDF\u8BA1\uFF09",
|
|
96
|
-
risk: READ,
|
|
97
|
-
inputSchema: schemaOf(
|
|
98
|
-
{ id: SCHEMA_ID },
|
|
99
|
-
{ required: ["id"] }
|
|
100
|
-
),
|
|
101
|
-
handler: async (args, { host }) => {
|
|
102
|
-
const id = String(args.id).trim();
|
|
103
|
-
if (!id) throw hrmValidationError("id_required", "id \u5FC5\u586B");
|
|
104
|
-
const session = await host.getSession();
|
|
105
|
-
const baseUrl = session.baseUrl.replace(/\/+$/, "");
|
|
106
|
-
const resp = await host.request({
|
|
107
|
-
method: "GET",
|
|
108
|
-
path: "/api/bs/hrm/organization/getForm",
|
|
109
|
-
query: { id, readOnly: true, includeSub: true, quote: true, isMobile: false },
|
|
110
|
-
headers: { Referer: `${baseUrl}/sp/hrm/orgCard/${id}` }
|
|
111
|
-
});
|
|
112
|
-
const raw = resp?.data?.data ?? {};
|
|
113
|
-
const parentName = Array.isArray(raw.parent) && raw.parent[0]?.name ? String(raw.parent[0].name) : "";
|
|
114
|
-
const subcompanyName = Array.isArray(raw.subcompany) && raw.subcompany[0]?.name ? String(raw.subcompany[0].name) : "";
|
|
115
|
-
return hrmSuccess("hrm.org.detail", {
|
|
116
|
-
id,
|
|
117
|
-
name: raw.name,
|
|
118
|
-
type: raw.type,
|
|
119
|
-
code: raw.code,
|
|
120
|
-
fullPath: raw.fullPath,
|
|
121
|
-
status: raw.status,
|
|
122
|
-
...parentName ? { parentName } : {},
|
|
123
|
-
...subcompanyName ? { subcompanyName } : {},
|
|
124
|
-
...pickDefined(raw, ["description", "remark"]),
|
|
125
|
-
link: orgLink(baseUrl, id)
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
var orgLookup = {
|
|
130
|
-
name: "hrm.org.lookup",
|
|
131
|
-
resource: "org",
|
|
132
|
-
method: "org.lookup",
|
|
133
|
-
action: "hrm.org.lookup",
|
|
134
|
-
summary: "\u7EC4\u7EC7\u6A21\u7CCA\u67E5\u627E\uFF1A\u5173\u952E\u8BCD**\u4E0D\u7528\u5199\u5168**\uFF0C\u4E00\u6B21\u8FD4\u56DE\u6240\u6709\u8FD1\u4F3C\u7684\u90E8\u95E8/\u5206\u90E8\uFF08\u542B\u5B8C\u6574\u8DEF\u5F84\u3001\u6309\u76F8\u4F3C\u5EA6\u6392\u5E8F\uFF09",
|
|
135
|
-
risk: READ,
|
|
136
|
-
inputSchema: schemaOf({
|
|
137
|
-
keyword: { type: "string", minLength: 1, description: "\u90E8\u95E8/\u5206\u90E8\u540D\u79F0\u5173\u952E\u8BCD\uFF08\u53EF\u53EA\u5199\u4E00\u90E8\u5206\uFF0C\u5982\u300C\u4F1A\u8BAE\u7BA1\u7406\u300D\u300C\u7814\u53D1\u300D\uFF09" },
|
|
138
|
-
type: { type: "string", enum: ["department", "subcompany", "both"], description: "\u9ED8\u8BA4 both\uFF08\u90E8\u95E8+\u5206\u90E8\u90FD\u67E5\uFF09" },
|
|
139
|
-
limit: { type: "number", minimum: 1, maximum: 50, description: "\u6700\u591A\u8FD4\u56DE\u6761\u6570\uFF0C\u9ED8\u8BA4 10" }
|
|
140
|
-
}, { required: ["keyword"] }),
|
|
141
|
-
handler: async (args, { host }) => {
|
|
142
|
-
const keyword = String(args.keyword ?? "").trim();
|
|
143
|
-
if (!keyword) throw hrmValidationError("keyword_required", "keyword \u5FC5\u586B");
|
|
144
|
-
const scope = args.type === "department" || args.type === "subcompany" ? String(args.type) : "both";
|
|
145
|
-
const limit = Math.max(1, Math.min(50, Number(args.limit) || 10));
|
|
146
|
-
const fetchOrg = async (type, text2) => {
|
|
147
|
-
const body = {
|
|
148
|
-
...browserBaseBody(),
|
|
149
|
-
virtualType: "ALL",
|
|
150
|
-
cmd: "list",
|
|
151
|
-
formDatas: { name: [{ nameCondition: { id: "in", content: "\u5305\u542B", disabled: false }, name: text2 }] },
|
|
152
|
-
quickSearchDatas: {},
|
|
153
|
-
type: "and",
|
|
154
|
-
stopDepartment: false,
|
|
155
|
-
current: 1,
|
|
156
|
-
pageSize: 200
|
|
157
|
-
};
|
|
158
|
-
const path = type === "subcompany" ? "/api/hrm/common/browser/data/subcompany" : "/api/hrm/common/browser/data/department";
|
|
159
|
-
const resp = await host.request({ method: "POST", path, body });
|
|
160
|
-
const rows2 = resp?.data?.data ?? [];
|
|
161
|
-
return rows2.map((r) => ({
|
|
162
|
-
id: String(r.id ?? ""),
|
|
163
|
-
name: String(r.name ?? ""),
|
|
164
|
-
type,
|
|
165
|
-
fullPath: String(r.fullPath ?? r.path ?? ""),
|
|
166
|
-
...r.subcompanyName ? { subcompanyName: String(r.subcompanyName) } : {},
|
|
167
|
-
...r.parentName ? { parentName: String(r.parentName) } : {}
|
|
168
|
-
})).filter((r) => r.id);
|
|
169
|
-
};
|
|
170
|
-
const types = scope === "both" ? ["department", "subcompany"] : [scope];
|
|
171
|
-
const collected = [];
|
|
172
|
-
let requests = 0;
|
|
173
|
-
const stripSuffix = (text2) => text2.replace(/(部门|事业部|中心|科室|组|部)$/u, "").trim();
|
|
174
|
-
for (const type of types) {
|
|
175
|
-
requests += 1;
|
|
176
|
-
collected.push(...await fetchOrg(type, keyword));
|
|
177
|
-
const stripped = stripSuffix(keyword);
|
|
178
|
-
if (collected.length === 0 && stripped !== "" && stripped !== keyword) {
|
|
179
|
-
const raws = await fetchOrg(type, stripped);
|
|
180
|
-
collected.push(...raws.map((row) => ({ ...row, stripped: true })));
|
|
181
|
-
requests += 1;
|
|
182
|
-
}
|
|
183
|
-
if (collected.length === 0) {
|
|
184
|
-
for (let len = Math.min(keyword.length, 6) - 1; len >= 2; len -= 1) {
|
|
185
|
-
const short = keyword.slice(0, len);
|
|
186
|
-
const raws = await fetchOrg(type, short);
|
|
187
|
-
requests += 1;
|
|
188
|
-
if (raws.length > 0) {
|
|
189
|
-
collected.push(...raws.map((row) => ({ ...row, shortened: short })));
|
|
190
|
-
break;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
const scoreOf = (row) => {
|
|
196
|
-
const name = String(row.name);
|
|
197
|
-
const pathText = String(row.fullPath ?? "");
|
|
198
|
-
let score = 0;
|
|
199
|
-
if (name === keyword) score = 100;
|
|
200
|
-
else if (name.startsWith(keyword)) score = 85;
|
|
201
|
-
else if (name.includes(keyword)) score = 70;
|
|
202
|
-
else if (pathText.includes(keyword)) score = 50;
|
|
203
|
-
else score = 35;
|
|
204
|
-
if (row.type === "department") score += 5;
|
|
205
|
-
if (row.stripped) score -= 5;
|
|
206
|
-
if (row.shortened) score -= 15;
|
|
207
|
-
return score;
|
|
208
|
-
};
|
|
209
|
-
const rows = collected.map((row) => ({ ...row, score: scoreOf(row) })).sort((left, right) => Number(right.score) - Number(left.score) || String(left.name).localeCompare(String(right.name), "zh-Hans-CN")).slice(0, limit);
|
|
210
|
-
return hrmSuccess("hrm.org.lookup", {
|
|
211
|
-
rows,
|
|
212
|
-
total: rows.length,
|
|
213
|
-
...rows.length === 0 ? { hint: `\u6CA1\u6709\u540D\u79F0\u542B\u300C${keyword}\u300D\u7684\u90E8\u95E8\u6216\u5206\u90E8\u3002\u6362\u66F4\u77ED\u7684\u5173\u952E\u8BCD\uFF08\u5982\u4E24\u4E2A\u5B57\uFF09\u518D\u8BD5\uFF0C\u6216\u7528 hrm.org.query \u6309 parent/subcompany \u9010\u7EA7\u627E\u3002` } : {}
|
|
214
|
-
}, { requests, keyword });
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
var hrmOrgOperations = [
|
|
218
|
-
orgQuery,
|
|
219
|
-
orgLookup,
|
|
220
|
-
orgDetail
|
|
221
|
-
];
|
|
222
|
-
|
|
223
23
|
// src/shortcuts/hrm/operations/position.ts
|
|
224
24
|
function positionFormDatas() {
|
|
225
25
|
const d = {};
|
|
@@ -405,7 +205,7 @@ var hrmPositionOperations = [
|
|
|
405
205
|
// src/shortcuts/hrm/operations/resolve.ts
|
|
406
206
|
var VIRTUAL_PATH = "/api/bs/hrm/companyVirtual/listCompanyVirtual";
|
|
407
207
|
var ORG_DETAIL_PATH = "/api/bs/hrm/organization/getForm";
|
|
408
|
-
var
|
|
208
|
+
var ORG_TYPES = ["department", "subcompany"];
|
|
409
209
|
var DEFAULT_MAX_CANDIDATES = 20;
|
|
410
210
|
var MAX_CANDIDATES = 200;
|
|
411
211
|
var MAX_SUGGESTIONS = 5;
|
|
@@ -672,7 +472,7 @@ var orgResolve = {
|
|
|
672
472
|
virtualId: SCHEMA_ID,
|
|
673
473
|
name: { type: "string", minLength: 1, description: "\u7EC4\u7EC7\u540D\u79F0\uFF1B\u4E0E orgId \u81F3\u5C11\u4F20\u4E00\u4E2A" },
|
|
674
474
|
orgId: SCHEMA_ID,
|
|
675
|
-
type: { type: "string", enum: [...
|
|
475
|
+
type: { type: "string", enum: [...ORG_TYPES] },
|
|
676
476
|
maxCandidates: { type: "integer", minimum: 1, maximum: MAX_CANDIDATES, default: DEFAULT_MAX_CANDIDATES }
|
|
677
477
|
}),
|
|
678
478
|
handler: async (args, { host }) => {
|
|
@@ -688,8 +488,8 @@ var orgResolve = {
|
|
|
688
488
|
}
|
|
689
489
|
const explicitType = args.type !== void 0;
|
|
690
490
|
const requestedType = explicitType ? text(args.type) : "";
|
|
691
|
-
if (explicitType && !
|
|
692
|
-
throw hrmValidationError("enum_invalid", `type \u53D6\u503C\u5FC5\u987B\u662F ${
|
|
491
|
+
if (explicitType && !ORG_TYPES.includes(requestedType)) {
|
|
492
|
+
throw hrmValidationError("enum_invalid", `type \u53D6\u503C\u5FC5\u987B\u662F ${ORG_TYPES.join(" / ")} \u4E4B\u4E00`);
|
|
693
493
|
}
|
|
694
494
|
const types = explicitType ? [requestedType] : ["department", "subcompany"];
|
|
695
495
|
const maxCandidates = maxCandidatesValue(args.maxCandidates);
|
|
@@ -946,6 +946,23 @@ async function resolveTerm(env, systemKey, rawValue, label) {
|
|
|
946
946
|
clarificationCandidates(selected, 10)
|
|
947
947
|
);
|
|
948
948
|
}
|
|
949
|
+
async function resolveTermForNotin(env, systemKey, rawValue, label) {
|
|
950
|
+
const text = asString(rawValue);
|
|
951
|
+
if (!text) return [];
|
|
952
|
+
const parsed = parseNameWithId(text);
|
|
953
|
+
if (parsed.id) return [{ id: parsed.id, name: parsed.name || text }];
|
|
954
|
+
const candidates = await resolveNameCandidates(env, SYSTEM_FIELDS[systemKey], text);
|
|
955
|
+
if (!candidates.length) return [];
|
|
956
|
+
const exact = candidates.filter((item) => item.name.trim().toLowerCase() === text.trim().toLowerCase());
|
|
957
|
+
if (exact.length >= 1) return exact;
|
|
958
|
+
if (candidates.length === 1) return candidates;
|
|
959
|
+
throw workflowClarificationError(
|
|
960
|
+
SYSTEM_CLARIFICATION_TYPES[systemKey],
|
|
961
|
+
text,
|
|
962
|
+
`${label}\u300C${text}\u300D\u5339\u914D\u5230 ${candidates.length} \u4E2A\u5019\u9009\u9879\u4E14\u65E0\u5168\u540D\u7CBE\u786E\u5339\u914D\uFF0C\u6392\u9664\u8303\u56F4\u4E0D\u660E\u786E\uFF0C\u8BF7\u786E\u8BA4\u8981\u6392\u9664\u7684\u5177\u4F53${label}\u3002`,
|
|
963
|
+
clarificationCandidates(candidates, 10)
|
|
964
|
+
);
|
|
965
|
+
}
|
|
949
966
|
async function fetchRequestLevels(env) {
|
|
950
967
|
const response = await env.host.workflowRequest({
|
|
951
968
|
method: "GET",
|
|
@@ -1430,19 +1447,24 @@ async function buildSearchQuery(env, args, mode) {
|
|
|
1430
1447
|
if (workflowType) formDatas.workflowtype = [{ browserDatas: [{ id: workflowType.id, name: workflowType.name }] }];
|
|
1431
1448
|
const workflows = asStringArray(args.workflow, "workflow") ?? splitCsv(args.workflow).map((w) => [w]).flat();
|
|
1432
1449
|
const resolvedWorkflows = [];
|
|
1450
|
+
const workflowTerm = asString(args.workflowTerm) === "notin" ? "notin" : "in";
|
|
1451
|
+
const notinMisses = [];
|
|
1433
1452
|
if (workflows && workflows.length) {
|
|
1434
1453
|
const seenWorkflowIds = /* @__PURE__ */ new Set();
|
|
1435
1454
|
for (const w of workflows) {
|
|
1436
|
-
const
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
if (
|
|
1440
|
-
|
|
1455
|
+
const resolvedList = workflowTerm === "notin" ? await resolveTermForNotin(env, "workflowid", w, "\u5DE5\u4F5C\u6D41") : [await resolveTerm(env, "workflowid", w, "\u5DE5\u4F5C\u6D41")].filter(
|
|
1456
|
+
(resolved) => resolved !== null
|
|
1457
|
+
);
|
|
1458
|
+
if (workflowTerm === "notin" && resolvedList.length === 0) notinMisses.push(String(w));
|
|
1459
|
+
for (const resolved of resolvedList) {
|
|
1460
|
+
if (resolved.id && seenWorkflowIds.has(resolved.id)) continue;
|
|
1461
|
+
if (resolved.id) seenWorkflowIds.add(resolved.id);
|
|
1462
|
+
resolvedWorkflows.push(resolved);
|
|
1463
|
+
}
|
|
1441
1464
|
}
|
|
1442
1465
|
if (resolvedWorkflows.length) {
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
const firstWorkflowId = asString(resolvedWorkflows[0]?.id) ?? "";
|
|
1466
|
+
formDatas.workflowid = [{ term: workflowTerm, browserDatas: resolvedWorkflows }];
|
|
1467
|
+
const firstWorkflowId = workflowTerm === "in" ? asString(resolvedWorkflows[0]?.id) ?? "" : "";
|
|
1446
1468
|
if (firstWorkflowId) {
|
|
1447
1469
|
query.params = { ...query.params || {}, searchAdWorkflowid: firstWorkflowId };
|
|
1448
1470
|
}
|
|
@@ -1550,7 +1572,12 @@ async function buildSearchQuery(env, args, mode) {
|
|
|
1550
1572
|
}
|
|
1551
1573
|
if (items.length) query.sortParams = items;
|
|
1552
1574
|
}
|
|
1553
|
-
return {
|
|
1575
|
+
return {
|
|
1576
|
+
query,
|
|
1577
|
+
tabid,
|
|
1578
|
+
// 2026-11-11:notin(排除)语义下 0 命中被跳过的词要透出(不静默丢弃条件)。
|
|
1579
|
+
...notinMisses.length > 0 ? { warnings: notinMisses.map((word) => `\u6392\u9664\u5BF9\u8C61\u300C${word}\u300D\u672A\u5339\u914D\u5230\u4EFB\u4F55\u5DE5\u4F5C\u6D41\uFF0C\u8BE5\u6392\u9664\u6761\u4EF6\u672A\u751F\u6548`) } : {}
|
|
1580
|
+
};
|
|
1554
1581
|
}
|
|
1555
1582
|
function safeJsonArray(value) {
|
|
1556
1583
|
try {
|
|
@@ -10161,10 +10188,7 @@ var RESUME_INPUT_KEYS = [
|
|
|
10161
10188
|
"skillTiming",
|
|
10162
10189
|
"smartSmmaryTitle"
|
|
10163
10190
|
];
|
|
10164
|
-
var DEFAULT_FETCH_LIMIT = 200;
|
|
10165
|
-
var MAX_FETCH_LIMIT = 500;
|
|
10166
10191
|
var FETCH_PAGE_SIZE = 100;
|
|
10167
|
-
var MAX_FETCH_PAGES = 5;
|
|
10168
10192
|
var LIST_ENDPOINT_BY_CATEGORY = {
|
|
10169
10193
|
todo: WORKFLOW_ENDPOINTS.TODO_LIST,
|
|
10170
10194
|
done: WORKFLOW_ENDPOINTS.DONE_LIST,
|
|
@@ -10173,14 +10197,25 @@ var LIST_ENDPOINT_BY_CATEGORY = {
|
|
|
10173
10197
|
};
|
|
10174
10198
|
var DEFAULT_CATEGORY = "todo";
|
|
10175
10199
|
var DEFAULT_TABID2 = "0";
|
|
10200
|
+
var DEGRADE_TOTAL_THRESHOLD = 200;
|
|
10201
|
+
var DEGRADE_WINDOW_DAYS = [365, 180, 90, 30];
|
|
10202
|
+
var DEGRADE_WINDOW_LABELS = ["\u8FD1\u4E00\u5E74", "\u8FD16\u4E2A\u6708", "\u8FD13\u4E2A\u6708", "\u8FD11\u4E2A\u6708"];
|
|
10203
|
+
var DEGRADE_TABID = "7";
|
|
10204
|
+
var TIME_FILTER_KEYS = ["createTime", "operateTime", "receiveTime", "finishTime"];
|
|
10205
|
+
function totalEndpointFor(listPath) {
|
|
10206
|
+
const totalPath = listPath.replace("/data/", "/total/").replace(/Data$/u, "Total");
|
|
10207
|
+
if (totalPath === listPath) {
|
|
10208
|
+
throw workflowValidationError("total_endpoint_unknown", `\u65E0\u6CD5\u4ECE\u5217\u8868\u63A5\u53E3\u63A8\u5BFC\u603B\u6570\u63A5\u53E3\uFF1A${listPath}`);
|
|
10209
|
+
}
|
|
10210
|
+
return totalPath;
|
|
10211
|
+
}
|
|
10176
10212
|
var CATEGORY_VALUES = ["todo", "done", "mine", "all"];
|
|
10177
10213
|
function readFetchLimit(value) {
|
|
10178
|
-
if (value === void 0 || value === null || value === "") return { limit:
|
|
10214
|
+
if (value === void 0 || value === null || value === "") return { limit: null };
|
|
10179
10215
|
const parsed = Number(value);
|
|
10180
10216
|
if (!Number.isInteger(parsed) || parsed < 1) {
|
|
10181
10217
|
throw workflowValidationError("limit_invalid", `limit \u5FC5\u987B\u662F \u22651 \u7684\u6574\u6570\uFF0C\u6536\u5230 ${String(value)}`);
|
|
10182
10218
|
}
|
|
10183
|
-
if (parsed > MAX_FETCH_LIMIT) return { limit: MAX_FETCH_LIMIT, cappedFrom: parsed };
|
|
10184
10219
|
return { limit: parsed };
|
|
10185
10220
|
}
|
|
10186
10221
|
function readCategory(value) {
|
|
@@ -10196,6 +10231,7 @@ function readCategory(value) {
|
|
|
10196
10231
|
return text;
|
|
10197
10232
|
}
|
|
10198
10233
|
function readPageSize(limit) {
|
|
10234
|
+
if (limit === null) return FETCH_PAGE_SIZE;
|
|
10199
10235
|
return limit <= FETCH_PAGE_SIZE ? limit : FETCH_PAGE_SIZE;
|
|
10200
10236
|
}
|
|
10201
10237
|
function guardListOnlyHost(env) {
|
|
@@ -10205,7 +10241,7 @@ function guardListOnlyHost(env) {
|
|
|
10205
10241
|
if (prop === "workflowRequest") {
|
|
10206
10242
|
return async (request) => {
|
|
10207
10243
|
const path = String(request?.path ?? "");
|
|
10208
|
-
if (/getTodo(?!
|
|
10244
|
+
if (/getTodo(?!List(?:Data|Total))/u.test(path)) {
|
|
10209
10245
|
throw workflowValidationError(
|
|
10210
10246
|
"forbidden_endpoint",
|
|
10211
10247
|
`\u53D6\u6570\u9636\u6BB5\u53EA\u5141\u8BB8\u8C03\u7528 getTodoListData\uFF1B${path} \u5C5E\u4E8E getTodo* \u5206\u9875/\u7EDF\u8BA1\u8F85\u52A9\u63A5\u53E3\uFF0C\u5DF2\u7981\u6B62`,
|
|
@@ -10342,12 +10378,6 @@ function readItems(rawItems) {
|
|
|
10342
10378
|
if (rawItems.length === 0) {
|
|
10343
10379
|
throw workflowValidationError("items_empty", "items \u4E3A\u7A7A\u6570\u7EC4\uFF0C\u6CA1\u6709\u53EF\u6C47\u603B\u7684\u5F85\u529E");
|
|
10344
10380
|
}
|
|
10345
|
-
if (rawItems.length > 500) {
|
|
10346
|
-
throw workflowValidationError(
|
|
10347
|
-
"items_too_many",
|
|
10348
|
-
`\u5355\u6B21\u6700\u591A 500 \u6761\uFF0C\u6536\u5230 ${rawItems.length} \u6761\uFF1B\u8BF7\u5148\u5206\u9875\u7F29\u51CF\u8303\u56F4`
|
|
10349
|
-
);
|
|
10350
|
-
}
|
|
10351
10381
|
const seen = /* @__PURE__ */ new Set();
|
|
10352
10382
|
const rows = [];
|
|
10353
10383
|
let duplicateCount = 0;
|
|
@@ -12579,9 +12609,11 @@ var DEFAULT_REQUEST_SUMMARY_MAX = 50;
|
|
|
12579
12609
|
async function collectRawTodos(args, env) {
|
|
12580
12610
|
const category = readCategory(args.category);
|
|
12581
12611
|
const priorityFields = priorityRuleFields();
|
|
12582
|
-
const
|
|
12612
|
+
const readLimit = readFetchLimit(args.limit);
|
|
12613
|
+
const requestedLimit = readLimit.limit;
|
|
12614
|
+
const limit = readLimit.limit;
|
|
12583
12615
|
const pageSize = readPageSize(limit);
|
|
12584
|
-
const plannedPages = Math.max(1, Math.
|
|
12616
|
+
const plannedPages = limit === null ? null : Math.max(1, Math.ceil(limit / pageSize));
|
|
12585
12617
|
const listEnv = guardListOnlyHost(env);
|
|
12586
12618
|
const searchArgs = { category };
|
|
12587
12619
|
for (const key of [...COLLECT_FILTER_KEYS, ...COLLECT_ORDER_KEYS]) {
|
|
@@ -12600,15 +12632,10 @@ async function collectRawTodos(args, env) {
|
|
|
12600
12632
|
warnings.push(`\u5DF2\u6309\u901A\u7528\u89C4\u5219\u9ED8\u8BA4\u6392\u9664\u6284\u9001\u7C7B\u8EAB\u4EFD\uFF08isremarks=${defaultIsremarks}\uFF09\uFF1B\u5982\u9700\u5305\u542B\u6284\u9001\uFF0C\u8BF7\u5728\u63D0\u793A\u8BCD\u4E2D\u8BF4\u660E`);
|
|
12601
12633
|
}
|
|
12602
12634
|
}
|
|
12603
|
-
if (cappedFrom !== void 0) {
|
|
12604
|
-
warnings.push(
|
|
12605
|
-
`\u5355\u6B21\u6700\u591A\u53EA\u80FD\u53D6 ${MAX_FETCH_LIMIT} \u6761\uFF08${MAX_FETCH_PAGES} \u6B21\u8BF7\u6C42 \xD7 ${FETCH_PAGE_SIZE} \u6761\uFF09\uFF0C\u4F60\u8981\u6C42\u7684 ${cappedFrom} \u6761\u5DF2\u6309\u4E0A\u9650 ${MAX_FETCH_LIMIT} \u6761\u5904\u7406\uFF1B\u5982\u9700\u8986\u76D6\u66F4\u591A\uFF0C\u8BF7\u7F29\u5C0F\u7B5B\u9009\u6761\u4EF6\uFF08\u5982\u6309\u5DE5\u4F5C\u6D41\u3001\u65F6\u95F4\u8303\u56F4\u5206\u6279\uFF09\u540E\u518D\u6C47\u603B`
|
|
12606
|
-
);
|
|
12607
|
-
}
|
|
12608
12635
|
const requestedPageSize = args.pageSize;
|
|
12609
12636
|
if (requestedPageSize !== void 0 && requestedPageSize !== null && requestedPageSize !== "" && Number(requestedPageSize) !== pageSize) {
|
|
12610
12637
|
warnings.push(
|
|
12611
|
-
`\u5355\u9875\u6761\u6570\u5DF2\u6309 limit \u63A8\u5BFC\u4E3A ${pageSize}\
|
|
12638
|
+
`\u5355\u9875\u6761\u6570\u5DF2\u6309 limit \u63A8\u5BFC\u4E3A ${pageSize}\uFF0C\u5FFD\u7565\u4F20\u5165\u7684 pageSize=${String(requestedPageSize)}`
|
|
12612
12639
|
);
|
|
12613
12640
|
}
|
|
12614
12641
|
const sortText = String(searchArgs.sort ?? "").trim();
|
|
@@ -12617,19 +12644,97 @@ async function collectRawTodos(args, env) {
|
|
|
12617
12644
|
`\u5DF2\u6309\u81EA\u5B9A\u4E49\u6392\u5E8F\u53D6\u6570\uFF08sort=${sortText}\uFF09\uFF1B\u8DE8\u9875\u6309 requestId \u53BB\u91CD\uFF0C\u6392\u5E8F\u952E\u540C\u503C\u8F83\u591A\u65F6\u76F8\u90BB\u9875\u53EF\u80FD\u91CD\u590D\u6216\u6F0F\u9879\uFF0C\u5EFA\u8BAE\u914D\u5408\u65F6\u95F4 / \u5DE5\u4F5C\u6D41\u6761\u4EF6\u7F29\u5C0F\u8303\u56F4`
|
|
12618
12645
|
);
|
|
12619
12646
|
}
|
|
12647
|
+
const listPath = LIST_ENDPOINT_BY_CATEGORY[category] ?? WORKFLOW_ENDPOINTS.TODO_LIST;
|
|
12648
|
+
const degradeSteps = [];
|
|
12649
|
+
let degradeApplied = false;
|
|
12650
|
+
let degradeLevel = 0;
|
|
12651
|
+
const hasTimeCondition = TIME_FILTER_KEYS.some((key) => {
|
|
12652
|
+
const value = searchArgs[key];
|
|
12653
|
+
return value !== void 0 && value !== null && String(value).trim() !== "";
|
|
12654
|
+
});
|
|
12655
|
+
const receiveTimeWindow = (days) => {
|
|
12656
|
+
const end = /* @__PURE__ */ new Date();
|
|
12657
|
+
const start = new Date(end.getTime() - days * 24 * 3600 * 1e3);
|
|
12658
|
+
const fmt = (d) => `${d.getFullYear()}-${String(d.getMonth() + 1).padStart(2, "0")}-${String(d.getDate()).padStart(2, "0")}`;
|
|
12659
|
+
return `${fmt(start)} ${fmt(end)}`;
|
|
12660
|
+
};
|
|
12661
|
+
const probeTodoTotal = async () => {
|
|
12662
|
+
const { query } = await buildSearchQuery(listEnv, { ...searchArgs, current: 1, pageSize }, "list");
|
|
12663
|
+
const totalBody = JSON.parse(JSON.stringify(query));
|
|
12664
|
+
delete totalBody.customDisplayPage;
|
|
12665
|
+
try {
|
|
12666
|
+
const response = await listEnv.host.workflowRequest({
|
|
12667
|
+
method: "POST",
|
|
12668
|
+
path: totalEndpointFor(listPath),
|
|
12669
|
+
operation: "workflow.todoSmartConvert.total",
|
|
12670
|
+
body: totalBody
|
|
12671
|
+
});
|
|
12672
|
+
return extractTotal(response);
|
|
12673
|
+
} catch {
|
|
12674
|
+
return null;
|
|
12675
|
+
}
|
|
12676
|
+
};
|
|
12677
|
+
if (category === DEFAULT_CATEGORY) {
|
|
12678
|
+
const initialTotal = await probeTodoTotal();
|
|
12679
|
+
degradeSteps.push({ level: "initial", scope: "\u7528\u6237\u6761\u4EF6\u539F\u6837", total: initialTotal });
|
|
12680
|
+
if (!hasTimeCondition && (initialTotal === null || initialTotal > DEGRADE_TOTAL_THRESHOLD)) {
|
|
12681
|
+
if (initialTotal === null) {
|
|
12682
|
+
searchArgs.receiveTime = receiveTimeWindow(DEGRADE_WINDOW_DAYS[DEGRADE_WINDOW_DAYS.length - 1]);
|
|
12683
|
+
if (!explicitTab) searchArgs.tabid = DEGRADE_TABID;
|
|
12684
|
+
degradeApplied = true;
|
|
12685
|
+
degradeLevel = DEGRADE_WINDOW_DAYS.length + 1;
|
|
12686
|
+
const scope2 = explicitTab ? `\u63A5\u6536\u65F6\u95F4\u8FD11\u4E2A\u6708\uFF08\u4FDD\u6301\u7528\u6237\u6307\u5B9A\u9875\u7B7E\uFF09` : `\u63A5\u6536\u65F6\u95F4\u8FD11\u4E2A\u6708 + \u5F85\u5904\u7406\uFF08tabid=${DEGRADE_TABID}\uFF09`;
|
|
12687
|
+
degradeSteps.push({ level: "final", scope: scope2, total: null });
|
|
12688
|
+
warnings.push(
|
|
12689
|
+
`\u5F85\u529E\u603B\u6570\u63A5\u53E3\uFF08getTodoListTotal\uFF09\u8C03\u7528\u5931\u8D25\u6216\u65E0\u6CD5\u89E3\u6790\u603B\u6570\uFF0C\u5DF2\u76F4\u63A5\u6309\u6700\u4E25\u964D\u7EA7\u8D70\uFF1A\u300C${scope2}\u300D\uFF1B\u8FD9\u662F\u6700\u540E\u4E00\u7EA7\uFF0C\u53D6\u5230\u591A\u5C11\u5904\u7406\u591A\u5C11\uFF0C\u4E0D\u518D\u622A\u65AD`
|
|
12690
|
+
);
|
|
12691
|
+
} else {
|
|
12692
|
+
let matched = false;
|
|
12693
|
+
for (let i = 0; i < DEGRADE_WINDOW_DAYS.length; i += 1) {
|
|
12694
|
+
searchArgs.receiveTime = receiveTimeWindow(DEGRADE_WINDOW_DAYS[i]);
|
|
12695
|
+
const scope2 = `\u63A5\u6536\u65F6\u95F4${DEGRADE_WINDOW_LABELS[i]}`;
|
|
12696
|
+
const total = await probeTodoTotal();
|
|
12697
|
+
degradeSteps.push({ level: `window${i + 1}`, scope: scope2, total });
|
|
12698
|
+
if (total !== null && total <= DEGRADE_TOTAL_THRESHOLD) {
|
|
12699
|
+
degradeApplied = true;
|
|
12700
|
+
degradeLevel = i + 1;
|
|
12701
|
+
warnings.push(
|
|
12702
|
+
`\u65E0\u65F6\u95F4\u6761\u4EF6\u4E14\u5F85\u529E\u603B\u6570 ${initialTotal} \u6761 > ${DEGRADE_TOTAL_THRESHOLD}\uFF0C\u5DF2\u964D\u7EA7\u4E3A\u300C${scope2}\u300D\uFF1B\u8BE5\u8303\u56F4\u603B\u6570 ${total} \u6761\u5728\u9608\u503C\u5185\uFF0C\u6309\u8BE5\u8303\u56F4\u53D6\u6570`
|
|
12703
|
+
);
|
|
12704
|
+
matched = true;
|
|
12705
|
+
break;
|
|
12706
|
+
}
|
|
12707
|
+
if (total === null) break;
|
|
12708
|
+
}
|
|
12709
|
+
if (!matched) {
|
|
12710
|
+
searchArgs.receiveTime = receiveTimeWindow(DEGRADE_WINDOW_DAYS[DEGRADE_WINDOW_DAYS.length - 1]);
|
|
12711
|
+
if (!explicitTab) searchArgs.tabid = DEGRADE_TABID;
|
|
12712
|
+
degradeApplied = true;
|
|
12713
|
+
degradeLevel = DEGRADE_WINDOW_DAYS.length + 1;
|
|
12714
|
+
const scope2 = explicitTab ? `\u63A5\u6536\u65F6\u95F4\u8FD11\u4E2A\u6708\uFF08\u4FDD\u6301\u7528\u6237\u6307\u5B9A\u9875\u7B7E\uFF09` : `\u63A5\u6536\u65F6\u95F4\u8FD11\u4E2A\u6708 + \u5F85\u5904\u7406\uFF08tabid=${DEGRADE_TABID}\uFF09`;
|
|
12715
|
+
degradeSteps.push({ level: "final", scope: scope2, total: null });
|
|
12716
|
+
warnings.push(
|
|
12717
|
+
`\u65E0\u65F6\u95F4\u6761\u4EF6\u4E14\u5404\u964D\u7EA7\u7A97\u53E3\u603B\u6570\u5747 > ${DEGRADE_TOTAL_THRESHOLD}\uFF0C\u5DF2\u964D\u7EA7\u4E3A\u300C${scope2}\u300D\uFF1B\u8FD9\u662F\u6700\u540E\u4E00\u7EA7\uFF0C\u53D6\u5230\u591A\u5C11\u5904\u7406\u591A\u5C11\uFF0C\u4E0D\u518D\u622A\u65AD`
|
|
12718
|
+
);
|
|
12719
|
+
}
|
|
12720
|
+
}
|
|
12721
|
+
}
|
|
12722
|
+
}
|
|
12620
12723
|
const seen = /* @__PURE__ */ new Set();
|
|
12621
12724
|
const items = [];
|
|
12622
12725
|
let duplicateCount = 0;
|
|
12623
12726
|
let totalAvailable = null;
|
|
12624
12727
|
let pages = 0;
|
|
12625
12728
|
let stoppedEarly = false;
|
|
12626
|
-
|
|
12627
|
-
|
|
12628
|
-
const { query } = await buildSearchQuery(
|
|
12729
|
+
for (let pageNo = 1; limit === null || pageNo <= (plannedPages ?? 0); pageNo += 1) {
|
|
12730
|
+
const { query, warnings: buildWarnings } = await buildSearchQuery(
|
|
12629
12731
|
listEnv,
|
|
12630
12732
|
{ ...searchArgs, current: pageNo, pageSize },
|
|
12631
12733
|
"list"
|
|
12632
12734
|
);
|
|
12735
|
+
for (const warning of buildWarnings ?? []) {
|
|
12736
|
+
if (!warnings.includes(warning)) warnings.push(warning);
|
|
12737
|
+
}
|
|
12633
12738
|
const isremarks = String(searchArgs.isremarks ?? "").trim();
|
|
12634
12739
|
if (isremarks !== "") {
|
|
12635
12740
|
query.params = { ...query.params || {}, isremarks };
|
|
@@ -12688,7 +12793,7 @@ async function collectRawTodos(args, env) {
|
|
|
12688
12793
|
added += 1;
|
|
12689
12794
|
}
|
|
12690
12795
|
if (added === 0) break;
|
|
12691
|
-
if (items.length >= limit) break;
|
|
12796
|
+
if (limit !== null && items.length >= limit) break;
|
|
12692
12797
|
if (pageRows.length < pageSize) break;
|
|
12693
12798
|
}
|
|
12694
12799
|
const workflowNames = /* @__PURE__ */ new Map();
|
|
@@ -12757,7 +12862,7 @@ async function collectRawTodos(args, env) {
|
|
|
12757
12862
|
if (stoppedEarly && items.length === 0) {
|
|
12758
12863
|
warnings.push("\u5217\u8868\u63A5\u53E3\u6CA1\u6709\u8FD4\u56DE\u4EFB\u4F55\u660E\u7EC6\uFF0C\u8BF7\u786E\u8BA4\u7B5B\u9009\u6761\u4EF6\u662F\u5426\u8FC7\u7A84");
|
|
12759
12864
|
}
|
|
12760
|
-
if (totalAvailable !== null && items.length < totalAvailable) {
|
|
12865
|
+
if (limit !== null && totalAvailable !== null && items.length < totalAvailable) {
|
|
12761
12866
|
warnings.push(
|
|
12762
12867
|
`\u5171 ${totalAvailable} \u6761\u5F85\u529E\uFF0C\u672C\u6B21\u6309 ${pages} \u6B21\u8BF7\u6C42\uFF08\u6BCF\u6B21\u6700\u591A ${FETCH_PAGE_SIZE} \u6761\uFF09\u53D6\u5230 ${items.length} \u6761\uFF1B\u5DF2\u5230\u672C\u6B21 limit=${limit} \u7684\u9608\u503C\u2014\u2014\u9700\u8981\u8986\u76D6\u66F4\u591A\u8BF7\u8C03\u5927 limit\uFF0C\u6216\u7F29\u5C0F\u7B5B\u9009\u6761\u4EF6\uFF08\u5DE5\u4F5C\u6D41 / \u65F6\u95F4\u8303\u56F4\uFF09\u5206\u6279\u6C47\u603B`
|
|
12763
12868
|
);
|
|
@@ -12888,19 +12993,31 @@ async function collectRawTodos(args, env) {
|
|
|
12888
12993
|
query: {
|
|
12889
12994
|
category,
|
|
12890
12995
|
...scope ? { tabid: searchArgs.tabid } : {},
|
|
12891
|
-
/**
|
|
12892
|
-
requestedLimit
|
|
12893
|
-
/**
|
|
12996
|
+
/** 用户原始诉求;不传 = null(不限条数,翻页取完为止)。 */
|
|
12997
|
+
requestedLimit,
|
|
12998
|
+
/** 计划请求次数;limit 不传(不限条数)时为 null(按需翻页,无上限)。 */
|
|
12894
12999
|
plannedPages,
|
|
12895
13000
|
/** 实际发出的列表请求次数 */
|
|
12896
13001
|
pages,
|
|
12897
13002
|
/** 单页大小(limit ≤ 100 时等于 limit,否则固定 100) */
|
|
12898
13003
|
pageSize,
|
|
12899
|
-
/** 计划能覆盖的条数上限 = 计划页数 ×
|
|
12900
|
-
appliedLimit: plannedPages * pageSize,
|
|
13004
|
+
/** 计划能覆盖的条数上限 = 计划页数 × 单页(实际可能更少,取决于服务端还有没有数据);不限条数时为 null。 */
|
|
13005
|
+
appliedLimit: plannedPages === null ? null : plannedPages * pageSize,
|
|
12901
13006
|
totalAvailable,
|
|
12902
13007
|
/** 取数只用了这一个接口(照实写出来,便于核对「有没有偷偷调别的」) */
|
|
12903
13008
|
endpoint: listPath,
|
|
13009
|
+
/** 无时间条件时的查询降级留痕(2026-11-11 新链路):steps 按探数顺序记录每级的范围与总数;
|
|
13010
|
+
* level 0=未降级、1..4=接收时间近一年/近6个月/近3个月/近1个月、5=近1个月+待处理(终点级,
|
|
13011
|
+
* 不再截断)。首轮探数对带时间条件的查询也会做(2026-11-10 起),此时 applied=false、level=0,
|
|
13012
|
+
* 总数供交付正文展示。 */
|
|
13013
|
+
...degradeSteps.length > 0 ? {
|
|
13014
|
+
degrade: {
|
|
13015
|
+
threshold: DEGRADE_TOTAL_THRESHOLD,
|
|
13016
|
+
applied: degradeApplied,
|
|
13017
|
+
level: degradeLevel,
|
|
13018
|
+
steps: degradeSteps
|
|
13019
|
+
}
|
|
13020
|
+
} : {},
|
|
12904
13021
|
/** 自定义排序原文(不在 filters 里:它是排序不是筛选条件) */
|
|
12905
13022
|
...sortText ? { sort: sortText } : {},
|
|
12906
13023
|
filters: Object.fromEntries(
|
|
@@ -14431,8 +14548,7 @@ var inputSchema = schemaOf({
|
|
|
14431
14548
|
items: {
|
|
14432
14549
|
type: "array",
|
|
14433
14550
|
minItems: 1,
|
|
14434
|
-
|
|
14435
|
-
description: "\u5F85\u529E\u6761\u76EE\u3002\u672A\u4F20\u65F6 collect \u51FA\u7F51\u53D6\u6570\uFF1B\u4F20\u5165\u540E\u53EA\u505A\u672C\u5730\u5F52\u4E00\u3001\u5206\u7EC4\u6216\u6458\u8981\u56DE\u586B\u3002",
|
|
14551
|
+
description: "\u5F85\u529E\u6761\u76EE\u3002\u672A\u4F20\u65F6 collect \u51FA\u7F51\u53D6\u6570\uFF1B\u4F20\u5165\u540E\u53EA\u505A\u672C\u5730\u5F52\u4E00\u3001\u5206\u7EC4\u6216\u6458\u8981\u56DE\u586B\u3002\u6761\u6570\u4E0D\u8BBE\u4E0A\u9650\uFF082026-11-11\uFF1A\u4E0E collect\u300C\u67E5\u6240\u6709\u300D\u5BF9\u9F50\uFF09\u3002",
|
|
14436
14552
|
items: { type: "object" }
|
|
14437
14553
|
},
|
|
14438
14554
|
aiGroups: {
|
|
@@ -14479,9 +14595,7 @@ var inputSchema = schemaOf({
|
|
|
14479
14595
|
limit: {
|
|
14480
14596
|
type: "integer",
|
|
14481
14597
|
minimum: 1,
|
|
14482
|
-
|
|
14483
|
-
default: DEFAULT_FETCH_LIMIT,
|
|
14484
|
-
description: "collect \u76EE\u6807\u6761\u6570\uFF1B\u5355\u9875\u6700\u591A " + FETCH_PAGE_SIZE + " \u6761\uFF0C\u6700\u591A " + MAX_FETCH_PAGES + " \u9875\u3002"
|
|
14598
|
+
description: "collect \u76EE\u6807\u6761\u6570\uFF1B\u4E0D\u4F20 = \u4E0D\u9650\u6761\u6570\uFF08\u7FFB\u9875\u53D6\u5B8C\u4E3A\u6B62\uFF0C\u65E0\u65F6\u95F4\u6761\u4EF6\u65F6\u6309\u964D\u7EA7\u94FE\u81EA\u52A8\u6536\u7A84\u8303\u56F4\uFF09\uFF1B\u4F20\u4E86\u5219\u7D2F\u8BA1\u5230\u8BE5\u6761\u6570\u5373\u505C\u3002\u5355\u9875\u6700\u591A " + FETCH_PAGE_SIZE + " \u6761\u3002\uFF082026-11-11\uFF1A\u539F 500 \u4E0A\u9650\u5DF2\u5E9F\u9664\uFF09"
|
|
14485
14599
|
},
|
|
14486
14600
|
pageSize: {
|
|
14487
14601
|
type: "integer",
|
|
@@ -2,13 +2,13 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
|
|
|
2
2
|
const require = __esbuildCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
meetingStateDir
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-3NCFFHB2.js";
|
|
6
6
|
import {
|
|
7
7
|
SCHEMA_ID,
|
|
8
8
|
meetingSuccess,
|
|
9
9
|
meetingValidationError,
|
|
10
10
|
schemaOf
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-K67FODVC.js";
|
|
12
12
|
|
|
13
13
|
// src/shortcuts/meeting/operations/attachment-content.ts
|
|
14
14
|
import { mkdir, writeFile } from "node:fs/promises";
|