@tokamohsen/sentry-mcp 0.29.6 → 0.29.8
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/index.cjs +33696 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +33706 -45
- package/dist/index.js.map +1 -1
- package/dist/{token-GX19_oyM.cjs → token-B5HKFZKz.cjs} +2 -2
- package/dist/{token-GX19_oyM.cjs.map → token-B5HKFZKz.cjs.map} +1 -1
- package/dist/{token-CO5Bq1Ct.js → token-JvPeoopD.js} +2 -2
- package/dist/{token-CO5Bq1Ct.js.map → token-JvPeoopD.js.map} +1 -1
- package/dist/{token-util-Cw83HNFN.cjs → token-util-BNYjqouU.cjs} +1 -1
- package/dist/{token-util-Cw83HNFN.cjs.map → token-util-BNYjqouU.cjs.map} +1 -1
- package/dist/{token-util-1O_mwf8r.js → token-util-CqB8j8br.js} +2 -2
- package/dist/{token-util-1O_mwf8r.js.map → token-util-CqB8j8br.js.map} +1 -1
- package/dist/transports/{stdio-DeWUp4RP.d.cts → stdio-BoqvAN3P.d.cts} +1 -1
- package/dist/transports/{stdio-DeWUp4RP.d.cts.map → stdio-BoqvAN3P.d.cts.map} +1 -1
- package/dist/transports/{stdio-DKQR8J7l.d.ts → stdio-BvNog4wx.d.ts} +1 -1
- package/dist/transports/{stdio-DKQR8J7l.d.ts.map → stdio-BvNog4wx.d.ts.map} +1 -1
- package/dist/transports/stdio.cjs +1 -1
- package/dist/transports/stdio.js +1 -1
- package/dist/{version-BD4r13ze.cjs → version-BN5g2FHt.cjs} +1 -1
- package/dist/{version-BD4r13ze.cjs.map → version-BN5g2FHt.cjs.map} +1 -1
- package/dist/{version-4iOZzjiD.js → version-CV6JJx_P.js} +1 -1
- package/dist/{version-4iOZzjiD.js.map → version-CV6JJx_P.js.map} +1 -1
- package/package.json +2 -2
- package/dist/cli/parse-CX7Bcldr.d.ts +0 -11
- package/dist/cli/parse-CX7Bcldr.d.ts.map +0 -1
- package/dist/cli/parse-EvLqDjN2.d.cts +0 -11
- package/dist/cli/parse-EvLqDjN2.d.cts.map +0 -1
- package/dist/cli/parse.cjs +0 -107
- package/dist/cli/parse.cjs.map +0 -1
- package/dist/cli/parse.js +0 -103
- package/dist/cli/parse.js.map +0 -1
- package/dist/cli/resolve-BVtyZcQM.d.ts +0 -10
- package/dist/cli/resolve-BVtyZcQM.d.ts.map +0 -1
- package/dist/cli/resolve-C3hwH129.d.cts +0 -10
- package/dist/cli/resolve-C3hwH129.d.cts.map +0 -1
- package/dist/cli/resolve.cjs +0 -56
- package/dist/cli/resolve.cjs.map +0 -1
- package/dist/cli/resolve.js +0 -54
- package/dist/cli/resolve.js.map +0 -1
- package/dist/cli/types-CnTkIHzd.d.ts +0 -73
- package/dist/cli/types-CnTkIHzd.d.ts.map +0 -1
- package/dist/cli/types-VWgo1wm6.d.cts +0 -73
- package/dist/cli/types-VWgo1wm6.d.cts.map +0 -1
- package/dist/cli/types.cjs +0 -0
- package/dist/cli/types.js +0 -1
- package/dist/cli/usage-B0gAPy4S.d.cts +0 -9
- package/dist/cli/usage-B0gAPy4S.d.cts.map +0 -1
- package/dist/cli/usage-BhCVaC5j.d.ts +0 -9
- package/dist/cli/usage-BhCVaC5j.d.ts.map +0 -1
- package/dist/cli/usage.cjs +0 -47
- package/dist/cli/usage.cjs.map +0 -1
- package/dist/cli/usage.js +0 -45
- package/dist/cli/usage.js.map +0 -1
- package/dist/config-CzqCJmB9.js +0 -613
- package/dist/config-CzqCJmB9.js.map +0 -1
- package/dist/config-DMt6phB6.cjs +0 -630
- package/dist/config-DMt6phB6.cjs.map +0 -1
- package/dist/constants-BrEVt86y.js +0 -194
- package/dist/constants-BrEVt86y.js.map +0 -1
- package/dist/constants-C14tQf_s.cjs +0 -217
- package/dist/constants-C14tQf_s.cjs.map +0 -1
- package/dist/server-DduxvXpe.js +0 -32499
- package/dist/server-DduxvXpe.js.map +0 -1
- package/dist/server-lur5iSHk.cjs +0 -32530
- package/dist/server-lur5iSHk.cjs.map +0 -1
- package/dist/skills-DOgs9MAy.cjs +0 -96
- package/dist/skills-DOgs9MAy.cjs.map +0 -1
- package/dist/skills-DfqlqYXj.js +0 -72
- package/dist/skills-DfqlqYXj.js.map +0 -1
- package/dist/url-utils-BHhxlntO.js +0 -119
- package/dist/url-utils-BHhxlntO.js.map +0 -1
- package/dist/url-utils-N2ExJl9F.cjs +0 -161
- package/dist/url-utils-N2ExJl9F.cjs.map +0 -1
- /package/dist/{index-16fTC-hT.d.cts → index-Cxeq9ZuA.d.ts} +0 -0
- /package/dist/{index-UKPmYT-S.d.ts → index-XTv1ki6h.d.cts} +0 -0
package/dist/skills-DOgs9MAy.cjs
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../mcp-core/dist/skills.js
|
|
3
|
-
const SKILLS = {
|
|
4
|
-
inspect: {
|
|
5
|
-
id: "inspect",
|
|
6
|
-
name: "Inspect Issues & Events",
|
|
7
|
-
description: "Search for errors, analyze traces, and explore event details",
|
|
8
|
-
defaultEnabled: true,
|
|
9
|
-
order: 1
|
|
10
|
-
},
|
|
11
|
-
seer: {
|
|
12
|
-
id: "seer",
|
|
13
|
-
name: "Seer",
|
|
14
|
-
description: "Sentry's AI debugger that helps you analyze, root cause, and fix issues",
|
|
15
|
-
defaultEnabled: true,
|
|
16
|
-
order: 2
|
|
17
|
-
},
|
|
18
|
-
docs: {
|
|
19
|
-
id: "docs",
|
|
20
|
-
name: "Documentation",
|
|
21
|
-
description: "Search and read Sentry SDK documentation",
|
|
22
|
-
defaultEnabled: false,
|
|
23
|
-
order: 3
|
|
24
|
-
},
|
|
25
|
-
triage: {
|
|
26
|
-
id: "triage",
|
|
27
|
-
name: "Triage Issues",
|
|
28
|
-
description: "Resolve, assign, and update issues",
|
|
29
|
-
defaultEnabled: false,
|
|
30
|
-
order: 4
|
|
31
|
-
},
|
|
32
|
-
"project-management": {
|
|
33
|
-
id: "project-management",
|
|
34
|
-
name: "Manage Projects & Teams",
|
|
35
|
-
description: "Create and modify projects, teams, and DSNs",
|
|
36
|
-
defaultEnabled: false,
|
|
37
|
-
order: 5
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
const SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);
|
|
41
|
-
const ALL_SKILLS = Object.keys(SKILLS);
|
|
42
|
-
const DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);
|
|
43
|
-
function isValidSkill(skill) {
|
|
44
|
-
return skill in SKILLS;
|
|
45
|
-
}
|
|
46
|
-
function isEnabledBySkills(grantedSkills, toolSkills) {
|
|
47
|
-
if (!grantedSkills || toolSkills.length === 0) return false;
|
|
48
|
-
return toolSkills.some((skill) => grantedSkills.has(skill));
|
|
49
|
-
}
|
|
50
|
-
function parseSkills(input) {
|
|
51
|
-
const valid = /* @__PURE__ */ new Set();
|
|
52
|
-
const invalid = [];
|
|
53
|
-
if (!input) return {
|
|
54
|
-
valid,
|
|
55
|
-
invalid
|
|
56
|
-
};
|
|
57
|
-
let skills = [];
|
|
58
|
-
if (typeof input === "string") skills = input.split(",");
|
|
59
|
-
else if (Array.isArray(input)) skills = input.map((v) => typeof v === "string" ? v : "");
|
|
60
|
-
for (const skill of skills) {
|
|
61
|
-
const trimmed = String(skill).trim();
|
|
62
|
-
if (isValidSkill(trimmed)) valid.add(trimmed);
|
|
63
|
-
else if (trimmed) invalid.push(trimmed);
|
|
64
|
-
}
|
|
65
|
-
return {
|
|
66
|
-
valid,
|
|
67
|
-
invalid
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
//#endregion
|
|
72
|
-
Object.defineProperty(exports, 'ALL_SKILLS', {
|
|
73
|
-
enumerable: true,
|
|
74
|
-
get: function () {
|
|
75
|
-
return ALL_SKILLS;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
Object.defineProperty(exports, 'SKILLS', {
|
|
79
|
-
enumerable: true,
|
|
80
|
-
get: function () {
|
|
81
|
-
return SKILLS;
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
Object.defineProperty(exports, 'isEnabledBySkills', {
|
|
85
|
-
enumerable: true,
|
|
86
|
-
get: function () {
|
|
87
|
-
return isEnabledBySkills;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
Object.defineProperty(exports, 'parseSkills', {
|
|
91
|
-
enumerable: true,
|
|
92
|
-
get: function () {
|
|
93
|
-
return parseSkills;
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
//# sourceMappingURL=skills-DOgs9MAy.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skills-DOgs9MAy.cjs","names":[],"sources":["../../mcp-core/dist/skills.js"],"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 tools = (await import(\"./tools/index.js\")).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.skills)) for (const skill of tool.skills) 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 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 tools = (await import(\"./tools/index.js\")).default;\n\tconst scopes = new Set(DEFAULT_SCOPES);\n\tfor (const tool of Object.values(tools)) if (tool.skills.some((skill) => grantedSkills.has(skill))) for (const scope of tool.requiredScopes) scopes.add(scope);\n\treturn scopes;\n}\n\n//#endregion\nexport { ALL_SKILLS, DEFAULT_SKILLS, SKILLS, SKILLS_ARRAY, getScopesForSkills, getSkillsArrayWithCounts, isEnabledBySk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AE,OAAM,IAAI,QAAQ;WACpC,QAAS,SAAQ,KAAK,QAAQ;;AAExC,QAAO;EACN;EACA;EACA"}
|
package/dist/skills-DfqlqYXj.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
//#region ../mcp-core/dist/skills.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 isEnabledBySkills(grantedSkills, toolSkills) {
|
|
46
|
-
if (!grantedSkills || toolSkills.length === 0) return false;
|
|
47
|
-
return toolSkills.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
|
-
export { parseSkills as i, SKILLS as n, isEnabledBySkills as r, ALL_SKILLS as t };
|
|
72
|
-
//# sourceMappingURL=skills-DfqlqYXj.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skills-DfqlqYXj.js","names":[],"sources":["../../mcp-core/dist/skills.js"],"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 tools = (await import(\"./tools/index.js\")).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.skills)) for (const skill of tool.skills) 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 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 tools = (await import(\"./tools/index.js\")).default;\n\tconst scopes = new Set(DEFAULT_SCOPES);\n\tfor (const tool of Object.values(tools)) if (tool.skills.some((skill) => grantedSkills.has(skill))) for (const scope of tool.requiredScopes) scopes.add(scope);\n\treturn scopes;\n}\n\n//#endregion\nexport { ALL_SKILLS, DEFAULT_SKILLS, SKILLS, SKILLS_ARRAY, getScopesForSkills, getSkillsArrayWithCounts, isEnabledBySkills, isValidSkill, parseSkills };\n//# sourceMappingURL=skills.js.map"],"mappings":";AACA,MAAM,SAAS;CACd,SAAS;EACR,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;EACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;EACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;EACP;CACD,QAAQ;EACP,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;EACP;CACD,sBAAsB;EACrB,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;EACP;CACD;AACD,MAAM,eAAe,OAAO,OAAO,OAAO,CAAC,MAAM,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM;AAW5E,MAAM,aAAa,OAAO,KAAK,OAAO;AACtC,MAAM,iBAAiB,aAAa,QAAQ,MAAM,EAAE,eAAe,CAAC,KAAK,MAAM,EAAE,GAAG;AACpF,SAAS,aAAa,OAAO;AAC5B,QAAO,SAAS;;AAEjB,SAAS,kBAAkB,eAAe,YAAY;AACrD,KAAI,CAAC,iBAAiB,WAAW,WAAW,EAAG,QAAO;AACtD,QAAO,WAAW,MAAM,UAAU,cAAc,IAAI,MAAM,CAAC;;AAE5D,SAAS,YAAY,OAAO;CAC3B,MAAM,wBAAwB,IAAI,KAAK;CACvC,MAAM,UAAU,EAAE;AAClB,KAAI,CAAC,MAAO,QAAO;EAClB;EACA;EACA;CACD,IAAI,SAAS,EAAE;AACf,KAAI,OAAO,UAAU,SAAU,UAAS,MAAM,MAAM,IAAI;UAC/C,MAAM,QAAQ,MAAM,CAAE,UAAS,MAAM,KAAK,MAAM,OAAO,MAAM,WAAW,IAAI,GAAG;AACxF,MAAK,MAAM,SAAS,QAAQ;EAC3B,MAAM,UAAU,OAAO,MAAM,CAAC,MAAM;AACpC,MAAI,aAAa,QAAQ,CAAE,OAAM,IAAI,QAAQ;WACpC,QAAS,SAAQ,KAAK,QAAQ;;AAExC,QAAO;EACN;EACA;EACA"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
//#region ../mcp-core/dist/utils/url-utils.js
|
|
2
|
-
/**
|
|
3
|
-
* Determines if a Sentry instance is SaaS or self-hosted based on the host.
|
|
4
|
-
* @param host The Sentry host (e.g., "sentry.io" or "sentry.company.com")
|
|
5
|
-
* @returns true if SaaS instance, false if self-hosted
|
|
6
|
-
*/
|
|
7
|
-
function isSentryHost(host) {
|
|
8
|
-
return host === "sentry.io" || host.endsWith(".sentry.io");
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Generates a Sentry issue URL.
|
|
12
|
-
* @param host The Sentry host (may include regional subdomain for API access)
|
|
13
|
-
* @param organizationSlug Organization identifier
|
|
14
|
-
* @param issueId Issue identifier (e.g., "PROJECT-123")
|
|
15
|
-
* @returns The complete issue URL
|
|
16
|
-
*/
|
|
17
|
-
function getIssueUrl(host, organizationSlug, issueId) {
|
|
18
|
-
const isSaas = isSentryHost(host);
|
|
19
|
-
return isSaas ? `https://${organizationSlug}.${isSaas ? "sentry.io" : host}/issues/${issueId}` : `https://${host}/organizations/${organizationSlug}/issues/${issueId}`;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Generates a Sentry issues search URL.
|
|
23
|
-
* @param host The Sentry host (may include regional subdomain for API access)
|
|
24
|
-
* @param organizationSlug Organization identifier
|
|
25
|
-
* @param query Optional search query
|
|
26
|
-
* @param projectSlugOrId Optional project slug or ID
|
|
27
|
-
* @returns The complete issues search URL
|
|
28
|
-
*/
|
|
29
|
-
function getIssuesSearchUrl(host, organizationSlug, query, projectSlugOrId) {
|
|
30
|
-
const isSaas = isSentryHost(host);
|
|
31
|
-
let url = isSaas ? `https://${organizationSlug}.${isSaas ? "sentry.io" : host}/issues/` : `https://${host}/organizations/${organizationSlug}/issues/`;
|
|
32
|
-
const params = new URLSearchParams();
|
|
33
|
-
if (projectSlugOrId) params.append("project", projectSlugOrId);
|
|
34
|
-
if (query) params.append("query", query);
|
|
35
|
-
const queryString = params.toString();
|
|
36
|
-
if (queryString) url += `?${queryString}`;
|
|
37
|
-
return url;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Generates a Sentry trace URL for performance investigation.
|
|
41
|
-
* @param host The Sentry host (may include regional subdomain for API access)
|
|
42
|
-
* @param organizationSlug Organization identifier
|
|
43
|
-
* @param traceId Trace identifier
|
|
44
|
-
* @returns The complete trace URL
|
|
45
|
-
*/
|
|
46
|
-
function getTraceUrl(host, organizationSlug, traceId) {
|
|
47
|
-
const isSaas = isSentryHost(host);
|
|
48
|
-
return isSaas ? `https://${organizationSlug}.${isSaas ? "sentry.io" : host}/explore/traces/trace/${traceId}` : `https://${host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Internal validation function that checks if a SENTRY_HOST value contains only hostname (no protocol).
|
|
52
|
-
* Throws an error if validation fails instead of exiting the process.
|
|
53
|
-
*
|
|
54
|
-
* @param host The hostname to validate
|
|
55
|
-
* @throws {Error} If the host contains a protocol
|
|
56
|
-
*/
|
|
57
|
-
function _validateSentryHostInternal(host) {
|
|
58
|
-
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.");
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Internal validation function that checks if a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.
|
|
62
|
-
* Throws an error if validation fails instead of exiting the process.
|
|
63
|
-
*
|
|
64
|
-
* @param url The HTTPS URL to validate and parse
|
|
65
|
-
* @returns The extracted hostname from the URL
|
|
66
|
-
* @throws {Error} If the URL is invalid or not HTTPS
|
|
67
|
-
*/
|
|
68
|
-
function _validateAndParseSentryUrlInternal(url) {
|
|
69
|
-
if (!url.startsWith("https://")) throw new Error("SENTRY_URL must be a full HTTPS URL (e.g., https://sentry.example.com).");
|
|
70
|
-
try {
|
|
71
|
-
return new URL(url).host;
|
|
72
|
-
} catch (error) {
|
|
73
|
-
throw new Error("SENTRY_URL must be a valid HTTPS URL (e.g., https://sentry.example.com).");
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* Validates that a SENTRY_HOST value contains only hostname (no protocol).
|
|
78
|
-
* Throws an error instead of exiting the process (for testing).
|
|
79
|
-
*
|
|
80
|
-
* @param host The hostname to validate
|
|
81
|
-
* @throws {Error} If the host contains a protocol
|
|
82
|
-
*/
|
|
83
|
-
function validateSentryHostThrows(host) {
|
|
84
|
-
_validateSentryHostInternal(host);
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.
|
|
88
|
-
* Throws an error instead of exiting the process (for testing).
|
|
89
|
-
*
|
|
90
|
-
* @param url The HTTPS URL to validate and parse
|
|
91
|
-
* @returns The extracted hostname from the URL
|
|
92
|
-
* @throws {Error} If the URL is invalid or not HTTPS
|
|
93
|
-
*/
|
|
94
|
-
function validateAndParseSentryUrlThrows(url) {
|
|
95
|
-
return _validateAndParseSentryUrlInternal(url);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Validates that the provided OpenAI base URL is a valid HTTP(S) URL and returns a normalized string.
|
|
99
|
-
*
|
|
100
|
-
* @param url The URL to validate and normalize
|
|
101
|
-
* @returns The normalized URL string
|
|
102
|
-
* @throws {Error} If the URL is empty, invalid, or uses an unsupported protocol
|
|
103
|
-
*/
|
|
104
|
-
function validateOpenAiBaseUrlThrows(url) {
|
|
105
|
-
const trimmed = url.trim();
|
|
106
|
-
if (trimmed.length === 0) throw new Error("OPENAI base URL must not be empty.");
|
|
107
|
-
let parsed;
|
|
108
|
-
try {
|
|
109
|
-
parsed = new URL(trimmed);
|
|
110
|
-
} catch (error) {
|
|
111
|
-
throw new Error("OPENAI base URL must be a valid HTTP or HTTPS URL (e.g., https://example.com/v1).", { cause: error });
|
|
112
|
-
}
|
|
113
|
-
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).");
|
|
114
|
-
return parsed.toString();
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
//#endregion
|
|
118
|
-
export { validateAndParseSentryUrlThrows as a, isSentryHost as i, getIssuesSearchUrl as n, validateOpenAiBaseUrlThrows as o, getTraceUrl as r, validateSentryHostThrows as s, getIssueUrl as t };
|
|
119
|
-
//# sourceMappingURL=url-utils-BHhxlntO.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"url-utils-BHhxlntO.js","names":[],"sources":["../../mcp-core/dist/utils/url-utils.js"],"sourcesContent":["//#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\treturn isSaas ? `https://${organizationSlug}.${isSaas ? \"sentry.io\" : host}/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\tlet url = isSaas ? `https://${organizationSlug}.${isSaas ? \"sentry.io\" : host}/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\treturn isSaas ? `https://${organizationSlug}.${isSaas ? \"sentry.io\" : host}/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\tlet url = isSaas ? `https://${organizationSlug}.${isSaas ? \"sentry.io\" : host}/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\treturn new URL(url).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.js.map"],"mappings":";;;;;;AAMA,SAAS,aAAa,MAAM;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AO,mCAAmC,IAAI;;;;;;;;;AAS/C,SAAS,4BAA4B,KAAK;CACzC,MAAM,UAAU,IAAI,MAAM;AAC1B,KAAI,QAAQ,WAAW,EAAG,OAAM,IAAI,MAAM,qCAAqC;CAC/E,IAAI;AACJ,KAAI;AACH,WAAS,IAAI,IAAI,QAAQ;UACjB,OAAO;AACf,QAAM,IAAI,MAAM,qFAAqF,EAAE,OAAO,OAAO,CAAC;;AAEvH,KAAI,OAAO,aAAa,YAAY,OAAO,aAAa,QAAS,OAAM,IAAI,MAAM,gFAAgF;AACjK,QAAO,OAAO,UAAU"}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region ../mcp-core/dist/utils/url-utils.js
|
|
3
|
-
/**
|
|
4
|
-
* Determines if a Sentry instance is SaaS or self-hosted based on the host.
|
|
5
|
-
* @param host The Sentry host (e.g., "sentry.io" or "sentry.company.com")
|
|
6
|
-
* @returns true if SaaS instance, false if self-hosted
|
|
7
|
-
*/
|
|
8
|
-
function isSentryHost(host) {
|
|
9
|
-
return host === "sentry.io" || host.endsWith(".sentry.io");
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
* Generates a Sentry issue URL.
|
|
13
|
-
* @param host The Sentry host (may include regional subdomain for API access)
|
|
14
|
-
* @param organizationSlug Organization identifier
|
|
15
|
-
* @param issueId Issue identifier (e.g., "PROJECT-123")
|
|
16
|
-
* @returns The complete issue URL
|
|
17
|
-
*/
|
|
18
|
-
function getIssueUrl(host, organizationSlug, issueId) {
|
|
19
|
-
const isSaas = isSentryHost(host);
|
|
20
|
-
return isSaas ? `https://${organizationSlug}.${isSaas ? "sentry.io" : host}/issues/${issueId}` : `https://${host}/organizations/${organizationSlug}/issues/${issueId}`;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Generates a Sentry issues search URL.
|
|
24
|
-
* @param host The Sentry host (may include regional subdomain for API access)
|
|
25
|
-
* @param organizationSlug Organization identifier
|
|
26
|
-
* @param query Optional search query
|
|
27
|
-
* @param projectSlugOrId Optional project slug or ID
|
|
28
|
-
* @returns The complete issues search URL
|
|
29
|
-
*/
|
|
30
|
-
function getIssuesSearchUrl(host, organizationSlug, query, projectSlugOrId) {
|
|
31
|
-
const isSaas = isSentryHost(host);
|
|
32
|
-
let url = isSaas ? `https://${organizationSlug}.${isSaas ? "sentry.io" : host}/issues/` : `https://${host}/organizations/${organizationSlug}/issues/`;
|
|
33
|
-
const params = new URLSearchParams();
|
|
34
|
-
if (projectSlugOrId) params.append("project", projectSlugOrId);
|
|
35
|
-
if (query) params.append("query", query);
|
|
36
|
-
const queryString = params.toString();
|
|
37
|
-
if (queryString) url += `?${queryString}`;
|
|
38
|
-
return url;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Generates a Sentry trace URL for performance investigation.
|
|
42
|
-
* @param host The Sentry host (may include regional subdomain for API access)
|
|
43
|
-
* @param organizationSlug Organization identifier
|
|
44
|
-
* @param traceId Trace identifier
|
|
45
|
-
* @returns The complete trace URL
|
|
46
|
-
*/
|
|
47
|
-
function getTraceUrl(host, organizationSlug, traceId) {
|
|
48
|
-
const isSaas = isSentryHost(host);
|
|
49
|
-
return isSaas ? `https://${organizationSlug}.${isSaas ? "sentry.io" : host}/explore/traces/trace/${traceId}` : `https://${host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Internal validation function that checks if a SENTRY_HOST value contains only hostname (no protocol).
|
|
53
|
-
* Throws an error if validation fails instead of exiting the process.
|
|
54
|
-
*
|
|
55
|
-
* @param host The hostname to validate
|
|
56
|
-
* @throws {Error} If the host contains a protocol
|
|
57
|
-
*/
|
|
58
|
-
function _validateSentryHostInternal(host) {
|
|
59
|
-
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.");
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Internal validation function that checks if a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.
|
|
63
|
-
* Throws an error if validation fails instead of exiting the process.
|
|
64
|
-
*
|
|
65
|
-
* @param url The HTTPS URL to validate and parse
|
|
66
|
-
* @returns The extracted hostname from the URL
|
|
67
|
-
* @throws {Error} If the URL is invalid or not HTTPS
|
|
68
|
-
*/
|
|
69
|
-
function _validateAndParseSentryUrlInternal(url) {
|
|
70
|
-
if (!url.startsWith("https://")) throw new Error("SENTRY_URL must be a full HTTPS URL (e.g., https://sentry.example.com).");
|
|
71
|
-
try {
|
|
72
|
-
return new URL(url).host;
|
|
73
|
-
} catch (error) {
|
|
74
|
-
throw new Error("SENTRY_URL must be a valid HTTPS URL (e.g., https://sentry.example.com).");
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Validates that a SENTRY_HOST value contains only hostname (no protocol).
|
|
79
|
-
* Throws an error instead of exiting the process (for testing).
|
|
80
|
-
*
|
|
81
|
-
* @param host The hostname to validate
|
|
82
|
-
* @throws {Error} If the host contains a protocol
|
|
83
|
-
*/
|
|
84
|
-
function validateSentryHostThrows(host) {
|
|
85
|
-
_validateSentryHostInternal(host);
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.
|
|
89
|
-
* Throws an error instead of exiting the process (for testing).
|
|
90
|
-
*
|
|
91
|
-
* @param url The HTTPS URL to validate and parse
|
|
92
|
-
* @returns The extracted hostname from the URL
|
|
93
|
-
* @throws {Error} If the URL is invalid or not HTTPS
|
|
94
|
-
*/
|
|
95
|
-
function validateAndParseSentryUrlThrows(url) {
|
|
96
|
-
return _validateAndParseSentryUrlInternal(url);
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Validates that the provided OpenAI base URL is a valid HTTP(S) URL and returns a normalized string.
|
|
100
|
-
*
|
|
101
|
-
* @param url The URL to validate and normalize
|
|
102
|
-
* @returns The normalized URL string
|
|
103
|
-
* @throws {Error} If the URL is empty, invalid, or uses an unsupported protocol
|
|
104
|
-
*/
|
|
105
|
-
function validateOpenAiBaseUrlThrows(url) {
|
|
106
|
-
const trimmed = url.trim();
|
|
107
|
-
if (trimmed.length === 0) throw new Error("OPENAI base URL must not be empty.");
|
|
108
|
-
let parsed;
|
|
109
|
-
try {
|
|
110
|
-
parsed = new URL(trimmed);
|
|
111
|
-
} catch (error) {
|
|
112
|
-
throw new Error("OPENAI base URL must be a valid HTTP or HTTPS URL (e.g., https://example.com/v1).", { cause: error });
|
|
113
|
-
}
|
|
114
|
-
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).");
|
|
115
|
-
return parsed.toString();
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
//#endregion
|
|
119
|
-
Object.defineProperty(exports, 'getIssueUrl', {
|
|
120
|
-
enumerable: true,
|
|
121
|
-
get: function () {
|
|
122
|
-
return getIssueUrl;
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
Object.defineProperty(exports, 'getIssuesSearchUrl', {
|
|
126
|
-
enumerable: true,
|
|
127
|
-
get: function () {
|
|
128
|
-
return getIssuesSearchUrl;
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
Object.defineProperty(exports, 'getTraceUrl', {
|
|
132
|
-
enumerable: true,
|
|
133
|
-
get: function () {
|
|
134
|
-
return getTraceUrl;
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
Object.defineProperty(exports, 'isSentryHost', {
|
|
138
|
-
enumerable: true,
|
|
139
|
-
get: function () {
|
|
140
|
-
return isSentryHost;
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
Object.defineProperty(exports, 'validateAndParseSentryUrlThrows', {
|
|
144
|
-
enumerable: true,
|
|
145
|
-
get: function () {
|
|
146
|
-
return validateAndParseSentryUrlThrows;
|
|
147
|
-
}
|
|
148
|
-
});
|
|
149
|
-
Object.defineProperty(exports, 'validateOpenAiBaseUrlThrows', {
|
|
150
|
-
enumerable: true,
|
|
151
|
-
get: function () {
|
|
152
|
-
return validateOpenAiBaseUrlThrows;
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
Object.defineProperty(exports, 'validateSentryHostThrows', {
|
|
156
|
-
enumerable: true,
|
|
157
|
-
get: function () {
|
|
158
|
-
return validateSentryHostThrows;
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
//# sourceMappingURL=url-utils-N2ExJl9F.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"url-utils-N2ExJl9F.cjs","names":[],"sources":["../../mcp-core/dist/utils/url-utils.js"],"sourcesContent":["//#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\treturn isSaas ? `https://${organizationSlug}.${isSaas ? \"sentry.io\" : host}/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\tlet url = isSaas ? `https://${organizationSlug}.${isSaas ? \"sentry.io\" : host}/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\treturn isSaas ? `https://${organizationSlug}.${isSaas ? \"sentry.io\" : host}/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\tlet url = isSaas ? `https://${organizationSlug}.${isSaas ? \"sentry.io\" : host}/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\treturn new URL(url).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.js.map"],"mappings":";;;;;;;AAMA,SAAS,aAAa,MAAM;AAC3B,QAAO,SAAS,eAAe,KAAK,SAAS,aAAa;;;;;;;;;AAS3D,SAAS,YAAY,MAAM,kBAAkB,SAAS;CACrD,MAAM,SAAS,aAAa,KAAK;AACjC,QAAO,SAAS,WAAW,iBAAiB,GAAG,SAAS,cAAc,KAAK,UAAU,YAAY,WAAW,KAAK,iBAAiB,iBAAiB,UAAU;;;;;;;;;;AAU9J,SAAS,mBAAmB,MAAM,kBAAkB,OAAO,iBAAiB;CAC3E,MAAM,SAAS,aAAa,KAAK;CACjC,IAAI,MAAM,SAAS,WAAW,iBAAiB,GAAG,SAAS,cAAc,KAAK,YAAY,WAAW,KAAK,iBAAiB,iBAAiB;CAC5I,MAAM,SAAS,IAAI,iBAAiB;AACpC,KAAI,gBAAiB,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