@sentry/mcp-server 0.11.0 → 0.13.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/README.md +4 -2
- package/dist/analyze-issue-with-seer-Bq3kefOr.cjs +169 -0
- package/dist/analyze-issue-with-seer-Bq3kefOr.cjs.map +1 -0
- package/dist/analyze-issue-with-seer-Dk0ZFwN8.js +163 -0
- package/dist/analyze-issue-with-seer-Dk0ZFwN8.js.map +1 -0
- package/dist/api-client/client.cjs +2 -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 +2 -2
- package/dist/api-client/index.cjs +10 -2
- package/dist/api-client/index.d.cts +4 -4
- package/dist/api-client/index.d.ts +5 -5
- package/dist/api-client/index.js +5 -5
- package/dist/api-client/schema.cjs +9 -1
- package/dist/api-client/schema.d.cts +2 -2
- package/dist/api-client/schema.d.ts +2 -2
- package/dist/api-client/schema.js +2 -2
- package/dist/api-client/types.d.cts +3 -3
- package/dist/api-client/types.d.ts +3 -3
- package/dist/api-client/types.js +1 -1
- package/dist/api-utils-BJS0CChW.cjs +36 -0
- package/dist/api-utils-BJS0CChW.cjs.map +1 -0
- package/dist/api-utils-BcB1cMXS.js +31 -0
- package/dist/api-utils-BcB1cMXS.js.map +1 -0
- package/dist/client-BNTsOycD.cjs +620 -0
- package/dist/client-BNTsOycD.cjs.map +1 -0
- package/dist/client-BbamPqV4.js +609 -0
- package/dist/client-BbamPqV4.js.map +1 -0
- package/dist/client-Dae1ZwWb.d.cts +556 -0
- package/dist/client-Dae1ZwWb.d.cts.map +1 -0
- package/dist/client-qyEu8fvj.d.ts +556 -0
- package/dist/client-qyEu8fvj.d.ts.map +1 -0
- package/dist/constants-ClkMK29-.cjs +182 -0
- package/dist/constants-ClkMK29-.cjs.map +1 -0
- package/dist/constants-S7AU45oQ.js +164 -0
- package/dist/constants-S7AU45oQ.js.map +1 -0
- package/dist/constants.cjs +5 -0
- package/dist/constants.d.cts +23 -0
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.ts +23 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +3 -0
- package/dist/create-dsn-B3L8iWno.js +59 -0
- package/dist/create-dsn-B3L8iWno.js.map +1 -0
- package/dist/create-dsn-CVPtt_Es.cjs +65 -0
- package/dist/create-dsn-CVPtt_Es.cjs.map +1 -0
- package/dist/create-project-B_6a6okf.cjs +82 -0
- package/dist/create-project-B_6a6okf.cjs.map +1 -0
- package/dist/create-project-DdIXMvWI.js +76 -0
- package/dist/create-project-DdIXMvWI.js.map +1 -0
- package/dist/create-team-BarRdaZK.js +47 -0
- package/dist/create-team-BarRdaZK.js.map +1 -0
- package/dist/create-team-C1DP5Z1r.cjs +53 -0
- package/dist/create-team-C1DP5Z1r.cjs.map +1 -0
- package/dist/defineTool-77H4nSna.js +8 -0
- package/dist/defineTool-77H4nSna.js.map +1 -0
- package/dist/defineTool-lWNTzWl_.cjs +14 -0
- package/dist/defineTool-lWNTzWl_.cjs.map +1 -0
- package/dist/{errors-BJSrT6Ou.js → errors-CIoxzIug.js} +1 -1
- package/dist/{errors-BJSrT6Ou.js.map → errors-CIoxzIug.js.map} +1 -1
- package/dist/{errors-B9fwS-aP.cjs → errors-YmiXLOyx.cjs} +1 -1
- package/dist/{errors-B9fwS-aP.cjs.map → errors-YmiXLOyx.cjs.map} +1 -1
- package/dist/errors.cjs +1 -1
- package/dist/errors.js +1 -1
- package/dist/fetch-utils-B-a92ObC.d.ts +14 -0
- package/dist/fetch-utils-B-a92ObC.d.ts.map +1 -0
- package/dist/fetch-utils-BMKjO-cc.js +29 -0
- package/dist/fetch-utils-BMKjO-cc.js.map +1 -0
- package/dist/fetch-utils-DlPjrSk2.js +0 -0
- package/dist/fetch-utils-DzdRW4Yd.d.cts +14 -0
- package/dist/fetch-utils-DzdRW4Yd.d.cts.map +1 -0
- package/dist/fetch-utils-oab6uNp3.cjs +35 -0
- package/dist/fetch-utils-oab6uNp3.cjs.map +1 -0
- package/dist/find-dsns-BDJWY6nZ.cjs +58 -0
- package/dist/find-dsns-BDJWY6nZ.cjs.map +1 -0
- package/dist/find-dsns-BPbblgrn.js +52 -0
- package/dist/find-dsns-BPbblgrn.js.map +1 -0
- package/dist/find-errors-B9wLxXA0.js +91 -0
- package/dist/find-errors-B9wLxXA0.js.map +1 -0
- package/dist/find-errors-DnFs3PaH.cjs +97 -0
- package/dist/find-errors-DnFs3PaH.cjs.map +1 -0
- package/dist/find-issues-BI1tI3cJ.js +92 -0
- package/dist/find-issues-BI1tI3cJ.js.map +1 -0
- package/dist/find-issues-CwPbwRXK.cjs +98 -0
- package/dist/find-issues-CwPbwRXK.cjs.map +1 -0
- package/dist/find-organizations-CdiouW48.js +45 -0
- package/dist/find-organizations-CdiouW48.js.map +1 -0
- package/dist/find-organizations-DqS6zoTK.cjs +50 -0
- package/dist/find-organizations-DqS6zoTK.cjs.map +1 -0
- package/dist/find-projects-Ba6cdX7n.cjs +45 -0
- package/dist/find-projects-Ba6cdX7n.cjs.map +1 -0
- package/dist/find-projects-Ccfxv47h.js +39 -0
- package/dist/find-projects-Ccfxv47h.js.map +1 -0
- package/dist/find-releases-CFl86XMT.cjs +99 -0
- package/dist/find-releases-CFl86XMT.cjs.map +1 -0
- package/dist/find-releases-CFoGytN-.js +93 -0
- package/dist/find-releases-CFoGytN-.js.map +1 -0
- package/dist/find-tags-ORtYLH5b.js +39 -0
- package/dist/find-tags-ORtYLH5b.js.map +1 -0
- package/dist/find-tags-h2o0BKWO.cjs +45 -0
- package/dist/find-tags-h2o0BKWO.cjs.map +1 -0
- package/dist/find-teams-DUcDfSOl.cjs +45 -0
- package/dist/find-teams-DUcDfSOl.cjs.map +1 -0
- package/dist/find-teams-hreVp1nw.js +39 -0
- package/dist/find-teams-hreVp1nw.js.map +1 -0
- package/dist/find-transactions-BehUqQYs.js +83 -0
- package/dist/find-transactions-BehUqQYs.js.map +1 -0
- package/dist/find-transactions-BkPscam3.cjs +89 -0
- package/dist/find-transactions-BkPscam3.cjs.map +1 -0
- package/dist/formatting-B-u5CbYn.d.ts +47 -0
- package/dist/formatting-B-u5CbYn.d.ts.map +1 -0
- package/dist/formatting-BlMiQa9i.cjs +388 -0
- package/dist/formatting-BlMiQa9i.cjs.map +1 -0
- package/dist/formatting-Di1X9Jn3.d.cts +47 -0
- package/dist/formatting-Di1X9Jn3.d.cts.map +1 -0
- package/dist/formatting-pUm38KOj.js +370 -0
- package/dist/formatting-pUm38KOj.js.map +1 -0
- package/dist/formatting-utils-C3sej5ER.js +14 -0
- package/dist/formatting-utils-C3sej5ER.js.map +1 -0
- package/dist/formatting-utils-DDz14xeB.cjs +20 -0
- package/dist/formatting-utils-DDz14xeB.cjs.map +1 -0
- package/dist/get-doc-AuAW_qr9.cjs +86 -0
- package/dist/get-doc-AuAW_qr9.cjs.map +1 -0
- package/dist/get-doc-BtxZOy7y.js +80 -0
- package/dist/get-doc-BtxZOy7y.js.map +1 -0
- package/dist/get-event-attachment-Bq5lkaKV.cjs +144 -0
- package/dist/get-event-attachment-Bq5lkaKV.cjs.map +1 -0
- package/dist/get-event-attachment-DwAl54zv.js +138 -0
- package/dist/get-event-attachment-DwAl54zv.js.map +1 -0
- package/dist/get-issue-details-DrpD5LlK.js +104 -0
- package/dist/get-issue-details-DrpD5LlK.js.map +1 -0
- package/dist/get-issue-details-qGwu18JX.cjs +110 -0
- package/dist/get-issue-details-qGwu18JX.cjs.map +1 -0
- package/dist/index.cjs +60 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +62 -23
- package/dist/index.js.map +1 -1
- package/dist/internal/fetch-utils.cjs +3 -0
- package/dist/internal/fetch-utils.d.cts +2 -0
- package/dist/internal/fetch-utils.d.ts +2 -0
- package/dist/internal/fetch-utils.js +3 -0
- package/dist/internal/formatting.cjs +1 -1
- package/dist/internal/formatting.d.cts +5 -24
- package/dist/internal/formatting.d.ts +6 -25
- package/dist/internal/formatting.js +1 -1
- package/dist/internal/issue-helpers.cjs +1 -1
- package/dist/internal/issue-helpers.d.cts +2 -44
- package/dist/internal/issue-helpers.d.ts +2 -44
- package/dist/internal/issue-helpers.js +1 -1
- package/dist/internal/test-fixtures.cjs +214 -0
- package/dist/internal/test-fixtures.cjs.map +1 -0
- package/dist/internal/test-fixtures.d.cts +2138 -0
- package/dist/internal/test-fixtures.d.cts.map +1 -0
- package/dist/internal/test-fixtures.d.ts +2138 -0
- package/dist/internal/test-fixtures.d.ts.map +1 -0
- package/dist/internal/test-fixtures.js +205 -0
- package/dist/internal/test-fixtures.js.map +1 -0
- package/dist/issue-helpers-BOn4g7rx.d.ts +52 -0
- package/dist/issue-helpers-BOn4g7rx.d.ts.map +1 -0
- package/dist/{issue-helpers-CSNNO03f.js → issue-helpers-CqqYnwYE.js} +9 -1
- package/dist/issue-helpers-CqqYnwYE.js.map +1 -0
- package/dist/issue-helpers-Cz01Ipvl.d.cts +52 -0
- package/dist/issue-helpers-Cz01Ipvl.d.cts.map +1 -0
- package/dist/{issue-helpers-71XgJVXC.cjs → issue-helpers-DyAIO0w6.cjs} +9 -1
- package/dist/issue-helpers-DyAIO0w6.cjs.map +1 -0
- package/dist/issue-utils-BVAB6I-Z.js +0 -0
- package/dist/issue-utils-pdbo-5LW.cjs +0 -0
- package/dist/{logging-CXLD0FFB.js → logging-LnQMFw-_.js} +1 -1
- package/dist/logging-LnQMFw-_.js.map +1 -0
- package/dist/{logging-ByvSjT6V.cjs → logging-oIouXrcb.cjs} +1 -1
- package/dist/logging-oIouXrcb.cjs.map +1 -0
- package/dist/logging.cjs +1 -1
- package/dist/logging.d.cts +30 -1
- package/dist/logging.d.cts.map +1 -1
- package/dist/logging.d.ts +30 -1
- package/dist/logging.d.ts.map +1 -1
- package/dist/logging.js +1 -1
- package/dist/{promptDefinitions-H0q1_X-K.d.ts → promptDefinitions-6xelipaz.d.ts} +11 -3
- package/dist/promptDefinitions-6xelipaz.d.ts.map +1 -0
- package/dist/{promptDefinitions-D3ll3qCd.cjs → promptDefinitions-C29BWGYg.cjs} +11 -4
- package/dist/promptDefinitions-C29BWGYg.cjs.map +1 -0
- package/dist/{promptDefinitions-aKmUZWWO.js → promptDefinitions-CSKE8T0a.js} +11 -4
- package/dist/promptDefinitions-CSKE8T0a.js.map +1 -0
- package/dist/{promptDefinitions-DMucOchd.d.cts → promptDefinitions-CVHtYaj8.d.cts} +11 -3
- package/dist/promptDefinitions-CVHtYaj8.d.cts.map +1 -0
- package/dist/promptDefinitions.cjs +3 -2
- package/dist/promptDefinitions.d.cts +1 -1
- package/dist/promptDefinitions.d.ts +1 -1
- package/dist/promptDefinitions.js +3 -2
- package/dist/{prompts-CzD0yl7Z.js → prompts-C8Y9w5c4.js} +9 -7
- package/dist/prompts-C8Y9w5c4.js.map +1 -0
- package/dist/{prompts-DMwoay8l.cjs → prompts-Df3i1XSB.cjs} +8 -7
- package/dist/prompts-Df3i1XSB.cjs.map +1 -0
- package/dist/prompts.cjs +2 -1
- package/dist/prompts.d.cts +4 -5
- package/dist/prompts.d.cts.map +1 -1
- package/dist/prompts.d.ts +4 -5
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +2 -1
- package/dist/resources-BHF8a1ZB.js +92 -0
- package/dist/resources-BHF8a1ZB.js.map +1 -0
- package/dist/resources-BM_YQGcb.cjs +104 -0
- package/dist/resources-BM_YQGcb.cjs.map +1 -0
- package/dist/resources.cjs +5 -2
- package/dist/resources.d.cts +30 -7
- package/dist/resources.d.cts.map +1 -1
- package/dist/resources.d.ts +30 -7
- package/dist/resources.d.ts.map +1 -1
- package/dist/resources.js +4 -2
- package/dist/{schema-DqxkW9Tx.d.cts → schema-B5BpplNK.d.ts} +3746 -575
- package/dist/schema-B5BpplNK.d.ts.map +1 -0
- package/dist/{schema-DkyWSqp_.cjs → schema-B_cMyyJJ.cjs} +130 -13
- package/dist/schema-B_cMyyJJ.cjs.map +1 -0
- package/dist/{schema-B8lT632E.cjs → schema-BpJVmev8.cjs} +51 -2
- package/dist/schema-BpJVmev8.cjs.map +1 -0
- package/dist/{schema-C-MLkWMc.d.ts → schema-Dt-HKnd_.d.cts} +3674 -503
- package/dist/schema-Dt-HKnd_.d.cts.map +1 -0
- package/dist/schema-DtsnsxMl.js +36 -0
- package/dist/schema-DtsnsxMl.js.map +1 -0
- package/dist/{schema-CewAKS9A.js → schema-WDk5Yqww.js} +83 -14
- package/dist/schema-WDk5Yqww.js.map +1 -0
- package/dist/schema.cjs +7 -1
- package/dist/schema.d.cts +16 -3
- package/dist/schema.d.cts.map +1 -1
- package/dist/schema.d.ts +16 -3
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +3 -2
- package/dist/search-docs-CrMdRDJy.js +102 -0
- package/dist/search-docs-CrMdRDJy.js.map +1 -0
- package/dist/search-docs-VhefTOOH.cjs +108 -0
- package/dist/search-docs-VhefTOOH.cjs.map +1 -0
- package/dist/seer-utils-Ckr8nYlz.js +87 -0
- package/dist/seer-utils-Ckr8nYlz.js.map +1 -0
- package/dist/seer-utils-CzYEEZb2.cjs +129 -0
- package/dist/seer-utils-CzYEEZb2.cjs.map +1 -0
- package/dist/server-CHG27fcn.cjs +243 -0
- package/dist/server-CHG27fcn.cjs.map +1 -0
- package/dist/server-DeuBftc5.js +237 -0
- package/dist/server-DeuBftc5.js.map +1 -0
- package/dist/server.cjs +40 -13
- package/dist/server.d.cts +22 -4
- package/dist/server.d.cts.map +1 -1
- package/dist/server.d.ts +22 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +42 -15
- package/dist/stdio-BtVdTwx-.cjs +57 -0
- package/dist/stdio-BtVdTwx-.cjs.map +1 -0
- package/dist/stdio-DIuLW5EE.js +51 -0
- package/dist/stdio-DIuLW5EE.js.map +1 -0
- package/dist/test-setup.cjs +1763 -1410
- package/dist/test-setup.cjs.map +1 -1
- package/dist/test-setup.js +1581 -1201
- package/dist/test-setup.js.map +1 -1
- package/dist/toolDefinitions.d.ts +25 -2
- package/dist/toolDefinitions.js +1059 -4
- package/dist/tools/analyze-issue-with-seer.cjs +16 -0
- package/dist/tools/analyze-issue-with-seer.d.cts +16 -0
- package/dist/tools/analyze-issue-with-seer.d.cts.map +1 -0
- package/dist/tools/analyze-issue-with-seer.d.ts +16 -0
- package/dist/tools/analyze-issue-with-seer.d.ts.map +1 -0
- package/dist/tools/analyze-issue-with-seer.js +16 -0
- package/dist/tools/create-dsn.cjs +12 -0
- package/dist/tools/create-dsn.d.cts +15 -0
- package/dist/tools/create-dsn.d.cts.map +1 -0
- package/dist/tools/create-dsn.d.ts +15 -0
- package/dist/tools/create-dsn.d.ts.map +1 -0
- package/dist/tools/create-dsn.js +12 -0
- package/dist/tools/create-project.cjs +13 -0
- package/dist/tools/create-project.d.cts +16 -0
- package/dist/tools/create-project.d.cts.map +1 -0
- package/dist/tools/create-project.d.ts +16 -0
- package/dist/tools/create-project.d.ts.map +1 -0
- package/dist/tools/create-project.js +13 -0
- package/dist/tools/create-team.cjs +12 -0
- package/dist/tools/create-team.d.cts +14 -0
- package/dist/tools/create-team.d.cts.map +1 -0
- package/dist/tools/create-team.d.ts +14 -0
- package/dist/tools/create-team.d.ts.map +1 -0
- package/dist/tools/create-team.js +12 -0
- package/dist/tools/find-dsns.cjs +12 -0
- package/dist/tools/find-dsns.d.cts +14 -0
- package/dist/tools/find-dsns.d.cts.map +1 -0
- package/dist/tools/find-dsns.d.ts +14 -0
- package/dist/tools/find-dsns.d.ts.map +1 -0
- package/dist/tools/find-dsns.js +12 -0
- package/dist/tools/find-errors.cjs +12 -0
- package/dist/tools/find-errors.d.cts +18 -0
- package/dist/tools/find-errors.d.cts.map +1 -0
- package/dist/tools/find-errors.d.ts +18 -0
- package/dist/tools/find-errors.d.ts.map +1 -0
- package/dist/tools/find-errors.js +12 -0
- package/dist/tools/find-issues.cjs +12 -0
- package/dist/tools/find-issues.d.cts +16 -0
- package/dist/tools/find-issues.d.cts.map +1 -0
- package/dist/tools/find-issues.d.ts +16 -0
- package/dist/tools/find-issues.d.ts.map +1 -0
- package/dist/tools/find-issues.js +12 -0
- package/dist/tools/find-organizations.cjs +10 -0
- package/dist/tools/find-organizations.d.cts +9 -0
- package/dist/tools/find-organizations.d.cts.map +1 -0
- package/dist/tools/find-organizations.d.ts +9 -0
- package/dist/tools/find-organizations.d.ts.map +1 -0
- package/dist/tools/find-organizations.js +10 -0
- package/dist/tools/find-projects.cjs +12 -0
- package/dist/tools/find-projects.d.cts +13 -0
- package/dist/tools/find-projects.d.cts.map +1 -0
- package/dist/tools/find-projects.d.ts +13 -0
- package/dist/tools/find-projects.d.ts.map +1 -0
- package/dist/tools/find-projects.js +12 -0
- package/dist/tools/find-releases.cjs +12 -0
- package/dist/tools/find-releases.d.cts +15 -0
- package/dist/tools/find-releases.d.cts.map +1 -0
- package/dist/tools/find-releases.d.ts +15 -0
- package/dist/tools/find-releases.d.ts.map +1 -0
- package/dist/tools/find-releases.js +12 -0
- package/dist/tools/find-tags.cjs +12 -0
- package/dist/tools/find-tags.d.cts +13 -0
- package/dist/tools/find-tags.d.cts.map +1 -0
- package/dist/tools/find-tags.d.ts +13 -0
- package/dist/tools/find-tags.d.ts.map +1 -0
- package/dist/tools/find-tags.js +12 -0
- package/dist/tools/find-teams.cjs +12 -0
- package/dist/tools/find-teams.d.cts +13 -0
- package/dist/tools/find-teams.d.cts.map +1 -0
- package/dist/tools/find-teams.d.ts +13 -0
- package/dist/tools/find-teams.d.ts.map +1 -0
- package/dist/tools/find-teams.js +12 -0
- package/dist/tools/find-transactions.cjs +12 -0
- package/dist/tools/find-transactions.d.cts +17 -0
- package/dist/tools/find-transactions.d.cts.map +1 -0
- package/dist/tools/find-transactions.d.ts +17 -0
- package/dist/tools/find-transactions.d.ts.map +1 -0
- package/dist/tools/find-transactions.js +12 -0
- package/dist/tools/get-doc.cjs +11 -0
- package/dist/tools/get-doc.d.cts +12 -0
- package/dist/tools/get-doc.d.cts.map +1 -0
- package/dist/tools/get-doc.d.ts +12 -0
- package/dist/tools/get-doc.d.ts.map +1 -0
- package/dist/tools/get-doc.js +11 -0
- package/dist/tools/get-event-attachment.cjs +12 -0
- package/dist/tools/get-event-attachment.d.cts +16 -0
- package/dist/tools/get-event-attachment.d.cts.map +1 -0
- package/dist/tools/get-event-attachment.d.ts +16 -0
- package/dist/tools/get-event-attachment.d.ts.map +1 -0
- package/dist/tools/get-event-attachment.js +12 -0
- package/dist/tools/get-issue-details.cjs +15 -0
- package/dist/tools/get-issue-details.d.cts +16 -0
- package/dist/tools/get-issue-details.d.cts.map +1 -0
- package/dist/tools/get-issue-details.d.ts +16 -0
- package/dist/tools/get-issue-details.d.ts.map +1 -0
- package/dist/tools/get-issue-details.js +15 -0
- package/dist/tools/index.cjs +40 -0
- package/dist/tools/index.d.cts +127 -0
- package/dist/tools/index.d.cts.map +1 -0
- package/dist/tools/index.d.ts +127 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +40 -0
- package/dist/tools/search-docs.cjs +12 -0
- package/dist/tools/search-docs.d.cts +14 -0
- package/dist/tools/search-docs.d.cts.map +1 -0
- package/dist/tools/search-docs.d.ts +14 -0
- package/dist/tools/search-docs.d.ts.map +1 -0
- package/dist/tools/search-docs.js +12 -0
- package/dist/tools/types.cjs +0 -0
- package/dist/tools/types.d.cts +4 -0
- package/dist/tools/types.d.ts +4 -0
- package/dist/tools/types.js +0 -0
- package/dist/tools/update-issue.cjs +16 -0
- package/dist/tools/update-issue.d.cts +17 -0
- package/dist/tools/update-issue.d.cts.map +1 -0
- package/dist/tools/update-issue.d.ts +17 -0
- package/dist/tools/update-issue.d.ts.map +1 -0
- package/dist/tools/update-issue.js +16 -0
- package/dist/tools/update-project.cjs +13 -0
- package/dist/tools/update-project.d.cts +18 -0
- package/dist/tools/update-project.d.cts.map +1 -0
- package/dist/tools/update-project.d.ts +18 -0
- package/dist/tools/update-project.d.ts.map +1 -0
- package/dist/tools/update-project.js +13 -0
- package/dist/tools/utils/api-utils.cjs +8 -0
- package/dist/tools/utils/api-utils.d.cts +24 -0
- package/dist/tools/utils/api-utils.d.cts.map +1 -0
- package/dist/tools/utils/api-utils.d.ts +24 -0
- package/dist/tools/utils/api-utils.d.ts.map +1 -0
- package/dist/tools/utils/api-utils.js +8 -0
- package/dist/tools/utils/defineTool.cjs +3 -0
- package/dist/tools/utils/defineTool.d.cts +12 -0
- package/dist/tools/utils/defineTool.d.cts.map +1 -0
- package/dist/tools/utils/defineTool.d.ts +12 -0
- package/dist/tools/utils/defineTool.d.ts.map +1 -0
- package/dist/tools/utils/defineTool.js +3 -0
- package/dist/tools/utils/fetch-utils.cjs +4 -0
- package/dist/tools/utils/fetch-utils.d.cts +2 -0
- package/dist/tools/utils/fetch-utils.d.ts +2 -0
- package/dist/tools/utils/fetch-utils.js +4 -0
- package/dist/tools/utils/formatting-utils.cjs +3 -0
- package/dist/tools/utils/formatting-utils.d.cts +15 -0
- package/dist/tools/utils/formatting-utils.d.cts.map +1 -0
- package/dist/tools/utils/formatting-utils.d.ts +15 -0
- package/dist/tools/utils/formatting-utils.d.ts.map +1 -0
- package/dist/tools/utils/formatting-utils.js +3 -0
- package/dist/tools/utils/issue-utils.cjs +6 -0
- package/dist/tools/utils/issue-utils.d.cts +7 -0
- package/dist/tools/utils/issue-utils.d.ts +7 -0
- package/dist/tools/utils/issue-utils.js +5 -0
- package/dist/tools/utils/seer-utils.cjs +9 -0
- package/dist/tools/utils/seer-utils.d.cts +28 -0
- package/dist/tools/utils/seer-utils.d.cts.map +1 -0
- package/dist/tools/utils/seer-utils.d.ts +28 -0
- package/dist/tools/utils/seer-utils.d.ts.map +1 -0
- package/dist/tools/utils/seer-utils.js +3 -0
- package/dist/tools/whoami.cjs +10 -0
- package/dist/tools/whoami.d.cts +9 -0
- package/dist/tools/whoami.d.cts.map +1 -0
- package/dist/tools/whoami.d.ts +9 -0
- package/dist/tools/whoami.d.ts.map +1 -0
- package/dist/tools/whoami.js +10 -0
- package/dist/tools-BiZ7ZDKf.cjs +53 -0
- package/dist/tools-BiZ7ZDKf.cjs.map +1 -0
- package/dist/tools-DGF9GhbP.js +48 -0
- package/dist/tools-DGF9GhbP.js.map +1 -0
- package/dist/transports/stdio.cjs +42 -14
- package/dist/transports/stdio.d.cts +25 -4
- package/dist/transports/stdio.d.cts.map +1 -1
- package/dist/transports/stdio.d.ts +25 -4
- package/dist/transports/stdio.d.ts.map +1 -1
- package/dist/transports/stdio.js +44 -16
- package/dist/types-B2qOfefC.d.ts +29 -0
- package/dist/types-B2qOfefC.d.ts.map +1 -0
- package/dist/{types-DuUmV9zh.d.ts → types-Br0saqtE.d.ts} +7 -3
- package/dist/types-Br0saqtE.d.ts.map +1 -0
- package/dist/{types-CcffrLXB.d.cts → types-C3pRFQyA.d.cts} +7 -3
- package/dist/types-C3pRFQyA.d.cts.map +1 -0
- package/dist/types-CCHsZshF.js +0 -0
- package/dist/types-CYjev2Ep.d.cts +29 -0
- package/dist/types-CYjev2Ep.d.cts.map +1 -0
- package/dist/types-CZaMk5Yg.d.cts +29 -0
- package/dist/types-CZaMk5Yg.d.cts.map +1 -0
- package/dist/types-D5KkaSjc.d.ts +29 -0
- package/dist/types-D5KkaSjc.d.ts.map +1 -0
- package/dist/types.d.cts +3 -4
- package/dist/types.d.ts +3 -4
- package/dist/update-issue-Bz-u_Yaa.cjs +115 -0
- package/dist/update-issue-Bz-u_Yaa.cjs.map +1 -0
- package/dist/update-issue-DN80uuKU.js +109 -0
- package/dist/update-issue-DN80uuKU.js.map +1 -0
- package/dist/update-project-5j-SOHWU.js +120 -0
- package/dist/update-project-5j-SOHWU.js.map +1 -0
- package/dist/update-project-C7Xbmhqg.cjs +126 -0
- package/dist/update-project-C7Xbmhqg.cjs.map +1 -0
- package/dist/version-DvMKCu-i.js +6 -0
- package/dist/version-DvMKCu-i.js.map +1 -0
- package/dist/{version-CRzAHHGZ.cjs → version-Dyz6_b54.cjs} +2 -2
- package/dist/version-Dyz6_b54.cjs.map +1 -0
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/dist/whoami-qIbcECMA.cjs +28 -0
- package/dist/whoami-qIbcECMA.cjs.map +1 -0
- package/dist/whoami-raA70UBD.js +23 -0
- package/dist/whoami-raA70UBD.js.map +1 -0
- package/package.json +24 -14
- package/dist/api-client/client.test.cjs +0 -33
- package/dist/api-client/client.test.cjs.map +0 -1
- package/dist/api-client/client.test.d.ts +0 -1
- package/dist/api-client/client.test.js +0 -33
- package/dist/api-client/client.test.js.map +0 -1
- package/dist/chunk-BLXvPPr8.js +0 -30
- package/dist/client-Bxf4MxOz.d.cts +0 -179
- package/dist/client-Bxf4MxOz.d.cts.map +0 -1
- package/dist/client-D5xFZtxK.js +0 -224
- package/dist/client-D5xFZtxK.js.map +0 -1
- package/dist/client-DOhBiaMJ.d.ts +0 -179
- package/dist/client-DOhBiaMJ.d.ts.map +0 -1
- package/dist/client-GKHZSXgV.cjs +0 -235
- package/dist/client-GKHZSXgV.cjs.map +0 -1
- package/dist/dist-BlIWGSIM.cjs +0 -8197
- package/dist/dist-BlIWGSIM.cjs.map +0 -1
- package/dist/dist-DDpQABxe.js +0 -8054
- package/dist/dist-DDpQABxe.js.map +0 -1
- package/dist/errors.test.cjs +0 -24
- package/dist/errors.test.cjs.map +0 -1
- package/dist/errors.test.d.cts +0 -1
- package/dist/errors.test.d.ts +0 -1
- package/dist/errors.test.js +0 -24
- package/dist/errors.test.js.map +0 -1
- package/dist/formatting-BaARL2gT.js +0 -68
- package/dist/formatting-BaARL2gT.js.map +0 -1
- package/dist/formatting-C2kN0ok6.cjs +0 -86
- package/dist/formatting-C2kN0ok6.cjs.map +0 -1
- package/dist/index-h64gcVNJ.d.ts +0 -1
- package/dist/internal/formatting.d.cts.map +0 -1
- package/dist/internal/formatting.d.ts.map +0 -1
- package/dist/internal/issue-helpers.d.cts.map +0 -1
- package/dist/internal/issue-helpers.d.ts.map +0 -1
- package/dist/internal/issue-helpers.test.cjs +0 -110
- package/dist/internal/issue-helpers.test.cjs.map +0 -1
- package/dist/internal/issue-helpers.test.d.cts +0 -1
- package/dist/internal/issue-helpers.test.d.ts +0 -1
- package/dist/internal/issue-helpers.test.js +0 -110
- package/dist/internal/issue-helpers.test.js.map +0 -1
- package/dist/issue-helpers-71XgJVXC.cjs.map +0 -1
- package/dist/issue-helpers-CSNNO03f.js.map +0 -1
- package/dist/logging-ByvSjT6V.cjs.map +0 -1
- package/dist/logging-CXLD0FFB.js.map +0 -1
- package/dist/magic-string.es-CybcVAw7.cjs +0 -1016
- package/dist/magic-string.es-CybcVAw7.cjs.map +0 -1
- package/dist/magic-string.es-DY8GVHw9.js +0 -1015
- package/dist/magic-string.es-DY8GVHw9.js.map +0 -1
- package/dist/promptDefinitions-D3ll3qCd.cjs.map +0 -1
- package/dist/promptDefinitions-DMucOchd.d.cts.map +0 -1
- package/dist/promptDefinitions-H0q1_X-K.d.ts.map +0 -1
- package/dist/promptDefinitions-aKmUZWWO.js.map +0 -1
- package/dist/prompts-CzD0yl7Z.js.map +0 -1
- package/dist/prompts-DMwoay8l.cjs.map +0 -1
- package/dist/resources-D6TW2ER0.cjs +0 -32
- package/dist/resources-D6TW2ER0.cjs.map +0 -1
- package/dist/resources-x-GaokG8.js +0 -26
- package/dist/resources-x-GaokG8.js.map +0 -1
- package/dist/schema-B8lT632E.cjs.map +0 -1
- package/dist/schema-BkHf97d7.js +0 -17
- package/dist/schema-BkHf97d7.js.map +0 -1
- package/dist/schema-C-MLkWMc.d.ts.map +0 -1
- package/dist/schema-CewAKS9A.js.map +0 -1
- package/dist/schema-DkyWSqp_.cjs.map +0 -1
- package/dist/schema-DqxkW9Tx.d.cts.map +0 -1
- package/dist/server-pGtEIwE3.cjs +0 -148
- package/dist/server-pGtEIwE3.cjs.map +0 -1
- package/dist/server-qpWdf-ST.js +0 -142
- package/dist/server-qpWdf-ST.js.map +0 -1
- package/dist/stdio-D8u2W847.js +0 -19
- package/dist/stdio-D8u2W847.js.map +0 -1
- package/dist/stdio-DydB2Pxu.cjs +0 -25
- package/dist/stdio-DydB2Pxu.cjs.map +0 -1
- package/dist/toolDefinitions-BSC2D_S-.js +0 -430
- package/dist/toolDefinitions-BSC2D_S-.js.map +0 -1
- package/dist/toolDefinitions-BtHN8t_d.cjs +0 -436
- package/dist/toolDefinitions-BtHN8t_d.cjs.map +0 -1
- package/dist/toolDefinitions-Dp13BpEu.d.cts +0 -296
- package/dist/toolDefinitions-Dp13BpEu.d.cts.map +0 -1
- package/dist/toolDefinitions-fQrpWznJ.d.ts +0 -296
- package/dist/toolDefinitions-fQrpWznJ.d.ts.map +0 -1
- package/dist/toolDefinitions.cjs +0 -4
- package/dist/toolDefinitions.d.cts +0 -2
- package/dist/toolDefinitions.test.cjs +0 -15
- package/dist/toolDefinitions.test.cjs.map +0 -1
- package/dist/toolDefinitions.test.d.cts +0 -1
- package/dist/toolDefinitions.test.d.ts +0 -1
- package/dist/toolDefinitions.test.js +0 -15
- package/dist/toolDefinitions.test.js.map +0 -1
- package/dist/tools-4Rtn4WEf.js +0 -470
- package/dist/tools-4Rtn4WEf.js.map +0 -1
- package/dist/tools-DHHqAqP9.cjs +0 -476
- package/dist/tools-DHHqAqP9.cjs.map +0 -1
- package/dist/tools.cjs +0 -11
- package/dist/tools.d.cts +0 -251
- package/dist/tools.d.cts.map +0 -1
- package/dist/tools.d.ts +0 -251
- package/dist/tools.d.ts.map +0 -1
- package/dist/tools.js +0 -11
- package/dist/tools.test.cjs +0 -1018
- package/dist/tools.test.cjs.map +0 -1
- package/dist/tools.test.d.cts +0 -1
- package/dist/tools.test.d.ts +0 -1
- package/dist/tools.test.js +0 -1018
- package/dist/tools.test.js.map +0 -1
- package/dist/types-CbLyQvVe.d.cts +0 -38
- package/dist/types-CbLyQvVe.d.cts.map +0 -1
- package/dist/types-CcffrLXB.d.cts.map +0 -1
- package/dist/types-CfJ51LyL.d.ts +0 -38
- package/dist/types-CfJ51LyL.d.ts.map +0 -1
- package/dist/types-DuUmV9zh.d.ts.map +0 -1
- package/dist/version-BT9r_3jm.js +0 -6
- package/dist/version-BT9r_3jm.js.map +0 -1
- package/dist/version-CRzAHHGZ.cjs.map +0 -1
- package/dist/vi.bdSIJ99Y-BfJr7I2s.js +0 -6349
- package/dist/vi.bdSIJ99Y-BfJr7I2s.js.map +0 -1
- package/dist/vi.bdSIJ99Y-Dft_B_Ta.cjs +0 -6355
- package/dist/vi.bdSIJ99Y-Dft_B_Ta.cjs.map +0 -1
- /package/dist/{api-client-CNv_hbPO.js → api-client-ChL_0F2u.js} +0 -0
- /package/dist/{types-6zHoEWAx.js → fetch-utils-C0F4eH6S.cjs} +0 -0
- /package/dist/{api-client/client.test.d.cts → index-BrojxuhJ.d.ts} +0 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-DWy1uDak.cjs');
|
|
2
|
+
const require_defineTool = require('./defineTool-lWNTzWl_.cjs');
|
|
3
|
+
const require_client = require('./client-BNTsOycD.cjs');
|
|
4
|
+
const require_schema = require('./schema-BpJVmev8.cjs');
|
|
5
|
+
const require_fetch_utils = require('./fetch-utils-oab6uNp3.cjs');
|
|
6
|
+
const zod = require_chunk.__toESM(require("zod"));
|
|
7
|
+
|
|
8
|
+
//#region src/tools/search-docs.ts
|
|
9
|
+
var search_docs_default = require_defineTool.defineTool({
|
|
10
|
+
name: "search_docs",
|
|
11
|
+
description: [
|
|
12
|
+
"Search Sentry documentation for SDK setup, instrumentation, and configuration guidance.",
|
|
13
|
+
"",
|
|
14
|
+
"Use this tool when you need to:",
|
|
15
|
+
"- Set up Sentry SDK in any language (Python, JavaScript, Go, Ruby, etc.)",
|
|
16
|
+
"- Configure specific features like performance monitoring, error sampling, or release tracking",
|
|
17
|
+
"- Implement custom instrumentation (spans, transactions, breadcrumbs)",
|
|
18
|
+
"- Set up integrations with frameworks (Django, Flask, Express, Next.js, etc.)",
|
|
19
|
+
"- Configure data scrubbing, filtering, or sampling rules",
|
|
20
|
+
"- Troubleshoot SDK issues or find best practices",
|
|
21
|
+
"",
|
|
22
|
+
"This tool searches technical documentation, NOT general information about Sentry as a company.",
|
|
23
|
+
"",
|
|
24
|
+
"<examples>",
|
|
25
|
+
"### Setting up Sentry in a Python Django app",
|
|
26
|
+
"",
|
|
27
|
+
"```",
|
|
28
|
+
"search_docs(query='Django setup configuration SENTRY_DSN', guide='python/django')",
|
|
29
|
+
"```",
|
|
30
|
+
"",
|
|
31
|
+
"### Setting up source maps for Next.js",
|
|
32
|
+
"",
|
|
33
|
+
"```",
|
|
34
|
+
"search_docs(query='source maps webpack upload', guide='javascript/nextjs')",
|
|
35
|
+
"```",
|
|
36
|
+
"",
|
|
37
|
+
"### Configuring release tracking",
|
|
38
|
+
"",
|
|
39
|
+
"```",
|
|
40
|
+
"search_docs(query='release tracking deployment integration CI/CD')",
|
|
41
|
+
"```",
|
|
42
|
+
"</examples>",
|
|
43
|
+
"",
|
|
44
|
+
"<hints>",
|
|
45
|
+
"- Use guide parameter to filter results to specific technologies (e.g., 'javascript' or 'javascript/nextjs')",
|
|
46
|
+
"- Include the programming language/framework in your query for SDK-specific results",
|
|
47
|
+
"- Use technical terms like 'instrumentation', 'spans', 'transactions' for performance docs",
|
|
48
|
+
"- Include specific feature names like 'beforeSend', 'tracesSampleRate', 'SENTRY_DSN'",
|
|
49
|
+
"</hints>"
|
|
50
|
+
].join("\n"),
|
|
51
|
+
inputSchema: {
|
|
52
|
+
query: zod.z.string().trim().min(2, "Search query is too short. Please provide at least 2 characters.").max(200, "Search query is too long. Please keep your query under 200 characters.").describe("The search query in natural language. Be specific about what you're looking for."),
|
|
53
|
+
maxResults: zod.z.number().int().min(1).max(10).default(3).describe("Maximum number of results to return (1-10)").optional(),
|
|
54
|
+
guide: require_schema.ParamSentryGuide.optional()
|
|
55
|
+
},
|
|
56
|
+
async handler(params, context) {
|
|
57
|
+
let output = `# Documentation Search Results\n\n`;
|
|
58
|
+
output += `**Query**: "${params.query}"\n`;
|
|
59
|
+
if (params.guide) output += `**Guide**: ${params.guide}\n`;
|
|
60
|
+
output += `\n`;
|
|
61
|
+
const host = context.mcpHost || "https://mcp.sentry.dev";
|
|
62
|
+
const searchUrl = new URL("/api/search", host);
|
|
63
|
+
const response = await require_fetch_utils.fetchWithTimeout(searchUrl.toString(), {
|
|
64
|
+
method: "POST",
|
|
65
|
+
headers: { "Content-Type": "application/json" },
|
|
66
|
+
body: JSON.stringify({
|
|
67
|
+
query: params.query,
|
|
68
|
+
maxResults: params.maxResults,
|
|
69
|
+
guide: params.guide
|
|
70
|
+
})
|
|
71
|
+
}, 15e3);
|
|
72
|
+
if (!response.ok) {
|
|
73
|
+
const errorData = await response.json().catch(() => null);
|
|
74
|
+
const errorMessage = errorData?.error || `Search failed with status ${response.status}`;
|
|
75
|
+
throw new require_client.ApiError(errorMessage, response.status);
|
|
76
|
+
}
|
|
77
|
+
const data = await response.json();
|
|
78
|
+
if ("error" in data && data.error) {
|
|
79
|
+
output += `**Error**: ${data.error}\n\n`;
|
|
80
|
+
return output;
|
|
81
|
+
}
|
|
82
|
+
if (data.results.length === 0) {
|
|
83
|
+
output += "No documentation found matching your query.\n\n";
|
|
84
|
+
return output;
|
|
85
|
+
}
|
|
86
|
+
output += `Found ${data.results.length} match${data.results.length === 1 ? "" : "es"}\n\n`;
|
|
87
|
+
output += `These are just snippets. Use \`get_doc(path='...')\` to fetch the full content.\n\n`;
|
|
88
|
+
for (const [index, result] of data.results.entries()) {
|
|
89
|
+
output += `## ${index + 1}. ${result.url}\n\n`;
|
|
90
|
+
output += `**Path**: ${result.id}\n`;
|
|
91
|
+
output += `**Relevance**: ${(result.relevance * 100).toFixed(1)}%\n\n`;
|
|
92
|
+
if (index < 3) {
|
|
93
|
+
output += "**Matching Context**\n";
|
|
94
|
+
output += `> ${result.snippet.replace(/\n/g, "\n> ")}\n\n`;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return output;
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
//#endregion
|
|
102
|
+
Object.defineProperty(exports, 'search_docs_default', {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () {
|
|
105
|
+
return search_docs_default;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
//# sourceMappingURL=search-docs-VhefTOOH.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search-docs-VhefTOOH.cjs","names":["context: ServerContext","ApiError"],"sources":["../src/tools/search-docs.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { fetchWithTimeout } from \"./utils/fetch-utils\";\nimport { ApiError } from \"../api-client/index\";\nimport type { ServerContext } from \"../types\";\nimport type { SearchResponse } from \"./types\";\nimport { ParamSentryGuide } from \"../schema\";\n\nexport default defineTool({\n name: \"search_docs\",\n description: [\n \"Search Sentry documentation for SDK setup, instrumentation, and configuration guidance.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Set up Sentry SDK in any language (Python, JavaScript, Go, Ruby, etc.)\",\n \"- Configure specific features like performance monitoring, error sampling, or release tracking\",\n \"- Implement custom instrumentation (spans, transactions, breadcrumbs)\",\n \"- Set up integrations with frameworks (Django, Flask, Express, Next.js, etc.)\",\n \"- Configure data scrubbing, filtering, or sampling rules\",\n \"- Troubleshoot SDK issues or find best practices\",\n \"\",\n \"This tool searches technical documentation, NOT general information about Sentry as a company.\",\n \"\",\n \"<examples>\",\n \"### Setting up Sentry in a Python Django app\",\n \"\",\n \"```\",\n \"search_docs(query='Django setup configuration SENTRY_DSN', guide='python/django')\",\n \"```\",\n \"\",\n \"### Setting up source maps for Next.js\",\n \"\",\n \"```\",\n \"search_docs(query='source maps webpack upload', guide='javascript/nextjs')\",\n \"```\",\n \"\",\n \"### Configuring release tracking\",\n \"\",\n \"```\",\n \"search_docs(query='release tracking deployment integration CI/CD')\",\n \"```\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- Use guide parameter to filter results to specific technologies (e.g., 'javascript' or 'javascript/nextjs')\",\n \"- Include the programming language/framework in your query for SDK-specific results\",\n \"- Use technical terms like 'instrumentation', 'spans', 'transactions' for performance docs\",\n \"- Include specific feature names like 'beforeSend', 'tracesSampleRate', 'SENTRY_DSN'\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n query: z\n .string()\n .trim()\n .min(\n 2,\n \"Search query is too short. Please provide at least 2 characters.\",\n )\n .max(\n 200,\n \"Search query is too long. Please keep your query under 200 characters.\",\n )\n .describe(\n \"The search query in natural language. Be specific about what you're looking for.\",\n ),\n maxResults: z\n .number()\n .int()\n .min(1)\n .max(10)\n .default(3)\n .describe(\"Maximum number of results to return (1-10)\")\n .optional(),\n guide: ParamSentryGuide.optional(),\n },\n async handler(params, context: ServerContext) {\n let output = `# Documentation Search Results\\n\\n`;\n output += `**Query**: \"${params.query}\"\\n`;\n if (params.guide) {\n output += `**Guide**: ${params.guide}\\n`;\n }\n output += `\\n`;\n\n // Determine the host - use context.host if available, then check env var, otherwise default to production\n const host = context.mcpHost || \"https://mcp.sentry.dev\";\n const searchUrl = new URL(\"/api/search\", host);\n\n const response = await fetchWithTimeout(\n searchUrl.toString(),\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n query: params.query,\n maxResults: params.maxResults,\n guide: params.guide,\n }),\n },\n 15000, // 15 second timeout\n );\n\n if (!response.ok) {\n // TODO: improve error responses with types\n const errorData = (await response.json().catch(() => null)) as {\n error?: string;\n } | null;\n\n const errorMessage =\n errorData?.error || `Search failed with status ${response.status}`;\n throw new ApiError(errorMessage, response.status);\n }\n\n const data = (await response.json()) as SearchResponse;\n\n // Handle error in response\n if (\"error\" in data && data.error) {\n output += `**Error**: ${data.error}\\n\\n`;\n return output;\n }\n\n // Display results\n if (data.results.length === 0) {\n output += \"No documentation found matching your query.\\n\\n\";\n return output;\n }\n\n output += `Found ${data.results.length} match${data.results.length === 1 ? \"\" : \"es\"}\\n\\n`;\n\n output += `These are just snippets. Use \\`get_doc(path='...')\\` to fetch the full content.\\n\\n`;\n\n for (const [index, result] of data.results.entries()) {\n output += `## ${index + 1}. ${result.url}\\n\\n`;\n output += `**Path**: ${result.id}\\n`;\n output += `**Relevance**: ${(result.relevance * 100).toFixed(1)}%\\n\\n`;\n if (index < 3) {\n output += \"**Matching Context**\\n\";\n output += `> ${result.snippet.replace(/\\n/g, \"\\n> \")}\\n\\n`;\n }\n }\n\n return output;\n },\n});\n"],"mappings":";;;;;;;;AAQA,0BAAe,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;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,OAAO,MACJ,QAAQ,CACR,MAAM,CACN,IACC,GACA,mEACD,CACA,IACC,KACA,yEACD,CACA,SACC,mFACD;EACH,YAAY,MACT,QAAQ,CACR,KAAK,CACL,IAAI,EAAE,CACN,IAAI,GAAG,CACP,QAAQ,EAAE,CACV,SAAS,6CAA6C,CACtD,UAAU;EACb,OAAO,gCAAiB,UAAU;CACnC;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,IAAI,UAAU;AACd,aAAW,cAAc,OAAO,MAAM;AACtC,MAAI,OAAO,MACT,YAAW,aAAa,OAAO,MAAM;AAEvC,aAAW;EAGX,MAAM,OAAO,QAAQ,WAAW;EAChC,MAAM,YAAY,IAAI,IAAI,eAAe;EAEzC,MAAM,WAAW,MAAM,qCACrB,UAAU,UAAU,EACpB;GACE,QAAQ;GACR,SAAS,EACP,gBAAgB,mBACjB;GACD,MAAM,KAAK,UAAU;IACnB,OAAO,OAAO;IACd,YAAY,OAAO;IACnB,OAAO,OAAO;GACf,EAAC;EACH,GACD,KACD;AAED,OAAK,SAAS,IAAI;GAEhB,MAAM,YAAa,MAAM,SAAS,MAAM,CAAC,MAAM,MAAM,KAAK;GAI1D,MAAM,eACJ,WAAW,UAAU,4BAA4B,SAAS;AAC5D,SAAM,IAAIC,wBAAS,cAAc,SAAS;EAC3C;EAED,MAAM,OAAQ,MAAM,SAAS,MAAM;AAGnC,MAAI,WAAW,QAAQ,KAAK,OAAO;AACjC,cAAW,aAAa,KAAK,MAAM;AACnC,UAAO;EACR;AAGD,MAAI,KAAK,QAAQ,WAAW,GAAG;AAC7B,aAAU;AACV,UAAO;EACR;AAED,aAAW,QAAQ,KAAK,QAAQ,OAAO,QAAQ,KAAK,QAAQ,WAAW,IAAI,KAAK,KAAK;AAErF,aAAW;AAEX,OAAK,MAAM,CAAC,OAAO,OAAO,IAAI,KAAK,QAAQ,SAAS,EAAE;AACpD,cAAW,KAAK,QAAQ,EAAE,IAAI,OAAO,IAAI;AACzC,cAAW,YAAY,OAAO,GAAG;AACjC,cAAW,iBAAiB,CAAC,OAAO,YAAY,KAAK,QAAQ,EAAE,CAAC;AAChE,OAAI,QAAQ,GAAG;AACb,cAAU;AACV,eAAW,IAAI,OAAO,QAAQ,QAAQ,OAAO,OAAO,CAAC;GACtD;EACF;AAED,SAAO;CACR;AACF,EAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
//#region src/tools/utils/seer-utils.ts
|
|
2
|
+
const SEER_POLLING_INTERVAL = 5e3;
|
|
3
|
+
const SEER_TIMEOUT = 5 * 60 * 1e3;
|
|
4
|
+
function getStatusDisplayName(status) {
|
|
5
|
+
switch (status) {
|
|
6
|
+
case "COMPLETED": return "Complete";
|
|
7
|
+
case "FAILED":
|
|
8
|
+
case "ERROR": return "Failed";
|
|
9
|
+
case "CANCELLED": return "Cancelled";
|
|
10
|
+
case "NEED_MORE_INFORMATION": return "Needs More Information";
|
|
11
|
+
case "WAITING_FOR_USER_RESPONSE": return "Waiting for Response";
|
|
12
|
+
case "PROCESSING": return "Processing";
|
|
13
|
+
case "IN_PROGRESS": return "In Progress";
|
|
14
|
+
default: return status;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Check if an autofix status is terminal (no more updates expected)
|
|
19
|
+
*/
|
|
20
|
+
function isTerminalStatus(status) {
|
|
21
|
+
return [
|
|
22
|
+
"COMPLETED",
|
|
23
|
+
"FAILED",
|
|
24
|
+
"ERROR",
|
|
25
|
+
"CANCELLED",
|
|
26
|
+
"NEED_MORE_INFORMATION",
|
|
27
|
+
"WAITING_FOR_USER_RESPONSE"
|
|
28
|
+
].includes(status);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Check if an autofix status requires human intervention
|
|
32
|
+
*/
|
|
33
|
+
function isHumanInterventionStatus(status) {
|
|
34
|
+
return status === "NEED_MORE_INFORMATION" || status === "WAITING_FOR_USER_RESPONSE";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get guidance message for human intervention states
|
|
38
|
+
*/
|
|
39
|
+
function getHumanInterventionGuidance(status) {
|
|
40
|
+
if (status === "NEED_MORE_INFORMATION") return "\nSeer needs additional information to continue the analysis. Please review the insights above and consider providing more context.\n";
|
|
41
|
+
if (status === "WAITING_FOR_USER_RESPONSE") return "\nSeer is waiting for your response to proceed. Please review the analysis and provide feedback.\n";
|
|
42
|
+
return "";
|
|
43
|
+
}
|
|
44
|
+
function getOutputForAutofixStep(step) {
|
|
45
|
+
let output = `## ${step.title}\n\n`;
|
|
46
|
+
if (step.status === "FAILED") {
|
|
47
|
+
output += `**Sentry hit an error completing this step.\n\n`;
|
|
48
|
+
return output;
|
|
49
|
+
}
|
|
50
|
+
if (step.status !== "COMPLETED") {
|
|
51
|
+
output += `**Sentry is still working on this step. Please check back in a minute.**\n\n`;
|
|
52
|
+
return output;
|
|
53
|
+
}
|
|
54
|
+
if (step.type === "root_cause_analysis") {
|
|
55
|
+
const typedStep$1 = step;
|
|
56
|
+
for (const cause of typedStep$1.causes) {
|
|
57
|
+
if (typedStep$1.description) output += `${typedStep$1.description}\n\n`;
|
|
58
|
+
for (const entry of cause.root_cause_reproduction) {
|
|
59
|
+
output += `**${entry.title}**\n\n`;
|
|
60
|
+
output += `${entry.code_snippet_and_analysis}\n\n`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return output;
|
|
64
|
+
}
|
|
65
|
+
if (step.type === "solution") {
|
|
66
|
+
const typedStep$1 = step;
|
|
67
|
+
output += `${typedStep$1.description}\n\n`;
|
|
68
|
+
for (const entry of typedStep$1.solution) {
|
|
69
|
+
output += `**${entry.title}**\n`;
|
|
70
|
+
output += `${entry.code_snippet_and_analysis}\n\n`;
|
|
71
|
+
}
|
|
72
|
+
if (typedStep$1.status === "FAILED") output += `**Sentry hit an error completing this step.\n\n`;
|
|
73
|
+
else if (typedStep$1.status !== "COMPLETED") output += `**Sentry is still working on this step.**\n\n`;
|
|
74
|
+
return output;
|
|
75
|
+
}
|
|
76
|
+
const typedStep = step;
|
|
77
|
+
if (typedStep.insights && typedStep.insights.length > 0) for (const entry of typedStep.insights) {
|
|
78
|
+
output += `**${entry.insight}**\n`;
|
|
79
|
+
output += `${entry.justification}\n\n`;
|
|
80
|
+
}
|
|
81
|
+
else if (step.output_stream) output += `${step.output_stream}\n`;
|
|
82
|
+
return output;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
//#endregion
|
|
86
|
+
export { SEER_POLLING_INTERVAL, SEER_TIMEOUT, getHumanInterventionGuidance, getOutputForAutofixStep, getStatusDisplayName, isHumanInterventionStatus, isTerminalStatus };
|
|
87
|
+
//# sourceMappingURL=seer-utils-Ckr8nYlz.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seer-utils-Ckr8nYlz.js","names":["status: string","step: z.infer<typeof AutofixRunStepSchema>","typedStep"],"sources":["../src/tools/utils/seer-utils.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type {\n AutofixRunStepSchema,\n AutofixRunStepRootCauseAnalysisSchema,\n AutofixRunStepSolutionSchema,\n AutofixRunStepDefaultSchema,\n} from \"../../api-client/index\";\n\nexport const SEER_POLLING_INTERVAL = 5000; // 5 seconds\nexport const SEER_TIMEOUT = 5 * 60 * 1000; // 5 minutes\n\nexport function getStatusDisplayName(status: string): string {\n switch (status) {\n case \"COMPLETED\":\n return \"Complete\";\n case \"FAILED\":\n case \"ERROR\":\n return \"Failed\";\n case \"CANCELLED\":\n return \"Cancelled\";\n case \"NEED_MORE_INFORMATION\":\n return \"Needs More Information\";\n case \"WAITING_FOR_USER_RESPONSE\":\n return \"Waiting for Response\";\n case \"PROCESSING\":\n return \"Processing\";\n case \"IN_PROGRESS\":\n return \"In Progress\";\n default:\n return status;\n }\n}\n\n/**\n * Check if an autofix status is terminal (no more updates expected)\n */\nexport function isTerminalStatus(status: string): boolean {\n return [\n \"COMPLETED\",\n \"FAILED\",\n \"ERROR\",\n \"CANCELLED\",\n \"NEED_MORE_INFORMATION\",\n \"WAITING_FOR_USER_RESPONSE\",\n ].includes(status);\n}\n\n/**\n * Check if an autofix status requires human intervention\n */\nexport function isHumanInterventionStatus(status: string): boolean {\n return (\n status === \"NEED_MORE_INFORMATION\" || status === \"WAITING_FOR_USER_RESPONSE\"\n );\n}\n\n/**\n * Get guidance message for human intervention states\n */\nexport function getHumanInterventionGuidance(status: string): string {\n if (status === \"NEED_MORE_INFORMATION\") {\n return \"\\nSeer needs additional information to continue the analysis. Please review the insights above and consider providing more context.\\n\";\n }\n if (status === \"WAITING_FOR_USER_RESPONSE\") {\n return \"\\nSeer is waiting for your response to proceed. Please review the analysis and provide feedback.\\n\";\n }\n return \"\";\n}\n\nexport function getOutputForAutofixStep(\n step: z.infer<typeof AutofixRunStepSchema>,\n) {\n let output = `## ${step.title}\\n\\n`;\n\n if (step.status === \"FAILED\") {\n output += `**Sentry hit an error completing this step.\\n\\n`;\n return output;\n }\n\n if (step.status !== \"COMPLETED\") {\n output += `**Sentry is still working on this step. Please check back in a minute.**\\n\\n`;\n return output;\n }\n\n if (step.type === \"root_cause_analysis\") {\n const typedStep = step as z.infer<\n typeof AutofixRunStepRootCauseAnalysisSchema\n >;\n\n for (const cause of typedStep.causes) {\n if (typedStep.description) {\n output += `${typedStep.description}\\n\\n`;\n }\n for (const entry of cause.root_cause_reproduction) {\n output += `**${entry.title}**\\n\\n`;\n output += `${entry.code_snippet_and_analysis}\\n\\n`;\n }\n }\n return output;\n }\n\n if (step.type === \"solution\") {\n const typedStep = step as z.infer<typeof AutofixRunStepSolutionSchema>;\n output += `${typedStep.description}\\n\\n`;\n for (const entry of typedStep.solution) {\n output += `**${entry.title}**\\n`;\n output += `${entry.code_snippet_and_analysis}\\n\\n`;\n }\n\n if (typedStep.status === \"FAILED\") {\n output += `**Sentry hit an error completing this step.\\n\\n`;\n } else if (typedStep.status !== \"COMPLETED\") {\n output += `**Sentry is still working on this step.**\\n\\n`;\n }\n\n return output;\n }\n\n const typedStep = step as z.infer<typeof AutofixRunStepDefaultSchema>;\n if (typedStep.insights && typedStep.insights.length > 0) {\n for (const entry of typedStep.insights) {\n output += `**${entry.insight}**\\n`;\n output += `${entry.justification}\\n\\n`;\n }\n } else if (step.output_stream) {\n output += `${step.output_stream}\\n`;\n }\n\n return output;\n}\n"],"mappings":";AAQA,MAAa,wBAAwB;AACrC,MAAa,eAAe,IAAI,KAAK;AAErC,SAAgB,qBAAqBA,QAAwB;AAC3D,SAAQ,QAAR;EACE,KAAK,YACH,QAAO;EACT,KAAK;EACL,KAAK,QACH,QAAO;EACT,KAAK,YACH,QAAO;EACT,KAAK,wBACH,QAAO;EACT,KAAK,4BACH,QAAO;EACT,KAAK,aACH,QAAO;EACT,KAAK,cACH,QAAO;EACT,QACE,QAAO;CACV;AACF;;;;AAKD,SAAgB,iBAAiBA,QAAyB;AACxD,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,SAAS,OAAO;AACnB;;;;AAKD,SAAgB,0BAA0BA,QAAyB;AACjE,QACE,WAAW,2BAA2B,WAAW;AAEpD;;;;AAKD,SAAgB,6BAA6BA,QAAwB;AACnE,KAAI,WAAW,wBACb,QAAO;AAET,KAAI,WAAW,4BACb,QAAO;AAET,QAAO;AACR;AAED,SAAgB,wBACdC,MACA;CACA,IAAI,UAAU,KAAK,KAAK,MAAM;AAE9B,KAAI,KAAK,WAAW,UAAU;AAC5B,aAAW;AACX,SAAO;CACR;AAED,KAAI,KAAK,WAAW,aAAa;AAC/B,aAAW;AACX,SAAO;CACR;AAED,KAAI,KAAK,SAAS,uBAAuB;EACvC,MAAMC,cAAY;AAIlB,OAAK,MAAM,SAASA,YAAU,QAAQ;AACpC,OAAIA,YAAU,YACZ,cAAaA,YAAU,YAAY;AAErC,QAAK,MAAM,SAAS,MAAM,yBAAyB;AACjD,eAAW,IAAI,MAAM,MAAM;AAC3B,iBAAa,MAAM,0BAA0B;GAC9C;EACF;AACD,SAAO;CACR;AAED,KAAI,KAAK,SAAS,YAAY;EAC5B,MAAMA,cAAY;AAClB,eAAaA,YAAU,YAAY;AACnC,OAAK,MAAM,SAASA,YAAU,UAAU;AACtC,cAAW,IAAI,MAAM,MAAM;AAC3B,gBAAa,MAAM,0BAA0B;EAC9C;AAED,MAAIA,YAAU,WAAW,SACvB,YAAW;WACFA,YAAU,WAAW,YAC9B,YAAW;AAGb,SAAO;CACR;CAED,MAAM,YAAY;AAClB,KAAI,UAAU,YAAY,UAAU,SAAS,SAAS,EACpD,MAAK,MAAM,SAAS,UAAU,UAAU;AACtC,aAAW,IAAI,MAAM,QAAQ;AAC7B,eAAa,MAAM,cAAc;CAClC;UACQ,KAAK,cACd,cAAa,KAAK,cAAc;AAGlC,QAAO;AACR"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/tools/utils/seer-utils.ts
|
|
3
|
+
const SEER_POLLING_INTERVAL = 5e3;
|
|
4
|
+
const SEER_TIMEOUT = 5 * 60 * 1e3;
|
|
5
|
+
function getStatusDisplayName(status) {
|
|
6
|
+
switch (status) {
|
|
7
|
+
case "COMPLETED": return "Complete";
|
|
8
|
+
case "FAILED":
|
|
9
|
+
case "ERROR": return "Failed";
|
|
10
|
+
case "CANCELLED": return "Cancelled";
|
|
11
|
+
case "NEED_MORE_INFORMATION": return "Needs More Information";
|
|
12
|
+
case "WAITING_FOR_USER_RESPONSE": return "Waiting for Response";
|
|
13
|
+
case "PROCESSING": return "Processing";
|
|
14
|
+
case "IN_PROGRESS": return "In Progress";
|
|
15
|
+
default: return status;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Check if an autofix status is terminal (no more updates expected)
|
|
20
|
+
*/
|
|
21
|
+
function isTerminalStatus(status) {
|
|
22
|
+
return [
|
|
23
|
+
"COMPLETED",
|
|
24
|
+
"FAILED",
|
|
25
|
+
"ERROR",
|
|
26
|
+
"CANCELLED",
|
|
27
|
+
"NEED_MORE_INFORMATION",
|
|
28
|
+
"WAITING_FOR_USER_RESPONSE"
|
|
29
|
+
].includes(status);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if an autofix status requires human intervention
|
|
33
|
+
*/
|
|
34
|
+
function isHumanInterventionStatus(status) {
|
|
35
|
+
return status === "NEED_MORE_INFORMATION" || status === "WAITING_FOR_USER_RESPONSE";
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get guidance message for human intervention states
|
|
39
|
+
*/
|
|
40
|
+
function getHumanInterventionGuidance(status) {
|
|
41
|
+
if (status === "NEED_MORE_INFORMATION") return "\nSeer needs additional information to continue the analysis. Please review the insights above and consider providing more context.\n";
|
|
42
|
+
if (status === "WAITING_FOR_USER_RESPONSE") return "\nSeer is waiting for your response to proceed. Please review the analysis and provide feedback.\n";
|
|
43
|
+
return "";
|
|
44
|
+
}
|
|
45
|
+
function getOutputForAutofixStep(step) {
|
|
46
|
+
let output = `## ${step.title}\n\n`;
|
|
47
|
+
if (step.status === "FAILED") {
|
|
48
|
+
output += `**Sentry hit an error completing this step.\n\n`;
|
|
49
|
+
return output;
|
|
50
|
+
}
|
|
51
|
+
if (step.status !== "COMPLETED") {
|
|
52
|
+
output += `**Sentry is still working on this step. Please check back in a minute.**\n\n`;
|
|
53
|
+
return output;
|
|
54
|
+
}
|
|
55
|
+
if (step.type === "root_cause_analysis") {
|
|
56
|
+
const typedStep$1 = step;
|
|
57
|
+
for (const cause of typedStep$1.causes) {
|
|
58
|
+
if (typedStep$1.description) output += `${typedStep$1.description}\n\n`;
|
|
59
|
+
for (const entry of cause.root_cause_reproduction) {
|
|
60
|
+
output += `**${entry.title}**\n\n`;
|
|
61
|
+
output += `${entry.code_snippet_and_analysis}\n\n`;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return output;
|
|
65
|
+
}
|
|
66
|
+
if (step.type === "solution") {
|
|
67
|
+
const typedStep$1 = step;
|
|
68
|
+
output += `${typedStep$1.description}\n\n`;
|
|
69
|
+
for (const entry of typedStep$1.solution) {
|
|
70
|
+
output += `**${entry.title}**\n`;
|
|
71
|
+
output += `${entry.code_snippet_and_analysis}\n\n`;
|
|
72
|
+
}
|
|
73
|
+
if (typedStep$1.status === "FAILED") output += `**Sentry hit an error completing this step.\n\n`;
|
|
74
|
+
else if (typedStep$1.status !== "COMPLETED") output += `**Sentry is still working on this step.**\n\n`;
|
|
75
|
+
return output;
|
|
76
|
+
}
|
|
77
|
+
const typedStep = step;
|
|
78
|
+
if (typedStep.insights && typedStep.insights.length > 0) for (const entry of typedStep.insights) {
|
|
79
|
+
output += `**${entry.insight}**\n`;
|
|
80
|
+
output += `${entry.justification}\n\n`;
|
|
81
|
+
}
|
|
82
|
+
else if (step.output_stream) output += `${step.output_stream}\n`;
|
|
83
|
+
return output;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
//#endregion
|
|
87
|
+
Object.defineProperty(exports, 'SEER_POLLING_INTERVAL', {
|
|
88
|
+
enumerable: true,
|
|
89
|
+
get: function () {
|
|
90
|
+
return SEER_POLLING_INTERVAL;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(exports, 'SEER_TIMEOUT', {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
get: function () {
|
|
96
|
+
return SEER_TIMEOUT;
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
Object.defineProperty(exports, 'getHumanInterventionGuidance', {
|
|
100
|
+
enumerable: true,
|
|
101
|
+
get: function () {
|
|
102
|
+
return getHumanInterventionGuidance;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
Object.defineProperty(exports, 'getOutputForAutofixStep', {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
get: function () {
|
|
108
|
+
return getOutputForAutofixStep;
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
Object.defineProperty(exports, 'getStatusDisplayName', {
|
|
112
|
+
enumerable: true,
|
|
113
|
+
get: function () {
|
|
114
|
+
return getStatusDisplayName;
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
Object.defineProperty(exports, 'isHumanInterventionStatus', {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
get: function () {
|
|
120
|
+
return isHumanInterventionStatus;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
Object.defineProperty(exports, 'isTerminalStatus', {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
get: function () {
|
|
126
|
+
return isTerminalStatus;
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
//# sourceMappingURL=seer-utils-CzYEEZb2.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seer-utils-CzYEEZb2.cjs","names":["status: string","step: z.infer<typeof AutofixRunStepSchema>","typedStep"],"sources":["../src/tools/utils/seer-utils.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type {\n AutofixRunStepSchema,\n AutofixRunStepRootCauseAnalysisSchema,\n AutofixRunStepSolutionSchema,\n AutofixRunStepDefaultSchema,\n} from \"../../api-client/index\";\n\nexport const SEER_POLLING_INTERVAL = 5000; // 5 seconds\nexport const SEER_TIMEOUT = 5 * 60 * 1000; // 5 minutes\n\nexport function getStatusDisplayName(status: string): string {\n switch (status) {\n case \"COMPLETED\":\n return \"Complete\";\n case \"FAILED\":\n case \"ERROR\":\n return \"Failed\";\n case \"CANCELLED\":\n return \"Cancelled\";\n case \"NEED_MORE_INFORMATION\":\n return \"Needs More Information\";\n case \"WAITING_FOR_USER_RESPONSE\":\n return \"Waiting for Response\";\n case \"PROCESSING\":\n return \"Processing\";\n case \"IN_PROGRESS\":\n return \"In Progress\";\n default:\n return status;\n }\n}\n\n/**\n * Check if an autofix status is terminal (no more updates expected)\n */\nexport function isTerminalStatus(status: string): boolean {\n return [\n \"COMPLETED\",\n \"FAILED\",\n \"ERROR\",\n \"CANCELLED\",\n \"NEED_MORE_INFORMATION\",\n \"WAITING_FOR_USER_RESPONSE\",\n ].includes(status);\n}\n\n/**\n * Check if an autofix status requires human intervention\n */\nexport function isHumanInterventionStatus(status: string): boolean {\n return (\n status === \"NEED_MORE_INFORMATION\" || status === \"WAITING_FOR_USER_RESPONSE\"\n );\n}\n\n/**\n * Get guidance message for human intervention states\n */\nexport function getHumanInterventionGuidance(status: string): string {\n if (status === \"NEED_MORE_INFORMATION\") {\n return \"\\nSeer needs additional information to continue the analysis. Please review the insights above and consider providing more context.\\n\";\n }\n if (status === \"WAITING_FOR_USER_RESPONSE\") {\n return \"\\nSeer is waiting for your response to proceed. Please review the analysis and provide feedback.\\n\";\n }\n return \"\";\n}\n\nexport function getOutputForAutofixStep(\n step: z.infer<typeof AutofixRunStepSchema>,\n) {\n let output = `## ${step.title}\\n\\n`;\n\n if (step.status === \"FAILED\") {\n output += `**Sentry hit an error completing this step.\\n\\n`;\n return output;\n }\n\n if (step.status !== \"COMPLETED\") {\n output += `**Sentry is still working on this step. Please check back in a minute.**\\n\\n`;\n return output;\n }\n\n if (step.type === \"root_cause_analysis\") {\n const typedStep = step as z.infer<\n typeof AutofixRunStepRootCauseAnalysisSchema\n >;\n\n for (const cause of typedStep.causes) {\n if (typedStep.description) {\n output += `${typedStep.description}\\n\\n`;\n }\n for (const entry of cause.root_cause_reproduction) {\n output += `**${entry.title}**\\n\\n`;\n output += `${entry.code_snippet_and_analysis}\\n\\n`;\n }\n }\n return output;\n }\n\n if (step.type === \"solution\") {\n const typedStep = step as z.infer<typeof AutofixRunStepSolutionSchema>;\n output += `${typedStep.description}\\n\\n`;\n for (const entry of typedStep.solution) {\n output += `**${entry.title}**\\n`;\n output += `${entry.code_snippet_and_analysis}\\n\\n`;\n }\n\n if (typedStep.status === \"FAILED\") {\n output += `**Sentry hit an error completing this step.\\n\\n`;\n } else if (typedStep.status !== \"COMPLETED\") {\n output += `**Sentry is still working on this step.**\\n\\n`;\n }\n\n return output;\n }\n\n const typedStep = step as z.infer<typeof AutofixRunStepDefaultSchema>;\n if (typedStep.insights && typedStep.insights.length > 0) {\n for (const entry of typedStep.insights) {\n output += `**${entry.insight}**\\n`;\n output += `${entry.justification}\\n\\n`;\n }\n } else if (step.output_stream) {\n output += `${step.output_stream}\\n`;\n }\n\n return output;\n}\n"],"mappings":";;AAQA,MAAa,wBAAwB;AACrC,MAAa,eAAe,IAAI,KAAK;AAErC,SAAgB,qBAAqBA,QAAwB;AAC3D,SAAQ,QAAR;EACE,KAAK,YACH,QAAO;EACT,KAAK;EACL,KAAK,QACH,QAAO;EACT,KAAK,YACH,QAAO;EACT,KAAK,wBACH,QAAO;EACT,KAAK,4BACH,QAAO;EACT,KAAK,aACH,QAAO;EACT,KAAK,cACH,QAAO;EACT,QACE,QAAO;CACV;AACF;;;;AAKD,SAAgB,iBAAiBA,QAAyB;AACxD,QAAO;EACL;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,SAAS,OAAO;AACnB;;;;AAKD,SAAgB,0BAA0BA,QAAyB;AACjE,QACE,WAAW,2BAA2B,WAAW;AAEpD;;;;AAKD,SAAgB,6BAA6BA,QAAwB;AACnE,KAAI,WAAW,wBACb,QAAO;AAET,KAAI,WAAW,4BACb,QAAO;AAET,QAAO;AACR;AAED,SAAgB,wBACdC,MACA;CACA,IAAI,UAAU,KAAK,KAAK,MAAM;AAE9B,KAAI,KAAK,WAAW,UAAU;AAC5B,aAAW;AACX,SAAO;CACR;AAED,KAAI,KAAK,WAAW,aAAa;AAC/B,aAAW;AACX,SAAO;CACR;AAED,KAAI,KAAK,SAAS,uBAAuB;EACvC,MAAMC,cAAY;AAIlB,OAAK,MAAM,SAASA,YAAU,QAAQ;AACpC,OAAIA,YAAU,YACZ,cAAaA,YAAU,YAAY;AAErC,QAAK,MAAM,SAAS,MAAM,yBAAyB;AACjD,eAAW,IAAI,MAAM,MAAM;AAC3B,iBAAa,MAAM,0BAA0B;GAC9C;EACF;AACD,SAAO;CACR;AAED,KAAI,KAAK,SAAS,YAAY;EAC5B,MAAMA,cAAY;AAClB,eAAaA,YAAU,YAAY;AACnC,OAAK,MAAM,SAASA,YAAU,UAAU;AACtC,cAAW,IAAI,MAAM,MAAM;AAC3B,gBAAa,MAAM,0BAA0B;EAC9C;AAED,MAAIA,YAAU,WAAW,SACvB,YAAW;WACFA,YAAU,WAAW,YAC9B,YAAW;AAGb,SAAO;CACR;CAED,MAAM,YAAY;AAClB,KAAI,UAAU,YAAY,UAAU,SAAS,SAAS,EACpD,MAAK,MAAM,SAAS,UAAU,UAAU;AACtC,aAAW,IAAI,MAAM,QAAQ;AAC7B,eAAa,MAAM,cAAc;CAClC;UACQ,KAAK,cACd,cAAa,KAAK,cAAc;AAGlC,QAAO;AACR"}
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-DWy1uDak.cjs');
|
|
2
|
+
const require_errors = require('./errors-YmiXLOyx.cjs');
|
|
3
|
+
const require_client = require('./client-BNTsOycD.cjs');
|
|
4
|
+
const require_logging = require('./logging-oIouXrcb.cjs');
|
|
5
|
+
const require_tools = require('./tools-BiZ7ZDKf.cjs');
|
|
6
|
+
const require_resources = require('./resources-BM_YQGcb.cjs');
|
|
7
|
+
const require_promptDefinitions = require('./promptDefinitions-C29BWGYg.cjs');
|
|
8
|
+
const require_prompts = require('./prompts-Df3i1XSB.cjs');
|
|
9
|
+
const __sentry_core = require_chunk.__toESM(require("@sentry/core"));
|
|
10
|
+
|
|
11
|
+
//#region src/server.ts
|
|
12
|
+
/**
|
|
13
|
+
* Type guard to identify Sentry API errors.
|
|
14
|
+
*/
|
|
15
|
+
function isApiError(error) {
|
|
16
|
+
return error instanceof require_client.ApiError;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Type guard to identify user input validation errors.
|
|
20
|
+
*/
|
|
21
|
+
function isUserInputError(error) {
|
|
22
|
+
return error instanceof require_errors.UserInputError;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Formats errors for LLM consumption with appropriate telemetry handling.
|
|
26
|
+
*
|
|
27
|
+
* **Error Types:**
|
|
28
|
+
* - User Input Errors: Clear guidance without telemetry
|
|
29
|
+
* - API Errors: Enhanced messaging with HTTP status context
|
|
30
|
+
* - System Errors: Full telemetry capture with event IDs
|
|
31
|
+
*
|
|
32
|
+
* @example User Input Error Response
|
|
33
|
+
* ```markdown
|
|
34
|
+
* **Input Error**
|
|
35
|
+
*
|
|
36
|
+
* It looks like there was a problem with the input you provided.
|
|
37
|
+
* Organization slug is required. Please provide an organizationSlug parameter.
|
|
38
|
+
* You may be able to resolve the issue by addressing the concern and trying again.
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
async function logAndFormatError(error) {
|
|
42
|
+
if (isUserInputError(error)) {
|
|
43
|
+
const typedError = error;
|
|
44
|
+
return [
|
|
45
|
+
"**Input Error**",
|
|
46
|
+
"It looks like there was a problem with the input you provided.",
|
|
47
|
+
typedError.message,
|
|
48
|
+
`You may be able to resolve the issue by addressing the concern and trying again.`
|
|
49
|
+
].join("\n\n");
|
|
50
|
+
}
|
|
51
|
+
if (isApiError(error)) {
|
|
52
|
+
const typedError = error;
|
|
53
|
+
return [
|
|
54
|
+
"**Error**",
|
|
55
|
+
`There was an HTTP ${typedError.status} error with the your request to the Sentry API.`,
|
|
56
|
+
`${typedError.message}`,
|
|
57
|
+
`You may be able to resolve the issue by addressing the concern and trying again.`
|
|
58
|
+
].join("\n\n");
|
|
59
|
+
}
|
|
60
|
+
const eventId = require_logging.logError(error);
|
|
61
|
+
return [
|
|
62
|
+
"**Error**",
|
|
63
|
+
"It looks like there was a problem communicating with the Sentry API.",
|
|
64
|
+
"Please report the following to the user for the Sentry team:",
|
|
65
|
+
`**Event ID**: ${eventId}`,
|
|
66
|
+
process.env.NODE_ENV !== "production" ? error instanceof Error ? error.message : String(error) : ""
|
|
67
|
+
].join("\n\n");
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Extracts MCP request parameters for OpenTelemetry attributes.
|
|
71
|
+
*
|
|
72
|
+
* @example Parameter Transformation
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const input = { organizationSlug: "my-org", query: "is:unresolved" };
|
|
75
|
+
* const output = extractMcpParameters(input);
|
|
76
|
+
* // { "mcp.request.argument.organizationSlug": "\"my-org\"", "mcp.request.argument.query": "\"is:unresolved\"" }
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
function extractMcpParameters(args) {
|
|
80
|
+
return Object.fromEntries(Object.entries(args).map(([key, value]) => {
|
|
81
|
+
return [`mcp.request.argument.${key}`, JSON.stringify(value)];
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Creates a telemetry wrapper for regular URI resource handlers.
|
|
86
|
+
* Captures URI access and user context for observability.
|
|
87
|
+
*/
|
|
88
|
+
function createResourceHandler(resource, context) {
|
|
89
|
+
return async (uri, extra) => {
|
|
90
|
+
return await (0, __sentry_core.startNewTrace)(async () => {
|
|
91
|
+
return await (0, __sentry_core.startSpan)({
|
|
92
|
+
name: `resources/read ${resource.name}`,
|
|
93
|
+
attributes: {
|
|
94
|
+
"mcp.resource.name": resource.name,
|
|
95
|
+
"mcp.resource.uri": uri.toString(),
|
|
96
|
+
...context.userAgent && { "user_agent.original": context.userAgent }
|
|
97
|
+
}
|
|
98
|
+
}, async () => {
|
|
99
|
+
if (context.userId) (0, __sentry_core.setUser)({ id: context.userId });
|
|
100
|
+
if (context.clientId) (0, __sentry_core.setTag)("client.id", context.clientId);
|
|
101
|
+
return resource.handler(uri, extra);
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Creates a telemetry wrapper for URI template resource handlers.
|
|
108
|
+
* Captures template parameters and user context for observability.
|
|
109
|
+
*/
|
|
110
|
+
function createTemplateResourceHandler(resource, context) {
|
|
111
|
+
return async (uri, variables, extra) => {
|
|
112
|
+
return await (0, __sentry_core.startNewTrace)(async () => {
|
|
113
|
+
return await (0, __sentry_core.startSpan)({
|
|
114
|
+
name: `resources/read ${resource.name}`,
|
|
115
|
+
attributes: {
|
|
116
|
+
"mcp.resource.name": resource.name,
|
|
117
|
+
"mcp.resource.uri": uri.toString(),
|
|
118
|
+
...context.userAgent && { "user_agent.original": context.userAgent },
|
|
119
|
+
...extractMcpParameters(variables)
|
|
120
|
+
}
|
|
121
|
+
}, async () => {
|
|
122
|
+
if (context.userId) (0, __sentry_core.setUser)({ id: context.userId });
|
|
123
|
+
if (context.clientId) (0, __sentry_core.setTag)("client.id", context.clientId);
|
|
124
|
+
return resource.handler(uri, extra);
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Configures an MCP server with all tools, prompts, resources, and telemetry.
|
|
131
|
+
*
|
|
132
|
+
* Transforms a bare MCP server instance into a fully-featured Sentry integration
|
|
133
|
+
* with comprehensive observability, error handling, and handler registration.
|
|
134
|
+
*
|
|
135
|
+
* @example Basic Configuration
|
|
136
|
+
* ```typescript
|
|
137
|
+
* const server = new McpServer();
|
|
138
|
+
* const context = {
|
|
139
|
+
* accessToken: process.env.SENTRY_TOKEN,
|
|
140
|
+
* host: "sentry.io",
|
|
141
|
+
* userId: "user-123",
|
|
142
|
+
* clientId: "cursor-ide"
|
|
143
|
+
* };
|
|
144
|
+
*
|
|
145
|
+
* await configureServer({ server, context });
|
|
146
|
+
* ```
|
|
147
|
+
*/
|
|
148
|
+
async function configureServer({ server, context, onToolComplete }) {
|
|
149
|
+
server.server.onerror = (error) => {
|
|
150
|
+
require_logging.logError(error);
|
|
151
|
+
};
|
|
152
|
+
for (const resource of require_resources.RESOURCES) if (require_resources.isTemplateResource(resource)) server.registerResource(resource.name, resource.template, {
|
|
153
|
+
description: resource.description,
|
|
154
|
+
mimeType: resource.mimeType
|
|
155
|
+
}, createTemplateResourceHandler(resource, context));
|
|
156
|
+
else server.registerResource(resource.name, resource.uri, {
|
|
157
|
+
description: resource.description,
|
|
158
|
+
mimeType: resource.mimeType
|
|
159
|
+
}, createResourceHandler(resource, context));
|
|
160
|
+
for (const prompt of require_promptDefinitions.PROMPT_DEFINITIONS) {
|
|
161
|
+
const handler = require_prompts.PROMPT_HANDLERS[prompt.name];
|
|
162
|
+
server.prompt(prompt.name, prompt.description, prompt.paramsSchema ? prompt.paramsSchema : {}, async (...args) => {
|
|
163
|
+
try {
|
|
164
|
+
return await (0, __sentry_core.startNewTrace)(async () => {
|
|
165
|
+
return await (0, __sentry_core.startSpan)({
|
|
166
|
+
name: `prompts/get ${prompt.name}`,
|
|
167
|
+
attributes: {
|
|
168
|
+
"mcp.prompt.name": prompt.name,
|
|
169
|
+
...context.userAgent && { "user_agent.original": context.userAgent },
|
|
170
|
+
...extractMcpParameters(args[0] || {})
|
|
171
|
+
}
|
|
172
|
+
}, async (span) => {
|
|
173
|
+
if (context.userId) (0, __sentry_core.setUser)({ id: context.userId });
|
|
174
|
+
if (context.clientId) (0, __sentry_core.setTag)("client.id", context.clientId);
|
|
175
|
+
try {
|
|
176
|
+
const output = await handler(context, ...args);
|
|
177
|
+
span.setStatus({ code: 1 });
|
|
178
|
+
return { messages: [{
|
|
179
|
+
role: "user",
|
|
180
|
+
content: {
|
|
181
|
+
type: "text",
|
|
182
|
+
text: output
|
|
183
|
+
}
|
|
184
|
+
}] };
|
|
185
|
+
} catch (error) {
|
|
186
|
+
span.setStatus({ code: 2 });
|
|
187
|
+
throw error;
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
} finally {
|
|
192
|
+
onToolComplete?.();
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
for (const [toolKey, tool] of Object.entries(require_tools.tools_default)) server.tool(tool.name, tool.description, tool.inputSchema, async (params, extra) => {
|
|
197
|
+
try {
|
|
198
|
+
return await (0, __sentry_core.startNewTrace)(async () => {
|
|
199
|
+
return await (0, __sentry_core.startSpan)({
|
|
200
|
+
name: `tools/call ${tool.name}`,
|
|
201
|
+
attributes: {
|
|
202
|
+
"mcp.tool.name": tool.name,
|
|
203
|
+
...context.userAgent && { "user_agent.original": context.userAgent },
|
|
204
|
+
...extractMcpParameters(params || {})
|
|
205
|
+
}
|
|
206
|
+
}, async (span) => {
|
|
207
|
+
if (context.userId) (0, __sentry_core.setUser)({ id: context.userId });
|
|
208
|
+
if (context.clientId) (0, __sentry_core.setTag)("client.id", context.clientId);
|
|
209
|
+
try {
|
|
210
|
+
const output = await tool.handler(params, context);
|
|
211
|
+
span.setStatus({ code: 1 });
|
|
212
|
+
if (typeof output === "string") return { content: [{
|
|
213
|
+
type: "text",
|
|
214
|
+
text: output
|
|
215
|
+
}] };
|
|
216
|
+
if (Array.isArray(output)) return { content: output };
|
|
217
|
+
throw new Error(`Invalid tool output: ${output}`);
|
|
218
|
+
} catch (error) {
|
|
219
|
+
span.setStatus({ code: 2 });
|
|
220
|
+
return {
|
|
221
|
+
content: [{
|
|
222
|
+
type: "text",
|
|
223
|
+
text: await logAndFormatError(error)
|
|
224
|
+
}],
|
|
225
|
+
isError: true
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
} finally {
|
|
231
|
+
onToolComplete?.();
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
//#endregion
|
|
237
|
+
Object.defineProperty(exports, 'configureServer', {
|
|
238
|
+
enumerable: true,
|
|
239
|
+
get: function () {
|
|
240
|
+
return configureServer;
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
//# sourceMappingURL=server-CHG27fcn.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-CHG27fcn.cjs","names":["error: unknown","ApiError","UserInputError","args: Record<string, unknown>","resource: { name: string; handler: ReadResourceCallback }","context: ServerContext","uri: URL","extra: RequestHandlerExtra<any, any>","variables: Variables","RESOURCES","PROMPT_DEFINITIONS","PROMPT_HANDLERS","tools","params: any","extra: RequestHandlerExtra<ServerRequest, ServerNotification>"],"sources":["../src/server.ts"],"sourcesContent":["/**\n * MCP Server Configuration and Request Handling Infrastructure.\n *\n * This module orchestrates tool execution, prompt handling, resource management,\n * and telemetry collection in a unified server interface for LLMs.\n *\n * **Configuration Example:**\n * ```typescript\n * const server = new McpServer();\n * const context: ServerContext = {\n * accessToken: \"your-sentry-token\",\n * host: \"sentry.io\",\n * userId: \"user-123\",\n * clientId: \"mcp-client\"\n * };\n *\n * await configureServer({ server, context });\n * ```\n */\nimport type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport type { RequestHandlerExtra } from \"@modelcontextprotocol/sdk/shared/protocol.js\";\nimport type {\n ServerRequest,\n ServerNotification,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport type {\n ReadResourceCallback,\n ReadResourceTemplateCallback,\n} from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport type { Variables } from \"@modelcontextprotocol/sdk/shared/uriTemplate.js\";\nimport tools from \"./tools/index\";\nimport type { ServerContext } from \"./types\";\nimport { setTag, setUser, startNewTrace, startSpan } from \"@sentry/core\";\nimport { logError } from \"./logging\";\nimport { RESOURCES, isTemplateResource } from \"./resources\";\nimport { PROMPT_DEFINITIONS } from \"./promptDefinitions\";\nimport { PROMPT_HANDLERS } from \"./prompts\";\nimport { ApiError } from \"./api-client\";\nimport { UserInputError } from \"./errors\";\n\n/**\n * Type guard to identify Sentry API errors.\n */\nfunction isApiError(error: unknown): error is ApiError {\n return error instanceof ApiError;\n}\n\n/**\n * Type guard to identify user input validation errors.\n */\nfunction isUserInputError(error: unknown) {\n return error instanceof UserInputError;\n}\n\n/**\n * Formats errors for LLM consumption with appropriate telemetry handling.\n *\n * **Error Types:**\n * - User Input Errors: Clear guidance without telemetry\n * - API Errors: Enhanced messaging with HTTP status context\n * - System Errors: Full telemetry capture with event IDs\n *\n * @example User Input Error Response\n * ```markdown\n * **Input Error**\n *\n * It looks like there was a problem with the input you provided.\n * Organization slug is required. Please provide an organizationSlug parameter.\n * You may be able to resolve the issue by addressing the concern and trying again.\n * ```\n */\nasync function logAndFormatError(error: unknown) {\n if (isUserInputError(error)) {\n const typedError = error as UserInputError;\n return [\n \"**Input Error**\",\n \"It looks like there was a problem with the input you provided.\",\n typedError.message,\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n if (isApiError(error)) {\n const typedError = error as ApiError;\n return [\n \"**Error**\",\n `There was an HTTP ${typedError.status} error with the your request to the Sentry API.`,\n `${typedError.message}`,\n `You may be able to resolve the issue by addressing the concern and trying again.`,\n ].join(\"\\n\\n\");\n }\n\n const eventId = logError(error);\n\n return [\n \"**Error**\",\n \"It looks like there was a problem communicating with the Sentry API.\",\n \"Please report the following to the user for the Sentry team:\",\n `**Event ID**: ${eventId}`,\n process.env.NODE_ENV !== \"production\"\n ? error instanceof Error\n ? error.message\n : String(error)\n : \"\",\n ].join(\"\\n\\n\");\n}\n\n/**\n * Extracts MCP request parameters for OpenTelemetry attributes.\n *\n * @example Parameter Transformation\n * ```typescript\n * const input = { organizationSlug: \"my-org\", query: \"is:unresolved\" };\n * const output = extractMcpParameters(input);\n * // { \"mcp.request.argument.organizationSlug\": \"\\\"my-org\\\"\", \"mcp.request.argument.query\": \"\\\"is:unresolved\\\"\" }\n * ```\n */\nfunction extractMcpParameters(args: Record<string, unknown>) {\n return Object.fromEntries(\n Object.entries(args).map(([key, value]) => {\n return [`mcp.request.argument.${key}`, JSON.stringify(value)];\n }),\n );\n}\n\n/**\n * Creates a telemetry wrapper for regular URI resource handlers.\n * Captures URI access and user context for observability.\n */\nfunction createResourceHandler(\n resource: { name: string; handler: ReadResourceCallback },\n context: ServerContext,\n): ReadResourceCallback {\n return async (uri: URL, extra: RequestHandlerExtra<any, any>) => {\n return await startNewTrace(async () => {\n return await startSpan(\n {\n name: `resources/read ${resource.name}`,\n attributes: {\n \"mcp.resource.name\": resource.name,\n \"mcp.resource.uri\": uri.toString(),\n ...(context.userAgent && {\n \"user_agent.original\": context.userAgent,\n }),\n },\n },\n async () => {\n if (context.userId) {\n setUser({\n id: context.userId,\n });\n }\n if (context.clientId) {\n setTag(\"client.id\", context.clientId);\n }\n\n return resource.handler(uri, extra);\n },\n );\n });\n };\n}\n\n/**\n * Creates a telemetry wrapper for URI template resource handlers.\n * Captures template parameters and user context for observability.\n */\nfunction createTemplateResourceHandler(\n resource: { name: string; handler: ReadResourceCallback },\n context: ServerContext,\n): ReadResourceTemplateCallback {\n return async (\n uri: URL,\n variables: Variables,\n extra: RequestHandlerExtra<any, any>,\n ) => {\n return await startNewTrace(async () => {\n return await startSpan(\n {\n name: `resources/read ${resource.name}`,\n attributes: {\n \"mcp.resource.name\": resource.name,\n \"mcp.resource.uri\": uri.toString(),\n ...(context.userAgent && {\n \"user_agent.original\": context.userAgent,\n }),\n ...extractMcpParameters(variables),\n },\n },\n async () => {\n if (context.userId) {\n setUser({\n id: context.userId,\n });\n }\n if (context.clientId) {\n setTag(\"client.id\", context.clientId);\n }\n\n // The MCP SDK has already constructed the URI from the template and variables\n // We just need to call the handler with the constructed URI\n return resource.handler(uri, extra);\n },\n );\n });\n };\n}\n\n/**\n * Configures an MCP server with all tools, prompts, resources, and telemetry.\n *\n * Transforms a bare MCP server instance into a fully-featured Sentry integration\n * with comprehensive observability, error handling, and handler registration.\n *\n * @example Basic Configuration\n * ```typescript\n * const server = new McpServer();\n * const context = {\n * accessToken: process.env.SENTRY_TOKEN,\n * host: \"sentry.io\",\n * userId: \"user-123\",\n * clientId: \"cursor-ide\"\n * };\n *\n * await configureServer({ server, context });\n * ```\n */\nexport async function configureServer({\n server,\n context,\n onToolComplete,\n}: { server: McpServer; context: ServerContext; onToolComplete?: () => void }) {\n server.server.onerror = (error) => {\n logError(error);\n };\n\n for (const resource of RESOURCES) {\n if (isTemplateResource(resource)) {\n // Handle URI template resources\n server.registerResource(\n resource.name,\n resource.template,\n {\n description: resource.description,\n mimeType: resource.mimeType,\n },\n createTemplateResourceHandler(resource, context),\n );\n } else {\n // Handle regular URI resources\n server.registerResource(\n resource.name,\n resource.uri,\n {\n description: resource.description,\n mimeType: resource.mimeType,\n },\n createResourceHandler(resource, context),\n );\n }\n }\n\n for (const prompt of PROMPT_DEFINITIONS) {\n const handler = PROMPT_HANDLERS[prompt.name];\n\n server.prompt(\n prompt.name,\n prompt.description,\n prompt.paramsSchema ? prompt.paramsSchema : {},\n async (...args) => {\n try {\n return await startNewTrace(async () => {\n return await startSpan(\n {\n name: `prompts/get ${prompt.name}`,\n attributes: {\n \"mcp.prompt.name\": prompt.name,\n ...(context.userAgent && {\n \"user_agent.original\": context.userAgent,\n }),\n ...extractMcpParameters(args[0] || {}),\n },\n },\n async (span) => {\n if (context.userId) {\n setUser({\n id: context.userId,\n });\n }\n if (context.clientId) {\n setTag(\"client.id\", context.clientId);\n }\n try {\n // TODO(dcramer): I'm too dumb to figure this out\n // @ts-ignore\n const output = await handler(context, ...args);\n span.setStatus({\n code: 1, // ok\n });\n return {\n messages: [\n {\n role: \"user\" as const,\n content: {\n type: \"text\" as const,\n text: output,\n },\n },\n ],\n };\n } catch (error) {\n span.setStatus({\n code: 2, // error\n });\n throw error;\n }\n },\n );\n });\n } finally {\n onToolComplete?.();\n }\n },\n );\n }\n\n for (const [toolKey, tool] of Object.entries(tools)) {\n server.tool(\n tool.name,\n tool.description,\n tool.inputSchema,\n async (\n params: any,\n extra: RequestHandlerExtra<ServerRequest, ServerNotification>,\n ) => {\n try {\n return await startNewTrace(async () => {\n return await startSpan(\n {\n name: `tools/call ${tool.name}`,\n attributes: {\n \"mcp.tool.name\": tool.name,\n ...(context.userAgent && {\n \"user_agent.original\": context.userAgent,\n }),\n ...extractMcpParameters(params || {}),\n },\n },\n async (span) => {\n if (context.userId) {\n setUser({\n id: context.userId,\n });\n }\n if (context.clientId) {\n setTag(\"client.id\", context.clientId);\n }\n\n try {\n const output = await tool.handler(params, context);\n span.setStatus({\n code: 1, // ok\n });\n // if the tool returns a string, assume it's a message\n if (typeof output === \"string\") {\n return {\n content: [\n {\n type: \"text\" as const,\n text: output,\n },\n ],\n };\n }\n // if the tool returns a list, assume it's a content list\n if (Array.isArray(output)) {\n return {\n content: output,\n };\n }\n throw new Error(`Invalid tool output: ${output}`);\n } catch (error) {\n span.setStatus({\n code: 2, // error\n });\n\n // CRITICAL: Tool errors MUST be returned as formatted text responses,\n // NOT thrown as exceptions. This ensures consistent error handling\n // and prevents the MCP client from receiving raw error objects.\n //\n // The logAndFormatError function provides user-friendly error messages\n // with appropriate formatting for different error types:\n // - UserInputError: Clear guidance for fixing input problems\n // - ApiError: HTTP status context with helpful messaging\n // - System errors: Sentry event IDs for debugging\n //\n // DO NOT change this to throw error - it breaks error handling!\n return {\n content: [\n {\n type: \"text\" as const,\n text: await logAndFormatError(error),\n },\n ],\n isError: true,\n };\n }\n },\n );\n });\n } finally {\n onToolComplete?.();\n }\n },\n );\n }\n}\n"],"mappings":"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"}
|