@qwen-code/qwen-code 0.19.2 → 0.19.3-nightly.20260701.a974594d7

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 (291) hide show
  1. package/bundled/extension-creator/SKILL.md +357 -0
  2. package/bundled/loop/SKILL.md +34 -10
  3. package/bundled/loop/SKILL.test.ts +52 -0
  4. package/bundled/loop/autonomous-loop.test.ts +59 -0
  5. package/bundled/loop/autonomous-loop.ts +102 -0
  6. package/bundled/loop/loop-task-file.test.ts +1064 -0
  7. package/bundled/loop/loop-task-file.ts +404 -0
  8. package/bundled/loop/loop-tick-resolver.test.ts +864 -0
  9. package/bundled/loop/loop-tick-resolver.ts +416 -0
  10. package/bundled/qc-helper/SKILL.md +26 -19
  11. package/bundled/qc-helper/docs/configuration/auth.md +11 -11
  12. package/bundled/qc-helper/docs/configuration/model-providers.md +13 -13
  13. package/bundled/qc-helper/docs/configuration/settings.md +77 -75
  14. package/bundled/qc-helper/docs/features/channels/plugins.md +1 -1
  15. package/bundled/qc-helper/docs/features/commands.md +108 -77
  16. package/bundled/qc-helper/docs/features/hooks.md +6 -1
  17. package/bundled/qc-helper/docs/features/memory.md +53 -1
  18. package/bundled/qc-helper/docs/features/status-line.md +3 -3
  19. package/bundled/qc-helper/docs/ide-integration/ide-integration.md +4 -4
  20. package/bundled/qc-helper/docs/qwen-serve.md +24 -2
  21. package/bundled/qc-helper/docs/support/tos-privacy.md +16 -3
  22. package/bundled/qc-helper/docs/support/troubleshooting.md +6 -0
  23. package/chunks/{MaxSizedBox-7RERNLFK.js → MaxSizedBox-UZHJ73JB.js} +29 -27
  24. package/chunks/{StandaloneSessionPicker-S22XBSN6.js → StandaloneSessionPicker-GGUIZWCE.js} +42 -37
  25. package/chunks/{acpAgent-4MCETHF2.js → acpAgent-QYZFICEZ.js} +1292 -332
  26. package/chunks/{agent-K3ENVYSB.js → agent-2EN7YNSW.js} +24 -23
  27. package/chunks/{agent-headless-HO3V3A3A.js → agent-headless-SLTEZ5LV.js} +24 -23
  28. package/chunks/{anthropicContentGenerator-E3TQ5XJJ.js → anthropicContentGenerator-CA3JTAMO.js} +33 -12
  29. package/chunks/{artifact-tool-QA4KRO3B.js → artifact-tool-RM7WINJO.js} +3 -3
  30. package/chunks/{askUserQuestion-HMWXW6VN.js → askUserQuestion-J3P6QAJ7.js} +2 -2
  31. package/chunks/{bridge-4LV2HBH2.js → bridge-HZVAUTMX.js} +29 -28
  32. package/chunks/{ca-7WC7ELX6.js → ca-RYOETBUW.js} +10 -9
  33. package/chunks/{chunk-JXQ23SNT.js → chunk-2JKEQWDZ.js} +623 -78
  34. package/chunks/chunk-32MCHZQC.js +73 -0
  35. package/chunks/{chunk-PXFFKNCO.js → chunk-35FH347N.js} +5308 -2500
  36. package/chunks/{chunk-5JZLXFPD.js → chunk-3O2BJMFW.js} +11 -11
  37. package/chunks/{chunk-2JD55C6G.js → chunk-3TK7FSCP.js} +2 -2
  38. package/chunks/{chunk-USGMPVOY.js → chunk-4722VFFU.js} +19 -10
  39. package/chunks/chunk-6FIWYVN4.js +4932 -0
  40. package/chunks/{chunk-I2RFAW6Q.js → chunk-7SP275SH.js} +7 -5
  41. package/chunks/{chunk-5R4SBCX6.js → chunk-AIBPG5MB.js} +3 -3
  42. package/chunks/{chunk-C4K3FEQ2.js → chunk-AVQDCKNF.js} +124 -21
  43. package/chunks/{chunk-OTBK43JR.js → chunk-B236XPGF.js} +1 -1
  44. package/chunks/{chunk-WA5OJGFL.js → chunk-B5MPZI4K.js} +458 -125
  45. package/chunks/{chunk-5DWXLGOM.js → chunk-BJBWRCSK.js} +1 -1
  46. package/chunks/{chunk-4W4T77MO.js → chunk-BLAE2TCO.js} +109 -6
  47. package/chunks/chunk-BMFMJINR.js +45 -0
  48. package/chunks/{chunk-T2VDEFUU.js → chunk-BZHLWC6T.js} +2 -2
  49. package/chunks/{chunk-XU5P23GN.js → chunk-CA4ML3VH.js} +3 -3
  50. package/chunks/{chunk-WGAEWQTF.js → chunk-DBR7PF4B.js} +1 -2
  51. package/chunks/{chunk-S566HKUS.js → chunk-DHXWNSJA.js} +15 -1
  52. package/chunks/{chunk-LLFFKXZZ.js → chunk-DJ25MIU2.js} +167 -43
  53. package/chunks/{chunk-KBXLIVWQ.js → chunk-DX3TKXNT.js} +2 -2
  54. package/chunks/{chunk-OIC6S73E.js → chunk-E5I6YSNO.js} +1 -1
  55. package/chunks/{chunk-TXVGVZYR.js → chunk-ESVSWG6Z.js} +3 -3
  56. package/chunks/{chunk-EX4W6ZYG.js → chunk-EUURTJY7.js} +1 -1
  57. package/chunks/{chunk-QBZ22PQX.js → chunk-EWALXUAD.js} +3 -1
  58. package/chunks/{chunk-F6XNTYNE.js → chunk-FQDMX5IL.js} +30 -307
  59. package/chunks/{chunk-3QFE4OTE.js → chunk-FR3II765.js} +4 -4
  60. package/chunks/{chunk-VYFMN7C6.js → chunk-FV4SQ54H.js} +382 -55
  61. package/chunks/{chunk-ZD3NW5KL.js → chunk-FZY7NH37.js} +63 -9
  62. package/chunks/{chunk-CI5O6SQL.js → chunk-G525INVW.js} +4 -4
  63. package/chunks/{chunk-CGOMICBE.js → chunk-GDIG7TMG.js} +34 -1
  64. package/chunks/{chunk-R2BXK7SX.js → chunk-GHOTR7HL.js} +6 -1
  65. package/chunks/{chunk-TZM5JIAX.js → chunk-GZKQ36JS.js} +10 -7
  66. package/chunks/{chunk-BS64PXY3.js → chunk-HIYUAXBG.js} +1 -1
  67. package/chunks/{chunk-TMBPDHXD.js → chunk-HTWHAN44.js} +1 -1
  68. package/chunks/{chunk-EL5IHQON.js → chunk-HUGAEYZR.js} +6 -27
  69. package/chunks/{chunk-2BIF2NVV.js → chunk-HWG4XLD7.js} +2 -2
  70. package/chunks/{chunk-I5T6PIBQ.js → chunk-I4MXURND.js} +1076 -954
  71. package/chunks/{chunk-JTYRZODB.js → chunk-IBEM64M4.js} +39 -11
  72. package/chunks/{chunk-XKBP7M7A.js → chunk-IKO44NAT.js} +149 -31
  73. package/chunks/{chunk-2BAQ3ACS.js → chunk-JERW36RG.js} +404 -4
  74. package/chunks/{chunk-TOEGRAVX.js → chunk-JV7A66DR.js} +28 -16
  75. package/chunks/{chunk-3RJ3ZPPR.js → chunk-KKQWC6WS.js} +7 -7
  76. package/chunks/{chunk-EXMX5YHG.js → chunk-KXVVXAAC.js} +1 -1
  77. package/chunks/{chunk-Z7XXFPGP.js → chunk-LDWTYE33.js} +1 -1
  78. package/chunks/{chunk-X6EDWN44.js → chunk-LWGLBVWA.js} +1 -1
  79. package/chunks/{chunk-NYOHZYHM.js → chunk-LXEW6BHF.js} +45 -3
  80. package/chunks/{chunk-BGUDAULQ.js → chunk-LXGWLOCM.js} +5 -5
  81. package/chunks/{chunk-ZUAXI2OA.js → chunk-M2U5NM24.js} +188 -11366
  82. package/chunks/{chunk-BNXANYLH.js → chunk-MOUXUCXQ.js} +81 -1
  83. package/chunks/{chunk-FPACXT7T.js → chunk-MTJVHQDP.js} +534 -164
  84. package/chunks/{chunk-UAARJR2G.js → chunk-N4V4VBP6.js} +2 -2
  85. package/chunks/chunk-NIOPRZNN.js +27 -0
  86. package/chunks/{chunk-2TJ3YN6Q.js → chunk-NOYV2NXI.js} +517 -490
  87. package/chunks/{chunk-PRYMDRBV.js → chunk-NPQWQYU6.js} +1 -1
  88. package/chunks/{chunk-J6AW7O5D.js → chunk-NVTRORSK.js} +2 -2
  89. package/chunks/{chunk-PF523XJX.js → chunk-OE5J6UA7.js} +1 -1
  90. package/chunks/{chunk-RS4HRC75.js → chunk-OEY3YAL2.js} +99 -8
  91. package/chunks/{chunk-R36VMVEP.js → chunk-PLQTLKMR.js} +5 -5
  92. package/chunks/{chunk-UN3C6GOR.js → chunk-PPFWEV7G.js} +10 -108
  93. package/chunks/chunk-Q3JOGB4U.js +481 -0
  94. package/chunks/{chunk-HG6YKEBI.js → chunk-Q7TDHJ2G.js} +192 -30
  95. package/chunks/{chunk-EW6C27XX.js → chunk-QHHNFG22.js} +9 -3
  96. package/chunks/chunk-QYUE6W3T.js +123 -0
  97. package/chunks/{chunk-GZCJS5WH.js → chunk-SJBIFVD2.js} +2 -2
  98. package/chunks/{chunk-3UALQ56H.js → chunk-T42ACHFI.js} +1 -1
  99. package/chunks/chunk-T44AF4I6.js +690 -0
  100. package/chunks/{chunk-DBZUXSSV.js → chunk-TMILTLP3.js} +6 -6
  101. package/chunks/{chunk-EEEZIVFJ.js → chunk-TOAUDIS7.js} +1 -1
  102. package/chunks/chunk-UAKXW3DN.js +30 -0
  103. package/chunks/{chunk-VQRYPFCV.js → chunk-V5YJAUHW.js} +10 -460
  104. package/chunks/{chunk-D5E5TMYH.js → chunk-VHRREANT.js} +16 -2
  105. package/chunks/{chunk-5RVSM6NW.js → chunk-VN4CKYUW.js} +1 -1
  106. package/chunks/chunk-VXGPYF7U.js +37 -0
  107. package/chunks/{chunk-UAARVVBI.js → chunk-WGY3GIPP.js} +1 -1
  108. package/chunks/{chunk-GYZQA2FO.js → chunk-WJAY4WXR.js} +1 -1
  109. package/chunks/chunk-XKSCTXPK.js +167 -0
  110. package/chunks/chunk-YCEHOJZJ.js +840 -0
  111. package/chunks/{chunk-BG4BIP7F.js → chunk-YCRTJYSQ.js} +4 -2
  112. package/chunks/{chunk-CGEGHF2C.js → chunk-YPCPZSZB.js} +1 -1
  113. package/chunks/chunk-YTFBURQD.js +313 -0
  114. package/chunks/{chunk-HGNSRCRB.js → chunk-YXK4GPYO.js} +1 -1
  115. package/chunks/{chunk-OQHQHJRK.js → chunk-Z34RYLRO.js} +151 -4775
  116. package/chunks/chunk-ZGSV5ORL.js +11273 -0
  117. package/chunks/{computer-use-6BBRNT6S.js → computer-use-FCNWHVPW.js} +103 -49
  118. package/chunks/{contextCommand-UJAJ6N57.js → contextCommand-FVFMZZEU.js} +26 -25
  119. package/chunks/{cron-create-4KQE6YLH.js → cron-create-IY5NMIHQ.js} +4 -4
  120. package/chunks/{cron-delete-THME66UP.js → cron-delete-OLNEQWKO.js} +6 -6
  121. package/chunks/{cron-list-7A54SJ5N.js → cron-list-YAUAUV24.js} +5 -5
  122. package/chunks/{daemon-status-provider-CSL3BUOY.js → daemon-status-provider-42JEXENZ.js} +32 -32
  123. package/chunks/{de-ACHALDED.js → de-HB5NJXGB.js} +10 -9
  124. package/chunks/{dist-BD27IA3L.js → dist-4FCNM6KJ.js} +2 -2
  125. package/chunks/{dist-OD2FY543.js → dist-K4XZILIO.js} +1 -1
  126. package/chunks/{dist-BOOH5JWN.js → dist-SU6L7ZNJ.js} +114 -9
  127. package/chunks/{dist-QHJRBCMP.js → dist-UKPWQJCL.js} +44 -2
  128. package/chunks/{dist-QFFZWACU.js → dist-VD7HXTML.js} +20 -9
  129. package/chunks/{earlyInputCapture-X6KMCSHD.js → earlyInputCapture-FFFEC6P4.js} +25 -24
  130. package/chunks/{edit-7J6WXARF.js → edit-32ILSGZY.js} +72 -30
  131. package/chunks/{en-NCUBOJOY.js → en-U3LWGSFX.js} +19 -9
  132. package/chunks/{enter-worktree-KULCKJPJ.js → enter-worktree-XWZKIN6A.js} +24 -23
  133. package/chunks/{enterPlanMode-H2CIOLMH.js → enterPlanMode-LPFFY7BJ.js} +24 -23
  134. package/chunks/{errors-6G2JYR54.js → errors-UXBPYPI2.js} +26 -25
  135. package/chunks/{exit-worktree-ECBWBVC5.js → exit-worktree-IBS4UIU7.js} +24 -23
  136. package/chunks/{exitPlanMode-DQV56GTW.js → exitPlanMode-JA72YHII.js} +24 -23
  137. package/chunks/{fast-path-35JJFS3C.js → fast-path-7UU67Y2W.js} +30 -13
  138. package/chunks/{fast-path-settings-TSVI53EB.js → fast-path-settings-UQLRFDQP.js} +3 -2
  139. package/chunks/{fr-GVKZ27MF.js → fr-XY3NQFCM.js} +10 -9
  140. package/chunks/{gemini-NDTG7WAX.js → gemini-GMVKJNMX.js} +211 -105
  141. package/chunks/{geminiContentGenerator-XTG6SFLA.js → geminiContentGenerator-7NIFF2L4.js} +4 -4
  142. package/chunks/{glob-SJ2JBZK4.js → glob-4NJCW5HI.js} +24 -23
  143. package/chunks/{grep-BRMWFEWR.js → grep-PAIMLQEL.js} +24 -23
  144. package/chunks/{initializer-P5AXF7PV.js → initializer-R6KU4VYM.js} +31 -28
  145. package/chunks/{ja-FKZ2WZ4D.js → ja-J7YAG7SA.js} +10 -9
  146. package/chunks/{keychain-token-storage-CSYMNRPP.js → keychain-token-storage-GPAKRDKQ.js} +2 -2
  147. package/chunks/{list-6COK34BP.js → list-H7LXAO64.js} +32 -29
  148. package/chunks/{loadedSettingsAdapter-XIUTN245.js → loadedSettingsAdapter-H27JMTLU.js} +30 -27
  149. package/chunks/{loop-wakeup-33GPXJLA.js → loop-wakeup-Y3OIRQFM.js} +7 -7
  150. package/chunks/{ls-BYQY7RVV.js → ls-TVJEYS7O.js} +4 -4
  151. package/chunks/{lsp-X54RO4IV.js → lsp-JZSDVR3F.js} +2 -2
  152. package/chunks/{monitor-DH7KFSJV.js → monitor-JSIHDPXP.js} +24 -23
  153. package/chunks/nonInteractiveCli-Y4CHOETG.js +100 -0
  154. package/chunks/{notebook-edit-D4R4ZLMA.js → notebook-edit-SHRNL2UM.js} +52 -23
  155. package/chunks/{openaiContentGenerator-F74IPQ6E.js → openaiContentGenerator-ORZZ7VFO.js} +13 -12
  156. package/chunks/{pt-SY5NCFGR.js → pt-6RTAA6SS.js} +10 -9
  157. package/chunks/{qwenContentGenerator-ATTK5P4D.js → qwenContentGenerator-H643PL2G.js} +26 -25
  158. package/chunks/{qwenOAuth2-K4AASPCV.js → qwenOAuth2-OI2B7PES.js} +5 -4
  159. package/chunks/{read-file-767G23OY.js → read-file-5PRNPTTY.js} +8 -8
  160. package/chunks/{read-mcp-resource-I5HCZJ6X.js → read-mcp-resource-QTXGKTEV.js} +2 -2
  161. package/chunks/{ripGrep-4OMMGSWX.js → ripGrep-JIKZMABJ.js} +24 -23
  162. package/chunks/{ru-FWNXJG4F.js → ru-AUBGJ2C4.js} +10 -9
  163. package/chunks/{run-qwen-serve-REKSTYRA.js → run-qwen-serve-PQV7QOHZ.js} +284 -52
  164. package/chunks/{scheduler-UNTFDQLG.js → scheduler-OS3R5MGU.js} +24 -23
  165. package/chunks/{send-message-2DAFXEYP.js → send-message-DKGHWSTF.js} +2 -2
  166. package/chunks/{serve-KZ56QB5S.js → serve-LVYZDKCZ.js} +31 -29
  167. package/chunks/{server-BV5TZUMU.js → server-P4YIH35I.js} +11458 -8447
  168. package/chunks/{session-OIBXFSGD.js → session-DE4TZBKH.js} +195 -58
  169. package/chunks/{settings-WJTCBIRA.js → settings-DFTYMJYF.js} +30 -27
  170. package/chunks/{shell-WC52IBHW.js → shell-3GNQLNV7.js} +24 -23
  171. package/chunks/{skill-U7F7JR4M.js → skill-NCNG4KKZ.js} +38 -11
  172. package/chunks/{spawnChannel-EI2E5BCW.js → spawnChannel-DHRIMDVL.js} +26 -25
  173. package/chunks/{src-4F6FBZFI.js → src-PNZYGM3R.js} +104 -28
  174. package/chunks/{startInteractiveUI-SFRVB3CE.js → startInteractiveUI-P6GZBFQW.js} +2817 -2500
  175. package/chunks/{syntheticOutput-PPS3HDVA.js → syntheticOutput-X7L5HWLN.js} +3 -3
  176. package/chunks/{task-create-OUYCA553.js → task-create-AWEUI4GI.js} +6 -6
  177. package/chunks/{task-list-WAX7I2IA.js → task-list-KZ3VJLDU.js} +5 -5
  178. package/chunks/{task-stop-CAIL6FNH.js → task-stop-GUNOZKJ5.js} +2 -2
  179. package/chunks/{task-update-AHEO5OUT.js → task-update-Y56GP6DU.js} +6 -6
  180. package/chunks/{team-create-3WC7CIIW.js → team-create-6JMW3KQK.js} +24 -23
  181. package/chunks/{team-delete-HGHFG23B.js → team-delete-6AFRGDJY.js} +5 -5
  182. package/chunks/{theme-manager-DICFCT3P.js → theme-manager-FEHQO22G.js} +25 -24
  183. package/chunks/{todoWrite-IFBMN3FH.js → todoWrite-JRS6NOEU.js} +4 -4
  184. package/chunks/{tool-search-L5K7HLER.js → tool-search-IXAEKS7J.js} +101 -16
  185. package/chunks/trustedFolders-SJRXNHZE.js +76 -0
  186. package/chunks/types-QX5C3CHJ.js +12 -0
  187. package/chunks/{validateNonInterActiveAuth-GCH4Z6KI.js → validateNonInterActiveAuth-HCH7OBDH.js} +56 -51
  188. package/chunks/{web-fetch-B5IIQ5TT.js → web-fetch-RELNL37A.js} +29 -15
  189. package/chunks/{workflow-OB3AND7I.js → workflow-M2COBI7R.js} +38 -32
  190. package/chunks/{workspace-providers-status-ZIR5EPOO.js → workspace-providers-status-GOCWYDMK.js} +32 -29
  191. package/chunks/workspace-service-34C7SUBU.js +75 -0
  192. package/chunks/{write-file-SEXBNDZM.js → write-file-E52WRXZL.js} +67 -31
  193. package/chunks/{zh-RBEGQVQT.js → zh-F5T4WWZO.js} +19 -9
  194. package/chunks/{zh-TW-QGAVRXT3.js → zh-TW-LKLBTZHE.js} +19 -9
  195. package/cli-entry.js +20 -9
  196. package/cli.js +6 -6
  197. package/locales/ca.js +15 -13
  198. package/locales/de.js +15 -13
  199. package/locales/en.js +31 -13
  200. package/locales/fr.js +16 -14
  201. package/locales/ja.js +15 -14
  202. package/locales/pt.js +15 -13
  203. package/locales/ru.js +15 -13
  204. package/locales/zh-TW.js +28 -12
  205. package/locales/zh.js +28 -12
  206. package/node_modules/@qwen-code/audio-capture/dist/index.d.ts +35 -0
  207. package/node_modules/@qwen-code/audio-capture/dist/index.js +48 -0
  208. package/node_modules/@qwen-code/audio-capture/dist/index.js.map +1 -0
  209. package/node_modules/@qwen-code/audio-capture/dist/platform.d.ts +7 -0
  210. package/node_modules/@qwen-code/audio-capture/dist/platform.js +18 -0
  211. package/node_modules/@qwen-code/audio-capture/dist/platform.js.map +1 -0
  212. package/node_modules/@qwen-code/audio-capture/node_modules/node-gyp-build/LICENSE +21 -0
  213. package/node_modules/@qwen-code/audio-capture/node_modules/node-gyp-build/README.md +58 -0
  214. package/node_modules/@qwen-code/audio-capture/node_modules/node-gyp-build/SECURITY.md +5 -0
  215. package/node_modules/@qwen-code/audio-capture/node_modules/node-gyp-build/bin.js +84 -0
  216. package/node_modules/@qwen-code/audio-capture/node_modules/node-gyp-build/build-test.js +19 -0
  217. package/node_modules/@qwen-code/audio-capture/node_modules/node-gyp-build/index.js +6 -0
  218. package/node_modules/@qwen-code/audio-capture/node_modules/node-gyp-build/node-gyp-build.js +207 -0
  219. package/node_modules/@qwen-code/audio-capture/node_modules/node-gyp-build/optional.js +7 -0
  220. package/node_modules/@qwen-code/audio-capture/node_modules/node-gyp-build/package.json +43 -0
  221. package/node_modules/@qwen-code/audio-capture/package.json +30 -0
  222. package/node_modules/@qwen-code/audio-capture/prebuilds/darwin-arm64/@qwen-code+audio-capture.node +0 -0
  223. package/node_modules/@qwen-code/audio-capture/prebuilds/darwin-x64/@qwen-code+audio-capture.node +0 -0
  224. package/node_modules/@qwen-code/audio-capture/prebuilds/linux-arm64/@qwen-code+audio-capture.node +0 -0
  225. package/node_modules/@qwen-code/audio-capture/prebuilds/linux-x64/@qwen-code+audio-capture.node +0 -0
  226. package/node_modules/@qwen-code/audio-capture/prebuilds/win32-x64/@qwen-code+audio-capture.node +0 -0
  227. package/package.json +18 -6
  228. package/patches/chrome-devtools-mcp+1.4.0.patch +31 -0
  229. package/postinstall.js +50 -0
  230. package/web-shell/assets/{arc-D_ae_Y9k.js → arc-C2DILvUl.js} +1 -1
  231. package/web-shell/assets/{architectureDiagram-3BPJPVTR-BMLRjppa.js → architectureDiagram-3BPJPVTR-b8gZ2cNw.js} +1 -1
  232. package/web-shell/assets/{blockDiagram-GPEHLZMM-qVDQC8KL.js → blockDiagram-GPEHLZMM-BuRpghMj.js} +1 -1
  233. package/web-shell/assets/{c4Diagram-AAUBKEIU-CxWS6MBd.js → c4Diagram-AAUBKEIU-2ItdhFmE.js} +1 -1
  234. package/web-shell/assets/channel-eRvn2UA3.js +1 -0
  235. package/web-shell/assets/{chunk-2J33WTMH-BtNuY5Yp.js → chunk-2J33WTMH-B1QXa0q3.js} +1 -1
  236. package/web-shell/assets/{chunk-4BX2VUAB-BU-x368d.js → chunk-4BX2VUAB-DXfhKlNq.js} +1 -1
  237. package/web-shell/assets/{chunk-55IACEB6-DRgTLvBu.js → chunk-55IACEB6-ClSNjxLo.js} +1 -1
  238. package/web-shell/assets/{chunk-727SXJPM-D2aElv7q.js → chunk-727SXJPM-Dsh2wisB.js} +1 -1
  239. package/web-shell/assets/{chunk-AQP2D5EJ-BwHCMRQ0.js → chunk-AQP2D5EJ-C1TkY5AR.js} +1 -1
  240. package/web-shell/assets/{chunk-FMBD7UC4-BMyPH-ku.js → chunk-FMBD7UC4-CGtN9XR6.js} +1 -1
  241. package/web-shell/assets/{chunk-ND2GUHAM-BNKTstUf.js → chunk-ND2GUHAM-BHiPi1SS.js} +1 -1
  242. package/web-shell/assets/{chunk-QZHKN3VN-gD3vsFId.js → chunk-QZHKN3VN-CzG3I5o1.js} +1 -1
  243. package/web-shell/assets/classDiagram-4FO5ZUOK-YZNwy1rx.js +1 -0
  244. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-YZNwy1rx.js +1 -0
  245. package/web-shell/assets/{cose-bilkent-S5V4N54A-BG9FAsXE.js → cose-bilkent-S5V4N54A-EgrIoH_K.js} +1 -1
  246. package/web-shell/assets/{dagre-BM42HDAG-Cy1sR7om.js → dagre-BM42HDAG-BUnpdX8S.js} +1 -1
  247. package/web-shell/assets/default-aEtf0G7-.svg +1 -0
  248. package/web-shell/assets/{diagram-2AECGRRQ-Bxi1I_Vu.js → diagram-2AECGRRQ-BlLUCVYu.js} +1 -1
  249. package/web-shell/assets/{diagram-5GNKFQAL-BGCJjO6y.js → diagram-5GNKFQAL-FG-enmjQ.js} +1 -1
  250. package/web-shell/assets/{diagram-KO2AKTUF-CMTeLXp7.js → diagram-KO2AKTUF-BlzmTONk.js} +1 -1
  251. package/web-shell/assets/{diagram-LMA3HP47-BN1wyAGh.js → diagram-LMA3HP47-CoBQ8mIx.js} +1 -1
  252. package/web-shell/assets/{diagram-OG6HWLK6-UYSG_zcp.js → diagram-OG6HWLK6-DvxV6sX8.js} +1 -1
  253. package/web-shell/assets/{erDiagram-TEJ5UH35-DqXL08lw.js → erDiagram-TEJ5UH35-Jq1tpAoj.js} +1 -1
  254. package/web-shell/assets/{flowDiagram-I6XJVG4X-BPJ9SFji.js → flowDiagram-I6XJVG4X-CbtYOry5.js} +1 -1
  255. package/web-shell/assets/{ganttDiagram-6RSMTGT7-BEd9Pnms.js → ganttDiagram-6RSMTGT7-ZEn2VEKR.js} +1 -1
  256. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-DrNRH3oi.js → gitGraphDiagram-PVQCEYII-BZh-LkhJ.js} +1 -1
  257. package/web-shell/assets/index-5FhE0ORO.css +5 -0
  258. package/web-shell/assets/index-CDTGmqVm.js +720 -0
  259. package/web-shell/assets/{infoDiagram-5YYISTIA-CFYBrkVI.js → infoDiagram-5YYISTIA-B9HuZygK.js} +1 -1
  260. package/web-shell/assets/insert-DmRbh9Rv.svg +1 -0
  261. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-Dxsddth7.js → ishikawaDiagram-YF4QCWOH-D76cNpYG.js} +1 -1
  262. package/web-shell/assets/{journeyDiagram-JHISSGLW-DxaDK80t.js → journeyDiagram-JHISSGLW-6bGo7P1t.js} +1 -1
  263. package/web-shell/assets/{kanban-definition-UN3LZRKU-Q0jQCOct.js → kanban-definition-UN3LZRKU-DuYyRBvB.js} +1 -1
  264. package/web-shell/assets/{linear-DGGM2kcP.js → linear-CpdSW1BC.js} +1 -1
  265. package/web-shell/assets/{mermaid.core-ByoxnWut.js → mermaid.core-s5xbZMMj.js} +5 -5
  266. package/web-shell/assets/{mindmap-definition-RKZ34NQL-C0ZseHsi.js → mindmap-definition-RKZ34NQL-go01fZ2y.js} +1 -1
  267. package/web-shell/assets/{pieDiagram-4H26LBE5-MQXNhl5A.js → pieDiagram-4H26LBE5-BfuZiEHO.js} +1 -1
  268. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-DIR4ee2A.js → quadrantDiagram-W4KKPZXB-DsoINqV6.js} +1 -1
  269. package/web-shell/assets/queue-DWpnpFgW.svg +1 -0
  270. package/web-shell/assets/{requirementDiagram-4Y6WPE33-BTR0UdYQ.js → requirementDiagram-4Y6WPE33-B7FU4LiU.js} +1 -1
  271. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-sfnhMELN.js → sankeyDiagram-5OEKKPKP-BEDjFnGB.js} +1 -1
  272. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-DXczHOHH.js → sequenceDiagram-3UESZ5HK-gzmmL5tK.js} +1 -1
  273. package/web-shell/assets/{stateDiagram-AJRCARHV-DdE_KQFH.js → stateDiagram-AJRCARHV-BtHD4IN_.js} +1 -1
  274. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DFy6gLDd.js +1 -0
  275. package/web-shell/assets/{timeline-definition-PNZ67QCA-DIc61uE8.js → timeline-definition-PNZ67QCA-T_8gmMCf.js} +1 -1
  276. package/web-shell/assets/{vennDiagram-CIIHVFJN-BF7ODmxB.js → vennDiagram-CIIHVFJN-DdjuqnjO.js} +1 -1
  277. package/web-shell/assets/{wardley-L42UT6IY-3pc1MEaw.js → wardley-L42UT6IY-Cgtrvb37.js} +1 -1
  278. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-9jnPcZuP.js → wardleyDiagram-YWT4CUSO-BW3f3-yW.js} +1 -1
  279. package/web-shell/assets/{xychartDiagram-2RQKCTM6-DcthaZK6.js → xychartDiagram-2RQKCTM6-BUS9IKkc.js} +1 -1
  280. package/web-shell/index.html +2 -2
  281. package/chunks/chunk-B6HQGTYR.js +0 -410
  282. package/chunks/chunk-RKIZXJMB.js +0 -13
  283. package/chunks/headlessSafetyWarnings-LJ6FJX77.js +0 -57
  284. package/chunks/nonInteractiveCli-7575LBXP.js +0 -91
  285. package/chunks/workspace-service-OM5D4OI2.js +0 -60
  286. package/web-shell/assets/channel-DYPNiTww.js +0 -1
  287. package/web-shell/assets/classDiagram-4FO5ZUOK-p_g25Tni.js +0 -1
  288. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-p_g25Tni.js +0 -1
  289. package/web-shell/assets/index-CpOXWDPh.js +0 -714
  290. package/web-shell/assets/index-oVK7qhre.css +0 -5
  291. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BHUSEndU.js +0 -1
@@ -1,10 +1,12 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
+ import {
4
+ contextCommand
5
+ } from "./chunk-GZKQ36JS.js";
3
6
  import {
4
7
  isValidSessionId,
5
- require_undici,
6
8
  validateAuthMethod
7
- } from "./chunk-ZUAXI2OA.js";
9
+ } from "./chunk-ZGSV5ORL.js";
8
10
  import {
9
11
  VSCODE_SHIFT_ENTER_SEQUENCE,
10
12
  calculateCost,
@@ -15,57 +17,65 @@ import {
15
17
  getSystemInfoFields,
16
18
  useKeypress,
17
19
  writeOsc52
18
- } from "./chunk-JTYRZODB.js";
19
- import {
20
- Text
21
- } from "./chunk-UAARJR2G.js";
22
- import {
23
- isKittyProtocolEnabled
24
- } from "./chunk-JZSY4WP3.js";
25
- import {
26
- contextCommand
27
- } from "./chunk-TZM5JIAX.js";
20
+ } from "./chunk-IBEM64M4.js";
28
21
  import {
29
22
  isTerminalGoalStatusKind
30
23
  } from "./chunk-KSPVDFE4.js";
24
+ import {
25
+ Text
26
+ } from "./chunk-N4V4VBP6.js";
31
27
  import {
32
28
  require_react
33
29
  } from "./chunk-KYMBIKIW.js";
34
30
  import {
35
- getErrorMessage as getErrorMessage2
36
- } from "./chunk-5R4SBCX6.js";
31
+ isKittyProtocolEnabled
32
+ } from "./chunk-JZSY4WP3.js";
37
33
  import {
38
34
  themeManager
39
- } from "./chunk-TMBPDHXD.js";
35
+ } from "./chunk-HTWHAN44.js";
40
36
  import {
41
- formatUnsupportedVoiceModelMessage,
42
- isSelectableVoiceModel
43
- } from "./chunk-NYOHZYHM.js";
37
+ getErrorMessage as getErrorMessage2
38
+ } from "./chunk-AIBPG5MB.js";
39
+ import {
40
+ GITHUB_WORKFLOW_PATHS,
41
+ setupGithub
42
+ } from "./chunk-Q3JOGB4U.js";
44
43
  import {
45
- stripUnsafeCharacters
46
- } from "./chunk-CGOMICBE.js";
44
+ require_undici
45
+ } from "./chunk-M2U5NM24.js";
46
+ import {
47
+ stripUnsafeCharacters,
48
+ toCodePoints
49
+ } from "./chunk-GDIG7TMG.js";
47
50
  import {
48
51
  getExtendedSystemInfo,
49
52
  getGitVersion,
50
53
  getNpmVersion
51
- } from "./chunk-CI5O6SQL.js";
54
+ } from "./chunk-G525INVW.js";
52
55
  import {
53
56
  formatDuration,
54
57
  formatMemoryUsage,
55
58
  formatTokenCount
56
59
  } from "./chunk-KHDZHZMH.js";
57
60
  import {
61
+ isInlineModelOverrideAllowed,
58
62
  parseAcpModelOption
59
- } from "./chunk-RS4HRC75.js";
63
+ } from "./chunk-OEY3YAL2.js";
64
+ import {
65
+ formatUnsupportedVoiceModelMessage,
66
+ getVoiceSettingsScope,
67
+ isSelectableVoiceModel,
68
+ isVoiceEnabled,
69
+ readVoiceMode,
70
+ readVoiceModel
71
+ } from "./chunk-LXEW6BHF.js";
60
72
  import {
61
73
  OUTPUT_LANGUAGE_AUTO,
62
74
  getPersistScopeForModelSelection,
63
75
  isAutoLanguage,
64
- isFolderTrustEnabled,
65
- loadTrustedFolders,
66
76
  resolveOutputLanguage,
67
77
  writeOutputLanguageAndRegisterPath
68
- } from "./chunk-OQHQHJRK.js";
78
+ } from "./chunk-6FIWYVN4.js";
69
79
  import {
70
80
  SUPPORTED_LANGUAGES,
71
81
  getCurrentLanguage,
@@ -73,10 +83,14 @@ import {
73
83
  resolveSupportedLanguage,
74
84
  setLanguageAsync,
75
85
  t
76
- } from "./chunk-5JZLXFPD.js";
86
+ } from "./chunk-3O2BJMFW.js";
87
+ import {
88
+ isFolderTrustEnabled,
89
+ loadTrustedFolders
90
+ } from "./chunk-Z34RYLRO.js";
77
91
  import {
78
92
  require_strip_json_comments
79
- } from "./chunk-UN3C6GOR.js";
93
+ } from "./chunk-QYUE6W3T.js";
80
94
  import {
81
95
  APPROVAL_MODES,
82
96
  ArenaManager,
@@ -108,18 +122,21 @@ import {
108
122
  flatMapTextParts,
109
123
  generateSessionRecap,
110
124
  getActiveGoal,
125
+ getArenaSystemReminder,
111
126
  getExtensionDescription,
112
127
  getExtensionDisplayName,
113
128
  getIdeInstaller,
114
129
  getInsightPrompt,
115
130
  getLastGoalTerminal,
116
131
  getMCPServerPrompts,
132
+ getPlanModeSystemReminder,
117
133
  getProjectSummaryPrompt,
118
134
  getShellConfiguration,
119
135
  glob,
120
136
  hookEventSupportsMatcher,
121
137
  ideContextStore,
122
138
  isGitRepository,
139
+ isImageCapable,
123
140
  isSuccessStatus,
124
141
  isTerminalStatus,
125
142
  listSavedWorkflows,
@@ -143,21 +160,21 @@ import {
143
160
  stripStartupContext,
144
161
  tryGenerateSessionTitle,
145
162
  unregisterGoalHook
146
- } from "./chunk-PXFFKNCO.js";
163
+ } from "./chunk-35FH347N.js";
147
164
  import {
148
165
  external_exports
149
166
  } from "./chunk-K5PGHDBN.js";
150
167
  import {
151
168
  runSideQuery
152
- } from "./chunk-BG4BIP7F.js";
169
+ } from "./chunk-YCRTJYSQ.js";
153
170
  import {
154
171
  applySkillAllowedTools,
155
172
  buildSkillLlmContent
156
- } from "./chunk-OTBK43JR.js";
173
+ } from "./chunk-B236XPGF.js";
157
174
  import {
158
175
  HookEventName,
159
176
  sanitizeUserPromptExpansionAdditionalContext
160
- } from "./chunk-HGNSRCRB.js";
177
+ } from "./chunk-YXK4GPYO.js";
161
178
  import {
162
179
  IdeConnectionEvent,
163
180
  formatTokenUsageSummaryAsCsv,
@@ -167,31 +184,34 @@ import {
167
184
  logIdeConnection,
168
185
  queryTokenUsage,
169
186
  read,
187
+ recordSkillInvocation,
170
188
  resolveOpenAILogDir,
171
189
  uiTelemetryService
172
- } from "./chunk-WA5OJGFL.js";
190
+ } from "./chunk-B5MPZI4K.js";
173
191
  import {
174
192
  getAutoMemoryRoot,
175
193
  getUserAutoMemoryRoot
176
- } from "./chunk-BNXANYLH.js";
194
+ } from "./chunk-MOUXUCXQ.js";
177
195
  import {
178
196
  ToolNames
179
- } from "./chunk-TOEGRAVX.js";
197
+ } from "./chunk-JV7A66DR.js";
180
198
  import {
181
199
  openBrowserSecurely
182
200
  } from "./chunk-22IFUCVR.js";
183
201
  import {
184
202
  Storage,
185
203
  createDebugLogger,
204
+ expandHomeDir,
186
205
  getErrorMessage,
187
206
  isSubpath,
207
+ resolvePath,
188
208
  updateSymlink
189
- } from "./chunk-C4K3FEQ2.js";
209
+ } from "./chunk-AVQDCKNF.js";
190
210
  import {
191
211
  isCpuProfileRecording,
192
212
  startCpuProfile,
193
213
  stopCpuProfile
194
- } from "./chunk-PF523XJX.js";
214
+ } from "./chunk-OE5J6UA7.js";
195
215
  import {
196
216
  init_esbuild_shims
197
217
  } from "./chunk-A4BMJM77.js";
@@ -238,7 +258,7 @@ var isBtwCommand = /* @__PURE__ */ __name((query) => {
238
258
  }, "isBtwCommand");
239
259
  var debugLogger = createDebugLogger("COMMAND_UTILS");
240
260
  var copyToClipboard = /* @__PURE__ */ __name(async (text) => {
241
- const run = /* @__PURE__ */ __name((cmd, args, options) => new Promise((resolve6, reject) => {
261
+ const run = /* @__PURE__ */ __name((cmd, args, options) => new Promise((resolve5, reject) => {
242
262
  const child = options ? spawn(cmd, args, options) : spawn(cmd, args);
243
263
  let stderr = "";
244
264
  if (child.stderr) {
@@ -246,7 +266,7 @@ var copyToClipboard = /* @__PURE__ */ __name(async (text) => {
246
266
  }
247
267
  child.on("error", reject);
248
268
  child.on("close", (code) => {
249
- if (code === 0) return resolve6();
269
+ if (code === 0) return resolve5();
250
270
  const errorMsg = stderr.trim();
251
271
  reject(
252
272
  new Error(
@@ -325,20 +345,26 @@ var getUrlOpenCommand = /* @__PURE__ */ __name(() => {
325
345
  }
326
346
  return openCmd;
327
347
  }, "getUrlOpenCommand");
348
+ function isMidInputCompletableCommand(cmd) {
349
+ return cmd.modelInvocable === true && !cmd.hidden;
350
+ }
351
+ __name(isMidInputCompletableCommand, "isMidInputCompletableCommand");
328
352
  function findMidInputSlashCommand(input, cursorOffset) {
329
353
  if (input.startsWith("/")) return null;
330
- const beforeCursor = input.slice(0, cursorOffset);
354
+ const codePoints = toCodePoints(input);
355
+ const beforeCursor = codePoints.slice(0, cursorOffset).join("");
331
356
  const match = beforeCursor.match(/\s\/([a-zA-Z0-9_:-]*)$/);
332
- if (!match || match.index === void 0) return null;
333
- const slashPos = match.index + 1;
334
- const textAfterSlash = input.slice(slashPos + 1);
357
+ if (!match) return null;
358
+ const partialCommand = match[1];
359
+ const slashPos = cursorOffset - 1 - partialCommand.length;
360
+ const textAfterSlash = codePoints.slice(slashPos + 1).join("");
335
361
  const commandMatch = textAfterSlash.match(/^[a-zA-Z0-9_:-]*/);
336
362
  const fullCommand = commandMatch ? commandMatch[0] : "";
337
363
  if (cursorOffset !== slashPos + 1 + fullCommand.length) return null;
338
364
  return {
339
365
  token: "/" + fullCommand,
340
366
  startPos: slashPos,
341
- partialCommand: input.slice(slashPos + 1, cursorOffset)
367
+ partialCommand
342
368
  };
343
369
  }
344
370
  __name(findMidInputSlashCommand, "findMidInputSlashCommand");
@@ -346,7 +372,7 @@ function getBestSlashCommandMatch(partialCommand, commands, recentCommands) {
346
372
  if (!partialCommand) return null;
347
373
  const query = partialCommand.toLowerCase();
348
374
  const matches = commands.filter((cmd) => {
349
- if (!cmd.modelInvocable) return false;
375
+ if (!isMidInputCompletableCommand(cmd)) return false;
350
376
  const name = cmd.name.toLowerCase();
351
377
  return name.startsWith(query) && (name !== query || !!cmd.argumentHint);
352
378
  }).sort((left, right) => {
@@ -2650,7 +2676,7 @@ init_esbuild_shims();
2650
2676
  // packages/cli/src/ui/hooks/useAutoAcceptIndicator.ts
2651
2677
  init_esbuild_shims();
2652
2678
  var import_react = __toESM(require_react(), 1);
2653
- var AUTO_MODE_FIRST_TIME_MESSAGE = "\u2728 Auto mode enabled.\n An LLM classifier evaluates each tool call and auto-approves safe actions,\n blocks risky ones. Most read-only operations and in-cwd edits skip the\n classifier for speed. To exit: Shift+Tab or /approval-mode default.\n (This notice will not appear again.)";
2679
+ var AUTO_MODE_FIRST_TIME_MESSAGE = "Auto mode enabled.\n An LLM classifier evaluates each tool call \u2014 safe actions auto-approve,\n risky ones are blocked. Exit: Shift+Tab or /approval-mode default.";
2654
2680
  function useAutoAcceptIndicator({
2655
2681
  config,
2656
2682
  settings,
@@ -2725,7 +2751,7 @@ function emitAutoModeEntryNotices(opts) {
2725
2751
  const stripped = pm?.getStrippedDangerousRules?.();
2726
2752
  if (stripped && (stripped.persistent.length > 0 || stripped.session.length > 0)) {
2727
2753
  const lines = [
2728
- "\u2139\uFE0F Auto mode temporarily disabled these allow rules",
2754
+ "\u2139 Auto mode temporarily disabled these allow rules",
2729
2755
  " (they would bypass the classifier):",
2730
2756
  ...stripped.persistent.map((r) => ` - ${r.raw} (from user settings)`),
2731
2757
  ...stripped.session.map((r) => ` - ${r.raw} (session)`),
@@ -3082,27 +3108,12 @@ ${info}
3082
3108
  // packages/cli/src/ui/commands/cdCommand.ts
3083
3109
  init_esbuild_shims();
3084
3110
  import * as fs3 from "node:fs/promises";
3085
- import * as os2 from "node:os";
3086
3111
  import * as path3 from "node:path";
3087
3112
 
3088
3113
  // packages/cli/src/ui/commands/directoryCommand.tsx
3089
3114
  init_esbuild_shims();
3090
3115
  import * as fs2 from "node:fs";
3091
- import * as os from "node:os";
3092
3116
  import * as path2 from "node:path";
3093
- function expandHomeDir(p) {
3094
- if (!p) {
3095
- return "";
3096
- }
3097
- let expandedPath = p;
3098
- if (p.toLowerCase().startsWith("%userprofile%")) {
3099
- expandedPath = os.homedir() + p.substring("%userprofile%".length);
3100
- } else if (p === "~" || p.startsWith("~/")) {
3101
- expandedPath = os.homedir() + p.substring(1);
3102
- }
3103
- return path2.normalize(expandedPath);
3104
- }
3105
- __name(expandHomeDir, "expandHomeDir");
3106
3117
  function findExistingWorkspaceDirectory(directory, existingDirectories) {
3107
3118
  if (existingDirectories.has(directory)) {
3108
3119
  return directory;
@@ -3132,8 +3143,9 @@ __name(getSingleDirPathCompletions, "getSingleDirPathCompletions");
3132
3143
  function getPathCompletions(prefix, partial) {
3133
3144
  const trimmed = partial.trim();
3134
3145
  if (!trimmed) return [];
3135
- const expanded = trimmed.startsWith("~") ? trimmed.replace(/^~/, os.homedir()) : trimmed;
3136
- const endsWithSep = expanded.endsWith("/") || expanded.endsWith(path2.sep);
3146
+ const inputEndsWithSep = trimmed.endsWith("/") || trimmed.endsWith("\\");
3147
+ const expanded = expandHomeDir(trimmed);
3148
+ const endsWithSep = inputEndsWithSep || expanded.endsWith("/") || expanded.endsWith(path2.sep);
3137
3149
  const searchDir = endsWithSep ? expanded : path2.dirname(expanded);
3138
3150
  const namePrefix = endsWithSep ? "" : path2.basename(expanded);
3139
3151
  try {
@@ -3255,7 +3267,13 @@ var directoryCommand = {
3255
3267
  }
3256
3268
  if (added.length > 0) {
3257
3269
  try {
3258
- if (config.shouldLoadMemoryFromIncludeDirectories()) {
3270
+ if (config.isSafeMode()) {
3271
+ messages.push(
3272
+ t(
3273
+ "Safe mode active \u2014 skipping memory reload from include directories."
3274
+ )
3275
+ );
3276
+ } else if (config.shouldLoadMemoryFromIncludeDirectories()) {
3259
3277
  const {
3260
3278
  memoryContent,
3261
3279
  fileCount,
@@ -3386,16 +3404,7 @@ function resolveCdPath(input, baseDir) {
3386
3404
  if (input.includes("\0") || baseDir.includes("\0")) {
3387
3405
  throw new Error("Path contains null bytes.");
3388
3406
  }
3389
- if (input === "~") {
3390
- return path3.normalize(os2.homedir());
3391
- }
3392
- if (input.startsWith("~/")) {
3393
- return path3.normalize(path3.join(os2.homedir(), input.slice(2)));
3394
- }
3395
- if (path3.isAbsolute(input)) {
3396
- return path3.normalize(input);
3397
- }
3398
- return path3.resolve(baseDir, input);
3407
+ return path3.normalize(resolvePath(baseDir, input));
3399
3408
  }
3400
3409
  __name(resolveCdPath, "resolveCdPath");
3401
3410
  var cdCommand = {
@@ -4386,7 +4395,7 @@ init_esbuild_shims();
4386
4395
  // packages/cli/src/utils/doctorChecks.ts
4387
4396
  init_esbuild_shims();
4388
4397
  import process4 from "node:process";
4389
- import os3 from "node:os";
4398
+ import os from "node:os";
4390
4399
  var MIN_NODE_MAJOR = 22;
4391
4400
  function checkNodeVersion() {
4392
4401
  const version = process4.version;
@@ -4435,7 +4444,7 @@ function checkPlatform() {
4435
4444
  category: t("System"),
4436
4445
  name: t("Platform"),
4437
4446
  status: "pass",
4438
- message: `${process4.platform}/${process4.arch} (${os3.release()})`
4447
+ message: `${process4.platform}/${process4.arch} (${os.release()})`
4439
4448
  };
4440
4449
  }
4441
4450
  __name(checkPlatform, "checkPlatform");
@@ -4735,7 +4744,7 @@ __name(runDoctorChecks, "runDoctorChecks");
4735
4744
  // packages/cli/src/utils/memoryDiagnostics.ts
4736
4745
  init_esbuild_shims();
4737
4746
  import * as fs4 from "node:fs";
4738
- import * as os4 from "node:os";
4747
+ import * as os2 from "node:os";
4739
4748
  import * as path4 from "node:path";
4740
4749
  import * as v8 from "node:v8";
4741
4750
  var HIGH_HEAP_PRESSURE_THRESHOLD = 0.85;
@@ -4792,7 +4801,7 @@ function getMemoryDiagnostics() {
4792
4801
  }
4793
4802
  __name(getMemoryDiagnostics, "getMemoryDiagnostics");
4794
4803
  function defaultHeapSnapshotDir() {
4795
- return path4.join(os4.homedir(), ".qwen", "memory-snapshots");
4804
+ return path4.join(os2.homedir(), ".qwen", "memory-snapshots");
4796
4805
  }
4797
4806
  __name(defaultHeapSnapshotDir, "defaultHeapSnapshotDir");
4798
4807
  function formatSnapshotTimestamp(now) {
@@ -4925,7 +4934,7 @@ function writeMemoryHeapSnapshot({
4925
4934
  }
4926
4935
  __name(writeMemoryHeapSnapshot, "writeMemoryHeapSnapshot");
4927
4936
  function defaultWait(ms) {
4928
- return new Promise((resolve6) => setTimeout(resolve6, ms));
4937
+ return new Promise((resolve5) => setTimeout(resolve5, ms));
4929
4938
  }
4930
4939
  __name(defaultWait, "defaultWait");
4931
4940
  function normalizeSampleCount(sampleCount) {
@@ -5135,7 +5144,7 @@ init_esbuild_shims();
5135
5144
  var import_undici = __toESM(require_undici(), 1);
5136
5145
  import { createHash } from "node:crypto";
5137
5146
  import * as fs5 from "node:fs";
5138
- import * as os5 from "node:os";
5147
+ import * as os3 from "node:os";
5139
5148
  import * as path5 from "node:path";
5140
5149
  import { Readable, Transform } from "node:stream";
5141
5150
  import { spawn as spawn2, execFile } from "node:child_process";
@@ -5338,7 +5347,7 @@ __name(isSafeTarEntryPath, "isSafeTarEntryPath");
5338
5347
  async function extractArchive(archivePath, destDir, target) {
5339
5348
  fs5.mkdirSync(destDir, { recursive: true });
5340
5349
  if (target.startsWith("win")) {
5341
- await new Promise((resolve6, reject) => {
5350
+ await new Promise((resolve5, reject) => {
5342
5351
  const ps = spawn2(
5343
5352
  "powershell.exe",
5344
5353
  [
@@ -5350,7 +5359,7 @@ async function extractArchive(archivePath, destDir, target) {
5350
5359
  );
5351
5360
  ps.on(
5352
5361
  "close",
5353
- (code) => code === 0 ? resolve6() : reject(new Error(`Expand-Archive exited with code ${code}`))
5362
+ (code) => code === 0 ? resolve5() : reject(new Error(`Expand-Archive exited with code ${code}`))
5354
5363
  );
5355
5364
  ps.on("error", reject);
5356
5365
  });
@@ -5382,7 +5391,7 @@ async function extractArchive(archivePath, destDir, target) {
5382
5391
  }
5383
5392
  __name(extractArchive, "extractArchive");
5384
5393
  function spawnAndCapture(command, args, timeoutMs) {
5385
- return new Promise((resolve6, reject) => {
5394
+ return new Promise((resolve5, reject) => {
5386
5395
  let settled = false;
5387
5396
  const child = execFile(
5388
5397
  command,
@@ -5397,10 +5406,10 @@ function spawnAndCapture(command, args, timeoutMs) {
5397
5406
  }
5398
5407
  if (err) {
5399
5408
  const exitCode = "code" in err && typeof err.code === "number" ? err.code : 1;
5400
- resolve6({ exitCode, stdout: out || "", stderr: stderr || "" });
5409
+ resolve5({ exitCode, stdout: out || "", stderr: stderr || "" });
5401
5410
  return;
5402
5411
  }
5403
- resolve6({ exitCode: 0, stdout: out || "", stderr: stderr || "" });
5412
+ resolve5({ exitCode: 0, stdout: out || "", stderr: stderr || "" });
5404
5413
  }
5405
5414
  );
5406
5415
  child.on("error", (e) => {
@@ -5503,7 +5512,7 @@ function atomicReplace(standaloneDir, newDir, lockPath) {
5503
5512
  if (fs5.existsSync(oldDir)) {
5504
5513
  fs5.rmSync(oldDir, { recursive: true, force: true });
5505
5514
  }
5506
- if (os5.platform() === "win32") {
5515
+ if (os3.platform() === "win32") {
5507
5516
  if (UNSAFE_CMD_CHARS.test(standaloneDir) || UNSAFE_CMD_CHARS.test(oldDir) || UNSAFE_CMD_CHARS.test(pendingDir)) {
5508
5517
  throw new Error(
5509
5518
  "Installation path contains characters unsafe for deferred update script"
@@ -5613,13 +5622,13 @@ function ensurePathInShellRc(binDir) {
5613
5622
  assertSafeForShellEmbed(binDir, "binDir");
5614
5623
  const shell = process.env["SHELL"] || "";
5615
5624
  let rcFile = null;
5616
- const home = process.env["HOME"] || os5.homedir();
5625
+ const home = process.env["HOME"] || os3.homedir();
5617
5626
  if (shell.endsWith("/zsh")) {
5618
5627
  rcFile = path5.join(home, ".zshrc");
5619
5628
  } else if (shell.endsWith("/bash")) {
5620
5629
  const bashrc = path5.join(home, ".bashrc");
5621
5630
  const profile = path5.join(home, ".bash_profile");
5622
- if (os5.platform() === "darwin") {
5631
+ if (os3.platform() === "darwin") {
5623
5632
  rcFile = fs5.existsSync(profile) ? profile : bashrc;
5624
5633
  } else {
5625
5634
  rcFile = bashrc;
@@ -5647,8 +5656,8 @@ export PATH="${binDir}:$PATH"
5647
5656
  }
5648
5657
  __name(ensurePathInShellRc, "ensurePathInShellRc");
5649
5658
  function detectTarget() {
5650
- const platform3 = os5.platform();
5651
- const arch2 = os5.arch();
5659
+ const platform3 = os3.platform();
5660
+ const arch2 = os3.arch();
5652
5661
  if (platform3 === "darwin") {
5653
5662
  return arch2 === "arm64" ? "darwin-arm64" : "darwin-x64";
5654
5663
  }
@@ -5688,7 +5697,7 @@ async function performStandaloneUpdate(standaloneDir, newVersion) {
5688
5697
  if (isFirstTimeMigration) {
5689
5698
  fs5.mkdirSync(standaloneDir, { recursive: true });
5690
5699
  }
5691
- const tempDir = fs5.mkdtempSync(path5.join(os5.tmpdir(), "qwen-code-update-"));
5700
+ const tempDir = fs5.mkdtempSync(path5.join(os3.tmpdir(), "qwen-code-update-"));
5692
5701
  let extractDir;
5693
5702
  let updateResult;
5694
5703
  try {
@@ -6491,14 +6500,14 @@ async function cpuProfileDoctorAction(context, args = "") {
6491
6500
  })
6492
6501
  });
6493
6502
  }
6494
- await new Promise((resolve6) => {
6495
- const timer = setTimeout(resolve6, durationSec * 1e3);
6503
+ await new Promise((resolve5) => {
6504
+ const timer = setTimeout(resolve5, durationSec * 1e3);
6496
6505
  if (abortSignal) {
6497
6506
  abortSignal.addEventListener(
6498
6507
  "abort",
6499
6508
  () => {
6500
6509
  clearTimeout(timer);
6501
- resolve6();
6510
+ resolve5();
6502
6511
  },
6503
6512
  { once: true }
6504
6513
  );
@@ -6788,7 +6797,7 @@ async function extractMetadata(conversation, config) {
6788
6797
  const gitBranch = firstRecord?.gitBranch;
6789
6798
  let gitRepo;
6790
6799
  if (cwd) {
6791
- const { getGitRepoName } = await import("./src-4F6FBZFI.js");
6800
+ const { getGitRepoName } = await import("./src-PNZYGM3R.js");
6792
6801
  gitRepo = getGitRepoName(cwd);
6793
6802
  }
6794
6803
  let model;
@@ -7382,10 +7391,10 @@ function formatToolCall(message) {
7382
7391
  lines.push(createCodeBlock(contentData.text, language));
7383
7392
  }
7384
7393
  } else if (item.type === "diff") {
7385
- const path21 = item["path"];
7394
+ const path20 = item["path"];
7386
7395
  const diffText = item["newText"];
7387
7396
  lines.push(`
7388
- *Diff for \`${sanitizeText(path21)}\`:*`);
7397
+ *Diff for \`${sanitizeText(path20)}\`:*`);
7389
7398
  lines.push(createCodeBlock(diffText, "diff"));
7390
7399
  }
7391
7400
  }
@@ -7422,8 +7431,8 @@ function buildFence(value) {
7422
7431
  return "`".repeat(fenceLength);
7423
7432
  }
7424
7433
  __name(buildFence, "buildFence");
7425
- function getLanguageFromPath(path21) {
7426
- const ext = path21.split(".").pop()?.toLowerCase();
7434
+ function getLanguageFromPath(path20) {
7435
+ const ext = path20.split(".").pop()?.toLowerCase();
7427
7436
  switch (ext) {
7428
7437
  case "ts":
7429
7438
  case "tsx":
@@ -9215,15 +9224,15 @@ function getIdeStatusMessage(ideClient) {
9215
9224
  case "connected" /* Connected */:
9216
9225
  return {
9217
9226
  messageType: "info",
9218
- content: `\u{1F7E2} Connected to ${ideClient.getDetectedIdeDisplayName()}`
9227
+ content: `\u2713 Connected to ${ideClient.getDetectedIdeDisplayName()}`
9219
9228
  };
9220
9229
  case "connecting" /* Connecting */:
9221
9230
  return {
9222
9231
  messageType: "info",
9223
- content: `\u{1F7E1} Connecting...`
9232
+ content: `\u25D0 Connecting...`
9224
9233
  };
9225
9234
  default: {
9226
- let content = `\u{1F534} Disconnected`;
9235
+ let content = `\u2717 Disconnected`;
9227
9236
  if (connection?.details) {
9228
9237
  content += `: ${connection.details}`;
9229
9238
  }
@@ -9261,7 +9270,7 @@ async function getIdeStatusMessageWithFiles(ideClient) {
9261
9270
  const connection = ideClient.getConnectionStatus();
9262
9271
  switch (connection.status) {
9263
9272
  case "connected" /* Connected */: {
9264
- let content = `\u{1F7E2} Connected to ${ideClient.getDetectedIdeDisplayName()}`;
9273
+ let content = `\u2713 Connected to ${ideClient.getDetectedIdeDisplayName()}`;
9265
9274
  const context = ideContextStore.get();
9266
9275
  const openFiles = context?.workspaceState?.openFiles;
9267
9276
  if (openFiles && openFiles.length > 0) {
@@ -9275,10 +9284,10 @@ async function getIdeStatusMessageWithFiles(ideClient) {
9275
9284
  case "connecting" /* Connecting */:
9276
9285
  return {
9277
9286
  messageType: "info",
9278
- content: `\u{1F7E1} Connecting...`
9287
+ content: `\u25D0 Connecting...`
9279
9288
  };
9280
9289
  default: {
9281
- let content = `\u{1F534} Disconnected`;
9290
+ let content = `\u2717 Disconnected`;
9282
9291
  if (connection?.details) {
9283
9292
  content += `: ${connection.details}`;
9284
9293
  }
@@ -9406,7 +9415,7 @@ var ideCommand = /* @__PURE__ */ __name(async () => {
9406
9415
  if (ideClient.getConnectionStatus().status === "connected" /* Connected */) {
9407
9416
  break;
9408
9417
  }
9409
- await new Promise((resolve6) => setTimeout(resolve6, 500));
9418
+ await new Promise((resolve5) => setTimeout(resolve5, 500));
9410
9419
  }
9411
9420
  const { messageType, content } = getIdeStatusMessage(ideClient);
9412
9421
  if (messageType === "error") {
@@ -9497,7 +9506,7 @@ init_esbuild_shims();
9497
9506
  // packages/cli/src/config/claudeMcpImport.ts
9498
9507
  init_esbuild_shims();
9499
9508
  import * as fs8 from "node:fs";
9500
- import * as os6 from "node:os";
9509
+ import * as os4 from "node:os";
9501
9510
  import * as path9 from "node:path";
9502
9511
  var import_strip_json_comments = __toESM(require_strip_json_comments(), 1);
9503
9512
  function isRecord(value) {
@@ -9584,11 +9593,11 @@ function getClaudeProjectSettings(projects, cwd) {
9584
9593
  return void 0;
9585
9594
  }
9586
9595
  __name(getClaudeProjectSettings, "getClaudeProjectSettings");
9587
- function getClaudeCodeConfigPath(homeDir = os6.homedir()) {
9596
+ function getClaudeCodeConfigPath(homeDir = os4.homedir()) {
9588
9597
  return path9.join(homeDir, ".claude.json");
9589
9598
  }
9590
9599
  __name(getClaudeCodeConfigPath, "getClaudeCodeConfigPath");
9591
- function getClaudeDesktopConfigPath(homeDir = os6.homedir(), platform3 = process.platform, env = process.env) {
9600
+ function getClaudeDesktopConfigPath(homeDir = os4.homedir(), platform3 = process.platform, env = process.env) {
9592
9601
  if (platform3 === "win32") {
9593
9602
  const appData = env["APPDATA"] ?? path9.win32.join(homeDir, "AppData", "Roaming");
9594
9603
  return path9.win32.join(appData, "Claude", "claude_desktop_config.json");
@@ -9754,7 +9763,7 @@ function loadClaudeDesktopMcpServers(homeDir, platform3, env) {
9754
9763
  }
9755
9764
  __name(loadClaudeDesktopMcpServers, "loadClaudeDesktopMcpServers");
9756
9765
  function loadClaudeMcpSources(options) {
9757
- const homeDir = options.homeDir ?? os6.homedir();
9766
+ const homeDir = options.homeDir ?? os4.homedir();
9758
9767
  const cwd = options.cwd ?? process.cwd();
9759
9768
  const platform3 = options.platform ?? process.platform;
9760
9769
  const env = options.env ?? process.env;
@@ -10629,10 +10638,16 @@ var memoryCommand = {
10629
10638
 
10630
10639
  // packages/cli/src/ui/commands/modelCommand.ts
10631
10640
  init_esbuild_shims();
10641
+
10642
+ // packages/cli/src/ui/voice/voice-model.ts
10643
+ init_esbuild_shims();
10644
+
10645
+ // packages/cli/src/ui/commands/modelCommand.ts
10632
10646
  var MAIN_MODEL_CONFIGURATION_HINT = "Configure models in settings.modelProviders and ensure the required environment variables are set. In interactive mode, run /auth to configure or switch providers, or run /model without arguments to choose from configured models.";
10633
10647
  var FAST_MODEL_CONFIGURATION_HINT = "Configure models in settings.modelProviders and ensure the required environment variables are set. In interactive mode, run /auth to configure or switch providers, or run /model --fast without a model to choose from configured models.";
10634
- function persistSetting(settings, path21, value) {
10635
- settings.setValue(getPersistScopeForModelSelection(settings), path21, value);
10648
+ var VISION_MODEL_CONFIGURATION_HINT = "Configure an image-capable model in settings.modelProviders and ensure the required environment variables are set. Run /model --vision <model-id> to set it, or leave it unset to auto-pick a same-provider vision model.";
10649
+ function persistSetting(settings, path20, value) {
10650
+ settings.setValue(getPersistScopeForModelSelection(settings), path20, value);
10636
10651
  }
10637
10652
  __name(persistSetting, "persistSetting");
10638
10653
  async function switchMainModel(config, settings, currentAuthType, modelArg) {
@@ -10659,21 +10674,47 @@ function formatUnavailableModelMessage(kind, modelName, authType, availableModel
10659
10674
  new Set(availableModels.map((model) => model.id))
10660
10675
  );
10661
10676
  const availableModelsLine = availableModelIds.length === 0 ? `No models are configured for auth type '${authType}'.` : `Available models for '${authType}': ${availableModelIds.join(", ")}.`;
10677
+ const hint = kind === "Fast model" ? FAST_MODEL_CONFIGURATION_HINT : kind === "Vision model" ? VISION_MODEL_CONFIGURATION_HINT : MAIN_MODEL_CONFIGURATION_HINT;
10662
10678
  return `${kind} '${modelName}' is not available for auth type '${authType}'.
10663
10679
  ${availableModelsLine}
10664
- ` + (kind === "Fast model" ? FAST_MODEL_CONFIGURATION_HINT : MAIN_MODEL_CONFIGURATION_HINT);
10680
+ ` + hint;
10665
10681
  }
10666
10682
  __name(formatUnavailableModelMessage, "formatUnavailableModelMessage");
10667
- function formatUnavailableFastModelMessage(modelName, availableModels) {
10683
+ function formatUnavailableAuxModelMessage(label, modelName, availableModels, hint) {
10668
10684
  const availableModelIds = Array.from(
10669
10685
  new Set(availableModels.map((model) => model.id))
10670
10686
  );
10671
10687
  const availableModelsLine = availableModelIds.length === 0 ? "No models are configured." : `Configured models: ${availableModelIds.join(", ")}.`;
10672
- return `Fast model '${modelName}' is not configured for any auth type.
10688
+ return `${label} '${modelName}' is not configured for any auth type.
10673
10689
  ${availableModelsLine}
10674
- ` + FAST_MODEL_CONFIGURATION_HINT;
10690
+ ` + hint;
10691
+ }
10692
+ __name(formatUnavailableAuxModelMessage, "formatUnavailableAuxModelMessage");
10693
+ function formatUnavailableFastModelMessage(modelName, availableModels) {
10694
+ return formatUnavailableAuxModelMessage(
10695
+ "Fast model",
10696
+ modelName,
10697
+ availableModels,
10698
+ FAST_MODEL_CONFIGURATION_HINT
10699
+ );
10675
10700
  }
10676
10701
  __name(formatUnavailableFastModelMessage, "formatUnavailableFastModelMessage");
10702
+ function formatUnavailableVisionModelMessage(modelName, availableModels) {
10703
+ return formatUnavailableAuxModelMessage(
10704
+ "Vision model",
10705
+ modelName,
10706
+ availableModels,
10707
+ VISION_MODEL_CONFIGURATION_HINT
10708
+ );
10709
+ }
10710
+ __name(formatUnavailableVisionModelMessage, "formatUnavailableVisionModelMessage");
10711
+ function formatNonVisionModelWarning(modelName) {
10712
+ return t(
10713
+ "\u26A0 '{{model}}' is not a known image-capable model; the vision bridge may fail on images.",
10714
+ { model: modelName }
10715
+ );
10716
+ }
10717
+ __name(formatNonVisionModelWarning, "formatNonVisionModelWarning");
10677
10718
  function formatUnavailableVoiceModelMessage(modelName, availableModels) {
10678
10719
  const availableModelIds = Array.from(
10679
10720
  new Set(availableModels.map((model) => model.id))
@@ -10707,10 +10748,10 @@ var modelCommand = {
10707
10748
  completionPriority: 100,
10708
10749
  get description() {
10709
10750
  return t(
10710
- "Switch the model for this session (--fast for suggestion model, --voice for voice transcription model, [model-id] to switch immediately)."
10751
+ "Switch the model for this session (--fast for suggestion model, --voice for voice transcription model, --vision for the vision bridge model, [model-id] to switch immediately, or [model-id] [prompt] to run a one-off prompt on another model; the inline prompt is sent verbatim without @file expansion)."
10711
10752
  );
10712
10753
  },
10713
- argumentHint: "[--fast|--voice] [<model-id>]",
10754
+ argumentHint: "[--fast|--voice|--vision] [<model-id>] | <model-id> <prompt>",
10714
10755
  kind: "built-in" /* BUILT_IN */,
10715
10756
  supportedModes: ["interactive", "non_interactive", "acp"],
10716
10757
  completion: /* @__PURE__ */ __name(async (context, partialArg) => {
@@ -10725,6 +10766,12 @@ var modelCommand = {
10725
10766
  {
10726
10767
  value: "--voice",
10727
10768
  description: t("Set the model for voice transcription")
10769
+ },
10770
+ {
10771
+ value: "--vision",
10772
+ description: t(
10773
+ "Set the image-capable model used to transcribe images for a text-only main model"
10774
+ )
10728
10775
  }
10729
10776
  ].filter((item) => item.value.startsWith(partialArg));
10730
10777
  if (flagCompletions.length > 0) {
@@ -10740,6 +10787,9 @@ var modelCommand = {
10740
10787
  } else if (trimmed.startsWith("--voice ")) {
10741
10788
  mode = "voice";
10742
10789
  modelPrefix = trimmed.slice("--voice ".length);
10790
+ } else if (trimmed.startsWith("--vision ")) {
10791
+ mode = "vision";
10792
+ modelPrefix = trimmed.slice("--vision ".length);
10743
10793
  }
10744
10794
  return getAvailableModelIds(context, mode).filter(
10745
10795
  (id) => id.startsWith(modelPrefix)
@@ -10893,6 +10943,83 @@ Use "/model --fast <model-id>" to set fast model.`
10893
10943
  content: t("Fast Model") + ": " + modelName2
10894
10944
  };
10895
10945
  }
10946
+ const isVisionModelCommand = args === "--vision" || args.startsWith("--vision ");
10947
+ if (isVisionModelCommand) {
10948
+ const modelName2 = args.replace("--vision", "").trim();
10949
+ if (!modelName2) {
10950
+ if (context.executionMode !== "interactive") {
10951
+ const visionModel = context.services.settings?.merged?.visionModel?.trim() || t("not set");
10952
+ return {
10953
+ type: "message",
10954
+ messageType: "info",
10955
+ content: t(
10956
+ 'Current vision model: {{visionModel}}\nUse "/model --vision <model-id>" to set the vision bridge model.',
10957
+ { visionModel }
10958
+ )
10959
+ };
10960
+ }
10961
+ return {
10962
+ type: "dialog",
10963
+ dialog: "vision-model"
10964
+ };
10965
+ }
10966
+ if (!settings) {
10967
+ return {
10968
+ type: "message",
10969
+ messageType: "error",
10970
+ content: t("Settings service not available.")
10971
+ };
10972
+ }
10973
+ const selector = (() => {
10974
+ try {
10975
+ return resolveModelId(modelName2);
10976
+ } catch {
10977
+ return void 0;
10978
+ }
10979
+ })();
10980
+ if (!selector) {
10981
+ return {
10982
+ type: "message",
10983
+ messageType: "error",
10984
+ content: formatUnavailableVisionModelMessage(modelName2, [])
10985
+ };
10986
+ }
10987
+ const availableModels = (selector.authType ? config.getAvailableModelsForAuthType(selector.authType) : config.getAllConfiguredModels()).filter((m) => !m.fastOnly && !m.voiceOnly);
10988
+ const matched = availableModels.find(
10989
+ (model) => model.id === selector.modelId
10990
+ );
10991
+ if (!matched) {
10992
+ return {
10993
+ type: "message",
10994
+ messageType: "error",
10995
+ content: selector.authType ? formatUnavailableModelMessage(
10996
+ "Vision model",
10997
+ selector.modelId,
10998
+ selector.authType,
10999
+ availableModels
11000
+ ) : formatUnavailableVisionModelMessage(modelName2, availableModels)
11001
+ };
11002
+ }
11003
+ if (config.isCurrentPrimaryModel(matched)) {
11004
+ return {
11005
+ type: "message",
11006
+ messageType: "error",
11007
+ content: t(
11008
+ "'{{model}}' is the current primary model and cannot be used as the vision bridge. Choose a different image-capable model.",
11009
+ { model: modelName2 }
11010
+ )
11011
+ };
11012
+ }
11013
+ persistSetting(settings, "visionModel", modelName2);
11014
+ config.setVisionModel(modelName2);
11015
+ const visionWarning = isImageCapable(matched) ? "" : `
11016
+ ${formatNonVisionModelWarning(modelName2)}`;
11017
+ return {
11018
+ type: "message",
11019
+ messageType: "info",
11020
+ content: t("Vision Model") + ": " + modelName2 + visionWarning
11021
+ };
11022
+ }
10896
11023
  const contentGeneratorConfig = config.getContentGeneratorConfig();
10897
11024
  if (!contentGeneratorConfig) {
10898
11025
  return {
@@ -10909,15 +11036,11 @@ Use "/model --fast <model-id>" to set fast model.`
10909
11036
  content: t("Authentication type not available.")
10910
11037
  };
10911
11038
  }
10912
- const modelName = args.trim().split(/\s+/)[0] ?? "";
11039
+ const trimmedArgs = args.trim();
11040
+ const firstSpace = trimmedArgs.search(/\s/);
11041
+ const modelName = firstSpace === -1 ? trimmedArgs : trimmedArgs.slice(0, firstSpace);
11042
+ const inlinePrompt = firstSpace === -1 ? "" : trimmedArgs.slice(firstSpace + 1).trim();
10913
11043
  if (modelName) {
10914
- if (!settings) {
10915
- return {
10916
- type: "message",
10917
- messageType: "error",
10918
- content: t("Settings service not available.")
10919
- };
10920
- }
10921
11044
  const parsed = parseAcpModelOption(modelName);
10922
11045
  const targetAuthType = parsed.authType ?? authType;
10923
11046
  const availableModels = config.getAvailableModelsForAuthType(targetAuthType).filter((m) => !m.fastOnly && !m.voiceOnly);
@@ -10933,6 +11056,41 @@ Use "/model --fast <model-id>" to set fast model.`
10933
11056
  )
10934
11057
  };
10935
11058
  }
11059
+ if (inlinePrompt) {
11060
+ if (context.executionMode === "acp") {
11061
+ return {
11062
+ type: "message",
11063
+ messageType: "error",
11064
+ content: t(
11065
+ "Inline one-shot override isn't supported in this mode \u2014 run '/model {{model}}' first, then send your prompt.",
11066
+ { model: modelName }
11067
+ )
11068
+ };
11069
+ }
11070
+ const sameAuthType = targetAuthType === authType;
11071
+ if (!sameAuthType || !isInlineModelOverrideAllowed(config, parsed.modelId)) {
11072
+ return {
11073
+ type: "message",
11074
+ messageType: "error",
11075
+ content: t(
11076
+ "Inline one-shot override can't switch providers. '{{model}}' belongs to a different provider \u2014 run '/model {{model}}' first, then send your prompt.",
11077
+ { model: modelName }
11078
+ )
11079
+ };
11080
+ }
11081
+ return {
11082
+ type: "submit_prompt",
11083
+ content: inlinePrompt,
11084
+ modelOverride: parsed.modelId
11085
+ };
11086
+ }
11087
+ if (!settings) {
11088
+ return {
11089
+ type: "message",
11090
+ messageType: "error",
11091
+ content: t("Settings service not available.")
11092
+ };
11093
+ }
10936
11094
  const effectiveModelName = await switchMainModel(
10937
11095
  config,
10938
11096
  settings,
@@ -10988,7 +11146,7 @@ var rememberCommand = {
10988
11146
  content: t("Config not loaded.")
10989
11147
  };
10990
11148
  }
10991
- const useManagedMemory = config?.getManagedAutoMemoryEnabled() ?? false;
11149
+ const useManagedMemory = config?.isManagedMemoryAvailable() ?? false;
10992
11150
  if (useManagedMemory) {
10993
11151
  const projectDir = config ? getAutoMemoryRoot(config.getProjectRoot()) : void 0;
10994
11152
  const userDir = getUserAutoMemoryRoot();
@@ -11711,6 +11869,12 @@ import * as fs11 from "node:fs/promises";
11711
11869
  import { randomUUID as randomUUID2 } from "node:crypto";
11712
11870
  import path13 from "node:path";
11713
11871
  var VALID_EXPORT_FORMATS = /* @__PURE__ */ new Set(["csv", "json"]);
11872
+ var EMPTY_SKILL_METRICS = {
11873
+ totalCalls: 0,
11874
+ totalSuccess: 0,
11875
+ totalFail: 0,
11876
+ byName: {}
11877
+ };
11714
11878
  function formatInteger(value) {
11715
11879
  return new Intl.NumberFormat(getCurrentLanguage()).format(value);
11716
11880
  }
@@ -11732,6 +11896,32 @@ function formatGroupLines(titleKey, groups) {
11732
11896
  ];
11733
11897
  }
11734
11898
  __name(formatGroupLines, "formatGroupLines");
11899
+ function formatSkillStats(skills) {
11900
+ const skillNames = Object.keys(skills.byName).sort((a, b) => {
11901
+ const countDelta = skills.byName[b].count - skills.byName[a].count;
11902
+ return countDelta !== 0 ? countDelta : a.localeCompare(b);
11903
+ });
11904
+ if (skillNames.length === 0) {
11905
+ return t("No skill usage data yet.");
11906
+ }
11907
+ return [
11908
+ t("Skill calls: {{total}} ({{success}} ok, {{fail}} fail)", {
11909
+ total: String(skills.totalCalls),
11910
+ success: String(skills.totalSuccess),
11911
+ fail: String(skills.totalFail)
11912
+ }),
11913
+ ...skillNames.map((name) => {
11914
+ const stats = skills.byName[name];
11915
+ return t(" {{name}}: {{count}} ({{success}} ok, {{fail}} fail)", {
11916
+ name,
11917
+ count: String(stats.count),
11918
+ success: String(stats.success),
11919
+ fail: String(stats.fail)
11920
+ });
11921
+ })
11922
+ ].join("\n");
11923
+ }
11924
+ __name(formatSkillStats, "formatSkillStats");
11735
11925
  function formatTokenUsageSummary(summary) {
11736
11926
  const label = summary.period === "day" ? t("Daily token usage for {{value}}", { value: summary.value }) : t("Monthly token usage for {{value}}", { value: summary.value });
11737
11927
  return [
@@ -12205,7 +12395,7 @@ var statsCommand = {
12205
12395
  get description() {
12206
12396
  return t("Show usage statistics dashboard.");
12207
12397
  },
12208
- argumentHint: "[model|tools|daily|monthly|export]",
12398
+ argumentHint: "[model|tools|skills|daily|monthly|export]",
12209
12399
  kind: "built-in" /* BUILT_IN */,
12210
12400
  supportedModes: ["interactive", "non_interactive", "acp"],
12211
12401
  action: /* @__PURE__ */ __name((context) => {
@@ -12325,6 +12515,30 @@ var statsCommand = {
12325
12515
  );
12326
12516
  }, "action")
12327
12517
  },
12518
+ {
12519
+ name: "skills",
12520
+ get description() {
12521
+ return t("Show skill-specific usage statistics.");
12522
+ },
12523
+ kind: "built-in" /* BUILT_IN */,
12524
+ supportedModes: ["interactive", "non_interactive", "acp"],
12525
+ action: /* @__PURE__ */ __name((context) => {
12526
+ if (context.executionMode !== "interactive") {
12527
+ const skills = context.session.stats.metrics.skills ?? EMPTY_SKILL_METRICS;
12528
+ return {
12529
+ type: "message",
12530
+ messageType: "info",
12531
+ content: formatSkillStats(skills)
12532
+ };
12533
+ }
12534
+ context.ui.addItem(
12535
+ {
12536
+ type: "skill_stats" /* SKILL_STATS */
12537
+ },
12538
+ Date.now()
12539
+ );
12540
+ }, "action")
12541
+ },
12328
12542
  {
12329
12543
  name: "daily",
12330
12544
  altNames: ["day"],
@@ -12527,7 +12741,7 @@ var summaryCommand = {
12527
12741
  ui.addItem(
12528
12742
  {
12529
12743
  type: "error",
12530
- text: `\u274C ${formatErrorMessage3(error)}`
12744
+ text: `\u2717 ${formatErrorMessage3(error)}`
12531
12745
  },
12532
12746
  Date.now()
12533
12747
  );
@@ -12628,7 +12842,7 @@ init_esbuild_shims();
12628
12842
  // packages/cli/src/ui/utils/terminalSetup.ts
12629
12843
  init_esbuild_shims();
12630
12844
  import { promises as fs12 } from "node:fs";
12631
- import * as os7 from "node:os";
12845
+ import * as os5 from "node:os";
12632
12846
  import * as path15 from "node:path";
12633
12847
  import { exec } from "node:child_process";
12634
12848
  import { promisify } from "node:util";
@@ -12652,7 +12866,7 @@ async function detectTerminal() {
12652
12866
  if (termProgram === "vscode" || process.env["VSCODE_GIT_IPC_HANDLE"]) {
12653
12867
  return "vscode";
12654
12868
  }
12655
- if (os7.platform() !== "win32") {
12869
+ if (os5.platform() !== "win32") {
12656
12870
  try {
12657
12871
  const { stdout } = await execAsync("ps -o comm= -p $PPID");
12658
12872
  const parentName = stdout.trim();
@@ -12682,10 +12896,10 @@ async function backupFile(filePath) {
12682
12896
  }
12683
12897
  __name(backupFile, "backupFile");
12684
12898
  function getVSCodeStyleConfigDir(appName) {
12685
- const platform3 = os7.platform();
12899
+ const platform3 = os5.platform();
12686
12900
  if (platform3 === "darwin") {
12687
12901
  return path15.join(
12688
- os7.homedir(),
12902
+ os5.homedir(),
12689
12903
  "Library",
12690
12904
  "Application Support",
12691
12905
  appName,
@@ -12697,7 +12911,7 @@ function getVSCodeStyleConfigDir(appName) {
12697
12911
  }
12698
12912
  return path15.join(process.env["APPDATA"], appName, "User");
12699
12913
  } else {
12700
- return path15.join(os7.homedir(), ".config", appName, "User");
12914
+ return path15.join(os5.homedir(), ".config", appName, "User");
12701
12915
  }
12702
12916
  }
12703
12917
  __name(getVSCodeStyleConfigDir, "getVSCodeStyleConfigDir");
@@ -13018,27 +13232,6 @@ function getVoiceUnavailableReason(environment = {
13018
13232
  __name(getVoiceUnavailableReason, "getVoiceUnavailableReason");
13019
13233
 
13020
13234
  // packages/cli/src/ui/commands/voice-command.ts
13021
- function getVoiceModel(settings) {
13022
- const value = settings.merged?.voiceModel;
13023
- if (typeof value !== "string") {
13024
- return void 0;
13025
- }
13026
- const trimmed = value.trim();
13027
- return trimmed.length > 0 ? trimmed : void 0;
13028
- }
13029
- __name(getVoiceModel, "getVoiceModel");
13030
- function isVoiceEnabled(settings) {
13031
- return settings.merged?.general?.voice?.enabled === true;
13032
- }
13033
- __name(isVoiceEnabled, "isVoiceEnabled");
13034
- function getVoiceMode(settings) {
13035
- return settings.merged?.general?.voice?.mode === "tap" ? "tap" : "hold";
13036
- }
13037
- __name(getVoiceMode, "getVoiceMode");
13038
- function getVoiceScope(settings) {
13039
- return settings.isTrusted === true && typeof settings.workspace?.settings?.general?.voice?.enabled === "boolean" ? "Workspace" /* Workspace */ : "User" /* User */;
13040
- }
13041
- __name(getVoiceScope, "getVoiceScope");
13042
13235
  var voiceCommand = {
13043
13236
  name: "voice",
13044
13237
  get description() {
@@ -13051,7 +13244,7 @@ var voiceCommand = {
13051
13244
  const settings = context.services.settings;
13052
13245
  const command = args.trim().toLowerCase();
13053
13246
  if (command === "status") {
13054
- const voiceModel2 = getVoiceModel(settings);
13247
+ const voiceModel2 = readVoiceModel(settings);
13055
13248
  const status = isVoiceEnabled(settings) ? "enabled" : "disabled";
13056
13249
  const modelText = voiceModel2 ? t("model: {{voiceModel}}", { voiceModel: voiceModel2 }) : t("no voice model selected");
13057
13250
  return {
@@ -13061,7 +13254,7 @@ var voiceCommand = {
13061
13254
  "Voice dictation: {{status}} (mode: {{mode}}, {{modelText}}).",
13062
13255
  {
13063
13256
  status,
13064
- mode: getVoiceMode(settings),
13257
+ mode: readVoiceMode(settings),
13065
13258
  modelText
13066
13259
  }
13067
13260
  )
@@ -13069,7 +13262,7 @@ var voiceCommand = {
13069
13262
  }
13070
13263
  if (command === "off") {
13071
13264
  settings.setValue(
13072
- getVoiceScope(settings),
13265
+ getVoiceSettingsScope(settings),
13073
13266
  "general.voice.enabled",
13074
13267
  false
13075
13268
  );
@@ -13088,7 +13281,7 @@ var voiceCommand = {
13088
13281
  }
13089
13282
  if (command === "" && isVoiceEnabled(settings)) {
13090
13283
  settings.setValue(
13091
- getVoiceScope(settings),
13284
+ getVoiceSettingsScope(settings),
13092
13285
  "general.voice.enabled",
13093
13286
  false
13094
13287
  );
@@ -13098,7 +13291,7 @@ var voiceCommand = {
13098
13291
  content: t("Voice dictation disabled.")
13099
13292
  };
13100
13293
  }
13101
- const voiceModel = getVoiceModel(settings);
13294
+ const voiceModel = readVoiceModel(settings);
13102
13295
  if (!voiceModel) {
13103
13296
  return {
13104
13297
  type: "message",
@@ -13116,8 +13309,8 @@ var voiceCommand = {
13116
13309
  content: unavailableReason
13117
13310
  };
13118
13311
  }
13119
- const scope = getVoiceScope(settings);
13120
- const mode = command === "tap" ? "tap" : command === "hold" ? "hold" : getVoiceMode(settings);
13312
+ const scope = getVoiceSettingsScope(settings);
13313
+ const mode = command === "tap" ? "tap" : command === "hold" ? "hold" : readVoiceMode(settings);
13121
13314
  settings.setValue(scope, "general.voice.mode", mode);
13122
13315
  settings.setValue(scope, "general.voice.enabled", true);
13123
13316
  return {
@@ -13136,172 +13329,14 @@ var voiceCommand = {
13136
13329
 
13137
13330
  // packages/cli/src/ui/commands/setupGithubCommand.ts
13138
13331
  init_esbuild_shims();
13139
- var import_undici3 = __toESM(require_undici(), 1);
13140
- import path16 from "node:path";
13141
- import * as fs13 from "node:fs";
13142
- import { Writable } from "node:stream";
13143
-
13144
- // packages/cli/src/utils/gitUtils.ts
13145
- init_esbuild_shims();
13146
- var import_undici2 = __toESM(require_undici(), 1);
13147
- import { execSync as execSync2 } from "node:child_process";
13148
- var debugLogger13 = createDebugLogger("GIT");
13149
- var isGitHubRepository = /* @__PURE__ */ __name(() => {
13150
- try {
13151
- const remotes = (execSync2("git remote -v", {
13152
- encoding: "utf-8"
13153
- }) || "").trim();
13154
- return remotes.split("\n").some((line) => {
13155
- const remoteUrl = line.trim().split(/\s+/)[1];
13156
- return remoteUrl ? isGitHubRemoteUrl(remoteUrl) : false;
13157
- });
13158
- } catch (_error) {
13159
- debugLogger13.debug(`Failed to get git remote:`, _error);
13160
- return false;
13161
- }
13162
- }, "isGitHubRepository");
13163
- function isGitHubRemoteUrl(remoteUrl) {
13164
- if (remoteUrl.startsWith("git@github.com:")) {
13165
- return true;
13166
- }
13167
- if (remoteUrl.startsWith("git@")) {
13168
- return false;
13169
- }
13170
- try {
13171
- return new URL(remoteUrl).hostname === "github.com";
13172
- } catch {
13173
- return false;
13174
- }
13175
- }
13176
- __name(isGitHubRemoteUrl, "isGitHubRemoteUrl");
13177
- var getGitRepoRoot = /* @__PURE__ */ __name(() => {
13178
- const gitRepoRoot = (execSync2("git rev-parse --show-toplevel", {
13179
- encoding: "utf-8"
13180
- }) || "").trim();
13181
- if (!gitRepoRoot) {
13182
- throw new Error(`Git repo returned empty value`);
13183
- }
13184
- return gitRepoRoot;
13185
- }, "getGitRepoRoot");
13186
- var getLatestGitHubRelease = /* @__PURE__ */ __name(async (proxy) => {
13187
- try {
13188
- const controller = new AbortController();
13189
- const endpoint = `https://api.github.com/repos/QwenLM/qwen-code-action/releases/latest`;
13190
- const response = await fetch(endpoint, {
13191
- method: "GET",
13192
- headers: {
13193
- Accept: "application/vnd.github+json",
13194
- "Content-Type": "application/json",
13195
- "X-GitHub-Api-Version": "2022-11-28"
13196
- },
13197
- dispatcher: proxy ? new import_undici2.ProxyAgent(proxy) : void 0,
13198
- signal: AbortSignal.any([AbortSignal.timeout(3e4), controller.signal])
13199
- });
13200
- if (!response.ok) {
13201
- throw new Error(
13202
- `Invalid response code: ${response.status} - ${response.statusText}`
13203
- );
13204
- }
13205
- const releaseTag = (await response.json()).tag_name;
13206
- if (!releaseTag) {
13207
- throw new Error(`Response did not include tag_name field`);
13208
- }
13209
- return releaseTag;
13210
- } catch (_error) {
13211
- debugLogger13.debug(
13212
- `Failed to determine latest qwen-code-action release:`,
13213
- _error
13214
- );
13215
- throw new Error(
13216
- `Unable to determine the latest qwen-code-action release on GitHub.`
13217
- );
13218
- }
13219
- }, "getLatestGitHubRelease");
13220
- function getGitHubRepoInfo() {
13221
- const remoteUrl = execSync2("git remote get-url origin", {
13222
- encoding: "utf-8"
13223
- }).trim();
13224
- let urlToParse = remoteUrl;
13225
- if (remoteUrl.startsWith("git@github.com:")) {
13226
- urlToParse = remoteUrl.replace("git@github.com:", "");
13227
- } else if (remoteUrl.startsWith("git@")) {
13228
- throw new Error(
13229
- `Owner & repo could not be extracted from remote URL: ${remoteUrl}`
13230
- );
13231
- }
13232
- let parsedUrl;
13233
- try {
13234
- parsedUrl = new URL(urlToParse, "https://github.com");
13235
- } catch {
13236
- throw new Error(
13237
- `Owner & repo could not be extracted from remote URL: ${remoteUrl}`
13238
- );
13239
- }
13240
- if (parsedUrl.hostname !== "github.com") {
13241
- throw new Error(
13242
- `Owner & repo could not be extracted from remote URL: ${remoteUrl}`
13243
- );
13244
- }
13245
- const parts = parsedUrl.pathname.split("/").filter((part) => part !== "");
13246
- if (parts.length !== 2 || !parts[0] || !parts[1]) {
13247
- throw new Error(
13248
- `Owner & repo could not be extracted from remote URL: ${remoteUrl}`
13249
- );
13250
- }
13251
- return { owner: parts[0], repo: parts[1].replace(/\.git$/, "") };
13252
- }
13253
- __name(getGitHubRepoInfo, "getGitHubRepoInfo");
13254
-
13255
- // packages/cli/src/ui/commands/setupGithubCommand.ts
13256
- var debugLogger14 = createDebugLogger("SETUP_GITHUB");
13257
- var GITHUB_WORKFLOW_PATHS = [
13258
- "qwen-dispatch/qwen-dispatch.yml",
13259
- "qwen-assistant/qwen-invoke.yml",
13260
- "issue-triage/qwen-triage.yml",
13261
- "issue-triage/qwen-scheduled-triage.yml",
13262
- "pr-review/qwen-review.yml"
13263
- ];
13264
- function getOpenUrlsCommands(readmeUrl) {
13332
+ function getOpenUrlsCommands(readmeUrl, secretsUrl) {
13265
13333
  const openCmd = getUrlOpenCommand();
13266
13334
  const urlsToOpen = [readmeUrl];
13267
- const repoInfo = getGitHubRepoInfo();
13268
- if (repoInfo) {
13269
- urlsToOpen.push(
13270
- `https://github.com/${repoInfo.owner}/${repoInfo.repo}/settings/secrets/actions`
13271
- );
13272
- }
13335
+ if (secretsUrl) urlsToOpen.push(secretsUrl);
13273
13336
  const commands = urlsToOpen.map((url) => `${openCmd} "${url}"`);
13274
13337
  return commands;
13275
13338
  }
13276
13339
  __name(getOpenUrlsCommands, "getOpenUrlsCommands");
13277
- async function updateGitignore(gitRepoRoot) {
13278
- const gitignoreEntries = [".qwen/", "gha-creds-*.json"];
13279
- const gitignorePath = path16.join(gitRepoRoot, ".gitignore");
13280
- try {
13281
- let existingContent = "";
13282
- let fileExists = true;
13283
- try {
13284
- existingContent = await fs13.promises.readFile(gitignorePath, "utf8");
13285
- } catch (_error) {
13286
- fileExists = false;
13287
- }
13288
- if (!fileExists) {
13289
- const contentToWrite = gitignoreEntries.join("\n") + "\n";
13290
- await fs13.promises.writeFile(gitignorePath, contentToWrite);
13291
- } else {
13292
- const missingEntries = gitignoreEntries.filter(
13293
- (entry) => !existingContent.split(/\r?\n/).some((line) => line.split("#")[0].trim() === entry)
13294
- );
13295
- if (missingEntries.length > 0) {
13296
- const contentToAdd = "\n" + missingEntries.join("\n") + "\n";
13297
- await fs13.promises.appendFile(gitignorePath, contentToAdd);
13298
- }
13299
- }
13300
- } catch (error) {
13301
- debugLogger14.debug("Failed to update .gitignore:", error);
13302
- }
13303
- }
13304
- __name(updateGitignore, "updateGitignore");
13305
13340
  var setupGithubCommand = {
13306
13341
  name: "setup-github",
13307
13342
  get description() {
@@ -13318,84 +13353,17 @@ var setupGithubCommand = {
13318
13353
  { once: true }
13319
13354
  );
13320
13355
  }
13321
- if (!isGitHubRepository()) {
13322
- throw new Error(
13323
- "Unable to determine the GitHub repository. /setup-github must be run from a git repository."
13324
- );
13325
- }
13326
- let gitRepoRoot;
13327
- try {
13328
- gitRepoRoot = getGitRepoRoot();
13329
- } catch (_error) {
13330
- debugLogger14.debug(`Failed to get git repo root:`, _error);
13331
- throw new Error(
13332
- "Unable to determine the GitHub repository. /setup-github must be run from a git repository."
13333
- );
13334
- }
13335
13356
  const proxy = context?.services?.config?.getProxy();
13336
- const releaseTag = await getLatestGitHubRelease(proxy);
13337
- const readmeUrl = `https://github.com/QwenLM/qwen-code-action/blob/${releaseTag}/README.md#quick-start`;
13338
- const githubWorkflowsDir = path16.join(gitRepoRoot, ".github", "workflows");
13339
- try {
13340
- await fs13.promises.mkdir(githubWorkflowsDir, { recursive: true });
13341
- } catch (_error) {
13342
- debugLogger14.debug(
13343
- `Failed to create ${githubWorkflowsDir} directory:`,
13344
- _error
13345
- );
13346
- throw new Error(
13347
- `Unable to create ${githubWorkflowsDir} directory. Do you have file permissions in the current directory?`
13348
- );
13349
- }
13350
- const downloads = [];
13351
- for (const workflow of GITHUB_WORKFLOW_PATHS) {
13352
- downloads.push(
13353
- (async () => {
13354
- const endpoint = `https://raw.githubusercontent.com/QwenLM/qwen-code-action/refs/tags/${releaseTag}/examples/workflows/${workflow}`;
13355
- const response = await fetch(endpoint, {
13356
- method: "GET",
13357
- dispatcher: proxy ? new import_undici3.ProxyAgent(proxy) : void 0,
13358
- signal: AbortSignal.any([
13359
- AbortSignal.timeout(3e4),
13360
- abortController.signal
13361
- ])
13362
- });
13363
- if (!response.ok) {
13364
- throw new Error(
13365
- `Invalid response code downloading ${endpoint}: ${response.status} - ${response.statusText}`
13366
- );
13367
- }
13368
- const body = response.body;
13369
- if (!body) {
13370
- throw new Error(
13371
- `Empty body while downloading ${endpoint}: ${response.status} - ${response.statusText}`
13372
- );
13373
- }
13374
- const destination = path16.resolve(
13375
- githubWorkflowsDir,
13376
- path16.basename(workflow)
13377
- );
13378
- const fileStream = fs13.createWriteStream(destination, {
13379
- mode: 420,
13380
- // -rw-r--r--, user(rw), group(r), other(r)
13381
- flags: "w",
13382
- // write and overwrite
13383
- flush: true
13384
- });
13385
- await body.pipeTo(Writable.toWeb(fileStream));
13386
- })()
13387
- );
13388
- }
13389
- await Promise.all(downloads).finally(() => {
13390
- abortController.abort();
13391
- });
13392
- await updateGitignore(gitRepoRoot);
13357
+ const result = await setupGithub({
13358
+ proxy,
13359
+ abortSignal: abortController.signal
13360
+ }).finally(() => abortController.abort());
13393
13361
  const commands = [];
13394
13362
  commands.push("set -eEuo pipefail");
13395
13363
  commands.push(
13396
- `echo "Successfully downloaded ${GITHUB_WORKFLOW_PATHS.length} workflows and updated .gitignore. Follow the steps in ${readmeUrl} (skipping the /setup-github step) to complete setup."`
13364
+ `echo "Successfully downloaded ${GITHUB_WORKFLOW_PATHS.length} workflows and updated .gitignore. Follow the steps in ${result.readmeUrl} (skipping the /setup-github step) to complete setup."`
13397
13365
  );
13398
- commands.push(...getOpenUrlsCommands(readmeUrl));
13366
+ commands.push(...getOpenUrlsCommands(result.readmeUrl, result.secretsUrl));
13399
13367
  const command = `(${commands.join(" && ")})`;
13400
13368
  return {
13401
13369
  type: "tool",
@@ -13411,18 +13379,18 @@ var setupGithubCommand = {
13411
13379
 
13412
13380
  // packages/cli/src/ui/commands/insightCommand.ts
13413
13381
  init_esbuild_shims();
13414
- import { join as join10 } from "path";
13382
+ import { join as join9 } from "path";
13415
13383
  import { pathToFileURL } from "node:url";
13416
13384
 
13417
13385
  // packages/cli/src/services/insight/generators/StaticInsightGenerator.ts
13418
13386
  init_esbuild_shims();
13419
- import fs15 from "fs/promises";
13420
- import path18 from "path";
13387
+ import fs14 from "fs/promises";
13388
+ import path17 from "path";
13421
13389
 
13422
13390
  // packages/cli/src/services/insight/generators/DataProcessor.ts
13423
13391
  init_esbuild_shims();
13424
- import fs14 from "fs/promises";
13425
- import path17 from "path";
13392
+ import fs13 from "fs/promises";
13393
+ import path16 from "path";
13426
13394
 
13427
13395
  // packages/cli/node_modules/p-limit/index.js
13428
13396
  init_esbuild_shims();
@@ -13522,27 +13490,27 @@ function pLimit(concurrency) {
13522
13490
  activeCount--;
13523
13491
  resumeNext();
13524
13492
  }, "next");
13525
- const run = /* @__PURE__ */ __name(async (function_, resolve6, arguments_) => {
13493
+ const run = /* @__PURE__ */ __name(async (function_, resolve5, arguments_) => {
13526
13494
  const result = (async () => function_(...arguments_))();
13527
- resolve6(result);
13495
+ resolve5(result);
13528
13496
  try {
13529
13497
  await result;
13530
13498
  } catch {
13531
13499
  }
13532
13500
  next();
13533
13501
  }, "run");
13534
- const enqueue = /* @__PURE__ */ __name((function_, resolve6, reject, arguments_) => {
13502
+ const enqueue = /* @__PURE__ */ __name((function_, resolve5, reject, arguments_) => {
13535
13503
  const queueItem = { reject };
13536
13504
  new Promise((internalResolve) => {
13537
13505
  queueItem.run = internalResolve;
13538
13506
  queue.enqueue(queueItem);
13539
- }).then(run.bind(void 0, function_, resolve6, arguments_));
13507
+ }).then(run.bind(void 0, function_, resolve5, arguments_));
13540
13508
  if (activeCount < concurrency) {
13541
13509
  resumeNext();
13542
13510
  }
13543
13511
  }, "enqueue");
13544
- const generator = /* @__PURE__ */ __name((function_, ...arguments_) => new Promise((resolve6, reject) => {
13545
- enqueue(function_, resolve6, reject, arguments_);
13512
+ const generator = /* @__PURE__ */ __name((function_, ...arguments_) => new Promise((resolve5, reject) => {
13513
+ enqueue(function_, resolve5, reject, arguments_);
13546
13514
  }), "generator");
13547
13515
  Object.defineProperties(generator, {
13548
13516
  activeCount: {
@@ -13577,8 +13545,8 @@ function pLimit(concurrency) {
13577
13545
  },
13578
13546
  map: {
13579
13547
  async value(iterable, function_) {
13580
- const promises2 = Array.from(iterable, (value, index) => this(function_, value, index));
13581
- return Promise.all(promises2);
13548
+ const promises = Array.from(iterable, (value, index) => this(function_, value, index));
13549
+ return Promise.all(promises);
13582
13550
  }
13583
13551
  }
13584
13552
  });
@@ -14376,19 +14344,19 @@ None captured`;
14376
14344
  async scanChatFiles(baseDir) {
14377
14345
  const allChatFiles = [];
14378
14346
  try {
14379
- const projectDirs = await fs14.readdir(baseDir);
14347
+ const projectDirs = await fs13.readdir(baseDir);
14380
14348
  for (const projectDir of projectDirs) {
14381
- const projectPath = path17.join(baseDir, projectDir);
14382
- const stats = await fs14.stat(projectPath);
14349
+ const projectPath = path16.join(baseDir, projectDir);
14350
+ const stats = await fs13.stat(projectPath);
14383
14351
  if (stats.isDirectory()) {
14384
- const chatsDir = path17.join(projectPath, "chats");
14352
+ const chatsDir = path16.join(projectPath, "chats");
14385
14353
  try {
14386
- const files = await fs14.readdir(chatsDir);
14354
+ const files = await fs13.readdir(chatsDir);
14387
14355
  const chatFiles = files.filter((file) => file.endsWith(".jsonl"));
14388
14356
  for (const file of chatFiles) {
14389
- const filePath = path17.join(chatsDir, file);
14357
+ const filePath = path16.join(chatsDir, file);
14390
14358
  try {
14391
- const fileStats = await fs14.stat(filePath);
14359
+ const fileStats = await fs13.stat(filePath);
14392
14360
  allChatFiles.push({ path: filePath, mtime: fileStats.mtimeMs });
14393
14361
  } catch (e) {
14394
14362
  logger.error(`Failed to stat file ${filePath}:`, e);
@@ -14483,7 +14451,7 @@ None captured`;
14483
14451
  overallProgress
14484
14452
  );
14485
14453
  }
14486
- await new Promise((resolve6) => setTimeout(resolve6, 0));
14454
+ await new Promise((resolve5) => setTimeout(resolve5, 0));
14487
14455
  }
14488
14456
  const streakData = this.calculateStreaks(Object.keys(heatmap));
14489
14457
  let longestWorkDuration = 0;
@@ -14566,12 +14534,12 @@ None captured`;
14566
14534
  if (records.length > 0 && facetsOutputDir) {
14567
14535
  const sessionId = records[0].sessionId;
14568
14536
  if (sessionId) {
14569
- const existingFacetPath = path17.join(
14537
+ const existingFacetPath = path16.join(
14570
14538
  facetsOutputDir,
14571
14539
  `${sessionId}.json`
14572
14540
  );
14573
14541
  try {
14574
- const existingData = await fs14.readFile(
14542
+ const existingData = await fs13.readFile(
14575
14543
  existingFacetPath,
14576
14544
  "utf-8"
14577
14545
  );
@@ -14589,7 +14557,7 @@ None captured`;
14589
14557
  const normalizedData = JSON.stringify(normalizedFacet, null, 2);
14590
14558
  if (existingData !== normalizedData) {
14591
14559
  try {
14592
- await fs14.writeFile(
14560
+ await fs13.writeFile(
14593
14561
  existingFacetPath,
14594
14562
  normalizedData,
14595
14563
  "utf-8"
@@ -14624,11 +14592,11 @@ None captured`;
14624
14592
  const facet = await this.analyzeSession(records);
14625
14593
  if (facet && facetsOutputDir) {
14626
14594
  try {
14627
- const facetPath = path17.join(
14595
+ const facetPath = path16.join(
14628
14596
  facetsOutputDir,
14629
14597
  `${facet.session_id}.json`
14630
14598
  );
14631
- await fs14.writeFile(
14599
+ await fs13.writeFile(
14632
14600
  facetPath,
14633
14601
  JSON.stringify(facet, null, 2),
14634
14602
  "utf-8"
@@ -14726,8 +14694,8 @@ var StaticInsightGenerator = class {
14726
14694
  }
14727
14695
  // Ensure the output directory exists
14728
14696
  async ensureOutputDirectory() {
14729
- const outputDir = path18.join(Storage.getRuntimeBaseDir(), "insights");
14730
- await fs15.mkdir(outputDir, { recursive: true });
14697
+ const outputDir = path17.join(Storage.getRuntimeBaseDir(), "insights");
14698
+ await fs14.mkdir(outputDir, { recursive: true });
14731
14699
  return outputDir;
14732
14700
  }
14733
14701
  // Generate timestamped filename with collision detection
@@ -14735,23 +14703,23 @@ var StaticInsightGenerator = class {
14735
14703
  const now = /* @__PURE__ */ new Date();
14736
14704
  const date = now.toISOString().split("T")[0];
14737
14705
  const time = now.toTimeString().slice(0, 8).replace(/:/g, "");
14738
- let outputPath = path18.join(outputDir, `insight-${date}.html`);
14706
+ let outputPath = path17.join(outputDir, `insight-${date}.html`);
14739
14707
  try {
14740
- await fs15.access(outputPath);
14741
- outputPath = path18.join(outputDir, `insight-${date}-${time}.html`);
14708
+ await fs14.access(outputPath);
14709
+ outputPath = path17.join(outputDir, `insight-${date}-${time}.html`);
14742
14710
  } catch {
14743
14711
  }
14744
14712
  return outputPath;
14745
14713
  }
14746
14714
  async updateInsightSymlink(outputDir, targetPath) {
14747
- const latestPath = path18.join(outputDir, "insight.html");
14715
+ const latestPath = path17.join(outputDir, "insight.html");
14748
14716
  await updateSymlink(latestPath, targetPath);
14749
14717
  }
14750
14718
  // Generate the static insight HTML file
14751
14719
  async generateStaticInsight(baseDir, onProgress) {
14752
14720
  const outputDir = await this.ensureOutputDirectory();
14753
- const facetsDir = path18.join(outputDir, "facets");
14754
- await fs15.mkdir(facetsDir, { recursive: true });
14721
+ const facetsDir = path17.join(outputDir, "facets");
14722
+ await fs14.mkdir(facetsDir, { recursive: true });
14755
14723
  const insights = await this.dataProcessor.generateInsights(
14756
14724
  baseDir,
14757
14725
  facetsDir,
@@ -14759,7 +14727,7 @@ var StaticInsightGenerator = class {
14759
14727
  );
14760
14728
  const html = await this.templateRenderer.renderInsightHTML(insights);
14761
14729
  const outputPath = await this.generateOutputPath(outputDir);
14762
- await fs15.writeFile(outputPath, html, "utf-8");
14730
+ await fs14.writeFile(outputPath, html, "utf-8");
14763
14731
  await this.updateInsightSymlink(outputDir, outputPath);
14764
14732
  return outputPath;
14765
14733
  }
@@ -14779,7 +14747,7 @@ var insightCommand = {
14779
14747
  action: /* @__PURE__ */ __name(async (context) => {
14780
14748
  try {
14781
14749
  context.ui.setDebugMessage(t("Generating insights..."));
14782
- const projectsDir = join10(Storage.getRuntimeBaseDir(), "projects");
14750
+ const projectsDir = join9(Storage.getRuntimeBaseDir(), "projects");
14783
14751
  if (!context.services.config) {
14784
14752
  if (context.executionMode !== "interactive") {
14785
14753
  return {
@@ -14822,12 +14790,12 @@ var insightCommand = {
14822
14790
  let isComplete = false;
14823
14791
  let resume = null;
14824
14792
  const flushResume = /* @__PURE__ */ __name(() => {
14825
- const resolve6 = resume;
14826
- if (!resolve6) {
14793
+ const resolve5 = resume;
14794
+ if (!resolve5) {
14827
14795
  return;
14828
14796
  }
14829
14797
  resume = null;
14830
- resolve6();
14798
+ resolve5();
14831
14799
  }, "flushResume");
14832
14800
  const pushMessage = /* @__PURE__ */ __name((message) => {
14833
14801
  pendingMessages.push(message);
@@ -14836,8 +14804,8 @@ var insightCommand = {
14836
14804
  const streamMessages = /* @__PURE__ */ __name(async function* () {
14837
14805
  while (!isComplete || pendingMessages.length > 0) {
14838
14806
  if (pendingMessages.length === 0) {
14839
- await new Promise((resolve6) => {
14840
- resume = resolve6;
14807
+ await new Promise((resolve5) => {
14808
+ resume = resolve5;
14841
14809
  });
14842
14810
  }
14843
14811
  while (pendingMessages.length > 0) {
@@ -15153,7 +15121,7 @@ var BuiltinCommandLoader = class {
15153
15121
  initCommand,
15154
15122
  languageCommand,
15155
15123
  mcpCommand,
15156
- ...this.config?.getManagedAutoMemoryEnabled() ? [dreamCommand, forgetCommand] : [],
15124
+ ...this.config?.isManagedMemoryAvailable() ? [dreamCommand, forgetCommand] : [],
15157
15125
  goalCommand,
15158
15126
  memoryCommand,
15159
15127
  modelCommand,
@@ -15194,7 +15162,7 @@ var BuiltinCommandLoader = class {
15194
15162
  // packages/cli/src/services/BundledSkillLoader.ts
15195
15163
  init_esbuild_shims();
15196
15164
  import { dirname as dirname4 } from "node:path";
15197
- var debugLogger15 = createDebugLogger("BUNDLED_SKILL_LOADER");
15165
+ var debugLogger13 = createDebugLogger("BUNDLED_SKILL_LOADER");
15198
15166
  var BundledSkillLoader = class {
15199
15167
  constructor(config) {
15200
15168
  this.config = config;
@@ -15204,12 +15172,12 @@ var BundledSkillLoader = class {
15204
15172
  }
15205
15173
  async loadCommands(_signal) {
15206
15174
  if (this.config?.getBareMode?.()) {
15207
- debugLogger15.debug("Bare mode enabled, skipping bundled skills");
15175
+ debugLogger13.debug("Bare mode enabled, skipping bundled skills");
15208
15176
  return [];
15209
15177
  }
15210
15178
  const skillManager = this.config?.getSkillManager();
15211
15179
  if (!skillManager) {
15212
- debugLogger15.debug("SkillManager not available, skipping bundled skills");
15180
+ debugLogger13.debug("SkillManager not available, skipping bundled skills");
15213
15181
  return [];
15214
15182
  }
15215
15183
  try {
@@ -15217,7 +15185,7 @@ var BundledSkillLoader = class {
15217
15185
  const cronEnabled = this.config?.isCronEnabled() ?? false;
15218
15186
  const cronVisible = allSkills.filter((skill) => {
15219
15187
  if (!cronEnabled && skill.allowedTools?.some((t2) => t2.startsWith("cron_"))) {
15220
- debugLogger15.debug(
15188
+ debugLogger13.debug(
15221
15189
  `Hiding skill "${skill.name}" because cron is not enabled`
15222
15190
  );
15223
15191
  return false;
@@ -15228,7 +15196,7 @@ var BundledSkillLoader = class {
15228
15196
  const skills = cronVisible.filter(
15229
15197
  (skill) => !disabled.has(skill.name.toLowerCase())
15230
15198
  );
15231
- debugLogger15.debug(
15199
+ debugLogger13.debug(
15232
15200
  `Loaded ${skills.length} bundled skill(s) as slash commands; ${cronVisible.length - skills.length} hidden by skills.disabled`
15233
15201
  );
15234
15202
  return skills.map((skill) => ({
@@ -15279,7 +15247,7 @@ ${body}`;
15279
15247
  }, "action")
15280
15248
  }));
15281
15249
  } catch (error) {
15282
- debugLogger15.error("Failed to load bundled skills:", error);
15250
+ debugLogger13.error("Failed to load bundled skills:", error);
15283
15251
  return [];
15284
15252
  }
15285
15253
  }
@@ -15288,9 +15256,9 @@ ${body}`;
15288
15256
  // packages/cli/src/services/FileCommandLoader.ts
15289
15257
  init_esbuild_shims();
15290
15258
  var import_toml = __toESM(require_toml(), 1);
15291
- import { promises as fs16 } from "node:fs";
15259
+ import { promises as fs15 } from "node:fs";
15292
15260
  import * as fsSync from "node:fs";
15293
- import path20 from "node:path";
15261
+ import path19 from "node:path";
15294
15262
 
15295
15263
  // packages/cli/src/services/markdown-command-parser.ts
15296
15264
  init_esbuild_shims();
@@ -15335,7 +15303,7 @@ __name(parseMarkdownCommand, "parseMarkdownCommand");
15335
15303
 
15336
15304
  // packages/cli/src/services/command-factory.ts
15337
15305
  init_esbuild_shims();
15338
- import path19 from "node:path";
15306
+ import path18 from "node:path";
15339
15307
 
15340
15308
  // packages/cli/src/services/prompt-processors/argumentProcessor.ts
15341
15309
  init_esbuild_shims();
@@ -15559,7 +15527,7 @@ var ShellProcessor = class {
15559
15527
 
15560
15528
  // packages/cli/src/services/prompt-processors/atFileProcessor.ts
15561
15529
  init_esbuild_shims();
15562
- var debugLogger16 = createDebugLogger("AT_FILE_PROCESSOR");
15530
+ var debugLogger14 = createDebugLogger("AT_FILE_PROCESSOR");
15563
15531
  var AtFileProcessor = class {
15564
15532
  constructor(commandName) {
15565
15533
  this.commandName = commandName;
@@ -15605,7 +15573,7 @@ var AtFileProcessor = class {
15605
15573
  } catch (error) {
15606
15574
  const message = error instanceof Error ? error.message : String(error);
15607
15575
  const uiMessage = `Failed to inject content for '@{${pathStr}}': ${message}`;
15608
- debugLogger16.error(
15576
+ debugLogger14.error(
15609
15577
  `[AtFileProcessor] ${uiMessage}. Leaving placeholder in prompt.`
15610
15578
  );
15611
15579
  context.ui.addItem(
@@ -15630,15 +15598,15 @@ var AtFileProcessor = class {
15630
15598
  };
15631
15599
 
15632
15600
  // packages/cli/src/services/command-factory.ts
15633
- var debugLogger17 = createDebugLogger("COMMAND_FACTORY");
15601
+ var debugLogger15 = createDebugLogger("COMMAND_FACTORY");
15634
15602
  function createSlashCommandFromDefinition(filePath, baseDir, definition, extensionName, fileExtension) {
15635
- const relativePathWithExt = path19.relative(baseDir, filePath);
15603
+ const relativePathWithExt = path18.relative(baseDir, filePath);
15636
15604
  const relativePath = relativePathWithExt.substring(
15637
15605
  0,
15638
15606
  relativePathWithExt.length - fileExtension.length
15639
15607
  );
15640
- const baseCommandName = relativePath.split(path19.sep).map((segment) => segment.replaceAll(":", "_")).join(":");
15641
- const defaultDescription = `Custom command from ${path19.basename(filePath)}`;
15608
+ const baseCommandName = relativePath.split(path18.sep).map((segment) => segment.replaceAll(":", "_")).join(":");
15609
+ const defaultDescription = `Custom command from ${path18.basename(filePath)}`;
15642
15610
  let description = definition.description || defaultDescription;
15643
15611
  if (extensionName) {
15644
15612
  description = `[${extensionName}] ${description}`;
@@ -15674,7 +15642,7 @@ function createSlashCommandFromDefinition(filePath, baseDir, definition, extensi
15674
15642
  whenToUse: definition.whenToUse,
15675
15643
  action: /* @__PURE__ */ __name(async (context, _args) => {
15676
15644
  if (!context.invocation) {
15677
- debugLogger17.error(
15645
+ debugLogger15.error(
15678
15646
  `[FileCommandLoader] Critical error: Command '${baseCommandName}' was executed without invocation context.`
15679
15647
  );
15680
15648
  return {
@@ -15712,7 +15680,7 @@ function createSlashCommandFromDefinition(filePath, baseDir, definition, extensi
15712
15680
  __name(createSlashCommandFromDefinition, "createSlashCommandFromDefinition");
15713
15681
 
15714
15682
  // packages/cli/src/services/FileCommandLoader.ts
15715
- var debugLogger18 = createDebugLogger("FILE_COMMAND_LOADER");
15683
+ var debugLogger16 = createDebugLogger("FILE_COMMAND_LOADER");
15716
15684
  var TomlCommandDefSchema = external_exports.object({
15717
15685
  prompt: external_exports.string({
15718
15686
  required_error: "The 'prompt' field is required.",
@@ -15746,7 +15714,7 @@ var FileCommandLoader = class {
15746
15714
  */
15747
15715
  async loadCommands(signal) {
15748
15716
  if (this.config?.getBareMode?.()) {
15749
- debugLogger18.debug("Bare mode enabled, skipping auto-discovered commands");
15717
+ debugLogger16.debug("Bare mode enabled, skipping auto-discovered commands");
15750
15718
  return [];
15751
15719
  }
15752
15720
  const allCommands = [];
@@ -15772,14 +15740,14 @@ var FileCommandLoader = class {
15772
15740
  }
15773
15741
  const tomlCommandPromises = tomlFiles.map(
15774
15742
  (file) => this.parseAndAdaptTomlFile(
15775
- path20.join(dirInfo.path, file),
15743
+ path19.join(dirInfo.path, file),
15776
15744
  dirInfo.path,
15777
15745
  dirInfo.extensionName
15778
15746
  )
15779
15747
  );
15780
15748
  const mdCommandPromises = mdFiles.map(
15781
15749
  (file) => this.parseAndAdaptMarkdownFile(
15782
- path20.join(dirInfo.path, file),
15750
+ path19.join(dirInfo.path, file),
15783
15751
  dirInfo.path,
15784
15752
  dirInfo.extensionName
15785
15753
  )
@@ -15790,7 +15758,7 @@ var FileCommandLoader = class {
15790
15758
  const isEnoent = error.code === "ENOENT";
15791
15759
  const isAbortError = error instanceof Error && error.name === "AbortError";
15792
15760
  if (!isEnoent && !isAbortError) {
15793
- debugLogger18.error(
15761
+ debugLogger16.error(
15794
15762
  `[FileCommandLoader] Error loading commands from ${dirInfo.path}:`,
15795
15763
  error
15796
15764
  );
@@ -15829,14 +15797,14 @@ var FileCommandLoader = class {
15829
15797
  */
15830
15798
  getExtensionCommandsPaths(ext) {
15831
15799
  try {
15832
- const configPath = path20.join(ext.path, EXTENSIONS_CONFIG_FILENAME);
15800
+ const configPath = path19.join(ext.path, EXTENSIONS_CONFIG_FILENAME);
15833
15801
  if (fsSync.existsSync(configPath)) {
15834
15802
  const configContent = fsSync.readFileSync(configPath, "utf-8");
15835
15803
  const config = JSON.parse(configContent);
15836
15804
  if (config.commands) {
15837
15805
  const commandsArray = Array.isArray(config.commands) ? config.commands : [config.commands];
15838
15806
  return commandsArray.map(
15839
- (cmdPath) => path20.isAbsolute(cmdPath) ? cmdPath : path20.join(ext.path, cmdPath)
15807
+ (cmdPath) => path19.isAbsolute(cmdPath) ? cmdPath : path19.join(ext.path, cmdPath)
15840
15808
  ).filter((cmdPath) => {
15841
15809
  try {
15842
15810
  return fsSync.existsSync(cmdPath);
@@ -15847,12 +15815,12 @@ var FileCommandLoader = class {
15847
15815
  }
15848
15816
  }
15849
15817
  } catch (error) {
15850
- debugLogger18.warn(
15818
+ debugLogger16.warn(
15851
15819
  `Failed to read extension config for ${ext.name}:`,
15852
15820
  error
15853
15821
  );
15854
15822
  }
15855
- const defaultPath = path20.join(ext.path, "commands");
15823
+ const defaultPath = path19.join(ext.path, "commands");
15856
15824
  try {
15857
15825
  if (fsSync.existsSync(defaultPath)) {
15858
15826
  return [defaultPath];
@@ -15871,9 +15839,9 @@ var FileCommandLoader = class {
15871
15839
  async parseAndAdaptTomlFile(filePath, baseDir, extensionName) {
15872
15840
  let fileContent;
15873
15841
  try {
15874
- fileContent = await fs16.readFile(filePath, "utf-8");
15842
+ fileContent = await fs15.readFile(filePath, "utf-8");
15875
15843
  } catch (error) {
15876
- debugLogger18.error(
15844
+ debugLogger16.error(
15877
15845
  `[FileCommandLoader] Failed to read file ${filePath}:`,
15878
15846
  error instanceof Error ? error.message : String(error)
15879
15847
  );
@@ -15883,7 +15851,7 @@ var FileCommandLoader = class {
15883
15851
  try {
15884
15852
  parsed = import_toml.default.parse(fileContent);
15885
15853
  } catch (error) {
15886
- debugLogger18.error(
15854
+ debugLogger16.error(
15887
15855
  `[FileCommandLoader] Failed to parse TOML file ${filePath}:`,
15888
15856
  error instanceof Error ? error.message : String(error)
15889
15857
  );
@@ -15891,7 +15859,7 @@ var FileCommandLoader = class {
15891
15859
  }
15892
15860
  const validationResult = TomlCommandDefSchema.safeParse(parsed);
15893
15861
  if (!validationResult.success) {
15894
- debugLogger18.error(
15862
+ debugLogger16.error(
15895
15863
  `[FileCommandLoader] Skipping invalid command file: ${filePath}. Validation errors:`,
15896
15864
  validationResult.error.flatten()
15897
15865
  );
@@ -15916,9 +15884,9 @@ var FileCommandLoader = class {
15916
15884
  async parseAndAdaptMarkdownFile(filePath, baseDir, extensionName) {
15917
15885
  let fileContent;
15918
15886
  try {
15919
- fileContent = await fs16.readFile(filePath, "utf-8");
15887
+ fileContent = await fs15.readFile(filePath, "utf-8");
15920
15888
  } catch (error) {
15921
- debugLogger18.error(
15889
+ debugLogger16.error(
15922
15890
  `[FileCommandLoader] Failed to read file ${filePath}:`,
15923
15891
  error instanceof Error ? error.message : String(error)
15924
15892
  );
@@ -15928,7 +15896,7 @@ var FileCommandLoader = class {
15928
15896
  try {
15929
15897
  parsed = parseMarkdownCommand(fileContent);
15930
15898
  } catch (error) {
15931
- debugLogger18.error(
15899
+ debugLogger16.error(
15932
15900
  `[FileCommandLoader] Failed to parse Markdown file ${filePath}:`,
15933
15901
  error instanceof Error ? error.message : String(error)
15934
15902
  );
@@ -15936,7 +15904,7 @@ var FileCommandLoader = class {
15936
15904
  }
15937
15905
  const validationResult = MarkdownCommandDefSchema.safeParse(parsed);
15938
15906
  if (!validationResult.success) {
15939
- debugLogger18.error(
15907
+ debugLogger16.error(
15940
15908
  `[FileCommandLoader] Skipping invalid command file: ${filePath}. Validation errors:`,
15941
15909
  validationResult.error.flatten()
15942
15910
  );
@@ -15962,7 +15930,7 @@ var FileCommandLoader = class {
15962
15930
 
15963
15931
  // packages/cli/src/services/saved-workflow-loader.ts
15964
15932
  init_esbuild_shims();
15965
- var debugLogger19 = createDebugLogger("SavedWorkflowLoader");
15933
+ var debugLogger17 = createDebugLogger("SavedWorkflowLoader");
15966
15934
  var SavedWorkflowLoader = class {
15967
15935
  constructor(config) {
15968
15936
  this.config = config;
@@ -15981,7 +15949,7 @@ var SavedWorkflowLoader = class {
15981
15949
  try {
15982
15950
  entries = await listSavedWorkflows(this.config);
15983
15951
  } catch (e) {
15984
- debugLogger19.debug(`listSavedWorkflows failed: ${e}`);
15952
+ debugLogger17.debug(`listSavedWorkflows failed: ${e}`);
15985
15953
  return [];
15986
15954
  }
15987
15955
  if (signal.aborted) return [];
@@ -16279,7 +16247,7 @@ var McpPromptLoader = class {
16279
16247
  // packages/cli/src/services/SkillCommandLoader.ts
16280
16248
  init_esbuild_shims();
16281
16249
  import { dirname as dirname5 } from "node:path";
16282
- var debugLogger20 = createDebugLogger("SKILL_COMMAND_LOADER");
16250
+ var debugLogger18 = createDebugLogger("SKILL_COMMAND_LOADER");
16283
16251
  var SkillCommandLoader = class {
16284
16252
  constructor(config) {
16285
16253
  this.config = config;
@@ -16289,12 +16257,12 @@ var SkillCommandLoader = class {
16289
16257
  }
16290
16258
  async loadCommands(_signal) {
16291
16259
  if (this.config?.getBareMode?.()) {
16292
- debugLogger20.debug("Bare mode enabled, skipping skill commands");
16260
+ debugLogger18.debug("Bare mode enabled, skipping skill commands");
16293
16261
  return [];
16294
16262
  }
16295
16263
  const skillManager = this.config?.getSkillManager();
16296
16264
  if (!skillManager) {
16297
- debugLogger20.debug("SkillManager not available, skipping skill commands");
16265
+ debugLogger18.debug("SkillManager not available, skipping skill commands");
16298
16266
  return [];
16299
16267
  }
16300
16268
  try {
@@ -16311,7 +16279,7 @@ var SkillCommandLoader = class {
16311
16279
  const nonUserInvocableCount = visibleSkills.filter(
16312
16280
  (skill) => skill.userInvocable === false
16313
16281
  ).length;
16314
- debugLogger20.debug(
16282
+ debugLogger18.debug(
16315
16283
  `Loaded ${userSkills.length} user + ${projectSkills.length} project + ${extensionSkills.length} extension skill(s) as slash commands; ${allSkills.length - visibleSkills.length} hidden by skills.disabled; ${nonUserInvocableCount} marked non-user-invocable`
16316
16284
  );
16317
16285
  return visibleSkills.map((skill) => {
@@ -16354,7 +16322,7 @@ var SkillCommandLoader = class {
16354
16322
  };
16355
16323
  });
16356
16324
  } catch (error) {
16357
- debugLogger20.error("Failed to load skill commands:", error);
16325
+ debugLogger18.error("Failed to load skill commands:", error);
16358
16326
  return [];
16359
16327
  }
16360
16328
  }
@@ -16429,13 +16397,18 @@ function formatUserPromptExpansionBlockedMessage(reason) {
16429
16397
  __name(formatUserPromptExpansionBlockedMessage, "formatUserPromptExpansionBlockedMessage");
16430
16398
 
16431
16399
  // packages/cli/src/nonInteractiveCliCommands.ts
16432
- var debugLogger21 = createDebugLogger("NON_INTERACTIVE_COMMANDS");
16400
+ var debugLogger19 = createDebugLogger("NON_INTERACTIVE_COMMANDS");
16401
+ function getSkillCommandName(command) {
16402
+ return command.skillDetail?.name ?? command.name;
16403
+ }
16404
+ __name(getSkillCommandName, "getSkillCommandName");
16433
16405
  function handleCommandResult(result, outputHistoryItems) {
16434
16406
  switch (result.type) {
16435
16407
  case "submit_prompt":
16436
16408
  return {
16437
16409
  type: "submit_prompt",
16438
16410
  content: result.content,
16411
+ ...result.modelOverride ? { modelOverride: result.modelOverride } : {},
16439
16412
  ...outputHistoryItems?.length ? { outputHistoryItems } : {}
16440
16413
  };
16441
16414
  case "message":
@@ -16697,7 +16670,25 @@ var handleSlashCommand = /* @__PURE__ */ __name(async (rawQuery, abortController
16697
16670
  args
16698
16671
  }
16699
16672
  };
16700
- const result = await commandToExecute.action(context, args);
16673
+ const isSkillCommand = commandToExecute.kind === "skill" /* SKILL */;
16674
+ let skillInvocationRecorded = false;
16675
+ const recordSkillCommandInvocation = /* @__PURE__ */ __name((success) => {
16676
+ if (!isSkillCommand || skillInvocationRecorded) {
16677
+ return;
16678
+ }
16679
+ recordSkillInvocation(config, {
16680
+ skillName: getSkillCommandName(commandToExecute),
16681
+ success
16682
+ });
16683
+ skillInvocationRecorded = true;
16684
+ }, "recordSkillCommandInvocation");
16685
+ let result;
16686
+ try {
16687
+ result = await commandToExecute.action(context, args);
16688
+ } catch (error) {
16689
+ recordSkillCommandInvocation(false);
16690
+ throw error;
16691
+ }
16701
16692
  if (!result) {
16702
16693
  return {
16703
16694
  type: "message",
@@ -16706,16 +16697,24 @@ var handleSlashCommand = /* @__PURE__ */ __name(async (rawQuery, abortController
16706
16697
  };
16707
16698
  }
16708
16699
  if (result.type === "submit_prompt") {
16709
- const hookResult = await fireUserPromptExpansionHook(
16710
- config,
16711
- commandToExecute.name,
16712
- args,
16713
- result.content,
16714
- abortController.signal
16715
- );
16700
+ let hookResult;
16701
+ try {
16702
+ hookResult = await fireUserPromptExpansionHook(
16703
+ config,
16704
+ commandToExecute.name,
16705
+ args,
16706
+ result.content,
16707
+ abortController.signal
16708
+ );
16709
+ } catch (error) {
16710
+ recordSkillCommandInvocation(false);
16711
+ throw error;
16712
+ }
16716
16713
  if (hookResult.blockedResult) {
16714
+ recordSkillCommandInvocation(false);
16717
16715
  return hookResult.blockedResult;
16718
16716
  }
16717
+ recordSkillCommandInvocation(true);
16719
16718
  return handleCommandResult(
16720
16719
  { ...result, content: hookResult.content },
16721
16720
  outputHistoryItems
@@ -16747,14 +16746,14 @@ var getAvailableCommands = /* @__PURE__ */ __name(async (config, abortSignal, mo
16747
16746
  );
16748
16747
  return commandService.getCommandsForMode(mode);
16749
16748
  } catch (error) {
16750
- debugLogger21.error("Error loading available commands:", error);
16749
+ debugLogger19.error("Error loading available commands:", error);
16751
16750
  return [];
16752
16751
  }
16753
16752
  }, "getAvailableCommands");
16754
16753
 
16755
16754
  // packages/cli/src/utils/nonInteractiveHelpers.ts
16756
16755
  init_esbuild_shims();
16757
- var debugLogger22 = createDebugLogger("NON_INTERACTIVE");
16756
+ var debugLogger20 = createDebugLogger("NON_INTERACTIVE");
16758
16757
  function normalizePartList(parts) {
16759
16758
  if (!parts) {
16760
16759
  return [];
@@ -16817,6 +16816,31 @@ function computeUsageFromMetrics(metrics) {
16817
16816
  return usage2;
16818
16817
  }
16819
16818
  __name(computeUsageFromMetrics, "computeUsageFromMetrics");
16819
+ function buildInitialSystemReminders(config) {
16820
+ const reminders = [];
16821
+ if (config.getApprovalMode() === "plan" /* PLAN */) {
16822
+ reminders.push({ text: getPlanModeSystemReminder(config.getSdkMode?.()) });
16823
+ }
16824
+ const arenaManager = config.getArenaManager?.();
16825
+ if (arenaManager) {
16826
+ try {
16827
+ const sessionDir = arenaManager.getArenaSessionDir();
16828
+ const configPath = `${sessionDir}/config.json`;
16829
+ reminders.push({ text: getArenaSystemReminder(configPath) });
16830
+ } catch {
16831
+ }
16832
+ }
16833
+ return reminders;
16834
+ }
16835
+ __name(buildInitialSystemReminders, "buildInitialSystemReminders");
16836
+ function insertAfterFunctionResponses(parts, additions) {
16837
+ const firstNonFunctionResponse = parts.findIndex(
16838
+ (part) => !part.functionResponse
16839
+ );
16840
+ const insertAt = firstNonFunctionResponse === -1 ? parts.length : firstNonFunctionResponse;
16841
+ return [...parts.slice(0, insertAt), ...additions, ...parts.slice(insertAt)];
16842
+ }
16843
+ __name(insertAfterFunctionResponses, "insertAfterFunctionResponses");
16820
16844
  async function loadSlashCommandNames(config) {
16821
16845
  const controller = new AbortController();
16822
16846
  try {
@@ -16827,7 +16851,7 @@ async function loadSlashCommandNames(config) {
16827
16851
  );
16828
16852
  return commands.map((cmd) => cmd.name).sort();
16829
16853
  } catch (error) {
16830
- debugLogger22.error(
16854
+ debugLogger20.error(
16831
16855
  "[buildSystemMessage] Failed to load slash commands:",
16832
16856
  error
16833
16857
  );
@@ -16852,7 +16876,7 @@ async function buildSystemMessage(config, sessionId, permissionMode) {
16852
16876
  const subagents = await subagentManager.listSubagents();
16853
16877
  agentNames = subagents.map((subagent) => subagent.name);
16854
16878
  } catch (error) {
16855
- debugLogger22.error("[buildSystemMessage] Failed to load subagents:", error);
16879
+ debugLogger20.error("[buildSystemMessage] Failed to load subagents:", error);
16856
16880
  }
16857
16881
  const systemMessage = {
16858
16882
  type: "system",
@@ -17024,6 +17048,7 @@ export {
17024
17048
  hasSlashCommandPathSeparator,
17025
17049
  isSlashCommand,
17026
17050
  isBtwCommand,
17051
+ isMidInputCompletableCommand,
17027
17052
  findMidInputSlashCommand,
17028
17053
  getBestSlashCommandMatch,
17029
17054
  findSlashCommandTokens,
@@ -17055,6 +17080,8 @@ export {
17055
17080
  normalizePartList,
17056
17081
  extractPartsFromUserMessage,
17057
17082
  computeUsageFromMetrics,
17083
+ buildInitialSystemReminders,
17084
+ insertAfterFunctionResponses,
17058
17085
  buildSystemMessage,
17059
17086
  createToolProgressHandler,
17060
17087
  createAgentToolProgressHandler,