@qwen-code/qwen-code 0.21.0 → 0.21.1-nightly.20260731.702932cc7

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 (423) hide show
  1. package/bundled/qc-helper/docs/configuration/model-providers.md +2 -0
  2. package/bundled/qc-helper/docs/configuration/settings.md +39 -28
  3. package/bundled/qc-helper/docs/features/channels/_meta.ts +2 -0
  4. package/bundled/qc-helper/docs/features/channels/github.md +139 -0
  5. package/bundled/qc-helper/docs/features/channels/gitlab.md +171 -0
  6. package/bundled/qc-helper/docs/features/channels/overview.md +61 -6
  7. package/bundled/qc-helper/docs/features/code-review.md +21 -1
  8. package/bundled/qc-helper/docs/features/hooks.md +72 -15
  9. package/bundled/qc-helper/docs/features/mcp.md +9 -1
  10. package/bundled/qc-helper/docs/features/scheduled-tasks.md +3 -1
  11. package/bundled/qc-helper/docs/features/sub-agents.md +42 -8
  12. package/bundled/qc-helper/docs/qwen-serve.md +11 -7
  13. package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +2 -2
  14. package/bundled/qc-helper/docs/support/troubleshooting.md +2 -1
  15. package/bundled/review/DESIGN.md +19 -0
  16. package/bundled/review/SKILL.md +120 -61
  17. package/chunks/MaxSizedBox-LAFHK4VO.js +88 -0
  18. package/chunks/{StandaloneSessionPicker-BIRMPLRD.js → StandaloneSessionPicker-EMNOBN3S.js} +71 -68
  19. package/chunks/{acp-startup-profiler-RV3IV562.js → acp-startup-profiler-2C4A5ZTJ.js} +2 -2
  20. package/chunks/{acpAgent-6J2U72PQ.js → acpAgent-ERFA6HWV.js} +1674 -591
  21. package/chunks/agent-PLKF6JK4.js +84 -0
  22. package/chunks/agent-headless-JAORDQ63.js +78 -0
  23. package/chunks/{anthropicContentGenerator-75BKLTSP.js → anthropicContentGenerator-OFHSZJBF.js} +79 -27
  24. package/chunks/{artifact-tool-Y5T7GG7F.js → artifact-tool-RDN2W7ND.js} +4 -4
  25. package/chunks/{askUserQuestion-2H6747FR.js → askUserQuestion-OZERWH5R.js} +4 -4
  26. package/chunks/bridge-NYOBVRIT.js +94 -0
  27. package/chunks/{build-RV63TIRH.js → build-GDBLPA24.js} +1 -1
  28. package/chunks/{ca-25EDXPFZ.js → ca-6W3SK7OQ.js} +6 -1
  29. package/chunks/channel-management-service-5S7YCWX5.js +418 -0
  30. package/chunks/channel-settings-store-NLOKYO23.js +91 -0
  31. package/chunks/{channel-worker-group-2ZD7TVAT.js → channel-worker-group-OVWGYMZS.js} +11 -6
  32. package/chunks/{channel-worker-manager-4OA4BCGB.js → channel-worker-manager-H55GKOQA.js} +11 -6
  33. package/chunks/{channel-worker-supervisor-V7KCFJTS.js → channel-worker-supervisor-CABBXYHK.js} +7 -5
  34. package/chunks/{chunk-RIBKPMRP.js → chunk-23F4XGWO.js} +19 -6
  35. package/chunks/{chunk-ACY3A37B.js → chunk-25VHI5T7.js} +23 -18
  36. package/chunks/{chunk-MZAXJAUM.js → chunk-26JK4RPD.js} +1 -1
  37. package/chunks/{chunk-6GMVPFB2.js → chunk-2IIJTXYF.js} +45 -16
  38. package/chunks/{chunk-BPJSQIJX.js → chunk-2J3OJGTL.js} +0 -2
  39. package/chunks/{chunk-2X55UKQE.js → chunk-2JZR3B4A.js} +3 -3
  40. package/chunks/{chunk-7JURR4JT.js → chunk-2OQUICDM.js} +167 -81
  41. package/chunks/{chunk-ZJHVAS7M.js → chunk-2YCYFWYZ.js} +4 -5
  42. package/chunks/{chunk-3QMGYBFN.js → chunk-3APUUXRF.js} +1 -80
  43. package/chunks/{chunk-MUP3T3AD.js → chunk-3I6DUGQD.js} +1 -35
  44. package/chunks/{chunk-JVPM2ULZ.js → chunk-3XZ5SSNR.js} +6 -6
  45. package/chunks/chunk-42VPM33K.js +319 -0
  46. package/chunks/{chunk-VAK25FTU.js → chunk-45IOTAUS.js} +1 -1
  47. package/chunks/chunk-45UYUCJ6.js +363 -0
  48. package/chunks/{chunk-JZA3JUDJ.js → chunk-4KP2F2TE.js} +1 -1
  49. package/chunks/{chunk-IO3IX5Q4.js → chunk-4YJQD2IO.js} +1 -1
  50. package/chunks/{chunk-JXJFVC6E.js → chunk-5G6XUGXO.js} +61 -14
  51. package/chunks/{chunk-ZOIFNCKL.js → chunk-5NNHICSA.js} +3 -23
  52. package/chunks/{chunk-A4UCTEB5.js → chunk-5WV5S2GT.js} +0 -1
  53. package/chunks/{chunk-RHLZR4E5.js → chunk-675H6PLP.js} +1 -1
  54. package/chunks/chunk-6FMJLI5M.js +1591 -0
  55. package/chunks/chunk-6MPDY6ZG.js +76 -0
  56. package/chunks/{chunk-PSOO6YXD.js → chunk-6NUWQ3R7.js} +9 -7
  57. package/chunks/{chunk-7MVVZO4N.js → chunk-6ZRWX46I.js} +4 -4
  58. package/chunks/{chunk-TPRQ7RZH.js → chunk-76E5Y3UZ.js} +3117 -993
  59. package/chunks/{chunk-UUUTRMI2.js → chunk-7ULQIS27.js} +1 -1
  60. package/chunks/{chunk-BKHWX6I2.js → chunk-A5BZ722X.js} +11 -3
  61. package/chunks/{chunk-TEHGS6UP.js → chunk-A5T5W7PR.js} +154 -16
  62. package/chunks/{chunk-VIA5XA4U.js → chunk-A5UODYG3.js} +4 -1
  63. package/chunks/{chunk-JLU636DO.js → chunk-ALMR3E6Q.js} +1 -0
  64. package/chunks/{chunk-EBJQ6AXW.js → chunk-ANDVK2JN.js} +358 -14
  65. package/chunks/{chunk-TOFQCPDC.js → chunk-AOHY3QJ3.js} +14 -8
  66. package/chunks/chunk-AQ37AY7B.js +93 -0
  67. package/chunks/{chunk-PJIZUQVC.js → chunk-AZQ3DT76.js} +2 -2
  68. package/chunks/{chunk-LKEJ26GS.js → chunk-B3TA3IF5.js} +16 -11
  69. package/chunks/{chunk-Q4M4MDQ4.js → chunk-B43QHWY6.js} +1 -1
  70. package/chunks/{chunk-UH3WSE5L.js → chunk-B4AJNNOL.js} +1 -6
  71. package/chunks/{chunk-K36B6G2O.js → chunk-B6FOGNGH.js} +5 -5
  72. package/chunks/{chunk-PWVFN2LF.js → chunk-BP2H5K25.js} +1 -1
  73. package/chunks/{chunk-LB6DUZ26.js → chunk-BTWSGZCT.js} +264 -185
  74. package/chunks/{chunk-ZNAUOR2I.js → chunk-BZBPT52P.js} +2 -2
  75. package/chunks/{chunk-L26JL52R.js → chunk-CBBP4BMC.js} +64 -67
  76. package/chunks/{chunk-ZD6UTE4A.js → chunk-CNTR4GR6.js} +1 -1
  77. package/chunks/{chunk-3SJ43L4W.js → chunk-CPZAH673.js} +6 -0
  78. package/chunks/{chunk-EPDRMGT4.js → chunk-D4HTUMGX.js} +4 -28
  79. package/chunks/{chunk-QAF7NMK7.js → chunk-D7CQTWRS.js} +1 -1
  80. package/chunks/{chunk-XVNQMZ2I.js → chunk-DGEIYUC3.js} +0 -1
  81. package/chunks/{chunk-BPZALHVR.js → chunk-DI35ZN7T.js} +1 -1
  82. package/chunks/{chunk-IKCX4CCL.js → chunk-DKPJUF5F.js} +118 -95
  83. package/chunks/{chunk-DLWL3Z7A.js → chunk-DSFHVTWD.js} +3 -3
  84. package/chunks/{chunk-FSITMZJH.js → chunk-DYRYLJ3O.js} +18 -9
  85. package/chunks/{chunk-NL7LTRLR.js → chunk-E2BHWIDT.js} +48 -72
  86. package/chunks/{chunk-UDX5OBWR.js → chunk-E2FN6SM7.js} +94 -4
  87. package/chunks/{chunk-USTWD7QV.js → chunk-E6CJ2SMM.js} +26 -16
  88. package/chunks/{chunk-KMQ33DO4.js → chunk-EDB7A72S.js} +4 -4
  89. package/chunks/{chunk-7ZCNENPP.js → chunk-FANRZEAJ.js} +1 -1
  90. package/chunks/{chunk-WBL3FJEU.js → chunk-FC4KQFCS.js} +1 -1
  91. package/chunks/{chunk-5NBDS5S6.js → chunk-FCYYAB4S.js} +162 -7
  92. package/chunks/{chunk-OKY7HXPG.js → chunk-FJ5WUMUQ.js} +2 -2
  93. package/chunks/{chunk-PHOF65IG.js → chunk-FRXG4ARO.js} +36273 -44436
  94. package/chunks/{chunk-FQK6JAFG.js → chunk-FS674JW4.js} +4 -4
  95. package/chunks/chunk-FYJ7W2PI.js +194 -0
  96. package/chunks/{chunk-BULDBTYC.js → chunk-G7XXKQYS.js} +3 -28
  97. package/chunks/{chunk-LS77BEZP.js → chunk-GLCZKT5V.js} +1 -5
  98. package/chunks/{chunk-VRYUBFMC.js → chunk-GRUAVQQR.js} +1 -1
  99. package/chunks/{chunk-MVSUYZDT.js → chunk-GWV7DI3S.js} +4 -4
  100. package/chunks/{chunk-A5L3JMUA.js → chunk-HC45LTEN.js} +18 -4
  101. package/chunks/{chunk-PC6JANNU.js → chunk-HKRVXYDN.js} +4 -4
  102. package/chunks/{chunk-GZXCZHCT.js → chunk-I3G5JWBV.js} +1 -1
  103. package/chunks/{chunk-4WIZGAH3.js → chunk-I5BT7ADR.js} +6 -58
  104. package/chunks/{chunk-GSN55ZRI.js → chunk-ID3O7PRB.js} +19 -7
  105. package/chunks/{chunk-L5UHQJTJ.js → chunk-IGTHU3T4.js} +1 -1
  106. package/chunks/{chunk-BIQWWWJN.js → chunk-IIUGIWWY.js} +1 -1
  107. package/chunks/{chunk-RWTEFFPU.js → chunk-JCJ7LKNA.js} +6140 -5616
  108. package/chunks/{chunk-S3TWXGKA.js → chunk-JE7KQ2UP.js} +4 -2
  109. package/chunks/{chunk-PWTZEM3C.js → chunk-JXVC2PL3.js} +3 -37
  110. package/chunks/chunk-JYBU6YUE.js +378 -0
  111. package/chunks/{chunk-RF3EXIHJ.js → chunk-K3PFMM5U.js} +49 -26
  112. package/chunks/{chunk-JCW2R7WC.js → chunk-K623ENWT.js} +3 -79
  113. package/chunks/{chunk-T2NCM2ET.js → chunk-K6KS3LTN.js} +2 -749
  114. package/chunks/chunk-KWHKHSIS.js +81 -0
  115. package/chunks/{chunk-DHHOYAPR.js → chunk-L2E5GFAG.js} +7 -7
  116. package/chunks/{chunk-2W3OOD4W.js → chunk-L55JWS76.js} +6 -3
  117. package/chunks/{chunk-E5TUC6CA.js → chunk-LHKCY7DY.js} +3 -3
  118. package/chunks/{chunk-NH6KE4JX.js → chunk-LOY7RWQG.js} +3 -3
  119. package/chunks/{chunk-U7M2DMGW.js → chunk-M4MSAE7U.js} +130 -5
  120. package/chunks/{chunk-IJTOWOD7.js → chunk-MB32MS4U.js} +92 -9
  121. package/chunks/{chunk-PR75REBZ.js → chunk-MM7TH7ZM.js} +12 -82
  122. package/chunks/{chunk-FODK6UMO.js → chunk-MPHPFVKK.js} +0 -2
  123. package/chunks/{chunk-M5JM7OSF.js → chunk-N4ACHWNH.js} +2 -3
  124. package/chunks/{chunk-JESCGQM3.js → chunk-NAVJD2PQ.js} +8 -7
  125. package/chunks/{chunk-J56UI34H.js → chunk-NBD76HUW.js} +4 -2
  126. package/chunks/{chunk-2SCDWPXI.js → chunk-NC4U4I3Y.js} +5 -5
  127. package/chunks/{chunk-H4SBPHSA.js → chunk-NNL7WPPK.js} +3 -3
  128. package/chunks/{chunk-YBL3QUDD.js → chunk-NQCXWP5D.js} +1 -1
  129. package/chunks/{chunk-CIKQ7KKO.js → chunk-NVFSGPIF.js} +954 -444
  130. package/chunks/{chunk-6OUGMXDC.js → chunk-NWNEANAT.js} +7 -7
  131. package/chunks/chunk-O6GEWCJA.js +21 -0
  132. package/chunks/chunk-OCPBI7J5.js +18 -0
  133. package/chunks/{chunk-KIM5GUMA.js → chunk-OE6F6ZWQ.js} +589 -220
  134. package/chunks/{chunk-SQCQ4KO2.js → chunk-P5DEY3NF.js} +380 -317
  135. package/chunks/{chunk-2JZBVYTU.js → chunk-Q3T5KA2V.js} +1 -8
  136. package/chunks/{chunk-MB4MZHMJ.js → chunk-QARJNL2V.js} +211 -522
  137. package/chunks/{chunk-YH6G52F2.js → chunk-QCXGC7QB.js} +4 -4
  138. package/chunks/chunk-QDK4F2N5.js +1252 -0
  139. package/chunks/{chunk-VDDGDZMA.js → chunk-QHWCP53L.js} +14 -7
  140. package/chunks/{chunk-VULLI6WQ.js → chunk-QIERF2GQ.js} +6 -6
  141. package/chunks/{chunk-TGILQ3YH.js → chunk-QQTJK5GB.js} +200 -77
  142. package/chunks/{chunk-H5FFA6TH.js → chunk-QTHQ6Z5X.js} +16 -3
  143. package/chunks/{chunk-5I2IWRSH.js → chunk-R2XWGR75.js} +2 -2
  144. package/chunks/{chunk-YPE6A4GC.js → chunk-RT7FNC2O.js} +2 -2
  145. package/chunks/{chunk-OFDOK3VM.js → chunk-RX7NJOPE.js} +8 -13
  146. package/chunks/{chunk-6AM5D4ME.js → chunk-S6LOFUVP.js} +0 -12
  147. package/chunks/{chunk-K4XWPEWB.js → chunk-SHN4KHDK.js} +4 -33
  148. package/chunks/{chunk-VYPFXUCB.js → chunk-SZ3KHTDR.js} +1 -1
  149. package/chunks/chunk-T26EAKDL.js +13 -0
  150. package/chunks/chunk-T3CHYWJZ.js +758 -0
  151. package/chunks/{chunk-FNQ6T3CV.js → chunk-TEGJSJDF.js} +10 -7
  152. package/chunks/{chunk-RZIX2G32.js → chunk-THPORXSI.js} +1 -1
  153. package/chunks/{chunk-OHNBB4XR.js → chunk-THVU3RNH.js} +1 -1
  154. package/chunks/{record-artifact-RQKFYO5B.js → chunk-TIRRPCFS.js} +22 -7
  155. package/chunks/{chunk-ETSW4KLJ.js → chunk-TUCOXPHJ.js} +2 -2
  156. package/chunks/{chunk-63P4EL5V.js → chunk-TZTAV5RH.js} +1 -1
  157. package/chunks/{chunk-LK7CHLVP.js → chunk-U4VTUMMK.js} +0 -60
  158. package/chunks/{chunk-3RN6GBKS.js → chunk-U5CODIJW.js} +1 -1
  159. package/chunks/chunk-UU2B5YG6.js +2196 -0
  160. package/chunks/{chunk-R5AFZNQW.js → chunk-VAVHTGU4.js} +15 -8
  161. package/chunks/{chunk-2NH6DYI4.js → chunk-VHPFWR2O.js} +12 -12
  162. package/chunks/{chunk-IKYJHJNF.js → chunk-VOMQ2P6B.js} +3 -3
  163. package/chunks/{chunk-ZFDTEDCF.js → chunk-VX22DUW2.js} +6 -6
  164. package/chunks/{chunk-HTR4WV6U.js → chunk-W4RQUHY3.js} +31 -1
  165. package/chunks/{chunk-M4FMGVY4.js → chunk-WQP7BKWA.js} +3 -3
  166. package/chunks/{chunk-LH2BYDQ5.js → chunk-X2E5TFJ5.js} +18 -12
  167. package/chunks/{chunk-COH43MRJ.js → chunk-XCGIMOLN.js} +27 -1
  168. package/chunks/{chunk-YX324OPW.js → chunk-XDS22O52.js} +1 -1
  169. package/chunks/chunk-XP4L6KS3.js +463 -0
  170. package/chunks/{chunk-6FGBXPWM.js → chunk-XQK4XXTN.js} +38 -44
  171. package/chunks/{chunk-55DJUCI2.js → chunk-XWYPFDB5.js} +53 -43
  172. package/chunks/{chunk-Y34KJKDC.js → chunk-Y7BVNVVW.js} +1 -1
  173. package/chunks/{chunk-IPUUTYMV.js → chunk-YDLJGZHL.js} +1 -1
  174. package/chunks/{chunk-HIJQF5B5.js → chunk-YGE3IXJP.js} +1 -1
  175. package/chunks/{chunk-LQIW3YFY.js → chunk-YJFPRUWX.js} +9 -7
  176. package/chunks/{chunk-J24WCGIN.js → chunk-YQIIG4NA.js} +4 -4
  177. package/chunks/{chunk-BJX6ZSUK.js → chunk-YUFIEIWC.js} +2 -2
  178. package/chunks/{chunk-NIBLUX3Y.js → chunk-Z3S5EMOW.js} +148 -21
  179. package/chunks/{chunk-WCXCRJYB.js → chunk-Z3YLHKB7.js} +1 -1
  180. package/chunks/chunk-Z4X5MTRT.js +133 -0
  181. package/chunks/{chunk-UW5EOVUN.js → chunk-ZBVS26BY.js} +4 -4
  182. package/chunks/{chunk-HTO4JFDZ.js → chunk-ZPJWUGCS.js} +0 -1
  183. package/chunks/{chunk-X5XDDSSH.js → chunk-ZPZ7ZJEE.js} +28 -5
  184. package/chunks/{computer-use-SOQ4E3VX.js → computer-use-GOM42LNK.js} +53 -50
  185. package/chunks/{config-utils-7V7GGIW6.js → config-utils-WADIDWGG.js} +4 -3
  186. package/chunks/contextCommand-6LVPTIWD.js +83 -0
  187. package/chunks/core-runtime-253XV2DB.js +137 -0
  188. package/chunks/{create-sub-session-QRJLW5BV.js → create-sub-session-45POYEVP.js} +50 -47
  189. package/chunks/{create-sub-session-IWW2IZ2T.js → create-sub-session-62YZWVAY.js} +3 -3
  190. package/chunks/{cron-create-YIID5XAW.js → cron-create-6E7GIQTG.js} +6 -6
  191. package/chunks/{cron-delete-ZVHYCEP2.js → cron-delete-JD26XY3W.js} +5 -5
  192. package/chunks/{cron-list-XEGS463Q.js → cron-list-CUWFB44G.js} +6 -6
  193. package/chunks/{daemon-YO6433NF.js → daemon-PCNCI5YU.js} +428 -18
  194. package/chunks/daemon-status-provider-AKALDYJJ.js +93 -0
  195. package/chunks/daemon-trust-policy-XB7ZSQFQ.js +88 -0
  196. package/chunks/daemon-trust-policy-monitor-FUTKP42Q.js +175 -0
  197. package/chunks/{de-HGRCYDEJ.js → de-SY6O76BF.js} +6 -1
  198. package/chunks/deferred-core-runtime-RKLCO7V5.js +92 -0
  199. package/chunks/dist-26BIMQT6.js +4487 -0
  200. package/chunks/{dist-F6IBUDR4.js → dist-2PERFI23.js} +12 -9
  201. package/chunks/{dist-46NQKLTW.js → dist-OAOC5OV4.js} +2 -2
  202. package/chunks/{dist-YFNEUWSE.js → dist-PVEAFLHY.js} +5 -4
  203. package/chunks/{dist-AIKFMUKK.js → dist-SL2LUMML.js} +1449 -14
  204. package/chunks/dist-ULIG4M5H.js +13415 -0
  205. package/chunks/{dist-WEAHOXDM.js → dist-WGMNT3JQ.js} +2 -1
  206. package/chunks/{dist-BBLXMS3N.js → dist-ZHXOBXDN.js} +3 -3
  207. package/chunks/earlyInputCapture-FCWU47OB.js +85 -0
  208. package/chunks/{edit-OBDSQURM.js → edit-TTACM3LN.js} +51 -48
  209. package/chunks/{en-MTWBNGDO.js → en-NBK3JKCE.js} +9 -1
  210. package/chunks/{enter-worktree-U6MRPQ2P.js → enter-worktree-R34GFDX6.js} +51 -48
  211. package/chunks/{enterPlanMode-BC5QUZZ2.js → enterPlanMode-KJPBB6G5.js} +51 -48
  212. package/chunks/environment-IJG3N2PR.js +105 -0
  213. package/chunks/errors-MRON5OJD.js +91 -0
  214. package/chunks/esm-K5FARBNI.js +5548 -0
  215. package/chunks/{exit-worktree-DGNYMECB.js → exit-worktree-UBA66Y4I.js} +51 -48
  216. package/chunks/exitPlanMode-SMSPGNSK.js +76 -0
  217. package/chunks/{fast-path-JJZFJANL.js → fast-path-ZBAMZDCP.js} +16 -6
  218. package/chunks/{fr-45RLL55O.js → fr-4KG5V7UT.js} +6 -1
  219. package/chunks/{gemini-QS36EBZV.js → gemini-XFT7HRNL.js} +106 -99
  220. package/chunks/{geminiContentGenerator-AG4KB6CV.js → geminiContentGenerator-XD3MLYQX.js} +40 -11
  221. package/chunks/{getMachineId-bsd-V7W3GODC.js → getMachineId-bsd-FG7IUY6U.js} +1 -1
  222. package/chunks/{getMachineId-darwin-TDO75DQP.js → getMachineId-darwin-GLCJI2RA.js} +1 -1
  223. package/chunks/{getMachineId-linux-TF43WQT2.js → getMachineId-linux-O6OPPAKO.js} +1 -1
  224. package/chunks/{getMachineId-unsupported-ZGUO3TXT.js → getMachineId-unsupported-S6CKYVGC.js} +1 -1
  225. package/chunks/{getMachineId-win-ECFYZZFQ.js → getMachineId-win-X5SRNEH7.js} +1 -1
  226. package/chunks/{glob-V7R3PSK3.js → glob-HFKY7HXZ.js} +51 -48
  227. package/chunks/goal-tools-HGO6VXPB.js +335 -0
  228. package/chunks/{grep-QYPSK7OP.js → grep-EO5Z3PFV.js} +53 -49
  229. package/chunks/handleAutoUpdate-WRENFE6C.js +84 -0
  230. package/chunks/i18n-ZG5OTVSV.js +100 -0
  231. package/chunks/{image-gen-Z3VPGKRC.js → image-gen-CKWZ4MJI.js} +12 -12
  232. package/chunks/initializer-FYPLLRC7.js +89 -0
  233. package/chunks/installationInfo-5RV4HRMC.js +83 -0
  234. package/chunks/{ja-B7DF7DFG.js → ja-F3GSQXMF.js} +6 -1
  235. package/chunks/{keychain-token-storage-MDTG3WRM.js → keychain-token-storage-IKO4G53C.js} +3 -3
  236. package/chunks/lib-RUF3WZA6.js +9 -0
  237. package/chunks/list-ZNWVL3AT.js +92 -0
  238. package/chunks/{list-agents-5KJJHR6I.js → list-agents-PXJ7ZUFB.js} +3 -3
  239. package/chunks/loadedSettingsAdapter-GQGNHP5I.js +86 -0
  240. package/chunks/{loggingContentGenerator-HS3S5H3Q.js → loggingContentGenerator-MS5DFAWH.js} +78 -113
  241. package/chunks/{loop-wakeup-FXKNNYSY.js → loop-wakeup-Y26NQZ5I.js} +15 -8
  242. package/chunks/{ls-NTK6VOQJ.js → ls-ONQTTMQR.js} +5 -5
  243. package/chunks/{lsp-2JI24STP.js → lsp-YGHHRGMD.js} +3 -3
  244. package/chunks/{managed-npm-update-JYEMMXA3.js → managed-npm-update-67AK4GTL.js} +51 -48
  245. package/chunks/mcp-FVQ4VTLM.js +86 -0
  246. package/chunks/{monitor-R3ODH5U6.js → monitor-BXB33EOZ.js} +51 -48
  247. package/chunks/nonInteractiveCli-CN2GYSN3.js +148 -0
  248. package/chunks/{notebook-edit-BNOK452R.js → notebook-edit-FKYRBV4L.js} +51 -48
  249. package/chunks/{openaiContentGenerator-WMCU3O2H.js → openaiContentGenerator-UUXV5DGU.js} +26 -27
  250. package/chunks/pidfile-MV347TTZ.js +89 -0
  251. package/chunks/process-registry-2CHQBXH5.js +157 -0
  252. package/chunks/{processUtils-RT7UNCC2.js → processUtils-LKFG52RV.js} +2 -2
  253. package/chunks/{pt-22Q3FP73.js → pt-EQ33KWEN.js} +6 -1
  254. package/chunks/{qwenContentGenerator-HHCRK4SX.js → qwenContentGenerator-3WYI2HRW.js} +56 -53
  255. package/chunks/{qwenOAuth2-OWLB5AKH.js → qwenOAuth2-B46MW45O.js} +10 -10
  256. package/chunks/read-file-ACSHVWP3.js +29 -0
  257. package/chunks/{read-mcp-resource-4DKQWGHD.js → read-mcp-resource-U2IJN5HM.js} +4 -4
  258. package/chunks/record-artifact-MGPJ7EG4.js +21 -0
  259. package/chunks/resumeHistoryUtils-AMS4767B.js +94 -0
  260. package/chunks/ripGrep-BAPM2UKC.js +76 -0
  261. package/chunks/{ru-FZCNZHDC.js → ru-7OZAUKGG.js} +6 -1
  262. package/chunks/{run-qwen-serve-FU6HEM4J.js → run-qwen-serve-JEN6FO2A.js} +1018 -263
  263. package/chunks/runtime-WVP22ISH.js +122 -0
  264. package/chunks/{scheduler-G2ZS2Z7E.js → scheduler-HTX5ACVR.js} +50 -47
  265. package/chunks/{sdk-exporters-grpc-AK3LGHNO.js → sdk-exporters-grpc-54L4LS5L.js} +4 -4
  266. package/chunks/{sdk-exporters-http-FYBSUCPD.js → sdk-exporters-http-4BQANSJ6.js} +7 -7
  267. package/chunks/{sdk-impl-GMVPB7NB.js → sdk-impl-Z4VXWVFX.js} +14 -14
  268. package/chunks/{send-message-Q6OOR6BR.js → send-message-PMP4ATVM.js} +8 -13
  269. package/chunks/serve-ELQIVNWN.js +92 -0
  270. package/chunks/{server-4UMH7OIZ.js → server-JNW2NOSQ.js} +5288 -1364
  271. package/chunks/{session-K3O3Q2SV.js → session-NC356XNS.js} +102 -95
  272. package/chunks/{settings-CR2EWTBA.js → settings-73RMIOJ6.js} +54 -51
  273. package/chunks/shell-NMHF5TFG.js +86 -0
  274. package/chunks/{skill-I3SDA4MB.js → skill-XPGXHEKO.js} +22 -22
  275. package/chunks/skill-settings-5IGIJDGA.js +94 -0
  276. package/chunks/spawnChannel-T5THBHFN.js +85 -0
  277. package/chunks/standalone-update-ODXEPDLP.js +95 -0
  278. package/chunks/{startInteractiveUI-SLZGHRPH.js → startInteractiveUI-S27DXVAE.js} +1241 -905
  279. package/chunks/{syntheticOutput-I3757IWH.js → syntheticOutput-D7E6ZFKR.js} +4 -4
  280. package/chunks/task-create-NFCYD43L.js +26 -0
  281. package/chunks/{task-list-FOPULZEP.js → task-list-TAVMGEVD.js} +7 -7
  282. package/chunks/{task-stop-H6RHXFVQ.js → task-stop-ZDF2UJRM.js} +3 -3
  283. package/chunks/{task-update-M57TFZJT.js → task-update-6L7LHGEX.js} +12 -11
  284. package/chunks/{team-create-YJALH5D2.js → team-create-CTLQWTJ2.js} +53 -50
  285. package/chunks/{team-delete-QE2UXJL7.js → team-delete-DPGGRQBU.js} +7 -7
  286. package/chunks/{team-plan-approval-34QFYKGN.js → team-plan-approval-WKRUAPJ4.js} +51 -48
  287. package/chunks/theme-manager-XQHXQQX6.js +80 -0
  288. package/chunks/{todoWrite-VQ7FKOHL.js → todoWrite-2UO5G6G6.js} +34 -6
  289. package/chunks/{tool-search-NF7GB6LE.js → tool-search-45YINAJA.js} +21 -22
  290. package/chunks/total-session-admission-QPUKGHKO.js +88 -0
  291. package/chunks/trustedFolders-YMUTRHEQ.js +98 -0
  292. package/chunks/{update-relaunch-WBUZJC5O.js → update-relaunch-PZUXTVHC.js} +5 -5
  293. package/chunks/updateCheck-IZAN4XTB.js +95 -0
  294. package/chunks/useAutoAcceptIndicator-CGL2MAYE.js +96 -0
  295. package/chunks/{validateNonInterActiveAuth-3R223G3R.js → validateNonInterActiveAuth-GBGNJ65K.js} +97 -90
  296. package/chunks/{version-HS7YSFHV.js → version-Z7EX24NZ.js} +1 -1
  297. package/chunks/{web-fetch-NKCSG7ZE.js → web-fetch-ETTT2H3V.js} +19 -21
  298. package/chunks/{web-search-S62WAP4S.js → web-search-Y3ZSVRJ6.js} +13 -13
  299. package/chunks/{workflow-QAGU5RU4.js → workflow-ATRJSAO7.js} +52 -49
  300. package/chunks/workspace-providers-status-YM3WLW3N.js +89 -0
  301. package/chunks/{workspace-registration-store-24JMHDGF.js → workspace-registration-store-4EGNCIPG.js} +1 -1
  302. package/chunks/workspace-registry-NGZOZKQP.js +96 -0
  303. package/chunks/workspace-service-SVWOXX2B.js +103 -0
  304. package/chunks/workspace-skills-status-YZHZ3PT5.js +89 -0
  305. package/chunks/workspace-trust-reconciler-GGBQV2U5.js +349 -0
  306. package/chunks/write-file-HLGCEB72.js +78 -0
  307. package/chunks/xterm-headless-NTYVIBT3.js +3475 -0
  308. package/chunks/{zh-LUIGBD55.js → zh-H3YDK5QW.js} +9 -1
  309. package/chunks/{zh-TW-F5KG2IYD.js → zh-TW-JYCP7XUA.js} +9 -1
  310. package/chunks/zoom-image-LDECT475.js +224 -0
  311. package/cli.js +50 -16
  312. package/locales/ca.js +7 -2
  313. package/locales/de.js +7 -2
  314. package/locales/en.js +10 -2
  315. package/locales/fr.js +7 -2
  316. package/locales/ja.js +7 -2
  317. package/locales/pt.js +7 -2
  318. package/locales/ru.js +7 -2
  319. package/locales/zh-TW.js +10 -2
  320. package/locales/zh.js +10 -2
  321. package/package.json +5 -4
  322. package/web-shell/assets/{arc-DcbWnB9T.js → arc-Dpy_U6Bb.js} +1 -1
  323. package/web-shell/assets/{architectureDiagram-3BPJPVTR-kMMF5sud.js → architectureDiagram-3BPJPVTR-DgDOg-c5.js} +1 -1
  324. package/web-shell/assets/{blockDiagram-GPEHLZMM-Htl9vTJS.js → blockDiagram-GPEHLZMM-tADd9Ja3.js} +1 -1
  325. package/web-shell/assets/{c4Diagram-AAUBKEIU-BnZnm0mQ.js → c4Diagram-AAUBKEIU-68wj9MCU.js} +1 -1
  326. package/web-shell/assets/channel-Do7fFnFl.js +1 -0
  327. package/web-shell/assets/{chunk-2J33WTMH-DziB7kDG.js → chunk-2J33WTMH-DjJLOeVU.js} +1 -1
  328. package/web-shell/assets/{chunk-4BX2VUAB-CmkD8daw.js → chunk-4BX2VUAB-CMbzGeVC.js} +1 -1
  329. package/web-shell/assets/{chunk-55IACEB6-CHAd9A_U.js → chunk-55IACEB6-SlKgejv9.js} +1 -1
  330. package/web-shell/assets/{chunk-727SXJPM-Dqaam3fE.js → chunk-727SXJPM-CijXssHZ.js} +1 -1
  331. package/web-shell/assets/{chunk-AQP2D5EJ-D_-saBYM.js → chunk-AQP2D5EJ-D8w25nvR.js} +1 -1
  332. package/web-shell/assets/{chunk-FMBD7UC4-B9r_veWD.js → chunk-FMBD7UC4-Bv9dcx_e.js} +1 -1
  333. package/web-shell/assets/{chunk-ND2GUHAM-B3EaCSpL.js → chunk-ND2GUHAM-Bzf6sAOd.js} +1 -1
  334. package/web-shell/assets/{chunk-QZHKN3VN-CYq8x9mn.js → chunk-QZHKN3VN-whNoNeW5.js} +1 -1
  335. package/web-shell/assets/classDiagram-4FO5ZUOK-By_XOP3X.js +1 -0
  336. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-By_XOP3X.js +1 -0
  337. package/web-shell/assets/{cose-bilkent-S5V4N54A-D0ng4uiB.js → cose-bilkent-S5V4N54A-rpQS44Lz.js} +1 -1
  338. package/web-shell/assets/{dagre-BM42HDAG-DCZollQv.js → dagre-BM42HDAG-Ck7VE6nT.js} +1 -1
  339. package/web-shell/assets/{diagram-2AECGRRQ-Dfk2pWS0.js → diagram-2AECGRRQ-CgRrsodR.js} +1 -1
  340. package/web-shell/assets/{diagram-5GNKFQAL-kX38ltWR.js → diagram-5GNKFQAL-CsTZtE5A.js} +1 -1
  341. package/web-shell/assets/{diagram-KO2AKTUF-CJz2vsXh.js → diagram-KO2AKTUF-D5EAdVq4.js} +1 -1
  342. package/web-shell/assets/{diagram-LMA3HP47-BvMLZm_7.js → diagram-LMA3HP47-DNrjHC7Z.js} +1 -1
  343. package/web-shell/assets/{diagram-OG6HWLK6-l7kfStkO.js → diagram-OG6HWLK6-ClJSJGgC.js} +1 -1
  344. package/web-shell/assets/{erDiagram-TEJ5UH35-BSVa8GGT.js → erDiagram-TEJ5UH35-DuVnos_y.js} +1 -1
  345. package/web-shell/assets/{flowDiagram-I6XJVG4X-CoawKIXH.js → flowDiagram-I6XJVG4X-DEpIVl1s.js} +1 -1
  346. package/web-shell/assets/{ganttDiagram-6RSMTGT7-DFUDH0zF.js → ganttDiagram-6RSMTGT7-COnQM2-C.js} +1 -1
  347. package/web-shell/assets/{gitGraphDiagram-PVQCEYII-Y2pvpT4e.js → gitGraphDiagram-PVQCEYII-C-lX5H3_.js} +1 -1
  348. package/web-shell/assets/index-C2GE3DAF.js +74 -0
  349. package/web-shell/assets/{index-D0GX0zZf.js → index-DfcyS2E7.js} +1 -1
  350. package/web-shell/assets/index-Qxt6kN7i.js +1700 -0
  351. package/web-shell/assets/index-bo0Z8hfu.css +5 -0
  352. package/web-shell/assets/{infoDiagram-5YYISTIA-CU8_zLiX.js → infoDiagram-5YYISTIA-D0WP-wmU.js} +1 -1
  353. package/web-shell/assets/{ishikawaDiagram-YF4QCWOH-AVQiV0DU.js → ishikawaDiagram-YF4QCWOH-DgsI3Clu.js} +1 -1
  354. package/web-shell/assets/{journeyDiagram-JHISSGLW-DQ0VSKa3.js → journeyDiagram-JHISSGLW-4yCoMZO6.js} +1 -1
  355. package/web-shell/assets/{kanban-definition-UN3LZRKU-BqnWqsE_.js → kanban-definition-UN3LZRKU-D_05au1N.js} +1 -1
  356. package/web-shell/assets/{linear-BkoihsaA.js → linear-B38fDz0Q.js} +1 -1
  357. package/web-shell/assets/{mermaid.core-5RJs-31j.js → mermaid.core-aGNwTaHi.js} +5 -5
  358. package/web-shell/assets/{mindmap-definition-RKZ34NQL-D33Bxnpd.js → mindmap-definition-RKZ34NQL-C2yf_5WM.js} +1 -1
  359. package/web-shell/assets/{pieDiagram-4H26LBE5-BuEAw3BH.js → pieDiagram-4H26LBE5-DiHABBT-.js} +1 -1
  360. package/web-shell/assets/{quadrantDiagram-W4KKPZXB-Kox_usEq.js → quadrantDiagram-W4KKPZXB-W9xkeAGe.js} +1 -1
  361. package/web-shell/assets/{requirementDiagram-4Y6WPE33-CNjeUif0.js → requirementDiagram-4Y6WPE33-BGmRXl9k.js} +1 -1
  362. package/web-shell/assets/{sankeyDiagram-5OEKKPKP-BCd2OL_U.js → sankeyDiagram-5OEKKPKP-CvOmT43_.js} +1 -1
  363. package/web-shell/assets/{sequenceDiagram-3UESZ5HK-CF2ZTsz0.js → sequenceDiagram-3UESZ5HK-C8pdd0Z-.js} +1 -1
  364. package/web-shell/assets/{stateDiagram-AJRCARHV-qenSzHtm.js → stateDiagram-AJRCARHV-C-CYdFx2.js} +1 -1
  365. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-BieEHeN9.js +1 -0
  366. package/web-shell/assets/{timeline-definition-PNZ67QCA-B5DyWdgs.js → timeline-definition-PNZ67QCA-w2KQn1cI.js} +1 -1
  367. package/web-shell/assets/{vennDiagram-CIIHVFJN-DqP4I_o_.js → vennDiagram-CIIHVFJN-DuorhRku.js} +1 -1
  368. package/web-shell/assets/{wardley-L42UT6IY-CJe2e4mg.js → wardley-L42UT6IY-BAXm2cWy.js} +1 -1
  369. package/web-shell/assets/{wardleyDiagram-YWT4CUSO-BMDSw-Rr.js → wardleyDiagram-YWT4CUSO-8PHaOXn5.js} +1 -1
  370. package/web-shell/assets/{xychartDiagram-2RQKCTM6-BTVZYkxD.js → xychartDiagram-2RQKCTM6-Do84JFSc.js} +1 -1
  371. package/web-shell/index.html +2 -2
  372. package/chunks/MaxSizedBox-5DPPWPGT.js +0 -85
  373. package/chunks/agent-6ODUANDO.js +0 -81
  374. package/chunks/agent-headless-7BYQTMHW.js +0 -75
  375. package/chunks/bridge-ZUB64FAE.js +0 -90
  376. package/chunks/chunk-LEH5C7FV.js +0 -232
  377. package/chunks/chunk-SZRN75WQ.js +0 -29
  378. package/chunks/chunk-UGYMA4EI.js +0 -219
  379. package/chunks/chunk-Z2BC6UJ5.js +0 -8575
  380. package/chunks/contextCommand-JLHYA34Z.js +0 -80
  381. package/chunks/daemon-status-provider-2233Q37D.js +0 -89
  382. package/chunks/earlyInputCapture-A7NDU3PF.js +0 -82
  383. package/chunks/environment-W5UFC2CH.js +0 -102
  384. package/chunks/errors-M7CLORXH.js +0 -88
  385. package/chunks/exitPlanMode-GXTBWQAR.js +0 -403
  386. package/chunks/handleAutoUpdate-6DBEZYPV.js +0 -81
  387. package/chunks/i18n-VUJJZIMU.js +0 -97
  388. package/chunks/initializer-UWAK5U5O.js +0 -86
  389. package/chunks/installationInfo-6O2YAA52.js +0 -80
  390. package/chunks/list-GB4ESM3T.js +0 -89
  391. package/chunks/loadedSettingsAdapter-OT6JVQ7U.js +0 -83
  392. package/chunks/mcp-6DBDJPFU.js +0 -83
  393. package/chunks/nonInteractiveCli-MOYCYBBU.js +0 -141
  394. package/chunks/pidfile-TFRZZZIO.js +0 -86
  395. package/chunks/read-file-APMO3PSX.js +0 -31
  396. package/chunks/resumeHistoryUtils-6KRYEAWZ.js +0 -91
  397. package/chunks/ripGrep-BEJDEDXW.js +0 -73
  398. package/chunks/runtime-XXRRTNP6.js +0 -118
  399. package/chunks/serve-7BSTXJ4T.js +0 -89
  400. package/chunks/shell-HH3PF3A2.js +0 -83
  401. package/chunks/spawnChannel-RWNDBXGA.js +0 -82
  402. package/chunks/src-GE4TTTML.js +0 -3147
  403. package/chunks/standalone-update-Q6WFRZZQ.js +0 -92
  404. package/chunks/task-create-N7WQSGYA.js +0 -25
  405. package/chunks/theme-manager-SWRILQHI.js +0 -77
  406. package/chunks/total-session-admission-DLHHHLD3.js +0 -84
  407. package/chunks/trustedFolders-KHXHY6PY.js +0 -93
  408. package/chunks/updateCheck-RKL6M5XN.js +0 -92
  409. package/chunks/useAutoAcceptIndicator-CFQ5BUJL.js +0 -93
  410. package/chunks/workspace-providers-status-QSVZUETE.js +0 -86
  411. package/chunks/workspace-registry-UT4RBNBM.js +0 -88
  412. package/chunks/workspace-service-JFWRUS4V.js +0 -98
  413. package/chunks/workspace-skills-status-ZBBKJOI2.js +0 -85
  414. package/chunks/write-file-VHIXW5M7.js +0 -73
  415. package/web-shell/assets/channel-Cq7YKtfC.js +0 -1
  416. package/web-shell/assets/classDiagram-4FO5ZUOK-CQ9aC1Tg.js +0 -1
  417. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CQ9aC1Tg.js +0 -1
  418. package/web-shell/assets/index-D9haPt0X.css +0 -5
  419. package/web-shell/assets/index-ckX9Pq5k.js +0 -1230
  420. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-B7W4zlCr.js +0 -1
  421. package/chunks/{chunk-TARRHLLG.js → chunk-QUGAUQGJ.js} +25 -25
  422. package/chunks/{chunk-U7ZFW55U.js → chunk-VOQXFAY5.js} +977 -977
  423. /package/chunks/{chunk-LXXMOYPL.js → chunk-VXZBKKQR.js} +0 -0
@@ -1,7 +1,6 @@
1
1
  // Force strict mode and setup for ESM
2
2
  "use strict";
3
3
  import {
4
- DEFAULT_SENSITIVE_SPAN_ATTRIBUTE_MAX_LENGTH,
5
4
  EVENT_CHAT_COMPRESSION,
6
5
  SERVICE_NAME,
7
6
  SPAN_HOOK,
@@ -10,15 +9,14 @@ import {
10
9
  SPAN_SUBAGENT,
11
10
  SPAN_TOOL,
12
11
  SPAN_TOOL_BLOCKED_ON_USER,
13
- SPAN_TOOL_EXECUTION,
14
- safeJsonStringify
15
- } from "./chunk-BULDBTYC.js";
12
+ SPAN_TOOL_EXECUTION
13
+ } from "./chunk-G7XXKQYS.js";
16
14
  import {
17
15
  createDebugLogger,
18
16
  getCurrentSessionId,
19
17
  setSessionContext,
20
18
  setShellTracePropagation
21
- } from "./chunk-NL7LTRLR.js";
19
+ } from "./chunk-E2BHWIDT.js";
22
20
  import {
23
21
  DiagLogLevel,
24
22
  ROOT_CONTEXT,
@@ -31,7 +29,7 @@ import {
31
29
  init_esm,
32
30
  metrics,
33
31
  trace
34
- } from "./chunk-TARRHLLG.js";
32
+ } from "./chunk-QUGAUQGJ.js";
35
33
  import {
36
34
  init_esbuild_shims
37
35
  } from "./chunk-5O2XNYP6.js";
@@ -262,42 +260,6 @@ var PERFORMANCE_HISTOGRAM_DEFINITIONS = {
262
260
  attributes: {}
263
261
  }
264
262
  };
265
- var FileOperation = /* @__PURE__ */ ((FileOperation2) => {
266
- FileOperation2["CREATE"] = "create";
267
- FileOperation2["READ"] = "read";
268
- FileOperation2["UPDATE"] = "update";
269
- return FileOperation2;
270
- })(FileOperation || {});
271
- var PerformanceMetricType = /* @__PURE__ */ ((PerformanceMetricType2) => {
272
- PerformanceMetricType2["STARTUP"] = "startup";
273
- PerformanceMetricType2["MEMORY"] = "memory";
274
- PerformanceMetricType2["CPU"] = "cpu";
275
- PerformanceMetricType2["TOOL_EXECUTION"] = "tool_execution";
276
- PerformanceMetricType2["API_REQUEST"] = "api_request";
277
- PerformanceMetricType2["TOKEN_EFFICIENCY"] = "token_efficiency";
278
- return PerformanceMetricType2;
279
- })(PerformanceMetricType || {});
280
- var MemoryMetricType = /* @__PURE__ */ ((MemoryMetricType2) => {
281
- MemoryMetricType2["HEAP_USED"] = "heap_used";
282
- MemoryMetricType2["HEAP_TOTAL"] = "heap_total";
283
- MemoryMetricType2["EXTERNAL"] = "external";
284
- MemoryMetricType2["RSS"] = "rss";
285
- return MemoryMetricType2;
286
- })(MemoryMetricType || {});
287
- var ToolExecutionPhase = /* @__PURE__ */ ((ToolExecutionPhase2) => {
288
- ToolExecutionPhase2["VALIDATION"] = "validation";
289
- ToolExecutionPhase2["PREPARATION"] = "preparation";
290
- ToolExecutionPhase2["EXECUTION"] = "execution";
291
- ToolExecutionPhase2["RESULT_PROCESSING"] = "result_processing";
292
- return ToolExecutionPhase2;
293
- })(ToolExecutionPhase || {});
294
- var ApiRequestPhase = /* @__PURE__ */ ((ApiRequestPhase2) => {
295
- ApiRequestPhase2["REQUEST_PREPARATION"] = "request_preparation";
296
- ApiRequestPhase2["NETWORK_LATENCY"] = "network_latency";
297
- ApiRequestPhase2["RESPONSE_PROCESSING"] = "response_processing";
298
- ApiRequestPhase2["TOKEN_PROCESSING"] = "token_processing";
299
- return ApiRequestPhase2;
300
- })(ApiRequestPhase || {});
301
263
  var cliMeter;
302
264
  var toolCallCounter;
303
265
  var toolCallLatencyHistogram;
@@ -544,11 +506,6 @@ function recordFileOperationMetric(config, attributes) {
544
506
  });
545
507
  }
546
508
  __name(recordFileOperationMetric, "recordFileOperationMetric");
547
- function recordInvalidChunk(config) {
548
- if (!invalidChunkCounter || !isMetricsInitialized) return;
549
- invalidChunkCounter.add(1, baseMetricDefinition.getCommonAttributes(config));
550
- }
551
- __name(recordInvalidChunk, "recordInvalidChunk");
552
509
  function recordContentRetry(config) {
553
510
  if (!contentRetryCounter || !isMetricsInitialized) return;
554
511
  contentRetryCounter.add(1, baseMetricDefinition.getCommonAttributes(config));
@@ -595,16 +552,6 @@ function initializePerformanceMonitoring(config) {
595
552
  );
596
553
  }
597
554
  __name(initializePerformanceMonitoring, "initializePerformanceMonitoring");
598
- function recordStartupPerformance(config, durationMs, attributes) {
599
- if (!startupTimeHistogram || !isPerformanceMonitoringEnabled) return;
600
- const metricAttributes = {
601
- ...baseMetricDefinition.getCommonAttributes(config),
602
- phase: attributes.phase,
603
- ...attributes.details
604
- };
605
- startupTimeHistogram.record(durationMs, metricAttributes);
606
- }
607
- __name(recordStartupPerformance, "recordStartupPerformance");
608
555
  function recordMemoryUsage(config, bytes, attributes) {
609
556
  if (!memoryUsageGauge || !isPerformanceMonitoringEnabled) return;
610
557
  const metricAttributes = {
@@ -623,33 +570,6 @@ function recordCpuUsage(config, percentage, attributes) {
623
570
  cpuUsageGauge.record(percentage, metricAttributes);
624
571
  }
625
572
  __name(recordCpuUsage, "recordCpuUsage");
626
- function recordToolQueueDepth(config, queueDepth) {
627
- if (!toolQueueDepthGauge || !isPerformanceMonitoringEnabled) return;
628
- const attributes = {
629
- ...baseMetricDefinition.getCommonAttributes(config)
630
- };
631
- toolQueueDepthGauge.record(queueDepth, attributes);
632
- }
633
- __name(recordToolQueueDepth, "recordToolQueueDepth");
634
- function recordToolExecutionBreakdown(config, durationMs, attributes) {
635
- if (!toolExecutionBreakdownHistogram || !isPerformanceMonitoringEnabled)
636
- return;
637
- const metricAttributes = {
638
- ...baseMetricDefinition.getCommonAttributes(config),
639
- ...attributes
640
- };
641
- toolExecutionBreakdownHistogram.record(durationMs, metricAttributes);
642
- }
643
- __name(recordToolExecutionBreakdown, "recordToolExecutionBreakdown");
644
- function recordTokenEfficiency(config, value, attributes) {
645
- if (!tokenEfficiencyHistogram || !isPerformanceMonitoringEnabled) return;
646
- const metricAttributes = {
647
- ...baseMetricDefinition.getCommonAttributes(config),
648
- ...attributes
649
- };
650
- tokenEfficiencyHistogram.record(value, metricAttributes);
651
- }
652
- __name(recordTokenEfficiency, "recordTokenEfficiency");
653
573
  function recordApiRequestBreakdown(config, durationMs, attributes) {
654
574
  if (!apiRequestBreakdownHistogram || !isPerformanceMonitoringEnabled) return;
655
575
  const metricAttributes = {
@@ -659,45 +579,6 @@ function recordApiRequestBreakdown(config, durationMs, attributes) {
659
579
  apiRequestBreakdownHistogram.record(durationMs, metricAttributes);
660
580
  }
661
581
  __name(recordApiRequestBreakdown, "recordApiRequestBreakdown");
662
- function recordPerformanceScore(config, score, attributes) {
663
- if (!performanceScoreGauge || !isPerformanceMonitoringEnabled) return;
664
- const metricAttributes = {
665
- ...baseMetricDefinition.getCommonAttributes(config),
666
- ...attributes
667
- };
668
- performanceScoreGauge.record(score, metricAttributes);
669
- }
670
- __name(recordPerformanceScore, "recordPerformanceScore");
671
- function recordPerformanceRegression(config, attributes) {
672
- if (!regressionDetectionCounter || !isPerformanceMonitoringEnabled) return;
673
- const metricAttributes = {
674
- ...baseMetricDefinition.getCommonAttributes(config),
675
- ...attributes
676
- };
677
- regressionDetectionCounter.add(1, metricAttributes);
678
- if (attributes.baseline_value !== 0 && regressionPercentageChangeHistogram) {
679
- const percentageChange = (attributes.current_value - attributes.baseline_value) / attributes.baseline_value * 100;
680
- regressionPercentageChangeHistogram.record(
681
- percentageChange,
682
- metricAttributes
683
- );
684
- }
685
- }
686
- __name(recordPerformanceRegression, "recordPerformanceRegression");
687
- function recordBaselineComparison(config, attributes) {
688
- if (!baselineComparisonHistogram || !isPerformanceMonitoringEnabled) return;
689
- if (attributes.baseline_value === 0) {
690
- diag.warn("Baseline value is zero, skipping comparison.");
691
- return;
692
- }
693
- const percentageChange = (attributes.current_value - attributes.baseline_value) / attributes.baseline_value * 100;
694
- const metricAttributes = {
695
- ...baseMetricDefinition.getCommonAttributes(config),
696
- ...attributes
697
- };
698
- baselineComparisonHistogram.record(percentageChange, metricAttributes);
699
- }
700
- __name(recordBaselineComparison, "recordBaselineComparison");
701
582
  function isPerformanceMonitoringActive() {
702
583
  return isPerformanceMonitoringEnabled && isMetricsInitialized;
703
584
  }
@@ -845,9 +726,10 @@ function recordMemoryRecallDeliveryMetrics(config, latencyMs, attrs) {
845
726
  }
846
727
  __name(recordMemoryRecallDeliveryMetrics, "recordMemoryRecallDeliveryMetrics");
847
728
 
848
- // packages/core/src/telemetry/detailed-span-attributes.ts
729
+ // packages/core/src/telemetry/session-tracing.ts
849
730
  init_esbuild_shims();
850
- import { createHash as createHash2 } from "node:crypto";
731
+ init_esm();
732
+ import { AsyncLocalStorage } from "node:async_hooks";
851
733
 
852
734
  // packages/core/src/telemetry/sdk.ts
853
735
  init_esbuild_shims();
@@ -932,10 +814,160 @@ function createSessionRootContext(sessionId) {
932
814
  }
933
815
  __name(createSessionRootContext, "createSessionRootContext");
934
816
 
817
+ // packages/core/src/telemetry/sdk.ts
818
+ function createTelemetryDiagLogger() {
819
+ const debugLogger3 = createDebugLogger("OTEL");
820
+ return {
821
+ error: /* @__PURE__ */ __name((message, ...args) => debugLogger3.error(message, ...args), "error"),
822
+ warn: /* @__PURE__ */ __name((message, ...args) => debugLogger3.warn(message, ...args), "warn"),
823
+ info: /* @__PURE__ */ __name((message, ...args) => debugLogger3.info(message, ...args), "info"),
824
+ debug: /* @__PURE__ */ __name((message, ...args) => debugLogger3.debug(message, ...args), "debug"),
825
+ verbose: /* @__PURE__ */ __name((message, ...args) => debugLogger3.debug(message, ...args), "verbose")
826
+ };
827
+ }
828
+ __name(createTelemetryDiagLogger, "createTelemetryDiagLogger");
829
+ diag.setLogger(createTelemetryDiagLogger(), DiagLogLevel.WARN);
830
+ var SHUTDOWN_TIMEOUT_MS = 1e4;
831
+ var sdk;
832
+ var telemetryInitialized = false;
833
+ var telemetryInitPromise;
834
+ var telemetryShutdownPromise;
835
+ var activeMetricReader;
836
+ function isTelemetrySdkInitialized() {
837
+ return telemetryInitialized;
838
+ }
839
+ __name(isTelemetrySdkInitialized, "isTelemetrySdkInitialized");
840
+ function initializeTelemetry(config) {
841
+ if (telemetryInitialized || !config.getTelemetryEnabled()) {
842
+ return Promise.resolve();
843
+ }
844
+ telemetryInitPromise ??= (async () => {
845
+ const debugLogger3 = createDebugLogger("OTEL");
846
+ try {
847
+ const { startTelemetrySdk } = await import("./sdk-impl-Z4VXWVFX.js");
848
+ if (telemetryInitialized) return;
849
+ const started = await startTelemetrySdk(config);
850
+ if (!started) return;
851
+ sdk = started.sdk;
852
+ sdk.start();
853
+ debugLogger3.debug("OpenTelemetry SDK started successfully.");
854
+ telemetryInitialized = true;
855
+ activeMetricReader = started.metricReader;
856
+ const sessionId = config.getSessionId();
857
+ setSessionContext(createSessionRootContext(sessionId), sessionId);
858
+ setShellTracePropagation(
859
+ config.getOutboundCorrelationPropagateTraceContext()
860
+ );
861
+ initializeMetrics(config);
862
+ } catch (error) {
863
+ debugLogger3.error("Error starting OpenTelemetry SDK:", error);
864
+ }
865
+ })().finally(() => {
866
+ telemetryInitPromise = void 0;
867
+ });
868
+ return telemetryInitPromise;
869
+ }
870
+ __name(initializeTelemetry, "initializeTelemetry");
871
+ function refreshSessionContext(sessionId) {
872
+ if (!telemetryInitialized) return;
873
+ try {
874
+ setSessionContext(createSessionRootContext(sessionId), sessionId);
875
+ } catch (error) {
876
+ createDebugLogger("OTEL").warn("Failed to refresh session context:", error);
877
+ }
878
+ }
879
+ __name(refreshSessionContext, "refreshSessionContext");
880
+ function shutdownTelemetry() {
881
+ if (telemetryShutdownPromise) {
882
+ return telemetryShutdownPromise;
883
+ }
884
+ const pendingInit = telemetryInitPromise;
885
+ if (!pendingInit && (!telemetryInitialized || !sdk)) {
886
+ return Promise.resolve();
887
+ }
888
+ telemetryShutdownPromise = (async () => {
889
+ if (pendingInit) {
890
+ await pendingInit.catch(() => {
891
+ });
892
+ }
893
+ if (!telemetryInitialized || !sdk) {
894
+ telemetryShutdownPromise = void 0;
895
+ return;
896
+ }
897
+ endInteractionSpan("cancelled");
898
+ const currentSdk = sdk;
899
+ const debugLogger3 = createDebugLogger("OTEL");
900
+ let timer;
901
+ let timedOut = false;
902
+ try {
903
+ const sdkShutdown = Promise.resolve(currentSdk.shutdown());
904
+ sdkShutdown.catch((err) => {
905
+ if (timedOut) {
906
+ debugLogger3.warn(
907
+ "SDK shutdown rejected after timeout:",
908
+ err instanceof Error ? err.message : err
909
+ );
910
+ }
911
+ });
912
+ const timeout = new Promise((resolve) => {
913
+ timer = setTimeout(() => {
914
+ timedOut = true;
915
+ resolve("timeout");
916
+ }, SHUTDOWN_TIMEOUT_MS);
917
+ timer.unref?.();
918
+ });
919
+ const result = await Promise.race([sdkShutdown, timeout]);
920
+ clearTimeout(timer);
921
+ if (result === "timeout") {
922
+ const msg = `Telemetry shutdown timed out after ${SHUTDOWN_TIMEOUT_MS}ms.`;
923
+ diag.warn(msg);
924
+ debugLogger3.warn(msg);
925
+ } else {
926
+ debugLogger3.debug("OpenTelemetry SDK shut down successfully.");
927
+ }
928
+ } catch (error) {
929
+ clearTimeout(timer);
930
+ diag.error("Error shutting down SDK:", error);
931
+ debugLogger3.error("Error shutting down SDK:", error);
932
+ } finally {
933
+ telemetryInitialized = false;
934
+ sdk = void 0;
935
+ activeMetricReader = void 0;
936
+ telemetryShutdownPromise = void 0;
937
+ setSessionContext(void 0);
938
+ setShellTracePropagation(false);
939
+ }
940
+ })();
941
+ return telemetryShutdownPromise;
942
+ }
943
+ __name(shutdownTelemetry, "shutdownTelemetry");
944
+ var FORCE_FLUSH_TIMEOUT_MS = 2e3;
945
+ async function forceFlushMetrics() {
946
+ if (!telemetryInitialized || !activeMetricReader) return;
947
+ const flush = activeMetricReader.forceFlush();
948
+ flush.catch(() => {
949
+ });
950
+ let timer;
951
+ const timeout = new Promise((_, reject) => {
952
+ timer = setTimeout(
953
+ () => reject(
954
+ new Error(
955
+ `forceFlushMetrics timed out after ${FORCE_FLUSH_TIMEOUT_MS}ms`
956
+ )
957
+ ),
958
+ FORCE_FLUSH_TIMEOUT_MS
959
+ );
960
+ timer.unref?.();
961
+ });
962
+ try {
963
+ await Promise.race([flush, timeout]);
964
+ } finally {
965
+ clearTimeout(timer);
966
+ }
967
+ }
968
+ __name(forceFlushMetrics, "forceFlushMetrics");
969
+
935
970
  // packages/core/src/telemetry/session-tracing.ts
936
- init_esbuild_shims();
937
- init_esm();
938
- import { AsyncLocalStorage } from "node:async_hooks";
939
971
  var debugLogger2 = createDebugLogger("SESSION_TRACING");
940
972
  function resolveParentContext(parent) {
941
973
  if (parent) {
@@ -952,6 +984,7 @@ var NOOP_SPAN = trace.wrapSpanContext({
952
984
  var interactionContext = new AsyncLocalStorage();
953
985
  var toolContext = new AsyncLocalStorage();
954
986
  var subagentContext = new AsyncLocalStorage();
987
+ var interactionIdentityByPromptId = /* @__PURE__ */ new Map();
955
988
  function isInNativeSubagentSpan() {
956
989
  const ctx = subagentContext.getStore();
957
990
  return ctx !== void 0 && !ctx.ended;
@@ -962,6 +995,12 @@ function resolveSessionId(parentCtx) {
962
995
  return typeof fromParent === "string" && fromParent ? fromParent : getCurrentSessionId();
963
996
  }
964
997
  __name(resolveSessionId, "resolveSessionId");
998
+ function resolveGenAiUserId(parentCtx, promptId) {
999
+ const logicalParent = parentCtx ?? (promptId ? interactionIdentityByPromptId.get(promptId) : void 0);
1000
+ const value = logicalParent?.attributes["gen_ai.user.id"];
1001
+ return typeof value === "string" && value ? value : void 0;
1002
+ }
1003
+ __name(resolveGenAiUserId, "resolveGenAiUserId");
965
1004
  var activeSpans = /* @__PURE__ */ new Map();
966
1005
  var strongSpans = /* @__PURE__ */ new Map();
967
1006
  var interactionSequence = 0;
@@ -984,6 +1023,11 @@ function ttlFor(ctx) {
984
1023
  }
985
1024
  __name(ttlFor, "ttlFor");
986
1025
  function sweepStaleSpans(now) {
1026
+ for (const [promptId, ctx] of interactionIdentityByPromptId) {
1027
+ if (now - ctx.startTime >= SPAN_TTL_MS_DEFAULT) {
1028
+ interactionIdentityByPromptId.delete(promptId);
1029
+ }
1030
+ }
987
1031
  for (const [spanId, weakRef] of activeSpans) {
988
1032
  const ctx = weakRef.deref();
989
1033
  if (ctx === void 0) {
@@ -1052,9 +1096,10 @@ function getSpanId(span) {
1052
1096
  }
1053
1097
  __name(getSpanId, "getSpanId");
1054
1098
  var SPAN_TEXT_MAX_CHARS = 1024;
1055
- function truncateSpanText(s) {
1056
- if (s.length <= SPAN_TEXT_MAX_CHARS) return s;
1057
- let end = SPAN_TEXT_MAX_CHARS;
1099
+ var TOOL_DESCRIPTION_MAX_CHARS = 4096;
1100
+ function truncateSpanText(s, maxChars = SPAN_TEXT_MAX_CHARS) {
1101
+ if (s.length <= maxChars) return s;
1102
+ let end = maxChars;
1058
1103
  const code = s.charCodeAt(end - 1);
1059
1104
  if (code >= 55296 && code <= 56319) end--;
1060
1105
  return s.slice(0, end) + "\u2026[truncated]";
@@ -1072,8 +1117,10 @@ function startInteractionSpan(config, options) {
1072
1117
  if (!isTelemetrySdkInitialized()) return;
1073
1118
  ensureCleanupInterval();
1074
1119
  interactionSequence++;
1120
+ const userId = config.getTelemetryUserId();
1075
1121
  const attributes = {
1076
1122
  "session.id": config.getSessionId(),
1123
+ ...userId ? { "gen_ai.user.id": userId } : {},
1077
1124
  "qwen-code.prompt_id": options.promptId,
1078
1125
  "qwen-code.message_type": options.messageType,
1079
1126
  "qwen-code.model": options.model,
@@ -1094,6 +1141,14 @@ function startInteractionSpan(config, options) {
1094
1141
  };
1095
1142
  activeSpans.set(spanId, new WeakRef(spanContextObj));
1096
1143
  strongSpans.set(spanId, spanContextObj);
1144
+ if (userId) {
1145
+ interactionIdentityByPromptId.set(options.promptId, {
1146
+ startTime: spanContextObj.startTime,
1147
+ attributes: { "gen_ai.user.id": userId }
1148
+ });
1149
+ } else {
1150
+ interactionIdentityByPromptId.delete(options.promptId);
1151
+ }
1097
1152
  lastInteractionCtx = spanContextObj;
1098
1153
  interactionContext.enterWith(spanContextObj);
1099
1154
  }
@@ -1133,8 +1188,10 @@ async function withInteractionSpan(config, options, fn, getResultStatus) {
1133
1188
  if (!isTelemetrySdkInitialized()) return await fn();
1134
1189
  ensureCleanupInterval();
1135
1190
  interactionSequence++;
1191
+ const userId = config.getTelemetryUserId();
1136
1192
  const attributes = {
1137
1193
  "session.id": config.getSessionId(),
1194
+ ...userId ? { "gen_ai.user.id": userId } : {},
1138
1195
  "qwen-code.prompt_id": options.promptId,
1139
1196
  "qwen-code.message_type": options.messageType,
1140
1197
  "qwen-code.model": options.model,
@@ -1159,6 +1216,14 @@ async function withInteractionSpan(config, options, fn, getResultStatus) {
1159
1216
  };
1160
1217
  activeSpans.set(spanId, new WeakRef(spanContextObj));
1161
1218
  strongSpans.set(spanId, spanContextObj);
1219
+ if (userId) {
1220
+ interactionIdentityByPromptId.set(options.promptId, {
1221
+ startTime: spanContextObj.startTime,
1222
+ attributes: { "gen_ai.user.id": userId }
1223
+ });
1224
+ } else {
1225
+ interactionIdentityByPromptId.delete(options.promptId);
1226
+ }
1162
1227
  const activeContext = trace.setSpan(parentContext, span);
1163
1228
  return await context.with(
1164
1229
  activeContext,
@@ -1211,9 +1276,11 @@ function startLLMRequestSpan(model, promptId, options) {
1211
1276
  const parentCtx = subagentContext.getStore() ?? interactionContext.getStore();
1212
1277
  const ctx = resolveParentContext(parentCtx);
1213
1278
  const sessionId = resolveSessionId(parentCtx);
1279
+ const userId = resolveGenAiUserId(parentCtx, promptId);
1214
1280
  const attributes = {
1215
1281
  ...sessionId ? { "session.id": sessionId } : {},
1216
1282
  ...sessionId ? { "gen_ai.conversation.id": sessionId } : {},
1283
+ ...userId ? { "gen_ai.user.id": userId } : {},
1217
1284
  "qwen-code.prompt_id": promptId,
1218
1285
  "llm_request.context": subagentContext.getStore() ? "subagent" : interactionContext.getStore() ? "interaction" : "standalone",
1219
1286
  // Emit the version-pinned OTel GenAI semantic convention.
@@ -1366,19 +1433,27 @@ function endLLMRequestSpan(span, metadata) {
1366
1433
  strongSpans.delete(spanId);
1367
1434
  }
1368
1435
  __name(endLLMRequestSpan, "endLLMRequestSpan");
1369
- function startToolSpan(toolName, attrs) {
1436
+ function startToolSpan(toolName, attrs, description, promptId) {
1370
1437
  if (!isTelemetrySdkInitialized()) {
1371
1438
  return NOOP_SPAN;
1372
1439
  }
1373
1440
  const parentCtx = subagentContext.getStore() ?? interactionContext.getStore();
1374
1441
  const ctx = resolveParentContext(parentCtx);
1375
1442
  const sessionId = resolveSessionId(parentCtx);
1443
+ const userId = resolveGenAiUserId(parentCtx, promptId);
1376
1444
  const attributes = {
1377
1445
  ...sessionId ? { "session.id": sessionId } : {},
1378
1446
  ...attrs,
1447
+ ...userId ? { "gen_ai.user.id": userId } : {},
1379
1448
  "gen_ai.operation.name": "execute_tool",
1380
1449
  "gen_ai.tool.name": toolName,
1381
- "gen_ai.tool.type": "function"
1450
+ "gen_ai.tool.type": "function",
1451
+ ...description ? {
1452
+ "gen_ai.tool.description": truncateSpanText(
1453
+ description,
1454
+ TOOL_DESCRIPTION_MAX_CHARS
1455
+ )
1456
+ } : {}
1382
1457
  };
1383
1458
  const span = getTracer().startSpan(
1384
1459
  SPAN_TOOL,
@@ -1702,11 +1777,14 @@ __name(endHookSpan, "endHookSpan");
1702
1777
  function startSubagentSpan(opts) {
1703
1778
  if (!isTelemetrySdkInitialized()) return NOOP_SPAN;
1704
1779
  ensureCleanupInterval();
1780
+ const parentCtx = subagentContext.getStore() ?? toolContext.getStore() ?? interactionContext.getStore();
1781
+ const userId = resolveGenAiUserId(parentCtx);
1705
1782
  const attributes = {
1706
1783
  // Spec-aligned (OTel GenAI Agent Spans, Development status).
1707
1784
  "gen_ai.operation.name": "invoke_agent",
1708
1785
  "gen_ai.agent.name": opts.subagentName,
1709
1786
  "gen_ai.conversation.id": opts.sessionId,
1787
+ ...userId ? { "gen_ai.user.id": userId } : {},
1710
1788
  // Vendor identity and lifecycle. The per-invocation ID stays private;
1711
1789
  // gen_ai.agent.id is reserved for a stable agent definition identity.
1712
1790
  "qwen-code.subagent.id": opts.agentId,
@@ -1842,378 +1920,7 @@ function getActiveInteractionSpan() {
1842
1920
  }
1843
1921
  __name(getActiveInteractionSpan, "getActiveInteractionSpan");
1844
1922
 
1845
- // packages/core/src/telemetry/sdk.ts
1846
- function createTelemetryDiagLogger() {
1847
- const debugLogger3 = createDebugLogger("OTEL");
1848
- return {
1849
- error: /* @__PURE__ */ __name((message, ...args) => debugLogger3.error(message, ...args), "error"),
1850
- warn: /* @__PURE__ */ __name((message, ...args) => debugLogger3.warn(message, ...args), "warn"),
1851
- info: /* @__PURE__ */ __name((message, ...args) => debugLogger3.info(message, ...args), "info"),
1852
- debug: /* @__PURE__ */ __name((message, ...args) => debugLogger3.debug(message, ...args), "debug"),
1853
- verbose: /* @__PURE__ */ __name((message, ...args) => debugLogger3.debug(message, ...args), "verbose")
1854
- };
1855
- }
1856
- __name(createTelemetryDiagLogger, "createTelemetryDiagLogger");
1857
- diag.setLogger(createTelemetryDiagLogger(), DiagLogLevel.WARN);
1858
- var SHUTDOWN_TIMEOUT_MS = 1e4;
1859
- var sdk;
1860
- var telemetryInitialized = false;
1861
- var telemetryInitPromise;
1862
- var telemetryShutdownPromise;
1863
- var activeMetricReader;
1864
- function isTelemetrySdkInitialized() {
1865
- return telemetryInitialized;
1866
- }
1867
- __name(isTelemetrySdkInitialized, "isTelemetrySdkInitialized");
1868
- function initializeTelemetry(config) {
1869
- if (telemetryInitialized || !config.getTelemetryEnabled()) {
1870
- return Promise.resolve();
1871
- }
1872
- telemetryInitPromise ??= (async () => {
1873
- const debugLogger3 = createDebugLogger("OTEL");
1874
- try {
1875
- const { startTelemetrySdk } = await import("./sdk-impl-GMVPB7NB.js");
1876
- if (telemetryInitialized) return;
1877
- const started = await startTelemetrySdk(config);
1878
- if (!started) return;
1879
- sdk = started.sdk;
1880
- sdk.start();
1881
- debugLogger3.debug("OpenTelemetry SDK started successfully.");
1882
- telemetryInitialized = true;
1883
- activeMetricReader = started.metricReader;
1884
- const sessionId = config.getSessionId();
1885
- setSessionContext(createSessionRootContext(sessionId), sessionId);
1886
- setShellTracePropagation(
1887
- config.getOutboundCorrelationPropagateTraceContext()
1888
- );
1889
- initializeMetrics(config);
1890
- } catch (error) {
1891
- debugLogger3.error("Error starting OpenTelemetry SDK:", error);
1892
- }
1893
- })().finally(() => {
1894
- telemetryInitPromise = void 0;
1895
- });
1896
- return telemetryInitPromise;
1897
- }
1898
- __name(initializeTelemetry, "initializeTelemetry");
1899
- function refreshSessionContext(sessionId) {
1900
- if (!telemetryInitialized) return;
1901
- try {
1902
- setSessionContext(createSessionRootContext(sessionId), sessionId);
1903
- } catch (error) {
1904
- createDebugLogger("OTEL").warn("Failed to refresh session context:", error);
1905
- }
1906
- }
1907
- __name(refreshSessionContext, "refreshSessionContext");
1908
- function shutdownTelemetry() {
1909
- if (telemetryShutdownPromise) {
1910
- return telemetryShutdownPromise;
1911
- }
1912
- const pendingInit = telemetryInitPromise;
1913
- if (!pendingInit && (!telemetryInitialized || !sdk)) {
1914
- return Promise.resolve();
1915
- }
1916
- telemetryShutdownPromise = (async () => {
1917
- if (pendingInit) {
1918
- await pendingInit.catch(() => {
1919
- });
1920
- }
1921
- if (!telemetryInitialized || !sdk) {
1922
- telemetryShutdownPromise = void 0;
1923
- return;
1924
- }
1925
- endInteractionSpan("cancelled");
1926
- const currentSdk = sdk;
1927
- const debugLogger3 = createDebugLogger("OTEL");
1928
- let timer;
1929
- let timedOut = false;
1930
- try {
1931
- const sdkShutdown = Promise.resolve(currentSdk.shutdown());
1932
- sdkShutdown.catch((err) => {
1933
- if (timedOut) {
1934
- debugLogger3.warn(
1935
- "SDK shutdown rejected after timeout:",
1936
- err instanceof Error ? err.message : err
1937
- );
1938
- }
1939
- });
1940
- const timeout = new Promise((resolve) => {
1941
- timer = setTimeout(() => {
1942
- timedOut = true;
1943
- resolve("timeout");
1944
- }, SHUTDOWN_TIMEOUT_MS);
1945
- timer.unref?.();
1946
- });
1947
- const result = await Promise.race([sdkShutdown, timeout]);
1948
- clearTimeout(timer);
1949
- if (result === "timeout") {
1950
- const msg = `Telemetry shutdown timed out after ${SHUTDOWN_TIMEOUT_MS}ms.`;
1951
- diag.warn(msg);
1952
- debugLogger3.warn(msg);
1953
- } else {
1954
- debugLogger3.debug("OpenTelemetry SDK shut down successfully.");
1955
- }
1956
- } catch (error) {
1957
- clearTimeout(timer);
1958
- diag.error("Error shutting down SDK:", error);
1959
- debugLogger3.error("Error shutting down SDK:", error);
1960
- } finally {
1961
- telemetryInitialized = false;
1962
- sdk = void 0;
1963
- activeMetricReader = void 0;
1964
- telemetryShutdownPromise = void 0;
1965
- setSessionContext(void 0);
1966
- setShellTracePropagation(false);
1967
- }
1968
- })();
1969
- return telemetryShutdownPromise;
1970
- }
1971
- __name(shutdownTelemetry, "shutdownTelemetry");
1972
- var FORCE_FLUSH_TIMEOUT_MS = 2e3;
1973
- async function forceFlushMetrics() {
1974
- if (!telemetryInitialized || !activeMetricReader) return;
1975
- const flush = activeMetricReader.forceFlush();
1976
- flush.catch(() => {
1977
- });
1978
- let timer;
1979
- const timeout = new Promise((_, reject) => {
1980
- timer = setTimeout(
1981
- () => reject(
1982
- new Error(
1983
- `forceFlushMetrics timed out after ${FORCE_FLUSH_TIMEOUT_MS}ms`
1984
- )
1985
- ),
1986
- FORCE_FLUSH_TIMEOUT_MS
1987
- );
1988
- timer.unref?.();
1989
- });
1990
- try {
1991
- await Promise.race([flush, timeout]);
1992
- } finally {
1993
- clearTimeout(timer);
1994
- }
1995
- }
1996
- __name(forceFlushMetrics, "forceFlushMetrics");
1997
-
1998
- // packages/core/src/telemetry/detailed-span-attributes.ts
1999
- var SYSTEM_PROMPT_PREVIEW_LENGTH = 500;
2000
- var SHORT_TRUNCATION_SUFFIX = "...[TRUNCATED]";
2001
- var seenHashes = /* @__PURE__ */ new Set();
2002
- function areSensitiveSpanAttributesEnabled(config) {
2003
- return isTelemetrySdkInitialized() && config.getTelemetryIncludeSensitiveSpanAttributes();
2004
- }
2005
- __name(areSensitiveSpanAttributesEnabled, "areSensitiveSpanAttributesEnabled");
2006
- function truncateContent(content, maxSize = DEFAULT_SENSITIVE_SPAN_ATTRIBUTE_MAX_LENGTH, originalLength = content.length) {
2007
- if (!Number.isSafeInteger(maxSize) || maxSize < 1) {
2008
- throw new TypeError(
2009
- `maxSize must be a positive safe integer, got ${String(maxSize)}`
2010
- );
2011
- }
2012
- if (!Number.isSafeInteger(originalLength) || originalLength < 0) {
2013
- throw new TypeError(
2014
- `originalLength must be a non-negative safe integer, got ${String(
2015
- originalLength
2016
- )}`
2017
- );
2018
- }
2019
- if (originalLength < content.length) {
2020
- throw new TypeError(
2021
- `originalLength must be greater than or equal to content length, got ${originalLength} for content length ${content.length}`
2022
- );
2023
- }
2024
- if (originalLength <= maxSize && content.length <= maxSize) {
2025
- return { content, truncated: false };
2026
- }
2027
- if (originalLength > content.length && content.length <= maxSize) {
2028
- return { content, truncated: true };
2029
- }
2030
- const suffix = `
2031
-
2032
- [TRUNCATED - Content exceeds configured limit of ${maxSize} characters]`;
2033
- if (suffix.length >= maxSize) {
2034
- if (SHORT_TRUNCATION_SUFFIX.length >= maxSize) {
2035
- return {
2036
- content: SHORT_TRUNCATION_SUFFIX.slice(0, maxSize),
2037
- truncated: true
2038
- };
2039
- }
2040
- return {
2041
- content: content.slice(0, maxSize - SHORT_TRUNCATION_SUFFIX.length) + SHORT_TRUNCATION_SUFFIX,
2042
- truncated: true
2043
- };
2044
- }
2045
- return {
2046
- content: content.slice(0, maxSize - suffix.length) + suffix,
2047
- truncated: true
2048
- };
2049
- }
2050
- __name(truncateContent, "truncateContent");
2051
- function getMaxContentSize(config) {
2052
- return config.getTelemetrySensitiveSpanAttributeMaxLength();
2053
- }
2054
- __name(getMaxContentSize, "getMaxContentSize");
2055
- function truncatePrefixedContent(prefix, content, maxSize) {
2056
- const prefixedContent = `${prefix}${content}`;
2057
- const result = truncateContent(prefixedContent, maxSize);
2058
- return {
2059
- ...result,
2060
- originalLength: content.length
2061
- };
2062
- }
2063
- __name(truncatePrefixedContent, "truncatePrefixedContent");
2064
- function shortHash(content) {
2065
- return createHash2("sha256").update(content).digest("hex").slice(0, 12);
2066
- }
2067
- __name(shortHash, "shortHash");
2068
- function stringifyContentUnion(value) {
2069
- if (typeof value === "string") return value;
2070
- return safeJsonStringify(value) ?? "";
2071
- }
2072
- __name(stringifyContentUnion, "stringifyContentUnion");
2073
- function addUserPromptAttributes(config, span, promptText) {
2074
- if (!areSensitiveSpanAttributesEnabled(config) || !promptText) return;
2075
- const { content, truncated, originalLength } = truncatePrefixedContent(
2076
- `[USER PROMPT]
2077
- `,
2078
- promptText,
2079
- getMaxContentSize(config)
2080
- );
2081
- span.setAttributes({
2082
- new_context: content,
2083
- ...truncated && {
2084
- new_context_truncated: true,
2085
- new_context_original_length: originalLength
2086
- }
2087
- });
2088
- }
2089
- __name(addUserPromptAttributes, "addUserPromptAttributes");
2090
- function addSystemPromptAttributes(config, span, systemInstruction) {
2091
- if (!areSensitiveSpanAttributesEnabled(config) || !systemInstruction) return;
2092
- const text = stringifyContentUnion(systemInstruction);
2093
- if (!text) return;
2094
- const hash = `sp_${shortHash(text)}`;
2095
- span.setAttributes({
2096
- system_prompt_hash: hash,
2097
- system_prompt_preview: text.slice(0, SYSTEM_PROMPT_PREVIEW_LENGTH),
2098
- system_prompt_length: text.length
2099
- });
2100
- if (!seenHashes.has(hash)) {
2101
- seenHashes.add(hash);
2102
- const { content, truncated } = truncateContent(
2103
- text,
2104
- getMaxContentSize(config)
2105
- );
2106
- span.setAttribute("system_prompt", content);
2107
- if (truncated) {
2108
- span.setAttribute("system_prompt_truncated", true);
2109
- }
2110
- }
2111
- }
2112
- __name(addSystemPromptAttributes, "addSystemPromptAttributes");
2113
- function addToolSchemaAttributes(config, span, tools) {
2114
- if (!areSensitiveSpanAttributesEnabled(config) || !tools?.length) return;
2115
- const declarations = [];
2116
- for (const tool of tools) {
2117
- const inner = tool["functionDeclarations"];
2118
- if (Array.isArray(inner)) {
2119
- declarations.push(...inner);
2120
- } else {
2121
- declarations.push(tool);
2122
- }
2123
- }
2124
- const summary = [];
2125
- for (const decl of declarations) {
2126
- const declObj = decl;
2127
- const name = typeof declObj["name"] === "string" ? declObj["name"] : "unknown_tool";
2128
- const declJson = safeJsonStringify(decl) ?? `unstringifiable_${name}`;
2129
- const hash = shortHash(declJson);
2130
- summary.push({ name, hash });
2131
- const hashKey = `tool_${hash}`;
2132
- if (!seenHashes.has(hashKey)) {
2133
- seenHashes.add(hashKey);
2134
- const { content, truncated } = truncateContent(
2135
- declJson,
2136
- getMaxContentSize(config)
2137
- );
2138
- span.addEvent("tool_schema", {
2139
- tool_name: name,
2140
- tool_hash: hash,
2141
- tool_definition: content,
2142
- ...truncated && {
2143
- tool_definition_truncated: true,
2144
- tool_definition_original_length: declJson.length
2145
- }
2146
- });
2147
- }
2148
- }
2149
- span.setAttributes({
2150
- tools: safeJsonStringify(summary) ?? "[]",
2151
- tools_count: summary.length
2152
- });
2153
- }
2154
- __name(addToolSchemaAttributes, "addToolSchemaAttributes");
2155
- function addModelOutputAttributes(config, span, responseText, originalLength) {
2156
- if (!areSensitiveSpanAttributesEnabled(config) || !responseText) return;
2157
- const responseTextOriginalLength = originalLength ?? responseText.length;
2158
- const { content, truncated } = truncateContent(
2159
- responseText,
2160
- getMaxContentSize(config),
2161
- responseTextOriginalLength
2162
- );
2163
- span.setAttributes({
2164
- "response.model_output": content,
2165
- ...truncated && {
2166
- "response.model_output_truncated": true,
2167
- "response.model_output_original_length": responseTextOriginalLength
2168
- }
2169
- });
2170
- }
2171
- __name(addModelOutputAttributes, "addModelOutputAttributes");
2172
- function addToolInputAttributes(config, span, toolName, toolInput) {
2173
- if (!areSensitiveSpanAttributesEnabled(config)) return;
2174
- const { content, truncated, originalLength } = truncatePrefixedContent(
2175
- `[TOOL INPUT: ${toolName}]
2176
- `,
2177
- toolInput,
2178
- getMaxContentSize(config)
2179
- );
2180
- span.setAttributes({
2181
- tool_input: content,
2182
- ...truncated && {
2183
- tool_input_truncated: true,
2184
- tool_input_original_length: originalLength
2185
- }
2186
- });
2187
- }
2188
- __name(addToolInputAttributes, "addToolInputAttributes");
2189
- function addToolResultAttributes(config, span, toolName, toolResult) {
2190
- if (!areSensitiveSpanAttributesEnabled(config)) return;
2191
- const { content, truncated, originalLength } = truncatePrefixedContent(
2192
- `[TOOL RESULT: ${toolName}]
2193
- `,
2194
- toolResult,
2195
- getMaxContentSize(config)
2196
- );
2197
- span.setAttributes({
2198
- tool_result: content,
2199
- ...truncated && {
2200
- tool_result_truncated: true,
2201
- tool_result_original_length: originalLength
2202
- }
2203
- });
2204
- }
2205
- __name(addToolResultAttributes, "addToolResultAttributes");
2206
- function clearDetailedSpanState() {
2207
- seenHashes.clear();
2208
- }
2209
- __name(clearDetailedSpanState, "clearDetailedSpanState");
2210
-
2211
1923
  export {
2212
- FileOperation,
2213
- PerformanceMetricType,
2214
- MemoryMetricType,
2215
- ToolExecutionPhase,
2216
- ApiRequestPhase,
2217
1924
  getMeter,
2218
1925
  recordChatCompressionMetrics,
2219
1926
  recordToolCallMetrics,
@@ -2221,21 +1928,12 @@ export {
2221
1928
  recordApiResponseMetrics,
2222
1929
  recordApiErrorMetrics,
2223
1930
  recordFileOperationMetric,
2224
- recordInvalidChunk,
2225
1931
  recordContentRetry,
2226
1932
  recordContentRetryFailure,
2227
1933
  recordApiRetry,
2228
1934
  recordModelSlashCommand,
2229
- recordStartupPerformance,
2230
1935
  recordMemoryUsage,
2231
1936
  recordCpuUsage,
2232
- recordToolQueueDepth,
2233
- recordToolExecutionBreakdown,
2234
- recordTokenEfficiency,
2235
- recordApiRequestBreakdown,
2236
- recordPerformanceScore,
2237
- recordPerformanceRegression,
2238
- recordBaselineComparison,
2239
1937
  isPerformanceMonitoringActive,
2240
1938
  recordSubagentExecutionMetrics,
2241
1939
  recordArenaSessionStartedMetrics,
@@ -2252,15 +1950,6 @@ export {
2252
1950
  API_CALL_FAILED_SPAN_STATUS_MESSAGE,
2253
1951
  API_CALL_ABORTED_SPAN_STATUS_MESSAGE,
2254
1952
  safeSetStatus,
2255
- areSensitiveSpanAttributesEnabled,
2256
- truncateContent,
2257
- addUserPromptAttributes,
2258
- addSystemPromptAttributes,
2259
- addToolSchemaAttributes,
2260
- addModelOutputAttributes,
2261
- addToolInputAttributes,
2262
- addToolResultAttributes,
2263
- clearDetailedSpanState,
2264
1953
  isInNativeSubagentSpan,
2265
1954
  truncateSpanError,
2266
1955
  startInteractionSpan,