weaver-work-cli 0.1.71 → 0.1.75

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 (324) hide show
  1. package/README.md +37 -1
  2. package/dist/chunks/{archive-5P33NAUN.js → archive-OZJ6PYUR.js} +14 -9
  3. package/dist/chunks/{archive-oa-YTY5D7DG.js → archive-oa-BHL5RK2F.js} +10 -7
  4. package/dist/chunks/{asset-3Q5MFQBX.js → asset-HKRFRQR2.js} +10 -7
  5. package/dist/chunks/{asset-idle-PQPNYIS7.js → asset-idle-GGIR4KE7.js} +7 -4
  6. package/dist/chunks/{attachment-content-7CN7JB6B.js → attachment-content-4OV65NK5.js} +3 -3
  7. package/dist/chunks/{blog-MFHHK6ZR.js → blog-HYDP4DV3.js} +10 -7
  8. package/dist/chunks/{caizhilian-OZ435AYW.js → caizhilian-JS4RQZ6Z.js} +10 -7
  9. package/dist/chunks/{calendar-TNJXS5UC.js → calendar-SWRY4DIT.js} +10 -7
  10. package/dist/chunks/chunk-257JXJGD.js +30 -0
  11. package/dist/chunks/{chunk-FRMDHZSN.js → chunk-2AUFKU2D.js} +11 -11
  12. package/dist/chunks/chunk-2BZ7TY4M.js +49 -0
  13. package/dist/chunks/{chunk-WM33BSIL.js → chunk-2QCCXPNU.js} +1 -1
  14. package/dist/chunks/{chunk-X2C5CGGM.js → chunk-4FCBEWNB.js} +74 -68
  15. package/dist/chunks/{chunk-YN5SD4TX.js → chunk-5D2V7ZAN.js} +2 -2
  16. package/dist/chunks/{chunk-UPVAQJKS.js → chunk-5QUTQHXF.js} +282 -158
  17. package/dist/chunks/{chunk-SKWKCLJX.js → chunk-5ZJGPEIB.js} +2 -2
  18. package/dist/chunks/chunk-7DE3VMZD.js +35 -0
  19. package/dist/chunks/chunk-BNKUHN4N.js +1346 -0
  20. package/dist/chunks/{chunk-VMVMEIL3.js → chunk-BSR5TM7U.js} +4 -4
  21. package/dist/chunks/{chunk-EJLP63UO.js → chunk-ERZY6GYL.js} +7 -3
  22. package/dist/chunks/{chunk-OFCF23FY.js → chunk-FEZK536Z.js} +25 -9
  23. package/dist/chunks/{chunk-Q3EXRNB4.js → chunk-I6NOHKEK.js} +1 -1
  24. package/dist/chunks/{chunk-OZ7CJC7W.js → chunk-J7FAAHWH.js} +2 -2
  25. package/dist/chunks/{chunk-6MMSLE6K.js → chunk-JJONWB5N.js} +16 -2
  26. package/dist/chunks/chunk-JOY3HZXL.js +467 -0
  27. package/dist/chunks/{chunk-2DNCKZRX.js → chunk-JWF2R6EQ.js} +0 -462
  28. package/dist/chunks/{chunk-ICNUOWLL.js → chunk-KEA4XQPO.js} +4 -4
  29. package/dist/chunks/chunk-KINXYJXM.js +205 -0
  30. package/dist/chunks/{chunk-VJWVB55R.js → chunk-KWJEICD4.js} +2 -2
  31. package/dist/chunks/{chunk-P3AFNAJ6.js → chunk-LJI4N6FV.js} +1 -1
  32. package/dist/chunks/{chunk-DRJYPXKC.js → chunk-MXCRKXOP.js} +48 -6
  33. package/dist/chunks/{chunk-OPTJ6IF7.js → chunk-NWYHCZTY.js} +1 -1
  34. package/dist/chunks/chunk-OJ4JPD25.js +428 -0
  35. package/dist/chunks/{chunk-B4NINGP2.js → chunk-OQCK5SAU.js} +2 -2
  36. package/dist/chunks/chunk-PG5YSNYY.js +1166 -0
  37. package/dist/chunks/{chunk-LU2SPJYY.js → chunk-QJWVYOOV.js} +2 -2
  38. package/dist/chunks/{chunk-SUWR5QEG.js → chunk-QVKRNL7L.js} +287 -305
  39. package/dist/chunks/chunk-SU6IJD6D.js +49 -0
  40. package/dist/chunks/{chunk-MD5RXRI3.js → chunk-TA2RBUTH.js} +2 -2
  41. package/dist/chunks/{chunk-SSS75WXW.js → chunk-U6Y32KEV.js} +2 -2
  42. package/dist/chunks/chunk-UUJK76HV.js +209 -0
  43. package/dist/chunks/{chunk-GB2MCJPG.js → chunk-VOMDD2C5.js} +1 -1
  44. package/dist/chunks/chunk-Y3C6MDL7.js +28 -0
  45. package/dist/chunks/chunk-ZM7RN2IM.js +38 -0
  46. package/dist/chunks/{chunk-G7ZM2VOX.js → chunk-ZUB4M4N3.js} +38 -36
  47. package/dist/chunks/{chunk-XLSJC6JZ.js → chunk-ZWIMLT6P.js} +8 -7
  48. package/dist/chunks/cli-FULPXIKJ.js +226 -0
  49. package/dist/chunks/commands-BNWFNTD3.js +70 -0
  50. package/dist/chunks/{conflict-Y4PXZ2YQ.js → conflict-5BKCDV2F.js} +2 -2
  51. package/dist/chunks/{contract-C3BGUMBM.js → contract-WI23OXVC.js} +12446 -5964
  52. package/dist/chunks/{cowork-2AWG4QLA.js → cowork-DZBBVNMQ.js} +11 -8
  53. package/dist/chunks/{create-flow-LOUOK46Z.js → create-flow-7ZRBRKX7.js} +6 -6
  54. package/dist/chunks/{data-BSFYMXVO.js → data-PAZVE6QE.js} +6 -3
  55. package/dist/chunks/{ebuilder-form-LAAMTD2Y.js → ebuilder-form-5SQXIGXN.js} +9 -6
  56. package/dist/chunks/{ehr-36KEX5SH.js → ehr-CX5F4ZAU.js} +27 -19
  57. package/dist/chunks/{entry-mode-6N2IGCS4.js → entry-mode-I2BYNONZ.js} +3 -3
  58. package/dist/chunks/{env-QYLS3EB3.js → env-ZAQZ7EHN.js} +2 -2
  59. package/dist/chunks/{esb-PTYS3E67.js → esb-DQTXDIBF.js} +10 -7
  60. package/dist/chunks/{factory-LPFPKZ4T.js → factory-XRI6KZ7H.js} +1 -1
  61. package/dist/chunks/{fna-JNHCLRDE.js → fna-FK6HQVJL.js} +13 -8
  62. package/dist/chunks/{group-chat-QP2WX4QJ.js → group-chat-MLWNYM2P.js} +3 -3
  63. package/dist/chunks/{host-C2BLBIID.js → host-3EPREGXS.js} +6 -3
  64. package/dist/chunks/{host-QXFKQXNX.js → host-J74JGYAW.js} +6 -3
  65. package/dist/chunks/{host-57LSRSE7.js → host-KUMU3DDK.js} +6 -3
  66. package/dist/chunks/{host-7BVR7CQ3.js → host-MEC4VQZA.js} +6 -3
  67. package/dist/chunks/{host-NS36QFLR.js → host-T6NNQGVZ.js} +6 -3
  68. package/dist/chunks/{host-K2ZKNXME.js → host-VI7Q45PM.js} +6 -3
  69. package/dist/chunks/{hrm-FSGO4NSH.js → hrm-KKVAW4P5.js} +8 -5
  70. package/dist/chunks/{im-2BFGS2XO.js → im-47CIWQNL.js} +7 -4
  71. package/dist/chunks/{invoice-JKLTTHSZ.js → invoice-CDYRBNIG.js} +21 -16
  72. package/dist/chunks/{jiuchuanhui-PTABJE7V.js → jiuchuanhui-M7QTRHZK.js} +17 -10
  73. package/dist/chunks/{lazy-dispatch-YN2ZP3CS.js → lazy-dispatch-FKQJZFI5.js} +22 -8
  74. package/dist/chunks/{mail-YNO7ZZUK.js → mail-NRBS5N6Y.js} +11 -8
  75. package/dist/chunks/{meeting-NIDHDBCB.js → meeting-WC5LD3IO.js} +22 -18
  76. package/dist/chunks/{minute-doc-G3QAT7DE.js → minute-doc-OQUMDTKG.js} +4 -4
  77. package/dist/chunks/{okr-QC52G6AJ.js → okr-EHKSKMPL.js} +10 -7
  78. package/dist/chunks/{operations-MQV32ITT.js → operations-V5VM5MS2.js} +7 -4
  79. package/dist/chunks/{performance-3MQ3AHDQ.js → performance-ZJADXJPN.js} +6 -3
  80. package/dist/chunks/{plan-ISINIEPY.js → plan-OTDNBDJ7.js} +10 -7
  81. package/dist/chunks/{project-IJ6DVKT7.js → project-4XVBQ3HX.js} +10 -7
  82. package/dist/chunks/{reception-3H5LUG2I.js → reception-3FAHOOH7.js} +118 -45
  83. package/dist/chunks/{recruit-stage-MIOJXP6W.js → recruit-stage-3WTVWW2K.js} +1056 -191
  84. package/dist/chunks/register-SQOPIR2G.js +16 -0
  85. package/dist/chunks/{registry-3S7AVMXR.js → registry-F4YFZLOD.js} +7 -3
  86. package/dist/chunks/registry-NBTBXR4L.js +30 -0
  87. package/dist/chunks/{registry-NHHKOEU3.js → registry-TJGCVRCW.js} +7 -4
  88. package/dist/chunks/{room-recommend-IOKBJVYP.js → room-recommend-KL62XB2Y.js} +4 -4
  89. package/dist/chunks/root-YZG2TS5W.js +16 -0
  90. package/dist/chunks/{schedule-IB6EUARH.js → schedule-XOISYUPB.js} +4 -4
  91. package/dist/chunks/{smart-extract-N2TK3CEF.js → smart-extract-UYGNV3BM.js} +15 -7
  92. package/dist/chunks/update-AV5VOXGY.js +13 -0
  93. package/dist/chunks/{workflow-RINBAL2M.js → workflow-V54LJPXL.js} +15 -10
  94. package/dist/cli.js +40 -0
  95. package/dist/cmd/action.js +3 -1
  96. package/dist/cmd/doctor/index.js +1 -1
  97. package/dist/cmd/e10/index.js +1 -1
  98. package/dist/cmd/identity/index.js +5 -8
  99. package/dist/cmd/index.js +2 -0
  100. package/dist/cmd/setup/index.js +1 -1
  101. package/dist/cmd/update/index.js +38 -0
  102. package/dist/core/manifest-view.js +1 -1
  103. package/dist/core/output.js +12 -1
  104. package/dist/core/runtime-agent.js +13 -0
  105. package/dist/core/update-notice.js +23 -0
  106. package/dist/index.js +105 -198
  107. package/dist/internal/e10/auth/agent-host-key.js +16 -0
  108. package/dist/internal/e10/auth/agent-hosts.js +45 -9
  109. package/dist/internal/e10/auth/commands.js +66 -36
  110. package/dist/internal/e10/auth/session.js +30 -15
  111. package/dist/internal/e10/auth/xiaoe.js +4 -20
  112. package/dist/internal/e10/auth-recovery.js +44 -4
  113. package/dist/internal/e10/context.js +5 -2
  114. package/dist/internal/update/bootstrap.js +96 -0
  115. package/dist/internal/update/npm.js +78 -0
  116. package/dist/internal/update/service.js +252 -0
  117. package/dist/internal/update/store.js +135 -0
  118. package/dist/shortcuts/archive/index.js +2 -2
  119. package/dist/shortcuts/archive/manifest.js +1 -0
  120. package/dist/shortcuts/archive/operations/search.js +3 -1
  121. package/dist/shortcuts/archive-oa/index.js +1 -1
  122. package/dist/shortcuts/asset/index.js +1 -1
  123. package/dist/shortcuts/asset-idle/index.js +1 -1
  124. package/dist/shortcuts/blog/index.js +1 -1
  125. package/dist/shortcuts/caizhilian/index.js +1 -1
  126. package/dist/shortcuts/calendar/index.js +1 -1
  127. package/dist/shortcuts/contract/data/bi-config.js +156 -0
  128. package/dist/shortcuts/contract/data/collection-ledger-html.js +189 -0
  129. package/dist/shortcuts/contract/data/collection-node-catalog.js +226 -0
  130. package/dist/shortcuts/contract/data/metric-catalog.js +154 -20
  131. package/dist/shortcuts/contract/data/report-renderers.js +414 -0
  132. package/dist/shortcuts/contract/data/report-spec.js +132 -0
  133. package/dist/shortcuts/contract/error-actions.js +114 -0
  134. package/dist/shortcuts/contract/host.js +12 -3
  135. package/dist/shortcuts/contract/index.js +17 -1
  136. package/dist/shortcuts/contract/manifest.js +398 -3
  137. package/dist/shortcuts/contract/ooxml/docx-table.js +48 -0
  138. package/dist/shortcuts/contract/operations/bi-preview.js +131 -0
  139. package/dist/shortcuts/contract/operations/bizreview-report.js +496 -0
  140. package/dist/shortcuts/contract/operations/collection-node.js +229 -0
  141. package/dist/shortcuts/contract/operations/docx-slots.js +735 -16
  142. package/dist/shortcuts/contract/operations/draft-build.js +940 -0
  143. package/dist/shortcuts/contract/operations/draft-submit.js +229 -0
  144. package/dist/shortcuts/contract/operations/first-screen.js +3 -2
  145. package/dist/shortcuts/contract/operations/generated-submit.js +175 -0
  146. package/dist/shortcuts/contract/operations/ledger-report.js +233 -0
  147. package/dist/shortcuts/contract/operations/ledger-stat.js +1400 -0
  148. package/dist/shortcuts/contract/operations/ledger.js +4 -1
  149. package/dist/shortcuts/contract/operations/metrics.js +9 -3
  150. package/dist/shortcuts/contract/operations/ops-draft.js +527 -0
  151. package/dist/shortcuts/contract/operations/page.js +9 -0
  152. package/dist/shortcuts/contract/operations/quote-submit.js +55 -229
  153. package/dist/shortcuts/contract/operations/registry.js +20 -0
  154. package/dist/shortcuts/contract/operations/sign-launch.js +256 -0
  155. package/dist/shortcuts/contract/operations/viewlink.js +334 -0
  156. package/dist/shortcuts/cowork/index.js +2 -2
  157. package/dist/shortcuts/ebuilder-form/index.js +1 -1
  158. package/dist/shortcuts/ehr/index.js +2 -2
  159. package/dist/shortcuts/ehr/manifest.js +1 -1
  160. package/dist/shortcuts/ehr/operations/recruit-position.js +11 -5
  161. package/dist/shortcuts/ehr/operations/recruit-short-cache.js +6 -2
  162. package/dist/shortcuts/ehr/operations/recruit-write.js +10 -9
  163. package/dist/shortcuts/ehr/operations/recruit.js +390 -196
  164. package/dist/shortcuts/ehr/operations/shared.js +51 -0
  165. package/dist/shortcuts/esb/index.js +1 -1
  166. package/dist/shortcuts/fna/index.js +1 -1
  167. package/dist/shortcuts/fna/manifest.js +1 -0
  168. package/dist/shortcuts/fna/operations/expense-chart.js +3 -1
  169. package/dist/shortcuts/hrm/index.js +1 -1
  170. package/dist/shortcuts/invoice/index.js +1 -1
  171. package/dist/shortcuts/jiuchuanhui/index.js +2 -2
  172. package/dist/shortcuts/jiuchuanhui/manifest.js +3 -0
  173. package/dist/shortcuts/mail/index.js +2 -2
  174. package/dist/shortcuts/meeting/index.js +1 -1
  175. package/dist/shortcuts/meeting/manifest.js +1 -0
  176. package/dist/shortcuts/meeting/operations/eb/catalog.js +5 -3
  177. package/dist/shortcuts/meeting/operations/eb/conflict.js +3 -1
  178. package/dist/shortcuts/meeting/operations/eb/create-flow.js +10 -9
  179. package/dist/shortcuts/meeting/operations/eb/factory.js +2 -0
  180. package/dist/shortcuts/meeting/operations/eb/member-expand.js +3 -2
  181. package/dist/shortcuts/meeting/operations/invitation-publish.js +3 -3
  182. package/dist/shortcuts/meeting/operations/invitation.js +4 -4
  183. package/dist/shortcuts/meeting/operations/link.js +3 -1
  184. package/dist/shortcuts/okr/index.js +1 -1
  185. package/dist/shortcuts/performance/index.js +1 -1
  186. package/dist/shortcuts/plan/index.js +1 -1
  187. package/dist/shortcuts/project/index.js +1 -1
  188. package/dist/shortcuts/reception/constants.js +22 -0
  189. package/dist/shortcuts/reception/index.js +4 -0
  190. package/dist/shortcuts/reception/manifest.js +16 -2
  191. package/dist/shortcuts/reception/operations/doc.js +24 -11
  192. package/dist/shortcuts/reception/operations/docrender.js +18 -1
  193. package/dist/shortcuts/reception/operations/render-assets.js +93 -22
  194. package/dist/shortcuts/recruit-stage/context.js +22 -8
  195. package/dist/shortcuts/recruit-stage/index.js +16 -3
  196. package/dist/shortcuts/recruit-stage/operations/interview-arrange.js +20 -11
  197. package/dist/shortcuts/recruit-stage/operations/interview-feedback.js +1 -1
  198. package/dist/shortcuts/recruit-stage/operations/jd-create.js +467 -26
  199. package/dist/shortcuts/recruit-stage/operations/list.js +73 -2
  200. package/dist/shortcuts/recruit-stage/operations/profile.js +13 -5
  201. package/dist/shortcuts/recruit-stage/operations/registry.js +18 -2
  202. package/dist/shortcuts/recruit-stage/operations/resume-import.js +363 -54
  203. package/dist/shortcuts/recruit-stage/operations/search.js +80 -16
  204. package/dist/shortcuts/recruit-stage/operations/shortlist.js +124 -0
  205. package/dist/shortcuts/recruit-stage/shared.js +174 -56
  206. package/dist/shortcuts/smart-extract/manifest.js +1 -0
  207. package/dist/shortcuts/smart-extract/operations/fill.js +7 -2
  208. package/dist/shortcuts/smart-extract/operations/validate.js +4 -1
  209. package/dist/shortcuts/workflow/index.js +2 -2
  210. package/dist/shortcuts/workflow/manifest.js +1 -0
  211. package/dist/shortcuts/workflow/operations/aiDeepRead/render.js +4 -1
  212. package/dist/shortcuts/workflow/operations/deepRead.js +23 -2
  213. package/dist/shortcuts/workflow/operations/form.js +44 -4
  214. package/docs/contract.md +6 -1
  215. package/docs/e10-auth.md +25 -7
  216. package/docs/operation-manual.md +15 -0
  217. package/package.json +2 -2
  218. package/scripts/pysite/__pycache__/sitecustomize.cpython-314.pyc +0 -0
  219. package/skill-template/business-info.json +28 -0
  220. package/skill-template/domains/jinchengda.md +13 -1
  221. package/skills/weaver-e10-archive-oa/references/source-manifest.json +3 -3
  222. package/skills/weaver-e10-caizhilian/references/auth-and-install.md +2 -1
  223. package/skills/weaver-e10-caizhilian/references/source-manifest.json +3 -3
  224. package/skills/weaver-e10-esb/references/source-manifest.json +3 -3
  225. package/skills/weaver-e10-jinchengda/SKILL.md +90 -32
  226. package/skills/weaver-e10-jinchengda/references/contract-ai-review.md +45 -0
  227. package/skills/weaver-e10-jinchengda/references/contract-bizreview-report-template.html +68 -0
  228. package/skills/weaver-e10-jinchengda/references/contract-bizreview.md +216 -0
  229. package/skills/weaver-e10-jinchengda/references/contract-clause-negotiate.md +215 -0
  230. package/skills/weaver-e10-jinchengda/references/contract-collection-node.md +113 -0
  231. package/skills/weaver-e10-jinchengda/references/contract-command-index.md +19 -3
  232. package/skills/weaver-e10-jinchengda/references/contract-decisions.md +114 -0
  233. package/skills/weaver-e10-jinchengda/references/contract-doc-triage.md +53 -44
  234. package/skills/weaver-e10-jinchengda/references/contract-element-extract.md +1 -1
  235. package/skills/weaver-e10-jinchengda/references/contract-field-extract-other-flows.md +1 -1
  236. package/skills/weaver-e10-jinchengda/references/contract-firstscreen-guide.md +200 -0
  237. package/skills/weaver-e10-jinchengda/references/contract-ledger-catalog.md +18 -1
  238. package/skills/weaver-e10-jinchengda/references/contract-ledger-query-playbook.md +138 -3
  239. package/skills/weaver-e10-jinchengda/references/contract-ledger-report.md +158 -0
  240. package/skills/weaver-e10-jinchengda/references/contract-ledger-rules.md +3 -1
  241. package/skills/weaver-e10-jinchengda/references/contract-material-gap.md +139 -0
  242. package/skills/weaver-e10-jinchengda/references/contract-object-detect.md +2 -2
  243. package/skills/weaver-e10-jinchengda/references/contract-open-web-pages.md +10 -3
  244. package/skills/weaver-e10-jinchengda/references/contract-ops-draft.md +106 -0
  245. package/skills/weaver-e10-jinchengda/references/contract-performance-query.md +1 -1
  246. package/skills/weaver-e10-jinchengda/references/contract-quote-to-contract.md +176 -56
  247. package/skills/weaver-e10-jinchengda/references/contract-sign-launch.md +123 -0
  248. package/skills/weaver-e10-jinchengda/references/contract-smart-draft.md +410 -0
  249. package/skills/weaver-e10-jinchengda/references/contract-template-recommend.md +1 -1
  250. package/skills/weaver-e10-jinchengda/references/contract-viewlink.md +110 -0
  251. package/skills/weaver-e10-jinchengda/references/orchestration.md +38 -24
  252. package/skills/weaver-e10-jucailin/SKILL.md +7 -3
  253. package/skills/weaver-e10-jucailin/references/recruit-output-links.md +33 -0
  254. package/skills/weaver-e10-jucailin/references/recruit-write.md +2 -0
  255. package/skills/weaver-e10-meeting/SKILL.md +13 -0
  256. package/skills/weaver-e10-okr/SKILL.md +11 -0
  257. package/skills/weaver-e10-okr/references/source-manifest.json +7 -6
  258. package/skills/weaver-e10-performance/SKILL.md +131 -39
  259. package/skills/weaver-e10-performance/agents/openai.yaml +48 -17
  260. package/skills/weaver-e10-performance/references/default-assembly.md +3 -0
  261. package/skills/weaver-e10-performance/references/extraction-guide.md +17 -3
  262. package/skills/weaver-e10-performance/references/flow-assess.md +38 -5
  263. package/skills/weaver-e10-performance/references/scheme-setting-page.md +20 -3
  264. package/skills/weaver-e10-performance/scripts/assemble_scheme.py +461 -0
  265. package/skills/weaver-e10-performance/scripts/parse_appraisal_doc.py +41 -0
  266. package/skills/weaver-e10-plan/SKILL.md +10 -0
  267. package/skills/weaver-e10-plan/references/source-manifest.json +13 -13
  268. package/skills/weaver-e10-qiyecheng/SKILL.md +2 -2
  269. package/skills/weaver-e10-qiyecheng/references/source-manifest.json +9 -9
  270. package/skills/weaver-e10-reception-flow/SKILL.md +97 -41
  271. package/skills/weaver-e10-reception-flow/references/guide.md +3 -1
  272. package/skills/weaver-e10-recruit-stage/SKILL.md +533 -137
  273. package/skills/weaver-e10-recruit-stage/agents/openai.yaml +103 -62
  274. package/skills/weaver-e10-recruit-stage/lib/interview-conflict.mjs +282 -0
  275. package/skills/weaver-e10-recruit-stage/lib/interview-summary.mjs +331 -0
  276. package/skills/weaver-e10-recruit-stage/lib/recruit-shortlist.mjs +865 -0
  277. package/skills/weaver-e10-recruit-stage/lib/recruit-write-helper.mjs +162 -11
  278. package/skills/weaver-e10-recruit-stage/lib/recruit-xiaoe-file.mjs +15 -1
  279. package/skills/weaver-e10-recruit-stage/lib/report-attachment.mjs +38 -0
  280. package/skills/weaver-e10-recruit-stage/lib/xiaoe-session.mjs +5 -1
  281. package/skills/weaver-e10-recruit-stage/references/env-fixed-values.md +6 -2
  282. package/skills/weaver-e10-recruit-stage/references/env-ziyong.md +4 -0
  283. package/skills/weaver-e10-recruit-stage/references/position-templates.md +26 -21
  284. package/skills/weaver-e10-recruit-stage/references/recruit-arrange-interview.md +33 -27
  285. package/skills/weaver-e10-recruit-stage/references/recruit-capability-check.md +11 -7
  286. package/skills/weaver-e10-recruit-stage/references/recruit-check-install.md +5 -1
  287. package/skills/weaver-e10-recruit-stage/references/recruit-detail-process.md +5 -1
  288. package/skills/weaver-e10-recruit-stage/references/recruit-edit-interview-feedback.md +22 -5
  289. package/skills/weaver-e10-recruit-stage/references/recruit-failure-fallback.md +42 -0
  290. package/skills/weaver-e10-recruit-stage/references/recruit-interview-not-attended.md +11 -7
  291. package/skills/weaver-e10-recruit-stage/references/recruit-jd-create.md +87 -50
  292. package/skills/weaver-e10-recruit-stage/references/recruit-jd-template.md +4 -0
  293. package/skills/weaver-e10-recruit-stage/references/recruit-list-candidate.md +4 -0
  294. package/skills/weaver-e10-recruit-stage/references/recruit-list-interview.md +48 -3
  295. package/skills/weaver-e10-recruit-stage/references/recruit-maint.md +45 -0
  296. package/skills/weaver-e10-recruit-stage/references/recruit-match-candidates.md +17 -11
  297. package/skills/weaver-e10-recruit-stage/references/recruit-my-positions.md +8 -4
  298. package/skills/weaver-e10-recruit-stage/references/recruit-output-links.md +162 -31
  299. package/skills/weaver-e10-recruit-stage/references/recruit-platform-compat.md +55 -0
  300. package/skills/weaver-e10-recruit-stage/references/recruit-report-templates.md +75 -0
  301. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-creator.md +4 -0
  302. package/skills/weaver-e10-recruit-stage/references/recruit-resolve-metadata.md +12 -8
  303. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import-batch.md +8 -4
  304. package/skills/weaver-e10-recruit-stage/references/recruit-resume-import.md +80 -46
  305. package/skills/weaver-e10-recruit-stage/references/recruit-resume-parse.md +11 -7
  306. package/skills/weaver-e10-recruit-stage/references/recruit-search-by-tag.md +12 -8
  307. package/skills/weaver-e10-recruit-stage/references/recruit-search-candidate.md +10 -6
  308. package/skills/weaver-e10-recruit-stage/references/recruit-tag-recommend.md +15 -11
  309. package/skills/weaver-e10-recruit-stage/references/recruit-urge-feedback.md +7 -3
  310. package/skills/weaver-e10-recruit-stage/references/recruit-utterance-glossary.md +7 -3
  311. package/skills/weaver-e10-recruit-stage/templates/candidate-evidence.html +119 -0
  312. package/skills/weaver-e10-recruit-stage/templates/interview-summary.html +322 -0
  313. package/skills/weaver-e10-recruit-stage/templates/match-report.html +166 -76
  314. package/skills/weaver-e10-shared/SKILL.md +40 -5
  315. package/skills/weaver-e10-shared/references/e10-auth-and-session.md +11 -1
  316. package/skills/weaver-e10-shared/references/json-output-contract.md +144 -8
  317. package/skills/weaver-e10-shared/references/weaver-e10-installation.md +11 -0
  318. package/skills/weaver-e10-shijingran/references/source-manifest.json +3 -3
  319. package/skills/weaver-e10-wenshuding/references/source-manifest.json +3 -3
  320. package/skills/weaver-e10-workflow/references/source-manifest.json +3 -3
  321. package/skills/weaver-e10-yepiaotong/references/source-manifest.json +5 -5
  322. package/dist/chunks/chunk-MZVQKQP5.js +0 -2849
  323. package/dist/chunks/registry-3GQRYP2R.js +0 -27
  324. package/skills/weaver-e10-jucailin/references/source-manifest.json +0 -152
@@ -1,35 +1,91 @@
1
1
  import { createRequire as __esbuildCreateRequire } from 'node:module';
2
2
  const require = __esbuildCreateRequire(import.meta.url);
3
+ import {
4
+ isConnectorMode
5
+ } from "./chunk-Y3C6MDL7.js";
6
+ import {
7
+ isXiaoEHostEnvironment,
8
+ isXiaoERuntimeAgent
9
+ } from "./chunk-7DE3VMZD.js";
10
+ import {
11
+ packagePath
12
+ } from "./chunk-2BZ7TY4M.js";
3
13
  import {
4
14
  CliError
5
15
  } from "./chunk-UG5G54VL.js";
6
16
 
7
- // src/internal/e10/auth/session.ts
8
- import { constants, createDecipheriv as createDecipheriv2, createHash, publicEncrypt } from "node:crypto";
9
- import { existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync3, readdirSync, unlinkSync as unlinkSync2 } from "node:fs";
10
- import { dirname as dirname2, resolve as resolve4 } from "node:path";
17
+ // src/internal/e10/auth/paths.ts
18
+ import { homedir } from "node:os";
19
+ import { resolve } from "node:path";
20
+ function getE10AuthRoot() {
21
+ const override = process.env.WEAVER_WORK_CLI_AUTH_ROOT?.trim();
22
+ return override ? resolve(override) : resolve(homedir(), ".weaver-work-cli", "e10");
23
+ }
24
+ function getE10ProfilesRoot() {
25
+ return resolve(getE10AuthRoot(), "profiles");
26
+ }
27
+ function getE10ActiveProfilePath() {
28
+ return resolve(getE10AuthRoot(), "profile");
29
+ }
30
+ function getE10AgentsPath() {
31
+ return resolve(getE10AuthRoot(), "agents.json");
32
+ }
11
33
 
12
- // src/core/connector.ts
13
- var CONNECTOR_PROFILE = "eteams";
14
- function isConnectorEnabled(value) {
15
- if (value === void 0 || value === null || value === false) return false;
16
- if (value === true) return true;
17
- const normalized = String(value).trim().toLowerCase();
18
- return normalized === "" || normalized === "true" || normalized === "1" || normalized === "yes";
19
- }
20
- var connectorMode = false;
21
- function isConnectorMode() {
22
- return connectorMode;
23
- }
24
- function normalizeGlobalOptions(options) {
25
- if (!isConnectorEnabled(options.isConnector)) {
26
- connectorMode = false;
27
- return options;
28
- }
29
- connectorMode = true;
30
- return { ...options, profile: CONNECTOR_PROFILE };
34
+ // src/internal/e10/auth/agent-host-key.ts
35
+ function hasEnvPrefix(env, prefix) {
36
+ return Object.keys(env).some((key) => key === prefix || key.startsWith(`${prefix}_`));
37
+ }
38
+ var AGENT_HOST_PREFIXES = [
39
+ { key: "xiaoe", prefixes: ["XIAOE", "WEAVER_XIAOE"] },
40
+ { key: "workbuddy", prefixes: ["WORKBUDDY"] },
41
+ { key: "codex", prefixes: ["CODEX"] },
42
+ { key: "doubao", prefixes: ["DOUBAO_OFFICE", "DOUBAO"] },
43
+ { key: "qwen", prefixes: ["QWENWORK", "QWEN"] }
44
+ ];
45
+ var DEFAULT_AGENT_HOST_KEY = "default";
46
+ function resolveSessionHostKey(env, options = {}) {
47
+ if (isXiaoERuntimeAgent(options.runtimeAgent)) return "xiaoe";
48
+ return resolveAgentHostKey(env, options.runtimeAgent);
49
+ }
50
+ function isIsolatedAgentHost(hostKey) {
51
+ return hostKey === "workbuddy" || hostKey === "xiaoe";
52
+ }
53
+ function matchesAgentHost(hostKey, agentType) {
54
+ if (hostKey === "xiaoe") return isXiaoERuntimeAgent(agentType);
55
+ if (hostKey === "workbuddy") return normalizeAgentHostKey(agentType) === "workbuddy";
56
+ return true;
57
+ }
58
+ function normalizeAgentHostKey(value) {
59
+ return value.trim().toLowerCase().replace(/[^a-z0-9]+/gu, "");
60
+ }
61
+ function normalizeExplicitAgentHostKey(value) {
62
+ const normalized = normalizeAgentHostKey(value);
63
+ if (!normalized) return "";
64
+ for (const { key, prefixes } of AGENT_HOST_PREFIXES) {
65
+ if (normalized === normalizeAgentHostKey(key)) return key;
66
+ if (prefixes.some((prefix) => normalized.startsWith(normalizeAgentHostKey(prefix)))) return key;
67
+ }
68
+ return normalized;
69
+ }
70
+ function resolveAgentHostKey(env = process.env, explicitAgentType = "") {
71
+ const explicit = normalizeExplicitAgentHostKey(explicitAgentType);
72
+ if (explicit) return explicit;
73
+ for (const { key, prefixes } of AGENT_HOST_PREFIXES) {
74
+ if (prefixes.some((prefix) => hasEnvPrefix(env, prefix))) return key;
75
+ }
76
+ return DEFAULT_AGENT_HOST_KEY;
31
77
  }
32
78
 
79
+ // src/internal/e10/auth/agent-hosts.ts
80
+ import { chmodSync, closeSync, existsSync as existsSync2, mkdirSync as mkdirSync2, openSync, readFileSync as readFileSync2, renameSync, unlinkSync, writeFileSync as writeFileSync2 } from "node:fs";
81
+ import { dirname, resolve as resolve3 } from "node:path";
82
+
83
+ // src/internal/e10/auth/crypto.ts
84
+ import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
85
+ import { existsSync, mkdirSync, readFileSync } from "node:fs";
86
+ import { createRequire } from "node:module";
87
+ import { resolve as resolve2 } from "node:path";
88
+
33
89
  // src/core/write-with-retry.ts
34
90
  import { writeFileSync } from "node:fs";
35
91
  var RETRIABLE_WRITE_ERRORS = /* @__PURE__ */ new Set(["EPERM", "EACCES", "EBUSY", "ENOTEMPTY"]);
@@ -52,117 +108,6 @@ function writeWithRetry(path, data, options) {
52
108
  }
53
109
  }
54
110
 
55
- // src/internal/e10/network-error.ts
56
- var NETWORK_ERROR_CODES = /* @__PURE__ */ new Set([
57
- "ECONNREFUSED",
58
- "ECONNRESET",
59
- "ECONNABORTED",
60
- "EHOSTUNREACH",
61
- "EHOSTDOWN",
62
- "ENETUNREACH",
63
- "ENETDOWN",
64
- "ENETRESET",
65
- "ENOTFOUND",
66
- "EAI_AGAIN",
67
- "EPIPE",
68
- "ETIMEDOUT",
69
- "ESOCKETTIMEDOUT",
70
- "ERR_SOCKET_CONNECTION_TIMEOUT",
71
- "UND_ERR_CONNECT_TIMEOUT",
72
- "UND_ERR_HEADERS_TIMEOUT",
73
- "UND_ERR_BODY_TIMEOUT",
74
- "UND_ERR_SOCKET",
75
- "UND_ERR_CLOSED",
76
- "UND_ERR_ABORTED",
77
- "CERT_HAS_EXPIRED",
78
- "DEPTH_ZERO_SELF_SIGNED_CERT",
79
- "SELF_SIGNED_CERT_IN_CHAIN",
80
- "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
81
- "ERR_TLS_CERT_ALTNAME_INVALID",
82
- "ERR_SSL_WRONG_VERSION_NUMBER"
83
- ]);
84
- var TLS_TRUST_ERROR_CODES = /* @__PURE__ */ new Set([
85
- "DEPTH_ZERO_SELF_SIGNED_CERT",
86
- "SELF_SIGNED_CERT_IN_CHAIN",
87
- "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
88
- "UNABLE_TO_GET_ISSUER_CERT",
89
- "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
90
- "CERT_HAS_EXPIRED",
91
- "CERT_NOT_YET_VALID",
92
- "CERT_UNTRUSTED",
93
- "CERT_REVOKED",
94
- "ERR_TLS_CERT_ALTNAME_INVALID"
95
- ]);
96
- var TLS_TRUST_MESSAGE_PATTERN = /certificate verify failed|self[- ]signed certificate|certificate (?:has )?expired|unable to (?:verify|get) (?:the )?(?:leaf|issuer|local issuer)|certificate chain/i;
97
- var ABORT_ERROR_CODE = "ABORT_ERR";
98
- function asRecord(value) {
99
- return value && typeof value === "object" ? value : null;
100
- }
101
- function readErrorCauseCode(error, maxDepth = 5) {
102
- let current = error;
103
- const seen = /* @__PURE__ */ new Set();
104
- for (let depth = 0; depth < maxDepth; depth += 1) {
105
- if (current === void 0 || current === null || seen.has(current)) return void 0;
106
- seen.add(current);
107
- if (current instanceof Error && current.name === "AbortError") return ABORT_ERROR_CODE;
108
- const record = asRecord(current);
109
- if (!record) return void 0;
110
- if (record.name === "AbortError") return ABORT_ERROR_CODE;
111
- const code = record.code;
112
- if (typeof code === "string" && code) return code;
113
- const errno = record.errno;
114
- if (typeof errno === "string" && errno) return errno;
115
- if (typeof errno === "number") return String(errno);
116
- current = record.cause;
117
- }
118
- return void 0;
119
- }
120
- function isAbortError(error) {
121
- if (error instanceof Error && error.name === "AbortError") return true;
122
- return asRecord(error)?.name === "AbortError";
123
- }
124
- function isNetworkErrorCode(code) {
125
- return typeof code === "string" && NETWORK_ERROR_CODES.has(code.toUpperCase());
126
- }
127
- function isTlsTrustErrorCode(code) {
128
- return typeof code === "string" && TLS_TRUST_ERROR_CODES.has(code.toUpperCase());
129
- }
130
- function looksLikeTlsTrustMessage(message) {
131
- return TLS_TRUST_MESSAGE_PATTERN.test(message);
132
- }
133
- var TRANSPORT_MESSAGE_PATTERN = /fetch failed|socket hang up|other side closed|network|connection (?:refused|reset|closed)|timed? ?out|timeout|certificate|getaddrinfo|dns lookup/i;
134
- function looksLikeTransportMessage(message) {
135
- return TRANSPORT_MESSAGE_PATTERN.test(message);
136
- }
137
- function createTimeoutSignal(timeoutMs) {
138
- const controller = new AbortController();
139
- const timer = setTimeout(() => controller.abort(), timeoutMs);
140
- return { signal: controller.signal, clear: () => clearTimeout(timer) };
141
- }
142
-
143
- // src/internal/e10/auth/crypto.ts
144
- import { createCipheriv, createDecipheriv, randomBytes } from "node:crypto";
145
- import { existsSync, mkdirSync, readFileSync } from "node:fs";
146
- import { createRequire } from "node:module";
147
- import { resolve as resolve2 } from "node:path";
148
-
149
- // src/internal/e10/auth/paths.ts
150
- import { homedir } from "node:os";
151
- import { resolve } from "node:path";
152
- function getE10AuthRoot() {
153
- const override = process.env.WEAVER_WORK_CLI_AUTH_ROOT?.trim();
154
- return override ? resolve(override) : resolve(homedir(), ".weaver-work-cli", "e10");
155
- }
156
- function getE10ProfilesRoot() {
157
- return resolve(getE10AuthRoot(), "profiles");
158
- }
159
- function getE10ActiveProfilePath() {
160
- return resolve(getE10AuthRoot(), "profile");
161
- }
162
- function getE10AgentsPath() {
163
- return resolve(getE10AuthRoot(), "agents.json");
164
- }
165
-
166
111
  // src/internal/e10/auth/crypto.ts
167
112
  var ALGORITHM = "aes-256-gcm";
168
113
  var IV_LENGTH = 12;
@@ -283,48 +228,11 @@ function parseAuthFile(raw) {
283
228
  }
284
229
  }
285
230
 
286
- // src/internal/e10/auth/agent-hosts.ts
287
- import { chmodSync, closeSync, existsSync as existsSync2, mkdirSync as mkdirSync2, openSync, readFileSync as readFileSync2, renameSync, unlinkSync, writeFileSync as writeFileSync2 } from "node:fs";
288
- import { dirname, resolve as resolve3 } from "node:path";
289
-
290
- // src/internal/e10/auth/agent-host-key.ts
291
- function hasEnvPrefix(env, prefix) {
292
- return Object.keys(env).some((key) => key === prefix || key.startsWith(`${prefix}_`));
293
- }
294
- var AGENT_HOST_PREFIXES = [
295
- { key: "xiaoe", prefixes: ["XIAOE", "WEAVER_XIAOE"] },
296
- { key: "workbuddy", prefixes: ["WORKBUDDY"] },
297
- { key: "codex", prefixes: ["CODEX"] },
298
- { key: "doubao", prefixes: ["DOUBAO_OFFICE", "DOUBAO"] },
299
- { key: "qwen", prefixes: ["QWENWORK", "QWEN"] }
300
- ];
301
- var DEFAULT_AGENT_HOST_KEY = "default";
302
- function normalizeAgentHostKey(value) {
303
- return value.trim().toLowerCase().replace(/[^a-z0-9]+/gu, "");
304
- }
305
- function normalizeExplicitAgentHostKey(value) {
306
- const normalized = normalizeAgentHostKey(value);
307
- if (!normalized) return "";
308
- for (const { key, prefixes } of AGENT_HOST_PREFIXES) {
309
- if (normalized === normalizeAgentHostKey(key)) return key;
310
- if (prefixes.some((prefix) => normalized.startsWith(normalizeAgentHostKey(prefix)))) return key;
311
- }
312
- return normalized;
313
- }
314
- function resolveAgentHostKey(env = process.env, explicitAgentType = "") {
315
- const explicit = normalizeExplicitAgentHostKey(explicitAgentType);
316
- if (explicit) return explicit;
317
- for (const { key, prefixes } of AGENT_HOST_PREFIXES) {
318
- if (prefixes.some((prefix) => hasEnvPrefix(env, prefix))) return key;
319
- }
320
- return DEFAULT_AGENT_HOST_KEY;
321
- }
322
-
323
231
  // src/internal/e10/auth/agent-hosts.ts
324
232
  var AGENTS_FILE_VERSION = 1;
325
233
  var AGENTS_LOCK_TIMEOUT_MS = 600;
326
234
  var AGENTS_LOCK_RETRY_MS = 15;
327
- function asRecord2(value) {
235
+ function asRecord(value) {
328
236
  return value && typeof value === "object" && !Array.isArray(value) ? value : {};
329
237
  }
330
238
  function readText(value) {
@@ -344,12 +252,12 @@ function readAgentHosts() {
344
252
  const filePath = getE10AgentsPath();
345
253
  if (!existsSync2(filePath)) return null;
346
254
  try {
347
- const parsed = asRecord2(JSON.parse(readFileSync2(filePath, "utf-8")));
255
+ const parsed = asRecord(JSON.parse(readFileSync2(filePath, "utf-8")));
348
256
  const version = typeof parsed.version === "number" ? parsed.version : AGENTS_FILE_VERSION;
349
257
  if (!Number.isInteger(version) || version > AGENTS_FILE_VERSION) return null;
350
258
  const hosts = {};
351
- for (const [key, raw] of Object.entries(asRecord2(parsed.hosts))) {
352
- const entry = asRecord2(raw);
259
+ for (const [key, raw] of Object.entries(asRecord(parsed.hosts))) {
260
+ const entry = asRecord(raw);
353
261
  const profile = readText(entry.profile);
354
262
  if (!profile) continue;
355
263
  hosts[key] = {
@@ -393,11 +301,40 @@ function lookupAgentHost(env = process.env, explicitAgentType = "") {
393
301
  }
394
302
  function resolveLoginProfileName(input) {
395
303
  const hinted = (input.profileHint || "").trim();
396
- if (hinted) return hinted;
397
304
  const derived = (input.derivedName || "").trim() || "default";
398
305
  const hostKey = (input.hostKey || "").trim() || resolveAgentHostKey(input.env || process.env);
399
306
  const origin = normalizeOrigin(input.baseUrl);
400
307
  const hosts = readAgentHosts()?.hosts || {};
308
+ const ownedByAnotherHost = (profile) => {
309
+ if (Object.entries(hosts).some(([key, record]) => key !== hostKey && record.profile === profile && (isIsolatedAgentHost(key) || isIsolatedAgentHost(hostKey)))) return true;
310
+ try {
311
+ const data = parseAuthFile(readFileSync2(resolve3(getE10ProfilesRoot(), profile, "auth"), "utf-8"));
312
+ const agentType = data?.agentType || data?.agent_type || "";
313
+ return Boolean(data) && (!matchesAgentHost(hostKey, agentType) || isIsolatedAgentHost(resolveAgentHostKey({}, agentType)) && resolveAgentHostKey({}, agentType) !== hostKey);
314
+ } catch {
315
+ return false;
316
+ }
317
+ };
318
+ if (hinted) {
319
+ if (ownedByAnotherHost(hinted)) {
320
+ throw new CliError(`E10 profile "${hinted}" belongs to another agent host. Select a separate profile for ${hostKey}.`, 3 /* AuthError */);
321
+ }
322
+ return hinted;
323
+ }
324
+ if (isIsolatedAgentHost(hostKey) && !(hosts[hostKey]?.profile === derived && !ownedByAnotherHost(derived))) {
325
+ const isolated = `${derived}-${hostKey}`;
326
+ if (ownedByAnotherHost(isolated)) {
327
+ throw new CliError(`E10 profile "${isolated}" belongs to another agent host. Select a separate profile for ${hostKey}.`, 3 /* AuthError */);
328
+ }
329
+ return isolated;
330
+ }
331
+ if (ownedByAnotherHost(derived)) {
332
+ const isolated = `${derived}-${hostKey}`;
333
+ if (ownedByAnotherHost(isolated)) {
334
+ throw new CliError(`E10 profile "${isolated}" belongs to another agent host. Select a separate profile for ${hostKey}.`, 3 /* AuthError */);
335
+ }
336
+ return isolated;
337
+ }
401
338
  const claimedByOthers = Object.entries(hosts).filter(([key, record]) => key !== hostKey && record.profile === derived);
402
339
  if (!claimedByOthers.length) return derived;
403
340
  const sharesDomain = claimedByOthers.some(([, record]) => normalizeOrigin(record.baseUrl || "") === origin);
@@ -487,6 +424,99 @@ function upsertAgentHost(input) {
487
424
  }
488
425
  }
489
426
 
427
+ // src/internal/e10/auth/session.ts
428
+ import { constants, createDecipheriv as createDecipheriv2, createHash, publicEncrypt } from "node:crypto";
429
+ import { existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync3, readdirSync, unlinkSync as unlinkSync2 } from "node:fs";
430
+ import { dirname as dirname2, resolve as resolve4 } from "node:path";
431
+
432
+ // src/internal/e10/network-error.ts
433
+ var NETWORK_ERROR_CODES = /* @__PURE__ */ new Set([
434
+ "ECONNREFUSED",
435
+ "ECONNRESET",
436
+ "ECONNABORTED",
437
+ "EHOSTUNREACH",
438
+ "EHOSTDOWN",
439
+ "ENETUNREACH",
440
+ "ENETDOWN",
441
+ "ENETRESET",
442
+ "ENOTFOUND",
443
+ "EAI_AGAIN",
444
+ "EPIPE",
445
+ "ETIMEDOUT",
446
+ "ESOCKETTIMEDOUT",
447
+ "ERR_SOCKET_CONNECTION_TIMEOUT",
448
+ "UND_ERR_CONNECT_TIMEOUT",
449
+ "UND_ERR_HEADERS_TIMEOUT",
450
+ "UND_ERR_BODY_TIMEOUT",
451
+ "UND_ERR_SOCKET",
452
+ "UND_ERR_CLOSED",
453
+ "UND_ERR_ABORTED",
454
+ "CERT_HAS_EXPIRED",
455
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
456
+ "SELF_SIGNED_CERT_IN_CHAIN",
457
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
458
+ "ERR_TLS_CERT_ALTNAME_INVALID",
459
+ "ERR_SSL_WRONG_VERSION_NUMBER"
460
+ ]);
461
+ var TLS_TRUST_ERROR_CODES = /* @__PURE__ */ new Set([
462
+ "DEPTH_ZERO_SELF_SIGNED_CERT",
463
+ "SELF_SIGNED_CERT_IN_CHAIN",
464
+ "UNABLE_TO_VERIFY_LEAF_SIGNATURE",
465
+ "UNABLE_TO_GET_ISSUER_CERT",
466
+ "UNABLE_TO_GET_ISSUER_CERT_LOCALLY",
467
+ "CERT_HAS_EXPIRED",
468
+ "CERT_NOT_YET_VALID",
469
+ "CERT_UNTRUSTED",
470
+ "CERT_REVOKED",
471
+ "ERR_TLS_CERT_ALTNAME_INVALID"
472
+ ]);
473
+ var TLS_TRUST_MESSAGE_PATTERN = /certificate verify failed|self[- ]signed certificate|certificate (?:has )?expired|unable to (?:verify|get) (?:the )?(?:leaf|issuer|local issuer)|certificate chain/i;
474
+ var ABORT_ERROR_CODE = "ABORT_ERR";
475
+ function asRecord2(value) {
476
+ return value && typeof value === "object" ? value : null;
477
+ }
478
+ function readErrorCauseCode(error, maxDepth = 5) {
479
+ let current = error;
480
+ const seen = /* @__PURE__ */ new Set();
481
+ for (let depth = 0; depth < maxDepth; depth += 1) {
482
+ if (current === void 0 || current === null || seen.has(current)) return void 0;
483
+ seen.add(current);
484
+ if (current instanceof Error && current.name === "AbortError") return ABORT_ERROR_CODE;
485
+ const record = asRecord2(current);
486
+ if (!record) return void 0;
487
+ if (record.name === "AbortError") return ABORT_ERROR_CODE;
488
+ const code = record.code;
489
+ if (typeof code === "string" && code) return code;
490
+ const errno = record.errno;
491
+ if (typeof errno === "string" && errno) return errno;
492
+ if (typeof errno === "number") return String(errno);
493
+ current = record.cause;
494
+ }
495
+ return void 0;
496
+ }
497
+ function isAbortError(error) {
498
+ if (error instanceof Error && error.name === "AbortError") return true;
499
+ return asRecord2(error)?.name === "AbortError";
500
+ }
501
+ function isNetworkErrorCode(code) {
502
+ return typeof code === "string" && NETWORK_ERROR_CODES.has(code.toUpperCase());
503
+ }
504
+ function isTlsTrustErrorCode(code) {
505
+ return typeof code === "string" && TLS_TRUST_ERROR_CODES.has(code.toUpperCase());
506
+ }
507
+ function looksLikeTlsTrustMessage(message) {
508
+ return TLS_TRUST_MESSAGE_PATTERN.test(message);
509
+ }
510
+ var TRANSPORT_MESSAGE_PATTERN = /fetch failed|socket hang up|other side closed|network|connection (?:refused|reset|closed)|timed? ?out|timeout|certificate|getaddrinfo|dns lookup/i;
511
+ function looksLikeTransportMessage(message) {
512
+ return TRANSPORT_MESSAGE_PATTERN.test(message);
513
+ }
514
+ function createTimeoutSignal(timeoutMs) {
515
+ const controller = new AbortController();
516
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
517
+ return { signal: controller.signal, clear: () => clearTimeout(timer) };
518
+ }
519
+
490
520
  // src/internal/e10/auth/session.ts
491
521
  var E10_TEAMS_CHECK_TIMEOUT_MS = 15e3;
492
522
  var RSA_PUBLIC_KEY_PEM = `-----BEGIN PUBLIC KEY-----
@@ -647,20 +677,30 @@ function clearProfileAuthFile(profile = getActiveProfile()) {
647
677
  unlinkSync2(authFile);
648
678
  return { profile, authFile, cleared: true };
649
679
  }
650
- function resolveActiveProfileForHost(env = process.env) {
651
- const host = lookupAgentHost(env);
652
- return host ? host.profile : getActiveProfile();
653
- }
654
- function findAuthFile(startDir = process.cwd(), options = {}) {
655
- if (options.auth) return options.auth;
680
+ function resolveActiveProfileForHost(env = process.env, options = {}) {
681
+ const hostKey = resolveSessionHostKey(env, options);
682
+ const host = lookupAgentHost(env, hostKey);
683
+ return host ? host.profile : isIsolatedAgentHost(hostKey) ? hostKey : getActiveProfile();
684
+ }
685
+ function findAuthFile(startDir = process.cwd(), options = {}, env = process.env) {
686
+ const hostKey = resolveSessionHostKey(env, options);
687
+ const accept = (path) => {
688
+ if (!isIsolatedAgentHost(hostKey)) return path;
689
+ if (!existsSync3(path)) return null;
690
+ const session = E10AuthSession.fromFile(path);
691
+ return session && matchesAgentHost(hostKey, session.agentType) ? path : null;
692
+ };
693
+ if (options.auth) return accept(options.auth);
656
694
  if (options.profile) {
657
695
  const profileAuth = getProfileAuthPath(options.profile);
658
- if (existsSync3(profileAuth)) return profileAuth;
659
- }
660
- const envAuth = process.env.E10_AUTH_PATH;
661
- if (envAuth && existsSync3(envAuth)) return envAuth;
662
- const host = lookupAgentHost();
663
- if (host) return host.status === "ok" ? host.authFile : null;
696
+ if (existsSync3(profileAuth)) return accept(profileAuth);
697
+ if (isIsolatedAgentHost(hostKey)) return null;
698
+ }
699
+ const envAuth = env.E10_AUTH_PATH;
700
+ if (envAuth && (existsSync3(envAuth) || isIsolatedAgentHost(hostKey))) return accept(envAuth);
701
+ const host = lookupAgentHost(env, hostKey);
702
+ if (host) return host.status === "ok" ? accept(host.authFile) : null;
703
+ if (isIsolatedAgentHost(hostKey)) return null;
664
704
  const activeProfileAuth = getProfileAuthPath(getActiveProfile());
665
705
  if (existsSync3(activeProfileAuth)) return activeProfileAuth;
666
706
  return null;
@@ -871,7 +911,7 @@ var E10AuthSession = class _E10AuthSession {
871
911
  return null;
872
912
  }
873
913
  }
874
- static async fromOptions(options, startDir = process.cwd(), load = {}) {
914
+ static async fromOptions(options, startDir = process.cwd(), load = {}, env = process.env) {
875
915
  let baseUrl = options.baseUrl;
876
916
  let passportUrl = options.passportUrl;
877
917
  if (options.profile) {
@@ -879,7 +919,7 @@ var E10AuthSession = class _E10AuthSession {
879
919
  baseUrl ||= cfg.baseUrl;
880
920
  passportUrl ||= cfg.passportUrl;
881
921
  }
882
- const authPath = findAuthFile(startDir, options);
922
+ const authPath = findAuthFile(startDir, options, env);
883
923
  if (!authPath) return null;
884
924
  const session = _E10AuthSession.fromFile(authPath, baseUrl, passportUrl);
885
925
  if (session && !session.isExpired() && !(load.skipProfileEnrichment && hasUsableUserId(session))) {
@@ -1045,53 +1085,10 @@ var E10AuthSession = class _E10AuthSession {
1045
1085
  };
1046
1086
 
1047
1087
  // src/internal/e10/tls-policy.ts
1048
- import { existsSync as existsSync5, readFileSync as readFileSync4 } from "node:fs";
1088
+ import { existsSync as existsSync4, readFileSync as readFileSync4 } from "node:fs";
1049
1089
  import { homedir as homedir2 } from "node:os";
1050
- import { delimiter, resolve as resolve6 } from "node:path";
1090
+ import { delimiter, resolve as resolve5 } from "node:path";
1051
1091
  import * as tls from "node:tls";
1052
-
1053
- // src/core/package-paths.ts
1054
- import { existsSync as existsSync4, realpathSync } from "node:fs";
1055
- import { dirname as dirname3, join, resolve as resolve5 } from "node:path";
1056
- import { fileURLToPath, pathToFileURL } from "node:url";
1057
- var cachedRoot;
1058
- function entryDirectory(entry) {
1059
- const absoluteEntry = resolve5(entry);
1060
- try {
1061
- return dirname3(realpathSync(absoluteEntry));
1062
- } catch {
1063
- return dirname3(absoluteEntry);
1064
- }
1065
- }
1066
- function packageRootDir() {
1067
- if (cachedRoot) return cachedRoot;
1068
- const seeds = [];
1069
- const entry = process.argv[1];
1070
- if (entry) seeds.push(entryDirectory(entry));
1071
- seeds.push(dirname3(fileURLToPath(import.meta.url)));
1072
- for (const seed of seeds) {
1073
- let dir = seed;
1074
- for (let depth = 0; depth < 10; depth += 1) {
1075
- if (existsSync4(join(dir, "package.json"))) {
1076
- cachedRoot = dir;
1077
- return dir;
1078
- }
1079
- const parent = dirname3(dir);
1080
- if (parent === dir) break;
1081
- dir = parent;
1082
- }
1083
- }
1084
- cachedRoot = process.cwd();
1085
- return cachedRoot;
1086
- }
1087
- function packagePath(...segments) {
1088
- return join(packageRootDir(), ...segments);
1089
- }
1090
- function packageFileUrl(...segments) {
1091
- return pathToFileURL(packagePath(...segments));
1092
- }
1093
-
1094
- // src/internal/e10/tls-policy.ts
1095
1092
  var E10_TLS_CA_FILE_ENV = "WEAVER_E10_CA_FILE";
1096
1093
  var E10_TLS_CA_FILE_ALIASES = ["WEAVER_XIAOE_CA_FILE"];
1097
1094
  var E10_TLS_INSECURE_ENV = "WEAVER_E10_TLS_INSECURE";
@@ -1105,14 +1102,14 @@ function readE10TlsCaFilePaths(env = process.env) {
1105
1102
  for (const candidate of raw.split(/[,\n]/u)) {
1106
1103
  const trimmed = candidate.trim();
1107
1104
  if (!trimmed) continue;
1108
- const absolute = resolve6(expandHome(trimmed));
1105
+ const absolute = resolve5(expandHome(trimmed));
1109
1106
  if (!paths.includes(absolute)) paths.push(absolute);
1110
1107
  }
1111
1108
  return paths;
1112
1109
  }
1113
1110
  function expandHome(value) {
1114
1111
  if (value === "~") return homedir2();
1115
- if (value.startsWith("~/")) return resolve6(homedir2(), value.slice(2));
1112
+ if (value.startsWith("~/")) return resolve5(homedir2(), value.slice(2));
1116
1113
  return value;
1117
1114
  }
1118
1115
  function readE10TlsInsecureSetting(env = process.env) {
@@ -1143,7 +1140,7 @@ function resolveE10TlsPolicy(env = process.env) {
1143
1140
  const problems = [];
1144
1141
  for (const file of configuredFiles) {
1145
1142
  try {
1146
- if (!existsSync5(file)) {
1143
+ if (!existsSync4(file)) {
1147
1144
  problems.push(`${file}: \u6587\u4EF6\u4E0D\u5B58\u5728`);
1148
1145
  continue;
1149
1146
  }
@@ -1264,7 +1261,7 @@ function summarizeE10TlsPolicy(status) {
1264
1261
  }
1265
1262
  function e10TlsPythonSiteDir() {
1266
1263
  const dir = packagePath("scripts", "pysite");
1267
- return existsSync5(dir) ? dir : "";
1264
+ return existsSync4(dir) ? dir : "";
1268
1265
  }
1269
1266
  function e10TlsChildEnv(env = process.env) {
1270
1267
  const policy = resolveE10TlsPolicy(env);
@@ -1285,31 +1282,11 @@ function e10TlsChildEnv(env = process.env) {
1285
1282
  return next;
1286
1283
  }
1287
1284
 
1288
- // src/core/runtime-agent.ts
1289
- var XIAOE_RUNTIME_AGENT_ALIASES = /* @__PURE__ */ new Set([
1290
- "xiaoe",
1291
- "xiaoeclient",
1292
- "\u5C0Fe",
1293
- "\u5C0Fe\u5BA2\u6237\u7AEF",
1294
- "\u667A\u80FD\u5C0Fe",
1295
- "\u667A\u80FD\u5C0Fe\u5BA2\u6237\u7AEF"
1296
- ]);
1297
- function normalizeRuntimeAgent(value) {
1298
- if (typeof value !== "string") return "";
1299
- return value.toLowerCase().replace(/[^a-z0-9\p{Script=Han}]+/gu, "");
1300
- }
1301
- function isXiaoERuntimeAgent(value) {
1302
- return XIAOE_RUNTIME_AGENT_ALIASES.has(normalizeRuntimeAgent(value));
1303
- }
1304
- function isXiaoERuntime(options) {
1305
- return isXiaoERuntimeAgent(options?.runtimeAgent);
1306
- }
1307
-
1308
1285
  // src/internal/e10/auth/xiaoe.ts
1309
1286
  import { execFile } from "node:child_process";
1310
- import { accessSync, constants as fsConstants, existsSync as existsSync6, readFileSync as readFileSync5, readdirSync as readdirSync2, statSync } from "node:fs";
1287
+ import { accessSync, constants as fsConstants, existsSync as existsSync5, readFileSync as readFileSync5, readdirSync as readdirSync2, statSync } from "node:fs";
1311
1288
  import { homedir as homedir3 } from "node:os";
1312
- import { join as join2 } from "node:path";
1289
+ import { join } from "node:path";
1313
1290
  var DEFAULT_E10_LOGIN_BASE_URL = "https://weapp.eteams.cn";
1314
1291
  var DEFAULT_E10_BASE_URL = "https://www.e-cology.com.cn";
1315
1292
  var XIAOE_AGENT_TYPE = "XiaoE";
@@ -1485,15 +1462,7 @@ function envString(env, ...keys) {
1485
1462
  return "";
1486
1463
  }
1487
1464
  function hasXiaoEEnv(env = process.env, options = {}) {
1488
- if (isXiaoERuntime(options)) return true;
1489
- if (Object.keys(env).some((key) => key.startsWith("XIAOE_"))) return true;
1490
- const explicitHostAgentType = envString(env, "WORKBUDDY_AGENT_TYPE", "CODEX_AGENT_TYPE");
1491
- if (explicitHostAgentType) return isXiaoERuntimeAgent(explicitHostAgentType);
1492
- if (Object.keys(env).some((key) => key.startsWith("WORKBUDDY_") || key.startsWith("CODEX_"))) {
1493
- return false;
1494
- }
1495
- const explicitAgentType = envString(env, "WEAVER_AGENT_TYPE");
1496
- return explicitAgentType ? isXiaoERuntimeAgent(explicitAgentType) : false;
1465
+ return isXiaoEHostEnvironment(env, options);
1497
1466
  }
1498
1467
  function resolveXiaoEClientType(env = process.env) {
1499
1468
  const raw = envString(env, "XIAOE_CLIENT_TYPE").toLowerCase();
@@ -1686,6 +1655,11 @@ function isXiaoEHostedEnvironment(env = process.env) {
1686
1655
  function resolveDefaultE10BaseUrl(env = process.env) {
1687
1656
  return isXiaoEHostedEnvironment(env) ? DEFAULT_E10_BASE_URL : DEFAULT_E10_LOGIN_BASE_URL;
1688
1657
  }
1658
+ function resolveXiaoEDefaultBaseUrl(env = process.env) {
1659
+ const configured = resolveXiaoEConfiguredBaseUrl(env);
1660
+ if (configured) return configured;
1661
+ return resolveDefaultE10BaseUrl(env);
1662
+ }
1689
1663
  function uniqueStrings(values) {
1690
1664
  const seen = /* @__PURE__ */ new Set();
1691
1665
  const result = [];
@@ -1703,30 +1677,30 @@ function xiaoETokenScriptCandidatePaths(env = process.env) {
1703
1677
  const localAppData = envString(env, "LOCALAPPDATA");
1704
1678
  const userProfile = envString(env, "USERPROFILE");
1705
1679
  return uniqueStrings([
1706
- localAppData ? join2(localAppData, "xiaoeUserData", "tokens.py") : "",
1707
- userProfile ? join2(userProfile, "AppData", "Local", "xiaoeUserData", "tokens.py") : ""
1680
+ localAppData ? join(localAppData, "xiaoeUserData", "tokens.py") : "",
1681
+ userProfile ? join(userProfile, "AppData", "Local", "xiaoeUserData", "tokens.py") : ""
1708
1682
  ]);
1709
1683
  }
1710
1684
  const envHome = envString(env, "HOME");
1711
1685
  const nodeHome = envHome ? "" : homedir3();
1712
1686
  return uniqueStrings([
1713
- envHome ? join2(envHome, "Library", "Application Support", "xiaoeUserData", "tokens.py") : "",
1714
- nodeHome ? join2(nodeHome, "Library", "Application Support", "xiaoeUserData", "tokens.py") : ""
1687
+ envHome ? join(envHome, "Library", "Application Support", "xiaoeUserData", "tokens.py") : "",
1688
+ nodeHome ? join(nodeHome, "Library", "Application Support", "xiaoeUserData", "tokens.py") : ""
1715
1689
  ]);
1716
1690
  }
1717
1691
  function xiaoETokenScriptPath(env = process.env) {
1718
- return xiaoETokenScriptCandidatePaths(env).find((path) => existsSync6(path)) || "";
1692
+ return xiaoETokenScriptCandidatePaths(env).find((path) => existsSync5(path)) || "";
1719
1693
  }
1720
1694
  function xiaoEBundledEnvScriptPath() {
1721
1695
  const scriptPath = packagePath("scripts", "xiaoe_env.py");
1722
- return existsSync6(scriptPath) ? scriptPath : "";
1696
+ return existsSync5(scriptPath) ? scriptPath : "";
1723
1697
  }
1724
1698
  function hasXiaoETokenScript(env = process.env, allowLocalDiscovery = true) {
1725
1699
  const explicit = envString(env, XIAOE_TOKEN_SCRIPT_ENV_KEY, XIAOE_TOKEN_SCRIPT_LEGACY_ENV_KEY);
1726
- if (explicit) return existsSync6(explicit);
1700
+ if (explicit) return existsSync5(explicit);
1727
1701
  if (!allowLocalDiscovery) return false;
1728
1702
  const scriptPath = xiaoETokenScriptPath(env);
1729
- return Boolean(scriptPath && existsSync6(scriptPath));
1703
+ return Boolean(scriptPath && existsSync5(scriptPath));
1730
1704
  }
1731
1705
  function isExecutableFile(path) {
1732
1706
  try {
@@ -1738,18 +1712,18 @@ function isExecutableFile(path) {
1738
1712
  }
1739
1713
  }
1740
1714
  function listXiaoEPythonRuntimeDirectories(resourcesRoot) {
1741
- if (!resourcesRoot || !existsSync6(resourcesRoot)) return [];
1715
+ if (!resourcesRoot || !existsSync5(resourcesRoot)) return [];
1742
1716
  try {
1743
- return readdirSync2(resourcesRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && /^Python3(?:[-_.]\d[\d.]*)?$/iu.test(entry.name)).map((entry) => join2(resourcesRoot, entry.name)).sort((left, right) => right.localeCompare(left, void 0, { numeric: true }));
1717
+ return readdirSync2(resourcesRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && /^Python3(?:[-_.]\d[\d.]*)?$/iu.test(entry.name)).map((entry) => join(resourcesRoot, entry.name)).sort((left, right) => right.localeCompare(left, void 0, { numeric: true }));
1744
1718
  } catch {
1745
1719
  return [];
1746
1720
  }
1747
1721
  }
1748
1722
  function listExecutablePythonFiles(directory, platform) {
1749
- if (!directory || !existsSync6(directory)) return [];
1723
+ if (!directory || !existsSync5(directory)) return [];
1750
1724
  try {
1751
1725
  const pattern = platform === "win32" ? /^python(?:3(?:\.\d+)*)?\.exe$/iu : /^python3(?:\.\d+)*$/u;
1752
- return readdirSync2(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && pattern.test(entry.name)).map((entry) => join2(directory, entry.name)).filter(isExecutableFile).sort((left, right) => right.localeCompare(left, void 0, { numeric: true }));
1726
+ return readdirSync2(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && pattern.test(entry.name)).map((entry) => join(directory, entry.name)).filter(isExecutableFile).sort((left, right) => right.localeCompare(left, void 0, { numeric: true }));
1753
1727
  } catch {
1754
1728
  return [];
1755
1729
  }
@@ -1760,7 +1734,7 @@ function xiaoEClientPythonCandidates(env = process.env, platform = process.platf
1760
1734
  const envHome = envString(env, "HOME");
1761
1735
  const nodeHome = homedir3();
1762
1736
  for (const home of uniqueStrings([envHome, nodeHome])) {
1763
- appRoots.push(join2(home, "Applications", "\u667A\u80FD\u5C0Fe.app"));
1737
+ appRoots.push(join(home, "Applications", "\u667A\u80FD\u5C0Fe.app"));
1764
1738
  }
1765
1739
  appRoots.push("/Applications/\u667A\u80FD\u5C0Fe.app");
1766
1740
  } else if (platform === "win32") {
@@ -1773,19 +1747,19 @@ function xiaoEClientPythonCandidates(env = process.env, platform = process.platf
1773
1747
  const appNames = ["\u667A\u80FD\u5C0Fe", "XiaoE", "XiaoEClient", "XiaoEAI"];
1774
1748
  if (localAppData) {
1775
1749
  for (const appName of appNames) {
1776
- appRoots.push(join2(localAppData, "Programs", appName), join2(localAppData, appName));
1750
+ appRoots.push(join(localAppData, "Programs", appName), join(localAppData, appName));
1777
1751
  }
1778
1752
  }
1779
1753
  for (const programFilesRoot of programFiles) {
1780
- for (const appName of appNames) appRoots.push(join2(programFilesRoot, appName));
1754
+ for (const appName of appNames) appRoots.push(join(programFilesRoot, appName));
1781
1755
  }
1782
1756
  }
1783
1757
  const candidates = [];
1784
1758
  for (const appRoot of uniqueStrings(appRoots)) {
1785
- const resourcesRoots = platform === "darwin" ? [join2(appRoot, "Contents", "Resources")] : [join2(appRoot, "Resources"), appRoot];
1759
+ const resourcesRoots = platform === "darwin" ? [join(appRoot, "Contents", "Resources")] : [join(appRoot, "Resources"), appRoot];
1786
1760
  for (const resourcesRoot of resourcesRoots) {
1787
1761
  for (const runtimeRoot of listXiaoEPythonRuntimeDirectories(resourcesRoot)) {
1788
- const executableDirectories = platform === "win32" ? [runtimeRoot, join2(runtimeRoot, "bin")] : [join2(runtimeRoot, "bin")];
1762
+ const executableDirectories = platform === "win32" ? [runtimeRoot, join(runtimeRoot, "bin")] : [join(runtimeRoot, "bin")];
1789
1763
  for (const executableDirectory of executableDirectories) {
1790
1764
  candidates.push(...listExecutablePythonFiles(executableDirectory, platform));
1791
1765
  }
@@ -1905,7 +1879,7 @@ async function runXiaoETokenScriptOnce(pythonCommand, scriptPath, baseUrl, env)
1905
1879
  ' raise SystemExit("XiaoE credential script produced empty stdout")',
1906
1880
  "print(json.dumps(data, ensure_ascii=False))"
1907
1881
  ].join("\n");
1908
- return await new Promise((resolve8, reject) => {
1882
+ return await new Promise((resolve7, reject) => {
1909
1883
  execFile(
1910
1884
  pythonCommand,
1911
1885
  ["-c", wrapper],
@@ -1936,7 +1910,7 @@ async function runXiaoETokenScriptOnce(pythonCommand, scriptPath, baseUrl, env)
1936
1910
  }
1937
1911
  try {
1938
1912
  const parsed = JSON.parse(text);
1939
- resolve8(parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null);
1913
+ resolve7(parsed && typeof parsed === "object" && !Array.isArray(parsed) ? parsed : null);
1940
1914
  } catch {
1941
1915
  reject(new CliError("XiaoE credential script stdout is not valid JSON.", 3 /* AuthError */));
1942
1916
  }
@@ -1945,7 +1919,7 @@ async function runXiaoETokenScriptOnce(pythonCommand, scriptPath, baseUrl, env)
1945
1919
  });
1946
1920
  }
1947
1921
  async function runXiaoEPythonCredentialScript(scriptPath, baseUrl, env) {
1948
- if (!scriptPath || !existsSync6(scriptPath)) return null;
1922
+ if (!scriptPath || !existsSync5(scriptPath)) return null;
1949
1923
  let lastError = null;
1950
1924
  for (const pythonCommand of xiaoETokenScriptPythonCandidates(env)) {
1951
1925
  try {
@@ -1998,13 +1972,13 @@ async function resolveXiaoEBundledEnvScriptCredential(baseUrl, env = process.env
1998
1972
  function xiaoEClientRobotsRoot(env = process.env) {
1999
1973
  if (process.platform === "win32") {
2000
1974
  const localAppData = envString(env, "LOCALAPPDATA");
2001
- return localAppData ? join2(localAppData, "XiaoE", "Robots") : "";
1975
+ return localAppData ? join(localAppData, "XiaoE", "Robots") : "";
2002
1976
  }
2003
1977
  const home = envString(env, "HOME") || homedir3();
2004
- return home ? join2(home, "Library", "Application Support", "XiaoE", "Robots") : "";
1978
+ return home ? join(home, "Library", "Application Support", "XiaoE", "Robots") : "";
2005
1979
  }
2006
1980
  function isFile(path) {
2007
- if (!path || !existsSync6(path)) return false;
1981
+ if (!path || !existsSync5(path)) return false;
2008
1982
  try {
2009
1983
  return statSync(path).isFile();
2010
1984
  } catch {
@@ -2012,7 +1986,7 @@ function isFile(path) {
2012
1986
  }
2013
1987
  }
2014
1988
  function isDirectory(path) {
2015
- if (!path || !existsSync6(path)) return false;
1989
+ if (!path || !existsSync5(path)) return false;
2016
1990
  try {
2017
1991
  return statSync(path).isDirectory();
2018
1992
  } catch {
@@ -2031,15 +2005,15 @@ function listXiaoEClientSettingsFiles(root) {
2031
2005
  if (!isDirectory(directory)) return;
2032
2006
  try {
2033
2007
  for (const entry of readdirSync2(directory, { withFileTypes: true })) {
2034
- if (entry.isDirectory()) addCandidate(join2(directory, entry.name, "user_settings.json"));
2008
+ if (entry.isDirectory()) addCandidate(join(directory, entry.name, "user_settings.json"));
2035
2009
  }
2036
2010
  } catch {
2037
2011
  }
2038
2012
  };
2039
- addCandidate(join2(root, "user_settings.json"));
2013
+ addCandidate(join(root, "user_settings.json"));
2040
2014
  addChildSettings(root);
2041
- const robotsRoot = join2(root, "Robots");
2042
- addCandidate(join2(robotsRoot, "user_settings.json"));
2015
+ const robotsRoot = join(root, "Robots");
2016
+ addCandidate(join(robotsRoot, "user_settings.json"));
2043
2017
  addChildSettings(robotsRoot);
2044
2018
  return uniqueStrings(candidates);
2045
2019
  }
@@ -2118,6 +2092,9 @@ function inspectXiaoEUnifiedLoginSources(options = {}) {
2118
2092
  any: platformCredential || tokenScript || clientCredential || environmentCredential
2119
2093
  };
2120
2094
  }
2095
+ function hasXiaoEUnifiedLoginSource(options = {}) {
2096
+ return inspectXiaoEUnifiedLoginSources(options).any;
2097
+ }
2121
2098
  async function fetchXiaoEClientEteamId(credential, domain) {
2122
2099
  const requestedDomain = domain || DEFAULT_E10_BASE_URL;
2123
2100
  const startedAt = Date.now();
@@ -2340,7 +2317,7 @@ async function saveXiaoEUnifiedLogin(input) {
2340
2317
  const profile = resolveLoginProfileName({
2341
2318
  derivedName: profileNameFromUrl(baseUrl),
2342
2319
  baseUrl,
2343
- hostKey: input.hostKey,
2320
+ hostKey: "xiaoe",
2344
2321
  profileHint: input.profileHint
2345
2322
  });
2346
2323
  setActiveProfile(profile);
@@ -2369,7 +2346,7 @@ async function saveXiaoEUnifiedLogin(input) {
2369
2346
  };
2370
2347
  const authFile = saveAuthFile(authData, profile);
2371
2348
  saveProfileConfig(baseUrl, baseUrl, profile, tenantKey);
2372
- upsertAgentHost({ profile, baseUrl, tenantKey, agentType: XIAOE_AGENT_TYPE, hostKey: input.hostKey });
2349
+ upsertAgentHost({ profile, baseUrl, tenantKey, agentType: XIAOE_AGENT_TYPE, hostKey: "xiaoe" });
2373
2350
  const session = new E10AuthSession(authData, authFile);
2374
2351
  return {
2375
2352
  session,
@@ -2529,16 +2506,13 @@ async function tryXiaoEUnifiedLogin(options = {}) {
2529
2506
  }
2530
2507
 
2531
2508
  export {
2532
- isConnectorMode,
2533
- normalizeGlobalOptions,
2534
- packagePath,
2535
- packageFileUrl,
2536
- isXiaoERuntimeAgent,
2537
2509
  readErrorCauseCode,
2538
2510
  isTlsTrustErrorCode,
2539
2511
  looksLikeTlsTrustMessage,
2540
2512
  writeWithRetry,
2541
2513
  getE10AuthRoot,
2514
+ resolveSessionHostKey,
2515
+ isIsolatedAgentHost,
2542
2516
  resolveAgentHostKey,
2543
2517
  lookupAgentHost,
2544
2518
  resolveLoginProfileName,
@@ -2564,12 +2538,20 @@ export {
2564
2538
  applyE10TlsPolicy,
2565
2539
  currentE10TlsPolicyStatus,
2566
2540
  summarizeE10TlsPolicy,
2541
+ DEFAULT_E10_LOGIN_BASE_URL,
2542
+ DEFAULT_E10_BASE_URL,
2567
2543
  XIAOE_AGENT_TYPE,
2568
2544
  summarizeXiaoEFailureKind,
2569
2545
  lastXiaoEFailure,
2570
2546
  hasXiaoEEnv,
2547
+ isXiaoECloudRuntime,
2548
+ resolveXiaoEUnifiedLoginCredential,
2549
+ isXiaoEHostedEnvironment,
2571
2550
  resolveDefaultE10BaseUrl,
2551
+ resolveXiaoEDefaultBaseUrl,
2552
+ hasXiaoETokenScript,
2572
2553
  inspectXiaoEUnifiedLoginSources,
2554
+ hasXiaoEUnifiedLoginSource,
2573
2555
  resolveXiaoEPreferredBaseUrl,
2574
2556
  createXiaoEUnifiedLoginUnavailableError,
2575
2557
  tryXiaoEUnifiedLogin