weaver-work-cli 0.1.80 → 0.1.81
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/README.md +3 -1
- package/dist/chunks/{archive-ENBSUMHV.js → archive-KVV4SM7J.js} +3 -3
- package/dist/chunks/{archive-oa-7BFPQ6M5.js → archive-oa-VRSPNLY4.js} +3 -3
- package/dist/chunks/{asset-V5SUD3PW.js → asset-JZ5MN6OL.js} +306 -10
- package/dist/chunks/{asset-idle-3CEL7WFX.js → asset-idle-B4SAL43V.js} +3 -3
- package/dist/chunks/{attachment-content-SHXZUE3N.js → attachment-content-7W4XQTA7.js} +3 -3
- package/dist/chunks/{blog-FLI4SS3P.js → blog-XCBM467O.js} +3 -3
- package/dist/chunks/{caizhilian-7WCTKCCP.js → caizhilian-NZVUKCZD.js} +5 -5
- package/dist/chunks/{calendar-G726HUUH.js → calendar-OVM2SGYJ.js} +3 -3
- package/dist/chunks/{chunk-XNN5PZTI.js → chunk-3WZMDOI3.js} +1 -1
- package/dist/chunks/{chunk-TM2G7DNT.js → chunk-56F2GGE4.js} +5 -5
- package/dist/chunks/{chunk-LCM5SSGJ.js → chunk-5MM2IZ27.js} +423 -36
- package/dist/chunks/{chunk-BWFCTE43.js → chunk-5NQZO3CO.js} +48 -5
- package/dist/chunks/{chunk-KVCDZ2FX.js → chunk-5RIK6OLF.js} +7 -7
- package/dist/chunks/{chunk-5E2FDXBU.js → chunk-64RYQOXA.js} +1 -1
- package/dist/chunks/{chunk-44ZWNC7A.js → chunk-7BP3HU74.js} +2 -2
- package/dist/chunks/{chunk-3Q5F4C5B.js → chunk-AW3HQUOC.js} +5 -5
- package/dist/chunks/{chunk-7M5OYRK2.js → chunk-BD3M2YVN.js} +3 -3
- package/dist/chunks/{chunk-JEQHNNSS.js → chunk-BFVUBCYO.js} +14 -0
- package/dist/chunks/{chunk-PAWXVT6H.js → chunk-CLVEXDEJ.js} +4 -5
- package/dist/chunks/{chunk-TBCKK6LH.js → chunk-DWCMKEMO.js} +2 -2
- package/dist/chunks/{chunk-AVDEZLEB.js → chunk-E3XUYWYA.js} +4 -4
- package/dist/chunks/{chunk-3IX6L74V.js → chunk-FIPTUAOW.js} +2 -2
- package/dist/chunks/{chunk-4MAQALTM.js → chunk-GQEIHXY5.js} +6 -6
- package/dist/chunks/{chunk-TD5IOEGN.js → chunk-JUPKXW4P.js} +1 -1
- package/dist/chunks/{chunk-HYNOKFYJ.js → chunk-KZ3JR3GE.js} +3 -3
- package/dist/chunks/{chunk-4PBN7NJY.js → chunk-L2PKMZIU.js} +1 -1
- package/dist/chunks/{chunk-DACQKJ6O.js → chunk-LXWWOHM6.js} +4 -4
- package/dist/chunks/{chunk-7DE3VMZD.js → chunk-LYFPWZBD.js} +6 -1
- package/dist/chunks/{chunk-2UV4IZIT.js → chunk-MTIV6JEN.js} +2 -2
- package/dist/chunks/{chunk-WXV5FIKA.js → chunk-MWFKLXVU.js} +38 -38
- package/dist/chunks/{chunk-PMRNIGKZ.js → chunk-RVVRTW4P.js} +2 -2
- package/dist/chunks/{chunk-FPWCCRKT.js → chunk-UASZW22U.js} +3 -3
- package/dist/chunks/{chunk-RVEKGVZU.js → chunk-VMUVVTT4.js} +2 -2
- package/dist/chunks/{chunk-JQPKSQAK.js → chunk-W4BGNYKR.js} +1 -1
- package/dist/chunks/{chunk-OVTCWLNQ.js → chunk-W4R3SXJV.js} +15 -7
- package/dist/chunks/{chunk-UDBQJLQF.js → chunk-WF5G5SV3.js} +2 -2
- package/dist/chunks/{chunk-EGHRA2E3.js → chunk-WM5ZE67G.js} +1 -1
- package/dist/chunks/{chunk-QVKRNL7L.js → chunk-WQ4ZHAEZ.js} +10 -2
- package/dist/chunks/{chunk-JFZM3ZRU.js → chunk-X7OZKI6F.js} +12 -12
- package/dist/chunks/{chunk-YKTVK6XM.js → chunk-Y6HRTEDD.js} +1 -1
- package/dist/chunks/{chunk-2KW7AI6P.js → chunk-YFDKTTYX.js} +8 -5
- package/dist/chunks/{chunk-HKW5FYZR.js → chunk-YLPGCOAM.js} +76 -69
- package/dist/chunks/{chunk-LQLIXBJF.js → chunk-YXIPZFMX.js} +1 -1
- package/dist/chunks/{cli-JDTWQDDR.js → cli-VCQIDBDQ.js} +37 -37
- package/dist/chunks/{commands-J52MJ6NF.js → commands-THGXVOEL.js} +9 -5
- package/dist/chunks/{conflict-O4FXUTIX.js → conflict-T7URCNS6.js} +2 -2
- package/dist/chunks/{contract-GW7US3UF.js → contract-ZLGLQ45G.js} +3 -3
- package/dist/chunks/{cowork-GZDODGKF.js → cowork-2MBNOUYS.js} +21 -8
- package/dist/chunks/{create-flow-YIFMKM2C.js → create-flow-OFZC36MV.js} +6 -6
- package/dist/chunks/{data-HTQZRPPI.js → data-6O7ANJVT.js} +3 -3
- package/dist/chunks/{ebuilder-form-GHNIZ7ET.js → ebuilder-form-OJ3KJVQI.js} +4 -4
- package/dist/chunks/{ehr-7TGZTZR3.js → ehr-NWMI5Q7S.js} +4 -4
- package/dist/chunks/{employee-QX57HEWS.js → employee-O2EPUYIH.js} +2 -2
- package/dist/chunks/{entry-mode-X3KKRN36.js → entry-mode-TVACGU7K.js} +3 -3
- package/dist/chunks/{env-MCVDVISU.js → env-EWG4ZAWP.js} +2 -2
- package/dist/chunks/{esb-ATRKVHCD.js → esb-56FV2PIA.js} +5 -5
- package/dist/chunks/{factory-ALB7DMVY.js → factory-GQSEJRDY.js} +1 -1
- package/dist/chunks/{fna-IKYI3SST.js → fna-YLA3RKRW.js} +3 -3
- package/dist/chunks/{group-chat-GGPL2EBF.js → group-chat-5R6L3LCG.js} +3 -3
- package/dist/chunks/{host-UY4LQPN4.js → host-42MLO4KX.js} +4 -4
- package/dist/chunks/{host-XXGDQM7D.js → host-J72VEDW5.js} +4 -4
- package/dist/chunks/{host-EJSJSLVK.js → host-QKCRQS2C.js} +4 -4
- package/dist/chunks/{host-EYNLB6S4.js → host-W3BVEATN.js} +4 -4
- package/dist/chunks/{host-OT4KNR3G.js → host-YJINI5GG.js} +4 -4
- package/dist/chunks/{host-6UOXYOOY.js → host-ZVGBZOHY.js} +4 -4
- package/dist/chunks/{hrm-5JQ7QZ6A.js → hrm-3JFZNB42.js} +66 -26
- package/dist/chunks/{im-2YJW3EI5.js → im-HKIRPCGD.js} +5 -5
- package/dist/chunks/{invoice-36BCXKOX.js → invoice-4PREIOTG.js} +80 -17
- package/dist/chunks/{jiuchuanhui-KBWUZ7WT.js → jiuchuanhui-K3PLNENZ.js} +3 -3
- package/dist/chunks/{lazy-dispatch-ZDKLS5MR.js → lazy-dispatch-MKGEWZNM.js} +8 -8
- package/dist/chunks/{mail-YBKUM6HM.js → mail-6QPVWKXM.js} +3 -3
- package/dist/chunks/{meeting-MU3RHAEX.js → meeting-QPPEPBSN.js} +15 -15
- package/dist/chunks/{minute-doc-NHIEZEHU.js → minute-doc-JMIDZK5D.js} +1 -1
- package/dist/chunks/{okr-HW7IULIR.js → okr-67C5LQYD.js} +3 -3
- package/dist/chunks/{operations-4P2UYVLH.js → operations-YLKRNAPI.js} +5 -5
- package/dist/chunks/{org-MWWIFNAO.js → org-L5XDM2RQ.js} +2 -2
- package/dist/chunks/{performance-PM2G6L3E.js → performance-33QZZR4I.js} +3 -3
- package/dist/chunks/{plan-3YYGZ7ZM.js → plan-W4BPONRL.js} +3 -3
- package/dist/chunks/{project-6PRGBLO2.js → project-OKSEH6AF.js} +3 -3
- package/dist/chunks/{reception-7G3J2MA6.js → reception-H5M7SPHT.js} +3 -3
- package/dist/chunks/{recruit-stage-5KK7R37U.js → recruit-stage-O2JGNVMO.js} +12 -8
- package/dist/chunks/{registry-4S3RXXWS.js → registry-45VEUYTC.js} +4 -4
- package/dist/chunks/{registry-3VTB3KLV.js → registry-BMTQ55G5.js} +5 -5
- package/dist/chunks/{registry-KQ4TNUWO.js → registry-PYONXFUF.js} +3 -3
- package/dist/chunks/{registry-HWUNNXDU.js → registry-SAMJ4VH2.js} +14 -14
- package/dist/chunks/{registry-AC33ZZVH.js → registry-YY62OFKQ.js} +1 -1
- package/dist/chunks/{room-recommend-V4BSHR2M.js → room-recommend-NRLAZJCI.js} +4 -4
- package/dist/chunks/{schedule-T7W357TN.js → schedule-LNBOCBP5.js} +4 -4
- package/dist/chunks/{smart-extract-T5Z4AULN.js → smart-extract-JOTX6UZC.js} +3 -3
- package/dist/chunks/{update-77ZUIYSG.js → update-BERR64TI.js} +3 -3
- package/dist/chunks/{workflow-SYCBS5XD.js → workflow-ZDQY3TI7.js} +5 -5
- package/dist/core/runtime-agent.js +19 -3
- package/dist/index.js +4 -4
- package/dist/internal/e10/auth/agent-host-key.js +10 -1
- package/dist/internal/e10/auth/commands.js +20 -4
- package/dist/internal/e10/auth/xiaoe.js +15 -3
- package/dist/shortcuts/asset/host.js +39 -1
- package/dist/shortcuts/asset/index.js +16 -2
- package/dist/shortcuts/asset/manifest.js +115 -1
- package/dist/shortcuts/asset/operations/audit-report.js +144 -0
- package/dist/shortcuts/asset/operations/registry.js +4 -0
- package/dist/shortcuts/asset/operations/write.js +7 -1
- package/dist/shortcuts/cowork/operations/read.js +13 -6
- package/dist/shortcuts/cowork/operations/shared.js +15 -0
- package/dist/shortcuts/hrm/host.js +51 -4
- package/dist/shortcuts/hrm/index.js +45 -26
- package/dist/shortcuts/hrm/manifest.js +17 -0
- package/dist/shortcuts/hrm/operations/employee.js +3 -7
- package/dist/shortcuts/hrm/operations/org.js +2 -4
- package/dist/shortcuts/hrm/operations/position.js +2 -4
- package/dist/shortcuts/hrm/operations/shared.js +21 -0
- package/dist/shortcuts/hrm/operations.js +34 -0
- package/dist/shortcuts/im/constants.js +163 -0
- package/dist/shortcuts/im/host.js +12 -5
- package/dist/shortcuts/im/operations/at-mention.js +4 -2
- package/dist/shortcuts/im/operations/file-user.js +3 -1
- package/dist/shortcuts/im/operations/msg-sync.js +219 -2
- package/dist/shortcuts/im/operations/msg-write.js +70 -30
- package/dist/shortcuts/invoice/invoice-record.js +4 -0
- package/dist/shortcuts/invoice/manifest.js +1 -1
- package/dist/shortcuts/invoice/operations/reim-auto.js +10 -7
- package/dist/shortcuts/invoice/read-enrichment.js +74 -7
- package/dist/shortcuts/meeting/operations/eb/create-flow.js +1 -1
- package/dist/shortcuts/meeting/operations/rooms.js +7 -0
- package/dist/shortcuts/recruit-stage/operations/list.js +3 -2
- package/dist/shortcuts/recruit-stage/operations/profile.js +3 -2
- package/dist/shortcuts/recruit-stage/operations/search.js +2 -2
- package/dist/shortcuts/recruit-stage/operations/shortlist.js +3 -2
- package/dist/shortcuts/recruit-stage/operations/tag.js +5 -0
- package/dist/shortcuts/workflow/operations/form.js +2 -1
- package/docs/agent-invoice.md +1 -1
- package/docs/e10-auth.md +14 -1
- package/docs/hrm.md +5 -1
- package/docs/invoice.md +1 -1
- package/docs/ziguanjia.md +5 -1
- package/package.json +1 -1
- package/skill-template/business-info.json +6 -1
- package/skill-template/domains/hrm.md +1 -1
- package/skill-template/domains/yepiaotong.md +1 -1
- package/skill-template/domains/ziguanjia.md +7 -2
- package/skills/weaver-e10-cowork/SKILL.md +13 -1
- package/skills/weaver-e10-hrm/SKILL.md +16 -2
- package/skills/weaver-e10-hrm/references/org.md +1 -1
- package/skills/weaver-e10-meeting/SKILL.md +1 -1
- package/skills/weaver-e10-recruit-stage/SKILL.md +24 -15
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +14 -7
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +12 -1
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +18 -1
- package/skills/weaver-e10-recruit-stage/lib/resume-import-once.mjs +308 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +9 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +54 -15
- package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +456 -93
- package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +2 -2
- package/skills/weaver-e10-shared/SKILL.md +1 -1
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +1 -1
- package/skills/weaver-e10-shared-report.html +874 -0
- package/skills/weaver-e10-workflow/SKILL.md +4 -4
- package/skills/weaver-e10-workflow/aiDeepRead/config.json +138 -142
- package/skills/weaver-e10-workflow/references/workflow-deep-read.md +7 -7
- package/skills/weaver-e10-yepiaotong/SKILL.md +2 -2
- package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +5 -3
- package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +1 -1
- package/skills/weaver-e10-yepiaotong/references/source-manifest.json +34 -32
- package/skills/weaver-e10-yepiaotong.zip +0 -0
- package/skills/weaver-e10-yimiaoban/SKILL.md +12 -9
- package/skills/weaver-e10-yimiaoban/references/constants.md +291 -0
- package/skills/weaver-e10-yimiaoban/references/ding-write.md +1 -0
- package/skills/weaver-e10-yimiaoban/references/group-read.md +1 -0
- package/skills/weaver-e10-yimiaoban/references/group-write.md +1 -0
- package/skills/weaver-e10-yimiaoban/references/msg-read.md +10 -1
- package/skills/weaver-e10-yimiaoban/references/msg-write.md +3 -1
- package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +1 -0
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +175 -36
- package/skills/weaver-e10-ziguanjia/SKILL.md +26 -6
- package/skills/weaver-e10-ziguanjia/references/source-manifest.json +1373 -96
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-audit.md +63 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-disabled-capabilities.md +5 -1
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-idle.md +52 -0
- package/skills/weaver-e10-ziguanjia/references/ziguanjia-report.md +59 -0
- package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
- package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
- package/scripts/pysite/__pycache__/sitecustomize.cpython-314.pyc +0 -0
|
@@ -6,6 +6,7 @@ import { assertImOk, compact, extractGroupMembers, str } from './shared.js';
|
|
|
6
6
|
import { buildAtMsgJson, buildAtText, hasAtInput, resolveAtMentions } from './at-mention.js';
|
|
7
7
|
import { hasQuoteInput, resolveQuotedRef } from './quote-mention.js';
|
|
8
8
|
import { fileObjToFile, fileObjToImg, makeWritePair } from './write-util.js';
|
|
9
|
+
import { DING_SOURCE_DEFAULT, DING_SOURCE_TYPE, MKIND } from '../constants.js';
|
|
9
10
|
/** 校验本地文件存在,返回绝对路径。 */
|
|
10
11
|
function assertLocalFile(pathValue, field) {
|
|
11
12
|
const abs = resolve(String(pathValue ?? ''));
|
|
@@ -17,6 +18,8 @@ function assertLocalFile(pathValue, field) {
|
|
|
17
18
|
* 单聊/群聊发送内容归一化:txt / img / file 至少一种。
|
|
18
19
|
* 🔴 全空白文本(空格 / 换行)不算内容,禁止发送空白消息。
|
|
19
20
|
* markdown:true 表示 txt 是 markdown 原文(发送时外层 type=26 且 txt 段带 vt=1,客户端仅对 type=26 按 markdown 解析),仅支持纯文本消息。
|
|
21
|
+
* txt 与 img/file 可同时提供:发送时组装 type=26 富文本 msg JSON(dt 含 txt 段 + 媒体段),避免服务端 sendSingleMsg/sendGroupMsg
|
|
22
|
+
* 收到 txt 后整条按文本处理、静默丢弃媒体(旧行为 sent:true 但落库 type=1、媒体为空)。markdown 与媒体互斥(markdown_txt_only)。
|
|
20
23
|
*/
|
|
21
24
|
function normalizeContent(args) {
|
|
22
25
|
const txtRaw = args.txt !== undefined && args.txt !== null ? String(args.txt) : '';
|
|
@@ -59,6 +62,7 @@ const sendSinglePair = makeWritePair({
|
|
|
59
62
|
if (quote && !content.txt) {
|
|
60
63
|
throw imValidationError('quote_requires_txt', 'quoteMsgId 仅支持文本消息(txt)');
|
|
61
64
|
}
|
|
65
|
+
const richCombo = Boolean(content.txt) && Boolean(content.imgPath || content.filePath) && !content.markdown;
|
|
62
66
|
const summary = {
|
|
63
67
|
action: '发送单聊消息',
|
|
64
68
|
toUid,
|
|
@@ -67,6 +71,7 @@ const sendSinglePair = makeWritePair({
|
|
|
67
71
|
hasImg: Boolean(content.imgPath),
|
|
68
72
|
hasFile: Boolean(content.filePath),
|
|
69
73
|
...(content.markdown ? { contentFormat: 'markdown' } : {}),
|
|
74
|
+
...(richCombo ? { contentType: 'rich', note: '文本+媒体将以 type=26 富文本一条发出(dt 含 txt 段与媒体段)' } : {}),
|
|
70
75
|
};
|
|
71
76
|
const snapshot = { toUid, toCid };
|
|
72
77
|
if (content.txt) {
|
|
@@ -97,7 +102,23 @@ const sendSinglePair = makeWritePair({
|
|
|
97
102
|
const txtExtra = plan.markdown ? { vt: '1' } : {};
|
|
98
103
|
// markdown 约束:客户端仅对最外层 type=26 的消息按 markdown 解析,故 markdown 发送时 msg JSON 的 type 必须为 '26'
|
|
99
104
|
const markdownTypeExtra = plan.markdown ? { type: '26' } : {};
|
|
100
|
-
|
|
105
|
+
// txt + 媒体同发:服务端 sendSingleMsg 收到 txt 会整条按文本处理、静默丢弃 img/file,
|
|
106
|
+
// 故组装 type=26 富文本 msg JSON,dt 同时含 txt 段与媒体段(客户端按富文本多段渲染,解析侧亦按 dt.map 还原)。
|
|
107
|
+
const richCombo = plan.txt !== undefined && (plan.imgPath || plan.filePath) && !plan.markdown;
|
|
108
|
+
if (richCombo) {
|
|
109
|
+
const self = await env.host.getSelfIdentity();
|
|
110
|
+
const mediaSegs = [];
|
|
111
|
+
if (plan.imgPath) {
|
|
112
|
+
const fileObj = await env.host.uploadFile(plan.imgPath, { shareUsers: plan.toUid });
|
|
113
|
+
mediaSegs.push({ img: fileObjToImg(fileObj) });
|
|
114
|
+
}
|
|
115
|
+
if (plan.filePath) {
|
|
116
|
+
const fileObj = await env.host.uploadFile(plan.filePath, { shareUsers: plan.toUid });
|
|
117
|
+
mediaSegs.push({ file: fileObjToFile(fileObj) });
|
|
118
|
+
}
|
|
119
|
+
body.msg = buildAtMsgJson(String(plan.txt), [], self, { ...(quoteRef ? { ref: quoteRef } : {}), type: '26' }, {}, mediaSegs);
|
|
120
|
+
}
|
|
121
|
+
else if (quoteRef) {
|
|
101
122
|
// 引用:完整原生 msg JSON 走 msg 字段(与群聊同款承载方式,实测单聊同样生效)
|
|
102
123
|
const self = await env.host.getSelfIdentity();
|
|
103
124
|
body.msg = buildAtMsgJson(String(plan.txt ?? ''), [], self, { ref: quoteRef, ...markdownTypeExtra }, txtExtra);
|
|
@@ -112,13 +133,15 @@ const sendSinglePair = makeWritePair({
|
|
|
112
133
|
body.txt = plan.txt;
|
|
113
134
|
}
|
|
114
135
|
}
|
|
115
|
-
if (
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
136
|
+
if (!richCombo) {
|
|
137
|
+
if (plan.imgPath) {
|
|
138
|
+
const fileObj = await env.host.uploadFile(plan.imgPath, { shareUsers: plan.toUid });
|
|
139
|
+
body.img = fileObjToImg(fileObj);
|
|
140
|
+
}
|
|
141
|
+
if (plan.filePath) {
|
|
142
|
+
const fileObj = await env.host.uploadFile(plan.filePath, { shareUsers: plan.toUid });
|
|
143
|
+
body.file = fileObjToFile(fileObj);
|
|
144
|
+
}
|
|
122
145
|
}
|
|
123
146
|
const res = await env.host.request({
|
|
124
147
|
method: 'POST',
|
|
@@ -127,7 +150,7 @@ const sendSinglePair = makeWritePair({
|
|
|
127
150
|
operation: 'im.msg.send.single',
|
|
128
151
|
});
|
|
129
152
|
assertImOk(res, '发送单聊消息');
|
|
130
|
-
return { toUid: plan.toUid, toCid: plan.toCid, sent: true };
|
|
153
|
+
return { toUid: plan.toUid, toCid: plan.toCid, sent: true, contentType: richCombo ? 'rich' : undefined };
|
|
131
154
|
},
|
|
132
155
|
});
|
|
133
156
|
// ── 发群聊 ──
|
|
@@ -148,7 +171,8 @@ const sendGroupPair = makeWritePair({
|
|
|
148
171
|
if (quote && !content.txt) {
|
|
149
172
|
throw imValidationError('quote_requires_txt', 'quoteMsgId/replyMsgId 仅支持文本消息(txt)');
|
|
150
173
|
}
|
|
151
|
-
const
|
|
174
|
+
const richCombo = Boolean(content.txt) && Boolean(content.imgPath || content.filePath) && !content.markdown;
|
|
175
|
+
const summary = { action: '发送群聊消息', groupId, hasTxt: Boolean(content.txt), hasImg: Boolean(content.imgPath), hasFile: Boolean(content.filePath), ...(content.markdown ? { contentFormat: 'markdown' } : {}), ...(richCombo ? { contentType: 'rich', note: '文本+媒体将以 type=26 富文本一条发出(dt 含 txt 段与媒体段)' } : {}) };
|
|
152
176
|
const snapshot = { groupId };
|
|
153
177
|
if (content.txt) {
|
|
154
178
|
snapshot.txt = content.txt;
|
|
@@ -183,7 +207,24 @@ const sendGroupPair = makeWritePair({
|
|
|
183
207
|
const txtExtra = plan.markdown ? { vt: '1' } : {};
|
|
184
208
|
// markdown 约束:客户端仅对最外层 type=26 的消息按 markdown 解析,故 markdown 发送时 msg JSON 的 type 必须为 '26'
|
|
185
209
|
const markdownTypeExtra = plan.markdown ? { type: '26' } : {};
|
|
186
|
-
|
|
210
|
+
// txt + 媒体同发:服务端 sendGroupMsg 收到 txt 会整条按文本处理、静默丢弃 img/file,
|
|
211
|
+
// 故组装 type=26 富文本 msg JSON,dt 同时含 txt 段与媒体段(可与 @ / 引用叠加,aus/ref 仍在 txt 段)。
|
|
212
|
+
const richCombo = plan.txt !== undefined && (plan.imgPath || plan.filePath) && !plan.markdown;
|
|
213
|
+
if (richCombo) {
|
|
214
|
+
const { v, aus } = buildAtText(String(plan.txt), atEntries);
|
|
215
|
+
const self = await env.host.getSelfIdentity();
|
|
216
|
+
const mediaSegs = [];
|
|
217
|
+
if (plan.imgPath) {
|
|
218
|
+
const fileObj = await env.host.uploadFile(plan.imgPath, { shareGroups: plan.groupId });
|
|
219
|
+
mediaSegs.push({ img: fileObjToImg(fileObj) });
|
|
220
|
+
}
|
|
221
|
+
if (plan.filePath) {
|
|
222
|
+
const fileObj = await env.host.uploadFile(plan.filePath, { shareGroups: plan.groupId });
|
|
223
|
+
mediaSegs.push({ file: fileObjToFile(fileObj) });
|
|
224
|
+
}
|
|
225
|
+
body.msg = buildAtMsgJson(v, aus, self, { ...(quoteRef ? { [plan.quoteKind === 'reply' ? 'rmsg' : 'ref']: quoteRef } : {}), type: '26' }, {}, mediaSegs);
|
|
226
|
+
}
|
|
227
|
+
else if (atEntries.length || quoteRef) {
|
|
187
228
|
// @ / 引用 / 回复:完整原生 msg JSON 走 msg 字段(txt 字段无法携带 aus/ref,实测会被当纯文本展示)
|
|
188
229
|
const { v, aus } = buildAtText(String(plan.txt ?? ''), atEntries);
|
|
189
230
|
const self = await env.host.getSelfIdentity();
|
|
@@ -199,13 +240,15 @@ const sendGroupPair = makeWritePair({
|
|
|
199
240
|
body.txt = plan.txt;
|
|
200
241
|
}
|
|
201
242
|
}
|
|
202
|
-
if (
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
243
|
+
if (!richCombo) {
|
|
244
|
+
if (plan.imgPath) {
|
|
245
|
+
const fileObj = await env.host.uploadFile(plan.imgPath, { shareGroups: plan.groupId });
|
|
246
|
+
body.img = fileObjToImg(fileObj);
|
|
247
|
+
}
|
|
248
|
+
if (plan.filePath) {
|
|
249
|
+
const fileObj = await env.host.uploadFile(plan.filePath, { shareGroups: plan.groupId });
|
|
250
|
+
body.file = fileObjToFile(fileObj);
|
|
251
|
+
}
|
|
209
252
|
}
|
|
210
253
|
const res = await env.host.request({
|
|
211
254
|
method: 'POST',
|
|
@@ -214,7 +257,7 @@ const sendGroupPair = makeWritePair({
|
|
|
214
257
|
operation: 'im.msg.send.group',
|
|
215
258
|
});
|
|
216
259
|
assertImOk(res, '发送群聊消息');
|
|
217
|
-
return { groupId: plan.groupId, sent: true };
|
|
260
|
+
return { groupId: plan.groupId, sent: true, contentType: richCombo ? 'rich' : undefined };
|
|
218
261
|
},
|
|
219
262
|
});
|
|
220
263
|
// ── 撤回消息 ──
|
|
@@ -307,7 +350,7 @@ const withdrawPair = makeWritePair({
|
|
|
307
350
|
const timeOut = findWithdrawTimeOut(res);
|
|
308
351
|
const interval = timeOut !== null ? formatWithdrawInterval(timeOut) : '';
|
|
309
352
|
if (actCode === 1505) {
|
|
310
|
-
throw imValidationError('withdraw_timeout', `撤销超时${interval ? `(撤回时限 ${interval})` : '
|
|
353
|
+
throw imValidationError('withdraw_timeout', `撤销超时${interval ? `(撤回时限 ${interval})` : ''}:消息发送已超过可撤回时限,无法撤回(时限因环境而异,以正常撤回时回包 withdrawInterval 为准)`, { code: 1505, details: interval ? { withdrawInterval: interval } : undefined });
|
|
311
354
|
}
|
|
312
355
|
if (actCode === 1506)
|
|
313
356
|
throw imValidationError('withdraw_not_owner', '消息不是自己发送的,无法撤回', { code: 1506 });
|
|
@@ -524,31 +567,28 @@ const dingSendPair = makeWritePair({
|
|
|
524
567
|
let tag;
|
|
525
568
|
let titleDt;
|
|
526
569
|
const nm = msgObj.dt?.[0]?.file?.nm || msgObj.dt?.[0]?.img?.nm || msgObj.dt?.[0]?.media?.nm || '';
|
|
570
|
+
// mkind/tag 按源消息体 type 取值(具名常量,语义见 constants.md / DING_SOURCE_TYPE):
|
|
571
|
+
// 文件 512/tag2、图片 64/tag0、视频 2048/tag1;其余落文本兜底 mkind=1/tag3(与源脚本 sendDing.js 一致)。
|
|
572
|
+
const src = DING_SOURCE_TYPE[mtype] || DING_SOURCE_DEFAULT;
|
|
573
|
+
mkind = src.mkind;
|
|
574
|
+
tag = src.tag;
|
|
527
575
|
if (mtype === 4) {
|
|
528
|
-
tag = '2';
|
|
529
576
|
content = `[文件]${nm}`;
|
|
530
|
-
mkind = 512;
|
|
531
577
|
titleDt = [{ txt: { v: nm } }];
|
|
532
578
|
fileIds = String(msgObj.dt?.[0]?.file?.id || '');
|
|
533
579
|
}
|
|
534
580
|
else if (mtype === 2) {
|
|
535
|
-
tag = '0';
|
|
536
581
|
content = '[图片]';
|
|
537
|
-
mkind = 64;
|
|
538
582
|
titleDt = [];
|
|
539
583
|
fileIds = String(msgObj.dt?.[0]?.img?.src || msgObj.dt?.[0]?.img?.id || '');
|
|
540
584
|
}
|
|
541
585
|
else if (mtype === 7) {
|
|
542
|
-
tag = '1';
|
|
543
586
|
content = '[视频]';
|
|
544
|
-
mkind = 2048;
|
|
545
587
|
titleDt = [];
|
|
546
588
|
fileIds = String(msgObj.dt?.[0]?.media?.src || msgObj.dt?.[0]?.media?.id || '');
|
|
547
589
|
}
|
|
548
590
|
else {
|
|
549
|
-
tag = '3';
|
|
550
591
|
content = msgObj.dt?.[0]?.txt?.v || '';
|
|
551
|
-
mkind = 1;
|
|
552
592
|
titleDt = [{ txt: { v: content } }];
|
|
553
593
|
}
|
|
554
594
|
msgEntity = JSON.stringify({ ...msgObj, tf: '1' });
|
|
@@ -559,7 +599,7 @@ const dingSendPair = makeWritePair({
|
|
|
559
599
|
// 普通必达(markdown 时外层 type='26' 且 txt 段带 vt=1,与客户端 markdown 消息格式一致;
|
|
560
600
|
// 客户端仅对最外层 type=26 的消息按 markdown 解析)
|
|
561
601
|
content = plan.txt;
|
|
562
|
-
mkind =
|
|
602
|
+
mkind = MKIND.TXT_NORMAL;
|
|
563
603
|
const mdType = plan.markdown ? '26' : '1';
|
|
564
604
|
const txtSeg = plan.markdown
|
|
565
605
|
? { v: plan.txt, vt: '1', next: '0', ft: 'china' }
|
|
@@ -673,7 +713,7 @@ const msgWriteOps = [
|
|
|
673
713
|
img: { type: 'string', description: '本地图片路径' },
|
|
674
714
|
file: { type: 'string', description: '本地文件路径' },
|
|
675
715
|
}, sendGroupPair, { required: ['groupId'], requiredAny: ['txt', 'img', 'file'] }),
|
|
676
|
-
...buildMsgWriteDefinition('im.msg.withdraw', 'msg.withdraw', '
|
|
716
|
+
...buildMsgWriteDefinition('im.msg.withdraw', 'msg.withdraw', '撤回消息(单聊/群聊,仅限本人消息,时限以回包 withdrawInterval 为准)', {
|
|
677
717
|
type: { type: 'string', enum: ['single', 'group'], description: 'single 或 group' },
|
|
678
718
|
msgid: { type: 'string', pattern: '^\\d+$', description: '消息 id(ser_msgid)' },
|
|
679
719
|
toUid: { type: 'string', pattern: '^\\d+$', description: '单聊:对方 uid' },
|
|
@@ -56,6 +56,10 @@ export function invoiceTollSummaryNames(item) {
|
|
|
56
56
|
const pro = asRecord(asRecord(record.comm_info).pro);
|
|
57
57
|
if (typeof pro.cname !== 'string' || pro.cname.trim() !== '电子发票(通行费)')
|
|
58
58
|
return undefined;
|
|
59
|
+
// 保留 CLI 详情补读的结果,包括补读失败时的 [],不再从列表快照重新推断。
|
|
60
|
+
if (Array.isArray(record.tollSummaryNames) && record.tollSummaryNames.every((name) => typeof name === 'string')) {
|
|
61
|
+
return record.tollSummaryNames;
|
|
62
|
+
}
|
|
59
63
|
const files = Array.isArray(record.flist) ? record.flist : [];
|
|
60
64
|
return files.flatMap((file) => {
|
|
61
65
|
const attachment = asRecord(file);
|
|
@@ -137,7 +137,7 @@ const invoiceTravelIdsSchema = arrayOf(objectSchema({
|
|
|
137
137
|
type: { type: 'integer' },
|
|
138
138
|
}, [], true), { description: '本张发票已关联的凭证列表,原样保留 fid、文件、金额、日期及状态;无关联为 [],不逐个补查凭证详情。' });
|
|
139
139
|
const tollSummaryNamesSchema = arrayOf({ type: 'string' }, {
|
|
140
|
-
description: '仅 comm_info.pro.cname
|
|
140
|
+
description: '仅 comm_info.pro.cname 为「电子发票(通行费)」时返回:从详情 flist 中提取名称含「票据汇总单」的未删除文件名,按原序保留完整名称。列表和候选均按真实发票 ID 批量读取详情,不能凭列表 flist 或空数组判定汇总单完整;详情入口直接提取当次结果,不递归补读。无匹配项为 [],补读未能核实时返回 [] 并附 warnings,不沿用列表旧值,其他票种不返回。',
|
|
141
141
|
});
|
|
142
142
|
const extInfoSchema = objectSchema({
|
|
143
143
|
expenseNote: { type: 'string', description: '费用说明(ext.expenseDesc),如「上海-武汉」' },
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { invoiceValidationError } from '../errors.js';
|
|
2
2
|
import { FULL_EXT_MASK, invoiceExtInfo, invoiceRecordOf, invoiceTollSummaryNames } from '../invoice-record.js';
|
|
3
|
-
import { readInvoiceEmployeeInfo } from '../read-enrichment.js';
|
|
3
|
+
import { readInvoiceEmployeeInfo, readInvoiceTollSummaryFiles } from '../read-enrichment.js';
|
|
4
4
|
import { readInvoicePreApprovals } from '../preapproval-enrichment.js';
|
|
5
5
|
import { invoiceDetailUrl, isRedReversedInvoice, optionalEpochSeconds, reqBase, workflow } from './shared.js';
|
|
6
6
|
const MONEY_PATTERN = /^-?\d+(?:\.\d{1,2})?$/u;
|
|
@@ -207,6 +207,15 @@ export class InvoiceReimCandidatesListOperation {
|
|
|
207
207
|
// 偏移按请求的页大小推进,不能按过滤红冲或去重后的数量计算。
|
|
208
208
|
startPos += pageSize;
|
|
209
209
|
}
|
|
210
|
+
const [approval, tollWarnings] = await Promise.all([
|
|
211
|
+
readInvoicePreApprovals(host, {
|
|
212
|
+
operation: this.name,
|
|
213
|
+
invoices: kept,
|
|
214
|
+
includePreApprovals: input.includePreApprovals,
|
|
215
|
+
}),
|
|
216
|
+
readInvoiceTollSummaryFiles(host, kept, this.name),
|
|
217
|
+
]);
|
|
218
|
+
warnings.push(...approval.warnings, ...tollWarnings);
|
|
210
219
|
const available = [];
|
|
211
220
|
const assigned = [];
|
|
212
221
|
if (kept.length) {
|
|
@@ -231,12 +240,6 @@ export class InvoiceReimCandidatesListOperation {
|
|
|
231
240
|
availableAmount: summarize(available),
|
|
232
241
|
assignedAmount: summarize(assigned),
|
|
233
242
|
};
|
|
234
|
-
const approval = await readInvoicePreApprovals(host, {
|
|
235
|
-
operation: this.name,
|
|
236
|
-
invoices: kept,
|
|
237
|
-
includePreApprovals: input.includePreApprovals,
|
|
238
|
-
});
|
|
239
|
-
warnings.push(...approval.warnings);
|
|
240
243
|
return {
|
|
241
244
|
status: complete ? 'COMPLETE' : 'PARTIAL',
|
|
242
245
|
data: {
|
|
@@ -1,8 +1,72 @@
|
|
|
1
1
|
import { InvoiceCliError } from './errors.js';
|
|
2
2
|
import { invoiceRecordOf, invoiceTollSummaryNames } from './invoice-record.js';
|
|
3
3
|
import { readInvoicePreApprovals } from './preapproval-enrichment.js';
|
|
4
|
+
import { assertBusinessSuccess } from './business-response.js';
|
|
4
5
|
const EXPENSE_TYPE_TIMEOUT_MS = 5_000;
|
|
5
6
|
const EMPLOYEE_INFO_TIMEOUT_MS = 5_000;
|
|
7
|
+
const TOLL_FILES_TIMEOUT_MS = 10_000;
|
|
8
|
+
const TOLL_FILES_BATCH_SIZE = 100;
|
|
9
|
+
/** sync 的附件不能代表汇总单完整性;通行费票统一批量读详情,不改写票面、凭证或金额。 */
|
|
10
|
+
export async function readInvoiceTollSummaryFiles(host, invoices, operation) {
|
|
11
|
+
const pending = new Map();
|
|
12
|
+
const warnings = [];
|
|
13
|
+
for (const item of invoices) {
|
|
14
|
+
const record = invoiceRecordOf(item);
|
|
15
|
+
const names = invoiceTollSummaryNames(record);
|
|
16
|
+
if (names === undefined)
|
|
17
|
+
continue;
|
|
18
|
+
record.tollSummaryNames = [];
|
|
19
|
+
if (Number(record.comm_info?.pro?.status) === 8)
|
|
20
|
+
continue;
|
|
21
|
+
const rawId = record.fid ?? record.id;
|
|
22
|
+
const fid = typeof rawId === 'string' ? rawId
|
|
23
|
+
: typeof rawId === 'number' && Number.isSafeInteger(rawId) ? String(rawId) : '';
|
|
24
|
+
if (!/^[1-9]\d*$/u.test(fid)) {
|
|
25
|
+
warnings.push('通行费发票缺少有效业务 ID,票据汇总单未能核实;tollSummaryNames 返回 []。');
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
const records = pending.get(fid) ?? [];
|
|
29
|
+
records.push(record);
|
|
30
|
+
pending.set(fid, records);
|
|
31
|
+
}
|
|
32
|
+
const ids = [...pending.keys()];
|
|
33
|
+
for (let start = 0; start < ids.length; start += TOLL_FILES_BATCH_SIZE) {
|
|
34
|
+
const batch = ids.slice(start, start + TOLL_FILES_BATCH_SIZE);
|
|
35
|
+
const unresolved = new Set(batch);
|
|
36
|
+
try {
|
|
37
|
+
const result = await host.invoiceRequest({
|
|
38
|
+
path: '/api/inc/get',
|
|
39
|
+
method: 'POST',
|
|
40
|
+
operation,
|
|
41
|
+
timeoutMs: TOLL_FILES_TIMEOUT_MS,
|
|
42
|
+
body: { ids: batch, userFlag: '1', isDelFlag: '1', req_base: { trace: String(Date.now()), dev: 1 } },
|
|
43
|
+
});
|
|
44
|
+
assertBusinessSuccess(result, 'toll_summary_files_failed', '通行费票据汇总单补读失败');
|
|
45
|
+
for (const item of Array.isArray(result?.infos) ? result.infos : []) {
|
|
46
|
+
if (item?.ret?.ret !== undefined && Number(item.ret.ret) !== 0)
|
|
47
|
+
continue;
|
|
48
|
+
const detail = invoiceRecordOf(item);
|
|
49
|
+
const fid = String(detail.fid ?? detail.id ?? '');
|
|
50
|
+
if (!unresolved.has(fid) || !Array.isArray(detail.flist))
|
|
51
|
+
continue;
|
|
52
|
+
// 仅合入同一真实发票的附件,供完整输出及语义投影共用;不覆盖 travel_ids 等列表数据。
|
|
53
|
+
for (const record of pending.get(fid)) {
|
|
54
|
+
record.flist = detail.flist;
|
|
55
|
+
record.tollSummaryNames = invoiceTollSummaryNames({ comm_info: record.comm_info, flist: detail.flist });
|
|
56
|
+
}
|
|
57
|
+
unresolved.delete(fid);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
if (error && typeof error === 'object' && 'type' in error && error.type === 'authentication')
|
|
62
|
+
throw error;
|
|
63
|
+
}
|
|
64
|
+
if (unresolved.size) {
|
|
65
|
+
warnings.push(`通行费发票 ${[...unresolved].join('、')} 的票据汇总单未能核实,tollSummaryNames 返回 [];发票结果保留,此空数组不表示已确认没有汇总单。`);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
return warnings;
|
|
69
|
+
}
|
|
6
70
|
function employeeEntities(value) {
|
|
7
71
|
if (value === undefined || value === null)
|
|
8
72
|
return [];
|
|
@@ -91,7 +155,7 @@ async function readExpenseTypes(host, operation) {
|
|
|
91
155
|
return { names: null, warnings: ['费用类型字典暂不可用,fyn 返回 null;发票和相关凭证仍正常返回。'] };
|
|
92
156
|
}
|
|
93
157
|
}
|
|
94
|
-
/**
|
|
158
|
+
/** 主请求、费用字典和人员卡片并行;列表通行费统一批量补读详情文件。 */
|
|
95
159
|
export async function readInvoicesWithMetadata(host, request, options = {}) {
|
|
96
160
|
if (options.includePreApprovals !== undefined && typeof options.includePreApprovals !== 'boolean') {
|
|
97
161
|
throw new InvoiceCliError('validation', 'input_invalid', 'includePreApprovals 必须是布尔值');
|
|
@@ -117,10 +181,13 @@ export async function readInvoicesWithMetadata(host, request, options = {}) {
|
|
|
117
181
|
if (missing.size) {
|
|
118
182
|
types.warnings.push(`费用类型字典未匹配 ${missing.size} 个 ID:${[...missing].slice(0, 10).join('、')};对应 fyn 返回 null。`);
|
|
119
183
|
}
|
|
120
|
-
const approval = await
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
184
|
+
const [approval, tollWarnings] = await Promise.all([
|
|
185
|
+
readInvoicePreApprovals(host, {
|
|
186
|
+
operation: request.operation,
|
|
187
|
+
invoices: infos,
|
|
188
|
+
includePreApprovals: options.includePreApprovals,
|
|
189
|
+
}),
|
|
190
|
+
request.path === '/api/inc/sync' ? readInvoiceTollSummaryFiles(host, infos, request.operation) : [],
|
|
191
|
+
]);
|
|
192
|
+
return { response, employeeInfo: employee.info, preApprovals: approval.preApprovals, warnings: [...types.warnings, ...employee.warnings, ...approval.warnings, ...tollWarnings] };
|
|
126
193
|
}
|
|
@@ -1419,7 +1419,7 @@ const ebMeetingCreateFlowPrepare = {
|
|
|
1419
1419
|
},
|
|
1420
1420
|
preferAlternatives: {
|
|
1421
1421
|
type: 'boolean',
|
|
1422
|
-
description: '时间已确认(timeConfirmed
|
|
1422
|
+
description: '时间已确认(timeConfirmed)时默认**不**扫全天找替代时段(该路要查当天全部会议、回执与日程,明显更慢)。'
|
|
1423
1423
|
+ '用户明确说"这个时间不行的话还有别的时段吗"再传 true',
|
|
1424
1424
|
},
|
|
1425
1425
|
includeContinuation: {
|
|
@@ -105,6 +105,13 @@ const meetingRoomUsage = {
|
|
|
105
105
|
},
|
|
106
106
|
},
|
|
107
107
|
handler: async (args, { host }) => {
|
|
108
|
+
// ⛔ 空参会一路打到上游 `/getRoomUsageData`,服务端只回一句「系统内部错误」(code 500),
|
|
109
|
+
// 调用方完全看不出是"漏了 bywhat"——2026-12-01 授权后复测把它记成「上游 HTTP/系统错误」。
|
|
110
|
+
// bywhat 决定按月/周/日查,缺了服务端根本不知道查什么,这里先拦。
|
|
111
|
+
// 提示只写"要做什么":服务端为什么返 500 属于实现细节,不进给调用方的 message。
|
|
112
|
+
if (args.bywhat === undefined || args.bywhat === null) {
|
|
113
|
+
throw meetingValidationError('bywhat_required', 'bywhat 必填:2=按月、3=按周、4=按日', { allowed: [2, 3, 4] });
|
|
114
|
+
}
|
|
108
115
|
const query = {};
|
|
109
116
|
if (args.roomid !== undefined)
|
|
110
117
|
query.roomid = toIdString(args.roomid, 'roomid');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { rsSuccess, schemaOf } from './types.js';
|
|
2
|
-
import { rsFail } from '../errors.js';
|
|
2
|
+
import { rsFail, rsValidationError } from '../errors.js';
|
|
3
3
|
import { resolveCurrentUser, randHex32, fetchDatasetRows } from '../shared.js';
|
|
4
4
|
const TYPES = {
|
|
5
5
|
demand: { listKey: 'demand', formType: 'demand_manage', title: '招聘需求', menuNames: ['招聘需求', '需求'] },
|
|
@@ -152,7 +152,8 @@ async function runList(env, args, feedbackTodoMode) {
|
|
|
152
152
|
const appId = cache.appId;
|
|
153
153
|
const type = String(args.type || (feedbackTodoMode ? 'interview' : ''));
|
|
154
154
|
if (!type || !TYPES[type]) {
|
|
155
|
-
|
|
155
|
+
// 2026-12-01 复测:缺 type 属参数错误,必须落 E-0003,不能借 rsFail 兜到 E-9999。
|
|
156
|
+
throw rsValidationError('type_invalid', 'type 必须是 demand|position|entry|offer|interview|candidate 之一');
|
|
156
157
|
}
|
|
157
158
|
const t = TYPES[type];
|
|
158
159
|
const pageSize = Number(args.pageSize || (feedbackTodoMode ? 200 : 10));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { rsSuccess, schemaOf } from './types.js';
|
|
2
|
-
import { rsFail } from '../errors.js';
|
|
2
|
+
import { rsFail, rsValidationError } from '../errors.js';
|
|
3
3
|
import { objIdOf, formIdOf, getFormDataRecord, getFormLayoutMeta } from '../shared.js';
|
|
4
4
|
function makeDictLookup(cache) {
|
|
5
5
|
const byId = new Map();
|
|
@@ -44,8 +44,9 @@ export async function handlerProfile(args, env) {
|
|
|
44
44
|
const ctx = { host, baseUrl: session.baseUrl.replace(/\/+$/, ''), appId: '', cache: await env.recruitContext() };
|
|
45
45
|
ctx.appId = ctx.cache.appId;
|
|
46
46
|
const talentId = String(args.talentId || '').trim();
|
|
47
|
+
// 2026-12-01 复测:缺参走 validation(E-0003),不再抛 rsFail 落成 type:api/E-9999
|
|
47
48
|
if (!talentId)
|
|
48
|
-
throw
|
|
49
|
+
throw rsValidationError('talent_id_required', 'talentId 必填');
|
|
49
50
|
const objId = objIdOf(ctx.cache, 'talent_pool');
|
|
50
51
|
const formId = formIdOf(ctx.cache, 'talent_pool');
|
|
51
52
|
const fields = ctx.cache.fields[objId] || {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { rsSuccess, schemaOf } from './types.js';
|
|
2
|
-
import { rsFail } from '../errors.js';
|
|
2
|
+
import { rsFail, rsValidationError } from '../errors.js';
|
|
3
3
|
import { randHex32, fetchDatasetRows, detectHiddenFields, hiddenFieldsHint } from '../shared.js';
|
|
4
4
|
import { resolveTags } from '../tag-lookup.js';
|
|
5
5
|
const ID_RE = /^\d+$/;
|
|
@@ -529,7 +529,7 @@ async function handlerSearchByTag(args, env) {
|
|
|
529
529
|
const wanted = (Array.isArray(args.tags) ? args.tags : [args.tags])
|
|
530
530
|
.map((x) => String(x == null ? '' : x).trim()).filter(Boolean);
|
|
531
531
|
if (!wanted.length)
|
|
532
|
-
throw
|
|
532
|
+
throw rsValidationError('tags_required', '请提供要搜索的标签名,例如:{"tags":["985"]}。');
|
|
533
533
|
const match = args.match === 'all' ? 'all' : 'any';
|
|
534
534
|
const pageSize = clampInt(args.pageSize, 1, 100, 20);
|
|
535
535
|
const current = clampInt(args.current, 1, 10000, 1);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { rsSuccess, schemaOf } from './types.js';
|
|
2
|
-
import {
|
|
2
|
+
import { rsValidationError } from '../errors.js';
|
|
3
3
|
import { candidateSearchHandler } from './search.js';
|
|
4
4
|
import { handlerProfile } from './profile.js';
|
|
5
5
|
function clampInt(v, min, max, fallback) {
|
|
@@ -42,7 +42,8 @@ async function handlerShortlist(args, env) {
|
|
|
42
42
|
// 实测折叠内部空格会把多槽 AND 查询降级成子串匹配——「制造业 解决方案 经理」折叠后命中 0,
|
|
43
43
|
// 而拆槽多探针可召回 54 人并把最佳人选排到第 1。详见 SKILL.md §6.7。
|
|
44
44
|
if (!keyword) {
|
|
45
|
-
|
|
45
|
+
// 2026-12-01 复测:缺参走 validation(E-0003),不再抛 rsFail 落成 type:api/E-9999
|
|
46
|
+
throw rsValidationError('keyword_required', 'keyword 必填:请提供要检索的关键词,例如 {"keyword":"Java开发"}');
|
|
46
47
|
}
|
|
47
48
|
const limit = clampInt(args.limit, 1, 10, 5);
|
|
48
49
|
const concurrency = clampInt(args.concurrency, 1, 10, 10);
|
|
@@ -171,7 +171,12 @@ function prepareOperation() {
|
|
|
171
171
|
},
|
|
172
172
|
}, { required: ['talentId', 'tags'] }),
|
|
173
173
|
handler: async (args, env) => {
|
|
174
|
+
// 2026-12-01 复测:talentId、tags 同为必填,空参时一次报全,避免"补一个再报一个"被误读成漏校验
|
|
174
175
|
const talentId = normName(args.talentId);
|
|
176
|
+
const tagsGiven = Array.isArray(args.tags) && args.tags.length > 0;
|
|
177
|
+
if (!talentId && !tagsGiven) {
|
|
178
|
+
throw rsValidationError('params_required', '缺少必填参数:talentId(人才 id)、tags(标签清单,如 ["985"])');
|
|
179
|
+
}
|
|
175
180
|
if (!talentId)
|
|
176
181
|
throw rsValidationError('talent_id_required', '请提供 talentId');
|
|
177
182
|
const plan = await buildPlan(env.host, args, talentId);
|
|
@@ -5384,7 +5384,8 @@ async function runCreateRequest(args, env, options = {}) {
|
|
|
5384
5384
|
* 所以下面的 `message` 要明确告诉模型:从 `data.finalMarkdown` 取内容、原样作为本轮回复正文。
|
|
5385
5385
|
*
|
|
5386
5386
|
* 判据:桌面客户端可由 Agent 根据宿主明确上下文传入全局参数 `--runtime-agent xiaoe`;
|
|
5387
|
-
* 传入环境中存在任意 `XIAOE_*` 变量时也直接判定为小e
|
|
5387
|
+
* 传入环境中存在任意 `XIAOE_*` 变量时也直接判定为小e环境,且**优先级最高**——
|
|
5388
|
+
* 环境里有 `XIAOE_*` 时即使传了 `--runtime-agent workbuddy` 也按小e 处理。
|
|
5388
5389
|
* 历史会话和本地文件本身不参与宿主身份判断。
|
|
5389
5390
|
* 本处复用上面算好的 `isXiaoE`(同一判据,只求值一次)。
|
|
5390
5391
|
*
|
package/docs/agent-invoice.md
CHANGED
|
@@ -60,7 +60,7 @@ weaver-work-cli --json invoice run invoice.list --input-json '{"page_size":10,"s
|
|
|
60
60
|
|
|
61
61
|
**候选发票详情链接**:`invoice.reim.candidates.list` 的 `available[]` 和 `assigned[]` 每张票均返回 `detailUrl`,由 CLI 用当前 E10 会话真实地址及本票 fid 生成。直接用该 URL 展示发票号码链接,不为取得候选链接额外查详情;两组完整保留该字段。
|
|
62
62
|
|
|
63
|
-
**通行费票据汇总单输出**:个人 / 企业票夹、待报销候选及详情对 `comm_info.pro.cname="电子发票(通行费)"` 的票返回 `tollSummaryNames`(文件名数组),取本票 `flist` 中未删除且名称含“票据汇总单”的全部原始 `name`,如 `["通行费电子票据汇总单(行程).pdf"]
|
|
63
|
+
**通行费票据汇总单输出**:个人 / 企业票夹、待报销候选及详情对 `comm_info.pro.cname="电子发票(通行费)"` 的票返回 `tollSummaryNames`(文件名数组),取本票 `flist` 中未删除且名称含“票据汇总单”的全部原始 `name`,如 `["通行费电子票据汇总单(行程).pdf"]`。列表 / 候选中的所有非全额红冲通行费票均由 CLI 按真实 fid 去重、每批最多 100 张用既有详情 `ids` 合同读取,以 get 的真实文件清单为准。sync 的 `flist` 即使已有空数组、原发票附件或旧汇总名,也不能证明汇总单完整,不据此跳过 get;其他票种不补读,详情入口直接使用当次 get,不递归。可靠列表无匹配时为 `[]`;补读失败 / 未能核实时保留发票及 `[]` 并附警告,不沿用列表旧值,认证错误仍传播,不把未知说成没有汇总单。summary / detail 保留字段和完整文件名;补读仅补真实文件信息,不改变 `travel_ids`、凭证关联、其他票面或计额,不下载附件。字段路径见 invoice-output-view.md 的 toll-summary-names。
|
|
64
64
|
|
|
65
65
|
**AI 报销默认合并个人票夹与本次上传**:用户提出报销需求且未明确仅报本次上传时,必须按本次日期、行程、费用及其他已确认条件查全个人票夹,将全部符合条件的正式票与本次上传正式票按真实 fid 合并去重纳入范围。仅提供附件 / fid 或说“上传这几张帮我报销”不等于只报上传;上传成功、上传全部失败或票夹暂时零条均不能跳过另一来源。上周等相对日期从本次系统时间推算,差旅按实际消费 / 住宿期间判断,不凭文件名或晚开的开票日漏票。水单 / 行程单仅作相关凭证,不重复计额;来源不完整或仍有未解决错误时暂停范围确认及填单。先展示整份合并清单,默认纳入全部合规票,用户明确选子集后才缩小;已查全的本轮同条件新鲜结果可复用。规则见 reim-workflow.md 的 reim-invoice-scope-union,福利仍执行专项窗口及每申请每轮 100 张限制并完整说明未处理项。
|
|
66
66
|
|
package/docs/e10-auth.md
CHANGED
|
@@ -40,7 +40,9 @@ weaver-work-cli auth export-weaver-env
|
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
`auth login`、`auth oidc`、`auth init`、`auth set` 和 `auth xiaoe` 在未显式传入
|
|
43
|
-
`--base-url`、且当前 profile
|
|
43
|
+
`--base-url`、且当前 profile 没有保存域名时,先取宿主注入的默认域
|
|
44
|
+
(`WEAVER_XIAOE_DEFAULT_DOMAIN` 等,见下文「目标解析优先级」),仍取不到才使用
|
|
45
|
+
`https://weapp.eteams.cn`。
|
|
44
46
|
XiaoE 宿主(网页端 `XIAOE_CLIENT_TYPE=cloud`、桌面客户端 `client`)保持原有解析逻辑:
|
|
45
47
|
先从环境上下文取 E10 目标域(`WEAVER_XIAOE_E10_*` / `WEAVER_XIAOE_DEFAULT_*`、
|
|
46
48
|
`WEAVER_XIAOE_E10_DOMAIN` 等专用变量,以及登录凭据映射),取不到才回退内置默认值;
|
|
@@ -84,6 +86,9 @@ XiaoE 宿主(网页端 `XIAOE_CLIENT_TYPE=cloud`、桌面客户端 `client`)
|
|
|
84
86
|
| 终端 / 未知 | 以上都不命中 | `default` | `weaver-work-cli` | 无 |
|
|
85
87
|
|
|
86
88
|
判定顺序即上表顺序,XiaoE 优先(网页端沙箱里可能同时存在其他框架变量)。
|
|
89
|
+
`XIAOE_*` 环境变量是**最高优先级**,且同时决定环境判定与登录分区:只要进程环境里存在任一
|
|
90
|
+
`XIAOE_*` 变量,即使同时传了 `--runtime-agent workbuddy`,也按 `xiaoe` 处理。
|
|
91
|
+
`--runtime-agent` 只在没有任何 `XIAOE_*` 标记时作为次优先的自报身份使用。
|
|
87
92
|
`DOUBAO_` / `QWEN_` / `DASHSCOPE_` 等属对方平台保留前缀,CLI 只读不写。
|
|
88
93
|
豆包与千问的自定义协议未注册前,显式 `auth login` 的成功页需靠
|
|
89
94
|
`--agent-return-url` 或 `WEAVER_AGENT_RETURN_URL` 指定返回地址;显式 `--agent_type` 也会
|
|
@@ -96,6 +101,14 @@ XiaoE 宿主(网页端 `XIAOE_CLIENT_TYPE=cloud`、桌面客户端 `client`)
|
|
|
96
101
|
3. 全局 `profile` 指针(仅 WorkBuddy / XiaoE 之外的宿主保留此兼容行为)
|
|
97
102
|
4. `resolveDefaultE10BaseUrl(env)`
|
|
98
103
|
|
|
104
|
+
浏览器登录(`auth login` / `oidc` / `init`)与 `auth set` 在**没有显式域名、profile 也没存域名**时,
|
|
105
|
+
会先取宿主注入的默认域(`WEAVER_XIAOE_DEFAULT_DOMAIN`,其次 `WEAVER_XIAOE_E10_DOMAIN` /
|
|
106
|
+
`WEAVER_XIAOE_E10_BASE_URL` 等单域名变量,见 `resolveConfiguredE10BaseUrl`),仍为空才落到
|
|
107
|
+
`resolveDefaultE10BaseUrl(env)` 的硬编码兜底(普通环境 `https://weapp.eteams.cn`、XiaoE 宿主
|
|
108
|
+
`https://www.e-cology.com.cn`)。宿主默认域**排在 profile 之后**:它是"还没有任何线索时"的补位,
|
|
109
|
+
不能顶掉用户上一次显式登录选的租户。`WEAVER_XIAOE_AUTH_MAP` 这类凭据映射里的域名不参与该解析,
|
|
110
|
+
`XIAOE_DOMAIN` 是换票服务地址同样不参与。
|
|
111
|
+
|
|
99
112
|
记录存在但不可用时**按未登录处理,不回落**到其他 profile——回落等于带着另一个租户的
|
|
100
113
|
凭据干活。三种不可用状态:`profile-missing`(目录被删)、`auth-missing`(凭据被
|
|
101
114
|
`auth logout` 清掉)、`domain-mismatch`(该 profile 后来被别的宿主登录到了另一个域名)。
|
package/docs/hrm.md
CHANGED
|
@@ -117,10 +117,14 @@ printf '%s\n' '{"keyword":"张三"}' | weaver-work-cli --json hrm run hrm.employ
|
|
|
117
117
|
|
|
118
118
|
## 禁用边界
|
|
119
119
|
|
|
120
|
-
`withheldOperations` 中声明的能力不实现,也不要绕过:
|
|
120
|
+
`hrm schema` 首屏的 `withheldCount` + `withheldOperations` 摘要(最多 6 条)与 `--full` 明细是能力边界的单一事实来源;`withheldOperations` 中声明的能力不实现,也不要绕过:
|
|
121
121
|
|
|
122
122
|
- **代理商查询**(`hrm.employee.dls`):`containsDls=true` 仅泛微自用系统域名支持(自用域名白名单),客户/其他环境禁止触发。
|
|
123
123
|
- **列多维**(`hrm.org.virtuals`):已下线并入 `hrm.org.resolve`;「列出该租户有哪些多维」暂不支持,不得构造假查询绕取 `availableVirtuals`。
|
|
124
|
+
- **组织变更**(`hrm.org.change`):写操作,本模块全部只读;替代做法是 E10 组织管理界面自助操作。
|
|
125
|
+
- **岗位调整**(`hrm.position.adjust`):写操作,本模块全部只读;替代做法是 E10 组织管理界面自助操作。
|
|
126
|
+
|
|
127
|
+
**服务端不可用错误的改写**(飞书审计 H-01):员工详情 / 组织详情返回「系统内部错误」、下属按 id 返回「没有权限」时,E10 侧未装配或未开通对应接口。`host.ts` 会把这类失败改写成 `api/operation_unavailable`(附开通指引)或增强后的 `api/permission_denied`(提示开通数据可见范围),原始文案保留在 `details.message`。这是 CLI 侧的提示补救;真正的开通仍需 E10 / 租户侧处理。
|
|
124
128
|
|
|
125
129
|
## 测试
|
|
126
130
|
|
package/docs/invoice.md
CHANGED
|
@@ -62,7 +62,7 @@ weaver-work-cli --json invoice list --fields number,detailUrl
|
|
|
62
62
|
|
|
63
63
|
**候选发票详情链接**:`invoice.reim.candidates.list` 的 `available[]` 和 `assigned[]` 每张票均返回 `detailUrl`,由 CLI 用当前 E10 会话真实地址及本票 fid 生成。直接用该 URL 展示发票号码链接,不为取得候选链接额外查详情;两组完整保留该字段。
|
|
64
64
|
|
|
65
|
-
**通行费票据汇总单输出**:个人 / 企业票夹、待报销候选及详情对 `comm_info.pro.cname="电子发票(通行费)"` 的票返回 `tollSummaryNames`(文件名数组),取本票 `flist` 中未删除且名称含“票据汇总单”的全部原始 `name`,如 `["通行费电子票据汇总单(行程).pdf"]
|
|
65
|
+
**通行费票据汇总单输出**:个人 / 企业票夹、待报销候选及详情对 `comm_info.pro.cname="电子发票(通行费)"` 的票返回 `tollSummaryNames`(文件名数组),取本票 `flist` 中未删除且名称含“票据汇总单”的全部原始 `name`,如 `["通行费电子票据汇总单(行程).pdf"]`。列表 / 候选中的所有非全额红冲通行费票均由 CLI 按真实 fid 去重、每批最多 100 张用既有详情 `ids` 合同读取,以 get 的真实文件清单为准。sync 的 `flist` 即使已有空数组、原发票附件或旧汇总名,也不能证明汇总单完整,不据此跳过 get;其他票种不补读,详情入口直接使用当次 get,不递归。可靠列表无匹配时为 `[]`;补读失败 / 未能核实时保留发票及 `[]` 并附警告,不沿用列表旧值,认证错误仍传播,不把未知说成没有汇总单。summary / detail 保留字段和完整文件名;补读仅补真实文件信息,不改变 `travel_ids`、凭证关联、其他票面或计额,不下载附件。字段路径见 invoice-output-view.md 的 toll-summary-names。
|
|
66
66
|
|
|
67
67
|
**AI 报销默认合并个人票夹与本次上传**:用户提出报销需求且未明确仅报本次上传时,必须按本次日期、行程、费用及其他已确认条件查全个人票夹,将全部符合条件的正式票与本次上传正式票按真实 fid 合并去重纳入范围。仅提供附件 / fid 或说“上传这几张帮我报销”不等于只报上传;上传成功、上传全部失败或票夹暂时零条均不能跳过另一来源。上周等相对日期从本次系统时间推算,差旅按实际消费 / 住宿期间判断,不凭文件名或晚开的开票日漏票。水单 / 行程单仅作相关凭证,不重复计额;来源不完整或仍有未解决错误时暂停范围确认及填单。先展示整份合并清单,默认纳入全部合规票,用户明确选子集后才缩小;已查全的本轮同条件新鲜结果可复用。规则见 reim-workflow.md 的 reim-invoice-scope-union,福利仍执行专项窗口及每申请每轮 100 张限制并完整说明未处理项。
|
|
68
68
|
|
package/docs/ziguanjia.md
CHANGED
|
@@ -65,8 +65,12 @@ weaver-work-cli --json asset run asset.list --input-json '{"page_size":10}'
|
|
|
65
65
|
| `asset.repair.create` | 高风险写 | ESB 动作流报修;prepare 返回 continuation |
|
|
66
66
|
| `asset.purch` | 高风险写 | ESB 动作流采购申请;prepare 返回 continuation |
|
|
67
67
|
| `asset.depre` | 高风险写 | 折旧设置读取 + 预检 + 任务创建;prepare 返回 continuation |
|
|
68
|
+
| `asset.viewlink` | 只读 | 生成卡片式「查看详情」链接(scene + ids;depre_task 用 calc_month) |
|
|
69
|
+
| `asset.audit.list` | 只读 | 资产清查分页取数(动作流 esbFlowId=907938775240413184;**门禁豁免**) |
|
|
70
|
+
| `asset.audit.confirm` | 高风险写 | 清查确认表写入(动作流 esbFlowId=913634865562390528;**门禁豁免**);prepare 返回 continuation |
|
|
71
|
+
| `asset.report.apply` | 高风险写 | 资产上报写入(动作流 esbFlowId=915199285606354944;**门禁豁免**,moduleSource 固定 AISKILL);prepare 返回 continuation |
|
|
68
72
|
|
|
69
|
-
暂未暴露:资产调拨(`asset.transfer`)、流程审批(`asset.approve`)、图片上传(`asset.file.upload
|
|
73
|
+
暂未暴露:资产调拨(`asset.transfer`)、流程审批(`asset.approve`)、图片上传(`asset.file.upload`)、清查/上报 HTML 渲染与图片识别(脚本不随 Skill 包分发);闲置资产判定由 `asset-idle` 模块提供、处置发起由 `workflow` 模块提供。原因见 `skills/weaver-e10-ziguanjia/references/ziguanjia-disabled-capabilities.md`。
|
|
70
74
|
|
|
71
75
|
## 常用命令
|
|
72
76
|
|
package/package.json
CHANGED