@qwen-code/qwen-code 0.26.2-preview.0 → 0.26.2-preview.1

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 (300) hide show
  1. package/chunks/{MaxSizedBox-K6YUM3DX.js → MaxSizedBox-EGHZ2BPF.js} +1 -1
  2. package/chunks/{StandaloneSessionPicker-75IC33SN.js → StandaloneSessionPicker-UVCW6YW3.js} +1 -1
  3. package/chunks/{acp-subagent-executor-3NHBJRPL.js → acp-subagent-executor-AQ7AWSD4.js} +1 -1
  4. package/chunks/{acpAgent-JT6KQPTH.js → acpAgent-IV7JAGD7.js} +3 -3
  5. package/chunks/{advisor-TI2UVEZK.js → advisor-UZ4TF65D.js} +1 -1
  6. package/chunks/{agent-SWIZZZMY.js → agent-CNLVAWDD.js} +1 -1
  7. package/chunks/{agent-headless-USWEJ4GW.js → agent-headless-ZJUJLUJS.js} +1 -1
  8. package/chunks/{agent-host-client-ZFIMQX33.js → agent-host-client-SN5V2KBH.js} +1 -1
  9. package/chunks/{agent-host-connections-LOFD7O7Q.js → agent-host-connections-VKMAJIIU.js} +1 -1
  10. package/chunks/{anthropicContentGenerator-HMLEI4FI.js → anthropicContentGenerator-QTJVPAMI.js} +1 -1
  11. package/chunks/{autofix-pr-NKR2VSLB.js → autofix-pr-U7GNSH27.js} +1 -1
  12. package/chunks/{batch-JQZ3TOHA.js → batch-MBEWETXN.js} +1 -1
  13. package/chunks/{bridge-EIWWT4P6.js → bridge-TEJLNYV3.js} +1 -1
  14. package/chunks/{channel-settings-store-FLRLUA67.js → channel-settings-store-QNCKWWBL.js} +1 -1
  15. package/chunks/{chunk-244YTFYD.js → chunk-23KDY7UW.js} +1 -1
  16. package/chunks/{chunk-7TDMQJTD.js → chunk-2DWWSMTV.js} +1 -1
  17. package/chunks/{chunk-UU2LTNSF.js → chunk-3IZMVLVZ.js} +1 -1
  18. package/chunks/{chunk-B6T4ESBM.js → chunk-3JI7IKJL.js} +1 -1
  19. package/chunks/{chunk-Y5TT2G3N.js → chunk-427MARCP.js} +1 -1
  20. package/chunks/{chunk-KX7JS2P7.js → chunk-4NNNGSQY.js} +3 -3
  21. package/chunks/{chunk-6TQS2WQO.js → chunk-4RM7KY3Z.js} +2 -2
  22. package/chunks/{chunk-YL3N2UGG.js → chunk-5X7S4AE6.js} +5 -5
  23. package/chunks/{chunk-K2HAY5PY.js → chunk-5XAECBED.js} +1 -1
  24. package/chunks/{chunk-VCHFBETO.js → chunk-66KKSLUO.js} +1 -1
  25. package/chunks/{chunk-BSJR2KEF.js → chunk-6CIIDUZW.js} +1 -1
  26. package/chunks/{chunk-22CLK7PK.js → chunk-7EBRMQYW.js} +1 -1
  27. package/chunks/{chunk-J4TFGZ4A.js → chunk-7FSC2NKA.js} +1 -1
  28. package/chunks/{chunk-6JFC5M6B.js → chunk-A5TAAMML.js} +1 -1
  29. package/chunks/{chunk-DHHACQVN.js → chunk-AOYSX44A.js} +1 -1
  30. package/chunks/{chunk-VFVZ2DY7.js → chunk-AZCMQ3DD.js} +2 -2
  31. package/chunks/{chunk-BQJXWIMR.js → chunk-B6F7CVBP.js} +1 -1
  32. package/chunks/{chunk-OVPEAKOQ.js → chunk-BDQOLT37.js} +1 -1
  33. package/chunks/{chunk-5SYUBQNO.js → chunk-BIWEUAKG.js} +1 -1
  34. package/chunks/{chunk-BZM66PQO.js → chunk-BJ5R7LOM.js} +1 -1
  35. package/chunks/{chunk-4R2OHBH3.js → chunk-BKUFRNME.js} +1 -1
  36. package/chunks/{chunk-NIYWNFVF.js → chunk-BNZSPX2I.js} +1 -1
  37. package/chunks/{chunk-FJV2ECNY.js → chunk-D2URRVOK.js} +1 -1
  38. package/chunks/{chunk-GT6CHVAI.js → chunk-DANP7CMW.js} +1 -1
  39. package/chunks/{chunk-FHFLD4DR.js → chunk-DBHLRZGI.js} +1 -1
  40. package/chunks/{chunk-Y2UXZJLM.js → chunk-DL7TKH2E.js} +2 -2
  41. package/chunks/{chunk-MCQE2U7N.js → chunk-DOWKH5OZ.js} +6 -6
  42. package/chunks/{chunk-UHRLBY3C.js → chunk-DPHQJPCU.js} +1 -1
  43. package/chunks/{chunk-PV2VT25U.js → chunk-DPNGBOI7.js} +1 -1
  44. package/chunks/{chunk-NCDNF7UJ.js → chunk-DXRXF4QD.js} +1 -1
  45. package/chunks/{chunk-OCVRMNEQ.js → chunk-DZ3GV34J.js} +1 -1
  46. package/chunks/{chunk-3QIAXWWW.js → chunk-EU2MKUK4.js} +1 -1
  47. package/chunks/{chunk-KMAVI6FB.js → chunk-EVBUXPGM.js} +1 -1
  48. package/chunks/{chunk-BVSTV4JM.js → chunk-F3ZRU2SA.js} +1 -1
  49. package/chunks/{chunk-TBZY477Y.js → chunk-FCZYH27X.js} +1 -1
  50. package/chunks/{chunk-JCOK67LT.js → chunk-FNDMWG43.js} +1 -1
  51. package/chunks/{chunk-5SF32OGU.js → chunk-GDXLJJSW.js} +1 -1
  52. package/chunks/{chunk-SO6FCPRI.js → chunk-GZYIXB7Y.js} +1 -1
  53. package/chunks/{chunk-WZPTWC7X.js → chunk-HHNAH4IH.js} +1 -1
  54. package/chunks/{chunk-7KCAOXNL.js → chunk-HOKROBQZ.js} +1 -1
  55. package/chunks/{chunk-34ZBUQJV.js → chunk-IGPAATQW.js} +1 -1
  56. package/chunks/{chunk-2ZTRKK2O.js → chunk-INFBJDWM.js} +1 -1
  57. package/chunks/{chunk-IEJ2CGRN.js → chunk-J3R7ZNSA.js} +1 -1
  58. package/chunks/{chunk-KT5MPRYB.js → chunk-JCRS367I.js} +1 -1
  59. package/chunks/{chunk-7JWJTRP6.js → chunk-JFVXZFMV.js} +1 -1
  60. package/chunks/{chunk-47LP4MBD.js → chunk-JKMGS2VD.js} +1 -1
  61. package/chunks/{chunk-WRJ3PMDZ.js → chunk-JUQ7T2MV.js} +1 -1
  62. package/chunks/{chunk-NZX3UWNF.js → chunk-KQ4TDFNE.js} +1 -1
  63. package/chunks/{chunk-X7D4VKMX.js → chunk-L6BKKN42.js} +1 -1
  64. package/chunks/{chunk-YG5HVFMY.js → chunk-L7Y6MOHS.js} +1 -1
  65. package/chunks/{chunk-UFTIUKD4.js → chunk-LGYXZJI3.js} +1 -1
  66. package/chunks/{chunk-JQGGILML.js → chunk-LPOEVTKD.js} +1 -1
  67. package/chunks/{chunk-5KI55A6S.js → chunk-LRXS7ZI2.js} +1 -1
  68. package/chunks/{chunk-CKVHEYXW.js → chunk-LYYVSCNL.js} +1 -1
  69. package/chunks/{chunk-LIIMQ4DI.js → chunk-LZNBHBAJ.js} +6 -6
  70. package/chunks/{chunk-H4GDEXMF.js → chunk-M3C6RDGC.js} +1 -1
  71. package/chunks/{chunk-KKKUB3RQ.js → chunk-MNVMHVQJ.js} +1 -1
  72. package/chunks/{chunk-2B3W7IQY.js → chunk-MVGQFFIK.js} +1 -1
  73. package/chunks/{chunk-Q35A2RGO.js → chunk-NC7BCZPQ.js} +1 -1
  74. package/chunks/{chunk-2ZOTG3NW.js → chunk-NE627MUW.js} +1 -1
  75. package/chunks/{chunk-W4P2EN3V.js → chunk-NZNRCPGE.js} +1 -1
  76. package/chunks/{chunk-YPDQJQ3S.js → chunk-P3M4WWRA.js} +1 -1
  77. package/chunks/{chunk-DVB36ASH.js → chunk-P534ONQN.js} +1 -1
  78. package/chunks/{chunk-EL5J4ESB.js → chunk-QF44NNSC.js} +1 -1
  79. package/chunks/{chunk-IQPJOBPI.js → chunk-QHGCDHNW.js} +1 -1
  80. package/chunks/{chunk-EVZC4KEQ.js → chunk-QWJX7NIP.js} +1 -1
  81. package/chunks/{chunk-J2TJL2F4.js → chunk-S53G54DW.js} +2 -2
  82. package/chunks/{chunk-3A6LFJJV.js → chunk-SMNFL3AD.js} +1 -1
  83. package/chunks/{chunk-WDO3K3P2.js → chunk-TOBNWST4.js} +1 -1
  84. package/chunks/{chunk-AVGJ4HE3.js → chunk-TQSBUHAM.js} +1 -1
  85. package/chunks/{chunk-ABUS7DNN.js → chunk-TW5QEP2J.js} +1 -1
  86. package/chunks/{chunk-WYM4Z4D5.js → chunk-UEB2F43V.js} +1 -1
  87. package/chunks/{chunk-FUUPMVD2.js → chunk-UPPE4I6H.js} +1 -1
  88. package/chunks/{chunk-UHBJVFZA.js → chunk-US42COBM.js} +1 -1
  89. package/chunks/{chunk-RMQNBSMK.js → chunk-UUY6XSQI.js} +1 -1
  90. package/chunks/{chunk-UVQUQNCA.js → chunk-UZI3IA27.js} +1 -1
  91. package/chunks/{chunk-SXJ2E33J.js → chunk-V6VMUJ47.js} +1 -1
  92. package/chunks/{chunk-5UFCNJGN.js → chunk-VG2ZINTO.js} +1 -1
  93. package/chunks/{chunk-JPPPJ2GN.js → chunk-VJI6MHWX.js} +1 -1
  94. package/chunks/{chunk-AUI7WVSU.js → chunk-VOBNHBCJ.js} +1 -1
  95. package/chunks/{chunk-3BNJDZHU.js → chunk-VUEZWMI4.js} +1 -1
  96. package/chunks/{chunk-LMNKCL55.js → chunk-W7ZX6WB3.js} +2 -2
  97. package/chunks/{chunk-HVS6V2UZ.js → chunk-WA2LKUVP.js} +1 -1
  98. package/chunks/{chunk-7APLU2XE.js → chunk-WFFCJ5PF.js} +1 -1
  99. package/chunks/{chunk-3TD4WAG5.js → chunk-WQY5GE65.js} +1 -1
  100. package/chunks/{chunk-3YWRMF6C.js → chunk-WSESLSKK.js} +1 -1
  101. package/chunks/{chunk-NILCQMZ7.js → chunk-XFJV5NYT.js} +1 -1
  102. package/chunks/{chunk-LGBGUITT.js → chunk-XIYLRIW4.js} +1 -1
  103. package/chunks/{chunk-KS74L67R.js → chunk-XQ2NYKJH.js} +1 -1
  104. package/chunks/{chunk-JB2NOB6W.js → chunk-Y3VRWG52.js} +1 -1
  105. package/chunks/{chunk-GVZ6D2NL.js → chunk-YBISME5B.js} +1 -1
  106. package/chunks/{chunk-2C2253QI.js → chunk-YJNWPSB3.js} +1 -1
  107. package/chunks/{chunk-O2T3GQ6F.js → chunk-YWVV5STA.js} +1 -1
  108. package/chunks/{chunk-MAQZSOHI.js → chunk-ZH4J3FL6.js} +1 -1
  109. package/chunks/{chunk-THNEKTPK.js → chunk-ZSKCF6DI.js} +1 -1
  110. package/chunks/{chunk-Z7BAHKO5.js → chunk-ZW6456SD.js} +1 -1
  111. package/chunks/{chunk-DMSZ2TB3.js → chunk-ZWM3LLT7.js} +1 -1
  112. package/chunks/{codex-subagent-executor-DQ5LQQWO.js → codex-subagent-executor-DWWT7246.js} +1 -1
  113. package/chunks/{config-utils-CY6HLKZ5.js → config-utils-NGZB522W.js} +1 -1
  114. package/chunks/{contextCommand-SGBWI7O6.js → contextCommand-7QCW2YNX.js} +1 -1
  115. package/chunks/{core-runtime-4DP27LCC.js → core-runtime-PSVNDJPD.js} +1 -1
  116. package/chunks/{create-sub-session-ECPDZMBX.js → create-sub-session-JTSEMEJE.js} +1 -1
  117. package/chunks/{cron-create-OO4OG3EI.js → cron-create-VGIDTUMX.js} +1 -1
  118. package/chunks/{daemon-git-worktree-guard-OYDNHT7P.js → daemon-git-worktree-guard-IQRGS7IH.js} +1 -1
  119. package/chunks/{daemon-status-provider-JGDLXPC6.js → daemon-status-provider-R4MYCYPG.js} +1 -1
  120. package/chunks/{daemon-trust-policy-5HRARS54.js → daemon-trust-policy-VAUKFZ2N.js} +1 -1
  121. package/chunks/{daemon-trust-policy-monitor-RM7FVIIC.js → daemon-trust-policy-monitor-E5HIO6RP.js} +1 -1
  122. package/chunks/{deferred-core-runtime-3CXBZIOG.js → deferred-core-runtime-FLOFQJPU.js} +1 -1
  123. package/chunks/{edit-DJPESAAY.js → edit-OOVQUGKV.js} +1 -1
  124. package/chunks/{enterPlanMode-IHBLRIF3.js → enterPlanMode-AUWVTQLT.js} +1 -1
  125. package/chunks/{environment-JN5SD347.js → environment-RM5OXYP4.js} +1 -1
  126. package/chunks/{errors-NUJCME3Y.js → errors-CLDJGHVD.js} +1 -1
  127. package/chunks/{execution-tool-I3SWG6I3.js → execution-tool-JFBVOKPW.js} +1 -1
  128. package/chunks/{execution-worker-62UZMAMJ.js → execution-worker-MNJZD72W.js} +1 -1
  129. package/chunks/{exitPlanMode-JIC4V3FE.js → exitPlanMode-PC6XG4TW.js} +1 -1
  130. package/chunks/{fast-path-NIOIL5YI.js → fast-path-V4DN3CRZ.js} +1 -1
  131. package/chunks/{glob-EQ4QNAHF.js → glob-DTZROBDS.js} +1 -1
  132. package/chunks/{goal-tools-DYTTSBQG.js → goal-tools-FUVGTY33.js} +1 -1
  133. package/chunks/{handleAutoUpdate-44BTG5L5.js → handleAutoUpdate-U4LVTHGU.js} +1 -1
  134. package/chunks/{i18n-FTHZAHCT.js → i18n-XOKNDFYP.js} +1 -1
  135. package/chunks/{initializer-MSGKXC75.js → initializer-XBR5J4CY.js} +1 -1
  136. package/chunks/{installationInfo-4XJMJJYU.js → installationInfo-4AOEOUI6.js} +1 -1
  137. package/chunks/{interactive-mod-session-DFLRYO2Q.js → interactive-mod-session-YGZK2JK2.js} +1 -1
  138. package/chunks/{list-ODZ7Z6VI.js → list-TCGKVPH4.js} +1 -1
  139. package/chunks/{llm-O64DHKP7.js → llm-SKFTN5UN.js} +4 -4
  140. package/chunks/{llm-content-generator-SK24I6QS.js → llm-content-generator-GWHXT3WS.js} +1 -1
  141. package/chunks/{loadedSettingsAdapter-6PEBUZT5.js → loadedSettingsAdapter-ZALZGZE7.js} +1 -1
  142. package/chunks/{local-ED3UEKWP.js → local-RWTWYS5Z.js} +1 -1
  143. package/chunks/{local-execution-environment-PUKES5LO.js → local-execution-environment-R6JWLD65.js} +1 -1
  144. package/chunks/{loggingContentGenerator-UHOJVSRR.js → loggingContentGenerator-UJV6QFOY.js} +1 -1
  145. package/chunks/{loop-wakeup-NSJQETPZ.js → loop-wakeup-BU2RRYHA.js} +1 -1
  146. package/chunks/{manage-memory-5RRB6FLH.js → manage-memory-XI57JN4T.js} +1 -1
  147. package/chunks/{managed-execution-engine-MZAP7SK6.js → managed-execution-engine-BA5PABMP.js} +1 -1
  148. package/chunks/{managed-local-serve-XMES3HXL.js → managed-local-serve-MFKN22K6.js} +1 -1
  149. package/chunks/{managed-npm-update-R5KGY7G2.js → managed-npm-update-ZGN43NUA.js} +1 -1
  150. package/chunks/{managed-runtime-attestation-worker-O2KNHHV6.js → managed-runtime-attestation-worker-YN2VBGYN.js} +1 -1
  151. package/chunks/{managed-runtime-bootstrap-HOTLM6DE.js → managed-runtime-bootstrap-SGQVMUJE.js} +1 -1
  152. package/chunks/{managed-runtime-session-worker-QZX44ZTD.js → managed-runtime-session-worker-4UMF3VBY.js} +1 -1
  153. package/chunks/{managed-runtime-ssh-worker-U425WQ65.js → managed-runtime-ssh-worker-7XA6KRBN.js} +1 -1
  154. package/chunks/{managed-session-authority-THHDHCBP.js → managed-session-authority-IJGYAOEL.js} +1 -1
  155. package/chunks/{mcp-AR7EK4WY.js → mcp-V3L7B5YK.js} +1 -1
  156. package/chunks/{memory-C2TSF6BK.js → memory-3T6FPNAK.js} +1 -1
  157. package/chunks/{model-call-collection-25WR55OH.js → model-call-collection-WTTITWWM.js} +1 -1
  158. package/chunks/{model-configuration-KC7DQGKV.js → model-configuration-T6SSGI4J.js} +1 -1
  159. package/chunks/{modelConfigUtils-QEHMVLSQ.js → modelConfigUtils-TQA25QJC.js} +1 -1
  160. package/chunks/{monitor-PDQUZD23.js → monitor-5ZAOJSEE.js} +1 -1
  161. package/chunks/{nonInteractiveCli-WY2YFONU.js → nonInteractiveCli-YFINLVA7.js} +1 -1
  162. package/chunks/{nonInteractiveToolExecutor-7RJZYPHJ.js → nonInteractiveToolExecutor-DE3WACL5.js} +1 -1
  163. package/chunks/{notebook-edit-P4ITXF5H.js → notebook-edit-UK6HBRO3.js} +1 -1
  164. package/chunks/{omni-AYUPB2QM.js → omni-65LF5QK4.js} +1 -1
  165. package/chunks/{openaiContentGenerator-V5IK4ITO.js → openaiContentGenerator-HX7NCSV5.js} +1 -1
  166. package/chunks/{openaiResponsesContentGenerator-DYDH6KWT.js → openaiResponsesContentGenerator-CFA6U6Y5.js} +1 -1
  167. package/chunks/{pidfile-INPBL2DK.js → pidfile-ZVKJUNTZ.js} +1 -1
  168. package/chunks/{processUtils-J4UDEDS4.js → processUtils-VS6CJT7E.js} +1 -1
  169. package/chunks/{prompt-terminal-ledger-QLOQWHYE.js → prompt-terminal-ledger-UF5RDB57.js} +1 -1
  170. package/chunks/{qwenContentGenerator-RU43XKKB.js → qwenContentGenerator-GM3ZSI7E.js} +1 -1
  171. package/chunks/{reactive-degrade-2Q3Z3KAR.js → reactive-degrade-TSAQWZ5F.js} +1 -1
  172. package/chunks/{read-file-472BQ25I.js → read-file-J267NT45.js} +1 -1
  173. package/chunks/{resumeHistoryUtils-7SUFKZDC.js → resumeHistoryUtils-IM46VFDV.js} +1 -1
  174. package/chunks/{review-WX52IWJR.js → review-4B64XTCL.js} +1 -1
  175. package/chunks/{ripGrep-4GPGLKAM.js → ripGrep-YLOSXO7P.js} +1 -1
  176. package/chunks/{run-qwen-serve-MXK4RBKL.js → run-qwen-serve-SAHEC44O.js} +1 -1
  177. package/chunks/{runtime-WHU3AGFT.js → runtime-SJDZHV6J.js} +1 -1
  178. package/chunks/{sandboxConfig-7DBXEQJH.js → sandboxConfig-47EXXMUA.js} +1 -1
  179. package/chunks/{scheduled-tasks-O5RV6G6U.js → scheduled-tasks-E6RCTUUS.js} +1 -1
  180. package/chunks/{scheduler-HLMS5LR5.js → scheduler-SE3IWIWA.js} +1 -1
  181. package/chunks/{search-memory-PYND7ZX3.js → search-memory-2W7VJC4Q.js} +1 -1
  182. package/chunks/{send-message-TMLYTQOI.js → send-message-63YGQP6G.js} +1 -1
  183. package/chunks/{serve-EBNBRAME.js → serve-F4ML2WNL.js} +1 -1
  184. package/chunks/{server-63BRDBL5.js → server-S56IB4TT.js} +3 -3
  185. package/chunks/{session-XB6J4CZD.js → session-2CUVLZ4H.js} +1 -1
  186. package/chunks/{session-attachments-root-PFK475N2.js → session-attachments-root-FINBX7K5.js} +1 -1
  187. package/chunks/{session-execution-engine-selector-P6TJTCKR.js → session-execution-engine-selector-UGC7DGUN.js} +1 -1
  188. package/chunks/{session-pr-refresh-PM7VAQTV.js → session-pr-refresh-KQLQ4MZY.js} +1 -1
  189. package/chunks/{sessionService-PO3LLZIZ.js → sessionService-Q6N7LF7Z.js} +1 -1
  190. package/chunks/{settings-JDQSRXP3.js → settings-23I6H76E.js} +1 -1
  191. package/chunks/{shell-JCEX3HKM.js → shell-IUECEVVY.js} +1 -1
  192. package/chunks/{skill-JSZBONIZ.js → skill-YKUETMPC.js} +1 -1
  193. package/chunks/{skill-settings-YGFG6GPN.js → skill-settings-ODYXOPCA.js} +1 -1
  194. package/chunks/{spawnChannel-VIIWSWTL.js → spawnChannel-7XU2SRWZ.js} +1 -1
  195. package/chunks/{standalone-update-2UU6FQZL.js → standalone-update-SWI2RL3L.js} +1 -1
  196. package/chunks/{start-opentui-ui-OSZZNSLY.js → start-opentui-ui-T53QJGCH.js} +1 -1
  197. package/chunks/{startInteractiveUI-FFH66MYH.js → startInteractiveUI-USTZGQOE.js} +1 -1
  198. package/chunks/{team-create-TKGDJ3NU.js → team-create-4A2XUE3D.js} +1 -1
  199. package/chunks/{team-plan-approval-3VJF4G6Z.js → team-plan-approval-4TS5CYN6.js} +1 -1
  200. package/chunks/{terminal-image-renderer-T3VJRZGP.js → terminal-image-renderer-C7553YV6.js} +1 -1
  201. package/chunks/{theme-manager-ZGUFLFUI.js → theme-manager-GTW75GOO.js} +1 -1
  202. package/chunks/{tool-call-3EQS5KSE.js → tool-call-YTUMWL3A.js} +1 -1
  203. package/chunks/{tool-result-media-7LFNVQ6E.js → tool-result-media-JYOYBX4J.js} +1 -1
  204. package/chunks/{tool-search-UDZ4S7T5.js → tool-search-Y4XTT2WF.js} +1 -1
  205. package/chunks/{total-session-admission-U4MII4RA.js → total-session-admission-EMJ5NRGL.js} +1 -1
  206. package/chunks/{trustedFolders-2NQJCIN3.js → trustedFolders-YG6WAVRE.js} +1 -1
  207. package/chunks/{update-relaunch-YKLWSCLC.js → update-relaunch-4QYQRCP4.js} +1 -1
  208. package/chunks/{updateCheck-YDLTQQRU.js → updateCheck-VRFPSX4G.js} +1 -1
  209. package/chunks/{upload-config-5QQKWF4O.js → upload-config-UCKGUYYQ.js} +1 -1
  210. package/chunks/{useAutoAcceptIndicator-AJS4WTU2.js → useAutoAcceptIndicator-2VGLKD7B.js} +1 -1
  211. package/chunks/{validateNonInterActiveAuth-AETOT7ZW.js → validateNonInterActiveAuth-GGMQXKKU.js} +1 -1
  212. package/chunks/{version-IB6DLRAG.js → version-Y46PG7II.js} +1 -1
  213. package/chunks/{web-fetch-LS3QARNR.js → web-fetch-7MPU555L.js} +1 -1
  214. package/chunks/{web-search-FGHRIVEB.js → web-search-HU2CL2X2.js} +1 -1
  215. package/chunks/{workflow-FX6XNETQ.js → workflow-U3D34QQX.js} +1 -1
  216. package/chunks/{workflow-ancestor-trust-5XXBGN6F.js → workflow-ancestor-trust-OWC4YTMR.js} +1 -1
  217. package/chunks/{workspace-agents-UJKLYPUK.js → workspace-agents-KHLAWSAR.js} +1 -1
  218. package/chunks/{workspace-providers-status-4JOHMTAW.js → workspace-providers-status-T57SE3YX.js} +1 -1
  219. package/chunks/{workspace-recovery-worker-XFEYQ4TP.js → workspace-recovery-worker-VYQ723ZE.js} +1 -1
  220. package/chunks/{workspace-registration-store-LWAPVNYC.js → workspace-registration-store-I7PR3A2Y.js} +1 -1
  221. package/chunks/{workspace-registry-M7OC376O.js → workspace-registry-YYUBXCLH.js} +1 -1
  222. package/chunks/{workspace-runtime-coordinator-CYHIL47L.js → workspace-runtime-coordinator-5ICAQO7W.js} +1 -1
  223. package/chunks/{workspace-service-43VZZ56B.js → workspace-service-YROWXOLQ.js} +1 -1
  224. package/chunks/{workspace-skills-status-V2TT6UJQ.js → workspace-skills-status-DKKQDTZJ.js} +1 -1
  225. package/chunks/{workspace-trust-reconciler-YZ4AG5ZW.js → workspace-trust-reconciler-3FPMUZDO.js} +1 -1
  226. package/chunks/{write-file-TGEH5MEZ.js → write-file-7QQVYFDT.js} +1 -1
  227. package/chunks/{zoom-image-TT6R7H2H.js → zoom-image-WL5EB6Q7.js} +1 -1
  228. package/cli.js +2 -2
  229. package/execution-worker.js +1 -1
  230. package/export-transcript-document.js +1 -1
  231. package/package.json +3 -3
  232. package/web-shell/assets/{PierreFilePreview-OsApm5-S.js → PierreFilePreview-BZ17f56_.js} +1 -1
  233. package/web-shell/assets/{SpreadsheetPreview-I1v1EzV7.js → SpreadsheetPreview-Bvkvr_5u.js} +1 -1
  234. package/web-shell/assets/{WorkspaceFileBrowser-BO6aug7i.js → WorkspaceFileBrowser-BJ_I4Uoz.js} +1 -1
  235. package/web-shell/assets/{abnfDiagram-VCTEODGH-DxuLMyN0.js → abnfDiagram-VCTEODGH-iuaBM15V.js} +1 -1
  236. package/web-shell/assets/{agents-route-CSJf6QPO.js → agents-route-CycwfNSC.js} +1 -1
  237. package/web-shell/assets/{arc-3--LekYQ.js → arc-C0lt8n55.js} +1 -1
  238. package/web-shell/assets/{architectureDiagram-5GKGNRK7-Dihq4uto.js → architectureDiagram-5GKGNRK7-Bw326d-A.js} +1 -1
  239. package/web-shell/assets/{blockDiagram-NRAW4CY4-BnaRPM2o.js → blockDiagram-NRAW4CY4-CHtFgBjV.js} +1 -1
  240. package/web-shell/assets/{c4Diagram-UCG6FXSJ-BtC94eMa.js → c4Diagram-UCG6FXSJ-Bx66oJT9.js} +1 -1
  241. package/web-shell/assets/channel-CRJuO00u.js +1 -0
  242. package/web-shell/assets/{chunk-2Q5K7J3B-2ZTXWP6M.js → chunk-2Q5K7J3B-BIshvfa_.js} +1 -1
  243. package/web-shell/assets/{chunk-5VM5RSS4-DBh7DP1F.js → chunk-5VM5RSS4-BZeRS6uD.js} +1 -1
  244. package/web-shell/assets/{chunk-F27PBJKO-xzqbWXBw.js → chunk-F27PBJKO-El-CGY2R.js} +1 -1
  245. package/web-shell/assets/{chunk-G27WJ6UU-DxnCrpxK.js → chunk-G27WJ6UU-DO8ZfQL_.js} +1 -1
  246. package/web-shell/assets/{chunk-JWPE2WC7-BPjRsozm.js → chunk-JWPE2WC7-yYFrrKAj.js} +1 -1
  247. package/web-shell/assets/{chunk-LCL6LL3I-Q2HgB3lf.js → chunk-LCL6LL3I-BFGuOKN0.js} +1 -1
  248. package/web-shell/assets/{chunk-POPQ4Y6H-9tlPaKu-.js → chunk-POPQ4Y6H-GRHK6sdV.js} +1 -1
  249. package/web-shell/assets/{chunk-SVP7TREG-DkNdOHCU.js → chunk-SVP7TREG-DwDu6GqZ.js} +1 -1
  250. package/web-shell/assets/{chunk-XXDRQBXY-D0G-Dhfi.js → chunk-XXDRQBXY-RoNDjkIy.js} +1 -1
  251. package/web-shell/assets/classDiagram-DTDB5LWJ-pPPByLA7.js +1 -0
  252. package/web-shell/assets/classDiagram-v2-JRS7N3AN-pPPByLA7.js +1 -0
  253. package/web-shell/assets/{cose-bilkent-JH36ORCC-Ck0tHxul.js → cose-bilkent-JH36ORCC-CYNiiONE.js} +1 -1
  254. package/web-shell/assets/{cynefin-OW5HDTMX-a4-NTMHi.js → cynefin-OW5HDTMX-DC1_lDIG.js} +1 -1
  255. package/web-shell/assets/{cynefinDiagram-5FMLGOSQ-Pg41Zbf2.js → cynefinDiagram-5FMLGOSQ-D2VxKm2n.js} +1 -1
  256. package/web-shell/assets/{dagre-3AP2YEHR-DT_ZmqkF.js → dagre-3AP2YEHR-C4_BHzpM.js} +1 -1
  257. package/web-shell/assets/{diagram-S7CK7UJ4-hapdMOl1.js → diagram-S7CK7UJ4-BpAO4-Gv.js} +1 -1
  258. package/web-shell/assets/{diagram-UQ7AKVKN-YZ0nbk56.js → diagram-UQ7AKVKN-DqUsFdsX.js} +1 -1
  259. package/web-shell/assets/{diagram-VSXAHHWV-DA_yNbWy.js → diagram-VSXAHHWV-DcMXIYMy.js} +1 -1
  260. package/web-shell/assets/{diagram-VX7I27RA-DoULuCLT.js → diagram-VX7I27RA-I3nr09ex.js} +1 -1
  261. package/web-shell/assets/{diagram-Z3DM3KII-B5c9o9zL.js → diagram-Z3DM3KII-CN-gvsTo.js} +1 -1
  262. package/web-shell/assets/{docx-preview-BulxdBjs.js → docx-preview-31J6RsS0.js} +1 -1
  263. package/web-shell/assets/{ebnfDiagram-PWID7BFC-B5hgIg3m.js → ebnfDiagram-PWID7BFC-DOQvLWlM.js} +1 -1
  264. package/web-shell/assets/{erDiagram-SSCWMZ5O-BEfEPozi.js → erDiagram-SSCWMZ5O-Cb5ijFZh.js} +1 -1
  265. package/web-shell/assets/{flowDiagram-A5DVABFB-CQHNk92v.js → flowDiagram-A5DVABFB-BecqqjnZ.js} +1 -1
  266. package/web-shell/assets/{ganttDiagram-EL5Y4UJY-BabdVgIM.js → ganttDiagram-EL5Y4UJY-DWY5vzQl.js} +1 -1
  267. package/web-shell/assets/{gitGraphDiagram-WWUBYQGX-ujRZBFUo.js → gitGraphDiagram-WWUBYQGX-DqBnsZmZ.js} +1 -1
  268. package/web-shell/assets/{index-B9uXebIR.js → index-DDmiUW3b.js} +6 -6
  269. package/web-shell/assets/{index-DSZXdZnu.js → index-DabH7kHA.js} +1 -1
  270. package/web-shell/assets/{infoDiagram-RXCK75RN-CUHj9jJC.js → infoDiagram-RXCK75RN-MlotyOdT.js} +1 -1
  271. package/web-shell/assets/{ishikawaDiagram-5VMMS53U-CulW_q81.js → ishikawaDiagram-5VMMS53U-Daq_85C7.js} +1 -1
  272. package/web-shell/assets/{journeyDiagram-EYS64GPL-BR46CvRQ.js → journeyDiagram-EYS64GPL-OipivCxL.js} +1 -1
  273. package/web-shell/assets/{kanban-definition-3QL26DDD-HAoUqzFy.js → kanban-definition-3QL26DDD-zqaz7dLu.js} +1 -1
  274. package/web-shell/assets/{layout-DYLl7fyA.js → layout-Bi3msQMQ.js} +1 -1
  275. package/web-shell/assets/{linear-DPXABjDZ.js → linear-D4gPORvD.js} +1 -1
  276. package/web-shell/assets/{mermaid.core-Bi30Gi0n.js → mermaid.core-BUnytF7a.js} +6 -6
  277. package/web-shell/assets/{mindmap-definition-FBJOCRG2-B1_lUq4o.js → mindmap-definition-FBJOCRG2-B_X4iChu.js} +1 -1
  278. package/web-shell/assets/{pegDiagram-XKGWAZYB-Cy8tjJJC.js → pegDiagram-XKGWAZYB-z4wYBoBW.js} +1 -1
  279. package/web-shell/assets/{pieDiagram-E7YTZNPT-D6waLVVi.js → pieDiagram-E7YTZNPT-Dvyg6FYo.js} +1 -1
  280. package/web-shell/assets/{quadrantDiagram-AXDQQJYC--6ehi_FI.js → quadrantDiagram-AXDQQJYC-CJBWU2Dk.js} +1 -1
  281. package/web-shell/assets/{railroadDiagram-O6MQD6OU-BhLy40X4.js → railroadDiagram-O6MQD6OU-Dl_An1O0.js} +1 -1
  282. package/web-shell/assets/{requirementDiagram-EFPCY7ZU-BVNXTgNP.js → requirementDiagram-EFPCY7ZU-Tw8FwaYU.js} +1 -1
  283. package/web-shell/assets/{sankeyDiagram-P5KCCOFB-BHgTytxV.js → sankeyDiagram-P5KCCOFB-BCPCkbR0.js} +1 -1
  284. package/web-shell/assets/{sequenceDiagram-WJ2MYXX4-CgOsTvhu.js → sequenceDiagram-WJ2MYXX4-DDj7uFTG.js} +1 -1
  285. package/web-shell/assets/{sizeCapture-X5ZJPWSS-vCQBQ5FI.js → sizeCapture-X5ZJPWSS-B9eVSpKb.js} +1 -1
  286. package/web-shell/assets/{stateDiagram-HBIQ2CUA-DytMYRWJ.js → stateDiagram-HBIQ2CUA-Bf4BZP_V.js} +1 -1
  287. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-BPJi6Gre.js +1 -0
  288. package/web-shell/assets/{swimlanes-XN3QIQJK-CTGnifOP.js → swimlanes-XN3QIQJK-dyTWsZFj.js} +1 -1
  289. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Bw4NRtJQ.js +8 -0
  290. package/web-shell/assets/{timeline-definition-24CTP7MA-DEJ1cbn2.js → timeline-definition-24CTP7MA-DVl1A4uL.js} +1 -1
  291. package/web-shell/assets/{vennDiagram-4TSXK5OY-K1e4SjS0.js → vennDiagram-4TSXK5OY-Boosxy9D.js} +1 -1
  292. package/web-shell/assets/{wardleyDiagram-VM6X3IG4-DEX-GkRp.js → wardleyDiagram-VM6X3IG4-C6wlY8jy.js} +1 -1
  293. package/web-shell/assets/{xychartDiagram-S5SC5T6Z-B6wYXreH.js → xychartDiagram-S5SC5T6Z-CkzZe3ro.js} +1 -1
  294. package/web-shell/index.html +1 -1
  295. package/web-shell/sw.js +1 -1
  296. package/web-shell/assets/channel-CLVrtVFX.js +0 -1
  297. package/web-shell/assets/classDiagram-DTDB5LWJ-Df2T70oB.js +0 -1
  298. package/web-shell/assets/classDiagram-v2-JRS7N3AN-Df2T70oB.js +0 -1
  299. package/web-shell/assets/stateDiagram-v2-4QOOHH4V-CcjUJGng.js +0 -1
  300. package/web-shell/assets/swimlanesDiagram-VK2B7HYN-Dt8NvQfX.js +0 -8
@@ -1,7 +1,7 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
- import{EXTENSION_CONTEXT_BUDGET,buildExtensionMentionContext,buildExtensionRef,getSanitizedExtensionDisplayName,matchExtensionByRef,parseExtensionRef,sanitizeDisplayText}from"./chunk-Z7BAHKO5.js";import{t}from"./chunk-EZMTX4EU.js";import{SessionReferenceService,readManyFiles}from"./chunk-6JFC5M6B.js";import{emptyMcpResourceText,formatMcpResourceContents,summarizeMcpResource}from"./chunk-46VUDNCL.js";import{SessionService}from"./chunk-LIIMQ4DI.js";import{shouldRunVisionBridge}from"./chunk-TNCN2JX2.js";import{Storage}from"./chunk-EPODBRBP.js";import{isSubpath,unescapePath,unescapeShellSpecials}from"./chunk-OKN3Z5C5.js";import{getErrorMessage,isNodeError}from"./chunk-XYB7GC5U.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import*as fs from"node:fs/promises";import*as path from"node:path";init_esbuild_shims();function matchMcpServerPrefix(input,serverNames){let serverName=null;for(const name of serverNames){if(input.startsWith(`${name}:`)&&(serverName===null||name.length>serverName.length)){serverName=name}}if(serverName===null)return null;return{serverName,rest:input.slice(serverName.length+1)}}__name(matchMcpServerPrefix,"matchMcpServerPrefix");function buildMcpResourceRef(serverName,uri){return`${serverName}:${uri}`}__name(buildMcpResourceRef,"buildMcpResourceRef");init_esbuild_shims();init_esbuild_shims();var MAX_SUGGESTIONS_TO_SHOW=8;var MAX_SUGGESTION_LABEL_WIDTH=150;function prepareSuggestionLabel(label,matchedIndex,userInput,isExpanded=false){const hasMatch=matchedIndex!==void 0&&matchedIndex>=0&&matchedIndex<label.length&&userInput.length>0;if(!hasMatch){return{before:!isExpanded&&label.length>MAX_SUGGESTION_LABEL_WIDTH?label.slice(0,MAX_SUGGESTION_LABEL_WIDTH)+"...":label,match:"",after:""}}const matchLength=userInput.length;let before="";let match="";let after="";if(isExpanded||label.length<=MAX_SUGGESTION_LABEL_WIDTH){before=label.slice(0,matchedIndex);match=label.slice(matchedIndex,matchedIndex+matchLength);after=label.slice(matchedIndex+matchLength)}else if(matchLength>=MAX_SUGGESTION_LABEL_WIDTH){match=label.slice(matchedIndex,matchedIndex+MAX_SUGGESTION_LABEL_WIDTH-1)+"..."}else{const contextSpace=MAX_SUGGESTION_LABEL_WIDTH-matchLength;const beforeSpace=Math.floor(contextSpace/2);const afterSpace=Math.ceil(contextSpace/2);let start=matchedIndex-beforeSpace;let end=matchedIndex+matchLength+afterSpace;if(start<0){end+=-start;start=0}if(end>label.length){start-=end-label.length;end=label.length}start=Math.max(0,start);const finalMatchIndex=matchedIndex-start;const slicedLabel=label.slice(start,end);before=slicedLabel.slice(0,finalMatchIndex);match=slicedLabel.slice(finalMatchIndex,finalMatchIndex+matchLength);after=slicedLabel.slice(finalMatchIndex+matchLength);if(start>0){before=before.length>=3?"..."+before.slice(3):"..."}if(end<label.length){after=after.length>=3?after.slice(0,-3)+"...":"..."}}return{before,match,after}}__name(prepareSuggestionLabel,"prepareSuggestionLabel");function normalizeDescription(description){return description.replace(/\s+/g," ").trim()}__name(normalizeDescription,"normalizeDescription");function getExtensionSuggestions(config,pattern){if(!config)return[];if(config.isTrustedFolder?.()===false)return[];const extensions=config.getActiveExtensions?.()??[];if(extensions.length===0)return[];const query=pattern.toLowerCase();return extensions.map(ext=>({ext,safeLabel:sanitizeDisplayText(ext.displayName||ext.name)||ext.name})).filter(({safeLabel,ext})=>{const label=safeLabel.toLowerCase();const name=ext.name.toLowerCase();return label.includes(query)||name.includes(query)}).sort((a,b)=>{const aName=a.safeLabel.toLowerCase();const bName=b.safeLabel.toLowerCase();const aPrefix=aName.startsWith(query)?0:1;const bPrefix=bName.startsWith(query)?0:1;if(aPrefix!==bPrefix)return aPrefix-bPrefix;return aName.localeCompare(bName)}).slice(0,MAX_SUGGESTIONS_TO_SHOW).map(({ext,safeLabel})=>({label:safeLabel,value:buildExtensionRef(ext.name),description:ext.config.description?sanitizeDisplayText(ext.config.description)??void 0:void 0,sourceBadge:t("Extension"),isDirectory:false,category:"extension"}))}__name(getExtensionSuggestions,"getExtensionSuggestions");init_esbuild_shims();var SESSION_MENTION_PREFIX="session:";var UUID_RE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function isSessionId(value){return UUID_RE.test(value.trim())}__name(isSessionId,"isSessionId");function parseSessionRef(pathName){if(!pathName.startsWith(SESSION_MENTION_PREFIX))return null;const rawRemainder=pathName.slice(SESSION_MENTION_PREFIX.length).trim();const remainder=process.platform==="win32"?unescapeShellSpecials(rawRemainder):rawRemainder;if(remainder.length===0)return null;return isSessionId(remainder)?{id:remainder}:{title:remainder}}__name(parseSessionRef,"parseSessionRef");function buildSessionRef(idOrTitle){return`${SESSION_MENTION_PREFIX}${idOrTitle}`}__name(buildSessionRef,"buildSessionRef");init_esbuild_shims();var MCP_SERVER_REF_PREFIX="mcp:";function parseMcpServerRef(pathName){if(!pathName.startsWith(MCP_SERVER_REF_PREFIX))return null;const name=pathName.slice(MCP_SERVER_REF_PREFIX.length);if(!name)return null;return{name}}__name(parseMcpServerRef,"parseMcpServerRef");function buildMcpServerRef(serverName){return`${MCP_SERVER_REF_PREFIX}${serverName}`}__name(buildMcpServerRef,"buildMcpServerRef");function matchMcpServerByRef(name,servers){const lower=name.toLowerCase();const matchedName=Object.keys(servers).find(serverName=>serverName.toLowerCase()===lower);if(!matchedName)return void 0;return{serverName:matchedName,server:servers[matchedName]}}__name(matchMcpServerByRef,"matchMcpServerByRef");function buildMcpServerContextText(config,serverName){const lines=[`--- MCP Server: ${serverName} ---`,`The user explicitly mentioned this MCP server. Prefer using tools and resources from this server when relevant for this turn. This is advisory context, not a hard restriction.`];const prompts=config.getPromptRegistry?.()?.getPromptsByServer(serverName)??[];const resources=config.getResourceRegistry?.()?.getResourcesByServer(serverName)??[];const details=[];if(resources.length>0){details.push(`- Resources: ${resources.length}`)}if(prompts.length>0){details.push(`- Prompts: ${prompts.length}`)}if(details.length>0){lines.push("Available capabilities from this MCP server:");lines.push(...details)}lines.push(`--- End MCP Server: ${serverName} ---`);return lines.join("\n")}__name(buildMcpServerContextText,"buildMcpServerContextText");function parseAllAtCommands(query){const parts=[];let currentIndex=0;while(currentIndex<query.length){let atIndex=-1;let nextSearchIndex=currentIndex;while(nextSearchIndex<query.length){if(query[nextSearchIndex]==="@"&&(nextSearchIndex===0||query[nextSearchIndex-1]!=="\\")){atIndex=nextSearchIndex;break}nextSearchIndex++}if(atIndex===-1){if(currentIndex<query.length){parts.push({type:"text",content:query.substring(currentIndex)})}break}if(atIndex>currentIndex){parts.push({type:"text",content:query.substring(currentIndex,atIndex)})}const isUrlRef=/^https?:\/\//i.test(query.slice(atIndex+1));const NON_URL_CHAR=/[^A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=%]/;let pathEndIndex=atIndex+1;let inEscape=false;while(pathEndIndex<query.length){const char=query[pathEndIndex];if(inEscape){inEscape=false}else if(char==="\\"){inEscape=true}else if(isUrlRef){if(NON_URL_CHAR.test(char))break}else if(/[,\s;!?()[\]{}]/.test(char)){break}else if(char==="."){const nextChar=pathEndIndex+1<query.length?query[pathEndIndex+1]:"";if(nextChar===""||/\s/.test(nextChar)){break}}pathEndIndex++}let rawAtPath=query.substring(atIndex,pathEndIndex);if(isUrlRef){const trimmed=rawAtPath.replace(/[.,;:!?]+$/,"");pathEndIndex=atIndex+trimmed.length;rawAtPath=trimmed}const atPath=unescapePath(rawAtPath);parts.push({type:"atPath",content:atPath});currentIndex=pathEndIndex}return parts.filter(part=>!(part.type==="text"&&part.content.trim()===""))}__name(parseAllAtCommands,"parseAllAtCommands");function extractAtPathCommands(query){return parseAllAtCommands(query).flatMap(part=>part.type==="atPath"&&part.content!=="@"?[part.content.substring(1)]:[])}__name(extractAtPathCommands,"extractAtPathCommands");function parseMcpResourceRef(pathName,mcpServerNames){const match=matchMcpServerPrefix(pathName,mcpServerNames);if(!match||!match.rest)return null;return{serverName:match.serverName,uri:match.rest}}__name(parseMcpResourceRef,"parseMcpResourceRef");async function resolveAtCommandQuery({query,config,onDebugMessage,messageId:userMessageTimestamp,signal}){const commandParts=parseAllAtCommands(query);const atPathCommandParts=commandParts.filter(part=>part.type==="atPath");if(atPathCommandParts.length===0){return{processedQuery:[{text:query}],shouldProceed:true}}const fileDiscovery=config.getFileService();const respectFileIgnore=config.getFileFilteringOptions();const configuredProjectTempDir=Storage.getGlobalTempDir();const projectTempDir=await fs.realpath(configuredProjectTempDir).catch(()=>path.resolve(configuredProjectTempDir));const pathSpecsToRead=[];const atPathToResolvedSpecMap=new Map;const contentLabelsForDisplay=[];const displayPaths=new Map;const displayPathsByCanonicalPath=new Map;const ignoredByReason={git:[],qwen:[],both:[]};const getIgnoreReason=__name(candidate=>{const gitIgnored=respectFileIgnore.respectGitIgnore&&fileDiscovery.shouldIgnoreFile(candidate,{respectGitIgnore:true,respectQwenIgnore:false});const qwenIgnored=respectFileIgnore.respectQwenIgnore&&fileDiscovery.shouldIgnoreFile(candidate,{respectGitIgnore:false,respectQwenIgnore:true});return gitIgnored&&qwenIgnored?"both":gitIgnored?"git":qwenIgnored?"qwen":void 0},"getIgnoreReason");const mcpServerNames=new Set(Object.keys(config.getMcpServers()||{}));const mcpResourceRefs=[];const mcpServerMentions=[];const activeExtensions=config.getActiveExtensions?.()??[];const extensionMentions=[];const sessionMentions=[];const urlMediaRefs=[];const rememberedMediaRefs=[];for(const atPathPart of atPathCommandParts){const originalAtPath=atPathPart.content;if(originalAtPath==="@"){onDebugMessage("Lone @ detected, will be treated as text in the modified query.");continue}const pathName=originalAtPath.substring(1);if(/^https?:\/\//i.test(pathName)&&config.isOmniEnabled?.()){const omni=await import("./omni-AYUPB2QM.js");if(omni.isOmniDeliveryActive(config)&&omni.parseHttpUrlRef(pathName)){if(!urlMediaRefs.some(r=>r.url===pathName)){urlMediaRefs.push({originalAtPath,url:pathName})}atPathToResolvedSpecMap.set(originalAtPath,pathName);continue}}const extRef=parseExtensionRef(pathName);if(extRef){const extension=matchExtensionByRef(extRef.name,activeExtensions);if(extension){if(!extensionMentions.some(m=>m.extension.name===extension.name)){extensionMentions.push({originalAtPath,extension})}atPathToResolvedSpecMap.set(originalAtPath,pathName);continue}onDebugMessage(`Extension "${extRef.name}" not found among active extensions. Available: ${activeExtensions.map(e=>e.name).join(", ")||"(none)"}`);continue}const sessionRef=parseSessionRef(pathName);if(sessionRef){if(!sessionMentions.some(m=>(m.ref.id??m.ref.title)===(sessionRef.id??sessionRef.title))){sessionMentions.push({originalAtPath,ref:sessionRef})}atPathToResolvedSpecMap.set(originalAtPath,buildSessionRef(sessionRef.id??sessionRef.title));continue}const resourceRef=parseMcpResourceRef(pathName,mcpServerNames);if(resourceRef){mcpResourceRefs.push({originalAtPath,...resourceRef});atPathToResolvedSpecMap.set(originalAtPath,pathName);continue}const mcpServerRef=parseMcpServerRef(pathName);if(mcpServerRef){const matched=matchMcpServerByRef(mcpServerRef.name,config.getMcpServers()||{});if(matched){if(!mcpServerMentions.some(m=>m.serverName===matched.serverName)){mcpServerMentions.push({originalAtPath,serverName:matched.serverName})}atPathToResolvedSpecMap.set(originalAtPath,buildMcpServerRef(matched.serverName));continue}onDebugMessage(`MCP server "${mcpServerRef.name}" not found among configured MCP servers. Available: ${Object.keys(config.getMcpServers()||{}).join(", ")||"(none)"}`);continue}const workspaceContext=config.getWorkspaceContext();const absolutePathName=path.isAbsolute(pathName)?pathName:path.resolve(workspaceContext.getDirectories()[0]||"",pathName);if(!isSubpath(configuredProjectTempDir,absolutePathName)&&!isSubpath(projectTempDir,absolutePathName)&&!workspaceContext.isPathWithinWorkspace(pathName)){onDebugMessage(`Path ${pathName} is not in the workspace and will be skipped.`);continue}const ignoredReason=getIgnoreReason(pathName);if(ignoredReason){const reason=ignoredReason;ignoredByReason[reason].push(pathName);const reasonText=reason==="both"?"ignored by both git and qwen":reason==="git"?"git-ignored":"qwen-ignored";onDebugMessage(`Path ${pathName} is ${reasonText} and will be skipped.`);continue}let resolvedSuccessfully=false;let sawNotFound=false;let deferredIgnoreReason;for(const dir of config.getWorkspaceContext().getDirectories()){try{const absolutePath=path.resolve(dir,pathName);const canonicalPath=await fs.realpath(absolutePath);const stats=await fs.stat(canonicalPath);if(!isSubpath(configuredProjectTempDir,canonicalPath)&&!isSubpath(projectTempDir,canonicalPath)&&!workspaceContext.isPathWithinWorkspace(canonicalPath)){onDebugMessage(`Path ${pathName} is not in the workspace and will be skipped.`);continue}const canonicalIgnoreReason=getIgnoreReason(canonicalPath);if(canonicalIgnoreReason){deferredIgnoreReason=canonicalIgnoreReason;const reasonText=canonicalIgnoreReason==="both"?"ignored by both git and qwen":canonicalIgnoreReason==="git"?"git-ignored":"qwen-ignored";onDebugMessage(`Path ${pathName} is ${reasonText} and will be skipped.`);continue}if(stats.isDirectory()){onDebugMessage(`Path ${pathName} resolved to directory.`)}else{onDebugMessage(`Path ${pathName} resolved to file: ${absolutePath}`)}pathSpecsToRead.push(canonicalPath);atPathToResolvedSpecMap.set(originalAtPath,pathName);contentLabelsForDisplay.push(pathName);displayPaths.set(canonicalPath,pathName);const canonicalDisplays=displayPathsByCanonicalPath.get(canonicalPath)??new Set;canonicalDisplays.add(pathName);displayPathsByCanonicalPath.set(canonicalPath,canonicalDisplays);resolvedSuccessfully=true}catch(error){if(isNodeError(error)&&error.code==="ENOENT"){sawNotFound=true;continue}else{onDebugMessage(`Error stating path ${pathName}: ${getErrorMessage(error)}. Path ${pathName} will be skipped.`)}}if(resolvedSuccessfully){break}}if(!resolvedSuccessfully&&sawNotFound){let reanchored=false;if(config.isOmniEnabled?.()){const{reanchorRememberedMedia}=await import("./omni-AYUPB2QM.js");for(const dir of config.getWorkspaceContext().getDirectories()){const anchor=await reanchorRememberedMedia(config,path.resolve(dir,pathName));if(!anchor)continue;rememberedMediaRefs.push({originalAtPath,pathName,annotation:anchor.annotation});atPathToResolvedSpecMap.set(originalAtPath,pathName);onDebugMessage(`Path ${pathName} is gone but remembered; re-anchored as ${anchor.resourceId} (bytes unavailable).`);reanchored=true;break}}if(!reanchored){onDebugMessage(`Path ${pathName} not found. Path ${pathName} will be skipped.`)}}if(!resolvedSuccessfully&&deferredIgnoreReason){ignoredByReason[deferredIgnoreReason].push(pathName)}}const buildInitialQueryText=__name(()=>{let text="";for(let i=0;i<commandParts.length;i++){const part=commandParts[i];if(part.type==="text"){text+=part.content}else{const resolvedSpec=atPathToResolvedSpecMap.get(part.content);if(i>0&&text.length>0&&!text.endsWith(" ")){const prevPart=commandParts[i-1];if(prevPart.type==="text"||prevPart.type==="atPath"){text+=" "}}if(resolvedSpec){text+=`@${resolvedSpec}`}else{if(i>0&&text.length>0&&!text.endsWith(" ")&&!part.content.startsWith(" ")){text+=" "}text+=part.content}}}return text.trim()},"buildInitialQueryText");let initialQueryText=buildInitialQueryText();const totalIgnored=ignoredByReason["git"].length+ignoredByReason["qwen"].length+ignoredByReason["both"].length;if(totalIgnored>0){const messages=[];if(ignoredByReason["git"].length){messages.push(`Git-ignored: ${ignoredByReason["git"].join(", ")}`)}if(ignoredByReason["qwen"].length){messages.push(`Qwen-ignored: ${ignoredByReason["qwen"].join(", ")}`)}if(ignoredByReason["both"].length){messages.push(`Ignored by both: ${ignoredByReason["both"].join(", ")}`)}const message=`Ignored ${totalIgnored} files:
4
- ${messages.join("\n")}`;onDebugMessage(message)}const resourceReads=await Promise.allSettled(mcpResourceRefs.map(ref=>config.getToolRegistry().readMcpResource(ref.serverName,ref.uri,{signal})));const urlMediaParts=[];const urlMediaDisplays=[];const urlMediaLabels=[];if(urlMediaRefs.length>0){const core=await import("./omni-AYUPB2QM.js");for(let i=0;i<urlMediaRefs.length;i++){const ref=urlMediaRefs[i];const callId=`client-url-media-${userMessageTimestamp}-${i}`;const hostLabel=(()=>{try{return new URL(ref.url).hostname}catch{return"invalid-url"}})();let tempPartPath;try{const store=new core.OmniObjectStore(config.storage.getQwenDir());const downloadsDir=path.join(store.getOmniRootDir(),"downloads");const downloaded=await core.downloadMediaUrl({url:ref.url,downloadsDir,maxBytes:core.effectiveMaxDownloadFileBytes(config),signal});tempPartPath=downloaded.partPath;const urlBase=path.basename(new URL(ref.url).pathname)||hostLabel;const modalities=config.getContentGeneratorConfig?.()?.modalities??{};const sniffedModality=await core.sniffFileModality(downloaded.partPath);if(sniffedModality&&!modalities[sniffedModality]){urlMediaDisplays.push({callId,name:"Fetch Media URL",description:`Download ${ref.url}`,status:"Error",resultDisplay:`Skipped ${urlBase}: the active model does not accept ${sniffedModality} input.`,confirmationDetails:void 0});continue}const delivery=await core.processMediaForOmniDelivery(downloaded.partPath,config,{signal,displayName:urlBase,sourceUrl:ref.url});const transcriptParts=core.buildTranscriptParts(urlBase,delivery.transcripts);const additionalParts=core.buildAdditionalMediaParts(urlBase,delivery.additionalMedia);const handleParts=delivery.resourceId?[{text:core.formatResourceHandleText(urlBase,delivery.resourceId)}]:[];if(delivery.omission){urlMediaParts.push(...handleParts);urlMediaParts.push({text:core.formatOmissionText(urlBase,delivery.omission.reason)});urlMediaParts.push(...additionalParts);urlMediaParts.push(...transcriptParts);urlMediaLabels.push(ref.url);urlMediaDisplays.push({callId,name:"Fetch Media URL",description:`Downloaded ${ref.url}`,status:"Success",resultDisplay:`Media omitted by the omni transport guard: ${urlBase}`,confirmationDetails:void 0});continue}if(!delivery.fileUri&&transcriptParts.length>0){urlMediaParts.push(...handleParts);if(delivery.disclosure){urlMediaParts.push({text:core.formatDisclosureText(urlBase,delivery.disclosure)})}urlMediaParts.push(...additionalParts);urlMediaParts.push(...transcriptParts);urlMediaLabels.push(ref.url);urlMediaDisplays.push({callId,name:"Fetch Media URL",description:`Downloaded ${ref.url}`,status:"Success",resultDisplay:`Localized ${urlBase} and delivered as transcript (omni policy).`,confirmationDetails:void 0});continue}urlMediaParts.push(...handleParts);if(delivery.disclosure){urlMediaParts.push({text:core.formatDisclosureText(urlBase,delivery.disclosure)})}urlMediaParts.push({fileData:{fileUri:delivery.fileUri,mimeType:delivery.mimeType,displayName:urlBase}});urlMediaParts.push(...additionalParts);urlMediaParts.push(...transcriptParts);urlMediaLabels.push(ref.url);urlMediaDisplays.push({callId,name:"Fetch Media URL",description:`Downloaded ${ref.url}`,status:"Success",resultDisplay:`Localized ${urlBase} (${delivery.recognized.modality}, ${(delivery.recognized.sizeBytes/1024/1024).toFixed(1)}MB) and delivered via omni upload${delivery.degraded?" (degraded by media policy)":""}.`,confirmationDetails:void 0})}catch(error){if(signal.aborted){if(tempPartPath){await fs.rm(tempPartPath,{force:true}).catch(()=>{})}return{processedQuery:null,shouldProceed:false,toolDisplays:[...urlMediaDisplays],filesRead:urlMediaLabels}}const reason=getErrorMessage(error);onDebugMessage(`Failed to localize media URL ${ref.url}: ${reason}`);urlMediaDisplays.push({callId,name:"Fetch Media URL",description:`Download ${ref.url}`,status:"Error",resultDisplay:`Failed to fetch media from ${hostLabel}: ${reason}`,confirmationDetails:void 0})}finally{if(tempPartPath){await fs.rm(tempPartPath,{force:true}).catch(()=>{})}}}}const resourceParts=[];const resourceDisplays=[];const resourceLabels=[];for(let i=0;i<mcpResourceRefs.length;i++){const ref=mcpResourceRefs[i];const label=`${ref.serverName}:${ref.uri}`;const callId=`client-mcp-resource-${userMessageTimestamp}-${i}`;const outcome=resourceReads[i];if(outcome.status==="rejected"){onDebugMessage(`Failed to read MCP resource ${label}: ${getErrorMessage(outcome.reason)}`);resourceDisplays.push({callId,name:"Read MCP Resource",description:`Read resource ${label}`,status:"Error",resultDisplay:`Failed to read resource ${label}: ${getErrorMessage(outcome.reason)}`,confirmationDetails:void 0});continue}const formatted=formatMcpResourceContents(outcome.value,label);if(formatted.parts.length>0){resourceParts.push(...formatted.parts)}else{resourceParts.push({text:emptyMcpResourceText(formatted,label)})}resourceLabels.push(label);resourceDisplays.push({callId,name:"Read MCP Resource",description:`Read resource ${label}`,status:"Success",resultDisplay:summarizeMcpResource(formatted),confirmationDetails:void 0})}if(pathSpecsToRead.length===0&&mcpResourceRefs.length===0&&mcpServerMentions.length===0&&extensionMentions.length===0&&sessionMentions.length===0&&urlMediaRefs.length===0){onDebugMessage("No valid file paths found in @ commands to read.");if(initialQueryText==="@"&&query.trim()==="@"){return{processedQuery:[{text:query}],shouldProceed:true}}else if(!initialQueryText&&query){return{processedQuery:[{text:query}],shouldProceed:true}}return{processedQuery:[{text:initialQueryText||query}],shouldProceed:true}}let extensionContextBudgetRemaining=EXTENSION_CONTEXT_BUDGET;const scopedMentionEntries=[];for(let i=0;i<extensionMentions.length;i++){const{originalAtPath,extension}=extensionMentions[i];const displayName=getSanitizedExtensionDisplayName(extension);const callId=`client-extension-${userMessageTimestamp}-${i}`;const context=await buildExtensionMentionContext(extension,{remainingBudget:extensionContextBudgetRemaining,signal,onDebugMessage});extensionContextBudgetRemaining=context.remainingBudget;scopedMentionEntries.push({originalAtPath,part:{text:context.text},label:buildExtensionRef(extension.name),display:{callId,name:"Activate Extension",description:`Activated extension ${displayName}`,status:"Success",resultDisplay:void 0,confirmationDetails:void 0}})}for(let i=0;i<mcpServerMentions.length;i++){const{originalAtPath,serverName}=mcpServerMentions[i];scopedMentionEntries.push({originalAtPath,part:{text:buildMcpServerContextText(config,serverName)},label:buildMcpServerRef(serverName),display:{callId:`client-mcp-server-${userMessageTimestamp}-${i}`,name:"Activate MCP Server",description:`Activated MCP server ${serverName}`,status:"Success",resultDisplay:void 0,confirmationDetails:void 0}})}const resolvedSessionIds=new Set;for(let i=0;i<sessionMentions.length;i++){const{originalAtPath,ref}=sessionMentions[i];const callId=`client-session-${userMessageTimestamp}-${i}`;let sessionId=ref.id;if(!sessionId&&ref.title){let matches=[];try{matches=await new SessionService(config.getProjectRoot()).findSessionsByTitle(ref.title)}catch(error){const reason=`Could not look up sessions matching "@${originalAtPath.substring(1)}" (${getErrorMessage(error)}); try a session id instead.`;onDebugMessage(reason);scopedMentionEntries.push({originalAtPath,part:{text:""},label:buildSessionRef(ref.title??originalAtPath),display:{callId,name:"Referenced Session",description:`Reference session "${ref.title??""}"`,status:"Error",resultDisplay:reason,confirmationDetails:void 0}});continue}if(matches.length===1){sessionId=matches[0].sessionId}else{const reason=matches.length===0?`No session matches "@${originalAtPath.substring(1)}".`:`"@${originalAtPath.substring(1)}" is ambiguous (${matches.length} matches); use the picker or a session id.`;onDebugMessage(reason);scopedMentionEntries.push({originalAtPath,part:{text:""},label:buildSessionRef(ref.title),display:{callId,name:"Referenced Session",description:`Reference session "${ref.title}"`,status:"Error",resultDisplay:reason,confirmationDetails:void 0}});continue}}if(!sessionId){const reason=`Session reference "@${originalAtPath.substring(1)}" could not be resolved.`;onDebugMessage(reason);scopedMentionEntries.push({originalAtPath,part:{text:""},label:buildSessionRef(ref.title??ref.id??originalAtPath),display:{callId,name:"Referenced Session",description:`Reference session "${ref.title??ref.id??""}"`,status:"Error",resultDisplay:reason,confirmationDetails:void 0}});continue}if(resolvedSessionIds.has(sessionId)){onDebugMessage(`Session reference "@${originalAtPath.substring(1)}" resolves to session ${sessionId}, which was already referenced; skipping duplicate.`);continue}resolvedSessionIds.add(sessionId);let resolved;try{resolved=await new SessionReferenceService(config.getProjectRoot()).resolve(sessionId,ref.title?{title:ref.title}:{})}catch(error){const reason=`Failed to load session "${sessionId}" (${getErrorMessage(error)}); the transcript may be corrupted or unreadable.`;onDebugMessage(reason);scopedMentionEntries.push({originalAtPath,part:{text:""},label:buildSessionRef(sessionId),display:{callId,name:"Referenced Session",description:`Reference session ${sessionId}`,status:"Error",resultDisplay:reason,confirmationDetails:void 0}});continue}if("notFound"in resolved){const reason=`Session "${sessionId}" not found in this project.`;onDebugMessage(reason);scopedMentionEntries.push({originalAtPath,part:{text:""},label:buildSessionRef(sessionId),display:{callId,name:"Referenced Session",description:`Reference session ${sessionId}`,status:"Error",resultDisplay:reason,confirmationDetails:void 0}});continue}scopedMentionEntries.push({originalAtPath,part:{text:resolved.text},label:buildSessionRef(sessionId),display:{callId,name:"Referenced Session",description:`Referenced session "${resolved.meta.title}"${resolved.truncated?" (truncated)":""}`,status:"Success",resultDisplay:void 0,confirmationDetails:void 0}})}const scopedMentionOrder=new Map(atPathCommandParts.map((part,index)=>[part.content,index]));scopedMentionEntries.sort((a,b)=>(scopedMentionOrder.get(a.originalAtPath)??Number.MAX_SAFE_INTEGER)-(scopedMentionOrder.get(b.originalAtPath)??Number.MAX_SAFE_INTEGER));const scopedMentionParts=scopedMentionEntries.map(entry=>entry.part);const scopedMentionLabels=scopedMentionEntries.map(entry=>entry.label);const scopedMentionDisplays=scopedMentionEntries.map(entry=>entry.display);const fileParts=[];let fileDisplays=[];const revalidatedPathSpecs=[];const revalidatedDisplayPaths=new Map;const validatedPathIdentities=new Map;const pruneSkippedPath=__name(approvedPath=>{const displayPath=displayPaths.get(approvedPath);const displayLabels=displayPathsByCanonicalPath.get(approvedPath)??new Set(displayPath?[displayPath]:[]);for(const[originalAtPath,resolvedSpec]of atPathToResolvedSpecMap){if(resolvedSpec===approvedPath||displayLabels.has(resolvedSpec)){atPathToResolvedSpecMap.delete(originalAtPath)}}for(let index=contentLabelsForDisplay.length-1;index>=0;index--){const label=contentLabelsForDisplay[index];if(label===approvedPath||displayLabels.has(label)){contentLabelsForDisplay.splice(index,1)}}},"pruneSkippedPath");for(const approvedPath of pathSpecsToRead){try{const currentPath=await fs.realpath(approvedPath);const stats=await fs.stat(currentPath);if(currentPath===approvedPath&&(stats.isFile()||stats.isDirectory())&&(isSubpath(configuredProjectTempDir,currentPath)||isSubpath(projectTempDir,currentPath)||config.getWorkspaceContext().isPathWithinWorkspace(currentPath))&&getIgnoreReason(currentPath)===void 0){revalidatedPathSpecs.push(currentPath);const displayPath=displayPaths.get(approvedPath);if(displayPath)revalidatedDisplayPaths.set(currentPath,displayPath);validatedPathIdentities.set(currentPath,{dev:stats.dev,ino:stats.ino})}else{pruneSkippedPath(approvedPath);onDebugMessage(`Path ${approvedPath} failed revalidation and will be skipped.`)}}catch{pruneSkippedPath(approvedPath);onDebugMessage(`Path ${approvedPath} changed before it could be read and will be skipped.`)}}initialQueryText=buildInitialQueryText();if(revalidatedPathSpecs.length>0){try{const result=await readManyFiles(config,{paths:revalidatedPathSpecs,signal,preserveUnsupportedImageForBridge:shouldRunVisionBridge(config),validatedPathIdentities,displayPaths:revalidatedDisplayPaths});const parts=Array.isArray(result.contentParts)?result.contentParts:[result.contentParts];fileDisplays=result.files.map((file,index)=>({callId:`client-read-${userMessageTimestamp}-${index}`,name:file.isDirectory?"Read Directory":"Read File",description:`@${path.basename(file.filePath)}`,status:file.error?"Error":"Success",resultDisplay:file.error?`Failed to read ${path.basename(file.filePath)}: ${file.error}`:void 0,confirmationDetails:void 0}));if(parts.length>0&&!result.error){for(const part of parts){fileParts.push(typeof part==="string"?{text:part}:part)}}else{onDebugMessage("readManyFiles returned no content or empty content.")}}catch(error){const errorToolCallDisplay={callId:`client-read-${userMessageTimestamp}`,name:"Read File(s)",description:"Error attempting to read files",status:"Error",resultDisplay:`Error reading files (${contentLabelsForDisplay.join(", ")}): ${getErrorMessage(error)}`,confirmationDetails:void 0};const errorMessage=typeof errorToolCallDisplay.resultDisplay==="string"?errorToolCallDisplay.resultDisplay:void 0;const labelsOnError=[...scopedMentionLabels,...contentLabelsForDisplay,...resourceLabels,...urlMediaLabels];return{processedQuery:null,shouldProceed:false,toolDisplays:[...scopedMentionDisplays,...resourceDisplays,...urlMediaDisplays,errorToolCallDisplay],filesRead:labelsOnError,recording:{filesRead:labelsOnError,status:"error",message:errorMessage}}}}const rememberedMediaParts=rememberedMediaRefs.flatMap(ref=>[{text:ref.annotation},{text:`\u3010\u5A92\u4F53\u7F3A\u5931\u3011${ref.pathName}\uFF1A\u6587\u4EF6\u5DF2\u4E0D\u5728\u78C1\u76D8\u4E0A\uFF0C\u65E0\u6CD5\u6295\u9012\u753B\u9762/\u97F3\u9891\u3002\u5176\u5904\u7406\u8BB0\u5FC6\u4ECD\u53EF\u7528\u2014\u2014\u7528\u4E0A\u9762\u7684\u53E5\u67C4\u8C03\u7528 omni_recall_media_memory \u53D6\u56DE\u3002`}]);const processedQueryParts=[{text:initialQueryText},...scopedMentionParts,...fileParts,...resourceParts,...urlMediaParts,...rememberedMediaParts];const allLabels=[...scopedMentionLabels,...contentLabelsForDisplay,...resourceLabels,...urlMediaLabels,...rememberedMediaRefs.map(ref=>`${ref.pathName} (\u8BB0\u5FC6)`)];return{processedQuery:processedQueryParts,shouldProceed:true,toolDisplays:[...scopedMentionDisplays,...fileDisplays,...resourceDisplays,...urlMediaDisplays],filesRead:allLabels,recording:{filesRead:allLabels,status:"success"}}}__name(resolveAtCommandQuery,"resolveAtCommandQuery");async function handleAtCommand(params){const result=await resolveAtCommandQuery(params);if(result.recording){const chatRecorder=params.config.getChatRecordingService?.();chatRecorder?.recordAtCommand({filesRead:result.recording.filesRead,status:result.recording.status,...result.recording.message?{message:result.recording.message}:{},userText:params.query})}if(params.addItem&&result.toolDisplays&&result.toolDisplays.length>0){const toolGroupItem={type:"tool_group",tools:result.toolDisplays};params.addItem(toolGroupItem,params.messageId)}return{processedQuery:result.processedQuery,shouldProceed:result.shouldProceed,toolDisplays:result.toolDisplays,filesRead:result.filesRead}}__name(handleAtCommand,"handleAtCommand");export{matchMcpServerPrefix,buildMcpResourceRef,MAX_SUGGESTIONS_TO_SHOW,MAX_SUGGESTION_LABEL_WIDTH,prepareSuggestionLabel,normalizeDescription,getExtensionSuggestions,SESSION_MENTION_PREFIX,buildSessionRef,parseMcpServerRef,buildMcpServerRef,matchMcpServerByRef,buildMcpServerContextText,extractAtPathCommands,resolveAtCommandQuery,handleAtCommand};
3
+ import{EXTENSION_CONTEXT_BUDGET,buildExtensionMentionContext,buildExtensionRef,getSanitizedExtensionDisplayName,matchExtensionByRef,parseExtensionRef,sanitizeDisplayText}from"./chunk-ZW6456SD.js";import{t}from"./chunk-EZMTX4EU.js";import{SessionReferenceService,readManyFiles}from"./chunk-A5TAAMML.js";import{emptyMcpResourceText,formatMcpResourceContents,summarizeMcpResource}from"./chunk-46VUDNCL.js";import{SessionService}from"./chunk-LZNBHBAJ.js";import{shouldRunVisionBridge}from"./chunk-TNCN2JX2.js";import{Storage}from"./chunk-EPODBRBP.js";import{isSubpath,unescapePath,unescapeShellSpecials}from"./chunk-OKN3Z5C5.js";import{getErrorMessage,isNodeError}from"./chunk-XYB7GC5U.js";import{init_esbuild_shims}from"./chunk-VKDAXTCZ.js";import{__name}from"./chunk-KBWJGX7I.js";init_esbuild_shims();import*as fs from"node:fs/promises";import*as path from"node:path";init_esbuild_shims();function matchMcpServerPrefix(input,serverNames){let serverName=null;for(const name of serverNames){if(input.startsWith(`${name}:`)&&(serverName===null||name.length>serverName.length)){serverName=name}}if(serverName===null)return null;return{serverName,rest:input.slice(serverName.length+1)}}__name(matchMcpServerPrefix,"matchMcpServerPrefix");function buildMcpResourceRef(serverName,uri){return`${serverName}:${uri}`}__name(buildMcpResourceRef,"buildMcpResourceRef");init_esbuild_shims();init_esbuild_shims();var MAX_SUGGESTIONS_TO_SHOW=8;var MAX_SUGGESTION_LABEL_WIDTH=150;function prepareSuggestionLabel(label,matchedIndex,userInput,isExpanded=false){const hasMatch=matchedIndex!==void 0&&matchedIndex>=0&&matchedIndex<label.length&&userInput.length>0;if(!hasMatch){return{before:!isExpanded&&label.length>MAX_SUGGESTION_LABEL_WIDTH?label.slice(0,MAX_SUGGESTION_LABEL_WIDTH)+"...":label,match:"",after:""}}const matchLength=userInput.length;let before="";let match="";let after="";if(isExpanded||label.length<=MAX_SUGGESTION_LABEL_WIDTH){before=label.slice(0,matchedIndex);match=label.slice(matchedIndex,matchedIndex+matchLength);after=label.slice(matchedIndex+matchLength)}else if(matchLength>=MAX_SUGGESTION_LABEL_WIDTH){match=label.slice(matchedIndex,matchedIndex+MAX_SUGGESTION_LABEL_WIDTH-1)+"..."}else{const contextSpace=MAX_SUGGESTION_LABEL_WIDTH-matchLength;const beforeSpace=Math.floor(contextSpace/2);const afterSpace=Math.ceil(contextSpace/2);let start=matchedIndex-beforeSpace;let end=matchedIndex+matchLength+afterSpace;if(start<0){end+=-start;start=0}if(end>label.length){start-=end-label.length;end=label.length}start=Math.max(0,start);const finalMatchIndex=matchedIndex-start;const slicedLabel=label.slice(start,end);before=slicedLabel.slice(0,finalMatchIndex);match=slicedLabel.slice(finalMatchIndex,finalMatchIndex+matchLength);after=slicedLabel.slice(finalMatchIndex+matchLength);if(start>0){before=before.length>=3?"..."+before.slice(3):"..."}if(end<label.length){after=after.length>=3?after.slice(0,-3)+"...":"..."}}return{before,match,after}}__name(prepareSuggestionLabel,"prepareSuggestionLabel");function normalizeDescription(description){return description.replace(/\s+/g," ").trim()}__name(normalizeDescription,"normalizeDescription");function getExtensionSuggestions(config,pattern){if(!config)return[];if(config.isTrustedFolder?.()===false)return[];const extensions=config.getActiveExtensions?.()??[];if(extensions.length===0)return[];const query=pattern.toLowerCase();return extensions.map(ext=>({ext,safeLabel:sanitizeDisplayText(ext.displayName||ext.name)||ext.name})).filter(({safeLabel,ext})=>{const label=safeLabel.toLowerCase();const name=ext.name.toLowerCase();return label.includes(query)||name.includes(query)}).sort((a,b)=>{const aName=a.safeLabel.toLowerCase();const bName=b.safeLabel.toLowerCase();const aPrefix=aName.startsWith(query)?0:1;const bPrefix=bName.startsWith(query)?0:1;if(aPrefix!==bPrefix)return aPrefix-bPrefix;return aName.localeCompare(bName)}).slice(0,MAX_SUGGESTIONS_TO_SHOW).map(({ext,safeLabel})=>({label:safeLabel,value:buildExtensionRef(ext.name),description:ext.config.description?sanitizeDisplayText(ext.config.description)??void 0:void 0,sourceBadge:t("Extension"),isDirectory:false,category:"extension"}))}__name(getExtensionSuggestions,"getExtensionSuggestions");init_esbuild_shims();var SESSION_MENTION_PREFIX="session:";var UUID_RE=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function isSessionId(value){return UUID_RE.test(value.trim())}__name(isSessionId,"isSessionId");function parseSessionRef(pathName){if(!pathName.startsWith(SESSION_MENTION_PREFIX))return null;const rawRemainder=pathName.slice(SESSION_MENTION_PREFIX.length).trim();const remainder=process.platform==="win32"?unescapeShellSpecials(rawRemainder):rawRemainder;if(remainder.length===0)return null;return isSessionId(remainder)?{id:remainder}:{title:remainder}}__name(parseSessionRef,"parseSessionRef");function buildSessionRef(idOrTitle){return`${SESSION_MENTION_PREFIX}${idOrTitle}`}__name(buildSessionRef,"buildSessionRef");init_esbuild_shims();var MCP_SERVER_REF_PREFIX="mcp:";function parseMcpServerRef(pathName){if(!pathName.startsWith(MCP_SERVER_REF_PREFIX))return null;const name=pathName.slice(MCP_SERVER_REF_PREFIX.length);if(!name)return null;return{name}}__name(parseMcpServerRef,"parseMcpServerRef");function buildMcpServerRef(serverName){return`${MCP_SERVER_REF_PREFIX}${serverName}`}__name(buildMcpServerRef,"buildMcpServerRef");function matchMcpServerByRef(name,servers){const lower=name.toLowerCase();const matchedName=Object.keys(servers).find(serverName=>serverName.toLowerCase()===lower);if(!matchedName)return void 0;return{serverName:matchedName,server:servers[matchedName]}}__name(matchMcpServerByRef,"matchMcpServerByRef");function buildMcpServerContextText(config,serverName){const lines=[`--- MCP Server: ${serverName} ---`,`The user explicitly mentioned this MCP server. Prefer using tools and resources from this server when relevant for this turn. This is advisory context, not a hard restriction.`];const prompts=config.getPromptRegistry?.()?.getPromptsByServer(serverName)??[];const resources=config.getResourceRegistry?.()?.getResourcesByServer(serverName)??[];const details=[];if(resources.length>0){details.push(`- Resources: ${resources.length}`)}if(prompts.length>0){details.push(`- Prompts: ${prompts.length}`)}if(details.length>0){lines.push("Available capabilities from this MCP server:");lines.push(...details)}lines.push(`--- End MCP Server: ${serverName} ---`);return lines.join("\n")}__name(buildMcpServerContextText,"buildMcpServerContextText");function parseAllAtCommands(query){const parts=[];let currentIndex=0;while(currentIndex<query.length){let atIndex=-1;let nextSearchIndex=currentIndex;while(nextSearchIndex<query.length){if(query[nextSearchIndex]==="@"&&(nextSearchIndex===0||query[nextSearchIndex-1]!=="\\")){atIndex=nextSearchIndex;break}nextSearchIndex++}if(atIndex===-1){if(currentIndex<query.length){parts.push({type:"text",content:query.substring(currentIndex)})}break}if(atIndex>currentIndex){parts.push({type:"text",content:query.substring(currentIndex,atIndex)})}const isUrlRef=/^https?:\/\//i.test(query.slice(atIndex+1));const NON_URL_CHAR=/[^A-Za-z0-9\-._~:/?#[\]@!$&'()*+,;=%]/;let pathEndIndex=atIndex+1;let inEscape=false;while(pathEndIndex<query.length){const char=query[pathEndIndex];if(inEscape){inEscape=false}else if(char==="\\"){inEscape=true}else if(isUrlRef){if(NON_URL_CHAR.test(char))break}else if(/[,\s;!?()[\]{}]/.test(char)){break}else if(char==="."){const nextChar=pathEndIndex+1<query.length?query[pathEndIndex+1]:"";if(nextChar===""||/\s/.test(nextChar)){break}}pathEndIndex++}let rawAtPath=query.substring(atIndex,pathEndIndex);if(isUrlRef){const trimmed=rawAtPath.replace(/[.,;:!?]+$/,"");pathEndIndex=atIndex+trimmed.length;rawAtPath=trimmed}const atPath=unescapePath(rawAtPath);parts.push({type:"atPath",content:atPath});currentIndex=pathEndIndex}return parts.filter(part=>!(part.type==="text"&&part.content.trim()===""))}__name(parseAllAtCommands,"parseAllAtCommands");function extractAtPathCommands(query){return parseAllAtCommands(query).flatMap(part=>part.type==="atPath"&&part.content!=="@"?[part.content.substring(1)]:[])}__name(extractAtPathCommands,"extractAtPathCommands");function parseMcpResourceRef(pathName,mcpServerNames){const match=matchMcpServerPrefix(pathName,mcpServerNames);if(!match||!match.rest)return null;return{serverName:match.serverName,uri:match.rest}}__name(parseMcpResourceRef,"parseMcpResourceRef");async function resolveAtCommandQuery({query,config,onDebugMessage,messageId:userMessageTimestamp,signal}){const commandParts=parseAllAtCommands(query);const atPathCommandParts=commandParts.filter(part=>part.type==="atPath");if(atPathCommandParts.length===0){return{processedQuery:[{text:query}],shouldProceed:true}}const fileDiscovery=config.getFileService();const respectFileIgnore=config.getFileFilteringOptions();const configuredProjectTempDir=Storage.getGlobalTempDir();const projectTempDir=await fs.realpath(configuredProjectTempDir).catch(()=>path.resolve(configuredProjectTempDir));const pathSpecsToRead=[];const atPathToResolvedSpecMap=new Map;const contentLabelsForDisplay=[];const displayPaths=new Map;const displayPathsByCanonicalPath=new Map;const ignoredByReason={git:[],qwen:[],both:[]};const getIgnoreReason=__name(candidate=>{const gitIgnored=respectFileIgnore.respectGitIgnore&&fileDiscovery.shouldIgnoreFile(candidate,{respectGitIgnore:true,respectQwenIgnore:false});const qwenIgnored=respectFileIgnore.respectQwenIgnore&&fileDiscovery.shouldIgnoreFile(candidate,{respectGitIgnore:false,respectQwenIgnore:true});return gitIgnored&&qwenIgnored?"both":gitIgnored?"git":qwenIgnored?"qwen":void 0},"getIgnoreReason");const mcpServerNames=new Set(Object.keys(config.getMcpServers()||{}));const mcpResourceRefs=[];const mcpServerMentions=[];const activeExtensions=config.getActiveExtensions?.()??[];const extensionMentions=[];const sessionMentions=[];const urlMediaRefs=[];const rememberedMediaRefs=[];for(const atPathPart of atPathCommandParts){const originalAtPath=atPathPart.content;if(originalAtPath==="@"){onDebugMessage("Lone @ detected, will be treated as text in the modified query.");continue}const pathName=originalAtPath.substring(1);if(/^https?:\/\//i.test(pathName)&&config.isOmniEnabled?.()){const omni=await import("./omni-65LF5QK4.js");if(omni.isOmniDeliveryActive(config)&&omni.parseHttpUrlRef(pathName)){if(!urlMediaRefs.some(r=>r.url===pathName)){urlMediaRefs.push({originalAtPath,url:pathName})}atPathToResolvedSpecMap.set(originalAtPath,pathName);continue}}const extRef=parseExtensionRef(pathName);if(extRef){const extension=matchExtensionByRef(extRef.name,activeExtensions);if(extension){if(!extensionMentions.some(m=>m.extension.name===extension.name)){extensionMentions.push({originalAtPath,extension})}atPathToResolvedSpecMap.set(originalAtPath,pathName);continue}onDebugMessage(`Extension "${extRef.name}" not found among active extensions. Available: ${activeExtensions.map(e=>e.name).join(", ")||"(none)"}`);continue}const sessionRef=parseSessionRef(pathName);if(sessionRef){if(!sessionMentions.some(m=>(m.ref.id??m.ref.title)===(sessionRef.id??sessionRef.title))){sessionMentions.push({originalAtPath,ref:sessionRef})}atPathToResolvedSpecMap.set(originalAtPath,buildSessionRef(sessionRef.id??sessionRef.title));continue}const resourceRef=parseMcpResourceRef(pathName,mcpServerNames);if(resourceRef){mcpResourceRefs.push({originalAtPath,...resourceRef});atPathToResolvedSpecMap.set(originalAtPath,pathName);continue}const mcpServerRef=parseMcpServerRef(pathName);if(mcpServerRef){const matched=matchMcpServerByRef(mcpServerRef.name,config.getMcpServers()||{});if(matched){if(!mcpServerMentions.some(m=>m.serverName===matched.serverName)){mcpServerMentions.push({originalAtPath,serverName:matched.serverName})}atPathToResolvedSpecMap.set(originalAtPath,buildMcpServerRef(matched.serverName));continue}onDebugMessage(`MCP server "${mcpServerRef.name}" not found among configured MCP servers. Available: ${Object.keys(config.getMcpServers()||{}).join(", ")||"(none)"}`);continue}const workspaceContext=config.getWorkspaceContext();const absolutePathName=path.isAbsolute(pathName)?pathName:path.resolve(workspaceContext.getDirectories()[0]||"",pathName);if(!isSubpath(configuredProjectTempDir,absolutePathName)&&!isSubpath(projectTempDir,absolutePathName)&&!workspaceContext.isPathWithinWorkspace(pathName)){onDebugMessage(`Path ${pathName} is not in the workspace and will be skipped.`);continue}const ignoredReason=getIgnoreReason(pathName);if(ignoredReason){const reason=ignoredReason;ignoredByReason[reason].push(pathName);const reasonText=reason==="both"?"ignored by both git and qwen":reason==="git"?"git-ignored":"qwen-ignored";onDebugMessage(`Path ${pathName} is ${reasonText} and will be skipped.`);continue}let resolvedSuccessfully=false;let sawNotFound=false;let deferredIgnoreReason;for(const dir of config.getWorkspaceContext().getDirectories()){try{const absolutePath=path.resolve(dir,pathName);const canonicalPath=await fs.realpath(absolutePath);const stats=await fs.stat(canonicalPath);if(!isSubpath(configuredProjectTempDir,canonicalPath)&&!isSubpath(projectTempDir,canonicalPath)&&!workspaceContext.isPathWithinWorkspace(canonicalPath)){onDebugMessage(`Path ${pathName} is not in the workspace and will be skipped.`);continue}const canonicalIgnoreReason=getIgnoreReason(canonicalPath);if(canonicalIgnoreReason){deferredIgnoreReason=canonicalIgnoreReason;const reasonText=canonicalIgnoreReason==="both"?"ignored by both git and qwen":canonicalIgnoreReason==="git"?"git-ignored":"qwen-ignored";onDebugMessage(`Path ${pathName} is ${reasonText} and will be skipped.`);continue}if(stats.isDirectory()){onDebugMessage(`Path ${pathName} resolved to directory.`)}else{onDebugMessage(`Path ${pathName} resolved to file: ${absolutePath}`)}pathSpecsToRead.push(canonicalPath);atPathToResolvedSpecMap.set(originalAtPath,pathName);contentLabelsForDisplay.push(pathName);displayPaths.set(canonicalPath,pathName);const canonicalDisplays=displayPathsByCanonicalPath.get(canonicalPath)??new Set;canonicalDisplays.add(pathName);displayPathsByCanonicalPath.set(canonicalPath,canonicalDisplays);resolvedSuccessfully=true}catch(error){if(isNodeError(error)&&error.code==="ENOENT"){sawNotFound=true;continue}else{onDebugMessage(`Error stating path ${pathName}: ${getErrorMessage(error)}. Path ${pathName} will be skipped.`)}}if(resolvedSuccessfully){break}}if(!resolvedSuccessfully&&sawNotFound){let reanchored=false;if(config.isOmniEnabled?.()){const{reanchorRememberedMedia}=await import("./omni-65LF5QK4.js");for(const dir of config.getWorkspaceContext().getDirectories()){const anchor=await reanchorRememberedMedia(config,path.resolve(dir,pathName));if(!anchor)continue;rememberedMediaRefs.push({originalAtPath,pathName,annotation:anchor.annotation});atPathToResolvedSpecMap.set(originalAtPath,pathName);onDebugMessage(`Path ${pathName} is gone but remembered; re-anchored as ${anchor.resourceId} (bytes unavailable).`);reanchored=true;break}}if(!reanchored){onDebugMessage(`Path ${pathName} not found. Path ${pathName} will be skipped.`)}}if(!resolvedSuccessfully&&deferredIgnoreReason){ignoredByReason[deferredIgnoreReason].push(pathName)}}const buildInitialQueryText=__name(()=>{let text="";for(let i=0;i<commandParts.length;i++){const part=commandParts[i];if(part.type==="text"){text+=part.content}else{const resolvedSpec=atPathToResolvedSpecMap.get(part.content);if(i>0&&text.length>0&&!text.endsWith(" ")){const prevPart=commandParts[i-1];if(prevPart.type==="text"||prevPart.type==="atPath"){text+=" "}}if(resolvedSpec){text+=`@${resolvedSpec}`}else{if(i>0&&text.length>0&&!text.endsWith(" ")&&!part.content.startsWith(" ")){text+=" "}text+=part.content}}}return text.trim()},"buildInitialQueryText");let initialQueryText=buildInitialQueryText();const totalIgnored=ignoredByReason["git"].length+ignoredByReason["qwen"].length+ignoredByReason["both"].length;if(totalIgnored>0){const messages=[];if(ignoredByReason["git"].length){messages.push(`Git-ignored: ${ignoredByReason["git"].join(", ")}`)}if(ignoredByReason["qwen"].length){messages.push(`Qwen-ignored: ${ignoredByReason["qwen"].join(", ")}`)}if(ignoredByReason["both"].length){messages.push(`Ignored by both: ${ignoredByReason["both"].join(", ")}`)}const message=`Ignored ${totalIgnored} files:
4
+ ${messages.join("\n")}`;onDebugMessage(message)}const resourceReads=await Promise.allSettled(mcpResourceRefs.map(ref=>config.getToolRegistry().readMcpResource(ref.serverName,ref.uri,{signal})));const urlMediaParts=[];const urlMediaDisplays=[];const urlMediaLabels=[];if(urlMediaRefs.length>0){const core=await import("./omni-65LF5QK4.js");for(let i=0;i<urlMediaRefs.length;i++){const ref=urlMediaRefs[i];const callId=`client-url-media-${userMessageTimestamp}-${i}`;const hostLabel=(()=>{try{return new URL(ref.url).hostname}catch{return"invalid-url"}})();let tempPartPath;try{const store=new core.OmniObjectStore(config.storage.getQwenDir());const downloadsDir=path.join(store.getOmniRootDir(),"downloads");const downloaded=await core.downloadMediaUrl({url:ref.url,downloadsDir,maxBytes:core.effectiveMaxDownloadFileBytes(config),signal});tempPartPath=downloaded.partPath;const urlBase=path.basename(new URL(ref.url).pathname)||hostLabel;const modalities=config.getContentGeneratorConfig?.()?.modalities??{};const sniffedModality=await core.sniffFileModality(downloaded.partPath);if(sniffedModality&&!modalities[sniffedModality]){urlMediaDisplays.push({callId,name:"Fetch Media URL",description:`Download ${ref.url}`,status:"Error",resultDisplay:`Skipped ${urlBase}: the active model does not accept ${sniffedModality} input.`,confirmationDetails:void 0});continue}const delivery=await core.processMediaForOmniDelivery(downloaded.partPath,config,{signal,displayName:urlBase,sourceUrl:ref.url});const transcriptParts=core.buildTranscriptParts(urlBase,delivery.transcripts);const additionalParts=core.buildAdditionalMediaParts(urlBase,delivery.additionalMedia);const handleParts=delivery.resourceId?[{text:core.formatResourceHandleText(urlBase,delivery.resourceId)}]:[];if(delivery.omission){urlMediaParts.push(...handleParts);urlMediaParts.push({text:core.formatOmissionText(urlBase,delivery.omission.reason)});urlMediaParts.push(...additionalParts);urlMediaParts.push(...transcriptParts);urlMediaLabels.push(ref.url);urlMediaDisplays.push({callId,name:"Fetch Media URL",description:`Downloaded ${ref.url}`,status:"Success",resultDisplay:`Media omitted by the omni transport guard: ${urlBase}`,confirmationDetails:void 0});continue}if(!delivery.fileUri&&transcriptParts.length>0){urlMediaParts.push(...handleParts);if(delivery.disclosure){urlMediaParts.push({text:core.formatDisclosureText(urlBase,delivery.disclosure)})}urlMediaParts.push(...additionalParts);urlMediaParts.push(...transcriptParts);urlMediaLabels.push(ref.url);urlMediaDisplays.push({callId,name:"Fetch Media URL",description:`Downloaded ${ref.url}`,status:"Success",resultDisplay:`Localized ${urlBase} and delivered as transcript (omni policy).`,confirmationDetails:void 0});continue}urlMediaParts.push(...handleParts);if(delivery.disclosure){urlMediaParts.push({text:core.formatDisclosureText(urlBase,delivery.disclosure)})}urlMediaParts.push({fileData:{fileUri:delivery.fileUri,mimeType:delivery.mimeType,displayName:urlBase}});urlMediaParts.push(...additionalParts);urlMediaParts.push(...transcriptParts);urlMediaLabels.push(ref.url);urlMediaDisplays.push({callId,name:"Fetch Media URL",description:`Downloaded ${ref.url}`,status:"Success",resultDisplay:`Localized ${urlBase} (${delivery.recognized.modality}, ${(delivery.recognized.sizeBytes/1024/1024).toFixed(1)}MB) and delivered via omni upload${delivery.degraded?" (degraded by media policy)":""}.`,confirmationDetails:void 0})}catch(error){if(signal.aborted){if(tempPartPath){await fs.rm(tempPartPath,{force:true}).catch(()=>{})}return{processedQuery:null,shouldProceed:false,toolDisplays:[...urlMediaDisplays],filesRead:urlMediaLabels}}const reason=getErrorMessage(error);onDebugMessage(`Failed to localize media URL ${ref.url}: ${reason}`);urlMediaDisplays.push({callId,name:"Fetch Media URL",description:`Download ${ref.url}`,status:"Error",resultDisplay:`Failed to fetch media from ${hostLabel}: ${reason}`,confirmationDetails:void 0})}finally{if(tempPartPath){await fs.rm(tempPartPath,{force:true}).catch(()=>{})}}}}const resourceParts=[];const resourceDisplays=[];const resourceLabels=[];for(let i=0;i<mcpResourceRefs.length;i++){const ref=mcpResourceRefs[i];const label=`${ref.serverName}:${ref.uri}`;const callId=`client-mcp-resource-${userMessageTimestamp}-${i}`;const outcome=resourceReads[i];if(outcome.status==="rejected"){onDebugMessage(`Failed to read MCP resource ${label}: ${getErrorMessage(outcome.reason)}`);resourceDisplays.push({callId,name:"Read MCP Resource",description:`Read resource ${label}`,status:"Error",resultDisplay:`Failed to read resource ${label}: ${getErrorMessage(outcome.reason)}`,confirmationDetails:void 0});continue}const formatted=formatMcpResourceContents(outcome.value,label);if(formatted.parts.length>0){resourceParts.push(...formatted.parts)}else{resourceParts.push({text:emptyMcpResourceText(formatted,label)})}resourceLabels.push(label);resourceDisplays.push({callId,name:"Read MCP Resource",description:`Read resource ${label}`,status:"Success",resultDisplay:summarizeMcpResource(formatted),confirmationDetails:void 0})}if(pathSpecsToRead.length===0&&mcpResourceRefs.length===0&&mcpServerMentions.length===0&&extensionMentions.length===0&&sessionMentions.length===0&&urlMediaRefs.length===0){onDebugMessage("No valid file paths found in @ commands to read.");if(initialQueryText==="@"&&query.trim()==="@"){return{processedQuery:[{text:query}],shouldProceed:true}}else if(!initialQueryText&&query){return{processedQuery:[{text:query}],shouldProceed:true}}return{processedQuery:[{text:initialQueryText||query}],shouldProceed:true}}let extensionContextBudgetRemaining=EXTENSION_CONTEXT_BUDGET;const scopedMentionEntries=[];for(let i=0;i<extensionMentions.length;i++){const{originalAtPath,extension}=extensionMentions[i];const displayName=getSanitizedExtensionDisplayName(extension);const callId=`client-extension-${userMessageTimestamp}-${i}`;const context=await buildExtensionMentionContext(extension,{remainingBudget:extensionContextBudgetRemaining,signal,onDebugMessage});extensionContextBudgetRemaining=context.remainingBudget;scopedMentionEntries.push({originalAtPath,part:{text:context.text},label:buildExtensionRef(extension.name),display:{callId,name:"Activate Extension",description:`Activated extension ${displayName}`,status:"Success",resultDisplay:void 0,confirmationDetails:void 0}})}for(let i=0;i<mcpServerMentions.length;i++){const{originalAtPath,serverName}=mcpServerMentions[i];scopedMentionEntries.push({originalAtPath,part:{text:buildMcpServerContextText(config,serverName)},label:buildMcpServerRef(serverName),display:{callId:`client-mcp-server-${userMessageTimestamp}-${i}`,name:"Activate MCP Server",description:`Activated MCP server ${serverName}`,status:"Success",resultDisplay:void 0,confirmationDetails:void 0}})}const resolvedSessionIds=new Set;for(let i=0;i<sessionMentions.length;i++){const{originalAtPath,ref}=sessionMentions[i];const callId=`client-session-${userMessageTimestamp}-${i}`;let sessionId=ref.id;if(!sessionId&&ref.title){let matches=[];try{matches=await new SessionService(config.getProjectRoot()).findSessionsByTitle(ref.title)}catch(error){const reason=`Could not look up sessions matching "@${originalAtPath.substring(1)}" (${getErrorMessage(error)}); try a session id instead.`;onDebugMessage(reason);scopedMentionEntries.push({originalAtPath,part:{text:""},label:buildSessionRef(ref.title??originalAtPath),display:{callId,name:"Referenced Session",description:`Reference session "${ref.title??""}"`,status:"Error",resultDisplay:reason,confirmationDetails:void 0}});continue}if(matches.length===1){sessionId=matches[0].sessionId}else{const reason=matches.length===0?`No session matches "@${originalAtPath.substring(1)}".`:`"@${originalAtPath.substring(1)}" is ambiguous (${matches.length} matches); use the picker or a session id.`;onDebugMessage(reason);scopedMentionEntries.push({originalAtPath,part:{text:""},label:buildSessionRef(ref.title),display:{callId,name:"Referenced Session",description:`Reference session "${ref.title}"`,status:"Error",resultDisplay:reason,confirmationDetails:void 0}});continue}}if(!sessionId){const reason=`Session reference "@${originalAtPath.substring(1)}" could not be resolved.`;onDebugMessage(reason);scopedMentionEntries.push({originalAtPath,part:{text:""},label:buildSessionRef(ref.title??ref.id??originalAtPath),display:{callId,name:"Referenced Session",description:`Reference session "${ref.title??ref.id??""}"`,status:"Error",resultDisplay:reason,confirmationDetails:void 0}});continue}if(resolvedSessionIds.has(sessionId)){onDebugMessage(`Session reference "@${originalAtPath.substring(1)}" resolves to session ${sessionId}, which was already referenced; skipping duplicate.`);continue}resolvedSessionIds.add(sessionId);let resolved;try{resolved=await new SessionReferenceService(config.getProjectRoot()).resolve(sessionId,ref.title?{title:ref.title}:{})}catch(error){const reason=`Failed to load session "${sessionId}" (${getErrorMessage(error)}); the transcript may be corrupted or unreadable.`;onDebugMessage(reason);scopedMentionEntries.push({originalAtPath,part:{text:""},label:buildSessionRef(sessionId),display:{callId,name:"Referenced Session",description:`Reference session ${sessionId}`,status:"Error",resultDisplay:reason,confirmationDetails:void 0}});continue}if("notFound"in resolved){const reason=`Session "${sessionId}" not found in this project.`;onDebugMessage(reason);scopedMentionEntries.push({originalAtPath,part:{text:""},label:buildSessionRef(sessionId),display:{callId,name:"Referenced Session",description:`Reference session ${sessionId}`,status:"Error",resultDisplay:reason,confirmationDetails:void 0}});continue}scopedMentionEntries.push({originalAtPath,part:{text:resolved.text},label:buildSessionRef(sessionId),display:{callId,name:"Referenced Session",description:`Referenced session "${resolved.meta.title}"${resolved.truncated?" (truncated)":""}`,status:"Success",resultDisplay:void 0,confirmationDetails:void 0}})}const scopedMentionOrder=new Map(atPathCommandParts.map((part,index)=>[part.content,index]));scopedMentionEntries.sort((a,b)=>(scopedMentionOrder.get(a.originalAtPath)??Number.MAX_SAFE_INTEGER)-(scopedMentionOrder.get(b.originalAtPath)??Number.MAX_SAFE_INTEGER));const scopedMentionParts=scopedMentionEntries.map(entry=>entry.part);const scopedMentionLabels=scopedMentionEntries.map(entry=>entry.label);const scopedMentionDisplays=scopedMentionEntries.map(entry=>entry.display);const fileParts=[];let fileDisplays=[];const revalidatedPathSpecs=[];const revalidatedDisplayPaths=new Map;const validatedPathIdentities=new Map;const pruneSkippedPath=__name(approvedPath=>{const displayPath=displayPaths.get(approvedPath);const displayLabels=displayPathsByCanonicalPath.get(approvedPath)??new Set(displayPath?[displayPath]:[]);for(const[originalAtPath,resolvedSpec]of atPathToResolvedSpecMap){if(resolvedSpec===approvedPath||displayLabels.has(resolvedSpec)){atPathToResolvedSpecMap.delete(originalAtPath)}}for(let index=contentLabelsForDisplay.length-1;index>=0;index--){const label=contentLabelsForDisplay[index];if(label===approvedPath||displayLabels.has(label)){contentLabelsForDisplay.splice(index,1)}}},"pruneSkippedPath");for(const approvedPath of pathSpecsToRead){try{const currentPath=await fs.realpath(approvedPath);const stats=await fs.stat(currentPath);if(currentPath===approvedPath&&(stats.isFile()||stats.isDirectory())&&(isSubpath(configuredProjectTempDir,currentPath)||isSubpath(projectTempDir,currentPath)||config.getWorkspaceContext().isPathWithinWorkspace(currentPath))&&getIgnoreReason(currentPath)===void 0){revalidatedPathSpecs.push(currentPath);const displayPath=displayPaths.get(approvedPath);if(displayPath)revalidatedDisplayPaths.set(currentPath,displayPath);validatedPathIdentities.set(currentPath,{dev:stats.dev,ino:stats.ino})}else{pruneSkippedPath(approvedPath);onDebugMessage(`Path ${approvedPath} failed revalidation and will be skipped.`)}}catch{pruneSkippedPath(approvedPath);onDebugMessage(`Path ${approvedPath} changed before it could be read and will be skipped.`)}}initialQueryText=buildInitialQueryText();if(revalidatedPathSpecs.length>0){try{const result=await readManyFiles(config,{paths:revalidatedPathSpecs,signal,preserveUnsupportedImageForBridge:shouldRunVisionBridge(config),validatedPathIdentities,displayPaths:revalidatedDisplayPaths});const parts=Array.isArray(result.contentParts)?result.contentParts:[result.contentParts];fileDisplays=result.files.map((file,index)=>({callId:`client-read-${userMessageTimestamp}-${index}`,name:file.isDirectory?"Read Directory":"Read File",description:`@${path.basename(file.filePath)}`,status:file.error?"Error":"Success",resultDisplay:file.error?`Failed to read ${path.basename(file.filePath)}: ${file.error}`:void 0,confirmationDetails:void 0}));if(parts.length>0&&!result.error){for(const part of parts){fileParts.push(typeof part==="string"?{text:part}:part)}}else{onDebugMessage("readManyFiles returned no content or empty content.")}}catch(error){const errorToolCallDisplay={callId:`client-read-${userMessageTimestamp}`,name:"Read File(s)",description:"Error attempting to read files",status:"Error",resultDisplay:`Error reading files (${contentLabelsForDisplay.join(", ")}): ${getErrorMessage(error)}`,confirmationDetails:void 0};const errorMessage=typeof errorToolCallDisplay.resultDisplay==="string"?errorToolCallDisplay.resultDisplay:void 0;const labelsOnError=[...scopedMentionLabels,...contentLabelsForDisplay,...resourceLabels,...urlMediaLabels];return{processedQuery:null,shouldProceed:false,toolDisplays:[...scopedMentionDisplays,...resourceDisplays,...urlMediaDisplays,errorToolCallDisplay],filesRead:labelsOnError,recording:{filesRead:labelsOnError,status:"error",message:errorMessage}}}}const rememberedMediaParts=rememberedMediaRefs.flatMap(ref=>[{text:ref.annotation},{text:`\u3010\u5A92\u4F53\u7F3A\u5931\u3011${ref.pathName}\uFF1A\u6587\u4EF6\u5DF2\u4E0D\u5728\u78C1\u76D8\u4E0A\uFF0C\u65E0\u6CD5\u6295\u9012\u753B\u9762/\u97F3\u9891\u3002\u5176\u5904\u7406\u8BB0\u5FC6\u4ECD\u53EF\u7528\u2014\u2014\u7528\u4E0A\u9762\u7684\u53E5\u67C4\u8C03\u7528 omni_recall_media_memory \u53D6\u56DE\u3002`}]);const processedQueryParts=[{text:initialQueryText},...scopedMentionParts,...fileParts,...resourceParts,...urlMediaParts,...rememberedMediaParts];const allLabels=[...scopedMentionLabels,...contentLabelsForDisplay,...resourceLabels,...urlMediaLabels,...rememberedMediaRefs.map(ref=>`${ref.pathName} (\u8BB0\u5FC6)`)];return{processedQuery:processedQueryParts,shouldProceed:true,toolDisplays:[...scopedMentionDisplays,...fileDisplays,...resourceDisplays,...urlMediaDisplays],filesRead:allLabels,recording:{filesRead:allLabels,status:"success"}}}__name(resolveAtCommandQuery,"resolveAtCommandQuery");async function handleAtCommand(params){const result=await resolveAtCommandQuery(params);if(result.recording){const chatRecorder=params.config.getChatRecordingService?.();chatRecorder?.recordAtCommand({filesRead:result.recording.filesRead,status:result.recording.status,...result.recording.message?{message:result.recording.message}:{},userText:params.query})}if(params.addItem&&result.toolDisplays&&result.toolDisplays.length>0){const toolGroupItem={type:"tool_group",tools:result.toolDisplays};params.addItem(toolGroupItem,params.messageId)}return{processedQuery:result.processedQuery,shouldProceed:result.shouldProceed,toolDisplays:result.toolDisplays,filesRead:result.filesRead}}__name(handleAtCommand,"handleAtCommand");export{matchMcpServerPrefix,buildMcpResourceRef,MAX_SUGGESTIONS_TO_SHOW,MAX_SUGGESTION_LABEL_WIDTH,prepareSuggestionLabel,normalizeDescription,getExtensionSuggestions,SESSION_MENTION_PREFIX,buildSessionRef,parseMcpServerRef,buildMcpServerRef,matchMcpServerByRef,buildMcpServerContextText,extractAtPathCommands,resolveAtCommandQuery,handleAtCommand};
5
5
  /**
6
6
  * @license
7
7
  * Copyright 2025 Google LLC