@qwen-code/qwen-code 0.21.12-preview.4 → 0.21.12

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 (337) hide show
  1. package/bundled/qc-helper/docs/features/channels/overview.md +1 -1
  2. package/bundled/qc-helper/docs/features/channels/plugins.md +11 -11
  3. package/bundled/qc-helper/docs/qwen-serve.md +65 -0
  4. package/chunks/{MaxSizedBox-GFI5RYXH.js → MaxSizedBox-ZSJJ2D5S.js} +45 -45
  5. package/chunks/{StandaloneSessionPicker-JFWRY4V2.js → StandaloneSessionPicker-WHUHQXSA.js} +64 -65
  6. package/chunks/{acp-startup-profiler-TVI2OVUN.js → acp-startup-profiler-SVPUHLXV.js} +2 -2
  7. package/chunks/{acpAgent-7YC6SNIS.js → acpAgent-7JOAESF5.js} +378 -201
  8. package/chunks/{agent-43KVQSB5.js → agent-E6V3VXQR.js} +41 -41
  9. package/chunks/{agent-headless-P2N7PDGQ.js → agent-headless-OEQNFOMH.js} +41 -41
  10. package/chunks/{anthropicContentGenerator-ZBBX5VMY.js → anthropicContentGenerator-YDT4EOKO.js} +25 -25
  11. package/chunks/{artifact-tool-RWJAKYBZ.js → artifact-tool-4GCQQDZI.js} +5 -5
  12. package/chunks/{askUserQuestion-IQCA2SOX.js → askUserQuestion-HZJJLR3Z.js} +2 -2
  13. package/chunks/{bridge-ZBMNALLA.js → bridge-NPBV53UA.js} +47 -47
  14. package/chunks/{build-RZS65IIX.js → build-GDBLPA24.js} +1 -1
  15. package/chunks/{channel-management-service-5ZYX4ROW.js → channel-management-service-OADNGQM3.js} +4 -4
  16. package/chunks/{channel-settings-store-ZJWM7EDP.js → channel-settings-store-4ODLJ4X2.js} +48 -48
  17. package/chunks/{channel-worker-group-QFJKXO7R.js → channel-worker-group-IHBIHQ45.js} +7 -7
  18. package/chunks/{channel-worker-manager-PWD2UURZ.js → channel-worker-manager-GEHYJ5AE.js} +7 -7
  19. package/chunks/{channel-worker-supervisor-XQJBGFCM.js → channel-worker-supervisor-ZJIIWM4I.js} +5 -5
  20. package/chunks/{chunk-LHOG4E6Y.js → chunk-22C7BQ6D.js} +3 -3
  21. package/chunks/{chunk-2SB4SLKC.js → chunk-2IIJTXYF.js} +1 -3
  22. package/chunks/{chunk-QSMZHJ62.js → chunk-2IVYL3IF.js} +1 -1
  23. package/chunks/{chunk-QEWAHAW2.js → chunk-2ZWH53I4.js} +3 -3
  24. package/chunks/{chunk-6NQWER7D.js → chunk-36XKGB7E.js} +3 -3
  25. package/chunks/{chunk-7JL5YBSA.js → chunk-3AEKDXKT.js} +1 -1
  26. package/chunks/{chunk-H2U4FK62.js → chunk-3GDBZJD6.js} +6 -6
  27. package/chunks/{chunk-VPZMLGD3.js → chunk-3GM5DLBI.js} +5 -5
  28. package/chunks/{chunk-PYLVQ6RT.js → chunk-3LDGOQXZ.js} +6 -6
  29. package/chunks/{chunk-BKHCW2BI.js → chunk-3VUENPWF.js} +10 -0
  30. package/chunks/{chunk-XY7DGTIC.js → chunk-45NQKMYB.js} +1 -1
  31. package/chunks/{chunk-QWAI7FNT.js → chunk-47BGDLJG.js} +119 -27
  32. package/chunks/{chunk-H6BFLALJ.js → chunk-4AOVQPJU.js} +1 -1
  33. package/chunks/{chunk-UAAWNTOC.js → chunk-4KM2SYK5.js} +12 -12
  34. package/chunks/{chunk-VRQD5D7R.js → chunk-4XA4QIUA.js} +1 -1
  35. package/chunks/{chunk-BNRIQWXW.js → chunk-56HVDG3M.js} +4 -4
  36. package/chunks/{chunk-KB4ISUT3.js → chunk-5AFGJNY6.js} +4 -4
  37. package/chunks/{chunk-KTWUFHS4.js → chunk-5RUCD4ED.js} +2 -2
  38. package/chunks/{chunk-TB6DPBE4.js → chunk-62X3CM7Q.js} +7 -7
  39. package/chunks/{chunk-SNHBRO4C.js → chunk-63FNZTWG.js} +2 -2
  40. package/chunks/{chunk-GDNDZJSG.js → chunk-6JEIRPLN.js} +47 -4
  41. package/chunks/{chunk-A2QIWDFO.js → chunk-6P5EXEBL.js} +159 -34
  42. package/chunks/{chunk-NAOHSM56.js → chunk-6SPD4Z7F.js} +1 -1
  43. package/chunks/{chunk-MTV5W6WN.js → chunk-6ZKSO6K7.js} +7 -7
  44. package/chunks/{chunk-QSDPJROT.js → chunk-7KJPO7YH.js} +2 -2
  45. package/chunks/{chunk-JVY7FHUZ.js → chunk-7U5G6JXI.js} +9 -0
  46. package/chunks/{chunk-JW5UEE3V.js → chunk-A6NRNRKE.js} +1 -1
  47. package/chunks/{chunk-AAZWJAPQ.js → chunk-AKBFSOC5.js} +2 -2
  48. package/chunks/{chunk-ADJDLEVO.js → chunk-AW27A43Y.js} +9 -11
  49. package/chunks/{chunk-M4NWDIFU.js → chunk-AZQ3DT76.js} +1 -1
  50. package/chunks/{chunk-HY5OHJEC.js → chunk-B4VN3VDH.js} +5 -5
  51. package/chunks/{chunk-VUTOV2HG.js → chunk-BSR5AXZR.js} +4 -3
  52. package/chunks/{chunk-ARL4UGRW.js → chunk-BSSLSQEW.js} +3 -3
  53. package/chunks/{chunk-OSA2TFDI.js → chunk-CGM3E75C.js} +3 -3
  54. package/chunks/{chunk-OIZWCOYC.js → chunk-CIDQISGM.js} +5 -5
  55. package/chunks/{chunk-67F2BEYW.js → chunk-CPFFU46D.js} +1 -1
  56. package/chunks/{chunk-HOJZ2QQA.js → chunk-CQ6IPDQW.js} +3 -3
  57. package/chunks/{chunk-UWIJU22K.js → chunk-CZ4OWGQQ.js} +6 -8
  58. package/chunks/{chunk-A6GQUQ7I.js → chunk-D2RNVVH6.js} +2 -2
  59. package/chunks/{chunk-PSTHNTHF.js → chunk-D7QGE3RT.js} +1 -1
  60. package/chunks/{chunk-2U3UCXZ3.js → chunk-DAV4QFD5.js} +2 -11
  61. package/chunks/{chunk-4JS2QK7P.js → chunk-DD6O3ZRD.js} +1 -1
  62. package/chunks/{chunk-7WUMS2UA.js → chunk-DEDESZDL.js} +1 -1
  63. package/chunks/{chunk-VYDQD5J4.js → chunk-DFVXU5YM.js} +1 -1
  64. package/chunks/{chunk-CDDLHCC2.js → chunk-DG4IQ6JG.js} +5 -5
  65. package/chunks/{chunk-B66LYK4B.js → chunk-DPTMKFIH.js} +1 -1
  66. package/chunks/{chunk-GHOUZ5X4.js → chunk-EBPLKY6U.js} +384 -311
  67. package/chunks/{chunk-XL6GYJL2.js → chunk-EJOGLSNJ.js} +2 -2
  68. package/chunks/{chunk-4X5J3V2I.js → chunk-FA5K6YI2.js} +2 -2
  69. package/chunks/{chunk-ZZ7RUTJ4.js → chunk-FMIH5KMQ.js} +1 -1
  70. package/chunks/{chunk-UFHPAMAV.js → chunk-FQDCO3CJ.js} +6 -1
  71. package/chunks/{chunk-UHF5VBKO.js → chunk-FRHQQC2Z.js} +1 -1
  72. package/chunks/{chunk-6OJDN5ZT.js → chunk-G6MUFRNI.js} +1 -1
  73. package/chunks/{chunk-XUBM2A4F.js → chunk-GXTMEATA.js} +15 -34
  74. package/chunks/{chunk-V3NMFQD2.js → chunk-GZDWTBT3.js} +2 -2
  75. package/chunks/{chunk-5KZNWF2M.js → chunk-H7TMVHKE.js} +1 -1
  76. package/chunks/{chunk-YY23TR4M.js → chunk-HG3UBTJ4.js} +1 -1
  77. package/chunks/{chunk-YMB77M76.js → chunk-HOSVOUDK.js} +56 -0
  78. package/chunks/{chunk-NHZF4VCD.js → chunk-HTYND72J.js} +1 -1
  79. package/chunks/{chunk-JBZYGFIB.js → chunk-I7BT2MME.js} +1 -1
  80. package/chunks/{chunk-N3J3CO35.js → chunk-IH4Z54RJ.js} +7 -5
  81. package/chunks/{chunk-JXS2JNMZ.js → chunk-IRSLAS4M.js} +2 -2
  82. package/chunks/{chunk-CTEGMF77.js → chunk-IX4PWUDU.js} +155 -87
  83. package/chunks/{chunk-A4BAHMJF.js → chunk-JRIVMPD2.js} +3 -3
  84. package/chunks/{chunk-Q7YDKOGY.js → chunk-JVEGA3MM.js} +1 -1
  85. package/chunks/{chunk-U5C2GIN2.js → chunk-K34GJQOZ.js} +117 -3
  86. package/chunks/{chunk-YI5G32RU.js → chunk-KEC5FHLM.js} +3 -3
  87. package/chunks/{chunk-2RTRFLWH.js → chunk-KLOMACIR.js} +6 -6
  88. package/chunks/{chunk-XJ6IMYUS.js → chunk-KWX56CHZ.js} +7 -7
  89. package/chunks/{chunk-Y2HK3ELT.js → chunk-LCX5B364.js} +3 -3
  90. package/chunks/{chunk-JRTJEGSP.js → chunk-LSRI3ND3.js} +1 -1
  91. package/chunks/{chunk-T4G33L3W.js → chunk-LUISTZXI.js} +3 -3
  92. package/chunks/{chunk-Q7ALOKK7.js → chunk-MAKIANMX.js} +3 -3
  93. package/chunks/{chunk-QXFAQDBV.js → chunk-MDNUCDKZ.js} +2 -2
  94. package/chunks/{chunk-BXAGPCYH.js → chunk-MELQSJOU.js} +1 -1
  95. package/chunks/{chunk-B7IBCWDW.js → chunk-MUNA4QDC.js} +4 -4
  96. package/chunks/{chunk-3MJ44LNC.js → chunk-N4SVADAV.js} +264 -138
  97. package/chunks/{chunk-KK3FEHPJ.js → chunk-NLFLYSS4.js} +1 -1
  98. package/chunks/{chunk-UPUAGRKY.js → chunk-NW2GIPG3.js} +2 -4
  99. package/chunks/{chunk-LSMCI42W.js → chunk-NX4A23LY.js} +3 -3
  100. package/chunks/{chunk-TN3REXN4.js → chunk-OK47XBYH.js} +79 -36
  101. package/chunks/{chunk-L3YACXS2.js → chunk-OPVF453Q.js} +3 -3
  102. package/chunks/{chunk-NX5QZVRS.js → chunk-OR64CU46.js} +1 -1
  103. package/chunks/{chunk-JOVJCXN4.js → chunk-OWGRUU7F.js} +1 -1
  104. package/chunks/{chunk-V2U6FOJB.js → chunk-OWXFBIB6.js} +1 -1
  105. package/chunks/{chunk-6LDLDK6E.js → chunk-OYWVIXHT.js} +1 -3
  106. package/chunks/{chunk-V7RNNPGC.js → chunk-P5Y23G2L.js} +18 -1
  107. package/chunks/{chunk-32SNBMNP.js → chunk-PTSEETCO.js} +27 -27
  108. package/chunks/{chunk-C2DR57L6.js → chunk-PVXEJB66.js} +1 -1
  109. package/chunks/{chunk-O6SLWH4X.js → chunk-PZW46OTB.js} +2 -2
  110. package/chunks/{chunk-ECDXUCEO.js → chunk-Q4ZPYNIZ.js} +4 -4
  111. package/chunks/{chunk-QSWDGAIC.js → chunk-QILD6R27.js} +1 -1
  112. package/chunks/{chunk-6SU6OW5Z.js → chunk-QLTATTPS.js} +1 -1
  113. package/chunks/{chunk-NM33GGOM.js → chunk-QPBFRWCP.js} +3 -3
  114. package/chunks/{chunk-DUFZ3OW6.js → chunk-QSD4UH74.js} +842 -62
  115. package/chunks/{chunk-6T5HCY34.js → chunk-RDVNSJQU.js} +3 -3
  116. package/chunks/{chunk-3JI5D6RU.js → chunk-ROIJYS5K.js} +6 -6
  117. package/chunks/{chunk-WIHSDI6U.js → chunk-RQJA2YYO.js} +4 -4
  118. package/chunks/{chunk-JRMUA53D.js → chunk-S6TCTH4Z.js} +13 -13
  119. package/chunks/{chunk-FVHLDSQS.js → chunk-SYHXR6WM.js} +5 -5
  120. package/chunks/{chunk-FTGU6G45.js → chunk-TB4YFWXG.js} +2 -2
  121. package/chunks/{chunk-SFBRH5RY.js → chunk-TDESMS7M.js} +8 -8
  122. package/chunks/{chunk-EGB2PIYM.js → chunk-TMFWI4RC.js} +1 -1
  123. package/chunks/{chunk-2N6CV4PW.js → chunk-TQDFSQQF.js} +1 -1
  124. package/chunks/{chunk-TROB4PZY.js → chunk-TTRH3RTQ.js} +4 -4
  125. package/chunks/{chunk-E74YSVIN.js → chunk-TXP5NGG3.js} +1 -1
  126. package/chunks/{chunk-E3GLDLYB.js → chunk-TYAMGABM.js} +0 -6
  127. package/chunks/{chunk-APQTLUZ3.js → chunk-UI5UGEF4.js} +129 -8
  128. package/chunks/{chunk-TNETSI2A.js → chunk-ULNWG62W.js} +3 -3
  129. package/chunks/{chunk-FNVF5RR4.js → chunk-V6OBVAST.js} +1 -1
  130. package/chunks/{chunk-BGIKUE5J.js → chunk-VIFA5VJD.js} +1 -1
  131. package/chunks/{chunk-HWCHDINS.js → chunk-VLHR7F4E.js} +595 -58
  132. package/chunks/{chunk-SKRHR6N2.js → chunk-VPV7WBVT.js} +1 -1
  133. package/chunks/{chunk-FB5CQZMK.js → chunk-WCEI6J56.js} +1 -1
  134. package/chunks/{chunk-ORR5EFCL.js → chunk-WDVDVWJ3.js} +6 -6
  135. package/chunks/{chunk-B2BKFWJK.js → chunk-WI6GIM2M.js} +2 -2
  136. package/chunks/{chunk-N56NYJWY.js → chunk-WM3LUQLO.js} +7 -7
  137. package/chunks/{chunk-JGD35ZSJ.js → chunk-X5SLJOMF.js} +9 -7
  138. package/chunks/{chunk-Y5C24BUY.js → chunk-XAFIL4BD.js} +5 -5
  139. package/chunks/{chunk-IJCZP2MA.js → chunk-XDRXOSAD.js} +3 -3
  140. package/chunks/{chunk-FXWGMPAP.js → chunk-XH3KAV2G.js} +2 -2
  141. package/chunks/{chunk-NW7SPXVG.js → chunk-YBHUXEC6.js} +1 -1
  142. package/chunks/{chunk-2ASWIM4A.js → chunk-YBVVOSOH.js} +1 -1
  143. package/chunks/{chunk-62TIEFNN.js → chunk-YCHNAKC5.js} +16 -14
  144. package/chunks/{chunk-ZRT36RSF.js → chunk-YIGGWOJE.js} +1 -1
  145. package/chunks/{chunk-ZPZANKVP.js → chunk-YILJKX2T.js} +3 -3
  146. package/chunks/{chunk-Y2EOB7WZ.js → chunk-YX2RDGAL.js} +1 -1
  147. package/chunks/{chunk-UQPLUR4A.js → chunk-ZBB5EZZV.js} +2 -2
  148. package/chunks/{chunk-U7ROFHSH.js → chunk-ZLCT4C5A.js} +1 -1
  149. package/chunks/{chunk-ZA2JN5IZ.js → chunk-ZMY2P4L3.js} +3 -3
  150. package/chunks/{chunk-LIBTBTHP.js → chunk-ZQUY3ZJU.js} +4 -4
  151. package/chunks/{computer-use-J5VUY257.js → computer-use-F4URV4TU.js} +44 -44
  152. package/chunks/{config-utils-7JZQN6L2.js → config-utils-Z3OW3IQG.js} +4 -4
  153. package/chunks/{contextCommand-RCTGC36R.js → contextCommand-IGSS2U5J.js} +43 -43
  154. package/chunks/{core-runtime-REBZ5ZYE.js → core-runtime-H5CZDN3A.js} +41 -41
  155. package/chunks/{create-sub-session-TEEUROAZ.js → create-sub-session-PA7MFTHK.js} +41 -41
  156. package/chunks/{create-sub-session-23ULO5PO.js → create-sub-session-XT6DLYOE.js} +2 -2
  157. package/chunks/{cron-create-5WUTNKNF.js → cron-create-2JZ2TWTF.js} +4 -4
  158. package/chunks/{cron-delete-JEQ27YPS.js → cron-delete-CTPD2P26.js} +4 -4
  159. package/chunks/{cron-list-IXGCA7UR.js → cron-list-V44KHAF6.js} +4 -4
  160. package/chunks/{daemon-UBVOQMWY.js → daemon-GED37WOX.js} +28 -1
  161. package/chunks/daemon-git-worktree-guard-LZDCNJGV.js +2062 -0
  162. package/chunks/{daemon-status-provider-SV7KRLJ4.js → daemon-status-provider-QYM57Z44.js} +51 -52
  163. package/chunks/{daemon-trust-policy-LFUJ4NGF.js → daemon-trust-policy-TSRVEYZR.js} +47 -47
  164. package/chunks/{daemon-trust-policy-monitor-BQZ77NDD.js → daemon-trust-policy-monitor-2K2YETMT.js} +47 -47
  165. package/chunks/{deferred-core-runtime-F4XOQJQL.js → deferred-core-runtime-FKJ3OYE7.js} +43 -43
  166. package/chunks/{devtools-X6ROTKHE.js → devtools-4QFYJT6U.js} +1 -1
  167. package/chunks/{display-image-CAD7RAUM.js → display-image-M2ELAVN4.js} +4 -4
  168. package/chunks/{dist-B3ODKYEB.js → dist-4ZPG4BY6.js} +2 -2
  169. package/chunks/{dist-CCUH2Z4C.js → dist-BROOP2EG.js} +1 -1
  170. package/chunks/{dist-DANKRAB3.js → dist-IYYN3RUT.js} +2 -2
  171. package/chunks/{dist-5VDE7U3A.js → dist-JWMKPWT5.js} +3 -1
  172. package/chunks/{dist-6RK4U6VU.js → dist-K7IQB53U.js} +1 -1
  173. package/chunks/{dist-EZHCZSW6.js → dist-MAQXAQ2Y.js} +1 -1
  174. package/chunks/{dist-362MN6CP.js → dist-WJ4BHIEW.js} +2 -2
  175. package/chunks/{dist-M3XMEIP2.js → dist-YEPL4RAW.js} +1 -1
  176. package/chunks/{earlyInputCapture-JAJXDT2N.js → earlyInputCapture-WJBSJQUF.js} +42 -42
  177. package/chunks/{edit-OXBMFY5B.js → edit-X73LA4YO.js} +49 -48
  178. package/chunks/{enter-worktree-XS4JX4PO.js → enter-worktree-CLRQTIVN.js} +46 -46
  179. package/chunks/{enterPlanMode-J6PDPFFT.js → enterPlanMode-6BDYUQ5T.js} +47 -47
  180. package/chunks/{environment-BQW6FAZL.js → environment-WOAJXJDJ.js} +43 -43
  181. package/chunks/{errors-TMSN7AZN.js → errors-7OY5MXYY.js} +43 -43
  182. package/chunks/{exit-worktree-2RIE6DAO.js → exit-worktree-TFFJXCRT.js} +46 -46
  183. package/chunks/{exitPlanMode-QQL27HU4.js → exitPlanMode-WDURQMIU.js} +41 -41
  184. package/chunks/{external-tool-guard-provider-5HTGOPGU.js → external-tool-guard-provider-TE4DRY36.js} +1 -1
  185. package/chunks/{fast-path-TSGUVE5K.js → fast-path-QQLGC37M.js} +3 -3
  186. package/chunks/{gemini-RLTFENFV.js → gemini-VHE62IJL.js} +107 -102
  187. package/chunks/{geminiContentGenerator-B6W6PSO7.js → geminiContentGenerator-VSHIEGAQ.js} +11 -11
  188. package/chunks/{glob-JKVAHWL5.js → glob-VMEEDDLO.js} +48 -48
  189. package/chunks/{goal-tools-LQFO4BRY.js → goal-tools-M4UDAZXP.js} +4 -4
  190. package/chunks/{grep-6CN23ZPS.js → grep-F4UAR7KX.js} +46 -46
  191. package/chunks/{handleAutoUpdate-Y6BUNMBG.js → handleAutoUpdate-GN7Z6QAC.js} +45 -45
  192. package/chunks/{i18n-Y5PM6L5V.js → i18n-ETW24DHW.js} +42 -42
  193. package/chunks/{image-gen-DC2IQZ73.js → image-gen-YPK2AZT4.js} +11 -11
  194. package/chunks/{initializer-OYKKBNHO.js → initializer-UA6KQ7MS.js} +48 -48
  195. package/chunks/{installationInfo-63AFHLWA.js → installationInfo-P7OTIR4P.js} +42 -42
  196. package/chunks/{keychain-token-storage-GU75J2T2.js → keychain-token-storage-NKKCUHI2.js} +2 -2
  197. package/chunks/{list-KA63R3R6.js → list-GRAMIQOT.js} +50 -50
  198. package/chunks/{list-agents-5PNMK2AM.js → list-agents-O6WSY4CT.js} +2 -2
  199. package/chunks/{loadedSettingsAdapter-IGBJN7C5.js → loadedSettingsAdapter-5O2TDS3I.js} +47 -47
  200. package/chunks/{loggingContentGenerator-Z3NADCTQ.js → loggingContentGenerator-J2J2AANS.js} +54 -45
  201. package/chunks/{loop-wakeup-OV65FEGR.js → loop-wakeup-GVQRMUKS.js} +5 -5
  202. package/chunks/{ls-RPRSX26R.js → ls-6W2D7TKU.js} +6 -6
  203. package/chunks/{lsp-IWTJWFLT.js → lsp-NJ4KFBI2.js} +2 -2
  204. package/chunks/{managed-npm-update-HA262PFM.js → managed-npm-update-WMV5ITKU.js} +42 -42
  205. package/chunks/{mcp-T5ZUOKT3.js → mcp-XLP33CAI.js} +47 -47
  206. package/chunks/{monitor-SLGY7CYB.js → monitor-2MM23VDV.js} +46 -46
  207. package/chunks/{node-YSOU44FX.js → node-UUDY34IG.js} +3 -3
  208. package/chunks/nonInteractiveCli-KTA5K6FS.js +163 -0
  209. package/chunks/{notebook-edit-STSSB5KQ.js → notebook-edit-QD4TRKLY.js} +46 -46
  210. package/chunks/{openaiContentGenerator-OQED57JE.js → openaiContentGenerator-KLHSPVN2.js} +30 -30
  211. package/chunks/{pidfile-GES3MIHH.js → pidfile-RQGZBNXT.js} +42 -42
  212. package/chunks/{processUtils-FU6VMUOL.js → processUtils-HZZDA2VV.js} +2 -2
  213. package/chunks/{qwenContentGenerator-HWJSEGUL.js → qwenContentGenerator-T75M2Z3B.js} +49 -49
  214. package/chunks/{qwenOAuth2-PAIR7XEW.js → qwenOAuth2-5QZU444W.js} +10 -10
  215. package/chunks/{read-file-IYEBTQT5.js → read-file-LOVUSBJC.js} +11 -11
  216. package/chunks/{read-mcp-resource-THCSZHXO.js → read-mcp-resource-GWCP23WG.js} +2 -2
  217. package/chunks/{record-artifact-76YYQA5F.js → record-artifact-IYQDEYMV.js} +3 -3
  218. package/chunks/{resumeHistoryUtils-WP446RP5.js → resumeHistoryUtils-LVKSSQII.js} +49 -49
  219. package/chunks/{ripGrep-VV2CRCL2.js → ripGrep-ZJSHKB6H.js} +41 -41
  220. package/chunks/{run-qwen-serve-AHQCTALV.js → run-qwen-serve-GZW7B4WK.js} +68 -61
  221. package/chunks/{runtime-AUUZGDK6.js → runtime-MYRXEO2E.js} +52 -52
  222. package/chunks/{scheduler-Y4UPEURR.js → scheduler-DPTPI6FW.js} +43 -43
  223. package/chunks/{sdk-exporters-grpc-4QKV6MCX.js → sdk-exporters-grpc-54L4LS5L.js} +2 -2
  224. package/chunks/{sdk-exporters-http-A7XLKZO7.js → sdk-exporters-http-NHBYB5FZ.js} +12 -12
  225. package/chunks/{sdk-impl-XO4UF6PR.js → sdk-impl-SK4P5WON.js} +8 -8
  226. package/chunks/{send-message-P5SLP57G.js → send-message-O7FO63UK.js} +6 -6
  227. package/chunks/{serve-WI3SE4MY.js → serve-XCG4XCDA.js} +49 -49
  228. package/chunks/{server-G6JU6UWL.js → server-AWQHKXLG.js} +122 -117
  229. package/chunks/{session-2AO2UACB.js → session-P5FKNCNR.js} +91 -94
  230. package/chunks/{settings-3HRWSH66.js → settings-CSYVIP2R.js} +46 -46
  231. package/chunks/{shell-AR7XFLHA.js → shell-EGTSUO2P.js} +41 -41
  232. package/chunks/{skill-K6NOUUYM.js → skill-IFUD72GF.js} +21 -21
  233. package/chunks/{skill-settings-IOXQYS6X.js → skill-settings-YOE7LBHE.js} +46 -46
  234. package/chunks/{spawnChannel-V6P6HF4V.js → spawnChannel-PQSZIOLY.js} +44 -46
  235. package/chunks/{standalone-update-K5G3L2OJ.js → standalone-update-RB2EGUSF.js} +43 -43
  236. package/chunks/{startInteractiveUI-TRRP52QX.js → startInteractiveUI-KMYUJ2MU.js} +3036 -2405
  237. package/chunks/{syntheticOutput-SEW4NA47.js → syntheticOutput-DVHJMUGV.js} +3 -3
  238. package/chunks/{task-create-247EAVF7.js → task-create-4NC7PDI4.js} +11 -11
  239. package/chunks/{task-list-ZJN4QHLK.js → task-list-LBSRMOC7.js} +5 -5
  240. package/chunks/{task-stop-MAYQJ42I.js → task-stop-YFNATTIM.js} +2 -2
  241. package/chunks/{task-update-SU5TMZGG.js → task-update-BPLM52GD.js} +12 -12
  242. package/chunks/{team-create-IEEEBLE2.js → team-create-B6A6MJBT.js} +46 -46
  243. package/chunks/{team-delete-3XVRPQBP.js → team-delete-MKYMYBFM.js} +5 -5
  244. package/chunks/{team-plan-approval-SJGNS5JL.js → team-plan-approval-5WO3CXXU.js} +47 -47
  245. package/chunks/{terminal-image-renderer-C4RQMC67.js → terminal-image-renderer-BTRE2GEU.js} +43 -43
  246. package/chunks/{theme-manager-IKZQJQ6C.js → theme-manager-XL2N5SBY.js} +42 -42
  247. package/chunks/{todoWrite-IE2YTCK7.js → todoWrite-K5K7NRE5.js} +4 -4
  248. package/chunks/{tool-search-4UVNFYWU.js → tool-search-QNBLXUGR.js} +17 -17
  249. package/chunks/{total-session-admission-DIN6FTZP.js → total-session-admission-N4E5SFBO.js} +47 -47
  250. package/chunks/{trustedFolders-IAHOLV6A.js → trustedFolders-MQS46LIU.js} +42 -42
  251. package/chunks/{update-relaunch-5QSJ5CWP.js → update-relaunch-536KRL33.js} +5 -5
  252. package/chunks/{updateCheck-N4RT7HOZ.js → updateCheck-QJI2SYWF.js} +45 -45
  253. package/chunks/{useAutoAcceptIndicator-25T26VZS.js → useAutoAcceptIndicator-7QASHD46.js} +50 -50
  254. package/chunks/{validateNonInterActiveAuth-MCTVPLFE.js → validateNonInterActiveAuth-ZNRGWBLV.js} +83 -85
  255. package/chunks/{version-6PLZ7PCV.js → version-DBEQAFRW.js} +1 -1
  256. package/chunks/{web-fetch-5ANX6FSM.js → web-fetch-MBIVXKPE.js} +20 -20
  257. package/chunks/{web-search-KQJWWRHW.js → web-search-4LBIN6VF.js} +16 -16
  258. package/chunks/{workflow-C57ZKFUF.js → workflow-LNMA55HY.js} +54 -53
  259. package/chunks/{workspace-providers-status-3QAE4G4Y.js → workspace-providers-status-PDDMI6ST.js} +50 -50
  260. package/chunks/{workspace-registration-store-Q3J5LV6T.js → workspace-registration-store-BGRKKIYR.js} +1 -1
  261. package/chunks/{workspace-registry-DSJ5NAII.js → workspace-registry-L4NCJ34K.js} +47 -47
  262. package/chunks/{workspace-service-QW5LH7FA.js → workspace-service-LOXYKYTR.js} +53 -53
  263. package/chunks/{workspace-skills-status-N34ALJPZ.js → workspace-skills-status-IJ5FOQI6.js} +48 -48
  264. package/chunks/{workspace-trust-reconciler-YTOL7QEV.js → workspace-trust-reconciler-H36TCR2S.js} +55 -55
  265. package/chunks/{write-file-MSFRVUZB.js → write-file-JJAY7JSP.js} +41 -41
  266. package/chunks/{zoom-image-4TQA5GHG.js → zoom-image-4MVVVM7E.js} +11 -11
  267. package/cli.js +18 -17
  268. package/package.json +3 -3
  269. package/web-shell/assets/{arc-lZ04kynw.js → arc-B-89zHN4.js} +1 -1
  270. package/web-shell/assets/{architectureDiagram-3BPJPVTR-B1wZVhzD.js → architectureDiagram-3BPJPVTR-BkcOncHk.js} +1 -1
  271. package/web-shell/assets/{blockDiagram-GPEHLZMM-CO0e0yJt.js → blockDiagram-GPEHLZMM-DQ4yboaF.js} +1 -1
  272. package/web-shell/assets/{c4Diagram-AAUBKEIU-Dfpo6Qie.js → c4Diagram-AAUBKEIU-C_8ZjPDI.js} +1 -1
  273. package/web-shell/assets/channel-Du2WFns8.js +1 -0
  274. package/web-shell/assets/{chunk-2J33WTMH-BvxArftT.js → chunk-2J33WTMH-naKVe1Bm.js} +1 -1
  275. package/web-shell/assets/{chunk-4BX2VUAB-BS2XXjGY.js → chunk-4BX2VUAB-DdoViKT2.js} +1 -1
  276. package/web-shell/assets/{chunk-55IACEB6-CYL6h3Ph.js → chunk-55IACEB6-DUDQZEwU.js} +1 -1
  277. package/web-shell/assets/{chunk-727SXJPM-C-cWPX30.js → chunk-727SXJPM-BqpDTR5s.js} +1 -1
  278. package/web-shell/assets/{chunk-AQP2D5EJ-CJLxNbVV.js → chunk-AQP2D5EJ-CdmEknkT.js} +1 -1
  279. package/web-shell/assets/{chunk-FMBD7UC4-DwfzKywA.js → chunk-FMBD7UC4-CH7fFTLB.js} +1 -1
  280. package/web-shell/assets/{chunk-ND2GUHAM-BI5raYHQ.js → chunk-ND2GUHAM-ObgSuFKF.js} +1 -1
  281. package/web-shell/assets/{chunk-QZHKN3VN-_GkNI90J.js → chunk-QZHKN3VN-D9fKdv_s.js} +1 -1
  282. package/web-shell/assets/classDiagram-4FO5ZUOK-Zw0HafH6.js +1 -0
  283. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-Zw0HafH6.js +1 -0
  284. package/web-shell/assets/{cose-bilkent-S5V4N54A-BAVLNxh9.js → cose-bilkent-S5V4N54A-CvzATMx9.js} +1 -1
  285. package/web-shell/assets/{dagre-BM42HDAG-BD4XNLqp.js → dagre-BM42HDAG-M_xU21QW.js} +1 -1
  286. package/web-shell/assets/{diagram-2AECGRRQ-WO567p8w.js → diagram-2AECGRRQ-CNrl9sW1.js} +1 -1
  287. package/web-shell/assets/{diagram-5GNKFQAL-mAk23VWO.js → diagram-5GNKFQAL-CUweVT6T.js} +1 -1
  288. package/web-shell/assets/{diagram-KO2AKTUF-YQEeHKze.js → diagram-KO2AKTUF-D3n6Lxjo.js} +1 -1
  289. package/web-shell/assets/{diagram-LMA3HP47-CMVjxAjv.js → diagram-LMA3HP47-0SeFPK4t.js} +1 -1
  290. package/web-shell/assets/{diagram-OG6HWLK6-42hPvbM-.js → diagram-OG6HWLK6-DAgyEwge.js} +1 -1
  291. package/web-shell/assets/{erDiagram-TEJ5UH35-CXU_cPfu.js → erDiagram-TEJ5UH35-CzxBBDIK.js} +1 -1
  292. package/web-shell/assets/{flowDiagram-I6XJVG4X-D-3TdhMT.js → flowDiagram-I6XJVG4X-B0uj0jyo.js} +1 -1
  293. package/web-shell/assets/{ganttDiagram-6RSMTGT7-CsgkXolz.js → ganttDiagram-6RSMTGT7-DFzcj5km.js} +1 -1
  294. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-B6Q3PBLD.js → gitGraphDiagram-PVQCEYII-DylJ_Fc9.js} +1 -1
  295. package/web-shell/assets/index-BIGQygTL.css +5 -0
  296. package/web-shell/assets/{index-BFrkGj2B.js → index-BKSAnXU9.js} +1 -1
  297. package/web-shell/assets/index-J7OMTqAN.js +1789 -0
  298. package/web-shell/assets/{infoDiagram-5YYISTIA-jiAfSXp8.js → infoDiagram-5YYISTIA-BYMcJVMI.js} +1 -1
  299. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-BWif5KeJ.js → ishikawaDiagram-YF4QCWOH-t1quI1S3.js} +1 -1
  300. package/web-shell/assets/{journeyDiagram-JHISSGLW-B-GAZthS.js → journeyDiagram-JHISSGLW-YM_QVUJm.js} +1 -1
  301. package/web-shell/assets/{kanban-definition-UN3LZRKU-9TEuATdL.js → kanban-definition-UN3LZRKU-jw8OddK1.js} +1 -1
  302. package/web-shell/assets/{linear-dy_QPfyE.js → linear-Dlr3RVuP.js} +1 -1
  303. package/web-shell/assets/{mermaid.core-DB2uLAnq.js → mermaid.core-CqGKzNzd.js} +5 -5
  304. package/web-shell/assets/{mindmap-definition-RKZ34NQL-ey_dyxi-.js → mindmap-definition-RKZ34NQL-BqureoOS.js} +1 -1
  305. package/web-shell/assets/{pieDiagram-4H26LBE5-_6BuMdDj.js → pieDiagram-4H26LBE5-Da20HkK1.js} +1 -1
  306. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-B2rM19W2.js → quadrantDiagram-W4KKPZXB-BsNlMvJy.js} +1 -1
  307. package/web-shell/assets/{requirementDiagram-4Y6WPE33-DWj8b7vW.js → requirementDiagram-4Y6WPE33-DzVCQCse.js} +1 -1
  308. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-D5dtYh0N.js → sankeyDiagram-5OEKKPKP-BMo16voT.js} +1 -1
  309. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-DVkdn_qW.js → sequenceDiagram-3UESZ5HK-Bgi-pdHk.js} +1 -1
  310. package/web-shell/assets/{stateDiagram-AJRCARHV-DgwD_fi6.js → stateDiagram-AJRCARHV-xaPQXwGk.js} +1 -1
  311. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-D5RqimXD.js +1 -0
  312. package/web-shell/assets/{timeline-definition-PNZ67QCA-vNr_1UNX.js → timeline-definition-PNZ67QCA-C_9RuvKG.js} +1 -1
  313. package/web-shell/assets/{vennDiagram-CIIHVFJN-ChFcGAcu.js → vennDiagram-CIIHVFJN-Bgu6vdla.js} +1 -1
  314. package/web-shell/assets/{wardley-L42UT6IY-C8PXoSWk.js → wardley-L42UT6IY-CFTZ8IrX.js} +1 -1
  315. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-C2nqOV6i.js → wardleyDiagram-YWT4CUSO-BASW9Vmt.js} +1 -1
  316. package/web-shell/assets/{xychartDiagram-2RQKCTM6-BntaqhSB.js → xychartDiagram-2RQKCTM6--Nh-CD3F.js} +1 -1
  317. package/web-shell/index.html +2 -2
  318. package/chunks/chunk-CJNKGZLC.js +0 -649
  319. package/chunks/chunk-L34XSHIZ.js +0 -28
  320. package/chunks/chunk-MUN34TTF.js +0 -830
  321. package/chunks/chunk-N2TNM3QB.js +0 -9
  322. package/chunks/chunk-O4MVJKSX.js +0 -622
  323. package/chunks/chunk-WLML6VIA.js +0 -18
  324. package/chunks/chunk-ZBBVBZBR.js +0 -137
  325. package/chunks/chunk-bdqvmfwv-OHYAFAAO.js +0 -17446
  326. package/chunks/dispatch-FW7DX2CR.js +0 -43
  327. package/chunks/nonInteractiveCli-R5PK5B5G.js +0 -166
  328. package/chunks/opentui-entry-UTJ6MHDI.js +0 -52344
  329. package/chunks/runtime-gate-T4ICWGQJ.js +0 -89
  330. package/chunks/wrapper-46Z24CTM.js +0 -35
  331. package/web-shell/assets/channel-BxvRq3pV.js +0 -1
  332. package/web-shell/assets/classDiagram-4FO5ZUOK-tL8nAxYf.js +0 -1
  333. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-tL8nAxYf.js +0 -1
  334. package/web-shell/assets/index-BgjULKyF.css +0 -5
  335. package/web-shell/assets/index-CxXlPYfl.js +0 -1789
  336. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BWGkVGVB.js +0 -1
  337. /package/chunks/{chunk-44CTCCLY.js → chunk-NWNEANAT.js} +0 -0
@@ -20,11 +20,12 @@ import {
20
20
  import {
21
21
  createDebugLogger,
22
22
  getCurrentSessionId,
23
+ getErrorType,
23
24
  getSessionIdFromContext,
24
25
  setSessionContext,
25
26
  setSessionIdOnContext,
26
27
  setShellTracePropagation
27
- } from "./chunk-YMB77M76.js";
28
+ } from "./chunk-HOSVOUDK.js";
28
29
  import {
29
30
  DiagLogLevel,
30
31
  ROOT_CONTEXT,
@@ -765,6 +766,55 @@ function recordMemoryRecallDeliveryMetrics(config, latencyMs, attrs) {
765
766
  }
766
767
  __name(recordMemoryRecallDeliveryMetrics, "recordMemoryRecallDeliveryMetrics");
767
768
 
769
+ // packages/core/src/utils/textUtils.ts
770
+ init_esbuild_shims();
771
+ import { stripVTControlCharacters } from "node:util";
772
+ var CONTROL_CHARS_RE = /[\u0000-\u001f\u007f-\u009f]/g;
773
+ function stripAnsiAndControl(text) {
774
+ return stripVTControlCharacters(text).replace(CONTROL_CHARS_RE, "");
775
+ }
776
+ __name(stripAnsiAndControl, "stripAnsiAndControl");
777
+ function safeLiteralReplace(str, oldString, newString) {
778
+ if (oldString === "" || !str.includes(oldString)) {
779
+ return str;
780
+ }
781
+ if (!newString.includes("$")) {
782
+ return str.replaceAll(oldString, newString);
783
+ }
784
+ const escapedNewString = newString.replaceAll("$", "$$$$");
785
+ return str.replaceAll(oldString, escapedNewString);
786
+ }
787
+ __name(safeLiteralReplace, "safeLiteralReplace");
788
+ function isBinary(data, sampleSize = 512) {
789
+ if (!data) {
790
+ return false;
791
+ }
792
+ const sample = data.length > sampleSize ? data.subarray(0, sampleSize) : data;
793
+ for (const byte of sample) {
794
+ if (byte === 0) {
795
+ return true;
796
+ }
797
+ }
798
+ return false;
799
+ }
800
+ __name(isBinary, "isBinary");
801
+ function normalizeContent(content) {
802
+ let normalized = content.replace(/^\uFEFF/, "");
803
+ normalized = normalized.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
804
+ return normalized;
805
+ }
806
+ __name(normalizeContent, "normalizeContent");
807
+
808
+ // packages/core/src/extension/redaction.ts
809
+ init_esbuild_shims();
810
+ var REDACTED_URL_CREDENTIAL = "***REDACTED***";
811
+ var URL_CREDENTIALS_PATTERN = /\b([a-z][a-z0-9+.-]*:\/\/)(?:[^/\s]+@)+/gi;
812
+ var UPLOAD_IDENTITY_PATTERN = /\bupload:v1:[0-9a-fA-F-]+:/gu;
813
+ function redactUrlCredentials(source) {
814
+ return source.replace(UPLOAD_IDENTITY_PATTERN, "upload:").replace(URL_CREDENTIALS_PATTERN, `$1${REDACTED_URL_CREDENTIAL}@`);
815
+ }
816
+ __name(redactUrlCredentials, "redactUrlCredentials");
817
+
768
818
  // packages/core/src/telemetry/session-tracing.ts
769
819
  init_esbuild_shims();
770
820
  init_esm();
@@ -942,7 +992,7 @@ function initializeTelemetry(config) {
942
992
  telemetryInitPromise ??= (async () => {
943
993
  const debugLogger3 = createDebugLogger("OTEL");
944
994
  try {
945
- const { startTelemetrySdk } = await import("./sdk-impl-XO4UF6PR.js");
995
+ const { startTelemetrySdk } = await import("./sdk-impl-SK4P5WON.js");
946
996
  if (telemetryInitialized) return;
947
997
  const started = await startTelemetrySdk(config);
948
998
  if (!started) return;
@@ -993,7 +1043,7 @@ function shutdownTelemetry() {
993
1043
  telemetryShutdownPromise = void 0;
994
1044
  return;
995
1045
  }
996
- endInteractionSpan("cancelled");
1046
+ endAllInteractionSpans("cancelled");
997
1047
  const currentSessionId = getCurrentSessionId();
998
1048
  if (currentSessionId) {
999
1049
  emitSessionEnd(currentSessionId);
@@ -1087,6 +1137,7 @@ var NOOP_SPAN = trace.wrapSpanContext({
1087
1137
  var interactionContext = new AsyncLocalStorage();
1088
1138
  var toolContext = new AsyncLocalStorage();
1089
1139
  var subagentContext = new AsyncLocalStorage();
1140
+ var activeInteractionsByPromptId = /* @__PURE__ */ new Map();
1090
1141
  var interactionIdentityByPromptId = /* @__PURE__ */ new Map();
1091
1142
  function isInNativeSubagentSpan() {
1092
1143
  const ctx = subagentContext.getStore();
@@ -1109,7 +1160,6 @@ __name(resolveGenAiUserId, "resolveGenAiUserId");
1109
1160
  var activeSpans = /* @__PURE__ */ new Map();
1110
1161
  var strongSpans = /* @__PURE__ */ new Map();
1111
1162
  var interactionSequence = 0;
1112
- var lastInteractionCtx;
1113
1163
  var cleanupIntervalStarted = false;
1114
1164
  var SPAN_TTL_MS_DEFAULT = 30 * 60 * 1e3;
1115
1165
  var SPAN_TTL_MS_LONG = 4 * 60 * 60 * 1e3;
@@ -1129,7 +1179,7 @@ function ttlFor(ctx) {
1129
1179
  __name(ttlFor, "ttlFor");
1130
1180
  function sweepStaleSpans(now) {
1131
1181
  for (const [promptId, ctx] of interactionIdentityByPromptId) {
1132
- if (now - ctx.startTime >= SPAN_TTL_MS_DEFAULT) {
1182
+ if (now - ctx.lastActivityTime >= SPAN_TTL_MS_DEFAULT) {
1133
1183
  interactionIdentityByPromptId.delete(promptId);
1134
1184
  }
1135
1185
  }
@@ -1140,9 +1190,16 @@ function sweepStaleSpans(now) {
1140
1190
  strongSpans.delete(spanId);
1141
1191
  continue;
1142
1192
  }
1143
- if (now - ctx.startTime < ttlFor(ctx)) continue;
1193
+ const ttlReferenceTime = ctx.type === "interaction" ? ctx.lastActivityTime ?? ctx.startTime : ctx.startTime;
1194
+ if (now - ttlReferenceTime < ttlFor(ctx)) continue;
1144
1195
  if (!ctx.ended) {
1145
1196
  ctx.ended = true;
1197
+ if (ctx.type === "interaction") {
1198
+ const promptId = ctx.attributes["qwen-code.prompt_id"];
1199
+ if (typeof promptId === "string" && activeInteractionsByPromptId.get(promptId) === ctx) {
1200
+ activeInteractionsByPromptId.delete(promptId);
1201
+ }
1202
+ }
1146
1203
  const ageMs = now - ctx.startTime;
1147
1204
  const toolName = ctx.attributes["gen_ai.tool.name"] ?? ctx.attributes["tool.name"];
1148
1205
  const callId = ctx.attributes["tool.call_id"];
@@ -1211,55 +1268,146 @@ function truncateSpanText(s, maxChars = SPAN_TEXT_MAX_CHARS) {
1211
1268
  }
1212
1269
  __name(truncateSpanText, "truncateSpanText");
1213
1270
  function truncateSpanError(s) {
1214
- return truncateSpanText(s);
1271
+ return truncateSpanText(redactUrlCredentials(stripAnsiAndControl(s)));
1215
1272
  }
1216
1273
  __name(truncateSpanError, "truncateSpanError");
1217
1274
  function getTracer() {
1218
1275
  return trace.getTracer(SERVICE_NAME, "1.0.0");
1219
1276
  }
1220
1277
  __name(getTracer, "getTracer");
1221
- function startInteractionSpan(config, options) {
1222
- if (!isTelemetrySdkInitialized()) return;
1223
- ensureCleanupInterval();
1224
- interactionSequence++;
1278
+ function buildInteractionAttributes(config, options) {
1279
+ const sessionId = config.getSessionId();
1225
1280
  const userId = config.getTelemetryUserId();
1226
- const attributes = {
1227
- "session.id": config.getSessionId(),
1281
+ return {
1282
+ "session.id": sessionId,
1228
1283
  ...userId ? { "gen_ai.user.id": userId } : {},
1284
+ "gen_ai.operation.name": "invoke_agent",
1285
+ "gen_ai.agent.name": "qwen-code",
1286
+ "gen_ai.conversation.id": sessionId,
1287
+ ...config.getJsonSchema?.() ? { "gen_ai.output.type": "json" } : {},
1229
1288
  "qwen-code.prompt_id": options.promptId,
1230
1289
  "qwen-code.message_type": options.messageType,
1231
1290
  "qwen-code.model": options.model,
1232
1291
  "qwen-code.approval_mode": config.getApprovalMode(),
1233
1292
  "interaction.sequence": interactionSequence
1234
1293
  };
1294
+ }
1295
+ __name(buildInteractionAttributes, "buildInteractionAttributes");
1296
+ function finalizeInteractionContext(spanCtx, status, metadata) {
1297
+ if (spanCtx.ended) return;
1298
+ spanCtx.ended = true;
1299
+ const promptId = spanCtx.attributes["qwen-code.prompt_id"];
1300
+ if (typeof promptId === "string" && activeInteractionsByPromptId.get(promptId) === spanCtx) {
1301
+ activeInteractionsByPromptId.delete(promptId);
1302
+ const identity = interactionIdentityByPromptId.get(promptId);
1303
+ if (identity) identity.lastActivityTime = Date.now();
1304
+ }
1305
+ try {
1306
+ const duration = Date.now() - spanCtx.startTime;
1307
+ const attributes = {
1308
+ "interaction.duration_ms": duration,
1309
+ "qwen-code.turn_status": status
1310
+ };
1311
+ if (status === "error") {
1312
+ attributes["error.type"] = metadata?.errorType || "interaction_error";
1313
+ }
1314
+ spanCtx.span.setAttributes(attributes);
1315
+ if (status === "error") {
1316
+ spanCtx.span.setStatus({
1317
+ code: SpanStatusCode.ERROR,
1318
+ message: truncateSpanError(metadata?.errorMessage ?? "unknown error")
1319
+ });
1320
+ }
1321
+ } catch (error) {
1322
+ debugLogger2.warn(
1323
+ `Failed to update interaction span attributes/status: ${error instanceof Error ? error.message : String(error)}`
1324
+ );
1325
+ }
1326
+ try {
1327
+ spanCtx.span.end();
1328
+ } catch (error) {
1329
+ debugLogger2.warn(
1330
+ `Failed to end interaction span: ${error instanceof Error ? error.message : String(error)}`
1331
+ );
1332
+ }
1333
+ const spanId = getSpanId(spanCtx.span);
1334
+ activeSpans.delete(spanId);
1335
+ strongSpans.delete(spanId);
1336
+ }
1337
+ __name(finalizeInteractionContext, "finalizeInteractionContext");
1338
+ function registerInteractionContext(promptId, spanContextObj) {
1339
+ const existing = activeInteractionsByPromptId.get(promptId);
1340
+ if (existing && !existing.ended) {
1341
+ debugLogger2.warn(
1342
+ `Replacing unfinished interaction for promptId=${promptId}; ending the previous span as cancelled`
1343
+ );
1344
+ finalizeInteractionContext(existing, "cancelled", { promptId });
1345
+ }
1346
+ const spanId = getSpanId(spanContextObj.span);
1347
+ activeSpans.set(spanId, new WeakRef(spanContextObj));
1348
+ strongSpans.set(spanId, spanContextObj);
1349
+ activeInteractionsByPromptId.set(promptId, spanContextObj);
1350
+ const userId = spanContextObj.attributes["gen_ai.user.id"];
1351
+ if (typeof userId === "string" && userId) {
1352
+ interactionIdentityByPromptId.set(promptId, {
1353
+ lastActivityTime: spanContextObj.lastActivityTime ?? spanContextObj.startTime,
1354
+ attributes: { "gen_ai.user.id": userId }
1355
+ });
1356
+ } else {
1357
+ interactionIdentityByPromptId.delete(promptId);
1358
+ }
1359
+ }
1360
+ __name(registerInteractionContext, "registerInteractionContext");
1361
+ function getInteractionContext(promptId) {
1362
+ if (promptId !== void 0) {
1363
+ const exact = activeInteractionsByPromptId.get(promptId);
1364
+ return exact && !exact.ended ? exact : void 0;
1365
+ }
1366
+ const current = interactionContext.getStore();
1367
+ return current && !current.ended ? current : void 0;
1368
+ }
1369
+ __name(getInteractionContext, "getInteractionContext");
1370
+ function touchInteractionContext(spanCtx) {
1371
+ if (!spanCtx || spanCtx.type !== "interaction" || spanCtx.ended) return false;
1372
+ const promptId = spanCtx.attributes["qwen-code.prompt_id"];
1373
+ if (typeof promptId !== "string" || activeInteractionsByPromptId.get(promptId) !== spanCtx) {
1374
+ return false;
1375
+ }
1376
+ const now = Date.now();
1377
+ spanCtx.lastActivityTime = now;
1378
+ const identity = interactionIdentityByPromptId.get(promptId);
1379
+ if (identity) identity.lastActivityTime = now;
1380
+ return true;
1381
+ }
1382
+ __name(touchInteractionContext, "touchInteractionContext");
1383
+ function resolveGenAiParentContext(parent) {
1384
+ if (!parent && interactionContext.getStore()) return ROOT_CONTEXT;
1385
+ return resolveParentContext(parent);
1386
+ }
1387
+ __name(resolveGenAiParentContext, "resolveGenAiParentContext");
1388
+ function startInteractionSpan(config, options) {
1389
+ if (!isTelemetrySdkInitialized()) return;
1390
+ ensureCleanupInterval();
1391
+ interactionSequence++;
1392
+ const attributes = buildInteractionAttributes(config, options);
1235
1393
  const span = getTracer().startSpan(
1236
1394
  SPAN_INTERACTION,
1237
1395
  { kind: SpanKind.INTERNAL, attributes },
1238
1396
  ROOT_CONTEXT
1239
1397
  );
1240
- const spanId = getSpanId(span);
1241
1398
  const spanContextObj = {
1242
1399
  span,
1243
1400
  startTime: Date.now(),
1401
+ lastActivityTime: Date.now(),
1244
1402
  attributes,
1245
1403
  type: "interaction"
1246
1404
  };
1247
- activeSpans.set(spanId, new WeakRef(spanContextObj));
1248
- strongSpans.set(spanId, spanContextObj);
1249
- if (userId) {
1250
- interactionIdentityByPromptId.set(options.promptId, {
1251
- startTime: spanContextObj.startTime,
1252
- attributes: { "gen_ai.user.id": userId }
1253
- });
1254
- } else {
1255
- interactionIdentityByPromptId.delete(options.promptId);
1256
- }
1257
- lastInteractionCtx = spanContextObj;
1405
+ registerInteractionContext(options.promptId, spanContextObj);
1258
1406
  interactionContext.enterWith(spanContextObj);
1259
1407
  }
1260
1408
  __name(startInteractionSpan, "startInteractionSpan");
1261
1409
  function endInteractionSpan(status, metadata) {
1262
- const spanCtx = interactionContext.getStore() ?? lastInteractionCtx;
1410
+ const spanCtx = getInteractionContext(metadata?.promptId);
1263
1411
  if (!spanCtx) return;
1264
1412
  if (spanCtx.ended) {
1265
1413
  debugLogger2.debug(
@@ -1267,43 +1415,24 @@ function endInteractionSpan(status, metadata) {
1267
1415
  );
1268
1416
  return;
1269
1417
  }
1270
- spanCtx.ended = true;
1271
- lastInteractionCtx = void 0;
1272
- const duration = Date.now() - spanCtx.startTime;
1273
- spanCtx.span.setAttributes({
1274
- "interaction.duration_ms": duration,
1275
- "qwen-code.turn_status": status
1276
- });
1277
- if (status === "error") {
1278
- spanCtx.span.setStatus({
1279
- code: SpanStatusCode.ERROR,
1280
- message: metadata?.errorMessage ?? "unknown error"
1281
- });
1282
- } else {
1283
- spanCtx.span.setStatus({ code: SpanStatusCode.OK });
1418
+ const current = interactionContext.getStore();
1419
+ finalizeInteractionContext(spanCtx, status, metadata);
1420
+ if (current === spanCtx) interactionContext.enterWith(void 0);
1421
+ }
1422
+ __name(endInteractionSpan, "endInteractionSpan");
1423
+ function endAllInteractionSpans(status = "cancelled") {
1424
+ for (const spanCtx of [...activeInteractionsByPromptId.values()]) {
1425
+ finalizeInteractionContext(spanCtx, status);
1284
1426
  }
1285
- spanCtx.span.end();
1286
- const spanId = getSpanId(spanCtx.span);
1287
- activeSpans.delete(spanId);
1288
- strongSpans.delete(spanId);
1289
1427
  interactionContext.enterWith(void 0);
1290
1428
  }
1291
- __name(endInteractionSpan, "endInteractionSpan");
1429
+ __name(endAllInteractionSpans, "endAllInteractionSpans");
1292
1430
  async function withInteractionSpan(config, options, fn, getResultStatus) {
1293
1431
  if (!isTelemetrySdkInitialized()) return await fn();
1294
1432
  ensureCleanupInterval();
1295
1433
  interactionSequence++;
1296
1434
  const sessionId = config.getSessionId();
1297
- const userId = config.getTelemetryUserId();
1298
- const attributes = {
1299
- "session.id": sessionId,
1300
- ...userId ? { "gen_ai.user.id": userId } : {},
1301
- "qwen-code.prompt_id": options.promptId,
1302
- "qwen-code.message_type": options.messageType,
1303
- "qwen-code.model": options.model,
1304
- "qwen-code.approval_mode": config.getApprovalMode(),
1305
- "interaction.sequence": interactionSequence
1306
- };
1435
+ const attributes = buildInteractionAttributes(config, options);
1307
1436
  const parentContext = options.parentContext ?? ROOT_CONTEXT;
1308
1437
  const span = getTracer().startSpan(
1309
1438
  SPAN_INTERACTION,
@@ -1313,23 +1442,14 @@ async function withInteractionSpan(config, options, fn, getResultStatus) {
1313
1442
  },
1314
1443
  parentContext
1315
1444
  );
1316
- const spanId = getSpanId(span);
1317
1445
  const spanContextObj = {
1318
1446
  span,
1319
1447
  startTime: Date.now(),
1448
+ lastActivityTime: Date.now(),
1320
1449
  attributes,
1321
1450
  type: "interaction"
1322
1451
  };
1323
- activeSpans.set(spanId, new WeakRef(spanContextObj));
1324
- strongSpans.set(spanId, spanContextObj);
1325
- if (userId) {
1326
- interactionIdentityByPromptId.set(options.promptId, {
1327
- startTime: spanContextObj.startTime,
1328
- attributes: { "gen_ai.user.id": userId }
1329
- });
1330
- } else {
1331
- interactionIdentityByPromptId.delete(options.promptId);
1332
- }
1452
+ registerInteractionContext(options.promptId, spanContextObj);
1333
1453
  const activeContext = trace.setSpan(
1334
1454
  setSessionIdOnContext(parentContext, sessionId),
1335
1455
  span
@@ -1338,41 +1458,27 @@ async function withInteractionSpan(config, options, fn, getResultStatus) {
1338
1458
  activeContext,
1339
1459
  async () => interactionContext.run(spanContextObj, async () => {
1340
1460
  let terminalStatus = "ok";
1341
- let errorStatusSet = false;
1461
+ let errorMetadata;
1342
1462
  try {
1343
1463
  const result = await fn();
1344
1464
  terminalStatus = getResultStatus?.(result) ?? "ok";
1345
1465
  return result;
1346
1466
  } catch (error) {
1347
1467
  terminalStatus = "error";
1348
- span.setStatus({
1349
- code: SpanStatusCode.ERROR,
1350
- message: truncateSpanError(
1351
- error instanceof Error ? error.message : String(error)
1352
- )
1353
- });
1354
- errorStatusSet = true;
1468
+ errorMetadata = {
1469
+ promptId: options.promptId,
1470
+ errorMessage: error instanceof Error ? error.message : String(error),
1471
+ errorType: getErrorType(error)
1472
+ };
1355
1473
  throw error;
1356
1474
  } finally {
1357
- if (!spanContextObj.ended) {
1358
- spanContextObj.ended = true;
1359
- const duration = Date.now() - spanContextObj.startTime;
1360
- span.setAttributes({
1361
- "interaction.duration_ms": duration,
1362
- "qwen-code.turn_status": terminalStatus
1363
- });
1364
- if (terminalStatus === "ok") {
1365
- span.setStatus({ code: SpanStatusCode.OK });
1366
- } else if (terminalStatus === "error" && !errorStatusSet) {
1367
- span.setStatus({
1368
- code: SpanStatusCode.ERROR,
1369
- message: "interaction error"
1370
- });
1371
- }
1372
- span.end();
1373
- activeSpans.delete(spanId);
1374
- strongSpans.delete(spanId);
1375
- }
1475
+ finalizeInteractionContext(spanContextObj, terminalStatus, {
1476
+ promptId: options.promptId,
1477
+ ...terminalStatus === "error" && !errorMetadata ? {
1478
+ errorMessage: "interaction error",
1479
+ errorType: "interaction_error"
1480
+ } : errorMetadata
1481
+ });
1376
1482
  }
1377
1483
  })
1378
1484
  );
@@ -1385,25 +1491,18 @@ function startLLMRequestSpanWithContext(model, promptId, options) {
1385
1491
  context: trace.setSpan(context.active(), NOOP_SPAN)
1386
1492
  };
1387
1493
  }
1388
- const parentCtx = subagentContext.getStore() ?? interactionContext.getStore();
1389
- const identityParentCtx = subagentContext.getStore() ?? toolContext.getStore() ?? interactionContext.getStore();
1390
- const ctx = resolveParentContext(parentCtx);
1391
- const sessionId = resolveSessionId(
1392
- identityParentCtx,
1393
- options?.sessionId,
1394
- ctx
1395
- );
1396
- const userId = resolveGenAiUserId(
1397
- identityParentCtx,
1398
- promptId,
1399
- options?.userId
1400
- );
1494
+ const interactionParentCtx = getInteractionContext(promptId);
1495
+ touchInteractionContext(interactionParentCtx);
1496
+ const parentCtx = subagentContext.getStore() ?? toolContext.getStore() ?? interactionParentCtx;
1497
+ const ctx = resolveGenAiParentContext(parentCtx);
1498
+ const sessionId = resolveSessionId(parentCtx, options?.sessionId, ctx);
1499
+ const userId = resolveGenAiUserId(parentCtx, promptId, options?.userId);
1401
1500
  const attributes = {
1402
1501
  ...sessionId ? { "session.id": sessionId } : {},
1403
1502
  ...sessionId ? { "gen_ai.conversation.id": sessionId } : {},
1404
1503
  ...userId ? { "gen_ai.user.id": userId } : {},
1405
1504
  "qwen-code.prompt_id": promptId,
1406
- "llm_request.context": subagentContext.getStore() ? "subagent" : interactionContext.getStore() ? "interaction" : "standalone",
1505
+ "llm_request.context": parentCtx?.type === "subagent" ? "subagent" : interactionParentCtx ? "interaction" : "standalone",
1407
1506
  // Emit the version-pinned OTel GenAI semantic convention.
1408
1507
  "gen_ai.request.model": model,
1409
1508
  ...options?.operationName ? { "gen_ai.operation.name": options.operationName } : {},
@@ -1420,6 +1519,7 @@ function startLLMRequestSpanWithContext(model, promptId, options) {
1420
1519
  const spanContextObj = {
1421
1520
  span,
1422
1521
  startTime: Date.now(),
1522
+ ...interactionParentCtx ? { interactionOwner: interactionParentCtx } : {},
1423
1523
  attributes,
1424
1524
  type: "llm_request"
1425
1525
  };
@@ -1497,10 +1597,13 @@ function endLLMRequestSpan(span, metadata) {
1497
1597
  if (metadata.subagentName !== void 0) {
1498
1598
  endAttributes["subagent_name"] = metadata.subagentName;
1499
1599
  }
1500
- if (metadata.errorType !== void 0) {
1600
+ if (metadata.errorType && !metadata.cancelled) {
1501
1601
  endAttributes["error_type"] = metadata.errorType;
1502
1602
  endAttributes["error.type"] = metadata.errorType;
1503
1603
  }
1604
+ if (!metadata.success && !metadata.cancelled && endAttributes["error.type"] === void 0) {
1605
+ endAttributes["error.type"] = "llm_error";
1606
+ }
1504
1607
  if (metadata.errorStatusCode !== void 0) {
1505
1608
  endAttributes["error_status_code"] = metadata.errorStatusCode;
1506
1609
  }
@@ -1534,9 +1637,7 @@ function endLLMRequestSpan(span, metadata) {
1534
1637
  `Failed to record API request breakdown histogram: ${error instanceof Error ? error.message : String(error)}`
1535
1638
  );
1536
1639
  }
1537
- if (metadata === void 0 || metadata.success) {
1538
- spanCtx.span.setStatus({ code: SpanStatusCode.OK });
1539
- } else {
1640
+ if (metadata !== void 0 && !metadata.success && !metadata.cancelled) {
1540
1641
  spanCtx.span.setStatus({
1541
1642
  code: SpanStatusCode.ERROR,
1542
1643
  message: metadata.error ? truncateSpanError(metadata.error) : "unknown error"
@@ -1556,6 +1657,7 @@ function endLLMRequestSpan(span, metadata) {
1556
1657
  }
1557
1658
  activeSpans.delete(spanId);
1558
1659
  strongSpans.delete(spanId);
1660
+ touchInteractionContext(spanCtx.interactionOwner);
1559
1661
  }
1560
1662
  __name(endLLMRequestSpan, "endLLMRequestSpan");
1561
1663
  function startToolSpan(toolName, attrs, description, promptId) {
@@ -1564,11 +1666,13 @@ function startToolSpan(toolName, attrs, description, promptId) {
1564
1666
  }
1565
1667
  let span;
1566
1668
  try {
1567
- const parentCtx = subagentContext.getStore() ?? interactionContext.getStore();
1568
- const identityParentCtx = subagentContext.getStore() ?? toolContext.getStore() ?? interactionContext.getStore();
1569
- const ctx = resolveParentContext(parentCtx);
1570
- const sessionId = resolveSessionId(identityParentCtx);
1571
- const userId = resolveGenAiUserId(identityParentCtx, promptId);
1669
+ const interactionParentCtx = getInteractionContext(promptId);
1670
+ touchInteractionContext(interactionParentCtx);
1671
+ const parentCtx = subagentContext.getStore() ?? toolContext.getStore() ?? interactionParentCtx;
1672
+ const ctx = resolveGenAiParentContext(parentCtx);
1673
+ const sessionId = resolveSessionId(parentCtx, void 0, ctx);
1674
+ const userId = resolveGenAiUserId(parentCtx, promptId);
1675
+ const agentName = (subagentContext.getStore() ?? interactionParentCtx)?.attributes["gen_ai.agent.name"];
1572
1676
  const attributes = {
1573
1677
  ...sessionId ? { "session.id": sessionId } : {},
1574
1678
  ...attrs,
@@ -1576,6 +1680,7 @@ function startToolSpan(toolName, attrs, description, promptId) {
1576
1680
  "gen_ai.operation.name": "execute_tool",
1577
1681
  "gen_ai.tool.name": toolName,
1578
1682
  "gen_ai.tool.type": "function",
1683
+ ...typeof agentName === "string" ? { "gen_ai.agent.name": agentName } : {},
1579
1684
  ...description ? {
1580
1685
  "gen_ai.tool.description": truncateSpanText(
1581
1686
  description,
@@ -1583,6 +1688,9 @@ function startToolSpan(toolName, attrs, description, promptId) {
1583
1688
  )
1584
1689
  } : {}
1585
1690
  };
1691
+ if (typeof agentName !== "string") {
1692
+ delete attributes["gen_ai.agent.name"];
1693
+ }
1586
1694
  span = getTracer().startSpan(
1587
1695
  SPAN_TOOL,
1588
1696
  { kind: SpanKind.INTERNAL, attributes },
@@ -1592,6 +1700,7 @@ function startToolSpan(toolName, attrs, description, promptId) {
1592
1700
  const spanContextObj = {
1593
1701
  span,
1594
1702
  startTime: Date.now(),
1703
+ ...interactionParentCtx ? { interactionOwner: interactionParentCtx } : {},
1595
1704
  attributes,
1596
1705
  type: "tool"
1597
1706
  };
@@ -1642,17 +1751,16 @@ function endToolSpan(span, metadata) {
1642
1751
  }
1643
1752
  if (metadata.error !== void 0)
1644
1753
  endAttributes["error"] = truncateSpanError(metadata.error);
1754
+ if (metadata.success === false && !metadata.cancelled) {
1755
+ endAttributes["error.type"] = "tool_error";
1756
+ }
1645
1757
  if (metadata.cancelled) {
1646
1758
  endAttributes[TOOL_FAILURE_KIND_ATTRIBUTE] = TOOL_FAILURE_KIND_CANCELLED;
1647
1759
  }
1648
1760
  }
1649
1761
  spanCtx.span.setAttributes(endAttributes);
1650
1762
  if (metadata) {
1651
- if (metadata.cancelled) {
1652
- spanCtx.span.setStatus({ code: SpanStatusCode.UNSET });
1653
- } else if (metadata.success !== false) {
1654
- spanCtx.span.setStatus({ code: SpanStatusCode.OK });
1655
- } else {
1763
+ if (!metadata.cancelled && metadata.success === false) {
1656
1764
  spanCtx.span.setStatus({
1657
1765
  code: SpanStatusCode.ERROR,
1658
1766
  message: metadata.error ? truncateSpanError(metadata.error) : "tool error"
@@ -1673,6 +1781,7 @@ function endToolSpan(span, metadata) {
1673
1781
  }
1674
1782
  activeSpans.delete(spanId);
1675
1783
  strongSpans.delete(spanId);
1784
+ touchInteractionContext(spanCtx.interactionOwner);
1676
1785
  }
1677
1786
  __name(endToolSpan, "endToolSpan");
1678
1787
  function startToolExecutionSpan(options) {
@@ -1739,6 +1848,8 @@ function endToolExecutionSpan(span, metadata) {
1739
1848
  spanCtx.ended = true;
1740
1849
  try {
1741
1850
  const duration = Date.now() - spanCtx.startTime;
1851
+ const executionStatus = metadata?.executionStatus;
1852
+ const cancelled = metadata?.cancelled === true || executionStatus === "cancelled";
1742
1853
  const endAttributes = {};
1743
1854
  if (metadata?.attributes) {
1744
1855
  Object.assign(endAttributes, metadata.attributes);
@@ -1752,19 +1863,21 @@ function endToolExecutionSpan(span, metadata) {
1752
1863
  if (metadata.executionStatus !== void 0) {
1753
1864
  endAttributes["execution_status"] = metadata.executionStatus;
1754
1865
  }
1755
- if (metadata.errorType !== void 0) {
1866
+ if (metadata.errorType) {
1756
1867
  endAttributes["error_type"] = metadata.errorType;
1757
- endAttributes["error.type"] = metadata.errorType;
1868
+ if (!cancelled) {
1869
+ endAttributes["error.type"] = metadata.errorType;
1870
+ }
1871
+ }
1872
+ const failed = !cancelled && executionStatus !== "not_started" && (executionStatus === void 0 ? metadata.success === false : executionStatus !== "success");
1873
+ if (failed && endAttributes["error.type"] === void 0) {
1874
+ endAttributes["error.type"] = "tool_execution_error";
1758
1875
  }
1759
1876
  }
1760
1877
  spanCtx.span.setAttributes(endAttributes);
1761
- const executionStatus = metadata?.executionStatus;
1762
- const cancelled = metadata?.cancelled === true || executionStatus === "cancelled";
1763
1878
  if (metadata && !cancelled && executionStatus !== "not_started") {
1764
1879
  const succeeded = executionStatus === void 0 ? metadata.success !== false : executionStatus === "success";
1765
- if (succeeded) {
1766
- spanCtx.span.setStatus({ code: SpanStatusCode.OK });
1767
- } else {
1880
+ if (!succeeded) {
1768
1881
  spanCtx.span.setStatus({
1769
1882
  code: SpanStatusCode.ERROR,
1770
1883
  message: metadata.error ? truncateSpanError(metadata.error) : "tool execution error"
@@ -1865,6 +1978,7 @@ function startHookSpan(opts) {
1865
1978
  }
1866
1979
  ensureCleanupInterval();
1867
1980
  const parentCtx = toolContext.getStore() ?? subagentContext.getStore() ?? interactionContext.getStore() ?? void 0;
1981
+ touchInteractionContext(interactionContext.getStore());
1868
1982
  const ctx = resolveParentContext(parentCtx);
1869
1983
  const sessionId = resolveSessionId(parentCtx);
1870
1984
  const attributes = {
@@ -1884,6 +1998,7 @@ function startHookSpan(opts) {
1884
1998
  const spanContextObj = {
1885
1999
  span,
1886
2000
  startTime: Date.now(),
2001
+ ...interactionContext.getStore() ? { interactionOwner: interactionContext.getStore() } : {},
1887
2002
  attributes,
1888
2003
  type: "hook"
1889
2004
  };
@@ -1925,6 +2040,8 @@ function endHookSpan(span, metadata) {
1925
2040
  );
1926
2041
  if (metadata.error !== void 0)
1927
2042
  endAttributes["error"] = truncateSpanError(metadata.error);
2043
+ if (metadata.error !== void 0)
2044
+ endAttributes["error.type"] = "hook_error";
1928
2045
  }
1929
2046
  spanCtx.span.setAttributes(endAttributes);
1930
2047
  if (metadata?.error !== void 0) {
@@ -1947,6 +2064,7 @@ function endHookSpan(span, metadata) {
1947
2064
  }
1948
2065
  activeSpans.delete(spanId);
1949
2066
  strongSpans.delete(spanId);
2067
+ touchInteractionContext(spanCtx.interactionOwner);
1950
2068
  }
1951
2069
  __name(endHookSpan, "endHookSpan");
1952
2070
  function startSubagentSpan(opts) {
@@ -2062,17 +2180,15 @@ function endSubagentSpan(span, metadata) {
2062
2180
  if (metadata.resultSummaryPresent !== void 0) {
2063
2181
  endAttributes["qwen-code.subagent.result_summary_present"] = metadata.resultSummaryPresent;
2064
2182
  }
2065
- if (metadata.error !== void 0) {
2183
+ if (metadata.status === "failed" && metadata.error !== void 0) {
2066
2184
  const truncated = truncateSpanError(metadata.error);
2067
2185
  endAttributes["exception.message"] = truncated;
2068
2186
  }
2069
- if (metadata.errorType !== void 0) {
2070
- endAttributes["error.type"] = metadata.errorType;
2187
+ if (metadata.status === "failed") {
2188
+ endAttributes["error.type"] = metadata.errorType || "subagent_error";
2071
2189
  }
2072
2190
  spanCtx.span.setAttributes(endAttributes);
2073
- if (metadata.status === "completed") {
2074
- spanCtx.span.setStatus({ code: SpanStatusCode.OK });
2075
- } else if (metadata.status === "failed") {
2191
+ if (metadata.status === "failed") {
2076
2192
  spanCtx.span.setStatus({
2077
2193
  code: SpanStatusCode.ERROR,
2078
2194
  message: metadata.error ? truncateSpanError(metadata.error) : "subagent failed"
@@ -2094,12 +2210,16 @@ function endSubagentSpan(span, metadata) {
2094
2210
  strongSpans.delete(spanId);
2095
2211
  }
2096
2212
  __name(endSubagentSpan, "endSubagentSpan");
2097
- function getActiveInteractionSpan() {
2098
- const ctx = interactionContext.getStore() ?? lastInteractionCtx;
2099
- if (!ctx || ctx.ended) return void 0;
2100
- return ctx.span;
2213
+ function getActiveInteractionSpan(promptId) {
2214
+ return getInteractionContext(promptId)?.span;
2101
2215
  }
2102
2216
  __name(getActiveInteractionSpan, "getActiveInteractionSpan");
2217
+ function recordInteractionActivity(promptId, expectedOwner) {
2218
+ const spanCtx = getInteractionContext(promptId);
2219
+ if (!spanCtx || spanCtx.span !== expectedOwner) return false;
2220
+ return touchInteractionContext(spanCtx);
2221
+ }
2222
+ __name(recordInteractionActivity, "recordInteractionActivity");
2103
2223
 
2104
2224
  export {
2105
2225
  getMeter,
@@ -2133,6 +2253,11 @@ export {
2133
2253
  API_CALL_FAILED_SPAN_STATUS_MESSAGE,
2134
2254
  API_CALL_ABORTED_SPAN_STATUS_MESSAGE,
2135
2255
  safeSetStatus,
2256
+ stripAnsiAndControl,
2257
+ safeLiteralReplace,
2258
+ isBinary,
2259
+ normalizeContent,
2260
+ redactUrlCredentials,
2136
2261
  isInNativeSubagentSpan,
2137
2262
  truncateSpanError,
2138
2263
  startInteractionSpan,
@@ -2153,6 +2278,7 @@ export {
2153
2278
  runInSubagentSpanContext,
2154
2279
  endSubagentSpan,
2155
2280
  getActiveInteractionSpan,
2281
+ recordInteractionActivity,
2156
2282
  emitSessionStart,
2157
2283
  emitSessionEnd,
2158
2284
  isTelemetrySdkInitialized,