weaver-work-cli 0.1.70 → 0.1.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) 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-DMU7KNZ7.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-KDOJW5LH.js → chunk-EJLP63UO.js} +1 -1
  15. package/dist/chunks/{chunk-HAORST2G.js → chunk-FRMDHZSN.js} +11 -11
  16. package/dist/chunks/{chunk-GWM5TLIK.js → chunk-G7ZM2VOX.js} +34 -34
  17. package/dist/chunks/{chunk-LSVA7QA6.js → chunk-GB2MCJPG.js} +3 -1
  18. package/dist/chunks/{chunk-L2A3COWV.js → chunk-ICNUOWLL.js} +4 -4
  19. package/dist/chunks/{chunk-GTAFCAVP.js → chunk-IZCQU5D5.js} +1 -1
  20. package/dist/chunks/{chunk-7CINV2BU.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-X6PMJQGO.js → chunk-OFCF23FY.js} +6 -6
  24. package/dist/chunks/{chunk-IVCOZCAW.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-LJE7RZNC.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-XIBMZEDB.js → chunk-VJWVB55R.js} +2 -2
  32. package/dist/chunks/{chunk-EHH363SP.js → chunk-VMVMEIL3.js} +4 -4
  33. package/dist/chunks/chunk-WM33BSIL.js +136 -0
  34. package/dist/chunks/{chunk-GFOFUH6O.js → chunk-X2C5CGGM.js} +52 -51
  35. package/dist/chunks/{chunk-4W6BSNIL.js → chunk-XLSJC6JZ.js} +6 -6
  36. package/dist/chunks/{chunk-U3OO3IZF.js → chunk-YN5SD4TX.js} +20 -7
  37. package/dist/chunks/{conflict-YW5BULJ3.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-5OBS3B3V.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-L65OWPFM.js → entry-mode-6N2IGCS4.js} +3 -3
  45. package/dist/chunks/{env-XW7LYIME.js → env-QYLS3EB3.js} +2 -2
  46. package/dist/chunks/{esb-GSB5QCEX.js → esb-PTYS3E67.js} +17 -7
  47. package/dist/chunks/{factory-MHFZZAGH.js → factory-LPFPKZ4T.js} +1 -1
  48. package/dist/chunks/{fna-XBSNUS2V.js → fna-JNHCLRDE.js} +15 -5
  49. package/dist/chunks/{group-chat-EEOLO5NM.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-JCBUR563.js → jiuchuanhui-PTABJE7V.js} +19 -6
  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-PCD5EPBF.js → meeting-NIDHDBCB.js} +29 -16
  63. package/dist/chunks/{minute-doc-WTZJVCHG.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-SMVTPK6T.js → performance-3MQ3AHDQ.js} +92 -7
  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-ZQ7OONCB.js → registry-3GQRYP2R.js} +12 -12
  73. package/dist/chunks/{registry-3B3OAJYX.js → registry-3S7AVMXR.js} +4 -4
  74. package/dist/chunks/{registry-FTPUUHWC.js → registry-NHHKOEU3.js} +5 -5
  75. package/dist/chunks/{room-recommend-73NBN3RU.js → room-recommend-IOKBJVYP.js} +4 -4
  76. package/dist/chunks/{schedule-SDBOBBUQ.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-OWHWLAOX.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/index.js +15 -1
  140. package/dist/shortcuts/jiuchuanhui/manifest.js +2 -0
  141. package/dist/shortcuts/mail/errors.js +14 -0
  142. package/dist/shortcuts/mail/index.js +23 -6
  143. package/dist/shortcuts/mail/manifest.js +11 -4
  144. package/dist/shortcuts/mail/operations/mail-blacklist.js +6 -6
  145. package/dist/shortcuts/mail/operations/mail-contacts.js +10 -10
  146. package/dist/shortcuts/mail/operations/mail-manage.js +15 -14
  147. package/dist/shortcuts/mail/operations/mail-read.js +7 -25
  148. package/dist/shortcuts/mail/operations/mail-send.js +12 -12
  149. package/dist/shortcuts/mail/operations/mail-sign.js +10 -10
  150. package/dist/shortcuts/mail/operations/mail-template.js +10 -10
  151. package/dist/shortcuts/meeting/index.js +11 -2
  152. package/dist/shortcuts/meeting/operations/invitation-publish.js +1 -0
  153. package/dist/shortcuts/okr/index.js +11 -2
  154. package/dist/shortcuts/performance/index.js +62 -3
  155. package/dist/shortcuts/performance/scheme-validate.js +7 -0
  156. package/dist/shortcuts/performance/shared.js +40 -2
  157. package/dist/shortcuts/plan/index.js +11 -2
  158. package/dist/shortcuts/project/index.js +11 -2
  159. package/dist/shortcuts/project/operations/write.js +3 -0
  160. package/dist/shortcuts/reception/index.js +11 -2
  161. package/dist/shortcuts/reception/manifest.js +2 -2
  162. package/dist/shortcuts/reception/operations/ask.js +3 -0
  163. package/dist/shortcuts/recruit-stage/index.js +22 -3
  164. package/dist/shortcuts/recruit-stage/manifest.js +2 -0
  165. package/dist/shortcuts/recruit-stage/operations/jd-create.js +33 -16
  166. package/dist/shortcuts/recruit-stage/operations/profile.js +186 -0
  167. package/dist/shortcuts/recruit-stage/operations/registry.js +2 -0
  168. package/dist/shortcuts/recruit-stage/operations/resume-import.js +76 -47
  169. package/dist/shortcuts/recruit-stage/operations/search.js +151 -16
  170. package/dist/shortcuts/recruit-stage/operations/tag.js +17 -3
  171. package/dist/shortcuts/recruit-stage/shared.js +11 -1
  172. package/dist/shortcuts/smart-extract/index.js +11 -2
  173. package/dist/shortcuts/smart-extract/manifest.js +1 -0
  174. package/dist/shortcuts/smart-extract/operations/save.js +2 -0
  175. package/dist/shortcuts/workflow/index.js +21 -1
  176. package/dist/shortcuts/workflow/operations/read.js +2 -2
  177. package/dist/shortcuts/workflow/operations/write.js +1 -1
  178. package/docs/caizhilian.md +1 -1
  179. package/docs/contract.md +1 -0
  180. package/docs/data.md +22 -22
  181. package/docs/e10-auth.md +41 -33
  182. package/docs/ehr.md +2 -0
  183. package/docs/reception.md +4 -3
  184. package/package.json +1 -1
  185. package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
  186. package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
  187. package/scripts/pysite/sitecustomize.py +41 -0
  188. package/skill-template/domains/data.md +4 -4
  189. package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
  190. package/skills/weaver-e10-caizhilian/references/org-browser.md +1 -0
  191. package/skills/weaver-e10-cowork/SKILL.md +3 -1
  192. package/skills/weaver-e10-data/SKILL.md +12 -16
  193. package/skills/weaver-e10-data/references/config-center.md +6 -7
  194. package/skills/weaver-e10-data/references/datasource.md +1 -1
  195. package/skills/weaver-e10-data/references/scene-and-misc.md +2 -2
  196. package/skills/weaver-e10-jiuchuanhui/SKILL.md +6 -4
  197. package/skills/weaver-e10-jiuchuanhui/references/clue.md +2 -2
  198. package/skills/weaver-e10-jiuchuanhui/references/customer.md +18 -8
  199. package/skills/weaver-e10-jiuchuanhui/references/sale.md +2 -2
  200. package/skills/weaver-e10-jucailin/references/attend-write.md +1 -1
  201. package/skills/weaver-e10-mail/SKILL.md +4 -1
  202. package/skills/weaver-e10-mail/references/mail-read.md +4 -2
  203. package/skills/weaver-e10-mail/references/safety-boundaries.md +1 -0
  204. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  205. package/skills/weaver-e10-performance/SKILL.md +8 -6
  206. package/skills/weaver-e10-recruit-stage/SKILL.md +125 -20
  207. package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +359 -0
  208. package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +87 -0
  209. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +9 -2
  210. package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +1 -0
  211. package/skills/weaver-e10-recruit-stage/templates/match-report.html +177 -0
  212. package/skills/weaver-e10-shared/SKILL.md +22 -1
  213. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +2 -2
  214. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
@@ -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 { createAssetIdleHost } from './host.js';
5
6
  import { assetIdleManifest } from './manifest.js';
6
7
  import { executeAssetIdleOperation } from './operations.js';
@@ -100,8 +101,16 @@ export const assetIdleShortcut = {
100
101
  assetIdle
101
102
  .command('schema')
102
103
  .description('Print asset-idle operation manifest for agents')
103
- .action(action((ctx) => {
104
- ctx.output.write(assetIdleManifest, { json: true });
104
+ .option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
105
+ .option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
106
+ .option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
107
+ .action(action((ctx, options) => {
108
+ const schema = schemaOptionsOf(options);
109
+ ctx.output.write(manifestView(assetIdleManifest, schema), {
110
+ json: true,
111
+ // 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
112
+ ...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
113
+ });
105
114
  }));
106
115
  assetIdle
107
116
  .command('run')
@@ -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 { createBlogContinuationSigner } from './continuation.js';
5
6
  import { blogValidationError } from './errors.js';
6
7
  import { createBlogHost } from './host.js';
@@ -115,8 +116,16 @@ export const blogShortcut = {
115
116
  const blog = program.command('blog').description('E10 工作日报(查询/发布/编辑/评论/点赞/提醒/导出)');
116
117
  blog.command('schema')
117
118
  .description('Print blog operation manifest for agents')
118
- .action(action((ctx) => {
119
- ctx.output.write(blogManifest, { json: true });
119
+ .option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
120
+ .option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
121
+ .option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
122
+ .action(action((ctx, options) => {
123
+ const schema = schemaOptionsOf(options);
124
+ ctx.output.write(manifestView(blogManifest, schema), {
125
+ json: true,
126
+ // 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
127
+ ...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
128
+ });
120
129
  }));
121
130
  withJsonInputOptions(blog.command('run')
122
131
  .description('Run a blog operation with JSON input')
@@ -172,6 +172,7 @@ export const blogOperations = [
172
172
  {
173
173
  name: 'blog.publish.prepare',
174
174
  risk: 'read-before-write',
175
+ requiresConfirmation: true,
175
176
  summary: '发布准备:查当日是否已有日报 + 回填默认共享 + 签发 continuation(不写数据)',
176
177
  inputSchema: {
177
178
  type: 'object',
@@ -195,6 +196,7 @@ export const blogOperations = [
195
196
  {
196
197
  name: 'blog.publish.apply',
197
198
  risk: 'high-risk-write',
199
+ requiresConfirmation: true,
198
200
  summary: '发布落库:校验 continuation 与写前状态后调用 addBlog,并回查验证',
199
201
  inputSchema: CONFIRM_SCHEMA,
200
202
  missingExamples: [
@@ -208,6 +210,7 @@ export const blogOperations = [
208
210
  {
209
211
  name: 'blog.edit.prepare',
210
212
  risk: 'read-before-write',
213
+ requiresConfirmation: true,
211
214
  summary: '编辑准备:回查原内容与差异 + 目标指纹 + 签发 continuation(不写数据)',
212
215
  inputSchema: {
213
216
  type: 'object',
@@ -232,6 +235,7 @@ export const blogOperations = [
232
235
  {
233
236
  name: 'blog.edit.apply',
234
237
  risk: 'high-risk-write',
238
+ requiresConfirmation: true,
235
239
  summary: '编辑落库:目标指纹校验后调用 updateBlog,并回查内容一致性',
236
240
  inputSchema: CONFIRM_SCHEMA,
237
241
  missingExamples: [
@@ -245,6 +249,7 @@ export const blogOperations = [
245
249
  {
246
250
  name: 'blog.comment.prepare',
247
251
  risk: 'read-before-write',
252
+ requiresConfirmation: true,
248
253
  summary: '评论准备:定位目标日报(blog_id 或 date+user)后签发 continuation',
249
254
  inputSchema: {
250
255
  type: 'object',
@@ -271,6 +276,7 @@ export const blogOperations = [
271
276
  {
272
277
  name: 'blog.comment.apply',
273
278
  risk: 'high-risk-write',
279
+ requiresConfirmation: true,
274
280
  summary: '评论落库:createComment 后从评论列表回查该评论',
275
281
  inputSchema: CONFIRM_SCHEMA,
276
282
  missingExamples: [
@@ -284,6 +290,7 @@ export const blogOperations = [
284
290
  {
285
291
  name: 'blog.like.prepare',
286
292
  risk: 'read-before-write',
293
+ requiresConfirmation: true,
287
294
  summary: '点赞/取消点赞准备:定位目标日报后签发 continuation',
288
295
  inputSchema: {
289
296
  type: 'object',
@@ -309,6 +316,7 @@ export const blogOperations = [
309
316
  {
310
317
  name: 'blog.like.apply',
311
318
  risk: 'high-risk-write',
319
+ requiresConfirmation: true,
312
320
  summary: '点赞落库:vote / cancelVote,以业务码为生效依据(无只读回查接口)',
313
321
  inputSchema: CONFIRM_SCHEMA,
314
322
  missingExamples: [
@@ -322,6 +330,7 @@ export const blogOperations = [
322
330
  {
323
331
  name: 'blog.remind.prepare',
324
332
  risk: 'read-before-write',
333
+ requiresConfirmation: true,
325
334
  summary: '提醒准备:解析被提醒人 + 生成默认文案 + 签发 continuation(不发送)',
326
335
  inputSchema: {
327
336
  type: 'object',
@@ -366,6 +375,7 @@ export const blogOperations = [
366
375
  {
367
376
  name: 'blog.remind.apply',
368
377
  risk: 'high-risk-write',
378
+ requiresConfirmation: true,
369
379
  summary: '提醒落库:逐人 POST sendUrge;部分失败返回 PARTIAL,中断返回 write_uncertain',
370
380
  inputSchema: CONFIRM_SCHEMA,
371
381
  missingExamples: [
@@ -30,15 +30,29 @@ export function isCaizhilianBusinessSuccess(value) {
30
30
  return value.status;
31
31
  return false;
32
32
  }
33
+ /** 服务端响应无可读文案时的兜底 message(调用方按引用判定「服务端没给文案」)。 */
34
+ export const CAIZHILIAN_BUSINESS_FALLBACK_MESSAGE = '采知连接口返回业务失败';
35
+ /** 错误信封 details.raw:服务端原始响应体摘要(截断 2 KB),供调用方自助排障。 */
36
+ function rawErrorBody(value) {
37
+ if (value === undefined || value === null)
38
+ return undefined;
39
+ try {
40
+ const text = typeof value === 'string' ? value : JSON.stringify(value);
41
+ return text.length > 2048 ? `${text.slice(0, 2048)}…` : text;
42
+ }
43
+ catch {
44
+ return undefined;
45
+ }
46
+ }
33
47
  export function caizhilianBusinessMessage(value) {
34
48
  if (!value || typeof value !== 'object')
35
- return '采知连接口返回业务失败';
49
+ return CAIZHILIAN_BUSINESS_FALLBACK_MESSAGE;
36
50
  const candidates = [value.msg, value.message, value.errMsg, value.data?.msg, value.data?.message];
37
51
  for (const item of candidates) {
38
52
  if (typeof item === 'string' && item.trim())
39
53
  return item;
40
54
  }
41
- return '采知连接口返回业务失败';
55
+ return CAIZHILIAN_BUSINESS_FALLBACK_MESSAGE;
42
56
  }
43
57
  function caizhilianBusinessCode(value) {
44
58
  if (!value || typeof value !== 'object')
@@ -167,16 +181,18 @@ export function createCaizhilianHost(ctx, dependencies = {}) {
167
181
  throw caizhilianNetworkError('protocol', `接口返回不是合法 JSON(HTTP ${response.status})`, { retryable: false });
168
182
  }
169
183
  if (response.status < 200 || response.status >= 300 || (request.requireHttp200 && response.status !== 200)) {
184
+ const raw = rawErrorBody(response.value);
170
185
  throw new CaizhilianCliError('api', 'http_error', `采知连接口 HTTP ${response.status}`, {
171
186
  code: response.status,
172
- details: { status: response.status, message: caizhilianBusinessMessage(response.value) },
187
+ details: { status: response.status, message: caizhilianBusinessMessage(response.value), ...(raw === undefined ? {} : { raw }) },
173
188
  exitCode: 1,
174
189
  });
175
190
  }
176
191
  if (!request.tolerateBusinessError && !isCaizhilianBusinessSuccess(response.value)) {
192
+ const raw = rawErrorBody(response.value);
177
193
  throw new CaizhilianCliError('api', 'business_error', caizhilianBusinessMessage(response.value), {
178
194
  code: caizhilianBusinessCode(response.value),
179
- details: { code: caizhilianBusinessCode(response.value), message: caizhilianBusinessMessage(response.value) },
195
+ details: { code: caizhilianBusinessCode(response.value), message: caizhilianBusinessMessage(response.value), ...(raw === undefined ? {} : { raw }) },
180
196
  exitCode: 1,
181
197
  });
182
198
  }
@@ -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 { createCaizhilianContinuationSigner } from './continuation.js';
5
6
  import { caizhilianValidationError } from './errors.js';
6
7
  import { createCaizhilianHost } from './host.js';
@@ -115,6 +116,7 @@ function operationsCatalog() {
115
116
  sourceSkill: caizhilianManifest.sourceSkill,
116
117
  total: caizhilianOperationDefinitions().length,
117
118
  groups: [...groups.entries()].map(([resource, operations]) => ({ resource, operations })),
119
+ withheldCount: caizhilianManifest.withheldCount,
118
120
  withheldOperations: caizhilianManifest.withheldOperations,
119
121
  };
120
122
  }
@@ -134,8 +136,16 @@ export const caizhilianShortcut = {
134
136
  caizhilian
135
137
  .command('schema')
136
138
  .description('Print caizhilian operation manifest for agents')
137
- .action(action((ctx) => {
138
- ctx.output.write(caizhilianManifest, { json: true });
139
+ .option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
140
+ .option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
141
+ .option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
142
+ .action(action((ctx, options) => {
143
+ const schema = schemaOptionsOf(options);
144
+ ctx.output.write(manifestView(caizhilianManifest, schema), {
145
+ json: true,
146
+ // 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
147
+ ...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
148
+ });
139
149
  }));
140
150
  caizhilian
141
151
  .command('operations')
@@ -1,27 +1,5 @@
1
- import { caizhilianOperationContracts } from './operations/registry.js';
2
- /**
3
- * 禁用边界:源 Skill 的 64 个 operation 中,4 个属于「本地多环境配置」能力,
4
- * 在 weaver-work-cli 里由框架层统一承担(config / e10 auth),模块 CLI 不重复实现,
5
- * 因此不进入 operations,仅在此显式声明,避免 Agent 误以为能力缺失。
6
- */
7
- const WITHHELD = [
8
- {
9
- name: 'caizhilian.system.list-systems',
10
- reason: '源 list_systems 读取的是 Skill 自带 assets/config.json 的多环境配置与登录态;weaver-work-cli 的环境与登录态由框架统一管理,请用 `weaver-work-cli config list` 与 `weaver-work-cli auth status` 查看,连通性自检用 caizhilian.system.health。',
11
- },
12
- {
13
- name: 'caizhilian.system.get-loaded-config',
14
- reason: '源 get_loaded_config 会输出 Skill 本地 config.json 的生效内容(含 cookies 掩码、下载目录等);CLI 侧等价信息来自框架配置,请用 `weaver-work-cli config list`,不在业务模块内暴露配置快照。',
15
- },
16
- {
17
- name: 'caizhilian.system.reload-config',
18
- reason: '源 reload_config 重新加载 Skill 本地 config.json;CLI 每次进程启动即读取框架配置,无进程内缓存需要刷新,故不提供该操作。',
19
- },
20
- {
21
- name: 'caizhilian.system.switch-config',
22
- reason: '源 switch_config 在 Skill 本地多套环境配置间切换;CLI 的环境与认证配置体系负责这一职责,业务模块不做环境切换。',
23
- },
24
- ];
1
+ import { caizhilianOperationContracts, caizhilianWithheldOperations } from './operations/registry.js';
2
+ /** 4 个本地配置类 operation 的禁用声明与理由见 operations/registry.ts 的 caizhilianWithheldOperations。 */
25
3
  function buildOperations() {
26
4
  return caizhilianOperationContracts();
27
5
  }
@@ -35,7 +13,8 @@ export const caizhilianManifest = {
35
13
  sourceSkill: 'weaver-e10-caizhilian',
36
14
  capabilities: ['caizhilian'],
37
15
  operations: buildOperations(),
38
- withheldOperations: WITHHELD,
16
+ withheldCount: caizhilianWithheldOperations.length,
17
+ withheldOperations: caizhilianWithheldOperations,
39
18
  };
40
19
  export function hasCaizhilianManifestOperation(operation) {
41
20
  return caizhilianManifest.operations.some((item) => item.name === operation);
@@ -1,4 +1,6 @@
1
1
  import { hasNextPage, optionalId, optionalText, parsePage, resolveTimeRange, toBoolean, } from '../shared.js';
2
+ import { CaizhilianCliError } from '../../errors.js';
3
+ import { CAIZHILIAN_BUSINESS_FALLBACK_MESSAGE } from '../../host.js';
2
4
  import { caizhilianSuccess } from '../types.js';
3
5
  /**
4
6
  * 检索类只读操作(1:1 对应源 scripts/search_plugins.py 的 10 个 plugin
@@ -156,6 +158,35 @@ async function searchVirtualFolders(args, env) {
156
158
  folders,
157
159
  });
158
160
  }
161
+ /** 服务端裸失败信封(实测签名 {code:500,status:false,fail:true},无任何错误文案)。 */
162
+ function isBareServerFail(raw) {
163
+ if (typeof raw !== 'string')
164
+ return false;
165
+ try {
166
+ const parsed = JSON.parse(raw);
167
+ return isRecord(parsed) && parsed.code === 500 && parsed.status === false && parsed.fail === true;
168
+ }
169
+ catch {
170
+ return false;
171
+ }
172
+ }
173
+ /**
174
+ * 裸失败信封且服务端无文案时,用操作自带的业务提示替换 message(code/details 原样保留)。
175
+ * 服务端有可读文案时一律透传,不做归因替换。
176
+ */
177
+ function applyBusinessErrorMessage(error, businessErrorMessage) {
178
+ if (!businessErrorMessage || !(error instanceof CaizhilianCliError))
179
+ return error;
180
+ if (error.subtype !== 'business_error')
181
+ return error;
182
+ if (error.message !== CAIZHILIAN_BUSINESS_FALLBACK_MESSAGE)
183
+ return error;
184
+ const raw = error.details?.raw;
185
+ if (!isBareServerFail(raw))
186
+ return error;
187
+ error.message = businessErrorMessage;
188
+ return error;
189
+ }
159
190
  function browserSearch(config) {
160
191
  return async (args, env) => {
161
192
  const { pageNo, pageSize } = parsePage(args, 50);
@@ -177,6 +208,8 @@ function browserSearch(config) {
177
208
  path: config.path,
178
209
  body,
179
210
  operation: config.action,
211
+ }).catch((error) => {
212
+ throw applyBusinessErrorMessage(error, config.businessErrorMessage);
180
213
  });
181
214
  const items = nestedList(response, 'data', 'data');
182
215
  return caizhilianSuccess(config.action, {
@@ -226,6 +259,7 @@ const subcompanySearch = browserSearch({
226
259
  resultKey: 'subcompanies',
227
260
  head: { browserMultiple: true, virtualType: 'ALL', cmd: 'list' },
228
261
  tail: { stopDepartment: false },
262
+ businessErrorMessage: '本租户未开通分部功能',
229
263
  mapItem: (item) => ({
230
264
  id: String(item.id ?? ''),
231
265
  name: item.name ?? '',
@@ -14,6 +14,29 @@ import { caizhilianSettingStorageHandlers } from './handlers/setting-storage.js'
14
14
  import { caizhilianSystemHandlers } from './handlers/system.js';
15
15
  import { caizhilianOperationSpecs } from './specs.js';
16
16
  import { applySchemaOf, isWriteHandler } from './types.js';
17
+ /**
18
+ * 禁用边界:源 Skill 的 64 个 operation 中,4 个属于「本地多环境配置」能力,
19
+ * 在 weaver-work-cli 里由框架层统一承担(config / e10 auth),模块 CLI 不重复实现,
20
+ * 因此不进入 operations,仅在此显式声明,避免 Agent 误以为能力缺失。
21
+ */
22
+ export const caizhilianWithheldOperations = [
23
+ {
24
+ name: 'caizhilian.system.list-systems',
25
+ reason: '源 list_systems 读取的是 Skill 自带 assets/config.json 的多环境配置与登录态;weaver-work-cli 的环境与登录态由框架统一管理,请用 `weaver-work-cli config list` 与 `weaver-work-cli auth status` 查看,连通性自检用 caizhilian.system.health。',
26
+ },
27
+ {
28
+ name: 'caizhilian.system.get-loaded-config',
29
+ reason: '源 get_loaded_config 会输出 Skill 本地 config.json 的生效内容(含 cookies 掩码、下载目录等);CLI 侧等价信息来自框架配置,请用 `weaver-work-cli config list`,不在业务模块内暴露配置快照。',
30
+ },
31
+ {
32
+ name: 'caizhilian.system.reload-config',
33
+ reason: '源 reload_config 重新加载 Skill 本地 config.json;CLI 每次进程启动即读取框架配置,无进程内缓存需要刷新,故不提供该操作。',
34
+ },
35
+ {
36
+ name: 'caizhilian.system.switch-config',
37
+ reason: '源 switch_config 在 Skill 本地多套环境配置间切换;CLI 的环境与认证配置体系负责这一职责,业务模块不做环境切换。',
38
+ },
39
+ ];
17
40
  /**
18
41
  * 操作注册表:specs.ts 提供 WHAT(name/resource/risk/inputSchema),
19
42
  * handlers/*.ts 提供 HOW(execute 或 prepare/apply)。
@@ -132,7 +155,8 @@ export function caizhilianOperationDefinitions() {
132
155
  export function getCaizhilianOperation(operation) {
133
156
  const definition = caizhilianRegistry.get(operation);
134
157
  if (!definition) {
135
- throw caizhilianValidationError('operation_unknown', `采知连不支持操作:${operation}`);
158
+ const withheld = caizhilianWithheldOperations.some((entry) => entry.name === operation);
159
+ throw caizhilianValidationError('operation_unknown', `采知连不支持操作:${operation}${withheld ? '(属 withheld 能力,原因与替代命令见 caizhilian operations 输出的 withheldOperations)' : ''}`);
136
160
  }
137
161
  return definition;
138
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 { createCalendarContinuationSigner } from './continuation.js';
5
6
  import { createCalendarHost } from './host.js';
6
7
  import { calendarManifest } from './manifest.js';
@@ -97,8 +98,16 @@ export const calendarShortcut = {
97
98
  const calendar = program.command('calendar').description('泛微E10日程管理(创建/查询列表/详情/总数/更新/删除/类型/紧急程度)');
98
99
  calendar.command('schema')
99
100
  .description('Print calendar operation manifest for agents')
100
- .action(action((ctx) => {
101
- ctx.output.write(calendarManifest, { 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(calendarManifest, schema), {
107
+ json: true,
108
+ // 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
109
+ ...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
110
+ });
102
111
  }));
103
112
  calendar.command('run')
104
113
  .description('Run a calendar 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 { createContractContinuationSigner } from './continuation.js';
5
6
  import { contractValidationError } from './errors.js';
6
7
  import { createContractHost } from './host.js';
@@ -141,8 +142,16 @@ export const contractShortcut = {
141
142
  const contract = program.command('contract').description('泛微E10今承达合同管理');
142
143
  contract.command('schema')
143
144
  .description('Print contract operation manifest for agents')
144
- .action(wrap((ctx) => {
145
- ctx.output.write(contractManifest, { json: true });
145
+ .option('--list', '只列操作清单(name/summary/risk),全量不截断;判断"有没有某操作"用这个')
146
+ .option('--full', '打印完整 manifest(超 stdout 预算会落本地 ref,用 refs get 分页取)')
147
+ .option('--operation <name>', '只输出单个操作的完整契约(含 inputSchema,体积远低于预算)')
148
+ .action(wrap((ctx, options) => {
149
+ const schema = schemaOptionsOf(options);
150
+ ctx.output.write(manifestView(contractManifest, schema), {
151
+ json: true,
152
+ // 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
153
+ ...(schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}),
154
+ });
146
155
  }));
147
156
  const run = contract.command('run')
148
157
  .description('Run a contract operation with JSON input')