@qwen-code/qwen-code 0.21.12-preview.5 → 0.21.13

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 (347) hide show
  1. package/bundled/qc-helper/docs/configuration/settings.md +7 -5
  2. package/bundled/qc-helper/docs/features/channels/overview.md +1 -1
  3. package/bundled/qc-helper/docs/features/channels/plugins.md +11 -11
  4. package/bundled/qc-helper/docs/features/code-review.md +13 -12
  5. package/bundled/qc-helper/docs/qwen-serve.md +65 -0
  6. package/bundled/review/SKILL.md +96 -68
  7. package/chunks/{MaxSizedBox-6STELMXN.js → MaxSizedBox-UQALOVVT.js} +46 -46
  8. package/chunks/{StandaloneSessionPicker-LXMGCAIF.js → StandaloneSessionPicker-KEGXNUG6.js} +68 -69
  9. package/chunks/{acp-startup-profiler-TVI2OVUN.js → acp-startup-profiler-NMDXYGDN.js} +2 -2
  10. package/chunks/{acpAgent-NFRP4O5A.js → acpAgent-XPES32S7.js} +804 -380
  11. package/chunks/{agent-4AGYD6I6.js → agent-DPTOZFEM.js} +42 -42
  12. package/chunks/{agent-headless-GH4UIDXU.js → agent-headless-GJCQMURW.js} +42 -42
  13. package/chunks/{anthropicContentGenerator-ZBBX5VMY.js → anthropicContentGenerator-G7BVXTKN.js} +25 -25
  14. package/chunks/{artifact-tool-RWJAKYBZ.js → artifact-tool-GEXTOPVO.js} +5 -5
  15. package/chunks/{askUserQuestion-IQCA2SOX.js → askUserQuestion-B33XRSB7.js} +2 -2
  16. package/chunks/{bridge-3S4SKXSQ.js → bridge-YNQBAA4Z.js} +48 -48
  17. package/chunks/{build-RZS65IIX.js → build-GDBLPA24.js} +1 -1
  18. package/chunks/{channel-management-service-5ZYX4ROW.js → channel-management-service-GWY2GAIC.js} +4 -4
  19. package/chunks/{channel-settings-store-62E3TWVK.js → channel-settings-store-WNWYFHG7.js} +49 -49
  20. package/chunks/{channel-worker-group-QFJKXO7R.js → channel-worker-group-7LXCMZ77.js} +6 -6
  21. package/chunks/{channel-worker-manager-PWD2UURZ.js → channel-worker-manager-RYEME4ZZ.js} +6 -6
  22. package/chunks/{channel-worker-supervisor-XQJBGFCM.js → channel-worker-supervisor-OEVWBHGT.js} +4 -4
  23. package/chunks/{chunk-LHOG4E6Y.js → chunk-22C7BQ6D.js} +3 -3
  24. package/chunks/{chunk-KTWUFHS4.js → chunk-25EYDK42.js} +3 -3
  25. package/chunks/{chunk-QEWAHAW2.js → chunk-2B2BF7P7.js} +3 -3
  26. package/chunks/{chunk-2SB4SLKC.js → chunk-2IIJTXYF.js} +1 -3
  27. package/chunks/{chunk-6LDLDK6E.js → chunk-2M55OBEB.js} +1 -3
  28. package/chunks/{chunk-V3NMFQD2.js → chunk-3EZLLVDF.js} +2 -2
  29. package/chunks/{chunk-HUDUANHL.js → chunk-3U3VAL47.js} +1 -1
  30. package/chunks/{chunk-BKHCW2BI.js → chunk-3VUENPWF.js} +10 -0
  31. package/chunks/{chunk-XY7DGTIC.js → chunk-45NQKMYB.js} +1 -1
  32. package/chunks/{chunk-VGGNHRYZ.js → chunk-4PKCUT7F.js} +7 -7
  33. package/chunks/{chunk-T7YMWGFY.js → chunk-4S5337WV.js} +1491 -711
  34. package/chunks/{chunk-FVHLDSQS.js → chunk-4W5U2TUT.js} +3 -3
  35. package/chunks/{chunk-6SU6OW5Z.js → chunk-5CVO7YES.js} +1 -1
  36. package/chunks/{chunk-OZTGLK53.js → chunk-5EYKMUUY.js} +1 -1
  37. package/chunks/{chunk-ZRT36RSF.js → chunk-6HY6IF3Z.js} +1 -1
  38. package/chunks/{chunk-HRAFAUM7.js → chunk-6ORZ2EDC.js} +3 -3
  39. package/chunks/{chunk-JOVJCXN4.js → chunk-6QFDQMQX.js} +1 -1
  40. package/chunks/{chunk-CPTIJGUK.js → chunk-6YKYPVDV.js} +4 -4
  41. package/chunks/{chunk-62OKKUOX.js → chunk-76J3IJ3M.js} +9 -7
  42. package/chunks/{chunk-JVY7FHUZ.js → chunk-7U5G6JXI.js} +9 -0
  43. package/chunks/{chunk-TIM7NVEO.js → chunk-7UXUJ5T3.js} +1 -1
  44. package/chunks/{chunk-YCGXJ4Q3.js → chunk-A267JX7H.js} +6 -6
  45. package/chunks/{chunk-4JS2QK7P.js → chunk-A4MFR4C5.js} +1 -1
  46. package/chunks/{chunk-TN3REXN4.js → chunk-A4QRWUDE.js} +79 -36
  47. package/chunks/{chunk-JW5UEE3V.js → chunk-A6NRNRKE.js} +1 -1
  48. package/chunks/{chunk-T4G33L3W.js → chunk-AA2BEKV3.js} +3 -3
  49. package/chunks/{chunk-M3DWLXEO.js → chunk-AFSG32D5.js} +1 -1
  50. package/chunks/{chunk-R4YAQULI.js → chunk-AS5IN4GK.js} +5 -5
  51. package/chunks/{chunk-ADJDLEVO.js → chunk-AW27A43Y.js} +9 -11
  52. package/chunks/{chunk-RIDUB2GC.js → chunk-AW4TRXOC.js} +1 -1
  53. package/chunks/{chunk-XL6GYJL2.js → chunk-AXN7UPYQ.js} +2 -2
  54. package/chunks/{chunk-M4NWDIFU.js → chunk-AZQ3DT76.js} +1 -1
  55. package/chunks/{chunk-OSA2TFDI.js → chunk-BHILXOC3.js} +3 -3
  56. package/chunks/{chunk-YMIQ24FR.js → chunk-BKPPWD33.js} +2 -2
  57. package/chunks/{chunk-YMB77M76.js → chunk-BUQDLC2G.js} +59 -0
  58. package/chunks/{chunk-DXXYMK2U.js → chunk-BVJS5BSP.js} +1 -1
  59. package/chunks/{chunk-EGB2PIYM.js → chunk-BZ263IKX.js} +1 -1
  60. package/chunks/{chunk-6OJDN5ZT.js → chunk-CHHABXPE.js} +1 -1
  61. package/chunks/{chunk-ZPZANKVP.js → chunk-CKSJECTU.js} +4 -4
  62. package/chunks/{chunk-H6BFLALJ.js → chunk-CPHEPGAO.js} +1 -1
  63. package/chunks/{chunk-V6PERRH4.js → chunk-CU6GJD55.js} +1 -1
  64. package/chunks/{chunk-ZZ7RUTJ4.js → chunk-CZBYX5MY.js} +1 -1
  65. package/chunks/{chunk-2OFDCPMS.js → chunk-DGK6P3BQ.js} +13 -13
  66. package/chunks/{chunk-NM33GGOM.js → chunk-DGZEMW5R.js} +3 -3
  67. package/chunks/{chunk-UPUAGRKY.js → chunk-DXIBNLBZ.js} +2 -4
  68. package/chunks/{chunk-J5SUM3ZJ.js → chunk-E23IPNGS.js} +25 -2
  69. package/chunks/{chunk-TNETSI2A.js → chunk-E3DYKPYZ.js} +3 -3
  70. package/chunks/{chunk-3MJ44LNC.js → chunk-EL5SXY3T.js} +265 -138
  71. package/chunks/{chunk-AFKOAHC3.js → chunk-EZ5RP345.js} +13 -11
  72. package/chunks/{chunk-PSTHNTHF.js → chunk-FAAUPSY2.js} +1 -1
  73. package/chunks/{chunk-NW7SPXVG.js → chunk-FDGGZIYW.js} +1 -1
  74. package/chunks/{chunk-6YSSQFHQ.js → chunk-GGDBMYGZ.js} +5 -5
  75. package/chunks/{chunk-CDDLHCC2.js → chunk-GMIEIY3Y.js} +5 -5
  76. package/chunks/{chunk-6JFPUJ2O.js → chunk-GO7STP6N.js} +4 -4
  77. package/chunks/{chunk-7JL5YBSA.js → chunk-H4A72DE5.js} +1 -1
  78. package/chunks/{chunk-I3UEXUWJ.js → chunk-HUTNYWBG.js} +2 -2
  79. package/chunks/{chunk-UQPLUR4A.js → chunk-IA2K2HJE.js} +2 -2
  80. package/chunks/{chunk-Q7VJUIIB.js → chunk-IGGGG5CX.js} +4104 -1293
  81. package/chunks/{chunk-VE2UV7IN.js → chunk-IWPYVAO2.js} +4 -4
  82. package/chunks/{chunk-HAR4G5K2.js → chunk-JNDY2MDR.js} +2 -2
  83. package/chunks/{chunk-UALXTL5Y.js → chunk-JOOFMXGF.js} +6 -6
  84. package/chunks/{chunk-HOXEJHJQ.js → chunk-JUEPY766.js} +3 -3
  85. package/chunks/{chunk-Q7YDKOGY.js → chunk-JVEGA3MM.js} +1 -1
  86. package/chunks/{chunk-QBJYSIQ4.js → chunk-K3LPAED5.js} +53 -12
  87. package/chunks/{chunk-UHF5VBKO.js → chunk-KBXKR5R2.js} +1 -1
  88. package/chunks/{chunk-32SNBMNP.js → chunk-KD5BOPLP.js} +27 -27
  89. package/chunks/{chunk-67F2BEYW.js → chunk-KV27IEHM.js} +1 -1
  90. package/chunks/{chunk-DLDVO2NY.js → chunk-LJQAUZMR.js} +360 -174
  91. package/chunks/{chunk-BNRIQWXW.js → chunk-M732YJPW.js} +7 -7
  92. package/chunks/{chunk-JRTJEGSP.js → chunk-MA2HEDVP.js} +1 -1
  93. package/chunks/{chunk-5IW3FJGD.js → chunk-MC4TLKEI.js} +2 -2
  94. package/chunks/{chunk-2ASWIM4A.js → chunk-MIPFDQAF.js} +1 -1
  95. package/chunks/{chunk-6GTKI2YX.js → chunk-MLPXSYXR.js} +133 -28
  96. package/chunks/{chunk-KRXPRVGL.js → chunk-MLXTMF7H.js} +0 -1
  97. package/chunks/{chunk-NNGCKJAD.js → chunk-MRMJCLIY.js} +3 -3
  98. package/chunks/{chunk-E7XJWIWC.js → chunk-N5YPT6PH.js} +7 -7
  99. package/chunks/{chunk-72SKJ3E7.js → chunk-NEFOOD54.js} +3 -3
  100. package/chunks/{chunk-2U3UCXZ3.js → chunk-NHDR76JX.js} +45 -13
  101. package/chunks/{chunk-QLFTWYTO.js → chunk-NM5V5OVW.js} +3 -3
  102. package/chunks/{chunk-N4LVA3S6.js → chunk-NNHNLJ2X.js} +840 -60
  103. package/chunks/chunk-NYWWQ437.js +24 -0
  104. package/chunks/{chunk-DGNQ5AFX.js → chunk-O4D7SPJN.js} +2 -2
  105. package/chunks/{chunk-YY23TR4M.js → chunk-O565M6A4.js} +411 -10
  106. package/chunks/{chunk-VUTOV2HG.js → chunk-OD2WU5QY.js} +4 -3
  107. package/chunks/{chunk-B66LYK4B.js → chunk-OMLJNPBE.js} +42 -12
  108. package/chunks/{chunk-WAF6AR5Y.js → chunk-OOQUVWIG.js} +4 -4
  109. package/chunks/{chunk-A6GQUQ7I.js → chunk-OVZPVYZB.js} +2 -2
  110. package/chunks/{chunk-VPZMLGD3.js → chunk-OXCMMLED.js} +5 -5
  111. package/chunks/{chunk-646ZB2TS.js → chunk-OY5RNSV4.js} +3 -3
  112. package/chunks/{chunk-V7RNNPGC.js → chunk-P5Y23G2L.js} +18 -1
  113. package/chunks/{chunk-O6SLWH4X.js → chunk-P7MPQI75.js} +2 -2
  114. package/chunks/{chunk-3HXLH5QV.js → chunk-PP4FUZNV.js} +47 -4
  115. package/chunks/{chunk-4XX2LZ3E.js → chunk-PQ36L4F5.js} +1 -1
  116. package/chunks/{chunk-SKRHR6N2.js → chunk-PT4I7NBA.js} +1 -1
  117. package/chunks/{chunk-KQLW7LLV.js → chunk-QF2NHSPB.js} +603 -66
  118. package/chunks/{chunk-KK3FEHPJ.js → chunk-QFJ5JHQR.js} +1 -1
  119. package/chunks/{chunk-N2G4RA77.js → chunk-QIH2HAEN.js} +1 -1
  120. package/chunks/{chunk-QSWDGAIC.js → chunk-QILD6R27.js} +1 -1
  121. package/chunks/{chunk-NHZF4VCD.js → chunk-QNQAPSN2.js} +1 -1
  122. package/chunks/{chunk-6DH5YA3X.js → chunk-QRCNA3SR.js} +8 -8
  123. package/chunks/{chunk-3RC5Q66G.js → chunk-QV5YN5YD.js} +7 -5
  124. package/chunks/{chunk-7TKNMQ6L.js → chunk-RIAABG2K.js} +2 -2
  125. package/chunks/{chunk-LYRA6ZTI.js → chunk-RLKC46YT.js} +138 -11
  126. package/chunks/{chunk-YI5G32RU.js → chunk-ROIYNTHJ.js} +3 -3
  127. package/chunks/{chunk-UAAWNTOC.js → chunk-RVOJ2FBP.js} +12 -12
  128. package/chunks/{chunk-SNHBRO4C.js → chunk-RWDNJBWN.js} +2 -2
  129. package/chunks/{chunk-UFHPAMAV.js → chunk-S5DWMTHO.js} +11 -1
  130. package/chunks/{chunk-TROB4PZY.js → chunk-SG7ZP5PG.js} +4 -4
  131. package/chunks/{chunk-E74YSVIN.js → chunk-SXCOEJO4.js} +1 -1
  132. package/chunks/{chunk-U5C2GIN2.js → chunk-TIGA2IVL.js} +117 -3
  133. package/chunks/chunk-TS6625XH.js +488 -0
  134. package/chunks/{chunk-EHXS5MAC.js → chunk-TUGSVUJB.js} +7 -7
  135. package/chunks/{chunk-E3GLDLYB.js → chunk-TYAMGABM.js} +0 -6
  136. package/chunks/{chunk-ZLX7FTZQ.js → chunk-U3VNBPUO.js} +3 -3
  137. package/chunks/{chunk-F7PTQFTB.js → chunk-UKMR3CKV.js} +4 -4
  138. package/chunks/{chunk-7WUMS2UA.js → chunk-UPDOZBWO.js} +1 -1
  139. package/chunks/{chunk-YK4O72LT.js → chunk-UZPM4XHR.js} +4 -4
  140. package/chunks/{chunk-VKEA37IR.js → chunk-V26NVGAU.js} +1 -1
  141. package/chunks/{chunk-IJCZP2MA.js → chunk-V57QC6WW.js} +3 -3
  142. package/chunks/{chunk-LSMCI42W.js → chunk-WFSTRPRO.js} +3 -3
  143. package/chunks/{chunk-5KZNWF2M.js → chunk-WGHHA7ZH.js} +1 -1
  144. package/chunks/{chunk-A4BAHMJF.js → chunk-WSH6GRKG.js} +4 -4
  145. package/chunks/{chunk-OK727E5D.js → chunk-X26JYGTD.js} +1 -1
  146. package/chunks/{chunk-VAPNUDD5.js → chunk-XHRY7BXD.js} +4 -4
  147. package/chunks/{chunk-XNL23MGG.js → chunk-XIT3GURH.js} +3 -3
  148. package/chunks/{chunk-2RTRFLWH.js → chunk-XLLKYULU.js} +6 -6
  149. package/chunks/{chunk-C2DR57L6.js → chunk-XUJNK7Y6.js} +1 -1
  150. package/chunks/{chunk-AAZWJAPQ.js → chunk-Y3YCSWG5.js} +2 -2
  151. package/chunks/{chunk-ZTBFA7I6.js → chunk-YEYY7TEP.js} +7 -7
  152. package/chunks/{chunk-FTGU6G45.js → chunk-YZHRN3CF.js} +2 -2
  153. package/chunks/{chunk-2N6CV4PW.js → chunk-YZOSNW4R.js} +1 -1
  154. package/chunks/{chunk-U7ROFHSH.js → chunk-ZLCT4C5A.js} +1 -1
  155. package/chunks/{chunk-VBKTP7TH.js → chunk-ZYBBISBY.js} +15 -34
  156. package/chunks/{chunk-7ATQGA6V.js → chunk-ZYYTZUI2.js} +6 -6
  157. package/chunks/{chunk-RXX5T3IF.js → chunk-ZZO74WKW.js} +44 -8
  158. package/chunks/{computer-use-ZFBJYSR3.js → computer-use-77C5FHMW.js} +45 -45
  159. package/chunks/{config-utils-7JZQN6L2.js → config-utils-IVHRSXWI.js} +4 -4
  160. package/chunks/{contextCommand-G3TAIY7T.js → contextCommand-PJ77GBWL.js} +44 -44
  161. package/chunks/{core-runtime-K3MQVNSF.js → core-runtime-7VMIKUTG.js} +42 -42
  162. package/chunks/{create-sub-session-DMTLJPDG.js → create-sub-session-2L5MQRN4.js} +42 -42
  163. package/chunks/{create-sub-session-23ULO5PO.js → create-sub-session-KRQULJE6.js} +2 -2
  164. package/chunks/{cron-create-5WUTNKNF.js → cron-create-H7UEPDSN.js} +4 -4
  165. package/chunks/{cron-delete-JEQ27YPS.js → cron-delete-6SZK7YFM.js} +4 -4
  166. package/chunks/{cron-list-IXGCA7UR.js → cron-list-H25JIHEZ.js} +4 -4
  167. package/chunks/{daemon-UBVOQMWY.js → daemon-2KTG7ZBN.js} +108 -9
  168. package/chunks/daemon-git-worktree-guard-DXYIMWFT.js +2062 -0
  169. package/chunks/{daemon-status-provider-KFLEZGD7.js → daemon-status-provider-ZDOYJCU6.js} +52 -53
  170. package/chunks/{daemon-trust-policy-ZZ6DRDAC.js → daemon-trust-policy-E67OYUK2.js} +48 -48
  171. package/chunks/{daemon-trust-policy-monitor-CIKHNV2K.js → daemon-trust-policy-monitor-RYYGCQ3J.js} +48 -48
  172. package/chunks/{deferred-core-runtime-MM7X7UYR.js → deferred-core-runtime-3SGXFXEQ.js} +44 -44
  173. package/chunks/{devtools-X6ROTKHE.js → devtools-4QFYJT6U.js} +1 -1
  174. package/chunks/discovery-ORA5J7YP.js +27 -0
  175. package/chunks/{display-image-CAD7RAUM.js → display-image-ON3EYFRD.js} +4 -4
  176. package/chunks/{dist-B3ODKYEB.js → dist-4ZPG4BY6.js} +2 -2
  177. package/chunks/{dist-CCUH2Z4C.js → dist-BROOP2EG.js} +1 -1
  178. package/chunks/{dist-DANKRAB3.js → dist-IYYN3RUT.js} +2 -2
  179. package/chunks/{dist-5VDE7U3A.js → dist-JWMKPWT5.js} +3 -1
  180. package/chunks/{dist-6RK4U6VU.js → dist-K7IQB53U.js} +1 -1
  181. package/chunks/{dist-EZHCZSW6.js → dist-MAQXAQ2Y.js} +1 -1
  182. package/chunks/{dist-362MN6CP.js → dist-WJ4BHIEW.js} +2 -2
  183. package/chunks/{dist-M3XMEIP2.js → dist-YEPL4RAW.js} +1 -1
  184. package/chunks/{earlyInputCapture-O77TUBIF.js → earlyInputCapture-KJMLFVQV.js} +43 -43
  185. package/chunks/{edit-CZ23AVP6.js → edit-I4LQFAEC.js} +50 -49
  186. package/chunks/{enter-worktree-4EMS7IRL.js → enter-worktree-YNPOJSRH.js} +47 -47
  187. package/chunks/{enterPlanMode-TS6KO6DU.js → enterPlanMode-XCPK62ER.js} +47 -47
  188. package/chunks/{environment-7JAXEU6I.js → environment-S7CTIHMX.js} +44 -44
  189. package/chunks/{errors-NBABPF4S.js → errors-7HB2AIDS.js} +44 -44
  190. package/chunks/{exit-worktree-Q3NFHYUI.js → exit-worktree-AIIY7SR6.js} +47 -47
  191. package/chunks/{exitPlanMode-4JH6WLKL.js → exitPlanMode-R4JY7V2O.js} +42 -42
  192. package/chunks/{external-tool-guard-provider-5HTGOPGU.js → external-tool-guard-provider-TE4DRY36.js} +1 -1
  193. package/chunks/{fast-path-5LFDLPHJ.js → fast-path-NDJV3ZFJ.js} +3 -3
  194. package/chunks/{gemini-MB4S7YLN.js → gemini-RSUFP5OE.js} +108 -103
  195. package/chunks/{geminiContentGenerator-EQY2QU7K.js → geminiContentGenerator-SQ5XBPZ7.js} +11 -11
  196. package/chunks/{glob-LA5XO2H7.js → glob-J4RUJAHX.js} +49 -49
  197. package/chunks/{goal-tools-LQFO4BRY.js → goal-tools-VHTNVOKK.js} +56 -12
  198. package/chunks/{grep-KYBZMY36.js → grep-VJWPLFOT.js} +47 -47
  199. package/chunks/{handleAutoUpdate-HZJSAUNC.js → handleAutoUpdate-POCX2MNB.js} +46 -46
  200. package/chunks/{i18n-BSCIN4J4.js → i18n-RM5YOICI.js} +43 -43
  201. package/chunks/{image-gen-HGURQAHX.js → image-gen-EXECB5XM.js} +11 -11
  202. package/chunks/{initializer-WUHJXIB3.js → initializer-Z2AFGBNR.js} +49 -49
  203. package/chunks/{installationInfo-G3PDBWG2.js → installationInfo-4I5FXNMH.js} +43 -43
  204. package/chunks/{keychain-token-storage-GU75J2T2.js → keychain-token-storage-3XFJ5ZB2.js} +2 -2
  205. package/chunks/{list-IC7KDSZ6.js → list-ZMBFIGZA.js} +51 -51
  206. package/chunks/{list-agents-5PNMK2AM.js → list-agents-OSVDFI6S.js} +2 -2
  207. package/chunks/{loadedSettingsAdapter-Z3GOJRI7.js → loadedSettingsAdapter-T6TV4YJ7.js} +48 -48
  208. package/chunks/{loggingContentGenerator-E2QENFPH.js → loggingContentGenerator-WF4ZOJEZ.js} +99 -66
  209. package/chunks/{loop-wakeup-OV65FEGR.js → loop-wakeup-WQS6JYAG.js} +5 -5
  210. package/chunks/{ls-RPRSX26R.js → ls-D3HUFHDP.js} +6 -6
  211. package/chunks/{lsp-IWTJWFLT.js → lsp-3QDDJTCS.js} +2 -2
  212. package/chunks/{managed-npm-update-MX2OPCW4.js → managed-npm-update-E7IW6N7V.js} +43 -43
  213. package/chunks/{mcp-QQEWPNWV.js → mcp-6UNYX4HG.js} +48 -48
  214. package/chunks/{monitor-SV64FNV3.js → monitor-EE2UYMGE.js} +47 -47
  215. package/chunks/{node-YSOU44FX.js → node-UUDY34IG.js} +3 -3
  216. package/chunks/nonInteractiveCli-WAY237O4.js +163 -0
  217. package/chunks/{notebook-edit-QPYSWPRI.js → notebook-edit-NTDY4QDU.js} +47 -47
  218. package/chunks/{openaiContentGenerator-CMZXOSVA.js → openaiContentGenerator-YNFVJMRJ.js} +30 -30
  219. package/chunks/{pidfile-D5UXVVAI.js → pidfile-4XSFLYBZ.js} +43 -43
  220. package/chunks/{processUtils-ZEIMIVPX.js → processUtils-WDA2MJFD.js} +2 -2
  221. package/chunks/proper-lockfile-3LHWIM44.js +8 -0
  222. package/chunks/{qwenContentGenerator-JAXZKB7R.js → qwenContentGenerator-434M7QKY.js} +50 -50
  223. package/chunks/{qwenOAuth2-C2QWTD2G.js → qwenOAuth2-GMYZOO6A.js} +10 -10
  224. package/chunks/{read-file-2V5GE6ZW.js → read-file-TAFBKMNI.js} +11 -11
  225. package/chunks/{read-mcp-resource-THCSZHXO.js → read-mcp-resource-XD54ZQMC.js} +2 -2
  226. package/chunks/{record-artifact-76YYQA5F.js → record-artifact-SEYFJEJF.js} +3 -3
  227. package/chunks/{resumeHistoryUtils-UZ7GHPNY.js → resumeHistoryUtils-EVG3WYK2.js} +50 -50
  228. package/chunks/{ripGrep-MUTMPQSV.js → ripGrep-WOEK2PXS.js} +42 -42
  229. package/chunks/{run-qwen-serve-WU43JKEA.js → run-qwen-serve-3QSGRXAN.js} +417 -208
  230. package/chunks/{runtime-YLOFDP2P.js → runtime-5MLLZ7DC.js} +53 -53
  231. package/chunks/{scheduler-G44OPSZE.js → scheduler-RPBJ63CH.js} +44 -44
  232. package/chunks/{sdk-exporters-grpc-4QKV6MCX.js → sdk-exporters-grpc-54L4LS5L.js} +2 -2
  233. package/chunks/{sdk-exporters-http-A7XLKZO7.js → sdk-exporters-http-XUVP63H6.js} +12 -12
  234. package/chunks/{sdk-impl-XO4UF6PR.js → sdk-impl-YXUEN2Z2.js} +8 -8
  235. package/chunks/{send-message-P5SLP57G.js → send-message-VZENRWRH.js} +6 -6
  236. package/chunks/{serve-CZQDBDYV.js → serve-HS3XLPXU.js} +50 -50
  237. package/chunks/{server-HGI2KF3Y.js → server-TC4A7AAZ.js} +3850 -1630
  238. package/chunks/{session-OVMSHAO5.js → session-UBOFXVMN.js} +92 -95
  239. package/chunks/{settings-TWX6ROGP.js → settings-D5644OM5.js} +47 -47
  240. package/chunks/{shell-JDSWGVC7.js → shell-3PZULQQV.js} +42 -42
  241. package/chunks/{skill-QILHTMYJ.js → skill-PEVVXQ3L.js} +22 -22
  242. package/chunks/{skill-settings-RKRD34RZ.js → skill-settings-J65JKKES.js} +47 -47
  243. package/chunks/{spawnChannel-V5PYSDEI.js → spawnChannel-IYGXRHSQ.js} +45 -47
  244. package/chunks/{standalone-update-Y52CWCGG.js → standalone-update-IFM53PE7.js} +44 -44
  245. package/chunks/{startInteractiveUI-RVA62ZM6.js → startInteractiveUI-3AVH7L6H.js} +3340 -2460
  246. package/chunks/{syntheticOutput-SEW4NA47.js → syntheticOutput-7GWFIDXT.js} +3 -3
  247. package/chunks/{task-create-247EAVF7.js → task-create-FCBDX7UH.js} +12 -12
  248. package/chunks/{task-list-ZJN4QHLK.js → task-list-YIYIUFUA.js} +6 -6
  249. package/chunks/{task-stop-MAYQJ42I.js → task-stop-X37KYTKB.js} +2 -2
  250. package/chunks/{task-update-SU5TMZGG.js → task-update-MYPFVOVM.js} +12 -12
  251. package/chunks/{team-create-YMWUDIE3.js → team-create-ZAIA7KAV.js} +47 -47
  252. package/chunks/{team-delete-3XVRPQBP.js → team-delete-6UMU4XLS.js} +6 -6
  253. package/chunks/{team-plan-approval-3GPZAW46.js → team-plan-approval-UNIUS7OD.js} +47 -47
  254. package/chunks/{terminal-image-renderer-UGQKWDM3.js → terminal-image-renderer-G343P2RV.js} +44 -44
  255. package/chunks/{theme-manager-KRG4GGFY.js → theme-manager-Z3RIT7DB.js} +43 -43
  256. package/chunks/{todoWrite-IE2YTCK7.js → todoWrite-U2R4NVF4.js} +4 -4
  257. package/chunks/{tool-search-SZRO5G72.js → tool-search-5R2OE4C7.js} +17 -17
  258. package/chunks/{total-session-admission-JYHYOKWX.js → total-session-admission-4KBHMQQ2.js} +48 -48
  259. package/chunks/{trustedFolders-2BDCB5NJ.js → trustedFolders-LK6T4XC7.js} +43 -43
  260. package/chunks/{update-relaunch-XSYVPSDL.js → update-relaunch-UBKROIC6.js} +5 -5
  261. package/chunks/{updateCheck-SMMJ27GG.js → updateCheck-W4Y2GFSD.js} +45 -45
  262. package/chunks/{useAutoAcceptIndicator-HPG4UFIZ.js → useAutoAcceptIndicator-C7BEICBF.js} +51 -51
  263. package/chunks/{validateNonInterActiveAuth-IIL774NT.js → validateNonInterActiveAuth-LTEI2TB6.js} +84 -86
  264. package/chunks/{version-WSGAB2PA.js → version-G5A5DGVS.js} +1 -1
  265. package/chunks/{web-fetch-LKC2F5DM.js → web-fetch-RTEQTR5Z.js} +20 -20
  266. package/chunks/{web-search-BHMAMXEU.js → web-search-5OXHEZPV.js} +16 -16
  267. package/chunks/{workflow-A7AQ52HO.js → workflow-ISQJHPG2.js} +54 -53
  268. package/chunks/{workspace-providers-status-JRT57TLL.js → workspace-providers-status-2ZPZPUPZ.js} +51 -51
  269. package/chunks/{workspace-registration-store-EACJNCM5.js → workspace-registration-store-CYNY6IP6.js} +2 -2
  270. package/chunks/{workspace-registry-OV5SI4ES.js → workspace-registry-34GTUUHB.js} +50 -49
  271. package/chunks/{workspace-service-PUHU4EEK.js → workspace-service-XCDQLE2Y.js} +53 -53
  272. package/chunks/{workspace-skills-status-YAJE3UW3.js → workspace-skills-status-RS4O7AIJ.js} +49 -49
  273. package/chunks/{workspace-trust-reconciler-JP5UR2H6.js → workspace-trust-reconciler-AYGXC7A3.js} +57 -56
  274. package/chunks/{write-file-UBIHUP5M.js → write-file-EWXKVVXF.js} +42 -42
  275. package/chunks/{zoom-image-4QTKAMTP.js → zoom-image-4BFYJ3HG.js} +11 -11
  276. package/cli.js +18 -17
  277. package/package.json +3 -3
  278. package/web-shell/assets/{arc-lZ04kynw.js → arc-CgOpDKvm.js} +1 -1
  279. package/web-shell/assets/{architectureDiagram-3BPJPVTR-B1wZVhzD.js → architectureDiagram-3BPJPVTR-0Ag_m34F.js} +1 -1
  280. package/web-shell/assets/{blockDiagram-GPEHLZMM-CO0e0yJt.js → blockDiagram-GPEHLZMM-IwTwFau0.js} +1 -1
  281. package/web-shell/assets/{c4Diagram-AAUBKEIU-Dfpo6Qie.js → c4Diagram-AAUBKEIU-DLa5GUv8.js} +1 -1
  282. package/web-shell/assets/channel-BrGVBa2L.js +1 -0
  283. package/web-shell/assets/{chunk-2J33WTMH-BvxArftT.js → chunk-2J33WTMH-DcYP-WFG.js} +1 -1
  284. package/web-shell/assets/{chunk-4BX2VUAB-BS2XXjGY.js → chunk-4BX2VUAB-C8MVPMiQ.js} +1 -1
  285. package/web-shell/assets/{chunk-55IACEB6-CYL6h3Ph.js → chunk-55IACEB6-BUi4Yfv3.js} +1 -1
  286. package/web-shell/assets/{chunk-727SXJPM-C-cWPX30.js → chunk-727SXJPM-Cy3Su2YY.js} +1 -1
  287. package/web-shell/assets/{chunk-AQP2D5EJ-CJLxNbVV.js → chunk-AQP2D5EJ-Dp8Teqv6.js} +1 -1
  288. package/web-shell/assets/{chunk-FMBD7UC4-DwfzKywA.js → chunk-FMBD7UC4-BDTDM-4j.js} +1 -1
  289. package/web-shell/assets/{chunk-ND2GUHAM-BI5raYHQ.js → chunk-ND2GUHAM-7HfDt0r2.js} +1 -1
  290. package/web-shell/assets/{chunk-QZHKN3VN-_GkNI90J.js → chunk-QZHKN3VN-BIBU0uCF.js} +1 -1
  291. package/web-shell/assets/classDiagram-4FO5ZUOK-B5TUzJzI.js +1 -0
  292. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-B5TUzJzI.js +1 -0
  293. package/web-shell/assets/{cose-bilkent-S5V4N54A-BAVLNxh9.js → cose-bilkent-S5V4N54A-DRLdcg9p.js} +1 -1
  294. package/web-shell/assets/{dagre-BM42HDAG-BD4XNLqp.js → dagre-BM42HDAG-DCCgDwqW.js} +1 -1
  295. package/web-shell/assets/{diagram-2AECGRRQ-WO567p8w.js → diagram-2AECGRRQ-CsBTBmk3.js} +1 -1
  296. package/web-shell/assets/{diagram-5GNKFQAL-mAk23VWO.js → diagram-5GNKFQAL-C9qjH8Lt.js} +1 -1
  297. package/web-shell/assets/{diagram-KO2AKTUF-YQEeHKze.js → diagram-KO2AKTUF-Brjs_lj2.js} +1 -1
  298. package/web-shell/assets/{diagram-LMA3HP47-CMVjxAjv.js → diagram-LMA3HP47-DtiWCl_F.js} +1 -1
  299. package/web-shell/assets/{diagram-OG6HWLK6-42hPvbM-.js → diagram-OG6HWLK6-DmfKLkBT.js} +1 -1
  300. package/web-shell/assets/{erDiagram-TEJ5UH35-CXU_cPfu.js → erDiagram-TEJ5UH35-Bve_4deH.js} +1 -1
  301. package/web-shell/assets/{flowDiagram-I6XJVG4X-D-3TdhMT.js → flowDiagram-I6XJVG4X-C2_kXCcV.js} +1 -1
  302. package/web-shell/assets/{ganttDiagram-6RSMTGT7-CsgkXolz.js → ganttDiagram-6RSMTGT7-BSBIjiTF.js} +1 -1
  303. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-B6Q3PBLD.js → gitGraphDiagram-PVQCEYII-CyebwI55.js} +1 -1
  304. package/web-shell/assets/index-CIDsgxTe.js +1792 -0
  305. package/web-shell/assets/index-DiQnWi_E.css +5 -0
  306. package/web-shell/assets/{index-BFrkGj2B.js → index-d0yfnV1M.js} +1 -1
  307. package/web-shell/assets/{infoDiagram-5YYISTIA-jiAfSXp8.js → infoDiagram-5YYISTIA-CSDGnWxU.js} +1 -1
  308. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-BWif5KeJ.js → ishikawaDiagram-YF4QCWOH-BK4jU13p.js} +1 -1
  309. package/web-shell/assets/{journeyDiagram-JHISSGLW-B-GAZthS.js → journeyDiagram-JHISSGLW-D_W6j-oF.js} +1 -1
  310. package/web-shell/assets/{kanban-definition-UN3LZRKU-9TEuATdL.js → kanban-definition-UN3LZRKU-C7xf-SdC.js} +1 -1
  311. package/web-shell/assets/{linear-dy_QPfyE.js → linear-DQmzxpxd.js} +1 -1
  312. package/web-shell/assets/{mermaid.core-DB2uLAnq.js → mermaid.core-9P7AGOLG.js} +5 -5
  313. package/web-shell/assets/{mindmap-definition-RKZ34NQL-ey_dyxi-.js → mindmap-definition-RKZ34NQL-DgcgMyPk.js} +1 -1
  314. package/web-shell/assets/{pieDiagram-4H26LBE5-_6BuMdDj.js → pieDiagram-4H26LBE5-3wWGb9eG.js} +1 -1
  315. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-B2rM19W2.js → quadrantDiagram-W4KKPZXB-BeCXnQw9.js} +1 -1
  316. package/web-shell/assets/{requirementDiagram-4Y6WPE33-DWj8b7vW.js → requirementDiagram-4Y6WPE33-Bi1UOHDz.js} +1 -1
  317. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-D5dtYh0N.js → sankeyDiagram-5OEKKPKP-lrLUjjbb.js} +1 -1
  318. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-DVkdn_qW.js → sequenceDiagram-3UESZ5HK-BFuqKz6Q.js} +1 -1
  319. package/web-shell/assets/{stateDiagram-AJRCARHV-DgwD_fi6.js → stateDiagram-AJRCARHV-8DemQLhu.js} +1 -1
  320. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DhM5ixYd.js +1 -0
  321. package/web-shell/assets/{timeline-definition-PNZ67QCA-vNr_1UNX.js → timeline-definition-PNZ67QCA-uzEuVQXg.js} +1 -1
  322. package/web-shell/assets/{vennDiagram-CIIHVFJN-ChFcGAcu.js → vennDiagram-CIIHVFJN-BQTeZ_-o.js} +1 -1
  323. package/web-shell/assets/{wardley-L42UT6IY-C8PXoSWk.js → wardley-L42UT6IY-B6yM5Im7.js} +1 -1
  324. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-C2nqOV6i.js → wardleyDiagram-YWT4CUSO-ChM8bmgn.js} +1 -1
  325. package/web-shell/assets/{xychartDiagram-2RQKCTM6-BntaqhSB.js → xychartDiagram-2RQKCTM6-oNG6HyB1.js} +1 -1
  326. package/web-shell/index.html +2 -2
  327. package/chunks/chunk-5PLOQW7H.js +0 -830
  328. package/chunks/chunk-DMODRHNL.js +0 -649
  329. package/chunks/chunk-L34XSHIZ.js +0 -28
  330. package/chunks/chunk-N2TNM3QB.js +0 -9
  331. package/chunks/chunk-RECPKBBD.js +0 -622
  332. package/chunks/chunk-WLML6VIA.js +0 -18
  333. package/chunks/chunk-ZBBVBZBR.js +0 -137
  334. package/chunks/chunk-bdqvmfwv-OHYAFAAO.js +0 -17446
  335. package/chunks/discovery-XLHITE74.js +0 -220
  336. package/chunks/dispatch-FW7DX2CR.js +0 -43
  337. package/chunks/nonInteractiveCli-3XFIFXBR.js +0 -166
  338. package/chunks/opentui-entry-TEHHLGN7.js +0 -52419
  339. package/chunks/runtime-gate-T4ICWGQJ.js +0 -89
  340. package/chunks/wrapper-46Z24CTM.js +0 -35
  341. package/web-shell/assets/channel-BxvRq3pV.js +0 -1
  342. package/web-shell/assets/classDiagram-4FO5ZUOK-tL8nAxYf.js +0 -1
  343. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-tL8nAxYf.js +0 -1
  344. package/web-shell/assets/index-BgjULKyF.css +0 -5
  345. package/web-shell/assets/index-CxXlPYfl.js +0 -1789
  346. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BWGkVGVB.js +0 -1
  347. /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-BUQDLC2G.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-YXUEN2Z2.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,147 @@ 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
+ const ownsStructuredOutputContract = options.messageType === "userQuery" || options.messageType === "retry" || options.messageType === "acp_prompt";
1282
+ return {
1283
+ "session.id": sessionId,
1228
1284
  ...userId ? { "gen_ai.user.id": userId } : {},
1285
+ "gen_ai.operation.name": "invoke_agent",
1286
+ "gen_ai.agent.name": "qwen-code",
1287
+ "gen_ai.conversation.id": sessionId,
1288
+ ...ownsStructuredOutputContract && config.getJsonSchema?.() ? { "gen_ai.output.type": "json" } : {},
1229
1289
  "qwen-code.prompt_id": options.promptId,
1230
1290
  "qwen-code.message_type": options.messageType,
1231
1291
  "qwen-code.model": options.model,
1232
1292
  "qwen-code.approval_mode": config.getApprovalMode(),
1233
1293
  "interaction.sequence": interactionSequence
1234
1294
  };
1295
+ }
1296
+ __name(buildInteractionAttributes, "buildInteractionAttributes");
1297
+ function finalizeInteractionContext(spanCtx, status, metadata) {
1298
+ if (spanCtx.ended) return;
1299
+ spanCtx.ended = true;
1300
+ const promptId = spanCtx.attributes["qwen-code.prompt_id"];
1301
+ if (typeof promptId === "string" && activeInteractionsByPromptId.get(promptId) === spanCtx) {
1302
+ activeInteractionsByPromptId.delete(promptId);
1303
+ const identity = interactionIdentityByPromptId.get(promptId);
1304
+ if (identity) identity.lastActivityTime = Date.now();
1305
+ }
1306
+ try {
1307
+ const duration = Date.now() - spanCtx.startTime;
1308
+ const attributes = {
1309
+ "interaction.duration_ms": duration,
1310
+ "qwen-code.turn_status": status
1311
+ };
1312
+ if (status === "error") {
1313
+ attributes["error.type"] = metadata?.errorType || "interaction_error";
1314
+ }
1315
+ spanCtx.span.setAttributes(attributes);
1316
+ if (status === "error") {
1317
+ spanCtx.span.setStatus({
1318
+ code: SpanStatusCode.ERROR,
1319
+ message: truncateSpanError(metadata?.errorMessage ?? "unknown error")
1320
+ });
1321
+ }
1322
+ } catch (error) {
1323
+ debugLogger2.warn(
1324
+ `Failed to update interaction span attributes/status: ${error instanceof Error ? error.message : String(error)}`
1325
+ );
1326
+ }
1327
+ try {
1328
+ spanCtx.span.end();
1329
+ } catch (error) {
1330
+ debugLogger2.warn(
1331
+ `Failed to end interaction span: ${error instanceof Error ? error.message : String(error)}`
1332
+ );
1333
+ }
1334
+ const spanId = getSpanId(spanCtx.span);
1335
+ activeSpans.delete(spanId);
1336
+ strongSpans.delete(spanId);
1337
+ }
1338
+ __name(finalizeInteractionContext, "finalizeInteractionContext");
1339
+ function registerInteractionContext(promptId, spanContextObj) {
1340
+ const existing = activeInteractionsByPromptId.get(promptId);
1341
+ if (existing && !existing.ended) {
1342
+ debugLogger2.warn(
1343
+ `Replacing unfinished interaction for promptId=${promptId}; ending the previous span as cancelled`
1344
+ );
1345
+ finalizeInteractionContext(existing, "cancelled", { promptId });
1346
+ }
1347
+ const spanId = getSpanId(spanContextObj.span);
1348
+ activeSpans.set(spanId, new WeakRef(spanContextObj));
1349
+ strongSpans.set(spanId, spanContextObj);
1350
+ activeInteractionsByPromptId.set(promptId, spanContextObj);
1351
+ const userId = spanContextObj.attributes["gen_ai.user.id"];
1352
+ if (typeof userId === "string" && userId) {
1353
+ interactionIdentityByPromptId.set(promptId, {
1354
+ lastActivityTime: spanContextObj.lastActivityTime ?? spanContextObj.startTime,
1355
+ attributes: { "gen_ai.user.id": userId }
1356
+ });
1357
+ } else {
1358
+ interactionIdentityByPromptId.delete(promptId);
1359
+ }
1360
+ }
1361
+ __name(registerInteractionContext, "registerInteractionContext");
1362
+ function getInteractionContext(promptId) {
1363
+ if (promptId !== void 0) {
1364
+ const exact = activeInteractionsByPromptId.get(promptId);
1365
+ return exact && !exact.ended ? exact : void 0;
1366
+ }
1367
+ const current = interactionContext.getStore();
1368
+ return current && !current.ended ? current : void 0;
1369
+ }
1370
+ __name(getInteractionContext, "getInteractionContext");
1371
+ function touchInteractionContext(spanCtx) {
1372
+ if (!spanCtx || spanCtx.type !== "interaction" || spanCtx.ended) return false;
1373
+ const promptId = spanCtx.attributes["qwen-code.prompt_id"];
1374
+ if (typeof promptId !== "string" || activeInteractionsByPromptId.get(promptId) !== spanCtx) {
1375
+ return false;
1376
+ }
1377
+ const now = Date.now();
1378
+ spanCtx.lastActivityTime = now;
1379
+ const identity = interactionIdentityByPromptId.get(promptId);
1380
+ if (identity) identity.lastActivityTime = now;
1381
+ return true;
1382
+ }
1383
+ __name(touchInteractionContext, "touchInteractionContext");
1384
+ function resolveGenAiParentContext(parent) {
1385
+ if (!parent && interactionContext.getStore()) return ROOT_CONTEXT;
1386
+ return resolveParentContext(parent);
1387
+ }
1388
+ __name(resolveGenAiParentContext, "resolveGenAiParentContext");
1389
+ function startInteractionSpan(config, options) {
1390
+ if (!isTelemetrySdkInitialized()) return;
1391
+ ensureCleanupInterval();
1392
+ interactionSequence++;
1393
+ const attributes = buildInteractionAttributes(config, options);
1235
1394
  const span = getTracer().startSpan(
1236
1395
  SPAN_INTERACTION,
1237
1396
  { kind: SpanKind.INTERNAL, attributes },
1238
1397
  ROOT_CONTEXT
1239
1398
  );
1240
- const spanId = getSpanId(span);
1241
1399
  const spanContextObj = {
1242
1400
  span,
1243
1401
  startTime: Date.now(),
1402
+ lastActivityTime: Date.now(),
1244
1403
  attributes,
1245
1404
  type: "interaction"
1246
1405
  };
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;
1406
+ registerInteractionContext(options.promptId, spanContextObj);
1258
1407
  interactionContext.enterWith(spanContextObj);
1259
1408
  }
1260
1409
  __name(startInteractionSpan, "startInteractionSpan");
1261
1410
  function endInteractionSpan(status, metadata) {
1262
- const spanCtx = interactionContext.getStore() ?? lastInteractionCtx;
1411
+ const spanCtx = getInteractionContext(metadata?.promptId);
1263
1412
  if (!spanCtx) return;
1264
1413
  if (spanCtx.ended) {
1265
1414
  debugLogger2.debug(
@@ -1267,43 +1416,24 @@ function endInteractionSpan(status, metadata) {
1267
1416
  );
1268
1417
  return;
1269
1418
  }
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 });
1419
+ const current = interactionContext.getStore();
1420
+ finalizeInteractionContext(spanCtx, status, metadata);
1421
+ if (current === spanCtx) interactionContext.enterWith(void 0);
1422
+ }
1423
+ __name(endInteractionSpan, "endInteractionSpan");
1424
+ function endAllInteractionSpans(status = "cancelled") {
1425
+ for (const spanCtx of [...activeInteractionsByPromptId.values()]) {
1426
+ finalizeInteractionContext(spanCtx, status);
1284
1427
  }
1285
- spanCtx.span.end();
1286
- const spanId = getSpanId(spanCtx.span);
1287
- activeSpans.delete(spanId);
1288
- strongSpans.delete(spanId);
1289
1428
  interactionContext.enterWith(void 0);
1290
1429
  }
1291
- __name(endInteractionSpan, "endInteractionSpan");
1430
+ __name(endAllInteractionSpans, "endAllInteractionSpans");
1292
1431
  async function withInteractionSpan(config, options, fn, getResultStatus) {
1293
1432
  if (!isTelemetrySdkInitialized()) return await fn();
1294
1433
  ensureCleanupInterval();
1295
1434
  interactionSequence++;
1296
1435
  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
- };
1436
+ const attributes = buildInteractionAttributes(config, options);
1307
1437
  const parentContext = options.parentContext ?? ROOT_CONTEXT;
1308
1438
  const span = getTracer().startSpan(
1309
1439
  SPAN_INTERACTION,
@@ -1313,23 +1443,14 @@ async function withInteractionSpan(config, options, fn, getResultStatus) {
1313
1443
  },
1314
1444
  parentContext
1315
1445
  );
1316
- const spanId = getSpanId(span);
1317
1446
  const spanContextObj = {
1318
1447
  span,
1319
1448
  startTime: Date.now(),
1449
+ lastActivityTime: Date.now(),
1320
1450
  attributes,
1321
1451
  type: "interaction"
1322
1452
  };
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
- }
1453
+ registerInteractionContext(options.promptId, spanContextObj);
1333
1454
  const activeContext = trace.setSpan(
1334
1455
  setSessionIdOnContext(parentContext, sessionId),
1335
1456
  span
@@ -1338,41 +1459,27 @@ async function withInteractionSpan(config, options, fn, getResultStatus) {
1338
1459
  activeContext,
1339
1460
  async () => interactionContext.run(spanContextObj, async () => {
1340
1461
  let terminalStatus = "ok";
1341
- let errorStatusSet = false;
1462
+ let errorMetadata;
1342
1463
  try {
1343
1464
  const result = await fn();
1344
1465
  terminalStatus = getResultStatus?.(result) ?? "ok";
1345
1466
  return result;
1346
1467
  } catch (error) {
1347
1468
  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;
1469
+ errorMetadata = {
1470
+ promptId: options.promptId,
1471
+ errorMessage: error instanceof Error ? error.message : String(error),
1472
+ errorType: getErrorType(error)
1473
+ };
1355
1474
  throw error;
1356
1475
  } 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
- }
1476
+ finalizeInteractionContext(spanContextObj, terminalStatus, {
1477
+ promptId: options.promptId,
1478
+ ...terminalStatus === "error" && !errorMetadata ? {
1479
+ errorMessage: "interaction error",
1480
+ errorType: "interaction_error"
1481
+ } : errorMetadata
1482
+ });
1376
1483
  }
1377
1484
  })
1378
1485
  );
@@ -1385,25 +1492,18 @@ function startLLMRequestSpanWithContext(model, promptId, options) {
1385
1492
  context: trace.setSpan(context.active(), NOOP_SPAN)
1386
1493
  };
1387
1494
  }
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
- );
1495
+ const interactionParentCtx = getInteractionContext(promptId);
1496
+ touchInteractionContext(interactionParentCtx);
1497
+ const parentCtx = subagentContext.getStore() ?? toolContext.getStore() ?? interactionParentCtx;
1498
+ const ctx = resolveGenAiParentContext(parentCtx);
1499
+ const sessionId = resolveSessionId(parentCtx, options?.sessionId, ctx);
1500
+ const userId = resolveGenAiUserId(parentCtx, promptId, options?.userId);
1401
1501
  const attributes = {
1402
1502
  ...sessionId ? { "session.id": sessionId } : {},
1403
1503
  ...sessionId ? { "gen_ai.conversation.id": sessionId } : {},
1404
1504
  ...userId ? { "gen_ai.user.id": userId } : {},
1405
1505
  "qwen-code.prompt_id": promptId,
1406
- "llm_request.context": subagentContext.getStore() ? "subagent" : interactionContext.getStore() ? "interaction" : "standalone",
1506
+ "llm_request.context": parentCtx?.type === "subagent" ? "subagent" : interactionParentCtx ? "interaction" : "standalone",
1407
1507
  // Emit the version-pinned OTel GenAI semantic convention.
1408
1508
  "gen_ai.request.model": model,
1409
1509
  ...options?.operationName ? { "gen_ai.operation.name": options.operationName } : {},
@@ -1420,6 +1520,7 @@ function startLLMRequestSpanWithContext(model, promptId, options) {
1420
1520
  const spanContextObj = {
1421
1521
  span,
1422
1522
  startTime: Date.now(),
1523
+ ...interactionParentCtx ? { interactionOwner: interactionParentCtx } : {},
1423
1524
  attributes,
1424
1525
  type: "llm_request"
1425
1526
  };
@@ -1497,10 +1598,13 @@ function endLLMRequestSpan(span, metadata) {
1497
1598
  if (metadata.subagentName !== void 0) {
1498
1599
  endAttributes["subagent_name"] = metadata.subagentName;
1499
1600
  }
1500
- if (metadata.errorType !== void 0) {
1601
+ if (metadata.errorType && !metadata.cancelled) {
1501
1602
  endAttributes["error_type"] = metadata.errorType;
1502
1603
  endAttributes["error.type"] = metadata.errorType;
1503
1604
  }
1605
+ if (!metadata.success && !metadata.cancelled && endAttributes["error.type"] === void 0) {
1606
+ endAttributes["error.type"] = "llm_error";
1607
+ }
1504
1608
  if (metadata.errorStatusCode !== void 0) {
1505
1609
  endAttributes["error_status_code"] = metadata.errorStatusCode;
1506
1610
  }
@@ -1534,9 +1638,7 @@ function endLLMRequestSpan(span, metadata) {
1534
1638
  `Failed to record API request breakdown histogram: ${error instanceof Error ? error.message : String(error)}`
1535
1639
  );
1536
1640
  }
1537
- if (metadata === void 0 || metadata.success) {
1538
- spanCtx.span.setStatus({ code: SpanStatusCode.OK });
1539
- } else {
1641
+ if (metadata !== void 0 && !metadata.success && !metadata.cancelled) {
1540
1642
  spanCtx.span.setStatus({
1541
1643
  code: SpanStatusCode.ERROR,
1542
1644
  message: metadata.error ? truncateSpanError(metadata.error) : "unknown error"
@@ -1556,6 +1658,7 @@ function endLLMRequestSpan(span, metadata) {
1556
1658
  }
1557
1659
  activeSpans.delete(spanId);
1558
1660
  strongSpans.delete(spanId);
1661
+ touchInteractionContext(spanCtx.interactionOwner);
1559
1662
  }
1560
1663
  __name(endLLMRequestSpan, "endLLMRequestSpan");
1561
1664
  function startToolSpan(toolName, attrs, description, promptId) {
@@ -1564,11 +1667,13 @@ function startToolSpan(toolName, attrs, description, promptId) {
1564
1667
  }
1565
1668
  let span;
1566
1669
  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);
1670
+ const interactionParentCtx = getInteractionContext(promptId);
1671
+ touchInteractionContext(interactionParentCtx);
1672
+ const parentCtx = subagentContext.getStore() ?? toolContext.getStore() ?? interactionParentCtx;
1673
+ const ctx = resolveGenAiParentContext(parentCtx);
1674
+ const sessionId = resolveSessionId(parentCtx, void 0, ctx);
1675
+ const userId = resolveGenAiUserId(parentCtx, promptId);
1676
+ const agentName = (subagentContext.getStore() ?? interactionParentCtx)?.attributes["gen_ai.agent.name"];
1572
1677
  const attributes = {
1573
1678
  ...sessionId ? { "session.id": sessionId } : {},
1574
1679
  ...attrs,
@@ -1576,6 +1681,7 @@ function startToolSpan(toolName, attrs, description, promptId) {
1576
1681
  "gen_ai.operation.name": "execute_tool",
1577
1682
  "gen_ai.tool.name": toolName,
1578
1683
  "gen_ai.tool.type": "function",
1684
+ ...typeof agentName === "string" ? { "gen_ai.agent.name": agentName } : {},
1579
1685
  ...description ? {
1580
1686
  "gen_ai.tool.description": truncateSpanText(
1581
1687
  description,
@@ -1583,6 +1689,9 @@ function startToolSpan(toolName, attrs, description, promptId) {
1583
1689
  )
1584
1690
  } : {}
1585
1691
  };
1692
+ if (typeof agentName !== "string") {
1693
+ delete attributes["gen_ai.agent.name"];
1694
+ }
1586
1695
  span = getTracer().startSpan(
1587
1696
  SPAN_TOOL,
1588
1697
  { kind: SpanKind.INTERNAL, attributes },
@@ -1592,6 +1701,7 @@ function startToolSpan(toolName, attrs, description, promptId) {
1592
1701
  const spanContextObj = {
1593
1702
  span,
1594
1703
  startTime: Date.now(),
1704
+ ...interactionParentCtx ? { interactionOwner: interactionParentCtx } : {},
1595
1705
  attributes,
1596
1706
  type: "tool"
1597
1707
  };
@@ -1642,17 +1752,16 @@ function endToolSpan(span, metadata) {
1642
1752
  }
1643
1753
  if (metadata.error !== void 0)
1644
1754
  endAttributes["error"] = truncateSpanError(metadata.error);
1755
+ if (metadata.success === false && !metadata.cancelled) {
1756
+ endAttributes["error.type"] = "tool_error";
1757
+ }
1645
1758
  if (metadata.cancelled) {
1646
1759
  endAttributes[TOOL_FAILURE_KIND_ATTRIBUTE] = TOOL_FAILURE_KIND_CANCELLED;
1647
1760
  }
1648
1761
  }
1649
1762
  spanCtx.span.setAttributes(endAttributes);
1650
1763
  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 {
1764
+ if (!metadata.cancelled && metadata.success === false) {
1656
1765
  spanCtx.span.setStatus({
1657
1766
  code: SpanStatusCode.ERROR,
1658
1767
  message: metadata.error ? truncateSpanError(metadata.error) : "tool error"
@@ -1673,6 +1782,7 @@ function endToolSpan(span, metadata) {
1673
1782
  }
1674
1783
  activeSpans.delete(spanId);
1675
1784
  strongSpans.delete(spanId);
1785
+ touchInteractionContext(spanCtx.interactionOwner);
1676
1786
  }
1677
1787
  __name(endToolSpan, "endToolSpan");
1678
1788
  function startToolExecutionSpan(options) {
@@ -1739,6 +1849,8 @@ function endToolExecutionSpan(span, metadata) {
1739
1849
  spanCtx.ended = true;
1740
1850
  try {
1741
1851
  const duration = Date.now() - spanCtx.startTime;
1852
+ const executionStatus = metadata?.executionStatus;
1853
+ const cancelled = metadata?.cancelled === true || executionStatus === "cancelled";
1742
1854
  const endAttributes = {};
1743
1855
  if (metadata?.attributes) {
1744
1856
  Object.assign(endAttributes, metadata.attributes);
@@ -1752,19 +1864,21 @@ function endToolExecutionSpan(span, metadata) {
1752
1864
  if (metadata.executionStatus !== void 0) {
1753
1865
  endAttributes["execution_status"] = metadata.executionStatus;
1754
1866
  }
1755
- if (metadata.errorType !== void 0) {
1867
+ if (metadata.errorType) {
1756
1868
  endAttributes["error_type"] = metadata.errorType;
1757
- endAttributes["error.type"] = metadata.errorType;
1869
+ if (!cancelled) {
1870
+ endAttributes["error.type"] = metadata.errorType;
1871
+ }
1872
+ }
1873
+ const failed = !cancelled && executionStatus !== "not_started" && (executionStatus === void 0 ? metadata.success === false : executionStatus !== "success");
1874
+ if (failed && endAttributes["error.type"] === void 0) {
1875
+ endAttributes["error.type"] = "tool_execution_error";
1758
1876
  }
1759
1877
  }
1760
1878
  spanCtx.span.setAttributes(endAttributes);
1761
- const executionStatus = metadata?.executionStatus;
1762
- const cancelled = metadata?.cancelled === true || executionStatus === "cancelled";
1763
1879
  if (metadata && !cancelled && executionStatus !== "not_started") {
1764
1880
  const succeeded = executionStatus === void 0 ? metadata.success !== false : executionStatus === "success";
1765
- if (succeeded) {
1766
- spanCtx.span.setStatus({ code: SpanStatusCode.OK });
1767
- } else {
1881
+ if (!succeeded) {
1768
1882
  spanCtx.span.setStatus({
1769
1883
  code: SpanStatusCode.ERROR,
1770
1884
  message: metadata.error ? truncateSpanError(metadata.error) : "tool execution error"
@@ -1865,6 +1979,7 @@ function startHookSpan(opts) {
1865
1979
  }
1866
1980
  ensureCleanupInterval();
1867
1981
  const parentCtx = toolContext.getStore() ?? subagentContext.getStore() ?? interactionContext.getStore() ?? void 0;
1982
+ touchInteractionContext(interactionContext.getStore());
1868
1983
  const ctx = resolveParentContext(parentCtx);
1869
1984
  const sessionId = resolveSessionId(parentCtx);
1870
1985
  const attributes = {
@@ -1884,6 +1999,7 @@ function startHookSpan(opts) {
1884
1999
  const spanContextObj = {
1885
2000
  span,
1886
2001
  startTime: Date.now(),
2002
+ ...interactionContext.getStore() ? { interactionOwner: interactionContext.getStore() } : {},
1887
2003
  attributes,
1888
2004
  type: "hook"
1889
2005
  };
@@ -1925,6 +2041,8 @@ function endHookSpan(span, metadata) {
1925
2041
  );
1926
2042
  if (metadata.error !== void 0)
1927
2043
  endAttributes["error"] = truncateSpanError(metadata.error);
2044
+ if (metadata.error !== void 0)
2045
+ endAttributes["error.type"] = "hook_error";
1928
2046
  }
1929
2047
  spanCtx.span.setAttributes(endAttributes);
1930
2048
  if (metadata?.error !== void 0) {
@@ -1947,6 +2065,7 @@ function endHookSpan(span, metadata) {
1947
2065
  }
1948
2066
  activeSpans.delete(spanId);
1949
2067
  strongSpans.delete(spanId);
2068
+ touchInteractionContext(spanCtx.interactionOwner);
1950
2069
  }
1951
2070
  __name(endHookSpan, "endHookSpan");
1952
2071
  function startSubagentSpan(opts) {
@@ -2062,17 +2181,15 @@ function endSubagentSpan(span, metadata) {
2062
2181
  if (metadata.resultSummaryPresent !== void 0) {
2063
2182
  endAttributes["qwen-code.subagent.result_summary_present"] = metadata.resultSummaryPresent;
2064
2183
  }
2065
- if (metadata.error !== void 0) {
2184
+ if (metadata.status === "failed" && metadata.error !== void 0) {
2066
2185
  const truncated = truncateSpanError(metadata.error);
2067
2186
  endAttributes["exception.message"] = truncated;
2068
2187
  }
2069
- if (metadata.errorType !== void 0) {
2070
- endAttributes["error.type"] = metadata.errorType;
2188
+ if (metadata.status === "failed") {
2189
+ endAttributes["error.type"] = metadata.errorType || "subagent_error";
2071
2190
  }
2072
2191
  spanCtx.span.setAttributes(endAttributes);
2073
- if (metadata.status === "completed") {
2074
- spanCtx.span.setStatus({ code: SpanStatusCode.OK });
2075
- } else if (metadata.status === "failed") {
2192
+ if (metadata.status === "failed") {
2076
2193
  spanCtx.span.setStatus({
2077
2194
  code: SpanStatusCode.ERROR,
2078
2195
  message: metadata.error ? truncateSpanError(metadata.error) : "subagent failed"
@@ -2094,12 +2211,16 @@ function endSubagentSpan(span, metadata) {
2094
2211
  strongSpans.delete(spanId);
2095
2212
  }
2096
2213
  __name(endSubagentSpan, "endSubagentSpan");
2097
- function getActiveInteractionSpan() {
2098
- const ctx = interactionContext.getStore() ?? lastInteractionCtx;
2099
- if (!ctx || ctx.ended) return void 0;
2100
- return ctx.span;
2214
+ function getActiveInteractionSpan(promptId) {
2215
+ return getInteractionContext(promptId)?.span;
2101
2216
  }
2102
2217
  __name(getActiveInteractionSpan, "getActiveInteractionSpan");
2218
+ function recordInteractionActivity(promptId, expectedOwner) {
2219
+ const spanCtx = getInteractionContext(promptId);
2220
+ if (!spanCtx || spanCtx.span !== expectedOwner) return false;
2221
+ return touchInteractionContext(spanCtx);
2222
+ }
2223
+ __name(recordInteractionActivity, "recordInteractionActivity");
2103
2224
 
2104
2225
  export {
2105
2226
  getMeter,
@@ -2133,6 +2254,11 @@ export {
2133
2254
  API_CALL_FAILED_SPAN_STATUS_MESSAGE,
2134
2255
  API_CALL_ABORTED_SPAN_STATUS_MESSAGE,
2135
2256
  safeSetStatus,
2257
+ stripAnsiAndControl,
2258
+ safeLiteralReplace,
2259
+ isBinary,
2260
+ normalizeContent,
2261
+ redactUrlCredentials,
2136
2262
  isInNativeSubagentSpan,
2137
2263
  truncateSpanError,
2138
2264
  startInteractionSpan,
@@ -2153,6 +2279,7 @@ export {
2153
2279
  runInSubagentSpanContext,
2154
2280
  endSubagentSpan,
2155
2281
  getActiveInteractionSpan,
2282
+ recordInteractionActivity,
2156
2283
  emitSessionStart,
2157
2284
  emitSessionEnd,
2158
2285
  isTelemetrySdkInitialized,