@qwen-code/qwen-code 0.21.10 → 0.21.11-nightly.20260815.c396fe3d12

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 (386) hide show
  1. package/bundled/coordinate/SKILL.md +52 -0
  2. package/bundled/qc-helper/docs/configuration/model-providers.md +10 -8
  3. package/bundled/qc-helper/docs/configuration/settings.md +10 -0
  4. package/bundled/qc-helper/docs/extension/_meta.ts +1 -0
  5. package/bundled/qc-helper/docs/extension/agent-plugins.md +50 -0
  6. package/bundled/qc-helper/docs/extension/extension-releasing.md +3 -3
  7. package/bundled/qc-helper/docs/extension/introduction.md +17 -3
  8. package/bundled/qc-helper/docs/features/_meta.ts +1 -0
  9. package/bundled/qc-helper/docs/features/arena.md +4 -3
  10. package/bundled/qc-helper/docs/features/channels/overview.md +1 -1
  11. package/bundled/qc-helper/docs/features/channels/plugins.md +11 -11
  12. package/bundled/qc-helper/docs/features/code-review.md +1 -1
  13. package/bundled/qc-helper/docs/features/commands.md +7 -6
  14. package/bundled/qc-helper/docs/features/dual-output.md +5 -0
  15. package/bundled/qc-helper/docs/features/headless.md +8 -0
  16. package/bundled/qc-helper/docs/features/multi-agent-coordination.md +30 -0
  17. package/bundled/qc-helper/docs/qwen-serve.md +105 -40
  18. package/bundled/review/SKILL.md +72 -43
  19. package/chunks/{MaxSizedBox-FKXYULMW.js → MaxSizedBox-RRYY7LE5.js} +45 -44
  20. package/chunks/{StandaloneSessionPicker-OQS3M7AY.js → StandaloneSessionPicker-CK3O3N7F.js} +68 -67
  21. package/chunks/{acp-startup-profiler-VNTFWYAC.js → acp-startup-profiler-SVPUHLXV.js} +2 -2
  22. package/chunks/{acpAgent-AGS6HLQQ.js → acpAgent-DXUWYWDM.js} +1889 -640
  23. package/chunks/{agent-4NCVO27U.js → agent-DEPG4BP7.js} +42 -41
  24. package/chunks/agent-headless-VLBUWGPP.js +87 -0
  25. package/chunks/{anthropicContentGenerator-D3Y4RFT4.js → anthropicContentGenerator-YDT4EOKO.js} +8 -8
  26. package/chunks/{artifact-tool-N652YE4L.js → artifact-tool-4GCQQDZI.js} +2 -2
  27. package/chunks/{askUserQuestion-ONW74PKJ.js → askUserQuestion-HZJJLR3Z.js} +2 -2
  28. package/chunks/bridge-U7LETTTF.js +104 -0
  29. package/chunks/{ca-ZLKAB4K3.js → ca-4CQ6MYNQ.js} +2 -1
  30. package/chunks/{channel-management-service-PHELKOW2.js → channel-management-service-OADNGQM3.js} +6 -6
  31. package/chunks/channel-settings-store-B2GRIZ2D.js +102 -0
  32. package/chunks/{channel-worker-group-WQP4RCDO.js → channel-worker-group-IHBIHQ45.js} +9 -8
  33. package/chunks/{channel-worker-manager-MRDFAKIM.js → channel-worker-manager-GEHYJ5AE.js} +9 -8
  34. package/chunks/{channel-worker-supervisor-IVSDIMI4.js → channel-worker-supervisor-ZJIIWM4I.js} +7 -6
  35. package/chunks/{chunk-26CXSA6V.js → chunk-25VWCPYE.js} +2 -2
  36. package/chunks/{chunk-DP3IHZGG.js → chunk-2AUM35J5.js} +59 -7
  37. package/chunks/{chunk-URKIBIFC.js → chunk-2QHWLRQ2.js} +3 -3
  38. package/chunks/{chunk-4PYCZH2V.js → chunk-2ZWH53I4.js} +3 -3
  39. package/chunks/{chunk-UVX4Y6IN.js → chunk-3AEKDXKT.js} +1 -1
  40. package/chunks/{chunk-ABVRJU3D.js → chunk-3ER3FWZM.js} +9 -9
  41. package/chunks/{chunk-DZUO626D.js → chunk-3GM5DLBI.js} +3 -3
  42. package/chunks/{chunk-VSFKIRRW.js → chunk-3NBTNFNC.js} +4 -4
  43. package/chunks/{chunk-NEOXOWYH.js → chunk-3QZY3JSR.js} +7 -7
  44. package/chunks/{chunk-BKHCW2BI.js → chunk-3VUENPWF.js} +10 -0
  45. package/chunks/{chunk-67EWJE77.js → chunk-45NQKMYB.js} +1 -1
  46. package/chunks/{chunk-KKBPOU75.js → chunk-4AOVQPJU.js} +1 -1
  47. package/chunks/{chunk-OONWZLFK.js → chunk-4EB5GRRC.js} +4 -4
  48. package/chunks/{chunk-YGT2AUJ7.js → chunk-4KM2SYK5.js} +39 -19
  49. package/chunks/{chunk-Y3OVRWRY.js → chunk-4N4JVRZA.js} +1 -1
  50. package/chunks/{chunk-VNNWAZSI.js → chunk-56HVDG3M.js} +6 -6
  51. package/chunks/{chunk-TRRF5BSP.js → chunk-5C42HXEX.js} +1 -1
  52. package/chunks/{chunk-J6SZID63.js → chunk-5RUCD4ED.js} +2 -2
  53. package/chunks/{chunk-WAUGQKUU.js → chunk-63FNZTWG.js} +9 -5
  54. package/chunks/{chunk-F6WDTQ3M.js → chunk-655DWW7X.js} +5 -5
  55. package/chunks/{chunk-AAE6SR4Q.js → chunk-7P5NK5EI.js} +1 -1
  56. package/chunks/{chunk-MZSJ43WV.js → chunk-7U5G6JXI.js} +24 -2
  57. package/chunks/{chunk-GWVUR3QZ.js → chunk-7WROZ3E6.js} +3 -3
  58. package/chunks/{chunk-PBRVUF5B.js → chunk-A6NRNRKE.js} +1 -1
  59. package/chunks/{chunk-IBUGFUXC.js → chunk-A6TJ7QUA.js} +13 -13
  60. package/chunks/{chunk-DCZEPFB4.js → chunk-ADM4C4TX.js} +3 -3
  61. package/chunks/{chunk-UBX6NL47.js → chunk-AGWK35OJ.js} +47 -3
  62. package/chunks/{chunk-4MKXUHXY.js → chunk-AGWZRQJJ.js} +5 -5
  63. package/chunks/{chunk-GNPNYXJB.js → chunk-AKBFSOC5.js} +2 -2
  64. package/chunks/{chunk-YWPSGJFI.js → chunk-ARSQPRYL.js} +2 -2
  65. package/chunks/{chunk-IWTMYQ32.js → chunk-AVKPDOQZ.js} +12 -11
  66. package/chunks/{chunk-DX3RGJMS.js → chunk-AW27A43Y.js} +76 -19
  67. package/chunks/{chunk-MIKXJYZB.js → chunk-AZPFLLFR.js} +315 -299
  68. package/chunks/{chunk-2PLNY5TN.js → chunk-BBCGHZ4S.js} +4 -4
  69. package/chunks/{chunk-KID7K6H2.js → chunk-BP5VZBVK.js} +6 -6
  70. package/chunks/{chunk-LLCWZQCU.js → chunk-BRQR2FJ5.js} +3 -3
  71. package/chunks/{chunk-LHEC5V6G.js → chunk-BSR5AXZR.js} +4 -3
  72. package/chunks/{chunk-ONSZH6VM.js → chunk-CGM3E75C.js} +2 -2
  73. package/chunks/{chunk-SEZ556DZ.js → chunk-CPFFU46D.js} +1 -1
  74. package/chunks/{chunk-H6XPXXMH.js → chunk-CQ35AJ4Z.js} +252 -254
  75. package/chunks/{chunk-7MH4J33A.js → chunk-D2RNVVH6.js} +2 -2
  76. package/chunks/{chunk-M6HMMKVG.js → chunk-D7QGE3RT.js} +1 -1
  77. package/chunks/{chunk-UMD7WQTR.js → chunk-D7VALEOK.js} +13 -9
  78. package/chunks/chunk-DAV4QFD5.js +1280 -0
  79. package/chunks/{chunk-B2GJNDTV.js → chunk-DD6O3ZRD.js} +1 -1
  80. package/chunks/{chunk-HUWENAHO.js → chunk-DEDESZDL.js} +1 -1
  81. package/chunks/{chunk-3P2LV43B.js → chunk-DG4IQ6JG.js} +3 -3
  82. package/chunks/{chunk-QUI267ZP.js → chunk-DPTMKFIH.js} +492 -63
  83. package/chunks/{chunk-Q3JQ7OSU.js → chunk-EJOGLSNJ.js} +1 -1
  84. package/chunks/{chunk-NRLFZWCT.js → chunk-EQHCHTHC.js} +48 -5
  85. package/chunks/{chunk-P3BJLFSZ.js → chunk-EQR7YDXY.js} +3 -3
  86. package/chunks/{chunk-4WL6SY4F.js → chunk-EQUXHAFW.js} +1 -1
  87. package/chunks/{chunk-Q3AL4JQ3.js → chunk-F5BD3RNA.js} +2 -2
  88. package/chunks/{chunk-A7XMDZRI.js → chunk-FJYUSD2N.js} +5 -5
  89. package/chunks/{chunk-JT7XS4YW.js → chunk-FMIH5KMQ.js} +1 -1
  90. package/chunks/{chunk-ZBVS26BY.js → chunk-FPGTNKCP.js} +7 -5
  91. package/chunks/{chunk-W5UC37EE.js → chunk-FQDCO3CJ.js} +12 -1
  92. package/chunks/{chunk-EQL65XGA.js → chunk-FRHQQC2Z.js} +47 -21
  93. package/chunks/{chunk-FVKHVJZQ.js → chunk-G6MUFRNI.js} +1 -1
  94. package/chunks/{chunk-D27I6YJT.js → chunk-GB245X4Z.js} +129 -26
  95. package/chunks/{chunk-WCG5O7IP.js → chunk-GZDWTBT3.js} +2 -2
  96. package/chunks/{chunk-AOHJKPKL.js → chunk-H7TMVHKE.js} +1 -1
  97. package/chunks/{chunk-ZJ4W6SUY.js → chunk-HDRTQ5DH.js} +3 -3
  98. package/chunks/{chunk-ZZCWJWTF.js → chunk-HG3UBTJ4.js} +31 -11
  99. package/chunks/chunk-HHJLM3WQ.js +41 -0
  100. package/chunks/{chunk-6LP743KE.js → chunk-HHZU6ZZM.js} +79 -113
  101. package/chunks/{chunk-OIVKILPI.js → chunk-HOSVOUDK.js} +74 -0
  102. package/chunks/{chunk-DA4HRSBW.js → chunk-HTYND72J.js} +1 -1
  103. package/chunks/{chunk-ZRBMO3C7.js → chunk-IKFHTAQW.js} +1 -1
  104. package/chunks/{chunk-KZ22NXBY.js → chunk-IVROQYG5.js} +4 -4
  105. package/chunks/{chunk-UDXSXLER.js → chunk-IW6RQPQB.js} +14 -4
  106. package/chunks/{chunk-F24A2JBM.js → chunk-J6JVP7ZZ.js} +1180 -254
  107. package/chunks/{chunk-ECWR5LQR.js → chunk-JB6IM2TJ.js} +3 -3
  108. package/chunks/{chunk-MVUQRLOH.js → chunk-JRIVMPD2.js} +3 -3
  109. package/chunks/{chunk-Q7YDKOGY.js → chunk-JVEGA3MM.js} +1 -1
  110. package/chunks/{chunk-4TRQPFDP.js → chunk-K34GJQOZ.js} +140 -20
  111. package/chunks/{chunk-W4RQUHY3.js → chunk-K5IDV3PC.js} +184 -22
  112. package/chunks/{chunk-NDU63YLI.js → chunk-KD6FGI2Q.js} +4 -4
  113. package/chunks/{chunk-HV76SFIA.js → chunk-KEC5FHLM.js} +3 -3
  114. package/chunks/{chunk-IIJEYBNH.js → chunk-KLOMACIR.js} +197 -60
  115. package/chunks/{chunk-Z4JX4NSH.js → chunk-KSPRBJJ3.js} +50 -50
  116. package/chunks/{chunk-KONVMRK7.js → chunk-KX5TNFCJ.js} +1 -1
  117. package/chunks/{chunk-QGNOFE5E.js → chunk-KX7PC5QG.js} +1 -1
  118. package/chunks/{chunk-OJUQF2PL.js → chunk-LEKKQEQW.js} +5 -5
  119. package/chunks/{chunk-COBO5EBO.js → chunk-LSRI3ND3.js} +1 -1
  120. package/chunks/{chunk-BSI645OU.js → chunk-LUISTZXI.js} +3 -3
  121. package/chunks/{chunk-YTFDX4PR.js → chunk-M6NDLY2T.js} +1 -1
  122. package/chunks/{chunk-EBZ6BJTF.js → chunk-MNUKNVYQ.js} +1 -1
  123. package/chunks/{chunk-VFMASYQA.js → chunk-MS7GNABG.js} +3 -0
  124. package/chunks/{chunk-EI3NWELG.js → chunk-MSSNVG2G.js} +6430 -4463
  125. package/chunks/{chunk-L2AFWWJE.js → chunk-N4SVADAV.js} +351 -144
  126. package/chunks/{chunk-URK542T4.js → chunk-NF5J2WFA.js} +15 -2
  127. package/chunks/{chunk-EI3HZX6C.js → chunk-NLFLYSS4.js} +1 -1
  128. package/chunks/{chunk-NV3F44FL.js → chunk-NW2GIPG3.js} +2 -2
  129. package/chunks/{chunk-OQTXYMKW.js → chunk-NX4A23LY.js} +3 -3
  130. package/chunks/{chunk-E2FPSSKP.js → chunk-OK47XBYH.js} +97 -10
  131. package/chunks/{chunk-EKPKKXY2.js → chunk-OWGRUU7F.js} +1 -1
  132. package/chunks/{chunk-CTJLZLB5.js → chunk-OYWVIXHT.js} +1 -1
  133. package/chunks/{chunk-47PEPJO7.js → chunk-P7PSGVWP.js} +3 -3
  134. package/chunks/{chunk-6Q5ABMTU.js → chunk-PTSEETCO.js} +23 -19
  135. package/chunks/{chunk-6ZRFAKXK.js → chunk-PVXEJB66.js} +1 -1
  136. package/chunks/{chunk-EUNWC2VS.js → chunk-PZW46OTB.js} +2 -2
  137. package/chunks/{chunk-QSWDGAIC.js → chunk-QILD6R27.js} +1 -1
  138. package/chunks/{chunk-CKASRHZI.js → chunk-QLTATTPS.js} +1 -1
  139. package/chunks/{chunk-2UUMVNYT.js → chunk-QPBFRWCP.js} +3 -3
  140. package/chunks/{chunk-QJMOAMXT.js → chunk-QQSXM3FE.js} +8 -8
  141. package/chunks/{chunk-AEL7KN2O.js → chunk-RN7GFREP.js} +2 -2
  142. package/chunks/{chunk-AQAJJMRR.js → chunk-RYSBWLLV.js} +1 -1
  143. package/chunks/{chunk-MFDYOYZZ.js → chunk-SYHXR6WM.js} +26 -3
  144. package/chunks/{chunk-SR7RZ4MS.js → chunk-TB4YFWXG.js} +2 -2
  145. package/chunks/{chunk-IRZ2ZH72.js → chunk-TCMU4ZUE.js} +4 -4
  146. package/chunks/{chunk-OWMAZHIX.js → chunk-TMFWI4RC.js} +1 -1
  147. package/chunks/{chunk-TZEZYNYD.js → chunk-TQDFSQQF.js} +1 -1
  148. package/chunks/{chunk-IA7TGCN2.js → chunk-TTRH3RTQ.js} +4 -4
  149. package/chunks/{chunk-PJRW65JO.js → chunk-TXP5NGG3.js} +1 -1
  150. package/chunks/{chunk-VWKER4ZH.js → chunk-ULJGMSG5.js} +3 -3
  151. package/chunks/{chunk-2FRY5CRX.js → chunk-ULNWG62W.js} +3 -3
  152. package/chunks/{chunk-XVHYA33G.js → chunk-URYJYT5W.js} +4 -4
  153. package/chunks/{chunk-7GTMV7UE.js → chunk-US7J7LJT.js} +10786 -4462
  154. package/chunks/{chunk-HGCQ5SE7.js → chunk-UXEO7E3V.js} +21 -0
  155. package/chunks/{chunk-NV65ZUVM.js → chunk-VKT2R3NB.js} +1 -1
  156. package/chunks/{chunk-CPG6P4GG.js → chunk-VPV7WBVT.js} +1 -1
  157. package/chunks/{chunk-QG3FFJYU.js → chunk-VXSD4AGT.js} +1 -1
  158. package/chunks/{chunk-XCGIMOLN.js → chunk-WCCLLK7X.js} +14 -1
  159. package/chunks/{chunk-VJNBRRZG.js → chunk-WZMH7II3.js} +1 -1
  160. package/chunks/{chunk-5MZCSWI4.js → chunk-WZRLXVLJ.js} +1185 -1451
  161. package/chunks/{chunk-YF5MALI4.js → chunk-X5QJFMLY.js} +21 -17
  162. package/chunks/{chunk-DREZZAZM.js → chunk-XDRXOSAD.js} +13 -5
  163. package/chunks/{chunk-FOGU3LJX.js → chunk-YBHUXEC6.js} +1 -1
  164. package/chunks/{chunk-GM463R2B.js → chunk-YBVVOSOH.js} +1 -1
  165. package/chunks/{chunk-PYQADEFD.js → chunk-YIGGWOJE.js} +1 -1
  166. package/chunks/{chunk-XCWO3SMQ.js → chunk-YILJKX2T.js} +3 -3
  167. package/chunks/{chunk-Y4R47ZUH.js → chunk-YM3I6VW5.js} +7 -7
  168. package/chunks/{chunk-OCSFNUU4.js → chunk-YMALTWIZ.js} +13 -11
  169. package/chunks/{chunk-WOJZWRAZ.js → chunk-YRLW2MSX.js} +1 -1
  170. package/chunks/{chunk-UEOKWYGY.js → chunk-YYIOFWVH.js} +11 -11
  171. package/chunks/chunk-Z7B6SRPM.js +32 -0
  172. package/chunks/{chunk-S6HYI3MF.js → chunk-ZBB5EZZV.js} +2 -2
  173. package/chunks/{chunk-VKJ4KTPJ.js → chunk-ZLCT4C5A.js} +1 -1
  174. package/chunks/{chunk-O3EU6GMH.js → chunk-ZO37CAQH.js} +27 -4
  175. package/chunks/{computer-use-WQFK33Z3.js → computer-use-TMDO6TEC.js} +42 -41
  176. package/chunks/{config-utils-ULCSRMWD.js → config-utils-Z3OW3IQG.js} +6 -6
  177. package/chunks/{contextCommand-7EOZND7C.js → contextCommand-IUQ6G5ES.js} +44 -43
  178. package/chunks/{core-runtime-FGMQRM6E.js → core-runtime-HAZLPQXI.js} +42 -41
  179. package/chunks/{create-sub-session-QM2K5HLZ.js → create-sub-session-GREIOIZU.js} +42 -41
  180. package/chunks/{create-sub-session-QIDZUOPU.js → create-sub-session-XT6DLYOE.js} +2 -2
  181. package/chunks/{cron-create-VONA5JYY.js → cron-create-2JZ2TWTF.js} +4 -4
  182. package/chunks/{cron-delete-5JXSP2MI.js → cron-delete-CTPD2P26.js} +4 -4
  183. package/chunks/{cron-list-KE4F2CIR.js → cron-list-V44KHAF6.js} +4 -4
  184. package/chunks/{daemon-GWD7BT6E.js → daemon-GED37WOX.js} +216 -9
  185. package/chunks/daemon-git-worktree-guard-BSKVBYPM.js +2062 -0
  186. package/chunks/daemon-status-provider-7UK2DVVN.js +102 -0
  187. package/chunks/daemon-trust-policy-BZEALQSM.js +99 -0
  188. package/chunks/{daemon-trust-policy-monitor-6UKEABN5.js → daemon-trust-policy-monitor-P7OM342T.js} +49 -48
  189. package/chunks/{de-LIW4XVLN.js → de-UBEBKG6V.js} +2 -1
  190. package/chunks/{deferred-core-runtime-67GJXHXS.js → deferred-core-runtime-MTDXZT6B.js} +42 -41
  191. package/chunks/{display-image-NQRSIBXM.js → display-image-M2ELAVN4.js} +4 -4
  192. package/chunks/{dist-OTUO3AS2.js → dist-4ZPG4BY6.js} +13 -5
  193. package/chunks/{dist-B2CGTW6T.js → dist-BROOP2EG.js} +3 -3
  194. package/chunks/{dist-EZE3V3Q7.js → dist-IYYN3RUT.js} +3 -3
  195. package/chunks/{dist-3NTTUAHT.js → dist-JWMKPWT5.js} +5 -3
  196. package/chunks/{dist-Z3CS4OVP.js → dist-K7IQB53U.js} +11 -5
  197. package/chunks/{dist-J47AXBZC.js → dist-MAQXAQ2Y.js} +3 -3
  198. package/chunks/{dist-6BMOAE3Z.js → dist-WJ4BHIEW.js} +4 -4
  199. package/chunks/{dist-EWW3J4HQ.js → dist-YEPL4RAW.js} +3 -3
  200. package/chunks/{earlyInputCapture-IWMYR6OB.js → earlyInputCapture-BGZYFN2F.js} +43 -42
  201. package/chunks/{edit-ZFGROCAF.js → edit-ASQVJARF.js} +45 -43
  202. package/chunks/{en-SY5GTIGX.js → en-X6YV7GME.js} +2 -1
  203. package/chunks/{enter-worktree-TZZZCDM5.js → enter-worktree-WIUNMC64.js} +42 -41
  204. package/chunks/{enterPlanMode-U77BI3R6.js → enterPlanMode-TUBB2L7O.js} +42 -41
  205. package/chunks/{environment-HC37DS2I.js → environment-RWSNEY4T.js} +45 -44
  206. package/chunks/{errors-6AG54JPD.js → errors-44QVVNGT.js} +44 -43
  207. package/chunks/{exit-worktree-UYYWFPNK.js → exit-worktree-WPBRPIRR.js} +42 -41
  208. package/chunks/exitPlanMode-AP7J626M.js +85 -0
  209. package/chunks/{external-tool-guard-provider-5HTGOPGU.js → external-tool-guard-provider-TE4DRY36.js} +1 -1
  210. package/chunks/{fast-path-F5FSZ3O7.js → fast-path-XG5KXXLS.js} +6 -6
  211. package/chunks/{fast-path-settings-RPAVBD7P.js → fast-path-settings-LNOFM2YP.js} +2 -2
  212. package/chunks/{fr-RQFO7U4P.js → fr-VENTC2BS.js} +2 -1
  213. package/chunks/{gemini-NKQHYM36.js → gemini-PGXORAFF.js} +112 -103
  214. package/chunks/{geminiContentGenerator-HCWZOUX3.js → geminiContentGenerator-ZQVVD4J4.js} +6 -6
  215. package/chunks/{glob-3PDXKBAO.js → glob-Q6LWKMBU.js} +42 -41
  216. package/chunks/{goal-tools-SWNB6GP4.js → goal-tools-M4UDAZXP.js} +4 -4
  217. package/chunks/{grep-5HZKZYVD.js → grep-C67Z35I4.js} +42 -41
  218. package/chunks/handleAutoUpdate-75L74MB4.js +94 -0
  219. package/chunks/{i18n-Q27KKNDL.js → i18n-GYUC23UJ.js} +43 -42
  220. package/chunks/{image-gen-2Z2RJ6W7.js → image-gen-XE56S4MG.js} +10 -10
  221. package/chunks/initializer-V7XZVY35.js +100 -0
  222. package/chunks/{installationInfo-XXB75T7O.js → installationInfo-S5PPSD7T.js} +43 -42
  223. package/chunks/{ja-KOZKHJHZ.js → ja-QHT4EQTO.js} +2 -1
  224. package/chunks/{keychain-token-storage-TVAMTNP7.js → keychain-token-storage-NKKCUHI2.js} +2 -2
  225. package/chunks/list-JJ2FB7SP.js +103 -0
  226. package/chunks/{list-agents-Z4WABFDZ.js → list-agents-O6WSY4CT.js} +2 -2
  227. package/chunks/loadedSettingsAdapter-LNUDRGW5.js +97 -0
  228. package/chunks/{loggingContentGenerator-6NTFBM7Q.js → loggingContentGenerator-HCJ2DX2S.js} +162 -112
  229. package/chunks/{loop-wakeup-UZ5RL5Y2.js → loop-wakeup-GVQRMUKS.js} +5 -5
  230. package/chunks/{ls-TVHDGIES.js → ls-6W2D7TKU.js} +4 -4
  231. package/chunks/{lsp-CVN6OQPI.js → lsp-NJ4KFBI2.js} +2 -2
  232. package/chunks/{managed-npm-update-SPHYQUWZ.js → managed-npm-update-MDF2JDTH.js} +45 -44
  233. package/chunks/mcp-M5OML5FI.js +97 -0
  234. package/chunks/{monitor-ZBBPAA54.js → monitor-U5NM5ONC.js} +42 -41
  235. package/chunks/nonInteractiveCli-TX3QP7JT.js +163 -0
  236. package/chunks/{notebook-edit-5W3FW7Z2.js → notebook-edit-Q7SUR44R.js} +42 -41
  237. package/chunks/{openaiContentGenerator-TQANPEVZ.js → openaiContentGenerator-2H5CYLXP.js} +29 -29
  238. package/chunks/{pidfile-EQOBLH4E.js → pidfile-SHSMSAZR.js} +43 -42
  239. package/chunks/{processUtils-7XQG7EHS.js → processUtils-GZAP6EYW.js} +2 -2
  240. package/chunks/{pt-U6AOCTMF.js → pt-VL3I5RNY.js} +2 -1
  241. package/chunks/{qwenContentGenerator-BKCPHHXU.js → qwenContentGenerator-2624VVZH.js} +48 -48
  242. package/chunks/{qwenOAuth2-BJ6PQKE6.js → qwenOAuth2-AAWH3C7N.js} +9 -9
  243. package/chunks/read-file-ZWGQE2TE.js +32 -0
  244. package/chunks/{read-mcp-resource-PZ4ZF6YL.js → read-mcp-resource-GWCP23WG.js} +2 -2
  245. package/chunks/{read-package-up-TCM6I7S2.js → read-package-up-K6RKTL5D.js} +1 -1
  246. package/chunks/{record-artifact-P4HFMS7X.js → record-artifact-IYQDEYMV.js} +3 -3
  247. package/chunks/{resumeHistoryUtils-6N6XGJJW.js → resumeHistoryUtils-7N2H4QCU.js} +50 -49
  248. package/chunks/ripGrep-6JGJDWYB.js +85 -0
  249. package/chunks/{ru-CMX4UMYP.js → ru-4RCKL4PY.js} +2 -1
  250. package/chunks/{run-qwen-serve-BCKBCAMX.js → run-qwen-serve-2A6RHHI7.js} +197 -90
  251. package/chunks/{runtime-E2437YKL.js → runtime-NPYVZVRI.js} +55 -54
  252. package/chunks/{scheduler-K3D5Z655.js → scheduler-UMKTEQAM.js} +44 -43
  253. package/chunks/{sdk-exporters-http-XVTZQRCE.js → sdk-exporters-http-NHBYB5FZ.js} +11 -7
  254. package/chunks/{sdk-impl-7W7AKCS4.js → sdk-impl-SK4P5WON.js} +13 -10
  255. package/chunks/{send-message-CAMSLG2L.js → send-message-O7FO63UK.js} +6 -6
  256. package/chunks/serve-LYADPWRV.js +107 -0
  257. package/chunks/{server-UD6INW7J.js → server-WMVPH4G4.js} +1137 -382
  258. package/chunks/{session-GR4ZEVW4.js → session-LE6O62ZE.js} +122 -102
  259. package/chunks/{settings-5O24D3OJ.js → settings-2IPZYYGS.js} +48 -47
  260. package/chunks/{shell-UTLWLG5G.js → shell-VOBAZFFI.js} +42 -41
  261. package/chunks/{skill-QQAZL4VO.js → skill-6LKOWJV4.js} +19 -19
  262. package/chunks/{skill-settings-P3YHJVBZ.js → skill-settings-J5IHQA7L.js} +48 -47
  263. package/chunks/spawnChannel-TLW7N3SM.js +98 -0
  264. package/chunks/{standalone-update-QP742MGP.js → standalone-update-6OFPUBEM.js} +44 -43
  265. package/chunks/{startInteractiveUI-YCS6AEPN.js → startInteractiveUI-KVHNCR2L.js} +836 -444
  266. package/chunks/{syntheticOutput-PEBJQYJV.js → syntheticOutput-DVHJMUGV.js} +3 -3
  267. package/chunks/{task-create-5NWCQSJF.js → task-create-4NC7PDI4.js} +10 -10
  268. package/chunks/{task-list-53265TRZ.js → task-list-LBSRMOC7.js} +5 -5
  269. package/chunks/{task-stop-FPCOIRYX.js → task-stop-YFNATTIM.js} +2 -2
  270. package/chunks/{task-update-5HN577LS.js → task-update-BPLM52GD.js} +10 -10
  271. package/chunks/{team-create-WFH7OCDQ.js → team-create-INCC7G74.js} +44 -43
  272. package/chunks/{team-delete-MMQB4OSC.js → team-delete-MKYMYBFM.js} +5 -5
  273. package/chunks/{team-plan-approval-EGTT53MV.js → team-plan-approval-6DCWGZQ4.js} +42 -41
  274. package/chunks/{terminal-image-renderer-BWRESAQ7.js → terminal-image-renderer-O5EDW64G.js} +44 -43
  275. package/chunks/theme-manager-NZZO4SWE.js +89 -0
  276. package/chunks/{todoWrite-JGV6VLOX.js → todoWrite-K5K7NRE5.js} +4 -4
  277. package/chunks/{tool-search-TI5PTIBF.js → tool-search-JB2PXD5P.js} +19 -19
  278. package/chunks/total-session-admission-NWNMU6AW.js +99 -0
  279. package/chunks/{trustedFolders-4KYHA4IG.js → trustedFolders-A5ZWRRSP.js} +43 -42
  280. package/chunks/{update-relaunch-WB6LGIF2.js → update-relaunch-GG7EDBEA.js} +5 -5
  281. package/chunks/{updateCheck-LOS5GYFC.js → updateCheck-P6JJ4MBU.js} +48 -47
  282. package/chunks/{useAutoAcceptIndicator-MHAPY52L.js → useAutoAcceptIndicator-KV2AANVG.js} +53 -52
  283. package/chunks/{validateNonInterActiveAuth-QV22HNQU.js → validateNonInterActiveAuth-HXRCYXY7.js} +89 -88
  284. package/chunks/{version-DALWZHKQ.js → version-HH5V762G.js} +2 -2
  285. package/chunks/{web-fetch-JMJVMYFE.js → web-fetch-LVXPFB5O.js} +19 -19
  286. package/chunks/{web-search-DNDUIPU5.js → web-search-4E234FSM.js} +11 -11
  287. package/chunks/{workflow-JGNN64PM.js → workflow-GUE6WIMP.js} +117 -50
  288. package/chunks/workspace-providers-status-TUWLGJOF.js +100 -0
  289. package/chunks/{workspace-registration-store-LRJG7QA4.js → workspace-registration-store-22XXHPKR.js} +1 -1
  290. package/chunks/{workspace-registry-KVXIFM36.js → workspace-registry-HUFJF5W5.js} +50 -49
  291. package/chunks/{workspace-service-PO4AAKKT.js → workspace-service-NAGTBJXJ.js} +54 -53
  292. package/chunks/workspace-skills-status-LWDBXAQI.js +100 -0
  293. package/chunks/{workspace-trust-reconciler-DOZPCVHG.js → workspace-trust-reconciler-DLWV2ZO6.js} +57 -56
  294. package/chunks/write-file-QVHVOKKR.js +87 -0
  295. package/chunks/{zh-AGL2FVBI.js → zh-LMSTK4WD.js} +2 -1
  296. package/chunks/{zh-TW-KI66MHQY.js → zh-TW-SQ4HTSCW.js} +2 -1
  297. package/chunks/{zoom-image-CNC77ZMA.js → zoom-image-CJDXYWJH.js} +15 -15
  298. package/cli.js +18 -17
  299. package/locales/ca.js +1 -0
  300. package/locales/de.js +1 -0
  301. package/locales/en.js +1 -0
  302. package/locales/fr.js +1 -0
  303. package/locales/ja.js +1 -0
  304. package/locales/pt.js +1 -0
  305. package/locales/ru.js +1 -0
  306. package/locales/zh-TW.js +1 -0
  307. package/locales/zh.js +1 -0
  308. package/package.json +4 -4
  309. package/web-shell/assets/{arc-CDk0d60K.js → arc-DagtOPoO.js} +1 -1
  310. package/web-shell/assets/{architectureDiagram-3BPJPVTR-h-W3I2lP.js → architectureDiagram-3BPJPVTR-Dc3kGCBm.js} +1 -1
  311. package/web-shell/assets/{blockDiagram-GPEHLZMM-D1pvSmZg.js → blockDiagram-GPEHLZMM-BUZvQLL_.js} +1 -1
  312. package/web-shell/assets/{c4Diagram-AAUBKEIU-ByAm5ZNf.js → c4Diagram-AAUBKEIU-BbBgCu9K.js} +1 -1
  313. package/web-shell/assets/channel-aMHKHCQ2.js +1 -0
  314. package/web-shell/assets/{chunk-2J33WTMH-VrGPPOGV.js → chunk-2J33WTMH-CZ4miMNB.js} +1 -1
  315. package/web-shell/assets/{chunk-4BX2VUAB-B7hTowgG.js → chunk-4BX2VUAB-B2_qQSGx.js} +1 -1
  316. package/web-shell/assets/{chunk-55IACEB6-j1Fq8DpE.js → chunk-55IACEB6-EdmTwZW7.js} +1 -1
  317. package/web-shell/assets/{chunk-727SXJPM-UjABYpF2.js → chunk-727SXJPM-l2EpyrLV.js} +1 -1
  318. package/web-shell/assets/{chunk-AQP2D5EJ-D4uBItrs.js → chunk-AQP2D5EJ-0q9sx5lV.js} +1 -1
  319. package/web-shell/assets/{chunk-FMBD7UC4-DeFbKlb8.js → chunk-FMBD7UC4-CbGnA4Dp.js} +1 -1
  320. package/web-shell/assets/{chunk-ND2GUHAM-rQJ8TIgT.js → chunk-ND2GUHAM-D8JBELgZ.js} +1 -1
  321. package/web-shell/assets/{chunk-QZHKN3VN-DAGcRxvq.js → chunk-QZHKN3VN-DQMpGGOO.js} +1 -1
  322. package/web-shell/assets/classDiagram-4FO5ZUOK-zASpLzDx.js +1 -0
  323. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-zASpLzDx.js +1 -0
  324. package/web-shell/assets/{cose-bilkent-S5V4N54A-MaE7MJSt.js → cose-bilkent-S5V4N54A-DzM-ZRsM.js} +1 -1
  325. package/web-shell/assets/{dagre-BM42HDAG-DzijYGSb.js → dagre-BM42HDAG-uxLS-TtN.js} +1 -1
  326. package/web-shell/assets/{diagram-2AECGRRQ-WdbG7WnX.js → diagram-2AECGRRQ-DH7Gnqzr.js} +1 -1
  327. package/web-shell/assets/{diagram-5GNKFQAL-NYutsBnw.js → diagram-5GNKFQAL-B2TngKRK.js} +1 -1
  328. package/web-shell/assets/{diagram-KO2AKTUF-Dqg0eBY0.js → diagram-KO2AKTUF-DQ61-HiV.js} +1 -1
  329. package/web-shell/assets/{diagram-LMA3HP47-C7vRP2Lb.js → diagram-LMA3HP47-By6qvgAT.js} +1 -1
  330. package/web-shell/assets/{diagram-OG6HWLK6-B2sEPpPt.js → diagram-OG6HWLK6-ClVSEz-3.js} +1 -1
  331. package/web-shell/assets/{erDiagram-TEJ5UH35-a4zIbzm8.js → erDiagram-TEJ5UH35-C9gFc5Fg.js} +1 -1
  332. package/web-shell/assets/{flowDiagram-I6XJVG4X-BK9y89ya.js → flowDiagram-I6XJVG4X-BWPLLJ5-.js} +1 -1
  333. package/web-shell/assets/{ganttDiagram-6RSMTGT7-wUQTSNvV.js → ganttDiagram-6RSMTGT7-C6RMacQQ.js} +1 -1
  334. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Dnzt4SAi.js → gitGraphDiagram-PVQCEYII-LnqiWuka.js} +1 -1
  335. package/web-shell/assets/index---fOcMdS.js +1789 -0
  336. package/web-shell/assets/{index-BA3wUcKL.js → index-B9iqcrv0.js} +1 -1
  337. package/web-shell/assets/index-BIGQygTL.css +5 -0
  338. package/web-shell/assets/{infoDiagram-5YYISTIA-DcaoToij.js → infoDiagram-5YYISTIA-Bc4iS8YB.js} +1 -1
  339. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-DzduqhP2.js → ishikawaDiagram-YF4QCWOH-9pH4Dpnd.js} +1 -1
  340. package/web-shell/assets/{journeyDiagram-JHISSGLW-BvviZR_O.js → journeyDiagram-JHISSGLW-C-YMnw2W.js} +1 -1
  341. package/web-shell/assets/{kanban-definition-UN3LZRKU-Efm2JxY3.js → kanban-definition-UN3LZRKU-D-PaAIp-.js} +1 -1
  342. package/web-shell/assets/{linear-DtY3IbOs.js → linear-DpLgI2kt.js} +1 -1
  343. package/web-shell/assets/{mermaid.core-PzpFqoMe.js → mermaid.core-nZbOHGxx.js} +5 -5
  344. package/web-shell/assets/{mindmap-definition-RKZ34NQL-BLlTkHS0.js → mindmap-definition-RKZ34NQL-Dq0xxnET.js} +1 -1
  345. package/web-shell/assets/{pieDiagram-4H26LBE5-D-mKF-jE.js → pieDiagram-4H26LBE5-ctqG2eeF.js} +1 -1
  346. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-DYCzslGm.js → quadrantDiagram-W4KKPZXB-MivToddn.js} +1 -1
  347. package/web-shell/assets/{requirementDiagram-4Y6WPE33-Dfpxlk7R.js → requirementDiagram-4Y6WPE33-DrLLnkpQ.js} +1 -1
  348. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-D5cRaaxh.js → sankeyDiagram-5OEKKPKP-sYdYhdpV.js} +1 -1
  349. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-s04DReiS.js → sequenceDiagram-3UESZ5HK-CuvhxDOs.js} +1 -1
  350. package/web-shell/assets/{stateDiagram-AJRCARHV-01UNFgnb.js → stateDiagram-AJRCARHV-BLZgbV7Q.js} +1 -1
  351. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DR_gXrIC.js +1 -0
  352. package/web-shell/assets/{timeline-definition-PNZ67QCA-DX8_wZBC.js → timeline-definition-PNZ67QCA-lNr2Uz_Q.js} +1 -1
  353. package/web-shell/assets/{vennDiagram-CIIHVFJN-BK0FlBme.js → vennDiagram-CIIHVFJN-CoaexGVO.js} +1 -1
  354. package/web-shell/assets/{wardley-L42UT6IY-DkPc9UlD.js → wardley-L42UT6IY-DG1vhGKA.js} +1 -1
  355. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-DNKkpDAo.js → wardleyDiagram-YWT4CUSO-CqNjF5xC.js} +1 -1
  356. package/web-shell/assets/{xychartDiagram-2RQKCTM6-CiPwg8QG.js → xychartDiagram-2RQKCTM6-BXg1gx3C.js} +1 -1
  357. package/web-shell/index.html +2 -2
  358. package/chunks/agent-headless-HYEHZFH6.js +0 -86
  359. package/chunks/bridge-FHINXZMN.js +0 -103
  360. package/chunks/channel-settings-store-OXYG5S5X.js +0 -101
  361. package/chunks/chunk-I5VM3SKY.js +0 -451
  362. package/chunks/chunk-PDPFQ2FO.js +0 -156
  363. package/chunks/daemon-status-provider-L3J6GKCT.js +0 -102
  364. package/chunks/daemon-trust-policy-4PHPY23S.js +0 -98
  365. package/chunks/exitPlanMode-RWJR2KGB.js +0 -84
  366. package/chunks/handleAutoUpdate-NHFSGYTF.js +0 -93
  367. package/chunks/initializer-Y5DJLT43.js +0 -99
  368. package/chunks/list-YHNQ32CS.js +0 -102
  369. package/chunks/loadedSettingsAdapter-GHUQK7H4.js +0 -96
  370. package/chunks/mcp-EA3KO6FS.js +0 -96
  371. package/chunks/nonInteractiveCli-NNOR56HU.js +0 -162
  372. package/chunks/read-file-KKTXGIZD.js +0 -32
  373. package/chunks/ripGrep-SJVAAYDV.js +0 -84
  374. package/chunks/serve-IH4XR5IL.js +0 -106
  375. package/chunks/spawnChannel-UAQMH6Y6.js +0 -94
  376. package/chunks/theme-manager-ZNDGAHJN.js +0 -88
  377. package/chunks/total-session-admission-66UDSOHO.js +0 -98
  378. package/chunks/workspace-providers-status-K22B3Z6B.js +0 -99
  379. package/chunks/workspace-skills-status-DDYCBVSH.js +0 -99
  380. package/chunks/write-file-TT6MWIKC.js +0 -86
  381. package/web-shell/assets/channel-DPFUV4oi.js +0 -1
  382. package/web-shell/assets/classDiagram-4FO5ZUOK-CLm0hVvw.js +0 -1
  383. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CLm0hVvw.js +0 -1
  384. package/web-shell/assets/index-BjC3yjjL.css +0 -5
  385. package/web-shell/assets/index-QzFq6w7o.js +0 -1775
  386. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DXb5olqv.js +0 -1
@@ -2,6 +2,8 @@
2
2
  "use strict";
3
3
  import {
4
4
  EVENT_CHAT_COMPRESSION,
5
+ EVENT_SESSION_END,
6
+ EVENT_SESSION_START,
5
7
  SERVICE_NAME,
6
8
  SPAN_HOOK,
7
9
  SPAN_INTERACTION,
@@ -11,14 +13,19 @@ import {
11
13
  SPAN_TOOL_BLOCKED_ON_USER,
12
14
  SPAN_TOOL_EXECUTION,
13
15
  TOOL_FAILURE_KIND_ATTRIBUTE,
14
- TOOL_FAILURE_KIND_CANCELLED
15
- } from "./chunk-PDPFQ2FO.js";
16
+ TOOL_FAILURE_KIND_CANCELLED,
17
+ require_src,
18
+ sessionIdContext
19
+ } from "./chunk-K5IDV3PC.js";
16
20
  import {
17
21
  createDebugLogger,
18
22
  getCurrentSessionId,
23
+ getErrorType,
24
+ getSessionIdFromContext,
19
25
  setSessionContext,
26
+ setSessionIdOnContext,
20
27
  setShellTracePropagation
21
- } from "./chunk-OIVKILPI.js";
28
+ } from "./chunk-HOSVOUDK.js";
22
29
  import {
23
30
  DiagLogLevel,
24
31
  ROOT_CONTEXT,
@@ -36,7 +43,8 @@ import {
36
43
  init_esbuild_shims
37
44
  } from "./chunk-5O2XNYP6.js";
38
45
  import {
39
- __name
46
+ __name,
47
+ __toESM
40
48
  } from "./chunk-J2S4EL5Y.js";
41
49
 
42
50
  // packages/core/src/telemetry/metrics.ts
@@ -758,6 +766,55 @@ function recordMemoryRecallDeliveryMetrics(config, latencyMs, attrs) {
758
766
  }
759
767
  __name(recordMemoryRecallDeliveryMetrics, "recordMemoryRecallDeliveryMetrics");
760
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
+
761
818
  // packages/core/src/telemetry/session-tracing.ts
762
819
  init_esbuild_shims();
763
820
  init_esm();
@@ -846,6 +903,40 @@ function createSessionRootContext(sessionId) {
846
903
  }
847
904
  __name(createSessionRootContext, "createSessionRootContext");
848
905
 
906
+ // packages/core/src/telemetry/session-events.ts
907
+ init_esbuild_shims();
908
+ var import_api_logs = __toESM(require_src(), 1);
909
+ var startedSessionId;
910
+ function emitSessionStart(sessionId, previousSessionId) {
911
+ if (startedSessionId === sessionId) return;
912
+ startedSessionId = sessionId;
913
+ const attributes = {
914
+ "event.name": EVENT_SESSION_START,
915
+ "event.timestamp": (/* @__PURE__ */ new Date()).toISOString(),
916
+ "session.id": sessionId,
917
+ ...previousSessionId ? { "session.previous_id": previousSessionId } : {}
918
+ };
919
+ import_api_logs.logs.getLogger(SERVICE_NAME).emit({
920
+ body: "Session started.",
921
+ attributes
922
+ });
923
+ }
924
+ __name(emitSessionStart, "emitSessionStart");
925
+ function emitSessionEnd(sessionId) {
926
+ if (startedSessionId === sessionId) {
927
+ startedSessionId = void 0;
928
+ }
929
+ import_api_logs.logs.getLogger(SERVICE_NAME).emit({
930
+ body: "Session ended.",
931
+ attributes: {
932
+ "event.name": EVENT_SESSION_END,
933
+ "event.timestamp": (/* @__PURE__ */ new Date()).toISOString(),
934
+ "session.id": sessionId
935
+ }
936
+ });
937
+ }
938
+ __name(emitSessionEnd, "emitSessionEnd");
939
+
849
940
  // packages/core/src/telemetry/sdk.ts
850
941
  function createTelemetryDiagLogger() {
851
942
  const debugLogger3 = createDebugLogger("OTEL");
@@ -901,7 +992,7 @@ function initializeTelemetry(config) {
901
992
  telemetryInitPromise ??= (async () => {
902
993
  const debugLogger3 = createDebugLogger("OTEL");
903
994
  try {
904
- const { startTelemetrySdk } = await import("./sdk-impl-7W7AKCS4.js");
995
+ const { startTelemetrySdk } = await import("./sdk-impl-SK4P5WON.js");
905
996
  if (telemetryInitialized) return;
906
997
  const started = await startTelemetrySdk(config);
907
998
  if (!started) return;
@@ -912,6 +1003,7 @@ function initializeTelemetry(config) {
912
1003
  activeMetricReader = started.metricReader;
913
1004
  const sessionId = config.getSessionId();
914
1005
  setSessionContext(createSessionRootContext(sessionId), sessionId);
1006
+ emitSessionStart(sessionId);
915
1007
  setShellTracePropagation(
916
1008
  config.getOutboundCorrelationPropagateTraceContext()
917
1009
  );
@@ -951,7 +1043,11 @@ function shutdownTelemetry() {
951
1043
  telemetryShutdownPromise = void 0;
952
1044
  return;
953
1045
  }
954
- endInteractionSpan("cancelled");
1046
+ endAllInteractionSpans("cancelled");
1047
+ const currentSessionId = getCurrentSessionId();
1048
+ if (currentSessionId) {
1049
+ emitSessionEnd(currentSessionId);
1050
+ }
955
1051
  const currentSdk = sdk;
956
1052
  const debugLogger3 = createDebugLogger("OTEL");
957
1053
  let timer;
@@ -1041,27 +1137,29 @@ var NOOP_SPAN = trace.wrapSpanContext({
1041
1137
  var interactionContext = new AsyncLocalStorage();
1042
1138
  var toolContext = new AsyncLocalStorage();
1043
1139
  var subagentContext = new AsyncLocalStorage();
1140
+ var activeInteractionsByPromptId = /* @__PURE__ */ new Map();
1044
1141
  var interactionIdentityByPromptId = /* @__PURE__ */ new Map();
1045
1142
  function isInNativeSubagentSpan() {
1046
1143
  const ctx = subagentContext.getStore();
1047
1144
  return ctx !== void 0 && !ctx.ended;
1048
1145
  }
1049
1146
  __name(isInNativeSubagentSpan, "isInNativeSubagentSpan");
1050
- function resolveSessionId(parentCtx) {
1147
+ function resolveSessionId(parentCtx, explicitSessionId, activeContext = context.active()) {
1051
1148
  const fromParent = parentCtx?.attributes?.["session.id"];
1052
- return typeof fromParent === "string" && fromParent ? fromParent : getCurrentSessionId();
1149
+ if (typeof fromParent === "string" && fromParent) return fromParent;
1150
+ if (explicitSessionId) return explicitSessionId;
1151
+ return getSessionIdFromContext(activeContext) ?? (sessionIdContext.getStore() || getCurrentSessionId());
1053
1152
  }
1054
1153
  __name(resolveSessionId, "resolveSessionId");
1055
- function resolveGenAiUserId(parentCtx, promptId) {
1154
+ function resolveGenAiUserId(parentCtx, promptId, explicitUserId) {
1056
1155
  const logicalParent = parentCtx ?? (promptId ? interactionIdentityByPromptId.get(promptId) : void 0);
1057
1156
  const value = logicalParent?.attributes["gen_ai.user.id"];
1058
- return typeof value === "string" && value ? value : void 0;
1157
+ return typeof value === "string" && value ? value : explicitUserId;
1059
1158
  }
1060
1159
  __name(resolveGenAiUserId, "resolveGenAiUserId");
1061
1160
  var activeSpans = /* @__PURE__ */ new Map();
1062
1161
  var strongSpans = /* @__PURE__ */ new Map();
1063
1162
  var interactionSequence = 0;
1064
- var lastInteractionCtx;
1065
1163
  var cleanupIntervalStarted = false;
1066
1164
  var SPAN_TTL_MS_DEFAULT = 30 * 60 * 1e3;
1067
1165
  var SPAN_TTL_MS_LONG = 4 * 60 * 60 * 1e3;
@@ -1081,7 +1179,7 @@ function ttlFor(ctx) {
1081
1179
  __name(ttlFor, "ttlFor");
1082
1180
  function sweepStaleSpans(now) {
1083
1181
  for (const [promptId, ctx] of interactionIdentityByPromptId) {
1084
- if (now - ctx.startTime >= SPAN_TTL_MS_DEFAULT) {
1182
+ if (now - ctx.lastActivityTime >= SPAN_TTL_MS_DEFAULT) {
1085
1183
  interactionIdentityByPromptId.delete(promptId);
1086
1184
  }
1087
1185
  }
@@ -1092,9 +1190,16 @@ function sweepStaleSpans(now) {
1092
1190
  strongSpans.delete(spanId);
1093
1191
  continue;
1094
1192
  }
1095
- 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;
1096
1195
  if (!ctx.ended) {
1097
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
+ }
1098
1203
  const ageMs = now - ctx.startTime;
1099
1204
  const toolName = ctx.attributes["gen_ai.tool.name"] ?? ctx.attributes["tool.name"];
1100
1205
  const callId = ctx.attributes["tool.call_id"];
@@ -1163,55 +1268,146 @@ function truncateSpanText(s, maxChars = SPAN_TEXT_MAX_CHARS) {
1163
1268
  }
1164
1269
  __name(truncateSpanText, "truncateSpanText");
1165
1270
  function truncateSpanError(s) {
1166
- return truncateSpanText(s);
1271
+ return truncateSpanText(redactUrlCredentials(stripAnsiAndControl(s)));
1167
1272
  }
1168
1273
  __name(truncateSpanError, "truncateSpanError");
1169
1274
  function getTracer() {
1170
1275
  return trace.getTracer(SERVICE_NAME, "1.0.0");
1171
1276
  }
1172
1277
  __name(getTracer, "getTracer");
1173
- function startInteractionSpan(config, options) {
1174
- if (!isTelemetrySdkInitialized()) return;
1175
- ensureCleanupInterval();
1176
- interactionSequence++;
1278
+ function buildInteractionAttributes(config, options) {
1279
+ const sessionId = config.getSessionId();
1177
1280
  const userId = config.getTelemetryUserId();
1178
- const attributes = {
1179
- "session.id": config.getSessionId(),
1281
+ return {
1282
+ "session.id": sessionId,
1180
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" } : {},
1181
1288
  "qwen-code.prompt_id": options.promptId,
1182
1289
  "qwen-code.message_type": options.messageType,
1183
1290
  "qwen-code.model": options.model,
1184
1291
  "qwen-code.approval_mode": config.getApprovalMode(),
1185
1292
  "interaction.sequence": interactionSequence
1186
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);
1187
1393
  const span = getTracer().startSpan(
1188
1394
  SPAN_INTERACTION,
1189
1395
  { kind: SpanKind.INTERNAL, attributes },
1190
1396
  ROOT_CONTEXT
1191
1397
  );
1192
- const spanId = getSpanId(span);
1193
1398
  const spanContextObj = {
1194
1399
  span,
1195
1400
  startTime: Date.now(),
1401
+ lastActivityTime: Date.now(),
1196
1402
  attributes,
1197
1403
  type: "interaction"
1198
1404
  };
1199
- activeSpans.set(spanId, new WeakRef(spanContextObj));
1200
- strongSpans.set(spanId, spanContextObj);
1201
- if (userId) {
1202
- interactionIdentityByPromptId.set(options.promptId, {
1203
- startTime: spanContextObj.startTime,
1204
- attributes: { "gen_ai.user.id": userId }
1205
- });
1206
- } else {
1207
- interactionIdentityByPromptId.delete(options.promptId);
1208
- }
1209
- lastInteractionCtx = spanContextObj;
1405
+ registerInteractionContext(options.promptId, spanContextObj);
1210
1406
  interactionContext.enterWith(spanContextObj);
1211
1407
  }
1212
1408
  __name(startInteractionSpan, "startInteractionSpan");
1213
1409
  function endInteractionSpan(status, metadata) {
1214
- const spanCtx = interactionContext.getStore() ?? lastInteractionCtx;
1410
+ const spanCtx = getInteractionContext(metadata?.promptId);
1215
1411
  if (!spanCtx) return;
1216
1412
  if (spanCtx.ended) {
1217
1413
  debugLogger2.debug(
@@ -1219,42 +1415,24 @@ function endInteractionSpan(status, metadata) {
1219
1415
  );
1220
1416
  return;
1221
1417
  }
1222
- spanCtx.ended = true;
1223
- lastInteractionCtx = void 0;
1224
- const duration = Date.now() - spanCtx.startTime;
1225
- spanCtx.span.setAttributes({
1226
- "interaction.duration_ms": duration,
1227
- "qwen-code.turn_status": status
1228
- });
1229
- if (status === "error") {
1230
- spanCtx.span.setStatus({
1231
- code: SpanStatusCode.ERROR,
1232
- message: metadata?.errorMessage ?? "unknown error"
1233
- });
1234
- } else {
1235
- 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);
1236
1426
  }
1237
- spanCtx.span.end();
1238
- const spanId = getSpanId(spanCtx.span);
1239
- activeSpans.delete(spanId);
1240
- strongSpans.delete(spanId);
1241
1427
  interactionContext.enterWith(void 0);
1242
1428
  }
1243
- __name(endInteractionSpan, "endInteractionSpan");
1429
+ __name(endAllInteractionSpans, "endAllInteractionSpans");
1244
1430
  async function withInteractionSpan(config, options, fn, getResultStatus) {
1245
1431
  if (!isTelemetrySdkInitialized()) return await fn();
1246
1432
  ensureCleanupInterval();
1247
1433
  interactionSequence++;
1248
- const userId = config.getTelemetryUserId();
1249
- const attributes = {
1250
- "session.id": config.getSessionId(),
1251
- ...userId ? { "gen_ai.user.id": userId } : {},
1252
- "qwen-code.prompt_id": options.promptId,
1253
- "qwen-code.message_type": options.messageType,
1254
- "qwen-code.model": options.model,
1255
- "qwen-code.approval_mode": config.getApprovalMode(),
1256
- "interaction.sequence": interactionSequence
1257
- };
1434
+ const sessionId = config.getSessionId();
1435
+ const attributes = buildInteractionAttributes(config, options);
1258
1436
  const parentContext = options.parentContext ?? ROOT_CONTEXT;
1259
1437
  const span = getTracer().startSpan(
1260
1438
  SPAN_INTERACTION,
@@ -1264,105 +1442,95 @@ async function withInteractionSpan(config, options, fn, getResultStatus) {
1264
1442
  },
1265
1443
  parentContext
1266
1444
  );
1267
- const spanId = getSpanId(span);
1268
1445
  const spanContextObj = {
1269
1446
  span,
1270
1447
  startTime: Date.now(),
1448
+ lastActivityTime: Date.now(),
1271
1449
  attributes,
1272
1450
  type: "interaction"
1273
1451
  };
1274
- activeSpans.set(spanId, new WeakRef(spanContextObj));
1275
- strongSpans.set(spanId, spanContextObj);
1276
- if (userId) {
1277
- interactionIdentityByPromptId.set(options.promptId, {
1278
- startTime: spanContextObj.startTime,
1279
- attributes: { "gen_ai.user.id": userId }
1280
- });
1281
- } else {
1282
- interactionIdentityByPromptId.delete(options.promptId);
1283
- }
1284
- const activeContext = trace.setSpan(parentContext, span);
1452
+ registerInteractionContext(options.promptId, spanContextObj);
1453
+ const activeContext = trace.setSpan(
1454
+ setSessionIdOnContext(parentContext, sessionId),
1455
+ span
1456
+ );
1285
1457
  return await context.with(
1286
1458
  activeContext,
1287
1459
  async () => interactionContext.run(spanContextObj, async () => {
1288
1460
  let terminalStatus = "ok";
1289
- let errorStatusSet = false;
1461
+ let errorMetadata;
1290
1462
  try {
1291
1463
  const result = await fn();
1292
1464
  terminalStatus = getResultStatus?.(result) ?? "ok";
1293
1465
  return result;
1294
1466
  } catch (error) {
1295
1467
  terminalStatus = "error";
1296
- span.setStatus({
1297
- code: SpanStatusCode.ERROR,
1298
- message: truncateSpanError(
1299
- error instanceof Error ? error.message : String(error)
1300
- )
1301
- });
1302
- errorStatusSet = true;
1468
+ errorMetadata = {
1469
+ promptId: options.promptId,
1470
+ errorMessage: error instanceof Error ? error.message : String(error),
1471
+ errorType: getErrorType(error)
1472
+ };
1303
1473
  throw error;
1304
1474
  } finally {
1305
- if (!spanContextObj.ended) {
1306
- spanContextObj.ended = true;
1307
- const duration = Date.now() - spanContextObj.startTime;
1308
- span.setAttributes({
1309
- "interaction.duration_ms": duration,
1310
- "qwen-code.turn_status": terminalStatus
1311
- });
1312
- if (terminalStatus === "ok") {
1313
- span.setStatus({ code: SpanStatusCode.OK });
1314
- } else if (terminalStatus === "error" && !errorStatusSet) {
1315
- span.setStatus({
1316
- code: SpanStatusCode.ERROR,
1317
- message: "interaction error"
1318
- });
1319
- }
1320
- span.end();
1321
- activeSpans.delete(spanId);
1322
- strongSpans.delete(spanId);
1323
- }
1475
+ finalizeInteractionContext(spanContextObj, terminalStatus, {
1476
+ promptId: options.promptId,
1477
+ ...terminalStatus === "error" && !errorMetadata ? {
1478
+ errorMessage: "interaction error",
1479
+ errorType: "interaction_error"
1480
+ } : errorMetadata
1481
+ });
1324
1482
  }
1325
1483
  })
1326
1484
  );
1327
1485
  }
1328
1486
  __name(withInteractionSpan, "withInteractionSpan");
1329
- function startLLMRequestSpan(model, promptId, options) {
1487
+ function startLLMRequestSpanWithContext(model, promptId, options) {
1330
1488
  if (!isTelemetrySdkInitialized()) {
1331
- return NOOP_SPAN;
1489
+ return {
1490
+ span: NOOP_SPAN,
1491
+ context: trace.setSpan(context.active(), NOOP_SPAN)
1492
+ };
1332
1493
  }
1333
- const parentCtx = subagentContext.getStore() ?? interactionContext.getStore();
1334
- const ctx = resolveParentContext(parentCtx);
1335
- const sessionId = resolveSessionId(parentCtx);
1336
- const userId = resolveGenAiUserId(parentCtx, promptId);
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);
1337
1500
  const attributes = {
1338
1501
  ...sessionId ? { "session.id": sessionId } : {},
1339
1502
  ...sessionId ? { "gen_ai.conversation.id": sessionId } : {},
1340
1503
  ...userId ? { "gen_ai.user.id": userId } : {},
1341
1504
  "qwen-code.prompt_id": promptId,
1342
- "llm_request.context": subagentContext.getStore() ? "subagent" : interactionContext.getStore() ? "interaction" : "standalone",
1505
+ "llm_request.context": parentCtx?.type === "subagent" ? "subagent" : interactionParentCtx ? "interaction" : "standalone",
1343
1506
  // Emit the version-pinned OTel GenAI semantic convention.
1344
1507
  "gen_ai.request.model": model,
1345
1508
  ...options?.operationName ? { "gen_ai.operation.name": options.operationName } : {},
1346
1509
  ...options?.providerName ? { "gen_ai.provider.name": options.providerName } : {},
1347
1510
  ...options?.outputType ? { "gen_ai.output.type": options.outputType } : {}
1348
1511
  };
1512
+ const sessionContext = setSessionIdOnContext(ctx, sessionId);
1349
1513
  const span = getTracer().startSpan(
1350
1514
  SPAN_LLM_REQUEST,
1351
1515
  { kind: SpanKind.INTERNAL, attributes },
1352
- ctx
1516
+ sessionContext
1353
1517
  );
1354
1518
  const spanId = getSpanId(span);
1355
1519
  const spanContextObj = {
1356
1520
  span,
1357
1521
  startTime: Date.now(),
1522
+ ...interactionParentCtx ? { interactionOwner: interactionParentCtx } : {},
1358
1523
  attributes,
1359
1524
  type: "llm_request"
1360
1525
  };
1361
1526
  activeSpans.set(spanId, new WeakRef(spanContextObj));
1362
1527
  strongSpans.set(spanId, spanContextObj);
1363
- return span;
1528
+ return {
1529
+ span,
1530
+ context: trace.setSpan(sessionContext, span)
1531
+ };
1364
1532
  }
1365
- __name(startLLMRequestSpan, "startLLMRequestSpan");
1533
+ __name(startLLMRequestSpanWithContext, "startLLMRequestSpanWithContext");
1366
1534
  function endLLMRequestSpan(span, metadata) {
1367
1535
  const spanId = getSpanId(span);
1368
1536
  const spanCtx = activeSpans.get(spanId)?.deref();
@@ -1429,10 +1597,13 @@ function endLLMRequestSpan(span, metadata) {
1429
1597
  if (metadata.subagentName !== void 0) {
1430
1598
  endAttributes["subagent_name"] = metadata.subagentName;
1431
1599
  }
1432
- if (metadata.errorType !== void 0) {
1600
+ if (metadata.errorType && !metadata.cancelled) {
1433
1601
  endAttributes["error_type"] = metadata.errorType;
1434
1602
  endAttributes["error.type"] = metadata.errorType;
1435
1603
  }
1604
+ if (!metadata.success && !metadata.cancelled && endAttributes["error.type"] === void 0) {
1605
+ endAttributes["error.type"] = "llm_error";
1606
+ }
1436
1607
  if (metadata.errorStatusCode !== void 0) {
1437
1608
  endAttributes["error_status_code"] = metadata.errorStatusCode;
1438
1609
  }
@@ -1466,9 +1637,7 @@ function endLLMRequestSpan(span, metadata) {
1466
1637
  `Failed to record API request breakdown histogram: ${error instanceof Error ? error.message : String(error)}`
1467
1638
  );
1468
1639
  }
1469
- if (metadata === void 0 || metadata.success) {
1470
- spanCtx.span.setStatus({ code: SpanStatusCode.OK });
1471
- } else {
1640
+ if (metadata !== void 0 && !metadata.success && !metadata.cancelled) {
1472
1641
  spanCtx.span.setStatus({
1473
1642
  code: SpanStatusCode.ERROR,
1474
1643
  message: metadata.error ? truncateSpanError(metadata.error) : "unknown error"
@@ -1488,6 +1657,7 @@ function endLLMRequestSpan(span, metadata) {
1488
1657
  }
1489
1658
  activeSpans.delete(spanId);
1490
1659
  strongSpans.delete(spanId);
1660
+ touchInteractionContext(spanCtx.interactionOwner);
1491
1661
  }
1492
1662
  __name(endLLMRequestSpan, "endLLMRequestSpan");
1493
1663
  function startToolSpan(toolName, attrs, description, promptId) {
@@ -1496,10 +1666,13 @@ function startToolSpan(toolName, attrs, description, promptId) {
1496
1666
  }
1497
1667
  let span;
1498
1668
  try {
1499
- const parentCtx = subagentContext.getStore() ?? interactionContext.getStore();
1500
- const ctx = resolveParentContext(parentCtx);
1501
- const sessionId = resolveSessionId(parentCtx);
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);
1502
1674
  const userId = resolveGenAiUserId(parentCtx, promptId);
1675
+ const agentName = (subagentContext.getStore() ?? interactionParentCtx)?.attributes["gen_ai.agent.name"];
1503
1676
  const attributes = {
1504
1677
  ...sessionId ? { "session.id": sessionId } : {},
1505
1678
  ...attrs,
@@ -1507,6 +1680,7 @@ function startToolSpan(toolName, attrs, description, promptId) {
1507
1680
  "gen_ai.operation.name": "execute_tool",
1508
1681
  "gen_ai.tool.name": toolName,
1509
1682
  "gen_ai.tool.type": "function",
1683
+ ...typeof agentName === "string" ? { "gen_ai.agent.name": agentName } : {},
1510
1684
  ...description ? {
1511
1685
  "gen_ai.tool.description": truncateSpanText(
1512
1686
  description,
@@ -1514,6 +1688,9 @@ function startToolSpan(toolName, attrs, description, promptId) {
1514
1688
  )
1515
1689
  } : {}
1516
1690
  };
1691
+ if (typeof agentName !== "string") {
1692
+ delete attributes["gen_ai.agent.name"];
1693
+ }
1517
1694
  span = getTracer().startSpan(
1518
1695
  SPAN_TOOL,
1519
1696
  { kind: SpanKind.INTERNAL, attributes },
@@ -1523,6 +1700,7 @@ function startToolSpan(toolName, attrs, description, promptId) {
1523
1700
  const spanContextObj = {
1524
1701
  span,
1525
1702
  startTime: Date.now(),
1703
+ ...interactionParentCtx ? { interactionOwner: interactionParentCtx } : {},
1526
1704
  attributes,
1527
1705
  type: "tool"
1528
1706
  };
@@ -1545,7 +1723,11 @@ function runInToolSpanContext(span, fn) {
1545
1723
  const spanId = getSpanId(span);
1546
1724
  const spanCtx = activeSpans.get(spanId)?.deref();
1547
1725
  if (!spanCtx) return fn();
1548
- const otelCtxWithSpan = trace.setSpan(context.active(), span);
1726
+ const sessionId = resolveSessionId(spanCtx);
1727
+ const otelCtxWithSpan = trace.setSpan(
1728
+ setSessionIdOnContext(context.active(), sessionId),
1729
+ span
1730
+ );
1549
1731
  return toolContext.run(spanCtx, () => context.with(otelCtxWithSpan, fn));
1550
1732
  }
1551
1733
  __name(runInToolSpanContext, "runInToolSpanContext");
@@ -1569,17 +1751,16 @@ function endToolSpan(span, metadata) {
1569
1751
  }
1570
1752
  if (metadata.error !== void 0)
1571
1753
  endAttributes["error"] = truncateSpanError(metadata.error);
1754
+ if (metadata.success === false && !metadata.cancelled) {
1755
+ endAttributes["error.type"] = "tool_error";
1756
+ }
1572
1757
  if (metadata.cancelled) {
1573
1758
  endAttributes[TOOL_FAILURE_KIND_ATTRIBUTE] = TOOL_FAILURE_KIND_CANCELLED;
1574
1759
  }
1575
1760
  }
1576
1761
  spanCtx.span.setAttributes(endAttributes);
1577
1762
  if (metadata) {
1578
- if (metadata.cancelled) {
1579
- spanCtx.span.setStatus({ code: SpanStatusCode.UNSET });
1580
- } else if (metadata.success !== false) {
1581
- spanCtx.span.setStatus({ code: SpanStatusCode.OK });
1582
- } else {
1763
+ if (!metadata.cancelled && metadata.success === false) {
1583
1764
  spanCtx.span.setStatus({
1584
1765
  code: SpanStatusCode.ERROR,
1585
1766
  message: metadata.error ? truncateSpanError(metadata.error) : "tool error"
@@ -1600,6 +1781,7 @@ function endToolSpan(span, metadata) {
1600
1781
  }
1601
1782
  activeSpans.delete(spanId);
1602
1783
  strongSpans.delete(spanId);
1784
+ touchInteractionContext(spanCtx.interactionOwner);
1603
1785
  }
1604
1786
  __name(endToolSpan, "endToolSpan");
1605
1787
  function startToolExecutionSpan(options) {
@@ -1666,6 +1848,8 @@ function endToolExecutionSpan(span, metadata) {
1666
1848
  spanCtx.ended = true;
1667
1849
  try {
1668
1850
  const duration = Date.now() - spanCtx.startTime;
1851
+ const executionStatus = metadata?.executionStatus;
1852
+ const cancelled = metadata?.cancelled === true || executionStatus === "cancelled";
1669
1853
  const endAttributes = {};
1670
1854
  if (metadata?.attributes) {
1671
1855
  Object.assign(endAttributes, metadata.attributes);
@@ -1679,19 +1863,21 @@ function endToolExecutionSpan(span, metadata) {
1679
1863
  if (metadata.executionStatus !== void 0) {
1680
1864
  endAttributes["execution_status"] = metadata.executionStatus;
1681
1865
  }
1682
- if (metadata.errorType !== void 0) {
1866
+ if (metadata.errorType) {
1683
1867
  endAttributes["error_type"] = metadata.errorType;
1684
- 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";
1685
1875
  }
1686
1876
  }
1687
1877
  spanCtx.span.setAttributes(endAttributes);
1688
- const executionStatus = metadata?.executionStatus;
1689
- const cancelled = metadata?.cancelled === true || executionStatus === "cancelled";
1690
1878
  if (metadata && !cancelled && executionStatus !== "not_started") {
1691
1879
  const succeeded = executionStatus === void 0 ? metadata.success !== false : executionStatus === "success";
1692
- if (succeeded) {
1693
- spanCtx.span.setStatus({ code: SpanStatusCode.OK });
1694
- } else {
1880
+ if (!succeeded) {
1695
1881
  spanCtx.span.setStatus({
1696
1882
  code: SpanStatusCode.ERROR,
1697
1883
  message: metadata.error ? truncateSpanError(metadata.error) : "tool execution error"
@@ -1792,6 +1978,7 @@ function startHookSpan(opts) {
1792
1978
  }
1793
1979
  ensureCleanupInterval();
1794
1980
  const parentCtx = toolContext.getStore() ?? subagentContext.getStore() ?? interactionContext.getStore() ?? void 0;
1981
+ touchInteractionContext(interactionContext.getStore());
1795
1982
  const ctx = resolveParentContext(parentCtx);
1796
1983
  const sessionId = resolveSessionId(parentCtx);
1797
1984
  const attributes = {
@@ -1811,6 +1998,7 @@ function startHookSpan(opts) {
1811
1998
  const spanContextObj = {
1812
1999
  span,
1813
2000
  startTime: Date.now(),
2001
+ ...interactionContext.getStore() ? { interactionOwner: interactionContext.getStore() } : {},
1814
2002
  attributes,
1815
2003
  type: "hook"
1816
2004
  };
@@ -1852,6 +2040,8 @@ function endHookSpan(span, metadata) {
1852
2040
  );
1853
2041
  if (metadata.error !== void 0)
1854
2042
  endAttributes["error"] = truncateSpanError(metadata.error);
2043
+ if (metadata.error !== void 0)
2044
+ endAttributes["error.type"] = "hook_error";
1855
2045
  }
1856
2046
  spanCtx.span.setAttributes(endAttributes);
1857
2047
  if (metadata?.error !== void 0) {
@@ -1874,18 +2064,21 @@ function endHookSpan(span, metadata) {
1874
2064
  }
1875
2065
  activeSpans.delete(spanId);
1876
2066
  strongSpans.delete(spanId);
2067
+ touchInteractionContext(spanCtx.interactionOwner);
1877
2068
  }
1878
2069
  __name(endHookSpan, "endHookSpan");
1879
2070
  function startSubagentSpan(opts) {
1880
2071
  if (!isTelemetrySdkInitialized()) return NOOP_SPAN;
1881
2072
  ensureCleanupInterval();
1882
2073
  const parentCtx = subagentContext.getStore() ?? toolContext.getStore() ?? interactionContext.getStore();
2074
+ const sessionId = resolveSessionId(parentCtx, opts.sessionId) ?? opts.sessionId;
1883
2075
  const userId = resolveGenAiUserId(parentCtx);
1884
2076
  const attributes = {
1885
2077
  // Spec-aligned (OTel GenAI Agent Spans, Development status).
1886
2078
  "gen_ai.operation.name": "invoke_agent",
1887
2079
  "gen_ai.agent.name": opts.subagentName,
1888
- "gen_ai.conversation.id": opts.sessionId,
2080
+ "gen_ai.conversation.id": sessionId,
2081
+ "session.id": sessionId,
1889
2082
  ...userId ? { "gen_ai.user.id": userId } : {},
1890
2083
  // Vendor identity and lifecycle. The per-invocation ID stays private;
1891
2084
  // gen_ai.agent.id is reserved for a stable agent definition identity.
@@ -1945,7 +2138,11 @@ function runInSubagentSpanContext(span, fn) {
1945
2138
  const spanId = getSpanId(span);
1946
2139
  const spanCtx = activeSpans.get(spanId)?.deref();
1947
2140
  if (!spanCtx) return fn();
1948
- const otelCtxWithSpan = trace.setSpan(context.active(), span);
2141
+ const sessionId = resolveSessionId(spanCtx);
2142
+ const otelCtxWithSpan = trace.setSpan(
2143
+ setSessionIdOnContext(context.active(), sessionId),
2144
+ span
2145
+ );
1949
2146
  return subagentContext.run(
1950
2147
  spanCtx,
1951
2148
  () => toolContext.run(void 0, () => context.with(otelCtxWithSpan, fn))
@@ -1983,17 +2180,15 @@ function endSubagentSpan(span, metadata) {
1983
2180
  if (metadata.resultSummaryPresent !== void 0) {
1984
2181
  endAttributes["qwen-code.subagent.result_summary_present"] = metadata.resultSummaryPresent;
1985
2182
  }
1986
- if (metadata.error !== void 0) {
2183
+ if (metadata.status === "failed" && metadata.error !== void 0) {
1987
2184
  const truncated = truncateSpanError(metadata.error);
1988
2185
  endAttributes["exception.message"] = truncated;
1989
2186
  }
1990
- if (metadata.errorType !== void 0) {
1991
- endAttributes["error.type"] = metadata.errorType;
2187
+ if (metadata.status === "failed") {
2188
+ endAttributes["error.type"] = metadata.errorType || "subagent_error";
1992
2189
  }
1993
2190
  spanCtx.span.setAttributes(endAttributes);
1994
- if (metadata.status === "completed") {
1995
- spanCtx.span.setStatus({ code: SpanStatusCode.OK });
1996
- } else if (metadata.status === "failed") {
2191
+ if (metadata.status === "failed") {
1997
2192
  spanCtx.span.setStatus({
1998
2193
  code: SpanStatusCode.ERROR,
1999
2194
  message: metadata.error ? truncateSpanError(metadata.error) : "subagent failed"
@@ -2015,12 +2210,16 @@ function endSubagentSpan(span, metadata) {
2015
2210
  strongSpans.delete(spanId);
2016
2211
  }
2017
2212
  __name(endSubagentSpan, "endSubagentSpan");
2018
- function getActiveInteractionSpan() {
2019
- const ctx = interactionContext.getStore() ?? lastInteractionCtx;
2020
- if (!ctx || ctx.ended) return void 0;
2021
- return ctx.span;
2213
+ function getActiveInteractionSpan(promptId) {
2214
+ return getInteractionContext(promptId)?.span;
2022
2215
  }
2023
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");
2024
2223
 
2025
2224
  export {
2026
2225
  getMeter,
@@ -2054,12 +2253,17 @@ export {
2054
2253
  API_CALL_FAILED_SPAN_STATUS_MESSAGE,
2055
2254
  API_CALL_ABORTED_SPAN_STATUS_MESSAGE,
2056
2255
  safeSetStatus,
2256
+ stripAnsiAndControl,
2257
+ safeLiteralReplace,
2258
+ isBinary,
2259
+ normalizeContent,
2260
+ redactUrlCredentials,
2057
2261
  isInNativeSubagentSpan,
2058
2262
  truncateSpanError,
2059
2263
  startInteractionSpan,
2060
2264
  endInteractionSpan,
2061
2265
  withInteractionSpan,
2062
- startLLMRequestSpan,
2266
+ startLLMRequestSpanWithContext,
2063
2267
  endLLMRequestSpan,
2064
2268
  startToolSpan,
2065
2269
  runInToolSpanContext,
@@ -2074,6 +2278,9 @@ export {
2074
2278
  runInSubagentSpanContext,
2075
2279
  endSubagentSpan,
2076
2280
  getActiveInteractionSpan,
2281
+ recordInteractionActivity,
2282
+ emitSessionStart,
2283
+ emitSessionEnd,
2077
2284
  isTelemetrySdkInitialized,
2078
2285
  initializeTelemetry,
2079
2286
  refreshSessionContext,