@sentry/mcp-server 0.15.0 → 0.17.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 (612) hide show
  1. package/dist/agent-COgY789I.js +225 -0
  2. package/dist/agent-COgY789I.js.map +1 -0
  3. package/dist/agent-Cody_f0d.cjs +59 -0
  4. package/dist/agent-Cody_f0d.cjs.map +1 -0
  5. package/dist/agent-DZRRChrO.js +53 -0
  6. package/dist/agent-DZRRChrO.js.map +1 -0
  7. package/dist/agent-DpCCnhh5.cjs +231 -0
  8. package/dist/agent-DpCCnhh5.cjs.map +1 -0
  9. package/dist/agent-tools/discover-dataset-fields.cjs +6 -0
  10. package/dist/agent-tools/discover-dataset-fields.d.cts +59 -0
  11. package/dist/agent-tools/discover-dataset-fields.d.cts.map +1 -0
  12. package/dist/agent-tools/discover-dataset-fields.d.ts +59 -0
  13. package/dist/agent-tools/discover-dataset-fields.d.ts.map +1 -0
  14. package/dist/agent-tools/discover-dataset-fields.js +3 -0
  15. package/dist/agent-tools/lookup-otel-semantics.cjs +5 -0
  16. package/dist/agent-tools/lookup-otel-semantics.d.cts +38 -0
  17. package/dist/agent-tools/lookup-otel-semantics.d.cts.map +1 -0
  18. package/dist/agent-tools/lookup-otel-semantics.d.ts +38 -0
  19. package/dist/agent-tools/lookup-otel-semantics.d.ts.map +1 -0
  20. package/dist/agent-tools/lookup-otel-semantics.js +4 -0
  21. package/dist/agent-tools/whoami.cjs +4 -0
  22. package/dist/agent-tools/whoami.d.cts +28 -0
  23. package/dist/agent-tools/whoami.d.cts.map +1 -0
  24. package/dist/agent-tools/whoami.d.ts +28 -0
  25. package/dist/agent-tools/whoami.d.ts.map +1 -0
  26. package/dist/agent-tools/whoami.js +3 -0
  27. package/dist/{analyze-issue-with-seer-CoqsTklL.js → analyze-issue-with-seer-DcSwrWrs.js} +51 -11
  28. package/dist/analyze-issue-with-seer-DcSwrWrs.js.map +1 -0
  29. package/dist/{analyze-issue-with-seer-BkVrrh28.cjs → analyze-issue-with-seer-Dw9iqvSk.cjs} +51 -11
  30. package/dist/analyze-issue-with-seer-Dw9iqvSk.cjs.map +1 -0
  31. package/dist/api-client/client.cjs +4 -2
  32. package/dist/api-client/client.d.cts +3 -3
  33. package/dist/api-client/client.d.ts +3 -3
  34. package/dist/api-client/client.js +4 -2
  35. package/dist/api-client/index.cjs +6 -4
  36. package/dist/api-client/index.d.cts +3 -3
  37. package/dist/api-client/index.d.ts +4 -4
  38. package/dist/api-client/index.js +6 -4
  39. package/dist/api-client/schema.cjs +1 -1
  40. package/dist/api-client/schema.d.cts +1 -1
  41. package/dist/api-client/schema.d.ts +1 -1
  42. package/dist/api-client/schema.js +1 -1
  43. package/dist/api-client/types.cjs +1 -1
  44. package/dist/api-client/types.d.cts +2 -2
  45. package/dist/api-client/types.d.ts +2 -2
  46. package/dist/api-client/types.js +1 -1
  47. package/dist/api-utils-BlUSO8xh.js +68 -0
  48. package/dist/api-utils-BlUSO8xh.js.map +1 -0
  49. package/dist/api-utils-DFWUfQ83.cjs +85 -0
  50. package/dist/api-utils-DFWUfQ83.cjs.map +1 -0
  51. package/dist/{client-Dkw5iYu3.cjs → client-CPrEfAwa.cjs} +403 -58
  52. package/dist/client-CPrEfAwa.cjs.map +1 -0
  53. package/dist/{client-CQ9Xe1aN.d.cts → client-C_dDreKj.d.ts} +198 -11
  54. package/dist/client-C_dDreKj.d.ts.map +1 -0
  55. package/dist/{client-VCJp6Kcu.d.ts → client-CgS3tjJG.d.cts} +198 -11
  56. package/dist/client-CgS3tjJG.d.cts.map +1 -0
  57. package/dist/{client-DOYWNvVM.js → client-MaVV1gVC.js} +403 -58
  58. package/dist/client-MaVV1gVC.js.map +1 -0
  59. package/dist/config-BUmDxVLS.js +52 -0
  60. package/dist/config-BUmDxVLS.js.map +1 -0
  61. package/dist/config-BvtWiL3I.js +449 -0
  62. package/dist/config-BvtWiL3I.js.map +1 -0
  63. package/dist/config-CD-5FpOO.cjs +479 -0
  64. package/dist/config-CD-5FpOO.cjs.map +1 -0
  65. package/dist/config-FWsgDbm7.cjs +58 -0
  66. package/dist/config-FWsgDbm7.cjs.map +1 -0
  67. package/dist/{create-dsn-Dz8nyTFw.cjs → create-dsn-C6IPwoVO.cjs} +12 -10
  68. package/dist/create-dsn-C6IPwoVO.cjs.map +1 -0
  69. package/dist/{create-dsn-D530I7Lr.js → create-dsn-QDLdwhDO.js} +12 -10
  70. package/dist/create-dsn-QDLdwhDO.js.map +1 -0
  71. package/dist/{create-project-K1od5Rhx.js → create-project-Cax3fWey.js} +14 -11
  72. package/dist/create-project-Cax3fWey.js.map +1 -0
  73. package/dist/{create-project-BxzRiryg.cjs → create-project-DdSF58TR.cjs} +14 -11
  74. package/dist/create-project-DdSF58TR.cjs.map +1 -0
  75. package/dist/{create-team-CJhrccc1.cjs → create-team-CXaLcylp.cjs} +14 -5
  76. package/dist/{create-team-CJhrccc1.cjs.map → create-team-CXaLcylp.cjs.map} +1 -1
  77. package/dist/{create-team-zHz00C6Q.js → create-team-nm06goO5.js} +14 -5
  78. package/dist/{create-team-zHz00C6Q.js.map → create-team-nm06goO5.js.map} +1 -1
  79. package/dist/discover-dataset-fields-BEnyqPSq.js +156 -0
  80. package/dist/discover-dataset-fields-BEnyqPSq.js.map +1 -0
  81. package/dist/discover-dataset-fields-Cl7HpVkm.cjs +180 -0
  82. package/dist/discover-dataset-fields-Cl7HpVkm.cjs.map +1 -0
  83. package/dist/errors-BtJEw2Z-.cjs +38 -0
  84. package/dist/errors-BtJEw2Z-.cjs.map +1 -0
  85. package/dist/errors-D_R568zP.js +26 -0
  86. package/dist/errors-D_R568zP.js.map +1 -0
  87. package/dist/errors.cjs +2 -1
  88. package/dist/errors.d.cts +10 -2
  89. package/dist/errors.d.cts.map +1 -1
  90. package/dist/errors.d.ts +10 -2
  91. package/dist/errors.d.ts.map +1 -1
  92. package/dist/errors.js +2 -2
  93. package/dist/fetch-utils-CTLoW1R8.d.cts +33 -0
  94. package/dist/fetch-utils-CTLoW1R8.d.cts.map +1 -0
  95. package/dist/fetch-utils-C_Xj921x.js +52 -0
  96. package/dist/fetch-utils-C_Xj921x.js.map +1 -0
  97. package/dist/fetch-utils-DkcYwqBo.cjs +64 -0
  98. package/dist/fetch-utils-DkcYwqBo.cjs.map +1 -0
  99. package/dist/fetch-utils-JDZw4XaU.d.ts +33 -0
  100. package/dist/fetch-utils-JDZw4XaU.d.ts.map +1 -0
  101. package/dist/{find-dsns-BoEP0N7B.js → find-dsns-C3G5aBm1.js} +3 -3
  102. package/dist/{find-dsns-BoEP0N7B.js.map → find-dsns-C3G5aBm1.js.map} +1 -1
  103. package/dist/{find-dsns-CK59RaUJ.cjs → find-dsns-vQolGM7e.cjs} +3 -3
  104. package/dist/{find-dsns-CK59RaUJ.cjs.map → find-dsns-vQolGM7e.cjs.map} +1 -1
  105. package/dist/{find-organizations-BrdMfZRO.cjs → find-organizations-BDtHkcFV.cjs} +3 -3
  106. package/dist/find-organizations-BDtHkcFV.cjs.map +1 -0
  107. package/dist/{find-organizations-ojXwWWzk.js → find-organizations-Cs1GvZtJ.js} +3 -3
  108. package/dist/find-organizations-Cs1GvZtJ.js.map +1 -0
  109. package/dist/{find-projects-fcLG4KpT.js → find-projects-B0NdOjBO.js} +4 -4
  110. package/dist/{find-projects-fcLG4KpT.js.map → find-projects-B0NdOjBO.js.map} +1 -1
  111. package/dist/{find-projects-BZWhlYJh.cjs → find-projects-xM2L0U1W.cjs} +4 -4
  112. package/dist/{find-projects-BZWhlYJh.cjs.map → find-projects-xM2L0U1W.cjs.map} +1 -1
  113. package/dist/{find-releases-CZCVEOHZ.cjs → find-releases-BBTYr5Bx.cjs} +3 -3
  114. package/dist/{find-releases-CZCVEOHZ.cjs.map → find-releases-BBTYr5Bx.cjs.map} +1 -1
  115. package/dist/{find-releases-BUozr0Z-.js → find-releases-BO2OF_uR.js} +3 -3
  116. package/dist/{find-releases-BUozr0Z-.js.map → find-releases-BO2OF_uR.js.map} +1 -1
  117. package/dist/{find-teams-CnU5x9rQ.cjs → find-teams-B237Aq8U.cjs} +4 -4
  118. package/dist/{find-teams-CnU5x9rQ.cjs.map → find-teams-B237Aq8U.cjs.map} +1 -1
  119. package/dist/{find-teams-BZ118EIK.js → find-teams-CqUwp0EI.js} +4 -4
  120. package/dist/{find-teams-BZ118EIK.js.map → find-teams-CqUwp0EI.js.map} +1 -1
  121. package/dist/formatters-B3ONbRhI.js +79 -0
  122. package/dist/formatters-B3ONbRhI.js.map +1 -0
  123. package/dist/formatters-CfeBjhXZ.cjs +235 -0
  124. package/dist/formatters-CfeBjhXZ.cjs.map +1 -0
  125. package/dist/formatters-DSYXBiQx.js +217 -0
  126. package/dist/formatters-DSYXBiQx.js.map +1 -0
  127. package/dist/formatters-DbqofIoy.cjs +85 -0
  128. package/dist/formatters-DbqofIoy.cjs.map +1 -0
  129. package/dist/{formatting-CcTK2X8V.d.cts → formatting-BxyhA4G3.d.cts} +4 -4
  130. package/dist/formatting-BxyhA4G3.d.cts.map +1 -0
  131. package/dist/{formatting-D0Aki7rK.cjs → formatting-C180PVwd.cjs} +3 -3
  132. package/dist/formatting-C180PVwd.cjs.map +1 -0
  133. package/dist/{formatting-vtXxusbn.d.ts → formatting-C80LN9iK.d.ts} +4 -4
  134. package/dist/formatting-C80LN9iK.d.ts.map +1 -0
  135. package/dist/{formatting-Bvyded57.js → formatting-DIvCVunN.js} +3 -3
  136. package/dist/formatting-DIvCVunN.js.map +1 -0
  137. package/dist/{formatting-utils-DgOyTl-m.js → formatting-utils-C3sej5ER.js} +1 -1
  138. package/dist/{formatting-utils-DgOyTl-m.js.map → formatting-utils-C3sej5ER.js.map} +1 -1
  139. package/dist/{formatting-utils-m9R5bsRU.cjs → formatting-utils-DDz14xeB.cjs} +1 -1
  140. package/dist/{formatting-utils-m9R5bsRU.cjs.map → formatting-utils-DDz14xeB.cjs.map} +1 -1
  141. package/dist/{get-doc-DaTCenOE.cjs → get-doc-BfMg0GIa.cjs} +4 -4
  142. package/dist/{get-doc-DaTCenOE.cjs.map → get-doc-BfMg0GIa.cjs.map} +1 -1
  143. package/dist/{get-doc-YTiQznr1.js → get-doc-DyqJe6TP.js} +4 -4
  144. package/dist/{get-doc-YTiQznr1.js.map → get-doc-DyqJe6TP.js.map} +1 -1
  145. package/dist/{get-event-attachment-DVCPpUMj.js → get-event-attachment-B-ElqztF.js} +3 -3
  146. package/dist/{get-event-attachment-DVCPpUMj.js.map → get-event-attachment-B-ElqztF.js.map} +1 -1
  147. package/dist/{get-event-attachment-C-ig2-3F.cjs → get-event-attachment-o0oH43Tv.cjs} +3 -3
  148. package/dist/{get-event-attachment-C-ig2-3F.cjs.map → get-event-attachment-o0oH43Tv.cjs.map} +1 -1
  149. package/dist/{get-issue-details-lBrYR9yx.cjs → get-issue-details-CP_RyCpt.cjs} +27 -20
  150. package/dist/get-issue-details-CP_RyCpt.cjs.map +1 -0
  151. package/dist/{get-issue-details-Dcmzxknx.js → get-issue-details-CzroF7HR.js} +27 -20
  152. package/dist/get-issue-details-CzroF7HR.js.map +1 -0
  153. package/dist/handler-BGhr9FJM.d.cts +15 -0
  154. package/dist/handler-BGhr9FJM.d.cts.map +1 -0
  155. package/dist/handler-BH_OLIbD.cjs +152 -0
  156. package/dist/handler-BH_OLIbD.cjs.map +1 -0
  157. package/dist/handler-BPPTAi7I.d.ts +15 -0
  158. package/dist/handler-BPPTAi7I.d.ts.map +1 -0
  159. package/dist/handler-BZ3hKPb8.d.cts +15 -0
  160. package/dist/handler-BZ3hKPb8.d.cts.map +1 -0
  161. package/dist/handler-O9fYgC9a.cjs +114 -0
  162. package/dist/handler-O9fYgC9a.cjs.map +1 -0
  163. package/dist/handler-aE_8mEm7.js +146 -0
  164. package/dist/handler-aE_8mEm7.js.map +1 -0
  165. package/dist/handler-cUB6XcUV.d.ts +15 -0
  166. package/dist/handler-cUB6XcUV.d.ts.map +1 -0
  167. package/dist/handler-ykkULTZ-.js +108 -0
  168. package/dist/handler-ykkULTZ-.js.map +1 -0
  169. package/dist/index.cjs +54 -44
  170. package/dist/index.cjs.map +1 -1
  171. package/dist/index.js +54 -44
  172. package/dist/index.js.map +1 -1
  173. package/dist/internal/fetch-utils.cjs +3 -2
  174. package/dist/internal/fetch-utils.d.cts +2 -2
  175. package/dist/internal/fetch-utils.d.ts +2 -2
  176. package/dist/internal/fetch-utils.js +2 -2
  177. package/dist/internal/formatting.cjs +2 -2
  178. package/dist/internal/formatting.d.cts +4 -4
  179. package/dist/internal/formatting.d.ts +5 -5
  180. package/dist/internal/formatting.js +2 -2
  181. package/dist/internal/issue-helpers.cjs +2 -1
  182. package/dist/internal/issue-helpers.d.ts +1 -1
  183. package/dist/internal/issue-helpers.js +2 -1
  184. package/dist/internal/test-fixtures.d.cts +164 -164
  185. package/dist/internal/test-fixtures.d.cts.map +1 -1
  186. package/dist/internal/test-fixtures.d.ts +38 -38
  187. package/dist/internal/test-fixtures.d.ts.map +1 -1
  188. package/dist/{issue-helpers-CqqYnwYE.js → issue-helpers-CRx45FYG.js} +15 -19
  189. package/dist/issue-helpers-CRx45FYG.js.map +1 -0
  190. package/dist/issue-helpers-Cz01Ipvl.d.cts.map +1 -1
  191. package/dist/{issue-helpers-BJffpNoO.d.ts → issue-helpers-D1_Uqr-F.d.ts} +1 -1
  192. package/dist/issue-helpers-D1_Uqr-F.d.ts.map +1 -0
  193. package/dist/{issue-helpers-DyAIO0w6.cjs → issue-helpers-s5fKLwJZ.cjs} +14 -19
  194. package/dist/issue-helpers-s5fKLwJZ.cjs.map +1 -0
  195. package/dist/{logging-CX2buXiG.cjs → logging-BpL53bY6.cjs} +1 -1
  196. package/dist/{logging-CX2buXiG.cjs.map → logging-BpL53bY6.cjs.map} +1 -1
  197. package/dist/{logging-DzxYBMrn.js → logging-tGU_SYcA.js} +1 -1
  198. package/dist/{logging-DzxYBMrn.js.map → logging-tGU_SYcA.js.map} +1 -1
  199. package/dist/logging.cjs +1 -1
  200. package/dist/logging.js +1 -1
  201. package/dist/lookup-otel-semantics-BbriXZAx.cjs +5088 -0
  202. package/dist/lookup-otel-semantics-BbriXZAx.cjs.map +1 -0
  203. package/dist/lookup-otel-semantics-Dt667kdR.js +5076 -0
  204. package/dist/lookup-otel-semantics-Dt667kdR.js.map +1 -0
  205. package/dist/{promptDefinitions-C29BWGYg.cjs → promptDefinitions-5V4-M69A.cjs} +2 -2
  206. package/dist/{promptDefinitions-C29BWGYg.cjs.map → promptDefinitions-5V4-M69A.cjs.map} +1 -1
  207. package/dist/{promptDefinitions-D3GTBGLr.d.ts → promptDefinitions-DehpwJfn.d.ts} +1 -1
  208. package/dist/promptDefinitions-DehpwJfn.d.ts.map +1 -0
  209. package/dist/{promptDefinitions-CSKE8T0a.js → promptDefinitions-DyshsF51.js} +2 -2
  210. package/dist/{promptDefinitions-CSKE8T0a.js.map → promptDefinitions-DyshsF51.js.map} +1 -1
  211. package/dist/promptDefinitions.cjs +2 -2
  212. package/dist/promptDefinitions.d.ts +1 -1
  213. package/dist/promptDefinitions.js +2 -2
  214. package/dist/{prompts-Df3i1XSB.cjs → prompts-BTtNbKQR.cjs} +7 -5
  215. package/dist/prompts-BTtNbKQR.cjs.map +1 -0
  216. package/dist/{prompts-C8Y9w5c4.js → prompts-CYcvIxWR.js} +7 -5
  217. package/dist/prompts-CYcvIxWR.js.map +1 -0
  218. package/dist/prompts.cjs +2 -2
  219. package/dist/prompts.d.cts +1 -1
  220. package/dist/prompts.d.cts.map +1 -1
  221. package/dist/prompts.d.ts +2 -2
  222. package/dist/prompts.d.ts.map +1 -1
  223. package/dist/prompts.js +2 -2
  224. package/dist/resources-CSxBC9gs.js +60 -0
  225. package/dist/resources-CSxBC9gs.js.map +1 -0
  226. package/dist/resources-TCvijqOA.cjs +72 -0
  227. package/dist/resources-TCvijqOA.cjs.map +1 -0
  228. package/dist/resources.cjs +2 -2
  229. package/dist/resources.d.cts.map +1 -1
  230. package/dist/resources.d.ts.map +1 -1
  231. package/dist/resources.js +2 -2
  232. package/dist/{schema-3NeMWRAm.d.cts → schema-BlkWypl3.d.ts} +155 -155
  233. package/dist/schema-BlkWypl3.d.ts.map +1 -0
  234. package/dist/{schema-DtsnsxMl.js → schema-Bv2fvxgy.js} +2 -2
  235. package/dist/{schema-DtsnsxMl.js.map → schema-Bv2fvxgy.js.map} +1 -1
  236. package/dist/{schema-B_cMyyJJ.cjs → schema-C0LznFvu.cjs} +4 -4
  237. package/dist/schema-C0LznFvu.cjs.map +1 -0
  238. package/dist/{schema-WDk5Yqww.js → schema-CcFmBoEf.js} +4 -4
  239. package/dist/schema-CcFmBoEf.js.map +1 -0
  240. package/dist/{schema-B3CzDGJk.d.ts → schema-CdDcpvrp.d.cts} +375 -375
  241. package/dist/schema-CdDcpvrp.d.cts.map +1 -0
  242. package/dist/{schema-BpJVmev8.cjs → schema-DPL_hZXP.cjs} +2 -2
  243. package/dist/{schema-BpJVmev8.cjs.map → schema-DPL_hZXP.cjs.map} +1 -1
  244. package/dist/schema.cjs +1 -1
  245. package/dist/schema.js +1 -1
  246. package/dist/{search-docs-D5Foht_0.cjs → search-docs-CjIZDaD1.cjs} +4 -4
  247. package/dist/{search-docs-D5Foht_0.cjs.map → search-docs-CjIZDaD1.cjs.map} +1 -1
  248. package/dist/{search-docs-BLbB_GV2.js → search-docs-ss09Dt0F.js} +4 -4
  249. package/dist/{search-docs-BLbB_GV2.js.map → search-docs-ss09Dt0F.js.map} +1 -1
  250. package/dist/search-issues-BFgCvRYe.js +0 -0
  251. package/dist/search-issues-Biu64RkQ.cjs +0 -0
  252. package/dist/{seer-utils-CDm5J8ur.cjs → seer-utils-C7Kv0gr8.cjs} +15 -1
  253. package/dist/seer-utils-C7Kv0gr8.cjs.map +1 -0
  254. package/dist/{seer-utils-Cj9DXrow.js → seer-utils-NPHv8KYY.js} +4 -2
  255. package/dist/seer-utils-NPHv8KYY.js.map +1 -0
  256. package/dist/{server-BSRxzYFd.js → server-D78x_7Vz.js} +80 -26
  257. package/dist/server-D78x_7Vz.js.map +1 -0
  258. package/dist/{server-Dgkqz8bA.cjs → server-DYFiTMLB.cjs} +80 -26
  259. package/dist/server-DYFiTMLB.cjs.map +1 -0
  260. package/dist/server.cjs +52 -40
  261. package/dist/server.d.cts +4 -2
  262. package/dist/server.d.cts.map +1 -1
  263. package/dist/server.d.ts +5 -3
  264. package/dist/server.d.ts.map +1 -1
  265. package/dist/server.js +52 -40
  266. package/dist/{stdio-BQAm0Liz.cjs → stdio-Be01KQkA.cjs} +3 -3
  267. package/dist/{stdio-BQAm0Liz.cjs.map → stdio-Be01KQkA.cjs.map} +1 -1
  268. package/dist/{stdio-BcihaDjO.js → stdio-CDb2NHHD.js} +3 -3
  269. package/dist/{stdio-BcihaDjO.js.map → stdio-CDb2NHHD.js.map} +1 -1
  270. package/dist/test-setup.cjs +371 -0
  271. package/dist/test-setup.cjs.map +1 -1
  272. package/dist/test-setup.js +371 -0
  273. package/dist/test-setup.js.map +1 -1
  274. package/dist/toolDefinitions.cjs +184 -0
  275. package/dist/toolDefinitions.cjs.map +1 -0
  276. package/dist/toolDefinitions.d.cts +13 -0
  277. package/dist/toolDefinitions.d.cts.map +1 -0
  278. package/dist/toolDefinitions.d.ts +8 -20
  279. package/dist/toolDefinitions.d.ts.map +1 -0
  280. package/dist/toolDefinitions.js +183 -1059
  281. package/dist/toolDefinitions.js.map +1 -0
  282. package/dist/tools/analyze-issue-with-seer.cjs +14 -12
  283. package/dist/tools/analyze-issue-with-seer.d.cts +2 -2
  284. package/dist/tools/analyze-issue-with-seer.d.ts +3 -3
  285. package/dist/tools/analyze-issue-with-seer.js +14 -12
  286. package/dist/tools/create-dsn.cjs +9 -8
  287. package/dist/tools/create-dsn.d.cts +2 -2
  288. package/dist/tools/create-dsn.d.ts +3 -3
  289. package/dist/tools/create-dsn.js +9 -8
  290. package/dist/tools/create-project.cjs +10 -9
  291. package/dist/tools/create-project.d.cts +2 -2
  292. package/dist/tools/create-project.d.ts +3 -3
  293. package/dist/tools/create-project.js +10 -9
  294. package/dist/tools/create-team.cjs +9 -8
  295. package/dist/tools/create-team.d.cts +2 -2
  296. package/dist/tools/create-team.d.ts +3 -3
  297. package/dist/tools/create-team.js +9 -8
  298. package/dist/tools/find-dsns.cjs +9 -8
  299. package/dist/tools/find-dsns.d.cts +2 -2
  300. package/dist/tools/find-dsns.d.ts +3 -3
  301. package/dist/tools/find-dsns.js +9 -8
  302. package/dist/tools/find-organizations.cjs +8 -7
  303. package/dist/tools/find-organizations.d.cts +2 -2
  304. package/dist/tools/find-organizations.d.ts +3 -3
  305. package/dist/tools/find-organizations.js +8 -7
  306. package/dist/tools/find-projects.cjs +9 -8
  307. package/dist/tools/find-projects.d.cts +2 -2
  308. package/dist/tools/find-projects.d.ts +3 -3
  309. package/dist/tools/find-projects.js +9 -8
  310. package/dist/tools/find-releases.cjs +9 -8
  311. package/dist/tools/find-releases.d.cts +2 -2
  312. package/dist/tools/find-releases.d.ts +3 -3
  313. package/dist/tools/find-releases.js +9 -8
  314. package/dist/tools/find-teams.cjs +9 -8
  315. package/dist/tools/find-teams.d.cts +2 -2
  316. package/dist/tools/find-teams.d.ts +3 -3
  317. package/dist/tools/find-teams.js +9 -8
  318. package/dist/tools/get-doc.cjs +9 -8
  319. package/dist/tools/get-doc.d.cts +2 -2
  320. package/dist/tools/get-doc.d.ts +3 -3
  321. package/dist/tools/get-doc.js +9 -8
  322. package/dist/tools/get-event-attachment.cjs +9 -8
  323. package/dist/tools/get-event-attachment.d.cts +2 -2
  324. package/dist/tools/get-event-attachment.d.ts +3 -3
  325. package/dist/tools/get-event-attachment.js +9 -8
  326. package/dist/tools/get-issue-details.cjs +13 -12
  327. package/dist/tools/get-issue-details.d.cts +2 -2
  328. package/dist/tools/get-issue-details.d.ts +3 -3
  329. package/dist/tools/get-issue-details.js +13 -12
  330. package/dist/tools/index.cjs +47 -36
  331. package/dist/tools/index.d.cts +74 -86
  332. package/dist/tools/index.d.cts.map +1 -1
  333. package/dist/tools/index.d.ts +15 -27
  334. package/dist/tools/index.d.ts.map +1 -1
  335. package/dist/tools/index.js +47 -36
  336. package/dist/tools/search-docs.cjs +10 -8
  337. package/dist/tools/search-docs.d.cts +2 -2
  338. package/dist/tools/search-docs.d.ts +3 -3
  339. package/dist/tools/search-docs.js +10 -8
  340. package/dist/tools/search-events/agent.cjs +8 -0
  341. package/dist/tools/search-events/agent.d.cts +43 -0
  342. package/dist/tools/search-events/agent.d.cts.map +1 -0
  343. package/dist/tools/search-events/agent.d.ts +43 -0
  344. package/dist/tools/search-events/agent.d.ts.map +1 -0
  345. package/dist/tools/search-events/agent.js +8 -0
  346. package/dist/tools/search-events/config.cjs +7 -0
  347. package/dist/tools/search-events/config.d.cts +131 -0
  348. package/dist/tools/search-events/config.d.cts.map +1 -0
  349. package/dist/tools/search-events/config.d.ts +131 -0
  350. package/dist/tools/search-events/config.d.ts.map +1 -0
  351. package/dist/tools/search-events/config.js +3 -0
  352. package/dist/tools/search-events/formatters.cjs +8 -0
  353. package/dist/tools/search-events/formatters.d.cts +32 -0
  354. package/dist/tools/search-events/formatters.d.cts.map +1 -0
  355. package/dist/tools/search-events/formatters.d.ts +32 -0
  356. package/dist/tools/search-events/formatters.d.ts.map +1 -0
  357. package/dist/tools/search-events/formatters.js +6 -0
  358. package/dist/tools/search-events/handler.cjs +20 -0
  359. package/dist/tools/search-events/handler.d.cts +5 -0
  360. package/dist/tools/search-events/handler.d.ts +5 -0
  361. package/dist/tools/search-events/handler.js +20 -0
  362. package/dist/tools/search-events/index.cjs +21 -0
  363. package/dist/tools/search-events/index.d.cts +5 -0
  364. package/dist/tools/search-events/index.d.ts +5 -0
  365. package/dist/tools/search-events/index.js +21 -0
  366. package/dist/tools/search-events/utils.cjs +9 -0
  367. package/dist/tools/search-events/utils.d.cts +6 -0
  368. package/dist/tools/search-events/utils.d.ts +6 -0
  369. package/dist/tools/search-events/utils.js +5 -0
  370. package/dist/tools/search-issues/agent.cjs +7 -0
  371. package/dist/tools/search-issues/agent.d.cts +33 -0
  372. package/dist/tools/search-issues/agent.d.cts.map +1 -0
  373. package/dist/tools/search-issues/agent.d.ts +33 -0
  374. package/dist/tools/search-issues/agent.d.ts.map +1 -0
  375. package/dist/tools/search-issues/agent.js +7 -0
  376. package/dist/tools/search-issues/config.cjs +3 -0
  377. package/dist/tools/search-issues/config.d.cts +9 -0
  378. package/dist/tools/search-issues/config.d.cts.map +1 -0
  379. package/dist/tools/search-issues/config.d.ts +9 -0
  380. package/dist/tools/search-issues/config.d.ts.map +1 -0
  381. package/dist/tools/search-issues/config.js +3 -0
  382. package/dist/tools/search-issues/formatters.cjs +4 -0
  383. package/dist/tools/search-issues/formatters.d.cts +15 -0
  384. package/dist/tools/search-issues/formatters.d.cts.map +1 -0
  385. package/dist/tools/search-issues/formatters.d.ts +15 -0
  386. package/dist/tools/search-issues/formatters.d.ts.map +1 -0
  387. package/dist/tools/search-issues/formatters.js +4 -0
  388. package/dist/tools/search-issues/handler.cjs +18 -0
  389. package/dist/tools/search-issues/handler.d.cts +5 -0
  390. package/dist/tools/search-issues/handler.d.ts +5 -0
  391. package/dist/tools/search-issues/handler.js +18 -0
  392. package/dist/tools/search-issues/index.cjs +19 -0
  393. package/dist/tools/search-issues/index.d.cts +5 -0
  394. package/dist/tools/search-issues/index.d.ts +5 -0
  395. package/dist/tools/search-issues/index.js +19 -0
  396. package/dist/tools/types.d.cts +2 -2
  397. package/dist/tools/types.d.ts +3 -3
  398. package/dist/tools/update-issue.cjs +14 -13
  399. package/dist/tools/update-issue.d.cts +2 -2
  400. package/dist/tools/update-issue.d.ts +3 -3
  401. package/dist/tools/update-issue.js +14 -13
  402. package/dist/tools/update-project.cjs +10 -9
  403. package/dist/tools/update-project.d.cts +2 -2
  404. package/dist/tools/update-project.d.ts +3 -3
  405. package/dist/tools/update-project.js +10 -9
  406. package/dist/tools/utils/api-utils.cjs +10 -7
  407. package/dist/tools/utils/api-utils.d.cts +23 -6
  408. package/dist/tools/utils/api-utils.d.cts.map +1 -1
  409. package/dist/tools/utils/api-utils.d.ts +25 -8
  410. package/dist/tools/utils/api-utils.d.ts.map +1 -1
  411. package/dist/tools/utils/api-utils.js +8 -7
  412. package/dist/tools/utils/defineTool.d.cts +2 -2
  413. package/dist/tools/utils/defineTool.d.ts +3 -3
  414. package/dist/tools/utils/fetch-utils.cjs +4 -3
  415. package/dist/tools/utils/fetch-utils.d.cts +2 -2
  416. package/dist/tools/utils/fetch-utils.d.ts +2 -2
  417. package/dist/tools/utils/fetch-utils.js +3 -3
  418. package/dist/tools/utils/formatting-utils.cjs +1 -1
  419. package/dist/tools/utils/formatting-utils.d.cts +3 -3
  420. package/dist/tools/utils/formatting-utils.d.ts +4 -4
  421. package/dist/tools/utils/formatting-utils.js +1 -1
  422. package/dist/tools/utils/issue-utils.cjs +5 -4
  423. package/dist/tools/utils/issue-utils.d.cts +4 -4
  424. package/dist/tools/utils/issue-utils.d.ts +6 -6
  425. package/dist/tools/utils/issue-utils.js +5 -4
  426. package/dist/tools/utils/seer-utils.cjs +3 -1
  427. package/dist/tools/utils/seer-utils.d.cts +6 -4
  428. package/dist/tools/utils/seer-utils.d.cts.map +1 -1
  429. package/dist/tools/utils/seer-utils.d.ts +7 -5
  430. package/dist/tools/utils/seer-utils.d.ts.map +1 -1
  431. package/dist/tools/utils/seer-utils.js +2 -2
  432. package/dist/tools/whoami.cjs +8 -7
  433. package/dist/tools/whoami.d.cts +2 -2
  434. package/dist/tools/whoami.d.ts +3 -3
  435. package/dist/tools/whoami.js +8 -7
  436. package/dist/tools-DvKm5uMs.js +44 -0
  437. package/dist/tools-DvKm5uMs.js.map +1 -0
  438. package/dist/tools-sQ2wM3Pi.cjs +49 -0
  439. package/dist/tools-sQ2wM3Pi.cjs.map +1 -0
  440. package/dist/transports/stdio.cjs +53 -42
  441. package/dist/transports/stdio.d.cts +1 -1
  442. package/dist/transports/stdio.d.ts +2 -2
  443. package/dist/transports/stdio.js +53 -42
  444. package/dist/types-6zHoEWAx.js +0 -0
  445. package/dist/{types-DpV1JAZj.d.ts → types-B-8S69No.d.ts} +2 -2
  446. package/dist/{types-DpV1JAZj.d.ts.map → types-B-8S69No.d.ts.map} +1 -1
  447. package/dist/{types-qB8a4WQT.d.ts → types-BOcoP3Na.d.ts} +2 -2
  448. package/dist/{types-qB8a4WQT.d.ts.map → types-BOcoP3Na.d.ts.map} +1 -1
  449. package/dist/{types-CUN-2OSS.d.cts → types-BV-G5sBp.d.cts} +4 -2
  450. package/dist/{types-CUN-2OSS.d.cts.map → types-BV-G5sBp.d.cts.map} +1 -1
  451. package/dist/{types-BoMP-Ro6.d.cts → types-BYtO24VE.d.cts} +2 -2
  452. package/dist/{types-BoMP-Ro6.d.cts.map → types-BYtO24VE.d.cts.map} +1 -1
  453. package/dist/{types-DkJtNDXU.d.ts → types-C1Fih0eQ.d.ts} +5 -3
  454. package/dist/{types-DkJtNDXU.d.ts.map → types-C1Fih0eQ.d.ts.map} +1 -1
  455. package/dist/types-DdloOYgD.cjs +0 -0
  456. package/dist/{types-D_mx318Q.d.cts → types-aOEJ0KgQ.d.cts} +2 -2
  457. package/dist/{types-D_mx318Q.d.cts.map → types-aOEJ0KgQ.d.cts.map} +1 -1
  458. package/dist/types.d.cts +1 -1
  459. package/dist/types.d.ts +2 -2
  460. package/dist/{update-issue-DpkxxiNk.cjs → update-issue-D77PudUi.cjs} +20 -13
  461. package/dist/update-issue-D77PudUi.cjs.map +1 -0
  462. package/dist/{update-issue-DRTQvy6p.js → update-issue-ndy2PF5G.js} +20 -13
  463. package/dist/update-issue-ndy2PF5G.js.map +1 -0
  464. package/dist/{update-project-YLxt2ry2.js → update-project-Bxsi-BG_.js} +5 -5
  465. package/dist/{update-project-YLxt2ry2.js.map → update-project-Bxsi-BG_.js.map} +1 -1
  466. package/dist/{update-project-DLDDbcGY.cjs → update-project-DqECtbDA.cjs} +5 -5
  467. package/dist/{update-project-DLDDbcGY.cjs.map → update-project-DqECtbDA.cjs.map} +1 -1
  468. package/dist/url-utils-IqgSmI-B.js +152 -0
  469. package/dist/url-utils-IqgSmI-B.js.map +1 -0
  470. package/dist/url-utils-vJo2ER5v.cjs +206 -0
  471. package/dist/url-utils-vJo2ER5v.cjs.map +1 -0
  472. package/dist/utils/url-utils.cjs +6 -1
  473. package/dist/utils/url-utils.d.cts +43 -1
  474. package/dist/utils/url-utils.d.cts.map +1 -1
  475. package/dist/utils/url-utils.d.ts +43 -1
  476. package/dist/utils/url-utils.d.ts.map +1 -1
  477. package/dist/utils/url-utils.js +2 -2
  478. package/dist/utils-BwXbSgEI.d.ts +35 -0
  479. package/dist/utils-BwXbSgEI.d.ts.map +1 -0
  480. package/dist/utils-CqbeJfE1.cjs +138 -0
  481. package/dist/utils-CqbeJfE1.cjs.map +1 -0
  482. package/dist/utils-CtBGHj_N.d.cts +35 -0
  483. package/dist/utils-CtBGHj_N.d.cts.map +1 -0
  484. package/dist/utils-OgYE-imr.js +108 -0
  485. package/dist/utils-OgYE-imr.js.map +1 -0
  486. package/dist/version-Bj68uyCt.js +6 -0
  487. package/dist/{version-CcTnFB56.js.map → version-Bj68uyCt.js.map} +1 -1
  488. package/dist/{version-rDjaSkPw.cjs → version-CMS1IOUV.cjs} +2 -2
  489. package/dist/{version-rDjaSkPw.cjs.map → version-CMS1IOUV.cjs.map} +1 -1
  490. package/dist/version.cjs +1 -1
  491. package/dist/version.js +1 -1
  492. package/dist/{whoami-CEgbTUqt.cjs → whoami-BOJHfdih.cjs} +2 -2
  493. package/dist/{whoami-CEgbTUqt.cjs.map → whoami-BOJHfdih.cjs.map} +1 -1
  494. package/dist/{whoami-DesNZnaQ.js → whoami-Bswhb72a.js} +2 -2
  495. package/dist/{whoami-DesNZnaQ.js.map → whoami-Bswhb72a.js.map} +1 -1
  496. package/dist/whoami-CoZJKpys.cjs +44 -0
  497. package/dist/whoami-CoZJKpys.cjs.map +1 -0
  498. package/dist/whoami-xBAWvzG4.js +32 -0
  499. package/dist/whoami-xBAWvzG4.js.map +1 -0
  500. package/package.json +14 -7
  501. package/dist/analyze-issue-with-seer-BkVrrh28.cjs.map +0 -1
  502. package/dist/analyze-issue-with-seer-CoqsTklL.js.map +0 -1
  503. package/dist/api-utils-C6QJAzFL.js +0 -31
  504. package/dist/api-utils-C6QJAzFL.js.map +0 -1
  505. package/dist/api-utils-d36iteNO.cjs +0 -36
  506. package/dist/api-utils-d36iteNO.cjs.map +0 -1
  507. package/dist/client-CQ9Xe1aN.d.cts.map +0 -1
  508. package/dist/client-DOYWNvVM.js.map +0 -1
  509. package/dist/client-Dkw5iYu3.cjs.map +0 -1
  510. package/dist/client-VCJp6Kcu.d.ts.map +0 -1
  511. package/dist/create-dsn-D530I7Lr.js.map +0 -1
  512. package/dist/create-dsn-Dz8nyTFw.cjs.map +0 -1
  513. package/dist/create-project-BxzRiryg.cjs.map +0 -1
  514. package/dist/create-project-K1od5Rhx.js.map +0 -1
  515. package/dist/errors-CIoxzIug.js +0 -15
  516. package/dist/errors-CIoxzIug.js.map +0 -1
  517. package/dist/errors-YmiXLOyx.cjs +0 -21
  518. package/dist/errors-YmiXLOyx.cjs.map +0 -1
  519. package/dist/fetch-utils-BMKjO-cc.js +0 -29
  520. package/dist/fetch-utils-BMKjO-cc.js.map +0 -1
  521. package/dist/fetch-utils-Bv9WjUp0.d.ts +0 -14
  522. package/dist/fetch-utils-Bv9WjUp0.d.ts.map +0 -1
  523. package/dist/fetch-utils-DzdRW4Yd.d.cts +0 -14
  524. package/dist/fetch-utils-DzdRW4Yd.d.cts.map +0 -1
  525. package/dist/fetch-utils-oab6uNp3.cjs +0 -35
  526. package/dist/fetch-utils-oab6uNp3.cjs.map +0 -1
  527. package/dist/find-errors-C3oUMeRi.js +0 -91
  528. package/dist/find-errors-C3oUMeRi.js.map +0 -1
  529. package/dist/find-errors-CB9NpSxG.cjs +0 -97
  530. package/dist/find-errors-CB9NpSxG.cjs.map +0 -1
  531. package/dist/find-issues-C3uk59rn.cjs +0 -98
  532. package/dist/find-issues-C3uk59rn.cjs.map +0 -1
  533. package/dist/find-issues-CAtNGBly.js +0 -92
  534. package/dist/find-issues-CAtNGBly.js.map +0 -1
  535. package/dist/find-organizations-BrdMfZRO.cjs.map +0 -1
  536. package/dist/find-organizations-ojXwWWzk.js.map +0 -1
  537. package/dist/find-tags-Byk4d3oZ.cjs +0 -45
  538. package/dist/find-tags-Byk4d3oZ.cjs.map +0 -1
  539. package/dist/find-tags-d-wF1Se8.js +0 -39
  540. package/dist/find-tags-d-wF1Se8.js.map +0 -1
  541. package/dist/find-transactions-BiBgg-AE.js +0 -83
  542. package/dist/find-transactions-BiBgg-AE.js.map +0 -1
  543. package/dist/find-transactions-DuZyqjhF.cjs +0 -89
  544. package/dist/find-transactions-DuZyqjhF.cjs.map +0 -1
  545. package/dist/formatting-Bvyded57.js.map +0 -1
  546. package/dist/formatting-CcTK2X8V.d.cts.map +0 -1
  547. package/dist/formatting-D0Aki7rK.cjs.map +0 -1
  548. package/dist/formatting-vtXxusbn.d.ts.map +0 -1
  549. package/dist/get-issue-details-Dcmzxknx.js.map +0 -1
  550. package/dist/get-issue-details-lBrYR9yx.cjs.map +0 -1
  551. package/dist/issue-helpers-BJffpNoO.d.ts.map +0 -1
  552. package/dist/issue-helpers-CqqYnwYE.js.map +0 -1
  553. package/dist/issue-helpers-DyAIO0w6.cjs.map +0 -1
  554. package/dist/promptDefinitions-D3GTBGLr.d.ts.map +0 -1
  555. package/dist/prompts-C8Y9w5c4.js.map +0 -1
  556. package/dist/prompts-Df3i1XSB.cjs.map +0 -1
  557. package/dist/resources-BHF8a1ZB.js +0 -92
  558. package/dist/resources-BHF8a1ZB.js.map +0 -1
  559. package/dist/resources-BM_YQGcb.cjs +0 -104
  560. package/dist/resources-BM_YQGcb.cjs.map +0 -1
  561. package/dist/schema-3NeMWRAm.d.cts.map +0 -1
  562. package/dist/schema-B3CzDGJk.d.ts.map +0 -1
  563. package/dist/schema-B_cMyyJJ.cjs.map +0 -1
  564. package/dist/schema-WDk5Yqww.js.map +0 -1
  565. package/dist/seer-utils-CDm5J8ur.cjs.map +0 -1
  566. package/dist/seer-utils-Cj9DXrow.js.map +0 -1
  567. package/dist/server-BSRxzYFd.js.map +0 -1
  568. package/dist/server-Dgkqz8bA.cjs.map +0 -1
  569. package/dist/tools/find-errors.cjs +0 -12
  570. package/dist/tools/find-errors.d.cts +0 -18
  571. package/dist/tools/find-errors.d.cts.map +0 -1
  572. package/dist/tools/find-errors.d.ts +0 -18
  573. package/dist/tools/find-errors.d.ts.map +0 -1
  574. package/dist/tools/find-errors.js +0 -12
  575. package/dist/tools/find-issues.cjs +0 -12
  576. package/dist/tools/find-issues.d.cts +0 -16
  577. package/dist/tools/find-issues.d.cts.map +0 -1
  578. package/dist/tools/find-issues.d.ts +0 -16
  579. package/dist/tools/find-issues.d.ts.map +0 -1
  580. package/dist/tools/find-issues.js +0 -12
  581. package/dist/tools/find-tags.cjs +0 -12
  582. package/dist/tools/find-tags.d.cts +0 -13
  583. package/dist/tools/find-tags.d.cts.map +0 -1
  584. package/dist/tools/find-tags.d.ts +0 -13
  585. package/dist/tools/find-tags.d.ts.map +0 -1
  586. package/dist/tools/find-tags.js +0 -12
  587. package/dist/tools/find-transactions.cjs +0 -12
  588. package/dist/tools/find-transactions.d.cts +0 -17
  589. package/dist/tools/find-transactions.d.cts.map +0 -1
  590. package/dist/tools/find-transactions.d.ts +0 -17
  591. package/dist/tools/find-transactions.d.ts.map +0 -1
  592. package/dist/tools/find-transactions.js +0 -12
  593. package/dist/tools-CHnZvVEN.cjs +0 -53
  594. package/dist/tools-CHnZvVEN.cjs.map +0 -1
  595. package/dist/tools-CdXGgq1W.js +0 -48
  596. package/dist/tools-CdXGgq1W.js.map +0 -1
  597. package/dist/update-issue-DRTQvy6p.js.map +0 -1
  598. package/dist/update-issue-DpkxxiNk.cjs.map +0 -1
  599. package/dist/url-utils-C9hykWmk.cjs +0 -106
  600. package/dist/url-utils-C9hykWmk.cjs.map +0 -1
  601. package/dist/url-utils-DvZYfzPM.js +0 -82
  602. package/dist/url-utils-DvZYfzPM.js.map +0 -1
  603. package/dist/version-CcTnFB56.js +0 -6
  604. /package/dist/{api-client-CL1WDkw9.cjs → api-client-BWt6M7ij.cjs} +0 -0
  605. /package/dist/{api-client-ChL_0F2u.js → api-client-CNv_hbPO.js} +0 -0
  606. /package/dist/{fetch-utils-C0F4eH6S.cjs → fetch-utils-BqMx2KQr.js} +0 -0
  607. /package/dist/{fetch-utils-DlPjrSk2.js → fetch-utils-DeZcERfe.cjs} +0 -0
  608. /package/dist/{index-DVGDAddE.d.ts → index-DE1muTvw.d.ts} +0 -0
  609. /package/dist/{issue-utils-BbCfbiY8.js → issue-utils-BVAB6I-Z.js} +0 -0
  610. /package/dist/{issue-utils-DMKiif6C.cjs → issue-utils-pdbo-5LW.cjs} +0 -0
  611. /package/dist/{types-CCHsZshF.js → search-events-BBFPuvRq.cjs} +0 -0
  612. /package/dist/{types-MYBaygjr.cjs → search-events-bV3-kK78.js} +0 -0
@@ -1,83 +0,0 @@
1
- import { defineTool } from "./defineTool-77H4nSna.js";
2
- import { apiServiceFromContext } from "./api-utils-C6QJAzFL.js";
3
- import { ParamOrganizationSlug, ParamProjectSlugOrAll, ParamQuery, ParamRegionUrl, ParamTransaction } from "./schema-DtsnsxMl.js";
4
- import { z } from "zod";
5
- import { setTag } from "@sentry/core";
6
-
7
- //#region src/tools/find-transactions.ts
8
- var find_transactions_default = defineTool({
9
- name: "find_transactions",
10
- description: [
11
- "Find transactions in Sentry using advanced search syntax.",
12
- "",
13
- "Transactions are segments of traces that are associated with a specific route or endpoint.",
14
- "",
15
- "Use this tool when you need to:",
16
- "- Search for production transaction data to understand performance.",
17
- "- Analyze traces and latency patterns.",
18
- "- Find examples of recent requests to endpoints.",
19
- "",
20
- "<examples>",
21
- "### Find slow requests to a route",
22
- "",
23
- "...",
24
- "",
25
- "```",
26
- "find_transactions(organizationSlug='my-organization', transaction='/checkout', sortBy='duration')",
27
- "```",
28
- "",
29
- "</examples>",
30
- "",
31
- "<hints>",
32
- "- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.",
33
- "- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `find_organizations()` first.",
34
- "- You can use the `find_tags()` tool to see what user-defined tags are available.",
35
- "</hints>"
36
- ].join("\n"),
37
- inputSchema: {
38
- organizationSlug: ParamOrganizationSlug,
39
- regionUrl: ParamRegionUrl.optional(),
40
- projectSlug: ParamProjectSlugOrAll.optional(),
41
- transaction: ParamTransaction.optional(),
42
- query: ParamQuery.optional(),
43
- sortBy: z.enum(["timestamp", "duration"]).optional().default("timestamp").describe("Sort the results either by the timestamp of the request (most recent first) or the duration of the request (longest first).")
44
- },
45
- async handler(params, context) {
46
- const apiService = apiServiceFromContext(context, { regionUrl: params.regionUrl });
47
- const organizationSlug = params.organizationSlug;
48
- setTag("organization.slug", organizationSlug);
49
- if (params.projectSlug) setTag("project.slug", params.projectSlug);
50
- const eventList = await apiService.searchSpans({
51
- organizationSlug,
52
- projectSlug: params.projectSlug,
53
- transaction: params.transaction,
54
- query: params.query,
55
- sortBy: params.sortBy
56
- });
57
- let output = `# Transactions in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : ""}**\n\n`;
58
- if (params.query) output += `These spans match the query \`${params.query}\`\n`;
59
- if (params.transaction) output += `These spans are limited to the transaction \`${params.transaction}\`\n`;
60
- output += "\n";
61
- if (eventList.length === 0) {
62
- output += `No results found\n\n`;
63
- output += `We searched within the ${organizationSlug} organization.\n\n`;
64
- return output;
65
- }
66
- for (const eventSummary of eventList) {
67
- output += `## \`${eventSummary.transaction}\`\n\n`;
68
- output += `**Span ID**: ${eventSummary.id}\n`;
69
- output += `**Trace ID**: ${eventSummary.trace}\n`;
70
- output += `**Span Operation**: ${eventSummary["span.op"]}\n`;
71
- output += `**Span Description**: ${eventSummary["span.description"]}\n`;
72
- output += `**Duration**: ${eventSummary["span.duration"]}\n`;
73
- output += `**Timestamp**: ${eventSummary.timestamp}\n`;
74
- output += `**Project**: ${eventSummary.project}\n`;
75
- output += `**URL**: ${apiService.getTraceUrl(organizationSlug, eventSummary.trace)}\n\n`;
76
- }
77
- return output;
78
- }
79
- });
80
-
81
- //#endregion
82
- export { find_transactions_default };
83
- //# sourceMappingURL=find-transactions-BiBgg-AE.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-transactions-BiBgg-AE.js","names":["context: ServerContext"],"sources":["../src/tools/find-transactions.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlugOrAll,\n ParamTransaction,\n ParamQuery,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_transactions\",\n description: [\n \"Find transactions in Sentry using advanced search syntax.\",\n \"\",\n \"Transactions are segments of traces that are associated with a specific route or endpoint.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Search for production transaction data to understand performance.\",\n \"- Analyze traces and latency patterns.\",\n \"- Find examples of recent requests to endpoints.\",\n \"\",\n \"<examples>\",\n \"### Find slow requests to a route\",\n \"\",\n \"...\",\n \"\",\n \"```\",\n \"find_transactions(organizationSlug='my-organization', transaction='/checkout', sortBy='duration')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `find_organizations()` first.\",\n \"- You can use the `find_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlugOrAll.optional(),\n transaction: ParamTransaction.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"timestamp\", \"duration\"])\n .optional()\n .default(\"timestamp\")\n .describe(\n \"Sort the results either by the timestamp of the request (most recent first) or the duration of the request (longest first).\",\n ),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n if (params.projectSlug) setTag(\"project.slug\", params.projectSlug);\n\n const eventList = await apiService.searchSpans({\n organizationSlug,\n projectSlug: params.projectSlug,\n transaction: params.transaction,\n query: params.query,\n sortBy: params.sortBy as \"timestamp\" | \"duration\" | undefined,\n });\n let output = `# Transactions in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (params.query)\n output += `These spans match the query \\`${params.query}\\`\\n`;\n if (params.transaction)\n output += `These spans are limited to the transaction \\`${params.transaction}\\`\\n`;\n output += \"\\n\";\n if (eventList.length === 0) {\n output += `No results found\\n\\n`;\n output += `We searched within the ${organizationSlug} organization.\\n\\n`;\n return output;\n }\n for (const eventSummary of eventList) {\n output += `## \\`${eventSummary.transaction}\\`\\n\\n`;\n output += `**Span ID**: ${eventSummary.id}\\n`;\n output += `**Trace ID**: ${eventSummary.trace}\\n`;\n output += `**Span Operation**: ${eventSummary[\"span.op\"]}\\n`;\n output += `**Span Description**: ${eventSummary[\"span.description\"]}\\n`;\n output += `**Duration**: ${eventSummary[\"span.duration\"]}\\n`;\n output += `**Timestamp**: ${eventSummary.timestamp}\\n`;\n output += `**Project**: ${eventSummary.project}\\n`;\n output += `**URL**: ${apiService.getTraceUrl(organizationSlug, eventSummary.trace)}\\n\\n`;\n }\n return output;\n },\n});\n"],"mappings":";;;;;;;AAaA,gCAAe,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;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;C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0 @@
1
- const require_chunk = require('./chunk-DWy1uDak.cjs');
2
- const require_defineTool = require('./defineTool-lWNTzWl_.cjs');
3
- const require_api_utils = require('./api-utils-d36iteNO.cjs');
4
- const require_schema = require('./schema-BpJVmev8.cjs');
5
- const zod = require_chunk.__toESM(require("zod"));
6
- const __sentry_core = require_chunk.__toESM(require("@sentry/core"));
7
-
8
- //#region src/tools/find-transactions.ts
9
- var find_transactions_default = require_defineTool.defineTool({
10
- name: "find_transactions",
11
- description: [
12
- "Find transactions in Sentry using advanced search syntax.",
13
- "",
14
- "Transactions are segments of traces that are associated with a specific route or endpoint.",
15
- "",
16
- "Use this tool when you need to:",
17
- "- Search for production transaction data to understand performance.",
18
- "- Analyze traces and latency patterns.",
19
- "- Find examples of recent requests to endpoints.",
20
- "",
21
- "<examples>",
22
- "### Find slow requests to a route",
23
- "",
24
- "...",
25
- "",
26
- "```",
27
- "find_transactions(organizationSlug='my-organization', transaction='/checkout', sortBy='duration')",
28
- "```",
29
- "",
30
- "</examples>",
31
- "",
32
- "<hints>",
33
- "- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.",
34
- "- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `find_organizations()` first.",
35
- "- You can use the `find_tags()` tool to see what user-defined tags are available.",
36
- "</hints>"
37
- ].join("\n"),
38
- inputSchema: {
39
- organizationSlug: require_schema.ParamOrganizationSlug,
40
- regionUrl: require_schema.ParamRegionUrl.optional(),
41
- projectSlug: require_schema.ParamProjectSlugOrAll.optional(),
42
- transaction: require_schema.ParamTransaction.optional(),
43
- query: require_schema.ParamQuery.optional(),
44
- sortBy: zod.z.enum(["timestamp", "duration"]).optional().default("timestamp").describe("Sort the results either by the timestamp of the request (most recent first) or the duration of the request (longest first).")
45
- },
46
- async handler(params, context) {
47
- const apiService = require_api_utils.apiServiceFromContext(context, { regionUrl: params.regionUrl });
48
- const organizationSlug = params.organizationSlug;
49
- (0, __sentry_core.setTag)("organization.slug", organizationSlug);
50
- if (params.projectSlug) (0, __sentry_core.setTag)("project.slug", params.projectSlug);
51
- const eventList = await apiService.searchSpans({
52
- organizationSlug,
53
- projectSlug: params.projectSlug,
54
- transaction: params.transaction,
55
- query: params.query,
56
- sortBy: params.sortBy
57
- });
58
- let output = `# Transactions in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : ""}**\n\n`;
59
- if (params.query) output += `These spans match the query \`${params.query}\`\n`;
60
- if (params.transaction) output += `These spans are limited to the transaction \`${params.transaction}\`\n`;
61
- output += "\n";
62
- if (eventList.length === 0) {
63
- output += `No results found\n\n`;
64
- output += `We searched within the ${organizationSlug} organization.\n\n`;
65
- return output;
66
- }
67
- for (const eventSummary of eventList) {
68
- output += `## \`${eventSummary.transaction}\`\n\n`;
69
- output += `**Span ID**: ${eventSummary.id}\n`;
70
- output += `**Trace ID**: ${eventSummary.trace}\n`;
71
- output += `**Span Operation**: ${eventSummary["span.op"]}\n`;
72
- output += `**Span Description**: ${eventSummary["span.description"]}\n`;
73
- output += `**Duration**: ${eventSummary["span.duration"]}\n`;
74
- output += `**Timestamp**: ${eventSummary.timestamp}\n`;
75
- output += `**Project**: ${eventSummary.project}\n`;
76
- output += `**URL**: ${apiService.getTraceUrl(organizationSlug, eventSummary.trace)}\n\n`;
77
- }
78
- return output;
79
- }
80
- });
81
-
82
- //#endregion
83
- Object.defineProperty(exports, 'find_transactions_default', {
84
- enumerable: true,
85
- get: function () {
86
- return find_transactions_default;
87
- }
88
- });
89
- //# sourceMappingURL=find-transactions-DuZyqjhF.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-transactions-DuZyqjhF.cjs","names":["ParamOrganizationSlug","context: ServerContext"],"sources":["../src/tools/find-transactions.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlugOrAll,\n ParamTransaction,\n ParamQuery,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_transactions\",\n description: [\n \"Find transactions in Sentry using advanced search syntax.\",\n \"\",\n \"Transactions are segments of traces that are associated with a specific route or endpoint.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Search for production transaction data to understand performance.\",\n \"- Analyze traces and latency patterns.\",\n \"- Find examples of recent requests to endpoints.\",\n \"\",\n \"<examples>\",\n \"### Find slow requests to a route\",\n \"\",\n \"...\",\n \"\",\n \"```\",\n \"find_transactions(organizationSlug='my-organization', transaction='/checkout', sortBy='duration')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `find_organizations()` first.\",\n \"- You can use the `find_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlugOrAll.optional(),\n transaction: ParamTransaction.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"timestamp\", \"duration\"])\n .optional()\n .default(\"timestamp\")\n .describe(\n \"Sort the results either by the timestamp of the request (most recent first) or the duration of the request (longest first).\",\n ),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n if (params.projectSlug) setTag(\"project.slug\", params.projectSlug);\n\n const eventList = await apiService.searchSpans({\n organizationSlug,\n projectSlug: params.projectSlug,\n transaction: params.transaction,\n query: params.query,\n sortBy: params.sortBy as \"timestamp\" | \"duration\" | undefined,\n });\n let output = `# Transactions in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (params.query)\n output += `These spans match the query \\`${params.query}\\`\\n`;\n if (params.transaction)\n output += `These spans are limited to the transaction \\`${params.transaction}\\`\\n`;\n output += \"\\n\";\n if (eventList.length === 0) {\n output += `No results found\\n\\n`;\n output += `We searched within the ${organizationSlug} organization.\\n\\n`;\n return output;\n }\n for (const eventSummary of eventList) {\n output += `## \\`${eventSummary.transaction}\\`\\n\\n`;\n output += `**Span ID**: ${eventSummary.id}\\n`;\n output += `**Trace ID**: ${eventSummary.trace}\\n`;\n output += `**Span Operation**: ${eventSummary[\"span.op\"]}\\n`;\n output += `**Span Description**: ${eventSummary[\"span.description\"]}\\n`;\n output += `**Duration**: ${eventSummary[\"span.duration\"]}\\n`;\n output += `**Timestamp**: ${eventSummary.timestamp}\\n`;\n output += `**Project**: ${eventSummary.project}\\n`;\n output += `**URL**: ${apiService.getTraceUrl(organizationSlug, eventSummary.trace)}\\n\\n`;\n }\n return output;\n },\n});\n"],"mappings":";;;;;;;;AAaA,gCAAe,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;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkBA;EAClB,WAAW,8BAAe,UAAU;EACpC,aAAa,qCAAsB,UAAU;EAC7C,aAAa,gCAAiB,UAAU;EACxC,OAAO,0BAAW,UAAU;EAC5B,QAAQ,MACL,KAAK,CAAC,aAAa,UAAW,EAAC,CAC/B,UAAU,CACV,QAAQ,YAAY,CACpB,SACC,8HACD;CACJ;CACD,MAAM,QAAQ,QAAQC,SAAwB;EAC5C,MAAM,aAAa,wCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,4BAAO,qBAAqB,iBAAiB;AAC7C,MAAI,OAAO,YAAa,2BAAO,gBAAgB,OAAO,YAAY;EAElE,MAAM,YAAY,MAAM,WAAW,YAAY;GAC7C;GACA,aAAa,OAAO;GACpB,aAAa,OAAO;GACpB,OAAO,OAAO;GACd,QAAQ,OAAO;EAChB,EAAC;EACF,IAAI,UAAU,sBAAsB,mBAAmB,OAAO,eAAe,GAAG,OAAO,gBAAgB,GAAG;AAC1G,MAAI,OAAO,MACT,YAAW,gCAAgC,OAAO,MAAM;AAC1D,MAAI,OAAO,YACT,YAAW,+CAA+C,OAAO,YAAY;AAC/E,YAAU;AACV,MAAI,UAAU,WAAW,GAAG;AAC1B,cAAW;AACX,cAAW,yBAAyB,iBAAiB;AACrD,UAAO;EACR;AACD,OAAK,MAAM,gBAAgB,WAAW;AACpC,cAAW,OAAO,aAAa,YAAY;AAC3C,cAAW,eAAe,aAAa,GAAG;AAC1C,cAAW,gBAAgB,aAAa,MAAM;AAC9C,cAAW,sBAAsB,aAAa,WAAW;AACzD,cAAW,wBAAwB,aAAa,oBAAoB;AACpE,cAAW,gBAAgB,aAAa,iBAAiB;AACzD,cAAW,iBAAiB,aAAa,UAAU;AACnD,cAAW,eAAe,aAAa,QAAQ;AAC/C,cAAW,WAAW,WAAW,YAAY,kBAAkB,aAAa,MAAM,CAAC;EACpF;AACD,SAAO;CACR;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatting-Bvyded57.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(event.platform, index, exceptions.length),\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,O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AG;AACpC,KAAI,MAAM,SAAS,QACjB,YAAW,mBAAmB,IAAI,KAAM,MAA2C,aAAa,aAAa,CAAC;AAEhH,KAAI,MAAM,QACR,YAAW,gBAAgB,MAAM,QAAQ;AAE3C,WAAU;AACV,WAAU,kBAAkB,MAAM;AAGlC,KAAI,aACF,WAAU,kBAAkB,aAAa;AAG3C,WAAU;AACV,YAAW,mEAAmE,MAAM,QAAQ;AAC5F,WACE;AACF,QAAO;AACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatting-CcTK2X8V.d.cts","names":[],"sources":["../src/internal/formatting.ts"],"sourcesContent":[],"mappings":";;;;;;;AAoFgB;AAoEhB;AA2gBA;;;;;;;AAQS,iBAxlBO,iBAAA,CAwlBP,KAAA,EAvlBA,CAAA,CAAE,KAulBF,CAAA,OAvlBe,cAulBf,CAAA,EAAA,UAAA,CAAA,EAAA,MAAA,EAAA,QAAA,CAAA,EAAA,MAAA,GAAA,IAAA,CAAA,EAAA,MAAA;;;;AAGuB;;;;iBAthBhB,iBAAA,QAAyB;;;;;;;;iBA2gBzB,iBAAA;;;;;;;;SAQP;SACA;cACK;iBACG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatting-D0Aki7rK.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(event.platform, index, exceptions.length),\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;GAA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;AAE3C,WAAU;AACV,WAAU,kBAAkB,MAAM;AAGlC,KAAI,aACF,WAAU,kBAAkB,aAAa;AAG3C,WAAU;AACV,YAAW,mEAAmE,MAAM,QAAQ;AAC5F,WACE;AACF,QAAO;AACR"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"formatting-vtXxusbn.d.ts","names":[],"sources":["../src/internal/formatting.ts"],"sourcesContent":[],"mappings":";;;;;;;AAoFgB;AAoEhB;AA2gBA;;;;;;;AAQS,iBAxlBO,iBAAA,CAwlBP,KAAA,EAvlBA,CAAA,CAAE,KAulBF,CAAA,OAvlBe,cAulBf,CAAA,EAAA,UAAA,CAAA,EAAA,MAAA,EAAA,QAAA,CAAA,EAAA,MAAA,GAAA,IAAA,CAAA,EAAA,MAAA;;;;AAGuB;;;;iBAthBhB,iBAAA,QAAyB;;;;;;;;iBA2gBzB,iBAAA;;;;;;;;SAQP;SACA;cACK;iBACG"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-issue-details-Dcmzxknx.js","names":["context: ServerContext","orgSlug","issue","event","autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined","autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined"],"sources":["../src/tools/get-issue-details.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport { parseIssueParams, formatIssueOutput } from \"./utils/issue-utils\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamIssueShortId,\n ParamIssueUrl,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"get_issue_details\",\n description: [\n \"Retrieve issue details from Sentry for a specific Issue ID, including the stacktrace and error message if available. Either issueId or issueUrl MUST be provided.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View error details, stacktraces, and metadata\",\n \"- Investigate when/where an error occurred\",\n \"- Access raw error information from Sentry\",\n \"- Get comprehensive issue information including any available Seer analysis\",\n \"\",\n \"Do NOT use this tool when:\",\n \"- User wants root cause analysis → Use `analyze_issue_with_seer`\",\n \"\",\n \"<examples>\",\n '### User: \"How do I fix ISSUE-123?\"',\n \"\",\n \"```\",\n \"get_issue_details(organizationSlug='my-organization', issueId='ISSUE-123')\",\n \"```\",\n \"\",\n \"### Get details for event ID 'c49541c747cb4d8aa3efb70ca5aba243'\",\n \"\",\n \"```\",\n \"get_issue_details(organizationSlug='my-organization', eventId='c49541c747cb4d8aa3efb70ca5aba243')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user provides the `issueUrl`, you can ignore the other parameters.\",\n \"- If the user provides `issueId` or `eventId` (only one is needed), `organizationSlug` is required.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n issueId: ParamIssueShortId.optional(),\n eventId: z.string().trim().describe(\"The ID of the event.\").optional(),\n issueUrl: ParamIssueUrl.optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n\n if (params.eventId) {\n const orgSlug = params.organizationSlug;\n if (!orgSlug) {\n throw new UserInputError(\n \"`organizationSlug` is required when providing `eventId`\",\n );\n }\n\n setTag(\"organization.slug\", orgSlug);\n const [issue] = await apiService.listIssues({\n organizationSlug: orgSlug,\n query: params.eventId,\n });\n if (!issue) {\n return `# Event Not Found\\n\\nNo issue found for Event ID: ${params.eventId}`;\n }\n const event = await apiService.getEventForIssue({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n eventId: params.eventId,\n });\n\n // Try to fetch Seer analysis context (non-blocking)\n let autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined;\n try {\n autofixState = await apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n });\n } catch (error) {\n // Silently continue if Seer analysis is not available\n // This ensures the tool works even if Seer is not enabled\n }\n\n return formatIssueOutput({\n organizationSlug: orgSlug,\n issue,\n event,\n apiService,\n autofixState,\n });\n }\n\n // Validate that we have the minimum required parameters\n if (!params.issueUrl && !params.issueId) {\n throw new UserInputError(\n \"Either `issueId` or `issueUrl` must be provided\",\n );\n }\n\n if (!params.issueUrl && !params.organizationSlug) {\n throw new UserInputError(\n \"`organizationSlug` is required when providing `issueId`\",\n );\n }\n\n const { organizationSlug: orgSlug, issueId: parsedIssueId } =\n parseIssueParams({\n organizationSlug: params.organizationSlug,\n issueId: params.issueId,\n issueUrl: params.issueUrl,\n });\n\n setTag(\"organization.slug\", orgSlug);\n\n const issue = await apiService.getIssue({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n });\n const event = await apiService.getLatestEventForIssue({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n });\n\n // Try to fetch Seer analysis context (non-blocking)\n let autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined;\n try {\n autofixState = await apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n });\n } catch (error) {\n // Silently continue if Seer analysis is not available\n // This ensures the tool works even if Seer is not enabled\n }\n\n return formatIssueOutput({\n organizationSlug: orgSlug,\n issue,\n event,\n apiService,\n autofixState,\n });\n },\n});\n"],"mappings":";;;;;;;;;;AAcA,gCAAe,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;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB,sBAAsB,UAAU;EAClD,WAAW,eAAe,UAAU;EACpC,SAAS,kBAAkB,UAAU;EACrC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,uBAAuB,CAAC,UA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Gf;AAED,SAAO,kBAAkB;GACvB,kBAAkB;GAClB;GACA;GACA;GACA;EACD,EAAC;CACH;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-issue-details-lBrYR9yx.cjs","names":["context: ServerContext","orgSlug","UserInputError","issue","event","autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined","autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined"],"sources":["../src/tools/get-issue-details.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport { parseIssueParams, formatIssueOutput } from \"./utils/issue-utils\";\nimport { UserInputError } from \"../errors\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamIssueShortId,\n ParamIssueUrl,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"get_issue_details\",\n description: [\n \"Retrieve issue details from Sentry for a specific Issue ID, including the stacktrace and error message if available. Either issueId or issueUrl MUST be provided.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- View error details, stacktraces, and metadata\",\n \"- Investigate when/where an error occurred\",\n \"- Access raw error information from Sentry\",\n \"- Get comprehensive issue information including any available Seer analysis\",\n \"\",\n \"Do NOT use this tool when:\",\n \"- User wants root cause analysis → Use `analyze_issue_with_seer`\",\n \"\",\n \"<examples>\",\n '### User: \"How do I fix ISSUE-123?\"',\n \"\",\n \"```\",\n \"get_issue_details(organizationSlug='my-organization', issueId='ISSUE-123')\",\n \"```\",\n \"\",\n \"### Get details for event ID 'c49541c747cb4d8aa3efb70ca5aba243'\",\n \"\",\n \"```\",\n \"get_issue_details(organizationSlug='my-organization', eventId='c49541c747cb4d8aa3efb70ca5aba243')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user provides the `issueUrl`, you can ignore the other parameters.\",\n \"- If the user provides `issueId` or `eventId` (only one is needed), `organizationSlug` is required.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n issueId: ParamIssueShortId.optional(),\n eventId: z.string().trim().describe(\"The ID of the event.\").optional(),\n issueUrl: ParamIssueUrl.optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n\n if (params.eventId) {\n const orgSlug = params.organizationSlug;\n if (!orgSlug) {\n throw new UserInputError(\n \"`organizationSlug` is required when providing `eventId`\",\n );\n }\n\n setTag(\"organization.slug\", orgSlug);\n const [issue] = await apiService.listIssues({\n organizationSlug: orgSlug,\n query: params.eventId,\n });\n if (!issue) {\n return `# Event Not Found\\n\\nNo issue found for Event ID: ${params.eventId}`;\n }\n const event = await apiService.getEventForIssue({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n eventId: params.eventId,\n });\n\n // Try to fetch Seer analysis context (non-blocking)\n let autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined;\n try {\n autofixState = await apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n });\n } catch (error) {\n // Silently continue if Seer analysis is not available\n // This ensures the tool works even if Seer is not enabled\n }\n\n return formatIssueOutput({\n organizationSlug: orgSlug,\n issue,\n event,\n apiService,\n autofixState,\n });\n }\n\n // Validate that we have the minimum required parameters\n if (!params.issueUrl && !params.issueId) {\n throw new UserInputError(\n \"Either `issueId` or `issueUrl` must be provided\",\n );\n }\n\n if (!params.issueUrl && !params.organizationSlug) {\n throw new UserInputError(\n \"`organizationSlug` is required when providing `issueId`\",\n );\n }\n\n const { organizationSlug: orgSlug, issueId: parsedIssueId } =\n parseIssueParams({\n organizationSlug: params.organizationSlug,\n issueId: params.issueId,\n issueUrl: params.issueUrl,\n });\n\n setTag(\"organization.slug\", orgSlug);\n\n const issue = await apiService.getIssue({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n });\n const event = await apiService.getLatestEventForIssue({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n });\n\n // Try to fetch Seer analysis context (non-blocking)\n let autofixState:\n | Awaited<ReturnType<typeof apiService.getAutofixState>>\n | undefined;\n try {\n autofixState = await apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: issue.shortId,\n });\n } catch (error) {\n // Silently continue if Seer analysis is not available\n // This ensures the tool works even if Seer is not enabled\n }\n\n return formatIssueOutput({\n organizationSlug: orgSlug,\n issue,\n event,\n apiService,\n autofixState,\n });\n },\n});\n"],"mappings":";;;;;;;;;;;AAcA,gCAAe,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;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB,qCAAsB,UAAU;EAClD,WAAW,8BAAe,UAAU;EACpC,SAAS,iCAAkB,UAAU;EACrC,SAAS,MAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,uBAAuB,CAAC,UAAU;EACtE,UAAU,6BAAc,UAAU;CACnC;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,wCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;AAEF,MAAI,OAAO,SAAS;GAClB,MAAMC,YAAU,OAAO;AACvB,QAAKA,UACH,OAAM,IAAIC,8BACR;AAIJ,6BAAO,qBAAqBD,UAAQ;GACpC,MAAM,CAACE,QAAM,GAAG,MAAM,WAAW,WAAW;IAC1C,kBAAkBF;IAClB,OAAO,OAAO;GACf,EAAC;AACF,QAAKE,QACH,SAAQ,oDAAoD,OAAO;GAErE,MAAMC,UAAQ,MAAM,WAAW,iBAAiB;IAC9C,kBAAkBH;IAClB,SAASE,QAAM;IACf,SAAS,OAAO;GACjB,EAAC;GAGF,IAAIE;AAGJ,OAAI;AACF,qBAAe,MAAM,WAAW,gBAAgB;KAC9C,kBAAkBJ;KAClB,SAASE,QAAM;IAChB,EAAC;GACH,SAAQ,OAAO,CAGf;AAED,UAAO,qCAAkB;IACvB,kBAAkBF;IAClB;IACA;IACA;IACA;GACD,EAAC;EACH;AAGD,OAAK,OAAO,aAAa,OAAO,QAC9B,OAAM,IAAIC,8BACR;AAIJ,OAAK,OAAO,aAAa,OAAO,iBAC9B,OAAM,IAAIA,8BACR;EAIJ,MAAM,EAAE,kBAAkB,SAAS,SAAS,eAAe,GACzD,uCAAiB;GACf,kBAAkB,OAAO;GACzB,SAAS,OAAO;GAChB,UAAU,OAAO;EAClB,EAAC;AAEJ,4BAAO,qBAAqB,QAAQ;EAEpC,MAAM,QAAQ,MAAM,WAAW,SAAS;GACtC,kBAAkB;GAClB,SAAS;EACV,EAAC;EACF,MAAM,QAAQ,MAAM,WAAW,uBAAuB;GACpD,kBAAkB;GAClB,SAAS,MAAM;EAChB,EAAC;EAGF,IAAII;AAGJ,MAAI;AACF,kBAAe,MAAM,WAAW,gBAAgB;IAC9C,kBAAkB;IAClB,SAAS,MAAM;GAChB,EAAC;EACH,SAAQ,OAAO,CAGf;AAED,SAAO,qCAAkB;GACvB,kBAAkB;GAClB;GACA;GACA;GACA;EACD,EAAC;CACH;AACF,EAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"issue-helpers-BJffpNoO.d.ts","names":[],"sources":["../src/internal/issue-helpers.ts"],"sourcesContent":[],"mappings":";;AAgBA;AAmEA;AAyBA;;;;;AAGkB;;;;;;;iBA/FF,cAAA;;;;;;;;;;;;iBAmEA,YAAA;;;;;;;;iBAyBA,gBAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"issue-helpers-CqqYnwYE.js","names":["url: string","parsedUrl: URL","organizationSlug: string | undefined","issueId: string"],"sources":["../src/internal/issue-helpers.ts"],"sourcesContent":["/**\n * Issue parameter parsing and validation utilities.\n *\n * Handles flexible input formats for Sentry issues (URLs vs explicit parameters),\n * extracts organization and issue identifiers, and validates issue ID formats.\n * Provides robust parsing for LLM-generated parameters that may contain formatting\n * inconsistencies.\n */\n\n/**\n * Extracts the Sentry issue ID and organization slug from a full URL\n *\n * @param url - A full Sentry issue URL\n * @returns Object containing the numeric issue ID and organization slug (if found)\n * @throws Error if the input is invalid\n */\nexport function extractIssueId(url: string): {\n issueId: string;\n organizationSlug: string;\n} {\n if (!url || typeof url !== \"string\") {\n throw new Error(\n \"Invalid Sentry issue URL. URL must be a non-empty string.\",\n );\n }\n\n if (!url.startsWith(\"http://\") && !url.startsWith(\"https://\")) {\n throw new Error(\n \"Invalid Sentry issue URL. Must start with http:// or https://\",\n );\n }\n\n let parsedUrl: URL;\n try {\n parsedUrl = new URL(url);\n } catch (error) {\n throw new Error(`Invalid Sentry issue URL. Unable to parse URL: ${url}`);\n }\n\n const pathParts = parsedUrl.pathname.split(\"/\").filter(Boolean);\n if (pathParts.length < 2 || !pathParts.includes(\"issues\")) {\n throw new Error(\n \"Invalid Sentry issue URL. Path must contain '/issues/{issue_id}'\",\n );\n }\n\n const issueId = pathParts[pathParts.indexOf(\"issues\") + 1];\n if (!issueId) {\n throw new Error(\"Unable to determine issue ID from URL.\");\n }\n\n // Extract organization slug from either the path or subdomain\n let organizationSlug: string | undefined;\n if (pathParts.includes(\"organizations\")) {\n organizationSlug = pathParts[pathParts.indexOf(\"organizations\") + 1];\n } else if (pathParts.length > 1 && pathParts[0] !== \"issues\") {\n // If URL is like sentry.io/sentry/issues/123\n organizationSlug = pathParts[0];\n } else {\n // Check for subdomain\n const hostParts = parsedUrl.hostname.split(\".\");\n if (hostParts.length > 2 && hostParts[0] !== \"www\") {\n organizationSlug = hostParts[0];\n }\n }\n\n if (!organizationSlug) {\n throw new Error(\n \"Invalid Sentry issue URL. Could not determine organization.\",\n );\n }\n\n return { issueId, organizationSlug };\n}\n\n/**\n * Sometimes the LLM will pass in a funky issue shortId. For example it might pass\n * in \"CLOUDFLARE-MCP-41.\" instead of \"CLOUDFLARE-MCP-41\". This function attempts to\n * fix common issues.\n *\n * @param issueId - The issue ID to parse\n * @returns The parsed issue ID\n */\nexport function parseIssueId(issueId: string) {\n let finalIssueId = issueId;\n // remove trailing punctuation\n finalIssueId = finalIssueId.replace(/[^\\w-]/g, \"\");\n\n // Validate against common Sentry issue ID patterns\n // Either numeric IDs or PROJECT-ABC123 format\n const validFormatRegex = /^(\\d+|[A-Za-z][\\w-]*-[A-Za-z0-9]+)$/;\n\n if (!validFormatRegex.test(finalIssueId)) {\n throw new Error(\n `Invalid issue ID format: \"${finalIssueId}\". Expected either a numeric ID or a project code followed by an alphanumeric identifier (e.g., \"PROJECT-ABC123\").`,\n );\n }\n\n return finalIssueId;\n}\n\n/**\n * Parses issue parameters from a variety of formats.\n *\n * @param params - Object containing issue URL, issue ID, and organization slug\n * @returns Object containing the parsed organization slug and issue ID\n * @throws Error if the input is invalid\n */\nexport function parseIssueParams({\n issueUrl,\n issueId,\n organizationSlug,\n}: {\n issueUrl?: string | null;\n issueId?: string | null;\n organizationSlug?: string | null;\n}): {\n organizationSlug: string;\n issueId: string;\n} {\n if (issueUrl) {\n const resolved = extractIssueId(issueUrl);\n if (!resolved) {\n throw new Error(\n \"Invalid Sentry issue URL. Path should contain '/issues/{issue_id}'\",\n );\n }\n return {\n ...resolved,\n issueId: parseIssueId(resolved.issueId),\n };\n }\n\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n\n if (issueId) {\n return {\n organizationSlug,\n issueId: parseIssueId(issueId),\n };\n }\n\n throw new Error(\"Either issueId or issueUrl must be provided\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAgB,eAAeA,KAG7B;AACA,MAAK,cAAc,QAAQ,SACzB,OAAM,IAAI,MACR;AAIJ,MAAK,IAAI,WAAW,UAAU,KAAK,IAAI,WAAW,WAAW,CAC3D,OAAM,IAAI,MACR;CAIJ,IAAIC;AACJ,KA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w6.cjs","names":["url: string","parsedUrl: URL","organizationSlug: string | undefined","issueId: string"],"sources":["../src/internal/issue-helpers.ts"],"sourcesContent":["/**\n * Issue parameter parsing and validation utilities.\n *\n * Handles flexible input formats for Sentry issues (URLs vs explicit parameters),\n * extracts organization and issue identifiers, and validates issue ID formats.\n * Provides robust parsing for LLM-generated parameters that may contain formatting\n * inconsistencies.\n */\n\n/**\n * Extracts the Sentry issue ID and organization slug from a full URL\n *\n * @param url - A full Sentry issue URL\n * @returns Object containing the numeric issue ID and organization slug (if found)\n * @throws Error if the input is invalid\n */\nexport function extractIssueId(url: string): {\n issueId: string;\n organizationSlug: string;\n} {\n if (!url || typeof url !== \"string\") {\n throw new Error(\n \"Invalid Sentry issue URL. URL must be a non-empty string.\",\n );\n }\n\n if (!url.startsWith(\"http://\") && !url.startsWith(\"https://\")) {\n throw new Error(\n \"Invalid Sentry issue URL. Must start with http:// or https://\",\n );\n }\n\n let parsedUrl: URL;\n try {\n parsedUrl = new URL(url);\n } catch (error) {\n throw new Error(`Invalid Sentry issue URL. Unable to parse URL: ${url}`);\n }\n\n const pathParts = parsedUrl.pathname.split(\"/\").filter(Boolean);\n if (pathParts.length < 2 || !pathParts.includes(\"issues\")) {\n throw new Error(\n \"Invalid Sentry issue URL. Path must contain '/issues/{issue_id}'\",\n );\n }\n\n const issueId = pathParts[pathParts.indexOf(\"issues\") + 1];\n if (!issueId) {\n throw new Error(\"Unable to determine issue ID from URL.\");\n }\n\n // Extract organization slug from either the path or subdomain\n let organizationSlug: string | undefined;\n if (pathParts.includes(\"organizations\")) {\n organizationSlug = pathParts[pathParts.indexOf(\"organizations\") + 1];\n } else if (pathParts.length > 1 && pathParts[0] !== \"issues\") {\n // If URL is like sentry.io/sentry/issues/123\n organizationSlug = pathParts[0];\n } else {\n // Check for subdomain\n const hostParts = parsedUrl.hostname.split(\".\");\n if (hostParts.length > 2 && hostParts[0] !== \"www\") {\n organizationSlug = hostParts[0];\n }\n }\n\n if (!organizationSlug) {\n throw new Error(\n \"Invalid Sentry issue URL. Could not determine organization.\",\n );\n }\n\n return { issueId, organizationSlug };\n}\n\n/**\n * Sometimes the LLM will pass in a funky issue shortId. For example it might pass\n * in \"CLOUDFLARE-MCP-41.\" instead of \"CLOUDFLARE-MCP-41\". This function attempts to\n * fix common issues.\n *\n * @param issueId - The issue ID to parse\n * @returns The parsed issue ID\n */\nexport function parseIssueId(issueId: string) {\n let finalIssueId = issueId;\n // remove trailing punctuation\n finalIssueId = finalIssueId.replace(/[^\\w-]/g, \"\");\n\n // Validate against common Sentry issue ID patterns\n // Either numeric IDs or PROJECT-ABC123 format\n const validFormatRegex = /^(\\d+|[A-Za-z][\\w-]*-[A-Za-z0-9]+)$/;\n\n if (!validFormatRegex.test(finalIssueId)) {\n throw new Error(\n `Invalid issue ID format: \"${finalIssueId}\". Expected either a numeric ID or a project code followed by an alphanumeric identifier (e.g., \"PROJECT-ABC123\").`,\n );\n }\n\n return finalIssueId;\n}\n\n/**\n * Parses issue parameters from a variety of formats.\n *\n * @param params - Object containing issue URL, issue ID, and organization slug\n * @returns Object containing the parsed organization slug and issue ID\n * @throws Error if the input is invalid\n */\nexport function parseIssueParams({\n issueUrl,\n issueId,\n organizationSlug,\n}: {\n issueUrl?: string | null;\n issueId?: string | null;\n organizationSlug?: string | null;\n}): {\n organizationSlug: string;\n issueId: string;\n} {\n if (issueUrl) {\n const resolved = extractIssueId(issueUrl);\n if (!resolved) {\n throw new Error(\n \"Invalid Sentry issue URL. Path should contain '/issues/{issue_id}'\",\n );\n }\n return {\n ...resolved,\n issueId: parseIssueId(resolved.issueId),\n };\n }\n\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n\n if (issueId) {\n return {\n organizationSlug,\n issueId: parseIssueId(issueId),\n };\n }\n\n throw new Error(\"Either issueId or issueUrl must be provided\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,SAAgB,eAAeA,KAG7B;AACA,MAAK,cAAc,QAAQ,SACzB,OAAM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L;EACA,SAAS,aAAa,QAAQ;CAC/B;AAGH,OAAM,IAAI,MAAM;AACjB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"promptDefinitions-D3GTBGLr.d.ts","names":[],"sources":["../src/promptDefinitions.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;cAoCa;;;;sBAuBZ,CAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompts-C8Y9w5c4.js","names":["issueMessage: string"],"sources":["../src/prompts.ts"],"sourcesContent":["/**\n * Prompt implementation handlers for the Sentry MCP server.\n *\n * Contains runtime implementations for all MCP prompts defined in `promptDefinitions.ts`.\n * Each handler generates context-aware instructions that guide LLMs through\n * complex multi-step workflows involving Sentry operations.\n *\n * @example Basic Handler Pattern\n * ```typescript\n * prompt_name: async (context, params) => {\n * const instructions = [\n * \"Primary objective and context\",\n * \"\",\n * \"1. First step with specific tool call\",\n * \"2. Second step with conditional logic\",\n * \"3. Final step with recommendations\",\n * ];\n * return instructions.join(\"\\n\");\n * },\n * ```\n */\nimport { UserInputError } from \"./errors\";\nimport type { PromptHandlers } from \"./types\";\n\nexport const PROMPT_HANDLERS = {\n find_errors_in_file: async (context, { organizationSlug, filename }) =>\n [\n `I want to find errors in Sentry, within the organization ${organizationSlug}, for the file ${filename}`,\n \"\",\n \"You should use the tool `search_errors` to find errors in Sentry.\",\n \"\",\n \"If the filename is ambiguous, such as something like `index.ts`, and in most cases, you should pass it in with its direct parent.\",\n \"For example: if the file is `app/utils/index.ts`, you should pass in `utils/index.ts` or `app/utils/index.ts` depending on if the file is actually part of the applications source path.\",\n ].join(\"\\n\"),\n fix_issue_with_seer: async (\n context,\n { organizationSlug, issueId, issueUrl },\n ) => {\n let issueMessage: string;\n if (issueUrl) {\n issueMessage = `The Sentry issue is ${issueUrl}`;\n } else if (organizationSlug && issueId) {\n issueMessage = `The Sentry issue is ${issueId} in the organization ${organizationSlug}`;\n } else {\n throw new UserInputError(\n \"Either issueUrl or organizationSlug and issueId must be provided\",\n );\n }\n return [\n `I want to use Seer to fix an issue in Sentry.`,\n \"\",\n issueMessage,\n \"\",\n \"1. Call the tool `analyze_issue_with_seer` to analyze the issue and get fix recommendations.\",\n \"2. The tool will automatically check for existing analysis or start a new one if needed.\",\n \"3. Wait for the analysis to complete (typically 30-60 seconds).\",\n \"4. Review the root cause analysis and suggested fixes.\",\n \"5. Help me apply the fix to my application, if you are able to. Think carefully when doing this.\",\n ].join(\"\\n\");\n },\n} satisfies PromptHandlers;\n"],"mappings":";;;AAwBA,MAAa,kBAAkB;CAC7B,qBAAqB,OAAO,SAAS,EAAE,kBAAkB,UAAU,KACjE;GACG,2DAA2D,iBAAiB,iBAAiB;EAC9F;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACd,qBAAqB,OACnB,SACA,EAAE,kBAAkB,SAAS,UAAU,KACpC;EACH,IAAIA;AACJ,MAAI,SACF,iBAAgB,sBAAsB;WAC7B,oBAAoB,QAC7B,iBAAgB,sBAAsB,QAAQ,uBAAuB;MAErE,OAAM,IAAI,eACR;AAGJ,SAAO;IACJ;GACD;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;CACb;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"prompts-Df3i1XSB.cjs","names":["issueMessage: string","UserInputError"],"sources":["../src/prompts.ts"],"sourcesContent":["/**\n * Prompt implementation handlers for the Sentry MCP server.\n *\n * Contains runtime implementations for all MCP prompts defined in `promptDefinitions.ts`.\n * Each handler generates context-aware instructions that guide LLMs through\n * complex multi-step workflows involving Sentry operations.\n *\n * @example Basic Handler Pattern\n * ```typescript\n * prompt_name: async (context, params) => {\n * const instructions = [\n * \"Primary objective and context\",\n * \"\",\n * \"1. First step with specific tool call\",\n * \"2. Second step with conditional logic\",\n * \"3. Final step with recommendations\",\n * ];\n * return instructions.join(\"\\n\");\n * },\n * ```\n */\nimport { UserInputError } from \"./errors\";\nimport type { PromptHandlers } from \"./types\";\n\nexport const PROMPT_HANDLERS = {\n find_errors_in_file: async (context, { organizationSlug, filename }) =>\n [\n `I want to find errors in Sentry, within the organization ${organizationSlug}, for the file ${filename}`,\n \"\",\n \"You should use the tool `search_errors` to find errors in Sentry.\",\n \"\",\n \"If the filename is ambiguous, such as something like `index.ts`, and in most cases, you should pass it in with its direct parent.\",\n \"For example: if the file is `app/utils/index.ts`, you should pass in `utils/index.ts` or `app/utils/index.ts` depending on if the file is actually part of the applications source path.\",\n ].join(\"\\n\"),\n fix_issue_with_seer: async (\n context,\n { organizationSlug, issueId, issueUrl },\n ) => {\n let issueMessage: string;\n if (issueUrl) {\n issueMessage = `The Sentry issue is ${issueUrl}`;\n } else if (organizationSlug && issueId) {\n issueMessage = `The Sentry issue is ${issueId} in the organization ${organizationSlug}`;\n } else {\n throw new UserInputError(\n \"Either issueUrl or organizationSlug and issueId must be provided\",\n );\n }\n return [\n `I want to use Seer to fix an issue in Sentry.`,\n \"\",\n issueMessage,\n \"\",\n \"1. Call the tool `analyze_issue_with_seer` to analyze the issue and get fix recommendations.\",\n \"2. The tool will automatically check for existing analysis or start a new one if needed.\",\n \"3. Wait for the analysis to complete (typically 30-60 seconds).\",\n \"4. Review the root cause analysis and suggested fixes.\",\n \"5. Help me apply the fix to my application, if you are able to. Think carefully when doing this.\",\n ].join(\"\\n\");\n },\n} satisfies PromptHandlers;\n"],"mappings":";;;AAwBA,MAAa,kBAAkB;CAC7B,qBAAqB,OAAO,SAAS,EAAE,kBAAkB,UAAU,KACjE;GACG,2DAA2D,iBAAiB,iBAAiB;EAC9F;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACd,qBAAqB,OACnB,SACA,EAAE,kBAAkB,SAAS,UAAU,KACpC;EACH,IAAIA;AACJ,MAAI,SACF,iBAAgB,sBAAsB;WAC7B,oBAAoB,QAC7B,iBAAgB,sBAAsB,QAAQ,uBAAuB;MAErE,OAAM,IAAIC,8BACR;AAGJ,SAAO;IACJ;GACD;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;CACb;AACF"}
@@ -1,92 +0,0 @@
1
- import { SENTRY_FRAMEWORKS, SENTRY_PLATFORMS_BASE } from "./constants-S7AU45oQ.js";
2
- import { UserInputError } from "./errors-CIoxzIug.js";
3
- import { ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
4
-
5
- //#region src/resources.ts
6
- /**
7
- * Type guard to check if a resource uses a URI template
8
- */
9
- function isTemplateResource(resource) {
10
- return "template" in resource && resource.template instanceof ResourceTemplate;
11
- }
12
- /**
13
- * Fetches raw content from GitHub repositories.
14
- * Converts GitHub blob URLs to raw content URLs.
15
- */
16
- async function fetchRawGithubContent(rawPath) {
17
- const path = rawPath.replace("/blob", "");
18
- return fetch(`https://raw.githubusercontent.com${path}`).then((res) => res.text());
19
- }
20
- /**
21
- * Default handler for GitHub-hosted resources.
22
- * Converts GitHub blob URLs to raw content URLs and returns MCP resource format.
23
- */
24
- async function defaultGitHubHandler(url, _extra) {
25
- const uri = url.host;
26
- const rawPath = url.pathname;
27
- const content = await fetchRawGithubContent(rawPath);
28
- return { contents: [{
29
- uri,
30
- mimeType: "text/plain",
31
- text: content
32
- }] };
33
- }
34
- /**
35
- * Fetches Sentry documentation in markdown format.
36
- * Converts docs.sentry.io URLs to their markdown equivalents.
37
- *
38
- * The handler receives the exact URI from the resource definition,
39
- * but dynamically constructs the markdown URL based on the actual request.
40
- */
41
- async function sentryDocsHandler(url, _extra) {
42
- const path = `${url.pathname.replace(/\/$/, "")}.md`;
43
- const mdUrl = `${url.origin}${path}`;
44
- const response = await fetch(mdUrl, { headers: { "User-Agent": "Sentry MCP Server" } });
45
- if (!response.ok) {
46
- if (response.status === 404) throw new UserInputError(`Sentry documentation not found at ${url.pathname}. Please check the URL is correct.`);
47
- throw new Error(`Failed to fetch Sentry docs: ${response.status} ${response.statusText}`);
48
- }
49
- const content = await response.text();
50
- return { contents: [{
51
- uri: url.toString(),
52
- mimeType: "text/markdown",
53
- text: content
54
- }] };
55
- }
56
- const RESOURCES = [
57
- {
58
- name: "sentry-query-syntax",
59
- uri: "https://github.com/getsentry/sentry-ai-rules/blob/main/api/query-syntax.mdc",
60
- mimeType: "text/plain",
61
- description: "Use these rules to understand common query parameters when searching Sentry for information.",
62
- handler: defaultGitHubHandler
63
- },
64
- {
65
- name: "sentry-docs-platform",
66
- template: new ResourceTemplate("https://docs.sentry.io/platforms/{platform}/", { list: async (_extra) => ({ resources: SENTRY_PLATFORMS_BASE.map((platform) => ({
67
- uri: `https://docs.sentry.io/platforms/${platform}/`,
68
- name: `${platform}-docs`,
69
- description: `Sentry SDK documentation for ${platform}`,
70
- mimeType: "text/markdown"
71
- })) }) }),
72
- mimeType: "text/markdown",
73
- description: "Sentry SDK documentation for {platform}",
74
- handler: sentryDocsHandler
75
- },
76
- {
77
- name: "sentry-docs-platform-guide",
78
- template: new ResourceTemplate("https://docs.sentry.io/platforms/{platform}/guides/{framework}/", { list: async (_extra) => ({ resources: Object.entries(SENTRY_FRAMEWORKS).flatMap(([platform, frameworks]) => frameworks.map((framework) => ({
79
- uri: `https://docs.sentry.io/platforms/${platform}/guides/${framework}/`,
80
- name: `${platform}-${framework}-guide`,
81
- description: `Sentry integration guide for ${framework} on ${platform}`,
82
- mimeType: "text/markdown"
83
- }))) }) }),
84
- mimeType: "text/markdown",
85
- description: "Sentry integration guide for {framework} on {platform}",
86
- handler: sentryDocsHandler
87
- }
88
- ];
89
-
90
- //#endregion
91
- export { RESOURCES, isTemplateResource };
92
- //# sourceMappingURL=resources-BHF8a1ZB.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resources-BHF8a1ZB.js","names":["resource: ResourceConfig","rawPath: string","url: URL","_extra: RequestHandlerExtra<any, any>","RESOURCES: ResourceConfig[]"],"sources":["../src/resources.ts"],"sourcesContent":["/**\n * MCP Resources for external documentation and reference materials.\n *\n * Defines MCP resources that provide access to external documentation and\n * knowledge bases. Resources enable LLMs to access contextual information\n * during tool execution without embedding large documents in the codebase.\n *\n * @see https://modelcontextprotocol.io/docs/concepts/resources - MCP Resources specification\n *\n * @example Resource Definition\n * ```typescript\n * {\n * name: \"sentry-query-syntax\",\n * uri: \"https://github.com/getsentry/sentry-ai-rules/blob/main/api/query-syntax.mdc\",\n * mimeType: \"text/plain\",\n * description: \"Sentry search query syntax reference for filtering issues and events.\",\n * handler: defaultGitHubHandler,\n * }\n * ```\n */\nimport {\n ResourceTemplate,\n type ReadResourceCallback,\n type ReadResourceTemplateCallback,\n} from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport type { ReadResourceResult } from \"@modelcontextprotocol/sdk/types.js\";\nimport type { RequestHandlerExtra } from \"@modelcontextprotocol/sdk/shared/protocol.js\";\nimport { UserInputError } from \"./errors\";\n\n/**\n * Resource configuration for regular URI resources\n */\nexport type UriResourceConfig = {\n name: string;\n description: string;\n mimeType: string;\n uri: string;\n handler: ReadResourceCallback;\n};\n\n/**\n * Resource configuration for URI template resources\n */\nexport type TemplateResourceConfig = {\n name: string;\n description: string;\n mimeType: string;\n template: ResourceTemplate;\n handler: ReadResourceCallback; // Changed back to ReadResourceCallback\n};\n\n/**\n * Resource configuration with handler function\n */\nexport type ResourceConfig = UriResourceConfig | TemplateResourceConfig;\n\n/**\n * Type guard to check if a resource uses a URI template\n */\nexport function isTemplateResource(\n resource: ResourceConfig,\n): resource is TemplateResourceConfig {\n return (\n \"template\" in resource && resource.template instanceof ResourceTemplate\n );\n}\n\n/**\n * Fetches raw content from GitHub repositories.\n * Converts GitHub blob URLs to raw content URLs.\n */\nasync function fetchRawGithubContent(rawPath: string) {\n const path = rawPath.replace(\"/blob\", \"\");\n\n return fetch(`https://raw.githubusercontent.com${path}`).then((res) =>\n res.text(),\n );\n}\n\n/**\n * Default handler for GitHub-hosted resources.\n * Converts GitHub blob URLs to raw content URLs and returns MCP resource format.\n */\nasync function defaultGitHubHandler(\n url: URL,\n _extra: RequestHandlerExtra<any, any>,\n): Promise<ReadResourceResult> {\n const uri = url.host;\n const rawPath = url.pathname;\n const content = await fetchRawGithubContent(rawPath);\n return {\n contents: [\n {\n uri: uri,\n mimeType: \"text/plain\",\n text: content,\n },\n ],\n };\n}\n\n/**\n * Fetches Sentry documentation in markdown format.\n * Converts docs.sentry.io URLs to their markdown equivalents.\n *\n * The handler receives the exact URI from the resource definition,\n * but dynamically constructs the markdown URL based on the actual request.\n */\nasync function sentryDocsHandler(\n url: URL,\n _extra: RequestHandlerExtra<any, any>,\n): Promise<ReadResourceResult> {\n // The URL passed here is the actual docs.sentry.io URL being requested\n // Transform it to fetch the markdown version\n const path = `${url.pathname.replace(/\\/$/, \"\")}.md`;\n const mdUrl = `${url.origin}${path}`;\n\n const response = await fetch(mdUrl, {\n headers: {\n \"User-Agent\": \"Sentry MCP Server\",\n },\n });\n if (!response.ok) {\n if (response.status === 404) {\n throw new UserInputError(\n `Sentry documentation not found at ${url.pathname}. Please check the URL is correct.`,\n );\n }\n throw new Error(\n `Failed to fetch Sentry docs: ${response.status} ${response.statusText}`,\n );\n }\n\n const content = await response.text();\n\n return {\n contents: [\n {\n uri: url.toString(),\n mimeType: \"text/markdown\",\n text: content,\n },\n ],\n };\n}\n\n/**\n * Registry of all MCP resources available to LLMs.\n * Defines external documentation and reference materials with their handlers.\n */\n// XXX: Try to keep the description in sync with the MDC file itself\n// Note: In an ideal world these would live on-disk in this same repo and we'd\n// simply parse everything out, but given we're running the service on cloudflare\n// and the author barely knows TypeScript, we're opting for a solution we've\n// seen employed elsewhere (h/t Neon)\n\n// Import platform constants from constants\nimport { SENTRY_PLATFORMS_BASE, SENTRY_FRAMEWORKS } from \"./constants\";\n\nexport const RESOURCES: ResourceConfig[] = [\n {\n name: \"sentry-query-syntax\",\n uri: \"https://github.com/getsentry/sentry-ai-rules/blob/main/api/query-syntax.mdc\",\n mimeType: \"text/plain\",\n description:\n \"Use these rules to understand common query parameters when searching Sentry for information.\",\n handler: defaultGitHubHandler,\n } as UriResourceConfig,\n // Platform documentation with dynamic segments\n {\n name: \"sentry-docs-platform\",\n template: new ResourceTemplate(\n \"https://docs.sentry.io/platforms/{platform}/\",\n {\n list: async (_extra) => ({\n resources: SENTRY_PLATFORMS_BASE.map((platform) => ({\n uri: `https://docs.sentry.io/platforms/${platform}/`,\n name: `${platform}-docs`,\n description: `Sentry SDK documentation for ${platform}`,\n mimeType: \"text/markdown\",\n })),\n }),\n },\n ),\n mimeType: \"text/markdown\",\n description: \"Sentry SDK documentation for {platform}\",\n handler: sentryDocsHandler,\n } as TemplateResourceConfig,\n {\n name: \"sentry-docs-platform-guide\",\n template: new ResourceTemplate(\n \"https://docs.sentry.io/platforms/{platform}/guides/{framework}/\",\n {\n list: async (_extra) => ({\n resources: Object.entries(SENTRY_FRAMEWORKS).flatMap(\n ([platform, frameworks]) =>\n frameworks.map((framework) => ({\n uri: `https://docs.sentry.io/platforms/${platform}/guides/${framework}/`,\n name: `${platform}-${framework}-guide`,\n description: `Sentry integration guide for ${framework} on ${platform}`,\n mimeType: \"text/markdown\",\n })),\n ),\n }),\n },\n ),\n mimeType: \"text/markdown\",\n description: \"Sentry integration guide for {framework} on {platform}\",\n handler: sentryDocsHandler,\n } as TemplateResourceConfig,\n];\n"],"mappings":";;;;;;;;AA2DA,SAAgB,mBACdA,UACoC;AACpC,QACE,cAAc,YAAY,SAAS,oBAAoB;AAE1D;;;;;AAMD,eAAe,sBAAsBC,SAAiB;CACpD,MAAM,OAAO,QAAQ,QAAQ,SAAS,GAAG;AAEzC,QAAO,OAAO,mCAAmC,OAAO,CAAC,KAAK,CAAC,QAC7D,IAAI,MAAM,CACX;AACF;;;;;AAMD,eAAe,qBACbC,KACAC,QAC6B;CAC7B,MAAM,MAAM,IAAI;CAChB,MAAM,UAAU,IAAI;CACpB,MAAM,UAAU,MAAM,sBAAsB,QAAQ;AACpD,QAAO,EACL,UAAU,CACR;EACO;EACL,UAAU;EACV,MAAM;CACP,CACF,EACF;AACF;;;;;;;;AASD,eAAe,kBACbD,KACAC,QAC6B;CAG7B,M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