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
@@ -30,6 +30,7 @@ function assistantWrite(name, fixed, properties, required) {
30
30
  {
31
31
  name: `${name}.prepare`,
32
32
  risk: 'read-before-write',
33
+ requiresConfirmation: true,
33
34
  auth: AUTH,
34
35
  fixed,
35
36
  inputSchema: readSchema(properties, required),
@@ -37,6 +38,7 @@ function assistantWrite(name, fixed, properties, required) {
37
38
  {
38
39
  name: `${name}.apply`,
39
40
  risk: 'high-risk-write',
41
+ requiresConfirmation: true,
40
42
  auth: AUTH,
41
43
  fixed,
42
44
  inputSchema: readSchema({ ...properties, continuation: { type: 'string', minLength: 1 }, confirm: { type: 'boolean', enum: [true] } }, [...required, 'continuation', 'confirm']),
@@ -1050,6 +1052,7 @@ export const contractOperations = [
1050
1052
  {
1051
1053
  name: 'contract.clause.reference.save.prepare',
1052
1054
  risk: 'read-before-write',
1055
+ requiresConfirmation: true,
1053
1056
  auth: AUTH,
1054
1057
  fixed: { writeMethod: 'POST', path: '/api/ebd/contract/clauseReference/saveData', referenceObjType: 1 },
1055
1058
  inputSchema: readSchema({
@@ -1063,6 +1066,7 @@ export const contractOperations = [
1063
1066
  {
1064
1067
  name: 'contract.clause.reference.save.apply',
1065
1068
  risk: 'high-risk-write',
1069
+ requiresConfirmation: true,
1066
1070
  auth: AUTH,
1067
1071
  fixed: { writeMethod: 'POST', path: '/api/ebd/contract/clauseReference/saveData', referenceObjType: 1 },
1068
1072
  inputSchema: readSchema({
@@ -1141,6 +1145,7 @@ export const contractOperations = [
1141
1145
  {
1142
1146
  name: 'contract.subject.create.prepare',
1143
1147
  risk: 'read-before-write',
1148
+ requiresConfirmation: true,
1144
1149
  auth: AUTH,
1145
1150
  fixed: {
1146
1151
  writeMethod: 'POST',
@@ -1164,6 +1169,7 @@ export const contractOperations = [
1164
1169
  {
1165
1170
  name: 'contract.subject.create.apply',
1166
1171
  risk: 'high-risk-write',
1172
+ requiresConfirmation: true,
1167
1173
  auth: AUTH,
1168
1174
  fixed: {
1169
1175
  writeMethod: 'POST',
@@ -1232,6 +1238,7 @@ export const contractOperations = [
1232
1238
  {
1233
1239
  name: 'contract.request.create.prepare',
1234
1240
  risk: 'read-before-write',
1241
+ requiresConfirmation: true,
1235
1242
  auth: AUTH,
1236
1243
  fixed: {
1237
1244
  writeMethod: 'POST',
@@ -1254,6 +1261,7 @@ export const contractOperations = [
1254
1261
  {
1255
1262
  name: 'contract.request.create.apply',
1256
1263
  risk: 'high-risk-write',
1264
+ requiresConfirmation: true,
1257
1265
  auth: AUTH,
1258
1266
  fixed: {
1259
1267
  writeMethod: 'POST',
@@ -1278,6 +1286,7 @@ export const contractOperations = [
1278
1286
  {
1279
1287
  name: 'contract.request.save.prepare',
1280
1288
  risk: 'read-before-write',
1289
+ requiresConfirmation: true,
1281
1290
  auth: AUTH,
1282
1291
  fixed: { writeMethod: 'POST', path: '/api/workflow/core/paService/v1/saveFormData', userIdField: 'userid' },
1283
1292
  inputSchema: readSchema({
@@ -1301,6 +1310,7 @@ export const contractOperations = [
1301
1310
  {
1302
1311
  name: 'contract.request.save.apply',
1303
1312
  risk: 'high-risk-write',
1313
+ requiresConfirmation: true,
1304
1314
  auth: AUTH,
1305
1315
  fixed: { writeMethod: 'POST', path: '/api/workflow/core/paService/v1/saveFormData', userIdField: 'userid' },
1306
1316
  inputSchema: readSchema({
@@ -1326,6 +1336,7 @@ export const contractOperations = [
1326
1336
  {
1327
1337
  name: 'contract.request.submit.prepare',
1328
1338
  risk: 'read-before-write',
1339
+ requiresConfirmation: true,
1329
1340
  auth: AUTH,
1330
1341
  fixed: {
1331
1342
  writeMethod: 'POST',
@@ -1347,6 +1358,7 @@ export const contractOperations = [
1347
1358
  {
1348
1359
  name: 'contract.request.submit.apply',
1349
1360
  risk: 'high-risk-write',
1361
+ requiresConfirmation: true,
1350
1362
  auth: AUTH,
1351
1363
  fixed: {
1352
1364
  writeMethod: 'POST',
@@ -1370,6 +1382,7 @@ export const contractOperations = [
1370
1382
  {
1371
1383
  name: 'contract.request.supervise.prepare',
1372
1384
  risk: 'read-before-write',
1385
+ requiresConfirmation: true,
1373
1386
  auth: AUTH,
1374
1387
  fixed: {
1375
1388
  writeMethod: 'POST',
@@ -1406,6 +1419,7 @@ export const contractOperations = [
1406
1419
  {
1407
1420
  name: 'contract.request.supervise.apply',
1408
1421
  risk: 'high-risk-write',
1422
+ requiresConfirmation: true,
1409
1423
  auth: AUTH,
1410
1424
  fixed: {
1411
1425
  writeMethod: 'POST',
@@ -1758,6 +1772,7 @@ export const contractOperations = [
1758
1772
  {
1759
1773
  name: 'contract.clause.category.create.prepare',
1760
1774
  risk: 'read-before-write',
1775
+ requiresConfirmation: true,
1761
1776
  auth: AUTH,
1762
1777
  fixed: { method: 'POST', path: '/api/ebd/contract/tree/save', requiresPermission: 'termComponent' },
1763
1778
  inputSchema: readSchema({
@@ -1771,6 +1786,7 @@ export const contractOperations = [
1771
1786
  {
1772
1787
  name: 'contract.clause.category.create.apply',
1773
1788
  risk: 'high-risk-write',
1789
+ requiresConfirmation: true,
1774
1790
  auth: AUTH,
1775
1791
  fixed: { method: 'POST', path: '/api/ebd/contract/tree/save', requiresPermission: 'termComponent' },
1776
1792
  inputSchema: readSchema({
@@ -1786,6 +1802,7 @@ export const contractOperations = [
1786
1802
  {
1787
1803
  name: 'contract.clause.category.update.prepare',
1788
1804
  risk: 'read-before-write',
1805
+ requiresConfirmation: true,
1789
1806
  auth: AUTH,
1790
1807
  fixed: { method: 'POST', path: '/api/ebd/contract/tree/update', requiresPermission: 'termComponent' },
1791
1808
  inputSchema: readSchema({
@@ -1800,6 +1817,7 @@ export const contractOperations = [
1800
1817
  {
1801
1818
  name: 'contract.clause.category.update.apply',
1802
1819
  risk: 'high-risk-write',
1820
+ requiresConfirmation: true,
1803
1821
  auth: AUTH,
1804
1822
  fixed: { method: 'POST', path: '/api/ebd/contract/tree/update', requiresPermission: 'termComponent' },
1805
1823
  inputSchema: readSchema({
@@ -1816,6 +1834,7 @@ export const contractOperations = [
1816
1834
  {
1817
1835
  name: 'contract.clause.category.delete.prepare',
1818
1836
  risk: 'read-before-write',
1837
+ requiresConfirmation: true,
1819
1838
  auth: AUTH,
1820
1839
  fixed: { method: 'POST', path: '/api/ebd/contract/tree/deletebyid', requiresPermission: 'termComponent', cascade: true },
1821
1840
  inputSchema: readSchema({ id: idString }, ['id']),
@@ -1823,6 +1842,7 @@ export const contractOperations = [
1823
1842
  {
1824
1843
  name: 'contract.clause.category.delete.apply',
1825
1844
  risk: 'high-risk-write',
1845
+ requiresConfirmation: true,
1826
1846
  auth: AUTH,
1827
1847
  fixed: { method: 'POST', path: '/api/ebd/contract/tree/deletebyid', requiresPermission: 'termComponent', cascade: true },
1828
1848
  inputSchema: readSchema({
@@ -1859,6 +1879,7 @@ export const contractOperations = [
1859
1879
  {
1860
1880
  name: 'contract.clause.create.prepare',
1861
1881
  risk: 'read-before-write',
1882
+ requiresConfirmation: true,
1862
1883
  auth: AUTH,
1863
1884
  fixed: { method: 'POST', path: '/api/ebd/contract/clauseinfo/save', requiresPermission: 'termComponent' },
1864
1885
  inputSchema: readSchema({
@@ -1878,6 +1899,7 @@ export const contractOperations = [
1878
1899
  {
1879
1900
  name: 'contract.clause.create.apply',
1880
1901
  risk: 'high-risk-write',
1902
+ requiresConfirmation: true,
1881
1903
  auth: AUTH,
1882
1904
  fixed: { method: 'POST', path: '/api/ebd/contract/clauseinfo/save', requiresPermission: 'termComponent' },
1883
1905
  inputSchema: readSchema({
@@ -1899,6 +1921,7 @@ export const contractOperations = [
1899
1921
  {
1900
1922
  name: 'contract.clause.update.prepare',
1901
1923
  risk: 'read-before-write',
1924
+ requiresConfirmation: true,
1902
1925
  auth: AUTH,
1903
1926
  fixed: { method: 'POST', path: '/api/ebd/contract/clauseinfo/update', requiresPermission: 'termComponent' },
1904
1927
  inputSchema: readSchema({
@@ -1917,6 +1940,7 @@ export const contractOperations = [
1917
1940
  {
1918
1941
  name: 'contract.clause.update.apply',
1919
1942
  risk: 'high-risk-write',
1943
+ requiresConfirmation: true,
1920
1944
  auth: AUTH,
1921
1945
  fixed: { method: 'POST', path: '/api/ebd/contract/clauseinfo/update', requiresPermission: 'termComponent' },
1922
1946
  inputSchema: readSchema({
@@ -1937,6 +1961,7 @@ export const contractOperations = [
1937
1961
  {
1938
1962
  name: 'contract.clause.delete.prepare',
1939
1963
  risk: 'read-before-write',
1964
+ requiresConfirmation: true,
1940
1965
  auth: AUTH,
1941
1966
  fixed: { method: 'POST', path: '/api/ebd/contract/clauseinfo/deletebyid', requiresPermission: 'termComponent' },
1942
1967
  inputSchema: readSchema({
@@ -1948,6 +1973,7 @@ export const contractOperations = [
1948
1973
  {
1949
1974
  name: 'contract.clause.delete.apply',
1950
1975
  risk: 'high-risk-write',
1976
+ requiresConfirmation: true,
1951
1977
  auth: AUTH,
1952
1978
  fixed: { method: 'POST', path: '/api/ebd/contract/clauseinfo/deletebyid', requiresPermission: 'termComponent' },
1953
1979
  inputSchema: readSchema({
@@ -1961,6 +1987,7 @@ export const contractOperations = [
1961
1987
  {
1962
1988
  name: 'contract.clause.group.create.prepare',
1963
1989
  risk: 'read-before-write',
1990
+ requiresConfirmation: true,
1964
1991
  auth: AUTH,
1965
1992
  fixed: { method: 'POST', path: '/api/ebd/contract/clausegroup/save', requiresPermission: 'termComponent' },
1966
1993
  inputSchema: readSchema({
@@ -1977,6 +2004,7 @@ export const contractOperations = [
1977
2004
  {
1978
2005
  name: 'contract.clause.group.create.apply',
1979
2006
  risk: 'high-risk-write',
2007
+ requiresConfirmation: true,
1980
2008
  auth: AUTH,
1981
2009
  fixed: { method: 'POST', path: '/api/ebd/contract/clausegroup/save', requiresPermission: 'termComponent' },
1982
2010
  inputSchema: readSchema({
@@ -1995,6 +2023,7 @@ export const contractOperations = [
1995
2023
  {
1996
2024
  name: 'contract.clause.group.update.prepare',
1997
2025
  risk: 'read-before-write',
2026
+ requiresConfirmation: true,
1998
2027
  auth: AUTH,
1999
2028
  fixed: { method: 'POST', path: '/api/ebd/contract/clausegroup/update', requiresPermission: 'termComponent' },
2000
2029
  inputSchema: readSchema({
@@ -2012,6 +2041,7 @@ export const contractOperations = [
2012
2041
  {
2013
2042
  name: 'contract.clause.group.update.apply',
2014
2043
  risk: 'high-risk-write',
2044
+ requiresConfirmation: true,
2015
2045
  auth: AUTH,
2016
2046
  fixed: { method: 'POST', path: '/api/ebd/contract/clausegroup/update', requiresPermission: 'termComponent' },
2017
2047
  inputSchema: readSchema({
@@ -2031,6 +2061,7 @@ export const contractOperations = [
2031
2061
  {
2032
2062
  name: 'contract.clause.group.delete.prepare',
2033
2063
  risk: 'read-before-write',
2064
+ requiresConfirmation: true,
2034
2065
  auth: AUTH,
2035
2066
  fixed: { method: 'POST', path: '/api/ebd/contract/clausegroup/deletebyid', requiresPermission: 'termComponent' },
2036
2067
  inputSchema: readSchema({
@@ -2041,6 +2072,7 @@ export const contractOperations = [
2041
2072
  {
2042
2073
  name: 'contract.clause.group.delete.apply',
2043
2074
  risk: 'high-risk-write',
2075
+ requiresConfirmation: true,
2044
2076
  auth: AUTH,
2045
2077
  fixed: { method: 'POST', path: '/api/ebd/contract/clausegroup/deletebyid', requiresPermission: 'termComponent' },
2046
2078
  inputSchema: readSchema({
@@ -19,6 +19,9 @@ export class ContractWritePrepareOperation {
19
19
  }
20
20
  async execute(input, { host, continuation }) {
21
21
  this.spec.validate?.(input);
22
+ // prepare 阶段按 apply 的口径先构造一次 body(纯本地、不发请求)。
23
+ // 必填缺失、字段格式非法都在签发票据之前就失败:否则空参调用也能换出一张「确认即写库」的 continuation。
24
+ this.spec.body(input);
22
25
  const precheck = this.spec.precheck ? await this.spec.precheck(input, host) : undefined;
23
26
  const session = await host.getSession();
24
27
  const preview = this.spec.preview(input);
@@ -1,6 +1,7 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { ExitCode, isCliError, toErrorEnvelope } from '../../core/errors.js';
3
- import { reportPlatformError } from '../../core/error-codes.js';
3
+ import { shouldReportPlatformError, toPlatformError } from '../../core/error-codes.js';
4
+ import { MANIFEST_LIST_COMPACT_PATHS, manifestView, schemaOptionsOf } from '../../core/manifest-view.js';
4
5
  import { createCoworkContinuationSigner } from './continuation.js';
5
6
  import { createCoworkHost } from './host.js';
6
7
  import { coworkManifest } from './manifest.js';
@@ -85,8 +86,15 @@ async function executeAndPrint(ctx, operation, input) {
85
86
  ctx.output.write(successEnvelope(operation, result), { json: true });
86
87
  }
87
88
  catch (error) {
88
- reportPlatformError(error);
89
- console.error(JSON.stringify(failureEnvelope(error), null, 2));
89
+ // 与 ehr 对齐(审计 CO-03 / G-06):单段 JSON、顶层带平台码,不再“一行 code + 一段信封”。
90
+ const env = failureEnvelope(error);
91
+ if (shouldReportPlatformError(error)) {
92
+ const pe = toPlatformError(error);
93
+ console.error(JSON.stringify({ ...env, code: pe.code, message: pe.message }, null, 2));
94
+ }
95
+ else {
96
+ console.error(JSON.stringify(env, null, 2));
97
+ }
90
98
  process.exitCode = isCliError(error) ? error.exitCode : ExitCode.GeneralError;
91
99
  }
92
100
  }
@@ -98,8 +106,16 @@ export const coworkShortcut = {
98
106
  const cowork = program.command('cowork').description('泛微E10协作区(协作事项/讨论/审批/共享权限)');
99
107
  cowork.command('schema')
100
108
  .description('Print cowork operation manifest for agents')
101
- .action(action((ctx) => {
102
- ctx.output.write(coworkManifest, { json: true });
109
+ .option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
110
+ .option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
111
+ .option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
112
+ .action(action((ctx, options) => {
113
+ const schema = schemaOptionsOf(options);
114
+ ctx.output.write(manifestView(coworkManifest, schema), {
115
+ json: true,
116
+ // 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
117
+ ...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
118
+ });
103
119
  }));
104
120
  cowork.command('run')
105
121
  .description('Run a cowork operation with JSON input')
@@ -48,6 +48,9 @@ export const coworkManifest = {
48
48
  sourceSkill: 'weaver-e10-cowork',
49
49
  capabilities: ['cowork'],
50
50
  operations: buildOperations(),
51
+ // 2026-11-27 审计 K-02 / G-10:schema 超预算会把 withheldOperations 一并截断,
52
+ // 首屏必须先给出总数,模型才知道"边界之外还有多少条",再看明细或按 recovery 取全量。
53
+ withheldCount: BROWSER_WITHHELD.length + PERMISSION_TABLE_WITHHELD.length + SEARCH_WITHHELD.length,
51
54
  withheldOperations: [
52
55
  ...BROWSER_WITHHELD.map((name) => ({
53
56
  name,
@@ -29,6 +29,7 @@ const discussPublishPrepare = {
29
29
  action: 'cowork.discuss.publish.prepare',
30
30
  summary: '发布/回复讨论的确认摘要:先读协作详情确认存在并解析版块 id,不写入',
31
31
  risk: READ_BEFORE_WRITE,
32
+ requiresConfirmation: true,
32
33
  inputSchema: schemaOf({
33
34
  coworkId: { ...SCHEMA_ID, description: '协作 id' },
34
35
  content: { type: 'string', maxLength: 20000, description: '讨论内容(纯文本)' },
@@ -175,6 +176,7 @@ const discussActionPrepare = {
175
176
  action: 'cowork.discuss.action.prepare',
176
177
  summary: '讨论动作摘要(top 置顶 / untop 取消置顶 / delete 删除 / approve 审批通过):在协作讨论中定位该讨论并回显内容,不写入',
177
178
  risk: READ_BEFORE_WRITE,
179
+ requiresConfirmation: true,
178
180
  inputSchema: schemaOf({
179
181
  action: { type: 'string', enum: [...DISCUSS_ACTIONS], description: 'top / untop / delete / approve' },
180
182
  coworkId: { ...SCHEMA_ID, description: '所属协作 id(用于定位讨论)' },
@@ -42,6 +42,7 @@ const itemCreatePrepare = {
42
42
  action: 'cowork.item.create.prepare',
43
43
  summary: '新建协作的确认摘要:校验版块 id 是否在本环境真实存在、负责人默认为当前用户、开关默认全开;不写入',
44
44
  risk: READ_BEFORE_WRITE,
45
+ requiresConfirmation: true,
45
46
  inputSchema: schemaOf({
46
47
  itemName: { type: 'string', maxLength: 200, description: '协作主题' },
47
48
  itemContent: { type: 'string', maxLength: 20000, description: '详细说明(纯文本或 HTML,CLI 内部按接口要求做 Base64 编码)' },
@@ -216,6 +217,7 @@ const itemActionPrepare = {
216
217
  action: 'cowork.item.action.prepare',
217
218
  summary: '协作级动作的确认摘要(当前支持 end 结束协作):先读详情校验存在与 canEnd,不写入',
218
219
  risk: READ_BEFORE_WRITE,
220
+ requiresConfirmation: true,
219
221
  inputSchema: schemaOf({
220
222
  action: { type: 'string', enum: [...ITEM_ACTIONS], description: 'end=结束协作(不可逆)' },
221
223
  id: { ...SCHEMA_ID, description: '协作 id' },
@@ -308,6 +310,7 @@ const itemFlagPrepare = {
308
310
  action: 'cowork.item.flag.prepare',
309
311
  summary: '协作标记动作摘要:hide=从我的列表隐藏 / vote=标记投票;先读详情确认协作存在,不写入',
310
312
  risk: READ_BEFORE_WRITE,
313
+ requiresConfirmation: true,
311
314
  inputSchema: schemaOf({
312
315
  action: { type: 'string', enum: [...ITEM_FLAGS], description: 'hide 隐藏 / vote 标记投票' },
313
316
  id: { ...SCHEMA_ID, description: '协作 id' },
@@ -36,6 +36,7 @@ const memberActionPrepare = {
36
36
  action: 'cowork.member.action.prepare',
37
37
  summary: '成员动作摘要:invite 邀请 / rejoin 重新加入 / join 申请加入;先读协作详情确认存在,并提示已在协作内的人员,不写入',
38
38
  risk: READ_BEFORE_WRITE,
39
+ requiresConfirmation: true,
39
40
  inputSchema: schemaOf({
40
41
  action: { type: 'string', enum: [...MEMBER_ACTIONS], description: 'invite 邀请他人 / rejoin 重新加入 / join 申请加入(我)' },
41
42
  coworkId: { ...SCHEMA_ID, description: '协作 id' },
@@ -199,6 +200,7 @@ const applyDecidePrepare = {
199
200
  action: 'cowork.apply.decide.prepare',
200
201
  summary: '加入申请审批摘要(approve 通过 / refuse 拒绝):在待审批列表中定位申请记录并回显申请人与协作主题,不写入',
201
202
  risk: READ_BEFORE_WRITE,
203
+ requiresConfirmation: true,
202
204
  inputSchema: schemaOf({
203
205
  decision: { type: 'string', enum: [...DECISIONS], description: 'approve 通过 / refuse 拒绝' },
204
206
  applyId: { ...SCHEMA_ID, description: '申请记录 id(来自 cowork.list scope=approve)' },
@@ -31,6 +31,7 @@ const permAddPrepare = {
31
31
  action: 'cowork.permission.add.prepare',
32
32
  summary: '新增共享对象的摘要:先读协作详情与现有共享权限列表,提示该人员是否已在,不写入',
33
33
  risk: READ_BEFORE_WRITE,
34
+ requiresConfirmation: true,
34
35
  inputSchema: schemaOf({
35
36
  coworkId: { ...SCHEMA_ID, description: '协作 id' },
36
37
  userId: { ...SCHEMA_ID, description: '被授权人员 id' },
@@ -175,6 +176,7 @@ const permRemovePrepare = {
175
176
  action: 'cowork.permission.remove.prepare',
176
177
  summary: '删除共享对象的摘要:先按 pkId 在共享权限列表中定位真实记录并回显,不写入',
177
178
  risk: READ_BEFORE_WRITE,
179
+ requiresConfirmation: true,
178
180
  inputSchema: schemaOf({
179
181
  coworkId: { ...SCHEMA_ID, description: '协作 id' },
180
182
  pkId: { ...SCHEMA_ID, description: '共享记录 id(来自 cowork.permission.list 的行 id)' },
@@ -69,6 +69,7 @@ function buildReviewOperations(domain) {
69
69
  action: prepareName,
70
70
  summary: `${spec.label}台的动作摘要(approve 通过 / delete 删除):先在待审列表中定位记录并回显主题,不写入`,
71
71
  risk: READ_BEFORE_WRITE,
72
+ requiresConfirmation: true,
72
73
  inputSchema: schemaOf({
73
74
  action: { type: 'string', enum: [...REVIEW_ACTIONS], description: 'approve 通过 / delete 删除' },
74
75
  id: { ...SCHEMA_ID, description: `记录 id(来自 cowork.list 的 ${domain === 'item' ? 'itemApprove' : 'discussApprove'} 列表)` },
@@ -1,22 +1,4 @@
1
1
  import { CliError, ExitCode } from '../../core/errors.js';
2
- /**
3
- * data 模块的错误类型。
4
- *
5
- * 退出码沿用 e10-data 的既有语义(技能侧按退出码分流,不能改):
6
- * 0 正常(**空结果也算正常**)|2 未登录·凭据失效|3 非 JSON·confAttrs 异常
7
- * 4 权限受限(hasSearchRight=false,终端态)|6 命中 HRM 路径黑名单|7 请求失败|8 用法错误
8
- * 映射到框架的 ExitCode:2→UsageError、3→AuthError、4→PolicyError、6→PolicyError、
9
- * 7→NetworkError、8→UsageError。**退出码数值本身必须与旧版一致**,因此这里直接使用数值。
10
- */
11
- export const DataExit = {
12
- OK: 0,
13
- AUTH: 2,
14
- JSON: 3,
15
- PERM: 4,
16
- HRM: 6,
17
- HTTP: 7,
18
- USAGE: 8,
19
- };
20
2
  export class DataCliError extends CliError {
21
3
  type;
22
4
  subtype;
@@ -25,7 +7,7 @@ export class DataCliError extends CliError {
25
7
  stage;
26
8
  details;
27
9
  constructor(type, subtype, message, options = {}) {
28
- super(message, options.exitCode ?? ExitCode.GeneralError);
10
+ super(message, options.exitCode ?? ExitCode.InternalError);
29
11
  this.name = 'DataCliError';
30
12
  this.type = type;
31
13
  this.subtype = subtype;
@@ -35,30 +17,35 @@ export class DataCliError extends CliError {
35
17
  this.details = options.details;
36
18
  }
37
19
  }
38
- export function dataValidationError(subtype, message, exitCode = DataExit.USAGE) {
39
- return new DataCliError('validation', subtype, message, { exitCode });
20
+ export function dataValidationError(subtype, message, details) {
21
+ return new DataCliError('validation', subtype, message, { exitCode: ExitCode.UsageError, details });
40
22
  }
41
23
  export function dataAuthError(subtype, message, details) {
42
- return new DataCliError('authentication', subtype, message, { exitCode: DataExit.AUTH, details });
24
+ return new DataCliError('authentication', subtype, message, { exitCode: ExitCode.AuthError, details });
43
25
  }
44
- export function dataNetworkError(subtype, message, details) {
45
- return new DataCliError('network', subtype, message, { exitCode: DataExit.HTTP, retryable: true, details });
26
+ export function dataNetworkError(subtype, message, options = {}) {
27
+ return new DataCliError('network', subtype, message, {
28
+ ...options,
29
+ retryable: options.retryable ?? true,
30
+ exitCode: ExitCode.NetworkError,
31
+ });
46
32
  }
47
33
  export function dataApiError(subtype, message, options = {}) {
48
34
  return new DataCliError('api', subtype, message, {
49
35
  code: options.code,
50
36
  details: options.details,
51
- exitCode: options.exitCode ?? DataExit.JSON,
37
+ stage: options.stage,
38
+ exitCode: ExitCode.GeneralError,
52
39
  });
53
40
  }
54
41
  export function dataPolicyError(subtype, message, details) {
55
- return new DataCliError('policy', subtype, message, { exitCode: DataExit.PERM, details });
42
+ return new DataCliError('policy', subtype, message, { exitCode: ExitCode.PolicyError, details });
56
43
  }
57
44
  /** 权限受限是「终端态」:结果照常给,但退出码必须非 0(对齐 call_module.py)。 */
58
- export function dataPermissionBlocked(message) {
59
- return new DataCliError('policy', 'permission_restricted', message, { exitCode: DataExit.PERM });
45
+ export function dataPermissionBlocked(message, details) {
46
+ return dataPolicyError('permission_restricted', message, details);
60
47
  }
61
48
  /** HRM 路径黑名单:人员/部门/岗位一律走 `weaver-work-cli hrm`,禁止在 data 通道直调。 */
62
49
  export function dataHrmBlocked(apiPath) {
63
- return new DataCliError('policy', 'hrm_path_blocked', `该接口命中 HRM 路径黑名单(${apiPath})→ 人员/部门/岗位一律走 weaver-work-cli 的 hrm 子命令,禁止直调`, { exitCode: DataExit.HRM, details: { apiPath } });
50
+ return new DataCliError('policy', 'hrm_path_blocked', `该接口命中 HRM 路径黑名单(${apiPath})→ 人员/部门/岗位一律走 weaver-work-cli 的 hrm 子命令,禁止直调`, { exitCode: ExitCode.PolicyError, details: { apiPath } });
64
51
  }
@@ -94,8 +94,12 @@ export function createDataHost(ctx, dependencies = {}) {
94
94
  if (error instanceof E10ApiError) {
95
95
  if (error.type === 'authentication')
96
96
  throw dataAuthError('session_expired', error.message);
97
- if (error.type === 'network')
98
- throw dataNetworkError(error.subtype, error.message, error.details);
97
+ if (error.type === 'network') {
98
+ throw dataNetworkError(error.subtype, error.message, {
99
+ retryable: error.retryable,
100
+ details: error.details,
101
+ });
102
+ }
99
103
  }
100
104
  throw error;
101
105
  }
@@ -108,7 +112,7 @@ export function createDataHost(ctx, dependencies = {}) {
108
112
  return { status: response.status, text: response.text, value: null };
109
113
  }
110
114
  throw dataNetworkError('non_json', `HTTP ${response.status} 非 JSON 响应: ${response.text.slice(0, 300)}`, {
111
- status: response.status,
115
+ details: { httpStatus: response.status, preview: response.text.slice(0, 300) },
112
116
  });
113
117
  }
114
118
  return { status: response.status, text: response.text, value: response.value };
@@ -116,10 +120,15 @@ export function createDataHost(ctx, dependencies = {}) {
116
120
  async function request(request) {
117
121
  const { status, value, text } = await requestText(request);
118
122
  if (status < 200 || status >= 300) {
119
- throw dataApiError('http_error', `接口 HTTP ${status}`, {
123
+ throw dataNetworkError('http_error', `接口 HTTP ${status}`, {
124
+ retryable: status >= 500,
120
125
  code: status,
121
- details: { status, body: String(text ?? '').slice(0, 500) },
122
- exitCode: 7,
126
+ details: { httpStatus: status, body: String(text ?? '').slice(0, 500) },
127
+ });
128
+ }
129
+ if (value === null) {
130
+ throw dataApiError('non_json', `HTTP ${status} 返回非 JSON 响应`, {
131
+ details: { httpStatus: status, preview: String(text ?? '').slice(0, 500) },
123
132
  });
124
133
  }
125
134
  return value;
@@ -130,7 +139,7 @@ export function createDataHost(ctx, dependencies = {}) {
130
139
  }
131
140
  return { session, request, requestText };
132
141
  }
133
- /** 参数校验小工具:必填项缺失统一走用法错误(退出码 8)。 */
142
+ /** 参数校验小工具:必填项缺失统一走框架 UsageError(退出码 2)。 */
134
143
  export function needArg(input, key, flag) {
135
144
  const raw = input[key];
136
145
  if (raw === undefined || raw === null || raw === '' || raw === true) {
@@ -1,4 +1,5 @@
1
1
  import { readFile } from 'node:fs/promises';
2
+ import { MANIFEST_LIST_COMPACT_PATHS, manifestView, schemaOptionsOf } from '../../core/manifest-view.js';
2
3
  import { createDataHost } from './host.js';
3
4
  import { dataManifest } from './manifest.js';
4
5
  import { dataValidationError } from './errors.js';
@@ -90,8 +91,17 @@ export const dataShortcut = {
90
91
  const data = program.command('data').description('泛微E10数据助手(DSL 查询 / 数据源发现 / 配置中心 / 场景定位)');
91
92
  data.command('schema')
92
93
  .description('Print data operation manifest for agents')
93
- .action(action((ctx) => {
94
- ctx.output.write(dataManifest, { json: true, persist: false });
94
+ .option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
95
+ .option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
96
+ .option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
97
+ .action(action((ctx, options) => {
98
+ const schema = schemaOptionsOf(options);
99
+ // 不再用 `persist: false`:关掉落盘等于超预算时只能静默精简,而宿主会先按自己的上限截断,
100
+ // 模型拿到的是残缺 JSON(parse 失败),比"预览 + ref 可恢复"更难排查。
101
+ ctx.output.write(manifestView(dataManifest, schema), {
102
+ json: true,
103
+ ...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
104
+ });
95
105
  }));
96
106
  data.command('run')
97
107
  .description('Run a data operation with JSON input')
@@ -329,45 +339,6 @@ export const dataShortcut = {
329
339
  .action(action(async (ctx, path, options) => {
330
340
  await run(ctx, 'data.conf.resolve-file', { ...toInput(options), path }, false);
331
341
  }));
332
- conf.command('add')
333
- .description('新增配置(已存在默认跳过)')
334
- .argument('<key>', 'confKey')
335
- .option('--value <v>', '配置值')
336
- .option('--name <n>', '配置名称')
337
- .option('--attrs <json>', 'confAttrs')
338
- .option('--type <confType>', 'confType')
339
- .option('--group <confGroup>', 'confGroup')
340
- .option('--force', '已存在时也重建')
341
- .action(action(async (ctx, key, options) => {
342
- await run(ctx, 'data.conf.add', { ...toInput(options), keys: [key] }, false);
343
- }));
344
- conf.command('add-file')
345
- .description('按文件批量新增配置')
346
- .argument('<file>', 'JSON 文件')
347
- .option('--type <confType>', 'confType')
348
- .option('--group <confGroup>', 'confGroup')
349
- .action(action(async (ctx, file, options) => {
350
- await run(ctx, 'data.conf.add-file', { ...toInput(options), add_file: file }, false);
351
- }));
352
- conf.command('update')
353
- .description('更新配置的 value / name / attrs')
354
- .argument('<key>', 'confKey')
355
- .option('--value <v>', '配置值')
356
- .option('--name <n>', '配置名称')
357
- .option('--attrs <json>', 'confAttrs')
358
- .option('--type <confType>', 'confType')
359
- .option('--group <confGroup>', 'confGroup')
360
- .action(action(async (ctx, key, options) => {
361
- await run(ctx, 'data.conf.update', { ...toInput(options), keys: [key] }, false);
362
- }));
363
- conf.command('delete')
364
- .description('删除配置')
365
- .argument('<key>', 'confKey')
366
- .option('--type <confType>', 'confType')
367
- .option('--group <confGroup>', 'confGroup')
368
- .action(action(async (ctx, key, options) => {
369
- await run(ctx, 'data.conf.delete', { ...toInput(options), keys: [key] }, false);
370
- }));
371
342
  // ---------------------------------------------------------------- scene
372
343
  const scene = data.command('scene').description('场景定位元数据(getSceneGroups)');
373
344
  scene.command('groups')