@hostclubeos/miraos 0.0.7-beta → 0.0.9-beta

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 (239) hide show
  1. package/chunks/{MaxSizedBox-CBUPHLMW.js → MaxSizedBox-6CGCRBRO.js} +1 -1
  2. package/chunks/{StandaloneSessionPicker-EXZJQKTK.js → StandaloneSessionPicker-7VQOS4TU.js} +1 -1
  3. package/chunks/{acp-subagent-executor-BMIXP52W.js → acp-subagent-executor-BFQRCU7R.js} +1 -1
  4. package/chunks/{acpAgent-JC4KGTLW.js → acpAgent-PCXQRPNU.js} +3 -3
  5. package/chunks/{advisor-5RUG3VFZ.js → advisor-WDZ5N5ZP.js} +1 -1
  6. package/chunks/{agent-SGQ7AEZI.js → agent-I7Q3IPSS.js} +1 -1
  7. package/chunks/{agent-headless-ZGCZ2DA7.js → agent-headless-6LOYWI5T.js} +1 -1
  8. package/chunks/{agent-host-client-HY5GPSHM.js → agent-host-client-PZZKCNQF.js} +1 -1
  9. package/chunks/{agent-host-connections-KGTBS37X.js → agent-host-connections-TWWSRTKJ.js} +1 -1
  10. package/chunks/{autofix-pr-E62FC67X.js → autofix-pr-RQPGPQ4D.js} +1 -1
  11. package/chunks/{batch-OUC6FGCQ.js → batch-UJD5TSBN.js} +1 -1
  12. package/chunks/{bridge-FLEIBB5V.js → bridge-4TYLRPXZ.js} +1 -1
  13. package/chunks/{channel-settings-store-QG6HREVH.js → channel-settings-store-RENJMOQ5.js} +1 -1
  14. package/chunks/{chunk-K7VOBDFT.js → chunk-24PHAWM3.js} +1 -1
  15. package/chunks/{chunk-7F5IYTVE.js → chunk-26JPBN6V.js} +1 -1
  16. package/chunks/{chunk-V5Z6OEKJ.js → chunk-2MQH3J4U.js} +1 -1
  17. package/chunks/{chunk-UOYXBAN7.js → chunk-2RXOWQSQ.js} +1 -1
  18. package/chunks/{chunk-H2QXWIRZ.js → chunk-323HUW2T.js} +1 -1
  19. package/chunks/{chunk-KNW2OD46.js → chunk-3BHXE7CB.js} +1 -1
  20. package/chunks/{chunk-RWFOQXPU.js → chunk-3GYAEXAA.js} +1 -1
  21. package/chunks/{chunk-W6IOHGWW.js → chunk-3YBZW4HP.js} +1 -1
  22. package/chunks/{chunk-23543L6E.js → chunk-4RJ2RRGZ.js} +1 -1
  23. package/chunks/{chunk-2PB6TEZU.js → chunk-5DIW4X4P.js} +1 -1
  24. package/chunks/{chunk-4346FNTB.js → chunk-5GB6JNJX.js} +1 -1
  25. package/chunks/{chunk-VRAHMOQQ.js → chunk-5HSNCG73.js} +2 -2
  26. package/chunks/{chunk-PQOQONLN.js → chunk-6HDMM7TJ.js} +1 -1
  27. package/chunks/{chunk-K7KY7FIB.js → chunk-6STNGEYC.js} +1 -1
  28. package/chunks/{chunk-7VP4KALB.js → chunk-7EFWNFJJ.js} +1 -1
  29. package/chunks/{chunk-ATVRF62A.js → chunk-7EWIKIJI.js} +1 -1
  30. package/chunks/{chunk-T5PDEAU5.js → chunk-7TB6VG72.js} +1 -1
  31. package/chunks/{chunk-4WYKHP7Q.js → chunk-7TLL4JLR.js} +1 -1
  32. package/chunks/{chunk-JDABSS6M.js → chunk-AOMXZNMX.js} +1 -1
  33. package/chunks/{chunk-FK5L2WVV.js → chunk-AUM57JI2.js} +1 -1
  34. package/chunks/{chunk-KK6SQPYG.js → chunk-AW5UCOZO.js} +1 -1
  35. package/chunks/{chunk-WC72OWF2.js → chunk-C6HVNDQT.js} +2 -2
  36. package/chunks/{chunk-BSLIVO6O.js → chunk-CC6E5CQV.js} +1 -1
  37. package/chunks/{chunk-AIAYQAPA.js → chunk-CLKUQP27.js} +1 -1
  38. package/chunks/{chunk-2QYFSBJY.js → chunk-DFMQQM4M.js} +1 -1
  39. package/chunks/{chunk-MMGNOY3U.js → chunk-DP7LJTG2.js} +5 -5
  40. package/chunks/{chunk-MYS5NQXO.js → chunk-DQT5VL7G.js} +1 -1
  41. package/chunks/{chunk-FC7SJIAS.js → chunk-E4QOAV5O.js} +1 -1
  42. package/chunks/{chunk-3MBYQYPC.js → chunk-E4REGDEZ.js} +1 -1
  43. package/chunks/{chunk-WCLAVBNR.js → chunk-EAG7VZJJ.js} +1 -1
  44. package/chunks/{chunk-GQ24VFGQ.js → chunk-EFO6J22W.js} +1 -1
  45. package/chunks/{chunk-6RDYPRV6.js → chunk-EMR4QK2F.js} +1 -1
  46. package/chunks/{chunk-WZTO3EYG.js → chunk-EYECE2PH.js} +1 -1
  47. package/chunks/{chunk-UWMLSAQY.js → chunk-EZDXHUHB.js} +1 -1
  48. package/chunks/{chunk-T3A53XMM.js → chunk-FJFTKA4H.js} +1 -1
  49. package/chunks/{chunk-W2ZVZ6LS.js → chunk-FSLDNLNU.js} +1 -1
  50. package/chunks/{chunk-O6Z3KO6R.js → chunk-FSRXTX3N.js} +1 -1
  51. package/chunks/{chunk-TFITRCIC.js → chunk-FWSXFRIQ.js} +1 -1
  52. package/chunks/{chunk-TU5QHOJC.js → chunk-G4ATLMDH.js} +1 -1
  53. package/chunks/{chunk-DF6TBGS2.js → chunk-GAS3HKRX.js} +1 -1
  54. package/chunks/{chunk-YVN32EUM.js → chunk-GFFL2LR2.js} +1 -1
  55. package/chunks/{chunk-TLZM3DMY.js → chunk-GYFIY7TD.js} +1 -1
  56. package/chunks/{chunk-PGKFDR73.js → chunk-GYXRI4P5.js} +1 -1
  57. package/chunks/{chunk-3KFLO5W3.js → chunk-H3U7DXIU.js} +1 -1
  58. package/chunks/{chunk-YN6WXB6B.js → chunk-HEDVPRMD.js} +1 -1
  59. package/chunks/{chunk-JJDF5FHA.js → chunk-HI3644FQ.js} +1 -1
  60. package/chunks/{chunk-HASJX2YS.js → chunk-HTHYLMBO.js} +1 -1
  61. package/chunks/{chunk-4MGTY3CJ.js → chunk-IW7RPDV2.js} +1 -1
  62. package/chunks/{chunk-SCHCTQCG.js → chunk-IXQI4K6O.js} +1 -1
  63. package/chunks/chunk-IYH3IZL4.js +13 -0
  64. package/chunks/{chunk-EF3HUB7S.js → chunk-J52J35K4.js} +1 -1
  65. package/chunks/{chunk-TXL535SJ.js → chunk-J7L5IHLG.js} +1 -1
  66. package/chunks/{chunk-N7WQH6L4.js → chunk-JHS5B4N7.js} +2 -2
  67. package/chunks/{chunk-P5543CFV.js → chunk-JRSO5ZGU.js} +1 -1
  68. package/chunks/{chunk-G35E5UB3.js → chunk-JS6VAGRQ.js} +1 -1
  69. package/chunks/{chunk-Z4JY3HGO.js → chunk-KAFPULGU.js} +1 -1
  70. package/chunks/{chunk-RNPVWQ3V.js → chunk-LDP47G5M.js} +1 -1
  71. package/chunks/{chunk-EW3EVEYN.js → chunk-LMZZWPKA.js} +1 -1
  72. package/chunks/{chunk-5RYDKYIR.js → chunk-LNCELICB.js} +1 -1
  73. package/chunks/{chunk-JDHMSERR.js → chunk-LY2DRNTZ.js} +1 -1
  74. package/chunks/{chunk-7W5DOBKY.js → chunk-MMGGGYSJ.js} +1 -1
  75. package/chunks/{chunk-CUY6CVSL.js → chunk-MTBU2ZIM.js} +1 -1
  76. package/chunks/{chunk-TWJ4XBED.js → chunk-N27KICJQ.js} +1 -1
  77. package/chunks/{chunk-JQOLNQQN.js → chunk-NHYFTK4O.js} +1 -1
  78. package/chunks/{chunk-NGH27AWP.js → chunk-NRDHXSEE.js} +1 -1
  79. package/chunks/{chunk-3GJ56V2J.js → chunk-NV5VVTYQ.js} +1 -1
  80. package/chunks/{chunk-VJUTDS6C.js → chunk-OEDMFKZL.js} +1 -1
  81. package/chunks/{chunk-PVHBBTAU.js → chunk-OQAVMR6K.js} +1 -1
  82. package/chunks/{chunk-IF3SWUYT.js → chunk-OY3Y6EMV.js} +1 -1
  83. package/chunks/{chunk-SOCXRMZM.js → chunk-OZL4ZMGQ.js} +2 -2
  84. package/chunks/{chunk-GLQWA4W2.js → chunk-PKSPKVFH.js} +1 -1
  85. package/chunks/{chunk-KYK53GFP.js → chunk-PNFKCYZT.js} +1 -1
  86. package/chunks/{chunk-7SAR6NXA.js → chunk-PTWHFVGG.js} +2 -2
  87. package/chunks/{chunk-RBA3TP7L.js → chunk-QJ6ZTZFC.js} +1 -1
  88. package/chunks/{chunk-PFECH6U6.js → chunk-QRGWB7IX.js} +1 -1
  89. package/chunks/{chunk-VBJV7T47.js → chunk-QRP2GXQD.js} +1 -1
  90. package/chunks/{chunk-WJLHLFIR.js → chunk-RES5ET63.js} +1 -1
  91. package/chunks/{chunk-GY4ID3EB.js → chunk-ROSJCTWB.js} +1 -1
  92. package/chunks/{chunk-4KIFAVR2.js → chunk-RR3NFNWL.js} +1 -1
  93. package/chunks/{chunk-2ZWVSKPK.js → chunk-RYQDRFLW.js} +1 -1
  94. package/chunks/{chunk-NVD63O5H.js → chunk-S7CWSAUQ.js} +1 -1
  95. package/chunks/{chunk-66DZADDA.js → chunk-SAJKF4WS.js} +1 -1
  96. package/chunks/chunk-SINRWOVD.js +36 -0
  97. package/chunks/{chunk-HSN5QUS7.js → chunk-SJNQ6I23.js} +1 -1
  98. package/chunks/{chunk-3NB3FFLR.js → chunk-T2GM4S4G.js} +3 -3
  99. package/chunks/{chunk-GN7ODRDE.js → chunk-TCQJO42E.js} +1 -1
  100. package/chunks/{chunk-67PM7M5R.js → chunk-TIIDF23U.js} +2 -2
  101. package/chunks/{chunk-USR2Y7B3.js → chunk-TKH5R7RZ.js} +1 -1
  102. package/chunks/{chunk-GTQULDIL.js → chunk-TSRTZD3X.js} +1 -1
  103. package/chunks/{chunk-GXNGLDUN.js → chunk-UXSXKLRH.js} +1 -1
  104. package/chunks/{chunk-JJQJFMPL.js → chunk-UYI5AMPI.js} +1 -1
  105. package/chunks/{chunk-SHKSVOTG.js → chunk-VO6SPDH4.js} +1 -1
  106. package/chunks/{chunk-AE6E2YKY.js → chunk-VRIHYTDI.js} +1 -1
  107. package/chunks/{chunk-6T25QVBX.js → chunk-VT47A26Q.js} +1 -1
  108. package/chunks/{chunk-2VW4HXVF.js → chunk-VZOZUCZX.js} +1 -1
  109. package/chunks/{chunk-724YPZRX.js → chunk-WLEGTKGA.js} +1 -1
  110. package/chunks/{chunk-ZOWMHZWO.js → chunk-XHCJN4A2.js} +1 -1
  111. package/chunks/{chunk-J773THNP.js → chunk-XTRZ5PHG.js} +1 -1
  112. package/chunks/{chunk-H65ZVST6.js → chunk-Y4GZOZWD.js} +1 -1
  113. package/chunks/{chunk-E6LRCLLE.js → chunk-YUCAGV52.js} +2 -2
  114. package/chunks/{chunk-FS67DOZQ.js → chunk-YWQM4TSO.js} +1 -1
  115. package/chunks/{chunk-P42MFWO2.js → chunk-YYTOHY4V.js} +1 -1
  116. package/chunks/{chunk-PSSJDUZB.js → chunk-Z25W2S5N.js} +1 -1
  117. package/chunks/{chunk-VF2UWWI2.js → chunk-Z6GECBAJ.js} +1 -1
  118. package/chunks/{chunk-HZ4L4MDM.js → chunk-ZJU4B4WX.js} +1 -1
  119. package/chunks/{chunk-RRMTSVGU.js → chunk-ZSHDQPAO.js} +1 -1
  120. package/chunks/{chunk-PFKTTUGS.js → chunk-ZUWLTGSR.js} +6 -6
  121. package/chunks/{codex-subagent-executor-UCDGQFTR.js → codex-subagent-executor-2V4NB7IR.js} +1 -1
  122. package/chunks/{config-utils-Z6F4DVLG.js → config-utils-5B2LYCON.js} +1 -1
  123. package/chunks/{contextCommand-HMVZT56Y.js → contextCommand-UPQGRXWK.js} +1 -1
  124. package/chunks/{core-runtime-AV7CJXOL.js → core-runtime-DPMH2BXK.js} +1 -1
  125. package/chunks/{create-sub-session-NNKVHZKT.js → create-sub-session-EJVB3FE5.js} +1 -1
  126. package/chunks/{cron-create-HWZDFVPA.js → cron-create-V2A7PMQC.js} +1 -1
  127. package/chunks/{daemon-git-worktree-guard-Q3C45X7T.js → daemon-git-worktree-guard-YEIMR2X7.js} +1 -1
  128. package/chunks/{daemon-status-provider-UX574XBB.js → daemon-status-provider-6BRB5TG3.js} +1 -1
  129. package/chunks/{daemon-trust-policy-6D4KJANB.js → daemon-trust-policy-BEXVFO4M.js} +1 -1
  130. package/chunks/{daemon-trust-policy-monitor-BZ46W4IA.js → daemon-trust-policy-monitor-BVS6LXBX.js} +1 -1
  131. package/chunks/{deferred-core-runtime-YC5XIWEI.js → deferred-core-runtime-NTKFHL5J.js} +1 -1
  132. package/chunks/{edit-LOWDEKPX.js → edit-LRG3TMHP.js} +1 -1
  133. package/chunks/{enterPlanMode-NGSATDRH.js → enterPlanMode-KOUSHJHR.js} +1 -1
  134. package/chunks/{environment-CVIB5DW4.js → environment-54CM3OXE.js} +1 -1
  135. package/chunks/{errors-USKSVZFO.js → errors-D6XR3NH4.js} +1 -1
  136. package/chunks/{execution-tool-QSJLRU5N.js → execution-tool-7RZ2JLEK.js} +1 -1
  137. package/chunks/{execution-worker-TQEIC4AJ.js → execution-worker-LXQ7WAFG.js} +1 -1
  138. package/chunks/{exitPlanMode-AW2HOTIK.js → exitPlanMode-4FGFA2QC.js} +1 -1
  139. package/chunks/{fast-path-OQWHYDXC.js → fast-path-4B7OKPYK.js} +1 -1
  140. package/chunks/{glob-7U6FQSWZ.js → glob-N2D7SY23.js} +1 -1
  141. package/chunks/{goal-tools-5ZB6GPCJ.js → goal-tools-7RNSDRFO.js} +1 -1
  142. package/chunks/{handleAutoUpdate-MLUFTWFP.js → handleAutoUpdate-PKKJQAKG.js} +1 -1
  143. package/chunks/{i18n-QAPQLOC3.js → i18n-F3OAHCLJ.js} +1 -1
  144. package/chunks/{initializer-B27IZ7K4.js → initializer-OL3DDWR7.js} +1 -1
  145. package/chunks/{installationInfo-SAMHABWV.js → installationInfo-D2L743RV.js} +1 -1
  146. package/chunks/{interactive-mod-session-7LQ5CYUR.js → interactive-mod-session-2GXRCQKR.js} +1 -1
  147. package/chunks/{list-TDMJQDQO.js → list-PU7ZXBY5.js} +1 -1
  148. package/chunks/{llm-R2RFT63S.js → llm-V42HGUVH.js} +4 -4
  149. package/chunks/{loadedSettingsAdapter-ZQK5KMEW.js → loadedSettingsAdapter-KAEVWWRX.js} +1 -1
  150. package/chunks/{local-AONDQYFL.js → local-KM5F5RAB.js} +1 -1
  151. package/chunks/{local-execution-environment-WJVCE26F.js → local-execution-environment-OEO2KW3M.js} +1 -1
  152. package/chunks/{loggingContentGenerator-ALSG42YA.js → loggingContentGenerator-DQLXSDZR.js} +1 -1
  153. package/chunks/{loop-wakeup-LFU4LDJM.js → loop-wakeup-CJICM24Y.js} +1 -1
  154. package/chunks/{manage-memory-FBL6CHX2.js → manage-memory-7CV6LF4C.js} +1 -1
  155. package/chunks/{managed-execution-engine-FX7FDAWW.js → managed-execution-engine-JEAIQ7L4.js} +1 -1
  156. package/chunks/{managed-local-serve-DRNC6PTL.js → managed-local-serve-KA37YWRW.js} +1 -1
  157. package/chunks/{managed-npm-update-2MKV7UOI.js → managed-npm-update-TSUUH3NN.js} +1 -1
  158. package/chunks/{managed-runtime-attestation-worker-DBAHM5MN.js → managed-runtime-attestation-worker-PUZ2ECM5.js} +1 -1
  159. package/chunks/{managed-runtime-bootstrap-K3GRKDNQ.js → managed-runtime-bootstrap-SERIRKPD.js} +1 -1
  160. package/chunks/{managed-runtime-session-worker-YN4KML7A.js → managed-runtime-session-worker-UOXK63YX.js} +1 -1
  161. package/chunks/{managed-runtime-ssh-worker-AVNBWFYC.js → managed-runtime-ssh-worker-VKZYIX6R.js} +1 -1
  162. package/chunks/{managed-session-authority-MFEINLXC.js → managed-session-authority-5FYS3G3M.js} +1 -1
  163. package/chunks/{mcp-TS5PX5FY.js → mcp-TRPV3K74.js} +1 -1
  164. package/chunks/{memory-JVT5LAWJ.js → memory-5CMNRPM2.js} +1 -1
  165. package/chunks/{model-call-collection-TNBMD3YL.js → model-call-collection-S4JKVFUO.js} +1 -1
  166. package/chunks/{model-configuration-6KTQQTMO.js → model-configuration-NEIDLKWQ.js} +1 -1
  167. package/chunks/{modelConfigUtils-LCZZ3EQU.js → modelConfigUtils-LZLQOZKJ.js} +1 -1
  168. package/chunks/{monitor-KCCNIKLE.js → monitor-5MNKK5AO.js} +1 -1
  169. package/chunks/{nonInteractiveCli-2GHQYHGW.js → nonInteractiveCli-DDTGU2ER.js} +1 -1
  170. package/chunks/{nonInteractiveToolExecutor-R5CTTWKD.js → nonInteractiveToolExecutor-N7PCYCKO.js} +1 -1
  171. package/chunks/{notebook-edit-KIWE2XOA.js → notebook-edit-7HIBTFFW.js} +1 -1
  172. package/chunks/{omni-IFTMWBMU.js → omni-MX7BMOL5.js} +1 -1
  173. package/chunks/{openaiContentGenerator-XP3VPU6C.js → openaiContentGenerator-NOIIZNRX.js} +1 -1
  174. package/chunks/{openaiResponsesContentGenerator-ZJ6C22EA.js → openaiResponsesContentGenerator-5JJ6G7RS.js} +1 -1
  175. package/chunks/{pidfile-42P24JIA.js → pidfile-OHAGZOTV.js} +1 -1
  176. package/chunks/{processUtils-I2XOO5U2.js → processUtils-TCDNCYVB.js} +1 -1
  177. package/chunks/{prompt-terminal-ledger-7EW46VQ4.js → prompt-terminal-ledger-4ZUOCMOS.js} +1 -1
  178. package/chunks/{reactive-degrade-O4JO7MOX.js → reactive-degrade-C7CGUJNP.js} +1 -1
  179. package/chunks/{read-file-VGC4O7F2.js → read-file-L4ZF6VDG.js} +1 -1
  180. package/chunks/{resumeHistoryUtils-QMVIHQRW.js → resumeHistoryUtils-WK3I4OIL.js} +1 -1
  181. package/chunks/{review-NDK2B7XI.js → review-F6JGI2LP.js} +1 -1
  182. package/chunks/{ripGrep-JY4PZABK.js → ripGrep-L6M2GPCM.js} +1 -1
  183. package/chunks/{run-qwen-serve-P5X5OZUH.js → run-qwen-serve-D5HB55SC.js} +1 -1
  184. package/chunks/{runtime-OL7B72CH.js → runtime-CH3RAOQL.js} +1 -1
  185. package/chunks/{sandboxConfig-EJTMWZHD.js → sandboxConfig-EADWCO37.js} +1 -1
  186. package/chunks/{scheduled-tasks-XQSZWZXG.js → scheduled-tasks-PBKD4BHY.js} +1 -1
  187. package/chunks/{scheduler-3TIRZEVB.js → scheduler-U5K3523K.js} +1 -1
  188. package/chunks/{search-memory-P5KOTUVV.js → search-memory-Y2IPKBDP.js} +1 -1
  189. package/chunks/{send-message-KFSKFXLX.js → send-message-JJQG2S6D.js} +1 -1
  190. package/chunks/{serve-UHEH433U.js → serve-2ZYS47MO.js} +1 -1
  191. package/chunks/{server-ARYDETSZ.js → server-5GMO4IHU.js} +3 -3
  192. package/chunks/{session-HKWGCZF2.js → session-LLOOVSHK.js} +1 -1
  193. package/chunks/{session-attachments-root-O3YQ7HWD.js → session-attachments-root-XCLXH2XO.js} +1 -1
  194. package/chunks/{session-execution-engine-selector-LZBHS3UO.js → session-execution-engine-selector-5QPWJZSF.js} +1 -1
  195. package/chunks/{session-pr-refresh-L5Z5WCXS.js → session-pr-refresh-MDBOAN3R.js} +1 -1
  196. package/chunks/{sessionService-MMPZUN5X.js → sessionService-VKAHCTCC.js} +1 -1
  197. package/chunks/{settings-7PYHXPN4.js → settings-ULEB2IYZ.js} +1 -1
  198. package/chunks/{shell-E6QLKRVU.js → shell-RBEKIYKU.js} +1 -1
  199. package/chunks/{skill-55IZUUM5.js → skill-GEVOEFMZ.js} +1 -1
  200. package/chunks/{skill-settings-A2M5BPH7.js → skill-settings-4IMGLYJW.js} +1 -1
  201. package/chunks/{spawnChannel-KWU26CB7.js → spawnChannel-B7L5PWQ6.js} +1 -1
  202. package/chunks/{standalone-update-32WYZ3BJ.js → standalone-update-SYQM6NOC.js} +1 -1
  203. package/chunks/{start-opentui-ui-S7A4FBGP.js → start-opentui-ui-N427PLF4.js} +2 -2
  204. package/chunks/{startInteractiveUI-DY6DWFW7.js → startInteractiveUI-AS6GZKJJ.js} +1 -1
  205. package/chunks/{team-create-ARICYIQB.js → team-create-MN6FHUHU.js} +1 -1
  206. package/chunks/{team-plan-approval-JPRE6Q3R.js → team-plan-approval-OUYBIT7H.js} +1 -1
  207. package/chunks/{terminal-image-renderer-HVIZ2VNE.js → terminal-image-renderer-MXZDUEOS.js} +1 -1
  208. package/chunks/{theme-manager-UEPLIBUP.js → theme-manager-QOYSKWFK.js} +1 -1
  209. package/chunks/{tool-call-EFJKXI3Z.js → tool-call-Q5NLEQFD.js} +1 -1
  210. package/chunks/{tool-result-media-LMIYNXSD.js → tool-result-media-NZJZTOBQ.js} +1 -1
  211. package/chunks/{tool-search-D7HQTRQG.js → tool-search-D6Y45RNQ.js} +1 -1
  212. package/chunks/{total-session-admission-67QMR44O.js → total-session-admission-36W7MDHP.js} +1 -1
  213. package/chunks/{trustedFolders-HARYVS3F.js → trustedFolders-XW5VH6HK.js} +1 -1
  214. package/chunks/{update-relaunch-NVNPOK5J.js → update-relaunch-KQPR2HAP.js} +1 -1
  215. package/chunks/{updateCheck-7NMXUCTN.js → updateCheck-SRW67WAX.js} +1 -1
  216. package/chunks/{upload-config-W2SICJ32.js → upload-config-BTJNYMRX.js} +1 -1
  217. package/chunks/{useAutoAcceptIndicator-ELMIP4TJ.js → useAutoAcceptIndicator-N3RRUBSL.js} +1 -1
  218. package/chunks/{validateNonInterActiveAuth-P2F6MYO6.js → validateNonInterActiveAuth-SWNH4FY4.js} +1 -1
  219. package/chunks/{version-2ZFKVIIW.js → version-6R6LSGXO.js} +1 -1
  220. package/chunks/{web-fetch-537RS6IX.js → web-fetch-Y7LBAU3R.js} +1 -1
  221. package/chunks/{web-search-O27MYFSW.js → web-search-IB4NYYUH.js} +1 -1
  222. package/chunks/{workflow-6QF4RMYM.js → workflow-TR4YIPJO.js} +1 -1
  223. package/chunks/{workflow-ancestor-trust-CABLU3VV.js → workflow-ancestor-trust-AHDUBOR7.js} +1 -1
  224. package/chunks/{workspace-agents-5WP3PY7W.js → workspace-agents-MY2NFL6A.js} +1 -1
  225. package/chunks/{workspace-providers-status-7G2EJJEO.js → workspace-providers-status-DNCCKFVE.js} +1 -1
  226. package/chunks/{workspace-recovery-worker-ICCIDEWU.js → workspace-recovery-worker-22VK4T4R.js} +1 -1
  227. package/chunks/{workspace-registration-store-WHXMNQQQ.js → workspace-registration-store-64TGRRGC.js} +1 -1
  228. package/chunks/{workspace-registry-NXBODLYH.js → workspace-registry-E6LFL5GL.js} +1 -1
  229. package/chunks/{workspace-runtime-coordinator-CJXS273B.js → workspace-runtime-coordinator-UHJHBIQT.js} +1 -1
  230. package/chunks/{workspace-service-HUDE2RXN.js → workspace-service-OVEYIQOC.js} +1 -1
  231. package/chunks/{workspace-skills-status-FJC6U62F.js → workspace-skills-status-3NKXA5SK.js} +1 -1
  232. package/chunks/{workspace-trust-reconciler-ZIQ3A5ZB.js → workspace-trust-reconciler-JF7YHR52.js} +1 -1
  233. package/chunks/{write-file-652YGG7I.js → write-file-FSTHYKKZ.js} +1 -1
  234. package/chunks/{zoom-image-YEH4O74G.js → zoom-image-JP3EUDXE.js} +1 -1
  235. package/cli.js +2 -2
  236. package/execution-worker.js +1 -1
  237. package/package.json +2 -2
  238. package/chunks/chunk-56PVVXUG.js +0 -8
  239. package/chunks/chunk-AJ75BPTA.js +0 -31
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{DEFAULT_DARK_THEME_NAME,DEFAULT_LIGHT_THEME_NAME}from"./chunk-UWCF7JIF.js";import{createDebugLogger}from"./chunk-46KPDLFH.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();init_esbuild_shims();init_esbuild_shims();init_esbuild_shims();var CSS_NAME_TO_HEX_MAP={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",blanchedalmond:"#ffebcd",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",whitesmoke:"#f5f5f5",yellowgreen:"#9acd32"};var debugLogger=createDebugLogger("COLOR_UTILS");var INK_SUPPORTED_NAMES=new Set(["black","red","green","yellow","blue","cyan","magenta","white","gray","grey","blackbright","redbright","greenbright","yellowbright","bluebright","cyanbright","magentabright","whitebright"]);function resolveColor(colorValue){const lowerColor=colorValue.toLowerCase();if(lowerColor.startsWith("#")){if(/^#[0-9A-Fa-f]{3}([0-9A-Fa-f]{3})?$/.test(colorValue)){return lowerColor}else{return void 0}}else if(INK_SUPPORTED_NAMES.has(lowerColor)){return lowerColor}else if(CSS_NAME_TO_HEX_MAP[lowerColor]){return CSS_NAME_TO_HEX_MAP[lowerColor]}debugLogger.warn(`[ColorUtils] Could not resolve color "${colorValue}" to an Ink-compatible format.`);return void 0}__name(resolveColor,"resolveColor");var INK_NAME_TO_HEX={black:"#000000",red:"#ff0000",green:"#00ff00",yellow:"#ffff00",blue:"#0000ff",cyan:"#00ffff",magenta:"#ff00ff",white:"#ffffff",gray:"#808080",grey:"#808080",blackbright:"#808080",redbright:"#ff8080",greenbright:"#80ff80",yellowbright:"#ffff80",bluebright:"#8080ff",cyanbright:"#80ffff",magentabright:"#ff80ff",whitebright:"#ffffff"};function toHex(color){const resolved=(resolveColor(color)??color).toLowerCase();if(resolved.startsWith("#")){if(/^#[0-9a-f]{3}$/.test(resolved)){return`#${resolved.slice(1).split("").map(c=>c+c).join("")}`}if(/^#[0-9a-f]{6}$/.test(resolved)){return resolved}return void 0}return INK_NAME_TO_HEX[resolved]}__name(toHex,"toHex");var lightTheme={type:"light",Background:"#F0EEE6",Foreground:"#1F1E1D",LightBlue:"#B25E3C",AccentBlue:"#BD5D3A",AccentPurple:"#BD5D3A",AccentCyan:"#4F8A7B",AccentGreen:"#4A7C59",AccentYellow:"#A97E14",AccentRed:"#C0392B",AccentYellowDim:"#8B7000",AccentRedDim:"#993333",DiffAdded:"#DCE8D5",DiffRemoved:"#F5D9D5",Comment:"#6B6A63",Gray:"#83827D",GradientColors:["#D97757","#BD5D3A"]};var darkTheme={type:"dark",Background:"#262624",Foreground:"#E8E6DC",LightBlue:"#E6B49A",AccentBlue:"#D97757",AccentPurple:"#D97757",AccentCyan:"#8FB0A8",AccentGreen:"#83A97F",AccentYellow:"#E0B252",AccentRed:"#D4645A",AccentYellowDim:"#8B7530",AccentRedDim:"#8B3A4A",DiffAdded:"#2E3B2A",DiffRemoved:"#431F1C",Comment:"#8C8A80",Gray:"#6B6A63",GradientColors:["#D97757","#C2613F"]};var ansiTheme={type:"ansi",Background:"black",Foreground:"white",LightBlue:"blue",AccentBlue:"blue",AccentPurple:"magenta",AccentCyan:"cyan",AccentGreen:"green",AccentYellow:"yellow",AccentRed:"red",AccentYellowDim:"yellow",AccentRedDim:"red",DiffAdded:"green",DiffRemoved:"red",Comment:"gray",Gray:"gray"};var Theme=class _Theme{constructor(name,type,rawMappings,colors,semanticColors){this.name=name;this.type=type;this.colors=colors;this.semanticColors=semanticColors??{text:{primary:this.colors.Foreground,secondary:this.colors.Gray,link:this.colors.AccentBlue,accent:this.colors.AccentPurple,code:this.colors.LightBlue},background:{primary:this.colors.Background,diff:{added:this.colors.DiffAdded,removed:this.colors.DiffRemoved}},border:{default:this.colors.Gray,focused:this.colors.AccentBlue},ui:{comment:this.colors.Gray,symbol:this.colors.AccentCyan,gradient:this.colors.GradientColors},status:{error:this.colors.AccentRed,success:this.colors.AccentGreen,warning:this.colors.AccentYellow,errorDim:this.colors.AccentRedDim,warningDim:this.colors.AccentYellowDim}};this._colorMap=Object.freeze(this._buildColorMap(rawMappings));const rawDefaultColor=rawMappings["hljs"]?.color;this.defaultColor=(rawDefaultColor?_Theme._resolveColor(rawDefaultColor):void 0)??""}static{__name(this,"Theme")}defaultColor;_colorMap;semanticColors;getInkColor(hljsClass){return this._colorMap[hljsClass]}static _resolveColor(colorValue){return resolveColor(colorValue)}_buildColorMap(hljsTheme){const inkTheme={};for(const key in hljsTheme){if(!key.startsWith("hljs-")&&key!=="hljs"){continue}const style=hljsTheme[key];if(style?.color){const resolvedColor=_Theme._resolveColor(style.color);if(resolvedColor!==void 0){inkTheme[key]=resolvedColor}}}return inkTheme}};function createCustomTheme(customTheme){const colors={type:"custom",Background:customTheme.background?.primary??customTheme.Background??"",Foreground:customTheme.text?.primary??customTheme.Foreground??"",LightBlue:customTheme.text?.code??customTheme.LightBlue??"",AccentBlue:customTheme.text?.link??customTheme.AccentBlue??"",AccentPurple:customTheme.text?.accent??customTheme.AccentPurple??"",AccentCyan:customTheme.text?.link??customTheme.AccentCyan??"",AccentGreen:customTheme.status?.success??customTheme.AccentGreen??"",AccentYellow:customTheme.status?.warning??customTheme.AccentYellow??"",AccentRed:customTheme.status?.error??customTheme.AccentRed??"",AccentYellowDim:customTheme.status?.warningDim??customTheme.AccentYellowDim??"",AccentRedDim:customTheme.status?.errorDim??customTheme.AccentRedDim??"",DiffAdded:customTheme.background?.diff?.added??customTheme.DiffAdded??"",DiffRemoved:customTheme.background?.diff?.removed??customTheme.DiffRemoved??"",Comment:customTheme.ui?.comment??customTheme.Comment??"",Gray:customTheme.text?.secondary??customTheme.Gray??"",GradientColors:customTheme.ui?.gradient??customTheme.GradientColors};const rawMappings={hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:colors.Background,color:colors.Foreground},"hljs-keyword":{color:colors.AccentBlue},"hljs-literal":{color:colors.AccentBlue},"hljs-symbol":{color:colors.AccentBlue},"hljs-name":{color:colors.AccentBlue},"hljs-link":{color:colors.AccentBlue,textDecoration:"underline"},"hljs-built_in":{color:colors.AccentCyan},"hljs-type":{color:colors.AccentCyan},"hljs-number":{color:colors.AccentGreen},"hljs-class":{color:colors.AccentGreen},"hljs-string":{color:colors.AccentYellow},"hljs-meta-string":{color:colors.AccentYellow},"hljs-regexp":{color:colors.AccentRed},"hljs-template-tag":{color:colors.AccentRed},"hljs-subst":{color:colors.Foreground},"hljs-function":{color:colors.Foreground},"hljs-title":{color:colors.Foreground},"hljs-params":{color:colors.Foreground},"hljs-formula":{color:colors.Foreground},"hljs-comment":{color:colors.Comment,fontStyle:"italic"},"hljs-quote":{color:colors.Comment,fontStyle:"italic"},"hljs-doctag":{color:colors.Comment},"hljs-meta":{color:colors.Gray},"hljs-meta-keyword":{color:colors.Gray},"hljs-tag":{color:colors.Gray},"hljs-variable":{color:colors.AccentPurple},"hljs-template-variable":{color:colors.AccentPurple},"hljs-attr":{color:colors.LightBlue},"hljs-attribute":{color:colors.LightBlue},"hljs-builtin-name":{color:colors.LightBlue},"hljs-section":{color:colors.AccentYellow},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"},"hljs-bullet":{color:colors.AccentYellow},"hljs-selector-tag":{color:colors.AccentYellow},"hljs-selector-id":{color:colors.AccentYellow},"hljs-selector-class":{color:colors.AccentYellow},"hljs-selector-attr":{color:colors.AccentYellow},"hljs-selector-pseudo":{color:colors.AccentYellow},"hljs-addition":{backgroundColor:colors.AccentGreen,display:"inline-block",width:"100%"},"hljs-deletion":{backgroundColor:colors.AccentRed,display:"inline-block",width:"100%"}};const semanticColors={text:{primary:customTheme.text?.primary??colors.Foreground,secondary:customTheme.text?.secondary??colors.Gray,link:customTheme.text?.link??colors.AccentBlue,accent:customTheme.text?.accent??colors.AccentPurple,code:customTheme.text?.code??colors.LightBlue},background:{primary:customTheme.background?.primary??colors.Background,diff:{added:customTheme.background?.diff?.added??colors.DiffAdded,removed:customTheme.background?.diff?.removed??colors.DiffRemoved}},border:{default:customTheme.border?.default??colors.Gray,focused:customTheme.border?.focused??colors.AccentBlue},ui:{comment:customTheme.ui?.comment??colors.Comment,symbol:customTheme.ui?.symbol??colors.Gray,gradient:customTheme.ui?.gradient??colors.GradientColors},status:{error:customTheme.status?.error??colors.AccentRed,success:customTheme.status?.success??colors.AccentGreen,warning:customTheme.status?.warning??colors.AccentYellow,errorDim:customTheme.status?.errorDim??colors.AccentRedDim,warningDim:customTheme.status?.warningDim??colors.AccentYellowDim}};return new Theme(customTheme.name,"custom",rawMappings,colors,semanticColors)}__name(createCustomTheme,"createCustomTheme");function validateCustomTheme(customTheme){if(customTheme.name&&!isValidThemeName(customTheme.name)){return{isValid:false,error:`Invalid theme name: ${customTheme.name}`}}return{isValid:true}}__name(validateCustomTheme,"validateCustomTheme");function isValidThemeName(name){return name.trim().length>0&&name.trim().length<=50}__name(isValidThemeName,"isValidThemeName");var ayuDarkColors={type:"dark",Background:"#0b0e14",Foreground:"#aeaca6",LightBlue:"#59C2FF",AccentBlue:"#39BAE6",AccentPurple:"#D2A6FF",AccentCyan:"#95E6CB",AccentGreen:"#AAD94C",AccentYellow:"#FFB454",AccentRed:"#F26D78",AccentYellowDim:"#8B7530",AccentRedDim:"#8B3A4A",DiffAdded:"#293022",DiffRemoved:"#3D1215",Comment:"#646A71",Gray:"#3D4149",GradientColors:["#FFB454","#F26D78"]};var AyuDark=new Theme("Ayu","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:ayuDarkColors.Background,color:ayuDarkColors.Foreground},"hljs-keyword":{color:ayuDarkColors.AccentYellow},"hljs-literal":{color:ayuDarkColors.AccentPurple},"hljs-symbol":{color:ayuDarkColors.AccentCyan},"hljs-name":{color:ayuDarkColors.LightBlue},"hljs-link":{color:ayuDarkColors.AccentBlue},"hljs-function .hljs-keyword":{color:ayuDarkColors.AccentYellow},"hljs-subst":{color:ayuDarkColors.Foreground},"hljs-string":{color:ayuDarkColors.AccentGreen},"hljs-title":{color:ayuDarkColors.AccentYellow},"hljs-type":{color:ayuDarkColors.AccentBlue},"hljs-attribute":{color:ayuDarkColors.AccentYellow},"hljs-bullet":{color:ayuDarkColors.AccentYellow},"hljs-addition":{color:ayuDarkColors.AccentGreen},"hljs-variable":{color:ayuDarkColors.Foreground},"hljs-template-tag":{color:ayuDarkColors.AccentYellow},"hljs-template-variable":{color:ayuDarkColors.AccentYellow},"hljs-comment":{color:ayuDarkColors.Comment,fontStyle:"italic"},"hljs-quote":{color:ayuDarkColors.AccentCyan,fontStyle:"italic"},"hljs-deletion":{color:ayuDarkColors.AccentRed},"hljs-meta":{color:ayuDarkColors.AccentYellow},"hljs-doctag":{fontWeight:"bold"},"hljs-strong":{fontWeight:"bold"},"hljs-emphasis":{fontStyle:"italic"}},ayuDarkColors);init_esbuild_shims();var ayuLightColors={type:"light",Background:"#f8f9fa",Foreground:"#5c6166",LightBlue:"#55b4d4",AccentBlue:"#399ee6",AccentPurple:"#a37acc",AccentCyan:"#4cbf99",AccentGreen:"#86b300",AccentYellow:"#f2ae49",AccentRed:"#f07171",AccentYellowDim:"#8B7000",AccentRedDim:"#993333",DiffAdded:"#C6EAD8",DiffRemoved:"#FFCCCC",Comment:"#ABADB1",Gray:"#a6aaaf",GradientColors:["#399ee6","#86b300"]};var AyuLight=new Theme("Ayu Light","light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:ayuLightColors.Background,color:ayuLightColors.Foreground},"hljs-comment":{color:ayuLightColors.Comment,fontStyle:"italic"},"hljs-quote":{color:ayuLightColors.AccentCyan,fontStyle:"italic"},"hljs-string":{color:ayuLightColors.AccentGreen},"hljs-constant":{color:ayuLightColors.AccentCyan},"hljs-number":{color:ayuLightColors.AccentPurple},"hljs-keyword":{color:ayuLightColors.AccentYellow},"hljs-selector-tag":{color:ayuLightColors.AccentYellow},"hljs-attribute":{color:ayuLightColors.AccentYellow},"hljs-variable":{color:ayuLightColors.Foreground},"hljs-variable.language":{color:ayuLightColors.LightBlue,fontStyle:"italic"},"hljs-title":{color:ayuLightColors.AccentBlue},"hljs-section":{color:ayuLightColors.AccentGreen,fontWeight:"bold"},"hljs-type":{color:ayuLightColors.LightBlue},"hljs-class .hljs-title":{color:ayuLightColors.AccentBlue},"hljs-tag":{color:ayuLightColors.LightBlue},"hljs-name":{color:ayuLightColors.AccentBlue},"hljs-builtin-name":{color:ayuLightColors.AccentYellow},"hljs-meta":{color:ayuLightColors.AccentYellow},"hljs-symbol":{color:ayuLightColors.AccentRed},"hljs-bullet":{color:ayuLightColors.AccentYellow},"hljs-regexp":{color:ayuLightColors.AccentCyan},"hljs-link":{color:ayuLightColors.LightBlue},"hljs-deletion":{color:ayuLightColors.AccentRed},"hljs-addition":{color:ayuLightColors.AccentGreen},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"},"hljs-literal":{color:ayuLightColors.AccentCyan},"hljs-built_in":{color:ayuLightColors.AccentRed},"hljs-doctag":{color:ayuLightColors.AccentRed},"hljs-template-variable":{color:ayuLightColors.AccentCyan},"hljs-selector-id":{color:ayuLightColors.AccentRed}},ayuLightColors);init_esbuild_shims();var atomOneDarkColors={type:"dark",Background:"#282c34",Foreground:"#abb2bf",LightBlue:"#61aeee",AccentBlue:"#61aeee",AccentPurple:"#c678dd",AccentCyan:"#56b6c2",AccentGreen:"#98c379",AccentYellow:"#e6c07b",AccentRed:"#e06c75",AccentYellowDim:"#8B7530",AccentRedDim:"#8B3A4A",DiffAdded:"#39544E",DiffRemoved:"#562B2F",Comment:"#5c6370",Gray:"#5c6370",GradientColors:["#61aeee","#98c379"]};var AtomOneDark=new Theme("Atom One","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",color:atomOneDarkColors.Foreground,background:atomOneDarkColors.Background},"hljs-comment":{color:atomOneDarkColors.Comment,fontStyle:"italic"},"hljs-quote":{color:atomOneDarkColors.Comment,fontStyle:"italic"},"hljs-doctag":{color:atomOneDarkColors.AccentPurple},"hljs-keyword":{color:atomOneDarkColors.AccentPurple},"hljs-formula":{color:atomOneDarkColors.AccentPurple},"hljs-section":{color:atomOneDarkColors.AccentRed},"hljs-name":{color:atomOneDarkColors.AccentRed},"hljs-selector-tag":{color:atomOneDarkColors.AccentRed},"hljs-deletion":{color:atomOneDarkColors.AccentRed},"hljs-subst":{color:atomOneDarkColors.AccentRed},"hljs-literal":{color:atomOneDarkColors.AccentCyan},"hljs-string":{color:atomOneDarkColors.AccentGreen},"hljs-regexp":{color:atomOneDarkColors.AccentGreen},"hljs-addition":{color:atomOneDarkColors.AccentGreen},"hljs-attribute":{color:atomOneDarkColors.AccentGreen},"hljs-meta-string":{color:atomOneDarkColors.AccentGreen},"hljs-built_in":{color:atomOneDarkColors.AccentYellow},"hljs-class .hljs-title":{color:atomOneDarkColors.AccentYellow},"hljs-attr":{color:atomOneDarkColors.AccentYellow},"hljs-variable":{color:atomOneDarkColors.AccentYellow},"hljs-template-variable":{color:atomOneDarkColors.AccentYellow},"hljs-type":{color:atomOneDarkColors.AccentYellow},"hljs-selector-class":{color:atomOneDarkColors.AccentYellow},"hljs-selector-attr":{color:atomOneDarkColors.AccentYellow},"hljs-selector-pseudo":{color:atomOneDarkColors.AccentYellow},"hljs-number":{color:atomOneDarkColors.AccentYellow},"hljs-symbol":{color:atomOneDarkColors.AccentBlue},"hljs-bullet":{color:atomOneDarkColors.AccentBlue},"hljs-link":{color:atomOneDarkColors.AccentBlue,textDecoration:"underline"},"hljs-meta":{color:atomOneDarkColors.AccentBlue},"hljs-selector-id":{color:atomOneDarkColors.AccentBlue},"hljs-title":{color:atomOneDarkColors.AccentBlue},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}},atomOneDarkColors);init_esbuild_shims();var draculaColors={type:"dark",Background:"#282a36",Foreground:"#a3afb7",LightBlue:"#8be9fd",AccentBlue:"#8be9fd",AccentPurple:"#ff79c6",AccentCyan:"#8be9fd",AccentGreen:"#50fa7b",AccentYellow:"#fff783",AccentRed:"#ff5555",AccentYellowDim:"#8B7530",AccentRedDim:"#8B3A4A",DiffAdded:"#11431d",DiffRemoved:"#6e1818",Comment:"#6272a4",Gray:"#6272a4",GradientColors:["#ff79c6","#8be9fd"]};var Dracula=new Theme("Dracula","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:draculaColors.Background,color:draculaColors.Foreground},"hljs-keyword":{color:draculaColors.AccentBlue,fontWeight:"bold"},"hljs-selector-tag":{color:draculaColors.AccentBlue,fontWeight:"bold"},"hljs-literal":{color:draculaColors.AccentBlue,fontWeight:"bold"},"hljs-section":{color:draculaColors.AccentBlue,fontWeight:"bold"},"hljs-link":{color:draculaColors.AccentBlue},"hljs-function .hljs-keyword":{color:draculaColors.AccentPurple},"hljs-subst":{color:draculaColors.Foreground},"hljs-string":{color:draculaColors.AccentYellow},"hljs-title":{color:draculaColors.AccentYellow,fontWeight:"bold"},"hljs-name":{color:draculaColors.AccentYellow,fontWeight:"bold"},"hljs-type":{color:draculaColors.AccentYellow,fontWeight:"bold"},"hljs-attribute":{color:draculaColors.AccentYellow},"hljs-symbol":{color:draculaColors.AccentYellow},"hljs-bullet":{color:draculaColors.AccentYellow},"hljs-addition":{color:draculaColors.AccentGreen},"hljs-variable":{color:draculaColors.AccentYellow},"hljs-template-tag":{color:draculaColors.AccentYellow},"hljs-template-variable":{color:draculaColors.AccentYellow},"hljs-comment":{color:draculaColors.Comment},"hljs-quote":{color:draculaColors.Comment},"hljs-deletion":{color:draculaColors.AccentRed},"hljs-meta":{color:draculaColors.Comment},"hljs-doctag":{fontWeight:"bold"},"hljs-strong":{fontWeight:"bold"},"hljs-emphasis":{fontStyle:"italic"}},draculaColors);init_esbuild_shims();var githubDarkColors={type:"dark",Background:"#24292e",Foreground:"#c0c4c8",LightBlue:"#79B8FF",AccentBlue:"#79B8FF",AccentPurple:"#B392F0",AccentCyan:"#9ECBFF",AccentGreen:"#85E89D",AccentYellow:"#FFAB70",AccentRed:"#F97583",AccentYellowDim:"#8B7530",AccentRedDim:"#8B3A4A",DiffAdded:"#3C4636",DiffRemoved:"#502125",Comment:"#6A737D",Gray:"#6A737D",GradientColors:["#79B8FF","#85E89D"]};var GitHubDark=new Theme("GitHub","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",color:githubDarkColors.Foreground,background:githubDarkColors.Background},"hljs-comment":{color:githubDarkColors.Comment,fontStyle:"italic"},"hljs-quote":{color:githubDarkColors.Comment,fontStyle:"italic"},"hljs-keyword":{color:githubDarkColors.AccentRed,fontWeight:"bold"},"hljs-selector-tag":{color:githubDarkColors.AccentRed,fontWeight:"bold"},"hljs-subst":{color:githubDarkColors.Foreground},"hljs-number":{color:githubDarkColors.LightBlue},"hljs-literal":{color:githubDarkColors.LightBlue},"hljs-variable":{color:githubDarkColors.AccentYellow},"hljs-template-variable":{color:githubDarkColors.AccentYellow},"hljs-tag .hljs-attr":{color:githubDarkColors.AccentYellow},"hljs-string":{color:githubDarkColors.AccentCyan},"hljs-doctag":{color:githubDarkColors.AccentCyan},"hljs-title":{color:githubDarkColors.AccentPurple,fontWeight:"bold"},"hljs-section":{color:githubDarkColors.AccentPurple,fontWeight:"bold"},"hljs-selector-id":{color:githubDarkColors.AccentPurple,fontWeight:"bold"},"hljs-type":{color:githubDarkColors.AccentGreen,fontWeight:"bold"},"hljs-class .hljs-title":{color:githubDarkColors.AccentGreen,fontWeight:"bold"},"hljs-tag":{color:githubDarkColors.AccentGreen},"hljs-name":{color:githubDarkColors.AccentGreen},"hljs-attribute":{color:githubDarkColors.LightBlue},"hljs-regexp":{color:githubDarkColors.AccentCyan},"hljs-link":{color:githubDarkColors.AccentCyan},"hljs-symbol":{color:githubDarkColors.AccentPurple},"hljs-bullet":{color:githubDarkColors.AccentPurple},"hljs-built_in":{color:githubDarkColors.LightBlue},"hljs-builtin-name":{color:githubDarkColors.LightBlue},"hljs-meta":{color:githubDarkColors.LightBlue,fontWeight:"bold"},"hljs-deletion":{background:"#86181D",color:githubDarkColors.AccentRed},"hljs-addition":{background:"#144620",color:githubDarkColors.AccentGreen},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}},githubDarkColors);init_esbuild_shims();var githubLightColors={type:"light",Background:"#f8f8f8",Foreground:"#24292E",LightBlue:"#0086b3",AccentBlue:"#458",AccentPurple:"#900",AccentCyan:"#009926",AccentGreen:"#008080",AccentYellow:"#990073",AccentRed:"#d14",AccentYellowDim:"#8B7000",AccentRedDim:"#993333",DiffAdded:"#C6EAD8",DiffRemoved:"#FFCCCC",Comment:"#998",Gray:"#999",GradientColors:["#458","#008080"]};var GitHubLight=new Theme("GitHub Light","light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",color:githubLightColors.Foreground,background:githubLightColors.Background},"hljs-comment":{color:githubLightColors.Comment,fontStyle:"italic"},"hljs-quote":{color:githubLightColors.Comment,fontStyle:"italic"},"hljs-keyword":{color:githubLightColors.Foreground,fontWeight:"bold"},"hljs-selector-tag":{color:githubLightColors.Foreground,fontWeight:"bold"},"hljs-subst":{color:githubLightColors.Foreground,fontWeight:"normal"},"hljs-number":{color:githubLightColors.AccentGreen},"hljs-literal":{color:githubLightColors.AccentGreen},"hljs-variable":{color:githubLightColors.AccentGreen},"hljs-template-variable":{color:githubLightColors.AccentGreen},"hljs-tag .hljs-attr":{color:githubLightColors.AccentGreen},"hljs-string":{color:githubLightColors.AccentRed},"hljs-doctag":{color:githubLightColors.AccentRed},"hljs-title":{color:githubLightColors.AccentPurple,fontWeight:"bold"},"hljs-section":{color:githubLightColors.AccentPurple,fontWeight:"bold"},"hljs-selector-id":{color:githubLightColors.AccentPurple,fontWeight:"bold"},"hljs-type":{color:githubLightColors.AccentBlue,fontWeight:"bold"},"hljs-class .hljs-title":{color:githubLightColors.AccentBlue,fontWeight:"bold"},"hljs-tag":{color:githubLightColors.AccentBlue,fontWeight:"normal"},"hljs-name":{color:githubLightColors.AccentBlue,fontWeight:"normal"},"hljs-attribute":{color:githubLightColors.AccentBlue,fontWeight:"normal"},"hljs-regexp":{color:githubLightColors.AccentCyan},"hljs-link":{color:githubLightColors.AccentCyan},"hljs-symbol":{color:githubLightColors.AccentYellow},"hljs-bullet":{color:githubLightColors.AccentYellow},"hljs-built_in":{color:githubLightColors.LightBlue},"hljs-builtin-name":{color:githubLightColors.LightBlue},"hljs-meta":{color:githubLightColors.Gray,fontWeight:"bold"},"hljs-deletion":{background:"#fdd"},"hljs-addition":{background:"#dfd"},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}},githubLightColors);init_esbuild_shims();var googleCodeColors={type:"light",Background:"white",Foreground:"#444",LightBlue:"#066",AccentBlue:"#008",AccentPurple:"#606",AccentCyan:"#066",AccentGreen:"#080",AccentYellow:"#660",AccentRed:"#800",AccentYellowDim:"#8B7000",AccentRedDim:"#993333",DiffAdded:"#C6EAD8",DiffRemoved:"#FEDEDE",Comment:"#5f6368",Gray:lightTheme.Gray,GradientColors:["#066","#606"]};var GoogleCode=new Theme("Google Code","light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:googleCodeColors.Background,color:googleCodeColors.Foreground},"hljs-comment":{color:googleCodeColors.AccentRed},"hljs-quote":{color:googleCodeColors.AccentRed},"hljs-keyword":{color:googleCodeColors.AccentBlue},"hljs-selector-tag":{color:googleCodeColors.AccentBlue},"hljs-section":{color:googleCodeColors.AccentBlue},"hljs-title":{color:googleCodeColors.AccentPurple},"hljs-name":{color:googleCodeColors.AccentBlue},"hljs-variable":{color:googleCodeColors.AccentYellow},"hljs-template-variable":{color:googleCodeColors.AccentYellow},"hljs-string":{color:googleCodeColors.AccentGreen},"hljs-selector-attr":{color:googleCodeColors.AccentGreen},"hljs-selector-pseudo":{color:googleCodeColors.AccentGreen},"hljs-regexp":{color:googleCodeColors.AccentGreen},"hljs-literal":{color:googleCodeColors.AccentCyan},"hljs-symbol":{color:googleCodeColors.AccentCyan},"hljs-bullet":{color:googleCodeColors.AccentCyan},"hljs-meta":{color:googleCodeColors.AccentCyan},"hljs-number":{color:googleCodeColors.AccentCyan},"hljs-link":{color:googleCodeColors.AccentCyan},"hljs-doctag":{color:googleCodeColors.AccentPurple,fontWeight:"bold"},"hljs-type":{color:googleCodeColors.AccentPurple},"hljs-attr":{color:googleCodeColors.AccentPurple},"hljs-built_in":{color:googleCodeColors.AccentPurple},"hljs-builtin-name":{color:googleCodeColors.AccentPurple},"hljs-params":{color:googleCodeColors.AccentPurple},"hljs-attribute":{color:googleCodeColors.Foreground},"hljs-subst":{color:googleCodeColors.Foreground},"hljs-formula":{backgroundColor:"#eee",fontStyle:"italic"},"hljs-selector-id":{color:googleCodeColors.AccentYellow},"hljs-selector-class":{color:googleCodeColors.AccentYellow},"hljs-addition":{backgroundColor:"#baeeba"},"hljs-deletion":{backgroundColor:"#ffc8bd"},"hljs-strong":{fontWeight:"bold"},"hljs-emphasis":{fontStyle:"italic"}},googleCodeColors);init_esbuild_shims();var DefaultLight=new Theme(DEFAULT_LIGHT_THEME_NAME,"light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:lightTheme.Background,color:lightTheme.Foreground},"hljs-comment":{color:lightTheme.Comment},"hljs-quote":{color:lightTheme.Comment},"hljs-variable":{color:lightTheme.Foreground},"hljs-keyword":{color:lightTheme.AccentBlue},"hljs-selector-tag":{color:lightTheme.AccentBlue},"hljs-built_in":{color:lightTheme.AccentBlue},"hljs-name":{color:lightTheme.AccentBlue},"hljs-tag":{color:lightTheme.AccentBlue},"hljs-string":{color:lightTheme.AccentRed},"hljs-title":{color:lightTheme.AccentRed},"hljs-section":{color:lightTheme.AccentRed},"hljs-attribute":{color:lightTheme.AccentRed},"hljs-literal":{color:lightTheme.AccentRed},"hljs-template-tag":{color:lightTheme.AccentRed},"hljs-template-variable":{color:lightTheme.AccentRed},"hljs-type":{color:lightTheme.AccentRed},"hljs-addition":{color:lightTheme.AccentGreen},"hljs-deletion":{color:lightTheme.AccentRed},"hljs-selector-attr":{color:lightTheme.AccentCyan},"hljs-selector-pseudo":{color:lightTheme.AccentCyan},"hljs-meta":{color:lightTheme.AccentCyan},"hljs-doctag":{color:lightTheme.Gray},"hljs-attr":{color:lightTheme.AccentRed},"hljs-symbol":{color:lightTheme.AccentCyan},"hljs-bullet":{color:lightTheme.AccentCyan},"hljs-link":{color:lightTheme.AccentCyan},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}},lightTheme);init_esbuild_shims();var DefaultDark=new Theme(DEFAULT_DARK_THEME_NAME,"dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:darkTheme.Background,color:darkTheme.Foreground},"hljs-keyword":{color:darkTheme.AccentBlue},"hljs-literal":{color:darkTheme.AccentBlue},"hljs-symbol":{color:darkTheme.AccentBlue},"hljs-name":{color:darkTheme.AccentBlue},"hljs-link":{color:darkTheme.AccentBlue,textDecoration:"underline"},"hljs-built_in":{color:darkTheme.AccentCyan},"hljs-type":{color:darkTheme.AccentCyan},"hljs-number":{color:darkTheme.AccentGreen},"hljs-class":{color:darkTheme.AccentGreen},"hljs-string":{color:darkTheme.AccentYellow},"hljs-meta-string":{color:darkTheme.AccentYellow},"hljs-regexp":{color:darkTheme.AccentRed},"hljs-template-tag":{color:darkTheme.AccentRed},"hljs-subst":{color:darkTheme.Foreground},"hljs-function":{color:darkTheme.Foreground},"hljs-title":{color:darkTheme.Foreground},"hljs-params":{color:darkTheme.Foreground},"hljs-formula":{color:darkTheme.Foreground},"hljs-comment":{color:darkTheme.Comment,fontStyle:"italic"},"hljs-quote":{color:darkTheme.Comment,fontStyle:"italic"},"hljs-doctag":{color:darkTheme.Comment},"hljs-meta":{color:darkTheme.Gray},"hljs-meta-keyword":{color:darkTheme.Gray},"hljs-tag":{color:darkTheme.Gray},"hljs-variable":{color:darkTheme.AccentPurple},"hljs-template-variable":{color:darkTheme.AccentPurple},"hljs-attr":{color:darkTheme.LightBlue},"hljs-attribute":{color:darkTheme.LightBlue},"hljs-builtin-name":{color:darkTheme.LightBlue},"hljs-section":{color:darkTheme.AccentYellow},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"},"hljs-bullet":{color:darkTheme.AccentYellow},"hljs-selector-tag":{color:darkTheme.AccentYellow},"hljs-selector-id":{color:darkTheme.AccentYellow},"hljs-selector-class":{color:darkTheme.AccentYellow},"hljs-selector-attr":{color:darkTheme.AccentYellow},"hljs-selector-pseudo":{color:darkTheme.AccentYellow},"hljs-addition":{backgroundColor:"#144212",display:"inline-block",width:"100%"},"hljs-deletion":{backgroundColor:"#600",display:"inline-block",width:"100%"}},darkTheme);init_esbuild_shims();var shadesOfPurpleColors={type:"dark",Background:"#2d2b57",Foreground:"#e3dfff",LightBlue:"#847ace",AccentBlue:"#a599e9",AccentPurple:"#ac65ff",AccentCyan:"#a1feff",AccentGreen:"#A5FF90",AccentYellow:"#fad000",AccentRed:"#ff628c",AccentYellowDim:"#8B7530",AccentRedDim:"#8B3A4A",DiffAdded:"#383E45",DiffRemoved:"#572244",Comment:"#B362FF",Gray:"#726c86",GradientColors:["#4d21fc","#847ace","#ff628c"]};var additionalColors={AccentYellowAlt:"#f8d000",AccentOrange:"#fb9e00",AccentPink:"#fa658d",AccentLightPurple:"#c991ff",AccentDarkPurple:"#6943ff",AccentTeal:"#2ee2fa"};var ShadesOfPurple=new Theme("Shades Of Purple","dark",{hljs:{display:"block",overflowX:"auto",background:shadesOfPurpleColors.Background,color:shadesOfPurpleColors.Foreground},"hljs-title":{color:shadesOfPurpleColors.AccentYellow,fontWeight:"normal"},"hljs-name":{color:shadesOfPurpleColors.AccentCyan,fontWeight:"normal"},"hljs-tag":{color:shadesOfPurpleColors.Foreground},"hljs-attr":{color:additionalColors.AccentYellowAlt,fontStyle:"italic"},"hljs-built_in":{color:additionalColors.AccentOrange},"hljs-selector-tag":{color:additionalColors.AccentOrange,fontWeight:"normal"},"hljs-section":{color:additionalColors.AccentOrange},"hljs-keyword":{color:additionalColors.AccentOrange,fontWeight:"normal"},"hljs-subst":{color:shadesOfPurpleColors.Foreground},"hljs-string":{color:shadesOfPurpleColors.AccentGreen},"hljs-attribute":{color:shadesOfPurpleColors.AccentGreen},"hljs-symbol":{color:shadesOfPurpleColors.AccentGreen},"hljs-bullet":{color:shadesOfPurpleColors.AccentGreen},"hljs-addition":{color:shadesOfPurpleColors.AccentGreen},"hljs-code":{color:shadesOfPurpleColors.AccentGreen},"hljs-regexp":{color:shadesOfPurpleColors.AccentGreen},"hljs-selector-class":{color:shadesOfPurpleColors.AccentGreen},"hljs-selector-attr":{color:shadesOfPurpleColors.AccentGreen},"hljs-selector-pseudo":{color:shadesOfPurpleColors.AccentGreen},"hljs-template-tag":{color:shadesOfPurpleColors.AccentGreen},"hljs-quote":{color:shadesOfPurpleColors.AccentGreen},"hljs-deletion":{color:shadesOfPurpleColors.AccentRed},"hljs-meta":{color:additionalColors.AccentOrange},"hljs-meta-string":{color:additionalColors.AccentOrange},"hljs-comment":{color:shadesOfPurpleColors.AccentPurple},"hljs-literal":{color:additionalColors.AccentPink,fontWeight:"normal"},"hljs-number":{color:additionalColors.AccentPink},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"},"hljs-diff":{color:shadesOfPurpleColors.Foreground},"hljs-meta.hljs-diff":{color:shadesOfPurpleColors.AccentBlue},"hljs-ln":{color:shadesOfPurpleColors.Gray},"hljs-type":{color:shadesOfPurpleColors.AccentYellow,fontWeight:"normal"},"hljs-variable":{color:shadesOfPurpleColors.AccentYellow},"hljs-template-variable":{color:shadesOfPurpleColors.AccentGreen},"hljs-function .hljs-keyword":{color:additionalColors.AccentOrange},"hljs-link":{color:shadesOfPurpleColors.LightBlue},"hljs-doctag":{fontWeight:"bold"},"hljs-params":{color:additionalColors.AccentLightPurple,fontStyle:"italic"},"hljs-class":{color:shadesOfPurpleColors.AccentCyan,fontWeight:"bold"},"hljs-function":{color:shadesOfPurpleColors.AccentCyan},"hljs-property":{color:shadesOfPurpleColors.AccentBlue},"hljs-operator":{color:additionalColors.AccentDarkPurple},"hljs-punctuation":{color:shadesOfPurpleColors.Gray},"hljs-selector-id":{color:shadesOfPurpleColors.AccentYellow,fontWeight:"bold"},"hljs-char":{color:shadesOfPurpleColors.AccentGreen},"hljs-escape":{color:additionalColors.AccentPink,fontWeight:"bold"},"hljs-meta-keyword":{color:additionalColors.AccentOrange,fontWeight:"bold"},"hljs-builtin-name":{color:additionalColors.AccentTeal},"hljs-module":{color:shadesOfPurpleColors.AccentCyan},"hljs-namespace":{color:shadesOfPurpleColors.LightBlue},"hljs-important":{color:shadesOfPurpleColors.AccentRed,fontWeight:"bold"},"hljs-formula":{color:shadesOfPurpleColors.AccentCyan,fontStyle:"italic"},"hljs-decorator":{color:additionalColors.AccentTeal,fontWeight:"bold"},"hljs-symbol.ruby":{color:additionalColors.AccentPink},"hljs-keyword.sql":{color:additionalColors.AccentOrange,textTransform:"uppercase"},"hljs-section.markdown":{color:shadesOfPurpleColors.AccentYellow,fontWeight:"bold"},"hljs-attr.json":{color:shadesOfPurpleColors.AccentCyan},"hljs-tag .hljs-name":{color:shadesOfPurpleColors.AccentRed},"hljs-tag .hljs-attr":{color:additionalColors.AccentYellowAlt},"hljs.hljs-line-numbers":{borderRight:`1px solid ${shadesOfPurpleColors.Gray}`},"hljs.hljs-line-numbers .hljs-ln-numbers":{color:shadesOfPurpleColors.Gray,paddingRight:"1em"},"hljs.hljs-line-numbers .hljs-ln-code":{paddingLeft:"1em"},"hljs::selection":{background:shadesOfPurpleColors.AccentBlue+"40"},"hljs ::-moz-selection":{background:shadesOfPurpleColors.AccentBlue+"40"},"hljs .hljs-highlight":{background:shadesOfPurpleColors.AccentPurple+"20",display:"block",width:"100%"}},shadesOfPurpleColors);init_esbuild_shims();var xcodeColors={type:"light",Background:"#fff",Foreground:"#444",LightBlue:"#0E0EFF",AccentBlue:"#1c00cf",AccentPurple:"#aa0d91",AccentCyan:"#3F6E74",AccentGreen:"#007400",AccentYellow:"#836C28",AccentRed:"#c41a16",AccentYellowDim:"#8B7000",AccentRedDim:"#993333",DiffAdded:"#C6EAD8",DiffRemoved:"#FEDEDE",Comment:"#007400",Gray:"#c0c0c0",GradientColors:["#1c00cf","#007400"]};var XCode=new Theme("Xcode","light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:xcodeColors.Background,color:xcodeColors.Foreground},"xml .hljs-meta":{color:xcodeColors.Gray},"hljs-comment":{color:xcodeColors.Comment},"hljs-quote":{color:xcodeColors.Comment},"hljs-tag":{color:xcodeColors.AccentPurple},"hljs-attribute":{color:xcodeColors.AccentPurple},"hljs-keyword":{color:xcodeColors.AccentPurple},"hljs-selector-tag":{color:xcodeColors.AccentPurple},"hljs-literal":{color:xcodeColors.AccentPurple},"hljs-name":{color:xcodeColors.AccentPurple},"hljs-variable":{color:xcodeColors.AccentCyan},"hljs-template-variable":{color:xcodeColors.AccentCyan},"hljs-code":{color:xcodeColors.AccentRed},"hljs-string":{color:xcodeColors.AccentRed},"hljs-meta-string":{color:xcodeColors.AccentRed},"hljs-regexp":{color:xcodeColors.LightBlue},"hljs-link":{color:xcodeColors.LightBlue},"hljs-title":{color:xcodeColors.AccentBlue},"hljs-symbol":{color:xcodeColors.AccentBlue},"hljs-bullet":{color:xcodeColors.AccentBlue},"hljs-number":{color:xcodeColors.AccentBlue},"hljs-section":{color:xcodeColors.AccentYellow},"hljs-meta":{color:xcodeColors.AccentYellow},"hljs-class .hljs-title":{color:xcodeColors.AccentPurple},"hljs-type":{color:xcodeColors.AccentPurple},"hljs-built_in":{color:xcodeColors.AccentPurple},"hljs-builtin-name":{color:xcodeColors.AccentPurple},"hljs-params":{color:xcodeColors.AccentPurple},"hljs-attr":{color:xcodeColors.AccentYellow},"hljs-subst":{color:xcodeColors.Foreground},"hljs-formula":{backgroundColor:"#eee",fontStyle:"italic"},"hljs-addition":{backgroundColor:"#baeeba"},"hljs-deletion":{backgroundColor:"#ffc8bd"},"hljs-selector-id":{color:xcodeColors.AccentYellow},"hljs-selector-class":{color:xcodeColors.AccentYellow},"hljs-doctag":{fontWeight:"bold"},"hljs-strong":{fontWeight:"bold"},"hljs-emphasis":{fontStyle:"italic"}},xcodeColors);init_esbuild_shims();init_esbuild_shims();var lightSemanticColors={text:{primary:lightTheme.Foreground,secondary:lightTheme.Gray,link:lightTheme.AccentBlue,accent:lightTheme.AccentPurple,code:lightTheme.LightBlue},background:{primary:lightTheme.Background,diff:{added:lightTheme.DiffAdded,removed:lightTheme.DiffRemoved}},border:{default:lightTheme.Gray,focused:lightTheme.AccentBlue},ui:{comment:lightTheme.Comment,symbol:lightTheme.Gray,gradient:lightTheme.GradientColors},status:{error:lightTheme.AccentRed,success:lightTheme.AccentGreen,warning:lightTheme.AccentYellow,errorDim:lightTheme.AccentRedDim,warningDim:lightTheme.AccentYellowDim}};var darkSemanticColors={text:{primary:darkTheme.Foreground,secondary:darkTheme.Gray,link:darkTheme.AccentBlue,accent:darkTheme.AccentPurple,code:darkTheme.LightBlue},background:{primary:darkTheme.Background,diff:{added:darkTheme.DiffAdded,removed:darkTheme.DiffRemoved}},border:{default:darkTheme.Gray,focused:darkTheme.AccentBlue},ui:{comment:darkTheme.Comment,symbol:darkTheme.Gray,gradient:darkTheme.GradientColors},status:{error:darkTheme.AccentRed,success:darkTheme.AccentGreen,warning:darkTheme.AccentYellow,errorDim:darkTheme.AccentRedDim,warningDim:darkTheme.AccentYellowDim}};var ansiSemanticColors={text:{primary:ansiTheme.Foreground,secondary:ansiTheme.Gray,link:ansiTheme.AccentBlue,accent:ansiTheme.AccentPurple,code:ansiTheme.LightBlue},background:{primary:ansiTheme.Background,diff:{added:ansiTheme.DiffAdded,removed:ansiTheme.DiffRemoved}},border:{default:ansiTheme.Gray,focused:ansiTheme.AccentBlue},ui:{comment:ansiTheme.Comment,symbol:ansiTheme.Gray,gradient:ansiTheme.GradientColors},status:{error:ansiTheme.AccentRed,success:ansiTheme.AccentGreen,warning:ansiTheme.AccentYellow,errorDim:ansiTheme.AccentRedDim,warningDim:ansiTheme.AccentYellowDim}};var qwenLightColors={type:"light",Background:"#f8f9fa",Foreground:"#5c6166",LightBlue:"#55b4d4",AccentBlue:"#399ee6",AccentPurple:"#a37acc",AccentCyan:"#4cbf99",AccentGreen:"#86b300",AccentYellow:"#f2ae49",AccentRed:"#f07171",AccentYellowDim:"#8B7000",AccentRedDim:"#993333",DiffAdded:"#86b300",DiffRemoved:"#f07171",Comment:"#ABADB1",Gray:"#CCCFD3",GradientColors:["#399ee6","#86b300"]};var QwenLight=new Theme("Qwen Light","light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:qwenLightColors.Background,color:qwenLightColors.Foreground},"hljs-comment":{color:qwenLightColors.Comment,fontStyle:"italic"},"hljs-quote":{color:qwenLightColors.AccentCyan,fontStyle:"italic"},"hljs-string":{color:qwenLightColors.AccentGreen},"hljs-constant":{color:qwenLightColors.AccentCyan},"hljs-number":{color:qwenLightColors.AccentPurple},"hljs-keyword":{color:qwenLightColors.AccentYellow},"hljs-selector-tag":{color:qwenLightColors.AccentYellow},"hljs-attribute":{color:qwenLightColors.AccentYellow},"hljs-variable":{color:qwenLightColors.Foreground},"hljs-variable.language":{color:qwenLightColors.LightBlue,fontStyle:"italic"},"hljs-title":{color:qwenLightColors.AccentBlue},"hljs-section":{color:qwenLightColors.AccentGreen,fontWeight:"bold"},"hljs-type":{color:qwenLightColors.LightBlue},"hljs-class .hljs-title":{color:qwenLightColors.AccentBlue},"hljs-tag":{color:qwenLightColors.LightBlue},"hljs-name":{color:qwenLightColors.AccentBlue},"hljs-builtin-name":{color:qwenLightColors.AccentYellow},"hljs-meta":{color:qwenLightColors.AccentYellow},"hljs-symbol":{color:qwenLightColors.AccentRed},"hljs-bullet":{color:qwenLightColors.AccentYellow},"hljs-regexp":{color:qwenLightColors.AccentCyan},"hljs-link":{color:qwenLightColors.LightBlue},"hljs-deletion":{color:qwenLightColors.AccentRed},"hljs-addition":{color:qwenLightColors.AccentGreen},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"},"hljs-literal":{color:qwenLightColors.AccentCyan},"hljs-built_in":{color:qwenLightColors.AccentRed},"hljs-doctag":{color:qwenLightColors.AccentRed},"hljs-template-variable":{color:qwenLightColors.AccentCyan},"hljs-selector-id":{color:qwenLightColors.AccentRed}},qwenLightColors,lightSemanticColors);init_esbuild_shims();var qwenDarkColors={type:"dark",Background:"#0b0e14",Foreground:"#bfbdb6",LightBlue:"#59C2FF",AccentBlue:"#39BAE6",AccentPurple:"#D2A6FF",AccentCyan:"#95E6CB",AccentGreen:"#AAD94C",AccentYellow:"#FFD700",AccentRed:"#F26D78",AccentYellowDim:"#8B7530",AccentRedDim:"#8B3A4A",DiffAdded:"#AAD94C",DiffRemoved:"#F26D78",Comment:"#646A71",Gray:"#3D4149",GradientColors:["#FFD700","#da7959"]};var QwenDark=new Theme("Qwen Dark","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:qwenDarkColors.Background,color:qwenDarkColors.Foreground},"hljs-keyword":{color:qwenDarkColors.AccentYellow},"hljs-literal":{color:qwenDarkColors.AccentPurple},"hljs-symbol":{color:qwenDarkColors.AccentCyan},"hljs-name":{color:qwenDarkColors.LightBlue},"hljs-link":{color:qwenDarkColors.AccentBlue},"hljs-function .hljs-keyword":{color:qwenDarkColors.AccentYellow},"hljs-subst":{color:qwenDarkColors.Foreground},"hljs-string":{color:qwenDarkColors.AccentGreen},"hljs-title":{color:qwenDarkColors.AccentYellow},"hljs-type":{color:qwenDarkColors.AccentBlue},"hljs-attribute":{color:qwenDarkColors.AccentYellow},"hljs-bullet":{color:qwenDarkColors.AccentYellow},"hljs-addition":{color:qwenDarkColors.AccentGreen},"hljs-variable":{color:qwenDarkColors.Foreground},"hljs-template-tag":{color:qwenDarkColors.AccentYellow},"hljs-template-variable":{color:qwenDarkColors.AccentYellow},"hljs-comment":{color:qwenDarkColors.Comment,fontStyle:"italic"},"hljs-quote":{color:qwenDarkColors.AccentCyan,fontStyle:"italic"},"hljs-deletion":{color:qwenDarkColors.AccentRed},"hljs-meta":{color:qwenDarkColors.AccentYellow},"hljs-doctag":{fontWeight:"bold"},"hljs-strong":{fontWeight:"bold"},"hljs-emphasis":{fontStyle:"italic"}},qwenDarkColors,darkSemanticColors);import*as fs from"node:fs";import*as path from"node:path";import*as os from"node:os";init_esbuild_shims();var ansiColors={type:"dark",Background:"black",Foreground:"white",LightBlue:"bluebright",AccentBlue:"blue",AccentPurple:"magenta",AccentCyan:"cyan",AccentGreen:"green",AccentYellow:"yellow",AccentRed:"red",AccentYellowDim:"yellow",AccentRedDim:"red",DiffAdded:"#003300",DiffRemoved:"#4D0000",Comment:"gray",Gray:"gray",GradientColors:["cyan","green"]};var ANSI=new Theme("ANSI","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:"black",color:"white"},"hljs-keyword":{color:"blue"},"hljs-literal":{color:"blue"},"hljs-symbol":{color:"blue"},"hljs-name":{color:"blue"},"hljs-link":{color:"blue"},"hljs-built_in":{color:"cyan"},"hljs-type":{color:"cyan"},"hljs-number":{color:"green"},"hljs-class":{color:"green"},"hljs-string":{color:"yellow"},"hljs-meta-string":{color:"yellow"},"hljs-regexp":{color:"red"},"hljs-template-tag":{color:"red"},"hljs-subst":{color:"white"},"hljs-function":{color:"white"},"hljs-title":{color:"white"},"hljs-params":{color:"white"},"hljs-formula":{color:"white"},"hljs-comment":{color:"green"},"hljs-quote":{color:"green"},"hljs-doctag":{color:"green"},"hljs-meta":{color:"gray"},"hljs-meta-keyword":{color:"gray"},"hljs-tag":{color:"gray"},"hljs-variable":{color:"magenta"},"hljs-template-variable":{color:"magenta"},"hljs-attr":{color:"bluebright"},"hljs-attribute":{color:"bluebright"},"hljs-builtin-name":{color:"bluebright"},"hljs-section":{color:"yellow"},"hljs-emphasis":{},"hljs-strong":{},"hljs-bullet":{color:"yellow"},"hljs-selector-tag":{color:"yellow"},"hljs-selector-id":{color:"yellow"},"hljs-selector-class":{color:"yellow"},"hljs-selector-attr":{color:"yellow"},"hljs-selector-pseudo":{color:"yellow"}},ansiColors,darkSemanticColors);init_esbuild_shims();var ansiLightColors={type:"light",Background:"white",Foreground:"#444",LightBlue:"blue",AccentBlue:"blue",AccentPurple:"purple",AccentCyan:"cyan",AccentGreen:"green",AccentYellow:"orange",AccentRed:"red",AccentYellowDim:"orange",AccentRedDim:"red",DiffAdded:"#E5F2E5",DiffRemoved:"#FFE5E5",Comment:"gray",Gray:"gray",GradientColors:["blue","green"]};var ANSILight=new Theme("ANSI Light","light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:"white",color:"black"},"hljs-keyword":{color:"blue"},"hljs-literal":{color:"blue"},"hljs-symbol":{color:"blue"},"hljs-name":{color:"blue"},"hljs-link":{color:"blue"},"hljs-built_in":{color:"cyan"},"hljs-type":{color:"cyan"},"hljs-number":{color:"green"},"hljs-class":{color:"green"},"hljs-string":{color:"red"},"hljs-meta-string":{color:"red"},"hljs-regexp":{color:"magenta"},"hljs-template-tag":{color:"magenta"},"hljs-subst":{color:"black"},"hljs-function":{color:"black"},"hljs-title":{color:"black"},"hljs-params":{color:"black"},"hljs-formula":{color:"black"},"hljs-comment":{color:"gray"},"hljs-quote":{color:"gray"},"hljs-doctag":{color:"gray"},"hljs-meta":{color:"gray"},"hljs-meta-keyword":{color:"gray"},"hljs-tag":{color:"gray"},"hljs-variable":{color:"purple"},"hljs-template-variable":{color:"purple"},"hljs-attr":{color:"blue"},"hljs-attribute":{color:"blue"},"hljs-builtin-name":{color:"blue"},"hljs-section":{color:"orange"},"hljs-bullet":{color:"orange"},"hljs-selector-tag":{color:"orange"},"hljs-selector-id":{color:"orange"},"hljs-selector-class":{color:"orange"},"hljs-selector-attr":{color:"orange"},"hljs-selector-pseudo":{color:"orange"}},ansiLightColors,lightSemanticColors);init_esbuild_shims();var noColorColorsTheme={type:"ansi",Background:"",Foreground:"",LightBlue:"",AccentBlue:"",AccentPurple:"",AccentCyan:"",AccentGreen:"",AccentYellow:"",AccentRed:"",AccentYellowDim:"",AccentRedDim:"",DiffAdded:"",DiffRemoved:"",Comment:"",Gray:""};var noColorSemanticColors={text:{primary:"",secondary:"",link:"",accent:"",code:""},background:{primary:"",diff:{added:"",removed:""}},border:{default:"",focused:""},ui:{comment:"",symbol:"",gradient:[]},status:{error:"",success:"",warning:"",errorDim:"",warningDim:""}};var NoColorTheme=new Theme("NoColor","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em"},"hljs-keyword":{},"hljs-literal":{},"hljs-symbol":{},"hljs-name":{},"hljs-link":{textDecoration:"underline"},"hljs-built_in":{},"hljs-type":{},"hljs-number":{},"hljs-class":{},"hljs-string":{},"hljs-meta-string":{},"hljs-regexp":{},"hljs-template-tag":{},"hljs-subst":{},"hljs-function":{},"hljs-title":{},"hljs-params":{},"hljs-formula":{},"hljs-comment":{fontStyle:"italic"},"hljs-quote":{fontStyle:"italic"},"hljs-doctag":{},"hljs-meta":{},"hljs-meta-keyword":{},"hljs-tag":{},"hljs-variable":{},"hljs-template-variable":{},"hljs-attr":{},"hljs-attribute":{},"hljs-builtin-name":{},"hljs-section":{},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"},"hljs-bullet":{},"hljs-selector-tag":{},"hljs-selector-id":{},"hljs-selector-class":{},"hljs-selector-attr":{},"hljs-selector-pseudo":{},"hljs-addition":{display:"inline-block",width:"100%"},"hljs-deletion":{display:"inline-block",width:"100%"}},noColorColorsTheme,noColorSemanticColors);import process2 from"node:process";init_esbuild_shims();import{execSync}from"node:child_process";import process from"node:process";var debugLogger2=createDebugLogger("THEME_DETECT");var OSC11_TIMEOUT_MS=200;function hexComponent(hex){const max=16**hex.length-1;return parseInt(hex,16)/max}__name(hexComponent,"hexComponent");function parseOscRgb(data){const rgbMatch=/^rgba?:([0-9a-f]{1,4})\/([0-9a-f]{1,4})\/([0-9a-f]{1,4})$/i.exec(data);if(rgbMatch){return{r:hexComponent(rgbMatch[1]),g:hexComponent(rgbMatch[2]),b:hexComponent(rgbMatch[3])}}const hashMatch=/^#([0-9a-f]+)$/i.exec(data);if(hashMatch&&hashMatch[1].length%3===0){const hex=hashMatch[1];const n=hex.length/3;return{r:hexComponent(hex.slice(0,n)),g:hexComponent(hex.slice(n,2*n)),b:hexComponent(hex.slice(2*n))}}return void 0}__name(parseOscRgb,"parseOscRgb");function themeFromOscColor(data){const rgb=parseOscRgb(data);if(!rgb)return void 0;const luminance=.2126*rgb.r+.7152*rgb.g+.0722*rgb.b;return luminance>.5?"light":"dark"}__name(themeFromOscColor,"themeFromOscColor");function detectOsc11Theme(){if(!process.stdin.isTTY||!process.stdout.isTTY){return Promise.resolve(void 0)}return new Promise(resolve2=>{const stdin=process.stdin;let resolved=false;let buffer="";const finish=__name(result=>{if(resolved)return;resolved=true;clearTimeout(timer);stdin.removeListener("data",onData);resolve2(result)},"finish");const timer=setTimeout(()=>finish(void 0),OSC11_TIMEOUT_MS);const onData=__name(data=>{buffer+=data.toString();const match=/\x1b\]11;(.*?)(?:\x07|\x1b\\)/.exec(buffer);if(match){finish(themeFromOscColor(match[1]))}},"onData");stdin.on("data",onData);process.stdout.write("\x1B]11;?\x07")})}__name(detectOsc11Theme,"detectOsc11Theme");function detectMacOSTheme(){if(process.platform!=="darwin"){return void 0}try{const result=execSync("defaults read -g AppleInterfaceStyle",{encoding:"utf-8",timeout:3e3,stdio:["pipe","pipe","pipe"]}).trim();return result.toLowerCase()==="dark"?"dark":"light"}catch(error){const err=error;const stderr=typeof err.stderr==="string"?err.stderr:err.stderr?.toString?.()??"";const message=err.message??"";if(/does not exist/i.test(stderr)||/does not exist/i.test(message)){return"light"}return void 0}}__name(detectMacOSTheme,"detectMacOSTheme");function detectFromColorFgBg(){const colorFgBg=process.env["COLORFGBG"];if(!colorFgBg){return void 0}const parts=colorFgBg.split(";");const bgStr=parts[parts.length-1];if(bgStr===void 0){return void 0}const bg=parseInt(bgStr,10);if(isNaN(bg)){return void 0}if(bg===7||bg>=9&&bg<=15){return"light"}return"dark"}__name(detectFromColorFgBg,"detectFromColorFgBg");function detectTerminalTheme(){const colorFgBgResult=detectFromColorFgBg();if(colorFgBgResult){debugLogger2.info(`Detected theme from COLORFGBG: ${colorFgBgResult}`);return colorFgBgResult}const macResult=detectMacOSTheme();if(macResult){debugLogger2.info(`Detected theme from macOS system appearance: ${macResult}`);return macResult}debugLogger2.info("Could not detect terminal theme, defaulting to dark");return"dark"}__name(detectTerminalTheme,"detectTerminalTheme");async function detectTerminalThemeAsync(){const colorFgBgResult=detectFromColorFgBg();if(colorFgBgResult){debugLogger2.info(`Detected theme from COLORFGBG (async path): ${colorFgBgResult}`);return colorFgBgResult}const osc11Result=await detectOsc11Theme();if(osc11Result){debugLogger2.info(`Detected theme from OSC 11 background query: ${osc11Result}`);return osc11Result}const macResult=detectMacOSTheme();if(macResult){debugLogger2.info(`Detected theme from macOS system appearance: ${macResult}`);return macResult}debugLogger2.info("Could not detect terminal theme, defaulting to dark");return"dark"}__name(detectTerminalThemeAsync,"detectTerminalThemeAsync");var debugLogger3=createDebugLogger("THEME_MANAGER");var DEFAULT_THEME=QwenDark;var AUTO_THEME_NAME="auto";function isPathWithinDirectory(parent,child){const relativePath=path.relative(parent,child);return relativePath===""||!relativePath.startsWith(`..${path.sep}`)&&relativePath!==".."&&!path.isAbsolute(relativePath)}__name(isPathWithinDirectory,"isPathWithinDirectory");var ThemeManager=class{static{__name(this,"ThemeManager")}availableThemes;activeTheme;customThemes=new Map;constructor(){this.availableThemes=[AyuDark,AyuLight,AtomOneDark,Dracula,DefaultLight,DefaultDark,GitHubDark,GitHubLight,GoogleCode,QwenLight,QwenDark,ShadesOfPurple,XCode,ANSI,ANSILight];this.activeTheme=DEFAULT_THEME}loadCustomThemes(customThemesSettings){this.customThemes.clear();if(!customThemesSettings){return}for(const[name,customThemeConfig]of Object.entries(customThemesSettings)){const validation=validateCustomTheme(customThemeConfig);if(validation.isValid){if(validation.warning){debugLogger3.warn(`Theme "${name}": ${validation.warning}`)}const themeWithDefaults={...DEFAULT_THEME.colors,...customThemeConfig,name:customThemeConfig.name||name,type:"custom"};try{const theme=createCustomTheme(themeWithDefaults);this.customThemes.set(name,theme)}catch(error){debugLogger3.warn(`Failed to load custom theme "${name}":`,error)}}else{debugLogger3.warn(`Invalid custom theme "${name}": ${validation.error}`)}}if(this.activeTheme&&this.activeTheme.type==="custom"&&this.customThemes.has(this.activeTheme.name)){this.activeTheme=this.customThemes.get(this.activeTheme.name)}}setActiveTheme(themeName){if(themeName===AUTO_THEME_NAME){this.activeTheme=this.resolveAutoTheme();debugLogger3.info(`Auto-detected theme: ${this.activeTheme.name}`);return true}const theme=this.findThemeByName(themeName);if(!theme){return false}this.activeTheme=theme;return true}cachedAutoDetection;terminalBackground;resolveAutoTheme(){const detected=this.cachedAutoDetection??detectTerminalTheme();return detected==="light"?QwenLight:QwenDark}async resolveAutoThemeAsync(){const detected=await detectTerminalThemeAsync();this.cachedAutoDetection=detected;this.activeTheme=detected==="light"?QwenLight:QwenDark;debugLogger3.info(`Auto-detected theme (async): ${this.activeTheme.name}`)}getTerminalBackgroundType(){if(this.cachedAutoDetection){return this.cachedAutoDetection}this.terminalBackground??=detectTerminalTheme();return this.terminalBackground}getActiveTheme(){if(process2.env["NO_COLOR"]){return NoColorTheme}if(this.activeTheme){const isBuiltIn=this.availableThemes.some(t=>t.name===this.activeTheme.name);const isCustom=[...this.customThemes.values()].includes(this.activeTheme);if(isBuiltIn||isCustom){return this.activeTheme}}this.activeTheme=DEFAULT_THEME;return this.activeTheme}getSemanticColors(){return this.getActiveTheme().semanticColors}getCustomThemeNames(){return Array.from(this.customThemes.keys())}isCustomTheme(themeName){return this.customThemes.has(themeName)}getAvailableThemes(){const builtInThemes=this.availableThemes.map(theme=>({name:theme.name,type:theme.type,isCustom:false}));const customThemes=Array.from(this.customThemes.values()).map(theme=>({name:theme.name,type:theme.type,isCustom:true}));const qwenThemes=builtInThemes.filter(theme=>theme.name===QwenLight.name||theme.name===QwenDark.name);const otherBuiltInThemes=builtInThemes.filter(theme=>theme.name!==QwenLight.name&&theme.name!==QwenDark.name);const sortedOtherThemes=[...otherBuiltInThemes,...customThemes].sort((a,b)=>{const typeOrder=__name(type=>{switch(type){case"dark":return 1;case"light":return 2;case"ansi":return 3;case"custom":return 4;default:return 5}},"typeOrder");const typeComparison=typeOrder(a.type)-typeOrder(b.type);if(typeComparison!==0){return typeComparison}return a.name.localeCompare(b.name)});return[...qwenThemes,...sortedOtherThemes]}getTheme(themeName){return this.findThemeByName(themeName)}isPath(themeName){return themeName.endsWith(".json")||themeName.startsWith(".")||path.isAbsolute(themeName)}loadThemeFromFile(themePath){try{const canonicalPath=fs.realpathSync(path.resolve(themePath));if(this.customThemes.has(canonicalPath)){return this.customThemes.get(canonicalPath)}const homeDir=path.resolve(os.homedir());if(!isPathWithinDirectory(homeDir,canonicalPath)){debugLogger3.warn(`Theme file at "${themePath}" is outside your home directory. Only load themes from trusted sources.`);return void 0}const themeContent=fs.readFileSync(canonicalPath,"utf-8");const customThemeConfig=JSON.parse(themeContent);const validation=validateCustomTheme(customThemeConfig);if(!validation.isValid){debugLogger3.warn(`Invalid custom theme from file "${themePath}": ${validation.error}`);return void 0}if(validation.warning){debugLogger3.warn(`Theme from "${themePath}": ${validation.warning}`)}const themeWithDefaults={...DEFAULT_THEME.colors,...customThemeConfig,name:customThemeConfig.name||canonicalPath,type:"custom"};const theme=createCustomTheme(themeWithDefaults);this.customThemes.set(canonicalPath,theme);return theme}catch(error){if(!(error instanceof Error&&"code"in error&&error.code==="ENOENT")){debugLogger3.warn(`Could not load theme from file "${themePath}":`,error)}return void 0}}findThemeByName(themeName){if(!themeName){return DEFAULT_THEME}const builtInTheme=this.availableThemes.find(theme=>theme.name===themeName);if(builtInTheme){return builtInTheme}if(this.isPath(themeName)){return this.loadThemeFromFile(themeName)}if(this.customThemes.has(themeName)){return this.customThemes.get(themeName)}return void 0}};var themeManager=new ThemeManager;export{resolveColor,toHex,DEFAULT_THEME,AUTO_THEME_NAME,themeManager};
3
+ import{DEFAULT_DARK_THEME_NAME,DEFAULT_LIGHT_THEME_NAME}from"./chunk-UWCF7JIF.js";import{createDebugLogger}from"./chunk-46KPDLFH.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();init_esbuild_shims();init_esbuild_shims();init_esbuild_shims();var CSS_NAME_TO_HEX_MAP={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",blanchedalmond:"#ffebcd",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgrey:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",whitesmoke:"#f5f5f5",yellowgreen:"#9acd32"};var debugLogger=createDebugLogger("COLOR_UTILS");var INK_SUPPORTED_NAMES=new Set(["black","red","green","yellow","blue","cyan","magenta","white","gray","grey","blackbright","redbright","greenbright","yellowbright","bluebright","cyanbright","magentabright","whitebright"]);function resolveColor(colorValue){const lowerColor=colorValue.toLowerCase();if(lowerColor.startsWith("#")){if(/^#[0-9A-Fa-f]{3}([0-9A-Fa-f]{3})?$/.test(colorValue)){return lowerColor}else{return void 0}}else if(INK_SUPPORTED_NAMES.has(lowerColor)){return lowerColor}else if(CSS_NAME_TO_HEX_MAP[lowerColor]){return CSS_NAME_TO_HEX_MAP[lowerColor]}debugLogger.warn(`[ColorUtils] Could not resolve color "${colorValue}" to an Ink-compatible format.`);return void 0}__name(resolveColor,"resolveColor");var INK_NAME_TO_HEX={black:"#000000",red:"#ff0000",green:"#00ff00",yellow:"#ffff00",blue:"#0000ff",cyan:"#00ffff",magenta:"#ff00ff",white:"#ffffff",gray:"#808080",grey:"#808080",blackbright:"#808080",redbright:"#ff8080",greenbright:"#80ff80",yellowbright:"#ffff80",bluebright:"#8080ff",cyanbright:"#80ffff",magentabright:"#ff80ff",whitebright:"#ffffff"};function toHex(color){const resolved=(resolveColor(color)??color).toLowerCase();if(resolved.startsWith("#")){if(/^#[0-9a-f]{3}$/.test(resolved)){return`#${resolved.slice(1).split("").map(c=>c+c).join("")}`}if(/^#[0-9a-f]{6}$/.test(resolved)){return resolved}return void 0}return INK_NAME_TO_HEX[resolved]}__name(toHex,"toHex");var lightTheme={type:"light",Background:"#F0EEE6",Foreground:"#1F1E1D",LightBlue:"#B25E3C",AccentBlue:"#BD5D3A",AccentPurple:"#BD5D3A",AccentCyan:"#4F8A7B",AccentGreen:"#4A7C59",AccentYellow:"#A97E14",AccentRed:"#C0392B",AccentYellowDim:"#8B7000",AccentRedDim:"#993333",DiffAdded:"#DCE8D5",DiffRemoved:"#F5D9D5",Comment:"#6B6A63",Gray:"#83827D",GradientColors:["#D97757","#BD5D3A"]};var darkTheme={type:"dark",Background:"#262624",Foreground:"#E8E6DC",LightBlue:"#E6B49A",AccentBlue:"#D97757",AccentPurple:"#D97757",AccentCyan:"#8FB0A8",AccentGreen:"#83A97F",AccentYellow:"#E0B252",AccentRed:"#D4645A",AccentYellowDim:"#8B7530",AccentRedDim:"#8B3A4A",DiffAdded:"#2E3B2A",DiffRemoved:"#431F1C",Comment:"#8C8A80",Gray:"#6B6A63",GradientColors:["#D97757","#C2613F"]};var ansiTheme={type:"ansi",Background:"black",Foreground:"white",LightBlue:"blue",AccentBlue:"blue",AccentPurple:"magenta",AccentCyan:"cyan",AccentGreen:"green",AccentYellow:"yellow",AccentRed:"red",AccentYellowDim:"yellow",AccentRedDim:"red",DiffAdded:"green",DiffRemoved:"red",Comment:"gray",Gray:"gray"};var Theme=class _Theme{constructor(name,type,rawMappings,colors,semanticColors){this.name=name;this.type=type;this.colors=colors;this.semanticColors=semanticColors??{text:{primary:this.colors.Foreground,secondary:this.colors.Gray,link:this.colors.AccentBlue,accent:this.colors.AccentPurple,code:this.colors.LightBlue},background:{primary:this.colors.Background,diff:{added:this.colors.DiffAdded,removed:this.colors.DiffRemoved}},border:{default:this.colors.Gray,focused:this.colors.AccentBlue},ui:{comment:this.colors.Gray,symbol:this.colors.AccentCyan,gradient:this.colors.GradientColors},status:{error:this.colors.AccentRed,success:this.colors.AccentGreen,warning:this.colors.AccentYellow,errorDim:this.colors.AccentRedDim,warningDim:this.colors.AccentYellowDim}};this._colorMap=Object.freeze(this._buildColorMap(rawMappings));const rawDefaultColor=rawMappings["hljs"]?.color;this.defaultColor=(rawDefaultColor?_Theme._resolveColor(rawDefaultColor):void 0)??""}static{__name(this,"Theme")}defaultColor;_colorMap;semanticColors;getInkColor(hljsClass){return this._colorMap[hljsClass]}static _resolveColor(colorValue){return resolveColor(colorValue)}_buildColorMap(hljsTheme){const inkTheme={};for(const key in hljsTheme){if(!key.startsWith("hljs-")&&key!=="hljs"){continue}const style=hljsTheme[key];if(style?.color){const resolvedColor=_Theme._resolveColor(style.color);if(resolvedColor!==void 0){inkTheme[key]=resolvedColor}}}return inkTheme}};function createCustomTheme(customTheme){const colors={type:"custom",Background:customTheme.background?.primary??customTheme.Background??"",Foreground:customTheme.text?.primary??customTheme.Foreground??"",LightBlue:customTheme.text?.code??customTheme.LightBlue??"",AccentBlue:customTheme.text?.link??customTheme.AccentBlue??"",AccentPurple:customTheme.text?.accent??customTheme.AccentPurple??"",AccentCyan:customTheme.text?.link??customTheme.AccentCyan??"",AccentGreen:customTheme.status?.success??customTheme.AccentGreen??"",AccentYellow:customTheme.status?.warning??customTheme.AccentYellow??"",AccentRed:customTheme.status?.error??customTheme.AccentRed??"",AccentYellowDim:customTheme.status?.warningDim??customTheme.AccentYellowDim??"",AccentRedDim:customTheme.status?.errorDim??customTheme.AccentRedDim??"",DiffAdded:customTheme.background?.diff?.added??customTheme.DiffAdded??"",DiffRemoved:customTheme.background?.diff?.removed??customTheme.DiffRemoved??"",Comment:customTheme.ui?.comment??customTheme.Comment??"",Gray:customTheme.text?.secondary??customTheme.Gray??"",GradientColors:customTheme.ui?.gradient??customTheme.GradientColors};const rawMappings={hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:colors.Background,color:colors.Foreground},"hljs-keyword":{color:colors.AccentBlue},"hljs-literal":{color:colors.AccentBlue},"hljs-symbol":{color:colors.AccentBlue},"hljs-name":{color:colors.AccentBlue},"hljs-link":{color:colors.AccentBlue,textDecoration:"underline"},"hljs-built_in":{color:colors.AccentCyan},"hljs-type":{color:colors.AccentCyan},"hljs-number":{color:colors.AccentGreen},"hljs-class":{color:colors.AccentGreen},"hljs-string":{color:colors.AccentYellow},"hljs-meta-string":{color:colors.AccentYellow},"hljs-regexp":{color:colors.AccentRed},"hljs-template-tag":{color:colors.AccentRed},"hljs-subst":{color:colors.Foreground},"hljs-function":{color:colors.Foreground},"hljs-title":{color:colors.Foreground},"hljs-params":{color:colors.Foreground},"hljs-formula":{color:colors.Foreground},"hljs-comment":{color:colors.Comment,fontStyle:"italic"},"hljs-quote":{color:colors.Comment,fontStyle:"italic"},"hljs-doctag":{color:colors.Comment},"hljs-meta":{color:colors.Gray},"hljs-meta-keyword":{color:colors.Gray},"hljs-tag":{color:colors.Gray},"hljs-variable":{color:colors.AccentPurple},"hljs-template-variable":{color:colors.AccentPurple},"hljs-attr":{color:colors.LightBlue},"hljs-attribute":{color:colors.LightBlue},"hljs-builtin-name":{color:colors.LightBlue},"hljs-section":{color:colors.AccentYellow},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"},"hljs-bullet":{color:colors.AccentYellow},"hljs-selector-tag":{color:colors.AccentYellow},"hljs-selector-id":{color:colors.AccentYellow},"hljs-selector-class":{color:colors.AccentYellow},"hljs-selector-attr":{color:colors.AccentYellow},"hljs-selector-pseudo":{color:colors.AccentYellow},"hljs-addition":{backgroundColor:colors.AccentGreen,display:"inline-block",width:"100%"},"hljs-deletion":{backgroundColor:colors.AccentRed,display:"inline-block",width:"100%"}};const semanticColors={text:{primary:customTheme.text?.primary??colors.Foreground,secondary:customTheme.text?.secondary??colors.Gray,link:customTheme.text?.link??colors.AccentBlue,accent:customTheme.text?.accent??colors.AccentPurple,code:customTheme.text?.code??colors.LightBlue},background:{primary:customTheme.background?.primary??colors.Background,diff:{added:customTheme.background?.diff?.added??colors.DiffAdded,removed:customTheme.background?.diff?.removed??colors.DiffRemoved}},border:{default:customTheme.border?.default??colors.Gray,focused:customTheme.border?.focused??colors.AccentBlue},ui:{comment:customTheme.ui?.comment??colors.Comment,symbol:customTheme.ui?.symbol??colors.Gray,gradient:customTheme.ui?.gradient??colors.GradientColors},status:{error:customTheme.status?.error??colors.AccentRed,success:customTheme.status?.success??colors.AccentGreen,warning:customTheme.status?.warning??colors.AccentYellow,errorDim:customTheme.status?.errorDim??colors.AccentRedDim,warningDim:customTheme.status?.warningDim??colors.AccentYellowDim}};return new Theme(customTheme.name,"custom",rawMappings,colors,semanticColors)}__name(createCustomTheme,"createCustomTheme");function validateCustomTheme(customTheme){if(customTheme.name&&!isValidThemeName(customTheme.name)){return{isValid:false,error:`Invalid theme name: ${customTheme.name}`}}return{isValid:true}}__name(validateCustomTheme,"validateCustomTheme");function isValidThemeName(name){return name.trim().length>0&&name.trim().length<=50}__name(isValidThemeName,"isValidThemeName");var ayuDarkColors={type:"dark",Background:"#0b0e14",Foreground:"#aeaca6",LightBlue:"#59C2FF",AccentBlue:"#39BAE6",AccentPurple:"#D2A6FF",AccentCyan:"#95E6CB",AccentGreen:"#AAD94C",AccentYellow:"#FFB454",AccentRed:"#F26D78",AccentYellowDim:"#8B7530",AccentRedDim:"#8B3A4A",DiffAdded:"#293022",DiffRemoved:"#3D1215",Comment:"#646A71",Gray:"#3D4149",GradientColors:["#FFB454","#F26D78"]};var AyuDark=new Theme("Ayu","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:ayuDarkColors.Background,color:ayuDarkColors.Foreground},"hljs-keyword":{color:ayuDarkColors.AccentYellow},"hljs-literal":{color:ayuDarkColors.AccentPurple},"hljs-symbol":{color:ayuDarkColors.AccentCyan},"hljs-name":{color:ayuDarkColors.LightBlue},"hljs-link":{color:ayuDarkColors.AccentBlue},"hljs-function .hljs-keyword":{color:ayuDarkColors.AccentYellow},"hljs-subst":{color:ayuDarkColors.Foreground},"hljs-string":{color:ayuDarkColors.AccentGreen},"hljs-title":{color:ayuDarkColors.AccentYellow},"hljs-type":{color:ayuDarkColors.AccentBlue},"hljs-attribute":{color:ayuDarkColors.AccentYellow},"hljs-bullet":{color:ayuDarkColors.AccentYellow},"hljs-addition":{color:ayuDarkColors.AccentGreen},"hljs-variable":{color:ayuDarkColors.Foreground},"hljs-template-tag":{color:ayuDarkColors.AccentYellow},"hljs-template-variable":{color:ayuDarkColors.AccentYellow},"hljs-comment":{color:ayuDarkColors.Comment,fontStyle:"italic"},"hljs-quote":{color:ayuDarkColors.AccentCyan,fontStyle:"italic"},"hljs-deletion":{color:ayuDarkColors.AccentRed},"hljs-meta":{color:ayuDarkColors.AccentYellow},"hljs-doctag":{fontWeight:"bold"},"hljs-strong":{fontWeight:"bold"},"hljs-emphasis":{fontStyle:"italic"}},ayuDarkColors);init_esbuild_shims();var ayuLightColors={type:"light",Background:"#f8f9fa",Foreground:"#5c6166",LightBlue:"#55b4d4",AccentBlue:"#399ee6",AccentPurple:"#a37acc",AccentCyan:"#4cbf99",AccentGreen:"#86b300",AccentYellow:"#f2ae49",AccentRed:"#f07171",AccentYellowDim:"#8B7000",AccentRedDim:"#993333",DiffAdded:"#C6EAD8",DiffRemoved:"#FFCCCC",Comment:"#ABADB1",Gray:"#a6aaaf",GradientColors:["#399ee6","#86b300"]};var AyuLight=new Theme("Ayu Light","light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:ayuLightColors.Background,color:ayuLightColors.Foreground},"hljs-comment":{color:ayuLightColors.Comment,fontStyle:"italic"},"hljs-quote":{color:ayuLightColors.AccentCyan,fontStyle:"italic"},"hljs-string":{color:ayuLightColors.AccentGreen},"hljs-constant":{color:ayuLightColors.AccentCyan},"hljs-number":{color:ayuLightColors.AccentPurple},"hljs-keyword":{color:ayuLightColors.AccentYellow},"hljs-selector-tag":{color:ayuLightColors.AccentYellow},"hljs-attribute":{color:ayuLightColors.AccentYellow},"hljs-variable":{color:ayuLightColors.Foreground},"hljs-variable.language":{color:ayuLightColors.LightBlue,fontStyle:"italic"},"hljs-title":{color:ayuLightColors.AccentBlue},"hljs-section":{color:ayuLightColors.AccentGreen,fontWeight:"bold"},"hljs-type":{color:ayuLightColors.LightBlue},"hljs-class .hljs-title":{color:ayuLightColors.AccentBlue},"hljs-tag":{color:ayuLightColors.LightBlue},"hljs-name":{color:ayuLightColors.AccentBlue},"hljs-builtin-name":{color:ayuLightColors.AccentYellow},"hljs-meta":{color:ayuLightColors.AccentYellow},"hljs-symbol":{color:ayuLightColors.AccentRed},"hljs-bullet":{color:ayuLightColors.AccentYellow},"hljs-regexp":{color:ayuLightColors.AccentCyan},"hljs-link":{color:ayuLightColors.LightBlue},"hljs-deletion":{color:ayuLightColors.AccentRed},"hljs-addition":{color:ayuLightColors.AccentGreen},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"},"hljs-literal":{color:ayuLightColors.AccentCyan},"hljs-built_in":{color:ayuLightColors.AccentRed},"hljs-doctag":{color:ayuLightColors.AccentRed},"hljs-template-variable":{color:ayuLightColors.AccentCyan},"hljs-selector-id":{color:ayuLightColors.AccentRed}},ayuLightColors);init_esbuild_shims();var atomOneDarkColors={type:"dark",Background:"#282c34",Foreground:"#abb2bf",LightBlue:"#61aeee",AccentBlue:"#61aeee",AccentPurple:"#c678dd",AccentCyan:"#56b6c2",AccentGreen:"#98c379",AccentYellow:"#e6c07b",AccentRed:"#e06c75",AccentYellowDim:"#8B7530",AccentRedDim:"#8B3A4A",DiffAdded:"#39544E",DiffRemoved:"#562B2F",Comment:"#5c6370",Gray:"#5c6370",GradientColors:["#61aeee","#98c379"]};var AtomOneDark=new Theme("Atom One","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",color:atomOneDarkColors.Foreground,background:atomOneDarkColors.Background},"hljs-comment":{color:atomOneDarkColors.Comment,fontStyle:"italic"},"hljs-quote":{color:atomOneDarkColors.Comment,fontStyle:"italic"},"hljs-doctag":{color:atomOneDarkColors.AccentPurple},"hljs-keyword":{color:atomOneDarkColors.AccentPurple},"hljs-formula":{color:atomOneDarkColors.AccentPurple},"hljs-section":{color:atomOneDarkColors.AccentRed},"hljs-name":{color:atomOneDarkColors.AccentRed},"hljs-selector-tag":{color:atomOneDarkColors.AccentRed},"hljs-deletion":{color:atomOneDarkColors.AccentRed},"hljs-subst":{color:atomOneDarkColors.AccentRed},"hljs-literal":{color:atomOneDarkColors.AccentCyan},"hljs-string":{color:atomOneDarkColors.AccentGreen},"hljs-regexp":{color:atomOneDarkColors.AccentGreen},"hljs-addition":{color:atomOneDarkColors.AccentGreen},"hljs-attribute":{color:atomOneDarkColors.AccentGreen},"hljs-meta-string":{color:atomOneDarkColors.AccentGreen},"hljs-built_in":{color:atomOneDarkColors.AccentYellow},"hljs-class .hljs-title":{color:atomOneDarkColors.AccentYellow},"hljs-attr":{color:atomOneDarkColors.AccentYellow},"hljs-variable":{color:atomOneDarkColors.AccentYellow},"hljs-template-variable":{color:atomOneDarkColors.AccentYellow},"hljs-type":{color:atomOneDarkColors.AccentYellow},"hljs-selector-class":{color:atomOneDarkColors.AccentYellow},"hljs-selector-attr":{color:atomOneDarkColors.AccentYellow},"hljs-selector-pseudo":{color:atomOneDarkColors.AccentYellow},"hljs-number":{color:atomOneDarkColors.AccentYellow},"hljs-symbol":{color:atomOneDarkColors.AccentBlue},"hljs-bullet":{color:atomOneDarkColors.AccentBlue},"hljs-link":{color:atomOneDarkColors.AccentBlue,textDecoration:"underline"},"hljs-meta":{color:atomOneDarkColors.AccentBlue},"hljs-selector-id":{color:atomOneDarkColors.AccentBlue},"hljs-title":{color:atomOneDarkColors.AccentBlue},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}},atomOneDarkColors);init_esbuild_shims();var draculaColors={type:"dark",Background:"#282a36",Foreground:"#a3afb7",LightBlue:"#8be9fd",AccentBlue:"#8be9fd",AccentPurple:"#ff79c6",AccentCyan:"#8be9fd",AccentGreen:"#50fa7b",AccentYellow:"#fff783",AccentRed:"#ff5555",AccentYellowDim:"#8B7530",AccentRedDim:"#8B3A4A",DiffAdded:"#11431d",DiffRemoved:"#6e1818",Comment:"#6272a4",Gray:"#6272a4",GradientColors:["#ff79c6","#8be9fd"]};var Dracula=new Theme("Dracula","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:draculaColors.Background,color:draculaColors.Foreground},"hljs-keyword":{color:draculaColors.AccentBlue,fontWeight:"bold"},"hljs-selector-tag":{color:draculaColors.AccentBlue,fontWeight:"bold"},"hljs-literal":{color:draculaColors.AccentBlue,fontWeight:"bold"},"hljs-section":{color:draculaColors.AccentBlue,fontWeight:"bold"},"hljs-link":{color:draculaColors.AccentBlue},"hljs-function .hljs-keyword":{color:draculaColors.AccentPurple},"hljs-subst":{color:draculaColors.Foreground},"hljs-string":{color:draculaColors.AccentYellow},"hljs-title":{color:draculaColors.AccentYellow,fontWeight:"bold"},"hljs-name":{color:draculaColors.AccentYellow,fontWeight:"bold"},"hljs-type":{color:draculaColors.AccentYellow,fontWeight:"bold"},"hljs-attribute":{color:draculaColors.AccentYellow},"hljs-symbol":{color:draculaColors.AccentYellow},"hljs-bullet":{color:draculaColors.AccentYellow},"hljs-addition":{color:draculaColors.AccentGreen},"hljs-variable":{color:draculaColors.AccentYellow},"hljs-template-tag":{color:draculaColors.AccentYellow},"hljs-template-variable":{color:draculaColors.AccentYellow},"hljs-comment":{color:draculaColors.Comment},"hljs-quote":{color:draculaColors.Comment},"hljs-deletion":{color:draculaColors.AccentRed},"hljs-meta":{color:draculaColors.Comment},"hljs-doctag":{fontWeight:"bold"},"hljs-strong":{fontWeight:"bold"},"hljs-emphasis":{fontStyle:"italic"}},draculaColors);init_esbuild_shims();var githubDarkColors={type:"dark",Background:"#24292e",Foreground:"#c0c4c8",LightBlue:"#79B8FF",AccentBlue:"#79B8FF",AccentPurple:"#B392F0",AccentCyan:"#9ECBFF",AccentGreen:"#85E89D",AccentYellow:"#FFAB70",AccentRed:"#F97583",AccentYellowDim:"#8B7530",AccentRedDim:"#8B3A4A",DiffAdded:"#3C4636",DiffRemoved:"#502125",Comment:"#6A737D",Gray:"#6A737D",GradientColors:["#79B8FF","#85E89D"]};var GitHubDark=new Theme("GitHub","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",color:githubDarkColors.Foreground,background:githubDarkColors.Background},"hljs-comment":{color:githubDarkColors.Comment,fontStyle:"italic"},"hljs-quote":{color:githubDarkColors.Comment,fontStyle:"italic"},"hljs-keyword":{color:githubDarkColors.AccentRed,fontWeight:"bold"},"hljs-selector-tag":{color:githubDarkColors.AccentRed,fontWeight:"bold"},"hljs-subst":{color:githubDarkColors.Foreground},"hljs-number":{color:githubDarkColors.LightBlue},"hljs-literal":{color:githubDarkColors.LightBlue},"hljs-variable":{color:githubDarkColors.AccentYellow},"hljs-template-variable":{color:githubDarkColors.AccentYellow},"hljs-tag .hljs-attr":{color:githubDarkColors.AccentYellow},"hljs-string":{color:githubDarkColors.AccentCyan},"hljs-doctag":{color:githubDarkColors.AccentCyan},"hljs-title":{color:githubDarkColors.AccentPurple,fontWeight:"bold"},"hljs-section":{color:githubDarkColors.AccentPurple,fontWeight:"bold"},"hljs-selector-id":{color:githubDarkColors.AccentPurple,fontWeight:"bold"},"hljs-type":{color:githubDarkColors.AccentGreen,fontWeight:"bold"},"hljs-class .hljs-title":{color:githubDarkColors.AccentGreen,fontWeight:"bold"},"hljs-tag":{color:githubDarkColors.AccentGreen},"hljs-name":{color:githubDarkColors.AccentGreen},"hljs-attribute":{color:githubDarkColors.LightBlue},"hljs-regexp":{color:githubDarkColors.AccentCyan},"hljs-link":{color:githubDarkColors.AccentCyan},"hljs-symbol":{color:githubDarkColors.AccentPurple},"hljs-bullet":{color:githubDarkColors.AccentPurple},"hljs-built_in":{color:githubDarkColors.LightBlue},"hljs-builtin-name":{color:githubDarkColors.LightBlue},"hljs-meta":{color:githubDarkColors.LightBlue,fontWeight:"bold"},"hljs-deletion":{background:"#86181D",color:githubDarkColors.AccentRed},"hljs-addition":{background:"#144620",color:githubDarkColors.AccentGreen},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}},githubDarkColors);init_esbuild_shims();var githubLightColors={type:"light",Background:"#f8f8f8",Foreground:"#24292E",LightBlue:"#0086b3",AccentBlue:"#458",AccentPurple:"#900",AccentCyan:"#009926",AccentGreen:"#008080",AccentYellow:"#990073",AccentRed:"#d14",AccentYellowDim:"#8B7000",AccentRedDim:"#993333",DiffAdded:"#C6EAD8",DiffRemoved:"#FFCCCC",Comment:"#998",Gray:"#999",GradientColors:["#458","#008080"]};var GitHubLight=new Theme("GitHub Light","light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",color:githubLightColors.Foreground,background:githubLightColors.Background},"hljs-comment":{color:githubLightColors.Comment,fontStyle:"italic"},"hljs-quote":{color:githubLightColors.Comment,fontStyle:"italic"},"hljs-keyword":{color:githubLightColors.Foreground,fontWeight:"bold"},"hljs-selector-tag":{color:githubLightColors.Foreground,fontWeight:"bold"},"hljs-subst":{color:githubLightColors.Foreground,fontWeight:"normal"},"hljs-number":{color:githubLightColors.AccentGreen},"hljs-literal":{color:githubLightColors.AccentGreen},"hljs-variable":{color:githubLightColors.AccentGreen},"hljs-template-variable":{color:githubLightColors.AccentGreen},"hljs-tag .hljs-attr":{color:githubLightColors.AccentGreen},"hljs-string":{color:githubLightColors.AccentRed},"hljs-doctag":{color:githubLightColors.AccentRed},"hljs-title":{color:githubLightColors.AccentPurple,fontWeight:"bold"},"hljs-section":{color:githubLightColors.AccentPurple,fontWeight:"bold"},"hljs-selector-id":{color:githubLightColors.AccentPurple,fontWeight:"bold"},"hljs-type":{color:githubLightColors.AccentBlue,fontWeight:"bold"},"hljs-class .hljs-title":{color:githubLightColors.AccentBlue,fontWeight:"bold"},"hljs-tag":{color:githubLightColors.AccentBlue,fontWeight:"normal"},"hljs-name":{color:githubLightColors.AccentBlue,fontWeight:"normal"},"hljs-attribute":{color:githubLightColors.AccentBlue,fontWeight:"normal"},"hljs-regexp":{color:githubLightColors.AccentCyan},"hljs-link":{color:githubLightColors.AccentCyan},"hljs-symbol":{color:githubLightColors.AccentYellow},"hljs-bullet":{color:githubLightColors.AccentYellow},"hljs-built_in":{color:githubLightColors.LightBlue},"hljs-builtin-name":{color:githubLightColors.LightBlue},"hljs-meta":{color:githubLightColors.Gray,fontWeight:"bold"},"hljs-deletion":{background:"#fdd"},"hljs-addition":{background:"#dfd"},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}},githubLightColors);init_esbuild_shims();var googleCodeColors={type:"light",Background:"white",Foreground:"#444",LightBlue:"#066",AccentBlue:"#008",AccentPurple:"#606",AccentCyan:"#066",AccentGreen:"#080",AccentYellow:"#660",AccentRed:"#800",AccentYellowDim:"#8B7000",AccentRedDim:"#993333",DiffAdded:"#C6EAD8",DiffRemoved:"#FEDEDE",Comment:"#5f6368",Gray:lightTheme.Gray,GradientColors:["#066","#606"]};var GoogleCode=new Theme("Google Code","light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:googleCodeColors.Background,color:googleCodeColors.Foreground},"hljs-comment":{color:googleCodeColors.AccentRed},"hljs-quote":{color:googleCodeColors.AccentRed},"hljs-keyword":{color:googleCodeColors.AccentBlue},"hljs-selector-tag":{color:googleCodeColors.AccentBlue},"hljs-section":{color:googleCodeColors.AccentBlue},"hljs-title":{color:googleCodeColors.AccentPurple},"hljs-name":{color:googleCodeColors.AccentBlue},"hljs-variable":{color:googleCodeColors.AccentYellow},"hljs-template-variable":{color:googleCodeColors.AccentYellow},"hljs-string":{color:googleCodeColors.AccentGreen},"hljs-selector-attr":{color:googleCodeColors.AccentGreen},"hljs-selector-pseudo":{color:googleCodeColors.AccentGreen},"hljs-regexp":{color:googleCodeColors.AccentGreen},"hljs-literal":{color:googleCodeColors.AccentCyan},"hljs-symbol":{color:googleCodeColors.AccentCyan},"hljs-bullet":{color:googleCodeColors.AccentCyan},"hljs-meta":{color:googleCodeColors.AccentCyan},"hljs-number":{color:googleCodeColors.AccentCyan},"hljs-link":{color:googleCodeColors.AccentCyan},"hljs-doctag":{color:googleCodeColors.AccentPurple,fontWeight:"bold"},"hljs-type":{color:googleCodeColors.AccentPurple},"hljs-attr":{color:googleCodeColors.AccentPurple},"hljs-built_in":{color:googleCodeColors.AccentPurple},"hljs-builtin-name":{color:googleCodeColors.AccentPurple},"hljs-params":{color:googleCodeColors.AccentPurple},"hljs-attribute":{color:googleCodeColors.Foreground},"hljs-subst":{color:googleCodeColors.Foreground},"hljs-formula":{backgroundColor:"#eee",fontStyle:"italic"},"hljs-selector-id":{color:googleCodeColors.AccentYellow},"hljs-selector-class":{color:googleCodeColors.AccentYellow},"hljs-addition":{backgroundColor:"#baeeba"},"hljs-deletion":{backgroundColor:"#ffc8bd"},"hljs-strong":{fontWeight:"bold"},"hljs-emphasis":{fontStyle:"italic"}},googleCodeColors);init_esbuild_shims();var DefaultLight=new Theme(DEFAULT_LIGHT_THEME_NAME,"light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:lightTheme.Background,color:lightTheme.Foreground},"hljs-comment":{color:lightTheme.Comment},"hljs-quote":{color:lightTheme.Comment},"hljs-variable":{color:lightTheme.Foreground},"hljs-keyword":{color:lightTheme.AccentBlue},"hljs-selector-tag":{color:lightTheme.AccentBlue},"hljs-built_in":{color:lightTheme.AccentBlue},"hljs-name":{color:lightTheme.AccentBlue},"hljs-tag":{color:lightTheme.AccentBlue},"hljs-string":{color:lightTheme.AccentRed},"hljs-title":{color:lightTheme.AccentRed},"hljs-section":{color:lightTheme.AccentRed},"hljs-attribute":{color:lightTheme.AccentRed},"hljs-literal":{color:lightTheme.AccentRed},"hljs-template-tag":{color:lightTheme.AccentRed},"hljs-template-variable":{color:lightTheme.AccentRed},"hljs-type":{color:lightTheme.AccentRed},"hljs-addition":{color:lightTheme.AccentGreen},"hljs-deletion":{color:lightTheme.AccentRed},"hljs-selector-attr":{color:lightTheme.AccentCyan},"hljs-selector-pseudo":{color:lightTheme.AccentCyan},"hljs-meta":{color:lightTheme.AccentCyan},"hljs-doctag":{color:lightTheme.Gray},"hljs-attr":{color:lightTheme.AccentRed},"hljs-symbol":{color:lightTheme.AccentCyan},"hljs-bullet":{color:lightTheme.AccentCyan},"hljs-link":{color:lightTheme.AccentCyan},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"}},lightTheme);init_esbuild_shims();var DefaultDark=new Theme(DEFAULT_DARK_THEME_NAME,"dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:darkTheme.Background,color:darkTheme.Foreground},"hljs-keyword":{color:darkTheme.AccentBlue},"hljs-literal":{color:darkTheme.AccentBlue},"hljs-symbol":{color:darkTheme.AccentBlue},"hljs-name":{color:darkTheme.AccentBlue},"hljs-link":{color:darkTheme.AccentBlue,textDecoration:"underline"},"hljs-built_in":{color:darkTheme.AccentCyan},"hljs-type":{color:darkTheme.AccentCyan},"hljs-number":{color:darkTheme.AccentGreen},"hljs-class":{color:darkTheme.AccentGreen},"hljs-string":{color:darkTheme.AccentYellow},"hljs-meta-string":{color:darkTheme.AccentYellow},"hljs-regexp":{color:darkTheme.AccentRed},"hljs-template-tag":{color:darkTheme.AccentRed},"hljs-subst":{color:darkTheme.Foreground},"hljs-function":{color:darkTheme.Foreground},"hljs-title":{color:darkTheme.Foreground},"hljs-params":{color:darkTheme.Foreground},"hljs-formula":{color:darkTheme.Foreground},"hljs-comment":{color:darkTheme.Comment,fontStyle:"italic"},"hljs-quote":{color:darkTheme.Comment,fontStyle:"italic"},"hljs-doctag":{color:darkTheme.Comment},"hljs-meta":{color:darkTheme.Gray},"hljs-meta-keyword":{color:darkTheme.Gray},"hljs-tag":{color:darkTheme.Gray},"hljs-variable":{color:darkTheme.AccentPurple},"hljs-template-variable":{color:darkTheme.AccentPurple},"hljs-attr":{color:darkTheme.LightBlue},"hljs-attribute":{color:darkTheme.LightBlue},"hljs-builtin-name":{color:darkTheme.LightBlue},"hljs-section":{color:darkTheme.AccentYellow},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"},"hljs-bullet":{color:darkTheme.AccentYellow},"hljs-selector-tag":{color:darkTheme.AccentYellow},"hljs-selector-id":{color:darkTheme.AccentYellow},"hljs-selector-class":{color:darkTheme.AccentYellow},"hljs-selector-attr":{color:darkTheme.AccentYellow},"hljs-selector-pseudo":{color:darkTheme.AccentYellow},"hljs-addition":{backgroundColor:"#144212",display:"inline-block",width:"100%"},"hljs-deletion":{backgroundColor:"#600",display:"inline-block",width:"100%"}},darkTheme);init_esbuild_shims();var shadesOfPurpleColors={type:"dark",Background:"#2d2b57",Foreground:"#e3dfff",LightBlue:"#847ace",AccentBlue:"#a599e9",AccentPurple:"#ac65ff",AccentCyan:"#a1feff",AccentGreen:"#A5FF90",AccentYellow:"#fad000",AccentRed:"#ff628c",AccentYellowDim:"#8B7530",AccentRedDim:"#8B3A4A",DiffAdded:"#383E45",DiffRemoved:"#572244",Comment:"#B362FF",Gray:"#726c86",GradientColors:["#4d21fc","#847ace","#ff628c"]};var additionalColors={AccentYellowAlt:"#f8d000",AccentOrange:"#fb9e00",AccentPink:"#fa658d",AccentLightPurple:"#c991ff",AccentDarkPurple:"#6943ff",AccentTeal:"#2ee2fa"};var ShadesOfPurple=new Theme("Shades Of Purple","dark",{hljs:{display:"block",overflowX:"auto",background:shadesOfPurpleColors.Background,color:shadesOfPurpleColors.Foreground},"hljs-title":{color:shadesOfPurpleColors.AccentYellow,fontWeight:"normal"},"hljs-name":{color:shadesOfPurpleColors.AccentCyan,fontWeight:"normal"},"hljs-tag":{color:shadesOfPurpleColors.Foreground},"hljs-attr":{color:additionalColors.AccentYellowAlt,fontStyle:"italic"},"hljs-built_in":{color:additionalColors.AccentOrange},"hljs-selector-tag":{color:additionalColors.AccentOrange,fontWeight:"normal"},"hljs-section":{color:additionalColors.AccentOrange},"hljs-keyword":{color:additionalColors.AccentOrange,fontWeight:"normal"},"hljs-subst":{color:shadesOfPurpleColors.Foreground},"hljs-string":{color:shadesOfPurpleColors.AccentGreen},"hljs-attribute":{color:shadesOfPurpleColors.AccentGreen},"hljs-symbol":{color:shadesOfPurpleColors.AccentGreen},"hljs-bullet":{color:shadesOfPurpleColors.AccentGreen},"hljs-addition":{color:shadesOfPurpleColors.AccentGreen},"hljs-code":{color:shadesOfPurpleColors.AccentGreen},"hljs-regexp":{color:shadesOfPurpleColors.AccentGreen},"hljs-selector-class":{color:shadesOfPurpleColors.AccentGreen},"hljs-selector-attr":{color:shadesOfPurpleColors.AccentGreen},"hljs-selector-pseudo":{color:shadesOfPurpleColors.AccentGreen},"hljs-template-tag":{color:shadesOfPurpleColors.AccentGreen},"hljs-quote":{color:shadesOfPurpleColors.AccentGreen},"hljs-deletion":{color:shadesOfPurpleColors.AccentRed},"hljs-meta":{color:additionalColors.AccentOrange},"hljs-meta-string":{color:additionalColors.AccentOrange},"hljs-comment":{color:shadesOfPurpleColors.AccentPurple},"hljs-literal":{color:additionalColors.AccentPink,fontWeight:"normal"},"hljs-number":{color:additionalColors.AccentPink},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"},"hljs-diff":{color:shadesOfPurpleColors.Foreground},"hljs-meta.hljs-diff":{color:shadesOfPurpleColors.AccentBlue},"hljs-ln":{color:shadesOfPurpleColors.Gray},"hljs-type":{color:shadesOfPurpleColors.AccentYellow,fontWeight:"normal"},"hljs-variable":{color:shadesOfPurpleColors.AccentYellow},"hljs-template-variable":{color:shadesOfPurpleColors.AccentGreen},"hljs-function .hljs-keyword":{color:additionalColors.AccentOrange},"hljs-link":{color:shadesOfPurpleColors.LightBlue},"hljs-doctag":{fontWeight:"bold"},"hljs-params":{color:additionalColors.AccentLightPurple,fontStyle:"italic"},"hljs-class":{color:shadesOfPurpleColors.AccentCyan,fontWeight:"bold"},"hljs-function":{color:shadesOfPurpleColors.AccentCyan},"hljs-property":{color:shadesOfPurpleColors.AccentBlue},"hljs-operator":{color:additionalColors.AccentDarkPurple},"hljs-punctuation":{color:shadesOfPurpleColors.Gray},"hljs-selector-id":{color:shadesOfPurpleColors.AccentYellow,fontWeight:"bold"},"hljs-char":{color:shadesOfPurpleColors.AccentGreen},"hljs-escape":{color:additionalColors.AccentPink,fontWeight:"bold"},"hljs-meta-keyword":{color:additionalColors.AccentOrange,fontWeight:"bold"},"hljs-builtin-name":{color:additionalColors.AccentTeal},"hljs-module":{color:shadesOfPurpleColors.AccentCyan},"hljs-namespace":{color:shadesOfPurpleColors.LightBlue},"hljs-important":{color:shadesOfPurpleColors.AccentRed,fontWeight:"bold"},"hljs-formula":{color:shadesOfPurpleColors.AccentCyan,fontStyle:"italic"},"hljs-decorator":{color:additionalColors.AccentTeal,fontWeight:"bold"},"hljs-symbol.ruby":{color:additionalColors.AccentPink},"hljs-keyword.sql":{color:additionalColors.AccentOrange,textTransform:"uppercase"},"hljs-section.markdown":{color:shadesOfPurpleColors.AccentYellow,fontWeight:"bold"},"hljs-attr.json":{color:shadesOfPurpleColors.AccentCyan},"hljs-tag .hljs-name":{color:shadesOfPurpleColors.AccentRed},"hljs-tag .hljs-attr":{color:additionalColors.AccentYellowAlt},"hljs.hljs-line-numbers":{borderRight:`1px solid ${shadesOfPurpleColors.Gray}`},"hljs.hljs-line-numbers .hljs-ln-numbers":{color:shadesOfPurpleColors.Gray,paddingRight:"1em"},"hljs.hljs-line-numbers .hljs-ln-code":{paddingLeft:"1em"},"hljs::selection":{background:shadesOfPurpleColors.AccentBlue+"40"},"hljs ::-moz-selection":{background:shadesOfPurpleColors.AccentBlue+"40"},"hljs .hljs-highlight":{background:shadesOfPurpleColors.AccentPurple+"20",display:"block",width:"100%"}},shadesOfPurpleColors);init_esbuild_shims();var xcodeColors={type:"light",Background:"#fff",Foreground:"#444",LightBlue:"#0E0EFF",AccentBlue:"#1c00cf",AccentPurple:"#aa0d91",AccentCyan:"#3F6E74",AccentGreen:"#007400",AccentYellow:"#836C28",AccentRed:"#c41a16",AccentYellowDim:"#8B7000",AccentRedDim:"#993333",DiffAdded:"#C6EAD8",DiffRemoved:"#FEDEDE",Comment:"#007400",Gray:"#c0c0c0",GradientColors:["#1c00cf","#007400"]};var XCode=new Theme("Xcode","light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:xcodeColors.Background,color:xcodeColors.Foreground},"xml .hljs-meta":{color:xcodeColors.Gray},"hljs-comment":{color:xcodeColors.Comment},"hljs-quote":{color:xcodeColors.Comment},"hljs-tag":{color:xcodeColors.AccentPurple},"hljs-attribute":{color:xcodeColors.AccentPurple},"hljs-keyword":{color:xcodeColors.AccentPurple},"hljs-selector-tag":{color:xcodeColors.AccentPurple},"hljs-literal":{color:xcodeColors.AccentPurple},"hljs-name":{color:xcodeColors.AccentPurple},"hljs-variable":{color:xcodeColors.AccentCyan},"hljs-template-variable":{color:xcodeColors.AccentCyan},"hljs-code":{color:xcodeColors.AccentRed},"hljs-string":{color:xcodeColors.AccentRed},"hljs-meta-string":{color:xcodeColors.AccentRed},"hljs-regexp":{color:xcodeColors.LightBlue},"hljs-link":{color:xcodeColors.LightBlue},"hljs-title":{color:xcodeColors.AccentBlue},"hljs-symbol":{color:xcodeColors.AccentBlue},"hljs-bullet":{color:xcodeColors.AccentBlue},"hljs-number":{color:xcodeColors.AccentBlue},"hljs-section":{color:xcodeColors.AccentYellow},"hljs-meta":{color:xcodeColors.AccentYellow},"hljs-class .hljs-title":{color:xcodeColors.AccentPurple},"hljs-type":{color:xcodeColors.AccentPurple},"hljs-built_in":{color:xcodeColors.AccentPurple},"hljs-builtin-name":{color:xcodeColors.AccentPurple},"hljs-params":{color:xcodeColors.AccentPurple},"hljs-attr":{color:xcodeColors.AccentYellow},"hljs-subst":{color:xcodeColors.Foreground},"hljs-formula":{backgroundColor:"#eee",fontStyle:"italic"},"hljs-addition":{backgroundColor:"#baeeba"},"hljs-deletion":{backgroundColor:"#ffc8bd"},"hljs-selector-id":{color:xcodeColors.AccentYellow},"hljs-selector-class":{color:xcodeColors.AccentYellow},"hljs-doctag":{fontWeight:"bold"},"hljs-strong":{fontWeight:"bold"},"hljs-emphasis":{fontStyle:"italic"}},xcodeColors);init_esbuild_shims();init_esbuild_shims();var lightSemanticColors={text:{primary:lightTheme.Foreground,secondary:lightTheme.Gray,link:lightTheme.AccentBlue,accent:lightTheme.AccentPurple,code:lightTheme.LightBlue},background:{primary:lightTheme.Background,diff:{added:lightTheme.DiffAdded,removed:lightTheme.DiffRemoved}},border:{default:lightTheme.Gray,focused:lightTheme.AccentBlue},ui:{comment:lightTheme.Comment,symbol:lightTheme.Gray,gradient:lightTheme.GradientColors},status:{error:lightTheme.AccentRed,success:lightTheme.AccentGreen,warning:lightTheme.AccentYellow,errorDim:lightTheme.AccentRedDim,warningDim:lightTheme.AccentYellowDim}};var darkSemanticColors={text:{primary:darkTheme.Foreground,secondary:darkTheme.Gray,link:darkTheme.AccentBlue,accent:darkTheme.AccentPurple,code:darkTheme.LightBlue},background:{primary:darkTheme.Background,diff:{added:darkTheme.DiffAdded,removed:darkTheme.DiffRemoved}},border:{default:darkTheme.Gray,focused:darkTheme.AccentBlue},ui:{comment:darkTheme.Comment,symbol:darkTheme.Gray,gradient:darkTheme.GradientColors},status:{error:darkTheme.AccentRed,success:darkTheme.AccentGreen,warning:darkTheme.AccentYellow,errorDim:darkTheme.AccentRedDim,warningDim:darkTheme.AccentYellowDim}};var ansiSemanticColors={text:{primary:ansiTheme.Foreground,secondary:ansiTheme.Gray,link:ansiTheme.AccentBlue,accent:ansiTheme.AccentPurple,code:ansiTheme.LightBlue},background:{primary:ansiTheme.Background,diff:{added:ansiTheme.DiffAdded,removed:ansiTheme.DiffRemoved}},border:{default:ansiTheme.Gray,focused:ansiTheme.AccentBlue},ui:{comment:ansiTheme.Comment,symbol:ansiTheme.Gray,gradient:ansiTheme.GradientColors},status:{error:ansiTheme.AccentRed,success:ansiTheme.AccentGreen,warning:ansiTheme.AccentYellow,errorDim:ansiTheme.AccentRedDim,warningDim:ansiTheme.AccentYellowDim}};var qwenLightColors={...lightTheme,type:"light"};var QwenLight=new Theme("Qwen Light","light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:qwenLightColors.Background,color:qwenLightColors.Foreground},"hljs-comment":{color:qwenLightColors.Comment,fontStyle:"italic"},"hljs-quote":{color:qwenLightColors.AccentCyan,fontStyle:"italic"},"hljs-string":{color:qwenLightColors.AccentGreen},"hljs-constant":{color:qwenLightColors.AccentCyan},"hljs-number":{color:qwenLightColors.AccentPurple},"hljs-keyword":{color:qwenLightColors.AccentYellow},"hljs-selector-tag":{color:qwenLightColors.AccentYellow},"hljs-attribute":{color:qwenLightColors.AccentYellow},"hljs-variable":{color:qwenLightColors.Foreground},"hljs-variable.language":{color:qwenLightColors.LightBlue,fontStyle:"italic"},"hljs-title":{color:qwenLightColors.AccentBlue},"hljs-section":{color:qwenLightColors.AccentGreen,fontWeight:"bold"},"hljs-type":{color:qwenLightColors.LightBlue},"hljs-class .hljs-title":{color:qwenLightColors.AccentBlue},"hljs-tag":{color:qwenLightColors.LightBlue},"hljs-name":{color:qwenLightColors.AccentBlue},"hljs-builtin-name":{color:qwenLightColors.AccentYellow},"hljs-meta":{color:qwenLightColors.AccentYellow},"hljs-symbol":{color:qwenLightColors.AccentRed},"hljs-bullet":{color:qwenLightColors.AccentYellow},"hljs-regexp":{color:qwenLightColors.AccentCyan},"hljs-link":{color:qwenLightColors.LightBlue},"hljs-deletion":{color:qwenLightColors.AccentRed},"hljs-addition":{color:qwenLightColors.AccentGreen},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"},"hljs-literal":{color:qwenLightColors.AccentCyan},"hljs-built_in":{color:qwenLightColors.AccentRed},"hljs-doctag":{color:qwenLightColors.AccentRed},"hljs-template-variable":{color:qwenLightColors.AccentCyan},"hljs-selector-id":{color:qwenLightColors.AccentRed}},qwenLightColors,lightSemanticColors);init_esbuild_shims();var qwenDarkColors={...darkTheme,type:"dark"};var QwenDark=new Theme("Qwen Dark","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:qwenDarkColors.Background,color:qwenDarkColors.Foreground},"hljs-keyword":{color:qwenDarkColors.AccentYellow},"hljs-literal":{color:qwenDarkColors.AccentPurple},"hljs-symbol":{color:qwenDarkColors.AccentCyan},"hljs-name":{color:qwenDarkColors.LightBlue},"hljs-link":{color:qwenDarkColors.AccentBlue},"hljs-function .hljs-keyword":{color:qwenDarkColors.AccentYellow},"hljs-subst":{color:qwenDarkColors.Foreground},"hljs-string":{color:qwenDarkColors.AccentGreen},"hljs-title":{color:qwenDarkColors.AccentYellow},"hljs-type":{color:qwenDarkColors.AccentBlue},"hljs-attribute":{color:qwenDarkColors.AccentYellow},"hljs-bullet":{color:qwenDarkColors.AccentYellow},"hljs-addition":{color:qwenDarkColors.AccentGreen},"hljs-variable":{color:qwenDarkColors.Foreground},"hljs-template-tag":{color:qwenDarkColors.AccentYellow},"hljs-template-variable":{color:qwenDarkColors.AccentYellow},"hljs-comment":{color:qwenDarkColors.Comment,fontStyle:"italic"},"hljs-quote":{color:qwenDarkColors.AccentCyan,fontStyle:"italic"},"hljs-deletion":{color:qwenDarkColors.AccentRed},"hljs-meta":{color:qwenDarkColors.AccentYellow},"hljs-doctag":{fontWeight:"bold"},"hljs-strong":{fontWeight:"bold"},"hljs-emphasis":{fontStyle:"italic"}},qwenDarkColors,darkSemanticColors);import*as fs from"node:fs";import*as path from"node:path";import*as os from"node:os";init_esbuild_shims();var ansiColors={type:"dark",Background:"black",Foreground:"white",LightBlue:"bluebright",AccentBlue:"blue",AccentPurple:"magenta",AccentCyan:"cyan",AccentGreen:"green",AccentYellow:"yellow",AccentRed:"red",AccentYellowDim:"yellow",AccentRedDim:"red",DiffAdded:"#003300",DiffRemoved:"#4D0000",Comment:"gray",Gray:"gray",GradientColors:["cyan","green"]};var ANSI=new Theme("ANSI","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:"black",color:"white"},"hljs-keyword":{color:"blue"},"hljs-literal":{color:"blue"},"hljs-symbol":{color:"blue"},"hljs-name":{color:"blue"},"hljs-link":{color:"blue"},"hljs-built_in":{color:"cyan"},"hljs-type":{color:"cyan"},"hljs-number":{color:"green"},"hljs-class":{color:"green"},"hljs-string":{color:"yellow"},"hljs-meta-string":{color:"yellow"},"hljs-regexp":{color:"red"},"hljs-template-tag":{color:"red"},"hljs-subst":{color:"white"},"hljs-function":{color:"white"},"hljs-title":{color:"white"},"hljs-params":{color:"white"},"hljs-formula":{color:"white"},"hljs-comment":{color:"green"},"hljs-quote":{color:"green"},"hljs-doctag":{color:"green"},"hljs-meta":{color:"gray"},"hljs-meta-keyword":{color:"gray"},"hljs-tag":{color:"gray"},"hljs-variable":{color:"magenta"},"hljs-template-variable":{color:"magenta"},"hljs-attr":{color:"bluebright"},"hljs-attribute":{color:"bluebright"},"hljs-builtin-name":{color:"bluebright"},"hljs-section":{color:"yellow"},"hljs-emphasis":{},"hljs-strong":{},"hljs-bullet":{color:"yellow"},"hljs-selector-tag":{color:"yellow"},"hljs-selector-id":{color:"yellow"},"hljs-selector-class":{color:"yellow"},"hljs-selector-attr":{color:"yellow"},"hljs-selector-pseudo":{color:"yellow"}},ansiColors,darkSemanticColors);init_esbuild_shims();var ansiLightColors={type:"light",Background:"white",Foreground:"#444",LightBlue:"blue",AccentBlue:"blue",AccentPurple:"purple",AccentCyan:"cyan",AccentGreen:"green",AccentYellow:"orange",AccentRed:"red",AccentYellowDim:"orange",AccentRedDim:"red",DiffAdded:"#E5F2E5",DiffRemoved:"#FFE5E5",Comment:"gray",Gray:"gray",GradientColors:["blue","green"]};var ANSILight=new Theme("ANSI Light","light",{hljs:{display:"block",overflowX:"auto",padding:"0.5em",background:"white",color:"black"},"hljs-keyword":{color:"blue"},"hljs-literal":{color:"blue"},"hljs-symbol":{color:"blue"},"hljs-name":{color:"blue"},"hljs-link":{color:"blue"},"hljs-built_in":{color:"cyan"},"hljs-type":{color:"cyan"},"hljs-number":{color:"green"},"hljs-class":{color:"green"},"hljs-string":{color:"red"},"hljs-meta-string":{color:"red"},"hljs-regexp":{color:"magenta"},"hljs-template-tag":{color:"magenta"},"hljs-subst":{color:"black"},"hljs-function":{color:"black"},"hljs-title":{color:"black"},"hljs-params":{color:"black"},"hljs-formula":{color:"black"},"hljs-comment":{color:"gray"},"hljs-quote":{color:"gray"},"hljs-doctag":{color:"gray"},"hljs-meta":{color:"gray"},"hljs-meta-keyword":{color:"gray"},"hljs-tag":{color:"gray"},"hljs-variable":{color:"purple"},"hljs-template-variable":{color:"purple"},"hljs-attr":{color:"blue"},"hljs-attribute":{color:"blue"},"hljs-builtin-name":{color:"blue"},"hljs-section":{color:"orange"},"hljs-bullet":{color:"orange"},"hljs-selector-tag":{color:"orange"},"hljs-selector-id":{color:"orange"},"hljs-selector-class":{color:"orange"},"hljs-selector-attr":{color:"orange"},"hljs-selector-pseudo":{color:"orange"}},ansiLightColors,lightSemanticColors);init_esbuild_shims();var noColorColorsTheme={type:"ansi",Background:"",Foreground:"",LightBlue:"",AccentBlue:"",AccentPurple:"",AccentCyan:"",AccentGreen:"",AccentYellow:"",AccentRed:"",AccentYellowDim:"",AccentRedDim:"",DiffAdded:"",DiffRemoved:"",Comment:"",Gray:""};var noColorSemanticColors={text:{primary:"",secondary:"",link:"",accent:"",code:""},background:{primary:"",diff:{added:"",removed:""}},border:{default:"",focused:""},ui:{comment:"",symbol:"",gradient:[]},status:{error:"",success:"",warning:"",errorDim:"",warningDim:""}};var NoColorTheme=new Theme("NoColor","dark",{hljs:{display:"block",overflowX:"auto",padding:"0.5em"},"hljs-keyword":{},"hljs-literal":{},"hljs-symbol":{},"hljs-name":{},"hljs-link":{textDecoration:"underline"},"hljs-built_in":{},"hljs-type":{},"hljs-number":{},"hljs-class":{},"hljs-string":{},"hljs-meta-string":{},"hljs-regexp":{},"hljs-template-tag":{},"hljs-subst":{},"hljs-function":{},"hljs-title":{},"hljs-params":{},"hljs-formula":{},"hljs-comment":{fontStyle:"italic"},"hljs-quote":{fontStyle:"italic"},"hljs-doctag":{},"hljs-meta":{},"hljs-meta-keyword":{},"hljs-tag":{},"hljs-variable":{},"hljs-template-variable":{},"hljs-attr":{},"hljs-attribute":{},"hljs-builtin-name":{},"hljs-section":{},"hljs-emphasis":{fontStyle:"italic"},"hljs-strong":{fontWeight:"bold"},"hljs-bullet":{},"hljs-selector-tag":{},"hljs-selector-id":{},"hljs-selector-class":{},"hljs-selector-attr":{},"hljs-selector-pseudo":{},"hljs-addition":{display:"inline-block",width:"100%"},"hljs-deletion":{display:"inline-block",width:"100%"}},noColorColorsTheme,noColorSemanticColors);import process2 from"node:process";init_esbuild_shims();import{execSync}from"node:child_process";import process from"node:process";var debugLogger2=createDebugLogger("THEME_DETECT");var OSC11_TIMEOUT_MS=200;function hexComponent(hex){const max=16**hex.length-1;return parseInt(hex,16)/max}__name(hexComponent,"hexComponent");function parseOscRgb(data){const rgbMatch=/^rgba?:([0-9a-f]{1,4})\/([0-9a-f]{1,4})\/([0-9a-f]{1,4})$/i.exec(data);if(rgbMatch){return{r:hexComponent(rgbMatch[1]),g:hexComponent(rgbMatch[2]),b:hexComponent(rgbMatch[3])}}const hashMatch=/^#([0-9a-f]+)$/i.exec(data);if(hashMatch&&hashMatch[1].length%3===0){const hex=hashMatch[1];const n=hex.length/3;return{r:hexComponent(hex.slice(0,n)),g:hexComponent(hex.slice(n,2*n)),b:hexComponent(hex.slice(2*n))}}return void 0}__name(parseOscRgb,"parseOscRgb");function themeFromOscColor(data){const rgb=parseOscRgb(data);if(!rgb)return void 0;const luminance=.2126*rgb.r+.7152*rgb.g+.0722*rgb.b;return luminance>.5?"light":"dark"}__name(themeFromOscColor,"themeFromOscColor");function detectOsc11Theme(){if(!process.stdin.isTTY||!process.stdout.isTTY){return Promise.resolve(void 0)}return new Promise(resolve2=>{const stdin=process.stdin;let resolved=false;let buffer="";const finish=__name(result=>{if(resolved)return;resolved=true;clearTimeout(timer);stdin.removeListener("data",onData);resolve2(result)},"finish");const timer=setTimeout(()=>finish(void 0),OSC11_TIMEOUT_MS);const onData=__name(data=>{buffer+=data.toString();const match=/\x1b\]11;(.*?)(?:\x07|\x1b\\)/.exec(buffer);if(match){finish(themeFromOscColor(match[1]))}},"onData");stdin.on("data",onData);process.stdout.write("\x1B]11;?\x07")})}__name(detectOsc11Theme,"detectOsc11Theme");function detectMacOSTheme(){if(process.platform!=="darwin"){return void 0}try{const result=execSync("defaults read -g AppleInterfaceStyle",{encoding:"utf-8",timeout:3e3,stdio:["pipe","pipe","pipe"]}).trim();return result.toLowerCase()==="dark"?"dark":"light"}catch(error){const err=error;const stderr=typeof err.stderr==="string"?err.stderr:err.stderr?.toString?.()??"";const message=err.message??"";if(/does not exist/i.test(stderr)||/does not exist/i.test(message)){return"light"}return void 0}}__name(detectMacOSTheme,"detectMacOSTheme");function detectFromColorFgBg(){const colorFgBg=process.env["COLORFGBG"];if(!colorFgBg){return void 0}const parts=colorFgBg.split(";");const bgStr=parts[parts.length-1];if(bgStr===void 0){return void 0}const bg=parseInt(bgStr,10);if(isNaN(bg)){return void 0}if(bg===7||bg>=9&&bg<=15){return"light"}return"dark"}__name(detectFromColorFgBg,"detectFromColorFgBg");function detectTerminalTheme(){const colorFgBgResult=detectFromColorFgBg();if(colorFgBgResult){debugLogger2.info(`Detected theme from COLORFGBG: ${colorFgBgResult}`);return colorFgBgResult}const macResult=detectMacOSTheme();if(macResult){debugLogger2.info(`Detected theme from macOS system appearance: ${macResult}`);return macResult}debugLogger2.info("Could not detect terminal theme, defaulting to dark");return"dark"}__name(detectTerminalTheme,"detectTerminalTheme");async function detectTerminalThemeAsync(){const colorFgBgResult=detectFromColorFgBg();if(colorFgBgResult){debugLogger2.info(`Detected theme from COLORFGBG (async path): ${colorFgBgResult}`);return colorFgBgResult}const osc11Result=await detectOsc11Theme();if(osc11Result){debugLogger2.info(`Detected theme from OSC 11 background query: ${osc11Result}`);return osc11Result}const macResult=detectMacOSTheme();if(macResult){debugLogger2.info(`Detected theme from macOS system appearance: ${macResult}`);return macResult}debugLogger2.info("Could not detect terminal theme, defaulting to dark");return"dark"}__name(detectTerminalThemeAsync,"detectTerminalThemeAsync");var debugLogger3=createDebugLogger("THEME_MANAGER");var DEFAULT_THEME=QwenDark;var AUTO_THEME_NAME="auto";function isPathWithinDirectory(parent,child){const relativePath=path.relative(parent,child);return relativePath===""||!relativePath.startsWith(`..${path.sep}`)&&relativePath!==".."&&!path.isAbsolute(relativePath)}__name(isPathWithinDirectory,"isPathWithinDirectory");var ThemeManager=class{static{__name(this,"ThemeManager")}availableThemes;activeTheme;customThemes=new Map;constructor(){this.availableThemes=[AyuDark,AyuLight,AtomOneDark,Dracula,DefaultLight,DefaultDark,GitHubDark,GitHubLight,GoogleCode,QwenLight,QwenDark,ShadesOfPurple,XCode,ANSI,ANSILight];this.activeTheme=DEFAULT_THEME}loadCustomThemes(customThemesSettings){this.customThemes.clear();if(!customThemesSettings){return}for(const[name,customThemeConfig]of Object.entries(customThemesSettings)){const validation=validateCustomTheme(customThemeConfig);if(validation.isValid){if(validation.warning){debugLogger3.warn(`Theme "${name}": ${validation.warning}`)}const themeWithDefaults={...DEFAULT_THEME.colors,...customThemeConfig,name:customThemeConfig.name||name,type:"custom"};try{const theme=createCustomTheme(themeWithDefaults);this.customThemes.set(name,theme)}catch(error){debugLogger3.warn(`Failed to load custom theme "${name}":`,error)}}else{debugLogger3.warn(`Invalid custom theme "${name}": ${validation.error}`)}}if(this.activeTheme&&this.activeTheme.type==="custom"&&this.customThemes.has(this.activeTheme.name)){this.activeTheme=this.customThemes.get(this.activeTheme.name)}}setActiveTheme(themeName){if(themeName===AUTO_THEME_NAME){this.activeTheme=this.resolveAutoTheme();debugLogger3.info(`Auto-detected theme: ${this.activeTheme.name}`);return true}const theme=this.findThemeByName(themeName);if(!theme){return false}this.activeTheme=theme;return true}cachedAutoDetection;terminalBackground;resolveAutoTheme(){const detected=this.cachedAutoDetection??detectTerminalTheme();return detected==="light"?QwenLight:QwenDark}async resolveAutoThemeAsync(){const detected=await detectTerminalThemeAsync();this.cachedAutoDetection=detected;this.activeTheme=detected==="light"?QwenLight:QwenDark;debugLogger3.info(`Auto-detected theme (async): ${this.activeTheme.name}`)}getTerminalBackgroundType(){if(this.cachedAutoDetection){return this.cachedAutoDetection}this.terminalBackground??=detectTerminalTheme();return this.terminalBackground}getActiveTheme(){if(process2.env["NO_COLOR"]){return NoColorTheme}if(this.activeTheme){const isBuiltIn=this.availableThemes.some(t=>t.name===this.activeTheme.name);const isCustom=[...this.customThemes.values()].includes(this.activeTheme);if(isBuiltIn||isCustom){return this.activeTheme}}this.activeTheme=DEFAULT_THEME;return this.activeTheme}getSemanticColors(){return this.getActiveTheme().semanticColors}getCustomThemeNames(){return Array.from(this.customThemes.keys())}isCustomTheme(themeName){return this.customThemes.has(themeName)}getAvailableThemes(){const builtInThemes=this.availableThemes.map(theme=>({name:theme.name,type:theme.type,isCustom:false}));const customThemes=Array.from(this.customThemes.values()).map(theme=>({name:theme.name,type:theme.type,isCustom:true}));const qwenThemes=builtInThemes.filter(theme=>theme.name===QwenLight.name||theme.name===QwenDark.name);const otherBuiltInThemes=builtInThemes.filter(theme=>theme.name!==QwenLight.name&&theme.name!==QwenDark.name);const sortedOtherThemes=[...otherBuiltInThemes,...customThemes].sort((a,b)=>{const typeOrder=__name(type=>{switch(type){case"dark":return 1;case"light":return 2;case"ansi":return 3;case"custom":return 4;default:return 5}},"typeOrder");const typeComparison=typeOrder(a.type)-typeOrder(b.type);if(typeComparison!==0){return typeComparison}return a.name.localeCompare(b.name)});return[...qwenThemes,...sortedOtherThemes]}getTheme(themeName){return this.findThemeByName(themeName)}isPath(themeName){return themeName.endsWith(".json")||themeName.startsWith(".")||path.isAbsolute(themeName)}loadThemeFromFile(themePath){try{const canonicalPath=fs.realpathSync(path.resolve(themePath));if(this.customThemes.has(canonicalPath)){return this.customThemes.get(canonicalPath)}const homeDir=path.resolve(os.homedir());if(!isPathWithinDirectory(homeDir,canonicalPath)){debugLogger3.warn(`Theme file at "${themePath}" is outside your home directory. Only load themes from trusted sources.`);return void 0}const themeContent=fs.readFileSync(canonicalPath,"utf-8");const customThemeConfig=JSON.parse(themeContent);const validation=validateCustomTheme(customThemeConfig);if(!validation.isValid){debugLogger3.warn(`Invalid custom theme from file "${themePath}": ${validation.error}`);return void 0}if(validation.warning){debugLogger3.warn(`Theme from "${themePath}": ${validation.warning}`)}const themeWithDefaults={...DEFAULT_THEME.colors,...customThemeConfig,name:customThemeConfig.name||canonicalPath,type:"custom"};const theme=createCustomTheme(themeWithDefaults);this.customThemes.set(canonicalPath,theme);return theme}catch(error){if(!(error instanceof Error&&"code"in error&&error.code==="ENOENT")){debugLogger3.warn(`Could not load theme from file "${themePath}":`,error)}return void 0}}findThemeByName(themeName){if(!themeName){return DEFAULT_THEME}const builtInTheme=this.availableThemes.find(theme=>theme.name===themeName);if(builtInTheme){return builtInTheme}if(this.isPath(themeName)){return this.loadThemeFromFile(themeName)}if(this.customThemes.has(themeName)){return this.customThemes.get(themeName)}return void 0}};var themeManager=new ThemeManager;export{resolveColor,toHex,DEFAULT_THEME,AUTO_THEME_NAME,themeManager};
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2025 Google LLC
@@ -1,7 +1,7 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
3
  import{remarkParse,unified}from"./chunk-AZ3CKMCT.js";import{estimateTextTokens}from"./chunk-RP57XAJ2.js";import{ignoreBrokenPipe}from"./chunk-M4ECEHLX.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import{homedir}from"node:os";import path2 from"node:path";import*as fs2 from"node:fs/promises";init_esbuild_shims();init_esbuild_shims();var MEMORY_IMPORT_BUDGET={maxCalls:32,maxReservedTokens:512e3,batchSections:8,sourceBytes:65536,contextBytes:32768,outputTokens:8192,promptBytes:32768};function packMemoryImportSections(sections){const groups=new Map;for(const section of[...sections].sort((a,b)=>a.id.localeCompare(b.id))){const key=`${section.scope??""}:${section.groupId}`;const group=groups.get(key)??[];group.push(section);groups.set(key,group)}const batches=[];for(const group of groups.values()){let batch=[];let bytes=0;for(const section of group){const size=Buffer.byteLength(section.content);if(batch.length&&(batch.length===MEMORY_IMPORT_BUDGET.batchSections||bytes+size>MEMORY_IMPORT_BUDGET.sourceBytes)){batches.push(batch);batch=[];bytes=0}batch.push(section);bytes+=size}if(batch.length)batches.push(batch)}return batches}__name(packMemoryImportSections,"packMemoryImportSections");function estimateMemoryImport(sections){const batches=packMemoryImportSections(sections);const modelCalls=batches.length*2;const sourceTokens=sections.reduce((n,section)=>n+estimateTextTokens(section.content),0);const sourceBytes=Buffer.byteLength(JSON.stringify(sections.map(({id,content})=>({id,content}))));const reservedTokens=modelCalls*(MEMORY_IMPORT_BUDGET.contextBytes+MEMORY_IMPORT_BUDGET.promptBytes+MEMORY_IMPORT_BUDGET.outputTokens+1024)+sourceBytes+modelCalls;return{basis:"source-only-with-context-reserve",modelCalls,sourceTokens,maxOutputTokens:modelCalls*MEMORY_IMPORT_BUDGET.outputTokens,reservedTokens,exceedsBudget:modelCalls>MEMORY_IMPORT_BUDGET.maxCalls||reservedTokens>MEMORY_IMPORT_BUDGET.maxReservedTokens,limits:MEMORY_IMPORT_BUDGET}}__name(estimateMemoryImport,"estimateMemoryImport");import{createHash}from"node:crypto";import*as fs from"node:fs/promises";import path from"node:path";import{constants}from"node:fs";var MemoryImportRequestError=class extends Error{static{__name(this,"MemoryImportRequestError")}};var IMPORT_LIMITS={files:256,fileBytes:512*1024,totalBytes:8*1024*1024,sectionBytes:64*1024,headings:4096,markdownLines:16384,inlineMarkers:4096};function digest(value){return createHash("sha256").update(value).digest("hex")}__name(digest,"digest");function record(value){return value!==null&&typeof value==="object"&&!Array.isArray(value)}__name(record,"record");function validSourcePath(value){return value.length<=512&&!/[\\\p{Cc}]/u.test(value)&&!value.startsWith("/")&&!/^[a-z]:/i.test(value)&&value.split("/").every(part=>part!==""&&part!=="."&&part!=="..")&&(/^(?:MEMORY|memory_summary)\.md$/.test(value)||/^rollout_summaries\/[\w.-]+\.md$/.test(value))}__name(validSourcePath,"validSourcePath");function validateSource(value){if(!record(value)||value["version"]!==1||value["source"]!=="codex"||!Array.isArray(value["files"])||value["files"].length===0||value["files"].length>IMPORT_LIMITS.files)throw new MemoryImportRequestError("Invalid version 1 Codex source set.");let bytes=0;const seen=new Set;const files=value["files"].map(file=>{if(!record(file)||typeof file["path"]!=="string"||!validSourcePath(file["path"])||typeof file["content"]!=="string"||file["content"].includes("\0"))throw new MemoryImportRequestError("Invalid Codex Markdown resource. Only memory Markdown and rollout_summaries/*.md are accepted.");const size=Buffer.byteLength(file["content"]);bytes+=size;if(size>IMPORT_LIMITS.fileBytes||bytes>IMPORT_LIMITS.totalBytes||seen.has(file["path"].toLowerCase()))throw new MemoryImportRequestError("Source exceeds limits or contains duplicate paths.");seen.add(file["path"].toLowerCase());return{path:file["path"],content:file["content"]}});if(!files.some(file=>file.path==="MEMORY.md"||file.path==="memory_summary.md"))throw new MemoryImportRequestError("Select the Codex memories folder containing MEMORY.md or memory_summary.md.");return{version:1,source:"codex",files:files.sort((a,b)=>a.path.localeCompare(b.path))}}__name(validateSource,"validateSource");var parser=unified().use(remarkParse);function headingTitle(raw){const atx=raw.match(/^ {0,3}#{1,6}(?:[\t ]+|$)/);if(atx)return raw.slice(atx[0].length).replace(/[\t ]+#+[\t ]*$/,"").trim();return raw.split(/\r\n|[\r\n]/).slice(0,-1).join(" ").trim()}__name(headingTitle,"headingTitle");function scopeFor(content,title,summary){const scopes=[];for(const match of content.matchAll(/(?:^|[\s;(])cwd\s*[=:]\s*(?:`([^`\n]+)`|([^\r\n,;()\s]+))/gim)){if(match[1]!==void 0){scopes.push({value:match[1].trim(),quoted:true,prose:false});continue}const trailing=content.slice(match.index+match[0].length).split(/\r\n|[\r\n]/,1)[0].trim();scopes.push({value:match[2].trim(),quoted:false,prose:/[^\s,;()]/.test(trailing)})}const heading=title.trim();if(/^(?:\/|[A-Za-z]:[\\/])/.test(heading))scopes.push({value:heading.replace(/^`|`$/g,""),quoted:false,prose:false});const strip=__name(value=>value.replace(/[\\/]+$/,"").replace(/[.:!?'"]+$/,""),"strip");const unique=[...new Set(scopes.map(scope=>strip(scope.value)))];if(unique.length===1&&/^(?:\/|[A-Za-z]:[\\/])/.test(unique[0])&&scopes.every(scope=>!scope.prose&&!/[*?{}[\]\p{Cc}]|\bcwd\s*[=:]/u.test(scope.value)&&(scope.quoted||!/\s/.test(scope.value))))return{suggestedScope:"project",sourceProject:unique[0],reason:"Source project hint; explicit target mapping is required."};if(scopes.length)return{suggestedScope:"unassigned",reason:"Ambiguous or unsupported project scope; assign explicitly."};if(summary&&/^(?:user profile|user preferences)$/i.test(title))return{suggestedScope:"user",reason:"Explicit user-level summary section."};return{suggestedScope:"unassigned",reason:"No reliable project scope; assign explicitly."}}__name(scopeFor,"scopeFor");function previewSource(input){const source=validateSource(input);const sections=[];const warnings=[];let headingCount=0;let lineCount=0;let markerCount=0;let expandedBytes=0;const paths=new Set(source.files.map(file=>file.path));const referenced=new Set;for(const file of source.files.filter(f=>!f.path.startsWith("rollout_summaries/"))){for(const match of file.content.matchAll(/rollout_summaries\/[\w.-]+\.md/g))referenced.add(match[0])}for(const ref of referenced)if(!paths.has(ref))warnings.push(`Missing referenced Markdown: ${ref}`);for(const file of source.files){if(file.path.startsWith("rollout_summaries/")&&!referenced.has(file.path)){warnings.push(`Unreferenced supporting resource excluded: ${file.path}`);continue}const atxCandidates=file.content.match(/^ {0,3}#{1,6}(?:[\t ]|$)/gm)?.length??0;if(headingCount+atxCandidates>4*IMPORT_LIMITS.headings)throw new MemoryImportRequestError("Source exceeds the supported heading limit.");for(let i=0;i<file.content.length;i++){const char=file.content[i];if(char==="\n"||char==="\r"&&file.content[i+1]!=="\n")lineCount++;if("*_~[]<>!`&\\".includes(char))markerCount++;if(lineCount>IMPORT_LIMITS.markdownLines||markerCount>IMPORT_LIMITS.inlineMarkers)throw new MemoryImportRequestError("Source exceeds the Markdown complexity limit; split it into smaller source sets before importing.")}const tree=parser.parse(file.content);const headings=tree.children.filter(node=>node.type==="heading").map((node,index,nodes)=>({offset:node.position.start.offset,line:node.position.start.line,depth:node.depth,title:headingTitle(file.content.slice(node.position.start.offset,node.position.end.offset)),preface:file.content.slice(node.position.start.offset,nodes[index+1]?.position.start.offset).trim()}));headingCount+=headings.length;if(headingCount>IMPORT_LIMITS.headings)throw new MemoryImportRequestError("Source exceeds the supported heading limit.");const scopedDepths=headings.filter(heading=>/^(?:`?\/|`?[A-Za-z]:[\\/])/.test(heading.title)||/\bcwd\s*[=:]/i.test(heading.preface)).map(heading=>heading.depth);const minDepth=headings.length?Math.min(...headings.map(h=>h.depth)):1;const depth=Math.max(file.path==="memory_summary.md"?2:minDepth,...scopedDepths);const boundaries=headings.filter(heading=>heading.depth<=depth);if(!boundaries.length||boundaries[0].offset>0)boundaries.unshift({offset:0,line:1,title:file.path,depth:0,preface:""});for(let i=0;i<boundaries.length;i++){const boundary=boundaries[i];const own=file.content.slice(boundary.offset,boundaries[i+1]?.offset).trim();if(!own||/^v\d+$/.test(own)||own.split(/\r\n|[\r\n]/).every(line=>!line.trim()||/^#{1,6}\s/.test(line)))continue;const ancestors=[];for(const heading of headings){if(heading.offset>=boundary.offset)break;while(ancestors.length&&ancestors.at(-1).depth>=heading.depth)ancestors.pop();ancestors.push(heading)}while(ancestors.length&&ancestors.at(-1).depth>=boundary.depth)ancestors.pop();const parts=[...ancestors.map(heading=>heading.preface),own];expandedBytes+=parts.reduce((bytes,part)=>bytes+Buffer.byteLength(part),0)+2*(parts.length-1);if(expandedBytes>IMPORT_LIMITS.totalBytes)throw new MemoryImportRequestError("Source expanded context exceeds 8 MiB; split shared context and project groups before importing.");const content=parts.join("\n\n");let scope=scopeFor(content,boundary.title,file.path==="memory_summary.md");if(scope.suggestedScope==="unassigned"&&!/\bcwd\s*[=:]/i.test(content)){const parent=ancestors.at(-1);if(parent)scope=scopeFor(content,parent.title,file.path==="memory_summary.md")}const references=[...new Set(Array.from(content.matchAll(/rollout_summaries\/[\w.-]+\.md/g),m=>m[0]))];const selectable=Buffer.byteLength(content)<=IMPORT_LIMITS.sectionBytes;if(!selectable)warnings.push(`${file.path}:${boundary.line}: section exceeds ${IMPORT_LIMITS.sectionBytes} bytes; split it before import.`);const id=digest(`${file.path}\0${content}`);if(sections.some(section=>section.id===id))continue;sections.push({id,groupId:digest(`${scope.suggestedScope}\0${scope.sourceProject??""}`),title:boundary.title,path:file.path,line:boundary.line,content,references,...scope,selectable})}}const groups=new Map;for(const section of sections){const group=groups.get(section.groupId)??{id:section.groupId,scope:section.suggestedScope,sourceProject:section.sourceProject,sectionIds:[]};group.sectionIds.push(section.id);groups.set(group.id,group)}return{version:1,kind:"preview",digest:digest(JSON.stringify(source)),groups:[...groups.values()].map(group=>({...group,estimate:estimateMemoryImport(sections.filter(section=>section.selectable&&section.groupId===group.id))})),sections,warnings,estimate:estimateMemoryImport(sections.filter(section=>section.selectable))}}__name(previewSource,"previewSource");async function readLocalSource(directory){const root=await fs.realpath(directory);const files=[];const read=__name(async relative=>{const file=path.join(root,relative);const info=await fs.lstat(file);if(!info.isFile()||info.isSymbolicLink()||info.size>IMPORT_LIMITS.fileBytes)throw new Error("Source must contain regular bounded Markdown files.");const handle=await fs.open(file,constants.O_RDONLY|(constants.O_NOFOLLOW??0)|(constants.O_NONBLOCK??0));try{const opened=await handle.stat();if(!opened.isFile()||opened.size>IMPORT_LIMITS.fileBytes)throw new Error("Source changed while opening.");const buffer=Buffer.alloc(IMPORT_LIMITS.fileBytes+1);let length=0;while(length<buffer.length){const read2=await handle.read(buffer,length,buffer.length-length,null);if(!read2.bytesRead)break;length+=read2.bytesRead}if(length>IMPORT_LIMITS.fileBytes||files.reduce((sum,entry)=>sum+Buffer.byteLength(entry.content),length)>IMPORT_LIMITS.totalBytes)throw new Error("Source exceeds byte limits.");files.push({path:relative,content:buffer.subarray(0,length).toString("utf8")})}finally{await handle.close()}},"read");for(const name of["MEMORY.md","memory_summary.md"]){try{await read(name)}catch(error){if(error.code!=="ENOENT")throw error}}const refs=new Set(files.flatMap(file=>Array.from(file.content.matchAll(/rollout_summaries\/[\w.-]+\.md/g),m=>m[0])));if(refs.size+files.length>IMPORT_LIMITS.files)throw new Error("Too many referenced source files.");if(refs.size){const dir=await fs.lstat(path.join(root,"rollout_summaries")).catch(error=>{if(error.code==="ENOENT")return void 0;throw error});if(dir&&(!dir.isDirectory()||dir.isSymbolicLink()))throw new Error("Supporting resource directory must not be a symlink.");if(dir)for(const ref of refs){try{await read(ref)}catch(error){if(error.code!=="ENOENT")throw error}}}return validateSource({version:1,source:"codex",files})}__name(readLocalSource,"readLocalSource");var writeStdoutLineFlushed=__name(message=>new Promise((resolve,reject)=>process.stdout.write(message.endsWith("\n")?message:`${message}
4
- `,error=>error&&error.code!=="EPIPE"?reject(error):resolve())),"writeStdoutLineFlushed");var memoryCommand={command:"memory",describe:"Preview and import external memories",builder:__name(argv=>argv.command({command:"import codex",describe:"Preview Codex memory; explicitly confirm selected sections to consolidate",builder:__name(args=>args.positional("codex",{type:"string",describe:"External memory source",choices:["codex"]}).option("source",{type:"string",describe:"Codex memories directory"}).option("dry-run",{type:"boolean",default:false,describe:"Offline preview; no model or memory writes"}).option("json",{type:"boolean",default:false}).option("apply",{type:"boolean",default:false,describe:"Authorize model consolidation of an explicit selection"}).option("selection",{type:"string",describe:"JSON array of {id, scope: project|user}"}).option("idempotency-key",{type:"string",describe:"Stable caller key for this selection"}).option("retry",{type:"boolean",default:false,describe:"Retry unfinished items of this submitted batch"}).strict(),"builder"),handler:__name(async args=>{ignoreBrokenPipe();if(args["apply"]&&args["dry-run"])throw new Error("--apply and --dry-run cannot be combined.");if(args["apply"]&&(args["bare"]||args["safeMode"]||args["safe-mode"]))throw new Error("Confirmed memory import is unavailable in bare or safe mode. Offline preview remains available.");if(args["source"]!==void 0&&typeof args["source"]!=="string")throw new Error("Provide a single --source directory.");const directory=typeof args["source"]==="string"?args["source"]:path2.join(process.env["CODEX_HOME"]?.trim()||path2.join(homedir(),".codex"),"memories");const source=await readLocalSource(directory);const preview=previewSource(source);if(!args["apply"]){if(args["json"])await writeStdoutLineFlushed(JSON.stringify(preview));else{const lines=[`Preview only: ${preview.sections.length} source sections. No memory was written.`,...preview.groups.map(group=>`[${group.sectionIds.length} sections] ${group.scope}: ${JSON.stringify(group.sourceProject??"No project hint")}`),`Estimated usage (all selectable sections): ${preview.estimate.modelCalls} model calls, ${preview.estimate.sourceTokens} source tokens, up to ${preview.estimate.maxOutputTokens} output tokens; ${preview.estimate.reservedTokens} reserved token units including context.`,`Task limits: ${preview.estimate.limits.maxCalls} calls / ${preview.estimate.limits.maxReservedTokens} reserved token units. Estimates are not billing quotes; explicit selection and existing context affect usage.`];if(preview.estimate.exceedsBudget)lines.push("Warning: the full selection may exceed the task budget; select fewer sections before confirming.");for(const warning of preview.warnings)lines.push(`Warning: ${JSON.stringify(warning)}`);lines.push("Use --json for section IDs, details and source text. To import, provide --apply --selection <JSON file> --idempotency-key <key>. Unassigned sections require an explicit scope.");await writeStdoutLineFlushed(lines.join("\n"))}return}if(typeof args["selection"]!=="string"||typeof args["idempotency-key"]!=="string")throw new Error("--apply requires --selection and --idempotency-key.");const stat=await fs2.lstat(args["selection"]);if(!stat.isFile()||stat.isSymbolicLink()||stat.size>512*1024)throw new Error("Selection must be a bounded regular JSON file.");const selection=JSON.parse(await fs2.readFile(args["selection"],"utf8"));const{createLocalMemoryImportService}=await import("./local-AONDQYFL.js");const service=await createLocalMemoryImportService();let task=await service.submit(source,selection,args["idempotency-key"]);if(args["retry"])task=await service.retry(task.id);task=await service.idle(task.id);await writeStdoutLineFlushed(JSON.stringify(task));if(task.status!=="completed"||task.items.some(item=>item.status==="conflict"))process.exitCode=1},"handler")}).demandCommand(1).version(false),"builder"),handler:__name(()=>{},"handler")};export{MEMORY_IMPORT_BUDGET,packMemoryImportSections,MemoryImportRequestError,digest,previewSource,memoryCommand};
4
+ `,error=>error&&error.code!=="EPIPE"?reject(error):resolve())),"writeStdoutLineFlushed");var memoryCommand={command:"memory",describe:"Preview and import external memories",builder:__name(argv=>argv.command({command:"import codex",describe:"Preview Codex memory; explicitly confirm selected sections to consolidate",builder:__name(args=>args.positional("codex",{type:"string",describe:"External memory source",choices:["codex"]}).option("source",{type:"string",describe:"Codex memories directory"}).option("dry-run",{type:"boolean",default:false,describe:"Offline preview; no model or memory writes"}).option("json",{type:"boolean",default:false}).option("apply",{type:"boolean",default:false,describe:"Authorize model consolidation of an explicit selection"}).option("selection",{type:"string",describe:"JSON array of {id, scope: project|user}"}).option("idempotency-key",{type:"string",describe:"Stable caller key for this selection"}).option("retry",{type:"boolean",default:false,describe:"Retry unfinished items of this submitted batch"}).strict(),"builder"),handler:__name(async args=>{ignoreBrokenPipe();if(args["apply"]&&args["dry-run"])throw new Error("--apply and --dry-run cannot be combined.");if(args["apply"]&&(args["bare"]||args["safeMode"]||args["safe-mode"]))throw new Error("Confirmed memory import is unavailable in bare or safe mode. Offline preview remains available.");if(args["source"]!==void 0&&typeof args["source"]!=="string")throw new Error("Provide a single --source directory.");const directory=typeof args["source"]==="string"?args["source"]:path2.join(process.env["CODEX_HOME"]?.trim()||path2.join(homedir(),".codex"),"memories");const source=await readLocalSource(directory);const preview=previewSource(source);if(!args["apply"]){if(args["json"])await writeStdoutLineFlushed(JSON.stringify(preview));else{const lines=[`Preview only: ${preview.sections.length} source sections. No memory was written.`,...preview.groups.map(group=>`[${group.sectionIds.length} sections] ${group.scope}: ${JSON.stringify(group.sourceProject??"No project hint")}`),`Estimated usage (all selectable sections): ${preview.estimate.modelCalls} model calls, ${preview.estimate.sourceTokens} source tokens, up to ${preview.estimate.maxOutputTokens} output tokens; ${preview.estimate.reservedTokens} reserved token units including context.`,`Task limits: ${preview.estimate.limits.maxCalls} calls / ${preview.estimate.limits.maxReservedTokens} reserved token units. Estimates are not billing quotes; explicit selection and existing context affect usage.`];if(preview.estimate.exceedsBudget)lines.push("Warning: the full selection may exceed the task budget; select fewer sections before confirming.");for(const warning of preview.warnings)lines.push(`Warning: ${JSON.stringify(warning)}`);lines.push("Use --json for section IDs, details and source text. To import, provide --apply --selection <JSON file> --idempotency-key <key>. Unassigned sections require an explicit scope.");await writeStdoutLineFlushed(lines.join("\n"))}return}if(typeof args["selection"]!=="string"||typeof args["idempotency-key"]!=="string")throw new Error("--apply requires --selection and --idempotency-key.");const stat=await fs2.lstat(args["selection"]);if(!stat.isFile()||stat.isSymbolicLink()||stat.size>512*1024)throw new Error("Selection must be a bounded regular JSON file.");const selection=JSON.parse(await fs2.readFile(args["selection"],"utf8"));const{createLocalMemoryImportService}=await import("./local-KM5F5RAB.js");const service=await createLocalMemoryImportService();let task=await service.submit(source,selection,args["idempotency-key"]);if(args["retry"])task=await service.retry(task.id);task=await service.idle(task.id);await writeStdoutLineFlushed(JSON.stringify(task));if(task.status!=="completed"||task.items.some(item=>item.status==="conflict"))process.exitCode=1},"handler")}).demandCommand(1).version(false),"builder"),handler:__name(()=>{},"handler")};export{MEMORY_IMPORT_BUDGET,packMemoryImportSections,MemoryImportRequestError,digest,previewSource,memoryCommand};
5
5
  /**
6
6
  * @license
7
7
  * Copyright 2026 Qwen Team
@@ -1,6 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{loadProjectMcpServers}from"./chunk-TFITRCIC.js";import{normalizeProjectRoot}from"./chunk-JDZ3UHK5.js";import{loadSettings}from"./chunk-23543L6E.js";import{getCurrentLanguage}from"./chunk-FK5L2WVV.js";import{require_strip_json_comments}from"./chunk-EKRCICRK.js";import{isWorkspaceTrusted}from"./chunk-WZTO3EYG.js";import{hashMcpServerConfig}from"./chunk-3MBYQYPC.js";import{Config,ExtensionManager,FileDiscoveryService,MCPOAuthTokenStorage,createMcpClient,createTransport,isGatedMcpScope,runWithTimeout}from"./chunk-PFKTTUGS.js";import{parseBooleanEnvFlag}from"./chunk-7Z2ZH5CW.js";import{getMCPServerLastError,getMCPServerStatus}from"./chunk-MJEL7DIE.js";import{atomicWriteFile}from"./chunk-2GF3E5MI.js";import{writeStderrLine,writeStdoutLine}from"./chunk-M4ECEHLX.js";import{Storage}from"./chunk-5VB4YX3Z.js";import{getErrorMessage}from"./chunk-E7MYPQGV.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name,__toESM}from"./chunk-KBWJGX7I.js";init_esbuild_shims();init_esbuild_shims();function splitCommaList(values){if(values===void 0)return void 0;const strings=values.filter(value=>typeof value==="string");if(strings.length===0)return values.length?void 0:[];return strings.flatMap(value=>value.split(",")).map(value=>value.trim()).filter(Boolean)}__name(splitCommaList,"splitCommaList");async function addMcpServer(name,commandOrUrl,args,options){const{scope,transport,env,header,timeout,trust,description,includeTools,excludeTools,oauthClientId,oauthClientSecret,oauthRedirectUri,oauthAuthorizationUrl,oauthTokenUrl,oauthScopes}=options;const settings=loadSettings(process.cwd());const inHome=settings.workspace.path===settings.user.path;if(scope==="project"&&inHome){writeStderrLine("Error: Please use --scope user to edit settings in the home directory.");process.exit(1)}const settingsScope=scope==="user"?"User":"Workspace";let newServer={};const scopes=splitCommaList(oauthScopes);const hasOAuth=Boolean(oauthClientId||oauthClientSecret||oauthRedirectUri||oauthAuthorizationUrl||oauthTokenUrl||scopes&&scopes.length>0);if(hasOAuth&&transport==="stdio"){writeStderrLine("Error: OAuth options (--oauth-*) are only supported with --transport sse or --transport http.");process.exit(1)}const oauthConfig=hasOAuth?{enabled:true,...oauthClientId&&{clientId:oauthClientId},...oauthClientSecret&&{clientSecret:oauthClientSecret},...oauthRedirectUri&&{redirectUri:oauthRedirectUri},...oauthAuthorizationUrl&&{authorizationUrl:oauthAuthorizationUrl},...oauthTokenUrl&&{tokenUrl:oauthTokenUrl},...scopes&&scopes.length>0&&{scopes}}:void 0;const headers=header?.reduce((acc,curr)=>{const[key,...valueParts]=curr.split(":");const value=valueParts.join(":").trim();if(key.trim()&&value){acc[key.trim()]=value}return acc},{});switch(transport){case"sse":newServer={url:commandOrUrl,headers,timeout,trust,description,includeTools,excludeTools,oauth:oauthConfig};break;case"http":newServer={httpUrl:commandOrUrl,headers,timeout,trust,description,includeTools,excludeTools,oauth:oauthConfig};break;case"stdio":default:newServer={command:commandOrUrl,args:args?.map(String),env:env?.reduce((acc,curr)=>{const separator=curr.indexOf("=");if(separator===-1){return acc}const key=curr.slice(0,separator);const value=curr.slice(separator+1);if(key&&value){acc[key]=value}return acc},{}),timeout,trust,description,includeTools,excludeTools};break}const existingSettings=settings.forScope(settingsScope).settings;const mcpServers=existingSettings.mcpServers||{};const isExistingServer=!!mcpServers[name];if(isExistingServer){writeStdoutLine(`MCP server "${name}" is already configured within ${scope} settings.`)}mcpServers[name]=newServer;settings.setValue(settingsScope,"mcpServers",mcpServers);if(isExistingServer){writeStdoutLine(`MCP server "${name}" updated in ${scope} settings.`)}else{writeStdoutLine(`MCP server "${name}" added to ${scope} settings. (${transport})`)}}__name(addMcpServer,"addMcpServer");var addCommand={command:"add <name> <commandOrUrl> [args...]",describe:"Add a server",builder:__name(yargs=>yargs.usage("Usage: qwen mcp add [options] <name> <commandOrUrl> [args...]").parserConfiguration({"unknown-options-as-args":true,"populate--":true}).positional("name",{describe:"Name of the server",type:"string",demandOption:true}).positional("commandOrUrl",{describe:"Command (stdio) or URL (sse, http)",type:"string",demandOption:true}).option("scope",{alias:"s",describe:"Configuration scope (user or project)",type:"string",default:"user",choices:["user","project"]}).option("transport",{alias:"t",describe:"Transport type (stdio, sse, http). Auto-detected from URL if not specified.",type:"string",choices:["stdio","sse","http"]}).option("env",{alias:"e",describe:"Set environment variables (e.g. -e KEY=value)",type:"array",string:true,nargs:1}).option("header",{alias:"H",describe:'Set HTTP headers for SSE and HTTP transports (e.g. -H "X-Api-Key: abc123" -H "Authorization: Bearer abc123")',type:"array",string:true,nargs:1}).option("timeout",{describe:"Set connection timeout in milliseconds",type:"number"}).option("trust",{describe:"Trust the server (bypass its tool call confirmations in a trusted workspace)",type:"boolean"}).option("description",{describe:"Set the description for the server",type:"string"}).option("include-tools",{describe:"A comma-separated list of tools to include",type:"array",string:true}).option("exclude-tools",{describe:"A comma-separated list of tools to exclude",type:"array",string:true}).option("oauth-client-id",{describe:"OAuth client ID for MCP server authentication",type:"string"}).option("oauth-client-secret",{describe:"OAuth client secret for MCP server authentication",type:"string"}).option("oauth-redirect-uri",{describe:"OAuth redirect URI (e.g., https://your-server.com/oauth/callback). Defaults to localhost for local setups.",type:"string"}).option("oauth-authorization-url",{describe:"OAuth authorization URL",type:"string"}).option("oauth-token-url",{describe:"OAuth token URL",type:"string"}).option("oauth-scopes",{describe:"OAuth scopes (comma-separated)",type:"array",string:true}).middleware(argv=>{if(argv["--"]){const existingArgs=argv["args"]||[];argv["args"]=[...existingArgs,...argv["--"]]}if(!argv["transport"]){const commandOrUrl=argv["commandOrUrl"];if(commandOrUrl&&/^https?:\/\//i.test(commandOrUrl)){argv["transport"]="http"}else{argv["transport"]="stdio"}}}),"builder"),handler:__name(async argv=>{await addMcpServer(argv["name"],argv["commandOrUrl"],argv["args"],{scope:argv["scope"],transport:argv["transport"],env:argv["env"],header:argv["header"],timeout:argv["timeout"],trust:argv["trust"],description:argv["description"],includeTools:splitCommaList(argv["includeTools"]),excludeTools:splitCommaList(argv["excludeTools"]),oauthClientId:argv["oauthClientId"],oauthClientSecret:argv["oauthClientSecret"],oauthRedirectUri:argv["oauthRedirectUri"],oauthAuthorizationUrl:argv["oauthAuthorizationUrl"],oauthTokenUrl:argv["oauthTokenUrl"],oauthScopes:argv["oauthScopes"]})},"handler")};init_esbuild_shims();async function removeMcpServer(name,options){const{scope}=options;const settingsScope=scope==="user"?"User":"Workspace";const settings=loadSettings();const existingSettings=settings.forScope(settingsScope).settings;const mcpServers=existingSettings.mcpServers||{};if(!mcpServers[name]){writeStdoutLine(`Server "${name}" not found in ${scope} settings.`);return}delete mcpServers[name];settings.setValue(settingsScope,"mcpServers",mcpServers);try{const tokenStorage=new MCPOAuthTokenStorage;await tokenStorage.deleteCredentials(name)}catch{}writeStdoutLine(`Server "${name}" removed from ${scope} settings.`)}__name(removeMcpServer,"removeMcpServer");var removeCommand={command:"remove <name>",describe:"Remove a server",builder:__name(yargs=>yargs.usage("Usage: qwen mcp remove [options] <name>").positional("name",{describe:"Name of the server",type:"string",demandOption:true}).option("scope",{alias:"s",describe:"Configuration scope (user or project)",type:"string",default:"user",choices:["user","project"]}),"builder"),handler:__name(async argv=>{await removeMcpServer(argv["name"],{scope:argv["scope"]})},"handler")};init_esbuild_shims();init_esbuild_shims();function assembleMcpServers(mergedSettingsServers,cwd,cliMcpServers){const belowProject={};const aboveProject={};for(const[name,config]of Object.entries(mergedSettingsServers??{})){if(config.scope==="workspace"||config.scope==="system"){aboveProject[name]=config}else{belowProject[name]=config}}const projectResult=loadProjectMcpServers(cwd);for(const error of projectResult.errors){writeStderrLine(`Warning: ${error}`)}return{...belowProject,...projectResult.servers,...aboveProject,...cliMcpServers??{}}}__name(assembleMcpServers,"assembleMcpServers");init_esbuild_shims();import*as fs from"node:fs";import*as os from"node:os";import*as path from"node:path";var import_strip_json_comments=__toESM(require_strip_json_comments(),1);var MCP_APPROVALS_FILENAME="mcpApprovals.json";function getMcpApprovalsPath(){if(process.env["QWEN_CODE_MCP_APPROVALS_PATH"]){return process.env["QWEN_CODE_MCP_APPROVALS_PATH"]}return path.join(Storage.getGlobalQwenDir(),MCP_APPROVALS_FILENAME)}__name(getMcpApprovalsPath,"getMcpApprovalsPath");function isApprovalRecordMap(value){return typeof value==="object"&&value!==null&&!Array.isArray(value)}__name(isApprovalRecordMap,"isApprovalRecordMap");function isWin32AbsolutePath(p){return/^[A-Za-z]:[\\/]/.test(p)||/^\\\\/.test(p)}__name(isWin32AbsolutePath,"isWin32AbsolutePath");function mergeApprovalRecords(existing,incoming){const merged=Object.assign(Object.create(null),existing);for(const[name,record]of Object.entries(incoming)){if(!isApprovalRecordMap(record)){continue}const current=merged[name];if(!current){merged[name]=record}else if(current.status!==record.status){merged[name]=current.status==="rejected"?current:record}}return merged}__name(mergeApprovalRecords,"mergeApprovalRecords");function normalizeStoredProjectKeys(config){if(os.platform()!=="win32"){return config}const normalized=Object.create(null);for(const[key,value]of Object.entries(config)){const projectKey=isWin32AbsolutePath(key)?key.toLowerCase():key;const existing=normalized[projectKey];normalized[projectKey]=isApprovalRecordMap(existing)&&isApprovalRecordMap(value)?mergeApprovalRecords(existing,value):isApprovalRecordMap(value)||!isApprovalRecordMap(existing)?value:existing}return normalized}__name(normalizeStoredProjectKeys,"normalizeStoredProjectKeys");var LoadedMcpApprovals=class{constructor(file,errors){this.file=file;this.errors=errors}static{__name(this,"LoadedMcpApprovals")}getState(projectRoot,serverName,config){const record=this.file.config[normalizeProjectRoot(projectRoot)]?.[serverName];if(!record){return"pending"}if(record.hash!==hashMcpServerConfig(config)){return"pending"}return record.status}async setState(projectRoot,serverName,config,status){const root=normalizeProjectRoot(projectRoot);const existing=this.file.config[root];const project=isApprovalRecordMap(existing)?existing:Object.create(null);Object.defineProperty(project,serverName,{value:{hash:hashMcpServerConfig(config),status},enumerable:true,configurable:true,writable:true});this.file.config[root]=project;await saveMcpApprovals(this.file)}};var loadedMcpApprovals;function loadMcpApprovals(){if(loadedMcpApprovals){return loadedMcpApprovals}const errors=[];let config={};const filePath=getMcpApprovalsPath();try{if(fs.existsSync(filePath)){const content=fs.readFileSync(filePath,"utf-8");const parsed=JSON.parse((0,import_strip_json_comments.default)(content));if(typeof parsed!=="object"||parsed===null||Array.isArray(parsed)){errors.push({message:"MCP approvals file is not a valid JSON object.",path:filePath})}else{config=normalizeStoredProjectKeys(parsed)}}}catch(error){errors.push({message:getErrorMessage(error),path:filePath})}loadedMcpApprovals=new LoadedMcpApprovals({path:filePath,config},errors);for(const error of errors){writeStderrLine(`Warning: MCP approvals file error: ${error.message}`)}return loadedMcpApprovals}__name(loadMcpApprovals,"loadMcpApprovals");function getPendingGatedMcpServers(mcpServers,projectRoot){const approvals=loadMcpApprovals();const pending=[];for(const[name,config]of Object.entries(mcpServers)){if(!isGatedMcpScope(config.scope)){continue}if(approvals.getState(projectRoot,name,config)!=="approved"){pending.push(name)}}return pending}__name(getPendingGatedMcpServers,"getPendingGatedMcpServers");function getPromptableMcpServers(mcpServers,projectRoot){const approvals=loadMcpApprovals();const promptable=[];for(const[name,config]of Object.entries(mcpServers)){if(!isGatedMcpScope(config.scope)){continue}if(approvals.getState(projectRoot,name,config)==="pending"){promptable.push(name)}}return promptable}__name(getPromptableMcpServers,"getPromptableMcpServers");async function saveMcpApprovals(file){try{const dirPath=path.dirname(file.path);if(!fs.existsSync(dirPath)){fs.mkdirSync(dirPath,{recursive:true})}await atomicWriteFile(file.path,JSON.stringify(file.config,null,2),{mode:384})}catch(error){writeStderrLine("Error saving MCP approvals file.");writeStderrLine(error instanceof Error?error.message:String(error))}}__name(saveMcpApprovals,"saveMcpApprovals");var COLOR_GREEN="\x1B[32m";var COLOR_YELLOW="\x1B[33m";var COLOR_RED="\x1B[31m";var RESET_COLOR="\x1B[0m";var MCP_CONNECT_TIMEOUT_MS=1e4;async function getMcpServersFromConfig(){const settings=loadSettings();const extensionManager=new ExtensionManager({isWorkspaceTrusted:isWorkspaceTrusted(settings.merged).isTrusted??true,telemetrySettings:settings.merged.telemetry,locale:getCurrentLanguage()});await extensionManager.refreshCache();const extensions=extensionManager.getLoadedExtensions();const mcpServers=assembleMcpServers(settings.merged.mcpServers,process.cwd());for(const extension of extensions){if(extension.isActive){Object.entries(extension.config.mcpServers||{}).forEach(([key,server])=>{if(mcpServers[key]){return}mcpServers[key]={...server,extensionName:extension.config.name}})}}return mcpServers}__name(getMcpServersFromConfig,"getMcpServersFromConfig");async function testMCPConnection(serverName,config){const client=createMcpClient("mcp-test-client",config);let transport;try{transport=await createTransport(serverName,config,false)}catch(_error){await client.close();return{status:"disconnected",timedOut:false}}try{await runWithTimeout(client.connect(transport,{timeout:MCP_CONNECT_TIMEOUT_MS}),MCP_CONNECT_TIMEOUT_MS,`MCP connection for ${serverName}`);await client.close();return{status:"connected",timedOut:false}}catch(error){await transport.close();return{status:"disconnected",timedOut:error instanceof Error&&error.message.startsWith("Timed out after ")}}}__name(testMCPConnection,"testMCPConnection");async function getServerStatus(serverName,server){return await testMCPConnection(serverName,server)}__name(getServerStatus,"getServerStatus");async function listMcpServers(){const mcpServers=await getMcpServersFromConfig();const serverNames=Object.keys(mcpServers);if(serverNames.length===0){writeStdoutLine("No MCP servers configured.");return}writeStdoutLine("Configured MCP servers:\n");const cwd=process.cwd();let approvals;for(const serverName of serverNames){const server=mcpServers[serverName];let serverInfo=`${serverName}: `;if(server.httpUrl){serverInfo+=`${server.httpUrl} (http)`}else if(server.url){serverInfo+=`${server.url} (sse)`}else if(server.command){serverInfo+=`${server.command} ${server.args?.join(" ")||""} (stdio)`}if(isGatedMcpScope(server.scope)){approvals??=loadMcpApprovals();const state=approvals.getState(cwd,serverName,server);if(state!=="approved"){const statusText2=state==="rejected"?"Rejected":"Pending approval";writeStdoutLine(`${COLOR_YELLOW}\u25CF${RESET_COLOR} ${serverInfo} - ${statusText2}`);continue}}const{status,timedOut}=await getServerStatus(serverName,server);let statusIndicator="";let statusText="";switch(status){case"connected":statusIndicator=COLOR_GREEN+"\u2713"+RESET_COLOR;statusText="Connected";break;case"connecting":statusIndicator=COLOR_YELLOW+"\u2026"+RESET_COLOR;statusText="Connecting";break;case"disconnected":default:statusIndicator=COLOR_RED+"\u2717"+RESET_COLOR;statusText=timedOut?`Disconnected (timed out after ${MCP_CONNECT_TIMEOUT_MS}ms)`:"Disconnected";break}writeStdoutLine(`${statusIndicator} ${serverInfo} - ${statusText}`)}}__name(listMcpServers,"listMcpServers");var listCommand={command:"list",describe:"List all configured MCP servers",handler:__name(async()=>{await listMcpServers()},"handler")};init_esbuild_shims();async function getMcpServersFromConfig2(extensionManager){const settings=loadSettings();const extManager=extensionManager??new ExtensionManager({isWorkspaceTrusted:isWorkspaceTrusted(settings.merged).isTrusted??true,telemetrySettings:settings.merged.telemetry,locale:getCurrentLanguage()});if(!extensionManager){await extManager.refreshCache()}const extensions=extManager.getLoadedExtensions();const mcpServers=assembleMcpServers(settings.merged.mcpServers,process.cwd());for(const extension of extensions){if(extension.isActive){Object.entries(extension.config.mcpServers||{}).forEach(([key,server])=>{if(mcpServers[key]){return}mcpServers[key]={...server,extensionName:extension.config.name}})}}return mcpServers}__name(getMcpServersFromConfig2,"getMcpServersFromConfig");async function createMinimalConfig(){const settings=loadSettings();const cwd=process.cwd();const fileFiltering=settings.merged.context?.fileFiltering;const fileService=new FileDiscoveryService(cwd,fileFiltering?.customIgnoreFiles);const mcpServers=await getMcpServersFromConfig2();const allowedMcpServers=settings.merged.mcp?.allowed?new Set(settings.merged.mcp.allowed.filter(Boolean)):void 0;const excludedMcpServers=settings.merged.mcp?.excluded?new Set(settings.merged.mcp.excluded.filter(Boolean)):void 0;const config=new Config({sessionId:"mcp-reconnect",targetDir:cwd,cwd,debugMode:false,chatRecording:false,mcpServers,pendingMcpServers:getPendingGatedMcpServers(mcpServers,cwd),fileDiscoveryService:fileService,mcpServerCommand:settings.merged.mcp?.serverCommand,allowedMcpServers:allowedMcpServers?Array.from(allowedMcpServers):void 0,excludedMcpServers:excludedMcpServers?Array.from(excludedMcpServers):void 0,trustedFolder:isWorkspaceTrusted(settings.merged).isTrusted??true,usageStatisticsEnabled:parseBooleanEnvFlag(process.env["QWEN_USAGE_STATISTICS_ENABLED"])??settings.merged.privacy?.usageStatisticsEnabled??true,modelCatalogRefreshEnabled:typeof settings.merged.model?.catalogRefresh==="boolean"?settings.merged.model.catalogRefresh:void 0,proxy:settings.merged.proxy||process.env["HTTPS_PROXY"]||process.env["https_proxy"]||process.env["HTTP_PROXY"]||process.env["http_proxy"],...fileFiltering!==void 0?{fileFiltering}:{}});await config.initialize({skipMcpDiscovery:true,skipFileWatching:true,skipLlmInitialization:true});return config}__name(createMinimalConfig,"createMinimalConfig");var SkippedConnectionError=class extends Error{static{__name(this,"SkippedConnectionError")}skipReason;constructor(skipReason){super(`no connection attempt was made: ${skipReason}`);this.name="SkippedConnectionError";this.skipReason=skipReason}};var SESSION_SCOPE_NOTE="Note: this command reconnects in a separate process; it cannot refresh the MCP tools of an already-running MiraOS session. Restart that session if its tools remain unavailable.";function createReconnectError(message,exitCode=1){const error=new Error(message);error.exitCode=exitCode;return error}__name(createReconnectError,"createReconnectError");function describeSkippedConnectionReason(config,serverName){const unavailableReason=config.getMcpServerUnavailableReason(serverName);if(unavailableReason==="excluded"){return"server is excluded in settings (mcp.excluded)"}if(unavailableReason==="not_allowed"){return"server is not in the mcp.allowed list"}if(config.isMcpServerDisabled(serverName)){return"server is disabled in settings"}if(config.isMcpServerPendingApproval(serverName)){return"server is pending approval (.mcp.json)"}if(config.isTrustedFolder()===false){return"workspace folder is not trusted"}return void 0}__name(describeSkippedConnectionReason,"describeSkippedConnectionReason");async function discoverAndVerifyConnection(config,serverName){const toolRegistry=config.getToolRegistry();await toolRegistry.discoverToolsForServer(serverName);const status=getMCPServerStatus(serverName);if(status!=="connected"){const skippedReason=describeSkippedConnectionReason(config,serverName);if(skippedReason){throw new SkippedConnectionError(skippedReason)}const lastError=getMCPServerLastError(serverName);throw new Error(`connection attempt finished without a live connection (status: ${status})`+(lastError?`: ${lastError}`:""))}}__name(discoverAndVerifyConnection,"discoverAndVerifyConnection");async function reconnectMcpServer(serverName){const mcpServers=await getMcpServersFromConfig2();if(!mcpServers[serverName]){throw createReconnectError(`Error: Server "${serverName}" not found in configuration.`)}writeStdoutLine(`Reconnecting to server "${serverName}"...`);let config;try{config=await createMinimalConfig();await discoverAndVerifyConnection(config,serverName);writeStdoutLine(`Successfully reconnected to server "${serverName}".`);writeStdoutLine(SESSION_SCOPE_NOTE)}catch(error){const message=error instanceof Error?error.message:String(error);writeStdoutLine(SESSION_SCOPE_NOTE);throw createReconnectError(`Failed to reconnect to server "${serverName}": ${message}`)}finally{if(config){await config.shutdown()}}}__name(reconnectMcpServer,"reconnectMcpServer");async function reconnectAllMcpServers(){const settings=loadSettings();const extensionManager=new ExtensionManager({isWorkspaceTrusted:isWorkspaceTrusted(settings.merged).isTrusted??true,telemetrySettings:settings.merged.telemetry,locale:getCurrentLanguage()});await extensionManager.refreshCache();const mcpServers=await getMcpServersFromConfig2(extensionManager);const serverNames=Object.keys(mcpServers);if(serverNames.length===0){writeStdoutLine("No MCP servers configured.");return}writeStdoutLine("Reconnecting to all MCP servers...\n");let config;let failedCount=0;try{config=await createMinimalConfig();for(const serverName of serverNames){try{await discoverAndVerifyConnection(config,serverName);writeStdoutLine(`\u2713 ${serverName}: Reconnected successfully`)}catch(error){if(error instanceof SkippedConnectionError){writeStdoutLine(`- ${serverName}: Skipped - ${error.skipReason}`);continue}failedCount++;const message=error instanceof Error?error.message:String(error);writeStdoutLine(`\u2717 ${serverName}: Failed - ${message}`)}}writeStdoutLine("");writeStdoutLine(SESSION_SCOPE_NOTE)}finally{if(config){await config.shutdown()}}if(failedCount>0){throw createReconnectError(`Failed to reconnect ${failedCount} of ${serverNames.length} configured server(s).`)}}__name(reconnectAllMcpServers,"reconnectAllMcpServers");var reconnectCommand={command:"reconnect [server-name]",describe:"Reconnect MCP server(s)",builder:__name(yargs=>yargs.usage("Usage: qwen mcp reconnect [options] [server-name]").positional("server-name",{describe:"Name of the server to reconnect",type:"string"}).option("all",{alias:"a",describe:"Reconnect all configured servers",type:"boolean",default:false}).conflicts("server-name","all").check(argv=>{const serverName=argv["server-name"];const all=argv["all"];if(!serverName&&!all){throw new Error("Please specify a server name or use --all to reconnect all servers.")}return true}),"builder"),handler:__name(async argv=>{const serverName=argv["server-name"];const all=argv["all"];try{if(all){await reconnectAllMcpServers()}else if(serverName){await reconnectMcpServer(serverName)}}catch(error){const message=error instanceof Error?error.message:String(error);const exitCode=error?.exitCode??1;writeStderrLine(message);process.exit(exitCode)}},"handler")};init_esbuild_shims();function loadGatedServers(cwd){const settings=loadSettings(cwd);const all=assembleMcpServers(settings.merged.mcpServers,cwd);const gated={};for(const[serverName,config]of Object.entries(all)){if(isGatedMcpScope(config.scope)){gated[serverName]=config}}return gated}__name(loadGatedServers,"loadGatedServers");async function setProjectServerStatus(name,status,all){const cwd=process.cwd();const servers=loadGatedServers(cwd);const names=Object.keys(servers);if(names.length===0){writeStdoutLine("No approval-requiring MCP servers found (looked in .mcp.json and .qwen/settings.json).");return}const verb=status==="approved"?"Approved":"Rejected";const approvals=loadMcpApprovals();const targets=all?names:name?[name]:[];if(targets.length===0){writeStdoutLine("Specify a server name or pass --all.");return}for(const target of targets){const config=servers[target];if(!config){writeStdoutLine(`Server "${target}" not found. Available: ${names.join(", ")}`);continue}await approvals.setState(cwd,target,config,status);writeStdoutLine(`${verb} MCP server "${target}" (bound to its current config).`)}if(status==="approved"){writeStdoutLine("Approved servers connect in your next interactive session.")}}__name(setProjectServerStatus,"setProjectServerStatus");var approveCommand={command:"approve [name]",describe:"Approve a gated MCP server (.mcp.json or workspace .qwen/settings.json)",builder:__name(yargs=>yargs.usage("Usage: qwen mcp approve [options] [name]").positional("name",{describe:"Name of the gated server to approve",type:"string"}).option("all",{describe:"Approve all gated servers in this workspace",type:"boolean",default:false}),"builder"),handler:__name(async argv=>{await setProjectServerStatus(argv["name"],"approved",argv["all"])},"handler")};var rejectCommand={command:"reject [name]",describe:"Reject a gated MCP server (.mcp.json or workspace .qwen/settings.json)",builder:__name(yargs=>yargs.usage("Usage: qwen mcp reject [options] [name]").positional("name",{describe:"Name of the gated server to reject",type:"string"}).option("all",{describe:"Reject all gated servers in this workspace",type:"boolean",default:false}),"builder"),handler:__name(async argv=>{await setProjectServerStatus(argv["name"],"rejected",argv["all"])},"handler")};var mcpCommand={command:"mcp",describe:"Manage MCP servers",builder:__name(yargs=>yargs.command(addCommand).command(removeCommand).command(listCommand).command(reconnectCommand).command(approveCommand).command(rejectCommand).demandCommand(1,"You need at least one command before continuing.").version(false),"builder"),handler:__name(()=>{},"handler")};export{assembleMcpServers,loadMcpApprovals,getPendingGatedMcpServers,getPromptableMcpServers,mcpCommand};
3
+ import{loadProjectMcpServers}from"./chunk-FWSXFRIQ.js";import{normalizeProjectRoot}from"./chunk-JDZ3UHK5.js";import{loadSettings}from"./chunk-4RJ2RRGZ.js";import{getCurrentLanguage}from"./chunk-AUM57JI2.js";import{require_strip_json_comments}from"./chunk-EKRCICRK.js";import{isWorkspaceTrusted}from"./chunk-EYECE2PH.js";import{hashMcpServerConfig}from"./chunk-E4REGDEZ.js";import{Config,ExtensionManager,FileDiscoveryService,MCPOAuthTokenStorage,createMcpClient,createTransport,isGatedMcpScope,runWithTimeout}from"./chunk-ZUWLTGSR.js";import{parseBooleanEnvFlag}from"./chunk-7Z2ZH5CW.js";import{getMCPServerLastError,getMCPServerStatus}from"./chunk-MJEL7DIE.js";import{atomicWriteFile}from"./chunk-2GF3E5MI.js";import{writeStderrLine,writeStdoutLine}from"./chunk-M4ECEHLX.js";import{Storage}from"./chunk-5VB4YX3Z.js";import{getErrorMessage}from"./chunk-E7MYPQGV.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name,__toESM}from"./chunk-KBWJGX7I.js";init_esbuild_shims();init_esbuild_shims();function splitCommaList(values){if(values===void 0)return void 0;const strings=values.filter(value=>typeof value==="string");if(strings.length===0)return values.length?void 0:[];return strings.flatMap(value=>value.split(",")).map(value=>value.trim()).filter(Boolean)}__name(splitCommaList,"splitCommaList");async function addMcpServer(name,commandOrUrl,args,options){const{scope,transport,env,header,timeout,trust,description,includeTools,excludeTools,oauthClientId,oauthClientSecret,oauthRedirectUri,oauthAuthorizationUrl,oauthTokenUrl,oauthScopes}=options;const settings=loadSettings(process.cwd());const inHome=settings.workspace.path===settings.user.path;if(scope==="project"&&inHome){writeStderrLine("Error: Please use --scope user to edit settings in the home directory.");process.exit(1)}const settingsScope=scope==="user"?"User":"Workspace";let newServer={};const scopes=splitCommaList(oauthScopes);const hasOAuth=Boolean(oauthClientId||oauthClientSecret||oauthRedirectUri||oauthAuthorizationUrl||oauthTokenUrl||scopes&&scopes.length>0);if(hasOAuth&&transport==="stdio"){writeStderrLine("Error: OAuth options (--oauth-*) are only supported with --transport sse or --transport http.");process.exit(1)}const oauthConfig=hasOAuth?{enabled:true,...oauthClientId&&{clientId:oauthClientId},...oauthClientSecret&&{clientSecret:oauthClientSecret},...oauthRedirectUri&&{redirectUri:oauthRedirectUri},...oauthAuthorizationUrl&&{authorizationUrl:oauthAuthorizationUrl},...oauthTokenUrl&&{tokenUrl:oauthTokenUrl},...scopes&&scopes.length>0&&{scopes}}:void 0;const headers=header?.reduce((acc,curr)=>{const[key,...valueParts]=curr.split(":");const value=valueParts.join(":").trim();if(key.trim()&&value){acc[key.trim()]=value}return acc},{});switch(transport){case"sse":newServer={url:commandOrUrl,headers,timeout,trust,description,includeTools,excludeTools,oauth:oauthConfig};break;case"http":newServer={httpUrl:commandOrUrl,headers,timeout,trust,description,includeTools,excludeTools,oauth:oauthConfig};break;case"stdio":default:newServer={command:commandOrUrl,args:args?.map(String),env:env?.reduce((acc,curr)=>{const separator=curr.indexOf("=");if(separator===-1){return acc}const key=curr.slice(0,separator);const value=curr.slice(separator+1);if(key&&value){acc[key]=value}return acc},{}),timeout,trust,description,includeTools,excludeTools};break}const existingSettings=settings.forScope(settingsScope).settings;const mcpServers=existingSettings.mcpServers||{};const isExistingServer=!!mcpServers[name];if(isExistingServer){writeStdoutLine(`MCP server "${name}" is already configured within ${scope} settings.`)}mcpServers[name]=newServer;settings.setValue(settingsScope,"mcpServers",mcpServers);if(isExistingServer){writeStdoutLine(`MCP server "${name}" updated in ${scope} settings.`)}else{writeStdoutLine(`MCP server "${name}" added to ${scope} settings. (${transport})`)}}__name(addMcpServer,"addMcpServer");var addCommand={command:"add <name> <commandOrUrl> [args...]",describe:"Add a server",builder:__name(yargs=>yargs.usage("Usage: qwen mcp add [options] <name> <commandOrUrl> [args...]").parserConfiguration({"unknown-options-as-args":true,"populate--":true}).positional("name",{describe:"Name of the server",type:"string",demandOption:true}).positional("commandOrUrl",{describe:"Command (stdio) or URL (sse, http)",type:"string",demandOption:true}).option("scope",{alias:"s",describe:"Configuration scope (user or project)",type:"string",default:"user",choices:["user","project"]}).option("transport",{alias:"t",describe:"Transport type (stdio, sse, http). Auto-detected from URL if not specified.",type:"string",choices:["stdio","sse","http"]}).option("env",{alias:"e",describe:"Set environment variables (e.g. -e KEY=value)",type:"array",string:true,nargs:1}).option("header",{alias:"H",describe:'Set HTTP headers for SSE and HTTP transports (e.g. -H "X-Api-Key: abc123" -H "Authorization: Bearer abc123")',type:"array",string:true,nargs:1}).option("timeout",{describe:"Set connection timeout in milliseconds",type:"number"}).option("trust",{describe:"Trust the server (bypass its tool call confirmations in a trusted workspace)",type:"boolean"}).option("description",{describe:"Set the description for the server",type:"string"}).option("include-tools",{describe:"A comma-separated list of tools to include",type:"array",string:true}).option("exclude-tools",{describe:"A comma-separated list of tools to exclude",type:"array",string:true}).option("oauth-client-id",{describe:"OAuth client ID for MCP server authentication",type:"string"}).option("oauth-client-secret",{describe:"OAuth client secret for MCP server authentication",type:"string"}).option("oauth-redirect-uri",{describe:"OAuth redirect URI (e.g., https://your-server.com/oauth/callback). Defaults to localhost for local setups.",type:"string"}).option("oauth-authorization-url",{describe:"OAuth authorization URL",type:"string"}).option("oauth-token-url",{describe:"OAuth token URL",type:"string"}).option("oauth-scopes",{describe:"OAuth scopes (comma-separated)",type:"array",string:true}).middleware(argv=>{if(argv["--"]){const existingArgs=argv["args"]||[];argv["args"]=[...existingArgs,...argv["--"]]}if(!argv["transport"]){const commandOrUrl=argv["commandOrUrl"];if(commandOrUrl&&/^https?:\/\//i.test(commandOrUrl)){argv["transport"]="http"}else{argv["transport"]="stdio"}}}),"builder"),handler:__name(async argv=>{await addMcpServer(argv["name"],argv["commandOrUrl"],argv["args"],{scope:argv["scope"],transport:argv["transport"],env:argv["env"],header:argv["header"],timeout:argv["timeout"],trust:argv["trust"],description:argv["description"],includeTools:splitCommaList(argv["includeTools"]),excludeTools:splitCommaList(argv["excludeTools"]),oauthClientId:argv["oauthClientId"],oauthClientSecret:argv["oauthClientSecret"],oauthRedirectUri:argv["oauthRedirectUri"],oauthAuthorizationUrl:argv["oauthAuthorizationUrl"],oauthTokenUrl:argv["oauthTokenUrl"],oauthScopes:argv["oauthScopes"]})},"handler")};init_esbuild_shims();async function removeMcpServer(name,options){const{scope}=options;const settingsScope=scope==="user"?"User":"Workspace";const settings=loadSettings();const existingSettings=settings.forScope(settingsScope).settings;const mcpServers=existingSettings.mcpServers||{};if(!mcpServers[name]){writeStdoutLine(`Server "${name}" not found in ${scope} settings.`);return}delete mcpServers[name];settings.setValue(settingsScope,"mcpServers",mcpServers);try{const tokenStorage=new MCPOAuthTokenStorage;await tokenStorage.deleteCredentials(name)}catch{}writeStdoutLine(`Server "${name}" removed from ${scope} settings.`)}__name(removeMcpServer,"removeMcpServer");var removeCommand={command:"remove <name>",describe:"Remove a server",builder:__name(yargs=>yargs.usage("Usage: qwen mcp remove [options] <name>").positional("name",{describe:"Name of the server",type:"string",demandOption:true}).option("scope",{alias:"s",describe:"Configuration scope (user or project)",type:"string",default:"user",choices:["user","project"]}),"builder"),handler:__name(async argv=>{await removeMcpServer(argv["name"],{scope:argv["scope"]})},"handler")};init_esbuild_shims();init_esbuild_shims();function assembleMcpServers(mergedSettingsServers,cwd,cliMcpServers){const belowProject={};const aboveProject={};for(const[name,config]of Object.entries(mergedSettingsServers??{})){if(config.scope==="workspace"||config.scope==="system"){aboveProject[name]=config}else{belowProject[name]=config}}const projectResult=loadProjectMcpServers(cwd);for(const error of projectResult.errors){writeStderrLine(`Warning: ${error}`)}return{...belowProject,...projectResult.servers,...aboveProject,...cliMcpServers??{}}}__name(assembleMcpServers,"assembleMcpServers");init_esbuild_shims();import*as fs from"node:fs";import*as os from"node:os";import*as path from"node:path";var import_strip_json_comments=__toESM(require_strip_json_comments(),1);var MCP_APPROVALS_FILENAME="mcpApprovals.json";function getMcpApprovalsPath(){if(process.env["QWEN_CODE_MCP_APPROVALS_PATH"]){return process.env["QWEN_CODE_MCP_APPROVALS_PATH"]}return path.join(Storage.getGlobalQwenDir(),MCP_APPROVALS_FILENAME)}__name(getMcpApprovalsPath,"getMcpApprovalsPath");function isApprovalRecordMap(value){return typeof value==="object"&&value!==null&&!Array.isArray(value)}__name(isApprovalRecordMap,"isApprovalRecordMap");function isWin32AbsolutePath(p){return/^[A-Za-z]:[\\/]/.test(p)||/^\\\\/.test(p)}__name(isWin32AbsolutePath,"isWin32AbsolutePath");function mergeApprovalRecords(existing,incoming){const merged=Object.assign(Object.create(null),existing);for(const[name,record]of Object.entries(incoming)){if(!isApprovalRecordMap(record)){continue}const current=merged[name];if(!current){merged[name]=record}else if(current.status!==record.status){merged[name]=current.status==="rejected"?current:record}}return merged}__name(mergeApprovalRecords,"mergeApprovalRecords");function normalizeStoredProjectKeys(config){if(os.platform()!=="win32"){return config}const normalized=Object.create(null);for(const[key,value]of Object.entries(config)){const projectKey=isWin32AbsolutePath(key)?key.toLowerCase():key;const existing=normalized[projectKey];normalized[projectKey]=isApprovalRecordMap(existing)&&isApprovalRecordMap(value)?mergeApprovalRecords(existing,value):isApprovalRecordMap(value)||!isApprovalRecordMap(existing)?value:existing}return normalized}__name(normalizeStoredProjectKeys,"normalizeStoredProjectKeys");var LoadedMcpApprovals=class{constructor(file,errors){this.file=file;this.errors=errors}static{__name(this,"LoadedMcpApprovals")}getState(projectRoot,serverName,config){const record=this.file.config[normalizeProjectRoot(projectRoot)]?.[serverName];if(!record){return"pending"}if(record.hash!==hashMcpServerConfig(config)){return"pending"}return record.status}async setState(projectRoot,serverName,config,status){const root=normalizeProjectRoot(projectRoot);const existing=this.file.config[root];const project=isApprovalRecordMap(existing)?existing:Object.create(null);Object.defineProperty(project,serverName,{value:{hash:hashMcpServerConfig(config),status},enumerable:true,configurable:true,writable:true});this.file.config[root]=project;await saveMcpApprovals(this.file)}};var loadedMcpApprovals;function loadMcpApprovals(){if(loadedMcpApprovals){return loadedMcpApprovals}const errors=[];let config={};const filePath=getMcpApprovalsPath();try{if(fs.existsSync(filePath)){const content=fs.readFileSync(filePath,"utf-8");const parsed=JSON.parse((0,import_strip_json_comments.default)(content));if(typeof parsed!=="object"||parsed===null||Array.isArray(parsed)){errors.push({message:"MCP approvals file is not a valid JSON object.",path:filePath})}else{config=normalizeStoredProjectKeys(parsed)}}}catch(error){errors.push({message:getErrorMessage(error),path:filePath})}loadedMcpApprovals=new LoadedMcpApprovals({path:filePath,config},errors);for(const error of errors){writeStderrLine(`Warning: MCP approvals file error: ${error.message}`)}return loadedMcpApprovals}__name(loadMcpApprovals,"loadMcpApprovals");function getPendingGatedMcpServers(mcpServers,projectRoot){const approvals=loadMcpApprovals();const pending=[];for(const[name,config]of Object.entries(mcpServers)){if(!isGatedMcpScope(config.scope)){continue}if(approvals.getState(projectRoot,name,config)!=="approved"){pending.push(name)}}return pending}__name(getPendingGatedMcpServers,"getPendingGatedMcpServers");function getPromptableMcpServers(mcpServers,projectRoot){const approvals=loadMcpApprovals();const promptable=[];for(const[name,config]of Object.entries(mcpServers)){if(!isGatedMcpScope(config.scope)){continue}if(approvals.getState(projectRoot,name,config)==="pending"){promptable.push(name)}}return promptable}__name(getPromptableMcpServers,"getPromptableMcpServers");async function saveMcpApprovals(file){try{const dirPath=path.dirname(file.path);if(!fs.existsSync(dirPath)){fs.mkdirSync(dirPath,{recursive:true})}await atomicWriteFile(file.path,JSON.stringify(file.config,null,2),{mode:384})}catch(error){writeStderrLine("Error saving MCP approvals file.");writeStderrLine(error instanceof Error?error.message:String(error))}}__name(saveMcpApprovals,"saveMcpApprovals");var COLOR_GREEN="\x1B[32m";var COLOR_YELLOW="\x1B[33m";var COLOR_RED="\x1B[31m";var RESET_COLOR="\x1B[0m";var MCP_CONNECT_TIMEOUT_MS=1e4;async function getMcpServersFromConfig(){const settings=loadSettings();const extensionManager=new ExtensionManager({isWorkspaceTrusted:isWorkspaceTrusted(settings.merged).isTrusted??true,telemetrySettings:settings.merged.telemetry,locale:getCurrentLanguage()});await extensionManager.refreshCache();const extensions=extensionManager.getLoadedExtensions();const mcpServers=assembleMcpServers(settings.merged.mcpServers,process.cwd());for(const extension of extensions){if(extension.isActive){Object.entries(extension.config.mcpServers||{}).forEach(([key,server])=>{if(mcpServers[key]){return}mcpServers[key]={...server,extensionName:extension.config.name}})}}return mcpServers}__name(getMcpServersFromConfig,"getMcpServersFromConfig");async function testMCPConnection(serverName,config){const client=createMcpClient("mcp-test-client",config);let transport;try{transport=await createTransport(serverName,config,false)}catch(_error){await client.close();return{status:"disconnected",timedOut:false}}try{await runWithTimeout(client.connect(transport,{timeout:MCP_CONNECT_TIMEOUT_MS}),MCP_CONNECT_TIMEOUT_MS,`MCP connection for ${serverName}`);await client.close();return{status:"connected",timedOut:false}}catch(error){await transport.close();return{status:"disconnected",timedOut:error instanceof Error&&error.message.startsWith("Timed out after ")}}}__name(testMCPConnection,"testMCPConnection");async function getServerStatus(serverName,server){return await testMCPConnection(serverName,server)}__name(getServerStatus,"getServerStatus");async function listMcpServers(){const mcpServers=await getMcpServersFromConfig();const serverNames=Object.keys(mcpServers);if(serverNames.length===0){writeStdoutLine("No MCP servers configured.");return}writeStdoutLine("Configured MCP servers:\n");const cwd=process.cwd();let approvals;for(const serverName of serverNames){const server=mcpServers[serverName];let serverInfo=`${serverName}: `;if(server.httpUrl){serverInfo+=`${server.httpUrl} (http)`}else if(server.url){serverInfo+=`${server.url} (sse)`}else if(server.command){serverInfo+=`${server.command} ${server.args?.join(" ")||""} (stdio)`}if(isGatedMcpScope(server.scope)){approvals??=loadMcpApprovals();const state=approvals.getState(cwd,serverName,server);if(state!=="approved"){const statusText2=state==="rejected"?"Rejected":"Pending approval";writeStdoutLine(`${COLOR_YELLOW}\u25CF${RESET_COLOR} ${serverInfo} - ${statusText2}`);continue}}const{status,timedOut}=await getServerStatus(serverName,server);let statusIndicator="";let statusText="";switch(status){case"connected":statusIndicator=COLOR_GREEN+"\u2713"+RESET_COLOR;statusText="Connected";break;case"connecting":statusIndicator=COLOR_YELLOW+"\u2026"+RESET_COLOR;statusText="Connecting";break;case"disconnected":default:statusIndicator=COLOR_RED+"\u2717"+RESET_COLOR;statusText=timedOut?`Disconnected (timed out after ${MCP_CONNECT_TIMEOUT_MS}ms)`:"Disconnected";break}writeStdoutLine(`${statusIndicator} ${serverInfo} - ${statusText}`)}}__name(listMcpServers,"listMcpServers");var listCommand={command:"list",describe:"List all configured MCP servers",handler:__name(async()=>{await listMcpServers()},"handler")};init_esbuild_shims();async function getMcpServersFromConfig2(extensionManager){const settings=loadSettings();const extManager=extensionManager??new ExtensionManager({isWorkspaceTrusted:isWorkspaceTrusted(settings.merged).isTrusted??true,telemetrySettings:settings.merged.telemetry,locale:getCurrentLanguage()});if(!extensionManager){await extManager.refreshCache()}const extensions=extManager.getLoadedExtensions();const mcpServers=assembleMcpServers(settings.merged.mcpServers,process.cwd());for(const extension of extensions){if(extension.isActive){Object.entries(extension.config.mcpServers||{}).forEach(([key,server])=>{if(mcpServers[key]){return}mcpServers[key]={...server,extensionName:extension.config.name}})}}return mcpServers}__name(getMcpServersFromConfig2,"getMcpServersFromConfig");async function createMinimalConfig(){const settings=loadSettings();const cwd=process.cwd();const fileFiltering=settings.merged.context?.fileFiltering;const fileService=new FileDiscoveryService(cwd,fileFiltering?.customIgnoreFiles);const mcpServers=await getMcpServersFromConfig2();const allowedMcpServers=settings.merged.mcp?.allowed?new Set(settings.merged.mcp.allowed.filter(Boolean)):void 0;const excludedMcpServers=settings.merged.mcp?.excluded?new Set(settings.merged.mcp.excluded.filter(Boolean)):void 0;const config=new Config({sessionId:"mcp-reconnect",targetDir:cwd,cwd,debugMode:false,chatRecording:false,mcpServers,pendingMcpServers:getPendingGatedMcpServers(mcpServers,cwd),fileDiscoveryService:fileService,mcpServerCommand:settings.merged.mcp?.serverCommand,allowedMcpServers:allowedMcpServers?Array.from(allowedMcpServers):void 0,excludedMcpServers:excludedMcpServers?Array.from(excludedMcpServers):void 0,trustedFolder:isWorkspaceTrusted(settings.merged).isTrusted??true,usageStatisticsEnabled:parseBooleanEnvFlag(process.env["QWEN_USAGE_STATISTICS_ENABLED"])??settings.merged.privacy?.usageStatisticsEnabled??true,modelCatalogRefreshEnabled:typeof settings.merged.model?.catalogRefresh==="boolean"?settings.merged.model.catalogRefresh:void 0,proxy:settings.merged.proxy||process.env["HTTPS_PROXY"]||process.env["https_proxy"]||process.env["HTTP_PROXY"]||process.env["http_proxy"],...fileFiltering!==void 0?{fileFiltering}:{}});await config.initialize({skipMcpDiscovery:true,skipFileWatching:true,skipLlmInitialization:true});return config}__name(createMinimalConfig,"createMinimalConfig");var SkippedConnectionError=class extends Error{static{__name(this,"SkippedConnectionError")}skipReason;constructor(skipReason){super(`no connection attempt was made: ${skipReason}`);this.name="SkippedConnectionError";this.skipReason=skipReason}};var SESSION_SCOPE_NOTE="Note: this command reconnects in a separate process; it cannot refresh the MCP tools of an already-running MiraOS session. Restart that session if its tools remain unavailable.";function createReconnectError(message,exitCode=1){const error=new Error(message);error.exitCode=exitCode;return error}__name(createReconnectError,"createReconnectError");function describeSkippedConnectionReason(config,serverName){const unavailableReason=config.getMcpServerUnavailableReason(serverName);if(unavailableReason==="excluded"){return"server is excluded in settings (mcp.excluded)"}if(unavailableReason==="not_allowed"){return"server is not in the mcp.allowed list"}if(config.isMcpServerDisabled(serverName)){return"server is disabled in settings"}if(config.isMcpServerPendingApproval(serverName)){return"server is pending approval (.mcp.json)"}if(config.isTrustedFolder()===false){return"workspace folder is not trusted"}return void 0}__name(describeSkippedConnectionReason,"describeSkippedConnectionReason");async function discoverAndVerifyConnection(config,serverName){const toolRegistry=config.getToolRegistry();await toolRegistry.discoverToolsForServer(serverName);const status=getMCPServerStatus(serverName);if(status!=="connected"){const skippedReason=describeSkippedConnectionReason(config,serverName);if(skippedReason){throw new SkippedConnectionError(skippedReason)}const lastError=getMCPServerLastError(serverName);throw new Error(`connection attempt finished without a live connection (status: ${status})`+(lastError?`: ${lastError}`:""))}}__name(discoverAndVerifyConnection,"discoverAndVerifyConnection");async function reconnectMcpServer(serverName){const mcpServers=await getMcpServersFromConfig2();if(!mcpServers[serverName]){throw createReconnectError(`Error: Server "${serverName}" not found in configuration.`)}writeStdoutLine(`Reconnecting to server "${serverName}"...`);let config;try{config=await createMinimalConfig();await discoverAndVerifyConnection(config,serverName);writeStdoutLine(`Successfully reconnected to server "${serverName}".`);writeStdoutLine(SESSION_SCOPE_NOTE)}catch(error){const message=error instanceof Error?error.message:String(error);writeStdoutLine(SESSION_SCOPE_NOTE);throw createReconnectError(`Failed to reconnect to server "${serverName}": ${message}`)}finally{if(config){await config.shutdown()}}}__name(reconnectMcpServer,"reconnectMcpServer");async function reconnectAllMcpServers(){const settings=loadSettings();const extensionManager=new ExtensionManager({isWorkspaceTrusted:isWorkspaceTrusted(settings.merged).isTrusted??true,telemetrySettings:settings.merged.telemetry,locale:getCurrentLanguage()});await extensionManager.refreshCache();const mcpServers=await getMcpServersFromConfig2(extensionManager);const serverNames=Object.keys(mcpServers);if(serverNames.length===0){writeStdoutLine("No MCP servers configured.");return}writeStdoutLine("Reconnecting to all MCP servers...\n");let config;let failedCount=0;try{config=await createMinimalConfig();for(const serverName of serverNames){try{await discoverAndVerifyConnection(config,serverName);writeStdoutLine(`\u2713 ${serverName}: Reconnected successfully`)}catch(error){if(error instanceof SkippedConnectionError){writeStdoutLine(`- ${serverName}: Skipped - ${error.skipReason}`);continue}failedCount++;const message=error instanceof Error?error.message:String(error);writeStdoutLine(`\u2717 ${serverName}: Failed - ${message}`)}}writeStdoutLine("");writeStdoutLine(SESSION_SCOPE_NOTE)}finally{if(config){await config.shutdown()}}if(failedCount>0){throw createReconnectError(`Failed to reconnect ${failedCount} of ${serverNames.length} configured server(s).`)}}__name(reconnectAllMcpServers,"reconnectAllMcpServers");var reconnectCommand={command:"reconnect [server-name]",describe:"Reconnect MCP server(s)",builder:__name(yargs=>yargs.usage("Usage: qwen mcp reconnect [options] [server-name]").positional("server-name",{describe:"Name of the server to reconnect",type:"string"}).option("all",{alias:"a",describe:"Reconnect all configured servers",type:"boolean",default:false}).conflicts("server-name","all").check(argv=>{const serverName=argv["server-name"];const all=argv["all"];if(!serverName&&!all){throw new Error("Please specify a server name or use --all to reconnect all servers.")}return true}),"builder"),handler:__name(async argv=>{const serverName=argv["server-name"];const all=argv["all"];try{if(all){await reconnectAllMcpServers()}else if(serverName){await reconnectMcpServer(serverName)}}catch(error){const message=error instanceof Error?error.message:String(error);const exitCode=error?.exitCode??1;writeStderrLine(message);process.exit(exitCode)}},"handler")};init_esbuild_shims();function loadGatedServers(cwd){const settings=loadSettings(cwd);const all=assembleMcpServers(settings.merged.mcpServers,cwd);const gated={};for(const[serverName,config]of Object.entries(all)){if(isGatedMcpScope(config.scope)){gated[serverName]=config}}return gated}__name(loadGatedServers,"loadGatedServers");async function setProjectServerStatus(name,status,all){const cwd=process.cwd();const servers=loadGatedServers(cwd);const names=Object.keys(servers);if(names.length===0){writeStdoutLine("No approval-requiring MCP servers found (looked in .mcp.json and .qwen/settings.json).");return}const verb=status==="approved"?"Approved":"Rejected";const approvals=loadMcpApprovals();const targets=all?names:name?[name]:[];if(targets.length===0){writeStdoutLine("Specify a server name or pass --all.");return}for(const target of targets){const config=servers[target];if(!config){writeStdoutLine(`Server "${target}" not found. Available: ${names.join(", ")}`);continue}await approvals.setState(cwd,target,config,status);writeStdoutLine(`${verb} MCP server "${target}" (bound to its current config).`)}if(status==="approved"){writeStdoutLine("Approved servers connect in your next interactive session.")}}__name(setProjectServerStatus,"setProjectServerStatus");var approveCommand={command:"approve [name]",describe:"Approve a gated MCP server (.mcp.json or workspace .qwen/settings.json)",builder:__name(yargs=>yargs.usage("Usage: qwen mcp approve [options] [name]").positional("name",{describe:"Name of the gated server to approve",type:"string"}).option("all",{describe:"Approve all gated servers in this workspace",type:"boolean",default:false}),"builder"),handler:__name(async argv=>{await setProjectServerStatus(argv["name"],"approved",argv["all"])},"handler")};var rejectCommand={command:"reject [name]",describe:"Reject a gated MCP server (.mcp.json or workspace .qwen/settings.json)",builder:__name(yargs=>yargs.usage("Usage: qwen mcp reject [options] [name]").positional("name",{describe:"Name of the gated server to reject",type:"string"}).option("all",{describe:"Reject all gated servers in this workspace",type:"boolean",default:false}),"builder"),handler:__name(async argv=>{await setProjectServerStatus(argv["name"],"rejected",argv["all"])},"handler")};var mcpCommand={command:"mcp",describe:"Manage MCP servers",builder:__name(yargs=>yargs.command(addCommand).command(removeCommand).command(listCommand).command(reconnectCommand).command(approveCommand).command(rejectCommand).demandCommand(1,"You need at least one command before continuing.").version(false),"builder"),handler:__name(()=>{},"handler")};export{assembleMcpServers,loadMcpApprovals,getPendingGatedMcpServers,getPromptableMcpServers,mcpCommand};
4
4
  /**
5
5
  * @license
6
6
  * Copyright 2025 Google LLC