weaver-work-cli 0.1.42 → 0.1.45

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 (401) hide show
  1. package/README.md +21 -0
  2. package/dist/chunks/{archive-J4I6MCKF.js → archive-ZQ4A4TV6.js} +399 -47
  3. package/dist/chunks/{archive-oa-BRZKKTO4.js → archive-oa-BBDP7AKJ.js} +12 -5
  4. package/dist/chunks/{asset-L7D4FAOZ.js → asset-ZOJVBWZH.js} +11 -4
  5. package/dist/chunks/{asset-idle-DADLLV75.js → asset-idle-XGB5IPGT.js} +7 -3
  6. package/dist/chunks/{attachment-content-K4C7VLWQ.js → attachment-content-CE3GMWTS.js} +5 -4
  7. package/dist/chunks/{blog-BVGQ7NZL.js → blog-QSHLZSFW.js} +11 -4
  8. package/dist/chunks/caizhilian-KCQYFH72.js +204 -0
  9. package/dist/chunks/{calendar-Q7NQY5Z2.js → calendar-DLGMRJQA.js} +12 -5
  10. package/dist/chunks/{chunk-W7BEHOSR.js → chunk-3WBIQLMB.js} +2 -2
  11. package/dist/chunks/{chunk-4PD5NWAX.js → chunk-3YV7PKRL.js} +2 -2
  12. package/dist/chunks/{chunk-JPRO6ER2.js → chunk-3ZMAQQ3W.js} +185 -60
  13. package/dist/chunks/{chunk-R4CHUSKC.js → chunk-4EXOIQDI.js} +40 -10
  14. package/dist/chunks/{chunk-OOUTBLZ4.js → chunk-56EZERK4.js} +1 -1
  15. package/dist/chunks/chunk-6N4JPNFL.js +76 -0
  16. package/dist/chunks/{chunk-SA6VBIHY.js → chunk-6NXT4ICB.js} +342 -17
  17. package/dist/chunks/{chunk-ZUX3P6BQ.js → chunk-727FH2NI.js} +1 -1
  18. package/dist/chunks/chunk-762M5XJS.js +215 -0
  19. package/dist/chunks/{chunk-GEWYMQME.js → chunk-77YP6I52.js} +1 -1
  20. package/dist/chunks/chunk-7BDPM5ST.js +11 -0
  21. package/dist/chunks/{chunk-G4UR6NXN.js → chunk-CZNZKOHR.js} +3 -3
  22. package/dist/chunks/{chunk-GHXCDPTM.js → chunk-DGMYACGJ.js} +1 -1
  23. package/dist/chunks/{chunk-4RAE6JXP.js → chunk-DLY5GUXX.js} +6 -3
  24. package/dist/chunks/{chunk-BYBSCN4X.js → chunk-G7PQWD4L.js} +6 -3
  25. package/dist/chunks/{chunk-EKWAQSLU.js → chunk-GR76ZDDX.js} +432 -2248
  26. package/dist/chunks/{chunk-APVFJUQH.js → chunk-HFXK54M4.js} +3 -3
  27. package/dist/chunks/{chunk-EZALDOQH.js → chunk-HP7JIYMT.js} +5 -2
  28. package/dist/chunks/{chunk-ZEDWSH32.js → chunk-IC62NFM5.js} +1 -1
  29. package/dist/chunks/{chunk-3KTFS4IA.js → chunk-JB34OE7R.js} +808 -85
  30. package/dist/chunks/{chunk-72CKAUAG.js → chunk-JWWTI63L.js} +59 -7
  31. package/dist/chunks/{chunk-P26ZWSKU.js → chunk-KIHNAS25.js} +5 -2
  32. package/dist/chunks/{chunk-NKZRQXST.js → chunk-LGKWL4OH.js} +200 -47
  33. package/dist/chunks/chunk-LRCPNDZA.js +2529 -0
  34. package/dist/chunks/{chunk-QKNKR4RH.js → chunk-LXFVWZLM.js} +4 -4
  35. package/dist/chunks/{chunk-NOODWMCL.js → chunk-O6CMPO65.js} +25 -2
  36. package/dist/chunks/{chunk-BIPYLLVS.js → chunk-OAE3AZBQ.js} +15 -15
  37. package/dist/chunks/chunk-P5GQRWDC.js +60 -0
  38. package/dist/chunks/{caizhilian-SAADNFD6.js → chunk-PGO4ILMQ.js} +44 -517
  39. package/dist/chunks/{chunk-2LV74IWP.js → chunk-Q4OYAQYH.js} +1 -1
  40. package/dist/chunks/{chunk-LDZQPUIA.js → chunk-T4MWQAQB.js} +8 -6
  41. package/dist/chunks/{chunk-BBKDXQEC.js → chunk-TGAGQV4I.js} +3 -3
  42. package/dist/chunks/{chunk-GPMFD4RD.js → chunk-TXUG266F.js} +1 -1
  43. package/dist/chunks/{chunk-FOAA27U5.js → chunk-U6R6FZHD.js} +184 -18
  44. package/dist/chunks/{chunk-LUSPKZKY.js → chunk-UG5G54VL.js} +1 -0
  45. package/dist/chunks/{chunk-NIAJ5ZCG.js → chunk-UL5XUQ25.js} +5 -2
  46. package/dist/chunks/{chunk-IZ7S7QUS.js → chunk-VIMCY4DI.js} +6 -6
  47. package/dist/chunks/chunk-VRPH24IC.js +76 -0
  48. package/dist/chunks/{chunk-FMPJJYYI.js → chunk-WRXSAVKO.js} +1 -1
  49. package/dist/chunks/{chunk-YRSZQUD2.js → chunk-YIKSL36S.js} +3 -3
  50. package/dist/chunks/{chunk-3SO6QL6U.js → chunk-YWX377BY.js} +5 -2
  51. package/dist/chunks/{chunk-BYATLLEF.js → chunk-Z3GDFVJR.js} +1 -1
  52. package/dist/chunks/{chunk-LADPYOWC.js → chunk-Z6UUBY37.js} +3 -3
  53. package/dist/chunks/{conflict-F2OMZRTO.js → conflict-IYJETSGT.js} +4 -3
  54. package/dist/chunks/{continuation-2CKSBLA6.js → continuation-3S37AUSH.js} +4 -3
  55. package/dist/chunks/{continuation-RN6PZN2M.js → continuation-3XLYYTKV.js} +4 -3
  56. package/dist/chunks/continuation-GW6PRWK3.js +12 -0
  57. package/dist/chunks/{continuation-HZIZRZBX.js → continuation-HFW2YT5S.js} +4 -3
  58. package/dist/chunks/{continuation-NLECEJPX.js → continuation-KI7DRRZN.js} +4 -3
  59. package/dist/chunks/{contract-5BETHRSG.js → contract-3QLAGYQL.js} +5803 -4593
  60. package/dist/chunks/{cowork-3MN6EQQO.js → cowork-3ACICHDQ.js} +11 -4
  61. package/dist/chunks/{create-flow-5FQNNMVO.js → create-flow-7JLC7UID.js} +8 -7
  62. package/dist/chunks/{ebuilder-form-SBHOYBUD.js → ebuilder-form-GWDTKEI2.js} +14 -9
  63. package/dist/chunks/{ehr-KMOJULKG.js → ehr-MYRDCHZ4.js} +357 -43
  64. package/dist/chunks/{employee-SAK2QYXX.js → employee-NOHNXC46.js} +3 -3
  65. package/dist/chunks/{env-LB7NBL2O.js → env-3MBHAWBL.js} +4 -3
  66. package/dist/chunks/{esb-W2PJCFCX.js → esb-4BQHNP5C.js} +12 -7
  67. package/dist/chunks/{factory-6ZFQXQ46.js → factory-TZEVU4DU.js} +3 -2
  68. package/dist/chunks/{fna-ZQPCUV4R.js → fna-ZVB2IILI.js} +14 -8
  69. package/dist/chunks/{group-chat-2HHAJN46.js → group-chat-KL3HFKRM.js} +5 -4
  70. package/dist/chunks/{host-YTODKMSL.js → host-3TNBMDTR.js} +5 -5
  71. package/dist/chunks/host-7NTIBSPK.js +25 -0
  72. package/dist/chunks/{host-4CBHGOHT.js → host-7OWWPLM4.js} +5 -5
  73. package/dist/chunks/{host-ATKVNZAT.js → host-G3VU7SDW.js} +5 -5
  74. package/dist/chunks/{host-BQH22NTQ.js → host-M4XP5URR.js} +5 -5
  75. package/dist/chunks/{host-X2CSLFM6.js → host-TUOIOEMC.js} +5 -5
  76. package/dist/chunks/{hrm-FFM4UJFS.js → hrm-UNKCCCGP.js} +11 -7
  77. package/dist/chunks/{im-VEHKDQPB.js → im-NJB7ZYMH.js} +8 -7
  78. package/dist/chunks/{invoice-LVIKSIIF.js → invoice-OQP3TMKQ.js} +636 -1768
  79. package/dist/chunks/{jiuchuanhui-X6DINO5P.js → jiuchuanhui-ASFZBMPU.js} +14 -6
  80. package/dist/chunks/{lazy-dispatch-KSWTN5L6.js → lazy-dispatch-UH6HGK2I.js} +7 -6
  81. package/dist/chunks/{mail-VDKRGUD3.js → mail-M3HJF5ER.js} +16 -14
  82. package/dist/chunks/{meeting-CLC6HP3Z.js → meeting-C67EHQ4Z.js} +21 -14
  83. package/dist/chunks/{okr-CHG4OO3U.js → okr-EVX7FB5G.js} +12 -5
  84. package/dist/chunks/{operations-5QL3AECO.js → operations-62N6EP3C.js} +4 -3
  85. package/dist/chunks/operations-J7PUIVWZ.js +15 -0
  86. package/dist/chunks/{plan-XWR75667.js → plan-2QJQEPBO.js} +12 -5
  87. package/dist/chunks/{project-5BXOOKMG.js → project-XELELW2T.js} +11 -4
  88. package/dist/chunks/reception-5WITA44R.js +1899 -0
  89. package/dist/chunks/{recruit-stage-DGMFNNDE.js → recruit-stage-AHY5QAMF.js} +745 -149
  90. package/dist/chunks/{registry-RHMW6ANW.js → registry-AQVGHUM6.js} +7 -6
  91. package/dist/chunks/{registry-OZSMDVPP.js → registry-PVUZQDDQ.js} +3 -3
  92. package/dist/chunks/{registry-7FFOXIAW.js → registry-QJCZ2GVG.js} +7 -6
  93. package/dist/chunks/{registry-Z43434VG.js → registry-VWXWPVAG.js} +4 -4
  94. package/dist/chunks/registry-XPWPGHYE.js +24 -0
  95. package/dist/chunks/{room-recommend-62H7ZQQ6.js → room-recommend-CNWE5WQK.js} +8 -5
  96. package/dist/chunks/{schedule-FNXKH3DQ.js → schedule-YYNYBQIE.js} +6 -5
  97. package/dist/chunks/{workflow-ADHKCAJK.js → workflow-BSYT5TGL.js} +15 -8
  98. package/dist/cmd/action.js +6 -0
  99. package/dist/cmd/identity/index.js +45 -0
  100. package/dist/cmd/index.js +2 -0
  101. package/dist/core/continuation-ttl.js +18 -0
  102. package/dist/core/error-codes.js +85 -0
  103. package/dist/core/logger.js +11 -0
  104. package/dist/index.js +37 -31
  105. package/dist/internal/e10/auth/commands.js +195 -8
  106. package/dist/internal/e10/auth/error-log.js +312 -0
  107. package/dist/internal/e10/auth/session.js +17 -3
  108. package/dist/internal/e10/auth/xiaoe.js +176 -13
  109. package/dist/internal/e10/auth-recovery.js +39 -12
  110. package/dist/internal/e10/context.js +29 -3
  111. package/dist/internal/skills/install.js +9 -1
  112. package/dist/shortcuts/archive/continuation.js +2 -1
  113. package/dist/shortcuts/archive/index.js +3 -0
  114. package/dist/shortcuts/archive/operations/borrow-list.js +105 -14
  115. package/dist/shortcuts/archive/operations/confirm.js +2 -1
  116. package/dist/shortcuts/archive/operations/flow-url.js +182 -22
  117. package/dist/shortcuts/archive/operations/getPageUrl.js +75 -0
  118. package/dist/shortcuts/archive/operations/prelib.js +33 -4
  119. package/dist/shortcuts/archive/operations/shared.js +52 -0
  120. package/dist/shortcuts/archive-oa/continuation.js +2 -1
  121. package/dist/shortcuts/archive-oa/index.js +2 -0
  122. package/dist/shortcuts/archive-oa/operations/confirm.js +2 -1
  123. package/dist/shortcuts/asset/continuation.js +2 -1
  124. package/dist/shortcuts/asset/index.js +2 -0
  125. package/dist/shortcuts/asset-idle/index.js +2 -0
  126. package/dist/shortcuts/blog/continuation.js +2 -1
  127. package/dist/shortcuts/blog/index.js +2 -0
  128. package/dist/shortcuts/caizhilian/continuation.js +2 -1
  129. package/dist/shortcuts/caizhilian/index.js +2 -0
  130. package/dist/shortcuts/caizhilian/operations/confirm.js +3 -2
  131. package/dist/shortcuts/calendar/continuation.js +2 -1
  132. package/dist/shortcuts/calendar/index.js +2 -0
  133. package/dist/shortcuts/calendar/operations/write.js +1 -1
  134. package/dist/shortcuts/contract/continuation.js +2 -1
  135. package/dist/shortcuts/contract/host.js +111 -4
  136. package/dist/shortcuts/contract/index.js +21 -0
  137. package/dist/shortcuts/contract/manifest.js +125 -0
  138. package/dist/shortcuts/contract/ooxml/clause-insert.js +249 -0
  139. package/dist/shortcuts/contract/operations/clause-insert.js +56 -0
  140. package/dist/shortcuts/contract/operations/customer.js +192 -0
  141. package/dist/shortcuts/contract/operations/file-download.js +75 -0
  142. package/dist/shortcuts/contract/operations/flow.js +44 -2
  143. package/dist/shortcuts/contract/operations/form-info.js +162 -62
  144. package/dist/shortcuts/contract/operations/registry.js +8 -0
  145. package/dist/shortcuts/contract/operations/review.js +116 -1
  146. package/dist/shortcuts/contract/operations/summary.js +177 -0
  147. package/dist/shortcuts/contract/operations/upload.js +64 -4
  148. package/dist/shortcuts/contract/operations/write.js +2 -1
  149. package/dist/shortcuts/contract/upload-cache.js +104 -0
  150. package/dist/shortcuts/cowork/continuation.js +2 -1
  151. package/dist/shortcuts/cowork/index.js +2 -0
  152. package/dist/shortcuts/ebuilder-form/continuation.js +2 -1
  153. package/dist/shortcuts/ebuilder-form/index.js +2 -0
  154. package/dist/shortcuts/ebuilder-form/operations/write.js +3 -2
  155. package/dist/shortcuts/ehr/continuation.js +2 -1
  156. package/dist/shortcuts/ehr/index.js +2 -0
  157. package/dist/shortcuts/ehr/operations/attend-write.js +1 -1
  158. package/dist/shortcuts/ehr/operations/recruit-candidate-import.js +186 -5
  159. package/dist/shortcuts/ehr/operations/recruit-position.js +239 -6
  160. package/dist/shortcuts/ehr/operations/recruit-write.js +18 -19
  161. package/dist/shortcuts/ehr/operations/recruit.js +17 -5
  162. package/dist/shortcuts/esb/continuation.js +2 -1
  163. package/dist/shortcuts/esb/index.js +2 -0
  164. package/dist/shortcuts/esb/operations/trigger.js +2 -1
  165. package/dist/shortcuts/fna/continuation.js +2 -1
  166. package/dist/shortcuts/fna/index.js +2 -0
  167. package/dist/shortcuts/fna/operations/invoice-writeoff.js +1 -1
  168. package/dist/shortcuts/fna/operations/loan.js +1 -1
  169. package/dist/shortcuts/hrm/index.js +2 -0
  170. package/dist/shortcuts/hrm/operations/employee.js +29 -1
  171. package/dist/shortcuts/im/continuation.js +2 -1
  172. package/dist/shortcuts/index.js +5 -0
  173. package/dist/shortcuts/invoice/continuation.js +2 -1
  174. package/dist/shortcuts/invoice/index.js +14 -15
  175. package/dist/shortcuts/invoice/invoice-record.js +93 -0
  176. package/dist/shortcuts/invoice/manifest.js +190 -393
  177. package/dist/shortcuts/invoice/operations/add.js +2 -1
  178. package/dist/shortcuts/invoice/operations/delete.js +2 -1
  179. package/dist/shortcuts/invoice/operations/import.js +2 -1
  180. package/dist/shortcuts/invoice/operations/issuing-contract-detail.js +86 -0
  181. package/dist/shortcuts/invoice/operations/issuing-contracts.js +210 -0
  182. package/dist/shortcuts/invoice/operations/registry.js +17 -17
  183. package/dist/shortcuts/invoice/operations/reim-auto.js +4 -569
  184. package/dist/shortcuts/invoice/operations/reim.js +52 -341
  185. package/dist/shortcuts/invoice/operations/shared.js +21 -4
  186. package/dist/shortcuts/invoice/operations/update.js +2 -1
  187. package/dist/shortcuts/invoice/projection.js +10 -62
  188. package/dist/shortcuts/jiuchuanhui/continuation.js +2 -1
  189. package/dist/shortcuts/jiuchuanhui/index.js +2 -0
  190. package/dist/shortcuts/jiuchuanhui/operations/datajson.js +2 -1
  191. package/dist/shortcuts/jiuchuanhui/operations/esb.js +2 -1
  192. package/dist/shortcuts/mail/continuation.js +2 -1
  193. package/dist/shortcuts/mail/index.js +2 -0
  194. package/dist/shortcuts/mail/operations/mail-blacklist.js +1 -1
  195. package/dist/shortcuts/mail/operations/mail-contacts.js +1 -1
  196. package/dist/shortcuts/mail/operations/mail-send.js +1 -1
  197. package/dist/shortcuts/mail/operations/mail-sign.js +1 -1
  198. package/dist/shortcuts/mail/operations/mail-template.js +1 -1
  199. package/dist/shortcuts/meeting/continuation.js +2 -1
  200. package/dist/shortcuts/meeting/index.js +2 -0
  201. package/dist/shortcuts/meeting/operations/change.js +1 -1
  202. package/dist/shortcuts/meeting/operations/create.js +1 -1
  203. package/dist/shortcuts/meeting/operations/eb/create-flow.js +198 -65
  204. package/dist/shortcuts/meeting/operations/eb/decision.js +1 -1
  205. package/dist/shortcuts/meeting/operations/eb/draft-memory.js +56 -0
  206. package/dist/shortcuts/meeting/operations/eb/factory.js +59 -4
  207. package/dist/shortcuts/meeting/operations/eb/person-cache.js +2 -2
  208. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +47 -5
  209. package/dist/shortcuts/meeting/operations/invitation-publish.js +132 -0
  210. package/dist/shortcuts/meeting/operations/lifecycle.js +1 -1
  211. package/dist/shortcuts/meeting/operations/receipts.js +1 -1
  212. package/dist/shortcuts/meeting/operations/registry.js +2 -0
  213. package/dist/shortcuts/meeting/operations/signs.js +1 -1
  214. package/dist/shortcuts/okr/continuation.js +2 -1
  215. package/dist/shortcuts/okr/index.js +2 -0
  216. package/dist/shortcuts/okr/operations/write.js +1 -1
  217. package/dist/shortcuts/plan/continuation.js +2 -1
  218. package/dist/shortcuts/plan/index.js +2 -0
  219. package/dist/shortcuts/plan/operations/write.js +1 -1
  220. package/dist/shortcuts/project/continuation.js +2 -1
  221. package/dist/shortcuts/project/index.js +2 -0
  222. package/dist/shortcuts/reception/constants.js +53 -0
  223. package/dist/shortcuts/reception/errors.js +54 -0
  224. package/dist/shortcuts/reception/host.js +125 -0
  225. package/dist/shortcuts/reception/index.js +198 -0
  226. package/dist/shortcuts/reception/manifest.js +177 -0
  227. package/dist/shortcuts/reception/operations/ask.js +71 -0
  228. package/dist/shortcuts/reception/operations/browsertool.js +58 -0
  229. package/dist/shortcuts/reception/operations/compose.js +129 -0
  230. package/dist/shortcuts/reception/operations/customparams.js +74 -0
  231. package/dist/shortcuts/reception/operations/doc.js +238 -0
  232. package/dist/shortcuts/reception/operations/docrender.js +36 -0
  233. package/dist/shortcuts/reception/operations/panels.js +179 -0
  234. package/dist/shortcuts/reception/operations/registry.js +26 -0
  235. package/dist/shortcuts/reception/operations/render-assets.js +184 -0
  236. package/dist/shortcuts/reception/operations/render.js +123 -0
  237. package/dist/shortcuts/reception/operations/runs.js +38 -0
  238. package/dist/shortcuts/reception/operations/schedule.js +127 -0
  239. package/dist/shortcuts/reception/operations/shared.js +196 -0
  240. package/dist/shortcuts/reception/operations/snapshot.js +68 -0
  241. package/dist/shortcuts/reception/operations/types.js +1 -0
  242. package/dist/shortcuts/reception/operations.js +33 -0
  243. package/dist/shortcuts/reception/upload.js +218 -0
  244. package/dist/shortcuts/recruit-stage/context.js +145 -33
  245. package/dist/shortcuts/recruit-stage/continuation.js +2 -1
  246. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +86 -16
  247. package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +6 -4
  248. package/dist/shortcuts/recruit-stage/operations/jd-create.js +289 -48
  249. package/dist/shortcuts/recruit-stage/operations/resume-import.js +207 -25
  250. package/dist/shortcuts/recruit-stage/shared.js +161 -18
  251. package/dist/shortcuts/workflow/continuation.js +2 -1
  252. package/dist/shortcuts/workflow/index.js +4 -0
  253. package/dist/shortcuts/workflow/operations/form.js +32 -8
  254. package/dist/shortcuts/workflow/operations/read.js +8 -3
  255. package/dist/shortcuts/workflow/operations/todoSmartConvert/aigroupRules.js +92 -5
  256. package/dist/shortcuts/workflow/operations/todoSmartConvert/priorityExpr.js +509 -0
  257. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +22 -1
  258. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +32 -6
  259. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +57 -11
  260. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +165 -52
  261. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +57 -14
  262. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.smartGroup.js +44 -18
  263. package/dist/shortcuts/workflow/operations/write.js +1 -1
  264. package/docs/_catalog.md +3 -0
  265. package/docs/agent-invoice.md +1 -1
  266. package/docs/archive-oa.md +1 -1
  267. package/docs/caizhilian.md +1 -1
  268. package/docs/calendar.md +1 -1
  269. package/docs/contract.md +2 -1
  270. package/docs/e10-auth.md +19 -1
  271. package/docs/ehr.md +2 -2
  272. package/docs/esb.md +1 -1
  273. package/docs/im.md +1 -1
  274. package/docs/invoice.md +8 -12
  275. package/docs/okr.md +1 -1
  276. package/docs/reception.md +119 -0
  277. package/docs/todo-smart-convert/data-contract.md +7 -0
  278. package/package.json +1 -1
  279. package/scripts/clean.mjs +43 -2
  280. package/skill-template/business-info.json +18 -2
  281. package/skill-template/domains/caizhilian.md +1 -1
  282. package/skill-template/domains/jinchengda.md +2 -0
  283. package/skill-template/domains/reception-flow.md +18 -0
  284. package/skill-template/domains/yepiaotong.md +4 -7
  285. package/skills/weaver-e10-archive-oa/references/source-manifest.json +14 -14
  286. package/skills/weaver-e10-blog/references/blog-publish.md +1 -1
  287. package/skills/weaver-e10-blog/references/source-manifest.json +7 -7
  288. package/skills/weaver-e10-caizhilian/references/source-manifest.json +21 -21
  289. package/skills/weaver-e10-caizhilian/references/write-protocol.md +2 -2
  290. package/skills/weaver-e10-calendar/references/calendar-write.md +1 -1
  291. package/skills/weaver-e10-cowork/SKILL.md +1 -1
  292. package/skills/weaver-e10-ebuilder-form/SKILL.md +1 -1
  293. package/skills/weaver-e10-ebuilder-form/references/custom-api.md +1 -1
  294. package/skills/weaver-e10-ebuilder-form/references/openapi-write.md +1 -1
  295. package/skills/weaver-e10-esb/SKILL.md +2 -2
  296. package/skills/weaver-e10-esb/references/source-manifest.json +22 -22
  297. package/skills/weaver-e10-esb/references/trigger.md +2 -2
  298. package/skills/weaver-e10-jinchengda/SKILL.md +198 -205
  299. package/skills/weaver-e10-jinchengda/references/contract-action-card.md +759 -0
  300. package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +250 -0
  301. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +146 -7
  302. package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +178 -0
  303. package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +1 -1
  304. package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +1 -1
  305. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +75 -0
  306. package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +137 -0
  307. package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +163 -0
  308. package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +52 -3
  309. package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +92 -5
  310. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +602 -0
  311. package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +209 -0
  312. package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +126 -0
  313. package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +312 -0
  314. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +555 -0
  315. package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +47 -12
  316. package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +469 -0
  317. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +154 -1
  318. package/skills/weaver-e10-jinchengda/references/contract-request-write.md +1 -1
  319. package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +224 -0
  320. package/skills/weaver-e10-jinchengda/references/orchestration.md +355 -0
  321. package/skills/weaver-e10-jinchengda/references/source-manifest.json +29 -29
  322. package/skills/weaver-e10-jucailin/SKILL.md +1 -1
  323. package/skills/weaver-e10-jucailin/references/attend-write.md +2 -2
  324. package/skills/weaver-e10-jucailin/references/recruit-create.md +15 -4
  325. package/skills/weaver-e10-jucailin/references/recruit-write.md +3 -3
  326. package/skills/weaver-e10-meeting/SKILL.md +64 -14
  327. package/skills/weaver-e10-meeting/references/meeting-change.md +1 -1
  328. package/skills/weaver-e10-meeting/references/meeting-create.md +1 -1
  329. package/skills/weaver-e10-meeting/references/meeting-lifecycle.md +1 -1
  330. package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
  331. package/skills/weaver-e10-okr/references/okr-align.md +1 -1
  332. package/skills/weaver-e10-okr/references/okr-keyresult.md +1 -1
  333. package/skills/weaver-e10-okr/references/okr-write.md +1 -1
  334. package/skills/weaver-e10-okr/references/source-manifest.json +8 -8
  335. package/skills/weaver-e10-plan/references/plan-report-write.md +1 -1
  336. package/skills/weaver-e10-plan/references/source-manifest.json +20 -20
  337. package/skills/weaver-e10-qiyecheng/references/loan-management.md +1 -1
  338. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +18 -18
  339. package/skills/weaver-e10-reception-flow/SKILL.md +173 -0
  340. package/skills/weaver-e10-reception-flow/assets//350/241/214/347/250/213/345/215/225/346/250/241/346/235/277-/346/263/233/345/276/256.docx +0 -0
  341. package/skills/weaver-e10-reception-flow/data/fields-snapshot.json +213 -0
  342. package/skills/weaver-e10-reception-flow/references/browsertool.md +68 -0
  343. package/skills/weaver-e10-reception-flow/references/env-pitfalls.md +51 -0
  344. package/skills/weaver-e10-reception-flow/references/fields-snapshot.md +227 -0
  345. package/skills/weaver-e10-reception-flow/references/guide.md +179 -0
  346. package/skills/weaver-e10-reception-flow/scripts/locate.sh +14 -0
  347. package/skills/weaver-e10-reception-flow/scripts/render.py +724 -0
  348. package/skills/weaver-e10-recruit-stage/SKILL.md +19 -10
  349. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +10 -2
  350. package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +1 -1
  351. package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +66 -0
  352. package/skills/weaver-e10-recruit-stage/references/position-templates.md +204 -0
  353. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +13 -1
  354. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +29 -6
  355. package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +27 -14
  356. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +21 -2
  357. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +9 -1
  358. package/skills/weaver-e10-shijingran/SKILL.md +5 -5
  359. package/skills/weaver-e10-shijingran/references/source-manifest.json +37 -36
  360. package/skills/weaver-e10-skill-maker/references/module-cli-generation.md +2 -0
  361. package/skills/weaver-e10-wenshuding/SKILL.md +17 -7
  362. package/skills/weaver-e10-wenshuding/references/archive-borrow-list.md +28 -0
  363. package/skills/weaver-e10-wenshuding/references/archive-flow.md +24 -8
  364. package/skills/weaver-e10-wenshuding/references/archive-prelib-list.md +3 -0
  365. package/skills/weaver-e10-wenshuding/references/archive-prelib-open.md +4 -0
  366. package/skills/weaver-e10-wenshuding/references/archive-search.md +3 -1
  367. package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
  368. package/skills/weaver-e10-workflow/SKILL.md +19 -17
  369. package/skills/weaver-e10-workflow/aigroup/default.json +10 -6
  370. package/skills/weaver-e10-workflow/references/source-manifest.json +32 -32
  371. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +36 -3
  372. package/skills/weaver-e10-workflow/references/workflow-memory.md +1 -1
  373. package/skills/weaver-e10-workflow/references/workflow-query.md +9 -6
  374. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +152 -1
  375. package/skills/weaver-e10-yepiaotong/SKILL.md +19 -26
  376. package/skills/weaver-e10-yepiaotong/references/invoice-detail.md +13 -10
  377. package/skills/weaver-e10-yepiaotong/references/invoice-enterprise-list.md +2 -0
  378. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-workflow.md +194 -155
  379. package/skills/weaver-e10-yepiaotong/references/invoice-output-view.md +28 -32
  380. package/skills/weaver-e10-yepiaotong/references/invoice-personal-list.md +5 -1
  381. package/skills/weaver-e10-yepiaotong/references/invoice-reim.md +8 -10
  382. package/skills/weaver-e10-yepiaotong/references/reim-api-reference.md +211 -616
  383. package/skills/weaver-e10-yepiaotong/references/reim-examples.md +149 -117
  384. package/skills/weaver-e10-yepiaotong/references/reim-expense-subject-rules.md +17 -20
  385. package/skills/weaver-e10-yepiaotong/references/reim-form-fill-rules.md +20 -39
  386. package/skills/weaver-e10-yepiaotong/references/reim-matching-rules.md +55 -22
  387. package/skills/weaver-e10-yepiaotong/references/reim-phone-subsidy-rules.md +7 -17
  388. package/skills/weaver-e10-yepiaotong/references/reim-workflow.md +88 -92
  389. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +144 -354
  390. package/skills/weaver-e10-yimiaoban/SKILL.md +18 -6
  391. package/skills/weaver-e10-yimiaoban/references/msg-write.md +31 -1
  392. package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
  393. package/skills/weaver-e10-yimiaoban/references/session-sysmsg.md +72 -0
  394. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +11 -11
  395. package/dist/chunks/chunk-TTPJJJC4.js +0 -465
  396. package/dist/chunks/registry-BKBZPBAJ.js +0 -23
  397. package/dist/shortcuts/invoice/markdown.js +0 -172
  398. package/dist/shortcuts/invoice/operations/issuing-qys.js +0 -424
  399. package/skills/weaver-e10-meeting.zip +0 -0
  400. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-examples.md +0 -131
  401. package/skills/weaver-e10-yepiaotong/references/invoice-issuing-form-fill-rules.md +0 -179
@@ -0,0 +1,759 @@
1
+ # 行为卡片输出(小e 合同列表)
2
+
3
+ 只要本轮**给出了可选项、推荐、或需要用户点选的动作**,除了对话文本之外,必须再输出一张行为卡片。文本负责解释"为什么",卡片负责让用户"一键选"。
4
+
5
+ ## 0. 输出形态(最高优先级硬规则,2026-11-04 用户指定)
6
+
7
+ `<browsertool>` 是**宿主解析标签**,不是代码示例。最终回复必须**原样裸输出**,一条都不许包裹:
8
+
9
+ | 必须 | 绝对禁止 |
10
+ |---|---|
11
+ | 标签顶格原样出现:`<browsertool>` … `</browsertool>` | ❌ **包进 ``` 围栏代码块**(最常见的错,宿主当普通文本,卡片完全不渲染) |
12
+ | 标签内紧跟一个完整 JSON 对象 | ❌ 整段用行内反引号包裹 |
13
+ | 与正文自然分段,前后可留空行 | ❌ HTML 转义成 `&lt;browsertool&gt;` |
14
+ | 一轮仅一对标签 | ❌ 只给 JSON 不给标签,或只给文字描述 |
15
+ | | ❌ 把 JSON 写进文件、只丢个路径让用户自己看 |
16
+ | | ❌ 先输出标签,标签内 JSON 再被 ``` 二次包裹 |
17
+
18
+ > **为什么会写错(2026-11-04 实测踩坑)**:本文档 §6 的示例为了让结构可读,把标签放进了 ```text 围栏——那是**结构示意图,不是输出格式**。照抄就会触发本条禁令。实际输出时**不带任何围栏**。
19
+ > 正文里用反引号提及 `<browsertool>`(如本节)只是排版习惯,与输出格式无关、不冲突。
20
+
21
+ **交付前自检一句话**:把这条回复发出去之前,确认 `<browsertool>` 前面三个字符不是 ``` 。是,就删掉围栏重发。
22
+
23
+ ### 0.1 摘要不默认展示,做成横向动作卡之一(2026-11-05 动态化修订)
24
+
25
+ > **卡片有哪些条目、各有几条,不在这里写死** —— 由 [`contract-action-engine.md`](contract-action-engine.md) 按上下文状态计算(1~4 条)。
26
+ > 本节只规定:**摘要必须是「点击后以 artifact 渲染」的那张卡之一**,不铺在页面上、不落盘成文件。
27
+
28
+ 首屏场景(上传合同未说意图)**只输出一张 `<browsertool>`**,`customParams.html` 里**只有横向动作卡**——摘要内容**一个字都不铺在页面上**:
29
+
30
+ 1. **动作卡区(用户可见)**:三张横向卡,「图标 + 标题(+推荐徽标)+ 一行灰色描述」,整卡可点
31
+ 2. **摘要内容(隐藏)**:五节摘要**写成 script 内的 JS 字符串常量 `var S="..."`**(**禁止** `display:none` + `innerHTML`,实测取空串),只作为第三条卡的点击来源
32
+
33
+ | 序 | 卡片 `title` | 点击行为 |
34
+ |---|---|---|
35
+ | ① | 发起「<flowKey>」合同流程(带「推荐」徽标) | `rightPanel.open` 直开流程创建页 |
36
+ | ② | 合同预审 | `session.sendQuestion` 命中审查技能 |
37
+ | ③ | 查看合同摘要 | `rightPanel.open({type:'artifact'})`,`raw:{html:S}`(S 为 script 内常量),并带 `initialArtifactKeys:['summary-1']` |
38
+
39
+ 硬约束:
40
+
41
+ | 项 | 要求 |
42
+ |---|---|
43
+ | 可见区域 | **只有三张横向卡**;摘要默认不显示,用户不点就看不到 |
44
+ | 摘要传递(硬) | **必须把摘要 HTML 写成 script 内的 JS 字符串常量,点击时直接 `raw: { html: S }`**(与官方规范 `raw: { html: '<h2>…</h2>' }` 一致)。**禁止**用 `display:none` 容器 + `box.innerHTML` 动态提取——2026-11-04 实测取到空串,面板打开后一片空白 |
45
+ | 空值防御 | 打开面板前判 `if (!S) { say('摘要内容为空'); return; }`,绝不把空字符串交给 `raw.html` |
46
+ | **`initialArtifactKeys`(硬)** | 打开 `artifact` 时**必须传**,**与 `artifacts` 同级**放在 `contentProps` 里,值取 `artifacts[].id`(本技能摘要固定为 `['summary-1']`)。**漏传不报错,但面板不激活目标文档**,表现为空白或不是想看的那一篇(2026-11-04 实测踩坑)。见 §5.3 动作③ |
47
+ | 文件 | **不生成独立 `.html`,不用 `present_files`** |
48
+ | 条数 | **动态 1~4 条**(按 `contract-action-engine.md` 计算,`MAX_CARDS=4`),`arguments.title` 写 `可做的 N 件事`,**N 必须等于实际条数** |
49
+ | `arguments.width` | **必须带 `1300`**,与 `type` / `title` / `src` 同级放在 `arguments` 里;**禁止**塞进 `customParams` 或 `sdkOptions` |
50
+ | **发起流程的回填** | 点 ① 时,除直开流程页外,还要把 [`contract-field-extract-new-customer.md`](contract-field-extract-new-customer.md) 抽到的字段值写入 `customParams`(与 `fieldAssignKeys` 配对),**一次写全**;**字段 ID 与选项 ID 一律取 [`contract-field-extract-new-customer.md`](contract-field-extract-new-customer.md) §1/§2 的写死映射表**(本环境已实测固定);**禁止**运行时再调 `form.info` 按名称解析。换环境时才回退到按名称解析 |
51
+ | 为什么 | 摘要直接铺开会把动作挤到屏幕下方,用户得先看完才知道能点什么;摘要应是"想细看再点"的次要入口(2026-11-04 用户反馈) |
52
+
53
+ ## 1. 什么时候必须出卡片
54
+
55
+ | 场景 | 出卡片 | 说明 |
56
+ |---|---|---|
57
+ | S3 给 `nextOptions` | ✅ 必须 | §4.2 的四要素全部落在卡片里 |
58
+ | 首屏分流的动作集(`entry=file && intent=null`) | ✅ 必须 | 判为合同:**3 条**(发起流程 / 合同预审 / 查看合同摘要);**判为报价单/标书:1 条「按报价单生成合同」,写明对方主体时可加 1 条「查对方资信」** |
59
+ | §3.2 冲突卡让用户二选一 | ✅ 必须 | 每个候选一张卡,`description` 写清后果 |
60
+ | 模板 / 条款 / 范文推荐 | ✅ 必须 | 每组推荐一卡,最匹配的那条带「推荐」徽标 |
61
+ | 判出类型但要用户确认(60~80 分) | ✅ 必须 | 两类动作各一卡,用点选反推类型 |
62
+ | 纯问答、查单条数据、报错误原因 | ❌ 不出 | 没有"行为"就不要造卡片 |
63
+ | 已有明确单一动作且用户已确认 | ❌ 不出 | 直接把事做完再复述 |
64
+ | 摘要内容与动作卡合进同一面板(§0.1) | ✅ 出,条目 **按引擎计算(1~4 条)** | 摘要不能单列入口,也不能落盘成本地文件 |
65
+ | 本轮需要给用户看的动态页面(如审查页) | ⚠️ 最多一个 | **一轮只输出一个 `<browsertool>`**,不要既开页面又开动作卡片 |
66
+
67
+ > 判据只有一句:**本轮是否存在"用户接下来要点的事"**。没有就不出。
68
+
69
+ **两条硬约束(优先级高于任何"多给选项"的偏好)**:
70
+
71
+ 1. **一轮只输出一个 `<browsertool>`。** 上传返回的 ai-contract `url` 不得与动作卡片同时出现——它只在用户明确说「打开审查页」时单独使用。
72
+ 2. **摘要合进同一张卡,不单列入口。** 摘要内容与动作卡在同一面板(见 §0.1),卡片内**不再有「打开合同摘要详情」**,条数 **按引擎动态计算(1~4 条)**,`arguments.title` 写 `可做的 N 件事`。
73
+
74
+ ## 2. 外层结构
75
+
76
+ 行为卡片**一律用形态 B(`xiaoeCustomPage`)**,见 §5.1。形态 A(`XiaoeList`)仅用于确认不需要任何点击的纯展示场景,见 §5.4。
77
+
78
+ `app` / `compName` / `routerType` / `toolId` 是**固定值**,不要改;`src`、`callId`、`title`、`html` 每次都要变。
79
+
80
+ ## 3. `arguments.title`:每轮动态
81
+
82
+ - **必须跟着本次输出变**,禁止写死一个常量标题。
83
+ - 建议格式:`<对象> · <这轮能给什么>`,控制在 20 字内。
84
+ - 它会被当作右侧 HTML 的文件名(`标题.html`),所以不要带 `/ \ : * ? " < > |`。
85
+
86
+ 合规示例:
87
+
88
+ ```
89
+ 长芯盛e-cology购买合同 · 可做的 4 件事
90
+ 新客户流程待确认 · 请二选一
91
+ 老客户增值 · 推荐 3 个条款
92
+ 报价单已解析 · 可生成合同
93
+ ```
94
+
95
+ ## 4. 每张卡承载什么(四要素,一个都不能少)
96
+
97
+ 单张卡只保留三个可见元素,但**四要素必须齐全且不重复**:
98
+
99
+ | `nextOptions` 要素 | 落到哪里 |
100
+ |---|---|
101
+ | ① 动作名 | 卡片标题(动词开头,≤12 字) |
102
+ | ② 一句收益 + ③ 证据状态 + ④ 代价 | 卡片下方那行灰色描述,用全角竖线 `|` 分隔 |
103
+ | 展开说明(做什么/需要什么/会发生什么/失败怎么办) | **不放进卡片正文**;必要时点开后再展示(动作③ artifact) |
104
+
105
+ - **条数一致**:卡片数 = 本轮列出的动作数;动作 >4 时只列前 4,其余写进"未完成"并说明原因。
106
+ - **结构性关闭的动作不进卡片**(无 `fileId` 时的 E2/E4/E5、`flowKey=null` 时的 E1)——给一个必然失败的点按区等于骗人。
107
+ - **缺证据的动作要进卡片**,但描述里必须写明「缺 X」,让用户知道补什么。
108
+
109
+ ## 5. 卡片形态与点击动作
110
+
111
+ > **2026-11-04 修正**:`XiaoeList` 的 `detailHtml` 是**纯静态 HTML**,`script` / `onclick` / `style` 会被静默剥掉,用户点了毫无反应。卡片必须可点击 → **默认改用 `xiaoeCustomPage`**。
112
+
113
+ | 形态 | 组件 | 能否点击 | 用在哪 |
114
+ |---|---|---|---|
115
+ | **A. 列表型** | `XiaoeList` + `customParams.items[]` | ❌ 不能 | 仅纯展示、无需任何操作 |
116
+ | **B. 自定义页面型** | `xiaoeCustomPage` + `customParams.html` | ✅ 能(原样渲染并执行 `script`) | **默认用这个:所有行为卡片** |
117
+
118
+ ### 5.1 形态 B 外层结构(组件名 `xiaoeCustomPage`,注意小写 x)
119
+
120
+ ```json
121
+ {
122
+ "version": 1,
123
+ "callId": "<场景>-<YYYYMMDDHHmm>-<序号>",
124
+ "toolId": "fill_form",
125
+ "arguments": {
126
+ "type": "e10",
127
+ "title": "<本次输出的动态标题>",
128
+ "src": "<baseUrl>/sp/contract/xiaoe-custom-page",
129
+ "width": 1300,
130
+ "sdkRenderType": "inline",
131
+ "sdkOptions": {
132
+ "compName": "ui.CorsComponent",
133
+ "routerType": "MemoryRouter",
134
+ "routerProps_pc": { "initialEntries": ["/sp/contract/xiaoe-custom-page"] },
135
+ "params_pc": {
136
+ "app": "@weapp/contract",
137
+ "compName": "xiaoeCustomPage",
138
+ "customParams": {
139
+ "html": "<整页 HTML + script>"
140
+ }
141
+ }
142
+ }
143
+ }
144
+ }
145
+ ```
146
+
147
+ `customParams.html` 传**原始字符串**,不 URL 编码。JSON 里双引号转义 `\"`;HTML 内的换行允许用 `\n`(因为是 JSON 字符串值)。
148
+
149
+ ### 5.2 走法判定(**规则边界**,按序命中即停)
150
+
151
+ > 本节是走法的**唯一判定依据**。四条规则**自上而下判,命中即停**,禁止跳跃、禁止凭动作名称猜。
152
+ > 历史修正:2026-11-04 把「发起审批」写成 `sendQuestion`(有页面却绕会话);2026-11-06 把「生成比对报告」写成 `sendQuestion`(成品已在手却绕会话)。两次都是**判据用错**。
153
+
154
+ | 序 | 判据(**客观事实**) | 走法 |
155
+ |---|---|---|
156
+ | **R1** | 目标**系统页面/组件已存在**:有 `src` + `compName` + `app` | `e10Sdk` 直开 |
157
+ | **R2** | **要展示的内容已在手**:本次输出中已存在该内容的完整字符串(报告 HTML、摘要 HTML、对照表 HTML…) | **`artifact` 直传 `raw.html`** |
158
+ | **R3** | 内容**尚未产出**,必须模型现场加工(取数、推理、生成合同、抽条款、插条款) | `sendQuestion` |
159
+ | **R4** | 纯展示、无任何交互诉求 | `artifact` |
160
+
161
+ #### 关键判据:**看「内容是否已在手」,不看「动作名称」**
162
+
163
+ **唯一自检问句**(出卡片前必答):
164
+
165
+ > 「我现在要展示的东西,**能不能直接赋值成一个字符串**?」
166
+
167
+ - **能** → 命中 **R2**,一律 `artifact` 直传,**禁止** `sendQuestion`
168
+ - **不能,得先让模型算** → 命中 **R3**,才用 `sendQuestion`
169
+
170
+ #### 🔴 反面案例(2026-11-06 实际踩坑,必须记住)
171
+
172
+ **动作名**:「生成比对报告」
173
+
174
+ **错误判定**:名称里有"生成"二字 → 误以为属 R3「需要 AI 继续加工」→ 走了 `sendQuestion`,绕回会话让 AI 又生成一遍。
175
+
176
+ **正确判定**:报告 HTML 在本轮**已经生成完毕、就是个字符串**,只剩"展示"这一步 → 命中 **R2** → `artifact` 直传。
177
+
178
+ **结论**:`生成` / `分析` / `整理` / `汇总` 这类**动名词不是判据**。判断依据永远是 **"内容此刻在不在手"**,而非"动作听起来像不像要算"。
179
+
180
+ > 判据错一次,后果是让模型白跑一轮,且用户看到的是"点了没反应/答非所问"。
181
+
182
+ #### 各走法适用与禁用
183
+
184
+ | 走法 | 适用(命中条件) | **禁止用于** |
185
+ |---|---|---|
186
+ | `e10Sdk` | R1:系统页面/组件已存在 | 无对应页面时凭空编 `src`/`compName` |
187
+ | `artifact` | R2 / R4:内容已成字符串 | 内容尚未产出时强行使用 |
188
+ | `sendQuestion` | **仅** R3:必须模型现场加工 | **成品字符串已在手(R2)时——禁止绕回会话** |
189
+ | `type:'url'` | ❌ **一律禁用** | 全部场景(含打开系统页面:改走 R1 的 `e10Sdk`) |
190
+
191
+ #### 回归用例(照此核对,防止再错)
192
+
193
+ | 动作 | 应有判定 | 命中规则 | 走法 |
194
+ |---|---|---|---|
195
+ | 生成比对报告 | 报告 HTML 已在手 | R2 | `artifact` 直传 |
196
+ | 查看合同摘要 | 摘要 HTML 已在手(script 常量 `S`) | R2 | `artifact` 直传 |
197
+ | 查看比对详情 | 组件 `AIDocCompare` 已存在 | R1 | `e10Sdk` 直开 |
198
+ | 查对方资信 | 组件 `ContractCreditDetail` 已存在 | R1 | `e10Sdk` 直开 |
199
+ | 发起合同审批 | 流程创建页已存在 | R1 | `e10Sdk` 直开 |
200
+ | 按报价单生成合同 | docx 尚未产出 | R3 | `sendQuestion`(或按既有链生成) |
201
+
202
+ > **凡命中 R1/R2 的,写成 `sendQuestion` 即为错误实现**,属回归必查项。
203
+
204
+ **已知页面清单(可直接用,不要重新试探)**
205
+
206
+ | 页面 | `app` | `compName` | `src` 路径 | 来源 |
207
+ |---|---|---|---|---|
208
+ | **合同流程创建页** | `@weapp/workflow` | `Comp.WffpRoute` | `/sp/workflow/flowpage/create/{workflowId}?workflowId={workflowId}&isCreate=1` | 2026-11-04 用户修正:是 `Comp.WffpRoute`,**不是** `Comp.MWffpRoute` |
209
+ | 合同列表 | `@weapp/contract` | `XiaoeList` | `/sp/contract/xiaoe-list` | 既有 |
210
+ | 自定义页面 | `@weapp/contract` | `xiaoeCustomPage` | `/sp/contract/xiaoe-custom-page` | 既有 |
211
+ | 合同审查页 | `@weapp/contract` | 待补 | `/sp/contract/business/ai-contract` | **缺 compName** |
212
+ | 企业资信页 | `@weapp/contract` | 待补 | `/sp/contract/business/credit` | **缺 compName** |
213
+ | 文档比对页 | `@weapp/contract` | 待补 | `/sp/contract/business/doc-compare` | **缺 compName** |
214
+
215
+ > 「待补」的页面**不许瞎填 compName**(会白屏),但也不许永久退化成会话指令——应先向用户索取组件名,或在面板里点一次抓真实值后回填本表。
216
+
217
+ #### 发起合同审批:标准直开写法(已实测)
218
+
219
+ 先用 CLI 拿到带文件的完整地址,**不要手拼**:
220
+
221
+ Windows PowerShell:
222
+
223
+ ```powershell
224
+ # 只拿流程页(不带文件)
225
+ weaver-work-cli --json contract flow page --flow 新客户
226
+
227
+ # 上传合同并生成「自动回填」地址(推荐)
228
+ weaver-work-cli --json contract flow launch --flow 新客户 --path "<合同.docx 绝对路径>"
229
+ ```
230
+
231
+ macOS/Linux(bash/zsh):
232
+
233
+ ```bash
234
+ # 只拿流程页(不带文件)
235
+ weaver-work-cli --json contract flow page --flow 新客户
236
+
237
+ # 上传合同并生成「自动回填」地址(推荐)
238
+ weaver-work-cli --json contract flow launch --flow 新客户 --path "<合同.docx 绝对路径>"
239
+ ```
240
+
241
+ `flow launch` 返回形如:
242
+
243
+ ```
244
+ https://<baseUrl>/sp/workflow/flowpage/create/1269716062340284522
245
+ ?workflowId=1269716062340284522&isCreate=1
246
+ &fileId=1333865857015693314&automaticFormFilling=true
247
+ ```
248
+
249
+ > ⚠️ **fileId 必须来自 `flow launch`,禁止用 `review upload` 的**(2026-11-04 实测踩坑)
250
+ >
251
+ > 两个上传是**不同 module**,fileId 互不通用:
252
+ >
253
+ > | 来源 | module | 用途 |
254
+ > |---|---|---|
255
+ > | `contract review upload` | `ebContract` | 供 AI 合同审查 / 摘要,**不能**喂给流程文件字段 |
256
+ > | `contract flow launch` | `workflow` + `fieldId`(新客户为 `1269716066559755048`) | 供流程「合同正文及附件」字段 |
257
+ >
258
+ > 把 `ebContract` 的 fileId 拼进 `/flowpage/create/...?fileId=` 会导致 **`E10 SDK init 失败(error 回调)`**——URL 结构看起来完全正确,只是文件 ID 指向了流程上下文里不存在的对象,极难从报错文字看出来。
259
+ >
260
+ > **结论:`src` 一律原样使用 `flow launch` 返回的 `url`,不要自己拿 review 的 fileId 去替换。** 卡片文案里若已展示合同,仍要重新跑一次 `flow launch` 取流程专用 fileId。
261
+
262
+ 把该 `url` 原样放进 `src`,卡片点击时直开:
263
+
264
+ ```js
265
+ plugin.rightPanel.open({
266
+ type: 'e10Sdk',
267
+ width: 1300,
268
+ contentProps: {
269
+ src: '<flow launch 返回的 url 原样>',
270
+ sdkOptions: {
271
+ compName: 'ui.CorsComponent',
272
+ routerType: 'MemoryRouter',
273
+ routerProps: { initialEntries: ['/flowpage/create/<workflowId>'] },
274
+ params: {
275
+ app: '@weapp/workflow',
276
+ compName: 'Comp.WffpRoute'
277
+ }
278
+ }
279
+ }
280
+ });
281
+ ```
282
+
283
+ 四个流程的 `workflowId`(见 `contract-flow-launch.md`,**禁止硬编码猜**):
284
+
285
+ | `flow` | workflowId |
286
+ |---|---|
287
+ | `契约锁` | `100003460000002066` |
288
+ | `新客户` | `1269716062340284522` |
289
+ | `老客户增值` | `1283761429944369334` |
290
+ | `常规二次销售` | `1283761687634100307` |
291
+
292
+ > 字段预填(`customParams` 里的各字段 ID 与 `fieldAssignKeys`)**只在字段 ID 已验证属于该流程表单时才写**;未验证时不要带 `customParams`,否则页面打不开。
293
+
294
+ ### 5.3 三种点击动作的具体写法
295
+
296
+ #### 动作①:发会话消息,命中技能继续走下游
297
+
298
+ 用于「按报价单生成合同」「抽出条款」这类**需要 AI 接着干活**的动作。
299
+
300
+ ```js
301
+ window.xiaoePlugin.session.sendQuestion({
302
+ question: '按这份报价单生成合同',
303
+ files: [] // 需要带附件时传 File 或已上传的应用附件;纯文本指令传空数组
304
+ });
305
+ ```
306
+
307
+ - `question` 要写成**能命中对应技能的完整指令**(用户口吻),不要写"生成""确认"这种单词。
308
+ - `files` 支持原始 `File`、已上传解析完成的应用附件,两者可混用。
309
+ - **不要**用它做「只是打开一个页面」的动作,那种走动作②。
310
+
311
+ #### 动作②:打开 E10 业务组件(资信页、流程页等)
312
+
313
+ 用于「查对方资信」「发起合同流程」这类**打开系统既有页面**的动作。
314
+
315
+ ```js
316
+ plugin.rightPanel.open({
317
+ type: 'e10Sdk',
318
+ width: 700, // 资信页 700(2026-11-06 用户指定);合同流程页用 1300
319
+ contentProps: {
320
+ src: 'https://www.e-cology.com.cn/sp/contract/business/credit',
321
+ sdkOptions: {
322
+ compName: 'ui.CorsComponent',
323
+ routerType: 'MemoryRouter',
324
+ routerProps: { initialEntries: ['/sp/contract/business/credit'] },
325
+ params: {
326
+ app: '@weapp/contract',
327
+ compName: '<目标页组件名>'
328
+ }
329
+ }
330
+ }
331
+ });
332
+ ```
333
+
334
+ 发起合同流程(带表单预填):
335
+
336
+ ```js
337
+ plugin.rightPanel.open({
338
+ type: 'e10Sdk',
339
+ contentProps: {
340
+ src: 'https://www.e-cology.com.cn/sp/workflow/flowpage/create/<workflowId>?workflowId=<workflowId>&isCreate=1',
341
+ sdkOptions: {
342
+ compName: 'ui.CorsComponent',
343
+ routerType: 'MemoryRouter',
344
+ routerProps: { initialEntries: ['/flowpage/create/<workflowId>'] },
345
+ params: {
346
+ app: '@weapp/workflow',
347
+ compName: 'Comp.WffpRoute',
348
+ customParams: {
349
+ "<字段ID>": "<字段值>",
350
+ "fieldAssignKeys": "<字段ID逗号拼接>"
351
+ }
352
+ }
353
+ }
354
+ }
355
+ });
356
+ ```
357
+
358
+ > ⚠️ **`rightPanel.open` 的 e10Sdk 用 `routerProps` / `params`**,不是 browsertool 的 `routerProps_pc` / `params_pc`。混用会白屏。
359
+
360
+ #### 动作③:展示内容(HTML / Markdown / 图片 / PDF / 外链)
361
+
362
+ ```js
363
+ plugin.rightPanel.open({
364
+ type: 'artifact',
365
+ width: 640,
366
+ panelKey: 'contract-detail-<唯一键>', // 可选:面板业务标识,多标签时同 key 只激活
367
+ title: '合同详情.html', // 可选:标签标题
368
+ displayMode: 'side', // 可选:'side' | 'tabs' | 'modal',不传用默认值
369
+ contentProps: {
370
+ artifacts: [{
371
+ id: 'detail-1', // 面板内 key,也是 initialArtifactKeys 的取值
372
+ name: 'detail.html',
373
+ fileType: 'html',
374
+ raw: { html: '<h2>合同详情</h2><p>……</p>' }
375
+ }],
376
+ initialArtifactKeys: ['detail-1'] // ★ 与 artifacts 同级;值取 artifacts[].id
377
+ }
378
+ });
379
+ ```
380
+
381
+ **⚠️ `initialArtifactKeys` 必须传**(2026-11-04 实测踩坑):它**与 `artifacts` 同级**,都在 `contentProps` 里,
382
+ 值是数组,元素取 `artifacts[].id`。**漏传时不会报错,但面板不激活目标文档**(只按默认行为处理),
383
+ 表现为「打开了面板、却是空白或不是想要的那篇」。**要看哪一篇,就把它对应的 `id` 写进来。**
384
+
385
+ | 参数 | 位置 | 说明 |
386
+ |---|---|---|
387
+ | `artifacts` | `contentProps` 内 | 文档数组,每项一篇 |
388
+ | **`initialArtifactKeys`** | **`contentProps` 内,与 `artifacts` 同级** | **必传**;值为数组,元素是 `artifacts[].id`。**不是放 `artifacts` 里面** |
389
+ | `artifacts[].id` | 每项内 | 面板内唯一 key,充当 `initialArtifactKeys` 的取值 |
390
+ | `panelKey` / `title` / `displayMode` | 顶层,与 `type` 同级 | 均可选 |
391
+ | `width` | 顶层,与 `type` 同级 | 与 `e10Sdk` 同样写在顶层 |
392
+
393
+ **内容取值方式**(三项内 `artifacts[]` 里任选其一):
394
+
395
+ | 取值字段 | 适用 |
396
+ |---|---|
397
+ | `raw.html` | HTML 字符串(本技能摘要用这个) |
398
+ | `raw.content` | Markdown 文本 |
399
+ | `file_path` | 文件直链(如 `https://…/report.pdf`) |
400
+ | `url` | 外链 / 图片 / PDF 直链 |
401
+
402
+ `fileType` 取 `html` / `markdown` / `image/png` / `application/pdf` / `url`,与取值字段对应。
403
+
404
+ ### 5.3 卡片视觉与 HTML 骨架(**对齐小 e 原生卡片,整卡可点击**)
405
+
406
+ > **2026-11-04 第三次修正(用户提供截图定稿)**:卡片视觉为「**左侧浅蓝圆角图标块 + 右侧标题(可带『推荐』徽标)+ 一行灰色描述**」。
407
+ > **不要序号**(`①②`、`1.` `2.` 一律不要)、**不要「会做什么 / 会写数据」这类标签表格**、**不要外挂按钮**;点击绑在**整张卡**上。
408
+
409
+ **元素规格(照此实现,不要自行发挥)**
410
+
411
+ | 元素 | 规格 |
412
+ |---|---|
413
+ | 外层容器 | `padding:4px 2px`,无背景、无边框、**不加卡片大标题** |
414
+ | 卡片 | 白底、`border:1px solid #e8ebf2`、`border-radius:12px`、`padding:16px`、`margin-bottom:12px`、`display:flex;align-items:center;gap:12px`、`cursor:pointer` |
415
+ | 图标块 | `44×44`、`border-radius:10px`、底色 `#eef1fb`、居中放 22px 线性图标,描边 `#7b8cf0` |
416
+ | 标题 | `15px`、`font-weight:700`、`#1f2430`;与徽标同一行、`gap:8px` |
417
+ | 推荐徽标 | **仅推荐项有**:`11px`、字色 `#3b6fe0`、底色 `#eaf0fe`、`border-radius:10px`、`padding:2px 8px`、文案「推荐」 |
418
+ | 描述 | 单行 `13px`、`#7a8497`、`line-height:1.5`,分段用**全角竖线 `|`**,不要换行堆叠 |
419
+ | 悬停 | 边框 `#1d6fd8` + `box-shadow:0 2px 8px rgba(29,111,216,.12)` |
420
+ | 状态提示 | 底部一行 `12px`、`#b45309` 小字,**不弹窗、不 toast** |
421
+
422
+ ```html
423
+ <section style="padding:4px 2px;font-family:'Microsoft YaHei','PingFang SC',sans-serif">
424
+ <div data-act="gen" role="button" tabindex="0"
425
+ style="display:flex;align-items:center;gap:12px;background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;margin-bottom:12px;cursor:pointer">
426
+ <span style="flex:0 0 auto;width:44px;height:44px;border-radius:10px;background:#eef1fb;display:flex;align-items:center;justify-content:center">
427
+ <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#7b8cf0" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z"/><path d="M14 3v5h5"/><path d="M9 13h6"/><path d="M9 17h4"/></svg>
428
+ </span>
429
+ <span style="min-width:0">
430
+ <span style="display:flex;align-items:center;gap:8px;margin-bottom:6px">
431
+ <span style="font-size:15px;font-weight:700;color:#1f2430">按报价单生成合同</span>
432
+ <span style="font-size:11px;color:#3b6fe0;background:#eaf0fe;border-radius:10px;padding:2px 8px;line-height:1.4">推荐</span>
433
+ </span>
434
+ <span style="display:block;font-size:13px;color:#7a8497;line-height:1.5">把标的与金额填成合同 docx | 自动推荐模板 | 可补条款</span>
435
+ </span>
436
+ </div>
437
+
438
+ <div data-act="credit" role="button" tabindex="0"
439
+ style="display:flex;align-items:center;gap:12px;background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;cursor:pointer">
440
+ <span style="flex:0 0 auto;width:44px;height:44px;border-radius:10px;background:#eef1fb;display:flex;align-items:center;justify-content:center">
441
+ <svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="#7b8cf0" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="7"/><path d="M16.5 16.5 21 21"/></svg>
442
+ </span>
443
+ <span style="min-width:0">
444
+ <span style="display:block;font-size:15px;font-weight:700;color:#1f2430;margin-bottom:6px">查对方资信</span>
445
+ <span style="display:block;font-size:13px;color:#7a8497;line-height:1.5">打开资信页看诉讼/被执行/工商变更 | 只读,仅开页面</span>
446
+ </span>
447
+ </div>
448
+
449
+ <p data-status style="margin:8px 0 0;color:#b45309;font-size:12px"></p>
450
+ </section>
451
+ <script>
452
+ (function () {
453
+ var root = document.currentScript.closest('.contract-xiaoe-custom-page-content');
454
+ if (!root) return;
455
+ var status = root.querySelector('[data-status]');
456
+ var plugin = window.xiaoePlugin || (window.rawWindow && window.rawWindow.xiaoePlugin);
457
+
458
+ function say(m) { if (status) status.textContent = m; }
459
+
460
+ function send(q) {
461
+ if (!plugin || !plugin.session || typeof plugin.session.sendQuestion !== 'function') { say('当前环境不支持发送会话消息'); return; }
462
+ try { plugin.session.sendQuestion({ question: q, files: [] }); }
463
+ catch (e) { say('发送失败,请重试'); }
464
+ }
465
+
466
+ function openE10(src, entries, app, comp) {
467
+ if (!plugin || !plugin.rightPanel || typeof plugin.rightPanel.open !== 'function') { say('当前环境没有小 e 右侧面板'); return; }
468
+ try {
469
+ plugin.rightPanel.open({
470
+ type: 'e10Sdk',
471
+ contentProps: {
472
+ src: src,
473
+ sdkOptions: {
474
+ compName: 'ui.CorsComponent',
475
+ routerType: 'MemoryRouter',
476
+ routerProps: { initialEntries: entries },
477
+ params: { app: app, compName: comp }
478
+ }
479
+ }
480
+ });
481
+ } catch (e) { say('面板打开失败,请确认右侧面板已挂载'); }
482
+ }
483
+
484
+ var handlers = {
485
+ gen: function () { send('按这份报价单生成合同'); },
486
+ credit: function () { say('正在打开资信页…'); /* openE10(...) 见 §5.2 动作② */ }
487
+ };
488
+
489
+ Array.prototype.forEach.call(root.querySelectorAll('[data-act]'), function (el) {
490
+ var fn = handlers[el.getAttribute('data-act')];
491
+ if (!fn) return;
492
+
493
+ var onClick = function () { fn(); };
494
+ var onEnter = function () { el.style.borderColor = '#1d6fd8'; el.style.boxShadow = '0 2px 8px rgba(29,111,216,.12)'; };
495
+ var onLeave = function () { el.style.borderColor = '#e8ebf2'; el.style.boxShadow = 'none'; };
496
+ var onKey = function (e) { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); fn(); } };
497
+
498
+ el.addEventListener('click', onClick);
499
+ el.addEventListener('mouseenter', onEnter);
500
+ el.addEventListener('mouseleave', onLeave);
501
+ el.addEventListener('keydown', onKey);
502
+
503
+ root.addEventListener('xiaoe-custom-page-dispose', function () {
504
+ el.removeEventListener('click', onClick);
505
+ el.removeEventListener('mouseenter', onEnter);
506
+ el.removeEventListener('mouseleave', onLeave);
507
+ el.removeEventListener('keydown', onKey);
508
+ }, { once: true });
509
+ });
510
+ })();
511
+ </script>
512
+ ```
513
+
514
+ **图标可换**:文档类用上面的「文件+折线」;查询类用「放大镜」;发起流程用「纸飞机」;比对用「双向箭头」。**统一 22px、`stroke:#7b8cf0`、`fill:none`、`stroke-width:1.6`**。
515
+
516
+ **要点**:
517
+
518
+ | 项 | 要求 |
519
+ |---|---|
520
+ | 视觉 | 左图标块 + 右「标题(+推荐徽标)/ 一行描述」;**无序号、无标签表格** |
521
+ | 点击区 | **整张卡片**可点(`cursor:pointer` + hover 描边高亮),**不放独立按钮** |
522
+ | 可访问性 | `role="button"` `tabindex="0"`,支持回车/空格触发 |
523
+ | 卡片间距 | 卡片间 `margin-bottom:12px`;外层只留 `padding:4px 2px` |
524
+ | 状态反馈 | 只在 `[data-status]` 写一句浅色小字 |
525
+ | 取容器(硬) | **每卡唯一 `id` + `document.getElementById(该 id)` 精确定位**;**禁止**用共享容器 `.contract-xiaoe-custom-page-content` 直接取卡片元素(会绑到别的卡)。兜底仅次要(2026-11-06 用户定论) |
526
+ | 样式写法(硬) | **必须**内联 `style`;**禁止** `<style>` 块与 `.c`/`.i`/`.b` 这类极短全局类名——污染宿主页面且与既有类名冲突,观感走样 |
527
+ | plugin 判空(硬) | 调 `rightPanel.open` / `session.sendQuestion` 前**必须**判 `plugin` 及其方法存在(ES5 写法 `!plugin || !plugin.x || typeof plugin.x.y !== 'function'`);缺失时写 `[data-status]` 提示,**禁止**直接调用 |
528
+
529
+ ### 5.3.1 JS 语法兼容性:**必须只用 ES5**(2026-11-04 用户实测反馈)
530
+
531
+ > **血案**:卡片 HTML 里写了 `window.xiaoePlugin ?? window.rawWindow?.xiaoePlugin`,宿主报「不支持这种写法」。
532
+ > 后果是 **整个 `<script>` 解析失败(SyntaxError),一段都不执行**——点击毫无反应,且不报业务错误,极难定位。
533
+ > 用户此前反馈「点了什么反应也没有」,根因就在这里,不是事件没绑。
534
+
535
+ **禁止清单(全部不可用)**
536
+
537
+ | 语法 | 引入版本 | 为什么禁 |
538
+ |---|---|---|
539
+ | `??` 空值合并 | ES2020 | 宿主不认,整个 script 挂掉 |
540
+ | `?.` 可选链 | ES2020 | 同上 |
541
+ | `=>` 箭头函数 | ES2015 | 同上 |
542
+ | `const` / `let` | ES2015 | 同上 |
543
+ | `` `模板字符串` `` | ES2015 | 同上 |
544
+ | `class` / 展开 `...` / `async` / `await` | ES2015+ | 同上 |
545
+
546
+ **替代写法对照**
547
+
548
+ | 想写 | 改成 |
549
+ |---|---|
550
+ | `a ?? b` | `a !== null && a !== undefined ? a : b` 或直接 `a \|\| b`(falsy 可接受时) |
551
+ | `obj?.prop` | `obj && obj.prop` |
552
+ | `obj?.fn()` | `obj && typeof obj.fn === 'function' && obj.fn()` |
553
+ | `var f = () => {}` | `function f() {}` |
554
+ | `const x = 1` | `var x = 1` |
555
+ | `` `hi ${n}` `` | `'hi ' + n` |
556
+ | `arr.forEach(fn)` | `for (var i = 0; i < arr.length; i++) { fn(arr[i]); }` |
557
+
558
+ **推荐的插件获取写法(每次点击时求值,且完全 ES5)**
559
+
560
+ ```js
561
+ function getPlugin() {
562
+ if (window.xiaoePlugin) {
563
+ return window.xiaoePlugin;
564
+ }
565
+ if (window.rawWindow && window.rawWindow.xiaoePlugin) {
566
+ return window.rawWindow.xiaoePlugin;
567
+ }
568
+ return null;
569
+ }
570
+
571
+ function send(q) {
572
+ var plugin = getPlugin();
573
+ if (!plugin || !plugin.session || typeof plugin.session.sendQuestion !== 'function') {
574
+ say('当前环境不支持发送会话消息');
575
+ return;
576
+ }
577
+ try {
578
+ plugin.session.sendQuestion({ question: q, files: [] });
579
+ } catch (err) {
580
+ say('发送失败,请重试');
581
+ }
582
+ }
583
+ ```
584
+
585
+ **卡片容器定位:每卡唯一 ID + `getElementById`(硬要求,2026-11-06 用户定论)**
586
+
587
+ > 🔴 **事故根因(用户定论)**:此前把**共享容器** `.contract-xiaoe-custom-page-content` 当根节点,
588
+ > 再用 `querySelector('[data-act=...]')` 在里面找卡片。该容器**可能同时容纳多张卡片**
589
+ > (同页多张、多轮输出的卡片叠加),而 `querySelector` 只返回**文档顺序里第一个**匹配元素。
590
+ > 后果:监听器绑到**另一张卡片**(或已失效的旧节点)上,**用户点的那张卡始终没有监听器** ——
591
+ > 表现为「点不动」,且不报错。此前多轮排查都栽在这里。
592
+
593
+ **正确做法**:
594
+
595
+ | 步骤 | 要求 |
596
+ |---|---|
597
+ | 1 | 每张卡片的 `<section>` **必须带全局唯一 `id`**,建议 `场景-日期-时间-随机后缀`(如 `cmp-detail-20261106-1633-x9k2`) |
598
+ | 2 | 脚本**第一件事**用 `document.getElementById('<该 id>')` 精确定位自己的根节点 |
599
+ | 3 | 卡片内所有查询基于该 `root` 缩小范围:`root.querySelector('[data-act=detail]')` |
600
+ | 4 | 点击载体用 `<button type='button'>`(比 `div` 稳),需带 `width:100%;box-sizing:border-box;text-align:left;font-family:inherit` 保持卡片外观 |
601
+ | 5 | 销毁监听挂在真实容器上:`root.closest('.contract-xiaoe-custom-page-content')` |
602
+
603
+ **禁止**:
604
+
605
+ - **禁止**用 `.contract-xiaoe-custom-page-content` 等**共享容器**直接 `querySelector` 取卡片元素(会取到别的卡)
606
+ - **禁止**同一张卡片出现两个相同 `id`
607
+ - **禁止跨轮次复用同一个 `id`**(多张卡片之间撞车)——历史卡片仍留在页面上时,`getElementById` 会命中**先前那张旧卡**,新卡片的监听器等于绑到了旧卡上
608
+ (2026-11-06 实测:**同一份内容**「用户输出可点、我输出点不动」,唯一差别就是 `id` 撞车;换新 `id` 后立即正常。这是「点不动」的**最后一层**根因)
609
+ - **禁止** html 内出现双引号(见 §5.3.2),`id` 与属性值一律单引号
610
+
611
+ **兜底仅作次要防线**:唯一 ID 取不到时,再依次降级为父级上溯 → `querySelector` → `document.body`;
612
+ 但**不得**用兜底替代唯一 ID —— 兜底恰恰会退回「取到别的卡」的老问题。
613
+
614
+ ```js
615
+ // 首选:唯一 ID 精确定位(每卡一个 id)
616
+ var root = document.getElementById('cmp-detail-20261106-1633-x9k2');
617
+ if (!root) { return; }
618
+ ```
619
+
620
+ **交付前必查**:① `section` 是否带唯一 `id`(且**不与历史卡片重复**);② 脚本是否用 `getElementById` 定位;③ 有无对共享容器的 `querySelector('[data-act=...]')`;④ html 内双引号是否为 0。
621
+
622
+ **为什么必须唯一 ID —— 共享容器 `querySelector` 只取第一个匹配(2026-11-06 用户定论)**
623
+
624
+ 聊天页面会**保留多轮历史卡片**。若用共享容器作根节点:
625
+
626
+ ```js
627
+ // ❌ 错误:root 可能是历史卡片那一份
628
+ var root = document.querySelector('.contract-xiaoe-custom-page-content');
629
+ // 后续两项操作会全部作用在错误位置:
630
+ root.querySelector('[data-status]'); // 状态写到了别的卡片
631
+ root.querySelector('[data-act="detail"]'); // 点击事件也绑到了别的卡片
632
+ ```
633
+
634
+ `querySelector` **只返回文档顺序里第一个匹配元素**。一旦 `document.currentScript` 无法定位当前容器,
635
+ 就会退回到**历史卡片**上,于是:用户点的那张卡没有监听器(点不动),状态提示也显示在别的卡上。
636
+
637
+ **正反写法对照**:
638
+
639
+ | 环节 | ❌ 错误写法 | ✅ 正确写法 |
640
+ |---|---|---|
641
+ | 取根节点 | `document.querySelector('.contract-xiaoe-custom-page-content')` | `document.getElementById('<本卡唯一 id>')` |
642
+ | 取状态位 | `root.querySelector('[data-status]')`(root 为共享容器时) | `root.querySelector('[data-status]')`(root 为**唯一 id 元素**时) |
643
+ | 取卡片 | `root.querySelector('[data-act="detail"]')`(同上) | `root.querySelector('[data-act=detail]')` |
644
+
645
+ > **根节点取得对,后两项才可能对**。所以第一步必须是唯一 ID,而不是"先用容器顶上、取不到再兜底"。
646
+
647
+ **`getElementById` 的同类边界**:同一 `id` 在页面出现多份时,它**同样只返回第一个**。
648
+ 因此每张卡的 `id` 必须**真正全局唯一且不复用历史值**——建议格式 `场景-YYYYMMDD-HHmm-4位随机`,
649
+ **禁止**多轮输出沿用同一个 id,否则会命中历史卡片里那份旧节点。
650
+
651
+
652
+
653
+ **交付前必查**:写完 HTML 后统计 `??`、`?.`、`=>`、`const`、`let`、反引号,**必须全部为 0** 再交付。
654
+
655
+ ### 5.3.2 html 内禁止双引号(硬要求,2026-11-06 用户实测)
656
+
657
+ > 🔴 **现象**:控制台报 `Uncaught SyntaxError: Failed to execute 'replaceWith' on 'Element': Unexpected token ')'`,
658
+ > **整段脚本不执行**,卡片点击无反应。
659
+
660
+ **根因**:`customParams.html` 会被宿主作为字符串嵌入渲染流程。html 内一旦出现双引号,
661
+ 字符串在**第一个双引号处提前结束**,后续内容变成裸代码,解析器随即撞上孤立的 `')'` 而报错
662
+ (`replaceWith` 正是「把旧节点替换为新内容」这一步)。
663
+
664
+ **硬要求**:
665
+
666
+ | 项 | 要求 |
667
+ |---|---|
668
+ | `html` 值内的引号 | **一律单引号 `'`**,全内文双引号数量为 **0** |
669
+ | 选择器 | 用 `querySelector('[data-act=detail]')`(属性值**不加引号**),或 `querySelectorAll('[data-act]')` + `getAttribute('data-act')` |
670
+ | 禁止 | `querySelector('[data-act="detail"]')` 这类**内层双引号**写法 |
671
+ | 附带收益 | 零双引号后,html 放进 JSON **无需任何转义**,从根上消除这类故障 |
672
+
673
+ **交付前必查**:统计 html 值里的双引号数量,**必须为 0**。
674
+
675
+ Windows PowerShell:
676
+
677
+ ```powershell
678
+ # $h 为待交付的 html 字符串
679
+ ([regex]::Matches($h, [char]34)).Count # 期望 0
680
+ ```
681
+
682
+ macOS/Linux(bash/zsh):
683
+
684
+ ```bash
685
+ # $h 为待交付的 html 字符串
686
+ printf '%s' "$h" | tr -cd '"' | wc -c # 期望 0
687
+ ```
688
+
689
+ ### 5.4 形态 A(`XiaoeList`)的唯一约束
690
+
691
+ 确认**完全不需要点击**时才用,此时 `detailHtml` 只能放:
692
+
693
+ 允许:`h2` / `h3` / `p` / `ul` `ol` `li` / `table` `tbody` `tr` `th` `td` / `strong` `em` / 内联 `style`
694
+ 禁止(会被静默过滤,用户看到空白):`script`、`style` 标签、`a` 链接、`img`、`onclick` 等事件属性
695
+
696
+ > 形态 A 用于纯展示时,可以采用「标签表格」写法(`th` 列 + `td` 内容),因为它不需要点击、也不追求与形态 B 完全同款。
697
+ > **但只要有动作要执行,就必须用形态 B 的「图标 + 标题 + 一行描述」视觉。**
698
+
699
+ ## 6. 完整示例(形态 B)
700
+
701
+ > ⚠️ **下面的围栏只是为了把结构显示清楚,不是输出格式。实际输出时去掉围栏,让 `<browsertool>` 顶格裸出现(见 §0)。**
702
+
703
+ ```browsertool-structure-only
704
+ <browsertool>
705
+ {
706
+ "version": 1,
707
+ "callId": "quote-card-202611041152-01",
708
+ "toolId": "fill_form",
709
+ "arguments": {
710
+ "type": "e10",
711
+ "title": "报价单已解析 · 可做的 2 件事",
712
+ "src": "https://www.e-cology.com.cn/sp/contract/xiaoe-custom-page",
713
+ "width": 1300,
714
+ "sdkRenderType": "inline",
715
+ "sdkOptions": {
716
+ "compName": "ui.CorsComponent",
717
+ "routerType": "MemoryRouter",
718
+ "routerProps_pc": { "initialEntries": ["/sp/contract/xiaoe-custom-page"] },
719
+ "params_pc": {
720
+ "app": "@weapp/contract",
721
+ "compName": "xiaoeCustomPage",
722
+ "customParams": {
723
+ "html": "<section style=\"padding:4px 2px;font-family:'Microsoft YaHei','PingFang SC',sans-serif\">\n <div data-act=\"gen\" role=\"button\" tabindex=\"0\" style=\"display:flex;align-items:center;gap:12px;background:#fff;border:1px solid #e8ebf2;border-radius:12px;padding:16px;margin-bottom:12px;cursor:pointer\">\n <span style=\"flex:0 0 auto;width:44px;height:44px;border-radius:10px;background:#eef1fb;display:flex;align-items:center;justify-content:center\">\n <svg width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"#7b8cf0\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z\"/><path d=\"M14 3v5h5\"/><path d=\"M9 13h6\"/><path d=\"M9 17h4\"/></svg>\n </span>\n <span style=\"min-width:0\">\n <span style=\"display:flex;align-items:center;gap:8px;margin-bottom:6px\">\n <span style=\"font-size:15px;font-weight:700;color:#1f2430\">按报价单生成合同</span>\n <span style=\"font-size:11px;color:#3b6fe0;background:#eaf0fe;border-radius:10px;padding:2px 8px;line-height:1.4\">推荐</span>\n </span>\n <span style=\"display:block;font-size:13px;color:#7a8497;line-height:1.5\">把标的与金额填成合同 docx | 自动推荐模板 | 可补条款</span>\n </span>\n </div>\n <p data-status style=\"margin:8px 0 0;color:#b45309;font-size:12px\"></p>\n</section>\n<script>\n(function(){var root=document.currentScript.closest('.contract-xiaoe-custom-page-content');if(!root)return;var status=root.querySelector('[data-status]');var plugin=window.xiaoePlugin||(window.rawWindow&&window.rawWindow.xiaoePlugin);function say(m){if(status)status.textContent=m;}function send(q){if(!plugin||!plugin.session||typeof plugin.session.sendQuestion!=='function'){say('当前环境不支持发送会话消息');return;}try{plugin.session.sendQuestion({question:q,files:[]});}catch(e){say('发送失败,请重试');}}var el=root.querySelector('[data-act=\"gen\"]');var fn=function(){send('按这份报价单生成合同');};el.addEventListener('click',fn);root.addEventListener('xiaoe-custom-page-dispose',function(){el.removeEventListener('click',fn);},{once:true});})();\n</script>"
724
+ }
725
+ }
726
+ }
727
+ }
728
+ }
729
+ </browsertool>
730
+ ```
731
+
732
+ ## 7. 常见坑
733
+
734
+ | # | 坑 | 后果 |
735
+ |---|---|---|
736
+ | -2 | **`artifact` 漏传 `initialArtifactKeys`** | 面板不激活目标文档,表现为空白、或不是想看的**那一篇**。该参数**与 `artifacts` 同级**放在 `contentProps` 内,**不是放 `artifacts` 里**;值取 `artifacts[].id`(2026-11-04 实测踩坑)。见 §5.3 动作③ |
737
+ | -1 | **`<browsertool>` 被包进围栏代码块、行内反引号,或做了 HTML 转义;或只给 JSON 不给标签** | 宿主当普通文本处理,卡片**完全不渲染**,用户只看到一段代码,本该能点的动作全丢(2026-11-04 实测发生)。见 §0,交付前确认标签前三个字符不是围栏符 |
738
+ | 0 | **卡片 script 里用了 `??` / `?.` / 箭头函数 / `const` / 模板字符串** | 宿主不识别 ES2020,**整个 script SyntaxError、一段不执行**,表现为「点击毫无反应」且无任何业务报错。见 §5.3.1,交付前必须统计为 0(2026-11-04 用户实测) |
739
+ | 1 | **行为卡片用 `XiaoeList` 的 `detailHtml`** | `script`/`onclick` 被静默过滤,用户点了毫无反应 |
740
+ | 2 | **卡片里加序号(①②、1. 2.)** | 用户明确不要;卡片本身已按上下顺序表达优先级 |
741
+ | 3 | **卡片里塞「会做什么 / 会写数据」标签表格** | 用户明确不要;这些信息应压进那一行灰色描述 |
742
+ | 4 | **外挂独立按钮**(蓝色实心 `<button>`) | 观感很丑,用户以为只有按钮能点;应整卡可点 |
743
+ | 5 | 卡片没有左侧图标块 | 与小 e 原生卡片不一致 |
744
+ | 6 | 图标尺寸/颜色随意(48px、深蓝、`fill` 填充) | 应统一 22px、`stroke:#7b8cf0`、`fill:none`、`stroke-width:1.6`,容器 44×44 圆角 10 底 `#eef1fb` |
745
+ | 7 | 「推荐」徽标加在每条上 | 只给排序第一的那条加 |
746
+ | 8 | 绑了 `click` 但没 hover 高亮 / 没 `cursor:pointer` | 用户不知道这块能点 |
747
+ | 9 | `rightPanel.open` 的 e10Sdk 误用 `routerProps_pc`/`params_pc` | 要 `routerProps`/`params`,混用白屏 |
748
+ | 10 | `sendQuestion` 的 `question` 写太简(如"生成") | 命中不了技能,答非所问 |
749
+ | 11 | 忘了注册 `xiaoe-custom-page-dispose` 解绑 | 面板切换后监听残留,重复触发 |
750
+ | 12 | 没做 `plugin` 存在性判断 | 非小 e 环境直接抛错,点了像没反应 |
751
+ | 13 | `title` 每轮不变 | 多轮卡片在右侧互相覆盖 |
752
+ | 14 | 把数据当行为(10 份合同塞进卡片) | 用户不知道点哪;数据请用摘要 HTML |
753
+ | 15 | 域名写死 `e-cology` | 换环境 `src` 打不开,卡片空白 |
754
+
755
+ ## 8. 环境相关
756
+
757
+ - `src` 与 `routerProps_pc.initialEntries` 的域名取**当前登录环境的 `baseUrl`**(`weaver-work-cli auth status` 输出里的 `baseUrl`),路径按形态固定(B:`/sp/contract/xiaoe-custom-page`;A:`/sp/contract/xiaoe-list`),**不要写死示例域名**。
758
+ - `callId` 每轮唯一,格式建议 `<场景>-<YYYYMMDDHHmm>-<序号>`。
759
+ - 卡片渲染失败(宿主不支持 `browsertool`)时,**必须**把同样的动作以四要素文本形式列在对话里,不能让用户无从选择。