@sentry/mcp-server 0.15.0 → 0.16.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.
- package/dist/{analyze-issue-with-seer-BkVrrh28.cjs → analyze-issue-with-seer-B8ZWokLV.cjs} +50 -10
- package/dist/analyze-issue-with-seer-B8ZWokLV.cjs.map +1 -0
- package/dist/{analyze-issue-with-seer-CoqsTklL.js → analyze-issue-with-seer-szIqv1_I.js} +50 -10
- package/dist/analyze-issue-with-seer-szIqv1_I.js.map +1 -0
- package/dist/api-client/client.cjs +2 -1
- package/dist/api-client/client.d.cts +3 -3
- package/dist/api-client/client.d.ts +3 -3
- package/dist/api-client/client.js +2 -1
- package/dist/api-client/index.cjs +2 -1
- package/dist/api-client/index.d.cts +3 -3
- package/dist/api-client/index.d.ts +3 -3
- package/dist/api-client/index.js +2 -1
- package/dist/api-client/schema.d.cts +1 -1
- package/dist/api-client/schema.d.ts +1 -1
- package/dist/api-client/types.d.cts +2 -2
- package/dist/api-client/types.d.ts +2 -2
- package/dist/api-utils-B-9vnzoA.cjs +86 -0
- package/dist/api-utils-B-9vnzoA.cjs.map +1 -0
- package/dist/api-utils-CHRiLf2Y.js +69 -0
- package/dist/api-utils-CHRiLf2Y.js.map +1 -0
- package/dist/{client-Dkw5iYu3.cjs → client-C_lwH0jz.cjs} +102 -51
- package/dist/client-C_lwH0jz.cjs.map +1 -0
- package/dist/{client-VCJp6Kcu.d.ts → client-D8vrUp2k.d.cts} +37 -5
- package/dist/client-D8vrUp2k.d.cts.map +1 -0
- package/dist/{client-CQ9Xe1aN.d.cts → client-h32L1Hx5.d.ts} +36 -4
- package/dist/client-h32L1Hx5.d.ts.map +1 -0
- package/dist/{client-DOYWNvVM.js → client-pyNUFaLN.js} +102 -51
- package/dist/client-pyNUFaLN.js.map +1 -0
- package/dist/{create-dsn-D530I7Lr.js → create-dsn-CEEytIa4.js} +2 -2
- package/dist/{create-dsn-D530I7Lr.js.map → create-dsn-CEEytIa4.js.map} +1 -1
- package/dist/{create-dsn-Dz8nyTFw.cjs → create-dsn-CI7MSiQu.cjs} +2 -2
- package/dist/{create-dsn-Dz8nyTFw.cjs.map → create-dsn-CI7MSiQu.cjs.map} +1 -1
- package/dist/{create-project-K1od5Rhx.js → create-project-CoV1e-vp.js} +2 -2
- package/dist/{create-project-K1od5Rhx.js.map → create-project-CoV1e-vp.js.map} +1 -1
- package/dist/{create-project-BxzRiryg.cjs → create-project-DnLKRG1p.cjs} +2 -2
- package/dist/{create-project-BxzRiryg.cjs.map → create-project-DnLKRG1p.cjs.map} +1 -1
- package/dist/{create-team-CJhrccc1.cjs → create-team-DKpKxVIY.cjs} +2 -2
- package/dist/{create-team-CJhrccc1.cjs.map → create-team-DKpKxVIY.cjs.map} +1 -1
- package/dist/{create-team-zHz00C6Q.js → create-team-HWN88CJQ.js} +2 -2
- package/dist/{create-team-zHz00C6Q.js.map → create-team-HWN88CJQ.js.map} +1 -1
- package/dist/errors-BtJEw2Z-.cjs +38 -0
- package/dist/errors-BtJEw2Z-.cjs.map +1 -0
- package/dist/errors-D_R568zP.js +26 -0
- package/dist/errors-D_R568zP.js.map +1 -0
- package/dist/errors.cjs +2 -1
- package/dist/errors.d.cts +10 -2
- package/dist/errors.d.cts.map +1 -1
- package/dist/errors.d.ts +10 -2
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +2 -2
- package/dist/fetch-utils-B0CB5xLM.d.ts +33 -0
- package/dist/fetch-utils-B0CB5xLM.d.ts.map +1 -0
- package/dist/fetch-utils-CTLoW1R8.d.cts +33 -0
- package/dist/fetch-utils-CTLoW1R8.d.cts.map +1 -0
- package/dist/fetch-utils-SuGtrQRz.cjs +64 -0
- package/dist/fetch-utils-SuGtrQRz.cjs.map +1 -0
- package/dist/fetch-utils-gHZdOZV2.js +52 -0
- package/dist/fetch-utils-gHZdOZV2.js.map +1 -0
- package/dist/{find-dsns-BoEP0N7B.js → find-dsns-BB9dQP0b.js} +2 -2
- package/dist/{find-dsns-BoEP0N7B.js.map → find-dsns-BB9dQP0b.js.map} +1 -1
- package/dist/{find-dsns-CK59RaUJ.cjs → find-dsns-vriZSwr7.cjs} +2 -2
- package/dist/{find-dsns-CK59RaUJ.cjs.map → find-dsns-vriZSwr7.cjs.map} +1 -1
- package/dist/{find-errors-CB9NpSxG.cjs → find-errors-BQFHuBHi.cjs} +6 -3
- package/dist/find-errors-BQFHuBHi.cjs.map +1 -0
- package/dist/{find-errors-C3oUMeRi.js → find-errors-CSPsT-Jp.js} +6 -3
- package/dist/find-errors-CSPsT-Jp.js.map +1 -0
- package/dist/{find-issues-C3uk59rn.cjs → find-issues-BG80wLZw.cjs} +7 -4
- package/dist/find-issues-BG80wLZw.cjs.map +1 -0
- package/dist/{find-issues-CAtNGBly.js → find-issues-DoUD8vP0.js} +7 -4
- package/dist/find-issues-DoUD8vP0.js.map +1 -0
- package/dist/{find-organizations-ojXwWWzk.js → find-organizations-BILg1hUb.js} +3 -3
- package/dist/find-organizations-BILg1hUb.js.map +1 -0
- package/dist/{find-organizations-BrdMfZRO.cjs → find-organizations-Cx5vCj4j.cjs} +3 -3
- package/dist/find-organizations-Cx5vCj4j.cjs.map +1 -0
- package/dist/{find-projects-BZWhlYJh.cjs → find-projects-CN99WBex.cjs} +3 -3
- package/dist/{find-projects-BZWhlYJh.cjs.map → find-projects-CN99WBex.cjs.map} +1 -1
- package/dist/{find-projects-fcLG4KpT.js → find-projects-CgCj2_eq.js} +3 -3
- package/dist/{find-projects-fcLG4KpT.js.map → find-projects-CgCj2_eq.js.map} +1 -1
- package/dist/{find-releases-BUozr0Z-.js → find-releases-BsQF3wc5.js} +2 -2
- package/dist/{find-releases-BUozr0Z-.js.map → find-releases-BsQF3wc5.js.map} +1 -1
- package/dist/{find-releases-CZCVEOHZ.cjs → find-releases-Cm11xU5S.cjs} +2 -2
- package/dist/{find-releases-CZCVEOHZ.cjs.map → find-releases-Cm11xU5S.cjs.map} +1 -1
- package/dist/{find-tags-d-wF1Se8.js → find-tags-BRaa2i-r.js} +2 -2
- package/dist/{find-tags-d-wF1Se8.js.map → find-tags-BRaa2i-r.js.map} +1 -1
- package/dist/{find-tags-Byk4d3oZ.cjs → find-tags-BjibTJBm.cjs} +2 -2
- package/dist/{find-tags-Byk4d3oZ.cjs.map → find-tags-BjibTJBm.cjs.map} +1 -1
- package/dist/{find-teams-CnU5x9rQ.cjs → find-teams-CS443jRa.cjs} +3 -3
- package/dist/{find-teams-CnU5x9rQ.cjs.map → find-teams-CS443jRa.cjs.map} +1 -1
- package/dist/{find-teams-BZ118EIK.js → find-teams-XgUg8Nj5.js} +3 -3
- package/dist/{find-teams-BZ118EIK.js.map → find-teams-XgUg8Nj5.js.map} +1 -1
- package/dist/{find-transactions-DuZyqjhF.cjs → find-transactions-B0s_rr0H.cjs} +2 -2
- package/dist/{find-transactions-DuZyqjhF.cjs.map → find-transactions-B0s_rr0H.cjs.map} +1 -1
- package/dist/{find-transactions-BiBgg-AE.js → find-transactions-Cob_B_3u.js} +2 -2
- package/dist/{find-transactions-BiBgg-AE.js.map → find-transactions-Cob_B_3u.js.map} +1 -1
- package/dist/{formatting-D0Aki7rK.cjs → formatting-AXU4XsjJ.cjs} +2 -2
- package/dist/{formatting-D0Aki7rK.cjs.map → formatting-AXU4XsjJ.cjs.map} +1 -1
- package/dist/{formatting-vtXxusbn.d.ts → formatting-DnSI0DHf.d.ts} +4 -4
- package/dist/{formatting-vtXxusbn.d.ts.map → formatting-DnSI0DHf.d.ts.map} +1 -1
- package/dist/{formatting-Bvyded57.js → formatting-WGc5qrhv.js} +2 -2
- package/dist/{formatting-Bvyded57.js.map → formatting-WGc5qrhv.js.map} +1 -1
- package/dist/{formatting-CcTK2X8V.d.cts → formatting-aGQ7M_2w.d.cts} +4 -4
- package/dist/{formatting-CcTK2X8V.d.cts.map → formatting-aGQ7M_2w.d.cts.map} +1 -1
- package/dist/{get-doc-DaTCenOE.cjs → get-doc-ByXR3EWc.cjs} +4 -4
- package/dist/{get-doc-DaTCenOE.cjs.map → get-doc-ByXR3EWc.cjs.map} +1 -1
- package/dist/{get-doc-YTiQznr1.js → get-doc-C1IEG2pH.js} +4 -4
- package/dist/{get-doc-YTiQznr1.js.map → get-doc-C1IEG2pH.js.map} +1 -1
- package/dist/{get-event-attachment-C-ig2-3F.cjs → get-event-attachment-CuGUfVAD.cjs} +2 -2
- package/dist/{get-event-attachment-C-ig2-3F.cjs.map → get-event-attachment-CuGUfVAD.cjs.map} +1 -1
- package/dist/{get-event-attachment-DVCPpUMj.js → get-event-attachment-N11gSV23.js} +2 -2
- package/dist/{get-event-attachment-DVCPpUMj.js.map → get-event-attachment-N11gSV23.js.map} +1 -1
- package/dist/{get-issue-details-Dcmzxknx.js → get-issue-details-BrEGybe0.js} +9 -6
- package/dist/get-issue-details-BrEGybe0.js.map +1 -0
- package/dist/{get-issue-details-lBrYR9yx.cjs → get-issue-details-EklkHsWi.cjs} +9 -6
- package/dist/get-issue-details-EklkHsWi.cjs.map +1 -0
- package/dist/index.cjs +34 -34
- package/dist/index.js +34 -34
- package/dist/internal/fetch-utils.cjs +3 -2
- package/dist/internal/fetch-utils.d.cts +2 -2
- package/dist/internal/fetch-utils.d.ts +2 -2
- package/dist/internal/fetch-utils.js +2 -2
- package/dist/internal/formatting.cjs +2 -2
- package/dist/internal/formatting.d.cts +4 -4
- package/dist/internal/formatting.d.ts +4 -4
- package/dist/internal/formatting.js +2 -2
- package/dist/internal/issue-helpers.cjs +2 -1
- package/dist/internal/issue-helpers.js +2 -1
- package/dist/internal/test-fixtures.d.cts +44 -44
- package/dist/internal/test-fixtures.d.cts.map +1 -1
- package/dist/internal/test-fixtures.d.ts +2 -2
- package/dist/issue-helpers-BJffpNoO.d.ts.map +1 -1
- package/dist/issue-helpers-Cz01Ipvl.d.cts.map +1 -1
- package/dist/{issue-helpers-CqqYnwYE.js → issue-helpers-D2p1Gkgm.js} +15 -19
- package/dist/issue-helpers-D2p1Gkgm.js.map +1 -0
- package/dist/{issue-helpers-DyAIO0w6.cjs → issue-helpers-DvsTfq9u.cjs} +14 -19
- package/dist/issue-helpers-DvsTfq9u.cjs.map +1 -0
- package/dist/{prompts-C8Y9w5c4.js → prompts-Cuwmybyc.js} +2 -2
- package/dist/{prompts-C8Y9w5c4.js.map → prompts-Cuwmybyc.js.map} +1 -1
- package/dist/{prompts-Df3i1XSB.cjs → prompts-uWAbMvLe.cjs} +2 -2
- package/dist/{prompts-Df3i1XSB.cjs.map → prompts-uWAbMvLe.cjs.map} +1 -1
- package/dist/prompts.cjs +2 -2
- package/dist/prompts.js +2 -2
- package/dist/{resources-BM_YQGcb.cjs → resources-BlgeiG6C.cjs} +2 -2
- package/dist/{resources-BM_YQGcb.cjs.map → resources-BlgeiG6C.cjs.map} +1 -1
- package/dist/{resources-BHF8a1ZB.js → resources-CwWOjB8_.js} +2 -2
- package/dist/{resources-BHF8a1ZB.js.map → resources-CwWOjB8_.js.map} +1 -1
- package/dist/resources.cjs +2 -2
- package/dist/resources.js +2 -2
- package/dist/{schema-3NeMWRAm.d.cts → schema-BW_fxx99.d.cts} +157 -157
- package/dist/{schema-3NeMWRAm.d.cts.map → schema-BW_fxx99.d.cts.map} +1 -1
- package/dist/{schema-B3CzDGJk.d.ts → schema-DkWOa2-c.d.ts} +83 -83
- package/dist/{schema-B3CzDGJk.d.ts.map → schema-DkWOa2-c.d.ts.map} +1 -1
- package/dist/schema.d.cts.map +1 -1
- package/dist/{search-docs-BLbB_GV2.js → search-docs-BKUeMSyn.js} +3 -3
- package/dist/{search-docs-BLbB_GV2.js.map → search-docs-BKUeMSyn.js.map} +1 -1
- package/dist/{search-docs-D5Foht_0.cjs → search-docs-Cr-gyE5m.cjs} +3 -3
- package/dist/{search-docs-D5Foht_0.cjs.map → search-docs-Cr-gyE5m.cjs.map} +1 -1
- package/dist/{seer-utils-Cj9DXrow.js → seer-utils-BdE7DddW.js} +4 -2
- package/dist/seer-utils-BdE7DddW.js.map +1 -0
- package/dist/{seer-utils-CDm5J8ur.cjs → seer-utils-BvdVTH85.cjs} +15 -1
- package/dist/seer-utils-BvdVTH85.cjs.map +1 -0
- package/dist/{server-Dgkqz8bA.cjs → server-9IEGGN8V.cjs} +40 -24
- package/dist/{server-BSRxzYFd.js.map → server-9IEGGN8V.cjs.map} +1 -1
- package/dist/{server-BSRxzYFd.js → server-BhNrW6bw.js} +40 -24
- package/dist/server-BhNrW6bw.js.map +1 -0
- package/dist/server.cjs +31 -31
- package/dist/server.d.cts.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +31 -31
- package/dist/{stdio-BcihaDjO.js → stdio-CQmibRBR.js} +3 -3
- package/dist/{stdio-BcihaDjO.js.map → stdio-CQmibRBR.js.map} +1 -1
- package/dist/{stdio-BQAm0Liz.cjs → stdio-mw-fEjO4.cjs} +3 -3
- package/dist/{stdio-BQAm0Liz.cjs.map → stdio-mw-fEjO4.cjs.map} +1 -1
- package/dist/tools/analyze-issue-with-seer.cjs +8 -7
- package/dist/tools/analyze-issue-with-seer.js +8 -7
- package/dist/tools/create-dsn.cjs +4 -4
- package/dist/tools/create-dsn.js +4 -4
- package/dist/tools/create-project.cjs +4 -4
- package/dist/tools/create-project.js +4 -4
- package/dist/tools/create-team.cjs +4 -4
- package/dist/tools/create-team.js +4 -4
- package/dist/tools/find-dsns.cjs +4 -4
- package/dist/tools/find-dsns.js +4 -4
- package/dist/tools/find-errors.cjs +4 -4
- package/dist/tools/find-errors.js +4 -4
- package/dist/tools/find-issues.cjs +4 -4
- package/dist/tools/find-issues.js +4 -4
- package/dist/tools/find-organizations.cjs +4 -4
- package/dist/tools/find-organizations.js +4 -4
- package/dist/tools/find-projects.cjs +4 -4
- package/dist/tools/find-projects.js +4 -4
- package/dist/tools/find-releases.cjs +4 -4
- package/dist/tools/find-releases.js +4 -4
- package/dist/tools/find-tags.cjs +4 -4
- package/dist/tools/find-tags.js +4 -4
- package/dist/tools/find-teams.cjs +4 -4
- package/dist/tools/find-teams.js +4 -4
- package/dist/tools/find-transactions.cjs +4 -4
- package/dist/tools/find-transactions.js +4 -4
- package/dist/tools/get-doc.cjs +4 -4
- package/dist/tools/get-doc.js +4 -4
- package/dist/tools/get-event-attachment.cjs +4 -4
- package/dist/tools/get-event-attachment.js +4 -4
- package/dist/tools/get-issue-details.cjs +7 -7
- package/dist/tools/get-issue-details.js +7 -7
- package/dist/tools/index.cjs +28 -28
- package/dist/tools/index.d.cts +76 -76
- package/dist/tools/index.d.ts +76 -76
- package/dist/tools/index.js +28 -28
- package/dist/tools/search-docs.cjs +4 -3
- package/dist/tools/search-docs.js +4 -3
- package/dist/tools/update-issue.cjs +7 -7
- package/dist/tools/update-issue.js +7 -7
- package/dist/tools/update-project.cjs +4 -4
- package/dist/tools/update-project.js +4 -4
- package/dist/tools/utils/api-utils.cjs +6 -4
- package/dist/tools/utils/api-utils.d.cts +22 -5
- package/dist/tools/utils/api-utils.d.cts.map +1 -1
- package/dist/tools/utils/api-utils.d.ts +22 -5
- package/dist/tools/utils/api-utils.d.ts.map +1 -1
- package/dist/tools/utils/api-utils.js +4 -4
- package/dist/tools/utils/fetch-utils.cjs +3 -2
- package/dist/tools/utils/fetch-utils.d.cts +2 -2
- package/dist/tools/utils/fetch-utils.d.ts +2 -2
- package/dist/tools/utils/fetch-utils.js +2 -2
- package/dist/tools/utils/formatting-utils.d.cts +3 -3
- package/dist/tools/utils/formatting-utils.d.ts +3 -3
- package/dist/tools/utils/issue-utils.cjs +4 -3
- package/dist/tools/utils/issue-utils.d.cts +4 -4
- package/dist/tools/utils/issue-utils.d.ts +4 -4
- package/dist/tools/utils/issue-utils.js +4 -3
- package/dist/tools/utils/seer-utils.cjs +3 -1
- package/dist/tools/utils/seer-utils.d.cts +6 -4
- package/dist/tools/utils/seer-utils.d.cts.map +1 -1
- package/dist/tools/utils/seer-utils.d.ts +6 -4
- package/dist/tools/utils/seer-utils.d.ts.map +1 -1
- package/dist/tools/utils/seer-utils.js +2 -2
- package/dist/tools/whoami.cjs +4 -4
- package/dist/tools/whoami.js +4 -4
- package/dist/tools-AYbI0sEf.js +48 -0
- package/dist/{tools-CdXGgq1W.js.map → tools-AYbI0sEf.js.map} +1 -1
- package/dist/{tools-CHnZvVEN.cjs → tools-CwQFlJzn.cjs} +21 -21
- package/dist/{tools-CHnZvVEN.cjs.map → tools-CwQFlJzn.cjs.map} +1 -1
- package/dist/transports/stdio.cjs +33 -33
- package/dist/transports/stdio.js +33 -33
- package/dist/{types-BoMP-Ro6.d.cts → types-BAbu4Vzx.d.cts} +2 -2
- package/dist/{types-BoMP-Ro6.d.cts.map → types-BAbu4Vzx.d.cts.map} +1 -1
- package/dist/{types-DpV1JAZj.d.ts → types-CoY5KVni.d.ts} +2 -2
- package/dist/{types-DpV1JAZj.d.ts.map → types-CoY5KVni.d.ts.map} +1 -1
- package/dist/{update-issue-DRTQvy6p.js → update-issue-ClbiTLyL.js} +12 -6
- package/dist/update-issue-ClbiTLyL.js.map +1 -0
- package/dist/{update-issue-DpkxxiNk.cjs → update-issue-_4vzwHfZ.cjs} +12 -6
- package/dist/update-issue-_4vzwHfZ.cjs.map +1 -0
- package/dist/{update-project-DLDDbcGY.cjs → update-project-2EEnezbZ.cjs} +3 -3
- package/dist/{update-project-DLDDbcGY.cjs.map → update-project-2EEnezbZ.cjs.map} +1 -1
- package/dist/{update-project-YLxt2ry2.js → update-project-CExfO7tG.js} +3 -3
- package/dist/{update-project-YLxt2ry2.js.map → update-project-CExfO7tG.js.map} +1 -1
- package/dist/version-3e1twbPm.js +6 -0
- package/dist/{version-CcTnFB56.js.map → version-3e1twbPm.js.map} +1 -1
- package/dist/{version-rDjaSkPw.cjs → version-Cp9p-38J.cjs} +2 -2
- package/dist/{version-rDjaSkPw.cjs.map → version-Cp9p-38J.cjs.map} +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/dist/{whoami-DesNZnaQ.js → whoami-DhoaHHY5.js} +2 -2
- package/dist/{whoami-DesNZnaQ.js.map → whoami-DhoaHHY5.js.map} +1 -1
- package/dist/{whoami-CEgbTUqt.cjs → whoami-m0N5F6BN.cjs} +2 -2
- package/dist/{whoami-CEgbTUqt.cjs.map → whoami-m0N5F6BN.cjs.map} +1 -1
- package/package.json +3 -3
- package/dist/analyze-issue-with-seer-BkVrrh28.cjs.map +0 -1
- package/dist/analyze-issue-with-seer-CoqsTklL.js.map +0 -1
- package/dist/api-utils-C6QJAzFL.js +0 -31
- package/dist/api-utils-C6QJAzFL.js.map +0 -1
- package/dist/api-utils-d36iteNO.cjs +0 -36
- package/dist/api-utils-d36iteNO.cjs.map +0 -1
- package/dist/client-CQ9Xe1aN.d.cts.map +0 -1
- package/dist/client-DOYWNvVM.js.map +0 -1
- package/dist/client-Dkw5iYu3.cjs.map +0 -1
- package/dist/client-VCJp6Kcu.d.ts.map +0 -1
- package/dist/errors-CIoxzIug.js +0 -15
- package/dist/errors-CIoxzIug.js.map +0 -1
- package/dist/errors-YmiXLOyx.cjs +0 -21
- package/dist/errors-YmiXLOyx.cjs.map +0 -1
- package/dist/fetch-utils-BMKjO-cc.js +0 -29
- package/dist/fetch-utils-BMKjO-cc.js.map +0 -1
- package/dist/fetch-utils-Bv9WjUp0.d.ts +0 -14
- package/dist/fetch-utils-Bv9WjUp0.d.ts.map +0 -1
- package/dist/fetch-utils-DzdRW4Yd.d.cts +0 -14
- package/dist/fetch-utils-DzdRW4Yd.d.cts.map +0 -1
- package/dist/fetch-utils-oab6uNp3.cjs +0 -35
- package/dist/fetch-utils-oab6uNp3.cjs.map +0 -1
- package/dist/find-errors-C3oUMeRi.js.map +0 -1
- package/dist/find-errors-CB9NpSxG.cjs.map +0 -1
- package/dist/find-issues-C3uk59rn.cjs.map +0 -1
- package/dist/find-issues-CAtNGBly.js.map +0 -1
- package/dist/find-organizations-BrdMfZRO.cjs.map +0 -1
- package/dist/find-organizations-ojXwWWzk.js.map +0 -1
- package/dist/get-issue-details-Dcmzxknx.js.map +0 -1
- package/dist/get-issue-details-lBrYR9yx.cjs.map +0 -1
- package/dist/issue-helpers-CqqYnwYE.js.map +0 -1
- package/dist/issue-helpers-DyAIO0w6.cjs.map +0 -1
- package/dist/seer-utils-CDm5J8ur.cjs.map +0 -1
- package/dist/seer-utils-Cj9DXrow.js.map +0 -1
- package/dist/server-Dgkqz8bA.cjs.map +0 -1
- package/dist/tools-CdXGgq1W.js +0 -48
- package/dist/update-issue-DRTQvy6p.js.map +0 -1
- package/dist/update-issue-DpkxxiNk.cjs.map +0 -1
- package/dist/version-CcTnFB56.js +0 -6
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DWy1uDak.cjs');
|
|
2
2
|
const require_defineTool = require('./defineTool-lWNTzWl_.cjs');
|
|
3
|
-
const
|
|
3
|
+
const require_client = require('./client-C_lwH0jz.cjs');
|
|
4
|
+
const require_api_utils = require('./api-utils-B-9vnzoA.cjs');
|
|
4
5
|
const require_schema = require('./schema-BpJVmev8.cjs');
|
|
5
|
-
const require_issue_helpers = require('./issue-helpers-
|
|
6
|
-
const require_seer_utils = require('./seer-utils-
|
|
6
|
+
const require_issue_helpers = require('./issue-helpers-DvsTfq9u.cjs');
|
|
7
|
+
const require_seer_utils = require('./seer-utils-BvdVTH85.cjs');
|
|
8
|
+
const require_fetch_utils = require('./fetch-utils-SuGtrQRz.cjs');
|
|
7
9
|
const zod = require_chunk.__toESM(require("zod"));
|
|
8
10
|
const __sentry_core = require_chunk.__toESM(require("@sentry/core"));
|
|
9
11
|
|
|
@@ -67,9 +69,16 @@ var analyze_issue_with_seer_default = require_defineTool.defineTool({
|
|
|
67
69
|
});
|
|
68
70
|
(0, __sentry_core.setTag)("organization.slug", orgSlug);
|
|
69
71
|
let output = `# Seer AI Analysis for Issue ${parsedIssueId}\n\n`;
|
|
70
|
-
let autofixState = await apiService.getAutofixState({
|
|
72
|
+
let autofixState = await require_fetch_utils.retryWithBackoff(() => apiService.getAutofixState({
|
|
71
73
|
organizationSlug: orgSlug,
|
|
72
74
|
issueId: parsedIssueId
|
|
75
|
+
}), {
|
|
76
|
+
maxRetries: require_seer_utils.SEER_MAX_RETRIES,
|
|
77
|
+
initialDelay: require_seer_utils.SEER_INITIAL_RETRY_DELAY,
|
|
78
|
+
shouldRetry: (error) => {
|
|
79
|
+
if (error instanceof require_client.ApiError) return error.status >= 500;
|
|
80
|
+
return true;
|
|
81
|
+
}
|
|
73
82
|
});
|
|
74
83
|
if (!autofixState.autofix) {
|
|
75
84
|
output += `Starting new analysis...\n\n`;
|
|
@@ -80,9 +89,16 @@ var analyze_issue_with_seer_default = require_defineTool.defineTool({
|
|
|
80
89
|
});
|
|
81
90
|
output += `Analysis started with Run ID: ${startResult.run_id}\n\n`;
|
|
82
91
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
83
|
-
autofixState = await apiService.getAutofixState({
|
|
92
|
+
autofixState = await require_fetch_utils.retryWithBackoff(() => apiService.getAutofixState({
|
|
84
93
|
organizationSlug: orgSlug,
|
|
85
94
|
issueId: parsedIssueId
|
|
95
|
+
}), {
|
|
96
|
+
maxRetries: require_seer_utils.SEER_MAX_RETRIES,
|
|
97
|
+
initialDelay: require_seer_utils.SEER_INITIAL_RETRY_DELAY,
|
|
98
|
+
shouldRetry: (error) => {
|
|
99
|
+
if (error instanceof require_client.ApiError) return error.status >= 500;
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
86
102
|
});
|
|
87
103
|
} else {
|
|
88
104
|
output += `Found existing analysis (Run ID: ${autofixState.autofix.run_id})\n\n`;
|
|
@@ -103,6 +119,7 @@ var analyze_issue_with_seer_default = require_defineTool.defineTool({
|
|
|
103
119
|
}
|
|
104
120
|
const startTime = Date.now();
|
|
105
121
|
let lastStatus = "";
|
|
122
|
+
let consecutiveErrors = 0;
|
|
106
123
|
while (Date.now() - startTime < require_seer_utils.SEER_TIMEOUT) {
|
|
107
124
|
if (!autofixState.autofix) {
|
|
108
125
|
output += `Error: Analysis state lost. Please try again by running:\n`;
|
|
@@ -130,10 +147,33 @@ var analyze_issue_with_seer_default = require_defineTool.defineTool({
|
|
|
130
147
|
lastStatus = status;
|
|
131
148
|
}
|
|
132
149
|
await new Promise((resolve) => setTimeout(resolve, require_seer_utils.SEER_POLLING_INTERVAL));
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
150
|
+
try {
|
|
151
|
+
autofixState = await require_fetch_utils.retryWithBackoff(() => apiService.getAutofixState({
|
|
152
|
+
organizationSlug: orgSlug,
|
|
153
|
+
issueId: parsedIssueId
|
|
154
|
+
}), {
|
|
155
|
+
maxRetries: require_seer_utils.SEER_MAX_RETRIES,
|
|
156
|
+
initialDelay: require_seer_utils.SEER_INITIAL_RETRY_DELAY,
|
|
157
|
+
shouldRetry: (error) => {
|
|
158
|
+
if (error instanceof require_client.ApiError) return error.status >= 500;
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
consecutiveErrors = 0;
|
|
163
|
+
} catch (error) {
|
|
164
|
+
consecutiveErrors++;
|
|
165
|
+
if (consecutiveErrors >= 3) {
|
|
166
|
+
output += `\n## Error During Analysis\n\n`;
|
|
167
|
+
output += `Unable to retrieve analysis status after multiple attempts.\n`;
|
|
168
|
+
output += `Error: ${error instanceof Error ? error.message : String(error)}\n\n`;
|
|
169
|
+
output += `You can check the status later by running the same command again:\n`;
|
|
170
|
+
output += `\`\`\`\n`;
|
|
171
|
+
output += params.issueUrl ? `analyze_issue_with_seer(issueUrl="${params.issueUrl}")` : `analyze_issue_with_seer(organizationSlug="${orgSlug}", issueId="${parsedIssueId}")`;
|
|
172
|
+
output += `\n\`\`\`\n`;
|
|
173
|
+
return output;
|
|
174
|
+
}
|
|
175
|
+
output += `Temporary error retrieving status (attempt ${consecutiveErrors}/3), retrying...\n`;
|
|
176
|
+
}
|
|
137
177
|
}
|
|
138
178
|
if (autofixState.autofix) {
|
|
139
179
|
output += `**Current Status**: ${require_seer_utils.getStatusDisplayName(autofixState.autofix.status)}\n\n`;
|
|
@@ -159,4 +199,4 @@ Object.defineProperty(exports, 'analyze_issue_with_seer_default', {
|
|
|
159
199
|
return analyze_issue_with_seer_default;
|
|
160
200
|
}
|
|
161
201
|
});
|
|
162
|
-
//# sourceMappingURL=analyze-issue-with-seer-
|
|
202
|
+
//# sourceMappingURL=analyze-issue-with-seer-B8ZWokLV.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze-issue-with-seer-B8ZWokLV.cjs","names":["context: ServerContext","SEER_MAX_RETRIES","SEER_INITIAL_RETRY_DELAY","ApiError","SEER_TIMEOUT","SEER_POLLING_INTERVAL"],"sources":["../src/tools/analyze-issue-with-seer.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport { parseIssueParams } from \"./utils/issue-utils\";\nimport {\n getStatusDisplayName,\n isTerminalStatus,\n isHumanInterventionStatus,\n getHumanInterventionGuidance,\n getOutputForAutofixStep,\n SEER_POLLING_INTERVAL,\n SEER_TIMEOUT,\n SEER_MAX_RETRIES,\n SEER_INITIAL_RETRY_DELAY,\n} from \"./utils/seer-utils\";\nimport { retryWithBackoff } from \"../internal/fetch-utils\";\nimport type { ServerContext } from \"../types\";\nimport { ApiError } from \"../api-client/index\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamIssueShortId,\n ParamIssueUrl,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"analyze_issue_with_seer\",\n description: [\n \"Use Seer AI to analyze production errors and get detailed root cause analysis with specific code fixes.\",\n \"\",\n \"Use this tool when you need:\",\n \"- Detailed AI-powered root cause analysis\",\n \"- Specific code fixes and implementation guidance\",\n \"- Step-by-step troubleshooting for complex issues\",\n \"- Understanding why an error is happening in production\",\n \"\",\n \"What this tool provides:\",\n \"- Root cause analysis with code-level explanations\",\n \"- Specific file locations and line numbers where errors occur\",\n \"- Concrete code fixes you can apply\",\n \"- Step-by-step implementation guidance\",\n \"\",\n \"This tool automatically:\",\n \"1. Checks if analysis already exists (instant results)\",\n \"2. Starts new AI analysis if needed (~2-5 minutes)\",\n \"3. Returns complete fix recommendations\",\n \"\",\n \"<examples>\",\n '### User: \"What\\'s causing this error? https://my-org.sentry.io/issues/PROJECT-1Z43\"',\n \"\",\n \"```\",\n \"analyze_issue_with_seer(issueUrl='https://my-org.sentry.io/issues/PROJECT-1Z43')\",\n \"```\",\n \"\",\n '### User: \"Can you help me understand why this is failing in production?\"',\n \"\",\n \"```\",\n \"analyze_issue_with_seer(organizationSlug='my-organization', issueId='ERROR-456')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- Use this tool when you need deeper analysis beyond basic issue details\",\n \"- If the user provides an issueUrl, extract it and use that parameter alone\",\n \"- The analysis includes actual code snippets and fixes, not just error descriptions\",\n \"- Results are cached - subsequent calls return instantly\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n issueId: ParamIssueShortId.optional(),\n issueUrl: ParamIssueUrl.optional(),\n instruction: z\n .string()\n .describe(\"Optional custom instruction for the AI analysis\")\n .optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const { organizationSlug: orgSlug, issueId: parsedIssueId } =\n parseIssueParams({\n organizationSlug: params.organizationSlug,\n issueId: params.issueId,\n issueUrl: params.issueUrl,\n });\n\n setTag(\"organization.slug\", orgSlug);\n\n let output = `# Seer AI Analysis for Issue ${parsedIssueId}\\n\\n`;\n\n // Step 1: Check if analysis already exists\n let autofixState = await retryWithBackoff(\n () =>\n apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n }),\n {\n maxRetries: SEER_MAX_RETRIES,\n initialDelay: SEER_INITIAL_RETRY_DELAY,\n shouldRetry: (error) => {\n // Retry on network errors or 5xx errors\n if (error instanceof ApiError) {\n return error.status >= 500;\n }\n // Retry on network/connection errors\n return true;\n },\n },\n );\n\n // Step 2: Start analysis if none exists\n if (!autofixState.autofix) {\n output += `Starting new analysis...\\n\\n`;\n const startResult = await apiService.startAutofix({\n organizationSlug: orgSlug,\n issueId: parsedIssueId,\n instruction: params.instruction,\n });\n output += `Analysis started with Run ID: ${startResult.run_id}\\n\\n`;\n\n // Give it a moment to initialize\n await new Promise((resolve) => setTimeout(resolve, 1000));\n\n // Refresh state with retry logic\n autofixState = await retryWithBackoff(\n () =>\n apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n }),\n {\n maxRetries: SEER_MAX_RETRIES,\n initialDelay: SEER_INITIAL_RETRY_DELAY,\n shouldRetry: (error) => {\n if (error instanceof ApiError) {\n return error.status >= 500;\n }\n return true;\n },\n },\n );\n } else {\n output += `Found existing analysis (Run ID: ${autofixState.autofix.run_id})\\n\\n`;\n\n // Check if existing analysis is already complete\n const existingStatus = autofixState.autofix.status;\n if (isTerminalStatus(existingStatus)) {\n // Return results immediately, no polling needed\n output += `## Analysis ${getStatusDisplayName(existingStatus)}\\n\\n`;\n\n for (const step of autofixState.autofix.steps) {\n output += getOutputForAutofixStep(step);\n output += \"\\n\";\n }\n\n if (existingStatus !== \"COMPLETED\") {\n output += `\\n**Status**: ${existingStatus}\\n`;\n output += getHumanInterventionGuidance(existingStatus);\n output += \"\\n\";\n }\n\n return output;\n }\n }\n\n // Step 3: Poll until complete or timeout (only for non-terminal states)\n const startTime = Date.now();\n let lastStatus = \"\";\n let consecutiveErrors = 0;\n\n while (Date.now() - startTime < SEER_TIMEOUT) {\n if (!autofixState.autofix) {\n output += `Error: Analysis state lost. Please try again by running:\\n`;\n output += `\\`\\`\\`\\n`;\n output += params.issueUrl\n ? `analyze_issue_with_seer(issueUrl=\"${params.issueUrl}\")`\n : `analyze_issue_with_seer(organizationSlug=\"${orgSlug}\", issueId=\"${parsedIssueId}\")`;\n output += `\\n\\`\\`\\`\\n`;\n return output;\n }\n\n const status = autofixState.autofix.status;\n\n // Check if completed (terminal state)\n if (isTerminalStatus(status)) {\n output += `## Analysis ${getStatusDisplayName(status)}\\n\\n`;\n\n // Add all step outputs\n for (const step of autofixState.autofix.steps) {\n output += getOutputForAutofixStep(step);\n output += \"\\n\";\n }\n\n if (status !== \"COMPLETED\") {\n output += `\\n**Status**: ${status}\\n`;\n output += getHumanInterventionGuidance(status);\n }\n\n return output;\n }\n\n // Update status if changed\n if (status !== lastStatus) {\n const activeStep = autofixState.autofix.steps.find(\n (step) =>\n step.status === \"PROCESSING\" || step.status === \"IN_PROGRESS\",\n );\n if (activeStep) {\n output += `Processing: ${activeStep.title}...\\n`;\n }\n lastStatus = status;\n }\n\n // Wait before next poll\n await new Promise((resolve) =>\n setTimeout(resolve, SEER_POLLING_INTERVAL),\n );\n\n // Refresh state with error handling\n try {\n autofixState = await retryWithBackoff(\n () =>\n apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n }),\n {\n maxRetries: SEER_MAX_RETRIES,\n initialDelay: SEER_INITIAL_RETRY_DELAY,\n shouldRetry: (error) => {\n if (error instanceof ApiError) {\n return error.status >= 500;\n }\n return true;\n },\n },\n );\n consecutiveErrors = 0; // Reset error counter on success\n } catch (error) {\n consecutiveErrors++;\n\n // If we've had too many consecutive errors, give up\n if (consecutiveErrors >= 3) {\n output += `\\n## Error During Analysis\\n\\n`;\n output += `Unable to retrieve analysis status after multiple attempts.\\n`;\n output += `Error: ${error instanceof Error ? error.message : String(error)}\\n\\n`;\n output += `You can check the status later by running the same command again:\\n`;\n output += `\\`\\`\\`\\n`;\n output += params.issueUrl\n ? `analyze_issue_with_seer(issueUrl=\"${params.issueUrl}\")`\n : `analyze_issue_with_seer(organizationSlug=\"${orgSlug}\", issueId=\"${parsedIssueId}\")`;\n output += `\\n\\`\\`\\`\\n`;\n return output;\n }\n\n // Log the error but continue polling\n output += `Temporary error retrieving status (attempt ${consecutiveErrors}/3), retrying...\\n`;\n }\n }\n\n // Show current progress\n if (autofixState.autofix) {\n output += `**Current Status**: ${getStatusDisplayName(autofixState.autofix.status)}\\n\\n`;\n for (const step of autofixState.autofix.steps) {\n output += getOutputForAutofixStep(step);\n output += \"\\n\";\n }\n }\n\n // Timeout reached\n output += `\\n## Analysis Timed Out\\n\\n`;\n output += `The analysis is taking longer than expected (>${SEER_TIMEOUT / 1000}s).\\n\\n`;\n\n output += `\\nYou can check the status later by running the same command again:\\n`;\n output += `\\`\\`\\`\\n`;\n output += params.issueUrl\n ? `analyze_issue_with_seer(issueUrl=\"${params.issueUrl}\")`\n : `analyze_issue_with_seer(organizationSlug=\"${orgSlug}\", issueId=\"${parsedIssueId}\")`;\n output += `\\n\\`\\`\\`\\n`;\n\n return output;\n },\n});\n"],"mappings":"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"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { defineTool } from "./defineTool-77H4nSna.js";
|
|
2
|
-
import {
|
|
2
|
+
import { ApiError } from "./client-pyNUFaLN.js";
|
|
3
|
+
import { apiServiceFromContext } from "./api-utils-CHRiLf2Y.js";
|
|
3
4
|
import { ParamIssueShortId, ParamIssueUrl, ParamOrganizationSlug, ParamRegionUrl } from "./schema-DtsnsxMl.js";
|
|
4
|
-
import { parseIssueParams } from "./issue-helpers-
|
|
5
|
-
import { SEER_POLLING_INTERVAL, SEER_TIMEOUT, getHumanInterventionGuidance, getOutputForAutofixStep, getStatusDisplayName, isTerminalStatus } from "./seer-utils-
|
|
5
|
+
import { parseIssueParams } from "./issue-helpers-D2p1Gkgm.js";
|
|
6
|
+
import { SEER_INITIAL_RETRY_DELAY, SEER_MAX_RETRIES, SEER_POLLING_INTERVAL, SEER_TIMEOUT, getHumanInterventionGuidance, getOutputForAutofixStep, getStatusDisplayName, isTerminalStatus } from "./seer-utils-BdE7DddW.js";
|
|
7
|
+
import { retryWithBackoff } from "./fetch-utils-gHZdOZV2.js";
|
|
6
8
|
import { z } from "zod";
|
|
7
9
|
import { setTag } from "@sentry/core";
|
|
8
10
|
|
|
@@ -66,9 +68,16 @@ var analyze_issue_with_seer_default = defineTool({
|
|
|
66
68
|
});
|
|
67
69
|
setTag("organization.slug", orgSlug);
|
|
68
70
|
let output = `# Seer AI Analysis for Issue ${parsedIssueId}\n\n`;
|
|
69
|
-
let autofixState = await apiService.getAutofixState({
|
|
71
|
+
let autofixState = await retryWithBackoff(() => apiService.getAutofixState({
|
|
70
72
|
organizationSlug: orgSlug,
|
|
71
73
|
issueId: parsedIssueId
|
|
74
|
+
}), {
|
|
75
|
+
maxRetries: SEER_MAX_RETRIES,
|
|
76
|
+
initialDelay: SEER_INITIAL_RETRY_DELAY,
|
|
77
|
+
shouldRetry: (error) => {
|
|
78
|
+
if (error instanceof ApiError) return error.status >= 500;
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
72
81
|
});
|
|
73
82
|
if (!autofixState.autofix) {
|
|
74
83
|
output += `Starting new analysis...\n\n`;
|
|
@@ -79,9 +88,16 @@ var analyze_issue_with_seer_default = defineTool({
|
|
|
79
88
|
});
|
|
80
89
|
output += `Analysis started with Run ID: ${startResult.run_id}\n\n`;
|
|
81
90
|
await new Promise((resolve) => setTimeout(resolve, 1e3));
|
|
82
|
-
autofixState = await apiService.getAutofixState({
|
|
91
|
+
autofixState = await retryWithBackoff(() => apiService.getAutofixState({
|
|
83
92
|
organizationSlug: orgSlug,
|
|
84
93
|
issueId: parsedIssueId
|
|
94
|
+
}), {
|
|
95
|
+
maxRetries: SEER_MAX_RETRIES,
|
|
96
|
+
initialDelay: SEER_INITIAL_RETRY_DELAY,
|
|
97
|
+
shouldRetry: (error) => {
|
|
98
|
+
if (error instanceof ApiError) return error.status >= 500;
|
|
99
|
+
return true;
|
|
100
|
+
}
|
|
85
101
|
});
|
|
86
102
|
} else {
|
|
87
103
|
output += `Found existing analysis (Run ID: ${autofixState.autofix.run_id})\n\n`;
|
|
@@ -102,6 +118,7 @@ var analyze_issue_with_seer_default = defineTool({
|
|
|
102
118
|
}
|
|
103
119
|
const startTime = Date.now();
|
|
104
120
|
let lastStatus = "";
|
|
121
|
+
let consecutiveErrors = 0;
|
|
105
122
|
while (Date.now() - startTime < SEER_TIMEOUT) {
|
|
106
123
|
if (!autofixState.autofix) {
|
|
107
124
|
output += `Error: Analysis state lost. Please try again by running:\n`;
|
|
@@ -129,10 +146,33 @@ var analyze_issue_with_seer_default = defineTool({
|
|
|
129
146
|
lastStatus = status;
|
|
130
147
|
}
|
|
131
148
|
await new Promise((resolve) => setTimeout(resolve, SEER_POLLING_INTERVAL));
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
149
|
+
try {
|
|
150
|
+
autofixState = await retryWithBackoff(() => apiService.getAutofixState({
|
|
151
|
+
organizationSlug: orgSlug,
|
|
152
|
+
issueId: parsedIssueId
|
|
153
|
+
}), {
|
|
154
|
+
maxRetries: SEER_MAX_RETRIES,
|
|
155
|
+
initialDelay: SEER_INITIAL_RETRY_DELAY,
|
|
156
|
+
shouldRetry: (error) => {
|
|
157
|
+
if (error instanceof ApiError) return error.status >= 500;
|
|
158
|
+
return true;
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
consecutiveErrors = 0;
|
|
162
|
+
} catch (error) {
|
|
163
|
+
consecutiveErrors++;
|
|
164
|
+
if (consecutiveErrors >= 3) {
|
|
165
|
+
output += `\n## Error During Analysis\n\n`;
|
|
166
|
+
output += `Unable to retrieve analysis status after multiple attempts.\n`;
|
|
167
|
+
output += `Error: ${error instanceof Error ? error.message : String(error)}\n\n`;
|
|
168
|
+
output += `You can check the status later by running the same command again:\n`;
|
|
169
|
+
output += `\`\`\`\n`;
|
|
170
|
+
output += params.issueUrl ? `analyze_issue_with_seer(issueUrl="${params.issueUrl}")` : `analyze_issue_with_seer(organizationSlug="${orgSlug}", issueId="${parsedIssueId}")`;
|
|
171
|
+
output += `\n\`\`\`\n`;
|
|
172
|
+
return output;
|
|
173
|
+
}
|
|
174
|
+
output += `Temporary error retrieving status (attempt ${consecutiveErrors}/3), retrying...\n`;
|
|
175
|
+
}
|
|
136
176
|
}
|
|
137
177
|
if (autofixState.autofix) {
|
|
138
178
|
output += `**Current Status**: ${getStatusDisplayName(autofixState.autofix.status)}\n\n`;
|
|
@@ -153,4 +193,4 @@ var analyze_issue_with_seer_default = defineTool({
|
|
|
153
193
|
|
|
154
194
|
//#endregion
|
|
155
195
|
export { analyze_issue_with_seer_default };
|
|
156
|
-
//# sourceMappingURL=analyze-issue-with-seer-
|
|
196
|
+
//# sourceMappingURL=analyze-issue-with-seer-szIqv1_I.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyze-issue-with-seer-szIqv1_I.js","names":["context: ServerContext"],"sources":["../src/tools/analyze-issue-with-seer.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport { parseIssueParams } from \"./utils/issue-utils\";\nimport {\n getStatusDisplayName,\n isTerminalStatus,\n isHumanInterventionStatus,\n getHumanInterventionGuidance,\n getOutputForAutofixStep,\n SEER_POLLING_INTERVAL,\n SEER_TIMEOUT,\n SEER_MAX_RETRIES,\n SEER_INITIAL_RETRY_DELAY,\n} from \"./utils/seer-utils\";\nimport { retryWithBackoff } from \"../internal/fetch-utils\";\nimport type { ServerContext } from \"../types\";\nimport { ApiError } from \"../api-client/index\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamIssueShortId,\n ParamIssueUrl,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"analyze_issue_with_seer\",\n description: [\n \"Use Seer AI to analyze production errors and get detailed root cause analysis with specific code fixes.\",\n \"\",\n \"Use this tool when you need:\",\n \"- Detailed AI-powered root cause analysis\",\n \"- Specific code fixes and implementation guidance\",\n \"- Step-by-step troubleshooting for complex issues\",\n \"- Understanding why an error is happening in production\",\n \"\",\n \"What this tool provides:\",\n \"- Root cause analysis with code-level explanations\",\n \"- Specific file locations and line numbers where errors occur\",\n \"- Concrete code fixes you can apply\",\n \"- Step-by-step implementation guidance\",\n \"\",\n \"This tool automatically:\",\n \"1. Checks if analysis already exists (instant results)\",\n \"2. Starts new AI analysis if needed (~2-5 minutes)\",\n \"3. Returns complete fix recommendations\",\n \"\",\n \"<examples>\",\n '### User: \"What\\'s causing this error? https://my-org.sentry.io/issues/PROJECT-1Z43\"',\n \"\",\n \"```\",\n \"analyze_issue_with_seer(issueUrl='https://my-org.sentry.io/issues/PROJECT-1Z43')\",\n \"```\",\n \"\",\n '### User: \"Can you help me understand why this is failing in production?\"',\n \"\",\n \"```\",\n \"analyze_issue_with_seer(organizationSlug='my-organization', issueId='ERROR-456')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- Use this tool when you need deeper analysis beyond basic issue details\",\n \"- If the user provides an issueUrl, extract it and use that parameter alone\",\n \"- The analysis includes actual code snippets and fixes, not just error descriptions\",\n \"- Results are cached - subsequent calls return instantly\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n regionUrl: ParamRegionUrl.optional(),\n issueId: ParamIssueShortId.optional(),\n issueUrl: ParamIssueUrl.optional(),\n instruction: z\n .string()\n .describe(\"Optional custom instruction for the AI analysis\")\n .optional(),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const { organizationSlug: orgSlug, issueId: parsedIssueId } =\n parseIssueParams({\n organizationSlug: params.organizationSlug,\n issueId: params.issueId,\n issueUrl: params.issueUrl,\n });\n\n setTag(\"organization.slug\", orgSlug);\n\n let output = `# Seer AI Analysis for Issue ${parsedIssueId}\\n\\n`;\n\n // Step 1: Check if analysis already exists\n let autofixState = await retryWithBackoff(\n () =>\n apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n }),\n {\n maxRetries: SEER_MAX_RETRIES,\n initialDelay: SEER_INITIAL_RETRY_DELAY,\n shouldRetry: (error) => {\n // Retry on network errors or 5xx errors\n if (error instanceof ApiError) {\n return error.status >= 500;\n }\n // Retry on network/connection errors\n return true;\n },\n },\n );\n\n // Step 2: Start analysis if none exists\n if (!autofixState.autofix) {\n output += `Starting new analysis...\\n\\n`;\n const startResult = await apiService.startAutofix({\n organizationSlug: orgSlug,\n issueId: parsedIssueId,\n instruction: params.instruction,\n });\n output += `Analysis started with Run ID: ${startResult.run_id}\\n\\n`;\n\n // Give it a moment to initialize\n await new Promise((resolve) => setTimeout(resolve, 1000));\n\n // Refresh state with retry logic\n autofixState = await retryWithBackoff(\n () =>\n apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n }),\n {\n maxRetries: SEER_MAX_RETRIES,\n initialDelay: SEER_INITIAL_RETRY_DELAY,\n shouldRetry: (error) => {\n if (error instanceof ApiError) {\n return error.status >= 500;\n }\n return true;\n },\n },\n );\n } else {\n output += `Found existing analysis (Run ID: ${autofixState.autofix.run_id})\\n\\n`;\n\n // Check if existing analysis is already complete\n const existingStatus = autofixState.autofix.status;\n if (isTerminalStatus(existingStatus)) {\n // Return results immediately, no polling needed\n output += `## Analysis ${getStatusDisplayName(existingStatus)}\\n\\n`;\n\n for (const step of autofixState.autofix.steps) {\n output += getOutputForAutofixStep(step);\n output += \"\\n\";\n }\n\n if (existingStatus !== \"COMPLETED\") {\n output += `\\n**Status**: ${existingStatus}\\n`;\n output += getHumanInterventionGuidance(existingStatus);\n output += \"\\n\";\n }\n\n return output;\n }\n }\n\n // Step 3: Poll until complete or timeout (only for non-terminal states)\n const startTime = Date.now();\n let lastStatus = \"\";\n let consecutiveErrors = 0;\n\n while (Date.now() - startTime < SEER_TIMEOUT) {\n if (!autofixState.autofix) {\n output += `Error: Analysis state lost. Please try again by running:\\n`;\n output += `\\`\\`\\`\\n`;\n output += params.issueUrl\n ? `analyze_issue_with_seer(issueUrl=\"${params.issueUrl}\")`\n : `analyze_issue_with_seer(organizationSlug=\"${orgSlug}\", issueId=\"${parsedIssueId}\")`;\n output += `\\n\\`\\`\\`\\n`;\n return output;\n }\n\n const status = autofixState.autofix.status;\n\n // Check if completed (terminal state)\n if (isTerminalStatus(status)) {\n output += `## Analysis ${getStatusDisplayName(status)}\\n\\n`;\n\n // Add all step outputs\n for (const step of autofixState.autofix.steps) {\n output += getOutputForAutofixStep(step);\n output += \"\\n\";\n }\n\n if (status !== \"COMPLETED\") {\n output += `\\n**Status**: ${status}\\n`;\n output += getHumanInterventionGuidance(status);\n }\n\n return output;\n }\n\n // Update status if changed\n if (status !== lastStatus) {\n const activeStep = autofixState.autofix.steps.find(\n (step) =>\n step.status === \"PROCESSING\" || step.status === \"IN_PROGRESS\",\n );\n if (activeStep) {\n output += `Processing: ${activeStep.title}...\\n`;\n }\n lastStatus = status;\n }\n\n // Wait before next poll\n await new Promise((resolve) =>\n setTimeout(resolve, SEER_POLLING_INTERVAL),\n );\n\n // Refresh state with error handling\n try {\n autofixState = await retryWithBackoff(\n () =>\n apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\n }),\n {\n maxRetries: SEER_MAX_RETRIES,\n initialDelay: SEER_INITIAL_RETRY_DELAY,\n shouldRetry: (error) => {\n if (error instanceof ApiError) {\n return error.status >= 500;\n }\n return true;\n },\n },\n );\n consecutiveErrors = 0; // Reset error counter on success\n } catch (error) {\n consecutiveErrors++;\n\n // If we've had too many consecutive errors, give up\n if (consecutiveErrors >= 3) {\n output += `\\n## Error During Analysis\\n\\n`;\n output += `Unable to retrieve analysis status after multiple attempts.\\n`;\n output += `Error: ${error instanceof Error ? error.message : String(error)}\\n\\n`;\n output += `You can check the status later by running the same command again:\\n`;\n output += `\\`\\`\\`\\n`;\n output += params.issueUrl\n ? `analyze_issue_with_seer(issueUrl=\"${params.issueUrl}\")`\n : `analyze_issue_with_seer(organizationSlug=\"${orgSlug}\", issueId=\"${parsedIssueId}\")`;\n output += `\\n\\`\\`\\`\\n`;\n return output;\n }\n\n // Log the error but continue polling\n output += `Temporary error retrieving status (attempt ${consecutiveErrors}/3), retrying...\\n`;\n }\n }\n\n // Show current progress\n if (autofixState.autofix) {\n output += `**Current Status**: ${getStatusDisplayName(autofixState.autofix.status)}\\n\\n`;\n for (const step of autofixState.autofix.steps) {\n output += getOutputForAutofixStep(step);\n output += \"\\n\";\n }\n }\n\n // Timeout reached\n output += `\\n## Analysis Timed Out\\n\\n`;\n output += `The analysis is taking longer than expected (>${SEER_TIMEOUT / 1000}s).\\n\\n`;\n\n output += `\\nYou can check the status later by running the same command again:\\n`;\n output += `\\`\\`\\`\\n`;\n output += params.issueUrl\n ? `analyze_issue_with_seer(issueUrl=\"${params.issueUrl}\")`\n : `analyze_issue_with_seer(organizationSlug=\"${orgSlug}\", issueId=\"${parsedIssueId}\")`;\n output += `\\n\\`\\`\\`\\n`;\n\n return output;\n },\n});\n"],"mappings":"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"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
require('../errors-BtJEw2Z-.cjs');
|
|
1
2
|
require('../schema-B_cMyyJJ.cjs');
|
|
2
|
-
const require_client = require('../client-
|
|
3
|
+
const require_client = require('../client-C_lwH0jz.cjs');
|
|
3
4
|
|
|
4
5
|
exports.ApiError = require_client.ApiError;
|
|
5
6
|
exports.SentryApiService = require_client.SentryApiService;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../schema-
|
|
2
|
-
import "../types-
|
|
3
|
-
import { ApiError, SentryApiService } from "../client-
|
|
1
|
+
import "../schema-BW_fxx99.cjs";
|
|
2
|
+
import "../types-BAbu4Vzx.cjs";
|
|
3
|
+
import { ApiError, SentryApiService } from "../client-D8vrUp2k.cjs";
|
|
4
4
|
export { ApiError, SentryApiService };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../schema-
|
|
2
|
-
import "../types-
|
|
3
|
-
import { ApiError, SentryApiService } from "../client-
|
|
1
|
+
import "../schema-DkWOa2-c.js";
|
|
2
|
+
import "../types-CoY5KVni.js";
|
|
3
|
+
import { ApiError, SentryApiService } from "../client-h32L1Hx5.js";
|
|
4
4
|
export { ApiError, SentryApiService };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
require('../errors-BtJEw2Z-.cjs');
|
|
1
2
|
const require_schema = require('../schema-B_cMyyJJ.cjs');
|
|
2
|
-
const require_client = require('../client-
|
|
3
|
+
const require_client = require('../client-C_lwH0jz.cjs');
|
|
3
4
|
require('../types-MYBaygjr.cjs');
|
|
4
5
|
require('../api-client-CL1WDkw9.cjs');
|
|
5
6
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-
|
|
2
|
-
import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-
|
|
3
|
-
import { ApiError, SentryApiService } from "../client-
|
|
1
|
+
import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-BW_fxx99.cjs";
|
|
2
|
+
import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-BAbu4Vzx.cjs";
|
|
3
|
+
import { ApiError, SentryApiService } from "../client-D8vrUp2k.cjs";
|
|
4
4
|
import "../index-BPSCxsMC.cjs";
|
|
5
5
|
export { ApiError, ApiErrorSchema, AssignedTo, AssignedToSchema, AutofixRun, AutofixRunSchema, AutofixRunState, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKey, ClientKeyList, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, Event, EventAttachment, EventAttachmentList, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, Issue, IssueList, IssueListSchema, IssueSchema, MessageEntrySchema, Organization, OrganizationList, OrganizationListSchema, OrganizationSchema, Project, ProjectList, ProjectListSchema, ProjectSchema, Release, ReleaseList, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SentryApiService, SpansSearchResponseSchema, Tag, TagList, TagListSchema, TagSchema, Team, TeamList, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, User, UserRegionsSchema, UserSchema };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-
|
|
2
|
-
import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-
|
|
3
|
-
import { ApiError, SentryApiService } from "../client-
|
|
1
|
+
import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-DkWOa2-c.js";
|
|
2
|
+
import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-CoY5KVni.js";
|
|
3
|
+
import { ApiError, SentryApiService } from "../client-h32L1Hx5.js";
|
|
4
4
|
import "../index-DVGDAddE.js";
|
|
5
5
|
export { ApiError, ApiErrorSchema, AssignedTo, AssignedToSchema, AutofixRun, AutofixRunSchema, AutofixRunState, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKey, ClientKeyList, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, Event, EventAttachment, EventAttachmentList, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, Issue, IssueList, IssueListSchema, IssueSchema, MessageEntrySchema, Organization, OrganizationList, OrganizationListSchema, OrganizationSchema, Project, ProjectList, ProjectListSchema, ProjectSchema, Release, ReleaseList, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SentryApiService, SpansSearchResponseSchema, Tag, TagList, TagListSchema, TagSchema, Team, TeamList, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, User, UserRegionsSchema, UserSchema };
|
package/dist/api-client/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import "../errors-D_R568zP.js";
|
|
1
2
|
import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-WDk5Yqww.js";
|
|
2
|
-
import { ApiError, SentryApiService } from "../client-
|
|
3
|
+
import { ApiError, SentryApiService } from "../client-pyNUFaLN.js";
|
|
3
4
|
import "../types-CCHsZshF.js";
|
|
4
5
|
import "../api-client-ChL_0F2u.js";
|
|
5
6
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-
|
|
1
|
+
import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-BW_fxx99.cjs";
|
|
2
2
|
export { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-
|
|
1
|
+
import { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema } from "../schema-DkWOa2-c.js";
|
|
2
2
|
export { ApiErrorSchema, AssignedToSchema, AutofixRunSchema, AutofixRunStateSchema, AutofixRunStepDefaultSchema, AutofixRunStepRootCauseAnalysisSchema, AutofixRunStepSchema, AutofixRunStepSolutionSchema, BreadcrumbSchema, BreadcrumbsEntrySchema, ClientKeyListSchema, ClientKeySchema, ErrorEntrySchema, ErrorEventSchema, ErrorsSearchResponseSchema, EventAttachmentListSchema, EventAttachmentSchema, EventSchema, EventsResponseSchema, ExceptionInterface, FrameInterface, IssueListSchema, IssueSchema, MessageEntrySchema, OrganizationListSchema, OrganizationSchema, ProjectListSchema, ProjectSchema, ReleaseListSchema, ReleaseSchema, RequestEntrySchema, SpansSearchResponseSchema, TagListSchema, TagSchema, TeamListSchema, TeamSchema, ThreadEntrySchema, ThreadsEntrySchema, TransactionEventSchema, UnknownEventSchema, UserRegionsSchema, UserSchema };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../schema-
|
|
2
|
-
import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-
|
|
1
|
+
import "../schema-BW_fxx99.cjs";
|
|
2
|
+
import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-BAbu4Vzx.cjs";
|
|
3
3
|
export { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import "../schema-
|
|
2
|
-
import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-
|
|
1
|
+
import "../schema-DkWOa2-c.js";
|
|
2
|
+
import { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User } from "../types-CoY5KVni.js";
|
|
3
3
|
export { AssignedTo, AutofixRun, AutofixRunState, ClientKey, ClientKeyList, Event, EventAttachment, EventAttachmentList, Issue, IssueList, Organization, OrganizationList, Project, ProjectList, Release, ReleaseList, Tag, TagList, Team, TeamList, User };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
const require_errors = require('./errors-BtJEw2Z-.cjs');
|
|
2
|
+
const require_client = require('./client-C_lwH0jz.cjs');
|
|
3
|
+
|
|
4
|
+
//#region src/tools/utils/api-utils.ts
|
|
5
|
+
/**
|
|
6
|
+
* Create a Sentry API service from server context with optional region override
|
|
7
|
+
* @param context - Server context containing host and access token
|
|
8
|
+
* @param opts - Options object containing optional regionUrl override
|
|
9
|
+
* @returns Configured SentryApiService instance (always uses HTTPS)
|
|
10
|
+
* @throws {UserInputError} When regionUrl is provided but invalid
|
|
11
|
+
*/
|
|
12
|
+
function apiServiceFromContext(context, opts = {}) {
|
|
13
|
+
let host = context.sentryHost;
|
|
14
|
+
if (opts.regionUrl?.trim()) try {
|
|
15
|
+
const parsedUrl = new URL(opts.regionUrl);
|
|
16
|
+
if (!["http:", "https:"].includes(parsedUrl.protocol)) throw new require_errors.UserInputError(`Invalid regionUrl provided: ${opts.regionUrl}. Must include protocol (http:// or https://).`);
|
|
17
|
+
if (parsedUrl.host === "https" || parsedUrl.host === "http") throw new require_errors.UserInputError(`Invalid regionUrl provided: ${opts.regionUrl}. The host cannot be just a protocol name.`);
|
|
18
|
+
host = parsedUrl.host;
|
|
19
|
+
} catch (error) {
|
|
20
|
+
if (error instanceof require_errors.UserInputError) throw error;
|
|
21
|
+
throw new require_errors.UserInputError(`Invalid regionUrl provided: ${opts.regionUrl}. Must be a valid URL.`);
|
|
22
|
+
}
|
|
23
|
+
return new require_client.SentryApiService({
|
|
24
|
+
host,
|
|
25
|
+
accessToken: context.accessToken
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Maps API errors to user-friendly errors based on context
|
|
30
|
+
* @param error - The error to handle
|
|
31
|
+
* @param params - The parameters that were used in the API call
|
|
32
|
+
* @returns Never - always throws an error
|
|
33
|
+
* @throws {UserInputError} For errors that are clearly user input issues
|
|
34
|
+
* @throws {Error} For other errors
|
|
35
|
+
*/
|
|
36
|
+
function handleApiError(error, params) {
|
|
37
|
+
if (error instanceof require_client.ApiError && error.status === 404) {
|
|
38
|
+
const paramsList = [];
|
|
39
|
+
if (params) {
|
|
40
|
+
for (const [key, value] of Object.entries(params)) if (value !== void 0 && value !== null && value !== "") paramsList.push(`${key}: '${value}'`);
|
|
41
|
+
}
|
|
42
|
+
if (paramsList.length > 0) throw new require_errors.UserInputError(`Resource not found. Please verify these parameters are correct:\n${paramsList.map((p) => ` - ${p}`).join("\n")}`);
|
|
43
|
+
throw new require_errors.UserInputError(`Resource not found (404). Please verify that all provided identifiers are correct and you have access to the requested resources.`);
|
|
44
|
+
}
|
|
45
|
+
if (error instanceof require_client.ApiError) {
|
|
46
|
+
if (error.status === 400) throw new require_errors.UserInputError(`Invalid request: ${error.message}`);
|
|
47
|
+
if (error.status === 403) throw new require_errors.UserInputError(`Access denied: ${error.message}. Please verify you have access to this resource.`);
|
|
48
|
+
}
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Wraps an async API call with automatic error handling
|
|
53
|
+
* @param fn - The async function to execute
|
|
54
|
+
* @param params - The parameters that were used in the API call
|
|
55
|
+
* @returns The result of the function
|
|
56
|
+
* @throws {UserInputError} For user input errors
|
|
57
|
+
* @throws {Error} For other errors
|
|
58
|
+
*/
|
|
59
|
+
async function withApiErrorHandling(fn, params) {
|
|
60
|
+
try {
|
|
61
|
+
return await fn();
|
|
62
|
+
} catch (error) {
|
|
63
|
+
handleApiError(error, params);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
Object.defineProperty(exports, 'apiServiceFromContext', {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () {
|
|
71
|
+
return apiServiceFromContext;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
Object.defineProperty(exports, 'handleApiError', {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
get: function () {
|
|
77
|
+
return handleApiError;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
Object.defineProperty(exports, 'withApiErrorHandling', {
|
|
81
|
+
enumerable: true,
|
|
82
|
+
get: function () {
|
|
83
|
+
return withApiErrorHandling;
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
//# sourceMappingURL=api-utils-B-9vnzoA.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-utils-B-9vnzoA.cjs","names":["context: ServerContext","opts: { regionUrl?: string }","UserInputError","SentryApiService","error: unknown","params?: Record<string, unknown>","ApiError","paramsList: string[]","fn: () => Promise<T>"],"sources":["../src/tools/utils/api-utils.ts"],"sourcesContent":["import { SentryApiService, ApiError } from \"../../api-client/index\";\nimport { UserInputError } from \"../../errors\";\nimport type { ServerContext } from \"../../types\";\n\n/**\n * Create a Sentry API service from server context with optional region override\n * @param context - Server context containing host and access token\n * @param opts - Options object containing optional regionUrl override\n * @returns Configured SentryApiService instance (always uses HTTPS)\n * @throws {UserInputError} When regionUrl is provided but invalid\n */\nexport function apiServiceFromContext(\n context: ServerContext,\n opts: { regionUrl?: string } = {},\n) {\n let host = context.sentryHost;\n\n if (opts.regionUrl?.trim()) {\n try {\n const parsedUrl = new URL(opts.regionUrl);\n\n // Validate that the URL has a proper protocol\n if (![\"http:\", \"https:\"].includes(parsedUrl.protocol)) {\n throw new UserInputError(\n `Invalid regionUrl provided: ${opts.regionUrl}. Must include protocol (http:// or https://).`,\n );\n }\n\n // Validate that the host is not just the protocol name\n if (parsedUrl.host === \"https\" || parsedUrl.host === \"http\") {\n throw new UserInputError(\n `Invalid regionUrl provided: ${opts.regionUrl}. The host cannot be just a protocol name.`,\n );\n }\n\n host = parsedUrl.host;\n } catch (error) {\n if (error instanceof UserInputError) {\n throw error;\n }\n throw new UserInputError(\n `Invalid regionUrl provided: ${opts.regionUrl}. Must be a valid URL.`,\n );\n }\n }\n\n return new SentryApiService({\n host,\n accessToken: context.accessToken,\n });\n}\n\n/**\n * Maps API errors to user-friendly errors based on context\n * @param error - The error to handle\n * @param params - The parameters that were used in the API call\n * @returns Never - always throws an error\n * @throws {UserInputError} For errors that are clearly user input issues\n * @throws {Error} For other errors\n */\nexport function handleApiError(\n error: unknown,\n params?: Record<string, unknown>,\n): never {\n if (error instanceof ApiError && error.status === 404) {\n // Build a list of all provided parameters\n const paramsList: string[] = [];\n if (params) {\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\n if (paramsList.length > 0) {\n throw new UserInputError(\n `Resource not found. Please verify these parameters are correct:\\n${paramsList.map((p) => ` - ${p}`).join(\"\\n\")}`,\n );\n }\n\n // Fallback to generic message if no params provided\n throw new UserInputError(\n `Resource not found (404). Please verify that all provided identifiers are correct and you have access to the requested resources.`,\n );\n }\n\n // For other API errors, check if they're likely user input issues\n if (error instanceof ApiError) {\n // 400 Bad Request often indicates invalid parameters\n if (error.status === 400) {\n throw new UserInputError(`Invalid request: ${error.message}`);\n }\n\n // 403 Forbidden might be a permissions issue but could also be wrong org/project\n if (error.status === 403) {\n throw new UserInputError(\n `Access denied: ${error.message}. Please verify you have access to this resource.`,\n );\n }\n }\n\n // Re-throw any other errors as-is\n throw error;\n}\n\n/**\n * Wraps an async API call with automatic error handling\n * @param fn - The async function to execute\n * @param params - The parameters that were used in the API call\n * @returns The result of the function\n * @throws {UserInputError} For user input errors\n * @throws {Error} For other errors\n */\nexport async function withApiErrorHandling<T>(\n fn: () => Promise<T>,\n params?: Record<string, unknown>,\n): Promise<T> {\n try {\n return await fn();\n } catch (error) {\n handleApiError(error, params);\n }\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,sBACdA,SACAC,OAA+B,CAAE,GACjC;CACA,IAAI,OAAO,QAAQ;AAEnB,KAAI,KAAK,WAAW,MAAM,CACxB,KAAI;EACF,MAAM,YAAY,IAAI,IAAI,KAAK;AAG/B,OAAK,CAAC,SAAS,QAAS,EAAC,SAAS,UAAU,SAAS,CACnD,OAAM,IAAIC,+BACP,8BAA8B,KAAK,UAAU;AAKlD,MAAI,UAAU,SAAS,WAAW,UAAU,SAAS,OACnD,OAAM,IAAIA,+BACP,8BAA8B,KAAK,UAAU;AAIlD,SAAO,UAAU;CAClB,SAAQ,OAAO;AACd,MAAI,iBAAiBA,8BACnB,OAAM;AAER,QAAM,IAAIA,+BACP,8BAA8B,KAAK,UAAU;CAEjD;AAGH,QAAO,IAAIC,gCAAiB;EAC1B;EACA,aAAa,QAAQ;CACtB;AACF;;;;;;;;;AAUD,SAAgB,eACdC,OACAC,QACO;AACP,KAAI,iBAAiBC,2BAAY,MAAM,WAAW,KAAK;EAErD,MAAMC,aAAuB,CAAE;AAC/B,MAAI,QACF;QAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,OAAO,CAC/C,KAAI,oBAAuB,UAAU,QAAQ,UAAU,GACrD,YAAW,QAAQ,IAAI,KAAK,MAAM,GAAG;EAExC;AAGH,MAAI,WAAW,SAAS,EACtB,OAAM,IAAIL,+BACP,mEAAmE,WAAW,IAAI,CAAC,OAAO,MAAM,IAAI,CAAC,KAAK,KAAK;AAKpH,QAAM,IAAIA,+BACP;CAEJ;AAGD,KAAI,iBAAiBI,yBAAU;AAE7B,MAAI,MAAM,WAAW,IACnB,OAAM,IAAIJ,+BAAgB,mBAAmB,MAAM;AAIrD,MAAI,MAAM,WAAW,IACnB,OAAM,IAAIA,+BACP,iBAAiB,MAAM,QAAQ;CAGrC;AAGD,OAAM;AACP;;;;;;;;;AAUD,eAAsB,qBACpBM,IACAH,QACY;AACZ,KAAI;AACF,SAAO,MAAM,IAAI;CAClB,SAAQ,OAAO;AACd,iBAAe,OAAO,OAAO;CAC9B;AACF"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { UserInputError } from "./errors-D_R568zP.js";
|
|
2
|
+
import { ApiError, SentryApiService } from "./client-pyNUFaLN.js";
|
|
3
|
+
|
|
4
|
+
//#region src/tools/utils/api-utils.ts
|
|
5
|
+
/**
|
|
6
|
+
* Create a Sentry API service from server context with optional region override
|
|
7
|
+
* @param context - Server context containing host and access token
|
|
8
|
+
* @param opts - Options object containing optional regionUrl override
|
|
9
|
+
* @returns Configured SentryApiService instance (always uses HTTPS)
|
|
10
|
+
* @throws {UserInputError} When regionUrl is provided but invalid
|
|
11
|
+
*/
|
|
12
|
+
function apiServiceFromContext(context, opts = {}) {
|
|
13
|
+
let host = context.sentryHost;
|
|
14
|
+
if (opts.regionUrl?.trim()) try {
|
|
15
|
+
const parsedUrl = new URL(opts.regionUrl);
|
|
16
|
+
if (!["http:", "https:"].includes(parsedUrl.protocol)) throw new UserInputError(`Invalid regionUrl provided: ${opts.regionUrl}. Must include protocol (http:// or https://).`);
|
|
17
|
+
if (parsedUrl.host === "https" || parsedUrl.host === "http") throw new UserInputError(`Invalid regionUrl provided: ${opts.regionUrl}. The host cannot be just a protocol name.`);
|
|
18
|
+
host = parsedUrl.host;
|
|
19
|
+
} catch (error) {
|
|
20
|
+
if (error instanceof UserInputError) throw error;
|
|
21
|
+
throw new UserInputError(`Invalid regionUrl provided: ${opts.regionUrl}. Must be a valid URL.`);
|
|
22
|
+
}
|
|
23
|
+
return new SentryApiService({
|
|
24
|
+
host,
|
|
25
|
+
accessToken: context.accessToken
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Maps API errors to user-friendly errors based on context
|
|
30
|
+
* @param error - The error to handle
|
|
31
|
+
* @param params - The parameters that were used in the API call
|
|
32
|
+
* @returns Never - always throws an error
|
|
33
|
+
* @throws {UserInputError} For errors that are clearly user input issues
|
|
34
|
+
* @throws {Error} For other errors
|
|
35
|
+
*/
|
|
36
|
+
function handleApiError(error, params) {
|
|
37
|
+
if (error instanceof ApiError && error.status === 404) {
|
|
38
|
+
const paramsList = [];
|
|
39
|
+
if (params) {
|
|
40
|
+
for (const [key, value] of Object.entries(params)) if (value !== void 0 && value !== null && value !== "") paramsList.push(`${key}: '${value}'`);
|
|
41
|
+
}
|
|
42
|
+
if (paramsList.length > 0) throw new UserInputError(`Resource not found. Please verify these parameters are correct:\n${paramsList.map((p) => ` - ${p}`).join("\n")}`);
|
|
43
|
+
throw new UserInputError(`Resource not found (404). Please verify that all provided identifiers are correct and you have access to the requested resources.`);
|
|
44
|
+
}
|
|
45
|
+
if (error instanceof ApiError) {
|
|
46
|
+
if (error.status === 400) throw new UserInputError(`Invalid request: ${error.message}`);
|
|
47
|
+
if (error.status === 403) throw new UserInputError(`Access denied: ${error.message}. Please verify you have access to this resource.`);
|
|
48
|
+
}
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Wraps an async API call with automatic error handling
|
|
53
|
+
* @param fn - The async function to execute
|
|
54
|
+
* @param params - The parameters that were used in the API call
|
|
55
|
+
* @returns The result of the function
|
|
56
|
+
* @throws {UserInputError} For user input errors
|
|
57
|
+
* @throws {Error} For other errors
|
|
58
|
+
*/
|
|
59
|
+
async function withApiErrorHandling(fn, params) {
|
|
60
|
+
try {
|
|
61
|
+
return await fn();
|
|
62
|
+
} catch (error) {
|
|
63
|
+
handleApiError(error, params);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//#endregion
|
|
68
|
+
export { apiServiceFromContext, handleApiError, withApiErrorHandling };
|
|
69
|
+
//# sourceMappingURL=api-utils-CHRiLf2Y.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-utils-CHRiLf2Y.js","names":["context: ServerContext","opts: { regionUrl?: string }","error: unknown","params?: Record<string, unknown>","paramsList: string[]","fn: () => Promise<T>"],"sources":["../src/tools/utils/api-utils.ts"],"sourcesContent":["import { SentryApiService, ApiError } from \"../../api-client/index\";\nimport { UserInputError } from \"../../errors\";\nimport type { ServerContext } from \"../../types\";\n\n/**\n * Create a Sentry API service from server context with optional region override\n * @param context - Server context containing host and access token\n * @param opts - Options object containing optional regionUrl override\n * @returns Configured SentryApiService instance (always uses HTTPS)\n * @throws {UserInputError} When regionUrl is provided but invalid\n */\nexport function apiServiceFromContext(\n context: ServerContext,\n opts: { regionUrl?: string } = {},\n) {\n let host = context.sentryHost;\n\n if (opts.regionUrl?.trim()) {\n try {\n const parsedUrl = new URL(opts.regionUrl);\n\n // Validate that the URL has a proper protocol\n if (![\"http:\", \"https:\"].includes(parsedUrl.protocol)) {\n throw new UserInputError(\n `Invalid regionUrl provided: ${opts.regionUrl}. Must include protocol (http:// or https://).`,\n );\n }\n\n // Validate that the host is not just the protocol name\n if (parsedUrl.host === \"https\" || parsedUrl.host === \"http\") {\n throw new UserInputError(\n `Invalid regionUrl provided: ${opts.regionUrl}. The host cannot be just a protocol name.`,\n );\n }\n\n host = parsedUrl.host;\n } catch (error) {\n if (error instanceof UserInputError) {\n throw error;\n }\n throw new UserInputError(\n `Invalid regionUrl provided: ${opts.regionUrl}. Must be a valid URL.`,\n );\n }\n }\n\n return new SentryApiService({\n host,\n accessToken: context.accessToken,\n });\n}\n\n/**\n * Maps API errors to user-friendly errors based on context\n * @param error - The error to handle\n * @param params - The parameters that were used in the API call\n * @returns Never - always throws an error\n * @throws {UserInputError} For errors that are clearly user input issues\n * @throws {Error} For other errors\n */\nexport function handleApiError(\n error: unknown,\n params?: Record<string, unknown>,\n): never {\n if (error instanceof ApiError && error.status === 404) {\n // Build a list of all provided parameters\n const paramsList: string[] = [];\n if (params) {\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\n if (paramsList.length > 0) {\n throw new UserInputError(\n `Resource not found. Please verify these parameters are correct:\\n${paramsList.map((p) => ` - ${p}`).join(\"\\n\")}`,\n );\n }\n\n // Fallback to generic message if no params provided\n throw new UserInputError(\n `Resource not found (404). Please verify that all provided identifiers are correct and you have access to the requested resources.`,\n );\n }\n\n // For other API errors, check if they're likely user input issues\n if (error instanceof ApiError) {\n // 400 Bad Request often indicates invalid parameters\n if (error.status === 400) {\n throw new UserInputError(`Invalid request: ${error.message}`);\n }\n\n // 403 Forbidden might be a permissions issue but could also be wrong org/project\n if (error.status === 403) {\n throw new UserInputError(\n `Access denied: ${error.message}. Please verify you have access to this resource.`,\n );\n }\n }\n\n // Re-throw any other errors as-is\n throw error;\n}\n\n/**\n * Wraps an async API call with automatic error handling\n * @param fn - The async function to execute\n * @param params - The parameters that were used in the API call\n * @returns The result of the function\n * @throws {UserInputError} For user input errors\n * @throws {Error} For other errors\n */\nexport async function withApiErrorHandling<T>(\n fn: () => Promise<T>,\n params?: Record<string, unknown>,\n): Promise<T> {\n try {\n return await fn();\n } catch (error) {\n handleApiError(error, params);\n }\n}\n"],"mappings":";;;;;;;;;;;AAWA,SAAgB,sBACdA,SACAC,OAA+B,CAAE,GACjC;CACA,IAAI,OAAO,QAAQ;AAEnB,KAAI,KAAK,WAAW,MAAM,CACxB,KAAI;EACF,MAAM,YAAY,IAAI,IAAI,KAAK;AAG/B,OAAK,CAAC,SAAS,QAAS,EAAC,SAAS,UAAU,SAAS,CACnD,OAAM,IAAI,gBACP,8BAA8B,KAAK,UAAU;AAKlD,MAAI,UAAU,SAAS,WAAW,UAAU,SAAS,OACnD,OAAM,IAAI,gBACP,8BAA8B,KAAK,UAAU;AAIlD,SAAO,UAAU;CAClB,SAAQ,OAAO;AACd,MAAI,iBAAiB,eACnB,OAAM;AAER,QAAM,IAAI,gBACP,8BAA8B,KAAK,UAAU;CAEjD;AAGH,QAAO,IAAI,iBAAiB;EAC1B;EACA,aAAa,QAAQ;CACtB;AACF;;;;;;;;;AAUD,SAAgB,eACdC,OACAC,QACO;AACP,KAAI,iBAAiB,YAAY,MAAM,WAAW,KAAK;EAErD,MAAMC,aAAuB,CAAE;AAC/B,MAAI,QACF;QAAK,MAAM,CAAC,KAAK,MAAM,IAAI,OAAO,QAAQ,OAAO,CAC/C,KAAI,oBAAuB,UAAU,QAAQ,UAAU,GACrD,YAAW,QAAQ,IAAI,KAAK,MAAM,GAAG;EAExC;AAGH,MAAI,WAAW,SAAS,EACtB,OAAM,IAAI,gBACP,mEAAmE,WAAW,IAAI,CAAC,OAAO,MAAM,IAAI,CAAC,KAAK,KAAK;AAKpH,QAAM,IAAI,gBACP;CAEJ;AAGD,KAAI,iBAAiB,UAAU;AAE7B,MAAI,MAAM,WAAW,IACnB,OAAM,IAAI,gBAAgB,mBAAmB,MAAM;AAIrD,MAAI,MAAM,WAAW,IACnB,OAAM,IAAI,gBACP,iBAAiB,MAAM,QAAQ;CAGrC;AAGD,OAAM;AACP;;;;;;;;;AAUD,eAAsB,qBACpBC,IACAF,QACY;AACZ,KAAI;AACF,SAAO,MAAM,IAAI;CAClB,SAAQ,OAAO;AACd,iBAAe,OAAO,OAAO;CAC9B;AACF"}
|