@sentry/mcp-server 0.23.1 → 0.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/parse.cjs +1 -1
- package/dist/cli/parse.d.cts +1 -1
- package/dist/cli/parse.d.cts.map +1 -1
- package/dist/cli/parse.d.ts +1 -1
- package/dist/cli/parse.d.ts.map +1 -1
- package/dist/cli/parse.js +1 -1
- package/dist/cli/resolve.cjs +1 -2
- package/dist/cli/resolve.d.cts +2 -3
- package/dist/cli/resolve.d.cts.map +1 -1
- package/dist/cli/resolve.d.ts +2 -3
- package/dist/cli/resolve.d.ts.map +1 -1
- package/dist/cli/resolve.js +2 -2
- package/dist/cli/types.d.cts +1 -1
- package/dist/cli/types.d.ts +1 -1
- package/dist/cli/usage.cjs +1 -1
- package/dist/cli/usage.d.cts +1 -2
- package/dist/cli/usage.d.cts.map +1 -1
- package/dist/cli/usage.d.ts +1 -2
- package/dist/cli/usage.d.ts.map +1 -1
- package/dist/cli/usage.js +1 -1
- package/dist/config-BEgU9ylR.js +3 -0
- package/dist/{config-DtimzxvV-D3ccpxhQ.cjs → config-BoFBjXRq-CGHqlnJ9.cjs} +296 -4
- package/dist/config-BoFBjXRq-CGHqlnJ9.cjs.map +1 -0
- package/dist/{config-DtimzxvV-BItTrGiz.js → config-BoFBjXRq-CMdBQOkQ.js} +291 -5
- package/dist/config-BoFBjXRq-CMdBQOkQ.js.map +1 -0
- package/dist/config-rZ982IEm.cjs +7 -0
- package/dist/index.cjs +482 -316
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +438 -272
- package/dist/index.js.map +1 -1
- package/dist/{parse-Dn9XeQSj.js → parse-46t_fITC.js} +2 -26
- package/dist/parse-46t_fITC.js.map +1 -0
- package/dist/{parse-By6nDBNs.cjs → parse-BjIH83SX.cjs} +2 -26
- package/dist/parse-BjIH83SX.cjs.map +1 -0
- package/dist/resolve-CdTP9riu.cjs +286 -0
- package/dist/resolve-CdTP9riu.cjs.map +1 -0
- package/dist/resolve-Cg3SH2zt.js +232 -0
- package/dist/resolve-Cg3SH2zt.js.map +1 -0
- package/dist/{stdio-aCI9XyaI.cjs → stdio-Cl-Ib8bu.cjs} +4 -4
- package/dist/{stdio-aCI9XyaI.cjs.map → stdio-Cl-Ib8bu.cjs.map} +1 -1
- package/dist/{stdio-232a22j4.js → stdio-CwqdTAhY.js} +4 -4
- package/dist/{stdio-232a22j4.js.map → stdio-CwqdTAhY.js.map} +1 -1
- package/dist/transports/stdio.cjs +1 -1
- package/dist/transports/stdio.js +1 -1
- package/dist/{types-CM88pHH_.d.ts → types-D5f00mg9.d.ts} +2 -11
- package/dist/types-D5f00mg9.d.ts.map +1 -0
- package/dist/{types-CnLRMjvf.d.cts → types-DpmAC3S8.d.cts} +2 -11
- package/dist/types-DpmAC3S8.d.cts.map +1 -0
- package/dist/{usage-DMGbIpV-.js → usage-BzYvqaru.js} +3 -11
- package/dist/usage-BzYvqaru.js.map +1 -0
- package/dist/{usage-iwGZsu3a.cjs → usage-DD58xBe3.cjs} +3 -11
- package/dist/usage-DD58xBe3.cjs.map +1 -0
- package/package.json +7 -6
- package/dist/config-Bs1p6XwV.js +0 -3
- package/dist/config-DFewJLVx.cjs +0 -6
- package/dist/config-DtimzxvV-BItTrGiz.js.map +0 -1
- package/dist/config-DtimzxvV-D3ccpxhQ.cjs.map +0 -1
- package/dist/parse-By6nDBNs.cjs.map +0 -1
- package/dist/parse-Dn9XeQSj.js.map +0 -1
- package/dist/resolve-BCdS4js5.js +0 -590
- package/dist/resolve-BCdS4js5.js.map +0 -1
- package/dist/resolve-BMmRdCFJ.cjs +0 -692
- package/dist/resolve-BMmRdCFJ.cjs.map +0 -1
- package/dist/types-CM88pHH_.d.ts.map +0 -1
- package/dist/types-CnLRMjvf.d.cts.map +0 -1
- package/dist/usage-DMGbIpV-.js.map +0 -1
- package/dist/usage-iwGZsu3a.cjs.map +0 -1
package/dist/resolve-BCdS4js5.js
DELETED
|
@@ -1,590 +0,0 @@
|
|
|
1
|
-
//#region ../mcp-core/dist/skills-BmFl7P6V.js
|
|
2
|
-
const SKILLS = {
|
|
3
|
-
inspect: {
|
|
4
|
-
id: "inspect",
|
|
5
|
-
name: "Inspect Issues & Events",
|
|
6
|
-
description: "Search for errors, analyze traces, and explore event details",
|
|
7
|
-
defaultEnabled: true,
|
|
8
|
-
order: 1
|
|
9
|
-
},
|
|
10
|
-
seer: {
|
|
11
|
-
id: "seer",
|
|
12
|
-
name: "Seer",
|
|
13
|
-
description: "Sentry's AI debugger that helps you analyze, root cause, and fix issues",
|
|
14
|
-
defaultEnabled: true,
|
|
15
|
-
order: 2
|
|
16
|
-
},
|
|
17
|
-
docs: {
|
|
18
|
-
id: "docs",
|
|
19
|
-
name: "Documentation",
|
|
20
|
-
description: "Search and read Sentry SDK documentation",
|
|
21
|
-
defaultEnabled: false,
|
|
22
|
-
order: 3
|
|
23
|
-
},
|
|
24
|
-
triage: {
|
|
25
|
-
id: "triage",
|
|
26
|
-
name: "Triage Issues",
|
|
27
|
-
description: "Resolve, assign, and update issues",
|
|
28
|
-
defaultEnabled: false,
|
|
29
|
-
order: 4
|
|
30
|
-
},
|
|
31
|
-
"project-management": {
|
|
32
|
-
id: "project-management",
|
|
33
|
-
name: "Manage Projects & Teams",
|
|
34
|
-
description: "Create and modify projects, teams, and DSNs",
|
|
35
|
-
defaultEnabled: false,
|
|
36
|
-
order: 5
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
const SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);
|
|
40
|
-
const ALL_SKILLS = Object.keys(SKILLS);
|
|
41
|
-
const DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);
|
|
42
|
-
function isValidSkill(skill) {
|
|
43
|
-
return skill in SKILLS;
|
|
44
|
-
}
|
|
45
|
-
function hasRequiredSkills(grantedSkills, requiredSkills) {
|
|
46
|
-
if (!grantedSkills || requiredSkills.length === 0) return false;
|
|
47
|
-
return requiredSkills.some((skill) => grantedSkills.has(skill));
|
|
48
|
-
}
|
|
49
|
-
function parseSkills(input) {
|
|
50
|
-
const valid = /* @__PURE__ */ new Set();
|
|
51
|
-
const invalid = [];
|
|
52
|
-
if (!input) return {
|
|
53
|
-
valid,
|
|
54
|
-
invalid
|
|
55
|
-
};
|
|
56
|
-
let skills = [];
|
|
57
|
-
if (typeof input === "string") skills = input.split(",");
|
|
58
|
-
else if (Array.isArray(input)) skills = input.map((v) => typeof v === "string" ? v : "");
|
|
59
|
-
for (const skill of skills) {
|
|
60
|
-
const trimmed = String(skill).trim();
|
|
61
|
-
if (isValidSkill(trimmed)) valid.add(trimmed);
|
|
62
|
-
else if (trimmed) invalid.push(trimmed);
|
|
63
|
-
}
|
|
64
|
-
return {
|
|
65
|
-
valid,
|
|
66
|
-
invalid
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
//#endregion
|
|
71
|
-
//#region ../mcp-core/dist/constants-D8axTonA.js
|
|
72
|
-
/**
|
|
73
|
-
* Constants for Sentry MCP server.
|
|
74
|
-
*
|
|
75
|
-
* Defines platform and framework combinations available in Sentry documentation.
|
|
76
|
-
*/
|
|
77
|
-
/**
|
|
78
|
-
* MCP Server identification
|
|
79
|
-
*/
|
|
80
|
-
const MCP_SERVER_NAME = "Sentry MCP";
|
|
81
|
-
/**
|
|
82
|
-
* Allowed region domains for sentry.io
|
|
83
|
-
* Only these specific domains are permitted when using Sentry's cloud service
|
|
84
|
-
* This is used to prevent SSRF attacks by restricting regionUrl to known domains
|
|
85
|
-
*/
|
|
86
|
-
const SENTRY_ALLOWED_REGION_DOMAINS = new Set([
|
|
87
|
-
"sentry.io",
|
|
88
|
-
"us.sentry.io",
|
|
89
|
-
"de.sentry.io"
|
|
90
|
-
]);
|
|
91
|
-
/**
|
|
92
|
-
* Common Sentry platforms that have documentation available
|
|
93
|
-
*/
|
|
94
|
-
const SENTRY_PLATFORMS_BASE = [
|
|
95
|
-
"javascript",
|
|
96
|
-
"python",
|
|
97
|
-
"java",
|
|
98
|
-
"dotnet",
|
|
99
|
-
"go",
|
|
100
|
-
"php",
|
|
101
|
-
"ruby",
|
|
102
|
-
"android",
|
|
103
|
-
"apple",
|
|
104
|
-
"unity",
|
|
105
|
-
"unreal",
|
|
106
|
-
"rust",
|
|
107
|
-
"elixir",
|
|
108
|
-
"kotlin",
|
|
109
|
-
"native",
|
|
110
|
-
"dart",
|
|
111
|
-
"godot",
|
|
112
|
-
"nintendo-switch",
|
|
113
|
-
"playstation",
|
|
114
|
-
"powershell",
|
|
115
|
-
"react-native",
|
|
116
|
-
"xbox"
|
|
117
|
-
];
|
|
118
|
-
/**
|
|
119
|
-
* Platform-specific frameworks that have Sentry guides
|
|
120
|
-
*/
|
|
121
|
-
const SENTRY_FRAMEWORKS = {
|
|
122
|
-
javascript: [
|
|
123
|
-
"nextjs",
|
|
124
|
-
"react",
|
|
125
|
-
"gatsby",
|
|
126
|
-
"remix",
|
|
127
|
-
"vue",
|
|
128
|
-
"angular",
|
|
129
|
-
"hono",
|
|
130
|
-
"svelte",
|
|
131
|
-
"express",
|
|
132
|
-
"fastify",
|
|
133
|
-
"astro",
|
|
134
|
-
"bun",
|
|
135
|
-
"capacitor",
|
|
136
|
-
"cloudflare",
|
|
137
|
-
"connect",
|
|
138
|
-
"cordova",
|
|
139
|
-
"deno",
|
|
140
|
-
"electron",
|
|
141
|
-
"ember",
|
|
142
|
-
"nuxt",
|
|
143
|
-
"solid",
|
|
144
|
-
"solidstart",
|
|
145
|
-
"sveltekit",
|
|
146
|
-
"tanstack-react",
|
|
147
|
-
"wasm",
|
|
148
|
-
"node",
|
|
149
|
-
"koa",
|
|
150
|
-
"nestjs",
|
|
151
|
-
"hapi"
|
|
152
|
-
],
|
|
153
|
-
python: [
|
|
154
|
-
"django",
|
|
155
|
-
"flask",
|
|
156
|
-
"fastapi",
|
|
157
|
-
"celery",
|
|
158
|
-
"tornado",
|
|
159
|
-
"pyramid",
|
|
160
|
-
"aiohttp",
|
|
161
|
-
"anthropic",
|
|
162
|
-
"airflow",
|
|
163
|
-
"aws-lambda",
|
|
164
|
-
"boto3",
|
|
165
|
-
"bottle",
|
|
166
|
-
"chalice",
|
|
167
|
-
"dramatiq",
|
|
168
|
-
"falcon",
|
|
169
|
-
"langchain",
|
|
170
|
-
"litestar",
|
|
171
|
-
"logging",
|
|
172
|
-
"loguru",
|
|
173
|
-
"openai",
|
|
174
|
-
"quart",
|
|
175
|
-
"ray",
|
|
176
|
-
"redis",
|
|
177
|
-
"rq",
|
|
178
|
-
"sanic",
|
|
179
|
-
"sqlalchemy",
|
|
180
|
-
"starlette"
|
|
181
|
-
],
|
|
182
|
-
dart: ["flutter"],
|
|
183
|
-
dotnet: [
|
|
184
|
-
"aspnetcore",
|
|
185
|
-
"maui",
|
|
186
|
-
"wpf",
|
|
187
|
-
"winforms",
|
|
188
|
-
"aspnet",
|
|
189
|
-
"aws-lambda",
|
|
190
|
-
"azure-functions",
|
|
191
|
-
"blazor-webassembly",
|
|
192
|
-
"entityframework",
|
|
193
|
-
"google-cloud-functions",
|
|
194
|
-
"extensions-logging",
|
|
195
|
-
"log4net",
|
|
196
|
-
"nlog",
|
|
197
|
-
"serilog",
|
|
198
|
-
"uwp",
|
|
199
|
-
"xamarin"
|
|
200
|
-
],
|
|
201
|
-
java: [
|
|
202
|
-
"spring",
|
|
203
|
-
"spring-boot",
|
|
204
|
-
"android",
|
|
205
|
-
"jul",
|
|
206
|
-
"log4j2",
|
|
207
|
-
"logback",
|
|
208
|
-
"servlet"
|
|
209
|
-
],
|
|
210
|
-
go: [
|
|
211
|
-
"echo",
|
|
212
|
-
"fasthttp",
|
|
213
|
-
"fiber",
|
|
214
|
-
"gin",
|
|
215
|
-
"http",
|
|
216
|
-
"iris",
|
|
217
|
-
"logrus",
|
|
218
|
-
"negroni",
|
|
219
|
-
"slog",
|
|
220
|
-
"zerolog"
|
|
221
|
-
],
|
|
222
|
-
php: ["laravel", "symfony"],
|
|
223
|
-
ruby: [
|
|
224
|
-
"delayed_job",
|
|
225
|
-
"rack",
|
|
226
|
-
"rails",
|
|
227
|
-
"resque",
|
|
228
|
-
"sidekiq"
|
|
229
|
-
],
|
|
230
|
-
android: ["kotlin"],
|
|
231
|
-
apple: [
|
|
232
|
-
"ios",
|
|
233
|
-
"macos",
|
|
234
|
-
"watchos",
|
|
235
|
-
"tvos",
|
|
236
|
-
"visionos"
|
|
237
|
-
],
|
|
238
|
-
kotlin: ["multiplatform"]
|
|
239
|
-
};
|
|
240
|
-
/**
|
|
241
|
-
* All valid guides for Sentry docs search filtering.
|
|
242
|
-
* A guide can be either a platform (e.g., 'javascript') or a platform/framework combination (e.g., 'javascript/nextjs').
|
|
243
|
-
*/
|
|
244
|
-
const SENTRY_GUIDES = [...SENTRY_PLATFORMS_BASE, ...Object.entries(SENTRY_FRAMEWORKS).flatMap(([platform, guides]) => guides.map((guide) => `${platform}/${guide}`))];
|
|
245
|
-
const DEFAULT_SCOPES = [
|
|
246
|
-
"org:read",
|
|
247
|
-
"project:read",
|
|
248
|
-
"team:read",
|
|
249
|
-
"event:read"
|
|
250
|
-
];
|
|
251
|
-
|
|
252
|
-
//#endregion
|
|
253
|
-
//#region ../mcp-core/dist/permissions-DbIM2Lps.js
|
|
254
|
-
/**
|
|
255
|
-
* Scope hierarchy - higher scopes include lower ones
|
|
256
|
-
*/
|
|
257
|
-
const SCOPE_HIERARCHY = {
|
|
258
|
-
"org:read": new Set(["org:read"]),
|
|
259
|
-
"org:write": new Set(["org:read", "org:write"]),
|
|
260
|
-
"org:admin": new Set([
|
|
261
|
-
"org:read",
|
|
262
|
-
"org:write",
|
|
263
|
-
"org:admin"
|
|
264
|
-
]),
|
|
265
|
-
"project:read": new Set(["project:read"]),
|
|
266
|
-
"project:write": new Set(["project:read", "project:write"]),
|
|
267
|
-
"project:admin": new Set([
|
|
268
|
-
"project:read",
|
|
269
|
-
"project:write",
|
|
270
|
-
"project:admin"
|
|
271
|
-
]),
|
|
272
|
-
"team:read": new Set(["team:read"]),
|
|
273
|
-
"team:write": new Set(["team:read", "team:write"]),
|
|
274
|
-
"team:admin": new Set([
|
|
275
|
-
"team:read",
|
|
276
|
-
"team:write",
|
|
277
|
-
"team:admin"
|
|
278
|
-
]),
|
|
279
|
-
"member:read": new Set(["member:read"]),
|
|
280
|
-
"member:write": new Set(["member:read", "member:write"]),
|
|
281
|
-
"member:admin": new Set([
|
|
282
|
-
"member:read",
|
|
283
|
-
"member:write",
|
|
284
|
-
"member:admin"
|
|
285
|
-
]),
|
|
286
|
-
"event:read": new Set(["event:read"]),
|
|
287
|
-
"event:write": new Set(["event:read", "event:write"]),
|
|
288
|
-
"event:admin": new Set([
|
|
289
|
-
"event:read",
|
|
290
|
-
"event:write",
|
|
291
|
-
"event:admin"
|
|
292
|
-
]),
|
|
293
|
-
"project:releases": new Set(["project:releases"])
|
|
294
|
-
};
|
|
295
|
-
/**
|
|
296
|
-
* All available scopes as a readonly list
|
|
297
|
-
*/
|
|
298
|
-
function getAvailableScopes() {
|
|
299
|
-
return Object.keys(SCOPE_HIERARCHY);
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* All scopes available in the server, generated from the permission hierarchy.
|
|
303
|
-
* Exported here to keep scope consumers lightweight and avoid importing other
|
|
304
|
-
* unrelated constants.
|
|
305
|
-
*/
|
|
306
|
-
const ALL_SCOPES = getAvailableScopes();
|
|
307
|
-
const ALL_SCOPES_SET = new Set(ALL_SCOPES);
|
|
308
|
-
/**
|
|
309
|
-
* Expand a set of granted scopes to include all implied scopes
|
|
310
|
-
*/
|
|
311
|
-
function expandScopes(grantedScopes) {
|
|
312
|
-
const expandedScopes = /* @__PURE__ */ new Set();
|
|
313
|
-
for (const scope of grantedScopes) {
|
|
314
|
-
const implied = SCOPE_HIERARCHY[scope];
|
|
315
|
-
for (const s of implied) expandedScopes.add(s);
|
|
316
|
-
}
|
|
317
|
-
return expandedScopes;
|
|
318
|
-
}
|
|
319
|
-
/**
|
|
320
|
-
* Check if a set of scopes satisfies the required scopes
|
|
321
|
-
*/
|
|
322
|
-
function hasRequiredScopes(grantedScopes, requiredScopes) {
|
|
323
|
-
const expandedScopes = expandScopes(grantedScopes);
|
|
324
|
-
return requiredScopes.every((scope) => expandedScopes.has(scope));
|
|
325
|
-
}
|
|
326
|
-
/**
|
|
327
|
-
* Check if a tool is allowed based on granted scopes
|
|
328
|
-
*/
|
|
329
|
-
function isToolAllowed(requiredScopes, grantedScopes) {
|
|
330
|
-
if (!requiredScopes || requiredScopes.length === 0) return true;
|
|
331
|
-
return hasRequiredScopes(grantedScopes, requiredScopes);
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* Parse scopes from a comma-separated string
|
|
335
|
-
*/
|
|
336
|
-
/**
|
|
337
|
-
* Parse scopes from a comma-separated string.
|
|
338
|
-
* - Filters out invalid entries
|
|
339
|
-
* - Logs a console.warn listing any invalid values
|
|
340
|
-
*/
|
|
341
|
-
/**
|
|
342
|
-
* Parse scopes from an array of strings.
|
|
343
|
-
* - Filters out invalid entries
|
|
344
|
-
* - Logs a console.warn listing any invalid values
|
|
345
|
-
*/
|
|
346
|
-
/**
|
|
347
|
-
* Generic scope parser: accepts a comma-separated string or an array.
|
|
348
|
-
* Returns both valid and invalid tokens. No logging.
|
|
349
|
-
*/
|
|
350
|
-
function parseScopes(input) {
|
|
351
|
-
let tokens = [];
|
|
352
|
-
if (typeof input === "string") tokens = input.split(",");
|
|
353
|
-
else if (Array.isArray(input)) tokens = input.map((v) => typeof v === "string" ? v : "");
|
|
354
|
-
const valid = /* @__PURE__ */ new Set();
|
|
355
|
-
const invalid = [];
|
|
356
|
-
for (const raw of tokens.map((s) => s.trim()).filter(Boolean)) if (ALL_SCOPES_SET.has(raw)) valid.add(raw);
|
|
357
|
-
else invalid.push(raw);
|
|
358
|
-
return {
|
|
359
|
-
valid,
|
|
360
|
-
invalid
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
/**
|
|
364
|
-
* Strict validation helper for scope strings supplied via flags/env.
|
|
365
|
-
* Returns both valid and invalid entries without side effects.
|
|
366
|
-
*/
|
|
367
|
-
/**
|
|
368
|
-
* Resolve final scopes from optional override/additive sets and provided defaults.
|
|
369
|
-
* - If override is provided, it replaces defaults and is expanded
|
|
370
|
-
* - Else if add is provided, it unions with defaults and is expanded
|
|
371
|
-
* - Else returns undefined to indicate default handling upstream
|
|
372
|
-
*/
|
|
373
|
-
function resolveScopes(options) {
|
|
374
|
-
const { override, add, defaults } = options;
|
|
375
|
-
if (override) return expandScopes(override);
|
|
376
|
-
if (add) {
|
|
377
|
-
const base = new Set(defaults);
|
|
378
|
-
for (const s of add) base.add(s);
|
|
379
|
-
return expandScopes(base);
|
|
380
|
-
}
|
|
381
|
-
return void 0;
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
//#endregion
|
|
385
|
-
//#region ../mcp-core/dist/url-utils-DoqJlWab.js
|
|
386
|
-
/**
|
|
387
|
-
* Determines if a Sentry instance is SaaS or self-hosted based on the host.
|
|
388
|
-
* @param host The Sentry host (e.g., "sentry.io" or "sentry.company.com")
|
|
389
|
-
* @returns true if SaaS instance, false if self-hosted
|
|
390
|
-
*/
|
|
391
|
-
function isSentryHost(host) {
|
|
392
|
-
return host === "sentry.io" || host.endsWith(".sentry.io");
|
|
393
|
-
}
|
|
394
|
-
/**
|
|
395
|
-
* Generates a Sentry issue URL.
|
|
396
|
-
* @param host The Sentry host (may include regional subdomain for API access)
|
|
397
|
-
* @param organizationSlug Organization identifier
|
|
398
|
-
* @param issueId Issue identifier (e.g., "PROJECT-123")
|
|
399
|
-
* @returns The complete issue URL
|
|
400
|
-
*/
|
|
401
|
-
function getIssueUrl(host, organizationSlug, issueId) {
|
|
402
|
-
const isSaas = isSentryHost(host);
|
|
403
|
-
const webHost = isSaas ? "sentry.io" : host;
|
|
404
|
-
return isSaas ? `https://${organizationSlug}.${webHost}/issues/${issueId}` : `https://${host}/organizations/${organizationSlug}/issues/${issueId}`;
|
|
405
|
-
}
|
|
406
|
-
/**
|
|
407
|
-
* Generates a Sentry issues search URL.
|
|
408
|
-
* @param host The Sentry host (may include regional subdomain for API access)
|
|
409
|
-
* @param organizationSlug Organization identifier
|
|
410
|
-
* @param query Optional search query
|
|
411
|
-
* @param projectSlugOrId Optional project slug or ID
|
|
412
|
-
* @returns The complete issues search URL
|
|
413
|
-
*/
|
|
414
|
-
function getIssuesSearchUrl(host, organizationSlug, query, projectSlugOrId) {
|
|
415
|
-
const isSaas = isSentryHost(host);
|
|
416
|
-
const webHost = isSaas ? "sentry.io" : host;
|
|
417
|
-
let url = isSaas ? `https://${organizationSlug}.${webHost}/issues/` : `https://${host}/organizations/${organizationSlug}/issues/`;
|
|
418
|
-
const params = new URLSearchParams();
|
|
419
|
-
if (projectSlugOrId) params.append("project", projectSlugOrId);
|
|
420
|
-
if (query) params.append("query", query);
|
|
421
|
-
const queryString = params.toString();
|
|
422
|
-
if (queryString) url += `?${queryString}`;
|
|
423
|
-
return url;
|
|
424
|
-
}
|
|
425
|
-
/**
|
|
426
|
-
* Generates a Sentry trace URL for performance investigation.
|
|
427
|
-
* @param host The Sentry host (may include regional subdomain for API access)
|
|
428
|
-
* @param organizationSlug Organization identifier
|
|
429
|
-
* @param traceId Trace identifier
|
|
430
|
-
* @returns The complete trace URL
|
|
431
|
-
*/
|
|
432
|
-
function getTraceUrl(host, organizationSlug, traceId) {
|
|
433
|
-
const isSaas = isSentryHost(host);
|
|
434
|
-
const webHost = isSaas ? "sentry.io" : host;
|
|
435
|
-
return isSaas ? `https://${organizationSlug}.${webHost}/explore/traces/trace/${traceId}` : `https://${host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;
|
|
436
|
-
}
|
|
437
|
-
/**
|
|
438
|
-
* Internal validation function that checks if a SENTRY_HOST value contains only hostname (no protocol).
|
|
439
|
-
* Throws an error if validation fails instead of exiting the process.
|
|
440
|
-
*
|
|
441
|
-
* @param host The hostname to validate
|
|
442
|
-
* @throws {Error} If the host contains a protocol
|
|
443
|
-
*/
|
|
444
|
-
function _validateSentryHostInternal(host) {
|
|
445
|
-
if (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.");
|
|
446
|
-
}
|
|
447
|
-
/**
|
|
448
|
-
* Internal validation function that checks if a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.
|
|
449
|
-
* Throws an error if validation fails instead of exiting the process.
|
|
450
|
-
*
|
|
451
|
-
* @param url The HTTPS URL to validate and parse
|
|
452
|
-
* @returns The extracted hostname from the URL
|
|
453
|
-
* @throws {Error} If the URL is invalid or not HTTPS
|
|
454
|
-
*/
|
|
455
|
-
function _validateAndParseSentryUrlInternal(url) {
|
|
456
|
-
if (!url.startsWith("https://")) throw new Error("SENTRY_URL must be a full HTTPS URL (e.g., https://sentry.example.com).");
|
|
457
|
-
try {
|
|
458
|
-
const parsedUrl = new URL(url);
|
|
459
|
-
return parsedUrl.host;
|
|
460
|
-
} catch (error) {
|
|
461
|
-
throw new Error("SENTRY_URL must be a valid HTTPS URL (e.g., https://sentry.example.com).");
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
/**
|
|
465
|
-
* Validates that a SENTRY_HOST value contains only hostname (no protocol).
|
|
466
|
-
* Throws an error instead of exiting the process (for testing).
|
|
467
|
-
*
|
|
468
|
-
* @param host The hostname to validate
|
|
469
|
-
* @throws {Error} If the host contains a protocol
|
|
470
|
-
*/
|
|
471
|
-
function validateSentryHostThrows(host) {
|
|
472
|
-
_validateSentryHostInternal(host);
|
|
473
|
-
}
|
|
474
|
-
/**
|
|
475
|
-
* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.
|
|
476
|
-
* Throws an error instead of exiting the process (for testing).
|
|
477
|
-
*
|
|
478
|
-
* @param url The HTTPS URL to validate and parse
|
|
479
|
-
* @returns The extracted hostname from the URL
|
|
480
|
-
* @throws {Error} If the URL is invalid or not HTTPS
|
|
481
|
-
*/
|
|
482
|
-
function validateAndParseSentryUrlThrows(url) {
|
|
483
|
-
return _validateAndParseSentryUrlInternal(url);
|
|
484
|
-
}
|
|
485
|
-
/**
|
|
486
|
-
* Validates that the provided OpenAI base URL is a valid HTTP(S) URL and returns a normalized string.
|
|
487
|
-
*
|
|
488
|
-
* @param url The URL to validate and normalize
|
|
489
|
-
* @returns The normalized URL string
|
|
490
|
-
* @throws {Error} If the URL is empty, invalid, or uses an unsupported protocol
|
|
491
|
-
*/
|
|
492
|
-
function validateOpenAiBaseUrlThrows(url) {
|
|
493
|
-
const trimmed = url.trim();
|
|
494
|
-
if (trimmed.length === 0) throw new Error("OPENAI base URL must not be empty.");
|
|
495
|
-
let parsed;
|
|
496
|
-
try {
|
|
497
|
-
parsed = new URL(trimmed);
|
|
498
|
-
} catch (error) {
|
|
499
|
-
throw new Error("OPENAI base URL must be a valid HTTP or HTTPS URL (e.g., https://example.com/v1).", { cause: error });
|
|
500
|
-
}
|
|
501
|
-
if (parsed.protocol !== "https:" && parsed.protocol !== "http:") throw new Error("OPENAI base URL must use http or https scheme (e.g., https://example.com/v1).");
|
|
502
|
-
return parsed.toString();
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
//#endregion
|
|
506
|
-
//#region src/cli/resolve.ts
|
|
507
|
-
function formatInvalid(invalid, envName) {
|
|
508
|
-
const where = envName ? `${envName} provided` : "Invalid scopes provided";
|
|
509
|
-
return `Error: ${where}: ${invalid.join(", ")}\nAvailable scopes: ${ALL_SCOPES.join(", ")}`;
|
|
510
|
-
}
|
|
511
|
-
function formatInvalidSkills(invalid, envName) {
|
|
512
|
-
const where = envName ? `${envName} provided` : "Invalid skills provided";
|
|
513
|
-
const allSkills = Object.keys(SKILLS).join(", ");
|
|
514
|
-
return `Error: ${where}: ${invalid.join(", ")}\nAvailable skills: ${allSkills}`;
|
|
515
|
-
}
|
|
516
|
-
function finalize(input) {
|
|
517
|
-
if (!input.accessToken) throw new Error("Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.");
|
|
518
|
-
let sentryHost = "sentry.io";
|
|
519
|
-
if (input.url) sentryHost = validateAndParseSentryUrlThrows(input.url);
|
|
520
|
-
else if (input.host) {
|
|
521
|
-
validateSentryHostThrows(input.host);
|
|
522
|
-
sentryHost = input.host;
|
|
523
|
-
}
|
|
524
|
-
let finalScopes = void 0;
|
|
525
|
-
if (input.allScopes) {
|
|
526
|
-
console.warn("⚠️ Warning: --all-scopes is deprecated. Consider using skills instead:");
|
|
527
|
-
console.warn(" --skills=inspect,triage,project-management,seer,docs");
|
|
528
|
-
console.warn(" Learn more about skills in the documentation.");
|
|
529
|
-
console.warn("");
|
|
530
|
-
finalScopes = new Set(ALL_SCOPES);
|
|
531
|
-
} else if (input.scopes || input.addScopes) {
|
|
532
|
-
if (input.scopes) {
|
|
533
|
-
console.warn("⚠️ Warning: --scopes is deprecated. Consider using skills instead:");
|
|
534
|
-
console.warn(" For example, instead of --scopes=event:write,project:write");
|
|
535
|
-
console.warn(" Use: --skills=triage,project-management");
|
|
536
|
-
console.warn(" Learn more about skills in the documentation.");
|
|
537
|
-
console.warn("");
|
|
538
|
-
} else if (input.addScopes) {
|
|
539
|
-
console.warn("⚠️ Warning: --add-scopes is deprecated. Consider using --skills instead:");
|
|
540
|
-
console.warn(" For example, instead of --add-scopes=event:write");
|
|
541
|
-
console.warn(" Use: --skills=triage");
|
|
542
|
-
console.warn(" Learn more about skills in the documentation.");
|
|
543
|
-
console.warn("");
|
|
544
|
-
}
|
|
545
|
-
if (input.scopes) {
|
|
546
|
-
const { valid, invalid } = parseScopes(input.scopes);
|
|
547
|
-
if (invalid.length > 0) throw new Error(formatInvalid(invalid));
|
|
548
|
-
if (valid.size === 0) throw new Error("Error: Invalid scopes provided. No valid scopes found.");
|
|
549
|
-
finalScopes = resolveScopes({
|
|
550
|
-
override: valid,
|
|
551
|
-
defaults: DEFAULT_SCOPES
|
|
552
|
-
});
|
|
553
|
-
} else if (input.addScopes) {
|
|
554
|
-
const { valid, invalid } = parseScopes(input.addScopes);
|
|
555
|
-
if (invalid.length > 0) throw new Error(formatInvalid(invalid));
|
|
556
|
-
if (valid.size === 0) throw new Error("Error: Invalid additional scopes provided. No valid scopes found.");
|
|
557
|
-
finalScopes = resolveScopes({
|
|
558
|
-
add: valid,
|
|
559
|
-
defaults: DEFAULT_SCOPES
|
|
560
|
-
});
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
let finalSkills = void 0;
|
|
564
|
-
if (input.skills) {
|
|
565
|
-
const { valid, invalid } = parseSkills(input.skills);
|
|
566
|
-
if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid));
|
|
567
|
-
if (valid.size === 0) throw new Error("Error: Invalid skills provided. No valid skills found.");
|
|
568
|
-
finalSkills = valid;
|
|
569
|
-
} else {
|
|
570
|
-
const allSkills = Object.keys(SKILLS);
|
|
571
|
-
finalSkills = new Set(allSkills);
|
|
572
|
-
}
|
|
573
|
-
const resolvedOpenAiBaseUrl = input.openaiBaseUrl ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl) : void 0;
|
|
574
|
-
return {
|
|
575
|
-
accessToken: input.accessToken,
|
|
576
|
-
sentryHost,
|
|
577
|
-
mcpUrl: input.mcpUrl,
|
|
578
|
-
sentryDsn: input.sentryDsn,
|
|
579
|
-
openaiBaseUrl: resolvedOpenAiBaseUrl,
|
|
580
|
-
openaiModel: input.openaiModel,
|
|
581
|
-
finalScopes,
|
|
582
|
-
finalSkills,
|
|
583
|
-
organizationSlug: input.organizationSlug,
|
|
584
|
-
projectSlug: input.projectSlug
|
|
585
|
-
};
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
//#endregion
|
|
589
|
-
export { ALL_SCOPES, ALL_SKILLS, DEFAULT_SCOPES, DEFAULT_SKILLS, MCP_SERVER_NAME, SENTRY_ALLOWED_REGION_DOMAINS, SENTRY_GUIDES, SKILLS, finalize, formatInvalid, formatInvalidSkills, getIssueUrl, getIssuesSearchUrl, getTraceUrl, hasRequiredSkills, isSentryHost, isToolAllowed };
|
|
590
|
-
//# sourceMappingURL=resolve-BCdS4js5.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-BCdS4js5.js","names":["invalid: string[]","envName?: string","input: MergedArgs","finalScopes: Set<Scope> | undefined","finalSkills: Set<Skill> | undefined"],"sources":["../../mcp-core/dist/skills-BmFl7P6V.js","../../mcp-core/dist/constants-D8axTonA.js","../../mcp-core/dist/permissions-DbIM2Lps.js","../../mcp-core/dist/url-utils-DoqJlWab.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: \"Search for errors, analyze traces, and explore event details\",\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: \"Search and read Sentry SDK documentation\",\n\t\tdefaultEnabled: false,\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 tools = toolsModule.default;\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const skill of Object.keys(SKILLS)) counts.set(skill, 0);\n\tfor (const tool of Object.values(tools)) if (Array.isArray(tool.requiredSkills)) for (const skill of tool.requiredSkills) counts.set(skill, (counts.get(skill) || 0) + 1);\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 DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);\nfunction isValidSkill(skill) {\n\treturn skill in SKILLS;\n}\nfunction hasRequiredSkills(grantedSkills, requiredSkills) {\n\tif (!grantedSkills || requiredSkills.length === 0) return false;\n\treturn requiredSkills.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 tools = toolsModule.default;\n\tconst scopes = new Set(DEFAULT_SCOPES);\n\tfor (const tool of Object.values(tools)) {\n\t\tconst toolEnabled = tool.requiredSkills.some((reqSkill) => grantedSkills.has(reqSkill));\n\t\tif (toolEnabled) for (const scope of tool.requiredScopes) scopes.add(scope);\n\t}\n\treturn scopes;\n}\n\n//#endregion\nexport { ALL_SKILLS, DEFAULT_SKILLS, SKILLS, SKILLS_ARRAY, getScopesForSkills, getSkillsArrayWithCounts, hasRequiredSkills, isValidSkill, parseSkills };\n//# sourceMappingURL=skills-BmFl7P6V.js.map","//#region src/constants.ts\n/**\n* Constants for Sentry MCP server.\n*\n* Defines platform and framework combinations available in Sentry documentation.\n*/\n/**\n* MCP Server identification\n*/\nconst MCP_SERVER_NAME = \"Sentry MCP\";\n/**\n* Allowed region domains for sentry.io\n* Only these specific domains are permitted when using Sentry's cloud service\n* This is used to prevent SSRF attacks by restricting regionUrl to known domains\n*/\nconst SENTRY_ALLOWED_REGION_DOMAINS = new Set([\n\t\"sentry.io\",\n\t\"us.sentry.io\",\n\t\"de.sentry.io\"\n]);\n/**\n* Common Sentry platforms that have documentation available\n*/\nconst SENTRY_PLATFORMS_BASE = [\n\t\"javascript\",\n\t\"python\",\n\t\"java\",\n\t\"dotnet\",\n\t\"go\",\n\t\"php\",\n\t\"ruby\",\n\t\"android\",\n\t\"apple\",\n\t\"unity\",\n\t\"unreal\",\n\t\"rust\",\n\t\"elixir\",\n\t\"kotlin\",\n\t\"native\",\n\t\"dart\",\n\t\"godot\",\n\t\"nintendo-switch\",\n\t\"playstation\",\n\t\"powershell\",\n\t\"react-native\",\n\t\"xbox\"\n];\n/**\n* Platform-specific frameworks that have Sentry guides\n*/\nconst SENTRY_FRAMEWORKS = {\n\tjavascript: [\n\t\t\"nextjs\",\n\t\t\"react\",\n\t\t\"gatsby\",\n\t\t\"remix\",\n\t\t\"vue\",\n\t\t\"angular\",\n\t\t\"hono\",\n\t\t\"svelte\",\n\t\t\"express\",\n\t\t\"fastify\",\n\t\t\"astro\",\n\t\t\"bun\",\n\t\t\"capacitor\",\n\t\t\"cloudflare\",\n\t\t\"connect\",\n\t\t\"cordova\",\n\t\t\"deno\",\n\t\t\"electron\",\n\t\t\"ember\",\n\t\t\"nuxt\",\n\t\t\"solid\",\n\t\t\"solidstart\",\n\t\t\"sveltekit\",\n\t\t\"tanstack-react\",\n\t\t\"wasm\",\n\t\t\"node\",\n\t\t\"koa\",\n\t\t\"nestjs\",\n\t\t\"hapi\"\n\t],\n\tpython: [\n\t\t\"django\",\n\t\t\"flask\",\n\t\t\"fastapi\",\n\t\t\"celery\",\n\t\t\"tornado\",\n\t\t\"pyramid\",\n\t\t\"aiohttp\",\n\t\t\"anthropic\",\n\t\t\"airflow\",\n\t\t\"aws-lambda\",\n\t\t\"boto3\",\n\t\t\"bottle\",\n\t\t\"chalice\",\n\t\t\"dramatiq\",\n\t\t\"falcon\",\n\t\t\"langchain\",\n\t\t\"litestar\",\n\t\t\"logging\",\n\t\t\"loguru\",\n\t\t\"openai\",\n\t\t\"quart\",\n\t\t\"ray\",\n\t\t\"redis\",\n\t\t\"rq\",\n\t\t\"sanic\",\n\t\t\"sqlalchemy\",\n\t\t\"starlette\"\n\t],\n\tdart: [\"flutter\"],\n\tdotnet: [\n\t\t\"aspnetcore\",\n\t\t\"maui\",\n\t\t\"wpf\",\n\t\t\"winforms\",\n\t\t\"aspnet\",\n\t\t\"aws-lambda\",\n\t\t\"azure-functions\",\n\t\t\"blazor-webassembly\",\n\t\t\"entityframework\",\n\t\t\"google-cloud-functions\",\n\t\t\"extensions-logging\",\n\t\t\"log4net\",\n\t\t\"nlog\",\n\t\t\"serilog\",\n\t\t\"uwp\",\n\t\t\"xamarin\"\n\t],\n\tjava: [\n\t\t\"spring\",\n\t\t\"spring-boot\",\n\t\t\"android\",\n\t\t\"jul\",\n\t\t\"log4j2\",\n\t\t\"logback\",\n\t\t\"servlet\"\n\t],\n\tgo: [\n\t\t\"echo\",\n\t\t\"fasthttp\",\n\t\t\"fiber\",\n\t\t\"gin\",\n\t\t\"http\",\n\t\t\"iris\",\n\t\t\"logrus\",\n\t\t\"negroni\",\n\t\t\"slog\",\n\t\t\"zerolog\"\n\t],\n\tphp: [\"laravel\", \"symfony\"],\n\truby: [\n\t\t\"delayed_job\",\n\t\t\"rack\",\n\t\t\"rails\",\n\t\t\"resque\",\n\t\t\"sidekiq\"\n\t],\n\tandroid: [\"kotlin\"],\n\tapple: [\n\t\t\"ios\",\n\t\t\"macos\",\n\t\t\"watchos\",\n\t\t\"tvos\",\n\t\t\"visionos\"\n\t],\n\tkotlin: [\"multiplatform\"]\n};\n/**\n* All valid guides for Sentry docs search filtering.\n* A guide can be either a platform (e.g., 'javascript') or a platform/framework combination (e.g., 'javascript/nextjs').\n*/\nconst SENTRY_GUIDES = [...SENTRY_PLATFORMS_BASE, ...Object.entries(SENTRY_FRAMEWORKS).flatMap(([platform, guides]) => guides.map((guide) => `${platform}/${guide}`))];\nconst DEFAULT_SCOPES = [\n\t\"org:read\",\n\t\"project:read\",\n\t\"team:read\",\n\t\"event:read\"\n];\n\n//#endregion\nexport { DEFAULT_SCOPES, MCP_SERVER_NAME, SENTRY_ALLOWED_REGION_DOMAINS, SENTRY_FRAMEWORKS, SENTRY_GUIDES, SENTRY_PLATFORMS_BASE };\n//# sourceMappingURL=constants-D8axTonA.js.map","//#region src/permissions.ts\n/**\n* Scope hierarchy - higher scopes include lower ones\n*/\nconst SCOPE_HIERARCHY = {\n\t\"org:read\": new Set([\"org:read\"]),\n\t\"org:write\": new Set([\"org:read\", \"org:write\"]),\n\t\"org:admin\": new Set([\n\t\t\"org:read\",\n\t\t\"org:write\",\n\t\t\"org:admin\"\n\t]),\n\t\"project:read\": new Set([\"project:read\"]),\n\t\"project:write\": new Set([\"project:read\", \"project:write\"]),\n\t\"project:admin\": new Set([\n\t\t\"project:read\",\n\t\t\"project:write\",\n\t\t\"project:admin\"\n\t]),\n\t\"team:read\": new Set([\"team:read\"]),\n\t\"team:write\": new Set([\"team:read\", \"team:write\"]),\n\t\"team:admin\": new Set([\n\t\t\"team:read\",\n\t\t\"team:write\",\n\t\t\"team:admin\"\n\t]),\n\t\"member:read\": new Set([\"member:read\"]),\n\t\"member:write\": new Set([\"member:read\", \"member:write\"]),\n\t\"member:admin\": new Set([\n\t\t\"member:read\",\n\t\t\"member:write\",\n\t\t\"member:admin\"\n\t]),\n\t\"event:read\": new Set([\"event:read\"]),\n\t\"event:write\": new Set([\"event:read\", \"event:write\"]),\n\t\"event:admin\": new Set([\n\t\t\"event:read\",\n\t\t\"event:write\",\n\t\t\"event:admin\"\n\t]),\n\t\"project:releases\": new Set([\"project:releases\"])\n};\n/**\n* All available scopes as a readonly list\n*/\nfunction getAvailableScopes() {\n\treturn Object.keys(SCOPE_HIERARCHY);\n}\n/**\n* All scopes available in the server, generated from the permission hierarchy.\n* Exported here to keep scope consumers lightweight and avoid importing other\n* unrelated constants.\n*/\nconst ALL_SCOPES = getAvailableScopes();\nconst ALL_SCOPES_SET = new Set(ALL_SCOPES);\n/**\n* Expand a set of granted scopes to include all implied scopes\n*/\nfunction expandScopes(grantedScopes) {\n\tconst expandedScopes = /* @__PURE__ */ new Set();\n\tfor (const scope of grantedScopes) {\n\t\tconst implied = SCOPE_HIERARCHY[scope];\n\t\tfor (const s of implied) expandedScopes.add(s);\n\t}\n\treturn expandedScopes;\n}\n/**\n* Human-readable descriptions of scopes\n*/\nconst SCOPE_DESCRIPTIONS = {\n\t\"org:read\": \"View organization details\",\n\t\"org:write\": \"Modify organization details\",\n\t\"org:admin\": \"Delete organizations\",\n\t\"project:read\": \"View project information\",\n\t\"project:write\": \"Create and modify projects\",\n\t\"project:admin\": \"Delete projects\",\n\t\"team:read\": \"View team information\",\n\t\"team:write\": \"Create and modify teams\",\n\t\"team:admin\": \"Delete teams\",\n\t\"member:read\": \"View member information\",\n\t\"member:write\": \"Create and modify members\",\n\t\"member:admin\": \"Delete members\",\n\t\"event:read\": \"View events and issues\",\n\t\"event:write\": \"Update and manage issues\",\n\t\"event:admin\": \"Delete issues\",\n\t\"project:releases\": \"Access release information\"\n};\n/**\n* Check if a set of scopes satisfies the required scopes\n*/\nfunction hasRequiredScopes(grantedScopes, requiredScopes) {\n\tconst expandedScopes = expandScopes(grantedScopes);\n\treturn requiredScopes.every((scope) => expandedScopes.has(scope));\n}\n/**\n* Check if a tool is allowed based on granted scopes\n*/\nfunction isToolAllowed(requiredScopes, grantedScopes) {\n\tif (!requiredScopes || requiredScopes.length === 0) return true;\n\treturn hasRequiredScopes(grantedScopes, requiredScopes);\n}\n/**\n* Parse scopes from a comma-separated string\n*/\n/**\n* Parse scopes from a comma-separated string.\n* - Filters out invalid entries\n* - Logs a console.warn listing any invalid values\n*/\n/**\n* Parse scopes from an array of strings.\n* - Filters out invalid entries\n* - Logs a console.warn listing any invalid values\n*/\n/**\n* Generic scope parser: accepts a comma-separated string or an array.\n* Returns both valid and invalid tokens. No logging.\n*/\nfunction parseScopes(input) {\n\tlet tokens = [];\n\tif (typeof input === \"string\") tokens = input.split(\",\");\n\telse if (Array.isArray(input)) tokens = input.map((v) => typeof v === \"string\" ? v : \"\");\n\tconst valid = /* @__PURE__ */ new Set();\n\tconst invalid = [];\n\tfor (const raw of tokens.map((s) => s.trim()).filter(Boolean)) if (ALL_SCOPES_SET.has(raw)) valid.add(raw);\n\telse invalid.push(raw);\n\treturn {\n\t\tvalid,\n\t\tinvalid\n\t};\n}\n/**\n* Strict validation helper for scope strings supplied via flags/env.\n* Returns both valid and invalid entries without side effects.\n*/\n/**\n* Resolve final scopes from optional override/additive sets and provided defaults.\n* - If override is provided, it replaces defaults and is expanded\n* - Else if add is provided, it unions with defaults and is expanded\n* - Else returns undefined to indicate default handling upstream\n*/\nfunction resolveScopes(options) {\n\tconst { override, add, defaults } = options;\n\tif (override) return expandScopes(override);\n\tif (add) {\n\t\tconst base = new Set(defaults);\n\t\tfor (const s of add) base.add(s);\n\t\treturn expandScopes(base);\n\t}\n\treturn void 0;\n}\n\n//#endregion\nexport { ALL_SCOPES, ALL_SCOPES_SET, SCOPE_DESCRIPTIONS, expandScopes, getAvailableScopes, hasRequiredScopes, isToolAllowed, parseScopes, resolveScopes };\n//# sourceMappingURL=permissions-DbIM2Lps.js.map","//#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}\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) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\treturn isSaas ? `https://${organizationSlug}.${webHost}/issues/${issueId}` : `https://${host}/organizations/${organizationSlug}/issues/${issueId}`;\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) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\tlet url = isSaas ? `https://${organizationSlug}.${webHost}/issues/` : `https://${host}/organizations/${organizationSlug}/issues/`;\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 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) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\treturn isSaas ? `https://${organizationSlug}.${webHost}/explore/traces/trace/${traceId}` : `https://${host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;\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\", projectSlug, fields) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\tlet url = isSaas ? `https://${organizationSlug}.${webHost}/explore/` : `https://${host}/organizations/${organizationSlug}/explore/`;\n\tconst params = new URLSearchParams();\n\tparams.append(\"query\", query);\n\tparams.append(\"dataset\", dataset);\n\tparams.append(\"layout\", \"table\");\n\tif (projectSlug) params.append(\"project\", projectSlug);\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 { getEventsExplorerUrl, getIssueUrl, getIssuesSearchUrl, getTraceUrl, isSentryHost, validateAndParseSentryUrl, validateAndParseSentryUrlThrows, validateOpenAiBaseUrlThrows, validateSentryHost, validateSentryHostThrows };\n//# sourceMappingURL=url-utils-DoqJlWab.js.map","import {\n ALL_SCOPES,\n parseScopes,\n resolveScopes,\n type Scope,\n} from \"@sentry/mcp-core/permissions\";\nimport { parseSkills, SKILLS, type Skill } from \"@sentry/mcp-core/skills\";\nimport { DEFAULT_SCOPES } from \"@sentry/mcp-core/constants\";\nimport {\n validateAndParseSentryUrlThrows,\n validateOpenAiBaseUrlThrows,\n validateSentryHostThrows,\n} from \"@sentry/mcp-core/utils/url-utils\";\nimport type { MergedArgs, ResolvedConfig } from \"./types\";\n\nexport function formatInvalid(invalid: string[], envName?: string): string {\n const where = envName ? `${envName} provided` : \"Invalid scopes provided\";\n return `Error: ${where}: ${invalid.join(\", \")}\\nAvailable scopes: ${ALL_SCOPES.join(\", \")}`;\n}\n\nexport function formatInvalidSkills(\n invalid: string[],\n envName?: string,\n): string {\n const where = envName ? `${envName} provided` : \"Invalid skills provided\";\n const allSkills = Object.keys(SKILLS).join(\", \");\n return `Error: ${where}: ${invalid.join(\", \")}\\nAvailable skills: ${allSkills}`;\n}\n\nexport function finalize(input: MergedArgs): ResolvedConfig {\n // Access token required\n if (!input.accessToken) {\n throw new Error(\n \"Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.\",\n );\n }\n\n // Determine host from url/host with validation\n let sentryHost = \"sentry.io\";\n if (input.url) {\n sentryHost = validateAndParseSentryUrlThrows(input.url);\n } else if (input.host) {\n validateSentryHostThrows(input.host);\n sentryHost = input.host;\n }\n\n // Scopes resolution (LEGACY - deprecated in favor of skills)\n let finalScopes: Set<Scope> | undefined = undefined;\n if (input.allScopes) {\n console.warn(\n \"⚠️ Warning: --all-scopes is deprecated. Consider using skills instead:\",\n );\n console.warn(\" --skills=inspect,triage,project-management,seer,docs\");\n console.warn(\" Learn more about skills in the documentation.\");\n console.warn(\"\");\n finalScopes = new Set<Scope>(ALL_SCOPES as ReadonlyArray<Scope>);\n } else if (input.scopes || input.addScopes) {\n // Show deprecation warning\n if (input.scopes) {\n console.warn(\n \"⚠️ Warning: --scopes is deprecated. Consider using skills instead:\",\n );\n console.warn(\n \" For example, instead of --scopes=event:write,project:write\",\n );\n console.warn(\" Use: --skills=triage,project-management\");\n console.warn(\" Learn more about skills in the documentation.\");\n console.warn(\"\");\n } else if (input.addScopes) {\n console.warn(\n \"⚠️ Warning: --add-scopes is deprecated. Consider using --skills instead:\",\n );\n console.warn(\" For example, instead of --add-scopes=event:write\");\n console.warn(\" Use: --skills=triage\");\n console.warn(\" Learn more about skills in the documentation.\");\n console.warn(\"\");\n }\n\n // Strict validation: any invalid token is an error\n if (input.scopes) {\n const { valid, invalid } = parseScopes(input.scopes);\n if (invalid.length > 0) {\n throw new Error(formatInvalid(invalid));\n }\n if (valid.size === 0) {\n throw new Error(\n \"Error: Invalid scopes provided. No valid scopes found.\",\n );\n }\n finalScopes = resolveScopes({\n override: valid,\n defaults: DEFAULT_SCOPES,\n });\n } else if (input.addScopes) {\n const { valid, invalid } = parseScopes(input.addScopes);\n if (invalid.length > 0) {\n throw new Error(formatInvalid(invalid));\n }\n if (valid.size === 0) {\n throw new Error(\n \"Error: Invalid additional scopes provided. No valid scopes found.\",\n );\n }\n finalScopes = resolveScopes({ add: valid, defaults: DEFAULT_SCOPES });\n }\n }\n\n // Skills resolution\n //\n // IMPORTANT: stdio (CLI) intentionally defaults to ALL 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 skills (inspect, docs, seer, triage, project-management)\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> | undefined = undefined;\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 skills when no flag is provided (see comment block above for rationale)\n const allSkills = Object.keys(SKILLS) as Skill[];\n finalSkills = new Set<Skill>(allSkills);\n }\n\n const resolvedOpenAiBaseUrl = input.openaiBaseUrl\n ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl)\n : undefined;\n\n return {\n accessToken: input.accessToken,\n sentryHost,\n mcpUrl: input.mcpUrl,\n sentryDsn: input.sentryDsn,\n openaiBaseUrl: resolvedOpenAiBaseUrl,\n openaiModel: input.openaiModel,\n finalScopes,\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,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;A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ACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACA;CACD,MAAM,CAAC,SAAU;CACjB,QAAQ;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACA;CACD,MAAM;EACL;EACA;EACA;EACA;EACA;EACA;EACA;CACA;CACD,IAAI;EACH;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACA;CACD,KAAK,CAAC,WAAW,SAAU;CAC3B,MAAM;EACL;EACA;EACA;EACA;EACA;CACA;CACD,SAAS,CAAC,QAAS;CACnB,OAAO;EACN;EACA;EACA;EACA;EACA;CACA;CACD,QAAQ,CAAC,eAAgB;AACzB;;;;;AAKD,MAAM,gBAAgB,CAAC,GAAG,uBAAuB,GAAG,OAAO,QAAQ,kBAAkB,CAAC,QAAQ,CAAC,CAAC,UAAU,OAAO,KAAK,OAAO,IAAI,CAAC,aAAa,SAAS,GAAG,QAAQ,CAAC,AAAC;AACrK,MAAM,iBAAiB;CACtB;CACA;CACA;CACA;AACA;;;;;;;AC/KD,MAAM,kBAAkB;CACvB,YAAY,IAAI,IAAI,CAAC,UAAW;CAChC,aAAa,IAAI,IAAI,CAAC,YAAY,WAAY;CAC9C,aAAa,IAAI,IAAI;EACpB;EACA;EACA;CACA;CACD,gBAAgB,IAAI,IAAI,CAAC,cAAe;CACxC,iBAAiB,IAAI,IAAI,CAAC,gBAAgB,eAAgB;CAC1D,iBAAiB,IAAI,IAAI;EACxB;EACA;EACA;CACA;CACD,aAAa,IAAI,IAAI,CAAC,WAAY;CAClC,cAAc,IAAI,IAAI,CAAC,aAAa,YAAa;CACjD,cAAc,IAAI,IAAI;EACrB;EACA;EACA;CACA;CACD,eAAe,IAAI,IAAI,CAAC,aAAc;CACtC,gBAAgB,IAAI,IAAI,CAAC,eAAe,cAAe;CACvD,gBAAgB,I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