@sentry/mcp-server 0.15.0 → 0.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-COgY789I.js +225 -0
- package/dist/agent-COgY789I.js.map +1 -0
- package/dist/agent-Cody_f0d.cjs +59 -0
- package/dist/agent-Cody_f0d.cjs.map +1 -0
- package/dist/agent-DZRRChrO.js +53 -0
- package/dist/agent-DZRRChrO.js.map +1 -0
- package/dist/agent-DpCCnhh5.cjs +231 -0
- package/dist/agent-DpCCnhh5.cjs.map +1 -0
- package/dist/agent-tools/discover-dataset-fields.cjs +6 -0
- package/dist/agent-tools/discover-dataset-fields.d.cts +59 -0
- package/dist/agent-tools/discover-dataset-fields.d.cts.map +1 -0
- package/dist/agent-tools/discover-dataset-fields.d.ts +59 -0
- package/dist/agent-tools/discover-dataset-fields.d.ts.map +1 -0
- package/dist/agent-tools/discover-dataset-fields.js +3 -0
- package/dist/agent-tools/lookup-otel-semantics.cjs +5 -0
- package/dist/agent-tools/lookup-otel-semantics.d.cts +38 -0
- package/dist/agent-tools/lookup-otel-semantics.d.cts.map +1 -0
- package/dist/agent-tools/lookup-otel-semantics.d.ts +38 -0
- package/dist/agent-tools/lookup-otel-semantics.d.ts.map +1 -0
- package/dist/agent-tools/lookup-otel-semantics.js +4 -0
- package/dist/agent-tools/whoami.cjs +4 -0
- package/dist/agent-tools/whoami.d.cts +28 -0
- package/dist/agent-tools/whoami.d.cts.map +1 -0
- package/dist/agent-tools/whoami.d.ts +28 -0
- package/dist/agent-tools/whoami.d.ts.map +1 -0
- package/dist/agent-tools/whoami.js +3 -0
- package/dist/{analyze-issue-with-seer-CoqsTklL.js → analyze-issue-with-seer-DcSwrWrs.js} +51 -11
- package/dist/analyze-issue-with-seer-DcSwrWrs.js.map +1 -0
- package/dist/{analyze-issue-with-seer-BkVrrh28.cjs → analyze-issue-with-seer-Dw9iqvSk.cjs} +51 -11
- package/dist/analyze-issue-with-seer-Dw9iqvSk.cjs.map +1 -0
- package/dist/api-client/client.cjs +4 -2
- package/dist/api-client/client.d.cts +3 -3
- package/dist/api-client/client.d.ts +3 -3
- package/dist/api-client/client.js +4 -2
- package/dist/api-client/index.cjs +6 -4
- package/dist/api-client/index.d.cts +3 -3
- package/dist/api-client/index.d.ts +4 -4
- package/dist/api-client/index.js +6 -4
- package/dist/api-client/schema.cjs +1 -1
- package/dist/api-client/schema.d.cts +1 -1
- package/dist/api-client/schema.d.ts +1 -1
- package/dist/api-client/schema.js +1 -1
- package/dist/api-client/types.cjs +1 -1
- package/dist/api-client/types.d.cts +2 -2
- package/dist/api-client/types.d.ts +2 -2
- package/dist/api-client/types.js +1 -1
- package/dist/api-utils-BlUSO8xh.js +68 -0
- package/dist/api-utils-BlUSO8xh.js.map +1 -0
- package/dist/api-utils-DFWUfQ83.cjs +85 -0
- package/dist/api-utils-DFWUfQ83.cjs.map +1 -0
- package/dist/{client-Dkw5iYu3.cjs → client-CPrEfAwa.cjs} +403 -58
- package/dist/client-CPrEfAwa.cjs.map +1 -0
- package/dist/{client-CQ9Xe1aN.d.cts → client-C_dDreKj.d.ts} +198 -11
- package/dist/client-C_dDreKj.d.ts.map +1 -0
- package/dist/{client-VCJp6Kcu.d.ts → client-CgS3tjJG.d.cts} +198 -11
- package/dist/client-CgS3tjJG.d.cts.map +1 -0
- package/dist/{client-DOYWNvVM.js → client-MaVV1gVC.js} +403 -58
- package/dist/client-MaVV1gVC.js.map +1 -0
- package/dist/config-BUmDxVLS.js +52 -0
- package/dist/config-BUmDxVLS.js.map +1 -0
- package/dist/config-BvtWiL3I.js +449 -0
- package/dist/config-BvtWiL3I.js.map +1 -0
- package/dist/config-CD-5FpOO.cjs +479 -0
- package/dist/config-CD-5FpOO.cjs.map +1 -0
- package/dist/config-FWsgDbm7.cjs +58 -0
- package/dist/config-FWsgDbm7.cjs.map +1 -0
- package/dist/{create-dsn-Dz8nyTFw.cjs → create-dsn-C6IPwoVO.cjs} +12 -10
- package/dist/create-dsn-C6IPwoVO.cjs.map +1 -0
- package/dist/{create-dsn-D530I7Lr.js → create-dsn-QDLdwhDO.js} +12 -10
- package/dist/create-dsn-QDLdwhDO.js.map +1 -0
- package/dist/{create-project-K1od5Rhx.js → create-project-Cax3fWey.js} +14 -11
- package/dist/create-project-Cax3fWey.js.map +1 -0
- package/dist/{create-project-BxzRiryg.cjs → create-project-DdSF58TR.cjs} +14 -11
- package/dist/create-project-DdSF58TR.cjs.map +1 -0
- package/dist/{create-team-CJhrccc1.cjs → create-team-CXaLcylp.cjs} +14 -5
- package/dist/{create-team-CJhrccc1.cjs.map → create-team-CXaLcylp.cjs.map} +1 -1
- package/dist/{create-team-zHz00C6Q.js → create-team-nm06goO5.js} +14 -5
- package/dist/{create-team-zHz00C6Q.js.map → create-team-nm06goO5.js.map} +1 -1
- package/dist/discover-dataset-fields-BEnyqPSq.js +156 -0
- package/dist/discover-dataset-fields-BEnyqPSq.js.map +1 -0
- package/dist/discover-dataset-fields-Cl7HpVkm.cjs +180 -0
- package/dist/discover-dataset-fields-Cl7HpVkm.cjs.map +1 -0
- 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-CTLoW1R8.d.cts +33 -0
- package/dist/fetch-utils-CTLoW1R8.d.cts.map +1 -0
- package/dist/fetch-utils-C_Xj921x.js +52 -0
- package/dist/fetch-utils-C_Xj921x.js.map +1 -0
- package/dist/fetch-utils-DkcYwqBo.cjs +64 -0
- package/dist/fetch-utils-DkcYwqBo.cjs.map +1 -0
- package/dist/fetch-utils-JDZw4XaU.d.ts +33 -0
- package/dist/fetch-utils-JDZw4XaU.d.ts.map +1 -0
- package/dist/{find-dsns-BoEP0N7B.js → find-dsns-C3G5aBm1.js} +3 -3
- package/dist/{find-dsns-BoEP0N7B.js.map → find-dsns-C3G5aBm1.js.map} +1 -1
- package/dist/{find-dsns-CK59RaUJ.cjs → find-dsns-vQolGM7e.cjs} +3 -3
- package/dist/{find-dsns-CK59RaUJ.cjs.map → find-dsns-vQolGM7e.cjs.map} +1 -1
- package/dist/{find-organizations-BrdMfZRO.cjs → find-organizations-BDtHkcFV.cjs} +3 -3
- package/dist/find-organizations-BDtHkcFV.cjs.map +1 -0
- package/dist/{find-organizations-ojXwWWzk.js → find-organizations-Cs1GvZtJ.js} +3 -3
- package/dist/find-organizations-Cs1GvZtJ.js.map +1 -0
- package/dist/{find-projects-fcLG4KpT.js → find-projects-B0NdOjBO.js} +4 -4
- package/dist/{find-projects-fcLG4KpT.js.map → find-projects-B0NdOjBO.js.map} +1 -1
- package/dist/{find-projects-BZWhlYJh.cjs → find-projects-xM2L0U1W.cjs} +4 -4
- package/dist/{find-projects-BZWhlYJh.cjs.map → find-projects-xM2L0U1W.cjs.map} +1 -1
- package/dist/{find-releases-CZCVEOHZ.cjs → find-releases-BBTYr5Bx.cjs} +3 -3
- package/dist/{find-releases-CZCVEOHZ.cjs.map → find-releases-BBTYr5Bx.cjs.map} +1 -1
- package/dist/{find-releases-BUozr0Z-.js → find-releases-BO2OF_uR.js} +3 -3
- package/dist/{find-releases-BUozr0Z-.js.map → find-releases-BO2OF_uR.js.map} +1 -1
- package/dist/{find-teams-CnU5x9rQ.cjs → find-teams-B237Aq8U.cjs} +4 -4
- package/dist/{find-teams-CnU5x9rQ.cjs.map → find-teams-B237Aq8U.cjs.map} +1 -1
- package/dist/{find-teams-BZ118EIK.js → find-teams-CqUwp0EI.js} +4 -4
- package/dist/{find-teams-BZ118EIK.js.map → find-teams-CqUwp0EI.js.map} +1 -1
- package/dist/formatters-B3ONbRhI.js +79 -0
- package/dist/formatters-B3ONbRhI.js.map +1 -0
- package/dist/formatters-CfeBjhXZ.cjs +235 -0
- package/dist/formatters-CfeBjhXZ.cjs.map +1 -0
- package/dist/formatters-DSYXBiQx.js +217 -0
- package/dist/formatters-DSYXBiQx.js.map +1 -0
- package/dist/formatters-DbqofIoy.cjs +85 -0
- package/dist/formatters-DbqofIoy.cjs.map +1 -0
- package/dist/{formatting-CcTK2X8V.d.cts → formatting-BxyhA4G3.d.cts} +4 -4
- package/dist/formatting-BxyhA4G3.d.cts.map +1 -0
- package/dist/{formatting-D0Aki7rK.cjs → formatting-C180PVwd.cjs} +3 -3
- package/dist/formatting-C180PVwd.cjs.map +1 -0
- package/dist/{formatting-vtXxusbn.d.ts → formatting-C80LN9iK.d.ts} +4 -4
- package/dist/formatting-C80LN9iK.d.ts.map +1 -0
- package/dist/{formatting-Bvyded57.js → formatting-DIvCVunN.js} +3 -3
- package/dist/formatting-DIvCVunN.js.map +1 -0
- package/dist/{formatting-utils-DgOyTl-m.js → formatting-utils-C3sej5ER.js} +1 -1
- package/dist/{formatting-utils-DgOyTl-m.js.map → formatting-utils-C3sej5ER.js.map} +1 -1
- package/dist/{formatting-utils-m9R5bsRU.cjs → formatting-utils-DDz14xeB.cjs} +1 -1
- package/dist/{formatting-utils-m9R5bsRU.cjs.map → formatting-utils-DDz14xeB.cjs.map} +1 -1
- package/dist/{get-doc-DaTCenOE.cjs → get-doc-BfMg0GIa.cjs} +4 -4
- package/dist/{get-doc-DaTCenOE.cjs.map → get-doc-BfMg0GIa.cjs.map} +1 -1
- package/dist/{get-doc-YTiQznr1.js → get-doc-DyqJe6TP.js} +4 -4
- package/dist/{get-doc-YTiQznr1.js.map → get-doc-DyqJe6TP.js.map} +1 -1
- package/dist/{get-event-attachment-DVCPpUMj.js → get-event-attachment-B-ElqztF.js} +3 -3
- package/dist/{get-event-attachment-DVCPpUMj.js.map → get-event-attachment-B-ElqztF.js.map} +1 -1
- package/dist/{get-event-attachment-C-ig2-3F.cjs → get-event-attachment-o0oH43Tv.cjs} +3 -3
- package/dist/{get-event-attachment-C-ig2-3F.cjs.map → get-event-attachment-o0oH43Tv.cjs.map} +1 -1
- package/dist/{get-issue-details-lBrYR9yx.cjs → get-issue-details-CP_RyCpt.cjs} +27 -20
- package/dist/get-issue-details-CP_RyCpt.cjs.map +1 -0
- package/dist/{get-issue-details-Dcmzxknx.js → get-issue-details-CzroF7HR.js} +27 -20
- package/dist/get-issue-details-CzroF7HR.js.map +1 -0
- package/dist/handler-BGhr9FJM.d.cts +15 -0
- package/dist/handler-BGhr9FJM.d.cts.map +1 -0
- package/dist/handler-BH_OLIbD.cjs +152 -0
- package/dist/handler-BH_OLIbD.cjs.map +1 -0
- package/dist/handler-BPPTAi7I.d.ts +15 -0
- package/dist/handler-BPPTAi7I.d.ts.map +1 -0
- package/dist/handler-BZ3hKPb8.d.cts +15 -0
- package/dist/handler-BZ3hKPb8.d.cts.map +1 -0
- package/dist/handler-O9fYgC9a.cjs +114 -0
- package/dist/handler-O9fYgC9a.cjs.map +1 -0
- package/dist/handler-aE_8mEm7.js +146 -0
- package/dist/handler-aE_8mEm7.js.map +1 -0
- package/dist/handler-cUB6XcUV.d.ts +15 -0
- package/dist/handler-cUB6XcUV.d.ts.map +1 -0
- package/dist/handler-ykkULTZ-.js +108 -0
- package/dist/handler-ykkULTZ-.js.map +1 -0
- package/dist/index.cjs +54 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +54 -44
- package/dist/index.js.map +1 -1
- 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 +5 -5
- package/dist/internal/formatting.js +2 -2
- package/dist/internal/issue-helpers.cjs +2 -1
- package/dist/internal/issue-helpers.d.ts +1 -1
- package/dist/internal/issue-helpers.js +2 -1
- package/dist/internal/test-fixtures.d.cts +164 -164
- package/dist/internal/test-fixtures.d.cts.map +1 -1
- package/dist/internal/test-fixtures.d.ts +38 -38
- package/dist/internal/test-fixtures.d.ts.map +1 -1
- package/dist/{issue-helpers-CqqYnwYE.js → issue-helpers-CRx45FYG.js} +15 -19
- package/dist/issue-helpers-CRx45FYG.js.map +1 -0
- package/dist/issue-helpers-Cz01Ipvl.d.cts.map +1 -1
- package/dist/{issue-helpers-BJffpNoO.d.ts → issue-helpers-D1_Uqr-F.d.ts} +1 -1
- package/dist/issue-helpers-D1_Uqr-F.d.ts.map +1 -0
- package/dist/{issue-helpers-DyAIO0w6.cjs → issue-helpers-s5fKLwJZ.cjs} +14 -19
- package/dist/issue-helpers-s5fKLwJZ.cjs.map +1 -0
- package/dist/{logging-CX2buXiG.cjs → logging-BpL53bY6.cjs} +1 -1
- package/dist/{logging-CX2buXiG.cjs.map → logging-BpL53bY6.cjs.map} +1 -1
- package/dist/{logging-DzxYBMrn.js → logging-tGU_SYcA.js} +1 -1
- package/dist/{logging-DzxYBMrn.js.map → logging-tGU_SYcA.js.map} +1 -1
- package/dist/logging.cjs +1 -1
- package/dist/logging.js +1 -1
- package/dist/lookup-otel-semantics-BbriXZAx.cjs +5088 -0
- package/dist/lookup-otel-semantics-BbriXZAx.cjs.map +1 -0
- package/dist/lookup-otel-semantics-Dt667kdR.js +5076 -0
- package/dist/lookup-otel-semantics-Dt667kdR.js.map +1 -0
- package/dist/{promptDefinitions-C29BWGYg.cjs → promptDefinitions-5V4-M69A.cjs} +2 -2
- package/dist/{promptDefinitions-C29BWGYg.cjs.map → promptDefinitions-5V4-M69A.cjs.map} +1 -1
- package/dist/{promptDefinitions-D3GTBGLr.d.ts → promptDefinitions-DehpwJfn.d.ts} +1 -1
- package/dist/promptDefinitions-DehpwJfn.d.ts.map +1 -0
- package/dist/{promptDefinitions-CSKE8T0a.js → promptDefinitions-DyshsF51.js} +2 -2
- package/dist/{promptDefinitions-CSKE8T0a.js.map → promptDefinitions-DyshsF51.js.map} +1 -1
- package/dist/promptDefinitions.cjs +2 -2
- package/dist/promptDefinitions.d.ts +1 -1
- package/dist/promptDefinitions.js +2 -2
- package/dist/{prompts-Df3i1XSB.cjs → prompts-BTtNbKQR.cjs} +7 -5
- package/dist/prompts-BTtNbKQR.cjs.map +1 -0
- package/dist/{prompts-C8Y9w5c4.js → prompts-CYcvIxWR.js} +7 -5
- package/dist/prompts-CYcvIxWR.js.map +1 -0
- package/dist/prompts.cjs +2 -2
- package/dist/prompts.d.cts +1 -1
- package/dist/prompts.d.cts.map +1 -1
- package/dist/prompts.d.ts +2 -2
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +2 -2
- package/dist/resources-CSxBC9gs.js +60 -0
- package/dist/resources-CSxBC9gs.js.map +1 -0
- package/dist/resources-TCvijqOA.cjs +72 -0
- package/dist/resources-TCvijqOA.cjs.map +1 -0
- package/dist/resources.cjs +2 -2
- package/dist/resources.d.cts.map +1 -1
- package/dist/resources.d.ts.map +1 -1
- package/dist/resources.js +2 -2
- package/dist/{schema-3NeMWRAm.d.cts → schema-BlkWypl3.d.ts} +155 -155
- package/dist/schema-BlkWypl3.d.ts.map +1 -0
- package/dist/{schema-DtsnsxMl.js → schema-Bv2fvxgy.js} +2 -2
- package/dist/{schema-DtsnsxMl.js.map → schema-Bv2fvxgy.js.map} +1 -1
- package/dist/{schema-B_cMyyJJ.cjs → schema-C0LznFvu.cjs} +4 -4
- package/dist/schema-C0LznFvu.cjs.map +1 -0
- package/dist/{schema-WDk5Yqww.js → schema-CcFmBoEf.js} +4 -4
- package/dist/schema-CcFmBoEf.js.map +1 -0
- package/dist/{schema-B3CzDGJk.d.ts → schema-CdDcpvrp.d.cts} +375 -375
- package/dist/schema-CdDcpvrp.d.cts.map +1 -0
- package/dist/{schema-BpJVmev8.cjs → schema-DPL_hZXP.cjs} +2 -2
- package/dist/{schema-BpJVmev8.cjs.map → schema-DPL_hZXP.cjs.map} +1 -1
- package/dist/schema.cjs +1 -1
- package/dist/schema.js +1 -1
- package/dist/{search-docs-D5Foht_0.cjs → search-docs-CjIZDaD1.cjs} +4 -4
- package/dist/{search-docs-D5Foht_0.cjs.map → search-docs-CjIZDaD1.cjs.map} +1 -1
- package/dist/{search-docs-BLbB_GV2.js → search-docs-ss09Dt0F.js} +4 -4
- package/dist/{search-docs-BLbB_GV2.js.map → search-docs-ss09Dt0F.js.map} +1 -1
- package/dist/search-issues-BFgCvRYe.js +0 -0
- package/dist/search-issues-Biu64RkQ.cjs +0 -0
- package/dist/{seer-utils-CDm5J8ur.cjs → seer-utils-C7Kv0gr8.cjs} +15 -1
- package/dist/seer-utils-C7Kv0gr8.cjs.map +1 -0
- package/dist/{seer-utils-Cj9DXrow.js → seer-utils-NPHv8KYY.js} +4 -2
- package/dist/seer-utils-NPHv8KYY.js.map +1 -0
- package/dist/{server-BSRxzYFd.js → server-D78x_7Vz.js} +80 -26
- package/dist/server-D78x_7Vz.js.map +1 -0
- package/dist/{server-Dgkqz8bA.cjs → server-DYFiTMLB.cjs} +80 -26
- package/dist/server-DYFiTMLB.cjs.map +1 -0
- package/dist/server.cjs +52 -40
- package/dist/server.d.cts +4 -2
- package/dist/server.d.cts.map +1 -1
- package/dist/server.d.ts +5 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +52 -40
- package/dist/{stdio-BQAm0Liz.cjs → stdio-Be01KQkA.cjs} +3 -3
- package/dist/{stdio-BQAm0Liz.cjs.map → stdio-Be01KQkA.cjs.map} +1 -1
- package/dist/{stdio-BcihaDjO.js → stdio-CDb2NHHD.js} +3 -3
- package/dist/{stdio-BcihaDjO.js.map → stdio-CDb2NHHD.js.map} +1 -1
- package/dist/test-setup.cjs +371 -0
- package/dist/test-setup.cjs.map +1 -1
- package/dist/test-setup.js +371 -0
- package/dist/test-setup.js.map +1 -1
- package/dist/toolDefinitions.cjs +184 -0
- package/dist/toolDefinitions.cjs.map +1 -0
- package/dist/toolDefinitions.d.cts +13 -0
- package/dist/toolDefinitions.d.cts.map +1 -0
- package/dist/toolDefinitions.d.ts +8 -20
- package/dist/toolDefinitions.d.ts.map +1 -0
- package/dist/toolDefinitions.js +183 -1059
- package/dist/toolDefinitions.js.map +1 -0
- package/dist/tools/analyze-issue-with-seer.cjs +14 -12
- package/dist/tools/analyze-issue-with-seer.d.cts +2 -2
- package/dist/tools/analyze-issue-with-seer.d.ts +3 -3
- package/dist/tools/analyze-issue-with-seer.js +14 -12
- package/dist/tools/create-dsn.cjs +9 -8
- package/dist/tools/create-dsn.d.cts +2 -2
- package/dist/tools/create-dsn.d.ts +3 -3
- package/dist/tools/create-dsn.js +9 -8
- package/dist/tools/create-project.cjs +10 -9
- package/dist/tools/create-project.d.cts +2 -2
- package/dist/tools/create-project.d.ts +3 -3
- package/dist/tools/create-project.js +10 -9
- package/dist/tools/create-team.cjs +9 -8
- package/dist/tools/create-team.d.cts +2 -2
- package/dist/tools/create-team.d.ts +3 -3
- package/dist/tools/create-team.js +9 -8
- package/dist/tools/find-dsns.cjs +9 -8
- package/dist/tools/find-dsns.d.cts +2 -2
- package/dist/tools/find-dsns.d.ts +3 -3
- package/dist/tools/find-dsns.js +9 -8
- package/dist/tools/find-organizations.cjs +8 -7
- package/dist/tools/find-organizations.d.cts +2 -2
- package/dist/tools/find-organizations.d.ts +3 -3
- package/dist/tools/find-organizations.js +8 -7
- package/dist/tools/find-projects.cjs +9 -8
- package/dist/tools/find-projects.d.cts +2 -2
- package/dist/tools/find-projects.d.ts +3 -3
- package/dist/tools/find-projects.js +9 -8
- package/dist/tools/find-releases.cjs +9 -8
- package/dist/tools/find-releases.d.cts +2 -2
- package/dist/tools/find-releases.d.ts +3 -3
- package/dist/tools/find-releases.js +9 -8
- package/dist/tools/find-teams.cjs +9 -8
- package/dist/tools/find-teams.d.cts +2 -2
- package/dist/tools/find-teams.d.ts +3 -3
- package/dist/tools/find-teams.js +9 -8
- package/dist/tools/get-doc.cjs +9 -8
- package/dist/tools/get-doc.d.cts +2 -2
- package/dist/tools/get-doc.d.ts +3 -3
- package/dist/tools/get-doc.js +9 -8
- package/dist/tools/get-event-attachment.cjs +9 -8
- package/dist/tools/get-event-attachment.d.cts +2 -2
- package/dist/tools/get-event-attachment.d.ts +3 -3
- package/dist/tools/get-event-attachment.js +9 -8
- package/dist/tools/get-issue-details.cjs +13 -12
- package/dist/tools/get-issue-details.d.cts +2 -2
- package/dist/tools/get-issue-details.d.ts +3 -3
- package/dist/tools/get-issue-details.js +13 -12
- package/dist/tools/index.cjs +47 -36
- package/dist/tools/index.d.cts +74 -86
- package/dist/tools/index.d.cts.map +1 -1
- package/dist/tools/index.d.ts +15 -27
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +47 -36
- package/dist/tools/search-docs.cjs +10 -8
- package/dist/tools/search-docs.d.cts +2 -2
- package/dist/tools/search-docs.d.ts +3 -3
- package/dist/tools/search-docs.js +10 -8
- package/dist/tools/search-events/agent.cjs +8 -0
- package/dist/tools/search-events/agent.d.cts +43 -0
- package/dist/tools/search-events/agent.d.cts.map +1 -0
- package/dist/tools/search-events/agent.d.ts +43 -0
- package/dist/tools/search-events/agent.d.ts.map +1 -0
- package/dist/tools/search-events/agent.js +8 -0
- package/dist/tools/search-events/config.cjs +7 -0
- package/dist/tools/search-events/config.d.cts +131 -0
- package/dist/tools/search-events/config.d.cts.map +1 -0
- package/dist/tools/search-events/config.d.ts +131 -0
- package/dist/tools/search-events/config.d.ts.map +1 -0
- package/dist/tools/search-events/config.js +3 -0
- package/dist/tools/search-events/formatters.cjs +8 -0
- package/dist/tools/search-events/formatters.d.cts +32 -0
- package/dist/tools/search-events/formatters.d.cts.map +1 -0
- package/dist/tools/search-events/formatters.d.ts +32 -0
- package/dist/tools/search-events/formatters.d.ts.map +1 -0
- package/dist/tools/search-events/formatters.js +6 -0
- package/dist/tools/search-events/handler.cjs +20 -0
- package/dist/tools/search-events/handler.d.cts +5 -0
- package/dist/tools/search-events/handler.d.ts +5 -0
- package/dist/tools/search-events/handler.js +20 -0
- package/dist/tools/search-events/index.cjs +21 -0
- package/dist/tools/search-events/index.d.cts +5 -0
- package/dist/tools/search-events/index.d.ts +5 -0
- package/dist/tools/search-events/index.js +21 -0
- package/dist/tools/search-events/utils.cjs +9 -0
- package/dist/tools/search-events/utils.d.cts +6 -0
- package/dist/tools/search-events/utils.d.ts +6 -0
- package/dist/tools/search-events/utils.js +5 -0
- package/dist/tools/search-issues/agent.cjs +7 -0
- package/dist/tools/search-issues/agent.d.cts +33 -0
- package/dist/tools/search-issues/agent.d.cts.map +1 -0
- package/dist/tools/search-issues/agent.d.ts +33 -0
- package/dist/tools/search-issues/agent.d.ts.map +1 -0
- package/dist/tools/search-issues/agent.js +7 -0
- package/dist/tools/search-issues/config.cjs +3 -0
- package/dist/tools/search-issues/config.d.cts +9 -0
- package/dist/tools/search-issues/config.d.cts.map +1 -0
- package/dist/tools/search-issues/config.d.ts +9 -0
- package/dist/tools/search-issues/config.d.ts.map +1 -0
- package/dist/tools/search-issues/config.js +3 -0
- package/dist/tools/search-issues/formatters.cjs +4 -0
- package/dist/tools/search-issues/formatters.d.cts +15 -0
- package/dist/tools/search-issues/formatters.d.cts.map +1 -0
- package/dist/tools/search-issues/formatters.d.ts +15 -0
- package/dist/tools/search-issues/formatters.d.ts.map +1 -0
- package/dist/tools/search-issues/formatters.js +4 -0
- package/dist/tools/search-issues/handler.cjs +18 -0
- package/dist/tools/search-issues/handler.d.cts +5 -0
- package/dist/tools/search-issues/handler.d.ts +5 -0
- package/dist/tools/search-issues/handler.js +18 -0
- package/dist/tools/search-issues/index.cjs +19 -0
- package/dist/tools/search-issues/index.d.cts +5 -0
- package/dist/tools/search-issues/index.d.ts +5 -0
- package/dist/tools/search-issues/index.js +19 -0
- package/dist/tools/types.d.cts +2 -2
- package/dist/tools/types.d.ts +3 -3
- package/dist/tools/update-issue.cjs +14 -13
- package/dist/tools/update-issue.d.cts +2 -2
- package/dist/tools/update-issue.d.ts +3 -3
- package/dist/tools/update-issue.js +14 -13
- package/dist/tools/update-project.cjs +10 -9
- package/dist/tools/update-project.d.cts +2 -2
- package/dist/tools/update-project.d.ts +3 -3
- package/dist/tools/update-project.js +10 -9
- package/dist/tools/utils/api-utils.cjs +10 -7
- package/dist/tools/utils/api-utils.d.cts +23 -6
- package/dist/tools/utils/api-utils.d.cts.map +1 -1
- package/dist/tools/utils/api-utils.d.ts +25 -8
- package/dist/tools/utils/api-utils.d.ts.map +1 -1
- package/dist/tools/utils/api-utils.js +8 -7
- package/dist/tools/utils/defineTool.d.cts +2 -2
- package/dist/tools/utils/defineTool.d.ts +3 -3
- package/dist/tools/utils/fetch-utils.cjs +4 -3
- 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 +3 -3
- package/dist/tools/utils/formatting-utils.cjs +1 -1
- package/dist/tools/utils/formatting-utils.d.cts +3 -3
- package/dist/tools/utils/formatting-utils.d.ts +4 -4
- package/dist/tools/utils/formatting-utils.js +1 -1
- package/dist/tools/utils/issue-utils.cjs +5 -4
- package/dist/tools/utils/issue-utils.d.cts +4 -4
- package/dist/tools/utils/issue-utils.d.ts +6 -6
- package/dist/tools/utils/issue-utils.js +5 -4
- 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 +7 -5
- 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 +8 -7
- package/dist/tools/whoami.d.cts +2 -2
- package/dist/tools/whoami.d.ts +3 -3
- package/dist/tools/whoami.js +8 -7
- package/dist/tools-DvKm5uMs.js +44 -0
- package/dist/tools-DvKm5uMs.js.map +1 -0
- package/dist/tools-sQ2wM3Pi.cjs +49 -0
- package/dist/tools-sQ2wM3Pi.cjs.map +1 -0
- package/dist/transports/stdio.cjs +53 -42
- package/dist/transports/stdio.d.cts +1 -1
- package/dist/transports/stdio.d.ts +2 -2
- package/dist/transports/stdio.js +53 -42
- package/dist/types-6zHoEWAx.js +0 -0
- package/dist/{types-DpV1JAZj.d.ts → types-B-8S69No.d.ts} +2 -2
- package/dist/{types-DpV1JAZj.d.ts.map → types-B-8S69No.d.ts.map} +1 -1
- package/dist/{types-qB8a4WQT.d.ts → types-BOcoP3Na.d.ts} +2 -2
- package/dist/{types-qB8a4WQT.d.ts.map → types-BOcoP3Na.d.ts.map} +1 -1
- package/dist/{types-CUN-2OSS.d.cts → types-BV-G5sBp.d.cts} +4 -2
- package/dist/{types-CUN-2OSS.d.cts.map → types-BV-G5sBp.d.cts.map} +1 -1
- package/dist/{types-BoMP-Ro6.d.cts → types-BYtO24VE.d.cts} +2 -2
- package/dist/{types-BoMP-Ro6.d.cts.map → types-BYtO24VE.d.cts.map} +1 -1
- package/dist/{types-DkJtNDXU.d.ts → types-C1Fih0eQ.d.ts} +5 -3
- package/dist/{types-DkJtNDXU.d.ts.map → types-C1Fih0eQ.d.ts.map} +1 -1
- package/dist/types-DdloOYgD.cjs +0 -0
- package/dist/{types-D_mx318Q.d.cts → types-aOEJ0KgQ.d.cts} +2 -2
- package/dist/{types-D_mx318Q.d.cts.map → types-aOEJ0KgQ.d.cts.map} +1 -1
- package/dist/types.d.cts +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/{update-issue-DpkxxiNk.cjs → update-issue-D77PudUi.cjs} +20 -13
- package/dist/update-issue-D77PudUi.cjs.map +1 -0
- package/dist/{update-issue-DRTQvy6p.js → update-issue-ndy2PF5G.js} +20 -13
- package/dist/update-issue-ndy2PF5G.js.map +1 -0
- package/dist/{update-project-YLxt2ry2.js → update-project-Bxsi-BG_.js} +5 -5
- package/dist/{update-project-YLxt2ry2.js.map → update-project-Bxsi-BG_.js.map} +1 -1
- package/dist/{update-project-DLDDbcGY.cjs → update-project-DqECtbDA.cjs} +5 -5
- package/dist/{update-project-DLDDbcGY.cjs.map → update-project-DqECtbDA.cjs.map} +1 -1
- package/dist/url-utils-IqgSmI-B.js +152 -0
- package/dist/url-utils-IqgSmI-B.js.map +1 -0
- package/dist/url-utils-vJo2ER5v.cjs +206 -0
- package/dist/url-utils-vJo2ER5v.cjs.map +1 -0
- package/dist/utils/url-utils.cjs +6 -1
- package/dist/utils/url-utils.d.cts +43 -1
- package/dist/utils/url-utils.d.cts.map +1 -1
- package/dist/utils/url-utils.d.ts +43 -1
- package/dist/utils/url-utils.d.ts.map +1 -1
- package/dist/utils/url-utils.js +2 -2
- package/dist/utils-BwXbSgEI.d.ts +35 -0
- package/dist/utils-BwXbSgEI.d.ts.map +1 -0
- package/dist/utils-CqbeJfE1.cjs +138 -0
- package/dist/utils-CqbeJfE1.cjs.map +1 -0
- package/dist/utils-CtBGHj_N.d.cts +35 -0
- package/dist/utils-CtBGHj_N.d.cts.map +1 -0
- package/dist/utils-OgYE-imr.js +108 -0
- package/dist/utils-OgYE-imr.js.map +1 -0
- package/dist/version-Bj68uyCt.js +6 -0
- package/dist/{version-CcTnFB56.js.map → version-Bj68uyCt.js.map} +1 -1
- package/dist/{version-rDjaSkPw.cjs → version-CMS1IOUV.cjs} +2 -2
- package/dist/{version-rDjaSkPw.cjs.map → version-CMS1IOUV.cjs.map} +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/dist/{whoami-CEgbTUqt.cjs → whoami-BOJHfdih.cjs} +2 -2
- package/dist/{whoami-CEgbTUqt.cjs.map → whoami-BOJHfdih.cjs.map} +1 -1
- package/dist/{whoami-DesNZnaQ.js → whoami-Bswhb72a.js} +2 -2
- package/dist/{whoami-DesNZnaQ.js.map → whoami-Bswhb72a.js.map} +1 -1
- package/dist/whoami-CoZJKpys.cjs +44 -0
- package/dist/whoami-CoZJKpys.cjs.map +1 -0
- package/dist/whoami-xBAWvzG4.js +32 -0
- package/dist/whoami-xBAWvzG4.js.map +1 -0
- package/package.json +14 -7
- 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/create-dsn-D530I7Lr.js.map +0 -1
- package/dist/create-dsn-Dz8nyTFw.cjs.map +0 -1
- package/dist/create-project-BxzRiryg.cjs.map +0 -1
- package/dist/create-project-K1od5Rhx.js.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 +0 -91
- package/dist/find-errors-C3oUMeRi.js.map +0 -1
- package/dist/find-errors-CB9NpSxG.cjs +0 -97
- package/dist/find-errors-CB9NpSxG.cjs.map +0 -1
- package/dist/find-issues-C3uk59rn.cjs +0 -98
- package/dist/find-issues-C3uk59rn.cjs.map +0 -1
- package/dist/find-issues-CAtNGBly.js +0 -92
- 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/find-tags-Byk4d3oZ.cjs +0 -45
- package/dist/find-tags-Byk4d3oZ.cjs.map +0 -1
- package/dist/find-tags-d-wF1Se8.js +0 -39
- package/dist/find-tags-d-wF1Se8.js.map +0 -1
- package/dist/find-transactions-BiBgg-AE.js +0 -83
- package/dist/find-transactions-BiBgg-AE.js.map +0 -1
- package/dist/find-transactions-DuZyqjhF.cjs +0 -89
- package/dist/find-transactions-DuZyqjhF.cjs.map +0 -1
- package/dist/formatting-Bvyded57.js.map +0 -1
- package/dist/formatting-CcTK2X8V.d.cts.map +0 -1
- package/dist/formatting-D0Aki7rK.cjs.map +0 -1
- package/dist/formatting-vtXxusbn.d.ts.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-BJffpNoO.d.ts.map +0 -1
- package/dist/issue-helpers-CqqYnwYE.js.map +0 -1
- package/dist/issue-helpers-DyAIO0w6.cjs.map +0 -1
- package/dist/promptDefinitions-D3GTBGLr.d.ts.map +0 -1
- package/dist/prompts-C8Y9w5c4.js.map +0 -1
- package/dist/prompts-Df3i1XSB.cjs.map +0 -1
- package/dist/resources-BHF8a1ZB.js +0 -92
- package/dist/resources-BHF8a1ZB.js.map +0 -1
- package/dist/resources-BM_YQGcb.cjs +0 -104
- package/dist/resources-BM_YQGcb.cjs.map +0 -1
- package/dist/schema-3NeMWRAm.d.cts.map +0 -1
- package/dist/schema-B3CzDGJk.d.ts.map +0 -1
- package/dist/schema-B_cMyyJJ.cjs.map +0 -1
- package/dist/schema-WDk5Yqww.js.map +0 -1
- package/dist/seer-utils-CDm5J8ur.cjs.map +0 -1
- package/dist/seer-utils-Cj9DXrow.js.map +0 -1
- package/dist/server-BSRxzYFd.js.map +0 -1
- package/dist/server-Dgkqz8bA.cjs.map +0 -1
- package/dist/tools/find-errors.cjs +0 -12
- package/dist/tools/find-errors.d.cts +0 -18
- package/dist/tools/find-errors.d.cts.map +0 -1
- package/dist/tools/find-errors.d.ts +0 -18
- package/dist/tools/find-errors.d.ts.map +0 -1
- package/dist/tools/find-errors.js +0 -12
- package/dist/tools/find-issues.cjs +0 -12
- package/dist/tools/find-issues.d.cts +0 -16
- package/dist/tools/find-issues.d.cts.map +0 -1
- package/dist/tools/find-issues.d.ts +0 -16
- package/dist/tools/find-issues.d.ts.map +0 -1
- package/dist/tools/find-issues.js +0 -12
- package/dist/tools/find-tags.cjs +0 -12
- package/dist/tools/find-tags.d.cts +0 -13
- package/dist/tools/find-tags.d.cts.map +0 -1
- package/dist/tools/find-tags.d.ts +0 -13
- package/dist/tools/find-tags.d.ts.map +0 -1
- package/dist/tools/find-tags.js +0 -12
- package/dist/tools/find-transactions.cjs +0 -12
- package/dist/tools/find-transactions.d.cts +0 -17
- package/dist/tools/find-transactions.d.cts.map +0 -1
- package/dist/tools/find-transactions.d.ts +0 -17
- package/dist/tools/find-transactions.d.ts.map +0 -1
- package/dist/tools/find-transactions.js +0 -12
- package/dist/tools-CHnZvVEN.cjs +0 -53
- package/dist/tools-CHnZvVEN.cjs.map +0 -1
- package/dist/tools-CdXGgq1W.js +0 -48
- package/dist/tools-CdXGgq1W.js.map +0 -1
- package/dist/update-issue-DRTQvy6p.js.map +0 -1
- package/dist/update-issue-DpkxxiNk.cjs.map +0 -1
- package/dist/url-utils-C9hykWmk.cjs +0 -106
- package/dist/url-utils-C9hykWmk.cjs.map +0 -1
- package/dist/url-utils-DvZYfzPM.js +0 -82
- package/dist/url-utils-DvZYfzPM.js.map +0 -1
- package/dist/version-CcTnFB56.js +0 -6
- /package/dist/{api-client-CL1WDkw9.cjs → api-client-BWt6M7ij.cjs} +0 -0
- /package/dist/{api-client-ChL_0F2u.js → api-client-CNv_hbPO.js} +0 -0
- /package/dist/{fetch-utils-C0F4eH6S.cjs → fetch-utils-BqMx2KQr.js} +0 -0
- /package/dist/{fetch-utils-DlPjrSk2.js → fetch-utils-DeZcERfe.cjs} +0 -0
- /package/dist/{index-DVGDAddE.d.ts → index-DE1muTvw.d.ts} +0 -0
- /package/dist/{issue-utils-BbCfbiY8.js → issue-utils-BVAB6I-Z.js} +0 -0
- /package/dist/{issue-utils-DMKiif6C.cjs → issue-utils-pdbo-5LW.cjs} +0 -0
- /package/dist/{types-CCHsZshF.js → search-events-BBFPuvRq.cjs} +0 -0
- /package/dist/{types-MYBaygjr.cjs → search-events-bV3-kK78.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=20"
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
"default": "./dist/resources.js"
|
|
67
67
|
},
|
|
68
68
|
"./toolDefinitions": {
|
|
69
|
+
"types": "./dist/toolDefinitions.ts",
|
|
69
70
|
"default": "./dist/toolDefinitions.js"
|
|
70
71
|
},
|
|
71
72
|
"./types": {
|
|
@@ -79,24 +80,30 @@
|
|
|
79
80
|
},
|
|
80
81
|
"devDependencies": {
|
|
81
82
|
"msw": "^2.10.2",
|
|
83
|
+
"yaml": "^2.6.1",
|
|
82
84
|
"zod-to-json-schema": "^3.24.6",
|
|
83
|
-
"@sentry/mcp-server-mocks": "0.
|
|
84
|
-
"@sentry/mcp-server-tsconfig": "0.
|
|
85
|
+
"@sentry/mcp-server-mocks": "0.17.0",
|
|
86
|
+
"@sentry/mcp-server-tsconfig": "0.17.0"
|
|
85
87
|
},
|
|
86
88
|
"dependencies": {
|
|
89
|
+
"@ai-sdk/openai": "^1.3.22",
|
|
87
90
|
"@modelcontextprotocol/sdk": "^1.13.2",
|
|
88
91
|
"@sentry/core": "^9.33.0",
|
|
89
92
|
"@sentry/node": "^9.33.0",
|
|
93
|
+
"ai": "^4.3.16",
|
|
90
94
|
"zod": "^3.25.67"
|
|
91
95
|
},
|
|
92
96
|
"scripts": {
|
|
93
|
-
"
|
|
94
|
-
"
|
|
97
|
+
"prebuild": "pnpm run generate-tool-definitions",
|
|
98
|
+
"build": "tsdown",
|
|
99
|
+
"dev": "pnpm run generate-tool-definitions && tsdown -w",
|
|
95
100
|
"start": "tsx src/index.ts",
|
|
96
|
-
"
|
|
101
|
+
"pretest": "pnpm run generate-tool-definitions",
|
|
102
|
+
"test": "vitest",
|
|
97
103
|
"test:ci": "pnpm run generate-tool-definitions && vitest run --coverage --reporter=junit --outputFile=tests.junit.xml",
|
|
98
104
|
"tsc": "tsc --noEmit",
|
|
99
105
|
"test:watch": "vitest watch",
|
|
100
|
-
"generate-tool-definitions": "tsx scripts/generate-tool-definitions.ts"
|
|
106
|
+
"generate-tool-definitions": "tsx scripts/generate-tool-definitions.ts",
|
|
107
|
+
"generate-otel-namespaces": "tsx scripts/generate-otel-namespaces.ts"
|
|
101
108
|
}
|
|
102
109
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"analyze-issue-with-seer-BkVrrh28.cjs","names":["context: ServerContext","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} from \"./utils/seer-utils\";\nimport type { ServerContext } from \"../types\";\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 apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\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\n autofixState = await apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\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\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\n autofixState = await apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\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":";;;;;;;;;;AAsBA,sCAAe,8BAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAA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oqsTklL.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} from \"./utils/seer-utils\";\nimport type { ServerContext } from \"../types\";\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 apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\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\n autofixState = await apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\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\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\n autofixState = await apiService.getAutofixState({\n organizationSlug: orgSlug,\n issueId: parsedIssueId!,\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":";;;;;;;;;AAsBA,sCAAe,WAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB,sBAAsB,UAAU;EAClD,WAAW,eAAe,UAAU;EACpC,SAAS,kBAAkB,UAAU;EACrC,UAAU,cAAc,UAAU;EAClC,aAAa,EACV,QAAQ,CACR,SAAS,kDAAkD,CAC3D,UAAU;CACd;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,sBAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,EAAE,kBAAkB,SAAS,SAAS,eAAe,GACzD,iBAAiB;GACf,kBAAkB,OAAO;GACzB,SAAS,OAAO;GAChB,UAAU,OAAO;EAClB,EAAC;AAEJ,SAAO,qBAAqB,QAAQ;EAEpC,IAAI,UAAU,+BAA+B,cAAc;EAG3D,IAAI,eAAe,MAAM,WAAW,gBAAgB;GAClD,kBAAkB;GAClB,SAAS;EACV,EAAC;AAGF,OAAK,aAAa,SAAS;AACzB,cAAW;GACX,MAAM,cAAc,MAAM,WAAW,aAAa;IAChD,kBAAkB;IAClB,SAAS;IACT,aAAa,OAAO;GACrB,EAAC;AACF,cAAW,gCAAgC,YAAY,OAAO;AAG9D,SAAM,IAAI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WAAW,SAAS,sBAAsB;AAI5C,kBAAe,MAAM,WAAW,gBAAgB;IAC9C,kBAAkB;IAClB,SAAS;GACV,EAAC;EACH;AAGD,MAAI,aAAa,SAAS;AACxB,cAAW,sBAAsB,qBAAqB,aAAa,QAAQ,OAAO,CAAC;AACnF,QAAK,MAAM,QAAQ,aAAa,QAAQ,OAAO;AAC7C,cAAU,wBAAwB,KAAK;AACvC,cAAU;GACX;EACF;AAGD,aAAW;AACX,aAAW,gDAAgD,eAAe,IAAK;AAE/E,aAAW;AACX,aAAW;AACX,YAAU,OAAO,YACZ,oCAAoC,OAAO,SAAS,OACpD,4CAA4C,QAAQ,cAAc,cAAc;AACrF,aAAW;AAEX,SAAO;CACR;AACF,EAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { UserInputError } from "./errors-CIoxzIug.js";
|
|
2
|
-
import { SentryApiService } from "./client-DOYWNvVM.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
|
-
//#endregion
|
|
30
|
-
export { apiServiceFromContext };
|
|
31
|
-
//# sourceMappingURL=api-utils-C6QJAzFL.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api-utils-C6QJAzFL.js","names":["context: ServerContext","opts: { regionUrl?: string }"],"sources":["../src/tools/utils/api-utils.ts"],"sourcesContent":["import { SentryApiService } 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"],"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"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
const require_errors = require('./errors-YmiXLOyx.cjs');
|
|
2
|
-
const require_client = require('./client-Dkw5iYu3.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
|
-
//#endregion
|
|
30
|
-
Object.defineProperty(exports, 'apiServiceFromContext', {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function () {
|
|
33
|
-
return apiServiceFromContext;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=api-utils-d36iteNO.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api-utils-d36iteNO.cjs","names":["context: ServerContext","opts: { regionUrl?: string }","UserInputError","SentryApiService"],"sources":["../src/tools/utils/api-utils.ts"],"sourcesContent":["import { SentryApiService } 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"],"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client-CQ9Xe1aN.d.cts","names":[],"sources":["../src/api-client/client.ts"],"sourcesContent":[],"mappings":";;;;;;AA0EA;AAkBC;AAkDD;;;;;;;;;;;;;AA0RM,cA9VO,QAAA,SAAiB,KAAK,CA8V7B;EAAgB,MAChB,EAAA,MAAA;EAAI,WAKC,CAAA,OAAA,EAAA,MAAA,EAAA,MAAA,EAAA,MAAA;;KAhVN,cAAA,GAiVA;EAAO,IAsBD,CAAA,EAAA,MAAA;CAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiVnB,cAxoBO,gB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;;UAGN;;;;;;;;;;;;YAqDC,iBACN,QAAQ;;;;;;;;;;;;;;;YAkDF,iBAAc;;;;;;;;;;;;;;;;;;;;YAyDd,iBAAc;;;;;;;;;;;;;;;;;;;;YAuDd,iBACN,QAAQ;;;;;;;YAyBF,iBACN,QAAQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client-DOYWNvVM.js","names":["NETWORK_ERROR_MESSAGES: Record<string, string>","message: string","status: number","host: string","path: string","options: RequestInit","headers: Record<string, string>","response: Response","parsed: unknown | undefined","organizationSlug: string","issueId: string","traceId: string","opts?: RequestOptions","updateData: Record<string, any>","sentryQuery: string[]"],"sources":["../src/api-client/client.ts"],"sourcesContent":["import {\n OrganizationListSchema,\n ClientKeySchema,\n TeamListSchema,\n TeamSchema,\n ProjectListSchema,\n ProjectSchema,\n ReleaseListSchema,\n IssueListSchema,\n IssueSchema,\n EventSchema,\n EventAttachmentListSchema,\n ErrorsSearchResponseSchema,\n SpansSearchResponseSchema,\n TagListSchema,\n ApiErrorSchema,\n ClientKeyListSchema,\n AutofixRunSchema,\n AutofixRunStateSchema,\n UserSchema,\n UserRegionsSchema,\n} from \"./schema\";\nimport type {\n AutofixRun,\n AutofixRunState,\n ClientKey,\n ClientKeyList,\n Event,\n EventAttachment,\n EventAttachmentList,\n Issue,\n IssueList,\n OrganizationList,\n Project,\n ProjectList,\n ReleaseList,\n TagList,\n Team,\n TeamList,\n User,\n} from \"./types\";\n// TODO: this is shared - so ideally, for safety, it uses @sentry/core, but currently\n// logger isnt exposed (or rather, it is, but its not the right logger)\n// import { logger } from \"@sentry/node\";\n\n/**\n * Mapping of common network error codes to user-friendly messages.\n * These help users understand and resolve connection issues.\n */\nconst NETWORK_ERROR_MESSAGES: Record<string, string> = {\n EAI_AGAIN: \"DNS temporarily unavailable. Check your internet connection.\",\n ENOTFOUND: \"Hostname not found. Verify the URL is correct.\",\n ECONNREFUSED: \"Connection refused. Ensure the service is accessible.\",\n ETIMEDOUT: \"Connection timed out. Check network connectivity.\",\n ECONNRESET: \"Connection reset. Try again in a moment.\",\n};\n\n/**\n * Custom error class for Sentry API responses.\n *\n * Provides enhanced error messages for LLM consumption and handles\n * common API error scenarios with user-friendly messaging.\n *\n * @example\n * ```typescript\n * try {\n * await apiService.listIssues({ organizationSlug: \"invalid\" });\n * } catch (error) {\n * if (error instanceof ApiError) {\n * console.log(`API Error ${error.status}: ${error.message}`);\n * }\n * }\n * ```\n */\nexport class ApiError extends Error {\n constructor(\n message: string,\n public status: number,\n ) {\n // HACK: improving this error message for the LLMs\n let finalMessage = message;\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 finalMessage =\n \"You do not have access to query across multiple projects. Please select a project for your query.\";\n }\n super(finalMessage);\n }\n}\n\ntype RequestOptions = {\n host?: string;\n};\n\n/**\n * Sentry API client service for interacting with Sentry's REST API.\n *\n * This service provides a comprehensive interface to Sentry's API endpoints,\n * handling authentication, error processing, multi-region support, and\n * response validation through Zod schemas.\n *\n * Key Features:\n * - Multi-region support for Sentry SaaS and self-hosted instances\n * - Automatic schema validation with Zod\n * - Enhanced error handling with LLM-friendly messages\n * - URL generation for Sentry resources (issues, traces)\n * - Bearer token authentication\n * - Always uses HTTPS for secure connections\n *\n * @example Basic Usage\n * ```typescript\n * const apiService = new SentryApiService({\n * accessToken: \"your-token\",\n * host: \"sentry.io\"\n * });\n *\n * const orgs = await apiService.listOrganizations();\n * const issues = await apiService.listIssues({\n * organizationSlug: \"my-org\",\n * query: \"is:unresolved\"\n * });\n * ```\n *\n * @example Multi-Region Support\n * ```typescript\n * // Self-hosted instance with hostname\n * const selfHosted = new SentryApiService({\n * accessToken: \"token\",\n * host: \"sentry.company.com\"\n * });\n *\n * // Regional endpoint override\n * const issues = await apiService.listIssues(\n * { organizationSlug: \"org\" },\n * { host: \"eu.sentry.io\" }\n * );\n * ```\n */\nexport class SentryApiService {\n private accessToken: string | null;\n protected host: string;\n protected apiPrefix: string;\n\n /**\n * Creates a new Sentry API service instance.\n *\n * Always uses HTTPS for secure connections.\n *\n * @param config Configuration object\n * @param config.accessToken OAuth access token for authentication (optional for some endpoints)\n * @param config.host Sentry hostname (e.g. \"sentry.io\", \"sentry.example.com\")\n */\n constructor({\n accessToken = null,\n host = \"sentry.io\",\n }: {\n accessToken?: string | null;\n host?: string;\n }) {\n this.accessToken = accessToken;\n this.host = host;\n this.apiPrefix = `https://${host}/api/0`;\n }\n\n /**\n * Updates the host for API requests.\n *\n * Used for multi-region support or switching between Sentry instances.\n * Always uses HTTPS protocol.\n *\n * @param host New hostname to use for API requests\n */\n setHost(host: string) {\n this.host = host;\n this.apiPrefix = `https://${this.host}/api/0`;\n }\n\n /**\n * Internal method for making authenticated requests to Sentry API.\n *\n * Handles:\n * - Bearer token authentication\n * - Error response parsing and enhancement\n * - Multi-region host overrides\n * - Fetch availability validation\n *\n * @param path API endpoint path (without /api/0 prefix)\n * @param options Fetch options\n * @param requestOptions Additional request configuration\n * @returns Promise resolving to Response object\n * @throws {ApiError} Enhanced API errors with user-friendly messages\n * @throws {Error} Network or parsing errors\n */\n private async request(\n path: string,\n options: RequestInit = {},\n { host }: { host?: string } = {},\n ): Promise<Response> {\n const url = host\n ? `https://${host}/api/0${path}`\n : `${this.apiPrefix}${path}`;\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n \"User-Agent\": \"Sentry MCP Server\",\n };\n if (this.accessToken) {\n headers.Authorization = `Bearer ${this.accessToken}`;\n }\n\n // Check if fetch is available, otherwise provide a helpful error message\n if (typeof globalThis.fetch === \"undefined\") {\n throw new Error(\n \"fetch is not available. Please use Node.js >= 18 or ensure fetch is available in your environment.\",\n );\n }\n\n // logger.info(logger.fmt`[sentryApi] ${options.method || \"GET\"} ${url}`);\n let response: Response;\n try {\n response = await fetch(url, {\n ...options,\n headers,\n });\n } catch (error) {\n // Extract the root cause from the error chain\n let rootCause = error;\n while (rootCause instanceof Error && rootCause.cause) {\n rootCause = rootCause.cause;\n }\n\n const errorMessage =\n rootCause instanceof Error ? rootCause.message : String(rootCause);\n\n let friendlyMessage = `Unable to connect to ${url}`;\n\n // Check if we have a specific message for this error\n const errorCode = Object.keys(NETWORK_ERROR_MESSAGES).find((code) =>\n errorMessage.includes(code),\n );\n\n if (errorCode) {\n friendlyMessage += ` - ${NETWORK_ERROR_MESSAGES[errorCode]}`;\n } else {\n friendlyMessage += ` - ${errorMessage}`;\n }\n\n throw new Error(friendlyMessage, { cause: error });\n }\n\n if (!response.ok) {\n const errorText = await response.text();\n let parsed: unknown | undefined;\n try {\n parsed = JSON.parse(errorText);\n } catch (error) {\n console.error(\n `[sentryApi] Failed to parse error response: ${errorText}`,\n error,\n );\n }\n\n if (parsed) {\n const { data, success, error } = ApiErrorSchema.safeParse(parsed);\n\n if (success) {\n throw new ApiError(data.detail, response.status);\n }\n\n console.error(\n `[sentryApi] Failed to parse error response: ${errorText}`,\n error,\n );\n }\n\n throw new Error(\n `API request failed: ${response.status} ${response.statusText}\\n${errorText}`,\n );\n }\n\n return response;\n }\n\n /**\n * Generates a Sentry issue URL for browser navigation.\n *\n * Handles both SaaS (subdomain-based) and self-hosted URL formats.\n * Always uses HTTPS protocol.\n *\n * @param organizationSlug Organization identifier\n * @param issueId Issue identifier (short ID or numeric ID)\n * @returns Full URL to the issue in Sentry UI\n *\n * @example\n * ```typescript\n * // SaaS: https://my-org.sentry.io/issues/PROJ-123\n * apiService.getIssueUrl(\"my-org\", \"PROJ-123\")\n *\n * // Self-hosted: https://sentry.company.com/organizations/my-org/issues/PROJ-123\n * apiService.getIssueUrl(\"my-org\", \"PROJ-123\")\n * ```\n */\n getIssueUrl(organizationSlug: string, issueId: string): string {\n const isSaas = this.host === \"sentry.io\";\n\n return isSaas\n ? `https://${organizationSlug}.${this.host}/issues/${issueId}`\n : `https://${this.host}/organizations/${organizationSlug}/issues/${issueId}`;\n }\n\n /**\n * Generates a Sentry trace URL for performance investigation.\n *\n * Always uses HTTPS protocol.\n *\n * @param organizationSlug Organization identifier\n * @param traceId Trace identifier (hex string)\n * @returns Full HTTPS URL to the trace in Sentry UI\n *\n * @example\n * ```typescript\n * const traceUrl = apiService.getTraceUrl(\"my-org\", \"6a477f5b0f31ef7b6b9b5e1dea66c91d\");\n * // https://my-org.sentry.io/explore/traces/trace/6a477f5b0f31ef7b6b9b5e1dea66c91d\n * ```\n */\n getTraceUrl(organizationSlug: string, traceId: string): string {\n const isSaas = this.host === \"sentry.io\";\n\n return isSaas\n ? `https://${organizationSlug}.${this.host}/explore/traces/trace/${traceId}`\n : `https://${this.host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;\n }\n\n /**\n * Retrieves the authenticated user's profile information.\n *\n * @param opts Request options including host override\n * @returns User profile data\n * @throws {ApiError} If authentication fails or user not found\n */\n async getAuthenticatedUser(opts?: RequestOptions): Promise<User> {\n const response = await this.request(\"/auth/\", undefined, opts);\n const body = await response.json();\n return UserSchema.parse(body);\n }\n\n /**\n * Lists all organizations accessible to the authenticated user.\n *\n * Automatically handles multi-region queries by fetching from all\n * available regions and combining results.\n *\n * @param opts Request options\n * @returns Array of organizations across all accessible regions\n *\n * @example\n * ```typescript\n * const orgs = await apiService.listOrganizations();\n * orgs.forEach(org => {\n * // regionUrl present for Cloud Service, empty for self-hosted\n * console.log(`${org.name} (${org.slug}) - ${org.links?.regionUrl || 'No region URL'}`);\n * });\n * ```\n */\n async listOrganizations(opts?: RequestOptions): Promise<OrganizationList> {\n // TODO: Sentry is currently not returning all orgs without hitting region endpoints\n const regionResponse = await this.request(\n \"/users/me/regions/\",\n undefined,\n opts,\n );\n const regionData = UserRegionsSchema.parse(await regionResponse.json());\n\n return (\n await Promise.all(\n regionData.regions.map(async (region) =>\n this.request(`/organizations/`, undefined, {\n ...opts,\n host: new URL(region.url).host,\n }).then((response) => response.json()),\n ),\n )\n )\n .map((data) => OrganizationListSchema.parse(data))\n .reduce((acc, curr) => acc.concat(curr), []);\n }\n\n /**\n * Lists teams within an organization.\n *\n * @param organizationSlug Organization identifier\n * @param opts Request options including host override\n * @returns Array of teams in the organization\n */\n async listTeams(\n organizationSlug: string,\n opts?: RequestOptions,\n ): Promise<TeamList> {\n const response = await this.request(\n `/organizations/${organizationSlug}/teams/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return TeamListSchema.parse(body);\n }\n\n /**\n * Creates a new team within an organization.\n *\n * @param params Team creation parameters\n * @param params.organizationSlug Organization identifier\n * @param params.name Team name\n * @param opts Request options\n * @returns Created team data\n * @throws {ApiError} If team creation fails (e.g., name conflicts)\n */\n async createTeam(\n {\n organizationSlug,\n name,\n }: {\n organizationSlug: string;\n name: string;\n },\n opts?: RequestOptions,\n ): Promise<Team> {\n const response = await this.request(\n `/organizations/${organizationSlug}/teams/`,\n {\n method: \"POST\",\n body: JSON.stringify({ name }),\n },\n opts,\n );\n\n return TeamSchema.parse(await response.json());\n }\n\n /**\n * Lists projects within an organization.\n *\n * @param organizationSlug Organization identifier\n * @param opts Request options\n * @returns Array of projects in the organization\n */\n async listProjects(\n organizationSlug: string,\n opts?: RequestOptions,\n ): Promise<ProjectList> {\n const response = await this.request(\n `/organizations/${organizationSlug}/projects/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return ProjectListSchema.parse(body);\n }\n\n /**\n * Creates a new project within a team.\n *\n * @param params Project creation parameters\n * @param params.organizationSlug Organization identifier\n * @param params.teamSlug Team identifier\n * @param params.name Project name\n * @param params.platform Platform identifier (e.g., \"javascript\", \"python\")\n * @param opts Request options\n * @returns Created project data\n */\n async createProject(\n {\n organizationSlug,\n teamSlug,\n name,\n platform,\n }: {\n organizationSlug: string;\n teamSlug: string;\n name: string;\n platform?: string;\n },\n opts?: RequestOptions,\n ): Promise<Project> {\n const response = await this.request(\n `/teams/${organizationSlug}/${teamSlug}/projects/`,\n {\n method: \"POST\",\n body: JSON.stringify({\n name,\n platform,\n }),\n },\n opts,\n );\n return ProjectSchema.parse(await response.json());\n }\n\n /**\n * Updates an existing project's configuration.\n *\n * @param params Project update parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Current project identifier\n * @param params.name New project name (optional)\n * @param params.slug New project slug (optional)\n * @param params.platform New platform identifier (optional)\n * @param opts Request options\n * @returns Updated project data\n */\n async updateProject(\n {\n organizationSlug,\n projectSlug,\n name,\n slug,\n platform,\n }: {\n organizationSlug: string;\n projectSlug: string;\n name?: string;\n slug?: string;\n platform?: string;\n },\n opts?: RequestOptions,\n ): Promise<Project> {\n const updateData: Record<string, any> = {};\n if (name !== undefined) updateData.name = name;\n if (slug !== undefined) updateData.slug = slug;\n if (platform !== undefined) updateData.platform = platform;\n\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/`,\n {\n method: \"PUT\",\n body: JSON.stringify(updateData),\n },\n opts,\n );\n return ProjectSchema.parse(await response.json());\n }\n\n /**\n * Assigns a team to a project.\n *\n * @param params Assignment parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier\n * @param params.teamSlug Team identifier to assign\n * @param opts Request options\n */\n async addTeamToProject(\n {\n organizationSlug,\n projectSlug,\n teamSlug,\n }: {\n organizationSlug: string;\n projectSlug: string;\n teamSlug: string;\n },\n opts?: RequestOptions,\n ): Promise<void> {\n await this.request(\n `/projects/${organizationSlug}/${projectSlug}/teams/${teamSlug}/`,\n {\n method: \"POST\",\n body: JSON.stringify({}),\n },\n opts,\n );\n }\n\n /**\n * Creates a new client key (DSN) for a project.\n *\n * Client keys are used to identify and authenticate SDK requests to Sentry.\n *\n * @param params Key creation parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier\n * @param params.name Human-readable name for the key (optional)\n * @param opts Request options\n * @returns Created client key with DSN information\n *\n * @example\n * ```typescript\n * const key = await apiService.createClientKey({\n * organizationSlug: \"my-org\",\n * projectSlug: \"my-project\",\n * name: \"Production\"\n * });\n * console.log(`DSN: ${key.dsn.public}`);\n * ```\n */\n async createClientKey(\n {\n organizationSlug,\n projectSlug,\n name,\n }: {\n organizationSlug: string;\n projectSlug: string;\n name?: string;\n },\n opts?: RequestOptions,\n ): Promise<ClientKey> {\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/keys/`,\n {\n method: \"POST\",\n body: JSON.stringify({\n name,\n }),\n },\n opts,\n );\n return ClientKeySchema.parse(await response.json());\n }\n\n /**\n * Lists all client keys (DSNs) for a project.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier\n * @param opts Request options\n * @returns Array of client keys with DSN information\n */\n async listClientKeys(\n {\n organizationSlug,\n projectSlug,\n }: {\n organizationSlug: string;\n projectSlug: string;\n },\n opts?: RequestOptions,\n ): Promise<ClientKeyList> {\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/keys/`,\n undefined,\n opts,\n );\n return ClientKeyListSchema.parse(await response.json());\n }\n\n /**\n * Lists releases for an organization or specific project.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier (optional, scopes to specific project)\n * @param params.query Search query for filtering releases\n * @param opts Request options\n * @returns Array of releases with deployment and commit information\n *\n * @example\n * ```typescript\n * // All releases for organization\n * const releases = await apiService.listReleases({\n * organizationSlug: \"my-org\"\n * });\n *\n * // Search for specific version\n * const filtered = await apiService.listReleases({\n * organizationSlug: \"my-org\",\n * query: \"v1.2.3\"\n * });\n * ```\n */\n async listReleases(\n {\n organizationSlug,\n projectSlug,\n query,\n }: {\n organizationSlug: string;\n projectSlug?: string;\n query?: string;\n },\n opts?: RequestOptions,\n ): Promise<ReleaseList> {\n const searchQuery = new URLSearchParams();\n if (query) {\n searchQuery.set(\"query\", query);\n }\n\n const path = projectSlug\n ? `/projects/${organizationSlug}/${projectSlug}/releases/`\n : `/organizations/${organizationSlug}/releases/`;\n\n const response = await this.request(\n `${path}${searchQuery.toString()}`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return ReleaseListSchema.parse(body);\n }\n\n /**\n * Lists available tags for search queries.\n *\n * Tags represent indexed fields that can be used in Sentry search queries.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.dataset Dataset to query tags for (\"errors\" or \"search_issues\")\n * @param opts Request options\n * @returns Array of available tags with metadata\n *\n * @example\n * ```typescript\n * const tags = await apiService.listTags({\n * organizationSlug: \"my-org\",\n * dataset: \"errors\"\n * });\n * tags.forEach(tag => console.log(`${tag.key}: ${tag.name}`));\n * ```\n */\n async listTags(\n {\n organizationSlug,\n dataset,\n }: {\n organizationSlug: string;\n dataset?: \"errors\" | \"search_issues\";\n },\n opts?: RequestOptions,\n ): Promise<TagList> {\n // TODO: this supports project in the query, but needs fixed\n // to accept slugs\n const searchQuery = new URLSearchParams();\n if (dataset) {\n searchQuery.set(\"dataset\", dataset);\n }\n\n const response = await this.request(\n `/organizations/${organizationSlug}/tags/${searchQuery.toString()}`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return TagListSchema.parse(body);\n }\n\n /**\n * Lists issues within an organization or project.\n *\n * Issues represent groups of similar errors or problems in your application.\n * Supports Sentry's powerful query syntax for filtering and sorting.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier (optional, scopes to specific project)\n * @param params.query Sentry search query (e.g., \"is:unresolved browser:chrome\")\n * @param params.sortBy Sort order (\"user\", \"freq\", \"date\", \"new\")\n * @param opts Request options\n * @returns Array of issues with metadata and statistics\n *\n * @example\n * ```typescript\n * // Recent unresolved issues\n * const issues = await apiService.listIssues({\n * organizationSlug: \"my-org\",\n * query: \"is:unresolved\",\n * sortBy: \"date\"\n * });\n *\n * // High-frequency errors in specific project\n * const critical = await apiService.listIssues({\n * organizationSlug: \"my-org\",\n * projectSlug: \"backend\",\n * query: \"level:error\",\n * sortBy: \"freq\"\n * });\n * ```\n */\n async listIssues(\n {\n organizationSlug,\n projectSlug,\n query,\n sortBy,\n }: {\n organizationSlug: string;\n projectSlug?: string;\n query?: string;\n sortBy?: \"user\" | \"freq\" | \"date\" | \"new\";\n },\n opts?: RequestOptions,\n ): Promise<IssueList> {\n const sentryQuery: string[] = [];\n if (query) {\n sentryQuery.push(query);\n }\n\n const queryParams = new URLSearchParams();\n queryParams.set(\"per_page\", \"10\");\n queryParams.set(\"referrer\", \"sentry-mcp\");\n if (sortBy) queryParams.set(\"sort\", sortBy);\n queryParams.set(\"statsPeriod\", \"24h\");\n queryParams.set(\"query\", sentryQuery.join(\" \"));\n\n queryParams.append(\"collapse\", \"unhandled\");\n\n const apiUrl = projectSlug\n ? `/projects/${organizationSlug}/${projectSlug}/issues/?${queryParams.toString()}`\n : `/organizations/${organizationSlug}/issues/?${queryParams.toString()}`;\n\n const response = await this.request(apiUrl, undefined, opts);\n\n const body = await response.json();\n return IssueListSchema.parse(body);\n }\n\n async getIssue(\n {\n organizationSlug,\n issueId,\n }: {\n organizationSlug: string;\n issueId: string;\n },\n opts?: RequestOptions,\n ): Promise<Issue> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return IssueSchema.parse(body);\n }\n\n async getEventForIssue(\n {\n organizationSlug,\n issueId,\n eventId,\n }: {\n organizationSlug: string;\n issueId: string;\n eventId: string;\n },\n opts?: RequestOptions,\n ): Promise<Event> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/events/${eventId}/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return EventSchema.parse(body);\n }\n\n async getLatestEventForIssue(\n {\n organizationSlug,\n issueId,\n }: {\n organizationSlug: string;\n issueId: string;\n },\n opts?: RequestOptions,\n ): Promise<Event> {\n return this.getEventForIssue(\n {\n organizationSlug,\n issueId,\n eventId: \"latest\",\n },\n opts,\n );\n }\n\n async listEventAttachments(\n {\n organizationSlug,\n projectSlug,\n eventId,\n }: {\n organizationSlug: string;\n projectSlug: string;\n eventId: string;\n },\n opts?: RequestOptions,\n ): Promise<EventAttachmentList> {\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return EventAttachmentListSchema.parse(body);\n }\n\n async getEventAttachment(\n {\n organizationSlug,\n projectSlug,\n eventId,\n attachmentId,\n }: {\n organizationSlug: string;\n projectSlug: string;\n eventId: string;\n attachmentId: string;\n },\n opts?: RequestOptions,\n ): Promise<{\n attachment: EventAttachment;\n downloadUrl: string;\n filename: string;\n blob: Blob;\n }> {\n // Get the attachment metadata first\n const attachmentsResponse = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/`,\n undefined,\n opts,\n );\n\n const attachments = EventAttachmentListSchema.parse(\n await attachmentsResponse.json(),\n );\n const attachment = attachments.find((att) => att.id === attachmentId);\n\n if (!attachment) {\n throw new Error(\n `Attachment with ID ${attachmentId} not found for event ${eventId}`,\n );\n }\n\n // Download the actual file content\n const downloadUrl = `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/${attachmentId}/?download=1`;\n const downloadResponse = await this.request(\n downloadUrl,\n {\n method: \"GET\",\n headers: {\n Accept: \"application/octet-stream\",\n },\n },\n opts,\n );\n\n return {\n attachment,\n downloadUrl: downloadResponse.url,\n filename: attachment.name,\n blob: await downloadResponse.blob(),\n };\n }\n\n async updateIssue(\n {\n organizationSlug,\n issueId,\n status,\n assignedTo,\n }: {\n organizationSlug: string;\n issueId: string;\n status?: string;\n assignedTo?: string;\n },\n opts?: RequestOptions,\n ): Promise<Issue> {\n const updateData: Record<string, any> = {};\n if (status !== undefined) updateData.status = status;\n if (assignedTo !== undefined) updateData.assignedTo = assignedTo;\n\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/`,\n {\n method: \"PUT\",\n body: JSON.stringify(updateData),\n },\n opts,\n );\n\n const body = await response.json();\n return IssueSchema.parse(body);\n }\n\n // TODO: Sentry is not yet exposing a reasonable API to fetch trace data\n // async getTrace({\n // organizationSlug,\n // traceId,\n // }: {\n // organizationSlug: string;\n // traceId: string;\n // }): Promise<z.infer<typeof SentryIssueSchema>> {\n // const response = await this.request(\n // `/organizations/${organizationSlug}/issues/${traceId}/`,\n // );\n\n // const body = await response.json();\n // return SentryIssueSchema.parse(body);\n // }\n\n async searchErrors(\n {\n organizationSlug,\n projectSlug,\n filename,\n transaction,\n query,\n sortBy = \"last_seen\",\n }: {\n organizationSlug: string;\n projectSlug?: string;\n filename?: string;\n transaction?: string;\n query?: string;\n sortBy?: \"last_seen\" | \"count\";\n },\n opts?: RequestOptions,\n ) {\n const sentryQuery: string[] = [];\n if (filename) {\n sentryQuery.push(`stack.filename:\"*${filename.replace(/\"/g, '\\\\\"')}\"`);\n }\n if (transaction) {\n sentryQuery.push(`transaction:\"${transaction.replace(/\"/g, '\\\\\"')}\"`);\n }\n if (query) {\n sentryQuery.push(query);\n }\n if (projectSlug) {\n sentryQuery.push(`project:${projectSlug}`);\n }\n\n const queryParams = new URLSearchParams();\n queryParams.set(\"dataset\", \"errors\");\n queryParams.set(\"per_page\", \"10\");\n queryParams.set(\"referrer\", \"sentry-mcp\");\n queryParams.set(\n \"sort\",\n `-${sortBy === \"last_seen\" ? \"last_seen\" : \"count\"}`,\n );\n queryParams.set(\"statsPeriod\", \"24h\");\n queryParams.append(\"field\", \"issue\");\n queryParams.append(\"field\", \"title\");\n queryParams.append(\"field\", \"project\");\n queryParams.append(\"field\", \"last_seen()\");\n queryParams.append(\"field\", \"count()\");\n queryParams.set(\"query\", sentryQuery.join(\" \"));\n // if (projectSlug) queryParams.set(\"project\", projectSlug);\n\n const apiUrl = `/organizations/${organizationSlug}/events/?${queryParams.toString()}`;\n\n const response = await this.request(apiUrl, undefined, opts);\n\n const body = await response.json();\n // TODO(dcramer): If you're using an older version of Sentry this API had a breaking change\n // meaning this endpoint will error.\n return ErrorsSearchResponseSchema.parse(body).data;\n }\n\n async searchSpans(\n {\n organizationSlug,\n projectSlug,\n transaction,\n query,\n sortBy = \"timestamp\",\n }: {\n organizationSlug: string;\n projectSlug?: string;\n transaction?: string;\n query?: string;\n sortBy?: \"timestamp\" | \"duration\";\n },\n opts?: RequestOptions,\n ) {\n const sentryQuery: string[] = [\"is_transaction:true\"];\n if (transaction) {\n sentryQuery.push(`transaction:\"${transaction.replace(/\"/g, '\\\\\"')}\"`);\n }\n if (query) {\n sentryQuery.push(query);\n }\n if (projectSlug) {\n sentryQuery.push(`project:${projectSlug}`);\n }\n\n const queryParams = new URLSearchParams();\n queryParams.set(\"dataset\", \"spans\");\n queryParams.set(\"per_page\", \"10\");\n queryParams.set(\"referrer\", \"sentry-mcp\");\n queryParams.set(\n \"sort\",\n `-${sortBy === \"timestamp\" ? \"timestamp\" : \"span.duration\"}`,\n );\n queryParams.set(\"allowAggregateConditions\", \"0\");\n queryParams.set(\"useRpc\", \"1\");\n queryParams.append(\"field\", \"id\");\n queryParams.append(\"field\", \"trace\");\n queryParams.append(\"field\", \"span.op\");\n queryParams.append(\"field\", \"span.description\");\n queryParams.append(\"field\", \"span.duration\");\n queryParams.append(\"field\", \"transaction\");\n queryParams.append(\"field\", \"project\");\n queryParams.append(\"field\", \"timestamp\");\n queryParams.set(\"query\", sentryQuery.join(\" \"));\n // if (projectSlug) queryParams.set(\"project\", projectSlug);\n\n const apiUrl = `/organizations/${organizationSlug}/events/?${queryParams.toString()}`;\n\n const response = await this.request(apiUrl, undefined, opts);\n\n const body = await response.json();\n return SpansSearchResponseSchema.parse(body).data;\n }\n\n // POST https://us.sentry.io/api/0/issues/5485083130/autofix/\n async startAutofix(\n {\n organizationSlug,\n issueId,\n eventId,\n instruction = \"\",\n }: {\n organizationSlug: string;\n issueId: string;\n eventId?: string;\n instruction?: string;\n },\n opts?: RequestOptions,\n ): Promise<AutofixRun> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/autofix/`,\n {\n method: \"POST\",\n body: JSON.stringify({\n event_id: eventId,\n instruction,\n }),\n },\n opts,\n );\n const body = await response.json();\n return AutofixRunSchema.parse(body);\n }\n\n // GET https://us.sentry.io/api/0/issues/5485083130/autofix/\n async getAutofixState(\n {\n organizationSlug,\n issueId,\n }: {\n organizationSlug: string;\n issueId: string;\n },\n opts?: RequestOptions,\n ): Promise<AutofixRunState> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/autofix/`,\n undefined,\n opts,\n );\n const body = await response.json();\n return AutofixRunStateSchema.parse(body);\n }\n}\n"],"mappings":";;;;;;;AAiDA,MAAMA,yBAAiD;CACrD,WAAW;CACX,WAAW;CACX,cAAc;CACd,WAAW;CACX,YAAY;AACb;;;;;;;;;;;;;;;;;;AAmBD,IAAa,WAAb,cAA8B,MAAM;CAClC,YACEC,SACOC,QACP;EAEA,IAAI,eAAe;AACnB,MACE,QAAQ,SACN,2DACD,IACD,QAAQ,SAAS,gDAAgD,CAEjE,gBACE;AAEJ,QAAM,aAAa;EAbZ;CAcR;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDD,IAAa,mBAAb,MAA8B;CAC5B,AAAQ;CACR,AAAU;CACV,AAAU;;;;;;;;;;CAWV,YAAY,EACV,cAAc,MACd,OAAO,aAIR,EAAE;AACD,OAAK,cAAc;AACnB,OAAK,OAAO;AACZ,OAAK,aAAa,UAAU,KAAK;CAClC;;;;;;;;;CAUD,QAAQC,MAAc;AACpB,OAAK,OAAO;AACZ,OAAK,aAAa,UAAU,KAAK,KAAK;CACvC;;;;;;;;;;;;;;;;;CAkBD,MAAc,QACZC,MACAC,UAAuB,CAAE,GACzB,EAAE,MAAyB,GAAG,CAAE,GACb;EACnB,MAAM,MAAM,QACP,UAAU,KAAK,QAAQ,YACrB,KAAK,YAAY;EAExB,MAAMC,UAAkC;GACtC,gBAAgB;GAChB,cAAc;EACf;AACD,MAAI,KAAK,YACP,SAAQ,iBAAiB,SAAS,KAAK;AAIzC,aAAW,WAAW,UAAU,YAC9B,OAAM,IAAI,MACR;EAKJ,IAAIC;AACJ,MAAI;AACF,cAAW,MAAM,MAAM,KAAK;IAC1B,G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AC9C;CAGD,MAAM,aACJ,EACE,kBACA,SACA,SACA,cAAc,IAMf,EACDF,MACqB;EACrB,MAAM,WAAW,MAAM,KAAK,SACzB,iBAAiB,iBAAiB,UAAU,QAAQ,YACrD;GACE,QAAQ;GACR,MAAM,KAAK,UAAU;IACnB,UAAU;IACV;GACD,EAAC;EACH,GACD,KACD;EACD,MAAM,OAAO,MAAM,SAAS,MAAM;AAClC,SAAO,iBAAiB,MAAM,KAAK;CACpC;CAGD,MAAM,gBACJ,EACE,kBACA,SAID,EACDA,MAC0B;EAC1B,MAAM,WAAW,MAAM,KAAK,SACzB,iBAAiB,iBAAiB,UAAU,QAAQ,oBAErD,KACD;EACD,MAAM,OAAO,MAAM,SAAS,MAAM;AAClC,SAAO,sBAAsB,MAAM,KAAK;CACzC;AACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client-Dkw5iYu3.cjs","names":["NETWORK_ERROR_MESSAGES: Record<string, string>","message: string","status: number","host: string","path: string","options: RequestInit","headers: Record<string, string>","response: Response","parsed: unknown | undefined","organizationSlug: string","issueId: string","traceId: string","opts?: RequestOptions","updateData: Record<string, any>","sentryQuery: string[]"],"sources":["../src/api-client/client.ts"],"sourcesContent":["import {\n OrganizationListSchema,\n ClientKeySchema,\n TeamListSchema,\n TeamSchema,\n ProjectListSchema,\n ProjectSchema,\n ReleaseListSchema,\n IssueListSchema,\n IssueSchema,\n EventSchema,\n EventAttachmentListSchema,\n ErrorsSearchResponseSchema,\n SpansSearchResponseSchema,\n TagListSchema,\n ApiErrorSchema,\n ClientKeyListSchema,\n AutofixRunSchema,\n AutofixRunStateSchema,\n UserSchema,\n UserRegionsSchema,\n} from \"./schema\";\nimport type {\n AutofixRun,\n AutofixRunState,\n ClientKey,\n ClientKeyList,\n Event,\n EventAttachment,\n EventAttachmentList,\n Issue,\n IssueList,\n OrganizationList,\n Project,\n ProjectList,\n ReleaseList,\n TagList,\n Team,\n TeamList,\n User,\n} from \"./types\";\n// TODO: this is shared - so ideally, for safety, it uses @sentry/core, but currently\n// logger isnt exposed (or rather, it is, but its not the right logger)\n// import { logger } from \"@sentry/node\";\n\n/**\n * Mapping of common network error codes to user-friendly messages.\n * These help users understand and resolve connection issues.\n */\nconst NETWORK_ERROR_MESSAGES: Record<string, string> = {\n EAI_AGAIN: \"DNS temporarily unavailable. Check your internet connection.\",\n ENOTFOUND: \"Hostname not found. Verify the URL is correct.\",\n ECONNREFUSED: \"Connection refused. Ensure the service is accessible.\",\n ETIMEDOUT: \"Connection timed out. Check network connectivity.\",\n ECONNRESET: \"Connection reset. Try again in a moment.\",\n};\n\n/**\n * Custom error class for Sentry API responses.\n *\n * Provides enhanced error messages for LLM consumption and handles\n * common API error scenarios with user-friendly messaging.\n *\n * @example\n * ```typescript\n * try {\n * await apiService.listIssues({ organizationSlug: \"invalid\" });\n * } catch (error) {\n * if (error instanceof ApiError) {\n * console.log(`API Error ${error.status}: ${error.message}`);\n * }\n * }\n * ```\n */\nexport class ApiError extends Error {\n constructor(\n message: string,\n public status: number,\n ) {\n // HACK: improving this error message for the LLMs\n let finalMessage = message;\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 finalMessage =\n \"You do not have access to query across multiple projects. Please select a project for your query.\";\n }\n super(finalMessage);\n }\n}\n\ntype RequestOptions = {\n host?: string;\n};\n\n/**\n * Sentry API client service for interacting with Sentry's REST API.\n *\n * This service provides a comprehensive interface to Sentry's API endpoints,\n * handling authentication, error processing, multi-region support, and\n * response validation through Zod schemas.\n *\n * Key Features:\n * - Multi-region support for Sentry SaaS and self-hosted instances\n * - Automatic schema validation with Zod\n * - Enhanced error handling with LLM-friendly messages\n * - URL generation for Sentry resources (issues, traces)\n * - Bearer token authentication\n * - Always uses HTTPS for secure connections\n *\n * @example Basic Usage\n * ```typescript\n * const apiService = new SentryApiService({\n * accessToken: \"your-token\",\n * host: \"sentry.io\"\n * });\n *\n * const orgs = await apiService.listOrganizations();\n * const issues = await apiService.listIssues({\n * organizationSlug: \"my-org\",\n * query: \"is:unresolved\"\n * });\n * ```\n *\n * @example Multi-Region Support\n * ```typescript\n * // Self-hosted instance with hostname\n * const selfHosted = new SentryApiService({\n * accessToken: \"token\",\n * host: \"sentry.company.com\"\n * });\n *\n * // Regional endpoint override\n * const issues = await apiService.listIssues(\n * { organizationSlug: \"org\" },\n * { host: \"eu.sentry.io\" }\n * );\n * ```\n */\nexport class SentryApiService {\n private accessToken: string | null;\n protected host: string;\n protected apiPrefix: string;\n\n /**\n * Creates a new Sentry API service instance.\n *\n * Always uses HTTPS for secure connections.\n *\n * @param config Configuration object\n * @param config.accessToken OAuth access token for authentication (optional for some endpoints)\n * @param config.host Sentry hostname (e.g. \"sentry.io\", \"sentry.example.com\")\n */\n constructor({\n accessToken = null,\n host = \"sentry.io\",\n }: {\n accessToken?: string | null;\n host?: string;\n }) {\n this.accessToken = accessToken;\n this.host = host;\n this.apiPrefix = `https://${host}/api/0`;\n }\n\n /**\n * Updates the host for API requests.\n *\n * Used for multi-region support or switching between Sentry instances.\n * Always uses HTTPS protocol.\n *\n * @param host New hostname to use for API requests\n */\n setHost(host: string) {\n this.host = host;\n this.apiPrefix = `https://${this.host}/api/0`;\n }\n\n /**\n * Internal method for making authenticated requests to Sentry API.\n *\n * Handles:\n * - Bearer token authentication\n * - Error response parsing and enhancement\n * - Multi-region host overrides\n * - Fetch availability validation\n *\n * @param path API endpoint path (without /api/0 prefix)\n * @param options Fetch options\n * @param requestOptions Additional request configuration\n * @returns Promise resolving to Response object\n * @throws {ApiError} Enhanced API errors with user-friendly messages\n * @throws {Error} Network or parsing errors\n */\n private async request(\n path: string,\n options: RequestInit = {},\n { host }: { host?: string } = {},\n ): Promise<Response> {\n const url = host\n ? `https://${host}/api/0${path}`\n : `${this.apiPrefix}${path}`;\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n \"User-Agent\": \"Sentry MCP Server\",\n };\n if (this.accessToken) {\n headers.Authorization = `Bearer ${this.accessToken}`;\n }\n\n // Check if fetch is available, otherwise provide a helpful error message\n if (typeof globalThis.fetch === \"undefined\") {\n throw new Error(\n \"fetch is not available. Please use Node.js >= 18 or ensure fetch is available in your environment.\",\n );\n }\n\n // logger.info(logger.fmt`[sentryApi] ${options.method || \"GET\"} ${url}`);\n let response: Response;\n try {\n response = await fetch(url, {\n ...options,\n headers,\n });\n } catch (error) {\n // Extract the root cause from the error chain\n let rootCause = error;\n while (rootCause instanceof Error && rootCause.cause) {\n rootCause = rootCause.cause;\n }\n\n const errorMessage =\n rootCause instanceof Error ? rootCause.message : String(rootCause);\n\n let friendlyMessage = `Unable to connect to ${url}`;\n\n // Check if we have a specific message for this error\n const errorCode = Object.keys(NETWORK_ERROR_MESSAGES).find((code) =>\n errorMessage.includes(code),\n );\n\n if (errorCode) {\n friendlyMessage += ` - ${NETWORK_ERROR_MESSAGES[errorCode]}`;\n } else {\n friendlyMessage += ` - ${errorMessage}`;\n }\n\n throw new Error(friendlyMessage, { cause: error });\n }\n\n if (!response.ok) {\n const errorText = await response.text();\n let parsed: unknown | undefined;\n try {\n parsed = JSON.parse(errorText);\n } catch (error) {\n console.error(\n `[sentryApi] Failed to parse error response: ${errorText}`,\n error,\n );\n }\n\n if (parsed) {\n const { data, success, error } = ApiErrorSchema.safeParse(parsed);\n\n if (success) {\n throw new ApiError(data.detail, response.status);\n }\n\n console.error(\n `[sentryApi] Failed to parse error response: ${errorText}`,\n error,\n );\n }\n\n throw new Error(\n `API request failed: ${response.status} ${response.statusText}\\n${errorText}`,\n );\n }\n\n return response;\n }\n\n /**\n * Generates a Sentry issue URL for browser navigation.\n *\n * Handles both SaaS (subdomain-based) and self-hosted URL formats.\n * Always uses HTTPS protocol.\n *\n * @param organizationSlug Organization identifier\n * @param issueId Issue identifier (short ID or numeric ID)\n * @returns Full URL to the issue in Sentry UI\n *\n * @example\n * ```typescript\n * // SaaS: https://my-org.sentry.io/issues/PROJ-123\n * apiService.getIssueUrl(\"my-org\", \"PROJ-123\")\n *\n * // Self-hosted: https://sentry.company.com/organizations/my-org/issues/PROJ-123\n * apiService.getIssueUrl(\"my-org\", \"PROJ-123\")\n * ```\n */\n getIssueUrl(organizationSlug: string, issueId: string): string {\n const isSaas = this.host === \"sentry.io\";\n\n return isSaas\n ? `https://${organizationSlug}.${this.host}/issues/${issueId}`\n : `https://${this.host}/organizations/${organizationSlug}/issues/${issueId}`;\n }\n\n /**\n * Generates a Sentry trace URL for performance investigation.\n *\n * Always uses HTTPS protocol.\n *\n * @param organizationSlug Organization identifier\n * @param traceId Trace identifier (hex string)\n * @returns Full HTTPS URL to the trace in Sentry UI\n *\n * @example\n * ```typescript\n * const traceUrl = apiService.getTraceUrl(\"my-org\", \"6a477f5b0f31ef7b6b9b5e1dea66c91d\");\n * // https://my-org.sentry.io/explore/traces/trace/6a477f5b0f31ef7b6b9b5e1dea66c91d\n * ```\n */\n getTraceUrl(organizationSlug: string, traceId: string): string {\n const isSaas = this.host === \"sentry.io\";\n\n return isSaas\n ? `https://${organizationSlug}.${this.host}/explore/traces/trace/${traceId}`\n : `https://${this.host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;\n }\n\n /**\n * Retrieves the authenticated user's profile information.\n *\n * @param opts Request options including host override\n * @returns User profile data\n * @throws {ApiError} If authentication fails or user not found\n */\n async getAuthenticatedUser(opts?: RequestOptions): Promise<User> {\n const response = await this.request(\"/auth/\", undefined, opts);\n const body = await response.json();\n return UserSchema.parse(body);\n }\n\n /**\n * Lists all organizations accessible to the authenticated user.\n *\n * Automatically handles multi-region queries by fetching from all\n * available regions and combining results.\n *\n * @param opts Request options\n * @returns Array of organizations across all accessible regions\n *\n * @example\n * ```typescript\n * const orgs = await apiService.listOrganizations();\n * orgs.forEach(org => {\n * // regionUrl present for Cloud Service, empty for self-hosted\n * console.log(`${org.name} (${org.slug}) - ${org.links?.regionUrl || 'No region URL'}`);\n * });\n * ```\n */\n async listOrganizations(opts?: RequestOptions): Promise<OrganizationList> {\n // TODO: Sentry is currently not returning all orgs without hitting region endpoints\n const regionResponse = await this.request(\n \"/users/me/regions/\",\n undefined,\n opts,\n );\n const regionData = UserRegionsSchema.parse(await regionResponse.json());\n\n return (\n await Promise.all(\n regionData.regions.map(async (region) =>\n this.request(`/organizations/`, undefined, {\n ...opts,\n host: new URL(region.url).host,\n }).then((response) => response.json()),\n ),\n )\n )\n .map((data) => OrganizationListSchema.parse(data))\n .reduce((acc, curr) => acc.concat(curr), []);\n }\n\n /**\n * Lists teams within an organization.\n *\n * @param organizationSlug Organization identifier\n * @param opts Request options including host override\n * @returns Array of teams in the organization\n */\n async listTeams(\n organizationSlug: string,\n opts?: RequestOptions,\n ): Promise<TeamList> {\n const response = await this.request(\n `/organizations/${organizationSlug}/teams/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return TeamListSchema.parse(body);\n }\n\n /**\n * Creates a new team within an organization.\n *\n * @param params Team creation parameters\n * @param params.organizationSlug Organization identifier\n * @param params.name Team name\n * @param opts Request options\n * @returns Created team data\n * @throws {ApiError} If team creation fails (e.g., name conflicts)\n */\n async createTeam(\n {\n organizationSlug,\n name,\n }: {\n organizationSlug: string;\n name: string;\n },\n opts?: RequestOptions,\n ): Promise<Team> {\n const response = await this.request(\n `/organizations/${organizationSlug}/teams/`,\n {\n method: \"POST\",\n body: JSON.stringify({ name }),\n },\n opts,\n );\n\n return TeamSchema.parse(await response.json());\n }\n\n /**\n * Lists projects within an organization.\n *\n * @param organizationSlug Organization identifier\n * @param opts Request options\n * @returns Array of projects in the organization\n */\n async listProjects(\n organizationSlug: string,\n opts?: RequestOptions,\n ): Promise<ProjectList> {\n const response = await this.request(\n `/organizations/${organizationSlug}/projects/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return ProjectListSchema.parse(body);\n }\n\n /**\n * Creates a new project within a team.\n *\n * @param params Project creation parameters\n * @param params.organizationSlug Organization identifier\n * @param params.teamSlug Team identifier\n * @param params.name Project name\n * @param params.platform Platform identifier (e.g., \"javascript\", \"python\")\n * @param opts Request options\n * @returns Created project data\n */\n async createProject(\n {\n organizationSlug,\n teamSlug,\n name,\n platform,\n }: {\n organizationSlug: string;\n teamSlug: string;\n name: string;\n platform?: string;\n },\n opts?: RequestOptions,\n ): Promise<Project> {\n const response = await this.request(\n `/teams/${organizationSlug}/${teamSlug}/projects/`,\n {\n method: \"POST\",\n body: JSON.stringify({\n name,\n platform,\n }),\n },\n opts,\n );\n return ProjectSchema.parse(await response.json());\n }\n\n /**\n * Updates an existing project's configuration.\n *\n * @param params Project update parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Current project identifier\n * @param params.name New project name (optional)\n * @param params.slug New project slug (optional)\n * @param params.platform New platform identifier (optional)\n * @param opts Request options\n * @returns Updated project data\n */\n async updateProject(\n {\n organizationSlug,\n projectSlug,\n name,\n slug,\n platform,\n }: {\n organizationSlug: string;\n projectSlug: string;\n name?: string;\n slug?: string;\n platform?: string;\n },\n opts?: RequestOptions,\n ): Promise<Project> {\n const updateData: Record<string, any> = {};\n if (name !== undefined) updateData.name = name;\n if (slug !== undefined) updateData.slug = slug;\n if (platform !== undefined) updateData.platform = platform;\n\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/`,\n {\n method: \"PUT\",\n body: JSON.stringify(updateData),\n },\n opts,\n );\n return ProjectSchema.parse(await response.json());\n }\n\n /**\n * Assigns a team to a project.\n *\n * @param params Assignment parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier\n * @param params.teamSlug Team identifier to assign\n * @param opts Request options\n */\n async addTeamToProject(\n {\n organizationSlug,\n projectSlug,\n teamSlug,\n }: {\n organizationSlug: string;\n projectSlug: string;\n teamSlug: string;\n },\n opts?: RequestOptions,\n ): Promise<void> {\n await this.request(\n `/projects/${organizationSlug}/${projectSlug}/teams/${teamSlug}/`,\n {\n method: \"POST\",\n body: JSON.stringify({}),\n },\n opts,\n );\n }\n\n /**\n * Creates a new client key (DSN) for a project.\n *\n * Client keys are used to identify and authenticate SDK requests to Sentry.\n *\n * @param params Key creation parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier\n * @param params.name Human-readable name for the key (optional)\n * @param opts Request options\n * @returns Created client key with DSN information\n *\n * @example\n * ```typescript\n * const key = await apiService.createClientKey({\n * organizationSlug: \"my-org\",\n * projectSlug: \"my-project\",\n * name: \"Production\"\n * });\n * console.log(`DSN: ${key.dsn.public}`);\n * ```\n */\n async createClientKey(\n {\n organizationSlug,\n projectSlug,\n name,\n }: {\n organizationSlug: string;\n projectSlug: string;\n name?: string;\n },\n opts?: RequestOptions,\n ): Promise<ClientKey> {\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/keys/`,\n {\n method: \"POST\",\n body: JSON.stringify({\n name,\n }),\n },\n opts,\n );\n return ClientKeySchema.parse(await response.json());\n }\n\n /**\n * Lists all client keys (DSNs) for a project.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier\n * @param opts Request options\n * @returns Array of client keys with DSN information\n */\n async listClientKeys(\n {\n organizationSlug,\n projectSlug,\n }: {\n organizationSlug: string;\n projectSlug: string;\n },\n opts?: RequestOptions,\n ): Promise<ClientKeyList> {\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/keys/`,\n undefined,\n opts,\n );\n return ClientKeyListSchema.parse(await response.json());\n }\n\n /**\n * Lists releases for an organization or specific project.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier (optional, scopes to specific project)\n * @param params.query Search query for filtering releases\n * @param opts Request options\n * @returns Array of releases with deployment and commit information\n *\n * @example\n * ```typescript\n * // All releases for organization\n * const releases = await apiService.listReleases({\n * organizationSlug: \"my-org\"\n * });\n *\n * // Search for specific version\n * const filtered = await apiService.listReleases({\n * organizationSlug: \"my-org\",\n * query: \"v1.2.3\"\n * });\n * ```\n */\n async listReleases(\n {\n organizationSlug,\n projectSlug,\n query,\n }: {\n organizationSlug: string;\n projectSlug?: string;\n query?: string;\n },\n opts?: RequestOptions,\n ): Promise<ReleaseList> {\n const searchQuery = new URLSearchParams();\n if (query) {\n searchQuery.set(\"query\", query);\n }\n\n const path = projectSlug\n ? `/projects/${organizationSlug}/${projectSlug}/releases/`\n : `/organizations/${organizationSlug}/releases/`;\n\n const response = await this.request(\n `${path}${searchQuery.toString()}`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return ReleaseListSchema.parse(body);\n }\n\n /**\n * Lists available tags for search queries.\n *\n * Tags represent indexed fields that can be used in Sentry search queries.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.dataset Dataset to query tags for (\"errors\" or \"search_issues\")\n * @param opts Request options\n * @returns Array of available tags with metadata\n *\n * @example\n * ```typescript\n * const tags = await apiService.listTags({\n * organizationSlug: \"my-org\",\n * dataset: \"errors\"\n * });\n * tags.forEach(tag => console.log(`${tag.key}: ${tag.name}`));\n * ```\n */\n async listTags(\n {\n organizationSlug,\n dataset,\n }: {\n organizationSlug: string;\n dataset?: \"errors\" | \"search_issues\";\n },\n opts?: RequestOptions,\n ): Promise<TagList> {\n // TODO: this supports project in the query, but needs fixed\n // to accept slugs\n const searchQuery = new URLSearchParams();\n if (dataset) {\n searchQuery.set(\"dataset\", dataset);\n }\n\n const response = await this.request(\n `/organizations/${organizationSlug}/tags/${searchQuery.toString()}`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return TagListSchema.parse(body);\n }\n\n /**\n * Lists issues within an organization or project.\n *\n * Issues represent groups of similar errors or problems in your application.\n * Supports Sentry's powerful query syntax for filtering and sorting.\n *\n * @param params Query parameters\n * @param params.organizationSlug Organization identifier\n * @param params.projectSlug Project identifier (optional, scopes to specific project)\n * @param params.query Sentry search query (e.g., \"is:unresolved browser:chrome\")\n * @param params.sortBy Sort order (\"user\", \"freq\", \"date\", \"new\")\n * @param opts Request options\n * @returns Array of issues with metadata and statistics\n *\n * @example\n * ```typescript\n * // Recent unresolved issues\n * const issues = await apiService.listIssues({\n * organizationSlug: \"my-org\",\n * query: \"is:unresolved\",\n * sortBy: \"date\"\n * });\n *\n * // High-frequency errors in specific project\n * const critical = await apiService.listIssues({\n * organizationSlug: \"my-org\",\n * projectSlug: \"backend\",\n * query: \"level:error\",\n * sortBy: \"freq\"\n * });\n * ```\n */\n async listIssues(\n {\n organizationSlug,\n projectSlug,\n query,\n sortBy,\n }: {\n organizationSlug: string;\n projectSlug?: string;\n query?: string;\n sortBy?: \"user\" | \"freq\" | \"date\" | \"new\";\n },\n opts?: RequestOptions,\n ): Promise<IssueList> {\n const sentryQuery: string[] = [];\n if (query) {\n sentryQuery.push(query);\n }\n\n const queryParams = new URLSearchParams();\n queryParams.set(\"per_page\", \"10\");\n queryParams.set(\"referrer\", \"sentry-mcp\");\n if (sortBy) queryParams.set(\"sort\", sortBy);\n queryParams.set(\"statsPeriod\", \"24h\");\n queryParams.set(\"query\", sentryQuery.join(\" \"));\n\n queryParams.append(\"collapse\", \"unhandled\");\n\n const apiUrl = projectSlug\n ? `/projects/${organizationSlug}/${projectSlug}/issues/?${queryParams.toString()}`\n : `/organizations/${organizationSlug}/issues/?${queryParams.toString()}`;\n\n const response = await this.request(apiUrl, undefined, opts);\n\n const body = await response.json();\n return IssueListSchema.parse(body);\n }\n\n async getIssue(\n {\n organizationSlug,\n issueId,\n }: {\n organizationSlug: string;\n issueId: string;\n },\n opts?: RequestOptions,\n ): Promise<Issue> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return IssueSchema.parse(body);\n }\n\n async getEventForIssue(\n {\n organizationSlug,\n issueId,\n eventId,\n }: {\n organizationSlug: string;\n issueId: string;\n eventId: string;\n },\n opts?: RequestOptions,\n ): Promise<Event> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/events/${eventId}/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return EventSchema.parse(body);\n }\n\n async getLatestEventForIssue(\n {\n organizationSlug,\n issueId,\n }: {\n organizationSlug: string;\n issueId: string;\n },\n opts?: RequestOptions,\n ): Promise<Event> {\n return this.getEventForIssue(\n {\n organizationSlug,\n issueId,\n eventId: \"latest\",\n },\n opts,\n );\n }\n\n async listEventAttachments(\n {\n organizationSlug,\n projectSlug,\n eventId,\n }: {\n organizationSlug: string;\n projectSlug: string;\n eventId: string;\n },\n opts?: RequestOptions,\n ): Promise<EventAttachmentList> {\n const response = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/`,\n undefined,\n opts,\n );\n\n const body = await response.json();\n return EventAttachmentListSchema.parse(body);\n }\n\n async getEventAttachment(\n {\n organizationSlug,\n projectSlug,\n eventId,\n attachmentId,\n }: {\n organizationSlug: string;\n projectSlug: string;\n eventId: string;\n attachmentId: string;\n },\n opts?: RequestOptions,\n ): Promise<{\n attachment: EventAttachment;\n downloadUrl: string;\n filename: string;\n blob: Blob;\n }> {\n // Get the attachment metadata first\n const attachmentsResponse = await this.request(\n `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/`,\n undefined,\n opts,\n );\n\n const attachments = EventAttachmentListSchema.parse(\n await attachmentsResponse.json(),\n );\n const attachment = attachments.find((att) => att.id === attachmentId);\n\n if (!attachment) {\n throw new Error(\n `Attachment with ID ${attachmentId} not found for event ${eventId}`,\n );\n }\n\n // Download the actual file content\n const downloadUrl = `/projects/${organizationSlug}/${projectSlug}/events/${eventId}/attachments/${attachmentId}/?download=1`;\n const downloadResponse = await this.request(\n downloadUrl,\n {\n method: \"GET\",\n headers: {\n Accept: \"application/octet-stream\",\n },\n },\n opts,\n );\n\n return {\n attachment,\n downloadUrl: downloadResponse.url,\n filename: attachment.name,\n blob: await downloadResponse.blob(),\n };\n }\n\n async updateIssue(\n {\n organizationSlug,\n issueId,\n status,\n assignedTo,\n }: {\n organizationSlug: string;\n issueId: string;\n status?: string;\n assignedTo?: string;\n },\n opts?: RequestOptions,\n ): Promise<Issue> {\n const updateData: Record<string, any> = {};\n if (status !== undefined) updateData.status = status;\n if (assignedTo !== undefined) updateData.assignedTo = assignedTo;\n\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/`,\n {\n method: \"PUT\",\n body: JSON.stringify(updateData),\n },\n opts,\n );\n\n const body = await response.json();\n return IssueSchema.parse(body);\n }\n\n // TODO: Sentry is not yet exposing a reasonable API to fetch trace data\n // async getTrace({\n // organizationSlug,\n // traceId,\n // }: {\n // organizationSlug: string;\n // traceId: string;\n // }): Promise<z.infer<typeof SentryIssueSchema>> {\n // const response = await this.request(\n // `/organizations/${organizationSlug}/issues/${traceId}/`,\n // );\n\n // const body = await response.json();\n // return SentryIssueSchema.parse(body);\n // }\n\n async searchErrors(\n {\n organizationSlug,\n projectSlug,\n filename,\n transaction,\n query,\n sortBy = \"last_seen\",\n }: {\n organizationSlug: string;\n projectSlug?: string;\n filename?: string;\n transaction?: string;\n query?: string;\n sortBy?: \"last_seen\" | \"count\";\n },\n opts?: RequestOptions,\n ) {\n const sentryQuery: string[] = [];\n if (filename) {\n sentryQuery.push(`stack.filename:\"*${filename.replace(/\"/g, '\\\\\"')}\"`);\n }\n if (transaction) {\n sentryQuery.push(`transaction:\"${transaction.replace(/\"/g, '\\\\\"')}\"`);\n }\n if (query) {\n sentryQuery.push(query);\n }\n if (projectSlug) {\n sentryQuery.push(`project:${projectSlug}`);\n }\n\n const queryParams = new URLSearchParams();\n queryParams.set(\"dataset\", \"errors\");\n queryParams.set(\"per_page\", \"10\");\n queryParams.set(\"referrer\", \"sentry-mcp\");\n queryParams.set(\n \"sort\",\n `-${sortBy === \"last_seen\" ? \"last_seen\" : \"count\"}`,\n );\n queryParams.set(\"statsPeriod\", \"24h\");\n queryParams.append(\"field\", \"issue\");\n queryParams.append(\"field\", \"title\");\n queryParams.append(\"field\", \"project\");\n queryParams.append(\"field\", \"last_seen()\");\n queryParams.append(\"field\", \"count()\");\n queryParams.set(\"query\", sentryQuery.join(\" \"));\n // if (projectSlug) queryParams.set(\"project\", projectSlug);\n\n const apiUrl = `/organizations/${organizationSlug}/events/?${queryParams.toString()}`;\n\n const response = await this.request(apiUrl, undefined, opts);\n\n const body = await response.json();\n // TODO(dcramer): If you're using an older version of Sentry this API had a breaking change\n // meaning this endpoint will error.\n return ErrorsSearchResponseSchema.parse(body).data;\n }\n\n async searchSpans(\n {\n organizationSlug,\n projectSlug,\n transaction,\n query,\n sortBy = \"timestamp\",\n }: {\n organizationSlug: string;\n projectSlug?: string;\n transaction?: string;\n query?: string;\n sortBy?: \"timestamp\" | \"duration\";\n },\n opts?: RequestOptions,\n ) {\n const sentryQuery: string[] = [\"is_transaction:true\"];\n if (transaction) {\n sentryQuery.push(`transaction:\"${transaction.replace(/\"/g, '\\\\\"')}\"`);\n }\n if (query) {\n sentryQuery.push(query);\n }\n if (projectSlug) {\n sentryQuery.push(`project:${projectSlug}`);\n }\n\n const queryParams = new URLSearchParams();\n queryParams.set(\"dataset\", \"spans\");\n queryParams.set(\"per_page\", \"10\");\n queryParams.set(\"referrer\", \"sentry-mcp\");\n queryParams.set(\n \"sort\",\n `-${sortBy === \"timestamp\" ? \"timestamp\" : \"span.duration\"}`,\n );\n queryParams.set(\"allowAggregateConditions\", \"0\");\n queryParams.set(\"useRpc\", \"1\");\n queryParams.append(\"field\", \"id\");\n queryParams.append(\"field\", \"trace\");\n queryParams.append(\"field\", \"span.op\");\n queryParams.append(\"field\", \"span.description\");\n queryParams.append(\"field\", \"span.duration\");\n queryParams.append(\"field\", \"transaction\");\n queryParams.append(\"field\", \"project\");\n queryParams.append(\"field\", \"timestamp\");\n queryParams.set(\"query\", sentryQuery.join(\" \"));\n // if (projectSlug) queryParams.set(\"project\", projectSlug);\n\n const apiUrl = `/organizations/${organizationSlug}/events/?${queryParams.toString()}`;\n\n const response = await this.request(apiUrl, undefined, opts);\n\n const body = await response.json();\n return SpansSearchResponseSchema.parse(body).data;\n }\n\n // POST https://us.sentry.io/api/0/issues/5485083130/autofix/\n async startAutofix(\n {\n organizationSlug,\n issueId,\n eventId,\n instruction = \"\",\n }: {\n organizationSlug: string;\n issueId: string;\n eventId?: string;\n instruction?: string;\n },\n opts?: RequestOptions,\n ): Promise<AutofixRun> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/autofix/`,\n {\n method: \"POST\",\n body: JSON.stringify({\n event_id: eventId,\n instruction,\n }),\n },\n opts,\n );\n const body = await response.json();\n return AutofixRunSchema.parse(body);\n }\n\n // GET https://us.sentry.io/api/0/issues/5485083130/autofix/\n async getAutofixState(\n {\n organizationSlug,\n issueId,\n }: {\n organizationSlug: string;\n issueId: string;\n },\n opts?: RequestOptions,\n ): Promise<AutofixRunState> {\n const response = await this.request(\n `/organizations/${organizationSlug}/issues/${issueId}/autofix/`,\n undefined,\n opts,\n );\n const body = await response.json();\n return AutofixRunStateSchema.parse(body);\n }\n}\n"],"mappings":";;;;;;;AAiDA,MAAMA,yBAAiD;CACrD,WAAW;CACX,WAAW;CACX,cAAc;CACd,WAAW;CACX,YAAY;AACb;;;;;;;;;;;;;;;;;;AAmBD,IAAa,WAAb,cAA8B,MAAM;CAClC,YACEC,SACOC,QACP;EAEA,IAAI,eAAe;AACnB,MACE,QAAQ,SACN,2DACD,IACD,QAAQ,SAAS,gDAAgD,CAEjE,gBACE;AAEJ,QAAM,aAAa;EAbZ;CAcR;AACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDD,IAAa,mBAAb,MAA8B;CAC5B,AAAQ;CACR,AAAU;CACV,AAAU;;;;;;;;;;CAWV,YAAY,EACV,cAAc,MACd,OAAO,aAIR,EAAE;AACD,OAAK,cAAc;AACnB,OAAK,OAAO;AACZ,OAAK,aAAa,UAAU,KAAK;CAClC;;;;;;;;;CAUD,QAAQC,MAAc;AACpB,OAAK,OAAO;AACZ,OAAK,aAAa,UAAU,KAAK,KAAK;CACvC;;;;;;;;;;;;;;;;;CAkBD,MAAc,QACZC,MACAC,UAAu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,iBACN;gBACW;;;UAGN;;;;;;;;;;;;YAqDC,iBACN,QAAQ;;;;;;;;;;;;;;;YAkDF,iBAAc;;;;;;;;;;;;;;;;;;;;YAyDd,iBAAc;;;;;;;;;;;;;;;;;;;;YAuDd,iBACN,QAAQ;;;;;;;YAyBF,iBACN,QAAQ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-dsn-D530I7Lr.js","names":["context: ServerContext"],"sources":["../src/tools/create-dsn.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"create_dsn\",\n description: [\n \"Create a new Sentry DSN for a specific project.\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Create a new DSN for a specific project\",\n \"\",\n \"<examples>\",\n \"### Create a new DSN for the 'my-project' project\",\n \"\",\n \"```\",\n \"create_dsn(organizationSlug='my-organization', projectSlug='my-project', name='Production')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If 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 projectSlug: ParamProjectSlug,\n name: z\n .string()\n .trim()\n .describe(\"The name of the DSN to create, for example 'Production'.\"),\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 setTag(\"project.slug\", params.projectSlug);\n\n const clientKey = await apiService.createClientKey({\n organizationSlug,\n projectSlug: params.projectSlug,\n name: params.name,\n });\n let output = `# New DSN in **${organizationSlug}/${params.projectSlug}**\\n\\n`;\n output += `**DSN**: ${clientKey.dsn.public}\\n`;\n output += `**Name**: ${clientKey.name}\\n\\n`;\n output += \"# Using this information\\n\\n\";\n output +=\n \"- The `SENTRY_DSN` value is a URL that you can use to initialize Sentry's SDKs.\\n\";\n return output;\n },\n});\n"],"mappings":";;;;;;;AAWA,yBAAe,WAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB;EAClB,WAAW,eAAe,UAAU;EACpC,aAAa;EACb,MAAM,EACH,QAAQ,CACR,MAAM,CACN,SAAS,2DAA2D;CACxE;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,sBAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,SAAO,qBAAqB,iBAAiB;AAC7C,SAAO,gBAAgB,OAAO,YAAY;EAE1C,MAAM,YAAY,MAAM,WAAW,gBAAgB;GACjD;GACA,aAAa,OAAO;GACpB,MAAM,OAAO;EACd,EAAC;EACF,IAAI,UAAU,iBAAiB,iBAAiB,GAAG,OAAO,YAAY;AACtE,aAAW,WAAW,UAAU,IAAI,OAAO;AAC3C,aAAW,YAAY,UAAU,KAAK;AACtC,YAAU;AACV,YACE;AACF,SAAO;CACR;AACF,EAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-dsn-Dz8nyTFw.cjs","names":["ParamOrganizationSlug","ParamProjectSlug","context: ServerContext"],"sources":["../src/tools/create-dsn.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"create_dsn\",\n description: [\n \"Create a new Sentry DSN for a specific project.\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Create a new DSN for a specific project\",\n \"\",\n \"<examples>\",\n \"### Create a new DSN for the 'my-project' project\",\n \"\",\n \"```\",\n \"create_dsn(organizationSlug='my-organization', projectSlug='my-project', name='Production')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If 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 projectSlug: ParamProjectSlug,\n name: z\n .string()\n .trim()\n .describe(\"The name of the DSN to create, for example 'Production'.\"),\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 setTag(\"project.slug\", params.projectSlug);\n\n const clientKey = await apiService.createClientKey({\n organizationSlug,\n projectSlug: params.projectSlug,\n name: params.name,\n });\n let output = `# New DSN in **${organizationSlug}/${params.projectSlug}**\\n\\n`;\n output += `**DSN**: ${clientKey.dsn.public}\\n`;\n output += `**Name**: ${clientKey.name}\\n\\n`;\n output += \"# Using this information\\n\\n\";\n output +=\n \"- The `SENTRY_DSN` value is a URL that you can use to initialize Sentry's SDKs.\\n\";\n return output;\n },\n});\n"],"mappings":";;;;;;;;AAWA,yBAAe,8BAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkBA;EAClB,WAAW,8BAAe,UAAU;EACpC,aAAaC;EACb,MAAM,MACH,QAAQ,CACR,MAAM,CACN,SAAS,2DAA2D;CACxE;CACD,MAAM,QAAQ,QAAQC,SAAwB;EAC5C,MAAM,aAAa,wCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,4BAAO,qBAAqB,iBAAiB;AAC7C,4BAAO,gBAAgB,OAAO,YAAY;EAE1C,MAAM,YAAY,MAAM,WAAW,gBAAgB;GACjD;GACA,aAAa,OAAO;GACpB,MAAM,OAAO;EACd,EAAC;EACF,IAAI,UAAU,iBAAiB,iBAAiB,GAAG,OAAO,YAAY;AACtE,aAAW,WAAW,UAAU,IAAI,OAAO;AAC3C,aAAW,YAAY,UAAU,KAAK;AACtC,YAAU;AACV,YACE;AACF,SAAO;CACR;AACF,EAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-project-BxzRiryg.cjs","names":["ParamOrganizationSlug","ParamTeamSlug","context: ServerContext","clientKey: ClientKey | null"],"sources":["../src/tools/create-project.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport { logError } from \"../logging\";\nimport type { ServerContext } from \"../types\";\nimport type { ClientKey } from \"../api-client/index\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamTeamSlug,\n ParamPlatform,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"create_project\",\n description: [\n \"Create a new project in Sentry, giving you access to a new SENTRY_DSN.\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Create a new project in a Sentry organization\",\n \"\",\n \"<examples>\",\n \"### Create a new javascript project in the 'my-organization' organization\",\n \"\",\n \"```\",\n \"create_project(organizationSlug='my-organization', teamSlug='my-team', name='my-project', platform='javascript')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<teamSlug>.\",\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 teamSlug: ParamTeamSlug,\n name: z\n .string()\n .trim()\n .describe(\n \"The name of the project to create. Typically this is commonly the name of the repository or service. It is only used as a visual label in Sentry.\",\n ),\n platform: ParamPlatform.optional(),\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 setTag(\"team.slug\", params.teamSlug);\n\n const project = await apiService.createProject({\n organizationSlug,\n teamSlug: params.teamSlug,\n name: params.name,\n platform: params.platform,\n });\n let clientKey: ClientKey | null = null;\n try {\n clientKey = await apiService.createClientKey({\n organizationSlug,\n projectSlug: project.slug,\n name: \"Default\",\n });\n } catch (err) {\n logError(err);\n }\n let output = `# New Project in **${organizationSlug}**\\n\\n`;\n output += `**ID**: ${project.id}\\n`;\n output += `**Slug**: ${project.slug}\\n`;\n output += `**Name**: ${project.name}\\n`;\n if (clientKey) {\n output += `**SENTRY_DSN**: ${clientKey?.dsn.public}\\n\\n`;\n } else {\n output += \"**SENTRY_DSN**: There was an error fetching this value.\\n\\n\";\n }\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the **SENTRY_DSN** value to initialize Sentry's SDKs.\\n`;\n output += `- You should always inform the user of the **SENTRY_DSN** and Project Slug values.\\n`;\n return output;\n },\n});\n"],"mappings":";;;;;;;;;AAcA,6BAAe,8BAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkBA;EAClB,WAAW,8BAAe,UAAU;EACpC,UAAUC;EACV,MAAM,MACH,QAAQ,CACR,MAAM,CACN,SACC,oJACD;EACH,UAAU,6BAAc,UAAU;CACnC;CACD,MAAM,QAAQ,QAAQC,SAAwB;EAC5C,MAAM,aAAa,wCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,4BAAO,qBAAqB,iBAAiB;AAC7C,4BAAO,aAAa,OAAO,SAAS;EAEpC,MAAM,UAAU,MAAM,WAAW,cAAc;GAC7C;GACA,UAAU,OAAO;GACjB,MAAM,OAAO;GACb,UAAU,OAAO;EAClB,EAAC;EACF,IAAIC,YAA8B;AAClC,MAAI;AACF,eAAY,MAAM,WAAW,gBAAgB;IAC3C;IACA,aAAa,QAAQ;IACrB,MAAM;GACP,EAAC;EACH,SAAQ,KAAK;AACZ,4BAAS,IAAI;EACd;EACD,IAAI,UAAU,qBAAqB,iBAAiB;AACpD,aAAW,UAAU,QAAQ,GAAG;AAChC,aAAW,YAAY,QAAQ,KAAK;AACpC,aAAW,YAAY,QAAQ,KAAK;AACpC,MAAI,UACF,YAAW,kBAAkB,WAAW,IAAI,OAAO;MAEnD,WAAU;AAEZ,YAAU;AACV,aAAW;AACX,aAAW;AACX,SAAO;CACR;AACF,EAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-project-K1od5Rhx.js","names":["context: ServerContext","clientKey: ClientKey | null"],"sources":["../src/tools/create-project.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport { logError } from \"../logging\";\nimport type { ServerContext } from \"../types\";\nimport type { ClientKey } from \"../api-client/index\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamTeamSlug,\n ParamPlatform,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"create_project\",\n description: [\n \"Create a new project in Sentry, giving you access to a new SENTRY_DSN.\",\n \"\",\n \"Be careful when using this tool!\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Create a new project in a Sentry organization\",\n \"\",\n \"<examples>\",\n \"### Create a new javascript project in the 'my-organization' organization\",\n \"\",\n \"```\",\n \"create_project(organizationSlug='my-organization', teamSlug='my-team', name='my-project', platform='javascript')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<teamSlug>.\",\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 teamSlug: ParamTeamSlug,\n name: z\n .string()\n .trim()\n .describe(\n \"The name of the project to create. Typically this is commonly the name of the repository or service. It is only used as a visual label in Sentry.\",\n ),\n platform: ParamPlatform.optional(),\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 setTag(\"team.slug\", params.teamSlug);\n\n const project = await apiService.createProject({\n organizationSlug,\n teamSlug: params.teamSlug,\n name: params.name,\n platform: params.platform,\n });\n let clientKey: ClientKey | null = null;\n try {\n clientKey = await apiService.createClientKey({\n organizationSlug,\n projectSlug: project.slug,\n name: \"Default\",\n });\n } catch (err) {\n logError(err);\n }\n let output = `# New Project in **${organizationSlug}**\\n\\n`;\n output += `**ID**: ${project.id}\\n`;\n output += `**Slug**: ${project.slug}\\n`;\n output += `**Name**: ${project.name}\\n`;\n if (clientKey) {\n output += `**SENTRY_DSN**: ${clientKey?.dsn.public}\\n\\n`;\n } else {\n output += \"**SENTRY_DSN**: There was an error fetching this value.\\n\\n\";\n }\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the **SENTRY_DSN** value to initialize Sentry's SDKs.\\n`;\n output += `- You should always inform the user of the **SENTRY_DSN** and Project Slug values.\\n`;\n return output;\n },\n});\n"],"mappings":";;;;;;;;AAcA,6BAAe,WAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB;EAClB,WAAW,eAAe,UAAU;EACpC,UAAU;EACV,MAAM,EACH,QAAQ,CACR,MAAM,CACN,SACC,oJACD;EACH,UAAU,cAAc,UAAU;CACnC;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,sBAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,SAAO,qBAAqB,iBAAiB;AAC7C,SAAO,aAAa,OAAO,SAAS;EAEpC,MAAM,UAAU,MAAM,WAAW,cAAc;GAC7C;GACA,UAAU,OAAO;GACjB,MAAM,OAAO;GACb,UAAU,OAAO;EAClB,EAAC;EACF,IAAIC,YAA8B;AAClC,MAAI;AACF,eAAY,MAAM,WAAW,gBAAgB;IAC3C;IACA,aAAa,QAAQ;IACrB,MAAM;GACP,EAAC;EACH,SAAQ,KAAK;AACZ,YAAS,IAAI;EACd;EACD,IAAI,UAAU,qBAAqB,iBAAiB;AACpD,aAAW,UAAU,QAAQ,GAAG;AAChC,aAAW,YAAY,QAAQ,KAAK;AACpC,aAAW,YAAY,QAAQ,KAAK;AACpC,MAAI,UACF,YAAW,kBAAkB,WAAW,IAAI,OAAO;MAEnD,WAAU;AAEZ,YAAU;AACV,aAAW;AACX,aAAW;AACX,SAAO;CACR;AACF,EAAC"}
|
package/dist/errors-CIoxzIug.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
//#region src/errors.ts
|
|
2
|
-
/**
|
|
3
|
-
* Error thrown when user input validation fails.
|
|
4
|
-
* These errors should be returned to the user directly without logging to Sentry.
|
|
5
|
-
*/
|
|
6
|
-
var UserInputError = class extends Error {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
super(message);
|
|
9
|
-
this.name = "UserInputError";
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
//#endregion
|
|
14
|
-
export { UserInputError };
|
|
15
|
-
//# sourceMappingURL=errors-CIoxzIug.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors-CIoxzIug.js","names":["message: string"],"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) {\n super(message);\n this.name = \"UserInputError\";\n }\n}\n"],"mappings":";;;;;AAIA,IAAa,iBAAb,cAAoC,MAAM;CACxC,YAAYA,SAAiB;AAC3B,QAAM,QAAQ;AACd,OAAK,OAAO;CACb;AACF"}
|
package/dist/errors-YmiXLOyx.cjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/errors.ts
|
|
3
|
-
/**
|
|
4
|
-
* Error thrown when user input validation fails.
|
|
5
|
-
* These errors should be returned to the user directly without logging to Sentry.
|
|
6
|
-
*/
|
|
7
|
-
var UserInputError = class extends Error {
|
|
8
|
-
constructor(message) {
|
|
9
|
-
super(message);
|
|
10
|
-
this.name = "UserInputError";
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
//#endregion
|
|
15
|
-
Object.defineProperty(exports, 'UserInputError', {
|
|
16
|
-
enumerable: true,
|
|
17
|
-
get: function () {
|
|
18
|
-
return UserInputError;
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
//# sourceMappingURL=errors-YmiXLOyx.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors-YmiXLOyx.cjs","names":["message: string"],"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) {\n super(message);\n this.name = \"UserInputError\";\n }\n}\n"],"mappings":";;;;;;AAIA,IAAa,iBAAb,cAAoC,MAAM;CACxC,YAAYA,SAAiB;AAC3B,QAAM,QAAQ;AACd,OAAK,OAAO;CACb;AACF"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//#region src/internal/fetch-utils.ts
|
|
2
|
-
/**
|
|
3
|
-
* Fetch with timeout using AbortController
|
|
4
|
-
* @param url - The URL to fetch
|
|
5
|
-
* @param options - Standard fetch options
|
|
6
|
-
* @param timeoutMs - Timeout in milliseconds (default: 30000)
|
|
7
|
-
* @returns Promise<Response>
|
|
8
|
-
* @throws Error if request times out
|
|
9
|
-
*/
|
|
10
|
-
async function fetchWithTimeout(url, options = {}, timeoutMs = 3e4) {
|
|
11
|
-
const controller = new AbortController();
|
|
12
|
-
const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
|
|
13
|
-
try {
|
|
14
|
-
const response = await fetch(url, {
|
|
15
|
-
...options,
|
|
16
|
-
signal: controller.signal
|
|
17
|
-
});
|
|
18
|
-
return response;
|
|
19
|
-
} catch (error) {
|
|
20
|
-
if (error instanceof Error && error.name === "AbortError") throw new Error(`Request timeout after ${timeoutMs}ms`);
|
|
21
|
-
throw error;
|
|
22
|
-
} finally {
|
|
23
|
-
clearTimeout(timeoutId);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
export { fetchWithTimeout };
|
|
29
|
-
//# sourceMappingURL=fetch-utils-BMKjO-cc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-utils-BMKjO-cc.js","names":["url: string | URL","options: RequestInit"],"sources":["../src/internal/fetch-utils.ts"],"sourcesContent":["/**\n * Fetch with timeout using AbortController\n * @param url - The URL to fetch\n * @param options - Standard fetch options\n * @param timeoutMs - Timeout in milliseconds (default: 30000)\n * @returns Promise<Response>\n * @throws Error if request times out\n */\nexport async function fetchWithTimeout(\n url: string | URL,\n options: RequestInit = {},\n timeoutMs = 30000,\n): Promise<Response> {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), timeoutMs);\n\n try {\n const response = await fetch(url, {\n ...options,\n signal: controller.signal,\n });\n return response;\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n throw new Error(`Request timeout after ${timeoutMs}ms`);\n }\n throw error;\n } finally {\n clearTimeout(timeoutId);\n }\n}\n"],"mappings":";;;;;;;;;AAQA,eAAsB,iBACpBA,KACAC,UAAuB,CAAE,GACzB,YAAY,KACO;CACnB,MAAM,aAAa,IAAI;CACvB,MAAM,YAAY,WAAW,MAAM,WAAW,OAAO,EAAE,UAAU;AAEjE,KAAI;EACF,MAAM,WAAW,MAAM,MAAM,KAAK;GAChC,GAAG;GACH,QAAQ,WAAW;EACpB,EAAC;AACF,SAAO;CACR,SAAQ,OAAO;AACd,MAAI,iBAAiB,SAAS,MAAM,SAAS,aAC3C,OAAM,IAAI,OAAO,wBAAwB,UAAU;AAErD,QAAM;CACP,UAAS;AACR,eAAa,UAAU;CACxB;AACF"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region src/internal/fetch-utils.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Fetch with timeout using AbortController
|
|
4
|
-
* @param url - The URL to fetch
|
|
5
|
-
* @param options - Standard fetch options
|
|
6
|
-
* @param timeoutMs - Timeout in milliseconds (default: 30000)
|
|
7
|
-
* @returns Promise<Response>
|
|
8
|
-
* @throws Error if request times out
|
|
9
|
-
*/
|
|
10
|
-
declare function fetchWithTimeout(url: string | URL, options?: RequestInit, timeoutMs?: number): Promise<Response>;
|
|
11
|
-
//# sourceMappingURL=fetch-utils.d.ts.map
|
|
12
|
-
//#endregion
|
|
13
|
-
export { fetchWithTimeout };
|
|
14
|
-
//# sourceMappingURL=fetch-utils-Bv9WjUp0.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-utils-Bv9WjUp0.d.ts","names":[],"sources":["../src/internal/fetch-utils.ts"],"sourcesContent":[],"mappings":";;AAQA;;;;;;AAIU;iBAJY,gBAAA,eACN,eACL,kCAER,QAAQ"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
//#region src/internal/fetch-utils.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Fetch with timeout using AbortController
|
|
4
|
-
* @param url - The URL to fetch
|
|
5
|
-
* @param options - Standard fetch options
|
|
6
|
-
* @param timeoutMs - Timeout in milliseconds (default: 30000)
|
|
7
|
-
* @returns Promise<Response>
|
|
8
|
-
* @throws Error if request times out
|
|
9
|
-
*/
|
|
10
|
-
declare function fetchWithTimeout(url: string | URL, options?: RequestInit, timeoutMs?: number): Promise<Response>;
|
|
11
|
-
//# sourceMappingURL=fetch-utils.d.ts.map
|
|
12
|
-
//#endregion
|
|
13
|
-
export { fetchWithTimeout };
|
|
14
|
-
//# sourceMappingURL=fetch-utils-DzdRW4Yd.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-utils-DzdRW4Yd.d.cts","names":[],"sources":["../src/internal/fetch-utils.ts"],"sourcesContent":[],"mappings":";;AAQA;;;;;;AAIU;iBAJY,gBAAA,eACN,eACL,kCAER,QAAQ"}
|