@sentry/mcp-server 0.37.0 → 0.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/dist/auth/constants.cjs +1 -1
  2. package/dist/auth/constants.js +1 -1
  3. package/dist/auth/device-code-flow.cjs +3 -3
  4. package/dist/auth/device-code-flow.d.cts +1 -1
  5. package/dist/auth/device-code-flow.d.ts +1 -1
  6. package/dist/auth/device-code-flow.js +3 -3
  7. package/dist/auth/resolve-token.cjs +4 -4
  8. package/dist/auth/resolve-token.d.cts +1 -1
  9. package/dist/auth/resolve-token.d.ts +1 -1
  10. package/dist/auth/resolve-token.js +4 -4
  11. package/dist/auth/token-cache.d.cts +1 -1
  12. package/dist/auth/token-cache.d.ts +1 -1
  13. package/dist/auth/types.d.cts +1 -1
  14. package/dist/auth/types.d.ts +1 -1
  15. package/dist/{auth-CoEHiogK.cjs → auth-BlhX8Vom.cjs} +5 -5
  16. package/dist/{auth-CoEHiogK.cjs.map → auth-BlhX8Vom.cjs.map} +1 -1
  17. package/dist/{auth-DMKQfLeC.js → auth-CmWwtW3L.js} +5 -5
  18. package/dist/{auth-DMKQfLeC.js.map → auth-CmWwtW3L.js.map} +1 -1
  19. package/dist/blob-utils-ByQZ_jqM.cjs +3 -0
  20. package/dist/{blob-utils-W1AQ3zH3-Dqg_Ruod.js → blob-utils-CdbE_jsd-9sHzy4nK.js} +2 -2
  21. package/dist/{blob-utils-W1AQ3zH3-Dqg_Ruod.js.map → blob-utils-CdbE_jsd-9sHzy4nK.js.map} +1 -1
  22. package/dist/{blob-utils-W1AQ3zH3-CbD1HBpG.cjs → blob-utils-CdbE_jsd-zazUDulT.cjs} +2 -2
  23. package/dist/{blob-utils-W1AQ3zH3-CbD1HBpG.cjs.map → blob-utils-CdbE_jsd-zazUDulT.cjs.map} +1 -1
  24. package/dist/blob-utils-KYOyFu79.js +3 -0
  25. package/dist/cli/commands/auth.cjs +6 -6
  26. package/dist/cli/commands/auth.js +6 -6
  27. package/dist/cli/parse.cjs +1 -1
  28. package/dist/cli/parse.d.cts +1 -1
  29. package/dist/cli/parse.d.ts +1 -1
  30. package/dist/cli/parse.d.ts.map +1 -1
  31. package/dist/cli/parse.js +1 -1
  32. package/dist/cli/resolve.cjs +2 -2
  33. package/dist/cli/resolve.d.cts +1 -1
  34. package/dist/cli/resolve.d.ts +1 -1
  35. package/dist/cli/resolve.js +2 -2
  36. package/dist/cli/types.d.cts +1 -1
  37. package/dist/cli/types.d.ts +1 -1
  38. package/dist/cli/usage.cjs +1 -1
  39. package/dist/cli/usage.js +1 -1
  40. package/dist/{config-8Hjp9aiG.js → config-BUwpc74z.js} +1 -1
  41. package/dist/{config-CUeobZnr-BYvJlg7Z.js → config-BqCCImAX-C9xxoOuk.js} +6 -2
  42. package/dist/config-BqCCImAX-C9xxoOuk.js.map +1 -0
  43. package/dist/{config-CUeobZnr-C1uLYu0T.cjs → config-BqCCImAX-CqsS5Qiu.cjs} +6 -2
  44. package/dist/config-BqCCImAX-CqsS5Qiu.cjs.map +1 -0
  45. package/dist/config-Md3ohhLy.cjs +7 -0
  46. package/dist/{constants-zNdapUB3.cjs → constants-BF1H5JLS.cjs} +19 -3
  47. package/dist/constants-BF1H5JLS.cjs.map +1 -0
  48. package/dist/{constants-D_84kMgg.js → constants-BZbaI-zR.js} +14 -4
  49. package/dist/constants-BZbaI-zR.js.map +1 -0
  50. package/dist/{device-code-flow-CcQul2R1.js → device-code-flow-D8_wFtpA.js} +3 -3
  51. package/dist/{device-code-flow-CcQul2R1.js.map → device-code-flow-D8_wFtpA.js.map} +1 -1
  52. package/dist/{device-code-flow-C8F3AhEF.cjs → device-code-flow-R-ZBimNL.cjs} +3 -3
  53. package/dist/{device-code-flow-C8F3AhEF.cjs.map → device-code-flow-R-ZBimNL.cjs.map} +1 -1
  54. package/dist/index.cjs +41430 -25488
  55. package/dist/index.cjs.map +1 -1
  56. package/dist/index.js +41270 -25328
  57. package/dist/index.js.map +1 -1
  58. package/dist/{parse-zwbX4Y-K.cjs → parse-CPY7-_2_.cjs} +5 -5
  59. package/dist/parse-CPY7-_2_.cjs.map +1 -0
  60. package/dist/{parse-Da-x492e.js → parse-Dd3OOgIq.js} +5 -5
  61. package/dist/parse-Dd3OOgIq.js.map +1 -0
  62. package/dist/{resolve-CZF3TTNf.cjs → resolve-BsYckCew.cjs} +8 -6
  63. package/dist/resolve-BsYckCew.cjs.map +1 -0
  64. package/dist/{resolve-8tYs_T8S.js → resolve-CS-Bms6W.js} +8 -6
  65. package/dist/resolve-CS-Bms6W.js.map +1 -0
  66. package/dist/{resolve-token-BZT0rfog.js → resolve-token-6Nwn0wwt.js} +3 -3
  67. package/dist/{resolve-token-BZT0rfog.js.map → resolve-token-6Nwn0wwt.js.map} +1 -1
  68. package/dist/{resolve-token-DVtQqc4m.cjs → resolve-token-D8ViFyUf.cjs} +3 -3
  69. package/dist/{resolve-token-DVtQqc4m.cjs.map → resolve-token-D8ViFyUf.cjs.map} +1 -1
  70. package/dist/{stdio-BuQ6IY8U.cjs → stdio-BAG9vDZV.cjs} +2 -3
  71. package/dist/stdio-BAG9vDZV.cjs.map +1 -0
  72. package/dist/{stdio-CFhXG3ra.js → stdio-DFJbp9zP.js} +2 -3
  73. package/dist/stdio-DFJbp9zP.js.map +1 -0
  74. package/dist/transports/stdio.cjs +2 -2
  75. package/dist/transports/stdio.d.cts +0 -1
  76. package/dist/transports/stdio.d.cts.map +1 -1
  77. package/dist/transports/stdio.d.ts +0 -1
  78. package/dist/transports/stdio.d.ts.map +1 -1
  79. package/dist/transports/stdio.js +2 -2
  80. package/dist/{types-BclC2DY0.d.ts → types-BGyk9F4G.d.ts} +6 -57
  81. package/dist/types-BGyk9F4G.d.ts.map +1 -0
  82. package/dist/{types-BJpeKPWI.d.cts → types-C9HgNyIE.d.cts} +6 -57
  83. package/dist/types-C9HgNyIE.d.cts.map +1 -0
  84. package/dist/{types-DcYSHvwR.d.cts → types-D-BIcaY4.d.ts} +3 -3
  85. package/dist/{types-Ky5RNldv.d.ts.map → types-D-BIcaY4.d.ts.map} +1 -1
  86. package/dist/{types-Ky5RNldv.d.ts → types-Dyacb-A8.d.cts} +3 -3
  87. package/dist/{types-DcYSHvwR.d.cts.map → types-Dyacb-A8.d.cts.map} +1 -1
  88. package/dist/{usage-QiSwuC5N.js → usage-Con424Df.js} +6 -4
  89. package/dist/usage-Con424Df.js.map +1 -0
  90. package/dist/{usage-D486x6Lh.cjs → usage-Crfzx1qJ.cjs} +6 -4
  91. package/dist/usage-Crfzx1qJ.cjs.map +1 -0
  92. package/dist/{version-CDrryFjP.cjs → version-CXUk1-K3.cjs} +3 -3
  93. package/dist/version-CXUk1-K3.cjs.map +1 -0
  94. package/dist/version-Duuvuy5h.js +7 -0
  95. package/dist/version-Duuvuy5h.js.map +1 -0
  96. package/package.json +7 -7
  97. package/dist/blob-utils-C7JBV2hl.js +0 -3
  98. package/dist/blob-utils-DaykNmFv.cjs +0 -3
  99. package/dist/config-BXJMmHuY.cjs +0 -7
  100. package/dist/config-CUeobZnr-BYvJlg7Z.js.map +0 -1
  101. package/dist/config-CUeobZnr-C1uLYu0T.cjs.map +0 -1
  102. package/dist/constants-D_84kMgg.js.map +0 -1
  103. package/dist/constants-zNdapUB3.cjs.map +0 -1
  104. package/dist/parse-Da-x492e.js.map +0 -1
  105. package/dist/parse-zwbX4Y-K.cjs.map +0 -1
  106. package/dist/resolve-8tYs_T8S.js.map +0 -1
  107. package/dist/resolve-CZF3TTNf.cjs.map +0 -1
  108. package/dist/stdio-BuQ6IY8U.cjs.map +0 -1
  109. package/dist/stdio-CFhXG3ra.js.map +0 -1
  110. package/dist/types-BJpeKPWI.d.cts.map +0 -1
  111. package/dist/types-BclC2DY0.d.ts.map +0 -1
  112. package/dist/usage-D486x6Lh.cjs.map +0 -1
  113. package/dist/usage-QiSwuC5N.js.map +0 -1
  114. package/dist/version-CDrryFjP.cjs.map +0 -1
  115. package/dist/version-COFS7UF2.js +0 -7
  116. package/dist/version-COFS7UF2.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-D_84kMgg.js","names":[],"sources":["../../mcp-core/dist/events-datasets-DTs4kChz.js","../../mcp-core/dist/url-utils-t-bdCfoW.js","../../mcp-core/dist/scopes.js","../src/auth/constants.ts"],"sourcesContent":["//#region src/utils/events-datasets.ts\nconst PUBLIC_EVENTS_DATASETS = [\n\t\"spans\",\n\t\"errors\",\n\t\"logs\",\n\t\"metrics\",\n\t\"profiles\"\n];\nfunction isMetricsDataset(dataset) {\n\treturn dataset === \"metrics\" || dataset === \"tracemetrics\";\n}\nfunction isProfilesDataset(dataset) {\n\treturn dataset === \"profiles\";\n}\n/**\n* Sentry's product-facing Explore schemas already call this dataset \"metrics\",\n* but the current `/events/` and `/trace-items/attributes/` APIs still expect\n* the legacy `tracemetrics` identifier. Keep MCP aligned with the UI-facing\n* schema and swap only at the transport boundary until the upstream API name\n* catches up.\n*/\nfunction normalizeEventsDataset(dataset) {\n\treturn dataset === \"metrics\" ? \"tracemetrics\" : dataset;\n}\n\n//#endregion\nexport { PUBLIC_EVENTS_DATASETS, isMetricsDataset, isProfilesDataset, normalizeEventsDataset };\n//# sourceMappingURL=events-datasets-DTs4kChz.js.map","import { isMetricsDataset, isProfilesDataset } from \"./events-datasets-DTs4kChz.js\";\n\n//#region src/utils/url-utils.ts\n/**\n* Determines if a Sentry instance is SaaS or self-hosted based on the host.\n* @param host The Sentry host (e.g., \"sentry.io\" or \"sentry.company.com\")\n* @returns true if SaaS instance, false if self-hosted\n*/\nfunction isSentryHost(host) {\n\treturn host === \"sentry.io\" || host.endsWith(\".sentry.io\");\n}\nfunction deriveSelectedFields(fields, aggregateFunctions, groupByFields) {\n\tif (fields && fields.length > 0) return fields;\n\treturn Array.from(new Set([...groupByFields ?? [], ...aggregateFunctions ?? []]));\n}\nfunction getSentryWebBaseUrl(host, organizationSlug, path, protocol = \"https\") {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\treturn isSaas ? `${protocol}://${organizationSlug}.${webHost}${path}` : `${protocol}://${host}/organizations/${organizationSlug}${path}`;\n}\nfunction normalizeTraceMetric(metric) {\n\tif (!metric?.name || !metric.type) return null;\n\treturn {\n\t\tname: metric.name,\n\t\ttype: metric.type,\n\t\tunit: metric.unit && metric.unit !== \"-\" ? metric.unit : void 0\n\t};\n}\nfunction extractTraceMetricFromAggregate(field) {\n\tconst match = field.match(/^[^(]+\\((.*)\\)$/);\n\tif (!match) return null;\n\tconst args = match[1].split(\",\").map((arg) => arg.trim()).filter((arg) => arg.length > 0);\n\tif (args.length < 4) return null;\n\treturn normalizeTraceMetric({\n\t\tname: args[1],\n\t\ttype: args[2],\n\t\tunit: args[3]\n\t});\n}\nfunction extractTraceMetricFromQuery(query) {\n\tconst extractValue = (field) => {\n\t\tconst quotedMatch = query.match(new RegExp(`${field}:\"([^\"]+)\"`, \"i\"));\n\t\tif (quotedMatch?.[1]) return quotedMatch[1];\n\t\tconst unquotedMatch = query.match(new RegExp(`${field}:([^\\\\s]+)`, \"i\"));\n\t\treturn unquotedMatch?.[1] ?? null;\n\t};\n\treturn normalizeTraceMetric({\n\t\tname: extractValue(\"metric\\\\.name\") ?? \"\",\n\t\ttype: extractValue(\"metric\\\\.type\") ?? \"\",\n\t\tunit: extractValue(\"metric\\\\.unit\") ?? void 0\n\t});\n}\nfunction dedupeTraceMetrics(metrics) {\n\tconst deduped = /* @__PURE__ */ new Map();\n\tfor (const metric of metrics) {\n\t\tconst normalizedMetric = normalizeTraceMetric(metric);\n\t\tif (!normalizedMetric) continue;\n\t\tconst key = `${normalizedMetric.name}|${normalizedMetric.type}|${normalizedMetric.unit ?? \"\"}`;\n\t\tdeduped.set(key, normalizedMetric);\n\t}\n\treturn [...deduped.values()];\n}\nfunction buildMetricQueryState(params) {\n\treturn JSON.stringify({\n\t\tmetric: params.metric,\n\t\tquery: params.query,\n\t\taggregateFields: [...params.yAxes.map((yAxis) => ({ yAxes: [yAxis] })), ...(params.groupByFields ?? []).map((field) => ({ groupBy: field }))],\n\t\taggregateSortBys: params.aggregateSortBys ?? [],\n\t\tmode: params.mode\n\t});\n}\nfunction getTraceMetricsExploreUrl(host, organizationSlug, options, protocol = \"https\") {\n\tconst { query, projectId, statsPeriod, start, end, sort, aggregateFunctions, groupByFields, traceMetrics } = options;\n\tconst urlParams = new URLSearchParams();\n\tif (projectId) urlParams.set(\"project\", projectId);\n\tif (start && end) {\n\t\turlParams.set(\"start\", start);\n\t\turlParams.set(\"end\", end);\n\t} else urlParams.set(\"statsPeriod\", statsPeriod || \"24h\");\n\tconst aggregateFields = aggregateFunctions ?? [];\n\tconst aggregateGroupByFields = groupByFields ?? [];\n\tconst isAggregateQuery = aggregateFields.length > 0;\n\tconst sortField = sort?.startsWith(\"-\") ? sort.slice(1) : sort;\n\tconst sortKind = sort?.startsWith(\"-\") ? \"desc\" : \"asc\";\n\tif (isAggregateQuery) {\n\t\tconst metricQueries = /* @__PURE__ */ new Map();\n\t\tfor (const aggregateField of aggregateFields) {\n\t\t\tconst metric = extractTraceMetricFromAggregate(aggregateField);\n\t\t\tif (!metric) continue;\n\t\t\tconst key = `${metric.name}|${metric.type}|${metric.unit ?? \"\"}`;\n\t\t\tconst existing = metricQueries.get(key);\n\t\t\tif (existing) existing.yAxes.push(aggregateField);\n\t\t\telse metricQueries.set(key, {\n\t\t\t\tmetric,\n\t\t\t\tyAxes: [aggregateField]\n\t\t\t});\n\t\t}\n\t\tfor (const { metric, yAxes } of metricQueries.values()) {\n\t\t\tconst aggregateSortBys = sortField && (yAxes.includes(sortField) || aggregateGroupByFields.includes(sortField)) ? [{\n\t\t\t\tfield: sortField,\n\t\t\t\tkind: sortKind\n\t\t\t}] : [];\n\t\t\turlParams.append(\"metric\", buildMetricQueryState({\n\t\t\t\tmetric,\n\t\t\t\tquery,\n\t\t\t\tmode: \"aggregate\",\n\t\t\t\tyAxes,\n\t\t\t\tgroupByFields: aggregateGroupByFields,\n\t\t\t\taggregateSortBys\n\t\t\t}));\n\t\t}\n\t} else {\n\t\tconst sampleMetrics = dedupeTraceMetrics([...traceMetrics ?? [], extractTraceMetricFromQuery(query)]);\n\t\tfor (const metric of sampleMetrics) urlParams.append(\"metric\", buildMetricQueryState({\n\t\t\tmetric,\n\t\t\tquery,\n\t\t\tmode: \"samples\",\n\t\t\tyAxes: [\"sum(value)\"],\n\t\t\taggregateSortBys: [{\n\t\t\t\tfield: \"sum(value)\",\n\t\t\t\tkind: \"desc\"\n\t\t\t}]\n\t\t}));\n\t}\n\treturn `${getSentryWebBaseUrl(host, organizationSlug, \"/explore/metrics/\", protocol)}?${urlParams.toString()}`;\n}\nfunction getProfilingExplorerUrl(host, organizationSlug, options, protocol = \"https\") {\n\tconst { query, projectId, statsPeriod, start, end, sort, fields, aggregateFunctions, groupByFields } = options;\n\tconst urlParams = new URLSearchParams();\n\tif (query) urlParams.set(\"query\", query);\n\tif (projectId) urlParams.set(\"project\", projectId);\n\tif (sort) urlParams.set(\"sort\", sort);\n\tfor (const field of deriveSelectedFields(fields, aggregateFunctions, groupByFields)) urlParams.append(\"field\", field);\n\tif (start && end) {\n\t\turlParams.set(\"start\", start);\n\t\turlParams.set(\"end\", end);\n\t} else urlParams.set(\"statsPeriod\", statsPeriod || \"24h\");\n\treturn `${getSentryWebBaseUrl(host, organizationSlug, \"/explore/profiling/\", protocol)}?${urlParams.toString()}`;\n}\n/**\n* Generates a Sentry issue URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param issueId Issue identifier (e.g., \"PROJECT-123\")\n* @returns The complete issue URL\n*/\nfunction getIssueUrl(host, organizationSlug, issueId, protocol = \"https\") {\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/issues/${issueId}`, protocol);\n}\n/**\n* Generates a Sentry dashboard URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param dashboardId Dashboard ID\n* @param options Optional dashboard view query parameters\n* @param protocol Protocol to use when building the web URL\n* @returns The complete dashboard URL\n*/\nfunction getDashboardUrl(host, organizationSlug, dashboardId, options = {}, protocol = \"https\") {\n\tconst encodedDashboardId = encodeURIComponent(dashboardId);\n\tconst params = new URLSearchParams();\n\tif (options.projectId !== null && options.projectId !== void 0) params.set(\"project\", String(options.projectId));\n\tif (options.statsPeriod) params.set(\"statsPeriod\", options.statsPeriod);\n\tconst queryString = params.toString();\n\treturn `${getSentryWebBaseUrl(host, organizationSlug, `/dashboard/${encodedDashboardId}/`, protocol)}${queryString ? `?${queryString}` : \"\"}`;\n}\n/**\n* Generates a Sentry preprod snapshot URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param snapshotId Preprod snapshot artifact ID\n* @returns The complete snapshot URL\n*/\nfunction getPreprodSnapshotUrl(host, organizationSlug, snapshotId, protocol = \"https\") {\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/preprod/snapshots/${snapshotId}/`, protocol);\n}\n/**\n* Generates a Sentry cron monitor URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param monitorSlug Monitor slug\n* @param projectSlug Optional project slug to disambiguate monitors with the same slug\n* @returns The complete monitor URL\n*/\nfunction getMonitorUrl(host, organizationSlug, monitorSlug, protocol = \"https\", projectSlug) {\n\tconst monitorPath = (projectSlug ? [projectSlug, monitorSlug] : [monitorSlug]).map((segment) => encodeURIComponent(segment)).join(\"/\");\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/crons/${monitorPath}/`, protocol);\n}\n/**\n* Generates a Sentry release URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param releaseVersion Release version identifier\n* @returns The complete release URL\n*/\nfunction getReleaseUrl(host, organizationSlug, releaseVersion, protocol = \"https\") {\n\tconst encodedReleaseVersion = encodeURIComponent(releaseVersion);\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/releases/${encodedReleaseVersion}/`, protocol);\n}\n/**\n* Generates a Sentry issues search URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param query Optional search query\n* @param projectSlugOrId Optional project slug or ID\n* @returns The complete issues search URL\n*/\nfunction getIssuesSearchUrl(host, organizationSlug, query, projectSlugOrId, protocol = \"https\") {\n\tlet url = getSentryWebBaseUrl(host, organizationSlug, \"/issues/\", protocol);\n\tconst params = new URLSearchParams();\n\tif (projectSlugOrId) params.append(\"project\", projectSlugOrId);\n\tif (query) params.append(\"query\", query);\n\tconst queryString = params.toString();\n\tif (queryString) url += `?${queryString}`;\n\treturn url;\n}\n/**\n* Generates a Sentry replay search URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param options Replay search options\n* @returns The complete replay search URL\n*/\nfunction getReplaysSearchUrl(host, organizationSlug, options = {}, protocol = \"https\") {\n\tconst { query, projectSlugOrId, environment, sort, statsPeriod, start, end } = options;\n\tlet url = getSentryWebBaseUrl(host, organizationSlug, \"/explore/replays/\", protocol);\n\tconst params = new URLSearchParams();\n\tif (projectSlugOrId) params.append(\"project\", projectSlugOrId);\n\tif (query) params.append(\"query\", query);\n\tif (environment) {\n\t\tconst environments = Array.isArray(environment) ? environment : [environment];\n\t\tfor (const value of environments) params.append(\"environment\", value);\n\t}\n\tif (sort) params.append(\"sort\", sort);\n\tif (start && end) {\n\t\tparams.append(\"start\", start);\n\t\tparams.append(\"end\", end);\n\t} else if (statsPeriod) params.append(\"statsPeriod\", statsPeriod);\n\tconst queryString = params.toString();\n\tif (queryString) url += `?${queryString}`;\n\treturn url;\n}\n/**\n* Generates a Sentry trace URL for performance investigation.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param traceId Trace identifier\n* @returns The complete trace URL\n*/\nfunction getTraceUrl(host, organizationSlug, traceId, protocol = \"https\") {\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/explore/traces/trace/${traceId}`, protocol);\n}\n/**\n* Generates a Sentry replay URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param replayId Replay identifier\n* @returns The complete replay URL\n*/\nfunction getReplayUrl(host, organizationSlug, replayId, protocol = \"https\") {\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/explore/replays/${replayId}/`, protocol);\n}\n/**\n* Generates a Sentry AI conversation URL.\n* @param host The Sentry host\n* @param organizationSlug Organization identifier\n* @param conversationId AI conversation identifier\n* @returns The complete AI conversation URL\n*/\nfunction getAIConversationUrl(host, organizationSlug, conversationId, protocol = \"https\") {\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/explore/conversations/${encodeURIComponent(conversationId)}/`, protocol);\n}\n/**\n* Extract a single non-negated AI conversation ID from a Sentry search query\n* that filters on `gen_ai.conversation.id`. Returns undefined when the query\n* does not contain exactly one such filter or contains a negated filter.\n*/\nfunction extractConversationIdFromSearchQuery(query) {\n\tif (!query) return void 0;\n\tif (/!gen_ai\\.conversation\\.id:|\\bNOT\\s+(?:\\(\\s*)?gen_ai\\.conversation\\.id:/i.test(query)) return void 0;\n\tconst pattern = /gen_ai\\.conversation\\.id:(?:\"([^\"]+)\"|([^\\s)]+))/g;\n\tconst matches = [...query.matchAll(pattern)];\n\tif (matches.length !== 1) return void 0;\n\tconst conversationId = matches[0][1] ?? matches[0][2];\n\tif (conversationId.startsWith(\"[\")) return void 0;\n\treturn conversationId;\n}\n/**\n* Generates a Sentry AI conversations list URL with optional search filters.\n*/\nfunction getAIConversationsUrl(host, organizationSlug, options = {}, protocol = \"https\") {\n\tconst urlParams = new URLSearchParams();\n\tif (options.query) urlParams.set(\"query\", options.query);\n\tfor (const projectId of options.project ?? []) urlParams.append(\"project\", projectId);\n\tconst environments = Array.isArray(options.environment) ? options.environment : options.environment ? [options.environment] : [];\n\tfor (const environmentName of environments) urlParams.append(\"environment\", environmentName);\n\tif (options.start && options.end) {\n\t\turlParams.set(\"start\", options.start);\n\t\turlParams.set(\"end\", options.end);\n\t} else if (options.statsPeriod) urlParams.set(\"statsPeriod\", options.statsPeriod);\n\tconst baseUrl = getSentryWebBaseUrl(host, organizationSlug, \"/explore/conversations/\", protocol);\n\tconst queryString = urlParams.toString();\n\treturn queryString ? `${baseUrl}?${queryString}` : baseUrl;\n}\nfunction getProfileUrl(host, organizationSlug, projectSlug, profileId, protocol = \"https\") {\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/explore/profiling/profile/${projectSlug}/${profileId}/flamegraph/`, protocol);\n}\nfunction getContinuousProfileUrl(host, organizationSlug, projectSlug, options, protocol = \"https\") {\n\tconst url = new URL(getSentryWebBaseUrl(host, organizationSlug, `/explore/profiling/profile/${projectSlug}/flamegraph/`, protocol));\n\turl.searchParams.set(\"profilerId\", options.profilerId);\n\turl.searchParams.set(\"start\", options.start);\n\turl.searchParams.set(\"end\", options.end);\n\treturn url.toString();\n}\n/**\n* Generates a Sentry events explorer URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param query Search query\n* @param dataset Dataset type\n* @param projectSlug Optional project slug\n* @param fields Optional fields to display\n* @returns The complete events explorer URL\n*/\nfunction getEventsExplorerUrl(host, organizationSlug, query, dataset = \"spans\", projectSlugOrId, fields, explorerOptions, protocol = \"https\") {\n\tif (isMetricsDataset(dataset)) {\n\t\tconst derivedAggregateFunctions = explorerOptions?.aggregateFunctions ?? fields?.filter((field) => field.includes(\"(\") && field.includes(\")\"));\n\t\tconst derivedGroupByFields = explorerOptions?.groupByFields ?? fields?.filter((field) => !field.includes(\"(\") && !field.includes(\")\"));\n\t\treturn getTraceMetricsExploreUrl(host, organizationSlug, {\n\t\t\t...explorerOptions,\n\t\t\tquery,\n\t\t\tprojectId: projectSlugOrId,\n\t\t\taggregateFunctions: derivedAggregateFunctions,\n\t\t\tgroupByFields: derivedGroupByFields\n\t\t}, protocol);\n\t}\n\tif (isProfilesDataset(dataset)) {\n\t\tconst derivedAggregateFunctions = explorerOptions?.aggregateFunctions ?? fields?.filter((field) => field.includes(\"(\") && field.includes(\")\"));\n\t\tconst derivedGroupByFields = explorerOptions?.groupByFields ?? fields?.filter((field) => !field.includes(\"(\") && !field.includes(\")\"));\n\t\treturn getProfilingExplorerUrl(host, organizationSlug, {\n\t\t\tquery,\n\t\t\tprojectId: projectSlugOrId,\n\t\t\tfields,\n\t\t\tsort: explorerOptions?.sort,\n\t\t\tstatsPeriod: explorerOptions?.statsPeriod,\n\t\t\tstart: explorerOptions?.start,\n\t\t\tend: explorerOptions?.end,\n\t\t\taggregateFunctions: derivedAggregateFunctions,\n\t\t\tgroupByFields: derivedGroupByFields\n\t\t}, protocol);\n\t}\n\tlet url = getSentryWebBaseUrl(host, organizationSlug, \"/explore/\", protocol);\n\tconst params = new URLSearchParams();\n\tparams.append(\"query\", query);\n\tparams.append(\"dataset\", dataset);\n\tparams.append(\"layout\", \"table\");\n\tif (projectSlugOrId) params.append(\"project\", projectSlugOrId);\n\tif (fields && fields.length > 0) for (const field of fields) params.append(\"field\", field);\n\turl += `?${params.toString()}`;\n\treturn url;\n}\n/**\n* Internal validation function that checks if a SENTRY_HOST value contains only hostname (no protocol).\n* Throws an error if validation fails instead of exiting the process.\n*\n* @param host The hostname to validate\n* @throws {Error} If the host contains a protocol\n*/\nfunction _validateSentryHostInternal(host) {\n\tif (host.startsWith(\"http://\") || host.startsWith(\"https://\")) throw new Error(\"SENTRY_HOST should only contain a hostname (e.g., sentry.example.com). Use SENTRY_URL if you want to provide a full URL.\");\n}\n/**\n* Internal validation function that checks if a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Throws an error if validation fails instead of exiting the process.\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n* @throws {Error} If the URL is invalid or not HTTPS\n*/\nfunction _validateAndParseSentryUrlInternal(url) {\n\tif (!url.startsWith(\"https://\")) throw new Error(\"SENTRY_URL must be a full HTTPS URL (e.g., https://sentry.example.com).\");\n\ttry {\n\t\tconst parsedUrl = new URL(url);\n\t\treturn parsedUrl.host;\n\t} catch (error) {\n\t\tthrow new Error(\"SENTRY_URL must be a valid HTTPS URL (e.g., https://sentry.example.com).\");\n\t}\n}\n/**\n* Validates that a SENTRY_HOST value contains only hostname (no protocol).\n* Exits the process with error code 1 if validation fails (CLI behavior).\n*\n* @param host The hostname to validate\n*/\nfunction validateSentryHost(host) {\n\ttry {\n\t\t_validateSentryHostInternal(host);\n\t} catch (error) {\n\t\tconsole.error(`Error: ${error.message}`);\n\t\tprocess.exit(1);\n\t}\n}\n/**\n* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Exits the process with error code 1 if validation fails (CLI behavior).\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n*/\nfunction validateAndParseSentryUrl(url) {\n\ttry {\n\t\treturn _validateAndParseSentryUrlInternal(url);\n\t} catch (error) {\n\t\tconsole.error(`Error: ${error.message}`);\n\t\tprocess.exit(1);\n\t}\n}\n/**\n* Validates that a SENTRY_HOST value contains only hostname (no protocol).\n* Throws an error instead of exiting the process (for testing).\n*\n* @param host The hostname to validate\n* @throws {Error} If the host contains a protocol\n*/\nfunction validateSentryHostThrows(host) {\n\t_validateSentryHostInternal(host);\n}\n/**\n* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Throws an error instead of exiting the process (for testing).\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n* @throws {Error} If the URL is invalid or not HTTPS\n*/\nfunction validateAndParseSentryUrlThrows(url) {\n\treturn _validateAndParseSentryUrlInternal(url);\n}\n/**\n* Validates that the provided OpenAI base URL is a valid HTTP(S) URL and returns a normalized string.\n*\n* @param url The URL to validate and normalize\n* @returns The normalized URL string\n* @throws {Error} If the URL is empty, invalid, or uses an unsupported protocol\n*/\nfunction validateOpenAiBaseUrlThrows(url) {\n\tconst trimmed = url.trim();\n\tif (trimmed.length === 0) throw new Error(\"OPENAI base URL must not be empty.\");\n\tlet parsed;\n\ttry {\n\t\tparsed = new URL(trimmed);\n\t} catch (error) {\n\t\tthrow new Error(\"OPENAI base URL must be a valid HTTP or HTTPS URL (e.g., https://example.com/v1).\", { cause: error });\n\t}\n\tif (parsed.protocol !== \"https:\" && parsed.protocol !== \"http:\") throw new Error(\"OPENAI base URL must use http or https scheme (e.g., https://example.com/v1).\");\n\treturn parsed.toString();\n}\n\n//#endregion\nexport { extractConversationIdFromSearchQuery, getAIConversationUrl, getAIConversationsUrl, getContinuousProfileUrl, getDashboardUrl, getEventsExplorerUrl, getIssueUrl, getIssuesSearchUrl, getMonitorUrl, getPreprodSnapshotUrl, getProfileUrl, getProfilingExplorerUrl, getReleaseUrl, getReplayUrl, getReplaysSearchUrl, getTraceMetricsExploreUrl, getTraceUrl, isSentryHost, validateAndParseSentryUrl, validateAndParseSentryUrlThrows, validateOpenAiBaseUrlThrows, validateSentryHost, validateSentryHostThrows };\n//# sourceMappingURL=url-utils-t-bdCfoW.js.map","//#region src/scopes.ts\nconst SCOPES = {\n\t\"org:read\": \"Read organization data\",\n\t\"project:write\": \"Write project data\",\n\t\"team:write\": \"Write team data\",\n\t\"event:write\": \"Write event data\"\n};\n\n//#endregion\nexport { SCOPES };\n//# sourceMappingURL=scopes.js.map","import { SCOPES } from \"@sentry/mcp-core/scopes\";\nimport { isSentryHost } from \"@sentry/mcp-core/utils/url-utils\";\n\n/**\n * Public OAuth app registered on sentry.io for the stdio device code flow.\n * No client secret — device code grant is a public client flow.\n * The Cloudflare transport uses a separate OAuth app with a secret.\n * Override via SENTRY_CLIENT_ID environment variable.\n * See docs/operations/stdio-auth.md for the full credential architecture.\n */\nexport const DEFAULT_SENTRY_CLIENT_ID =\n \"0acbeba7d07d58076dd7dbde8cea2fed8ab525ce3713bda604988009ab35d765\";\n\nexport const DEVICE_CODE_ENDPOINT = \"/oauth/device/code/\";\nexport const TOKEN_ENDPOINT = \"/oauth/token/\";\nexport const DEVICE_CODE_SCOPES = Object.keys(SCOPES).join(\" \");\n\n/** Interval increment on slow_down response (RFC 8628). */\nexport const SLOW_DOWN_INCREMENT_SEC = 5;\n\n/**\n * Whether device code auth is available for this host.\n * Supports sentry.io and regional subdomains (us.sentry.io, eu.sentry.io).\n */\nexport { isSentryHost as isSentryIo };\n\n/**\n * OAuth endpoints live on sentry.io regardless of regional host.\n * Always use this as the host for device code and token requests.\n */\nexport const OAUTH_HOST = \"sentry.io\";\n"],"mappings":";AACA,MAAM,yBAAyB;CAC9B;CACA;CACA;CACA;CACA;AACA;AACD,SAAS,iBAAiB,SAAS;AAClC,QAAO,YAAY,aAAa,YAAY;AAC5C;AACD,SAAS,kBAAkB,SAAS;AACnC,QAAO,YAAY;AACnB;;;;;;;;AAQD,SAAS,uBAAuB,SAAS;AACxC,QAAO,YAAY,YAAY,iBAAiB;AAChD;;;;;;;;;ACfD,SAAS,aAAa,MAAM;AAC3B,QAAO,SAAS,eAAe,KAAK,SAAS,aAAa;AAC1D;AACD,SAAS,qBAAqB,QAAQ,oBAAoB,eAAe;AACxE,KAAI,UAAU,OAAO,SAAS,EAAG,QAAO;AACxC,QAAO,MAAM,KAAK,IAAI,IAAI,CAAC,GAAG,iBAAiB,CAAE,GAAE,GAAG,sBAAsB,CAAE,CAAC,GAAE;AACjF;AACD,SAAS,oBAAoB,MAAM,kBAAkB,MAAM,WAAW,SAAS;CAC9E,MAAM,SAAS,aAAa,KAAK;CACjC,MAAM,UAAU,SAAS,cAAc;AACvC,QAAO,YAAY,SAAS,KAAK,iBAAiB,GAAG,UAAU,YAAY,SAAS,KAAK,KAAK,iBAAiB,mBAAmB;AAClI;AACD,SAAS,qBAAqB,QAAQ;AACrC,MAAK,QAAQ,SAAS,OAAO,KAAM,QAAO;AAC1C,QAAO;EACN,MAAM,OAAO;EACb,MAAM,OAAO;EACb,MAAM,OAAO,QAAQ,OAAO,SAAS,MAAM,OAAO,YAAY;CAC9D;AACD;AACD,SAAS,gCAAgC,OAAO;CAC/C,MAAM,QAAQ,MAAM,MAAM,kBAAkB;AAC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;;;;;AAuDD,SAAS,4BAA4B,MAAM;AAC1C,KAAI,KAAK,WAAW,UAAU,IAAI,KAAK,WAAW,WAAW,CAAE,OAAM,IAAI,MAAM;AAC/E;;;;;;;;;AASD,SAAS,mCAAmC,KAAK;AAChD,MAAK,IAAI,WAAW,WAAW,CAAE,OAAM,IAAI,MAAM;AACjD,KAAI;EACH,MAAM,YAAY,IAAI,IAAI;AAC1B,SAAO,UAAU;CACjB,SAAQ,OAAO;AACf,QAAM,IAAI,MAAM;CAChB;AACD;;;;;;;;AAqCD,SAAS,yBAAyB,MAAM;AACvC,6BAA4B,KAAK;AACjC;;;;;;;;;AASD,SAAS,gCAAgC,KAAK;AAC7C,QAAO,mCAAmC,IAAI;AAC9C;;;;;;;;AAQD,SAAS,4BAA4B,KAAK;CACzC,MAAM,UAAU,IAAI,MAAM;AAC1B,KAAI,QAAQ,WAAW,EAAG,OAAM,IAAI,MAAM;CAC1C,IAAI;AACJ,KAAI;AACH,WAAS,IAAI,IAAI;CACjB,SAAQ,OAAO;AACf,QAAM,IAAI,MAAM,qFAAqF,EAAE,OAAO,MAAO;CACrH;AACD,KAAI,OAAO,aAAa,YAAY,OAAO,aAAa,QAAS,OAAM,IAAI,MAAM;AACjF,QAAO,OAAO,UAAU;AACxB;;;;ACvcD,MAAM,SAAS;CACd,YAAY;CACZ,iBAAiB;CACjB,cAAc;CACd,eAAe;AACf;;;;;;;;;;;ACID,MAAa,2BACX;AAEF,MAAa,uBAAuB;AACpC,MAAa,iBAAiB;AAC9B,MAAa,qBAAqB,OAAO,KAAK,OAAO,CAAC,KAAK,IAAI;;AAG/D,MAAa,0BAA0B;;;;;AAYvC,MAAa,aAAa"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-zNdapUB3.cjs","names":[],"sources":["../../mcp-core/dist/events-datasets-DTs4kChz.js","../../mcp-core/dist/url-utils-t-bdCfoW.js","../../mcp-core/dist/scopes.js","../src/auth/constants.ts"],"sourcesContent":["//#region src/utils/events-datasets.ts\nconst PUBLIC_EVENTS_DATASETS = [\n\t\"spans\",\n\t\"errors\",\n\t\"logs\",\n\t\"metrics\",\n\t\"profiles\"\n];\nfunction isMetricsDataset(dataset) {\n\treturn dataset === \"metrics\" || dataset === \"tracemetrics\";\n}\nfunction isProfilesDataset(dataset) {\n\treturn dataset === \"profiles\";\n}\n/**\n* Sentry's product-facing Explore schemas already call this dataset \"metrics\",\n* but the current `/events/` and `/trace-items/attributes/` APIs still expect\n* the legacy `tracemetrics` identifier. Keep MCP aligned with the UI-facing\n* schema and swap only at the transport boundary until the upstream API name\n* catches up.\n*/\nfunction normalizeEventsDataset(dataset) {\n\treturn dataset === \"metrics\" ? \"tracemetrics\" : dataset;\n}\n\n//#endregion\nexport { PUBLIC_EVENTS_DATASETS, isMetricsDataset, isProfilesDataset, normalizeEventsDataset };\n//# sourceMappingURL=events-datasets-DTs4kChz.js.map","import { isMetricsDataset, isProfilesDataset } from \"./events-datasets-DTs4kChz.js\";\n\n//#region src/utils/url-utils.ts\n/**\n* Determines if a Sentry instance is SaaS or self-hosted based on the host.\n* @param host The Sentry host (e.g., \"sentry.io\" or \"sentry.company.com\")\n* @returns true if SaaS instance, false if self-hosted\n*/\nfunction isSentryHost(host) {\n\treturn host === \"sentry.io\" || host.endsWith(\".sentry.io\");\n}\nfunction deriveSelectedFields(fields, aggregateFunctions, groupByFields) {\n\tif (fields && fields.length > 0) return fields;\n\treturn Array.from(new Set([...groupByFields ?? [], ...aggregateFunctions ?? []]));\n}\nfunction getSentryWebBaseUrl(host, organizationSlug, path, protocol = \"https\") {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\treturn isSaas ? `${protocol}://${organizationSlug}.${webHost}${path}` : `${protocol}://${host}/organizations/${organizationSlug}${path}`;\n}\nfunction normalizeTraceMetric(metric) {\n\tif (!metric?.name || !metric.type) return null;\n\treturn {\n\t\tname: metric.name,\n\t\ttype: metric.type,\n\t\tunit: metric.unit && metric.unit !== \"-\" ? metric.unit : void 0\n\t};\n}\nfunction extractTraceMetricFromAggregate(field) {\n\tconst match = field.match(/^[^(]+\\((.*)\\)$/);\n\tif (!match) return null;\n\tconst args = match[1].split(\",\").map((arg) => arg.trim()).filter((arg) => arg.length > 0);\n\tif (args.length < 4) return null;\n\treturn normalizeTraceMetric({\n\t\tname: args[1],\n\t\ttype: args[2],\n\t\tunit: args[3]\n\t});\n}\nfunction extractTraceMetricFromQuery(query) {\n\tconst extractValue = (field) => {\n\t\tconst quotedMatch = query.match(new RegExp(`${field}:\"([^\"]+)\"`, \"i\"));\n\t\tif (quotedMatch?.[1]) return quotedMatch[1];\n\t\tconst unquotedMatch = query.match(new RegExp(`${field}:([^\\\\s]+)`, \"i\"));\n\t\treturn unquotedMatch?.[1] ?? null;\n\t};\n\treturn normalizeTraceMetric({\n\t\tname: extractValue(\"metric\\\\.name\") ?? \"\",\n\t\ttype: extractValue(\"metric\\\\.type\") ?? \"\",\n\t\tunit: extractValue(\"metric\\\\.unit\") ?? void 0\n\t});\n}\nfunction dedupeTraceMetrics(metrics) {\n\tconst deduped = /* @__PURE__ */ new Map();\n\tfor (const metric of metrics) {\n\t\tconst normalizedMetric = normalizeTraceMetric(metric);\n\t\tif (!normalizedMetric) continue;\n\t\tconst key = `${normalizedMetric.name}|${normalizedMetric.type}|${normalizedMetric.unit ?? \"\"}`;\n\t\tdeduped.set(key, normalizedMetric);\n\t}\n\treturn [...deduped.values()];\n}\nfunction buildMetricQueryState(params) {\n\treturn JSON.stringify({\n\t\tmetric: params.metric,\n\t\tquery: params.query,\n\t\taggregateFields: [...params.yAxes.map((yAxis) => ({ yAxes: [yAxis] })), ...(params.groupByFields ?? []).map((field) => ({ groupBy: field }))],\n\t\taggregateSortBys: params.aggregateSortBys ?? [],\n\t\tmode: params.mode\n\t});\n}\nfunction getTraceMetricsExploreUrl(host, organizationSlug, options, protocol = \"https\") {\n\tconst { query, projectId, statsPeriod, start, end, sort, aggregateFunctions, groupByFields, traceMetrics } = options;\n\tconst urlParams = new URLSearchParams();\n\tif (projectId) urlParams.set(\"project\", projectId);\n\tif (start && end) {\n\t\turlParams.set(\"start\", start);\n\t\turlParams.set(\"end\", end);\n\t} else urlParams.set(\"statsPeriod\", statsPeriod || \"24h\");\n\tconst aggregateFields = aggregateFunctions ?? [];\n\tconst aggregateGroupByFields = groupByFields ?? [];\n\tconst isAggregateQuery = aggregateFields.length > 0;\n\tconst sortField = sort?.startsWith(\"-\") ? sort.slice(1) : sort;\n\tconst sortKind = sort?.startsWith(\"-\") ? \"desc\" : \"asc\";\n\tif (isAggregateQuery) {\n\t\tconst metricQueries = /* @__PURE__ */ new Map();\n\t\tfor (const aggregateField of aggregateFields) {\n\t\t\tconst metric = extractTraceMetricFromAggregate(aggregateField);\n\t\t\tif (!metric) continue;\n\t\t\tconst key = `${metric.name}|${metric.type}|${metric.unit ?? \"\"}`;\n\t\t\tconst existing = metricQueries.get(key);\n\t\t\tif (existing) existing.yAxes.push(aggregateField);\n\t\t\telse metricQueries.set(key, {\n\t\t\t\tmetric,\n\t\t\t\tyAxes: [aggregateField]\n\t\t\t});\n\t\t}\n\t\tfor (const { metric, yAxes } of metricQueries.values()) {\n\t\t\tconst aggregateSortBys = sortField && (yAxes.includes(sortField) || aggregateGroupByFields.includes(sortField)) ? [{\n\t\t\t\tfield: sortField,\n\t\t\t\tkind: sortKind\n\t\t\t}] : [];\n\t\t\turlParams.append(\"metric\", buildMetricQueryState({\n\t\t\t\tmetric,\n\t\t\t\tquery,\n\t\t\t\tmode: \"aggregate\",\n\t\t\t\tyAxes,\n\t\t\t\tgroupByFields: aggregateGroupByFields,\n\t\t\t\taggregateSortBys\n\t\t\t}));\n\t\t}\n\t} else {\n\t\tconst sampleMetrics = dedupeTraceMetrics([...traceMetrics ?? [], extractTraceMetricFromQuery(query)]);\n\t\tfor (const metric of sampleMetrics) urlParams.append(\"metric\", buildMetricQueryState({\n\t\t\tmetric,\n\t\t\tquery,\n\t\t\tmode: \"samples\",\n\t\t\tyAxes: [\"sum(value)\"],\n\t\t\taggregateSortBys: [{\n\t\t\t\tfield: \"sum(value)\",\n\t\t\t\tkind: \"desc\"\n\t\t\t}]\n\t\t}));\n\t}\n\treturn `${getSentryWebBaseUrl(host, organizationSlug, \"/explore/metrics/\", protocol)}?${urlParams.toString()}`;\n}\nfunction getProfilingExplorerUrl(host, organizationSlug, options, protocol = \"https\") {\n\tconst { query, projectId, statsPeriod, start, end, sort, fields, aggregateFunctions, groupByFields } = options;\n\tconst urlParams = new URLSearchParams();\n\tif (query) urlParams.set(\"query\", query);\n\tif (projectId) urlParams.set(\"project\", projectId);\n\tif (sort) urlParams.set(\"sort\", sort);\n\tfor (const field of deriveSelectedFields(fields, aggregateFunctions, groupByFields)) urlParams.append(\"field\", field);\n\tif (start && end) {\n\t\turlParams.set(\"start\", start);\n\t\turlParams.set(\"end\", end);\n\t} else urlParams.set(\"statsPeriod\", statsPeriod || \"24h\");\n\treturn `${getSentryWebBaseUrl(host, organizationSlug, \"/explore/profiling/\", protocol)}?${urlParams.toString()}`;\n}\n/**\n* Generates a Sentry issue URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param issueId Issue identifier (e.g., \"PROJECT-123\")\n* @returns The complete issue URL\n*/\nfunction getIssueUrl(host, organizationSlug, issueId, protocol = \"https\") {\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/issues/${issueId}`, protocol);\n}\n/**\n* Generates a Sentry dashboard URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param dashboardId Dashboard ID\n* @param options Optional dashboard view query parameters\n* @param protocol Protocol to use when building the web URL\n* @returns The complete dashboard URL\n*/\nfunction getDashboardUrl(host, organizationSlug, dashboardId, options = {}, protocol = \"https\") {\n\tconst encodedDashboardId = encodeURIComponent(dashboardId);\n\tconst params = new URLSearchParams();\n\tif (options.projectId !== null && options.projectId !== void 0) params.set(\"project\", String(options.projectId));\n\tif (options.statsPeriod) params.set(\"statsPeriod\", options.statsPeriod);\n\tconst queryString = params.toString();\n\treturn `${getSentryWebBaseUrl(host, organizationSlug, `/dashboard/${encodedDashboardId}/`, protocol)}${queryString ? `?${queryString}` : \"\"}`;\n}\n/**\n* Generates a Sentry preprod snapshot URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param snapshotId Preprod snapshot artifact ID\n* @returns The complete snapshot URL\n*/\nfunction getPreprodSnapshotUrl(host, organizationSlug, snapshotId, protocol = \"https\") {\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/preprod/snapshots/${snapshotId}/`, protocol);\n}\n/**\n* Generates a Sentry cron monitor URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param monitorSlug Monitor slug\n* @param projectSlug Optional project slug to disambiguate monitors with the same slug\n* @returns The complete monitor URL\n*/\nfunction getMonitorUrl(host, organizationSlug, monitorSlug, protocol = \"https\", projectSlug) {\n\tconst monitorPath = (projectSlug ? [projectSlug, monitorSlug] : [monitorSlug]).map((segment) => encodeURIComponent(segment)).join(\"/\");\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/crons/${monitorPath}/`, protocol);\n}\n/**\n* Generates a Sentry release URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param releaseVersion Release version identifier\n* @returns The complete release URL\n*/\nfunction getReleaseUrl(host, organizationSlug, releaseVersion, protocol = \"https\") {\n\tconst encodedReleaseVersion = encodeURIComponent(releaseVersion);\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/releases/${encodedReleaseVersion}/`, protocol);\n}\n/**\n* Generates a Sentry issues search URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param query Optional search query\n* @param projectSlugOrId Optional project slug or ID\n* @returns The complete issues search URL\n*/\nfunction getIssuesSearchUrl(host, organizationSlug, query, projectSlugOrId, protocol = \"https\") {\n\tlet url = getSentryWebBaseUrl(host, organizationSlug, \"/issues/\", protocol);\n\tconst params = new URLSearchParams();\n\tif (projectSlugOrId) params.append(\"project\", projectSlugOrId);\n\tif (query) params.append(\"query\", query);\n\tconst queryString = params.toString();\n\tif (queryString) url += `?${queryString}`;\n\treturn url;\n}\n/**\n* Generates a Sentry replay search URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param options Replay search options\n* @returns The complete replay search URL\n*/\nfunction getReplaysSearchUrl(host, organizationSlug, options = {}, protocol = \"https\") {\n\tconst { query, projectSlugOrId, environment, sort, statsPeriod, start, end } = options;\n\tlet url = getSentryWebBaseUrl(host, organizationSlug, \"/explore/replays/\", protocol);\n\tconst params = new URLSearchParams();\n\tif (projectSlugOrId) params.append(\"project\", projectSlugOrId);\n\tif (query) params.append(\"query\", query);\n\tif (environment) {\n\t\tconst environments = Array.isArray(environment) ? environment : [environment];\n\t\tfor (const value of environments) params.append(\"environment\", value);\n\t}\n\tif (sort) params.append(\"sort\", sort);\n\tif (start && end) {\n\t\tparams.append(\"start\", start);\n\t\tparams.append(\"end\", end);\n\t} else if (statsPeriod) params.append(\"statsPeriod\", statsPeriod);\n\tconst queryString = params.toString();\n\tif (queryString) url += `?${queryString}`;\n\treturn url;\n}\n/**\n* Generates a Sentry trace URL for performance investigation.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param traceId Trace identifier\n* @returns The complete trace URL\n*/\nfunction getTraceUrl(host, organizationSlug, traceId, protocol = \"https\") {\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/explore/traces/trace/${traceId}`, protocol);\n}\n/**\n* Generates a Sentry replay URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param replayId Replay identifier\n* @returns The complete replay URL\n*/\nfunction getReplayUrl(host, organizationSlug, replayId, protocol = \"https\") {\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/explore/replays/${replayId}/`, protocol);\n}\n/**\n* Generates a Sentry AI conversation URL.\n* @param host The Sentry host\n* @param organizationSlug Organization identifier\n* @param conversationId AI conversation identifier\n* @returns The complete AI conversation URL\n*/\nfunction getAIConversationUrl(host, organizationSlug, conversationId, protocol = \"https\") {\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/explore/conversations/${encodeURIComponent(conversationId)}/`, protocol);\n}\n/**\n* Extract a single non-negated AI conversation ID from a Sentry search query\n* that filters on `gen_ai.conversation.id`. Returns undefined when the query\n* does not contain exactly one such filter or contains a negated filter.\n*/\nfunction extractConversationIdFromSearchQuery(query) {\n\tif (!query) return void 0;\n\tif (/!gen_ai\\.conversation\\.id:|\\bNOT\\s+(?:\\(\\s*)?gen_ai\\.conversation\\.id:/i.test(query)) return void 0;\n\tconst pattern = /gen_ai\\.conversation\\.id:(?:\"([^\"]+)\"|([^\\s)]+))/g;\n\tconst matches = [...query.matchAll(pattern)];\n\tif (matches.length !== 1) return void 0;\n\tconst conversationId = matches[0][1] ?? matches[0][2];\n\tif (conversationId.startsWith(\"[\")) return void 0;\n\treturn conversationId;\n}\n/**\n* Generates a Sentry AI conversations list URL with optional search filters.\n*/\nfunction getAIConversationsUrl(host, organizationSlug, options = {}, protocol = \"https\") {\n\tconst urlParams = new URLSearchParams();\n\tif (options.query) urlParams.set(\"query\", options.query);\n\tfor (const projectId of options.project ?? []) urlParams.append(\"project\", projectId);\n\tconst environments = Array.isArray(options.environment) ? options.environment : options.environment ? [options.environment] : [];\n\tfor (const environmentName of environments) urlParams.append(\"environment\", environmentName);\n\tif (options.start && options.end) {\n\t\turlParams.set(\"start\", options.start);\n\t\turlParams.set(\"end\", options.end);\n\t} else if (options.statsPeriod) urlParams.set(\"statsPeriod\", options.statsPeriod);\n\tconst baseUrl = getSentryWebBaseUrl(host, organizationSlug, \"/explore/conversations/\", protocol);\n\tconst queryString = urlParams.toString();\n\treturn queryString ? `${baseUrl}?${queryString}` : baseUrl;\n}\nfunction getProfileUrl(host, organizationSlug, projectSlug, profileId, protocol = \"https\") {\n\treturn getSentryWebBaseUrl(host, organizationSlug, `/explore/profiling/profile/${projectSlug}/${profileId}/flamegraph/`, protocol);\n}\nfunction getContinuousProfileUrl(host, organizationSlug, projectSlug, options, protocol = \"https\") {\n\tconst url = new URL(getSentryWebBaseUrl(host, organizationSlug, `/explore/profiling/profile/${projectSlug}/flamegraph/`, protocol));\n\turl.searchParams.set(\"profilerId\", options.profilerId);\n\turl.searchParams.set(\"start\", options.start);\n\turl.searchParams.set(\"end\", options.end);\n\treturn url.toString();\n}\n/**\n* Generates a Sentry events explorer URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param query Search query\n* @param dataset Dataset type\n* @param projectSlug Optional project slug\n* @param fields Optional fields to display\n* @returns The complete events explorer URL\n*/\nfunction getEventsExplorerUrl(host, organizationSlug, query, dataset = \"spans\", projectSlugOrId, fields, explorerOptions, protocol = \"https\") {\n\tif (isMetricsDataset(dataset)) {\n\t\tconst derivedAggregateFunctions = explorerOptions?.aggregateFunctions ?? fields?.filter((field) => field.includes(\"(\") && field.includes(\")\"));\n\t\tconst derivedGroupByFields = explorerOptions?.groupByFields ?? fields?.filter((field) => !field.includes(\"(\") && !field.includes(\")\"));\n\t\treturn getTraceMetricsExploreUrl(host, organizationSlug, {\n\t\t\t...explorerOptions,\n\t\t\tquery,\n\t\t\tprojectId: projectSlugOrId,\n\t\t\taggregateFunctions: derivedAggregateFunctions,\n\t\t\tgroupByFields: derivedGroupByFields\n\t\t}, protocol);\n\t}\n\tif (isProfilesDataset(dataset)) {\n\t\tconst derivedAggregateFunctions = explorerOptions?.aggregateFunctions ?? fields?.filter((field) => field.includes(\"(\") && field.includes(\")\"));\n\t\tconst derivedGroupByFields = explorerOptions?.groupByFields ?? fields?.filter((field) => !field.includes(\"(\") && !field.includes(\")\"));\n\t\treturn getProfilingExplorerUrl(host, organizationSlug, {\n\t\t\tquery,\n\t\t\tprojectId: projectSlugOrId,\n\t\t\tfields,\n\t\t\tsort: explorerOptions?.sort,\n\t\t\tstatsPeriod: explorerOptions?.statsPeriod,\n\t\t\tstart: explorerOptions?.start,\n\t\t\tend: explorerOptions?.end,\n\t\t\taggregateFunctions: derivedAggregateFunctions,\n\t\t\tgroupByFields: derivedGroupByFields\n\t\t}, protocol);\n\t}\n\tlet url = getSentryWebBaseUrl(host, organizationSlug, \"/explore/\", protocol);\n\tconst params = new URLSearchParams();\n\tparams.append(\"query\", query);\n\tparams.append(\"dataset\", dataset);\n\tparams.append(\"layout\", \"table\");\n\tif (projectSlugOrId) params.append(\"project\", projectSlugOrId);\n\tif (fields && fields.length > 0) for (const field of fields) params.append(\"field\", field);\n\turl += `?${params.toString()}`;\n\treturn url;\n}\n/**\n* Internal validation function that checks if a SENTRY_HOST value contains only hostname (no protocol).\n* Throws an error if validation fails instead of exiting the process.\n*\n* @param host The hostname to validate\n* @throws {Error} If the host contains a protocol\n*/\nfunction _validateSentryHostInternal(host) {\n\tif (host.startsWith(\"http://\") || host.startsWith(\"https://\")) throw new Error(\"SENTRY_HOST should only contain a hostname (e.g., sentry.example.com). Use SENTRY_URL if you want to provide a full URL.\");\n}\n/**\n* Internal validation function that checks if a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Throws an error if validation fails instead of exiting the process.\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n* @throws {Error} If the URL is invalid or not HTTPS\n*/\nfunction _validateAndParseSentryUrlInternal(url) {\n\tif (!url.startsWith(\"https://\")) throw new Error(\"SENTRY_URL must be a full HTTPS URL (e.g., https://sentry.example.com).\");\n\ttry {\n\t\tconst parsedUrl = new URL(url);\n\t\treturn parsedUrl.host;\n\t} catch (error) {\n\t\tthrow new Error(\"SENTRY_URL must be a valid HTTPS URL (e.g., https://sentry.example.com).\");\n\t}\n}\n/**\n* Validates that a SENTRY_HOST value contains only hostname (no protocol).\n* Exits the process with error code 1 if validation fails (CLI behavior).\n*\n* @param host The hostname to validate\n*/\nfunction validateSentryHost(host) {\n\ttry {\n\t\t_validateSentryHostInternal(host);\n\t} catch (error) {\n\t\tconsole.error(`Error: ${error.message}`);\n\t\tprocess.exit(1);\n\t}\n}\n/**\n* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Exits the process with error code 1 if validation fails (CLI behavior).\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n*/\nfunction validateAndParseSentryUrl(url) {\n\ttry {\n\t\treturn _validateAndParseSentryUrlInternal(url);\n\t} catch (error) {\n\t\tconsole.error(`Error: ${error.message}`);\n\t\tprocess.exit(1);\n\t}\n}\n/**\n* Validates that a SENTRY_HOST value contains only hostname (no protocol).\n* Throws an error instead of exiting the process (for testing).\n*\n* @param host The hostname to validate\n* @throws {Error} If the host contains a protocol\n*/\nfunction validateSentryHostThrows(host) {\n\t_validateSentryHostInternal(host);\n}\n/**\n* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Throws an error instead of exiting the process (for testing).\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n* @throws {Error} If the URL is invalid or not HTTPS\n*/\nfunction validateAndParseSentryUrlThrows(url) {\n\treturn _validateAndParseSentryUrlInternal(url);\n}\n/**\n* Validates that the provided OpenAI base URL is a valid HTTP(S) URL and returns a normalized string.\n*\n* @param url The URL to validate and normalize\n* @returns The normalized URL string\n* @throws {Error} If the URL is empty, invalid, or uses an unsupported protocol\n*/\nfunction validateOpenAiBaseUrlThrows(url) {\n\tconst trimmed = url.trim();\n\tif (trimmed.length === 0) throw new Error(\"OPENAI base URL must not be empty.\");\n\tlet parsed;\n\ttry {\n\t\tparsed = new URL(trimmed);\n\t} catch (error) {\n\t\tthrow new Error(\"OPENAI base URL must be a valid HTTP or HTTPS URL (e.g., https://example.com/v1).\", { cause: error });\n\t}\n\tif (parsed.protocol !== \"https:\" && parsed.protocol !== \"http:\") throw new Error(\"OPENAI base URL must use http or https scheme (e.g., https://example.com/v1).\");\n\treturn parsed.toString();\n}\n\n//#endregion\nexport { extractConversationIdFromSearchQuery, getAIConversationUrl, getAIConversationsUrl, getContinuousProfileUrl, getDashboardUrl, getEventsExplorerUrl, getIssueUrl, getIssuesSearchUrl, getMonitorUrl, getPreprodSnapshotUrl, getProfileUrl, getProfilingExplorerUrl, getReleaseUrl, getReplayUrl, getReplaysSearchUrl, getTraceMetricsExploreUrl, getTraceUrl, isSentryHost, validateAndParseSentryUrl, validateAndParseSentryUrlThrows, validateOpenAiBaseUrlThrows, validateSentryHost, validateSentryHostThrows };\n//# sourceMappingURL=url-utils-t-bdCfoW.js.map","//#region src/scopes.ts\nconst SCOPES = {\n\t\"org:read\": \"Read organization data\",\n\t\"project:write\": \"Write project data\",\n\t\"team:write\": \"Write team data\",\n\t\"event:write\": \"Write event data\"\n};\n\n//#endregion\nexport { SCOPES };\n//# sourceMappingURL=scopes.js.map","import { SCOPES } from \"@sentry/mcp-core/scopes\";\nimport { isSentryHost } from \"@sentry/mcp-core/utils/url-utils\";\n\n/**\n * Public OAuth app registered on sentry.io for the stdio device code flow.\n * No client secret — device code grant is a public client flow.\n * The Cloudflare transport uses a separate OAuth app with a secret.\n * Override via SENTRY_CLIENT_ID environment variable.\n * See docs/operations/stdio-auth.md for the full credential architecture.\n */\nexport const DEFAULT_SENTRY_CLIENT_ID =\n \"0acbeba7d07d58076dd7dbde8cea2fed8ab525ce3713bda604988009ab35d765\";\n\nexport const DEVICE_CODE_ENDPOINT = \"/oauth/device/code/\";\nexport const TOKEN_ENDPOINT = \"/oauth/token/\";\nexport const DEVICE_CODE_SCOPES = Object.keys(SCOPES).join(\" \");\n\n/** Interval increment on slow_down response (RFC 8628). */\nexport const SLOW_DOWN_INCREMENT_SEC = 5;\n\n/**\n * Whether device code auth is available for this host.\n * Supports sentry.io and regional subdomains (us.sentry.io, eu.sentry.io).\n */\nexport { isSentryHost as isSentryIo };\n\n/**\n * OAuth endpoints live on sentry.io regardless of regional host.\n * Always use this as the host for device code and token requests.\n */\nexport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EACH,MAAM,YAAY,IAAI,IAAI;AAC1B,SAAO,UAAU;CACjB,SAAQ,OAAO;AACf,QAAM,IAAI,MAAM;CAChB;AACD;;;;;;;;AAqCD,SAAS,yBAAyB,MAAM;AACvC,6BAA4B,KAAK;AACjC;;;;;;;;;AASD,SAAS,gCAAgC,KAAK;AAC7C,QAAO,mCAAmC,IAAI;AAC9C;;;;;;;;AAQD,SAAS,4BAA4B,KAAK;CACzC,MAAM,UAAU,IAAI,MAAM;AAC1B,KAAI,QAAQ,WAAW,EAAG,OAAM,IAAI,MAAM;CAC1C,IAAI;AACJ,KAAI;AACH,WAAS,IAAI,IAAI;CACjB,SAAQ,OAAO;AACf,QAAM,IAAI,MAAM,qFAAqF,EAAE,OAAO,MAAO;CACrH;AACD,KAAI,OAAO,aAAa,YAAY,OAAO,aAAa,QAAS,OAAM,IAAI,MAAM;AACjF,QAAO,OAAO,UAAU;AACxB;;;;ACvcD,MAAM,SAAS;CACd,YAAY;CACZ,iBAAiB;CACjB,cAAc;CACd,eAAe;AACf;;;;;;;;;;;ACID,MAAa,2BACX;AAEF,MAAa,uBAAuB;AACpC,MAAa,iBAAiB;AAC9B,MAAa,qBAAqB,OAAO,KAAK,OAAO,CAAC,KAAK,IAAI;;AAG/D,MAAa,0BAA0B;;;;;AAYvC,MAAa,aAAa"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse-Da-x492e.js","names":["argv: string[]","unknownArgs: string[]","env: NodeJS.ProcessEnv","fromEnv: EnvArgs","cli: CliArgs","env: EnvArgs"],"sources":["../src/cli/parse.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport type { CliArgs, EnvArgs, MergedArgs } from \"./types\";\n\nexport function parseArgv(argv: string[]): CliArgs {\n const options = {\n \"access-token\": { type: \"string\" as const },\n host: { type: \"string\" as const },\n \"insecure-http\": { type: \"boolean\" as const },\n url: { type: \"string\" as const },\n \"mcp-url\": { type: \"string\" as const },\n \"sentry-dsn\": { type: \"string\" as const },\n \"openai-base-url\": { type: \"string\" as const },\n \"openai-model\": { type: \"string\" as const },\n \"anthropic-base-url\": { type: \"string\" as const },\n \"anthropic-model\": { type: \"string\" as const },\n \"agent-provider\": { type: \"string\" as const },\n \"organization-slug\": { type: \"string\" as const },\n \"project-slug\": { type: \"string\" as const },\n skills: { type: \"string\" as const },\n \"disable-skills\": { type: \"string\" as const },\n agent: { type: \"boolean\" as const },\n experimental: { type: \"boolean\" as const },\n help: { type: \"boolean\" as const, short: \"h\" as const },\n version: { type: \"boolean\" as const, short: \"v\" as const },\n };\n\n const { values, positionals, tokens } = parseArgs({\n args: argv,\n options,\n allowPositionals: false,\n strict: false,\n tokens: true,\n });\n\n const knownLong = new Set(Object.keys(options));\n const knownShort = new Set([\n ...(Object.values(options)\n .map((o) => (\"short\" in o ? (o.short as string | undefined) : undefined))\n .filter(Boolean) as string[]),\n ]);\n\n const unknownArgs: string[] = [];\n for (const t of (tokens as any[]) || []) {\n if (t.kind === \"option\") {\n const name = t.name as string | undefined;\n if (name && !(knownLong.has(name) || knownShort.has(name))) {\n unknownArgs.push((t.raw as string) ?? `--${name}`);\n }\n } else if (t.kind === \"positional\") {\n unknownArgs.push((t.raw as string) ?? String(t.value ?? \"\"));\n }\n }\n\n return {\n accessToken: values[\"access-token\"] as string | undefined,\n host: values.host as string | undefined,\n insecureHttp: values[\"insecure-http\"] === true,\n url: values.url as string | undefined,\n mcpUrl: values[\"mcp-url\"] as string | undefined,\n sentryDsn: values[\"sentry-dsn\"] as string | undefined,\n openaiBaseUrl: values[\"openai-base-url\"] as string | undefined,\n openaiModel: values[\"openai-model\"] as string | undefined,\n anthropicBaseUrl: values[\"anthropic-base-url\"] as string | undefined,\n anthropicModel: values[\"anthropic-model\"] as string | undefined,\n agentProvider: values[\"agent-provider\"] as string | undefined,\n organizationSlug: values[\"organization-slug\"] as string | undefined,\n projectSlug: values[\"project-slug\"] as string | undefined,\n skills: values.skills as string | undefined,\n disableSkills: values[\"disable-skills\"] as string | undefined,\n agent: values.agent === true,\n experimental: values.experimental === true,\n help: (values.help as boolean | undefined) === true,\n version: (values.version as boolean | undefined) === true,\n unknownArgs:\n unknownArgs.length > 0 ? unknownArgs : (positionals as string[]) || [],\n };\n}\n\nexport function parseEnv(env: NodeJS.ProcessEnv): EnvArgs {\n const fromEnv: EnvArgs = {};\n if (env.SENTRY_ACCESS_TOKEN) fromEnv.accessToken = env.SENTRY_ACCESS_TOKEN;\n if (env.SENTRY_URL) fromEnv.url = env.SENTRY_URL;\n if (env.SENTRY_HOST) fromEnv.host = env.SENTRY_HOST;\n if (env.MCP_URL) fromEnv.mcpUrl = env.MCP_URL;\n if (env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN)\n fromEnv.sentryDsn = env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN;\n\n if (env.OPENAI_MODEL) fromEnv.openaiModel = env.OPENAI_MODEL;\n if (env.ANTHROPIC_MODEL) fromEnv.anthropicModel = env.ANTHROPIC_MODEL;\n if (env.EMBEDDED_AGENT_PROVIDER)\n fromEnv.agentProvider = env.EMBEDDED_AGENT_PROVIDER;\n if (env.SENTRY_CLIENT_ID) fromEnv.clientId = env.SENTRY_CLIENT_ID;\n if (env.MCP_SKILLS) fromEnv.skills = env.MCP_SKILLS;\n if (env.MCP_DISABLE_SKILLS) fromEnv.disableSkills = env.MCP_DISABLE_SKILLS;\n return fromEnv;\n}\n\nexport function merge(cli: CliArgs, env: EnvArgs): MergedArgs {\n // CLI wins over env\n return {\n accessToken: cli.accessToken ?? env.accessToken,\n // If CLI provided url/host, prefer those; else fall back to env\n url: cli.url ?? env.url,\n host: cli.host ?? env.host,\n insecureHttp: cli.insecureHttp === true,\n mcpUrl: cli.mcpUrl ?? env.mcpUrl,\n sentryDsn: cli.sentryDsn ?? env.sentryDsn,\n openaiBaseUrl: cli.openaiBaseUrl,\n openaiModel: cli.openaiModel ?? env.openaiModel,\n anthropicBaseUrl: cli.anthropicBaseUrl,\n anthropicModel: cli.anthropicModel ?? env.anthropicModel,\n agentProvider: cli.agentProvider ?? env.agentProvider,\n clientId: env.clientId,\n // Skills precedence: CLI skills override env\n skills: cli.skills ?? env.skills,\n disableSkills: cli.disableSkills ?? env.disableSkills,\n agent: cli.agent === true,\n experimental: cli.experimental === true,\n organizationSlug: cli.organizationSlug,\n projectSlug: cli.projectSlug,\n help: cli.help === true,\n version: cli.version === true,\n unknownArgs: cli.unknownArgs,\n };\n}\n"],"mappings":";;;AAGA,SAAgB,UAAUA,MAAyB;CACjD,MAAM,UAAU;EACd,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,MAAM,EAAE,MAAM,SAAmB;EACjC,iBAAiB,EAAE,MAAM,UAAoB;EAC7C,KAAK,EAAE,MAAM,SAAmB;EAChC,WAAW,EAAE,MAAM,SAAmB;EACtC,cAAc,EAAE,MAAM,SAAmB;EACzC,mBAAmB,EAAE,MAAM,SAAmB;EAC9C,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,sBAAsB,EAAE,MAAM,SAAmB;EACjD,mBAAmB,EAAE,MAAM,SAAmB;EAC9C,kBAAkB,EAAE,MAAM,SAAmB;EAC7C,qBAAqB,EAAE,MAAM,SAAmB;EAChD,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,QAAQ,EAAE,MAAM,SAAmB;EACnC,kBAAkB,EAAE,MAAM,SAAmB;EAC7C,OAAO,EAAE,MAAM,UAAoB;EACnC,cAAc,EAAE,MAAM,UAAoB;EAC1C,MAAM;GAAE,MAAM;GAAoB,OAAO;EAAc;EACvD,SAAS;GAAE,MAAM;GAAoB,OAAO;EAAc;CAC3D;CAED,MAAM,EAAE,QAAQ,aAAa,QAAQ,GAAG,UAAU;EAChD,MAAM;EACN;EACA,kBAAkB;EAClB,QAAQ;EACR,QAAQ;CACT,EAAC;CAEF,MAAM,YAAY,IAAI,IAAI,OAAO,KAAK,QAAQ;CAC9C,MAAM,aAAa,IAAI,IAAI,CACzB,GAAI,OAAO,OAAO,QAAQ,CACvB,IAAI,CAAC,MAAO,WA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,gBAAgB,IAAI;AAC9B,KAAI,IAAI,iBAAkB,SAAQ,WAAW,IAAI;AACjD,KAAI,IAAI,WAAY,SAAQ,SAAS,IAAI;AACzC,KAAI,IAAI,mBAAoB,SAAQ,gBAAgB,IAAI;AACxD,QAAO;AACR;AAED,SAAgB,MAAMC,KAAcC,KAA0B;AAE5D,QAAO;EACL,aAAa,IAAI,eAAe,IAAI;EAEpC,KAAK,IAAI,OAAO,IAAI;EACpB,MAAM,IAAI,QAAQ,IAAI;EACtB,cAAc,IAAI,iBAAiB;EACnC,QAAQ,IAAI,UAAU,IAAI;EAC1B,WAAW,IAAI,aAAa,IAAI;EAChC,eAAe,IAAI;EACnB,aAAa,IAAI,eAAe,IAAI;EACpC,kBAAkB,IAAI;EACtB,gBAAgB,IAAI,kBAAkB,IAAI;EAC1C,eAAe,IAAI,iBAAiB,IAAI;EACxC,UAAU,IAAI;EAEd,QAAQ,IAAI,UAAU,IAAI;EAC1B,eAAe,IAAI,iBAAiB,IAAI;EACxC,OAAO,IAAI,UAAU;EACrB,cAAc,IAAI,iBAAiB;EACnC,kBAAkB,IAAI;EACtB,aAAa,IAAI;EACjB,MAAM,IAAI,SAAS;EACnB,SAAS,IAAI,YAAY;EACzB,aAAa,IAAI;CAClB;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"parse-zwbX4Y-K.cjs","names":["argv: string[]","unknownArgs: string[]","env: NodeJS.ProcessEnv","fromEnv: EnvArgs","cli: CliArgs","env: EnvArgs"],"sources":["../src/cli/parse.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport type { CliArgs, EnvArgs, MergedArgs } from \"./types\";\n\nexport function parseArgv(argv: string[]): CliArgs {\n const options = {\n \"access-token\": { type: \"string\" as const },\n host: { type: \"string\" as const },\n \"insecure-http\": { type: \"boolean\" as const },\n url: { type: \"string\" as const },\n \"mcp-url\": { type: \"string\" as const },\n \"sentry-dsn\": { type: \"string\" as const },\n \"openai-base-url\": { type: \"string\" as const },\n \"openai-model\": { type: \"string\" as const },\n \"anthropic-base-url\": { type: \"string\" as const },\n \"anthropic-model\": { type: \"string\" as const },\n \"agent-provider\": { type: \"string\" as const },\n \"organization-slug\": { type: \"string\" as const },\n \"project-slug\": { type: \"string\" as const },\n skills: { type: \"string\" as const },\n \"disable-skills\": { type: \"string\" as const },\n agent: { type: \"boolean\" as const },\n experimental: { type: \"boolean\" as const },\n help: { type: \"boolean\" as const, short: \"h\" as const },\n version: { type: \"boolean\" as const, short: \"v\" as const },\n };\n\n const { values, positionals, tokens } = parseArgs({\n args: argv,\n options,\n allowPositionals: false,\n strict: false,\n tokens: true,\n });\n\n const knownLong = new Set(Object.keys(options));\n const knownShort = new Set([\n ...(Object.values(options)\n .map((o) => (\"short\" in o ? (o.short as string | undefined) : undefined))\n .filter(Boolean) as string[]),\n ]);\n\n const unknownArgs: string[] = [];\n for (const t of (tokens as any[]) || []) {\n if (t.kind === \"option\") {\n const name = t.name as string | undefined;\n if (name && !(knownLong.has(name) || knownShort.has(name))) {\n unknownArgs.push((t.raw as string) ?? `--${name}`);\n }\n } else if (t.kind === \"positional\") {\n unknownArgs.push((t.raw as string) ?? String(t.value ?? \"\"));\n }\n }\n\n return {\n accessToken: values[\"access-token\"] as string | undefined,\n host: values.host as string | undefined,\n insecureHttp: values[\"insecure-http\"] === true,\n url: values.url as string | undefined,\n mcpUrl: values[\"mcp-url\"] as string | undefined,\n sentryDsn: values[\"sentry-dsn\"] as string | undefined,\n openaiBaseUrl: values[\"openai-base-url\"] as string | undefined,\n openaiModel: values[\"openai-model\"] as string | undefined,\n anthropicBaseUrl: values[\"anthropic-base-url\"] as string | undefined,\n anthropicModel: values[\"anthropic-model\"] as string | undefined,\n agentProvider: values[\"agent-provider\"] as string | undefined,\n organizationSlug: values[\"organization-slug\"] as string | undefined,\n projectSlug: values[\"project-slug\"] as string | undefined,\n skills: values.skills as string | undefined,\n disableSkills: values[\"disable-skills\"] as string | undefined,\n agent: values.agent === true,\n experimental: values.experimental === true,\n help: (values.help as boolean | undefined) === true,\n version: (values.version as boolean | undefined) === true,\n unknownArgs:\n unknownArgs.length > 0 ? unknownArgs : (positionals as string[]) || [],\n };\n}\n\nexport function parseEnv(env: NodeJS.ProcessEnv): EnvArgs {\n const fromEnv: EnvArgs = {};\n if (env.SENTRY_ACCESS_TOKEN) fromEnv.accessToken = env.SENTRY_ACCESS_TOKEN;\n if (env.SENTRY_URL) fromEnv.url = env.SENTRY_URL;\n if (env.SENTRY_HOST) fromEnv.host = env.SENTRY_HOST;\n if (env.MCP_URL) fromEnv.mcpUrl = env.MCP_URL;\n if (env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN)\n fromEnv.sentryDsn = env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN;\n\n if (env.OPENAI_MODEL) fromEnv.openaiModel = env.OPENAI_MODEL;\n if (env.ANTHROPIC_MODEL) fromEnv.anthropicModel = env.ANTHROPIC_MODEL;\n if (env.EMBEDDED_AGENT_PROVIDER)\n fromEnv.agentProvider = env.EMBEDDED_AGENT_PROVIDER;\n if (env.SENTRY_CLIENT_ID) fromEnv.clientId = env.SENTRY_CLIENT_ID;\n if (env.MCP_SKILLS) fromEnv.skills = env.MCP_SKILLS;\n if (env.MCP_DISABLE_SKILLS) fromEnv.disableSkills = env.MCP_DISABLE_SKILLS;\n return fromEnv;\n}\n\nexport function merge(cli: CliArgs, env: EnvArgs): MergedArgs {\n // CLI wins over env\n return {\n accessToken: cli.accessToken ?? env.accessToken,\n // If CLI provided url/host, prefer those; else fall back to env\n url: cli.url ?? env.url,\n host: cli.host ?? env.host,\n insecureHttp: cli.insecureHttp === true,\n mcpUrl: cli.mcpUrl ?? env.mcpUrl,\n sentryDsn: cli.sentryDsn ?? env.sentryDsn,\n openaiBaseUrl: cli.openaiBaseUrl,\n openaiModel: cli.openaiModel ?? env.openaiModel,\n anthropicBaseUrl: cli.anthropicBaseUrl,\n anthropicModel: cli.anthropicModel ?? env.anthropicModel,\n agentProvider: cli.agentProvider ?? env.agentProvider,\n clientId: env.clientId,\n // Skills precedence: CLI skills override env\n skills: cli.skills ?? env.skills,\n disableSkills: cli.disableSkills ?? env.disableSkills,\n agent: cli.agent === true,\n experimental: cli.experimental === true,\n organizationSlug: cli.organizationSlug,\n projectSlug: cli.projectSlug,\n help: cli.help === true,\n version: cli.version === true,\n unknownArgs: cli.unknownArgs,\n };\n}\n"],"mappings":";;;;AAGA,SAAgB,UAAUA,MAAyB;CACjD,MAAM,UAAU;EACd,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,MAAM,EAAE,MAAM,SAAmB;EACjC,iBAAiB,EAAE,MAAM,UAAoB;EAC7C,KAAK,EAAE,MAAM,SAAmB;EAChC,WAAW,EAAE,MAAM,SAAmB;EACtC,cAAc,EAAE,MAAM,SAAmB;EACzC,mBAAmB,EAAE,MAAM,SAAmB;EAC9C,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,sBAAsB,EAAE,MAAM,SAAmB;EACjD,mBAAmB,EAAE,MAAM,SAAmB;EAC9C,kBAAkB,EAAE,MAAM,SAAmB;EAC7C,qBAAqB,EAAE,MAAM,SAAmB;EAChD,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,QAAQ,EAAE,MAAM,SAAmB;EACnC,kBAAkB,EAAE,MAAM,SAAmB;EAC7C,OAAO,EAAE,MAAM,UAAoB;EACnC,cAAc,EAAE,MAAM,UAAoB;EAC1C,MAAM;GAAE,MAAM;GAAoB,OAAO;EAAc;EACvD,SAAS;GAAE,MAAM;GAAoB,OAAO;EAAc;CAC3D;CAED,MAAM,EAAE,QAAQ,aAAa,QAAQ,GAAG,yBAAU;EAChD,MAAM;EACN;EACA,kBAAkB;EAClB,QAAQ;EACR,QAAQ;CACT,EAAC;CAEF,MAAM,YAAY,IAAI,IAAI,OAAO,KAAK,QAAQ;CAC9C,MAAM,aAAa,IAAI,IAAI,CACzB,GAAI,OAAO,OAAO,QAAQ,CACvB,IAAI,CAAC,MAAO,WAAW,IAAK,EAAE,eAA0C,C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AAI,IAAI,iBAAkB,SAAQ,WAAW,IAAI;AACjD,KAAI,IAAI,WAAY,SAAQ,SAAS,IAAI;AACzC,KAAI,IAAI,mBAAoB,SAAQ,gBAAgB,IAAI;AACxD,QAAO;AACR;AAED,SAAgB,MAAMC,KAAcC,KAA0B;AAE5D,QAAO;EACL,aAAa,IAAI,eAAe,IAAI;EAEpC,KAAK,IAAI,OAAO,IAAI;EACpB,MAAM,IAAI,QAAQ,IAAI;EACtB,cAAc,IAAI,iBAAiB;EACnC,QAAQ,IAAI,UAAU,IAAI;EAC1B,WAAW,IAAI,aAAa,IAAI;EAChC,eAAe,IAAI;EACnB,aAAa,IAAI,eAAe,IAAI;EACpC,kBAAkB,IAAI;EACtB,gBAAgB,IAAI,kBAAkB,IAAI;EAC1C,eAAe,IAAI,iBAAiB,IAAI;EACxC,UAAU,IAAI;EAEd,QAAQ,IAAI,UAAU,IAAI;EAC1B,eAAe,IAAI,iBAAiB,IAAI;EACxC,OAAO,IAAI,UAAU;EACrB,cAAc,IAAI,iBAAiB;EACnC,kBAAkB,IAAI;EACtB,aAAa,IAAI;EACjB,MAAM,IAAI,SAAS;EACnB,SAAS,IAAI,YAAY;EACzB,aAAa,IAAI;CAClB;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-8tYs_T8S.js","names":["invalid: string[]","source?: string","url?: string","host?: string","input: MergedArgs","finalSkills: Set<Skill>","agentProvider:\n | \"openai\"\n | \"azure-openai\"\n | \"anthropic\"\n | \"openrouter\"\n | undefined"],"sources":["../../mcp-core/dist/skills-C8WO-Jal.js","../src/cli/resolve.ts"],"sourcesContent":["//#region src/skills.ts\nconst SKILLS = {\n\tinspect: {\n\t\tid: \"inspect\",\n\t\tname: \"Inspect Issues & Events\",\n\t\tdescription: \"Read-only access to core Sentry data: issues, events, traces, replays, releases, monitors, profiles, documentation, and project metadata\",\n\t\tdefaultEnabled: true,\n\t\torder: 1\n\t},\n\tseer: {\n\t\tid: \"seer\",\n\t\tname: \"Seer\",\n\t\tdescription: \"Sentry's AI debugger that helps you analyze, root cause, and fix issues\",\n\t\tdefaultEnabled: true,\n\t\torder: 2\n\t},\n\tdocs: {\n\t\tid: \"docs\",\n\t\tname: \"Documentation\",\n\t\tdescription: \"Deprecated legacy docs-only grant. Documentation tools are now available through Inspect Issues & Events.\",\n\t\tdefaultEnabled: false,\n\t\tdeprecated: true,\n\t\torder: 3\n\t},\n\ttriage: {\n\t\tid: \"triage\",\n\t\tname: \"Triage Issues\",\n\t\tdescription: \"Resolve, assign, and update issues\",\n\t\tdefaultEnabled: false,\n\t\torder: 4\n\t},\n\t\"project-management\": {\n\t\tid: \"project-management\",\n\t\tname: \"Manage Projects & Teams\",\n\t\tdescription: \"Create and modify projects, teams, and DSNs\",\n\t\tdefaultEnabled: false,\n\t\torder: 5\n\t}\n};\nconst SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);\nasync function getSkillsArrayWithCounts() {\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst surfacesModule = await import(\"./tools/surfaces.js\");\n\tconst tools = toolsModule.default;\n\tconst isCatalogInfrastructureTool = surfacesModule.isCatalogInfrastructureToolName;\n\tconst isWrapperTool = surfacesModule.isWrapperToolName;\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const skill of Object.keys(SKILLS)) counts.set(skill, 0);\n\tfor (const [toolName, tool] of Object.entries(tools)) {\n\t\tif (isWrapperTool(toolName) || isCatalogInfrastructureTool(toolName)) continue;\n\t\tif (Array.isArray(tool.skills)) for (const skill of tool.skills) counts.set(skill, (counts.get(skill) || 0) + 1);\n\t}\n\treturn SKILLS_ARRAY.map((skill) => ({\n\t\t...skill,\n\t\ttoolCount: counts.get(skill.id) || 0\n\t}));\n}\nconst ALL_SKILLS = Object.keys(SKILLS);\nconst ACTIVE_SKILLS = SKILLS_ARRAY.filter((s) => !s.deprecated).map((s) => s.id);\nconst DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);\nfunction isValidSkill(skill) {\n\treturn Object.hasOwn(SKILLS, skill);\n}\nfunction isEnabledBySkills(grantedSkills, toolSkills) {\n\tif (!grantedSkills || toolSkills.length === 0) return false;\n\treturn toolSkills.some((skill) => grantedSkills.has(skill));\n}\nfunction parseSkills(input) {\n\tconst valid = /* @__PURE__ */ new Set();\n\tconst invalid = [];\n\tif (!input) return {\n\t\tvalid,\n\t\tinvalid\n\t};\n\tlet skills = [];\n\tif (typeof input === \"string\") skills = input.split(\",\");\n\telse if (Array.isArray(input)) skills = input.map((v) => typeof v === \"string\" ? v : \"\");\n\tfor (const skill of skills) {\n\t\tconst trimmed = String(skill).trim();\n\t\tif (isValidSkill(trimmed)) valid.add(trimmed);\n\t\telse if (trimmed) invalid.push(trimmed);\n\t}\n\treturn {\n\t\tvalid,\n\t\tinvalid\n\t};\n}\nasync function getScopesForSkills(grantedSkills) {\n\tconst { DEFAULT_SCOPES } = await import(\"./constants.js\");\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst surfacesModule = await import(\"./tools/surfaces.js\");\n\tconst tools = toolsModule.default;\n\tconst isCatalogInfrastructureTool = surfacesModule.isCatalogInfrastructureToolName;\n\tconst isWrapperTool = surfacesModule.isWrapperToolName;\n\tconst scopes = new Set(DEFAULT_SCOPES);\n\tfor (const [toolName, tool] of Object.entries(tools)) {\n\t\tif (isWrapperTool(toolName) || isCatalogInfrastructureTool(toolName)) continue;\n\t\tconst toolEnabled = tool.skills.some((skill) => grantedSkills.has(skill));\n\t\tif (toolEnabled) for (const scope of tool.requiredScopes) scopes.add(scope);\n\t}\n\treturn scopes;\n}\n\n//#endregion\nexport { ACTIVE_SKILLS, ALL_SKILLS, DEFAULT_SKILLS, SKILLS, SKILLS_ARRAY, getScopesForSkills, getSkillsArrayWithCounts, isEnabledBySkills, isValidSkill, parseSkills };\n//# sourceMappingURL=skills-C8WO-Jal.js.map","import {\n ACTIVE_SKILLS,\n ALL_SKILLS,\n parseSkills,\n type Skill,\n} from \"@sentry/mcp-core/skills\";\nimport {\n isSentryHost,\n validateAndParseSentryUrlThrows,\n validateOpenAiBaseUrlThrows,\n validateSentryHostThrows,\n} from \"@sentry/mcp-core/utils/url-utils\";\nimport { DEFAULT_SENTRY_CLIENT_ID } from \"../auth/constants\";\nimport type { MergedArgs, PartiallyResolvedConfig } from \"./types\";\n\nexport function formatInvalidSkills(\n invalid: string[],\n source?: string,\n): string {\n const prefix = source ? `${source} provided` : \"Invalid skills provided\";\n return `Error: ${prefix}: ${invalid.join(\", \")}\\nAvailable skills: ${ALL_SKILLS.join(\", \")}`;\n}\n\n/**\n * Resolves the Sentry host from url/host inputs with validation.\n * Used by both the server flow (finalize) and auth commands (resolveAuthContext)\n * to ensure cache keys always match.\n */\nexport function resolveHost(url?: string, host?: string): string {\n if (url) {\n return validateAndParseSentryUrlThrows(url);\n }\n if (host) {\n validateSentryHostThrows(host);\n return host;\n }\n return \"sentry.io\";\n}\n\nexport function finalize(input: MergedArgs): PartiallyResolvedConfig {\n if (input.insecureHttp && input.url) {\n throw new Error(\n \"Error: --insecure-http cannot be used with --url or SENTRY_URL. Use --host for insecure self-hosted instances.\",\n );\n }\n\n const sentryHost = resolveHost(input.url, input.host);\n\n if (input.insecureHttp && isSentryHost(sentryHost)) {\n throw new Error(\n \"Error: --insecure-http is only supported for self-hosted Sentry hosts.\",\n );\n }\n\n const sentryProtocol = input.insecureHttp ? \"http\" : \"https\";\n\n // Skills resolution\n //\n // IMPORTANT: stdio (CLI) intentionally defaults to all active skills when no --skills flag is provided\n //\n // This differs from the OAuth flow, which requires explicit user selection:\n // - stdio/CLI: Non-interactive, defaults to all non-deprecated skills\n // - OAuth: Interactive, requires user to explicitly select skills (with sensible defaults pre-checked)\n //\n // Rationale:\n // We don't want the MCP to break if users don't specify skills. stdio is typically used in\n // local development and CI/CD environments where maximum access by default is expected.\n // OAuth is used in multi-tenant hosted environments where users should consciously grant\n // permissions on a per-app basis.\n //\n // For OAuth validation that enforces minimum 1 skill selection, see:\n // packages/mcp-cloudflare/src/server/oauth/routes/callback.ts (lines 234-248)\n //\n let finalSkills: Set<Skill>;\n if (input.skills) {\n // Override: use only the specified skills\n const { valid, invalid } = parseSkills(input.skills);\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid));\n }\n if (valid.size === 0) {\n throw new Error(\"Error: Invalid skills provided. No valid skills found.\");\n }\n finalSkills = valid;\n } else {\n // Default: grant all active skills when no flag is provided (see comment block above for rationale)\n finalSkills = new Set<Skill>(ACTIVE_SKILLS);\n }\n\n // Disable-skills: remove specific skills from the active set\n if (input.disableSkills) {\n const { valid: skillsToDisable, invalid } = parseSkills(\n input.disableSkills,\n );\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid, \"--disable-skills\"));\n }\n for (const skill of skillsToDisable) {\n finalSkills.delete(skill);\n }\n if (finalSkills.size === 0) {\n throw new Error(\n \"Error: All skills have been disabled. At least one skill must remain enabled.\",\n );\n }\n }\n\n const resolvedOpenAiBaseUrl = input.openaiBaseUrl\n ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl)\n : undefined;\n\n // Validate anthropic base URL if provided (same validation as OpenAI)\n const resolvedAnthropicBaseUrl = input.anthropicBaseUrl\n ? validateOpenAiBaseUrlThrows(input.anthropicBaseUrl)\n : undefined;\n\n // Validate agent provider if explicitly set\n let agentProvider:\n | \"openai\"\n | \"azure-openai\"\n | \"anthropic\"\n | \"openrouter\"\n | undefined = undefined;\n if (input.agentProvider) {\n const provider = input.agentProvider.toLowerCase();\n if (\n provider !== \"openai\" &&\n provider !== \"azure-openai\" &&\n provider !== \"anthropic\" &&\n provider !== \"openrouter\"\n ) {\n throw new Error(\n `Error: Invalid agent provider \"${input.agentProvider}\". Must be \"openai\", \"azure-openai\", \"anthropic\", or \"openrouter\".`,\n );\n }\n agentProvider = provider;\n }\n\n return {\n accessToken: input.accessToken,\n clientId: input.clientId || DEFAULT_SENTRY_CLIENT_ID,\n sentryHost,\n sentryProtocol,\n mcpUrl: input.mcpUrl,\n sentryDsn: input.sentryDsn,\n openaiBaseUrl: resolvedOpenAiBaseUrl,\n openaiModel: input.openaiModel,\n anthropicBaseUrl: resolvedAnthropicBaseUrl,\n anthropicModel: input.anthropicModel,\n agentProvider,\n finalSkills,\n organizationSlug: input.organizationSlug,\n projectSlug: input.projectSlug,\n };\n}\n"],"mappings":";;;AACA,MAAM,SAAS;CACd,SAAS;EACR,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,YAAY;EACZ,OAAO;CACP;CACD,QAAQ;EACP,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,sBAAsB;EACrB,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;AACD;AACD,MAAM,eAAe,OAAO,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM;AAkB5E,MAAM,aAAa,OAAO,KAAK,OAAO;AACtC,MAAM,gBAAgB,aAAa,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG;AAChF,MAAM,iBAAiB,aAAa,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG;AACpF,SAAS,aAAa,OAAO;AAC5B,QAAO,OAAO,OAAO,QAAQ,MAAM;AACnC;AACD,SAAS,kBAAkB,eAAe,YAAY;AACrD,MAAK,iBAAiB,WAAW,WAAW,EAAG,QAAO;AACtD,QAAO,WAAW,KAAK,CAAC,UAAU,cAAc,IAAI,MAAM,CAAC;AAC3D;AACD,SAAS,YAAY,OAAO;CAC3B,MAAM,wBAAwB,IAAI;CAClC,MAAM,UAAU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,EAAE,OAAO,iBAAiB,SAAS,GAAG,YAC1C,MAAM,cACP;AACD,MAAI,QAAQ,SAAS,EACnB,OAAM,IAAI,MAAM,oBAAoB,SAAS,mBAAmB;AAElE,OAAK,MAAM,SAAS,gBAClB,aAAY,OAAO,MAAM;AAE3B,MAAI,YAAY,SAAS,EACvB,OAAM,IAAI,MACR;CAGL;CAED,MAAM,wBAAwB,MAAM,gBAChC,4BAA4B,MAAM,cAAc;CAIpD,MAAM,2BAA2B,MAAM,mBACnC,4BAA4B,MAAM,iBAAiB;CAIvD,IAAIC;AAMJ,KAAI,MAAM,eAAe;EACvB,MAAM,WAAW,MAAM,cAAc,aAAa;AAClD,MACE,aAAa,YACb,aAAa,kBACb,aAAa,eACb,aAAa,aAEb,OAAM,IAAI,OACP,iCAAiC,MAAM,cAAc;AAG1D,kBAAgB;CACjB;AAED,QAAO;EACL,aAAa,MAAM;EACnB,UAAU,MAAM,YAAY;EAC5B;EACA;EACA,QAAQ,MAAM;EACd,WAAW,MAAM;EACjB,eAAe;EACf,aAAa,MAAM;EACnB,kBAAkB;EAClB,gBAAgB,MAAM;EACtB;EACA;EACA,kBAAkB,MAAM;EACxB,aAAa,MAAM;CACpB;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-CZF3TTNf.cjs","names":["invalid: string[]","source?: string","url?: string","host?: string","input: MergedArgs","finalSkills: Set<Skill>","agentProvider:\n | \"openai\"\n | \"azure-openai\"\n | \"anthropic\"\n | \"openrouter\"\n | undefined","DEFAULT_SENTRY_CLIENT_ID"],"sources":["../../mcp-core/dist/skills-C8WO-Jal.js","../src/cli/resolve.ts"],"sourcesContent":["//#region src/skills.ts\nconst SKILLS = {\n\tinspect: {\n\t\tid: \"inspect\",\n\t\tname: \"Inspect Issues & Events\",\n\t\tdescription: \"Read-only access to core Sentry data: issues, events, traces, replays, releases, monitors, profiles, documentation, and project metadata\",\n\t\tdefaultEnabled: true,\n\t\torder: 1\n\t},\n\tseer: {\n\t\tid: \"seer\",\n\t\tname: \"Seer\",\n\t\tdescription: \"Sentry's AI debugger that helps you analyze, root cause, and fix issues\",\n\t\tdefaultEnabled: true,\n\t\torder: 2\n\t},\n\tdocs: {\n\t\tid: \"docs\",\n\t\tname: \"Documentation\",\n\t\tdescription: \"Deprecated legacy docs-only grant. Documentation tools are now available through Inspect Issues & Events.\",\n\t\tdefaultEnabled: false,\n\t\tdeprecated: true,\n\t\torder: 3\n\t},\n\ttriage: {\n\t\tid: \"triage\",\n\t\tname: \"Triage Issues\",\n\t\tdescription: \"Resolve, assign, and update issues\",\n\t\tdefaultEnabled: false,\n\t\torder: 4\n\t},\n\t\"project-management\": {\n\t\tid: \"project-management\",\n\t\tname: \"Manage Projects & Teams\",\n\t\tdescription: \"Create and modify projects, teams, and DSNs\",\n\t\tdefaultEnabled: false,\n\t\torder: 5\n\t}\n};\nconst SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);\nasync function getSkillsArrayWithCounts() {\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst surfacesModule = await import(\"./tools/surfaces.js\");\n\tconst tools = toolsModule.default;\n\tconst isCatalogInfrastructureTool = surfacesModule.isCatalogInfrastructureToolName;\n\tconst isWrapperTool = surfacesModule.isWrapperToolName;\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const skill of Object.keys(SKILLS)) counts.set(skill, 0);\n\tfor (const [toolName, tool] of Object.entries(tools)) {\n\t\tif (isWrapperTool(toolName) || isCatalogInfrastructureTool(toolName)) continue;\n\t\tif (Array.isArray(tool.skills)) for (const skill of tool.skills) counts.set(skill, (counts.get(skill) || 0) + 1);\n\t}\n\treturn SKILLS_ARRAY.map((skill) => ({\n\t\t...skill,\n\t\ttoolCount: counts.get(skill.id) || 0\n\t}));\n}\nconst ALL_SKILLS = Object.keys(SKILLS);\nconst ACTIVE_SKILLS = SKILLS_ARRAY.filter((s) => !s.deprecated).map((s) => s.id);\nconst DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);\nfunction isValidSkill(skill) {\n\treturn Object.hasOwn(SKILLS, skill);\n}\nfunction isEnabledBySkills(grantedSkills, toolSkills) {\n\tif (!grantedSkills || toolSkills.length === 0) return false;\n\treturn toolSkills.some((skill) => grantedSkills.has(skill));\n}\nfunction parseSkills(input) {\n\tconst valid = /* @__PURE__ */ new Set();\n\tconst invalid = [];\n\tif (!input) return {\n\t\tvalid,\n\t\tinvalid\n\t};\n\tlet skills = [];\n\tif (typeof input === \"string\") skills = input.split(\",\");\n\telse if (Array.isArray(input)) skills = input.map((v) => typeof v === \"string\" ? v : \"\");\n\tfor (const skill of skills) {\n\t\tconst trimmed = String(skill).trim();\n\t\tif (isValidSkill(trimmed)) valid.add(trimmed);\n\t\telse if (trimmed) invalid.push(trimmed);\n\t}\n\treturn {\n\t\tvalid,\n\t\tinvalid\n\t};\n}\nasync function getScopesForSkills(grantedSkills) {\n\tconst { DEFAULT_SCOPES } = await import(\"./constants.js\");\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst surfacesModule = await import(\"./tools/surfaces.js\");\n\tconst tools = toolsModule.default;\n\tconst isCatalogInfrastructureTool = surfacesModule.isCatalogInfrastructureToolName;\n\tconst isWrapperTool = surfacesModule.isWrapperToolName;\n\tconst scopes = new Set(DEFAULT_SCOPES);\n\tfor (const [toolName, tool] of Object.entries(tools)) {\n\t\tif (isWrapperTool(toolName) || isCatalogInfrastructureTool(toolName)) continue;\n\t\tconst toolEnabled = tool.skills.some((skill) => grantedSkills.has(skill));\n\t\tif (toolEnabled) for (const scope of tool.requiredScopes) scopes.add(scope);\n\t}\n\treturn scopes;\n}\n\n//#endregion\nexport { ACTIVE_SKILLS, ALL_SKILLS, DEFAULT_SKILLS, SKILLS, SKILLS_ARRAY, getScopesForSkills, getSkillsArrayWithCounts, isEnabledBySkills, isValidSkill, parseSkills };\n//# sourceMappingURL=skills-C8WO-Jal.js.map","import {\n ACTIVE_SKILLS,\n ALL_SKILLS,\n parseSkills,\n type Skill,\n} from \"@sentry/mcp-core/skills\";\nimport {\n isSentryHost,\n validateAndParseSentryUrlThrows,\n validateOpenAiBaseUrlThrows,\n validateSentryHostThrows,\n} from \"@sentry/mcp-core/utils/url-utils\";\nimport { DEFAULT_SENTRY_CLIENT_ID } from \"../auth/constants\";\nimport type { MergedArgs, PartiallyResolvedConfig } from \"./types\";\n\nexport function formatInvalidSkills(\n invalid: string[],\n source?: string,\n): string {\n const prefix = source ? `${source} provided` : \"Invalid skills provided\";\n return `Error: ${prefix}: ${invalid.join(\", \")}\\nAvailable skills: ${ALL_SKILLS.join(\", \")}`;\n}\n\n/**\n * Resolves the Sentry host from url/host inputs with validation.\n * Used by both the server flow (finalize) and auth commands (resolveAuthContext)\n * to ensure cache keys always match.\n */\nexport function resolveHost(url?: string, host?: string): string {\n if (url) {\n return validateAndParseSentryUrlThrows(url);\n }\n if (host) {\n validateSentryHostThrows(host);\n return host;\n }\n return \"sentry.io\";\n}\n\nexport function finalize(input: MergedArgs): PartiallyResolvedConfig {\n if (input.insecureHttp && input.url) {\n throw new Error(\n \"Error: --insecure-http cannot be used with --url or SENTRY_URL. Use --host for insecure self-hosted instances.\",\n );\n }\n\n const sentryHost = resolveHost(input.url, input.host);\n\n if (input.insecureHttp && isSentryHost(sentryHost)) {\n throw new Error(\n \"Error: --insecure-http is only supported for self-hosted Sentry hosts.\",\n );\n }\n\n const sentryProtocol = input.insecureHttp ? \"http\" : \"https\";\n\n // Skills resolution\n //\n // IMPORTANT: stdio (CLI) intentionally defaults to all active skills when no --skills flag is provided\n //\n // This differs from the OAuth flow, which requires explicit user selection:\n // - stdio/CLI: Non-interactive, defaults to all non-deprecated skills\n // - OAuth: Interactive, requires user to explicitly select skills (with sensible defaults pre-checked)\n //\n // Rationale:\n // We don't want the MCP to break if users don't specify skills. stdio is typically used in\n // local development and CI/CD environments where maximum access by default is expected.\n // OAuth is used in multi-tenant hosted environments where users should consciously grant\n // permissions on a per-app basis.\n //\n // For OAuth validation that enforces minimum 1 skill selection, see:\n // packages/mcp-cloudflare/src/server/oauth/routes/callback.ts (lines 234-248)\n //\n let finalSkills: Set<Skill>;\n if (input.skills) {\n // Override: use only the specified skills\n const { valid, invalid } = parseSkills(input.skills);\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid));\n }\n if (valid.size === 0) {\n throw new Error(\"Error: Invalid skills provided. No valid skills found.\");\n }\n finalSkills = valid;\n } else {\n // Default: grant all active skills when no flag is provided (see comment block above for rationale)\n finalSkills = new Set<Skill>(ACTIVE_SKILLS);\n }\n\n // Disable-skills: remove specific skills from the active set\n if (input.disableSkills) {\n const { valid: skillsToDisable, invalid } = parseSkills(\n input.disableSkills,\n );\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid, \"--disable-skills\"));\n }\n for (const skill of skillsToDisable) {\n finalSkills.delete(skill);\n }\n if (finalSkills.size === 0) {\n throw new Error(\n \"Error: All skills have been disabled. At least one skill must remain enabled.\",\n );\n }\n }\n\n const resolvedOpenAiBaseUrl = input.openaiBaseUrl\n ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl)\n : undefined;\n\n // Validate anthropic base URL if provided (same validation as OpenAI)\n const resolvedAnthropicBaseUrl = input.anthropicBaseUrl\n ? validateOpenAiBaseUrlThrows(input.anthropicBaseUrl)\n : undefined;\n\n // Validate agent provider if explicitly set\n let agentProvider:\n | \"openai\"\n | \"azure-openai\"\n | \"anthropic\"\n | \"openrouter\"\n | undefined = undefined;\n if (input.agentProvider) {\n const provider = input.agentProvider.toLowerCase();\n if (\n provider !== \"openai\" &&\n provider !== \"azure-openai\" &&\n provider !== \"anthropic\" &&\n provider !== \"openrouter\"\n ) {\n throw new Error(\n `Error: Invalid agent provider \"${input.agentProvider}\". Must be \"openai\", \"azure-openai\", \"anthropic\", or \"openrouter\".`,\n );\n }\n agentProvider = provider;\n }\n\n return {\n accessToken: input.accessToken,\n clientId: input.clientId || DEFAULT_SENTRY_CLIENT_ID,\n sentryHost,\n sentryProtocol,\n mcpUrl: input.mcpUrl,\n sentryDsn: input.sentryDsn,\n openaiBaseUrl: resolvedOpenAiBaseUrl,\n openaiModel: input.openaiModel,\n anthropicBaseUrl: resolvedAnthropicBaseUrl,\n anthropicModel: input.anthropicModel,\n agentProvider,\n finalSkills,\n organizationSlug: input.organizationSlug,\n projectSlug: input.projectSlug,\n };\n}\n"],"mappings":";;;AACA,MAAM,SAAS;CACd,SAAS;EACR,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,YAAY;EACZ,OAAO;CACP;CACD,QAAQ;EACP,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,sBAAsB;EACrB,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;AACD;AACD,MAAM,eAAe,OAAO,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM;AAkB5E,MAAM,aAAa,OAAO,KAAK,OAAO;AACtC,MAAM,gBAAgB,aAAa,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG;AAChF,MAAM,iBAAiB,aAAa,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG;AACpF,SAAS,aAAa,OAAO;AAC5B,QAAO,OAAO,OAAO,QAAQ,MAAM;AACnC;AACD,SAAS,kBAAkB,eAAe,YAAY;AACrD,MAAK,iBAAiB,WAAW,WAAW,EAAG,QAAO;AACtD,QAAO,WAAW,KAAK,CAAC,UAAU,cAAc,IAAI,MAAM,CAAC;AAC3D;AACD,SAAS,YAAY,OAAO;CAC3B,MAAM,wBAAwB,IAAI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M,eAAe;EACvB,MAAM,EAAE,OAAO,iBAAiB,SAAS,GAAG,YAC1C,MAAM,cACP;AACD,MAAI,QAAQ,SAAS,EACnB,OAAM,IAAI,MAAM,oBAAoB,SAAS,mBAAmB;AAElE,OAAK,MAAM,SAAS,gBAClB,aAAY,OAAO,MAAM;AAE3B,MAAI,YAAY,SAAS,EACvB,OAAM,IAAI,MACR;CAGL;CAED,MAAM,wBAAwB,MAAM,gBAChC,8CAA4B,MAAM,cAAc;CAIpD,MAAM,2BAA2B,MAAM,mBACnC,8CAA4B,MAAM,iBAAiB;CAIvD,IAAIC;AAMJ,KAAI,MAAM,eAAe;EACvB,MAAM,WAAW,MAAM,cAAc,aAAa;AAClD,MACE,aAAa,YACb,aAAa,kBACb,aAAa,eACb,aAAa,aAEb,OAAM,IAAI,OACP,iCAAiC,MAAM,cAAc;AAG1D,kBAAgB;CACjB;AAED,QAAO;EACL,aAAa,MAAM;EACnB,UAAU,MAAM,YAAYC;EAC5B;EACA;EACA,QAAQ,MAAM;EACd,WAAW,MAAM;EACjB,eAAe;EACf,aAAa,MAAM;EACnB,kBAAkB;EAClB,gBAAgB,MAAM;EACtB;EACA;EACA,kBAAkB,MAAM;EACxB,aAAa,MAAM;CACpB;AACF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"stdio-BuQ6IY8U.cjs","names":["context: StdioServerContext","attributes: Record<string, string | boolean>","LIB_VERSION","server: McpServer","context: Context","StdioServerTransport"],"sources":["../src/transports/stdio.ts"],"sourcesContent":["import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\n/**\n * Standard I/O Transport for MCP Server.\n *\n * Provides stdio-based communication for the Sentry MCP server, typically used\n * when the server runs as a subprocess communicating via stdin/stdout pipes.\n *\n * @example Basic Usage\n * ```typescript\n * import { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\n * import { startStdio } from \"./transports/stdio.js\";\n *\n * const server = new Server();\n * const context = {\n * accessToken: process.env.SENTRY_TOKEN,\n * host: \"sentry.io\"\n * };\n *\n * await startStdio(server, context);\n * ```\n */\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { LIB_VERSION } from \"@sentry/mcp-core/version\";\nimport * as Sentry from \"@sentry/node\";\n\nexport type StdioServerContext = {\n sentryHost?: string;\n mcpUrl?: string;\n agentMode?: boolean;\n experimentalMode?: boolean;\n};\n\nfunction getStdioSpanAttributes(\n context: StdioServerContext,\n): Record<string, string | boolean> {\n const attributes: Record<string, string | boolean> = {\n \"app.transport\": \"stdio\",\n \"app.server.version\": LIB_VERSION,\n \"app.server.mode.agent\": context.agentMode ?? false,\n \"app.server.mode.experimental\": context.experimentalMode ?? false,\n \"network.transport\": \"pipe\",\n \"service.version\": LIB_VERSION,\n };\n\n if (context.sentryHost) {\n attributes[\"app.upstream.host\"] = context.sentryHost;\n }\n if (context.mcpUrl) {\n attributes[\"app.url.full\"] = context.mcpUrl;\n }\n\n return attributes;\n}\n\n/**\n * Starts the MCP server with stdio transport and telemetry.\n *\n * Connects the server using stdio transport for process-based communication.\n * Context is already captured in tool handler closures during buildServer().\n * All operations are wrapped in Sentry tracing for observability.\n *\n * @param server - Configured and instrumented MCP server instance (with context in closures)\n * @param context - Context values used for telemetry attributes\n *\n * @example CLI Integration\n * ```typescript\n * import { buildServer } from \"./server.js\";\n * import { startStdio } from \"./transports/stdio.js\";\n *\n * const context = {\n * accessToken: userToken,\n * sentryHost: \"sentry.io\",\n * userId: \"user-123\",\n * clientId: \"cursor-ide\",\n * constraints: {}\n * };\n *\n * const server = buildServer({ context }); // Context captured in closures\n * await startStdio(server, context);\n * ```\n */\nexport async function startStdio<Context extends StdioServerContext>(\n server: McpServer,\n context: Context,\n) {\n await Sentry.startNewTrace(async () => {\n return await Sentry.startSpan(\n {\n name: \"mcp.server/stdio\",\n attributes: getStdioSpanAttributes(context),\n },\n async () => {\n // Context already captured in tool handler closures during buildServer()\n const transport = new StdioServerTransport();\n await server.connect(transport);\n },\n );\n });\n}\n"],"mappings":";;;;;;AAgCA,SAAS,uBACPA,SACkC;CAClC,MAAMC,aAA+C;EACnD,iBAAiB;EACjB,sBAAsBC;EACtB,yBAAyB,QAAQ,aAAa;EAC9C,gCAAgC,QAAQ,oBAAoB;EAC5D,qBAAqB;EACrB,mBAAmBA;CACpB;AAED,KAAI,QAAQ,WACV,YAAW,uBAAuB,QAAQ;AAE5C,KAAI,QAAQ,OACV,YAAW,kBAAkB,QAAQ;AAGvC,QAAO;AACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BD,eAAsB,WACpBC,QACAC,SACA;AACA,OAAM,cAAO,cAAc,YAAY;AACrC,SAAO,MAAM,cAAO,UAClB;GACE,MAAM;GACN,YAAY,uBAAuB,QAAQ;EAC5C,GACD,YAAY;GAEV,MAAM,YAAY,IAAIC;AACtB,SAAM,OAAO,QAAQ,UAAU;EAChC,EACF;CACF,EAAC;AACH"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"stdio-CFhXG3ra.js","names":["context: StdioServerContext","attributes: Record<string, string | boolean>","server: McpServer","context: Context"],"sources":["../src/transports/stdio.ts"],"sourcesContent":["import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\n/**\n * Standard I/O Transport for MCP Server.\n *\n * Provides stdio-based communication for the Sentry MCP server, typically used\n * when the server runs as a subprocess communicating via stdin/stdout pipes.\n *\n * @example Basic Usage\n * ```typescript\n * import { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\n * import { startStdio } from \"./transports/stdio.js\";\n *\n * const server = new Server();\n * const context = {\n * accessToken: process.env.SENTRY_TOKEN,\n * host: \"sentry.io\"\n * };\n *\n * await startStdio(server, context);\n * ```\n */\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { LIB_VERSION } from \"@sentry/mcp-core/version\";\nimport * as Sentry from \"@sentry/node\";\n\nexport type StdioServerContext = {\n sentryHost?: string;\n mcpUrl?: string;\n agentMode?: boolean;\n experimentalMode?: boolean;\n};\n\nfunction getStdioSpanAttributes(\n context: StdioServerContext,\n): Record<string, string | boolean> {\n const attributes: Record<string, string | boolean> = {\n \"app.transport\": \"stdio\",\n \"app.server.version\": LIB_VERSION,\n \"app.server.mode.agent\": context.agentMode ?? false,\n \"app.server.mode.experimental\": context.experimentalMode ?? false,\n \"network.transport\": \"pipe\",\n \"service.version\": LIB_VERSION,\n };\n\n if (context.sentryHost) {\n attributes[\"app.upstream.host\"] = context.sentryHost;\n }\n if (context.mcpUrl) {\n attributes[\"app.url.full\"] = context.mcpUrl;\n }\n\n return attributes;\n}\n\n/**\n * Starts the MCP server with stdio transport and telemetry.\n *\n * Connects the server using stdio transport for process-based communication.\n * Context is already captured in tool handler closures during buildServer().\n * All operations are wrapped in Sentry tracing for observability.\n *\n * @param server - Configured and instrumented MCP server instance (with context in closures)\n * @param context - Context values used for telemetry attributes\n *\n * @example CLI Integration\n * ```typescript\n * import { buildServer } from \"./server.js\";\n * import { startStdio } from \"./transports/stdio.js\";\n *\n * const context = {\n * accessToken: userToken,\n * sentryHost: \"sentry.io\",\n * userId: \"user-123\",\n * clientId: \"cursor-ide\",\n * constraints: {}\n * };\n *\n * const server = buildServer({ context }); // Context captured in closures\n * await startStdio(server, context);\n * ```\n */\nexport async function startStdio<Context extends StdioServerContext>(\n server: McpServer,\n context: Context,\n) {\n await Sentry.startNewTrace(async () => {\n return await Sentry.startSpan(\n {\n name: \"mcp.server/stdio\",\n attributes: getStdioSpanAttributes(context),\n },\n async () => {\n // Context already captured in tool handler closures during buildServer()\n const transport = new StdioServerTransport();\n await server.connect(transport);\n },\n );\n });\n}\n"],"mappings":";;;;;AAgCA,SAAS,uBACPA,SACkC;CAClC,MAAMC,aAA+C;EACnD,iBAAiB;EACjB,sBAAsB;EACtB,yBAAyB,QAAQ,aAAa;EAC9C,gCAAgC,QAAQ,oBAAoB;EAC5D,qBAAqB;EACrB,mBAAmB;CACpB;AAED,KAAI,QAAQ,WACV,YAAW,uBAAuB,QAAQ;AAE5C,KAAI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;;;;;;;;;;;;;;;;KA3BF,aAAA,GAAgB,CAAA,CAAE,aAAa;;;;KAK/B,WAAA;;;;;;;;;iBAYI,iBAAA,gBAAiC;iBAMjC,aAAA,gBACC,sDAGd"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"usage-D486x6Lh.cjs","names":["packageName: string","allSkills: ReadonlyArray<Skill>"],"sources":["../src/cli/usage.ts"],"sourcesContent":["import type { Skill } from \"@sentry/mcp-core/skills\";\n\nexport function buildUsage(\n packageName: string,\n allSkills: ReadonlyArray<Skill>,\n): string {\n return `Usage: ${packageName} [--access-token=<token>] [--host=<host>] [--insecure-http]\n ${packageName} auth [login|logout|status]\n\nCommands:\n auth login Authenticate via device code flow (sentry.io only)\n auth logout Clear cached authentication\n auth status Show current authentication state\n\nAuthentication:\n --access-token <token> Sentry User Auth Token with API access\n Optional for sentry.io (device code flow is used if omitted)\n Required for self-hosted instances\n\nCommon optional flags:\n --host <host> Change Sentry host (self-hosted)\n --insecure-http Use http:// for self-hosted --host values\n --sentry-dsn <dsn> Override DSN used for telemetry reporting\n --agent Agent mode: only expose use_sentry tool (for AI agents)\n --experimental Enable forward-looking tool variants and experimental features\n\nEmbedded agent configuration:\n --agent-provider <provider> LLM provider: openai, azure-openai, anthropic, or openrouter (auto-detects from API keys)\n --openai-base-url <url> Override OpenAI API base URL\n --openai-model <model> Override OpenAI model (default: gpt-5)\n --anthropic-base-url <url> Override Anthropic API base URL\n --anthropic-model <model> Override Anthropic model (default: claude-sonnet-4-5)\n\nSession constraints:\n --organization-slug <slug> Force all calls to an organization\n --project-slug <slug> Optional project constraint\n\nSkill controls:\n --skills <list> Specify which skills to grant (default: active, non-deprecated skills)\n --disable-skills <list> Remove specific skills (e.g. --disable-skills=seer)\n\nAll skills: ${allSkills.join(\", \")}\n\nEnvironment variables:\n SENTRY_ACCESS_TOKEN Sentry auth token (alternative to --access-token)\n SENTRY_CLIENT_ID Override OAuth client ID for device code flow\n OPENAI_API_KEY OpenAI API key for AI-powered search tools\n ANTHROPIC_API_KEY Anthropic API key for AI-powered search tools\n OPENROUTER_API_KEY OpenRouter API key for AI-powered search tools\n OPENROUTER_MODEL OpenRouter model (default: openai/gpt-5)\n EMBEDDED_AGENT_PROVIDER Provider override: openai, azure-openai, anthropic, or openrouter\n MCP_DISABLE_SKILLS Disable specific skills (comma-separated)\n\nExamples:\n ${packageName} # device code auth (sentry.io only)\n ${packageName} --access-token=TOKEN\n ${packageName} --access-token=TOKEN --skills=inspect,triage\n ${packageName} --access-token=TOKEN --host=sentry.example.com\n ${packageName} --access-token=TOKEN --host=sentry.internal:9000 --insecure-http\n ${packageName} --access-token=TOKEN --host=sentry.example.com --disable-skills=seer\n ${packageName} --access-token=TOKEN --agent-provider=azure-openai --openai-base-url=https://example.openai.azure.com/openai/v1/\n ${packageName} --access-token=TOKEN --agent-provider=anthropic\n ${packageName} --access-token=TOKEN --agent-provider=openrouter`;\n}\n"],"mappings":";;AAEA,SAAgB,WACdA,aACAC,WACQ;AACR,SAAQ,SAAS,YAAY;SACtB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkCP,UAAU,KAAK,KAAK,CAAC;;;;;;;;;;;;;IAa/B,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;AACf"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"usage-QiSwuC5N.js","names":["packageName: string","allSkills: ReadonlyArray<Skill>"],"sources":["../src/cli/usage.ts"],"sourcesContent":["import type { Skill } from \"@sentry/mcp-core/skills\";\n\nexport function buildUsage(\n packageName: string,\n allSkills: ReadonlyArray<Skill>,\n): string {\n return `Usage: ${packageName} [--access-token=<token>] [--host=<host>] [--insecure-http]\n ${packageName} auth [login|logout|status]\n\nCommands:\n auth login Authenticate via device code flow (sentry.io only)\n auth logout Clear cached authentication\n auth status Show current authentication state\n\nAuthentication:\n --access-token <token> Sentry User Auth Token with API access\n Optional for sentry.io (device code flow is used if omitted)\n Required for self-hosted instances\n\nCommon optional flags:\n --host <host> Change Sentry host (self-hosted)\n --insecure-http Use http:// for self-hosted --host values\n --sentry-dsn <dsn> Override DSN used for telemetry reporting\n --agent Agent mode: only expose use_sentry tool (for AI agents)\n --experimental Enable forward-looking tool variants and experimental features\n\nEmbedded agent configuration:\n --agent-provider <provider> LLM provider: openai, azure-openai, anthropic, or openrouter (auto-detects from API keys)\n --openai-base-url <url> Override OpenAI API base URL\n --openai-model <model> Override OpenAI model (default: gpt-5)\n --anthropic-base-url <url> Override Anthropic API base URL\n --anthropic-model <model> Override Anthropic model (default: claude-sonnet-4-5)\n\nSession constraints:\n --organization-slug <slug> Force all calls to an organization\n --project-slug <slug> Optional project constraint\n\nSkill controls:\n --skills <list> Specify which skills to grant (default: active, non-deprecated skills)\n --disable-skills <list> Remove specific skills (e.g. --disable-skills=seer)\n\nAll skills: ${allSkills.join(\", \")}\n\nEnvironment variables:\n SENTRY_ACCESS_TOKEN Sentry auth token (alternative to --access-token)\n SENTRY_CLIENT_ID Override OAuth client ID for device code flow\n OPENAI_API_KEY OpenAI API key for AI-powered search tools\n ANTHROPIC_API_KEY Anthropic API key for AI-powered search tools\n OPENROUTER_API_KEY OpenRouter API key for AI-powered search tools\n OPENROUTER_MODEL OpenRouter model (default: openai/gpt-5)\n EMBEDDED_AGENT_PROVIDER Provider override: openai, azure-openai, anthropic, or openrouter\n MCP_DISABLE_SKILLS Disable specific skills (comma-separated)\n\nExamples:\n ${packageName} # device code auth (sentry.io only)\n ${packageName} --access-token=TOKEN\n ${packageName} --access-token=TOKEN --skills=inspect,triage\n ${packageName} --access-token=TOKEN --host=sentry.example.com\n ${packageName} --access-token=TOKEN --host=sentry.internal:9000 --insecure-http\n ${packageName} --access-token=TOKEN --host=sentry.example.com --disable-skills=seer\n ${packageName} --access-token=TOKEN --agent-provider=azure-openai --openai-base-url=https://example.openai.azure.com/openai/v1/\n ${packageName} --access-token=TOKEN --agent-provider=anthropic\n ${packageName} --access-token=TOKEN --agent-provider=openrouter`;\n}\n"],"mappings":";AAEA,SAAgB,WACdA,aACAC,WACQ;AACR,SAAQ,SAAS,YAAY;SACtB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkCP,UAAU,KAAK,KAAK,CAAC;;;;;;;;;;;;;IAa/B,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;AACf"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"version-CDrryFjP.cjs","names":[],"sources":["../../mcp-core/dist/version-DQZH5nTw.js"],"sourcesContent":["//#region src/version.ts\nconst LIB_VERSION = typeof process !== \"undefined\" && \"0.37.0\" || \"0.0.0\";\nconst USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;\n\n//#endregion\nexport { LIB_VERSION, USER_AGENT };\n//# sourceMappingURL=version-DQZH5nTw.js.map"],"mappings":";;AACA,MAAM,qBAAqB,YAAY,eAAe,YAAY;AAClE,MAAM,cAAc,aAAa,YAAY"}
@@ -1,7 +0,0 @@
1
- //#region ../mcp-core/dist/version-DQZH5nTw.js
2
- const LIB_VERSION = typeof process !== "undefined" && "0.37.0" || "0.0.0";
3
- const USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;
4
-
5
- //#endregion
6
- export { LIB_VERSION, USER_AGENT };
7
- //# sourceMappingURL=version-COFS7UF2.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version-COFS7UF2.js","names":[],"sources":["../../mcp-core/dist/version-DQZH5nTw.js"],"sourcesContent":["//#region src/version.ts\nconst LIB_VERSION = typeof process !== \"undefined\" && \"0.37.0\" || \"0.0.0\";\nconst USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;\n\n//#endregion\nexport { LIB_VERSION, USER_AGENT };\n//# sourceMappingURL=version-DQZH5nTw.js.map"],"mappings":";AACA,MAAM,qBAAqB,YAAY,eAAe,YAAY;AAClE,MAAM,cAAc,aAAa,YAAY"}