@sentry/mcp-server 0.19.0 → 0.21.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 (813) hide show
  1. package/README.md +55 -27
  2. package/dist/agent-BIhLK0w6.d.ts +32 -0
  3. package/dist/agent-BIhLK0w6.d.ts.map +1 -0
  4. package/dist/{agent-BA98dlM7.d.cts → agent-BePwIb80.d.cts} +2 -2
  5. package/dist/{agent-BA98dlM7.d.cts.map → agent-BePwIb80.d.cts.map} +1 -1
  6. package/dist/{agent-CbJ6lvV3.cjs → agent-Bgg6nor6.cjs} +6 -6
  7. package/dist/{agent-CbJ6lvV3.cjs.map → agent-Bgg6nor6.cjs.map} +1 -1
  8. package/dist/{agent-DhHtOQmP.d.ts → agent-CaZRIfIM.d.ts} +2 -2
  9. package/dist/{agent-DhHtOQmP.d.ts.map → agent-CaZRIfIM.d.ts.map} +1 -1
  10. package/dist/{agent-D9DV11tZ.d.ts → agent-CuX9zpZq.d.ts} +2 -2
  11. package/dist/{agent-D9DV11tZ.d.ts.map → agent-CuX9zpZq.d.ts.map} +1 -1
  12. package/dist/agent-CvjnNjVl.js +29 -0
  13. package/dist/agent-CvjnNjVl.js.map +1 -0
  14. package/dist/{agent-BL7Xae0U.js → agent-CzjC0wP8.js} +7 -7
  15. package/dist/{agent-BL7Xae0U.js.map → agent-CzjC0wP8.js.map} +1 -1
  16. package/dist/{agent-D7MuFRwE.cjs → agent-DOraNng-.cjs} +7 -7
  17. package/dist/{agent-D7MuFRwE.cjs.map → agent-DOraNng-.cjs.map} +1 -1
  18. package/dist/{agent-ADO0sPxf.d.cts → agent-WO6BpLta.d.cts} +2 -2
  19. package/dist/{agent-ADO0sPxf.d.cts.map → agent-WO6BpLta.d.cts.map} +1 -1
  20. package/dist/agent-_VPpnFmn.d.cts +32 -0
  21. package/dist/agent-_VPpnFmn.d.cts.map +1 -0
  22. package/dist/agent-pad5p0Xr.cjs +35 -0
  23. package/dist/agent-pad5p0Xr.cjs.map +1 -0
  24. package/dist/{agent-DXya3Bcy.js → agent-vFXI2vu1.js} +6 -6
  25. package/dist/{agent-DXya3Bcy.js.map → agent-vFXI2vu1.js.map} +1 -1
  26. package/dist/{analyze-issue-with-seer-CI8pvCnf.cjs → analyze-issue-with-seer-DHxMOCaf.cjs} +10 -9
  27. package/dist/analyze-issue-with-seer-DHxMOCaf.cjs.map +1 -0
  28. package/dist/{analyze-issue-with-seer-DvuKEcbu.js → analyze-issue-with-seer-iXBAIlQL.js} +10 -9
  29. package/dist/analyze-issue-with-seer-iXBAIlQL.js.map +1 -0
  30. package/dist/{api-CZD9zwQ-.cjs → api-BkWv0o1h.cjs} +5 -5
  31. package/dist/{api-CZD9zwQ-.cjs.map → api-BkWv0o1h.cjs.map} +1 -1
  32. package/dist/{api-CkLTFexT.js → api-Cozv5F92.js} +5 -5
  33. package/dist/{api-CkLTFexT.js.map → api-Cozv5F92.js.map} +1 -1
  34. package/dist/api-client/client.cjs +7 -6
  35. package/dist/api-client/client.d.cts +3 -3
  36. package/dist/api-client/client.d.ts +3 -3
  37. package/dist/api-client/client.js +7 -6
  38. package/dist/api-client/errors.cjs +1 -1
  39. package/dist/api-client/errors.d.ts +1 -1
  40. package/dist/api-client/errors.js +1 -1
  41. package/dist/api-client/index.cjs +9 -8
  42. package/dist/api-client/index.d.cts +3 -3
  43. package/dist/api-client/index.d.ts +5 -5
  44. package/dist/api-client/index.js +9 -8
  45. package/dist/api-client/schema.cjs +1 -1
  46. package/dist/api-client/schema.d.cts +1 -1
  47. package/dist/api-client/schema.d.ts +1 -1
  48. package/dist/api-client/schema.js +1 -1
  49. package/dist/api-client/types.cjs +1 -1
  50. package/dist/api-client/types.d.cts +2 -2
  51. package/dist/api-client/types.d.ts +2 -2
  52. package/dist/api-client/types.js +1 -1
  53. package/dist/callEmbeddedAgent-B24rpPzZ.d.cts +34 -0
  54. package/dist/callEmbeddedAgent-B24rpPzZ.d.cts.map +1 -0
  55. package/dist/{callEmbeddedAgent-B_BMEB_u.js → callEmbeddedAgent-B51_9ycP.js} +4 -3
  56. package/dist/callEmbeddedAgent-B51_9ycP.js.map +1 -0
  57. package/dist/callEmbeddedAgent-Dk48A2gz.d.ts +34 -0
  58. package/dist/callEmbeddedAgent-Dk48A2gz.d.ts.map +1 -0
  59. package/dist/{callEmbeddedAgent-BaGxBAdM.cjs → callEmbeddedAgent-xTPNMk8s.cjs} +4 -3
  60. package/dist/callEmbeddedAgent-xTPNMk8s.cjs.map +1 -0
  61. package/dist/cli/parse.cjs +1 -1
  62. package/dist/cli/parse.d.cts +3 -2
  63. package/dist/cli/parse.d.cts.map +1 -1
  64. package/dist/cli/parse.d.ts +3 -2
  65. package/dist/cli/parse.d.ts.map +1 -1
  66. package/dist/cli/parse.js +1 -1
  67. package/dist/cli/resolve.cjs +7 -5
  68. package/dist/cli/resolve.d.cts +5 -3
  69. package/dist/cli/resolve.d.cts.map +1 -1
  70. package/dist/cli/resolve.d.ts +5 -3
  71. package/dist/cli/resolve.d.ts.map +1 -1
  72. package/dist/cli/resolve.js +6 -5
  73. package/dist/cli/types.d.cts +3 -2
  74. package/dist/cli/types.d.ts +3 -2
  75. package/dist/cli/usage.cjs +1 -1
  76. package/dist/cli/usage.d.cts +3 -2
  77. package/dist/cli/usage.d.cts.map +1 -1
  78. package/dist/cli/usage.d.ts +3 -2
  79. package/dist/cli/usage.d.ts.map +1 -1
  80. package/dist/cli/usage.js +1 -1
  81. package/dist/{client-CWgvrDHH.js → client-BSlwJcxe.js} +8 -7
  82. package/dist/client-BSlwJcxe.js.map +1 -0
  83. package/dist/{client-VVhTv_ej.d.ts → client-D1Oq6Udl.d.ts} +7 -7
  84. package/dist/{client-VVhTv_ej.d.ts.map → client-D1Oq6Udl.d.ts.map} +1 -1
  85. package/dist/{client-C_fNdaX8.d.cts → client-DeGFkGAD.d.cts} +2 -2
  86. package/dist/{client-C_fNdaX8.d.cts.map → client-DeGFkGAD.d.cts.map} +1 -1
  87. package/dist/{client-C2TwbSm-.cjs → client-DlJ_23xq.cjs} +8 -7
  88. package/dist/client-DlJ_23xq.cjs.map +1 -0
  89. package/dist/{config-CllFlx5w.cjs → config-2JTOC4-d.cjs} +1 -1
  90. package/dist/{config-CllFlx5w.cjs.map → config-2JTOC4-d.cjs.map} +1 -1
  91. package/dist/{config-BMC-126h.js → config-BFaJp4hW.js} +1 -1
  92. package/dist/{config-BMC-126h.js.map → config-BFaJp4hW.js.map} +1 -1
  93. package/dist/config-BMLvvgGQ.cjs +37 -0
  94. package/dist/config-BMLvvgGQ.cjs.map +1 -0
  95. package/dist/{config-DbQP60oo.cjs → config-BacDkkdz.cjs} +1 -1
  96. package/dist/{config-DbQP60oo.cjs.map → config-BacDkkdz.cjs.map} +1 -1
  97. package/dist/config-Dh25cVhL.js +25 -0
  98. package/dist/config-Dh25cVhL.js.map +1 -0
  99. package/dist/{config-DlhHLHjD.js → config-jAHLRqMZ.js} +1 -1
  100. package/dist/{config-DlhHLHjD.js.map → config-jAHLRqMZ.js.map} +1 -1
  101. package/dist/{constants-DJrjLmh5.cjs → constants-CgLLujFn.cjs} +1 -1
  102. package/dist/{constants-DJrjLmh5.cjs.map → constants-CgLLujFn.cjs.map} +1 -1
  103. package/dist/{constants-BPM_OWt0.js → constants-D8axTonA.js} +1 -1
  104. package/dist/{constants-BPM_OWt0.js.map → constants-D8axTonA.js.map} +1 -1
  105. package/dist/constants.cjs +3 -1
  106. package/dist/constants.d.cts +4 -2
  107. package/dist/constants.d.cts.map +1 -1
  108. package/dist/constants.d.ts +4 -2
  109. package/dist/constants.d.ts.map +1 -1
  110. package/dist/constants.js +3 -2
  111. package/dist/{constraint-helpers-Bey-Pii6.js → constraint-helpers-CBddlAo8.js} +1 -1
  112. package/dist/{constraint-helpers-Bey-Pii6.js.map → constraint-helpers-CBddlAo8.js.map} +1 -1
  113. package/dist/{constraint-helpers-BqcuWXad.cjs → constraint-helpers-UEovDW_M.cjs} +1 -1
  114. package/dist/{constraint-helpers-BqcuWXad.cjs.map → constraint-helpers-UEovDW_M.cjs.map} +1 -1
  115. package/dist/{create-dsn-Bx2s8Bik.js → create-dsn-CzaN7V1p.js} +5 -4
  116. package/dist/create-dsn-CzaN7V1p.js.map +1 -0
  117. package/dist/{create-dsn-ggGt0lZf.cjs → create-dsn-erDvHRvv.cjs} +5 -4
  118. package/dist/create-dsn-erDvHRvv.cjs.map +1 -0
  119. package/dist/{create-project-CZBklXm8.cjs → create-project-B9dyzzyz.cjs} +6 -5
  120. package/dist/create-project-B9dyzzyz.cjs.map +1 -0
  121. package/dist/{create-project-C0pm6zUK.js → create-project-BvmA3Xm7.js} +6 -5
  122. package/dist/create-project-BvmA3Xm7.js.map +1 -0
  123. package/dist/{create-team-BQIns3VD.js → create-team-Bb0ajRQO.js} +5 -4
  124. package/dist/create-team-Bb0ajRQO.js.map +1 -0
  125. package/dist/{create-team-DmqKw2c1.cjs → create-team-CWC7s6TS.cjs} +5 -4
  126. package/dist/create-team-CWC7s6TS.cjs.map +1 -0
  127. package/dist/{dataset-fields-C0m-vwNH.cjs → dataset-fields-Bo9Nbtdn.cjs} +2 -2
  128. package/dist/{dataset-fields-C0m-vwNH.cjs.map → dataset-fields-Bo9Nbtdn.cjs.map} +1 -1
  129. package/dist/{dataset-fields-C1o_cZrM.js → dataset-fields-dZ43jEgF.js} +2 -2
  130. package/dist/{dataset-fields-C1o_cZrM.js.map → dataset-fields-dZ43jEgF.js.map} +1 -1
  131. package/dist/{define-BfP4rFlE.cjs → define-CLp6EtpZ.cjs} +1 -1
  132. package/dist/{define-BfP4rFlE.cjs.map → define-CLp6EtpZ.cjs.map} +1 -1
  133. package/dist/{define-2Lj8Lm1t.js → define-vA6uuVue.js} +1 -1
  134. package/dist/{define-2Lj8Lm1t.js.map → define-vA6uuVue.js.map} +1 -1
  135. package/dist/{enhance-error-D3QfZOhm.js → enhance-error-BULHg3Tl.js} +2 -2
  136. package/dist/{enhance-error-D3QfZOhm.js.map → enhance-error-BULHg3Tl.js.map} +1 -1
  137. package/dist/{enhance-error-DzXrKg85.cjs → enhance-error-vihkdCX5.cjs} +2 -2
  138. package/dist/{enhance-error-DzXrKg85.cjs.map → enhance-error-vihkdCX5.cjs.map} +1 -1
  139. package/dist/{error-handling-CxV2m_Dr.cjs → error-handling-19djRJdh.cjs} +4 -4
  140. package/dist/{error-handling-CxV2m_Dr.cjs.map → error-handling-19djRJdh.cjs.map} +1 -1
  141. package/dist/{error-handling-R4SJQ7n0.js → error-handling-CLnyY1TR.js} +4 -4
  142. package/dist/{error-handling-R4SJQ7n0.js.map → error-handling-CLnyY1TR.js.map} +1 -1
  143. package/dist/{errors-D_R568zP.js → errors-BXmNwD2K.js} +1 -1
  144. package/dist/{errors-D_R568zP.js.map → errors-BXmNwD2K.js.map} +1 -1
  145. package/dist/{errors-00Iz6Wmy.d.cts → errors-BYClKbv4.d.cts} +1 -1
  146. package/dist/{errors-00Iz6Wmy.d.cts.map → errors-BYClKbv4.d.cts.map} +1 -1
  147. package/dist/{errors-Bvit2_Qs.d.ts → errors-Cn4l-BlC.d.ts} +1 -1
  148. package/dist/{errors-Bvit2_Qs.d.ts.map → errors-Cn4l-BlC.d.ts.map} +1 -1
  149. package/dist/{errors-JbBt1G2l.d.ts → errors-CyAWBU2S.d.ts} +1 -1
  150. package/dist/{errors-JbBt1G2l.d.ts.map → errors-CyAWBU2S.d.ts.map} +1 -1
  151. package/dist/{errors-CQZ-QlOB.js → errors-DUEMWOr1.js} +1 -1
  152. package/dist/{errors-CQZ-QlOB.js.map → errors-DUEMWOr1.js.map} +1 -1
  153. package/dist/{errors-Bmqdg5Q6.cjs → errors-DWysOIMw.cjs} +1 -1
  154. package/dist/{errors-Bmqdg5Q6.cjs.map → errors-DWysOIMw.cjs.map} +1 -1
  155. package/dist/{errors-BtJEw2Z-.cjs → errors-umQzF_vW.cjs} +1 -1
  156. package/dist/{errors-BtJEw2Z-.cjs.map → errors-umQzF_vW.cjs.map} +1 -1
  157. package/dist/errors.cjs +1 -1
  158. package/dist/errors.d.cts +1 -1
  159. package/dist/errors.d.ts +1 -1
  160. package/dist/errors.js +1 -1
  161. package/dist/{fetch-utils-BetJhSli.js → fetch-utils-C6qSgZai.js} +1 -1
  162. package/dist/{fetch-utils-BetJhSli.js.map → fetch-utils-C6qSgZai.js.map} +1 -1
  163. package/dist/{fetch-utils-Cp3P-Ai3.cjs → fetch-utils-DRgOJp3e.cjs} +1 -1
  164. package/dist/{fetch-utils-Cp3P-Ai3.cjs.map → fetch-utils-DRgOJp3e.cjs.map} +1 -1
  165. package/dist/{find-dsns-BPN8wnUr.js → find-dsns-Bqafhzp5.js} +5 -4
  166. package/dist/find-dsns-Bqafhzp5.js.map +1 -0
  167. package/dist/{find-dsns-Ct6uFZMB.cjs → find-dsns-MMdOXURp.cjs} +5 -4
  168. package/dist/find-dsns-MMdOXURp.cjs.map +1 -0
  169. package/dist/{find-organizations-BGI_WW2q.cjs → find-organizations-D80maEbK.cjs} +6 -4
  170. package/dist/find-organizations-D80maEbK.cjs.map +1 -0
  171. package/dist/{find-organizations-DxH9SS3w.js → find-organizations-DV7Za1d0.js} +6 -4
  172. package/dist/find-organizations-DV7Za1d0.js.map +1 -0
  173. package/dist/{find-projects-DOMBBYAP.js → find-projects-Dcqw9Vyi.js} +7 -5
  174. package/dist/find-projects-Dcqw9Vyi.js.map +1 -0
  175. package/dist/{find-projects-B80qSPpP.cjs → find-projects-KrMwC18K.cjs} +7 -5
  176. package/dist/find-projects-KrMwC18K.cjs.map +1 -0
  177. package/dist/{find-releases-Cy-Q-Qje.cjs → find-releases-BPS53QTy.cjs} +5 -4
  178. package/dist/find-releases-BPS53QTy.cjs.map +1 -0
  179. package/dist/{find-releases-CfZRMBvh.js → find-releases-CHDuNU2z.js} +5 -4
  180. package/dist/find-releases-CHDuNU2z.js.map +1 -0
  181. package/dist/{find-teams-BuH2ddaL.cjs → find-teams-DFl7ESVe.cjs} +10 -5
  182. package/dist/find-teams-DFl7ESVe.cjs.map +1 -0
  183. package/dist/{find-teams-D5770X0I.js → find-teams-DPdnW18Q.js} +10 -5
  184. package/dist/find-teams-DPdnW18Q.js.map +1 -0
  185. package/dist/{formatters-B9XiCNZ_.js → formatters-BOJNlDKG.js} +2 -2
  186. package/dist/{formatters-B9XiCNZ_.js.map → formatters-BOJNlDKG.js.map} +1 -1
  187. package/dist/{formatters-CkbVfXEE.cjs → formatters-Bb4El3CZ.cjs} +2 -2
  188. package/dist/{formatters-CkbVfXEE.cjs.map → formatters-Bb4El3CZ.cjs.map} +1 -1
  189. package/dist/{formatters-DMlTJcHW.cjs → formatters-Bta1mFce.cjs} +2 -2
  190. package/dist/{formatters-DMlTJcHW.cjs.map → formatters-Bta1mFce.cjs.map} +1 -1
  191. package/dist/{formatters-MEWHZ83Y.js → formatters-C9MhdNDX.js} +2 -2
  192. package/dist/{formatters-MEWHZ83Y.js.map → formatters-C9MhdNDX.js.map} +1 -1
  193. package/dist/{formatting-Cu1Skk_Y.cjs → formatting-5u-ZFz8H.cjs} +2 -2
  194. package/dist/{formatting-Cu1Skk_Y.cjs.map → formatting-5u-ZFz8H.cjs.map} +1 -1
  195. package/dist/{formatting-DytLf-hH.js → formatting-BEgp4WO_.js} +2 -2
  196. package/dist/{formatting-DytLf-hH.js.map → formatting-BEgp4WO_.js.map} +1 -1
  197. package/dist/{formatting-FJne_W9i.d.cts → formatting-BWMTp6lM.d.cts} +4 -4
  198. package/dist/{formatting-FJne_W9i.d.cts.map → formatting-BWMTp6lM.d.cts.map} +1 -1
  199. package/dist/{formatting-EM76FrY3.cjs → formatting-C6hyL-Yv.cjs} +1 -1
  200. package/dist/{formatting-EM76FrY3.cjs.map → formatting-C6hyL-Yv.cjs.map} +1 -1
  201. package/dist/{formatting-ar_6QZRE.d.ts → formatting-CSkVn9rJ.d.ts} +4 -4
  202. package/dist/{formatting-ar_6QZRE.d.ts.map → formatting-CSkVn9rJ.d.ts.map} +1 -1
  203. package/dist/{formatting-CAQbf0su.js → formatting-DJFcfTJG.js} +1 -1
  204. package/dist/{formatting-CAQbf0su.js.map → formatting-DJFcfTJG.js.map} +1 -1
  205. package/dist/{get-doc-MxWNTA8R.cjs → get-doc-BWKx48zK.cjs} +8 -6
  206. package/dist/get-doc-BWKx48zK.cjs.map +1 -0
  207. package/dist/{get-doc-D9Xq7et9.js → get-doc-CGOI0C0A.js} +8 -6
  208. package/dist/get-doc-CGOI0C0A.js.map +1 -0
  209. package/dist/{get-event-attachment-B_BzSfcE.js → get-event-attachment-C5nefGca.js} +5 -4
  210. package/dist/get-event-attachment-C5nefGca.js.map +1 -0
  211. package/dist/{get-event-attachment-CrtS0QRV.cjs → get-event-attachment-CMPD67lQ.cjs} +5 -4
  212. package/dist/{get-event-attachment-B_BzSfcE.js.map → get-event-attachment-CMPD67lQ.cjs.map} +1 -1
  213. package/dist/{get-issue-details-DTQ-jXyu.cjs → get-issue-details-BxJ_lQN8.cjs} +25 -14
  214. package/dist/get-issue-details-BxJ_lQN8.cjs.map +1 -0
  215. package/dist/{get-issue-details-Bvw1Xi8I.js → get-issue-details-y1io-npG.js} +25 -14
  216. package/dist/get-issue-details-y1io-npG.js.map +1 -0
  217. package/dist/{get-trace-details-BL5_jvgs.js → get-trace-details-BOBNimN0.js} +6 -5
  218. package/dist/get-trace-details-BOBNimN0.js.map +1 -0
  219. package/dist/{get-trace-details-iDp34mms.cjs → get-trace-details-C9gJYPip.cjs} +6 -5
  220. package/dist/get-trace-details-C9gJYPip.cjs.map +1 -0
  221. package/dist/{handler-LaesAQaD.d.cts → handler-7ABtxyRG.d.cts} +2 -2
  222. package/dist/{handler-LaesAQaD.d.cts.map → handler-7ABtxyRG.d.cts.map} +1 -1
  223. package/dist/{handler-CdSvAOl6.d.ts → handler-BDPbWDvJ.d.ts} +2 -2
  224. package/dist/{handler-CdSvAOl6.d.ts.map → handler-BDPbWDvJ.d.ts.map} +1 -1
  225. package/dist/{handler-B7-KeBak.cjs → handler-CK_gY4IH.cjs} +12 -7
  226. package/dist/handler-CK_gY4IH.cjs.map +1 -0
  227. package/dist/{handler-uWae09YN.d.ts → handler-CU9ZxaP9.d.ts} +2 -2
  228. package/dist/{handler-uWae09YN.d.ts.map → handler-CU9ZxaP9.d.ts.map} +1 -1
  229. package/dist/handler-CXY05zhR.d.ts +11 -0
  230. package/dist/handler-CXY05zhR.d.ts.map +1 -0
  231. package/dist/handler-D6OGs2Ok.d.cts +11 -0
  232. package/dist/handler-D6OGs2Ok.d.cts.map +1 -0
  233. package/dist/{handler-nILS77E9.js → handler-DdgXX0YP.js} +13 -8
  234. package/dist/handler-DdgXX0YP.js.map +1 -0
  235. package/dist/{handler-B08ITQl8.js → handler-Dv8J_Uro.js} +12 -7
  236. package/dist/handler-Dv8J_Uro.js.map +1 -0
  237. package/dist/{handler-BcRR_2MX.d.cts → handler-FxM1t6Wf.d.cts} +2 -2
  238. package/dist/{handler-BcRR_2MX.d.cts.map → handler-FxM1t6Wf.d.cts.map} +1 -1
  239. package/dist/{handler-DIiYPQGL.cjs → handler-L0cEG-0-.cjs} +13 -8
  240. package/dist/handler-L0cEG-0-.cjs.map +1 -0
  241. package/dist/index.cjs +84 -71
  242. package/dist/index.cjs.map +1 -1
  243. package/dist/index.js +84 -71
  244. package/dist/index.js.map +1 -1
  245. package/dist/internal/agents/callEmbeddedAgent.cjs +3 -2
  246. package/dist/internal/agents/callEmbeddedAgent.d.cts +2 -33
  247. package/dist/internal/agents/callEmbeddedAgent.d.ts +2 -33
  248. package/dist/internal/agents/callEmbeddedAgent.js +3 -2
  249. package/dist/internal/agents/openai-provider.cjs +4 -3
  250. package/dist/internal/agents/openai-provider.d.cts +11 -13
  251. package/dist/internal/agents/openai-provider.d.cts.map +1 -1
  252. package/dist/internal/agents/openai-provider.d.ts +11 -13
  253. package/dist/internal/agents/openai-provider.d.ts.map +1 -1
  254. package/dist/internal/agents/openai-provider.js +3 -2
  255. package/dist/internal/agents/tools/dataset-fields.cjs +11 -10
  256. package/dist/internal/agents/tools/dataset-fields.d.cts +7 -7
  257. package/dist/internal/agents/tools/dataset-fields.d.ts +9 -9
  258. package/dist/internal/agents/tools/dataset-fields.d.ts.map +1 -1
  259. package/dist/internal/agents/tools/dataset-fields.js +11 -10
  260. package/dist/internal/agents/tools/otel-semantics.cjs +11 -10
  261. package/dist/internal/agents/tools/otel-semantics.d.cts +4 -4
  262. package/dist/internal/agents/tools/otel-semantics.d.ts +9 -9
  263. package/dist/internal/agents/tools/otel-semantics.d.ts.map +1 -1
  264. package/dist/internal/agents/tools/otel-semantics.js +11 -10
  265. package/dist/internal/agents/tools/utils.cjs +10 -9
  266. package/dist/internal/agents/tools/utils.d.cts +1 -1
  267. package/dist/internal/agents/tools/utils.d.ts +1 -1
  268. package/dist/internal/agents/tools/utils.js +10 -9
  269. package/dist/internal/agents/tools/whoami.cjs +11 -10
  270. package/dist/internal/agents/tools/whoami.d.cts +4 -4
  271. package/dist/internal/agents/tools/whoami.d.ts +9 -9
  272. package/dist/internal/agents/tools/whoami.d.ts.map +1 -1
  273. package/dist/internal/agents/tools/whoami.js +11 -10
  274. package/dist/internal/constraint-helpers.cjs +1 -1
  275. package/dist/internal/constraint-helpers.d.cts +3 -2
  276. package/dist/internal/constraint-helpers.d.cts.map +1 -1
  277. package/dist/internal/constraint-helpers.d.ts +3 -2
  278. package/dist/internal/constraint-helpers.d.ts.map +1 -1
  279. package/dist/internal/constraint-helpers.js +1 -1
  280. package/dist/internal/error-handling.cjs +10 -9
  281. package/dist/internal/error-handling.d.cts +4 -4
  282. package/dist/internal/error-handling.d.ts +6 -6
  283. package/dist/internal/error-handling.js +10 -9
  284. package/dist/internal/fetch-utils.cjs +1 -1
  285. package/dist/internal/fetch-utils.js +1 -1
  286. package/dist/internal/formatting.cjs +2 -2
  287. package/dist/internal/formatting.d.cts +4 -4
  288. package/dist/internal/formatting.d.ts +6 -6
  289. package/dist/internal/formatting.js +2 -2
  290. package/dist/internal/issue-helpers.cjs +2 -2
  291. package/dist/internal/issue-helpers.d.cts +1 -1
  292. package/dist/internal/issue-helpers.d.ts +1 -1
  293. package/dist/internal/issue-helpers.js +2 -2
  294. package/dist/internal/test-fixtures.d.cts +2 -2
  295. package/dist/internal/test-fixtures.d.ts +2 -2
  296. package/dist/internal/tool-helpers/api.cjs +13 -11
  297. package/dist/internal/tool-helpers/api.d.cts +6 -5
  298. package/dist/internal/tool-helpers/api.d.cts.map +1 -1
  299. package/dist/internal/tool-helpers/api.d.ts +8 -7
  300. package/dist/internal/tool-helpers/api.d.ts.map +1 -1
  301. package/dist/internal/tool-helpers/api.js +13 -11
  302. package/dist/internal/tool-helpers/define.cjs +1 -1
  303. package/dist/internal/tool-helpers/define.d.cts +4 -3
  304. package/dist/internal/tool-helpers/define.d.cts.map +1 -1
  305. package/dist/internal/tool-helpers/define.d.ts +4 -3
  306. package/dist/internal/tool-helpers/define.d.ts.map +1 -1
  307. package/dist/internal/tool-helpers/define.js +1 -1
  308. package/dist/internal/tool-helpers/enhance-error.cjs +10 -9
  309. package/dist/internal/tool-helpers/enhance-error.d.cts +3 -3
  310. package/dist/internal/tool-helpers/enhance-error.d.ts +5 -5
  311. package/dist/internal/tool-helpers/enhance-error.js +10 -9
  312. package/dist/internal/tool-helpers/formatting.cjs +1 -1
  313. package/dist/internal/tool-helpers/formatting.d.cts +3 -3
  314. package/dist/internal/tool-helpers/formatting.d.ts +5 -5
  315. package/dist/internal/tool-helpers/formatting.js +1 -1
  316. package/dist/internal/tool-helpers/issue.cjs +5 -5
  317. package/dist/internal/tool-helpers/issue.d.cts +5 -5
  318. package/dist/internal/tool-helpers/issue.d.ts +7 -7
  319. package/dist/internal/tool-helpers/issue.js +5 -5
  320. package/dist/internal/tool-helpers/seer.cjs +1 -1
  321. package/dist/internal/tool-helpers/seer.d.cts +3 -3
  322. package/dist/internal/tool-helpers/seer.d.ts +5 -5
  323. package/dist/internal/tool-helpers/seer.js +1 -1
  324. package/dist/internal/tool-helpers/validate-region-url.cjs +4 -3
  325. package/dist/internal/tool-helpers/validate-region-url.js +4 -3
  326. package/dist/{issue-helpers-DbPTv_qC.cjs → issue-helpers-D-hBnXTk.cjs} +2 -2
  327. package/dist/{issue-helpers-DbPTv_qC.cjs.map → issue-helpers-D-hBnXTk.cjs.map} +1 -1
  328. package/dist/{issue-helpers-bECziPOG.d.ts → issue-helpers-D4NRLqkR.d.ts} +1 -1
  329. package/dist/{issue-helpers-bECziPOG.d.ts.map → issue-helpers-D4NRLqkR.d.ts.map} +1 -1
  330. package/dist/{issue-helpers-8Bubch8E.js → issue-helpers-DtCbXiRZ.js} +2 -2
  331. package/dist/{issue-helpers-8Bubch8E.js.map → issue-helpers-DtCbXiRZ.js.map} +1 -1
  332. package/dist/{issue-helpers-CD46ia7_.d.cts → issue-helpers-ILmSPsJZ.d.cts} +1 -1
  333. package/dist/{issue-helpers-CD46ia7_.d.cts.map → issue-helpers-ILmSPsJZ.d.cts.map} +1 -1
  334. package/dist/{logging-PY270KtN.d.ts → logging-BgTqJ4mI.d.ts} +1 -1
  335. package/dist/{logging-PY270KtN.d.ts.map → logging-BgTqJ4mI.d.ts.map} +1 -1
  336. package/dist/{logging-CDYnh7ho.d.cts → logging-BjKioF_x.d.cts} +1 -1
  337. package/dist/{logging-CDYnh7ho.d.cts.map → logging-BjKioF_x.d.cts.map} +1 -1
  338. package/dist/{logging-DqqDTe02.js → logging-ChQnSEmD.js} +1 -1
  339. package/dist/{logging-DqqDTe02.js.map → logging-ChQnSEmD.js.map} +1 -1
  340. package/dist/{logging-CkAJKyq2.cjs → logging-DrbQ8weU.cjs} +1 -1
  341. package/dist/{logging-CkAJKyq2.cjs.map → logging-DrbQ8weU.cjs.map} +1 -1
  342. package/dist/openai-provider-BpAFXVih.js +48 -0
  343. package/dist/openai-provider-BpAFXVih.js.map +1 -0
  344. package/dist/openai-provider-CdGMI-ue.cjs +60 -0
  345. package/dist/openai-provider-CdGMI-ue.cjs.map +1 -0
  346. package/dist/{otel-semantics-CArUzarp.js → otel-semantics-CWWWmiNy.js} +2 -2
  347. package/dist/{otel-semantics-CArUzarp.js.map → otel-semantics-CWWWmiNy.js.map} +1 -1
  348. package/dist/{otel-semantics-onvZv7i9.cjs → otel-semantics-CgF1PqFd.cjs} +2 -2
  349. package/dist/{otel-semantics-onvZv7i9.cjs.map → otel-semantics-CgF1PqFd.cjs.map} +1 -1
  350. package/dist/{parse-8lpnm_2Z.js → parse-BvHK_nys.js} +24 -3
  351. package/dist/parse-BvHK_nys.js.map +1 -0
  352. package/dist/{parse-shlhKlaL.cjs → parse-vgBG5mXu.cjs} +24 -3
  353. package/dist/parse-vgBG5mXu.cjs.map +1 -0
  354. package/dist/{permissions-D5kR-bZw.cjs → permissions-Berbg2vC.cjs} +3 -5
  355. package/dist/permissions-Berbg2vC.cjs.map +1 -0
  356. package/dist/{permissions-40d2hxK-.d.ts → permissions-CiIVEs4_.d.ts} +2 -2
  357. package/dist/permissions-CiIVEs4_.d.ts.map +1 -0
  358. package/dist/{permissions-B1meXGie.d.cts → permissions-Cm5e34n2.d.cts} +2 -2
  359. package/dist/permissions-Cm5e34n2.d.cts.map +1 -0
  360. package/dist/{permissions-C_xHmYV4.js → permissions-DvkVlUJ1.js} +3 -5
  361. package/dist/permissions-DvkVlUJ1.js.map +1 -0
  362. package/dist/permissions.cjs +1 -1
  363. package/dist/permissions.d.cts +1 -1
  364. package/dist/permissions.d.ts +1 -1
  365. package/dist/permissions.js +1 -1
  366. package/dist/resolve-CrYQ5aF_.cjs +107 -0
  367. package/dist/resolve-CrYQ5aF_.cjs.map +1 -0
  368. package/dist/resolve-DQ-6eLec.js +90 -0
  369. package/dist/resolve-DQ-6eLec.js.map +1 -0
  370. package/dist/{schema-DoWJbcHt.cjs → schema-CGiILhan.cjs} +1 -1
  371. package/dist/{schema-DoWJbcHt.cjs.map → schema-CGiILhan.cjs.map} +1 -1
  372. package/dist/{schema-rwexXWFL.js → schema-ChlpIaqA.js} +3 -3
  373. package/dist/{schema-rwexXWFL.js.map → schema-ChlpIaqA.js.map} +1 -1
  374. package/dist/{schema-Cv_VNAHz.cjs → schema-DUU4CA0j.cjs} +3 -3
  375. package/dist/{schema-Cv_VNAHz.cjs.map → schema-DUU4CA0j.cjs.map} +1 -1
  376. package/dist/{schema-CuB-30t5.js → schema-DkZXVCQJ.js} +1 -1
  377. package/dist/{schema-CuB-30t5.js.map → schema-DkZXVCQJ.js.map} +1 -1
  378. package/dist/{schema-0uEmsoCr.d.ts → schema-Y6BzAUmc.d.cts} +9 -9
  379. package/dist/{schema-xhCkX5uD.d.cts.map → schema-Y6BzAUmc.d.cts.map} +1 -1
  380. package/dist/{schema-xhCkX5uD.d.cts → schema-xBO557xH.d.ts} +433 -433
  381. package/dist/{schema-0uEmsoCr.d.ts.map → schema-xBO557xH.d.ts.map} +1 -1
  382. package/dist/schema.cjs +4 -3
  383. package/dist/schema.js +4 -3
  384. package/dist/{search-docs-CTT1Bt1U.cjs → search-docs-Da7cAz8X.cjs} +10 -26
  385. package/dist/search-docs-Da7cAz8X.cjs.map +1 -0
  386. package/dist/{search-docs-B9qNTw49.js → search-docs-YYBTOWY5.js} +10 -26
  387. package/dist/search-docs-YYBTOWY5.js.map +1 -0
  388. package/dist/{seer-CderEQ-X.js → seer-CSFgx4AP.js} +1 -1
  389. package/dist/{seer-CderEQ-X.js.map → seer-CSFgx4AP.js.map} +1 -1
  390. package/dist/{seer-B63P5CPi.cjs → seer-sA1asAZs.cjs} +1 -1
  391. package/dist/{seer-B63P5CPi.cjs.map → seer-sA1asAZs.cjs.map} +1 -1
  392. package/dist/{sentry-Da9wc8eP.cjs → sentry-3DC3Kob2.cjs} +1 -1
  393. package/dist/{sentry-Da9wc8eP.cjs.map → sentry-3DC3Kob2.cjs.map} +1 -1
  394. package/dist/{sentry-De4G2HDR.d.cts → sentry-CfePWwtE.d.cts} +1 -1
  395. package/dist/sentry-CfePWwtE.d.cts.map +1 -0
  396. package/dist/{sentry-BhTMff8f.js → sentry-Cfj4OGMQ.js} +1 -1
  397. package/dist/{sentry-BhTMff8f.js.map → sentry-Cfj4OGMQ.js.map} +1 -1
  398. package/dist/{sentry-DZNWcvcy.d.ts → sentry-DKiJwGZX.d.ts} +1 -1
  399. package/dist/sentry-DKiJwGZX.d.ts.map +1 -0
  400. package/dist/server-BaovxxmS.js +335 -0
  401. package/dist/server-BaovxxmS.js.map +1 -0
  402. package/dist/server-KMgWcsoE.cjs +353 -0
  403. package/dist/server-KMgWcsoE.cjs.map +1 -0
  404. package/dist/server.cjs +63 -62
  405. package/dist/server.d.cts +14 -9
  406. package/dist/server.d.cts.map +1 -1
  407. package/dist/server.d.ts +14 -9
  408. package/dist/server.d.ts.map +1 -1
  409. package/dist/server.js +63 -62
  410. package/dist/skillDefinitions.cjs +53 -0
  411. package/dist/skillDefinitions.cjs.map +1 -0
  412. package/dist/skillDefinitions.d.cts +13 -0
  413. package/dist/skillDefinitions.d.cts.map +1 -0
  414. package/dist/skillDefinitions.d.ts +13 -0
  415. package/dist/skillDefinitions.d.ts.map +1 -0
  416. package/dist/skillDefinitions.js +52 -0
  417. package/dist/skillDefinitions.js.map +1 -0
  418. package/dist/skills-BmFl7P6V.js +94 -0
  419. package/dist/skills-BmFl7P6V.js.map +1 -0
  420. package/dist/skills-COOuBrrA.cjs +148 -0
  421. package/dist/skills-COOuBrrA.cjs.map +1 -0
  422. package/dist/skills-HlAeBq_E.d.cts +33 -0
  423. package/dist/skills-HlAeBq_E.d.cts.map +1 -0
  424. package/dist/skills-g0WCenTA.d.ts +33 -0
  425. package/dist/skills-g0WCenTA.d.ts.map +1 -0
  426. package/dist/skills.cjs +11 -0
  427. package/dist/skills.d.cts +2 -0
  428. package/dist/skills.d.ts +2 -0
  429. package/dist/skills.js +3 -0
  430. package/dist/{slug-validation-58wajHeL.js → slug-validation-Bkteg65O.js} +1 -1
  431. package/dist/{slug-validation-58wajHeL.js.map → slug-validation-Bkteg65O.js.map} +1 -1
  432. package/dist/{slug-validation-DMk8Dyuh.cjs → slug-validation-ByuBdbX_.cjs} +1 -1
  433. package/dist/{slug-validation-DMk8Dyuh.cjs.map → slug-validation-ByuBdbX_.cjs.map} +1 -1
  434. package/dist/{stdio-Uv0oXx1a.js → stdio-DHijjrp9.js} +14 -16
  435. package/dist/stdio-DHijjrp9.js.map +1 -0
  436. package/dist/{stdio-D_myxOG-.cjs → stdio-pNGJyuki.cjs} +14 -16
  437. package/dist/stdio-pNGJyuki.cjs.map +1 -0
  438. package/dist/telem/index.cjs +2 -2
  439. package/dist/telem/index.d.cts +2 -2
  440. package/dist/telem/index.d.ts +2 -2
  441. package/dist/telem/index.js +2 -2
  442. package/dist/telem/logging.cjs +1 -1
  443. package/dist/telem/logging.d.cts +1 -1
  444. package/dist/telem/logging.d.ts +1 -1
  445. package/dist/telem/logging.js +1 -1
  446. package/dist/telem/sentry.cjs +1 -1
  447. package/dist/telem/sentry.d.cts +1 -1
  448. package/dist/telem/sentry.d.ts +1 -1
  449. package/dist/telem/sentry.js +1 -1
  450. package/dist/test-setup.cjs +1 -1
  451. package/dist/test-setup.d.cts +3 -2
  452. package/dist/test-setup.d.cts.map +1 -1
  453. package/dist/test-setup.d.ts +3 -2
  454. package/dist/test-setup.d.ts.map +1 -1
  455. package/dist/test-setup.js +1 -1
  456. package/dist/test-utils/context.d.cts +3 -2
  457. package/dist/test-utils/context.d.cts.map +1 -1
  458. package/dist/test-utils/context.d.ts +3 -2
  459. package/dist/test-utils/context.d.ts.map +1 -1
  460. package/dist/toolDefinitions.cjs +25 -3
  461. package/dist/toolDefinitions.cjs.map +1 -1
  462. package/dist/toolDefinitions.d.cts +1 -1
  463. package/dist/toolDefinitions.d.ts +1 -1
  464. package/dist/toolDefinitions.js +25 -3
  465. package/dist/toolDefinitions.js.map +1 -1
  466. package/dist/tools/analyze-issue-with-seer.cjs +22 -20
  467. package/dist/tools/analyze-issue-with-seer.d.cts +4 -3
  468. package/dist/tools/analyze-issue-with-seer.d.cts.map +1 -1
  469. package/dist/tools/analyze-issue-with-seer.d.ts +4 -3
  470. package/dist/tools/analyze-issue-with-seer.d.ts.map +1 -1
  471. package/dist/tools/analyze-issue-with-seer.js +22 -20
  472. package/dist/tools/create-dsn.cjs +17 -15
  473. package/dist/tools/create-dsn.d.cts +4 -3
  474. package/dist/tools/create-dsn.d.cts.map +1 -1
  475. package/dist/tools/create-dsn.d.ts +4 -3
  476. package/dist/tools/create-dsn.d.ts.map +1 -1
  477. package/dist/tools/create-dsn.js +17 -15
  478. package/dist/tools/create-project.cjs +17 -15
  479. package/dist/tools/create-project.d.cts +4 -3
  480. package/dist/tools/create-project.d.cts.map +1 -1
  481. package/dist/tools/create-project.d.ts +4 -3
  482. package/dist/tools/create-project.d.ts.map +1 -1
  483. package/dist/tools/create-project.js +17 -15
  484. package/dist/tools/create-team.cjs +17 -15
  485. package/dist/tools/create-team.d.cts +4 -3
  486. package/dist/tools/create-team.d.cts.map +1 -1
  487. package/dist/tools/create-team.d.ts +4 -3
  488. package/dist/tools/create-team.d.ts.map +1 -1
  489. package/dist/tools/create-team.js +17 -15
  490. package/dist/tools/find-dsns.cjs +17 -15
  491. package/dist/tools/find-dsns.d.cts +8 -7
  492. package/dist/tools/find-dsns.d.ts +8 -7
  493. package/dist/tools/find-dsns.js +17 -15
  494. package/dist/tools/find-organizations.cjs +17 -15
  495. package/dist/tools/find-organizations.d.cts +6 -5
  496. package/dist/tools/find-organizations.d.ts +6 -5
  497. package/dist/tools/find-organizations.js +17 -15
  498. package/dist/tools/find-projects.cjs +17 -15
  499. package/dist/tools/find-projects.d.cts +8 -7
  500. package/dist/tools/find-projects.d.ts +8 -7
  501. package/dist/tools/find-projects.js +17 -15
  502. package/dist/tools/find-releases.cjs +17 -15
  503. package/dist/tools/find-releases.d.cts +4 -3
  504. package/dist/tools/find-releases.d.cts.map +1 -1
  505. package/dist/tools/find-releases.d.ts +4 -3
  506. package/dist/tools/find-releases.d.ts.map +1 -1
  507. package/dist/tools/find-releases.js +17 -15
  508. package/dist/tools/find-teams.cjs +17 -15
  509. package/dist/tools/find-teams.d.cts +8 -7
  510. package/dist/tools/find-teams.d.ts +8 -7
  511. package/dist/tools/find-teams.js +17 -15
  512. package/dist/tools/get-doc.cjs +12 -11
  513. package/dist/tools/get-doc.d.cts +4 -3
  514. package/dist/tools/get-doc.d.cts.map +1 -1
  515. package/dist/tools/get-doc.d.ts +4 -3
  516. package/dist/tools/get-doc.d.ts.map +1 -1
  517. package/dist/tools/get-doc.js +12 -11
  518. package/dist/tools/get-event-attachment.cjs +17 -15
  519. package/dist/tools/get-event-attachment.d.cts +10 -9
  520. package/dist/tools/get-event-attachment.d.ts +10 -9
  521. package/dist/tools/get-event-attachment.js +17 -15
  522. package/dist/tools/get-issue-details.cjs +22 -20
  523. package/dist/tools/get-issue-details.d.cts +4 -3
  524. package/dist/tools/get-issue-details.d.cts.map +1 -1
  525. package/dist/tools/get-issue-details.d.ts +4 -3
  526. package/dist/tools/get-issue-details.d.ts.map +1 -1
  527. package/dist/tools/get-issue-details.js +22 -20
  528. package/dist/tools/get-trace-details.cjs +17 -15
  529. package/dist/tools/get-trace-details.d.cts +8 -7
  530. package/dist/tools/get-trace-details.d.ts +8 -7
  531. package/dist/tools/get-trace-details.js +17 -15
  532. package/dist/tools/index.cjs +64 -57
  533. package/dist/tools/index.d.cts +82 -77
  534. package/dist/tools/index.d.cts.map +1 -1
  535. package/dist/tools/index.d.ts +82 -77
  536. package/dist/tools/index.d.ts.map +1 -1
  537. package/dist/tools/index.js +63 -56
  538. package/dist/tools/search-docs.cjs +16 -14
  539. package/dist/tools/search-docs.d.cts +4 -3
  540. package/dist/tools/search-docs.d.cts.map +1 -1
  541. package/dist/tools/search-docs.d.ts +4 -3
  542. package/dist/tools/search-docs.d.ts.map +1 -1
  543. package/dist/tools/search-docs.js +16 -14
  544. package/dist/tools/search-events/agent.cjs +17 -16
  545. package/dist/tools/search-events/agent.d.cts +4 -4
  546. package/dist/tools/search-events/agent.d.ts +6 -6
  547. package/dist/tools/search-events/agent.js +17 -16
  548. package/dist/tools/search-events/config.cjs +1 -1
  549. package/dist/tools/search-events/config.js +1 -1
  550. package/dist/tools/search-events/formatters.cjs +12 -11
  551. package/dist/tools/search-events/formatters.d.cts +5 -5
  552. package/dist/tools/search-events/formatters.d.ts +7 -7
  553. package/dist/tools/search-events/formatters.js +12 -11
  554. package/dist/tools/search-events/handler.cjs +26 -24
  555. package/dist/tools/search-events/handler.d.cts +5 -4
  556. package/dist/tools/search-events/handler.d.ts +5 -4
  557. package/dist/tools/search-events/handler.js +26 -24
  558. package/dist/tools/search-events/index.cjs +27 -25
  559. package/dist/tools/search-events/index.d.cts +9 -8
  560. package/dist/tools/search-events/index.d.ts +11 -10
  561. package/dist/tools/search-events/index.js +27 -25
  562. package/dist/tools/search-events/utils.cjs +11 -10
  563. package/dist/tools/search-events/utils.d.cts +5 -5
  564. package/dist/tools/search-events/utils.d.ts +7 -7
  565. package/dist/tools/search-events/utils.js +11 -10
  566. package/dist/tools/search-issues/agent.cjs +16 -15
  567. package/dist/tools/search-issues/agent.d.cts +4 -4
  568. package/dist/tools/search-issues/agent.d.ts +6 -6
  569. package/dist/tools/search-issues/agent.js +16 -15
  570. package/dist/tools/search-issues/config.cjs +1 -1
  571. package/dist/tools/search-issues/config.js +1 -1
  572. package/dist/tools/search-issues/formatters.cjs +2 -2
  573. package/dist/tools/search-issues/formatters.d.cts +3 -3
  574. package/dist/tools/search-issues/formatters.d.ts +5 -5
  575. package/dist/tools/search-issues/formatters.js +2 -2
  576. package/dist/tools/search-issues/handler.cjs +25 -23
  577. package/dist/tools/search-issues/handler.d.cts +5 -4
  578. package/dist/tools/search-issues/handler.d.ts +5 -4
  579. package/dist/tools/search-issues/handler.js +25 -23
  580. package/dist/tools/search-issues/index.cjs +26 -24
  581. package/dist/tools/search-issues/index.d.cts +9 -8
  582. package/dist/tools/search-issues/index.d.ts +11 -10
  583. package/dist/tools/search-issues/index.js +26 -24
  584. package/dist/tools/types.d.cts +4 -3
  585. package/dist/tools/types.d.ts +4 -3
  586. package/dist/tools/update-issue.cjs +22 -20
  587. package/dist/tools/update-issue.d.cts +11 -10
  588. package/dist/tools/update-issue.d.ts +11 -10
  589. package/dist/tools/update-issue.js +22 -20
  590. package/dist/tools/update-project.cjs +17 -15
  591. package/dist/tools/update-project.d.cts +4 -3
  592. package/dist/tools/update-project.d.cts.map +1 -1
  593. package/dist/tools/update-project.d.ts +4 -3
  594. package/dist/tools/update-project.d.ts.map +1 -1
  595. package/dist/tools/update-project.js +17 -15
  596. package/dist/tools/use-sentry/agent.cjs +8 -0
  597. package/dist/tools/use-sentry/agent.d.cts +3 -0
  598. package/dist/tools/use-sentry/agent.d.ts +3 -0
  599. package/dist/tools/use-sentry/agent.js +8 -0
  600. package/dist/tools/use-sentry/config.cjs +4 -0
  601. package/dist/tools/use-sentry/config.d.cts +21 -0
  602. package/dist/tools/use-sentry/config.d.cts.map +1 -0
  603. package/dist/tools/use-sentry/config.d.ts +21 -0
  604. package/dist/tools/use-sentry/config.d.ts.map +1 -0
  605. package/dist/tools/use-sentry/config.js +3 -0
  606. package/dist/tools/use-sentry/handler.cjs +65 -0
  607. package/dist/tools/use-sentry/handler.d.cts +6 -0
  608. package/dist/tools/use-sentry/handler.d.ts +6 -0
  609. package/dist/tools/use-sentry/handler.js +65 -0
  610. package/dist/tools/use-sentry/index.cjs +67 -0
  611. package/dist/tools/use-sentry/index.d.cts +8 -0
  612. package/dist/tools/use-sentry/index.d.ts +8 -0
  613. package/dist/tools/use-sentry/index.js +65 -0
  614. package/dist/tools/use-sentry/tool-wrapper.cjs +63 -0
  615. package/dist/tools/use-sentry/tool-wrapper.cjs.map +1 -0
  616. package/dist/tools/use-sentry/tool-wrapper.d.cts +119 -0
  617. package/dist/tools/use-sentry/tool-wrapper.d.cts.map +1 -0
  618. package/dist/tools/use-sentry/tool-wrapper.d.ts +119 -0
  619. package/dist/tools/use-sentry/tool-wrapper.d.ts.map +1 -0
  620. package/dist/tools/use-sentry/tool-wrapper.js +62 -0
  621. package/dist/tools/use-sentry/tool-wrapper.js.map +1 -0
  622. package/dist/tools/whoami.cjs +15 -13
  623. package/dist/tools/whoami.d.cts +4 -3
  624. package/dist/tools/whoami.d.ts +4 -3
  625. package/dist/tools/whoami.js +15 -13
  626. package/dist/transports/stdio.cjs +2 -3
  627. package/dist/transports/stdio.d.cts +13 -11
  628. package/dist/transports/stdio.d.cts.map +1 -1
  629. package/dist/transports/stdio.d.ts +13 -11
  630. package/dist/transports/stdio.d.ts.map +1 -1
  631. package/dist/transports/stdio.js +2 -3
  632. package/dist/{types-DkmHqy15.d.cts → types-B_3dsqbN.d.cts} +5 -3
  633. package/dist/types-B_3dsqbN.d.cts.map +1 -0
  634. package/dist/{types-B9_8hSal.d.cts → types-BeIzCAF1.d.cts} +13 -2
  635. package/dist/types-BeIzCAF1.d.cts.map +1 -0
  636. package/dist/{types-BU11bcu2.d.ts → types-C70IdmF4.d.ts} +13 -2
  637. package/dist/types-C70IdmF4.d.ts.map +1 -0
  638. package/dist/{types-CtnbvcEw.d.cts → types-CLI02LNZ.d.cts} +2 -2
  639. package/dist/{types-CtnbvcEw.d.cts.map → types-CLI02LNZ.d.cts.map} +1 -1
  640. package/dist/{types-Z4mR2AFK.d.cts → types-CokRupPo.d.cts} +4 -2
  641. package/dist/types-CokRupPo.d.cts.map +1 -0
  642. package/dist/{types-4O1B8U0e.d.ts → types-DA9C6AdF.d.ts} +2 -2
  643. package/dist/{types-4O1B8U0e.d.ts.map → types-DA9C6AdF.d.ts.map} +1 -1
  644. package/dist/{types-NVsIso1A.d.ts → types-OrkP7cEA.d.ts} +4 -2
  645. package/dist/types-OrkP7cEA.d.ts.map +1 -0
  646. package/dist/{types-CZUp4Xzk.d.ts → types-u52qwG59.d.ts} +5 -3
  647. package/dist/types-u52qwG59.d.ts.map +1 -0
  648. package/dist/types.cjs.map +1 -1
  649. package/dist/types.d.cts +3 -2
  650. package/dist/types.d.ts +3 -2
  651. package/dist/types.js.map +1 -1
  652. package/dist/{update-issue-eELBq_Uy.cjs → update-issue-ADk9Bl3r.cjs} +8 -7
  653. package/dist/update-issue-ADk9Bl3r.cjs.map +1 -0
  654. package/dist/{update-issue-CoAkoO66.js → update-issue-B9Y1Qftw.js} +8 -7
  655. package/dist/update-issue-B9Y1Qftw.js.map +1 -0
  656. package/dist/{update-project-DMRBdOZ5.cjs → update-project-CanU1PTp.cjs} +7 -6
  657. package/dist/update-project-CanU1PTp.cjs.map +1 -0
  658. package/dist/{update-project-CuZlyBPN.js → update-project-CoVoAlvN.js} +7 -6
  659. package/dist/update-project-CoVoAlvN.js.map +1 -0
  660. package/dist/{url-utils-Bn5EoScr.cjs → url-utils-CbcNJVYS.cjs} +1 -1
  661. package/dist/{url-utils-Bn5EoScr.cjs.map → url-utils-CbcNJVYS.cjs.map} +1 -1
  662. package/dist/{url-utils-d9bPTnOl.js → url-utils-CfKwo6s5.js} +1 -1
  663. package/dist/{url-utils-d9bPTnOl.js.map → url-utils-CfKwo6s5.js.map} +1 -1
  664. package/dist/{usage-CP6e39yF.cjs → usage-CMWaPhZv.cjs} +14 -5
  665. package/dist/usage-CMWaPhZv.cjs.map +1 -0
  666. package/dist/{usage-CihInDyq.js → usage-CpguKuwi.js} +14 -5
  667. package/dist/usage-CpguKuwi.js.map +1 -0
  668. package/dist/utils/slug-validation.cjs +1 -1
  669. package/dist/utils/slug-validation.js +1 -1
  670. package/dist/utils/url-utils.cjs +1 -1
  671. package/dist/utils/url-utils.js +1 -1
  672. package/dist/{utils-DUJcA3eH.cjs → utils-B4iBngk1.cjs} +4 -4
  673. package/dist/{utils-DUJcA3eH.cjs.map → utils-B4iBngk1.cjs.map} +1 -1
  674. package/dist/{utils-CwvZS30K.js → utils-CaNeCYCH.js} +2 -2
  675. package/dist/{utils-CwvZS30K.js.map → utils-CaNeCYCH.js.map} +1 -1
  676. package/dist/{utils-DpeFMEgH.d.ts → utils-Cj4NLgWf.d.ts} +6 -6
  677. package/dist/{utils-DpeFMEgH.d.ts.map → utils-Cj4NLgWf.d.ts.map} +1 -1
  678. package/dist/{utils-C5DuiZoe.cjs → utils-Cr15-6aW.cjs} +2 -2
  679. package/dist/{utils-C5DuiZoe.cjs.map → utils-Cr15-6aW.cjs.map} +1 -1
  680. package/dist/{utils-DKgPcA6i.d.cts → utils-Cv3R2iOS.d.cts} +6 -6
  681. package/dist/{utils-DKgPcA6i.d.cts.map → utils-Cv3R2iOS.d.cts.map} +1 -1
  682. package/dist/{utils-iC0Uutcf.js → utils-DOb7bs5_.js} +4 -4
  683. package/dist/{utils-iC0Uutcf.js.map → utils-DOb7bs5_.js.map} +1 -1
  684. package/dist/{utils-HNrRwq-a.d.cts → utils-DfYLsLqN.d.cts} +1 -1
  685. package/dist/{utils-HNrRwq-a.d.cts.map → utils-DfYLsLqN.d.cts.map} +1 -1
  686. package/dist/{utils-DKQuo7b2.d.ts → utils-_4aPBcrG.d.ts} +4 -4
  687. package/dist/utils-_4aPBcrG.d.ts.map +1 -0
  688. package/dist/{validate-region-url-CaR6XWB_.js → validate-region-url-Bdokgz65.js} +3 -3
  689. package/dist/{validate-region-url-CaR6XWB_.js.map → validate-region-url-Bdokgz65.js.map} +1 -1
  690. package/dist/{validate-region-url-dzz6t54w.cjs → validate-region-url-BvT-IgKg.cjs} +3 -3
  691. package/dist/{validate-region-url-dzz6t54w.cjs.map → validate-region-url-BvT-IgKg.cjs.map} +1 -1
  692. package/dist/version-DZBMB6XD.cjs +19 -0
  693. package/dist/version-DZBMB6XD.cjs.map +1 -0
  694. package/dist/version-HXEfly4U.js +7 -0
  695. package/dist/version-HXEfly4U.js.map +1 -0
  696. package/dist/version.cjs +3 -2
  697. package/dist/version.d.cts +2 -1
  698. package/dist/version.d.cts.map +1 -1
  699. package/dist/version.d.ts +2 -1
  700. package/dist/version.d.ts.map +1 -1
  701. package/dist/version.js +2 -2
  702. package/dist/{whoami-D8-XCgVJ.js → whoami-BsX-LoXG.js} +2 -2
  703. package/dist/{whoami-D8-XCgVJ.js.map → whoami-BsX-LoXG.js.map} +1 -1
  704. package/dist/{whoami-DBlwuDZf.cjs → whoami-CZ02abcM.cjs} +5 -3
  705. package/dist/whoami-CZ02abcM.cjs.map +1 -0
  706. package/dist/{whoami-Bh_uOPqO.js → whoami-Cbo082cU.js} +5 -3
  707. package/dist/whoami-Cbo082cU.js.map +1 -0
  708. package/dist/{whoami-DBSqcCGl.cjs → whoami-DcSsmS02.cjs} +2 -2
  709. package/dist/{whoami-DBSqcCGl.cjs.map → whoami-DcSsmS02.cjs.map} +1 -1
  710. package/package.json +23 -8
  711. package/dist/analyze-issue-with-seer-CI8pvCnf.cjs.map +0 -1
  712. package/dist/analyze-issue-with-seer-DvuKEcbu.js.map +0 -1
  713. package/dist/callEmbeddedAgent-B_BMEB_u.js.map +0 -1
  714. package/dist/callEmbeddedAgent-BaGxBAdM.cjs.map +0 -1
  715. package/dist/client-C2TwbSm-.cjs.map +0 -1
  716. package/dist/client-CWgvrDHH.js.map +0 -1
  717. package/dist/context-storage-B8onP4Pw.cjs +0 -69
  718. package/dist/context-storage-B8onP4Pw.cjs.map +0 -1
  719. package/dist/context-storage-BRwdNVKx.js +0 -51
  720. package/dist/context-storage-BRwdNVKx.js.map +0 -1
  721. package/dist/create-dsn-Bx2s8Bik.js.map +0 -1
  722. package/dist/create-dsn-ggGt0lZf.cjs.map +0 -1
  723. package/dist/create-project-C0pm6zUK.js.map +0 -1
  724. package/dist/create-project-CZBklXm8.cjs.map +0 -1
  725. package/dist/create-team-BQIns3VD.js.map +0 -1
  726. package/dist/create-team-DmqKw2c1.cjs.map +0 -1
  727. package/dist/find-dsns-BPN8wnUr.js.map +0 -1
  728. package/dist/find-dsns-Ct6uFZMB.cjs.map +0 -1
  729. package/dist/find-organizations-BGI_WW2q.cjs.map +0 -1
  730. package/dist/find-organizations-DxH9SS3w.js.map +0 -1
  731. package/dist/find-projects-B80qSPpP.cjs.map +0 -1
  732. package/dist/find-projects-DOMBBYAP.js.map +0 -1
  733. package/dist/find-releases-CfZRMBvh.js.map +0 -1
  734. package/dist/find-releases-Cy-Q-Qje.cjs.map +0 -1
  735. package/dist/find-teams-BuH2ddaL.cjs.map +0 -1
  736. package/dist/find-teams-D5770X0I.js.map +0 -1
  737. package/dist/get-doc-D9Xq7et9.js.map +0 -1
  738. package/dist/get-doc-MxWNTA8R.cjs.map +0 -1
  739. package/dist/get-event-attachment-CrtS0QRV.cjs.map +0 -1
  740. package/dist/get-issue-details-Bvw1Xi8I.js.map +0 -1
  741. package/dist/get-issue-details-DTQ-jXyu.cjs.map +0 -1
  742. package/dist/get-trace-details-BL5_jvgs.js.map +0 -1
  743. package/dist/get-trace-details-iDp34mms.cjs.map +0 -1
  744. package/dist/handler-B08ITQl8.js.map +0 -1
  745. package/dist/handler-B7-KeBak.cjs.map +0 -1
  746. package/dist/handler-DIiYPQGL.cjs.map +0 -1
  747. package/dist/handler-nILS77E9.js.map +0 -1
  748. package/dist/internal/agents/callEmbeddedAgent.d.cts.map +0 -1
  749. package/dist/internal/agents/callEmbeddedAgent.d.ts.map +0 -1
  750. package/dist/internal/context-storage.cjs +0 -5
  751. package/dist/internal/context-storage.d.cts +0 -48
  752. package/dist/internal/context-storage.d.cts.map +0 -1
  753. package/dist/internal/context-storage.d.ts +0 -48
  754. package/dist/internal/context-storage.d.ts.map +0 -1
  755. package/dist/internal/context-storage.js +0 -3
  756. package/dist/openai-provider-BELCfis6.js +0 -29
  757. package/dist/openai-provider-BELCfis6.js.map +0 -1
  758. package/dist/openai-provider-CRxXeC9G.cjs +0 -41
  759. package/dist/openai-provider-CRxXeC9G.cjs.map +0 -1
  760. package/dist/parse-8lpnm_2Z.js.map +0 -1
  761. package/dist/parse-shlhKlaL.cjs.map +0 -1
  762. package/dist/permissions-40d2hxK-.d.ts.map +0 -1
  763. package/dist/permissions-B1meXGie.d.cts.map +0 -1
  764. package/dist/permissions-C_xHmYV4.js.map +0 -1
  765. package/dist/permissions-D5kR-bZw.cjs.map +0 -1
  766. package/dist/resolve-CBipUzux.cjs +0 -65
  767. package/dist/resolve-CBipUzux.cjs.map +0 -1
  768. package/dist/resolve-CZduTbDq.js +0 -54
  769. package/dist/resolve-CZduTbDq.js.map +0 -1
  770. package/dist/search-docs-B9qNTw49.js.map +0 -1
  771. package/dist/search-docs-CTT1Bt1U.cjs.map +0 -1
  772. package/dist/sentry-DZNWcvcy.d.ts.map +0 -1
  773. package/dist/sentry-De4G2HDR.d.cts.map +0 -1
  774. package/dist/server-B0jJJdAd.js +0 -157
  775. package/dist/server-B0jJJdAd.js.map +0 -1
  776. package/dist/server-Bk2YVj60.cjs +0 -163
  777. package/dist/server-Bk2YVj60.cjs.map +0 -1
  778. package/dist/stdio-D_myxOG-.cjs.map +0 -1
  779. package/dist/stdio-Uv0oXx1a.js.map +0 -1
  780. package/dist/tools-DcCN34Xz.cjs +0 -51
  781. package/dist/tools-DcCN34Xz.cjs.map +0 -1
  782. package/dist/tools-Du5wLts3.js +0 -46
  783. package/dist/tools-Du5wLts3.js.map +0 -1
  784. package/dist/types-B9_8hSal.d.cts.map +0 -1
  785. package/dist/types-BU11bcu2.d.ts.map +0 -1
  786. package/dist/types-CZUp4Xzk.d.ts.map +0 -1
  787. package/dist/types-DkmHqy15.d.cts.map +0 -1
  788. package/dist/types-NVsIso1A.d.ts.map +0 -1
  789. package/dist/types-Z4mR2AFK.d.cts.map +0 -1
  790. package/dist/update-issue-CoAkoO66.js.map +0 -1
  791. package/dist/update-issue-eELBq_Uy.cjs.map +0 -1
  792. package/dist/update-project-CuZlyBPN.js.map +0 -1
  793. package/dist/update-project-DMRBdOZ5.cjs.map +0 -1
  794. package/dist/usage-CP6e39yF.cjs.map +0 -1
  795. package/dist/usage-CihInDyq.js.map +0 -1
  796. package/dist/utils-DKQuo7b2.d.ts.map +0 -1
  797. package/dist/version-6dHij-Gk.js +0 -6
  798. package/dist/version-6dHij-Gk.js.map +0 -1
  799. package/dist/version-Cq6vA9Kc.cjs +0 -12
  800. package/dist/version-Cq6vA9Kc.cjs.map +0 -1
  801. package/dist/whoami-Bh_uOPqO.js.map +0 -1
  802. package/dist/whoami-DBlwuDZf.cjs.map +0 -1
  803. /package/dist/{api-client-BR5WolLe.js → api-client-BGgaBFuD.cjs} +0 -0
  804. /package/dist/{api-client-BsHWi0-I.cjs → api-client-CSLxiNP9.js} +0 -0
  805. /package/dist/{index-DZJ9s9rm.d.ts → index-NfFbnYt3.d.ts} +0 -0
  806. /package/dist/{issue-B7cgiWKp.cjs → issue-1C6txnk3.js} +0 -0
  807. /package/dist/{issue-BLm6gohl.js → issue-ChNk4cuO.cjs} +0 -0
  808. /package/dist/{search-events-Bc2a_R3A.cjs → search-events-B-MXKSB_.js} +0 -0
  809. /package/dist/{search-events-Bo5bAsOv.js → search-events-BrEw3wC-.cjs} +0 -0
  810. /package/dist/{search-issues-AaiYCZ6J.cjs → search-issues-C7Zs6rFB.cjs} +0 -0
  811. /package/dist/{search-issues-DVHuKDdB.js → search-issues-DUSkomYp.js} +0 -0
  812. /package/dist/{types-Bx1EKe0v.js → types-D670-rDz.js} +0 -0
  813. /package/dist/{types-D10T4PdD.cjs → types-n3wuZu5X.cjs} +0 -0
@@ -1,12 +1,13 @@
1
- import { defineTool } from "./define-2Lj8Lm1t.js";
2
- import { apiServiceFromContext } from "./api-CkLTFexT.js";
3
- import { ParamOrganizationSlug, ParamRegionUrl } from "./schema-rwexXWFL.js";
1
+ import { defineTool } from "./define-vA6uuVue.js";
2
+ import { apiServiceFromContext } from "./api-Cozv5F92.js";
3
+ import { ParamOrganizationSlug, ParamRegionUrl } from "./schema-ChlpIaqA.js";
4
4
  import { setTag } from "@sentry/core";
5
5
  import { z } from "zod";
6
6
 
7
7
  //#region src/tools/create-team.ts
8
8
  var create_team_default = defineTool({
9
9
  name: "create_team",
10
+ requiredSkills: ["project-management"],
10
11
  requiredScopes: ["team:write"],
11
12
  description: [
12
13
  "Create a new team in Sentry.",
@@ -59,4 +60,4 @@ var create_team_default = defineTool({
59
60
 
60
61
  //#endregion
61
62
  export { create_team_default };
62
- //# sourceMappingURL=create-team-BQIns3VD.js.map
63
+ //# sourceMappingURL=create-team-Bb0ajRQO.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-team-Bb0ajRQO.js","names":["context: ServerContext"],"sources":["../src/tools/create-team.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport type { ServerContext } from \"../types\";\nimport { ParamOrganizationSlug, ParamRegionUrl } from \"../schema\";\n\nexport default defineTool({\n name: \"create_team\",\n requiredSkills: [\"project-management\"], // Only available in project-management skill\n requiredScopes: [\"team:write\"],\n description: [\n \"Create a new team in Sentry.\",\n \"\",\n \"🔍 USE THIS TOOL WHEN USERS WANT TO:\",\n \"- 'Create a new team'\",\n \"- 'Set up a team called [X]'\",\n \"- 'I need a team for my project'\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"<examples>\",\n \"### Create a new team\",\n \"```\",\n \"create_team(organizationSlug='my-organization', name='the-goats')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n name: z.string().trim().describe(\"The name of the team to create.\"),\n },\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n openWorldHint: true,\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n\n const team = await apiService.createTeam({\n organizationSlug,\n name: params.name,\n });\n let output = `# New Team in **${organizationSlug}**\\n\\n`;\n output += `**ID**: ${team.id}\\n`;\n output += `**Slug**: ${team.slug}\\n`;\n output += `**Name**: ${team.name}\\n`;\n output += \"# Using this information\\n\\n\";\n output += `- You should always inform the user of the Team Slug value.\\n`;\n return output;\n },\n});\n"],"mappings":";;;;;;;AAOA,0BAAe,WAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,oBAAqB;CACtC,gBAAgB,CAAC,YAAa;CAC9B,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB;EAClB,WAAW,eAAe,UAAU;EACpC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,kCAAkC;CACpE;CACD,aAAa;EACX,cAAc;EACd,iBAAiB;EACjB,eAAe;CAChB;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,sBAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,SAAO,qBAAqB,iBAAiB;EAE7C,MAAM,OAAO,MAAM,WAAW,WAAW;GACvC;GACA,MAAM,OAAO;EACd,EAAC;EACF,IAAI,UAAU,kBAAkB,iBAAiB;AACjD,aAAW,UAAU,KAAK,GAAG;AAC7B,aAAW,YAAY,KAAK,KAAK;AACjC,aAAW,YAAY,KAAK,KAAK;AACjC,YAAU;AACV,aAAW;AACX,SAAO;CACR;AACF,EAAC"}
@@ -1,13 +1,14 @@
1
1
  const require_chunk = require('./chunk-DWy1uDak.cjs');
2
- const require_define = require('./define-BfP4rFlE.cjs');
3
- const require_api = require('./api-CZD9zwQ-.cjs');
4
- const require_schema = require('./schema-Cv_VNAHz.cjs');
2
+ const require_define = require('./define-CLp6EtpZ.cjs');
3
+ const require_api = require('./api-BkWv0o1h.cjs');
4
+ const require_schema = require('./schema-DUU4CA0j.cjs');
5
5
  const __sentry_core = require_chunk.__toESM(require("@sentry/core"));
6
6
  const zod = require_chunk.__toESM(require("zod"));
7
7
 
8
8
  //#region src/tools/create-team.ts
9
9
  var create_team_default = require_define.defineTool({
10
10
  name: "create_team",
11
+ requiredSkills: ["project-management"],
11
12
  requiredScopes: ["team:write"],
12
13
  description: [
13
14
  "Create a new team in Sentry.",
@@ -65,4 +66,4 @@ Object.defineProperty(exports, 'create_team_default', {
65
66
  return create_team_default;
66
67
  }
67
68
  });
68
- //# sourceMappingURL=create-team-DmqKw2c1.cjs.map
69
+ //# sourceMappingURL=create-team-CWC7s6TS.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-team-CWC7s6TS.cjs","names":["ParamOrganizationSlug","context: ServerContext"],"sources":["../src/tools/create-team.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"../internal/tool-helpers/define\";\nimport { apiServiceFromContext } from \"../internal/tool-helpers/api\";\nimport type { ServerContext } from \"../types\";\nimport { ParamOrganizationSlug, ParamRegionUrl } from \"../schema\";\n\nexport default defineTool({\n name: \"create_team\",\n requiredSkills: [\"project-management\"], // Only available in project-management skill\n requiredScopes: [\"team:write\"],\n description: [\n \"Create a new team in Sentry.\",\n \"\",\n \"🔍 USE THIS TOOL WHEN USERS WANT TO:\",\n \"- 'Create a new team'\",\n \"- 'Set up a team called [X]'\",\n \"- 'I need a team for my project'\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"<examples>\",\n \"### Create a new team\",\n \"```\",\n \"create_team(organizationSlug='my-organization', name='the-goats')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If any parameter is ambiguous, you should clarify with the user what they meant.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n name: z.string().trim().describe(\"The name of the team to create.\"),\n },\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n openWorldHint: true,\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n\n const team = await apiService.createTeam({\n organizationSlug,\n name: params.name,\n });\n let output = `# New Team in **${organizationSlug}**\\n\\n`;\n output += `**ID**: ${team.id}\\n`;\n output += `**Slug**: ${team.slug}\\n`;\n output += `**Name**: ${team.name}\\n`;\n output += \"# Using this information\\n\\n\";\n output += `- You should always inform the user of the Team Slug value.\\n`;\n return output;\n },\n});\n"],"mappings":";;;;;;;;AAOA,0BAAe,0BAAW;CACxB,MAAM;CACN,gBAAgB,CAAC,oBAAqB;CACtC,gBAAgB,CAAC,YAAa;CAC9B,aAAa;EACX;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,MAAM,MAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,kCAAkC;CACpE;CACD,aAAa;EACX,cAAc;EACd,iBAAiB;EACjB,eAAe;CAChB;CACD,MAAM,QAAQ,QAAQC,SAAwB;EAC5C,MAAM,aAAa,kCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,4BAAO,qBAAqB,iBAAiB;EAE7C,MAAM,OAAO,MAAM,WAAW,WAAW;GACvC;GACA,MAAM,OAAO;EACd,EAAC;EACF,IAAI,UAAU,kBAAkB,iBAAiB;AACjD,aAAW,UAAU,KAAK,GAAG;AAC7B,aAAW,YAAY,KAAK,KAAK;AACjC,aAAW,YAAY,KAAK,KAAK;AACjC,YAAU;AACV,aAAW;AACX,SAAO;CACR;AACF,EAAC"}
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require('./chunk-DWy1uDak.cjs');
2
- const require_utils = require('./utils-DUJcA3eH.cjs');
2
+ const require_utils = require('./utils-B4iBngk1.cjs');
3
3
  const zod = require_chunk.__toESM(require("zod"));
4
4
 
5
5
  //#region src/internal/agents/tools/dataset-fields.ts
@@ -176,4 +176,4 @@ Object.defineProperty(exports, 'getFieldExamples', {
176
176
  return getFieldExamples;
177
177
  }
178
178
  });
179
- //# sourceMappingURL=dataset-fields-C0m-vwNH.cjs.map
179
+ //# sourceMappingURL=dataset-fields-Bo9Nbtdn.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataset-fields-C0m-vwNH.cjs","names":["apiService: SentryApiService","organizationSlug: string","dataset: DatasetType","options: {\n projectId?: string;\n }","options: {\n apiService: SentryApiService;\n organizationSlug: string;\n dataset: DatasetType;\n projectId?: string;\n}","key: string","dataset: string","commonExamples: Record<string, string[]>","issueExamples: Record<string, string[]>","eventExamples: Record<string, string[]>"],"sources":["../src/internal/agents/tools/dataset-fields.ts"],"sourcesContent":["import { z } from \"zod\";\nimport type { SentryApiService } from \"../../../api-client\";\nimport { agentTool } from \"./utils\";\n\nexport type DatasetType = \"events\" | \"errors\" | \"search_issues\";\n\nexport interface DatasetField {\n key: string;\n name: string;\n totalValues: number;\n examples?: string[];\n}\n\nexport interface DatasetFieldsResult {\n dataset: string;\n fields: DatasetField[];\n commonPatterns: Array<{ pattern: string; description: string }>;\n}\n\n/**\n * Discover available fields for a dataset by querying Sentry's tags API\n */\nexport async function discoverDatasetFields(\n apiService: SentryApiService,\n organizationSlug: string,\n dataset: DatasetType,\n options: {\n projectId?: string;\n } = {},\n): Promise<DatasetFieldsResult> {\n const { projectId } = options;\n\n // Get available tags for the dataset\n const tags = await apiService.listTags({\n organizationSlug,\n dataset,\n project: projectId,\n statsPeriod: \"14d\",\n });\n\n // Filter out internal Sentry tags and format\n const fields = tags\n .filter((tag) => !tag.key.startsWith(\"sentry:\"))\n .map((tag) => ({\n key: tag.key,\n name: tag.name,\n totalValues: tag.totalValues,\n examples: getFieldExamples(tag.key, dataset),\n }));\n\n return {\n dataset,\n fields,\n commonPatterns: getCommonPatterns(dataset),\n };\n}\n\n/**\n * Create a tool for discovering available fields in a dataset\n * The tool is pre-bound with the API service and organization configured for the appropriate region\n */\nexport function createDatasetFieldsTool(options: {\n apiService: SentryApiService;\n organizationSlug: string;\n dataset: DatasetType;\n projectId?: string;\n}) {\n const { apiService, organizationSlug, dataset, projectId } = options;\n return agentTool({\n description: `Discover available fields for ${dataset} searches in Sentry (includes example values)`,\n parameters: z.object({}),\n execute: async () => {\n return discoverDatasetFields(apiService, organizationSlug, dataset, {\n projectId,\n });\n },\n });\n}\n\n/**\n * Get example values for common fields\n */\nexport function getFieldExamples(\n key: string,\n dataset: string,\n): string[] | undefined {\n const commonExamples: Record<string, string[]> = {\n level: [\"error\", \"warning\", \"info\", \"debug\", \"fatal\"],\n environment: [\"production\", \"staging\", \"development\"],\n release: [\"v1.0.0\", \"latest\", \"backend@1.2.3\"],\n user: [\"user123\", \"email@example.com\"],\n };\n\n const issueExamples: Record<string, string[]> = {\n ...commonExamples,\n assignedOrSuggested: [\"email@example.com\", \"team-slug\", \"me\"],\n is: [\"unresolved\", \"resolved\", \"ignored\"],\n };\n\n const eventExamples: Record<string, string[]> = {\n ...commonExamples,\n \"http.method\": [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\n \"http.status_code\": [\"200\", \"404\", \"500\"],\n \"db.system\": [\"postgresql\", \"mysql\", \"redis\"],\n };\n\n if (dataset === \"search_issues\") {\n return issueExamples[key];\n }\n if (dataset === \"events\" || dataset === \"errors\") {\n return eventExamples[key];\n }\n\n return commonExamples[key];\n}\n\n/**\n * Get common search patterns for a dataset\n */\nexport function getCommonPatterns(dataset: string) {\n if (dataset === \"search_issues\") {\n return [\n { pattern: \"is:unresolved\", description: \"Open issues\" },\n { pattern: \"is:resolved\", description: \"Closed issues\" },\n { pattern: \"level:error\", description: \"Error level issues\" },\n {\n pattern: \"firstSeen:-24h\",\n description: \"New issues from last 24 hours\",\n },\n {\n pattern: \"userCount:>100\",\n description: \"Affecting more than 100 users\",\n },\n ];\n }\n if (dataset === \"events\" || dataset === \"errors\") {\n return [\n { pattern: \"level:error\", description: \"Error events\" },\n { pattern: \"environment:production\", description: \"Production events\" },\n { pattern: \"timestamp:-1h\", description: \"Events from last hour\" },\n { pattern: \"has:http.method\", description: \"HTTP requests\" },\n { pattern: \"has:db.statement\", description: \"Database queries\" },\n ];\n }\n\n return [];\n}\n"],"mappings":";;;;;;;;AAsBA,eAAsB,sBACpBA,YACAC,kBACAC,SACAC,UAEI,CAAE,GACwB;CAC9B,MAAM,EAAE,WAAW,GAAG;CAGtB,MAAM,OAAO,MAAM,WAAW,SAAS;EACrC;EACA;EACA,SAAS;EACT,aAAa;CACd,EAAC;CAGF,MAAM,SAAS,KACZ,OAAO,CAAC,SAAS,IAAI,IAAI,WAAW,UAAU,CAAC,CAC/C,IAAI,CAAC,SAAS;EACb,KAAK,IAAI;EACT,MAAM,IAAI;EACV,aAAa,IAAI;EACjB,UAAU,iBAAiB,IAAI,KAAK,QAAQ;CAC7C,GAAE;AAEL,QAAO;EACL;EACA;EACA,gBAAgB,kBAAkB,QAAQ;CAC3C;AACF;;;;;AAMD,SAAgB,wBAAwBC,SAKrC;CACD,MAAM,EAAE,YAAY,kBAAkB,SAAS,WAAW,GAAG;AAC7D,QAAO,wBAAU;EACf,cAAc,gCAAgC,QAAQ;EACtD,YAAY,MAAE,OAAO,CAAE,EAAC;EACxB,SAAS,YAAY;AACnB,UAAO,sBAAsB,YAAY,kBAAkB,SAAS,EAClE,UACD,EAAC;EACH;CACF,EAAC;AACH;;;;AAKD,SAAgB,iBACdC,KACAC,SACsB;CACtB,MAAMC,iBAA2C;EAC/C,OAAO;GAAC;GAAS;GAAW;GAAQ;GAAS;EAAQ;EACrD,aAAa;GAAC;GAAc;GAAW;EAAc;EACrD,SAAS;GAAC;GAAU;GAAU;EAAgB;EAC9C,MAAM,CAAC,WAAW,mBAAoB;CACvC;CAED,MAAMC,gBAA0C;EAC9C,GAAG;EACH,qBAAqB;GAAC;GAAqB;GAAa;EAAK;EAC7D,IAAI;GAAC;GAAc;GAAY;EAAU;CAC1C;CAED,MAAMC,gBAA0C;EAC9C,GAAG;EACH,eAAe;GAAC;GAAO;GAAQ;GAAO;EAAS;EAC/C,oBAAoB;GAAC;GAAO;GAAO;EAAM;EACzC,aAAa;GAAC;GAAc;GAAS;EAAQ;CAC9C;AAED,KAAI,YAAY,gBACd,QAAO,cAAc;AAEvB,KAAI,YAAY,YAAY,YAAY,SACtC,QAAO,cAAc;AAGvB,QAAO,eAAe;AACvB;;;;AAKD,SAAgB,kBAAkBH,SAAiB;AACjD,KAAI,YAAY,gBACd,QAAO;EACL;GAAE,SAAS;GAAiB,aAAa;EAAe;EACxD;GAAE,SAAS;GAAe,aAAa;EAAiB;EACxD;GAAE,SAAS;GAAe,aAAa;EAAsB;EAC7D;GACE,SAAS;GACT,aAAa;EACd;EACD;GACE,SAAS;GACT,aAAa;EACd;CACF;AAEH,KAAI,YAAY,YAAY,YAAY,SACtC,QAAO;EACL;GAAE,SAAS;GAAe,aAAa;EAAgB;EACvD;GAAE,SAAS;GAA0B,aAAa;EAAqB;EACvE;GAAE,SAAS;GAAiB,aAAa;EAAyB;EAClE;GAAE,SAAS;GAAmB,aAAa;EAAiB;EAC5D;GAAE,SAAS;GAAoB,aAAa;EAAoB;CACjE;AAGH,QAAO,CAAE;AACV"}
1
+ {"version":3,"file":"dataset-fields-Bo9Nbtdn.cjs","names":["apiService: SentryApiService","organizationSlug: string","dataset: DatasetType","options: {\n projectId?: string;\n }","options: {\n apiService: SentryApiService;\n organizationSlug: string;\n dataset: DatasetType;\n projectId?: string;\n}","key: string","dataset: string","commonExamples: Record<string, string[]>","issueExamples: Record<string, string[]>","eventExamples: Record<string, string[]>"],"sources":["../src/internal/agents/tools/dataset-fields.ts"],"sourcesContent":["import { z } from \"zod\";\nimport type { SentryApiService } from \"../../../api-client\";\nimport { agentTool } from \"./utils\";\n\nexport type DatasetType = \"events\" | \"errors\" | \"search_issues\";\n\nexport interface DatasetField {\n key: string;\n name: string;\n totalValues: number;\n examples?: string[];\n}\n\nexport interface DatasetFieldsResult {\n dataset: string;\n fields: DatasetField[];\n commonPatterns: Array<{ pattern: string; description: string }>;\n}\n\n/**\n * Discover available fields for a dataset by querying Sentry's tags API\n */\nexport async function discoverDatasetFields(\n apiService: SentryApiService,\n organizationSlug: string,\n dataset: DatasetType,\n options: {\n projectId?: string;\n } = {},\n): Promise<DatasetFieldsResult> {\n const { projectId } = options;\n\n // Get available tags for the dataset\n const tags = await apiService.listTags({\n organizationSlug,\n dataset,\n project: projectId,\n statsPeriod: \"14d\",\n });\n\n // Filter out internal Sentry tags and format\n const fields = tags\n .filter((tag) => !tag.key.startsWith(\"sentry:\"))\n .map((tag) => ({\n key: tag.key,\n name: tag.name,\n totalValues: tag.totalValues,\n examples: getFieldExamples(tag.key, dataset),\n }));\n\n return {\n dataset,\n fields,\n commonPatterns: getCommonPatterns(dataset),\n };\n}\n\n/**\n * Create a tool for discovering available fields in a dataset\n * The tool is pre-bound with the API service and organization configured for the appropriate region\n */\nexport function createDatasetFieldsTool(options: {\n apiService: SentryApiService;\n organizationSlug: string;\n dataset: DatasetType;\n projectId?: string;\n}) {\n const { apiService, organizationSlug, dataset, projectId } = options;\n return agentTool({\n description: `Discover available fields for ${dataset} searches in Sentry (includes example values)`,\n parameters: z.object({}),\n execute: async () => {\n return discoverDatasetFields(apiService, organizationSlug, dataset, {\n projectId,\n });\n },\n });\n}\n\n/**\n * Get example values for common fields\n */\nexport function getFieldExamples(\n key: string,\n dataset: string,\n): string[] | undefined {\n const commonExamples: Record<string, string[]> = {\n level: [\"error\", \"warning\", \"info\", \"debug\", \"fatal\"],\n environment: [\"production\", \"staging\", \"development\"],\n release: [\"v1.0.0\", \"latest\", \"backend@1.2.3\"],\n user: [\"user123\", \"email@example.com\"],\n };\n\n const issueExamples: Record<string, string[]> = {\n ...commonExamples,\n assignedOrSuggested: [\"email@example.com\", \"team-slug\", \"me\"],\n is: [\"unresolved\", \"resolved\", \"ignored\"],\n };\n\n const eventExamples: Record<string, string[]> = {\n ...commonExamples,\n \"http.method\": [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\n \"http.status_code\": [\"200\", \"404\", \"500\"],\n \"db.system\": [\"postgresql\", \"mysql\", \"redis\"],\n };\n\n if (dataset === \"search_issues\") {\n return issueExamples[key];\n }\n if (dataset === \"events\" || dataset === \"errors\") {\n return eventExamples[key];\n }\n\n return commonExamples[key];\n}\n\n/**\n * Get common search patterns for a dataset\n */\nexport function getCommonPatterns(dataset: string) {\n if (dataset === \"search_issues\") {\n return [\n { pattern: \"is:unresolved\", description: \"Open issues\" },\n { pattern: \"is:resolved\", description: \"Closed issues\" },\n { pattern: \"level:error\", description: \"Error level issues\" },\n {\n pattern: \"firstSeen:-24h\",\n description: \"New issues from last 24 hours\",\n },\n {\n pattern: \"userCount:>100\",\n description: \"Affecting more than 100 users\",\n },\n ];\n }\n if (dataset === \"events\" || dataset === \"errors\") {\n return [\n { pattern: \"level:error\", description: \"Error events\" },\n { pattern: \"environment:production\", description: \"Production events\" },\n { pattern: \"timestamp:-1h\", description: \"Events from last hour\" },\n { pattern: \"has:http.method\", description: \"HTTP requests\" },\n { pattern: \"has:db.statement\", description: \"Database queries\" },\n ];\n }\n\n return [];\n}\n"],"mappings":";;;;;;;;AAsBA,eAAsB,sBACpBA,YACAC,kBACAC,SACAC,UAEI,CAAE,GACwB;CAC9B,MAAM,EAAE,WAAW,GAAG;CAGtB,MAAM,OAAO,MAAM,WAAW,SAAS;EACrC;EACA;EACA,SAAS;EACT,aAAa;CACd,EAAC;CAGF,MAAM,SAAS,KACZ,OAAO,CAAC,SAAS,IAAI,IAAI,WAAW,UAAU,CAAC,CAC/C,IAAI,CAAC,SAAS;EACb,KAAK,IAAI;EACT,MAAM,IAAI;EACV,aAAa,IAAI;EACjB,UAAU,iBAAiB,IAAI,KAAK,QAAQ;CAC7C,GAAE;AAEL,QAAO;EACL;EACA;EACA,gBAAgB,kBAAkB,QAAQ;CAC3C;AACF;;;;;AAMD,SAAgB,wBAAwBC,SAKrC;CACD,MAAM,EAAE,YAAY,kBAAkB,SAAS,WAAW,GAAG;AAC7D,QAAO,wBAAU;EACf,cAAc,gCAAgC,QAAQ;EACtD,Y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AE;AACV"}
@@ -1,4 +1,4 @@
1
- import { agentTool } from "./utils-iC0Uutcf.js";
1
+ import { agentTool } from "./utils-DOb7bs5_.js";
2
2
  import { z } from "zod";
3
3
 
4
4
  //#region src/internal/agents/tools/dataset-fields.ts
@@ -152,4 +152,4 @@ function getCommonPatterns(dataset) {
152
152
 
153
153
  //#endregion
154
154
  export { createDatasetFieldsTool, discoverDatasetFields, getCommonPatterns, getFieldExamples };
155
- //# sourceMappingURL=dataset-fields-C1o_cZrM.js.map
155
+ //# sourceMappingURL=dataset-fields-dZ43jEgF.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dataset-fields-C1o_cZrM.js","names":["apiService: SentryApiService","organizationSlug: string","dataset: DatasetType","options: {\n projectId?: string;\n }","options: {\n apiService: SentryApiService;\n organizationSlug: string;\n dataset: DatasetType;\n projectId?: string;\n}","key: string","dataset: string","commonExamples: Record<string, string[]>","issueExamples: Record<string, string[]>","eventExamples: Record<string, string[]>"],"sources":["../src/internal/agents/tools/dataset-fields.ts"],"sourcesContent":["import { z } from \"zod\";\nimport type { SentryApiService } from \"../../../api-client\";\nimport { agentTool } from \"./utils\";\n\nexport type DatasetType = \"events\" | \"errors\" | \"search_issues\";\n\nexport interface DatasetField {\n key: string;\n name: string;\n totalValues: number;\n examples?: string[];\n}\n\nexport interface DatasetFieldsResult {\n dataset: string;\n fields: DatasetField[];\n commonPatterns: Array<{ pattern: string; description: string }>;\n}\n\n/**\n * Discover available fields for a dataset by querying Sentry's tags API\n */\nexport async function discoverDatasetFields(\n apiService: SentryApiService,\n organizationSlug: string,\n dataset: DatasetType,\n options: {\n projectId?: string;\n } = {},\n): Promise<DatasetFieldsResult> {\n const { projectId } = options;\n\n // Get available tags for the dataset\n const tags = await apiService.listTags({\n organizationSlug,\n dataset,\n project: projectId,\n statsPeriod: \"14d\",\n });\n\n // Filter out internal Sentry tags and format\n const fields = tags\n .filter((tag) => !tag.key.startsWith(\"sentry:\"))\n .map((tag) => ({\n key: tag.key,\n name: tag.name,\n totalValues: tag.totalValues,\n examples: getFieldExamples(tag.key, dataset),\n }));\n\n return {\n dataset,\n fields,\n commonPatterns: getCommonPatterns(dataset),\n };\n}\n\n/**\n * Create a tool for discovering available fields in a dataset\n * The tool is pre-bound with the API service and organization configured for the appropriate region\n */\nexport function createDatasetFieldsTool(options: {\n apiService: SentryApiService;\n organizationSlug: string;\n dataset: DatasetType;\n projectId?: string;\n}) {\n const { apiService, organizationSlug, dataset, projectId } = options;\n return agentTool({\n description: `Discover available fields for ${dataset} searches in Sentry (includes example values)`,\n parameters: z.object({}),\n execute: async () => {\n return discoverDatasetFields(apiService, organizationSlug, dataset, {\n projectId,\n });\n },\n });\n}\n\n/**\n * Get example values for common fields\n */\nexport function getFieldExamples(\n key: string,\n dataset: string,\n): string[] | undefined {\n const commonExamples: Record<string, string[]> = {\n level: [\"error\", \"warning\", \"info\", \"debug\", \"fatal\"],\n environment: [\"production\", \"staging\", \"development\"],\n release: [\"v1.0.0\", \"latest\", \"backend@1.2.3\"],\n user: [\"user123\", \"email@example.com\"],\n };\n\n const issueExamples: Record<string, string[]> = {\n ...commonExamples,\n assignedOrSuggested: [\"email@example.com\", \"team-slug\", \"me\"],\n is: [\"unresolved\", \"resolved\", \"ignored\"],\n };\n\n const eventExamples: Record<string, string[]> = {\n ...commonExamples,\n \"http.method\": [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\n \"http.status_code\": [\"200\", \"404\", \"500\"],\n \"db.system\": [\"postgresql\", \"mysql\", \"redis\"],\n };\n\n if (dataset === \"search_issues\") {\n return issueExamples[key];\n }\n if (dataset === \"events\" || dataset === \"errors\") {\n return eventExamples[key];\n }\n\n return commonExamples[key];\n}\n\n/**\n * Get common search patterns for a dataset\n */\nexport function getCommonPatterns(dataset: string) {\n if (dataset === \"search_issues\") {\n return [\n { pattern: \"is:unresolved\", description: \"Open issues\" },\n { pattern: \"is:resolved\", description: \"Closed issues\" },\n { pattern: \"level:error\", description: \"Error level issues\" },\n {\n pattern: \"firstSeen:-24h\",\n description: \"New issues from last 24 hours\",\n },\n {\n pattern: \"userCount:>100\",\n description: \"Affecting more than 100 users\",\n },\n ];\n }\n if (dataset === \"events\" || dataset === \"errors\") {\n return [\n { pattern: \"level:error\", description: \"Error events\" },\n { pattern: \"environment:production\", description: \"Production events\" },\n { pattern: \"timestamp:-1h\", description: \"Events from last hour\" },\n { pattern: \"has:http.method\", description: \"HTTP requests\" },\n { pattern: \"has:db.statement\", description: \"Database queries\" },\n ];\n }\n\n return [];\n}\n"],"mappings":";;;;;;;AAsBA,eAAsB,sBACpBA,YACAC,kBACAC,SACAC,UAEI,CAAE,GACwB;CAC9B,MAAM,EAAE,WAAW,GAAG;CAGtB,MAAM,OAAO,MAAM,WAAW,SAAS;EACrC;EACA;EACA,SAAS;EACT,aAAa;CACd,EAAC;CAGF,MAAM,SAAS,KACZ,OAAO,CAAC,SAAS,IAAI,IAAI,WAAW,UAAU,CAAC,CAC/C,IAAI,CAAC,SAAS;EACb,KAAK,IAAI;EACT,MAAM,IAAI;EACV,aAAa,IAAI;EACjB,UAAU,iBAAiB,IAAI,KAAK,QAAQ;CAC7C,GAAE;AAEL,QAAO;EACL;EACA;EACA,gBAAgB,kBAAkB,QAAQ;CAC3C;AACF;;;;;AAMD,SAAgB,wBAAwBC,SAKrC;CACD,MAAM,EAAE,YAAY,kBAAkB,SAAS,WAAW,GAAG;AAC7D,QAAO,UAAU;EACf,cAAc,gCAAgC,QAAQ;EACtD,YAAY,EAAE,OAAO,CAAE,EAAC;EACxB,SAAS,YAAY;AACnB,UAAO,sBAAsB,YAAY,kBAAkB,SAAS,EAClE,UACD,EAAC;EACH;CACF,EAAC;AACH;;;;AAKD,SAAgB,iBACdC,KACAC,SACsB;CACtB,MAAMC,iBAA2C;EAC/C,OAAO;GAAC;GAAS;GAAW;GAAQ;GAAS;EAAQ;EACrD,aAAa;GAAC;GAAc;GAAW;EAAc;EACrD,SAAS;GAAC;GAAU;GAAU;EAAgB;EAC9C,MAAM,CAAC,WAAW,mBAAoB;CACvC;CAED,MAAMC,gBAA0C;EAC9C,GAAG;EACH,qBAAqB;GAAC;GAAqB;GAAa;EAAK;EAC7D,IAAI;GAAC;GAAc;GAAY;EAAU;CAC1C;CAED,MAAMC,gBAA0C;EAC9C,GAAG;EACH,eAAe;GAAC;GAAO;GAAQ;GAAO;EAAS;EAC/C,oBAAoB;GAAC;GAAO;GAAO;EAAM;EACzC,aAAa;GAAC;GAAc;GAAS;EAAQ;CAC9C;AAED,KAAI,YAAY,gBACd,QAAO,cAAc;AAEvB,KAAI,YAAY,YAAY,YAAY,SACtC,QAAO,cAAc;AAGvB,QAAO,eAAe;AACvB;;;;AAKD,SAAgB,kBAAkBH,SAAiB;AACjD,KAAI,YAAY,gBACd,QAAO;EACL;GAAE,SAAS;GAAiB,aAAa;EAAe;EACxD;GAAE,SAAS;GAAe,aAAa;EAAiB;EACxD;GAAE,SAAS;GAAe,aAAa;EAAsB;EAC7D;GACE,SAAS;GACT,aAAa;EACd;EACD;GACE,SAAS;GACT,aAAa;EACd;CACF;AAEH,KAAI,YAAY,YAAY,YAAY,SACtC,QAAO;EACL;GAAE,SAAS;GAAe,aAAa;EAAgB;EACvD;GAAE,SAAS;GAA0B,aAAa;EAAqB;EACvE;GAAE,SAAS;GAAiB,aAAa;EAAyB;EAClE;GAAE,SAAS;GAAmB,aAAa;EAAiB;EAC5D;GAAE,SAAS;GAAoB,aAAa;EAAoB;CACjE;AAGH,QAAO,CAAE;AACV"}
1
+ {"version":3,"file":"dataset-fields-dZ43jEgF.js","names":["apiService: SentryApiService","organizationSlug: string","dataset: DatasetType","options: {\n projectId?: string;\n }","options: {\n apiService: SentryApiService;\n organizationSlug: string;\n dataset: DatasetType;\n projectId?: string;\n}","key: string","dataset: string","commonExamples: Record<string, string[]>","issueExamples: Record<string, string[]>","eventExamples: Record<string, string[]>"],"sources":["../src/internal/agents/tools/dataset-fields.ts"],"sourcesContent":["import { z } from \"zod\";\nimport type { SentryApiService } from \"../../../api-client\";\nimport { agentTool } from \"./utils\";\n\nexport type DatasetType = \"events\" | \"errors\" | \"search_issues\";\n\nexport interface DatasetField {\n key: string;\n name: string;\n totalValues: number;\n examples?: string[];\n}\n\nexport interface DatasetFieldsResult {\n dataset: string;\n fields: DatasetField[];\n commonPatterns: Array<{ pattern: string; description: string }>;\n}\n\n/**\n * Discover available fields for a dataset by querying Sentry's tags API\n */\nexport async function discoverDatasetFields(\n apiService: SentryApiService,\n organizationSlug: string,\n dataset: DatasetType,\n options: {\n projectId?: string;\n } = {},\n): Promise<DatasetFieldsResult> {\n const { projectId } = options;\n\n // Get available tags for the dataset\n const tags = await apiService.listTags({\n organizationSlug,\n dataset,\n project: projectId,\n statsPeriod: \"14d\",\n });\n\n // Filter out internal Sentry tags and format\n const fields = tags\n .filter((tag) => !tag.key.startsWith(\"sentry:\"))\n .map((tag) => ({\n key: tag.key,\n name: tag.name,\n totalValues: tag.totalValues,\n examples: getFieldExamples(tag.key, dataset),\n }));\n\n return {\n dataset,\n fields,\n commonPatterns: getCommonPatterns(dataset),\n };\n}\n\n/**\n * Create a tool for discovering available fields in a dataset\n * The tool is pre-bound with the API service and organization configured for the appropriate region\n */\nexport function createDatasetFieldsTool(options: {\n apiService: SentryApiService;\n organizationSlug: string;\n dataset: DatasetType;\n projectId?: string;\n}) {\n const { apiService, organizationSlug, dataset, projectId } = options;\n return agentTool({\n description: `Discover available fields for ${dataset} searches in Sentry (includes example values)`,\n parameters: z.object({}),\n execute: async () => {\n return discoverDatasetFields(apiService, organizationSlug, dataset, {\n projectId,\n });\n },\n });\n}\n\n/**\n * Get example values for common fields\n */\nexport function getFieldExamples(\n key: string,\n dataset: string,\n): string[] | undefined {\n const commonExamples: Record<string, string[]> = {\n level: [\"error\", \"warning\", \"info\", \"debug\", \"fatal\"],\n environment: [\"production\", \"staging\", \"development\"],\n release: [\"v1.0.0\", \"latest\", \"backend@1.2.3\"],\n user: [\"user123\", \"email@example.com\"],\n };\n\n const issueExamples: Record<string, string[]> = {\n ...commonExamples,\n assignedOrSuggested: [\"email@example.com\", \"team-slug\", \"me\"],\n is: [\"unresolved\", \"resolved\", \"ignored\"],\n };\n\n const eventExamples: Record<string, string[]> = {\n ...commonExamples,\n \"http.method\": [\"GET\", \"POST\", \"PUT\", \"DELETE\"],\n \"http.status_code\": [\"200\", \"404\", \"500\"],\n \"db.system\": [\"postgresql\", \"mysql\", \"redis\"],\n };\n\n if (dataset === \"search_issues\") {\n return issueExamples[key];\n }\n if (dataset === \"events\" || dataset === \"errors\") {\n return eventExamples[key];\n }\n\n return commonExamples[key];\n}\n\n/**\n * Get common search patterns for a dataset\n */\nexport function getCommonPatterns(dataset: string) {\n if (dataset === \"search_issues\") {\n return [\n { pattern: \"is:unresolved\", description: \"Open issues\" },\n { pattern: \"is:resolved\", description: \"Closed issues\" },\n { pattern: \"level:error\", description: \"Error level issues\" },\n {\n pattern: \"firstSeen:-24h\",\n description: \"New issues from last 24 hours\",\n },\n {\n pattern: \"userCount:>100\",\n description: \"Affecting more than 100 users\",\n },\n ];\n }\n if (dataset === \"events\" || dataset === \"errors\") {\n return [\n { pattern: \"level:error\", description: \"Error events\" },\n { pattern: \"environment:production\", description: \"Production events\" },\n { pattern: \"timestamp:-1h\", description: \"Events from last hour\" },\n { pattern: \"has:http.method\", description: \"HTTP requests\" },\n { pattern: \"has:db.statement\", description: \"Database queries\" },\n ];\n }\n\n return [];\n}\n"],"mappings":";;;;;;;AAsBA,eAAsB,sBACpBA,YACAC,kBACAC,SACAC,UAEI,CAAE,GACwB;CAC9B,MAAM,EAAE,WAAW,GAAG;CAGtB,MAAM,OAAO,MAAM,WAAW,SAAS;EACrC;EACA;EACA,SAAS;EACT,aAAa;CACd,EAAC;CAGF,MAAM,SAAS,KACZ,OAAO,CAAC,SAAS,IAAI,IAAI,WAAW,UAAU,CAAC,CAC/C,IAAI,CAAC,SAAS;EACb,KAAK,IAAI;EACT,MAAM,IAAI;EACV,aAAa,IAAI;EACjB,UAAU,iBA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,YAAY,YAAY,SACtC,QAAO;EACL;GAAE,SAAS;GAAe,aAAa;EAAgB;EACvD;GAAE,SAAS;GAA0B,aAAa;EAAqB;EACvE;GAAE,SAAS;GAAiB,aAAa;EAAyB;EAClE;GAAE,SAAS;GAAmB,aAAa;EAAiB;EAC5D;GAAE,SAAS;GAAoB,aAAa;EAAoB;CACjE;AAGH,QAAO,CAAE;AACV"}
@@ -11,4 +11,4 @@ Object.defineProperty(exports, 'defineTool', {
11
11
  return defineTool;
12
12
  }
13
13
  });
14
- //# sourceMappingURL=define-BfP4rFlE.cjs.map
14
+ //# sourceMappingURL=define-CLp6EtpZ.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"define-BfP4rFlE.cjs","names":["config: ToolConfig<TSchema>"],"sources":["../src/internal/tool-helpers/define.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { ToolConfig } from \"../../tools/types\";\n\nexport function defineTool<TSchema extends Record<string, z.ZodType>>(\n config: ToolConfig<TSchema>,\n) {\n return config;\n}\n"],"mappings":";;AAGA,SAAgB,WACdA,QACA;AACA,QAAO;AACR"}
1
+ {"version":3,"file":"define-CLp6EtpZ.cjs","names":["config: ToolConfig<TSchema>"],"sources":["../src/internal/tool-helpers/define.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { ToolConfig } from \"../../tools/types\";\n\nexport function defineTool<TSchema extends Record<string, z.ZodType>>(\n config: ToolConfig<TSchema>,\n) {\n return config;\n}\n"],"mappings":";;AAGA,SAAgB,WACdA,QACA;AACA,QAAO;AACR"}
@@ -5,4 +5,4 @@ function defineTool(config) {
5
5
 
6
6
  //#endregion
7
7
  export { defineTool };
8
- //# sourceMappingURL=define-2Lj8Lm1t.js.map
8
+ //# sourceMappingURL=define-vA6uuVue.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"define-2Lj8Lm1t.js","names":["config: ToolConfig<TSchema>"],"sources":["../src/internal/tool-helpers/define.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { ToolConfig } from \"../../tools/types\";\n\nexport function defineTool<TSchema extends Record<string, z.ZodType>>(\n config: ToolConfig<TSchema>,\n) {\n return config;\n}\n"],"mappings":";AAGA,SAAgB,WACdA,QACA;AACA,QAAO;AACR"}
1
+ {"version":3,"file":"define-vA6uuVue.js","names":["config: ToolConfig<TSchema>"],"sources":["../src/internal/tool-helpers/define.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { ToolConfig } from \"../../tools/types\";\n\nexport function defineTool<TSchema extends Record<string, z.ZodType>>(\n config: ToolConfig<TSchema>,\n) {\n return config;\n}\n"],"mappings":";AAGA,SAAgB,WACdA,QACA;AACA,QAAO;AACR"}
@@ -1,4 +1,4 @@
1
- import { ApiNotFoundError } from "./errors-CQZ-QlOB.js";
1
+ import { ApiNotFoundError } from "./errors-DUEMWOr1.js";
2
2
 
3
3
  //#region src/internal/tool-helpers/enhance-error.ts
4
4
  /**
@@ -29,4 +29,4 @@ function enhanceNotFoundError(error, params) {
29
29
 
30
30
  //#endregion
31
31
  export { enhanceNotFoundError };
32
- //# sourceMappingURL=enhance-error-D3QfZOhm.js.map
32
+ //# sourceMappingURL=enhance-error-BULHg3Tl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"enhance-error-D3QfZOhm.js","names":["error: ApiNotFoundError","params: Record<string, unknown>","paramsList: string[]"],"sources":["../src/internal/tool-helpers/enhance-error.ts"],"sourcesContent":["import { ApiNotFoundError } from \"../../api-client\";\n\n/**\n * Enhances a 404 error with parameter context to help users understand what went wrong.\n * This is optional - tools can use this when they want to provide extra context.\n *\n * @example\n * ```typescript\n * try {\n * const issue = await apiService.getIssue({ organizationSlug, issueId });\n * } catch (error) {\n * if (error instanceof ApiNotFoundError) {\n * throw enhanceNotFoundError(error, { organizationSlug, issueId });\n * }\n * throw error;\n * }\n * ```\n */\nexport function enhanceNotFoundError(\n error: ApiNotFoundError,\n params: Record<string, unknown>,\n): ApiNotFoundError {\n const paramsList: string[] = [];\n\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 const enhancedMessage = `${error.message}\\nPlease verify these parameters are correct:\\n${paramsList.map((p) => ` - ${p}`).join(\"\\n\")}`;\n return new ApiNotFoundError(\n enhancedMessage,\n error.detail,\n error.responseBody,\n );\n }\n\n return error;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,SAAgB,qBACdA,OACAC,QACkB;CAClB,MAAMC,aAAuB,CAAE;AAE/B,MAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,OAAO,CAC/C,KAAI,oBAAuB,UAAU,QAAQ,UAAU,GACrD,YAAW,QAAQ,IAAI,KAAK,MAAM,GAAG;AAIzC,KAAI,WAAW,SAAS,GAAG;EACzB,MAAM,qBAAqB,MAAM,QAAQ,iDAAiD,WAAW,IAAI,CAAC,OAAO,MAAM,IAAI,CAAC,KAAK,KAAK;AACtI,SAAO,IAAI,iBACT,iBACA,MAAM,QACN,MAAM;CAET;AAED,QAAO;AACR"}
1
+ {"version":3,"file":"enhance-error-BULHg3Tl.js","names":["error: ApiNotFoundError","params: Record<string, unknown>","paramsList: string[]"],"sources":["../src/internal/tool-helpers/enhance-error.ts"],"sourcesContent":["import { ApiNotFoundError } from \"../../api-client\";\n\n/**\n * Enhances a 404 error with parameter context to help users understand what went wrong.\n * This is optional - tools can use this when they want to provide extra context.\n *\n * @example\n * ```typescript\n * try {\n * const issue = await apiService.getIssue({ organizationSlug, issueId });\n * } catch (error) {\n * if (error instanceof ApiNotFoundError) {\n * throw enhanceNotFoundError(error, { organizationSlug, issueId });\n * }\n * throw error;\n * }\n * ```\n */\nexport function enhanceNotFoundError(\n error: ApiNotFoundError,\n params: Record<string, unknown>,\n): ApiNotFoundError {\n const paramsList: string[] = [];\n\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 const enhancedMessage = `${error.message}\\nPlease verify these parameters are correct:\\n${paramsList.map((p) => ` - ${p}`).join(\"\\n\")}`;\n return new ApiNotFoundError(\n enhancedMessage,\n error.detail,\n error.responseBody,\n );\n }\n\n return error;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,SAAgB,qBACdA,OACAC,QACkB;CAClB,MAAMC,aAAuB,CAAE;AAE/B,MAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,OAAO,CAC/C,KAAI,oBAAuB,UAAU,QAAQ,UAAU,GACrD,YAAW,QAAQ,IAAI,KAAK,MAAM,GAAG;AAIzC,KAAI,WAAW,SAAS,GAAG;EACzB,MAAM,qBAAqB,MAAM,QAAQ,iDAAiD,WAAW,IAAI,CAAC,OAAO,MAAM,IAAI,CAAC,KAAK,KAAK;AACtI,SAAO,IAAI,iBACT,iBACA,MAAM,QACN,MAAM;CAET;AAED,QAAO;AACR"}
@@ -1,4 +1,4 @@
1
- const require_errors = require('./errors-Bmqdg5Q6.cjs');
1
+ const require_errors = require('./errors-DWysOIMw.cjs');
2
2
 
3
3
  //#region src/internal/tool-helpers/enhance-error.ts
4
4
  /**
@@ -34,4 +34,4 @@ Object.defineProperty(exports, 'enhanceNotFoundError', {
34
34
  return enhanceNotFoundError;
35
35
  }
36
36
  });
37
- //# sourceMappingURL=enhance-error-DzXrKg85.cjs.map
37
+ //# sourceMappingURL=enhance-error-vihkdCX5.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"enhance-error-DzXrKg85.cjs","names":["error: ApiNotFoundError","params: Record<string, unknown>","paramsList: string[]","ApiNotFoundError"],"sources":["../src/internal/tool-helpers/enhance-error.ts"],"sourcesContent":["import { ApiNotFoundError } from \"../../api-client\";\n\n/**\n * Enhances a 404 error with parameter context to help users understand what went wrong.\n * This is optional - tools can use this when they want to provide extra context.\n *\n * @example\n * ```typescript\n * try {\n * const issue = await apiService.getIssue({ organizationSlug, issueId });\n * } catch (error) {\n * if (error instanceof ApiNotFoundError) {\n * throw enhanceNotFoundError(error, { organizationSlug, issueId });\n * }\n * throw error;\n * }\n * ```\n */\nexport function enhanceNotFoundError(\n error: ApiNotFoundError,\n params: Record<string, unknown>,\n): ApiNotFoundError {\n const paramsList: string[] = [];\n\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 const enhancedMessage = `${error.message}\\nPlease verify these parameters are correct:\\n${paramsList.map((p) => ` - ${p}`).join(\"\\n\")}`;\n return new ApiNotFoundError(\n enhancedMessage,\n error.detail,\n error.responseBody,\n );\n }\n\n return error;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,SAAgB,qBACdA,OACAC,QACkB;CAClB,MAAMC,aAAuB,CAAE;AAE/B,MAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,OAAO,CAC/C,KAAI,oBAAuB,UAAU,QAAQ,UAAU,GACrD,YAAW,QAAQ,IAAI,KAAK,MAAM,GAAG;AAIzC,KAAI,WAAW,SAAS,GAAG;EACzB,MAAM,qBAAqB,MAAM,QAAQ,iDAAiD,WAAW,IAAI,CAAC,OAAO,MAAM,IAAI,CAAC,KAAK,KAAK;AACtI,SAAO,IAAIC,gCACT,iBACA,MAAM,QACN,MAAM;CAET;AAED,QAAO;AACR"}
1
+ {"version":3,"file":"enhance-error-vihkdCX5.cjs","names":["error: ApiNotFoundError","params: Record<string, unknown>","paramsList: string[]","ApiNotFoundError"],"sources":["../src/internal/tool-helpers/enhance-error.ts"],"sourcesContent":["import { ApiNotFoundError } from \"../../api-client\";\n\n/**\n * Enhances a 404 error with parameter context to help users understand what went wrong.\n * This is optional - tools can use this when they want to provide extra context.\n *\n * @example\n * ```typescript\n * try {\n * const issue = await apiService.getIssue({ organizationSlug, issueId });\n * } catch (error) {\n * if (error instanceof ApiNotFoundError) {\n * throw enhanceNotFoundError(error, { organizationSlug, issueId });\n * }\n * throw error;\n * }\n * ```\n */\nexport function enhanceNotFoundError(\n error: ApiNotFoundError,\n params: Record<string, unknown>,\n): ApiNotFoundError {\n const paramsList: string[] = [];\n\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 const enhancedMessage = `${error.message}\\nPlease verify these parameters are correct:\\n${paramsList.map((p) => ` - ${p}`).join(\"\\n\")}`;\n return new ApiNotFoundError(\n enhancedMessage,\n error.detail,\n error.responseBody,\n );\n }\n\n return error;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,SAAgB,qBACdA,OACAC,QACkB;CAClB,MAAMC,aAAuB,CAAE;AAE/B,MAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,OAAO,CAC/C,KAAI,oBAAuB,UAAU,QAAQ,UAAU,GACrD,YAAW,QAAQ,IAAI,KAAK,MAAM,GAAG;AAIzC,KAAI,WAAW,SAAS,GAAG;EACzB,MAAM,qBAAqB,MAAM,QAAQ,iDAAiD,WAAW,IAAI,CAAC,OAAO,MAAM,IAAI,CAAC,KAAK,KAAK;AACtI,SAAO,IAAIC,gCACT,iBACA,MAAM,QACN,MAAM;CAET;AAED,QAAO;AACR"}
@@ -1,6 +1,6 @@
1
- const require_errors = require('./errors-BtJEw2Z-.cjs');
2
- const require_logging = require('./logging-CkAJKyq2.cjs');
3
- const require_errors$1 = require('./errors-Bmqdg5Q6.cjs');
1
+ const require_errors = require('./errors-umQzF_vW.cjs');
2
+ const require_logging = require('./logging-DrbQ8weU.cjs');
3
+ const require_errors$1 = require('./errors-DWysOIMw.cjs');
4
4
 
5
5
  //#region src/internal/error-handling.ts
6
6
  /**
@@ -129,4 +129,4 @@ Object.defineProperty(exports, 'isUserInputError', {
129
129
  return isUserInputError;
130
130
  }
131
131
  });
132
- //# sourceMappingURL=error-handling-CxV2m_Dr.cjs.map
132
+ //# sourceMappingURL=error-handling-19djRJdh.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-handling-CxV2m_Dr.cjs","names":["error: unknown","UserInputError","ConfigurationError","ApiError","ApiClientError","ApiServerError","eventId"],"sources":["../src/internal/error-handling.ts"],"sourcesContent":["import { UserInputError, ConfigurationError } from \"../errors\";\nimport { ApiError, ApiClientError, ApiServerError } from \"../api-client\";\nimport { logIssue } from \"../telem/logging\";\n\n/**\n * Type guard to identify user input validation errors.\n */\nexport function isUserInputError(error: unknown): error is UserInputError {\n return error instanceof UserInputError;\n}\n\n/**\n * Type guard to identify configuration errors.\n */\nexport function isConfigurationError(\n error: unknown,\n): error is ConfigurationError {\n return error instanceof ConfigurationError;\n}\n\n/**\n * Type guard to identify API errors.\n */\nexport function isApiError(error: unknown): error is ApiError {\n return error instanceof ApiError;\n}\n\n/**\n * Type guard to identify API client errors (4xx).\n */\nexport function isApiClientError(error: unknown): error is ApiClientError {\n return error instanceof ApiClientError;\n}\n\n/**\n * Type guard to identify API server errors (5xx).\n */\nexport function isApiServerError(error: unknown): error is ApiServerError {\n return error instanceof ApiServerError;\n}\n\n/**\n * Format an error for user display with markdown formatting.\n * This is used by tool handlers to format errors for MCP responses.\n *\n * SECURITY: Only return trusted error messages to prevent prompt injection vulnerabilities.\n * We trust: Sentry API errors, our own UserInputError/ConfigurationError messages, and system templates.\n */\nexport async function formatErrorForUser(error: unknown): Promise<string> {\n if (isUserInputError(error)) {\n return [\n \"**Input Error**\",\n \"It looks like there was a problem with the input you provided.\",\n error.message,\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n if (isConfigurationError(error)) {\n return [\n \"**Configuration Error**\",\n \"There appears to be a configuration issue with your setup.\",\n error.message,\n `Please check your environment configuration and try again.`,\n ].join(\"\\n\\n\");\n }\n\n // Handle ApiClientError (4xx) - user input errors, should NOT be logged to Sentry\n if (isApiClientError(error)) {\n const statusText = error.status\n ? `There was an HTTP ${error.status} error with your request to the Sentry API.`\n : \"There was an error with your request.\";\n\n return [\n \"**Input Error**\",\n statusText,\n error.toUserMessage(),\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n // Handle ApiServerError (5xx) - system errors, SHOULD be logged to Sentry\n if (isApiServerError(error)) {\n const eventId = logIssue(error);\n const statusText = error.status\n ? `There was an HTTP ${error.status} server error with the Sentry API.`\n : \"There was a server error.\";\n\n return [\n \"**Error**\",\n statusText,\n `${error.message}`,\n `**Event ID**: ${eventId}`,\n `Please contact support with this Event ID if the problem persists.`,\n ].join(\"\\n\\n\");\n }\n\n // Handle generic ApiError (shouldn't happen with new hierarchy, but just in case)\n if (isApiError(error)) {\n const statusText = error.status\n ? `There was an HTTP ${error.status} error with your request to the Sentry API.`\n : \"There was an error with your request.\";\n\n return [\n \"**Error**\",\n statusText,\n `${error.message}`,\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n const eventId = logIssue(error);\n\n return [\n \"**Error**\",\n \"It looks like there was a problem communicating with the Sentry API.\",\n \"Please report the following to the user for the Sentry team:\",\n `**Event ID**: ${eventId}`,\n process.env.NODE_ENV !== \"production\"\n ? error instanceof Error\n ? error.message\n : String(error)\n : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\\n\");\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,iBAAiBA,OAAyC;AACxE,QAAO,iBAAiBC;AACzB;;;;AAKD,SAAgB,qBACdD,OAC6B;AAC7B,QAAO,iBAAiBE;AACzB;;;;AAKD,SAAgB,WAAWF,OAAmC;AAC5D,QAAO,iBAAiBG;AACzB;;;;AAKD,SAAgB,iBAAiBH,OAAyC;AACxE,QAAO,iBAAiBI;AACzB;;;;AAKD,SAAgB,iBAAiBJ,OAAyC;AACxE,QAAO,iBAAiBK;AACzB;;;;;;;;AASD,eAAsB,mBAAmBL,OAAiC;AACxE,KAAI,iBAAiB,MAAM,CACzB,QAAO;EACL;EACA;EACA,MAAM;GACL;CACF,EAAC,KAAK,OAAO;AAGhB,KAAI,qBAAqB,MAAM,CAC7B,QAAO;EACL;EACA;EACA,MAAM;GACL;CACF,EAAC,KAAK,OAAO;AAIhB,KAAI,iBAAiB,MAAM,EAAE;EAC3B,MAAM,aAAa,MAAM,UACpB,oBAAoB,MAAM,OAAO,+CAClC;AAEJ,SAAO;GACL;GACA;GACA,MAAM,eAAe;IACpB;EACF,EAAC,KAAK,OAAO;CACf;AAGD,KAAI,iBAAiB,MAAM,EAAE;EAC3B,MAAMM,YAAU,yBAAS,MAAM;EAC/B,MAAM,aAAa,MAAM,UACpB,oBAAoB,MAAM,OAAO,sCAClC;AAEJ,SAAO;GACL;GACA;MACG,MAAM;IACR,gBAAgBA;IAChB;EACF,EAAC,KAAK,OAAO;CACf;AAGD,KAAI,WAAW,MAAM,EAAE;EACrB,MAAM,aAAa,MAAM,UACpB,oBAAoB,MAAM,OAAO,+CAClC;AAEJ,SAAO;GACL;GACA;MACG,MAAM;IACR;EACF,EAAC,KAAK,OAAO;CACf;CAED,MAAM,UAAU,yBAAS,MAAM;AAE/B,QAAO;EACL;EACA;EACA;GACC,gBAAgB;EACjB,QAAQ,IAAI,aAAa,eACrB,iBAAiB,QACf,MAAM,UACN,OAAO,MAAM,GACf;CACL,EACE,OAAO,QAAQ,CACf,KAAK,OAAO;AAChB"}
1
+ {"version":3,"file":"error-handling-19djRJdh.cjs","names":["error: unknown","UserInputError","ConfigurationError","ApiError","ApiClientError","ApiServerError","eventId"],"sources":["../src/internal/error-handling.ts"],"sourcesContent":["import { UserInputError, ConfigurationError } from \"../errors\";\nimport { ApiError, ApiClientError, ApiServerError } from \"../api-client\";\nimport { logIssue } from \"../telem/logging\";\n\n/**\n * Type guard to identify user input validation errors.\n */\nexport function isUserInputError(error: unknown): error is UserInputError {\n return error instanceof UserInputError;\n}\n\n/**\n * Type guard to identify configuration errors.\n */\nexport function isConfigurationError(\n error: unknown,\n): error is ConfigurationError {\n return error instanceof ConfigurationError;\n}\n\n/**\n * Type guard to identify API errors.\n */\nexport function isApiError(error: unknown): error is ApiError {\n return error instanceof ApiError;\n}\n\n/**\n * Type guard to identify API client errors (4xx).\n */\nexport function isApiClientError(error: unknown): error is ApiClientError {\n return error instanceof ApiClientError;\n}\n\n/**\n * Type guard to identify API server errors (5xx).\n */\nexport function isApiServerError(error: unknown): error is ApiServerError {\n return error instanceof ApiServerError;\n}\n\n/**\n * Format an error for user display with markdown formatting.\n * This is used by tool handlers to format errors for MCP responses.\n *\n * SECURITY: Only return trusted error messages to prevent prompt injection vulnerabilities.\n * We trust: Sentry API errors, our own UserInputError/ConfigurationError messages, and system templates.\n */\nexport async function formatErrorForUser(error: unknown): Promise<string> {\n if (isUserInputError(error)) {\n return [\n \"**Input Error**\",\n \"It looks like there was a problem with the input you provided.\",\n error.message,\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n if (isConfigurationError(error)) {\n return [\n \"**Configuration Error**\",\n \"There appears to be a configuration issue with your setup.\",\n error.message,\n `Please check your environment configuration and try again.`,\n ].join(\"\\n\\n\");\n }\n\n // Handle ApiClientError (4xx) - user input errors, should NOT be logged to Sentry\n if (isApiClientError(error)) {\n const statusText = error.status\n ? `There was an HTTP ${error.status} error with your request to the Sentry API.`\n : \"There was an error with your request.\";\n\n return [\n \"**Input Error**\",\n statusText,\n error.toUserMessage(),\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n // Handle ApiServerError (5xx) - system errors, SHOULD be logged to Sentry\n if (isApiServerError(error)) {\n const eventId = logIssue(error);\n const statusText = error.status\n ? `There was an HTTP ${error.status} server error with the Sentry API.`\n : \"There was a server error.\";\n\n return [\n \"**Error**\",\n statusText,\n `${error.message}`,\n `**Event ID**: ${eventId}`,\n `Please contact support with this Event ID if the problem persists.`,\n ].join(\"\\n\\n\");\n }\n\n // Handle generic ApiError (shouldn't happen with new hierarchy, but just in case)\n if (isApiError(error)) {\n const statusText = error.status\n ? `There was an HTTP ${error.status} error with your request to the Sentry API.`\n : \"There was an error with your request.\";\n\n return [\n \"**Error**\",\n statusText,\n `${error.message}`,\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n const eventId = logIssue(error);\n\n return [\n \"**Error**\",\n \"It looks like there was a problem communicating with the Sentry API.\",\n \"Please report the following to the user for the Sentry team:\",\n `**Event ID**: ${eventId}`,\n process.env.NODE_ENV !== \"production\"\n ? error instanceof Error\n ? error.message\n : String(error)\n : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\\n\");\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,iBAAiBA,OAAyC;AACxE,QAAO,iBAAiBC;AACzB;;;;AAKD,SAAgB,qBACdD,OAC6B;AAC7B,QAAO,iBAAiBE;AACzB;;;;AAKD,SAAgB,WAAWF,OAAmC;AAC5D,QAAO,iBAAiBG;AACzB;;;;AAKD,SAAgB,iBAAiBH,OAAyC;AACxE,QAAO,iBAAiBI;AACzB;;;;AAKD,SAAgB,iBAAiBJ,OAAyC;AACxE,QAAO,iBAAiBK;AACzB;;;;;;;;AASD,eAAsB,mBAAmBL,OAAiC;AACxE,KAAI,iBAAiB,MAAM,CACzB,QAAO;EACL;EACA;EACA,MAAM;GACL;CACF,EAAC,KAAK,OAAO;AAGhB,KAAI,qBAAqB,MAAM,CAC7B,QAAO;EACL;EACA;EACA,MAAM;GACL;CACF,EAAC,KAAK,OAAO;AAIhB,KAAI,iBAAiB,MAAM,EAAE;EAC3B,MAAM,aAAa,MAAM,UACpB,oBAAoB,MAAM,OAAO,+CAClC;AAEJ,SAAO;GACL;GACA;GACA,MAAM,eAAe;IACpB;EACF,EAAC,KAAK,OAAO;CACf;AAGD,KAAI,iBAAiB,MAAM,EAAE;EAC3B,MAAMM,YAAU,yBAAS,MAAM;EAC/B,MAAM,aAAa,MAAM,UACpB,oBAAoB,MAAM,OAAO,sCAClC;AAEJ,SAAO;GACL;GACA;MACG,MAAM;IACR,gBAAgBA;IAChB;EACF,EAAC,KAAK,OAAO;CACf;AAGD,KAAI,WAAW,MAAM,EAAE;EACrB,MAAM,aAAa,MAAM,UACpB,oBAAoB,MAAM,OAAO,+CAClC;AAEJ,SAAO;GACL;GACA;MACG,MAAM;IACR;EACF,EAAC,KAAK,OAAO;CACf;CAED,MAAM,UAAU,yBAAS,MAAM;AAE/B,QAAO;EACL;EACA;EACA;GACC,gBAAgB;EACjB,QAAQ,IAAI,aAAa,eACrB,iBAAiB,QACf,MAAM,UACN,OAAO,MAAM,GACf;CACL,EACE,OAAO,QAAQ,CACf,KAAK,OAAO;AAChB"}
@@ -1,6 +1,6 @@
1
- import { ConfigurationError, UserInputError } from "./errors-D_R568zP.js";
2
- import { logIssue } from "./logging-DqqDTe02.js";
3
- import { ApiClientError, ApiError, ApiServerError } from "./errors-CQZ-QlOB.js";
1
+ import { ConfigurationError, UserInputError } from "./errors-BXmNwD2K.js";
2
+ import { logIssue } from "./logging-ChQnSEmD.js";
3
+ import { ApiClientError, ApiError, ApiServerError } from "./errors-DUEMWOr1.js";
4
4
 
5
5
  //#region src/internal/error-handling.ts
6
6
  /**
@@ -94,4 +94,4 @@ async function formatErrorForUser(error) {
94
94
 
95
95
  //#endregion
96
96
  export { formatErrorForUser, isApiClientError, isApiError, isApiServerError, isConfigurationError, isUserInputError };
97
- //# sourceMappingURL=error-handling-R4SJQ7n0.js.map
97
+ //# sourceMappingURL=error-handling-CLnyY1TR.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-handling-R4SJQ7n0.js","names":["error: unknown","eventId"],"sources":["../src/internal/error-handling.ts"],"sourcesContent":["import { UserInputError, ConfigurationError } from \"../errors\";\nimport { ApiError, ApiClientError, ApiServerError } from \"../api-client\";\nimport { logIssue } from \"../telem/logging\";\n\n/**\n * Type guard to identify user input validation errors.\n */\nexport function isUserInputError(error: unknown): error is UserInputError {\n return error instanceof UserInputError;\n}\n\n/**\n * Type guard to identify configuration errors.\n */\nexport function isConfigurationError(\n error: unknown,\n): error is ConfigurationError {\n return error instanceof ConfigurationError;\n}\n\n/**\n * Type guard to identify API errors.\n */\nexport function isApiError(error: unknown): error is ApiError {\n return error instanceof ApiError;\n}\n\n/**\n * Type guard to identify API client errors (4xx).\n */\nexport function isApiClientError(error: unknown): error is ApiClientError {\n return error instanceof ApiClientError;\n}\n\n/**\n * Type guard to identify API server errors (5xx).\n */\nexport function isApiServerError(error: unknown): error is ApiServerError {\n return error instanceof ApiServerError;\n}\n\n/**\n * Format an error for user display with markdown formatting.\n * This is used by tool handlers to format errors for MCP responses.\n *\n * SECURITY: Only return trusted error messages to prevent prompt injection vulnerabilities.\n * We trust: Sentry API errors, our own UserInputError/ConfigurationError messages, and system templates.\n */\nexport async function formatErrorForUser(error: unknown): Promise<string> {\n if (isUserInputError(error)) {\n return [\n \"**Input Error**\",\n \"It looks like there was a problem with the input you provided.\",\n error.message,\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n if (isConfigurationError(error)) {\n return [\n \"**Configuration Error**\",\n \"There appears to be a configuration issue with your setup.\",\n error.message,\n `Please check your environment configuration and try again.`,\n ].join(\"\\n\\n\");\n }\n\n // Handle ApiClientError (4xx) - user input errors, should NOT be logged to Sentry\n if (isApiClientError(error)) {\n const statusText = error.status\n ? `There was an HTTP ${error.status} error with your request to the Sentry API.`\n : \"There was an error with your request.\";\n\n return [\n \"**Input Error**\",\n statusText,\n error.toUserMessage(),\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n // Handle ApiServerError (5xx) - system errors, SHOULD be logged to Sentry\n if (isApiServerError(error)) {\n const eventId = logIssue(error);\n const statusText = error.status\n ? `There was an HTTP ${error.status} server error with the Sentry API.`\n : \"There was a server error.\";\n\n return [\n \"**Error**\",\n statusText,\n `${error.message}`,\n `**Event ID**: ${eventId}`,\n `Please contact support with this Event ID if the problem persists.`,\n ].join(\"\\n\\n\");\n }\n\n // Handle generic ApiError (shouldn't happen with new hierarchy, but just in case)\n if (isApiError(error)) {\n const statusText = error.status\n ? `There was an HTTP ${error.status} error with your request to the Sentry API.`\n : \"There was an error with your request.\";\n\n return [\n \"**Error**\",\n statusText,\n `${error.message}`,\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n const eventId = logIssue(error);\n\n return [\n \"**Error**\",\n \"It looks like there was a problem communicating with the Sentry API.\",\n \"Please report the following to the user for the Sentry team:\",\n `**Event ID**: ${eventId}`,\n process.env.NODE_ENV !== \"production\"\n ? error instanceof Error\n ? error.message\n : String(error)\n : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\\n\");\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,iBAAiBA,OAAyC;AACxE,QAAO,iBAAiB;AACzB;;;;AAKD,SAAgB,qBACdA,OAC6B;AAC7B,QAAO,iBAAiB;AACzB;;;;AAKD,SAAgB,WAAWA,OAAmC;AAC5D,QAAO,iBAAiB;AACzB;;;;AAKD,SAAgB,iBAAiBA,OAAyC;AACxE,QAAO,iBAAiB;AACzB;;;;AAKD,SAAgB,iBAAiBA,OAAyC;AACxE,QAAO,iBAAiB;AACzB;;;;;;;;AASD,eAAsB,mBAAmBA,OAAiC;AACxE,KAAI,iBAAiB,MAAM,CACzB,QAAO;EACL;EACA;EACA,MAAM;GACL;CACF,EAAC,KAAK,OAAO;AAGhB,KAAI,qBAAqB,MAAM,CAC7B,QAAO;EACL;EACA;EACA,MAAM;GACL;CACF,EAAC,KAAK,OAAO;AAIhB,KAAI,iBAAiB,MAAM,EAAE;EAC3B,MAAM,aAAa,MAAM,UACpB,oBAAoB,MAAM,OAAO,+CAClC;AAEJ,SAAO;GACL;GACA;GACA,MAAM,eAAe;IACpB;EACF,EAAC,KAAK,OAAO;CACf;AAGD,KAAI,iBAAiB,MAAM,EAAE;EAC3B,MAAMC,YAAU,SAAS,MAAM;EAC/B,MAAM,aAAa,MAAM,UACpB,oBAAoB,MAAM,OAAO,sCAClC;AAEJ,SAAO;GACL;GACA;MACG,MAAM;IACR,gBAAgBA;IAChB;EACF,EAAC,KAAK,OAAO;CACf;AAGD,KAAI,WAAW,MAAM,EAAE;EACrB,MAAM,aAAa,MAAM,UACpB,oBAAoB,MAAM,OAAO,+CAClC;AAEJ,SAAO;GACL;GACA;MACG,MAAM;IACR;EACF,EAAC,KAAK,OAAO;CACf;CAED,MAAM,UAAU,SAAS,MAAM;AAE/B,QAAO;EACL;EACA;EACA;GACC,gBAAgB;EACjB,QAAQ,IAAI,aAAa,eACrB,iBAAiB,QACf,MAAM,UACN,OAAO,MAAM,GACf;CACL,EACE,OAAO,QAAQ,CACf,KAAK,OAAO;AAChB"}
1
+ {"version":3,"file":"error-handling-CLnyY1TR.js","names":["error: unknown","eventId"],"sources":["../src/internal/error-handling.ts"],"sourcesContent":["import { UserInputError, ConfigurationError } from \"../errors\";\nimport { ApiError, ApiClientError, ApiServerError } from \"../api-client\";\nimport { logIssue } from \"../telem/logging\";\n\n/**\n * Type guard to identify user input validation errors.\n */\nexport function isUserInputError(error: unknown): error is UserInputError {\n return error instanceof UserInputError;\n}\n\n/**\n * Type guard to identify configuration errors.\n */\nexport function isConfigurationError(\n error: unknown,\n): error is ConfigurationError {\n return error instanceof ConfigurationError;\n}\n\n/**\n * Type guard to identify API errors.\n */\nexport function isApiError(error: unknown): error is ApiError {\n return error instanceof ApiError;\n}\n\n/**\n * Type guard to identify API client errors (4xx).\n */\nexport function isApiClientError(error: unknown): error is ApiClientError {\n return error instanceof ApiClientError;\n}\n\n/**\n * Type guard to identify API server errors (5xx).\n */\nexport function isApiServerError(error: unknown): error is ApiServerError {\n return error instanceof ApiServerError;\n}\n\n/**\n * Format an error for user display with markdown formatting.\n * This is used by tool handlers to format errors for MCP responses.\n *\n * SECURITY: Only return trusted error messages to prevent prompt injection vulnerabilities.\n * We trust: Sentry API errors, our own UserInputError/ConfigurationError messages, and system templates.\n */\nexport async function formatErrorForUser(error: unknown): Promise<string> {\n if (isUserInputError(error)) {\n return [\n \"**Input Error**\",\n \"It looks like there was a problem with the input you provided.\",\n error.message,\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n if (isConfigurationError(error)) {\n return [\n \"**Configuration Error**\",\n \"There appears to be a configuration issue with your setup.\",\n error.message,\n `Please check your environment configuration and try again.`,\n ].join(\"\\n\\n\");\n }\n\n // Handle ApiClientError (4xx) - user input errors, should NOT be logged to Sentry\n if (isApiClientError(error)) {\n const statusText = error.status\n ? `There was an HTTP ${error.status} error with your request to the Sentry API.`\n : \"There was an error with your request.\";\n\n return [\n \"**Input Error**\",\n statusText,\n error.toUserMessage(),\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n // Handle ApiServerError (5xx) - system errors, SHOULD be logged to Sentry\n if (isApiServerError(error)) {\n const eventId = logIssue(error);\n const statusText = error.status\n ? `There was an HTTP ${error.status} server error with the Sentry API.`\n : \"There was a server error.\";\n\n return [\n \"**Error**\",\n statusText,\n `${error.message}`,\n `**Event ID**: ${eventId}`,\n `Please contact support with this Event ID if the problem persists.`,\n ].join(\"\\n\\n\");\n }\n\n // Handle generic ApiError (shouldn't happen with new hierarchy, but just in case)\n if (isApiError(error)) {\n const statusText = error.status\n ? `There was an HTTP ${error.status} error with your request to the Sentry API.`\n : \"There was an error with your request.\";\n\n return [\n \"**Error**\",\n statusText,\n `${error.message}`,\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n const eventId = logIssue(error);\n\n return [\n \"**Error**\",\n \"It looks like there was a problem communicating with the Sentry API.\",\n \"Please report the following to the user for the Sentry team:\",\n `**Event ID**: ${eventId}`,\n process.env.NODE_ENV !== \"production\"\n ? error instanceof Error\n ? error.message\n : String(error)\n : \"\",\n ]\n .filter(Boolean)\n .join(\"\\n\\n\");\n}\n"],"mappings":";;;;;;;;AAOA,SAAgB,i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figurationError = class extends Error {
23
23
 
24
24
  //#endregion
25
25
  export { ConfigurationError, UserInputError };
26
- //# sourceMappingURL=errors-D_R568zP.js.map
26
+ //# sourceMappingURL=errors-BXmNwD2K.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors-D_R568zP.js","names":["message: string","options?: ErrorOptions"],"sources":["../src/errors.ts"],"sourcesContent":["/**\n * Error thrown when user input validation fails.\n * These errors should be returned to the user directly without logging to Sentry.\n */\nexport class UserInputError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n this.name = \"UserInputError\";\n }\n}\n\n/**\n * Error thrown when configuration is invalid or missing.\n * These errors should be returned to the user directly without logging to Sentry.\n * Typically used for environment configuration issues, connection settings, etc.\n */\nexport class ConfigurationError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n this.name = \"ConfigurationError\";\n }\n}\n"],"mappings":";;;;;AAIA,IAAa,iBAAb,cAAoC,MAAM;CACxC,YAAYA,SAAiBC,SAAwB;AACnD,QAAM,SAAS,QAAQ;AACvB,OAAK,OAAO;CACb;AACF;;;;;;AAOD,IAAa,qBAAb,cAAwC,MAAM;CAC5C,YAAYD,SAAiBC,SAAwB;AACnD,QAAM,SAAS,QAAQ;AACvB,OAAK,OAAO;CACb;AACF"}
1
+ {"version":3,"file":"errors-BXmNwD2K.js","names":["message: string","options?: ErrorOptions"],"sources":["../src/errors.ts"],"sourcesContent":["/**\n * Error thrown when user input validation fails.\n * These errors should be returned to the user directly without logging to Sentry.\n */\nexport class UserInputError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n this.name = \"UserInputError\";\n }\n}\n\n/**\n * Error thrown when configuration is invalid or missing.\n * These errors should be returned to the user directly without logging to Sentry.\n * Typically used for environment configuration issues, connection settings, etc.\n */\nexport class ConfigurationError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n this.name = \"ConfigurationError\";\n }\n}\n"],"mappings":";;;;;AAIA,IAAa,iBAAb,cAAoC,MAAM;CACxC,YAAYA,SAAiBC,SAAwB;AACnD,QAAM,SAAS,QAAQ;AACvB,OAAK,OAAO;CACb;AACF;;;;;;AAOD,IAAa,qBAAb,cAAwC,MAAM;CAC5C,YAAYD,SAAiBC,SAAwB;AACnD,QAAM,SAAS,QAAQ;AACvB,OAAK,OAAO;CACb;AACF"}
@@ -17,4 +17,4 @@ declare class ConfigurationError extends Error {
17
17
  //# sourceMappingURL=errors.d.ts.map
18
18
  //#endregion
19
19
  export { ConfigurationError, UserInputError };
20
- //# sourceMappingURL=errors-00Iz6Wmy.d.cts.map
20
+ //# sourceMappingURL=errors-BYClKbv4.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors-00Iz6Wmy.d.cts","names":[],"sources":["../src/errors.ts"],"sourcesContent":[],"mappings":";;AAIA;;;AAAoC,cAAvB,cAAA,SAAuB,KAAA,CAAA;EAAK,WAAA,CAAA,OAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EACA,YADA;AAYzC;;;;AAA6C;;cAAhC,kBAAA,SAA2B,KAAA;yCACC"}
1
+ {"version":3,"file":"errors-BYClKbv4.d.cts","names":[],"sources":["../src/errors.ts"],"sourcesContent":[],"mappings":";;AAIA;;;AAAoC,cAAvB,cAAA,SAAuB,KAAA,CAAA;EAAK,WAAA,CAAA,OAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EACA,YADA;AAYzC;;;;AAA6C;;cAAhC,kBAAA,SAA2B,KAAA;yCACC"}
@@ -17,4 +17,4 @@ declare class ConfigurationError extends Error {
17
17
  //# sourceMappingURL=errors.d.ts.map
18
18
  //#endregion
19
19
  export { ConfigurationError, UserInputError };
20
- //# sourceMappingURL=errors-Bvit2_Qs.d.ts.map
20
+ //# sourceMappingURL=errors-Cn4l-BlC.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors-Bvit2_Qs.d.ts","names":[],"sources":["../src/errors.ts"],"sourcesContent":[],"mappings":";;AAIA;;;AAAoC,cAAvB,cAAA,SAAuB,KAAA,CAAA;EAAK,WAAA,CAAA,OAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EACA,YADA;AAYzC;;;;AAA6C;;cAAhC,kBAAA,SAA2B,KAAA;yCACC"}
1
+ {"version":3,"file":"errors-Cn4l-BlC.d.ts","names":[],"sources":["../src/errors.ts"],"sourcesContent":[],"mappings":";;AAIA;;;AAAoC,cAAvB,cAAA,SAAuB,KAAA,CAAA;EAAK,WAAA,CAAA,OAAA,EAAA,MAAA,EAAA,OAAA,CAAA,EACA,YADA;AAYzC;;;;AAA6C;;cAAhC,kBAAA,SAA2B,KAAA;yCACC"}
@@ -123,4 +123,4 @@ declare function createApiError(message: string, status: number, detail?: string
123
123
  //# sourceMappingURL=errors.d.ts.map
124
124
  //#endregion
125
125
  export { ApiAuthenticationError, ApiClientError, ApiError, ApiNotFoundError, ApiPermissionError, ApiRateLimitError, ApiServerError, ApiValidationError, createApiError };
126
- //# sourceMappingURL=errors-JbBt1G2l.d.ts.map
126
+ //# sourceMappingURL=errors-CyAWBU2S.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors-JbBt1G2l.d.ts","names":[],"sources":["../src/api-client/errors.ts"],"sourcesContent":[],"mappings":";;AAkBA;AAmBA;AAwFA;AA0BA;AAkBA;;;;;AAAsD;AAkBtD;AAYA;AAiBA;AAgCA;;;cAtOa,QAAA,SAAiB,KAAK;;;;;;;;;;;cAmBtB,cAAA,SAAuB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwF/B,kBAAA,SAA2B,cAAc;;;;;;;;;;;cA0BzC,gBAAA,SAAyB,cAAc;;;;;;;;;cAkBvC,kBAAA,SAA2B,cAAA;8BAMD;+GAAA;;;;;;cAY1B,sBAAA,SAA+B,cAAc;;;;;;;cAY7C,iBAAA,SAA0B,cAAc;;;;;;;;cAiBxC,cAAA,SAAuB,QAAQ;;;;;;;;;;;;;;;;iBAgC5B,cAAA,4EAKb"}
1
+ {"version":3,"file":"errors-CyAWBU2S.d.ts","names":[],"sources":["../src/api-client/errors.ts"],"sourcesContent":[],"mappings":";;AAkBA;AAmBA;AAwFA;AA0BA;AAkBA;;;;;AAAsD;AAkBtD;AAYA;AAiBA;AAgCA;;;cAtOa,QAAA,SAAiB,KAAK;;;;;;;;;;;cAmBtB,cAAA,SAAuB,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAwF/B,kBAAA,SAA2B,cAAc;;;;;;;;;;;cA0BzC,gBAAA,SAAyB,cAAc;;;;;;;;;cAkBvC,kBAAA,SAA2B,cAAA;8BAMD;+GAAA;;;;;;cAY1B,sBAAA,SAA+B,cAAc;;;;;;;cAY7C,iBAAA,SAA0B,cAAc;;;;;;;;cAiBxC,cAAA,SAAuB,QAAQ;;;;;;;;;;;;;;;;iBAgC5B,cAAA,4EAKb"}
@@ -214,4 +214,4 @@ function createApiError(message, status, detail, responseBody) {
214
214
 
215
215
  //#endregion
216
216
  export { ApiAuthenticationError, ApiClientError, ApiError, ApiNotFoundError, ApiPermissionError, ApiRateLimitError, ApiServerError, ApiValidationError, createApiError };
217
- //# sourceMappingURL=errors-CQZ-QlOB.js.map
217
+ //# sourceMappingURL=errors-DUEMWOr1.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors-CQZ-QlOB.js","names":["message: string","status?: number","detail?: string","responseBody?: unknown","resourceType?: string","resourceId?: string","status?: 400 | 422","validationErrors?: Record<string, string[]>","retryAfter?: number","status: number","validationErrors: Record<string, string[]> | undefined","retryAfter: number | undefined"],"sources":["../src/api-client/errors.ts"],"sourcesContent":["/**\n * API Error Class Hierarchy\n *\n * This module defines a hierarchical error system for the Sentry API client\n * that automatically categorizes errors based on HTTP status codes.\n *\n * Key principles:\n * - 4xx errors (ApiClientError) are user input errors, not reported to Sentry\n * - 5xx errors (ApiServerError) are system errors, reported to Sentry\n * - Specific error types provide additional context and helper methods\n * - The hierarchy enables type-safe error handling without manual status checks\n */\n\n/**\n * Base class for all API errors.\n * Contains common properties for all API error types.\n * Status is optional since some errors (like client-side validation) don't have HTTP status codes.\n */\nexport class ApiError extends Error {\n constructor(\n message: string,\n public readonly status?: number,\n public readonly detail?: string,\n public readonly responseBody?: unknown,\n ) {\n super(message);\n this.name = \"ApiError\";\n // Ensure proper prototype chain for instanceof checks\n Object.setPrototypeOf(this, ApiError.prototype);\n }\n}\n\n/**\n * Client errors (4xx) - User input errors that should NOT be reported to Sentry.\n * These typically indicate issues with the request that the user can fix.\n * Also includes client-side validation errors that don't have HTTP status codes.\n */\nexport class ApiClientError extends ApiError {\n constructor(\n message: string,\n status?: number,\n detail?: string,\n responseBody?: unknown,\n ) {\n super(message, status, detail, responseBody);\n this.name = \"ApiClientError\";\n Object.setPrototypeOf(this, ApiClientError.prototype);\n }\n\n /**\n * Convert to a user-friendly formatted message.\n * Returns the standard format: \"API error (status): message\" or just \"API error: message\" if no status.\n * For 404 errors, adds helpful context about checking parameters.\n */\n toUserMessage(): string {\n const baseMessage = this.status\n ? `API error (${this.status}): ${this.message}`\n : `API error: ${this.message}`;\n\n // Add helpful context for 404 errors, especially generic ones\n if (this.status === 404) {\n // Check if the message is generic\n const genericMessages = [\n \"not found\",\n \"the requested resource does not exist\",\n \"resource does not exist\",\n \"resource not found\",\n ];\n\n const isGeneric = genericMessages.some(\n (msg) =>\n this.message.toLowerCase() === msg ||\n this.message.toLowerCase().includes(\"requested resource\"),\n );\n\n if (isGeneric) {\n return `${baseMessage}. Please verify that the organization, project, or resource ID is correct and that you have access to it.`;\n }\n // For specific messages like \"Project not found\", just add a hint\n return `${baseMessage}. Please verify the parameters are correct.`;\n }\n\n return baseMessage;\n }\n\n /**\n * Check if this is a permission/authorization error (403)\n */\n isPermissionError(): boolean {\n return this.status === 403;\n }\n\n /**\n * Check if this is a not found error (404)\n */\n isNotFoundError(): boolean {\n return this.status === 404;\n }\n\n /**\n * Check if this is a validation error (400 or 422)\n */\n isValidationError(): boolean {\n return this.status === 400 || this.status === 422;\n }\n\n /**\n * Check if this is an authentication error (401)\n */\n isAuthenticationError(): boolean {\n return this.status === 401;\n }\n\n /**\n * Check if this is a rate limit error (429)\n */\n isRateLimitError(): boolean {\n return this.status === 429;\n }\n}\n\n/**\n * Permission denied error (403).\n * Includes special handling for multi-project access errors.\n */\nexport class ApiPermissionError extends ApiClientError {\n constructor(message: string, detail?: string, responseBody?: unknown) {\n super(message, 403, detail, responseBody);\n this.name = \"ApiPermissionError\";\n Object.setPrototypeOf(this, ApiPermissionError.prototype);\n }\n\n /**\n * Check if this is the specific multi-project access error\n */\n isMultiProjectAccessError(): boolean {\n return (\n this.message.includes(\"multiple projects\") ||\n this.message.includes(\"multi project\") ||\n this.message.includes(\"multi-project\") ||\n this.message.includes(\n \"You do not have access to query across multiple projects\",\n )\n );\n }\n}\n\n/**\n * Resource not found error (404).\n * Can include additional context about what resource was not found.\n */\nexport class ApiNotFoundError extends ApiClientError {\n constructor(\n message: string,\n detail?: string,\n responseBody?: unknown,\n public readonly resourceType?: string,\n public readonly resourceId?: string,\n ) {\n super(message, 404, detail, responseBody);\n this.name = \"ApiNotFoundError\";\n Object.setPrototypeOf(this, ApiNotFoundError.prototype);\n }\n}\n\n/**\n * Validation error (400 or 422 for API responses, or no status for client-side validation).\n * Indicates the request was malformed or contained invalid data.\n */\nexport class ApiValidationError extends ApiClientError {\n constructor(\n message: string,\n status?: 400 | 422,\n detail?: string,\n responseBody?: unknown,\n public readonly validationErrors?: Record<string, string[]>,\n ) {\n super(message, status, detail, responseBody);\n this.name = \"ApiValidationError\";\n Object.setPrototypeOf(this, ApiValidationError.prototype);\n }\n}\n\n/**\n * Authentication error (401).\n * Indicates the request lacks valid authentication credentials.\n */\nexport class ApiAuthenticationError extends ApiClientError {\n constructor(message: string, detail?: string, responseBody?: unknown) {\n super(message, 401, detail, responseBody);\n this.name = \"ApiAuthenticationError\";\n Object.setPrototypeOf(this, ApiAuthenticationError.prototype);\n }\n}\n\n/**\n * Rate limit error (429).\n * Includes retry-after information when available.\n */\nexport class ApiRateLimitError extends ApiClientError {\n constructor(\n message: string,\n detail?: string,\n responseBody?: unknown,\n public readonly retryAfter?: number,\n ) {\n super(message, 429, detail, responseBody);\n this.name = \"ApiRateLimitError\";\n Object.setPrototypeOf(this, ApiRateLimitError.prototype);\n }\n}\n\n/**\n * Server errors (5xx) - System errors that SHOULD be reported to Sentry.\n * These indicate problems with the server that are not the user's fault.\n */\nexport class ApiServerError extends ApiError {\n constructor(\n message: string,\n status: number,\n detail?: string,\n responseBody?: unknown,\n ) {\n super(message, status, detail, responseBody);\n this.name = \"ApiServerError\";\n Object.setPrototypeOf(this, ApiServerError.prototype);\n }\n\n /**\n * Check if this is a gateway/proxy error (502, 503, 504)\n */\n isGatewayError(): boolean {\n return this.status === 502 || this.status === 503 || this.status === 504;\n }\n\n /**\n * Check if this is an internal server error (500)\n */\n isInternalError(): boolean {\n return this.status === 500;\n }\n}\n\n/**\n * Factory function to create the appropriate error type based on HTTP status code.\n * This centralizes the logic for determining which error class to instantiate.\n * This is only used for actual API responses, so status is required.\n */\nexport function createApiError(\n message: string,\n status: number,\n detail?: string,\n responseBody?: unknown,\n): ApiError {\n // Apply message improvements for known error patterns\n let improvedMessage = message;\n\n // Handle the multi-project access error that comes in various forms\n if (\n message.includes(\n \"You do not have the multi project stream feature enabled\",\n ) ||\n message.includes(\"You cannot view events from multiple projects\")\n ) {\n improvedMessage =\n \"You do not have access to query across multiple projects. Please select a project for your query.\";\n return new ApiPermissionError(improvedMessage, detail, responseBody);\n }\n\n // Create specific error types based on status code\n switch (status) {\n case 401:\n return new ApiAuthenticationError(message, detail, responseBody);\n\n case 403:\n return new ApiPermissionError(message, detail, responseBody);\n\n case 404:\n // TODO: Could extract resource type/ID from the request context\n return new ApiNotFoundError(message, detail, responseBody);\n\n case 400:\n case 422: {\n // Try to extract validation errors if present\n let validationErrors: Record<string, string[]> | undefined;\n if (\n responseBody &&\n typeof responseBody === \"object\" &&\n \"errors\" in responseBody\n ) {\n validationErrors = responseBody.errors as Record<string, string[]>;\n }\n return new ApiValidationError(\n message,\n status as 400 | 422,\n detail,\n responseBody,\n validationErrors,\n );\n }\n\n case 429: {\n // Try to extract retry-after header if available\n let retryAfter: number | undefined;\n if (responseBody && typeof responseBody === \"object\") {\n if (\"retry_after\" in responseBody) {\n retryAfter = Number(responseBody.retry_after);\n } else if (\"retryAfter\" in responseBody) {\n retryAfter = Number(responseBody.retryAfter);\n }\n }\n return new ApiRateLimitError(message, detail, responseBody, retryAfter);\n }\n\n default:\n // Generic categorization for other status codes\n if (status >= 400 && status < 500) {\n return new ApiClientError(message, status, detail, responseBody);\n }\n if (status >= 500 && status < 600) {\n return new ApiServerError(message, status, detail, responseBody);\n }\n // Fallback for unusual status codes\n return new ApiError(message, status, detail, responseBody);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,IAAa,WAAb,MAAa,iBAAiB,MAAM;CAClC,YACEA,SACgBC,QACAC,QACAC,cAChB;AACA,QAAM,QAAQ;EAJE;EACA;EACA;AAGhB,OAAK,OAAO;AAEZ,SAAO,eAAe,MAAM,SAAS,UAAU;CAChD;AACF;;;;;;AAOD,IAAa,iBAAb,MAAa,uBAAuB,SAAS;CAC3C,YACEH,SACAC,QACAC,QACAC,cACA;AACA,QAAM,SAAS,QAAQ,QAAQ,aAAa;AAC5C,OAAK,OAAO;AACZ,SAAO,eAAe,MAAM,eAAe,UAAU;CACtD;;;;;;CAOD,gBAAwB;EACtB,MAAM,cAAc,KAAK,UACpB,aAAa,KAAK,OAAO,KAAK,KAAK,aACnC,aAAa,KAAK;AAGvB,MAAI,KAAK,WAAW,KAAK;GAEvB,MAAM,kBAAkB;IACtB;IACA;IACA;IACA;GACD;GAED,MAAM,YAAY,gBAAgB,KAChC,CAAC,QACC,KAAK,QAAQ,aAAa,KAAK,OAC/B,KAAK,QAAQ,aAAa,CAAC,SAAS,qBAAqB,CAC5D;AAED,OAAI,UACF,WAAU,YAAY;AAGxB,aAAU,YAAY;EACvB;AAED,SAAO;CACR;;;;C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AAU,OAAO,SAAS,IAC5B,QAAO,IAAI,eAAe,SAAS,QAAQ,QAAQ;AAErD,OAAI,UAAU,OAAO,SAAS,IAC5B,QAAO,IAAI,eAAe,SAAS,QAAQ,QAAQ;AAGrD,UAAO,IAAI,SAAS,SAAS,QAAQ,QAAQ;CAChD;AACF"}
1
+ {"version":3,"file":"errors-DUEMWOr1.js","names":["message: string","status?: number","detail?: string","responseBody?: unknown","resourceType?: string","resourceId?: string","status?: 400 | 422","validationErrors?: Record<string, string[]>","retryAfter?: number","status: number","validationErrors: Record<string, string[]> | undefined","retryAfter: number | undefined"],"sources":["../src/api-client/errors.ts"],"sourcesContent":["/**\n * API Error Class Hierarchy\n *\n * This module defines a hierarchical error system for the Sentry API client\n * that automatically categorizes errors based on HTTP status codes.\n *\n * Key principles:\n * - 4xx errors (ApiClientError) are user input errors, not reported to Sentry\n * - 5xx errors (ApiServerError) are system errors, reported to Sentry\n * - Specific error types provide additional context and helper methods\n * - The hierarchy enables type-safe error handling without manual status checks\n */\n\n/**\n * Base class for all API errors.\n * Contains common properties for all API error types.\n * Status is optional since some errors (like client-side validation) don't have HTTP status codes.\n */\nexport class ApiError extends Error {\n constructor(\n message: string,\n public readonly status?: number,\n public readonly detail?: string,\n public readonly responseBody?: unknown,\n ) {\n super(message);\n this.name = \"ApiError\";\n // Ensure proper prototype chain for instanceof checks\n Object.setPrototypeOf(this, ApiError.prototype);\n }\n}\n\n/**\n * Client errors (4xx) - User input errors that should NOT be reported to Sentry.\n * These typically indicate issues with the request that the user can fix.\n * Also includes client-side validation errors that don't have HTTP status codes.\n */\nexport class ApiClientError extends ApiError {\n constructor(\n message: string,\n status?: number,\n detail?: string,\n responseBody?: unknown,\n ) {\n super(message, status, detail, responseBody);\n this.name = \"ApiClientError\";\n Object.setPrototypeOf(this, ApiClientError.prototype);\n }\n\n /**\n * Convert to a user-friendly formatted message.\n * Returns the standard format: \"API error (status): message\" or just \"API error: message\" if no status.\n * For 404 errors, adds helpful context about checking parameters.\n */\n toUserMessage(): string {\n const baseMessage = this.status\n ? `API error (${this.status}): ${this.message}`\n : `API error: ${this.message}`;\n\n // Add helpful context for 404 errors, especially generic ones\n if (this.status === 404) {\n // Check if the message is generic\n const genericMessages = [\n \"not found\",\n \"the requested resource does not exist\",\n \"resource does not exist\",\n \"resource not found\",\n ];\n\n const isGeneric = genericMessages.some(\n (msg) =>\n this.message.toLowerCase() === msg ||\n this.message.toLowerCase().includes(\"requested resource\"),\n );\n\n if (isGeneric) {\n return `${baseMessage}. Please verify that the organization, project, or resource ID is correct and that you have access to it.`;\n }\n // For specific messages like \"Project not found\", just add a hint\n return `${baseMessage}. Please verify the parameters are correct.`;\n }\n\n return baseMessage;\n }\n\n /**\n * Check if this is a permission/authorization error (403)\n */\n isPermissionError(): boolean {\n return this.status === 403;\n }\n\n /**\n * Check if this is a not found error (404)\n */\n isNotFoundError(): boolean {\n return this.status === 404;\n }\n\n /**\n * Check if this is a validation error (400 or 422)\n */\n isValidationError(): boolean {\n return this.status === 400 || this.status === 422;\n }\n\n /**\n * Check if this is an authentication error (401)\n */\n isAuthenticationError(): boolean {\n return this.status === 401;\n }\n\n /**\n * Check if this is a rate limit error (429)\n */\n isRateLimitError(): boolean {\n return this.status === 429;\n }\n}\n\n/**\n * Permission denied error (403).\n * Includes special handling for multi-project access errors.\n */\nexport class ApiPermissionError extends ApiClientError {\n constructor(message: string, detail?: string, responseBody?: unknown) {\n super(message, 403, detail, responseBody);\n this.name = \"ApiPermissionError\";\n Object.setPrototypeOf(this, ApiPermissionError.prototype);\n }\n\n /**\n * Check if this is the specific multi-project access error\n */\n isMultiProjectAccessError(): boolean {\n return (\n this.message.includes(\"multiple projects\") ||\n this.message.includes(\"multi project\") ||\n this.message.includes(\"multi-project\") ||\n this.message.includes(\n \"You do not have access to query across multiple projects\",\n )\n );\n }\n}\n\n/**\n * Resource not found error (404).\n * Can include additional context about what resource was not found.\n */\nexport class ApiNotFoundError extends ApiClientError {\n constructor(\n message: string,\n detail?: string,\n responseBody?: unknown,\n public readonly resourceType?: string,\n public readonly resourceId?: string,\n ) {\n super(message, 404, detail, responseBody);\n this.name = \"ApiNotFoundError\";\n Object.setPrototypeOf(this, ApiNotFoundError.prototype);\n }\n}\n\n/**\n * Validation error (400 or 422 for API responses, or no status for client-side validation).\n * Indicates the request was malformed or contained invalid data.\n */\nexport class ApiValidationError extends ApiClientError {\n constructor(\n message: string,\n status?: 400 | 422,\n detail?: string,\n responseBody?: unknown,\n public readonly validationErrors?: Record<string, string[]>,\n ) {\n super(message, status, detail, responseBody);\n this.name = \"ApiValidationError\";\n Object.setPrototypeOf(this, ApiValidationError.prototype);\n }\n}\n\n/**\n * Authentication error (401).\n * Indicates the request lacks valid authentication credentials.\n */\nexport class ApiAuthenticationError extends ApiClientError {\n constructor(message: string, detail?: string, responseBody?: unknown) {\n super(message, 401, detail, responseBody);\n this.name = \"ApiAuthenticationError\";\n Object.setPrototypeOf(this, ApiAuthenticationError.prototype);\n }\n}\n\n/**\n * Rate limit error (429).\n * Includes retry-after information when available.\n */\nexport class ApiRateLimitError extends ApiClientError {\n constructor(\n message: string,\n detail?: string,\n responseBody?: unknown,\n public readonly retryAfter?: number,\n ) {\n super(message, 429, detail, responseBody);\n this.name = \"ApiRateLimitError\";\n Object.setPrototypeOf(this, ApiRateLimitError.prototype);\n }\n}\n\n/**\n * Server errors (5xx) - System errors that SHOULD be reported to Sentry.\n * These indicate problems with the server that are not the user's fault.\n */\nexport class ApiServerError extends ApiError {\n constructor(\n message: string,\n status: number,\n detail?: string,\n responseBody?: unknown,\n ) {\n super(message, status, detail, responseBody);\n this.name = \"ApiServerError\";\n Object.setPrototypeOf(this, ApiServerError.prototype);\n }\n\n /**\n * Check if this is a gateway/proxy error (502, 503, 504)\n */\n isGatewayError(): boolean {\n return this.status === 502 || this.status === 503 || this.status === 504;\n }\n\n /**\n * Check if this is an internal server error (500)\n */\n isInternalError(): boolean {\n return this.status === 500;\n }\n}\n\n/**\n * Factory function to create the appropriate error type based on HTTP status code.\n * This centralizes the logic for determining which error class to instantiate.\n * This is only used for actual API responses, so status is required.\n */\nexport function createApiError(\n message: string,\n status: number,\n detail?: string,\n responseBody?: unknown,\n): ApiError {\n // Apply message improvements for known error patterns\n let improvedMessage = message;\n\n // Handle the multi-project access error that comes in various forms\n if (\n message.includes(\n \"You do not have the multi project stream feature enabled\",\n ) ||\n message.includes(\"You cannot view events from multiple projects\")\n ) {\n improvedMessage =\n \"You do not have access to query across multiple projects. Please select a project for your query.\";\n return new ApiPermissionError(improvedMessage, detail, responseBody);\n }\n\n // Create specific error types based on status code\n switch (status) {\n case 401:\n return new ApiAuthenticationError(message, detail, responseBody);\n\n case 403:\n return new ApiPermissionError(message, detail, responseBody);\n\n case 404:\n // TODO: Could extract resource type/ID from the request context\n return new ApiNotFoundError(message, detail, responseBody);\n\n case 400:\n case 422: {\n // Try to extract validation errors if present\n let validationErrors: Record<string, string[]> | undefined;\n if (\n responseBody &&\n typeof responseBody === \"object\" &&\n \"errors\" in responseBody\n ) {\n validationErrors = responseBody.errors as Record<string, string[]>;\n }\n return new ApiValidationError(\n message,\n status as 400 | 422,\n detail,\n responseBody,\n validationErrors,\n );\n }\n\n case 429: {\n // Try to extract retry-after header if available\n let retryAfter: number | undefined;\n if (responseBody && typeof responseBody === \"object\") {\n if (\"retry_after\" in responseBody) {\n retryAfter = Number(responseBody.retry_after);\n } else if (\"retryAfter\" in responseBody) {\n retryAfter = Number(responseBody.retryAfter);\n }\n }\n return new ApiRateLimitError(message, detail, responseBody, retryAfter);\n }\n\n default:\n // Generic categorization for other status codes\n if (status >= 400 && status < 500) {\n return new ApiClientError(message, status, detail, responseBody);\n }\n if (status >= 500 && status < 600) {\n return new ApiServerError(message, status, detail, responseBody);\n }\n // Fallback for unusual status codes\n return new ApiError(message, status, detail, responseBody);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,IAAa,WAAb,MAAa,iBAAiB,MAAM;CAClC,YACEA,SACgBC,QACAC,QACA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AAQ,SACN,2DACD,IACD,QAAQ,SAAS,gDAAgD,EACjE;AACA,oBACE;AACF,SAAO,IAAI,mBAAmB,iBAAiB,QAAQ;CACxD;AAGD,SAAQ,QAAR;EACE,KAAK,IACH,QAAO,IAAI,uBAAuB,SAAS,QAAQ;EAErD,KAAK,IACH,QAAO,IAAI,mBAAmB,SAAS,QAAQ;EAEjD,KAAK,IAEH,QAAO,IAAI,iBAAiB,SAAS,QAAQ;EAE/C,KAAK;EACL,KAAK,KAAK;GAER,IAAIO;AACJ,OACE,uBACO,iBAAiB,YACxB,YAAY,aAEZ,oBAAmB,aAAa;AAElC,UAAO,IAAI,mBACT,SACA,QACA,QACA,cACA;EAEH;EAED,KAAK,KAAK;GAER,IAAIC;AACJ,OAAI,uBAAuB,iBAAiB,UAC1C;QAAI,iBAAiB,aACnB,cAAa,OAAO,aAAa,YAAY;aACpC,gBAAgB,aACzB,cAAa,OAAO,aAAa,WAAW;GAC7C;AAEH,UAAO,IAAI,kBAAkB,SAAS,QAAQ,cAAc;EAC7D;EAED;AAEE,OAAI,UAAU,OAAO,SAAS,IAC5B,QAAO,IAAI,eAAe,SAAS,QAAQ,QAAQ;AAErD,OAAI,UAAU,OAAO,SAAS,IAC5B,QAAO,IAAI,eAAe,SAAS,QAAQ,QAAQ;AAGrD,UAAO,IAAI,SAAS,SAAS,QAAQ,QAAQ;CAChD;AACF"}
@@ -268,4 +268,4 @@ Object.defineProperty(exports, 'createApiError', {
268
268
  return createApiError;
269
269
  }
270
270
  });
271
- //# sourceMappingURL=errors-Bmqdg5Q6.cjs.map
271
+ //# sourceMappingURL=errors-DWysOIMw.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors-Bmqdg5Q6.cjs","names":["message: string","status?: number","detail?: string","responseBody?: unknown","resourceType?: string","resourceId?: string","status?: 400 | 422","validationErrors?: Record<string, string[]>","retryAfter?: number","status: number","validationErrors: Record<string, string[]> | undefined","retryAfter: number | undefined"],"sources":["../src/api-client/errors.ts"],"sourcesContent":["/**\n * API Error Class Hierarchy\n *\n * This module defines a hierarchical error system for the Sentry API client\n * that automatically categorizes errors based on HTTP status codes.\n *\n * Key principles:\n * - 4xx errors (ApiClientError) are user input errors, not reported to Sentry\n * - 5xx errors (ApiServerError) are system errors, reported to Sentry\n * - Specific error types provide additional context and helper methods\n * - The hierarchy enables type-safe error handling without manual status checks\n */\n\n/**\n * Base class for all API errors.\n * Contains common properties for all API error types.\n * Status is optional since some errors (like client-side validation) don't have HTTP status codes.\n */\nexport class ApiError extends Error {\n constructor(\n message: string,\n public readonly status?: number,\n public readonly detail?: string,\n public readonly responseBody?: unknown,\n ) {\n super(message);\n this.name = \"ApiError\";\n // Ensure proper prototype chain for instanceof checks\n Object.setPrototypeOf(this, ApiError.prototype);\n }\n}\n\n/**\n * Client errors (4xx) - User input errors that should NOT be reported to Sentry.\n * These typically indicate issues with the request that the user can fix.\n * Also includes client-side validation errors that don't have HTTP status codes.\n */\nexport class ApiClientError extends ApiError {\n constructor(\n message: string,\n status?: number,\n detail?: string,\n responseBody?: unknown,\n ) {\n super(message, status, detail, responseBody);\n this.name = \"ApiClientError\";\n Object.setPrototypeOf(this, ApiClientError.prototype);\n }\n\n /**\n * Convert to a user-friendly formatted message.\n * Returns the standard format: \"API error (status): message\" or just \"API error: message\" if no status.\n * For 404 errors, adds helpful context about checking parameters.\n */\n toUserMessage(): string {\n const baseMessage = this.status\n ? `API error (${this.status}): ${this.message}`\n : `API error: ${this.message}`;\n\n // Add helpful context for 404 errors, especially generic ones\n if (this.status === 404) {\n // Check if the message is generic\n const genericMessages = [\n \"not found\",\n \"the requested resource does not exist\",\n \"resource does not exist\",\n \"resource not found\",\n ];\n\n const isGeneric = genericMessages.some(\n (msg) =>\n this.message.toLowerCase() === msg ||\n this.message.toLowerCase().includes(\"requested resource\"),\n );\n\n if (isGeneric) {\n return `${baseMessage}. Please verify that the organization, project, or resource ID is correct and that you have access to it.`;\n }\n // For specific messages like \"Project not found\", just add a hint\n return `${baseMessage}. Please verify the parameters are correct.`;\n }\n\n return baseMessage;\n }\n\n /**\n * Check if this is a permission/authorization error (403)\n */\n isPermissionError(): boolean {\n return this.status === 403;\n }\n\n /**\n * Check if this is a not found error (404)\n */\n isNotFoundError(): boolean {\n return this.status === 404;\n }\n\n /**\n * Check if this is a validation error (400 or 422)\n */\n isValidationError(): boolean {\n return this.status === 400 || this.status === 422;\n }\n\n /**\n * Check if this is an authentication error (401)\n */\n isAuthenticationError(): boolean {\n return this.status === 401;\n }\n\n /**\n * Check if this is a rate limit error (429)\n */\n isRateLimitError(): boolean {\n return this.status === 429;\n }\n}\n\n/**\n * Permission denied error (403).\n * Includes special handling for multi-project access errors.\n */\nexport class ApiPermissionError extends ApiClientError {\n constructor(message: string, detail?: string, responseBody?: unknown) {\n super(message, 403, detail, responseBody);\n this.name = \"ApiPermissionError\";\n Object.setPrototypeOf(this, ApiPermissionError.prototype);\n }\n\n /**\n * Check if this is the specific multi-project access error\n */\n isMultiProjectAccessError(): boolean {\n return (\n this.message.includes(\"multiple projects\") ||\n this.message.includes(\"multi project\") ||\n this.message.includes(\"multi-project\") ||\n this.message.includes(\n \"You do not have access to query across multiple projects\",\n )\n );\n }\n}\n\n/**\n * Resource not found error (404).\n * Can include additional context about what resource was not found.\n */\nexport class ApiNotFoundError extends ApiClientError {\n constructor(\n message: string,\n detail?: string,\n responseBody?: unknown,\n public readonly resourceType?: string,\n public readonly resourceId?: string,\n ) {\n super(message, 404, detail, responseBody);\n this.name = \"ApiNotFoundError\";\n Object.setPrototypeOf(this, ApiNotFoundError.prototype);\n }\n}\n\n/**\n * Validation error (400 or 422 for API responses, or no status for client-side validation).\n * Indicates the request was malformed or contained invalid data.\n */\nexport class ApiValidationError extends ApiClientError {\n constructor(\n message: string,\n status?: 400 | 422,\n detail?: string,\n responseBody?: unknown,\n public readonly validationErrors?: Record<string, string[]>,\n ) {\n super(message, status, detail, responseBody);\n this.name = \"ApiValidationError\";\n Object.setPrototypeOf(this, ApiValidationError.prototype);\n }\n}\n\n/**\n * Authentication error (401).\n * Indicates the request lacks valid authentication credentials.\n */\nexport class ApiAuthenticationError extends ApiClientError {\n constructor(message: string, detail?: string, responseBody?: unknown) {\n super(message, 401, detail, responseBody);\n this.name = \"ApiAuthenticationError\";\n Object.setPrototypeOf(this, ApiAuthenticationError.prototype);\n }\n}\n\n/**\n * Rate limit error (429).\n * Includes retry-after information when available.\n */\nexport class ApiRateLimitError extends ApiClientError {\n constructor(\n message: string,\n detail?: string,\n responseBody?: unknown,\n public readonly retryAfter?: number,\n ) {\n super(message, 429, detail, responseBody);\n this.name = \"ApiRateLimitError\";\n Object.setPrototypeOf(this, ApiRateLimitError.prototype);\n }\n}\n\n/**\n * Server errors (5xx) - System errors that SHOULD be reported to Sentry.\n * These indicate problems with the server that are not the user's fault.\n */\nexport class ApiServerError extends ApiError {\n constructor(\n message: string,\n status: number,\n detail?: string,\n responseBody?: unknown,\n ) {\n super(message, status, detail, responseBody);\n this.name = \"ApiServerError\";\n Object.setPrototypeOf(this, ApiServerError.prototype);\n }\n\n /**\n * Check if this is a gateway/proxy error (502, 503, 504)\n */\n isGatewayError(): boolean {\n return this.status === 502 || this.status === 503 || this.status === 504;\n }\n\n /**\n * Check if this is an internal server error (500)\n */\n isInternalError(): boolean {\n return this.status === 500;\n }\n}\n\n/**\n * Factory function to create the appropriate error type based on HTTP status code.\n * This centralizes the logic for determining which error class to instantiate.\n * This is only used for actual API responses, so status is required.\n */\nexport function createApiError(\n message: string,\n status: number,\n detail?: string,\n responseBody?: unknown,\n): ApiError {\n // Apply message improvements for known error patterns\n let improvedMessage = message;\n\n // Handle the multi-project access error that comes in various forms\n if (\n message.includes(\n \"You do not have the multi project stream feature enabled\",\n ) ||\n message.includes(\"You cannot view events from multiple projects\")\n ) {\n improvedMessage =\n \"You do not have access to query across multiple projects. Please select a project for your query.\";\n return new ApiPermissionError(improvedMessage, detail, responseBody);\n }\n\n // Create specific error types based on status code\n switch (status) {\n case 401:\n return new ApiAuthenticationError(message, detail, responseBody);\n\n case 403:\n return new ApiPermissionError(message, detail, responseBody);\n\n case 404:\n // TODO: Could extract resource type/ID from the request context\n return new ApiNotFoundError(message, detail, responseBody);\n\n case 400:\n case 422: {\n // Try to extract validation errors if present\n let validationErrors: Record<string, string[]> | undefined;\n if (\n responseBody &&\n typeof responseBody === \"object\" &&\n \"errors\" in responseBody\n ) {\n validationErrors = responseBody.errors as Record<string, string[]>;\n }\n return new ApiValidationError(\n message,\n status as 400 | 422,\n detail,\n responseBody,\n validationErrors,\n );\n }\n\n case 429: {\n // Try to extract retry-after header if available\n let retryAfter: number | undefined;\n if (responseBody && typeof responseBody === \"object\") {\n if (\"retry_after\" in responseBody) {\n retryAfter = Number(responseBody.retry_after);\n } else if (\"retryAfter\" in responseBody) {\n retryAfter = Number(responseBody.retryAfter);\n }\n }\n return new ApiRateLimitError(message, detail, responseBody, retryAfter);\n }\n\n default:\n // Generic categorization for other status codes\n if (status >= 400 && status < 500) {\n return new ApiClientError(message, status, detail, responseBody);\n }\n if (status >= 500 && status < 600) {\n return new ApiServerError(message, status, detail, responseBody);\n }\n // Fallback for unusual status codes\n return new ApiError(message, status, detail, responseBody);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,IAAa,WAAb,MAAa,iBAAiB,MAAM;CAClC,YACEA,SACgBC,QACAC,QACAC,cAChB;AACA,QAAM,QAAQ;EAJE;EACA;EACA;AAGhB,OAAK,OAAO;AAEZ,SAAO,eAAe,MAAM,SAAS,UAAU;CAChD;AACF;;;;;;AAOD,IAAa,iBAAb,MAAa,uBAAuB,SAAS;CAC3C,YACEH,SACAC,QACAC,QACAC,cACA;AACA,QAAM,SAAS,QAAQ,QAAQ,aAAa;AAC5C,OAAK,OAAO;AACZ,SAAO,eAAe,MAAM,eAAe,UAAU;CACtD;;;;;;CAOD,gBAAwB;EACtB,MAAM,cAAc,KAAK,UACpB,aAAa,KAAK,OAAO,KAAK,KAAK,aACnC,aAAa,KAAK;AAGvB,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I,mBACT,SACA,QACA,QACA,cACA;EAEH;EAED,KAAK,KAAK;GAER,IAAIC;AACJ,OAAI,uBAAuB,iBAAiB,UAC1C;QAAI,iBAAiB,aACnB,cAAa,OAAO,aAAa,YAAY;aACpC,gBAAgB,aACzB,cAAa,OAAO,aAAa,WAAW;GAC7C;AAEH,UAAO,IAAI,kBAAkB,SAAS,QAAQ,cAAc;EAC7D;EAED;AAEE,OAAI,UAAU,OAAO,SAAS,IAC5B,QAAO,IAAI,eAAe,SAAS,QAAQ,QAAQ;AAErD,OAAI,UAAU,OAAO,SAAS,IAC5B,QAAO,IAAI,eAAe,SAAS,QAAQ,QAAQ;AAGrD,UAAO,IAAI,SAAS,SAAS,QAAQ,QAAQ;CAChD;AACF"}
1
+ {"version":3,"file":"errors-DWysOIMw.cjs","names":["message: string","status?: number","detail?: string","responseBody?: unknown","resourceType?: string","resourceId?: string","status?: 400 | 422","validationErrors?: Record<string, string[]>","retryAfter?: number","status: number","validationErrors: Record<string, string[]> | undefined","retryAfter: number | undefined"],"sources":["../src/api-client/errors.ts"],"sourcesContent":["/**\n * API Error Class Hierarchy\n *\n * This module defines a hierarchical error system for the Sentry API client\n * that automatically categorizes errors based on HTTP status codes.\n *\n * Key principles:\n * - 4xx errors (ApiClientError) are user input errors, not reported to Sentry\n * - 5xx errors (ApiServerError) are system errors, reported to Sentry\n * - Specific error types provide additional context and helper methods\n * - The hierarchy enables type-safe error handling without manual status checks\n */\n\n/**\n * Base class for all API errors.\n * Contains common properties for all API error types.\n * Status is optional since some errors (like client-side validation) don't have HTTP status codes.\n */\nexport class ApiError extends Error {\n constructor(\n message: string,\n public readonly status?: number,\n public readonly detail?: string,\n public readonly responseBody?: unknown,\n ) {\n super(message);\n this.name = \"ApiError\";\n // Ensure proper prototype chain for instanceof checks\n Object.setPrototypeOf(this, ApiError.prototype);\n }\n}\n\n/**\n * Client errors (4xx) - User input errors that should NOT be reported to Sentry.\n * These typically indicate issues with the request that the user can fix.\n * Also includes client-side validation errors that don't have HTTP status codes.\n */\nexport class ApiClientError extends ApiError {\n constructor(\n message: string,\n status?: number,\n detail?: string,\n responseBody?: unknown,\n ) {\n super(message, status, detail, responseBody);\n this.name = \"ApiClientError\";\n Object.setPrototypeOf(this, ApiClientError.prototype);\n }\n\n /**\n * Convert to a user-friendly formatted message.\n * Returns the standard format: \"API error (status): message\" or just \"API error: message\" if no status.\n * For 404 errors, adds helpful context about checking parameters.\n */\n toUserMessage(): string {\n const baseMessage = this.status\n ? `API error (${this.status}): ${this.message}`\n : `API error: ${this.message}`;\n\n // Add helpful context for 404 errors, especially generic ones\n if (this.status === 404) {\n // Check if the message is generic\n const genericMessages = [\n \"not found\",\n \"the requested resource does not exist\",\n \"resource does not exist\",\n \"resource not found\",\n ];\n\n const isGeneric = genericMessages.some(\n (msg) =>\n this.message.toLowerCase() === msg ||\n this.message.toLowerCase().includes(\"requested resource\"),\n );\n\n if (isGeneric) {\n return `${baseMessage}. Please verify that the organization, project, or resource ID is correct and that you have access to it.`;\n }\n // For specific messages like \"Project not found\", just add a hint\n return `${baseMessage}. Please verify the parameters are correct.`;\n }\n\n return baseMessage;\n }\n\n /**\n * Check if this is a permission/authorization error (403)\n */\n isPermissionError(): boolean {\n return this.status === 403;\n }\n\n /**\n * Check if this is a not found error (404)\n */\n isNotFoundError(): boolean {\n return this.status === 404;\n }\n\n /**\n * Check if this is a validation error (400 or 422)\n */\n isValidationError(): boolean {\n return this.status === 400 || this.status === 422;\n }\n\n /**\n * Check if this is an authentication error (401)\n */\n isAuthenticationError(): boolean {\n return this.status === 401;\n }\n\n /**\n * Check if this is a rate limit error (429)\n */\n isRateLimitError(): boolean {\n return this.status === 429;\n }\n}\n\n/**\n * Permission denied error (403).\n * Includes special handling for multi-project access errors.\n */\nexport class ApiPermissionError extends ApiClientError {\n constructor(message: string, detail?: string, responseBody?: unknown) {\n super(message, 403, detail, responseBody);\n this.name = \"ApiPermissionError\";\n Object.setPrototypeOf(this, ApiPermissionError.prototype);\n }\n\n /**\n * Check if this is the specific multi-project access error\n */\n isMultiProjectAccessError(): boolean {\n return (\n this.message.includes(\"multiple projects\") ||\n this.message.includes(\"multi project\") ||\n this.message.includes(\"multi-project\") ||\n this.message.includes(\n \"You do not have access to query across multiple projects\",\n )\n );\n }\n}\n\n/**\n * Resource not found error (404).\n * Can include additional context about what resource was not found.\n */\nexport class ApiNotFoundError extends ApiClientError {\n constructor(\n message: string,\n detail?: string,\n responseBody?: unknown,\n public readonly resourceType?: string,\n public readonly resourceId?: string,\n ) {\n super(message, 404, detail, responseBody);\n this.name = \"ApiNotFoundError\";\n Object.setPrototypeOf(this, ApiNotFoundError.prototype);\n }\n}\n\n/**\n * Validation error (400 or 422 for API responses, or no status for client-side validation).\n * Indicates the request was malformed or contained invalid data.\n */\nexport class ApiValidationError extends ApiClientError {\n constructor(\n message: string,\n status?: 400 | 422,\n detail?: string,\n responseBody?: unknown,\n public readonly validationErrors?: Record<string, string[]>,\n ) {\n super(message, status, detail, responseBody);\n this.name = \"ApiValidationError\";\n Object.setPrototypeOf(this, ApiValidationError.prototype);\n }\n}\n\n/**\n * Authentication error (401).\n * Indicates the request lacks valid authentication credentials.\n */\nexport class ApiAuthenticationError extends ApiClientError {\n constructor(message: string, detail?: string, responseBody?: unknown) {\n super(message, 401, detail, responseBody);\n this.name = \"ApiAuthenticationError\";\n Object.setPrototypeOf(this, ApiAuthenticationError.prototype);\n }\n}\n\n/**\n * Rate limit error (429).\n * Includes retry-after information when available.\n */\nexport class ApiRateLimitError extends ApiClientError {\n constructor(\n message: string,\n detail?: string,\n responseBody?: unknown,\n public readonly retryAfter?: number,\n ) {\n super(message, 429, detail, responseBody);\n this.name = \"ApiRateLimitError\";\n Object.setPrototypeOf(this, ApiRateLimitError.prototype);\n }\n}\n\n/**\n * Server errors (5xx) - System errors that SHOULD be reported to Sentry.\n * These indicate problems with the server that are not the user's fault.\n */\nexport class ApiServerError extends ApiError {\n constructor(\n message: string,\n status: number,\n detail?: string,\n responseBody?: unknown,\n ) {\n super(message, status, detail, responseBody);\n this.name = \"ApiServerError\";\n Object.setPrototypeOf(this, ApiServerError.prototype);\n }\n\n /**\n * Check if this is a gateway/proxy error (502, 503, 504)\n */\n isGatewayError(): boolean {\n return this.status === 502 || this.status === 503 || this.status === 504;\n }\n\n /**\n * Check if this is an internal server error (500)\n */\n isInternalError(): boolean {\n return this.status === 500;\n }\n}\n\n/**\n * Factory function to create the appropriate error type based on HTTP status code.\n * This centralizes the logic for determining which error class to instantiate.\n * This is only used for actual API responses, so status is required.\n */\nexport function createApiError(\n message: string,\n status: number,\n detail?: string,\n responseBody?: unknown,\n): ApiError {\n // Apply message improvements for known error patterns\n let improvedMessage = message;\n\n // Handle the multi-project access error that comes in various forms\n if (\n message.includes(\n \"You do not have the multi project stream feature enabled\",\n ) ||\n message.includes(\"You cannot view events from multiple projects\")\n ) {\n improvedMessage =\n \"You do not have access to query across multiple projects. Please select a project for your query.\";\n return new ApiPermissionError(improvedMessage, detail, responseBody);\n }\n\n // Create specific error types based on status code\n switch (status) {\n case 401:\n return new ApiAuthenticationError(message, detail, responseBody);\n\n case 403:\n return new ApiPermissionError(message, detail, responseBody);\n\n case 404:\n // TODO: Could extract resource type/ID from the request context\n return new ApiNotFoundError(message, detail, responseBody);\n\n case 400:\n case 422: {\n // Try to extract validation errors if present\n let validationErrors: Record<string, string[]> | undefined;\n if (\n responseBody &&\n typeof responseBody === \"object\" &&\n \"errors\" in responseBody\n ) {\n validationErrors = responseBody.errors as Record<string, string[]>;\n }\n return new ApiValidationError(\n message,\n status as 400 | 422,\n detail,\n responseBody,\n validationErrors,\n );\n }\n\n case 429: {\n // Try to extract retry-after header if available\n let retryAfter: number | undefined;\n if (responseBody && typeof responseBody === \"object\") {\n if (\"retry_after\" in responseBody) {\n retryAfter = Number(responseBody.retry_after);\n } else if (\"retryAfter\" in responseBody) {\n retryAfter = Number(responseBody.retryAfter);\n }\n }\n return new ApiRateLimitError(message, detail, responseBody, retryAfter);\n }\n\n default:\n // Generic categorization for other status codes\n if (status >= 400 && status < 500) {\n return new ApiClientError(message, status, detail, responseBody);\n }\n if (status >= 500 && status < 600) {\n return new ApiServerError(message, status, detail, responseBody);\n }\n // Fallback for unusual status codes\n return new ApiError(message, status, detail, responseBody);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,IAAa,WAAb,MAAa,iBAAiB,MAAM;CAClC,YACEA,SACgBC,QACAC,QACAC,cAChB;AACA,QAAM,QAAQ;EAJE;EACA;EACA;AAGhB,OAAK,OAAO;AAEZ,SAAO,eAAe,MAAM,SAAS,UAAU;CAChD;AACF;;;;;;AAOD,IAAa,iBAAb,MAAa,uBAAuB,SAAS;CAC3C,YACEH,SACAC,QACAC,QACAC,cACA;AACA,QAAM,SAAS,QAAQ,QAAQ,aAAa;AAC5C,OAAK,OAAO;AACZ,SAAO,eAAe,MAAM,eAAe,UAAU;CACtD;;;;;;CAOD,gBAAwB;EACtB,MAAM,cAAc,KAAK,UACpB,aAAa,KAAK,OAAO,KAAK,KAAK,aACnC,aAAa,KAAK;AAGvB,MAAI,KAAK,WAAW,KAAK;GAEvB,MAAM,kBAAkB;IACtB;IACA;IACA;IACA;GACD;GAED,MAAM,YAAY,gBAAgB,KAChC,CAAC,QACC,KAAK,QAAQ,aAAa,KAAK,OAC/B,KAAK,QAAQ,aAAa,CAAC,SAAS,qBAAqB,CAC5D;AAED,OAAI,UACF,WAAU,YAAY;AAGxB,aAAU,YAAY;EACvB;AAED,SAAO;CACR;;;;CAKD,oBAA6B;AAC3B,SAAO,KAAK,WAAW;CACxB;;;;CAKD,kBAA2B;AACzB,SAAO,KAAK,WAAW;CACxB;;;;CAKD,oBAA6B;AAC3B,SAAO,KAAK,WAAW,OAAO,KAAK,WAAW;CAC/C;;;;CAKD,wBAAiC;AAC/B,SAAO,KAAK,WAAW;CACxB;;;;CAKD,mBAA4B;AAC1B,SAAO,KAAK,WAAW;CACxB;AACF;;;;;AAMD,IAAa,qBAAb,MAAa,2BAA2B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2Z-.cjs.map
38
+ //# sourceMappingURL=errors-umQzF_vW.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors-BtJEw2Z-.cjs","names":["message: string","options?: ErrorOptions"],"sources":["../src/errors.ts"],"sourcesContent":["/**\n * Error thrown when user input validation fails.\n * These errors should be returned to the user directly without logging to Sentry.\n */\nexport class UserInputError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n this.name = \"UserInputError\";\n }\n}\n\n/**\n * Error thrown when configuration is invalid or missing.\n * These errors should be returned to the user directly without logging to Sentry.\n * Typically used for environment configuration issues, connection settings, etc.\n */\nexport class ConfigurationError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n this.name = \"ConfigurationError\";\n }\n}\n"],"mappings":";;;;;;AAIA,IAAa,iBAAb,cAAoC,MAAM;CACxC,YAAYA,SAAiBC,SAAwB;AACnD,QAAM,SAAS,QAAQ;AACvB,OAAK,OAAO;CACb;AACF;;;;;;AAOD,IAAa,qBAAb,cAAwC,MAAM;CAC5C,YAAYD,SAAiBC,SAAwB;AACnD,QAAM,SAAS,QAAQ;AACvB,OAAK,OAAO;CACb;AACF"}
1
+ {"version":3,"file":"errors-umQzF_vW.cjs","names":["message: string","options?: ErrorOptions"],"sources":["../src/errors.ts"],"sourcesContent":["/**\n * Error thrown when user input validation fails.\n * These errors should be returned to the user directly without logging to Sentry.\n */\nexport class UserInputError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n this.name = \"UserInputError\";\n }\n}\n\n/**\n * Error thrown when configuration is invalid or missing.\n * These errors should be returned to the user directly without logging to Sentry.\n * Typically used for environment configuration issues, connection settings, etc.\n */\nexport class ConfigurationError extends Error {\n constructor(message: string, options?: ErrorOptions) {\n super(message, options);\n this.name = \"ConfigurationError\";\n }\n}\n"],"mappings":";;;;;;AAIA,IAAa,iBAAb,cAAoC,MAAM;CACxC,YAAYA,SAAiBC,SAAwB;AACnD,QAAM,SAAS,QAAQ;AACvB,OAAK,OAAO;CACb;AACF;;;;;;AAOD,IAAa,qBAAb,cAAwC,MAAM;CAC5C,YAAYD,SAAiBC,SAAwB;AACnD,QAAM,SAAS,QAAQ;AACvB,OAAK,OAAO;CACb;AACF"}
package/dist/errors.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_errors = require('./errors-BtJEw2Z-.cjs');
1
+ const require_errors = require('./errors-umQzF_vW.cjs');
2
2
 
3
3
  exports.ConfigurationError = require_errors.ConfigurationError;
4
4
  exports.UserInputError = require_errors.UserInputError;
package/dist/errors.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { ConfigurationError, UserInputError } from "./errors-00Iz6Wmy.cjs";
1
+ import { ConfigurationError, UserInputError } from "./errors-BYClKbv4.cjs";
2
2
  export { ConfigurationError, UserInputError };
package/dist/errors.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { ConfigurationError, UserInputError } from "./errors-Bvit2_Qs.js";
1
+ import { ConfigurationError, UserInputError } from "./errors-Cn4l-BlC.js";
2
2
  export { ConfigurationError, UserInputError };