weaver-work-cli 0.1.1 → 0.1.4

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 (351) hide show
  1. package/README.md +187 -76
  2. package/dist/cmd/setup/index.js +5 -5
  3. package/dist/cmd/skills/index.js +1 -1
  4. package/dist/core/hooks.js +7 -0
  5. package/dist/index.js +0 -0
  6. package/dist/internal/e10/auth/commands.js +160 -55
  7. package/dist/internal/e10/auth/crypto.js +7 -22
  8. package/dist/internal/e10/auth/session.js +1 -1
  9. package/dist/internal/e10/auth/xiaoe.js +268 -0
  10. package/dist/internal/e10/context.js +16 -2
  11. package/dist/internal/e10/index.js +1 -0
  12. package/dist/internal/e10/request-runtime.js +344 -0
  13. package/dist/internal/skills/install.js +48 -6
  14. package/dist/internal/skills/reader.js +27 -0
  15. package/dist/shortcuts/archive/continuation.js +70 -0
  16. package/dist/shortcuts/archive/errors.js +53 -0
  17. package/dist/shortcuts/archive/host.js +197 -0
  18. package/dist/shortcuts/archive/index.js +363 -0
  19. package/dist/shortcuts/archive/manifest.js +45 -0
  20. package/dist/shortcuts/archive/operations/archive-info.js +55 -0
  21. package/dist/shortcuts/archive/operations/borrow-car.js +146 -0
  22. package/dist/shortcuts/archive/operations/borrow-list.js +200 -0
  23. package/dist/shortcuts/archive/operations/confirm.js +46 -0
  24. package/dist/shortcuts/archive/operations/download.js +238 -0
  25. package/dist/shortcuts/archive/operations/flow-url.js +240 -0
  26. package/dist/shortcuts/archive/operations/fonds.js +95 -0
  27. package/dist/shortcuts/archive/operations/getPageUrl.js +137 -0
  28. package/dist/shortcuts/archive/operations/registry.js +43 -0
  29. package/dist/shortcuts/archive/operations/search.js +88 -0
  30. package/dist/shortcuts/archive/operations/shared.js +120 -0
  31. package/dist/shortcuts/archive/operations/types.js +23 -0
  32. package/dist/shortcuts/archive/operations/upload.js +182 -0
  33. package/dist/shortcuts/archive/operations.js +13 -0
  34. package/dist/shortcuts/archive/render/search-format.js +276 -0
  35. package/dist/shortcuts/archive/render/search-view.js +125 -0
  36. package/dist/shortcuts/asset/continuation.js +70 -0
  37. package/dist/shortcuts/asset/errors.js +67 -0
  38. package/dist/shortcuts/asset/host.js +438 -0
  39. package/dist/shortcuts/asset/index.js +255 -0
  40. package/dist/shortcuts/asset/manifest.js +471 -0
  41. package/dist/shortcuts/asset/operations/query.js +249 -0
  42. package/dist/shortcuts/asset/operations/registry.js +85 -0
  43. package/dist/shortcuts/asset/operations/shared.js +100 -0
  44. package/dist/shortcuts/asset/operations/type-cache.js +49 -0
  45. package/dist/shortcuts/asset/operations/types.js +1 -0
  46. package/dist/shortcuts/asset/operations/viewlink.js +117 -0
  47. package/dist/shortcuts/asset/operations/write.js +435 -0
  48. package/dist/shortcuts/asset/operations.js +9 -0
  49. package/dist/shortcuts/calendar/continuation.js +70 -0
  50. package/dist/shortcuts/calendar/errors.js +53 -0
  51. package/dist/shortcuts/calendar/host.js +148 -0
  52. package/dist/shortcuts/calendar/index.js +125 -0
  53. package/dist/shortcuts/calendar/manifest.js +26 -0
  54. package/dist/shortcuts/calendar/operations/read.js +259 -0
  55. package/dist/shortcuts/calendar/operations/registry.js +31 -0
  56. package/dist/shortcuts/calendar/operations/shared.js +132 -0
  57. package/dist/shortcuts/calendar/operations/types.js +25 -0
  58. package/dist/shortcuts/calendar/operations/write.js +439 -0
  59. package/dist/shortcuts/calendar/operations.js +8 -0
  60. package/dist/shortcuts/ehr/continuation.js +70 -0
  61. package/dist/shortcuts/ehr/errors.js +53 -0
  62. package/dist/shortcuts/ehr/host.js +213 -0
  63. package/dist/shortcuts/ehr/index.js +205 -0
  64. package/dist/shortcuts/ehr/manifest.js +47 -0
  65. package/dist/shortcuts/ehr/operations/attend-read.js +373 -0
  66. package/dist/shortcuts/ehr/operations/attend-write.js +514 -0
  67. package/dist/shortcuts/ehr/operations/hr-contact.js +363 -0
  68. package/dist/shortcuts/ehr/operations/hr-ds.js +298 -0
  69. package/dist/shortcuts/ehr/operations/hr-report.js +386 -0
  70. package/dist/shortcuts/ehr/operations/recruit-write.js +1629 -0
  71. package/dist/shortcuts/ehr/operations/recruit.js +803 -0
  72. package/dist/shortcuts/ehr/operations/registry.js +43 -0
  73. package/dist/shortcuts/ehr/operations/salary.js +319 -0
  74. package/dist/shortcuts/ehr/operations/shared.js +246 -0
  75. package/dist/shortcuts/ehr/operations/types.js +25 -0
  76. package/dist/shortcuts/ehr/operations.js +25 -0
  77. package/dist/shortcuts/esb/continuation.js +70 -0
  78. package/dist/shortcuts/esb/errors.js +65 -0
  79. package/dist/shortcuts/esb/host.js +187 -0
  80. package/dist/shortcuts/esb/index.js +112 -0
  81. package/dist/shortcuts/esb/manifest.js +91 -0
  82. package/dist/shortcuts/esb/operations/input-format.js +31 -0
  83. package/dist/shortcuts/esb/operations/registry.js +48 -0
  84. package/dist/shortcuts/esb/operations/shared.js +152 -0
  85. package/dist/shortcuts/esb/operations/trigger.js +76 -0
  86. package/dist/shortcuts/esb/operations/types.js +21 -0
  87. package/dist/shortcuts/esb/operations.js +15 -0
  88. package/dist/shortcuts/fna/continuation.js +70 -0
  89. package/dist/shortcuts/fna/errors.js +59 -0
  90. package/dist/shortcuts/fna/host.js +146 -0
  91. package/dist/shortcuts/fna/index.js +111 -0
  92. package/dist/shortcuts/fna/manifest.js +41 -0
  93. package/dist/shortcuts/fna/operations/budget.js +124 -0
  94. package/dist/shortcuts/fna/operations/expense-center.js +148 -0
  95. package/dist/shortcuts/fna/operations/invoice-writeoff.js +212 -0
  96. package/dist/shortcuts/fna/operations/loan.js +195 -0
  97. package/dist/shortcuts/fna/operations/registry.js +35 -0
  98. package/dist/shortcuts/fna/operations/shared.js +210 -0
  99. package/dist/shortcuts/fna/operations/types.js +25 -0
  100. package/dist/shortcuts/fna/operations.js +19 -0
  101. package/dist/shortcuts/hrm/errors.js +38 -0
  102. package/dist/shortcuts/hrm/host.js +156 -0
  103. package/dist/shortcuts/hrm/index.js +111 -0
  104. package/dist/shortcuts/hrm/manifest.js +32 -0
  105. package/dist/shortcuts/hrm/operations/employee.js +338 -0
  106. package/dist/shortcuts/hrm/operations/org.js +110 -0
  107. package/dist/shortcuts/hrm/operations/position.js +176 -0
  108. package/dist/shortcuts/hrm/operations/registry.js +33 -0
  109. package/dist/shortcuts/hrm/operations/shared.js +143 -0
  110. package/dist/shortcuts/hrm/operations/types.js +23 -0
  111. package/dist/shortcuts/hrm/operations.js +19 -0
  112. package/dist/shortcuts/index.js +20 -0
  113. package/dist/shortcuts/invoice/host.js +99 -94
  114. package/dist/shortcuts/invoice/index.js +65 -61
  115. package/dist/shortcuts/invoice/manifest.js +222 -14
  116. package/dist/shortcuts/invoice/operations/browse-field.js +17 -0
  117. package/dist/shortcuts/invoice/operations/issuing.js +198 -0
  118. package/dist/shortcuts/invoice/operations/ocr-preview.js +6 -3
  119. package/dist/shortcuts/invoice/operations/registry.js +17 -0
  120. package/dist/shortcuts/invoice/operations/reim.js +401 -0
  121. package/dist/shortcuts/invoice/operations/shared.js +271 -6
  122. package/dist/shortcuts/invoice/operations/validate-preview.js +1 -1
  123. package/dist/shortcuts/jiuchuanhui/cache.js +441 -0
  124. package/dist/shortcuts/jiuchuanhui/continuation.js +70 -0
  125. package/dist/shortcuts/jiuchuanhui/errors.js +59 -0
  126. package/dist/shortcuts/jiuchuanhui/host.js +159 -0
  127. package/dist/shortcuts/jiuchuanhui/index.js +109 -0
  128. package/dist/shortcuts/jiuchuanhui/manifest.js +469 -0
  129. package/dist/shortcuts/jiuchuanhui/operations/datajson.js +214 -0
  130. package/dist/shortcuts/jiuchuanhui/operations/esb.js +157 -0
  131. package/dist/shortcuts/jiuchuanhui/operations/generic.js +146 -0
  132. package/dist/shortcuts/jiuchuanhui/operations/registry.js +133 -0
  133. package/dist/shortcuts/jiuchuanhui/operations/shared.js +158 -0
  134. package/dist/shortcuts/jiuchuanhui/operations/types.js +1 -0
  135. package/dist/shortcuts/jiuchuanhui/operations.js +8 -0
  136. package/dist/shortcuts/mail/continuation.js +70 -0
  137. package/dist/shortcuts/mail/errors.js +53 -0
  138. package/dist/shortcuts/mail/host.js +182 -0
  139. package/dist/shortcuts/mail/index.js +519 -0
  140. package/dist/shortcuts/mail/manifest.js +38 -0
  141. package/dist/shortcuts/mail/operations/mail-blacklist.js +79 -0
  142. package/dist/shortcuts/mail/operations/mail-contacts.js +195 -0
  143. package/dist/shortcuts/mail/operations/mail-manage.js +335 -0
  144. package/dist/shortcuts/mail/operations/mail-read.js +508 -0
  145. package/dist/shortcuts/mail/operations/mail-send.js +474 -0
  146. package/dist/shortcuts/mail/operations/mail-sign.js +203 -0
  147. package/dist/shortcuts/mail/operations/mail-template.js +170 -0
  148. package/dist/shortcuts/mail/operations/registry.js +41 -0
  149. package/dist/shortcuts/mail/operations/shared.js +64 -0
  150. package/dist/shortcuts/mail/operations/types.js +27 -0
  151. package/dist/shortcuts/mail/operations.js +19 -0
  152. package/dist/shortcuts/plan/continuation.js +70 -0
  153. package/dist/shortcuts/plan/errors.js +70 -0
  154. package/dist/shortcuts/plan/host.js +180 -0
  155. package/dist/shortcuts/plan/index.js +150 -0
  156. package/dist/shortcuts/plan/manifest.js +53 -0
  157. package/dist/shortcuts/plan/operations/link.js +256 -0
  158. package/dist/shortcuts/plan/operations/read.js +259 -0
  159. package/dist/shortcuts/plan/operations/registry.js +33 -0
  160. package/dist/shortcuts/plan/operations/shared.js +246 -0
  161. package/dist/shortcuts/plan/operations/types.js +49 -0
  162. package/dist/shortcuts/plan/operations/version.js +49 -0
  163. package/dist/shortcuts/plan/operations/write.js +710 -0
  164. package/dist/shortcuts/plan/operations.js +8 -0
  165. package/docs/SKILL.md +11 -7
  166. package/docs/_catalog.md +23 -5
  167. package/docs/agent-invoice.md +31 -10
  168. package/docs/agent-skill-install.md +211 -0
  169. package/docs/calendar.md +87 -0
  170. package/docs/e10-auth.md +28 -9
  171. package/docs/ehr.md +186 -0
  172. package/docs/esb.md +64 -0
  173. package/docs/fna.md +72 -0
  174. package/docs/hrm.md +89 -0
  175. package/docs/invoice.md +66 -20
  176. package/docs/jiuchuanhui.md +131 -0
  177. package/docs/operation-manual.md +443 -0
  178. package/docs/plan.md +82 -0
  179. package/docs/wenshuding.md +129 -0
  180. package/docs/ziguanjia.md +89 -0
  181. package/package.json +4 -4
  182. package/scripts/package-skill.mjs +127 -34
  183. package/scripts/postbuild.mjs +13 -0
  184. package/skill-template/business-info.json +13 -2
  185. package/skill-template/domains/calendar.md +15 -0
  186. package/skill-template/domains/esb.md +13 -0
  187. package/skill-template/domains/hrm.md +16 -0
  188. package/skill-template/domains/jiuchuanhui.md +23 -0
  189. package/skill-template/domains/jucailin.md +22 -0
  190. package/skill-template/domains/mail.md +21 -0
  191. package/skill-template/domains/plan.md +17 -0
  192. package/skill-template/domains/qiyecheng.md +17 -0
  193. package/skill-template/domains/shared.md +9 -3
  194. package/skill-template/domains/skill-maker.md +10 -0
  195. package/skill-template/domains/wenshuding.md +22 -0
  196. package/skill-template/domains/{invoice.md → yepiaotong.md} +4 -0
  197. package/skill-template/domains/ziguanjia.md +21 -0
  198. package/skill-template/master-skill-template.md +12 -6
  199. package/skill-template/skill-template.md +40 -9
  200. package/skills/weaver-e10-calendar/SKILL.md +101 -0
  201. package/skills/weaver-e10-calendar/product.json +8 -0
  202. package/skills/weaver-e10-calendar/references/calendar-app-check.md +65 -0
  203. package/skills/weaver-e10-calendar/references/calendar-dict.md +55 -0
  204. package/skills/weaver-e10-calendar/references/calendar-query.md +70 -0
  205. package/skills/weaver-e10-calendar/references/calendar-write.md +97 -0
  206. package/skills/weaver-e10-calendar/references/source-manifest.json +54 -0
  207. package/skills/weaver-e10-esb/SKILL.md +102 -0
  208. package/skills/weaver-e10-esb/product.json +8 -0
  209. package/skills/weaver-e10-esb/references/input-format.md +52 -0
  210. package/skills/weaver-e10-esb/references/source-manifest.json +242 -0
  211. package/skills/weaver-e10-esb/references/trigger.md +99 -0
  212. package/skills/weaver-e10-hrm/SKILL.md +87 -0
  213. package/skills/weaver-e10-hrm/product.json +8 -0
  214. package/skills/weaver-e10-hrm/references/employee.md +109 -0
  215. package/skills/weaver-e10-hrm/references/org.md +95 -0
  216. package/skills/weaver-e10-hrm/references/position.md +95 -0
  217. package/skills/weaver-e10-hrm/references/source-manifest.json +121 -0
  218. package/skills/weaver-e10-jiuchuanhui/SKILL.md +174 -0
  219. package/skills/weaver-e10-jiuchuanhui/product.json +8 -0
  220. package/skills/weaver-e10-jiuchuanhui/references/cache.md +110 -0
  221. package/skills/weaver-e10-jiuchuanhui/references/clue.md +61 -0
  222. package/skills/weaver-e10-jiuchuanhui/references/contact-plan.md +56 -0
  223. package/skills/weaver-e10-jiuchuanhui/references/contact-records.md +48 -0
  224. package/skills/weaver-e10-jiuchuanhui/references/contact.md +56 -0
  225. package/skills/weaver-e10-jiuchuanhui/references/customer.md +69 -0
  226. package/skills/weaver-e10-jiuchuanhui/references/disabled-capabilities.md +24 -0
  227. package/skills/weaver-e10-jiuchuanhui/references/discovery-config.md +60 -0
  228. package/skills/weaver-e10-jiuchuanhui/references/general-helpers.md +59 -0
  229. package/skills/weaver-e10-jiuchuanhui/references/jiuchuanhui-entry.md +60 -0
  230. package/skills/weaver-e10-jiuchuanhui/references/sale.md +72 -0
  231. package/skills/weaver-e10-jiuchuanhui/references/source-manifest.json +2632 -0
  232. package/skills/weaver-e10-jucailin/SKILL.md +101 -0
  233. package/skills/weaver-e10-jucailin/product.json +8 -0
  234. package/skills/weaver-e10-jucailin/references/attend-read.md +73 -0
  235. package/skills/weaver-e10-jucailin/references/attend-write.md +82 -0
  236. package/skills/weaver-e10-jucailin/references/hr-contact.md +92 -0
  237. package/skills/weaver-e10-jucailin/references/hr-datasource.md +104 -0
  238. package/skills/weaver-e10-jucailin/references/hr-report.md +76 -0
  239. package/skills/weaver-e10-jucailin/references/recruit-read.md +76 -0
  240. package/skills/weaver-e10-jucailin/references/recruit-write.md +70 -0
  241. package/skills/weaver-e10-jucailin/references/safety-boundaries.md +35 -0
  242. package/skills/weaver-e10-jucailin/references/salary.md +110 -0
  243. package/skills/weaver-e10-jucailin/references/source-manifest.json +152 -0
  244. package/skills/weaver-e10-mail/SKILL.md +151 -0
  245. package/skills/weaver-e10-mail/product.json +8 -0
  246. package/skills/weaver-e10-mail/references/mail-agent-entry.md +47 -0
  247. package/skills/weaver-e10-mail/references/mail-attachment.md +30 -0
  248. package/skills/weaver-e10-mail/references/mail-blacklist.md +27 -0
  249. package/skills/weaver-e10-mail/references/mail-contacts.md +33 -0
  250. package/skills/weaver-e10-mail/references/mail-manage.md +44 -0
  251. package/skills/weaver-e10-mail/references/mail-read.md +76 -0
  252. package/skills/weaver-e10-mail/references/mail-send.md +43 -0
  253. package/skills/weaver-e10-mail/references/mail-sign.md +33 -0
  254. package/skills/weaver-e10-mail/references/mail-template.md +31 -0
  255. package/skills/weaver-e10-mail/references/safety-boundaries.md +32 -0
  256. package/skills/weaver-e10-plan/SKILL.md +139 -0
  257. package/skills/weaver-e10-plan/product.json +8 -0
  258. package/skills/weaver-e10-plan/references/plan-collect-and-compose.md +123 -0
  259. package/skills/weaver-e10-plan/references/plan-overview-and-routing.md +138 -0
  260. package/skills/weaver-e10-plan/references/plan-report-query.md +154 -0
  261. package/skills/weaver-e10-plan/references/plan-report-remind.md +104 -0
  262. package/skills/weaver-e10-plan/references/plan-report-write.md +162 -0
  263. package/skills/weaver-e10-plan/references/source-manifest.json +858 -0
  264. package/skills/weaver-e10-qiyecheng/SKILL.md +118 -0
  265. package/skills/weaver-e10-qiyecheng/product.json +8 -0
  266. package/skills/weaver-e10-qiyecheng/references/budget.md +65 -0
  267. package/skills/weaver-e10-qiyecheng/references/catalog.md +56 -0
  268. package/skills/weaver-e10-qiyecheng/references/expense-center.md +51 -0
  269. package/skills/weaver-e10-qiyecheng/references/invoice-writeoff.md +57 -0
  270. package/skills/weaver-e10-qiyecheng/references/loan-management.md +59 -0
  271. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +698 -0
  272. package/skills/weaver-e10-shared/SKILL.md +86 -0
  273. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +127 -0
  274. package/skills/weaver-e10-shared/references/json-output-contract.md +120 -0
  275. package/skills/weaver-e10-shared/references/weaver-e10-installation.md +110 -0
  276. package/skills/weaver-e10-skill-maker/SKILL.md +77 -0
  277. package/skills/weaver-e10-skill-maker/product.json +8 -0
  278. package/skills/weaver-e10-skill-maker/references/business-skill-generation.md +124 -0
  279. package/skills/weaver-e10-skill-maker/references/detector-validation.md +101 -0
  280. package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +230 -0
  281. package/skills/weaver-e10-skill-maker/references/post-generation-install.md +105 -0
  282. package/skills/weaver-e10-skill-maker/references/source-update-detection.md +261 -0
  283. package/skills/weaver-e10-skill-maker/references/weaver-skill-style.md +141 -0
  284. package/skills/weaver-e10-wenshuding/SKILL.md +157 -0
  285. package/skills/weaver-e10-wenshuding/product.json +8 -0
  286. package/skills/weaver-e10-wenshuding/references/archive-agent-entry.md +63 -0
  287. package/skills/weaver-e10-wenshuding/references/archive-borrow-car.md +52 -0
  288. package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +52 -0
  289. package/skills/weaver-e10-wenshuding/references/archive-disabled-capabilities.md +22 -0
  290. package/skills/weaver-e10-wenshuding/references/archive-download.md +48 -0
  291. package/skills/weaver-e10-wenshuding/references/archive-flow.md +46 -0
  292. package/skills/weaver-e10-wenshuding/references/archive-fonds.md +34 -0
  293. package/skills/weaver-e10-wenshuding/references/archive-info.md +33 -0
  294. package/skills/weaver-e10-wenshuding/references/archive-search.md +52 -0
  295. package/skills/weaver-e10-wenshuding/references/archive-upload.md +41 -0
  296. package/skills/weaver-e10-wenshuding/references/source-manifest.json +517 -0
  297. package/skills/weaver-e10-yepiaotong/SKILL.md +184 -0
  298. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-add.md +1 -1
  299. package/skills/weaver-e10-yepiaotong/references/invoice-agent-entry.md +47 -0
  300. package/skills/weaver-e10-yepiaotong/references/invoice-browse-field-data.md +204 -0
  301. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-delete.md +1 -1
  302. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-detail.md +13 -5
  303. package/skills/weaver-e10-yepiaotong/references/invoice-disabled-capabilities.md +28 -0
  304. package/skills/weaver-e10-yepiaotong/references/invoice-download.md +31 -0
  305. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +45 -0
  306. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-file-upload.md +15 -4
  307. package/skills/weaver-e10-yepiaotong/references/invoice-import.md +45 -0
  308. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +120 -0
  309. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-field-rules.md +161 -0
  310. package/skills/weaver-e10-yepiaotong/references/invoice-issuing.md +99 -0
  311. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-ocr-preview.md +14 -4
  312. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +58 -0
  313. package/skills/weaver-e10-yepiaotong/references/invoice-red.md +261 -0
  314. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +97 -0
  315. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-update.md +1 -1
  316. package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/references/invoice-validation-preview.md +10 -3
  317. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +1340 -0
  318. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +845 -0
  319. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +94 -0
  320. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +449 -0
  321. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +266 -0
  322. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +494 -0
  323. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +1103 -0
  324. package/skills/weaver-e10-ziguanjia/SKILL.md +162 -0
  325. package/skills/weaver-e10-ziguanjia/product.json +8 -0
  326. package/skills/weaver-e10-ziguanjia/references/source-manifest.json +147 -0
  327. package/skills/weaver-e10-ziguanjia/references/ziguanjia-agent-entry.md +65 -0
  328. package/skills/weaver-e10-ziguanjia/references/ziguanjia-create.md +45 -0
  329. package/skills/weaver-e10-ziguanjia/references/ziguanjia-depre.md +48 -0
  330. package/skills/weaver-e10-ziguanjia/references/ziguanjia-disabled-capabilities.md +22 -0
  331. package/skills/weaver-e10-ziguanjia/references/ziguanjia-purch.md +57 -0
  332. package/skills/weaver-e10-ziguanjia/references/ziguanjia-query.md +62 -0
  333. package/skills/weaver-e10-ziguanjia/references/ziguanjia-repair.md +83 -0
  334. package/skills/weaver-e10-ziguanjia/references/ziguanjia-resolve.md +49 -0
  335. package/skills/weaver-e10-ziguanjia/references/ziguanjia-return.md +70 -0
  336. package/skills/weaver-e10-ziguanjia/references/ziguanjia-update.md +45 -0
  337. package/skills/weaver-e10-ziguanjia/references/ziguanjia-use.md +60 -0
  338. package/skills/weaver-e10-ziguanjia/references/ziguanjia-viewlink.md +81 -0
  339. package/skills/weaver-work-cli-invoice/SKILL.md +0 -103
  340. package/skills/weaver-work-cli-invoice/references/invoice-agent-entry.md +0 -38
  341. package/skills/weaver-work-cli-invoice/references/invoice-disabled-capabilities.md +0 -26
  342. package/skills/weaver-work-cli-invoice/references/invoice-download.md +0 -22
  343. package/skills/weaver-work-cli-invoice/references/invoice-enterprise-list.md +0 -35
  344. package/skills/weaver-work-cli-invoice/references/invoice-import.md +0 -28
  345. package/skills/weaver-work-cli-invoice/references/invoice-personal-list.md +0 -47
  346. package/skills/weaver-work-cli-shared/SKILL.md +0 -53
  347. package/skills/weaver-work-cli-shared/references/e10-auth-and-session.md +0 -83
  348. package/skills/weaver-work-cli-shared/references/json-output-contract.md +0 -61
  349. package/skills/weaver-work-cli-shared/references/weaver-work-cli-installation.md +0 -61
  350. /package/skills/{weaver-work-cli-shared → weaver-e10-shared}/references/high-risk-write.md +0 -0
  351. /package/skills/{weaver-work-cli-invoice → weaver-e10-yepiaotong}/product.json +0 -0
@@ -0,0 +1,129 @@
1
+ # 文书定档案管理 CLI
2
+
3
+ 来源 Skill:`weaver-e10-wenshuding`。本模块把接口文档中可安全自动化的能力封装为 `weaver-work-cli archive` 命令,供 AI Agent 通过结构化 JSON 调用。
4
+
5
+ 源码位于 `src/shortcuts/archive`。命令注册、`operation manifest` 和业务执行逻辑分离:manifest 由 `operations/registry.ts` 汇总各 operation 定义生成,具体执行逻辑在 `src/shortcuts/archive/operations` 中按业务分组维护(全宗、检索、档案信息、借阅车、借阅单、下载、流程 URL、上传)。
6
+
7
+ 面向 Agent 的说明位于 `skills/weaver-e10-wenshuding`。入口 `SKILL.md` 只负责共享规则和 reference 路由;具体细节拆在 `skills/weaver-e10-wenshuding/references/`,与飞书 CLI 的业务 Skill 组织方式保持一致。
8
+
9
+ ## 公共前置
10
+
11
+ 先通过 E10 鉴权模块登录:
12
+
13
+ ```text
14
+ weaver-work-cli auth login --base-url "https://weapp.xxx.cn" --agent_type "<当前智能体名称>"
15
+ weaver-work-cli auth status --no-check
16
+ ```
17
+
18
+ 每个档案业务请求由 CLI 托管:
19
+
20
+ 1. 读取当前 `weaver-work-cli auth` Profile 的 E10 会话。
21
+ 2. 请求统一走 `/api/` 路径,由 CLI 携带 E10 Cookie/ETEAMSID 与必要的业务头。
22
+ 3. 响应按 WeaResult(`code`/`status`/`data`)或 ebuilder 自定义接口(`datajson.status`)判定业务成功。
23
+
24
+ Agent 不得在业务 JSON 中传 Cookie、ETEAMSID、Token 或内部控制字段。
25
+
26
+ ## Agent 入口
27
+
28
+ 优先使用 `archive run <operation>`:
29
+
30
+ Windows PowerShell:
31
+
32
+ ```powershell
33
+ weaver-work-cli archive schema
34
+ weaver-work-cli --json archive run archive.borrow-car.list --input-json '{"pageNo":1,"pageSize":10}'
35
+ ```
36
+
37
+ macOS/Linux(bash/zsh):
38
+
39
+ ```bash
40
+ weaver-work-cli archive schema
41
+ weaver-work-cli --json archive run archive.borrow-car.list --input-json '{"pageNo":1,"pageSize":10}'
42
+ ```
43
+
44
+ 成功和失败都使用 JSON envelope。成功写 stdout;失败写 stderr,并设置非 0 退出码。
45
+
46
+ 当前输出层是完整 JSON 直接写 stdout,不提供飞书 CLI 的 `--jq`、`--format table/ndjson` 或通用 `--page-all`。Agent 使用时应默认小页读取和摘要渲染:列表先 `pageSize=10`,按 `pageNo` 继续;回复只展示关键字段和数量,超长响落本地文件后给路径。
47
+
48
+ ## Operation 目录
49
+
50
+ | Operation | 风险 | 固定规则 |
51
+ | --- | --- | --- |
52
+ | `archive.fonds.list` | 只读 | 默认 `menuSign=collectLib`;`id` 供后续链路复用 |
53
+ | `archive.prelib.tree` | 只读 | 只返回识别出的电子文件库节点,其 `id` 即上传 `treeId` |
54
+ | `archive.search.run` | 只读 | `key` 必填;结果行 `id`+`formId` 组成 `{档案ID}_{表单ID}` |
55
+ | `archive.info.get` | 只读 | `arcDangan` 与 `dataId`+`formId` 二选一 |
56
+ | `archive.borrow-car.list` | 只读 | 首选自定义接口 `myBorrowCar`,不可用时自动回退 ebuilder 链路 |
57
+ | `archive.borrow-car.add` | 写(免确认) | 直接传 `formAndIds` 分组;`logFlag=archiveSet`;全宗字段不参与加入借阅车 |
58
+ | `archive.borrow-list.list` | 只读 | 首选自定义接口 `myBorrowList`,不可用时回退「我的借阅」视图 |
59
+ | `archive.borrow-list.detail` | 只读 | 返回明细、可下载判定与流程 requestId |
60
+ | `archive.borrow-list.download.prepare/apply` | 高风险写 | prepare 校验未超期且有可下载原文;apply 轮询打包并落盘「下载」目录 |
61
+ | `archive.flow.borrow-car.prepare/apply` | 高风险写 | 缓存档案与借阅车两组参数,返回流程创建页 URL |
62
+ | `archive.flow.search.prepare/apply` | 高风险写 | 只缓存档案参数,返回流程创建页 URL |
63
+ | `archive.flow.renew.prepare/apply` | 高风险写 | 不缓存,`arcDataId` 直接传借阅单 `dataId`,URL 带 `isReNew=1` |
64
+ | `archive.upload.prelib.prepare/apply` | 高风险写 | continuation 绑定本地文件路径、全宗和 treeId;`preUploadCheck` → `module/upload` → `saveFile` |
65
+
66
+ 未绑定借阅流程时,`archive.flow.*.prepare` 返回 `validation/borrow_flow_unbound`,需要管理员先在档案设置中绑定借阅流程。
67
+
68
+ ## 常用命令
69
+
70
+ ```text
71
+ weaver-work-cli --json archive fonds --input-json '{"menuSign":"collectLib"}'
72
+ weaver-work-cli --json archive search --key 会计凭证 --page-size 10
73
+ weaver-work-cli archive search --key 会计凭证 --page-size 10 --format card
74
+ weaver-work-cli archive search --key 会计凭证 --page-size 10 --format html --output ./search.html
75
+ weaver-work-cli --json archive borrow-car list --page-no 1 --page-size 10
76
+ weaver-work-cli --json archive borrow-list list --page-no 1 --page-size 10
77
+ weaver-work-cli --json archive borrow-list detail --data-id BORROW_DATA_ID
78
+ weaver-work-cli --json archive info --arc-dangan 1252600626189156465_1190991330335571989
79
+ ```
80
+
81
+ 加入借阅车是低风险写操作,直接调用、不需要确认:
82
+
83
+ Windows PowerShell:
84
+
85
+ ```powershell
86
+ weaver-work-cli --json archive run archive.borrow-car.add --input .\borrow-car-add.json
87
+ ```
88
+
89
+ macOS/Linux(bash/zsh):
90
+
91
+ ```bash
92
+ weaver-work-cli --json archive run archive.borrow-car.add --input ./borrow-car-add.json
93
+ ```
94
+
95
+ `borrow-car-add.json` 示例:
96
+
97
+ ```json
98
+ { "formAndIds": [{ "formId": "1190991330335571989", "ids": ["1252600626189156465"] }] }
99
+ ```
100
+
101
+ 其余写操作(下载、发起借阅/续借、预归档上传)仍需 prepare、再 apply:
102
+
103
+ Windows PowerShell:
104
+
105
+ ```powershell
106
+ weaver-work-cli --json archive run archive.borrow-list.download.prepare --input-json '{"dataId":"BORROW_DATA_ID"}'
107
+
108
+ weaver-work-cli --json archive run archive.upload.prelib.prepare --input-json '{"file":"./档案.pdf","fondsId":"FONDS_ID"}'
109
+ ```
110
+
111
+ macOS/Linux(bash/zsh):
112
+
113
+ ```bash
114
+ weaver-work-cli --json archive run archive.borrow-list.download.prepare --input-json '{"dataId":"BORROW_DATA_ID"}'
115
+
116
+ weaver-work-cli --json archive run archive.upload.prelib.prepare --input-json '{"file":"./档案.pdf","fondsId":"FONDS_ID"}'
117
+ ```
118
+
119
+ ## 行为约定
120
+
121
+ - 全文检索结果的**默认返回显示样式是「卡片视图」**:`archive search --format card` 直接输出三段式 Markdown 卡片(标题可点击档案视图、命中词加粗、全宗/分类/日期一行),除用户明确要求外一律用该样式,不要用普通表格或 JSON 代替;`--format html` 可渲染成可落盘的 HTML。
122
+ - 借阅车/借阅单列表的默认返回显示样式是 **Markdown 表格**(列:序号/题名/类型/分类/时间/状态等可读字段),表头与各列内容 **居中显示**(分隔行用 `| :---: |`),不要用卡片、编号列表或 JSON 代替。
123
+ - 借阅车/借阅单列表优先自定义接口;接口未发布或报错时自动回退,回退行额外提供 `fields`/`display`。
124
+ - 加入借阅车(`archive.borrow-car.add`)是免确认写操作,直接提交;全宗信息只在预归档上传(`upload`)时查询,检索/借阅/下载流程不需要。
125
+ - 下载的 `.apply` 是异步任务:提交后每 2 秒轮询进度,完成后把 zip 保存到当前用户的「下载」目录(可用 `output` 指定路径),已存在同名文件时自动加序号。
126
+ - 发起借阅/续借只返回流程创建页 URL,CLI 不自动打开浏览器;上层 Agent 收到 URL 后默认调用**系统默认浏览器**打开,只有用户明确要求内置视图时才使用 IDE 内置浏览器。
127
+ - 写操作的 continuation 由 CLI 签发并绑定环境与登录账号,换环境或换账号必须重新 prepare。
128
+ - 写操作出现网络中断、部分成功或回查失败时返回 `partial/write_uncertain`,Agent 禁止自动重复提交。
129
+ - 涉及本地文件上传或原文下载时,必须先提醒用户文件内容可能进入大模型上下文,并取得明确确认。
@@ -0,0 +1,89 @@
1
+ # 资管家资产管理 CLI
2
+
3
+ 来源目录:`weaver-e10-ziguanjia`,内容版本未知。本模块把源资料中可安全自动化的能力封装为 `weaver-work-cli asset` 命令,供 AI Agent 通过结构化 JSON 调用。
4
+
5
+ 源码位于 `src/shortcuts/asset`。命令注册、operation manifest 和业务执行逻辑分离;具体执行逻辑在 `src/shortcuts/asset/operations` 中按 operation class 维护。
6
+
7
+ 面向 Agent 的说明位于 `skills/weaver-e10-ziguanjia`。入口 `SKILL.md` 只负责共享规则和 reference 路由;具体细节拆在 `skills/weaver-e10-ziguanjia/references/`,与飞书 CLI 的业务 Skill 组织方式保持一致。
8
+
9
+ ## 公共前置
10
+
11
+ 先通过 E10 鉴权模块登录:
12
+
13
+ ```text
14
+ weaver-work-cli auth login --base-url "https://weapp.xxx.cn" --agent_type "<当前智能体名称>"
15
+ weaver-work-cli auth status --no-check
16
+ ```
17
+
18
+ 每个资管家业务请求由 CLI 托管:读取当前 `weaver-work-cli auth` Profile 的 E10 会话,并调用 eBuilder 自定义接口(`/api/ebuilder/form/formdata/v2/*`)或 ESB 动作流(`/api/esb/server/event/triggerActionFlow`)。Agent 不得在业务 JSON 中传 Cookie、ETEAMSID、Token 或内部控制字段。
19
+
20
+ ## 版本门禁
21
+
22
+ 源资料约定:任何资产查询或写操作前,必须先确认 `zgjasset_search_appver` 存在 `ver_name ≥ V14` 的记录。CLI 在每个写操作中内置门禁,并额外暴露 `asset.gate.check` 供只读校验。门禁未通过时写操作会 STOP,不执行任何资产请求,也不走任何降级路径。
23
+
24
+ ## Agent 入口
25
+
26
+ 优先使用 `asset run <operation>`:
27
+
28
+ Windows PowerShell:
29
+
30
+ ```powershell
31
+ weaver-work-cli asset schema
32
+ weaver-work-cli --json asset run asset.list --input-json '{"page_size":10}'
33
+ ```
34
+
35
+ macOS/Linux(bash/zsh):
36
+
37
+ ```bash
38
+ weaver-work-cli asset schema
39
+ weaver-work-cli --json asset run asset.list --input-json '{"page_size":10}'
40
+ ```
41
+
42
+ 成功和失败都使用 JSON envelope。成功写 stdout;失败写 stderr,并设置非 0 退出码。
43
+
44
+ 当前输出层是完整 JSON 直接写 stdout,不提供飞书 CLI 的 `--jq`、`--format table/ndjson` 或通用 `--page-all`。Agent 使用时应默认小页读取和摘要渲染:列表先 `page_size=10`,按 `page_no` 继续;回复只展示关键字段和数量,超长详情/OCR/调试 JSON 落本地文件后给路径。
45
+
46
+ ## Operation 目录
47
+
48
+ | Operation | 风险 | 固定规则 |
49
+ | --- | --- | --- |
50
+ | `asset.gate.check` | 只读 | 版本门禁校验,返回是否通过 |
51
+ | `asset.list` | 只读 | 资产台账列表,按 mainTable 字段筛选 |
52
+ | `asset.detail` | 只读 | 资产详情,至少传 id / asset_number / asset_name 之一 |
53
+ | `asset.uselist` | 只读 | 领用列表,person_id 缺省查当前登录人 |
54
+ | `asset.repaillist` | 只读 | 报修列表,person_id 缺省查当前登录人 |
55
+ | `asset.purchaselist` | 只读 | 采购申请列表,person_id 缺省查当前登录人 |
56
+ | `asset.resolve.location` | 只读 | 按 house_name 解析存放地点 ID |
57
+ | `asset.resolve.status` | 只读 | 按 status_name 解析资产状态 ID |
58
+ | `asset.resolve.type` | 只读 | 按 type_name 解析资产类型 ID |
59
+ | `asset.create` | 高风险写 | eBuilder saveFormData;prepare 返回 continuation |
60
+ | `asset.update` | 高风险写 | eBuilder updateFormData;prepare 返回 continuation |
61
+ | `asset.use` | 高风险写 | ESB 动作流领用;prepare 返回 continuation |
62
+ | `asset.return.query` | 写前只读 | ESB 动作流查询可归还候选 |
63
+ | `asset.return.create` | 高风险写 | ESB 动作流归还;prepare 返回 continuation |
64
+ | `asset.repair.query` | 写前只读 | ESB 动作流查询报修候选 |
65
+ | `asset.repair.create` | 高风险写 | ESB 动作流报修;prepare 返回 continuation |
66
+ | `asset.purch` | 高风险写 | ESB 动作流采购申请;prepare 返回 continuation |
67
+ | `asset.depre` | 高风险写 | 折旧设置读取 + 预检 + 任务创建;prepare 返回 continuation |
68
+
69
+ 暂未暴露:资产调拨(`asset.transfer`)、流程审批(`asset.approve`)、图片上传(`asset.file.upload`)。原因见 `skills/weaver-e10-ziguanjia/references/ziguanjia-disabled-capabilities.md`。
70
+
71
+ ## 常用命令
72
+
73
+ ```text
74
+ weaver-work-cli --json asset run asset.gate.check --input-json '{}'
75
+ weaver-work-cli --json asset run asset.list --input-json '{"page_size":10}'
76
+ weaver-work-cli --json asset run asset.resolve.type --input-json '{"type_name":"EXAMPLE_TYPE"}'
77
+ weaver-work-cli --json asset run asset.create --input-json '{"asset_name":"EXAMPLE_ASSET","asset_type_browse":"EXAMPLE_TYPE_ID"}'
78
+ weaver-work-cli --json asset run asset.create --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
79
+ ```
80
+
81
+ ## 编辑白名单
82
+
83
+ 写操作的 `prepare` 阶段只接受 manifest 已声明字段;其中:
84
+
85
+ - `asset.update` 的 `changes` 只允许:`asset_name`、`stateid`、`admin_istrator`、`resourceid`、`location_browse`、`unit_price`、`value`。
86
+ - `asset.create` 不接受 `id`、内部控制字段或文件上传;图片仅接受已上传得到的裸 `file_id`。
87
+ - 所有写操作都不接受 `Cookie`、`ETEAMSID`、`token`、`sedit`、`app_key`、`app_secret`、`access_token` 等内部控制/凭据字段(CLI 会在输入层拒绝)。
88
+
89
+ 写请求已发送后如遇网络中断、部分成功或回查失败,CLI 返回 `partial/write_uncertain`,Agent 禁止自动重复提交。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "weaver-work-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.4",
4
4
  "description": "面向泛微工作工具链的可扩展 TypeScript CLI 基础框架(E10 业票通等能力)",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -18,11 +18,11 @@
18
18
  "scripts": {
19
19
  "dev": "tsx src/index.ts",
20
20
  "clean": "node scripts/clean.mjs",
21
- "build": "npm run clean && tsc",
22
- "test": "node --test --import tsx \"test/**/*.test.ts\"",
21
+ "build": "npm run clean && tsc && node scripts/postbuild.mjs",
22
+ "test": "node --import tsx --test $(find test -name '*.test.ts' -type f | sort)",
23
23
  "start": "node dist/index.js",
24
24
  "build:skill": "node scripts/package-skill.mjs",
25
- "build:invoice-skill": "node scripts/package-skill.mjs invoice",
25
+ "build:yepiaotong-skill": "node scripts/package-skill.mjs yepiaotong",
26
26
  "prepublishOnly": "npm run build && npm run test",
27
27
  "prepack": "npm run build"
28
28
  },
@@ -1,33 +1,24 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { createHash } from 'node:crypto'
4
- import { copyFile, mkdir, mkdtemp, readFile, readdir, rm, stat } from 'node:fs/promises'
4
+ import { copyFile, mkdir, mkdtemp, readFile, readdir, rm, stat, writeFile } from 'node:fs/promises'
5
5
  import os from 'node:os'
6
6
  import path from 'node:path'
7
- import { spawn } from 'node:child_process'
8
7
  import { fileURLToPath } from 'node:url'
8
+ import { deflateRawSync } from 'node:zlib'
9
9
 
10
10
  const repositoryRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
11
11
  const skillsRoot = path.join(repositoryRoot, 'skills')
12
- const sharedSkillName = 'weaver-work-cli-shared'
12
+ const sharedSkillName = 'weaver-e10-shared'
13
+ const legacySharedSkillName = 'weaver-work-cli-shared'
14
+ const skillPrefix = 'weaver-e10-'
15
+ const legacySkillPrefix = 'weaver-work-cli-'
13
16
  const [requestedSkillArg, outputArg] = process.argv.slice(2)
14
17
 
15
18
  function sha256(value) {
16
19
  return createHash('sha256').update(value).digest('hex')
17
20
  }
18
21
 
19
- function run(command, args, cwd) {
20
- return new Promise((resolve, reject) => {
21
- const child = spawn(command, args, { cwd, stdio: ['ignore', 'pipe', 'pipe'] })
22
- let stdout = ''
23
- let stderr = ''
24
- child.stdout.on('data', (chunk) => { stdout += chunk })
25
- child.stderr.on('data', (chunk) => { stderr += chunk })
26
- child.once('error', reject)
27
- child.once('close', (code) => resolve({ code: code ?? 1, stdout, stderr }))
28
- })
29
- }
30
-
31
22
  function normalizeSkillName(value) {
32
23
  if (!value || value === 'all') return null
33
24
  if (value.includes('/') || value.includes('\\') || value === '.' || value === '..') {
@@ -36,7 +27,8 @@ function normalizeSkillName(value) {
36
27
  if (!/^[A-Za-z0-9._-]+$/u.test(value)) {
37
28
  throw new Error(`非法 Skill 名称:${value}`)
38
29
  }
39
- return value.startsWith('weaver-work-cli-') ? value : `weaver-work-cli-${value}`
30
+ if (value.startsWith(legacySkillPrefix)) return `${skillPrefix}${value.slice(legacySkillPrefix.length)}`
31
+ return value.startsWith(skillPrefix) ? value : `${skillPrefix}${value}`
40
32
  }
41
33
 
42
34
  async function exists(filename) {
@@ -76,7 +68,7 @@ function defaultOutput(skillNames) {
76
68
  return path.join(repositoryRoot, 'dist', `${requestedSkill}-skill.zip`)
77
69
  }
78
70
  if (skillNames.length === 1) return path.join(repositoryRoot, 'dist', `${skillNames[0]}-skill.zip`)
79
- return path.join(repositoryRoot, 'dist', 'weaver-work-cli-skills.zip')
71
+ return path.join(repositoryRoot, 'dist', 'weaver-e10-skills.zip')
80
72
  }
81
73
 
82
74
  function shouldSkip(entry, relativePath) {
@@ -91,9 +83,111 @@ function assertSafeRelativePath(relativePath) {
91
83
  }
92
84
  }
93
85
 
94
- async function copySkill(skillName, stagingRoot, packagedEntries) {
86
+ function crc32(buffer) {
87
+ let crc = 0xffffffff
88
+ for (const byte of buffer) {
89
+ crc ^= byte
90
+ for (let bit = 0; bit < 8; bit += 1) {
91
+ crc = (crc >>> 1) ^ (crc & 1 ? 0xedb88320 : 0)
92
+ }
93
+ }
94
+ return (crc ^ 0xffffffff) >>> 0
95
+ }
96
+
97
+ function dosTimestamp() {
98
+ return { time: 0, date: 33 }
99
+ }
100
+
101
+ function uint16(value) {
102
+ const buffer = Buffer.alloc(2)
103
+ buffer.writeUInt16LE(value)
104
+ return buffer
105
+ }
106
+
107
+ function uint32(value) {
108
+ const buffer = Buffer.alloc(4)
109
+ buffer.writeUInt32LE(value)
110
+ return buffer
111
+ }
112
+
113
+ async function createZipArchive(root, entries) {
114
+ const timestamp = dosTimestamp()
115
+ const localParts = []
116
+ const centralParts = []
117
+ let offset = 0
118
+
119
+ for (const entry of entries) {
120
+ const name = Buffer.from(entry, 'utf8')
121
+ const body = await readFile(path.join(root, ...entry.split('/')))
122
+ const deflated = deflateRawSync(body, { level: 9 })
123
+ const compressed = deflated.length < body.length ? deflated : body
124
+ const method = compressed === deflated ? 8 : 0
125
+ const checksum = crc32(body)
126
+ const flags = 0x0800
127
+
128
+ const localHeader = Buffer.concat([
129
+ uint32(0x04034b50),
130
+ uint16(20),
131
+ uint16(flags),
132
+ uint16(method),
133
+ uint16(timestamp.time),
134
+ uint16(timestamp.date),
135
+ uint32(checksum),
136
+ uint32(compressed.length),
137
+ uint32(body.length),
138
+ uint16(name.length),
139
+ uint16(0),
140
+ name,
141
+ ])
142
+ localParts.push(localHeader, compressed)
143
+
144
+ const centralHeader = Buffer.concat([
145
+ uint32(0x02014b50),
146
+ uint16(20),
147
+ uint16(20),
148
+ uint16(flags),
149
+ uint16(method),
150
+ uint16(timestamp.time),
151
+ uint16(timestamp.date),
152
+ uint32(checksum),
153
+ uint32(compressed.length),
154
+ uint32(body.length),
155
+ uint16(name.length),
156
+ uint16(0),
157
+ uint16(0),
158
+ uint16(0),
159
+ uint16(0),
160
+ uint32(0),
161
+ uint32(offset),
162
+ name,
163
+ ])
164
+ centralParts.push(centralHeader)
165
+ offset += localHeader.length + compressed.length
166
+ }
167
+
168
+ const centralDirectory = Buffer.concat(centralParts)
169
+ const end = Buffer.concat([
170
+ uint32(0x06054b50),
171
+ uint16(0),
172
+ uint16(0),
173
+ uint16(entries.length),
174
+ uint16(entries.length),
175
+ uint32(centralDirectory.length),
176
+ uint32(offset),
177
+ uint16(0),
178
+ ])
179
+
180
+ return Buffer.concat([...localParts, centralDirectory, end])
181
+ }
182
+
183
+ function rewriteSkillContent(skillName, relativePath, content) {
184
+ if (skillName !== legacySharedSkillName || relativePath !== 'SKILL.md') return content
185
+ return content.replace(/^name:\s*weaver-e10-shared\s*$/mu, `name: ${legacySharedSkillName}`)
186
+ }
187
+
188
+ async function copySkill(skillName, stagingRoot, packagedEntries, packageName = skillName) {
95
189
  const sourceRoot = path.join(skillsRoot, skillName)
96
- const packageRoot = path.join(stagingRoot, skillName)
190
+ const packageRoot = path.join(stagingRoot, packageName)
97
191
  await stat(path.join(sourceRoot, 'SKILL.md'))
98
192
 
99
193
  async function copyDir(relativeDir = '') {
@@ -113,8 +207,13 @@ async function copySkill(skillName, stagingRoot, packagedEntries) {
113
207
  await copyDir(relativePath)
114
208
  } else if (entry.isFile()) {
115
209
  await mkdir(path.dirname(target), { recursive: true, mode: 0o700 })
116
- await copyFile(source, target)
117
- packagedEntries.push(`${skillName}/${relativePath}`)
210
+ if (packageName === skillName) {
211
+ await copyFile(source, target)
212
+ } else {
213
+ const content = await readFile(source, 'utf8')
214
+ await writeFile(target, rewriteSkillContent(packageName, relativePath, content))
215
+ }
216
+ packagedEntries.push(`${packageName}/${relativePath}`)
118
217
  }
119
218
  }
120
219
  }
@@ -134,31 +233,25 @@ const skillNames = await resolveSkillNames()
134
233
  if (skillNames.length === 0) throw new Error('没有可打包的 Skill')
135
234
 
136
235
  const output = path.resolve(outputArg || defaultOutput(skillNames))
137
- const stagingRoot = await mkdtemp(path.join(os.tmpdir(), 'weaver-work-cli-skill-'))
236
+ const stagingRoot = await mkdtemp(path.join(os.tmpdir(), 'weaver-e10-skill-'))
138
237
  const packagedEntries = []
139
238
 
140
239
  try {
141
240
  await mkdir(path.dirname(output), { recursive: true, mode: 0o700 })
142
241
  for (const skillName of skillNames) {
143
242
  await copySkill(skillName, stagingRoot, packagedEntries)
243
+ if (skillName === sharedSkillName) {
244
+ await copySkill(skillName, stagingRoot, packagedEntries, legacySharedSkillName)
245
+ }
144
246
  }
145
247
 
146
248
  await rm(output, { force: true })
147
- const zipResult = await run('zip', ['-X', '-q', '-r', output, ...skillNames], stagingRoot)
148
- if (zipResult.code !== 0) throw new Error(`Skill ZIP 打包失败:${zipResult.stderr.trim()}`)
149
-
150
- const archive = await readFile(output)
151
- const listResult = await run('unzip', ['-Z1', output], repositoryRoot)
152
- if (listResult.code !== 0) throw new Error(`Skill ZIP 校验失败:${listResult.stderr.trim()}`)
153
-
154
- const actualEntries = listResult.stdout.trim().split(/\r?\n/u).filter((entry) => entry && !entry.endsWith('/')).sort()
155
249
  const expectedEntries = packagedEntries.sort()
156
- if (JSON.stringify(actualEntries) !== JSON.stringify(expectedEntries)) {
157
- throw new Error(`Skill ZIP 闭包不匹配:${JSON.stringify(actualEntries)}`)
158
- }
250
+ const archive = await createZipArchive(stagingRoot, expectedEntries)
251
+ await writeFile(output, archive)
159
252
  if (archive.length > 256 * 1024) throw new Error(`Skill ZIP 超过 256 KiB:${archive.length}`)
160
253
 
161
- console.log(JSON.stringify({ ok: true, output, bytes: (await stat(output)).size, sha256: sha256(archive), skills: skillNames, entries: actualEntries }, null, 2))
254
+ console.log(JSON.stringify({ ok: true, output, bytes: (await stat(output)).size, sha256: sha256(archive), skills: skillNames, entries: expectedEntries }, null, 2))
162
255
  } finally {
163
256
  await rm(stagingRoot, { recursive: true, force: true })
164
257
  }
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env node
2
+
3
+ // 构建后把 bin 入口设为可执行,保证 `npm link` 场景下全局命令可运行。
4
+ // tsc 每次重建 dist/index.js 都会把权限重置为 644,因此放在 build 之后执行。
5
+ import { chmodSync, existsSync } from 'node:fs';
6
+ import { fileURLToPath } from 'node:url';
7
+
8
+ const entry = fileURLToPath(new URL('../dist/index.js', import.meta.url));
9
+
10
+ if (existsSync(entry)) {
11
+ chmodSync(entry, 0o755);
12
+ console.log('postbuild: dist/index.js mode set to 755');
13
+ }
@@ -1,4 +1,15 @@
1
1
  {
2
- "weaver-work-cli-invoice": ["业票通", "发票", "票夹", "OCR", "查验", "报销发票"],
3
- "weaver-work-cli-shared": ["安装", "登录", "认证", "E10", "profile", "JSON 输出", "高风险写入"]
2
+ "weaver-e10-wenshuding": ["文书定", "档案", "全宗", "预归档", "档案检索", "全文检索", "借阅车", "借阅单", "借阅", "续借", "档案下载", "原文下载", "预归档上传", "电子文件库"],
3
+ "weaver-e10-yepiaotong": ["业票通", "发票", "票夹", "OCR", "查验", "报销发票", "自动填单", "事前申请报销", "开票", "存台账", "发票浏览按钮"],
4
+ "weaver-e10-jucailin": ["聚才林", "人事", "人事档案", "通讯录", "出勤", "考勤", "打卡", "申诉", "薪酬", "工资单", "社保", "招聘", "人才", "候选人", "面试", "Offer", "入职"],
5
+ "weaver-e10-qiyecheng": ["齐业成", "费控", "FNA", "预算", "事前申请", "预算执行", "报销", "借款", "还款提醒", "预付", "核销", "发票核销", "催票", "对公支付"],
6
+ "weaver-e10-hrm": ["组织管理", "员工", "人员", "工号", "下属", "部门", "分部", "组织架构", "岗位", "职位", "批量查人员", "批量查岗位"],
7
+ "weaver-e10-esb": ["ESB", "动作流", "触发动作流", "执行动作流", "自定义触发", "入参模板", "ESB中心"],
8
+ "weaver-e10-mail": ["邮件", "收件箱", "发件箱", "草稿箱", "已删除", "待办邮件", "垃圾箱", "邮件正文", "附件", "发送邮件", "回复", "转发", "存草稿", "标星", "已读", "待办提醒", "移动邮件", "删除邮件", "撤回", "文件夹", "联系人", "联系人分组", "邮件模板", "签名", "二维码名片", "黑名单"],
9
+ "weaver-e10-calendar": ["日程", "日历", "安排", "提醒", "日程列表", "日程详情", "创建日程", "更新日程", "删除日程", "日程类型", "紧急程度", "参与人"],
10
+ "weaver-e10-plan": ["计划报告", "报告", "周报", "月报", "季报", "年报", "年中报告", "工作总结", "汇总工作", "新建报告", "修改报告", "发布报告", "撤回报告", "共享报告", "提交提醒", "报告评论", "报告详情"],
11
+ "weaver-e10-jiuchuanhui": ["九氚汇", "营销管理", "CRM", "客户", "联系人", "商机", "线索", "联系计划", "联系记录", "跟进记录", "公海", "客户公海", "赢单", "输单", "线索转客户", "客户经理"],
12
+ "weaver-e10-skill-maker": ["业务模块 CLI", "业务模块 Skill", "生成 Skill", "生成 operation", "自定义 Skill", "能力封装", "源资料更新检测"],
13
+ "weaver-e10-shared": ["安装", "登录", "认证", "E10", "profile", "JSON 输出", "高风险写入"],
14
+ "weaver-e10-ziguanjia": ["资管家", "资产管理", "固定资产", "资产", "资产领用", "资产归还", "资产报修", "资产采购", "折旧", "资产地点", "资产状态", "资产类型"]
4
15
  }
@@ -0,0 +1,15 @@
1
+ 本业务域用于 E10 日程管理。入口 `SKILL.md` 按 weaver 风格组织:CRITICAL 共享前置、路由优先级、高优先级语义、写操作确认链、执行原则、失败处理和「不在范围」。具体用法拆到 `references/`:
2
+
3
+ - `calendar-query.md`:日程列表(ESB 流程触发)、日程详情、日程总数。
4
+ - `calendar-dict.md`:日程类型、紧急程度字典(创建/更新前取选项 ID)。
5
+ - `calendar-write.md`:创建、更新(全量覆盖)、删除日程的 `prepare -> apply` 写入协议。
6
+ - `calendar-app-check.md`:应用版本检测与详情卡片页链接。
7
+
8
+ Agent 调优重点:
9
+
10
+ - `weaver-work-cli calendar schema` 是 operation 合约第一信息源。
11
+ - 业务输入不得包含 Cookie、ETEAMSID、Token 或内部控制字段;`header.operator` 由 CLI 自动填充。
12
+ - `agn_type`/`priority` 传选项 ID(先查字典),`participants` 传人员 ID(先由 weaver-e10-hrm 解析姓名)。
13
+ - 写操作只接受 CLI 生成的 continuation,不手工构造或复用;`confirm=true` 必须由用户明确确认后传入。
14
+ - 更新为全量覆盖,`update.prepare` 先查当前详情再合并;删除不可逆,务必 prepare 展示后确认。
15
+ - 结果为 `partial/write_uncertain` 时停止,不自动重放写请求。
@@ -0,0 +1,13 @@
1
+ 本业务域用于泛微 E10 ESB 中心的自定义触发动作流(取入参模板 + 触发执行)。入口 `SKILL.md` 先路由到 `weaver-e10-shared/SKILL.md`,再给出触发标识语义、写操作确认链和失败决策树。具体用法拆到 `references/`:
2
+
3
+ - `input-format.md`:按动作流 ID 取 `customParams` 模板、识别 `#可选` 占位字段、只读查询的失败处理。
4
+ - `trigger.md`:`esb.trigger.prepare` → `esb.trigger.apply` 确认链、请求体组装、结果判读(`resultCode` / `actionData` / `followUp`)与失败处置。
5
+ - `source-manifest.json`:源资料清单与 sha256 指纹,用于源资料更新检测。
6
+
7
+ 调优重点:
8
+
9
+ - `weaver-work-cli esb schema` 是 operation 合约第一信息源;`withheldOperations` 声明按名称解析 ID(`esb.actionflow.resolve`)与唯一值 `primary_key` 查询(`esb.unique-indent.resolve`)两条禁用边界,直接说明不可用,不引导用户绕过。
10
+ - 触发标识 `esbFlowId` 与 `uniqueIndent` 二选一:都传或多缺均为结构化校验错误,不得静默回退;唯一值触发存在「同租户多流同唯一值只执行 create_time 最新一条」的歧义,精确控制要求用户改传 `esbFlowId`。
11
+ - **trigger 是写操作**:必须先 `prepare` 并把 `requestPreview` 展示给用户确认,再 `apply` 且 `confirm: true`。
12
+ - `write_uncertain` 出现时必须立即停止:请求已发出但结果未知,禁止重试,先查动作流运行日志。
13
+ - 限流类错误(`throttled`)只提示稍后重试,不做高频轮询。
@@ -0,0 +1,16 @@
1
+ 本业务域用于泛微 E10 组织管理(员工查询 / 组织架构 / 岗位查询,全部只读)。入口 `SKILL.md` 先路由到 `weaver-e10-shared/SKILL.md`,再给出跨模块约定、Reference 路由表和安全边界。具体用法拆到 `references/`:
2
+
3
+ - `employee.md`:按工号/姓名/手机/邮箱查员工、批量人员、资料名片、下属查询(当前登录人 + 按 id)、部门成员。
4
+ - `org.md`:分部/部门浏览、组织详情、多级路径 drill-down 编排。
5
+ - `position.md`:岗位浏览、岗位详情、岗位批量(岗位地址簿)。
6
+ - `source-manifest.json`:源资料清单与 sha256 指纹,用于源资料更新检测。
7
+
8
+ 调优重点:
9
+
10
+ - `weaver-work-cli hrm schema` 是 operation 合约第一信息源,`withheldOperations` 声明代理商查询禁用边界。
11
+ - 三个业务域统一 `WeaResult` 响应契约,已在 CLI 内归一化;但「员工浏览/下属查询的 total 需额外请求 count/resource」这一差异必须由 Agent 正确解读。
12
+ - 长整型 id 一律按字符串传递;手机号已由 CLI 脱敏。
13
+ - **无条件禁止全量拉取**:`employee.query`/`org.query`/`position.query` 必须带收敛条件;`position.list` 无过滤需显式 `all=true`;`employee.query` 的 `status` 不能单独使用。
14
+ - 姓名/工号/名称模糊匹配多人命中时必须列候选让用户选择,不得自动取第一条;部门重名改传组织 id。
15
+ - 批量查询禁止循环单查:批量人员走 `employee.batch`,岗位批量走 `position.list`。
16
+ - 代理商查询(`containsDls=true`)属禁用边界,直接说明不可用,不引导用户绕过。
@@ -0,0 +1,23 @@
1
+ 本业务域用于 E10 九氚汇营销管理 CRM。入口 `SKILL.md` 按飞书 `lark-approval` 风格组织:CRITICAL 共享前置、路由优先级、高优先级语义、逐 operation 命令表、处理链、执行原则、写操作失败决策树和“不在范围”。具体用法拆到 `references/`:
2
+
3
+ - `jiuchuanhui-entry.md`:schema、统一 `jiuchuanhui run` 入口、JSON 输入方式。
4
+ - `customer.md`:客户创建/详情/搜索/修改/转移/公海/查重/联系记录的写入协议与搜索约束。
5
+ - `contact.md`:联系人创建/详情/修改/按事项查询。
6
+ - `sale.md`:商机创建/详情/搜索/修改/阶段/赢单/输单/无效/暂停/重启/转移/关联联系人/联系记录。
7
+ - `clue.md`:线索创建/详情/搜索/修改/状态变更/转客户/线索池/跟进记录。
8
+ - `contact-plan.md`:创建/完成联系计划的 `type` 联动规则。
9
+ - `contact-records.md`:按事项或按人员+时间范围查询联系记录。
10
+ - `discovery-config.md`:应用/表单/字段/选项/接口配置/文件预览的发现与配置,含缓存初始化边界。
11
+ - `general-helpers.md`:按名称查事项/人员 ID、当前人员、权限校验、工商照面、字段信息、自定义浏览选项。
12
+ - `disabled-capabilities.md`:缓存初始化、商机阶段推进等未暴露能力的处理边界。
13
+ - `source-manifest.json`:源资料指纹、`sourceChunks`/`operationImpact` 影响索引和产物基线。
14
+
15
+ Agent 调优重点:
16
+
17
+ - `weaver-work-cli jiuchuanhui schema` 是 operation 合约第一信息源。
18
+ - 业务输入不得包含 Cookie、ETEAMSID、Token 或内部控制字段。
19
+ - 写操作只接受 CLI 生成的 continuation,不手工构造或复用。
20
+ - 选项字段先取选项 ID 再传值;`RelateBrowser` 用 `browser-option.search`;行政区划用逗号分隔全路径 ID。
21
+ - 客户搜索必须显式传 `mine`/`all`/`customerSea`,没有 `scope` 快捷参数。
22
+ - 新建客户前先查重;赢单/输单/无效/释放公海前提示不可逆或关键影响。
23
+ - 结果为 `partial/write_uncertain` 时停止,不自动重放写请求。
@@ -0,0 +1,22 @@
1
+ 本业务域用于泛微聚才林(E10 人事云)的人事档案、出勤管理、薪酬管理、招聘查询(只读)。入口 `SKILL.md` 先路由到 `weaver-e10-shared/SKILL.md`,再给出跨子系统差异、Reference 路由表和安全边界。具体用法拆到 `references/`:
2
+
3
+ - `salary.md`:工资单、福利、调薪记录、社保台账、员工薪资明细查询。
4
+ - `attend-read.md`:出勤统计、异常考勤、打卡记录、外勤轨迹、假期统计、申诉查询。
5
+ - `attend-write.md`:PC 端打卡、创建申诉、处理申诉、报表重算的 `prepare -> apply` 写入协议。
6
+ - `hr-contact.md`:通讯录、字段列表、浏览器选择器、生日查询、人员状态变更台账。
7
+ - `hr-datasource.md`:HR 数据源通用查询(历史时点名册、离职名册、编制、流动分析等)。
8
+ - `hr-report.md`:部门/岗位/职务/职类人数、流失离职、占编人员、流动明细、属性合计。
9
+ - `recruit-read.md`:人才库搜索、招聘需求/职位/入职/录用列表、人才详情卡片(只读)。
10
+ - `safety-boundaries.md`:招聘写操作与移动端打卡的禁用边界,以及通用禁止项。
11
+ - `source-manifest.json`:源资料清单与 sha256 指纹,用于源资料更新检测。
12
+
13
+ 调优重点:
14
+
15
+ - `weaver-work-cli ehr schema` 是 operation 合约第一信息源,`dataSourceIds` 提供固定 formId 常量表。
16
+ - 三个子系统的响应成功判定与分页结构不统一,已在 CLI 内归一化;但「通讯录默认在职、状态变更默认含离职」的语义差异必须由 Agent 正确解读。
17
+ - 姓名、工号等模糊条件多人命中时必须列候选让用户选择,浏览器选择器返回多条时看 `requiresDisambiguation`。
18
+ - 占编人员查询的 `cfgId`/`id` 必须先从数据源记录解析,禁止编造。
19
+ - 招聘查询的运行时参数由 CLI 自动五层解析并缓存,业务输入只描述业务对象与意图;人才/需求等模糊命中多人时同样必须列候选让用户确认。
20
+ - 写操作只接受 CLI 生成的 continuation,不手工构造或复用;`apply` 不自动重试。
21
+ - 招聘写操作与移动端打卡属禁用边界,直接说明不可用,不引导用户绕过。
22
+ - 结果为 `partial/write_uncertain` 时停止,先做只读回查。
@@ -0,0 +1,21 @@
1
+ 本业务域用于 E10 邮件管理。入口 `SKILL.md` 按飞书风格组织:CRITICAL 共享前置、路由优先级、高优先级语义、逐 operation 命令表、处理链、执行原则、写操作失败决策树和“不在范围”。具体用法拆到 `references/`:
2
+
3
+ - `mail-agent-entry.md`:schema、统一 `mail run` 入口、stdin JSON 调用方式。
4
+ - `mail-read.md`:邮件列表/详情/正文/未读统计/配置、收件人解析、联系人/分组/模板/签名/黑名单列表与附件中心。
5
+ - `mail-send.md`:发送/回复/转发/存草稿的 `prepare -> apply` 写入协议。
6
+ - `mail-manage.md`:标星、已读、全部已读、待办、移动、逻辑删除、文件夹、撤回。
7
+ - `mail-contacts.md`:联系人/分组的 `prepare -> apply` 保存与删除。
8
+ - `mail-template.md`:模板的 `prepare -> apply` 保存、编辑、删除与默认。
9
+ - `mail-sign.md`:签名的 `prepare -> apply` 保存、编辑、删除、默认与二维码名片。
10
+ - `mail-blacklist.md`:黑名单新增/删除的 `prepare -> apply` 协议。
11
+ - `mail-attachment.md`:附件上传(预检→上传→绑定)与批量下载。
12
+ - `safety-boundaries.md`:已暂缓的破坏性/缺口 operation(物理永久删除、重发)与高风险写约束。
13
+
14
+ Agent 调优重点:
15
+
16
+ - `weaver-work-cli mail schema` 是 operation 合约第一信息源。
17
+ - 业务输入不得包含 Cookie、ETEAMSID、Token 或内部控制字段。
18
+ - 写操作只接受 CLI 生成的 continuation,不手工构造或复用。
19
+ - 发送、联系人/分组/模板/签名保存、黑名单操作必须先展示摘要并取得明确确认。
20
+ - 结果为 `partial/write_uncertain` 时停止,不自动重放写请求。
21
+ - 物理永久删除(`mail.delete.batch`)与重发(`mail.resend`)未暴露,需单独授权处理。