@sentry/mcp-server 0.18.0 → 0.19.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 (809) hide show
  1. package/README.md +19 -10
  2. package/dist/{agent-DD6nYWBQ.d.cts → agent-ADO0sPxf.d.cts} +2 -2
  3. package/dist/{agent-DD6nYWBQ.d.cts.map → agent-ADO0sPxf.d.cts.map} +1 -1
  4. package/dist/{agent-DAlB2lDx.d.cts → agent-BA98dlM7.d.cts} +2 -2
  5. package/dist/{agent-DAlB2lDx.d.cts.map → agent-BA98dlM7.d.cts.map} +1 -1
  6. package/dist/{agent-CP5e4nTv.js → agent-BL7Xae0U.js} +6 -6
  7. package/dist/{agent-CP5e4nTv.js.map → agent-BL7Xae0U.js.map} +1 -1
  8. package/dist/{agent-D9xBrLvD.cjs → agent-CbJ6lvV3.cjs} +5 -5
  9. package/dist/{agent-D9xBrLvD.cjs.map → agent-CbJ6lvV3.cjs.map} +1 -1
  10. package/dist/{agent-BF4d0oSb.cjs → agent-D7MuFRwE.cjs} +6 -6
  11. package/dist/{agent-BF4d0oSb.cjs.map → agent-D7MuFRwE.cjs.map} +1 -1
  12. package/dist/{agent-xEtb_OFK.d.ts → agent-D9DV11tZ.d.ts} +4 -4
  13. package/dist/{agent-xEtb_OFK.d.ts.map → agent-D9DV11tZ.d.ts.map} +1 -1
  14. package/dist/{agent-DzpIyyqs.js → agent-DXya3Bcy.js} +5 -5
  15. package/dist/{agent-DzpIyyqs.js.map → agent-DXya3Bcy.js.map} +1 -1
  16. package/dist/{agent-UxF0J0wb.d.ts → agent-DhHtOQmP.d.ts} +6 -6
  17. package/dist/{agent-UxF0J0wb.d.ts.map → agent-DhHtOQmP.d.ts.map} +1 -1
  18. package/dist/{analyze-issue-with-seer-Cf0jCiKP.cjs → analyze-issue-with-seer-CI8pvCnf.cjs} +16 -11
  19. package/dist/analyze-issue-with-seer-CI8pvCnf.cjs.map +1 -0
  20. package/dist/{analyze-issue-with-seer-DqwczSTV.js → analyze-issue-with-seer-DvuKEcbu.js} +16 -11
  21. package/dist/analyze-issue-with-seer-DvuKEcbu.js.map +1 -0
  22. package/dist/{api-D9yO5I-i.cjs → api-CZD9zwQ-.cjs} +4 -4
  23. package/dist/{api-D9yO5I-i.cjs.map → api-CZD9zwQ-.cjs.map} +1 -1
  24. package/dist/{api-mjnGhOW2.js → api-CkLTFexT.js} +4 -4
  25. package/dist/{api-mjnGhOW2.js.map → api-CkLTFexT.js.map} +1 -1
  26. package/dist/api-client/client.cjs +5 -4
  27. package/dist/api-client/client.d.cts +3 -3
  28. package/dist/api-client/client.d.ts +3 -3
  29. package/dist/api-client/client.js +5 -4
  30. package/dist/api-client/errors.cjs +1 -1
  31. package/dist/api-client/errors.d.ts +1 -1
  32. package/dist/api-client/errors.js +1 -1
  33. package/dist/api-client/index.cjs +8 -6
  34. package/dist/api-client/index.d.cts +4 -4
  35. package/dist/api-client/index.d.ts +6 -6
  36. package/dist/api-client/index.js +8 -7
  37. package/dist/api-client/schema.cjs +2 -1
  38. package/dist/api-client/schema.d.cts +2 -2
  39. package/dist/api-client/schema.d.ts +2 -2
  40. package/dist/api-client/schema.js +2 -2
  41. package/dist/api-client/types.cjs +1 -1
  42. package/dist/api-client/types.d.cts +3 -3
  43. package/dist/api-client/types.d.ts +3 -3
  44. package/dist/api-client/types.js +1 -1
  45. package/dist/{callEmbeddedAgent-C0pC9du1.js → callEmbeddedAgent-B_BMEB_u.js} +3 -3
  46. package/dist/callEmbeddedAgent-B_BMEB_u.js.map +1 -0
  47. package/dist/{callEmbeddedAgent-BRz60bxa.cjs → callEmbeddedAgent-BaGxBAdM.cjs} +3 -3
  48. package/dist/callEmbeddedAgent-BaGxBAdM.cjs.map +1 -0
  49. package/dist/cli/parse.cjs +1 -1
  50. package/dist/cli/parse.d.cts +2 -2
  51. package/dist/cli/parse.d.cts.map +1 -1
  52. package/dist/cli/parse.d.ts +2 -2
  53. package/dist/cli/parse.d.ts.map +1 -1
  54. package/dist/cli/parse.js +1 -1
  55. package/dist/cli/resolve.cjs +3 -3
  56. package/dist/cli/resolve.d.cts +2 -2
  57. package/dist/cli/resolve.d.cts.map +1 -1
  58. package/dist/cli/resolve.d.ts +2 -2
  59. package/dist/cli/resolve.d.ts.map +1 -1
  60. package/dist/cli/resolve.js +3 -3
  61. package/dist/cli/types.d.cts +2 -2
  62. package/dist/cli/types.d.ts +2 -2
  63. package/dist/cli/usage.cjs +1 -1
  64. package/dist/cli/usage.d.cts +1 -1
  65. package/dist/cli/usage.d.ts +1 -1
  66. package/dist/cli/usage.js +1 -1
  67. package/dist/{client-AVVG7J24.cjs → client-C2TwbSm-.cjs} +75 -19
  68. package/dist/client-C2TwbSm-.cjs.map +1 -0
  69. package/dist/{client-BqrNpqZW.js → client-CWgvrDHH.js} +75 -19
  70. package/dist/client-CWgvrDHH.js.map +1 -0
  71. package/dist/{client-B0wezrpt.d.cts → client-C_fNdaX8.d.cts} +23 -11
  72. package/dist/client-C_fNdaX8.d.cts.map +1 -0
  73. package/dist/{client-D-KqRd94.d.ts → client-VVhTv_ej.d.ts} +24 -12
  74. package/dist/client-VVhTv_ej.d.ts.map +1 -0
  75. package/dist/{config-CqdBCqLx.js → config-BMC-126h.js} +1 -1
  76. package/dist/{config-CqdBCqLx.js.map → config-BMC-126h.js.map} +1 -1
  77. package/dist/{config-DsvSjPCG.cjs → config-CllFlx5w.cjs} +1 -1
  78. package/dist/{config-DsvSjPCG.cjs.map → config-CllFlx5w.cjs.map} +1 -1
  79. package/dist/{config-DFt-16ni.cjs → config-DbQP60oo.cjs} +1 -1
  80. package/dist/{config-DFt-16ni.cjs.map → config-DbQP60oo.cjs.map} +1 -1
  81. package/dist/{config-DDf8XyZs.js → config-DlhHLHjD.js} +1 -1
  82. package/dist/{config-DDf8XyZs.js.map → config-DlhHLHjD.js.map} +1 -1
  83. package/dist/constraint-helpers-Bey-Pii6.js +64 -0
  84. package/dist/constraint-helpers-Bey-Pii6.js.map +1 -0
  85. package/dist/constraint-helpers-BqcuWXad.cjs +76 -0
  86. package/dist/constraint-helpers-BqcuWXad.cjs.map +1 -0
  87. package/dist/context-storage-B8onP4Pw.cjs +69 -0
  88. package/dist/context-storage-B8onP4Pw.cjs.map +1 -0
  89. package/dist/context-storage-BRwdNVKx.js +51 -0
  90. package/dist/context-storage-BRwdNVKx.js.map +1 -0
  91. package/dist/{create-dsn-BhshlP7l.js → create-dsn-Bx2s8Bik.js} +9 -4
  92. package/dist/create-dsn-Bx2s8Bik.js.map +1 -0
  93. package/dist/{create-dsn-DaHidLhE.cjs → create-dsn-ggGt0lZf.cjs} +9 -4
  94. package/dist/create-dsn-ggGt0lZf.cjs.map +1 -0
  95. package/dist/{create-project-C3laecaU.js → create-project-C0pm6zUK.js} +11 -6
  96. package/dist/create-project-C0pm6zUK.js.map +1 -0
  97. package/dist/{create-project-xszOpGTC.cjs → create-project-CZBklXm8.cjs} +11 -6
  98. package/dist/create-project-CZBklXm8.cjs.map +1 -0
  99. package/dist/{create-team-CTN-DxOE.js → create-team-BQIns3VD.js} +9 -4
  100. package/dist/create-team-BQIns3VD.js.map +1 -0
  101. package/dist/{create-team-DmnJHSIx.cjs → create-team-DmqKw2c1.cjs} +9 -4
  102. package/dist/create-team-DmqKw2c1.cjs.map +1 -0
  103. package/dist/{dataset-fields-DacS0qF0.cjs → dataset-fields-C0m-vwNH.cjs} +2 -2
  104. package/dist/{dataset-fields-DacS0qF0.cjs.map → dataset-fields-C0m-vwNH.cjs.map} +1 -1
  105. package/dist/{dataset-fields-By43SxJp.js → dataset-fields-C1o_cZrM.js} +2 -2
  106. package/dist/{dataset-fields-By43SxJp.js.map → dataset-fields-C1o_cZrM.js.map} +1 -1
  107. package/dist/{enhance-error-C7AVt85N.js → enhance-error-D3QfZOhm.js} +2 -2
  108. package/dist/{enhance-error-C7AVt85N.js.map → enhance-error-D3QfZOhm.js.map} +1 -1
  109. package/dist/{enhance-error-CAREhbDf.cjs → enhance-error-DzXrKg85.cjs} +2 -2
  110. package/dist/{enhance-error-CAREhbDf.cjs.map → enhance-error-DzXrKg85.cjs.map} +1 -1
  111. package/dist/{error-handling-qfa1BeDb.cjs → error-handling-CxV2m_Dr.cjs} +5 -5
  112. package/dist/error-handling-CxV2m_Dr.cjs.map +1 -0
  113. package/dist/{error-handling-efwohgKv.js → error-handling-R4SJQ7n0.js} +5 -5
  114. package/dist/error-handling-R4SJQ7n0.js.map +1 -0
  115. package/dist/{errors-CNTY5dED.cjs → errors-Bmqdg5Q6.cjs} +1 -1
  116. package/dist/{errors-CNTY5dED.cjs.map → errors-Bmqdg5Q6.cjs.map} +1 -1
  117. package/dist/{errors-Cn4l-BlC.d.ts → errors-Bvit2_Qs.d.ts} +1 -1
  118. package/dist/{errors-Cn4l-BlC.d.ts.map → errors-Bvit2_Qs.d.ts.map} +1 -1
  119. package/dist/{errors-Dr7Q6mD5.js → errors-CQZ-QlOB.js} +1 -1
  120. package/dist/{errors-Dr7Q6mD5.js.map → errors-CQZ-QlOB.js.map} +1 -1
  121. package/dist/{errors-bxPCd8AO.d.ts → errors-JbBt1G2l.d.ts} +1 -1
  122. package/dist/{errors-bxPCd8AO.d.ts.map → errors-JbBt1G2l.d.ts.map} +1 -1
  123. package/dist/errors.d.ts +1 -1
  124. package/dist/{fetch-utils-DRWItYjp.js → fetch-utils-BetJhSli.js} +1 -1
  125. package/dist/{fetch-utils-DRWItYjp.js.map → fetch-utils-BetJhSli.js.map} +1 -1
  126. package/dist/{fetch-utils-bHWZV7j9.cjs → fetch-utils-Cp3P-Ai3.cjs} +1 -1
  127. package/dist/{fetch-utils-bHWZV7j9.cjs.map → fetch-utils-Cp3P-Ai3.cjs.map} +1 -1
  128. package/dist/{find-dsns-U4CCcoTv.js → find-dsns-BPN8wnUr.js} +7 -3
  129. package/dist/find-dsns-BPN8wnUr.js.map +1 -0
  130. package/dist/{find-dsns-D0l3siyF.cjs → find-dsns-Ct6uFZMB.cjs} +7 -3
  131. package/dist/find-dsns-Ct6uFZMB.cjs.map +1 -0
  132. package/dist/{find-organizations-Ca-zpAlI.cjs → find-organizations-BGI_WW2q.cjs} +18 -7
  133. package/dist/find-organizations-BGI_WW2q.cjs.map +1 -0
  134. package/dist/{find-organizations-HUZFa8ZA.js → find-organizations-DxH9SS3w.js} +18 -7
  135. package/dist/find-organizations-DxH9SS3w.js.map +1 -0
  136. package/dist/{find-projects-CWNLthwg.cjs → find-projects-B80qSPpP.cjs} +19 -8
  137. package/dist/find-projects-B80qSPpP.cjs.map +1 -0
  138. package/dist/{find-projects-Dy1_O9L0.js → find-projects-DOMBBYAP.js} +19 -8
  139. package/dist/find-projects-DOMBBYAP.js.map +1 -0
  140. package/dist/{find-releases-DN_BfQM2.js → find-releases-CfZRMBvh.js} +8 -4
  141. package/dist/find-releases-CfZRMBvh.js.map +1 -0
  142. package/dist/{find-releases-BtazPcQH.cjs → find-releases-Cy-Q-Qje.cjs} +8 -4
  143. package/dist/find-releases-Cy-Q-Qje.cjs.map +1 -0
  144. package/dist/{find-teams-_zAHPVGx.cjs → find-teams-BuH2ddaL.cjs} +19 -8
  145. package/dist/find-teams-BuH2ddaL.cjs.map +1 -0
  146. package/dist/find-teams-D5770X0I.js +51 -0
  147. package/dist/find-teams-D5770X0I.js.map +1 -0
  148. package/dist/{formatters-DJSiRyVi.js → formatters-B9XiCNZ_.js} +2 -2
  149. package/dist/{formatters-DJSiRyVi.js.map → formatters-B9XiCNZ_.js.map} +1 -1
  150. package/dist/{formatters-Bzx0sr5R.cjs → formatters-CkbVfXEE.cjs} +2 -2
  151. package/dist/{formatters-Bzx0sr5R.cjs.map → formatters-CkbVfXEE.cjs.map} +1 -1
  152. package/dist/{formatters-CCZdBmLd.cjs → formatters-DMlTJcHW.cjs} +2 -2
  153. package/dist/{formatters-CCZdBmLd.cjs.map → formatters-DMlTJcHW.cjs.map} +1 -1
  154. package/dist/{formatters-DJM9_F3A.js → formatters-MEWHZ83Y.js} +2 -2
  155. package/dist/{formatters-DJM9_F3A.js.map → formatters-MEWHZ83Y.js.map} +1 -1
  156. package/dist/{formatting-CfpTtZLo.js → formatting-CAQbf0su.js} +1 -1
  157. package/dist/{formatting-CfpTtZLo.js.map → formatting-CAQbf0su.js.map} +1 -1
  158. package/dist/{formatting-CqmsvuAY.cjs → formatting-Cu1Skk_Y.cjs} +444 -10
  159. package/dist/formatting-Cu1Skk_Y.cjs.map +1 -0
  160. package/dist/{formatting-BjCK9XwW.js → formatting-DytLf-hH.js} +444 -10
  161. package/dist/formatting-DytLf-hH.js.map +1 -0
  162. package/dist/{formatting-CJKoPqjy.cjs → formatting-EM76FrY3.cjs} +1 -1
  163. package/dist/{formatting-CJKoPqjy.cjs.map → formatting-EM76FrY3.cjs.map} +1 -1
  164. package/dist/{formatting-l3qx5d7L.d.ts → formatting-FJne_W9i.d.cts} +11 -6
  165. package/dist/formatting-FJne_W9i.d.cts.map +1 -0
  166. package/dist/{formatting-XMmhMjRz.d.cts → formatting-ar_6QZRE.d.ts} +11 -6
  167. package/dist/formatting-ar_6QZRE.d.ts.map +1 -0
  168. package/dist/{get-doc-JDwOkY2j.js → get-doc-D9Xq7et9.js} +8 -4
  169. package/dist/get-doc-D9Xq7et9.js.map +1 -0
  170. package/dist/{get-doc-Euz6NiM3.cjs → get-doc-MxWNTA8R.cjs} +8 -4
  171. package/dist/get-doc-MxWNTA8R.cjs.map +1 -0
  172. package/dist/{get-event-attachment-pIJmUfFE.js → get-event-attachment-B_BzSfcE.js} +7 -3
  173. package/dist/get-event-attachment-B_BzSfcE.js.map +1 -0
  174. package/dist/{get-event-attachment-DvpQ-dEP.cjs → get-event-attachment-CrtS0QRV.cjs} +7 -3
  175. package/dist/get-event-attachment-CrtS0QRV.cjs.map +1 -0
  176. package/dist/{get-issue-details-B1PDMmMY.js → get-issue-details-Bvw1Xi8I.js} +50 -10
  177. package/dist/get-issue-details-Bvw1Xi8I.js.map +1 -0
  178. package/dist/{get-issue-details-BH75EnNk.cjs → get-issue-details-DTQ-jXyu.cjs} +50 -10
  179. package/dist/get-issue-details-DTQ-jXyu.cjs.map +1 -0
  180. package/dist/{get-trace-details-CaK0JMf4.js → get-trace-details-BL5_jvgs.js} +7 -3
  181. package/dist/get-trace-details-BL5_jvgs.js.map +1 -0
  182. package/dist/{get-trace-details-Bksygq21.cjs → get-trace-details-iDp34mms.cjs} +7 -3
  183. package/dist/get-trace-details-iDp34mms.cjs.map +1 -0
  184. package/dist/{handler-DyBdUYam.js → handler-B08ITQl8.js} +10 -6
  185. package/dist/handler-B08ITQl8.js.map +1 -0
  186. package/dist/{handler-C0zOOLbO.cjs → handler-B7-KeBak.cjs} +10 -6
  187. package/dist/handler-B7-KeBak.cjs.map +1 -0
  188. package/dist/{handler-DSYbwPgv.d.cts → handler-BcRR_2MX.d.cts} +2 -2
  189. package/dist/{handler-DSYbwPgv.d.cts.map → handler-BcRR_2MX.d.cts.map} +1 -1
  190. package/dist/{handler-CcbbXK_f.d.ts → handler-CdSvAOl6.d.ts} +2 -2
  191. package/dist/{handler-CcbbXK_f.d.ts.map → handler-CdSvAOl6.d.ts.map} +1 -1
  192. package/dist/{handler-cy5oD28N.cjs → handler-DIiYPQGL.cjs} +11 -7
  193. package/dist/handler-DIiYPQGL.cjs.map +1 -0
  194. package/dist/{handler-RV4XhU8F.d.cts → handler-LaesAQaD.d.cts} +2 -2
  195. package/dist/{handler-RV4XhU8F.d.cts.map → handler-LaesAQaD.d.cts.map} +1 -1
  196. package/dist/{handler-BbqDy4DA.js → handler-nILS77E9.js} +11 -7
  197. package/dist/handler-nILS77E9.js.map +1 -0
  198. package/dist/{handler-Ct9Z_sTZ.d.ts → handler-uWae09YN.d.ts} +2 -2
  199. package/dist/{handler-Ct9Z_sTZ.d.ts.map → handler-uWae09YN.d.ts.map} +1 -1
  200. package/dist/index.cjs +72 -76
  201. package/dist/index.cjs.map +1 -1
  202. package/dist/index.js +71 -75
  203. package/dist/index.js.map +1 -1
  204. package/dist/internal/agents/callEmbeddedAgent.cjs +2 -1
  205. package/dist/internal/agents/callEmbeddedAgent.js +2 -1
  206. package/dist/internal/agents/openai-provider.cjs +4 -0
  207. package/dist/internal/agents/openai-provider.d.cts +24 -0
  208. package/dist/internal/agents/openai-provider.d.cts.map +1 -0
  209. package/dist/internal/agents/openai-provider.d.ts +24 -0
  210. package/dist/internal/agents/openai-provider.d.ts.map +1 -0
  211. package/dist/internal/agents/openai-provider.js +3 -0
  212. package/dist/internal/agents/tools/dataset-fields.cjs +9 -9
  213. package/dist/internal/agents/tools/dataset-fields.d.cts +7 -7
  214. package/dist/internal/agents/tools/dataset-fields.d.ts +9 -9
  215. package/dist/internal/agents/tools/dataset-fields.js +9 -9
  216. package/dist/internal/agents/tools/otel-semantics.cjs +9 -9
  217. package/dist/internal/agents/tools/otel-semantics.d.cts +7 -7
  218. package/dist/internal/agents/tools/otel-semantics.d.ts +9 -9
  219. package/dist/internal/agents/tools/otel-semantics.js +9 -9
  220. package/dist/internal/agents/tools/utils.cjs +8 -8
  221. package/dist/internal/agents/tools/utils.d.cts +1 -1
  222. package/dist/internal/agents/tools/utils.d.ts +1 -1
  223. package/dist/internal/agents/tools/utils.js +8 -8
  224. package/dist/internal/agents/tools/whoami.cjs +9 -9
  225. package/dist/internal/agents/tools/whoami.d.cts +7 -7
  226. package/dist/internal/agents/tools/whoami.d.ts +9 -9
  227. package/dist/internal/agents/tools/whoami.js +9 -9
  228. package/dist/internal/constraint-helpers.cjs +4 -0
  229. package/dist/internal/constraint-helpers.d.cts +53 -0
  230. package/dist/internal/constraint-helpers.d.cts.map +1 -0
  231. package/dist/internal/constraint-helpers.d.ts +53 -0
  232. package/dist/internal/constraint-helpers.d.ts.map +1 -0
  233. package/dist/internal/constraint-helpers.js +3 -0
  234. package/dist/internal/context-storage.cjs +5 -0
  235. package/dist/internal/context-storage.d.cts +48 -0
  236. package/dist/internal/context-storage.d.cts.map +1 -0
  237. package/dist/internal/context-storage.d.ts +48 -0
  238. package/dist/internal/context-storage.d.ts.map +1 -0
  239. package/dist/internal/context-storage.js +3 -0
  240. package/dist/internal/error-handling.cjs +8 -8
  241. package/dist/internal/error-handling.d.cts +3 -3
  242. package/dist/internal/error-handling.d.ts +6 -6
  243. package/dist/internal/error-handling.js +8 -8
  244. package/dist/internal/fetch-utils.cjs +1 -1
  245. package/dist/internal/fetch-utils.js +1 -1
  246. package/dist/internal/formatting.cjs +2 -2
  247. package/dist/internal/formatting.d.cts +4 -4
  248. package/dist/internal/formatting.d.ts +6 -6
  249. package/dist/internal/formatting.js +2 -2
  250. package/dist/internal/issue-helpers.cjs +1 -1
  251. package/dist/internal/issue-helpers.d.cts +1 -1
  252. package/dist/internal/issue-helpers.d.ts +1 -1
  253. package/dist/internal/issue-helpers.js +1 -1
  254. package/dist/internal/test-fixtures.cjs +12 -2
  255. package/dist/internal/test-fixtures.cjs.map +1 -1
  256. package/dist/internal/test-fixtures.d.cts +35 -2133
  257. package/dist/internal/test-fixtures.d.cts.map +1 -1
  258. package/dist/internal/test-fixtures.d.ts +35 -2133
  259. package/dist/internal/test-fixtures.d.ts.map +1 -1
  260. package/dist/internal/test-fixtures.js +12 -2
  261. package/dist/internal/test-fixtures.js.map +1 -1
  262. package/dist/internal/tool-helpers/api.cjs +9 -8
  263. package/dist/internal/tool-helpers/api.d.cts +5 -6
  264. package/dist/internal/tool-helpers/api.d.cts.map +1 -1
  265. package/dist/internal/tool-helpers/api.d.ts +7 -8
  266. package/dist/internal/tool-helpers/api.d.ts.map +1 -1
  267. package/dist/internal/tool-helpers/api.js +9 -8
  268. package/dist/internal/tool-helpers/define.d.cts +3 -4
  269. package/dist/internal/tool-helpers/define.d.cts.map +1 -1
  270. package/dist/internal/tool-helpers/define.d.ts +3 -4
  271. package/dist/internal/tool-helpers/define.d.ts.map +1 -1
  272. package/dist/internal/tool-helpers/enhance-error.cjs +8 -7
  273. package/dist/internal/tool-helpers/enhance-error.d.cts +3 -3
  274. package/dist/internal/tool-helpers/enhance-error.d.ts +5 -5
  275. package/dist/internal/tool-helpers/enhance-error.js +8 -7
  276. package/dist/internal/tool-helpers/formatting.cjs +1 -1
  277. package/dist/internal/tool-helpers/formatting.d.cts +3 -3
  278. package/dist/internal/tool-helpers/formatting.d.ts +5 -5
  279. package/dist/internal/tool-helpers/formatting.js +1 -1
  280. package/dist/internal/tool-helpers/issue.cjs +4 -4
  281. package/dist/internal/tool-helpers/issue.d.cts +5 -5
  282. package/dist/internal/tool-helpers/issue.d.ts +7 -7
  283. package/dist/internal/tool-helpers/issue.js +4 -4
  284. package/dist/internal/tool-helpers/seer.cjs +1 -1
  285. package/dist/internal/tool-helpers/seer.d.cts +3 -3
  286. package/dist/internal/tool-helpers/seer.d.ts +5 -5
  287. package/dist/internal/tool-helpers/seer.js +1 -1
  288. package/dist/internal/tool-helpers/validate-region-url.cjs +1 -1
  289. package/dist/internal/tool-helpers/validate-region-url.js +1 -1
  290. package/dist/{issue-helpers-Bjp6xu5H.js → issue-helpers-8Bubch8E.js} +1 -1
  291. package/dist/{issue-helpers-Bjp6xu5H.js.map → issue-helpers-8Bubch8E.js.map} +1 -1
  292. package/dist/{issue-helpers-Cf6mvHG1.d.cts → issue-helpers-CD46ia7_.d.cts} +1 -1
  293. package/dist/{issue-helpers-Cf6mvHG1.d.cts.map → issue-helpers-CD46ia7_.d.cts.map} +1 -1
  294. package/dist/{issue-helpers-1qxzc7ww.cjs → issue-helpers-DbPTv_qC.cjs} +1 -1
  295. package/dist/{issue-helpers-1qxzc7ww.cjs.map → issue-helpers-DbPTv_qC.cjs.map} +1 -1
  296. package/dist/{issue-helpers-kwhe1ipy.d.ts → issue-helpers-bECziPOG.d.ts} +1 -1
  297. package/dist/{issue-helpers-kwhe1ipy.d.ts.map → issue-helpers-bECziPOG.d.ts.map} +1 -1
  298. package/dist/logging-CDYnh7ho.d.cts +31 -0
  299. package/dist/logging-CDYnh7ho.d.cts.map +1 -0
  300. package/dist/logging-CkAJKyq2.cjs +298 -0
  301. package/dist/logging-CkAJKyq2.cjs.map +1 -0
  302. package/dist/logging-DqqDTe02.js +256 -0
  303. package/dist/logging-DqqDTe02.js.map +1 -0
  304. package/dist/logging-PY270KtN.d.ts +31 -0
  305. package/dist/logging-PY270KtN.d.ts.map +1 -0
  306. package/dist/openai-provider-BELCfis6.js +29 -0
  307. package/dist/openai-provider-BELCfis6.js.map +1 -0
  308. package/dist/openai-provider-CRxXeC9G.cjs +41 -0
  309. package/dist/openai-provider-CRxXeC9G.cjs.map +1 -0
  310. package/dist/{otel-semantics-BFRGhf6y.js → otel-semantics-CArUzarp.js} +2 -2
  311. package/dist/{otel-semantics-BFRGhf6y.js.map → otel-semantics-CArUzarp.js.map} +1 -1
  312. package/dist/{otel-semantics-CkUpXWEJ.cjs → otel-semantics-onvZv7i9.cjs} +2 -2
  313. package/dist/{otel-semantics-CkUpXWEJ.cjs.map → otel-semantics-onvZv7i9.cjs.map} +1 -1
  314. package/dist/{parse-C3tRlsy-.js → parse-8lpnm_2Z.js} +4 -1
  315. package/dist/parse-8lpnm_2Z.js.map +1 -0
  316. package/dist/{parse-CeFc4xnt.cjs → parse-shlhKlaL.cjs} +4 -1
  317. package/dist/parse-shlhKlaL.cjs.map +1 -0
  318. package/dist/{permissions-C-q0Y5bL.d.ts → permissions-40d2hxK-.d.ts} +2 -2
  319. package/dist/permissions-40d2hxK-.d.ts.map +1 -0
  320. package/dist/{permissions-Cm5e34n2.d.cts → permissions-B1meXGie.d.cts} +2 -2
  321. package/dist/permissions-B1meXGie.d.cts.map +1 -0
  322. package/dist/{permissions-DRdH39Fe.js → permissions-C_xHmYV4.js} +5 -3
  323. package/dist/permissions-C_xHmYV4.js.map +1 -0
  324. package/dist/{permissions-DuDYuCjy.cjs → permissions-D5kR-bZw.cjs} +5 -3
  325. package/dist/permissions-D5kR-bZw.cjs.map +1 -0
  326. package/dist/permissions.cjs +1 -1
  327. package/dist/permissions.d.cts +1 -1
  328. package/dist/permissions.d.ts +1 -1
  329. package/dist/permissions.js +1 -1
  330. package/dist/{resolve-CAtC1wN-.cjs → resolve-CBipUzux.cjs} +5 -3
  331. package/dist/resolve-CBipUzux.cjs.map +1 -0
  332. package/dist/{resolve-B_Fq13Dk.js → resolve-CZduTbDq.js} +5 -3
  333. package/dist/resolve-CZduTbDq.js.map +1 -0
  334. package/dist/{schema-ChvpDxUk.d.cts → schema-0uEmsoCr.d.ts} +2512 -211
  335. package/dist/schema-0uEmsoCr.d.ts.map +1 -0
  336. package/dist/{schema-D1CzTJXB.js → schema-CuB-30t5.js} +38 -6
  337. package/dist/schema-CuB-30t5.js.map +1 -0
  338. package/dist/{schema-BUBkkdUa.cjs → schema-Cv_VNAHz.cjs} +8 -1
  339. package/dist/schema-Cv_VNAHz.cjs.map +1 -0
  340. package/dist/{schema-CbXlt1rW.cjs → schema-DoWJbcHt.cjs} +43 -5
  341. package/dist/schema-DoWJbcHt.cjs.map +1 -0
  342. package/dist/{schema-DPJO5nkQ.js → schema-rwexXWFL.js} +3 -2
  343. package/dist/schema-rwexXWFL.js.map +1 -0
  344. package/dist/{schema-DOY22v1Q.d.ts → schema-xhCkX5uD.d.cts} +2766 -465
  345. package/dist/schema-xhCkX5uD.d.cts.map +1 -0
  346. package/dist/schema.cjs +2 -1
  347. package/dist/schema.d.cts +2 -1
  348. package/dist/schema.d.cts.map +1 -1
  349. package/dist/schema.d.ts +2 -1
  350. package/dist/schema.d.ts.map +1 -1
  351. package/dist/schema.js +2 -2
  352. package/dist/{search-docs-CpAlMLs8.js → search-docs-B9qNTw49.js} +8 -4
  353. package/dist/search-docs-B9qNTw49.js.map +1 -0
  354. package/dist/{search-docs-CH6-1H9_.cjs → search-docs-CTT1Bt1U.cjs} +8 -4
  355. package/dist/search-docs-CTT1Bt1U.cjs.map +1 -0
  356. package/dist/{seer-retC9dFI.cjs → seer-B63P5CPi.cjs} +1 -1
  357. package/dist/{seer-retC9dFI.cjs.map → seer-B63P5CPi.cjs.map} +1 -1
  358. package/dist/{seer-DLvrFQPo.js → seer-CderEQ-X.js} +1 -1
  359. package/dist/{seer-DLvrFQPo.js.map → seer-CderEQ-X.js.map} +1 -1
  360. package/dist/sentry-BhTMff8f.js +104 -0
  361. package/dist/sentry-BhTMff8f.js.map +1 -0
  362. package/dist/sentry-DZNWcvcy.d.ts +9 -0
  363. package/dist/sentry-DZNWcvcy.d.ts.map +1 -0
  364. package/dist/sentry-Da9wc8eP.cjs +110 -0
  365. package/dist/sentry-Da9wc8eP.cjs.map +1 -0
  366. package/dist/sentry-De4G2HDR.d.cts +9 -0
  367. package/dist/sentry-De4G2HDR.d.cts.map +1 -0
  368. package/dist/server-B0jJJdAd.js +157 -0
  369. package/dist/server-B0jJJdAd.js.map +1 -0
  370. package/dist/server-Bk2YVj60.cjs +163 -0
  371. package/dist/server-Bk2YVj60.cjs.map +1 -0
  372. package/dist/server.cjs +59 -61
  373. package/dist/server.d.cts +32 -19
  374. package/dist/server.d.cts.map +1 -1
  375. package/dist/server.d.ts +32 -19
  376. package/dist/server.d.ts.map +1 -1
  377. package/dist/server.js +59 -61
  378. package/dist/{stdio-CJnMOUAU.cjs → stdio-D_myxOG-.cjs} +17 -15
  379. package/dist/stdio-D_myxOG-.cjs.map +1 -0
  380. package/dist/{stdio-DB9muOi8.js → stdio-Uv0oXx1a.js} +17 -15
  381. package/dist/stdio-Uv0oXx1a.js.map +1 -0
  382. package/dist/telem/index.cjs +10 -0
  383. package/dist/telem/index.d.cts +3 -0
  384. package/dist/telem/index.d.ts +3 -0
  385. package/dist/telem/index.js +4 -0
  386. package/dist/telem/logging.cjs +9 -0
  387. package/dist/telem/logging.d.cts +2 -0
  388. package/dist/telem/logging.d.ts +2 -0
  389. package/dist/telem/logging.js +3 -0
  390. package/dist/telem/sentry.cjs +3 -0
  391. package/dist/telem/sentry.d.cts +2 -0
  392. package/dist/telem/sentry.d.ts +2 -0
  393. package/dist/telem/sentry.js +3 -0
  394. package/dist/test-setup.cjs +367 -147
  395. package/dist/test-setup.cjs.map +1 -1
  396. package/dist/test-setup.d.cts +2 -3
  397. package/dist/test-setup.d.cts.map +1 -1
  398. package/dist/test-setup.d.ts +2 -3
  399. package/dist/test-setup.d.ts.map +1 -1
  400. package/dist/test-setup.js +367 -147
  401. package/dist/test-setup.js.map +1 -1
  402. package/dist/test-utils/context.d.cts +2 -3
  403. package/dist/test-utils/context.d.cts.map +1 -1
  404. package/dist/test-utils/context.d.ts +2 -3
  405. package/dist/test-utils/context.d.ts.map +1 -1
  406. package/dist/toolDefinitions.cjs +636 -127
  407. package/dist/toolDefinitions.cjs.map +1 -1
  408. package/dist/toolDefinitions.d.cts +5 -5
  409. package/dist/toolDefinitions.d.cts.map +1 -1
  410. package/dist/toolDefinitions.d.ts +5 -5
  411. package/dist/toolDefinitions.d.ts.map +1 -1
  412. package/dist/toolDefinitions.js +636 -127
  413. package/dist/toolDefinitions.js.map +1 -1
  414. package/dist/tools/analyze-issue-with-seer.cjs +16 -15
  415. package/dist/tools/analyze-issue-with-seer.d.cts +3 -4
  416. package/dist/tools/analyze-issue-with-seer.d.cts.map +1 -1
  417. package/dist/tools/analyze-issue-with-seer.d.ts +3 -4
  418. package/dist/tools/analyze-issue-with-seer.d.ts.map +1 -1
  419. package/dist/tools/analyze-issue-with-seer.js +16 -15
  420. package/dist/tools/create-dsn.cjs +11 -10
  421. package/dist/tools/create-dsn.d.cts +3 -4
  422. package/dist/tools/create-dsn.d.cts.map +1 -1
  423. package/dist/tools/create-dsn.d.ts +3 -4
  424. package/dist/tools/create-dsn.d.ts.map +1 -1
  425. package/dist/tools/create-dsn.js +11 -10
  426. package/dist/tools/create-project.cjs +11 -11
  427. package/dist/tools/create-project.d.cts +3 -4
  428. package/dist/tools/create-project.d.cts.map +1 -1
  429. package/dist/tools/create-project.d.ts +3 -4
  430. package/dist/tools/create-project.d.ts.map +1 -1
  431. package/dist/tools/create-project.js +11 -11
  432. package/dist/tools/create-team.cjs +11 -10
  433. package/dist/tools/create-team.d.cts +3 -4
  434. package/dist/tools/create-team.d.cts.map +1 -1
  435. package/dist/tools/create-team.d.ts +3 -4
  436. package/dist/tools/create-team.d.ts.map +1 -1
  437. package/dist/tools/create-team.js +11 -10
  438. package/dist/tools/find-dsns.cjs +11 -10
  439. package/dist/tools/find-dsns.d.cts +7 -8
  440. package/dist/tools/find-dsns.d.ts +7 -8
  441. package/dist/tools/find-dsns.js +11 -10
  442. package/dist/tools/find-organizations.cjs +12 -9
  443. package/dist/tools/find-organizations.d.cts +7 -5
  444. package/dist/tools/find-organizations.d.ts +7 -5
  445. package/dist/tools/find-organizations.js +12 -9
  446. package/dist/tools/find-projects.cjs +11 -10
  447. package/dist/tools/find-projects.d.cts +7 -7
  448. package/dist/tools/find-projects.d.ts +7 -7
  449. package/dist/tools/find-projects.js +11 -10
  450. package/dist/tools/find-releases.cjs +11 -10
  451. package/dist/tools/find-releases.d.cts +3 -4
  452. package/dist/tools/find-releases.d.cts.map +1 -1
  453. package/dist/tools/find-releases.d.ts +3 -4
  454. package/dist/tools/find-releases.d.ts.map +1 -1
  455. package/dist/tools/find-releases.js +11 -10
  456. package/dist/tools/find-teams.cjs +11 -10
  457. package/dist/tools/find-teams.d.cts +7 -7
  458. package/dist/tools/find-teams.d.ts +7 -7
  459. package/dist/tools/find-teams.js +11 -10
  460. package/dist/tools/get-doc.cjs +9 -8
  461. package/dist/tools/get-doc.d.cts +3 -4
  462. package/dist/tools/get-doc.d.cts.map +1 -1
  463. package/dist/tools/get-doc.d.ts +3 -4
  464. package/dist/tools/get-doc.d.ts.map +1 -1
  465. package/dist/tools/get-doc.js +9 -8
  466. package/dist/tools/get-event-attachment.cjs +11 -10
  467. package/dist/tools/get-event-attachment.d.cts +9 -10
  468. package/dist/tools/get-event-attachment.d.ts +9 -10
  469. package/dist/tools/get-event-attachment.js +11 -10
  470. package/dist/tools/get-issue-details.cjs +16 -15
  471. package/dist/tools/get-issue-details.d.cts +3 -4
  472. package/dist/tools/get-issue-details.d.cts.map +1 -1
  473. package/dist/tools/get-issue-details.d.ts +3 -4
  474. package/dist/tools/get-issue-details.d.ts.map +1 -1
  475. package/dist/tools/get-issue-details.js +16 -15
  476. package/dist/tools/get-trace-details.cjs +11 -10
  477. package/dist/tools/get-trace-details.d.cts +7 -8
  478. package/dist/tools/get-trace-details.d.ts +7 -8
  479. package/dist/tools/get-trace-details.js +11 -10
  480. package/dist/tools/index.cjs +52 -51
  481. package/dist/tools/index.d.cts +79 -76
  482. package/dist/tools/index.d.cts.map +1 -1
  483. package/dist/tools/index.d.ts +79 -76
  484. package/dist/tools/index.d.ts.map +1 -1
  485. package/dist/tools/index.js +52 -51
  486. package/dist/tools/search-docs.cjs +10 -9
  487. package/dist/tools/search-docs.d.cts +3 -4
  488. package/dist/tools/search-docs.d.cts.map +1 -1
  489. package/dist/tools/search-docs.d.ts +3 -4
  490. package/dist/tools/search-docs.d.ts.map +1 -1
  491. package/dist/tools/search-docs.js +10 -9
  492. package/dist/tools/search-events/agent.cjs +15 -14
  493. package/dist/tools/search-events/agent.d.cts +4 -4
  494. package/dist/tools/search-events/agent.d.ts +6 -6
  495. package/dist/tools/search-events/agent.js +15 -14
  496. package/dist/tools/search-events/config.cjs +1 -1
  497. package/dist/tools/search-events/config.js +1 -1
  498. package/dist/tools/search-events/formatters.cjs +10 -10
  499. package/dist/tools/search-events/formatters.d.cts +5 -5
  500. package/dist/tools/search-events/formatters.d.ts +7 -7
  501. package/dist/tools/search-events/formatters.js +10 -10
  502. package/dist/tools/search-events/handler.cjs +20 -19
  503. package/dist/tools/search-events/handler.d.cts +4 -5
  504. package/dist/tools/search-events/handler.d.ts +4 -5
  505. package/dist/tools/search-events/handler.js +20 -19
  506. package/dist/tools/search-events/index.cjs +21 -20
  507. package/dist/tools/search-events/index.d.cts +8 -9
  508. package/dist/tools/search-events/index.d.ts +10 -11
  509. package/dist/tools/search-events/index.js +21 -20
  510. package/dist/tools/search-events/utils.cjs +9 -9
  511. package/dist/tools/search-events/utils.d.cts +5 -5
  512. package/dist/tools/search-events/utils.d.ts +7 -7
  513. package/dist/tools/search-events/utils.js +9 -9
  514. package/dist/tools/search-issues/agent.cjs +14 -13
  515. package/dist/tools/search-issues/agent.d.cts +4 -4
  516. package/dist/tools/search-issues/agent.d.ts +6 -6
  517. package/dist/tools/search-issues/agent.js +14 -13
  518. package/dist/tools/search-issues/config.cjs +1 -1
  519. package/dist/tools/search-issues/config.js +1 -1
  520. package/dist/tools/search-issues/formatters.cjs +2 -2
  521. package/dist/tools/search-issues/formatters.d.cts +3 -3
  522. package/dist/tools/search-issues/formatters.d.ts +5 -5
  523. package/dist/tools/search-issues/formatters.js +2 -2
  524. package/dist/tools/search-issues/handler.cjs +19 -18
  525. package/dist/tools/search-issues/handler.d.cts +4 -5
  526. package/dist/tools/search-issues/handler.d.ts +4 -5
  527. package/dist/tools/search-issues/handler.js +19 -18
  528. package/dist/tools/search-issues/index.cjs +20 -19
  529. package/dist/tools/search-issues/index.d.cts +8 -9
  530. package/dist/tools/search-issues/index.d.ts +10 -11
  531. package/dist/tools/search-issues/index.js +20 -19
  532. package/dist/tools/types.d.cts +3 -4
  533. package/dist/tools/types.d.ts +3 -4
  534. package/dist/tools/update-issue.cjs +16 -15
  535. package/dist/tools/update-issue.d.cts +10 -11
  536. package/dist/tools/update-issue.d.ts +10 -11
  537. package/dist/tools/update-issue.js +16 -15
  538. package/dist/tools/update-project.cjs +11 -11
  539. package/dist/tools/update-project.d.cts +3 -4
  540. package/dist/tools/update-project.d.cts.map +1 -1
  541. package/dist/tools/update-project.d.ts +3 -4
  542. package/dist/tools/update-project.d.ts.map +1 -1
  543. package/dist/tools/update-project.js +11 -11
  544. package/dist/tools/whoami.cjs +10 -9
  545. package/dist/tools/whoami.d.cts +3 -4
  546. package/dist/tools/whoami.d.ts +3 -4
  547. package/dist/tools/whoami.js +10 -9
  548. package/dist/{tools-UZ_biJKC.cjs → tools-DcCN34Xz.cjs} +20 -20
  549. package/dist/{tools-UZ_biJKC.cjs.map → tools-DcCN34Xz.cjs.map} +1 -1
  550. package/dist/{tools-BiCRxQiY.js → tools-Du5wLts3.js} +20 -20
  551. package/dist/{tools-BiCRxQiY.js.map → tools-Du5wLts3.js.map} +1 -1
  552. package/dist/transports/stdio.cjs +3 -65
  553. package/dist/transports/stdio.d.cts +12 -9
  554. package/dist/transports/stdio.d.cts.map +1 -1
  555. package/dist/transports/stdio.d.ts +12 -9
  556. package/dist/transports/stdio.d.ts.map +1 -1
  557. package/dist/transports/stdio.js +3 -65
  558. package/dist/{types-B4nOfch5.d.cts → types-4O1B8U0e.d.ts} +9 -4
  559. package/dist/types-4O1B8U0e.d.ts.map +1 -0
  560. package/dist/{types-DTp1ajTT.d.ts → types-B9_8hSal.d.cts} +5 -2
  561. package/dist/types-B9_8hSal.d.cts.map +1 -0
  562. package/dist/{types-DLRWzl3K.d.cts → types-BU11bcu2.d.ts} +5 -2
  563. package/dist/types-BU11bcu2.d.ts.map +1 -0
  564. package/dist/{types-o23QqDgk.d.cts → types-CZUp4Xzk.d.ts} +10 -5
  565. package/dist/types-CZUp4Xzk.d.ts.map +1 -0
  566. package/dist/{types-ryM3umix.d.ts → types-CtnbvcEw.d.cts} +9 -4
  567. package/dist/types-CtnbvcEw.d.cts.map +1 -0
  568. package/dist/{types-s3ChfOM9.d.ts → types-DkmHqy15.d.cts} +10 -5
  569. package/dist/types-DkmHqy15.d.cts.map +1 -0
  570. package/dist/types-NVsIso1A.d.ts +31 -0
  571. package/dist/types-NVsIso1A.d.ts.map +1 -0
  572. package/dist/types-Z4mR2AFK.d.cts +31 -0
  573. package/dist/types-Z4mR2AFK.d.cts.map +1 -0
  574. package/dist/types.cjs +16 -0
  575. package/dist/types.cjs.map +1 -0
  576. package/dist/types.d.cts +3 -4
  577. package/dist/types.d.ts +3 -4
  578. package/dist/types.js +15 -0
  579. package/dist/types.js.map +1 -0
  580. package/dist/{update-issue-nq8D_YUe.js → update-issue-CoAkoO66.js} +11 -5
  581. package/dist/update-issue-CoAkoO66.js.map +1 -0
  582. package/dist/{update-issue-CD-kp2dt.cjs → update-issue-eELBq_Uy.cjs} +11 -5
  583. package/dist/update-issue-eELBq_Uy.cjs.map +1 -0
  584. package/dist/{update-project-DvJfmSmX.js → update-project-CuZlyBPN.js} +13 -7
  585. package/dist/update-project-CuZlyBPN.js.map +1 -0
  586. package/dist/{update-project-B_OLM4Ky.cjs → update-project-DMRBdOZ5.cjs} +13 -7
  587. package/dist/update-project-DMRBdOZ5.cjs.map +1 -0
  588. package/dist/{url-utils-0OheI87i.cjs → url-utils-Bn5EoScr.cjs} +26 -1
  589. package/dist/url-utils-Bn5EoScr.cjs.map +1 -0
  590. package/dist/{url-utils-DF8NBCyH.js → url-utils-d9bPTnOl.js} +21 -2
  591. package/dist/url-utils-d9bPTnOl.js.map +1 -0
  592. package/dist/usage-CP6e39yF.cjs +39 -0
  593. package/dist/usage-CP6e39yF.cjs.map +1 -0
  594. package/dist/usage-CihInDyq.js +33 -0
  595. package/dist/usage-CihInDyq.js.map +1 -0
  596. package/dist/utils/url-utils.cjs +2 -1
  597. package/dist/utils/url-utils.d.cts +9 -1
  598. package/dist/utils/url-utils.d.cts.map +1 -1
  599. package/dist/utils/url-utils.d.ts +9 -1
  600. package/dist/utils/url-utils.d.ts.map +1 -1
  601. package/dist/utils/url-utils.js +2 -2
  602. package/dist/{utils-DQ69VZrK.cjs → utils-C5DuiZoe.cjs} +2 -2
  603. package/dist/{utils-DQ69VZrK.cjs.map → utils-C5DuiZoe.cjs.map} +1 -1
  604. package/dist/{utils-CP4vAzfv.js → utils-CwvZS30K.js} +2 -2
  605. package/dist/{utils-CP4vAzfv.js.map → utils-CwvZS30K.js.map} +1 -1
  606. package/dist/{utils-Cw6O1ztc.d.ts → utils-DKQuo7b2.d.ts} +4 -4
  607. package/dist/utils-DKQuo7b2.d.ts.map +1 -0
  608. package/dist/{utils-Ddvt3CBZ.d.cts → utils-DKgPcA6i.d.cts} +6 -6
  609. package/dist/{utils-Ddvt3CBZ.d.cts.map → utils-DKgPcA6i.d.cts.map} +1 -1
  610. package/dist/{utils-BOPpU4-H.cjs → utils-DUJcA3eH.cjs} +16 -7
  611. package/dist/utils-DUJcA3eH.cjs.map +1 -0
  612. package/dist/{utils-DA-V9B-n.d.ts → utils-DpeFMEgH.d.ts} +6 -6
  613. package/dist/{utils-DA-V9B-n.d.ts.map → utils-DpeFMEgH.d.ts.map} +1 -1
  614. package/dist/{utils-OyJ8CB2S.d.cts → utils-HNrRwq-a.d.cts} +4 -4
  615. package/dist/utils-HNrRwq-a.d.cts.map +1 -0
  616. package/dist/{utils-K1XhlGf4.js → utils-iC0Uutcf.js} +16 -7
  617. package/dist/utils-iC0Uutcf.js.map +1 -0
  618. package/dist/{validate-region-url-DTUtqFky.js → validate-region-url-CaR6XWB_.js} +1 -1
  619. package/dist/{validate-region-url-DTUtqFky.js.map → validate-region-url-CaR6XWB_.js.map} +1 -1
  620. package/dist/{validate-region-url-BhxxcBgE.cjs → validate-region-url-dzz6t54w.cjs} +1 -1
  621. package/dist/{validate-region-url-BhxxcBgE.cjs.map → validate-region-url-dzz6t54w.cjs.map} +1 -1
  622. package/dist/version-6dHij-Gk.js +6 -0
  623. package/dist/{version-CaDh5TML.js.map → version-6dHij-Gk.js.map} +1 -1
  624. package/dist/{version-DB2IM9qM.cjs → version-Cq6vA9Kc.cjs} +2 -2
  625. package/dist/{version-DB2IM9qM.cjs.map → version-Cq6vA9Kc.cjs.map} +1 -1
  626. package/dist/version.cjs +1 -1
  627. package/dist/version.js +1 -1
  628. package/dist/{whoami-qCGsRPRm.js → whoami-Bh_uOPqO.js} +6 -2
  629. package/dist/whoami-Bh_uOPqO.js.map +1 -0
  630. package/dist/{whoami-bRIfclYF.js → whoami-D8-XCgVJ.js} +2 -2
  631. package/dist/{whoami-bRIfclYF.js.map → whoami-D8-XCgVJ.js.map} +1 -1
  632. package/dist/{whoami-DCgOyVnW.cjs → whoami-DBSqcCGl.cjs} +2 -2
  633. package/dist/{whoami-DCgOyVnW.cjs.map → whoami-DBSqcCGl.cjs.map} +1 -1
  634. package/dist/{whoami-BdiVu0Wr.cjs → whoami-DBlwuDZf.cjs} +6 -2
  635. package/dist/whoami-DBlwuDZf.cjs.map +1 -0
  636. package/package.json +29 -27
  637. package/dist/about-CDAN_HuU.js +0 -136
  638. package/dist/about-CDAN_HuU.js.map +0 -1
  639. package/dist/about-CteXVo1Q.d.ts +0 -10
  640. package/dist/about-CteXVo1Q.d.ts.map +0 -1
  641. package/dist/about-CwQvsGSc.d.cts +0 -10
  642. package/dist/about-CwQvsGSc.d.cts.map +0 -1
  643. package/dist/about-aDGhlM6f.cjs +0 -142
  644. package/dist/about-aDGhlM6f.cjs.map +0 -1
  645. package/dist/analyze-issue-with-seer-Cf0jCiKP.cjs.map +0 -1
  646. package/dist/analyze-issue-with-seer-DqwczSTV.js.map +0 -1
  647. package/dist/callEmbeddedAgent-BRz60bxa.cjs.map +0 -1
  648. package/dist/callEmbeddedAgent-C0pC9du1.js.map +0 -1
  649. package/dist/client-AVVG7J24.cjs.map +0 -1
  650. package/dist/client-B0wezrpt.d.cts.map +0 -1
  651. package/dist/client-BqrNpqZW.js.map +0 -1
  652. package/dist/client-D-KqRd94.d.ts.map +0 -1
  653. package/dist/create-dsn-BhshlP7l.js.map +0 -1
  654. package/dist/create-dsn-DaHidLhE.cjs.map +0 -1
  655. package/dist/create-project-C3laecaU.js.map +0 -1
  656. package/dist/create-project-xszOpGTC.cjs.map +0 -1
  657. package/dist/create-team-CTN-DxOE.js.map +0 -1
  658. package/dist/create-team-DmnJHSIx.cjs.map +0 -1
  659. package/dist/error-handling-efwohgKv.js.map +0 -1
  660. package/dist/error-handling-qfa1BeDb.cjs.map +0 -1
  661. package/dist/find-dsns-D0l3siyF.cjs.map +0 -1
  662. package/dist/find-dsns-U4CCcoTv.js.map +0 -1
  663. package/dist/find-organizations-Ca-zpAlI.cjs.map +0 -1
  664. package/dist/find-organizations-HUZFa8ZA.js.map +0 -1
  665. package/dist/find-projects-CWNLthwg.cjs.map +0 -1
  666. package/dist/find-projects-Dy1_O9L0.js.map +0 -1
  667. package/dist/find-releases-BtazPcQH.cjs.map +0 -1
  668. package/dist/find-releases-DN_BfQM2.js.map +0 -1
  669. package/dist/find-teams-CRVT4KOg.js +0 -40
  670. package/dist/find-teams-CRVT4KOg.js.map +0 -1
  671. package/dist/find-teams-_zAHPVGx.cjs.map +0 -1
  672. package/dist/formatting-BjCK9XwW.js.map +0 -1
  673. package/dist/formatting-CqmsvuAY.cjs.map +0 -1
  674. package/dist/formatting-XMmhMjRz.d.cts.map +0 -1
  675. package/dist/formatting-l3qx5d7L.d.ts.map +0 -1
  676. package/dist/get-doc-Euz6NiM3.cjs.map +0 -1
  677. package/dist/get-doc-JDwOkY2j.js.map +0 -1
  678. package/dist/get-event-attachment-DvpQ-dEP.cjs.map +0 -1
  679. package/dist/get-event-attachment-pIJmUfFE.js.map +0 -1
  680. package/dist/get-issue-details-B1PDMmMY.js.map +0 -1
  681. package/dist/get-issue-details-BH75EnNk.cjs.map +0 -1
  682. package/dist/get-trace-details-Bksygq21.cjs.map +0 -1
  683. package/dist/get-trace-details-CaK0JMf4.js.map +0 -1
  684. package/dist/handler-BbqDy4DA.js.map +0 -1
  685. package/dist/handler-C0zOOLbO.cjs.map +0 -1
  686. package/dist/handler-DyBdUYam.js.map +0 -1
  687. package/dist/handler-cy5oD28N.cjs.map +0 -1
  688. package/dist/internal/sentry-scrubbing.cjs +0 -6
  689. package/dist/internal/sentry-scrubbing.d.cts +0 -28
  690. package/dist/internal/sentry-scrubbing.d.cts.map +0 -1
  691. package/dist/internal/sentry-scrubbing.d.ts +0 -28
  692. package/dist/internal/sentry-scrubbing.d.ts.map +0 -1
  693. package/dist/internal/sentry-scrubbing.js +0 -3
  694. package/dist/logging-CBMxr4i2.js +0 -25
  695. package/dist/logging-CBMxr4i2.js.map +0 -1
  696. package/dist/logging-rvUPDKax.cjs +0 -31
  697. package/dist/logging-rvUPDKax.cjs.map +0 -1
  698. package/dist/logging.cjs +0 -3
  699. package/dist/logging.d.cts +0 -37
  700. package/dist/logging.d.cts.map +0 -1
  701. package/dist/logging.d.ts +0 -37
  702. package/dist/logging.d.ts.map +0 -1
  703. package/dist/logging.js +0 -3
  704. package/dist/parse-C3tRlsy-.js.map +0 -1
  705. package/dist/parse-CeFc4xnt.cjs.map +0 -1
  706. package/dist/permissions-C-q0Y5bL.d.ts.map +0 -1
  707. package/dist/permissions-Cm5e34n2.d.cts.map +0 -1
  708. package/dist/permissions-DRdH39Fe.js.map +0 -1
  709. package/dist/permissions-DuDYuCjy.cjs.map +0 -1
  710. package/dist/promptDefinitions-02aQWFKD.cjs +0 -37
  711. package/dist/promptDefinitions-02aQWFKD.cjs.map +0 -1
  712. package/dist/promptDefinitions-ImFNiWkX.d.cts +0 -34
  713. package/dist/promptDefinitions-ImFNiWkX.d.cts.map +0 -1
  714. package/dist/promptDefinitions-Y-mt2_IM.d.ts +0 -34
  715. package/dist/promptDefinitions-Y-mt2_IM.d.ts.map +0 -1
  716. package/dist/promptDefinitions-wR6u6ZJE.js +0 -31
  717. package/dist/promptDefinitions-wR6u6ZJE.js.map +0 -1
  718. package/dist/promptDefinitions.cjs +0 -6
  719. package/dist/promptDefinitions.d.cts +0 -2
  720. package/dist/promptDefinitions.d.ts +0 -2
  721. package/dist/promptDefinitions.js +0 -6
  722. package/dist/prompts-BwZJaywH.cjs +0 -41
  723. package/dist/prompts-BwZJaywH.cjs.map +0 -1
  724. package/dist/prompts-DCJ0XraB.js +0 -36
  725. package/dist/prompts-DCJ0XraB.js.map +0 -1
  726. package/dist/prompts.cjs +0 -4
  727. package/dist/prompts.d.cts +0 -31
  728. package/dist/prompts.d.cts.map +0 -1
  729. package/dist/prompts.d.ts +0 -31
  730. package/dist/prompts.d.ts.map +0 -1
  731. package/dist/prompts.js +0 -4
  732. package/dist/resolve-B_Fq13Dk.js.map +0 -1
  733. package/dist/resolve-CAtC1wN-.cjs.map +0 -1
  734. package/dist/resources/about.cjs +0 -3
  735. package/dist/resources/about.d.cts +0 -2
  736. package/dist/resources/about.d.ts +0 -2
  737. package/dist/resources/about.js +0 -3
  738. package/dist/resources/index.cjs +0 -4
  739. package/dist/resources/index.d.cts +0 -2
  740. package/dist/resources/index.d.ts +0 -2
  741. package/dist/resources/index.js +0 -4
  742. package/dist/resources-B4ropjfD.cjs +0 -94
  743. package/dist/resources-B4ropjfD.cjs.map +0 -1
  744. package/dist/resources-DaEUMw3Y.js +0 -82
  745. package/dist/resources-DaEUMw3Y.js.map +0 -1
  746. package/dist/resources.cjs +0 -8
  747. package/dist/resources.d.cts +0 -37
  748. package/dist/resources.d.cts.map +0 -1
  749. package/dist/resources.d.ts +0 -37
  750. package/dist/resources.d.ts.map +0 -1
  751. package/dist/resources.js +0 -7
  752. package/dist/schema-BUBkkdUa.cjs.map +0 -1
  753. package/dist/schema-CbXlt1rW.cjs.map +0 -1
  754. package/dist/schema-ChvpDxUk.d.cts.map +0 -1
  755. package/dist/schema-D1CzTJXB.js.map +0 -1
  756. package/dist/schema-DOY22v1Q.d.ts.map +0 -1
  757. package/dist/schema-DPJO5nkQ.js.map +0 -1
  758. package/dist/search-docs-CH6-1H9_.cjs.map +0 -1
  759. package/dist/search-docs-CpAlMLs8.js.map +0 -1
  760. package/dist/sentry-scrubbing-BrjExjlM.js +0 -94
  761. package/dist/sentry-scrubbing-BrjExjlM.js.map +0 -1
  762. package/dist/sentry-scrubbing-CDcE4n-D.cjs +0 -118
  763. package/dist/sentry-scrubbing-CDcE4n-D.cjs.map +0 -1
  764. package/dist/server-BjizUxVR.js +0 -238
  765. package/dist/server-BjizUxVR.js.map +0 -1
  766. package/dist/server-RKq8MlNM.cjs +0 -244
  767. package/dist/server-RKq8MlNM.cjs.map +0 -1
  768. package/dist/stdio-CJnMOUAU.cjs.map +0 -1
  769. package/dist/stdio-DB9muOi8.js.map +0 -1
  770. package/dist/types-B4nOfch5.d.cts.map +0 -1
  771. package/dist/types-CKPddlfS.cjs +0 -0
  772. package/dist/types-Cy4S5lN-.js +0 -0
  773. package/dist/types-DLRWzl3K.d.cts.map +0 -1
  774. package/dist/types-DTp1ajTT.d.ts.map +0 -1
  775. package/dist/types-Dj36Sq2V.d.cts +0 -41
  776. package/dist/types-Dj36Sq2V.d.cts.map +0 -1
  777. package/dist/types-m-t7jx2f.d.ts +0 -41
  778. package/dist/types-m-t7jx2f.d.ts.map +0 -1
  779. package/dist/types-o23QqDgk.d.cts.map +0 -1
  780. package/dist/types-ryM3umix.d.ts.map +0 -1
  781. package/dist/types-s3ChfOM9.d.ts.map +0 -1
  782. package/dist/update-issue-CD-kp2dt.cjs.map +0 -1
  783. package/dist/update-issue-nq8D_YUe.js.map +0 -1
  784. package/dist/update-project-B_OLM4Ky.cjs.map +0 -1
  785. package/dist/update-project-DvJfmSmX.js.map +0 -1
  786. package/dist/url-utils-0OheI87i.cjs.map +0 -1
  787. package/dist/url-utils-DF8NBCyH.js.map +0 -1
  788. package/dist/usage-Do2a2NJi.cjs +0 -44
  789. package/dist/usage-Do2a2NJi.cjs.map +0 -1
  790. package/dist/usage-OGOjVeAz.js +0 -38
  791. package/dist/usage-OGOjVeAz.js.map +0 -1
  792. package/dist/utils-BOPpU4-H.cjs.map +0 -1
  793. package/dist/utils-Cw6O1ztc.d.ts.map +0 -1
  794. package/dist/utils-K1XhlGf4.js.map +0 -1
  795. package/dist/utils-OyJ8CB2S.d.cts.map +0 -1
  796. package/dist/version-CaDh5TML.js +0 -6
  797. package/dist/whoami-BdiVu0Wr.cjs.map +0 -1
  798. package/dist/whoami-qCGsRPRm.js.map +0 -1
  799. /package/dist/{api-client-T99a5Vta.js → api-client-BR5WolLe.js} +0 -0
  800. /package/dist/{api-client-_2QFWf0d.cjs → api-client-BsHWi0-I.cjs} +0 -0
  801. /package/dist/{index-DCwqskfg.d.ts → index-DZJ9s9rm.d.ts} +0 -0
  802. /package/dist/{issue-DKr8zNay.js → issue-B7cgiWKp.cjs} +0 -0
  803. /package/dist/{issue-DrgpqPbF.cjs → issue-BLm6gohl.js} +0 -0
  804. /package/dist/{resources-BlsH_EDg.cjs → search-events-Bc2a_R3A.cjs} +0 -0
  805. /package/dist/{resources-U-u5ze91.js → search-events-Bo5bAsOv.js} +0 -0
  806. /package/dist/{search-events-CUvQ_Jch.js → search-issues-AaiYCZ6J.cjs} +0 -0
  807. /package/dist/{search-events-DSY2Z_Eh.cjs → search-issues-DVHuKDdB.js} +0 -0
  808. /package/dist/{search-issues-BOmdyuUf.js → types-Bx1EKe0v.js} +0 -0
  809. /package/dist/{search-issues-BxO2JE3D.cjs → types-D10T4PdD.cjs} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"error-handling-qfa1BeDb.cjs","names":["error: unknown","UserInputError","ConfigurationError","ApiError","ApiClientError","ApiServerError","eventId"],"sources":["../src/internal/error-handling.ts"],"sourcesContent":["import { UserInputError, ConfigurationError } from \"../errors\";\nimport { ApiError, ApiClientError, ApiServerError } from \"../api-client\";\nimport { logError } from \"../logging\";\n\n/**\n * Type guard to identify user input validation errors.\n */\nexport function isUserInputError(error: unknown): error is UserInputError {\n return error instanceof UserInputError;\n}\n\n/**\n * Type guard to identify configuration errors.\n */\nexport function isConfigurationError(\n error: unknown,\n): error is ConfigurationError {\n return error instanceof ConfigurationError;\n}\n\n/**\n * Type guard to identify API errors.\n */\nexport function isApiError(error: unknown): error is ApiError {\n return error instanceof ApiError;\n}\n\n/**\n * Type guard to identify API client errors (4xx).\n */\nexport function isApiClientError(error: unknown): error is ApiClientError {\n return error instanceof ApiClientError;\n}\n\n/**\n * Type guard to identify API server errors (5xx).\n */\nexport function isApiServerError(error: unknown): error is ApiServerError {\n return error instanceof ApiServerError;\n}\n\n/**\n * Format an error for user display with markdown formatting.\n * This is used by tool handlers to format errors for MCP responses.\n *\n * SECURITY: Only return trusted error messages to prevent prompt injection vulnerabilities.\n * We trust: Sentry API errors, our own UserInputError/ConfigurationError messages, and system templates.\n */\nexport async function formatErrorForUser(error: unknown): Promise<string> {\n if (isUserInputError(error)) {\n return [\n \"**Input Error**\",\n \"It looks like there was a problem with the input you provided.\",\n error.message,\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n if (isConfigurationError(error)) {\n return [\n \"**Configuration Error**\",\n \"There appears to be a configuration issue with your setup.\",\n error.message,\n `Please check your environment configuration and try again.`,\n ].join(\"\\n\\n\");\n }\n\n // Handle ApiClientError (4xx) - user input errors, should NOT be logged to Sentry\n if (isApiClientError(error)) {\n const statusText = error.status\n ? `There was an HTTP ${error.status} error with your request to the Sentry API.`\n : \"There was an error with your request.\";\n\n return [\n \"**Input Error**\",\n statusText,\n error.toUserMessage(),\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n // Handle ApiServerError (5xx) - system errors, SHOULD be logged to Sentry\n if (isApiServerError(error)) {\n const eventId = logError(error);\n const statusText = error.status\n ? `There was an HTTP ${error.status} server error with the Sentry API.`\n : \"There was a server error.\";\n\n return [\n \"**Error**\",\n statusText,\n `${error.message}`,\n `**Event ID**: ${eventId}`,\n `Please contact support with this Event ID if the problem persists.`,\n ].join(\"\\n\\n\");\n }\n\n // Handle generic ApiError (shouldn't happen with new hierarchy, but just in case)\n if (isApiError(error)) {\n const statusText = error.status\n ? `There was an HTTP ${error.status} error with your request to the Sentry API.`\n : \"There was an error with your request.\";\n\n return [\n \"**Error**\",\n statusText,\n `${error.message}`,\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n const eventId = logError(error);\n\n return [\n \"**Error**\",\n \"It looks like there was a problem communicating with the Sentry API.\",\n \"Please report the following to the user for the Sentry team:\",\n `**Event ID**: ${eventId}`,\n process.env.NODE_ENV !== \"production\"\n ? error instanceof Error\n ? error.message\n : String(error)\n : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\\n\");\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,iBAAiBA,OAAyC;AACxE,QAAO,iBAAiBC;AACzB;;;;AAKD,SAAgB,qBACdD,OAC6B;AAC7B,QAAO,iBAAiBE;AACzB;;;;AAKD,SAAgB,WAAWF,OAAmC;AAC5D,QAAO,iBAAiBG;AACzB;;;;AAKD,SAAgB,iBAAiBH,OAAyC;AACxE,QAAO,iBAAiBI;AACzB;;;;AAKD,SAAgB,iBAAiBJ,OAAyC;AACxE,QAAO,iBAAiBK;AACzB;;;;;;;;AASD,eAAsB,mBAAmBL,OAAiC;AACxE,KAAI,iBAAiB,MAAM,CACzB,QAAO;EACL;EACA;EACA,MAAM;GACL;CACF,EAAC,KAAK,OAAO;AAGhB,KAAI,qBAAqB,MAAM,CAC7B,QAAO;EACL;EACA;EACA,MAAM;GACL;CACF,EAAC,KAAK,OAAO;AAIhB,KAAI,iBAAiB,MAAM,EAAE;EAC3B,MAAM,aAAa,MAAM,UACpB,oBAAoB,MAAM,OAAO,+CAClC;AAEJ,SAAO;GACL;GACA;GACA,MAAM,eAAe;IACpB;EACF,EAAC,KAAK,OAAO;CACf;AAGD,KAAI,iBAAiB,MAAM,EAAE;EAC3B,MAAMM,YAAU,yBAAS,MAAM;EAC/B,MAAM,aAAa,MAAM,UACpB,oBAAoB,MAAM,OAAO,sCAClC;AAEJ,SAAO;GACL;GACA;MACG,MAAM;IACR,gBAAgBA;IAChB;EACF,EAAC,KAAK,OAAO;CACf;AAGD,KAAI,WAAW,MAAM,EAAE;EACrB,MAAM,aAAa,MAAM,UACpB,oBAAoB,MAAM,OAAO,+CAClC;AAEJ,SAAO;GACL;GACA;MACG,MAAM;IACR;EACF,EAAC,KAAK,OAAO;CACf;CAED,MAAM,UAAU,yBAAS,MAAM;AAE/B,QAAO;EACL;EACA;EACA;GACC,gBAAgB;EACjB,QAAQ,IAAI,aAAa,eACrB,iBAAiB,QACf,MAAM,UACN,OAAO,MAAM,GACf;CACL,EACE,OAAO,QAAQ,CACf,KAAK,OAAO;AAChB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-dsns-D0l3siyF.cjs","names":["ParamOrganizationSlug","ParamProjectSlug","context: ServerContext"],"sources":["../src/tools/find-dsns.ts"],"sourcesContent":["import { setTag } from \"@sentry/core\";\nimport { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_dsns\",\n requiredScopes: [\"project:read\"],\n description: [\n \"List all Sentry DSNs for a specific project.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Retrieve a SENTRY_DSN for a specific project\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `find_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug,\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n setTag(\"project.slug\", params.projectSlug);\n\n const clientKeys = await apiService.listClientKeys({\n organizationSlug,\n projectSlug: params.projectSlug,\n });\n let output = `# DSNs in **${organizationSlug}/${params.projectSlug}**\\n\\n`;\n if (clientKeys.length === 0) {\n output +=\n \"No DSNs were found.\\n\\nYou can create new one using the `create_dsn` tool.\";\n return output;\n }\n for (const clientKey of clientKeys) {\n output += `## ${clientKey.name}\\n`;\n output += `**ID**: ${clientKey.id}\\n`;\n output += `**DSN**: ${clientKey.dsn.public}\\n\\n`;\n }\n output += \"# Using this information\\n\\n\";\n output +=\n \"- The `SENTRY_DSN` value is a URL that you can use to initialize Sentry's SDKs.\\n\";\n return output;\n },\n});\n"],"mappings":";;;;;;;AAUA,wBAAe,0BAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,cAAe;CAChC,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkBA;EAClB,WAAW,8BAAe,UAAU;EACpC,aAAaC;CACd;CACD,MAAM,QAAQ,QAAQC,SAAwB;EAC5C,MAAM,aAAa,kCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,4BAAO,qBAAqB,iBAAiB;AAC7C,4BAAO,gBAAgB,OAAO,YAAY;EAE1C,MAAM,aAAa,MAAM,WAAW,eAAe;GACjD;GACA,aAAa,OAAO;EACrB,EAAC;EACF,IAAI,UAAU,cAAc,iBAAiB,GAAG,OAAO,YAAY;AACnE,MAAI,WAAW,WAAW,GAAG;AAC3B,aACE;AACF,UAAO;EACR;AACD,OAAK,MAAM,aAAa,YAAY;AAClC,cAAW,KAAK,UAAU,KAAK;AAC/B,cAAW,UAAU,UAAU,GAAG;AAClC,cAAW,WAAW,UAAU,IAAI,OAAO;EAC5C;AACD,YAAU;AACV,YACE;AACF,SAAO;CACR;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-dsns-U4CCcoTv.js","names":["context: ServerContext"],"sources":["../src/tools/find-dsns.ts"],"sourcesContent":["import { setTag } from \"@sentry/core\";\nimport { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_dsns\",\n requiredScopes: [\"project:read\"],\n description: [\n \"List all Sentry DSNs for a specific project.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Retrieve a SENTRY_DSN for a specific project\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `find_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug,\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n setTag(\"project.slug\", params.projectSlug);\n\n const clientKeys = await apiService.listClientKeys({\n organizationSlug,\n projectSlug: params.projectSlug,\n });\n let output = `# DSNs in **${organizationSlug}/${params.projectSlug}**\\n\\n`;\n if (clientKeys.length === 0) {\n output +=\n \"No DSNs were found.\\n\\nYou can create new one using the `create_dsn` tool.\";\n return output;\n }\n for (const clientKey of clientKeys) {\n output += `## ${clientKey.name}\\n`;\n output += `**ID**: ${clientKey.id}\\n`;\n output += `**DSN**: ${clientKey.dsn.public}\\n\\n`;\n }\n output += \"# Using this information\\n\\n\";\n output +=\n \"- The `SENTRY_DSN` value is a URL that you can use to initialize Sentry's SDKs.\\n\";\n return output;\n },\n});\n"],"mappings":";;;;;;AAUA,wBAAe,WAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,cAAe;CAChC,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB;EAClB,WAAW,eAAe,UAAU;EACpC,aAAa;CACd;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,sBAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,SAAO,qBAAqB,iBAAiB;AAC7C,SAAO,gBAAgB,OAAO,YAAY;EAE1C,MAAM,aAAa,MAAM,WAAW,eAAe;GACjD;GACA,aAAa,OAAO;EACrB,EAAC;EACF,IAAI,UAAU,cAAc,iBAAiB,GAAG,OAAO,YAAY;AACnE,MAAI,WAAW,WAAW,GAAG;AAC3B,aACE;AACF,UAAO;EACR;AACD,OAAK,MAAM,aAAa,YAAY;AAClC,cAAW,KAAK,UAAU,KAAK;AAC/B,cAAW,UAAU,UAAU,GAAG;AAClC,cAAW,WAAW,UAAU,IAAI,OAAO;EAC5C;AACD,YAAU;AACV,YACE;AACF,SAAO;CACR;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-organizations-Ca-zpAlI.cjs","names":["context: ServerContext"],"sources":["../src/tools/find-organizations.ts"],"sourcesContent":["import { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport type { ServerContext } from \"../types\";\n\nexport default defineTool({\n name: \"find_organizations\",\n requiredScopes: [\"org:read\"],\n description: [\n \"Find organizations that the user has access to in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View all organizations in Sentry\",\n \"- Find an organization's slug to aid other tool requests\",\n ].join(\"\\n\"),\n inputSchema: {},\n async handler(params, context: ServerContext) {\n // User data endpoints (like /users/me/regions/) should never use regionUrl\n // as they must always query the main API server, not region-specific servers\n const apiService = apiServiceFromContext(context);\n const organizations = await apiService.listOrganizations();\n\n let output = \"# Organizations\\n\\n\";\n\n if (organizations.length === 0) {\n output += \"You don't appear to be a member of any organizations.\\n\";\n return output;\n }\n\n output += organizations\n .map((org) =>\n [\n `## **${org.slug}**`,\n \"\",\n `**Web URL:** ${org.links?.organizationUrl || \"Not available\"}`,\n `**Region URL:** ${org.links?.regionUrl || \"\"}`,\n ].join(\"\\n\"),\n )\n .join(\"\\n\\n\");\n\n output += \"\\n\\n# Using this information\\n\\n\";\n output += `- The organization's name is the identifier for the organization, and is used in many tools for \\`organizationSlug\\`.\\n`;\n\n const hasValidRegionUrls = organizations.some((org) =>\n org.links?.regionUrl?.trim(),\n );\n\n if (hasValidRegionUrls) {\n output += `- If a tool supports passing in the \\`regionUrl\\`, you MUST pass in the correct value shown above for each organization.\\n`;\n output += `- For Sentry's Cloud Service (sentry.io), always use the regionUrl to ensure requests go to the correct region.\\n`;\n } else {\n output += `- This appears to be a self-hosted Sentry installation. You can omit the \\`regionUrl\\` parameter when using other tools.\\n`;\n output += `- For self-hosted Sentry, the regionUrl is typically empty and not needed for API calls.\\n`;\n }\n\n return output;\n },\n});\n"],"mappings":";;;;AAIA,iCAAe,0BAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,UAAW;CAC5B,aAAa;EACX;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa,CAAE;CACf,MAAM,QAAQ,QAAQA,SAAwB;EAG5C,MAAM,aAAa,kCAAsB,QAAQ;EACjD,MAAM,gBAAgB,MAAM,WAAW,mBAAmB;EAE1D,IAAI,SAAS;AAEb,MAAI,cAAc,WAAW,GAAG;AAC9B,aAAU;AACV,UAAO;EACR;AAED,YAAU,cACP,IAAI,CAAC,QACJ;IACG,OAAO,IAAI,KAAK;GACjB;IACC,eAAe,IAAI,OAAO,mBAAmB;IAC7C,kBAAkB,IAAI,OAAO,aAAa;EAC5C,EAAC,KAAK,KAAK,CACb,CACA,KAAK,OAAO;AAEf,YAAU;AACV,aAAW;EAEX,MAAM,qBAAqB,cAAc,KAAK,CAAC,QAC7C,IAAI,OAAO,WAAW,MAAM,CAC7B;AAED,MAAI,oBAAoB;AACtB,cAAW;AACX,cAAW;EACZ,OAAM;AACL,cAAW;AACX,cAAW;EACZ;AAED,SAAO;CACR;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-organizations-HUZFa8ZA.js","names":["context: ServerContext"],"sources":["../src/tools/find-organizations.ts"],"sourcesContent":["import { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport type { ServerContext } from \"../types\";\n\nexport default defineTool({\n name: \"find_organizations\",\n requiredScopes: [\"org:read\"],\n description: [\n \"Find organizations that the user has access to in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View all organizations in Sentry\",\n \"- Find an organization's slug to aid other tool requests\",\n ].join(\"\\n\"),\n inputSchema: {},\n async handler(params, context: ServerContext) {\n // User data endpoints (like /users/me/regions/) should never use regionUrl\n // as they must always query the main API server, not region-specific servers\n const apiService = apiServiceFromContext(context);\n const organizations = await apiService.listOrganizations();\n\n let output = \"# Organizations\\n\\n\";\n\n if (organizations.length === 0) {\n output += \"You don't appear to be a member of any organizations.\\n\";\n return output;\n }\n\n output += organizations\n .map((org) =>\n [\n `## **${org.slug}**`,\n \"\",\n `**Web URL:** ${org.links?.organizationUrl || \"Not available\"}`,\n `**Region URL:** ${org.links?.regionUrl || \"\"}`,\n ].join(\"\\n\"),\n )\n .join(\"\\n\\n\");\n\n output += \"\\n\\n# Using this information\\n\\n\";\n output += `- The organization's name is the identifier for the organization, and is used in many tools for \\`organizationSlug\\`.\\n`;\n\n const hasValidRegionUrls = organizations.some((org) =>\n org.links?.regionUrl?.trim(),\n );\n\n if (hasValidRegionUrls) {\n output += `- If a tool supports passing in the \\`regionUrl\\`, you MUST pass in the correct value shown above for each organization.\\n`;\n output += `- For Sentry's Cloud Service (sentry.io), always use the regionUrl to ensure requests go to the correct region.\\n`;\n } else {\n output += `- This appears to be a self-hosted Sentry installation. You can omit the \\`regionUrl\\` parameter when using other tools.\\n`;\n output += `- For self-hosted Sentry, the regionUrl is typically empty and not needed for API calls.\\n`;\n }\n\n return output;\n },\n});\n"],"mappings":";;;;AAIA,iCAAe,WAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,UAAW;CAC5B,aAAa;EACX;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa,CAAE;CACf,MAAM,QAAQ,QAAQA,SAAwB;EAG5C,MAAM,aAAa,sBAAsB,QAAQ;EACjD,MAAM,gBAAgB,MAAM,WAAW,mBAAmB;EAE1D,IAAI,SAAS;AAEb,MAAI,cAAc,WAAW,GAAG;AAC9B,aAAU;AACV,UAAO;EACR;AAED,YAAU,cACP,IAAI,CAAC,QACJ;IACG,OAAO,IAAI,KAAK;GACjB;IACC,eAAe,IAAI,OAAO,mBAAmB;IAC7C,kBAAkB,IAAI,OAAO,aAAa;EAC5C,EAAC,KAAK,KAAK,CACb,CACA,KAAK,OAAO;AAEf,YAAU;AACV,aAAW;EAEX,MAAM,qBAAqB,cAAc,KAAK,CAAC,QAC7C,IAAI,OAAO,WAAW,MAAM,CAC7B;AAED,MAAI,oBAAoB;AACtB,cAAW;AACX,cAAW;EACZ,OAAM;AACL,cAAW;AACX,cAAW;EACZ;AAED,SAAO;CACR;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-projects-CWNLthwg.cjs","names":["ParamOrganizationSlug","context: ServerContext","UserInputError"],"sources":["../src/tools/find-projects.ts"],"sourcesContent":["import { setTag } from \"@sentry/core\";\nimport { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport { ParamOrganizationSlug, ParamRegionUrl } from \"../schema\";\n\nexport default defineTool({\n name: \"find_projects\",\n requiredScopes: [\"project:read\"],\n description: [\n \"Find projects in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View all projects in a Sentry organization\",\n \"- Find a project's slug to aid other tool requests\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n if (!organizationSlug) {\n throw new UserInputError(\n \"Organization slug is required. Please provide an organizationSlug parameter.\",\n );\n }\n\n setTag(\"organization.slug\", organizationSlug);\n\n const projects = await apiService.listProjects(organizationSlug);\n let output = `# Projects in **${organizationSlug}**\\n\\n`;\n if (projects.length === 0) {\n output += \"No projects found.\\n\";\n return output;\n }\n output += projects.map((project) => `- **${project.slug}**\\n`).join(\"\");\n return output;\n },\n});\n"],"mappings":";;;;;;;;AAOA,4BAAe,0BAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,cAAe;CAChC,aAAa;EACX;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkBA;EAClB,WAAW,8BAAe,UAAU;CACrC;CACD,MAAM,QAAQ,QAAQC,SAAwB;EAC5C,MAAM,aAAa,kCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,OAAK,iBACH,OAAM,IAAIC,8BACR;AAIJ,4BAAO,qBAAqB,iBAAiB;EAE7C,MAAM,WAAW,MAAM,WAAW,aAAa,iBAAiB;EAChE,IAAI,UAAU,kBAAkB,iBAAiB;AACjD,MAAI,SAAS,WAAW,GAAG;AACzB,aAAU;AACV,UAAO;EACR;AACD,YAAU,SAAS,IAAI,CAAC,aAAa,MAAM,QAAQ,KAAK,MAAM,CAAC,KAAK,GAAG;AACvE,SAAO;CACR;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-projects-Dy1_O9L0.js","names":["context: ServerContext"],"sources":["../src/tools/find-projects.ts"],"sourcesContent":["import { setTag } from \"@sentry/core\";\nimport { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport { ParamOrganizationSlug, ParamRegionUrl } from \"../schema\";\n\nexport default defineTool({\n name: \"find_projects\",\n requiredScopes: [\"project:read\"],\n description: [\n \"Find projects in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View all projects in a Sentry organization\",\n \"- Find a project's slug to aid other tool requests\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n if (!organizationSlug) {\n throw new UserInputError(\n \"Organization slug is required. Please provide an organizationSlug parameter.\",\n );\n }\n\n setTag(\"organization.slug\", organizationSlug);\n\n const projects = await apiService.listProjects(organizationSlug);\n let output = `# Projects in **${organizationSlug}**\\n\\n`;\n if (projects.length === 0) {\n output += \"No projects found.\\n\";\n return output;\n }\n output += projects.map((project) => `- **${project.slug}**\\n`).join(\"\");\n return output;\n },\n});\n"],"mappings":";;;;;;;AAOA,4BAAe,WAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,cAAe;CAChC,aAAa;EACX;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB;EAClB,WAAW,eAAe,UAAU;CACrC;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,sBAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,OAAK,iBACH,OAAM,IAAI,eACR;AAIJ,SAAO,qBAAqB,iBAAiB;EAE7C,MAAM,WAAW,MAAM,WAAW,aAAa,iBAAiB;EAChE,IAAI,UAAU,kBAAkB,iBAAiB;AACjD,MAAI,SAAS,WAAW,GAAG;AACzB,aAAU;AACV,UAAO;EACR;AACD,YAAU,SAAS,IAAI,CAAC,aAAa,MAAM,QAAQ,KAAK,MAAM,CAAC,KAAK,GAAG;AACvE,SAAO;CACR;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-releases-BtazPcQH.cjs","names":["ParamOrganizationSlug","context: ServerContext"],"sources":["../src/tools/find-releases.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlugOrAll,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_releases\",\n requiredScopes: [\"project:read\"],\n description: [\n \"Find releases in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Find recent releases in a Sentry organization\",\n \"- Find the most recent version released of a specific project\",\n \"- Determine when a release was deployed to an environment\",\n \"\",\n \"<examples>\",\n \"### Find the most recent releases in the 'my-organization' organization\",\n \"\",\n \"```\",\n \"find_releases(organizationSlug='my-organization')\",\n \"```\",\n \"\",\n \"### Find releases matching '2ce6a27' in the 'my-organization' organization\",\n \"\",\n \"```\",\n \"find_releases(organizationSlug='my-organization', query='2ce6a27')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlugOrAll.optional(),\n query: z\n .string()\n .trim()\n .describe(\"Search for versions which contain the provided string.\")\n .optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n\n const releases = await apiService.listReleases({\n organizationSlug,\n projectSlug: params.projectSlug,\n query: params.query,\n });\n let output = `# Releases in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (releases.length === 0) {\n output += \"No releases found.\\n\";\n return output;\n }\n output += releases\n .map((release) => {\n const releaseInfo = [\n `## ${release.shortVersion}`,\n \"\",\n `**Created**: ${new Date(release.dateCreated).toISOString()}`,\n ];\n if (release.dateReleased) {\n releaseInfo.push(\n `**Released**: ${new Date(release.dateReleased).toISOString()}`,\n );\n }\n if (release.firstEvent) {\n releaseInfo.push(\n `**First Event**: ${new Date(release.firstEvent).toISOString()}`,\n );\n }\n if (release.lastEvent) {\n releaseInfo.push(\n `**Last Event**: ${new Date(release.lastEvent).toISOString()}`,\n );\n }\n if (release.newGroups !== undefined) {\n releaseInfo.push(`**New Issues**: ${release.newGroups}`);\n }\n if (release.projects && release.projects.length > 0) {\n releaseInfo.push(\n `**Projects**: ${release.projects.map((p) => p.name).join(\", \")}`,\n );\n }\n if (release.lastCommit) {\n releaseInfo.push(\"\", `### Last Commit`, \"\");\n releaseInfo.push(`**Commit ID**: ${release.lastCommit.id}`);\n releaseInfo.push(`**Commit Message**: ${release.lastCommit.message}`);\n releaseInfo.push(\n `**Commit Author**: ${release.lastCommit.author.name}`,\n );\n releaseInfo.push(\n `**Commit Date**: ${new Date(release.lastCommit.dateCreated).toISOString()}`,\n );\n }\n if (release.lastDeploy) {\n releaseInfo.push(\"\", `### Last Deploy`, \"\");\n releaseInfo.push(`**Deploy ID**: ${release.lastDeploy.id}`);\n releaseInfo.push(\n `**Environment**: ${release.lastDeploy.environment}`,\n );\n if (release.lastDeploy.dateStarted) {\n releaseInfo.push(\n `**Deploy Started**: ${new Date(release.lastDeploy.dateStarted).toISOString()}`,\n );\n }\n if (release.lastDeploy.dateFinished) {\n releaseInfo.push(\n `**Deploy Finished**: ${new Date(release.lastDeploy.dateFinished).toISOString()}`,\n );\n }\n }\n return releaseInfo.join(\"\\n\");\n })\n .join(\"\\n\\n\");\n output += \"\\n\\n\";\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the Release version in commit messages or documentation.\\n`;\n output += `- You can search for issues in a specific release using the \\`find_errors()\\` tool with the query \\`release:${releases.length ? releases[0]!.shortVersion : \"VERSION\"}\\`.\\n`;\n return output;\n },\n});\n"],"mappings":";;;;;;;;AAWA,4BAAe,0BAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,cAAe;CAChC,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EA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Y,MAAM,sBAAsB,QAAQ,WAAW,UAAU;AACrE,gBAAY,MACT,qBAAqB,QAAQ,WAAW,OAAO,OACjD;AACD,gBAAY,MACT,mBAAmB,IAAI,KAAK,QAAQ,WAAW,aAAa,aAAa,GAC3E;GACF;AACD,OAAI,QAAQ,YAAY;AACtB,gBAAY,KAAK,KAAK,kBAAkB,GAAG;AAC3C,gBAAY,MAAM,iBAAiB,QAAQ,WAAW,KAAK;AAC3D,gBAAY,MACT,mBAAmB,QAAQ,WAAW,cACxC;AACD,QAAI,QAAQ,WAAW,YACrB,aAAY,MACT,sBAAsB,IAAI,KAAK,QAAQ,WAAW,aAAa,aAAa,GAC9E;AAEH,QAAI,QAAQ,WAAW,aACrB,aAAY,MACT,uBAAuB,IAAI,KAAK,QAAQ,WAAW,cAAc,aAAa,GAChF;GAEJ;AACD,UAAO,YAAY,KAAK,KAAK;EAC9B,EAAC,CACD,KAAK,OAAO;AACf,YAAU;AACV,YAAU;AACV,aAAW;AACX,aAAW,8GAA8G,SAAS,SAAS,SAAS,GAAI,eAAe,UAAU;AACjL,SAAO;CACR;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-releases-DN_BfQM2.js","names":["context: ServerContext"],"sources":["../src/tools/find-releases.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlugOrAll,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_releases\",\n requiredScopes: [\"project:read\"],\n description: [\n \"Find releases in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Find recent releases in a Sentry organization\",\n \"- Find the most recent version released of a specific project\",\n \"- Determine when a release was deployed to an environment\",\n \"\",\n \"<examples>\",\n \"### Find the most recent releases in the 'my-organization' organization\",\n \"\",\n \"```\",\n \"find_releases(organizationSlug='my-organization')\",\n \"```\",\n \"\",\n \"### Find releases matching '2ce6a27' in the 'my-organization' organization\",\n \"\",\n \"```\",\n \"find_releases(organizationSlug='my-organization', query='2ce6a27')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlugOrAll.optional(),\n query: z\n .string()\n .trim()\n .describe(\"Search for versions which contain the provided string.\")\n .optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n\n const releases = await apiService.listReleases({\n organizationSlug,\n projectSlug: params.projectSlug,\n query: params.query,\n });\n let output = `# Releases in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (releases.length === 0) {\n output += \"No releases found.\\n\";\n return output;\n }\n output += releases\n .map((release) => {\n const releaseInfo = [\n `## ${release.shortVersion}`,\n \"\",\n `**Created**: ${new Date(release.dateCreated).toISOString()}`,\n ];\n if (release.dateReleased) {\n releaseInfo.push(\n `**Released**: ${new Date(release.dateReleased).toISOString()}`,\n );\n }\n if (release.firstEvent) {\n releaseInfo.push(\n `**First Event**: ${new Date(release.firstEvent).toISOString()}`,\n );\n }\n if (release.lastEvent) {\n releaseInfo.push(\n `**Last Event**: ${new Date(release.lastEvent).toISOString()}`,\n );\n }\n if (release.newGroups !== undefined) {\n releaseInfo.push(`**New Issues**: ${release.newGroups}`);\n }\n if (release.projects && release.projects.length > 0) {\n releaseInfo.push(\n `**Projects**: ${release.projects.map((p) => p.name).join(\", \")}`,\n );\n }\n if (release.lastCommit) {\n releaseInfo.push(\"\", `### Last Commit`, \"\");\n releaseInfo.push(`**Commit ID**: ${release.lastCommit.id}`);\n releaseInfo.push(`**Commit Message**: ${release.lastCommit.message}`);\n releaseInfo.push(\n `**Commit Author**: ${release.lastCommit.author.name}`,\n );\n releaseInfo.push(\n `**Commit Date**: ${new Date(release.lastCommit.dateCreated).toISOString()}`,\n );\n }\n if (release.lastDeploy) {\n releaseInfo.push(\"\", `### Last Deploy`, \"\");\n releaseInfo.push(`**Deploy ID**: ${release.lastDeploy.id}`);\n releaseInfo.push(\n `**Environment**: ${release.lastDeploy.environment}`,\n );\n if (release.lastDeploy.dateStarted) {\n releaseInfo.push(\n `**Deploy Started**: ${new Date(release.lastDeploy.dateStarted).toISOString()}`,\n );\n }\n if (release.lastDeploy.dateFinished) {\n releaseInfo.push(\n `**Deploy Finished**: ${new Date(release.lastDeploy.dateFinished).toISOString()}`,\n );\n }\n }\n return releaseInfo.join(\"\\n\");\n })\n .join(\"\\n\\n\");\n output += \"\\n\\n\";\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the Release version in commit messages or documentation.\\n`;\n output += `- You can search for issues in a specific release using the \\`find_errors()\\` tool with the query \\`release:${releases.length ? releases[0]!.shortVersion : \"VERSION\"}\\`.\\n`;\n return output;\n },\n});\n"],"mappings":";;;;;;;AAWA,4BAAe,WAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,cAAe;CAChC,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB;EAClB,WAAW,eAAe,UAAU;EACpC,aAAa,sBAAsB,UAAU;EAC7C,OAAO,EACJ,QAAQ,CACR,MAAM,CACN,SAAS,yDAAyD,CAClE,UAAU;CACd;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,sBAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC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AAW,KAAK;AAC3D,gBAAY,MACT,mBAAmB,QAAQ,WAAW,cACxC;AACD,QAAI,QAAQ,WAAW,YACrB,aAAY,MACT,sBAAsB,IAAI,KAAK,QAAQ,WAAW,aAAa,aAAa,GAC9E;AAEH,QAAI,QAAQ,WAAW,aACrB,aAAY,MACT,uBAAuB,IAAI,KAAK,QAAQ,WAAW,cAAc,aAAa,GAChF;GAEJ;AACD,UAAO,YAAY,KAAK,KAAK;EAC9B,EAAC,CACD,KAAK,OAAO;AACf,YAAU;AACV,YAAU;AACV,aAAW;AACX,aAAW,8GAA8G,SAAS,SAAS,SAAS,GAAI,eAAe,UAAU;AACjL,SAAO;CACR;AACF,EAAC"}
@@ -1,40 +0,0 @@
1
- import { UserInputError } from "./errors-D_R568zP.js";
2
- import { defineTool } from "./define-2Lj8Lm1t.js";
3
- import { apiServiceFromContext } from "./api-mjnGhOW2.js";
4
- import { ParamOrganizationSlug, ParamRegionUrl } from "./schema-DPJO5nkQ.js";
5
- import { setTag } from "@sentry/core";
6
-
7
- //#region src/tools/find-teams.ts
8
- var find_teams_default = defineTool({
9
- name: "find_teams",
10
- requiredScopes: ["team:read"],
11
- description: [
12
- "Find teams in an organization in Sentry.",
13
- "",
14
- "Use this tool when you need to:",
15
- "- View all teams in a Sentry organization",
16
- "- Find a team's slug to aid other tool requests"
17
- ].join("\n"),
18
- inputSchema: {
19
- organizationSlug: ParamOrganizationSlug,
20
- regionUrl: ParamRegionUrl.optional()
21
- },
22
- async handler(params, context) {
23
- const apiService = apiServiceFromContext(context, { regionUrl: params.regionUrl });
24
- const organizationSlug = params.organizationSlug;
25
- if (!organizationSlug) throw new UserInputError("Organization slug is required. Please provide an organizationSlug parameter.");
26
- setTag("organization.slug", organizationSlug);
27
- const teams = await apiService.listTeams(organizationSlug);
28
- let output = `# Teams in **${organizationSlug}**\n\n`;
29
- if (teams.length === 0) {
30
- output += "No teams found.\n";
31
- return output;
32
- }
33
- output += teams.map((team) => `- ${team.slug}\n`).join("");
34
- return output;
35
- }
36
- });
37
-
38
- //#endregion
39
- export { find_teams_default };
40
- //# sourceMappingURL=find-teams-CRVT4KOg.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-teams-CRVT4KOg.js","names":["context: ServerContext"],"sources":["../src/tools/find-teams.ts"],"sourcesContent":["import { setTag } from \"@sentry/core\";\nimport { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport { ParamOrganizationSlug, ParamRegionUrl } from \"../schema\";\n\nexport default defineTool({\n name: \"find_teams\",\n requiredScopes: [\"team:read\"],\n description: [\n \"Find teams in an organization in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View all teams in a Sentry organization\",\n \"- Find a team's slug to aid other tool requests\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n if (!organizationSlug) {\n throw new UserInputError(\n \"Organization slug is required. Please provide an organizationSlug parameter.\",\n );\n }\n\n setTag(\"organization.slug\", organizationSlug);\n\n const teams = await apiService.listTeams(organizationSlug);\n let output = `# Teams in **${organizationSlug}**\\n\\n`;\n if (teams.length === 0) {\n output += \"No teams found.\\n\";\n return output;\n }\n output += teams.map((team) => `- ${team.slug}\\n`).join(\"\");\n return output;\n },\n});\n"],"mappings":";;;;;;;AAOA,yBAAe,WAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,WAAY;CAC7B,aAAa;EACX;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB;EAClB,WAAW,eAAe,UAAU;CACrC;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,sBAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,OAAK,iBACH,OAAM,IAAI,eACR;AAIJ,SAAO,qBAAqB,iBAAiB;EAE7C,MAAM,QAAQ,MAAM,WAAW,UAAU,iBAAiB;EAC1D,IAAI,UAAU,eAAe,iBAAiB;AAC9C,MAAI,MAAM,WAAW,GAAG;AACtB,aAAU;AACV,UAAO;EACR;AACD,YAAU,MAAM,IAAI,CAAC,UAAU,IAAI,KAAK,KAAK,IAAI,CAAC,KAAK,GAAG;AAC1D,SAAO;CACR;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-teams-_zAHPVGx.cjs","names":["ParamOrganizationSlug","context: ServerContext","UserInputError"],"sources":["../src/tools/find-teams.ts"],"sourcesContent":["import { setTag } from \"@sentry/core\";\nimport { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport { ParamOrganizationSlug, ParamRegionUrl } from \"../schema\";\n\nexport default defineTool({\n name: \"find_teams\",\n requiredScopes: [\"team:read\"],\n description: [\n \"Find teams in an organization in Sentry.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View all teams in a Sentry organization\",\n \"- Find a team's slug to aid other tool requests\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n if (!organizationSlug) {\n throw new UserInputError(\n \"Organization slug is required. Please provide an organizationSlug parameter.\",\n );\n }\n\n setTag(\"organization.slug\", organizationSlug);\n\n const teams = await apiService.listTeams(organizationSlug);\n let output = `# Teams in **${organizationSlug}**\\n\\n`;\n if (teams.length === 0) {\n output += \"No teams found.\\n\";\n return output;\n }\n output += teams.map((team) => `- ${team.slug}\\n`).join(\"\");\n return output;\n },\n});\n"],"mappings":";;;;;;;;AAOA,yBAAe,0BAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,WAAY;CAC7B,aAAa;EACX;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkBA;EAClB,WAAW,8BAAe,UAAU;CACrC;CACD,MAAM,QAAQ,QAAQC,SAAwB;EAC5C,MAAM,aAAa,kCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,OAAK,iBACH,OAAM,IAAIC,8BACR;AAIJ,4BAAO,qBAAqB,iBAAiB;EAE7C,MAAM,QAAQ,MAAM,WAAW,UAAU,iBAAiB;EAC1D,IAAI,UAAU,eAAe,iBAAiB;AAC9C,MAAI,MAAM,WAAW,GAAG;AACtB,aAAU;AACV,UAAO;EACR;AACD,YAAU,MAAM,IAAI,CAAC,UAAU,IAAI,KAAK,KAAK,IAAI,CAAC,KAAK,GAAG;AAC1D,SAAO;CACR;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatting-BjCK9XwW.js","names":["LANGUAGE_EXTENSIONS: Record<string, string>","LANGUAGE_MODULE_PATTERNS: Array<[RegExp, string]>","frame: z.infer<typeof FrameInterface>","platform?: string | null","frameIndex?: number","event: Event","parts: string[]","data: z.infer<typeof ErrorEntrySchema>","platform: string | null","index: number","totalExceptions: number","data: z.infer<typeof RequestEntrySchema>","data: z.infer<typeof MessageEntrySchema>","data: z.infer<typeof ThreadsEntrySchema>","lines: string[]","value: unknown","vars: Record<string, unknown>","frames: z.infer<typeof FrameInterface>[]","tags: z.infer<typeof EventSchema>[\"tags\"]","contexts: z.infer<typeof EventSchema>[\"contexts\"]","autofixState: AutofixRunState | undefined","organizationSlug: string","issueId: string"],"sources":["../src/internal/formatting.ts"],"sourcesContent":["/**\n * LLM response formatting utilities for Sentry data.\n *\n * Converts Sentry API responses into structured markdown format optimized\n * for LLM consumption. Handles stacktraces, event details, issue summaries,\n * and contextual information with consistent formatting patterns.\n */\nimport type { z } from \"zod\";\nimport type { Event, Issue, AutofixRunState } from \"../api-client/types\";\nimport type {\n ErrorEntrySchema,\n ErrorEventSchema,\n EventSchema,\n FrameInterface,\n RequestEntrySchema,\n MessageEntrySchema,\n ThreadsEntrySchema,\n SentryApiService,\n AutofixRunStepRootCauseAnalysisSchema,\n} from \"../api-client\";\nimport {\n getOutputForAutofixStep,\n isTerminalStatus,\n getStatusDisplayName,\n} from \"./tool-helpers/seer\";\n\n// Language detection mappings\nconst LANGUAGE_EXTENSIONS: Record<string, string> = {\n \".java\": \"java\",\n \".py\": \"python\",\n \".js\": \"javascript\",\n \".jsx\": \"javascript\",\n \".ts\": \"javascript\",\n \".tsx\": \"javascript\",\n \".rb\": \"ruby\",\n \".php\": \"php\",\n};\n\nconst LANGUAGE_MODULE_PATTERNS: Array<[RegExp, string]> = [\n [/^(java\\.|com\\.|org\\.)/, \"java\"],\n];\n\n/**\n * Detects the programming language of a stack frame based on the file extension.\n * Falls back to the platform parameter if no filename is available or extension is unrecognized.\n *\n * @param frame - The stack frame containing file and location information\n * @param platform - Optional platform hint to use as fallback\n * @returns The detected language or platform fallback or \"unknown\"\n */\nfunction detectLanguage(\n frame: z.infer<typeof FrameInterface>,\n platform?: string | null,\n): string {\n // Check filename extensions\n if (frame.filename) {\n const ext = frame.filename.toLowerCase().match(/\\.[^.]+$/)?.[0];\n if (ext && LANGUAGE_EXTENSIONS[ext]) {\n return LANGUAGE_EXTENSIONS[ext];\n }\n }\n\n // Check module patterns\n if (frame.module) {\n for (const [pattern, language] of LANGUAGE_MODULE_PATTERNS) {\n if (pattern.test(frame.module)) {\n return language;\n }\n }\n }\n\n // Fallback to platform or unknown\n return platform || \"unknown\";\n}\n\n/**\n * Formats a stack frame into a language-specific string representation.\n * Different languages have different conventions for displaying stack traces.\n *\n * @param frame - The stack frame to format\n * @param frameIndex - Optional frame index for languages that display frame numbers\n * @param platform - Optional platform hint for language detection fallback\n * @returns Formatted stack frame string\n */\nexport function formatFrameHeader(\n frame: z.infer<typeof FrameInterface>,\n frameIndex?: number,\n platform?: string | null,\n) {\n const language = detectLanguage(frame, platform);\n\n switch (language) {\n case \"java\": {\n // at com.example.ClassName.methodName(FileName.java:123)\n const className = frame.module || \"UnknownClass\";\n const method = frame.function || \"<unknown>\";\n const source = frame.filename || \"Unknown Source\";\n const location = frame.lineNo ? `:${frame.lineNo}` : \"\";\n return `at ${className}.${method}(${source}${location})`;\n }\n\n case \"python\": {\n // File \"/path/to/file.py\", line 42, in function_name\n const file =\n frame.filename || frame.absPath || frame.module || \"<unknown>\";\n const func = frame.function || \"<module>\";\n const line = frame.lineNo ? `, line ${frame.lineNo}` : \"\";\n return ` File \"${file}\"${line}, in ${func}`;\n }\n\n case \"javascript\": {\n // Original compact format: filename:line:col (function)\n // This preserves backward compatibility\n return `${[frame.filename, frame.lineNo, frame.colNo]\n .filter((i) => !!i)\n .join(\":\")}${frame.function ? ` (${frame.function})` : \"\"}`;\n }\n\n case \"ruby\": {\n // from /path/to/file.rb:42:in `method_name'\n const file = frame.filename || frame.module || \"<unknown>\";\n const func = frame.function ? ` \\`${frame.function}\\`` : \"\";\n const line = frame.lineNo ? `:${frame.lineNo}:in` : \"\";\n return ` from ${file}${line}${func}`;\n }\n\n case \"php\": {\n // #0 /path/to/file.php(42): functionName()\n const file = frame.filename || \"<unknown>\";\n const line = frame.lineNo ? `(${frame.lineNo})` : \"\";\n const func = frame.function || \"<unknown>\";\n const prefix = frameIndex !== undefined ? `#${frameIndex} ` : \"\";\n return `${prefix}${file}${line}: ${func}()`;\n }\n\n default: {\n // Generic format for unknown languages\n const func = frame.function || \"<unknown>\";\n const location = frame.filename || frame.module || \"<unknown>\";\n const line = frame.lineNo ? `:${frame.lineNo}` : \"\";\n const col = frame.colNo != null ? `:${frame.colNo}` : \"\";\n return ` at ${func} (${location}${line}${col})`;\n }\n }\n}\n\n/**\n * Formats a Sentry event into a structured markdown output.\n * Includes error messages, stack traces, request info, and contextual data.\n *\n * @param event - The Sentry event to format\n * @returns Formatted markdown string\n */\nexport function formatEventOutput(event: Event) {\n let output = \"\";\n\n // Look for the primary error information\n const messageEntry = event.entries.find((e) => e.type === \"message\");\n const exceptionEntry = event.entries.find((e) => e.type === \"exception\");\n const threadsEntry = event.entries.find((e) => e.type === \"threads\");\n const requestEntry = event.entries.find((e) => e.type === \"request\");\n\n // Error message (if present)\n if (messageEntry) {\n output += formatMessageInterfaceOutput(\n event,\n messageEntry.data as z.infer<typeof MessageEntrySchema>,\n );\n }\n\n // Stack trace (from exception or threads)\n if (exceptionEntry) {\n output += formatExceptionInterfaceOutput(\n event,\n exceptionEntry.data as z.infer<typeof ErrorEntrySchema>,\n );\n } else if (threadsEntry) {\n output += formatThreadsInterfaceOutput(\n event,\n threadsEntry.data as z.infer<typeof ThreadsEntrySchema>,\n );\n }\n\n // Request info (if HTTP error)\n if (requestEntry) {\n output += formatRequestInterfaceOutput(\n event,\n requestEntry.data as z.infer<typeof RequestEntrySchema>,\n );\n }\n\n output += formatTags(event.tags);\n output += formatContexts(event.contexts);\n return output;\n}\n\n/**\n * Extracts the context line matching the frame's line number for inline display.\n * This is used in the full stacktrace view to show the actual line of code\n * that caused the error inline with the stack frame.\n *\n * @param frame - The stack frame containing context lines\n * @returns The line of code at the frame's line number, or empty string if not available\n */\nfunction renderInlineContext(frame: z.infer<typeof FrameInterface>): string {\n if (!frame.context?.length || !frame.lineNo) {\n return \"\";\n }\n\n const contextLine = frame.context.find(([lineNo]) => lineNo === frame.lineNo);\n return contextLine ? `\\n${contextLine[1]}` : \"\";\n}\n\n/**\n * Renders an enhanced view of a stack frame with context lines and variables.\n * Used for the \"Most Relevant Frame\" section to provide detailed information\n * about the most relevant application frame where the error occurred.\n *\n * @param frame - The stack frame to render with enhanced information\n * @param event - The Sentry event containing platform information for language detection\n * @returns Formatted string with frame header, context lines, and variables table\n */\nfunction renderEnhancedFrame(\n frame: z.infer<typeof FrameInterface>,\n event: Event,\n): string {\n const parts: string[] = [];\n\n parts.push(\"**Most Relevant Frame:**\");\n parts.push(\"─────────────────────\");\n parts.push(formatFrameHeader(frame, undefined, event.platform));\n\n // Add context lines if available\n if (frame.context?.length) {\n const contextLines = renderContextLines(frame);\n if (contextLines) {\n parts.push(\"\");\n parts.push(contextLines);\n }\n }\n\n // Add variables table if available\n if (frame.vars && Object.keys(frame.vars).length > 0) {\n parts.push(\"\");\n parts.push(renderVariablesTable(frame.vars));\n }\n\n return parts.join(\"\\n\");\n}\n\nfunction formatExceptionInterfaceOutput(\n event: Event,\n data: z.infer<typeof ErrorEntrySchema>,\n) {\n const parts: string[] = [];\n\n // Handle both single exception (value) and chained exceptions (values)\n const exceptions = data.values || (data.value ? [data.value] : []);\n\n if (exceptions.length === 0) {\n return \"\";\n }\n\n // For chained exceptions, they are typically ordered from innermost to outermost\n // We'll render them in reverse order (outermost first) to match how they occurred\n const isChained = exceptions.length > 1;\n\n // Create a copy before reversing to avoid mutating the original array\n [...exceptions].reverse().forEach((exception, index) => {\n if (!exception) return;\n\n // Add language-specific chain indicator for multiple exceptions\n if (isChained && index > 0) {\n parts.push(\"\");\n parts.push(\n getExceptionChainMessage(\n event.platform || null,\n index,\n exceptions.length,\n ),\n );\n parts.push(\"\");\n }\n\n // Use the actual exception type and value as the heading\n const exceptionTitle = `${exception.type}${exception.value ? `: ${exception.value}` : \"\"}`;\n\n parts.push(index === 0 ? \"### Error\" : `### ${exceptionTitle}`);\n parts.push(\"\");\n\n // Add the error details in a code block for the first exception\n // to maintain backward compatibility\n if (index === 0) {\n parts.push(\"```\");\n parts.push(exceptionTitle);\n parts.push(\"```\");\n parts.push(\"\");\n }\n\n if (!exception.stacktrace || !exception.stacktrace.frames) {\n parts.push(\"**Stacktrace:**\");\n parts.push(\"```\");\n parts.push(\"No stacktrace available\");\n parts.push(\"```\");\n return;\n }\n\n const frames = exception.stacktrace.frames;\n\n // Only show enhanced frame for the first (outermost) exception to avoid overwhelming output\n if (index === 0) {\n const firstInAppFrame = findFirstInAppFrame(frames);\n if (\n firstInAppFrame &&\n (firstInAppFrame.context?.length || firstInAppFrame.vars)\n ) {\n parts.push(renderEnhancedFrame(firstInAppFrame, event));\n parts.push(\"\");\n parts.push(\"**Full Stacktrace:**\");\n parts.push(\"────────────────\");\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n\n parts.push(\"```\");\n parts.push(\n frames\n .map((frame) => {\n const header = formatFrameHeader(frame, undefined, event.platform);\n const context = renderInlineContext(frame);\n return `${header}${context}`;\n })\n .join(\"\\n\"),\n );\n parts.push(\"```\");\n });\n\n parts.push(\"\");\n parts.push(\"\");\n\n return parts.join(\"\\n\");\n}\n\n/**\n * Get the appropriate exception chain message based on the platform\n */\nfunction getExceptionChainMessage(\n platform: string | null,\n index: number,\n totalExceptions: number,\n): string {\n // Default message for unknown platforms\n const defaultMessage =\n \"**During handling of the above exception, another exception occurred:**\";\n\n if (!platform) {\n return defaultMessage;\n }\n\n switch (platform.toLowerCase()) {\n case \"python\":\n // Python has two distinct messages, but without additional metadata\n // we default to the implicit chaining message\n return \"**During handling of the above exception, another exception occurred:**\";\n\n case \"java\":\n return \"**Caused by:**\";\n\n case \"csharp\":\n case \"dotnet\":\n return \"**---> Inner Exception:**\";\n\n case \"ruby\":\n return \"**Caused by:**\";\n\n case \"go\":\n return \"**Wrapped error:**\";\n\n case \"rust\":\n return `**Caused by (${index}):**`;\n\n default:\n return defaultMessage;\n }\n}\n\nfunction formatRequestInterfaceOutput(\n event: Event,\n data: z.infer<typeof RequestEntrySchema>,\n) {\n if (!data.method || !data.url) {\n return \"\";\n }\n return `### HTTP Request\\n\\n**Method:** ${data.method}\\n**URL:** ${data.url}\\n\\n`;\n}\n\nfunction formatMessageInterfaceOutput(\n event: Event,\n data: z.infer<typeof MessageEntrySchema>,\n) {\n if (!data.formatted && !data.message) {\n return \"\";\n }\n const message = data.formatted || data.message || \"\";\n return `### Error\\n\\n${\"```\"}\\n${message}\\n${\"```\"}\\n\\n`;\n}\n\nfunction formatThreadsInterfaceOutput(\n event: Event,\n data: z.infer<typeof ThreadsEntrySchema>,\n) {\n if (!data.values || data.values.length === 0) {\n return \"\";\n }\n\n // Find the crashed thread only\n const crashedThread = data.values.find((t) => t.crashed);\n\n if (!crashedThread?.stacktrace?.frames) {\n return \"\";\n }\n\n const parts: string[] = [];\n\n // Include thread name if available\n if (crashedThread.name) {\n parts.push(`**Thread** (${crashedThread.name})`);\n parts.push(\"\");\n }\n\n const frames = crashedThread.stacktrace.frames;\n\n // Find and format the first in-app frame with enhanced view\n const firstInAppFrame = findFirstInAppFrame(frames);\n if (\n firstInAppFrame &&\n (firstInAppFrame.context?.length || firstInAppFrame.vars)\n ) {\n parts.push(renderEnhancedFrame(firstInAppFrame, event));\n parts.push(\"\");\n parts.push(\"**Full Stacktrace:**\");\n parts.push(\"────────────────\");\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n\n parts.push(\"```\");\n parts.push(\n frames\n .map((frame) => {\n const header = formatFrameHeader(frame, undefined, event.platform);\n const context = renderInlineContext(frame);\n return `${header}${context}`;\n })\n .join(\"\\n\"),\n );\n parts.push(\"```\");\n parts.push(\"\");\n\n return parts.join(\"\\n\");\n}\n\n/**\n * Renders surrounding source code context for a stack frame.\n * Shows a window of code lines around the error line with visual indicators.\n *\n * @param frame - The stack frame containing context lines\n * @param contextSize - Number of lines to show before and after the error line (default: 3)\n * @returns Formatted context lines with line numbers and arrow indicator for the error line\n */\nfunction renderContextLines(\n frame: z.infer<typeof FrameInterface>,\n contextSize = 3,\n): string {\n if (!frame.context || frame.context.length === 0 || !frame.lineNo) {\n return \"\";\n }\n\n const lines: string[] = [];\n const errorLine = frame.lineNo;\n const maxLineNoWidth = Math.max(\n ...frame.context.map(([lineNo]) => lineNo.toString().length),\n );\n\n for (const [lineNo, code] of frame.context) {\n const isErrorLine = lineNo === errorLine;\n const lineNoStr = lineNo.toString().padStart(maxLineNoWidth, \" \");\n\n if (Math.abs(lineNo - errorLine) <= contextSize) {\n if (isErrorLine) {\n lines.push(` → ${lineNoStr} │ ${code}`);\n } else {\n lines.push(` ${lineNoStr} │ ${code}`);\n }\n }\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Formats a variable value for display in the variables table.\n * Handles different types appropriately and safely, converting complex objects\n * to readable representations and handling edge cases like circular references.\n *\n * @param value - The variable value to format (can be any type)\n * @param maxLength - Maximum length for stringified objects/arrays (default: 80)\n * @returns Human-readable string representation of the value\n */\nfunction formatVariableValue(value: unknown, maxLength = 80): string {\n try {\n if (typeof value === \"string\") {\n return `\"${value}\"`;\n }\n if (value === null) {\n return \"null\";\n }\n if (value === undefined) {\n return \"undefined\";\n }\n if (typeof value === \"object\") {\n const stringified = JSON.stringify(value);\n if (stringified.length > maxLength) {\n // Leave room for \", ...]\" or \", ...}\"\n const truncateAt = maxLength - 6;\n let truncated = stringified.substring(0, truncateAt);\n\n // Find the last complete element by looking for the last comma\n const lastComma = truncated.lastIndexOf(\",\");\n if (lastComma > 0) {\n truncated = truncated.substring(0, lastComma);\n }\n\n // Add the appropriate ending\n if (Array.isArray(value)) {\n return `${truncated}, ...]`;\n }\n return `${truncated}, ...}`;\n }\n return stringified;\n }\n return String(value);\n } catch {\n // Handle circular references or other stringify errors\n return `<${typeof value}>`;\n }\n}\n\n/**\n * Renders a table of local variables in a tree-like format.\n * Uses box-drawing characters to create a visual hierarchy of variables\n * and their values at the point where the error occurred.\n *\n * @param vars - Object containing variable names as keys and their values\n * @returns Formatted variables table with tree-style prefix characters\n */\nfunction renderVariablesTable(vars: Record<string, unknown>): string {\n const entries = Object.entries(vars);\n if (entries.length === 0) {\n return \"\";\n }\n\n const lines: string[] = [\"Local Variables:\"];\n const lastIndex = entries.length - 1;\n\n entries.forEach(([key, value], index) => {\n const prefix = index === lastIndex ? \"└─\" : \"├─\";\n const valueStr = formatVariableValue(value);\n lines.push(`${prefix} ${key}: ${valueStr}`);\n });\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Finds the first application frame (in_app) in a stack trace.\n * Searches from the bottom of the stack (oldest frame) to find the first\n * frame that belongs to the user's application code rather than libraries.\n *\n * @param frames - Array of stack frames, typically in reverse chronological order\n * @returns The first in-app frame found, or undefined if none exist\n */\nfunction findFirstInAppFrame(\n frames: z.infer<typeof FrameInterface>[],\n): z.infer<typeof FrameInterface> | undefined {\n // Frames are usually in reverse order (most recent first)\n // We want the first in-app frame from the bottom\n for (let i = frames.length - 1; i >= 0; i--) {\n if (frames[i].inApp === true) {\n return frames[i];\n }\n }\n return undefined;\n}\n\nfunction formatTags(tags: z.infer<typeof EventSchema>[\"tags\"]) {\n if (!tags || tags.length === 0) {\n return \"\";\n }\n return `### Tags\\n\\n${tags\n .map((tag) => `**${tag.key}**: ${tag.value}`)\n .join(\"\\n\")}\\n\\n`;\n}\n\nfunction formatContexts(contexts: z.infer<typeof EventSchema>[\"contexts\"]) {\n if (!contexts || Object.keys(contexts).length === 0) {\n return \"\";\n }\n return `### Additional Context\\n\\nThese are additional context provided by the user when they're instrumenting their application.\\n\\n${Object.entries(\n contexts,\n )\n .map(\n ([name, data]) =>\n `**${name}**\\n${Object.entries(data)\n .filter(([key, _]) => key !== \"type\")\n .map(([key, value]) => {\n return `${key}: ${JSON.stringify(value, undefined, 2)}`;\n })\n .join(\"\\n\")}`,\n )\n .join(\"\\n\\n\")}\\n\\n`;\n}\n\n/**\n * Formats a brief Seer AI analysis summary for inclusion in issue details.\n * Shows current status and high-level insights, prompting to use analyze_issue_with_seer for full details.\n *\n * @param autofixState - The autofix state containing Seer analysis data\n * @param organizationSlug - The organization slug for the issue\n * @param issueId - The issue ID (shortId)\n * @returns Formatted markdown string with Seer summary, or empty string if no analysis exists\n */\nfunction formatSeerSummary(\n autofixState: AutofixRunState | undefined,\n organizationSlug: string,\n issueId: string,\n): string {\n if (!autofixState || !autofixState.autofix) {\n return \"\";\n }\n\n const { autofix } = autofixState;\n const parts: string[] = [];\n\n parts.push(\"## Seer AI Analysis\");\n parts.push(\"\");\n\n // Show status first\n const statusDisplay = getStatusDisplayName(autofix.status);\n if (!isTerminalStatus(autofix.status)) {\n parts.push(`**Status:** ${statusDisplay}`);\n parts.push(\"\");\n }\n\n // Show summary of what we have so far\n if (autofix.steps.length > 0) {\n const completedSteps = autofix.steps.filter(\n (step) => step.status === \"COMPLETED\",\n );\n\n // Find the solution step if available\n const solutionStep = completedSteps.find(\n (step) => step.type === \"solution\",\n );\n\n if (solutionStep) {\n // For solution steps, use the description directly\n const solutionDescription = solutionStep.description;\n if (\n solutionDescription &&\n typeof solutionDescription === \"string\" &&\n solutionDescription.trim()\n ) {\n parts.push(\"**Summary:**\");\n parts.push(solutionDescription.trim());\n } else {\n // Fallback to extracting from output if no description\n const solutionOutput = getOutputForAutofixStep(solutionStep);\n const lines = solutionOutput.split(\"\\n\");\n const firstParagraph = lines.find(\n (line) =>\n line.trim().length > 50 &&\n !line.startsWith(\"#\") &&\n !line.startsWith(\"*\"),\n );\n if (firstParagraph) {\n parts.push(\"**Summary:**\");\n parts.push(firstParagraph.trim());\n }\n }\n } else if (completedSteps.length > 0) {\n // Show what steps have been completed so far\n const rootCauseStep = completedSteps.find(\n (step) => step.type === \"root_cause_analysis\",\n );\n\n if (rootCauseStep) {\n const typedStep = rootCauseStep as z.infer<\n typeof AutofixRunStepRootCauseAnalysisSchema\n >;\n if (\n typedStep.causes &&\n typedStep.causes.length > 0 &&\n typedStep.causes[0].description\n ) {\n parts.push(\"**Root Cause Identified:**\");\n parts.push(typedStep.causes[0].description.trim());\n }\n } else {\n // Show generic progress\n parts.push(\n `**Progress:** ${completedSteps.length} of ${autofix.steps.length} steps completed`,\n );\n }\n }\n } else {\n // No steps yet - check for terminal states first\n if (isTerminalStatus(autofix.status)) {\n if (autofix.status === \"FAILED\" || autofix.status === \"ERROR\") {\n parts.push(\"**Status:** Analysis failed.\");\n } else if (autofix.status === \"CANCELLED\") {\n parts.push(\"**Status:** Analysis was cancelled.\");\n } else if (\n autofix.status === \"NEED_MORE_INFORMATION\" ||\n autofix.status === \"WAITING_FOR_USER_RESPONSE\"\n ) {\n parts.push(\n \"**Status:** Analysis paused - additional information needed.\",\n );\n }\n } else {\n parts.push(\"Analysis has started but no results yet.\");\n }\n }\n\n // Add specific messages for terminal states when steps exist\n if (autofix.steps.length > 0 && isTerminalStatus(autofix.status)) {\n if (autofix.status === \"FAILED\" || autofix.status === \"ERROR\") {\n parts.push(\"\");\n parts.push(\"**Status:** Analysis failed.\");\n } else if (autofix.status === \"CANCELLED\") {\n parts.push(\"\");\n parts.push(\"**Status:** Analysis was cancelled.\");\n } else if (\n autofix.status === \"NEED_MORE_INFORMATION\" ||\n autofix.status === \"WAITING_FOR_USER_RESPONSE\"\n ) {\n parts.push(\"\");\n parts.push(\n \"**Status:** Analysis paused - additional information needed.\",\n );\n }\n }\n\n // Always suggest using analyze_issue_with_seer for more details\n parts.push(\"\");\n parts.push(\n `**Note:** For detailed root cause analysis and solutions, call \\`analyze_issue_with_seer(organizationSlug='${organizationSlug}', issueId='${issueId}')\\``,\n );\n\n return `${parts.join(\"\\n\")}\\n\\n`;\n}\n\n/**\n * Formats a Sentry issue with its latest event into comprehensive markdown output.\n * Includes issue metadata, event details, and usage instructions.\n *\n * @param params - Object containing organization slug, issue, event, and API service\n * @returns Formatted markdown string with complete issue information\n */\nexport function formatIssueOutput({\n organizationSlug,\n issue,\n event,\n apiService,\n autofixState,\n}: {\n organizationSlug: string;\n issue: Issue;\n event: Event;\n apiService: SentryApiService;\n autofixState?: AutofixRunState;\n}) {\n let output = `# Issue ${issue.shortId} in **${organizationSlug}**\\n\\n`;\n output += `**Description**: ${issue.title}\\n`;\n output += `**Culprit**: ${issue.culprit}\\n`;\n output += `**First Seen**: ${new Date(issue.firstSeen).toISOString()}\\n`;\n output += `**Last Seen**: ${new Date(issue.lastSeen).toISOString()}\\n`;\n output += `**Occurrences**: ${issue.count}\\n`;\n output += `**Users Impacted**: ${issue.userCount}\\n`;\n output += `**Status**: ${issue.status}\\n`;\n output += `**Platform**: ${issue.platform}\\n`;\n output += `**Project**: ${issue.project.name}\\n`;\n output += `**URL**: ${apiService.getIssueUrl(organizationSlug, issue.shortId)}\\n`;\n output += \"\\n\";\n output += \"## Event Details\\n\\n\";\n output += `**Event ID**: ${event.id}\\n`;\n if (event.type === \"error\") {\n output += `**Occurred At**: ${new Date((event as z.infer<typeof ErrorEventSchema>).dateCreated).toISOString()}\\n`;\n }\n if (event.message) {\n output += `**Message**:\\n${event.message}\\n`;\n }\n output += \"\\n\";\n output += formatEventOutput(event);\n\n // Add Seer context if available\n if (autofixState) {\n output += formatSeerSummary(autofixState, organizationSlug, issue.shortId);\n }\n\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the IssueID in commit messages (e.g. \\`Fixes ${issue.shortId}\\`) to automatically close the issue when the commit is merged.\\n`;\n output +=\n \"- The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\\n\";\n return output;\n}\n"],"mappings":";;;AA2BA,MAAMA,sBAA8C;CAClD,SAAS;CACT,OAAO;CACP,OAAO;CACP,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,OAAO;CACP,QAAQ;AACT;AAED,MAAMC,2BAAoD,CACxD,CAAC,yBAAyB,MAAO,CAClC;;;;;;;;;AAUD,SAAS,eACPC,OACAC,UACQ;AAER,KAAI,MAAM,UAAU;EAClB,MAAM,MAAM,MAAM,SAAS,aAAa,CAAC,MAAM,WAAW,GAAG;AAC7D,MAAI,OAAO,oBAAoB,KAC7B,QAAO,oBAAoB;CAE9B;AAGD,KAAI,MAAM,QACR;OAAK,MAAM,CAAC,SAAS,SAAS,IAAI,yBAChC,KAAI,QAAQ,KAAK,MAAM,OAAO,CAC5B,QAAO;CAEV;AAIH,QAAO,YAAY;AACpB;;;;;;;;;;AAWD,SAAgB,kBACdD,OACAE,YACAD,UACA;CACA,MAAM,WAAW,eAAe,OAAO,SAAS;AAEhD,SAAQ,UAAR;EACE,KAAK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B,EAChC,kBACA,OACA,OACA,YACA,cAOD,EAAE;CACD,IAAI,UAAU,UAAU,MAAM,QAAQ,QAAQ,iBAAiB;AAC/D,YAAW,mBAAmB,MAAM,MAAM;AAC1C,YAAW,eAAe,MAAM,QAAQ;AACxC,YAAW,kBAAkB,IAAI,KAAK,MAAM,WAAW,aAAa,CAAC;AACrE,YAAW,iBAAiB,IAAI,KAAK,MAAM,UAAU,aAAa,CAAC;AACnE,YAAW,mBAAmB,MAAM,MAAM;AAC1C,YAAW,sBAAsB,MAAM,UAAU;AACjD,YAAW,cAAc,MAAM,OAAO;AACtC,YAAW,gBAAgB,MAAM,SAAS;AAC1C,YAAW,eAAe,MAAM,QAAQ,KAAK;AAC7C,YAAW,WAAW,WAAW,YAAY,kBAAkB,MAAM,QAAQ,CAAC;AAC9E,WAAU;AACV,WAAU;AACV,YAAW,gBAAgB,MAAM,GAAG;AACpC,KAAI,MAAM,SAAS,QACjB,YAAW,mBAAmB,IAAI,KAAM,MAA2C,aAAa,aAAa,CAAC;AAEhH,KAAI,MAAM,QACR,YAAW,gBAAgB,MAAM,QAAQ;AAE3C,WAAU;AACV,WAAU,kBAAkB,MAAM;AAGlC,KAAI,aACF,WAAU,kBAAkB,cAAc,kBAAkB,MAAM,QAAQ;AAG5E,WAAU;AACV,YAAW,mEAAmE,MAAM,QAAQ;AAC5F,WACE;AACF,QAAO;AACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatting-CqmsvuAY.cjs","names":["LANGUAGE_EXTENSIONS: Record<string, string>","LANGUAGE_MODULE_PATTERNS: Array<[RegExp, string]>","frame: z.infer<typeof FrameInterface>","platform?: string | null","frameIndex?: number","event: Event","parts: string[]","data: z.infer<typeof ErrorEntrySchema>","platform: string | null","index: number","totalExceptions: number","data: z.infer<typeof RequestEntrySchema>","data: z.infer<typeof MessageEntrySchema>","data: z.infer<typeof ThreadsEntrySchema>","lines: string[]","value: unknown","vars: Record<string, unknown>","frames: z.infer<typeof FrameInterface>[]","tags: z.infer<typeof EventSchema>[\"tags\"]","contexts: z.infer<typeof EventSchema>[\"contexts\"]","autofixState: AutofixRunState | undefined","organizationSlug: string","issueId: string"],"sources":["../src/internal/formatting.ts"],"sourcesContent":["/**\n * LLM response formatting utilities for Sentry data.\n *\n * Converts Sentry API responses into structured markdown format optimized\n * for LLM consumption. Handles stacktraces, event details, issue summaries,\n * and contextual information with consistent formatting patterns.\n */\nimport type { z } from \"zod\";\nimport type { Event, Issue, AutofixRunState } from \"../api-client/types\";\nimport type {\n ErrorEntrySchema,\n ErrorEventSchema,\n EventSchema,\n FrameInterface,\n RequestEntrySchema,\n MessageEntrySchema,\n ThreadsEntrySchema,\n SentryApiService,\n AutofixRunStepRootCauseAnalysisSchema,\n} from \"../api-client\";\nimport {\n getOutputForAutofixStep,\n isTerminalStatus,\n getStatusDisplayName,\n} from \"./tool-helpers/seer\";\n\n// Language detection mappings\nconst LANGUAGE_EXTENSIONS: Record<string, string> = {\n \".java\": \"java\",\n \".py\": \"python\",\n \".js\": \"javascript\",\n \".jsx\": \"javascript\",\n \".ts\": \"javascript\",\n \".tsx\": \"javascript\",\n \".rb\": \"ruby\",\n \".php\": \"php\",\n};\n\nconst LANGUAGE_MODULE_PATTERNS: Array<[RegExp, string]> = [\n [/^(java\\.|com\\.|org\\.)/, \"java\"],\n];\n\n/**\n * Detects the programming language of a stack frame based on the file extension.\n * Falls back to the platform parameter if no filename is available or extension is unrecognized.\n *\n * @param frame - The stack frame containing file and location information\n * @param platform - Optional platform hint to use as fallback\n * @returns The detected language or platform fallback or \"unknown\"\n */\nfunction detectLanguage(\n frame: z.infer<typeof FrameInterface>,\n platform?: string | null,\n): string {\n // Check filename extensions\n if (frame.filename) {\n const ext = frame.filename.toLowerCase().match(/\\.[^.]+$/)?.[0];\n if (ext && LANGUAGE_EXTENSIONS[ext]) {\n return LANGUAGE_EXTENSIONS[ext];\n }\n }\n\n // Check module patterns\n if (frame.module) {\n for (const [pattern, language] of LANGUAGE_MODULE_PATTERNS) {\n if (pattern.test(frame.module)) {\n return language;\n }\n }\n }\n\n // Fallback to platform or unknown\n return platform || \"unknown\";\n}\n\n/**\n * Formats a stack frame into a language-specific string representation.\n * Different languages have different conventions for displaying stack traces.\n *\n * @param frame - The stack frame to format\n * @param frameIndex - Optional frame index for languages that display frame numbers\n * @param platform - Optional platform hint for language detection fallback\n * @returns Formatted stack frame string\n */\nexport function formatFrameHeader(\n frame: z.infer<typeof FrameInterface>,\n frameIndex?: number,\n platform?: string | null,\n) {\n const language = detectLanguage(frame, platform);\n\n switch (language) {\n case \"java\": {\n // at com.example.ClassName.methodName(FileName.java:123)\n const className = frame.module || \"UnknownClass\";\n const method = frame.function || \"<unknown>\";\n const source = frame.filename || \"Unknown Source\";\n const location = frame.lineNo ? `:${frame.lineNo}` : \"\";\n return `at ${className}.${method}(${source}${location})`;\n }\n\n case \"python\": {\n // File \"/path/to/file.py\", line 42, in function_name\n const file =\n frame.filename || frame.absPath || frame.module || \"<unknown>\";\n const func = frame.function || \"<module>\";\n const line = frame.lineNo ? `, line ${frame.lineNo}` : \"\";\n return ` File \"${file}\"${line}, in ${func}`;\n }\n\n case \"javascript\": {\n // Original compact format: filename:line:col (function)\n // This preserves backward compatibility\n return `${[frame.filename, frame.lineNo, frame.colNo]\n .filter((i) => !!i)\n .join(\":\")}${frame.function ? ` (${frame.function})` : \"\"}`;\n }\n\n case \"ruby\": {\n // from /path/to/file.rb:42:in `method_name'\n const file = frame.filename || frame.module || \"<unknown>\";\n const func = frame.function ? ` \\`${frame.function}\\`` : \"\";\n const line = frame.lineNo ? `:${frame.lineNo}:in` : \"\";\n return ` from ${file}${line}${func}`;\n }\n\n case \"php\": {\n // #0 /path/to/file.php(42): functionName()\n const file = frame.filename || \"<unknown>\";\n const line = frame.lineNo ? `(${frame.lineNo})` : \"\";\n const func = frame.function || \"<unknown>\";\n const prefix = frameIndex !== undefined ? `#${frameIndex} ` : \"\";\n return `${prefix}${file}${line}: ${func}()`;\n }\n\n default: {\n // Generic format for unknown languages\n const func = frame.function || \"<unknown>\";\n const location = frame.filename || frame.module || \"<unknown>\";\n const line = frame.lineNo ? `:${frame.lineNo}` : \"\";\n const col = frame.colNo != null ? `:${frame.colNo}` : \"\";\n return ` at ${func} (${location}${line}${col})`;\n }\n }\n}\n\n/**\n * Formats a Sentry event into a structured markdown output.\n * Includes error messages, stack traces, request info, and contextual data.\n *\n * @param event - The Sentry event to format\n * @returns Formatted markdown string\n */\nexport function formatEventOutput(event: Event) {\n let output = \"\";\n\n // Look for the primary error information\n const messageEntry = event.entries.find((e) => e.type === \"message\");\n const exceptionEntry = event.entries.find((e) => e.type === \"exception\");\n const threadsEntry = event.entries.find((e) => e.type === \"threads\");\n const requestEntry = event.entries.find((e) => e.type === \"request\");\n\n // Error message (if present)\n if (messageEntry) {\n output += formatMessageInterfaceOutput(\n event,\n messageEntry.data as z.infer<typeof MessageEntrySchema>,\n );\n }\n\n // Stack trace (from exception or threads)\n if (exceptionEntry) {\n output += formatExceptionInterfaceOutput(\n event,\n exceptionEntry.data as z.infer<typeof ErrorEntrySchema>,\n );\n } else if (threadsEntry) {\n output += formatThreadsInterfaceOutput(\n event,\n threadsEntry.data as z.infer<typeof ThreadsEntrySchema>,\n );\n }\n\n // Request info (if HTTP error)\n if (requestEntry) {\n output += formatRequestInterfaceOutput(\n event,\n requestEntry.data as z.infer<typeof RequestEntrySchema>,\n );\n }\n\n output += formatTags(event.tags);\n output += formatContexts(event.contexts);\n return output;\n}\n\n/**\n * Extracts the context line matching the frame's line number for inline display.\n * This is used in the full stacktrace view to show the actual line of code\n * that caused the error inline with the stack frame.\n *\n * @param frame - The stack frame containing context lines\n * @returns The line of code at the frame's line number, or empty string if not available\n */\nfunction renderInlineContext(frame: z.infer<typeof FrameInterface>): string {\n if (!frame.context?.length || !frame.lineNo) {\n return \"\";\n }\n\n const contextLine = frame.context.find(([lineNo]) => lineNo === frame.lineNo);\n return contextLine ? `\\n${contextLine[1]}` : \"\";\n}\n\n/**\n * Renders an enhanced view of a stack frame with context lines and variables.\n * Used for the \"Most Relevant Frame\" section to provide detailed information\n * about the most relevant application frame where the error occurred.\n *\n * @param frame - The stack frame to render with enhanced information\n * @param event - The Sentry event containing platform information for language detection\n * @returns Formatted string with frame header, context lines, and variables table\n */\nfunction renderEnhancedFrame(\n frame: z.infer<typeof FrameInterface>,\n event: Event,\n): string {\n const parts: string[] = [];\n\n parts.push(\"**Most Relevant Frame:**\");\n parts.push(\"─────────────────────\");\n parts.push(formatFrameHeader(frame, undefined, event.platform));\n\n // Add context lines if available\n if (frame.context?.length) {\n const contextLines = renderContextLines(frame);\n if (contextLines) {\n parts.push(\"\");\n parts.push(contextLines);\n }\n }\n\n // Add variables table if available\n if (frame.vars && Object.keys(frame.vars).length > 0) {\n parts.push(\"\");\n parts.push(renderVariablesTable(frame.vars));\n }\n\n return parts.join(\"\\n\");\n}\n\nfunction formatExceptionInterfaceOutput(\n event: Event,\n data: z.infer<typeof ErrorEntrySchema>,\n) {\n const parts: string[] = [];\n\n // Handle both single exception (value) and chained exceptions (values)\n const exceptions = data.values || (data.value ? [data.value] : []);\n\n if (exceptions.length === 0) {\n return \"\";\n }\n\n // For chained exceptions, they are typically ordered from innermost to outermost\n // We'll render them in reverse order (outermost first) to match how they occurred\n const isChained = exceptions.length > 1;\n\n // Create a copy before reversing to avoid mutating the original array\n [...exceptions].reverse().forEach((exception, index) => {\n if (!exception) return;\n\n // Add language-specific chain indicator for multiple exceptions\n if (isChained && index > 0) {\n parts.push(\"\");\n parts.push(\n getExceptionChainMessage(\n event.platform || null,\n index,\n exceptions.length,\n ),\n );\n parts.push(\"\");\n }\n\n // Use the actual exception type and value as the heading\n const exceptionTitle = `${exception.type}${exception.value ? `: ${exception.value}` : \"\"}`;\n\n parts.push(index === 0 ? \"### Error\" : `### ${exceptionTitle}`);\n parts.push(\"\");\n\n // Add the error details in a code block for the first exception\n // to maintain backward compatibility\n if (index === 0) {\n parts.push(\"```\");\n parts.push(exceptionTitle);\n parts.push(\"```\");\n parts.push(\"\");\n }\n\n if (!exception.stacktrace || !exception.stacktrace.frames) {\n parts.push(\"**Stacktrace:**\");\n parts.push(\"```\");\n parts.push(\"No stacktrace available\");\n parts.push(\"```\");\n return;\n }\n\n const frames = exception.stacktrace.frames;\n\n // Only show enhanced frame for the first (outermost) exception to avoid overwhelming output\n if (index === 0) {\n const firstInAppFrame = findFirstInAppFrame(frames);\n if (\n firstInAppFrame &&\n (firstInAppFrame.context?.length || firstInAppFrame.vars)\n ) {\n parts.push(renderEnhancedFrame(firstInAppFrame, event));\n parts.push(\"\");\n parts.push(\"**Full Stacktrace:**\");\n parts.push(\"────────────────\");\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n\n parts.push(\"```\");\n parts.push(\n frames\n .map((frame) => {\n const header = formatFrameHeader(frame, undefined, event.platform);\n const context = renderInlineContext(frame);\n return `${header}${context}`;\n })\n .join(\"\\n\"),\n );\n parts.push(\"```\");\n });\n\n parts.push(\"\");\n parts.push(\"\");\n\n return parts.join(\"\\n\");\n}\n\n/**\n * Get the appropriate exception chain message based on the platform\n */\nfunction getExceptionChainMessage(\n platform: string | null,\n index: number,\n totalExceptions: number,\n): string {\n // Default message for unknown platforms\n const defaultMessage =\n \"**During handling of the above exception, another exception occurred:**\";\n\n if (!platform) {\n return defaultMessage;\n }\n\n switch (platform.toLowerCase()) {\n case \"python\":\n // Python has two distinct messages, but without additional metadata\n // we default to the implicit chaining message\n return \"**During handling of the above exception, another exception occurred:**\";\n\n case \"java\":\n return \"**Caused by:**\";\n\n case \"csharp\":\n case \"dotnet\":\n return \"**---> Inner Exception:**\";\n\n case \"ruby\":\n return \"**Caused by:**\";\n\n case \"go\":\n return \"**Wrapped error:**\";\n\n case \"rust\":\n return `**Caused by (${index}):**`;\n\n default:\n return defaultMessage;\n }\n}\n\nfunction formatRequestInterfaceOutput(\n event: Event,\n data: z.infer<typeof RequestEntrySchema>,\n) {\n if (!data.method || !data.url) {\n return \"\";\n }\n return `### HTTP Request\\n\\n**Method:** ${data.method}\\n**URL:** ${data.url}\\n\\n`;\n}\n\nfunction formatMessageInterfaceOutput(\n event: Event,\n data: z.infer<typeof MessageEntrySchema>,\n) {\n if (!data.formatted && !data.message) {\n return \"\";\n }\n const message = data.formatted || data.message || \"\";\n return `### Error\\n\\n${\"```\"}\\n${message}\\n${\"```\"}\\n\\n`;\n}\n\nfunction formatThreadsInterfaceOutput(\n event: Event,\n data: z.infer<typeof ThreadsEntrySchema>,\n) {\n if (!data.values || data.values.length === 0) {\n return \"\";\n }\n\n // Find the crashed thread only\n const crashedThread = data.values.find((t) => t.crashed);\n\n if (!crashedThread?.stacktrace?.frames) {\n return \"\";\n }\n\n const parts: string[] = [];\n\n // Include thread name if available\n if (crashedThread.name) {\n parts.push(`**Thread** (${crashedThread.name})`);\n parts.push(\"\");\n }\n\n const frames = crashedThread.stacktrace.frames;\n\n // Find and format the first in-app frame with enhanced view\n const firstInAppFrame = findFirstInAppFrame(frames);\n if (\n firstInAppFrame &&\n (firstInAppFrame.context?.length || firstInAppFrame.vars)\n ) {\n parts.push(renderEnhancedFrame(firstInAppFrame, event));\n parts.push(\"\");\n parts.push(\"**Full Stacktrace:**\");\n parts.push(\"────────────────\");\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n\n parts.push(\"```\");\n parts.push(\n frames\n .map((frame) => {\n const header = formatFrameHeader(frame, undefined, event.platform);\n const context = renderInlineContext(frame);\n return `${header}${context}`;\n })\n .join(\"\\n\"),\n );\n parts.push(\"```\");\n parts.push(\"\");\n\n return parts.join(\"\\n\");\n}\n\n/**\n * Renders surrounding source code context for a stack frame.\n * Shows a window of code lines around the error line with visual indicators.\n *\n * @param frame - The stack frame containing context lines\n * @param contextSize - Number of lines to show before and after the error line (default: 3)\n * @returns Formatted context lines with line numbers and arrow indicator for the error line\n */\nfunction renderContextLines(\n frame: z.infer<typeof FrameInterface>,\n contextSize = 3,\n): string {\n if (!frame.context || frame.context.length === 0 || !frame.lineNo) {\n return \"\";\n }\n\n const lines: string[] = [];\n const errorLine = frame.lineNo;\n const maxLineNoWidth = Math.max(\n ...frame.context.map(([lineNo]) => lineNo.toString().length),\n );\n\n for (const [lineNo, code] of frame.context) {\n const isErrorLine = lineNo === errorLine;\n const lineNoStr = lineNo.toString().padStart(maxLineNoWidth, \" \");\n\n if (Math.abs(lineNo - errorLine) <= contextSize) {\n if (isErrorLine) {\n lines.push(` → ${lineNoStr} │ ${code}`);\n } else {\n lines.push(` ${lineNoStr} │ ${code}`);\n }\n }\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Formats a variable value for display in the variables table.\n * Handles different types appropriately and safely, converting complex objects\n * to readable representations and handling edge cases like circular references.\n *\n * @param value - The variable value to format (can be any type)\n * @param maxLength - Maximum length for stringified objects/arrays (default: 80)\n * @returns Human-readable string representation of the value\n */\nfunction formatVariableValue(value: unknown, maxLength = 80): string {\n try {\n if (typeof value === \"string\") {\n return `\"${value}\"`;\n }\n if (value === null) {\n return \"null\";\n }\n if (value === undefined) {\n return \"undefined\";\n }\n if (typeof value === \"object\") {\n const stringified = JSON.stringify(value);\n if (stringified.length > maxLength) {\n // Leave room for \", ...]\" or \", ...}\"\n const truncateAt = maxLength - 6;\n let truncated = stringified.substring(0, truncateAt);\n\n // Find the last complete element by looking for the last comma\n const lastComma = truncated.lastIndexOf(\",\");\n if (lastComma > 0) {\n truncated = truncated.substring(0, lastComma);\n }\n\n // Add the appropriate ending\n if (Array.isArray(value)) {\n return `${truncated}, ...]`;\n }\n return `${truncated}, ...}`;\n }\n return stringified;\n }\n return String(value);\n } catch {\n // Handle circular references or other stringify errors\n return `<${typeof value}>`;\n }\n}\n\n/**\n * Renders a table of local variables in a tree-like format.\n * Uses box-drawing characters to create a visual hierarchy of variables\n * and their values at the point where the error occurred.\n *\n * @param vars - Object containing variable names as keys and their values\n * @returns Formatted variables table with tree-style prefix characters\n */\nfunction renderVariablesTable(vars: Record<string, unknown>): string {\n const entries = Object.entries(vars);\n if (entries.length === 0) {\n return \"\";\n }\n\n const lines: string[] = [\"Local Variables:\"];\n const lastIndex = entries.length - 1;\n\n entries.forEach(([key, value], index) => {\n const prefix = index === lastIndex ? \"└─\" : \"├─\";\n const valueStr = formatVariableValue(value);\n lines.push(`${prefix} ${key}: ${valueStr}`);\n });\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Finds the first application frame (in_app) in a stack trace.\n * Searches from the bottom of the stack (oldest frame) to find the first\n * frame that belongs to the user's application code rather than libraries.\n *\n * @param frames - Array of stack frames, typically in reverse chronological order\n * @returns The first in-app frame found, or undefined if none exist\n */\nfunction findFirstInAppFrame(\n frames: z.infer<typeof FrameInterface>[],\n): z.infer<typeof FrameInterface> | undefined {\n // Frames are usually in reverse order (most recent first)\n // We want the first in-app frame from the bottom\n for (let i = frames.length - 1; i >= 0; i--) {\n if (frames[i].inApp === true) {\n return frames[i];\n }\n }\n return undefined;\n}\n\nfunction formatTags(tags: z.infer<typeof EventSchema>[\"tags\"]) {\n if (!tags || tags.length === 0) {\n return \"\";\n }\n return `### Tags\\n\\n${tags\n .map((tag) => `**${tag.key}**: ${tag.value}`)\n .join(\"\\n\")}\\n\\n`;\n}\n\nfunction formatContexts(contexts: z.infer<typeof EventSchema>[\"contexts\"]) {\n if (!contexts || Object.keys(contexts).length === 0) {\n return \"\";\n }\n return `### Additional Context\\n\\nThese are additional context provided by the user when they're instrumenting their application.\\n\\n${Object.entries(\n contexts,\n )\n .map(\n ([name, data]) =>\n `**${name}**\\n${Object.entries(data)\n .filter(([key, _]) => key !== \"type\")\n .map(([key, value]) => {\n return `${key}: ${JSON.stringify(value, undefined, 2)}`;\n })\n .join(\"\\n\")}`,\n )\n .join(\"\\n\\n\")}\\n\\n`;\n}\n\n/**\n * Formats a brief Seer AI analysis summary for inclusion in issue details.\n * Shows current status and high-level insights, prompting to use analyze_issue_with_seer for full details.\n *\n * @param autofixState - The autofix state containing Seer analysis data\n * @param organizationSlug - The organization slug for the issue\n * @param issueId - The issue ID (shortId)\n * @returns Formatted markdown string with Seer summary, or empty string if no analysis exists\n */\nfunction formatSeerSummary(\n autofixState: AutofixRunState | undefined,\n organizationSlug: string,\n issueId: string,\n): string {\n if (!autofixState || !autofixState.autofix) {\n return \"\";\n }\n\n const { autofix } = autofixState;\n const parts: string[] = [];\n\n parts.push(\"## Seer AI Analysis\");\n parts.push(\"\");\n\n // Show status first\n const statusDisplay = getStatusDisplayName(autofix.status);\n if (!isTerminalStatus(autofix.status)) {\n parts.push(`**Status:** ${statusDisplay}`);\n parts.push(\"\");\n }\n\n // Show summary of what we have so far\n if (autofix.steps.length > 0) {\n const completedSteps = autofix.steps.filter(\n (step) => step.status === \"COMPLETED\",\n );\n\n // Find the solution step if available\n const solutionStep = completedSteps.find(\n (step) => step.type === \"solution\",\n );\n\n if (solutionStep) {\n // For solution steps, use the description directly\n const solutionDescription = solutionStep.description;\n if (\n solutionDescription &&\n typeof solutionDescription === \"string\" &&\n solutionDescription.trim()\n ) {\n parts.push(\"**Summary:**\");\n parts.push(solutionDescription.trim());\n } else {\n // Fallback to extracting from output if no description\n const solutionOutput = getOutputForAutofixStep(solutionStep);\n const lines = solutionOutput.split(\"\\n\");\n const firstParagraph = lines.find(\n (line) =>\n line.trim().length > 50 &&\n !line.startsWith(\"#\") &&\n !line.startsWith(\"*\"),\n );\n if (firstParagraph) {\n parts.push(\"**Summary:**\");\n parts.push(firstParagraph.trim());\n }\n }\n } else if (completedSteps.length > 0) {\n // Show what steps have been completed so far\n const rootCauseStep = completedSteps.find(\n (step) => step.type === \"root_cause_analysis\",\n );\n\n if (rootCauseStep) {\n const typedStep = rootCauseStep as z.infer<\n typeof AutofixRunStepRootCauseAnalysisSchema\n >;\n if (\n typedStep.causes &&\n typedStep.causes.length > 0 &&\n typedStep.causes[0].description\n ) {\n parts.push(\"**Root Cause Identified:**\");\n parts.push(typedStep.causes[0].description.trim());\n }\n } else {\n // Show generic progress\n parts.push(\n `**Progress:** ${completedSteps.length} of ${autofix.steps.length} steps completed`,\n );\n }\n }\n } else {\n // No steps yet - check for terminal states first\n if (isTerminalStatus(autofix.status)) {\n if (autofix.status === \"FAILED\" || autofix.status === \"ERROR\") {\n parts.push(\"**Status:** Analysis failed.\");\n } else if (autofix.status === \"CANCELLED\") {\n parts.push(\"**Status:** Analysis was cancelled.\");\n } else if (\n autofix.status === \"NEED_MORE_INFORMATION\" ||\n autofix.status === \"WAITING_FOR_USER_RESPONSE\"\n ) {\n parts.push(\n \"**Status:** Analysis paused - additional information needed.\",\n );\n }\n } else {\n parts.push(\"Analysis has started but no results yet.\");\n }\n }\n\n // Add specific messages for terminal states when steps exist\n if (autofix.steps.length > 0 && isTerminalStatus(autofix.status)) {\n if (autofix.status === \"FAILED\" || autofix.status === \"ERROR\") {\n parts.push(\"\");\n parts.push(\"**Status:** Analysis failed.\");\n } else if (autofix.status === \"CANCELLED\") {\n parts.push(\"\");\n parts.push(\"**Status:** Analysis was cancelled.\");\n } else if (\n autofix.status === \"NEED_MORE_INFORMATION\" ||\n autofix.status === \"WAITING_FOR_USER_RESPONSE\"\n ) {\n parts.push(\"\");\n parts.push(\n \"**Status:** Analysis paused - additional information needed.\",\n );\n }\n }\n\n // Always suggest using analyze_issue_with_seer for more details\n parts.push(\"\");\n parts.push(\n `**Note:** For detailed root cause analysis and solutions, call \\`analyze_issue_with_seer(organizationSlug='${organizationSlug}', issueId='${issueId}')\\``,\n );\n\n return `${parts.join(\"\\n\")}\\n\\n`;\n}\n\n/**\n * Formats a Sentry issue with its latest event into comprehensive markdown output.\n * Includes issue metadata, event details, and usage instructions.\n *\n * @param params - Object containing organization slug, issue, event, and API service\n * @returns Formatted markdown string with complete issue information\n */\nexport function formatIssueOutput({\n organizationSlug,\n issue,\n event,\n apiService,\n autofixState,\n}: {\n organizationSlug: string;\n issue: Issue;\n event: Event;\n apiService: SentryApiService;\n autofixState?: AutofixRunState;\n}) {\n let output = `# Issue ${issue.shortId} in **${organizationSlug}**\\n\\n`;\n output += `**Description**: ${issue.title}\\n`;\n output += `**Culprit**: ${issue.culprit}\\n`;\n output += `**First Seen**: ${new Date(issue.firstSeen).toISOString()}\\n`;\n output += `**Last Seen**: ${new Date(issue.lastSeen).toISOString()}\\n`;\n output += `**Occurrences**: ${issue.count}\\n`;\n output += `**Users Impacted**: ${issue.userCount}\\n`;\n output += `**Status**: ${issue.status}\\n`;\n output += `**Platform**: ${issue.platform}\\n`;\n output += `**Project**: ${issue.project.name}\\n`;\n output += `**URL**: ${apiService.getIssueUrl(organizationSlug, issue.shortId)}\\n`;\n output += \"\\n\";\n output += \"## Event Details\\n\\n\";\n output += `**Event ID**: ${event.id}\\n`;\n if (event.type === \"error\") {\n output += `**Occurred At**: ${new Date((event as z.infer<typeof ErrorEventSchema>).dateCreated).toISOString()}\\n`;\n }\n if (event.message) {\n output += `**Message**:\\n${event.message}\\n`;\n }\n output += \"\\n\";\n output += formatEventOutput(event);\n\n // Add Seer context if available\n if (autofixState) {\n output += formatSeerSummary(autofixState, organizationSlug, issue.shortId);\n }\n\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the IssueID in commit messages (e.g. \\`Fixes ${issue.shortId}\\`) to automatically close the issue when the commit is merged.\\n`;\n output +=\n \"- The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\\n\";\n return output;\n}\n"],"mappings":";;;AA2BA,MAAMA,sBAA8C;CAClD,SAAS;CACT,OAAO;CACP,OAAO;CACP,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,OAAO;CACP,QAAQ;AACT;AAED,MAAMC,2BAAoD,CACxD,CAAC,yBAAyB,MAAO,CAClC;;;;;;;;;AAUD,SAAS,eACPC,OACAC,UACQ;AAER,KAAI,MAAM,UAAU;EAClB,MAAM,MAAM,MAAM,SAAS,aAAa,CAAC,MAAM,WAAW,GAAG;AAC7D,MAAI,OAAO,oBAAoB,KAC7B,QAAO,oBAAoB;CAE9B;AAGD,KAAI,MAAM,QACR;OAAK,MAAM,CAAC,SAAS,SA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yrBP,KAAA,EAxrBA,CAAA,CAAE,KAwrBF,CAAA,OAxrBe,cAwrBf,CAAA,EAAA,UAAA,CAAA,EAAA,MAAA,EAAA,QAAA,CAAA,EAAA,MAAA,GAAA,IAAA,CAAA,EAAA,MAAA;;;;AAGuB;;;;iBAvnBhB,iBAAA,QAAyB;;;;;;;;iBA4mBzB,iBAAA;;;;;;;;SAQP;SACA;cACK;iBACG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatting-l3qx5d7L.d.ts","names":[],"sources":["../src/internal/formatting.ts"],"sourcesContent":[],"mappings":";;;;;;;AAqFgB;AAoEhB;AA4mBA;;;;;;;AAQS,iBAzrBO,iBAAA,CAyrBP,KAAA,EAxrBA,CAAA,CAAE,KAwrBF,CAAA,OAxrBe,cAwrBf,CAAA,EAAA,UAAA,CAAA,EAAA,MAAA,EAAA,QAAA,CAAA,EAAA,MAAA,GAAA,IAAA,CAAA,EAAA,MAAA;;;;AAGuB;;;;iBAvnBhB,iBAAA,QAAyB;;;;;;;;iBA4mBzB,iBAAA;;;;;;;;SAQP;SACA;cACK;iBACG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-doc-Euz6NiM3.cjs","names":["context: ServerContext","UserInputError","ApiError"],"sources":["../src/tools/get-doc.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"../internal/tool-helpers/define\";\nimport { fetchWithTimeout } from \"../internal/fetch-utils\";\nimport { UserInputError } from \"../errors\";\nimport { ApiError } from \"../api-client/index\";\nimport type { ServerContext } from \"../types\";\n\nexport default defineTool({\n name: \"get_doc\",\n requiredScopes: [], // Documentation reading doesn't require specific scopes\n description: [\n \"Fetch the full markdown content of a Sentry documentation page.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Read the complete documentation for a specific topic\",\n \"- Get detailed implementation examples or code snippets\",\n \"- Access the full context of a documentation page\",\n \"- Extract specific sections from documentation\",\n \"\",\n \"<examples>\",\n \"### Get the Next.js integration guide\",\n \"\",\n \"```\",\n \"get_doc(path='/platforms/javascript/guides/nextjs.md')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- Use the path from search_docs results for accurate fetching\",\n \"- Paths should end with .md extension\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n path: z\n .string()\n .trim()\n .describe(\n \"The documentation path (e.g., '/platforms/javascript/guides/nextjs.md'). Get this from search_docs results.\",\n ),\n },\n async handler(params, context: ServerContext) {\n setTag(\"doc.path\", params.path);\n\n let output = `# Documentation Content\\n\\n`;\n output += `**Path**: ${params.path}\\n\\n`;\n\n // Validate path format\n if (!params.path.endsWith(\".md\")) {\n throw new UserInputError(\n \"Invalid documentation path. Path must end with .md extension.\",\n );\n }\n\n // Use docs.sentry.io for now - will be configurable via flag in the future\n const baseUrl = \"https://docs.sentry.io\";\n\n // Construct the full URL for the markdown file\n const docUrl = new URL(params.path, baseUrl);\n\n // Validate domain whitelist for security\n const allowedDomains = [\"docs.sentry.io\", \"develop.sentry.io\"];\n if (!allowedDomains.includes(docUrl.hostname)) {\n throw new UserInputError(\n `Invalid domain. Documentation can only be fetched from allowed domains: ${allowedDomains.join(\", \")}`,\n );\n }\n\n const response = await fetchWithTimeout(\n docUrl.toString(),\n {\n headers: {\n Accept: \"text/plain, text/markdown\",\n \"User-Agent\": \"Sentry-MCP/1.0\",\n },\n },\n 15000, // 15 second timeout\n );\n\n if (!response.ok) {\n if (response.status === 404) {\n output += `**Error**: Documentation not found at this path.\\n\\n`;\n output += `Please verify the path is correct. Common issues:\\n`;\n output += `- Path should start with / (e.g., /platforms/javascript/guides/nextjs.md)\\n`;\n output += `- Path should match exactly what's shown in search_docs results\\n`;\n output += `- Some pages may have been moved or renamed\\n\\n`;\n output += `Try searching again with \\`search_docs()\\` to find the correct path.\\n`;\n return output;\n }\n\n throw new ApiError(\n `Failed to fetch documentation: ${response.statusText}`,\n response.status,\n );\n }\n\n const content = await response.text();\n\n // Check if we got HTML instead of markdown (wrong path format)\n if (\n content.trim().startsWith(\"<!DOCTYPE\") ||\n content.trim().startsWith(\"<html\")\n ) {\n output += `> **Error**: Received HTML instead of markdown. The path may be incorrect.\\n\\n`;\n output += `Make sure to use the .md extension in the path.\\n`;\n output += `Example: /platforms/javascript/guides/nextjs.md\\n`;\n return output;\n }\n\n // Add the markdown content\n output += \"---\\n\\n\";\n output += content;\n output += \"\\n\\n---\\n\\n\";\n\n output += \"## Using this documentation\\n\\n\";\n output +=\n \"- This is the raw markdown content from Sentry's documentation\\n\";\n output +=\n \"- Code examples and configuration snippets can be copied directly\\n\";\n output +=\n \"- Links in the documentation are relative to https://docs.sentry.io\\n\";\n output +=\n \"- For more related topics, use `search_docs()` to find additional pages\\n\";\n\n return output;\n },\n});\n"],"mappings":";;;;;;;;;AAQA,sBAAe,0BAAW;CACxB,MAAM;CACN,gBAAgB,CAAE;CAClB,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa,EACX,MAAM,MACH,QAAQ,CACR,MAAM,CACN,SACC,8GACD,CACJ;CACD,MAAM,QAAQ,QAAQA,SAAwB;AAC5C,4BAAO,YAAY,OAAO,KAAK;EAE/B,IAAI,UAAU;AACd,aAAW,YAAY,OAAO,KAAK;AAGnC,OAAK,OAAO,KAAK,SAAS,MAAM,CAC9B,OAAM,IAAIC,8BACR;EAKJ,MAAM,UAAU;EAGhB,MAAM,SAAS,IAAI,IAAI,OAAO,MAAM;EAGpC,MAAM,iBAAiB,CAAC,kBAAkB,mBAAoB;AAC9D,OAAK,eAAe,SAAS,OAAO,SAAS,CAC3C,OAAM,IAAIA,+BACP,0EAA0E,eAAe,KAAK,KAAK;EAIxG,MAAM,WAAW,MAAM,qCACrB,OAAO,UAAU,EACjB,EACE,SAAS;GACP,QAAQ;GACR,cAAc;EACf,EACF,GACD,KACD;AAED,OAAK,SAAS,IAAI;AAChB,OAAI,SAAS,WAAW,KAAK;AAC3B,eAAW;AACX,eAAW;AACX,eAAW;AACX,eAAW;AACX,eAAW;AACX,eAAW;AACX,WAAO;GACR;AAED,SAAM,IAAIC,2BACP,iCAAiC,SAAS,cAC3C,SAAS;EAEZ;EAED,MAAM,UAAU,MAAM,SAAS,MAAM;AAGrC,MACE,QAAQ,MAAM,CAAC,WAAW,YAAY,IACtC,QAAQ,MAAM,CAAC,WAAW,QAAQ,EAClC;AACA,cAAW;AACX,cAAW;AACX,cAAW;AACX,UAAO;EACR;AAGD,YAAU;AACV,YAAU;AACV,YAAU;AAEV,YAAU;AACV,YACE;AACF,YACE;AACF,YACE;AACF,YACE;AAEF,SAAO;CACR;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-doc-JDwOkY2j.js","names":["context: ServerContext"],"sources":["../src/tools/get-doc.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"../internal/tool-helpers/define\";\nimport { fetchWithTimeout } from \"../internal/fetch-utils\";\nimport { UserInputError } from \"../errors\";\nimport { ApiError } from \"../api-client/index\";\nimport type { ServerContext } from \"../types\";\n\nexport default defineTool({\n name: \"get_doc\",\n requiredScopes: [], // Documentation reading doesn't require specific scopes\n description: [\n \"Fetch the full markdown content of a Sentry documentation page.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Read the complete documentation for a specific topic\",\n \"- Get detailed implementation examples or code snippets\",\n \"- Access the full context of a documentation page\",\n \"- Extract specific sections from documentation\",\n \"\",\n \"<examples>\",\n \"### Get the Next.js integration guide\",\n \"\",\n \"```\",\n \"get_doc(path='/platforms/javascript/guides/nextjs.md')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- Use the path from search_docs results for accurate fetching\",\n \"- Paths should end with .md extension\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n path: z\n .string()\n .trim()\n .describe(\n \"The documentation path (e.g., '/platforms/javascript/guides/nextjs.md'). Get this from search_docs results.\",\n ),\n },\n async handler(params, context: ServerContext) {\n setTag(\"doc.path\", params.path);\n\n let output = `# Documentation Content\\n\\n`;\n output += `**Path**: ${params.path}\\n\\n`;\n\n // Validate path format\n if (!params.path.endsWith(\".md\")) {\n throw new UserInputError(\n \"Invalid documentation path. Path must end with .md extension.\",\n );\n }\n\n // Use docs.sentry.io for now - will be configurable via flag in the future\n const baseUrl = \"https://docs.sentry.io\";\n\n // Construct the full URL for the markdown file\n const docUrl = new URL(params.path, baseUrl);\n\n // Validate domain whitelist for security\n const allowedDomains = [\"docs.sentry.io\", \"develop.sentry.io\"];\n if (!allowedDomains.includes(docUrl.hostname)) {\n throw new UserInputError(\n `Invalid domain. Documentation can only be fetched from allowed domains: ${allowedDomains.join(\", \")}`,\n );\n }\n\n const response = await fetchWithTimeout(\n docUrl.toString(),\n {\n headers: {\n Accept: \"text/plain, text/markdown\",\n \"User-Agent\": \"Sentry-MCP/1.0\",\n },\n },\n 15000, // 15 second timeout\n );\n\n if (!response.ok) {\n if (response.status === 404) {\n output += `**Error**: Documentation not found at this path.\\n\\n`;\n output += `Please verify the path is correct. Common issues:\\n`;\n output += `- Path should start with / (e.g., /platforms/javascript/guides/nextjs.md)\\n`;\n output += `- Path should match exactly what's shown in search_docs results\\n`;\n output += `- Some pages may have been moved or renamed\\n\\n`;\n output += `Try searching again with \\`search_docs()\\` to find the correct path.\\n`;\n return output;\n }\n\n throw new ApiError(\n `Failed to fetch documentation: ${response.statusText}`,\n response.status,\n );\n }\n\n const content = await response.text();\n\n // Check if we got HTML instead of markdown (wrong path format)\n if (\n content.trim().startsWith(\"<!DOCTYPE\") ||\n content.trim().startsWith(\"<html\")\n ) {\n output += `> **Error**: Received HTML instead of markdown. The path may be incorrect.\\n\\n`;\n output += `Make sure to use the .md extension in the path.\\n`;\n output += `Example: /platforms/javascript/guides/nextjs.md\\n`;\n return output;\n }\n\n // Add the markdown content\n output += \"---\\n\\n\";\n output += content;\n output += \"\\n\\n---\\n\\n\";\n\n output += \"## Using this documentation\\n\\n\";\n output +=\n \"- This is the raw markdown content from Sentry's documentation\\n\";\n output +=\n \"- Code examples and configuration snippets can be copied directly\\n\";\n output +=\n \"- Links in the documentation are relative to https://docs.sentry.io\\n\";\n output +=\n \"- For more related topics, use `search_docs()` to find additional pages\\n\";\n\n return output;\n },\n});\n"],"mappings":";;;;;;;;AAQA,sBAAe,WAAW;CACxB,MAAM;CACN,gBAAgB,CAAE;CAClB,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa,EACX,MAAM,EACH,QAAQ,CACR,MAAM,CACN,SACC,8GACD,CACJ;CACD,MAAM,QAAQ,QAAQA,SAAwB;AAC5C,SAAO,YAAY,OAAO,KAAK;EAE/B,IAAI,UAAU;AACd,aAAW,YAAY,OAAO,KAAK;AAGnC,OAAK,OAAO,KAAK,SAAS,MAAM,CAC9B,OAAM,IAAI,eACR;EAKJ,MAAM,UAAU;EAGhB,MAAM,SAAS,IAAI,IAAI,OAAO,MAAM;EAGpC,MAAM,iBAAiB,CAAC,kBAAkB,mBAAoB;AAC9D,OAAK,eAAe,SAAS,OAAO,SAAS,CAC3C,OAAM,IAAI,gBACP,0EAA0E,eAAe,KAAK,KAAK;EAIxG,MAAM,WAAW,MAAM,iBACrB,OAAO,UAAU,EACjB,EACE,SAAS;GACP,QAAQ;GACR,cAAc;EACf,EACF,GACD,KACD;AAED,OAAK,SAAS,IAAI;AAChB,OAAI,SAAS,WAAW,KAAK;AAC3B,eAAW;AACX,eAAW;AACX,eAAW;AACX,eAAW;AACX,eAAW;AACX,eAAW;AACX,WAAO;GACR;AAED,SAAM,IAAI,UACP,iCAAiC,SAAS,cAC3C,SAAS;EAEZ;EAED,MAAM,UAAU,MAAM,SAAS,MAAM;AAGrC,MACE,QAAQ,MAAM,CAAC,WAAW,YAAY,IACtC,QAAQ,MAAM,CAAC,WAAW,QAAQ,EAClC;AACA,cAAW;AACX,cAAW;AACX,cAAW;AACX,UAAO;EACR;AAGD,YAAU;AACV,YAAU;AACV,YAAU;AAEV,YAAU;AACV,YACE;AACF,YACE;AACF,YACE;AACF,YACE;AAEF,SAAO;CACR;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-event-attachment-DvpQ-dEP.cjs","names":["ParamOrganizationSlug","ParamProjectSlug","ParamEventId","context: ServerContext","contentParts: (TextContent | ImageContent | EmbeddedResource)[]","image: ImageContent","resource: EmbeddedResource","output","text: TextContent"],"sources":["../src/tools/get-event-attachment.ts"],"sourcesContent":["import { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport type { ServerContext } from \"../types\";\nimport type {\n TextContent,\n ImageContent,\n EmbeddedResource,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport {\n ParamOrganizationSlug,\n ParamProjectSlug,\n ParamEventId,\n ParamAttachmentId,\n ParamRegionUrl,\n} from \"../schema\";\nimport { setTag } from \"@sentry/core\";\n\nexport default defineTool({\n name: \"get_event_attachment\",\n requiredScopes: [\"event:read\"],\n description: [\n \"Download attachments from a Sentry event.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Download files attached to a specific event\",\n \"- Access screenshots, log files, or other attachments uploaded with an error report\",\n \"- Retrieve attachment metadata and download URLs\",\n \"\",\n \"<examples>\",\n \"### Download a specific attachment by ID\",\n \"\",\n \"```\",\n \"get_event_attachment(organizationSlug='my-organization', projectSlug='my-project', eventId='c49541c747cb4d8aa3efb70ca5aba243', attachmentId='12345')\",\n \"```\",\n \"\",\n \"### List all attachments for an event\",\n \"\",\n \"```\",\n \"get_event_attachment(organizationSlug='my-organization', projectSlug='my-project', eventId='c49541c747cb4d8aa3efb70ca5aba243')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If `attachmentId` is provided, the specific attachment will be downloaded as an embedded resource\",\n \"- If `attachmentId` is omitted, all attachments for the event will be listed with download information\",\n \"- The `projectSlug` is required to identify which project the event belongs to\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n projectSlug: ParamProjectSlug,\n eventId: ParamEventId,\n attachmentId: ParamAttachmentId.optional(),\n regionUrl: ParamRegionUrl.optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n\n setTag(\"organization.slug\", params.organizationSlug);\n\n // If attachmentId is provided, download the specific attachment\n if (params.attachmentId) {\n const attachment = await apiService.getEventAttachment({\n organizationSlug: params.organizationSlug,\n projectSlug: params.projectSlug,\n eventId: params.eventId,\n attachmentId: params.attachmentId,\n });\n\n const contentParts: (TextContent | ImageContent | EmbeddedResource)[] =\n [];\n const isBinary = !attachment.attachment.mimetype?.startsWith(\"text/\");\n\n if (isBinary) {\n const isImage = attachment.attachment.mimetype?.startsWith(\"image/\");\n // Base64 encode the binary attachment content\n // and add to the content as an embedded resource\n const uint8Array = new Uint8Array(await attachment.blob.arrayBuffer());\n let binary = \"\";\n for (let i = 0; i < uint8Array.byteLength; i++) {\n binary += String.fromCharCode(uint8Array[i]);\n }\n if (isImage) {\n const image: ImageContent = {\n type: \"image\",\n mimeType: attachment.attachment.mimetype,\n data: btoa(binary),\n };\n contentParts.push(image);\n } else {\n const resource: EmbeddedResource = {\n id: params.attachmentId,\n type: \"resource\",\n resource: {\n uri: `file://${attachment.filename}`,\n mimeType: attachment.attachment.mimetype,\n blob: btoa(binary),\n },\n };\n contentParts.push(resource);\n }\n }\n\n let output = `# Event Attachment Download\\n\\n`;\n output += `**Event ID:** ${params.eventId}\\n`;\n output += `**Attachment ID:** ${params.attachmentId}\\n`;\n output += `**Filename:** ${attachment.filename}\\n`;\n output += `**Type:** ${attachment.attachment.type}\\n`;\n output += `**Size:** ${attachment.attachment.size} bytes\\n`;\n output += `**MIME Type:** ${attachment.attachment.mimetype}\\n`;\n output += `**Created:** ${attachment.attachment.dateCreated}\\n`;\n output += `**SHA1:** ${attachment.attachment.sha1}\\n\\n`;\n output += `**Download URL:** ${attachment.downloadUrl}\\n\\n`;\n\n if (isBinary) {\n output += `## Binary Content\\n\\n`;\n output += `The attachment is included as a resource and accessible through your client.\\n`;\n } else {\n // If it's a text file and we have blob content, decode and display it instead\n // of embedding it as an image or resource\n const textContent = await attachment.blob.text();\n output += `## File Content\\n\\n`;\n output += `\\`\\`\\`\\n${textContent}\\n\\`\\`\\`\\n\\n`;\n }\n\n const text: TextContent = {\n type: \"text\",\n text: output,\n };\n contentParts.push(text);\n\n return contentParts;\n }\n\n // List all attachments for the event\n const attachments = await apiService.listEventAttachments({\n organizationSlug: params.organizationSlug,\n projectSlug: params.projectSlug,\n eventId: params.eventId,\n });\n\n let output = `# Event Attachments\\n\\n`;\n output += `**Event ID:** ${params.eventId}\\n`;\n output += `**Project:** ${params.projectSlug}\\n\\n`;\n\n if (attachments.length === 0) {\n output += \"No attachments found for this event.\\n\";\n return output;\n }\n\n output += `Found ${attachments.length} attachment(s):\\n\\n`;\n\n attachments.forEach((attachment, index) => {\n output += `## Attachment ${index + 1}\\n\\n`;\n output += `**ID:** ${attachment.id}\\n`;\n output += `**Name:** ${attachment.name}\\n`;\n output += `**Type:** ${attachment.type}\\n`;\n output += `**Size:** ${attachment.size} bytes\\n`;\n output += `**MIME Type:** ${attachment.mimetype}\\n`;\n output += `**Created:** ${attachment.dateCreated}\\n`;\n output += `**SHA1:** ${attachment.sha1}\\n\\n`;\n output += `To download this attachment, use the \"get_event_attachment\" tool with the attachmentId provided:\\n`;\n output += `\\`get_event_attachment(organizationSlug=\"${params.organizationSlug}\", projectSlug=\"${params.projectSlug}\", eventId=\"${params.eventId}\", attachmentId=\"${attachment.id}\")\\`\\n\\n`;\n });\n\n return output;\n },\n});\n"],"mappings":";;;;;;;AAiBA,mCAAe,0BAA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ClL,EAAC;AAEF,SAAO;CACR;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-event-attachment-pIJmUfFE.js","names":["context: ServerContext","contentParts: (TextContent | ImageContent | EmbeddedResource)[]","image: ImageContent","resource: EmbeddedResource","output","text: TextContent"],"sources":["../src/tools/get-event-attachment.ts"],"sourcesContent":["import { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport type { ServerContext } from \"../types\";\nimport type {\n TextContent,\n ImageContent,\n EmbeddedResource,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport {\n ParamOrganizationSlug,\n ParamProjectSlug,\n ParamEventId,\n ParamAttachmentId,\n ParamRegionUrl,\n} from \"../schema\";\nimport { setTag } from \"@sentry/core\";\n\nexport default defineTool({\n name: \"get_event_attachment\",\n requiredScopes: [\"event:read\"],\n description: [\n \"Download attachments from a Sentry event.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Download files attached to a specific event\",\n \"- Access screenshots, log files, or other attachments uploaded with an error report\",\n \"- Retrieve attachment metadata and download URLs\",\n \"\",\n \"<examples>\",\n \"### Download a specific attachment by ID\",\n \"\",\n \"```\",\n \"get_event_attachment(organizationSlug='my-organization', projectSlug='my-project', eventId='c49541c747cb4d8aa3efb70ca5aba243', attachmentId='12345')\",\n \"```\",\n \"\",\n \"### List all attachments for an event\",\n \"\",\n \"```\",\n \"get_event_attachment(organizationSlug='my-organization', projectSlug='my-project', eventId='c49541c747cb4d8aa3efb70ca5aba243')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If `attachmentId` is provided, the specific attachment will be downloaded as an embedded resource\",\n \"- If `attachmentId` is omitted, all attachments for the event will be listed with download information\",\n \"- The `projectSlug` is required to identify which project the event belongs to\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n projectSlug: ParamProjectSlug,\n eventId: ParamEventId,\n attachmentId: ParamAttachmentId.optional(),\n regionUrl: ParamRegionUrl.optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n\n setTag(\"organization.slug\", params.organizationSlug);\n\n // If attachmentId is provided, download the specific attachment\n if (params.attachmentId) {\n const attachment = await apiService.getEventAttachment({\n organizationSlug: params.organizationSlug,\n projectSlug: params.projectSlug,\n eventId: params.eventId,\n attachmentId: params.attachmentId,\n });\n\n const contentParts: (TextContent | ImageContent | EmbeddedResource)[] =\n [];\n const isBinary = !attachment.attachment.mimetype?.startsWith(\"text/\");\n\n if (isBinary) {\n const isImage = attachment.attachment.mimetype?.startsWith(\"image/\");\n // Base64 encode the binary attachment content\n // and add to the content as an embedded resource\n const uint8Array = new Uint8Array(await attachment.blob.arrayBuffer());\n let binary = \"\";\n for (let i = 0; i < uint8Array.byteLength; i++) {\n binary += String.fromCharCode(uint8Array[i]);\n }\n if (isImage) {\n const image: ImageContent = {\n type: \"image\",\n mimeType: attachment.attachment.mimetype,\n data: btoa(binary),\n };\n contentParts.push(image);\n } else {\n const resource: EmbeddedResource = {\n id: params.attachmentId,\n type: \"resource\",\n resource: {\n uri: `file://${attachment.filename}`,\n mimeType: attachment.attachment.mimetype,\n blob: btoa(binary),\n },\n };\n contentParts.push(resource);\n }\n }\n\n let output = `# Event Attachment Download\\n\\n`;\n output += `**Event ID:** ${params.eventId}\\n`;\n output += `**Attachment ID:** ${params.attachmentId}\\n`;\n output += `**Filename:** ${attachment.filename}\\n`;\n output += `**Type:** ${attachment.attachment.type}\\n`;\n output += `**Size:** ${attachment.attachment.size} bytes\\n`;\n output += `**MIME Type:** ${attachment.attachment.mimetype}\\n`;\n output += `**Created:** ${attachment.attachment.dateCreated}\\n`;\n output += `**SHA1:** ${attachment.attachment.sha1}\\n\\n`;\n output += `**Download URL:** ${attachment.downloadUrl}\\n\\n`;\n\n if (isBinary) {\n output += `## Binary Content\\n\\n`;\n output += `The attachment is included as a resource and accessible through your client.\\n`;\n } else {\n // If it's a text file and we have blob content, decode and display it instead\n // of embedding it as an image or resource\n const textContent = await attachment.blob.text();\n output += `## File Content\\n\\n`;\n output += `\\`\\`\\`\\n${textContent}\\n\\`\\`\\`\\n\\n`;\n }\n\n const text: TextContent = {\n type: \"text\",\n text: output,\n };\n contentParts.push(text);\n\n return contentParts;\n }\n\n // List all attachments for the event\n const attachments = await apiService.listEventAttachments({\n organizationSlug: params.organizationSlug,\n projectSlug: params.projectSlug,\n eventId: params.eventId,\n });\n\n let output = `# Event Attachments\\n\\n`;\n output += `**Event ID:** ${params.eventId}\\n`;\n output += `**Project:** ${params.projectSlug}\\n\\n`;\n\n if (attachments.length === 0) {\n output += \"No attachments found for this event.\\n\";\n return output;\n }\n\n output += `Found ${attachments.length} attachment(s):\\n\\n`;\n\n attachments.forEach((attachment, index) => {\n output += `## Attachment ${index + 1}\\n\\n`;\n output += `**ID:** ${attachment.id}\\n`;\n output += `**Name:** ${attachment.name}\\n`;\n output += `**Type:** ${attachment.type}\\n`;\n output += `**Size:** ${attachment.size} bytes\\n`;\n output += `**MIME Type:** ${attachment.mimetype}\\n`;\n output += `**Created:** ${attachment.dateCreated}\\n`;\n output += `**SHA1:** ${attachment.sha1}\\n\\n`;\n output += `To download this attachment, use the \"get_event_attachment\" tool with the attachmentId provided:\\n`;\n output += `\\`get_event_attachment(organizationSlug=\"${params.organizationSlug}\", projectSlug=\"${params.projectSlug}\", eventId=\"${params.eventId}\", attachmentId=\"${attachment.id}\")\\`\\n\\n`;\n });\n\n return output;\n },\n});\n"],"mappings":";;;;;;AAiBA,mCAAe,WAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,YAAa;CAC9B,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB;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,WAAW,WAAW,YAAY;AAC5D,gBAAW,YAAY,WAAW,WAAW,KAAK;AAClD,gBAAW,oBAAoB,WAAW,YAAY;AAEtD,OAAI,UAAU;AACZ,iBAAW;AACX,iBAAW;GACZ,OAAM;IAGL,MAAM,cAAc,MAAM,WAAW,KAAK,MAAM;AAChD,iBAAW;AACX,iBAAW,UAAU,YAAY;GAClC;GAED,MAAMC,OAAoB;IACxB,MAAM;IACN,MAAMD;GACP;AACD,gBAAa,KAAK,KAAK;AAEvB,UAAO;EACR;EAGD,MAAM,cAAc,MAAM,WAAW,qBAAqB;GACxD,kBAAkB,OAAO;GACzB,aAAa,OAAO;GACpB,SAAS,OAAO;EACjB,EAAC;EAEF,IAAI,UAAU;AACd,aAAW,gBAAgB,OAAO,QAAQ;AAC1C,aAAW,eAAe,OAAO,YAAY;AAE7C,MAAI,YAAY,WAAW,GAAG;AAC5B,aAAU;AACV,UAAO;EACR;AAED,aAAW,QAAQ,YAAY,OAAO;AAEtC,cAAY,QAAQ,CAAC,YAAY,UAAU;AACzC,cAAW,gBAAgB,QAAQ,EAAE;AACrC,cAAW,UAAU,WAAW,GAAG;AACnC,cAAW,YAAY,WAAW,KAAK;AACvC,cAAW,YAAY,WAAW,KAAK;AACvC,cAAW,YAAY,WAAW,KAAK;AACvC,cAAW,iBAAiB,WAAW,SAAS;AAChD,cAAW,eAAe,WAAW,YAAY;AACjD,cAAW,YAAY,WAAW,KAAK;AACvC,cAAW;AACX,cAAW,2CAA2C,OAAO,iBAAiB,kBAAkB,OAAO,YAAY,cAAc,OAAO,QAAQ,mBAAmB,WAAW,GAAG;EAClL,EAAC;AAEF,SAAO;CACR;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-issue-details-B1PDMmMY.js","names":["context: ServerContext","orgSlug","issue","event: Awaited<ReturnType<typeof apiService.getEventForIssue>>","autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined","issue: Awaited<ReturnType<typeof apiService.getIssue>>","autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined"],"sources":["../src/tools/get-issue-details.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport {\n parseIssueParams,\n formatIssueOutput,\n} from \"../internal/tool-helpers/issue\";\nimport { enhanceNotFoundError } from \"../internal/tool-helpers/enhance-error\";\nimport { ApiNotFoundError } from \"../api-client\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamIssueShortId,\n ParamIssueUrl,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"get_issue_details\",\n requiredScopes: [\"event:read\"],\n description: [\n \"Get detailed information about a specific Sentry issue by ID.\",\n \"\",\n \"🔍 USE THIS TOOL WHEN USERS:\",\n \"- Provide a specific issue ID (e.g., 'CLOUDFLARE-MCP-41', 'PROJECT-123')\",\n \"- Ask to 'explain [ISSUE-ID]', 'tell me about [ISSUE-ID]'\",\n \"- Want details/stacktrace/analysis for a known issue\",\n \"- Provide a Sentry issue URL\",\n \"\",\n \"❌ DO NOT USE for:\",\n \"- General searching or listing issues (use search_issues)\",\n \"- Root cause analysis (use analyze_issue_with_seer)\",\n \"\",\n \"TRIGGER PATTERNS:\",\n \"- 'Explain ISSUE-123' → use get_issue_details\",\n \"- 'Tell me about PROJECT-456' → use get_issue_details\",\n \"- 'What happened in [issue URL]' → use get_issue_details\",\n \"\",\n \"<examples>\",\n \"### Explain specific issue\",\n \"```\",\n \"get_issue_details(organizationSlug='my-organization', issueId='CLOUDFLARE-MCP-41')\",\n \"```\",\n \"\",\n \"### Get details for event ID\",\n \"```\",\n \"get_issue_details(organizationSlug='my-organization', eventId='c49541c747cb4d8aa3efb70ca5aba243')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user provides the `issueUrl`, you can ignore the other parameters.\",\n \"- If the user provides `issueId` or `eventId` (only one is needed), `organizationSlug` is required.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n issueId: ParamIssueShortId.optional(),\n eventId: z.string().trim().describe(\"The ID of the event.\").optional(),\n issueUrl: ParamIssueUrl.optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n\n if (params.eventId) {\n const orgSlug = params.organizationSlug;\n const eventId = params.eventId; // Capture eventId for type safety\n if (!orgSlug) {\n throw new UserInputError(\n \"`organizationSlug` is required when providing `eventId`\",\n );\n }\n\n setTag(\"organization.slug\", orgSlug);\n // API client will throw ApiClientError/ApiServerError which the MCP server wrapper handles\n const [issue] = await apiService.listIssues({\n organizationSlug: orgSlug,\n query: eventId,\n });\n if (!issue) {\n return `# Event Not Found\\n\\nNo issue found for Event ID: ${eventId}`;\n }\n // For this call, we might want to provide context if it fails\n let event: Awaited<ReturnType<typeof apiService.getEventForIssue>>;\n try {\n event = await apiService.getEventForIssue({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n eventId,\n });\n } catch (error) {\n // Optionally enhance 404 errors with parameter context\n if (error instanceof ApiNotFoundError) {\n throw enhanceNotFoundError(error, {\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n eventId,\n });\n }\n throw error;\n }\n\n // Try to fetch Seer analysis context (non-blocking)\n let autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined;\n try {\n autofixState = await apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n });\n } catch (error) {\n // Silently continue if Seer analysis is not available\n // This ensures the tool works even if Seer is not enabled\n }\n\n return formatIssueOutput({\n organizationSlug: orgSlug,\n issue,\n event,\n apiService,\n autofixState,\n });\n }\n\n // Validate that we have the minimum required parameters\n if (!params.issueUrl && !params.issueId) {\n throw new UserInputError(\n \"Either `issueId` or `issueUrl` must be provided\",\n );\n }\n\n if (!params.issueUrl && !params.organizationSlug) {\n throw new UserInputError(\n \"`organizationSlug` is required when providing `issueId`\",\n );\n }\n\n const { organizationSlug: orgSlug, issueId: parsedIssueId } =\n parseIssueParams({\n organizationSlug: params.organizationSlug,\n issueId: params.issueId,\n issueUrl: params.issueUrl,\n });\n\n setTag(\"organization.slug\", orgSlug);\n\n // For the main issue lookup, provide parameter context on 404\n let issue: Awaited<ReturnType<typeof apiService.getIssue>>;\n try {\n issue = await apiService.getIssue({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n });\n } catch (error) {\n if (error instanceof ApiNotFoundError) {\n throw enhanceNotFoundError(error, {\n organizationSlug: orgSlug,\n issueId: parsedIssueId,\n });\n }\n throw error;\n }\n\n const event = await apiService.getLatestEventForIssue({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n });\n\n // Try to fetch Seer analysis context (non-blocking)\n let autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined;\n try {\n autofixState = await apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n });\n } catch (error) {\n // Silently continue if Seer analysis is not available\n // This ensures the tool works even if Seer is not enabled\n }\n\n return formatIssueOutput({\n organizationSlug: orgSlug,\n issue,\n event,\n apiService,\n autofixState,\n });\n },\n});\n"],"mappings":";;;;;;;;;;;;AAmBA,gCAAe,WAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,YAAa;CAC9B,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB,sBAAsB,UAAU;EAClD,WAAW,eAAe,UAAU;EACpC,SAAS,kBAAkB,UAAU;EACrC,SAAS,EAAE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ACV,EAAC;EACH,SAAQ,OAAO;AACd,OAAI,iBAAiB,iBACnB,OAAM,qBAAqB,OAAO;IAChC,kBAAkB;IAClB,SAAS;GACV,EAAC;AAEJ,SAAM;EACP;EAED,MAAM,QAAQ,MAAM,WAAW,uBAAuB;GACpD,kBAAkB;GAClB,SAAS,MAAM;EAChB,EAAC;EAGF,IAAIC;AAGJ,MAAI;AACF,kBAAe,MAAM,WAAW,gBAAgB;IAC9C,kBAAkB;IAClB,SAAS,MAAM;GAChB,EAAC;EACH,SAAQ,OAAO,CAGf;AAED,SAAO,kBAAkB;GACvB,kBAAkB;GAClB;GACA;GACA;GACA;EACD,EAAC;CACH;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-issue-details-BH75EnNk.cjs","names":["context: ServerContext","orgSlug","UserInputError","issue","event: Awaited<ReturnType<typeof apiService.getEventForIssue>>","ApiNotFoundError","autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined","issue: Awaited<ReturnType<typeof apiService.getIssue>>","autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined"],"sources":["../src/tools/get-issue-details.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport {\n parseIssueParams,\n formatIssueOutput,\n} from \"../internal/tool-helpers/issue\";\nimport { enhanceNotFoundError } from \"../internal/tool-helpers/enhance-error\";\nimport { ApiNotFoundError } from \"../api-client\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamIssueShortId,\n ParamIssueUrl,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"get_issue_details\",\n requiredScopes: [\"event:read\"],\n description: [\n \"Get detailed information about a specific Sentry issue by ID.\",\n \"\",\n \"🔍 USE THIS TOOL WHEN USERS:\",\n \"- Provide a specific issue ID (e.g., 'CLOUDFLARE-MCP-41', 'PROJECT-123')\",\n \"- Ask to 'explain [ISSUE-ID]', 'tell me about [ISSUE-ID]'\",\n \"- Want details/stacktrace/analysis for a known issue\",\n \"- Provide a Sentry issue URL\",\n \"\",\n \"❌ DO NOT USE for:\",\n \"- General searching or listing issues (use search_issues)\",\n \"- Root cause analysis (use analyze_issue_with_seer)\",\n \"\",\n \"TRIGGER PATTERNS:\",\n \"- 'Explain ISSUE-123' → use get_issue_details\",\n \"- 'Tell me about PROJECT-456' → use get_issue_details\",\n \"- 'What happened in [issue URL]' → use get_issue_details\",\n \"\",\n \"<examples>\",\n \"### Explain specific issue\",\n \"```\",\n \"get_issue_details(organizationSlug='my-organization', issueId='CLOUDFLARE-MCP-41')\",\n \"```\",\n \"\",\n \"### Get details for event ID\",\n \"```\",\n \"get_issue_details(organizationSlug='my-organization', eventId='c49541c747cb4d8aa3efb70ca5aba243')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user provides the `issueUrl`, you can ignore the other parameters.\",\n \"- If the user provides `issueId` or `eventId` (only one is needed), `organizationSlug` is required.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n issueId: ParamIssueShortId.optional(),\n eventId: z.string().trim().describe(\"The ID of the event.\").optional(),\n issueUrl: ParamIssueUrl.optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n\n if (params.eventId) {\n const orgSlug = params.organizationSlug;\n const eventId = params.eventId; // Capture eventId for type safety\n if (!orgSlug) {\n throw new UserInputError(\n \"`organizationSlug` is required when providing `eventId`\",\n );\n }\n\n setTag(\"organization.slug\", orgSlug);\n // API client will throw ApiClientError/ApiServerError which the MCP server wrapper handles\n const [issue] = await apiService.listIssues({\n organizationSlug: orgSlug,\n query: eventId,\n });\n if (!issue) {\n return `# Event Not Found\\n\\nNo issue found for Event ID: ${eventId}`;\n }\n // For this call, we might want to provide context if it fails\n let event: Awaited<ReturnType<typeof apiService.getEventForIssue>>;\n try {\n event = await apiService.getEventForIssue({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n eventId,\n });\n } catch (error) {\n // Optionally enhance 404 errors with parameter context\n if (error instanceof ApiNotFoundError) {\n throw enhanceNotFoundError(error, {\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n eventId,\n });\n }\n throw error;\n }\n\n // Try to fetch Seer analysis context (non-blocking)\n let autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined;\n try {\n autofixState = await apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n });\n } catch (error) {\n // Silently continue if Seer analysis is not available\n // This ensures the tool works even if Seer is not enabled\n }\n\n return formatIssueOutput({\n organizationSlug: orgSlug,\n issue,\n event,\n apiService,\n autofixState,\n });\n }\n\n // Validate that we have the minimum required parameters\n if (!params.issueUrl && !params.issueId) {\n throw new UserInputError(\n \"Either `issueId` or `issueUrl` must be provided\",\n );\n }\n\n if (!params.issueUrl && !params.organizationSlug) {\n throw new UserInputError(\n \"`organizationSlug` is required when providing `issueId`\",\n );\n }\n\n const { organizationSlug: orgSlug, issueId: parsedIssueId } =\n parseIssueParams({\n organizationSlug: params.organizationSlug,\n issueId: params.issueId,\n issueUrl: params.issueUrl,\n });\n\n setTag(\"organization.slug\", orgSlug);\n\n // For the main issue lookup, provide parameter context on 404\n let issue: Awaited<ReturnType<typeof apiService.getIssue>>;\n try {\n issue = await apiService.getIssue({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n });\n } catch (error) {\n if (error instanceof ApiNotFoundError) {\n throw enhanceNotFoundError(error, {\n organizationSlug: orgSlug,\n issueId: parsedIssueId,\n });\n }\n throw error;\n }\n\n const event = await apiService.getLatestEventForIssue({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n });\n\n // Try to fetch Seer analysis context (non-blocking)\n let autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined;\n try {\n autofixState = await apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n });\n } catch (error) {\n // Silently continue if Seer analysis is not available\n // This ensures the tool works even if Seer is not enabled\n }\n\n return formatIssueOutput({\n organizationSlug: orgSlug,\n issue,\n event,\n apiService,\n autofixState,\n });\n },\n});\n"],"mappings":";;;;;;;;;;;;;AAmBA,gCAAe,0BAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,YAAa;CAC9B,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB,qCAAsB,UAAU;EAClD,WAAW,8BAAe,UAAU;EACpC,SAAS,iCAAkB,UAAU;EACrC,SAAS,MAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,uBAAuB,CAAC,UAAU;EACtE,UAAU,6BAAc,UAAU;CACnC;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,kCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;AAEF,MAAI,OAAO,SAAS;GAClB,MAAMC,YAAU,OAAO;GACvB,MAAM,UAAU,OAAO;AACvB,QAAKA,UACH,OAAM,IAAIC,8BACR;AAIJ,6BAAO,qBAAqBD,UAAQ;GAEpC,MAAM,CAACE,QAAM,GAAG,MAAM,WAAW,WAAW;IAC1C,kBAAkBF;IAClB,OAAO;GACR,EAAC;AACF,QAAKE,QACH,SAAQ,oDAAoD;GAG9D,IAAIC;AACJ,OAAI;AACF,cAAQ,MAAM,WAAW,iBAAiB;KACxC,kBAAkBH;KAClB,SAASE,QAAM;KACf;IACD,EAAC;GACH,SAAQ,OAAO;AAEd,QAAI,iBAAiBE,kCACnB,OAAM,2CAAqB,OAAO;KAChC,kBAAkBJ;KAClB,SAASE,QAAM;KACf;IACD,EAAC;AAEJ,UAAM;GACP;GAGD,IAAIG;AAGJ,OAAI;AACF,qBAAe,MAAM,WAAW,gBAAgB;KAC9C,kBAAkBL;KAClB,SAASE,QAAM;IAChB,EAAC;GACH,SAAQ,OAAO,CAGf;AAED,UAAO,qCAAkB;IACvB,kBAAkBF;IAClB;IACA;IACA;IACA;GACD,EAAC;EACH;AAGD,OAAK,OAAO,aAAa,OAAO,QAC9B,OAAM,IAAIC,8BACR;AAIJ,OAAK,OAAO,aAAa,OAAO,iBAC9B,OAAM,IAAIA,8BACR;EAIJ,MAAM,EAAE,kBAAkB,SAAS,SAAS,eAAe,GACzD,uCAAiB;GACf,kBAAkB,OAAO;GACzB,SAAS,OAAO;GAChB,UAAU,OAAO;EAClB,EAAC;AAEJ,4BAAO,qBAAqB,QAAQ;EAGpC,IAAIK;AACJ,MAAI;AACF,WAAQ,MAAM,WAAW,SAAS;IAChC,kBAAkB;IAClB,SAAS;GACV,EAAC;EACH,SAAQ,OAAO;AACd,OAAI,iBAAiBF,kCACnB,OAAM,2CAAqB,OAAO;IAChC,kBAAkB;IAClB,SAAS;GACV,EAAC;AAEJ,SAAM;EACP;EAED,MAAM,QAAQ,MAAM,WAAW,uBAAuB;GACpD,kBAAkB;GAClB,SAAS,MAAM;EAChB,EAAC;EAGF,IAAIG;AAGJ,MAAI;AACF,kBAAe,MAAM,WAAW,gBAAgB;IAC9C,kBAAkB;IAClB,SAAS,MAAM;GAChB,EAAC;EACH,SAAQ,OAAO,CAGf;AAED,SAAO,qCAAkB;GACvB,kBAAkB;GAClB;GACA;GACA;GACA;EACD,EAAC;CACH;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-trace-details-Bksygq21.cjs","names":["ParamOrganizationSlug","ParamTraceId","context: ServerContext","UserInputError","spans: any[]","traceId: string","selected: SelectedSpan[]","span: any","level: number","selectedSpan: SelectedSpan","child: any","a: any","b: any","fakeRoot: SelectedSpan","span: SelectedSpan","spans: SelectedSpan[]","lines: string[]","operationSpans: Record<string, any[]>","stats: Record<\n string,\n { count: number; avgDuration: number; p95Duration: number }\n >","result: any[]","spanList: any[]","sections: string[]"],"sources":["../src/tools/get-trace-details.ts"],"sourcesContent":["import { setTag } from \"@sentry/core\";\nimport { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport { ParamOrganizationSlug, ParamRegionUrl, ParamTraceId } from \"../schema\";\n\n// Constants for span filtering and tree rendering\nconst MAX_DEPTH = 2;\nconst MINIMUM_DURATION_THRESHOLD_MS = 10;\nconst MIN_MEANINGFUL_CHILD_DURATION = 5;\nconst MIN_AVG_DURATION_MS = 5;\n\nexport default defineTool({\n name: \"get_trace_details\",\n requiredScopes: [\"event:read\"],\n description: [\n \"Get detailed information about a specific Sentry trace by ID.\",\n \"\",\n \"🔍 USE THIS TOOL WHEN USERS:\",\n \"- Provide a specific trace ID (e.g., 'a4d1aae7216b47ff8117cf4e09ce9d0a')\",\n \"- Ask to 'show me trace [TRACE-ID]', 'explain trace [TRACE-ID]'\",\n \"- Want high-level overview and link to view trace details in Sentry\",\n \"- Need trace statistics and span breakdown\",\n \"\",\n \"❌ DO NOT USE for:\",\n \"- General searching for traces (use search_events with trace queries)\",\n \"- Individual span details (this shows trace overview)\",\n \"\",\n \"TRIGGER PATTERNS:\",\n \"- 'Show me trace abc123' → use get_trace_details\",\n \"- 'Explain trace a4d1aae7216b47ff8117cf4e09ce9d0a' → use get_trace_details\",\n \"- 'What is trace [trace-id]' → use get_trace_details\",\n \"\",\n \"<examples>\",\n \"### Get trace overview\",\n \"```\",\n \"get_trace_details(organizationSlug='my-organization', traceId='a4d1aae7216b47ff8117cf4e09ce9d0a')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- Trace IDs are 32-character hexadecimal strings\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n traceId: ParamTraceId,\n },\n async handler(params, context: ServerContext) {\n // Validate trace ID format\n if (!/^[0-9a-fA-F]{32}$/.test(params.traceId)) {\n throw new UserInputError(\n \"Trace ID must be a 32-character hexadecimal string\",\n );\n }\n\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n\n setTag(\"organization.slug\", params.organizationSlug);\n setTag(\"trace.id\", params.traceId);\n\n // Get trace metadata for overview\n const traceMeta = await apiService.getTraceMeta({\n organizationSlug: params.organizationSlug,\n traceId: params.traceId,\n statsPeriod: \"14d\", // Fixed stats period\n });\n\n // Get minimal trace data to show key transactions\n const trace = await apiService.getTrace({\n organizationSlug: params.organizationSlug,\n traceId: params.traceId,\n limit: 10, // Only get top-level spans for overview\n statsPeriod: \"14d\", // Fixed stats period\n });\n\n return formatTraceOutput({\n organizationSlug: params.organizationSlug,\n traceId: params.traceId,\n traceMeta,\n trace,\n apiService,\n });\n },\n});\n\ninterface SelectedSpan {\n event_id: string;\n op: string;\n name: string | null;\n description: string;\n duration: number;\n is_transaction: boolean;\n children: SelectedSpan[];\n level: number;\n}\n\n/**\n * Selects a subset of \"interesting\" spans from a trace for display in the overview.\n *\n * Creates a fake root span representing the entire trace, with selected interesting\n * spans as children. This provides a unified tree view of the trace.\n *\n * The goal is to provide a meaningful sample of the trace that highlights the most\n * important operations while staying within display limits. Selection prioritizes:\n *\n * 1. **Transactions** - Top-level operations that represent complete user requests\n * 2. **Error spans** - Any spans that contain errors (critical for debugging)\n * 3. **Long-running spans** - Operations >= 10ms duration (performance bottlenecks)\n * 4. **Hierarchical context** - Maintains parent-child relationships for understanding\n *\n * Span inclusion rules:\n * - All transactions are included (they're typically root-level operations)\n * - Spans with errors are always included (debugging importance)\n * - Spans with duration >= 10ms are included (performance relevance)\n * - Children are recursively added up to 2 levels deep:\n * - Transactions can have up to 2 children each\n * - Regular spans can have up to 1 child each\n * - Total output is capped at maxSpans to prevent overwhelming display\n *\n * @param spans - Complete array of trace spans with nested children\n * @param traceId - Trace ID to display in the fake root span\n * @param maxSpans - Maximum number of spans to include in output (default: 20)\n * @returns Single-element array containing fake root span with selected spans as children\n */\nfunction selectInterestingSpans(\n spans: any[],\n traceId: string,\n maxSpans = 20,\n): SelectedSpan[] {\n const selected: SelectedSpan[] = [];\n let spanCount = 0;\n\n // Filter out non-span items (issues) from the trace data\n // Spans must have children array, duration, and other span-specific fields\n const actualSpans = spans.filter(\n (item) =>\n item &&\n typeof item === \"object\" &&\n \"children\" in item &&\n Array.isArray(item.children) &&\n \"duration\" in item,\n );\n\n function addSpan(span: any, level: number): boolean {\n if (spanCount >= maxSpans || level > MAX_DEPTH) return false;\n\n const duration = span.duration || 0;\n const isTransaction = span.is_transaction;\n const hasErrors = span.errors?.length > 0;\n\n // Always include transactions and spans with errors\n // For regular spans, include if they have reasonable duration or are at root level\n const shouldInclude =\n isTransaction ||\n hasErrors ||\n level === 0 ||\n duration >= MINIMUM_DURATION_THRESHOLD_MS;\n\n if (!shouldInclude) return false;\n\n const selectedSpan: SelectedSpan = {\n event_id: span.event_id,\n op: span.op || \"unknown\",\n name: span.name || null,\n description: span.description || span.transaction || \"unnamed\",\n duration,\n is_transaction: isTransaction,\n children: [],\n level,\n };\n\n spanCount++;\n\n // Add up to one interesting child per span, up to MAX_DEPTH levels deep\n if (level < MAX_DEPTH && span.children?.length > 0) {\n // Sort children by duration (descending) and take the most interesting ones\n const sortedChildren = span.children\n .filter((child: any) => child.duration > MIN_MEANINGFUL_CHILD_DURATION) // Only children with meaningful duration\n .sort((a: any, b: any) => (b.duration || 0) - (a.duration || 0));\n\n // Add up to 2 children for transactions, 1 for regular spans\n const maxChildren = isTransaction ? 2 : 1;\n let addedChildren = 0;\n\n for (const child of sortedChildren) {\n if (addedChildren >= maxChildren || spanCount >= maxSpans) break;\n\n if (addSpan(child, level + 1)) {\n const childSpan = selected[selected.length - 1];\n selectedSpan.children.push(childSpan);\n addedChildren++;\n }\n }\n }\n\n selected.push(selectedSpan);\n return true;\n }\n\n // Sort root spans by duration and select the most interesting ones\n const sortedRoots = actualSpans\n .sort((a, b) => (b.duration || 0) - (a.duration || 0))\n .slice(0, 5); // Start with top 5 root spans\n\n for (const root of sortedRoots) {\n if (spanCount >= maxSpans) break;\n addSpan(root, 0);\n }\n\n const rootSpans = selected.filter((span) => span.level === 0);\n\n // Create fake root span representing the entire trace (no duration - traces are unbounded)\n const fakeRoot: SelectedSpan = {\n event_id: traceId,\n op: \"trace\",\n name: null,\n description: `Trace ${traceId.substring(0, 8)}`,\n duration: 0, // Traces don't have duration\n is_transaction: false,\n children: rootSpans,\n level: -1, // Mark as fake root\n };\n\n return [fakeRoot];\n}\n\n/**\n * Formats a span display name for the tree view.\n *\n * Uses span.name if available (OTEL-native), otherwise falls back to span.description.\n *\n * @param span - The span to format\n * @returns A formatted display name for the span\n */\nfunction formatSpanDisplayName(span: SelectedSpan): string {\n // For the fake trace root, just return \"trace\"\n if (span.op === \"trace\") {\n return \"trace\";\n }\n\n // Use span.name if available (OTEL-native), otherwise use description\n return span.name?.trim() || span.description || \"unnamed\";\n}\n\n/**\n * Renders a hierarchical tree structure of spans using Unicode box-drawing characters.\n *\n * Creates a visual tree representation showing parent-child relationships between spans,\n * with proper indentation and connecting lines. Each span shows its operation, short ID,\n * description, duration, and type (transaction vs span).\n *\n * Tree format:\n * - Root spans have no prefix\n * - Child spans use ├─ for intermediate children, └─ for last child\n * - Continuation lines use │ for vertical connections\n * - Proper spacing maintains visual alignment\n *\n * @param spans - Array of selected spans with their nested children structure\n * @returns Array of formatted markdown strings representing the tree structure\n */\nfunction renderSpanTree(spans: SelectedSpan[]): string[] {\n const lines: string[] = [];\n\n function renderSpan(span: SelectedSpan, prefix = \"\", isLast = true): void {\n const shortId = span.event_id.substring(0, 8);\n const connector = prefix === \"\" ? \"\" : isLast ? \"└─ \" : \"├─ \";\n const displayName = formatSpanDisplayName(span);\n\n // Don't show duration for the fake trace root span\n if (span.op === \"trace\") {\n lines.push(`${prefix}${connector}${displayName} [${shortId}]`);\n } else {\n const duration = span.duration\n ? `${Math.round(span.duration)}ms`\n : \"unknown\";\n\n // Don't show 'default' operations as they're not meaningful\n const opDisplay = span.op === \"default\" ? \"\" : ` · ${span.op}`;\n lines.push(\n `${prefix}${connector}${displayName} [${shortId}${opDisplay} · ${duration}]`,\n );\n }\n\n // Render children with proper tree indentation\n for (let i = 0; i < span.children.length; i++) {\n const child = span.children[i];\n const isLastChild = i === span.children.length - 1;\n const childPrefix = prefix + (isLast ? \" \" : \"│ \");\n renderSpan(child, childPrefix, isLastChild);\n }\n }\n\n for (let i = 0; i < spans.length; i++) {\n const span = spans[i];\n const isLastRoot = i === spans.length - 1;\n renderSpan(span, \"\", isLastRoot);\n }\n\n return lines;\n}\n\nfunction calculateOperationStats(spans: any[]): Record<\n string,\n {\n count: number;\n avgDuration: number;\n p95Duration: number;\n }\n> {\n const allSpans = getAllSpansFlattened(spans);\n const operationSpans: Record<string, any[]> = {};\n\n // Group leaf spans by operation type (only spans with no children)\n for (const span of allSpans) {\n // Only consider leaf nodes - spans that have no children\n if (!span.children || span.children.length === 0) {\n // Use span.op if available, otherwise extract from span.name, fallback to \"unknown\"\n const op = span.op || (span.name ? span.name.split(\" \")[0] : \"unknown\");\n if (!operationSpans[op]) {\n operationSpans[op] = [];\n }\n operationSpans[op].push(span);\n }\n }\n\n const stats: Record<\n string,\n { count: number; avgDuration: number; p95Duration: number }\n > = {};\n\n // Calculate stats for each operation\n for (const [op, opSpans] of Object.entries(operationSpans)) {\n const durations = opSpans\n .map((span) => span.duration || 0)\n .filter((duration) => duration > 0)\n .sort((a, b) => a - b);\n\n const count = opSpans.length;\n const avgDuration =\n durations.length > 0\n ? durations.reduce((sum, duration) => sum + duration, 0) /\n durations.length\n : 0;\n\n // Calculate P95 (95th percentile)\n const p95Index = Math.floor(durations.length * 0.95);\n const p95Duration = durations.length > 0 ? durations[p95Index] || 0 : 0;\n\n stats[op] = {\n count,\n avgDuration,\n p95Duration,\n };\n }\n\n return stats;\n}\n\nfunction getAllSpansFlattened(spans: any[]): any[] {\n const result: any[] = [];\n\n // Filter out non-span items (issues) from the trace data\n // Spans must have children array and duration\n const actualSpans = spans.filter(\n (item) =>\n item &&\n typeof item === \"object\" &&\n \"children\" in item &&\n Array.isArray(item.children) &&\n \"duration\" in item,\n );\n\n function collectSpans(spanList: any[]) {\n for (const span of spanList) {\n result.push(span);\n if (span.children && span.children.length > 0) {\n collectSpans(span.children);\n }\n }\n }\n\n collectSpans(actualSpans);\n return result;\n}\n\nfunction formatTraceOutput({\n organizationSlug,\n traceId,\n traceMeta,\n trace,\n apiService,\n}: {\n organizationSlug: string;\n traceId: string;\n traceMeta: any;\n trace: any[];\n apiService: any;\n}): string {\n const sections: string[] = [];\n\n // Header\n sections.push(`# Trace \\`${traceId}\\` in **${organizationSlug}**`);\n sections.push(\"\");\n\n // High-level statistics\n sections.push(\"## Summary\");\n sections.push(\"\");\n sections.push(`**Total Spans**: ${traceMeta.span_count}`);\n sections.push(`**Errors**: ${traceMeta.errors}`);\n sections.push(`**Performance Issues**: ${traceMeta.performance_issues}`);\n sections.push(`**Logs**: ${traceMeta.logs}`);\n\n // Show operation breakdown with detailed stats if we have trace data\n if (trace.length > 0) {\n const operationStats = calculateOperationStats(trace);\n const sortedOps = Object.entries(operationStats)\n .filter(([, stats]) => stats.avgDuration >= MIN_AVG_DURATION_MS) // Only show ops with avg duration >= 5ms\n .sort(([, a], [, b]) => b.count - a.count)\n .slice(0, 10); // Show top 10\n\n if (sortedOps.length > 0) {\n sections.push(\"\");\n sections.push(\"## Operation Breakdown\");\n sections.push(\"\");\n\n for (const [op, stats] of sortedOps) {\n const avgDuration = Math.round(stats.avgDuration);\n const p95Duration = Math.round(stats.p95Duration);\n sections.push(\n `- **${op}**: ${stats.count} spans (avg: ${avgDuration}ms, p95: ${p95Duration}ms)`,\n );\n }\n sections.push(\"\");\n }\n }\n\n // Show span tree structure\n if (trace.length > 0) {\n const selectedSpans = selectInterestingSpans(trace, traceId);\n\n if (selectedSpans.length > 0) {\n sections.push(\"## Overview\");\n sections.push(\"\");\n const treeLines = renderSpanTree(selectedSpans);\n sections.push(...treeLines);\n sections.push(\"\");\n sections.push(\n \"*Note: This shows a subset of spans. View the full trace for complete details.*\",\n );\n sections.push(\"\");\n }\n }\n\n // Links and usage information\n const traceUrl = apiService.getTraceUrl(organizationSlug, traceId);\n sections.push(\"## View Full Trace\");\n sections.push(\"\");\n sections.push(`**Sentry URL**: ${traceUrl}`);\n sections.push(\"\");\n sections.push(\"## Find Related Events\");\n sections.push(\"\");\n sections.push(`Use this search query to find all events in this trace:`);\n sections.push(\"```\");\n sections.push(`trace:${traceId}`);\n sections.push(\"```\");\n sections.push(\"\");\n sections.push(\n \"You can use this query with the `search_events` tool to get detailed event data from this trace.\",\n );\n\n return sections.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;AAQA,MAAM,YAAY;AAClB,MAAM,gCAAgC;AACtC,MAAM,gCAAgC;AACtC,MAAM,sBAAsB;AAE5B,gCAAe,0BAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,YAAa;CAC9B,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkBA;EAClB,WAAW,8BAAe,UAAU;EACpC,SAASC;CACV;CACD,MAAM,QAAQ,QAAQC,SAAwB;AAE5C,OAAK,oBAAoB,KAAK,OAAO,QAAQ,CAC3C,OAAM,IAAIC,8BACR;EAIJ,MAAM,aAAa,kCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;AAEF,4BAAO,qBAAqB,OAAO,iBAAiB;AACpD,4BAAO,YA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