weaver-work-cli 0.1.62 → 0.1.63

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 (272) hide show
  1. package/dist/chunks/{archive-S2VKZWQ3.js → archive-BLDYBZDX.js} +5 -4
  2. package/dist/chunks/{archive-oa-HEDSIUUY.js → archive-oa-3GJ3TWXR.js} +5 -4
  3. package/dist/chunks/{asset-HYH4W357.js → asset-AFXJN4CK.js} +5 -4
  4. package/dist/chunks/{asset-idle-N7REBNGL.js → asset-idle-VUJXWGWJ.js} +5 -4
  5. package/dist/chunks/{attachment-content-VYYA75FR.js → attachment-content-VMJA7NSQ.js} +3 -3
  6. package/dist/chunks/{blog-SLMZZICV.js → blog-EREB35VU.js} +5 -4
  7. package/dist/chunks/{caizhilian-RV43KKBT.js → caizhilian-ATM2JO5S.js} +5 -5
  8. package/dist/chunks/{calendar-DMVZ4OLY.js → calendar-E26ZIH7S.js} +5 -4
  9. package/dist/chunks/{chunk-6XSSAUNW.js → chunk-4OB22YKE.js} +48 -12
  10. package/dist/chunks/{chunk-UBGWIXU3.js → chunk-5CY37VLS.js} +131 -38
  11. package/dist/chunks/{chunk-EGANE35F.js → chunk-6G2JARDK.js} +1 -1
  12. package/dist/chunks/{chunk-WIWDVETN.js → chunk-6VCQLZXE.js} +75 -76
  13. package/dist/chunks/{chunk-E5YD5JWR.js → chunk-BY3WDJO5.js} +1 -1
  14. package/dist/chunks/{chunk-IW7A2IQY.js → chunk-C4YQJFZV.js} +43 -15
  15. package/dist/chunks/{chunk-BQYX2UX5.js → chunk-C5PIGPGX.js} +5 -3
  16. package/dist/chunks/{chunk-UBRWONP4.js → chunk-EOZHSNND.js} +2 -2
  17. package/dist/chunks/{chunk-UQFPF4EX.js → chunk-G3ZM57PD.js} +2 -2
  18. package/dist/chunks/{chunk-XT77MP54.js → chunk-GOBNIGWS.js} +410 -24
  19. package/dist/chunks/{chunk-KY3R42RS.js → chunk-GQK6WLOS.js} +5 -3
  20. package/dist/chunks/{chunk-BIA2NKUG.js → chunk-HEJPVXD3.js} +5 -5
  21. package/dist/chunks/{chunk-ILALC2N6.js → chunk-I4C2KR2G.js} +1 -1
  22. package/dist/chunks/{chunk-YI2YMW5N.js → chunk-IGICM3WJ.js} +2 -2
  23. package/dist/chunks/chunk-IN6NXQ26.js +680 -0
  24. package/dist/chunks/{chunk-VBFBMM7G.js → chunk-LOVAIGM2.js} +387 -70
  25. package/dist/chunks/{chunk-H6YOMI3U.js → chunk-OMAGCLUE.js} +5 -3
  26. package/dist/chunks/{chunk-VNYOUAWV.js → chunk-QAMIIFP6.js} +11 -11
  27. package/dist/chunks/{chunk-QBDXJS2W.js → chunk-QZYKZ7MQ.js} +16 -8
  28. package/dist/chunks/{chunk-V2LASYKO.js → chunk-RR45ELVE.js} +30 -24
  29. package/dist/chunks/{chunk-NRYDJN4J.js → chunk-RV2JAA5I.js} +89 -8
  30. package/dist/chunks/{chunk-TEZHIB6T.js → chunk-SDPC7BG2.js} +5 -3
  31. package/dist/chunks/{chunk-T2KVJFWJ.js → chunk-SHBDXEUE.js} +4 -7
  32. package/dist/chunks/{chunk-P6TXQK75.js → chunk-THMBDCRA.js} +5 -3
  33. package/dist/chunks/chunk-TJN4PIYO.js +47 -0
  34. package/dist/chunks/{chunk-DTCQFTHW.js → chunk-TNFIUZ4H.js} +3 -3
  35. package/dist/chunks/{chunk-JFAWZX53.js → chunk-UPVAQJKS.js} +282 -131
  36. package/dist/chunks/{chunk-KXJA42EA.js → chunk-WPBZQVLS.js} +1 -1
  37. package/dist/chunks/{conflict-GFJRS6I7.js → conflict-AMNTM3FV.js} +2 -2
  38. package/dist/chunks/{contract-U3ZGNRWB.js → contract-PLO2V2NO.js} +2333 -4426
  39. package/dist/chunks/{cowork-EX7PKIDK.js → cowork-FZAXE6FO.js} +5 -4
  40. package/dist/chunks/{create-flow-EJZD434E.js → create-flow-2DAUN7HU.js} +16 -6
  41. package/dist/chunks/{data-FOODGAMF.js → data-7NXMWET4.js} +3 -3
  42. package/dist/chunks/{ebuilder-form-I2EOKODG.js → ebuilder-form-DEYHX6M7.js} +4 -4
  43. package/dist/chunks/{ehr-TE4RFNID.js → ehr-QQH2DYYA.js} +244 -151
  44. package/dist/chunks/{employee-DR5Y64TI.js → employee-PGMY6NI6.js} +1 -1
  45. package/dist/chunks/{entry-mode-ZOLSXEGX.js → entry-mode-2JTVEKMP.js} +3 -3
  46. package/dist/chunks/{env-TID5NFR6.js → env-2JZMXC6I.js} +2 -2
  47. package/dist/chunks/{esb-7L6MHYLB.js → esb-I5ZFHJUK.js} +8 -8
  48. package/dist/chunks/{factory-OG7BPMH5.js → factory-XIATYHU6.js} +1 -1
  49. package/dist/chunks/{fna-6V2ENR3Y.js → fna-3V2TL6B2.js} +5 -4
  50. package/dist/chunks/{group-chat-5DKPWIHL.js → group-chat-CVYUZCOQ.js} +3 -3
  51. package/dist/chunks/{host-TJ5VVHM7.js → host-4DP7C7YQ.js} +4 -4
  52. package/dist/chunks/{host-3DLYA54R.js → host-4KQCAEWA.js} +4 -4
  53. package/dist/chunks/{host-ONZC6AE7.js → host-4X2F3JPQ.js} +4 -4
  54. package/dist/chunks/{host-OGBHL75G.js → host-BD7NAM33.js} +4 -4
  55. package/dist/chunks/{host-VTPAWDZV.js → host-CBONEAZS.js} +4 -4
  56. package/dist/chunks/{host-GOJHHTPY.js → host-L37QVNIV.js} +4 -4
  57. package/dist/chunks/{hrm-2N7NFQDZ.js → hrm-OL3IKN7C.js} +6 -6
  58. package/dist/chunks/{im-XCH47ZBN.js → im-YXQWUF3R.js} +4 -4
  59. package/dist/chunks/{invoice-5KJ7T774.js → invoice-4WY32PR2.js} +4 -4
  60. package/dist/chunks/{jiuchuanhui-PL6DRPBM.js → jiuchuanhui-L6SHLONH.js} +5 -4
  61. package/dist/chunks/{lazy-dispatch-UATEN7H7.js → lazy-dispatch-OYE6QV24.js} +5 -5
  62. package/dist/chunks/{mail-Q7Z4CQ4D.js → mail-PZV2KNRU.js} +5 -4
  63. package/dist/chunks/{meeting-5E3BNARL.js → meeting-6SOBCC6N.js} +16 -15
  64. package/dist/chunks/{minute-doc-NXRE5C77.js → minute-doc-KSJSJNOH.js} +4 -4
  65. package/dist/chunks/{okr-3O3XNYOK.js → okr-B76FW5M2.js} +5 -4
  66. package/dist/chunks/{operations-EZWG72FH.js → operations-YOMEGFLV.js} +5 -5
  67. package/dist/chunks/{performance-Y7CPNSOR.js → performance-4VBKUPFO.js} +5 -4
  68. package/dist/chunks/{plan-BLGPZF5M.js → plan-HBNZRQTI.js} +5 -4
  69. package/dist/chunks/{project-6MZMLJMP.js → project-IV6FWK74.js} +5 -4
  70. package/dist/chunks/{reception-F2VT2X52.js → reception-BR5YURT6.js} +3 -3
  71. package/dist/chunks/{recruit-stage-4ETIBMIW.js → recruit-stage-4HQ6OGXT.js} +654 -336
  72. package/dist/chunks/{registry-I4DVPDMU.js → registry-7LICMV5J.js} +12 -12
  73. package/dist/chunks/{registry-3FYSWV3U.js → registry-JFQEFC7E.js} +3 -3
  74. package/dist/chunks/{registry-3UGIWH53.js → registry-JMNOXRST.js} +2 -2
  75. package/dist/chunks/{registry-7RS74TCK.js → registry-MZJQX65Q.js} +5 -5
  76. package/dist/chunks/{room-recommend-GWCVKCXW.js → room-recommend-43GLLE7Y.js} +4 -4
  77. package/dist/chunks/{schedule-6AN63MJQ.js → schedule-ZQ42BEW6.js} +4 -4
  78. package/dist/chunks/{smart-extract-SR4SJJKN.js → smart-extract-QKAEAZGM.js} +3 -3
  79. package/dist/chunks/{workflow-KF7FA2UQ.js → workflow-6HV7H5PC.js} +10 -7
  80. package/dist/index.js +34 -34
  81. package/dist/internal/e10/auth/commands.js +21 -1
  82. package/dist/internal/e10/auth/xiaoe.js +6 -2
  83. package/dist/internal/e10/auth-recovery.js +28 -2
  84. package/dist/internal/e10/request-runtime.js +15 -3
  85. package/dist/internal/e10/request-trace.js +65 -0
  86. package/dist/shortcuts/contract/data/metric-catalog.js +149 -0
  87. package/dist/shortcuts/contract/index.js +14 -39
  88. package/dist/shortcuts/contract/manifest.js +115 -270
  89. package/dist/shortcuts/contract/operations/compare-report.js +437 -0
  90. package/dist/shortcuts/contract/operations/compare.js +2 -0
  91. package/dist/shortcuts/contract/operations/first-screen.js +96 -207
  92. package/dist/shortcuts/contract/operations/flow.js +19 -1
  93. package/dist/shortcuts/contract/operations/{card-ebdf-list.js → ledger-card.js} +98 -25
  94. package/dist/shortcuts/contract/operations/ledger.js +315 -1
  95. package/dist/shortcuts/contract/operations/metrics.js +93 -0
  96. package/dist/shortcuts/contract/operations/modeltext.js +3 -3
  97. package/dist/shortcuts/contract/operations/page.js +8 -4
  98. package/dist/shortcuts/contract/operations/performance.js +53 -0
  99. package/dist/shortcuts/contract/operations/quote-recognize.js +289 -0
  100. package/dist/shortcuts/contract/operations/quote-submit.js +264 -0
  101. package/dist/shortcuts/contract/operations/recommend.js +42 -1
  102. package/dist/shortcuts/contract/operations/registry.js +16 -23
  103. package/dist/shortcuts/contract/operations/{card-risk-report.js → review-report.js} +24 -114
  104. package/dist/shortcuts/contract/operations/review.js +33 -167
  105. package/dist/shortcuts/contract/operations/save-recognize.js +173 -43
  106. package/dist/shortcuts/contract/operations/triage.js +13 -6
  107. package/dist/shortcuts/contract/operations/{template.js → type-clause-read.js} +10 -25
  108. package/dist/shortcuts/contract/operations/upload.js +17 -11
  109. package/dist/shortcuts/contract/prewarm-cache.js +6 -2
  110. package/dist/shortcuts/contract/prewarm.js +33 -23
  111. package/dist/shortcuts/contract/recommend-cache.js +191 -0
  112. package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +85 -62
  113. package/dist/shortcuts/ehr/operations/recruit-position.js +21 -13
  114. package/dist/shortcuts/ehr/operations/recruit-short-cache.js +59 -0
  115. package/dist/shortcuts/ehr/operations/recruit-tag.js +17 -11
  116. package/dist/shortcuts/ehr/operations/recruit-write.js +118 -70
  117. package/dist/shortcuts/ehr/operations/recruit.js +338 -121
  118. package/dist/shortcuts/hrm/operations/employee.js +64 -17
  119. package/dist/shortcuts/hrm/operations/resolve.js +419 -369
  120. package/dist/shortcuts/im/host.js +38 -22
  121. package/dist/shortcuts/meeting/operations/eb/conflict.js +60 -2
  122. package/dist/shortcuts/meeting/operations/eb/create-flow.js +116 -7
  123. package/dist/shortcuts/meeting/operations/eb/create-form-link.js +380 -0
  124. package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
  125. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +1 -3
  126. package/dist/shortcuts/recruit-stage/batch-store.js +44 -0
  127. package/dist/shortcuts/recruit-stage/context.js +75 -9
  128. package/dist/shortcuts/recruit-stage/manifest.js +1 -1
  129. package/dist/shortcuts/recruit-stage/operations/jd-create.js +33 -22
  130. package/dist/shortcuts/recruit-stage/operations/list.js +187 -37
  131. package/dist/shortcuts/recruit-stage/operations/registry.js +2 -0
  132. package/dist/shortcuts/recruit-stage/operations/resume-import.js +231 -313
  133. package/dist/shortcuts/recruit-stage/operations/search.js +5 -5
  134. package/dist/shortcuts/recruit-stage/operations/tag.js +286 -0
  135. package/dist/shortcuts/workflow/endpoints.js +2 -0
  136. package/dist/shortcuts/workflow/operations/form.js +12 -15
  137. package/dist/shortcuts/workflow/operations/read.js +8 -8
  138. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +3 -2
  139. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +7 -6
  140. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +4 -3
  141. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +1 -0
  142. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +33 -6
  143. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +153 -0
  144. package/dist/shortcuts/workflow/operations/todoSmartConvert/workflowClarification.js +232 -0
  145. package/dist/shortcuts/workflow/operations.js +5 -0
  146. package/docs/contract.md +2 -2
  147. package/docs/e10-auth.md +28 -0
  148. package/docs/ehr.md +1 -1
  149. package/package.json +1 -1
  150. package/skills/weaver-e10-hrm/SKILL.md +3 -3
  151. package/skills/weaver-e10-hrm/references/employee.md +13 -2
  152. package/skills/weaver-e10-jinchengda/SKILL.md +237 -347
  153. package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +7 -14
  154. package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +21 -12
  155. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +109 -185
  156. package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +12 -4
  157. package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +28 -20
  158. package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +12 -17
  159. package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +7 -13
  160. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +21 -12
  161. package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +10 -18
  162. package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +18 -17
  163. package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +114 -61
  164. package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +8 -2
  165. package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +73 -104
  166. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +32 -37
  167. package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +12 -10
  168. package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +70 -82
  169. package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +37 -33
  170. package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +94 -27
  171. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +5 -5
  172. package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +9 -15
  173. package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +9 -4
  174. package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +59 -32
  175. package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +7 -5
  176. package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +21 -13
  177. package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +13 -13
  178. package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +6 -5
  179. package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +250 -0
  180. package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +11 -20
  181. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +203 -54
  182. package/skills/weaver-e10-jinchengda/references/contract-request-status.md +4 -11
  183. package/skills/weaver-e10-jinchengda/references/contract-request-write.md +11 -17
  184. package/skills/weaver-e10-jinchengda/references/contract-signing-subjects.md +11 -17
  185. package/skills/weaver-e10-jinchengda/references/contract-subject-create.md +5 -11
  186. package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +56 -7
  187. package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +10 -16
  188. package/skills/weaver-e10-jinchengda/references/orchestration.md +31 -33
  189. package/skills/weaver-e10-jucailin/SKILL.md +6 -7
  190. package/skills/weaver-e10-jucailin/agents/openai.yaml +52 -0
  191. package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +8 -6
  192. package/skills/weaver-e10-jucailin/references/recruit-read.md +4 -0
  193. package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +2 -2
  194. package/skills/weaver-e10-jucailin/references/recruit-write.md +4 -4
  195. package/skills/weaver-e10-meeting/SKILL.md +83 -531
  196. package/skills/weaver-e10-meeting/references/commands-table.md +61 -0
  197. package/skills/weaver-e10-meeting/references/create-commands.md +136 -0
  198. package/skills/weaver-e10-meeting/references/create-flow.md +3 -1
  199. package/skills/weaver-e10-meeting/references/create-guardrails.md +14 -8
  200. package/skills/weaver-e10-meeting/references/custom-fields.md +40 -0
  201. package/skills/weaver-e10-meeting/references/eb-contracts.md +60 -0
  202. package/skills/weaver-e10-meeting/references/invitation.md +69 -0
  203. package/skills/weaver-e10-meeting/references/minutes-pipeline.md +119 -0
  204. package/skills/weaver-e10-meeting/references/pitfalls.md +1 -1
  205. package/skills/weaver-e10-meeting/references/room-recommend.md +88 -0
  206. package/skills/weaver-e10-recruit-stage/SKILL.md +317 -266
  207. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +22 -27
  208. package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +1 -1
  209. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +30 -27
  210. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +2 -6
  211. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +12 -10
  212. package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +2 -0
  213. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +23 -19
  214. package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +3 -1
  215. package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +18 -16
  216. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +25 -23
  217. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +10 -10
  218. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +2 -2
  219. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +11 -11
  220. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +150 -85
  221. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +14 -18
  222. package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +1 -1
  223. package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +173 -0
  224. package/skills/weaver-e10-recruit-stage/references/recruit-tag-taxonomy.json +76 -0
  225. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +3 -1
  226. package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
  227. package/skills/weaver-e10-workflow/SKILL.md +49 -32
  228. package/skills/weaver-e10-workflow/references/todo-dialogue.md +67 -34
  229. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +65 -51
  230. package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +18 -11
  231. package/skills/weaver-e10-workflow/references/workflow-create.md +2 -2
  232. package/skills/weaver-e10-workflow/references/workflow-memory.md +19 -37
  233. package/skills/weaver-e10-workflow/references/workflow-query.md +25 -22
  234. package/skills/weaver-e10-workflow/references/workflow-view.md +1 -1
  235. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +318 -110
  236. package/skills/weaver-e10-yimiaoban/SKILL.md +10 -10
  237. package/skills/weaver-e10-yimiaoban/references/person.md +1 -1
  238. package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
  239. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +9 -9
  240. package/dist/chunks/chunk-6QYNE6HE.js +0 -658
  241. package/dist/chunks/chunk-SHYQUBY3.js +0 -48
  242. package/dist/shortcuts/contract/operations/card-action.js +0 -1266
  243. package/dist/shortcuts/contract/operations/card-plan.js +0 -393
  244. package/dist/shortcuts/contract/operations/card.js +0 -232
  245. package/dist/shortcuts/contract/operations/compare-screen.js +0 -378
  246. package/dist/shortcuts/contract/operations/quote-to-contract.js +0 -495
  247. package/dist/shortcuts/contract/operations/quotescreen.js +0 -529
  248. package/dist/shortcuts/contract/operations/summary-validate.js +0 -293
  249. package/dist/shortcuts/contract/operations/summary.js +0 -187
  250. package/dist/shortcuts/ehr/recruit-stage/batch-store.js +0 -78
  251. package/dist/shortcuts/ehr/recruit-stage/context.js +0 -231
  252. package/dist/shortcuts/ehr/recruit-stage/continuation.js +0 -74
  253. package/dist/shortcuts/ehr/recruit-stage/errors.js +0 -65
  254. package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +0 -165
  255. package/dist/shortcuts/ehr/recruit-stage/host.js +0 -109
  256. package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +0 -1065
  257. package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +0 -295
  258. package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +0 -961
  259. package/dist/shortcuts/ehr/recruit-stage/operations/list.js +0 -431
  260. package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +0 -50
  261. package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +0 -1655
  262. package/dist/shortcuts/ehr/recruit-stage/operations/search.js +0 -158
  263. package/dist/shortcuts/ehr/recruit-stage/operations/types.js +0 -34
  264. package/dist/shortcuts/ehr/recruit-stage/runtime.js +0 -31
  265. package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +0 -318
  266. package/dist/shortcuts/ehr/recruit-stage/shared.js +0 -887
  267. package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +0 -22
  268. package/skills/weaver-e10-jinchengda/references/contract-action-card.md +0 -554
  269. package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +0 -279
  270. package/skills/weaver-e10-jinchengda/references/contract-card-render-internals.md +0 -483
  271. package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +0 -46
  272. package/skills/weaver-e10-recruit-stage/lib/recruit-resume-photo.py +0 -194
@@ -1,393 +0,0 @@
1
- import { readFileSync } from 'node:fs';
2
- import { resolve } from 'node:path';
3
- import { contractValidationError } from '../errors.js';
4
- /**
5
- * 合同动作推荐引擎(本地,零依赖)。
6
- *
7
- * 迁移自 `scripts/plan_actions.py`(2026-11-12 第一批)。
8
- * 原脚本把注册表、requires、抑制、排序、截断固化为可执行逻辑,
9
- * 模型只提供上下文状态 JSON,不再自行推断卡片条数。
10
- *
11
- * 语义对齐要求:本实现与 Python 版**逐字段等价**,包括
12
- * Python 的真值规则(`[]` / `{}` 为假)、`"set"` 判定(`0` 视为未设置)、
13
- * 以及 `(-weight, id)` 的排序与 4 张卡片截断。
14
- */
15
- const MAX_CARDS = 4;
16
- const EMPTY_HINT = '按 contract-action-engine.md §7 空结果处理:不出卡片,说明缺什么与补法';
17
- /** scene = doc(默认)时的动作域。 */
18
- const ACTIONS = [
19
- {
20
- id: 'generate-contract',
21
- title: '按报价单生成合同',
22
- weight: 100,
23
- walk: 'sendQuestion',
24
- desc: '用真实模板把标的与金额填成合同 docx | 缺 .docx 模板 | 3~5 步 · 确认 1 次',
25
- requires: { docType: ['quote', 'tender'] },
26
- blocked: ['generatedDocx'],
27
- },
28
- {
29
- id: 'launch-flow',
30
- // 两条成立路径(2026-11-16 修复):
31
- // ① flowKey 已定且有流程文件 → 直开表单并回填(walk=e10Sdk);
32
- // ② 报价单刚转出合同、flowKey 未定且未上传 → 只给提示语,点击走 sendQuestion。
33
- //
34
- // 旧实现 requires 硬要求 `flowKey` + `hasFileId`,与「生成后不上传、不传 flowKey」
35
- // 的定稿规则直接冲突:过滤发生在 requires 阶段,抑制规则里的
36
- // 「flowKey=null 不抑制 launch-flow」根本轮不到执行,该卡在本场景永远消失。
37
- title: '发起「{flowKey}」合同流程',
38
- weight: 100,
39
- walk: 'e10Sdk',
40
- desc: '生成正式审批单并进入流转 | 证据齐 | 4~7 步 · 确认 2 次',
41
- requires: {},
42
- any_of: [{ flowKey: 'set', hasFileId: true }, { generatedDocx: true, flowTypeUndetermined: true }],
43
- blocked: ['submitted'],
44
- },
45
- {
46
- id: 'review',
47
- title: '合同预审',
48
- weight: 92,
49
- walk: 'sendQuestion',
50
- desc: '发消息让 AI 出风险条款与修改建议 | 只读,不改原文',
51
- requires: { hasFileId: true },
52
- // 已经触发过审查(reviewStarted)就不再给「合同预审」,避免重复触发
53
- blocked: ['reviewed', 'reviewStarted'],
54
- },
55
- {
56
- id: 'export-review',
57
- title: '导出审查报告',
58
- weight: 84,
59
- walk: 'artifact',
60
- desc: '查看风险条款、问题说明与建议修改 | 只读 | 点开即看',
61
- // 只有「已拿到审查结果」才允许导出;reviewStarted 但无结果时不得出现
62
- requires: { reviewed: true },
63
- blocked: [],
64
- },
65
- {
66
- id: 'view-compare',
67
- title: '查看比对详情',
68
- weight: 82,
69
- walk: 'e10Sdk',
70
- desc: '左右对照看两版差异 | 只读,仅开页面',
71
- requires: { compared: true },
72
- blocked: [],
73
- },
74
- {
75
- id: 'view-review',
76
- title: '查看审查详情',
77
- weight: 80,
78
- walk: 'e10Sdk',
79
- desc: '打开 AI 审查页看逐条判定与原文定位 | 只读,不改原文',
80
- // 审查进行中(reviewStarted)与已出结果(reviewed)两种情况都要给:
81
- // 前者是用户稍后回来看进度的唯一入口,后者可看逐条判定
82
- requires: {},
83
- any_of: [{ reviewed: true }, { reviewStarted: true }],
84
- blocked: [],
85
- },
86
- {
87
- id: 'export-compare-report',
88
- title: '生成比对报告',
89
- weight: 78,
90
- walk: 'artifact',
91
- desc: '出四指标统计与差异清单 | 只读 | 点开即看',
92
- requires: { compared: true },
93
- blocked: [],
94
- },
95
- {
96
- id: 'credit',
97
- title: '查对方资信',
98
- weight: 72,
99
- walk: 'e10Sdk',
100
- desc: '看诉讼/被执行/工商变更 | 只开页面,只读',
101
- requires: { hasCounterparty: true },
102
- blocked: [],
103
- },
104
- {
105
- id: 'request-status',
106
- title: '查这份合同的审批进度',
107
- weight: 70,
108
- walk: 'sendQuestion',
109
- desc: '看当前节点与审批意见 | 只读 | 1~2 步',
110
- requires: { submitted: true, requestId: 'set' },
111
- blocked: [],
112
- },
113
- {
114
- id: 'compare',
115
- title: '比对两份合同',
116
- weight: 60,
117
- walk: 'e10Sdk',
118
- desc: '逐条比差异 | 需两份文件 | 2~3 步',
119
- requires: { otherVersionAvailable: true },
120
- blocked: ['compared'],
121
- },
122
- {
123
- id: 'clause-rewrite',
124
- title: '按建议改条款',
125
- weight: 56,
126
- walk: 'sendQuestion',
127
- desc: '把建议条款写回合同 | 会改原文 | 需确认 2 次',
128
- requires: { reviewed: true },
129
- blocked: [],
130
- },
131
- {
132
- id: 'summary',
133
- title: '查看合同摘要',
134
- weight: 28,
135
- walk: 'artifact',
136
- desc: '要素、标的与关键条款 | 只读 | 点开即看',
137
- requires: { summaryReady: true },
138
- blocked: [],
139
- },
140
- ];
141
- /** scene ≠ doc 时的动作域(query / config 不处理合同文件)。 */
142
- const QUERY_ACTIONS = [
143
- {
144
- id: 'query-contracts',
145
- title: '查我负责的合同',
146
- weight: 100,
147
- walk: 'sendQuestion',
148
- desc: '按负责人查合同列表 | 只读',
149
- requires: {},
150
- blocked: [],
151
- },
152
- {
153
- id: 'query-performance',
154
- title: '查直销业绩',
155
- weight: 90,
156
- walk: 'sendQuestion',
157
- desc: '按期间汇总直销业绩 | 只读',
158
- requires: {},
159
- blocked: [],
160
- },
161
- {
162
- id: 'query-receipts',
163
- title: '查合同收款',
164
- weight: 80,
165
- walk: 'sendQuestion',
166
- desc: '按合同号查收款台账 | 只读',
167
- requires: {},
168
- blocked: [],
169
- },
170
- {
171
- id: 'query-channel',
172
- title: '查渠道订单',
173
- weight: 70,
174
- walk: 'sendQuestion',
175
- desc: '按渠道查订单 | 只读',
176
- requires: {},
177
- blocked: [],
178
- },
179
- ];
180
- /**
181
- * doc 场景的跨域补位动作(contract-action-engine.md §5)。
182
- *
183
- * 仅允许「与当前这份文件相关」的两条:客户历史合同、该合同收款。
184
- * 业绩 / 渠道订单 / 我的合同属全局查询,塞进文件上下文里是噪音,禁止补位。
185
- * 2026-11-16 修复:旧实现完全没有补位步骤,doc 域动作不足 2 条时也不补。
186
- */
187
- const DOC_TOPUP_ACTIONS = [
188
- {
189
- id: 'query-customer-contracts',
190
- title: '查该客户的合同',
191
- weight: 96,
192
- walk: 'sendQuestion',
193
- desc: '按客户主体查历史合同 | 只读',
194
- requires: { hasCounterparty: true },
195
- blocked: [],
196
- },
197
- {
198
- id: 'query-contract-receipt',
199
- title: '查该合同收款',
200
- weight: 88,
201
- walk: 'sendQuestion',
202
- desc: '按客户或合同号查收款台账 | 只读',
203
- requires: {},
204
- any_of: [{ hasContractNo: true }, { hasCounterparty: true }],
205
- blocked: [],
206
- },
207
- ];
208
- /** Python 真值语义:None/False/0/""/[]/{} 均为假。 */
209
- function pyTruthy(value) {
210
- if (value === null || value === undefined || value === false)
211
- return false;
212
- if (value === true)
213
- return true;
214
- if (typeof value === 'number')
215
- return value !== 0 && !Number.isNaN(value);
216
- if (typeof value === 'string')
217
- return value.length > 0;
218
- if (Array.isArray(value))
219
- return value.length > 0;
220
- if (typeof value === 'object')
221
- return Object.keys(value).length > 0;
222
- return true;
223
- }
224
- /** Python `==`:数字与布尔可互相相等(0 == False、1 == True)。 */
225
- function pyEq(left, right) {
226
- const toNum = (value) => {
227
- if (typeof value === 'boolean')
228
- return value ? 1 : 0;
229
- if (typeof value === 'number')
230
- return value;
231
- return null;
232
- };
233
- const ln = toNum(left);
234
- const rn = toNum(right);
235
- if (ln !== null && rn !== null)
236
- return ln === rn;
237
- if (left === null || left === undefined)
238
- return right === null || right === undefined;
239
- return left === right;
240
- }
241
- function asText(value) {
242
- if (value === null || value === undefined)
243
- return '';
244
- return String(value);
245
- }
246
- /** 单个条件组:全部为真才通过。 */
247
- function matchOne(cond, ctx) {
248
- for (const [key, expect] of Object.entries(cond)) {
249
- const actual = ctx[key];
250
- if (expect === 'set') {
251
- // Python: actual in (None, "", False),其中 0 == False 也视为未设置
252
- if (actual === null || actual === undefined || actual === '' || actual === false)
253
- return false;
254
- if (typeof actual === 'number' && actual === 0)
255
- return false;
256
- continue;
257
- }
258
- if (Array.isArray(expect)) {
259
- if (!expect.some((item) => pyEq(actual, item)))
260
- return false;
261
- continue;
262
- }
263
- if (pyTruthy(actual) !== pyTruthy(expect))
264
- return false;
265
- }
266
- return true;
267
- }
268
- /** requires 判定:requires 全真 且(无 any_of 或任一分支全真)。 */
269
- function matches(action, ctx) {
270
- if (!matchOne(action.requires ?? {}, ctx))
271
- return false;
272
- const anyOf = action.any_of;
273
- if (anyOf && anyOf.length) {
274
- if (!anyOf.some((cond) => matchOne(cond, ctx)))
275
- return false;
276
- }
277
- return true;
278
- }
279
- /** 抑制判定:终态不回推、已完成不重复、本轮刚执行的不立刻回推。 */
280
- function suppressed(action, ctx) {
281
- for (const key of action.blocked ?? []) {
282
- if (pyTruthy(ctx[key]))
283
- return true;
284
- }
285
- return ctx.lastAction === action.id;
286
- }
287
- export function planActions(ctx) {
288
- const rawScene = ctx.scene;
289
- const scene = pyTruthy(rawScene) ? String(rawScene) : 'doc';
290
- const pool = scene === 'query' || scene === 'config' ? QUERY_ACTIONS : ACTIONS;
291
- const scored = pool.filter((action) => matches(action, ctx) && !suppressed(action, ctx));
292
- scored.sort((left, right) => {
293
- if (right.weight !== left.weight)
294
- return right.weight - left.weight;
295
- if (left.id < right.id)
296
- return -1;
297
- if (left.id > right.id)
298
- return 1;
299
- return 0;
300
- });
301
- let picked = scored.slice(0, MAX_CARDS);
302
- // 跨域补位(contract-action-engine.md §5):doc 场景动作少于 2 条时,
303
- // 从「与当前文件相关」的查询动作里补足。补位必须在 requires 过滤之后、
304
- // 截断之前执行,且不覆盖已有动作。
305
- if (scene === 'doc' && picked.length < 2) {
306
- const seen = new Set(picked.map((action) => action.id));
307
- for (const action of DOC_TOPUP_ACTIONS) {
308
- if (picked.length >= 2)
309
- break;
310
- if (seen.has(action.id))
311
- continue;
312
- if (!matches(action, ctx) || suppressed(action, ctx))
313
- continue;
314
- picked = [...picked, action];
315
- seen.add(action.id);
316
- }
317
- }
318
- const flowKey = pyTruthy(ctx.flowKey) ? String(ctx.flowKey) : '';
319
- // flowKey 未定 → 该卡是「提示语」而非真实流程入口:标题不带流程名,点击发消息。
320
- // 同时避免 title 模板拼出「发起「」合同流程」这种空壳文案。
321
- const launchIsHint = !pyTruthy(ctx.flowKey);
322
- const cards = picked.map((action) => {
323
- if (action.id === 'launch-flow' && launchIsHint) {
324
- return {
325
- id: action.id,
326
- title: '发起合同流程',
327
- weight: action.weight,
328
- walk: 'sendQuestion',
329
- desc: '按这份合同发起审批 | 由对话侧判定类型后办理 | 点后继续',
330
- };
331
- }
332
- return {
333
- id: action.id,
334
- title: action.title.split('{flowKey}').join(flowKey),
335
- weight: action.weight,
336
- walk: action.walk,
337
- desc: action.desc,
338
- };
339
- });
340
- return {
341
- scene,
342
- count: cards.length,
343
- title: `可做的 ${cards.length} 件事`,
344
- cards,
345
- dropped: scored.slice(MAX_CARDS).map((action) => action.id),
346
- hint: cards.length ? '' : EMPTY_HINT,
347
- };
348
- }
349
- function resolveContext(input) {
350
- const direct = input.context;
351
- if (direct && typeof direct === 'object' && !Array.isArray(direct)) {
352
- return direct;
353
- }
354
- const file = typeof input.contextFile === 'string' && input.contextFile.trim() ? input.contextFile.trim() : '';
355
- const inline = typeof input.contextJson === 'string' && input.contextJson.trim() ? input.contextJson.trim() : '';
356
- if (!file && !inline) {
357
- throw contractValidationError('context_required', '必须提供上下文:context(对象)、contextFile(JSON 文件路径)或 contextJson(JSON 字符串)三选一');
358
- }
359
- let raw;
360
- if (file) {
361
- try {
362
- raw = readFileSync(resolve(file), 'utf8').replace(/^\uFEFF/u, '');
363
- }
364
- catch (error) {
365
- const message = error instanceof Error ? error.message : String(error);
366
- throw contractValidationError('context_unreadable', `无法读取上下文 JSON:${message}`);
367
- }
368
- }
369
- else {
370
- raw = inline;
371
- }
372
- let parsed;
373
- try {
374
- parsed = JSON.parse(raw);
375
- }
376
- catch (error) {
377
- const message = error instanceof Error ? error.message : String(error);
378
- throw contractValidationError('context_invalid', `上下文不是合法 JSON:${message}`);
379
- }
380
- if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
381
- throw contractValidationError('context_invalid', '上下文必须是 JSON 对象');
382
- }
383
- return parsed;
384
- }
385
- export const contractCardPlanOperation = {
386
- name: 'contract.card.plan',
387
- async execute(input) {
388
- const ctx = resolveContext(input);
389
- return { status: 'COMPLETE', data: planActions(ctx) };
390
- },
391
- };
392
- export const contractCardPlanOperations = [contractCardPlanOperation];
393
- export { asText };
@@ -1,232 +0,0 @@
1
- import { readFileSync, writeFileSync } from 'node:fs';
2
- import { basename, resolve } from 'node:path';
3
- import { contractValidationError } from '../errors.js';
4
- import { CARD_PANEL_WIDTH } from './card-action.js';
5
- import { requireNonEmptyString } from './shared.js';
6
- import { renderSummaryHtml } from './summary.js';
7
- /**
8
- * 行为卡片 HTML 渲染(本地,零依赖)。
9
- *
10
- * 定位:模型只产出「卡片清单 + 摘要数据」的紧凑 JSON(约 2~3 KB),
11
- * 卡片骨架、事件绑定、ES5 脚本、browsertool 外壳全部由本 operation 生成。
12
- *
13
- * 为什么值得做(2026-11-09):
14
- * 1. 手写卡片 HTML 是"点不动"的高发区(双引号截断、括号错位、漏 initialArtifactKeys)。
15
- * 生成器固定输出,这三类错误从结构上不可能发生——这是主要收益。
16
- * 2. 卡片从「逐张重复 HTML」改为「紧凑数组 + 循环生成」,
17
- * 常驻体积从约 6 KB 降到约 2 KB(脚本只写一次)。
18
- *
19
- * 注意:browsertool 必须内联完整 HTML,所以模型回复的体积下限仍由成品 HTML 决定。
20
- * 本 operation 靠"结构复用"降低成品体积,不承诺数量级的 token 下降。
21
- */
22
- const CARD_SCRIPT = `(function(){
23
- var root=document.getElementById('__UID__');
24
- if(!root){return;}
25
- var st=root.querySelector('[data-status]');
26
- function say(m){if(st){st.textContent=m;}}
27
- function plug(){
28
- if(window.xiaoePlugin){return window.xiaoePlugin;}
29
- if(window.rawWindow&&window.rawWindow.xiaoePlugin){return window.rawWindow.xiaoePlugin;}
30
- return null;
31
- }
32
- var wrap=document.createElement('div');
33
- root.insertBefore(wrap,st);
34
- var cards=[];
35
- var cb=root.querySelector('[data-cards]');
36
- try{cards=JSON.parse(cb?cb.value:'[]');}catch(e){cards=[];}
37
- var ICON={send:'&#128231;',shield:'&#128737;',search:'&#128269;',doc:'&#128203;',compare:'&#128260;',calc:'&#128202;',link:'&#128279;'};
38
- function run(c){
39
- var a=c.action||{};
40
- if('sendQuestion'.indexOf(a.type)>-1){
41
- var ps=plug();
42
- if(!ps||!ps.session||typeof ps.session.sendQuestion!=='function'){say('当前环境不支持发送会话消息');return;}
43
- try{ps.session.sendQuestion({question:a.question||c.title||'',files:[]});say('已发送,正在处理');}
44
- catch(e){say('发送失败,请重试');}
45
- return;
46
- }
47
- var p=plug();
48
- if(!p||!p.rightPanel||typeof p.rightPanel.open!=='function'){say('当前环境没有小e右侧面板');return;}
49
- var cfg={};
50
- if('e10Sdk'.indexOf(a.type)>-1){
51
- var prm={app:a.app,compName:a.comp};
52
- if(a.companyName){prm.companyName=a.companyName;}
53
- if(a.customParams){prm.customParams=a.customParams;}
54
- cfg.type='e10Sdk';
55
- cfg.width=a.width||${CARD_PANEL_WIDTH};
56
- cfg.contentProps={src:a.src,sdkOptions:{compName:'ui.CorsComponent',routerType:'MemoryRouter',routerProps:{initialEntries:a.entries},params:prm}};
57
- }else if('artifact'.indexOf(a.type)>-1){
58
- var sb=root.querySelector('[data-summary]');
59
- var h=sb?sb.value:'';
60
- if(!h){say('摘要内容为空');return;}
61
- cfg.type='artifact';
62
- cfg.width=a.width||${CARD_PANEL_WIDTH};
63
- cfg.contentProps={initialArtifactKeys:['summary-1'],artifacts:[{id:'summary-1',name:'合同摘要.html',fileType:'html',raw:{html:h}}]};
64
- }else{say('不支持的动作类型');return;}
65
- try{p.rightPanel.open(cfg);say('已打开');}catch(e){say('面板打开失败,请检查右侧面板');}
66
- }
67
- for(var i=0;i<cards.length;i++){
68
- (function(c){
69
- var b=document.createElement('button');
70
- b.type='button';
71
- b.setAttribute('data-act',c.id||('act'+i));
72
- b.style.cssText='width:100%;box-sizing:border-box;text-align:left;font-family:inherit;display:flex;align-items:center;gap:12px;background:#fff;border:1px solid #e3e6eb;border-radius:10px;padding:16px;margin-bottom:12px;cursor:pointer';
73
- var ic=document.createElement('span');
74
- ic.style.cssText='flex:0 0 auto;width:44px;height:44px;border-radius:10px;background:#eef4ff;display:flex;align-items:center;justify-content:center;font-size:20px';
75
- ic.innerHTML=ICON[c.icon]||ICON.doc;
76
- var tx=document.createElement('span');
77
- tx.style.cssText='min-width:0';
78
- var t1=document.createElement('span');
79
- t1.style.cssText='display:block;margin-bottom:6px;font-size:15px;font-weight:700;color:#1f2329';
80
- t1.textContent=c.title||'';
81
- if(c.recommended){
82
- var bd=document.createElement('span');
83
- bd.style.cssText='font-size:11px;color:#fff;background:#1a56b8;border-radius:999px;padding:2px 10px;margin-left:8px';
84
- bd.textContent='推荐';
85
- t1.appendChild(bd);
86
- }
87
- var t2=document.createElement('span');
88
- t2.style.cssText='display:block;font-size:13px;color:#5c6570;line-height:1.5';
89
- t2.textContent=c.desc||'';
90
- tx.appendChild(t1);tx.appendChild(t2);
91
- b.appendChild(ic);b.appendChild(tx);
92
- b.addEventListener('click',function(){run(c);});
93
- b.addEventListener('mouseenter',function(){b.style.borderColor='#1a56b8';});
94
- b.addEventListener('mouseleave',function(){b.style.borderColor='#e3e6eb';});
95
- wrap.appendChild(b);
96
- })(cards[i]);
97
- }
98
- say('共 '+cards.length+' 个可执行操作');
99
- })();`;
100
- function escAttr(value) {
101
- return String(value ?? '')
102
- .replace(/&/gu, '&amp;')
103
- .replace(/</gu, '&lt;')
104
- .replace(/>/gu, '&gt;')
105
- .replace(/'/gu, '&#39;');
106
- }
107
- /** textarea 是 raw text:先把 & 转义,再把双引号转成实体,读 .value 时浏览器会还原。 */
108
- function textareaRaw(value) {
109
- return value
110
- .replace(/&/gu, '&amp;')
111
- .replace(/"/gu, '&quot;')
112
- .replace(/<\/textarea/giu, '&lt;/textarea');
113
- }
114
- function makeUid() {
115
- const now = new Date();
116
- const pad = (value) => String(value).padStart(2, '0');
117
- const stamp = `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}`
118
- + `${pad(now.getHours())}${pad(now.getMinutes())}`;
119
- const rand = Math.random().toString(36).slice(2, 6);
120
- return `card-${stamp}-${rand}`;
121
- }
122
- function readJsonObject(path, label) {
123
- let raw;
124
- try {
125
- raw = readFileSync(path, 'utf8').replace(/^\uFEFF/u, '');
126
- }
127
- catch (error) {
128
- const message = error instanceof Error ? error.message : String(error);
129
- throw contractValidationError('data_unreadable', `无法读取${label} JSON:${message}`);
130
- }
131
- let parsed;
132
- try {
133
- parsed = JSON.parse(raw);
134
- }
135
- catch (error) {
136
- const message = error instanceof Error ? error.message : String(error);
137
- throw contractValidationError('data_unreadable', `无法解析${label} JSON:${message}`);
138
- }
139
- if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
140
- throw contractValidationError('data_unreadable', `${label}必须是 JSON 对象`);
141
- }
142
- return parsed;
143
- }
144
- export const contractCardOperations = [
145
- {
146
- name: 'contract.card.render',
147
- async execute(input, context) {
148
- const dataPath = resolve(requireNonEmptyString(input.data, 'data', 4096).trim());
149
- const outPath = resolve(requireNonEmptyString(input.out, 'out', 4096).trim());
150
- const data = readJsonObject(dataPath, '卡片数据');
151
- const cards = Array.isArray(data.cards) ? data.cards : [];
152
- if (cards.length === 0) {
153
- throw contractValidationError('cards_required', '卡片数据必须包含非空的 cards 数组');
154
- }
155
- let summaryHtml = '';
156
- if (input.summary) {
157
- const summaryPath = resolve(requireNonEmptyString(input.summary, 'summary', 4096).trim());
158
- summaryHtml = renderSummaryHtml(readJsonObject(summaryPath, '摘要数据'));
159
- }
160
- let baseUrl = input.baseUrl ? requireNonEmptyString(input.baseUrl, 'baseUrl', 2048).trim() : '';
161
- if (!baseUrl) {
162
- const session = await context.host.getSession();
163
- baseUrl = String(session?.baseUrl ?? '').trim();
164
- }
165
- baseUrl = baseUrl.replace(/\/+$/u, '');
166
- if (!baseUrl) {
167
- throw contractValidationError('base_url_missing', '无法确定当前 E10 环境地址,请显式传入 baseUrl');
168
- }
169
- const uid = typeof data.id === 'string' && data.id.trim() ? data.id.trim() : makeUid();
170
- const hint = typeof data.hint === 'string' ? data.hint.trim() : '';
171
- const title = typeof data.title === 'string' && data.title.trim() ? data.title.trim() : '可执行操作';
172
- const width = typeof data.width === 'number' && data.width > 0 ? data.width : CARD_PANEL_WIDTH;
173
- const cardsJson = JSON.stringify(cards);
174
- const script = CARD_SCRIPT.replace(/__UID__/gu, uid);
175
- const parts = [];
176
- parts.push(`<section id='${escAttr(uid)}' style='padding:4px 2px;font-family:Microsoft YaHei,PingFang SC,sans-serif'>`);
177
- if (hint) {
178
- parts.push(`<div style='background:#eef4ff;border:1px solid #d6e4ff;border-radius:8px;padding:10px 12px;margin-bottom:12px;font-size:12.5px;color:#1d39c4;line-height:1.6'>${escAttr(hint)}</div>`);
179
- }
180
- parts.push(`<p data-status aria-live='polite' style='margin:8px 0 0;color:#b45309;font-size:12px;line-height:1.6'></p>`);
181
- parts.push(`<textarea data-cards style='display:none'>${textareaRaw(cardsJson)}</textarea>`);
182
- if (summaryHtml) {
183
- parts.push(`<textarea data-summary style='display:none'>${textareaRaw(summaryHtml)}</textarea>`);
184
- }
185
- parts.push(`</section><script>${script}</script>`);
186
- const html = parts.join('');
187
- writeFileSync(outPath, html, 'utf8');
188
- const bytes = Buffer.byteLength(html, 'utf8');
189
- let browsertoolPath = '';
190
- if (input.browsertool) {
191
- browsertoolPath = resolve(requireNonEmptyString(input.browsertool, 'browsertool', 4096).trim());
192
- const browsertool = {
193
- version: 1,
194
- callId: typeof data.callId === 'string' && data.callId.trim() ? data.callId.trim() : `${uid}-01`,
195
- toolId: 'fill_form',
196
- arguments: {
197
- type: 'e10',
198
- title,
199
- src: `${baseUrl}/sp/contract/xiaoe-custom-page`,
200
- width,
201
- sdkRenderType: 'inline',
202
- sdkOptions: {
203
- compName: 'ui.CorsComponent',
204
- routerType: 'MemoryRouter',
205
- routerProps_pc: { initialEntries: ['/sp/contract/xiaoe-custom-page'] },
206
- params_pc: {
207
- app: '@weapp/contract',
208
- compName: 'xiaoeCustomPage',
209
- customParams: { html },
210
- },
211
- },
212
- },
213
- };
214
- writeFileSync(browsertoolPath, JSON.stringify(browsertool), 'utf8');
215
- }
216
- return {
217
- status: 'COMPLETE',
218
- data: {
219
- output: outPath,
220
- fileName: basename(outPath),
221
- fileSize: bytes,
222
- uid,
223
- cardCount: cards.length,
224
- cardIds: cards.map((card) => String(card?.id ?? '')),
225
- summaryEmbedded: Boolean(summaryHtml),
226
- browsertool: browsertoolPath || undefined,
227
- note: 'HTML 与 browsertool JSON 均由 CLI 生成;模型不要再手写卡片 HTML',
228
- },
229
- };
230
- },
231
- },
232
- ];