weaver-work-cli 0.1.70 → 0.1.73

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (263) hide show
  1. package/dist/chunks/{archive-VUTREF3P.js → archive-THZV4ND4.js} +22 -5
  2. package/dist/chunks/{archive-oa-VXXO4RTB.js → archive-oa-PQ23OLEV.js} +17 -5
  3. package/dist/chunks/{asset-45U6TY7I.js → asset-RGPROZYH.js} +22 -5
  4. package/dist/chunks/{asset-idle-YCRBMTIT.js → asset-idle-Z2PDX7NA.js} +15 -5
  5. package/dist/chunks/{attachment-content-DMU7KNZ7.js → attachment-content-R3RPVOYE.js} +3 -3
  6. package/dist/chunks/{blog-5AML4WMG.js → blog-7U3QZPIF.js} +25 -5
  7. package/dist/chunks/{caizhilian-3P7BUNHT.js → caizhilian-3AB42GCV.js} +22 -8
  8. package/dist/chunks/{calendar-2HUXM3CZ.js → calendar-KINM64E4.js} +15 -5
  9. package/dist/chunks/{chunk-EHH363SP.js → chunk-2CHGUYMG.js} +4 -4
  10. package/dist/chunks/{chunk-GWM5TLIK.js → chunk-2XED2FKY.js} +34 -34
  11. package/dist/chunks/{chunk-DVFA3ODS.js → chunk-35A56FJ7.js} +12 -0
  12. package/dist/chunks/{chunk-QYDSTYGG.js → chunk-4BXR6CNB.js} +3 -3
  13. package/dist/chunks/{chunk-KDOJW5LH.js → chunk-4I26YMBY.js} +1 -1
  14. package/dist/chunks/{chunk-X6PMJQGO.js → chunk-4YXAK6OA.js} +19 -8
  15. package/dist/chunks/{chunk-HG6INLH6.js → chunk-54ST55IJ.js} +28 -7
  16. package/dist/chunks/{chunk-DSBV4GRK.js → chunk-6HT73VOI.js} +3 -3
  17. package/dist/chunks/{chunk-4W6BSNIL.js → chunk-7QFVXP2X.js} +6 -6
  18. package/dist/chunks/{chunk-I5XB4MZT.js → chunk-AMAPQVBT.js} +95 -65
  19. package/dist/chunks/{chunk-L2A3COWV.js → chunk-BWYVS62Z.js} +4 -4
  20. package/dist/chunks/{chunk-UPVAQJKS.js → chunk-DRUND2PJ.js} +130 -79
  21. package/dist/chunks/{chunk-LJE7RZNC.js → chunk-F4HM25K4.js} +1 -1
  22. package/dist/chunks/{chunk-T24EBWAZ.js → chunk-GAMGDNTF.js} +48 -21
  23. package/dist/chunks/{chunk-H2NRTGZR.js → chunk-GWJLAF6B.js} +3 -3
  24. package/dist/chunks/{chunk-XIBMZEDB.js → chunk-IBSJJGXL.js} +2 -2
  25. package/dist/chunks/{chunk-VZUH3LKI.js → chunk-ICP53R52.js} +167 -157
  26. package/dist/chunks/{chunk-LRKKKO5A.js → chunk-IU6UB2TD.js} +3 -4
  27. package/dist/chunks/{chunk-GTAFCAVP.js → chunk-IZCQU5D5.js} +1 -1
  28. package/dist/chunks/{chunk-727VKJQK.js → chunk-JMJBPP4B.js} +2 -2
  29. package/dist/chunks/{chunk-UVWW5ABZ.js → chunk-L7TYG5SN.js} +3 -3
  30. package/dist/chunks/{chunk-HAORST2G.js → chunk-LLCMOZ5L.js} +11 -11
  31. package/dist/chunks/{chunk-U3OO3IZF.js → chunk-NUP4RYZK.js} +20 -7
  32. package/dist/chunks/{chunk-IVCOZCAW.js → chunk-PAFOLIYQ.js} +1 -1
  33. package/dist/chunks/{chunk-LSVA7QA6.js → chunk-R3MK2RBN.js} +3 -1
  34. package/dist/chunks/{chunk-GFOFUH6O.js → chunk-TV46Q4NY.js} +52 -51
  35. package/dist/chunks/chunk-WM33BSIL.js +136 -0
  36. package/dist/chunks/{chunk-7CINV2BU.js → chunk-XZBYRYWX.js} +2 -2
  37. package/dist/chunks/{chunk-E7VWE2XI.js → chunk-ZWLWXHJC.js} +3 -3
  38. package/dist/chunks/{conflict-YW5BULJ3.js → conflict-VPAR7E6F.js} +2 -2
  39. package/dist/chunks/{contract-3PMHUASH.js → contract-DDXAO2DZ.js} +48 -5
  40. package/dist/chunks/{cowork-FZBTTBYX.js → cowork-34QCHMDD.js} +37 -8
  41. package/dist/chunks/{create-flow-5OBS3B3V.js → create-flow-52PU2OBI.js} +6 -6
  42. package/dist/chunks/{data-2YZ6A6TL.js → data-CLQ62QGD.js} +99 -184
  43. package/dist/chunks/{ebuilder-form-AWPTMZBZ.js → ebuilder-form-W5R7Q22S.js} +17 -7
  44. package/dist/chunks/{ehr-MNPR4TE5.js → ehr-LCNAVMK5.js} +67 -17
  45. package/dist/chunks/{entry-mode-L65OWPFM.js → entry-mode-6Z3ZV3DE.js} +3 -3
  46. package/dist/chunks/{env-XW7LYIME.js → env-RDKWAARB.js} +2 -2
  47. package/dist/chunks/{esb-GSB5QCEX.js → esb-ANKPUU65.js} +17 -7
  48. package/dist/chunks/{factory-MHFZZAGH.js → factory-434B7RAT.js} +1 -1
  49. package/dist/chunks/{fna-XBSNUS2V.js → fna-AKBSG5HI.js} +15 -5
  50. package/dist/chunks/{group-chat-EEOLO5NM.js → group-chat-PROTW22R.js} +3 -3
  51. package/dist/chunks/{host-NVDG3NC6.js → host-5R2SNFWD.js} +4 -4
  52. package/dist/chunks/{host-2UMNXX5H.js → host-7FJW4E7R.js} +4 -4
  53. package/dist/chunks/{host-XVWBOSEN.js → host-CGXUFQO4.js} +4 -4
  54. package/dist/chunks/{host-R7BP3CTI.js → host-PDJAKCT7.js} +6 -4
  55. package/dist/chunks/{host-SYPCA63D.js → host-WO4L5G5I.js} +4 -4
  56. package/dist/chunks/{host-BD44ASOD.js → host-XIYG4F4B.js} +4 -4
  57. package/dist/chunks/{hrm-FZUDJAND.js → hrm-WGODDTEH.js} +15 -6
  58. package/dist/chunks/{im-F5NENPD7.js → im-YKTKAJU3.js} +16 -6
  59. package/dist/chunks/{invoice-DS6FLU55.js → invoice-PVYCCCVM.js} +27 -6
  60. package/dist/chunks/{jiuchuanhui-JCBUR563.js → jiuchuanhui-RKOQW7BY.js} +19 -6
  61. package/dist/chunks/{lazy-dispatch-F6O2EPGR.js → lazy-dispatch-DW45AFQ5.js} +6 -6
  62. package/dist/chunks/{mail-ZEOSANEJ.js → mail-BNB5S4NW.js} +116 -97
  63. package/dist/chunks/{meeting-PCD5EPBF.js → meeting-O2KDJH66.js} +29 -16
  64. package/dist/chunks/{minute-doc-WTZJVCHG.js → minute-doc-JUCG56GY.js} +4 -4
  65. package/dist/chunks/{okr-OZUMTMCL.js → okr-LWFGWOE7.js} +15 -5
  66. package/dist/chunks/{operations-LQY3FTPH.js → operations-2WHIF5WV.js} +1 -1
  67. package/dist/chunks/{operations-UTUWFJTX.js → operations-532PN5OB.js} +5 -5
  68. package/dist/chunks/{performance-SMVTPK6T.js → performance-7W5COCFU.js} +92 -7
  69. package/dist/chunks/{plan-C2NENH42.js → plan-ZVY3IYTL.js} +15 -5
  70. package/dist/chunks/{project-FAJ2P3UR.js → project-SA62B7MH.js} +18 -5
  71. package/dist/chunks/{reception-NH6MJFPR.js → reception-NGIONPQ3.js} +128 -49
  72. package/dist/chunks/{recruit-stage-DPEFHLSE.js → recruit-stage-WOSN6MGP.js} +1264 -197
  73. package/dist/chunks/{registry-FTPUUHWC.js → registry-N7P3W2RD.js} +5 -5
  74. package/dist/chunks/{registry-3B3OAJYX.js → registry-R72GWXOG.js} +4 -4
  75. package/dist/chunks/{registry-ZQ7OONCB.js → registry-RIQ67ZT7.js} +12 -12
  76. package/dist/chunks/{room-recommend-73NBN3RU.js → room-recommend-KCGIVUFR.js} +4 -4
  77. package/dist/chunks/{schedule-SDBOBBUQ.js → schedule-6UP27HQ4.js} +4 -4
  78. package/dist/chunks/{smart-extract-GTYKF5TJ.js → smart-extract-DDOQSPRB.js} +19 -6
  79. package/dist/chunks/{workflow-OWHWLAOX.js → workflow-V5ALD6QZ.js} +22 -8
  80. package/dist/cmd/auth/index.js +23 -0
  81. package/dist/cmd/e10/index.js +2 -1
  82. package/dist/cmd/index.js +2 -0
  83. package/dist/core/manifest-view.js +207 -0
  84. package/dist/core/output.js +42 -8
  85. package/dist/index.js +35 -35
  86. package/dist/internal/e10/auth/crypto.js +18 -8
  87. package/dist/internal/e10/auth/error-log.js +1 -2
  88. package/dist/internal/e10/auth/messages.js +2 -3
  89. package/dist/internal/e10/auth/xiaoe.js +1 -1
  90. package/dist/internal/e10/tls-policy.js +61 -13
  91. package/dist/shortcuts/archive/index.js +11 -2
  92. package/dist/shortcuts/archive/operations/download.js +1 -0
  93. package/dist/shortcuts/archive/operations/flow-url.js +3 -0
  94. package/dist/shortcuts/archive/operations/prelib.js +2 -0
  95. package/dist/shortcuts/archive/operations/upload.js +1 -0
  96. package/dist/shortcuts/archive-oa/index.js +11 -2
  97. package/dist/shortcuts/archive-oa/operations/borrow-car.js +2 -0
  98. package/dist/shortcuts/asset/index.js +11 -2
  99. package/dist/shortcuts/asset/manifest.js +7 -0
  100. package/dist/shortcuts/asset-idle/index.js +11 -2
  101. package/dist/shortcuts/blog/index.js +11 -2
  102. package/dist/shortcuts/blog/manifest.js +10 -0
  103. package/dist/shortcuts/caizhilian/host.js +20 -4
  104. package/dist/shortcuts/caizhilian/index.js +12 -2
  105. package/dist/shortcuts/caizhilian/manifest.js +4 -25
  106. package/dist/shortcuts/caizhilian/operations/handlers/search.js +34 -0
  107. package/dist/shortcuts/caizhilian/operations/registry.js +25 -1
  108. package/dist/shortcuts/calendar/index.js +11 -2
  109. package/dist/shortcuts/contract/index.js +11 -2
  110. package/dist/shortcuts/contract/manifest.js +32 -0
  111. package/dist/shortcuts/contract/operations/write.js +3 -0
  112. package/dist/shortcuts/cowork/index.js +21 -5
  113. package/dist/shortcuts/cowork/manifest.js +3 -0
  114. package/dist/shortcuts/cowork/operations/discuss-write.js +2 -0
  115. package/dist/shortcuts/cowork/operations/item-write.js +3 -0
  116. package/dist/shortcuts/cowork/operations/member-write.js +2 -0
  117. package/dist/shortcuts/cowork/operations/permission-write.js +2 -0
  118. package/dist/shortcuts/cowork/operations/review-write.js +1 -0
  119. package/dist/shortcuts/data/errors.js +16 -29
  120. package/dist/shortcuts/data/host.js +16 -7
  121. package/dist/shortcuts/data/index.js +12 -41
  122. package/dist/shortcuts/data/manifest.js +5 -44
  123. package/dist/shortcuts/data/operations/attend.js +2 -2
  124. package/dist/shortcuts/data/operations/conf.js +0 -88
  125. package/dist/shortcuts/data/operations/ds.js +4 -4
  126. package/dist/shortcuts/data/operations/index.js +1 -5
  127. package/dist/shortcuts/data/operations/module.js +40 -14
  128. package/dist/shortcuts/data/operations/query.js +2 -2
  129. package/dist/shortcuts/ebuilder-form/index.js +11 -2
  130. package/dist/shortcuts/ebuilder-form/manifest.js +12 -0
  131. package/dist/shortcuts/ehr/index.js +11 -2
  132. package/dist/shortcuts/ehr/operations/attend-write.js +51 -8
  133. package/dist/shortcuts/ehr/operations/recruit-position.js +4 -3
  134. package/dist/shortcuts/ehr/operations/recruit-short-cache.js +6 -2
  135. package/dist/shortcuts/ehr/operations/recruit-write.js +3 -3
  136. package/dist/shortcuts/ehr/operations/recruit.js +206 -82
  137. package/dist/shortcuts/ehr/operations/shared.js +31 -0
  138. package/dist/shortcuts/esb/index.js +11 -2
  139. package/dist/shortcuts/esb/manifest.js +2 -0
  140. package/dist/shortcuts/fna/index.js +11 -2
  141. package/dist/shortcuts/hrm/index.js +11 -1
  142. package/dist/shortcuts/im/index.js +11 -2
  143. package/dist/shortcuts/invoice/index.js +11 -2
  144. package/dist/shortcuts/invoice/manifest.js +8 -0
  145. package/dist/shortcuts/jiuchuanhui/index.js +15 -1
  146. package/dist/shortcuts/jiuchuanhui/manifest.js +2 -0
  147. package/dist/shortcuts/mail/errors.js +14 -0
  148. package/dist/shortcuts/mail/index.js +23 -6
  149. package/dist/shortcuts/mail/manifest.js +11 -4
  150. package/dist/shortcuts/mail/operations/mail-blacklist.js +6 -6
  151. package/dist/shortcuts/mail/operations/mail-contacts.js +10 -10
  152. package/dist/shortcuts/mail/operations/mail-manage.js +15 -14
  153. package/dist/shortcuts/mail/operations/mail-read.js +7 -25
  154. package/dist/shortcuts/mail/operations/mail-send.js +12 -12
  155. package/dist/shortcuts/mail/operations/mail-sign.js +10 -10
  156. package/dist/shortcuts/mail/operations/mail-template.js +10 -10
  157. package/dist/shortcuts/meeting/index.js +11 -2
  158. package/dist/shortcuts/meeting/operations/invitation-publish.js +1 -0
  159. package/dist/shortcuts/okr/index.js +11 -2
  160. package/dist/shortcuts/performance/index.js +62 -3
  161. package/dist/shortcuts/performance/scheme-validate.js +7 -0
  162. package/dist/shortcuts/performance/shared.js +40 -2
  163. package/dist/shortcuts/plan/index.js +11 -2
  164. package/dist/shortcuts/project/index.js +11 -2
  165. package/dist/shortcuts/project/operations/write.js +3 -0
  166. package/dist/shortcuts/reception/constants.js +22 -0
  167. package/dist/shortcuts/reception/index.js +15 -2
  168. package/dist/shortcuts/reception/manifest.js +17 -3
  169. package/dist/shortcuts/reception/operations/ask.js +3 -0
  170. package/dist/shortcuts/reception/operations/doc.js +24 -11
  171. package/dist/shortcuts/reception/operations/docrender.js +18 -1
  172. package/dist/shortcuts/reception/operations/render-assets.js +93 -22
  173. package/dist/shortcuts/recruit-stage/context.js +12 -6
  174. package/dist/shortcuts/recruit-stage/index.js +22 -3
  175. package/dist/shortcuts/recruit-stage/manifest.js +2 -0
  176. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +19 -10
  177. package/dist/shortcuts/recruit-stage/operations/jd-create.js +487 -38
  178. package/dist/shortcuts/recruit-stage/operations/list.js +72 -1
  179. package/dist/shortcuts/recruit-stage/operations/profile.js +194 -0
  180. package/dist/shortcuts/recruit-stage/operations/registry.js +20 -2
  181. package/dist/shortcuts/recruit-stage/operations/resume-import.js +258 -63
  182. package/dist/shortcuts/recruit-stage/operations/search.js +226 -27
  183. package/dist/shortcuts/recruit-stage/operations/shortlist.js +122 -0
  184. package/dist/shortcuts/recruit-stage/operations/tag.js +17 -3
  185. package/dist/shortcuts/recruit-stage/shared.js +158 -4
  186. package/dist/shortcuts/smart-extract/index.js +11 -2
  187. package/dist/shortcuts/smart-extract/manifest.js +1 -0
  188. package/dist/shortcuts/smart-extract/operations/save.js +2 -0
  189. package/dist/shortcuts/workflow/index.js +21 -1
  190. package/dist/shortcuts/workflow/operations/form.js +36 -2
  191. package/dist/shortcuts/workflow/operations/read.js +2 -2
  192. package/dist/shortcuts/workflow/operations/write.js +1 -1
  193. package/docs/caizhilian.md +1 -1
  194. package/docs/contract.md +1 -0
  195. package/docs/data.md +22 -22
  196. package/docs/e10-auth.md +41 -33
  197. package/docs/ehr.md +2 -0
  198. package/docs/reception.md +4 -3
  199. package/package.json +1 -1
  200. package/scripts/pysite/__pycache__/sitecustomize.cpython-312.pyc +0 -0
  201. package/scripts/pysite/__pycache__/sitecustomize.cpython-313.pyc +0 -0
  202. package/scripts/pysite/sitecustomize.py +41 -0
  203. package/skill-template/domains/data.md +4 -4
  204. package/skills/weaver-e10-caizhilian/SKILL.md +1 -1
  205. package/skills/weaver-e10-caizhilian/references/org-browser.md +1 -0
  206. package/skills/weaver-e10-cowork/SKILL.md +3 -1
  207. package/skills/weaver-e10-data/SKILL.md +12 -16
  208. package/skills/weaver-e10-data/references/config-center.md +6 -7
  209. package/skills/weaver-e10-data/references/datasource.md +1 -1
  210. package/skills/weaver-e10-data/references/scene-and-misc.md +2 -2
  211. package/skills/weaver-e10-jiuchuanhui/SKILL.md +6 -4
  212. package/skills/weaver-e10-jiuchuanhui/references/clue.md +2 -2
  213. package/skills/weaver-e10-jiuchuanhui/references/customer.md +18 -8
  214. package/skills/weaver-e10-jiuchuanhui/references/sale.md +2 -2
  215. package/skills/weaver-e10-jucailin/SKILL.md +7 -3
  216. package/skills/weaver-e10-jucailin/references/attend-write.md +1 -1
  217. package/skills/weaver-e10-jucailin/references/recruit-output-links.md +33 -0
  218. package/skills/weaver-e10-jucailin/references/recruit-write.md +2 -0
  219. package/skills/weaver-e10-mail/SKILL.md +4 -1
  220. package/skills/weaver-e10-mail/references/mail-read.md +4 -2
  221. package/skills/weaver-e10-mail/references/safety-boundaries.md +1 -0
  222. package/skills/weaver-e10-okr/references/source-manifest.json +3 -3
  223. package/skills/weaver-e10-performance/SKILL.md +8 -6
  224. package/skills/weaver-e10-reception-flow/SKILL.md +97 -41
  225. package/skills/weaver-e10-reception-flow/references/guide.md +3 -1
  226. package/skills/weaver-e10-recruit-stage/SKILL.md +557 -75
  227. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +67 -44
  228. package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +279 -0
  229. package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +198 -0
  230. package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +697 -0
  231. package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +507 -0
  232. package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +87 -0
  233. package/skills/weaver-e10-recruit-stage/references/position-templates.md +19 -18
  234. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +19 -18
  235. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +1 -1
  236. package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +1 -1
  237. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +15 -2
  238. package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +37 -0
  239. package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +4 -4
  240. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +64 -28
  241. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +43 -2
  242. package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +41 -0
  243. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +4 -4
  244. package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +2 -2
  245. package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +25 -7
  246. package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +51 -0
  247. package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +63 -0
  248. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +4 -4
  249. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +2 -2
  250. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +58 -33
  251. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +4 -4
  252. package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +5 -5
  253. package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +2 -2
  254. package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +11 -10
  255. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +2 -2
  256. package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
  257. package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +106 -0
  258. package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +325 -0
  259. package/skills/weaver-e10-recruit-stage/templates/match-report.html +265 -0
  260. package/skills/weaver-e10-shared/SKILL.md +22 -1
  261. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +2 -2
  262. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +3 -3
  263. package/skills/weaver-e10-jucailin/references/source-manifest.json +0 -152
@@ -4,13 +4,13 @@ import {
4
4
  esbOperationDefinitions,
5
5
  getEsbOperation,
6
6
  hasEsbOperation
7
- } from "./chunk-LSVA7QA6.js";
8
- import "./chunk-UVWW5ABZ.js";
7
+ } from "./chunk-R3MK2RBN.js";
8
+ import "./chunk-L7TYG5SN.js";
9
9
  import "./chunk-TXUG266F.js";
10
10
  import "./chunk-7BDPM5ST.js";
11
- import "./chunk-LRKKKO5A.js";
12
- import "./chunk-GTAFCAVP.js";
13
- import "./chunk-I5XB4MZT.js";
11
+ import "./chunk-IU6UB2TD.js";
12
+ import "./chunk-IZCQU5D5.js";
13
+ import "./chunk-AMAPQVBT.js";
14
14
  import "./chunk-UG5G54VL.js";
15
15
  import "./chunk-BUSC6UAE.js";
16
16
  export {
@@ -4,14 +4,14 @@ import {
4
4
  getWorkflowOperation,
5
5
  hasWorkflowOperation,
6
6
  workflowOperationDefinitions
7
- } from "./chunk-X6PMJQGO.js";
7
+ } from "./chunk-4YXAK6OA.js";
8
8
  import "./chunk-HP7JIYMT.js";
9
9
  import "./chunk-WRXSAVKO.js";
10
- import "./chunk-HG6INLH6.js";
10
+ import "./chunk-54ST55IJ.js";
11
11
  import "./chunk-AJ62BGAW.js";
12
12
  import "./chunk-7BDPM5ST.js";
13
- import "./chunk-GTAFCAVP.js";
14
- import "./chunk-I5XB4MZT.js";
13
+ import "./chunk-IZCQU5D5.js";
14
+ import "./chunk-AMAPQVBT.js";
15
15
  import "./chunk-UG5G54VL.js";
16
16
  import "./chunk-BUSC6UAE.js";
17
17
  export {
@@ -4,20 +4,20 @@ import {
4
4
  getMeetingOperation,
5
5
  hasMeetingOperation,
6
6
  meetingOperationDefinitions
7
- } from "./chunk-GFOFUH6O.js";
8
- import "./chunk-GWM5TLIK.js";
9
- import "./chunk-4W6BSNIL.js";
10
- import "./chunk-XIBMZEDB.js";
7
+ } from "./chunk-TV46Q4NY.js";
8
+ import "./chunk-2XED2FKY.js";
9
+ import "./chunk-7QFVXP2X.js";
10
+ import "./chunk-IBSJJGXL.js";
11
11
  import "./chunk-WMRNO6IU.js";
12
- import "./chunk-HAORST2G.js";
13
- import "./chunk-7CINV2BU.js";
14
- import "./chunk-L2A3COWV.js";
15
- import "./chunk-EHH363SP.js";
16
- import "./chunk-IVCOZCAW.js";
17
- import "./chunk-LJE7RZNC.js";
18
- import "./chunk-KDOJW5LH.js";
12
+ import "./chunk-LLCMOZ5L.js";
13
+ import "./chunk-XZBYRYWX.js";
14
+ import "./chunk-BWYVS62Z.js";
15
+ import "./chunk-2CHGUYMG.js";
16
+ import "./chunk-PAFOLIYQ.js";
17
+ import "./chunk-F4HM25K4.js";
18
+ import "./chunk-4I26YMBY.js";
19
19
  import "./chunk-7BDPM5ST.js";
20
- import "./chunk-I5XB4MZT.js";
20
+ import "./chunk-AMAPQVBT.js";
21
21
  import "./chunk-UG5G54VL.js";
22
22
  import "./chunk-BUSC6UAE.js";
23
23
  export {
@@ -7,10 +7,10 @@ import {
7
7
  loadRooms,
8
8
  recommendRooms,
9
9
  rememberFrequentRoom
10
- } from "./chunk-EHH363SP.js";
11
- import "./chunk-IVCOZCAW.js";
12
- import "./chunk-LJE7RZNC.js";
13
- import "./chunk-KDOJW5LH.js";
10
+ } from "./chunk-2CHGUYMG.js";
11
+ import "./chunk-PAFOLIYQ.js";
12
+ import "./chunk-F4HM25K4.js";
13
+ import "./chunk-4I26YMBY.js";
14
14
  import "./chunk-7BDPM5ST.js";
15
15
  import "./chunk-UG5G54VL.js";
16
16
  import "./chunk-BUSC6UAE.js";
@@ -8,10 +8,10 @@ import {
8
8
  resolveMeetingScheduleTypeIds,
9
9
  resolveMemberIdsByName,
10
10
  runScheduleConflictFlow
11
- } from "./chunk-L2A3COWV.js";
12
- import "./chunk-IVCOZCAW.js";
13
- import "./chunk-LJE7RZNC.js";
14
- import "./chunk-KDOJW5LH.js";
11
+ } from "./chunk-BWYVS62Z.js";
12
+ import "./chunk-PAFOLIYQ.js";
13
+ import "./chunk-F4HM25K4.js";
14
+ import "./chunk-4I26YMBY.js";
15
15
  import "./chunk-7BDPM5ST.js";
16
16
  import "./chunk-UG5G54VL.js";
17
17
  import "./chunk-BUSC6UAE.js";
@@ -2,10 +2,15 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  defaultResultThresholdChars
5
- } from "./chunk-HG6INLH6.js";
5
+ } from "./chunk-54ST55IJ.js";
6
6
  import {
7
7
  stateRoot
8
8
  } from "./chunk-AJ62BGAW.js";
9
+ import {
10
+ MANIFEST_LIST_COMPACT_PATHS,
11
+ manifestView,
12
+ schemaOptionsOf
13
+ } from "./chunk-WM33BSIL.js";
9
14
  import {
10
15
  CONTINUATION_TTL_MS,
11
16
  CONTINUATION_TTL_SECONDS
@@ -15,11 +20,11 @@ import {
15
20
  createE10RequestRuntime,
16
21
  isE10SessionExpiredResponse,
17
22
  requireE10Session
18
- } from "./chunk-LRKKKO5A.js";
19
- import "./chunk-GTAFCAVP.js";
23
+ } from "./chunk-IU6UB2TD.js";
24
+ import "./chunk-IZCQU5D5.js";
20
25
  import {
21
26
  getActiveProfile
22
- } from "./chunk-I5XB4MZT.js";
27
+ } from "./chunk-AMAPQVBT.js";
23
28
  import {
24
29
  CliError,
25
30
  isCliError,
@@ -1725,6 +1730,7 @@ function requireSuccessResult(result) {
1725
1730
  var savePrepare = {
1726
1731
  name: "smart-extract.save.prepare",
1727
1732
  risk: "read-before-write",
1733
+ requiresConfirmation: true,
1728
1734
  summary: "\u7EC4\u88C5\u843D\u5E93\u8BF7\u6C42\u5E76\u7B7E\u53D1\u786E\u8BA4\u7968\u636E\uFF1A\u5148\u6309\u5185\u5BB9\u6307\u7EB9\u4E0E\u9644\u4EF6\u952E\u67E5\u672C\u5730\u53F0\u8D26\uFF08\u547D\u4E2D\u8FD4\u56DE duplicate \u4E0E\u5DF2\u6709 aiExtraId\uFF0C\u4E0D\u7B7E\u7968\u636E\uFF09\uFF0C\u518D\u81EA\u52A8\u751F\u6210 requestId\uFF08\u9632\u300C\u5199\u7ED3\u679C\u672A\u77E5\u540E\u91CD\u8BD5\u300D\u53CC\u63D2\uFF09\u3002\u672C\u8EAB\u4E0D\u53D1\u5199\u8BF7\u6C42\u3002",
1729
1735
  inputSchema: schemaOf({
1730
1736
  workflowId: { ...SCHEMA_ID, description: "\u6D41\u7A0B\u6A21\u677F ID\uFF08\u5FC5\u586B\uFF0C\u670D\u52A1\u7AEF\u8981\u6C42\uFF09" },
@@ -1932,6 +1938,7 @@ async function resolveContinuation(args, stateDir) {
1932
1938
  var saveApply = {
1933
1939
  name: "smart-extract.save.apply",
1934
1940
  risk: "high-risk-write",
1941
+ requiresConfirmation: true,
1935
1942
  summary: "\u786E\u8BA4\u540E\u771F\u6B63\u5199\u5165\u6279\u6B21\u8BB0\u5F55\uFF1A\u5FC5\u987B confirm=true \u4E14\u5E26 prepare \u8FD4\u56DE\u7684 ticketFile\u3002\u53D1\u5199\u8BF7\u6C42\u524D\u5148\u6309 requestId/\u5185\u5BB9\u6307\u7EB9/\u9644\u4EF6\u952E\u4E09\u5C42\u67E5\u91CD\uFF0C\u91CD\u590D\u4E00\u5F8B\u8FD4\u56DE\u5DF2\u6709 aiExtraId\uFF0C\u4E0D\u518D\u5165\u5E93\u3002",
1936
1943
  inputSchema: schemaOf({
1937
1944
  confirm: { type: "boolean", description: "\u5FC5\u987B\u4E3A true\uFF1B\u8868\u793A\u7528\u6237\u5DF2\u660E\u786E\u786E\u8BA4\u4FDD\u5B58" },
@@ -2784,6 +2791,7 @@ var smartExtractOperations = smartExtractOperationDefinitions.map((definition) =
2784
2791
  name: definition.name,
2785
2792
  risk: definition.risk,
2786
2793
  summary: definition.summary,
2794
+ ...definition.requiresConfirmation ? { requiresConfirmation: true } : {},
2787
2795
  inputSchema: definition.inputSchema
2788
2796
  }));
2789
2797
  var smartExtractManifest = {
@@ -2880,8 +2888,13 @@ var smartExtractShortcut = {
2880
2888
  register({ program, action }) {
2881
2889
  assertManifestMatchesRegistry();
2882
2890
  const command = program.command("smart-extract").description("E10 \u667A\u80FD\u62BD\u53D6\uFF1Afill \u4E00\u6B21\u53D6\u9F50\u7ED3\u6784\u4E0E\u9644\u4EF6\u6B63\u6587\uFF0Cfill.save \u6821\u9A8C+\u843D\u5E93+\u56DE\u67E5\uFF1B\u5176\u4F59\u4E3A\u6392\u969C\u547D\u4EE4");
2883
- command.command("schema").description("\u8F93\u51FA operation \u5408\u7EA6\uFF08Agent \u81EA\u67E5\u5165\u53E3\uFF09").action(action((ctx) => {
2884
- ctx.output.write(smartExtractManifest, { json: true });
2891
+ command.command("schema").description("\u8F93\u51FA operation \u5408\u7EA6\uFF08Agent \u81EA\u67E5\u5165\u53E3\uFF09").option("--list", '\u53EA\u5217\u64CD\u4F5C\u6E05\u5355\uFF08name/summary/risk\uFF09\uFF0C\u5168\u91CF\u4E0D\u622A\u65AD\uFF1B\u5224\u65AD"\u6709\u6CA1\u6709\u67D0\u64CD\u4F5C"\u7528\u8FD9\u4E2A').option("--full", "\u6253\u5370\u5B8C\u6574 manifest\uFF08\u8D85 stdout \u9884\u7B97\u4F1A\u843D\u672C\u5730 ref\uFF0C\u7528 refs get \u5206\u9875\u53D6\uFF09").option("--operation <name>", "\u53EA\u8F93\u51FA\u5355\u4E2A\u64CD\u4F5C\u7684\u5B8C\u6574\u5951\u7EA6\uFF08\u542B inputSchema\uFF0C\u4F53\u79EF\u8FDC\u4F4E\u4E8E\u9884\u7B97\uFF09").action(action((ctx, options) => {
2892
+ const schema = schemaOptionsOf(options);
2893
+ ctx.output.write(manifestView(smartExtractManifest, schema), {
2894
+ json: true,
2895
+ // 只有 --list 单行化:条目多、缩进空白能吃掉近一半体积,且对读模型无收益。
2896
+ ...schema.list === true ? { compactPaths: MANIFEST_LIST_COMPACT_PATHS } : {}
2897
+ });
2885
2898
  }));
2886
2899
  command.command("run").description("\u6309 operation \u540D\u6267\u884C\uFF0C\u4F8B\u5982 smart-extract.form.structure").argument("<operation>", "operation \u540D\uFF0C\u89C1 schema \u8F93\u51FA").option("--input <path>", "JSON \u5165\u53C2\u6587\u4EF6\uFF0C- \u8868\u793A stdin").option("--input-json <json>", "\u5185\u8054 JSON \u5165\u53C2").action(action(async (ctx, operation, options) => {
2887
2900
  const opts = asOptions(options);
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  createWorkflowHost
5
- } from "./chunk-E7VWE2XI.js";
5
+ } from "./chunk-ZWLWXHJC.js";
6
6
  import {
7
7
  USER_INTENT_RULE_FILE,
8
8
  aigroupUserDir,
@@ -17,7 +17,7 @@ import {
17
17
  validateRuleFile,
18
18
  workflowOperationDefinitions,
19
19
  workflowSuccess
20
- } from "./chunk-X6PMJQGO.js";
20
+ } from "./chunk-4YXAK6OA.js";
21
21
  import {
22
22
  createWorkflowContinuationSigner
23
23
  } from "./chunk-HP7JIYMT.js";
@@ -27,15 +27,17 @@ import {
27
27
  workflowPolicyError,
28
28
  workflowValidationError
29
29
  } from "./chunk-WRXSAVKO.js";
30
- import "./chunk-HG6INLH6.js";
30
+ import {
31
+ charsOf
32
+ } from "./chunk-54ST55IJ.js";
31
33
  import "./chunk-AJ62BGAW.js";
32
34
  import {
33
35
  reportPlatformError
34
36
  } from "./chunk-MD5CW4B6.js";
35
37
  import "./chunk-7BDPM5ST.js";
36
- import "./chunk-LRKKKO5A.js";
37
- import "./chunk-GTAFCAVP.js";
38
- import "./chunk-I5XB4MZT.js";
38
+ import "./chunk-IU6UB2TD.js";
39
+ import "./chunk-IZCQU5D5.js";
40
+ import "./chunk-AMAPQVBT.js";
39
41
  import {
40
42
  isCliError,
41
43
  toErrorEnvelope
@@ -440,14 +442,26 @@ var workflowShortcut = {
440
442
  category: "shortcut",
441
443
  register({ program, action }) {
442
444
  const workflow = program.command("workflow").description("\u6CDB\u5FAEE10\u6D41\u7A0B\u667A\u80FD\u52A9\u624B\uFF08\u5F85\u529E/\u5DF2\u529E/\u6211\u53D1\u8D77/\u5168\u90E8\u3001\u8BE6\u60C5\u3001\u64CD\u4F5C\u3001\u6279\u91CF\u3001\u53D1\u8D77\u3001\u4FEE\u6539\uFF09");
443
- workflow.command("schema").description("Print workflow operation manifest for agents").option("--operation <name>", "print one operation with its full inputSchema").option("--full", "print the whole manifest (about 65 KB; stdout may be trimmed)").action(action((ctx, options) => {
445
+ workflow.command("schema").description("Print workflow operation manifest for agents").option("--list", "\u53EA\u5217\u64CD\u4F5C\u7D22\u5F15\uFF08name/summary/\u98CE\u9669\uFF09\uFF0C\u4E0E\u9ED8\u8BA4\u8F93\u51FA\u4E00\u81F4\uFF0C\u5168\u91CF\u4E0D\u622A\u65AD").option("--operation <name>", "print one operation with its full inputSchema").option("--full", "print the whole manifest (about 65 KB; stdout may be trimmed)").action(action((ctx, options) => {
444
446
  const opts = asOptions(options);
445
447
  const requested = String(opts.operation ?? "").trim();
446
448
  if (requested && opts.full === true) {
447
449
  throw workflowValidationError("option_conflict", "\u4E0D\u80FD\u540C\u65F6\u4F20 --operation \u548C --full");
448
450
  }
449
451
  if (opts.full === true) {
450
- ctx.output.write(manifestFull(), { json: true });
452
+ const full = manifestFull();
453
+ if (charsOf(full) > ctx.output.budgetChars()) {
454
+ ctx.output.write({
455
+ ...manifestIndex(),
456
+ fullOmitted: {
457
+ totalOperations: visibleOperations().length,
458
+ fullChars: charsOf(full),
459
+ hint: "\u5B8C\u6574 inputSchema \u8D85\u51FA stdout \u9884\u7B97\uFF0C\u672A\u968F\u672C\u6B21\u8FD4\u56DE\uFF08\u5426\u5219 operations \u4F1A\u88AB\u622A\u6210\u51E0\u6761\uFF0C\u8BA9\u4F60\u8BEF\u4EE5\u4E3A\u6A21\u5757\u53EA\u6709\u90A3\u4E48\u591A\u4E2A\u80FD\u529B\uFF09\u3002\u53D6\u67D0\u4E2A\u64CD\u4F5C\u7684\u5B8C\u6574\u5951\u7EA6\uFF1Aweaver-work-cli workflow schema --operation <name>\u3002"
460
+ }
461
+ }, { json: true });
462
+ return;
463
+ }
464
+ ctx.output.write(full, { json: true });
451
465
  return;
452
466
  }
453
467
  if (requested) {
@@ -0,0 +1,23 @@
1
+ import { registerE10AuthCommands } from '../../internal/e10/auth/commands.js';
2
+ /**
3
+ * 顶层 `auth` 入口:把 E10 auth 命令族挂到根 program 上。
4
+ *
5
+ * 单独登记成一个内建命令,而不再由 `e10Command.register` 顺手挂到根 program,原因有两条:
6
+ *
7
+ * 1. **可发现性**:`commands list` 与顶层 help 的元数据都来自 `builtinCommands` 数组,
8
+ * 侧挂出来的 `auth` 不会出现在 `commands list` 里 —— 文档写 `auth login` / `auth show`,
9
+ * 按 `commands list` 找入口却查不到,两条路径互相打架。
10
+ * 2. **启动开销**:`src/index.ts` 靠 `BUILTIN_NAMES`(同样派生自 `builtinCommands`)
11
+ * 判断要不要加载 shortcut 实现。`auth` 不在其中时会落进"没命中任何已知命令名 ⇒
12
+ * 全量加载"的兜底分支,于是每次 `auth ...` 都要把全部 shortcut 实现加载一遍。
13
+ *
14
+ * `e10 auth` 仍然由 `e10Command` 注册在 `e10` 子命令下,作为等价入口保留。
15
+ */
16
+ export const authCommand = {
17
+ name: 'auth',
18
+ description: 'E10 auth and profile management',
19
+ category: 'platform',
20
+ register({ program, action }) {
21
+ registerE10AuthCommands(program, action);
22
+ },
23
+ };
@@ -5,7 +5,8 @@ export const e10Command = {
5
5
  description: 'E10 platform adapter: auth, profiles, and shared API client',
6
6
  category: 'platform',
7
7
  register({ program, ctx, action }) {
8
- registerE10AuthCommands(program, action);
8
+ // 顶层 `auth` 由 src/cmd/auth/index.ts 的 authCommand 单独登记;这里只挂 `e10 auth`。
9
+ // 两边都挂根 program 会把 `auth` 注册两次(commander 会重复列命令并只路由到第一个)。
9
10
  const e10 = program.command('e10').description('E10 platform commands');
10
11
  registerE10AuthCommands(e10, action);
11
12
  ctx.hooks.register({
package/dist/cmd/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { authCommand } from './auth/index.js';
1
2
  import { commandsCommand } from './commands/index.js';
2
3
  import { configCommand } from './config/index.js';
3
4
  import { docsCommand } from './docs/index.js';
@@ -15,6 +16,7 @@ export const builtinCommands = [
15
16
  commandsCommand,
16
17
  runCommand,
17
18
  refsCommand,
19
+ authCommand,
18
20
  e10Command,
19
21
  identityCommand,
20
22
  setupCommand,
@@ -0,0 +1,207 @@
1
+ import { CliError, ExitCode } from './errors.js';
2
+ /**
3
+ * 域级 `schema` 的分级视图。
4
+ *
5
+ * ## 为什么需要它
6
+ *
7
+ * `<domain> schema` 把「有哪些操作」和「每个操作的完整 inputSchema」塞进同一份 JSON。大域的实测体积
8
+ * (`outputChars`,即压缩前的原始字符数):
9
+ *
10
+ * | 域 | 操作数 | 原始字符 | 压缩后剩余操作 |
11
+ * | --- | --- | --- | --- |
12
+ * | meeting | 149 | 309,577 | 10 |
13
+ * | caizhilian | 180 | 212,694 | 8 |
14
+ * | contract | 151 | 196,881 | 20 |
15
+ * | invoice | 28 | 181,625 | 2 |
16
+ *
17
+ * 全部超过 stdout 预算(默认 28,000 字符),被 `Output.prepare()` 统一压成预览。危害不是"少看几条":
18
+ * invoice 只剩 2 条,操作名还被截成 `invoice.enterprise.l…(truncated 3 chars)`,模型连名字都没法照抄;
19
+ * 更关键的是 `inputSchema` 几乎全丢,模型「知道有这工具,但不知道字段怎么传」→ 猜参数 → 校验失败 → 重试。
20
+ *
21
+ * ## 为什么不用 offset/limit 分页
22
+ *
23
+ * operations 每条长度差一个数量级(mail 平均 372 字符、invoice 2,530、performance 2,689),按条分页
24
+ * 对不齐边界;而且 `refs get` 的自适应分批实测取完 caizhilian 的 180 条要 10 次往返、累计 200K+ 上下文。
25
+ * 分页解决的是"一页装不下",而这里的问题是"根本不需要一次看全每个工具的参数"。
26
+ *
27
+ * ## 三级输出
28
+ *
29
+ * - 默认(不传 flag):完整 manifest,**行为不变**,超预算仍走 ref 恢复(兼容既有技能契约)。
30
+ * - `--list`:只留 name / summary(截 40 字)/ risk 等检索必需字段。实测 caizhilian 19,324 字符、
31
+ * meeting 15,215、contract 14,464、ehr 6,465、invoice 2,418 —— 全部落在 28K 预算内,一波放完不截断。
32
+ * - `--operation <name>`:单个操作的完整契约(含 inputSchema),实测 400–2,700 字符。
33
+ *
34
+ * 组合用法就是"先用 `--list` 认操作,再用 `--operation` 拿精确入参",两次往返、总量可控。
35
+ */
36
+ /** `--list` 里 summary 的最大字符数。实测 40 字能把 180 条压到 19.3K;再长就会顶到预算。 */
37
+ export const OPERATION_SUMMARY_MAX_CHARS = 40;
38
+ /**
39
+ * `--list` 模式下要单行化的路径。
40
+ *
41
+ * 清单条目多,每条只占一行后缩进空白能省掉近一半体积,而这些空白对读模型的收益为零
42
+ * (模型要的是"叫什么、干什么、什么风险",不是每层两个空格)。内容一字不改,仍是合法 JSON。
43
+ */
44
+ export const MANIFEST_LIST_COMPACT_PATHS = ['operations', 'withheldOperations'];
45
+ /** 找不到操作时最多回几条近似建议。 */
46
+ const MAX_SUGGESTIONS = 8;
47
+ /** 域标识:优先 `name`(多数域),退化到 `module`(ebuilder-form),都没有时给占位符。 */
48
+ function domainOf(manifest) {
49
+ if (typeof manifest.name === 'string' && manifest.name !== '')
50
+ return manifest.name;
51
+ if (typeof manifest.module === 'string' && manifest.module !== '')
52
+ return manifest.module;
53
+ return '';
54
+ }
55
+ function clip(text, max) {
56
+ const value = typeof text === 'string' ? text : text === undefined || text === null ? '' : String(text);
57
+ return value.length > max ? `${value.slice(0, max)}…` : value;
58
+ }
59
+ /**
60
+ * 清单里保留哪些字段:够模型判断"该用哪个",不含 inputSchema。
61
+ *
62
+ * **不带 `resource` / `capability`**:它们几乎总能从 name 的第二段读出来
63
+ * (`caizhilian.document.search` → document、`meeting.eb.create` → eb),
64
+ * 而 180 条各带一次 `"resource":"document"` 要吃掉约 4K 字符——正好把清单顶过预算。
65
+ */
66
+ function toListEntry(operation) {
67
+ const entry = { name: operation.name };
68
+ entry.summary = clip(operation.summary, OPERATION_SUMMARY_MAX_CHARS);
69
+ if (typeof operation.risk === 'string')
70
+ entry.risk = operation.risk;
71
+ if (operation.requiresConfirmation === true)
72
+ entry.requiresConfirmation = true;
73
+ return entry;
74
+ }
75
+ function operationsOf(manifest) {
76
+ if (!Array.isArray(manifest.operations))
77
+ return [];
78
+ return manifest.operations.filter((item) => Boolean(item) && typeof item === 'object' && !Array.isArray(item));
79
+ }
80
+ function namesOf(manifest) {
81
+ return operationsOf(manifest).map((item) => String(item?.name ?? '')).filter((name) => name !== '');
82
+ }
83
+ /**
84
+ * 按名字找操作。允许三种写法,省掉模型记不住全名时的来回:
85
+ * 全名(`invoice.list`)、省略域前缀(`list`)、以及唯一后缀匹配(`enterprise.list`)。
86
+ */
87
+ function findOperation(manifest, wanted) {
88
+ const operations = operationsOf(manifest);
89
+ const domain = domainOf(manifest);
90
+ const exact = operations.find((item) => String(item?.name ?? '') === wanted);
91
+ if (exact)
92
+ return exact;
93
+ if (domain) {
94
+ const prefixed = operations.find((item) => String(item?.name ?? '') === `${domain}.${wanted}`);
95
+ if (prefixed)
96
+ return prefixed;
97
+ }
98
+ const suffixed = operations.filter((item) => String(item?.name ?? '').endsWith(`.${wanted}`));
99
+ // 只有唯一命中才认,避免 `.list` 这种后缀同时命中十几个操作时给出错误结果。
100
+ return suffixed.length === 1 ? suffixed[0] : undefined;
101
+ }
102
+ function suggestionsOf(manifest, wanted) {
103
+ const needle = wanted.toLowerCase();
104
+ const all = namesOf(manifest);
105
+ const contains = all.filter((name) => name.toLowerCase().includes(needle));
106
+ const tail = all.filter((name) => {
107
+ const last = name.split('.').pop() ?? '';
108
+ return !contains.includes(name) && last.toLowerCase().includes(needle);
109
+ });
110
+ return [...contains, ...tail].slice(0, MAX_SUGGESTIONS);
111
+ }
112
+ function schemaHintOf(manifest) {
113
+ const domain = domainOf(manifest) || '<domain>';
114
+ return `本清单只含 name/summary/risk。取单个操作的完整入参契约(含 inputSchema):`
115
+ + `weaver-work-cli ${domain} schema --operation <name>`;
116
+ }
117
+ function operationHintOf(manifest) {
118
+ const domain = domainOf(manifest) || '<domain>';
119
+ return `要看全部操作清单:weaver-work-cli ${domain} schema --list`;
120
+ }
121
+ /**
122
+ * 从 commander 的 options 参数里读出 `--list` / `--operation`。
123
+ *
124
+ * 与各业务模块的 `asOptions(options)` 一致:**无位置参数**的子命令,action 回调第二个参数就是
125
+ * options 对象(jiuchuanhui 的 `schema --operation` 一直这么取,已跑通)。这里只做类型收窄,
126
+ * 非对象一律当"没传 flag",交由 `manifestView` 走默认分支。
127
+ */
128
+ export function schemaOptionsOf(value) {
129
+ if (!value || typeof value !== 'object' || Array.isArray(value))
130
+ return {};
131
+ const holder = value;
132
+ return {
133
+ list: holder.list === true,
134
+ full: holder.full === true,
135
+ operation: holder.operation === undefined || holder.operation === null
136
+ ? undefined
137
+ : String(holder.operation),
138
+ };
139
+ }
140
+ /**
141
+ * 把完整 manifest 投影成 `--list` / `--operation` 视图;两个 flag 都没给时**原样返回**,
142
+ * 保证默认行为逐字节不变。
143
+ */
144
+ export function manifestView(manifest, options = {}) {
145
+ const wanted = String(options.operation ?? '').trim();
146
+ if (wanted !== '') {
147
+ const hit = findOperation(manifest, wanted);
148
+ if (!hit) {
149
+ const suggestions = suggestionsOf(manifest, wanted);
150
+ const tail = suggestions.length > 0
151
+ ? `可用操作(近似匹配):${suggestions.join(', ')}。先用 --list 看全量清单。`
152
+ : '先用 --list 看全量清单。';
153
+ throw new CliError(`未知操作 ${wanted}(域 ${domainOf(manifest)} 共 ${operationsOf(manifest).length} 个操作)。${tail}`, ExitCode.UsageError);
154
+ }
155
+ const domain = domainOf(manifest);
156
+ return {
157
+ schemaVersion: 1,
158
+ ok: true,
159
+ ...(domain ? { module: domain } : {}),
160
+ ...(typeof manifest.title === 'string' ? { title: manifest.title } : {}),
161
+ ...(typeof manifest.sourceSkill === 'string' ? { sourceSkill: manifest.sourceSkill } : {}),
162
+ operation: hit,
163
+ operationHint: operationHintOf(manifest),
164
+ };
165
+ }
166
+ // `--full` 优先于 `--list`:同时给时以"要完整"为准,避免模型以为拿了全量其实拿的是清单。
167
+ if (options.full === true)
168
+ return manifest;
169
+ if (options.list !== true)
170
+ return manifest;
171
+ const operations = operationsOf(manifest);
172
+ const withheld = Array.isArray(manifest.withheldOperations) ? manifest.withheldOperations : [];
173
+ const domain = domainOf(manifest);
174
+ return {
175
+ schemaVersion: 1,
176
+ ok: true,
177
+ ...(domain !== '' ? { module: domain } : {}),
178
+ ...(typeof manifest.title === 'string' ? { title: manifest.title } : {}),
179
+ ...(typeof manifest.version === 'string' || typeof manifest.version === 'number'
180
+ ? { version: manifest.version }
181
+ : {}),
182
+ ...(typeof manifest.sourceSkill === 'string' ? { sourceSkill: manifest.sourceSkill } : {}),
183
+ ...(Array.isArray(manifest.capabilities) ? { capabilities: manifest.capabilities } : {}),
184
+ // count 与 total 相等是常态;分成两个键是为了让模型一眼看出"这份清单没被截断"。
185
+ total: operations.length,
186
+ count: operations.length,
187
+ schemaHint: schemaHintOf(manifest),
188
+ operations: operations.map(toListEntry),
189
+ // 被禁用的操作必须也在清单里:模型看到 `mail.delete.batch` 存在于清单才不会再去找它。
190
+ //
191
+ // `withheldCount` 一起回:各域 SKILL.md 明确要模型"看 withheldCount 与 withheldOperations 条数
192
+ // 是否一致来判断有没有被截",漏掉这个键会让那段指引失效。`--list` 保证全量,所以这里
193
+ // 直接用数组长度,天然自洽(不取 manifest 里的预置值,避免两者口径不一致)。
194
+ // 值为 0 也要回(招聘域当前就是 0),否则模型找不到字段会以为输出残缺。
195
+ ...(manifest.withheldCount !== undefined || withheld.length > 0
196
+ ? { withheldCount: withheld.length }
197
+ : {}),
198
+ ...(withheld.length > 0
199
+ ? {
200
+ withheldOperations: withheld.map((item) => {
201
+ const record = (item ?? {});
202
+ return { name: record.name, reason: clip(record.reason, 80) };
203
+ }),
204
+ }
205
+ : {}),
206
+ };
207
+ }
@@ -128,6 +128,19 @@ export function bytesOf(value) {
128
128
  export function charsOf(value) {
129
129
  return JSON.stringify(value ?? null, null, 2).length;
130
130
  }
131
+ /**
132
+ * 按"给 `compactPaths` 时实际会写出去的文本"计字符数。
133
+ *
134
+ * `charsOf()` 恒按 2 空格缩进计数,而 `write()` 最终走 `stringifyForStdout(value, compactPaths)`;
135
+ * 不同口径会让预算判断失真:一份紧凑化后 19,324 字符、本可完整输出的清单,按缩进会被算成 38,833,
136
+ * 于是被误判超线并切掉大半条目(caizhilian 180 条只留 50 条,2026-11-27 实测)。
137
+ */
138
+ function compactCharsOf(value, compactPaths) {
139
+ if (!compactPaths || compactPaths.length === 0)
140
+ return charsOf(value);
141
+ const text = stringifyForStdout(value, compactPaths);
142
+ return text === undefined ? charsOf(value) : text.length;
143
+ }
131
144
  /** 链接类字段不参与截断:被截断的 URL 无法点击或调用。 */
132
145
  function isLinkField(key) {
133
146
  if (!key)
@@ -152,6 +165,10 @@ function isIntegrityField(key) {
152
165
  'hash', 'sha256',
153
166
  'hasmore', 'offset', 'limit', 'pagesize', 'pageno',
154
167
  'nextoffset', 'nextpagetoken',
168
+ // continuation(2026-11-27 实证):prepare 两段式写通道的签名令牌,被 stdout 预览截断后
169
+ // helper/Agent 存下坏 token,apply 必报 continuation_invalid(HMAC 校验失败)。
170
+ // 它与 id/code 同级——一个字符都不能错,永不参与字符串截断;信封超预算走骨架+ref 兜底。
171
+ 'continuation',
155
172
  ].some((suffix) => normalized === suffix || normalized.endsWith(suffix));
156
173
  }
157
174
  function childPath(path, key) {
@@ -437,11 +454,13 @@ function withTruncationNotice(leading, truncations) {
437
454
  : '完整结果未能暂存,无法恢复。';
438
455
  const notice = `⚠️ stdout 仅为预览,不是全量(不要据此判断条数或分页):${detail}。${tail}`;
439
456
  const { largeOutputNotice: rawNotice, ...rest } = leading;
457
+ // 顺序即优先级(2026-11-27):`largeOutputNotice` 必须落在信封**第一行**。此前它排在第 14 行左右,
458
+ // 模型只扫前几个键时看不到"已截断",会把预览当全量。机读索引紧跟着它,明细放最后。
440
459
  return {
441
- ...rest,
460
+ largeOutputNotice: `${String(rawNotice ?? '')}${notice}`,
442
461
  ...(omitted ? { previewOmitted: omitted } : {}),
443
462
  ...(recovery ? { recovery } : {}),
444
- largeOutputNotice: `${String(rawNotice ?? '')}${notice}`,
463
+ ...rest,
445
464
  ...(truncatedFields ? { previewTruncatedFields: truncatedFields } : {}),
446
465
  };
447
466
  }
@@ -485,13 +504,14 @@ function fitEnvelope(value, leading, extraWarnings, budgetChars) {
485
504
  : '结果无法暂存;stdout 仅保留精简内容,完整结果不可恢复。';
486
505
  const finalDetail = describeTruncations(skeletonTruncations(base));
487
506
  return {
507
+ // 这一档连骨架都放不下,提示必须绝对第一:模型看到 `data: '<omitted ...>'` 之前得先知道发生了什么。
508
+ largeOutputNotice: finalDetail ? `${finalNotice}⚠️ 预览不是全量:${finalDetail}。` : finalNotice,
488
509
  ...(persisted ? { refId } : {}),
489
510
  resultPersisted: persisted,
490
511
  previewTruncated: true,
491
512
  ...(finalOmitted ? { previewOmitted: finalOmitted } : {}),
492
513
  outputChars: Number(leading.outputChars) || 0,
493
514
  outputBytes: Number(leading.outputBytes) || 0,
494
- largeOutputNotice: finalDetail ? `${finalNotice}⚠️ 预览不是全量:${finalDetail}。` : finalNotice,
495
515
  schemaVersion: typeof base.schemaVersion === 'number' || typeof base.schemaVersion === 'string'
496
516
  ? String(base.schemaVersion).slice(0, 20)
497
517
  : 1,
@@ -575,7 +595,10 @@ export class Output {
575
595
  if (options.persist === false || threshold <= 0)
576
596
  return value;
577
597
  const finalBudget = Math.max(1024, threshold - 1024);
578
- const chars = charsOf(value);
598
+ // 预算必须按**真正写出去的形态**算。给了 compactPaths 时,紧凑序列化能省掉近一半缩进空白
599
+ // (实测 caizhilian 的 180 条操作清单:全缩进 38,833 字符、operations 单行 19,324 字符),
600
+ // 而 `charsOf()` 恒按 2 空格缩进计数,会把本该完整放下的一份清单误判成超线并逐级切条目。
601
+ const chars = compactCharsOf(value, options.compactPaths);
579
602
  if (chars <= threshold)
580
603
  return value;
581
604
  // 字节数只用于回报(refs list / 通知文案),预算判断一律走字符。
@@ -629,6 +652,11 @@ export class Output {
629
652
  ? ' 本结果超过暂存容量上限,已保留本次结果并淘汰旧结果。'
630
653
  : '';
631
654
  return {
655
+ // 首行就是人话提示:模型只扫前几个键时也能先看到"已超线、别当全量用"。
656
+ largeOutputNotice: `结果 ${chars} 字符已超 stdout 预算 ${resultThresholdChars(this.ctx)} 字符,全量已暂存为本地 ref。`
657
+ + `取全量用 refs get ${meta.refId} <路径>(或 --input-ref ${meta.refId} 喂给下一条命令),`
658
+ + '不要重新调用业务接口。'
659
+ + retentionNotice,
632
660
  refId: meta.refId,
633
661
  resultPersisted: true,
634
662
  previewTruncated: true,
@@ -636,13 +664,19 @@ export class Output {
636
664
  expiresAt: meta.expiresAt,
637
665
  outputChars: chars,
638
666
  outputBytes: bytes,
639
- largeOutputNotice: `结果 ${chars} 字符已超 stdout 预算 ${resultThresholdChars(this.ctx)} 字符,全量已暂存为本地 ref。`
640
- + `取全量用 refs get ${meta.refId} <路径>(或 --input-ref ${meta.refId} 喂给下一条命令),`
641
- + '不要重新调用业务接口。'
642
- + retentionNotice,
643
667
  };
644
668
  }
645
669
  raw(message) {
646
670
  console.log(message);
647
671
  }
672
+ /**
673
+ * 当前生效的 stdout 预算(字符)。
674
+ *
675
+ * 给需要**自己判断"装不装得下"**的命令用(如 `schema --full`:装不下就改回完整清单,
676
+ * 而不是让输出层把 `operations` 切掉几条,让模型以为模块只有那么多个工具)。
677
+ * 统一走这里,避免各命令自己读 `BASH_MAX_OUTPUT_LENGTH` 或硬编码 28,000。
678
+ */
679
+ budgetChars() {
680
+ return resultThresholdChars(this.ctx);
681
+ }
648
682
  }