@qwen-code/qwen-code 0.18.3-preview.0 → 0.18.4-preview.0

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 (508) hide show
  1. package/README.md +64 -492
  2. package/bundled/loop/SKILL.md +53 -26
  3. package/bundled/loop/SKILL.test.ts +67 -0
  4. package/bundled/qc-helper/docs/configuration/settings.md +25 -18
  5. package/bundled/qc-helper/docs/extension/introduction.md +38 -0
  6. package/bundled/qc-helper/docs/features/channels/_meta.ts +1 -0
  7. package/bundled/qc-helper/docs/features/channels/overview.md +4 -4
  8. package/bundled/qc-helper/docs/features/channels/qqbot.md +179 -0
  9. package/bundled/qc-helper/docs/features/commands.md +49 -0
  10. package/bundled/qc-helper/docs/features/followup-suggestions.md +10 -6
  11. package/bundled/qc-helper/docs/features/hooks.md +6 -3
  12. package/bundled/qc-helper/docs/features/status-line.md +4 -2
  13. package/bundled/qc-helper/docs/qwen-serve.md +9 -4
  14. package/bundled/qc-helper/docs/reference/keyboard-shortcuts.md +11 -5
  15. package/bundled/qc-helper/docs/support/troubleshooting.md +5 -0
  16. package/chunks/{agent-X42UKL4M.js → agent-PPGQVSZN.js} +24 -23
  17. package/chunks/{agent-headless-7FQ7NX6G.js → agent-headless-5SGQIWGS.js} +24 -23
  18. package/chunks/{anthropicContentGenerator-KLBHYGH6.js → anthropicContentGenerator-OLOGBVLP.js} +4 -4
  19. package/chunks/{askUserQuestion-QPZXR3UO.js → askUserQuestion-ANRVSBIJ.js} +2 -2
  20. package/chunks/{ca-RK4QPLIX.js → ca-K6MD665I.js} +42 -2
  21. package/chunks/chunk-2ES3D3TW.js +1026 -0
  22. package/chunks/{chunk-O4PICXES.js → chunk-2MPVVENX.js} +14 -6
  23. package/chunks/{chunk-BJ5HQ23U.js → chunk-4HMWGHPP.js} +9 -10
  24. package/chunks/{chunk-SFRV6BGY.js → chunk-4TW2JM5Q.js} +3 -3
  25. package/chunks/{chunk-ZOFNJQNJ.js → chunk-7GX7XYZU.js} +3 -3
  26. package/chunks/{chunk-VIEIRAK3.js → chunk-7OCZ77KA.js} +4 -2
  27. package/chunks/{chunk-3U2ZIZDP.js → chunk-A6OKBLUA.js} +732 -617
  28. package/chunks/{chunk-RTTAC5VW.js → chunk-AQDPHFDZ.js} +1 -1
  29. package/chunks/{chunk-U62OHNQR.js → chunk-BR6DF3Y4.js} +6 -6
  30. package/chunks/{chunk-IDYDPBBN.js → chunk-DZCZZPCY.js} +3 -3
  31. package/chunks/{chunk-ZMIBJS45.js → chunk-E5SRTXRG.js} +1 -1
  32. package/chunks/{chunk-FIQECJTQ.js → chunk-F6FP3URI.js} +1 -1
  33. package/chunks/{chunk-IQHSD7K5.js → chunk-FPZF3BNV.js} +1 -1
  34. package/chunks/{chunk-NNIYWQIS.js → chunk-HU3RKEK2.js} +2 -1
  35. package/chunks/{chunk-HA2UEYZP.js → chunk-IKOWINH4.js} +7 -4
  36. package/chunks/{chunk-JHSQY3J5.js → chunk-IS4QOHTV.js} +6 -5
  37. package/chunks/{chunk-MN5RAXVB.js → chunk-IUEQOXOI.js} +18 -6
  38. package/chunks/{chunk-CPVI5J2L.js → chunk-JIJBNW4A.js} +1 -1
  39. package/chunks/{chunk-ZNUMXPNK.js → chunk-JJHY7NAD.js} +7 -3
  40. package/chunks/{chunk-YJDVHAGL.js → chunk-JN6FVOPP.js} +2 -2
  41. package/chunks/{chunk-P5CE42XM.js → chunk-JP3LQIMW.js} +1046 -293
  42. package/chunks/{chunk-VU6A2OBJ.js → chunk-JXQ23SNT.js} +217 -219
  43. package/chunks/{chunk-WPTCDQN6.js → chunk-M5VYHAHT.js} +2 -2
  44. package/chunks/{chunk-VFW7VM7A.js → chunk-MP436DDQ.js} +131009 -128408
  45. package/chunks/{chunk-LXYWINWF.js → chunk-N5QHMPZU.js} +1 -1
  46. package/chunks/{chunk-LYSND7KR.js → chunk-PTGKSUUJ.js} +2 -2
  47. package/chunks/{chunk-6X6PTTH3.js → chunk-VNMHFAZ3.js} +24 -12
  48. package/chunks/{chunk-LYRSMKLS.js → chunk-VWPDSQZY.js} +2 -2
  49. package/chunks/{chunk-B4ZF2KSI.js → chunk-WWU2KUSR.js} +2 -2
  50. package/chunks/{chunk-QP4R5FTG.js → chunk-Z7XXFPGP.js} +4 -3
  51. package/chunks/{chunk-TW522KN6.js → chunk-ZTQ26VBE.js} +13 -6
  52. package/chunks/{computer-use-WHPP33BI.js → computer-use-LPHSGISW.js} +24 -23
  53. package/chunks/contextCommand-SQPW6JX7.js +54 -0
  54. package/chunks/{cron-create-DQKRQMCP.js → cron-create-OKGQO6GX.js} +6 -6
  55. package/chunks/{cron-delete-DOFPHFTI.js → cron-delete-DTJP7L6O.js} +6 -6
  56. package/chunks/{cron-list-RCVOO3CB.js → cron-list-VKZUASFG.js} +24 -10
  57. package/chunks/{de-FGPM4KW5.js → de-K2F3T3TR.js} +41 -1
  58. package/chunks/{dist-2UCAYOX7.js → dist-BD27IA3L.js} +16 -5
  59. package/chunks/{dist-33LHH26D.js → dist-KIYB7DQW.js} +1 -1
  60. package/chunks/{dist-UH7CYT7F.js → dist-OLC6NBSB.js} +51 -10
  61. package/chunks/dist-QFFZWACU.js +2136 -0
  62. package/chunks/{dist-KF43SZZV.js → dist-QUSDBLAK.js} +1 -1
  63. package/chunks/{edit-V22UFE4F.js → edit-OPGWEYXB.js} +26 -27
  64. package/chunks/{en-VP6XPGEC.js → en-KGSAKBJP.js} +232 -0
  65. package/chunks/{enter-worktree-HYS5U3QO.js → enter-worktree-JLFLU22E.js} +24 -23
  66. package/chunks/{enterPlanMode-UR2KPB4Y.js → enterPlanMode-JFBUNYML.js} +47 -23
  67. package/chunks/{exit-worktree-JNIUZIZ3.js → exit-worktree-NU64ZZRI.js} +191 -41
  68. package/chunks/{exitPlanMode-NJY3Y6XQ.js → exitPlanMode-UR6YQE64.js} +81 -43
  69. package/chunks/{fr-ATYBVCLT.js → fr-2CAQEOK6.js} +41 -1
  70. package/chunks/{geminiContentGenerator-SDUMCYHD.js → geminiContentGenerator-KUVZXCGX.js} +4 -4
  71. package/chunks/{glob-Z6UYFZCH.js → glob-RNX6IBFD.js} +26 -24
  72. package/chunks/{grep-WHWDB2HD.js → grep-5GUNAZFX.js} +96 -43
  73. package/chunks/{ja-W2QEA2OI.js → ja-QWL7V6OJ.js} +41 -1
  74. package/chunks/{keychain-token-storage-QSTRHKKL.js → keychain-token-storage-ALKQXYJQ.js} +2 -2
  75. package/chunks/loop-wakeup-RX6YIUSG.js +167 -0
  76. package/chunks/{ls-TRD77UTS.js → ls-6PLNWHMU.js} +3 -3
  77. package/chunks/{lsp-2VFWQPZS.js → lsp-3HFQU4OF.js} +2 -2
  78. package/chunks/{monitor-F4V4YEE4.js → monitor-LYHRV6SR.js} +24 -23
  79. package/chunks/{notebook-edit-P45433KC.js → notebook-edit-B5FEP65B.js} +25 -26
  80. package/chunks/{openaiContentGenerator-DRXB5MSN.js → openaiContentGenerator-XYMMXZFG.js} +12 -11
  81. package/chunks/{pt-ZKEWJFBW.js → pt-2SPOLMAY.js} +41 -1
  82. package/chunks/{qwenContentGenerator-3XZMXLHX.js → qwenContentGenerator-QWPW3P7K.js} +26 -25
  83. package/chunks/{qwenOAuth2-KK433U33.js → qwenOAuth2-XWC5SU63.js} +4 -4
  84. package/chunks/{read-file-WQPROSSJ.js → read-file-ROEHCU4A.js} +9 -8
  85. package/chunks/{ripGrep-EAE7GW6T.js → ripGrep-YBPCCX22.js} +24 -23
  86. package/chunks/{ru-VEKTPJ74.js → ru-35IVJTEH.js} +41 -1
  87. package/chunks/{scheduler-WCMRRLYM.js → scheduler-NIQSNCLH.js} +24 -23
  88. package/chunks/{send-message-QZOC5GA2.js → send-message-IIT3SHA7.js} +2 -2
  89. package/chunks/{serve-BVDNMP5D.js → serve-GME2SMSV.js} +1249 -279
  90. package/chunks/{shell-W4LWEOQL.js → shell-E7NADQBV.js} +24 -23
  91. package/chunks/{skill-VTJI4OPM.js → skill-WVYNAGWW.js} +11 -10
  92. package/chunks/{src-E42UOH5I.js → src-4HJAM36V.js} +137 -59
  93. package/chunks/{syntheticOutput-WJSUK4SZ.js → syntheticOutput-H67FYXU7.js} +3 -3
  94. package/chunks/{task-create-GGSC27HO.js → task-create-OVXHSHAI.js} +7 -7
  95. package/chunks/{task-list-EDHHHSK4.js → task-list-QUUCQJ3U.js} +6 -6
  96. package/chunks/{task-stop-WR5PDVZY.js → task-stop-WA5DMTKK.js} +2 -2
  97. package/chunks/{task-update-UR7NUHBV.js → task-update-PC5427TI.js} +7 -7
  98. package/chunks/{team-create-OAGMFFDJ.js → team-create-BOSQOS35.js} +26 -25
  99. package/chunks/{team-delete-FC33URJK.js → team-delete-ZTEMYRJ3.js} +6 -6
  100. package/chunks/{todoWrite-GO2ME7ZV.js → todoWrite-J6L6ELD6.js} +4 -4
  101. package/chunks/{tool-search-XZPD5EPI.js → tool-search-PPLILX5J.js} +9 -8
  102. package/chunks/{web-fetch-NLLATYIL.js → web-fetch-6XLPPTP7.js} +5 -5
  103. package/chunks/{workflow-AIC3XOX5.js → workflow-CDROZNXC.js} +242 -39
  104. package/chunks/{write-file-6GIRRW43.js → write-file-QY4X7MMO.js} +26 -27
  105. package/chunks/{zh-TW-6YFNCKTA.js → zh-TW-BSG6BUWK.js} +232 -2
  106. package/chunks/{zh-OIXDDQHB.js → zh-X4KM6MTW.js} +233 -0
  107. package/cli.js +10735 -5708
  108. package/examples/agent/agents/diary.md +1 -1
  109. package/examples/mcp-server/qwen-extension.json +8 -1
  110. package/examples/starter/agents/diary.md +1 -1
  111. package/locales/ca.js +67 -2
  112. package/locales/de.js +68 -2
  113. package/locales/en.js +304 -0
  114. package/locales/fr.js +69 -2
  115. package/locales/ja.js +65 -2
  116. package/locales/pt.js +67 -2
  117. package/locales/ru.js +68 -2
  118. package/locales/zh-TW.js +288 -2
  119. package/locales/zh.js +288 -0
  120. package/package.json +4 -3
  121. package/web-shell/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  122. package/web-shell/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  123. package/web-shell/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  124. package/web-shell/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  125. package/web-shell/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  126. package/web-shell/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  127. package/web-shell/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  128. package/web-shell/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  129. package/web-shell/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  130. package/web-shell/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  131. package/web-shell/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  132. package/web-shell/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  133. package/web-shell/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  134. package/web-shell/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  135. package/web-shell/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  136. package/web-shell/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  137. package/web-shell/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  138. package/web-shell/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  139. package/web-shell/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  140. package/web-shell/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  141. package/web-shell/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  142. package/web-shell/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  143. package/web-shell/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  144. package/web-shell/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  145. package/web-shell/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  146. package/web-shell/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  147. package/web-shell/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  148. package/web-shell/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  149. package/web-shell/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  150. package/web-shell/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  151. package/web-shell/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  152. package/web-shell/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  153. package/web-shell/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  154. package/web-shell/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  155. package/web-shell/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  156. package/web-shell/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  157. package/web-shell/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  158. package/web-shell/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  159. package/web-shell/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  160. package/web-shell/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  161. package/web-shell/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  162. package/web-shell/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  163. package/web-shell/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  164. package/web-shell/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  165. package/web-shell/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  166. package/web-shell/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  167. package/web-shell/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  168. package/web-shell/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  169. package/web-shell/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  170. package/web-shell/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  171. package/web-shell/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  172. package/web-shell/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  173. package/web-shell/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  174. package/web-shell/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  175. package/web-shell/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  176. package/web-shell/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  177. package/web-shell/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  178. package/web-shell/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  179. package/web-shell/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  180. package/web-shell/assets/abap-DsBKuouk.js +1 -0
  181. package/web-shell/assets/actionscript-3-D_z4Izcz.js +1 -0
  182. package/web-shell/assets/ada-727ZlQH0.js +1 -0
  183. package/web-shell/assets/andromeeda-C3khCPGq.js +1 -0
  184. package/web-shell/assets/angular-html-LfdN0zeE.js +1 -0
  185. package/web-shell/assets/angular-ts-CKsD7JZE.js +1 -0
  186. package/web-shell/assets/apache-Dn00JSTd.js +1 -0
  187. package/web-shell/assets/apex-COJ4H7py.js +1 -0
  188. package/web-shell/assets/apl-BBq3IX1j.js +1 -0
  189. package/web-shell/assets/applescript-Bu5BbsvL.js +1 -0
  190. package/web-shell/assets/ara-7O62HKoU.js +1 -0
  191. package/web-shell/assets/arc-CRFN10gD.js +1 -0
  192. package/web-shell/assets/architectureDiagram-3BPJPVTR-IRlu1CpH.js +36 -0
  193. package/web-shell/assets/asciidoc-BPT9niGB.js +1 -0
  194. package/web-shell/assets/asm-Dhn9LcZ4.js +1 -0
  195. package/web-shell/assets/astro-CqkE3fuf.js +1 -0
  196. package/web-shell/assets/aurora-x-D-2ljcwZ.js +1 -0
  197. package/web-shell/assets/awk-eg146-Ew.js +1 -0
  198. package/web-shell/assets/ayu-dark-Cv9koXgw.js +1 -0
  199. package/web-shell/assets/ballerina-Du268qiB.js +1 -0
  200. package/web-shell/assets/bat-fje9CFhw.js +1 -0
  201. package/web-shell/assets/beancount-BwXTMy5W.js +1 -0
  202. package/web-shell/assets/berry-3xVqZejG.js +1 -0
  203. package/web-shell/assets/bibtex-xW4inM5L.js +1 -0
  204. package/web-shell/assets/bicep-DHo0CJ0O.js +1 -0
  205. package/web-shell/assets/blade-a8OxSdnT.js +1 -0
  206. package/web-shell/assets/blockDiagram-GPEHLZMM-htIZ6iw8.js +132 -0
  207. package/web-shell/assets/bsl-Dgyn0ogV.js +1 -0
  208. package/web-shell/assets/c-C3t2pwGQ.js +1 -0
  209. package/web-shell/assets/c4Diagram-AAUBKEIU-A2GoRq3O.js +10 -0
  210. package/web-shell/assets/cadence-DNquZEk8.js +1 -0
  211. package/web-shell/assets/cairo--RitsXJZ.js +1 -0
  212. package/web-shell/assets/catppuccin-frappe-CD_QflpE.js +1 -0
  213. package/web-shell/assets/catppuccin-latte-DRW-0cLl.js +1 -0
  214. package/web-shell/assets/catppuccin-macchiato-C-_shW-Y.js +1 -0
  215. package/web-shell/assets/catppuccin-mocha-LGGdnPYs.js +1 -0
  216. package/web-shell/assets/channel-WwImfsc7.js +1 -0
  217. package/web-shell/assets/chunk-2J33WTMH-CdP2AC6u.js +1 -0
  218. package/web-shell/assets/chunk-4BX2VUAB-DrA07nW2.js +1 -0
  219. package/web-shell/assets/chunk-55IACEB6-CFGnVU2f.js +1 -0
  220. package/web-shell/assets/chunk-727SXJPM-BTMkq3Tk.js +206 -0
  221. package/web-shell/assets/chunk-AQP2D5EJ-C9sYg04Z.js +231 -0
  222. package/web-shell/assets/chunk-FMBD7UC4-Cag-cj6I.js +15 -0
  223. package/web-shell/assets/chunk-ND2GUHAM-CDSTFoR7.js +1 -0
  224. package/web-shell/assets/chunk-QZHKN3VN-CN9Z6oOs.js +1 -0
  225. package/web-shell/assets/clarity-BHOwM8T6.js +1 -0
  226. package/web-shell/assets/classDiagram-4FO5ZUOK-CJKQYFeJ.js +1 -0
  227. package/web-shell/assets/classDiagram-v2-Q7XG4LA2-CJKQYFeJ.js +1 -0
  228. package/web-shell/assets/clojure-DxSadP1t.js +1 -0
  229. package/web-shell/assets/cmake-DbXoA79R.js +1 -0
  230. package/web-shell/assets/cobol-PTqiYgYu.js +1 -0
  231. package/web-shell/assets/codeowners-Bp6g37R7.js +1 -0
  232. package/web-shell/assets/codeql-sacFqUAJ.js +1 -0
  233. package/web-shell/assets/coffee-dyiR41kL.js +1 -0
  234. package/web-shell/assets/common-lisp-C7gG9l05.js +1 -0
  235. package/web-shell/assets/coq-Dsg_Bt_b.js +1 -0
  236. package/web-shell/assets/cose-bilkent-S5V4N54A-DuN9j8Du.js +1 -0
  237. package/web-shell/assets/cpp-BksuvNSY.js +1 -0
  238. package/web-shell/assets/crystal-DtDmRg-F.js +1 -0
  239. package/web-shell/assets/csharp-D9R-vmeu.js +1 -0
  240. package/web-shell/assets/css-BPhBrDlE.js +1 -0
  241. package/web-shell/assets/csv-B0qRVHPH.js +1 -0
  242. package/web-shell/assets/cue-DtFQj3wx.js +1 -0
  243. package/web-shell/assets/cypher-m2LEI-9-.js +1 -0
  244. package/web-shell/assets/cytoscape.esm-CUqq0XTU.js +331 -0
  245. package/web-shell/assets/d-BoXegm-a.js +1 -0
  246. package/web-shell/assets/dagre-BM42HDAG-ByCWe45f.js +4 -0
  247. package/web-shell/assets/dark-plus-C3mMm8J8.js +1 -0
  248. package/web-shell/assets/dart-B9wLZaAG.js +1 -0
  249. package/web-shell/assets/dax-ClGRhx96.js +1 -0
  250. package/web-shell/assets/defaultLocale-DX6XiGOO.js +1 -0
  251. package/web-shell/assets/desktop-DEIpsLCJ.js +1 -0
  252. package/web-shell/assets/diagram-2AECGRRQ-eWyU_pKZ.js +43 -0
  253. package/web-shell/assets/diagram-5GNKFQAL-0Bfu3Fq5.js +10 -0
  254. package/web-shell/assets/diagram-KO2AKTUF-B6KBKkQP.js +3 -0
  255. package/web-shell/assets/diagram-LMA3HP47-TToDmeA_.js +24 -0
  256. package/web-shell/assets/diagram-OG6HWLK6-CQCkC2Yx.js +24 -0
  257. package/web-shell/assets/diff-BgYniUM_.js +1 -0
  258. package/web-shell/assets/docker-COcR7UxN.js +1 -0
  259. package/web-shell/assets/dotenv-BjQB5zDj.js +1 -0
  260. package/web-shell/assets/dracula-BzJJZx-M.js +1 -0
  261. package/web-shell/assets/dracula-soft-BXkSAIEj.js +1 -0
  262. package/web-shell/assets/dream-maker-C-nORZOA.js +1 -0
  263. package/web-shell/assets/edge-D5gP-w-T.js +1 -0
  264. package/web-shell/assets/elixir-CLiX3zqd.js +1 -0
  265. package/web-shell/assets/elm-CmHSxxaM.js +1 -0
  266. package/web-shell/assets/emacs-lisp-BX77sIaO.js +1 -0
  267. package/web-shell/assets/erDiagram-TEJ5UH35-Cm9ls1iB.js +85 -0
  268. package/web-shell/assets/erb-BYTLMnw6.js +1 -0
  269. package/web-shell/assets/erlang-B-DoSBHF.js +1 -0
  270. package/web-shell/assets/everforest-dark-BgDCqdQA.js +1 -0
  271. package/web-shell/assets/everforest-light-C8M2exoo.js +1 -0
  272. package/web-shell/assets/fennel-bCA53EVm.js +1 -0
  273. package/web-shell/assets/fish-w-ucz2PV.js +1 -0
  274. package/web-shell/assets/flowDiagram-I6XJVG4X-Dyoz80Pv.js +162 -0
  275. package/web-shell/assets/fluent-Dayu4EKP.js +1 -0
  276. package/web-shell/assets/fortran-fixed-form-TqA4NnZg.js +1 -0
  277. package/web-shell/assets/fortran-free-form-DKXYxT9g.js +1 -0
  278. package/web-shell/assets/fsharp-XplgxFYe.js +1 -0
  279. package/web-shell/assets/ganttDiagram-6RSMTGT7-Cfut9yaU.js +292 -0
  280. package/web-shell/assets/gdresource-BHYsBjWJ.js +1 -0
  281. package/web-shell/assets/gdscript-DfxzS6Rs.js +1 -0
  282. package/web-shell/assets/gdshader-SKMF96pI.js +1 -0
  283. package/web-shell/assets/genie-ajMbGru0.js +1 -0
  284. package/web-shell/assets/gherkin--30QC5Em.js +1 -0
  285. package/web-shell/assets/git-commit-i4q6IMui.js +1 -0
  286. package/web-shell/assets/git-rebase-B-v9cOL2.js +1 -0
  287. package/web-shell/assets/gitGraphDiagram-PVQCEYII-BCuJdlfD.js +106 -0
  288. package/web-shell/assets/github-dark-DHJKELXO.js +1 -0
  289. package/web-shell/assets/github-dark-default-Cuk6v7N8.js +1 -0
  290. package/web-shell/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
  291. package/web-shell/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
  292. package/web-shell/assets/github-light-DAi9KRSo.js +1 -0
  293. package/web-shell/assets/github-light-default-D7oLnXFd.js +1 -0
  294. package/web-shell/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
  295. package/web-shell/assets/gleam-B430Bg39.js +1 -0
  296. package/web-shell/assets/glimmer-js-D-cwc0-E.js +1 -0
  297. package/web-shell/assets/glimmer-ts-pgjy16dm.js +1 -0
  298. package/web-shell/assets/glsl-DBO2IWDn.js +1 -0
  299. package/web-shell/assets/gnuplot-CM8KxXT1.js +1 -0
  300. package/web-shell/assets/go-B1SYOhNW.js +1 -0
  301. package/web-shell/assets/graph-qsFoMdT2.js +1 -0
  302. package/web-shell/assets/graphql-cDcHW_If.js +1 -0
  303. package/web-shell/assets/groovy-DkBy-JyN.js +1 -0
  304. package/web-shell/assets/hack-D1yCygmZ.js +1 -0
  305. package/web-shell/assets/haml-B2EZWmdv.js +1 -0
  306. package/web-shell/assets/handlebars-BQGss363.js +1 -0
  307. package/web-shell/assets/haskell-BILxekzW.js +1 -0
  308. package/web-shell/assets/haxe-C5wWYbrZ.js +1 -0
  309. package/web-shell/assets/hcl-HzYwdGDm.js +1 -0
  310. package/web-shell/assets/hjson-T-Tgc4AT.js +1 -0
  311. package/web-shell/assets/hlsl-ifBTmRxC.js +1 -0
  312. package/web-shell/assets/houston-DnULxvSX.js +1 -0
  313. package/web-shell/assets/html-C2L_23MC.js +1 -0
  314. package/web-shell/assets/html-derivative-CSfWNPLT.js +1 -0
  315. package/web-shell/assets/http-FRrOvY1W.js +1 -0
  316. package/web-shell/assets/hxml-TIA70rKU.js +1 -0
  317. package/web-shell/assets/hy-BMj5Y0dO.js +1 -0
  318. package/web-shell/assets/imba-bv_oIlVt.js +1 -0
  319. package/web-shell/assets/index-BDZiTAkl.css +1 -0
  320. package/web-shell/assets/index-DaebdpHq.js +516 -0
  321. package/web-shell/assets/infoDiagram-5YYISTIA-CXKxF2VL.js +2 -0
  322. package/web-shell/assets/ini-BjABl1g7.js +1 -0
  323. package/web-shell/assets/init-Gi6I4Gst.js +1 -0
  324. package/web-shell/assets/ishikawaDiagram-YF4QCWOH-DE7HWSU8.js +70 -0
  325. package/web-shell/assets/java-xI-RfyKK.js +1 -0
  326. package/web-shell/assets/javascript-ySlJ1b_l.js +1 -0
  327. package/web-shell/assets/jinja-DGy0s7-h.js +1 -0
  328. package/web-shell/assets/jison-BqZprYcd.js +1 -0
  329. package/web-shell/assets/journeyDiagram-JHISSGLW-D__YUfds.js +139 -0
  330. package/web-shell/assets/json-BQoSv7ci.js +1 -0
  331. package/web-shell/assets/json5-w8dY5SsB.js +1 -0
  332. package/web-shell/assets/jsonc-TU54ms6u.js +1 -0
  333. package/web-shell/assets/jsonl-DREVFZK8.js +1 -0
  334. package/web-shell/assets/jsonnet-BfivnA6A.js +1 -0
  335. package/web-shell/assets/jssm-P4WzXJd0.js +1 -0
  336. package/web-shell/assets/jsx-BAng5TT0.js +1 -0
  337. package/web-shell/assets/julia-BBuGR-5E.js +1 -0
  338. package/web-shell/assets/kanagawa-dragon-CkXjmgJE.js +1 -0
  339. package/web-shell/assets/kanagawa-lotus-CfQXZHmo.js +1 -0
  340. package/web-shell/assets/kanagawa-wave-DWedfzmr.js +1 -0
  341. package/web-shell/assets/kanban-definition-UN3LZRKU-D82R169M.js +89 -0
  342. package/web-shell/assets/kotlin-B5lbUyaz.js +1 -0
  343. package/web-shell/assets/kusto-mebxcVVE.js +1 -0
  344. package/web-shell/assets/laserwave-DUszq2jm.js +1 -0
  345. package/web-shell/assets/latex-C-cWTeAZ.js +1 -0
  346. package/web-shell/assets/layout-CNYaLpI5.js +1 -0
  347. package/web-shell/assets/lean-XBlWyCtg.js +1 -0
  348. package/web-shell/assets/less-BfCpw3nA.js +1 -0
  349. package/web-shell/assets/light-plus-B7mTdjB0.js +1 -0
  350. package/web-shell/assets/linear-DpyMbKqT.js +1 -0
  351. package/web-shell/assets/liquid-D3W5UaiH.js +1 -0
  352. package/web-shell/assets/log-Cc5clBb7.js +1 -0
  353. package/web-shell/assets/logo-IuBKFhSY.js +1 -0
  354. package/web-shell/assets/lua-CvWAzNxB.js +1 -0
  355. package/web-shell/assets/luau-Du5NY7AG.js +1 -0
  356. package/web-shell/assets/make-Bvotw-X0.js +1 -0
  357. package/web-shell/assets/markdown-UIAJJxZW.js +1 -0
  358. package/web-shell/assets/marko-z0MBrx5-.js +1 -0
  359. package/web-shell/assets/material-theme-D5KoaKCx.js +1 -0
  360. package/web-shell/assets/material-theme-darker-BfHTSMKl.js +1 -0
  361. package/web-shell/assets/material-theme-lighter-B0m2ddpp.js +1 -0
  362. package/web-shell/assets/material-theme-ocean-CyktbL80.js +1 -0
  363. package/web-shell/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
  364. package/web-shell/assets/matlab-D9-PGadD.js +1 -0
  365. package/web-shell/assets/mdc-DB_EDNY_.js +1 -0
  366. package/web-shell/assets/mdx-sdHcTMYB.js +1 -0
  367. package/web-shell/assets/mermaid-Ci6OQyBP.js +1 -0
  368. package/web-shell/assets/mermaid.core-D1KEFDhn.js +309 -0
  369. package/web-shell/assets/min-dark-CafNBF8u.js +1 -0
  370. package/web-shell/assets/min-light-CTRr51gU.js +1 -0
  371. package/web-shell/assets/mindmap-definition-RKZ34NQL-BwVUFGFE.js +96 -0
  372. package/web-shell/assets/mipsasm-BC5c_5Pe.js +1 -0
  373. package/web-shell/assets/mojo-Tz6hzZYG.js +1 -0
  374. package/web-shell/assets/monokai-D4h5O-jR.js +1 -0
  375. package/web-shell/assets/move-DB_GagMm.js +1 -0
  376. package/web-shell/assets/narrat-DLbgOhZU.js +1 -0
  377. package/web-shell/assets/nextflow-B0XVJmRM.js +1 -0
  378. package/web-shell/assets/nginx-D_VnBJ67.js +1 -0
  379. package/web-shell/assets/night-owl-C39BiMTA.js +1 -0
  380. package/web-shell/assets/nim-ZlGxZxc3.js +1 -0
  381. package/web-shell/assets/nix-shcSOmrb.js +1 -0
  382. package/web-shell/assets/nord-Ddv68eIx.js +1 -0
  383. package/web-shell/assets/nushell-D4Tzg5kh.js +1 -0
  384. package/web-shell/assets/objective-c-Deuh7S70.js +1 -0
  385. package/web-shell/assets/objective-cpp-BUEGK8hf.js +1 -0
  386. package/web-shell/assets/ocaml-BNioltXt.js +1 -0
  387. package/web-shell/assets/one-dark-pro-GBQ2dnAY.js +1 -0
  388. package/web-shell/assets/one-light-PoHY5YXO.js +1 -0
  389. package/web-shell/assets/ordinal-Cboi1Yqb.js +1 -0
  390. package/web-shell/assets/pascal-JqZropPD.js +1 -0
  391. package/web-shell/assets/perl-CHQXSrWU.js +1 -0
  392. package/web-shell/assets/php-B5ebYQev.js +1 -0
  393. package/web-shell/assets/pieDiagram-4H26LBE5-BO_qoEGx.js +30 -0
  394. package/web-shell/assets/plastic-3e1v2bzS.js +1 -0
  395. package/web-shell/assets/plsql-LKU2TuZ1.js +1 -0
  396. package/web-shell/assets/po-BFLt1xDp.js +1 -0
  397. package/web-shell/assets/poimandres-CS3Unz2-.js +1 -0
  398. package/web-shell/assets/polar-DKykz6zU.js +1 -0
  399. package/web-shell/assets/postcss-B3ZDOciz.js +1 -0
  400. package/web-shell/assets/powerquery-CSHBycmS.js +1 -0
  401. package/web-shell/assets/powershell-BIEUsx6d.js +1 -0
  402. package/web-shell/assets/prisma-B48N-Iqd.js +1 -0
  403. package/web-shell/assets/prolog-BY-TUvya.js +1 -0
  404. package/web-shell/assets/proto-zocC4JxJ.js +1 -0
  405. package/web-shell/assets/pug-CM9l7STV.js +1 -0
  406. package/web-shell/assets/puppet-Cza_XSSt.js +1 -0
  407. package/web-shell/assets/purescript-Bg-kzb6g.js +1 -0
  408. package/web-shell/assets/python-DhUJRlN_.js +1 -0
  409. package/web-shell/assets/qml-D8XfuvdV.js +1 -0
  410. package/web-shell/assets/qmldir-C8lEn-DE.js +1 -0
  411. package/web-shell/assets/qss-DhMKtDLN.js +1 -0
  412. package/web-shell/assets/quadrantDiagram-W4KKPZXB-Cx0ZaWPo.js +7 -0
  413. package/web-shell/assets/r-CwjWoCRV.js +1 -0
  414. package/web-shell/assets/racket-CzouJOBO.js +1 -0
  415. package/web-shell/assets/raku-B1bQXN8T.js +1 -0
  416. package/web-shell/assets/razor-CNLDkMZG.js +1 -0
  417. package/web-shell/assets/red-bN70gL4F.js +1 -0
  418. package/web-shell/assets/reg-5LuOXUq_.js +1 -0
  419. package/web-shell/assets/regexp-DWJ3fJO_.js +1 -0
  420. package/web-shell/assets/rel-DJlmqQ1C.js +1 -0
  421. package/web-shell/assets/requirementDiagram-4Y6WPE33-BJPXejOA.js +84 -0
  422. package/web-shell/assets/riscv-QhoSD0DR.js +1 -0
  423. package/web-shell/assets/rose-pine-CmCqftbK.js +1 -0
  424. package/web-shell/assets/rose-pine-dawn-Ds-gbosJ.js +1 -0
  425. package/web-shell/assets/rose-pine-moon-CjDtw9vr.js +1 -0
  426. package/web-shell/assets/rst-4NLicBqY.js +1 -0
  427. package/web-shell/assets/ruby-DeZ3UC14.js +1 -0
  428. package/web-shell/assets/rust-Be6lgOlo.js +1 -0
  429. package/web-shell/assets/sankeyDiagram-5OEKKPKP-C1xeIL9i.js +40 -0
  430. package/web-shell/assets/sas-BmTFh92c.js +1 -0
  431. package/web-shell/assets/sass-BJ4Li9vH.js +1 -0
  432. package/web-shell/assets/scala-DQVVAn-B.js +1 -0
  433. package/web-shell/assets/scheme-BJGe-b2p.js +1 -0
  434. package/web-shell/assets/scss-C31hgJw-.js +1 -0
  435. package/web-shell/assets/sdbl-BLhTXw86.js +1 -0
  436. package/web-shell/assets/sequenceDiagram-3UESZ5HK-CSYKQUjf.js +162 -0
  437. package/web-shell/assets/shaderlab-B7qAK45m.js +1 -0
  438. package/web-shell/assets/shellscript-atvbtKCR.js +1 -0
  439. package/web-shell/assets/shellsession-C_rIy8kc.js +1 -0
  440. package/web-shell/assets/slack-dark-BthQWCQV.js +1 -0
  441. package/web-shell/assets/slack-ochin-DqwNpetd.js +1 -0
  442. package/web-shell/assets/smalltalk-DkLiglaE.js +1 -0
  443. package/web-shell/assets/snazzy-light-Bw305WKR.js +1 -0
  444. package/web-shell/assets/solarized-dark-DXbdFlpD.js +1 -0
  445. package/web-shell/assets/solarized-light-L9t79GZl.js +1 -0
  446. package/web-shell/assets/solidity-C1w2a3ep.js +1 -0
  447. package/web-shell/assets/soy-C-lX7w71.js +1 -0
  448. package/web-shell/assets/sparql-bYkjHRlG.js +1 -0
  449. package/web-shell/assets/splunk-Cf8iN4DR.js +1 -0
  450. package/web-shell/assets/sql-COK4E0Yg.js +1 -0
  451. package/web-shell/assets/ssh-config-BknIz3MU.js +1 -0
  452. package/web-shell/assets/stata-DorPZHa4.js +1 -0
  453. package/web-shell/assets/stateDiagram-AJRCARHV-d9hiHlAW.js +1 -0
  454. package/web-shell/assets/stateDiagram-v2-BHNVJYJU-DgReoybQ.js +1 -0
  455. package/web-shell/assets/stylus-BeQkCIfX.js +1 -0
  456. package/web-shell/assets/svelte-MSaWC3Je.js +1 -0
  457. package/web-shell/assets/swift-BSxZ-RaX.js +1 -0
  458. package/web-shell/assets/synthwave-84-CbfX1IO0.js +1 -0
  459. package/web-shell/assets/system-verilog-C7L56vO4.js +1 -0
  460. package/web-shell/assets/systemd-CUnW07Te.js +1 -0
  461. package/web-shell/assets/talonscript-C1XDQQGZ.js +1 -0
  462. package/web-shell/assets/tasl-CQjiPCtT.js +1 -0
  463. package/web-shell/assets/tcl-DQ1-QYvQ.js +1 -0
  464. package/web-shell/assets/templ-dwX3ZSMB.js +1 -0
  465. package/web-shell/assets/terraform-BbSNqyBO.js +1 -0
  466. package/web-shell/assets/tex-rYs2v40G.js +1 -0
  467. package/web-shell/assets/timeline-definition-PNZ67QCA-BhCBkq8k.js +120 -0
  468. package/web-shell/assets/tokyo-night-DBQeEorK.js +1 -0
  469. package/web-shell/assets/toml-CB2ApiWb.js +1 -0
  470. package/web-shell/assets/ts-tags-CipyTH0X.js +1 -0
  471. package/web-shell/assets/tsv-B_m7g4N7.js +1 -0
  472. package/web-shell/assets/tsx-B6W0miNI.js +1 -0
  473. package/web-shell/assets/turtle-BMR_PYu6.js +1 -0
  474. package/web-shell/assets/twig-NC5TFiHP.js +1 -0
  475. package/web-shell/assets/typescript-Dj6nwHGl.js +1 -0
  476. package/web-shell/assets/typespec-BpWG_bgh.js +1 -0
  477. package/web-shell/assets/typst-BVUVsWT6.js +1 -0
  478. package/web-shell/assets/v-CAQ2eGtk.js +1 -0
  479. package/web-shell/assets/vala-BFOHcciG.js +1 -0
  480. package/web-shell/assets/vb-CdO5JTpU.js +1 -0
  481. package/web-shell/assets/vennDiagram-CIIHVFJN-DPPFWp_y.js +34 -0
  482. package/web-shell/assets/verilog-CJaU5se_.js +1 -0
  483. package/web-shell/assets/vesper-BEBZ7ncR.js +1 -0
  484. package/web-shell/assets/vhdl-DYoNaHQp.js +1 -0
  485. package/web-shell/assets/viml-m4uW47V2.js +1 -0
  486. package/web-shell/assets/vitesse-black-Bkuqu6BP.js +1 -0
  487. package/web-shell/assets/vitesse-dark-D0r3Knsf.js +1 -0
  488. package/web-shell/assets/vitesse-light-CVO1_9PV.js +1 -0
  489. package/web-shell/assets/vue-BuYVFjOK.js +1 -0
  490. package/web-shell/assets/vue-html-xdeiXROB.js +1 -0
  491. package/web-shell/assets/vyper-nyqBNV6O.js +1 -0
  492. package/web-shell/assets/wardley-L42UT6IY-CcOUIgXY.js +173 -0
  493. package/web-shell/assets/wardleyDiagram-YWT4CUSO-p7oR5X7r.js +78 -0
  494. package/web-shell/assets/wasm-C6j12Q_x.js +1 -0
  495. package/web-shell/assets/wasm-CG6Dc4jp.js +1 -0
  496. package/web-shell/assets/wenyan-7A4Fjokl.js +1 -0
  497. package/web-shell/assets/wgsl-CB0Krxn9.js +1 -0
  498. package/web-shell/assets/wikitext-DCE3LsBG.js +1 -0
  499. package/web-shell/assets/wolfram-C3FkfJm5.js +1 -0
  500. package/web-shell/assets/xml-e3z08dGr.js +1 -0
  501. package/web-shell/assets/xsl-Dd0NUgwM.js +1 -0
  502. package/web-shell/assets/xychartDiagram-2RQKCTM6-Dfr7-SEy.js +7 -0
  503. package/web-shell/assets/yaml-CVw76BM1.js +1 -0
  504. package/web-shell/assets/zenscript-HnGAYVZD.js +1 -0
  505. package/web-shell/assets/zig-BVz_zdnA.js +1 -0
  506. package/web-shell/index.html +23 -0
  507. package/chunks/chunk-C64WAJOC.js +0 -117
  508. package/chunks/contextCommand-WP7BU7IY.js +0 -53
@@ -18,24 +18,28 @@ import {
18
18
  DEFAULT_QWEN_MODEL,
19
19
  MAINLINE_CODER_MODEL
20
20
  } from "./chunk-OFEVLU4C.js";
21
+ import {
22
+ Mutex
23
+ } from "./chunk-OMX7CUOE.js";
21
24
  import {
22
25
  isAnyAutoMemPath
23
- } from "./chunk-IQHSD7K5.js";
26
+ } from "./chunk-FPZF3BNV.js";
24
27
  import {
25
28
  InstallationManager
26
- } from "./chunk-LYRSMKLS.js";
29
+ } from "./chunk-VWPDSQZY.js";
27
30
  import {
28
31
  STRUCTURED_OUTPUT_REDACTED_ARGS
29
- } from "./chunk-RTTAC5VW.js";
32
+ } from "./chunk-AQDPHFDZ.js";
30
33
  import {
31
34
  BaseDeclarativeTool,
32
35
  BaseToolInvocation,
33
36
  ToolDisplayNames,
34
37
  ToolNames
35
- } from "./chunk-ZNUMXPNK.js";
38
+ } from "./chunk-JJHY7NAD.js";
36
39
  import {
37
- atomicWriteFile
38
- } from "./chunk-LXYWINWF.js";
40
+ atomicWriteFile,
41
+ atomicWriteFileSync
42
+ } from "./chunk-N5QHMPZU.js";
39
43
  import {
40
44
  DEFAULT_OPENAI_BASE_URL,
41
45
  convertSchema,
@@ -43,7 +47,7 @@ import {
43
47
  runtimeDiagnostics,
44
48
  safeJsonParse,
45
49
  tokenLimit
46
- } from "./chunk-LYSND7KR.js";
50
+ } from "./chunk-PTGKSUUJ.js";
47
51
  import {
48
52
  FinishReason,
49
53
  GenerateContentResponse
@@ -58,6 +62,7 @@ import {
58
62
  getErrorMessage,
59
63
  getErrorStatus,
60
64
  getErrorType,
65
+ isAbortError,
61
66
  isNodeError,
62
67
  isSubpaths,
63
68
  makeRelative,
@@ -65,7 +70,7 @@ import {
65
70
  setShellTracePropagation,
66
71
  shortenPath,
67
72
  unescapePath
68
- } from "./chunk-HA2UEYZP.js";
73
+ } from "./chunk-IKOWINH4.js";
69
74
  import {
70
75
  require_dist
71
76
  } from "./chunk-ZERZSAZL.js";
@@ -9473,10 +9478,10 @@ var require_lib2 = __commonJS({
9473
9478
  exports.analyse = analyse;
9474
9479
  var detectFile = /* @__PURE__ */ __name((filepath, opts = {}) => new Promise((resolve2, reject) => {
9475
9480
  let fd;
9476
- const fs8 = (0, node_1.default)();
9481
+ const fs9 = (0, node_1.default)();
9477
9482
  const handler = /* @__PURE__ */ __name((err, buffer) => {
9478
9483
  if (fd) {
9479
- fs8.closeSync(fd);
9484
+ fs9.closeSync(fd);
9480
9485
  }
9481
9486
  if (err) {
9482
9487
  reject(err);
@@ -9485,26 +9490,26 @@ var require_lib2 = __commonJS({
9485
9490
  }
9486
9491
  }, "handler");
9487
9492
  if (opts && opts.sampleSize) {
9488
- fd = fs8.openSync(filepath, "r");
9493
+ fd = fs9.openSync(filepath, "r");
9489
9494
  const sample = Buffer.allocUnsafe(opts.sampleSize);
9490
- fs8.read(fd, sample, 0, opts.sampleSize, opts.offset, (err) => {
9495
+ fs9.read(fd, sample, 0, opts.sampleSize, opts.offset, (err) => {
9491
9496
  handler(err, sample);
9492
9497
  });
9493
9498
  return;
9494
9499
  }
9495
- fs8.readFile(filepath, handler);
9500
+ fs9.readFile(filepath, handler);
9496
9501
  }), "detectFile");
9497
9502
  exports.detectFile = detectFile;
9498
9503
  var detectFileSync = /* @__PURE__ */ __name((filepath, opts = {}) => {
9499
- const fs8 = (0, node_1.default)();
9504
+ const fs9 = (0, node_1.default)();
9500
9505
  if (opts && opts.sampleSize) {
9501
- const fd = fs8.openSync(filepath, "r");
9506
+ const fd = fs9.openSync(filepath, "r");
9502
9507
  const sample = Buffer.allocUnsafe(opts.sampleSize);
9503
- fs8.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
9504
- fs8.closeSync(fd);
9508
+ fs9.readSync(fd, sample, 0, opts.sampleSize, opts.offset);
9509
+ fs9.closeSync(fd);
9505
9510
  return (0, exports.detect)(sample);
9506
9511
  }
9507
- return (0, exports.detect)(fs8.readFileSync(filepath));
9512
+ return (0, exports.detect)(fs9.readFileSync(filepath));
9508
9513
  }, "detectFileSync");
9509
9514
  exports.detectFileSync = detectFileSync;
9510
9515
  exports.default = {
@@ -15731,14 +15736,14 @@ var require_tls_helpers = __commonJS({
15731
15736
  Object.defineProperty(exports, "__esModule", { value: true });
15732
15737
  exports.CIPHER_SUITES = void 0;
15733
15738
  exports.getDefaultRootsData = getDefaultRootsData;
15734
- var fs8 = __require("fs");
15739
+ var fs9 = __require("fs");
15735
15740
  exports.CIPHER_SUITES = process.env.GRPC_SSL_CIPHER_SUITES;
15736
15741
  var DEFAULT_ROOTS_FILE_PATH = process.env.GRPC_DEFAULT_SSL_ROOTS_FILE_PATH;
15737
15742
  var defaultRootsData = null;
15738
15743
  function getDefaultRootsData() {
15739
15744
  if (DEFAULT_ROOTS_FILE_PATH) {
15740
15745
  if (defaultRootsData === null) {
15741
- defaultRootsData = fs8.readFileSync(DEFAULT_ROOTS_FILE_PATH);
15746
+ defaultRootsData = fs9.readFileSync(DEFAULT_ROOTS_FILE_PATH);
15742
15747
  }
15743
15748
  return defaultRootsData;
15744
15749
  }
@@ -15772,19 +15777,19 @@ var require_uri_parser = __commonJS({
15772
15777
  }
15773
15778
  __name(parseUri, "parseUri");
15774
15779
  var NUMBER_REGEX = /^\d+$/;
15775
- function splitHostPort(path8) {
15776
- if (path8.startsWith("[")) {
15777
- const hostEnd = path8.indexOf("]");
15780
+ function splitHostPort(path11) {
15781
+ if (path11.startsWith("[")) {
15782
+ const hostEnd = path11.indexOf("]");
15778
15783
  if (hostEnd === -1) {
15779
15784
  return null;
15780
15785
  }
15781
- const host = path8.substring(1, hostEnd);
15786
+ const host = path11.substring(1, hostEnd);
15782
15787
  if (host.indexOf(":") === -1) {
15783
15788
  return null;
15784
15789
  }
15785
- if (path8.length > hostEnd + 1) {
15786
- if (path8[hostEnd + 1] === ":") {
15787
- const portString = path8.substring(hostEnd + 2);
15790
+ if (path11.length > hostEnd + 1) {
15791
+ if (path11[hostEnd + 1] === ":") {
15792
+ const portString = path11.substring(hostEnd + 2);
15788
15793
  if (NUMBER_REGEX.test(portString)) {
15789
15794
  return {
15790
15795
  host,
@@ -15802,7 +15807,7 @@ var require_uri_parser = __commonJS({
15802
15807
  };
15803
15808
  }
15804
15809
  } else {
15805
- const splitPath = path8.split(":");
15810
+ const splitPath = path11.split(":");
15806
15811
  if (splitPath.length === 2) {
15807
15812
  if (NUMBER_REGEX.test(splitPath[1])) {
15808
15813
  return {
@@ -15814,7 +15819,7 @@ var require_uri_parser = __commonJS({
15814
15819
  }
15815
15820
  } else {
15816
15821
  return {
15817
- host: path8
15822
+ host: path11
15818
15823
  };
15819
15824
  }
15820
15825
  }
@@ -18933,14 +18938,14 @@ var require_client_interceptors = __commonJS({
18933
18938
  }
18934
18939
  };
18935
18940
  exports.InterceptingCall = InterceptingCall;
18936
- function getCall(channel, path8, options) {
18941
+ function getCall(channel, path11, options) {
18937
18942
  var _a, _b;
18938
18943
  const deadline = (_a = options.deadline) !== null && _a !== void 0 ? _a : Infinity;
18939
18944
  const host = options.host;
18940
18945
  const parent = (_b = options.parent) !== null && _b !== void 0 ? _b : null;
18941
18946
  const propagateFlags = options.propagate_flags;
18942
18947
  const credentials = options.credentials;
18943
- const call = channel.createCall(path8, deadline, host, parent, propagateFlags);
18948
+ const call = channel.createCall(path11, deadline, host, parent, propagateFlags);
18944
18949
  if (credentials) {
18945
18950
  call.setCredentials(credentials);
18946
18951
  }
@@ -19531,9 +19536,9 @@ var require_make_client = __commonJS({
19531
19536
  return ServiceClientImpl;
19532
19537
  }
19533
19538
  __name(makeClientConstructor, "makeClientConstructor");
19534
- function partial(fn, path8, serialize, deserialize) {
19539
+ function partial(fn, path11, serialize, deserialize) {
19535
19540
  return function(...args) {
19536
- return fn.call(this, path8, serialize, deserialize, ...args);
19541
+ return fn.call(this, path11, serialize, deserialize, ...args);
19537
19542
  };
19538
19543
  }
19539
19544
  __name(partial, "partial");
@@ -20050,17 +20055,17 @@ var require_fs = __commonJS({
20050
20055
  "node_modules/@protobufjs/fetch/util/fs.js"(exports, module) {
20051
20056
  "use strict";
20052
20057
  init_esbuild_shims();
20053
- var fs8 = null;
20058
+ var fs9 = null;
20054
20059
  try {
20055
- fs8 = __require(
20060
+ fs9 = __require(
20056
20061
  /* webpackIgnore: true */
20057
20062
  "fs"
20058
20063
  );
20059
- if (!fs8 || !fs8.readFile || !fs8.readFileSync)
20060
- fs8 = null;
20064
+ if (!fs9 || !fs9.readFile || !fs9.readFileSync)
20065
+ fs9 = null;
20061
20066
  } catch (e) {
20062
20067
  }
20063
- module.exports = fs8;
20068
+ module.exports = fs9;
20064
20069
  }
20065
20070
  });
20066
20071
 
@@ -20071,7 +20076,7 @@ var require_fetch = __commonJS({
20071
20076
  init_esbuild_shims();
20072
20077
  module.exports = fetch;
20073
20078
  var asPromise = require_aspromise();
20074
- var fs8 = require_fs();
20079
+ var fs9 = require_fs();
20075
20080
  function fetch(filename, options, callback) {
20076
20081
  if (typeof options === "function") {
20077
20082
  callback = options;
@@ -20080,8 +20085,8 @@ var require_fetch = __commonJS({
20080
20085
  options = {};
20081
20086
  if (!callback)
20082
20087
  return asPromise(fetch, this, filename, options);
20083
- if (!options.xhr && fs8 && fs8.readFile)
20084
- return fs8.readFile(filename, /* @__PURE__ */ __name(function fetchReadFileCallback(err, contents) {
20088
+ if (!options.xhr && fs9 && fs9.readFile)
20089
+ return fs9.readFile(filename, /* @__PURE__ */ __name(function fetchReadFileCallback(err, contents) {
20085
20090
  return err && typeof XMLHttpRequest !== "undefined" ? fetch.xhr(filename, options, callback) : err ? callback(err) : callback(null, options.binary ? contents : contents.toString("utf8"));
20086
20091
  }, "fetchReadFileCallback"));
20087
20092
  return fetch.xhr(filename, options, callback);
@@ -20121,15 +20126,15 @@ var require_path = __commonJS({
20121
20126
  "node_modules/@protobufjs/path/index.js"(exports) {
20122
20127
  "use strict";
20123
20128
  init_esbuild_shims();
20124
- var path8 = exports;
20129
+ var path11 = exports;
20125
20130
  var isAbsolute3 = (
20126
20131
  /**
20127
20132
  * Tests if the specified path is absolute.
20128
20133
  * @param {string} path Path to test
20129
20134
  * @returns {boolean} `true` if path is absolute
20130
20135
  */
20131
- path8.isAbsolute = /* @__PURE__ */ __name(function isAbsolute4(path9) {
20132
- return /^(?:\/|\w+:)/.test(path9);
20136
+ path11.isAbsolute = /* @__PURE__ */ __name(function isAbsolute4(path12) {
20137
+ return /^(?:\/|\w+:)/.test(path12);
20133
20138
  }, "isAbsolute")
20134
20139
  );
20135
20140
  var normalize3 = (
@@ -20138,9 +20143,9 @@ var require_path = __commonJS({
20138
20143
  * @param {string} path Path to normalize
20139
20144
  * @returns {string} Normalized path
20140
20145
  */
20141
- path8.normalize = /* @__PURE__ */ __name(function normalize4(path9) {
20142
- path9 = path9.replace(/\\/g, "/").replace(/\/{2,}/g, "/");
20143
- var parts = path9.split("/"), absolute = isAbsolute3(path9), prefix = "";
20146
+ path11.normalize = /* @__PURE__ */ __name(function normalize4(path12) {
20147
+ path12 = path12.replace(/\\/g, "/").replace(/\/{2,}/g, "/");
20148
+ var parts = path12.split("/"), absolute = isAbsolute3(path12), prefix = "";
20144
20149
  if (absolute)
20145
20150
  prefix = parts.shift() + "/";
20146
20151
  for (var i = 0; i < parts.length; ) {
@@ -20159,7 +20164,7 @@ var require_path = __commonJS({
20159
20164
  return prefix + parts.join("/");
20160
20165
  }, "normalize")
20161
20166
  );
20162
- path8.resolve = /* @__PURE__ */ __name(function resolve2(originPath, includePath, alreadyNormalized) {
20167
+ path11.resolve = /* @__PURE__ */ __name(function resolve2(originPath, includePath, alreadyNormalized) {
20163
20168
  if (!alreadyNormalized)
20164
20169
  includePath = normalize3(includePath);
20165
20170
  if (isAbsolute3(includePath))
@@ -20188,17 +20193,17 @@ var require_fs2 = __commonJS({
20188
20193
  "node_modules/protobufjs/src/util/fs.js"(exports, module) {
20189
20194
  "use strict";
20190
20195
  init_esbuild_shims();
20191
- var fs8 = null;
20196
+ var fs9 = null;
20192
20197
  try {
20193
- fs8 = __require(
20198
+ fs9 = __require(
20194
20199
  /* webpackIgnore: true */
20195
20200
  "fs"
20196
20201
  );
20197
- if (!fs8 || !fs8.readFile || !fs8.readFileSync)
20198
- fs8 = null;
20202
+ if (!fs9 || !fs9.readFile || !fs9.readFileSync)
20203
+ fs9 = null;
20199
20204
  } catch (e) {
20200
20205
  }
20201
- module.exports = fs8;
20206
+ module.exports = fs9;
20202
20207
  }
20203
20208
  });
20204
20209
 
@@ -20349,18 +20354,18 @@ var require_namespace = __commonJS({
20349
20354
  object.onRemove(this);
20350
20355
  return clearCache(this);
20351
20356
  }, "remove");
20352
- Namespace.prototype.define = /* @__PURE__ */ __name(function define(path8, json) {
20353
- if (util.isString(path8))
20354
- path8 = path8.split(".");
20355
- else if (!Array.isArray(path8))
20357
+ Namespace.prototype.define = /* @__PURE__ */ __name(function define(path11, json) {
20358
+ if (util.isString(path11))
20359
+ path11 = path11.split(".");
20360
+ else if (!Array.isArray(path11))
20356
20361
  throw TypeError("illegal path");
20357
- if (path8 && path8.length && path8[0] === "")
20362
+ if (path11 && path11.length && path11[0] === "")
20358
20363
  throw Error("path must be relative");
20359
- if (path8.length > util.recursionLimit)
20364
+ if (path11.length > util.recursionLimit)
20360
20365
  throw Error("max depth exceeded");
20361
20366
  var ptr = this;
20362
- while (path8.length > 0) {
20363
- var part = path8.shift();
20367
+ while (path11.length > 0) {
20368
+ var part = path11.shift();
20364
20369
  if (ptr.nested && ptr.nested[part]) {
20365
20370
  ptr = ptr.nested[part];
20366
20371
  if (!(ptr instanceof Namespace))
@@ -20395,26 +20400,26 @@ var require_namespace = __commonJS({
20395
20400
  });
20396
20401
  return this;
20397
20402
  }, "_resolveFeaturesRecursive");
20398
- Namespace.prototype.lookup = /* @__PURE__ */ __name(function lookup(path8, filterTypes, parentAlreadyChecked) {
20403
+ Namespace.prototype.lookup = /* @__PURE__ */ __name(function lookup(path11, filterTypes, parentAlreadyChecked) {
20399
20404
  if (typeof filterTypes === "boolean") {
20400
20405
  parentAlreadyChecked = filterTypes;
20401
20406
  filterTypes = void 0;
20402
20407
  } else if (filterTypes && !Array.isArray(filterTypes))
20403
20408
  filterTypes = [filterTypes];
20404
- if (util.isString(path8) && path8.length) {
20405
- if (path8 === ".")
20409
+ if (util.isString(path11) && path11.length) {
20410
+ if (path11 === ".")
20406
20411
  return this.root;
20407
- path8 = path8.split(".");
20408
- } else if (!path8.length)
20412
+ path11 = path11.split(".");
20413
+ } else if (!path11.length)
20409
20414
  return this;
20410
- var flatPath = path8.join(".");
20411
- if (path8[0] === "")
20412
- return this.root.lookup(path8.slice(1), filterTypes);
20415
+ var flatPath = path11.join(".");
20416
+ if (path11[0] === "")
20417
+ return this.root.lookup(path11.slice(1), filterTypes);
20413
20418
  var found = this.root._fullyQualifiedObjects && this.root._fullyQualifiedObjects["." + flatPath];
20414
20419
  if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {
20415
20420
  return found;
20416
20421
  }
20417
- found = this._lookupImpl(path8, flatPath);
20422
+ found = this._lookupImpl(path11, flatPath);
20418
20423
  if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {
20419
20424
  return found;
20420
20425
  }
@@ -20422,7 +20427,7 @@ var require_namespace = __commonJS({
20422
20427
  return null;
20423
20428
  var current = this;
20424
20429
  while (current.parent) {
20425
- found = current.parent._lookupImpl(path8, flatPath);
20430
+ found = current.parent._lookupImpl(path11, flatPath);
20426
20431
  if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {
20427
20432
  return found;
20428
20433
  }
@@ -20430,22 +20435,22 @@ var require_namespace = __commonJS({
20430
20435
  }
20431
20436
  return null;
20432
20437
  }, "lookup");
20433
- Namespace.prototype._lookupImpl = /* @__PURE__ */ __name(function lookup(path8, flatPath) {
20438
+ Namespace.prototype._lookupImpl = /* @__PURE__ */ __name(function lookup(path11, flatPath) {
20434
20439
  if (Object.prototype.hasOwnProperty.call(this._lookupCache, flatPath)) {
20435
20440
  return this._lookupCache[flatPath];
20436
20441
  }
20437
- var found = this.get(path8[0]);
20442
+ var found = this.get(path11[0]);
20438
20443
  var exact = null;
20439
20444
  if (found) {
20440
- if (path8.length === 1) {
20445
+ if (path11.length === 1) {
20441
20446
  exact = found;
20442
20447
  } else if (found instanceof Namespace) {
20443
- path8 = path8.slice(1);
20444
- exact = found._lookupImpl(path8, path8.join("."));
20448
+ path11 = path11.slice(1);
20449
+ exact = found._lookupImpl(path11, path11.join("."));
20445
20450
  }
20446
20451
  } else {
20447
20452
  for (var i = 0; i < this.nestedArray.length; ++i)
20448
- if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i]._lookupImpl(path8, flatPath))) {
20453
+ if (this._nestedArray[i] instanceof Namespace && (found = this._nestedArray[i]._lookupImpl(path11, flatPath))) {
20449
20454
  exact = found;
20450
20455
  break;
20451
20456
  }
@@ -20453,28 +20458,28 @@ var require_namespace = __commonJS({
20453
20458
  this._lookupCache[flatPath] = exact;
20454
20459
  return exact;
20455
20460
  }, "lookup");
20456
- Namespace.prototype.lookupType = /* @__PURE__ */ __name(function lookupType(path8) {
20457
- var found = this.lookup(path8, [Type]);
20461
+ Namespace.prototype.lookupType = /* @__PURE__ */ __name(function lookupType(path11) {
20462
+ var found = this.lookup(path11, [Type]);
20458
20463
  if (!found)
20459
- throw Error("no such type: " + path8);
20464
+ throw Error("no such type: " + path11);
20460
20465
  return found;
20461
20466
  }, "lookupType");
20462
- Namespace.prototype.lookupEnum = /* @__PURE__ */ __name(function lookupEnum(path8) {
20463
- var found = this.lookup(path8, [Enum]);
20467
+ Namespace.prototype.lookupEnum = /* @__PURE__ */ __name(function lookupEnum(path11) {
20468
+ var found = this.lookup(path11, [Enum]);
20464
20469
  if (!found)
20465
- throw Error("no such Enum '" + path8 + "' in " + this);
20470
+ throw Error("no such Enum '" + path11 + "' in " + this);
20466
20471
  return found;
20467
20472
  }, "lookupEnum");
20468
- Namespace.prototype.lookupTypeOrEnum = /* @__PURE__ */ __name(function lookupTypeOrEnum(path8) {
20469
- var found = this.lookup(path8, [Type, Enum]);
20473
+ Namespace.prototype.lookupTypeOrEnum = /* @__PURE__ */ __name(function lookupTypeOrEnum(path11) {
20474
+ var found = this.lookup(path11, [Type, Enum]);
20470
20475
  if (!found)
20471
- throw Error("no such Type or Enum '" + path8 + "' in " + this);
20476
+ throw Error("no such Type or Enum '" + path11 + "' in " + this);
20472
20477
  return found;
20473
20478
  }, "lookupTypeOrEnum");
20474
- Namespace.prototype.lookupService = /* @__PURE__ */ __name(function lookupService(path8) {
20475
- var found = this.lookup(path8, [Service]);
20479
+ Namespace.prototype.lookupService = /* @__PURE__ */ __name(function lookupService(path11) {
20480
+ var found = this.lookup(path11, [Service]);
20476
20481
  if (!found)
20477
- throw Error("no such Service '" + path8 + "' in " + this);
20482
+ throw Error("no such Service '" + path11 + "' in " + this);
20478
20483
  return found;
20479
20484
  }, "lookupService");
20480
20485
  Namespace._configure = function(Type_, Service_, Enum_) {
@@ -21917,13 +21922,13 @@ var require_util = __commonJS({
21917
21922
  Object.defineProperty(object, "$type", { value: enm, enumerable: false });
21918
21923
  return enm;
21919
21924
  }, "decorateEnum");
21920
- util.setProperty = /* @__PURE__ */ __name(function setProperty(dst, path8, value, ifNotSet) {
21921
- function setProp(dst2, path9, value2) {
21922
- var part = path9.shift();
21925
+ util.setProperty = /* @__PURE__ */ __name(function setProperty(dst, path11, value, ifNotSet) {
21926
+ function setProp(dst2, path12, value2) {
21927
+ var part = path12.shift();
21923
21928
  if (util.isUnsafeProperty(part))
21924
21929
  return dst2;
21925
- if (path9.length > 0) {
21926
- dst2[part] = setProp(dst2[part] || {}, path9, value2);
21930
+ if (path12.length > 0) {
21931
+ dst2[part] = setProp(dst2[part] || {}, path12, value2);
21927
21932
  } else {
21928
21933
  var prevValue = dst2[part];
21929
21934
  if (prevValue && ifNotSet)
@@ -21937,12 +21942,12 @@ var require_util = __commonJS({
21937
21942
  __name(setProp, "setProp");
21938
21943
  if (typeof dst !== "object")
21939
21944
  throw TypeError("dst must be an object");
21940
- if (!path8)
21945
+ if (!path11)
21941
21946
  throw TypeError("path must be specified");
21942
- path8 = path8.split(".");
21943
- if (path8.length > util.recursionLimit)
21947
+ path11 = path11.split(".");
21948
+ if (path11.length > util.recursionLimit)
21944
21949
  throw Error("max depth exceeded");
21945
- return setProp(dst, path8, value);
21950
+ return setProp(dst, path11, value);
21946
21951
  }, "setProperty");
21947
21952
  Object.defineProperty(util, "decorateRoot", {
21948
21953
  get: /* @__PURE__ */ __name(function() {
@@ -22497,12 +22502,12 @@ var require_object = __commonJS({
22497
22502
  */
22498
22503
  fullName: {
22499
22504
  get: /* @__PURE__ */ __name(function() {
22500
- var path8 = [this.name], ptr = this.parent;
22505
+ var path11 = [this.name], ptr = this.parent;
22501
22506
  while (ptr) {
22502
- path8.unshift(ptr.name);
22507
+ path11.unshift(ptr.name);
22503
22508
  ptr = ptr.parent;
22504
22509
  }
22505
- return path8.join(".");
22510
+ return path11.join(".");
22506
22511
  }, "get")
22507
22512
  }
22508
22513
  });
@@ -26606,19 +26611,19 @@ var require_util2 = __commonJS({
26606
26611
  init_esbuild_shims();
26607
26612
  Object.defineProperty(exports, "__esModule", { value: true });
26608
26613
  exports.addCommonProtos = exports.loadProtosWithOptionsSync = exports.loadProtosWithOptions = void 0;
26609
- var fs8 = __require("fs");
26610
- var path8 = __require("path");
26614
+ var fs9 = __require("fs");
26615
+ var path11 = __require("path");
26611
26616
  var Protobuf = require_protobufjs();
26612
26617
  function addIncludePathResolver(root, includePaths) {
26613
26618
  const originalResolvePath = root.resolvePath;
26614
26619
  root.resolvePath = (origin, target) => {
26615
- if (path8.isAbsolute(target)) {
26620
+ if (path11.isAbsolute(target)) {
26616
26621
  return target;
26617
26622
  }
26618
26623
  for (const directory of includePaths) {
26619
- const fullPath = path8.join(directory, target);
26624
+ const fullPath = path11.join(directory, target);
26620
26625
  try {
26621
- fs8.accessSync(fullPath, fs8.constants.R_OK);
26626
+ fs9.accessSync(fullPath, fs9.constants.R_OK);
26622
26627
  return fullPath;
26623
26628
  } catch (err) {
26624
26629
  continue;
@@ -31818,9 +31823,9 @@ var require_server_call = __commonJS({
31818
31823
  static {
31819
31824
  __name(this, "ServerUnaryCallImpl");
31820
31825
  }
31821
- constructor(path8, call, metadata, request4) {
31826
+ constructor(path11, call, metadata, request4) {
31822
31827
  super();
31823
- this.path = path8;
31828
+ this.path = path11;
31824
31829
  this.call = call;
31825
31830
  this.metadata = metadata;
31826
31831
  this.request = request4;
@@ -31847,9 +31852,9 @@ var require_server_call = __commonJS({
31847
31852
  static {
31848
31853
  __name(this, "ServerReadableStreamImpl");
31849
31854
  }
31850
- constructor(path8, call, metadata) {
31855
+ constructor(path11, call, metadata) {
31851
31856
  super({ objectMode: true });
31852
- this.path = path8;
31857
+ this.path = path11;
31853
31858
  this.call = call;
31854
31859
  this.metadata = metadata;
31855
31860
  this.cancelled = false;
@@ -31878,9 +31883,9 @@ var require_server_call = __commonJS({
31878
31883
  static {
31879
31884
  __name(this, "ServerWritableStreamImpl");
31880
31885
  }
31881
- constructor(path8, call, metadata, request4) {
31886
+ constructor(path11, call, metadata, request4) {
31882
31887
  super({ objectMode: true });
31883
- this.path = path8;
31888
+ this.path = path11;
31884
31889
  this.call = call;
31885
31890
  this.metadata = metadata;
31886
31891
  this.request = request4;
@@ -31931,9 +31936,9 @@ var require_server_call = __commonJS({
31931
31936
  static {
31932
31937
  __name(this, "ServerDuplexStreamImpl");
31933
31938
  }
31934
- constructor(path8, call, metadata) {
31939
+ constructor(path11, call, metadata) {
31935
31940
  super({ objectMode: true });
31936
- this.path = path8;
31941
+ this.path = path11;
31937
31942
  this.call = call;
31938
31943
  this.metadata = metadata;
31939
31944
  this.pendingStatus = {
@@ -33851,11 +33856,11 @@ var require_server = __commonJS({
33851
33856
  }
33852
33857
  return true;
33853
33858
  }
33854
- _retrieveHandler(path8) {
33855
- serverCallTrace("Received call to method " + path8 + " at address " + this.serverAddressString);
33856
- const handler = this.handlers.get(path8);
33859
+ _retrieveHandler(path11) {
33860
+ serverCallTrace("Received call to method " + path11 + " at address " + this.serverAddressString);
33861
+ const handler = this.handlers.get(path11);
33857
33862
  if (handler === void 0) {
33858
- serverCallTrace("No handler registered for method " + path8 + ". Sending UNIMPLEMENTED status.");
33863
+ serverCallTrace("No handler registered for method " + path11 + ". Sending UNIMPLEMENTED status.");
33859
33864
  return null;
33860
33865
  }
33861
33866
  return handler;
@@ -33877,10 +33882,10 @@ var require_server = __commonJS({
33877
33882
  channelzSessionInfo === null || channelzSessionInfo === void 0 ? void 0 : channelzSessionInfo.streamTracker.addCallFailed();
33878
33883
  return;
33879
33884
  }
33880
- const path8 = headers[HTTP2_HEADER_PATH];
33881
- const handler = this._retrieveHandler(path8);
33885
+ const path11 = headers[HTTP2_HEADER_PATH];
33886
+ const handler = this._retrieveHandler(path11);
33882
33887
  if (!handler) {
33883
- this._respondWithError(getUnimplementedStatusResponse(path8), stream, channelzSessionInfo);
33888
+ this._respondWithError(getUnimplementedStatusResponse(path11), stream, channelzSessionInfo);
33884
33889
  return;
33885
33890
  }
33886
33891
  const callEventTracker = {
@@ -33928,10 +33933,10 @@ var require_server = __commonJS({
33928
33933
  if (this._verifyContentType(stream, headers) !== true) {
33929
33934
  return;
33930
33935
  }
33931
- const path8 = headers[HTTP2_HEADER_PATH];
33932
- const handler = this._retrieveHandler(path8);
33936
+ const path11 = headers[HTTP2_HEADER_PATH];
33937
+ const handler = this._retrieveHandler(path11);
33933
33938
  if (!handler) {
33934
- this._respondWithError(getUnimplementedStatusResponse(path8), stream, null);
33939
+ this._respondWithError(getUnimplementedStatusResponse(path11), stream, null);
33935
33940
  return;
33936
33941
  }
33937
33942
  const call = (0, server_interceptors_1.getServerInterceptingCall)([...extraInterceptors, ...this.interceptors], stream, headers, null, handler, this.options);
@@ -35006,7 +35011,7 @@ var require_certificate_provider = __commonJS({
35006
35011
  init_esbuild_shims();
35007
35012
  Object.defineProperty(exports, "__esModule", { value: true });
35008
35013
  exports.FileWatcherCertificateProvider = void 0;
35009
- var fs8 = __require("fs");
35014
+ var fs9 = __require("fs");
35010
35015
  var logging = require_logging();
35011
35016
  var constants_1 = require_constants2();
35012
35017
  var util_1 = __require("util");
@@ -35015,7 +35020,7 @@ var require_certificate_provider = __commonJS({
35015
35020
  logging.trace(constants_1.LogVerbosity.DEBUG, TRACER_NAME, text);
35016
35021
  }
35017
35022
  __name(trace2, "trace");
35018
- var readFilePromise = (0, util_1.promisify)(fs8.readFile);
35023
+ var readFilePromise = (0, util_1.promisify)(fs9.readFile);
35019
35024
  var FileWatcherCertificateProvider = class {
35020
35025
  static {
35021
35026
  __name(this, "FileWatcherCertificateProvider");
@@ -35267,13 +35272,13 @@ var require_resolver_uds = __commonJS({
35267
35272
  this.listener = listener;
35268
35273
  this.hasReturnedResult = false;
35269
35274
  this.endpoints = [];
35270
- let path8;
35275
+ let path11;
35271
35276
  if (target.authority === "") {
35272
- path8 = "/" + target.path;
35277
+ path11 = "/" + target.path;
35273
35278
  } else {
35274
- path8 = target.path;
35279
+ path11 = target.path;
35275
35280
  }
35276
- this.endpoints = [{ addresses: [{ path: path8 }] }];
35281
+ this.endpoints = [{ addresses: [{ path: path11 }] }];
35277
35282
  }
35278
35283
  updateResolution() {
35279
35284
  if (!this.hasReturnedResult) {
@@ -35337,12 +35342,12 @@ var require_resolver_ip = __commonJS({
35337
35342
  return;
35338
35343
  }
35339
35344
  const pathList = target.path.split(",");
35340
- for (const path8 of pathList) {
35341
- const hostPort = (0, uri_parser_1.splitHostPort)(path8);
35345
+ for (const path11 of pathList) {
35346
+ const hostPort = (0, uri_parser_1.splitHostPort)(path11);
35342
35347
  if (hostPort === null) {
35343
35348
  this.error = {
35344
35349
  code: constants_1.Status.UNAVAILABLE,
35345
- details: `Failed to parse ${target.scheme} address ${path8}`,
35350
+ details: `Failed to parse ${target.scheme} address ${path11}`,
35346
35351
  metadata: new metadata_1.Metadata()
35347
35352
  };
35348
35353
  return;
@@ -35350,7 +35355,7 @@ var require_resolver_ip = __commonJS({
35350
35355
  if (target.scheme === IPV4_SCHEME && !(0, net_1.isIPv4)(hostPort.host) || target.scheme === IPV6_SCHEME && !(0, net_1.isIPv6)(hostPort.host)) {
35351
35356
  this.error = {
35352
35357
  code: constants_1.Status.UNAVAILABLE,
35353
- details: `Failed to parse ${target.scheme} address ${path8}`,
35358
+ details: `Failed to parse ${target.scheme} address ${path11}`,
35354
35359
  metadata: new metadata_1.Metadata()
35355
35360
  };
35356
35361
  return;
@@ -36258,10 +36263,10 @@ var require_create_service_client_constructor = __commonJS({
36258
36263
  Object.defineProperty(exports, "__esModule", { value: true });
36259
36264
  exports.createServiceClientConstructor = void 0;
36260
36265
  var grpc = require_src6();
36261
- function createServiceClientConstructor(path8, name) {
36266
+ function createServiceClientConstructor(path11, name) {
36262
36267
  const serviceDefinition = {
36263
36268
  export: {
36264
- path: path8,
36269
+ path: path11,
36265
36270
  requestStream: false,
36266
36271
  responseStream: false,
36267
36272
  requestSerialize: /* @__PURE__ */ __name((arg) => {
@@ -36891,7 +36896,7 @@ function appendRootPathToUrlIfNeeded(url) {
36891
36896
  return void 0;
36892
36897
  }
36893
36898
  }
36894
- function appendResourcePathToUrl(url, path8) {
36899
+ function appendResourcePathToUrl(url, path11) {
36895
36900
  try {
36896
36901
  new URL(url);
36897
36902
  } catch {
@@ -36901,11 +36906,11 @@ function appendResourcePathToUrl(url, path8) {
36901
36906
  if (!url.endsWith("/")) {
36902
36907
  url = url + "/";
36903
36908
  }
36904
- url += path8;
36909
+ url += path11;
36905
36910
  try {
36906
36911
  new URL(url);
36907
36912
  } catch {
36908
- diag.warn(`Configuration: Provided URL appended with '${path8}' is not a valid URL, using 'undefined' instead of '${url}'`);
36913
+ diag.warn(`Configuration: Provided URL appended with '${path11}' is not a valid URL, using 'undefined' instead of '${url}'`);
36909
36914
  return void 0;
36910
36915
  }
36911
36916
  return url;
@@ -37014,8 +37019,8 @@ var require_otlp_grpc_env_configuration = __commonJS({
37014
37019
  var core_1 = require_src3();
37015
37020
  var grpc_exporter_transport_1 = require_grpc_exporter_transport();
37016
37021
  var node_http_1 = (init_index_node_http(), __toCommonJS(index_node_http_exports));
37017
- var fs8 = __require("fs");
37018
- var path8 = __require("path");
37022
+ var fs9 = __require("fs");
37023
+ var path11 = __require("path");
37019
37024
  var api_1 = (init_esm(), __toCommonJS(esm_exports));
37020
37025
  function fallbackIfNullishOrBlank(signalSpecific, nonSignalSpecific) {
37021
37026
  if (signalSpecific != null && signalSpecific !== "") {
@@ -37069,7 +37074,7 @@ var require_otlp_grpc_env_configuration = __commonJS({
37069
37074
  const filePath = fallbackIfNullishOrBlank(signalSpecificPath, nonSignalSpecificPath);
37070
37075
  if (filePath != null) {
37071
37076
  try {
37072
- return fs8.readFileSync(path8.resolve(process.cwd(), filePath));
37077
+ return fs9.readFileSync(path11.resolve(process.cwd(), filePath));
37073
37078
  } catch {
37074
37079
  api_1.diag.warn(warningMessage);
37075
37080
  return void 0;
@@ -54609,19 +54614,19 @@ var require_module_details_from_path = __commonJS({
54609
54614
  basedir += segments[i] + sep;
54610
54615
  }
54611
54616
  }
54612
- var path8 = "";
54617
+ var path11 = "";
54613
54618
  var lastSegmentIndex = segments.length - 1;
54614
54619
  for (var i2 = index + offset; i2 <= lastSegmentIndex; i2++) {
54615
54620
  if (i2 === lastSegmentIndex) {
54616
- path8 += segments[i2];
54621
+ path11 += segments[i2];
54617
54622
  } else {
54618
- path8 += segments[i2] + sep;
54623
+ path11 += segments[i2] + sep;
54619
54624
  }
54620
54625
  }
54621
54626
  return {
54622
54627
  name,
54623
54628
  basedir,
54624
- path: path8
54629
+ path: path11
54625
54630
  };
54626
54631
  };
54627
54632
  }
@@ -54733,8 +54738,8 @@ var require_path_parse = __commonJS({
54733
54738
  var require_node_modules_paths = __commonJS({
54734
54739
  "node_modules/resolve/lib/node-modules-paths.js"(exports, module) {
54735
54740
  init_esbuild_shims();
54736
- var path8 = __require("path");
54737
- var parse = path8.parse || require_path_parse();
54741
+ var path11 = __require("path");
54742
+ var parse = path11.parse || require_path_parse();
54738
54743
  var getNodeModulesDirs = /* @__PURE__ */ __name(function getNodeModulesDirs2(absoluteStart, modules) {
54739
54744
  var prefix = "/";
54740
54745
  if (/^([A-Za-z]:)/.test(absoluteStart)) {
@@ -54750,7 +54755,7 @@ var require_node_modules_paths = __commonJS({
54750
54755
  }
54751
54756
  return paths.reduce(function(dirs, aPath) {
54752
54757
  return dirs.concat(modules.map(function(moduleDir) {
54753
- return path8.resolve(prefix, aPath, moduleDir);
54758
+ return path11.resolve(prefix, aPath, moduleDir);
54754
54759
  }));
54755
54760
  }, []);
54756
54761
  }, "getNodeModulesDirs");
@@ -55021,23 +55026,23 @@ var require_is_core_module = __commonJS({
55021
55026
  var require_async = __commonJS({
55022
55027
  "node_modules/resolve/lib/async.js"(exports, module) {
55023
55028
  init_esbuild_shims();
55024
- var fs8 = __require("fs");
55029
+ var fs9 = __require("fs");
55025
55030
  var getHomedir = require_homedir();
55026
- var path8 = __require("path");
55031
+ var path11 = __require("path");
55027
55032
  var caller = require_caller();
55028
55033
  var nodeModulesPaths = require_node_modules_paths();
55029
55034
  var normalizeOptions = require_normalize_options();
55030
55035
  var isCore = require_is_core_module();
55031
- var realpathFS = process.platform !== "win32" && fs8.realpath && typeof fs8.realpath.native === "function" ? fs8.realpath.native : fs8.realpath;
55036
+ var realpathFS = process.platform !== "win32" && fs9.realpath && typeof fs9.realpath.native === "function" ? fs9.realpath.native : fs9.realpath;
55032
55037
  var homedir3 = getHomedir();
55033
55038
  var defaultPaths = /* @__PURE__ */ __name(function() {
55034
55039
  return [
55035
- path8.join(homedir3, ".node_modules"),
55036
- path8.join(homedir3, ".node_libraries")
55040
+ path11.join(homedir3, ".node_modules"),
55041
+ path11.join(homedir3, ".node_libraries")
55037
55042
  ];
55038
55043
  }, "defaultPaths");
55039
55044
  var defaultIsFile = /* @__PURE__ */ __name(function isFile(file, cb) {
55040
- fs8.stat(file, function(err, stat) {
55045
+ fs9.stat(file, function(err, stat) {
55041
55046
  if (!err) {
55042
55047
  return cb(null, stat.isFile() || stat.isFIFO());
55043
55048
  }
@@ -55046,7 +55051,7 @@ var require_async = __commonJS({
55046
55051
  });
55047
55052
  }, "isFile");
55048
55053
  var defaultIsDir = /* @__PURE__ */ __name(function isDirectory(dir, cb) {
55049
- fs8.stat(dir, function(err, stat) {
55054
+ fs9.stat(dir, function(err, stat) {
55050
55055
  if (!err) {
55051
55056
  return cb(null, stat.isDirectory());
55052
55057
  }
@@ -55083,7 +55088,7 @@ var require_async = __commonJS({
55083
55088
  var getPackageCandidates = /* @__PURE__ */ __name(function getPackageCandidates2(x, start, opts) {
55084
55089
  var dirs = nodeModulesPaths(start, opts, x);
55085
55090
  for (var i = 0; i < dirs.length; i++) {
55086
- dirs[i] = path8.join(dirs[i], x);
55091
+ dirs[i] = path11.join(dirs[i], x);
55087
55092
  }
55088
55093
  return dirs;
55089
55094
  }, "getPackageCandidates");
@@ -55103,7 +55108,7 @@ var require_async = __commonJS({
55103
55108
  opts = normalizeOptions(x, opts);
55104
55109
  var isFile = opts.isFile || defaultIsFile;
55105
55110
  var isDirectory = opts.isDirectory || defaultIsDir;
55106
- var readFile = opts.readFile || fs8.readFile;
55111
+ var readFile = opts.readFile || fs9.readFile;
55107
55112
  var realpath = opts.realpath || defaultRealpath;
55108
55113
  var readPackage = opts.readPackage || defaultReadPackage;
55109
55114
  if (opts.readFile && opts.readPackage) {
@@ -55115,10 +55120,10 @@ var require_async = __commonJS({
55115
55120
  var packageIterator = opts.packageIterator;
55116
55121
  var extensions = opts.extensions || [".js"];
55117
55122
  var includeCoreModules = opts.includeCoreModules !== false;
55118
- var basedir = opts.basedir || path8.dirname(caller());
55123
+ var basedir = opts.basedir || path11.dirname(caller());
55119
55124
  var parent = opts.filename || basedir;
55120
55125
  opts.paths = opts.paths || defaultPaths();
55121
- var absoluteStart = path8.resolve(basedir);
55126
+ var absoluteStart = path11.resolve(basedir);
55122
55127
  maybeRealpath(
55123
55128
  realpath,
55124
55129
  absoluteStart,
@@ -55131,7 +55136,7 @@ var require_async = __commonJS({
55131
55136
  var res;
55132
55137
  function init(basedir2) {
55133
55138
  if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x)) {
55134
- res = path8.resolve(basedir2, x);
55139
+ res = path11.resolve(basedir2, x);
55135
55140
  if (x === "." || x === ".." || x.slice(-1) === "/") res += "/";
55136
55141
  if (/\/$/.test(x) && res === basedir2) {
55137
55142
  loadAsDirectory(res, opts.package, onfile);
@@ -55191,17 +55196,17 @@ var require_async = __commonJS({
55191
55196
  var file = x3 + exts2[0];
55192
55197
  var pkg = loadPackage;
55193
55198
  if (pkg) onpkg(null, pkg);
55194
- else loadpkg(path8.dirname(file), onpkg);
55199
+ else loadpkg(path11.dirname(file), onpkg);
55195
55200
  function onpkg(err2, pkg_, dir) {
55196
55201
  pkg = pkg_;
55197
55202
  if (err2) return cb2(err2);
55198
55203
  if (dir && pkg && opts.pathFilter) {
55199
- var rfile = path8.relative(dir, file);
55204
+ var rfile = path11.relative(dir, file);
55200
55205
  var rel = rfile.slice(0, rfile.length - exts2[0].length);
55201
55206
  var r = opts.pathFilter(pkg, x3, rel);
55202
55207
  if (r) return load(
55203
55208
  [""].concat(extensions.slice()),
55204
- path8.resolve(dir, r),
55209
+ path11.resolve(dir, r),
55205
55210
  pkg
55206
55211
  );
55207
55212
  }
@@ -55225,10 +55230,10 @@ var require_async = __commonJS({
55225
55230
  }
55226
55231
  if (/[/\\]node_modules[/\\]*$/.test(dir)) return cb2(null);
55227
55232
  maybeRealpath(realpath, dir, opts, function(unwrapErr, pkgdir) {
55228
- if (unwrapErr) return loadpkg(path8.dirname(dir), cb2);
55229
- var pkgfile = path8.join(pkgdir, "package.json");
55233
+ if (unwrapErr) return loadpkg(path11.dirname(dir), cb2);
55234
+ var pkgfile = path11.join(pkgdir, "package.json");
55230
55235
  isFile(pkgfile, function(err2, ex) {
55231
- if (!ex) return loadpkg(path8.dirname(dir), cb2);
55236
+ if (!ex) return loadpkg(path11.dirname(dir), cb2);
55232
55237
  readPackage(readFile, pkgfile, function(err3, pkgParam) {
55233
55238
  if (err3) cb2(err3);
55234
55239
  var pkg = pkgParam;
@@ -55250,10 +55255,10 @@ var require_async = __commonJS({
55250
55255
  }
55251
55256
  maybeRealpath(realpath, x2, opts, function(unwrapErr, pkgdir) {
55252
55257
  if (unwrapErr) return cb2(unwrapErr);
55253
- var pkgfile = path8.join(pkgdir, "package.json");
55258
+ var pkgfile = path11.join(pkgdir, "package.json");
55254
55259
  isFile(pkgfile, function(err2, ex) {
55255
55260
  if (err2) return cb2(err2);
55256
- if (!ex) return loadAsFile(path8.join(x2, "index"), fpkg, cb2);
55261
+ if (!ex) return loadAsFile(path11.join(x2, "index"), fpkg, cb2);
55257
55262
  readPackage(readFile, pkgfile, function(err3, pkgParam) {
55258
55263
  if (err3) return cb2(err3);
55259
55264
  var pkg = pkgParam;
@@ -55269,20 +55274,20 @@ var require_async = __commonJS({
55269
55274
  if (pkg.main === "." || pkg.main === "./") {
55270
55275
  pkg.main = "index";
55271
55276
  }
55272
- loadAsFile(path8.resolve(x2, pkg.main), pkg, function(err4, m, pkg2) {
55277
+ loadAsFile(path11.resolve(x2, pkg.main), pkg, function(err4, m, pkg2) {
55273
55278
  if (err4) return cb2(err4);
55274
55279
  if (m) return cb2(null, m, pkg2);
55275
- if (!pkg2) return loadAsFile(path8.join(x2, "index"), pkg2, cb2);
55276
- var dir = path8.resolve(x2, pkg2.main);
55280
+ if (!pkg2) return loadAsFile(path11.join(x2, "index"), pkg2, cb2);
55281
+ var dir = path11.resolve(x2, pkg2.main);
55277
55282
  loadAsDirectory(dir, pkg2, function(err5, n, pkg3) {
55278
55283
  if (err5) return cb2(err5);
55279
55284
  if (n) return cb2(null, n, pkg3);
55280
- loadAsFile(path8.join(x2, "index"), pkg3, cb2);
55285
+ loadAsFile(path11.join(x2, "index"), pkg3, cb2);
55281
55286
  });
55282
55287
  });
55283
55288
  return;
55284
55289
  }
55285
- loadAsFile(path8.join(x2, "/index"), pkg, cb2);
55290
+ loadAsFile(path11.join(x2, "/index"), pkg, cb2);
55286
55291
  });
55287
55292
  });
55288
55293
  });
@@ -55291,7 +55296,7 @@ var require_async = __commonJS({
55291
55296
  function processDirs(cb2, dirs) {
55292
55297
  if (dirs.length === 0) return cb2(null, void 0);
55293
55298
  var dir = dirs[0];
55294
- isDirectory(path8.dirname(dir), isdir);
55299
+ isDirectory(path11.dirname(dir), isdir);
55295
55300
  function isdir(err2, isdir2) {
55296
55301
  if (err2) return cb2(err2);
55297
55302
  if (!isdir2) return processDirs(cb2, dirs.slice(1));
@@ -55528,23 +55533,23 @@ var require_sync = __commonJS({
55528
55533
  "node_modules/resolve/lib/sync.js"(exports, module) {
55529
55534
  init_esbuild_shims();
55530
55535
  var isCore = require_is_core_module();
55531
- var fs8 = __require("fs");
55532
- var path8 = __require("path");
55536
+ var fs9 = __require("fs");
55537
+ var path11 = __require("path");
55533
55538
  var getHomedir = require_homedir();
55534
55539
  var caller = require_caller();
55535
55540
  var nodeModulesPaths = require_node_modules_paths();
55536
55541
  var normalizeOptions = require_normalize_options();
55537
- var realpathFS = process.platform !== "win32" && fs8.realpathSync && typeof fs8.realpathSync.native === "function" ? fs8.realpathSync.native : fs8.realpathSync;
55542
+ var realpathFS = process.platform !== "win32" && fs9.realpathSync && typeof fs9.realpathSync.native === "function" ? fs9.realpathSync.native : fs9.realpathSync;
55538
55543
  var homedir3 = getHomedir();
55539
55544
  var defaultPaths = /* @__PURE__ */ __name(function() {
55540
55545
  return [
55541
- path8.join(homedir3, ".node_modules"),
55542
- path8.join(homedir3, ".node_libraries")
55546
+ path11.join(homedir3, ".node_modules"),
55547
+ path11.join(homedir3, ".node_libraries")
55543
55548
  ];
55544
55549
  }, "defaultPaths");
55545
55550
  var defaultIsFile = /* @__PURE__ */ __name(function isFile(file) {
55546
55551
  try {
55547
- var stat = fs8.statSync(file, { throwIfNoEntry: false });
55552
+ var stat = fs9.statSync(file, { throwIfNoEntry: false });
55548
55553
  } catch (e) {
55549
55554
  if (e && (e.code === "ENOENT" || e.code === "ENOTDIR")) return false;
55550
55555
  throw e;
@@ -55553,7 +55558,7 @@ var require_sync = __commonJS({
55553
55558
  }, "isFile");
55554
55559
  var defaultIsDir = /* @__PURE__ */ __name(function isDirectory(dir) {
55555
55560
  try {
55556
- var stat = fs8.statSync(dir, { throwIfNoEntry: false });
55561
+ var stat = fs9.statSync(dir, { throwIfNoEntry: false });
55557
55562
  } catch (e) {
55558
55563
  if (e && (e.code === "ENOENT" || e.code === "ENOTDIR")) return false;
55559
55564
  throw e;
@@ -55587,7 +55592,7 @@ var require_sync = __commonJS({
55587
55592
  var getPackageCandidates = /* @__PURE__ */ __name(function getPackageCandidates2(x, start, opts) {
55588
55593
  var dirs = nodeModulesPaths(start, opts, x);
55589
55594
  for (var i = 0; i < dirs.length; i++) {
55590
- dirs[i] = path8.join(dirs[i], x);
55595
+ dirs[i] = path11.join(dirs[i], x);
55591
55596
  }
55592
55597
  return dirs;
55593
55598
  }, "getPackageCandidates");
@@ -55597,7 +55602,7 @@ var require_sync = __commonJS({
55597
55602
  }
55598
55603
  var opts = normalizeOptions(x, options);
55599
55604
  var isFile = opts.isFile || defaultIsFile;
55600
- var readFileSync = opts.readFileSync || fs8.readFileSync;
55605
+ var readFileSync = opts.readFileSync || fs9.readFileSync;
55601
55606
  var isDirectory = opts.isDirectory || defaultIsDir;
55602
55607
  var realpathSync = opts.realpathSync || defaultRealpathSync;
55603
55608
  var readPackageSync = opts.readPackageSync || defaultReadPackageSync;
@@ -55607,12 +55612,12 @@ var require_sync = __commonJS({
55607
55612
  var packageIterator = opts.packageIterator;
55608
55613
  var extensions = opts.extensions || [".js"];
55609
55614
  var includeCoreModules = opts.includeCoreModules !== false;
55610
- var basedir = opts.basedir || path8.dirname(caller());
55615
+ var basedir = opts.basedir || path11.dirname(caller());
55611
55616
  var parent = opts.filename || basedir;
55612
55617
  opts.paths = opts.paths || defaultPaths();
55613
- var absoluteStart = maybeRealpathSync(realpathSync, path8.resolve(basedir), opts);
55618
+ var absoluteStart = maybeRealpathSync(realpathSync, path11.resolve(basedir), opts);
55614
55619
  if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x)) {
55615
- var res = path8.resolve(absoluteStart, x);
55620
+ var res = path11.resolve(absoluteStart, x);
55616
55621
  if (x === "." || x === ".." || x.slice(-1) === "/") res += "/";
55617
55622
  var m = loadAsFileSync(res) || loadAsDirectorySync(res);
55618
55623
  if (m) return maybeRealpathSync(realpathSync, m, opts);
@@ -55626,12 +55631,12 @@ var require_sync = __commonJS({
55626
55631
  err.code = "MODULE_NOT_FOUND";
55627
55632
  throw err;
55628
55633
  function loadAsFileSync(x2) {
55629
- var pkg = loadpkg(path8.dirname(x2));
55634
+ var pkg = loadpkg(path11.dirname(x2));
55630
55635
  if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
55631
- var rfile = path8.relative(pkg.dir, x2);
55636
+ var rfile = path11.relative(pkg.dir, x2);
55632
55637
  var r = opts.pathFilter(pkg.pkg, x2, rfile);
55633
55638
  if (r) {
55634
- x2 = path8.resolve(pkg.dir, r);
55639
+ x2 = path11.resolve(pkg.dir, r);
55635
55640
  }
55636
55641
  }
55637
55642
  if (isFile(x2)) {
@@ -55651,9 +55656,9 @@ var require_sync = __commonJS({
55651
55656
  return;
55652
55657
  }
55653
55658
  if (/[/\\]node_modules[/\\]*$/.test(dir)) return;
55654
- var pkgfile = path8.join(maybeRealpathSync(realpathSync, dir, opts), "package.json");
55659
+ var pkgfile = path11.join(maybeRealpathSync(realpathSync, dir, opts), "package.json");
55655
55660
  if (!isFile(pkgfile)) {
55656
- return loadpkg(path8.dirname(dir));
55661
+ return loadpkg(path11.dirname(dir));
55657
55662
  }
55658
55663
  var pkg = readPackageSync(readFileSync, pkgfile);
55659
55664
  if (pkg && opts.packageFilter) {
@@ -55667,7 +55672,7 @@ var require_sync = __commonJS({
55667
55672
  }
55668
55673
  __name(loadpkg, "loadpkg");
55669
55674
  function loadAsDirectorySync(x2) {
55670
- var pkgfile = path8.join(maybeRealpathSync(realpathSync, x2, opts), "/package.json");
55675
+ var pkgfile = path11.join(maybeRealpathSync(realpathSync, x2, opts), "/package.json");
55671
55676
  if (isFile(pkgfile)) {
55672
55677
  try {
55673
55678
  var pkg = readPackageSync(readFileSync, pkgfile);
@@ -55690,15 +55695,15 @@ var require_sync = __commonJS({
55690
55695
  pkg.main = "index";
55691
55696
  }
55692
55697
  try {
55693
- var m2 = loadAsFileSync(path8.resolve(x2, pkg.main));
55698
+ var m2 = loadAsFileSync(path11.resolve(x2, pkg.main));
55694
55699
  if (m2) return m2;
55695
- var n2 = loadAsDirectorySync(path8.resolve(x2, pkg.main));
55700
+ var n2 = loadAsDirectorySync(path11.resolve(x2, pkg.main));
55696
55701
  if (n2) return n2;
55697
55702
  } catch (e) {
55698
55703
  }
55699
55704
  }
55700
55705
  }
55701
- return loadAsFileSync(path8.join(x2, "/index"));
55706
+ return loadAsFileSync(path11.join(x2, "/index"));
55702
55707
  }
55703
55708
  __name(loadAsDirectorySync, "loadAsDirectorySync");
55704
55709
  function loadNodeModulesSync(x2, start) {
@@ -55708,7 +55713,7 @@ var require_sync = __commonJS({
55708
55713
  var dirs = packageIterator ? packageIterator(x2, start, thunk, opts) : thunk();
55709
55714
  for (var i = 0; i < dirs.length; i++) {
55710
55715
  var dir = dirs[i];
55711
- if (isDirectory(path8.dirname(dir))) {
55716
+ if (isDirectory(path11.dirname(dir))) {
55712
55717
  var m2 = loadAsFileSync(dir);
55713
55718
  if (m2) return m2;
55714
55719
  var n2 = loadAsDirectorySync(dir);
@@ -55802,7 +55807,7 @@ var require_require_in_the_middle = __commonJS({
55802
55807
  "node_modules/require-in-the-middle/index.js"(exports, module) {
55803
55808
  "use strict";
55804
55809
  init_esbuild_shims();
55805
- var path8 = __require("path");
55810
+ var path11 = __require("path");
55806
55811
  var Module = __require("module");
55807
55812
  var debug = require_src()("require-in-the-middle");
55808
55813
  var moduleDetailsFromPath = require_module_details_from_path();
@@ -55980,7 +55985,7 @@ var require_require_in_the_middle = __commonJS({
55980
55985
  }
55981
55986
  moduleName = filename;
55982
55987
  } else if (hasWhitelist === true && modules.includes(filename)) {
55983
- const parsedPath = path8.parse(filename);
55988
+ const parsedPath = path11.parse(filename);
55984
55989
  moduleName = parsedPath.name;
55985
55990
  basedir = parsedPath.dir;
55986
55991
  } else {
@@ -56018,7 +56023,7 @@ var require_require_in_the_middle = __commonJS({
56018
56023
  }
56019
56024
  if (res !== filename) {
56020
56025
  if (internals === true) {
56021
- moduleName = moduleName + path8.sep + path8.relative(basedir, filename);
56026
+ moduleName = moduleName + path11.sep + path11.relative(basedir, filename);
56022
56027
  debug("preparing to process require of internal file: %s", moduleName);
56023
56028
  } else {
56024
56029
  debug("ignoring require of non-main module file: %s", res);
@@ -56056,8 +56061,8 @@ var require_require_in_the_middle = __commonJS({
56056
56061
  }
56057
56062
  };
56058
56063
  function resolveModuleName(stat) {
56059
- const normalizedPath = path8.sep !== "/" ? stat.path.split(path8.sep).join("/") : stat.path;
56060
- return path8.posix.join(stat.name, normalizedPath).replace(normalize3, "");
56064
+ const normalizedPath = path11.sep !== "/" ? stat.path.split(path11.sep).join("/") : stat.path;
56065
+ return path11.posix.join(stat.name, normalizedPath).replace(normalize3, "");
56061
56066
  }
56062
56067
  __name(resolveModuleName, "resolveModuleName");
56063
56068
  }
@@ -56151,7 +56156,7 @@ var require_RequireInTheMiddleSingleton = __commonJS({
56151
56156
  Object.defineProperty(exports, "__esModule", { value: true });
56152
56157
  exports.RequireInTheMiddleSingleton = void 0;
56153
56158
  var require_in_the_middle_1 = require_require_in_the_middle();
56154
- var path8 = __require("path");
56159
+ var path11 = __require("path");
56155
56160
  var ModuleNameTrie_1 = require_ModuleNameTrie();
56156
56161
  var isMocha = [
56157
56162
  "afterEach",
@@ -56218,7 +56223,7 @@ var require_RequireInTheMiddleSingleton = __commonJS({
56218
56223
  };
56219
56224
  exports.RequireInTheMiddleSingleton = RequireInTheMiddleSingleton;
56220
56225
  function normalizePathSeparators(moduleNameOrPath) {
56221
- return path8.sep !== ModuleNameTrie_1.ModuleNameSeparator ? moduleNameOrPath.split(path8.sep).join(ModuleNameTrie_1.ModuleNameSeparator) : moduleNameOrPath;
56226
+ return path11.sep !== ModuleNameTrie_1.ModuleNameSeparator ? moduleNameOrPath.split(path11.sep).join(ModuleNameTrie_1.ModuleNameSeparator) : moduleNameOrPath;
56222
56227
  }
56223
56228
  __name(normalizePathSeparators, "normalizePathSeparators");
56224
56229
  }
@@ -56284,7 +56289,7 @@ var require_register = __commonJS({
56284
56289
  var require_import_in_the_middle = __commonJS({
56285
56290
  "node_modules/import-in-the-middle/index.js"(exports, module) {
56286
56291
  init_esbuild_shims();
56287
- var path8 = __require("path");
56292
+ var path11 = __require("path");
56288
56293
  var parse = require_module_details_from_path();
56289
56294
  var { fileURLToPath } = __require("url");
56290
56295
  var { MessageChannel } = __require("worker_threads");
@@ -56385,7 +56390,7 @@ var require_import_in_the_middle = __commonJS({
56385
56390
  if (moduleName === name) {
56386
56391
  if (baseDir) {
56387
56392
  if (internals) {
56388
- name = name + path8.sep + path8.relative(baseDir, fileURLToPath(filename));
56393
+ name = name + path11.sep + path11.relative(baseDir, fileURLToPath(filename));
56389
56394
  } else {
56390
56395
  if (!getExperimentalPatchInternals() && !baseDir.endsWith(specifiers.get(filename))) continue;
56391
56396
  }
@@ -56467,7 +56472,7 @@ var require_instrumentation2 = __commonJS({
56467
56472
  init_esbuild_shims();
56468
56473
  Object.defineProperty(exports, "__esModule", { value: true });
56469
56474
  exports.InstrumentationBase = void 0;
56470
- var path8 = __require("path");
56475
+ var path11 = __require("path");
56471
56476
  var util_1 = __require("util");
56472
56477
  var semver_1 = require_semver();
56473
56478
  var shimmer_1 = require_shimmer();
@@ -56568,7 +56573,7 @@ var require_instrumentation2 = __commonJS({
56568
56573
  }
56569
56574
  _extractPackageVersion(baseDir) {
56570
56575
  try {
56571
- const json = (0, fs_1.readFileSync)(path8.join(baseDir, "package.json"), {
56576
+ const json = (0, fs_1.readFileSync)(path11.join(baseDir, "package.json"), {
56572
56577
  encoding: "utf8"
56573
56578
  });
56574
56579
  const version = JSON.parse(json).version;
@@ -56610,7 +56615,7 @@ var require_instrumentation2 = __commonJS({
56610
56615
  return exports2;
56611
56616
  }
56612
56617
  const files = module2.files ?? [];
56613
- const normalizedName = path8.normalize(name);
56618
+ const normalizedName = path11.normalize(name);
56614
56619
  const supportedFileInstrumentations = files.filter((f) => f.name === normalizedName).filter((f) => isSupported(f.supportedVersions, version, module2.includePrerelease));
56615
56620
  return supportedFileInstrumentations.reduce((patchedExports, file) => {
56616
56621
  file.moduleExports = patchedExports;
@@ -56656,8 +56661,8 @@ var require_instrumentation2 = __commonJS({
56656
56661
  this._warnOnPreloadedModules();
56657
56662
  for (const module2 of this._modules) {
56658
56663
  const hookFn = /* @__PURE__ */ __name((exports2, name, baseDir) => {
56659
- if (!baseDir && path8.isAbsolute(name)) {
56660
- const parsedPath = path8.parse(name);
56664
+ if (!baseDir && path11.isAbsolute(name)) {
56665
+ const parsedPath = path11.parse(name);
56661
56666
  name = parsedPath.name;
56662
56667
  baseDir = parsedPath.dir;
56663
56668
  }
@@ -56666,7 +56671,7 @@ var require_instrumentation2 = __commonJS({
56666
56671
  const onRequire = /* @__PURE__ */ __name((exports2, name, baseDir) => {
56667
56672
  return this._onRequire(module2, exports2, name, baseDir);
56668
56673
  }, "onRequire");
56669
- const hook = path8.isAbsolute(module2.name) ? new require_in_the_middle_1.Hook([module2.name], { internals: true }, onRequire) : this._requireInTheMiddleSingleton.register(module2.name, onRequire);
56674
+ const hook = path11.isAbsolute(module2.name) ? new require_in_the_middle_1.Hook([module2.name], { internals: true }, onRequire) : this._requireInTheMiddleSingleton.register(module2.name, onRequire);
56670
56675
  this._hooks.push(hook);
56671
56676
  const esmHook = new import_in_the_middle_1.Hook([module2.name], { internals: false }, hookFn);
56672
56677
  this._hooks.push(esmHook);
@@ -59029,12 +59034,12 @@ var require_utils10 = __commonJS({
59029
59034
  const reqUrlObject = requestUrl || {};
59030
59035
  const protocol = reqUrlObject.protocol || fallbackProtocol;
59031
59036
  const port = (reqUrlObject.port || "").toString();
59032
- const path8 = reqUrlObject.path || "/";
59037
+ const path11 = reqUrlObject.path || "/";
59033
59038
  let host = reqUrlObject.host || reqUrlObject.hostname || headers.host || "localhost";
59034
59039
  if (host.indexOf(":") === -1 && port && port !== "80" && port !== "443") {
59035
59040
  host += `:${port}`;
59036
59041
  }
59037
- return `${protocol}//${host}${path8}`;
59042
+ return `${protocol}//${host}${path11}`;
59038
59043
  }, "getAbsoluteUrl");
59039
59044
  exports.getAbsoluteUrl = getAbsoluteUrl;
59040
59045
  var parseResponseStatus = /* @__PURE__ */ __name((kind, statusCode) => {
@@ -60693,8 +60698,8 @@ var require_src31 = __commonJS({
60693
60698
  // packages/core/src/tools/read-file.ts
60694
60699
  init_esbuild_shims();
60695
60700
  import os4 from "node:os";
60696
- import path7 from "node:path";
60697
- import fs7 from "node:fs/promises";
60701
+ import path10 from "node:path";
60702
+ import fs8 from "node:fs/promises";
60698
60703
 
60699
60704
  // packages/core/src/utils/fileUtils.ts
60700
60705
  init_esbuild_shims();
@@ -61124,12 +61129,12 @@ var Mime = class {
61124
61129
  }
61125
61130
  return this;
61126
61131
  }
61127
- getType(path8) {
61128
- if (typeof path8 !== "string")
61132
+ getType(path11) {
61133
+ if (typeof path11 !== "string")
61129
61134
  return null;
61130
- const last = path8.replace(/^.*[/\\]/s, "").toLowerCase();
61135
+ const last = path11.replace(/^.*[/\\]/s, "").toLowerCase();
61131
61136
  const ext = last.replace(/^.*\./s, "").toLowerCase();
61132
- const hasPath = last.length < path8.length;
61137
+ const hasPath = last.length < path11.length;
61133
61138
  const hasDot = ext.length < last.length - 1;
61134
61139
  if (!hasDot && hasPath)
61135
61140
  return null;
@@ -61391,7 +61396,6 @@ var BINARY_EXTENSIONS = [
61391
61396
  ...PYTHON_EXCLUDES
61392
61397
  ]),
61393
61398
  // Additional binary extensions not in the main patterns
61394
- ".dat",
61395
61399
  ".obj",
61396
61400
  ".o",
61397
61401
  ".a",
@@ -63646,7 +63650,7 @@ import { Buffer as Buffer2 } from "buffer";
63646
63650
  import * as https2 from "https";
63647
63651
  import * as os3 from "node:os";
63648
63652
  import fs6 from "node:fs";
63649
- import path6 from "node:path";
63653
+ import path7 from "node:path";
63650
63654
 
63651
63655
  // packages/core/src/telemetry/sanitize.ts
63652
63656
  init_esbuild_shims();
@@ -63913,18 +63917,16 @@ async function persistAndTruncateToolResult(callId, toolName, content, config) {
63913
63917
  `Session tool result budget exhausted (${budgetUsed} + ${byteSize} > ${MAX_SESSION_BYTES}), skipping disk persistence`
63914
63918
  );
63915
63919
  return {
63916
- content: buildStub(
63917
- content,
63918
- byteSize,
63919
- "(session disk budget exhausted)"
63920
- ),
63920
+ content: buildStub(content, byteSize, "(session disk budget exhausted)"),
63921
63921
  bytesWritten: 0
63922
63922
  };
63923
63923
  }
63924
63924
  config.trackToolResultBytes(byteSize);
63925
63925
  const safeCallId = path4.basename(callId).replace(/\x00/g, "_");
63926
63926
  if (!safeCallId || safeCallId === "." || safeCallId === "..") {
63927
- debugLogger3.warn(`Invalid callId for disk persistence: ${JSON.stringify(callId)}`);
63927
+ debugLogger3.warn(
63928
+ `Invalid callId for disk persistence: ${JSON.stringify(callId)}`
63929
+ );
63928
63930
  config.trackToolResultBytes(-byteSize);
63929
63931
  return {
63930
63932
  content: buildStub(content, byteSize, "(invalid callId)"),
@@ -63948,10 +63950,7 @@ async function persistAndTruncateToolResult(callId, toolName, content, config) {
63948
63950
  };
63949
63951
  } catch (error) {
63950
63952
  config.trackToolResultBytes(-byteSize);
63951
- debugLogger3.warn(
63952
- `Failed to persist tool result to ${outputFile}:`,
63953
- error
63954
- );
63953
+ debugLogger3.warn(`Failed to persist tool result to ${outputFile}:`, error);
63955
63954
  try {
63956
63955
  const fallback = await truncateAndSaveToFile(
63957
63956
  content,
@@ -63992,8 +63991,65 @@ ${preview}`;
63992
63991
  }
63993
63992
  __name(buildStub, "buildStub");
63994
63993
 
63994
+ // packages/core/src/tools/mcp-status.ts
63995
+ init_esbuild_shims();
63996
+ var MCPServerStatus = /* @__PURE__ */ ((MCPServerStatus2) => {
63997
+ MCPServerStatus2["DISCONNECTED"] = "disconnected";
63998
+ MCPServerStatus2["CONNECTING"] = "connecting";
63999
+ MCPServerStatus2["CONNECTED"] = "connected";
64000
+ return MCPServerStatus2;
64001
+ })(MCPServerStatus || {});
64002
+ var serverStatuses = /* @__PURE__ */ new Map();
64003
+ var statusChangeListeners = [];
64004
+ function addMCPStatusChangeListener(listener) {
64005
+ statusChangeListeners.push(listener);
64006
+ }
64007
+ __name(addMCPStatusChangeListener, "addMCPStatusChangeListener");
64008
+ function removeMCPStatusChangeListener(listener) {
64009
+ const index = statusChangeListeners.indexOf(listener);
64010
+ if (index !== -1) {
64011
+ statusChangeListeners.splice(index, 1);
64012
+ }
64013
+ }
64014
+ __name(removeMCPStatusChangeListener, "removeMCPStatusChangeListener");
64015
+ function updateMCPServerStatus(serverName, status) {
64016
+ serverStatuses.set(serverName, status);
64017
+ for (const listener of [...statusChangeListeners]) {
64018
+ listener(serverName, status);
64019
+ }
64020
+ }
64021
+ __name(updateMCPServerStatus, "updateMCPServerStatus");
64022
+ function removeMCPServerStatus(serverName) {
64023
+ if (!serverStatuses.has(serverName)) {
64024
+ return;
64025
+ }
64026
+ serverStatuses.delete(serverName);
64027
+ for (const listener of [...statusChangeListeners]) {
64028
+ listener(serverName, void 0);
64029
+ }
64030
+ }
64031
+ __name(removeMCPServerStatus, "removeMCPServerStatus");
64032
+ function getMCPServerStatus(serverName) {
64033
+ return serverStatuses.get(serverName) || "disconnected" /* DISCONNECTED */;
64034
+ }
64035
+ __name(getMCPServerStatus, "getMCPServerStatus");
64036
+ function getAllMCPServerStatuses() {
64037
+ return new Map(serverStatuses);
64038
+ }
64039
+ __name(getAllMCPServerStatuses, "getAllMCPServerStatuses");
64040
+
63995
64041
  // packages/core/src/tools/mcp-tool.ts
63996
64042
  var debugLogger4 = createDebugLogger("MCP_TOOL");
64043
+ var MCP_CONNECTION_ERROR_PATTERNS = [
64044
+ /ECONNREFUSED/i,
64045
+ /ENOTFOUND/i,
64046
+ /ECONNRESET/i,
64047
+ /ETIMEDOUT/i,
64048
+ /connection (closed|lost)/i,
64049
+ /not connected/i,
64050
+ /disconnected/i,
64051
+ /transport closed/i
64052
+ ];
63997
64053
  var DiscoveredMCPToolInvocation = class _DiscoveredMCPToolInvocation extends BaseToolInvocation {
63998
64054
  constructor(mcpTool, serverName, serverToolName, displayName, trust, params = {}, cliConfig, mcpClient, mcpTimeout, annotations, retryCount = 0) {
63999
64055
  super(params);
@@ -64087,6 +64143,9 @@ var DiscoveredMCPToolInvocation = class _DiscoveredMCPToolInvocation extends Bas
64087
64143
  }
64088
64144
  async handleReconnectOnError(error, signal, updateOutput) {
64089
64145
  debugLogger4.error(`MCP server error '${this.serverName}': ${error}`);
64146
+ if (!this.shouldAttemptReconnect(error)) {
64147
+ throw error;
64148
+ }
64090
64149
  if (this.retryCount < _DiscoveredMCPToolInvocation.MAX_RECONNECT_RETRIES) {
64091
64150
  debugLogger4.info(
64092
64151
  `Reconnection attempt ${this.retryCount + 1}/${_DiscoveredMCPToolInvocation.MAX_RECONNECT_RETRIES} for MCP server '${this.serverName}'`
@@ -64115,6 +64174,18 @@ var DiscoveredMCPToolInvocation = class _DiscoveredMCPToolInvocation extends Bas
64115
64174
  }
64116
64175
  throw error;
64117
64176
  }
64177
+ shouldAttemptReconnect(error) {
64178
+ if (isAbortError(error)) {
64179
+ return false;
64180
+ }
64181
+ if (getMCPServerStatus(this.serverName) === "disconnected" /* DISCONNECTED */) {
64182
+ return true;
64183
+ }
64184
+ const message = getErrorMessage(error);
64185
+ return MCP_CONNECTION_ERROR_PATTERNS.some(
64186
+ (pattern) => pattern.test(message)
64187
+ );
64188
+ }
64118
64189
  async execute(signal, updateOutput) {
64119
64190
  if (this.mcpClient) {
64120
64191
  return this.executeWithDirectClient(signal, updateOutput);
@@ -64838,6 +64909,9 @@ var LoopType = /* @__PURE__ */ ((LoopType2) => {
64838
64909
  LoopType2["REPETITIVE_THOUGHTS"] = "repetitive_thoughts";
64839
64910
  LoopType2["READ_FILE_LOOP"] = "read_file_loop";
64840
64911
  LoopType2["ACTION_STAGNATION"] = "action_stagnation";
64912
+ LoopType2["GLOBAL_TOOL_CALL_DUPLICATE"] = "global_tool_call_duplicate";
64913
+ LoopType2["ALTERNATING_TOOL_CALL_PATTERN"] = "alternating_tool_call_pattern";
64914
+ LoopType2["TURN_TOOL_CALL_CAP"] = "turn_tool_call_cap";
64841
64915
  return LoopType2;
64842
64916
  })(LoopType || {});
64843
64917
  var LoopDetectedEvent = class {
@@ -65398,6 +65472,7 @@ var PromptSuggestionEvent = class {
65398
65472
  outcome;
65399
65473
  prompt_id;
65400
65474
  accept_method;
65475
+ accept_source;
65401
65476
  time_to_accept_ms;
65402
65477
  time_to_ignore_ms;
65403
65478
  time_to_first_keystroke_ms;
@@ -65411,6 +65486,7 @@ var PromptSuggestionEvent = class {
65411
65486
  this.outcome = params.outcome;
65412
65487
  this.prompt_id = params.prompt_id ?? "user_intent";
65413
65488
  this.accept_method = params.accept_method;
65489
+ this.accept_source = params.accept_source;
65414
65490
  this.time_to_accept_ms = params.time_to_accept_ms;
65415
65491
  this.time_to_ignore_ms = params.time_to_ignore_ms;
65416
65492
  this.time_to_first_keystroke_ms = params.time_to_first_keystroke_ms;
@@ -65706,8 +65782,9 @@ function convertGeminiToolParametersToOpenAI(parameters) {
65706
65782
  result[key] = value;
65707
65783
  }
65708
65784
  } else if (key === "minLength" || key === "maxLength" || key === "minItems" || key === "maxItems") {
65709
- if (typeof value === "string" && !isNaN(Number(value))) {
65710
- result[key] = parseInt(value, 10);
65785
+ const numberValue = typeof value === "string" ? Number(value) : NaN;
65786
+ if (typeof value === "string" && value.trim() !== "" && Number.isInteger(numberValue)) {
65787
+ result[key] = numberValue;
65711
65788
  } else {
65712
65789
  result[key] = value;
65713
65790
  }
@@ -65951,6 +66028,14 @@ function processContent(content, messages, requestContext) {
65951
66028
  accumulatedSplitMedia.push(...mediaParts);
65952
66029
  }
65953
66030
  }
66031
+ if (requestContext.toolResultContentFormat === "string" && Array.isArray(toolMessage.content)) {
66032
+ const toolContent = toolMessage.content;
66033
+ if (toolContent.every(
66034
+ (cp) => cp?.type === "text"
66035
+ )) {
66036
+ toolMessage.content = toolContent.map((cp) => cp.text).join("\n");
66037
+ }
66038
+ }
65954
66039
  messages.push(toolMessage);
65955
66040
  }
65956
66041
  }
@@ -66316,7 +66401,7 @@ function convertOpenAIResponseToGemini(openaiResponse, requestContext) {
66316
66401
  let finalCompletionTokens = completionTokens;
66317
66402
  if (totalTokens > 0 && promptTokens === 0 && completionTokens === 0) {
66318
66403
  finalPromptTokens = Math.round(totalTokens * 0.7);
66319
- finalCompletionTokens = Math.round(totalTokens * 0.3);
66404
+ finalCompletionTokens = totalTokens - finalPromptTokens;
66320
66405
  }
66321
66406
  response.usageMetadata = {
66322
66407
  promptTokenCount: finalPromptTokens,
@@ -66448,7 +66533,7 @@ function convertOpenAIChunkToGemini(chunk, requestContext) {
66448
66533
  let finalCompletionTokens = completionTokens;
66449
66534
  if (totalTokens > 0 && promptTokens === 0 && completionTokens === 0) {
66450
66535
  finalPromptTokens = Math.round(totalTokens * 0.7);
66451
- finalCompletionTokens = Math.round(totalTokens * 0.3);
66536
+ finalCompletionTokens = totalTokens - finalPromptTokens;
66452
66537
  }
66453
66538
  response.usageMetadata = {
66454
66539
  promptTokenCount: finalPromptTokens,
@@ -66953,13 +67038,20 @@ init_esbuild_shims();
66953
67038
  var import_core3 = __toESM(require_src3(), 1);
66954
67039
  var import_sdk_metrics = __toESM(require_src9(), 1);
66955
67040
  import * as fs5 from "node:fs";
67041
+ import * as path6 from "node:path";
66956
67042
  var FileExporter = class {
66957
67043
  static {
66958
67044
  __name(this, "FileExporter");
66959
67045
  }
66960
67046
  writeStream;
66961
67047
  constructor(filePath) {
67048
+ try {
67049
+ fs5.mkdirSync(path6.dirname(filePath), { recursive: true });
67050
+ } catch {
67051
+ }
66962
67052
  this.writeStream = fs5.createWriteStream(filePath, { flags: "a" });
67053
+ this.writeStream.on("error", () => {
67054
+ });
66963
67055
  }
66964
67056
  serialize(data) {
66965
67057
  return safeJsonStringify(data, 2) + "\n";
@@ -68424,13 +68516,13 @@ __name(createSessionRootContext, "createSessionRootContext");
68424
68516
 
68425
68517
  // packages/core/src/telemetry/sdk.ts
68426
68518
  function createTelemetryDiagLogger() {
68427
- const debugLogger13 = createDebugLogger("OTEL");
68519
+ const debugLogger15 = createDebugLogger("OTEL");
68428
68520
  return {
68429
- error: /* @__PURE__ */ __name((message, ...args) => debugLogger13.error(message, ...args), "error"),
68430
- warn: /* @__PURE__ */ __name((message, ...args) => debugLogger13.warn(message, ...args), "warn"),
68431
- info: /* @__PURE__ */ __name((message, ...args) => debugLogger13.info(message, ...args), "info"),
68432
- debug: /* @__PURE__ */ __name((message, ...args) => debugLogger13.debug(message, ...args), "debug"),
68433
- verbose: /* @__PURE__ */ __name((message, ...args) => debugLogger13.debug(message, ...args), "verbose")
68521
+ error: /* @__PURE__ */ __name((message, ...args) => debugLogger15.error(message, ...args), "error"),
68522
+ warn: /* @__PURE__ */ __name((message, ...args) => debugLogger15.warn(message, ...args), "warn"),
68523
+ info: /* @__PURE__ */ __name((message, ...args) => debugLogger15.info(message, ...args), "info"),
68524
+ debug: /* @__PURE__ */ __name((message, ...args) => debugLogger15.debug(message, ...args), "debug"),
68525
+ verbose: /* @__PURE__ */ __name((message, ...args) => debugLogger15.debug(message, ...args), "verbose")
68434
68526
  };
68435
68527
  }
68436
68528
  __name(createTelemetryDiagLogger, "createTelemetryDiagLogger");
@@ -68533,7 +68625,7 @@ function initializeTelemetry(config) {
68533
68625
  if (telemetryInitialized || !config.getTelemetryEnabled()) {
68534
68626
  return;
68535
68627
  }
68536
- const debugLogger13 = createDebugLogger("OTEL");
68628
+ const debugLogger15 = createDebugLogger("OTEL");
68537
68629
  const userAttrs = config.getTelemetryResourceAttributes() ?? {};
68538
68630
  const userServiceName = userAttrs["service.name"];
68539
68631
  const {
@@ -68582,7 +68674,7 @@ function initializeTelemetry(config) {
68582
68674
  const metricsUrl = validateUrl(
68583
68675
  config.getTelemetryOtlpMetricsEndpoint() ?? (parsedEndpoint ? resolveHttpOtlpUrl(parsedEndpoint, "metrics") : void 0)
68584
68676
  );
68585
- debugLogger13.debug(
68677
+ debugLogger15.debug(
68586
68678
  `OTLP HTTP endpoints: traces=${tracesUrl ?? "none"}, logs=${logsUrl ?? "none"}, metrics=${metricsUrl ?? "none"}`
68587
68679
  );
68588
68680
  if (tracesUrl) {
@@ -68607,7 +68699,7 @@ function initializeTelemetry(config) {
68607
68699
  // trade-off, since falling back to stderr would re-introduce the
68608
68700
  // TUI pollution this injection was added to prevent.
68609
68701
  ...config.isInteractive() && {
68610
- diagnosticsSink: /* @__PURE__ */ __name((message) => debugLogger13.warn(message), "diagnosticsSink")
68702
+ diagnosticsSink: /* @__PURE__ */ __name((message) => debugLogger15.warn(message), "diagnosticsSink")
68611
68703
  }
68612
68704
  }
68613
68705
  );
@@ -68622,7 +68714,7 @@ function initializeTelemetry(config) {
68622
68714
  if (!parsedEndpoint) {
68623
68715
  const warning = 'Per-signal OTLP endpoints are only supported with HTTP protocol. Set otlpProtocol to "http" or provide a base otlpEndpoint for gRPC. Telemetry SDK startup was skipped because no supported gRPC endpoint was configured.';
68624
68716
  diag.warn(warning);
68625
- debugLogger13.warn(warning);
68717
+ debugLogger15.warn(warning);
68626
68718
  return;
68627
68719
  } else {
68628
68720
  spanExporter = new import_exporter_trace_otlp_grpc.OTLPTraceExporter({
@@ -68671,25 +68763,25 @@ function initializeTelemetry(config) {
68671
68763
  config.getTelemetryOtlpLogsEndpoint(),
68672
68764
  config.getTelemetryOtlpMetricsEndpoint()
68673
68765
  ].map(normalizeOtlpPrefix).filter((u) => !!u);
68674
- const matchesOtlpPrefix = /* @__PURE__ */ __name((origin, path8) => {
68766
+ const matchesOtlpPrefix = /* @__PURE__ */ __name((origin, path11) => {
68675
68767
  for (const prefix of otlpUrlPrefixes) {
68676
68768
  if (origin !== prefix.origin) continue;
68677
68769
  if (prefix.pathname === "") return true;
68678
- if (!path8.startsWith(prefix.pathname)) continue;
68679
- const next = path8.charAt(prefix.pathname.length);
68770
+ if (!path11.startsWith(prefix.pathname)) continue;
68771
+ const next = path11.charAt(prefix.pathname.length);
68680
68772
  if (next === "" || next === "/" || next === "?" || next === "#") {
68681
68773
  return true;
68682
68774
  }
68683
68775
  }
68684
68776
  return false;
68685
68777
  }, "matchesOtlpPrefix");
68686
- const stripPathSuffix = /* @__PURE__ */ __name((path8) => {
68687
- const qIdx = path8.indexOf("?");
68688
- const fIdx = path8.indexOf("#");
68689
- let cut = path8.length;
68778
+ const stripPathSuffix = /* @__PURE__ */ __name((path11) => {
68779
+ const qIdx = path11.indexOf("?");
68780
+ const fIdx = path11.indexOf("#");
68781
+ let cut = path11.length;
68690
68782
  if (qIdx !== -1) cut = Math.min(cut, qIdx);
68691
68783
  if (fIdx !== -1) cut = Math.min(cut, fIdx);
68692
- return path8.slice(0, cut);
68784
+ return path11.slice(0, cut);
68693
68785
  }, "stripPathSuffix");
68694
68786
  const textMapPropagator = config.getOutboundCorrelationPropagateTraceContext() ? void 0 : NOOP_PROPAGATOR;
68695
68787
  sdk = new import_sdk_node.NodeSDK({
@@ -68725,8 +68817,8 @@ function initializeTelemetry(config) {
68725
68817
  } catch {
68726
68818
  return false;
68727
68819
  }
68728
- const path8 = typeof req.path === "string" ? stripPathSuffix(req.path) : "";
68729
- return matchesOtlpPrefix(origin, path8);
68820
+ const path11 = typeof req.path === "string" ? stripPathSuffix(req.path) : "";
68821
+ return matchesOtlpPrefix(origin, path11);
68730
68822
  }, "ignoreOutgoingRequestHook")
68731
68823
  }),
68732
68824
  // Modern fetch (`globalThis.fetch` / undici) is the HTTP layer used by
@@ -68736,15 +68828,15 @@ function initializeTelemetry(config) {
68736
68828
  new import_instrumentation_undici.UndiciInstrumentation({
68737
68829
  ignoreRequestHook: /* @__PURE__ */ __name((request4) => {
68738
68830
  if (otlpUrlPrefixes.length === 0) return false;
68739
- const path8 = typeof request4.path === "string" ? stripPathSuffix(request4.path) : "";
68740
- return matchesOtlpPrefix(request4.origin, path8);
68831
+ const path11 = typeof request4.path === "string" ? stripPathSuffix(request4.path) : "";
68832
+ return matchesOtlpPrefix(request4.origin, path11);
68741
68833
  }, "ignoreRequestHook")
68742
68834
  })
68743
68835
  ]
68744
68836
  });
68745
68837
  try {
68746
68838
  sdk.start();
68747
- debugLogger13.debug("OpenTelemetry SDK started successfully.");
68839
+ debugLogger15.debug("OpenTelemetry SDK started successfully.");
68748
68840
  telemetryInitialized = true;
68749
68841
  activeMetricReader = metricReader;
68750
68842
  const sessionId = config.getSessionId();
@@ -68754,7 +68846,7 @@ function initializeTelemetry(config) {
68754
68846
  );
68755
68847
  initializeMetrics(config);
68756
68848
  } catch (error) {
68757
- debugLogger13.error("Error starting OpenTelemetry SDK:", error);
68849
+ debugLogger15.error("Error starting OpenTelemetry SDK:", error);
68758
68850
  }
68759
68851
  }
68760
68852
  __name(initializeTelemetry, "initializeTelemetry");
@@ -68776,7 +68868,7 @@ async function shutdownTelemetry() {
68776
68868
  }
68777
68869
  endInteractionSpan("cancelled");
68778
68870
  const currentSdk = sdk;
68779
- const debugLogger13 = createDebugLogger("OTEL");
68871
+ const debugLogger15 = createDebugLogger("OTEL");
68780
68872
  telemetryShutdownPromise = (async () => {
68781
68873
  let timer;
68782
68874
  let timedOut = false;
@@ -68784,7 +68876,7 @@ async function shutdownTelemetry() {
68784
68876
  const sdkShutdown = Promise.resolve(currentSdk.shutdown());
68785
68877
  sdkShutdown.catch((err) => {
68786
68878
  if (timedOut) {
68787
- debugLogger13.warn(
68879
+ debugLogger15.warn(
68788
68880
  "SDK shutdown rejected after timeout:",
68789
68881
  err instanceof Error ? err.message : err
68790
68882
  );
@@ -68802,14 +68894,14 @@ async function shutdownTelemetry() {
68802
68894
  if (result === "timeout") {
68803
68895
  const msg = `Telemetry shutdown timed out after ${SHUTDOWN_TIMEOUT_MS}ms.`;
68804
68896
  diag.warn(msg);
68805
- debugLogger13.warn(msg);
68897
+ debugLogger15.warn(msg);
68806
68898
  } else {
68807
- debugLogger13.debug("OpenTelemetry SDK shut down successfully.");
68899
+ debugLogger15.debug("OpenTelemetry SDK shut down successfully.");
68808
68900
  }
68809
68901
  } catch (error) {
68810
68902
  clearTimeout(timer);
68811
68903
  diag.error("Error shutting down SDK:", error);
68812
- debugLogger13.error("Error shutting down SDK:", error);
68904
+ debugLogger15.error("Error shutting down SDK:", error);
68813
68905
  } finally {
68814
68906
  telemetryInitialized = false;
68815
68907
  sdk = void 0;
@@ -69775,6 +69867,7 @@ var LoggingContentGenerator = class {
69775
69867
  this.config = config;
69776
69868
  this.modalities = generatorConfig.modalities;
69777
69869
  this.splitToolMedia = generatorConfig.splitToolMedia;
69870
+ this.toolResultContentFormat = generatorConfig.toolResultContentFormat;
69778
69871
  this.generatorAuthType = generatorConfig.authType;
69779
69872
  if (generatorConfig.enableOpenAILogging) {
69780
69873
  this.openaiLogger = new OpenAILogger(
@@ -69791,6 +69884,7 @@ var LoggingContentGenerator = class {
69791
69884
  schemaCompliance;
69792
69885
  modalities;
69793
69886
  splitToolMedia;
69887
+ toolResultContentFormat;
69794
69888
  generatorAuthType;
69795
69889
  getWrapped() {
69796
69890
  return this.wrapped;
@@ -70257,6 +70351,7 @@ var LoggingContentGenerator = class {
70257
70351
  // --openai-logging fallback reconstruction reflects the same split as the
70258
70352
  // request actually sent. Opt out via generationConfig.splitToolMedia = false.
70259
70353
  splitToolMedia: this.splitToolMedia ?? true,
70354
+ toolResultContentFormat: this.toolResultContentFormat ?? "parts",
70260
70355
  startTime: 0
70261
70356
  };
70262
70357
  }
@@ -70689,7 +70784,8 @@ var MODEL_GENERATION_CONFIG_FIELDS = [
70689
70784
  "customHeaders",
70690
70785
  "extra_body",
70691
70786
  "modalities",
70692
- "splitToolMedia"
70787
+ "splitToolMedia",
70788
+ "toolResultContentFormat"
70693
70789
  ];
70694
70790
  var CREDENTIAL_FIELDS = [
70695
70791
  "model",
@@ -71589,11 +71685,11 @@ var ModelsConfig = class _ModelsConfig {
71589
71685
  * 4. If no default is available, leave the generationConfig incomplete and let
71590
71686
  * resolveContentGeneratorConfigWithSources throw exceptions as expected.
71591
71687
  */
71592
- syncAfterAuthRefresh(authType, modelId) {
71688
+ syncAfterAuthRefresh(authType, modelId, providerBaseUrlOverride) {
71593
71689
  this.strictModelProviderSelection = false;
71594
71690
  const previousAuthType = this.currentAuthType;
71595
71691
  this.currentAuthType = authType;
71596
- const providerBaseUrl = this.generationConfigSources["baseUrl"]?.kind === "modelProviders" ? this._generationConfig.baseUrl : void 0;
71692
+ const providerBaseUrl = providerBaseUrlOverride ?? (this.generationConfigSources["baseUrl"]?.kind === "modelProviders" ? this._generationConfig.baseUrl : void 0);
71597
71693
  const resolved = modelId ? this.modelRegistry.getModel(authType, modelId, providerBaseUrl) ?? this.modelRegistry.getModel(authType, modelId) : void 0;
71598
71694
  if (resolved) {
71599
71695
  const hasBeenApplied = this.generationConfigSources["baseUrl"]?.kind === "modelProviders";
@@ -71879,12 +71975,12 @@ var AuthType = /* @__PURE__ */ ((AuthType2) => {
71879
71975
  AuthType2["USE_ANTHROPIC"] = "anthropic";
71880
71976
  return AuthType2;
71881
71977
  })(AuthType || {});
71882
- function setSource(sources, path8, source) {
71883
- sources[path8] = source;
71978
+ function setSource(sources, path11, source) {
71979
+ sources[path11] = source;
71884
71980
  }
71885
71981
  __name(setSource, "setSource");
71886
- function getSeedSource(seed, path8) {
71887
- return seed?.[path8];
71982
+ function getSeedSource(seed, path11) {
71983
+ return seed?.[path11];
71888
71984
  }
71889
71985
  __name(getSeedSource, "getSeedSource");
71890
71986
  function resolveContentGeneratorConfigWithSources(config, authType, generationConfig, seedSources, options) {
@@ -71905,7 +72001,7 @@ function resolveContentGeneratorConfigWithSources(config, authType, generationCo
71905
72001
  detail: "Config.getProxy()"
71906
72002
  });
71907
72003
  }
71908
- const seedOrUnknown = /* @__PURE__ */ __name((path8) => getSeedSource(seedSources, path8) ?? { kind: "unknown" }, "seedOrUnknown");
72004
+ const seedOrUnknown = /* @__PURE__ */ __name((path11) => getSeedSource(seedSources, path11) ?? { kind: "unknown" }, "seedOrUnknown");
71909
72005
  for (const field of PROVIDER_SOURCED_FIELDS) {
71910
72006
  if (generationConfig && field in generationConfig && !sources[field]) {
71911
72007
  setSource(sources, field, seedOrUnknown(field));
@@ -72004,11 +72100,11 @@ async function createContentGenerator(generatorConfig, config, isInitialAuth) {
72004
72100
  let baseGenerator;
72005
72101
  try {
72006
72102
  if (authType === "openai" /* USE_OPENAI */) {
72007
- const { createOpenAIContentGenerator } = await import("./openaiContentGenerator-DRXB5MSN.js");
72103
+ const { createOpenAIContentGenerator } = await import("./openaiContentGenerator-XYMMXZFG.js");
72008
72104
  baseGenerator = createOpenAIContentGenerator(generatorConfig, config);
72009
72105
  } else if (authType === "qwen-oauth" /* QWEN_OAUTH */) {
72010
- const { getQwenOAuthClient: getQwenOauthClient } = await import("./qwenOAuth2-KK433U33.js");
72011
- const { QwenContentGenerator } = await import("./qwenContentGenerator-3XZMXLHX.js");
72106
+ const { getQwenOAuthClient: getQwenOauthClient } = await import("./qwenOAuth2-XWC5SU63.js");
72107
+ const { QwenContentGenerator } = await import("./qwenContentGenerator-QWPW3P7K.js");
72012
72108
  try {
72013
72109
  const qwenClient = await getQwenOauthClient(
72014
72110
  config,
@@ -72026,10 +72122,10 @@ async function createContentGenerator(generatorConfig, config, isInitialAuth) {
72026
72122
  throw new Error(error instanceof Error ? error.message : String(error));
72027
72123
  }
72028
72124
  } else if (authType === "anthropic" /* USE_ANTHROPIC */) {
72029
- const { createAnthropicContentGenerator } = await import("./anthropicContentGenerator-KLBHYGH6.js");
72125
+ const { createAnthropicContentGenerator } = await import("./anthropicContentGenerator-OLOGBVLP.js");
72030
72126
  baseGenerator = createAnthropicContentGenerator(generatorConfig, config);
72031
72127
  } else if (authType === "gemini" /* USE_GEMINI */ || authType === "vertex-ai" /* USE_VERTEX_AI */) {
72032
- const { createGeminiContentGenerator } = await import("./geminiContentGenerator-SDUMCYHD.js");
72128
+ const { createGeminiContentGenerator } = await import("./geminiContentGenerator-KUVZXCGX.js");
72033
72129
  baseGenerator = createGeminiContentGenerator(generatorConfig, config);
72034
72130
  } else {
72035
72131
  throw new Error(
@@ -72202,9 +72298,9 @@ var QwenLogger = class _QwenLogger {
72202
72298
  readSourceInfo() {
72203
72299
  try {
72204
72300
  const globalDir = Storage.getGlobalQwenDir();
72205
- const sourceJsonPath = path6.join(globalDir, "source.json");
72206
- const legacyPath = path6.join(os3.homedir(), ".qwen", "source.json");
72207
- const candidates = path6.normalize(sourceJsonPath) !== path6.normalize(legacyPath) ? [sourceJsonPath, legacyPath] : [sourceJsonPath];
72301
+ const sourceJsonPath = path7.join(globalDir, "source.json");
72302
+ const legacyPath = path7.join(os3.homedir(), ".qwen", "source.json");
72303
+ const candidates = path7.normalize(sourceJsonPath) !== path7.normalize(legacyPath) ? [sourceJsonPath, legacyPath] : [sourceJsonPath];
72208
72304
  for (const candidate of candidates) {
72209
72305
  if (fs6.existsSync(candidate)) {
72210
72306
  const sourceJsonContent = fs6.readFileSync(candidate, "utf8");
@@ -72870,6 +72966,632 @@ var QwenLogger = class _QwenLogger {
72870
72966
  }
72871
72967
  };
72872
72968
 
72969
+ // packages/core/src/services/tokenUsageService.ts
72970
+ init_esbuild_shims();
72971
+ import path9 from "node:path";
72972
+ import { randomUUID } from "node:crypto";
72973
+
72974
+ // packages/core/src/utils/jsonl-utils.ts
72975
+ init_esbuild_shims();
72976
+ import fs7 from "node:fs";
72977
+ import path8 from "node:path";
72978
+ import readline from "node:readline";
72979
+ import { finished } from "node:stream/promises";
72980
+ var debugLogger12 = createDebugLogger("JSONL");
72981
+ var fileLocks = /* @__PURE__ */ new Map();
72982
+ function getFileLock(filePath) {
72983
+ if (!fileLocks.has(filePath)) {
72984
+ fileLocks.set(filePath, new Mutex());
72985
+ }
72986
+ return fileLocks.get(filePath);
72987
+ }
72988
+ __name(getFileLock, "getFileLock");
72989
+ function _recoverObjectsFromLine(line) {
72990
+ const out = [];
72991
+ let depth = 0;
72992
+ let inString = false;
72993
+ let escape = false;
72994
+ let start = -1;
72995
+ for (let i = 0; i < line.length; i++) {
72996
+ const c = line[i];
72997
+ if (escape) {
72998
+ escape = false;
72999
+ continue;
73000
+ }
73001
+ if (inString) {
73002
+ if (c === "\\") escape = true;
73003
+ else if (c === '"') inString = false;
73004
+ continue;
73005
+ }
73006
+ if (c === '"') {
73007
+ inString = true;
73008
+ continue;
73009
+ }
73010
+ if (c === "{") {
73011
+ if (depth === 0) start = i;
73012
+ depth++;
73013
+ } else if (c === "}") {
73014
+ depth--;
73015
+ if (depth === 0 && start >= 0) {
73016
+ const fragment = line.slice(start, i + 1);
73017
+ try {
73018
+ out.push(JSON.parse(fragment));
73019
+ } catch {
73020
+ }
73021
+ start = -1;
73022
+ } else if (depth < 0) {
73023
+ depth = 0;
73024
+ start = -1;
73025
+ }
73026
+ }
73027
+ }
73028
+ return out;
73029
+ }
73030
+ __name(_recoverObjectsFromLine, "_recoverObjectsFromLine");
73031
+ function parseLineTolerant(line, filePath) {
73032
+ try {
73033
+ const parsed = JSON.parse(line);
73034
+ if (parsed !== null && typeof parsed === "object" && !Array.isArray(parsed)) {
73035
+ return [parsed];
73036
+ }
73037
+ debugLogger12.warn(`Skipping non-object JSONL value in ${filePath}`);
73038
+ return [];
73039
+ } catch {
73040
+ const fragments = _recoverObjectsFromLine(line);
73041
+ if (fragments.length === 0) {
73042
+ debugLogger12.warn(`Failed to parse line in ${filePath}`);
73043
+ } else {
73044
+ debugLogger12.warn(
73045
+ `Recovered ${fragments.length} record(s) from malformed line in ${filePath}`
73046
+ );
73047
+ }
73048
+ return fragments;
73049
+ }
73050
+ }
73051
+ __name(parseLineTolerant, "parseLineTolerant");
73052
+ async function closeLineReader(rl, fileStream) {
73053
+ rl?.close();
73054
+ if (!fileStream || fileStream.closed) {
73055
+ return;
73056
+ }
73057
+ const closed = finished(fileStream, { cleanup: true }).catch(() => void 0);
73058
+ if (!fileStream.destroyed) {
73059
+ fileStream.destroy();
73060
+ }
73061
+ await closed;
73062
+ }
73063
+ __name(closeLineReader, "closeLineReader");
73064
+ async function readLines(filePath, count) {
73065
+ let fileStream;
73066
+ let rl;
73067
+ try {
73068
+ fileStream = fs7.createReadStream(filePath);
73069
+ rl = readline.createInterface({
73070
+ input: fileStream,
73071
+ crlfDelay: Infinity
73072
+ });
73073
+ const results = [];
73074
+ for await (const line of rl) {
73075
+ if (results.length >= count) break;
73076
+ const trimmed = line.trim();
73077
+ if (trimmed.length === 0) continue;
73078
+ for (const obj of parseLineTolerant(trimmed, filePath)) {
73079
+ if (results.length >= count) break;
73080
+ results.push(obj);
73081
+ }
73082
+ }
73083
+ return results;
73084
+ } catch (error) {
73085
+ if (error.code !== "ENOENT") {
73086
+ debugLogger12.error(
73087
+ `Error reading first ${count} lines from ${filePath}:`,
73088
+ error
73089
+ );
73090
+ }
73091
+ return [];
73092
+ } finally {
73093
+ await closeLineReader(rl, fileStream);
73094
+ }
73095
+ }
73096
+ __name(readLines, "readLines");
73097
+ async function read(filePath, options = {}) {
73098
+ let fileStream;
73099
+ let rl;
73100
+ try {
73101
+ fileStream = fs7.createReadStream(filePath);
73102
+ rl = readline.createInterface({
73103
+ input: fileStream,
73104
+ crlfDelay: Infinity
73105
+ });
73106
+ const results = [];
73107
+ for await (const line of rl) {
73108
+ const trimmed = line.trim();
73109
+ if (trimmed.length === 0) continue;
73110
+ for (const obj of parseLineTolerant(trimmed, filePath)) {
73111
+ results.push(obj);
73112
+ }
73113
+ }
73114
+ return results;
73115
+ } catch (error) {
73116
+ if (error.code !== "ENOENT") {
73117
+ debugLogger12.error(`Error reading ${filePath}:`, error);
73118
+ if (options.throwOnNonEnoentError) {
73119
+ throw error;
73120
+ }
73121
+ }
73122
+ return [];
73123
+ } finally {
73124
+ await closeLineReader(rl, fileStream);
73125
+ }
73126
+ }
73127
+ __name(read, "read");
73128
+ var ensuredDirs = /* @__PURE__ */ new Set();
73129
+ function _resetEnsuredDirsCacheForTest() {
73130
+ ensuredDirs.clear();
73131
+ }
73132
+ __name(_resetEnsuredDirsCacheForTest, "_resetEnsuredDirsCacheForTest");
73133
+ async function writeLine(filePath, data) {
73134
+ const lock = getFileLock(filePath);
73135
+ await lock.runExclusive(async () => {
73136
+ const line = `${JSON.stringify(data)}
73137
+ `;
73138
+ const dir = path8.dirname(filePath);
73139
+ if (!ensuredDirs.has(dir)) {
73140
+ await fs7.promises.mkdir(dir, { recursive: true });
73141
+ ensuredDirs.add(dir);
73142
+ }
73143
+ await fs7.promises.appendFile(filePath, Buffer.from(line, "utf8"), {
73144
+ flush: true
73145
+ });
73146
+ });
73147
+ }
73148
+ __name(writeLine, "writeLine");
73149
+ function writeLineSync(filePath, data) {
73150
+ const line = `${JSON.stringify(data)}
73151
+ `;
73152
+ const dir = path8.dirname(filePath);
73153
+ if (!fs7.existsSync(dir)) {
73154
+ fs7.mkdirSync(dir, { recursive: true });
73155
+ }
73156
+ fs7.appendFileSync(filePath, Buffer.from(line, "utf8"), { flush: true });
73157
+ }
73158
+ __name(writeLineSync, "writeLineSync");
73159
+ function write(filePath, data) {
73160
+ const lines = data.map((item) => JSON.stringify(item)).join("\n");
73161
+ const dir = path8.dirname(filePath);
73162
+ if (!fs7.existsSync(dir)) {
73163
+ fs7.mkdirSync(dir, { recursive: true });
73164
+ }
73165
+ atomicWriteFileSync(filePath, `${lines}
73166
+ `, { encoding: "utf8" });
73167
+ }
73168
+ __name(write, "write");
73169
+ async function countLines(filePath) {
73170
+ let fileStream;
73171
+ let rl;
73172
+ try {
73173
+ fileStream = fs7.createReadStream(filePath);
73174
+ rl = readline.createInterface({
73175
+ input: fileStream,
73176
+ crlfDelay: Infinity
73177
+ });
73178
+ let count = 0;
73179
+ for await (const line of rl) {
73180
+ if (line.trim().length > 0) {
73181
+ count++;
73182
+ }
73183
+ }
73184
+ return count;
73185
+ } catch (error) {
73186
+ if (error.code !== "ENOENT") {
73187
+ debugLogger12.error(`Error counting lines in ${filePath}:`, error);
73188
+ }
73189
+ return 0;
73190
+ } finally {
73191
+ await closeLineReader(rl, fileStream);
73192
+ }
73193
+ }
73194
+ __name(countLines, "countLines");
73195
+ function exists(filePath) {
73196
+ try {
73197
+ const stats = fs7.statSync(filePath);
73198
+ return stats.isFile() && stats.size > 0;
73199
+ } catch {
73200
+ return false;
73201
+ }
73202
+ }
73203
+ __name(exists, "exists");
73204
+
73205
+ // packages/core/src/services/tokenUsageService.ts
73206
+ var debugLogger13 = createDebugLogger("TOKEN_USAGE");
73207
+ var USAGE_DIR_NAME = "usage";
73208
+ var FILE_PREFIX = "token-usage-";
73209
+ var FILE_EXTENSION = ".jsonl";
73210
+ var SCHEMA_VERSION = 1;
73211
+ var UNKNOWN_AUTH_TYPE = "unknown";
73212
+ function createEmptyTotals() {
73213
+ return {
73214
+ requests: 0,
73215
+ inputTokens: 0,
73216
+ outputTokens: 0,
73217
+ cachedTokens: 0,
73218
+ thoughtsTokens: 0,
73219
+ totalTokens: 0,
73220
+ apiDurationMs: 0
73221
+ };
73222
+ }
73223
+ __name(createEmptyTotals, "createEmptyTotals");
73224
+ function addRecordToTotals(totals, record) {
73225
+ totals.requests += 1;
73226
+ totals.inputTokens += record.inputTokens;
73227
+ totals.outputTokens += record.outputTokens;
73228
+ totals.cachedTokens += record.cachedTokens;
73229
+ totals.thoughtsTokens += record.thoughtsTokens;
73230
+ totals.totalTokens += record.totalTokens;
73231
+ totals.apiDurationMs += record.apiDurationMs;
73232
+ }
73233
+ __name(addRecordToTotals, "addRecordToTotals");
73234
+ function getLocalDateParts(date) {
73235
+ const year = date.getFullYear();
73236
+ const monthNumber = String(date.getMonth() + 1).padStart(2, "0");
73237
+ const day = String(date.getDate()).padStart(2, "0");
73238
+ return {
73239
+ date: `${year}-${monthNumber}-${day}`,
73240
+ month: `${year}-${monthNumber}`
73241
+ };
73242
+ }
73243
+ __name(getLocalDateParts, "getLocalDateParts");
73244
+ function currentPeriodValue(period) {
73245
+ const parts = getLocalDateParts(/* @__PURE__ */ new Date());
73246
+ return period === "day" ? parts.date : parts.month;
73247
+ }
73248
+ __name(currentPeriodValue, "currentPeriodValue");
73249
+ function isValidDay(value) {
73250
+ const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(value);
73251
+ if (!match) {
73252
+ return false;
73253
+ }
73254
+ const year = Number(match[1]);
73255
+ const month = Number(match[2]);
73256
+ const day = Number(match[3]);
73257
+ if (month < 1 || month > 12 || day < 1) {
73258
+ return false;
73259
+ }
73260
+ const daysInMonth = [
73261
+ 31,
73262
+ isLeapYear(year) ? 29 : 28,
73263
+ 31,
73264
+ 30,
73265
+ 31,
73266
+ 30,
73267
+ 31,
73268
+ 31,
73269
+ 30,
73270
+ 31,
73271
+ 30,
73272
+ 31
73273
+ ];
73274
+ return day <= daysInMonth[month - 1];
73275
+ }
73276
+ __name(isValidDay, "isValidDay");
73277
+ function isValidMonth(value) {
73278
+ const match = /^(\d{4})-(\d{2})$/.exec(value);
73279
+ if (!match) {
73280
+ return false;
73281
+ }
73282
+ const month = Number(match[2]);
73283
+ return month >= 1 && month <= 12;
73284
+ }
73285
+ __name(isValidMonth, "isValidMonth");
73286
+ function isLeapYear(year) {
73287
+ return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
73288
+ }
73289
+ __name(isLeapYear, "isLeapYear");
73290
+ function normalizePeriodValue(period, value) {
73291
+ const normalized = value?.trim() || currentPeriodValue(period);
73292
+ const isValid = period === "day" ? isValidDay(normalized) : isValidMonth(normalized);
73293
+ if (!isValid) {
73294
+ throw new Error(
73295
+ `Invalid ${period} value "${normalized}". Expected ${period === "day" ? "YYYY-MM-DD" : "YYYY-MM"}.`
73296
+ );
73297
+ }
73298
+ return normalized;
73299
+ }
73300
+ __name(normalizePeriodValue, "normalizePeriodValue");
73301
+ function usageDir() {
73302
+ return path9.join(Storage.getRuntimeBaseDir(), USAGE_DIR_NAME);
73303
+ }
73304
+ __name(usageDir, "usageDir");
73305
+ function getTokenUsageFilePath(month) {
73306
+ if (!isValidMonth(month)) {
73307
+ throw new Error(`Invalid month value "${month}". Expected YYYY-MM.`);
73308
+ }
73309
+ return path9.join(usageDir(), `${FILE_PREFIX}${month}${FILE_EXTENSION}`);
73310
+ }
73311
+ __name(getTokenUsageFilePath, "getTokenUsageFilePath");
73312
+ function toNonNegativeInteger(value) {
73313
+ if (!Number.isFinite(value) || value === void 0 || value <= 0) {
73314
+ return 0;
73315
+ }
73316
+ return Math.trunc(value);
73317
+ }
73318
+ __name(toNonNegativeInteger, "toNonNegativeInteger");
73319
+ function calculateInputTokens(event) {
73320
+ const inputTokens = toNonNegativeInteger(event.input_token_count);
73321
+ if (inputTokens > 0) {
73322
+ return inputTokens;
73323
+ }
73324
+ return toNonNegativeInteger(event.cached_content_token_count);
73325
+ }
73326
+ __name(calculateInputTokens, "calculateInputTokens");
73327
+ function calculateTotalTokens(event) {
73328
+ const total = toNonNegativeInteger(event.total_token_count);
73329
+ if (total > 0) {
73330
+ return total;
73331
+ }
73332
+ return calculateInputTokens(event) + toNonNegativeInteger(event.output_token_count) + toNonNegativeInteger(event.thoughts_token_count);
73333
+ }
73334
+ __name(calculateTotalTokens, "calculateTotalTokens");
73335
+ function apiResponseEventToTokenUsageRecord(config, event) {
73336
+ const timestamp = event["event.timestamp"] || (/* @__PURE__ */ new Date()).toISOString();
73337
+ const date = new Date(timestamp);
73338
+ const localParts = getLocalDateParts(
73339
+ Number.isNaN(date.getTime()) ? /* @__PURE__ */ new Date() : date
73340
+ );
73341
+ return {
73342
+ schemaVersion: SCHEMA_VERSION,
73343
+ id: randomUUID(),
73344
+ timestamp,
73345
+ localDate: localParts.date,
73346
+ localMonth: localParts.month,
73347
+ sessionId: config.getSessionId(),
73348
+ model: event.model || "unknown",
73349
+ authType: event.auth_type || UNKNOWN_AUTH_TYPE,
73350
+ source: event.subagent_name || MAIN_SOURCE,
73351
+ inputTokens: calculateInputTokens(event),
73352
+ outputTokens: toNonNegativeInteger(event.output_token_count),
73353
+ cachedTokens: toNonNegativeInteger(event.cached_content_token_count),
73354
+ thoughtsTokens: toNonNegativeInteger(event.thoughts_token_count),
73355
+ totalTokens: calculateTotalTokens(event),
73356
+ apiDurationMs: toNonNegativeInteger(event.duration_ms)
73357
+ };
73358
+ }
73359
+ __name(apiResponseEventToTokenUsageRecord, "apiResponseEventToTokenUsageRecord");
73360
+ function isTokenUsageRecord(value) {
73361
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
73362
+ return false;
73363
+ }
73364
+ const record = value;
73365
+ return typeof record.id === "string" && typeof record.sessionId === "string" && typeof record.schemaVersion === "number" && Number.isInteger(record.schemaVersion) && record.schemaVersion > 0 && record.schemaVersion <= SCHEMA_VERSION && typeof record.timestamp === "string" && typeof record.localDate === "string" && typeof record.localMonth === "string" && typeof record.model === "string" && typeof record.authType === "string" && typeof record.source === "string" && typeof record.inputTokens === "number" && typeof record.outputTokens === "number" && typeof record.cachedTokens === "number" && typeof record.thoughtsTokens === "number" && typeof record.totalTokens === "number" && typeof record.apiDurationMs === "number";
73366
+ }
73367
+ __name(isTokenUsageRecord, "isTokenUsageRecord");
73368
+ async function readRecordsForMonth(month) {
73369
+ const filePath = getTokenUsageFilePath(month);
73370
+ const records = await read(filePath, {
73371
+ throwOnNonEnoentError: true
73372
+ });
73373
+ const valid = [];
73374
+ let dropped = 0;
73375
+ for (const record of records) {
73376
+ if (isTokenUsageRecord(record)) {
73377
+ valid.push(record);
73378
+ } else {
73379
+ dropped++;
73380
+ }
73381
+ }
73382
+ if (dropped > 0) {
73383
+ debugLogger13.warn(
73384
+ `Dropped ${dropped}/${records.length} invalid record(s) from ${filePath}`
73385
+ );
73386
+ }
73387
+ return valid;
73388
+ }
73389
+ __name(readRecordsForMonth, "readRecordsForMonth");
73390
+ function summarizeRecords(period, value, records) {
73391
+ const totals = createEmptyTotals();
73392
+ const byModel = /* @__PURE__ */ new Map();
73393
+ const byAuthType = /* @__PURE__ */ new Map();
73394
+ const byModelAndAuthType = /* @__PURE__ */ new Map();
73395
+ const bySource = /* @__PURE__ */ new Map();
73396
+ const getGroup = /* @__PURE__ */ __name((map, key, fields) => {
73397
+ let group = map.get(key);
73398
+ if (!group) {
73399
+ group = {
73400
+ key,
73401
+ ...fields,
73402
+ ...createEmptyTotals()
73403
+ };
73404
+ map.set(key, group);
73405
+ }
73406
+ return group;
73407
+ }, "getGroup");
73408
+ for (const record of records) {
73409
+ addRecordToTotals(totals, record);
73410
+ addRecordToTotals(
73411
+ getGroup(byModel, record.model, { model: record.model }),
73412
+ record
73413
+ );
73414
+ addRecordToTotals(
73415
+ getGroup(byAuthType, record.authType, { authType: record.authType }),
73416
+ record
73417
+ );
73418
+ addRecordToTotals(
73419
+ getGroup(byModelAndAuthType, `${record.model}|${record.authType}`, {
73420
+ model: record.model,
73421
+ authType: record.authType
73422
+ }),
73423
+ record
73424
+ );
73425
+ addRecordToTotals(
73426
+ getGroup(bySource, record.source, { source: record.source }),
73427
+ record
73428
+ );
73429
+ }
73430
+ const sortGroups = /* @__PURE__ */ __name((groups) => [...groups].sort((a, b) => {
73431
+ if (b.totalTokens !== a.totalTokens) {
73432
+ return b.totalTokens - a.totalTokens;
73433
+ }
73434
+ return a.key.localeCompare(b.key);
73435
+ }), "sortGroups");
73436
+ return {
73437
+ period,
73438
+ value,
73439
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString(),
73440
+ totals,
73441
+ byModel: sortGroups(byModel.values()),
73442
+ byAuthType: sortGroups(byAuthType.values()),
73443
+ byModelAndAuthType: sortGroups(byModelAndAuthType.values()),
73444
+ bySource: sortGroups(bySource.values())
73445
+ };
73446
+ }
73447
+ __name(summarizeRecords, "summarizeRecords");
73448
+ async function recordTokenUsageFromApiResponse(config, event) {
73449
+ const record = apiResponseEventToTokenUsageRecord(config, event);
73450
+ await writeLine(getTokenUsageFilePath(record.localMonth), record);
73451
+ }
73452
+ __name(recordTokenUsageFromApiResponse, "recordTokenUsageFromApiResponse");
73453
+ var lastLoggedTimeByCode = /* @__PURE__ */ new Map();
73454
+ var suppressedCountByCode = /* @__PURE__ */ new Map();
73455
+ var TOKEN_USAGE_FAILURE_LOG_COOLDOWN_MS = 6e4;
73456
+ var _now = /* @__PURE__ */ __name(() => Date.now(), "_now");
73457
+ function logTokenUsageWriteFailure(error) {
73458
+ debugLogger13.warn("Failed to record token usage:", error);
73459
+ const code = error.code;
73460
+ if (code && code !== "ENOENT") {
73461
+ const now = _now();
73462
+ const lastTime = lastLoggedTimeByCode.get(code) ?? 0;
73463
+ if (now - lastTime > TOKEN_USAGE_FAILURE_LOG_COOLDOWN_MS) {
73464
+ lastLoggedTimeByCode.set(code, now);
73465
+ const suppressedCount = suppressedCountByCode.get(code) ?? 0;
73466
+ suppressedCountByCode.delete(code);
73467
+ const message = error instanceof Error ? error.message : String(error);
73468
+ console.error(
73469
+ `[token-usage] Write failed (${code}):`,
73470
+ suppressedCount > 0 ? `${message} (${suppressedCount} similar suppressed since last log)` : message
73471
+ );
73472
+ } else {
73473
+ suppressedCountByCode.set(
73474
+ code,
73475
+ (suppressedCountByCode.get(code) ?? 0) + 1
73476
+ );
73477
+ }
73478
+ }
73479
+ }
73480
+ __name(logTokenUsageWriteFailure, "logTokenUsageWriteFailure");
73481
+ function recordTokenUsageFromApiResponseBestEffort(config, event) {
73482
+ try {
73483
+ const record = apiResponseEventToTokenUsageRecord(config, event);
73484
+ void writeLine(getTokenUsageFilePath(record.localMonth), record).catch(logTokenUsageWriteFailure);
73485
+ } catch (error) {
73486
+ logTokenUsageWriteFailure(error);
73487
+ }
73488
+ }
73489
+ __name(recordTokenUsageFromApiResponseBestEffort, "recordTokenUsageFromApiResponseBestEffort");
73490
+ async function queryTokenUsage(query) {
73491
+ const value = normalizePeriodValue(query.period, query.value);
73492
+ const month = query.period === "day" ? value.slice(0, 7) : value;
73493
+ const records = (await readRecordsForMonth(month)).filter(
73494
+ (record) => query.period === "day" ? record.localDate === value : record.localMonth === value
73495
+ );
73496
+ return summarizeRecords(query.period, value, records);
73497
+ }
73498
+ __name(queryTokenUsage, "queryTokenUsage");
73499
+ function csvEscape(value) {
73500
+ const stringValue = value === void 0 ? "" : String(value);
73501
+ const trimmed = stringValue.trimStart();
73502
+ const sanitized = /^[=+\-@]/.test(trimmed) || /^[\t\r\n]/.test(stringValue) ? `'${stringValue}` : stringValue;
73503
+ if (/[",\n\r]/.test(sanitized)) {
73504
+ return `"${sanitized.replace(/"/g, '""')}"`;
73505
+ }
73506
+ return sanitized;
73507
+ }
73508
+ __name(csvEscape, "csvEscape");
73509
+ function groupRows(period, value, groupType, groups) {
73510
+ return groups.map((group) => [
73511
+ period,
73512
+ value,
73513
+ groupType,
73514
+ group.key,
73515
+ group.model ?? "",
73516
+ group.authType ?? "",
73517
+ group.source ?? "",
73518
+ String(group.requests),
73519
+ String(group.inputTokens),
73520
+ String(group.outputTokens),
73521
+ String(group.cachedTokens),
73522
+ String(group.thoughtsTokens),
73523
+ String(group.totalTokens),
73524
+ String(group.apiDurationMs)
73525
+ ]);
73526
+ }
73527
+ __name(groupRows, "groupRows");
73528
+ function formatTokenUsageSummaryAsCsv(summary) {
73529
+ const header = [
73530
+ "period",
73531
+ "value",
73532
+ "group_type",
73533
+ "group_key",
73534
+ "model",
73535
+ "auth_type",
73536
+ "source",
73537
+ "requests",
73538
+ "input_tokens",
73539
+ "output_tokens",
73540
+ "cached_tokens",
73541
+ "thoughts_tokens",
73542
+ "total_tokens",
73543
+ "api_duration_ms"
73544
+ ];
73545
+ const rows = [
73546
+ [
73547
+ summary.period,
73548
+ summary.value,
73549
+ "total",
73550
+ "total",
73551
+ "",
73552
+ "",
73553
+ "",
73554
+ String(summary.totals.requests),
73555
+ String(summary.totals.inputTokens),
73556
+ String(summary.totals.outputTokens),
73557
+ String(summary.totals.cachedTokens),
73558
+ String(summary.totals.thoughtsTokens),
73559
+ String(summary.totals.totalTokens),
73560
+ String(summary.totals.apiDurationMs)
73561
+ ],
73562
+ ...groupRows(summary.period, summary.value, "model", summary.byModel),
73563
+ ...groupRows(
73564
+ summary.period,
73565
+ summary.value,
73566
+ "auth_type",
73567
+ summary.byAuthType
73568
+ ),
73569
+ ...groupRows(
73570
+ summary.period,
73571
+ summary.value,
73572
+ "model_auth_type",
73573
+ summary.byModelAndAuthType
73574
+ ),
73575
+ ...groupRows(summary.period, summary.value, "source", summary.bySource)
73576
+ ];
73577
+ return [
73578
+ header.join(","),
73579
+ ...rows.map((row) => row.map(csvEscape).join(","))
73580
+ ].join("\n");
73581
+ }
73582
+ __name(formatTokenUsageSummaryAsCsv, "formatTokenUsageSummaryAsCsv");
73583
+ function formatTokenUsageSummaryAsJson(summary) {
73584
+ return `${JSON.stringify(summary, null, 2)}
73585
+ `;
73586
+ }
73587
+ __name(formatTokenUsageSummaryAsJson, "formatTokenUsageSummaryAsJson");
73588
+ async function exportTokenUsageSummary(options) {
73589
+ const summary = await queryTokenUsage(options);
73590
+ return options.format === "json" ? formatTokenUsageSummaryAsJson(summary) : `${formatTokenUsageSummaryAsCsv(summary)}
73591
+ `;
73592
+ }
73593
+ __name(exportTokenUsageSummary, "exportTokenUsageSummary");
73594
+
72873
73595
  // packages/core/src/telemetry/loggers.ts
72874
73596
  var shouldLogUserPrompts = /* @__PURE__ */ __name((config) => config.getTelemetryLogPromptsEnabled(), "shouldLogUserPrompts");
72875
73597
  function getCommonAttributes(config) {
@@ -73168,6 +73890,9 @@ function logApiResponse(config, event) {
73168
73890
  };
73169
73891
  uiTelemetryService.addEvent(uiEvent, config.getSessionId());
73170
73892
  if (!isInternalPromptId(event.prompt_id)) {
73893
+ if (config.getUsageStatisticsEnabled()) {
73894
+ recordTokenUsageFromApiResponseBestEffort(config, event);
73895
+ }
73171
73896
  config.getChatRecordingService()?.recordUiTelemetryEvent(uiEvent);
73172
73897
  }
73173
73898
  QwenLogger.getInstance(config)?.logApiResponseEvent(event);
@@ -73665,6 +74390,9 @@ function logPromptSuggestion(config, event) {
73665
74390
  if (event.accept_method) {
73666
74391
  attributes["accept_method"] = event.accept_method;
73667
74392
  }
74393
+ if (event.accept_source) {
74394
+ attributes["accept_source"] = event.accept_source;
74395
+ }
73668
74396
  if (event.time_to_accept_ms !== void 0) {
73669
74397
  attributes["time_to_accept_ms"] = event.time_to_accept_ms;
73670
74398
  }
@@ -73822,7 +74550,7 @@ function memoryFreshnessNote(mtimeMs) {
73822
74550
  __name(memoryFreshnessNote, "memoryFreshnessNote");
73823
74551
 
73824
74552
  // packages/core/src/tools/read-file.ts
73825
- var debugLogger12 = createDebugLogger("READ_FILE_CACHE");
74553
+ var debugLogger14 = createDebugLogger("READ_FILE_CACHE");
73826
74554
  var ReadFileToolInvocation = class extends BaseToolInvocation {
73827
74555
  constructor(config, params) {
73828
74556
  super(params);
@@ -73858,13 +74586,13 @@ var ReadFileToolInvocation = class extends BaseToolInvocation {
73858
74586
  * so that external file reads require user confirmation.
73859
74587
  */
73860
74588
  async getDefaultPermission() {
73861
- const filePath = path7.resolve(this.params.file_path);
74589
+ const filePath = path10.resolve(this.params.file_path);
73862
74590
  const workspaceContext = this.config.getWorkspaceContext();
73863
74591
  const allowedRoots = [
73864
74592
  this.config.storage.getProjectTempDir(),
73865
74593
  // Background subagent transcripts live under <projectDir>/subagents/ and
73866
74594
  // are advertised to the model as polling targets via read_file.
73867
- path7.join(this.config.storage.getProjectDir(), "subagents"),
74595
+ path10.join(this.config.storage.getProjectDir(), "subagents"),
73868
74596
  Storage.getGlobalTempDir(),
73869
74597
  os4.tmpdir(),
73870
74598
  ...this.config.storage.getUserSkillsDirs(),
@@ -73880,7 +74608,7 @@ var ReadFileToolInvocation = class extends BaseToolInvocation {
73880
74608
  return "ask";
73881
74609
  }
73882
74610
  async execute() {
73883
- const absPath = path7.resolve(this.params.file_path);
74611
+ const absPath = path10.resolve(this.params.file_path);
73884
74612
  const projectRoot = this.config.getTargetDir();
73885
74613
  const isAutoMem = isAnyAutoMemPath(absPath, projectRoot);
73886
74614
  const cacheEnabled = !this.config.getFileReadCacheDisabled();
@@ -73889,9 +74617,9 @@ var ReadFileToolInvocation = class extends BaseToolInvocation {
73889
74617
  const isFullRead = this.params.offset === void 0 && this.params.limit === void 0 && this.params.pages === void 0;
73890
74618
  let stats;
73891
74619
  try {
73892
- stats = await fs7.stat(absPath);
74620
+ stats = await fs8.stat(absPath);
73893
74621
  } catch (err) {
73894
- debugLogger12.debug("stat-failed", {
74622
+ debugLogger14.debug("stat-failed", {
73895
74623
  path: absPath,
73896
74624
  code: err.code
73897
74625
  });
@@ -73901,10 +74629,10 @@ var ReadFileToolInvocation = class extends BaseToolInvocation {
73901
74629
  if (status.state === "fresh" && status.entry.lastReadAt !== void 0 && status.entry.lastReadWasFull && status.entry.lastReadCacheable && // Only quote-back if that read is still in history (issue
73902
74630
  // #4239: idle microcompaction flips this off when it blanks it).
73903
74631
  status.entry.readResidentInHistory && (status.entry.lastWriteAt === void 0 || status.entry.lastReadAt > status.entry.lastWriteAt)) {
73904
- debugLogger12.debug("hit", { path: absPath });
74632
+ debugLogger14.debug("hit", { path: absPath });
73905
74633
  return this.unchangedResult(absPath);
73906
74634
  }
73907
- debugLogger12.debug("miss", { path: absPath, state: status.state });
74635
+ debugLogger14.debug("miss", { path: absPath, state: status.state });
73908
74636
  }
73909
74637
  const result = await processSingleFileContent(
73910
74638
  this.params.file_path,
@@ -73945,7 +74673,7 @@ ${result.llmContent}`;
73945
74673
  }
73946
74674
  if (typeof llmContent === "string" && isAutoMem) {
73947
74675
  try {
73948
- const memStat = stats ?? await fs7.stat(absPath);
74676
+ const memStat = stats ?? await fs8.stat(absPath);
73949
74677
  const note = memoryFreshnessNote(memStat.mtimeMs);
73950
74678
  if (note) {
73951
74679
  llmContent = note + llmContent;
@@ -73965,7 +74693,7 @@ ${result.llmContent}`;
73965
74693
  "read" /* READ */,
73966
74694
  lines,
73967
74695
  mimetype,
73968
- path7.extname(this.params.file_path),
74696
+ path10.extname(this.params.file_path),
73969
74697
  programming_language
73970
74698
  )
73971
74699
  );
@@ -74056,7 +74784,7 @@ var ReadFileTool = class _ReadFileTool extends BaseDeclarativeTool {
74056
74784
  if (!filePath) {
74057
74785
  return "The 'file_path' parameter must be non-empty.";
74058
74786
  }
74059
- if (!path7.isAbsolute(filePath)) {
74787
+ if (!path10.isAbsolute(filePath)) {
74060
74788
  return `File path must be absolute, but was relative: ${filePath}. You must provide an absolute path.`;
74061
74789
  }
74062
74790
  if (params.offset !== void 0 && params.offset < 0) {
@@ -74069,7 +74797,7 @@ var ReadFileTool = class _ReadFileTool extends BaseDeclarativeTool {
74069
74797
  const pages = params.pages.trim();
74070
74798
  params.pages = pages.length > 0 ? pages : void 0;
74071
74799
  }
74072
- const ext = path7.extname(filePath).toLowerCase();
74800
+ const ext = path10.extname(filePath).toLowerCase();
74073
74801
  if ((params.offset !== void 0 || params.limit !== void 0) && ext === ".ipynb") {
74074
74802
  return "offset and limit are not supported for Jupyter notebook (.ipynb) files. Notebooks are always read in full with structured cell output.";
74075
74803
  }
@@ -74230,6 +74958,24 @@ export {
74230
74958
  refreshSessionContext,
74231
74959
  shutdownTelemetry,
74232
74960
  forceFlushMetrics,
74961
+ _recoverObjectsFromLine,
74962
+ parseLineTolerant,
74963
+ readLines,
74964
+ read,
74965
+ _resetEnsuredDirsCacheForTest,
74966
+ writeLine,
74967
+ writeLineSync,
74968
+ write,
74969
+ countLines,
74970
+ exists,
74971
+ getTokenUsageFilePath,
74972
+ apiResponseEventToTokenUsageRecord,
74973
+ recordTokenUsageFromApiResponse,
74974
+ recordTokenUsageFromApiResponseBestEffort,
74975
+ queryTokenUsage,
74976
+ formatTokenUsageSummaryAsCsv,
74977
+ formatTokenUsageSummaryAsJson,
74978
+ exportTokenUsageSummary,
74233
74979
  logStartSession,
74234
74980
  logUserPrompt,
74235
74981
  logUserRetry,
@@ -74280,6 +75026,13 @@ export {
74280
75026
  truncateLlmContent,
74281
75027
  isAlreadyTruncated,
74282
75028
  persistAndTruncateToolResult,
75029
+ MCPServerStatus,
75030
+ addMCPStatusChangeListener,
75031
+ removeMCPStatusChangeListener,
75032
+ updateMCPServerStatus,
75033
+ removeMCPServerStatus,
75034
+ getMCPServerStatus,
75035
+ getAllMCPServerStatuses,
74283
75036
  DiscoveredMCPTool,
74284
75037
  generateValidName,
74285
75038
  StartSessionEvent,