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
@@ -22,7 +22,7 @@ import {
22
22
  import {
23
23
  Command,
24
24
  clearInvoiceTokenForSession
25
- } from "./chunk-TEZHIB6T.js";
25
+ } from "./chunk-WSHIOSGM.js";
26
26
  import {
27
27
  shouldReportPlatformError,
28
28
  toPlatformError
@@ -34,7 +34,7 @@ import {
34
34
  normalizeXiaoEAuthErrorLogLimit,
35
35
  readXiaoEAuthErrorLog,
36
36
  xiaoEAuthLogSecrets
37
- } from "./chunk-NRYDJN4J.js";
37
+ } from "./chunk-FJUOUSV3.js";
38
38
  import {
39
39
  E10AuthSession,
40
40
  XIAOE_AGENT_TYPE,
@@ -50,9 +50,12 @@ import {
50
50
  getProfileDir,
51
51
  hasXiaoEEnv,
52
52
  inspectXiaoEUnifiedLoginSources,
53
+ isConnectorMode,
53
54
  listProfiles,
54
55
  lookupAgentHost,
55
56
  normalizeGlobalOptions,
57
+ packageFileUrl,
58
+ packagePath,
56
59
  profileNameFromUrl,
57
60
  readProfileConfig,
58
61
  readTeamsCheckUserInfo,
@@ -67,11 +70,7 @@ import {
67
70
  switchActiveProfile,
68
71
  tryXiaoEUnifiedLogin,
69
72
  upsertAgentHost
70
- } from "./chunk-WIWDVETN.js";
71
- import {
72
- packageFileUrl,
73
- packagePath
74
- } from "./chunk-SHYQUBY3.js";
73
+ } from "./chunk-FDBAFANU.js";
75
74
  import {
76
75
  CliError,
77
76
  isCliError,
@@ -261,6 +260,7 @@ var doctorCommand = {
261
260
  // src/internal/e10/auth/commands.ts
262
261
  import { execFile } from "node:child_process";
263
262
  import { randomBytes } from "node:crypto";
263
+ import { existsSync as existsSync3 } from "node:fs";
264
264
  import { createServer } from "node:http";
265
265
  var DEFAULT_AGENT_TYPE = "weaver-work-cli";
266
266
  var EXPLICIT_AGENT_TYPE_ENV_KEYS = [
@@ -385,7 +385,11 @@ function validateAgentReturnUrl(value) {
385
385
  }
386
386
  return value;
387
387
  }
388
- function resolveAgentReturnTarget(options = {}, env = process.env, agentType = resolveAgentType(options, env)) {
388
+ function isMachineAuthMode(stdout = process.stdout, connectorMode = isConnectorMode()) {
389
+ if (connectorMode) return true;
390
+ return stdout.isTTY !== true;
391
+ }
392
+ function resolveAgentReturnTarget(options = {}, env = process.env, agentType = resolveAgentType(options, env), mode = {}) {
389
393
  const builtInTarget = builtInAgentReturnTarget(agentType);
390
394
  const explicitUrl = optionString(options, "agentReturnUrl") || envString(env, AGENT_RETURN_URL_ENV_KEY);
391
395
  if (explicitUrl) {
@@ -394,6 +398,7 @@ function resolveAgentReturnTarget(options = {}, env = process.env, agentType = r
394
398
  url: validateAgentReturnUrl(explicitUrl)
395
399
  };
396
400
  }
401
+ if (mode.machine) return null;
397
402
  if (builtInTarget) return builtInTarget;
398
403
  const conventionalUrl = conventionalAgentReturnUrl(agentType);
399
404
  return conventionalUrl ? { label: agentType, url: conventionalUrl } : null;
@@ -499,18 +504,77 @@ function renderE10LoginSuccessPage(userId, returnTarget = null, launchToken = ""
499
504
  const returnScript = safeReturnTarget && launchToken ? `<script nonce="${esc(launchToken)}">(()=>{const root=document.querySelector('[data-agent-return]');if(!root)return;const status=root.querySelector('.status');const buttons=[...root.querySelectorAll('button')];const agentLabel=root.dataset.agentLabel||'\u5E94\u7528';const fallbackUrl=root.dataset.fallbackUrl||'';const storageKey='weaver-work-cli.agent-return.'+root.dataset.agentKey;let busy=false;const setBusy=value=>{busy=value;buttons.forEach(button=>{button.disabled=value;});};const closePrompt=()=>{root.hidden=true;};const savePreference=()=>{try{localStorage.setItem(storageKey,'1');}catch{}};const clearPreference=()=>{try{localStorage.removeItem(storageKey);}catch{}};const hasPreference=()=>{try{return localStorage.getItem(storageKey)==='1';}catch{return false;}};const post=async action=>{let response;try{response=await fetch('${AGENT_RETURN_PATH}?action='+encodeURIComponent(action),{method:'POST',headers:{'${AGENT_RETURN_TOKEN_HEADER}':root.dataset.token}});}catch{return false;}if(!response.ok)throw new Error(await response.text()||'\u8BF7\u6C42\u5931\u8D25');return true;};const openAgent=async persist=>{if(busy)return;setBusy(true);status.textContent='\u6B63\u5728\u6253\u5F00 '+agentLabel+'\u2026';try{const openedLocally=await post('open');if(persist)savePreference();if(!openedLocally){closePrompt();window.location.href=fallbackUrl;return;}closePrompt();}catch(error){if(persist)clearPreference();status.textContent=error instanceof Error?error.message:'\u65E0\u6CD5\u6253\u5F00\u5E94\u7528\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5\u3002';setBusy(false);}};root.querySelector('[data-action="open"]').addEventListener('click',()=>openAgent(false));root.querySelector('[data-action="always"]').addEventListener('click',()=>openAgent(true));root.querySelector('[data-action="cancel"]').addEventListener('click',()=>{if(busy)return;clearPreference();closePrompt();post('cancel').catch(()=>{});});if(hasPreference())openAgent(false);})();</script>` : "";
500
505
  return `<!doctype html><html lang="zh-CN"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>weaver-work-cli \u767B\u5F55\u6210\u529F</title><style>:root{color-scheme:light}*{box-sizing:border-box}body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;background:radial-gradient(circle at 50% 18%,#eefbf8 0,#f6f7f9 42%,#eef1f5 100%);color:#20242a;display:grid;place-items:center;min-height:100vh;margin:0}.card{background:rgba(255,255,255,.88);border:1px solid #e6e8ec;border-radius:18px;padding:34px 38px;box-shadow:0 18px 55px rgba(18,24,40,.09);width:min(560px,calc(100vw - 40px));text-align:center}.title{font-size:24px;font-weight:700;margin-bottom:10px}.desc{color:#667085;font-size:15px;line-height:24px}.user{color:#98a2b3;font-size:12px;margin-top:18px}.overlay{position:fixed;inset:0;z-index:10;display:grid;place-items:center;padding:20px;background:rgba(28,34,41,.36);backdrop-filter:blur(5px)}.overlay[hidden]{display:none}.prompt{width:min(410px,calc(100vw - 32px));padding:32px 28px 26px;border:1px solid rgba(255,255,255,.75);border-radius:24px;background:rgba(250,250,251,.97);box-shadow:0 24px 70px rgba(15,23,42,.28);text-align:center}.app-icon{width:74px;height:74px;margin:0 auto 24px;filter:drop-shadow(0 8px 14px rgba(8,170,130,.22))}.app-icon svg{display:block;width:100%;height:100%}.prompt h1{margin:0;font-size:20px;line-height:30px;font-weight:700;letter-spacing:-.2px}.prompt p{margin:10px 0 24px;color:#667085;font-size:14px;line-height:22px}.prompt button{display:block;width:100%;min-height:40px;border:0;border-radius:12px;font:600 16px/22px inherit;cursor:pointer;transition:transform .12s ease,filter .12s ease}.prompt button+button{margin-top:10px}.prompt button:hover{filter:brightness(.98)}.prompt button:active{transform:scale(.99)}.prompt button:disabled{cursor:wait;opacity:.62}.primary{background:linear-gradient(180deg,#2f91ff,#0b74e5);color:#fff;box-shadow:0 8px 18px rgba(11,116,229,.2)}.secondary{background:#e9eaec;color:#22252a}.status{min-height:18px;margin-top:14px;color:#667085;font-size:12px;line-height:18px}</style></head><body><main class="card"><div class="title">\u767B\u5F55\u6388\u6743\u6210\u529F</div><div class="desc">\u4F60\u53EF\u4EE5\u5173\u95ED\u6B64\u9875\u9762\uFF0C\u8FD4\u56DE\u667A\u80FD\u4F53\u6216\u7EC8\u7AEF\u7EE7\u7EED\u4F7F\u7528\u3002</div><div class="user">${esc(userId)}</div></main>${returnAction}${returnScript}</body></html>`;
501
506
  }
502
- function resolveBrowserOpenCommand(url, platform = process.platform) {
507
+ function defaultFileExists(file) {
508
+ try {
509
+ return existsSync3(file);
510
+ } catch {
511
+ return false;
512
+ }
513
+ }
514
+ function firstExisting(candidates, exists) {
515
+ return candidates.find((candidate) => exists(candidate)) ?? null;
516
+ }
517
+ function resolveWindowsRundll32Path(env = process.env, exists = defaultFileExists) {
518
+ const systemRoot = (env.SystemRoot || env.windir || env.WINDIR || "C:\\Windows").replace(/[\\/]+$/, "");
519
+ return firstExisting(
520
+ [
521
+ // 常规路径;32 位进程下会被 WOW64 重定向到 SysWOW64,同样可正常 ShellExecute。
522
+ `${systemRoot}\\System32\\rundll32.exe`,
523
+ // 仅 32 位进程可见的虚拟目录,作为兜底;64 位进程探测会返回 false。
524
+ `${systemRoot}\\Sysnative\\rundll32.exe`
525
+ ],
526
+ exists
527
+ ) ?? "rundll32.exe";
528
+ }
529
+ function closeHttpServer(server, onClosed, graceMs = 500) {
530
+ let closed = false;
531
+ let timer = null;
532
+ const done = () => {
533
+ if (closed) return;
534
+ closed = true;
535
+ if (timer) clearTimeout(timer);
536
+ onClosed();
537
+ };
538
+ try {
539
+ server.close(done);
540
+ server.closeIdleConnections?.();
541
+ timer = setTimeout(() => {
542
+ try {
543
+ server.closeAllConnections?.();
544
+ } catch {
545
+ }
546
+ done();
547
+ }, graceMs);
548
+ timer.unref?.();
549
+ } catch {
550
+ done();
551
+ }
552
+ }
553
+ function resolveBrowserOpenCommand(url, platform = process.platform, options = {}) {
554
+ const exists = options.exists ?? defaultFileExists;
555
+ const env = options.env ?? process.env;
503
556
  if (platform === "win32") {
504
- return { file: "rundll32.exe", args: ["url.dll,FileProtocolHandler", url] };
557
+ return { file: resolveWindowsRundll32Path(env, exists), args: ["url.dll,FileProtocolHandler", url] };
558
+ }
559
+ if (platform === "darwin") {
560
+ return { file: firstExisting(["/usr/bin/open"], exists) ?? "open", args: [url] };
505
561
  }
506
- if (platform === "darwin") return { file: "open", args: [url] };
507
- return { file: "xdg-open", args: [url] };
562
+ return { file: firstExisting(["/usr/bin/xdg-open", "/bin/xdg-open"], exists) ?? "xdg-open", args: [url] };
563
+ }
564
+ function describeOpenFailure(error) {
565
+ if (error instanceof Error) {
566
+ const code = error.code;
567
+ return code ? `${code}: ${error.message}` : error.message;
568
+ }
569
+ return String(error);
508
570
  }
509
571
  function openUrlInBrowser(url, ctx) {
510
572
  const command = resolveBrowserOpenCommand(url);
511
573
  execFile(command.file, command.args, (error) => {
512
574
  if (error) {
513
- ctx.logger.warn("Could not open browser automatically. Copy the login URL manually.");
575
+ ctx.logger.warn(
576
+ `Could not open browser automatically (${command.file}: ${describeOpenFailure(error)}). Copy the login URL manually.`
577
+ );
514
578
  }
515
579
  });
516
580
  }
@@ -538,7 +602,16 @@ function resolvePromotionKeyword(agentType) {
538
602
  );
539
603
  return matched ? matched.keyword : "";
540
604
  }
541
- function buildE10AuthorizeUrl(baseUrl, redirectUri, agentType, promotionKeyword = resolvePromotionKeyword(agentType)) {
605
+ var PROMOTION_SOURCES = {
606
+ qianwen: "188",
607
+ doubao: "187",
608
+ workbuddy: "186"
609
+ };
610
+ function resolvePromotionSource(promotionKeyword) {
611
+ if (!promotionKeyword) return "";
612
+ return PROMOTION_SOURCES[promotionKeyword] || "";
613
+ }
614
+ function buildE10AuthorizeUrl(baseUrl, redirectUri, agentType, promotionKeyword = resolvePromotionKeyword(agentType), promotionSource = resolvePromotionSource(promotionKeyword)) {
542
615
  const authorizeParams = new URLSearchParams({
543
616
  redirect_uri: redirectUri,
544
617
  response_type: "code",
@@ -547,6 +620,7 @@ function buildE10AuthorizeUrl(baseUrl, redirectUri, agentType, promotionKeyword
547
620
  from: agentType
548
621
  });
549
622
  if (promotionKeyword) authorizeParams.set("promotionKeyword", promotionKeyword);
623
+ if (promotionSource) authorizeParams.set("promotionSource", promotionSource);
550
624
  return `${baseUrl}/papi/sso/oauth2.0/authorize?${authorizeParams.toString()}`;
551
625
  }
552
626
  function isTlsClientHello(error) {
@@ -662,9 +736,12 @@ async function oidcExchange(code, redirectUri, baseUrl, tenantKeyFallback, agent
662
736
  redirect: "manual"
663
737
  });
664
738
  const tokenData = await readJsonObject(tokenResp);
665
- if (tokenResp.status >= 400) {
666
- const message = readString(tokenData, "message", "msg", "error_description", "error") || `OAuth token exchange failed: ${tokenResp.status}`;
667
- throw new CliError(message, 3 /* AuthError */);
739
+ const businessStatus = Number(tokenData.status);
740
+ const businessFailed = Number.isFinite(businessStatus) && businessStatus >= 400;
741
+ if (tokenResp.status >= 400 || businessFailed) {
742
+ const message = readString(tokenData, "message", "msg", "error_description", "error") || `OAuth token exchange failed: ${businessFailed ? businessStatus : tokenResp.status}`;
743
+ const code2 = readString(tokenData, "code");
744
+ throw new CliError(code2 ? `${message} (code ${code2})` : message, 3 /* AuthError */);
668
745
  }
669
746
  let eteamsId = readString(tokenData, "eteamsId", "eteamsid");
670
747
  let userId = readString(tokenData, "id", "userId", "employeeId");
@@ -842,7 +919,7 @@ async function runXiaoELogin(ctx, options) {
842
919
  ));
843
920
  throw error;
844
921
  }
845
- async function runBrowserLogin(ctx, options) {
922
+ async function runBrowserLogin(ctx, options, loginMode = {}) {
846
923
  const commandOpts = asOptions(options);
847
924
  const globalOptions = ctx.getGlobalOptions();
848
925
  const profileFromGlobal = globalOptions.profile;
@@ -857,35 +934,43 @@ async function runBrowserLogin(ctx, options) {
857
934
  const hostKey = target.hostKey;
858
935
  const baseUrl = normalizeUrl(explicitBaseUrl || target.cfg.baseUrl || resolveDefaultE10BaseUrl(ctx.env));
859
936
  const tenantKey = optionString(commandOpts, "tenantKey");
860
- const portText = optionString(commandOpts, "port") || "19800";
861
- const port = Number.parseInt(portText, 10);
862
- if (!Number.isInteger(port) || port <= 0 || port > 65535) {
937
+ const explicitPort = optionString(commandOpts, "port");
938
+ const portText = explicitPort || "19800";
939
+ let port = Number(portText);
940
+ if (!/^\d+$/u.test(portText) || !Number.isInteger(port) || port < 0 || port > 65535) {
863
941
  throw new CliError("Invalid --port value", 2 /* UsageError */);
864
942
  }
865
- const agentReturnTarget = resolveAgentReturnTarget(commandOpts, ctx.env, agentType);
943
+ const machineMode = loginMode.machine === true || isMachineAuthMode();
944
+ const agentReturnTarget = loginMode.machine === true ? null : resolveAgentReturnTarget(commandOpts, ctx.env, agentType, { machine: machineMode });
866
945
  const agentReturnToken = agentReturnTarget ? randomBytes(24).toString("base64url") : "";
867
- const redirectUri = `http://127.0.0.1:${port}/callback`;
868
- const loginUrl = buildE10AuthorizeUrl(baseUrl, redirectUri, agentType);
869
- ctx.logger.info("Open browser login: " + loginUrl);
946
+ const successHeaders = {
947
+ "cache-control": "no-store",
948
+ "content-security-policy": agentReturnTarget ? `default-src 'none'; style-src 'unsafe-inline'; script-src 'nonce-${agentReturnToken}'; connect-src 'self'` : `default-src 'none'; style-src 'unsafe-inline'`,
949
+ "content-type": "text/html; charset=utf-8",
950
+ "referrer-policy": "no-referrer",
951
+ "x-content-type-options": "nosniff",
952
+ "x-frame-options": "DENY"
953
+ };
954
+ let redirectUri = "";
955
+ if (machineMode && !agentReturnTarget) {
956
+ ctx.logger.info("Machine mode: closing the callback server right after authorization.");
957
+ }
870
958
  ctx.logger.info("Waiting for E10 authorization callback...");
871
959
  return await new Promise((resolve8, reject) => {
872
960
  let settled = false;
873
961
  let timer = null;
874
962
  let pendingLoginResult = null;
875
963
  let tlsCallbackDetected = false;
964
+ let exchanging = false;
965
+ let retriedPort = false;
876
966
  const finish = (error, result) => {
877
967
  if (settled) return;
878
968
  settled = true;
879
969
  if (timer) clearTimeout(timer);
880
- const complete = () => {
970
+ closeHttpServer(server, () => {
881
971
  if (error) reject(error);
882
972
  else resolve8(result);
883
- };
884
- try {
885
- server.close(complete);
886
- } catch {
887
- complete();
888
- }
973
+ });
889
974
  };
890
975
  const server = createServer(async (req, res) => {
891
976
  const callbackUrl = new URL(req.url || "/", `http://127.0.0.1:${port}`);
@@ -915,8 +1000,10 @@ async function runBrowserLogin(ctx, options) {
915
1000
  res.writeHead(200, { "cache-control": "no-store", "content-type": "application/json; charset=utf-8" });
916
1001
  res.end('{"ok":true}');
917
1002
  finish(null, result);
918
- } catch {
919
- ctx.logger.warn(`Could not open ${agentReturnTarget.label} automatically.`);
1003
+ } catch (openError) {
1004
+ ctx.logger.warn(
1005
+ `Could not open ${agentReturnTarget.label} automatically (${describeOpenFailure(openError)}).`
1006
+ );
920
1007
  res.writeHead(500, { "cache-control": "no-store", "content-type": "text/plain; charset=utf-8" });
921
1008
  res.end(`\u65E0\u6CD5\u6253\u5F00 ${agentReturnTarget.label}\uFF0C\u8BF7\u786E\u8BA4\u5E94\u7528\u5DF2\u5B89\u88C5\u3002`);
922
1009
  }
@@ -927,6 +1014,16 @@ async function runBrowserLogin(ctx, options) {
927
1014
  res.end("Not found");
928
1015
  return;
929
1016
  }
1017
+ if (pendingLoginResult) {
1018
+ res.writeHead(200, successHeaders);
1019
+ res.end(renderE10LoginSuccessPage(pendingLoginResult.userId, agentReturnTarget, agentReturnToken));
1020
+ return;
1021
+ }
1022
+ if (exchanging || settled) {
1023
+ res.writeHead(409, { "cache-control": "no-store", "content-type": "text/plain; charset=utf-8" });
1024
+ res.end("Authorization callback already received.");
1025
+ return;
1026
+ }
930
1027
  const error = callbackUrl.searchParams.get("error");
931
1028
  const code = callbackUrl.searchParams.get("code");
932
1029
  const redirectAgentType = explicitAgentType || callbackUrl.searchParams.get("agent_type") || callbackUrl.searchParams.get("agentType") || callbackUrl.searchParams.get("from") || agentType;
@@ -948,22 +1045,15 @@ async function runBrowserLogin(ctx, options) {
948
1045
  timer = null;
949
1046
  }
950
1047
  try {
1048
+ exchanging = true;
951
1049
  const result = await oidcExchange(code, redirectUri, baseUrl, tenantKey, redirectAgentType, profileFromGlobal, hostKey);
952
- const responseHeaders = {
953
- "cache-control": "no-store",
954
- "content-security-policy": agentReturnTarget ? `default-src 'none'; style-src 'unsafe-inline'; script-src 'nonce-${agentReturnToken}'; connect-src 'self'` : `default-src 'none'; style-src 'unsafe-inline'`,
955
- "content-type": "text/html; charset=utf-8",
956
- "referrer-policy": "no-referrer",
957
- "x-content-type-options": "nosniff",
958
- "x-frame-options": "DENY"
959
- };
960
- res.writeHead(200, responseHeaders);
1050
+ pendingLoginResult = result;
1051
+ res.writeHead(200, successHeaders);
961
1052
  res.end(renderE10LoginSuccessPage(result.userId, agentReturnTarget, agentReturnToken));
962
1053
  if (!agentReturnTarget) {
963
1054
  finish(null, result);
964
1055
  return;
965
1056
  }
966
- pendingLoginResult = result;
967
1057
  if (timer) clearTimeout(timer);
968
1058
  timer = setTimeout(() => finish(null, result), AGENT_RETURN_TIMEOUT_MS);
969
1059
  } catch (exchangeError) {
@@ -974,6 +1064,12 @@ async function runBrowserLogin(ctx, options) {
974
1064
  }
975
1065
  });
976
1066
  server.on("error", (error) => {
1067
+ if (error.code === "EADDRINUSE" && !explicitPort && !retriedPort) {
1068
+ retriedPort = true;
1069
+ ctx.logger.warn(`Port ${port} is already in use. Using an available callback port.`);
1070
+ server.listen(0, "127.0.0.1");
1071
+ return;
1072
+ }
977
1073
  const message = error.code === "EADDRINUSE" ? `Port ${port} is already in use. Retry with --port ${port + 1}.` : error.code === "EACCES" ? `Port ${port} is not accessible. Retry with another --port.` : error.message;
978
1074
  finish(new CliError(message, 2 /* UsageError */));
979
1075
  });
@@ -996,10 +1092,20 @@ async function runBrowserLogin(ctx, options) {
996
1092
  }
997
1093
  socket.destroy();
998
1094
  });
999
- server.listen(port, "127.0.0.1", () => {
1095
+ server.once("listening", () => {
1096
+ const address = server.address();
1097
+ if (!address || typeof address === "string") {
1098
+ finish(new CliError("Could not resolve local OAuth callback port.", 2 /* UsageError */));
1099
+ return;
1100
+ }
1101
+ port = address.port;
1102
+ redirectUri = `http://127.0.0.1:${port}/callback`;
1103
+ const loginUrl = buildE10AuthorizeUrl(baseUrl, redirectUri, agentType);
1104
+ ctx.logger.info("Open browser login: " + loginUrl);
1000
1105
  ctx.logger.info("Local callback server: " + redirectUri);
1001
1106
  openUrlInBrowser(loginUrl, ctx);
1002
1107
  });
1108
+ server.listen(port, "127.0.0.1");
1003
1109
  timer = setTimeout(() => {
1004
1110
  finish(new CliError("Login timed out after 5 minutes.", 3 /* AuthError */));
1005
1111
  }, 3e5);
@@ -1130,7 +1236,7 @@ logFile: ${result.path}`;
1130
1236
  }));
1131
1237
  }
1132
1238
  function registerBrowserLoginCommand(auth, action, name, description, machine = false) {
1133
- const command = auth.command(name).description(description).option("--base-url <url>", "E10 base URL (defaults to https://weapp.eteams.cn)").option("--tenant-key <key>", "Tenant key fallback after login").option("--port <n>", "Local OAuth callback port", "19800").option("--agent_type <value>", "Agent type sent to E10 authorize endpoint").option("--agent-type <value>", "Alias of --agent_type").option("--agent-return-url <url>", "Desktop application URL linked by the login success page");
1239
+ const command = auth.command(name).description(description).option("--base-url <url>", "E10 base URL (defaults to https://weapp.eteams.cn)").option("--tenant-key <key>", "Tenant key fallback after login").option("--port <n>", "Local OAuth callback port (default: 19800 with automatic fallback; 0 selects an available port)").option("--agent_type <value>", "Agent type sent to E10 authorize endpoint").option("--agent-type <value>", "Alias of --agent_type").option("--agent-return-url <url>", "Desktop application URL linked by the login success page");
1134
1240
  command.action(action(async (ctx, options) => {
1135
1241
  if (!machine) {
1136
1242
  const result = await runBrowserLogin(ctx, options);
@@ -1139,7 +1245,7 @@ function registerBrowserLoginCommand(auth, action, name, description, machine =
1139
1245
  }
1140
1246
  ctx.logger.machineMode = true;
1141
1247
  try {
1142
- const result = await runBrowserLogin(ctx, options);
1248
+ const result = await runBrowserLogin(ctx, options, { machine: true });
1143
1249
  ctx.output.raw(JSON.stringify({
1144
1250
  status: "authorized",
1145
1251
  employeeId: result.userId || "",
@@ -1705,10 +1811,10 @@ var runCommand = {
1705
1811
  };
1706
1812
 
1707
1813
  // src/cmd/setup/index.ts
1708
- import { existsSync as existsSync4 } from "node:fs";
1814
+ import { existsSync as existsSync5 } from "node:fs";
1709
1815
 
1710
1816
  // src/internal/skills/install.ts
1711
- import { cpSync as cpSync2, existsSync as existsSync3, mkdirSync, readFileSync as readFileSync2, readdirSync as readdirSync2, statSync, writeFileSync } from "node:fs";
1817
+ import { cpSync as cpSync2, existsSync as existsSync4, mkdirSync, readFileSync as readFileSync2, readdirSync as readdirSync2, statSync, writeFileSync } from "node:fs";
1712
1818
  import { homedir } from "node:os";
1713
1819
  import { basename, posix, relative, resolve as resolve3, sep, win32 } from "node:path";
1714
1820
  var SKILL_PREFIX = "weaver-e10-";
@@ -1794,7 +1900,7 @@ function resolveSkillsRoot(env = process.env, options = {}) {
1794
1900
  }
1795
1901
  const codexRoot = hostSkillsRoot("codex", env, options);
1796
1902
  const workBuddyRoot = hostSkillsRoot("workbuddy", env, options);
1797
- const pathExists = options.pathExists ?? existsSync3;
1903
+ const pathExists = options.pathExists ?? existsSync4;
1798
1904
  if (host === "unknown") {
1799
1905
  const existing = [
1800
1906
  { root: codexRoot, host: "codex" },
@@ -1844,7 +1950,7 @@ function normalizePackagedSkillName(value) {
1844
1950
  return trimmed.startsWith(SKILL_PREFIX) ? trimmed : `${SKILL_PREFIX}${trimmed}`;
1845
1951
  }
1846
1952
  function resolvePackagedSkillNames(sourceRoot, requested = "all") {
1847
- const available = readdirSync2(sourceRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && existsSync3(resolve3(sourceRoot, entry.name, "SKILL.md"))).map((entry) => entry.name).sort();
1953
+ const available = readdirSync2(sourceRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && existsSync4(resolve3(sourceRoot, entry.name, "SKILL.md"))).map((entry) => entry.name).sort();
1848
1954
  const normalized = normalizePackagedSkillName(requested);
1849
1955
  if (!normalized || normalized === "all") return available;
1850
1956
  if (!available.includes(normalized)) {
@@ -1907,7 +2013,7 @@ function installPackagedSkills(sourceRoot, targetRoot, requested = "all") {
1907
2013
  }
1908
2014
  function productMetadataContent(sourceRoot) {
1909
2015
  const productPath = productMetadataPath(sourceRoot);
1910
- if (!existsSync3(productPath)) return null;
2016
+ if (!existsSync4(productPath)) return null;
1911
2017
  const product = JSON.parse(readFileSync2(productPath, "utf8"));
1912
2018
  const packageInfo = readPackageInfo(resolve3(sourceRoot, "..", "package.json"));
1913
2019
  const metadata = {
@@ -1926,11 +2032,11 @@ function productMetadataContent(sourceRoot) {
1926
2032
  }
1927
2033
  function productMetadataPath(sourceRoot) {
1928
2034
  const templatePath = resolve3(sourceRoot, "..", "skill-template", "product.json");
1929
- if (existsSync3(templatePath)) return templatePath;
2035
+ if (existsSync4(templatePath)) return templatePath;
1930
2036
  return resolve3(sourceRoot, "product.json");
1931
2037
  }
1932
2038
  function readPackageInfo(packagePath2) {
1933
- if (!existsSync3(packagePath2)) return null;
2039
+ if (!existsSync4(packagePath2)) return null;
1934
2040
  return JSON.parse(readFileSync2(packagePath2, "utf8"));
1935
2041
  }
1936
2042
  function stringOrEmpty(value) {
@@ -2003,7 +2109,7 @@ var setupCommand = {
2003
2109
  },
2004
2110
  {
2005
2111
  name: "e10Auth",
2006
- ok: Boolean(authFile && existsSync4(authFile)),
2112
+ ok: Boolean(authFile && existsSync5(authFile)),
2007
2113
  detail: authFile || "not found"
2008
2114
  }
2009
2115
  ];
@@ -2051,11 +2157,11 @@ var setupCommand = {
2051
2157
  };
2052
2158
 
2053
2159
  // src/cmd/skills/index.ts
2054
- import { existsSync as existsSync6 } from "node:fs";
2160
+ import { existsSync as existsSync7 } from "node:fs";
2055
2161
  import { spawnSync } from "node:child_process";
2056
2162
 
2057
2163
  // src/internal/skills/detector.ts
2058
- import { existsSync as existsSync5, readFileSync as readFileSync3 } from "node:fs";
2164
+ import { existsSync as existsSync6, readFileSync as readFileSync3 } from "node:fs";
2059
2165
  import { join, resolve as resolve4 } from "node:path";
2060
2166
  var PACKAGED_DETECTOR_VERSION = "1.0.13";
2061
2167
  var PACKAGED_DETECTOR_NAME = `weaver-skill-detector-${PACKAGED_DETECTOR_VERSION}`;
@@ -2071,7 +2177,7 @@ function legacySiblingDetectorDir() {
2071
2177
  function detectorVersion(detectorDir) {
2072
2178
  let version = PACKAGED_DETECTOR_VERSION;
2073
2179
  const metaPath = join(detectorDir, "_meta.json");
2074
- if (existsSync5(metaPath)) {
2180
+ if (existsSync6(metaPath)) {
2075
2181
  try {
2076
2182
  const meta = JSON.parse(readFileSync3(metaPath, "utf8"));
2077
2183
  if (typeof meta.version === "string" && meta.version) version = meta.version;
@@ -2085,7 +2191,7 @@ function resolveDetectorInfo(detectorDir) {
2085
2191
  const candidates = detectorDir ? [resolve4(detectorDir)] : [packagedDetectorDir(), legacySiblingDetectorDir()].map((candidate) => resolve4(candidate));
2086
2192
  for (const candidate of candidates) {
2087
2193
  const scriptPath = detectorScriptPath(candidate);
2088
- if (existsSync5(scriptPath)) {
2194
+ if (existsSync6(scriptPath)) {
2089
2195
  return { detectorDir: candidate, scriptPath, version: detectorVersion(candidate) };
2090
2196
  }
2091
2197
  }
@@ -2225,7 +2331,7 @@ function parseFrontmatter(content) {
2225
2331
  // src/cmd/skills/index.ts
2226
2332
  var SKILLS_DIR2 = packagePath("skills");
2227
2333
  function reader() {
2228
- if (!existsSync6(SKILLS_DIR2)) {
2334
+ if (!existsSync7(SKILLS_DIR2)) {
2229
2335
  throw new CliError("skills directory does not exist: " + SKILLS_DIR2);
2230
2336
  }
2231
2337
  return new SkillReader(SKILLS_DIR2);
@@ -2530,7 +2636,7 @@ import { homedir as homedir2 } from "node:os";
2530
2636
  import { resolve as resolve7 } from "node:path";
2531
2637
 
2532
2638
  // src/core/config-store.ts
2533
- import { existsSync as existsSync7, mkdirSync as mkdirSync2, readFileSync as readFileSync5, writeFileSync as writeFileSync2 } from "node:fs";
2639
+ import { existsSync as existsSync8, mkdirSync as mkdirSync2, readFileSync as readFileSync5, writeFileSync as writeFileSync2 } from "node:fs";
2534
2640
  import { dirname } from "node:path";
2535
2641
  var ConfigStore = class {
2536
2642
  constructor(getPath) {
@@ -2542,7 +2648,7 @@ var ConfigStore = class {
2542
2648
  }
2543
2649
  all() {
2544
2650
  const filePath = this.path();
2545
- if (!existsSync7(filePath)) return {};
2651
+ if (!existsSync8(filePath)) return {};
2546
2652
  try {
2547
2653
  const value = JSON.parse(readFileSync5(filePath, "utf-8"));
2548
2654
  return value && typeof value === "object" && !Array.isArray(value) ? value : {};
@@ -3,13 +3,13 @@ const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  readCache,
5
5
  writeCache
6
- } from "./chunk-ILALC2N6.js";
6
+ } from "./chunk-KYDXWYFB.js";
7
7
  import {
8
8
  SCHEMA_DATETIME_MINUTE,
9
9
  meetingSuccess,
10
10
  meetingValidationError,
11
11
  schemaOf
12
- } from "./chunk-DTCQFTHW.js";
12
+ } from "./chunk-4AFWOGOV.js";
13
13
 
14
14
  // src/shortcuts/meeting/operations/eb/schedule.ts
15
15
  var SCHEDULE_TYPE_PATH = "/api/ebuilder/form/formdata/v2/getFormDataList/queryAgendaType";
@@ -110,9 +110,9 @@ async function runScheduleConflictFlow(env, input) {
110
110
  if (!employeeId) {
111
111
  throw meetingValidationError("schedule_employee_required", "\u53D6\u4E0D\u5230\u5F53\u524D\u767B\u5F55\u7528\u6237 id\uFF0C\u65E0\u6CD5\u89E6\u53D1 ESB \u65E5\u7A0B\u67E5\u8BE2");
112
112
  }
113
- const { createEsbHost } = await import("./host-GOJHHTPY.js");
113
+ const { createEsbHost } = await import("./host-P7G22WNM.js");
114
114
  const { createEsbContinuationSigner } = await import("./continuation-KI7DRRZN.js");
115
- const { getEsbOperation } = await import("./registry-7RS74TCK.js");
115
+ const { getEsbOperation } = await import("./registry-QRMXRSCT.js");
116
116
  const esbEnv = {
117
117
  ctx: env.ctx,
118
118
  host: createEsbHost(env.ctx),
@@ -331,7 +331,7 @@ async function resolveMemberIdsByName(env, names) {
331
331
  const unique = [...new Set(names)].filter((name) => name !== "");
332
332
  if (unique.length === 0) return map;
333
333
  try {
334
- const { hrmEmployeeOperations } = await import("./employee-DR5Y64TI.js");
334
+ const { hrmEmployeeOperations } = await import("./employee-PGMY6NI6.js");
335
335
  const query = hrmEmployeeOperations.find((operation) => operation.name === "hrm.employee.query");
336
336
  if (!query) return map;
337
337
  for (const name of unique) {
@@ -2,7 +2,7 @@ import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
3
  import {
4
4
  meetingStateDir
5
- } from "./chunk-E5YD5JWR.js";
5
+ } from "./chunk-3PCXBG4H.js";
6
6
 
7
7
  // src/shortcuts/meeting/operations/eb/cache.ts
8
8
  import { mkdir, readFile, writeFile } from "node:fs/promises";
@@ -11,11 +11,13 @@ import {
11
11
  createE10RequestRuntime,
12
12
  isE10SessionExpiredResponse,
13
13
  requireE10Session
14
- } from "./chunk-NRYDJN4J.js";
14
+ } from "./chunk-FJUOUSV3.js";
15
+ import {
16
+ E10_SESSION_EXPIRED_MESSAGE
17
+ } from "./chunk-TJN4PIYO.js";
15
18
  import {
16
- E10_SESSION_EXPIRED_MESSAGE,
17
19
  getActiveProfile
18
- } from "./chunk-WIWDVETN.js";
20
+ } from "./chunk-FDBAFANU.js";
19
21
 
20
22
  // src/shortcuts/im/host.ts
21
23
  import { createHash } from "node:crypto";
@@ -319,30 +321,34 @@ function createImHost(ctx, dependencies = {}) {
319
321
  const batch = miss.slice(i, i + 100);
320
322
  const res = await request({
321
323
  method: "POST",
322
- path: "/api/hrm/common/getEmployeeByIds",
323
- body: { userIdList: batch, externalIdList: [] },
324
- headers: { devtype: "5" },
324
+ path: "/api/hrm/common/browser/destData/resource",
325
+ body: { browserMultiple: true, selectIds: batch.join(",") },
325
326
  operation: "im.person.resolveByIds",
326
327
  timeoutMs: 15e3
327
328
  });
328
- const list = res?.data?.userList;
329
- if (Array.isArray(list)) {
330
- for (const u of list) {
331
- const brief = {
332
- uid: String(u.id ?? ""),
333
- name: String(u.name ?? ""),
334
- cid: String(u.imCid ?? u.cid ?? ""),
335
- jobNum: String(u.jobNum ?? u.job_num ?? ""),
336
- department: String(u.department ?? ""),
337
- departmentId: String(u.departmentId ?? u.department_id ?? ""),
338
- subCompany: String(u.subCompany ?? u.subcompany ?? ""),
339
- position: String(u.position ?? ""),
340
- mobile: String(u.mobile ?? "")
341
- };
342
- if (brief.uid) {
343
- personCache.set(brief.uid, brief);
344
- result[brief.uid] = brief;
345
- }
329
+ const d = res?.data ?? {};
330
+ const list = Array.isArray(d) ? d : Array.isArray(d.datas) ? d.datas : Array.isArray(d.data) ? d.data : Array.isArray(d.userList) ? d.userList : Array.isArray(d.rows) ? d.rows : null;
331
+ if (!list) {
332
+ throw imValidationError(
333
+ "person_resolve_unexpected_shape",
334
+ `\u4EBA\u5458\u6279\u91CF\u89E3\u6790\u54CD\u5E94\u7ED3\u6784\u5F02\u5E38\uFF08keys=${Object.keys(d).join(",")}\uFF09`
335
+ );
336
+ }
337
+ for (const u of list) {
338
+ const brief = {
339
+ uid: String(u.id ?? u.mainId ?? ""),
340
+ name: String(u.name ?? ""),
341
+ cid: String(u.imCid ?? u.cid ?? ""),
342
+ jobNum: String(u.jobNum ?? u.number ?? u.job_num ?? ""),
343
+ department: String(u.department ?? ""),
344
+ departmentId: String(u.departmentId ?? u.department_id ?? ""),
345
+ subCompany: String(u.subCompany ?? u.subcompany ?? ""),
346
+ position: String(u.position ?? ""),
347
+ mobile: String(u.mobile ?? "")
348
+ };
349
+ if (brief.uid) {
350
+ personCache.set(brief.uid, brief);
351
+ result[brief.uid] = brief;
346
352
  }
347
353
  }
348
354
  }
@@ -5,13 +5,13 @@ import {
5
5
  } from "./chunk-WMRNO6IU.js";
6
6
  import {
7
7
  meetingStateDir
8
- } from "./chunk-E5YD5JWR.js";
8
+ } from "./chunk-3PCXBG4H.js";
9
9
  import {
10
10
  SCHEMA_ID,
11
11
  meetingSuccess,
12
12
  meetingValidationError,
13
13
  schemaOf
14
- } from "./chunk-DTCQFTHW.js";
14
+ } from "./chunk-4AFWOGOV.js";
15
15
 
16
16
  // src/shortcuts/meeting/operations/attachment-content.ts
17
17
  import { mkdir, writeFile } from "node:fs/promises";