weaver-work-cli 0.1.69 → 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.
Files changed (232) hide show
  1. package/dist/chunks/{archive-VUTREF3P.js → archive-5P33NAUN.js} +22 -5
  2. package/dist/chunks/{archive-oa-VXXO4RTB.js → archive-oa-YTY5D7DG.js} +17 -5
  3. package/dist/chunks/{asset-45U6TY7I.js → asset-3Q5MFQBX.js} +22 -5
  4. package/dist/chunks/{asset-idle-YCRBMTIT.js → asset-idle-PQPNYIS7.js} +15 -5
  5. package/dist/chunks/{attachment-content-7BEDNQ3O.js → attachment-content-7CN7JB6B.js} +3 -3
  6. package/dist/chunks/{blog-5AML4WMG.js → blog-MFHHK6ZR.js} +25 -5
  7. package/dist/chunks/{caizhilian-3P7BUNHT.js → caizhilian-OZ435AYW.js} +22 -8
  8. package/dist/chunks/{calendar-2HUXM3CZ.js → calendar-TNJXS5UC.js} +15 -5
  9. package/dist/chunks/{chunk-H2NRTGZR.js → chunk-2DNCKZRX.js} +3 -3
  10. package/dist/chunks/{chunk-DVFA3ODS.js → chunk-35A56FJ7.js} +12 -0
  11. package/dist/chunks/{chunk-HG6INLH6.js → chunk-6MMSLE6K.js} +23 -6
  12. package/dist/chunks/{chunk-UVWW5ABZ.js → chunk-B4NINGP2.js} +3 -3
  13. package/dist/chunks/{chunk-LRKKKO5A.js → chunk-DRJYPXKC.js} +3 -4
  14. package/dist/chunks/{chunk-3TZURS7M.js → chunk-EJLP63UO.js} +1 -1
  15. package/dist/chunks/{chunk-FMAZ42HS.js → chunk-FRMDHZSN.js} +11 -11
  16. package/dist/chunks/{chunk-MLJK4KLE.js → chunk-G7ZM2VOX.js} +34 -34
  17. package/dist/chunks/{chunk-LSVA7QA6.js → chunk-GB2MCJPG.js} +3 -1
  18. package/dist/chunks/{chunk-3CBURKSY.js → chunk-ICNUOWLL.js} +4 -4
  19. package/dist/chunks/{chunk-GTAFCAVP.js → chunk-IZCQU5D5.js} +1 -1
  20. package/dist/chunks/{chunk-BEYEXCWU.js → chunk-LU2SPJYY.js} +2 -2
  21. package/dist/chunks/{chunk-E7VWE2XI.js → chunk-MD5RXRI3.js} +3 -3
  22. package/dist/chunks/{chunk-VZUH3LKI.js → chunk-MZVQKQP5.js} +167 -157
  23. package/dist/chunks/{chunk-67AN5YJT.js → chunk-OFCF23FY.js} +9 -9
  24. package/dist/chunks/{chunk-ERAE4GHX.js → chunk-OPTJ6IF7.js} +1 -1
  25. package/dist/chunks/{chunk-727VKJQK.js → chunk-OZ7CJC7W.js} +2 -2
  26. package/dist/chunks/{chunk-T24EBWAZ.js → chunk-P3AFNAJ6.js} +48 -21
  27. package/dist/chunks/{chunk-4XYRTXRR.js → chunk-Q3EXRNB4.js} +1 -1
  28. package/dist/chunks/{chunk-QYDSTYGG.js → chunk-SKWKCLJX.js} +3 -3
  29. package/dist/chunks/{chunk-DSBV4GRK.js → chunk-SSS75WXW.js} +3 -3
  30. package/dist/chunks/{chunk-I5XB4MZT.js → chunk-SUWR5QEG.js} +94 -65
  31. package/dist/chunks/{chunk-YR3K53BU.js → chunk-VJWVB55R.js} +2 -2
  32. package/dist/chunks/{chunk-JAIZY37Z.js → chunk-VMVMEIL3.js} +4 -4
  33. package/dist/chunks/chunk-WM33BSIL.js +136 -0
  34. package/dist/chunks/{chunk-6DH73Q5H.js → chunk-X2C5CGGM.js} +52 -51
  35. package/dist/chunks/{chunk-ELF5TPSG.js → chunk-XLSJC6JZ.js} +6 -6
  36. package/dist/chunks/{chunk-U3OO3IZF.js → chunk-YN5SD4TX.js} +20 -7
  37. package/dist/chunks/{conflict-VKCRXHUV.js → conflict-Y4PXZ2YQ.js} +2 -2
  38. package/dist/chunks/{contract-3PMHUASH.js → contract-C3BGUMBM.js} +48 -5
  39. package/dist/chunks/{cowork-FZBTTBYX.js → cowork-2AWG4QLA.js} +37 -8
  40. package/dist/chunks/{create-flow-WYPLBLRK.js → create-flow-LOUOK46Z.js} +6 -6
  41. package/dist/chunks/{data-2YZ6A6TL.js → data-BSFYMXVO.js} +99 -184
  42. package/dist/chunks/{ebuilder-form-AWPTMZBZ.js → ebuilder-form-LAAMTD2Y.js} +17 -7
  43. package/dist/chunks/{ehr-MNPR4TE5.js → ehr-36KEX5SH.js} +62 -13
  44. package/dist/chunks/{entry-mode-BCJ7RPFC.js → entry-mode-6N2IGCS4.js} +3 -3
  45. package/dist/chunks/{env-SCVCHBN2.js → env-QYLS3EB3.js} +2 -2
  46. package/dist/chunks/{esb-GSB5QCEX.js → esb-PTYS3E67.js} +17 -7
  47. package/dist/chunks/{factory-CBXYOEBF.js → factory-LPFPKZ4T.js} +1 -1
  48. package/dist/chunks/{fna-XBSNUS2V.js → fna-JNHCLRDE.js} +15 -5
  49. package/dist/chunks/{group-chat-RFL4U7RF.js → group-chat-QP2WX4QJ.js} +3 -3
  50. package/dist/chunks/{host-2UMNXX5H.js → host-57LSRSE7.js} +4 -4
  51. package/dist/chunks/{host-NVDG3NC6.js → host-7BVR7CQ3.js} +4 -4
  52. package/dist/chunks/{host-SYPCA63D.js → host-C2BLBIID.js} +4 -4
  53. package/dist/chunks/{host-XVWBOSEN.js → host-K2ZKNXME.js} +4 -4
  54. package/dist/chunks/{host-R7BP3CTI.js → host-NS36QFLR.js} +6 -4
  55. package/dist/chunks/{host-BD44ASOD.js → host-QXFKQXNX.js} +4 -4
  56. package/dist/chunks/{hrm-FZUDJAND.js → hrm-FSGO4NSH.js} +15 -6
  57. package/dist/chunks/{im-F5NENPD7.js → im-2BFGS2XO.js} +16 -6
  58. package/dist/chunks/{invoice-DS6FLU55.js → invoice-JKLTTHSZ.js} +27 -6
  59. package/dist/chunks/{jiuchuanhui-PY2WEBUH.js → jiuchuanhui-PTABJE7V.js} +1294 -1134
  60. package/dist/chunks/{lazy-dispatch-F6O2EPGR.js → lazy-dispatch-YN2ZP3CS.js} +6 -6
  61. package/dist/chunks/{mail-ZEOSANEJ.js → mail-YNO7ZZUK.js} +116 -97
  62. package/dist/chunks/{meeting-N2AGGLVI.js → meeting-NIDHDBCB.js} +29 -16
  63. package/dist/chunks/{minute-doc-C62EZOJH.js → minute-doc-G3QAT7DE.js} +4 -4
  64. package/dist/chunks/{okr-OZUMTMCL.js → okr-QC52G6AJ.js} +15 -5
  65. package/dist/chunks/{operations-LQY3FTPH.js → operations-2WHIF5WV.js} +1 -1
  66. package/dist/chunks/{operations-UTUWFJTX.js → operations-MQV32ITT.js} +5 -5
  67. package/dist/chunks/{performance-GBKM5G2Y.js → performance-3MQ3AHDQ.js} +97 -11
  68. package/dist/chunks/{plan-C2NENH42.js → plan-ISINIEPY.js} +15 -5
  69. package/dist/chunks/{project-FAJ2P3UR.js → project-IJ6DVKT7.js} +18 -5
  70. package/dist/chunks/{reception-NH6MJFPR.js → reception-3H5LUG2I.js} +17 -7
  71. package/dist/chunks/{recruit-stage-DPEFHLSE.js → recruit-stage-MIOJXP6W.js} +412 -85
  72. package/dist/chunks/{registry-7US3QQXV.js → registry-3GQRYP2R.js} +12 -12
  73. package/dist/chunks/{registry-Y2HWS6JS.js → registry-3S7AVMXR.js} +4 -4
  74. package/dist/chunks/{registry-FTPUUHWC.js → registry-NHHKOEU3.js} +5 -5
  75. package/dist/chunks/{room-recommend-LMNF76YS.js → room-recommend-IOKBJVYP.js} +4 -4
  76. package/dist/chunks/{schedule-4QE2THAP.js → schedule-IB6EUARH.js} +4 -4
  77. package/dist/chunks/{smart-extract-GTYKF5TJ.js → smart-extract-N2TK3CEF.js} +19 -6
  78. package/dist/chunks/{workflow-KXYTQZ2H.js → workflow-RINBAL2M.js} +22 -8
  79. package/dist/cmd/auth/index.js +23 -0
  80. package/dist/cmd/e10/index.js +2 -1
  81. package/dist/cmd/index.js +2 -0
  82. package/dist/core/manifest-view.js +207 -0
  83. package/dist/core/output.js +38 -8
  84. package/dist/index.js +35 -35
  85. package/dist/internal/e10/auth/crypto.js +18 -8
  86. package/dist/internal/e10/auth/error-log.js +1 -2
  87. package/dist/internal/e10/auth/messages.js +2 -3
  88. package/dist/internal/e10/auth/xiaoe.js +1 -1
  89. package/dist/internal/e10/tls-policy.js +61 -13
  90. package/dist/shortcuts/archive/index.js +11 -2
  91. package/dist/shortcuts/archive/operations/download.js +1 -0
  92. package/dist/shortcuts/archive/operations/flow-url.js +3 -0
  93. package/dist/shortcuts/archive/operations/prelib.js +2 -0
  94. package/dist/shortcuts/archive/operations/upload.js +1 -0
  95. package/dist/shortcuts/archive-oa/index.js +11 -2
  96. package/dist/shortcuts/archive-oa/operations/borrow-car.js +2 -0
  97. package/dist/shortcuts/asset/index.js +11 -2
  98. package/dist/shortcuts/asset/manifest.js +7 -0
  99. package/dist/shortcuts/asset-idle/index.js +11 -2
  100. package/dist/shortcuts/blog/index.js +11 -2
  101. package/dist/shortcuts/blog/manifest.js +10 -0
  102. package/dist/shortcuts/caizhilian/host.js +20 -4
  103. package/dist/shortcuts/caizhilian/index.js +12 -2
  104. package/dist/shortcuts/caizhilian/manifest.js +4 -25
  105. package/dist/shortcuts/caizhilian/operations/handlers/search.js +34 -0
  106. package/dist/shortcuts/caizhilian/operations/registry.js +25 -1
  107. package/dist/shortcuts/calendar/index.js +11 -2
  108. package/dist/shortcuts/contract/index.js +11 -2
  109. package/dist/shortcuts/contract/manifest.js +32 -0
  110. package/dist/shortcuts/contract/operations/write.js +3 -0
  111. package/dist/shortcuts/cowork/index.js +21 -5
  112. package/dist/shortcuts/cowork/manifest.js +3 -0
  113. package/dist/shortcuts/cowork/operations/discuss-write.js +2 -0
  114. package/dist/shortcuts/cowork/operations/item-write.js +3 -0
  115. package/dist/shortcuts/cowork/operations/member-write.js +2 -0
  116. package/dist/shortcuts/cowork/operations/permission-write.js +2 -0
  117. package/dist/shortcuts/cowork/operations/review-write.js +1 -0
  118. package/dist/shortcuts/data/errors.js +16 -29
  119. package/dist/shortcuts/data/host.js +16 -7
  120. package/dist/shortcuts/data/index.js +12 -41
  121. package/dist/shortcuts/data/manifest.js +5 -44
  122. package/dist/shortcuts/data/operations/attend.js +2 -2
  123. package/dist/shortcuts/data/operations/conf.js +0 -88
  124. package/dist/shortcuts/data/operations/ds.js +4 -4
  125. package/dist/shortcuts/data/operations/index.js +1 -5
  126. package/dist/shortcuts/data/operations/module.js +40 -14
  127. package/dist/shortcuts/data/operations/query.js +2 -2
  128. package/dist/shortcuts/ebuilder-form/index.js +11 -2
  129. package/dist/shortcuts/ebuilder-form/manifest.js +12 -0
  130. package/dist/shortcuts/ehr/index.js +11 -2
  131. package/dist/shortcuts/ehr/operations/attend-write.js +51 -8
  132. package/dist/shortcuts/esb/index.js +11 -2
  133. package/dist/shortcuts/esb/manifest.js +2 -0
  134. package/dist/shortcuts/fna/index.js +11 -2
  135. package/dist/shortcuts/hrm/index.js +11 -1
  136. package/dist/shortcuts/im/index.js +11 -2
  137. package/dist/shortcuts/invoice/index.js +11 -2
  138. package/dist/shortcuts/invoice/manifest.js +8 -0
  139. package/dist/shortcuts/jiuchuanhui/cache.js +49 -35
  140. package/dist/shortcuts/jiuchuanhui/host.js +37 -5
  141. package/dist/shortcuts/jiuchuanhui/index.js +57 -7
  142. package/dist/shortcuts/jiuchuanhui/manifest.js +38 -1
  143. package/dist/shortcuts/jiuchuanhui/operations/customer-quick.js +110 -0
  144. package/dist/shortcuts/jiuchuanhui/operations/datajson.js +11 -56
  145. package/dist/shortcuts/jiuchuanhui/operations/esb.js +9 -16
  146. package/dist/shortcuts/jiuchuanhui/operations/generic.js +8 -30
  147. package/dist/shortcuts/jiuchuanhui/operations/registry.js +8 -2
  148. package/dist/shortcuts/jiuchuanhui/operations/shared.js +0 -10
  149. package/dist/shortcuts/mail/errors.js +14 -0
  150. package/dist/shortcuts/mail/index.js +23 -6
  151. package/dist/shortcuts/mail/manifest.js +11 -4
  152. package/dist/shortcuts/mail/operations/mail-blacklist.js +6 -6
  153. package/dist/shortcuts/mail/operations/mail-contacts.js +10 -10
  154. package/dist/shortcuts/mail/operations/mail-manage.js +15 -14
  155. package/dist/shortcuts/mail/operations/mail-read.js +7 -25
  156. package/dist/shortcuts/mail/operations/mail-send.js +12 -12
  157. package/dist/shortcuts/mail/operations/mail-sign.js +10 -10
  158. package/dist/shortcuts/mail/operations/mail-template.js +10 -10
  159. package/dist/shortcuts/meeting/index.js +11 -2
  160. package/dist/shortcuts/meeting/operations/invitation-publish.js +1 -0
  161. package/dist/shortcuts/okr/index.js +11 -2
  162. package/dist/shortcuts/performance/index.js +62 -3
  163. package/dist/shortcuts/performance/operations/flow-detail.js +5 -4
  164. package/dist/shortcuts/performance/scheme-validate.js +7 -0
  165. package/dist/shortcuts/performance/shared.js +40 -2
  166. package/dist/shortcuts/plan/index.js +11 -2
  167. package/dist/shortcuts/project/index.js +11 -2
  168. package/dist/shortcuts/project/operations/write.js +3 -0
  169. package/dist/shortcuts/reception/index.js +11 -2
  170. package/dist/shortcuts/reception/manifest.js +2 -2
  171. package/dist/shortcuts/reception/operations/ask.js +3 -0
  172. package/dist/shortcuts/recruit-stage/index.js +22 -3
  173. package/dist/shortcuts/recruit-stage/manifest.js +2 -0
  174. package/dist/shortcuts/recruit-stage/operations/jd-create.js +33 -16
  175. package/dist/shortcuts/recruit-stage/operations/profile.js +186 -0
  176. package/dist/shortcuts/recruit-stage/operations/registry.js +2 -0
  177. package/dist/shortcuts/recruit-stage/operations/resume-import.js +76 -47
  178. package/dist/shortcuts/recruit-stage/operations/search.js +151 -16
  179. package/dist/shortcuts/recruit-stage/operations/tag.js +17 -3
  180. package/dist/shortcuts/recruit-stage/shared.js +11 -1
  181. package/dist/shortcuts/smart-extract/index.js +11 -2
  182. package/dist/shortcuts/smart-extract/manifest.js +1 -0
  183. package/dist/shortcuts/smart-extract/operations/save.js +2 -0
  184. package/dist/shortcuts/workflow/index.js +21 -1
  185. package/dist/shortcuts/workflow/operations/aiDeepRead/collect.js +5 -2
  186. package/dist/shortcuts/workflow/operations/read.js +2 -2
  187. package/dist/shortcuts/workflow/operations/write.js +1 -1
  188. package/docs/caizhilian.md +1 -1
  189. package/docs/contract.md +1 -0
  190. package/docs/data.md +22 -22
  191. package/docs/e10-auth.md +41 -33
  192. package/docs/ehr.md +2 -0
  193. package/docs/jiuchuanhui.md +17 -5
  194. package/docs/reception.md +4 -3
  195. package/package.json +1 -1
  196. package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
  197. package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
  198. package/scripts/pysite/sitecustomize.py +41 -0
  199. package/skill-template/domains/data.md +4 -4
  200. package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
  201. package/skills/weaver-e10-caizhilian/references/org-browser.md +1 -0
  202. package/skills/weaver-e10-cowork/SKILL.md +3 -1
  203. package/skills/weaver-e10-data/SKILL.md +12 -16
  204. package/skills/weaver-e10-data/references/config-center.md +6 -7
  205. package/skills/weaver-e10-data/references/datasource.md +1 -1
  206. package/skills/weaver-e10-data/references/scene-and-misc.md +2 -2
  207. package/skills/weaver-e10-jiuchuanhui/SKILL.md +51 -90
  208. package/skills/weaver-e10-jiuchuanhui/references/cache.md +17 -13
  209. package/skills/weaver-e10-jiuchuanhui/references/clue.md +2 -2
  210. package/skills/weaver-e10-jiuchuanhui/references/customer.md +49 -11
  211. package/skills/weaver-e10-jiuchuanhui/references/discovery-config.md +3 -3
  212. package/skills/weaver-e10-jiuchuanhui/references/jiuchuanhui-entry.md +9 -7
  213. package/skills/weaver-e10-jiuchuanhui/references/sale.md +2 -2
  214. package/skills/weaver-e10-jucailin/references/attend-write.md +1 -1
  215. package/skills/weaver-e10-mail/SKILL.md +4 -1
  216. package/skills/weaver-e10-mail/references/mail-read.md +4 -2
  217. package/skills/weaver-e10-mail/references/safety-boundaries.md +1 -0
  218. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  219. package/skills/weaver-e10-performance/SKILL.md +9 -7
  220. package/skills/weaver-e10-performance/agents/openai.yaml +4 -2
  221. package/skills/weaver-e10-performance/references/flow-assess.md +19 -6
  222. package/skills/weaver-e10-recruit-stage/SKILL.md +125 -20
  223. package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +359 -0
  224. package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +87 -0
  225. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +9 -2
  226. package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +1 -0
  227. package/skills/weaver-e10-recruit-stage/templates/match-report.html +177 -0
  228. package/skills/weaver-e10-shared/SKILL.md +22 -1
  229. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +2 -2
  230. package/skills/weaver-e10-workflow/SKILL.md +1 -1
  231. package/skills/weaver-e10-workflow/references/workflow-deep-read.md +8 -3
  232. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
@@ -3,6 +3,7 @@ import { statSync, readFileSync } from 'node:fs';
3
3
  import { extname } from 'node:path';
4
4
  import { mailRandomKey } from '../host.js';
5
5
  import { WRITE, mailSuccess, schemaOf, SCHEMA_STRING } from './types.js';
6
+ import { mailValidationError, mailUpstreamError } from '../errors.js';
6
7
  const MIME_BY_EXT = {
7
8
  txt: 'text/plain',
8
9
  html: 'text/html',
@@ -48,7 +49,7 @@ const opStar = {
48
49
  const id = String(args.id || '').trim();
49
50
  const star = String(args.star ?? '1');
50
51
  if (!id)
51
- throw new Error('id(邮件 id)必填');
52
+ throw mailValidationError('id_required', 'id(邮件 id)必填');
52
53
  const value = (await env.host.request({
53
54
  path: '/api/mail/base/resource/starMail',
54
55
  method: 'POST',
@@ -69,7 +70,7 @@ const opReadStatus = {
69
70
  const id = String(args.id || '').trim();
70
71
  const read = String(args.read ?? '1');
71
72
  if (!id)
72
- throw new Error('id(邮件 id)必填');
73
+ throw mailValidationError('id_required', 'id(邮件 id)必填');
73
74
  const value = (await env.host.request({
74
75
  path: '/api/mail/base/resource/setMailReadStatus',
75
76
  method: 'POST',
@@ -114,7 +115,7 @@ const opWaitAdd = {
114
115
  async handler(args, env) {
115
116
  const id = String(args.id || '').trim();
116
117
  if (!id)
117
- throw new Error('id(邮件 id)必填');
118
+ throw mailValidationError('id_required', 'id(邮件 id)必填');
118
119
  const content = args.title ? String(args.title) : await fetchSubject(env, id);
119
120
  const processTime = args.endDate ? String(args.endDate) : '';
120
121
  const reminderTime = args.reminderTime ? String(args.reminderTime) : '';
@@ -144,9 +145,9 @@ const opMoveFolder = {
144
145
  const id = String(args.id || '').trim();
145
146
  const folder = String(args.folder || '').trim();
146
147
  if (!id)
147
- throw new Error('id(邮件 id)必填');
148
+ throw mailValidationError('id_required', 'id(邮件 id)必填');
148
149
  if (!folder)
149
- throw new Error('folder(目标文件夹 id)必填');
150
+ throw mailValidationError('folder_required', 'folder(目标文件夹 id)必填');
150
151
  const value = (await env.host.request({
151
152
  path: '/api/mail/base/resource/moveMailToFolder',
152
153
  method: 'POST',
@@ -166,7 +167,7 @@ const opDeleteMove = {
166
167
  async handler(args, env) {
167
168
  const id = String(args.id || '').trim();
168
169
  if (!id)
169
- throw new Error('id(邮件 id)必填');
170
+ throw mailValidationError('id_required', 'id(邮件 id)必填');
170
171
  const value = (await env.host.request({
171
172
  path: '/api/mail/base/resource/deleteMailResourceByMoveBatch',
172
173
  method: 'POST',
@@ -190,7 +191,7 @@ const opFolderCreate = {
190
191
  async handler(args, env) {
191
192
  const name = String(args.name || '').trim();
192
193
  if (!name)
193
- throw new Error('name(文件夹名)必填');
194
+ throw mailValidationError('folder_name_required', 'name(文件夹名)必填');
194
195
  const body = { name };
195
196
  if (args.id)
196
197
  body.id = String(args.id);
@@ -209,7 +210,7 @@ const opFolderDelete = {
209
210
  async handler(args, env) {
210
211
  const id = String(args.id || '').trim();
211
212
  if (!id)
212
- throw new Error('id(文件夹 id)必填');
213
+ throw mailValidationError('id_required', 'id(文件夹 id)必填');
213
214
  const value = (await env.host.request({ path: '/api/mail/base/setting/folder/deleteMailFolder', method: 'POST', body: { id } }));
214
215
  return mailSuccess('mail.folder.delete', value?.data ?? 'SUCCESS', { id });
215
216
  },
@@ -225,7 +226,7 @@ const opRecall = {
225
226
  async handler(args, env) {
226
227
  const id = String(args.id || '').trim();
227
228
  if (!id)
228
- throw new Error('id(邮件 id)必填');
229
+ throw mailValidationError('id_required', 'id(邮件 id)必填');
229
230
  const value = (await env.host.request({ path: '/api/mail/base/recallMail', method: 'POST', body: { mailResourceId: id, ids: id } }));
230
231
  const d = value?.data || {};
231
232
  return mailSuccess('mail.recall', { success: d.success === 1, msg: d.msg }, { id });
@@ -242,7 +243,7 @@ const opAttachmentUpload = {
242
243
  async handler(args, env) {
243
244
  const filePath = String(args.file || '').trim();
244
245
  if (!filePath)
245
- throw new Error('file(本地文件路径)必填');
246
+ throw mailValidationError('file_required', 'file(本地文件路径)必填');
246
247
  const name = args.name ? String(args.name) : filePath.split(/[\\/]/).pop() || 'attachment';
247
248
  let buffer;
248
249
  let size;
@@ -252,7 +253,7 @@ const opAttachmentUpload = {
252
253
  buffer = readFileSync(filePath);
253
254
  }
254
255
  catch {
255
- throw new Error('无法读取本地文件:' + filePath);
256
+ throw mailValidationError('file_unreadable', '无法读取本地文件:' + filePath);
256
257
  }
257
258
  const md5 = createHash('md5').update(buffer).digest('hex');
258
259
  const lastModified = Date.now();
@@ -275,7 +276,7 @@ const opAttachmentUpload = {
275
276
  }));
276
277
  const preUploadId = precheck?.data?.preUploadId;
277
278
  if (!preUploadId)
278
- throw new Error('附件预检未返回 preUploadId:' + JSON.stringify(precheck?.data).slice(0, 200));
279
+ throw mailUpstreamError('attachment_precheck_contract', '附件预检未返回 preUploadId:' + JSON.stringify(precheck?.data).slice(0, 200));
279
280
  const upload = (await env.host.request({
280
281
  path: '/api/file/module/upload',
281
282
  method: 'POST',
@@ -283,7 +284,7 @@ const opAttachmentUpload = {
283
284
  }));
284
285
  const fileid = upload?.data?.fileid;
285
286
  if (!fileid)
286
- throw new Error('附件上传未返回 fileid:' + JSON.stringify(upload?.data).slice(0, 200));
287
+ throw mailUpstreamError('attachment_upload_contract', '附件上传未返回 fileid:' + JSON.stringify(upload?.data).slice(0, 200));
287
288
  await env.host.request({
288
289
  path: '/api/mail/base/add/addPermissionFile',
289
290
  method: 'POST',
@@ -303,7 +304,7 @@ const opAttachmentDownload = {
303
304
  async handler(args, env) {
304
305
  const ids = String(args.ids || '').trim();
305
306
  if (!ids)
306
- throw new Error('ids(附件 id)必填');
307
+ throw mailValidationError('ids_required', 'ids(附件 id)必填');
307
308
  const value = (await env.host.request({
308
309
  path: '/api/mail/base/file/batchDownload',
309
310
  method: 'POST',
@@ -1,5 +1,6 @@
1
1
  import { mailRandomKey } from '../host.js';
2
2
  import { mailSuccess, READ, schemaOf, SCHEMA_STRING, SCHEMA_INTEGER, SCHEMA_BOOLEAN } from './types.js';
3
+ import { mailValidationError } from '../errors.js';
3
4
  const FOLDER_TEXT = {
4
5
  '-10': '全部',
5
6
  '0': '收件箱',
@@ -118,7 +119,7 @@ const opContactList = {
118
119
  async handler(args, env) {
119
120
  const name = String(args.name || '').trim();
120
121
  if (!name)
121
- throw new Error('name(人员姓名/工号)必填');
122
+ throw mailValidationError('name_required', 'name(人员姓名/工号)必填');
122
123
  const [inbox, sent] = await Promise.all([
123
124
  listMails(env, { ...args, size: args.size ?? 100 }, 0, { from: name }),
124
125
  listMails(env, { ...args, size: args.size ?? 100 }, -1, { to: name }),
@@ -142,7 +143,7 @@ const opViewInfo = {
142
143
  async handler(args, env) {
143
144
  const id = String(args.id || '').trim();
144
145
  if (!id)
145
- throw new Error('id(邮件 id)必填');
146
+ throw mailValidationError('id_required', 'id(邮件 id)必填');
146
147
  const rk = mailRandomKey();
147
148
  const [rkKey, rkVal] = rk.split('=');
148
149
  const value = (await env.host.request({
@@ -181,7 +182,7 @@ const opViewContent = {
181
182
  async handler(args, env) {
182
183
  const id = String(args.id || '').trim();
183
184
  if (!id)
184
- throw new Error('id(邮件 id)必填');
185
+ throw mailValidationError('id_required', 'id(邮件 id)必填');
185
186
  const rk = mailRandomKey();
186
187
  const [rkKey, rkVal] = rk.split('=');
187
188
  const value = (await env.host.request({
@@ -234,7 +235,7 @@ const opPersonSearch = {
234
235
  async handler(args, env) {
235
236
  const keyword = String(args.keyword || '').trim();
236
237
  if (!keyword)
237
- throw new Error('keyword(姓名/工号)必填');
238
+ throw mailValidationError('keyword_required', 'keyword(姓名/工号)必填');
238
239
  const value = (await env.host.request({
239
240
  path: '/api/mail/base/common/browser/complete/resource',
240
241
  method: 'POST',
@@ -322,7 +323,7 @@ const opAddressSearch = {
322
323
  async handler(args, env) {
323
324
  const keyword = String(args.keyword || '').trim();
324
325
  if (!keyword)
325
- throw new Error('keyword(邮箱关键字)必填');
326
+ throw mailValidationError('keyword_required', 'keyword(邮箱关键字)必填');
326
327
  const value = (await env.host.request({
327
328
  path: '/api/mail/base/add/addressFullsearch',
328
329
  method: 'POST',
@@ -384,7 +385,7 @@ const opGroupDetail = {
384
385
  async handler(args, env) {
385
386
  const id = String(args.id || '').trim();
386
387
  if (!id)
387
- throw new Error('id(分组 id)必填');
388
+ throw mailValidationError('id_required', 'id(分组 id)必填');
388
389
  const value = (await env.host.request({
389
390
  path: '/api/mail/base/contacts/getMailContactsGroupVosByGroupId',
390
391
  method: 'POST',
@@ -469,24 +470,6 @@ const opAttachmentCenter = {
469
470
  return mailSuccess('mail.attachment.center', value?.data || {});
470
471
  },
471
472
  };
472
- const opClearlogList = {
473
- name: 'mail.clearlog.list',
474
- resource: 'mail/base/setting/mailClear/getEmailClearLogList',
475
- method: 'POST',
476
- action: 'mail.clearlog.list',
477
- summary: '邮件清理日志列表',
478
- risk: READ,
479
- inputSchema: schemaOf({ page: SCHEMA_INTEGER, size: SCHEMA_INTEGER }, { description: '清理日志列表' }),
480
- async handler(args, env) {
481
- const body = { current: num(args.page, 1), pageSize: num(args.size, 20) };
482
- const value = (await env.host.request({
483
- path: '/api/mail/base/setting/mailClear/getEmailClearLogList',
484
- method: 'POST',
485
- body,
486
- }));
487
- return mailSuccess('mail.clearlog.list', value?.data || {});
488
- },
489
- };
490
473
  export const mailReadOperations = [
491
474
  opList,
492
475
  opContactList,
@@ -504,5 +487,4 @@ export const mailReadOperations = [
504
487
  opSignList,
505
488
  opBlacklistList,
506
489
  opAttachmentCenter,
507
- opClearlogList,
508
490
  ];
@@ -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 new Error('mailAdd 未返回 sessionUuid:' + JSON.stringify(value).slice(0, 300));
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 new Error('未找到内部人员:' + n + '(可尝试姓名/工号;若是部门请用 to-dep/cc-dep/bcc-dep 指定)');
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 new Error('未找到部门:' + n + '(请确认部门名称,或用 to 指定人员)');
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 new Error('未找到外部邮箱:' + e + '(可尝试完整邮箱地址)');
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 new Error('收件人内外部混用:邮箱地址=外部邮件、姓名=内部邮件,请统一,或用 --internal/--external 明确邮件类型');
252
+ throw mailValidationError('recipient_mixed', '收件人内外部混用:邮箱地址=外部邮件、姓名=内部邮件,请统一,或用 --internal/--external 明确邮件类型');
253
253
  }
254
254
  if (!all.length)
255
- throw new Error('请先说明收件人(姓名=内部邮件 / 邮箱地址=外部邮件 / 部门用 to-dep)');
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 new Error('当前账号未配置外部邮箱发件账号(mailAdd.sendFrom_outer 为空),无法发送外部邮件;请先在邮件设置中绑定外部邮箱账号');
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 new Error('当前环境未启用内部邮件(getEmailAllConfig.sysConfig.innerMail=' + sys.innerMail + '),无法发送内部邮件');
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 new Error('当前环境未启用外部邮件(getEmailAllConfig.outterMail=0),无法发送外部邮件');
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 new Error('系统未启用邮件功能(内部/外部邮件均未开启),无法发送邮件');
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 new Error('发送前校验未通过:' + (cdata.msg || '未知拦截(canSendMail)'));
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 new Error('signName(签名名称)必填');
19
+ throw mailValidationError('sign_name_required', 'signName(签名名称)必填');
20
20
  if (!clobContent)
21
- throw new Error('clobContent(Base64 编码的 HTML 内容)必填');
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 new Error('mail.sign.save.apply 必须传入 confirm=true 与 prepare 返回的 continuation');
71
+ throw mailConfirmationError('mail.sign.save.apply');
72
72
  if (!args.continuation)
73
- throw new Error('mail.sign.save.apply 必须传入 prepare 返回的 continuation');
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 new Error('id(签名 id)必填');
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 new Error('签名名称为空(原值缺失且未提供 signName)');
115
+ throw mailValidationError('sign_name_empty', '签名名称为空(原值缺失且未提供 signName)');
116
116
  if (!body.clobContent)
117
- throw new Error('签名内容为空(原值缺失且未提供 clobContent)');
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 new Error('id(签名 id)必填');
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 new Error('id(签名 id)必填');
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 new Error('subject(模板主题)必填');
20
+ throw mailValidationError('subject_required', 'subject(模板主题)必填');
21
21
  if (!clobContent)
22
- throw new Error('clobContent(Base64 编码的 HTML 内容)必填');
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 new Error('mail.template.save.apply 必须传入 confirm=true 与 prepare 返回的 continuation');
76
+ throw mailConfirmationError('mail.template.save.apply');
77
77
  if (!args.continuation)
78
- throw new Error('mail.template.save.apply 必须传入 prepare 返回的 continuation');
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 new Error('id(模板 id)必填');
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 new Error('模板主题为空(原值缺失且未提供 subject)');
125
+ throw mailValidationError('subject_empty', '模板主题为空(原值缺失且未提供 subject)');
126
126
  if (!body.clobContent)
127
- throw new Error('模板内容为空(原值缺失且未提供 clobContent)');
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 new Error('id(模板 id)必填');
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 new Error('id(模板 id)必填');
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
- .action(action((ctx) => {
105
- ctx.output.write(meetingManifest, { json: true });
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 预览,
@@ -31,6 +31,7 @@ const meetingInvitationPublish = {
31
31
  + '会真实创建文档(需 confirm: true)。',
32
32
  capability: 'invitation',
33
33
  risk: 'high-risk-write',
34
+ requiresConfirmation: true,
34
35
  inputSchema: {
35
36
  type: 'object',
36
37
  additionalProperties: false,
@@ -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
- .action(action((ctx) => {
101
- ctx.output.write(okrManifest, { json: true });
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 manifest for agents')
97
- .action(action((ctx) => {
98
- ctx.output.write(performanceManifest, { json: true });
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')
@@ -52,10 +52,11 @@ async function assess(args, env) {
52
52
  return pfSuccess('performance.flow.assess', {
53
53
  ...context,
54
54
  scoringHints: [
55
- '定量指标:以目标值与实际值(数据源聚合结果)为依据,先算达成率再映射分数',
56
- '定性指标:基于指标说明与可用数据给出可追溯的判断依据,不空泛',
57
- '数据源 error 字段非空的指标标注「无法取数」,不强行打分',
58
- '评分上限为满分(maxScore);超出会被拒绝,不做静默截断',
55
+ '评分必须由 AI 自己给出:禁止向用户询问「这项该打多少分」',
56
+ '依据优先级:①指标描述/等级标准 ②定量(目标值+实际值)→达成率映射 ③实际值缺失或取数失败→替代证据,仍无则中性预评 ④定性无量化→专业判断,无旁证则中性预评',
57
+ '中性预评 = 满分×70%(四舍五入 0.01),理由里必须注明「按中性水平预评」,用户可在详情页调整',
58
+ '数据源 error 字段非空的指标照常给分并在理由注明「取数失败」,不得跳过该行或留空',
59
+ '不得编造实际值;评分上限为满分(maxScore),超出会被拒绝,不做静默截断',
59
60
  ],
60
61
  });
61
62
  }
@@ -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))