@qwen-code/qwen-code 0.22.3 → 0.23.0

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 (497) hide show
  1. package/README.md +30 -0
  2. package/bundled/computer-use/SKILL.md +116 -180
  3. package/bundled/goal-draft/SKILL.md +5 -1
  4. package/bundled/qc-helper/docs/common-workflow.md +32 -0
  5. package/bundled/qc-helper/docs/configuration/auth.md +6 -6
  6. package/bundled/qc-helper/docs/configuration/model-providers.md +8 -2
  7. package/bundled/qc-helper/docs/configuration/settings.md +63 -58
  8. package/bundled/qc-helper/docs/extension/introduction.md +1 -1
  9. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  10. package/bundled/qc-helper/docs/features/approval-mode.md +3 -0
  11. package/bundled/qc-helper/docs/features/auto-mode.md +34 -17
  12. package/bundled/qc-helper/docs/features/channels/dingtalk.md +4 -2
  13. package/bundled/qc-helper/docs/features/channels/dws.md +6 -2
  14. package/bundled/qc-helper/docs/features/channels/overview.md +5 -2
  15. package/bundled/qc-helper/docs/features/code-review.md +2 -2
  16. package/bundled/qc-helper/docs/features/commands.md +79 -1
  17. package/bundled/qc-helper/docs/features/computer-use.md +2 -2
  18. package/bundled/qc-helper/docs/features/goals.md +9 -3
  19. package/bundled/qc-helper/docs/features/headless.md +16 -1
  20. package/bundled/qc-helper/docs/features/hooks.md +8 -3
  21. package/bundled/qc-helper/docs/features/memory.md +1 -0
  22. package/bundled/qc-helper/docs/features/output-styles.md +38 -0
  23. package/bundled/qc-helper/docs/qwen-serve-deploy-local.md +17 -7
  24. package/bundled/qc-helper/docs/qwen-serve.md +74 -55
  25. package/bundled/review/SKILL.md +16 -7
  26. package/bundled/review/references/posting.md +3 -3
  27. package/chunks/MaxSizedBox-B3D7545A.js +111 -0
  28. package/chunks/{StandaloneSessionPicker-2FJAOLGG.js → StandaloneSessionPicker-QUMO4LLQ.js} +88 -86
  29. package/chunks/{acp-startup-profiler-GNYAL6LI.js → acp-startup-profiler-M4X5F3VK.js} +2 -2
  30. package/chunks/{acpAgent-2ZMIJAFV.js → acpAgent-2GTFCIEP.js} +2041 -444
  31. package/chunks/{agent-X5WX3L2I.js → agent-XKF5SZWU.js} +46 -46
  32. package/chunks/agent-headless-OC2IB55D.js +85 -0
  33. package/chunks/{anthropicContentGenerator-YVTB6QX7.js → anthropicContentGenerator-L76MR5OR.js} +53 -20
  34. package/chunks/{artifact-tool-XSMPHZBT.js → artifact-tool-MYCL2QCS.js} +3 -4
  35. package/chunks/{askUserQuestion-4SWJY65V.js → askUserQuestion-THQZMG44.js} +45 -7
  36. package/chunks/bridge-IHSBI2YJ.js +118 -0
  37. package/chunks/{build-INBK7IXX.js → build-63BIOYWK.js} +1 -1
  38. package/chunks/{ca-7HPYOYSZ.js → ca-BNU7YNDE.js} +3 -0
  39. package/chunks/{channel-management-service-HQ6KDS7C.js → channel-management-service-4MTCEGJB.js} +4 -4
  40. package/chunks/channel-settings-store-BVKWAI2T.js +121 -0
  41. package/chunks/{channel-worker-group-6NA6BBZV.js → channel-worker-group-47F4ISUZ.js} +7 -7
  42. package/chunks/{channel-worker-manager-NEZ2J6RK.js → channel-worker-manager-I5Y44GYR.js} +51 -10
  43. package/chunks/{channel-worker-supervisor-FKU7DIHJ.js → channel-worker-supervisor-6VCLUXFE.js} +4 -4
  44. package/chunks/{chunk-PPKZ7JOE.js → chunk-22UH7VTP.js} +1 -1
  45. package/chunks/chunk-24FVUD5P.js +49 -0
  46. package/chunks/{chunk-MZCJWS5Y.js → chunk-2M3EWQNG.js} +20 -0
  47. package/chunks/{chunk-7T52W4SW.js → chunk-32LU3APX.js} +1 -1
  48. package/chunks/{chunk-42IDLQWS.js → chunk-373DQUVA.js} +48 -13
  49. package/chunks/{chunk-MSBO7X2W.js → chunk-37JFWFCD.js} +1 -1
  50. package/chunks/{chunk-3JXM2CVW.js → chunk-3AKCBZVW.js} +3 -3
  51. package/chunks/{chunk-TVC6HQ2U.js → chunk-3JQZVCBI.js} +2 -2
  52. package/chunks/{chunk-2LNNVAUV.js → chunk-3L724BJ5.js} +246 -15
  53. package/chunks/{chunk-E7REAOTN.js → chunk-47ECGEJC.js} +4 -0
  54. package/chunks/{chunk-WNPDGUJO.js → chunk-47RYEQW5.js} +2 -3
  55. package/chunks/{chunk-TZBSGJ6C.js → chunk-4BGDFKQE.js} +7 -7
  56. package/chunks/{chunk-PZ66FRIC.js → chunk-4F7GQGXB.js} +11772 -4773
  57. package/chunks/{chunk-DMLVSW7L.js → chunk-4HVH57J3.js} +713 -9
  58. package/chunks/{chunk-CMHFCLBU.js → chunk-4LIFGNI4.js} +1 -1
  59. package/chunks/{chunk-3SZC4VP4.js → chunk-4M24B5J5.js} +88 -49
  60. package/chunks/{chunk-BOWFGCEU.js → chunk-4PSDSCW3.js} +3 -3
  61. package/chunks/chunk-4UANMABT.js +1026 -0
  62. package/chunks/{chunk-M3QRM3DE.js → chunk-54C6PIGT.js} +5 -5
  63. package/chunks/{chunk-HP5LR5HL.js → chunk-5EIOJGCR.js} +4 -4
  64. package/chunks/{chunk-64REQJJ2.js → chunk-5H5S4UY5.js} +3 -3
  65. package/chunks/chunk-5IENVM7Z.js +35 -0
  66. package/chunks/{chunk-I6LYRJPB.js → chunk-5Q5RC2WE.js} +2 -2
  67. package/chunks/{chunk-WGY3AVGM.js → chunk-5RTTI4GE.js} +79 -5
  68. package/chunks/{chunk-KID24ZFN.js → chunk-64QH2UC6.js} +13 -1
  69. package/chunks/{chunk-MF7HCQWZ.js → chunk-65HWLGA7.js} +3 -3
  70. package/chunks/{chunk-OU5APVWO.js → chunk-6A2D4QSO.js} +13 -7
  71. package/chunks/chunk-6HUXPLB5.js +110 -0
  72. package/chunks/{chunk-VQUGEVGR.js → chunk-7IKXTGZT.js} +1 -1
  73. package/chunks/{chunk-UTLCH2FK.js → chunk-7JMGTOH7.js} +437 -136
  74. package/chunks/{chunk-7LOELM2I.js → chunk-7RB56BRJ.js} +3 -3
  75. package/chunks/{chunk-NIFYWDYN.js → chunk-7TBU7PU2.js} +1 -1
  76. package/chunks/{chunk-V2NDP3I4.js → chunk-7XL4WRXM.js} +2 -2
  77. package/chunks/chunk-ADJD4LZF.js +210 -0
  78. package/chunks/{chunk-T7KMERIX.js → chunk-ADYN7P2Y.js} +2 -2
  79. package/chunks/{chunk-TPI7O7HR.js → chunk-AHYTURFB.js} +1 -1
  80. package/chunks/{chunk-LUEHOUHM.js → chunk-AI35S34R.js} +3 -3
  81. package/chunks/{chunk-CIZCL2MW.js → chunk-ALUYNJPM.js} +1486 -2172
  82. package/chunks/{chunk-ABS25QER.js → chunk-ANVG3BVV.js} +1 -1
  83. package/chunks/{chunk-6ZPDLGHN.js → chunk-AZJLY2XZ.js} +5 -5
  84. package/chunks/{chunk-A3LWD5MK.js → chunk-BA4WJC4L.js} +1 -1
  85. package/chunks/{chunk-W3JH33JE.js → chunk-BFY33IB4.js} +18 -10
  86. package/chunks/{chunk-N4X7G4J2.js → chunk-BHTYRHJF.js} +1 -1
  87. package/chunks/{chunk-TEBDFQBZ.js → chunk-BJXCYUGM.js} +11 -6
  88. package/chunks/{chunk-7VMIMAVB.js → chunk-C2VWOXHS.js} +8 -8
  89. package/chunks/{chunk-XHF7WQ6B.js → chunk-C4TIXFDZ.js} +16 -5
  90. package/chunks/chunk-CHEIIBT3.js +40 -0
  91. package/chunks/chunk-CVX63TFJ.js +348 -0
  92. package/chunks/{chunk-RXFQM6FQ.js → chunk-DMEUXLSS.js} +16 -1
  93. package/chunks/{chunk-EKSCLBBF.js → chunk-DQCKVAF5.js} +23 -5
  94. package/chunks/{chunk-734C6JGI.js → chunk-DSX7KQPM.js} +5195 -666
  95. package/chunks/{chunk-4CMJKUND.js → chunk-DTVQSSNM.js} +67 -2
  96. package/chunks/{chunk-BKWNKLZB.js → chunk-DYTW3QVG.js} +24 -9
  97. package/chunks/{chunk-C2X7KY45.js → chunk-E4JNFXNI.js} +3 -3
  98. package/chunks/{chunk-UHQFIS7N.js → chunk-EAHOJF6V.js} +28 -4
  99. package/chunks/{chunk-YLSQLSH7.js → chunk-EBDGRBZX.js} +24 -16
  100. package/chunks/{chunk-DJBQCO2E.js → chunk-EFTPIZIC.js} +412 -3
  101. package/chunks/{chunk-6DIGWMGT.js → chunk-EIJT2PQ6.js} +2 -2
  102. package/chunks/{chunk-4TT3IVGA.js → chunk-EIY7SUPZ.js} +1 -1
  103. package/chunks/{chunk-XQFT3QUF.js → chunk-ENYUKMFK.js} +1 -1
  104. package/chunks/{chunk-ZWJDJ6RU.js → chunk-EVFDRBUM.js} +157 -153
  105. package/chunks/{chunk-4VPCTGH6.js → chunk-EWRW2WQC.js} +15 -9
  106. package/chunks/{chunk-VBCPNIQD.js → chunk-F33GFWPR.js} +47 -184
  107. package/chunks/{chunk-ERFDKH32.js → chunk-F47DITLZ.js} +19 -8
  108. package/chunks/{chunk-73RM4POK.js → chunk-F7NF2IOE.js} +7 -7
  109. package/chunks/{chunk-EB6QRGHM.js → chunk-FD5SJOWT.js} +10 -7
  110. package/chunks/{chunk-SS5SDCD3.js → chunk-FRICLXCZ.js} +7 -7
  111. package/chunks/{chunk-NU7RKEZR.js → chunk-FUO5V5KI.js} +14 -7
  112. package/chunks/{chunk-G6FECKTJ.js → chunk-G5PBOQWI.js} +9 -6
  113. package/chunks/{chunk-CAJTKR6W.js → chunk-G7HBEEX7.js} +15 -9
  114. package/chunks/{chunk-4QHPPXK2.js → chunk-GB4UKWY5.js} +2 -2
  115. package/chunks/{chunk-QYMAKPY5.js → chunk-GH2S4GD5.js} +350 -12
  116. package/chunks/{chunk-LHBUKJG2.js → chunk-GXUTFQXK.js} +28 -25
  117. package/chunks/{chunk-KJO2LBUK.js → chunk-H43PSPYS.js} +5 -5
  118. package/chunks/{chunk-XSG6G3G6.js → chunk-HJBHMANB.js} +12 -14
  119. package/chunks/chunk-HRPFBHW7.js +336 -0
  120. package/chunks/{chunk-6PJOTWAN.js → chunk-HT5S5TRQ.js} +1 -1
  121. package/chunks/{chunk-HCOBAG2L.js → chunk-HWVUSYSN.js} +3 -8
  122. package/chunks/{chunk-2OUD5T67.js → chunk-I2TMJPCV.js} +213 -185
  123. package/chunks/{chunk-CLWO3B77.js → chunk-I4NRYS6A.js} +11 -11
  124. package/chunks/{chunk-V7EESTJV.js → chunk-I5N4EAS6.js} +1 -1
  125. package/chunks/{chunk-K5KXUXWC.js → chunk-IG4W5SJR.js} +3 -3
  126. package/chunks/{chunk-FROAFEFB.js → chunk-IPATA3T2.js} +3 -3
  127. package/chunks/{chunk-NKLP3DCK.js → chunk-IQAFKVXS.js} +1 -1
  128. package/chunks/{chunk-AYHQZBJ4.js → chunk-IRKQ4YYX.js} +3 -3
  129. package/chunks/{chunk-J3NNHTV6.js → chunk-J5TTWBZK.js} +6 -0
  130. package/chunks/{chunk-QFCDF5PL.js → chunk-JHN7UIDW.js} +1 -1
  131. package/chunks/{chunk-AVNATYLY.js → chunk-JJKNYRFY.js} +1 -1
  132. package/chunks/{chunk-CQH5KTKC.js → chunk-JR42V4UY.js} +1 -1
  133. package/chunks/chunk-JS73NNWF.js +30 -0
  134. package/chunks/{chunk-NV55WWD6.js → chunk-JUARRUMA.js} +802 -2011
  135. package/chunks/chunk-JX6XHPTX.js +26 -0
  136. package/chunks/{chunk-5JTIYALA.js → chunk-JZWOCUZ3.js} +1 -1
  137. package/chunks/{chunk-P2G476QN.js → chunk-KEVYJSI4.js} +13 -13
  138. package/chunks/{chunk-B466ZSHZ.js → chunk-KFN2IZYR.js} +3 -3
  139. package/chunks/{chunk-JWALNCLT.js → chunk-KGV55H53.js} +1 -1
  140. package/chunks/{chunk-23RFD54N.js → chunk-KHP66DFN.js} +1 -1
  141. package/chunks/{chunk-2SXSLSQE.js → chunk-KM3XVTMO.js} +12 -6
  142. package/chunks/{chunk-GPGU4S2N.js → chunk-KMU3ZHH4.js} +3 -3
  143. package/chunks/chunk-KOGW3YWJ.js +2054 -0
  144. package/chunks/{chunk-NMOD2FXQ.js → chunk-L26ONV2Y.js} +8 -8
  145. package/chunks/chunk-L34XSHIZ.js +28 -0
  146. package/chunks/{chunk-SEONHUS3.js → chunk-LAUEEBDL.js} +2 -0
  147. package/chunks/{chunk-3WK3QDNV.js → chunk-LB3WQQJK.js} +2 -2
  148. package/chunks/{chunk-URE3QBBB.js → chunk-LEPCWS5A.js} +3 -3
  149. package/chunks/{chunk-36GSQ3MM.js → chunk-LHBNR6EU.js} +2 -2
  150. package/chunks/{chunk-V4264FEG.js → chunk-LKODFJRD.js} +1 -1
  151. package/chunks/{chunk-PADPMMYM.js → chunk-LOBDDFYK.js} +5 -29
  152. package/chunks/{chunk-BXDAPVQU.js → chunk-LU77UT4D.js} +28 -4
  153. package/chunks/{chunk-RFIDDFAL.js → chunk-M4KFODIP.js} +1 -1
  154. package/chunks/{chunk-CFJY4DGX.js → chunk-M4LBBSVP.js} +4 -2
  155. package/chunks/{chunk-KYWTPLBJ.js → chunk-MOF6VZN2.js} +2 -2
  156. package/chunks/{chunk-DJPASAUV.js → chunk-MP6YZ4RK.js} +4829 -3638
  157. package/chunks/{chunk-T26EAKDL.js → chunk-N2TNM3QB.js} +2 -6
  158. package/chunks/{chunk-2TNL5KPM.js → chunk-N4QWUPDM.js} +7 -0
  159. package/chunks/{chunk-7S226YTK.js → chunk-NFIDVZND.js} +11 -1
  160. package/chunks/{chunk-ZEYFMJQA.js → chunk-NQ4L2CMD.js} +83 -18
  161. package/chunks/{chunk-ZZUKP7HV.js → chunk-NRL5CUZT.js} +1 -1
  162. package/chunks/{chunk-WXEA74YB.js → chunk-NSUKQ4DN.js} +9 -3
  163. package/chunks/chunk-NUHOLAQ6.js +59 -0
  164. package/chunks/{chunk-DJEZ55D4.js → chunk-NVVJTUSL.js} +336 -140
  165. package/chunks/{chunk-3XKLXHGK.js → chunk-NXKOVOM5.js} +9 -9
  166. package/chunks/{chunk-5Q372OFJ.js → chunk-O4KNCAX4.js} +57 -10
  167. package/chunks/{chunk-GOXKNSDZ.js → chunk-O5CD7T4T.js} +40 -9
  168. package/chunks/{chunk-XIQ5HQ2F.js → chunk-OBTWL6ZW.js} +1 -1
  169. package/chunks/{chunk-PDQGMSZK.js → chunk-ODZF64DM.js} +1 -1
  170. package/chunks/{chunk-5MK45KZ3.js → chunk-OHOO527W.js} +1 -1
  171. package/chunks/{chunk-36LGBEM6.js → chunk-OHU2H5CS.js} +1 -1
  172. package/chunks/{chunk-JB4JIVTJ.js → chunk-OKTNXDVO.js} +1 -1
  173. package/chunks/{chunk-CETB5XY4.js → chunk-ORFIYTI2.js} +1 -1
  174. package/chunks/{chunk-7E7UCJHS.js → chunk-OSHQMOBS.js} +18 -17
  175. package/chunks/chunk-OSSTATJF.js +1310 -0
  176. package/chunks/chunk-P6UIF2OW.js +400 -0
  177. package/chunks/{chunk-U54AYGEC.js → chunk-PB7JBAHF.js} +15 -49
  178. package/chunks/{chunk-Y5S7LBOZ.js → chunk-PCRBLMIN.js} +17 -3
  179. package/chunks/{chunk-WAOIHTJS.js → chunk-PDAKFU7M.js} +1 -1
  180. package/chunks/{chunk-YTDVNSUQ.js → chunk-QAK5475D.js} +1 -1
  181. package/chunks/{chunk-ST5MDGH3.js → chunk-QI27MKNQ.js} +27 -19
  182. package/chunks/{chunk-MK2GIB46.js → chunk-QJGYU5PG.js} +1 -1
  183. package/chunks/{chunk-SMPR7SPO.js → chunk-QJNDUTOL.js} +45 -239
  184. package/chunks/{chunk-MQM5PJML.js → chunk-QJVZLILI.js} +1 -1
  185. package/chunks/{chunk-B5PHIJGI.js → chunk-QKDNS6FU.js} +2 -2
  186. package/chunks/{chunk-ZU4UDIWX.js → chunk-QQD2GART.js} +15 -9
  187. package/chunks/{chunk-62GQFYID.js → chunk-RAFQIHN2.js} +3 -3
  188. package/chunks/{chunk-MO3FC2WT.js → chunk-RJUVTJEZ.js} +1 -1
  189. package/chunks/{chunk-M6FOJXW3.js → chunk-RKW36UWC.js} +1 -1
  190. package/chunks/{chunk-GBJBJ4HX.js → chunk-RM4WT2XB.js} +4 -26
  191. package/chunks/{chunk-VGIFXISB.js → chunk-RN3YGDCA.js} +7 -5
  192. package/chunks/{chunk-DYXFD5RO.js → chunk-S2T7H5MI.js} +1 -1
  193. package/chunks/{chunk-FTF2YIZ5.js → chunk-S6H3ELPG.js} +1 -1
  194. package/chunks/{chunk-4NDLQAY2.js → chunk-SI7WDR3U.js} +524 -16
  195. package/chunks/{chunk-2YOHKHYR.js → chunk-SRF4KTAG.js} +6 -6
  196. package/chunks/{chunk-ZZMSC3RG.js → chunk-STCVJXQB.js} +24 -24
  197. package/chunks/{chunk-ST5V3ZOC.js → chunk-SULZPKTA.js} +3 -3
  198. package/chunks/{chunk-6X7EU5TI.js → chunk-SX2QIMJV.js} +9 -7
  199. package/chunks/{chunk-V5J4J5TP.js → chunk-TJYRTS4S.js} +2 -20
  200. package/chunks/{chunk-C3PEFRKD.js → chunk-TMKTOTMQ.js} +5 -5
  201. package/chunks/{chunk-ISKH4QX3.js → chunk-TQHPVKO6.js} +4 -4
  202. package/chunks/{chunk-HVC3PNVC.js → chunk-TSZSGQ3N.js} +1 -1
  203. package/chunks/{chunk-ICURCKIU.js → chunk-U4DJ5XB3.js} +594 -91
  204. package/chunks/{chunk-TTX2JUE6.js → chunk-U6D2PPMN.js} +1 -1
  205. package/chunks/{chunk-GVIVASYK.js → chunk-UAKRDON5.js} +4 -4
  206. package/chunks/{chunk-D5LUXLUH.js → chunk-UJ4DUYIH.js} +18 -4
  207. package/chunks/{chunk-VTHREBQM.js → chunk-UKYXYWI2.js} +2 -2
  208. package/chunks/{chunk-ZYMLPEZQ.js → chunk-UM2FFKXN.js} +3 -3
  209. package/chunks/{chunk-2OBKDPZZ.js → chunk-UPFRILIL.js} +2 -2
  210. package/chunks/{chunk-2HYKTO7V.js → chunk-UUASLXHW.js} +55 -6
  211. package/chunks/chunk-V5U2NZNJ.js +29 -0
  212. package/chunks/{chunk-P5Y23G2L.js → chunk-V7RNNPGC.js} +1 -18
  213. package/chunks/{chunk-Q2MSPKIJ.js → chunk-VBWD6C27.js} +1 -1
  214. package/chunks/chunk-VGHZT6JR.js +51 -0
  215. package/chunks/{chunk-MPNBVAEU.js → chunk-VNAYZAFX.js} +4 -4
  216. package/chunks/chunk-VPSIC437.js +780 -0
  217. package/chunks/{chunk-AIAOIFY4.js → chunk-VWTSRH6C.js} +92 -17
  218. package/chunks/{chunk-4K7KNVWH.js → chunk-VYIUNFEA.js} +3 -3
  219. package/chunks/{chunk-EQSBPBZ3.js → chunk-WP4AX3XD.js} +5 -7
  220. package/chunks/{chunk-BFPESSTR.js → chunk-XEAAO654.js} +1 -1
  221. package/chunks/{chunk-RU7BK6B3.js → chunk-XLXAZLDR.js} +3 -3
  222. package/chunks/{chunk-EFWRMA2I.js → chunk-YPWZTR7F.js} +3 -3
  223. package/chunks/{chunk-XF63PKEN.js → chunk-ZDFQGHZH.js} +1 -1
  224. package/chunks/{chunk-OZ6KS6KW.js → chunk-ZGCKTAL5.js} +6 -1
  225. package/chunks/chunk-ZHO2CW6D.js +205 -0
  226. package/chunks/chunk-ZJ2LM2SI.js +198 -0
  227. package/chunks/{chunk-AYFA7MZV.js → chunk-ZKFTS3OV.js} +6 -6
  228. package/chunks/{chunk-HMJ2P3SV.js → chunk-ZL4HFSL6.js} +91 -29
  229. package/chunks/{chunk-DJECZIJX.js → chunk-ZTPGUFQV.js} +30 -8
  230. package/chunks/{chunk-7EQQR46F.js → chunk-ZVP4PWBU.js} +1 -1
  231. package/chunks/chunk-bdqvmfwv-ZTSOWAFE.js +17446 -0
  232. package/chunks/config-utils-LVSYDLHZ.js +114 -0
  233. package/chunks/contextCommand-TZD7UAJK.js +107 -0
  234. package/chunks/{core-runtime-AXB6SK5D.js → core-runtime-B4UKKIAQ.js} +63 -62
  235. package/chunks/{create-sub-session-23ITIELI.js → create-sub-session-LUPWEUHR.js} +3 -3
  236. package/chunks/{create-sub-session-4QNE64MR.js → create-sub-session-NJ24B4US.js} +94 -66
  237. package/chunks/{cron-create-KJ4IY6PP.js → cron-create-CRSPET3H.js} +4 -4
  238. package/chunks/{cron-delete-MBLQCAYY.js → cron-delete-DB77SZTU.js} +4 -4
  239. package/chunks/{cron-list-DWH2PQ47.js → cron-list-U2JNYWV6.js} +4 -4
  240. package/chunks/{daemon-3GNHB3M2.js → daemon-RKDGBFLK.js} +613 -102
  241. package/chunks/{daemon-git-worktree-guard-IVAJJWYK.js → daemon-git-worktree-guard-O2HPOBAB.js} +62 -61
  242. package/chunks/daemon-status-provider-GRRVCJFW.js +117 -0
  243. package/chunks/daemon-trust-policy-YJL442BK.js +113 -0
  244. package/chunks/{daemon-trust-policy-monitor-KGGROSIV.js → daemon-trust-policy-monitor-JL7F4Y4Q.js} +68 -67
  245. package/chunks/{de-X6HLSIFE.js → de-T4BLOKEC.js} +3 -0
  246. package/chunks/deferred-core-runtime-S32AYVZI.js +115 -0
  247. package/chunks/{devtools-JCG4K2NZ.js → devtools-VDRJYPZF.js} +1 -1
  248. package/chunks/{discovery-X2NV535U.js → discovery-TUM3ZQ6U.js} +2 -2
  249. package/chunks/{display-image-BE7I6ZB6.js → display-image-73C7XNRK.js} +5 -5
  250. package/chunks/{dist-LVZCXVPF.js → dist-62OZ7QXB.js} +44 -26
  251. package/chunks/{dist-GFN5DCBX.js → dist-EDHQIBYD.js} +152 -63
  252. package/chunks/{dist-N6W6E753.js → dist-GT64AAUR.js} +135 -26
  253. package/chunks/{dist-6BPYWHVD.js → dist-JVXT4VUJ.js} +14 -7
  254. package/chunks/{dist-4WXLCBDR.js → dist-L6URO6CK.js} +12 -5
  255. package/chunks/{dist-5VXFRTWU.js → dist-LXFYIJNG.js} +866 -172
  256. package/chunks/{dist-SWQMYP2Q.js → dist-PDGNRVPY.js} +27 -8
  257. package/chunks/{dist-NSV4NBPK.js → dist-QAF5DO3Y.js} +380 -83
  258. package/chunks/{dist-HZNT6GQS.js → dist-ZCJLKQSP.js} +28 -14
  259. package/chunks/earlyInputCapture-BBPCIVZG.js +108 -0
  260. package/chunks/{edit-LEQLAGPZ.js → edit-SUGXY63Y.js} +47 -47
  261. package/chunks/{en-YLXBXM4Z.js → en-2RATMNX7.js} +5 -0
  262. package/chunks/{enter-worktree-35QCAAFP.js → enter-worktree-B6USKSIK.js} +7 -7
  263. package/chunks/{enterPlanMode-ONQN3WHE.js → enterPlanMode-MDX4RVVL.js} +48 -48
  264. package/chunks/{environment-UANTR7A4.js → environment-VN6RXDVN.js} +63 -62
  265. package/chunks/errors-UEY36PIT.js +114 -0
  266. package/chunks/{exit-worktree-XQD6D543.js → exit-worktree-DLQ73SJH.js} +10 -8
  267. package/chunks/exitPlanMode-EPHIEDAA.js +83 -0
  268. package/chunks/{fast-path-WUL7UZ6H.js → fast-path-Y73R42LV.js} +8 -7
  269. package/chunks/{fast-path-settings-XH426LUU.js → fast-path-settings-MFUR3IWK.js} +3 -3
  270. package/chunks/{fr-FTZWF462.js → fr-BGHGYX6A.js} +3 -0
  271. package/chunks/{glob-Y54QUWDY.js → glob-DMGH7EZN.js} +47 -47
  272. package/chunks/goal-tools-3RF3PXCL.js +99 -0
  273. package/chunks/{grep-5GPICQBU.js → grep-AJVLCVXC.js} +9 -7
  274. package/chunks/handleAutoUpdate-HVWQT2AU.js +110 -0
  275. package/chunks/i18n-5OR7NTRZ.js +125 -0
  276. package/chunks/{image-gen-J6FDGUZP.js → image-gen-VOIDOHOB.js} +8 -8
  277. package/chunks/initializer-JE5RQSOE.js +114 -0
  278. package/chunks/installationInfo-KO3CCSCK.js +108 -0
  279. package/chunks/{ja-2GL5FKYJ.js → ja-G3FTD5XE.js} +3 -0
  280. package/chunks/{keychain-token-storage-37XPR34V.js → keychain-token-storage-REZVMJA6.js} +2 -2
  281. package/chunks/list-3IORSFIY.js +117 -0
  282. package/chunks/list-agents-SBMONIUK.js +128 -0
  283. package/chunks/{llm-NSAVK5V3.js → llm-K26SUDVK.js} +223 -140
  284. package/chunks/{llm-content-generator-AY2QKXHE.js → llm-content-generator-TT6EAUD4.js} +11 -12
  285. package/chunks/loadedSettingsAdapter-KLLFZF3M.js +111 -0
  286. package/chunks/{loggingContentGenerator-DSFQHXIF.js → loggingContentGenerator-EYQBA4M4.js} +66 -65
  287. package/chunks/{loop-wakeup-XJFONSQ7.js → loop-wakeup-QA6SHCZT.js} +5 -5
  288. package/chunks/{ls-3VAT2J7A.js → ls-HEJNCEYO.js} +4 -4
  289. package/chunks/{lsp-5W7IRUBH.js → lsp-WOQKNZP6.js} +2 -2
  290. package/chunks/{managed-npm-update-TSWENTK5.js → managed-npm-update-HIJTODQT.js} +61 -60
  291. package/chunks/mcp-A2UEHETW.js +111 -0
  292. package/chunks/{monitor-RW4GWJHB.js → monitor-DKNZQAB2.js} +46 -46
  293. package/chunks/{node-QKLNSZMX.js → node-UETAYMMO.js} +3 -3
  294. package/chunks/nonInteractiveCli-YA47F2F4.js +190 -0
  295. package/chunks/{notebook-edit-CQNYS5OR.js → notebook-edit-MGHTRL2D.js} +47 -47
  296. package/chunks/{open-with-auth-YN3QZHVM.js → open-with-auth-D6JD6LDS.js} +3 -3
  297. package/chunks/{openaiContentGenerator-J6QIF7EX.js → openaiContentGenerator-ZJIEQ3ZJ.js} +26 -28
  298. package/chunks/pidfile-ETHAZNMY.js +112 -0
  299. package/chunks/{processUtils-GPHNANKZ.js → processUtils-UY3SAJJZ.js} +2 -2
  300. package/chunks/prompt-terminal-ledger-GZ747VYE.js +106 -0
  301. package/chunks/{pt-XN2YWJVM.js → pt-D73IFYT7.js} +3 -0
  302. package/chunks/{qwenContentGenerator-WWDXPYQI.js → qwenContentGenerator-VI4KATRY.js} +58 -58
  303. package/chunks/{qwenOAuth2-OF5WRBQT.js → qwenOAuth2-7AOCKSOQ.js} +7 -7
  304. package/chunks/{read-file-FQUQHC6N.js → read-file-P7F4P7LV.js} +11 -13
  305. package/chunks/{read-mcp-resource-XD257PGJ.js → read-mcp-resource-GLAGB6R7.js} +2 -2
  306. package/chunks/{record-artifact-VW23GS4F.js → record-artifact-SWVR7NSU.js} +4 -4
  307. package/chunks/renderer-selection-M4UN63VJ.js +99 -0
  308. package/chunks/{report-findings-AO5VYFLR.js → report-findings-AL5YW3KI.js} +5 -5
  309. package/chunks/{request-shutdown-BCLA3JV2.js → request-shutdown-5YK4IZ54.js} +8 -7
  310. package/chunks/resumeHistoryUtils-DPZKFW24.js +119 -0
  311. package/chunks/ripGrep-C7LJKUPZ.js +37 -0
  312. package/chunks/{ru-OLTMFJEW.js → ru-QMISLKRH.js} +3 -0
  313. package/chunks/{run-qwen-serve-5X6IDZER.js → run-qwen-serve-OGTEEUR2.js} +589 -251
  314. package/chunks/{runtime-HK27GMPF.js → runtime-LNBLEMZS.js} +73 -72
  315. package/chunks/scheduled-tasks-FLDYZQOF.js +128 -0
  316. package/chunks/{scheduler-WD4MHMO5.js → scheduler-73YXGUGW.js} +62 -61
  317. package/chunks/{sdk-exporters-grpc-G5IT4XS4.js → sdk-exporters-grpc-MXTVSE3C.js} +2 -2
  318. package/chunks/{sdk-exporters-http-TTU2CHBU.js → sdk-exporters-http-3JO5TJNU.js} +4 -4
  319. package/chunks/{sdk-impl-UUMVYMAL.js → sdk-impl-HZAUUTHJ.js} +6 -6
  320. package/chunks/{send-message-AJ4OCUBV.js → send-message-JC7NJTY6.js} +166 -35
  321. package/chunks/serve-3UR2H4CV.js +119 -0
  322. package/chunks/{server-GO2N5DH7.js → server-AOYZVVOM.js} +2904 -860
  323. package/chunks/{session-IFNHTUBT.js → session-UAWFNFGI.js} +119 -114
  324. package/chunks/session-attachments-root-ZCGXQQTR.js +104 -0
  325. package/chunks/{session-pr-refresh-I3UBWMVP.js → session-pr-refresh-CT2INROL.js} +157 -88
  326. package/chunks/{settings-L6N54CU6.js → settings-BHRGDASJ.js} +67 -66
  327. package/chunks/{shell-4Y5LLW6N.js → shell-YHOGC7TO.js} +46 -46
  328. package/chunks/{skill-YOWTRAKQ.js → skill-ZGBKNCHQ.js} +131 -97
  329. package/chunks/skill-settings-AKSP665O.js +119 -0
  330. package/chunks/spawnChannel-N25MBB6F.js +112 -0
  331. package/chunks/standalone-update-XGPWJDRN.js +119 -0
  332. package/chunks/start-opentui-ui-FZ4USOU7.js +55342 -0
  333. package/chunks/{startInteractiveUI-XDFSHBZD.js → startInteractiveUI-E2WQJUOA.js} +3509 -4706
  334. package/chunks/{syntheticOutput-ML43GEFN.js → syntheticOutput-HJNZSEHN.js} +3 -3
  335. package/chunks/{task-create-QN4LYRSE.js → task-create-6RSD54S5.js} +12 -12
  336. package/chunks/{task-list-JPLGK45U.js → task-list-IQSACPOM.js} +34 -11
  337. package/chunks/{task-stop-CXEH5L2D.js → task-stop-HE2LRQNW.js} +2 -2
  338. package/chunks/{task-update-IWEOJFV2.js → task-update-XAJ2NYOA.js} +13 -14
  339. package/chunks/{team-create-OOPXCDBA.js → team-create-SOKMYSQU.js} +54 -55
  340. package/chunks/{team-delete-RZVVSGCY.js → team-delete-NGNNKGMG.js} +25 -8
  341. package/chunks/{team-plan-approval-DSX5EWAT.js → team-plan-approval-U7ZWXYAY.js} +46 -46
  342. package/chunks/terminal-image-renderer-KKM4OBLO.js +117 -0
  343. package/chunks/theme-manager-GQHF3A7T.js +103 -0
  344. package/chunks/{todoWrite-WDJNQEMW.js → todoWrite-5UTVUXHA.js} +39 -9
  345. package/chunks/{tool-search-J5Q6U7DN.js → tool-search-IAI2RVWT.js} +21 -19
  346. package/chunks/total-session-admission-G4CGCSTG.js +113 -0
  347. package/chunks/trustedFolders-D2I3FDPB.js +123 -0
  348. package/chunks/{update-relaunch-SIKHLHVR.js → update-relaunch-5RWKZAL3.js} +5 -5
  349. package/chunks/updateCheck-ZXOQDFEI.js +119 -0
  350. package/chunks/useAutoAcceptIndicator-6EK4QGAH.js +121 -0
  351. package/chunks/{validateNonInterActiveAuth-JUDQP6V4.js → validateNonInterActiveAuth-QPFEKATS.js} +113 -109
  352. package/chunks/{version-C63GDDWN.js → version-JKNG7YDH.js} +1 -1
  353. package/chunks/{web-fetch-FOQZMNSC.js → web-fetch-X3AHIIHW.js} +16 -19
  354. package/chunks/{web-search-PUJTBFUC.js → web-search-K2FMOGS5.js} +10 -11
  355. package/chunks/{web-shell-static-HNB4FDOE.js → web-shell-static-POZHGGXE.js} +5 -4
  356. package/chunks/{workflow-Y5IPINVH.js → workflow-TOLPAK5G.js} +213 -119
  357. package/chunks/workspace-providers-status-PCJK3RC7.js +115 -0
  358. package/chunks/{workspace-registration-store-SMJWI2AI.js → workspace-registration-store-KQWVVW4Y.js} +2 -1
  359. package/chunks/workspace-registry-YNIOB6HJ.js +122 -0
  360. package/chunks/workspace-runtime-coordinator-WG2RNEN7.js +123 -0
  361. package/chunks/workspace-service-G4ZNBOFH.js +127 -0
  362. package/chunks/workspace-skills-status-FMTPPMWC.js +114 -0
  363. package/chunks/{workspace-trust-reconciler-PLIDLJZX.js → workspace-trust-reconciler-IBDFQBQS.js} +76 -77
  364. package/chunks/wrapper-JH3IFHT2.js +35 -0
  365. package/chunks/write-file-YTLFY2S5.js +88 -0
  366. package/chunks/{zh-UNY63FR3.js → zh-25DF7OGK.js} +5 -0
  367. package/chunks/{zh-TW-RPTMRTHG.js → zh-TW-5EDMZVGK.js} +5 -0
  368. package/chunks/{zoom-image-LYQD7BQA.js → zoom-image-IFXSN74N.js} +11 -13
  369. package/cli.js +131 -90
  370. package/locales/ca.js +6 -0
  371. package/locales/de.js +6 -0
  372. package/locales/en.js +9 -0
  373. package/locales/fr.js +6 -0
  374. package/locales/ja.js +6 -0
  375. package/locales/pt.js +6 -0
  376. package/locales/ru.js +6 -0
  377. package/locales/zh-TW.js +9 -0
  378. package/locales/zh.js +9 -0
  379. package/package.json +3 -3
  380. package/web-shell/assets/{abnfDiagram-VCTEODGH-TRCMSA_6.js → abnfDiagram-VCTEODGH-Cxf7xE_Z.js} +1 -1
  381. package/web-shell/assets/{arc-D9Uls5b3.js → arc-ESi1eNkE.js} +1 -1
  382. package/web-shell/assets/{architectureDiagram-5GKGNRK7-Bwb8jPXg.js → architectureDiagram-5GKGNRK7-D9l7-bDo.js} +1 -1
  383. package/web-shell/assets/{blockDiagram-NRAW4CY4-DHj71TSX.js → blockDiagram-NRAW4CY4-Bc8DEasw.js} +1 -1
  384. package/web-shell/assets/{c4Diagram-UCG6FXSJ-uKBBdbyr.js → c4Diagram-UCG6FXSJ-Dimb2Hmh.js} +1 -1
  385. package/web-shell/assets/channel-B7ohGDil.js +1 -0
  386. package/web-shell/assets/{chunk-2Q5K7J3B-BZd0Phrl.js → chunk-2Q5K7J3B-jVDmOpAQ.js} +1 -1
  387. package/web-shell/assets/{chunk-5VM5RSS4-7KNeNBqN.js → chunk-5VM5RSS4-DbG_SwdB.js} +1 -1
  388. package/web-shell/assets/{chunk-F27PBJKO-BeboS7Fi.js → chunk-F27PBJKO-QEc4cY1v.js} +1 -1
  389. package/web-shell/assets/{chunk-G27WJ6UU-RV3JONoj.js → chunk-G27WJ6UU-iJ36lQ3X.js} +1 -1
  390. package/web-shell/assets/{chunk-JWPE2WC7-Yw9FCFsP.js → chunk-JWPE2WC7-DuArnVtF.js} +1 -1
  391. package/web-shell/assets/{chunk-LCL6LL3I-GIMnydDe.js → chunk-LCL6LL3I-DxOf1zwL.js} +1 -1
  392. package/web-shell/assets/{chunk-POPQ4Y6H-Cfrux7bL.js → chunk-POPQ4Y6H-lVLu9Ild.js} +1 -1
  393. package/web-shell/assets/{chunk-SVP7TREG-BlvIN0CO.js → chunk-SVP7TREG-C6XYlIer.js} +1 -1
  394. package/web-shell/assets/{chunk-XXDRQBXY-DMs7Rr4t.js → chunk-XXDRQBXY-CiG2j2Ji.js} +1 -1
  395. package/web-shell/assets/classDiagram-DTDB5LWJ-DdFpqpfD.js +1 -0
  396. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DdFpqpfD.js +1 -0
  397. package/web-shell/assets/{cose-bilkent-JH36ORCC-DNGqTNwI.js → cose-bilkent-JH36ORCC-DGVHMMVm.js} +1 -1
  398. package/web-shell/assets/{cynefin-OW5HDTMX-CojMpaoH.js → cynefin-OW5HDTMX-D6cgpCnH.js} +1 -1
  399. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-DF07YXGo.js → cynefinDiagram-5FMLGOSQ-BKv4Z-UX.js} +1 -1
  400. package/web-shell/assets/{dagre-3AP2YEHR-17-4WtCH.js → dagre-3AP2YEHR-B4ABMIG-.js} +1 -1
  401. package/web-shell/assets/{diagram-S7CK7UJ4-G3Wuyz9m.js → diagram-S7CK7UJ4-DgCkp_Lm.js} +1 -1
  402. package/web-shell/assets/{diagram-UQ7AKVKN-nyWIKZ8P.js → diagram-UQ7AKVKN-FG0FNokz.js} +1 -1
  403. package/web-shell/assets/{diagram-VSXAHHWV-tKHhmYSC.js → diagram-VSXAHHWV-JgkP9qg-.js} +1 -1
  404. package/web-shell/assets/{diagram-VX7I27RA-CpDf1hYk.js → diagram-VX7I27RA-ADh2x83l.js} +1 -1
  405. package/web-shell/assets/{diagram-Z3DM3KII-Cah2IFXG.js → diagram-Z3DM3KII-yXqoYF1J.js} +1 -1
  406. package/web-shell/assets/{ebnfDiagram-PWID7BFC-DNaCkgxy.js → ebnfDiagram-PWID7BFC-Duk83Ek_.js} +1 -1
  407. package/web-shell/assets/{erDiagram-SSCWMZ5O-CAdRgcf1.js → erDiagram-SSCWMZ5O-DMdvxySG.js} +1 -1
  408. package/web-shell/assets/{flowDiagram-A5DVABFB-CMUJAShL.js → flowDiagram-A5DVABFB-DHjVgSji.js} +1 -1
  409. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-o-_MUNey.js → ganttDiagram-EL5Y4UJY-DMM9DkCE.js} +1 -1
  410. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-_aG-2Z7O.js → gitGraphDiagram-WWUBYQGX-t_ug9vO8.js} +1 -1
  411. package/web-shell/assets/index-BGZRqbRo.css +36 -0
  412. package/web-shell/assets/index-DRri_6_x.js +2067 -0
  413. package/web-shell/assets/{index-BK_NKxiJ.js → index-zqvnpGHv.js} +1 -1
  414. package/web-shell/assets/{infoDiagram-RXCK75RN-qJPeZbGP.js → infoDiagram-RXCK75RN-eT1fANNm.js} +1 -1
  415. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-7Om4vNo1.js → ishikawaDiagram-5VMMS53U-k3evzZNn.js} +1 -1
  416. package/web-shell/assets/{journeyDiagram-EYS64GPL-BNtXqmBW.js → journeyDiagram-EYS64GPL-CGim3EAi.js} +1 -1
  417. package/web-shell/assets/{kanban-definition-3QL26DDD-COgFec8P.js → kanban-definition-3QL26DDD-WHfJo-22.js} +1 -1
  418. package/web-shell/assets/{layout-B9n81PC9.js → layout-DkqIaFlJ.js} +1 -1
  419. package/web-shell/assets/{linear-Bb6nXZQq.js → linear-Bdkd3mCz.js} +1 -1
  420. package/web-shell/assets/{mermaid.core-Cgrm3JVT.js → mermaid.core-CGw0LkT_.js} +6 -6
  421. package/web-shell/assets/{mindmap-definition-FBJOCRG2-TKwLTjnG.js → mindmap-definition-FBJOCRG2-C9V4rBvo.js} +1 -1
  422. package/web-shell/assets/{pegDiagram-XKGWAZYB-BJPuvlpi.js → pegDiagram-XKGWAZYB-CwoI2T5G.js} +1 -1
  423. package/web-shell/assets/{pieDiagram-E7YTZNPT-D01VkNsW.js → pieDiagram-E7YTZNPT-DaTmBmPG.js} +1 -1
  424. package/web-shell/assets/{quadrantDiagram-AXDQQJYC-C4hHsiv-.js → quadrantDiagram-AXDQQJYC-plh6MyGI.js} +1 -1
  425. package/web-shell/assets/{railroadDiagram-O6MQD6OU-CuEO4xK2.js → railroadDiagram-O6MQD6OU-D_b-S0iK.js} +1 -1
  426. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-D5J_vIo5.js → requirementDiagram-EFPCY7ZU-zUzTN7VE.js} +1 -1
  427. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-DQKY223V.js → sankeyDiagram-P5KCCOFB-m6AhoD0l.js} +1 -1
  428. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-D27YV_cm.js → sequenceDiagram-WJ2MYXX4-Cwhzsine.js} +1 -1
  429. package/web-shell/assets/{sizeCapture-X5ZJPWSS-TJg8UcwV.js → sizeCapture-X5ZJPWSS-CcZuKIae.js} +1 -1
  430. package/web-shell/assets/{stateDiagram-HBIQ2CUA-CmnPzUIx.js → stateDiagram-HBIQ2CUA-CFoiJwD_.js} +1 -1
  431. package/web-shell/assets/stateDiagram-v2-4QOOHH4V--H8HdEmk.js +1 -0
  432. package/web-shell/assets/{swimlanes-XN3QIQJK-ByeP3_Nu.js → swimlanes-XN3QIQJK-CgS9hcaV.js} +1 -1
  433. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-ShE9OIgf.js +8 -0
  434. package/web-shell/assets/{timeline-definition-24CTP7MA-BsFA5juR.js → timeline-definition-24CTP7MA-Dzzc05t9.js} +1 -1
  435. package/web-shell/assets/{vennDiagram-4TSXK5OY-DREP2ECo.js → vennDiagram-4TSXK5OY-DemK0f7Y.js} +1 -1
  436. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-iyd9lKi2.js → wardleyDiagram-VM6X3IG4-CquLxtMr.js} +1 -1
  437. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-CVr1_j9q.js → xychartDiagram-S5SC5T6Z-BTBKTM5g.js} +1 -1
  438. package/web-shell/index.html +196 -2
  439. package/chunks/MaxSizedBox-X42SXBJH.js +0 -110
  440. package/chunks/agent-headless-IZM25LJA.js +0 -85
  441. package/chunks/bridge-ME6QXZNA.js +0 -119
  442. package/chunks/channel-settings-store-PEOI7XCG.js +0 -120
  443. package/chunks/chunk-7J6OTNGO.js +0 -424
  444. package/chunks/chunk-BWORX6FA.js +0 -135
  445. package/chunks/chunk-CPBF7KYF.js +0 -51
  446. package/chunks/chunk-H72BQNM3.js +0 -645
  447. package/chunks/chunk-JHYH6PYQ.js +0 -3096
  448. package/chunks/chunk-SS4MRMKE.js +0 -3525
  449. package/chunks/chunk-T4EFG2P5.js +0 -113
  450. package/chunks/chunk-XZA32HII.js +0 -19
  451. package/chunks/chunk-ZYNTSXWK.js +0 -32
  452. package/chunks/config-utils-R6M3TA34.js +0 -113
  453. package/chunks/contextCommand-ZCAP23J6.js +0 -106
  454. package/chunks/daemon-status-provider-K3SJ5C2U.js +0 -117
  455. package/chunks/daemon-trust-policy-DOR3YG62.js +0 -112
  456. package/chunks/deferred-core-runtime-WOYLUQQ7.js +0 -114
  457. package/chunks/earlyInputCapture-OHBEVO4K.js +0 -107
  458. package/chunks/errors-WAK6KFBC.js +0 -113
  459. package/chunks/exitPlanMode-UEYBG6P5.js +0 -83
  460. package/chunks/goal-tools-PTD3MBA7.js +0 -411
  461. package/chunks/handleAutoUpdate-FP3NWNSG.js +0 -109
  462. package/chunks/i18n-INIU5X7A.js +0 -124
  463. package/chunks/initializer-TYODV6GE.js +0 -113
  464. package/chunks/installationInfo-AAPKYDSZ.js +0 -107
  465. package/chunks/list-TUODDN6J.js +0 -116
  466. package/chunks/list-agents-DI3YFTDT.js +0 -80
  467. package/chunks/loadedSettingsAdapter-KJCLZ3C4.js +0 -110
  468. package/chunks/mcp-MWSAPFOL.js +0 -110
  469. package/chunks/nonInteractiveCli-JXKL343Q.js +0 -185
  470. package/chunks/pidfile-QOIQZFT2.js +0 -111
  471. package/chunks/prompt-terminal-ledger-FOMFTYOM.js +0 -105
  472. package/chunks/resumeHistoryUtils-NSGF3UCB.js +0 -118
  473. package/chunks/ripGrep-4CAT6SKV.js +0 -39
  474. package/chunks/scheduled-tasks-MN2ZZ5P6.js +0 -127
  475. package/chunks/serve-2XCHPPGG.js +0 -118
  476. package/chunks/skill-settings-ZL4JY5UE.js +0 -118
  477. package/chunks/spawnChannel-ZST6XJVJ.js +0 -112
  478. package/chunks/standalone-update-THVU3OKY.js +0 -118
  479. package/chunks/terminal-image-renderer-KS25G33E.js +0 -114
  480. package/chunks/theme-manager-YMZNG45F.js +0 -102
  481. package/chunks/total-session-admission-PVN64JVV.js +0 -114
  482. package/chunks/trustedFolders-FATSC4YI.js +0 -122
  483. package/chunks/updateCheck-D3YG2WCD.js +0 -118
  484. package/chunks/useAutoAcceptIndicator-ILINOSAS.js +0 -120
  485. package/chunks/workspace-providers-status-IJ4VHFMB.js +0 -114
  486. package/chunks/workspace-registry-BTGZIMPK.js +0 -123
  487. package/chunks/workspace-service-SIN67ITC.js +0 -126
  488. package/chunks/workspace-skills-status-F3RKCUIX.js +0 -113
  489. package/chunks/write-file-PAIGB33C.js +0 -88
  490. package/web-shell/assets/channel-CXjVLaBa.js +0 -1
  491. package/web-shell/assets/classDiagram-DTDB5LWJ-DANEijO3.js +0 -1
  492. package/web-shell/assets/classDiagram-v2-JRS7N3AN-DANEijO3.js +0 -1
  493. package/web-shell/assets/index-Ci-z4zWY.js +0 -1913
  494. package/web-shell/assets/index-LDlXZRHA.css +0 -36
  495. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-DNKPyrDc.js +0 -1
  496. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-ZL1HPC6w.js +0 -8
  497. /package/chunks/{chunk-FOGQO4FG.js → chunk-JA5CBKRP.js} +0 -0
@@ -0,0 +1,2054 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import {
4
+ reportChatRecordingFailureToAdapter
5
+ } from "./chunk-5Q5RC2WE.js";
6
+ import {
7
+ StreamJsonOutputAdapter
8
+ } from "./chunk-UAKRDON5.js";
9
+ import {
10
+ ICON
11
+ } from "./chunk-HJBHMANB.js";
12
+ import {
13
+ theme
14
+ } from "./chunk-PDAKFU7M.js";
15
+ import {
16
+ require_jsx_runtime
17
+ } from "./chunk-SV5PQVQE.js";
18
+ import {
19
+ Box_default,
20
+ Text
21
+ } from "./chunk-O4KNCAX4.js";
22
+ import {
23
+ require_react
24
+ } from "./chunk-5QWWOFGG.js";
25
+ import {
26
+ createLoadedSettingsAdapter
27
+ } from "./chunk-32LU3APX.js";
28
+ import {
29
+ SettingScope,
30
+ settingExistsInScope
31
+ } from "./chunk-VWTSRH6C.js";
32
+ import {
33
+ t
34
+ } from "./chunk-I4NRYS6A.js";
35
+ import {
36
+ Logger,
37
+ applyProviderInstallPlan,
38
+ buildInstallPlan,
39
+ getDefaultBaseUrlForProtocol,
40
+ getDefaultModelIds,
41
+ resolveBaseUrl,
42
+ shouldShowStep
43
+ } from "./chunk-JUARRUMA.js";
44
+ import {
45
+ qwenOAuth2Events,
46
+ sanitizeForOsc
47
+ } from "./chunk-3AKCBZVW.js";
48
+ import {
49
+ allowEditorTypeInSandbox,
50
+ checkHasEditorType
51
+ } from "./chunk-4F7GQGXB.js";
52
+ import {
53
+ AuthEvent,
54
+ logAuth
55
+ } from "./chunk-GH2S4GD5.js";
56
+ import {
57
+ createDebugLogger,
58
+ getErrorMessage
59
+ } from "./chunk-EAHOJF6V.js";
60
+ import {
61
+ init_esbuild_shims
62
+ } from "./chunk-5O2XNYP6.js";
63
+ import {
64
+ __name,
65
+ __toESM
66
+ } from "./chunk-J2S4EL5Y.js";
67
+
68
+ // packages/cli/src/ui/utils/windowTitle.ts
69
+ init_esbuild_shims();
70
+ var DEFAULT_WINDOW_TITLE = "qwen";
71
+ var MULTIPLEXER_ENV_KEYS = ["TMUX", "STY", "ZELLIJ", "DVTM"];
72
+ function sanitizeWindowTitle(title) {
73
+ return sanitizeForOsc(title);
74
+ }
75
+ __name(sanitizeWindowTitle, "sanitizeWindowTitle");
76
+ function computeWindowTitle(folderName) {
77
+ return sanitizeWindowTitle(
78
+ process.env["CLI_TITLE"] || `Qwen - ${folderName || DEFAULT_WINDOW_TITLE}`
79
+ );
80
+ }
81
+ __name(computeWindowTitle, "computeWindowTitle");
82
+ function writeTerminalTitle(write, title) {
83
+ const clean = sanitizeWindowTitle(title);
84
+ if (process.platform === "win32") {
85
+ process.title = clean;
86
+ }
87
+ const inMultiplexer = MULTIPLEXER_ENV_KEYS.some((k) => !!process.env[k]);
88
+ if (clean.length === 0) {
89
+ if (inMultiplexer) {
90
+ write("\x1B]2;\x07");
91
+ } else {
92
+ write("\x1B]0;\x07\x1B]2;\x07");
93
+ }
94
+ return;
95
+ }
96
+ if (inMultiplexer) {
97
+ write(`\x1B]2;${clean}\x07`);
98
+ } else {
99
+ const padded = clean.substring(0, 80).padEnd(80, " ");
100
+ write(`\x1B]0;${padded}\x07\x1B]2;${padded}\x07`);
101
+ }
102
+ }
103
+ __name(writeTerminalTitle, "writeTerminalTitle");
104
+ function formatSessionWindowTitle(sessionName, folderName, statusPrefix = "") {
105
+ const base = sessionName ? sanitizeWindowTitle(sessionName) : computeWindowTitle(folderName);
106
+ return sanitizeWindowTitle(statusPrefix + base);
107
+ }
108
+ __name(formatSessionWindowTitle, "formatSessionWindowTitle");
109
+ function titleStatusPrefix(streamingState) {
110
+ switch (streamingState) {
111
+ case "responding" /* Responding */:
112
+ return `${ICON.CIRCLE_LEFT_HALF} `;
113
+ case "waiting_for_confirmation" /* WaitingForConfirmation */:
114
+ return `${ICON.SPARKLE} `;
115
+ default:
116
+ return "";
117
+ }
118
+ }
119
+ __name(titleStatusPrefix, "titleStatusPrefix");
120
+
121
+ // packages/cli/src/ui/hooks/useLogger.ts
122
+ init_esbuild_shims();
123
+ var import_react = __toESM(require_react(), 1);
124
+ var useLogger = /* @__PURE__ */ __name((storage, sessionId) => {
125
+ const [logger, setLogger] = (0, import_react.useState)(null);
126
+ (0, import_react.useEffect)(() => {
127
+ if (!sessionId) {
128
+ return;
129
+ }
130
+ let cancelled = false;
131
+ const newLogger = new Logger(sessionId, storage);
132
+ newLogger.initialize().then(() => {
133
+ if (!cancelled) {
134
+ setLogger(newLogger);
135
+ }
136
+ }).catch(() => {
137
+ });
138
+ return () => {
139
+ cancelled = true;
140
+ };
141
+ }, [storage, sessionId]);
142
+ return logger;
143
+ }, "useLogger");
144
+
145
+ // packages/cli/src/dualOutput/DualOutputBridge.ts
146
+ init_esbuild_shims();
147
+ import {
148
+ createWriteStream,
149
+ fstatSync,
150
+ openSync,
151
+ constants
152
+ } from "node:fs";
153
+
154
+ // packages/cli/src/nonInteractive/io/index.ts
155
+ init_esbuild_shims();
156
+
157
+ // packages/cli/src/dualOutput/DualOutputBridge.ts
158
+ var debugLogger = createDebugLogger("DUAL_OUTPUT");
159
+ var SUPPORTED_EVENTS = [
160
+ "system",
161
+ "user",
162
+ "assistant",
163
+ "stream_event",
164
+ "result",
165
+ "control_request",
166
+ "control_response"
167
+ ];
168
+ var DUAL_OUTPUT_PROTOCOL_VERSION = 2;
169
+ var MAX_BUFFERED_BYTES = 1024 * 1024;
170
+ var DualOutputBridge = class {
171
+ static {
172
+ __name(this, "DualOutputBridge");
173
+ }
174
+ adapter;
175
+ stream;
176
+ sessionId;
177
+ active = true;
178
+ shutdownPromise = null;
179
+ unsubscribeRecordingFailure;
180
+ constructor(config, target, options = {}) {
181
+ this.sessionId = config.getSessionId();
182
+ if ("fd" in target) {
183
+ if (target.fd <= 2) {
184
+ throw new Error(
185
+ `--json-fd ${target.fd}: file descriptors 0 (stdin), 1 (stdout), and 2 (stderr) are reserved. Use fd 3 or higher.`
186
+ );
187
+ }
188
+ try {
189
+ fstatSync(target.fd);
190
+ } catch {
191
+ throw new Error(
192
+ `--json-fd ${target.fd}: file descriptor is not open. The caller must provide this fd via spawn stdio configuration or shell redirection (e.g., 3>/tmp/events.jsonl).`
193
+ );
194
+ }
195
+ this.stream = createWriteStream("", { fd: target.fd });
196
+ } else {
197
+ try {
198
+ const fd = openSync(
199
+ target.filePath,
200
+ constants.O_WRONLY | constants.O_NONBLOCK
201
+ );
202
+ this.stream = createWriteStream("", { fd });
203
+ } catch (err) {
204
+ const code = err.code;
205
+ if (code === "ENXIO") {
206
+ try {
207
+ const fd = openSync(
208
+ target.filePath,
209
+ constants.O_RDWR | constants.O_NONBLOCK
210
+ );
211
+ this.stream = createWriteStream("", { fd });
212
+ } catch (retryErr) {
213
+ if (retryErr.code === "EACCES") {
214
+ throw new Error(
215
+ `--json-file "${target.filePath}": permission denied opening FIFO for read-write. Check read/write permissions on the file and its parent directories, or start a reader before launching Qwen Code.`
216
+ );
217
+ }
218
+ throw retryErr;
219
+ }
220
+ } else if (code === "ENOENT") {
221
+ this.stream = createWriteStream(target.filePath, { flags: "w" });
222
+ } else {
223
+ throw err;
224
+ }
225
+ }
226
+ }
227
+ this.stream.on("error", (err) => {
228
+ const code = err.code;
229
+ if (code === "EPIPE" || code === "ERR_STREAM_DESTROYED") {
230
+ debugLogger.warn("DualOutput: consumer disconnected, disabling");
231
+ } else if (code === "ERR_SYSTEM_ERROR") {
232
+ debugLogger.warn(
233
+ "DualOutput: system error on stream, disabling:",
234
+ err.message
235
+ );
236
+ } else {
237
+ debugLogger.error("DualOutput stream error:", err);
238
+ }
239
+ this.active = false;
240
+ });
241
+ this.adapter = new StreamJsonOutputAdapter(
242
+ config,
243
+ true,
244
+ // includePartialMessages — always emit streaming events
245
+ this.stream
246
+ );
247
+ this.unsubscribeRecordingFailure = typeof config.onChatRecordingFailure === "function" ? config.onChatRecordingFailure((event) => {
248
+ this.emitRecordingFailure(event);
249
+ }) : () => {
250
+ };
251
+ try {
252
+ this.adapter.emitSystemMessage("session_start", {
253
+ session_id: this.sessionId,
254
+ cwd: process.cwd(),
255
+ protocol_version: DUAL_OUTPUT_PROTOCOL_VERSION,
256
+ version: options.version,
257
+ supported_events: [...SUPPORTED_EVENTS]
258
+ });
259
+ } catch (err) {
260
+ debugLogger.error("DualOutput session_start error:", err);
261
+ this.active = false;
262
+ }
263
+ }
264
+ processEvent(event) {
265
+ if (!this.active) return;
266
+ this.disableIfBufferOverflowed();
267
+ if (!this.active) return;
268
+ try {
269
+ this.adapter.processEvent(event);
270
+ } catch (err) {
271
+ debugLogger.error("DualOutput processEvent error:", err);
272
+ this.active = false;
273
+ }
274
+ }
275
+ startAssistantMessage() {
276
+ if (!this.active) return;
277
+ this.disableIfBufferOverflowed();
278
+ if (!this.active) return;
279
+ try {
280
+ this.adapter.startAssistantMessage();
281
+ } catch (err) {
282
+ debugLogger.error("DualOutput startAssistantMessage error:", err);
283
+ this.active = false;
284
+ }
285
+ }
286
+ finalizeAssistantMessage() {
287
+ if (!this.active) return;
288
+ this.disableIfBufferOverflowed();
289
+ if (!this.active) return;
290
+ try {
291
+ this.adapter.finalizeAssistantMessage();
292
+ } catch (err) {
293
+ debugLogger.error("DualOutput finalizeAssistantMessage error:", err);
294
+ this.active = false;
295
+ }
296
+ }
297
+ emitUserMessage(parts) {
298
+ if (!this.active) return;
299
+ this.disableIfBufferOverflowed();
300
+ if (!this.active) return;
301
+ try {
302
+ this.adapter.emitUserMessage(parts);
303
+ } catch (err) {
304
+ debugLogger.error("DualOutput emitUserMessage error:", err);
305
+ this.active = false;
306
+ }
307
+ }
308
+ emitToolResult(request, response) {
309
+ if (!this.active) return;
310
+ this.disableIfBufferOverflowed();
311
+ if (!this.active) return;
312
+ try {
313
+ this.adapter.emitToolResult(request, response);
314
+ } catch (err) {
315
+ debugLogger.error("DualOutput emitToolResult error:", err);
316
+ this.active = false;
317
+ }
318
+ }
319
+ /** Whether the underlying stream is still writable. */
320
+ get isConnected() {
321
+ return this.active;
322
+ }
323
+ disableIfBufferOverflowed() {
324
+ if (this.stream.writableLength > MAX_BUFFERED_BYTES) {
325
+ debugLogger.warn(
326
+ "DualOutput: buffered data exceeds limit, disabling (no consumer draining?)"
327
+ );
328
+ this.active = false;
329
+ this.stream.destroy();
330
+ }
331
+ }
332
+ /**
333
+ * Emits a `can_use_tool` permission request so an external consumer can
334
+ * approve or deny the tool call. Pairs with {@link emitControlResponse}.
335
+ */
336
+ emitPermissionRequest(requestId, toolName, toolUseId, input, blockedPath = null, permissionSuggestions = null) {
337
+ if (!this.active) return;
338
+ this.disableIfBufferOverflowed();
339
+ if (!this.active) return;
340
+ try {
341
+ this.adapter.emitPermissionRequest(
342
+ requestId,
343
+ toolName,
344
+ toolUseId,
345
+ input,
346
+ blockedPath,
347
+ permissionSuggestions
348
+ );
349
+ } catch (err) {
350
+ debugLogger.error("DualOutput emitPermissionRequest error:", err);
351
+ this.active = false;
352
+ }
353
+ }
354
+ /**
355
+ * Emits the result of a permission decision (made either in the TUI or by
356
+ * the external consumer) so all observers stay in sync.
357
+ */
358
+ emitControlResponse(requestId, allowed) {
359
+ if (!this.active) return;
360
+ this.disableIfBufferOverflowed();
361
+ if (!this.active) return;
362
+ try {
363
+ this.adapter.emitControlResponse(requestId, allowed);
364
+ } catch (err) {
365
+ debugLogger.error("DualOutput emitControlResponse error:", err);
366
+ this.active = false;
367
+ }
368
+ }
369
+ /**
370
+ * Emits a `control_response` with subtype `error` — used when an external
371
+ * `confirmation_response` cannot be satisfied (unknown request_id, the
372
+ * tool call already resolved, stream already closed, etc.). Lets
373
+ * consumers retry or surface the error instead of silently hanging.
374
+ */
375
+ emitControlError(requestId, message) {
376
+ if (!this.active) return;
377
+ this.disableIfBufferOverflowed();
378
+ if (!this.active) return;
379
+ try {
380
+ this.adapter.emitControlError(requestId, message);
381
+ } catch (err) {
382
+ debugLogger.error("DualOutput emitControlError error:", err);
383
+ this.active = false;
384
+ }
385
+ }
386
+ /** General-purpose system event escape hatch. */
387
+ emitSystemMessage(subtype, data) {
388
+ if (!this.active) return;
389
+ this.disableIfBufferOverflowed();
390
+ if (!this.active) return;
391
+ try {
392
+ this.adapter.emitSystemMessage(subtype, data);
393
+ } catch (err) {
394
+ debugLogger.error("DualOutput emitSystemMessage error:", err);
395
+ this.active = false;
396
+ }
397
+ }
398
+ emitRecordingFailure(event) {
399
+ if (!this.active) return;
400
+ this.disableIfBufferOverflowed();
401
+ if (!this.active) return;
402
+ try {
403
+ reportChatRecordingFailureToAdapter(this.adapter, event);
404
+ } catch (err) {
405
+ debugLogger.error("DualOutput recording failure output error:", err);
406
+ this.active = false;
407
+ }
408
+ }
409
+ shutdown() {
410
+ if (this.shutdownPromise) return this.shutdownPromise;
411
+ this.unsubscribeRecordingFailure();
412
+ if (this.active) {
413
+ try {
414
+ this.adapter.emitSystemMessage("session_end", {
415
+ session_id: this.sessionId
416
+ });
417
+ } catch {
418
+ }
419
+ }
420
+ this.active = false;
421
+ this.shutdownPromise = new Promise((resolve) => {
422
+ if (this.stream.closed || this.stream.destroyed) {
423
+ resolve();
424
+ return;
425
+ }
426
+ const cleanup = /* @__PURE__ */ __name(() => {
427
+ this.stream.off("close", onClose);
428
+ this.stream.off("error", onError);
429
+ }, "cleanup");
430
+ const onClose = /* @__PURE__ */ __name(() => {
431
+ cleanup();
432
+ resolve();
433
+ }, "onClose");
434
+ const onError = /* @__PURE__ */ __name((err) => {
435
+ debugLogger.debug("DualOutput: stream error during shutdown:", err);
436
+ }, "onError");
437
+ this.stream.once("close", onClose);
438
+ this.stream.once("error", onError);
439
+ try {
440
+ this.stream.end();
441
+ } catch (err) {
442
+ cleanup();
443
+ debugLogger.debug("DualOutput: stream end error during shutdown:", err);
444
+ resolve();
445
+ }
446
+ });
447
+ return this.shutdownPromise;
448
+ }
449
+ };
450
+
451
+ // packages/cli/src/remoteInput/RemoteInputWatcher.ts
452
+ init_esbuild_shims();
453
+ import { createHash } from "node:crypto";
454
+ import {
455
+ closeSync,
456
+ createReadStream,
457
+ openSync as openSync2,
458
+ readSync,
459
+ statSync,
460
+ unwatchFile,
461
+ watchFile
462
+ } from "node:fs";
463
+ import { createInterface } from "node:readline";
464
+ var debugLogger2 = createDebugLogger("REMOTE_INPUT");
465
+ var RemoteInputWatcher = class {
466
+ static {
467
+ __name(this, "RemoteInputWatcher");
468
+ }
469
+ submitFn = null;
470
+ confirmationHandler = null;
471
+ queue = [];
472
+ processing = false;
473
+ active = true;
474
+ bytesRead = 0;
475
+ consumedPrefixHash = null;
476
+ reading = false;
477
+ filePath;
478
+ retryTimer = null;
479
+ pollIntervalMs;
480
+ constructor(filePath, options) {
481
+ this.filePath = filePath;
482
+ this.pollIntervalMs = options?.pollIntervalMs ?? 500;
483
+ this.startWatching();
484
+ }
485
+ /**
486
+ * Register the TUI's submit function. Called from AppContainer
487
+ * once useLlmStream's submitQuery is available.
488
+ */
489
+ setSubmitFn(fn) {
490
+ this.submitFn = fn;
491
+ this.processQueue();
492
+ }
493
+ /**
494
+ * Register the handler invoked when a `confirmation_response` command is
495
+ * read from the input file. Used to bridge external approvals back into
496
+ * the tool's `onConfirm` callback.
497
+ */
498
+ setConfirmationHandler(fn) {
499
+ this.confirmationHandler = fn;
500
+ }
501
+ /**
502
+ * Notify the watcher that the TUI has become idle.
503
+ * Call this when streamingState transitions to Idle — it triggers
504
+ * processing of any queued commands that were deferred due to TUI busy.
505
+ */
506
+ notifyIdle() {
507
+ if (this.queue.length > 0 && !this.processing) {
508
+ this.processQueue();
509
+ }
510
+ }
511
+ startWatching() {
512
+ try {
513
+ const stat = statSync(this.filePath);
514
+ this.bytesRead = stat.size;
515
+ this.consumedPrefixHash = this.hashFilePrefix(this.bytesRead);
516
+ } catch {
517
+ this.bytesRead = 0;
518
+ this.consumedPrefixHash = null;
519
+ }
520
+ watchFile(this.filePath, { interval: this.pollIntervalMs }, () => {
521
+ if (!this.active) return;
522
+ this.readNewLines();
523
+ });
524
+ debugLogger2.debug(`RemoteInput: watching ${this.filePath}`);
525
+ }
526
+ /**
527
+ * Manually trigger a check for new input. Returns a promise that resolves
528
+ * once any new lines have been read and processed. In production the
529
+ * `watchFile` poll calls this automatically; tests can call it directly
530
+ * to avoid depending on filesystem-polling timing.
531
+ */
532
+ checkForNewInput() {
533
+ return this.readNewLines();
534
+ }
535
+ readNewLines() {
536
+ if (!this.active || this.reading) return Promise.resolve();
537
+ let currentSize;
538
+ try {
539
+ const stat = statSync(this.filePath);
540
+ currentSize = stat.size;
541
+ } catch {
542
+ return Promise.resolve();
543
+ }
544
+ if (currentSize < this.bytesRead) {
545
+ debugLogger2.debug(
546
+ "RemoteInput: input file shrank, resetting read offset"
547
+ );
548
+ this.bytesRead = 0;
549
+ this.consumedPrefixHash = null;
550
+ } else if (this.hasConsumedPrefixChanged()) {
551
+ debugLogger2.debug(
552
+ "RemoteInput: input file prefix changed, resetting read offset"
553
+ );
554
+ this.bytesRead = 0;
555
+ this.consumedPrefixHash = null;
556
+ }
557
+ if (currentSize <= this.bytesRead) return Promise.resolve();
558
+ const consumeUntil = this.findLastCompleteRecordEnd(
559
+ this.bytesRead,
560
+ currentSize
561
+ );
562
+ if (consumeUntil === null) {
563
+ return Promise.resolve();
564
+ }
565
+ const nextConsumedPrefixHash = this.hashFilePrefix(consumeUntil);
566
+ this.reading = true;
567
+ const stream = createReadStream(this.filePath, {
568
+ start: this.bytesRead,
569
+ end: consumeUntil - 1,
570
+ encoding: "utf-8"
571
+ });
572
+ const rl = createInterface({ input: stream, crlfDelay: Infinity });
573
+ rl.on("line", (line) => {
574
+ const trimmed = line.trim();
575
+ if (!trimmed) return;
576
+ try {
577
+ const cmd = JSON.parse(trimmed);
578
+ if (cmd && cmd.type === "confirmation_response" && typeof cmd.request_id === "string" && typeof cmd.allowed === "boolean") {
579
+ debugLogger2.debug(
580
+ `RemoteInput: confirmation_response for ${cmd.request_id} (allowed=${cmd.allowed})`
581
+ );
582
+ this.confirmationHandler?.(cmd.request_id, cmd.allowed);
583
+ } else if (cmd && cmd.type === "submit" && typeof cmd.text === "string") {
584
+ debugLogger2.debug(
585
+ `RemoteInput: queued command: ${cmd.text.slice(0, 50)}...`
586
+ );
587
+ this.queue.push(
588
+ cmd
589
+ );
590
+ } else {
591
+ debugLogger2.warn(
592
+ `RemoteInput: unknown command type: ${String(cmd?.type)}`
593
+ );
594
+ }
595
+ } catch (_err) {
596
+ debugLogger2.warn(`RemoteInput: failed to parse line: ${trimmed}`);
597
+ }
598
+ });
599
+ return new Promise((resolve) => {
600
+ rl.on("close", () => {
601
+ this.bytesRead = consumeUntil;
602
+ if (nextConsumedPrefixHash !== null) {
603
+ this.consumedPrefixHash = nextConsumedPrefixHash;
604
+ }
605
+ this.reading = false;
606
+ this.processQueue();
607
+ resolve();
608
+ });
609
+ });
610
+ }
611
+ findLastCompleteRecordEnd(start, end) {
612
+ if (end <= start) return null;
613
+ let fd = null;
614
+ try {
615
+ fd = openSync2(this.filePath, "r");
616
+ const buffer = Buffer.allocUnsafe(Math.min(64 * 1024, end - start));
617
+ let remaining = end - start;
618
+ let position = start;
619
+ let lastLineBreak = -1;
620
+ while (remaining > 0) {
621
+ const bytesToRead = Math.min(buffer.length, remaining);
622
+ const bytesRead = readSync(fd, buffer, 0, bytesToRead, position);
623
+ if (bytesRead <= 0) break;
624
+ for (let i = 0; i < bytesRead; i++) {
625
+ if (buffer[i] === 10) {
626
+ lastLineBreak = position + i;
627
+ }
628
+ }
629
+ remaining -= bytesRead;
630
+ position += bytesRead;
631
+ }
632
+ return lastLineBreak >= start ? lastLineBreak + 1 : null;
633
+ } catch (err) {
634
+ debugLogger2.warn("RemoteInput: failed to scan complete records:", err);
635
+ return null;
636
+ } finally {
637
+ if (fd !== null) {
638
+ closeSync(fd);
639
+ }
640
+ }
641
+ }
642
+ hasConsumedPrefixChanged() {
643
+ if (this.bytesRead === 0) {
644
+ return false;
645
+ }
646
+ if (this.consumedPrefixHash === null) {
647
+ debugLogger2.warn(
648
+ "RemoteInput: missing consumed prefix hash, resetting read offset"
649
+ );
650
+ return true;
651
+ }
652
+ const currentHash = this.hashFilePrefix(this.bytesRead);
653
+ if (currentHash === null) {
654
+ debugLogger2.warn(
655
+ "RemoteInput: failed to hash consumed prefix, resetting read offset"
656
+ );
657
+ return true;
658
+ }
659
+ return currentHash !== this.consumedPrefixHash;
660
+ }
661
+ hashFilePrefix(size) {
662
+ if (size <= 0) return null;
663
+ let fd = null;
664
+ try {
665
+ fd = openSync2(this.filePath, "r");
666
+ const hash = createHash("sha256");
667
+ const buffer = Buffer.allocUnsafe(Math.min(64 * 1024, size));
668
+ let remaining = size;
669
+ let position = 0;
670
+ while (remaining > 0) {
671
+ const bytesToRead = Math.min(buffer.length, remaining);
672
+ const bytesRead = readSync(fd, buffer, 0, bytesToRead, position);
673
+ if (bytesRead <= 0) return null;
674
+ hash.update(buffer.subarray(0, bytesRead));
675
+ remaining -= bytesRead;
676
+ position += bytesRead;
677
+ }
678
+ return hash.digest("base64");
679
+ } catch (err) {
680
+ debugLogger2.warn("RemoteInput: failed to hash file prefix:", err);
681
+ return null;
682
+ } finally {
683
+ if (fd !== null) {
684
+ closeSync(fd);
685
+ }
686
+ }
687
+ }
688
+ async processQueue() {
689
+ if (this.processing || !this.submitFn || this.queue.length === 0) return;
690
+ this.processing = true;
691
+ if (this.retryTimer) {
692
+ clearTimeout(this.retryTimer);
693
+ this.retryTimer = null;
694
+ }
695
+ try {
696
+ while (this.queue.length > 0 && this.active) {
697
+ if (!this.submitFn) break;
698
+ const cmd = this.queue[0];
699
+ debugLogger2.debug(
700
+ `RemoteInput: submitting: ${cmd.text.slice(0, 50)}...`
701
+ );
702
+ try {
703
+ const result = await this.submitFn(cmd.text);
704
+ if (result === false) {
705
+ debugLogger2.debug("RemoteInput: TUI busy, will retry on idle");
706
+ this.scheduleRetry();
707
+ break;
708
+ }
709
+ this.queue.shift();
710
+ } catch (err) {
711
+ debugLogger2.error("RemoteInput: submit failed:", err);
712
+ this.queue.shift();
713
+ }
714
+ if (this.queue.length > 0) {
715
+ await new Promise((r) => setTimeout(r, 500));
716
+ }
717
+ }
718
+ } finally {
719
+ this.processing = false;
720
+ }
721
+ }
722
+ scheduleRetry() {
723
+ if (this.retryTimer) return;
724
+ this.retryTimer = setTimeout(() => {
725
+ this.retryTimer = null;
726
+ if (this.queue.length > 0 && !this.processing) {
727
+ this.processQueue();
728
+ }
729
+ }, 2e3);
730
+ }
731
+ shutdown() {
732
+ this.active = false;
733
+ unwatchFile(this.filePath);
734
+ if (this.retryTimer) clearTimeout(this.retryTimer);
735
+ this.queue.length = 0;
736
+ debugLogger2.debug("RemoteInput: shut down");
737
+ }
738
+ };
739
+
740
+ // packages/cli/src/ui/auth/useAuth.ts
741
+ init_esbuild_shims();
742
+ var import_react3 = __toESM(require_react(), 1);
743
+
744
+ // packages/cli/src/ui/hooks/useQwenAuth.ts
745
+ init_esbuild_shims();
746
+ var import_react2 = __toESM(require_react(), 1);
747
+ var useQwenAuth = /* @__PURE__ */ __name((pendingAuthType, isAuthenticating) => {
748
+ const [qwenAuthState, setQwenAuthState] = (0, import_react2.useState)({
749
+ deviceAuth: null,
750
+ authStatus: "idle",
751
+ authMessage: null
752
+ });
753
+ const isQwenAuth = pendingAuthType === "qwen-oauth" /* QWEN_OAUTH */;
754
+ (0, import_react2.useEffect)(() => {
755
+ if (!isQwenAuth || !isAuthenticating) {
756
+ setQwenAuthState({
757
+ deviceAuth: null,
758
+ authStatus: "idle",
759
+ authMessage: null
760
+ });
761
+ return;
762
+ }
763
+ setQwenAuthState((prev) => ({
764
+ ...prev,
765
+ authStatus: "idle"
766
+ }));
767
+ const handleDeviceAuth = /* @__PURE__ */ __name((deviceAuth) => {
768
+ setQwenAuthState((prev) => ({
769
+ ...prev,
770
+ deviceAuth: {
771
+ verification_uri: deviceAuth.verification_uri,
772
+ verification_uri_complete: deviceAuth.verification_uri_complete,
773
+ user_code: deviceAuth.user_code,
774
+ expires_in: deviceAuth.expires_in,
775
+ device_code: deviceAuth.device_code
776
+ },
777
+ authStatus: "polling"
778
+ }));
779
+ }, "handleDeviceAuth");
780
+ const handleAuthProgress = /* @__PURE__ */ __name((status, message) => {
781
+ setQwenAuthState((prev) => ({
782
+ ...prev,
783
+ authStatus: status,
784
+ authMessage: message || null
785
+ }));
786
+ }, "handleAuthProgress");
787
+ qwenOAuth2Events.on("auth-uri" /* AuthUri */, handleDeviceAuth);
788
+ qwenOAuth2Events.on("auth-progress" /* AuthProgress */, handleAuthProgress);
789
+ return () => {
790
+ qwenOAuth2Events.off("auth-uri" /* AuthUri */, handleDeviceAuth);
791
+ qwenOAuth2Events.off("auth-progress" /* AuthProgress */, handleAuthProgress);
792
+ };
793
+ }, [isQwenAuth, isAuthenticating]);
794
+ const cancelQwenAuth = (0, import_react2.useCallback)(() => {
795
+ qwenOAuth2Events.emit("auth-cancel" /* AuthCancel */);
796
+ setQwenAuthState({
797
+ deviceAuth: null,
798
+ authStatus: "idle",
799
+ authMessage: null
800
+ });
801
+ }, []);
802
+ return {
803
+ qwenAuthState,
804
+ cancelQwenAuth
805
+ };
806
+ }, "useQwenAuth");
807
+
808
+ // packages/cli/src/ui/auth/useAuth.ts
809
+ function normalizeModelIds(modelIdsInput) {
810
+ return modelIdsInput.split(",").map((id) => id.trim()).filter((id, index, array) => id.length > 0 && array.indexOf(id) === index);
811
+ }
812
+ __name(normalizeModelIds, "normalizeModelIds");
813
+ function maskApiKey(apiKey) {
814
+ const trimmed = apiKey.trim();
815
+ if (trimmed.length === 0) return "(not set)";
816
+ if (trimmed.length <= 6) return "***";
817
+ return `${trimmed.slice(0, 3)}...${trimmed.slice(-4)}`;
818
+ }
819
+ __name(maskApiKey, "maskApiKey");
820
+ var useAuthCommand = /* @__PURE__ */ __name((settings, config, addItem, onAuthChange) => {
821
+ const unAuthenticated = config.getAuthType() === void 0;
822
+ const [authState, setAuthState] = (0, import_react3.useState)(
823
+ unAuthenticated ? "updating" /* Updating */ : "unauthenticated" /* Unauthenticated */
824
+ );
825
+ const [authError, setAuthError] = (0, import_react3.useState)(null);
826
+ const [isAuthenticating, setIsAuthenticating] = (0, import_react3.useState)(false);
827
+ const [isAuthDialogOpen, setIsAuthDialogOpen] = (0, import_react3.useState)(unAuthenticated);
828
+ const [pendingAuthType, setPendingAuthType] = (0, import_react3.useState)(
829
+ void 0
830
+ );
831
+ const [externalAuthState, setExternalAuthState] = (0, import_react3.useState)(null);
832
+ const { qwenAuthState, cancelQwenAuth } = useQwenAuth(
833
+ pendingAuthType,
834
+ isAuthenticating
835
+ );
836
+ const openedViaCommandRef = (0, import_react3.useRef)(false);
837
+ const onAuthError = (0, import_react3.useCallback)(
838
+ (error) => {
839
+ setAuthError(error);
840
+ if (error) {
841
+ setAuthState("updating" /* Updating */);
842
+ setIsAuthDialogOpen(true);
843
+ }
844
+ },
845
+ [setAuthError, setAuthState]
846
+ );
847
+ const handleAuthFailure = (0, import_react3.useCallback)(
848
+ (error, protocolForTelemetry) => {
849
+ setIsAuthenticating(false);
850
+ setExternalAuthState(null);
851
+ const msg = t("Failed to authenticate. Message: {{message}}", {
852
+ message: getErrorMessage(error)
853
+ });
854
+ onAuthError(msg);
855
+ const effectiveProtocol = protocolForTelemetry ?? pendingAuthType;
856
+ if (effectiveProtocol) {
857
+ logAuth(
858
+ config,
859
+ new AuthEvent(effectiveProtocol, "manual", "error", msg)
860
+ );
861
+ }
862
+ },
863
+ [onAuthError, pendingAuthType, config]
864
+ );
865
+ const completeAuthentication = (0, import_react3.useCallback)(() => {
866
+ setAuthError(null);
867
+ setAuthState("authenticated" /* Authenticated */);
868
+ setPendingAuthType(void 0);
869
+ setIsAuthDialogOpen(false);
870
+ setIsAuthenticating(false);
871
+ onAuthChange?.();
872
+ }, [onAuthChange]);
873
+ const handleProviderSubmit = (0, import_react3.useCallback)(
874
+ async (providerConfig, inputs) => {
875
+ const protocol = inputs.protocol ?? providerConfig.protocol;
876
+ try {
877
+ setPendingAuthType(protocol);
878
+ setIsAuthenticating(true);
879
+ setAuthError(null);
880
+ const plan = buildInstallPlan(providerConfig, inputs);
881
+ await applyProviderInstallPlan(plan, {
882
+ settings: createLoadedSettingsAdapter(settings),
883
+ reloadModelProviders: /* @__PURE__ */ __name((mp) => config.reloadModelProvidersConfig(mp), "reloadModelProviders"),
884
+ syncAuthState: /* @__PURE__ */ __name((authType, modelId, baseUrl) => config.getModelsConfig().syncAfterAuthRefresh(authType, modelId, baseUrl), "syncAuthState"),
885
+ refreshAuth: /* @__PURE__ */ __name((authType) => config.refreshAuth(authType), "refreshAuth")
886
+ });
887
+ completeAuthentication();
888
+ const feedbackItem = {
889
+ type: "info" /* INFO */,
890
+ text: t(
891
+ "Successfully configured {{provider}}. Use /model to switch models.",
892
+ { provider: providerConfig.label }
893
+ )
894
+ };
895
+ addItem(feedbackItem, Date.now());
896
+ if (openedViaCommandRef.current) {
897
+ openedViaCommandRef.current = false;
898
+ config.getChatRecordingService?.()?.recordSlashCommand({
899
+ phase: "result",
900
+ rawCommand: "/auth",
901
+ outputHistoryItems: [feedbackItem]
902
+ });
903
+ }
904
+ logAuth(config, new AuthEvent(protocol, "manual", "success"));
905
+ } catch (error) {
906
+ handleAuthFailure(error, protocol);
907
+ }
908
+ },
909
+ [settings, config, completeAuthentication, addItem, handleAuthFailure]
910
+ );
911
+ const openAuthDialog = (0, import_react3.useCallback)(() => {
912
+ openedViaCommandRef.current = true;
913
+ setIsAuthDialogOpen(true);
914
+ }, []);
915
+ const closeAuthDialog = (0, import_react3.useCallback)(() => {
916
+ openedViaCommandRef.current = false;
917
+ setIsAuthDialogOpen(false);
918
+ setAuthError(null);
919
+ }, []);
920
+ const cancelAuthentication = (0, import_react3.useCallback)(() => {
921
+ if (isAuthenticating && pendingAuthType === "qwen-oauth" /* QWEN_OAUTH */) {
922
+ cancelQwenAuth();
923
+ }
924
+ if (isAuthenticating && pendingAuthType) {
925
+ logAuth(config, new AuthEvent(pendingAuthType, "manual", "cancelled"));
926
+ }
927
+ setIsAuthenticating(false);
928
+ setExternalAuthState(null);
929
+ setIsAuthDialogOpen(true);
930
+ setAuthError(null);
931
+ }, [isAuthenticating, pendingAuthType, cancelQwenAuth, config]);
932
+ (0, import_react3.useEffect)(() => {
933
+ const val = process.env["QWEN_DEFAULT_AUTH_TYPE"];
934
+ const valid = [
935
+ "qwen-oauth" /* QWEN_OAUTH */,
936
+ "openai" /* USE_OPENAI */,
937
+ "anthropic" /* USE_ANTHROPIC */,
938
+ "gemini" /* USE_GEMINI */,
939
+ "vertex-ai" /* USE_VERTEX_AI */
940
+ ];
941
+ if (val && !valid.includes(val)) {
942
+ onAuthError(
943
+ t(
944
+ 'Invalid QWEN_DEFAULT_AUTH_TYPE value: "{{value}}". Valid values are: {{validValues}}',
945
+ { value: val, validValues: valid.join(", ") }
946
+ )
947
+ );
948
+ }
949
+ }, [onAuthError]);
950
+ const state = (0, import_react3.useMemo)(
951
+ () => ({
952
+ authError,
953
+ isAuthDialogOpen,
954
+ isAuthenticating,
955
+ pendingAuthType,
956
+ externalAuthState,
957
+ qwenAuthState
958
+ }),
959
+ [
960
+ authError,
961
+ isAuthDialogOpen,
962
+ isAuthenticating,
963
+ pendingAuthType,
964
+ externalAuthState,
965
+ qwenAuthState
966
+ ]
967
+ );
968
+ const actions = (0, import_react3.useMemo)(
969
+ () => ({
970
+ setAuthState,
971
+ onAuthError,
972
+ closeAuthDialog,
973
+ handleProviderSubmit,
974
+ openAuthDialog,
975
+ cancelAuthentication
976
+ }),
977
+ [
978
+ setAuthState,
979
+ onAuthError,
980
+ closeAuthDialog,
981
+ handleProviderSubmit,
982
+ openAuthDialog,
983
+ cancelAuthentication
984
+ ]
985
+ );
986
+ return {
987
+ authState,
988
+ setAuthState,
989
+ authError,
990
+ onAuthError,
991
+ isAuthDialogOpen,
992
+ isAuthenticating,
993
+ pendingAuthType,
994
+ externalAuthState,
995
+ qwenAuthState,
996
+ closeAuthDialog,
997
+ handleProviderSubmit,
998
+ openAuthDialog,
999
+ cancelAuthentication,
1000
+ state,
1001
+ actions
1002
+ };
1003
+ }, "useAuthCommand");
1004
+
1005
+ // packages/cli/src/ui/components/mcp/utils.ts
1006
+ init_esbuild_shims();
1007
+
1008
+ // packages/cli/src/ui/components/mcp/constants.ts
1009
+ init_esbuild_shims();
1010
+ var VISIBLE_TOOLS_COUNT = 10;
1011
+ var VISIBLE_RESOURCES_COUNT = 10;
1012
+ var SOURCE_ORDER = [
1013
+ "user",
1014
+ "project",
1015
+ "workspace",
1016
+ "system",
1017
+ "extension"
1018
+ ];
1019
+
1020
+ // packages/cli/src/ui/components/mcp/utils.ts
1021
+ function getSourceDisplayName(source) {
1022
+ switch (source) {
1023
+ case "user":
1024
+ return t("User MCPs");
1025
+ case "project":
1026
+ return t("Project MCPs");
1027
+ case "workspace":
1028
+ return t("Workspace Settings");
1029
+ case "system":
1030
+ return t("System Settings");
1031
+ case "extension":
1032
+ return t("Extension MCPs");
1033
+ default:
1034
+ return source;
1035
+ }
1036
+ }
1037
+ __name(getSourceDisplayName, "getSourceDisplayName");
1038
+ function groupServersBySource(servers) {
1039
+ const groups = /* @__PURE__ */ new Map();
1040
+ for (const server of servers) {
1041
+ const existing = groups.get(server.source);
1042
+ if (existing) {
1043
+ existing.push(server);
1044
+ } else {
1045
+ groups.set(server.source, [server]);
1046
+ }
1047
+ }
1048
+ const result = [];
1049
+ for (const source of SOURCE_ORDER) {
1050
+ const servers2 = groups.get(source);
1051
+ if (servers2 && servers2.length > 0) {
1052
+ result.push({
1053
+ source,
1054
+ displayName: getSourceDisplayName(source),
1055
+ servers: servers2
1056
+ });
1057
+ }
1058
+ }
1059
+ return result;
1060
+ }
1061
+ __name(groupServersBySource, "groupServersBySource");
1062
+ function getStatusColor(status) {
1063
+ switch (status) {
1064
+ case "connected":
1065
+ return "green";
1066
+ case "connecting":
1067
+ return "yellow";
1068
+ case "disconnected":
1069
+ return "red";
1070
+ default:
1071
+ return "gray";
1072
+ }
1073
+ }
1074
+ __name(getStatusColor, "getStatusColor");
1075
+ function getStatusIcon(status) {
1076
+ switch (status) {
1077
+ case "connected":
1078
+ return "\u2713";
1079
+ case "connecting":
1080
+ return "\u2026";
1081
+ case "disconnected":
1082
+ return "\u2717";
1083
+ default:
1084
+ return "?";
1085
+ }
1086
+ }
1087
+ __name(getStatusIcon, "getStatusIcon");
1088
+ function formatServerCommand(server) {
1089
+ const config = server.config;
1090
+ if (config.httpUrl) {
1091
+ return `${config.httpUrl} (http)`;
1092
+ }
1093
+ if (config.url) {
1094
+ return `${config.url} (sse)`;
1095
+ }
1096
+ if (config.command) {
1097
+ const args = config.args?.join(" ") || "";
1098
+ return `${config.command} ${args} (stdio)`.trim();
1099
+ }
1100
+ return t("Unknown");
1101
+ }
1102
+ __name(formatServerCommand, "formatServerCommand");
1103
+ function isToolValid(name, description) {
1104
+ return !!name && !!description;
1105
+ }
1106
+ __name(isToolValid, "isToolValid");
1107
+ function getToolInvalidReasons(name, description) {
1108
+ const reasons = [];
1109
+ if (!name) reasons.push(t("missing name"));
1110
+ if (!description) reasons.push(t("missing description"));
1111
+ return reasons;
1112
+ }
1113
+ __name(getToolInvalidReasons, "getToolInvalidReasons");
1114
+
1115
+ // packages/cli/src/config/dialogScopeUtils.ts
1116
+ init_esbuild_shims();
1117
+ var SCOPE_LABELS = {
1118
+ ["User" /* User */]: "User Settings",
1119
+ ["Workspace" /* Workspace */]: "Workspace Settings"
1120
+ // TODO: migrate system settings to user settings
1121
+ // we don't want to save settings to system scope, it is a troublemaker
1122
+ // comment it out for now.
1123
+ // [SettingScope.System]: 'System Settings',
1124
+ };
1125
+ function getScopeItems() {
1126
+ return [
1127
+ { label: SCOPE_LABELS["User" /* User */], value: "User" /* User */ },
1128
+ {
1129
+ label: SCOPE_LABELS["Workspace" /* Workspace */],
1130
+ value: "Workspace" /* Workspace */
1131
+ }
1132
+ // { label: SCOPE_LABELS[SettingScope.System], value: SettingScope.System },
1133
+ ];
1134
+ }
1135
+ __name(getScopeItems, "getScopeItems");
1136
+ function getScopeMessageForSetting(settingKey, selectedScope, settings) {
1137
+ const otherScopes = Object.values(SettingScope).filter(
1138
+ (scope) => scope !== selectedScope
1139
+ );
1140
+ const modifiedInOtherScopes = otherScopes.filter((scope) => {
1141
+ const scopeSettings = settings.forScope(scope).settings;
1142
+ return settingExistsInScope(settingKey, scopeSettings);
1143
+ });
1144
+ if (modifiedInOtherScopes.length === 0) {
1145
+ return "";
1146
+ }
1147
+ const modifiedScopesStr = modifiedInOtherScopes.join(", ");
1148
+ const currentScopeSettings = settings.forScope(selectedScope).settings;
1149
+ const existsInCurrentScope = settingExistsInScope(
1150
+ settingKey,
1151
+ currentScopeSettings
1152
+ );
1153
+ return existsInCurrentScope ? `(Also modified in ${modifiedScopesStr})` : `(Modified in ${modifiedScopesStr})`;
1154
+ }
1155
+ __name(getScopeMessageForSetting, "getScopeMessageForSetting");
1156
+
1157
+ // packages/cli/src/ui/components/stats-helpers.tsx
1158
+ init_esbuild_shims();
1159
+ var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
1160
+ var TAB_DEFS = [
1161
+ { tab: "session", label: /* @__PURE__ */ __name(() => t("Session"), "label") },
1162
+ { tab: "activity", label: /* @__PURE__ */ __name(() => t("Activity"), "label") },
1163
+ { tab: "efficiency", label: /* @__PURE__ */ __name(() => t("Efficiency"), "label") }
1164
+ ];
1165
+ var RANGE_CYCLE = ["all", "month", "week", "today"];
1166
+ function getHeatmapColors() {
1167
+ return {
1168
+ 0: "#161b22",
1169
+ 1: "#0e4429",
1170
+ 2: "#006d32",
1171
+ 3: "#26a641",
1172
+ 4: "#39d353"
1173
+ };
1174
+ }
1175
+ __name(getHeatmapColors, "getHeatmapColors");
1176
+ function getSeriesColors() {
1177
+ return [
1178
+ theme.text.link,
1179
+ theme.status.error,
1180
+ theme.text.accent,
1181
+ theme.status.success,
1182
+ theme.status.warning,
1183
+ theme.text.code
1184
+ ];
1185
+ }
1186
+ __name(getSeriesColors, "getSeriesColors");
1187
+ function getRangeLabel(range) {
1188
+ const labels = {
1189
+ today: t("Today"),
1190
+ all: t("All time"),
1191
+ week: t("Last 7 days"),
1192
+ month: t("Last 30 days")
1193
+ };
1194
+ return labels[range] ?? range;
1195
+ }
1196
+ __name(getRangeLabel, "getRangeLabel");
1197
+ function fmtTokens(n) {
1198
+ if (n >= 1e6) return `${(n / 1e6).toFixed(1)}m`;
1199
+ if (n >= 1e3) return `${(n / 1e3).toFixed(1)}k`;
1200
+ return `${n}`;
1201
+ }
1202
+ __name(fmtTokens, "fmtTokens");
1203
+ function fmtDurationShort(ms) {
1204
+ const totalMinutes = Math.floor(ms / 6e4);
1205
+ const days = Math.floor(totalMinutes / 1440);
1206
+ const hours = Math.floor(totalMinutes % 1440 / 60);
1207
+ const minutes = totalMinutes % 60;
1208
+ const d = t("d");
1209
+ const h = t("h");
1210
+ const m = t("m");
1211
+ if (days > 0) return `${days}${d} ${hours}${h} ${minutes}${m}`;
1212
+ if (hours > 0) return `${hours}${h} ${minutes}${m}`;
1213
+ return `${minutes}${m}`;
1214
+ }
1215
+ __name(fmtDurationShort, "fmtDurationShort");
1216
+ function fmtSuccessBar(rate) {
1217
+ const filled = Math.max(0, Math.min(10, Math.round(rate / 10)));
1218
+ return "\u2588".repeat(filled) + "\u2591".repeat(10 - filled);
1219
+ }
1220
+ __name(fmtSuccessBar, "fmtSuccessBar");
1221
+ function getSuccessColor(rate) {
1222
+ if (rate >= 95) return theme.status.success;
1223
+ if (rate >= 80) return theme.status.warning;
1224
+ return theme.status.error;
1225
+ }
1226
+ __name(getSuccessColor, "getSuccessColor");
1227
+ function getCacheColor(rate) {
1228
+ if (rate >= 85) return theme.status.success;
1229
+ if (rate >= 70) return theme.status.warning;
1230
+ return theme.status.error;
1231
+ }
1232
+ __name(getCacheColor, "getCacheColor");
1233
+ var TableRow = /* @__PURE__ */ __name(({ cells }) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { children: cells.map((cell, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Box_default, { width: cell.width, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Text, { color: cell.color, bold: cell.bold, children: cell.text }) }, i)) }), "TableRow");
1234
+
1235
+ // packages/cli/src/ui/auth/useProviderSetupFlow.ts
1236
+ init_esbuild_shims();
1237
+ var import_react4 = __toESM(require_react(), 1);
1238
+ var STEP_ORDER = [
1239
+ "protocol",
1240
+ "baseUrl",
1241
+ "apiKey",
1242
+ "models",
1243
+ "advancedConfig",
1244
+ "review"
1245
+ ];
1246
+ function getVisibleSteps(config) {
1247
+ return STEP_ORDER.filter((step) => {
1248
+ if (step === "review") return config.showAdvancedConfig === true;
1249
+ return shouldShowStep(config, step);
1250
+ });
1251
+ }
1252
+ __name(getVisibleSteps, "getVisibleSteps");
1253
+ function useProviderSetupFlow(onSubmit) {
1254
+ const [provider, setProvider] = (0, import_react4.useState)(null);
1255
+ const [visibleSteps, setVisibleSteps] = (0, import_react4.useState)([]);
1256
+ const [stepIndex, setStepIndex] = (0, import_react4.useState)(0);
1257
+ const [protocol, setProtocol] = (0, import_react4.useState)("openai" /* USE_OPENAI */);
1258
+ const [baseUrl, setBaseUrl] = (0, import_react4.useState)("");
1259
+ const [baseUrlPlaceholder, setBaseUrlPlaceholder] = (0, import_react4.useState)("");
1260
+ const [baseUrlOptionIndex, setBaseUrlOptionIndex] = (0, import_react4.useState)(0);
1261
+ const [baseUrlError, setBaseUrlError] = (0, import_react4.useState)(null);
1262
+ const [apiKey, setApiKey] = (0, import_react4.useState)("");
1263
+ const [apiKeyError, setApiKeyError] = (0, import_react4.useState)(null);
1264
+ const [modelIds, setModelIds] = (0, import_react4.useState)("");
1265
+ const [modelIdsError, setModelIdsError] = (0, import_react4.useState)(null);
1266
+ const [thinkingEnabled, setThinkingEnabled] = (0, import_react4.useState)(false);
1267
+ const [modalityEnabled, setModalityEnabled] = (0, import_react4.useState)(false);
1268
+ const [modalityImage, setModalityImage] = (0, import_react4.useState)(true);
1269
+ const [modalityVideo, setModalityVideo] = (0, import_react4.useState)(true);
1270
+ const [modalityAudio, setModalityAudio] = (0, import_react4.useState)(false);
1271
+ const [modalityPdf, setModalityPdf] = (0, import_react4.useState)(false);
1272
+ const [contextWindowSize, setContextWindowSize] = (0, import_react4.useState)("");
1273
+ const [focusedConfigIndex, setFocusedConfigIndex] = (0, import_react4.useState)(0);
1274
+ const currentStep = visibleSteps[stepIndex] ?? null;
1275
+ const start = (0, import_react4.useCallback)(
1276
+ (config, initialProtocol, existingEnv, existingModelIds) => {
1277
+ setProvider(config);
1278
+ const steps = getVisibleSteps(config);
1279
+ setVisibleSteps(steps);
1280
+ setStepIndex(0);
1281
+ const proto = initialProtocol ?? config.protocol;
1282
+ setProtocol(proto);
1283
+ const resolved = resolveBaseUrl(config);
1284
+ setBaseUrl(resolved);
1285
+ setBaseUrlPlaceholder(
1286
+ resolved ? "" : getDefaultBaseUrlForProtocol(proto)
1287
+ );
1288
+ setBaseUrlOptionIndex(0);
1289
+ setBaseUrlError(null);
1290
+ let prefillKey = "";
1291
+ if (existingEnv) {
1292
+ const envKeyName = typeof config.envKey === "function" ? config.envKey(proto, resolved) : config.envKey;
1293
+ prefillKey = existingEnv[envKeyName] ?? "";
1294
+ }
1295
+ setApiKey(prefillKey);
1296
+ setApiKeyError(null);
1297
+ const defaultIds = getDefaultModelIds(config);
1298
+ const customIds = existingModelIds ?? [];
1299
+ setModelIds([...defaultIds, ...customIds].join(", "));
1300
+ setModelIdsError(null);
1301
+ setThinkingEnabled(false);
1302
+ setModalityEnabled(false);
1303
+ setModalityImage(true);
1304
+ setModalityVideo(true);
1305
+ setModalityAudio(false);
1306
+ setModalityPdf(false);
1307
+ setContextWindowSize("");
1308
+ setFocusedConfigIndex(0);
1309
+ },
1310
+ []
1311
+ );
1312
+ const reset = (0, import_react4.useCallback)(() => {
1313
+ setProvider(null);
1314
+ setVisibleSteps([]);
1315
+ setStepIndex(0);
1316
+ }, []);
1317
+ const goBack = (0, import_react4.useCallback)(() => {
1318
+ if (stepIndex > 0) {
1319
+ setStepIndex((i) => i - 1);
1320
+ return true;
1321
+ }
1322
+ reset();
1323
+ return false;
1324
+ }, [stepIndex, reset]);
1325
+ const goNext = (0, import_react4.useCallback)(() => {
1326
+ setStepIndex((i) => Math.min(i + 1, visibleSteps.length - 1));
1327
+ }, [visibleSteps]);
1328
+ const selectProtocol = (0, import_react4.useCallback)(
1329
+ (selectedProtocol) => {
1330
+ setProtocol(selectedProtocol);
1331
+ setBaseUrl("");
1332
+ setBaseUrlPlaceholder(getDefaultBaseUrlForProtocol(selectedProtocol));
1333
+ setApiKey("");
1334
+ setApiKeyError(null);
1335
+ goNext();
1336
+ },
1337
+ [goNext]
1338
+ );
1339
+ const selectBaseUrl = (0, import_react4.useCallback)(
1340
+ (selectedUrl) => {
1341
+ setBaseUrl(selectedUrl);
1342
+ setBaseUrlError(null);
1343
+ goNext();
1344
+ },
1345
+ [goNext]
1346
+ );
1347
+ const submitBaseUrl = (0, import_react4.useCallback)(() => {
1348
+ const effective = baseUrl.trim() || baseUrlPlaceholder.trim();
1349
+ if (!effective) {
1350
+ setBaseUrlError(t("Base URL cannot be empty."));
1351
+ return false;
1352
+ }
1353
+ if (!/^https?:\/\//i.test(effective)) {
1354
+ setBaseUrlError(t("Base URL must start with http:// or https://."));
1355
+ return false;
1356
+ }
1357
+ if (!baseUrl.trim()) {
1358
+ setBaseUrl(effective);
1359
+ }
1360
+ setBaseUrlError(null);
1361
+ goNext();
1362
+ return true;
1363
+ }, [baseUrl, baseUrlPlaceholder, goNext]);
1364
+ const changeBaseUrl = (0, import_react4.useCallback)((value) => {
1365
+ setBaseUrl(value);
1366
+ setBaseUrlError(null);
1367
+ }, []);
1368
+ const changeApiKey = (0, import_react4.useCallback)((value) => {
1369
+ setApiKey(value);
1370
+ setApiKeyError(null);
1371
+ }, []);
1372
+ const buildCurrentInputs = (0, import_react4.useCallback)(
1373
+ (overrides) => ({
1374
+ protocol: provider?.protocolOptions ? protocol : void 0,
1375
+ baseUrl: baseUrl.trim(),
1376
+ apiKey: apiKey.trim(),
1377
+ modelIds: normalizeModelIds(modelIds),
1378
+ ...overrides
1379
+ }),
1380
+ [provider, protocol, baseUrl, apiKey, modelIds]
1381
+ );
1382
+ const submitOrNext = (0, import_react4.useCallback)(
1383
+ (overrides) => {
1384
+ if (stepIndex >= visibleSteps.length - 1) {
1385
+ if (provider) void onSubmit(provider, buildCurrentInputs(overrides));
1386
+ } else {
1387
+ goNext();
1388
+ }
1389
+ },
1390
+ [stepIndex, visibleSteps, provider, onSubmit, buildCurrentInputs, goNext]
1391
+ );
1392
+ const submitApiKey = (0, import_react4.useCallback)(
1393
+ (keyOverride) => {
1394
+ const trimmed = (keyOverride ?? apiKey).trim();
1395
+ if (!trimmed) {
1396
+ setApiKeyError(t("API key cannot be empty."));
1397
+ return false;
1398
+ }
1399
+ if (provider?.validateApiKey) {
1400
+ const err = provider.validateApiKey(trimmed, baseUrl);
1401
+ if (err) {
1402
+ setApiKeyError(err);
1403
+ return false;
1404
+ }
1405
+ }
1406
+ setApiKeyError(null);
1407
+ setApiKey(trimmed);
1408
+ submitOrNext({ apiKey: trimmed });
1409
+ return true;
1410
+ },
1411
+ [apiKey, provider, baseUrl, submitOrNext]
1412
+ );
1413
+ const highlightBaseUrl = (0, import_react4.useCallback)(
1414
+ (url) => {
1415
+ if (provider && Array.isArray(provider.baseUrl)) {
1416
+ const idx = provider.baseUrl.findIndex((o) => o.url === url);
1417
+ setBaseUrlOptionIndex(idx >= 0 ? idx : 0);
1418
+ }
1419
+ },
1420
+ [provider]
1421
+ );
1422
+ const changeModelIds = (0, import_react4.useCallback)((value) => {
1423
+ setModelIds(value);
1424
+ setModelIdsError(null);
1425
+ }, []);
1426
+ const clearModelIdsError = (0, import_react4.useCallback)(() => {
1427
+ setModelIdsError(null);
1428
+ }, []);
1429
+ const submitModelIds = (0, import_react4.useCallback)(
1430
+ (overrides) => {
1431
+ const normalized = overrides?.modelIds ?? normalizeModelIds(modelIds);
1432
+ if (normalized.length === 0) {
1433
+ setModelIdsError(t("Model IDs cannot be empty."));
1434
+ return false;
1435
+ }
1436
+ setModelIds(normalized.join(", "));
1437
+ setModelIdsError(null);
1438
+ submitOrNext({ ...overrides, modelIds: normalized });
1439
+ return true;
1440
+ },
1441
+ [modelIds, submitOrNext]
1442
+ );
1443
+ const advancedOptionCount = modalityEnabled ? 7 : 3;
1444
+ const moveAdvancedFocusUp = (0, import_react4.useCallback)(() => {
1445
+ setFocusedConfigIndex((v) => v <= 0 ? advancedOptionCount - 1 : v - 1);
1446
+ }, [advancedOptionCount]);
1447
+ const moveAdvancedFocusDown = (0, import_react4.useCallback)(() => {
1448
+ setFocusedConfigIndex((v) => v >= advancedOptionCount - 1 ? 0 : v + 1);
1449
+ }, [advancedOptionCount]);
1450
+ const toggleFocusedAdvancedOption = (0, import_react4.useCallback)(() => {
1451
+ switch (focusedConfigIndex) {
1452
+ case 0:
1453
+ setThinkingEnabled((v) => !v);
1454
+ break;
1455
+ case 1:
1456
+ setModalityEnabled((v) => !v);
1457
+ break;
1458
+ case 2:
1459
+ setModalityImage((v) => !v);
1460
+ break;
1461
+ case 3:
1462
+ setModalityVideo((v) => !v);
1463
+ break;
1464
+ case 4:
1465
+ setModalityAudio((v) => !v);
1466
+ break;
1467
+ case 5:
1468
+ setModalityPdf((v) => !v);
1469
+ break;
1470
+ default:
1471
+ break;
1472
+ }
1473
+ }, [focusedConfigIndex]);
1474
+ const submitAdvancedConfig = (0, import_react4.useCallback)(() => {
1475
+ goNext();
1476
+ }, [goNext]);
1477
+ const changeContextWindowSize = (0, import_react4.useCallback)((value) => {
1478
+ setContextWindowSize(value.replace(/[^0-9]/g, ""));
1479
+ }, []);
1480
+ const submit = (0, import_react4.useCallback)(() => {
1481
+ if (!provider) return;
1482
+ const multimodal = modalityEnabled ? {
1483
+ image: modalityImage || void 0,
1484
+ video: modalityVideo || void 0,
1485
+ audio: modalityAudio || void 0,
1486
+ pdf: modalityPdf || void 0
1487
+ } : void 0;
1488
+ const ctxSize = parseInt(contextWindowSize, 10);
1489
+ const hasAdvanced = thinkingEnabled || modalityEnabled || ctxSize > 0 && !isNaN(ctxSize);
1490
+ const advancedConfig = hasAdvanced ? {
1491
+ enableThinking: thinkingEnabled || void 0,
1492
+ multimodal,
1493
+ contextWindowSize: ctxSize > 0 && !isNaN(ctxSize) ? ctxSize : void 0
1494
+ } : void 0;
1495
+ void onSubmit(provider, buildCurrentInputs({ advancedConfig }));
1496
+ }, [
1497
+ provider,
1498
+ thinkingEnabled,
1499
+ modalityEnabled,
1500
+ modalityImage,
1501
+ modalityVideo,
1502
+ modalityAudio,
1503
+ modalityPdf,
1504
+ contextWindowSize,
1505
+ onSubmit,
1506
+ buildCurrentInputs
1507
+ ]);
1508
+ const getPreviewJson = (0, import_react4.useCallback)(() => {
1509
+ if (!provider) return "";
1510
+ const envKey = typeof provider.envKey === "function" ? provider.envKey(protocol, baseUrl.trim()) : provider.envKey;
1511
+ const normalizedIds = normalizeModelIds(modelIds);
1512
+ const masked = maskApiKey(apiKey);
1513
+ const genConfig = {};
1514
+ if (thinkingEnabled) genConfig["extra_body"] = { enable_thinking: true };
1515
+ if (modalityEnabled) {
1516
+ const mod = {};
1517
+ if (modalityImage) mod["image"] = true;
1518
+ if (modalityVideo) mod["video"] = true;
1519
+ if (modalityAudio) mod["audio"] = true;
1520
+ if (modalityPdf) mod["pdf"] = true;
1521
+ if (Object.keys(mod).length > 0) genConfig["modalities"] = mod;
1522
+ }
1523
+ const ctxSize = parseInt(contextWindowSize, 10);
1524
+ if (ctxSize > 0 && !isNaN(ctxSize))
1525
+ genConfig["contextWindowSize"] = ctxSize;
1526
+ const hasGenConfig = Object.keys(genConfig).length > 0;
1527
+ const models = normalizedIds.map((id) => {
1528
+ const entry = {
1529
+ id,
1530
+ name: id,
1531
+ baseUrl: baseUrl.trim(),
1532
+ envKey
1533
+ };
1534
+ if (hasGenConfig) entry["generationConfig"] = genConfig;
1535
+ return entry;
1536
+ });
1537
+ return JSON.stringify(
1538
+ {
1539
+ env: { [envKey]: masked },
1540
+ modelProviders: { [protocol]: models },
1541
+ security: { auth: { selectedType: protocol } },
1542
+ model: { name: normalizedIds[0] }
1543
+ },
1544
+ null,
1545
+ 2
1546
+ );
1547
+ }, [
1548
+ provider,
1549
+ protocol,
1550
+ baseUrl,
1551
+ apiKey,
1552
+ modelIds,
1553
+ thinkingEnabled,
1554
+ modalityEnabled,
1555
+ modalityImage,
1556
+ modalityVideo,
1557
+ modalityAudio,
1558
+ modalityPdf,
1559
+ contextWindowSize
1560
+ ]);
1561
+ const state = {
1562
+ provider,
1563
+ step: currentStep,
1564
+ stepIndex: stepIndex + 1,
1565
+ // 1-based for display
1566
+ totalSteps: visibleSteps.length,
1567
+ protocol,
1568
+ baseUrl,
1569
+ baseUrlPlaceholder,
1570
+ baseUrlOptionIndex,
1571
+ baseUrlError,
1572
+ apiKey,
1573
+ apiKeyError,
1574
+ modelIds,
1575
+ modelIdsError,
1576
+ thinkingEnabled,
1577
+ modalityEnabled,
1578
+ modalityImage,
1579
+ modalityVideo,
1580
+ modalityAudio,
1581
+ modalityPdf,
1582
+ contextWindowSize,
1583
+ focusedConfigIndex,
1584
+ previewJson: currentStep === "review" ? getPreviewJson() : ""
1585
+ };
1586
+ return {
1587
+ state,
1588
+ start,
1589
+ reset,
1590
+ goBack,
1591
+ selectProtocol,
1592
+ selectBaseUrl,
1593
+ highlightBaseUrl,
1594
+ submitBaseUrl,
1595
+ changeBaseUrl,
1596
+ changeApiKey,
1597
+ submitApiKey,
1598
+ changeModelIds,
1599
+ clearModelIdsError,
1600
+ submitModelIds,
1601
+ moveAdvancedFocusUp,
1602
+ moveAdvancedFocusDown,
1603
+ toggleFocusedAdvancedOption,
1604
+ changeContextWindowSize,
1605
+ submitAdvancedConfig,
1606
+ submit
1607
+ };
1608
+ }
1609
+ __name(useProviderSetupFlow, "useProviderSetupFlow");
1610
+
1611
+ // packages/cli/src/ui/editors/editorSettingsManager.ts
1612
+ init_esbuild_shims();
1613
+ var EDITOR_DISPLAY_NAMES = {
1614
+ cursor: "Cursor",
1615
+ emacs: "Emacs",
1616
+ neovim: "Neovim",
1617
+ vim: "Vim",
1618
+ vscode: "VS Code",
1619
+ vscodium: "VSCodium",
1620
+ windsurf: "Windsurf",
1621
+ zed: "Zed",
1622
+ trae: "Trae"
1623
+ };
1624
+ var EditorSettingsManager = class {
1625
+ static {
1626
+ __name(this, "EditorSettingsManager");
1627
+ }
1628
+ availableEditors;
1629
+ constructor() {
1630
+ const editorTypes = Object.keys(
1631
+ EDITOR_DISPLAY_NAMES
1632
+ ).sort();
1633
+ this.availableEditors = [
1634
+ {
1635
+ name: "None",
1636
+ type: "not_set",
1637
+ disabled: false
1638
+ },
1639
+ ...editorTypes.map((type) => {
1640
+ const hasEditor = checkHasEditorType(type);
1641
+ const isAllowedInSandbox = allowEditorTypeInSandbox(type);
1642
+ let labelSuffix = !isAllowedInSandbox ? " (Not available in sandbox)" : "";
1643
+ labelSuffix = !hasEditor ? " (Not installed)" : labelSuffix;
1644
+ return {
1645
+ name: EDITOR_DISPLAY_NAMES[type] + labelSuffix,
1646
+ type,
1647
+ disabled: !hasEditor || !isAllowedInSandbox
1648
+ };
1649
+ })
1650
+ ];
1651
+ }
1652
+ getAvailableEditorDisplays() {
1653
+ return this.availableEditors;
1654
+ }
1655
+ };
1656
+ var editorSettingsManager = new EditorSettingsManager();
1657
+
1658
+ // packages/cli/src/ui/statusLinePresets.ts
1659
+ init_esbuild_shims();
1660
+ import nodePath from "node:path";
1661
+ var STATUS_LINE_PRESET_ITEM_IDS = [
1662
+ "project-name",
1663
+ "git-branch",
1664
+ "model-with-reasoning",
1665
+ "model",
1666
+ "context-remaining",
1667
+ "total-input-tokens",
1668
+ "total-output-tokens",
1669
+ "current-dir",
1670
+ "pull-request-number",
1671
+ "branch-changes",
1672
+ "context-used",
1673
+ "run-state",
1674
+ "qwen-version",
1675
+ "context-window-size",
1676
+ "used-tokens",
1677
+ "session-id"
1678
+ ];
1679
+ function aggregateModelTokens(metrics) {
1680
+ let totalInputTokens = 0;
1681
+ let totalOutputTokens = 0;
1682
+ for (const modelMetrics of Object.values(metrics.models)) {
1683
+ totalInputTokens += modelMetrics.tokens.prompt;
1684
+ totalOutputTokens += modelMetrics.tokens.candidates;
1685
+ }
1686
+ return { totalInputTokens, totalOutputTokens };
1687
+ }
1688
+ __name(aggregateModelTokens, "aggregateModelTokens");
1689
+ var STATUS_LINE_PRESET_ITEMS = [
1690
+ {
1691
+ id: "project-name",
1692
+ label: "project-name",
1693
+ description: "Project name when available",
1694
+ defaultSelected: true
1695
+ },
1696
+ {
1697
+ id: "git-branch",
1698
+ label: "git-branch",
1699
+ description: "Current Git branch when available",
1700
+ defaultSelected: true
1701
+ },
1702
+ {
1703
+ id: "model-with-reasoning",
1704
+ label: "model-with-reasoning",
1705
+ description: "Current model name with reasoning level when available",
1706
+ defaultSelected: true
1707
+ },
1708
+ {
1709
+ id: "model",
1710
+ label: "model-only",
1711
+ description: "Current model name without reasoning level"
1712
+ },
1713
+ {
1714
+ id: "context-remaining",
1715
+ label: "context-remaining",
1716
+ description: "Percentage of context window remaining"
1717
+ },
1718
+ {
1719
+ id: "total-input-tokens",
1720
+ label: "total-input-tokens",
1721
+ description: "Total input tokens used in session"
1722
+ },
1723
+ {
1724
+ id: "total-output-tokens",
1725
+ label: "total-output-tokens",
1726
+ description: "Total output tokens used in session"
1727
+ },
1728
+ {
1729
+ id: "current-dir",
1730
+ label: "current-dir",
1731
+ description: "Current working directory"
1732
+ },
1733
+ {
1734
+ id: "pull-request-number",
1735
+ label: "pull-request-number",
1736
+ description: "Open pull request number for the current branch"
1737
+ },
1738
+ {
1739
+ id: "branch-changes",
1740
+ label: "branch-changes",
1741
+ description: "Session file changes added and removed"
1742
+ },
1743
+ {
1744
+ id: "context-used",
1745
+ label: "context-used",
1746
+ description: "Percentage of context window used",
1747
+ defaultSelected: true
1748
+ },
1749
+ {
1750
+ id: "run-state",
1751
+ label: "run-state",
1752
+ description: "Compact session run-state text"
1753
+ },
1754
+ {
1755
+ id: "qwen-version",
1756
+ label: "qwen-version",
1757
+ description: "Qwen Code application version"
1758
+ },
1759
+ {
1760
+ id: "context-window-size",
1761
+ label: "context-window-size",
1762
+ description: "Total context window size in tokens"
1763
+ },
1764
+ {
1765
+ id: "used-tokens",
1766
+ label: "used-tokens",
1767
+ description: "Current prompt tokens used"
1768
+ },
1769
+ {
1770
+ id: "session-id",
1771
+ label: "session-id",
1772
+ description: "Current session identifier"
1773
+ }
1774
+ ];
1775
+ var STATUS_LINE_PRESET_ITEM_ID_SET = new Set(
1776
+ STATUS_LINE_PRESET_ITEM_IDS
1777
+ );
1778
+ function orderStatusLinePresetItems(items) {
1779
+ const selectedItems = new Set(
1780
+ items.filter(
1781
+ (item) => typeof item === "string" && STATUS_LINE_PRESET_ITEM_ID_SET.has(item)
1782
+ )
1783
+ );
1784
+ return STATUS_LINE_PRESET_ITEM_IDS.filter((item) => selectedItems.has(item));
1785
+ }
1786
+ __name(orderStatusLinePresetItems, "orderStatusLinePresetItems");
1787
+ var DEFAULT_STATUS_LINE_PRESET_CONFIG = {
1788
+ type: "preset",
1789
+ useThemeColors: true,
1790
+ items: orderStatusLinePresetItems(
1791
+ STATUS_LINE_PRESET_ITEMS.filter((item) => item.defaultSelected).map(
1792
+ (item) => item.id
1793
+ )
1794
+ )
1795
+ };
1796
+ function normalizeStatusLinePresetConfig(raw) {
1797
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
1798
+ return void 0;
1799
+ }
1800
+ const candidate = raw;
1801
+ if (candidate["type"] !== "preset") {
1802
+ return void 0;
1803
+ }
1804
+ const hasItemsArray = Array.isArray(candidate["items"]);
1805
+ const items = hasItemsArray ? orderStatusLinePresetItems(candidate["items"]) : [];
1806
+ return {
1807
+ type: "preset",
1808
+ useThemeColors: typeof candidate["useThemeColors"] === "boolean" ? candidate["useThemeColors"] : true,
1809
+ items: hasItemsArray ? items : [...DEFAULT_STATUS_LINE_PRESET_CONFIG.items],
1810
+ hideContextIndicator: typeof candidate["hideContextIndicator"] === "boolean" ? candidate["hideContextIndicator"] : void 0
1811
+ };
1812
+ }
1813
+ __name(normalizeStatusLinePresetConfig, "normalizeStatusLinePresetConfig");
1814
+ function formatPercent(value) {
1815
+ if (!Number.isFinite(value)) {
1816
+ return "0%";
1817
+ }
1818
+ const rounded = Math.round(value * 10) / 10;
1819
+ return `${Number.isInteger(rounded) ? rounded.toFixed(0) : rounded}%`;
1820
+ }
1821
+ __name(formatPercent, "formatPercent");
1822
+ function formatTokenCount(value) {
1823
+ if (!Number.isFinite(value) || value <= 0) {
1824
+ return "0";
1825
+ }
1826
+ if (value >= 1e6) {
1827
+ return `${(value / 1e6).toFixed(1)}m`;
1828
+ }
1829
+ if (value >= 1e3) {
1830
+ return `${(value / 1e3).toFixed(1)}k`;
1831
+ }
1832
+ return String(Math.round(value));
1833
+ }
1834
+ __name(formatTokenCount, "formatTokenCount");
1835
+ function getRunStateLabel(state) {
1836
+ switch (state) {
1837
+ case "idle" /* Idle */:
1838
+ return "Ready";
1839
+ case "responding" /* Responding */:
1840
+ return "Working";
1841
+ case "waiting_for_confirmation" /* WaitingForConfirmation */:
1842
+ return "Confirm";
1843
+ default:
1844
+ return "Working";
1845
+ }
1846
+ }
1847
+ __name(getRunStateLabel, "getRunStateLabel");
1848
+ function stripProviderPrefix(name) {
1849
+ return name.replace(/^\[[^\]]*\]\s*/, "");
1850
+ }
1851
+ __name(stripProviderPrefix, "stripProviderPrefix");
1852
+ function formatModelWithReasoning(modelDisplayName, reasoning) {
1853
+ const cleanName = stripProviderPrefix(modelDisplayName);
1854
+ if (reasoning === false) {
1855
+ return `${cleanName} reasoning off`;
1856
+ }
1857
+ if (reasoning?.effort) {
1858
+ return `${cleanName} ${reasoning.effort}`;
1859
+ }
1860
+ return cleanName;
1861
+ }
1862
+ __name(formatModelWithReasoning, "formatModelWithReasoning");
1863
+ function inferPullRequestNumber(branch) {
1864
+ if (!branch) {
1865
+ return void 0;
1866
+ }
1867
+ const match = branch.match(
1868
+ /(?:^|[/_-])(?:pr|pull|pull-request)[/_-]?#?(\d+)(?:$|[/_-])/i
1869
+ );
1870
+ return match?.[1];
1871
+ }
1872
+ __name(inferPullRequestNumber, "inferPullRequestNumber");
1873
+ function buildStatusLinePresetData(params) {
1874
+ const usedPercentage = params.contextWindowSize > 0 ? Math.min(
1875
+ 100,
1876
+ Math.max(
1877
+ 0,
1878
+ Math.round(
1879
+ params.currentUsage / params.contextWindowSize * 1e3
1880
+ ) / 10
1881
+ )
1882
+ ) : 0;
1883
+ return {
1884
+ sessionId: params.sessionId,
1885
+ version: params.version || "unknown",
1886
+ modelDisplayName: params.modelDisplayName || "unknown",
1887
+ reasoning: params.reasoning,
1888
+ currentDir: params.currentDir,
1889
+ projectName: nodePath.basename(params.currentDir) || void 0,
1890
+ branch: params.branch,
1891
+ pullRequestNumber: params.pullRequestNumber,
1892
+ contextWindowSize: params.contextWindowSize,
1893
+ usedPercentage,
1894
+ remainingPercentage: Math.round((100 - usedPercentage) * 10) / 10,
1895
+ currentUsage: params.currentUsage,
1896
+ totalInputTokens: params.totalInputTokens,
1897
+ totalOutputTokens: params.totalOutputTokens,
1898
+ totalLinesAdded: params.totalLinesAdded,
1899
+ totalLinesRemoved: params.totalLinesRemoved,
1900
+ streamingState: params.streamingState
1901
+ };
1902
+ }
1903
+ __name(buildStatusLinePresetData, "buildStatusLinePresetData");
1904
+ function formatPresetItem(item, data) {
1905
+ switch (item) {
1906
+ case "model-with-reasoning":
1907
+ return formatModelWithReasoning(data.modelDisplayName, data.reasoning);
1908
+ case "model":
1909
+ return stripProviderPrefix(data.modelDisplayName);
1910
+ case "context-remaining":
1911
+ if (data.contextWindowSize > 0) {
1912
+ return `Context ${formatPercent(data.remainingPercentage)} left`;
1913
+ }
1914
+ return void 0;
1915
+ case "current-dir":
1916
+ return data.currentDir;
1917
+ case "context-used":
1918
+ if (data.contextWindowSize > 0 && data.usedPercentage > 0) {
1919
+ return `${formatTokenCount(data.contextWindowSize)} Context ${formatPercent(data.usedPercentage)} used`;
1920
+ }
1921
+ return void 0;
1922
+ case "git-branch":
1923
+ if (data.branch) {
1924
+ return `git:(${data.branch})`;
1925
+ }
1926
+ return void 0;
1927
+ case "project-name":
1928
+ if (data.projectName) {
1929
+ return `\u279C ${data.projectName}`;
1930
+ }
1931
+ return void 0;
1932
+ case "pull-request-number": {
1933
+ const prNumber = data.pullRequestNumber ?? inferPullRequestNumber(data.branch);
1934
+ if (prNumber) {
1935
+ return `#${prNumber}`;
1936
+ }
1937
+ return void 0;
1938
+ }
1939
+ case "branch-changes":
1940
+ if (data.totalLinesAdded > 0 || data.totalLinesRemoved > 0) {
1941
+ return `+${data.totalLinesAdded} -${data.totalLinesRemoved}`;
1942
+ }
1943
+ return void 0;
1944
+ case "run-state":
1945
+ return getRunStateLabel(data.streamingState);
1946
+ case "qwen-version":
1947
+ return `v${data.version}`;
1948
+ case "context-window-size":
1949
+ if (data.contextWindowSize > 0) {
1950
+ return `${formatTokenCount(data.contextWindowSize)} window`;
1951
+ }
1952
+ return void 0;
1953
+ case "used-tokens":
1954
+ if (data.currentUsage > 0) {
1955
+ return `${formatTokenCount(data.currentUsage)} used`;
1956
+ }
1957
+ return void 0;
1958
+ case "total-input-tokens":
1959
+ return `${formatTokenCount(data.totalInputTokens)} total in`;
1960
+ case "total-output-tokens":
1961
+ return `${formatTokenCount(data.totalOutputTokens)} total out`;
1962
+ case "session-id":
1963
+ return data.sessionId || void 0;
1964
+ default: {
1965
+ item;
1966
+ return void 0;
1967
+ }
1968
+ }
1969
+ }
1970
+ __name(formatPresetItem, "formatPresetItem");
1971
+ function buildStatusLinePresetParts(config, data) {
1972
+ const parts = [];
1973
+ for (const item of orderStatusLinePresetItems(config.items)) {
1974
+ const text = formatPresetItem(item, data);
1975
+ if (text) {
1976
+ parts.push(text);
1977
+ }
1978
+ }
1979
+ return parts;
1980
+ }
1981
+ __name(buildStatusLinePresetParts, "buildStatusLinePresetParts");
1982
+ function buildStatusLinePresetLines(config, data) {
1983
+ const line = buildStatusLinePresetParts(config, data).join(" \xB7 ");
1984
+ return line ? [line] : [];
1985
+ }
1986
+ __name(buildStatusLinePresetLines, "buildStatusLinePresetLines");
1987
+
1988
+ export {
1989
+ computeWindowTitle,
1990
+ writeTerminalTitle,
1991
+ formatSessionWindowTitle,
1992
+ titleStatusPrefix,
1993
+ useLogger,
1994
+ VISIBLE_TOOLS_COUNT,
1995
+ VISIBLE_RESOURCES_COUNT,
1996
+ groupServersBySource,
1997
+ getStatusColor,
1998
+ getStatusIcon,
1999
+ formatServerCommand,
2000
+ isToolValid,
2001
+ getToolInvalidReasons,
2002
+ getScopeItems,
2003
+ getScopeMessageForSetting,
2004
+ TAB_DEFS,
2005
+ RANGE_CYCLE,
2006
+ getHeatmapColors,
2007
+ getSeriesColors,
2008
+ getRangeLabel,
2009
+ fmtTokens,
2010
+ fmtDurationShort,
2011
+ fmtSuccessBar,
2012
+ getSuccessColor,
2013
+ getCacheColor,
2014
+ TableRow,
2015
+ normalizeModelIds,
2016
+ useAuthCommand,
2017
+ useProviderSetupFlow,
2018
+ EDITOR_DISPLAY_NAMES,
2019
+ editorSettingsManager,
2020
+ aggregateModelTokens,
2021
+ STATUS_LINE_PRESET_ITEMS,
2022
+ orderStatusLinePresetItems,
2023
+ DEFAULT_STATUS_LINE_PRESET_CONFIG,
2024
+ normalizeStatusLinePresetConfig,
2025
+ buildStatusLinePresetData,
2026
+ buildStatusLinePresetLines,
2027
+ DualOutputBridge,
2028
+ RemoteInputWatcher
2029
+ };
2030
+ /**
2031
+ * @license
2032
+ * Copyright 2025 Google LLC
2033
+ * SPDX-License-Identifier: Apache-2.0
2034
+ */
2035
+ /**
2036
+ * @license
2037
+ * Copyright 2025 Qwen Team
2038
+ * SPDX-License-Identifier: Apache-2.0
2039
+ */
2040
+ /**
2041
+ * @license
2042
+ * Copyright 2025 Qwen
2043
+ * SPDX-License-Identifier: Apache-2.0
2044
+ */
2045
+ /**
2046
+ * @license
2047
+ * Copyright 2026 Qwen Team
2048
+ * SPDX-License-Identifier: Apache-2.0
2049
+ */
2050
+ /**
2051
+ * @license
2052
+ * Copyright 2026 Qwen
2053
+ * SPDX-License-Identifier: Apache-2.0
2054
+ */