@qwen-code/qwen-code 0.18.5-nightly.20260622.6bc3f853e → 0.18.5-preview.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 (165) hide show
  1. package/bundled/qc-helper/SKILL.md +13 -5
  2. package/bundled/qc-helper/docs/configuration/_meta.ts +1 -0
  3. package/bundled/qc-helper/docs/configuration/auth.md +68 -48
  4. package/bundled/qc-helper/docs/configuration/model-providers.md +217 -195
  5. package/bundled/qc-helper/docs/configuration/qwen-ignore.md +31 -15
  6. package/bundled/qc-helper/docs/configuration/settings.md +44 -27
  7. package/bundled/qc-helper/docs/configuration/themes.md +7 -4
  8. package/bundled/qc-helper/docs/extension/extension-releasing.md +1 -1
  9. package/bundled/qc-helper/docs/extension/introduction.md +27 -21
  10. package/bundled/qc-helper/docs/features/arena.md +3 -3
  11. package/bundled/qc-helper/docs/features/channels/overview.md +1 -1
  12. package/bundled/qc-helper/docs/features/channels/plugins.md +1 -1
  13. package/bundled/qc-helper/docs/features/commands.md +6 -1
  14. package/bundled/qc-helper/docs/features/headless.md +1 -1
  15. package/bundled/qc-helper/docs/features/mcp.md +33 -14
  16. package/bundled/qc-helper/docs/features/sandbox.md +2 -2
  17. package/bundled/qc-helper/docs/features/tool-use-summaries.md +1 -1
  18. package/bundled/qc-helper/docs/integration-github-action.md +2 -2
  19. package/bundled/qc-helper/docs/overview.md +1 -1
  20. package/bundled/qc-helper/docs/quickstart.md +9 -5
  21. package/bundled/qc-helper/docs/qwen-serve.md +14 -2
  22. package/bundled/qc-helper/docs/support/tos-privacy.md +1 -1
  23. package/chunks/{agent-WFLPE5MW.js → agent-P4KSTVXX.js} +24 -22
  24. package/chunks/{agent-headless-Q27MG73I.js → agent-headless-QUAPWF55.js} +24 -22
  25. package/chunks/{anthropicContentGenerator-5S4OMMNL.js → anthropicContentGenerator-7352A7I5.js} +12 -11
  26. package/chunks/artifact-tool-5J4HUZAV.js +675 -0
  27. package/chunks/{askUserQuestion-WHVYL2S2.js → askUserQuestion-HF7HCWDD.js} +20 -7
  28. package/chunks/chunk-22IFUCVR.js +291 -0
  29. package/chunks/{chunk-26ZYKTYZ.js → chunk-2BIF2NVV.js} +2 -2
  30. package/chunks/{chunk-VKILGMZQ.js → chunk-2QDQTWCI.js} +1 -1
  31. package/chunks/{chunk-XGU3ETVO.js → chunk-3BR4OIOE.js} +3 -3
  32. package/chunks/{chunk-LTN3VYMZ.js → chunk-3UALQ56H.js} +1 -1
  33. package/chunks/{chunk-QBUR6J4B.js → chunk-BC5POO46.js} +8 -7
  34. package/chunks/{chunk-MSJ2MXJ6.js → chunk-BGUDAULQ.js} +11 -290
  35. package/chunks/{chunk-FH4P6RQA.js → chunk-BNXANYLH.js} +1 -1
  36. package/chunks/{chunk-WE6TNQJU.js → chunk-C4K3FEQ2.js} +36 -0
  37. package/chunks/{chunk-G4BUMVEY.js → chunk-CGEGHF2C.js} +2 -217
  38. package/chunks/chunk-EEEZIVFJ.js +908 -0
  39. package/chunks/{chunk-7Z2O7IBO.js → chunk-EIJYMXXX.js} +619 -135
  40. package/chunks/chunk-EJYJYJZ2.js +3703 -0
  41. package/chunks/{chunk-ATLUHLZE.js → chunk-EW6C27XX.js} +1 -1
  42. package/chunks/{chunk-42HGOMED.js → chunk-F6XNTYNE.js} +216 -1
  43. package/chunks/{chunk-C6MI2ASN.js → chunk-GZCJS5WH.js} +2 -2
  44. package/chunks/{chunk-KGV3F6UF.js → chunk-HGNSRCRB.js} +1 -1
  45. package/chunks/{chunk-CX3SGIPK.js → chunk-KBXLIVWQ.js} +2 -2
  46. package/chunks/{chunk-GOMVJKBL.js → chunk-L7U2RI5O.js} +59 -57
  47. package/chunks/{chunk-GBN55AWZ.js → chunk-NKJ6LRCR.js} +2 -2
  48. package/chunks/{chunk-2O3NAOJG.js → chunk-NWLUISRA.js} +1 -1
  49. package/chunks/{chunk-ID533GA3.js → chunk-OTBK43JR.js} +1 -1
  50. package/chunks/{chunk-AE6RQU6F.js → chunk-PRYMDRBV.js} +1 -1
  51. package/chunks/{chunk-KQIKOTQJ.js → chunk-RYLJU2DY.js} +60 -5
  52. package/chunks/{chunk-CTHZVIMD.js → chunk-T2VDEFUU.js} +2 -2
  53. package/chunks/{chunk-SWGPABMH.js → chunk-T336V435.js} +80 -83
  54. package/chunks/{chunk-LF6BKGZT.js → chunk-TXVGVZYR.js} +3 -3
  55. package/chunks/{chunk-GM3LTU6K.js → chunk-UMRZ7XCR.js} +170 -5015
  56. package/chunks/{chunk-XU7BKR3B.js → chunk-XU5P23GN.js} +3 -3
  57. package/chunks/{chunk-EJ6NFQ2L.js → chunk-ZC675NGC.js} +5 -5
  58. package/chunks/{chunk-CXZV4Q4J.js → chunk-ZXNEOCW2.js} +7118 -5113
  59. package/chunks/{computer-use-F5O56FVW.js → computer-use-4TLHI3UR.js} +24 -22
  60. package/chunks/contextCommand-HFEITKSR.js +56 -0
  61. package/chunks/{cron-create-THNDTYXU.js → cron-create-A5637KCI.js} +12 -9
  62. package/chunks/{cron-delete-BS5H6TFJ.js → cron-delete-AADOSEOZ.js} +4 -4
  63. package/chunks/{cron-list-7OBVHT7K.js → cron-list-OFCPTT2Y.js} +4 -4
  64. package/chunks/{dist-GKRNVFBH.js → dist-ZBX7LPJZ.js} +2 -1
  65. package/chunks/{edit-UV7MBOJU.js → edit-B7H73V6O.js} +24 -22
  66. package/chunks/{en-S3OQBISC.js → en-7OGNWWME.js} +48 -0
  67. package/chunks/{enter-worktree-TSCHZMJ3.js → enter-worktree-GG7ZHYPS.js} +24 -22
  68. package/chunks/{enterPlanMode-LKS7VIUG.js → enterPlanMode-RHTAKG52.js} +27 -23
  69. package/chunks/{exit-worktree-Q6EWFLZU.js → exit-worktree-U7VQZRMG.js} +24 -22
  70. package/chunks/{exitPlanMode-HS6I4D2O.js → exitPlanMode-S35A36II.js} +36 -28
  71. package/chunks/{geminiContentGenerator-GEZ63VSW.js → geminiContentGenerator-W7KVATBA.js} +4 -4
  72. package/chunks/{glob-ZN5LKB7E.js → glob-WOFF7ECI.js} +26 -23
  73. package/chunks/{grep-NIKBBYBU.js → grep-MWNYWYWQ.js} +24 -22
  74. package/chunks/{keychain-token-storage-YHXIWXIB.js → keychain-token-storage-CSYMNRPP.js} +2 -2
  75. package/chunks/{loop-wakeup-SSBWZ64K.js → loop-wakeup-DGSMT4N6.js} +5 -5
  76. package/chunks/{ls-YPFUHZRQ.js → ls-UGRZ4ZOM.js} +6 -6
  77. package/chunks/{lsp-FD6DNVAF.js → lsp-72IJURW3.js} +2 -2
  78. package/chunks/{monitor-A25XKPU5.js → monitor-AYUINLYN.js} +24 -22
  79. package/chunks/{notebook-edit-E72AIOUS.js → notebook-edit-EP4D4WFD.js} +25 -23
  80. package/chunks/{openaiContentGenerator-ZDLZDXLU.js → openaiContentGenerator-SLYYF7AM.js} +12 -15
  81. package/chunks/{qwenContentGenerator-HVJPPMTT.js → qwenContentGenerator-VZ7JYU4A.js} +26 -24
  82. package/chunks/{qwenOAuth2-WZ54YZ4J.js → qwenOAuth2-K4AASPCV.js} +5 -4
  83. package/chunks/{read-file-L6FM3KUX.js → read-file-65EQ53KS.js} +9 -8
  84. package/chunks/{ripGrep-YRJCUISE.js → ripGrep-5XLHJDDM.js} +24 -22
  85. package/chunks/{scheduler-M3742P2I.js → scheduler-5GLJSA2H.js} +73 -27
  86. package/chunks/{send-message-FWFTX62Q.js → send-message-URUZ7PLA.js} +24 -4
  87. package/chunks/{serve-ZIP2GDFY.js → serve-MUROZGCG.js} +618 -92
  88. package/chunks/{shell-T5VSPJLU.js → shell-ET3BQWKB.js} +24 -22
  89. package/chunks/{skill-ETTFYDOV.js → skill-YEYABCAF.js} +11 -10
  90. package/chunks/{src-UKOPSYDK.js → src-POVOI65Y.js} +140 -67
  91. package/chunks/{syntheticOutput-JY5NEDTV.js → syntheticOutput-65FRJGWM.js} +3 -3
  92. package/chunks/{task-create-IGILDV25.js → task-create-IH45HOFT.js} +6 -6
  93. package/chunks/{task-list-KBEJVAAG.js → task-list-FUB6JWSX.js} +5 -5
  94. package/chunks/{task-stop-WFTMQ6AC.js → task-stop-P6IOHQM3.js} +2 -2
  95. package/chunks/{task-update-UIVX7ZEV.js → task-update-RTUT7LJV.js} +6 -6
  96. package/chunks/{team-create-DRKUVGBN.js → team-create-EFZFKQFP.js} +28 -26
  97. package/chunks/{team-delete-LPOXDPVB.js → team-delete-RXGYRMHC.js} +5 -5
  98. package/chunks/{todoWrite-R4RIJKOD.js → todoWrite-O6JK24G6.js} +4 -4
  99. package/chunks/{tool-search-EIIK27ON.js → tool-search-BRJC42TE.js} +9 -8
  100. package/chunks/{web-fetch-JU7SS6KE.js → web-fetch-KUMBROUI.js} +4 -4
  101. package/chunks/{workflow-4RGAYFSJ.js → workflow-UDRBNFTT.js} +557 -97
  102. package/chunks/{write-file-GLQYJFEZ.js → write-file-F7TAHAHF.js} +24 -22
  103. package/chunks/{zh-QXLZV2PX.js → zh-3RMSEO5M.js} +48 -0
  104. package/chunks/{zh-TW-3OKU7LDA.js → zh-TW-R7WRLTJS.js} +48 -0
  105. package/cli.js +8473 -5091
  106. package/locales/en.js +69 -0
  107. package/locales/zh-TW.js +66 -0
  108. package/locales/zh.js +66 -0
  109. package/package.json +3 -2
  110. package/web-shell/assets/{arc-CRFN10gD.js → arc-DHUeMnnj.js} +1 -1
  111. package/web-shell/assets/{architectureDiagram-3BPJPVTR-IRlu1CpH.js → architectureDiagram-3BPJPVTR-DlX12yyj.js} +1 -1
  112. package/web-shell/assets/{blockDiagram-GPEHLZMM-htIZ6iw8.js → blockDiagram-GPEHLZMM-DTFUXMUT.js} +1 -1
  113. package/web-shell/assets/{c4Diagram-AAUBKEIU-A2GoRq3O.js → c4Diagram-AAUBKEIU-CWdB54fk.js} +1 -1
  114. package/web-shell/assets/channel-C3WhMjjP.js +1 -0
  115. package/web-shell/assets/{chunk-2J33WTMH-CdP2AC6u.js → chunk-2J33WTMH-CF5C5jNR.js} +1 -1
  116. package/web-shell/assets/{chunk-4BX2VUAB-DrA07nW2.js → chunk-4BX2VUAB-Cw7Ydfji.js} +1 -1
  117. package/web-shell/assets/{chunk-55IACEB6-CFGnVU2f.js → chunk-55IACEB6-CnbI1ZCw.js} +1 -1
  118. package/web-shell/assets/{chunk-727SXJPM-BTMkq3Tk.js → chunk-727SXJPM-DmSy00Pe.js} +1 -1
  119. package/web-shell/assets/{chunk-AQP2D5EJ-C9sYg04Z.js → chunk-AQP2D5EJ-DgNgXqBu.js} +1 -1
  120. package/web-shell/assets/{chunk-FMBD7UC4-Cag-cj6I.js → chunk-FMBD7UC4-tz2IvOXv.js} +1 -1
  121. package/web-shell/assets/{chunk-ND2GUHAM-CDSTFoR7.js → chunk-ND2GUHAM-DaBLEBPa.js} +1 -1
  122. package/web-shell/assets/{chunk-QZHKN3VN-CN9Z6oOs.js → chunk-QZHKN3VN-DVCQST3O.js} +1 -1
  123. package/web-shell/assets/classDiagram-4FO5ZUOK-CQ6TXPif.js +1 -0
  124. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CQ6TXPif.js +1 -0
  125. package/web-shell/assets/{cose-bilkent-S5V4N54A-DuN9j8Du.js → cose-bilkent-S5V4N54A-CAKTcdCQ.js} +1 -1
  126. package/web-shell/assets/{dagre-BM42HDAG-ByCWe45f.js → dagre-BM42HDAG-BdkBwlKg.js} +1 -1
  127. package/web-shell/assets/{diagram-2AECGRRQ-eWyU_pKZ.js → diagram-2AECGRRQ-DYt3G65F.js} +1 -1
  128. package/web-shell/assets/{diagram-5GNKFQAL-0Bfu3Fq5.js → diagram-5GNKFQAL-BWvROWjY.js} +1 -1
  129. package/web-shell/assets/{diagram-KO2AKTUF-B6KBKkQP.js → diagram-KO2AKTUF-BvvgwIaQ.js} +1 -1
  130. package/web-shell/assets/{diagram-LMA3HP47-TToDmeA_.js → diagram-LMA3HP47-E7NLSNKg.js} +1 -1
  131. package/web-shell/assets/{diagram-OG6HWLK6-CQCkC2Yx.js → diagram-OG6HWLK6-CYmUBgpE.js} +1 -1
  132. package/web-shell/assets/{erDiagram-TEJ5UH35-Cm9ls1iB.js → erDiagram-TEJ5UH35-BU5gY30h.js} +1 -1
  133. package/web-shell/assets/{flowDiagram-I6XJVG4X-Dyoz80Pv.js → flowDiagram-I6XJVG4X-V_ZssSZ9.js} +1 -1
  134. package/web-shell/assets/{ganttDiagram-6RSMTGT7-Cfut9yaU.js → ganttDiagram-6RSMTGT7-QIShlsdI.js} +1 -1
  135. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-BCuJdlfD.js → gitGraphDiagram-PVQCEYII-DJxdu2YS.js} +1 -1
  136. package/web-shell/assets/index-BPnhI7gl.css +1 -0
  137. package/web-shell/assets/index-De4rqTsW.js +706 -0
  138. package/web-shell/assets/{infoDiagram-5YYISTIA-CXKxF2VL.js → infoDiagram-5YYISTIA-BqjdrFeO.js} +1 -1
  139. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DE7HWSU8.js → ishikawaDiagram-YF4QCWOH-BP_a2YZ2.js} +1 -1
  140. package/web-shell/assets/{journeyDiagram-JHISSGLW-D__YUfds.js → journeyDiagram-JHISSGLW-BXg-S3Lk.js} +1 -1
  141. package/web-shell/assets/{kanban-definition-UN3LZRKU-D82R169M.js → kanban-definition-UN3LZRKU-BksAkdEJ.js} +1 -1
  142. package/web-shell/assets/{linear-DpyMbKqT.js → linear-D2m9-ODE.js} +1 -1
  143. package/web-shell/assets/{mermaid.core-D1KEFDhn.js → mermaid.core-dTtkZp2F.js} +5 -5
  144. package/web-shell/assets/{mindmap-definition-RKZ34NQL-BwVUFGFE.js → mindmap-definition-RKZ34NQL-Bft9my8O.js} +1 -1
  145. package/web-shell/assets/{pieDiagram-4H26LBE5-BO_qoEGx.js → pieDiagram-4H26LBE5-Cw8S-alZ.js} +1 -1
  146. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Cx0ZaWPo.js → quadrantDiagram-W4KKPZXB-DaDoTMts.js} +1 -1
  147. package/web-shell/assets/{requirementDiagram-4Y6WPE33-BJPXejOA.js → requirementDiagram-4Y6WPE33-Cp5kSpwj.js} +1 -1
  148. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-C1xeIL9i.js → sankeyDiagram-5OEKKPKP-CW8RsJJZ.js} +1 -1
  149. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CSYKQUjf.js → sequenceDiagram-3UESZ5HK-DTfpIiJK.js} +1 -1
  150. package/web-shell/assets/{stateDiagram-AJRCARHV-d9hiHlAW.js → stateDiagram-AJRCARHV-DixFVzEs.js} +1 -1
  151. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DZgE04s3.js +1 -0
  152. package/web-shell/assets/{timeline-definition-PNZ67QCA-BhCBkq8k.js → timeline-definition-PNZ67QCA-DYsbXn5l.js} +1 -1
  153. package/web-shell/assets/{vennDiagram-CIIHVFJN-DPPFWp_y.js → vennDiagram-CIIHVFJN-HUpRpuUp.js} +1 -1
  154. package/web-shell/assets/{wardley-L42UT6IY-CcOUIgXY.js → wardley-L42UT6IY-cT3nQH_T.js} +1 -1
  155. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-p7oR5X7r.js → wardleyDiagram-YWT4CUSO-Dmm7J6Qc.js} +1 -1
  156. package/web-shell/assets/{xychartDiagram-2RQKCTM6-Dfr7-SEy.js → xychartDiagram-2RQKCTM6-CX0L5p9C.js} +1 -1
  157. package/web-shell/index.html +3 -3
  158. package/chunks/chunk-77WXWU44.js +0 -26
  159. package/chunks/contextCommand-WBVNKL2C.js +0 -54
  160. package/web-shell/assets/channel-WwImfsc7.js +0 -1
  161. package/web-shell/assets/classDiagram-4FO5ZUOK-CJKQYFeJ.js +0 -1
  162. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CJKQYFeJ.js +0 -1
  163. package/web-shell/assets/index-BDZiTAkl.css +0 -1
  164. package/web-shell/assets/index-DaebdpHq.js +0 -516
  165. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DgReoybQ.js +0 -1
@@ -7,7 +7,7 @@ import {
7
7
  getLanguageSettingsOptions,
8
8
  t,
9
9
  writeStderrLine
10
- } from "./chunk-EJ6NFQ2L.js";
10
+ } from "./chunk-ZC675NGC.js";
11
11
  import {
12
12
  DEFAULT_STOP_HOOK_BLOCK_CAP,
13
13
  DEFAULT_TOOL_OUTPUT_BATCH_BUDGET,
@@ -17,22 +17,31 @@ import {
17
17
  IdeClient,
18
18
  SkillError,
19
19
  ideContextStore,
20
- require_main
21
- } from "./chunk-CXZV4Q4J.js";
22
- import {
23
- isWithinRoot,
20
+ require_main,
21
+ resolveModelConfig,
24
22
  stripRuntimeSnapshotPrefix
25
- } from "./chunk-GM3LTU6K.js";
23
+ } from "./chunk-ZXNEOCW2.js";
24
+ import {
25
+ external_exports
26
+ } from "./chunk-K5PGHDBN.js";
27
+ import {
28
+ DEFAULT_QWEN_CUSTOM_IGNORE_FILE_NAMES
29
+ } from "./chunk-EEEZIVFJ.js";
30
+ import {
31
+ AuthType,
32
+ MODEL_GENERATION_CONFIG_FIELDS,
33
+ isWithinRoot
34
+ } from "./chunk-UMRZ7XCR.js";
26
35
  import {
27
36
  atomicWriteFileSync
28
- } from "./chunk-LTN3VYMZ.js";
37
+ } from "./chunk-3UALQ56H.js";
29
38
  import {
30
39
  FatalConfigError,
31
40
  QWEN_DIR,
32
41
  Storage,
33
42
  createDebugLogger,
34
43
  getErrorMessage
35
- } from "./chunk-WE6TNQJU.js";
44
+ } from "./chunk-C4K3FEQ2.js";
36
45
  import {
37
46
  init_esbuild_shims
38
47
  } from "./chunk-A4BMJM77.js";
@@ -13472,7 +13481,7 @@ var BoundedAsyncQueue = class {
13472
13481
  }
13473
13482
  };
13474
13483
 
13475
- // packages/cli/src/serve/eventBus.ts
13484
+ // packages/cli/src/serve/event-bus.ts
13476
13485
  init_esbuild_shims();
13477
13486
 
13478
13487
  // packages/acp-bridge/src/bridgeErrors.ts
@@ -13890,6 +13899,7 @@ var SERVE_STATUS_EXT_METHODS = {
13890
13899
  sessionSupportedCommands: "qwen/status/session/supported_commands",
13891
13900
  sessionTasks: "qwen/status/session/tasks",
13892
13901
  sessionStats: "qwen/status/session/stats",
13902
+ sessionLspStatus: "qwen/status/session/lsp",
13893
13903
  sessionRewindSnapshots: "qwen/status/session/rewind_snapshots",
13894
13904
  workspaceHooks: "qwen/status/workspace/hooks",
13895
13905
  sessionHooks: "qwen/status/session/hooks",
@@ -13899,6 +13909,7 @@ var SERVE_CONTROL_EXT_METHODS = {
13899
13909
  sessionClose: "qwen/control/session/close",
13900
13910
  sessionApprovalMode: "qwen/control/session/approval_mode",
13901
13911
  sessionBranch: "qwen/control/session/branch",
13912
+ sessionForkAgent: "qwen/control/session/fork_agent",
13902
13913
  sessionRecap: "qwen/control/session/recap",
13903
13914
  sessionBtw: "qwen/control/session/btw",
13904
13915
  sessionShellHistory: "qwen/control/session/shell_history",
@@ -14809,89 +14820,6 @@ function resolveColor(colorValue) {
14809
14820
  return void 0;
14810
14821
  }
14811
14822
  __name(resolveColor, "resolveColor");
14812
- var INK_NAME_TO_HEX = {
14813
- black: "#000000",
14814
- red: "#ff0000",
14815
- green: "#00ff00",
14816
- yellow: "#ffff00",
14817
- blue: "#0000ff",
14818
- cyan: "#00ffff",
14819
- magenta: "#ff00ff",
14820
- white: "#ffffff",
14821
- gray: "#808080",
14822
- grey: "#808080",
14823
- blackbright: "#808080",
14824
- redbright: "#ff8080",
14825
- greenbright: "#80ff80",
14826
- yellowbright: "#ffff80",
14827
- bluebright: "#8080ff",
14828
- cyanbright: "#80ffff",
14829
- magentabright: "#ff80ff",
14830
- whitebright: "#ffffff"
14831
- };
14832
- function toHex(color) {
14833
- const resolved = (resolveColor(color) ?? color).toLowerCase();
14834
- if (resolved.startsWith("#")) {
14835
- if (/^#[0-9a-f]{3}$/.test(resolved)) {
14836
- return `#${resolved.slice(1).split("").map((c) => c + c).join("")}`;
14837
- }
14838
- if (/^#[0-9a-f]{6}$/.test(resolved)) {
14839
- return resolved;
14840
- }
14841
- return void 0;
14842
- }
14843
- return INK_NAME_TO_HEX[resolved];
14844
- }
14845
- __name(toHex, "toHex");
14846
- function interpolateColor(color1, color2, factor) {
14847
- if (factor <= 0) {
14848
- return color1;
14849
- }
14850
- if (factor >= 1) {
14851
- return color2;
14852
- }
14853
- const h1 = toHex(color1);
14854
- const h2 = toHex(color2);
14855
- if (!h1 || !h2) {
14856
- return "";
14857
- }
14858
- const r1 = parseInt(h1.slice(1, 3), 16);
14859
- const g1 = parseInt(h1.slice(3, 5), 16);
14860
- const b1 = parseInt(h1.slice(5, 7), 16);
14861
- const r2 = parseInt(h2.slice(1, 3), 16);
14862
- const g2 = parseInt(h2.slice(3, 5), 16);
14863
- const b2 = parseInt(h2.slice(5, 7), 16);
14864
- const lerp = /* @__PURE__ */ __name((a, b) => Math.round(a + (b - a) * factor), "lerp");
14865
- const toByte = /* @__PURE__ */ __name((n) => Math.max(0, Math.min(255, n)).toString(16).padStart(2, "0"), "toByte");
14866
- return `#${toByte(lerp(r1, r2))}${toByte(lerp(g1, g2))}${toByte(lerp(b1, b2))}`;
14867
- }
14868
- __name(interpolateColor, "interpolateColor");
14869
- function subtleBandColor(bgColor, factor = 0.06) {
14870
- const hex = toHex(bgColor);
14871
- if (!hex) {
14872
- return "";
14873
- }
14874
- const r = parseInt(hex.slice(1, 3), 16);
14875
- const g = parseInt(hex.slice(3, 5), 16);
14876
- const b = parseInt(hex.slice(5, 7), 16);
14877
- const isDark = (r * 299 + g * 587 + b * 114) / 1e3 < 128;
14878
- const target = isDark ? "#ffffff" : "#000000";
14879
- return interpolateColor(hex, target, factor);
14880
- }
14881
- __name(subtleBandColor, "subtleBandColor");
14882
- var _supportsTrueColor;
14883
- function supportsTrueColor() {
14884
- if (_supportsTrueColor !== void 0) return _supportsTrueColor;
14885
- const colorterm = process.env["COLORTERM"];
14886
- if (colorterm === "truecolor" || colorterm === "24bit" || colorterm === "kmscon") {
14887
- return _supportsTrueColor = true;
14888
- }
14889
- if (process.stdout.getColorDepth && process.stdout.getColorDepth() >= 24) {
14890
- return _supportsTrueColor = true;
14891
- }
14892
- return _supportsTrueColor = false;
14893
- }
14894
- __name(supportsTrueColor, "supportsTrueColor");
14895
14823
 
14896
14824
  // packages/cli/src/ui/themes/theme.ts
14897
14825
  var lightTheme = {
@@ -15711,6 +15639,48 @@ var SETTINGS_SCHEMA = {
15711
15639
  description: "Enable Vim keybindings",
15712
15640
  showInDialog: true
15713
15641
  },
15642
+ voice: {
15643
+ type: "object",
15644
+ label: "Voice Dictation",
15645
+ category: "General",
15646
+ requiresRestart: false,
15647
+ default: {},
15648
+ description: "Voice dictation settings.",
15649
+ showInDialog: false,
15650
+ properties: {
15651
+ enabled: {
15652
+ type: "boolean",
15653
+ label: "Voice Dictation",
15654
+ category: "General",
15655
+ requiresRestart: false,
15656
+ default: false,
15657
+ description: "Enable voice dictation in the prompt input.",
15658
+ showInDialog: false
15659
+ },
15660
+ mode: {
15661
+ type: "enum",
15662
+ label: "Voice Dictation Mode",
15663
+ category: "General",
15664
+ requiresRestart: false,
15665
+ default: "hold",
15666
+ description: 'How push-to-talk behaves: "hold" to talk while held, or "tap" to start and tap (or pause) to stop and submit.',
15667
+ showInDialog: false,
15668
+ options: [
15669
+ { value: "hold", label: "Hold to talk" },
15670
+ { value: "tap", label: "Tap to toggle" }
15671
+ ]
15672
+ },
15673
+ language: {
15674
+ type: "string",
15675
+ label: "Voice Dictation Language",
15676
+ category: "General",
15677
+ requiresRestart: false,
15678
+ default: "",
15679
+ description: 'Preferred spoken language for voice transcription (e.g. "english", "chinese"). Leave empty to auto-detect.',
15680
+ showInDialog: false
15681
+ }
15682
+ }
15683
+ },
15714
15684
  enableAutoUpdate: {
15715
15685
  type: "boolean",
15716
15686
  label: "Enable Auto Update",
@@ -15751,7 +15721,7 @@ var SETTINGS_SCHEMA = {
15751
15721
  // surprised when a mid-session edit doesn't take effect immediately.
15752
15722
  requiresRestart: true,
15753
15723
  default: 30,
15754
- description: "Number of days to retain ~/.qwen/file-history/ session backups used by /rewind. Backups older than this are removed by a background housekeeping pass that runs at most once per day. Set to 0 for minimum retention (~1 hour) \u2014 protects sessions touched in the last hour, plus the currently active session. Other persistent caches will honor the same setting in the future.",
15724
+ description: "Number of days to retain ~/.qwen/file-history/ session backups used by /rewind and background subagent transcripts under <projectDir>/subagents/. Data older than this is removed by a background housekeeping pass that runs at most once per day. Set to 0 for minimum retention (~1 hour) \u2014 protects sessions touched in the last hour, plus the currently active session.",
15755
15725
  showInDialog: true
15756
15726
  },
15757
15727
  gitCoAuthor: {
@@ -15897,6 +15867,15 @@ var SETTINGS_SCHEMA = {
15897
15867
  { value: "text", label: "Text" },
15898
15868
  { value: "json", label: "JSON" }
15899
15869
  ]
15870
+ },
15871
+ showTimestamps: {
15872
+ type: "boolean",
15873
+ label: "Show Timestamps",
15874
+ category: "General",
15875
+ requiresRestart: false,
15876
+ default: false,
15877
+ description: "Show [HH:MM:SS] timestamp before each assistant response.",
15878
+ showInDialog: true
15900
15879
  }
15901
15880
  }
15902
15881
  },
@@ -15992,6 +15971,15 @@ var SETTINGS_SCHEMA = {
15992
15971
  description: "Hide the window title bar",
15993
15972
  showInDialog: false
15994
15973
  },
15974
+ disableWorkflowKeywordTrigger: {
15975
+ type: "boolean",
15976
+ label: "Disable Workflow Keyword Trigger",
15977
+ category: "UI",
15978
+ requiresRestart: false,
15979
+ default: false,
15980
+ description: "When true, mentioning the word `workflow` in a prompt no longer softly steers the turn toward the Workflow tool (and the Footer `workflow active` indicator is suppressed). Only applies when workflows are enabled.",
15981
+ showInDialog: true
15982
+ },
15995
15983
  showStatusInTitle: {
15996
15984
  type: "boolean",
15997
15985
  label: "Show Status in Title",
@@ -16404,6 +16392,15 @@ var SETTINGS_SCHEMA = {
16404
16392
  description: "Model used for generating prompt suggestions and speculative execution. Leave empty to use the main model. A smaller/faster model (e.g., qwen3-coder-flash) reduces latency and cost.",
16405
16393
  showInDialog: true
16406
16394
  },
16395
+ voiceModel: {
16396
+ type: "string",
16397
+ label: "Voice Model",
16398
+ category: "Model",
16399
+ requiresRestart: false,
16400
+ default: "",
16401
+ description: "Model used for voice transcription. Set with /model --voice. Leave empty to keep voice dictation disabled until a voice model is selected.",
16402
+ showInDialog: false
16403
+ },
16407
16404
  model: {
16408
16405
  type: "object",
16409
16406
  label: "Model",
@@ -16500,7 +16497,7 @@ var SETTINGS_SCHEMA = {
16500
16497
  category: "Model",
16501
16498
  requiresRestart: false,
16502
16499
  default: true,
16503
- description: "Skip streaming loop detection. Defaults to true to avoid false-positive interruptions; set to false to re-enable as an unattended-run guardrail.",
16500
+ description: "Skip the opt-in streaming loop-detection heuristics (content/thought repetition, read-file and action stagnation, global-duplicate and alternating tool-call patterns). Defaults to true to avoid false-positive interruptions; set to false to re-enable them as an unattended-run guardrail. A minimal always-on guard (consecutive identical tool calls plus a per-turn tool-call cap) still runs regardless of this setting.",
16504
16501
  showInDialog: false
16505
16502
  },
16506
16503
  skipStartupContext: {
@@ -16710,7 +16707,12 @@ var SETTINGS_SCHEMA = {
16710
16707
  category: "Context",
16711
16708
  requiresRestart: false,
16712
16709
  default: 5,
16713
- description: "Number of most-recent compactable tool results to preserve when clearing. Floor at 1.",
16710
+ description: "Integer number of most-recent compactable tool results to preserve when clearing. Values below 1 are floored to 1.",
16711
+ jsonSchemaOverride: {
16712
+ type: "integer",
16713
+ default: 5,
16714
+ description: "Integer number of most-recent compactable tool results to preserve when clearing. Values below 1 are floored to 1."
16715
+ },
16714
16716
  showInDialog: false
16715
16717
  },
16716
16718
  toolResultsTotalCharsThreshold: {
@@ -16748,9 +16750,19 @@ var SETTINGS_SCHEMA = {
16748
16750
  category: "Context",
16749
16751
  requiresRestart: true,
16750
16752
  default: true,
16751
- description: "Respect .qwenignore files when searching",
16753
+ description: "Respect .qwenignore and configured custom ignore files when searching",
16752
16754
  showInDialog: true
16753
16755
  },
16756
+ customIgnoreFiles: {
16757
+ type: "array",
16758
+ label: "Custom Ignore Files",
16759
+ category: "Context",
16760
+ requiresRestart: true,
16761
+ default: [...DEFAULT_QWEN_CUSTOM_IGNORE_FILE_NAMES],
16762
+ description: "Project-root-relative ignore files to use instead of the defaults (`.agentignore`, `.aiignore`) when respectQwenIgnore is enabled. .qwenignore is always included when respectQwenIgnore is enabled.",
16763
+ showInDialog: false,
16764
+ items: { type: "string" }
16765
+ },
16754
16766
  enableRecursiveFileSearch: {
16755
16767
  type: "boolean",
16756
16768
  label: "Enable Recursive File Search",
@@ -17305,7 +17317,7 @@ var SETTINGS_SCHEMA = {
17305
17317
  default: void 0,
17306
17318
  description: "Optional fixed quorum size for consensus policy. Capped at M (count of registered voters at request issue time) to prevent unreachable quorum. Unset = floor(M/2)+1. Requires daemon restart \u2014 read once at boot.",
17307
17319
  showInDialog: false,
17308
- // runQwenServe.ts validates `Number.isInteger(n) && n >= 1` and
17320
+ // run-qwen-serve.ts validates `Number.isInteger(n) && n >= 1` and
17309
17321
  // refuses to boot otherwise. Override the generated schema so IDE
17310
17322
  // (VSCode, JetBrains via JSON Schema) flags `0`, `-1`, `1.5`
17311
17323
  // BEFORE the user restarts the daemon. The bare `type:'number'`
@@ -17628,7 +17640,12 @@ var SETTINGS_SCHEMA = {
17628
17640
  description: "Maximum consecutive blocking Stop/SubagentStop hook decisions before Qwen Code overrides the hook loop and ends the turn. Can be overridden by QWEN_CODE_STOP_HOOK_BLOCK_CAP.",
17629
17641
  // This is an advanced safety valve for runaway hook loops, not a common
17630
17642
  // interactive preference.
17631
- showInDialog: false
17643
+ showInDialog: false,
17644
+ jsonSchemaOverride: {
17645
+ type: "integer",
17646
+ minimum: 1,
17647
+ default: DEFAULT_STOP_HOOK_BLOCK_CAP
17648
+ }
17632
17649
  },
17633
17650
  hooks: {
17634
17651
  type: "object",
@@ -17822,6 +17839,15 @@ var SETTINGS_SCHEMA = {
17822
17839
  description: "Enable agent team collaboration tools (experimental). When enabled, the model can create agent teams and coordinate work using team_create, team_delete, send_message, task_create, task_update, and task_list tools. Can also be enabled via QWEN_CODE_ENABLE_AGENT_TEAM=1 environment variable.",
17823
17840
  showInDialog: true
17824
17841
  },
17842
+ artifact: {
17843
+ type: "boolean",
17844
+ label: "Enable Artifacts",
17845
+ category: "Experimental",
17846
+ requiresRestart: true,
17847
+ default: false,
17848
+ description: "Enable the Artifact tool (experimental). When enabled, the model can publish a self-contained HTML page as an interactive Artifact and open it in the browser. Interactive, non-SDK sessions only. Can also be enabled via QWEN_CODE_ENABLE_ARTIFACT=1, or hard-disabled via QWEN_CODE_DISABLE_ARTIFACT=1.",
17849
+ showInDialog: true
17850
+ },
17825
17851
  emitToolUseSummaries: {
17826
17852
  type: "boolean",
17827
17853
  label: "Tool Use Summaries",
@@ -17833,6 +17859,134 @@ var SETTINGS_SCHEMA = {
17833
17859
  }
17834
17860
  }
17835
17861
  },
17862
+ artifact: {
17863
+ type: "object",
17864
+ label: "Artifacts",
17865
+ category: "Experimental",
17866
+ requiresRestart: true,
17867
+ default: {},
17868
+ description: "Configuration for the experimental Artifact tool (enable it via experimental.artifact). Selects the publish backend and, for the host backend, the upload command and shareable URL template.",
17869
+ showInDialog: false,
17870
+ properties: {
17871
+ autoOpen: {
17872
+ type: "boolean",
17873
+ label: "Auto-open Artifacts",
17874
+ category: "Experimental",
17875
+ requiresRestart: true,
17876
+ default: true,
17877
+ description: "Open published artifacts in the browser automatically. Set to false to publish without launching a browser. QWEN_ARTIFACT_NO_AUTO_OPEN=1 overrides this setting.",
17878
+ showInDialog: false
17879
+ },
17880
+ publisher: {
17881
+ type: "enum",
17882
+ label: "Artifact Publisher",
17883
+ category: "Experimental",
17884
+ requiresRestart: true,
17885
+ default: "local",
17886
+ description: "Where artifacts are published: 'local' (a file:// page on disk, the default), 'host' (upload via artifact.host.uploadCommand and return a shareable link), or 'oss' (native Aliyun OSS upload).",
17887
+ showInDialog: false,
17888
+ options: [
17889
+ { value: "local", label: "Local (file://)" },
17890
+ { value: "host", label: "Host (shareable link)" },
17891
+ { value: "oss", label: "Aliyun OSS" }
17892
+ ]
17893
+ },
17894
+ host: {
17895
+ type: "object",
17896
+ label: "Artifact Host",
17897
+ category: "Experimental",
17898
+ requiresRestart: true,
17899
+ default: {},
17900
+ description: 'Host-backend config, used when artifact.publisher is "host".',
17901
+ showInDialog: false,
17902
+ properties: {
17903
+ uploadCommand: {
17904
+ type: "string",
17905
+ label: "Upload Command",
17906
+ category: "Experimental",
17907
+ requiresRestart: true,
17908
+ default: "",
17909
+ description: 'Command that uploads the artifact, run with execFile (no shell). {file} = local HTML path, {key} = remote object key. e.g. "aws s3 cp {file} s3://bucket/{key} --content-type text/html".',
17910
+ showInDialog: false
17911
+ },
17912
+ urlTemplate: {
17913
+ type: "string",
17914
+ label: "URL Template",
17915
+ category: "Experimental",
17916
+ requiresRestart: true,
17917
+ default: "",
17918
+ description: 'Shareable URL template; {key} is substituted. e.g. "https://bucket.example.com/{key}".',
17919
+ showInDialog: false
17920
+ },
17921
+ keyPrefix: {
17922
+ type: "string",
17923
+ label: "Key Prefix",
17924
+ category: "Experimental",
17925
+ requiresRestart: true,
17926
+ default: "artifacts",
17927
+ description: 'Remote key prefix; the object key is "{prefix}/{id}/index.html".',
17928
+ showInDialog: false
17929
+ }
17930
+ }
17931
+ },
17932
+ oss: {
17933
+ type: "object",
17934
+ label: "Artifact OSS",
17935
+ category: "Experimental",
17936
+ requiresRestart: true,
17937
+ default: {},
17938
+ description: 'Native Aliyun OSS backend, used when artifact.publisher is "oss". Credentials are read from OSS_ACCESS_KEY_ID / OSS_ACCESS_KEY_SECRET (or ALIBABA_CLOUD_*), never from settings.',
17939
+ showInDialog: false,
17940
+ properties: {
17941
+ bucket: {
17942
+ type: "string",
17943
+ label: "OSS Bucket",
17944
+ category: "Experimental",
17945
+ requiresRestart: true,
17946
+ default: "",
17947
+ description: "OSS bucket name.",
17948
+ showInDialog: false
17949
+ },
17950
+ endpoint: {
17951
+ type: "string",
17952
+ label: "OSS Endpoint",
17953
+ category: "Experimental",
17954
+ requiresRestart: true,
17955
+ default: "",
17956
+ description: 'OSS endpoint host, e.g. "oss-cn-hangzhou.aliyuncs.com".',
17957
+ showInDialog: false
17958
+ },
17959
+ keyPrefix: {
17960
+ type: "string",
17961
+ label: "Key Prefix",
17962
+ category: "Experimental",
17963
+ requiresRestart: true,
17964
+ default: "artifacts",
17965
+ description: 'Remote key prefix; the object key is "{prefix}/{id}/index.html".',
17966
+ showInDialog: false
17967
+ },
17968
+ acl: {
17969
+ type: "string",
17970
+ label: "Object ACL",
17971
+ category: "Experimental",
17972
+ requiresRestart: true,
17973
+ default: "public-read",
17974
+ description: 'Object ACL applied on upload. "public-read" (default) makes the link shareable.',
17975
+ showInDialog: false
17976
+ },
17977
+ publicBaseUrl: {
17978
+ type: "string",
17979
+ label: "Public Base URL",
17980
+ category: "Experimental",
17981
+ requiresRestart: true,
17982
+ default: "",
17983
+ description: 'Optional CDN / custom-domain base for the returned URL. Upload still goes through endpoint. e.g. "https://cdn.example.com".',
17984
+ showInDialog: false
17985
+ }
17986
+ }
17987
+ }
17988
+ }
17989
+ },
17836
17990
  worktree: {
17837
17991
  type: "object",
17838
17992
  label: "Worktree",
@@ -18876,14 +19030,88 @@ var V3ToV4Migration = class {
18876
19030
  };
18877
19031
  var v3ToV4Migration = new V3ToV4Migration();
18878
19032
 
19033
+ // packages/cli/src/config/migration/versions/v5-to-v4.ts
19034
+ init_esbuild_shims();
19035
+ var PROVIDER_KEY_TO_PROTOCOL = {
19036
+ openai: "openai",
19037
+ "qwen-oauth": "qwen-oauth",
19038
+ gemini: "gemini",
19039
+ "vertex-ai": "gemini",
19040
+ anthropic: "anthropic"
19041
+ };
19042
+ function isWrappedProviderConfig(value) {
19043
+ return typeof value === "object" && value !== null && !Array.isArray(value);
19044
+ }
19045
+ __name(isWrappedProviderConfig, "isWrappedProviderConfig");
19046
+ var V5ToV4Migration = class {
19047
+ static {
19048
+ __name(this, "V5ToV4Migration");
19049
+ }
19050
+ fromVersion = 5;
19051
+ toVersion = 4;
19052
+ shouldMigrate(settings) {
19053
+ if (typeof settings !== "object" || settings === null) {
19054
+ return false;
19055
+ }
19056
+ const s = settings;
19057
+ if (s["$version"] === 5) {
19058
+ return true;
19059
+ }
19060
+ if (s["$version"] !== void 0) {
19061
+ return false;
19062
+ }
19063
+ const modelProviders = s["modelProviders"];
19064
+ if (typeof modelProviders !== "object" || modelProviders === null) {
19065
+ return false;
19066
+ }
19067
+ return Object.values(modelProviders).some(
19068
+ (v) => isWrappedProviderConfig(v)
19069
+ );
19070
+ }
19071
+ migrate(settings, _scope) {
19072
+ if (typeof settings !== "object" || settings === null) {
19073
+ throw new Error("Settings must be an object");
19074
+ }
19075
+ const result = structuredClone(settings);
19076
+ const warnings = [];
19077
+ const modelProviders = result["modelProviders"];
19078
+ if (typeof modelProviders === "object" && modelProviders !== null) {
19079
+ const providers = modelProviders;
19080
+ for (const [key, value] of Object.entries(providers)) {
19081
+ if (Array.isArray(value)) {
19082
+ continue;
19083
+ }
19084
+ if (!isWrappedProviderConfig(value)) {
19085
+ continue;
19086
+ }
19087
+ const derivedProtocol = Object.hasOwn(PROVIDER_KEY_TO_PROTOCOL, key) ? PROVIDER_KEY_TO_PROTOCOL[key] : void 0;
19088
+ if (typeof value.protocol === "string" && derivedProtocol !== void 0 && value.protocol !== derivedProtocol) {
19089
+ warnings.push(
19090
+ `Provider "${key}" declared protocol "${value.protocol}", but V4 derives protocol "${derivedProtocol}" from the provider key. The explicit protocol has been dropped.`
19091
+ );
19092
+ }
19093
+ providers[key] = Array.isArray(value.models) ? value.models : [];
19094
+ }
19095
+ }
19096
+ result["$version"] = 4;
19097
+ return { settings: result, warnings };
19098
+ }
19099
+ };
19100
+ var v5ToV4Migration = new V5ToV4Migration();
19101
+
18879
19102
  // packages/cli/src/config/migration/index.ts
18880
19103
  var ALL_MIGRATIONS = [
18881
19104
  v1ToV2Migration,
18882
19105
  v2ToV3Migration,
18883
19106
  v3ToV4Migration
18884
19107
  ];
19108
+ var DOWNGRADE_MIGRATIONS = [v5ToV4Migration];
19109
+ var CONVERGENCE_MIGRATIONS = [
19110
+ ...ALL_MIGRATIONS,
19111
+ ...DOWNGRADE_MIGRATIONS
19112
+ ];
18885
19113
  function runMigrations(settings, scope) {
18886
- const scheduler = new MigrationScheduler([...ALL_MIGRATIONS], scope);
19114
+ const scheduler = new MigrationScheduler([...CONVERGENCE_MIGRATIONS], scope);
18887
19115
  return scheduler.migrate(settings);
18888
19116
  }
18889
19117
  __name(runMigrations, "runMigrations");
@@ -18893,11 +19121,11 @@ function needsMigration(settings) {
18893
19121
  }
18894
19122
  const s = settings;
18895
19123
  const version = s["$version"];
18896
- const hasApplicableMigration = ALL_MIGRATIONS.some(
19124
+ const hasApplicableMigration = CONVERGENCE_MIGRATIONS.some(
18897
19125
  (migration) => migration.shouldMigrate(settings)
18898
19126
  );
18899
19127
  if (typeof version === "number") {
18900
- if (version >= SETTINGS_VERSION) {
19128
+ if (version === SETTINGS_VERSION) {
18901
19129
  return false;
18902
19130
  }
18903
19131
  return hasApplicableMigration;
@@ -19361,72 +19589,86 @@ function detectQwenHomeRedirectWithoutMigration(activeUserSettingsPath) {
19361
19589
  return `QWEN_HOME points to "${activeQwenDir}" but no settings.json was found there. Existing config remains at "${legacyQwenDir}" \u2014 OAuth tokens, settings, memory, extensions, and skills are not auto-migrated. Copy them manually if you want them to apply at the new location.`;
19362
19590
  }
19363
19591
  __name(detectQwenHomeRedirectWithoutMigration, "detectQwenHomeRedirectWithoutMigration");
19364
- function findEnvFile(settings, startDir, userLevelPaths = getUserLevelEnvPaths()) {
19592
+ function findEnvFiles(settings, startDir, userLevelPaths = getUserLevelEnvPaths()) {
19365
19593
  const homeDir = homedir();
19366
19594
  const isTrusted = isWorkspaceTrusted(settings).isTrusted;
19367
19595
  const globalQwenDir = Storage.getGlobalQwenDir();
19368
19596
  const legacyQwenDir = path4.normalize(path4.join(homeDir, QWEN_DIR));
19369
19597
  const hasCustomConfigDir = path4.normalize(globalQwenDir) !== legacyQwenDir;
19598
+ const found = [];
19599
+ const seen = /* @__PURE__ */ new Set();
19370
19600
  const canUseEnvFile = /* @__PURE__ */ __name((filePath) => isTrusted !== false || userLevelPaths.has(path4.normalize(filePath)), "canUseEnvFile");
19371
- const findHomeCandidate = /* @__PURE__ */ __name(() => {
19601
+ const pushCandidate = /* @__PURE__ */ __name((filePath) => {
19602
+ const normalized = path4.normalize(filePath);
19603
+ if (!seen.has(normalized) && fs6.existsSync(filePath) && canUseEnvFile(filePath)) {
19604
+ seen.add(normalized);
19605
+ found.push(filePath);
19606
+ return true;
19607
+ }
19608
+ return false;
19609
+ }, "pushCandidate");
19610
+ const pushHomeCandidates = /* @__PURE__ */ __name(() => {
19372
19611
  const candidates = [path4.join(globalQwenDir, ".env")];
19373
19612
  if (hasCustomConfigDir) {
19374
19613
  candidates.push(path4.join(legacyQwenDir, ".env"));
19375
19614
  }
19376
19615
  candidates.push(path4.join(homeDir, ".env"));
19377
19616
  for (const candidate of candidates) {
19378
- if (fs6.existsSync(candidate) && canUseEnvFile(candidate)) {
19379
- return candidate;
19380
- }
19617
+ pushCandidate(candidate);
19381
19618
  }
19382
- return null;
19383
- }, "findHomeCandidate");
19619
+ }, "pushHomeCandidates");
19384
19620
  let currentDir = path4.resolve(startDir);
19385
19621
  let visitedHomeDir = false;
19386
19622
  while (true) {
19387
19623
  if (currentDir === homeDir) {
19388
19624
  visitedHomeDir = true;
19389
- const found = findHomeCandidate();
19390
- if (found) return found;
19625
+ pushHomeCandidates();
19626
+ return found;
19391
19627
  } else {
19392
19628
  const geminiEnvPath = path4.join(currentDir, QWEN_DIR, ".env");
19393
- if (fs6.existsSync(geminiEnvPath) && canUseEnvFile(geminiEnvPath)) {
19394
- return geminiEnvPath;
19629
+ if (pushCandidate(geminiEnvPath)) {
19630
+ pushHomeCandidates();
19631
+ return found;
19395
19632
  }
19396
19633
  const envPath = path4.join(currentDir, ".env");
19397
- if (fs6.existsSync(envPath) && canUseEnvFile(envPath)) {
19398
- return envPath;
19634
+ if (pushCandidate(envPath)) {
19635
+ pushHomeCandidates();
19636
+ return found;
19399
19637
  }
19400
19638
  }
19401
19639
  const parentDir = path4.dirname(currentDir);
19402
19640
  if (parentDir === currentDir || !parentDir) {
19403
- return visitedHomeDir ? null : findHomeCandidate();
19641
+ if (!visitedHomeDir) {
19642
+ pushHomeCandidates();
19643
+ }
19644
+ return found;
19404
19645
  }
19405
19646
  currentDir = parentDir;
19406
19647
  }
19407
19648
  }
19408
- __name(findEnvFile, "findEnvFile");
19409
- function setUpCloudShellEnvironment(envFilePath) {
19410
- if (envFilePath && fs6.existsSync(envFilePath)) {
19649
+ __name(findEnvFiles, "findEnvFiles");
19650
+ function setUpCloudShellEnvironmentFromFiles(envFilePaths) {
19651
+ for (const envFilePath of envFilePaths) {
19652
+ if (!fs6.existsSync(envFilePath)) {
19653
+ continue;
19654
+ }
19411
19655
  const envFileContent = fs6.readFileSync(envFilePath);
19412
19656
  const parsedEnv = dotenv.parse(envFileContent);
19413
19657
  if (parsedEnv["GOOGLE_CLOUD_PROJECT"]) {
19414
19658
  process2.env["GOOGLE_CLOUD_PROJECT"] = parsedEnv["GOOGLE_CLOUD_PROJECT"];
19415
- } else {
19416
- process2.env["GOOGLE_CLOUD_PROJECT"] = "cloudshell-gca";
19659
+ return;
19417
19660
  }
19418
- } else {
19419
- process2.env["GOOGLE_CLOUD_PROJECT"] = "cloudshell-gca";
19420
19661
  }
19662
+ process2.env["GOOGLE_CLOUD_PROJECT"] = "cloudshell-gca";
19421
19663
  }
19422
- __name(setUpCloudShellEnvironment, "setUpCloudShellEnvironment");
19664
+ __name(setUpCloudShellEnvironmentFromFiles, "setUpCloudShellEnvironmentFromFiles");
19423
19665
  function loadEnvironment(settings) {
19424
19666
  const userLevelPaths = getUserLevelEnvPaths();
19425
- const envFilePath = findEnvFile(settings, process2.cwd(), userLevelPaths);
19667
+ const envFilePaths = findEnvFiles(settings, process2.cwd(), userLevelPaths);
19426
19668
  if (process2.env["CLOUD_SHELL"] === "true") {
19427
- setUpCloudShellEnvironment(envFilePath);
19669
+ setUpCloudShellEnvironmentFromFiles(envFilePaths);
19428
19670
  }
19429
- if (envFilePath) {
19671
+ for (const envFilePath of envFilePaths) {
19430
19672
  try {
19431
19673
  const envFileContent = fs6.readFileSync(envFilePath, "utf-8");
19432
19674
  const parsedEnv = dotenv.parse(envFileContent);
@@ -19446,7 +19688,7 @@ function loadEnvironment(settings) {
19446
19688
  process2.env[key] = parsedEnv[key];
19447
19689
  dotEnvSourcedKeys.add(key);
19448
19690
  }
19449
- if (!lastReloadSnapshotSeeded) {
19691
+ if (!lastReloadSnapshotSeeded && !lastReloadSnapshot.has(key)) {
19450
19692
  lastReloadSnapshot.set(key, parsedEnv[key]);
19451
19693
  }
19452
19694
  }
@@ -19473,14 +19715,14 @@ function loadEnvironment(settings) {
19473
19715
  __name(loadEnvironment, "loadEnvironment");
19474
19716
  function reloadEnvironment(settings, workspaceCwd) {
19475
19717
  const userLevelPaths = getUserLevelEnvPaths();
19476
- const envFilePath = findEnvFile(settings, workspaceCwd, userLevelPaths);
19718
+ const envFilePaths = findEnvFiles(settings, workspaceCwd, userLevelPaths);
19477
19719
  if (process2.env["CLOUD_SHELL"] === "true") {
19478
- setUpCloudShellEnvironment(envFilePath);
19720
+ setUpCloudShellEnvironmentFromFiles(envFilePaths);
19479
19721
  }
19480
19722
  let dotEnvReadFailed = false;
19481
19723
  const newDotEnvKeys = /* @__PURE__ */ new Map();
19482
19724
  const newSettingsEnvKeys = /* @__PURE__ */ new Map();
19483
- if (envFilePath) {
19725
+ for (const envFilePath of envFilePaths) {
19484
19726
  try {
19485
19727
  const envFileContent = fs6.readFileSync(envFilePath, "utf-8");
19486
19728
  const parsedEnv = dotenv.parse(envFileContent);
@@ -19495,7 +19737,9 @@ function reloadEnvironment(settings, workspaceCwd) {
19495
19737
  continue;
19496
19738
  }
19497
19739
  if (!isQwenScopedEnvFile && excludedVars.includes(key)) continue;
19498
- newDotEnvKeys.set(key, parsedEnv[key]);
19740
+ if (!newDotEnvKeys.has(key)) {
19741
+ newDotEnvKeys.set(key, parsedEnv[key]);
19742
+ }
19499
19743
  }
19500
19744
  } catch {
19501
19745
  dotEnvReadFailed = true;
@@ -20077,7 +20321,7 @@ __name(getPackageJson, "getPackageJson");
20077
20321
  // packages/cli/src/utils/version.ts
20078
20322
  async function getCliVersion() {
20079
20323
  const pkgJson = await getPackageJson();
20080
- return "0.18.5-nightly.20260622.6bc3f853e";
20324
+ return "0.18.5-preview.0";
20081
20325
  }
20082
20326
  __name(getCliVersion, "getCliVersion");
20083
20327
 
@@ -20222,6 +20466,242 @@ function createLoadedSettingsAdapter(settings, scope) {
20222
20466
  }
20223
20467
  __name(createLoadedSettingsAdapter, "createLoadedSettingsAdapter");
20224
20468
 
20469
+ // packages/cli/src/utils/acpModelUtils.ts
20470
+ init_esbuild_shims();
20471
+ function formatAcpModelId(modelId, authType) {
20472
+ return `${modelId}(${authType})`;
20473
+ }
20474
+ __name(formatAcpModelId, "formatAcpModelId");
20475
+ function sanitizeProviderBaseUrl(baseUrl) {
20476
+ const scheme = baseUrl.match(/^[A-Za-z][A-Za-z\d+.-]*:\/\//);
20477
+ if (!scheme) {
20478
+ return baseUrl;
20479
+ }
20480
+ const authorityStart = scheme[0].length;
20481
+ const stripAt = /* @__PURE__ */ __name((at) => `${baseUrl.slice(0, authorityStart)}${baseUrl.slice(at + 1)}`, "stripAt");
20482
+ const authorityEnd = findAuthorityEnd(baseUrl, authorityStart);
20483
+ const authorityAt = baseUrl.slice(authorityStart, authorityEnd).lastIndexOf("@");
20484
+ const authorityAtIndex = authorityAt === -1 ? -1 : authorityStart + authorityAt;
20485
+ try {
20486
+ const parsed = new URL(baseUrl);
20487
+ if (parsed.username || parsed.password) {
20488
+ return authorityAtIndex >= authorityStart ? stripAt(authorityAtIndex) : baseUrl;
20489
+ }
20490
+ return baseUrl;
20491
+ } catch {
20492
+ if (authorityAtIndex >= authorityStart) {
20493
+ return stripAt(authorityAtIndex);
20494
+ }
20495
+ const fallbackAt = findUnescapedUserInfoFallbackAt(
20496
+ baseUrl,
20497
+ authorityStart,
20498
+ authorityEnd
20499
+ );
20500
+ return fallbackAt === -1 ? baseUrl : stripAt(fallbackAt);
20501
+ }
20502
+ }
20503
+ __name(sanitizeProviderBaseUrl, "sanitizeProviderBaseUrl");
20504
+ function findUnescapedUserInfoFallbackAt(baseUrl, authorityStart, authorityEnd) {
20505
+ const at = baseUrl.lastIndexOf("@");
20506
+ if (at < authorityStart || authorityEnd >= at) {
20507
+ return -1;
20508
+ }
20509
+ const colon = baseUrl.indexOf(":", authorityStart);
20510
+ if (colon === -1 || colon > authorityEnd) {
20511
+ return -1;
20512
+ }
20513
+ const portCandidate = baseUrl.slice(colon + 1, authorityEnd);
20514
+ return /^\d+$/.test(portCandidate) ? -1 : at;
20515
+ }
20516
+ __name(findUnescapedUserInfoFallbackAt, "findUnescapedUserInfoFallbackAt");
20517
+ function findAuthorityEnd(baseUrl, authorityStart) {
20518
+ const slash = baseUrl.indexOf("/", authorityStart);
20519
+ const query = baseUrl.indexOf("?", authorityStart);
20520
+ const hash = baseUrl.indexOf("#", authorityStart);
20521
+ let end = baseUrl.length;
20522
+ if (slash !== -1) end = Math.min(end, slash);
20523
+ if (query !== -1) end = Math.min(end, query);
20524
+ if (hash !== -1) end = Math.min(end, hash);
20525
+ return end;
20526
+ }
20527
+ __name(findAuthorityEnd, "findAuthorityEnd");
20528
+ function parseAcpBaseModelId(value) {
20529
+ const trimmed = value.trim();
20530
+ const closeIdx = trimmed.lastIndexOf(")");
20531
+ const openIdx = trimmed.lastIndexOf("(");
20532
+ if (openIdx >= 0 && closeIdx === trimmed.length - 1 && openIdx < closeIdx) {
20533
+ return trimmed.slice(0, openIdx);
20534
+ }
20535
+ return trimmed;
20536
+ }
20537
+ __name(parseAcpBaseModelId, "parseAcpBaseModelId");
20538
+ function parseAcpModelOption(input) {
20539
+ const trimmed = input.trim();
20540
+ const closeIdx = trimmed.lastIndexOf(")");
20541
+ const openIdx = trimmed.lastIndexOf("(");
20542
+ if (openIdx >= 0 && closeIdx === trimmed.length - 1 && openIdx < closeIdx) {
20543
+ const maybeModelId = trimmed.slice(0, openIdx);
20544
+ const maybeAuthType = trimmed.slice(openIdx + 1, closeIdx);
20545
+ const parsedAuthType = external_exports.nativeEnum(AuthType).safeParse(maybeAuthType);
20546
+ if (parsedAuthType.success) {
20547
+ return { modelId: maybeModelId, authType: parsedAuthType.data };
20548
+ }
20549
+ }
20550
+ return { modelId: trimmed };
20551
+ }
20552
+ __name(parseAcpModelOption, "parseAcpModelOption");
20553
+
20554
+ // packages/cli/src/utils/modelConfigUtils.ts
20555
+ init_esbuild_shims();
20556
+ var AUTH_ENV_MODEL_VARS = {
20557
+ ["openai" /* USE_OPENAI */]: ["OPENAI_MODEL", "QWEN_MODEL"],
20558
+ ["gemini" /* USE_GEMINI */]: ["GEMINI_MODEL"],
20559
+ ["vertex-ai" /* USE_VERTEX_AI */]: ["GOOGLE_MODEL"],
20560
+ ["anthropic" /* USE_ANTHROPIC */]: ["ANTHROPIC_MODEL"],
20561
+ ["qwen-oauth" /* QWEN_OAUTH */]: []
20562
+ };
20563
+ function getIgnoredTopLevelGenerationConfigFields(settingsGenerationConfig, modelProvider) {
20564
+ if (!settingsGenerationConfig || !modelProvider) {
20565
+ return [];
20566
+ }
20567
+ const providerGenerationConfig = modelProvider.generationConfig ?? {};
20568
+ return MODEL_GENERATION_CONFIG_FIELDS.filter(
20569
+ (field) => Object.hasOwn(settingsGenerationConfig, field) && !Object.hasOwn(providerGenerationConfig, field)
20570
+ );
20571
+ }
20572
+ __name(getIgnoredTopLevelGenerationConfigFields, "getIgnoredTopLevelGenerationConfigFields");
20573
+ function buildIgnoredTopLevelGenerationConfigWarning(authType, modelProvider, ignoredFields) {
20574
+ if (ignoredFields.length === 0) {
20575
+ return void 0;
20576
+ }
20577
+ const fieldList = ignoredFields.map((field) => `model.generationConfig.${field}`).join(", ");
20578
+ const isSingular = ignoredFields.length === 1;
20579
+ const verb = isSingular ? "is" : "are";
20580
+ const fieldReference = isSingular ? "this field" : "these fields";
20581
+ const pronoun = isSingular ? "it" : "them";
20582
+ return `Warning: ${fieldList} ${verb} ignored for provider model "${modelProvider.id}" from modelProviders.${authType}. Move ${fieldReference} to modelProviders.${authType}[].generationConfig for that model if you want ${pronoun} to apply.`;
20583
+ }
20584
+ __name(buildIgnoredTopLevelGenerationConfigWarning, "buildIgnoredTopLevelGenerationConfigWarning");
20585
+ function getAuthTypeFromEnv() {
20586
+ if (process.env["QWEN_OAUTH"]) {
20587
+ return "qwen-oauth" /* QWEN_OAUTH */;
20588
+ }
20589
+ if (process.env["OPENAI_API_KEY"] && (process.env["OPENAI_MODEL"] || process.env["QWEN_MODEL"]) && process.env["OPENAI_BASE_URL"]) {
20590
+ return "openai" /* USE_OPENAI */;
20591
+ }
20592
+ if (process.env["GEMINI_API_KEY"] && process.env["GEMINI_MODEL"]) {
20593
+ return "gemini" /* USE_GEMINI */;
20594
+ }
20595
+ if (process.env["GOOGLE_API_KEY"] && process.env["GOOGLE_MODEL"]) {
20596
+ return "vertex-ai" /* USE_VERTEX_AI */;
20597
+ }
20598
+ if (process.env["ANTHROPIC_API_KEY"] && process.env["ANTHROPIC_MODEL"] && process.env["ANTHROPIC_BASE_URL"]) {
20599
+ return "anthropic" /* USE_ANTHROPIC */;
20600
+ }
20601
+ return void 0;
20602
+ }
20603
+ __name(getAuthTypeFromEnv, "getAuthTypeFromEnv");
20604
+ function resolveCliGenerationConfig(inputs) {
20605
+ const { argv, settings, selectedAuthType } = inputs;
20606
+ const env = inputs.env ?? process.env;
20607
+ const authType = selectedAuthType;
20608
+ let resolvedModel;
20609
+ let sourceEnvVar;
20610
+ let resolvedFromSettings = false;
20611
+ if (argv.model) {
20612
+ resolvedModel = argv.model;
20613
+ } else if (settings.model?.name) {
20614
+ resolvedModel = stripRuntimeSnapshotPrefix(settings.model.name);
20615
+ resolvedFromSettings = true;
20616
+ } else if (authType && AUTH_ENV_MODEL_VARS[authType]) {
20617
+ for (const envVar of AUTH_ENV_MODEL_VARS[authType]) {
20618
+ if (env[envVar]) {
20619
+ resolvedModel = env[envVar];
20620
+ sourceEnvVar = envVar;
20621
+ break;
20622
+ }
20623
+ }
20624
+ }
20625
+ let modelProvider;
20626
+ let disambiguationWarning;
20627
+ if (resolvedModel && authType && settings.modelProviders) {
20628
+ const providers = settings.modelProviders[authType];
20629
+ if (providers && Array.isArray(providers)) {
20630
+ const persistedBaseUrl = settings.model?.baseUrl;
20631
+ if (resolvedFromSettings && persistedBaseUrl) {
20632
+ const exactMatch = providers.find(
20633
+ (p) => p.id === resolvedModel && p.baseUrl === persistedBaseUrl
20634
+ );
20635
+ modelProvider = exactMatch ?? providers.find((p) => p.id === resolvedModel);
20636
+ if (!exactMatch && modelProvider) {
20637
+ const fallbackBaseUrl = modelProvider.baseUrl === void 0 ? "(default baseUrl)" : sanitizeProviderBaseUrl(modelProvider.baseUrl);
20638
+ disambiguationWarning = `Persisted model.baseUrl '${sanitizeProviderBaseUrl(persistedBaseUrl)}' no longer matches any provider for model '${resolvedModel}' (authType '${authType}'); using the first id match ('${fallbackBaseUrl}'). Re-select the model to update it.`;
20639
+ }
20640
+ } else {
20641
+ modelProvider = providers.find((p) => p.id === resolvedModel);
20642
+ }
20643
+ }
20644
+ }
20645
+ const allModelEnvVars = Object.values(AUTH_ENV_MODEL_VARS).flat();
20646
+ const filteredEnv = { ...env };
20647
+ if (sourceEnvVar) {
20648
+ for (const envVar of allModelEnvVars) {
20649
+ if (envVar !== sourceEnvVar) {
20650
+ delete filteredEnv[envVar];
20651
+ }
20652
+ }
20653
+ } else {
20654
+ for (const envVar of allModelEnvVars) {
20655
+ delete filteredEnv[envVar];
20656
+ }
20657
+ }
20658
+ const configSources = {
20659
+ authType,
20660
+ cli: {
20661
+ model: argv.model,
20662
+ apiKey: argv.openaiApiKey,
20663
+ baseUrl: argv.openaiBaseUrl
20664
+ },
20665
+ settings: {
20666
+ model: settings.model?.name ? stripRuntimeSnapshotPrefix(settings.model.name) : void 0,
20667
+ apiKey: settings.security?.auth?.apiKey,
20668
+ baseUrl: settings.security?.auth?.baseUrl,
20669
+ generationConfig: settings.model?.generationConfig
20670
+ },
20671
+ modelProvider,
20672
+ env: filteredEnv
20673
+ };
20674
+ const resolved = resolveModelConfig(configSources);
20675
+ const ignoredGenerationConfigWarning = authType && modelProvider ? buildIgnoredTopLevelGenerationConfigWarning(
20676
+ authType,
20677
+ modelProvider,
20678
+ getIgnoredTopLevelGenerationConfigFields(
20679
+ settings.model?.generationConfig,
20680
+ modelProvider
20681
+ )
20682
+ ) : void 0;
20683
+ const enableOpenAILogging = (typeof argv.openaiLogging === "undefined" ? settings.model?.enableOpenAILogging : argv.openaiLogging) ?? false;
20684
+ const openAILoggingDir = argv.openaiLoggingDir || settings.model?.openAILoggingDir;
20685
+ const generationConfig = {
20686
+ ...resolved.config,
20687
+ enableOpenAILogging,
20688
+ openAILoggingDir
20689
+ };
20690
+ return {
20691
+ model: resolved.config.model || "",
20692
+ apiKey: resolved.config.apiKey || "",
20693
+ baseUrl: resolved.config.baseUrl || "",
20694
+ generationConfig,
20695
+ sources: resolved.sources,
20696
+ warnings: [
20697
+ ...resolved.warnings,
20698
+ ...disambiguationWarning ? [disambiguationWarning] : [],
20699
+ ...ignoredGenerationConfigWarning ? [ignoredGenerationConfigWarning] : []
20700
+ ]
20701
+ };
20702
+ }
20703
+ __name(resolveCliGenerationConfig, "resolveCliGenerationConfig");
20704
+
20225
20705
  // packages/acp-bridge/src/bridgeTypes.ts
20226
20706
  init_esbuild_shims();
20227
20707
  var MID_TURN_QUEUE_DRAIN_METHOD = "craft/drainMidTurnQueue";
@@ -20234,7 +20714,7 @@ import { execFile } from "node:child_process";
20234
20714
 
20235
20715
  // packages/cli/src/generated/git-commit.ts
20236
20716
  init_esbuild_shims();
20237
- var GIT_COMMIT_INFO = "6e7a8c221";
20717
+ var GIT_COMMIT_INFO = "7837cc103";
20238
20718
 
20239
20719
  // packages/cli/src/utils/systemInfo.ts
20240
20720
  var debugLogger4 = createDebugLogger("STATUS");
@@ -20389,8 +20869,6 @@ __name(formatLspStatusSnapshot, "formatLspStatusSnapshot");
20389
20869
  export {
20390
20870
  require_strip_json_comments,
20391
20871
  resolveColor,
20392
- subtleBandColor,
20393
- supportsTrueColor,
20394
20872
  lightTheme,
20395
20873
  darkTheme,
20396
20874
  ansiTheme,
@@ -20438,6 +20916,12 @@ export {
20438
20916
  reloadEnvironment,
20439
20917
  CORRUPTED_SUFFIX,
20440
20918
  loadSettings,
20919
+ formatAcpModelId,
20920
+ sanitizeProviderBaseUrl,
20921
+ parseAcpBaseModelId,
20922
+ parseAcpModelOption,
20923
+ getAuthTypeFromEnv,
20924
+ resolveCliGenerationConfig,
20441
20925
  require_debug,
20442
20926
  require_constants,
20443
20927
  require_re,