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
@@ -0,0 +1,363 @@
1
+ import { pfFail, pfValidationError } from './errors.js';
2
+ /**
3
+ * 考核流程(flow)相关公共工具:评分列解析、评分行组装、详情页链接、总分估算。
4
+ * 契约来源:e10-kpi-assess 的 references/api-contracts.md(2026-11-11 抓包 + 后端源码核验)。
5
+ */
6
+ /** 考核流程状态中文名(FlowStatus 枚举)。 */
7
+ export const FLOW_STATUS_LABELS = {
8
+ audit: '待审核',
9
+ score: '评分中',
10
+ noScore: '不可评分',
11
+ frozen: '冻结',
12
+ approve: '审批中',
13
+ noApprove: '不可审批',
14
+ drawback: '退回',
15
+ noDrawback: '不可退回',
16
+ finished: '已结束',
17
+ scoreOverTime: '已超时',
18
+ waitArchive: '已评分待归档',
19
+ interviewing: '面谈中',
20
+ };
21
+ export const DATE_TYPE_LABELS = {
22
+ year: '年度',
23
+ halfyear: '半年',
24
+ quarter: '季度',
25
+ month: '月度',
26
+ };
27
+ export const INDICATOR_MODE_LABELS = {
28
+ quantify: '定量',
29
+ qualitative: '定性',
30
+ };
31
+ /**
32
+ * 从 basicHeader 解析可编辑评分列(dataIndex 形如 `kps{stepId}-{userId}`,canEdit=true)。
33
+ * 找不到说明当前用户不是评分操作人,或考核不在评分阶段。
34
+ */
35
+ export function parseScoreColumn(detailData) {
36
+ const cols = (detailData?.basicHeader || []).filter((c) => c?.canEdit && /^kps.+-.+$/.test(String(c?.dataIndex || '')));
37
+ if (!cols.length)
38
+ return null;
39
+ const dataIndex = String(cols[0].dataIndex);
40
+ const m = dataIndex.match(/^kps(.+)-([^-.]+)$/);
41
+ return m ? { scoreColumn: dataIndex, stepId: m[1], scoreUserId: m[2] } : null;
42
+ }
43
+ /** 行级取值键:targetValue{stepId}-{userId} / actualValue… / kps… */
44
+ export function rowValueKeys(stepId, userId) {
45
+ return {
46
+ targetKey: `targetValue${stepId}-${userId}`,
47
+ actualKey: `actualValue${stepId}-${userId}`,
48
+ kpsKey: `kps${stepId}-${userId}`,
49
+ };
50
+ }
51
+ /** 数据源配置里表单/字段的显示名(配置里存的是 JSON 字符串)。 */
52
+ export function parseDatasourceText(jsonStr) {
53
+ if (!jsonStr)
54
+ return null;
55
+ try {
56
+ const parsed = typeof jsonStr === 'string' ? JSON.parse(jsonStr) : jsonStr;
57
+ return parsed?.text ?? parsed?.config?.title ?? null;
58
+ }
59
+ catch {
60
+ return null;
61
+ }
62
+ }
63
+ /** 数据源聚合取数(只读,纯查询无副作用)。 */
64
+ export async function fetchAggregated(host, config, operation) {
65
+ const response = await host.request({
66
+ path: '/api/workrelate/performance/flow/getDataSourceData',
67
+ body: config,
68
+ operation,
69
+ });
70
+ const data = unwrapWeaData(response, '数据源取数');
71
+ return typeof data === 'number' ? data : String(data);
72
+ }
73
+ export function unwrapWeaData(response, context) {
74
+ if (!response || typeof response !== 'object') {
75
+ throw pfFail(`${context}:接口返回不是对象`);
76
+ }
77
+ const failed = response.fail === true
78
+ || (response.status !== undefined && response.status !== true)
79
+ || (response.code !== undefined && response.code !== 200);
80
+ if (failed) {
81
+ throw pfFail(`${context}:${response.msg || '接口返回失败'}`, { code: response.code, msg: response.msg });
82
+ }
83
+ return response.data;
84
+ }
85
+ /** 单个指标的补充分类与数据源信息(assess 用)。 */
86
+ async function describeDatasource(host, cfg, operation) {
87
+ if (!cfg)
88
+ return null;
89
+ const view = {
90
+ formName: parseDatasourceText(cfg.dataSet),
91
+ fieldName: parseDatasourceText(cfg.target),
92
+ countType: cfg.targetCountType ?? null,
93
+ startDate: cfg.startDate ?? null,
94
+ endDate: cfg.endDate ?? null,
95
+ };
96
+ try {
97
+ view.aggregated = await fetchAggregated(host, cfg, operation);
98
+ }
99
+ catch (error) {
100
+ // 取数失败不阻断整体评估,按「无法取数」标注交给 AI 与用户
101
+ view.error = error?.message ?? String(error);
102
+ }
103
+ return view;
104
+ }
105
+ /**
106
+ * 组装 AI 评分上下文(对应原 kpi-cli `assess`):
107
+ * 评分元信息 + 逐指标(类型/描述/权重/模式/目标值/实际值/当前评分)+ 数据源聚合值。
108
+ */
109
+ export async function buildAssessContext(host, flowId, operation) {
110
+ const detailData = unwrapWeaData(await host.request({
111
+ path: `/api/workrelate/performance/flow/detail/${encodeURIComponent(flowId)}`,
112
+ method: 'GET',
113
+ operation,
114
+ }), '考核详情');
115
+ if (!detailData || !Array.isArray(detailData.basicData)) {
116
+ throw pfFail('考核详情缺少指标数据(basicData)', { keys: detailData ? Object.keys(detailData) : [] });
117
+ }
118
+ const column = parseScoreColumn(detailData);
119
+ if (!column) {
120
+ throw pfValidationError('not_scorable', '当前用户对该考核不可评分(找不到可编辑评分列):可能不是本轮评分人,或考核不在评分阶段', { flowStatus: detailData.flowStatus ?? null, canScore: detailData.canScore ?? null });
121
+ }
122
+ const keys = rowValueKeys(column.stepId, column.scoreUserId);
123
+ const indicators = [];
124
+ for (let i = 0; i < detailData.basicData.length; i += 1) {
125
+ const row = detailData.basicData[i];
126
+ const isQuantitative = String(row?.indicatorMode) === 'quantify';
127
+ const item = {
128
+ index: i + 1,
129
+ dataRow: row?.dataRow,
130
+ name: row?.type ?? null,
131
+ description: row?.describe ?? row?.indicatorDescription ?? null,
132
+ weight: row?.weight ?? null,
133
+ mode: INDICATOR_MODE_LABELS[String(row?.indicatorMode)] ?? null,
134
+ scoreType: row?.scoreType ?? null,
135
+ currentTarget: row?.[keys.targetKey] ?? null,
136
+ currentActual: row?.[keys.actualKey] ?? null,
137
+ currentScore: row?.[keys.kpsKey] ?? null,
138
+ // 后端为 AI 预留的镜像字段(FlowServiceImpl 796-809,注释「AI创建使用」)
139
+ aiTarget: row?.targetAIValue ?? null,
140
+ aiActual: row?.actualAIValue ?? null,
141
+ };
142
+ if (isQuantitative && Number(row?.targetSource) === 2 && row?.targetDatasourceData) {
143
+ item.targetDatasource = await describeDatasource(host, row.targetDatasourceData, operation);
144
+ }
145
+ if (isQuantitative && Number(row?.dataSource) === 2
146
+ && String(row?.dataModule || '').toLowerCase() === 'datasource' && row?.datasourceData) {
147
+ item.actualDatasource = await describeDatasource(host, row.datasourceData, operation);
148
+ }
149
+ indicators.push(item);
150
+ }
151
+ return {
152
+ flowId,
153
+ meta: {
154
+ name: detailData.name ?? null,
155
+ schemeName: detailData.schemeName ?? null,
156
+ kpiUserName: detailData.kpiUserName ?? null,
157
+ assessmentCycle: detailData.assessmentCycle ?? null,
158
+ periodStart: detailData.periodStartDate ?? null,
159
+ periodEnd: detailData.periodEndDate ?? null,
160
+ flowStatus: detailData.flowStatus ?? null,
161
+ flowStatusLabel: FLOW_STATUS_LABELS[String(detailData.flowStatus)] ?? null,
162
+ currentScore: detailData.score ?? null,
163
+ maxScore: detailData.total ?? null,
164
+ scoreLimit: detailData.scoreLimit ?? null,
165
+ canScore: detailData.canScore ?? null,
166
+ stepId: column.stepId,
167
+ scoreUserId: column.scoreUserId,
168
+ },
169
+ indicators,
170
+ detailUrl: buildDetailUrl(flowId, []),
171
+ };
172
+ }
173
+ /** 考核详情页链接;带 kpiext/aikps 时页面展示 AI 评分列。 */
174
+ export function buildDetailUrl(flowId, rows = []) {
175
+ const base = `/sp/performance/flow/deal/detail/${flowId}`;
176
+ if (!rows.length)
177
+ return base;
178
+ const aikps = [...rows]
179
+ .sort((a, b) => Number(a.dataRow) - Number(b.dataRow))
180
+ .map((row) => {
181
+ const value = Number(row.kps);
182
+ return Number.isFinite(value) ? String(value) : '';
183
+ })
184
+ .join(',');
185
+ return `${base}?kpiext=1&aikps=${aikps}`;
186
+ }
187
+ /**
188
+ * 组装评分请求体并做与前端同源的前置校验。
189
+ * 校验规则(对齐 weapp detailItem.tsx:2108-2159):
190
+ * - 每行 kps 必填(公式行可取行内计算值)
191
+ * - 超出满分(scoreLimit 未关闭)→ 直接拒绝,不静默截断
192
+ * - 定量指标 targetValue 必填;actualValue 在 dataSource=1 或(dataSource=2 且 editActualValue)时必填
193
+ */
194
+ export function buildScoreRequest(detailData, payloadRows, column) {
195
+ if (detailData?.canScore === false) {
196
+ throw pfValidationError('not_scorable', '当前用户对该考核不可评分(canScore=false)', {
197
+ flowStatus: detailData?.flowStatus ?? null,
198
+ });
199
+ }
200
+ if (!Array.isArray(payloadRows) || payloadRows.length === 0) {
201
+ throw pfValidationError('payload_empty', '评分行不能为空(每行至少提供 dataRow 与 kps)');
202
+ }
203
+ const keys = rowValueKeys(column.stepId, column.scoreUserId);
204
+ const maxScore = Number(detailData?.total);
205
+ const basicData = Array.isArray(detailData?.basicData) ? detailData.basicData : [];
206
+ const linkList = [];
207
+ for (const payloadRow of payloadRows) {
208
+ if (!payloadRow || typeof payloadRow !== 'object' || payloadRow.dataRow === undefined) {
209
+ throw pfValidationError('payload_invalid', '每行必须包含 dataRow', { row: payloadRow });
210
+ }
211
+ const row = basicData.find((r) => Number(r?.dataRow) === Number(payloadRow.dataRow));
212
+ if (!row) {
213
+ throw pfValidationError('data_row_unknown', `dataRow=${payloadRow.dataRow} 在指标表中不存在`, {
214
+ valid: basicData.map((r) => r?.dataRow),
215
+ });
216
+ }
217
+ const rowName = row?.type ?? `第 ${row?.dataRow} 行`;
218
+ let kpsValue = payloadRow.kps;
219
+ if ((kpsValue === undefined || kpsValue === null || kpsValue === '') && row?.scoreType === 'formula') {
220
+ const inline = row?.[keys.kpsKey];
221
+ if (inline !== undefined && inline !== null && inline !== '')
222
+ kpsValue = inline;
223
+ }
224
+ if (kpsValue === undefined || kpsValue === null || kpsValue === '') {
225
+ throw pfValidationError('kps_missing', `「${rowName}」缺少评分(kps)`, {
226
+ dataRow: row?.dataRow,
227
+ hint: '每行必填;公式行可省略但详情里需已有计算值',
228
+ });
229
+ }
230
+ const kpsNumber = Number(kpsValue);
231
+ if (!Number.isFinite(kpsNumber) || kpsNumber < 0) {
232
+ throw pfValidationError('kps_invalid', `「${rowName}」评分非法:${kpsValue}`, { dataRow: row?.dataRow });
233
+ }
234
+ if (detailData?.scoreLimit !== false && Number.isFinite(maxScore) && maxScore > 0 && kpsNumber > maxScore) {
235
+ throw pfValidationError('kps_exceeds_max', `「${rowName}」评分 ${kpsNumber} 超出满分 ${maxScore}`, {
236
+ dataRow: row?.dataRow,
237
+ hint: '不做静默截断,请调整评分',
238
+ });
239
+ }
240
+ const isQuantitative = String(row?.indicatorMode) === 'quantify';
241
+ let targetValue = payloadRow.targetValue !== undefined ? payloadRow.targetValue : row?.[keys.targetKey];
242
+ if (isQuantitative && (targetValue === undefined || targetValue === null || targetValue === '')) {
243
+ throw pfValidationError('target_missing', `定量指标「${rowName}」缺少目标值(targetValue)`, {
244
+ dataRow: row?.dataRow,
245
+ hint: '可在 payload 提供,或确认详情中已有目标值',
246
+ });
247
+ }
248
+ const targetNumber = targetValue === undefined || targetValue === null || targetValue === ''
249
+ ? 0
250
+ : Number(targetValue);
251
+ if (!Number.isFinite(targetNumber)) {
252
+ throw pfValidationError('target_invalid', `「${rowName}」目标值非数字:${targetValue}`, { dataRow: row?.dataRow });
253
+ }
254
+ let actualValue = null;
255
+ if (payloadRow.actualValue !== undefined && payloadRow.actualValue !== null && payloadRow.actualValue !== '') {
256
+ actualValue = String(payloadRow.actualValue);
257
+ }
258
+ else if (row?.[keys.actualKey] !== undefined && row?.[keys.actualKey] !== null && row?.[keys.actualKey] !== '') {
259
+ actualValue = String(row?.[keys.actualKey]);
260
+ }
261
+ if (isQuantitative && actualValue === null) {
262
+ const needsActual = Number(row?.dataSource) === 1
263
+ || (Number(row?.dataSource) === 2 && row?.editActualValue === true);
264
+ if (needsActual) {
265
+ throw pfValidationError('actual_missing', `定量指标「${rowName}」缺少实际值(actualValue)`, {
266
+ dataRow: row?.dataRow,
267
+ dataSource: row?.dataSource ?? null,
268
+ editActualValue: row?.editActualValue === true,
269
+ hint: '该指标需评分人提供实际值(dataSource=1 手动录入,或数据源模式但允许编辑实际值)',
270
+ });
271
+ }
272
+ }
273
+ linkList.push({
274
+ weight: row?.weight ?? null,
275
+ dataRow: row?.dataRow,
276
+ operater: column.scoreUserId,
277
+ kps: kpsNumber.toFixed(2),
278
+ kpiFlowStep: column.stepId,
279
+ targetValue: targetNumber,
280
+ actualValue: actualValue === null ? '' : actualValue,
281
+ ...(payloadRow.remark !== undefined && payloadRow.remark !== null && payloadRow.remark !== ''
282
+ ? { name: String(payloadRow.remark) }
283
+ : {}),
284
+ });
285
+ }
286
+ const rows = linkList.map((link) => ({ dataRow: link.dataRow, kps: link.kps, actualValue: link.actualValue }));
287
+ return {
288
+ body: {
289
+ flowid: String(detailData?.id ?? ''),
290
+ stepId: column.stepId,
291
+ operater: column.scoreUserId,
292
+ rewardMoney: 0,
293
+ kpiFlowStepLinkList: linkList,
294
+ distributeCheck: true,
295
+ },
296
+ rows,
297
+ meta: {
298
+ name: detailData?.name ?? null,
299
+ kpiUserName: detailData?.kpiUserName ?? null,
300
+ assessmentCycle: detailData?.assessmentCycle ?? null,
301
+ flowStatus: detailData?.flowStatus ?? null,
302
+ maxScore: detailData?.total ?? null,
303
+ },
304
+ };
305
+ }
306
+ /** 本地加权总分估算(不写库,用于 prepare 展示)。 */
307
+ export function estimateTotal(detailData, linkList) {
308
+ const basicData = Array.isArray(detailData?.basicData) ? detailData.basicData : [];
309
+ let weighted = 0;
310
+ let weightSum = 0;
311
+ for (const link of linkList) {
312
+ const row = basicData.find((r) => Number(r?.dataRow) === Number(link.dataRow));
313
+ const weight = Number(row?.weight);
314
+ const kps = Number(link.kps);
315
+ if (!Number.isFinite(weight) || !Number.isFinite(kps))
316
+ continue;
317
+ weighted += kps * weight;
318
+ weightSum += weight;
319
+ }
320
+ if (weightSum === 0)
321
+ return null;
322
+ return Math.round((weighted / weightSum) * 100) / 100;
323
+ }
324
+ /** 考核列表行 → 业务视图(不露英文字段名/枚举值)。 */
325
+ export function toFlowRowView(row) {
326
+ return {
327
+ flowId: row?.id === undefined || row?.id === null ? null : String(row.id),
328
+ name: row?.name ?? null,
329
+ kpiUserName: row?.kpiUserName ?? null,
330
+ kpiSchemeName: row?.kpiSchemeName ?? null,
331
+ department: row?.departmentDesc ?? null,
332
+ subcompany: row?.subcompanyDesc ?? null,
333
+ dateType: DATE_TYPE_LABELS[String(row?.dateType)] ?? null,
334
+ assessmentCycle: row?.assessmentCycle ?? null,
335
+ status: FLOW_STATUS_LABELS[String(row?.flowStatus)] ?? (row?.flowStatusDesc ?? null),
336
+ score: row?.score ?? null,
337
+ scoreDesc: row?.scoreDesc ?? null,
338
+ createTime: row?.createTime ?? null,
339
+ finishTime: row?.finishTime ?? null,
340
+ detailUrl: row?.id === undefined || row?.id === null
341
+ ? null
342
+ : `/sp/performance/flow/deal/detail/${row.id}`,
343
+ };
344
+ }
345
+ /**
346
+ * 兼容两种列表返回形态:
347
+ * - 纯数组(getPortalRecently → List<FlowPortalRecentlyRes>)
348
+ * - WeaTable(pendinglist / dealDonelist / list → { columns, data: [...], total })
349
+ */
350
+ export function extractRows(data) {
351
+ if (Array.isArray(data))
352
+ return data;
353
+ if (data && Array.isArray(data.data))
354
+ return data.data;
355
+ return [];
356
+ }
357
+ /** WeaTable 的 total(纯数组返回时为 null;后端对 pendinglist 恒为 0,不可当作总数)。 */
358
+ export function extractTotal(data) {
359
+ if (data && typeof data === 'object' && !Array.isArray(data) && typeof data.total === 'number') {
360
+ return data.total;
361
+ }
362
+ return null;
363
+ }
@@ -19,12 +19,12 @@ function buildOperations() {
19
19
  export const performanceManifest = {
20
20
  schemaVersion: 1,
21
21
  name: 'performance',
22
- title: '泛微E10绩效方案(文档导入 → 草稿 → 确认发布)',
22
+ title: '泛微E10绩效考核(方案导入 + 考核查询与 AI 评分)',
23
23
  version: '0.1.0',
24
24
  host: 'e10-performance',
25
25
  status: 'builtin',
26
26
  sourceSkill: 'weaver-e10-performance',
27
- capabilities: ['performance.hrm.resolve', 'performance.scheme.detail', 'performance.scheme.draft', 'performance.scheme.publish'],
27
+ capabilities: ['performance.hrm.resolve', 'performance.scheme.detail', 'performance.scheme.draft', 'performance.scheme.publish', 'performance.flow.query', 'performance.flow.score'],
28
28
  operations: buildOperations(),
29
29
  withheldOperations: [],
30
30
  };
@@ -0,0 +1,85 @@
1
+ import { buildAssessContext, buildDetailUrl, FLOW_STATUS_LABELS, INDICATOR_MODE_LABELS, parseScoreColumn, rowValueKeys, unwrapWeaData, } from '../flow-utils.js';
2
+ import { pfValidationError } from '../errors.js';
3
+ import { pfSuccess, schemaOf } from './types.js';
4
+ /**
5
+ * 考核详情:业务化视图 + 完整原文。
6
+ * 原文含评分列(kps{stepId}-{userId})与 AI 镜像字段,供评分与排查使用。
7
+ */
8
+ async function detail(args, env) {
9
+ if (args.flowId === undefined || args.flowId === null || args.flowId === '') {
10
+ throw pfValidationError('flow_id_missing', '缺少考核流程 id(flowId)');
11
+ }
12
+ const flowId = String(args.flowId);
13
+ const data = unwrapWeaData(await env.host.request({
14
+ path: `/api/workrelate/performance/flow/detail/${encodeURIComponent(flowId)}`,
15
+ method: 'GET',
16
+ operation: 'performance.flow.detail',
17
+ }), '考核详情');
18
+ const column = parseScoreColumn(data);
19
+ const keys = column ? rowValueKeys(column.stepId, column.scoreUserId) : null;
20
+ const indicatorRows = (Array.isArray(data?.basicData) ? data.basicData : []).map((row, index) => ({
21
+ index: index + 1,
22
+ dataRow: row?.dataRow,
23
+ name: row?.type ?? null,
24
+ mode: INDICATOR_MODE_LABELS[String(row?.indicatorMode)] ?? null,
25
+ weight: row?.weight === undefined || row?.weight === null ? null : `${row.weight}%`,
26
+ targetValue: keys ? (row?.[keys.targetKey] ?? null) : null,
27
+ actualValue: keys ? (row?.[keys.actualKey] ?? null) : null,
28
+ score: keys ? (row?.[keys.kpsKey] ?? null) : null,
29
+ description: row?.describe ?? row?.indicatorDescription ?? null,
30
+ }));
31
+ return pfSuccess('performance.flow.detail', {
32
+ flowId,
33
+ name: data?.name ?? null,
34
+ kpiUserName: data?.kpiUserName ?? null,
35
+ assessmentCycle: data?.assessmentCycle ?? null,
36
+ status: FLOW_STATUS_LABELS[String(data?.flowStatus)] ?? (data?.flowStatus ?? null),
37
+ score: data?.score ?? null,
38
+ maxScore: data?.total ?? null,
39
+ canScore: data?.canScore ?? false,
40
+ currentStep: data?.kpiCurrentStep ?? null,
41
+ indicatorRows,
42
+ detailUrl: buildDetailUrl(flowId),
43
+ data,
44
+ });
45
+ }
46
+ /** AI 评分上下文:评分元信息 + 逐指标(含数据源聚合值)。 */
47
+ async function assess(args, env) {
48
+ if (args.flowId === undefined || args.flowId === null || args.flowId === '') {
49
+ throw pfValidationError('flow_id_missing', '缺少考核流程 id(flowId)');
50
+ }
51
+ const context = await buildAssessContext(env.host, String(args.flowId), 'performance.flow.assess');
52
+ return pfSuccess('performance.flow.assess', {
53
+ ...context,
54
+ scoringHints: [
55
+ '定量指标:以目标值与实际值(数据源聚合结果)为依据,先算达成率再映射分数',
56
+ '定性指标:基于指标说明与可用数据给出可追溯的判断依据,不空泛',
57
+ '数据源 error 字段非空的指标标注「无法取数」,不强行打分',
58
+ '评分上限为满分(maxScore);超出会被拒绝,不做静默截断',
59
+ ],
60
+ });
61
+ }
62
+ export const flowDetailOperations = [
63
+ {
64
+ name: 'performance.flow.detail',
65
+ resource: 'performance.flow',
66
+ method: 'query',
67
+ action: 'flow.detail',
68
+ summary: '考核详情(指标行 + 当前评分 + 完整原文)',
69
+ capability: 'performance.flow.query',
70
+ risk: 'read',
71
+ inputSchema: schemaOf({ flowId: { type: 'string', description: '考核流程 id(flowId,字符串)' } }, { required: ['flowId'] }),
72
+ handler: detail,
73
+ },
74
+ {
75
+ name: 'performance.flow.assess',
76
+ resource: 'performance.flow',
77
+ method: 'query',
78
+ action: 'flow.assess',
79
+ summary: '组装 AI 评分上下文(逐指标目标/实际/当前评分 + 数据源聚合值)',
80
+ capability: 'performance.flow.score',
81
+ risk: 'read',
82
+ inputSchema: schemaOf({ flowId: { type: 'string', description: '考核流程 id(flowId,字符串)' } }, { required: ['flowId'] }),
83
+ handler: assess,
84
+ },
85
+ ];
@@ -0,0 +1,213 @@
1
+ import { extractRows, extractTotal, unwrapWeaData, toFlowRowView, FLOW_STATUS_LABELS } from '../flow-utils.js';
2
+ import { pfSuccess, schemaOf } from './types.js';
3
+ /** 考核流程类只读接口(全部为 POST/GET 查询,无写副作用)。 */
4
+ const API = {
5
+ recent: '/api/workrelate/performance/flow/getPortalRecently',
6
+ pending: '/api/workrelate/performance/flow/getPendingNums',
7
+ todo: '/api/workrelate/performance/flow/pendinglist',
8
+ done: '/api/workrelate/performance/flow/dealDonelist',
9
+ list: '/api/workrelate/performance/flow/list',
10
+ };
11
+ /** 最近已有考核(我作为被考核人的成绩)。 */
12
+ async function recent(_args, env) {
13
+ const data = unwrapWeaData(await env.host.request({ path: API.recent, body: {}, operation: 'performance.flow.recent' }), '最近考核列表');
14
+ // getPortalRecently 只返回 { id, score, assessmentCycle, linkUrl }:
15
+ // 单独映射,避免复用 toFlowRowView 造成 name/status 都是 null 的误导
16
+ const rows = extractRows(data).map((row) => ({
17
+ flowId: row?.id === undefined || row?.id === null ? null : String(row.id),
18
+ assessmentCycle: row?.assessmentCycle ?? null,
19
+ scoreText: row?.score ?? null,
20
+ detailUrl: row?.linkUrl
21
+ ? String(row.linkUrl)
22
+ : (row?.id === undefined || row?.id === null ? null : `/sp/performance/flow/deal/detail/${row.id}`),
23
+ }));
24
+ return pfSuccess('performance.flow.recent', {
25
+ count: rows.length,
26
+ rows,
27
+ note: '最近考核接口只返回考核 id、成绩文本与周期;名称/被考核人需用 performance.flow.detail 获取',
28
+ });
29
+ }
30
+ /** 待处理数量(待评分/待审批/面谈等)。 */
31
+ async function pending(_args, env) {
32
+ const data = unwrapWeaData(await env.host.request({ path: API.pending, body: {}, operation: 'performance.flow.pending' }), '待处理数量');
33
+ return pfSuccess('performance.flow.pending', {
34
+ scoreNum: data?.scoreNum ?? 0,
35
+ approveNum: data?.approveNum ?? 0,
36
+ interviewNum: data?.interviewNum ?? 0,
37
+ auditNum: data?.auditNum ?? 0,
38
+ frozenNum: data?.frozenNum ?? 0,
39
+ totalNum: data?.totalNum ?? 0,
40
+ hint: 'scoreNum>0 表示有待评分考核;取明细用 performance.flow.todo',
41
+ });
42
+ }
43
+ /** 待处理明细(默认待评分)。total/hasMore 后端恒不可信,只能翻页到空。 */
44
+ async function todo(args, env) {
45
+ const tab = String(args.tab || 'score');
46
+ const current = Number(args.current ?? 1);
47
+ const pageSize = Number(args.pageSize ?? 20);
48
+ const data = unwrapWeaData(await env.host.request({
49
+ path: API.todo,
50
+ body: { status: tab, current, pageSize },
51
+ operation: 'performance.flow.todo',
52
+ }), '待处理明细');
53
+ const rows = extractRows(data).map(toFlowRowView);
54
+ return pfSuccess('performance.flow.todo', {
55
+ tab,
56
+ current,
57
+ pageSize,
58
+ count: rows.length,
59
+ rows,
60
+ paging: {
61
+ note: '后端 total 恒为 0、hasMore 恒为 false,不能用于判断是否还有下一页;本页行数小于 pageSize 即到末页',
62
+ nextCurrent: rows.length < pageSize ? null : current + 1,
63
+ },
64
+ });
65
+ }
66
+ /** 已办明细(我作为评分/审批人已处理完的考核)。 */
67
+ async function done(args, env) {
68
+ const current = Number(args.current ?? 1);
69
+ const pageSize = Number(args.pageSize ?? 20);
70
+ const searchParams = {};
71
+ if (args.kpiUserName) {
72
+ // 被考核人过滤:browser 格式 formDatas.userIdList=[{userIdList:[{id}]}]
73
+ searchParams.formDatas = { userIdList: [{ userIdList: [{ id: String(args.kpiUserId ?? args.kpiUserName) }] }] };
74
+ }
75
+ if (args.keyword)
76
+ searchParams.formDatas = { ...(searchParams.formDatas || {}), name: String(args.keyword) };
77
+ const data = unwrapWeaData(await env.host.request({
78
+ path: API.done,
79
+ body: { searchParams, current, pageSize },
80
+ operation: 'performance.flow.done',
81
+ }), '已办列表');
82
+ const rows = extractRows(data).map(toFlowRowView);
83
+ return pfSuccess('performance.flow.done', { current, pageSize, count: rows.length, rows });
84
+ }
85
+ /** 考核成绩列表:我的 / 直接下属 / 间接下属 / 下属 / 全部 / 本人 / 待处理。 */
86
+ async function list(args, env) {
87
+ const dataTypes = Array.isArray(args.dataType) && args.dataType.length
88
+ ? args.dataType.map((x) => String(x))
89
+ : ['mine'];
90
+ const current = Number(args.current ?? 1);
91
+ const pageSize = Number(args.pageSize ?? 20);
92
+ const body = {
93
+ dataType: dataTypes,
94
+ // 前端同源写法:高级搜索侧也带同一份 dataType(flow/sub/list.tsx:127-136)
95
+ searchParams: { formDatas: { dataType: dataTypes.map((t) => ({ dataType: [t] })) } },
96
+ current,
97
+ pageSize,
98
+ dateType: args.dateType ?? null,
99
+ startTime: args.startTime ?? null,
100
+ endTime: args.endTime ?? null,
101
+ };
102
+ if (args.status !== undefined)
103
+ body.status = args.status;
104
+ if (args.keyword)
105
+ body.keywords = String(args.keyword);
106
+ if (args.schemeId !== undefined)
107
+ body.schemeId = args.schemeId;
108
+ const data = unwrapWeaData(await env.host.request({ path: API.list, body, operation: 'performance.flow.list' }), '考核成绩列表');
109
+ // WeaTable 结构:data.data 为行数组,data.total 视 pageUid 而定(不保证)
110
+ const rows = extractRows(data).map(toFlowRowView);
111
+ const scopeLabels = {
112
+ mine: '我的',
113
+ directsub: '直接下属',
114
+ indirectsub: '间接下属',
115
+ sub: '下属',
116
+ all: '全部',
117
+ myself: '本人',
118
+ pending: '待处理',
119
+ };
120
+ return pfSuccess('performance.flow.list', {
121
+ scope: dataTypes.map((t) => scopeLabels[t] || t).join('+'),
122
+ current,
123
+ pageSize,
124
+ count: rows.length,
125
+ rows,
126
+ total: extractTotal(data),
127
+ paging: {
128
+ note: '本接口的 total 由 pageUid 决定,可能为 0 或不准确;以本页行数判断是否到末页',
129
+ nextCurrent: rows.length < pageSize ? null : current + 1,
130
+ },
131
+ statusLegend: FLOW_STATUS_LABELS,
132
+ });
133
+ }
134
+ export const flowListOperations = [
135
+ {
136
+ name: 'performance.flow.recent',
137
+ resource: 'performance.flow',
138
+ method: 'query',
139
+ action: 'flow.recent',
140
+ summary: '最近已有考核成绩列表(我的)',
141
+ capability: 'performance.flow.query',
142
+ risk: 'read',
143
+ inputSchema: schemaOf({}),
144
+ handler: recent,
145
+ },
146
+ {
147
+ name: 'performance.flow.pending',
148
+ resource: 'performance.flow',
149
+ method: 'query',
150
+ action: 'flow.pending',
151
+ summary: '待处理数量(待评分/待审批/面谈/审核)',
152
+ capability: 'performance.flow.query',
153
+ risk: 'read',
154
+ inputSchema: schemaOf({}),
155
+ handler: pending,
156
+ },
157
+ {
158
+ name: 'performance.flow.todo',
159
+ resource: 'performance.flow',
160
+ method: 'query',
161
+ action: 'flow.todo',
162
+ summary: '待处理明细列表(默认待评分;total/hasMore 不可信)',
163
+ capability: 'performance.flow.query',
164
+ risk: 'read',
165
+ inputSchema: schemaOf({
166
+ tab: { type: 'string', enum: ['score', 'approve'], description: '待评分(score) 或 待审批(approve),默认 score' },
167
+ current: { type: 'integer', minimum: 1, description: '页码,默认 1' },
168
+ pageSize: { type: 'integer', minimum: 1, maximum: 100, description: '每页条数,默认 20' },
169
+ }),
170
+ handler: todo,
171
+ },
172
+ {
173
+ name: 'performance.flow.done',
174
+ resource: 'performance.flow',
175
+ method: 'query',
176
+ action: 'flow.done',
177
+ summary: '已办考核列表(我作为评分/审批人已处理的)',
178
+ capability: 'performance.flow.query',
179
+ risk: 'read',
180
+ inputSchema: schemaOf({
181
+ keyword: { type: 'string', description: '考核名称关键字' },
182
+ kpiUserId: { type: 'string', description: '被考核人 userId(字符串,按被考核人过滤)' },
183
+ current: { type: 'integer', minimum: 1, description: '页码,默认 1' },
184
+ pageSize: { type: 'integer', minimum: 1, maximum: 100, description: '每页条数,默认 20' },
185
+ }),
186
+ handler: done,
187
+ },
188
+ {
189
+ name: 'performance.flow.list',
190
+ resource: 'performance.flow',
191
+ method: 'query',
192
+ action: 'flow.list',
193
+ summary: '考核成绩列表:我的/直接下属/间接下属/下属/全部/本人/待处理(dataType 单选或组合)',
194
+ capability: 'performance.flow.query',
195
+ risk: 'read',
196
+ inputSchema: schemaOf({
197
+ dataType: {
198
+ type: 'array',
199
+ items: { type: 'string', enum: ['mine', 'directsub', 'indirectsub', 'sub', 'all', 'myself', 'pending'] },
200
+ description: '查询范围:mine=我的 / directsub=直接下属 / indirectsub=间接下属 / sub=下属 / all=全部 / myself=本人 / pending=待处理;默认 ["mine"]',
201
+ },
202
+ status: { type: 'array', items: { type: 'string' }, description: '流程状态过滤(可选)' },
203
+ dateType: { type: 'string', enum: ['year', 'halfyear', 'quarter', 'month'], description: '考核周期类型(可选)' },
204
+ startTime: { type: ['string', 'integer'], description: '开始时间(可选);按前端同源写法原样透传' },
205
+ endTime: { type: ['string', 'integer'], description: '结束时间(可选)' },
206
+ keyword: { type: 'string', description: '考核名称关键字(可选)' },
207
+ schemeId: { type: ['string', 'integer'], description: '限定某个方案(可选)' },
208
+ current: { type: 'integer', minimum: 1, description: '页码,默认 1' },
209
+ pageSize: { type: 'integer', minimum: 1, maximum: 100, description: '每页条数,默认 20' },
210
+ }),
211
+ handler: list,
212
+ },
213
+ ];