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,174 @@
1
+ ---
2
+ name: weaver-e10-jiuchuanhui
3
+ display_name: 泛微九氚汇营销管理
4
+ display_name_en: Weaver Jiuchuanhui Marketing Management
5
+ description: "泛微 E10 九氚汇营销管理:客户、联系人、商机、线索的创建、查询、搜索、修改、转移、公海、联系计划、联系记录、商机推进、线索转客户等 CRM 操作。用户表达营销/CRM 相关业务意图时使用。"
6
+ description_zh: "泛微 E10 九氚汇营销管理。覆盖客户、联系人、商机、线索全生命周期:创建、查询、搜索、修改、转移、公海领取/释放、查重、联系计划、联系记录、商机赢单/输单/无效/暂停/重启、线索转客户,并通过 prepare/apply 确认链处理全部高风险写操作。"
7
+ description_en: "Full-lifecycle CRM operations for customers, contacts, opportunities and clues in Weaver E10 Jiuchuanhui marketing management, including confirmed writes for create, update, transfer, pool claim/release, stage changes and clue-to-customer conversion."
8
+ version: 1.0.0
9
+ author: 泛微网络科技股份有限公司
10
+ agent_created: true
11
+ requires:
12
+ bins: ["weaver-work-cli"]
13
+ cliHelp: "weaver-work-cli jiuchuanhui --help"
14
+ ---
15
+
16
+ **CRITICAL — 开始前 MUST 先用 Read 工具读取 [`../weaver-e10-shared/SKILL.md`](../weaver-e10-shared/SKILL.md),其中包含安装、E10 认证、JSON 输出和高风险写入规则。若不存在则必须先执行 `weaver-work-cli skills install shared --skills-dir <当前Agent的Skills目录>`,若 CLI 未安装则先执行 `npm install -g weaver-work-cli`,安装或读取失败时必须停止执行。**
17
+ 认证和登录态只能按共享规则通过 `weaver-work-cli auth ...` 命令判断;CLI 会自动携带完整 Cookie、`eteamsid` 与 `User-Agent: AgentType=<agentType>,IsAgent=true`,业务调用方不得覆盖这三条 header,也不得在业务 JSON 中传入这些 key。禁止直接读取、列出、打印或解析用户主目录下的 `.e10-cli`、auth、config 或 Keychain 数据。
18
+ 所有命令通过 `weaver-work-cli --json jiuchuanhui run <operation>` 执行:简单 JSON 传 `--input-json '<json>'`,复杂或多行 JSON 先写入 UTF-8 文件再传 `--input <path>`,只有确认当前 shell 能稳定传管道时才使用 `--input -`。调用前先按需读取 references 下对应的文件,查参数结构,不要猜字段;**references 是第一信息源**,`weaver-work-cli jiuchuanhui schema` 是 operation、字段和风险等级的合约来源。
19
+ 命令示例、提示词和临时说明必须同时兼容 Windows 和 macOS/Linux;涉及 JSON 输入、用户目录、路径分隔符、Python 启动器、文件删除、目录查看或文件比对时,同时给 Windows PowerShell 与 macOS/Linux(bash/zsh)两套示例。Agent 先根据当前系统和 shell 选择对应示例,不确定时用 `node -p "process.platform"` 判断。Windows/PowerShell 下不要使用 `printf`、`$HOME/...`、`~/...`、bash 反斜杠续行、`rm/ls/diff/python3` 等 Unix-only 写法。
20
+ 涉及附件、图片、本地文件、远程 URL 文件或文件解析的操作,执行前必须提醒用户:文件内容可能被上传到 E10 九氚汇、文件服务或解析服务,并可能进入当前大模型上下文用于理解和处理;必须等待用户明确确认后才继续。
21
+
22
+ ## 启动与缓存(MUST)
23
+
24
+ **首次使用、缓存缺失、用户要求刷新、或需要版本/配置/选项/objId 时,必须先读取 [`references/cache.md`](references/cache.md) 并按其中规则处理,再继续业务调用。**
25
+
26
+ - 优先使用 `~/.weaver-e10-jiuchuanhui/{tenantKey}/{userId}/` 下的缓存(主文件 `weaver-e10-jiuchuanhui.json` + `config/{pk}.json`)。
27
+ - 缓存缺失或用户要求初始化/刷新时,调用 CLI operation `weaver-work-cli --json jiuchuanhui run jiuchuanhui.cache.init`(7 步:应用发现 → 13 objId → 版本校验 >= 1.5.11 → cfgId → 配置详情+字段 data_key → ebuilder 关联数据 → 字段选项 → 搜索参数 → 行政区划),支持 `dryRun`/`verbose`;也可在仓库根运行 `node src/shortcuts/jiuchuanhui/scripts/cache-init.mjs`(薄包装,转发同一 operation)。
28
+ - 创建/更新接口读 `config/{pk}.json.detail.mainFields`(`data_key`);搜索接口读 `searchParams`;选项字段优先读字段 `optionList`。缓存已覆盖的配置直接读缓存,不重复走动态配置链路。
29
+ - 缓存初始化与刷新**已暴露为 CLI operation `jiuchuanhui.cache.init`**(risk: local-file-write,写本地缓存文件,无需 prepare/apply 确认链),Agent 直接调用即可。
30
+
31
+ ## 参数与字段处理(MUST)
32
+
33
+ - **只使用用户明确提供或已确认的字段值**:录入或修改数据时,只使用用户明确提供或已确认的字段值;必填字段缺失时向用户追问,不编造默认值或占位值。
34
+ - **写操作必须用户确认**:写操作(新建、修改、删除、转移、释放、领取、状态变更、完成计划等)一律走 `prepare` → 用户确认 → `apply`;查询类操作可直接执行,无需确认。
35
+ - **不擅自追加动作**:只完成用户明确要求的业务动作,不自作主张追加查询、修改、创建、验证、推荐或其他操作;只有对应 reference 明确要求的前置步骤才可以执行。
36
+ - **参数缺失/不支持立即停止**:操作类请求如果用户提供的参数缺失、不支持、无法映射或不符合接口文档,直接说明具体问题并停止;禁止猜测参数、替换参数或自动重试。
37
+ - **选项字段传 ID 不传中文**:`Select`/`RadioBox`/`CheckBox` 优先使用字段 `optionList` 的选项 `value`;`Ebuilder`/关联字段通过对应搜索或查询接口取数据 ID;`RelateBrowser` 使用自定义浏览字段选项查询;均传 ID,不传中文名称。
38
+ - **行政区划全路径 ID**:`country`/`province`/`city`/`district` 传逗号分隔的全路径 ID(格式 `country,province,city,district`);传细粒度自动填充粗粒度。
39
+ - **日期与金额**:日期类模糊表达(今天、本周、本月等)转换为明确起止范围;金额统一转换为数字,单位为元。
40
+
41
+ ## 路由优先级(先判断是不是九氚汇 CRM,再选 operation)
42
+
43
+ 九氚汇 CRM 不是通用 E10 对象。**只要用户的核心对象是九氚汇的客户、联系人、商机、线索、联系计划、联系记录、公海客户或相关辅助查询,就优先使用 `weaver-e10-jiuchuanhui`。**
44
+
45
+ ### 明确归 `weaver-e10-jiuchuanhui` 的高优先级语义
46
+
47
+ 出现以下任一语义时,优先走本 Skill:
48
+
49
+ - 客户 / 新建客户 / 客户详情 / 搜索客户 / 修改客户 / 转移客户 / 客户查重 / 客户公海
50
+ - 联系人 / 新建联系人 / 联系人详情 / 修改联系人 / 按客户或商机查联系人
51
+ - 商机 / 新建商机 / 商机详情 / 搜索商机 / 修改商机 / 商机阶段 / 商机赢单 / 输单 / 无效 / 暂停 / 重启 / 商机转移 / 关联联系人
52
+ - 线索 / 新建线索 / 线索详情 / 搜索线索 / 修改线索 / 线索状态变更 / 线索转客户 / 线索池
53
+ - 联系计划 / 完成联系计划 / 联系记录 / 跟进记录 / 批量联系记录
54
+ - 公海 / 领取公海客户 / 释放客户到公海 / 公海搜索
55
+ - 客户经理 / 按姓名查人员 / 按名称查事项 ID / 事项权限校验 / 企业工商照面 / 字段选项 / 自定义浏览字段
56
+ - `customerId` / `saleId` / `clueId` / `contactId` / `planId` / `managerid` 等九氚汇业务 ID
57
+
58
+ **判定规则:** 只要最终动作是对九氚汇客户/联系人/商机/线索做查询、搜索、创建、修改、转移、公海、联系计划、联系记录、状态推进或辅助解析,就归 `weaver-e10-jiuchuanhui`。只有当用户处理的是非营销类 E10 业务、通用工作流或尚未封装的九氚汇能力时,才不使用本 Skill。
59
+
60
+ ## 选哪个命令
61
+ | 想做什么 | 命令 | 按需读取 reference |
62
+ |---|---|---|
63
+ | 查看可用 operation、字段和风险等级 | `jiuchuanhui schema` | [`jiuchuanhui-entry.md`](references/jiuchuanhui-entry.md) |
64
+ | 初始化/刷新表单配置缓存 | `jiuchuanhui run jiuchuanhui.cache.init`(risk: local-file-write);或仓库根运行 `node src/shortcuts/jiuchuanhui/scripts/cache-init.mjs` | [`cache.md`](references/cache.md) |
65
+ | 客户创建/详情/搜索/修改/转移/公海/查重/联系记录 | `jiuchuanhui run jiuchuanhui.customer.*` | [`customer.md`](references/customer.md) |
66
+ | 联系人创建/详情/修改/按事项查询 | `jiuchuanhui run jiuchuanhui.contact.*` | [`contact.md`](references/contact.md) |
67
+ | 商机创建/详情/搜索/修改/阶段/赢单/输单/无效/暂停/重启/转移/关联/联系记录 | `jiuchuanhui run jiuchuanhui.sale.*` | [`sale.md`](references/sale.md) |
68
+ | 线索创建/详情/搜索/修改/状态变更/转客户/线索池/跟进记录 | `jiuchuanhui run jiuchuanhui.clue.*` | [`clue.md`](references/clue.md) |
69
+ | 创建/完成联系计划 | `jiuchuanhui run jiuchuanhui.contact-plan.*` | [`contact-plan.md`](references/contact-plan.md) |
70
+ | 按事项或按人员+时间范围查询联系记录 | `jiuchuanhui run jiuchuanhui.entity.contact-records.list` / `jiuchuanhui.contact-records.by-person-time.list` | [`contact-records.md`](references/contact-records.md) |
71
+ | 应用/表单/字段/选项/接口配置/文件预览等发现与配置 | `jiuchuanhui run jiuchuanhui.{app,form,ds,field,rest,config,file}.*` | [`discovery-config.md`](references/discovery-config.md)、[`cache.md`](references/cache.md) |
72
+ | 按名称查事项/人员 ID、权限、工商照面、字段信息、自定义浏览选项 | `jiuchuanhui run jiuchuanhui.{entity,user,company,field,browser-option}.*` | [`general-helpers.md`](references/general-helpers.md) |
73
+ | 商机阶段推进组合、其它 schema 未列出的能力 | 无可用命令 | [`disabled-capabilities.md`](references/disabled-capabilities.md) |
74
+
75
+ 处理链:
76
+
77
+ - 客户:搜索/查重先于创建。新建客户前先 `jiuchuanhui.customer.duplicate.check`;有疑似重复时表格展示并让用户确认;若客户在公海提醒可领取。确认继续后才 `customer.create.prepare` -> 用户确认 -> `customer.create.apply`。
78
+ - 客户修改/转移/释放/领取:先 `customer.search`/`customer.get` 确认唯一 -> `customer.update.prepare`(或 `transfer`/`open-sea.release`/`open-sea.claim`)-> 用户确认 -> `.apply`。
79
+ - 联系人:只给姓名未指明所属事项时,先 `contact.by-entity.search` 或搜索候选并让用户选择;创建/修改走 `contact.create/update.prepare -> apply`。联系人随客户创建(`detail2`)时不要重复调用 `contact.create`。
80
+ - 商机:赢单/输单/无效/暂停/重启/转移/关联联系人/联系记录,全部先确认商机唯一,再 `sale.*.prepare` -> 用户确认影响与不可逆性 -> `sale.*.apply`。输单必须先确定输单原因,暂停必须有暂停原因。
81
+ - 线索:状态变更覆盖放弃/分配/转移/有效/无效,先确认线索唯一、目标状态/人员明确 -> `clue.status-change.prepare` -> 用户确认 -> `.apply`。线索转已有客户走 `clue.to-customer`;转新客户走 `customer.create` 且传 `source_module_id=<clueId>`,成功后不要再额外修改线索。
82
+ - 联系计划:按客户/商机/线索关联时必须先确定唯一关联事项和 `type`,用户提到联系人时先用 `contact.by-entity.search` 查询候选 -> `contact-plan.create.prepare -> apply`;完成计划走 `contact-plan.complete.prepare -> apply`。
83
+ - 通用辅助:先 `user.id.by-name` / `entity.id.by-name` 解析 ID,再进入业务调用;`user.current-profile` 每轮会话优先取一次并复用。
84
+
85
+ ## 执行原则(减少误路由、误重试和无效消耗)
86
+
87
+ ### 1) 先拿最小必要信息,再执行
88
+
89
+ - 只是搜索时,优先直接用 `customer.search`/`sale.search`/`clue.search`
90
+ - 列表默认先取小页,优先 `pageNo=1`、`pageSize=10`;用户没有要求全量时不要自动翻页
91
+ - 客户搜索必须显式传 `mine`/`all`/`customerSea` 三个 key(其中一个为 `""`,其余两个为 `-1`),默认 `mine=""&all=-1&customerSea=-1`(我的客户);本接口没有 `scope` 快捷参数
92
+ - 用户已经给出 `customerId`/`saleId`/`clueId` 时,不要先查列表再过滤,直接用对应 get 或 prepare
93
+ - 只有需要完整详情、可编辑状态或附件归属时才补 get
94
+
95
+ ### 1.5) 大结果只摘要给用户
96
+
97
+ - 当前 CLI 会把完整 JSON envelope 写 stdout;Agent 回复时不要原样贴完整 JSON
98
+ - 列表最多先展示最相关的前 10 条,包含 ID、名称、负责人、状态/阶段、金额、最近跟进时间和可点击链接
99
+ - 需要全量统计时,按 `pageNo` 分页读取并累计必要字段;说明已读取页数、命中数和是否还有更多
100
+ - 详情或调试用完整响应过长时,优先落本地文件并向用户提供摘要和文件路径
101
+ - 列表、卡片及详情中的关联事项名称必须渲染为可点击链接 `https://{baseUrl}/sp/ebdfpage/card/0/{objId}/{dataId}`;`objId` 优先从缓存 `discovery["objId:{tag}"]` 获取
102
+ - 返回类型为对象数组的字段必须展示全部对象及其完整有效值,不得只展示第一项或摘要;数组为空时按空值处理
103
+ -客户列表默认展示客户名称、负责人、客户类型/状态、行业、最近跟进、创建时间;商机列表展示商机名称、客户、负责人、阶段、金额、预计成交/最近跟进;线索列表展示线索名称、客户/公司、处理人、状态、来源、最近跟进/创建时间。缺失字段用 `-`
104
+ ### 2) 已知对象时直达动作
105
+
106
+ - 已拿到业务 ID、人员 ID、选项 ID 或完整 `form` 时,优先调用对应 operation
107
+ - 同一轮里已有足够的新鲜查询结果时,不要重复查询同一事项
108
+ - 不要默认走 `search -> get -> prepare -> apply` 全链路;对象已明确时应压缩步骤
109
+
110
+ ### 3) 错误语义驱动,而不是盲目重试
111
+
112
+ - 失败后先看进程退出码、`error.type`、`error.subtype` 和 `error.message`
113
+ - **除非错误明确提示可恢复或需要补充参数,否则不要重复刷同一个 operation**
114
+ - 写请求已经发出后,遇到结果不确定必须停止;不要把 `.apply` 当成可重试读操作
115
+ - **错误为 `authentication`(未登录,如 `E10 auth not found`)或 `session_expired`(登录态失效)时:立即停止当前操作,不要用示例占位域名或自行猜域名登录,也不要盲目重试**。先读取共享规则 `../weaver-e10-shared/references/e10-auth-and-session.md`,按其中流程用宿主提问/弹框让用户输入 E10 登录域名或选择已有 profile,完成登录后再继续原操作
116
+
117
+ ### 4) 文件处理确认
118
+
119
+ - 执行文件预览(`file.preview`)或任何会读取本地文件、上传远程 URL 文件、解析图片/PDF/XML 的步骤前,必须先提醒用户文件内容可能进入大模型上下文,也可能发送到 E10 九氚汇或文件解析服务
120
+ - 用户未明确确认前,不要运行文件预览或解析命令
121
+
122
+ ## 写操作失败处理:`partial/write_uncertain` 决策树
123
+
124
+ 当创建、修改、转移、释放、领取、状态变更、赢单/输单等写操作返回 `partial/write_uncertain`,或提示网络中断、部分成功、回查失败、回查字段不一致时,按下面规则处理:
125
+
126
+ 1. **先停止盲目重试**,不要连续重复提交相同 `.apply`
127
+ 2. 优先从以下角度解释:
128
+ - 写请求可能已经到达服务端,但连接在结果确认前中断
129
+ - 服务端可能只处理了部分事项(例如批量联系记录)
130
+ - 写接口已返回成功,但详情回查失败或与预期不一致
131
+ - continuation、目标事项或登录上下文可能已经变化
132
+ 3. 如需确认,只补 **一次** 只读查询(例如 `customer.get`/`sale.get`/`clue.get` 或列表查询),不要陷入 query/write 循环
133
+ 4. 最终给用户明确结论、已知 `status`/`resultCode`、成功/失败项和下一步人工确认建议,而不是继续无意义重试
134
+
135
+ **特别注意:** 对转移、释放公海、赢单/输单/无效、状态变更场景更要严格执行上述规则;这些场景最容易因重复提交造成误转、误释放或覆盖用户刚确认的状态。
136
+
137
+ **搜索约束:** 查询/搜索无结果时,直接原样说明查询条件并告知无结果,**不得修改条件(扩大范围/降低阈值/去除非核心条件)重试**——参数不支持的错误应反馈给用户后停止,而不是悄悄调整客户本意。
138
+
139
+ ## 快速命令示例
140
+
141
+ Windows PowerShell:
142
+
143
+ ```powershell
144
+ weaver-work-cli jiuchuanhui schema
145
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.duplicate.check --input-json '{"mainTable":{"name":"示例科技有限公司","simpleName":"示例科技"}}'
146
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.search --input-json '{"customer_name":"小康","mine":"","all":"-1","customerSea":"-1","pageNo":1,"pageSize":10}'
147
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.get --input-json '{"id":"100001"}'
148
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.create.prepare --input-json '{"form":{"mainTable":{"manager":"USER_ID","customer_name":"示例科技有限公司"}}}'
149
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.create.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
150
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.sale.win.prepare --input-json '{"mainTable":{"saleId":"200001"}}'
151
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.user.id.by-name --input-json '{"mainTable":{"employeeName":"魏思雨"}}'
152
+ ```
153
+
154
+ macOS/Linux(bash/zsh):
155
+
156
+ ```bash
157
+ weaver-work-cli jiuchuanhui schema
158
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.duplicate.check --input-json '{"mainTable":{"name":"示例科技有限公司","simpleName":"示例科技"}}'
159
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.search --input-json '{"customer_name":"小康","mine":"","all":"-1","customerSea":"-1","pageNo":1,"pageSize":10}'
160
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.get --input-json '{"id":"100001"}'
161
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.create.prepare --input-json '{"form":{"mainTable":{"manager":"USER_ID","customer_name":"示例科技有限公司"}}}'
162
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.create.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
163
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.sale.win.prepare --input-json '{"mainTable":{"saleId":"200001"}}'
164
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.user.id.by-name --input-json '{"mainTable":{"employeeName":"魏思雨"}}'
165
+ ```
166
+
167
+ ## 不在本 skill 范围
168
+
169
+ - 禁止加载原始 `weaver-e10-jiuchuanhui` 源 Skill 代替 CLI。
170
+ - 禁止 curl、fetch、浏览器自动化或直接访问 E10 原始接口路径。
171
+ - 禁止读取或复制 CLI runtime 内部 Token、Cookie、ETEAMSID。
172
+ - 禁止读取、列出、打印或解析用户主目录下的 `.e10-cli`、auth、config 或 Keychain 数据。
173
+ - `jiuchuanhui.sale.stage-advance` 未暴露为 CLI operation:商机阶段推进依赖缓存中的阶段配置做映射与前置校验,属于 Skill 编排层职责,CLI 的 `sale.update` 与 `sale.stage.search` 已覆盖基础能力。
174
+ - 非九氚汇营销类 E10 能力、通用流程编排、非 CRM 表单/审批/组织等业务不由本 Skill 承载。
@@ -0,0 +1,8 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "product": "weaver-work-cli",
4
+ "productVersion": "0.1.2",
5
+ "packageName": "weaver-work-cli",
6
+ "command": "weaver-work-cli",
7
+ "nodeEngine": ">=18"
8
+ }
@@ -0,0 +1,110 @@
1
+ # 缓存说明(cache)
2
+
3
+ 缓存保存应用发现、接口配置、字段选项、关联数据和行政区划,按租户和人员隔离。缓存无 TTL:文件存在即命中,刷新时覆盖写入。
4
+
5
+ ## 何时使用
6
+
7
+ 首次使用、缓存缺失、用户要求刷新或重新加载、需要版本/配置/选项/objId 时,先读本文件,再按需运行初始化脚本。
8
+
9
+ ## 文件位置
10
+
11
+ | 文件 | 内容 |
12
+ |---|---|
13
+ | `~/.weaver-e10-jiuchuanhui/{tenantKey}/{userId}/weaver-e10-jiuchuanhui.json` | 主缓存:`discovery`、`ebuilder`、`options`、`region` |
14
+ | `~/.weaver-e10-jiuchuanhui/{tenantKey}/{userId}/config/{pk}.json` | 单接口配置:创建/更新类 `{cfgId,objId,detail}`,搜索类 `{cfgId,objId,searchParams}` |
15
+
16
+ `tenantKey`、`userId`、`baseUrl` 和认证头均由 `weaver-work-cli auth` 提供。缓存文件是 Agent 本地状态,不随 Skill 打包、不入库。
17
+
18
+ ## 主缓存结构
19
+
20
+ ```json
21
+ {
22
+ "discovery": {},
23
+ "ebuilder": {},
24
+ "options": {},
25
+ "region": {}
26
+ }
27
+ ```
28
+
29
+ | 命名空间 | 内容 | 典型 key |
30
+ |---|---|---|
31
+ | `discovery` | 应用、表单对象、版本校验 | `appId:jch-crm-project`、`objId:uf_jch_customer`、`spVersion:jch-crm-project` |
32
+ | `ebuilder` | Ebuilder 关联数据 | `customer_type`、`customer_status`、`sale_stage` |
33
+ | `options` | Select/RadioBox/CheckBox 选项 | `options:{fieldId}:*:1` |
34
+ | `region` | 行政区划全路径 ID | `administrativeDivision:{name}` |
35
+
36
+ 接口配置的 `cfgId` 存在对应 `config/{pk}.json` 中,业务按 `pk` 读取;主缓存不保存单独的 cfgId 索引。
37
+
38
+ ## 初始化常量
39
+
40
+ | 常量 | 值 |
41
+ |---|---|
42
+ | 应用标签 | `jch-crm-project` |
43
+ | 模块表单标签 | `uf_jch_customer`、`uf_jch_sale`、`uf_jch_clue`、`uf_jch_contact`、`uf_jch_customer_open_sea`、`uf_jch_remind`、`uf_jch_rival`、`uf_jch_sale_process`、`uf_jch_sale_stage`、`uf_jch_clue_pool`、`uf_jch_lose_reason`、`uf_jch_customer_cmt`、`uf_jch_sale_cmt` |
44
+ | 创建类 pk | `customer_create_api`、`sale_create_api`、`ebclue_ai_create_api`、`contact_create_api`、`ebcontact_plan_create_api` |
45
+ | 搜索类 pk | `ebcustomer_search_api`、`ebsale_search_api`、`ebclue_ai_search_api` |
46
+ | 更新类 pk | `customer_update_api`、`sale_update_api`、`ebclue_ai_update_api`、`contact_update_api` |
47
+ | `interface_pk` 转 `cfgId` | `4F6E1A9702864666803CCA6B77B86227` |
48
+ | 字段 ID 转 `data_key` | `10351A4DC8D4454A9F1957FBE647CD9F` |
49
+ | 行政区划查询 | `7EC1639D5AC24B4DBCEE8D2CB85D4025` |
50
+ | 行政区划预取城市 | 成都市 |
51
+ | Ebuilder 分页大小 | `pageSize=500` |
52
+ | 选项层级 | `optionLevel=1` |
53
+ | 版本基线 | `>= 1.5.11` |
54
+
55
+ ## 初始化/刷新
56
+
57
+ **调用 CLI operation `jiuchuanhui.cache.init` 执行完整初始化**(`weaver-work-cli --json jiuchuanhui run jiuchuanhui.cache.init`),或在仓库根运行 `node src/shortcuts/jiuchuanhui/scripts/cache-init.mjs`(薄包装,转发同一 operation)。依赖有效 E10 登录态。支持 `dryRun`(只拉取不写入)/ `verbose`。用户要求初始化、刷新或重新加载缓存时,覆盖旧缓存。返回摘要含各命名空间条目数、objId/cfgId 计数、版本校验结果(`spVersion`,version.passed=false 时应停止业务调用)。
58
+
59
+ Windows PowerShell:
60
+
61
+ ```powershell
62
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.cache.init --input-json '{}' # 完整初始化
63
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.cache.init --input-json '{"dryRun":true}' # 只拉取不写入
64
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.cache.init --input-json '{"verbose":true}' # 打印步骤明细
65
+ node src/shortcuts/jiuchuanhui/scripts/cache-init.mjs # 薄包装(等价完整初始化)
66
+ node src/shortcuts/jiuchuanhui/scripts/cache-init.mjs --dry-run # 只拉取不写入
67
+ ```
68
+
69
+ macOS/Linux(bash/zsh):
70
+
71
+ ```bash
72
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.cache.init --input-json '{}'
73
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.cache.init --input-json '{"dryRun":true}'
74
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.cache.init --input-json '{"verbose":true}'
75
+ node src/shortcuts/jiuchuanhui/scripts/cache-init.mjs
76
+ node src/shortcuts/jiuchuanhui/scripts/cache-init.mjs --dry-run
77
+ ```
78
+
79
+ 初始化流程(operation 内 7 步,复用 CLI 的 E10 认证链直连接口):
80
+
81
+ 1. **发现接口**:`jiuchuanhui.app.discovery`(`tag=jch-crm-project`)取 `data[0]` 为 `appId`;对 13 个模块表单标签调 `jiuchuanhui.form.discovery`,优先取 `formId` 非空且非 `"0"` 的记录 `id` 为 `objId`,否则回退 `data[0]`;读取 `spVersion`(`commitVersion`+`passed`),版本必须 `>= 1.5.11`,否则停止业务调用。
82
+ 2. **获取 cfgId**:对 12 个 pk 调 `jiuchuanhui.config.id.by.pk`(`mainTable.interface_pk`),取 `mainTable.cfgId`。**该接口走 ESB 动作流,必须 POST JSON body + `uniqueIndent=4F6E1A9702864666803CCA6B77B86227`**;若以 GET query 调用会返回 HTTP 405。
83
+ 3. **创建/更新接口配置**:对 5 个创建类 pk 和 4 个更新类 pk 调 `jiuchuanhui.rest.cfg.detail`(`apid={appId}&id={cfgId}`);仅保留 `isInput=1` 的 `mainFields` 和 `detailFields[].fields`,空明细组丢弃;收集 `fieldid` 调 `jiuchuanhui.field.info.by-ids` 合并 `data_key`、`title`、`component_type`;注入对应表单 `objId`;精简存储(`detail` 顶层仅保留 `id`、`interfacePk`、`interfaceName`、`datasNumber`、`datasSize`、`mainFields`、`detailFields`、`interfaceType`、`relevanceForm`;字段元素仅保留 `fieldid`、`isRequired`、`isInput`、`data_key`、`title`、`component_type`)。写入 `config/{pk}.json`。
84
+ 4. **Ebuilder 关联数据**:对 8 类选项(客户公海、商机阶段、销售过程、线索池、输单原因、客户行业、客户类型、客户状态)调对应搜索 operation(`customer.open-sea.search` / `sale.stage.search` / `sale.process.search` / `clue.pool.search` / `sale.lose-reason.search` / `customer.industry.search` / `customer.type.search` / `customer.status.search`),归一化为 `{id,name}` 写入 `ebuilder`;商机阶段额外带 `sale_process`。
85
+ 5. **字段选项**:对 `config/{pk}.json` 中 `component_type` 为 `Select`/`RadioBox`/`CheckBox` 的字段调 `jiuchuanhui.field.options`(`fieldName`+`objId`+`groupId`),写入 `options.options:{fieldId}:*:1 = {lable,lableTitle,value}`,并按 `fieldid` 把 `value` 复制到相关 `config/{pk}.json` 字段的 `optionList`。失败不阻塞:保留旧缓存 `options`,业务侧可读字段 `optionList` 或主缓存 `options` 兜底。
86
+ 6. **搜索参数**:对 3 个搜索类 pk 调 `jiuchuanhui.rest.cfg.detail`,解析 `conditions.datas[]` 的 `{param}` 提取 URL 参数 key,组装 `{key,text,fieldType,compType,func,fieldid}` 写入 `config/{pk}.json.searchParams`。
87
+ 7. **行政区划**:预取 22 个常用城市(北京市、上海市、天津市、重庆市、成都市、广州市、深圳市、东莞市、杭州市、南京市、苏州市、武汉市、长沙市、西安市、郑州市、济南市、青岛市、厦门市、福州市、合肥市、沈阳市、大连市),通过 ESB 动作流(`uniqueIndent=7EC1639D5AC24B4DBCEE8D2CB85D4025`、`moduleType=administrativeDivision`、`name=城市名`、`fromType=agentSkill`)查询,`resultCode===200` 才写入 `region.administrativeDivision:{name}`;单城失败跳过,保留旧缓存 `region`。
88
+
89
+ ## 读取规则
90
+
91
+ - 创建/更新接口直接读 `config/{pk}.json.detail`,用字段 `data_key` 组装 `mainTable` 和明细数组。
92
+ - 搜索接口直接读 `config/{pk}.json.searchParams`,不得使用未定义的搜索 key。
93
+ - Select/RadioBox/CheckBox 优先读字段 `optionList`(缺失时读主缓存 `options.options:{fieldId}:*:1`)。
94
+ - Ebuilder 关联字段读 `ebuilder` 命名空间。
95
+ - 行政区划读 `region`;运行时查询到的新行政区划可覆盖写入。
96
+ - 缓存为空、主文件或接口级文件缺失时,执行初始化或单项刷新,再继续业务调用。
97
+
98
+ ## 刷新规则
99
+
100
+ | 方式 | 场景 | 处理 |
101
+ |---|---|---|
102
+ | 全量刷新 | 用户要求初始化、刷新、重新加载缓存 | 重新调用 `jiuchuanhui.cache.init`(或 `node src/shortcuts/jiuchuanhui/scripts/cache-init.mjs`),覆盖主缓存和接口级配置 |
103
+ | 单项刷新 | 某接口、字段、选项或行政区划缺失/变更 | 只重新查询对应 CLI operation 并覆盖对应 key 或 `config/{pk}.json` |
104
+
105
+ ## 失败处理
106
+
107
+ - 版本校验 `< 1.5.11`:停止业务调用并告知用户。
108
+ - `jiuchuanhui.config.id.by.pk` 返回 HTTP 405:确认以 POST + JSON body 调用(EsbReadOperation),不要用 GET query 方式调用该 ESB 动作流。
109
+ - `jiuchuanhui.field.options` 返回 HTTP 400:已知问题(GetQueryOperation 未注入 `sourceType=FORM` 时可能 400);保留旧缓存 options,业务侧用字段 `optionList` / 主缓存 `options` 兜底。
110
+ - 缓存缺失:先调用 `jiuchuanhui.cache.init` 完成初始化,再继续业务调用。
@@ -0,0 +1,61 @@
1
+ # 线索管理(clue)
2
+
3
+ ## 何时使用
4
+
5
+ 用户表达线索相关意图:新建线索、线索详情、搜索线索、修改线索、线索状态变更(放弃/分配/转移/有效/无效)、新建线索跟进记录、线索转已有客户、线索池搜索。
6
+
7
+ ## 可用 operation
8
+
9
+ | Operation | 风险 | 输入要点 |
10
+ |---|---|---|
11
+ | `jiuchuanhui.clue.create.prepare/apply` | 高风险写 | `form`: `{mainTable, detail1?, ...}` |
12
+ | `jiuchuanhui.clue.get` | 只读 | `id` |
13
+ | `jiuchuanhui.clue.search` | 只读 | 搜索条件走 query,`count:true` 并行取总数 |
14
+ | `jiuchuanhui.clue.pool.search` | 只读 | 线索池列表 |
15
+ | `jiuchuanhui.clue.update.prepare/apply` | 高风险写 | `form`:主表修改 |
16
+ | `jiuchuanhui.clue.status-change.prepare/apply` | 高风险写 | `clueid`(注意小写)、`type`(必须传数字 1/2/3/4,不可中文);`type=1`放弃时必填 `desc`,`type=2`分配/转移时必填 `newmanager`,`type=4`无效时必填 `desc`;`type=2` 靠线索有无负责人区分意图 |
17
+ | `jiuchuanhui.clue.to-customer.prepare/apply` | 高风险写 | `clueId`、`customerId`(转已有客户) |
18
+ | `jiuchuanhui.clue.contact-record.create.prepare/apply` | 高风险写 | `clueId`、`content`、`clueStatus_MappingId`(必填,驱动状态流转:`3`=跟进中、`4`=无效) |
19
+
20
+ ## 输入要点
21
+
22
+ - 创建/修改前读缓存 `config/ebclue_ai_create_api.json`(或 `ebclue_ai_update_api.json`)的 `detail`,按 `data_key` 组装,`isRequired:"1"` 缺失时追问。
23
+ - 状态变更 `type` **必须用数字 1/2/3/4**(不可中文,非缓存选项):`1`=放弃(必填 `desc`)| `2`=分配或转移(必填 `newmanager`,有无负责人区分意图)| `3`=恢复有效 | `4`=无效(必填 `desc`)。先确认线索唯一、目标状态/人员明确,再 prepare -> 用户确认 -> apply。
24
+ - 线索转客户:用户指定转已有客户 -> `clue.to-customer`;转新客户 -> 走 `customer.create` 且传 `source_module_id=<clueId>`,成功后不要额外修改线索。
25
+ - 创建类型记录时根据联系记录内容自动判断线索状态(有效或无效)。
26
+ ## 命令
27
+
28
+ Windows PowerShell:
29
+
30
+ ```powershell
31
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.clue.search --input-json '{"clue_name":"示例","pageNo":1,"pageSize":10,"count":true}'
32
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.clue.get --input-json '{"id":"500001"}'
33
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.clue.status-change.prepare --input-json '{"mainTable":{"clueid":"500001","type":"2","newmanager":"USER_ID"}}'
34
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.clue.status-change.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
35
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.clue.to-customer.prepare --input-json '{"mainTable":{"clueId":"500001","customerId":"100001"}}'
36
+ ```
37
+
38
+ macOS/Linux(bash/zsh):
39
+
40
+ ```bash
41
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.clue.search --input-json '{"clue_name":"示例","pageNo":1,"pageSize":10,"count":true}'
42
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.clue.get --input-json '{"id":"500001"}'
43
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.clue.status-change.prepare --input-json '{"mainTable":{"clueid":"500001","type":"2","newmanager":"USER_ID"}}'
44
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.clue.status-change.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
45
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.clue.to-customer.prepare --input-json '{"mainTable":{"clueId":"500001","customerId":"100001"}}'
46
+ ```
47
+
48
+ ## 输出处理
49
+
50
+ - 创建成功返回 `datajson.dataIds`;状态变更成功以 `resultCode===200` 为标志,不额外验证。
51
+ - 线索名称渲染为可点击链接,`objId` 取缓存 `discovery["objId:uf_jch_clue"]`。
52
+
53
+ ## 注意
54
+
55
+ - 线索状态变更覆盖放弃、分配、转移、有效、无效等动作;写入前必须让用户确认目标状态与人员。
56
+ - 转新客户成功后不要再调用线索修改接口。
57
+
58
+ ## 失败处理
59
+
60
+ - 参数缺失/不支持:说明具体问题并停止。
61
+ - `partial/write_uncertain`:停止重试,补一次 `clue.get` 回查。
@@ -0,0 +1,56 @@
1
+ # 联系计划(contact-plan)
2
+
3
+ ## 何时使用
4
+
5
+ 用户表达联系计划相关意图:创建联系计划、完成联系计划。
6
+
7
+ ## 可用 operation
8
+
9
+ | Operation | 风险 | 输入要点 |
10
+ |---|---|---|
11
+ | `jiuchuanhui.contact-plan.create.prepare/apply` | 高风险写 | `form`: `{mainTable, ...}`;`type` 必填且与关联字段一一对应(见下) |
12
+ | `jiuchuanhui.contact-plan.complete.prepare/apply` | 高风险写 | `planId` |
13
+
14
+ ## 输入要点
15
+
16
+ - **`type` 联动规则(必填,传数字 1/2/3)**:`type=1`(客户)→ 必填 `customer`(客户 ID);`type=2`(商机)→ 必填 `sale_chance`(商机 ID);`type=3`(线索)→ 必填 `clue`(线索 ID)。三选一、一 一对应,不可混搭。字段 key 是 `customer`/`sale_chance`/`clue`,不是 `customer_id`/`sale_id`/`clue_id`。
17
+ - `status` 必填,默认"进行中"(ID=1)。
18
+ - `remind_time`(联系时间)必填,格式 `yyyy-MM-dd HH:mm`;字段 key 是 `remind_time`(非 `plan_time`)。
19
+ - `manager`(负责人)必填,默认当前操作人。
20
+ - `visit_type`(联系类型)与 `type`(关联对象类型)**无关**——`type` 分模块,`visit_type` 分方式(上门/电话等),可独立选择。
21
+
22
+ ## 命令
23
+
24
+ Windows PowerShell:
25
+
26
+ ```powershell
27
+ # 为客户创建联系计划 (type=1 → customer)
28
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact-plan.create.prepare --input-json '{"form":{"mainTable":{"type":"1","customer":"100001","remind_time":"2026-09-10 14:00"}}}'
29
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact-plan.create.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
30
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact-plan.complete.prepare --input-json '{"mainTable":{"planId":"600001"}}'
31
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact-plan.complete.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
32
+ ```
33
+
34
+ macOS/Linux(bash/zsh):
35
+
36
+ ```bash
37
+ # 为客户创建联系计划 (type=1 → customer)
38
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact-plan.create.prepare --input-json '{"form":{"mainTable":{"type":"1","customer":"100001","remind_time":"2026-09-10 14:00"}}}'
39
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact-plan.create.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
40
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact-plan.complete.prepare --input-json '{"mainTable":{"planId":"600001"}}'
41
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact-plan.complete.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
42
+ ```
43
+
44
+ ## 输出处理
45
+
46
+ - 创建成功返回 `datajson.dataIds`;完成计划成功以 `resultCode===200` 为标志。
47
+
48
+ ## 注意
49
+
50
+ - `type` 与关联字段必须联动:客户、商机、线索分别传对应事项 ID。
51
+ - 写操作执行前必须展示摘要并取得用户确认。
52
+
53
+ ## 失败处理
54
+
55
+ - 关联事项不唯一:先搜索候选并让用户选择。
56
+ - `partial/write_uncertain`:停止重试,补一次只读回查。
@@ -0,0 +1,48 @@
1
+ # 联系记录(contact-records)
2
+
3
+ ## 何时使用
4
+
5
+ 用户表达联系记录/跟进记录相关意图:查询某客户/商机/线索/联系人的联系记录,或按人员+时间范围查询联系记录。
6
+
7
+ ## 可用 operation
8
+
9
+ | Operation | 风险 | 输入要点 |
10
+ |---|---|---|
11
+ | `jiuchuanhui.entity.contact-records.list` | 只读 | `mainTable.moduleType`(`customer`/`clue`/`saleChance`)、`mainTable.entityId` |
12
+ | `jiuchuanhui.contact-records.by-person-time.list` | 只读 | `mainTable`: `{employeeId, startData, endData}` |
13
+
14
+ (新建联系记录/跟进走各业务模块的 `*.contact-record.create.prepare/apply`:客户/商机/线索分别见对应 reference。)
15
+
16
+ ## 输入要点
17
+
18
+ - `moduleType`:要查询的对象类型(客户/商机/线索),`entityId` 为对应数据 ID。
19
+ - 按人员+时间范围查询时,`employeeId` 用人员 ID(可先用 `user.id.by-name` 解析姓名),`startData`/`endData` 用 `yyyy-MM-dd HH:mm:ss`。
20
+ - 日期类模糊表达需转换为明确范围,例如今天、本周、本月分别补齐开始和结束时间。
21
+
22
+ ## 命令
23
+
24
+ Windows PowerShell:
25
+
26
+ ```powershell
27
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.entity.contact-records.list --input-json '{"mainTable":{"moduleType":"customer","entityId":"100001"}}'
28
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact-records.by-person-time.list --input-json '{"mainTable":{"employeeId":"USER_ID","startData":"2026-09-01 00:00:00","endData":"2026-09-09 23:59:59"}}'
29
+ ```
30
+
31
+ macOS/Linux(bash/zsh):
32
+
33
+ ```bash
34
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.entity.contact-records.list --input-json '{"mainTable":{"moduleType":"customer","entityId":"100001"}}'
35
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact-records.by-person-time.list --input-json '{"mainTable":{"employeeId":"USER_ID","startData":"2026-09-01 00:00:00","endData":"2026-09-09 23:59:59"}}'
36
+ ```
37
+
38
+ ## 输出处理
39
+
40
+ - 联系记录列表按时间倒序展示;超过 10 条先展示最相关的前 10 条并提示可继续翻页/缩小范围。
41
+
42
+ ## 注意
43
+
44
+ - 记录内的关联事项名称渲染为可点击链接。
45
+
46
+ ## 失败处理
47
+
48
+ - 参数缺失/不支持:说明具体问题并停止。
@@ -0,0 +1,56 @@
1
+ # 联系人管理(contact)
2
+
3
+ ## 何时使用
4
+
5
+ 用户表达联系人相关意图:新建联系人、联系人详情、修改联系人、按客户或商机查询联系人。
6
+
7
+ ## 可用 operation
8
+
9
+ | Operation | 风险 | 输入要点 |
10
+ |---|---|---|
11
+ | `jiuchuanhui.contact.create.prepare/apply` | 高风险写 | `form`: `{mainTable, detail1?, ...}`;联系人随客户创建(客户 `detail2`)时勿重复调用 |
12
+ | `jiuchuanhui.contact.get` | 只读 | `id` |
13
+ | `jiuchuanhui.contact.update.prepare/apply` | 高风险写 | `form`:主表修改,按配置 `data_key` 组装 |
14
+ | `jiuchuanhui.contact.by-entity.search` | 只读 | 按 `customerId` 或 `saleChanceId`(URL Query 传递,至少传一个),支持分页;body 的 `mainTable` 必传空对象 `{}` |
15
+
16
+ ## 输入要点
17
+
18
+ - 创建/修改前读缓存 `config/contact_create_api.json`(或 `contact_update_api.json`)的 `detail`;只使用 `isInput:"1"` 字段,按 `data_key` 组装。
19
+ - `contact_name`(姓名)必填;`customer`(所属客户)与 `salechance`(所属商机)**二选一必填**(至少传一个归属),`rel_sales` 可多选(逗号分隔)。
20
+ - 只给联系人姓名未指明所属事项时,先 `contact.by-entity.search` 或搜索候选并让用户选择,不要猜归属。
21
+ - 关联字段传选项/事项 ID(RelateBrowser 通过 `browser-option.search` 查自定义浏览选项)。
22
+
23
+ ## 命令
24
+
25
+ Windows PowerShell:
26
+
27
+ ```powershell
28
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact.by-entity.search --input-json '{"customerId":"100001","pageNo":1,"pageSize":10}'
29
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact.get --input-json '{"id":"300001"}'
30
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact.create.prepare --input-json '{"form":{"mainTable":{"contact_name":"王五","position":"采购经理"}}}'
31
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact.create.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
32
+ ```
33
+
34
+ macOS/Linux(bash/zsh):
35
+
36
+ ```bash
37
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact.by-entity.search --input-json '{"customerId":"100001","pageNo":1,"pageSize":10}'
38
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact.get --input-json '{"id":"300001"}'
39
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact.create.prepare --input-json '{"form":{"mainTable":{"contact_name":"王五","position":"采购经理"}}}'
40
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.contact.create.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
41
+ ```
42
+
43
+ ## 输出处理
44
+
45
+ - 创建成功返回 `datajson.dataIds`;`by-entity.search` 返回联系人列表。
46
+ - 联系人名称渲染为可点击链接,`objId` 取缓存 `discovery["objId:uf_jch_contact"]`。
47
+
48
+ ## 注意
49
+
50
+ - 客户创建时通过 `detail2` 提交的联系人会同步写入联系人模块,不要再调用 `contact.create`。
51
+ - 写操作必须展示摘要并取得用户确认。
52
+
53
+ ## 失败处理
54
+
55
+ - 参数缺失/不支持:说明具体问题并停止。
56
+ - `partial/write_uncertain`:停止重试,补一次 `contact.get` 回查。
@@ -0,0 +1,69 @@
1
+ # 客户管理(customer)
2
+
3
+ ## 何时使用
4
+
5
+ 用户表达客户相关意图:新建客户、客户详情、搜索客户、修改客户、转移客户、客户查重、公海搜索/领取/释放、客户联系记录、批量联系记录、客户状态/类型/行业查询。
6
+
7
+ ## 可用 operation
8
+
9
+ | Operation | 风险 | 输入要点 |
10
+ |---|---|---|
11
+ | `jiuchuanhui.customer.create.prepare/apply` | 高风险写 | `form`: `{mainTable, detail1?, detail2?, ...}`;`detail2` 提交后同步创建联系人,勿再调 `contact.create` |
12
+ | `jiuchuanhui.customer.get` | 只读 | `id` |
13
+ | `jiuchuanhui.customer.search` | 只读 | 搜索条件走 query;**必须显式传 `mine`/`all`/`customerSea`**(一个 `""` 其余 `-1`,默认 `mine=""`);分页 `pageNo`/`pageSize`;`count:true` 并行取总数 |
14
+ | `jiuchuanhui.customer.type/status/industry.search` | 只读 | 分页字段,用于取选项 ID |
15
+ | `jiuchuanhui.customer.open-sea.search` | 只读 | 公海客户列表,条件走 query |
16
+ | `jiuchuanhui.customer.update.prepare/apply` | 高风险写 | `form`:主表+明细修改,按配置 `data_key` 组装 |
17
+ | `jiuchuanhui.customer.transfer.prepare/apply` | 高风险写 | `customerId`、`toUserId`、可选 `remark` |
18
+ | `jiuchuanhui.customer.open-sea.release.prepare/apply` | 高风险写 | `customerId`、`openSeaId`(均必填)、可选 `remark`;释放影响需用户确认 |
19
+ | `jiuchuanhui.customer.open-sea.claim.prepare/apply` | 高风险写 | `customer_id`(注意下划线命名) |
20
+ | `jiuchuanhui.customer.duplicate.check` | 只读 | `mainTable.name`(原始名称)、`mainTable.simpleName`(归一化简称,均必填),动作流 `uniqueIndent=D5D0A1C30E7B404B842987C0AD3B749D` |
21
+ | `jiuchuanhui.customer.contact-record.create.prepare/apply` | 高风险写 | `customerId`、`comment_content`(必填);可选 `type`/`rating`/`contact_information`/`contacts`/`next_time`/`next_content`/`next_contact_information`/`next_contacts`/`sync_salechance`/`rel_remind`。`type` 为**评论类型**(销售记录/外勤记录/系统记录/客服记录等),与商机联系记录的 `type`(联系类型)**取值体系不同,勿混用** |
22
+ | `jiuchuanhui.customer.contact-record.batch.prepare/apply` | 高风险写 | `customerIds`(一次最多 20 个客户 ID)、`content`;批量部分成功需人工核对 |
23
+
24
+ ## 输入要点
25
+
26
+ - 创建/修改前先读缓存 `config/customer_create_api.json`(或 `customer_update_api.json`)的 `detail.mainFields`/`detail.detailFields`;只使用 `isInput:"1"` 字段,按 `data_key` 组装,`isRequired:"1"` 缺失时追问,禁止占位值。
27
+ - `manager`(客户经理)必填,默认当前操作人;`id` 由系统生成,**请求体不携带 `id`**。
28
+ - **修改(update)局部更新**:只传需要修改的字段(含 `id` 定位记录),未传入字段保持原值。以下系统字段**不可更新**(传了会被忽略):`id`、`operator`、`creator`、`create_time`、`update_time`、`updater`、`data_status`、`customer_number`。
29
+ - **转移/释放公海权限不足返回 HTTP 204**:提示用户无对应权限,联系管理员;不可误报为"操作失败"。
30
+ - Select/RadioBox/CheckBox 字段传选项 ID(读字段 `optionList`);Employee/RelateBrowser 字段传人员/事项 ID。
31
+ - 行政区划 `country`/`province`/`city`/`district` 传逗号分隔全路径 ID;传细粒度自动填充粗粒度。
32
+ - 搜索无 `scope` 快捷参数,`mine`/`all`/`customerSea` 三选一置空;日期范围用 `*_gt`/`*_lt` 字段;人员字段传人员 ID(如 `managerid`)。
33
+
34
+ ## 命令
35
+
36
+ Windows PowerShell:
37
+
38
+ ```powershell
39
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.duplicate.check --input-json '{"mainTable":{"name":"示例科技有限公司","simpleName":"示例科技"}}'
40
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.create.prepare --input-json '{"form":{"mainTable":{"manager":"USER_ID","customer_name":"示例科技有限公司"}}}'
41
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.create.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
42
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.search --input-json '{"customer_name":"小康","mine":"","all":"-1","customerSea":"-1","pageNo":1,"pageSize":10,"count":true}'
43
+ ```
44
+
45
+ macOS/Linux(bash/zsh):
46
+
47
+ ```bash
48
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.duplicate.check --input-json '{"mainTable":{"name":"示例科技有限公司","simpleName":"示例科技"}}'
49
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.create.prepare --input-json '{"form":{"mainTable":{"manager":"USER_ID","customer_name":"示例科技有限公司"}}}'
50
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.create.apply --input-json '{"continuation":"PREPARE_CONTINUATION","confirm":true}'
51
+ weaver-work-cli --json jiuchuanhui run jiuchuanhui.customer.search --input-json '{"customer_name":"小康","mine":"","all":"-1","customerSea":"-1","pageNo":1,"pageSize":10,"count":true}'
52
+ ```
53
+
54
+ ## 输出处理
55
+
56
+ - 创建成功返回 `datajson.dataIds`(ID 列表)与 `status`;搜索返回 `datajson.datas` 数组。
57
+ - 列表默认只取第一页 `pageNo=1`、`pageSize=10`;只有用户要求翻页才继续。
58
+ - 客户名称渲染为可点击链接 `https://{baseUrl}/sp/ebdfpage/card/0/{objId}/{dataId}`,`objId` 取缓存 `discovery["objId:uf_jch_customer"]`。
59
+
60
+ ## 注意
61
+
62
+ - 新建客户前**必须先查重**;存在疑似重复时表格展示让用户确认;若客户在公海,提醒可领取并让用户确认。
63
+ - `detail2` 会同步创建联系人,不要重复调用 `contact.create`。
64
+ - 释放公海、转移客户前必须确认客户唯一并提示影响。
65
+
66
+ ## 失败处理
67
+
68
+ - 参数缺失/不支持:说明具体问题并停止,不猜测、不替换、不重试。
69
+ - `partial/write_uncertain`:停止重试,补一次 `customer.get` 只读回查,给用户明确结论。