@sentry/mcp-server 0.17.1 → 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 (937) hide show
  1. package/README.md +45 -19
  2. package/dist/agent-ADO0sPxf.d.cts +92 -0
  3. package/dist/agent-ADO0sPxf.d.cts.map +1 -0
  4. package/dist/agent-BA98dlM7.d.cts +34 -0
  5. package/dist/agent-BA98dlM7.d.cts.map +1 -0
  6. package/dist/agent-BL7Xae0U.js +60 -0
  7. package/dist/agent-BL7Xae0U.js.map +1 -0
  8. package/dist/agent-CbJ6lvV3.cjs +49 -0
  9. package/dist/agent-CbJ6lvV3.cjs.map +1 -0
  10. package/dist/agent-D7MuFRwE.cjs +66 -0
  11. package/dist/agent-D7MuFRwE.cjs.map +1 -0
  12. package/dist/agent-D9DV11tZ.d.ts +34 -0
  13. package/dist/agent-D9DV11tZ.d.ts.map +1 -0
  14. package/dist/agent-DXya3Bcy.js +43 -0
  15. package/dist/agent-DXya3Bcy.js.map +1 -0
  16. package/dist/agent-DhHtOQmP.d.ts +92 -0
  17. package/dist/agent-DhHtOQmP.d.ts.map +1 -0
  18. package/dist/{analyze-issue-with-seer-ByoDTsq-.cjs → analyze-issue-with-seer-CI8pvCnf.cjs} +41 -38
  19. package/dist/analyze-issue-with-seer-CI8pvCnf.cjs.map +1 -0
  20. package/dist/{analyze-issue-with-seer-CpwtN4UA.js → analyze-issue-with-seer-DvuKEcbu.js} +20 -17
  21. package/dist/analyze-issue-with-seer-DvuKEcbu.js.map +1 -0
  22. package/dist/{api-utils-DFWUfQ83.cjs → api-CZD9zwQ-.cjs} +15 -20
  23. package/dist/api-CZD9zwQ-.cjs.map +1 -0
  24. package/dist/{api-utils-BlUSO8xh.js → api-CkLTFexT.js} +15 -20
  25. package/dist/api-CkLTFexT.js.map +1 -0
  26. package/dist/api-client/client.cjs +5 -4
  27. package/dist/api-client/client.d.cts +4 -4
  28. package/dist/api-client/client.d.ts +4 -4
  29. package/dist/api-client/client.js +6 -4
  30. package/dist/api-client/errors.cjs +11 -0
  31. package/dist/api-client/errors.d.cts +2 -0
  32. package/dist/api-client/errors.d.ts +2 -0
  33. package/dist/api-client/errors.js +3 -0
  34. package/dist/api-client/index.cjs +22 -7
  35. package/dist/api-client/index.d.cts +6 -5
  36. package/dist/api-client/index.d.ts +6 -5
  37. package/dist/api-client/index.js +8 -6
  38. package/dist/api-client/schema.cjs +6 -1
  39. package/dist/api-client/schema.d.cts +2 -2
  40. package/dist/api-client/schema.d.ts +2 -2
  41. package/dist/api-client/schema.js +2 -2
  42. package/dist/api-client/types.cjs +1 -1
  43. package/dist/api-client/types.d.cts +3 -3
  44. package/dist/api-client/types.d.ts +3 -3
  45. package/dist/api-client/types.js +1 -1
  46. package/dist/callEmbeddedAgent-B_BMEB_u.js +38 -0
  47. package/dist/callEmbeddedAgent-B_BMEB_u.js.map +1 -0
  48. package/dist/callEmbeddedAgent-BaGxBAdM.cjs +44 -0
  49. package/dist/callEmbeddedAgent-BaGxBAdM.cjs.map +1 -0
  50. package/dist/cli/parse.cjs +5 -0
  51. package/dist/cli/parse.d.cts +12 -0
  52. package/dist/cli/parse.d.cts.map +1 -0
  53. package/dist/cli/parse.d.ts +12 -0
  54. package/dist/cli/parse.d.ts.map +1 -0
  55. package/dist/cli/parse.js +3 -0
  56. package/dist/cli/resolve.cjs +7 -0
  57. package/dist/cli/resolve.d.cts +11 -0
  58. package/dist/cli/resolve.d.cts.map +1 -0
  59. package/dist/cli/resolve.d.ts +11 -0
  60. package/dist/cli/resolve.d.ts.map +1 -0
  61. package/dist/cli/resolve.js +6 -0
  62. package/dist/cli/types.d.cts +3 -0
  63. package/dist/cli/types.d.ts +3 -0
  64. package/dist/cli/usage.cjs +3 -0
  65. package/dist/cli/usage.d.cts +9 -0
  66. package/dist/cli/usage.d.cts.map +1 -0
  67. package/dist/cli/usage.d.ts +9 -0
  68. package/dist/cli/usage.d.ts.map +1 -0
  69. package/dist/cli/usage.js +3 -0
  70. package/dist/{client-CPrEfAwa.cjs → client-C2TwbSm-.cjs} +197 -86
  71. package/dist/client-C2TwbSm-.cjs.map +1 -0
  72. package/dist/{client-MaVV1gVC.js → client-CWgvrDHH.js} +198 -81
  73. package/dist/client-CWgvrDHH.js.map +1 -0
  74. package/dist/{client-DLkUGS7r.d.ts → client-C_fNdaX8.d.cts} +118 -22
  75. package/dist/client-C_fNdaX8.d.cts.map +1 -0
  76. package/dist/{client-DV68BdcS.d.cts → client-VVhTv_ej.d.ts} +115 -19
  77. package/dist/client-VVhTv_ej.d.ts.map +1 -0
  78. package/dist/config-BMC-126h.js +74 -0
  79. package/dist/config-BMC-126h.js.map +1 -0
  80. package/dist/{config-CD-5FpOO.cjs → config-CllFlx5w.cjs} +178 -1
  81. package/dist/config-CllFlx5w.cjs.map +1 -0
  82. package/dist/config-DbQP60oo.cjs +80 -0
  83. package/dist/config-DbQP60oo.cjs.map +1 -0
  84. package/dist/{config-BvtWiL3I.js → config-DlhHLHjD.js} +173 -2
  85. package/dist/config-DlhHLHjD.js.map +1 -0
  86. package/dist/{constants-Fe-4NTUo.js → constants-BPM_OWt0.js} +18 -2
  87. package/dist/constants-BPM_OWt0.js.map +1 -0
  88. package/dist/{constants-wrEbre3j.cjs → constants-DJrjLmh5.cjs} +29 -1
  89. package/dist/constants-DJrjLmh5.cjs.map +1 -0
  90. package/dist/constants.cjs +3 -1
  91. package/dist/constants.d.cts +8 -1
  92. package/dist/constants.d.cts.map +1 -1
  93. package/dist/constants.d.ts +8 -1
  94. package/dist/constants.d.ts.map +1 -1
  95. package/dist/constants.js +2 -2
  96. package/dist/constraint-helpers-Bey-Pii6.js +64 -0
  97. package/dist/constraint-helpers-Bey-Pii6.js.map +1 -0
  98. package/dist/constraint-helpers-BqcuWXad.cjs +76 -0
  99. package/dist/constraint-helpers-BqcuWXad.cjs.map +1 -0
  100. package/dist/context-storage-B8onP4Pw.cjs +69 -0
  101. package/dist/context-storage-B8onP4Pw.cjs.map +1 -0
  102. package/dist/context-storage-BRwdNVKx.js +51 -0
  103. package/dist/context-storage-BRwdNVKx.js.map +1 -0
  104. package/dist/{create-dsn-BT3t-MDA.js → create-dsn-Bx2s8Bik.js} +11 -5
  105. package/dist/create-dsn-Bx2s8Bik.js.map +1 -0
  106. package/dist/{create-dsn-Bgwi-Ygi.cjs → create-dsn-ggGt0lZf.cjs} +13 -7
  107. package/dist/create-dsn-ggGt0lZf.cjs.map +1 -0
  108. package/dist/{create-project-Ca1Sy1_F.js → create-project-C0pm6zUK.js} +13 -7
  109. package/dist/create-project-C0pm6zUK.js.map +1 -0
  110. package/dist/{create-project-4R4aZMoc.cjs → create-project-CZBklXm8.cjs} +15 -9
  111. package/dist/create-project-CZBklXm8.cjs.map +1 -0
  112. package/dist/{create-team-D0dUl7Zo.js → create-team-BQIns3VD.js} +11 -5
  113. package/dist/create-team-BQIns3VD.js.map +1 -0
  114. package/dist/{create-team-CSBXDcoD.cjs → create-team-DmqKw2c1.cjs} +13 -7
  115. package/dist/create-team-DmqKw2c1.cjs.map +1 -0
  116. package/dist/{discover-dataset-fields-Cl7HpVkm.cjs → dataset-fields-C0m-vwNH.cjs} +13 -14
  117. package/dist/dataset-fields-C0m-vwNH.cjs.map +1 -0
  118. package/dist/{discover-dataset-fields-BEnyqPSq.js → dataset-fields-C1o_cZrM.js} +13 -14
  119. package/dist/dataset-fields-C1o_cZrM.js.map +1 -0
  120. package/dist/define-2Lj8Lm1t.js +8 -0
  121. package/dist/define-2Lj8Lm1t.js.map +1 -0
  122. package/dist/{defineTool-lWNTzWl_.cjs → define-BfP4rFlE.cjs} +2 -2
  123. package/dist/define-BfP4rFlE.cjs.map +1 -0
  124. package/dist/enhance-error-D3QfZOhm.js +32 -0
  125. package/dist/enhance-error-D3QfZOhm.js.map +1 -0
  126. package/dist/enhance-error-DzXrKg85.cjs +37 -0
  127. package/dist/enhance-error-DzXrKg85.cjs.map +1 -0
  128. package/dist/error-handling-CxV2m_Dr.cjs +132 -0
  129. package/dist/error-handling-CxV2m_Dr.cjs.map +1 -0
  130. package/dist/error-handling-R4SJQ7n0.js +97 -0
  131. package/dist/error-handling-R4SJQ7n0.js.map +1 -0
  132. package/dist/errors-00Iz6Wmy.d.cts +20 -0
  133. package/dist/errors-00Iz6Wmy.d.cts.map +1 -0
  134. package/dist/errors-Bmqdg5Q6.cjs +271 -0
  135. package/dist/errors-Bmqdg5Q6.cjs.map +1 -0
  136. package/dist/errors-Bvit2_Qs.d.ts +20 -0
  137. package/dist/errors-Bvit2_Qs.d.ts.map +1 -0
  138. package/dist/errors-CQZ-QlOB.js +217 -0
  139. package/dist/errors-CQZ-QlOB.js.map +1 -0
  140. package/dist/errors-DMiENfq7.d.cts +126 -0
  141. package/dist/errors-DMiENfq7.d.cts.map +1 -0
  142. package/dist/errors-JbBt1G2l.d.ts +126 -0
  143. package/dist/errors-JbBt1G2l.d.ts.map +1 -0
  144. package/dist/errors.d.cts +2 -20
  145. package/dist/errors.d.ts +2 -20
  146. package/dist/{fetch-utils-C_Xj921x.js → fetch-utils-BetJhSli.js} +1 -1
  147. package/dist/{fetch-utils-C_Xj921x.js.map → fetch-utils-BetJhSli.js.map} +1 -1
  148. package/dist/{fetch-utils-DkcYwqBo.cjs → fetch-utils-Cp3P-Ai3.cjs} +1 -1
  149. package/dist/{fetch-utils-DkcYwqBo.cjs.map → fetch-utils-Cp3P-Ai3.cjs.map} +1 -1
  150. package/dist/{find-dsns-DrNAfU_Q.js → find-dsns-BPN8wnUr.js} +9 -4
  151. package/dist/find-dsns-BPN8wnUr.js.map +1 -0
  152. package/dist/{find-dsns-CkvahHwJ.cjs → find-dsns-Ct6uFZMB.cjs} +11 -6
  153. package/dist/find-dsns-Ct6uFZMB.cjs.map +1 -0
  154. package/dist/{find-organizations-BDtHkcFV.cjs → find-organizations-BGI_WW2q.cjs} +22 -10
  155. package/dist/find-organizations-BGI_WW2q.cjs.map +1 -0
  156. package/dist/{find-organizations-Cs1GvZtJ.js → find-organizations-DxH9SS3w.js} +20 -8
  157. package/dist/find-organizations-DxH9SS3w.js.map +1 -0
  158. package/dist/find-projects-B80qSPpP.cjs +57 -0
  159. package/dist/find-projects-B80qSPpP.cjs.map +1 -0
  160. package/dist/find-projects-DOMBBYAP.js +51 -0
  161. package/dist/find-projects-DOMBBYAP.js.map +1 -0
  162. package/dist/{find-releases-Do_CywRr.js → find-releases-CfZRMBvh.js} +10 -5
  163. package/dist/find-releases-CfZRMBvh.js.map +1 -0
  164. package/dist/{find-releases-BsAkl--F.cjs → find-releases-Cy-Q-Qje.cjs} +12 -7
  165. package/dist/find-releases-Cy-Q-Qje.cjs.map +1 -0
  166. package/dist/find-teams-BuH2ddaL.cjs +57 -0
  167. package/dist/find-teams-BuH2ddaL.cjs.map +1 -0
  168. package/dist/find-teams-D5770X0I.js +51 -0
  169. package/dist/find-teams-D5770X0I.js.map +1 -0
  170. package/dist/{formatters-DSYXBiQx.js → formatters-B9XiCNZ_.js} +33 -27
  171. package/dist/formatters-B9XiCNZ_.js.map +1 -0
  172. package/dist/{formatters-DbqofIoy.cjs → formatters-CkbVfXEE.cjs} +17 -4
  173. package/dist/formatters-CkbVfXEE.cjs.map +1 -0
  174. package/dist/{formatters-CfeBjhXZ.cjs → formatters-DMlTJcHW.cjs} +38 -26
  175. package/dist/formatters-DMlTJcHW.cjs.map +1 -0
  176. package/dist/{formatters-B3ONbRhI.js → formatters-MEWHZ83Y.js} +12 -5
  177. package/dist/formatters-MEWHZ83Y.js.map +1 -0
  178. package/dist/{formatting-utils-C3sej5ER.js → formatting-CAQbf0su.js} +2 -2
  179. package/dist/formatting-CAQbf0su.js.map +1 -0
  180. package/dist/formatting-Cu1Skk_Y.cjs +897 -0
  181. package/dist/formatting-Cu1Skk_Y.cjs.map +1 -0
  182. package/dist/formatting-DytLf-hH.js +880 -0
  183. package/dist/formatting-DytLf-hH.js.map +1 -0
  184. package/dist/{formatting-utils-DDz14xeB.cjs → formatting-EM76FrY3.cjs} +2 -2
  185. package/dist/formatting-EM76FrY3.cjs.map +1 -0
  186. package/dist/{formatting-C3qu84cm.d.ts → formatting-FJne_W9i.d.cts} +11 -6
  187. package/dist/formatting-FJne_W9i.d.cts.map +1 -0
  188. package/dist/{formatting-CmBYkI_e.d.cts → formatting-ar_6QZRE.d.ts} +11 -6
  189. package/dist/formatting-ar_6QZRE.d.ts.map +1 -0
  190. package/dist/{get-doc-DyqJe6TP.js → get-doc-D9Xq7et9.js} +10 -5
  191. package/dist/get-doc-D9Xq7et9.js.map +1 -0
  192. package/dist/{get-doc-BfMg0GIa.cjs → get-doc-MxWNTA8R.cjs} +12 -7
  193. package/dist/get-doc-MxWNTA8R.cjs.map +1 -0
  194. package/dist/{get-event-attachment-CVoMrETq.js → get-event-attachment-B_BzSfcE.js} +9 -4
  195. package/dist/get-event-attachment-B_BzSfcE.js.map +1 -0
  196. package/dist/{get-event-attachment-BzhDeM6z.cjs → get-event-attachment-CrtS0QRV.cjs} +11 -6
  197. package/dist/get-event-attachment-CrtS0QRV.cjs.map +1 -0
  198. package/dist/{get-issue-details-_uS_AZ_v.js → get-issue-details-Bvw1Xi8I.js} +83 -23
  199. package/dist/get-issue-details-Bvw1Xi8I.js.map +1 -0
  200. package/dist/{get-issue-details-C96fhps3.cjs → get-issue-details-DTQ-jXyu.cjs} +85 -25
  201. package/dist/get-issue-details-DTQ-jXyu.cjs.map +1 -0
  202. package/dist/get-trace-details-BL5_jvgs.js +306 -0
  203. package/dist/get-trace-details-BL5_jvgs.js.map +1 -0
  204. package/dist/get-trace-details-iDp34mms.cjs +312 -0
  205. package/dist/get-trace-details-iDp34mms.cjs.map +1 -0
  206. package/dist/{handler-DTN2HYXt.js → handler-B08ITQl8.js} +45 -26
  207. package/dist/handler-B08ITQl8.js.map +1 -0
  208. package/dist/{handler-DEjS3yks.cjs → handler-B7-KeBak.cjs} +47 -28
  209. package/dist/handler-B7-KeBak.cjs.map +1 -0
  210. package/dist/{handler-BGhr9FJM.d.cts → handler-BcRR_2MX.d.cts} +4 -4
  211. package/dist/handler-BcRR_2MX.d.cts.map +1 -0
  212. package/dist/{handler-BPPTAi7I.d.ts → handler-CdSvAOl6.d.ts} +4 -4
  213. package/dist/handler-CdSvAOl6.d.ts.map +1 -0
  214. package/dist/{handler-7T1iMsQU.cjs → handler-DIiYPQGL.cjs} +46 -44
  215. package/dist/handler-DIiYPQGL.cjs.map +1 -0
  216. package/dist/{handler-BZ3hKPb8.d.cts → handler-LaesAQaD.d.cts} +4 -4
  217. package/dist/handler-LaesAQaD.d.cts.map +1 -0
  218. package/dist/{handler-B0bLvFFX.js → handler-nILS77E9.js} +44 -42
  219. package/dist/handler-nILS77E9.js.map +1 -0
  220. package/dist/{handler-cUB6XcUV.d.ts → handler-uWae09YN.d.ts} +4 -4
  221. package/dist/handler-uWae09YN.d.ts.map +1 -0
  222. package/dist/index.cjs +109 -103
  223. package/dist/index.cjs.map +1 -1
  224. package/dist/index.js +109 -103
  225. package/dist/index.js.map +1 -1
  226. package/dist/internal/agents/callEmbeddedAgent.cjs +4 -0
  227. package/dist/internal/agents/callEmbeddedAgent.d.cts +33 -0
  228. package/dist/internal/agents/callEmbeddedAgent.d.cts.map +1 -0
  229. package/dist/internal/agents/callEmbeddedAgent.d.ts +33 -0
  230. package/dist/internal/agents/callEmbeddedAgent.d.ts.map +1 -0
  231. package/dist/internal/agents/callEmbeddedAgent.js +4 -0
  232. package/dist/internal/agents/openai-provider.cjs +4 -0
  233. package/dist/internal/agents/openai-provider.d.cts +24 -0
  234. package/dist/internal/agents/openai-provider.d.cts.map +1 -0
  235. package/dist/internal/agents/openai-provider.d.ts +24 -0
  236. package/dist/internal/agents/openai-provider.d.ts.map +1 -0
  237. package/dist/internal/agents/openai-provider.js +3 -0
  238. package/dist/internal/agents/tools/dataset-fields.cjs +15 -0
  239. package/dist/{agent-tools/discover-dataset-fields.d.ts → internal/agents/tools/dataset-fields.d.cts} +18 -19
  240. package/dist/internal/agents/tools/dataset-fields.d.cts.map +1 -0
  241. package/dist/{agent-tools/discover-dataset-fields.d.cts → internal/agents/tools/dataset-fields.d.ts} +18 -19
  242. package/dist/internal/agents/tools/dataset-fields.d.ts.map +1 -0
  243. package/dist/internal/agents/tools/dataset-fields.js +12 -0
  244. package/dist/internal/agents/tools/otel-semantics.cjs +13 -0
  245. package/dist/internal/agents/tools/otel-semantics.d.cts +41 -0
  246. package/dist/internal/agents/tools/otel-semantics.d.cts.map +1 -0
  247. package/dist/internal/agents/tools/otel-semantics.d.ts +41 -0
  248. package/dist/internal/agents/tools/otel-semantics.d.ts.map +1 -0
  249. package/dist/internal/agents/tools/otel-semantics.js +12 -0
  250. package/dist/internal/agents/tools/utils.cjs +11 -0
  251. package/dist/internal/agents/tools/utils.d.cts +2 -0
  252. package/dist/internal/agents/tools/utils.d.ts +2 -0
  253. package/dist/internal/agents/tools/utils.js +11 -0
  254. package/dist/internal/agents/tools/whoami.cjs +13 -0
  255. package/dist/internal/agents/tools/whoami.d.cts +33 -0
  256. package/dist/internal/agents/tools/whoami.d.cts.map +1 -0
  257. package/dist/internal/agents/tools/whoami.d.ts +33 -0
  258. package/dist/internal/agents/tools/whoami.d.ts.map +1 -0
  259. package/dist/internal/agents/tools/whoami.js +12 -0
  260. package/dist/internal/constraint-helpers.cjs +4 -0
  261. package/dist/internal/constraint-helpers.d.cts +53 -0
  262. package/dist/internal/constraint-helpers.d.cts.map +1 -0
  263. package/dist/internal/constraint-helpers.d.ts +53 -0
  264. package/dist/internal/constraint-helpers.d.ts.map +1 -0
  265. package/dist/internal/constraint-helpers.js +3 -0
  266. package/dist/internal/context-storage.cjs +5 -0
  267. package/dist/internal/context-storage.d.cts +48 -0
  268. package/dist/internal/context-storage.d.cts.map +1 -0
  269. package/dist/internal/context-storage.d.ts +48 -0
  270. package/dist/internal/context-storage.d.ts.map +1 -0
  271. package/dist/internal/context-storage.js +3 -0
  272. package/dist/internal/error-handling.cjs +16 -0
  273. package/dist/internal/error-handling.d.cts +40 -0
  274. package/dist/internal/error-handling.d.cts.map +1 -0
  275. package/dist/internal/error-handling.d.ts +40 -0
  276. package/dist/internal/error-handling.d.ts.map +1 -0
  277. package/dist/internal/error-handling.js +11 -0
  278. package/dist/internal/fetch-utils.cjs +1 -1
  279. package/dist/internal/fetch-utils.d.cts +33 -2
  280. package/dist/internal/fetch-utils.d.cts.map +1 -0
  281. package/dist/internal/fetch-utils.d.ts +33 -2
  282. package/dist/internal/fetch-utils.d.ts.map +1 -0
  283. package/dist/internal/fetch-utils.js +1 -1
  284. package/dist/internal/formatting.cjs +2 -2
  285. package/dist/internal/formatting.d.cts +6 -5
  286. package/dist/internal/formatting.d.ts +6 -5
  287. package/dist/internal/formatting.js +2 -2
  288. package/dist/internal/issue-helpers.cjs +1 -1
  289. package/dist/internal/issue-helpers.d.cts +1 -1
  290. package/dist/internal/issue-helpers.d.ts +1 -1
  291. package/dist/internal/issue-helpers.js +1 -1
  292. package/dist/internal/test-fixtures.cjs +12 -2
  293. package/dist/internal/test-fixtures.cjs.map +1 -1
  294. package/dist/internal/test-fixtures.d.cts +35 -2043
  295. package/dist/internal/test-fixtures.d.cts.map +1 -1
  296. package/dist/internal/test-fixtures.d.ts +35 -2043
  297. package/dist/internal/test-fixtures.d.ts.map +1 -1
  298. package/dist/internal/test-fixtures.js +12 -2
  299. package/dist/internal/test-fixtures.js.map +1 -1
  300. package/dist/internal/tool-helpers/api.cjs +15 -0
  301. package/dist/{tools/utils/api-utils.d.cts → internal/tool-helpers/api.d.cts} +10 -10
  302. package/dist/internal/tool-helpers/api.d.cts.map +1 -0
  303. package/dist/{tools/utils/api-utils.d.ts → internal/tool-helpers/api.d.ts} +10 -10
  304. package/dist/internal/tool-helpers/api.d.ts.map +1 -0
  305. package/dist/internal/tool-helpers/api.js +13 -0
  306. package/dist/internal/tool-helpers/define.cjs +3 -0
  307. package/dist/internal/tool-helpers/define.d.cts +12 -0
  308. package/dist/internal/tool-helpers/define.d.cts.map +1 -0
  309. package/dist/internal/tool-helpers/define.d.ts +12 -0
  310. package/dist/internal/tool-helpers/define.d.ts.map +1 -0
  311. package/dist/internal/tool-helpers/define.js +3 -0
  312. package/dist/internal/tool-helpers/enhance-error.cjs +11 -0
  313. package/dist/internal/tool-helpers/enhance-error.d.cts +29 -0
  314. package/dist/internal/tool-helpers/enhance-error.d.cts.map +1 -0
  315. package/dist/internal/tool-helpers/enhance-error.d.ts +29 -0
  316. package/dist/internal/tool-helpers/enhance-error.d.ts.map +1 -0
  317. package/dist/internal/tool-helpers/enhance-error.js +11 -0
  318. package/dist/internal/tool-helpers/formatting.cjs +3 -0
  319. package/dist/internal/tool-helpers/formatting.d.cts +16 -0
  320. package/dist/internal/tool-helpers/formatting.d.cts.map +1 -0
  321. package/dist/internal/tool-helpers/formatting.d.ts +16 -0
  322. package/dist/internal/tool-helpers/formatting.d.ts.map +1 -0
  323. package/dist/internal/tool-helpers/formatting.js +3 -0
  324. package/dist/internal/tool-helpers/issue.cjs +8 -0
  325. package/dist/internal/tool-helpers/issue.d.cts +8 -0
  326. package/dist/internal/tool-helpers/issue.d.ts +8 -0
  327. package/dist/internal/tool-helpers/issue.js +7 -0
  328. package/dist/internal/tool-helpers/seer.cjs +11 -0
  329. package/dist/{tools/utils/seer-utils.d.cts → internal/tool-helpers/seer.d.cts} +8 -7
  330. package/dist/internal/tool-helpers/seer.d.cts.map +1 -0
  331. package/dist/{tools/utils/seer-utils.d.ts → internal/tool-helpers/seer.d.ts} +8 -7
  332. package/dist/internal/tool-helpers/seer.d.ts.map +1 -0
  333. package/dist/{tools/utils/seer-utils.js → internal/tool-helpers/seer.js} +1 -1
  334. package/dist/internal/tool-helpers/validate-region-url.cjs +5 -0
  335. package/dist/internal/tool-helpers/validate-region-url.d.cts +20 -0
  336. package/dist/internal/tool-helpers/validate-region-url.d.cts.map +1 -0
  337. package/dist/internal/tool-helpers/validate-region-url.d.ts +20 -0
  338. package/dist/internal/tool-helpers/validate-region-url.d.ts.map +1 -0
  339. package/dist/internal/tool-helpers/validate-region-url.js +5 -0
  340. package/dist/{issue-helpers-CRx45FYG.js → issue-helpers-8Bubch8E.js} +1 -1
  341. package/dist/{issue-helpers-CRx45FYG.js.map → issue-helpers-8Bubch8E.js.map} +1 -1
  342. package/dist/{issue-helpers-Cz01Ipvl.d.cts → issue-helpers-CD46ia7_.d.cts} +1 -1
  343. package/dist/{issue-helpers-Cz01Ipvl.d.cts.map → issue-helpers-CD46ia7_.d.cts.map} +1 -1
  344. package/dist/{issue-helpers-s5fKLwJZ.cjs → issue-helpers-DbPTv_qC.cjs} +1 -1
  345. package/dist/{issue-helpers-s5fKLwJZ.cjs.map → issue-helpers-DbPTv_qC.cjs.map} +1 -1
  346. package/dist/{issue-helpers-D1_Uqr-F.d.ts → issue-helpers-bECziPOG.d.ts} +1 -1
  347. package/dist/{issue-helpers-D1_Uqr-F.d.ts.map → issue-helpers-bECziPOG.d.ts.map} +1 -1
  348. package/dist/logging-CDYnh7ho.d.cts +31 -0
  349. package/dist/logging-CDYnh7ho.d.cts.map +1 -0
  350. package/dist/logging-CkAJKyq2.cjs +298 -0
  351. package/dist/logging-CkAJKyq2.cjs.map +1 -0
  352. package/dist/logging-DqqDTe02.js +256 -0
  353. package/dist/logging-DqqDTe02.js.map +1 -0
  354. package/dist/logging-PY270KtN.d.ts +31 -0
  355. package/dist/logging-PY270KtN.d.ts.map +1 -0
  356. package/dist/openai-provider-BELCfis6.js +29 -0
  357. package/dist/openai-provider-BELCfis6.js.map +1 -0
  358. package/dist/openai-provider-CRxXeC9G.cjs +41 -0
  359. package/dist/openai-provider-CRxXeC9G.cjs.map +1 -0
  360. package/dist/{lookup-otel-semantics-Dt667kdR.js → otel-semantics-CArUzarp.js} +88 -94
  361. package/dist/otel-semantics-CArUzarp.js.map +1 -0
  362. package/dist/{lookup-otel-semantics-BbriXZAx.cjs → otel-semantics-onvZv7i9.cjs} +88 -94
  363. package/dist/otel-semantics-onvZv7i9.cjs.map +1 -0
  364. package/dist/parse-8lpnm_2Z.js +92 -0
  365. package/dist/parse-8lpnm_2Z.js.map +1 -0
  366. package/dist/parse-shlhKlaL.cjs +110 -0
  367. package/dist/parse-shlhKlaL.cjs.map +1 -0
  368. package/dist/permissions-40d2hxK-.d.ts +79 -0
  369. package/dist/permissions-40d2hxK-.d.ts.map +1 -0
  370. package/dist/permissions-B1meXGie.d.cts +79 -0
  371. package/dist/permissions-B1meXGie.d.cts.map +1 -0
  372. package/dist/permissions-C_xHmYV4.js +157 -0
  373. package/dist/permissions-C_xHmYV4.js.map +1 -0
  374. package/dist/permissions-D5kR-bZw.cjs +211 -0
  375. package/dist/permissions-D5kR-bZw.cjs.map +1 -0
  376. package/dist/permissions.cjs +11 -0
  377. package/dist/permissions.d.cts +2 -0
  378. package/dist/permissions.d.ts +2 -0
  379. package/dist/permissions.js +3 -0
  380. package/dist/resolve-CBipUzux.cjs +65 -0
  381. package/dist/resolve-CBipUzux.cjs.map +1 -0
  382. package/dist/resolve-CZduTbDq.js +54 -0
  383. package/dist/resolve-CZduTbDq.js.map +1 -0
  384. package/dist/{schema-DWmx8lgm.d.ts → schema-0uEmsoCr.d.ts} +3043 -495
  385. package/dist/schema-0uEmsoCr.d.ts.map +1 -0
  386. package/dist/{schema-CcFmBoEf.js → schema-CuB-30t5.js} +116 -6
  387. package/dist/schema-CuB-30t5.js.map +1 -0
  388. package/dist/{schema-BL3kwfOA.cjs → schema-Cv_VNAHz.cjs} +21 -6
  389. package/dist/schema-Cv_VNAHz.cjs.map +1 -0
  390. package/dist/{schema-C0LznFvu.cjs → schema-DoWJbcHt.cjs} +145 -5
  391. package/dist/schema-DoWJbcHt.cjs.map +1 -0
  392. package/dist/{schema-DMfkTR1l.js → schema-rwexXWFL.js} +10 -7
  393. package/dist/schema-rwexXWFL.js.map +1 -0
  394. package/dist/{schema-xbTf44Hn.d.cts → schema-xhCkX5uD.d.cts} +2988 -440
  395. package/dist/schema-xhCkX5uD.d.cts.map +1 -0
  396. package/dist/schema.cjs +5 -2
  397. package/dist/schema.d.cts +8 -5
  398. package/dist/schema.d.cts.map +1 -1
  399. package/dist/schema.d.ts +8 -5
  400. package/dist/schema.d.ts.map +1 -1
  401. package/dist/schema.js +4 -3
  402. package/dist/{search-docs-DIm3ykOg.js → search-docs-B9qNTw49.js} +10 -5
  403. package/dist/search-docs-B9qNTw49.js.map +1 -0
  404. package/dist/{search-docs-EbjJuL9Q.cjs → search-docs-CTT1Bt1U.cjs} +12 -7
  405. package/dist/search-docs-CTT1Bt1U.cjs.map +1 -0
  406. package/dist/{seer-utils-C7Kv0gr8.cjs → seer-B63P5CPi.cjs} +2 -2
  407. package/dist/seer-B63P5CPi.cjs.map +1 -0
  408. package/dist/{seer-utils-NPHv8KYY.js → seer-CderEQ-X.js} +2 -2
  409. package/dist/seer-CderEQ-X.js.map +1 -0
  410. package/dist/sentry-BhTMff8f.js +104 -0
  411. package/dist/sentry-BhTMff8f.js.map +1 -0
  412. package/dist/sentry-DZNWcvcy.d.ts +9 -0
  413. package/dist/sentry-DZNWcvcy.d.ts.map +1 -0
  414. package/dist/sentry-Da9wc8eP.cjs +110 -0
  415. package/dist/sentry-Da9wc8eP.cjs.map +1 -0
  416. package/dist/sentry-De4G2HDR.d.cts +9 -0
  417. package/dist/sentry-De4G2HDR.d.cts.map +1 -0
  418. package/dist/server-B0jJJdAd.js +157 -0
  419. package/dist/server-B0jJJdAd.js.map +1 -0
  420. package/dist/server-Bk2YVj60.cjs +163 -0
  421. package/dist/server-Bk2YVj60.cjs.map +1 -0
  422. package/dist/server.cjs +62 -54
  423. package/dist/server.d.cts +32 -18
  424. package/dist/server.d.cts.map +1 -1
  425. package/dist/server.d.ts +32 -18
  426. package/dist/server.d.ts.map +1 -1
  427. package/dist/server.js +62 -54
  428. package/dist/slug-validation-58wajHeL.js +93 -0
  429. package/dist/slug-validation-58wajHeL.js.map +1 -0
  430. package/dist/slug-validation-DMk8Dyuh.cjs +111 -0
  431. package/dist/slug-validation-DMk8Dyuh.cjs.map +1 -0
  432. package/dist/{stdio-C6MAgHmA.cjs → stdio-D_myxOG-.cjs} +17 -15
  433. package/dist/stdio-D_myxOG-.cjs.map +1 -0
  434. package/dist/{stdio-DnAY4MSF.js → stdio-Uv0oXx1a.js} +17 -15
  435. package/dist/stdio-Uv0oXx1a.js.map +1 -0
  436. package/dist/telem/index.cjs +10 -0
  437. package/dist/telem/index.d.cts +3 -0
  438. package/dist/telem/index.d.ts +3 -0
  439. package/dist/telem/index.js +4 -0
  440. package/dist/telem/logging.cjs +9 -0
  441. package/dist/telem/logging.d.cts +2 -0
  442. package/dist/telem/logging.d.ts +2 -0
  443. package/dist/telem/logging.js +3 -0
  444. package/dist/telem/sentry.cjs +3 -0
  445. package/dist/telem/sentry.d.cts +2 -0
  446. package/dist/telem/sentry.d.ts +2 -0
  447. package/dist/telem/sentry.js +3 -0
  448. package/dist/test-setup.cjs +33843 -1525
  449. package/dist/test-setup.cjs.map +1 -1
  450. package/dist/test-setup.d.cts +32 -1
  451. package/dist/test-setup.d.cts.map +1 -0
  452. package/dist/test-setup.d.ts +32 -1
  453. package/dist/test-setup.d.ts.map +1 -0
  454. package/dist/test-setup.js +33896 -1578
  455. package/dist/test-setup.js.map +1 -1
  456. package/dist/test-utils/context.cjs +32 -0
  457. package/dist/test-utils/context.cjs.map +1 -0
  458. package/dist/test-utils/context.d.cts +17 -0
  459. package/dist/test-utils/context.d.cts.map +1 -0
  460. package/dist/test-utils/context.d.ts +17 -0
  461. package/dist/test-utils/context.d.ts.map +1 -0
  462. package/dist/test-utils/context.js +30 -0
  463. package/dist/test-utils/context.js.map +1 -0
  464. package/dist/toolDefinitions.cjs +638 -120
  465. package/dist/toolDefinitions.cjs.map +1 -1
  466. package/dist/toolDefinitions.d.cts +5 -5
  467. package/dist/toolDefinitions.d.cts.map +1 -1
  468. package/dist/toolDefinitions.d.ts +5 -5
  469. package/dist/toolDefinitions.d.ts.map +1 -1
  470. package/dist/toolDefinitions.js +638 -120
  471. package/dist/toolDefinitions.js.map +1 -1
  472. package/dist/tools/analyze-issue-with-seer.cjs +19 -15
  473. package/dist/tools/analyze-issue-with-seer.d.cts +4 -4
  474. package/dist/tools/analyze-issue-with-seer.d.ts +4 -4
  475. package/dist/tools/analyze-issue-with-seer.js +19 -15
  476. package/dist/tools/create-dsn.cjs +14 -10
  477. package/dist/tools/create-dsn.d.cts +5 -5
  478. package/dist/tools/create-dsn.d.ts +5 -5
  479. package/dist/tools/create-dsn.js +14 -10
  480. package/dist/tools/create-project.cjs +14 -11
  481. package/dist/tools/create-project.d.cts +5 -5
  482. package/dist/tools/create-project.d.ts +5 -5
  483. package/dist/tools/create-project.js +14 -11
  484. package/dist/tools/create-team.cjs +14 -10
  485. package/dist/tools/create-team.d.cts +4 -4
  486. package/dist/tools/create-team.d.ts +4 -4
  487. package/dist/tools/create-team.js +14 -10
  488. package/dist/tools/find-dsns.cjs +14 -10
  489. package/dist/tools/find-dsns.d.cts +7 -7
  490. package/dist/tools/find-dsns.d.cts.map +1 -1
  491. package/dist/tools/find-dsns.d.ts +7 -7
  492. package/dist/tools/find-dsns.d.ts.map +1 -1
  493. package/dist/tools/find-dsns.js +14 -10
  494. package/dist/tools/find-organizations.cjs +14 -8
  495. package/dist/tools/find-organizations.d.cts +7 -4
  496. package/dist/tools/find-organizations.d.ts +7 -4
  497. package/dist/tools/find-organizations.js +14 -8
  498. package/dist/tools/find-projects.cjs +14 -10
  499. package/dist/tools/find-projects.d.cts +7 -6
  500. package/dist/tools/find-projects.d.cts.map +1 -1
  501. package/dist/tools/find-projects.d.ts +7 -6
  502. package/dist/tools/find-projects.d.ts.map +1 -1
  503. package/dist/tools/find-projects.js +14 -10
  504. package/dist/tools/find-releases.cjs +14 -10
  505. package/dist/tools/find-releases.d.cts +5 -5
  506. package/dist/tools/find-releases.d.ts +5 -5
  507. package/dist/tools/find-releases.js +14 -10
  508. package/dist/tools/find-teams.cjs +14 -10
  509. package/dist/tools/find-teams.d.cts +7 -6
  510. package/dist/tools/find-teams.d.cts.map +1 -1
  511. package/dist/tools/find-teams.d.ts +7 -6
  512. package/dist/tools/find-teams.d.ts.map +1 -1
  513. package/dist/tools/find-teams.js +14 -10
  514. package/dist/tools/get-doc.cjs +10 -9
  515. package/dist/tools/get-doc.d.cts +3 -3
  516. package/dist/tools/get-doc.d.ts +3 -3
  517. package/dist/tools/get-doc.js +10 -9
  518. package/dist/tools/get-event-attachment.cjs +14 -10
  519. package/dist/tools/get-event-attachment.d.cts +9 -9
  520. package/dist/tools/get-event-attachment.d.cts.map +1 -1
  521. package/dist/tools/get-event-attachment.d.ts +9 -9
  522. package/dist/tools/get-event-attachment.d.ts.map +1 -1
  523. package/dist/tools/get-event-attachment.js +14 -10
  524. package/dist/tools/get-issue-details.cjs +19 -14
  525. package/dist/tools/get-issue-details.d.cts +4 -4
  526. package/dist/tools/get-issue-details.d.ts +4 -4
  527. package/dist/tools/get-issue-details.js +19 -14
  528. package/dist/tools/get-trace-details.cjs +17 -0
  529. package/dist/tools/get-trace-details.d.cts +14 -0
  530. package/dist/tools/get-trace-details.d.cts.map +1 -0
  531. package/dist/tools/get-trace-details.d.ts +14 -0
  532. package/dist/tools/get-trace-details.d.ts.map +1 -0
  533. package/dist/tools/get-trace-details.js +17 -0
  534. package/dist/tools/index.cjs +55 -48
  535. package/dist/tools/index.d.cts +81 -72
  536. package/dist/tools/index.d.cts.map +1 -1
  537. package/dist/tools/index.d.ts +81 -72
  538. package/dist/tools/index.d.ts.map +1 -1
  539. package/dist/tools/index.js +55 -48
  540. package/dist/tools/search-docs.cjs +13 -11
  541. package/dist/tools/search-docs.d.cts +3 -3
  542. package/dist/tools/search-docs.d.ts +3 -3
  543. package/dist/tools/search-docs.js +13 -11
  544. package/dist/tools/search-events/agent.cjs +16 -6
  545. package/dist/tools/search-events/agent.d.cts +7 -43
  546. package/dist/tools/search-events/agent.d.ts +7 -43
  547. package/dist/tools/search-events/agent.js +16 -6
  548. package/dist/tools/search-events/config.cjs +3 -2
  549. package/dist/tools/search-events/config.d.cts +2 -1
  550. package/dist/tools/search-events/config.d.cts.map +1 -1
  551. package/dist/tools/search-events/config.d.ts +2 -1
  552. package/dist/tools/search-events/config.d.ts.map +1 -1
  553. package/dist/tools/search-events/config.js +2 -2
  554. package/dist/tools/search-events/formatters.cjs +11 -3
  555. package/dist/tools/search-events/formatters.d.cts +28 -17
  556. package/dist/tools/search-events/formatters.d.cts.map +1 -1
  557. package/dist/tools/search-events/formatters.d.ts +28 -17
  558. package/dist/tools/search-events/formatters.d.ts.map +1 -1
  559. package/dist/tools/search-events/formatters.js +11 -4
  560. package/dist/tools/search-events/handler.cjs +23 -17
  561. package/dist/tools/search-events/handler.d.cts +4 -4
  562. package/dist/tools/search-events/handler.d.ts +4 -4
  563. package/dist/tools/search-events/handler.js +23 -17
  564. package/dist/tools/search-events/index.cjs +27 -19
  565. package/dist/tools/search-events/index.d.cts +11 -5
  566. package/dist/tools/search-events/index.d.ts +11 -5
  567. package/dist/tools/search-events/index.js +25 -19
  568. package/dist/tools/search-events/utils.cjs +14 -7
  569. package/dist/tools/search-events/utils.d.cts +7 -5
  570. package/dist/tools/search-events/utils.d.ts +7 -5
  571. package/dist/tools/search-events/utils.js +9 -2
  572. package/dist/tools/search-issues/agent.cjs +15 -5
  573. package/dist/tools/search-issues/agent.d.cts +7 -33
  574. package/dist/tools/search-issues/agent.d.ts +7 -33
  575. package/dist/tools/search-issues/agent.js +15 -5
  576. package/dist/tools/search-issues/config.cjs +1 -1
  577. package/dist/tools/search-issues/config.d.cts +1 -1
  578. package/dist/tools/search-issues/config.d.ts +1 -1
  579. package/dist/tools/search-issues/config.js +1 -1
  580. package/dist/tools/search-issues/formatters.cjs +3 -2
  581. package/dist/tools/search-issues/formatters.d.cts +20 -7
  582. package/dist/tools/search-issues/formatters.d.cts.map +1 -1
  583. package/dist/tools/search-issues/formatters.d.ts +20 -7
  584. package/dist/tools/search-issues/formatters.d.ts.map +1 -1
  585. package/dist/tools/search-issues/formatters.js +3 -3
  586. package/dist/tools/search-issues/handler.cjs +22 -15
  587. package/dist/tools/search-issues/handler.d.cts +4 -4
  588. package/dist/tools/search-issues/handler.d.ts +4 -4
  589. package/dist/tools/search-issues/handler.js +22 -15
  590. package/dist/tools/search-issues/index.cjs +26 -17
  591. package/dist/tools/search-issues/index.d.cts +11 -5
  592. package/dist/tools/search-issues/index.d.ts +11 -5
  593. package/dist/tools/search-issues/index.js +24 -17
  594. package/dist/tools/types.d.cts +3 -3
  595. package/dist/tools/types.d.ts +3 -3
  596. package/dist/tools/update-issue.cjs +19 -15
  597. package/dist/tools/update-issue.d.cts +10 -10
  598. package/dist/tools/update-issue.d.cts.map +1 -1
  599. package/dist/tools/update-issue.d.ts +10 -10
  600. package/dist/tools/update-issue.d.ts.map +1 -1
  601. package/dist/tools/update-issue.js +19 -15
  602. package/dist/tools/update-project.cjs +14 -11
  603. package/dist/tools/update-project.d.cts +6 -6
  604. package/dist/tools/update-project.d.ts +6 -6
  605. package/dist/tools/update-project.js +14 -11
  606. package/dist/tools/whoami.cjs +12 -8
  607. package/dist/tools/whoami.d.cts +3 -3
  608. package/dist/tools/whoami.d.ts +3 -3
  609. package/dist/tools/whoami.js +12 -8
  610. package/dist/{tools-qfk-QAo0.cjs → tools-DcCN34Xz.cjs} +21 -19
  611. package/dist/tools-DcCN34Xz.cjs.map +1 -0
  612. package/dist/tools-Du5wLts3.js +46 -0
  613. package/dist/tools-Du5wLts3.js.map +1 -0
  614. package/dist/transports/stdio.cjs +3 -55
  615. package/dist/transports/stdio.d.cts +12 -8
  616. package/dist/transports/stdio.d.cts.map +1 -1
  617. package/dist/transports/stdio.d.ts +12 -8
  618. package/dist/transports/stdio.d.ts.map +1 -1
  619. package/dist/transports/stdio.js +3 -55
  620. package/dist/types-4O1B8U0e.d.ts +40 -0
  621. package/dist/types-4O1B8U0e.d.ts.map +1 -0
  622. package/dist/types-B9_8hSal.d.cts +58 -0
  623. package/dist/types-B9_8hSal.d.cts.map +1 -0
  624. package/dist/types-BU11bcu2.d.ts +58 -0
  625. package/dist/types-BU11bcu2.d.ts.map +1 -0
  626. package/dist/{types-BOcoP3Na.d.ts → types-CZUp4Xzk.d.ts} +10 -3
  627. package/dist/types-CZUp4Xzk.d.ts.map +1 -0
  628. package/dist/types-CtnbvcEw.d.cts +40 -0
  629. package/dist/types-CtnbvcEw.d.cts.map +1 -0
  630. package/dist/{types-aOEJ0KgQ.d.cts → types-DkmHqy15.d.cts} +10 -3
  631. package/dist/types-DkmHqy15.d.cts.map +1 -0
  632. package/dist/types-NVsIso1A.d.ts +31 -0
  633. package/dist/types-NVsIso1A.d.ts.map +1 -0
  634. package/dist/types-Z4mR2AFK.d.cts +31 -0
  635. package/dist/types-Z4mR2AFK.d.cts.map +1 -0
  636. package/dist/types.cjs +16 -0
  637. package/dist/types.cjs.map +1 -0
  638. package/dist/types.d.cts +3 -3
  639. package/dist/types.d.ts +3 -3
  640. package/dist/types.js +15 -0
  641. package/dist/types.js.map +1 -0
  642. package/dist/{update-issue-DoQYEQjf.js → update-issue-CoAkoO66.js} +15 -14
  643. package/dist/update-issue-CoAkoO66.js.map +1 -0
  644. package/dist/{update-issue-DqUsAuTd.cjs → update-issue-eELBq_Uy.cjs} +19 -18
  645. package/dist/update-issue-eELBq_Uy.cjs.map +1 -0
  646. package/dist/{update-project-C9CLxNfF.js → update-project-CuZlyBPN.js} +15 -8
  647. package/dist/update-project-CuZlyBPN.js.map +1 -0
  648. package/dist/{update-project-DQu5PnE3.cjs → update-project-DMRBdOZ5.cjs} +17 -10
  649. package/dist/update-project-DMRBdOZ5.cjs.map +1 -0
  650. package/dist/{url-utils-vJo2ER5v.cjs → url-utils-Bn5EoScr.cjs} +38 -9
  651. package/dist/url-utils-Bn5EoScr.cjs.map +1 -0
  652. package/dist/{url-utils-IqgSmI-B.js → url-utils-d9bPTnOl.js} +33 -10
  653. package/dist/url-utils-d9bPTnOl.js.map +1 -0
  654. package/dist/usage-CP6e39yF.cjs +39 -0
  655. package/dist/usage-CP6e39yF.cjs.map +1 -0
  656. package/dist/usage-CihInDyq.js +33 -0
  657. package/dist/usage-CihInDyq.js.map +1 -0
  658. package/dist/utils/slug-validation.cjs +5 -0
  659. package/dist/utils/slug-validation.d.cts +51 -0
  660. package/dist/utils/slug-validation.d.cts.map +1 -0
  661. package/dist/utils/slug-validation.d.ts +51 -0
  662. package/dist/utils/slug-validation.d.ts.map +1 -0
  663. package/dist/utils/slug-validation.js +3 -0
  664. package/dist/utils/url-utils.cjs +2 -1
  665. package/dist/utils/url-utils.d.cts +14 -6
  666. package/dist/utils/url-utils.d.cts.map +1 -1
  667. package/dist/utils/url-utils.d.ts +14 -6
  668. package/dist/utils/url-utils.d.ts.map +1 -1
  669. package/dist/utils/url-utils.js +2 -2
  670. package/dist/{utils-CqbeJfE1.cjs → utils-C5DuiZoe.cjs} +39 -53
  671. package/dist/utils-C5DuiZoe.cjs.map +1 -0
  672. package/dist/utils-CwvZS30K.js +94 -0
  673. package/dist/utils-CwvZS30K.js.map +1 -0
  674. package/dist/utils-DKQuo7b2.d.ts +43 -0
  675. package/dist/utils-DKQuo7b2.d.ts.map +1 -0
  676. package/dist/{utils-CzV_Tz2C.d.ts → utils-DKgPcA6i.d.cts} +16 -12
  677. package/dist/utils-DKgPcA6i.d.cts.map +1 -0
  678. package/dist/utils-DUJcA3eH.cjs +96 -0
  679. package/dist/utils-DUJcA3eH.cjs.map +1 -0
  680. package/dist/{utils-Fm-dODdb.d.cts → utils-DpeFMEgH.d.ts} +16 -12
  681. package/dist/utils-DpeFMEgH.d.ts.map +1 -0
  682. package/dist/utils-HNrRwq-a.d.cts +43 -0
  683. package/dist/utils-HNrRwq-a.d.cts.map +1 -0
  684. package/dist/utils-iC0Uutcf.js +90 -0
  685. package/dist/utils-iC0Uutcf.js.map +1 -0
  686. package/dist/validate-region-url-CaR6XWB_.js +37 -0
  687. package/dist/validate-region-url-CaR6XWB_.js.map +1 -0
  688. package/dist/validate-region-url-dzz6t54w.cjs +42 -0
  689. package/dist/validate-region-url-dzz6t54w.cjs.map +1 -0
  690. package/dist/version-6dHij-Gk.js +6 -0
  691. package/dist/{version-DvjTvYJs.js.map → version-6dHij-Gk.js.map} +1 -1
  692. package/dist/{version-Bu9nGzm5.cjs → version-Cq6vA9Kc.cjs} +2 -2
  693. package/dist/{version-Bu9nGzm5.cjs.map → version-Cq6vA9Kc.cjs.map} +1 -1
  694. package/dist/version.cjs +1 -1
  695. package/dist/version.js +1 -1
  696. package/dist/whoami-Bh_uOPqO.js +37 -0
  697. package/dist/whoami-Bh_uOPqO.js.map +1 -0
  698. package/dist/{whoami-xBAWvzG4.js → whoami-D8-XCgVJ.js} +7 -5
  699. package/dist/whoami-D8-XCgVJ.js.map +1 -0
  700. package/dist/{whoami-CoZJKpys.cjs → whoami-DBSqcCGl.cjs} +7 -5
  701. package/dist/whoami-DBSqcCGl.cjs.map +1 -0
  702. package/dist/whoami-DBlwuDZf.cjs +42 -0
  703. package/dist/whoami-DBlwuDZf.cjs.map +1 -0
  704. package/package.json +55 -28
  705. package/dist/agent-COgY789I.js +0 -225
  706. package/dist/agent-COgY789I.js.map +0 -1
  707. package/dist/agent-Cody_f0d.cjs +0 -59
  708. package/dist/agent-Cody_f0d.cjs.map +0 -1
  709. package/dist/agent-DZRRChrO.js +0 -53
  710. package/dist/agent-DZRRChrO.js.map +0 -1
  711. package/dist/agent-DpCCnhh5.cjs +0 -231
  712. package/dist/agent-DpCCnhh5.cjs.map +0 -1
  713. package/dist/agent-tools/discover-dataset-fields.cjs +0 -6
  714. package/dist/agent-tools/discover-dataset-fields.d.cts.map +0 -1
  715. package/dist/agent-tools/discover-dataset-fields.d.ts.map +0 -1
  716. package/dist/agent-tools/discover-dataset-fields.js +0 -3
  717. package/dist/agent-tools/lookup-otel-semantics.cjs +0 -5
  718. package/dist/agent-tools/lookup-otel-semantics.d.cts +0 -38
  719. package/dist/agent-tools/lookup-otel-semantics.d.cts.map +0 -1
  720. package/dist/agent-tools/lookup-otel-semantics.d.ts +0 -38
  721. package/dist/agent-tools/lookup-otel-semantics.d.ts.map +0 -1
  722. package/dist/agent-tools/lookup-otel-semantics.js +0 -4
  723. package/dist/agent-tools/whoami.cjs +0 -4
  724. package/dist/agent-tools/whoami.d.cts +0 -28
  725. package/dist/agent-tools/whoami.d.cts.map +0 -1
  726. package/dist/agent-tools/whoami.d.ts +0 -28
  727. package/dist/agent-tools/whoami.d.ts.map +0 -1
  728. package/dist/agent-tools/whoami.js +0 -3
  729. package/dist/analyze-issue-with-seer-ByoDTsq-.cjs.map +0 -1
  730. package/dist/analyze-issue-with-seer-CpwtN4UA.js.map +0 -1
  731. package/dist/api-utils-BlUSO8xh.js.map +0 -1
  732. package/dist/api-utils-DFWUfQ83.cjs.map +0 -1
  733. package/dist/client-CPrEfAwa.cjs.map +0 -1
  734. package/dist/client-DLkUGS7r.d.ts.map +0 -1
  735. package/dist/client-DV68BdcS.d.cts.map +0 -1
  736. package/dist/client-MaVV1gVC.js.map +0 -1
  737. package/dist/config-BUmDxVLS.js +0 -52
  738. package/dist/config-BUmDxVLS.js.map +0 -1
  739. package/dist/config-BvtWiL3I.js.map +0 -1
  740. package/dist/config-CD-5FpOO.cjs.map +0 -1
  741. package/dist/config-FWsgDbm7.cjs +0 -58
  742. package/dist/config-FWsgDbm7.cjs.map +0 -1
  743. package/dist/constants-Fe-4NTUo.js.map +0 -1
  744. package/dist/constants-wrEbre3j.cjs.map +0 -1
  745. package/dist/create-dsn-BT3t-MDA.js.map +0 -1
  746. package/dist/create-dsn-Bgwi-Ygi.cjs.map +0 -1
  747. package/dist/create-project-4R4aZMoc.cjs.map +0 -1
  748. package/dist/create-project-Ca1Sy1_F.js.map +0 -1
  749. package/dist/create-team-CSBXDcoD.cjs.map +0 -1
  750. package/dist/create-team-D0dUl7Zo.js.map +0 -1
  751. package/dist/defineTool-77H4nSna.js +0 -8
  752. package/dist/defineTool-77H4nSna.js.map +0 -1
  753. package/dist/defineTool-lWNTzWl_.cjs.map +0 -1
  754. package/dist/discover-dataset-fields-BEnyqPSq.js.map +0 -1
  755. package/dist/discover-dataset-fields-Cl7HpVkm.cjs.map +0 -1
  756. package/dist/errors.d.cts.map +0 -1
  757. package/dist/errors.d.ts.map +0 -1
  758. package/dist/fetch-utils-CTLoW1R8.d.cts +0 -33
  759. package/dist/fetch-utils-CTLoW1R8.d.cts.map +0 -1
  760. package/dist/fetch-utils-JDZw4XaU.d.ts +0 -33
  761. package/dist/fetch-utils-JDZw4XaU.d.ts.map +0 -1
  762. package/dist/find-dsns-CkvahHwJ.cjs.map +0 -1
  763. package/dist/find-dsns-DrNAfU_Q.js.map +0 -1
  764. package/dist/find-organizations-BDtHkcFV.cjs.map +0 -1
  765. package/dist/find-organizations-Cs1GvZtJ.js.map +0 -1
  766. package/dist/find-projects-CZCMck_0.js +0 -39
  767. package/dist/find-projects-CZCMck_0.js.map +0 -1
  768. package/dist/find-projects-Dh-1AK-m.cjs +0 -45
  769. package/dist/find-projects-Dh-1AK-m.cjs.map +0 -1
  770. package/dist/find-releases-BsAkl--F.cjs.map +0 -1
  771. package/dist/find-releases-Do_CywRr.js.map +0 -1
  772. package/dist/find-teams-BylQQ4FO.js +0 -39
  773. package/dist/find-teams-BylQQ4FO.js.map +0 -1
  774. package/dist/find-teams-DXyzyQOy.cjs +0 -45
  775. package/dist/find-teams-DXyzyQOy.cjs.map +0 -1
  776. package/dist/formatters-B3ONbRhI.js.map +0 -1
  777. package/dist/formatters-CfeBjhXZ.cjs.map +0 -1
  778. package/dist/formatters-DSYXBiQx.js.map +0 -1
  779. package/dist/formatters-DbqofIoy.cjs.map +0 -1
  780. package/dist/formatting-C180PVwd.cjs +0 -419
  781. package/dist/formatting-C180PVwd.cjs.map +0 -1
  782. package/dist/formatting-C3qu84cm.d.ts.map +0 -1
  783. package/dist/formatting-CmBYkI_e.d.cts.map +0 -1
  784. package/dist/formatting-DIvCVunN.js +0 -402
  785. package/dist/formatting-DIvCVunN.js.map +0 -1
  786. package/dist/formatting-utils-C3sej5ER.js.map +0 -1
  787. package/dist/formatting-utils-DDz14xeB.cjs.map +0 -1
  788. package/dist/get-doc-BfMg0GIa.cjs.map +0 -1
  789. package/dist/get-doc-DyqJe6TP.js.map +0 -1
  790. package/dist/get-event-attachment-BzhDeM6z.cjs.map +0 -1
  791. package/dist/get-event-attachment-CVoMrETq.js.map +0 -1
  792. package/dist/get-issue-details-C96fhps3.cjs.map +0 -1
  793. package/dist/get-issue-details-_uS_AZ_v.js.map +0 -1
  794. package/dist/handler-7T1iMsQU.cjs.map +0 -1
  795. package/dist/handler-B0bLvFFX.js.map +0 -1
  796. package/dist/handler-BGhr9FJM.d.cts.map +0 -1
  797. package/dist/handler-BPPTAi7I.d.ts.map +0 -1
  798. package/dist/handler-BZ3hKPb8.d.cts.map +0 -1
  799. package/dist/handler-DEjS3yks.cjs.map +0 -1
  800. package/dist/handler-DTN2HYXt.js.map +0 -1
  801. package/dist/handler-cUB6XcUV.d.ts.map +0 -1
  802. package/dist/logging-BpL53bY6.cjs +0 -31
  803. package/dist/logging-BpL53bY6.cjs.map +0 -1
  804. package/dist/logging-tGU_SYcA.js +0 -25
  805. package/dist/logging-tGU_SYcA.js.map +0 -1
  806. package/dist/logging.cjs +0 -3
  807. package/dist/logging.d.cts +0 -37
  808. package/dist/logging.d.cts.map +0 -1
  809. package/dist/logging.d.ts +0 -37
  810. package/dist/logging.d.ts.map +0 -1
  811. package/dist/logging.js +0 -3
  812. package/dist/lookup-otel-semantics-BbriXZAx.cjs.map +0 -1
  813. package/dist/lookup-otel-semantics-Dt667kdR.js.map +0 -1
  814. package/dist/promptDefinitions-CVHtYaj8.d.cts +0 -34
  815. package/dist/promptDefinitions-CVHtYaj8.d.cts.map +0 -1
  816. package/dist/promptDefinitions-CWV8hsUX.cjs +0 -37
  817. package/dist/promptDefinitions-CWV8hsUX.cjs.map +0 -1
  818. package/dist/promptDefinitions-DF8nuJVq.js +0 -31
  819. package/dist/promptDefinitions-DF8nuJVq.js.map +0 -1
  820. package/dist/promptDefinitions-DehpwJfn.d.ts +0 -34
  821. package/dist/promptDefinitions-DehpwJfn.d.ts.map +0 -1
  822. package/dist/promptDefinitions.cjs +0 -5
  823. package/dist/promptDefinitions.d.cts +0 -2
  824. package/dist/promptDefinitions.d.ts +0 -2
  825. package/dist/promptDefinitions.js +0 -5
  826. package/dist/prompts-BTtNbKQR.cjs +0 -41
  827. package/dist/prompts-BTtNbKQR.cjs.map +0 -1
  828. package/dist/prompts-CYcvIxWR.js +0 -36
  829. package/dist/prompts-CYcvIxWR.js.map +0 -1
  830. package/dist/prompts.cjs +0 -4
  831. package/dist/prompts.d.cts +0 -30
  832. package/dist/prompts.d.cts.map +0 -1
  833. package/dist/prompts.d.ts +0 -30
  834. package/dist/prompts.d.ts.map +0 -1
  835. package/dist/prompts.js +0 -4
  836. package/dist/resources-Dadvq5Fm.cjs +0 -72
  837. package/dist/resources-Dadvq5Fm.cjs.map +0 -1
  838. package/dist/resources-jcFoc4JU.js +0 -60
  839. package/dist/resources-jcFoc4JU.js.map +0 -1
  840. package/dist/resources.cjs +0 -6
  841. package/dist/resources.d.cts +0 -37
  842. package/dist/resources.d.cts.map +0 -1
  843. package/dist/resources.d.ts +0 -37
  844. package/dist/resources.d.ts.map +0 -1
  845. package/dist/resources.js +0 -5
  846. package/dist/schema-BL3kwfOA.cjs.map +0 -1
  847. package/dist/schema-C0LznFvu.cjs.map +0 -1
  848. package/dist/schema-CcFmBoEf.js.map +0 -1
  849. package/dist/schema-DMfkTR1l.js.map +0 -1
  850. package/dist/schema-DWmx8lgm.d.ts.map +0 -1
  851. package/dist/schema-xbTf44Hn.d.cts.map +0 -1
  852. package/dist/search-docs-DIm3ykOg.js.map +0 -1
  853. package/dist/search-docs-EbjJuL9Q.cjs.map +0 -1
  854. package/dist/seer-utils-C7Kv0gr8.cjs.map +0 -1
  855. package/dist/seer-utils-NPHv8KYY.js.map +0 -1
  856. package/dist/server-CnJvaT0s.js +0 -292
  857. package/dist/server-CnJvaT0s.js.map +0 -1
  858. package/dist/server-Dv9HxoRk.cjs +0 -298
  859. package/dist/server-Dv9HxoRk.cjs.map +0 -1
  860. package/dist/stdio-C6MAgHmA.cjs.map +0 -1
  861. package/dist/stdio-DnAY4MSF.js.map +0 -1
  862. package/dist/tools/search-events/agent.d.cts.map +0 -1
  863. package/dist/tools/search-events/agent.d.ts.map +0 -1
  864. package/dist/tools/search-issues/agent.d.cts.map +0 -1
  865. package/dist/tools/search-issues/agent.d.ts.map +0 -1
  866. package/dist/tools/utils/api-utils.cjs +0 -11
  867. package/dist/tools/utils/api-utils.d.cts.map +0 -1
  868. package/dist/tools/utils/api-utils.d.ts.map +0 -1
  869. package/dist/tools/utils/api-utils.js +0 -9
  870. package/dist/tools/utils/defineTool.cjs +0 -3
  871. package/dist/tools/utils/defineTool.d.cts +0 -12
  872. package/dist/tools/utils/defineTool.d.cts.map +0 -1
  873. package/dist/tools/utils/defineTool.d.ts +0 -12
  874. package/dist/tools/utils/defineTool.d.ts.map +0 -1
  875. package/dist/tools/utils/defineTool.js +0 -3
  876. package/dist/tools/utils/fetch-utils.cjs +0 -5
  877. package/dist/tools/utils/fetch-utils.d.cts +0 -2
  878. package/dist/tools/utils/fetch-utils.d.ts +0 -2
  879. package/dist/tools/utils/fetch-utils.js +0 -4
  880. package/dist/tools/utils/formatting-utils.cjs +0 -3
  881. package/dist/tools/utils/formatting-utils.d.cts +0 -15
  882. package/dist/tools/utils/formatting-utils.d.cts.map +0 -1
  883. package/dist/tools/utils/formatting-utils.d.ts +0 -15
  884. package/dist/tools/utils/formatting-utils.d.ts.map +0 -1
  885. package/dist/tools/utils/formatting-utils.js +0 -3
  886. package/dist/tools/utils/issue-utils.cjs +0 -8
  887. package/dist/tools/utils/issue-utils.d.cts +0 -7
  888. package/dist/tools/utils/issue-utils.d.ts +0 -7
  889. package/dist/tools/utils/issue-utils.js +0 -7
  890. package/dist/tools/utils/seer-utils.cjs +0 -11
  891. package/dist/tools/utils/seer-utils.d.cts.map +0 -1
  892. package/dist/tools/utils/seer-utils.d.ts.map +0 -1
  893. package/dist/tools-B0wbxDty.js +0 -44
  894. package/dist/tools-B0wbxDty.js.map +0 -1
  895. package/dist/tools-qfk-QAo0.cjs.map +0 -1
  896. package/dist/types-BOcoP3Na.d.ts.map +0 -1
  897. package/dist/types-BV-G5sBp.d.cts +0 -31
  898. package/dist/types-BV-G5sBp.d.cts.map +0 -1
  899. package/dist/types-C1Fih0eQ.d.ts +0 -31
  900. package/dist/types-C1Fih0eQ.d.ts.map +0 -1
  901. package/dist/types-DE-njuHe.d.cts +0 -31
  902. package/dist/types-DE-njuHe.d.cts.map +0 -1
  903. package/dist/types-DRywojVB.d.ts +0 -31
  904. package/dist/types-DRywojVB.d.ts.map +0 -1
  905. package/dist/types-aOEJ0KgQ.d.cts.map +0 -1
  906. package/dist/update-issue-DoQYEQjf.js.map +0 -1
  907. package/dist/update-issue-DqUsAuTd.cjs.map +0 -1
  908. package/dist/update-project-C9CLxNfF.js.map +0 -1
  909. package/dist/update-project-DQu5PnE3.cjs.map +0 -1
  910. package/dist/url-utils-IqgSmI-B.js.map +0 -1
  911. package/dist/url-utils-vJo2ER5v.cjs.map +0 -1
  912. package/dist/utils-CqbeJfE1.cjs.map +0 -1
  913. package/dist/utils-CzV_Tz2C.d.ts.map +0 -1
  914. package/dist/utils-Fm-dODdb.d.cts.map +0 -1
  915. package/dist/utils-OgYE-imr.js +0 -108
  916. package/dist/utils-OgYE-imr.js.map +0 -1
  917. package/dist/version-DvjTvYJs.js +0 -6
  918. package/dist/whoami-BOJHfdih.cjs +0 -28
  919. package/dist/whoami-BOJHfdih.cjs.map +0 -1
  920. package/dist/whoami-Bswhb72a.js +0 -23
  921. package/dist/whoami-Bswhb72a.js.map +0 -1
  922. package/dist/whoami-CoZJKpys.cjs.map +0 -1
  923. package/dist/whoami-xBAWvzG4.js.map +0 -1
  924. /package/dist/{api-client-BWt6M7ij.cjs → api-client-BR5WolLe.js} +0 -0
  925. /package/dist/{api-client-CNv_hbPO.js → api-client-BsHWi0-I.cjs} +0 -0
  926. /package/dist/{fetch-utils-BqMx2KQr.js → cli/types.cjs} +0 -0
  927. /package/dist/{fetch-utils-DeZcERfe.cjs → cli/types.js} +0 -0
  928. /package/dist/{index-BPSCxsMC.d.cts → index-CmCelmEL.d.cts} +0 -0
  929. /package/dist/{index-DE1muTvw.d.ts → index-DZJ9s9rm.d.ts} +0 -0
  930. /package/dist/{issue-utils-BVAB6I-Z.js → issue-B7cgiWKp.cjs} +0 -0
  931. /package/dist/{issue-utils-pdbo-5LW.cjs → issue-BLm6gohl.js} +0 -0
  932. /package/dist/{search-events-BBFPuvRq.cjs → search-events-Bc2a_R3A.cjs} +0 -0
  933. /package/dist/{search-events-bV3-kK78.js → search-events-Bo5bAsOv.js} +0 -0
  934. /package/dist/{search-issues-BFgCvRYe.js → search-issues-AaiYCZ6J.cjs} +0 -0
  935. /package/dist/{search-issues-Biu64RkQ.cjs → search-issues-DVHuKDdB.js} +0 -0
  936. /package/dist/{types-6zHoEWAx.js → types-Bx1EKe0v.js} +0 -0
  937. /package/dist/{types-DdloOYgD.cjs → types-D10T4PdD.cjs} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatting-C180PVwd.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>[]","contexts: z.infer<typeof EventSchema>[\"contexts\"]","autofixState: AutofixRunState"],"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} from \"../api-client\";\nimport {\n getOutputForAutofixStep,\n getStatusDisplayName,\n isTerminalStatus,\n} from \"../tools/utils/seer-utils\";\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 += 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 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 Seer AI analysis context for inclusion in issue details.\n * Provides a minimal summary showing just the key solution when available.\n *\n * @param autofixState - The autofix state containing Seer analysis data\n * @returns Formatted markdown string with Seer context, or empty string if no analysis exists\n */\nfunction formatSeerContext(autofixState: AutofixRunState): string {\n if (!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 // For completed analyses, show just the key solution\n if (isTerminalStatus(autofix.status) && autofix.steps.length > 0) {\n const completedSteps = autofix.steps.filter(\n (step) => step.status === \"COMPLETED\",\n );\n\n // Find the solution step and show its description directly\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(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(firstParagraph.trim());\n }\n }\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 += formatSeerContext(autofixState);\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":";;;AA0BA,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,QAAQ;GAEX,MAAM,YAAY,MAAM,UAAU;GAClC,MAAM,SAAS,MAAM,YAAY;GACjC,MAAM,SAAS,MAAM,YAAY;GACjC,MAAM,WAAW,MAAM,UAAU,GAAG,MAAM,WAAW;AACrD,WAAQ,KAAK,UAAU,GAAG,OAAO,GAAG,SAAS,SAAS;EACvD;EAED,KAAK,UAAU;GAEb,MAAM,OACJ,MAAM,YAAY,MAAM,WAAW,MAAM,UAAU;GACrD,MAAM,OAAO,MAAM,YAAY;GAC/B,MAAM,OAAO,MAAM,UAAU,SAAS,MAAM,WAAW;AACvD,WAAQ,UAAU,KAAK,GAAG,KAAK,OAAO;EACvC;EAED,KAAK,aAGH,WAAU;GAAC,MAAM;GAAU,MAAM;GAAQ,MAAM;EAAM,EAClD,OAAO,CAAC,QAAQ,EAAE,CAClB,KAAK,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,WAAU,kBAAkB,aAAa;AAG3C,WAAU;AACV,YAAW,mEAAmE,MAAM,QAAQ;AAC5F,WACE;AACF,QAAO;AACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatting-C3qu84cm.d.ts","names":[],"sources":["../src/internal/formatting.ts"],"sourcesContent":[],"mappings":";;;;;;;AAoFgB;AAoEhB;AA+gBA;;;;;;;AAQS,iBA5lBO,iBAAA,CA4lBP,KAAA,EA3lBA,CAAA,CAAE,KA2lBF,CAAA,OA3lBe,cA2lBf,CAAA,EAAA,UAAA,CAAA,EAAA,MAAA,EAAA,QAAA,CAAA,EAAA,MAAA,GAAA,IAAA,CAAA,EAAA,MAAA;;;;AAGuB;;;;iBA1hBhB,iBAAA,QAAyB;;;;;;;;iBA+gBzB,iBAAA;;;;;;;;SAQP;SACA;cACK;iBACG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatting-CmBYkI_e.d.cts","names":[],"sources":["../src/internal/formatting.ts"],"sourcesContent":[],"mappings":";;;;;;;AAoFgB;AAoEhB;AA+gBA;;;;;;;AAQS,iBA5lBO,iBAAA,CA4lBP,KAAA,EA3lBA,CAAA,CAAE,KA2lBF,CAAA,OA3lBe,cA2lBf,CAAA,EAAA,UAAA,CAAA,EAAA,MAAA,EAAA,QAAA,CAAA,EAAA,MAAA,GAAA,IAAA,CAAA,EAAA,MAAA;;;;AAGuB;;;;iBA1hBhB,iBAAA,QAAyB;;;;;;;;iBA+gBzB,iBAAA;;;;;;;;SAQP;SACA;cACK;iBACG"}
@@ -1,402 +0,0 @@
1
- import { getOutputForAutofixStep, isTerminalStatus } from "./seer-utils-NPHv8KYY.js";
2
-
3
- //#region src/internal/formatting.ts
4
- const LANGUAGE_EXTENSIONS = {
5
- ".java": "java",
6
- ".py": "python",
7
- ".js": "javascript",
8
- ".jsx": "javascript",
9
- ".ts": "javascript",
10
- ".tsx": "javascript",
11
- ".rb": "ruby",
12
- ".php": "php"
13
- };
14
- const LANGUAGE_MODULE_PATTERNS = [[/^(java\.|com\.|org\.)/, "java"]];
15
- /**
16
- * Detects the programming language of a stack frame based on the file extension.
17
- * Falls back to the platform parameter if no filename is available or extension is unrecognized.
18
- *
19
- * @param frame - The stack frame containing file and location information
20
- * @param platform - Optional platform hint to use as fallback
21
- * @returns The detected language or platform fallback or "unknown"
22
- */
23
- function detectLanguage(frame, platform) {
24
- if (frame.filename) {
25
- const ext = frame.filename.toLowerCase().match(/\.[^.]+$/)?.[0];
26
- if (ext && LANGUAGE_EXTENSIONS[ext]) return LANGUAGE_EXTENSIONS[ext];
27
- }
28
- if (frame.module) {
29
- for (const [pattern, language] of LANGUAGE_MODULE_PATTERNS) if (pattern.test(frame.module)) return language;
30
- }
31
- return platform || "unknown";
32
- }
33
- /**
34
- * Formats a stack frame into a language-specific string representation.
35
- * Different languages have different conventions for displaying stack traces.
36
- *
37
- * @param frame - The stack frame to format
38
- * @param frameIndex - Optional frame index for languages that display frame numbers
39
- * @param platform - Optional platform hint for language detection fallback
40
- * @returns Formatted stack frame string
41
- */
42
- function formatFrameHeader(frame, frameIndex, platform) {
43
- const language = detectLanguage(frame, platform);
44
- switch (language) {
45
- case "java": {
46
- const className = frame.module || "UnknownClass";
47
- const method = frame.function || "<unknown>";
48
- const source = frame.filename || "Unknown Source";
49
- const location = frame.lineNo ? `:${frame.lineNo}` : "";
50
- return `at ${className}.${method}(${source}${location})`;
51
- }
52
- case "python": {
53
- const file = frame.filename || frame.absPath || frame.module || "<unknown>";
54
- const func = frame.function || "<module>";
55
- const line = frame.lineNo ? `, line ${frame.lineNo}` : "";
56
- return ` File "${file}"${line}, in ${func}`;
57
- }
58
- case "javascript": return `${[
59
- frame.filename,
60
- frame.lineNo,
61
- frame.colNo
62
- ].filter((i) => !!i).join(":")}${frame.function ? ` (${frame.function})` : ""}`;
63
- case "ruby": {
64
- const file = frame.filename || frame.module || "<unknown>";
65
- const func = frame.function ? ` \`${frame.function}\`` : "";
66
- const line = frame.lineNo ? `:${frame.lineNo}:in` : "";
67
- return ` from ${file}${line}${func}`;
68
- }
69
- case "php": {
70
- const file = frame.filename || "<unknown>";
71
- const line = frame.lineNo ? `(${frame.lineNo})` : "";
72
- const func = frame.function || "<unknown>";
73
- const prefix = frameIndex !== void 0 ? `#${frameIndex} ` : "";
74
- return `${prefix}${file}${line}: ${func}()`;
75
- }
76
- default: {
77
- const func = frame.function || "<unknown>";
78
- const location = frame.filename || frame.module || "<unknown>";
79
- const line = frame.lineNo ? `:${frame.lineNo}` : "";
80
- const col = frame.colNo != null ? `:${frame.colNo}` : "";
81
- return ` at ${func} (${location}${line}${col})`;
82
- }
83
- }
84
- }
85
- /**
86
- * Formats a Sentry event into a structured markdown output.
87
- * Includes error messages, stack traces, request info, and contextual data.
88
- *
89
- * @param event - The Sentry event to format
90
- * @returns Formatted markdown string
91
- */
92
- function formatEventOutput(event) {
93
- let output = "";
94
- const messageEntry = event.entries.find((e) => e.type === "message");
95
- const exceptionEntry = event.entries.find((e) => e.type === "exception");
96
- const threadsEntry = event.entries.find((e) => e.type === "threads");
97
- const requestEntry = event.entries.find((e) => e.type === "request");
98
- if (messageEntry) output += formatMessageInterfaceOutput(event, messageEntry.data);
99
- if (exceptionEntry) output += formatExceptionInterfaceOutput(event, exceptionEntry.data);
100
- else if (threadsEntry) output += formatThreadsInterfaceOutput(event, threadsEntry.data);
101
- if (requestEntry) output += formatRequestInterfaceOutput(event, requestEntry.data);
102
- output += formatContexts(event.contexts);
103
- return output;
104
- }
105
- /**
106
- * Extracts the context line matching the frame's line number for inline display.
107
- * This is used in the full stacktrace view to show the actual line of code
108
- * that caused the error inline with the stack frame.
109
- *
110
- * @param frame - The stack frame containing context lines
111
- * @returns The line of code at the frame's line number, or empty string if not available
112
- */
113
- function renderInlineContext(frame) {
114
- if (!frame.context?.length || !frame.lineNo) return "";
115
- const contextLine = frame.context.find(([lineNo]) => lineNo === frame.lineNo);
116
- return contextLine ? `\n${contextLine[1]}` : "";
117
- }
118
- /**
119
- * Renders an enhanced view of a stack frame with context lines and variables.
120
- * Used for the "Most Relevant Frame" section to provide detailed information
121
- * about the most relevant application frame where the error occurred.
122
- *
123
- * @param frame - The stack frame to render with enhanced information
124
- * @param event - The Sentry event containing platform information for language detection
125
- * @returns Formatted string with frame header, context lines, and variables table
126
- */
127
- function renderEnhancedFrame(frame, event) {
128
- const parts = [];
129
- parts.push("**Most Relevant Frame:**");
130
- parts.push("─────────────────────");
131
- parts.push(formatFrameHeader(frame, void 0, event.platform));
132
- if (frame.context?.length) {
133
- const contextLines = renderContextLines(frame);
134
- if (contextLines) {
135
- parts.push("");
136
- parts.push(contextLines);
137
- }
138
- }
139
- if (frame.vars && Object.keys(frame.vars).length > 0) {
140
- parts.push("");
141
- parts.push(renderVariablesTable(frame.vars));
142
- }
143
- return parts.join("\n");
144
- }
145
- function formatExceptionInterfaceOutput(event, data) {
146
- const parts = [];
147
- const exceptions = data.values || (data.value ? [data.value] : []);
148
- if (exceptions.length === 0) return "";
149
- const isChained = exceptions.length > 1;
150
- [...exceptions].reverse().forEach((exception, index) => {
151
- if (!exception) return;
152
- if (isChained && index > 0) {
153
- parts.push("");
154
- parts.push(getExceptionChainMessage(event.platform || null, index, exceptions.length));
155
- parts.push("");
156
- }
157
- const exceptionTitle = `${exception.type}${exception.value ? `: ${exception.value}` : ""}`;
158
- parts.push(index === 0 ? "### Error" : `### ${exceptionTitle}`);
159
- parts.push("");
160
- if (index === 0) {
161
- parts.push("```");
162
- parts.push(exceptionTitle);
163
- parts.push("```");
164
- parts.push("");
165
- }
166
- if (!exception.stacktrace || !exception.stacktrace.frames) {
167
- parts.push("**Stacktrace:**");
168
- parts.push("```");
169
- parts.push("No stacktrace available");
170
- parts.push("```");
171
- return;
172
- }
173
- const frames = exception.stacktrace.frames;
174
- if (index === 0) {
175
- const firstInAppFrame = findFirstInAppFrame(frames);
176
- if (firstInAppFrame && (firstInAppFrame.context?.length || firstInAppFrame.vars)) {
177
- parts.push(renderEnhancedFrame(firstInAppFrame, event));
178
- parts.push("");
179
- parts.push("**Full Stacktrace:**");
180
- parts.push("────────────────");
181
- } else parts.push("**Stacktrace:**");
182
- } else parts.push("**Stacktrace:**");
183
- parts.push("```");
184
- parts.push(frames.map((frame) => {
185
- const header = formatFrameHeader(frame, void 0, event.platform);
186
- const context = renderInlineContext(frame);
187
- return `${header}${context}`;
188
- }).join("\n"));
189
- parts.push("```");
190
- });
191
- parts.push("");
192
- parts.push("");
193
- return parts.join("\n");
194
- }
195
- /**
196
- * Get the appropriate exception chain message based on the platform
197
- */
198
- function getExceptionChainMessage(platform, index, totalExceptions) {
199
- const defaultMessage = "**During handling of the above exception, another exception occurred:**";
200
- if (!platform) return defaultMessage;
201
- switch (platform.toLowerCase()) {
202
- case "python": return "**During handling of the above exception, another exception occurred:**";
203
- case "java": return "**Caused by:**";
204
- case "csharp":
205
- case "dotnet": return "**---> Inner Exception:**";
206
- case "ruby": return "**Caused by:**";
207
- case "go": return "**Wrapped error:**";
208
- case "rust": return `**Caused by (${index}):**`;
209
- default: return defaultMessage;
210
- }
211
- }
212
- function formatRequestInterfaceOutput(event, data) {
213
- if (!data.method || !data.url) return "";
214
- return `### HTTP Request\n\n**Method:** ${data.method}\n**URL:** ${data.url}\n\n`;
215
- }
216
- function formatMessageInterfaceOutput(event, data) {
217
- if (!data.formatted && !data.message) return "";
218
- const message = data.formatted || data.message || "";
219
- return `### Error\n\n\`\`\`\n${message}\n\`\`\`\n\n`;
220
- }
221
- function formatThreadsInterfaceOutput(event, data) {
222
- if (!data.values || data.values.length === 0) return "";
223
- const crashedThread = data.values.find((t) => t.crashed);
224
- if (!crashedThread?.stacktrace?.frames) return "";
225
- const parts = [];
226
- if (crashedThread.name) {
227
- parts.push(`**Thread** (${crashedThread.name})`);
228
- parts.push("");
229
- }
230
- const frames = crashedThread.stacktrace.frames;
231
- const firstInAppFrame = findFirstInAppFrame(frames);
232
- if (firstInAppFrame && (firstInAppFrame.context?.length || firstInAppFrame.vars)) {
233
- parts.push(renderEnhancedFrame(firstInAppFrame, event));
234
- parts.push("");
235
- parts.push("**Full Stacktrace:**");
236
- parts.push("────────────────");
237
- } else parts.push("**Stacktrace:**");
238
- parts.push("```");
239
- parts.push(frames.map((frame) => {
240
- const header = formatFrameHeader(frame, void 0, event.platform);
241
- const context = renderInlineContext(frame);
242
- return `${header}${context}`;
243
- }).join("\n"));
244
- parts.push("```");
245
- parts.push("");
246
- return parts.join("\n");
247
- }
248
- /**
249
- * Renders surrounding source code context for a stack frame.
250
- * Shows a window of code lines around the error line with visual indicators.
251
- *
252
- * @param frame - The stack frame containing context lines
253
- * @param contextSize - Number of lines to show before and after the error line (default: 3)
254
- * @returns Formatted context lines with line numbers and arrow indicator for the error line
255
- */
256
- function renderContextLines(frame, contextSize = 3) {
257
- if (!frame.context || frame.context.length === 0 || !frame.lineNo) return "";
258
- const lines = [];
259
- const errorLine = frame.lineNo;
260
- const maxLineNoWidth = Math.max(...frame.context.map(([lineNo]) => lineNo.toString().length));
261
- for (const [lineNo, code] of frame.context) {
262
- const isErrorLine = lineNo === errorLine;
263
- const lineNoStr = lineNo.toString().padStart(maxLineNoWidth, " ");
264
- if (Math.abs(lineNo - errorLine) <= contextSize) if (isErrorLine) lines.push(` → ${lineNoStr} │ ${code}`);
265
- else lines.push(` ${lineNoStr} │ ${code}`);
266
- }
267
- return lines.join("\n");
268
- }
269
- /**
270
- * Formats a variable value for display in the variables table.
271
- * Handles different types appropriately and safely, converting complex objects
272
- * to readable representations and handling edge cases like circular references.
273
- *
274
- * @param value - The variable value to format (can be any type)
275
- * @param maxLength - Maximum length for stringified objects/arrays (default: 80)
276
- * @returns Human-readable string representation of the value
277
- */
278
- function formatVariableValue(value, maxLength = 80) {
279
- try {
280
- if (typeof value === "string") return `"${value}"`;
281
- if (value === null) return "null";
282
- if (value === void 0) return "undefined";
283
- if (typeof value === "object") {
284
- const stringified = JSON.stringify(value);
285
- if (stringified.length > maxLength) {
286
- const truncateAt = maxLength - 6;
287
- let truncated = stringified.substring(0, truncateAt);
288
- const lastComma = truncated.lastIndexOf(",");
289
- if (lastComma > 0) truncated = truncated.substring(0, lastComma);
290
- if (Array.isArray(value)) return `${truncated}, ...]`;
291
- return `${truncated}, ...}`;
292
- }
293
- return stringified;
294
- }
295
- return String(value);
296
- } catch {
297
- return `<${typeof value}>`;
298
- }
299
- }
300
- /**
301
- * Renders a table of local variables in a tree-like format.
302
- * Uses box-drawing characters to create a visual hierarchy of variables
303
- * and their values at the point where the error occurred.
304
- *
305
- * @param vars - Object containing variable names as keys and their values
306
- * @returns Formatted variables table with tree-style prefix characters
307
- */
308
- function renderVariablesTable(vars) {
309
- const entries = Object.entries(vars);
310
- if (entries.length === 0) return "";
311
- const lines = ["Local Variables:"];
312
- const lastIndex = entries.length - 1;
313
- entries.forEach(([key, value], index) => {
314
- const prefix = index === lastIndex ? "└─" : "├─";
315
- const valueStr = formatVariableValue(value);
316
- lines.push(`${prefix} ${key}: ${valueStr}`);
317
- });
318
- return lines.join("\n");
319
- }
320
- /**
321
- * Finds the first application frame (in_app) in a stack trace.
322
- * Searches from the bottom of the stack (oldest frame) to find the first
323
- * frame that belongs to the user's application code rather than libraries.
324
- *
325
- * @param frames - Array of stack frames, typically in reverse chronological order
326
- * @returns The first in-app frame found, or undefined if none exist
327
- */
328
- function findFirstInAppFrame(frames) {
329
- for (let i = frames.length - 1; i >= 0; i--) if (frames[i].inApp === true) return frames[i];
330
- return void 0;
331
- }
332
- function formatContexts(contexts) {
333
- if (!contexts || Object.keys(contexts).length === 0) return "";
334
- return `### Additional Context\n\nThese are additional context provided by the user when they're instrumenting their application.\n\n${Object.entries(contexts).map(([name, data]) => `**${name}**\n${Object.entries(data).filter(([key, _]) => key !== "type").map(([key, value]) => {
335
- return `${key}: ${JSON.stringify(value, void 0, 2)}`;
336
- }).join("\n")}`).join("\n\n")}\n\n`;
337
- }
338
- /**
339
- * Formats Seer AI analysis context for inclusion in issue details.
340
- * Provides a minimal summary showing just the key solution when available.
341
- *
342
- * @param autofixState - The autofix state containing Seer analysis data
343
- * @returns Formatted markdown string with Seer context, or empty string if no analysis exists
344
- */
345
- function formatSeerContext(autofixState) {
346
- if (!autofixState.autofix) return "";
347
- const { autofix } = autofixState;
348
- const parts = [];
349
- parts.push("## Seer AI Analysis");
350
- parts.push("");
351
- if (isTerminalStatus(autofix.status) && autofix.steps.length > 0) {
352
- const completedSteps = autofix.steps.filter((step) => step.status === "COMPLETED");
353
- const solutionStep = completedSteps.find((step) => step.type === "solution");
354
- if (solutionStep) {
355
- const solutionDescription = solutionStep.description;
356
- if (solutionDescription && typeof solutionDescription === "string" && solutionDescription.trim()) parts.push(solutionDescription.trim());
357
- else {
358
- const solutionOutput = getOutputForAutofixStep(solutionStep);
359
- const lines = solutionOutput.split("\n");
360
- const firstParagraph = lines.find((line) => line.trim().length > 50 && !line.startsWith("#") && !line.startsWith("*"));
361
- if (firstParagraph) parts.push(firstParagraph.trim());
362
- }
363
- }
364
- }
365
- return `${parts.join("\n")}\n\n`;
366
- }
367
- /**
368
- * Formats a Sentry issue with its latest event into comprehensive markdown output.
369
- * Includes issue metadata, event details, and usage instructions.
370
- *
371
- * @param params - Object containing organization slug, issue, event, and API service
372
- * @returns Formatted markdown string with complete issue information
373
- */
374
- function formatIssueOutput({ organizationSlug, issue, event, apiService, autofixState }) {
375
- let output = `# Issue ${issue.shortId} in **${organizationSlug}**\n\n`;
376
- output += `**Description**: ${issue.title}\n`;
377
- output += `**Culprit**: ${issue.culprit}\n`;
378
- output += `**First Seen**: ${new Date(issue.firstSeen).toISOString()}\n`;
379
- output += `**Last Seen**: ${new Date(issue.lastSeen).toISOString()}\n`;
380
- output += `**Occurrences**: ${issue.count}\n`;
381
- output += `**Users Impacted**: ${issue.userCount}\n`;
382
- output += `**Status**: ${issue.status}\n`;
383
- output += `**Platform**: ${issue.platform}\n`;
384
- output += `**Project**: ${issue.project.name}\n`;
385
- output += `**URL**: ${apiService.getIssueUrl(organizationSlug, issue.shortId)}\n`;
386
- output += "\n";
387
- output += "## Event Details\n\n";
388
- output += `**Event ID**: ${event.id}\n`;
389
- if (event.type === "error") output += `**Occurred At**: ${new Date(event.dateCreated).toISOString()}\n`;
390
- if (event.message) output += `**Message**:\n${event.message}\n`;
391
- output += "\n";
392
- output += formatEventOutput(event);
393
- if (autofixState) output += formatSeerContext(autofixState);
394
- output += "# Using this information\n\n";
395
- 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`;
396
- output += "- The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\n";
397
- return output;
398
- }
399
-
400
- //#endregion
401
- export { formatEventOutput, formatFrameHeader, formatIssueOutput };
402
- //# sourceMappingURL=formatting-DIvCVunN.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatting-DIvCVunN.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>[]","contexts: z.infer<typeof EventSchema>[\"contexts\"]","autofixState: AutofixRunState"],"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} from \"../api-client\";\nimport {\n getOutputForAutofixStep,\n getStatusDisplayName,\n isTerminalStatus,\n} from \"../tools/utils/seer-utils\";\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 += 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 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 Seer AI analysis context for inclusion in issue details.\n * Provides a minimal summary showing just the key solution when available.\n *\n * @param autofixState - The autofix state containing Seer analysis data\n * @returns Formatted markdown string with Seer context, or empty string if no analysis exists\n */\nfunction formatSeerContext(autofixState: AutofixRunState): string {\n if (!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 // For completed analyses, show just the key solution\n if (isTerminalStatus(autofix.status) && autofix.steps.length > 0) {\n const completedSteps = autofix.steps.filter(\n (step) => step.status === \"COMPLETED\",\n );\n\n // Find the solution step and show its description directly\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(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(firstParagraph.trim());\n }\n }\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 += formatSeerContext(autofixState);\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":";;;AA0BA,MAAMA,sBAA8C;CAClD,SAAS;CACT,OAAO;CACP,OAAO;CACP,QAAQ;CACR,OAAO;CACP,QA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ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { AssignedToSchema } from \"../../api-client/index\";\n\ntype AssignedTo = z.infer<typeof AssignedToSchema>;\n\n/**\n * Helper function to format assignedTo field for display\n */\nexport function formatAssignedTo(assignedTo: AssignedTo): string {\n if (!assignedTo) {\n return \"Unassigned\";\n }\n\n if (typeof assignedTo === \"string\") {\n return assignedTo;\n }\n\n if (typeof assignedTo === \"object\" && assignedTo.name) {\n return assignedTo.name;\n }\n\n return \"Unknown\";\n}\n"],"mappings":";;;;AAQA,SAAgB,iBAAiBA,YAAgC;AAC/D,MAAK,WACH,QAAO;AAGT,YAAW,eAAe,SACxB,QAAO;AAGT,YAAW,eAAe,YAAY,WAAW,KAC/C,QAAO,WAAW;AAGpB,QAAO;AACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatting-utils-DDz14xeB.cjs","names":["assignedTo: AssignedTo"],"sources":["../src/tools/utils/formatting-utils.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { AssignedToSchema } from \"../../api-client/index\";\n\ntype AssignedTo = z.infer<typeof AssignedToSchema>;\n\n/**\n * Helper function to format assignedTo field for display\n */\nexport function formatAssignedTo(assignedTo: AssignedTo): string {\n if (!assignedTo) {\n return \"Unassigned\";\n }\n\n if (typeof assignedTo === \"string\") {\n return assignedTo;\n }\n\n if (typeof assignedTo === \"object\" && assignedTo.name) {\n return assignedTo.name;\n }\n\n return \"Unknown\";\n}\n"],"mappings":";;;;;AAQA,SAAgB,iBAAiBA,YAAgC;AAC/D,MAAK,WACH,QAAO;AAGT,YAAW,eAAe,SACxB,QAAO;AAGT,YAAW,eAAe,YAAY,WAAW,KAC/C,QAAO,WAAW;AAGpB,QAAO;AACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-doc-BfMg0GIa.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 \"./utils/defineTool\";\nimport { fetchWithTimeout } from \"./utils/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 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,8BAAW;CACxB,MAAM;CACN,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,yBACP,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-DyqJe6TP.js","names":["context: ServerContext"],"sources":["../src/tools/get-doc.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { fetchWithTimeout } from \"./utils/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 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,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"}