@sentry/mcp-server 0.12.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 +9 -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 +8 -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-B7vZ6JMk.cjs → client-BNTsOycD.cjs} +55 -7
- package/dist/client-BNTsOycD.cjs.map +1 -0
- package/dist/{client-CAoHZbyK.js → client-BbamPqV4.js} +55 -7
- package/dist/client-BbamPqV4.js.map +1 -0
- package/dist/{client-DkY0ifZf.d.cts → client-Dae1ZwWb.d.cts} +38 -4
- package/dist/client-Dae1ZwWb.d.cts.map +1 -0
- package/dist/{client-4jq_wVgn.d.ts → client-qyEu8fvj.d.ts} +40 -6
- 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 -25
- package/dist/internal/formatting.d.ts +6 -26
- package/dist/internal/formatting.js +1 -1
- package/dist/internal/issue-helpers.cjs +1 -1
- package/dist/internal/issue-helpers.d.cts +2 -52
- package/dist/internal/issue-helpers.d.ts +2 -52
- 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-BMVLc3mR.js → issue-helpers-CqqYnwYE.js} +1 -1
- package/dist/{issue-helpers-BMVLc3mR.js.map → issue-helpers-CqqYnwYE.js.map} +1 -1
- package/dist/issue-helpers-Cz01Ipvl.d.cts +52 -0
- package/dist/issue-helpers-Cz01Ipvl.d.cts.map +1 -0
- package/dist/{issue-helpers-D712fGT2.cjs → issue-helpers-DyAIO0w6.cjs} +1 -1
- package/dist/{issue-helpers-D712fGT2.cjs.map → issue-helpers-DyAIO0w6.cjs.map} +1 -1
- 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-CXLD0FFB.js.map → logging-LnQMFw-_.js.map} +1 -1
- package/dist/{logging-ByvSjT6V.cjs → logging-oIouXrcb.cjs} +1 -1
- package/dist/{logging-ByvSjT6V.cjs.map → logging-oIouXrcb.cjs.map} +1 -1
- package/dist/logging.cjs +1 -1
- package/dist/logging.js +1 -1
- package/dist/{promptDefinitions-D5FSQckL.d.ts → promptDefinitions-6xelipaz.d.ts} +3 -3
- package/dist/promptDefinitions-6xelipaz.d.ts.map +1 -0
- package/dist/{promptDefinitions-BTLIBcGt.cjs → promptDefinitions-C29BWGYg.cjs} +4 -4
- package/dist/promptDefinitions-C29BWGYg.cjs.map +1 -0
- package/dist/{promptDefinitions-D8yow1m0.js → promptDefinitions-CSKE8T0a.js} +4 -4
- package/dist/{promptDefinitions-D8yow1m0.js.map → promptDefinitions-CSKE8T0a.js.map} +1 -1
- package/dist/{promptDefinitions-CF2VWdQ6.d.cts → promptDefinitions-CVHtYaj8.d.cts} +3 -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-Dt3A8Qfl.js → prompts-C8Y9w5c4.js} +7 -7
- package/dist/{prompts-Dt3A8Qfl.js.map → prompts-C8Y9w5c4.js.map} +1 -1
- package/dist/{prompts-CDbQrutV.cjs → prompts-Df3i1XSB.cjs} +7 -7
- package/dist/{prompts-CDbQrutV.cjs.map → prompts-Df3i1XSB.cjs.map} +1 -1
- package/dist/prompts.cjs +2 -2
- 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 -2
- 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 +26 -12
- package/dist/resources.d.cts.map +1 -1
- package/dist/resources.d.ts +26 -12
- package/dist/resources.d.ts.map +1 -1
- package/dist/resources.js +4 -2
- package/dist/{schema-BnxGHL_i.d.ts → schema-B5BpplNK.d.ts} +3632 -573
- package/dist/schema-B5BpplNK.d.ts.map +1 -0
- package/dist/{schema-BsvGMALe.cjs → schema-B_cMyyJJ.cjs} +94 -8
- package/dist/schema-B_cMyyJJ.cjs.map +1 -0
- package/dist/{schema-BTfISwFu.cjs → schema-BpJVmev8.cjs} +23 -1
- package/dist/{schema-Dv6aLZgz.js.map → schema-BpJVmev8.cjs.map} +1 -1
- package/dist/{schema-BJv7kREf.d.cts → schema-Dt-HKnd_.d.cts} +3567 -508
- package/dist/schema-Dt-HKnd_.d.cts.map +1 -0
- package/dist/{schema-Dv6aLZgz.js → schema-DtsnsxMl.js} +6 -2
- package/dist/schema-DtsnsxMl.js.map +1 -0
- package/dist/{schema-C_hp0BR7.js → schema-WDk5Yqww.js} +53 -9
- package/dist/schema-WDk5Yqww.js.map +1 -0
- package/dist/schema.cjs +5 -1
- package/dist/schema.d.cts +4 -1
- package/dist/schema.d.cts.map +1 -1
- package/dist/schema.d.ts +4 -1
- 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-DeutbO8v.cjs → server-CHG27fcn.cjs} +104 -57
- package/dist/server-CHG27fcn.cjs.map +1 -0
- package/dist/{server-C7cHq_pc.js → server-DeuBftc5.js} +104 -57
- package/dist/server-DeuBftc5.js.map +1 -0
- package/dist/server.cjs +40 -13
- package/dist/server.d.cts +2 -3
- package/dist/server.d.cts.map +1 -1
- package/dist/server.d.ts +2 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +42 -15
- package/dist/{stdio-B73CCTly.cjs → stdio-BtVdTwx-.cjs} +17 -7
- package/dist/stdio-BtVdTwx-.cjs.map +1 -0
- package/dist/{stdio-ZQLC-i5Q.js → stdio-DIuLW5EE.js} +17 -7
- package/dist/stdio-DIuLW5EE.js.map +1 -0
- package/dist/test-setup.cjs +1420 -1230
- package/dist/test-setup.cjs.map +1 -1
- package/dist/test-setup.js +1262 -1045
- 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 +2 -3
- package/dist/transports/stdio.d.cts.map +1 -1
- package/dist/transports/stdio.d.ts +2 -3
- 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-Daq2fm0E.d.ts → types-Br0saqtE.d.ts} +5 -3
- package/dist/types-Br0saqtE.d.ts.map +1 -0
- package/dist/{types-NIQW7KyF.d.cts → types-C3pRFQyA.d.cts} +5 -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-BNmubeQI.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-4jq_wVgn.d.ts.map +0 -1
- package/dist/client-B7vZ6JMk.cjs.map +0 -1
- package/dist/client-CAoHZbyK.js.map +0 -1
- package/dist/client-DkY0ifZf.d.cts.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/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-BTLIBcGt.cjs.map +0 -1
- package/dist/promptDefinitions-CF2VWdQ6.d.cts.map +0 -1
- package/dist/promptDefinitions-D5FSQckL.d.ts.map +0 -1
- package/dist/resources-Bol20Xuo.js +0 -38
- package/dist/resources-Bol20Xuo.js.map +0 -1
- package/dist/resources-DNyoutxH.cjs +0 -44
- package/dist/resources-DNyoutxH.cjs.map +0 -1
- package/dist/schema-BJv7kREf.d.cts.map +0 -1
- package/dist/schema-BTfISwFu.cjs.map +0 -1
- package/dist/schema-BnxGHL_i.d.ts.map +0 -1
- package/dist/schema-BsvGMALe.cjs.map +0 -1
- package/dist/schema-C_hp0BR7.js.map +0 -1
- package/dist/server-C7cHq_pc.js.map +0 -1
- package/dist/server-DeutbO8v.cjs.map +0 -1
- package/dist/stdio-B73CCTly.cjs.map +0 -1
- package/dist/stdio-ZQLC-i5Q.js.map +0 -1
- package/dist/toolDefinitions-BOMF-zIC.d.ts +0 -394
- package/dist/toolDefinitions-BOMF-zIC.d.ts.map +0 -1
- package/dist/toolDefinitions-CUegGcWU.cjs +0 -547
- package/dist/toolDefinitions-CUegGcWU.cjs.map +0 -1
- package/dist/toolDefinitions-DFAxp3nr.js +0 -541
- package/dist/toolDefinitions-DFAxp3nr.js.map +0 -1
- package/dist/toolDefinitions-Ipvr4Acw.d.cts +0 -394
- package/dist/toolDefinitions-Ipvr4Acw.d.cts.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-DpiQwSTY.js +0 -596
- package/dist/tools-DpiQwSTY.js.map +0 -1
- package/dist/tools-DyOqlsCW.cjs +0 -602
- package/dist/tools-DyOqlsCW.cjs.map +0 -1
- package/dist/tools.cjs +0 -11
- package/dist/tools.d.cts +0 -335
- package/dist/tools.d.cts.map +0 -1
- package/dist/tools.d.ts +0 -335
- package/dist/tools.d.ts.map +0 -1
- package/dist/tools.js +0 -11
- package/dist/tools.test.cjs +0 -1298
- 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 -1298
- package/dist/tools.test.js.map +0 -1
- package/dist/types-D5TPcOfv.d.ts +0 -39
- package/dist/types-D5TPcOfv.d.ts.map +0 -1
- package/dist/types-DRF2IoP_.d.cts +0 -39
- package/dist/types-DRF2IoP_.d.cts.map +0 -1
- package/dist/types-Daq2fm0E.d.ts.map +0 -1
- package/dist/types-NIQW7KyF.d.cts.map +0 -1
- package/dist/version-BNmubeQI.cjs.map +0 -1
- package/dist/version-CRto5Sn_.js +0 -6
- package/dist/version-CRto5Sn_.js.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,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"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DWy1uDak.cjs');
|
|
2
|
-
const require_errors = require('./errors-
|
|
3
|
-
const require_client = require('./client-
|
|
4
|
-
const require_logging = require('./logging-
|
|
5
|
-
const require_tools = require('./tools-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const require_prompts = require('./prompts-CDbQrutV.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');
|
|
10
9
|
const __sentry_core = require_chunk.__toESM(require("@sentry/core"));
|
|
11
10
|
|
|
12
11
|
//#region src/server.ts
|
|
@@ -14,7 +13,7 @@ const __sentry_core = require_chunk.__toESM(require("@sentry/core"));
|
|
|
14
13
|
* Type guard to identify Sentry API errors.
|
|
15
14
|
*/
|
|
16
15
|
function isApiError(error) {
|
|
17
|
-
return error instanceof require_client.ApiError
|
|
16
|
+
return error instanceof require_client.ApiError;
|
|
18
17
|
}
|
|
19
18
|
/**
|
|
20
19
|
* Type guard to identify user input validation errors.
|
|
@@ -74,15 +73,60 @@ async function logAndFormatError(error) {
|
|
|
74
73
|
* ```typescript
|
|
75
74
|
* const input = { organizationSlug: "my-org", query: "is:unresolved" };
|
|
76
75
|
* const output = extractMcpParameters(input);
|
|
77
|
-
* // { "mcp.
|
|
76
|
+
* // { "mcp.request.argument.organizationSlug": "\"my-org\"", "mcp.request.argument.query": "\"is:unresolved\"" }
|
|
78
77
|
* ```
|
|
79
78
|
*/
|
|
80
79
|
function extractMcpParameters(args) {
|
|
81
80
|
return Object.fromEntries(Object.entries(args).map(([key, value]) => {
|
|
82
|
-
return [`mcp.
|
|
81
|
+
return [`mcp.request.argument.${key}`, JSON.stringify(value)];
|
|
83
82
|
}));
|
|
84
83
|
}
|
|
85
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
|
+
/**
|
|
86
130
|
* Configures an MCP server with all tools, prompts, resources, and telemetry.
|
|
87
131
|
*
|
|
88
132
|
* Transforms a bare MCP server instance into a fully-featured Sentry integration
|
|
@@ -105,26 +149,26 @@ async function configureServer({ server, context, onToolComplete }) {
|
|
|
105
149
|
server.server.onerror = (error) => {
|
|
106
150
|
require_logging.logError(error);
|
|
107
151
|
};
|
|
108
|
-
for (const resource of require_resources.RESOURCES) server.
|
|
152
|
+
for (const resource of require_resources.RESOURCES) if (require_resources.isTemplateResource(resource)) server.registerResource(resource.name, resource.template, {
|
|
109
153
|
description: resource.description,
|
|
110
154
|
mimeType: resource.mimeType
|
|
111
|
-
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
return resource.handler(url);
|
|
117
|
-
});
|
|
118
|
-
});
|
|
119
|
-
});
|
|
155
|
+
}, createTemplateResourceHandler(resource, context));
|
|
156
|
+
else server.registerResource(resource.name, resource.uri, {
|
|
157
|
+
description: resource.description,
|
|
158
|
+
mimeType: resource.mimeType
|
|
159
|
+
}, createResourceHandler(resource, context));
|
|
120
160
|
for (const prompt of require_promptDefinitions.PROMPT_DEFINITIONS) {
|
|
121
161
|
const handler = require_prompts.PROMPT_HANDLERS[prompt.name];
|
|
122
162
|
server.prompt(prompt.name, prompt.description, prompt.paramsSchema ? prompt.paramsSchema : {}, async (...args) => {
|
|
123
163
|
try {
|
|
124
164
|
return await (0, __sentry_core.startNewTrace)(async () => {
|
|
125
165
|
return await (0, __sentry_core.startSpan)({
|
|
126
|
-
name: `
|
|
127
|
-
attributes:
|
|
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
|
+
}
|
|
128
172
|
}, async (span) => {
|
|
129
173
|
if (context.userId) (0, __sentry_core.setUser)({ id: context.userId });
|
|
130
174
|
if (context.clientId) (0, __sentry_core.setTag)("client.id", context.clientId);
|
|
@@ -149,41 +193,44 @@ async function configureServer({ server, context, onToolComplete }) {
|
|
|
149
193
|
}
|
|
150
194
|
});
|
|
151
195
|
}
|
|
152
|
-
for (const tool of
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
name:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
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: [{
|
|
167
222
|
type: "text",
|
|
168
|
-
text:
|
|
169
|
-
}]
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
content: [{
|
|
174
|
-
type: "text",
|
|
175
|
-
text: await logAndFormatError(error)
|
|
176
|
-
}],
|
|
177
|
-
isError: true
|
|
178
|
-
};
|
|
179
|
-
}
|
|
180
|
-
});
|
|
223
|
+
text: await logAndFormatError(error)
|
|
224
|
+
}],
|
|
225
|
+
isError: true
|
|
226
|
+
};
|
|
227
|
+
}
|
|
181
228
|
});
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
}
|
|
229
|
+
});
|
|
230
|
+
} finally {
|
|
231
|
+
onToolComplete?.();
|
|
232
|
+
}
|
|
233
|
+
});
|
|
187
234
|
}
|
|
188
235
|
|
|
189
236
|
//#endregion
|
|
@@ -193,4 +240,4 @@ Object.defineProperty(exports, 'configureServer', {
|
|
|
193
240
|
return configureServer;
|
|
194
241
|
}
|
|
195
242
|
});
|
|
196
|
-
//# sourceMappingURL=server-
|
|
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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"}
|