@qwen-code/qwen-code 0.21.12-preview.1 → 0.21.12-preview.3

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 (157) hide show
  1. package/chunks/{MaxSizedBox-VSAJNP52.js → MaxSizedBox-EIK4BHBQ.js} +6 -6
  2. package/chunks/{StandaloneSessionPicker-N5MC42M2.js → StandaloneSessionPicker-NHVJDRYD.js} +23 -24
  3. package/chunks/{acpAgent-GUV7LTDH.js → acpAgent-37UDZP64.js} +46 -44
  4. package/chunks/{agent-WJT3BALC.js → agent-FAWBG7PP.js} +3 -3
  5. package/chunks/{agent-headless-JRRUUVP3.js → agent-headless-SHK4PCCH.js} +3 -3
  6. package/chunks/{bridge-VB3BPG7G.js → bridge-DEAYNDCI.js} +5 -5
  7. package/chunks/{channel-settings-store-UM7JZEW7.js → channel-settings-store-UIGYER6R.js} +9 -9
  8. package/chunks/{chunk-4W25XH7F.js → chunk-2J53A6MV.js} +1 -1
  9. package/chunks/{chunk-DEVFUPC5.js → chunk-32VOOMEF.js} +2 -2
  10. package/chunks/{chunk-QIN5P5BP.js → chunk-3TT6MZHJ.js} +24 -24
  11. package/chunks/{chunk-45TYWBCB.js → chunk-3ZYX7AUR.js} +1 -1
  12. package/chunks/{chunk-M2S67TPJ.js → chunk-4ETA3KRC.js} +1 -1
  13. package/chunks/{chunk-DNRV2US3.js → chunk-4GLFFNP3.js} +3 -3
  14. package/chunks/{chunk-FWJRWCKU.js → chunk-4M2F7OG7.js} +4 -4
  15. package/chunks/{chunk-JWXBLIQL.js → chunk-575MI5K3.js} +4 -4
  16. package/chunks/{chunk-VESDV72K.js → chunk-5I5NMQCU.js} +1 -1
  17. package/chunks/{chunk-SZ36WFVK.js → chunk-5UPJ774B.js} +1 -1
  18. package/chunks/{chunk-XAAL4IFG.js → chunk-6AECVSVX.js} +3 -3
  19. package/chunks/{chunk-XDN6SMAQ.js → chunk-6ZIIHBNV.js} +2 -2
  20. package/chunks/{chunk-VO52SIZW.js → chunk-7D4KEFOT.js} +2 -2
  21. package/chunks/{chunk-RE6JD2BH.js → chunk-7LZ7DK4D.js} +1 -1
  22. package/chunks/{chunk-JO45C3OY.js → chunk-AJX4ITUG.js} +2 -2
  23. package/chunks/{chunk-PDKLO2DN.js → chunk-CG3OQDNY.js} +127 -4
  24. package/chunks/{chunk-M3QYOPGN.js → chunk-CZXQ4UZA.js} +1 -1
  25. package/chunks/{chunk-MLZCPGDX.js → chunk-DAX3G67A.js} +1 -1
  26. package/chunks/{chunk-7PBUQKMT.js → chunk-DYVCDQW2.js} +1 -1
  27. package/chunks/{chunk-MMH3GO4Z.js → chunk-EXG2R5UR.js} +6 -6
  28. package/chunks/{chunk-WQOE4IYF.js → chunk-EYY4IBPV.js} +1 -1
  29. package/chunks/{chunk-PRWGIKKU.js → chunk-FDWH6CBK.js} +2 -2
  30. package/chunks/{chunk-AMXMM7DH.js → chunk-FRH4SSGX.js} +2 -0
  31. package/chunks/{chunk-6LK2QPIA.js → chunk-GYBDYWMV.js} +1 -1
  32. package/chunks/{chunk-EAJESCBT.js → chunk-HBZUU4AE.js} +2 -2
  33. package/chunks/{chunk-U6LT3QBF.js → chunk-I4XSOFH2.js} +1 -1
  34. package/chunks/{chunk-67LXZ6LV.js → chunk-ILVATFYJ.js} +3 -3
  35. package/chunks/{chunk-ABGS4FDQ.js → chunk-J7DNMZFO.js} +1 -1
  36. package/chunks/{chunk-ZIS5I56G.js → chunk-JEMR2FTD.js} +3 -3
  37. package/chunks/{chunk-CX2MARRJ.js → chunk-JL3LC3CQ.js} +1 -1
  38. package/chunks/{chunk-YQB3HSQ7.js → chunk-JXK3WAP7.js} +3 -3
  39. package/chunks/{chunk-5AWARYOK.js → chunk-KIFRFCCB.js} +3 -3
  40. package/chunks/{chunk-OLU7GIF4.js → chunk-KNXA5XXK.js} +64 -13
  41. package/chunks/chunk-L34XSHIZ.js +28 -0
  42. package/chunks/{chunk-G4C5RLX6.js → chunk-L7T742G2.js} +1 -1
  43. package/chunks/{chunk-C2VGLLNA.js → chunk-LHY6HBRA.js} +4 -4
  44. package/chunks/{chunk-DGM2XA3R.js → chunk-M2PY7CNK.js} +1 -1
  45. package/chunks/{chunk-JRRZFO4A.js → chunk-M4OYAR6J.js} +2 -2
  46. package/chunks/{chunk-INQN4KIA.js → chunk-M6HXP2SG.js} +36 -33
  47. package/chunks/{chunk-3ZLUA4GV.js → chunk-M6SXIXBV.js} +5 -5
  48. package/chunks/{chunk-OSPIZEAM.js → chunk-MDFUBQAQ.js} +11 -11
  49. package/chunks/{chunk-OH5UKBLL.js → chunk-N3FJOQX7.js} +2 -2
  50. package/chunks/{chunk-L2O7DJIE.js → chunk-N5ULBHP3.js} +1 -1
  51. package/chunks/{chunk-EN2J77G7.js → chunk-NELCY6JT.js} +2 -0
  52. package/chunks/{chunk-5DDUYIY6.js → chunk-NPE3STIW.js} +3 -3
  53. package/chunks/{chunk-VUTOKX6F.js → chunk-O5G7IQGM.js} +2 -2
  54. package/chunks/{chunk-FMLUVVQ6.js → chunk-P64FPV3G.js} +1 -1
  55. package/chunks/{chunk-WFBG4MF5.js → chunk-RQVVXDHS.js} +3 -3
  56. package/chunks/{chunk-7N6WK2W6.js → chunk-RRQJPCRQ.js} +1 -1
  57. package/chunks/{chunk-LCWRQA5U.js → chunk-SSAOTDK7.js} +1 -1
  58. package/chunks/{chunk-T2VEHZH3.js → chunk-TEKFBSMY.js} +2 -2
  59. package/chunks/{chunk-3SIXC6QC.js → chunk-TRYJ3BVE.js} +2 -2
  60. package/chunks/{chunk-MJ5FMYVQ.js → chunk-TYCXSMZU.js} +2 -2
  61. package/chunks/{chunk-TKAEODJR.js → chunk-TYGKUOEG.js} +9 -0
  62. package/chunks/{chunk-GQW6P73F.js → chunk-U6PTKAOW.js} +1 -1
  63. package/chunks/{chunk-MM4XBXF7.js → chunk-UNCIELQJ.js} +1 -1
  64. package/chunks/{chunk-T5ZFG4CI.js → chunk-UOMZKPI5.js} +4 -4
  65. package/chunks/{chunk-VUFEW3SF.js → chunk-UZPWH6SP.js} +18 -18
  66. package/chunks/{chunk-ZXUMPZRT.js → chunk-V4MJ56RS.js} +2 -2
  67. package/chunks/{chunk-P5Y23G2L.js → chunk-V7RNNPGC.js} +1 -18
  68. package/chunks/{chunk-FLUYVAQZ.js → chunk-VQZXRLEX.js} +1 -1
  69. package/chunks/{chunk-7L64FSYQ.js → chunk-VWD7SNNN.js} +2 -2
  70. package/chunks/{chunk-XYVBANG5.js → chunk-WFRHWDBT.js} +289 -3
  71. package/chunks/{chunk-LOJO2RPW.js → chunk-XWUQ4IH5.js} +5 -5
  72. package/chunks/{chunk-OYLNJPY3.js → chunk-Y66OOMKS.js} +39 -273
  73. package/chunks/{chunk-AJL3SAZG.js → chunk-YI6UGZF5.js} +9 -9
  74. package/chunks/{chunk-A7M57KOL.js → chunk-YZJVVQD3.js} +4 -4
  75. package/chunks/{chunk-Q6FGSG6B.js → chunk-ZQSNP4TG.js} +1 -1
  76. package/chunks/{computer-use-YOYLKIHT.js → computer-use-S4JEU5P7.js} +3 -3
  77. package/chunks/{contextCommand-KZMV5EOI.js → contextCommand-2H5OH2HW.js} +5 -5
  78. package/chunks/{core-runtime-VFUL2R7U.js → core-runtime-IAQ4DD4Y.js} +3 -3
  79. package/chunks/{create-sub-session-EZW2NP4Z.js → create-sub-session-EKHKXJAA.js} +3 -3
  80. package/chunks/{daemon-status-provider-6L3ZKVVR.js → daemon-status-provider-LPYR2GXY.js} +9 -9
  81. package/chunks/{daemon-trust-policy-SZ3V4JEY.js → daemon-trust-policy-7JOBVFH3.js} +9 -9
  82. package/chunks/{daemon-trust-policy-monitor-HN34EJQ5.js → daemon-trust-policy-monitor-OU3NRHAR.js} +9 -9
  83. package/chunks/{deferred-core-runtime-Z462KPKI.js → deferred-core-runtime-SFT3KI2C.js} +3 -3
  84. package/chunks/{earlyInputCapture-GSE6MMC7.js → earlyInputCapture-27RPWE2D.js} +3 -3
  85. package/chunks/{edit-YJX2HMSA.js → edit-WXVZ7FHS.js} +3 -3
  86. package/chunks/{enter-worktree-H3GV4KQ7.js → enter-worktree-TYMVXFLA.js} +3 -3
  87. package/chunks/{enterPlanMode-6LPSFIN2.js → enterPlanMode-FT4MRU5N.js} +3 -3
  88. package/chunks/{environment-IVCQ3H7T.js → environment-Z6OMA34I.js} +5 -5
  89. package/chunks/{errors-2K5VJQVK.js → errors-YMXK2GG3.js} +5 -5
  90. package/chunks/{exit-worktree-QZC6DXGO.js → exit-worktree-ODZUQLGJ.js} +3 -3
  91. package/chunks/{exitPlanMode-UHGM7I4A.js → exitPlanMode-MBPAPBBV.js} +3 -3
  92. package/chunks/{fast-path-BDDOO4H6.js → fast-path-ZU5T6XSN.js} +2 -2
  93. package/chunks/{gemini-VDUDROF7.js → gemini-OZK6AIMC.js} +39 -36
  94. package/chunks/{geminiContentGenerator-O4HYJOR7.js → geminiContentGenerator-MC6ZKWZG.js} +1 -1
  95. package/chunks/{glob-Z7VZDN7C.js → glob-KJ4A4ZOM.js} +3 -3
  96. package/chunks/{grep-JQ6AGN62.js → grep-QWBLG564.js} +3 -3
  97. package/chunks/{handleAutoUpdate-XZCLKEMR.js → handleAutoUpdate-M3ACKDKF.js} +7 -7
  98. package/chunks/{i18n-G2BMPGAS.js → i18n-FPW7XZL5.js} +4 -4
  99. package/chunks/{image-gen-NMKTIERQ.js → image-gen-OTFC2S7L.js} +1 -1
  100. package/chunks/{initializer-JEYFVIIG.js → initializer-5HKUXXBT.js} +10 -10
  101. package/chunks/{installationInfo-GY2OCLIS.js → installationInfo-4OA6UW7V.js} +4 -4
  102. package/chunks/{list-ZJ4GEKM4.js → list-3TKZ264A.js} +12 -12
  103. package/chunks/{loadedSettingsAdapter-5BO2PZLD.js → loadedSettingsAdapter-IRUANLS2.js} +9 -9
  104. package/chunks/{loggingContentGenerator-ER2Z5L3L.js → loggingContentGenerator-D4URLH2A.js} +1 -1
  105. package/chunks/{managed-npm-update-X66EZDQD.js → managed-npm-update-2O7XSAWJ.js} +4 -4
  106. package/chunks/{mcp-BDWPEXJF.js → mcp-AFVHCHKT.js} +9 -9
  107. package/chunks/{monitor-7J3DCMBL.js → monitor-PY4WDSX3.js} +3 -3
  108. package/chunks/{nonInteractiveCli-THJJIXKG.js → nonInteractiveCli-ZHW6F76F.js} +36 -36
  109. package/chunks/{notebook-edit-IX7GCTIL.js → notebook-edit-GEPL33NO.js} +3 -3
  110. package/chunks/{openaiContentGenerator-K65IDMQ6.js → openaiContentGenerator-ACYSXQ6R.js} +1 -1
  111. package/chunks/{opentui-entry-L76XJNPE.js → opentui-entry-SBAOWW7M.js} +5151 -771
  112. package/chunks/{pidfile-NNWTPHX2.js → pidfile-SUNYCAA4.js} +3 -3
  113. package/chunks/{processUtils-ILOXESNR.js → processUtils-F7LP7YUV.js} +2 -2
  114. package/chunks/{qwenContentGenerator-YIKX3NHW.js → qwenContentGenerator-BB6IPELF.js} +3 -3
  115. package/chunks/{qwenOAuth2-BLYU65Y4.js → qwenOAuth2-OU3WGDOI.js} +1 -1
  116. package/chunks/{read-file-GLBZFPNV.js → read-file-GORBXJTS.js} +1 -1
  117. package/chunks/{resumeHistoryUtils-UMC4Y3E2.js → resumeHistoryUtils-FOAJJJWK.js} +8 -9
  118. package/chunks/{ripGrep-53XOGSZ4.js → ripGrep-RNLIZGCY.js} +3 -3
  119. package/chunks/{run-qwen-serve-BTZ46CLW.js → run-qwen-serve-GVMMX3IU.js} +28 -28
  120. package/chunks/{runtime-RQ3ACQKH.js → runtime-RNBZ5FDD.js} +10 -10
  121. package/chunks/{scheduler-WEIFVKQH.js → scheduler-NTRFSPIP.js} +5 -5
  122. package/chunks/{serve-RJUR5OJH.js → serve-H3PGA26U.js} +9 -9
  123. package/chunks/{server-WQ2ID4U7.js → server-SUXD2F3C.js} +29 -29
  124. package/chunks/{session-O4OXRVNI.js → session-MTFVUWWM.js} +37 -37
  125. package/chunks/{settings-4BVJ36YG.js → settings-GUJ3TN2J.js} +8 -8
  126. package/chunks/{shell-DCQZWM5T.js → shell-C2UP5FF2.js} +3 -3
  127. package/chunks/{skill-4KWZ4J7U.js → skill-4XCNK55E.js} +1 -1
  128. package/chunks/{skill-settings-TEMNXCLU.js → skill-settings-Y2BU27XM.js} +8 -8
  129. package/chunks/{spawnChannel-ROYEZK57.js → spawnChannel-UUUUK734.js} +6 -4
  130. package/chunks/{standalone-update-G4BETY4B.js → standalone-update-MJ722XZ4.js} +5 -5
  131. package/chunks/{startInteractiveUI-PDFQ7N7A.js → startInteractiveUI-TCPIPNGN.js} +356 -444
  132. package/chunks/{team-create-KW4LOVHD.js → team-create-WZWH2NJI.js} +3 -3
  133. package/chunks/{team-plan-approval-XHFK2RTF.js → team-plan-approval-SUZQJCWJ.js} +3 -3
  134. package/chunks/{terminal-image-renderer-46R2LHGR.js → terminal-image-renderer-BCUN3Z3W.js} +3 -3
  135. package/chunks/{theme-manager-E56XY2JG.js → theme-manager-UGMFDREN.js} +4 -4
  136. package/chunks/{tool-search-EVVFQUMJ.js → tool-search-B6F3MPUZ.js} +1 -1
  137. package/chunks/{total-session-admission-CULMHRTA.js → total-session-admission-MQLBJ5WL.js} +5 -5
  138. package/chunks/{trustedFolders-BKLVSCXW.js → trustedFolders-2XST7U5C.js} +4 -4
  139. package/chunks/{update-relaunch-46H4Q4VL.js → update-relaunch-OVC7YNGD.js} +5 -5
  140. package/chunks/{updateCheck-3BQA7KNI.js → updateCheck-YAKM36WQ.js} +6 -6
  141. package/chunks/{useAutoAcceptIndicator-3QJ7QV5R.js → useAutoAcceptIndicator-RF6FVX3S.js} +11 -11
  142. package/chunks/{validateNonInterActiveAuth-QVFJVBSY.js → validateNonInterActiveAuth-IPPXFNQH.js} +33 -33
  143. package/chunks/{version-6JJA54HH.js → version-4IDFEXOU.js} +1 -1
  144. package/chunks/{web-fetch-75JBSDA3.js → web-fetch-NUOLHXPN.js} +1 -1
  145. package/chunks/{web-search-PKBISWS3.js → web-search-LVOOV4XZ.js} +2 -2
  146. package/chunks/{workflow-KEZDQISR.js → workflow-JSTYTG3K.js} +4 -4
  147. package/chunks/{workspace-providers-status-YQW4VNIV.js → workspace-providers-status-U4EYXA4K.js} +11 -11
  148. package/chunks/{workspace-registration-store-GQ42PR72.js → workspace-registration-store-OG66U3CB.js} +1 -1
  149. package/chunks/{workspace-registry-ZR6DVZQ6.js → workspace-registry-WSHWQRQQ.js} +5 -5
  150. package/chunks/{workspace-service-BCMK3NLA.js → workspace-service-QZXQHX2F.js} +12 -12
  151. package/chunks/{workspace-skills-status-ZHBYM2X7.js → workspace-skills-status-VRBHEX5O.js} +9 -9
  152. package/chunks/{workspace-trust-reconciler-TWRB3TW2.js → workspace-trust-reconciler-FCRIUIOF.js} +11 -11
  153. package/chunks/{write-file-CQBI7HXO.js → write-file-PYL3JCCD.js} +3 -3
  154. package/chunks/{zoom-image-36I4WZIL.js → zoom-image-RS6MU26F.js} +1 -1
  155. package/cli.js +12 -12
  156. package/package.json +3 -3
  157. package/chunks/chunk-7P32M35F.js +0 -51
@@ -2,10 +2,24 @@
2
2
  "use strict";
3
3
  import {
4
4
  ICON
5
- } from "./chunk-7P32M35F.js";
5
+ } from "./chunk-KNXA5XXK.js";
6
6
  import {
7
7
  theme
8
- } from "./chunk-MLZCPGDX.js";
8
+ } from "./chunk-DAX3G67A.js";
9
+ import {
10
+ getCachedStringWidth
11
+ } from "./chunk-4NFY2S7N.js";
12
+ import {
13
+ MAIN_SOURCE
14
+ } from "./chunk-HB6QW4LM.js";
15
+ import {
16
+ ToolDisplayNames,
17
+ ToolNames
18
+ } from "./chunk-XTH2OMDS.js";
19
+ import {
20
+ sanitizeForOsc,
21
+ wrapForMultiplexer
22
+ } from "./chunk-TBVNYG5B.js";
9
23
  import {
10
24
  init_esbuild_shims
11
25
  } from "./chunk-5O2XNYP6.js";
@@ -13,6 +27,181 @@ import {
13
27
  __name
14
28
  } from "./chunk-J2S4EL5Y.js";
15
29
 
30
+ // packages/cli/src/ui/utils/sessionPickerUtils.ts
31
+ init_esbuild_shims();
32
+ var graphemeSegmenter = new Intl.Segmenter(void 0, {
33
+ granularity: "grapheme"
34
+ });
35
+ var SESSION_PAGE_SIZE = 20;
36
+ function truncateText(text, maxWidth) {
37
+ const widthLimit = Math.max(0, Math.floor(maxWidth));
38
+ if (widthLimit === 0) {
39
+ return "";
40
+ }
41
+ const firstLine = text.split(/\r?\n/, 1)[0];
42
+ if (getCachedStringWidth(firstLine) <= widthLimit) {
43
+ return firstLine;
44
+ }
45
+ if (widthLimit <= 3) {
46
+ return truncateToDisplayWidth(firstLine, widthLimit);
47
+ }
48
+ return `${truncateToDisplayWidth(firstLine, widthLimit - 3)}...`;
49
+ }
50
+ __name(truncateText, "truncateText");
51
+ function truncateToDisplayWidth(text, maxWidth) {
52
+ let width = 0;
53
+ let result = "";
54
+ for (const { segment } of graphemeSegmenter.segment(text)) {
55
+ const segmentWidth = getCachedStringWidth(segment);
56
+ if (width + segmentWidth > maxWidth) {
57
+ break;
58
+ }
59
+ result += segment;
60
+ width += segmentWidth;
61
+ }
62
+ return result;
63
+ }
64
+ __name(truncateToDisplayWidth, "truncateToDisplayWidth");
65
+ function matchesQuery(session, normalizedQuery) {
66
+ if (!normalizedQuery) return true;
67
+ const haystacks = [
68
+ session.customTitle,
69
+ session.prompt,
70
+ session.gitBranch
71
+ ];
72
+ for (const h of haystacks) {
73
+ if (h && h.toLowerCase().includes(normalizedQuery)) return true;
74
+ }
75
+ return false;
76
+ }
77
+ __name(matchesQuery, "matchesQuery");
78
+ function filterSessions(sessions, filterByBranch, currentBranch, query) {
79
+ const normalizedQuery = query?.toLowerCase().trim() ?? "";
80
+ return sessions.filter((session) => {
81
+ if (filterByBranch && currentBranch) {
82
+ if (session.gitBranch !== currentBranch) return false;
83
+ }
84
+ return matchesQuery(session, normalizedQuery);
85
+ });
86
+ }
87
+ __name(filterSessions, "filterSessions");
88
+ function formatMessageCount(count) {
89
+ return count === 1 ? "1 message" : `${count} messages`;
90
+ }
91
+ __name(formatMessageCount, "formatMessageCount");
92
+
93
+ // packages/cli/src/ui/utils/osc8.ts
94
+ init_esbuild_shims();
95
+ function osc8Open(url) {
96
+ return wrapForMultiplexer(`\x1B]8;;${sanitizeForOsc(url)}\x07`);
97
+ }
98
+ __name(osc8Open, "osc8Open");
99
+ function osc8Close() {
100
+ return wrapForMultiplexer(`\x1B]8;;\x07`);
101
+ }
102
+ __name(osc8Close, "osc8Close");
103
+ var SAFE_OSC8_SCHEMES = /* @__PURE__ */ new Set([
104
+ "http:",
105
+ "https:",
106
+ "mailto:",
107
+ "ftp:",
108
+ "ftps:",
109
+ "sftp:",
110
+ "ssh:"
111
+ ]);
112
+ function isSafeOscScheme(url) {
113
+ const match = url.match(/^([a-z][a-z0-9+.-]*:)/i);
114
+ if (!match) return false;
115
+ return SAFE_OSC8_SCHEMES.has(match[1].toLowerCase());
116
+ }
117
+ __name(isSafeOscScheme, "isSafeOscScheme");
118
+ var BARE_URL_BREAK_CHARACTERS = String.raw`\u3001-\u3004\u3008-\u3020\u302e-\u3030\u3036-\u3037\u303d-\u303f\uff01-\uff0f\uff1a-\uff20\uff3b-\uff40\uff5b-\uff65\ufe10-\ufe1f\ufe30-\ufe32\ufe35-\ufe6f`;
119
+ var BARE_URL_BREAK_PATTERN = new RegExp(`[${BARE_URL_BREAK_CHARACTERS}]`);
120
+ function trimTrailingUrlPunctuation(url, nextCharacter = "") {
121
+ let openParen = 0;
122
+ let openBracket = 0;
123
+ let openBrace = 0;
124
+ let closeParen = 0;
125
+ let closeBracket = 0;
126
+ let closeBrace = 0;
127
+ for (let i = 0; i < url.length; i++) {
128
+ const cc = url.charCodeAt(i);
129
+ if (cc === 40) openParen++;
130
+ else if (cc === 91) openBracket++;
131
+ else if (cc === 123) openBrace++;
132
+ else if (cc === 41) closeParen++;
133
+ else if (cc === 93) closeBracket++;
134
+ else if (cc === 125) closeBrace++;
135
+ }
136
+ let end = url.length;
137
+ if (url.charCodeAt(end - 1) === 95 && BARE_URL_BREAK_PATTERN.test(nextCharacter)) {
138
+ end--;
139
+ }
140
+ while (end > 0) {
141
+ const c = url.charCodeAt(end - 1);
142
+ if (c === 46 || c === 44 || c === 59 || c === 58 || c === 33 || c === 63 || c === 39 || c === 34 || c === 96 || c === 62) {
143
+ end--;
144
+ continue;
145
+ }
146
+ if (c === 41 && closeParen > openParen) {
147
+ closeParen--;
148
+ end--;
149
+ continue;
150
+ }
151
+ if (c === 93 && closeBracket > openBracket) {
152
+ closeBracket--;
153
+ end--;
154
+ continue;
155
+ }
156
+ if (c === 125 && closeBrace > openBrace) {
157
+ closeBrace--;
158
+ end--;
159
+ continue;
160
+ }
161
+ break;
162
+ }
163
+ return url.slice(0, end);
164
+ }
165
+ __name(trimTrailingUrlPunctuation, "trimTrailingUrlPunctuation");
166
+ var MD_LINK_PATTERN = String.raw`\[.*?\]\((?:[^()]|\([^()]*\))*\)`;
167
+ var MD_LINK_CAPTURE = /^\[(.*?)\]\(((?:[^()]|\([^()]*\))*)\)$/;
168
+ var BARE_URL_PATTERN = String.raw`https?:\/\/[^\s${BARE_URL_BREAK_CHARACTERS}]+`;
169
+ function shouldWrapMarkdownLink(url, canHyperlink) {
170
+ return canHyperlink && isSafeOscScheme(url) && !/\s/.test(url);
171
+ }
172
+ __name(shouldWrapMarkdownLink, "shouldWrapMarkdownLink");
173
+ var HOST_LIKE_RE = /\b[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?)*\.[a-z]{2,}\b/gi;
174
+ var IPV4_LIKE_RE = /\b(?:\d{1,3}\.){3}\d{1,3}\b/g;
175
+ function targetHostname(url) {
176
+ try {
177
+ const u = new URL(url);
178
+ if (u.protocol === "mailto:") {
179
+ const at = u.pathname.lastIndexOf("@");
180
+ return at >= 0 ? u.pathname.slice(at + 1).toLowerCase() || void 0 : void 0;
181
+ }
182
+ return u.hostname.toLowerCase() || void 0;
183
+ } catch {
184
+ return void 0;
185
+ }
186
+ }
187
+ __name(targetHostname, "targetHostname");
188
+ function labelMayDeceive(label, url) {
189
+ if (label === url) return false;
190
+ if (/:\/\//.test(label) || /^[a-z][a-z0-9+.-]*:/i.test(label.trim())) {
191
+ return true;
192
+ }
193
+ const lower = label.toLowerCase();
194
+ const labelHosts = [
195
+ ...lower.match(HOST_LIKE_RE) ?? [],
196
+ ...lower.match(IPV4_LIKE_RE) ?? []
197
+ ];
198
+ if (labelHosts.length === 0) return false;
199
+ const target = targetHostname(url);
200
+ if (!target) return true;
201
+ return labelHosts.some((h) => h !== target);
202
+ }
203
+ __name(labelMayDeceive, "labelMayDeceive");
204
+
16
205
  // packages/cli/src/ui/utils/displayUtils.ts
17
206
  init_esbuild_shims();
18
207
  function getArenaStatusLabel(status) {
@@ -319,7 +508,87 @@ function createKeyMatchers(config = defaultKeyBindings) {
319
508
  __name(createKeyMatchers, "createKeyMatchers");
320
509
  var keyMatchers = createKeyMatchers(defaultKeyBindings);
321
510
 
511
+ // packages/cli/src/ui/utils/tool-display-map.ts
512
+ init_esbuild_shims();
513
+ var TOOL_DISPLAY_BY_NAME = Object.fromEntries(
514
+ Object.keys(ToolNames).map((key) => [
515
+ ToolNames[key],
516
+ ToolDisplayNames[key]
517
+ ])
518
+ );
519
+
520
+ // packages/cli/src/ui/utils/modelsBySource.ts
521
+ init_esbuild_shims();
522
+ function flattenModelsBySource(models) {
523
+ const sessionHasNonMainSource = Object.values(models).some(
524
+ (modelMetrics) => Object.keys(modelMetrics.bySource).some((source) => source !== MAIN_SOURCE)
525
+ );
526
+ const result = [];
527
+ for (const [modelName, modelMetrics] of Object.entries(models)) {
528
+ if (modelMetrics.api.totalRequests <= 0) continue;
529
+ const displayName = normalizeModelName(modelName);
530
+ const sourceNames = Object.keys(modelMetrics.bySource);
531
+ if (sourceNames.length === 0) {
532
+ result.push({
533
+ key: modelName,
534
+ label: displayName,
535
+ metrics: modelMetrics
536
+ });
537
+ continue;
538
+ }
539
+ if (!sessionHasNonMainSource) {
540
+ result.push({
541
+ key: modelName,
542
+ label: displayName,
543
+ metrics: modelMetrics.bySource[MAIN_SOURCE] ?? modelMetrics
544
+ });
545
+ continue;
546
+ }
547
+ const sortedSources = sortSources(sourceNames);
548
+ for (const source of sortedSources) {
549
+ result.push({
550
+ key: `${modelName}::${source}`,
551
+ label: `${displayName} (${source})`,
552
+ metrics: modelMetrics.bySource[source]
553
+ });
554
+ }
555
+ }
556
+ return result;
557
+ }
558
+ __name(flattenModelsBySource, "flattenModelsBySource");
559
+ function normalizeModelName(modelName) {
560
+ return modelName.replace("-001", "");
561
+ }
562
+ __name(normalizeModelName, "normalizeModelName");
563
+ function sortSources(sources) {
564
+ const main = [];
565
+ const rest = [];
566
+ for (const source of sources) {
567
+ if (source === MAIN_SOURCE) {
568
+ main.push(source);
569
+ } else {
570
+ rest.push(source);
571
+ }
572
+ }
573
+ rest.sort((a, b) => a.localeCompare(b));
574
+ return [...main, ...rest];
575
+ }
576
+ __name(sortSources, "sortSources");
577
+
322
578
  export {
579
+ SESSION_PAGE_SIZE,
580
+ truncateText,
581
+ filterSessions,
582
+ formatMessageCount,
583
+ osc8Open,
584
+ osc8Close,
585
+ isSafeOscScheme,
586
+ trimTrailingUrlPunctuation,
587
+ MD_LINK_PATTERN,
588
+ MD_LINK_CAPTURE,
589
+ BARE_URL_PATTERN,
590
+ shouldWrapMarkdownLink,
591
+ labelMayDeceive,
323
592
  getArenaStatusLabel,
324
593
  TOOL_SUCCESS_RATE_HIGH,
325
594
  TOOL_SUCCESS_RATE_MEDIUM,
@@ -327,10 +596,27 @@ export {
327
596
  USER_AGREEMENT_RATE_MEDIUM,
328
597
  getStatusColor,
329
598
  formatDuration,
330
- keyMatchers
599
+ keyMatchers,
600
+ TOOL_DISPLAY_BY_NAME,
601
+ flattenModelsBySource
331
602
  };
603
+ /**
604
+ * @license
605
+ * Copyright 2025 Qwen Code
606
+ * SPDX-License-Identifier: Apache-2.0
607
+ */
608
+ /**
609
+ * @license
610
+ * Copyright 2025 Qwen
611
+ * SPDX-License-Identifier: Apache-2.0
612
+ */
332
613
  /**
333
614
  * @license
334
615
  * Copyright 2025 Google LLC
335
616
  * SPDX-License-Identifier: Apache-2.0
336
617
  */
618
+ /**
619
+ * @license
620
+ * Copyright 2025 Qwen Team
621
+ * SPDX-License-Identifier: Apache-2.0
622
+ */
@@ -405,18 +405,18 @@ async function createContentGenerator(generatorConfig, config, isInitialAuth) {
405
405
  try {
406
406
  if (authType === "openai" /* USE_OPENAI */) {
407
407
  loadBaseGenerator = /* @__PURE__ */ __name(async () => {
408
- const { createOpenAIContentGenerator } = await import("./openaiContentGenerator-K65IDMQ6.js");
408
+ const { createOpenAIContentGenerator } = await import("./openaiContentGenerator-ACYSXQ6R.js");
409
409
  return createOpenAIContentGenerator(generatorConfig, config);
410
410
  }, "loadBaseGenerator");
411
411
  } else if (authType === "qwen-oauth" /* QWEN_OAUTH */) {
412
- const { getQwenOAuthClient: getQwenOauthClient } = await import("./qwenOAuth2-BLYU65Y4.js");
412
+ const { getQwenOAuthClient: getQwenOauthClient } = await import("./qwenOAuth2-OU3WGDOI.js");
413
413
  try {
414
414
  const qwenClient = await getQwenOauthClient(
415
415
  config,
416
416
  isInitialAuth ? { requireCachedCredentials: true } : void 0
417
417
  );
418
418
  loadBaseGenerator = /* @__PURE__ */ __name(async () => {
419
- const { QwenContentGenerator } = await import("./qwenContentGenerator-YIKX3NHW.js");
419
+ const { QwenContentGenerator } = await import("./qwenContentGenerator-BB6IPELF.js");
420
420
  return new QwenContentGenerator(qwenClient, generatorConfig, config);
421
421
  }, "loadBaseGenerator");
422
422
  } catch (error) {
@@ -432,7 +432,7 @@ async function createContentGenerator(generatorConfig, config, isInitialAuth) {
432
432
  }, "loadBaseGenerator");
433
433
  } else if (authType === "gemini" /* USE_GEMINI */ || authType === "vertex-ai" /* USE_VERTEX_AI */) {
434
434
  loadBaseGenerator = /* @__PURE__ */ __name(async () => {
435
- const { createGeminiContentGenerator } = await import("./geminiContentGenerator-O4HYJOR7.js");
435
+ const { createGeminiContentGenerator } = await import("./geminiContentGenerator-MC6ZKWZG.js");
436
436
  return createGeminiContentGenerator(generatorConfig, config);
437
437
  }, "loadBaseGenerator");
438
438
  } else {
@@ -448,7 +448,7 @@ async function createContentGenerator(generatorConfig, config, isInitialAuth) {
448
448
  try {
449
449
  const [baseGenerator, { LoggingContentGenerator }] = await Promise.all([
450
450
  loadBaseGenerator(),
451
- import("./loggingContentGenerator-ER2Z5L3L.js")
451
+ import("./loggingContentGenerator-D4URLH2A.js")
452
452
  ]);
453
453
  return new LoggingContentGenerator(
454
454
  baseGenerator,