@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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"analyze-issue-with-seer-Dw9iqvSk.cjs","names":["context: ServerContext","SEER_MAX_RETRIES","SEER_INITIAL_RETRY_DELAY","ApiError","SEER_TIMEOUT","SEER_POLLING_INTERVAL"],"sources":["../src/tools/analyze-issue-with-seer.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport { parseIssueParams } from \"./utils/issue-utils\";\nimport {\n getStatusDisplayName,\n isTerminalStatus,\n isHumanInterventionStatus,\n getHumanInterventionGuidance,\n getOutputForAutofixStep,\n SEER_POLLING_INTERVAL,\n SEER_TIMEOUT,\n SEER_MAX_RETRIES,\n SEER_INITIAL_RETRY_DELAY,\n} from \"./utils/seer-utils\";\nimport { retryWithBackoff } from \"../internal/fetch-utils\";\nimport type { ServerContext } from \"../types\";\nimport { ApiError } from \"../api-client/index\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamIssueShortId,\n ParamIssueUrl,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"analyze_issue_with_seer\",\n description: [\n \"Use Seer AI to analyze production errors and get detailed root cause analysis with specific code fixes.\",\n \"\",\n \"Use this tool when you need:\",\n \"- Detailed AI-powered root cause analysis\",\n \"- Specific code fixes and implementation guidance\",\n \"- Step-by-step troubleshooting for complex issues\",\n \"- Understanding why an error is happening in production\",\n \"\",\n \"What this tool provides:\",\n \"- Root cause analysis with code-level explanations\",\n \"- Specific file locations and line numbers where errors occur\",\n \"- Concrete code fixes you can apply\",\n \"- Step-by-step implementation guidance\",\n \"\",\n \"This tool automatically:\",\n \"1. Checks if analysis already exists (instant results)\",\n \"2. Starts new AI analysis if needed (~2-5 minutes)\",\n \"3. Returns complete fix recommendations\",\n \"\",\n \"<examples>\",\n '### User: \"What\\'s causing this error? https://my-org.sentry.io/issues/PROJECT-1Z43\"',\n \"\",\n \"```\",\n \"analyze_issue_with_seer(issueUrl='https://my-org.sentry.io/issues/PROJECT-1Z43')\",\n \"```\",\n \"\",\n '### User: \"Can you help me understand why this is failing in production?\"',\n \"\",\n \"```\",\n \"analyze_issue_with_seer(organizationSlug='my-organization', issueId='ERROR-456')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- Use this tool when you need deeper analysis beyond basic issue details\",\n \"- If the user provides an issueUrl, extract it and use that parameter alone\",\n \"- The analysis includes actual code snippets and fixes, not just error descriptions\",\n \"- Results are cached - subsequent calls return instantly\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n issueId: ParamIssueShortId.optional(),\n issueUrl: ParamIssueUrl.optional(),\n instruction: z\n .string()\n .describe(\"Optional custom instruction for the AI analysis\")\n .optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\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 let output = `# Seer AI Analysis for Issue ${parsedIssueId}\\n\\n`;\n\n // Step 1: Check if analysis already exists\n let autofixState = await retryWithBackoff(\n () =>\n apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n }),\n {\n maxRetries: SEER_MAX_RETRIES,\n initialDelay: SEER_INITIAL_RETRY_DELAY,\n shouldRetry: (error) => {\n // Retry on network errors or 5xx errors\n if (error instanceof ApiError) {\n return error.status >= 500;\n }\n // Retry on network/connection errors\n return true;\n },\n },\n );\n\n // Step 2: Start analysis if none exists\n if (!autofixState.autofix) {\n output += `Starting new analysis...\\n\\n`;\n const startResult = await apiService.startAutofix({\n organizationSlug: orgSlug,\n issueId: parsedIssueId,\n instruction: params.instruction,\n });\n output += `Analysis started with Run ID: ${startResult.run_id}\\n\\n`;\n\n // Give it a moment to initialize\n await new Promise((resolve) => setTimeout(resolve, 1000));\n\n // Refresh state with retry logic\n autofixState = await retryWithBackoff(\n () =>\n apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n }),\n {\n maxRetries: SEER_MAX_RETRIES,\n initialDelay: SEER_INITIAL_RETRY_DELAY,\n shouldRetry: (error) => {\n if (error instanceof ApiError) {\n return error.status >= 500;\n }\n return true;\n },\n },\n );\n } else {\n output += `Found existing analysis (Run ID: ${autofixState.autofix.run_id})\\n\\n`;\n\n // Check if existing analysis is already complete\n const existingStatus = autofixState.autofix.status;\n if (isTerminalStatus(existingStatus)) {\n // Return results immediately, no polling needed\n output += `## Analysis ${getStatusDisplayName(existingStatus)}\\n\\n`;\n\n for (const step of autofixState.autofix.steps) {\n output += getOutputForAutofixStep(step);\n output += \"\\n\";\n }\n\n if (existingStatus !== \"COMPLETED\") {\n output += `\\n**Status**: ${existingStatus}\\n`;\n output += getHumanInterventionGuidance(existingStatus);\n output += \"\\n\";\n }\n\n return output;\n }\n }\n\n // Step 3: Poll until complete or timeout (only for non-terminal states)\n const startTime = Date.now();\n let lastStatus = \"\";\n let consecutiveErrors = 0;\n\n while (Date.now() - startTime < SEER_TIMEOUT) {\n if (!autofixState.autofix) {\n output += `Error: Analysis state lost. Please try again by running:\\n`;\n output += `\\`\\`\\`\\n`;\n output += params.issueUrl\n ? `analyze_issue_with_seer(issueUrl=\"${params.issueUrl}\")`\n : `analyze_issue_with_seer(organizationSlug=\"${orgSlug}\", issueId=\"${parsedIssueId}\")`;\n output += `\\n\\`\\`\\`\\n`;\n return output;\n }\n\n const status = autofixState.autofix.status;\n\n // Check if completed (terminal state)\n if (isTerminalStatus(status)) {\n output += `## Analysis ${getStatusDisplayName(status)}\\n\\n`;\n\n // Add all step outputs\n for (const step of autofixState.autofix.steps) {\n output += getOutputForAutofixStep(step);\n output += \"\\n\";\n }\n\n if (status !== \"COMPLETED\") {\n output += `\\n**Status**: ${status}\\n`;\n output += getHumanInterventionGuidance(status);\n }\n\n return output;\n }\n\n // Update status if changed\n if (status !== lastStatus) {\n const activeStep = autofixState.autofix.steps.find(\n (step) =>\n step.status === \"PROCESSING\" || step.status === \"IN_PROGRESS\",\n );\n if (activeStep) {\n output += `Processing: ${activeStep.title}...\\n`;\n }\n lastStatus = status;\n }\n\n // Wait before next poll\n await new Promise((resolve) =>\n setTimeout(resolve, SEER_POLLING_INTERVAL),\n );\n\n // Refresh state with error handling\n try {\n autofixState = await retryWithBackoff(\n () =>\n apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n }),\n {\n maxRetries: SEER_MAX_RETRIES,\n initialDelay: SEER_INITIAL_RETRY_DELAY,\n shouldRetry: (error) => {\n if (error instanceof ApiError) {\n return error.status >= 500;\n }\n return true;\n },\n },\n );\n consecutiveErrors = 0; // Reset error counter on success\n } catch (error) {\n consecutiveErrors++;\n\n // If we've had too many consecutive errors, give up\n if (consecutiveErrors >= 3) {\n output += `\\n## Error During Analysis\\n\\n`;\n output += `Unable to retrieve analysis status after multiple attempts.\\n`;\n output += `Error: ${error instanceof Error ? error.message : String(error)}\\n\\n`;\n output += `You can check the status later by running the same command again:\\n`;\n output += `\\`\\`\\`\\n`;\n output += params.issueUrl\n ? `analyze_issue_with_seer(issueUrl=\"${params.issueUrl}\")`\n : `analyze_issue_with_seer(organizationSlug=\"${orgSlug}\", issueId=\"${parsedIssueId}\")`;\n output += `\\n\\`\\`\\`\\n`;\n return output;\n }\n\n // Log the error but continue polling\n output += `Temporary error retrieving status (attempt ${consecutiveErrors}/3), retrying...\\n`;\n }\n }\n\n // Show current progress\n if (autofixState.autofix) {\n output += `**Current Status**: ${getStatusDisplayName(autofixState.autofix.status)}\\n\\n`;\n for (const step of autofixState.autofix.steps) {\n output += getOutputForAutofixStep(step);\n output += \"\\n\";\n }\n }\n\n // Timeout reached\n output += `\\n## Analysis Timed Out\\n\\n`;\n output += `The analysis is taking longer than expected (>${SEER_TIMEOUT / 1000}s).\\n\\n`;\n\n output += `\\nYou can check the status later by running the same command again:\\n`;\n output += `\\`\\`\\`\\n`;\n output += params.issueUrl\n ? `analyze_issue_with_seer(issueUrl=\"${params.issueUrl}\")`\n : `analyze_issue_with_seer(organizationSlug=\"${orgSlug}\", issueId=\"${parsedIssueId}\")`;\n output += `\\n\\`\\`\\`\\n`;\n\n return output;\n },\n});\n"],"mappings":";;;;;;;;;;;;AA0BA,sCAAe,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;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,UAAU,6BAAc,UAAU;EAClC,aAAa,MACV,QAAQ,CACR,SAAS,kDAAkD,CAC3D,UAAU;CACd;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,wCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,EAAE,kBAAkB,SAAS,SAAS,eAAe,GACzD,uCAAiB;GACf,kBAAkB,OAAO;GACzB,SAAS,OAAO;GAChB,UAAU,OAAO;EAClB,EAAC;AAEJ,4BAAO,qBAAqB,QAAQ;EAEpC,IAAI,UAAU,+BAA+B,cAAc;EAG3D,IAAI,eAAe,MAAM,qCACvB,MACE,WAAW,gBAAgB;GACzB,kBAAkB;GAClB,SAAS;EACV,EAAC,EACJ;GACE,YAAYC;GACZ,cAAcC;GACd,aAAa,CAAC,UAAU;AAEtB,QAAI,iBAAiBC,wBACnB,QAAO,MAAM,UAAU;AAGzB,WAAO;GACR;EACF,EACF;AAGD,OAAK,aAAa,SAAS;AACzB,cAAW;GACX,MAAM,cAAc,MAAM,WAAW,aAAa;IAChD,kBAAkB;IAClB,SAAS;IACT,aAAa,OAAO;GACrB,EAAC;AACF,cAAW,gCAAgC,YAAY,OAAO;AAG9D,SAAM,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,IAAK;AAGxD,kBAAe,MAAM,qCACnB,MACE,WAAW,gBAAgB;IACzB,kBAAkB;IAClB,SAAS;GACV,EAAC,EACJ;IACE,YAAYF;IACZ,cAAcC;IACd,aAAa,CAAC,UAAU;AACtB,SAAI,iBAAiBC,wBACnB,QAAO,MAAM,UAAU;AAEzB,YAAO;IACR;GACF,EACF;EACF,OAAM;AACL,cAAW,mCAAmC,aAAa,QAAQ,OAAO;GAG1E,MAAM,iBAAiB,aAAa,QAAQ;AAC5C,OAAI,oCAAiB,eAAe,EAAE;AAEpC,eAAW,cAAc,wCAAqB,eAAe,CAAC;AAE9D,SAAK,MAAM,QAAQ,aAAa,QAAQ,OAAO;AAC7C,eAAU,2CAAwB,KAAK;AACvC,eAAU;IACX;AAED,QAAI,mBAAmB,aAAa;AAClC,gBAAW,gBAAgB,eAAe;AAC1C,eAAU,gDAA6B,eAAe;AACtD,eAAU;IACX;AAED,WAAO;GACR;EACF;EAGD,MAAM,YAAY,KAAK,KAAK;EAC5B,IAAI,aAAa;EACjB,IAAI,oBAAoB;AAExB,SAAO,KAAK,KAAK,GAAG,YAAYC,iCAAc;AAC5C,QAAK,aAAa,SAAS;AACzB,eAAW;AACX,eAAW;AACX,cAAU,OAAO,YACZ,oCAAoC,OAAO,SAAS,OACpD,4CAA4C,QAAQ,cAAc,cAAc;AACrF,eAAW;AACX,WAAO;GACR;GAED,MAAM,SAAS,aAAa,QAAQ;AAGpC,OAAI,oCAAiB,OAAO,EAAE;AAC5B,eAAW,cAAc,wCAAqB,OAAO,CAAC;AAGtD,SAAK,MAAM,QAAQ,aAAa,QAAQ,OAAO;AAC7C,eAAU,2CAAwB,KAAK;AACvC,eAAU;IACX;AAED,QAAI,WAAW,aAAa;AAC1B,gBAAW,gBAAgB,OAAO;AAClC,eAAU,gDAA6B,OAAO;IAC/C;AAED,WAAO;GACR;AAGD,OAAI,WAAW,YAAY;IACzB,MAAM,aAAa,aAAa,QAAQ,MAAM,KAC5C,CAAC,SACC,KAAK,WAAW,gBAAgB,KAAK,WAAW,cACnD;AACD,QAAI,WACF,YAAW,cAAc,WAAW,MAAM;AAE5C,iBAAa;GACd;AAGD,SAAM,IAAI,QAAQ,CAAC,YACjB,WAAW,SAASC,yCAAsB;AAI5C,OAAI;AACF,mBAAe,MAAM,qCACnB,MACE,WAAW,gBAAgB;KACzB,kBAAkB;KAClB,SAAS;IACV,EAAC,EACJ;KACE,YAAYJ;KACZ,cAAcC;KACd,aAAa,CAAC,UAAU;AACtB,UAAI,iBAAiBC,wBACnB,QAAO,MAAM,UAAU;AAEzB,aAAO;KACR;IACF,EACF;AACD,wBAAoB;GACrB,SAAQ,OAAO;AACd;AAGA,QAAI,qBAAqB,GAAG;AAC1B,gBAAW;AACX,gBAAW;AACX,gBAAW,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CAAC;AAC3E,gBAAW;AACX,gBAAW;AACX,eAAU,OAAO,YACZ,oCAAoC,OAAO,SAAS,OACpD,4CAA4C,QAAQ,cAAc,cAAc;AACrF,gBAAW;AACX,YAAO;IACR;AAGD,eAAW,6CAA6C,kBAAkB;GAC3E;EACF;AAGD,MAAI,aAAa,SAAS;AACxB,cAAW,sBAAsB,wCAAqB,aAAa,QAAQ,OAAO,CAAC;AACnF,QAAK,MAAM,QAAQ,aAAa,QAAQ,OAAO;AAC7C,cAAU,2CAAwB,KAAK;AACvC,cAAU;GACX;EACF;AAGD,aAAW;AACX,aAAW,gDAAgDC,kCAAe,IAAK;AAE/E,aAAW;AACX,aAAW;AACX,YAAU,OAAO,YACZ,oCAAoC,OAAO,SAAS,OACpD,4CAA4C,QAAQ,cAAc,cAAc;AACrF,aAAW;AAEX,SAAO;CACR;AACF,EAAC"}
@@ -1,5 +1,7 @@
1
- require('../schema-B_cMyyJJ.cjs');
2
- const require_client = require('../client-Dkw5iYu3.cjs');
1
+ require('../errors-BtJEw2Z-.cjs');
2
+ require('../url-utils-vJo2ER5v.cjs');
3
+ require('../schema-C0LznFvu.cjs');
4
+ const require_client = require('../client-CPrEfAwa.cjs');
3
5
 
4
6
  exports.ApiError = require_client.ApiError;
5
7
  exports.SentryApiService = require_client.SentryApiService;
@@ -1,4 +1,4 @@
1
- import "../schema-3NeMWRAm.cjs";
2
- import "../types-BoMP-Ro6.cjs";
3
- import { ApiError, SentryApiService } from "../client-CQ9Xe1aN.cjs";
1
+ import "../schema-CdDcpvrp.cjs";
2
+ import "../types-BYtO24VE.cjs";
3
+ import { ApiError, SentryApiService } from "../client-CgS3tjJG.cjs";
4
4
  export { ApiError, SentryApiService };
@@ -1,4 +1,4 @@
1
- import "../schema-B3CzDGJk.js";
2
- import "../types-DpV1JAZj.js";
3
- import { ApiError, SentryApiService } from "../client-VCJp6Kcu.js";
1
+ import "../schema-BlkWypl3.js";
2
+ import "../types-B-8S69No.js";
3
+ import { ApiError, SentryApiService } from "../client-C_dDreKj.js";
4
4
  export { ApiError, SentryApiService };
@@ -1,4 +1,6 @@
1
- import "../schema-WDk5Yqww.js";
2
- import { ApiError, SentryApiService } from "../client-DOYWNvVM.js";
1
+ import "../errors-D_R568zP.js";
2
+ import "../url-utils-IqgSmI-B.js";
3
+ import "../schema-CcFmBoEf.js";
4
+ import { ApiError, SentryApiService } from "../client-MaVV1gVC.js";
3
5
 
4
6
  export { ApiError, SentryApiService };
@@ -1,7 +1,9 @@
1
- const require_schema = require('../schema-B_cMyyJJ.cjs');
2
- const require_client = require('../client-Dkw5iYu3.cjs');
3
- require('../types-MYBaygjr.cjs');
4
- require('../api-client-CL1WDkw9.cjs');
1
+ require('../errors-BtJEw2Z-.cjs');
2
+ require('../url-utils-vJo2ER5v.cjs');
3
+ const require_schema = require('../schema-C0LznFvu.cjs');
4
+ const require_client = require('../client-CPrEfAwa.cjs');
5
+ require('../types-DdloOYgD.cjs');
6
+ require('../api-client-BWt6M7ij.cjs');
5
7
 
6
8
  exports.ApiError = require_client.ApiError;
7
9
  exports.ApiErrorSchema = require_schema.ApiErrorSchema;
@@ -1,5 +1,5 @@
1
- import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-3NeMWRAm.cjs";
2
- import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-BoMP-Ro6.cjs";
3
- import { ApiError, SentryApiService } from "../client-CQ9Xe1aN.cjs";
1
+ import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-CdDcpvrp.cjs";
2
+ import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-BYtO24VE.cjs";
3
+ import { ApiError, SentryApiService } from "../client-CgS3tjJG.cjs";
4
4
  import "../index-BPSCxsMC.cjs";
5
5
  export { ApiError, ApiErrorSchema, AssignedTo, AssignedToSchema, AutofixRun, AutofixRunSchema, AutofixRunState, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKey, ClientKeyList, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, Event, EventAttachment, EventAttachmentList, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, Issue, IssueList, IssueListSchema, IssueSchema, MessageEntrySchema, Organization, OrganizationList, OrganizationListSchema, OrganizationSchema, Project, ProjectList, ProjectListSchema, ProjectSchema, Release, ReleaseList, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SentryApiService, SpansSearchResponseSchema, Tag, TagList, TagListSchema, TagSchema, Team, TeamList, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, User, UserRegionsSchema, UserSchema };
@@ -1,5 +1,5 @@
1
- import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-B3CzDGJk.js";
2
- import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-DpV1JAZj.js";
3
- import { ApiError, SentryApiService } from "../client-VCJp6Kcu.js";
4
- import "../index-DVGDAddE.js";
1
+ import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-BlkWypl3.js";
2
+ import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-B-8S69No.js";
3
+ import { ApiError, SentryApiService } from "../client-C_dDreKj.js";
4
+ import "../index-DE1muTvw.js";
5
5
  export { ApiError, ApiErrorSchema, AssignedTo, AssignedToSchema, AutofixRun, AutofixRunSchema, AutofixRunState, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKey, ClientKeyList, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, Event, EventAttachment, EventAttachmentList, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, Issue, IssueList, IssueListSchema, IssueSchema, MessageEntrySchema, Organization, OrganizationList, OrganizationListSchema, OrganizationSchema, Project, ProjectList, ProjectListSchema, ProjectSchema, Release, ReleaseList, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SentryApiService, SpansSearchResponseSchema, Tag, TagList, TagListSchema, TagSchema, Team, TeamList, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, User, UserRegionsSchema, UserSchema };
@@ -1,6 +1,8 @@
1
- import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-WDk5Yqww.js";
2
- import { ApiError, SentryApiService } from "../client-DOYWNvVM.js";
3
- import "../types-CCHsZshF.js";
4
- import "../api-client-ChL_0F2u.js";
1
+ import "../errors-D_R568zP.js";
2
+ import "../url-utils-IqgSmI-B.js";
3
+ import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-CcFmBoEf.js";
4
+ import { ApiError, SentryApiService } from "../client-MaVV1gVC.js";
5
+ import "../types-6zHoEWAx.js";
6
+ import "../api-client-CNv_hbPO.js";
5
7
 
6
8
  export { ApiError, ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SentryApiService, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema };
@@ -1,4 +1,4 @@
1
- const require_schema = require('../schema-B_cMyyJJ.cjs');
1
+ const require_schema = require('../schema-C0LznFvu.cjs');
2
2
 
3
3
  exports.ApiErrorSchema = require_schema.ApiErrorSchema;
4
4
  exports.AssignedToSchema = require_schema.AssignedToSchema;
@@ -1,2 +1,2 @@
1
- import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-3NeMWRAm.cjs";
1
+ import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-CdDcpvrp.cjs";
2
2
  export { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema };
@@ -1,2 +1,2 @@
1
- import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-B3CzDGJk.js";
1
+ import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-BlkWypl3.js";
2
2
  export { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema };
@@ -1,3 +1,3 @@
1
- import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-WDk5Yqww.js";
1
+ import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-CcFmBoEf.js";
2
2
 
3
3
  export { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema };
@@ -1 +1 @@
1
- require('../types-MYBaygjr.cjs');
1
+ require('../types-DdloOYgD.cjs');
@@ -1,3 +1,3 @@
1
- import "../schema-3NeMWRAm.cjs";
2
- import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-BoMP-Ro6.cjs";
1
+ import "../schema-CdDcpvrp.cjs";
2
+ import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-BYtO24VE.cjs";
3
3
  export { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User };
@@ -1,3 +1,3 @@
1
- import "../schema-B3CzDGJk.js";
2
- import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-DpV1JAZj.js";
1
+ import "../schema-BlkWypl3.js";
2
+ import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-B-8S69No.js";
3
3
  export { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User };
@@ -1 +1 @@
1
- import "../types-CCHsZshF.js";
1
+ import "../types-6zHoEWAx.js";
@@ -0,0 +1,68 @@
1
+ import { UserInputError } from "./errors-D_R568zP.js";
2
+ import { ApiError, SentryApiService } from "./client-MaVV1gVC.js";
3
+
4
+ //#region src/tools/utils/api-utils.ts
5
+ /**
6
+ * Create a Sentry API service from server context with optional region override
7
+ * @param context - Server context containing host and access token
8
+ * @param opts - Options object containing optional regionUrl override
9
+ * @returns Configured SentryApiService instance (always uses HTTPS)
10
+ * @throws {UserInputError} When regionUrl is provided but invalid
11
+ */
12
+ function apiServiceFromContext(context, opts = {}) {
13
+ let host = context.sentryHost;
14
+ if (opts.regionUrl?.trim()) try {
15
+ const parsedUrl = new URL(opts.regionUrl);
16
+ if (!["http:", "https:"].includes(parsedUrl.protocol)) throw new UserInputError(`Invalid regionUrl provided: ${opts.regionUrl}. Must include protocol (http:// or https://).`);
17
+ if (parsedUrl.host === "https" || parsedUrl.host === "http") throw new UserInputError(`Invalid regionUrl provided: ${opts.regionUrl}. The host cannot be just a protocol name.`);
18
+ host = parsedUrl.host;
19
+ } catch (error) {
20
+ if (error instanceof UserInputError) throw error;
21
+ throw new UserInputError(`Invalid regionUrl provided: ${opts.regionUrl}. Must be a valid URL.`);
22
+ }
23
+ return new SentryApiService({
24
+ host,
25
+ accessToken: context.accessToken
26
+ });
27
+ }
28
+ /**
29
+ * Maps API errors to user-friendly errors based on context
30
+ * @param error - The error to handle
31
+ * @param params - The parameters that were used in the API call
32
+ * @returns Never - always throws an error
33
+ * @throws {UserInputError} For 4xx errors that are likely user input issues
34
+ * @throws {Error} For other errors
35
+ */
36
+ function handleApiError(error, params) {
37
+ if (error instanceof ApiError) {
38
+ if (error.status >= 400 && error.status < 500) {
39
+ let message = `API error (${error.status}): ${error.message}`;
40
+ if (error.status === 404 && params) {
41
+ const paramsList = [];
42
+ for (const [key, value] of Object.entries(params)) if (value !== void 0 && value !== null && value !== "") paramsList.push(`${key}: '${value}'`);
43
+ if (paramsList.length > 0) message = `Resource not found (404): ${error.message}\nPlease verify these parameters are correct:\n${paramsList.map((p) => ` - ${p}`).join("\n")}`;
44
+ }
45
+ throw new UserInputError(message, { cause: error });
46
+ }
47
+ }
48
+ throw error;
49
+ }
50
+ /**
51
+ * Wraps an async API call with automatic error handling
52
+ * @param fn - The async function to execute
53
+ * @param params - The parameters that were used in the API call
54
+ * @returns The result of the function
55
+ * @throws {UserInputError} For user input errors
56
+ * @throws {Error} For other errors
57
+ */
58
+ async function withApiErrorHandling(fn, params) {
59
+ try {
60
+ return await fn();
61
+ } catch (error) {
62
+ handleApiError(error, params);
63
+ }
64
+ }
65
+
66
+ //#endregion
67
+ export { apiServiceFromContext, handleApiError, withApiErrorHandling };
68
+ //# sourceMappingURL=api-utils-BlUSO8xh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-utils-BlUSO8xh.js","names":["context: ServerContext","opts: { regionUrl?: string }","error: unknown","params?: Record<string, unknown>","paramsList: string[]","fn: () => Promise<T>"],"sources":["../src/tools/utils/api-utils.ts"],"sourcesContent":["import { SentryApiService, ApiError } from \"../../api-client/index\";\nimport { UserInputError } from \"../../errors\";\nimport type { ServerContext } from \"../../types\";\n\n/**\n * Create a Sentry API service from server context with optional region override\n * @param context - Server context containing host and access token\n * @param opts - Options object containing optional regionUrl override\n * @returns Configured SentryApiService instance (always uses HTTPS)\n * @throws {UserInputError} When regionUrl is provided but invalid\n */\nexport function apiServiceFromContext(\n context: ServerContext,\n opts: { regionUrl?: string } = {},\n) {\n let host = context.sentryHost;\n\n if (opts.regionUrl?.trim()) {\n try {\n const parsedUrl = new URL(opts.regionUrl);\n\n // Validate that the URL has a proper protocol\n if (![\"http:\", \"https:\"].includes(parsedUrl.protocol)) {\n throw new UserInputError(\n `Invalid regionUrl provided: ${opts.regionUrl}. Must include protocol (http:// or https://).`,\n );\n }\n\n // Validate that the host is not just the protocol name\n if (parsedUrl.host === \"https\" || parsedUrl.host === \"http\") {\n throw new UserInputError(\n `Invalid regionUrl provided: ${opts.regionUrl}. The host cannot be just a protocol name.`,\n );\n }\n\n host = parsedUrl.host;\n } catch (error) {\n if (error instanceof UserInputError) {\n throw error;\n }\n throw new UserInputError(\n `Invalid regionUrl provided: ${opts.regionUrl}. Must be a valid URL.`,\n );\n }\n }\n\n return new SentryApiService({\n host,\n accessToken: context.accessToken,\n });\n}\n\n/**\n * Maps API errors to user-friendly errors based on context\n * @param error - The error to handle\n * @param params - The parameters that were used in the API call\n * @returns Never - always throws an error\n * @throws {UserInputError} For 4xx errors that are likely user input issues\n * @throws {Error} For other errors\n */\nexport function handleApiError(\n error: unknown,\n params?: Record<string, unknown>,\n): never {\n if (error instanceof ApiError) {\n // For 4xx errors, convert to UserInputError with status code in message\n // This provides agents with the specific error type while using the appropriate error class\n if (error.status >= 400 && error.status < 500) {\n let message = `API error (${error.status}): ${error.message}`;\n\n // For 404s, add helpful context about parameters if available\n if (error.status === 404 && params) {\n const paramsList: string[] = [];\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined && value !== null && value !== \"\") {\n paramsList.push(`${key}: '${value}'`);\n }\n }\n\n if (paramsList.length > 0) {\n message = `Resource not found (404): ${error.message}\\nPlease verify these parameters are correct:\\n${paramsList.map((p) => ` - ${p}`).join(\"\\n\")}`;\n }\n }\n\n throw new UserInputError(message, { cause: error });\n }\n }\n\n // Re-throw any other errors as-is (including 5xx server errors)\n throw error;\n}\n\n/**\n * Wraps an async API call with automatic error handling\n * @param fn - The async function to execute\n * @param params - The parameters that were used in the API call\n * @returns The result of the function\n * @throws {UserInputError} For user input errors\n * @throws {Error} For other errors\n */\nexport async function withApiErrorHandling<T>(\n fn: () => Promise<T>,\n params?: Record<string, unknown>,\n): Promise<T> {\n try {\n return await fn();\n } catch (error) {\n handleApiError(error, params);\n }\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,sBACdA,SACAC,OAA+B,CAAE,GACjC;CACA,IAAI,OAAO,QAAQ;AAEnB,KAAI,KAAK,WAAW,MAAM,CACxB,KAAI;EACF,MAAM,YAAY,IAAI,IAAI,KAAK;AAG/B,OAAK,CAAC,SAAS,QAAS,EAAC,SAAS,UAAU,SAAS,CACnD,OAAM,IAAI,gBACP,8BAA8B,KAAK,UAAU;AAKlD,MAAI,UAAU,SAAS,WAAW,UAAU,SAAS,OACnD,OAAM,IAAI,gBACP,8BAA8B,KAAK,UAAU;AAIlD,SAAO,UAAU;CAClB,SAAQ,OAAO;AACd,MAAI,iBAAiB,eACnB,OAAM;AAER,QAAM,IAAI,gBACP,8BAA8B,KAAK,UAAU;CAEjD;AAGH,QAAO,IAAI,iBAAiB;EAC1B;EACA,aAAa,QAAQ;CACtB;AACF;;;;;;;;;AAUD,SAAgB,eACdC,OACAC,QACO;AACP,KAAI,iBAAiB,UAGnB;MAAI,MAAM,UAAU,OAAO,MAAM,SAAS,KAAK;GAC7C,IAAI,WAAW,aAAa,MAAM,OAAO,KAAK,MAAM;AAGpD,OAAI,MAAM,WAAW,OAAO,QAAQ;IAClC,MAAMC,aAAuB,CAAE;AAC/B,SAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,OAAO,CAC/C,KAAI,oBAAuB,UAAU,QAAQ,UAAU,GACrD,YAAW,QAAQ,IAAI,KAAK,MAAM,GAAG;AAIzC,QAAI,WAAW,SAAS,EACtB,YAAW,4BAA4B,MAAM,QAAQ,iDAAiD,WAAW,IAAI,CAAC,OAAO,MAAM,IAAI,CAAC,KAAK,KAAK;GAErJ;AAED,SAAM,IAAI,eAAe,SAAS,EAAE,OAAO,MAAO;EACnD;;AAIH,OAAM;AACP;;;;;;;;;AAUD,eAAsB,qBACpBC,IACAF,QACY;AACZ,KAAI;AACF,SAAO,MAAM,IAAI;CAClB,SAAQ,OAAO;AACd,iBAAe,OAAO,OAAO;CAC9B;AACF"}
@@ -0,0 +1,85 @@
1
+ const require_errors = require('./errors-BtJEw2Z-.cjs');
2
+ const require_client = require('./client-CPrEfAwa.cjs');
3
+
4
+ //#region src/tools/utils/api-utils.ts
5
+ /**
6
+ * Create a Sentry API service from server context with optional region override
7
+ * @param context - Server context containing host and access token
8
+ * @param opts - Options object containing optional regionUrl override
9
+ * @returns Configured SentryApiService instance (always uses HTTPS)
10
+ * @throws {UserInputError} When regionUrl is provided but invalid
11
+ */
12
+ function apiServiceFromContext(context, opts = {}) {
13
+ let host = context.sentryHost;
14
+ if (opts.regionUrl?.trim()) try {
15
+ const parsedUrl = new URL(opts.regionUrl);
16
+ if (!["http:", "https:"].includes(parsedUrl.protocol)) throw new require_errors.UserInputError(`Invalid regionUrl provided: ${opts.regionUrl}. Must include protocol (http:// or https://).`);
17
+ if (parsedUrl.host === "https" || parsedUrl.host === "http") throw new require_errors.UserInputError(`Invalid regionUrl provided: ${opts.regionUrl}. The host cannot be just a protocol name.`);
18
+ host = parsedUrl.host;
19
+ } catch (error) {
20
+ if (error instanceof require_errors.UserInputError) throw error;
21
+ throw new require_errors.UserInputError(`Invalid regionUrl provided: ${opts.regionUrl}. Must be a valid URL.`);
22
+ }
23
+ return new require_client.SentryApiService({
24
+ host,
25
+ accessToken: context.accessToken
26
+ });
27
+ }
28
+ /**
29
+ * Maps API errors to user-friendly errors based on context
30
+ * @param error - The error to handle
31
+ * @param params - The parameters that were used in the API call
32
+ * @returns Never - always throws an error
33
+ * @throws {UserInputError} For 4xx errors that are likely user input issues
34
+ * @throws {Error} For other errors
35
+ */
36
+ function handleApiError(error, params) {
37
+ if (error instanceof require_client.ApiError) {
38
+ if (error.status >= 400 && error.status < 500) {
39
+ let message = `API error (${error.status}): ${error.message}`;
40
+ if (error.status === 404 && params) {
41
+ const paramsList = [];
42
+ for (const [key, value] of Object.entries(params)) if (value !== void 0 && value !== null && value !== "") paramsList.push(`${key}: '${value}'`);
43
+ if (paramsList.length > 0) message = `Resource not found (404): ${error.message}\nPlease verify these parameters are correct:\n${paramsList.map((p) => ` - ${p}`).join("\n")}`;
44
+ }
45
+ throw new require_errors.UserInputError(message, { cause: error });
46
+ }
47
+ }
48
+ throw error;
49
+ }
50
+ /**
51
+ * Wraps an async API call with automatic error handling
52
+ * @param fn - The async function to execute
53
+ * @param params - The parameters that were used in the API call
54
+ * @returns The result of the function
55
+ * @throws {UserInputError} For user input errors
56
+ * @throws {Error} For other errors
57
+ */
58
+ async function withApiErrorHandling(fn, params) {
59
+ try {
60
+ return await fn();
61
+ } catch (error) {
62
+ handleApiError(error, params);
63
+ }
64
+ }
65
+
66
+ //#endregion
67
+ Object.defineProperty(exports, 'apiServiceFromContext', {
68
+ enumerable: true,
69
+ get: function () {
70
+ return apiServiceFromContext;
71
+ }
72
+ });
73
+ Object.defineProperty(exports, 'handleApiError', {
74
+ enumerable: true,
75
+ get: function () {
76
+ return handleApiError;
77
+ }
78
+ });
79
+ Object.defineProperty(exports, 'withApiErrorHandling', {
80
+ enumerable: true,
81
+ get: function () {
82
+ return withApiErrorHandling;
83
+ }
84
+ });
85
+ //# sourceMappingURL=api-utils-DFWUfQ83.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api-utils-DFWUfQ83.cjs","names":["context: ServerContext","opts: { regionUrl?: string }","UserInputError","SentryApiService","error: unknown","params?: Record<string, unknown>","ApiError","paramsList: string[]","fn: () => Promise<T>"],"sources":["../src/tools/utils/api-utils.ts"],"sourcesContent":["import { SentryApiService, ApiError } from \"../../api-client/index\";\nimport { UserInputError } from \"../../errors\";\nimport type { ServerContext } from \"../../types\";\n\n/**\n * Create a Sentry API service from server context with optional region override\n * @param context - Server context containing host and access token\n * @param opts - Options object containing optional regionUrl override\n * @returns Configured SentryApiService instance (always uses HTTPS)\n * @throws {UserInputError} When regionUrl is provided but invalid\n */\nexport function apiServiceFromContext(\n context: ServerContext,\n opts: { regionUrl?: string } = {},\n) {\n let host = context.sentryHost;\n\n if (opts.regionUrl?.trim()) {\n try {\n const parsedUrl = new URL(opts.regionUrl);\n\n // Validate that the URL has a proper protocol\n if (![\"http:\", \"https:\"].includes(parsedUrl.protocol)) {\n throw new UserInputError(\n `Invalid regionUrl provided: ${opts.regionUrl}. Must include protocol (http:// or https://).`,\n );\n }\n\n // Validate that the host is not just the protocol name\n if (parsedUrl.host === \"https\" || parsedUrl.host === \"http\") {\n throw new UserInputError(\n `Invalid regionUrl provided: ${opts.regionUrl}. The host cannot be just a protocol name.`,\n );\n }\n\n host = parsedUrl.host;\n } catch (error) {\n if (error instanceof UserInputError) {\n throw error;\n }\n throw new UserInputError(\n `Invalid regionUrl provided: ${opts.regionUrl}. Must be a valid URL.`,\n );\n }\n }\n\n return new SentryApiService({\n host,\n accessToken: context.accessToken,\n });\n}\n\n/**\n * Maps API errors to user-friendly errors based on context\n * @param error - The error to handle\n * @param params - The parameters that were used in the API call\n * @returns Never - always throws an error\n * @throws {UserInputError} For 4xx errors that are likely user input issues\n * @throws {Error} For other errors\n */\nexport function handleApiError(\n error: unknown,\n params?: Record<string, unknown>,\n): never {\n if (error instanceof ApiError) {\n // For 4xx errors, convert to UserInputError with status code in message\n // This provides agents with the specific error type while using the appropriate error class\n if (error.status >= 400 && error.status < 500) {\n let message = `API error (${error.status}): ${error.message}`;\n\n // For 404s, add helpful context about parameters if available\n if (error.status === 404 && params) {\n const paramsList: string[] = [];\n for (const [key, value] of Object.entries(params)) {\n if (value !== undefined && value !== null && value !== \"\") {\n paramsList.push(`${key}: '${value}'`);\n }\n }\n\n if (paramsList.length > 0) {\n message = `Resource not found (404): ${error.message}\\nPlease verify these parameters are correct:\\n${paramsList.map((p) => ` - ${p}`).join(\"\\n\")}`;\n }\n }\n\n throw new UserInputError(message, { cause: error });\n }\n }\n\n // Re-throw any other errors as-is (including 5xx server errors)\n throw error;\n}\n\n/**\n * Wraps an async API call with automatic error handling\n * @param fn - The async function to execute\n * @param params - The parameters that were used in the API call\n * @returns The result of the function\n * @throws {UserInputError} For user input errors\n * @throws {Error} For other errors\n */\nexport async function withApiErrorHandling<T>(\n fn: () => Promise<T>,\n params?: Record<string, unknown>,\n): Promise<T> {\n try {\n return await fn();\n } catch (error) {\n handleApiError(error, params);\n }\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,sBACdA,SACAC,OAA+B,CAAE,GACjC;CACA,IAAI,OAAO,QAAQ;AAEnB,KAAI,KAAK,WAAW,MAAM,CACxB,KAAI;EACF,MAAM,YAAY,IAAI,IAAI,KAAK;AAG/B,OAAK,CAAC,SAAS,QAAS,EAAC,SAAS,UAAU,SAAS,CACnD,OAAM,IAAIC,+BACP,8BAA8B,KAAK,UAAU;AAKlD,MAAI,UAAU,SAAS,WAAW,UAAU,SAAS,OACnD,OAAM,IAAIA,+BACP,8BAA8B,KAAK,UAAU;AAIlD,SAAO,UAAU;CAClB,SAAQ,OAAO;AACd,MAAI,iBAAiBA,8BACnB,OAAM;AAER,QAAM,IAAIA,+BACP,8BAA8B,KAAK,UAAU;CAEjD;AAGH,QAAO,IAAIC,gCAAiB;EAC1B;EACA,aAAa,QAAQ;CACtB;AACF;;;;;;;;;AAUD,SAAgB,eACdC,OACAC,QACO;AACP,KAAI,iBAAiBC,yBAGnB;MAAI,MAAM,UAAU,OAAO,MAAM,SAAS,KAAK;GAC7C,IAAI,WAAW,aAAa,MAAM,OAAO,KAAK,MAAM;AAGpD,OAAI,MAAM,WAAW,OAAO,QAAQ;IAClC,MAAMC,aAAuB,CAAE;AAC/B,SAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,OAAO,CAC/C,KAAI,oBAAuB,UAAU,QAAQ,UAAU,GACrD,YAAW,QAAQ,IAAI,KAAK,MAAM,GAAG;AAIzC,QAAI,WAAW,SAAS,EACtB,YAAW,4BAA4B,MAAM,QAAQ,iDAAiD,WAAW,IAAI,CAAC,OAAO,MAAM,IAAI,CAAC,KAAK,KAAK;GAErJ;AAED,SAAM,IAAIL,8BAAe,SAAS,EAAE,OAAO,MAAO;EACnD;;AAIH,OAAM;AACP;;;;;;;;;AAUD,eAAsB,qBACpBM,IACAH,QACY;AACZ,KAAI;AACF,SAAO,MAAM,IAAI;CAClB,SAAQ,OAAO;AACd,iBAAe,OAAO,OAAO;CAC9B;AACF"}