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,131 @@
1
+ # 九氚汇营销管理 CLI
2
+
3
+ 来源目录:`weaver-e10-jiuchuanhui`,内容版本 `1.1.1`。本模块把接口文档中可安全自动化的能力封装为 `weaver-work-cli jiuchuanhui` 命令,供 AI Agent 通过结构化 JSON 调用。
4
+
5
+ 源码位于 `src/shortcuts/jiuchuanhui`。命令注册、operation manifest 和业务执行逻辑分离;具体执行逻辑在 `src/shortcuts/jiuchuanhui/operations` 中按 operation class 维护。
6
+
7
+ 面向 Agent 的说明位于 `skills/weaver-e10-jiuchuanhui`。入口 `SKILL.md` 只负责共享规则和 reference 路由;具体细节拆在 `skills/weaver-e10-jiuchuanhui/references/`,与飞书 CLI 的业务 Skill 组织方式保持一致。
8
+
9
+ ## 公共前置
10
+
11
+ 先通过 E10 鉴权模块登录:
12
+
13
+ ```text
14
+ weaver-work-cli auth login --base-url "https://jchdemo.e-cology.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. 根据 operation 的 body mode 组装请求体(ESB 动作流 / eBuilder datajson)。
22
+ 3. 自动携带 Cookie、ETEAMSID、User-Agent,业务输入中禁止再传这些 key。
23
+
24
+ Agent 不得在业务 JSON 中传 Cookie、ETEAMSID、Token 或内部控制字段;CLI 会拒绝这些 key。
25
+
26
+ ## Agent 入口
27
+
28
+ 优先使用 `jiuchuanhui run <operation>`:
29
+
30
+ Windows PowerShell:
31
+
32
+ ```powershell
33
+ weaver-work-cli jiuchuanhui schema
34
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.search --input-json '{"customer_name":"小康","mine":"","all":"-1","customerSea":"-1","pageNo":1,"pageSize":10}'
35
+ ```
36
+
37
+ macOS/Linux(bash/zsh):
38
+
39
+ ```bash
40
+ weaver-work-cli jiuchuanhui schema
41
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.search --input-json '{"customer_name":"小康","mine":"","all":"-1","customerSea":"-1","pageNo":1,"pageSize":10}'
42
+ ```
43
+
44
+ 成功和失败都使用 JSON envelope。成功写 stdout;失败写 stderr,并设置非 0 退出码。
45
+
46
+ 当前输出层是完整 JSON 直接写 stdout,不提供飞书 CLI 的 `--jq`、`--format table/ndjson` 或通用 `--page-all`。Agent 使用时应默认小页读取和摘要渲染:列表先 `pageNo=1`、`pageSize=10`,按 `pageNo` 继续;回复只展示关键字段和数量,超长详情 JSON 落本地文件后给路径。
47
+
48
+ ## Operation 目录
49
+
50
+ | Operation 组 | 风险 | 固定规则 |
51
+ | --- | --- | --- |
52
+ | `jiuchuanhui.app.discovery` / `form.discovery` / `ds.fields` / `field.options` / `rest.cfg.detail` / `config.id.by.pk` / `file.preview` / `get-rest-cfg-detail` | 只读 | 发现与配置;`file.preview` 需先确认文件内容 |
53
+ | `jiuchuanhui.customer.create.prepare/apply` | 高风险写 | 创建前必须查重;`detail2` 同步创建联系人 |
54
+ | `jiuchuanhui.customer.get` / `search` / `type/status/industry.search` / `open-sea.search` / `duplicate.check` | 只读 | 搜索必须显式传 `mine`/`all`/`customerSea`;`count:true` 并行取总数 |
55
+ | `jiuchuanhui.customer.update/transfer/open-sea.release/open-sea.claim/contact-record.create/contact-record.batch` 的 prepare/apply | 高风险写 | 转移/释放/领取需确认唯一性与影响 |
56
+ | `jiuchuanhui.contact.create/update` prepare/apply | 高风险写 | 联系人随客户创建时勿重复调用 |
57
+ | `jiuchuanhui.contact.get` / `by-entity.search` | 只读 | 只给姓名先查候选再让用户选择 |
58
+ | `jiuchuanhui.sale.create/update` prepare/apply | 高风险写 | 按配置 `data_key` 组装 |
59
+ | `jiuchuanhui.sale.get` / `search` / `stage.search` / `process.search` / `lose-reason.search` / `rival.search` | 只读 | 阶段/原因选项供写操作取 ID |
60
+ | `jiuchuanhui.sale.win/lose/invalid/pause/restart/manager-change/link-contacts/contact-record.create` 的 prepare/apply | 高风险写 | 赢单/输单/无效不可逆;输单先取原因;转移与负责人变更共用 |
61
+ | `jiuchuanhui.clue.create/update/status-change/to-customer/contact-record.create` 的 prepare/apply | 高风险写 | 状态变更是覆盖型;转新客户走 `customer.create` 传 `source_module_id` |
62
+ | `jiuchuanhui.clue.get` / `search` / `pool.search` | 只读 | 线索池列表 |
63
+ | `jiuchuanhui.contact-plan.create/complete` prepare/apply | 高风险写 | `type` 与关联字段联动 |
64
+ | `jiuchuanhui.entity.contact-records.list` / `contact-records.by-person-time.list` | 只读 | 联系记录查询 |
65
+ | `jiuchuanhui.entity.id.by-name` / `user.id.by-name` / `user.current-profile` / `entity.permission.judge` / `company.business-profile.query` / `field.info.by-ids` / `browser-option.search` | 只读 | 通用辅助;行政区划也走 `entity.id.by-name` |
66
+
67
+ 缓存初始化(`cache.init`)与商机阶段推进(`stage-advance`)不暴露为 CLI operation:前者是 Agent 侧本地状态维护,后者依赖缓存阶段配置做映射,属于 Skill 编排层职责。
68
+
69
+ ## 常用命令
70
+
71
+ Windows PowerShell:
72
+
73
+ ```powershell
74
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.get --input-json '{"id":"100001"}'
75
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.sale.search --input-json '{"pageNo":1,"pageSize":10,"count":true}'
76
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.user.id.by-name --input-json '{"mainTable":{"userName":"魏思雨"}}'
77
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.duplicate.check --input-json '{"mainTable":{"customerName":"示例科技有限公司"}}'
78
+ ```
79
+
80
+ macOS/Linux(bash/zsh):
81
+
82
+ ```bash
83
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.get --input-json '{"id":"100001"}'
84
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.sale.search --input-json '{"pageNo":1,"pageSize":10,"count":true}'
85
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.user.id.by-name --input-json '{"mainTable":{"userName":"魏思雨"}}'
86
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.duplicate.check --input-json '{"mainTable":{"customerName":"示例科技有限公司"}}'
87
+ ```
88
+
89
+ 写操作必须先 prepare,再 apply:
90
+
91
+ Windows PowerShell:
92
+
93
+ ```powershell
94
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.create.prepare --input .\customer-create.json
95
+
96
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.create.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
97
+
98
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.sale.win.prepare --input-json '{"saleId":"200001"}'
99
+
100
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.sale.win.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
101
+ ```
102
+
103
+ macOS/Linux(bash/zsh):
104
+
105
+ ```bash
106
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.create.prepare --input ./customer-create.json
107
+
108
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.create.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
109
+
110
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.sale.win.prepare --input-json '{"saleId":"200001"}'
111
+
112
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.sale.win.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
113
+ ```
114
+
115
+ ## 写操作确认链
116
+
117
+ - `prepare` 只预览和生成 continuation(HMAC 签名,绑定当前登录上下文与参数)。
118
+ - 向用户摘要目标、差异、风险和 continuation 绑定含义。
119
+ - 用户明确确认后才调用 `apply`(`confirm:true` + 有效 continuation)。
120
+ - `apply` 不可盲目重试;遇到 `partial/write_uncertain` 先停止,再做一次只读回查(如 `customer.get`/`sale.get`/`clue.get`)。
121
+
122
+ 写操作出现网络中断、部分成功、缺少回执 ID 或回查失败时,CLI 返回 `partial/write_uncertain`,Agent 禁止自动重复提交。
123
+
124
+ ## 业务规则摘要
125
+
126
+ - 选项字段(Select/RadioBox/CheckBox)必须先取选项 ID 再传值;`RelateBrowser` 字段通过 `browser-option.search` 查对应类型选项。
127
+ - 行政区划传逗号分隔全路径 ID(`country,province,city,district`),传细粒度自动填充粗粒度。
128
+ - 客户搜索必须显式传 `mine`/`all`/`customerSea` 三个 key(一个 `""` 其余 `-1`),没有 `scope` 快捷参数。
129
+ - 列表、卡片及详情中的关联事项名称渲染为可点击链接 `https://{baseUrl}/sp/ebdfpage/card/0/{objId}/{dataId}`。
130
+ - 新建客户前先查重;客户在公海时提醒可领取。
131
+ - 线索转新客户走客户创建且传 `source_module_id=<clueId>`,成功后不再额外修改线索。
@@ -0,0 +1,443 @@
1
+ # weaver-work-cli 操作手册
2
+
3
+ 本文面向普通使用者和业务模块建设者,说明如何快速安装 `weaver-work-cli`,以及如何使用随包能力生成、验证、打包和安装业务模块 Agent Skill。
4
+
5
+ ## 1. 适用范围
6
+
7
+ `weaver-work-cli` 是面向泛微工作工具链的 TypeScript CLI。框架层保持业务无关,E10 登录、profile 和 HTTP client 由 `src/internal/e10` 托管,具体业务能力放在 `src/shortcuts/<module>`,对应的 Agent Skill 放在 `skills/weaver-e10-<module>`。
8
+
9
+ 当前随包内置业务模块:
10
+
11
+ | 模块 | CLI 命令 | Agent Skill | 说明 |
12
+ | --- | --- | --- | --- |
13
+ | 业票通 | `weaver-work-cli invoice` | `weaver-e10-yepiaotong` | 发票查询、详情、OCR/查验、下载、导入/新增/编辑/删除确认链 |
14
+ | 文书定 | `weaver-work-cli wenshuding` | `weaver-e10-wenshuding` | 全宗、档案检索、借阅车、借阅单、发起借阅、预归档上传 |
15
+ | Skill Maker | `weaver-work-cli skills ...` + Agent 生成流程 | `weaver-e10-skill-maker` | 把新业务模块资料转换成业务 CLI 与 Skill,并做检测和安装确认 |
16
+
17
+ 注意:当前 CLI 不提供独立的 `skills generate` 子命令。新业务模块的生成由 `weaver-e10-skill-maker` 这个 Agent Skill 编排完成;CLI 提供运行时、`schema/run` 合约、随包 Skill 读写安装能力和打包脚本。
18
+
19
+ ## 2. 环境要求
20
+
21
+ - Node.js 18 或更高版本。
22
+ - npm。
23
+ - 可访问组织 npm registry 或本地源码包。
24
+ - 执行业务 operation 前需要 E10 登录;仅安装 Agent Skill 不需要登录。
25
+
26
+ 本手册的命令示例按平台选择执行。完全相同的 `node`、`npm`、`git` 和 `weaver-work-cli` 命令可作为通用示例;涉及 JSON 输入、用户目录、路径分隔符、Python 启动器、文件删除、目录查看或文件比对时,同时给 Windows PowerShell 与 macOS/Linux(bash/zsh)两套示例。Agent 应先判断当前环境,Windows 或 PowerShell 用 Windows 示例,macOS/Linux、bash 或 zsh 用 macOS/Linux 示例;不确定时用 `node -p "process.platform"` 判断。Windows/PowerShell 下不要使用 `printf`、`$HOME/...`、`~/...`、bash 反斜杠续行、`rm/ls/diff/python3` 等 Unix-only 写法。
27
+
28
+ ## 3. 快速安装 CLI
29
+
30
+ ### 3.1 从 npm 或公司 registry 安装
31
+
32
+ ```text
33
+ npm install -g weaver-work-cli
34
+ weaver-work-cli --version
35
+ weaver-work-cli --help
36
+ weaver-work-cli commands list
37
+ weaver-work-cli skills list
38
+ ```
39
+
40
+ `skills list` 能输出 `weaver-e10-shared`、`weaver-e10-yepiaotong`、`weaver-e10-wenshuding`、`weaver-e10-skill-maker` 等条目,说明发布包中的 Skill 内容可读。
41
+
42
+ ### 3.2 从源码安装到本机全局命令
43
+
44
+ ```text
45
+ git clone GIT_REPO_URL weaver-work-cli
46
+ cd weaver-work-cli
47
+ npm install
48
+ npm run build
49
+ npm link
50
+ weaver-work-cli --version
51
+ ```
52
+
53
+ 如果怀疑全局命令指向旧版本,可在仓库根目录直接调用当前构建产物:
54
+
55
+ ```text
56
+ node dist/index.js --version
57
+ node dist/index.js commands list
58
+ node dist/index.js skills list
59
+ ```
60
+
61
+ ### 3.3 从本地 tgz 包安装
62
+
63
+ Windows PowerShell:
64
+
65
+ ```powershell
66
+ cd C:\path\to\weaver-work-cli
67
+ npm install
68
+ npm run build
69
+ npm pack
70
+ npm install -g .\weaver-work-cli-VERSION.tgz
71
+ weaver-work-cli --version
72
+ ```
73
+
74
+ macOS/Linux(bash/zsh):
75
+
76
+ ```bash
77
+ cd /path/to/weaver-work-cli
78
+ npm install
79
+ npm run build
80
+ npm pack
81
+ npm install -g ./weaver-work-cli-VERSION.tgz
82
+ weaver-work-cli --version
83
+ ```
84
+
85
+ ## 4. 登录和可用性检查
86
+
87
+ 执行业务接口前先登录 E10:
88
+
89
+ ```text
90
+ weaver-work-cli auth login --base-url "<E10_BASE_URL>" --agent_type "<当前智能体名称>"
91
+ weaver-work-cli auth status
92
+ weaver-work-cli doctor --e10
93
+ ```
94
+
95
+ 如果不能打开浏览器登录,也可以手动写入当前浏览器中的 `ETEAMSID`:
96
+
97
+ ```text
98
+ weaver-work-cli auth set --eteamsid "<PCACCOUNT_xxx>" --base-url "<E10_BASE_URL>" --agent_type "<当前智能体名称>"
99
+ weaver-work-cli auth whoami --live
100
+ ```
101
+
102
+ `<当前智能体名称>` 使用发起登录验证的宿主标识,例如 WorkBuddy 用 `workbuddy`,Codex 用 `codex`。CLI 会把该值同时写入授权 URL 的 `agent_type` 和 `from` 参数;未显式传入时,CLI 会尝试从环境变量推断。
103
+
104
+ 多环境可用 profile 隔离:
105
+
106
+ ```text
107
+ weaver-work-cli auth profile list
108
+ weaver-work-cli auth profile use PROFILE_NAME
109
+ weaver-work-cli --profile PROFILE_NAME auth status
110
+ ```
111
+
112
+ 认证、Cookie、Token 只应通过 `weaver-work-cli auth ...` 管理。不要让 Agent 直接读取、复制或展示本机认证文件、Keychain、Cookie、`ETEAMSID` 或业务 Token。
113
+
114
+ ## 5. 安装已有业务模块 Skill
115
+
116
+ ### 5.1 安装到 Codex 默认目录
117
+
118
+ ```text
119
+ weaver-work-cli skills install yepiaotong
120
+ weaver-work-cli skills install wenshuding
121
+ ```
122
+
123
+ 默认目标目录优先使用环境变量 `CODEX_HOME` 下的 `skills` 子目录;未设置 `CODEX_HOME` 时使用用户主目录下的 `.codex/skills`(Windows PowerShell 示例:`$env:USERPROFILE\.codex\skills`)。安装非 shared 业务 Skill 时,CLI 会自动带上 `weaver-e10-shared`。
124
+
125
+ ### 5.2 安装到 WorkBuddy 或其它 Agent
126
+
127
+ Windows PowerShell:
128
+
129
+ ```powershell
130
+ weaver-work-cli skills install yepiaotong --target-dir "$env:USERPROFILE\.workbuddy\skills"
131
+ weaver-work-cli skills install wenshuding --target-dir "$env:USERPROFILE\.workbuddy\skills"
132
+ ```
133
+
134
+ macOS/Linux(bash/zsh):
135
+
136
+ ```bash
137
+ weaver-work-cli skills install yepiaotong --target-dir "$HOME/.workbuddy/skills"
138
+ weaver-work-cli skills install wenshuding --target-dir "$HOME/.workbuddy/skills"
139
+ ```
140
+
141
+ 其它 Agent 使用自己的 skills 根目录:
142
+
143
+ Windows PowerShell:
144
+
145
+ ```powershell
146
+ weaver-work-cli skills install MODULE_NAME --target-dir "C:\path\to\agent-skills"
147
+ ```
148
+
149
+ macOS/Linux(bash/zsh):
150
+
151
+ ```bash
152
+ weaver-work-cli skills install MODULE_NAME --target-dir "/path/to/agent-skills"
153
+ ```
154
+
155
+ `<module>` 可以传短名,例如 `yepiaotong`、`wenshuding`、`skill-maker`,也可以传完整名,例如 `weaver-e10-yepiaotong`。传 `all` 会安装包内全部 Skill。
156
+
157
+ ### 5.3 验证安装结果
158
+
159
+ Windows PowerShell:
160
+
161
+ ```powershell
162
+ weaver-work-cli skills list
163
+ weaver-work-cli skills read weaver-e10-yepiaotong
164
+ weaver-work-cli skills list weaver-e10-yepiaotong/references
165
+ Get-ChildItem -Force "C:\path\to\agent-skills"
166
+ ```
167
+
168
+ macOS/Linux(bash/zsh):
169
+
170
+ ```bash
171
+ weaver-work-cli skills list
172
+ weaver-work-cli skills read weaver-e10-yepiaotong
173
+ weaver-work-cli skills list weaver-e10-yepiaotong/references
174
+ ls -la "/path/to/agent-skills"
175
+ ```
176
+
177
+ Agent 需要新建会话或按宿主规则重载 Skill 后才会读取新内容。
178
+
179
+ ### 5.4 安装语义
180
+
181
+ - `skills install` 是文件拷贝,不是软链;源目录后续修改不会自动同步到已安装目录。
182
+ - 覆盖安装只覆盖同名文件,不会清理目标目录里源端已删除的旧文件;需要干净升级时先移除目标 Skill 目录再安装。
183
+ - 拷贝会过滤 dotfile、`scripts/`、`assets/`、`node_modules/`,保留 `SKILL.md`、`product.json`、`references/` 等文本内容。
184
+ - 目标已有软链时可能报 `ERR_FS_CP_DIR_TO_NON_DIR`,先删除目标软链或旧副本再重装。
185
+
186
+ ## 6. 使用业务 CLI
187
+
188
+ Agent 和自动化脚本优先使用统一 JSON operation 入口:
189
+
190
+ Windows PowerShell:
191
+
192
+ ```powershell
193
+ weaver-work-cli MODULE_NAME schema
194
+ weaver-work-cli --json MODULE_NAME run MODULE_NAME.operation --input-json '{"key":"value"}'
195
+ ```
196
+
197
+ macOS/Linux(bash/zsh):
198
+
199
+ ```bash
200
+ weaver-work-cli MODULE_NAME schema
201
+ weaver-work-cli --json MODULE_NAME run MODULE_NAME.operation --input-json '{"key":"value"}'
202
+ ```
203
+
204
+ 示例:
205
+
206
+ Windows PowerShell:
207
+
208
+ ```powershell
209
+ weaver-work-cli invoice schema
210
+ weaver-work-cli --json invoice run invoice.list --input-json '{"page_size":10,"start_pos":0}'
211
+
212
+ weaver-work-cli wenshuding schema
213
+ weaver-work-cli --json wenshuding run wenshuding.search --input-json '{"key":"合同","page":0,"page_size":10}'
214
+ ```
215
+
216
+ macOS/Linux(bash/zsh):
217
+
218
+ ```bash
219
+ weaver-work-cli invoice schema
220
+ weaver-work-cli --json invoice run invoice.list --input-json '{"page_size":10,"start_pos":0}'
221
+
222
+ weaver-work-cli wenshuding schema
223
+ weaver-work-cli --json wenshuding run wenshuding.search --input-json '{"key":"合同","page":0,"page_size":10}'
224
+ ```
225
+
226
+ 成功输出统一 JSON envelope:
227
+
228
+ ```json
229
+ {
230
+ "schemaVersion": 1,
231
+ "ok": true,
232
+ "operation": "<module>.<action>",
233
+ "data": {},
234
+ "meta": { "status": "COMPLETE" },
235
+ "warnings": []
236
+ }
237
+ ```
238
+
239
+ 失败也会输出结构化 envelope,重点看 `error.type`、`error.subtype`、`error.message` 和退出码。写入类 operation 采用 `prepare -> apply`,`apply` 必须携带 `confirm: true` 和 prepare 返回的 continuation;写请求已发出后如出现 `partial/write_uncertain`,不要自动重试,先做只读回查。
240
+
241
+ ## 7. 启用业务模块 Skill 生成能力
242
+
243
+ 先把 Skill Maker 安装到当前 Agent 的 skills 目录:
244
+
245
+ ```text
246
+ weaver-work-cli skills install skill-maker
247
+ ```
248
+
249
+ WorkBuddy 示例:
250
+
251
+ Windows PowerShell:
252
+
253
+ ```powershell
254
+ weaver-work-cli skills install skill-maker --target-dir "$env:USERPROFILE\.workbuddy\skills"
255
+ ```
256
+
257
+ macOS/Linux(bash/zsh):
258
+
259
+ ```bash
260
+ weaver-work-cli skills install skill-maker --target-dir "$HOME/.workbuddy/skills"
261
+ ```
262
+
263
+ 安装后新建 Agent 会话,并用类似提示触发生成流程:
264
+
265
+ ```text
266
+ 请使用 weaver-e10-skill-maker,把 <源资料路径或文档列表> 转换为 <module> 业务模块。
267
+
268
+ 要求:
269
+ - 模块短名:<module>
270
+ - 输出到当前 weaver-work-cli 仓库
271
+ - 同步生成或更新 src/shortcuts/<module> 与 skills/weaver-e10-<module>
272
+ - 生成的 docs、Skill reference、提示词和 CLI 示例必须同时兼容 Windows 和 macOS/Linux;涉及 JSON 输入、用户目录、路径、Python、删除、目录查看或文件比对时,同时给 Windows PowerShell 与 macOS/Linux(bash/zsh)两套示例,并让 Agent 根据当前环境选择;Windows/PowerShell 简单 JSON 优先使用 `--input-json`,复杂 JSON 使用临时 UTF-8 文件和 `--input <path>`,不要使用 `printf`
273
+ - 只实现源资料能确认的 operation;资料不足的能力写入禁用边界或待确认清单
274
+ - 生成后运行 schema、测试和泛微技能检测工具
275
+ - 检测通过后询问我是否安装到 <agent-skills-root>
276
+ ```
277
+
278
+ 源资料至少应提供:
279
+
280
+ - 业务模块短名,例如 `contract`、`expense-claim`。
281
+ - 接口文档、现有代码、样例 JSON、业务说明或已有 Skill。
282
+ - 每个 operation 的接口路径、请求方法、关键字段、分页语义和返回结构。
283
+ - 写入、删除、导入、上传等高风险操作的确认条件、幂等要求和写后回查方式。
284
+ - 权限、租户、scope、固定参数和不可自动化边界。
285
+
286
+ 如果这些事实不足,Skill Maker 会只生成已能确认的能力,并把缺口列出来让用户确认;它不应编造接口、字段或写入确认链。
287
+
288
+ ## 8. 生成后的产物结构
289
+
290
+ 一个新业务模块生成后,默认会同步维护这些文件:
291
+
292
+ ```text
293
+ src/shortcuts/<module>/
294
+ index.ts
295
+ manifest.ts
296
+ operations.ts
297
+ errors.ts
298
+ host.ts
299
+ continuation.ts
300
+ operations/
301
+ registry.ts
302
+ types.ts
303
+ shared.ts
304
+ <operation>.ts
305
+
306
+ skills/weaver-e10-<module>/
307
+ SKILL.md
308
+ product.json
309
+ references/
310
+ <operation-or-topic>.md
311
+ source-manifest.json
312
+
313
+ docs/<module>.md
314
+ skill-template/business-info.json
315
+ skill-template/domains/<module>.md
316
+ test/business/<module>-*.test.ts
317
+ ```
318
+
319
+ 分工规则:
320
+
321
+ - `manifest.ts` 和 `<module> schema` 拥有 operation、字段、风险、权限、固定参数等 WHAT 合约。
322
+ - `docs/<module>.md` 说明维护者视角的 WHEN:模块来源、命令结构、operation 表和安全边界。
323
+ - `skills/weaver-e10-<module>/SKILL.md` 只做 Agent 路由、共享规则入口、工作流和禁用边界。
324
+ - `references/*.md` 写具体 HOW:命令示例、输入要点、输出处理、失败处理和回查策略。
325
+ - `source-manifest.json` 记录源资料路径、大小、sha256 和聚合指纹,后续源资料更新时先比较差异,再确认是否覆盖生成结果。
326
+
327
+ ## 9. 验证、检测和打包
328
+
329
+ 在仓库根目录验证生成结果:
330
+
331
+ ```text
332
+ npm run build
333
+ npm test -- test/skills/layout.test.ts
334
+ npm test -- "test/business/MODULE_NAME-*.test.ts"
335
+ weaver-work-cli MODULE_NAME schema
336
+ weaver-work-cli skills read weaver-e10-MODULE_NAME
337
+ ```
338
+
339
+ 使用泛微技能检测工具做静态质检:
340
+
341
+ Windows PowerShell:
342
+
343
+ ```powershell
344
+ py -3 ..\weaver-skill-detector-1.0.13\scripts\validate_skill.py skills\weaver-e10-MODULE_NAME --json --no-html
345
+ ```
346
+
347
+ macOS/Linux(bash/zsh):
348
+
349
+ ```bash
350
+ python3 ../weaver-skill-detector-1.0.13/scripts/validate_skill.py skills/weaver-e10-MODULE_NAME --json --no-html
351
+ ```
352
+
353
+ 检测通过后打包:
354
+
355
+ ```text
356
+ node scripts/package-skill.mjs MODULE_NAME
357
+ ```
358
+
359
+ 该脚本使用纯 Node 生成 ZIP,不依赖系统 `zip`/`unzip` 命令,Windows、macOS 和 Linux 下命令一致。
360
+
361
+ 默认输出:
362
+
363
+ ```text
364
+ dist/weaver-e10-<module>-skill.zip
365
+ ```
366
+
367
+ 打包单个业务模块时会自动包含 `weaver-e10-shared`。zip 用于平台导入、离线分发或版本归档;本机日常安装优先使用 `weaver-work-cli skills install <module>`。
368
+
369
+ ## 10. 安装新生成的业务模块 Skill
370
+
371
+ 检测通过并得到用户确认后安装:
372
+
373
+ Windows PowerShell:
374
+
375
+ ```powershell
376
+ weaver-work-cli skills install MODULE_NAME --target-dir "C:\path\to\agent-skills"
377
+ ```
378
+
379
+ macOS/Linux(bash/zsh):
380
+
381
+ ```bash
382
+ weaver-work-cli skills install MODULE_NAME --target-dir "/path/to/agent-skills"
383
+ ```
384
+
385
+ 如果全局命令还没更新,但当前仓库已构建,可用当前构建产物安装:
386
+
387
+ Windows PowerShell:
388
+
389
+ ```powershell
390
+ node dist/index.js skills install MODULE_NAME --target-dir "C:\path\to\agent-skills"
391
+ ```
392
+
393
+ macOS/Linux(bash/zsh):
394
+
395
+ ```bash
396
+ node dist/index.js skills install MODULE_NAME --target-dir "/path/to/agent-skills"
397
+ ```
398
+
399
+ 安装后验证:
400
+
401
+ Windows PowerShell:
402
+
403
+ ```powershell
404
+ weaver-work-cli skills list
405
+ weaver-work-cli skills read weaver-e10-MODULE_NAME
406
+ Get-ChildItem -Force "C:\path\to\agent-skills\weaver-e10-shared"
407
+ Get-ChildItem -Force "C:\path\to\agent-skills\weaver-e10-MODULE_NAME"
408
+ ```
409
+
410
+ macOS/Linux(bash/zsh):
411
+
412
+ ```bash
413
+ weaver-work-cli skills list
414
+ weaver-work-cli skills read weaver-e10-MODULE_NAME
415
+ ls -la "/path/to/agent-skills/weaver-e10-shared"
416
+ ls -la "/path/to/agent-skills/weaver-e10-MODULE_NAME"
417
+ ```
418
+
419
+ ## 11. 升级已有业务模块
420
+
421
+ 源文档或代码更新后,用下面的提示让 Agent 先做差异检测:
422
+
423
+ ```text
424
+ 请使用 weaver-e10-skill-maker,检查 <module> 的源资料 <路径> 是否相对
425
+ skills/weaver-e10-<module>/references/source-manifest.json 发生变化。
426
+ 先给出新增、删除、sha256 变化;如果 manifest 有 sourceChunks/operationImpact,
427
+ 再列出变化 chunk、锚点、可能影响的 operation、schema、reference、测试和写入确认链,
428
+ 然后问我是否同步转换。
429
+ ```
430
+
431
+ 确认转换后,Agent 才应更新 `src/shortcuts/<module>`、`skills/weaver-e10-<module>`、测试、docs、`business-info.json`、domain 文件和 manifest。无变化时不要重写 Skill;只有文件级变化但 chunk 未变时,也要先说明差异并等待确认。
432
+
433
+ ## 12. 常见问题
434
+
435
+ | 现象 | 处理 |
436
+ | --- | --- |
437
+ | `weaver-work-cli: command not found` | 先执行 `npm install -g weaver-work-cli` 或在源码仓库 `npm link` |
438
+ | `unknown packaged skill` | 先运行 `weaver-work-cli skills list`,确认传入的是短名或完整 Skill 名 |
439
+ | Agent 安装后没识别新 Skill | 新建会话或按 Agent 规则重载 Skill;确认安装到了该 Agent 实际读取的 skills 目录 |
440
+ | 安装后内容不是最新 | `skills install` 是拷贝语义,重新安装;需要干净升级时先删除旧目标目录 |
441
+ | 目标目录已有软链导致安装失败 | 删除该目标条目后重试,例如删除 `<agent-skills-root>/weaver-e10-<module>` |
442
+ | `schema` 能看见但业务执行失败 | 先 `weaver-work-cli auth status` 和 `doctor --e10`,再看失败 envelope 的 `error.type/subtype` |
443
+ | 生成器要求补资料 | 按 `operation -> 缺少事实 -> 为什么阻断` 补接口路径、字段、权限、幂等或回查契约 |
package/docs/plan.md ADDED
@@ -0,0 +1,82 @@
1
+ # plan — 泛微E10计划报告
2
+
3
+ `plan` 模块把 E10「计划报告」的两套报告侧接口链路(e10 标准版 / e10-ebuilder 版)收敛成一组业务 operation,供人和 Agent 统一调用。源资料为「E10 标准报告和 eb 报告整合 skill」目录下的标准版接口说明、ebuilder 其他接口说明、ebuilder 自定义接口说明与补充说明规则。
4
+
5
+ ## 模块来源
6
+
7
+ - `e10标准版本计划报告接口说明文档.docx`:新建报告、修改报告、发布报告、撤回报告、按报告 id 或按周期查询单个报告详情、分页查询共享我的报告、发送报告提交提醒、获取某个报告的评论。
8
+ - `e10-ebuilder版本计划报告其他接口说明文档.docx`:eb 链路发布报告(secondev 二开接口)、撤回报告(ESB 动作流)。
9
+ - `e10-ebuilder版本计划报告自定义接口说明文档.zip`:创建报告、编辑报告、按周期查询单个报告详情、分页查询报告、查询报告版本信息。
10
+ - `补充说明规则.txt`:意图判定、版本路由、作业步骤链、eb/标准版专属规则、通用基础规则。
11
+
12
+ ## CLI 结构
13
+
14
+ ```text
15
+ weaver-work-cli plan --help
16
+ weaver-work-cli plan schema
17
+ weaver-work-cli --json plan run <operation> --input-json '<json>'
18
+ weaver-work-cli --json plan run <operation> --input <path>
19
+ ```
20
+
21
+ 便捷子命令(均为薄包装,最终调用同一 operation):
22
+
23
+ - `plan route` → `plan.version.check`
24
+ - `plan get` → `plan.report.get`
25
+ - `plan list` → `plan.report.page`
26
+
27
+ 源码结构:
28
+
29
+ ```text
30
+ src/shortcuts/plan/
31
+ index.ts Commander 命令注册、schema/run、便捷子命令
32
+ manifest.ts operation 合约清单、链路路由元信息、禁用边界
33
+ operations.ts run 入口:选择 handler、校验输入、统一执行
34
+ errors.ts 结构化错误(validation/authentication/network/api/policy/confirmation/partial)
35
+ host.ts E10 请求适配 + 租户级缓存读写
36
+ continuation.ts prepare/apply 写入链的确认凭据签发与校验
37
+ operations/
38
+ registry.ts manifest 与 handler 一一对应校验
39
+ types.ts operation 类型、统一 JSON Schema 片段、报告枚举与标签
40
+ shared.ts 输入校验、字段归一化、报告结构归一化、默认提醒文案
41
+ link.ts 版本路由与租户缓存、eb 表单 id 解析、报告详情查询
42
+ version.ts plan.version.check、plan.eb.form.resolve
43
+ read.ts plan.report.get、plan.report.page、plan.comment.list
44
+ write.ts 新建/修改/发布/撤回/提交提醒的 prepare 与 apply
45
+ ```
46
+
47
+ ## operation 表
48
+
49
+ | operation | 风险 | 说明 |
50
+ | --- | --- | --- |
51
+ | `plan.version.check` | read | 判定租户报告链路(缓存 1 天;`ver_name=V2` → eb) |
52
+ | `plan.eb.form.resolve` | read | 解析 eb 报告详情表单 id(idobjId),按租户长期缓存 |
53
+ | `plan.report.get` | read | 按 id 或按周期查询单份报告详情,附带评论总条数(标准版) |
54
+ | `plan.report.page` | read | 分页查询报告列表 |
55
+ | `plan.comment.list` | read | 报告评论内容(标准版) |
56
+ | `plan.report.create.prepare` / `.apply` | read-before-write / high-risk-write | 新建报告(含周期查重) |
57
+ | `plan.report.update.prepare` / `.apply` | read-before-write / high-risk-write | 修改报告 |
58
+ | `plan.report.publish.prepare` / `.apply` | read-before-write / high-risk-write | 发布报告 |
59
+ | `plan.report.withdraw.prepare` / `.apply` | read-before-write / high-risk-write | 撤回报告(标准版) |
60
+ | `plan.report.remind.prepare` / `.apply` | read-before-write / high-risk-write | 发送提交提醒(标准版) |
61
+
62
+ ## 关键设计
63
+
64
+ - **链路路由由 CLI 负责**:`plan_searchAppver` 读到 `ver_name = V2` 走 eb 链路,其它走标准版;结果按租户缓存 1 天。Agent 只传业务字段,不选接口。
65
+ - **输出归一化**:eb 链路的 `f_*` 字段统一归一化为业务键(`reportId` / `title` / `content` / `summary` / `plans` / `year` / `type` / `serialNumber` / `postStatus` / `postTime` / `creator` / `detailUrl`),避免把数据库字段名暴露给 Agent 与用户。
66
+ - **详情页链接**:标准版 `/sp/plan/detail/{id}`;eb 版 `/sp/ebdfpage/card/0/{表单id}/{id}`,表单 id 由 `plan.eb.form.resolve` 解析并长期缓存,租户 `tt1pa2w2i3` 使用固定值。
67
+ - **写入链**:`prepare` 只读回查 + 预览 + 签发 continuation;`apply` 强制 `confirm=true` 与有效 continuation,并校验登录上下文与链路未变化。写请求发出后网络中断返回 `partial/write_uncertain`,禁止自动重试。
68
+ - **查重**:`create.prepare` 与 `create.apply` 都会按周期查重;已存在时 `prepare` 返回 `ALREADY_EXISTS`,`apply` 直接报 `report_exists`,杜绝重复创建。
69
+
70
+ ## 已知限制
71
+
72
+ - eb 链路「撤回报告」是 ESB 动作流,源资料未提供动作流唯一标识(uniqueIndent),本模块不实现;改用 weaver-e10-customesb-execute skill 执行同名动作流。对应 `plan.report.withdraw.*` 在 eb 链路返回 `policy/link_unsupported`。
73
+ - eb 链路未提供报告提交提醒、报告评论接口,`plan.report.remind.*`、`plan.comment.list` 在 eb 链路返回 `policy/link_unsupported`。
74
+ - eb 链路没有「按报告 id 查询详情」的接口,只有按周期查询;`prepare` 阶段若缺少 `year`/`type`/`serialNumber` 会跳过写入前校验并在 `warnings` 中说明。
75
+ - 标准版分页接口语义为「共享给我的报告」,不支持按创建人筛选,传入 `creatorUserId` 会被忽略并返回警告。
76
+
77
+ ## 安全边界
78
+
79
+ - 只调用 `/api/` 前缀路径,拒绝跨域、路径逃逸与协议外地址。
80
+ - 认证、Cookie、ETEAMSID、User-Agent 由 `src/internal/e10` 统一托管;业务输入不接收凭证。
81
+ - 不读取、不打印认证目录与认证文件。
82
+ - 租户缓存只落地版本判定结果与 eb 表单 id,不缓存任何凭证或报告正文。