weaver-work-cli 0.1.70 → 0.1.73
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-THZV4ND4.js} +22 -5
- package/dist/chunks/{archive-oa-VXXO4RTB.js → archive-oa-PQ23OLEV.js} +17 -5
- package/dist/chunks/{asset-45U6TY7I.js → asset-RGPROZYH.js} +22 -5
- package/dist/chunks/{asset-idle-YCRBMTIT.js → asset-idle-Z2PDX7NA.js} +15 -5
- package/dist/chunks/{attachment-content-DMU7KNZ7.js → attachment-content-R3RPVOYE.js} +3 -3
- package/dist/chunks/{blog-5AML4WMG.js → blog-7U3QZPIF.js} +25 -5
- package/dist/chunks/{caizhilian-3P7BUNHT.js → caizhilian-3AB42GCV.js} +22 -8
- package/dist/chunks/{calendar-2HUXM3CZ.js → calendar-KINM64E4.js} +15 -5
- package/dist/chunks/{chunk-EHH363SP.js → chunk-2CHGUYMG.js} +4 -4
- package/dist/chunks/{chunk-GWM5TLIK.js → chunk-2XED2FKY.js} +34 -34
- package/dist/chunks/{chunk-DVFA3ODS.js → chunk-35A56FJ7.js} +12 -0
- package/dist/chunks/{chunk-QYDSTYGG.js → chunk-4BXR6CNB.js} +3 -3
- package/dist/chunks/{chunk-KDOJW5LH.js → chunk-4I26YMBY.js} +1 -1
- package/dist/chunks/{chunk-X6PMJQGO.js → chunk-4YXAK6OA.js} +19 -8
- package/dist/chunks/{chunk-HG6INLH6.js → chunk-54ST55IJ.js} +28 -7
- package/dist/chunks/{chunk-DSBV4GRK.js → chunk-6HT73VOI.js} +3 -3
- package/dist/chunks/{chunk-4W6BSNIL.js → chunk-7QFVXP2X.js} +6 -6
- package/dist/chunks/{chunk-I5XB4MZT.js → chunk-AMAPQVBT.js} +95 -65
- package/dist/chunks/{chunk-L2A3COWV.js → chunk-BWYVS62Z.js} +4 -4
- package/dist/chunks/{chunk-UPVAQJKS.js → chunk-DRUND2PJ.js} +130 -79
- package/dist/chunks/{chunk-LJE7RZNC.js → chunk-F4HM25K4.js} +1 -1
- package/dist/chunks/{chunk-T24EBWAZ.js → chunk-GAMGDNTF.js} +48 -21
- package/dist/chunks/{chunk-H2NRTGZR.js → chunk-GWJLAF6B.js} +3 -3
- package/dist/chunks/{chunk-XIBMZEDB.js → chunk-IBSJJGXL.js} +2 -2
- package/dist/chunks/{chunk-VZUH3LKI.js → chunk-ICP53R52.js} +167 -157
- package/dist/chunks/{chunk-LRKKKO5A.js → chunk-IU6UB2TD.js} +3 -4
- package/dist/chunks/{chunk-GTAFCAVP.js → chunk-IZCQU5D5.js} +1 -1
- package/dist/chunks/{chunk-727VKJQK.js → chunk-JMJBPP4B.js} +2 -2
- package/dist/chunks/{chunk-UVWW5ABZ.js → chunk-L7TYG5SN.js} +3 -3
- package/dist/chunks/{chunk-HAORST2G.js → chunk-LLCMOZ5L.js} +11 -11
- package/dist/chunks/{chunk-U3OO3IZF.js → chunk-NUP4RYZK.js} +20 -7
- package/dist/chunks/{chunk-IVCOZCAW.js → chunk-PAFOLIYQ.js} +1 -1
- package/dist/chunks/{chunk-LSVA7QA6.js → chunk-R3MK2RBN.js} +3 -1
- package/dist/chunks/{chunk-GFOFUH6O.js → chunk-TV46Q4NY.js} +52 -51
- package/dist/chunks/chunk-WM33BSIL.js +136 -0
- package/dist/chunks/{chunk-7CINV2BU.js → chunk-XZBYRYWX.js} +2 -2
- package/dist/chunks/{chunk-E7VWE2XI.js → chunk-ZWLWXHJC.js} +3 -3
- package/dist/chunks/{conflict-YW5BULJ3.js → conflict-VPAR7E6F.js} +2 -2
- package/dist/chunks/{contract-3PMHUASH.js → contract-DDXAO2DZ.js} +48 -5
- package/dist/chunks/{cowork-FZBTTBYX.js → cowork-34QCHMDD.js} +37 -8
- package/dist/chunks/{create-flow-5OBS3B3V.js → create-flow-52PU2OBI.js} +6 -6
- package/dist/chunks/{data-2YZ6A6TL.js → data-CLQ62QGD.js} +99 -184
- package/dist/chunks/{ebuilder-form-AWPTMZBZ.js → ebuilder-form-W5R7Q22S.js} +17 -7
- package/dist/chunks/{ehr-MNPR4TE5.js → ehr-LCNAVMK5.js} +67 -17
- package/dist/chunks/{entry-mode-L65OWPFM.js → entry-mode-6Z3ZV3DE.js} +3 -3
- package/dist/chunks/{env-XW7LYIME.js → env-RDKWAARB.js} +2 -2
- package/dist/chunks/{esb-GSB5QCEX.js → esb-ANKPUU65.js} +17 -7
- package/dist/chunks/{factory-MHFZZAGH.js → factory-434B7RAT.js} +1 -1
- package/dist/chunks/{fna-XBSNUS2V.js → fna-AKBSG5HI.js} +15 -5
- package/dist/chunks/{group-chat-EEOLO5NM.js → group-chat-PROTW22R.js} +3 -3
- package/dist/chunks/{host-NVDG3NC6.js → host-5R2SNFWD.js} +4 -4
- package/dist/chunks/{host-2UMNXX5H.js → host-7FJW4E7R.js} +4 -4
- package/dist/chunks/{host-XVWBOSEN.js → host-CGXUFQO4.js} +4 -4
- package/dist/chunks/{host-R7BP3CTI.js → host-PDJAKCT7.js} +6 -4
- package/dist/chunks/{host-SYPCA63D.js → host-WO4L5G5I.js} +4 -4
- package/dist/chunks/{host-BD44ASOD.js → host-XIYG4F4B.js} +4 -4
- package/dist/chunks/{hrm-FZUDJAND.js → hrm-WGODDTEH.js} +15 -6
- package/dist/chunks/{im-F5NENPD7.js → im-YKTKAJU3.js} +16 -6
- package/dist/chunks/{invoice-DS6FLU55.js → invoice-PVYCCCVM.js} +27 -6
- package/dist/chunks/{jiuchuanhui-JCBUR563.js → jiuchuanhui-RKOQW7BY.js} +19 -6
- package/dist/chunks/{lazy-dispatch-F6O2EPGR.js → lazy-dispatch-DW45AFQ5.js} +6 -6
- package/dist/chunks/{mail-ZEOSANEJ.js → mail-BNB5S4NW.js} +116 -97
- package/dist/chunks/{meeting-PCD5EPBF.js → meeting-O2KDJH66.js} +29 -16
- package/dist/chunks/{minute-doc-WTZJVCHG.js → minute-doc-JUCG56GY.js} +4 -4
- package/dist/chunks/{okr-OZUMTMCL.js → okr-LWFGWOE7.js} +15 -5
- package/dist/chunks/{operations-LQY3FTPH.js → operations-2WHIF5WV.js} +1 -1
- package/dist/chunks/{operations-UTUWFJTX.js → operations-532PN5OB.js} +5 -5
- package/dist/chunks/{performance-SMVTPK6T.js → performance-7W5COCFU.js} +92 -7
- package/dist/chunks/{plan-C2NENH42.js → plan-ZVY3IYTL.js} +15 -5
- package/dist/chunks/{project-FAJ2P3UR.js → project-SA62B7MH.js} +18 -5
- package/dist/chunks/{reception-NH6MJFPR.js → reception-NGIONPQ3.js} +128 -49
- package/dist/chunks/{recruit-stage-DPEFHLSE.js → recruit-stage-WOSN6MGP.js} +1264 -197
- package/dist/chunks/{registry-FTPUUHWC.js → registry-N7P3W2RD.js} +5 -5
- package/dist/chunks/{registry-3B3OAJYX.js → registry-R72GWXOG.js} +4 -4
- package/dist/chunks/{registry-ZQ7OONCB.js → registry-RIQ67ZT7.js} +12 -12
- package/dist/chunks/{room-recommend-73NBN3RU.js → room-recommend-KCGIVUFR.js} +4 -4
- package/dist/chunks/{schedule-SDBOBBUQ.js → schedule-6UP27HQ4.js} +4 -4
- package/dist/chunks/{smart-extract-GTYKF5TJ.js → smart-extract-DDOQSPRB.js} +19 -6
- package/dist/chunks/{workflow-OWHWLAOX.js → workflow-V5ALD6QZ.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 +42 -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/ehr/operations/recruit-position.js +4 -3
- package/dist/shortcuts/ehr/operations/recruit-short-cache.js +6 -2
- package/dist/shortcuts/ehr/operations/recruit-write.js +3 -3
- package/dist/shortcuts/ehr/operations/recruit.js +206 -82
- package/dist/shortcuts/ehr/operations/shared.js +31 -0
- 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/constants.js +22 -0
- package/dist/shortcuts/reception/index.js +15 -2
- package/dist/shortcuts/reception/manifest.js +17 -3
- package/dist/shortcuts/reception/operations/ask.js +3 -0
- package/dist/shortcuts/reception/operations/doc.js +24 -11
- package/dist/shortcuts/reception/operations/docrender.js +18 -1
- package/dist/shortcuts/reception/operations/render-assets.js +93 -22
- package/dist/shortcuts/recruit-stage/context.js +12 -6
- package/dist/shortcuts/recruit-stage/index.js +22 -3
- package/dist/shortcuts/recruit-stage/manifest.js +2 -0
- package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +19 -10
- package/dist/shortcuts/recruit-stage/operations/jd-create.js +487 -38
- package/dist/shortcuts/recruit-stage/operations/list.js +72 -1
- package/dist/shortcuts/recruit-stage/operations/profile.js +194 -0
- package/dist/shortcuts/recruit-stage/operations/registry.js +20 -2
- package/dist/shortcuts/recruit-stage/operations/resume-import.js +258 -63
- package/dist/shortcuts/recruit-stage/operations/search.js +226 -27
- package/dist/shortcuts/recruit-stage/operations/shortlist.js +122 -0
- package/dist/shortcuts/recruit-stage/operations/tag.js +17 -3
- package/dist/shortcuts/recruit-stage/shared.js +158 -4
- 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/form.js +36 -2
- 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/SKILL.md +7 -3
- package/skills/weaver-e10-jucailin/references/attend-write.md +1 -1
- package/skills/weaver-e10-jucailin/references/recruit-output-links.md +33 -0
- package/skills/weaver-e10-jucailin/references/recruit-write.md +2 -0
- 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-reception-flow/SKILL.md +97 -41
- package/skills/weaver-e10-reception-flow/references/guide.md +3 -1
- package/skills/weaver-e10-recruit-stage/SKILL.md +557 -75
- package/skills/weaver-e10-recruit-stage/agents/openai.yaml +67 -44
- package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +279 -0
- package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +198 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +697 -0
- package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +507 -0
- package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +87 -0
- package/skills/weaver-e10-recruit-stage/references/position-templates.md +19 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +19 -18
- package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +1 -1
- package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +15 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +37 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +64 -28
- package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +43 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +41 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +25 -7
- package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +51 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +63 -0
- package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +58 -33
- package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +4 -4
- package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +5 -5
- package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +11 -10
- package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +2 -2
- package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
- package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +106 -0
- package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +325 -0
- package/skills/weaver-e10-recruit-stage/templates/match-report.html +265 -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
- package/skills/weaver-e10-jucailin/references/source-manifest.json +0 -152
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CONTINUATION_TTL_MS } from '../../../core/continuation-ttl.js';
|
|
2
2
|
import { randomBytes } from 'node:crypto';
|
|
3
|
-
import { mailValidationError } from '../errors.js';
|
|
3
|
+
import { mailRestrictedError, mailUpstreamError, mailValidationError } from '../errors.js';
|
|
4
4
|
import { WRITE, mailSuccess, schemaOf, SCHEMA_STRING } from './types.js';
|
|
5
5
|
function b64(s) {
|
|
6
6
|
return Buffer.from(s, 'utf8').toString('base64');
|
|
@@ -41,7 +41,7 @@ async function mailAdd(env, flag, mailResourceId) {
|
|
|
41
41
|
}));
|
|
42
42
|
const d = value?.data || {};
|
|
43
43
|
if (!d.sessionUuid)
|
|
44
|
-
throw
|
|
44
|
+
throw mailUpstreamError('mail_add_contract', 'mailAdd 未返回 sessionUuid:' + JSON.stringify(value).slice(0, 300));
|
|
45
45
|
return d;
|
|
46
46
|
}
|
|
47
47
|
async function searchInternal(env, keyword) {
|
|
@@ -90,7 +90,7 @@ async function resolveInternal(env, names) {
|
|
|
90
90
|
else if (list.length > 1)
|
|
91
91
|
pending.push({ keyword: n, reason: '多候选(无精确匹配)', candidates: list.slice(0, 5).map(cand) });
|
|
92
92
|
else
|
|
93
|
-
throw
|
|
93
|
+
throw mailValidationError('recipient_person_not_found', '未找到内部人员:' + n + '(可尝试姓名/工号;若是部门请用 to-dep/cc-dep/bcc-dep 指定)');
|
|
94
94
|
}
|
|
95
95
|
if (pending.length)
|
|
96
96
|
throw new CandidateError(pending);
|
|
@@ -191,7 +191,7 @@ async function resolveDepartment(env, names) {
|
|
|
191
191
|
pending.push({ keyword: n, reason: '同名部门(请在结果中选择)', candidates: matches.map((x) => ({ id: x.id, name: x.name, type: '部门' })) });
|
|
192
192
|
}
|
|
193
193
|
else {
|
|
194
|
-
throw
|
|
194
|
+
throw mailValidationError('department_not_found', '未找到部门:' + n + '(请确认部门名称,或用 to 指定人员)');
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
if (pending.length)
|
|
@@ -208,7 +208,7 @@ async function resolveExternal(env, emails) {
|
|
|
208
208
|
const list = await searchExternal(env, e);
|
|
209
209
|
const hit = list.find((x) => x.mailAddress?.includes(e)) || list[0];
|
|
210
210
|
if (!hit)
|
|
211
|
-
throw
|
|
211
|
+
throw mailValidationError('external_address_not_found', '未找到外部邮箱:' + e + '(可尝试完整邮箱地址)');
|
|
212
212
|
out.push({ mailAddress: hit.mailAddress, mailNickName: hit.mailNickName });
|
|
213
213
|
}
|
|
214
214
|
return out;
|
|
@@ -249,10 +249,10 @@ async function parseRecipients(env, add, args) {
|
|
|
249
249
|
const hasEmail = all.some(looksLikeEmail);
|
|
250
250
|
const hasName = all.some((x) => !looksLikeEmail(x));
|
|
251
251
|
if (hasEmail && hasName) {
|
|
252
|
-
throw
|
|
252
|
+
throw mailValidationError('recipient_mixed', '收件人内外部混用:邮箱地址=外部邮件、姓名=内部邮件,请统一,或用 --internal/--external 明确邮件类型');
|
|
253
253
|
}
|
|
254
254
|
if (!all.length)
|
|
255
|
-
throw
|
|
255
|
+
throw mailValidationError('recipient_required', '请先说明收件人(姓名=内部邮件 / 邮箱地址=外部邮件 / 部门用 to-dep)');
|
|
256
256
|
kind = hasEmail ? 'external' : 'internal';
|
|
257
257
|
}
|
|
258
258
|
}
|
|
@@ -298,7 +298,7 @@ async function parseRecipients(env, add, args) {
|
|
|
298
298
|
const names = (arr) => arr.map((x) => x.mailNickName || x.mailAddress).join('、');
|
|
299
299
|
const from = (add.sendFrom_outer || []).find((x) => x.selected) || (add.sendFrom_outer || [])[0];
|
|
300
300
|
if (!from || !from.mailAddress) {
|
|
301
|
-
throw
|
|
301
|
+
throw mailRestrictedError('outer_account_unbound', '当前账号未配置外部邮箱发件账号(mailAdd.sendFrom_outer 为空),无法发送外部邮件;请先在邮件设置中绑定外部邮箱账号');
|
|
302
302
|
}
|
|
303
303
|
const totalCount = [...rawTo, ...rawCc, ...rawBcc].length;
|
|
304
304
|
return {
|
|
@@ -326,23 +326,23 @@ async function checkMailConfig(env, isInternal) {
|
|
|
326
326
|
const sys = value?.data?.sysConfig || {};
|
|
327
327
|
if (isInternal === 1) {
|
|
328
328
|
if (sys.innerMail !== undefined && Number(sys.innerMail) !== 1) {
|
|
329
|
-
throw
|
|
329
|
+
throw mailRestrictedError('internal_mail_disabled', '当前环境未启用内部邮件(getEmailAllConfig.sysConfig.innerMail=' + sys.innerMail + '),无法发送内部邮件');
|
|
330
330
|
}
|
|
331
331
|
}
|
|
332
332
|
else {
|
|
333
333
|
if (sys.outterMail !== undefined && Number(sys.outterMail) !== 1) {
|
|
334
|
-
throw
|
|
334
|
+
throw mailRestrictedError('outer_mail_disabled', '当前环境未启用外部邮件(getEmailAllConfig.outterMail=0),无法发送外部邮件');
|
|
335
335
|
}
|
|
336
336
|
}
|
|
337
337
|
if (sys.innerMail !== undefined && sys.outterMail !== undefined && Number(sys.innerMail) !== 1 && Number(sys.outterMail) !== 1) {
|
|
338
|
-
throw
|
|
338
|
+
throw mailRestrictedError('mail_disabled', '系统未启用邮件功能(内部/外部邮件均未开启),无法发送邮件');
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
341
|
async function precheckSend(env, body) {
|
|
342
342
|
const c = (await env.host.request({ path: '/api/mail/send/canSendMail', method: 'POST', body }));
|
|
343
343
|
const cdata = c?.data || {};
|
|
344
344
|
if (cdata.success !== undefined && cdata.success !== 1) {
|
|
345
|
-
throw
|
|
345
|
+
throw mailRestrictedError('send_blocked', '发送前校验未通过:' + (cdata.msg || '未知拦截(canSendMail)'));
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
348
|
async function buildBody(env, add, args, draft) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CONTINUATION_TTL_MS } from '../../../core/continuation-ttl.js';
|
|
2
|
-
import { mailValidationError } from '../errors.js';
|
|
2
|
+
import { mailConfirmationError, mailValidationError } from '../errors.js';
|
|
3
3
|
import { READ, WRITE, mailSuccess, schemaOf, SCHEMA_STRING } from './types.js';
|
|
4
4
|
const SIGN_SCHEMA = schemaOf({
|
|
5
5
|
id: SCHEMA_STRING,
|
|
@@ -16,9 +16,9 @@ function buildSignBody(args) {
|
|
|
16
16
|
const signName = String(args.signName || '').trim();
|
|
17
17
|
const clobContent = String(args.clobContent || '').trim();
|
|
18
18
|
if (!signName)
|
|
19
|
-
throw
|
|
19
|
+
throw mailValidationError('sign_name_required', 'signName(签名名称)必填');
|
|
20
20
|
if (!clobContent)
|
|
21
|
-
throw
|
|
21
|
+
throw mailValidationError('content_required', 'clobContent(Base64 编码的 HTML 内容)必填');
|
|
22
22
|
const body = {
|
|
23
23
|
signName,
|
|
24
24
|
clobContent,
|
|
@@ -68,9 +68,9 @@ const opSignSaveApply = {
|
|
|
68
68
|
inputSchema: SIGN_SCHEMA,
|
|
69
69
|
async handler(args, env) {
|
|
70
70
|
if (args.confirm !== true)
|
|
71
|
-
throw
|
|
71
|
+
throw mailConfirmationError('mail.sign.save.apply');
|
|
72
72
|
if (!args.continuation)
|
|
73
|
-
throw
|
|
73
|
+
throw mailValidationError('continuation_required', 'mail.sign.save.apply 需要 prepare 返回的 continuation');
|
|
74
74
|
const lease = await env.continuation.verify(String(args.continuation), 'mail.sign.save.apply');
|
|
75
75
|
const session = await env.host.getSession();
|
|
76
76
|
if (lease.baseUrl !== session.baseUrl || lease.profile !== session.profile || lease.userId !== session.userId) {
|
|
@@ -99,7 +99,7 @@ const opSignUpdate = {
|
|
|
99
99
|
async handler(args, env) {
|
|
100
100
|
const id = String(args.id || '').trim();
|
|
101
101
|
if (!id)
|
|
102
|
-
throw
|
|
102
|
+
throw mailValidationError('id_required', 'id(签名 id)必填');
|
|
103
103
|
const form = (await env.host.request({ path: '/api/mail/base/setting/sign/getMailSignForm', method: 'POST', body: { id } }));
|
|
104
104
|
const cur = form?.data?.formData || {};
|
|
105
105
|
const body = {
|
|
@@ -112,9 +112,9 @@ const opSignUpdate = {
|
|
|
112
112
|
electronSignEnable: args.electronSignEnable !== undefined ? Number(args.electronSignEnable) : (cur.electronSignEnable ?? 0),
|
|
113
113
|
};
|
|
114
114
|
if (!body.signName)
|
|
115
|
-
throw
|
|
115
|
+
throw mailValidationError('sign_name_empty', '签名名称为空(原值缺失且未提供 signName)');
|
|
116
116
|
if (!body.clobContent)
|
|
117
|
-
throw
|
|
117
|
+
throw mailValidationError('content_empty', '签名内容为空(原值缺失且未提供 clobContent)');
|
|
118
118
|
const value = (await env.host.request({ path: '/api/mail/base/setting/sign/updateMailSign', method: 'POST', body }));
|
|
119
119
|
return mailSuccess('mail.sign.update', value?.data ?? 'SUCCESS', { id });
|
|
120
120
|
},
|
|
@@ -130,7 +130,7 @@ const opSignDelete = {
|
|
|
130
130
|
async handler(args, env) {
|
|
131
131
|
const id = String(args.id || '').trim();
|
|
132
132
|
if (!id)
|
|
133
|
-
throw
|
|
133
|
+
throw mailValidationError('id_required', 'id(签名 id)必填');
|
|
134
134
|
const value = (await env.host.request({ path: '/api/mail/base/setting/sign/deleteMailSign', method: 'POST', body: { id } }));
|
|
135
135
|
return mailSuccess('mail.sign.delete', value?.data ?? 'SUCCESS', { id });
|
|
136
136
|
},
|
|
@@ -146,7 +146,7 @@ const opSignDefault = {
|
|
|
146
146
|
async handler(args, env) {
|
|
147
147
|
const id = String(args.id || '').trim();
|
|
148
148
|
if (!id)
|
|
149
|
-
throw
|
|
149
|
+
throw mailValidationError('id_required', 'id(签名 id)必填');
|
|
150
150
|
const value = (await env.host.request({ path: '/api/mail/base/setting/sign/defaultMailSign', method: 'POST', body: { id } }));
|
|
151
151
|
return mailSuccess('mail.sign.default', value?.data ?? 'SUCCESS', { id });
|
|
152
152
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CONTINUATION_TTL_MS } from '../../../core/continuation-ttl.js';
|
|
2
|
-
import { mailValidationError } from '../errors.js';
|
|
2
|
+
import { mailConfirmationError, mailValidationError } from '../errors.js';
|
|
3
3
|
import { WRITE, mailSuccess, schemaOf, SCHEMA_STRING } from './types.js';
|
|
4
4
|
const TEMPLATE_SCHEMA = schemaOf({
|
|
5
5
|
id: SCHEMA_STRING,
|
|
@@ -17,9 +17,9 @@ function buildTemplateBody(args) {
|
|
|
17
17
|
const subject = String(args.subject || '').trim();
|
|
18
18
|
const clobContent = String(args.clobContent || '').trim();
|
|
19
19
|
if (!subject)
|
|
20
|
-
throw
|
|
20
|
+
throw mailValidationError('subject_required', 'subject(模板主题)必填');
|
|
21
21
|
if (!clobContent)
|
|
22
|
-
throw
|
|
22
|
+
throw mailValidationError('content_required', 'clobContent(Base64 编码的 HTML 内容)必填');
|
|
23
23
|
const body = {
|
|
24
24
|
templateType: args.templateType ? String(args.templateType) : 'personal',
|
|
25
25
|
subject,
|
|
@@ -73,9 +73,9 @@ const opTemplateSaveApply = {
|
|
|
73
73
|
inputSchema: TEMPLATE_SCHEMA,
|
|
74
74
|
async handler(args, env) {
|
|
75
75
|
if (args.confirm !== true)
|
|
76
|
-
throw
|
|
76
|
+
throw mailConfirmationError('mail.template.save.apply');
|
|
77
77
|
if (!args.continuation)
|
|
78
|
-
throw
|
|
78
|
+
throw mailValidationError('continuation_required', 'mail.template.save.apply 需要 prepare 返回的 continuation');
|
|
79
79
|
const lease = await env.continuation.verify(String(args.continuation), 'mail.template.save.apply');
|
|
80
80
|
const session = await env.host.getSession();
|
|
81
81
|
if (lease.baseUrl !== session.baseUrl || lease.profile !== session.profile || lease.userId !== session.userId) {
|
|
@@ -103,7 +103,7 @@ const opTemplateUpdate = {
|
|
|
103
103
|
async handler(args, env) {
|
|
104
104
|
const id = String(args.id || '').trim();
|
|
105
105
|
if (!id)
|
|
106
|
-
throw
|
|
106
|
+
throw mailValidationError('id_required', 'id(模板 id)必填');
|
|
107
107
|
const info = (await env.host.request({
|
|
108
108
|
path: '/api/mail/base/setting/template/getMailTemplateInfo',
|
|
109
109
|
method: 'POST',
|
|
@@ -122,9 +122,9 @@ const opTemplateUpdate = {
|
|
|
122
122
|
templateFile: cur.templateFile ?? [],
|
|
123
123
|
};
|
|
124
124
|
if (!body.subject)
|
|
125
|
-
throw
|
|
125
|
+
throw mailValidationError('subject_empty', '模板主题为空(原值缺失且未提供 subject)');
|
|
126
126
|
if (!body.clobContent)
|
|
127
|
-
throw
|
|
127
|
+
throw mailValidationError('content_empty', '模板内容为空(原值缺失且未提供 clobContent)');
|
|
128
128
|
const value = (await env.host.request({ path: '/api/mail/base/setting/template/updateMailTemplate', method: 'POST', body }));
|
|
129
129
|
return mailSuccess('mail.template.update', value?.data ?? 'SUCCESS', { id });
|
|
130
130
|
},
|
|
@@ -140,7 +140,7 @@ const opTemplateDelete = {
|
|
|
140
140
|
async handler(args, env) {
|
|
141
141
|
const id = String(args.id || '').trim();
|
|
142
142
|
if (!id)
|
|
143
|
-
throw
|
|
143
|
+
throw mailValidationError('id_required', 'id(模板 id)必填');
|
|
144
144
|
const value = (await env.host.request({ path: '/api/mail/base/setting/template/deleteMailTemplate', method: 'POST', body: { id } }));
|
|
145
145
|
return mailSuccess('mail.template.delete', value?.data ?? 'SUCCESS', { id });
|
|
146
146
|
},
|
|
@@ -156,7 +156,7 @@ const opTemplateDefault = {
|
|
|
156
156
|
async handler(args, env) {
|
|
157
157
|
const id = String(args.id || '').trim();
|
|
158
158
|
if (!id)
|
|
159
|
-
throw
|
|
159
|
+
throw mailValidationError('id_required', 'id(模板 id)必填');
|
|
160
160
|
const value = (await env.host.request({ path: '/api/mail/base/setting/template/defaultMailTemplate', method: 'POST', body: { id } }));
|
|
161
161
|
return mailSuccess('mail.template.default', value?.data ?? 'SUCCESS', { id });
|
|
162
162
|
},
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
3
|
import { reportPlatformError } from '../../core/error-codes.js';
|
|
4
|
+
import { MANIFEST_LIST_COMPACT_PATHS, manifestView, schemaOptionsOf } from '../../core/manifest-view.js';
|
|
4
5
|
import { createMeetingContinuationSigner } from './continuation.js';
|
|
5
6
|
import { createMeetingHost } from './host.js';
|
|
6
7
|
import { meetingManifest, OPERATION_INDEX_HINT } from './manifest.js';
|
|
@@ -101,8 +102,16 @@ export const meetingShortcut = {
|
|
|
101
102
|
const meeting = program.command('meeting').description('泛微E10会议管理(模式探测/会议列表/会议室/类型/冲突检测/预约/回执/签到)');
|
|
102
103
|
meeting.command('schema')
|
|
103
104
|
.description('Print meeting operation manifest for agents')
|
|
104
|
-
.
|
|
105
|
-
|
|
105
|
+
.option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
|
|
106
|
+
.option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
|
|
107
|
+
.option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
|
|
108
|
+
.action(action((ctx, options) => {
|
|
109
|
+
const schema = schemaOptionsOf(options);
|
|
110
|
+
ctx.output.write(manifestView(meetingManifest, schema), {
|
|
111
|
+
json: true,
|
|
112
|
+
// 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
|
|
113
|
+
...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
|
|
114
|
+
});
|
|
106
115
|
}));
|
|
107
116
|
// 能力清单:**纯文本、不压缩**。
|
|
108
117
|
// 为什么必须单独开一条命令:`meeting schema --json` 完整 308KB,stdout 只回 20KB 预览,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
3
|
import { reportPlatformError } from '../../core/error-codes.js';
|
|
4
|
+
import { MANIFEST_LIST_COMPACT_PATHS, manifestView, schemaOptionsOf } from '../../core/manifest-view.js';
|
|
4
5
|
import { createOkrContinuationSigner } from './continuation.js';
|
|
5
6
|
import { okrValidationError } from './errors.js';
|
|
6
7
|
import { createOkrHost } from './host.js';
|
|
@@ -97,8 +98,16 @@ export const okrShortcut = {
|
|
|
97
98
|
const okr = program.command('okr').description('泛微E10 OKR 目标管理(目标列表/详情/新建/编辑、关键成果、目标对齐、评论、链路判定)');
|
|
98
99
|
okr.command('schema')
|
|
99
100
|
.description('Print okr operation manifest for agents')
|
|
100
|
-
.
|
|
101
|
-
|
|
101
|
+
.option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
|
|
102
|
+
.option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
|
|
103
|
+
.option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
|
|
104
|
+
.action(action((ctx, options) => {
|
|
105
|
+
const schema = schemaOptionsOf(options);
|
|
106
|
+
ctx.output.write(manifestView(okrManifest, schema), {
|
|
107
|
+
json: true,
|
|
108
|
+
// 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
|
|
109
|
+
...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
|
|
110
|
+
});
|
|
102
111
|
}));
|
|
103
112
|
okr.command('run')
|
|
104
113
|
.description('Run an okr operation with JSON input')
|
|
@@ -86,6 +86,47 @@ async function executeAndPrint(ctx, operation, input) {
|
|
|
86
86
|
process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* schema 索引:只列 operation 与必需字段名,避免整份 manifest(约 129 KB)被输出预算截成预览。
|
|
91
|
+
* 字段类型/枚举/示例用 `--operation` 单取,整份清单用 `--full`。
|
|
92
|
+
*/
|
|
93
|
+
function performanceManifestIndex() {
|
|
94
|
+
return {
|
|
95
|
+
schemaVersion: performanceManifest.schemaVersion,
|
|
96
|
+
name: performanceManifest.name,
|
|
97
|
+
title: performanceManifest.title,
|
|
98
|
+
version: performanceManifest.version,
|
|
99
|
+
host: performanceManifest.host,
|
|
100
|
+
status: performanceManifest.status,
|
|
101
|
+
sourceSkill: performanceManifest.sourceSkill,
|
|
102
|
+
capabilities: performanceManifest.capabilities,
|
|
103
|
+
operationCount: performanceManifest.operations.length,
|
|
104
|
+
operations: performanceManifest.operations.map((operation) => {
|
|
105
|
+
const schema = operation.inputSchema;
|
|
106
|
+
return {
|
|
107
|
+
name: operation.name,
|
|
108
|
+
resource: operation.resource,
|
|
109
|
+
summary: operation.summary,
|
|
110
|
+
...(operation.capability ? { capability: operation.capability } : {}),
|
|
111
|
+
risk: operation.risk,
|
|
112
|
+
...(operation.requiresConfirmation ? { requiresConfirmation: true } : {}),
|
|
113
|
+
required: schema.required ?? [],
|
|
114
|
+
propertyCount: Object.keys(schema.properties ?? {}).length,
|
|
115
|
+
};
|
|
116
|
+
}),
|
|
117
|
+
withheldOperations: performanceManifest.withheldOperations,
|
|
118
|
+
operationsHint: '默认只列 operation 与必需字段;字段类型/枚举/示例用 `performance schema --operation <name>` 单取,整份 manifest 用 `performance schema --full`(约 129 KB,超预算会落 ref)。',
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/** `--operation` 单取:允许省略 `performance.` 前缀。未命中报参数错误(exit 2),不返回空对象。 */
|
|
122
|
+
function findPerformanceOperationContract(name) {
|
|
123
|
+
const full = name.startsWith('performance.') ? name : `performance.${name}`;
|
|
124
|
+
const matched = performanceManifest.operations.find((operation) => operation.name === full);
|
|
125
|
+
if (!matched) {
|
|
126
|
+
throw pfValidationError('operation_unknown', `绩效模块不支持操作:${name}。可用操作见 performance schema 索引`);
|
|
127
|
+
}
|
|
128
|
+
return matched;
|
|
129
|
+
}
|
|
89
130
|
export const performanceShortcut = {
|
|
90
131
|
name: 'performance',
|
|
91
132
|
description: '泛微E10绩效方案(文档导入 → 草稿 → 确认发布)CLI',
|
|
@@ -93,9 +134,27 @@ export const performanceShortcut = {
|
|
|
93
134
|
register({ program, action }) {
|
|
94
135
|
const pf = program.command('performance').description('泛微E10绩效方案(实体解析/落草稿/回读核对/确认发布)');
|
|
95
136
|
pf.command('schema')
|
|
96
|
-
.description('Print performance operation
|
|
97
|
-
|
|
98
|
-
|
|
137
|
+
.description('Print performance operation index for agents')
|
|
138
|
+
// `--list` 是本模块的默认行为(默认就输出精简索引),这里保留声明只为跨域统一:
|
|
139
|
+
// 其余业务域统一用 `schema --list` 拿全量清单,模型不必为 performance 记一个例外。
|
|
140
|
+
.option('--list', '只列操作索引(name/summary/risk),与默认输出一致,全量不截断')
|
|
141
|
+
.option('--operation <name>', 'print one operation with its full inputSchema')
|
|
142
|
+
.option('--full', 'print the whole manifest (about 129 KB; stdout may be trimmed to a ref)')
|
|
143
|
+
.action(action((ctx, options) => {
|
|
144
|
+
const opts = asOptions(options);
|
|
145
|
+
const requested = String(opts.operation ?? '').trim();
|
|
146
|
+
if (requested && opts.full === true) {
|
|
147
|
+
throw pfValidationError('option_conflict', '不能同时传 --operation 和 --full');
|
|
148
|
+
}
|
|
149
|
+
if (opts.full === true) {
|
|
150
|
+
ctx.output.write(performanceManifest, { json: true });
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (requested) {
|
|
154
|
+
ctx.output.write(findPerformanceOperationContract(requested), { json: true });
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
ctx.output.write(performanceManifestIndex(), { json: true });
|
|
99
158
|
}));
|
|
100
159
|
pf.command('run')
|
|
101
160
|
.description('Run a performance operation with JSON input')
|
|
@@ -113,6 +113,13 @@ export function validateScheme(req) {
|
|
|
113
113
|
if (req.includeInterviewItem === true && (!Array.isArray(req.interviewStepList) || req.interviewStepList.length === 0)) {
|
|
114
114
|
issues.push({ level: 'error', message: 'includeInterviewItem=true 时 interviewStepList 至少一个节点' });
|
|
115
115
|
}
|
|
116
|
+
// 提醒配置成对约束:服务端 saveSchemeRemindSetting 对两个列表是「任一为空即整块 return」,
|
|
117
|
+
// 只填一个不会报错,但自定义提醒会静默不生效(SchemeServiceImpl:446-449)。
|
|
118
|
+
const hasRemindOrdinary = Array.isArray(req.remindOrdinaryData) && req.remindOrdinaryData.length > 0;
|
|
119
|
+
const hasRemindTime = Array.isArray(req.remindTimeData) && req.remindTimeData.length > 0;
|
|
120
|
+
if (hasRemindOrdinary !== hasRemindTime) {
|
|
121
|
+
issues.push({ level: 'warn', message: 'remindOrdinaryData 与 remindTimeData 必须同时非空:服务端任一为空则整块提醒设置不落库(当前只填了一个,自定义提醒不会生效)' });
|
|
122
|
+
}
|
|
116
123
|
const basicData = Array.isArray(req.basicData) ? req.basicData : [];
|
|
117
124
|
const weights = basicData
|
|
118
125
|
.map((row) => num(row?.weight))
|
|
@@ -37,6 +37,36 @@ const stepFields = { sort: { type: 'integer' }, stepType: stringField, raterType
|
|
|
37
37
|
checkKps: booleanField, checkSignature: booleanField, stepWeight: numberField,
|
|
38
38
|
scoreMinNum: nullableNumber, scoreMaxNum: nullableNumber, interviewOrder: { type: ['string', 'null'] },
|
|
39
39
|
stepOperators: objectItems({ operateType: stringField, operater: { type: ['integer', 'string', 'null'] } }) };
|
|
40
|
+
/**
|
|
41
|
+
* 提醒配置元素(SchemeRemindSetting)。
|
|
42
|
+
* 证据:weaver-wr-performance 的 SchemeEditReq:397/402(List<SchemeRemindSetting>)、
|
|
43
|
+
* entity/SchemeRemindSetting.java、vo/basicSetting/RemindContentData.java;
|
|
44
|
+
* 事件名/提醒对象/timeRule 取值来自 weapp-performance 的 scheme/edit/remindCustomSetting.tsx 与 remindCustomEdit.tsx。
|
|
45
|
+
* 事件名不锁 enum:服务端不校验,前端才是权威取值源,锁死会挡住后续新增事件。
|
|
46
|
+
*/
|
|
47
|
+
const remindContentItem = {
|
|
48
|
+
type: 'object',
|
|
49
|
+
additionalProperties: true,
|
|
50
|
+
properties: {
|
|
51
|
+
id: { type: ['string', 'null'], description: '内容记录 id(服务端生成,回传时原样带上)' },
|
|
52
|
+
langId: { type: 'integer', description: '语言 id(中文=7)' },
|
|
53
|
+
value: { type: 'string', description: '提醒内容文案,可含 {字段} 占位符' },
|
|
54
|
+
targetId: { type: ['string', 'null'], description: '内容模板 id,字符串形式' },
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
const remindSettingItem = {
|
|
58
|
+
type: 'object',
|
|
59
|
+
additionalProperties: true,
|
|
60
|
+
properties: {
|
|
61
|
+
remindEventName: { type: 'string', description: '提醒事件名。普通提醒:schemeSubmitRemind/schemeBackRemind/distributeDiscontRemind/distributeFileRemind/commitRemind/auditRemind/complateRemind/startFlowRemind/flowBackedRemind/flowBackRemind/commitedRemind/flowApprovedRemind;定时提醒:scoreEndRemind/approveEndRemind/scoreOverTimeRemind/approveOverTimeRemind/appealsOverTimeRemind' },
|
|
62
|
+
remindTarget: { type: 'string', description: '提醒对象:approver 审批人 / submiter 提交人 / distributionManager 分布负责人 / scorer 评分人 / kpiUser 被评分人 / appealsManager 申诉处理人。由事件决定,按服务端默认值原样带回,不要自造' },
|
|
63
|
+
remindStatus: { type: 'boolean', description: '是否启用' },
|
|
64
|
+
remindDay: { type: 'integer', description: '截止日期前 N 天(仅定时提醒需要;普通提醒填 0)' },
|
|
65
|
+
remindTime: { type: 'string', description: '提醒时刻 HH:mm,如 "08:00"(仅定时提醒需要)' },
|
|
66
|
+
timeRule: { type: 'string', enum: ['serverTime', 'localTime'], description: '时间基准:serverTime 按服务器时间 / localTime 按当地时间。真机回读报文通常不含该字段(缺省按 serverTime),原样带回时不必补写' },
|
|
67
|
+
remindContentData: { type: 'array', items: remindContentItem, description: '多语言提醒内容' },
|
|
68
|
+
},
|
|
69
|
+
};
|
|
40
70
|
export const schemeEditReqSchema = {
|
|
41
71
|
id: { type: 'string', description: '方案 id,字符串形式(18 位 Long 转 JSON 数字会丢精度)。首次暂存不传;再次暂存/发布必传(覆盖式更新)' },
|
|
42
72
|
detailId: { type: 'string', description: '指标明细 id,字符串形式(发布时必传;缺失会导致 hr_kpi_details 重复插入、detail 永久 500)' },
|
|
@@ -92,8 +122,16 @@ export const schemeEditReqSchema = {
|
|
|
92
122
|
kpsDistributeType: stringField, flowDistributeType: stringField, createMode: stringField,
|
|
93
123
|
fieldFilters: { type: 'array', items: { type: 'object', additionalProperties: true } },
|
|
94
124
|
operatingTargetList: { type: 'array', items: { type: 'object', additionalProperties: true } },
|
|
95
|
-
remindOrdinaryData: {
|
|
96
|
-
|
|
125
|
+
remindOrdinaryData: {
|
|
126
|
+
type: 'array',
|
|
127
|
+
items: remindSettingItem,
|
|
128
|
+
description: '普通(事件型)提醒配置。⚠️ 必须与 remindTimeData 同时非空:服务端任一为空则整块提醒设置不落库。首选做法是从 scheme.detail 的 data 回读后,只改 remindStatus/remindDay/remindTime 再原样带回,不要凭空构造;回读记录还带 id/creator/tenantKey/createTime/deleteType/schemeId 等服务端字段,原样带回即可,普通提醒回读不含 remindTime 键。示例:[{"remindEventName":"commitRemind","remindTarget":"scorer","remindStatus":true,"remindDay":0,"timeRule":"serverTime","remindContentData":[{"langId":7,"value":"您有考核评分待提交"}]}]',
|
|
129
|
+
},
|
|
130
|
+
remindTimeData: {
|
|
131
|
+
type: 'array',
|
|
132
|
+
items: remindSettingItem,
|
|
133
|
+
description: '定时(截止/超时)提醒配置。⚠️ 必须与 remindOrdinaryData 同时非空;定时提醒需 remindDay + remindTime(真机报文形如 "08:00")。回读记录还带 id/creator/tenantKey/createTime/deleteType/schemeId 等服务端字段,原样带回即可。示例:[{"remindEventName":"scoreEndRemind","remindTarget":"scorer","remindStatus":true,"remindDay":3,"remindTime":"08:00","timeRule":"serverTime","remindContentData":[{"langId":7,"value":"评分将于 3 天后截止"}]}]',
|
|
134
|
+
},
|
|
97
135
|
teffectTime: { type: 'string', description: '生效日期 yyyy-MM-dd(文档未提及时默认当天)' },
|
|
98
136
|
failureTime: { type: 'string', description: '失效日期 yyyy-MM-dd(可选)' },
|
|
99
137
|
dateTypeSet: { type: 'string', enum: ['setting', 'custom'], description: '自动时间项模式;填 distributeTime/forbidTime 时应为 custom' },
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
3
|
import { reportPlatformError } from '../../core/error-codes.js';
|
|
4
|
+
import { MANIFEST_LIST_COMPACT_PATHS, manifestView, schemaOptionsOf } from '../../core/manifest-view.js';
|
|
4
5
|
import { createPlanContinuationSigner } from './continuation.js';
|
|
5
6
|
import { planValidationError } from './errors.js';
|
|
6
7
|
import { createPlanHost } from './host.js';
|
|
@@ -97,8 +98,16 @@ export const planShortcut = {
|
|
|
97
98
|
const plan = program.command('plan').description('泛微E10计划报告(报告详情/列表/新建/修改/发布/撤回/提交提醒/评论)');
|
|
98
99
|
plan.command('schema')
|
|
99
100
|
.description('Print plan operation manifest for agents')
|
|
100
|
-
.
|
|
101
|
-
|
|
101
|
+
.option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
|
|
102
|
+
.option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
|
|
103
|
+
.option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
|
|
104
|
+
.action(action((ctx, options) => {
|
|
105
|
+
const schema = schemaOptionsOf(options);
|
|
106
|
+
ctx.output.write(manifestView(planManifest, schema), {
|
|
107
|
+
json: true,
|
|
108
|
+
// 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
|
|
109
|
+
...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
|
|
110
|
+
});
|
|
102
111
|
}));
|
|
103
112
|
plan.command('run')
|
|
104
113
|
.description('Run a plan operation with JSON input')
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFile } from 'node:fs/promises';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
3
|
import { reportPlatformError } from '../../core/error-codes.js';
|
|
4
|
+
import { MANIFEST_LIST_COMPACT_PATHS, manifestView, schemaOptionsOf } from '../../core/manifest-view.js';
|
|
4
5
|
import { createProjectContinuationSigner } from './continuation.js';
|
|
5
6
|
import { createProjectHost } from './host.js';
|
|
6
7
|
import { projectManifest } from './manifest.js';
|
|
@@ -93,8 +94,16 @@ export const projectShortcut = {
|
|
|
93
94
|
const project = program.command('project').description('泛微E10事井然项目管理(项目/任务查询与确认写入)');
|
|
94
95
|
project.command('schema')
|
|
95
96
|
.description('Print project operation manifest for agents')
|
|
96
|
-
.
|
|
97
|
-
|
|
97
|
+
.option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
|
|
98
|
+
.option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
|
|
99
|
+
.option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
|
|
100
|
+
.action(action((ctx, options) => {
|
|
101
|
+
const schema = schemaOptionsOf(options);
|
|
102
|
+
ctx.output.write(manifestView(projectManifest, schema), {
|
|
103
|
+
json: true,
|
|
104
|
+
// 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
|
|
105
|
+
...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
|
|
106
|
+
});
|
|
98
107
|
}));
|
|
99
108
|
project.command('run')
|
|
100
109
|
.description('Run a project operation with JSON input')
|
|
@@ -103,6 +103,7 @@ function createOperations(namePrefix, target) {
|
|
|
103
103
|
action: prepareName,
|
|
104
104
|
summary: `预览并生成${target.entity === 'task' ? '任务' : '项目'}创建写入 continuation,不发生写入`,
|
|
105
105
|
risk: 'read-before-write',
|
|
106
|
+
requiresConfirmation: true,
|
|
106
107
|
inputSchema: schemaOf({ records: SCHEMA_RECORDS }, { required: ['records'] }),
|
|
107
108
|
handler: async (args, env) => {
|
|
108
109
|
const operator = await operatorId(env.host);
|
|
@@ -161,6 +162,7 @@ function updateOperations(namePrefix, target) {
|
|
|
161
162
|
action: prepareName,
|
|
162
163
|
summary: `回查并预览${target.entity === 'task' ? '任务' : '项目'}更新,生成 continuation,不发生写入`,
|
|
163
164
|
risk: 'read-before-write',
|
|
165
|
+
requiresConfirmation: true,
|
|
164
166
|
inputSchema: schemaOf({ id: SCHEMA_ID_STRING, fields: SCHEMA_FIELDS }, { required: ['id', 'fields'] }),
|
|
165
167
|
handler: async (args, env) => {
|
|
166
168
|
const id = idString(args.id, 'id');
|
|
@@ -231,6 +233,7 @@ function deleteOperations(namePrefix, target) {
|
|
|
231
233
|
action: prepareName,
|
|
232
234
|
summary: `回查${target.entity === 'task' ? '任务' : '项目'}并生成不可逆删除 continuation,不发生删除`,
|
|
233
235
|
risk: 'read-before-write',
|
|
236
|
+
requiresConfirmation: true,
|
|
234
237
|
inputSchema: schemaOf({ id: SCHEMA_ID_STRING }, { required: ['id'] }),
|
|
235
238
|
handler: async (args, env) => {
|
|
236
239
|
const id = idString(args.id, 'id');
|
|
@@ -54,6 +54,28 @@ export const MEETING_OPTIONS = [
|
|
|
54
54
|
{ label: '是,安排会议室', value: '是' },
|
|
55
55
|
{ label: '否,不需要', value: '否' },
|
|
56
56
|
];
|
|
57
|
+
/**
|
|
58
|
+
* 出件范围。
|
|
59
|
+
*
|
|
60
|
+
* - `flow`:完整链路——内部参考文档 md + 对外行程单 docx + 上传附件 + 填单页 browsertool。
|
|
61
|
+
* - `plan`:只出内部参考文档 md——不渲染 docx、不上传附件、不跑 render(因此也不出 browsertool,
|
|
62
|
+
* 不做会议未表态与小餐厅缺包厢的硬校验,那两条只对填单页有意义)。
|
|
63
|
+
*
|
|
64
|
+
* 为什么要有它:用户只说「出个接待方案」时,行程单与填单页都不该出现;
|
|
65
|
+
* 而 docx 渲染要 5~7s 且强依赖 python-docx,白跑一份再丢掉纯属浪费。
|
|
66
|
+
*/
|
|
67
|
+
export const RECEPTION_MODES = ['plan', 'flow'];
|
|
68
|
+
/** 默认按完整链路走,保持老调用方(不传 --mode)行为不变。 */
|
|
69
|
+
export const DEFAULT_RECEPTION_MODE = 'flow';
|
|
70
|
+
/** 把入参归一到 'plan' | 'flow';认不出的写法按默认处理,不报错打断链路。 */
|
|
71
|
+
export function normalizeReceptionMode(value) {
|
|
72
|
+
const text = String(value ?? '').trim().toLowerCase();
|
|
73
|
+
if (text === 'plan' || text === '方案' || text === 'document' || text === 'doc')
|
|
74
|
+
return 'plan';
|
|
75
|
+
if (text === 'flow' || text === '流程' || text === 'handbook' || text === 'manual')
|
|
76
|
+
return 'flow';
|
|
77
|
+
return DEFAULT_RECEPTION_MODE;
|
|
78
|
+
}
|
|
57
79
|
/** 快照文件的 kind 标识,用于拒收无关 JSON。 */
|
|
58
80
|
export const SNAPSHOT_KIND = 'reception-fields-snapshot';
|
|
59
81
|
/** python 探测结果的缓存时长(7 天)。 */
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { join } from 'node:path';
|
|
2
2
|
import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
|
|
3
3
|
import { stateRoot } from '../../core/state.js';
|
|
4
|
+
import { MANIFEST_LIST_COMPACT_PATHS, manifestView, schemaOptionsOf } from '../../core/manifest-view.js';
|
|
4
5
|
import { DEFAULT_WORKFLOW, STATE_SUBDIR } from './constants.js';
|
|
5
6
|
import { receptionValidationError } from './errors.js';
|
|
6
7
|
import { createReceptionHost } from './host.js';
|
|
@@ -75,8 +76,16 @@ export const receptionShortcut = {
|
|
|
75
76
|
.description('泛微客户参观接待流程:出面板 → 出两份产物并挂附件 → 输出填单页 browsertool');
|
|
76
77
|
reception.command('schema')
|
|
77
78
|
.description('输出 operation 合约(Agent 自查入口)')
|
|
78
|
-
.
|
|
79
|
-
|
|
79
|
+
.option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
|
|
80
|
+
.option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
|
|
81
|
+
.option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
|
|
82
|
+
.action(action((ctx, options) => {
|
|
83
|
+
const schema = schemaOptionsOf(options);
|
|
84
|
+
ctx.output.write(manifestView(receptionManifest, schema), {
|
|
85
|
+
json: true,
|
|
86
|
+
// 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
|
|
87
|
+
...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
|
|
88
|
+
});
|
|
80
89
|
}));
|
|
81
90
|
reception.command('run')
|
|
82
91
|
.description('按 operation 名执行(reception.ask / reception.doc / reception.render)')
|
|
@@ -134,6 +143,7 @@ export const receptionShortcut = {
|
|
|
134
143
|
.option('--snapshot <path>', '字段快照路径(同时用于推导 render.py)')
|
|
135
144
|
.option('--render-py <path>', '显式指定 render.py')
|
|
136
145
|
.option('--no-upload', '跳过附件上传,只出本地文件')
|
|
146
|
+
.option('--mode <mode>', '出件范围:plan=只出内部参考文档 md(不渲染 docx、不上传);flow=完整链路(默认)')
|
|
137
147
|
.action(action(async (ctx, options) => {
|
|
138
148
|
const opts = asOptions(options);
|
|
139
149
|
await runOperation(ctx, 'reception.doc', {
|
|
@@ -147,6 +157,7 @@ export const receptionShortcut = {
|
|
|
147
157
|
snapshot: textOf(opts, 'snapshot') || undefined,
|
|
148
158
|
renderPy: textOf(opts, 'renderPy') || undefined,
|
|
149
159
|
noUpload: opts.upload === false,
|
|
160
|
+
mode: textOf(opts, 'mode') || undefined,
|
|
150
161
|
}, opts);
|
|
151
162
|
}));
|
|
152
163
|
reception.command('render')
|
|
@@ -198,6 +209,7 @@ export const receptionShortcut = {
|
|
|
198
209
|
.option('--no-upload', '跳过附件上传,只出本地文件')
|
|
199
210
|
.option('--allow-missing-restaurant', '提了小餐厅但没包厢号时仍放行(明细留空进待办)')
|
|
200
211
|
.option('--sdk-render <type>', '打开形态:inline / popup / drawer(默认 drawer)')
|
|
212
|
+
.option('--mode <mode>', '出件范围:plan=只出内部参考文档 md(不打开填单页);flow=完整链路(默认)')
|
|
201
213
|
.action(action(async (ctx, options) => {
|
|
202
214
|
const opts = asOptions(options);
|
|
203
215
|
await runOperation(ctx, 'reception.docRender', {
|
|
@@ -213,6 +225,7 @@ export const receptionShortcut = {
|
|
|
213
225
|
noUpload: opts.upload === false,
|
|
214
226
|
allowMissingRestaurant: opts.allowMissingRestaurant === true,
|
|
215
227
|
sdkRender: textOf(opts, 'sdkRender') || undefined,
|
|
228
|
+
mode: textOf(opts, 'mode') || undefined,
|
|
216
229
|
}, opts);
|
|
217
230
|
}));
|
|
218
231
|
},
|