weaver-work-cli 0.1.62 → 0.1.64

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 (299) hide show
  1. package/dist/chunks/{archive-S2VKZWQ3.js → archive-WUZKAEZ6.js} +5 -4
  2. package/dist/chunks/{archive-oa-HEDSIUUY.js → archive-oa-PN46RTI2.js} +5 -4
  3. package/dist/chunks/{asset-HYH4W357.js → asset-ZPC5VWZM.js} +5 -4
  4. package/dist/chunks/{asset-idle-N7REBNGL.js → asset-idle-DHGP3NYY.js} +5 -4
  5. package/dist/chunks/{attachment-content-VYYA75FR.js → attachment-content-JQDW3BIB.js} +3 -3
  6. package/dist/chunks/{blog-SLMZZICV.js → blog-JC47AIXK.js} +5 -4
  7. package/dist/chunks/{caizhilian-RV43KKBT.js → caizhilian-IKIHM77A.js} +5 -5
  8. package/dist/chunks/{calendar-DMVZ4OLY.js → calendar-GZTSJ57Y.js} +5 -4
  9. package/dist/chunks/{chunk-H6YOMI3U.js → chunk-26FCCU5O.js} +5 -3
  10. package/dist/chunks/{chunk-E5YD5JWR.js → chunk-3PCXBG4H.js} +1 -1
  11. package/dist/chunks/{chunk-UBRWONP4.js → chunk-3W5NMGDS.js} +2 -2
  12. package/dist/chunks/{chunk-DTCQFTHW.js → chunk-4AFWOGOV.js} +3 -3
  13. package/dist/chunks/{chunk-VNYOUAWV.js → chunk-5QQKLR6H.js} +11 -11
  14. package/dist/chunks/{chunk-BQYX2UX5.js → chunk-6T5X6YWX.js} +5 -3
  15. package/dist/chunks/{chunk-KXJA42EA.js → chunk-AFZTMYGC.js} +1 -1
  16. package/dist/chunks/{chunk-YI2YMW5N.js → chunk-AGSO3PIK.js} +2 -2
  17. package/dist/chunks/{chunk-IW7A2IQY.js → chunk-C4YQJFZV.js} +43 -15
  18. package/dist/chunks/{chunk-WIWDVETN.js → chunk-FDBAFANU.js} +76 -76
  19. package/dist/chunks/{chunk-NRYDJN4J.js → chunk-FJUOUSV3.js} +89 -8
  20. package/dist/chunks/{chunk-EGANE35F.js → chunk-HLT6B26P.js} +1 -1
  21. package/dist/chunks/{chunk-P6TXQK75.js → chunk-HWA2A25Y.js} +5 -3
  22. package/dist/chunks/{chunk-T2KVJFWJ.js → chunk-I3MOFD6Q.js} +4 -7
  23. package/dist/chunks/chunk-IN6NXQ26.js +680 -0
  24. package/dist/chunks/{chunk-UBGWIXU3.js → chunk-INVYKG4I.js} +140 -45
  25. package/dist/chunks/{chunk-QBDXJS2W.js → chunk-K7QKQRSL.js} +168 -62
  26. package/dist/chunks/{chunk-BIA2NKUG.js → chunk-KDFEHDIB.js} +5 -5
  27. package/dist/chunks/{chunk-ILALC2N6.js → chunk-KYDXWYFB.js} +1 -1
  28. package/dist/chunks/{chunk-V2LASYKO.js → chunk-Q6D6PSMH.js} +30 -24
  29. package/dist/chunks/{chunk-UQFPF4EX.js → chunk-RMOH2GMF.js} +2 -2
  30. package/dist/chunks/{chunk-VBFBMM7G.js → chunk-SCMHG23G.js} +387 -70
  31. package/dist/chunks/chunk-TJN4PIYO.js +47 -0
  32. package/dist/chunks/{chunk-JFAWZX53.js → chunk-UPVAQJKS.js} +282 -131
  33. package/dist/chunks/{chunk-KY3R42RS.js → chunk-VLY5RTVO.js} +5 -3
  34. package/dist/chunks/{chunk-TEZHIB6T.js → chunk-WSHIOSGM.js} +5 -3
  35. package/dist/chunks/{chunk-6XSSAUNW.js → chunk-XHSEK2VM.js} +48 -12
  36. package/dist/chunks/{chunk-XT77MP54.js → chunk-YTFNMQO4.js} +410 -24
  37. package/dist/chunks/{conflict-GFJRS6I7.js → conflict-UUC7AFUI.js} +2 -2
  38. package/dist/chunks/{contract-U3ZGNRWB.js → contract-INMS7SYQ.js} +3051 -4497
  39. package/dist/chunks/{cowork-EX7PKIDK.js → cowork-34CBYVQP.js} +5 -4
  40. package/dist/chunks/{create-flow-EJZD434E.js → create-flow-YOR4QTAJ.js} +18 -6
  41. package/dist/chunks/{data-FOODGAMF.js → data-QKWI5325.js} +14 -3
  42. package/dist/chunks/{ebuilder-form-I2EOKODG.js → ebuilder-form-ZONRROK4.js} +4 -4
  43. package/dist/chunks/{ehr-TE4RFNID.js → ehr-2CONM7R6.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-S2ENJ6GZ.js} +3 -3
  46. package/dist/chunks/{env-TID5NFR6.js → env-ZSAXU5PJ.js} +2 -2
  47. package/dist/chunks/{esb-7L6MHYLB.js → esb-FQASCY2H.js} +8 -8
  48. package/dist/chunks/{factory-OG7BPMH5.js → factory-N76QQA53.js} +1 -1
  49. package/dist/chunks/{fna-6V2ENR3Y.js → fna-FCLVIWAS.js} +5 -4
  50. package/dist/chunks/{group-chat-5DKPWIHL.js → group-chat-UM665WDZ.js} +3 -3
  51. package/dist/chunks/{host-VTPAWDZV.js → host-2ED2KC4X.js} +4 -4
  52. package/dist/chunks/{host-TJ5VVHM7.js → host-2UYZEY2V.js} +4 -4
  53. package/dist/chunks/{host-3DLYA54R.js → host-46NYKDQP.js} +4 -4
  54. package/dist/chunks/{host-OGBHL75G.js → host-7IPZKIM4.js} +4 -4
  55. package/dist/chunks/{host-GOJHHTPY.js → host-P7G22WNM.js} +4 -4
  56. package/dist/chunks/{host-ONZC6AE7.js → host-XLCBLNJD.js} +4 -4
  57. package/dist/chunks/{hrm-2N7NFQDZ.js → hrm-XKL27NX2.js} +6 -6
  58. package/dist/chunks/{im-XCH47ZBN.js → im-NDYIMASG.js} +4 -4
  59. package/dist/chunks/{invoice-5KJ7T774.js → invoice-MOGNB6HN.js} +4 -4
  60. package/dist/chunks/{jiuchuanhui-PL6DRPBM.js → jiuchuanhui-3T5X7SB7.js} +5 -4
  61. package/dist/chunks/{lazy-dispatch-UATEN7H7.js → lazy-dispatch-4WOIL3ZQ.js} +5 -5
  62. package/dist/chunks/{mail-Q7Z4CQ4D.js → mail-P7VMUKQW.js} +5 -4
  63. package/dist/chunks/{meeting-5E3BNARL.js → meeting-MMTYDHXA.js} +16 -15
  64. package/dist/chunks/{minute-doc-NXRE5C77.js → minute-doc-LCSBWGJ3.js} +4 -4
  65. package/dist/chunks/{okr-3O3XNYOK.js → okr-VZXRQGS4.js} +5 -4
  66. package/dist/chunks/{operations-EZWG72FH.js → operations-MI2BSKZX.js} +5 -5
  67. package/dist/chunks/{performance-Y7CPNSOR.js → performance-OPEQNW7Y.js} +873 -17
  68. package/dist/chunks/{plan-BLGPZF5M.js → plan-TJAS4N5X.js} +5 -4
  69. package/dist/chunks/{project-6MZMLJMP.js → project-CYBGU6K6.js} +5 -4
  70. package/dist/chunks/{reception-F2VT2X52.js → reception-3FT2F66K.js} +3 -3
  71. package/dist/chunks/{recruit-stage-4ETIBMIW.js → recruit-stage-WPGB5BDJ.js} +654 -336
  72. package/dist/chunks/{registry-3FYSWV3U.js → registry-BAWCWV4D.js} +3 -3
  73. package/dist/chunks/{registry-I4DVPDMU.js → registry-FNI5E76J.js} +12 -12
  74. package/dist/chunks/{registry-3UGIWH53.js → registry-JMNOXRST.js} +2 -2
  75. package/dist/chunks/{registry-7RS74TCK.js → registry-QRMXRSCT.js} +5 -5
  76. package/dist/chunks/{room-recommend-GWCVKCXW.js → room-recommend-I7QQRHEL.js} +4 -4
  77. package/dist/chunks/{schedule-6AN63MJQ.js → schedule-3P7EWGNZ.js} +4 -4
  78. package/dist/chunks/{smart-extract-SR4SJJKN.js → smart-extract-FOBSVNYW.js} +3 -3
  79. package/dist/chunks/{workflow-KF7FA2UQ.js → workflow-U2KKTVQY.js} +10 -7
  80. package/dist/index.js +34 -34
  81. package/dist/internal/e10/auth/commands.js +203 -44
  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/error-actions.js +112 -0
  88. package/dist/shortcuts/contract/errors.js +9 -1
  89. package/dist/shortcuts/contract/index.js +14 -39
  90. package/dist/shortcuts/contract/manifest.js +130 -274
  91. package/dist/shortcuts/contract/operations/compare-report.js +437 -0
  92. package/dist/shortcuts/contract/operations/compare.js +2 -0
  93. package/dist/shortcuts/contract/operations/docx-slots.js +112 -5
  94. package/dist/shortcuts/contract/operations/docx-verify.js +2 -70
  95. package/dist/shortcuts/contract/operations/elements-build.js +82 -56
  96. package/dist/shortcuts/contract/operations/elements-spec.js +140 -3
  97. package/dist/shortcuts/contract/operations/first-screen.js +96 -207
  98. package/dist/shortcuts/contract/operations/flow.js +19 -1
  99. package/dist/shortcuts/contract/operations/{card-ebdf-list.js → ledger-card.js} +123 -27
  100. package/dist/shortcuts/contract/operations/ledger.js +343 -1
  101. package/dist/shortcuts/contract/operations/metrics.js +93 -0
  102. package/dist/shortcuts/contract/operations/modeltext.js +3 -3
  103. package/dist/shortcuts/contract/operations/money.js +90 -0
  104. package/dist/shortcuts/contract/operations/page.js +8 -4
  105. package/dist/shortcuts/contract/operations/performance.js +53 -0
  106. package/dist/shortcuts/contract/operations/placeholder-scan.js +104 -0
  107. package/dist/shortcuts/contract/operations/quote-recognize.js +326 -0
  108. package/dist/shortcuts/contract/operations/quote-ref.js +179 -0
  109. package/dist/shortcuts/contract/operations/quote-submit.js +281 -0
  110. package/dist/shortcuts/contract/operations/quote.js +66 -12
  111. package/dist/shortcuts/contract/operations/recommend.js +42 -1
  112. package/dist/shortcuts/contract/operations/registry.js +16 -23
  113. package/dist/shortcuts/contract/operations/{card-risk-report.js → review-report.js} +24 -114
  114. package/dist/shortcuts/contract/operations/review.js +33 -167
  115. package/dist/shortcuts/contract/operations/save-recognize.js +173 -43
  116. package/dist/shortcuts/contract/operations/solutions-spec.js +79 -0
  117. package/dist/shortcuts/contract/operations/triage.js +68 -15
  118. package/dist/shortcuts/contract/operations/{template.js → type-clause-read.js} +10 -25
  119. package/dist/shortcuts/contract/operations/upload.js +17 -11
  120. package/dist/shortcuts/contract/prewarm-cache.js +6 -2
  121. package/dist/shortcuts/contract/prewarm.js +33 -23
  122. package/dist/shortcuts/contract/recommend-cache.js +191 -0
  123. package/dist/shortcuts/data/operations/shared.js +14 -1
  124. package/dist/shortcuts/ehr/operations/recruit-interview-overview.js +85 -62
  125. package/dist/shortcuts/ehr/operations/recruit-position.js +21 -13
  126. package/dist/shortcuts/ehr/operations/recruit-short-cache.js +59 -0
  127. package/dist/shortcuts/ehr/operations/recruit-tag.js +17 -11
  128. package/dist/shortcuts/ehr/operations/recruit-write.js +118 -70
  129. package/dist/shortcuts/ehr/operations/recruit.js +338 -121
  130. package/dist/shortcuts/hrm/operations/employee.js +64 -17
  131. package/dist/shortcuts/hrm/operations/resolve.js +419 -369
  132. package/dist/shortcuts/im/host.js +38 -22
  133. package/dist/shortcuts/meeting/operations/eb/conflict.js +60 -2
  134. package/dist/shortcuts/meeting/operations/eb/create-flow.js +138 -15
  135. package/dist/shortcuts/meeting/operations/eb/create-form-link.js +380 -0
  136. package/dist/shortcuts/meeting/operations/eb/index.js +2 -0
  137. package/dist/shortcuts/meeting/operations/eb/room-recommend.js +1 -3
  138. package/dist/shortcuts/performance/flow-utils.js +363 -0
  139. package/dist/shortcuts/performance/manifest.js +2 -2
  140. package/dist/shortcuts/performance/operations/flow-detail.js +85 -0
  141. package/dist/shortcuts/performance/operations/flow-list.js +213 -0
  142. package/dist/shortcuts/performance/operations/flow-score.js +241 -0
  143. package/dist/shortcuts/performance/operations/registry.js +6 -0
  144. package/dist/shortcuts/recruit-stage/batch-store.js +44 -0
  145. package/dist/shortcuts/recruit-stage/context.js +75 -9
  146. package/dist/shortcuts/recruit-stage/manifest.js +1 -1
  147. package/dist/shortcuts/recruit-stage/operations/jd-create.js +33 -22
  148. package/dist/shortcuts/recruit-stage/operations/list.js +187 -37
  149. package/dist/shortcuts/recruit-stage/operations/registry.js +2 -0
  150. package/dist/shortcuts/recruit-stage/operations/resume-import.js +231 -313
  151. package/dist/shortcuts/recruit-stage/operations/search.js +5 -5
  152. package/dist/shortcuts/recruit-stage/operations/tag.js +286 -0
  153. package/dist/shortcuts/workflow/endpoints.js +2 -0
  154. package/dist/shortcuts/workflow/operations/form.js +12 -15
  155. package/dist/shortcuts/workflow/operations/read.js +8 -8
  156. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoListRows.js +3 -2
  157. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.collect.js +7 -6
  158. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.core.js +4 -3
  159. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.group.js +1 -0
  160. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.js +33 -6
  161. package/dist/shortcuts/workflow/operations/todoSmartConvert/todoSmartConvert.prepareQuery.js +153 -0
  162. package/dist/shortcuts/workflow/operations/todoSmartConvert/workflowClarification.js +232 -0
  163. package/dist/shortcuts/workflow/operations.js +5 -0
  164. package/docs/contract.md +2 -2
  165. package/docs/e10-auth.md +55 -2
  166. package/docs/ehr.md +1 -1
  167. package/package.json +1 -1
  168. package/skills/weaver-e10-hrm/SKILL.md +3 -3
  169. package/skills/weaver-e10-hrm/references/employee.md +13 -2
  170. package/skills/weaver-e10-jinchengda/SKILL.md +283 -345
  171. package/skills/weaver-e10-jinchengda/references/contract-agent-entry.md +7 -14
  172. package/skills/weaver-e10-jinchengda/references/contract-ai-assistant.md +21 -12
  173. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +126 -202
  174. package/skills/weaver-e10-jinchengda/references/contract-clause-insert.md +13 -5
  175. package/skills/weaver-e10-jinchengda/references/contract-clause-library-crud.md +28 -20
  176. package/skills/weaver-e10-jinchengda/references/contract-clause-recommender.md +12 -17
  177. package/skills/weaver-e10-jinchengda/references/contract-clause-reference-save.md +7 -13
  178. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +47 -16
  179. package/skills/weaver-e10-jinchengda/references/contract-compare-report-template.html +10 -18
  180. package/skills/weaver-e10-jinchengda/references/contract-compare-report.md +19 -18
  181. package/skills/weaver-e10-jinchengda/references/contract-credit-page.md +114 -61
  182. package/skills/weaver-e10-jinchengda/references/contract-disabled-capabilities.md +8 -2
  183. package/skills/weaver-e10-jinchengda/references/contract-doc-compare.md +78 -112
  184. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +67 -333
  185. package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +18 -15
  186. package/skills/weaver-e10-jinchengda/references/contract-element-save-record.md +80 -84
  187. package/skills/weaver-e10-jinchengda/references/contract-execution-rules.md +38 -34
  188. package/skills/weaver-e10-jinchengda/references/contract-field-extract-new-customer.md +132 -47
  189. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +108 -217
  190. package/skills/weaver-e10-jinchengda/references/contract-flow-launch.md +14 -20
  191. package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +13 -7
  192. package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +86 -46
  193. package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +12 -10
  194. package/skills/weaver-e10-jinchengda/references/contract-modeltext-library.md +22 -14
  195. package/skills/weaver-e10-jinchengda/references/contract-multi-file.md +18 -18
  196. package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +27 -26
  197. package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +252 -0
  198. package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +15 -23
  199. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +290 -104
  200. package/skills/weaver-e10-jinchengda/references/contract-request-status.md +5 -12
  201. package/skills/weaver-e10-jinchengda/references/contract-request-write.md +12 -18
  202. package/skills/weaver-e10-jinchengda/references/contract-signing-subjects.md +11 -17
  203. package/skills/weaver-e10-jinchengda/references/contract-subject-create.md +5 -11
  204. package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +56 -7
  205. package/skills/weaver-e10-jinchengda/references/contract-type-fingerprints.md +12 -12
  206. package/skills/weaver-e10-jinchengda/references/contract-workflow-discovery.md +10 -16
  207. package/skills/weaver-e10-jinchengda/references/orchestration.md +33 -35
  208. package/skills/weaver-e10-jucailin/SKILL.md +6 -7
  209. package/skills/weaver-e10-jucailin/agents/openai.yaml +52 -0
  210. package/skills/weaver-e10-jucailin/references/recruit-interview-overview.md +8 -6
  211. package/skills/weaver-e10-jucailin/references/recruit-read.md +4 -0
  212. package/skills/weaver-e10-jucailin/references/recruit-screening-to-interview-sop.md +2 -2
  213. package/skills/weaver-e10-jucailin/references/recruit-write.md +4 -4
  214. package/skills/weaver-e10-meeting/SKILL.md +87 -534
  215. package/skills/weaver-e10-meeting/references/commands-table.md +61 -0
  216. package/skills/weaver-e10-meeting/references/create-commands.md +136 -0
  217. package/skills/weaver-e10-meeting/references/create-flow.md +9 -7
  218. package/skills/weaver-e10-meeting/references/create-guardrails.md +23 -17
  219. package/skills/weaver-e10-meeting/references/custom-fields.md +40 -0
  220. package/skills/weaver-e10-meeting/references/eb-contracts.md +60 -0
  221. package/skills/weaver-e10-meeting/references/invitation.md +69 -0
  222. package/skills/weaver-e10-meeting/references/meeting-eb.md +26 -26
  223. package/skills/weaver-e10-meeting/references/meeting-invitation.md +2 -2
  224. package/skills/weaver-e10-meeting/references/meeting-minute-file.md +2 -2
  225. package/skills/weaver-e10-meeting/references/meeting-verification.md +1 -1
  226. package/skills/weaver-e10-meeting/references/minutes-pipeline.md +119 -0
  227. package/skills/weaver-e10-meeting/references/pitfalls.md +1 -1
  228. package/skills/weaver-e10-meeting/references/room-recommend.md +88 -0
  229. package/skills/weaver-e10-performance/SKILL.md +45 -5
  230. package/skills/weaver-e10-performance/agents/openai.yaml +26 -2
  231. package/skills/weaver-e10-performance/references/flow-api.md +128 -0
  232. package/skills/weaver-e10-performance/references/flow-assess.md +149 -0
  233. package/skills/weaver-e10-recruit-stage/SKILL.md +317 -266
  234. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +22 -27
  235. package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +1 -1
  236. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +30 -27
  237. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +2 -6
  238. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +12 -10
  239. package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +2 -0
  240. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +23 -19
  241. package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +3 -1
  242. package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +18 -16
  243. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +25 -23
  244. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +10 -10
  245. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +2 -2
  246. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +11 -11
  247. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +150 -85
  248. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +14 -18
  249. package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +1 -1
  250. package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +173 -0
  251. package/skills/weaver-e10-recruit-stage/references/recruit-tag-taxonomy.json +76 -0
  252. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +3 -1
  253. package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +2 -2
  254. package/skills/weaver-e10-workflow/SKILL.md +49 -32
  255. package/skills/weaver-e10-workflow/references/todo-dialogue.md +67 -34
  256. package/skills/weaver-e10-workflow/references/todo-smart-convert.md +65 -51
  257. package/skills/weaver-e10-workflow/references/workflow-agent-entry.md +18 -11
  258. package/skills/weaver-e10-workflow/references/workflow-create.md +2 -2
  259. package/skills/weaver-e10-workflow/references/workflow-memory.md +19 -37
  260. package/skills/weaver-e10-workflow/references/workflow-query.md +25 -22
  261. package/skills/weaver-e10-workflow/references/workflow-view.md +1 -1
  262. package/skills/weaver-e10-workflow/tools/todo-summary.cjs +318 -110
  263. package/skills/weaver-e10-yimiaoban/SKILL.md +17 -14
  264. package/skills/weaver-e10-yimiaoban/references/person.md +1 -1
  265. package/skills/weaver-e10-yimiaoban/references/safety-boundaries.md +1 -1
  266. package/skills/weaver-e10-yimiaoban/references/source-manifest.json +9 -9
  267. package/dist/chunks/chunk-6QYNE6HE.js +0 -658
  268. package/dist/chunks/chunk-SHYQUBY3.js +0 -48
  269. package/dist/shortcuts/contract/operations/card-action.js +0 -1266
  270. package/dist/shortcuts/contract/operations/card-plan.js +0 -393
  271. package/dist/shortcuts/contract/operations/card.js +0 -232
  272. package/dist/shortcuts/contract/operations/compare-screen.js +0 -378
  273. package/dist/shortcuts/contract/operations/quote-to-contract.js +0 -495
  274. package/dist/shortcuts/contract/operations/quotescreen.js +0 -529
  275. package/dist/shortcuts/contract/operations/summary-validate.js +0 -293
  276. package/dist/shortcuts/contract/operations/summary.js +0 -187
  277. package/dist/shortcuts/ehr/recruit-stage/batch-store.js +0 -78
  278. package/dist/shortcuts/ehr/recruit-stage/context.js +0 -231
  279. package/dist/shortcuts/ehr/recruit-stage/continuation.js +0 -74
  280. package/dist/shortcuts/ehr/recruit-stage/errors.js +0 -65
  281. package/dist/shortcuts/ehr/recruit-stage/fs-scan.js +0 -165
  282. package/dist/shortcuts/ehr/recruit-stage/host.js +0 -109
  283. package/dist/shortcuts/ehr/recruit-stage/operations/interview-arrange.js +0 -1065
  284. package/dist/shortcuts/ehr/recruit-stage/operations/interview-feedback.js +0 -295
  285. package/dist/shortcuts/ehr/recruit-stage/operations/jd-create.js +0 -961
  286. package/dist/shortcuts/ehr/recruit-stage/operations/list.js +0 -431
  287. package/dist/shortcuts/ehr/recruit-stage/operations/registry.js +0 -50
  288. package/dist/shortcuts/ehr/recruit-stage/operations/resume-import.js +0 -1655
  289. package/dist/shortcuts/ehr/recruit-stage/operations/search.js +0 -158
  290. package/dist/shortcuts/ehr/recruit-stage/operations/types.js +0 -34
  291. package/dist/shortcuts/ehr/recruit-stage/runtime.js +0 -31
  292. package/dist/shortcuts/ehr/recruit-stage/school-tiers.json +0 -318
  293. package/dist/shortcuts/ehr/recruit-stage/shared.js +0 -887
  294. package/skills/weaver-e10-jinchengda/references/contract-action-card-template.html +0 -22
  295. package/skills/weaver-e10-jinchengda/references/contract-action-card.md +0 -554
  296. package/skills/weaver-e10-jinchengda/references/contract-action-engine.md +0 -279
  297. package/skills/weaver-e10-jinchengda/references/contract-card-render-internals.md +0 -483
  298. package/skills/weaver-e10-jinchengda/references/contract-template-selector.md +0 -46
  299. package/skills/weaver-e10-recruit-stage/lib/recruit-resume-photo.py +0 -194
@@ -1,293 +0,0 @@
1
- import { existsSync, readFileSync, statSync, writeFileSync } from 'node:fs';
2
- import { resolve } from 'node:path';
3
- import { contractValidationError } from '../errors.js';
4
- import { requireNonEmptyString } from './shared.js';
5
- /**
6
- * 合同摘要数据校验(本地,零依赖)。
7
- *
8
- * 迁移自 `scripts/validate_summary.py`(2026-11-12 第一批)。
9
- * 定位不变:合同措辞千变万化,要素与摘要由模型读正文后生成;
10
- * 本 operation 只做「校验兜底」,拦截已知会污染审批单的错误,**不替模型取值**。
11
- *
12
- * 输出与 Python 版逐字段一致(ok / merged / sectionCount / rowCount / fails / warns),
13
- * 以便新旧两版可直接 diff。
14
- *
15
- * 语义说明:信封 `ok=true` 表示「命令执行成功」;`data.ok=false` 表示「摘要校验不通过」。
16
- * 校验不通过不是执行失败,因此不抛错,把 fails / warns 完整交给调用方判断。
17
- */
18
- const SUPPORTED_TYPES = ['alert', 'reasons', 'grid', 'table', 'checks', 'list', 'next'];
19
- const REQUIRED_ROWS = ['合同类型', '合同总额', '甲方', '乙方'];
20
- const TAX_WORDS = ['增值税', '税率', '发票', '含税'];
21
- const RICHNESS_BASELINE = 14;
22
- /** Python `str()` 的常见分支。 */
23
- function pyStr(value) {
24
- if (value === null || value === undefined)
25
- return 'None';
26
- if (value === true)
27
- return 'True';
28
- if (value === false)
29
- return 'False';
30
- if (typeof value === 'string')
31
- return value;
32
- if (typeof value === 'number')
33
- return String(value);
34
- if (Array.isArray(value))
35
- return `[${value.map((item) => pyRepr(item)).join(', ')}]`;
36
- if (typeof value === 'object') {
37
- return `{${Object.entries(value)
38
- .map(([key, val]) => `${pyRepr(key)}: ${pyRepr(val)}`)
39
- .join(', ')}}`;
40
- }
41
- return String(value);
42
- }
43
- function pyRepr(value) {
44
- if (typeof value === 'string')
45
- return `'${value}'`;
46
- return pyStr(value);
47
- }
48
- /** Python `x or ""` 后取值。 */
49
- function textOr(value) {
50
- return value === null || value === undefined || value === false || value === '' || value === 0
51
- ? ''
52
- : pyStr(value);
53
- }
54
- function loadJson(path) {
55
- const raw = readFileSync(path, 'utf8').replace(/^\uFEFF/u, '');
56
- const parsed = JSON.parse(raw);
57
- if (!parsed || typeof parsed !== 'object') {
58
- throw new Error('JSON 根节点不是对象');
59
- }
60
- return parsed;
61
- }
62
- function isFile(path) {
63
- try {
64
- return existsSync(path) && statSync(path).isFile();
65
- }
66
- catch {
67
- return false;
68
- }
69
- }
70
- /** 把各 section 摊平成 (label, value) 列表,便于统一校验。 */
71
- function collectRows(summary) {
72
- const rows = [];
73
- const sections = Array.isArray(summary.sections) ? summary.sections : [];
74
- for (const section of sections) {
75
- if (!section || typeof section !== 'object' || Array.isArray(section))
76
- continue;
77
- const sec = section;
78
- const type = String(sec.type ?? '').toLowerCase();
79
- const sectionTitle = textOr(sec.title);
80
- if (type === 'table') {
81
- const items = Array.isArray(sec.rows) ? sec.rows : [];
82
- for (const row of items) {
83
- if (Array.isArray(row) && row.length >= 2) {
84
- rows.push({ label: pyStr(row[0]), value: pyStr(row[1]), section: sectionTitle });
85
- }
86
- }
87
- }
88
- else if (type === 'grid' || type === 'checks') {
89
- const items = Array.isArray(sec.items) ? sec.items : [];
90
- for (const item of items) {
91
- if (item && typeof item === 'object' && !Array.isArray(item)) {
92
- const record = item;
93
- rows.push({
94
- label: textOr(record.label),
95
- value: textOr(record.value),
96
- section: sectionTitle,
97
- });
98
- }
99
- }
100
- }
101
- else if (type === 'list') {
102
- const items = Array.isArray(sec.items) ? sec.items : [];
103
- for (const item of items) {
104
- rows.push({ label: '', value: pyStr(item), section: sectionTitle });
105
- }
106
- }
107
- }
108
- return rows;
109
- }
110
- function textBlob(summary, rows) {
111
- const parts = [textOr(summary.title), textOr(summary.subtitle)];
112
- for (const row of rows)
113
- parts.push(row.value);
114
- return parts.join('\n');
115
- }
116
- /** 去掉千分位逗号、空白与中文逗号,供金额回查使用。 */
117
- function flatten(text) {
118
- return text.replace(/[,\s,]/gu, '');
119
- }
120
- export function validateSummaryData(summary, text, triagePath, elementsPath, outSummaryPath) {
121
- const fails = [];
122
- const warns = [];
123
- const rows = collectRows(summary);
124
- const sections = Array.isArray(summary.sections) ? summary.sections : [];
125
- // S1 结构
126
- if (!summary.title)
127
- fails.push('S1 缺少 title');
128
- if (!Array.isArray(summary.sections) || summary.sections.length === 0) {
129
- fails.push('S1 sections 为空或不是数组');
130
- }
131
- // S2 / S3 / S4
132
- sections.forEach((section, index) => {
133
- const sec = (section && typeof section === 'object' ? section : {});
134
- const type = String(sec.type ?? '').toLowerCase();
135
- const name = textOr(sec.title) || `第${index + 1}节`;
136
- if (!SUPPORTED_TYPES.includes(type)) {
137
- fails.push(`S2 [${name}] 未知 type=${type}(支持 ${[...SUPPORTED_TYPES].sort().join(' / ')})`);
138
- }
139
- if (type === 'grid') {
140
- fails.push(`S3 [${name}] 使用 grid:CLI 渲染器只输出空容器,内容会整段丢失;请改 table`);
141
- }
142
- if (type === 'alert' || type === 'checks') {
143
- warns.push(`S4 [${name}] 使用 ${type}:摘要只做客观呈现,风险提示应归「合同预审」`);
144
- }
145
- });
146
- // S5 丰富度
147
- if (rows.length < RICHNESS_BASELINE) {
148
- warns.push(`S5 要素仅 ${rows.length} 行,低于文档 §5.2 的 ${RICHNESS_BASELINE} 行基线`);
149
- }
150
- // S6 金额回查
151
- if (text) {
152
- const flatSource = flatten(text);
153
- for (const row of rows) {
154
- const numbers = flatten(row.value).match(/[0-9]{4,}(?:\.[0-9]{1,2})?/gu) ?? [];
155
- for (const number of numbers) {
156
- if (!flatSource.includes(number)) {
157
- warns.push(`S6 [${row.label || row.section}] 金额 ${number} 未在原文中找到,疑似换算或编造`);
158
- }
159
- }
160
- }
161
- }
162
- // S7 / S8 付款比例
163
- for (const row of rows) {
164
- const joined = `${row.label} ${row.value}`;
165
- const isPayRow = row.label.includes('付款')
166
- || row.label.includes('阶段')
167
- || (row.label.includes('比例') && !row.label.includes('税'));
168
- const percents = joined.match(/(\d{1,3})\s*%/gu) ?? [];
169
- for (const raw of percents) {
170
- const digit = /(\d{1,3})/u.exec(raw);
171
- const value = digit ? Number.parseInt(digit[1], 10) : 0;
172
- if (value > 100) {
173
- fails.push(`S7 [${row.label || row.section}] 比例 ${value}% 超过 100%`);
174
- }
175
- // 仅在「付款类行」且该行标签不是税率/发票口径时告警,
176
- // 避免「按付款进度开具 13% 增值税发票」这类正常表述被误报
177
- const hasTaxWord = TAX_WORDS.some((word) => joined.includes(word));
178
- const labelSaysTax = row.label.includes('税') || row.label.includes('发票');
179
- if (isPayRow && hasTaxWord && !labelSaysTax) {
180
- warns.push(`S8 [${row.label || row.section}] 付款与税率混写(${value}%),确认不是把税率当付款比例`);
181
- }
182
- }
183
- }
184
- // S9 必填行(标签列宽同义词;合同总额额外允许在内容列命中)
185
- const labelsBlob = rows.map((row) => row.label).join(' ');
186
- const valuesBlob = rows.map((row) => row.value).join(' ');
187
- const labelAlternatives = {
188
- 合同类型: ['合同类型', '合同类别', '类型'],
189
- 合同总额: ['合同总额', '合同标的总额', '标的总额', '总额', '合同总价', '合同价款'],
190
- 甲方: ['甲方', '需方', '买方'],
191
- 乙方: ['乙方', '供方', '卖方'],
192
- };
193
- const valueAlternatives = {
194
- 合同总额: ['合同总额', '合同标的总额', '标的总额', '合同总价', '合同价款'],
195
- };
196
- for (const key of REQUIRED_ROWS) {
197
- if ((labelAlternatives[key] ?? [key]).some((word) => labelsBlob.includes(word)))
198
- continue;
199
- if ((valueAlternatives[key] ?? []).some((word) => valuesBlob.includes(word)))
200
- continue;
201
- warns.push(`S9 缺少必填行「${key}」`);
202
- }
203
- // S10 交付地点口径
204
- let place = '';
205
- let signPlace = '';
206
- for (const row of rows) {
207
- if (row.label.includes('交付') && row.label.includes('地点'))
208
- place = row.value;
209
- if (row.label.includes('签订') && row.label.includes('地点'))
210
- signPlace = row.value;
211
- }
212
- if (place && signPlace && place.trim() === signPlace.trim()) {
213
- warns.push(`S10 「交付地点」与「签订地点」取值相同(${place}),确认是否用签订地点顶替`);
214
- }
215
- // elements 合流
216
- let merged = false;
217
- if (triagePath && elementsPath) {
218
- if (!isFile(triagePath)) {
219
- warns.push(`合流跳过:triage.json 不存在 ${triagePath}`);
220
- }
221
- else if (!isFile(elementsPath)) {
222
- warns.push(`合流跳过:elements.json 不存在 ${elementsPath}`);
223
- }
224
- else {
225
- try {
226
- const triage = loadJson(triagePath);
227
- const elements = loadJson(elementsPath);
228
- triage.elements = elements;
229
- triage.elementsSource = 'ai_semantic';
230
- writeFileSync(triagePath, JSON.stringify(triage, null, 2), 'utf8');
231
- merged = true;
232
- }
233
- catch (error) {
234
- const message = error instanceof Error ? error.message : String(error);
235
- warns.push(`合流失败:${message}`);
236
- }
237
- }
238
- }
239
- // 落地
240
- let outSummary;
241
- if (outSummaryPath && fails.length === 0) {
242
- writeFileSync(outSummaryPath, JSON.stringify(summary, null, 2), 'utf8');
243
- outSummary = outSummaryPath;
244
- }
245
- return {
246
- ok: fails.length === 0,
247
- merged,
248
- sectionCount: sections.length,
249
- rowCount: rows.length,
250
- fails,
251
- warns,
252
- ...(outSummary ? { outSummary } : {}),
253
- };
254
- }
255
- export const contractSummaryValidateOperation = {
256
- name: 'contract.summary.validate',
257
- async execute(input) {
258
- const summaryPath = resolve(requireNonEmptyString(input.summary, 'summary', 4096).trim());
259
- if (!isFile(summaryPath)) {
260
- throw contractValidationError('summary_not_found', `摘要数据文件不存在:${summaryPath}`);
261
- }
262
- let summary;
263
- try {
264
- summary = loadJson(summaryPath);
265
- }
266
- catch (error) {
267
- const message = error instanceof Error ? error.message : String(error);
268
- throw contractValidationError('summary_parse_fail', `摘要数据不是合法 JSON 对象:${message}`);
269
- }
270
- const textPath = typeof input.text === 'string' && input.text.trim() ? resolve(input.text.trim()) : '';
271
- const triagePath = typeof input.triage === 'string' && input.triage.trim() ? resolve(input.triage.trim()) : '';
272
- const elementsPath = typeof input.elements === 'string' && input.elements.trim() ? resolve(input.elements.trim()) : '';
273
- const outSummaryPath = typeof input.outSummary === 'string' && input.outSummary.trim()
274
- ? resolve(input.outSummary.trim())
275
- : '';
276
- let text = '';
277
- if (textPath && isFile(textPath)) {
278
- text = readFileSync(textPath, 'utf8');
279
- }
280
- const result = validateSummaryData(summary, text, triagePath, elementsPath, outSummaryPath);
281
- const strict = input.strict === true;
282
- return {
283
- status: 'COMPLETE',
284
- data: {
285
- ...result,
286
- strict,
287
- pass: result.ok && !(strict && result.warns.length > 0),
288
- note: '信封 ok 表示命令执行成功;data.ok 表示摘要校验通过。FAIL 时不得渲染摘要',
289
- },
290
- };
291
- },
292
- };
293
- export const contractSummaryValidateOperations = [contractSummaryValidateOperation];
@@ -1,187 +0,0 @@
1
- import { readFileSync, writeFileSync } from 'node:fs';
2
- import { basename, resolve } from 'node:path';
3
- import { contractValidationError } from '../errors.js';
4
- import { requireNonEmptyString } from './shared.js';
5
- /**
6
- * 合同摘要 HTML 渲染(本地,零依赖)。
7
- *
8
- * 定位:模型只产出紧凑的数据 JSON(约 1~2 KB),HTML/CSS 由本 operation 生成。
9
- * 手写 7 KB HTML 是首屏最大耗时来源,渲染下沉到 CLI 后模型输出量减少约 3/4。
10
- */
11
- const CSS = [
12
- 'body{margin:0;padding:24px 20px;background:#f5f7fa;color:#1f2430;',
13
- 'font-family:"Microsoft YaHei","PingFang SC",sans-serif;font-size:14px;line-height:1.65}',
14
- '.w{max-width:1040px;margin:0 auto}',
15
- '.hd,.s{background:#fff;border:1px solid #e2e8f0;border-radius:8px;padding:18px 20px;margin-bottom:14px}',
16
- '.bd{display:inline-block;padding:3px 14px;border-radius:16px;background:#1d6fd8;color:#fff;',
17
- 'font-size:13px;font-weight:700}',
18
- 'h1{font-size:19px;margin:10px 0 6px;line-height:1.4}',
19
- '.mt{color:#5b6577;font-size:12px}',
20
- 'h2{font-size:15px;margin:0 0 12px;padding-left:9px;border-left:4px solid #1d6fd8}',
21
- 'g{display:grid;grid-template-columns:150px 1fr;border-top:1px solid #e6ebf2}',
22
- 'g>div{padding:8px 10px;border-bottom:1px solid #e6ebf2}',
23
- 'g>.k{background:#f8fafc;color:#46506a;font-weight:600}',
24
- 'ul{margin:0;padding-left:20px}li{margin-bottom:4px}',
25
- 'table{border-collapse:collapse;width:100%;font-size:13px}',
26
- 'th,td{border:1px solid #dde3ec;padding:7px 9px}',
27
- 'th{background:#eef3fb;text-align:left;white-space:nowrap}',
28
- 'td.n{text-align:right}',
29
- 'tr.t td{background:#f7f9fc;font-weight:700}',
30
- '.na{color:#98a2b3}',
31
- '.wn{background:#fff8e6;border:1px solid #f2d48a;border-radius:6px;padding:10px 12px;margin-bottom:10px}',
32
- '.er{background:#fdeceb;border:1px solid #f0b4ae;border-radius:6px;padding:10px 12px;margin-bottom:10px}',
33
- '.ok{background:#f1f9f2;border:1px solid #b7dfc0;border-radius:6px;padding:10px 12px;margin-bottom:10px}',
34
- '.nt{color:#7a8497;font-size:12px;margin:6px 0 0}',
35
- ].join('');
36
- function esc(value) {
37
- return String(value ?? '')
38
- .replace(/&/gu, '&amp;')
39
- .replace(/</gu, '&lt;')
40
- .replace(/>/gu, '&gt;');
41
- }
42
- function asArray(value) {
43
- return Array.isArray(value) ? value : [];
44
- }
45
- function sectionHtml(section) {
46
- const type = String(section.type ?? '');
47
- const title = section.title ? `<h2>${esc(section.title)}</h2>` : '';
48
- if (type === 'alert') {
49
- const level = section.level === 'error' ? 'er' : 'wn';
50
- return `<div class="s">${title}<div class="${level}">${esc(section.text)}</div></div>`;
51
- }
52
- const parts = [`<div class="s">${title}`];
53
- if (type === 'reasons') {
54
- if (section.lead)
55
- parts.push(`<p style="margin:0 0 8px">${esc(section.lead)}</p>`);
56
- const items = asArray(section.items);
57
- if (items.length) {
58
- parts.push(`<ul>${items.map((item) => `<li>${esc(item)}</li>`).join('')}</ul>`);
59
- }
60
- }
61
- else if (type === 'grid') {
62
- const rows = asArray(section.rows);
63
- parts.push('<g>');
64
- for (const row of rows) {
65
- const cells = asArray(row);
66
- parts.push(`<div class="k">${esc(cells[0])}</div><div>${esc(cells[1])}</div>`);
67
- }
68
- parts.push('</g>');
69
- }
70
- else if (type === 'table') {
71
- const headers = asArray(section.headers);
72
- const rightAlign = section.align === 'right';
73
- parts.push('<table><thead><tr>');
74
- parts.push(headers.map((header) => `<th>${esc(header)}</th>`).join(''));
75
- parts.push('</tr></thead><tbody>');
76
- for (const row of asArray(section.rows)) {
77
- const cells = asArray(row);
78
- parts.push('<tr>');
79
- cells.forEach((cell, index) => {
80
- const cls = rightAlign && index > 0 ? ' class="n"' : '';
81
- parts.push(`<td${cls}>${esc(cell)}</td>`);
82
- });
83
- parts.push('</tr>');
84
- }
85
- const total = asArray(section.total);
86
- if (total.length) {
87
- const span = Math.max(0, headers.length - 1);
88
- parts.push('<tr class="t">');
89
- if (span > 0)
90
- parts.push(`<td colspan="${span}">${esc(total[0])}</td>`);
91
- parts.push(`<td class="n">${esc(total[total.length - 1])}</td>`);
92
- parts.push('</tr>');
93
- }
94
- parts.push('</tbody></table>');
95
- if (section.note)
96
- parts.push(`<p class="nt">${esc(section.note)}</p>`);
97
- }
98
- else if (type === 'checks') {
99
- const ok = asArray(section.ok);
100
- const warn = asArray(section.warn);
101
- if (ok.length)
102
- parts.push(`<div class="ok">✅ ${esc(ok.join(';'))}</div>`);
103
- if (warn.length)
104
- parts.push(`<div class="wn">⚠ ${esc(warn.join(';'))}</div>`);
105
- }
106
- else if (type === 'list') {
107
- const items = asArray(section.items);
108
- if (items.length) {
109
- parts.push(`<ul>${items.map((item) => `<li>${esc(item)}</li>`).join('')}</ul>`);
110
- }
111
- if (section.note)
112
- parts.push(`<p class="nt">${esc(section.note)}</p>`);
113
- }
114
- else if (type === 'next') {
115
- parts.push(`<p style="margin:0">${esc(section.text)}</p>`);
116
- parts.push('<p class="nt">本摘要基于合同正文解析生成,不构成法律审查意见。</p>');
117
- }
118
- else if (section.text) {
119
- parts.push(`<p>${esc(section.text)}</p>`);
120
- }
121
- parts.push('</div>');
122
- return parts.join('');
123
- }
124
- const SECTION_TYPES = ['alert', 'reasons', 'grid', 'table', 'checks', 'list', 'next'];
125
- /**
126
- * 按固定模板把摘要数据渲染成完整 HTML。
127
- * 抽成导出函数,供 contract.summary.render 与 contract.card.render(内嵌摘要)共用。
128
- */
129
- export function renderSummaryHtml(data) {
130
- const sections = asArray(data.sections);
131
- if (sections.length === 0) {
132
- throw contractValidationError('sections_required', '摘要数据必须包含非空的 sections 数组');
133
- }
134
- const unknownTypes = sections
135
- .map((section) => String(section?.type ?? ''))
136
- .filter((type) => !SECTION_TYPES.includes(type));
137
- if (unknownTypes.length) {
138
- throw contractValidationError('section_type_unknown', `未知的 section 类型:${[...new Set(unknownTypes)].join(', ')};支持 ${SECTION_TYPES.join(' / ')}`);
139
- }
140
- const badge = esc(data.badge ?? '合同');
141
- // 2026-11-11:标题按对象取,报价单阶段不得显示「合同摘要」
142
- const label = String(data.summaryLabel ?? '合同摘要');
143
- const title = esc(data.title ?? label);
144
- const meta = esc(data.meta ?? '');
145
- const body = sections.map((section) => sectionHtml(section)).join('');
146
- return `<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8">`
147
- + `<title>${label} - ${title}</title><style>${CSS}</style></head><body><div class="w">`
148
- + `<div class="hd"><span class="bd">${badge}</span><h1>${title}</h1><div class="mt">${meta}</div></div>`
149
- + `${body}</div></body></html>`;
150
- }
151
- export const contractSummaryOperations = [
152
- {
153
- name: 'contract.summary.render',
154
- async execute(input) {
155
- const dataPath = resolve(requireNonEmptyString(input.data, 'data', 4096).trim());
156
- const outPath = resolve(requireNonEmptyString(input.out, 'out', 4096).trim());
157
- let data;
158
- try {
159
- const raw = readFileSync(dataPath, 'utf8').replace(/^\uFEFF/u, '');
160
- const parsed = JSON.parse(raw);
161
- if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
162
- throw new Error('summary data must be an object');
163
- }
164
- data = parsed;
165
- }
166
- catch (error) {
167
- const message = error instanceof Error ? error.message : String(error);
168
- throw contractValidationError('data_unreadable', `无法读取摘要数据 JSON:${message}`);
169
- }
170
- const sections = asArray(data.sections);
171
- const html = renderSummaryHtml(data);
172
- writeFileSync(outPath, html, 'utf8');
173
- const bytes = Buffer.byteLength(html, 'utf8');
174
- return {
175
- status: 'COMPLETE',
176
- data: {
177
- output: outPath,
178
- fileName: basename(outPath),
179
- fileSize: bytes,
180
- sectionCount: sections.length,
181
- sectionTypes: sections.map((section) => String(section.type)),
182
- note: 'HTML 由 CLI 按固定模板渲染;模型只需提供紧凑数据 JSON',
183
- },
184
- };
185
- },
186
- },
187
- ];
@@ -1,78 +0,0 @@
1
- /**
2
- * 批量任务的暂存清单(2026-11-06)。
3
- *
4
- * 为什么不用 continuation 直接携带:
5
- * 批量简历导入的每一项都带 `structured`(整份简历 JSON),几十份时 token 会膨胀到几十万字符,
6
- * Agent 传参不现实。这里把清单落到本机 `~/.weaver-work-cli/batch/`,token 只带文件路径 + 指纹;
7
- * apply 时重算指纹,不一致即拒绝(防止清单被中途改写)。
8
- *
9
- * 安全:
10
- * - 目录 0700、文件 0600;
11
- * - 只允许读 batch 目录内的文件(防越权读任意路径);
12
- * - 24 小时以上的旧清单在下次写入时清理。
13
- */
14
- import { createHash } from 'node:crypto';
15
- import { chmodSync, mkdirSync, readFileSync, readdirSync, statSync, unlinkSync, writeFileSync } from 'node:fs';
16
- import { homedir } from 'node:os';
17
- import { join, resolve, sep } from 'node:path';
18
- import { rsValidationError } from './errors.js';
19
- function batchDir() {
20
- const home = process.env.WEAVER_WORK_CLI_HOME || process.env.WORK_CLI_HOME || resolve(homedir(), '.weaver-work-cli');
21
- const dir = join(home, 'batch');
22
- mkdirSync(dir, { recursive: true, mode: 0o700 });
23
- return dir;
24
- }
25
- function digest(value) {
26
- return createHash('sha256').update(JSON.stringify(value)).digest('hex');
27
- }
28
- function cleanup(dir) {
29
- try {
30
- const now = Date.now();
31
- for (const f of readdirSync(dir)) {
32
- if (!f.endsWith('.json'))
33
- continue;
34
- const p = join(dir, f);
35
- try {
36
- if (now - statSync(p).mtimeMs > 24 * 3600 * 1000)
37
- unlinkSync(p);
38
- }
39
- catch { /* 单文件清理失败忽略 */ }
40
- }
41
- }
42
- catch { /* 目录不可读忽略 */ }
43
- }
44
- /** 落盘批量清单,返回文件路径与内容指纹。 */
45
- export function saveBatchItems(kind, items) {
46
- const dir = batchDir();
47
- cleanup(dir);
48
- const fingerprint = digest(items);
49
- const file = join(dir, `${kind}-${fingerprint.slice(0, 16)}.json`);
50
- writeFileSync(file, JSON.stringify(items), { mode: 0o600 });
51
- try {
52
- chmodSync(file, 0o600);
53
- }
54
- catch { /* Windows 上可能不支持 */ }
55
- return { file, fingerprint };
56
- }
57
- /** 读取并校验批量清单(路径必须在 batch 目录内,内容指纹必须与 token 一致)。 */
58
- export function loadBatchItems(file, expectedFingerprint) {
59
- const dir = resolve(batchDir());
60
- const target = resolve(String(file || ''));
61
- if (!target.startsWith(dir + sep)) {
62
- throw rsValidationError('batch_file_invalid', '批量清单路径非法(必须位于 CLI 的 batch 目录内)');
63
- }
64
- let items;
65
- try {
66
- items = JSON.parse(readFileSync(target, 'utf8'));
67
- }
68
- catch {
69
- throw rsValidationError('batch_file_missing', '批量清单已失效(文件被移动或删除),请重新 prepare');
70
- }
71
- if (!Array.isArray(items)) {
72
- throw rsValidationError('batch_file_invalid', '批量清单格式不正确,请重新 prepare');
73
- }
74
- if (digest(items) !== String(expectedFingerprint || '')) {
75
- throw rsValidationError('batch_file_tampered', '批量清单与确认时不一致(文件被修改),已拒绝执行,请重新 prepare');
76
- }
77
- return items;
78
- }