weaver-work-cli 0.1.70 → 0.1.71
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-VUTREF3P.js → archive-5P33NAUN.js} +22 -5
- package/dist/chunks/{archive-oa-VXXO4RTB.js → archive-oa-YTY5D7DG.js} +17 -5
- package/dist/chunks/{asset-45U6TY7I.js → asset-3Q5MFQBX.js} +22 -5
- package/dist/chunks/{asset-idle-YCRBMTIT.js → asset-idle-PQPNYIS7.js} +15 -5
- package/dist/chunks/{attachment-content-DMU7KNZ7.js → attachment-content-7CN7JB6B.js} +3 -3
- package/dist/chunks/{blog-5AML4WMG.js → blog-MFHHK6ZR.js} +25 -5
- package/dist/chunks/{caizhilian-3P7BUNHT.js → caizhilian-OZ435AYW.js} +22 -8
- package/dist/chunks/{calendar-2HUXM3CZ.js → calendar-TNJXS5UC.js} +15 -5
- package/dist/chunks/{chunk-H2NRTGZR.js → chunk-2DNCKZRX.js} +3 -3
- package/dist/chunks/{chunk-DVFA3ODS.js → chunk-35A56FJ7.js} +12 -0
- package/dist/chunks/{chunk-HG6INLH6.js → chunk-6MMSLE6K.js} +23 -6
- package/dist/chunks/{chunk-UVWW5ABZ.js → chunk-B4NINGP2.js} +3 -3
- package/dist/chunks/{chunk-LRKKKO5A.js → chunk-DRJYPXKC.js} +3 -4
- package/dist/chunks/{chunk-KDOJW5LH.js → chunk-EJLP63UO.js} +1 -1
- package/dist/chunks/{chunk-HAORST2G.js → chunk-FRMDHZSN.js} +11 -11
- package/dist/chunks/{chunk-GWM5TLIK.js → chunk-G7ZM2VOX.js} +34 -34
- package/dist/chunks/{chunk-LSVA7QA6.js → chunk-GB2MCJPG.js} +3 -1
- package/dist/chunks/{chunk-L2A3COWV.js → chunk-ICNUOWLL.js} +4 -4
- package/dist/chunks/{chunk-GTAFCAVP.js → chunk-IZCQU5D5.js} +1 -1
- package/dist/chunks/{chunk-7CINV2BU.js → chunk-LU2SPJYY.js} +2 -2
- package/dist/chunks/{chunk-E7VWE2XI.js → chunk-MD5RXRI3.js} +3 -3
- package/dist/chunks/{chunk-VZUH3LKI.js → chunk-MZVQKQP5.js} +167 -157
- package/dist/chunks/{chunk-X6PMJQGO.js → chunk-OFCF23FY.js} +6 -6
- package/dist/chunks/{chunk-IVCOZCAW.js → chunk-OPTJ6IF7.js} +1 -1
- package/dist/chunks/{chunk-727VKJQK.js → chunk-OZ7CJC7W.js} +2 -2
- package/dist/chunks/{chunk-T24EBWAZ.js → chunk-P3AFNAJ6.js} +48 -21
- package/dist/chunks/{chunk-LJE7RZNC.js → chunk-Q3EXRNB4.js} +1 -1
- package/dist/chunks/{chunk-QYDSTYGG.js → chunk-SKWKCLJX.js} +3 -3
- package/dist/chunks/{chunk-DSBV4GRK.js → chunk-SSS75WXW.js} +3 -3
- package/dist/chunks/{chunk-I5XB4MZT.js → chunk-SUWR5QEG.js} +94 -65
- package/dist/chunks/{chunk-XIBMZEDB.js → chunk-VJWVB55R.js} +2 -2
- package/dist/chunks/{chunk-EHH363SP.js → chunk-VMVMEIL3.js} +4 -4
- package/dist/chunks/chunk-WM33BSIL.js +136 -0
- package/dist/chunks/{chunk-GFOFUH6O.js → chunk-X2C5CGGM.js} +52 -51
- package/dist/chunks/{chunk-4W6BSNIL.js → chunk-XLSJC6JZ.js} +6 -6
- package/dist/chunks/{chunk-U3OO3IZF.js → chunk-YN5SD4TX.js} +20 -7
- package/dist/chunks/{conflict-YW5BULJ3.js → conflict-Y4PXZ2YQ.js} +2 -2
- package/dist/chunks/{contract-3PMHUASH.js → contract-C3BGUMBM.js} +48 -5
- package/dist/chunks/{cowork-FZBTTBYX.js → cowork-2AWG4QLA.js} +37 -8
- package/dist/chunks/{create-flow-5OBS3B3V.js → create-flow-LOUOK46Z.js} +6 -6
- package/dist/chunks/{data-2YZ6A6TL.js → data-BSFYMXVO.js} +99 -184
- package/dist/chunks/{ebuilder-form-AWPTMZBZ.js → ebuilder-form-LAAMTD2Y.js} +17 -7
- package/dist/chunks/{ehr-MNPR4TE5.js → ehr-36KEX5SH.js} +62 -13
- package/dist/chunks/{entry-mode-L65OWPFM.js → entry-mode-6N2IGCS4.js} +3 -3
- package/dist/chunks/{env-XW7LYIME.js → env-QYLS3EB3.js} +2 -2
- package/dist/chunks/{esb-GSB5QCEX.js → esb-PTYS3E67.js} +17 -7
- package/dist/chunks/{factory-MHFZZAGH.js → factory-LPFPKZ4T.js} +1 -1
- package/dist/chunks/{fna-XBSNUS2V.js → fna-JNHCLRDE.js} +15 -5
- package/dist/chunks/{group-chat-EEOLO5NM.js → group-chat-QP2WX4QJ.js} +3 -3
- package/dist/chunks/{host-2UMNXX5H.js → host-57LSRSE7.js} +4 -4
- package/dist/chunks/{host-NVDG3NC6.js → host-7BVR7CQ3.js} +4 -4
- package/dist/chunks/{host-SYPCA63D.js → host-C2BLBIID.js} +4 -4
- package/dist/chunks/{host-XVWBOSEN.js → host-K2ZKNXME.js} +4 -4
- package/dist/chunks/{host-R7BP3CTI.js → host-NS36QFLR.js} +6 -4
- package/dist/chunks/{host-BD44ASOD.js → host-QXFKQXNX.js} +4 -4
- package/dist/chunks/{hrm-FZUDJAND.js → hrm-FSGO4NSH.js} +15 -6
- package/dist/chunks/{im-F5NENPD7.js → im-2BFGS2XO.js} +16 -6
- package/dist/chunks/{invoice-DS6FLU55.js → invoice-JKLTTHSZ.js} +27 -6
- package/dist/chunks/{jiuchuanhui-JCBUR563.js → jiuchuanhui-PTABJE7V.js} +19 -6
- package/dist/chunks/{lazy-dispatch-F6O2EPGR.js → lazy-dispatch-YN2ZP3CS.js} +6 -6
- package/dist/chunks/{mail-ZEOSANEJ.js → mail-YNO7ZZUK.js} +116 -97
- package/dist/chunks/{meeting-PCD5EPBF.js → meeting-NIDHDBCB.js} +29 -16
- package/dist/chunks/{minute-doc-WTZJVCHG.js → minute-doc-G3QAT7DE.js} +4 -4
- package/dist/chunks/{okr-OZUMTMCL.js → okr-QC52G6AJ.js} +15 -5
- package/dist/chunks/{operations-LQY3FTPH.js → operations-2WHIF5WV.js} +1 -1
- package/dist/chunks/{operations-UTUWFJTX.js → operations-MQV32ITT.js} +5 -5
- package/dist/chunks/{performance-SMVTPK6T.js → performance-3MQ3AHDQ.js} +92 -7
- package/dist/chunks/{plan-C2NENH42.js → plan-ISINIEPY.js} +15 -5
- package/dist/chunks/{project-FAJ2P3UR.js → project-IJ6DVKT7.js} +18 -5
- package/dist/chunks/{reception-NH6MJFPR.js → reception-3H5LUG2I.js} +17 -7
- package/dist/chunks/{recruit-stage-DPEFHLSE.js → recruit-stage-MIOJXP6W.js} +412 -85
- package/dist/chunks/{registry-ZQ7OONCB.js → registry-3GQRYP2R.js} +12 -12
- package/dist/chunks/{registry-3B3OAJYX.js → registry-3S7AVMXR.js} +4 -4
- package/dist/chunks/{registry-FTPUUHWC.js → registry-NHHKOEU3.js} +5 -5
- package/dist/chunks/{room-recommend-73NBN3RU.js → room-recommend-IOKBJVYP.js} +4 -4
- package/dist/chunks/{schedule-SDBOBBUQ.js → schedule-IB6EUARH.js} +4 -4
- package/dist/chunks/{smart-extract-GTYKF5TJ.js → smart-extract-N2TK3CEF.js} +19 -6
- package/dist/chunks/{workflow-OWHWLAOX.js → workflow-RINBAL2M.js} +22 -8
- package/dist/cmd/auth/index.js +23 -0
- package/dist/cmd/e10/index.js +2 -1
- package/dist/cmd/index.js +2 -0
- package/dist/core/manifest-view.js +207 -0
- package/dist/core/output.js +38 -8
- package/dist/index.js +35 -35
- package/dist/internal/e10/auth/crypto.js +18 -8
- package/dist/internal/e10/auth/error-log.js +1 -2
- package/dist/internal/e10/auth/messages.js +2 -3
- package/dist/internal/e10/auth/xiaoe.js +1 -1
- package/dist/internal/e10/tls-policy.js +61 -13
- package/dist/shortcuts/archive/index.js +11 -2
- package/dist/shortcuts/archive/operations/download.js +1 -0
- package/dist/shortcuts/archive/operations/flow-url.js +3 -0
- package/dist/shortcuts/archive/operations/prelib.js +2 -0
- package/dist/shortcuts/archive/operations/upload.js +1 -0
- package/dist/shortcuts/archive-oa/index.js +11 -2
- package/dist/shortcuts/archive-oa/operations/borrow-car.js +2 -0
- package/dist/shortcuts/asset/index.js +11 -2
- package/dist/shortcuts/asset/manifest.js +7 -0
- package/dist/shortcuts/asset-idle/index.js +11 -2
- package/dist/shortcuts/blog/index.js +11 -2
- package/dist/shortcuts/blog/manifest.js +10 -0
- package/dist/shortcuts/caizhilian/host.js +20 -4
- package/dist/shortcuts/caizhilian/index.js +12 -2
- package/dist/shortcuts/caizhilian/manifest.js +4 -25
- package/dist/shortcuts/caizhilian/operations/handlers/search.js +34 -0
- package/dist/shortcuts/caizhilian/operations/registry.js +25 -1
- package/dist/shortcuts/calendar/index.js +11 -2
- package/dist/shortcuts/contract/index.js +11 -2
- package/dist/shortcuts/contract/manifest.js +32 -0
- package/dist/shortcuts/contract/operations/write.js +3 -0
- package/dist/shortcuts/cowork/index.js +21 -5
- package/dist/shortcuts/cowork/manifest.js +3 -0
- package/dist/shortcuts/cowork/operations/discuss-write.js +2 -0
- package/dist/shortcuts/cowork/operations/item-write.js +3 -0
- package/dist/shortcuts/cowork/operations/member-write.js +2 -0
- package/dist/shortcuts/cowork/operations/permission-write.js +2 -0
- package/dist/shortcuts/cowork/operations/review-write.js +1 -0
- package/dist/shortcuts/data/errors.js +16 -29
- package/dist/shortcuts/data/host.js +16 -7
- package/dist/shortcuts/data/index.js +12 -41
- package/dist/shortcuts/data/manifest.js +5 -44
- package/dist/shortcuts/data/operations/attend.js +2 -2
- package/dist/shortcuts/data/operations/conf.js +0 -88
- package/dist/shortcuts/data/operations/ds.js +4 -4
- package/dist/shortcuts/data/operations/index.js +1 -5
- package/dist/shortcuts/data/operations/module.js +40 -14
- package/dist/shortcuts/data/operations/query.js +2 -2
- package/dist/shortcuts/ebuilder-form/index.js +11 -2
- package/dist/shortcuts/ebuilder-form/manifest.js +12 -0
- package/dist/shortcuts/ehr/index.js +11 -2
- package/dist/shortcuts/ehr/operations/attend-write.js +51 -8
- package/dist/shortcuts/esb/index.js +11 -2
- package/dist/shortcuts/esb/manifest.js +2 -0
- package/dist/shortcuts/fna/index.js +11 -2
- package/dist/shortcuts/hrm/index.js +11 -1
- package/dist/shortcuts/im/index.js +11 -2
- package/dist/shortcuts/invoice/index.js +11 -2
- package/dist/shortcuts/invoice/manifest.js +8 -0
- package/dist/shortcuts/jiuchuanhui/index.js +15 -1
- package/dist/shortcuts/jiuchuanhui/manifest.js +2 -0
- package/dist/shortcuts/mail/errors.js +14 -0
- package/dist/shortcuts/mail/index.js +23 -6
- package/dist/shortcuts/mail/manifest.js +11 -4
- package/dist/shortcuts/mail/operations/mail-blacklist.js +6 -6
- package/dist/shortcuts/mail/operations/mail-contacts.js +10 -10
- package/dist/shortcuts/mail/operations/mail-manage.js +15 -14
- package/dist/shortcuts/mail/operations/mail-read.js +7 -25
- package/dist/shortcuts/mail/operations/mail-send.js +12 -12
- package/dist/shortcuts/mail/operations/mail-sign.js +10 -10
- package/dist/shortcuts/mail/operations/mail-template.js +10 -10
- package/dist/shortcuts/meeting/index.js +11 -2
- package/dist/shortcuts/meeting/operations/invitation-publish.js +1 -0
- package/dist/shortcuts/okr/index.js +11 -2
- package/dist/shortcuts/performance/index.js +62 -3
- package/dist/shortcuts/performance/scheme-validate.js +7 -0
- package/dist/shortcuts/performance/shared.js +40 -2
- package/dist/shortcuts/plan/index.js +11 -2
- package/dist/shortcuts/project/index.js +11 -2
- package/dist/shortcuts/project/operations/write.js +3 -0
- package/dist/shortcuts/reception/index.js +11 -2
- package/dist/shortcuts/reception/manifest.js +2 -2
- package/dist/shortcuts/reception/operations/ask.js +3 -0
- package/dist/shortcuts/recruit-stage/index.js +22 -3
- package/dist/shortcuts/recruit-stage/manifest.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +33 -16
- package/dist/shortcuts/recruit-stage/operations/profile.js +186 -0
- package/dist/shortcuts/recruit-stage/operations/registry.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +76 -47
- package/dist/shortcuts/recruit-stage/operations/search.js +151 -16
- package/dist/shortcuts/recruit-stage/operations/tag.js +17 -3
- package/dist/shortcuts/recruit-stage/shared.js +11 -1
- package/dist/shortcuts/smart-extract/index.js +11 -2
- package/dist/shortcuts/smart-extract/manifest.js +1 -0
- package/dist/shortcuts/smart-extract/operations/save.js +2 -0
- package/dist/shortcuts/workflow/index.js +21 -1
- package/dist/shortcuts/workflow/operations/read.js +2 -2
- package/dist/shortcuts/workflow/operations/write.js +1 -1
- package/docs/caizhilian.md +1 -1
- package/docs/contract.md +1 -0
- package/docs/data.md +22 -22
- package/docs/e10-auth.md +41 -33
- package/docs/ehr.md +2 -0
- package/docs/reception.md +4 -3
- package/package.json +1 -1
- package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
- package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
- package/scripts/pysite/sitecustomize.py +41 -0
- package/skill-template/domains/data.md +4 -4
- package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
- package/skills/weaver-e10-caizhilian/references/org-browser.md +1 -0
- package/skills/weaver-e10-cowork/SKILL.md +3 -1
- package/skills/weaver-e10-data/SKILL.md +12 -16
- package/skills/weaver-e10-data/references/config-center.md +6 -7
- package/skills/weaver-e10-data/references/datasource.md +1 -1
- package/skills/weaver-e10-data/references/scene-and-misc.md +2 -2
- package/skills/weaver-e10-jiuchuanhui/SKILL.md +6 -4
- package/skills/weaver-e10-jiuchuanhui/references/clue.md +2 -2
- package/skills/weaver-e10-jiuchuanhui/references/customer.md +18 -8
- package/skills/weaver-e10-jiuchuanhui/references/sale.md +2 -2
- package/skills/weaver-e10-jucailin/references/attend-write.md +1 -1
- package/skills/weaver-e10-mail/SKILL.md +4 -1
- package/skills/weaver-e10-mail/references/mail-read.md +4 -2
- package/skills/weaver-e10-mail/references/safety-boundaries.md +1 -0
- package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
- package/skills/weaver-e10-performance/SKILL.md +8 -6
- package/skills/weaver-e10-recruit-stage/SKILL.md +125 -20
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +359 -0
- package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +87 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +9 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +1 -0
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +177 -0
- package/skills/weaver-e10-shared/SKILL.md +22 -1
- package/skills/weaver-e10-shared/references/e10-auth-and-session.md +2 -2
- package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
|
@@ -50,6 +50,13 @@ async function resolvePureIds(host, ids) {
|
|
|
50
50
|
}
|
|
51
51
|
return map;
|
|
52
52
|
}
|
|
53
|
+
/** pageSize 归一:默认 10,范围 1~200(服务端单页上限 200,超出会被静默截断且不报错)。 */
|
|
54
|
+
function clampPageSize(v) {
|
|
55
|
+
const n = Number(v);
|
|
56
|
+
if (!Number.isFinite(n) || n <= 0)
|
|
57
|
+
return 10;
|
|
58
|
+
return Math.min(200, Math.trunc(n));
|
|
59
|
+
}
|
|
53
60
|
async function handler(args, env) {
|
|
54
61
|
const host = env.host;
|
|
55
62
|
const session = await host.getSession();
|
|
@@ -68,17 +75,60 @@ async function handler(args, env) {
|
|
|
68
75
|
const mobileField = 'field_' + fields.telephone;
|
|
69
76
|
const name = args.name ? String(args.name) : '';
|
|
70
77
|
const mobile = args.mobile ? String(args.mobile) : '';
|
|
78
|
+
const keyword = args.keyword ? String(args.keyword) : '';
|
|
79
|
+
const createdAfter = args.createdAfter ? String(args.createdAfter) : '';
|
|
71
80
|
const conds = {};
|
|
72
81
|
if (name)
|
|
73
82
|
conds[nameField] = [{ [nameField]: name, [nameField + '_condition_type']: 'like' }];
|
|
74
83
|
if (mobile)
|
|
75
84
|
conds[mobileField] = [{ [mobileField]: mobile, [mobileField + '_condition_type']: 'like' }];
|
|
85
|
+
// 🔴 2026-11-27 关键词跨字段搜索(已按 builder 指南修正方法):
|
|
86
|
+
// · `quickSearchFields` 的 key 必须是**列表已配置的快捷搜索字段 id**,不是任意自定义键;
|
|
87
|
+
// 实测传 `{searchKeyword:"投资"}` 完全无效(total=774291 全库),故不用该通道。
|
|
88
|
+
// · 走 `commonSearchFields` + 多字段 + `type:'or'`,字段清单见 KEYWORD_TEXT_FIELDS,
|
|
89
|
+
// 每项都经 `cache.fields[objId]` 校验存在才用(环境没有就跳过,不拼无效 fieldId)。
|
|
90
|
+
// · 操作符按 `getListSearch` 返回的 conditionType 第一项取,**不再一律 like**
|
|
91
|
+
// (guide-list.md §搜索便捷配置明确告诫)。
|
|
92
|
+
// · 关键词与 name/mobile 互斥:有关键词时忽略 name/mobile,跨多字段 or 匹配。
|
|
93
|
+
// · 组合搜索(keyword + tag)不支持同一请求内混用:commonSearchFields 只有一个 type,
|
|
94
|
+
// or/in 不能同存,需分两步搜。
|
|
95
|
+
let searchType = 'and';
|
|
96
|
+
let searchFields;
|
|
97
|
+
let searchNote;
|
|
98
|
+
if (keyword && !name && !mobile) {
|
|
99
|
+
searchType = 'or';
|
|
100
|
+
const meta = await resolveListSearchMeta(host, String(listId));
|
|
101
|
+
const used = [];
|
|
102
|
+
for (const dk of KEYWORD_TEXT_FIELDS) {
|
|
103
|
+
const fid = fields[dk];
|
|
104
|
+
if (!fid)
|
|
105
|
+
continue;
|
|
106
|
+
const bare = String(fid);
|
|
107
|
+
const mk = 'field_' + bare;
|
|
108
|
+
const op = meta.operators[bare] || 'like';
|
|
109
|
+
conds[mk] = [{ [mk]: keyword, [mk + '_condition_type']: op }];
|
|
110
|
+
used.push({ field: dk, label: meta.labels[bare] || dk, operator: op });
|
|
111
|
+
}
|
|
112
|
+
searchFields = used;
|
|
113
|
+
// 🔴 一个字段都没命中时不能静默返回全库:那会让调用方以为"搜到了很多人",
|
|
114
|
+
// 实际是条件为空。显式点名,由调用方决定是否改用 name/mobile 或检查环境字段。
|
|
115
|
+
if (!used.length) {
|
|
116
|
+
searchNote = '关键词搜索未定位到任何可用字段(环境缓存 fields 与目标字段清单无交集),本次未做关键词过滤,返回的是全库分页结果;请改用 name/mobile 精确搜索';
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
// 🔴 2026-11-27 实测修正:`create_time` 是**系统字段**,不在表单 fields 映射里,
|
|
120
|
+
// 服务端 commonSearchFields 对它完全无效——实测单传 createdAfter 时 total=774293(=全库),
|
|
121
|
+
// 与不传时逐字相同;原实现回退拼出的 'field_create_time' 是无效标记,被服务端静默忽略。
|
|
122
|
+
// 这类"条件被吞但不报错"最危险:调用方以为筛过时间,实际拿到全时段数据。
|
|
123
|
+
// 改为**客户端按返回行的 createTime 过滤**,并在有该条件时放大取数量,避免筛后不足。
|
|
124
|
+
const wantPageSize = clampPageSize(args.pageSize);
|
|
125
|
+
const fetchPageSize = createdAfter ? Math.min(200, Math.max(wantPageSize * 5, 50)) : wantPageSize;
|
|
76
126
|
const baseBody = {
|
|
77
127
|
current: Number(args.current || 1),
|
|
78
|
-
pageSize:
|
|
128
|
+
pageSize: fetchPageSize,
|
|
79
129
|
tableuid: randHex32(),
|
|
80
130
|
listId,
|
|
81
|
-
searchParamData: { searchType: '3', commonSearchFields: conds, type:
|
|
131
|
+
searchParamData: { searchType: '3', commonSearchFields: conds, type: searchType },
|
|
82
132
|
terminal: 'PC', browser: 'Chrome',
|
|
83
133
|
requiredMatch: 1, mapResult: 1, recheckQuery: 1,
|
|
84
134
|
isFollow: 0, isShareToMe: 0, filterCondition: {},
|
|
@@ -111,7 +161,14 @@ async function handler(args, env) {
|
|
|
111
161
|
if (item.option_id && item.selection_name)
|
|
112
162
|
dictNameMap[item.option_id] = item.selection_name;
|
|
113
163
|
}
|
|
114
|
-
const out = {
|
|
164
|
+
const out = {
|
|
165
|
+
env: new URL(baseUrl).hostname, total,
|
|
166
|
+
// 🔴 显式回执「本次关键词实际搜了哪些字段、各用什么操作符」:
|
|
167
|
+
// 条件被服务端静默忽略时(total 与全库相同)调用方无从判断,有了这个清单才能自查。
|
|
168
|
+
...(searchFields ? { keyword, searchFields } : {}),
|
|
169
|
+
...(searchNote ? { searchNote } : {}),
|
|
170
|
+
rows: [],
|
|
171
|
+
};
|
|
115
172
|
const outRows = out.rows;
|
|
116
173
|
const inlineNames = rows.map((r) => parsePortalName(r.creator));
|
|
117
174
|
const pureIds = [];
|
|
@@ -137,6 +194,34 @@ async function handler(args, env) {
|
|
|
137
194
|
createTime: r.create_time || null,
|
|
138
195
|
});
|
|
139
196
|
});
|
|
197
|
+
// 🔴 客户端时间过滤:服务端不支持 create_time 条件(实测被静默忽略,见上方注释),
|
|
198
|
+
// 只能在取回的行上按 createTime 筛。
|
|
199
|
+
if (createdAfter) {
|
|
200
|
+
const cutoff = Date.parse(String(createdAfter).replace(/-/g, '/'));
|
|
201
|
+
const fetched = outRows.length;
|
|
202
|
+
if (Number.isNaN(cutoff)) {
|
|
203
|
+
out.timeFilter = {
|
|
204
|
+
createdAfter, mode: 'client', applied: false, fetched, matched: fetched,
|
|
205
|
+
note: 'createdAfter 无法解析为日期(应为 YYYY-MM-DD),本次未做时间过滤,返回的是全时段结果',
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
const kept = outRows.filter((r) => {
|
|
210
|
+
const t = Date.parse(String(r.createTime || '').replace(/-/g, '/'));
|
|
211
|
+
return !Number.isNaN(t) && t >= cutoff;
|
|
212
|
+
});
|
|
213
|
+
out.rows = kept;
|
|
214
|
+
out.returned = kept.length;
|
|
215
|
+
out.timeFilter = {
|
|
216
|
+
createdAfter, mode: 'client', applied: true, fetched, matched: kept.length, fetchPageSize,
|
|
217
|
+
// 🔴 必须显式声明「命中数 ≠ 该时间段全库总数」:客户端只能筛已取回的行,
|
|
218
|
+
// 不写清会让调用方把 matched 当成真实总数,进而误判「半年内只有这么多人」。
|
|
219
|
+
note: kept.length < wantPageSize
|
|
220
|
+
? `服务端不支持按创建时间过滤,已客户端筛选:取回 ${fetched} 行、命中 ${kept.length} 行(少于期望 ${wantPageSize})。命中数不代表该时间段全库总数,可加大 pageSize 或翻页后重查`
|
|
221
|
+
: `服务端不支持按创建时间过滤,已客户端筛选:取回 ${fetched} 行、命中 ${kept.length} 行`,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
}
|
|
140
225
|
return rsSuccess('recruit-stage.candidate.search', out);
|
|
141
226
|
}
|
|
142
227
|
/* ══════════ recruit-stage.candidate.searchByTag —— 按标签搜人才(2026-11-12 新增) ══════════
|
|
@@ -168,11 +253,34 @@ function clampInt(v, min, max, fallback) {
|
|
|
168
253
|
return Math.min(max, Math.max(min, Math.trunc(n)));
|
|
169
254
|
}
|
|
170
255
|
function normTag(s) { return String(s == null ? '' : s).trim().toLowerCase(); }
|
|
171
|
-
/**
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
256
|
+
/** 从 conditionType / conditionTypeValue 里取第一个可用操作符码(形态跨版本不一,逐个兼容)。 */
|
|
257
|
+
function firstConditionType(it) {
|
|
258
|
+
const ct = it?.conditionType ?? it?.conditionTypeValue ?? it?.conditionTypes ?? it?.conditions;
|
|
259
|
+
const pick = (v) => {
|
|
260
|
+
if (typeof v === 'string')
|
|
261
|
+
return v;
|
|
262
|
+
if (v && typeof v === 'object')
|
|
263
|
+
return String(v.value ?? v.key ?? v.code ?? v.conditionType ?? '');
|
|
264
|
+
return '';
|
|
265
|
+
};
|
|
266
|
+
if (Array.isArray(ct)) {
|
|
267
|
+
for (const x of ct) {
|
|
268
|
+
const s = pick(x);
|
|
269
|
+
if (s)
|
|
270
|
+
return s;
|
|
271
|
+
}
|
|
272
|
+
return '';
|
|
273
|
+
}
|
|
274
|
+
return pick(ct);
|
|
275
|
+
}
|
|
276
|
+
async function resolveListSearchMeta(host, listId) {
|
|
277
|
+
const meta = {
|
|
278
|
+
publicKey: FALLBACK_TAG_FIELDS.public,
|
|
279
|
+
privateKey: FALLBACK_TAG_FIELDS.private,
|
|
280
|
+
fromConfig: false,
|
|
281
|
+
operators: {},
|
|
282
|
+
labels: {},
|
|
283
|
+
};
|
|
176
284
|
try {
|
|
177
285
|
const r = await host.request({
|
|
178
286
|
path: '/api/ebuilder/form/listSearch/getListSearch/' + encodeURIComponent(listId),
|
|
@@ -185,21 +293,45 @@ async function resolveTagFields(host, listId) {
|
|
|
185
293
|
continue;
|
|
186
294
|
const raw = String(it.id);
|
|
187
295
|
const key = raw.indexOf('field_') === 0 ? raw : 'field_' + raw;
|
|
188
|
-
const
|
|
296
|
+
const bare = key.slice('field_'.length);
|
|
297
|
+
const label = String(it.label || it.showName || it.fieldName || '');
|
|
298
|
+
if (label)
|
|
299
|
+
meta.labels[bare] = label;
|
|
189
300
|
if (label === '公共标签') {
|
|
190
|
-
publicKey = key;
|
|
191
|
-
fromConfig = true;
|
|
301
|
+
meta.publicKey = key;
|
|
302
|
+
meta.fromConfig = true;
|
|
192
303
|
}
|
|
193
304
|
else if (label === '我的标签') {
|
|
194
|
-
privateKey = key;
|
|
195
|
-
fromConfig = true;
|
|
305
|
+
meta.privateKey = key;
|
|
306
|
+
meta.fromConfig = true;
|
|
196
307
|
}
|
|
308
|
+
const op = firstConditionType(it);
|
|
309
|
+
if (op)
|
|
310
|
+
meta.operators[bare] = op;
|
|
197
311
|
}
|
|
198
312
|
}
|
|
199
313
|
}
|
|
200
|
-
catch { /*
|
|
201
|
-
return
|
|
314
|
+
catch { /* 配置读不到就用兜底:标签走平台常量、操作符走 like;后面负样本仍会校验 */ }
|
|
315
|
+
return meta;
|
|
202
316
|
}
|
|
317
|
+
/**
|
|
318
|
+
* 关键词搜索的目标字段(业务语义清单)。
|
|
319
|
+
* 🔴 每一项都必须经 `cache.fields[objId]` 校验存在才使用——环境没有该字段就跳过,
|
|
320
|
+
* 绝不拼一个无效 fieldId 让服务端静默忽略(那会造成"搜了但没筛"的假成功)。
|
|
321
|
+
* 🔴 实测(2026-11-27 自用环境):BOSS直聘等渠道导入的人才,现职/现公司落在
|
|
322
|
+
* `last_position_id` / `last_company_id`,而 `current_position` / `current_industry` 常为空
|
|
323
|
+
* (后者只在 OCR 解析出 jobInformations[0] 时才写)。两组都搜,否则按职位关键词会大面积漏人。
|
|
324
|
+
*/
|
|
325
|
+
const KEYWORD_TEXT_FIELDS = [
|
|
326
|
+
'candidate_name', // 姓名
|
|
327
|
+
'intend_position', // 期望职位
|
|
328
|
+
'current_position', // 当前职位(OCR 建档才有)
|
|
329
|
+
'last_position_id', // 最近职位(渠道导入常有)
|
|
330
|
+
'current_industry', // 当前公司(OCR 建档才有)
|
|
331
|
+
'last_company_id', // 最近公司(渠道导入常有)
|
|
332
|
+
'college', // 毕业院校
|
|
333
|
+
'self_desc', // 自我评价
|
|
334
|
+
];
|
|
203
335
|
/** 构造标签条件:any = 单条件对象多值(并集);all = 多条件对象(交集) */
|
|
204
336
|
function buildTagCond(ids, keys, mode) {
|
|
205
337
|
const groups = [];
|
|
@@ -284,7 +416,8 @@ async function handlerSearchByTag(args, env) {
|
|
|
284
416
|
via: 'none', total: 0, countFrom: 'local', current, pageSize, rows: [],
|
|
285
417
|
});
|
|
286
418
|
}
|
|
287
|
-
|
|
419
|
+
// 与 candidate.search 共用同一份列表搜索配置解析(标签列 fieldId + 操作符),避免两处实现漂移
|
|
420
|
+
const keys = await resolveListSearchMeta(host, String(listId));
|
|
288
421
|
// getListDatas 的 passid/cid 必须是**台账视图 objId**(listInit.data.objid),不是表单 objId;
|
|
289
422
|
// 两者在某些环境不同,用错会查错台账(forge §19)。失败才回退 context 里的表单 objId。
|
|
290
423
|
let ledgerObjId = String(objId);
|
|
@@ -481,6 +614,8 @@ export const searchOperations = [
|
|
|
481
614
|
inputSchema: schemaOf({
|
|
482
615
|
name: { type: 'string', description: '姓名关键词(like)' },
|
|
483
616
|
mobile: { type: 'string', pattern: '^\\d{6,20}$', description: '手机号(like)' },
|
|
617
|
+
keyword: { type: 'string', description: '跨字段关键词搜索(E10 列表快捷搜索,匹配姓名/职位/公司/院校等)' },
|
|
618
|
+
createdAfter: { type: 'string', description: '创建时间过滤起始日期(YYYY-MM-DD,按 create_time gte 过滤)' },
|
|
484
619
|
pageSize: { type: 'integer', minimum: 1, maximum: 100 },
|
|
485
620
|
current: { type: 'integer', minimum: 1 },
|
|
486
621
|
}, {}),
|
|
@@ -125,12 +125,26 @@ function listOperation() {
|
|
|
125
125
|
if (type === 0)
|
|
126
126
|
body.tagModules = ['recruit'];
|
|
127
127
|
const r = await env.host.request({ path: '/api/my/tag/query', method: 'POST', body });
|
|
128
|
-
const
|
|
129
|
-
|
|
128
|
+
const payload = r?.data;
|
|
129
|
+
const list = payload?.data;
|
|
130
|
+
// 🔴 空结果 ≠ 失败(2026-11-27 修):上游「成功但没有标签」时只回 total=0、不带数组。
|
|
131
|
+
// 实测 {code:200,status:true,fail:false,msg:"接口返回成功",data:{total:0}};
|
|
132
|
+
// 以前一律 throw,导致「任何关键词零命中」都被判成查询失败,标签推荐第一步就断。
|
|
133
|
+
const upstreamFailed = r?.status === false
|
|
134
|
+
|| r?.fail === true
|
|
135
|
+
|| (typeof r?.code === 'number' && r.code !== 200);
|
|
136
|
+
if (upstreamFailed)
|
|
130
137
|
throw rsFail('标签库查询失败:' + (r?.msg || '无返回'), { response: r });
|
|
138
|
+
if (!Array.isArray(list)) {
|
|
139
|
+
const total = Number(payload?.total ?? 0);
|
|
140
|
+
if (Number.isFinite(total) && total > 0) {
|
|
141
|
+
throw rsFail('标签库查询失败:返回结构异常(total=' + total + ' 但没有标签数组)', { response: r });
|
|
142
|
+
}
|
|
143
|
+
return rsSuccess('tag.list', { type: type === 0 ? 'public' : 'personal', total: 0, tags: [] });
|
|
144
|
+
}
|
|
131
145
|
return rsSuccess('tag.list', {
|
|
132
146
|
type: type === 0 ? 'public' : 'personal',
|
|
133
|
-
total: Number(
|
|
147
|
+
total: Number(payload?.total ?? list.length),
|
|
134
148
|
tags: list.map((t) => ({
|
|
135
149
|
tagId: String(t.tagId), name: String(t.name), type: Number(t.type ?? 0),
|
|
136
150
|
color: t.color || '', creator: t.creator || '',
|
|
@@ -465,6 +465,16 @@ export function expectedFields(details, fields, keys, nonEmptyOnly = [], optiona
|
|
|
465
465
|
}
|
|
466
466
|
return out;
|
|
467
467
|
}
|
|
468
|
+
/** 数值归一化比较:字符串不一致时尝试 Number() 比较,消除 "18" vs "18.00" 假 mismatch。 */
|
|
469
|
+
function valuesMatch(expected, actual) {
|
|
470
|
+
if (expected === actual)
|
|
471
|
+
return true;
|
|
472
|
+
const expNum = Number(expected);
|
|
473
|
+
const actNum = Number(actual);
|
|
474
|
+
if (Number.isFinite(expNum) && Number.isFinite(actNum) && expNum === actNum)
|
|
475
|
+
return true;
|
|
476
|
+
return false;
|
|
477
|
+
}
|
|
468
478
|
/**
|
|
469
479
|
* 落库回查(缓存方案 A 第三层门禁):saveFormData 返回 success 不代表字段真的写进去——
|
|
470
480
|
* 后端对不认识的 optionId 会**静默丢弃仍返回成功**(2026-11-06 面试方式为空事故的根因)。
|
|
@@ -505,7 +515,7 @@ export async function verifySubmitted(opts) {
|
|
|
505
515
|
const actual = d
|
|
506
516
|
? String((d.dataOptions || [])[0]?.optionId ?? d.content ?? d.dataText?.content ?? d.value ?? '')
|
|
507
517
|
: '';
|
|
508
|
-
const bad = e.expected === '*' ? !actual :
|
|
518
|
+
const bad = e.expected === '*' ? !actual : !valuesMatch(e.expected, actual);
|
|
509
519
|
if (bad)
|
|
510
520
|
mismatches.push({ label: e.label, expected: e.expected === '*' ? '(非空)' : e.expected, actual: actual || '(空)' });
|
|
511
521
|
}
|
|
@@ -2,6 +2,7 @@ import { readFile } from 'node:fs/promises';
|
|
|
2
2
|
import { join } from 'node:path';
|
|
3
3
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
4
4
|
import { stateRoot } from '../../core/state.js';
|
|
5
|
+
import { MANIFEST_LIST_COMPACT_PATHS, manifestView, schemaOptionsOf } from '../../core/manifest-view.js';
|
|
5
6
|
import { STATE_SUBDIR } from './constants.js';
|
|
6
7
|
import { createSmartExtractContinuationSigner } from './continuation.js';
|
|
7
8
|
import { smartExtractValidationError } from './errors.js';
|
|
@@ -89,8 +90,16 @@ export const smartExtractShortcut = {
|
|
|
89
90
|
.description('E10 智能抽取:fill 一次取齐结构与附件正文,fill.save 校验+落库+回查;其余为排障命令');
|
|
90
91
|
command.command('schema')
|
|
91
92
|
.description('输出 operation 合约(Agent 自查入口)')
|
|
92
|
-
.
|
|
93
|
-
|
|
93
|
+
.option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
|
|
94
|
+
.option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
|
|
95
|
+
.option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
|
|
96
|
+
.action(action((ctx, options) => {
|
|
97
|
+
const schema = schemaOptionsOf(options);
|
|
98
|
+
ctx.output.write(manifestView(smartExtractManifest, schema), {
|
|
99
|
+
json: true,
|
|
100
|
+
// 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
|
|
101
|
+
...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
|
|
102
|
+
});
|
|
94
103
|
}));
|
|
95
104
|
command.command('run')
|
|
96
105
|
.description('按 operation 名执行,例如 smart-extract.form.structure')
|
|
@@ -3,6 +3,7 @@ export const smartExtractOperations = smartExtractOperationDefinitions.map((defi
|
|
|
3
3
|
name: definition.name,
|
|
4
4
|
risk: definition.risk,
|
|
5
5
|
summary: definition.summary,
|
|
6
|
+
...(definition.requiresConfirmation ? { requiresConfirmation: true } : {}),
|
|
6
7
|
inputSchema: definition.inputSchema,
|
|
7
8
|
}));
|
|
8
9
|
export const smartExtractManifest = {
|
|
@@ -48,6 +48,7 @@ function requireSuccessResult(result) {
|
|
|
48
48
|
const savePrepare = {
|
|
49
49
|
name: 'smart-extract.save.prepare',
|
|
50
50
|
risk: 'read-before-write',
|
|
51
|
+
requiresConfirmation: true,
|
|
51
52
|
summary: '组装落库请求并签发确认票据:先按内容指纹与附件键查本地台账(命中返回 duplicate 与已有 aiExtraId,不签票据),再自动生成 requestId(防「写结果未知后重试」双插)。本身不发写请求。',
|
|
52
53
|
inputSchema: schemaOf({
|
|
53
54
|
workflowId: { ...SCHEMA_ID, description: '流程模板 ID(必填,服务端要求)' },
|
|
@@ -256,6 +257,7 @@ async function resolveContinuation(args, stateDir) {
|
|
|
256
257
|
const saveApply = {
|
|
257
258
|
name: 'smart-extract.save.apply',
|
|
258
259
|
risk: 'high-risk-write',
|
|
260
|
+
requiresConfirmation: true,
|
|
259
261
|
summary: '确认后真正写入批次记录:必须 confirm=true 且带 prepare 返回的 ticketFile。发写请求前先按 requestId/内容指纹/附件键三层查重,重复一律返回已有 aiExtraId,不再入库。',
|
|
260
262
|
inputSchema: schemaOf({
|
|
261
263
|
confirm: { type: 'boolean', description: '必须为 true;表示用户已明确确认保存' },
|
|
@@ -7,6 +7,7 @@ import { workflowManifest } from './manifest.js';
|
|
|
7
7
|
import { executeWorkflowOperation } from './operations.js';
|
|
8
8
|
import { workflowValidationError, workflowPolicyError } from './errors.js';
|
|
9
9
|
import { isCapabilityDeniedHere } from '../../core/host-policy.js';
|
|
10
|
+
import { charsOf } from '../../core/output.js';
|
|
10
11
|
import { compactStdoutPaths } from './stdout-compact.js';
|
|
11
12
|
import { join } from 'node:path';
|
|
12
13
|
import { loadRules, resetActiveRules } from './operations/todoSmartConvert/aigroupRules.js';
|
|
@@ -232,6 +233,8 @@ export const workflowShortcut = {
|
|
|
232
233
|
.description('泛微E10流程智能助手(待办/已办/我发起/全部、详情、操作、批量、发起、修改)');
|
|
233
234
|
workflow.command('schema')
|
|
234
235
|
.description('Print workflow operation manifest for agents')
|
|
236
|
+
// `--list` 是本模块的默认行为(默认就输出精简索引),保留声明只为跨域统一。
|
|
237
|
+
.option('--list', '只列操作索引(name/summary/风险),与默认输出一致,全量不截断')
|
|
235
238
|
.option('--operation <name>', 'print one operation with its full inputSchema')
|
|
236
239
|
.option('--full', 'print the whole manifest (about 65 KB; stdout may be trimmed)')
|
|
237
240
|
.action(action((ctx, options) => {
|
|
@@ -241,7 +244,24 @@ export const workflowShortcut = {
|
|
|
241
244
|
throw workflowValidationError('option_conflict', '不能同时传 --operation 和 --full');
|
|
242
245
|
}
|
|
243
246
|
if (opts.full === true) {
|
|
244
|
-
|
|
247
|
+
const full = manifestFull();
|
|
248
|
+
// 装不下时返回**完整清单**(一条不丢),而不是让输出层把 `operations` 切成几条。
|
|
249
|
+
// 2026-11-27 实测:整份 75,961 字符,原本只剩 10/29 条,模型据此以为模块只有 10 个能力。
|
|
250
|
+
// 入参本来就用 `--operation` 单取,所以这里丢了 inputSchema 不影响可用性。
|
|
251
|
+
if (charsOf(full) > ctx.output.budgetChars()) {
|
|
252
|
+
ctx.output.write({
|
|
253
|
+
...manifestIndex(),
|
|
254
|
+
fullOmitted: {
|
|
255
|
+
totalOperations: visibleOperations().length,
|
|
256
|
+
fullChars: charsOf(full),
|
|
257
|
+
hint: '完整 inputSchema 超出 stdout 预算,未随本次返回(否则 operations 会被截成几条,'
|
|
258
|
+
+ '让你误以为模块只有那么多个能力)。取某个操作的完整契约:'
|
|
259
|
+
+ 'weaver-work-cli workflow schema --operation <name>。',
|
|
260
|
+
},
|
|
261
|
+
}, { json: true });
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
ctx.output.write(full, { json: true });
|
|
245
265
|
return;
|
|
246
266
|
}
|
|
247
267
|
if (requested) {
|
|
@@ -3990,7 +3990,7 @@ const workflowSummary = {
|
|
|
3990
3990
|
...schemaOf({
|
|
3991
3991
|
requestId: SCHEMA_REQUEST_ID,
|
|
3992
3992
|
index: SCHEMA_INDEX,
|
|
3993
|
-
group: { type: 'string' },
|
|
3993
|
+
group: { type: 'string', description: '检索索引分组标识(urgent/overdue/batch/pending,plan 场景可能是 specialGroups 的 kind);只给 index 时用来定位是哪一组,取值沿用 workflow.search 返回的 cards[].group' },
|
|
3994
3994
|
summaryFields: { type: 'integer', minimum: 1, default: 12 },
|
|
3995
3995
|
}),
|
|
3996
3996
|
// requestId 与 index 至少给一个:只给 index 时按 group 在本地检索索引中定位(见 resolveTargetRequestId)
|
|
@@ -4870,7 +4870,7 @@ const workflowOpen = {
|
|
|
4870
4870
|
...schemaOf({
|
|
4871
4871
|
requestId: SCHEMA_REQUEST_ID,
|
|
4872
4872
|
index: SCHEMA_INDEX,
|
|
4873
|
-
group: { type: 'string' },
|
|
4873
|
+
group: { type: 'string', description: '检索索引分组标识(urgent/overdue/batch/pending,plan 场景可能是 specialGroups 的 kind);只给 index 时用来定位是哪一组,取值沿用 workflow.search 返回的 cards[].group' },
|
|
4874
4874
|
openMode: { type: 'string', enum: ['auto', 'localBrowser', 'clientAction', 'url'], default: 'auto' },
|
|
4875
4875
|
noOpen: { type: 'boolean', default: false },
|
|
4876
4876
|
}),
|
|
@@ -1186,7 +1186,7 @@ const workflowOperateApply = {
|
|
|
1186
1186
|
// ===========================================================================
|
|
1187
1187
|
const SHARE_INPUT = schemaOf({
|
|
1188
1188
|
requestId: SCHEMA_REQUEST_ID,
|
|
1189
|
-
group: { type: 'string' },
|
|
1189
|
+
group: { type: 'string', description: '检索索引分组标识(urgent/overdue/batch/pending,plan 场景可能是 specialGroups 的 kind);只给 index 时用来定位是哪一组,取值沿用 workflow.search 返回的 cards[].group' },
|
|
1190
1190
|
index: SCHEMA_INDEX,
|
|
1191
1191
|
shareObjects: {
|
|
1192
1192
|
type: 'array',
|
package/docs/caizhilian.md
CHANGED
|
@@ -50,7 +50,7 @@ weaver-work-cli --json caizhilian get --doc-id 1234567890
|
|
|
50
50
|
weaver-work-cli --json caizhilian run caizhilian.folder.query-by-name --input-json '{"folder_name":"财务","kb_type":"company"}'
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
成功和失败都使用 JSON envelope。成功写 stdout;失败写 stderr,并设置非 0
|
|
53
|
+
成功和失败都使用 JSON envelope。成功写 stdout;失败写 stderr,并设置非 0 退出码。失败 envelope 的 `error.details.raw` 携带服务端原始响应体摘要(截断 2 KB),服务端不给错误文案时用它自助排障。
|
|
54
54
|
|
|
55
55
|
当前输出层是完整 JSON 直接写 stdout,不提供 `--jq`、`--format table/ndjson` 或通用 `--page-all`。Agent 使用时应默认小页读取和摘要渲染:文档列表先 `page_size=10`,按 `page_no` 继续;`has_next` 的判定是「本页条数 >= page_size」(服务端 `total` 不可信);回复只展示关键字段和数量,超长响应(正文 HTML、批量结果)落本地文件后给路径。
|
|
56
56
|
|
package/docs/contract.md
CHANGED
|
@@ -102,6 +102,7 @@ weaver-work-cli --json contract run contract.workflow.query --input-json '{"work
|
|
|
102
102
|
## 写操作确认链
|
|
103
103
|
|
|
104
104
|
- 写操作一律 `prepare -> apply`:`prepare` 返回脱敏 `preview` 与 `continuation`(有效期 24 小时),`apply` 必须带 `continuation` 与 `confirm: true`。
|
|
105
|
+
- `prepare` 在签发票据**之前**先按 `apply` 的口径构造一次请求体(纯本地、不发请求):必填字段缺失或格式非法时直接失败,不会出现「空参也拿到一张可执行 continuation」。
|
|
105
106
|
- 提交审批与催办需要与“创建并保存”分开的第二次确认。
|
|
106
107
|
- 提交后回读 `contract.request.status`,`flowStatus.code` 为 1(审批中)或 3(已归档)才算生效。
|
|
107
108
|
- 写请求超时或断线返回 `partial/write_uncertain`(退出码 11),禁止自动重放。
|
package/docs/data.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# 泛微 E10 数据助手(data)
|
|
2
2
|
|
|
3
|
-
`data` 是 E10 问数能力的聚合命令,覆盖 8 个业务域:**DSL 查询(query)**、**数据源(ds)**、**词库(noun)**、**字段值翻译(field)**、**配置中心(conf)**、**场景定位(scene)**、**模块接口调用(module)**、**考勤(attend)**,共 **
|
|
3
|
+
`data` 是 E10 问数能力的聚合命令,覆盖 8 个业务域:**DSL 查询(query)**、**数据源(ds)**、**词库(noun)**、**字段值翻译(field)**、**配置中心(conf)**、**场景定位(scene)**、**模块接口调用(module)**、**考勤(attend)**,共 **28 个只读 operation**。
|
|
4
4
|
|
|
5
5
|
由原独立 CLI `e10-data` 迁移而来。迁移只换了**承载进程**(登录与凭据改由 `weaver-work-cli` 统一托管),业务参数名与输出口径逐字保留,技能里 453 处 `e10-data …` 调用可直接换成 `weaver-work-cli data …`。
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ weaver-work-cli data schema
|
|
|
10
10
|
weaver-work-cli --json data run <operation> --input -
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
`schema` 是能力清单的唯一事实来源:每个 operation 的 `inputSchema`、`command`
|
|
13
|
+
`schema` 是能力清单的唯一事实来源:每个 operation 的 `inputSchema`、`command` 路径,以及当前为空的 `withheldOperations`。未注册的历史名称不再以声明形式保留,而是统一作为 `validation/unknown_operation` 在登录或网络请求前拒绝。
|
|
14
14
|
|
|
15
15
|
## 实现位置
|
|
16
16
|
|
|
@@ -19,8 +19,8 @@ weaver-work-cli --json data run <operation> --input -
|
|
|
19
19
|
| `src/shortcuts/data/index.ts` | 命令树、camelCase→snake_case 参数翻译、两种输出口径 |
|
|
20
20
|
| `src/shortcuts/data/manifest.ts` | `schema` 契约、inputSchema、禁用边界声明 |
|
|
21
21
|
| `src/shortcuts/data/host.ts` | E10 会话桥接、`ebbusinessid` 注入、JSON / form / multipart、退出码映射 |
|
|
22
|
-
| `src/shortcuts/data/errors.ts` | `DataCliError`
|
|
23
|
-
| `src/shortcuts/data/operations/index.ts` |
|
|
22
|
+
| `src/shortcuts/data/errors.ts` | `DataCliError` 与框架标准 `ExitCode` 映射 |
|
|
23
|
+
| `src/shortcuts/data/operations/index.ts` | 28 个 operation 注册表与统一分发 |
|
|
24
24
|
| `src/shortcuts/data/operations/{query,ds,noun,field,conf,scene,module,attend}.ts` | 按业务域拆分的实现 |
|
|
25
25
|
| `src/shortcuts/data/operations/shared.ts` | 雪花 ID 保精度、条件树、stat / order、平台提示扫描、人读渲染 |
|
|
26
26
|
|
|
@@ -55,7 +55,7 @@ weaver-work-cli auth login --base-url <E10 域名>
|
|
|
55
55
|
| 数据源 | `data ds groups / find / describe / tables / fields / fields-dsl / list / chart / stat / count` | `data.ds.*` |
|
|
56
56
|
| 词库 | `data noun list / scope` | `data.noun.*` |
|
|
57
57
|
| 字段 | `data field name2id / options` | `data.field.*` |
|
|
58
|
-
| 配置中心 | `data conf get / batch / batch-file / group / group-file / resolve / resolve-file
|
|
58
|
+
| 配置中心 | `data conf get / batch / batch-file / group / group-file / resolve / resolve-file` | `data.conf.*` |
|
|
59
59
|
| 场景 | `data scene groups / items / search` | `data.scene.*` |
|
|
60
60
|
| 模块接口 | `data module call` | `data.module.call` |
|
|
61
61
|
| 考勤 | `data attend statis` | `data.attend.statis` |
|
|
@@ -81,10 +81,11 @@ weaver-work-cli auth login --base-url <E10 域名>
|
|
|
81
81
|
|
|
82
82
|
### conf:配置中心
|
|
83
83
|
|
|
84
|
-
- `confType` 默认由 `confKey` 前缀推导:`CONN_`→`conn`、`DS_`→`ds`、`WF_`→`wf`、`API_`→`api`;无法推导时报 `conf_type_unknown`(退出码
|
|
84
|
+
- `confType` 默认由 `confKey` 前缀推导:`CONN_`→`conn`、`DS_`→`ds`、`WF_`→`wf`、`API_`→`api`;无法推导时报 `conf_type_unknown`(退出码 2),需显式 `--type`。
|
|
85
85
|
- `confGroup` 只在 `confType=api` 或显式传 `--group` 时下发,避免污染没有分组列的配置类型。
|
|
86
86
|
- 同一 `confKey` 可分布在多个 `confGroup`,内部用 `组|键` 做映射键,避免互相覆盖。
|
|
87
87
|
- 批量接口不可用时**自动降级逐条单查**;`batch-file` 直接跳过批量接口。
|
|
88
|
+
- 配置写入已退休:`data.conf.add`、`data.conf.add-file`、`data.conf.update`、`data.conf.delete` 不存在于 schema/注册表;调用时在任何认证或网络活动前报 `validation/unknown_operation`。
|
|
88
89
|
|
|
89
90
|
### module:配置中心驱动的接口调用
|
|
90
91
|
|
|
@@ -94,7 +95,8 @@ weaver-work-cli auth login --base-url <E10 域名>
|
|
|
94
95
|
- **`body` 必须传对象,不能传已序列化的 JSON 字符串**:运行时会再 `JSON.stringify` 一次,传字符串会发出"被转义的 JSON 字面量",服务端表现为 HTTP 200 + 业务 500/400。form 提交走 `form` 字段。
|
|
95
96
|
- `--fields` 只保留指定行字段,不限制返回行数。
|
|
96
97
|
- **`/api/hrm/` 路径命中黑名单**(退出码 6):人员 / 部门 / 岗位一律走 `weaver-work-cli hrm`。
|
|
97
|
-
-
|
|
98
|
+
- **真实请求只允许名称可明确判定为读取的接口**:名称含写入语义时以 `policy/module_write_interface_blocked` 拒绝;无法验证读取语义时以 `policy/module_read_interface_unverified` 拒绝。`--show-params`、`--dry-run` 不发送业务请求,不受该门禁限制。
|
|
99
|
+
- **`hasSearchRight=false` 是权限受限的终端态**:结果字段必为空,命令以框架 `PolicyError`(退出码 6)结束。不得交付为「无数据」,也不得换参重试。
|
|
98
100
|
|
|
99
101
|
### scene / noun:场景定位与词库
|
|
100
102
|
|
|
@@ -115,14 +117,13 @@ weaver-work-cli auth login --base-url <E10 域名>
|
|
|
115
117
|
| 码 | 含义 | 框架映射 |
|
|
116
118
|
| --- | --- | --- |
|
|
117
119
|
| 0 | 正常(**空结果也算正常**) | — |
|
|
118
|
-
|
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
-
| 8 | 用法错误(缺参、JSON 非法、未知 operation) | `UsageError` |
|
|
120
|
+
| 1 | API / 配置 / 2xx 非 JSON 等通用错误 | `GeneralError` |
|
|
121
|
+
| 2 | 用法错误(缺参、JSON 非法、未知 operation) | `UsageError` |
|
|
122
|
+
| 3 | 未登录 / 凭据失效 | `AuthError` |
|
|
123
|
+
| 4 | HTTP / 网络请求失败 | `NetworkError` |
|
|
124
|
+
| 6 | 权限受限、HRM 黑名单、module 写入或未验证读取接口 | `PolicyError` |
|
|
124
125
|
|
|
125
|
-
|
|
126
|
+
错误类型与退出码统一使用框架 `ExitCode`;调用方应优先依据结构化 `type/subtype` 分流。
|
|
126
127
|
|
|
127
128
|
## 关键陷阱
|
|
128
129
|
|
|
@@ -134,18 +135,17 @@ weaver-work-cli auth login --base-url <E10 域名>
|
|
|
134
135
|
|
|
135
136
|
**并发扇出**:`ds find` / `ds describe` / `conf group-file` 在进程内并发,`--concurrency` 可调(默认 10)。分组失败不中断整体,失败明细在输出的 `errors` 里。
|
|
136
137
|
|
|
137
|
-
##
|
|
138
|
+
## 已退休的历史名称
|
|
138
139
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
| `data.exp.*` | 专家包远端版本管理属 `weaver-work-cli skills repo …` 资源域 |
|
|
140
|
+
`data.doc.count`、`data.doc.list`、`data.field.id2name`、`data.refusal.get`、`data.refusal.rules` 与 `data.exp.*` 均未注册。它们(以及四个已退休的 `data.conf.*` 写命令)必须直接报 `validation/unknown_operation`,不得触发认证、配置读取或网络请求。
|
|
141
|
+
|
|
142
|
+
- 文档查询应按当前 schema 使用 DOCUMENT 配置与受门禁保护的 `data module call`。
|
|
143
|
+
- 选项值映射使用 `data field options`;不提供 `id2name` 探针。
|
|
144
|
+
- 拒答话术及专家包版本管理不属于 data 资源域。
|
|
145
145
|
|
|
146
146
|
## 测试
|
|
147
147
|
|
|
148
|
-
`test/business/data-operations.test.ts` 覆盖:雪花 ID 保精度、BOM
|
|
148
|
+
`test/business/data-operations.test.ts` 覆盖:雪花 ID 保精度、BOM、条件树、平台提示扫描、标准错误契约、confType 推导、28 个 operation 注册表与 manifest 对齐、已退休名称的请求前拒绝,以及 `module.call` 的读取/写入/未知名称/预览门禁。
|
|
149
149
|
|
|
150
150
|
```text
|
|
151
151
|
node --import tsx --test test/business/data-operations.test.ts
|