@sentry/mcp-server 0.8.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -6
- package/dist/api-client/client.cjs +2 -2
- package/dist/api-client/client.d.cts +3 -3
- package/dist/api-client/client.d.ts +3 -3
- package/dist/api-client/client.js +2 -2
- package/dist/api-client/client.test.cjs +3 -3
- package/dist/api-client/client.test.js +3 -3
- package/dist/api-client/index.cjs +3 -2
- package/dist/api-client/index.d.cts +4 -4
- package/dist/api-client/index.d.ts +4 -4
- package/dist/api-client/index.js +3 -3
- package/dist/api-client/schema.cjs +2 -1
- package/dist/api-client/schema.d.cts +2 -2
- package/dist/api-client/schema.d.ts +2 -2
- package/dist/api-client/schema.js +2 -2
- package/dist/api-client/types.d.cts +2 -2
- package/dist/api-client/types.d.ts +2 -2
- package/dist/{client-Cp-Y1PHr.cjs → client-B4Ux5Zdg.cjs} +7 -4
- package/dist/client-B4Ux5Zdg.cjs.map +1 -0
- package/dist/{client-CXUzhM1I.js → client-Bz_PNC8o.js} +7 -4
- package/dist/client-Bz_PNC8o.js.map +1 -0
- package/dist/{client-CRlGzHly.d.ts → client-J6VSRmQS.d.ts} +10 -8
- package/dist/client-J6VSRmQS.d.ts.map +1 -0
- package/dist/{client-TjRMJC41.d.cts → client-tE6FD__9.d.cts} +6 -4
- package/dist/client-tE6FD__9.d.cts.map +1 -0
- package/dist/{formatting-BmbJ5-Uh.cjs → formatting-B0SJqiqX.cjs} +33 -11
- package/dist/formatting-B0SJqiqX.cjs.map +1 -0
- package/dist/formatting-ggD6YRYR.js +68 -0
- package/dist/formatting-ggD6YRYR.js.map +1 -0
- package/dist/index.cjs +13 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/internal/formatting.cjs +1 -1
- package/dist/internal/formatting.d.cts +3 -3
- package/dist/internal/formatting.d.cts.map +1 -1
- package/dist/internal/formatting.d.ts +3 -3
- package/dist/internal/formatting.d.ts.map +1 -1
- package/dist/internal/formatting.js +1 -1
- package/dist/internal/issue-helpers.test.cjs +3 -3
- package/dist/internal/issue-helpers.test.cjs.map +1 -1
- package/dist/internal/issue-helpers.test.js +3 -3
- package/dist/internal/issue-helpers.test.js.map +1 -1
- package/dist/{promptDefinitions-Dcz3d9wL.d.cts → promptDefinitions-BR7PxWcH.d.cts} +3 -3
- package/dist/promptDefinitions-BR7PxWcH.d.cts.map +1 -0
- package/dist/{promptDefinitions-CPTadtuI.js → promptDefinitions-DBNOeSg-.js} +5 -5
- package/dist/promptDefinitions-DBNOeSg-.js.map +1 -0
- package/dist/{promptDefinitions-5jiZMBg5.cjs → promptDefinitions-pHRpPOpJ.cjs} +5 -5
- package/dist/promptDefinitions-pHRpPOpJ.cjs.map +1 -0
- package/dist/{promptDefinitions-DrGK-v8n.d.ts → promptDefinitions-tpKruPny.d.ts} +3 -3
- package/dist/promptDefinitions-tpKruPny.d.ts.map +1 -0
- package/dist/promptDefinitions.cjs +2 -2
- package/dist/promptDefinitions.d.cts +1 -1
- package/dist/promptDefinitions.d.ts +1 -1
- package/dist/promptDefinitions.js +2 -2
- package/dist/prompts.d.cts +5 -5
- package/dist/prompts.d.ts +5 -5
- package/dist/{schema-BuByiEkr.cjs → schema-3VLYcf4D.cjs} +19 -2
- package/dist/schema-3VLYcf4D.cjs.map +1 -0
- package/dist/{schema-BzLH7LPa.d.ts → schema-B7A-FyIi.d.ts} +176 -88
- package/dist/schema-B7A-FyIi.d.ts.map +1 -0
- package/dist/schema-BKa41TQ4.js +17 -0
- package/dist/schema-BKa41TQ4.js.map +1 -0
- package/dist/{schema-Drnljuwf.js → schema-Dltbjui7.js} +14 -3
- package/dist/schema-Dltbjui7.js.map +1 -0
- package/dist/{schema-DpID9ztC.d.cts → schema-PvgLrC1b.d.cts} +358 -270
- package/dist/schema-PvgLrC1b.d.cts.map +1 -0
- package/dist/schema-jk88gqOu.cjs +78 -0
- package/dist/schema-jk88gqOu.cjs.map +1 -0
- package/dist/schema.cjs +3 -1
- package/dist/schema.d.cts +3 -1
- package/dist/schema.d.cts.map +1 -1
- package/dist/schema.d.ts +3 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +2 -2
- package/dist/{server-fYrkDOmy.cjs → server-VwFSUPQn.cjs} +5 -5
- package/dist/{server-fYrkDOmy.cjs.map → server-VwFSUPQn.cjs.map} +1 -1
- package/dist/{server-BCmPE_Kt.js → server-yb4PkNyo.js} +5 -5
- package/dist/{server-BCmPE_Kt.js.map → server-yb4PkNyo.js.map} +1 -1
- package/dist/server.cjs +8 -8
- package/dist/server.d.cts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js +8 -8
- package/dist/{stdio-BxJq3OU7.cjs → stdio-65sYKLOk.cjs} +2 -2
- package/dist/{stdio-BxJq3OU7.cjs.map → stdio-65sYKLOk.cjs.map} +1 -1
- package/dist/{stdio-QBN7-Am6.js → stdio-DkU2-spy.js} +2 -2
- package/dist/{stdio-QBN7-Am6.js.map → stdio-DkU2-spy.js.map} +1 -1
- package/dist/test-setup.cjs +1338 -1142
- package/dist/test-setup.cjs.map +1 -1
- package/dist/test-setup.js +1338 -1141
- package/dist/test-setup.js.map +1 -1
- package/dist/{toolDefinitions-Z-JGBEIN.d.cts → toolDefinitions-B94CNDbt.d.cts} +33 -51
- package/dist/toolDefinitions-B94CNDbt.d.cts.map +1 -0
- package/dist/{toolDefinitions-D13S3vQE.js → toolDefinitions-Bb_1ejkl.js} +83 -100
- package/dist/toolDefinitions-Bb_1ejkl.js.map +1 -0
- package/dist/{toolDefinitions-1SnflztE.cjs → toolDefinitions-DIhvw3vk.cjs} +83 -100
- package/dist/toolDefinitions-DIhvw3vk.cjs.map +1 -0
- package/dist/{toolDefinitions-DkO9-iEg.d.ts → toolDefinitions-q_1-70fG.d.ts} +33 -51
- package/dist/toolDefinitions-q_1-70fG.d.ts.map +1 -0
- package/dist/toolDefinitions.cjs +2 -2
- package/dist/toolDefinitions.d.cts +1 -1
- package/dist/toolDefinitions.d.ts +1 -1
- package/dist/toolDefinitions.js +2 -2
- package/dist/toolDefinitions.test.cjs +2 -2
- package/dist/toolDefinitions.test.js +2 -2
- package/dist/{tools-BgrGdS8I.cjs → tools-BdkmyaZo.cjs} +36 -77
- package/dist/tools-BdkmyaZo.cjs.map +1 -0
- package/dist/{tools-CnVttgaS.js → tools-CMFpMPpD.js} +36 -77
- package/dist/tools-CMFpMPpD.js.map +1 -0
- package/dist/tools.cjs +4 -4
- package/dist/tools.d.cts +35 -50
- package/dist/tools.d.cts.map +1 -1
- package/dist/tools.d.ts +38 -53
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +4 -4
- package/dist/tools.test.cjs +128 -88
- package/dist/tools.test.cjs.map +1 -1
- package/dist/tools.test.js +128 -88
- package/dist/tools.test.js.map +1 -1
- package/dist/transports/stdio.cjs +9 -9
- package/dist/transports/stdio.d.cts +3 -3
- package/dist/transports/stdio.d.ts +3 -3
- package/dist/transports/stdio.js +9 -9
- package/dist/{types-CczA6AH1.d.cts → types-B03G337q.d.cts} +2 -2
- package/dist/{types-CczA6AH1.d.cts.map → types-B03G337q.d.cts.map} +1 -1
- package/dist/{types-X5Epdrlo.d.ts → types-CN4NEway.d.ts} +2 -2
- package/dist/{types-X5Epdrlo.d.ts.map → types-CN4NEway.d.ts.map} +1 -1
- package/dist/{types-BO0mZ8vj.d.cts → types-OeoNXRm-.d.cts} +3 -3
- package/dist/{types-BO0mZ8vj.d.cts.map → types-OeoNXRm-.d.cts.map} +1 -1
- package/dist/{types-Cis1PiVW.d.ts → types-jftb-CP9.d.ts} +3 -3
- package/dist/{types-Cis1PiVW.d.ts.map → types-jftb-CP9.d.ts.map} +1 -1
- package/dist/types.d.cts +3 -3
- package/dist/types.d.ts +3 -3
- package/dist/{version-sY-gY_s6.cjs → version-CDnh7DyW.cjs} +2 -2
- package/dist/{version-sY-gY_s6.cjs.map → version-CDnh7DyW.cjs.map} +1 -1
- package/dist/version-TjO7fHpC.js +6 -0
- package/dist/{version-DtWIv-x9.js.map → version-TjO7fHpC.js.map} +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/dist/{vi.ClIskdbk-TqmAThAO.cjs → vi.ClIskdbk-Bs263gvI.cjs} +5 -5
- package/dist/{vi.ClIskdbk-TqmAThAO.cjs.map → vi.ClIskdbk-Bs263gvI.cjs.map} +1 -1
- package/dist/{vi.ClIskdbk-BbUmO3mx.js → vi.ClIskdbk-De9q3829.js} +5 -5
- package/dist/{vi.ClIskdbk-BbUmO3mx.js.map → vi.ClIskdbk-De9q3829.js.map} +1 -1
- package/package.json +6 -6
- package/dist/client-CRlGzHly.d.ts.map +0 -1
- package/dist/client-CXUzhM1I.js.map +0 -1
- package/dist/client-Cp-Y1PHr.cjs.map +0 -1
- package/dist/client-TjRMJC41.d.cts.map +0 -1
- package/dist/formatting-BmbJ5-Uh.cjs.map +0 -1
- package/dist/formatting-C6Py2iOz.js +0 -46
- package/dist/formatting-C6Py2iOz.js.map +0 -1
- package/dist/promptDefinitions-5jiZMBg5.cjs.map +0 -1
- package/dist/promptDefinitions-CPTadtuI.js.map +0 -1
- package/dist/promptDefinitions-Dcz3d9wL.d.cts.map +0 -1
- package/dist/promptDefinitions-DrGK-v8n.d.ts.map +0 -1
- package/dist/schema-BCkBPgjj.cjs +0 -64
- package/dist/schema-BCkBPgjj.cjs.map +0 -1
- package/dist/schema-BuByiEkr.cjs.map +0 -1
- package/dist/schema-BzLH7LPa.d.ts.map +0 -1
- package/dist/schema-CJrk_GUH.js +0 -15
- package/dist/schema-CJrk_GUH.js.map +0 -1
- package/dist/schema-DpID9ztC.d.cts.map +0 -1
- package/dist/schema-Drnljuwf.js.map +0 -1
- package/dist/toolDefinitions-1SnflztE.cjs.map +0 -1
- package/dist/toolDefinitions-D13S3vQE.js.map +0 -1
- package/dist/toolDefinitions-DkO9-iEg.d.ts.map +0 -1
- package/dist/toolDefinitions-Z-JGBEIN.d.cts.map +0 -1
- package/dist/tools-BgrGdS8I.cjs.map +0 -1
- package/dist/tools-CnVttgaS.js.map +0 -1
- package/dist/version-DtWIv-x9.js +0 -6
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatting-B0SJqiqX.cjs","names":["frame: z.infer<typeof FrameInterface>","platform: string | undefined | null","event: Event","data: z.infer<typeof ErrorEntrySchema>","data: z.infer<typeof RequestEntrySchema>","contexts: z.infer<typeof EventSchema>[\"contexts\"]"],"sources":["../src/internal/formatting.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { Event, Issue } from \"../api-client/types\";\nimport type {\n ErrorEntrySchema,\n ErrorEventSchema,\n EventSchema,\n FrameInterface,\n RequestEntrySchema,\n SentryApiService,\n} from \"../api-client\";\n\nexport function formatFrameHeader(\n frame: z.infer<typeof FrameInterface>,\n platform: string | undefined | null,\n) {\n if (platform?.startsWith(\"javascript\")) {\n return `${[frame.filename, frame.lineNo, frame.colNo]\n .filter((i) => !!i)\n .join(\":\")}${frame.function ? ` (${frame.function})` : \"\"}`;\n }\n return `${frame.function ? `\"${frame.function}\"` : \"unknown function\"} in \"${frame.filename || frame.module}\"${\n frame.lineNo\n ? ` at line ${frame.lineNo}${frame.colNo !== null ? `:${frame.colNo}` : \"\"}`\n : \"\"\n }`;\n}\n\nexport function formatEventOutput(event: Event) {\n let output = \"\";\n for (const entry of event.entries) {\n if (entry.type === \"exception\") {\n output += formatExceptionInterfaceOutput(\n event,\n entry.data as z.infer<typeof ErrorEntrySchema>,\n );\n }\n if (entry.type === \"request\") {\n output += formatRequestInterfaceOutput(\n event,\n entry.data as z.infer<typeof RequestEntrySchema>,\n );\n }\n }\n output += formatContexts(event.contexts);\n return output;\n}\n\nfunction formatExceptionInterfaceOutput(\n event: Event,\n data: z.infer<typeof ErrorEntrySchema>,\n) {\n let output = \"\";\n // TODO: support chained exceptions\n const firstError = data.value ?? data.values[0];\n if (!firstError) {\n return \"\";\n }\n output += `### Error\\n\\n${\"```\"}\\n${firstError.type}: ${\n firstError.value\n }\\n${\"```\"}\\n\\n`;\n if (!firstError.stacktrace || !firstError.stacktrace.frames) {\n return output;\n }\n output += `**Stacktrace:**\\n${\"```\"}\\n${firstError.stacktrace.frames\n .map((frame) => {\n const context = frame.context?.length\n ? `${frame.context\n .filter(([lineno, _]) => lineno === frame.lineNo)\n .map(([_, code]) => `\\n${code}`)\n .join(\"\")}`\n : \"\";\n\n return `${formatFrameHeader(frame, event.platform)}${context}`;\n })\n .join(\"\\n\")}\\n${\"```\"}\\n\\n`;\n return output;\n}\n\nfunction formatRequestInterfaceOutput(\n event: Event,\n data: z.infer<typeof RequestEntrySchema>,\n) {\n if (!data.method || !data.url) {\n return \"\";\n }\n return `### HTTP Request\\n\\n**Method:** ${data.method}\\n**URL:** ${data.url}\\n\\n`;\n}\n\nfunction formatContexts(contexts: z.infer<typeof EventSchema>[\"contexts\"]) {\n if (!contexts) {\n return \"\";\n }\n return `### Additional Context\\n\\nThese are additional context provided by the user when they're instrumenting their application.\\n\\n${Object.entries(\n contexts,\n )\n .map(\n ([name, data]) =>\n `**${name}**\\n${Object.entries(data)\n .filter(([key, _]) => key !== \"type\")\n .map(([key, value]) => {\n return `${key}: ${JSON.stringify(value, undefined, 2)}`;\n })\n .join(\"\\n\")}`,\n )\n .join(\"\\n\\n\")}\\n\\n`;\n}\n\nexport function formatIssueOutput({\n organizationSlug,\n issue,\n event,\n apiService,\n}: {\n organizationSlug: string;\n issue: Issue;\n event: Event;\n apiService: SentryApiService;\n}) {\n let output = `# Issue ${issue.shortId} in **${organizationSlug}**\\n\\n`;\n output += `**Description**: ${issue.title}\\n`;\n output += `**Culprit**: ${issue.culprit}\\n`;\n output += `**First Seen**: ${new Date(issue.firstSeen).toISOString()}\\n`;\n output += `**Last Seen**: ${new Date(issue.lastSeen).toISOString()}\\n`;\n output += `**Occurrences**: ${issue.count}\\n`;\n output += `**Users Impacted**: ${issue.userCount}\\n`;\n output += `**Status**: ${issue.status}\\n`;\n output += `**Platform**: ${issue.platform}\\n`;\n output += `**Project**: ${issue.project.name}\\n`;\n output += `**URL**: ${apiService.getIssueUrl(organizationSlug, issue.shortId)}\\n`;\n output += \"\\n\";\n output += \"## Event Details\\n\\n\";\n output += `**Event ID**: ${event.id}\\n`;\n if (event.type === \"error\") {\n output += `**Occurred At**: ${new Date((event as z.infer<typeof ErrorEventSchema>).dateCreated).toISOString()}\\n`;\n }\n if (event.message) {\n output += `**Message**:\\n${event.message}\\n`;\n }\n output += \"\\n\";\n output += formatEventOutput(event);\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the IssueID in commit messages (e.g. \\`Fixes ${issue.shortId}\\`) to automatically close the issue when the commit is merged.\\n`;\n output +=\n \"- The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\\n\";\n return output;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
//#region src/internal/formatting.ts
|
|
2
|
+
function formatFrameHeader(frame, platform) {
|
|
3
|
+
if (platform?.startsWith("javascript")) return `${[
|
|
4
|
+
frame.filename,
|
|
5
|
+
frame.lineNo,
|
|
6
|
+
frame.colNo
|
|
7
|
+
].filter((i) => !!i).join(":")}${frame.function ? ` (${frame.function})` : ""}`;
|
|
8
|
+
return `${frame.function ? `"${frame.function}"` : "unknown function"} in "${frame.filename || frame.module}"${frame.lineNo ? ` at line ${frame.lineNo}${frame.colNo !== null ? `:${frame.colNo}` : ""}` : ""}`;
|
|
9
|
+
}
|
|
10
|
+
function formatEventOutput(event) {
|
|
11
|
+
let output = "";
|
|
12
|
+
for (const entry of event.entries) {
|
|
13
|
+
if (entry.type === "exception") output += formatExceptionInterfaceOutput(event, entry.data);
|
|
14
|
+
if (entry.type === "request") output += formatRequestInterfaceOutput(event, entry.data);
|
|
15
|
+
}
|
|
16
|
+
output += formatContexts(event.contexts);
|
|
17
|
+
return output;
|
|
18
|
+
}
|
|
19
|
+
function formatExceptionInterfaceOutput(event, data) {
|
|
20
|
+
let output = "";
|
|
21
|
+
const firstError = data.value ?? data.values[0];
|
|
22
|
+
if (!firstError) return "";
|
|
23
|
+
output += `### Error\n\n\`\`\`\n${firstError.type}: ${firstError.value}\n\`\`\`\n\n`;
|
|
24
|
+
if (!firstError.stacktrace || !firstError.stacktrace.frames) return output;
|
|
25
|
+
output += `**Stacktrace:**\n\`\`\`\n${firstError.stacktrace.frames.map((frame) => {
|
|
26
|
+
const context = frame.context?.length ? `${frame.context.filter(([lineno, _]) => lineno === frame.lineNo).map(([_, code]) => `\n${code}`).join("")}` : "";
|
|
27
|
+
return `${formatFrameHeader(frame, event.platform)}${context}`;
|
|
28
|
+
}).join("\n")}\n\`\`\`\n\n`;
|
|
29
|
+
return output;
|
|
30
|
+
}
|
|
31
|
+
function formatRequestInterfaceOutput(event, data) {
|
|
32
|
+
if (!data.method || !data.url) return "";
|
|
33
|
+
return `### HTTP Request\n\n**Method:** ${data.method}\n**URL:** ${data.url}\n\n`;
|
|
34
|
+
}
|
|
35
|
+
function formatContexts(contexts) {
|
|
36
|
+
if (!contexts) return "";
|
|
37
|
+
return `### Additional Context\n\nThese are additional context provided by the user when they're instrumenting their application.\n\n${Object.entries(contexts).map(([name, data]) => `**${name}**\n${Object.entries(data).filter(([key, _]) => key !== "type").map(([key, value]) => {
|
|
38
|
+
return `${key}: ${JSON.stringify(value, void 0, 2)}`;
|
|
39
|
+
}).join("\n")}`).join("\n\n")}\n\n`;
|
|
40
|
+
}
|
|
41
|
+
function formatIssueOutput({ organizationSlug, issue, event, apiService }) {
|
|
42
|
+
let output = `# Issue ${issue.shortId} in **${organizationSlug}**\n\n`;
|
|
43
|
+
output += `**Description**: ${issue.title}\n`;
|
|
44
|
+
output += `**Culprit**: ${issue.culprit}\n`;
|
|
45
|
+
output += `**First Seen**: ${new Date(issue.firstSeen).toISOString()}\n`;
|
|
46
|
+
output += `**Last Seen**: ${new Date(issue.lastSeen).toISOString()}\n`;
|
|
47
|
+
output += `**Occurrences**: ${issue.count}\n`;
|
|
48
|
+
output += `**Users Impacted**: ${issue.userCount}\n`;
|
|
49
|
+
output += `**Status**: ${issue.status}\n`;
|
|
50
|
+
output += `**Platform**: ${issue.platform}\n`;
|
|
51
|
+
output += `**Project**: ${issue.project.name}\n`;
|
|
52
|
+
output += `**URL**: ${apiService.getIssueUrl(organizationSlug, issue.shortId)}\n`;
|
|
53
|
+
output += "\n";
|
|
54
|
+
output += "## Event Details\n\n";
|
|
55
|
+
output += `**Event ID**: ${event.id}\n`;
|
|
56
|
+
if (event.type === "error") output += `**Occurred At**: ${new Date(event.dateCreated).toISOString()}\n`;
|
|
57
|
+
if (event.message) output += `**Message**:\n${event.message}\n`;
|
|
58
|
+
output += "\n";
|
|
59
|
+
output += formatEventOutput(event);
|
|
60
|
+
output += "# Using this information\n\n";
|
|
61
|
+
output += `- You can reference the IssueID in commit messages (e.g. \`Fixes ${issue.shortId}\`) to automatically close the issue when the commit is merged.\n`;
|
|
62
|
+
output += "- The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\n";
|
|
63
|
+
return output;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
//#endregion
|
|
67
|
+
export { formatEventOutput, formatFrameHeader, formatIssueOutput };
|
|
68
|
+
//# sourceMappingURL=formatting-ggD6YRYR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatting-ggD6YRYR.js","names":["frame: z.infer<typeof FrameInterface>","platform: string | undefined | null","event: Event","data: z.infer<typeof ErrorEntrySchema>","data: z.infer<typeof RequestEntrySchema>","contexts: z.infer<typeof EventSchema>[\"contexts\"]"],"sources":["../src/internal/formatting.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { Event, Issue } from \"../api-client/types\";\nimport type {\n ErrorEntrySchema,\n ErrorEventSchema,\n EventSchema,\n FrameInterface,\n RequestEntrySchema,\n SentryApiService,\n} from \"../api-client\";\n\nexport function formatFrameHeader(\n frame: z.infer<typeof FrameInterface>,\n platform: string | undefined | null,\n) {\n if (platform?.startsWith(\"javascript\")) {\n return `${[frame.filename, frame.lineNo, frame.colNo]\n .filter((i) => !!i)\n .join(\":\")}${frame.function ? ` (${frame.function})` : \"\"}`;\n }\n return `${frame.function ? `\"${frame.function}\"` : \"unknown function\"} in \"${frame.filename || frame.module}\"${\n frame.lineNo\n ? ` at line ${frame.lineNo}${frame.colNo !== null ? `:${frame.colNo}` : \"\"}`\n : \"\"\n }`;\n}\n\nexport function formatEventOutput(event: Event) {\n let output = \"\";\n for (const entry of event.entries) {\n if (entry.type === \"exception\") {\n output += formatExceptionInterfaceOutput(\n event,\n entry.data as z.infer<typeof ErrorEntrySchema>,\n );\n }\n if (entry.type === \"request\") {\n output += formatRequestInterfaceOutput(\n event,\n entry.data as z.infer<typeof RequestEntrySchema>,\n );\n }\n }\n output += formatContexts(event.contexts);\n return output;\n}\n\nfunction formatExceptionInterfaceOutput(\n event: Event,\n data: z.infer<typeof ErrorEntrySchema>,\n) {\n let output = \"\";\n // TODO: support chained exceptions\n const firstError = data.value ?? data.values[0];\n if (!firstError) {\n return \"\";\n }\n output += `### Error\\n\\n${\"```\"}\\n${firstError.type}: ${\n firstError.value\n }\\n${\"```\"}\\n\\n`;\n if (!firstError.stacktrace || !firstError.stacktrace.frames) {\n return output;\n }\n output += `**Stacktrace:**\\n${\"```\"}\\n${firstError.stacktrace.frames\n .map((frame) => {\n const context = frame.context?.length\n ? `${frame.context\n .filter(([lineno, _]) => lineno === frame.lineNo)\n .map(([_, code]) => `\\n${code}`)\n .join(\"\")}`\n : \"\";\n\n return `${formatFrameHeader(frame, event.platform)}${context}`;\n })\n .join(\"\\n\")}\\n${\"```\"}\\n\\n`;\n return output;\n}\n\nfunction formatRequestInterfaceOutput(\n event: Event,\n data: z.infer<typeof RequestEntrySchema>,\n) {\n if (!data.method || !data.url) {\n return \"\";\n }\n return `### HTTP Request\\n\\n**Method:** ${data.method}\\n**URL:** ${data.url}\\n\\n`;\n}\n\nfunction formatContexts(contexts: z.infer<typeof EventSchema>[\"contexts\"]) {\n if (!contexts) {\n return \"\";\n }\n return `### Additional Context\\n\\nThese are additional context provided by the user when they're instrumenting their application.\\n\\n${Object.entries(\n contexts,\n )\n .map(\n ([name, data]) =>\n `**${name}**\\n${Object.entries(data)\n .filter(([key, _]) => key !== \"type\")\n .map(([key, value]) => {\n return `${key}: ${JSON.stringify(value, undefined, 2)}`;\n })\n .join(\"\\n\")}`,\n )\n .join(\"\\n\\n\")}\\n\\n`;\n}\n\nexport function formatIssueOutput({\n organizationSlug,\n issue,\n event,\n apiService,\n}: {\n organizationSlug: string;\n issue: Issue;\n event: Event;\n apiService: SentryApiService;\n}) {\n let output = `# Issue ${issue.shortId} in **${organizationSlug}**\\n\\n`;\n output += `**Description**: ${issue.title}\\n`;\n output += `**Culprit**: ${issue.culprit}\\n`;\n output += `**First Seen**: ${new Date(issue.firstSeen).toISOString()}\\n`;\n output += `**Last Seen**: ${new Date(issue.lastSeen).toISOString()}\\n`;\n output += `**Occurrences**: ${issue.count}\\n`;\n output += `**Users Impacted**: ${issue.userCount}\\n`;\n output += `**Status**: ${issue.status}\\n`;\n output += `**Platform**: ${issue.platform}\\n`;\n output += `**Project**: ${issue.project.name}\\n`;\n output += `**URL**: ${apiService.getIssueUrl(organizationSlug, issue.shortId)}\\n`;\n output += \"\\n\";\n output += \"## Event Details\\n\\n\";\n output += `**Event ID**: ${event.id}\\n`;\n if (event.type === \"error\") {\n output += `**Occurred At**: ${new Date((event as z.infer<typeof ErrorEventSchema>).dateCreated).toISOString()}\\n`;\n }\n if (event.message) {\n output += `**Message**:\\n${event.message}\\n`;\n }\n output += \"\\n\";\n output += formatEventOutput(event);\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the IssueID in commit messages (e.g. \\`Fixes ${issue.shortId}\\`) to automatically close the issue when the commit is merged.\\n`;\n output +=\n \"- The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\\n\";\n return output;\n}\n"],"mappings":"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"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
3
|
const require_chunk = require('./chunk-BtT13l48.cjs');
|
|
4
|
-
require('./schema-
|
|
5
|
-
require('./client-
|
|
4
|
+
require('./schema-3VLYcf4D.cjs');
|
|
5
|
+
require('./client-B4Ux5Zdg.cjs');
|
|
6
6
|
require('./types-o3zWarRp.cjs');
|
|
7
7
|
require('./api-client-CEBuz3Zu.cjs');
|
|
8
|
-
require('./formatting-
|
|
8
|
+
require('./formatting-B0SJqiqX.cjs');
|
|
9
9
|
require('./issue-helpers-DbsECZFq.cjs');
|
|
10
10
|
require('./logging-BEMgC5SA.cjs');
|
|
11
|
-
require('./tools-
|
|
12
|
-
require('./schema-
|
|
13
|
-
require('./toolDefinitions-
|
|
11
|
+
require('./tools-BdkmyaZo.cjs');
|
|
12
|
+
require('./schema-jk88gqOu.cjs');
|
|
13
|
+
require('./toolDefinitions-DIhvw3vk.cjs');
|
|
14
14
|
require('./resources-BAE7VVZZ.cjs');
|
|
15
|
-
require('./promptDefinitions-
|
|
15
|
+
require('./promptDefinitions-pHRpPOpJ.cjs');
|
|
16
16
|
require('./prompts-nfFU-zY-.cjs');
|
|
17
|
-
require('./server-
|
|
18
|
-
const require_stdio = require('./stdio-
|
|
19
|
-
const require_version = require('./version-
|
|
17
|
+
require('./server-VwFSUPQn.cjs');
|
|
18
|
+
const require_stdio = require('./stdio-65sYKLOk.cjs');
|
|
19
|
+
const require_version = require('./version-CDnh7DyW.cjs');
|
|
20
20
|
const __modelcontextprotocol_sdk_server_mcp_js = require_chunk.__toESM(require("@modelcontextprotocol/sdk/server/mcp.js"));
|
|
21
21
|
const __sentry_node = require_chunk.__toESM(require("@sentry/node"));
|
|
22
22
|
|
|
23
23
|
//#region src/index.ts
|
|
24
|
-
let accessToken = process.env.SENTRY_AUTH_TOKEN;
|
|
24
|
+
let accessToken = process.env.SENTRY_ACCESS_TOKEN ?? process.env.SENTRY_AUTH_TOKEN;
|
|
25
25
|
let host = process.env.SENTRY_HOST;
|
|
26
26
|
let sentryDsn = process.env.SENTRY_DSN || "https://d0805acebb937435abcb5958da99cdab@o1.ingest.us.sentry.io/4509062593708032";
|
|
27
27
|
const packageName = "@sentry/mcp-server";
|
|
@@ -43,7 +43,7 @@ for (const arg of process.argv.slice(2)) {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
if (!accessToken) {
|
|
46
|
-
console.error("Error: No access token was provided. Pass one with `--access-token` or via `
|
|
46
|
+
console.error("Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.");
|
|
47
47
|
console.error(getUsage());
|
|
48
48
|
process.exit(1);
|
|
49
49
|
}
|
|
@@ -56,7 +56,7 @@ __sentry_node.init({
|
|
|
56
56
|
"mcp.transport": "stdio",
|
|
57
57
|
"sentry.host": host
|
|
58
58
|
} },
|
|
59
|
-
release: "0.
|
|
59
|
+
release: "0.10.0",
|
|
60
60
|
integrations: [__sentry_node.consoleLoggingIntegration(), __sentry_node.zodErrorsIntegration()],
|
|
61
61
|
environment: "stdio"
|
|
62
62
|
});
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["accessToken: string | undefined","host: string | undefined","sentryDsn: string | undefined","LIB_VERSION","McpServer"],"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { startStdio } from \"./transports/stdio\";\nimport * as Sentry from \"@sentry/node\";\nimport { LIB_VERSION } from \"./version\";\n\nlet accessToken: string | undefined
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["accessToken: string | undefined","host: string | undefined","sentryDsn: string | undefined","LIB_VERSION","McpServer"],"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { startStdio } from \"./transports/stdio\";\nimport * as Sentry from \"@sentry/node\";\nimport { LIB_VERSION } from \"./version\";\n\n// SENTRY_AUTH_TOKEN is deprecated, but we support it for backwards compatibility\nlet accessToken: string | undefined =\n process.env.SENTRY_ACCESS_TOKEN ?? process.env.SENTRY_AUTH_TOKEN;\nlet host: string | undefined = process.env.SENTRY_HOST;\nlet sentryDsn: string | undefined =\n process.env.SENTRY_DSN || process.env.DEFAULT_SENTRY_DSN;\n\nconst packageName = \"@sentry/mcp-server\";\n\nfunction getUsage() {\n return `Usage: ${packageName} --access-token=<token> [--host=<host>] [--sentry-dsn=<dsn>]`;\n}\n\nfor (const arg of process.argv.slice(2)) {\n if (arg === \"--version\" || arg === \"-v\") {\n console.log(`${packageName} ${LIB_VERSION}`);\n process.exit(0);\n }\n if (arg.startsWith(\"--access-token=\")) {\n accessToken = arg.split(\"=\")[1];\n } else if (arg.startsWith(\"--host=\")) {\n host = arg.split(\"=\")[1];\n } else if (arg.startsWith(\"--sentry-dsn=\")) {\n sentryDsn = arg.split(\"=\")[1];\n } else {\n console.error(\"Error: Invalid argument:\", arg);\n console.error(getUsage());\n process.exit(1);\n }\n}\n\nif (!accessToken) {\n console.error(\n \"Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.\",\n );\n console.error(getUsage());\n process.exit(1);\n}\n\nSentry.init({\n dsn: sentryDsn,\n sendDefaultPii: true,\n tracesSampleRate: 1,\n initialScope: {\n tags: {\n \"mcp.server_version\": LIB_VERSION,\n \"mcp.transport\": \"stdio\",\n \"sentry.host\": host,\n },\n },\n release: process.env.SENTRY_RELEASE,\n integrations: [\n Sentry.consoleLoggingIntegration(),\n Sentry.zodErrorsIntegration(),\n ],\n environment:\n process.env.SENTRY_ENVIRONMENT ??\n (process.env.NODE_ENV !== \"production\" ? \"development\" : \"production\"),\n});\n\nconst server = new McpServer({\n name: \"Sentry MCP\",\n version: LIB_VERSION,\n});\n\nconst instrumentedServer = Sentry.wrapMcpServerWithSentry(server);\n\nconst SENTRY_TIMEOUT = 5000; // 5 seconds\n\n// XXX: we could do what we're doing in routes/auth.ts and pass the context\n// identically, but we don't really need userId and userName yet\nstartStdio(instrumentedServer, {\n accessToken,\n organizationSlug: null,\n host,\n}).catch((err) => {\n console.error(\"Server error:\", err);\n // ensure we've flushed all events\n Sentry.flush(SENTRY_TIMEOUT);\n process.exit(1);\n});\n\n// ensure we've flushed all events\nSentry.flush(SENTRY_TIMEOUT);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAQA,IAAIA,cACF,QAAQ,IAAI,uBAAuB,QAAQ,IAAI;AACjD,IAAIC,OAA2B,QAAQ,IAAI;AAC3C,IAAIC,YACF,QAAQ,IAAI;AAEd,MAAM,cAAc;AAEpB,SAAS,WAAW;AAClB,SAAQ,SAAS,YAAY;AAC9B;AAED,KAAK,MAAM,OAAO,QAAQ,KAAK,MAAM,EAAE,EAAE;AACvC,KAAI,QAAQ,eAAe,QAAQ,MAAM;AACvC,UAAQ,KAAK,EAAE,YAAY,GAAGC,4BAAY,EAAE;AAC5C,UAAQ,KAAK,EAAE;CAChB;AACD,KAAI,IAAI,WAAW,kBAAkB,CACnC,eAAc,IAAI,MAAM,IAAI,CAAC;UACpB,IAAI,WAAW,UAAU,CAClC,QAAO,IAAI,MAAM,IAAI,CAAC;UACb,IAAI,WAAW,gBAAgB,CACxC,aAAY,IAAI,MAAM,IAAI,CAAC;MACtB;AACL,UAAQ,MAAM,4BAA4B,IAAI;AAC9C,UAAQ,MAAM,UAAU,CAAC;AACzB,UAAQ,KAAK,EAAE;CAChB;AACF;AAED,KAAK,aAAa;AAChB,SAAQ,MACN,oGACD;AACD,SAAQ,MAAM,UAAU,CAAC;AACzB,SAAQ,KAAK,EAAE;AAChB;AAED,cAAO,KAAK;CACV,KAAK;CACL,gBAAgB;CAChB,kBAAkB;CAClB,cAAc,EACZ,MAAM;EACJ,sBAAsBA;EACtB,iBAAiB;EACjB,eAAe;CAChB,EACF;CACD;CACA,cAAc,CACZ,cAAO,2BAA2B,EAClC,cAAO,sBAAsB,AAC9B;CACD;AAGD,EAAC;AAEF,MAAM,SAAS,IAAIC,mDAAU;CAC3B,MAAM;CACN,SAASD;AACV;AAED,MAAM,qBAAqB,cAAO,wBAAwB,OAAO;AAEjE,MAAM,iBAAiB;AAIvB,yBAAW,oBAAoB;CAC7B;CACA,kBAAkB;CAClB;AACD,EAAC,CAAC,MAAM,CAAC,QAAQ;AAChB,SAAQ,MAAM,iBAAiB,IAAI;AAEnC,eAAO,MAAM,eAAe;AAC5B,SAAQ,KAAK,EAAE;AAChB,EAAC;AAGF,cAAO,MAAM,eAAe"}
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "./schema-
|
|
3
|
-
import "./client-
|
|
2
|
+
import "./schema-Dltbjui7.js";
|
|
3
|
+
import "./client-Bz_PNC8o.js";
|
|
4
4
|
import "./types-H-TSmRpm.js";
|
|
5
5
|
import "./api-client-9mzrj2HY.js";
|
|
6
|
-
import "./formatting-
|
|
6
|
+
import "./formatting-ggD6YRYR.js";
|
|
7
7
|
import "./issue-helpers-CyoHu5j4.js";
|
|
8
8
|
import "./logging-Cxm8lQvg.js";
|
|
9
|
-
import "./tools-
|
|
10
|
-
import "./schema-
|
|
11
|
-
import "./toolDefinitions-
|
|
9
|
+
import "./tools-CMFpMPpD.js";
|
|
10
|
+
import "./schema-BKa41TQ4.js";
|
|
11
|
+
import "./toolDefinitions-Bb_1ejkl.js";
|
|
12
12
|
import "./resources-OM3EAnnj.js";
|
|
13
|
-
import "./promptDefinitions-
|
|
13
|
+
import "./promptDefinitions-DBNOeSg-.js";
|
|
14
14
|
import "./prompts-DgWOD2rU.js";
|
|
15
|
-
import "./server-
|
|
16
|
-
import { startStdio } from "./stdio-
|
|
17
|
-
import { LIB_VERSION } from "./version-
|
|
15
|
+
import "./server-yb4PkNyo.js";
|
|
16
|
+
import { startStdio } from "./stdio-DkU2-spy.js";
|
|
17
|
+
import { LIB_VERSION } from "./version-TjO7fHpC.js";
|
|
18
18
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
19
19
|
import * as Sentry from "@sentry/node";
|
|
20
20
|
|
|
21
21
|
//#region src/index.ts
|
|
22
|
-
let accessToken = process.env.SENTRY_AUTH_TOKEN;
|
|
22
|
+
let accessToken = process.env.SENTRY_ACCESS_TOKEN ?? process.env.SENTRY_AUTH_TOKEN;
|
|
23
23
|
let host = process.env.SENTRY_HOST;
|
|
24
24
|
let sentryDsn = process.env.SENTRY_DSN || "https://d0805acebb937435abcb5958da99cdab@o1.ingest.us.sentry.io/4509062593708032";
|
|
25
25
|
const packageName = "@sentry/mcp-server";
|
|
@@ -41,7 +41,7 @@ for (const arg of process.argv.slice(2)) {
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
if (!accessToken) {
|
|
44
|
-
console.error("Error: No access token was provided. Pass one with `--access-token` or via `
|
|
44
|
+
console.error("Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.");
|
|
45
45
|
console.error(getUsage());
|
|
46
46
|
process.exit(1);
|
|
47
47
|
}
|
|
@@ -54,7 +54,7 @@ Sentry.init({
|
|
|
54
54
|
"mcp.transport": "stdio",
|
|
55
55
|
"sentry.host": host
|
|
56
56
|
} },
|
|
57
|
-
release: "0.
|
|
57
|
+
release: "0.10.0",
|
|
58
58
|
integrations: [Sentry.consoleLoggingIntegration(), Sentry.zodErrorsIntegration()],
|
|
59
59
|
environment: "stdio"
|
|
60
60
|
});
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["accessToken: string | undefined","host: string | undefined","sentryDsn: string | undefined"],"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { startStdio } from \"./transports/stdio\";\nimport * as Sentry from \"@sentry/node\";\nimport { LIB_VERSION } from \"./version\";\n\nlet accessToken: string | undefined
|
|
1
|
+
{"version":3,"file":"index.js","names":["accessToken: string | undefined","host: string | undefined","sentryDsn: string | undefined"],"sources":["../src/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport { startStdio } from \"./transports/stdio\";\nimport * as Sentry from \"@sentry/node\";\nimport { LIB_VERSION } from \"./version\";\n\n// SENTRY_AUTH_TOKEN is deprecated, but we support it for backwards compatibility\nlet accessToken: string | undefined =\n process.env.SENTRY_ACCESS_TOKEN ?? process.env.SENTRY_AUTH_TOKEN;\nlet host: string | undefined = process.env.SENTRY_HOST;\nlet sentryDsn: string | undefined =\n process.env.SENTRY_DSN || process.env.DEFAULT_SENTRY_DSN;\n\nconst packageName = \"@sentry/mcp-server\";\n\nfunction getUsage() {\n return `Usage: ${packageName} --access-token=<token> [--host=<host>] [--sentry-dsn=<dsn>]`;\n}\n\nfor (const arg of process.argv.slice(2)) {\n if (arg === \"--version\" || arg === \"-v\") {\n console.log(`${packageName} ${LIB_VERSION}`);\n process.exit(0);\n }\n if (arg.startsWith(\"--access-token=\")) {\n accessToken = arg.split(\"=\")[1];\n } else if (arg.startsWith(\"--host=\")) {\n host = arg.split(\"=\")[1];\n } else if (arg.startsWith(\"--sentry-dsn=\")) {\n sentryDsn = arg.split(\"=\")[1];\n } else {\n console.error(\"Error: Invalid argument:\", arg);\n console.error(getUsage());\n process.exit(1);\n }\n}\n\nif (!accessToken) {\n console.error(\n \"Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.\",\n );\n console.error(getUsage());\n process.exit(1);\n}\n\nSentry.init({\n dsn: sentryDsn,\n sendDefaultPii: true,\n tracesSampleRate: 1,\n initialScope: {\n tags: {\n \"mcp.server_version\": LIB_VERSION,\n \"mcp.transport\": \"stdio\",\n \"sentry.host\": host,\n },\n },\n release: process.env.SENTRY_RELEASE,\n integrations: [\n Sentry.consoleLoggingIntegration(),\n Sentry.zodErrorsIntegration(),\n ],\n environment:\n process.env.SENTRY_ENVIRONMENT ??\n (process.env.NODE_ENV !== \"production\" ? \"development\" : \"production\"),\n});\n\nconst server = new McpServer({\n name: \"Sentry MCP\",\n version: LIB_VERSION,\n});\n\nconst instrumentedServer = Sentry.wrapMcpServerWithSentry(server);\n\nconst SENTRY_TIMEOUT = 5000; // 5 seconds\n\n// XXX: we could do what we're doing in routes/auth.ts and pass the context\n// identically, but we don't really need userId and userName yet\nstartStdio(instrumentedServer, {\n accessToken,\n organizationSlug: null,\n host,\n}).catch((err) => {\n console.error(\"Server error:\", err);\n // ensure we've flushed all events\n Sentry.flush(SENTRY_TIMEOUT);\n process.exit(1);\n});\n\n// ensure we've flushed all events\nSentry.flush(SENTRY_TIMEOUT);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAQA,IAAIA,cACF,QAAQ,IAAI,uBAAuB,QAAQ,IAAI;AACjD,IAAIC,OAA2B,QAAQ,IAAI;AAC3C,IAAIC,YACF,QAAQ,IAAI;AAEd,MAAM,cAAc;AAEpB,SAAS,WAAW;AAClB,SAAQ,SAAS,YAAY;AAC9B;AAED,KAAK,MAAM,OAAO,QAAQ,KAAK,MAAM,EAAE,EAAE;AACvC,KAAI,QAAQ,eAAe,QAAQ,MAAM;AACvC,UAAQ,KAAK,EAAE,YAAY,GAAG,YAAY,EAAE;AAC5C,UAAQ,KAAK,EAAE;CAChB;AACD,KAAI,IAAI,WAAW,kBAAkB,CACnC,eAAc,IAAI,MAAM,IAAI,CAAC;UACpB,IAAI,WAAW,UAAU,CAClC,QAAO,IAAI,MAAM,IAAI,CAAC;UACb,IAAI,WAAW,gBAAgB,CACxC,aAAY,IAAI,MAAM,IAAI,CAAC;MACtB;AACL,UAAQ,MAAM,4BAA4B,IAAI;AAC9C,UAAQ,MAAM,UAAU,CAAC;AACzB,UAAQ,KAAK,EAAE;CAChB;AACF;AAED,KAAK,aAAa;AAChB,SAAQ,MACN,oGACD;AACD,SAAQ,MAAM,UAAU,CAAC;AACzB,SAAQ,KAAK,EAAE;AAChB;AAED,OAAO,KAAK;CACV,KAAK;CACL,gBAAgB;CAChB,kBAAkB;CAClB,cAAc,EACZ,MAAM;EACJ,sBAAsB;EACtB,iBAAiB;EACjB,eAAe;CAChB,EACF;CACD;CACA,cAAc,CACZ,OAAO,2BAA2B,EAClC,OAAO,sBAAsB,AAC9B;CACD;AAGD,EAAC;AAEF,MAAM,SAAS,IAAI,UAAU;CAC3B,MAAM;CACN,SAAS;AACV;AAED,MAAM,qBAAqB,OAAO,wBAAwB,OAAO;AAEjE,MAAM,iBAAiB;AAIvB,WAAW,oBAAoB;CAC7B;CACA,kBAAkB;CAClB;AACD,EAAC,CAAC,MAAM,CAAC,QAAQ;AAChB,SAAQ,MAAM,iBAAiB,IAAI;AAEnC,QAAO,MAAM,eAAe;AAC5B,SAAQ,KAAK,EAAE;AAChB,EAAC;AAGF,OAAO,MAAM,eAAe"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FrameInterface } from "../schema-
|
|
2
|
-
import { Event, Issue } from "../types-
|
|
3
|
-
import { SentryApiService } from "../client-
|
|
1
|
+
import { FrameInterface } from "../schema-PvgLrC1b.cjs";
|
|
2
|
+
import { Event, Issue } from "../types-B03G337q.cjs";
|
|
3
|
+
import { SentryApiService } from "../client-tE6FD__9.cjs";
|
|
4
4
|
import "../index-BPSCxsMC.cjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.cts","names":[],"sources":["../../src/internal/formatting.ts"],"sourcesContent":null,"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"formatting.d.cts","names":[],"sources":["../../src/internal/formatting.ts"],"sourcesContent":null,"mappings":";;;;;;;iBAWgB,iBAAA,QACP,CAAA,CAAE,aAAa;iBAeR,iBAAA,QAAyB;iBAgFzB,iBAAA;;;;;;;EAhGA,KAAA,EAuGP,KAvGO;EAAiB,KAAA,EAwGxB,KAxGwB;EAAA,UACT,EAwGV,gBAxGU;CAAc,CAAA,EAAA,MAA3B;;;AAAK"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FrameInterface$1 as FrameInterface } from "../schema-
|
|
2
|
-
import { Event, Issue } from "../types-
|
|
3
|
-
import { SentryApiService$1 as SentryApiService } from "../client-
|
|
1
|
+
import { FrameInterface$1 as FrameInterface } from "../schema-B7A-FyIi.js";
|
|
2
|
+
import { Event, Issue } from "../types-CN4NEway.js";
|
|
3
|
+
import { SentryApiService$1 as SentryApiService } from "../client-J6VSRmQS.js";
|
|
4
4
|
import "../index-h64gcVNJ.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","names":[],"sources":["../../src/internal/formatting.ts"],"sourcesContent":null,"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","names":[],"sources":["../../src/internal/formatting.ts"],"sourcesContent":null,"mappings":";;;;;;;iBAWgB,iBAAA,QACP,CAAA,CAAE,aAAa;iBAeR,iBAAA,QAAyB;iBAgFzB,iBAAA;;;;;;;EAhGA,KAAA,EAuGP,KAvGO;EAAiB,KAAA,EAwGxB,KAxGwB;EAAA,UACT,EAwGV,gBAxGU;CAAc,CAAA,EAAA,MAA3B;;;AAAK"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { formatEventOutput, formatFrameHeader, formatIssueOutput } from "../formatting-
|
|
1
|
+
import { formatEventOutput, formatFrameHeader, formatIssueOutput } from "../formatting-ggD6YRYR.js";
|
|
2
2
|
|
|
3
3
|
export { formatEventOutput, formatFrameHeader, formatIssueOutput };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_issue_helpers = require('../issue-helpers-DbsECZFq.cjs');
|
|
3
3
|
const require_dist = require('../dist-wiyJYfAH.cjs');
|
|
4
|
-
const require_vi_ClIskdbk = require('../vi.ClIskdbk-
|
|
4
|
+
const require_vi_ClIskdbk = require('../vi.ClIskdbk-Bs263gvI.cjs');
|
|
5
5
|
|
|
6
6
|
//#region src/internal/issue-helpers.test.ts
|
|
7
7
|
require_dist.describe("extractIssueId", () => {
|
|
@@ -93,9 +93,9 @@ require_dist.describe("parseIssueParams", () => {
|
|
|
93
93
|
require_dist.it("should parse from issueId and organizationSlug", () => {
|
|
94
94
|
require_vi_ClIskdbk.globalExpect(require_issue_helpers.parseIssueParams({
|
|
95
95
|
issueId: "CLOUDFLARE-MCP-41.!",
|
|
96
|
-
organizationSlug: "
|
|
96
|
+
organizationSlug: "sentry-mcp-evals"
|
|
97
97
|
})).toEqual({
|
|
98
|
-
organizationSlug: "
|
|
98
|
+
organizationSlug: "sentry-mcp-evals",
|
|
99
99
|
issueId: "CLOUDFLARE-MCP-41"
|
|
100
100
|
});
|
|
101
101
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue-helpers.test.cjs","names":[],"sources":["../../src/internal/issue-helpers.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport {\n extractIssueId,\n parseIssueId,\n parseIssueParams,\n} from \"./issue-helpers\";\n\ndescribe(\"extractIssueId\", () => {\n it(\"should extract issue ID from a full Sentry URL\", () => {\n expect(\n extractIssueId(\"https://sentry.sentry.io/issues/1234\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"1234\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID from a Sentry URL with organization in path\", () => {\n expect(\n extractIssueId(\"https://sentry.io/sentry/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from URL with organizations path\", () => {\n expect(\n extractIssueId(\"https://sentry.io/organizations/my-org/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"my-org\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from subdomain URL\", () => {\n expect(extractIssueId(\"https://my-team.sentry.io/issues/123\")).toEqual({\n issueId: \"123\",\n organizationSlug: \"my-team\",\n });\n });\n\n it(\"should extract issue ID and org slug from self-hosted Sentry with subdomain\", () => {\n expect(\n extractIssueId(\"https://sentry.mycompany.com/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from self-hosted Sentry with organization path\", () => {\n expect(\n extractIssueId(\"https://mycompany.com/my-team/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"my-team\",\n }\n `);\n });\n\n it(\"should throw error for empty input\", () => {\n expect(() => extractIssueId(\"\")).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n\n it(\"should throw error for invalid URL path\", () => {\n expect(() =>\n extractIssueId(\"https://sentry.sentry.io/projects/123\"),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Path must contain '/issues/{issue_id}']`,\n );\n });\n\n it(\"should throw error for non-numeric issue ID in URL\", () => {\n expect(\n extractIssueId(\"https://sentry.sentry.io/issues/abc\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"abc\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should throw error for non-numeric standalone ID\", () => {\n expect(() => extractIssueId(\"abc\")).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n});\n\ndescribe(\"parseIssueId\", () => {\n it(\"should remove trailing punctuation from issue ID\", () => {\n expect(\n // trailing period and exclamation\n parseIssueId(\"CLOUDFLARE-MCP-41.!\"),\n ).toBe(\"CLOUDFLARE-MCP-41\");\n });\n\n it(\"should not modify a clean issue ID\", () => {\n expect(parseIssueId(\"CLOUDFLARE-MCP-41\")).toBe(\"CLOUDFLARE-MCP-41\");\n });\n\n it(\"should remove special characters except dash and underscore\", () => {\n expect(parseIssueId(\"ID_123-456!@#\")).toBe(\"ID_123-456\");\n });\n});\n\ndescribe(\"parseIssueParams\", () => {\n it(\"should parse from issueUrl\", () => {\n expect(\n parseIssueParams({\n issueUrl: \"https://sentry.io/sentry/issues/123\",\n }),\n ).toEqual({ organizationSlug: \"sentry\", issueId: \"123\" });\n });\n\n it(\"should parse from issueId and organizationSlug\", () => {\n expect(\n parseIssueParams({\n issueId: \"CLOUDFLARE-MCP-41.!\",\n organizationSlug: \"
|
|
1
|
+
{"version":3,"file":"issue-helpers.test.cjs","names":[],"sources":["../../src/internal/issue-helpers.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport {\n extractIssueId,\n parseIssueId,\n parseIssueParams,\n} from \"./issue-helpers\";\n\ndescribe(\"extractIssueId\", () => {\n it(\"should extract issue ID from a full Sentry URL\", () => {\n expect(\n extractIssueId(\"https://sentry.sentry.io/issues/1234\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"1234\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID from a Sentry URL with organization in path\", () => {\n expect(\n extractIssueId(\"https://sentry.io/sentry/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from URL with organizations path\", () => {\n expect(\n extractIssueId(\"https://sentry.io/organizations/my-org/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"my-org\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from subdomain URL\", () => {\n expect(extractIssueId(\"https://my-team.sentry.io/issues/123\")).toEqual({\n issueId: \"123\",\n organizationSlug: \"my-team\",\n });\n });\n\n it(\"should extract issue ID and org slug from self-hosted Sentry with subdomain\", () => {\n expect(\n extractIssueId(\"https://sentry.mycompany.com/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from self-hosted Sentry with organization path\", () => {\n expect(\n extractIssueId(\"https://mycompany.com/my-team/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"my-team\",\n }\n `);\n });\n\n it(\"should throw error for empty input\", () => {\n expect(() => extractIssueId(\"\")).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n\n it(\"should throw error for invalid URL path\", () => {\n expect(() =>\n extractIssueId(\"https://sentry.sentry.io/projects/123\"),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Path must contain '/issues/{issue_id}']`,\n );\n });\n\n it(\"should throw error for non-numeric issue ID in URL\", () => {\n expect(\n extractIssueId(\"https://sentry.sentry.io/issues/abc\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"abc\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should throw error for non-numeric standalone ID\", () => {\n expect(() => extractIssueId(\"abc\")).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n});\n\ndescribe(\"parseIssueId\", () => {\n it(\"should remove trailing punctuation from issue ID\", () => {\n expect(\n // trailing period and exclamation\n parseIssueId(\"CLOUDFLARE-MCP-41.!\"),\n ).toBe(\"CLOUDFLARE-MCP-41\");\n });\n\n it(\"should not modify a clean issue ID\", () => {\n expect(parseIssueId(\"CLOUDFLARE-MCP-41\")).toBe(\"CLOUDFLARE-MCP-41\");\n });\n\n it(\"should remove special characters except dash and underscore\", () => {\n expect(parseIssueId(\"ID_123-456!@#\")).toBe(\"ID_123-456\");\n });\n});\n\ndescribe(\"parseIssueParams\", () => {\n it(\"should parse from issueUrl\", () => {\n expect(\n parseIssueParams({\n issueUrl: \"https://sentry.io/sentry/issues/123\",\n }),\n ).toEqual({ organizationSlug: \"sentry\", issueId: \"123\" });\n });\n\n it(\"should parse from issueId and organizationSlug\", () => {\n expect(\n parseIssueParams({\n issueId: \"CLOUDFLARE-MCP-41.!\",\n organizationSlug: \"sentry-mcp-evals\",\n }),\n ).toEqual({\n organizationSlug: \"sentry-mcp-evals\",\n issueId: \"CLOUDFLARE-MCP-41\",\n });\n });\n\n it(\"should throw if neither issueId nor issueUrl is provided\", () => {\n expect(() =>\n parseIssueParams({ organizationSlug: \"foo\" }),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Either issueId or issueUrl must be provided]`,\n );\n });\n\n it(\"should throw if organizationSlug is missing and no issueUrl\", () => {\n expect(() =>\n parseIssueParams({ issueId: \"123\" }),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Organization slug is required]`,\n );\n });\n\n it(\"should throw if issueUrl is invalid\", () => {\n expect(() =>\n parseIssueParams({ issueUrl: \"not-a-url\" }),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n});\n"],"mappings":";;;;;;AAOA,sBAAS,kBAAkB,MAAM;AAC/B,iBAAG,kDAAkD,MAAM;AACzD,mCACE,qCAAe,uCAAuC,CACvD,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,iBAAG,uEAAuE,MAAM;AAC9E,mCACE,qCAAe,sCAAsC,CACtD,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,iBAAG,yEAAyE,MAAM;AAChF,mCACE,qCAAe,oDAAoD,CACpE,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,iBAAG,2DAA2D,MAAM;AAClE,mCAAO,qCAAe,uCAAuC,CAAC,CAAC,QAAQ;GACrE,SAAS;GACT,kBAAkB;EACnB,EAAC;CACH,EAAC;AAEF,iBAAG,+EAA+E,MAAM;AACtF,mCACE,qCAAe,0CAA0C,CAC1D,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,iBAAG,uFAAuF,MAAM;AAC9F,mCACE,qCAAe,2CAA2C,CAC3D,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,iBAAG,sCAAsC,MAAM;AAC7C,mCAAO,MAAM,qCAAe,GAAG,CAAC,CAAC,oCAC9B,wEACF;CACF,EAAC;AAEF,iBAAG,2CAA2C,MAAM;AAClD,mCAAO,MACL,qCAAe,wCAAwC,CACxD,CAAC,oCACC,2EACF;CACF,EAAC;AAEF,iBAAG,sDAAsD,MAAM;AAC7D,mCACE,qCAAe,sCAAsC,CACtD,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,iBAAG,oDAAoD,MAAM;AAC3D,mCAAO,MAAM,qCAAe,MAAM,CAAC,CAAC,oCACjC,wEACF;CACF,EAAC;AACH,EAAC;AAEF,sBAAS,gBAAgB,MAAM;AAC7B,iBAAG,oDAAoD,MAAM;AAC3D;;GAEE,mCAAa,sBAAsB;CACpC,CAAC,KAAK,oBAAoB;CAC5B,EAAC;AAEF,iBAAG,sCAAsC,MAAM;AAC7C,mCAAO,mCAAa,oBAAoB,CAAC,CAAC,KAAK,oBAAoB;CACpE,EAAC;AAEF,iBAAG,+DAA+D,MAAM;AACtE,mCAAO,mCAAa,gBAAgB,CAAC,CAAC,KAAK,aAAa;CACzD,EAAC;AACH,EAAC;AAEF,sBAAS,oBAAoB,MAAM;AACjC,iBAAG,8BAA8B,MAAM;AACrC,mCACE,uCAAiB,EACf,UAAU,sCACX,EAAC,CACH,CAAC,QAAQ;GAAE,kBAAkB;GAAU,SAAS;EAAO,EAAC;CAC1D,EAAC;AAEF,iBAAG,kDAAkD,MAAM;AACzD,mCACE,uCAAiB;GACf,SAAS;GACT,kBAAkB;EACnB,EAAC,CACH,CAAC,QAAQ;GACR,kBAAkB;GAClB,SAAS;EACV,EAAC;CACH,EAAC;AAEF,iBAAG,4DAA4D,MAAM;AACnE,mCAAO,MACL,uCAAiB,EAAE,kBAAkB,MAAO,EAAC,CAC9C,CAAC,oCACC,sDACF;CACF,EAAC;AAEF,iBAAG,+DAA+D,MAAM;AACtE,mCAAO,MACL,uCAAiB,EAAE,SAAS,MAAO,EAAC,CACrC,CAAC,oCACC,wCACF;CACF,EAAC;AAEF,iBAAG,uCAAuC,MAAM;AAC9C,mCAAO,MACL,uCAAiB,EAAE,UAAU,YAAa,EAAC,CAC5C,CAAC,oCACC,wEACF;CACF,EAAC;AACH,EAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { extractIssueId, parseIssueId, parseIssueParams } from "../issue-helpers-CyoHu5j4.js";
|
|
2
2
|
import { describe, it } from "../dist-BKh-M1A1.js";
|
|
3
|
-
import { globalExpect } from "../vi.ClIskdbk-
|
|
3
|
+
import { globalExpect } from "../vi.ClIskdbk-De9q3829.js";
|
|
4
4
|
|
|
5
5
|
//#region src/internal/issue-helpers.test.ts
|
|
6
6
|
describe("extractIssueId", () => {
|
|
@@ -92,9 +92,9 @@ describe("parseIssueParams", () => {
|
|
|
92
92
|
it("should parse from issueId and organizationSlug", () => {
|
|
93
93
|
globalExpect(parseIssueParams({
|
|
94
94
|
issueId: "CLOUDFLARE-MCP-41.!",
|
|
95
|
-
organizationSlug: "
|
|
95
|
+
organizationSlug: "sentry-mcp-evals"
|
|
96
96
|
})).toEqual({
|
|
97
|
-
organizationSlug: "
|
|
97
|
+
organizationSlug: "sentry-mcp-evals",
|
|
98
98
|
issueId: "CLOUDFLARE-MCP-41"
|
|
99
99
|
});
|
|
100
100
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue-helpers.test.js","names":[],"sources":["../../src/internal/issue-helpers.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport {\n extractIssueId,\n parseIssueId,\n parseIssueParams,\n} from \"./issue-helpers\";\n\ndescribe(\"extractIssueId\", () => {\n it(\"should extract issue ID from a full Sentry URL\", () => {\n expect(\n extractIssueId(\"https://sentry.sentry.io/issues/1234\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"1234\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID from a Sentry URL with organization in path\", () => {\n expect(\n extractIssueId(\"https://sentry.io/sentry/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from URL with organizations path\", () => {\n expect(\n extractIssueId(\"https://sentry.io/organizations/my-org/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"my-org\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from subdomain URL\", () => {\n expect(extractIssueId(\"https://my-team.sentry.io/issues/123\")).toEqual({\n issueId: \"123\",\n organizationSlug: \"my-team\",\n });\n });\n\n it(\"should extract issue ID and org slug from self-hosted Sentry with subdomain\", () => {\n expect(\n extractIssueId(\"https://sentry.mycompany.com/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from self-hosted Sentry with organization path\", () => {\n expect(\n extractIssueId(\"https://mycompany.com/my-team/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"my-team\",\n }\n `);\n });\n\n it(\"should throw error for empty input\", () => {\n expect(() => extractIssueId(\"\")).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n\n it(\"should throw error for invalid URL path\", () => {\n expect(() =>\n extractIssueId(\"https://sentry.sentry.io/projects/123\"),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Path must contain '/issues/{issue_id}']`,\n );\n });\n\n it(\"should throw error for non-numeric issue ID in URL\", () => {\n expect(\n extractIssueId(\"https://sentry.sentry.io/issues/abc\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"abc\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should throw error for non-numeric standalone ID\", () => {\n expect(() => extractIssueId(\"abc\")).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n});\n\ndescribe(\"parseIssueId\", () => {\n it(\"should remove trailing punctuation from issue ID\", () => {\n expect(\n // trailing period and exclamation\n parseIssueId(\"CLOUDFLARE-MCP-41.!\"),\n ).toBe(\"CLOUDFLARE-MCP-41\");\n });\n\n it(\"should not modify a clean issue ID\", () => {\n expect(parseIssueId(\"CLOUDFLARE-MCP-41\")).toBe(\"CLOUDFLARE-MCP-41\");\n });\n\n it(\"should remove special characters except dash and underscore\", () => {\n expect(parseIssueId(\"ID_123-456!@#\")).toBe(\"ID_123-456\");\n });\n});\n\ndescribe(\"parseIssueParams\", () => {\n it(\"should parse from issueUrl\", () => {\n expect(\n parseIssueParams({\n issueUrl: \"https://sentry.io/sentry/issues/123\",\n }),\n ).toEqual({ organizationSlug: \"sentry\", issueId: \"123\" });\n });\n\n it(\"should parse from issueId and organizationSlug\", () => {\n expect(\n parseIssueParams({\n issueId: \"CLOUDFLARE-MCP-41.!\",\n organizationSlug: \"
|
|
1
|
+
{"version":3,"file":"issue-helpers.test.js","names":[],"sources":["../../src/internal/issue-helpers.test.ts"],"sourcesContent":["import { describe, expect, it } from \"vitest\";\nimport {\n extractIssueId,\n parseIssueId,\n parseIssueParams,\n} from \"./issue-helpers\";\n\ndescribe(\"extractIssueId\", () => {\n it(\"should extract issue ID from a full Sentry URL\", () => {\n expect(\n extractIssueId(\"https://sentry.sentry.io/issues/1234\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"1234\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID from a Sentry URL with organization in path\", () => {\n expect(\n extractIssueId(\"https://sentry.io/sentry/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from URL with organizations path\", () => {\n expect(\n extractIssueId(\"https://sentry.io/organizations/my-org/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"my-org\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from subdomain URL\", () => {\n expect(extractIssueId(\"https://my-team.sentry.io/issues/123\")).toEqual({\n issueId: \"123\",\n organizationSlug: \"my-team\",\n });\n });\n\n it(\"should extract issue ID and org slug from self-hosted Sentry with subdomain\", () => {\n expect(\n extractIssueId(\"https://sentry.mycompany.com/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should extract issue ID and org slug from self-hosted Sentry with organization path\", () => {\n expect(\n extractIssueId(\"https://mycompany.com/my-team/issues/123\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"123\",\n \"organizationSlug\": \"my-team\",\n }\n `);\n });\n\n it(\"should throw error for empty input\", () => {\n expect(() => extractIssueId(\"\")).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n\n it(\"should throw error for invalid URL path\", () => {\n expect(() =>\n extractIssueId(\"https://sentry.sentry.io/projects/123\"),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Path must contain '/issues/{issue_id}']`,\n );\n });\n\n it(\"should throw error for non-numeric issue ID in URL\", () => {\n expect(\n extractIssueId(\"https://sentry.sentry.io/issues/abc\"),\n ).toMatchInlineSnapshot(`\n {\n \"issueId\": \"abc\",\n \"organizationSlug\": \"sentry\",\n }\n `);\n });\n\n it(\"should throw error for non-numeric standalone ID\", () => {\n expect(() => extractIssueId(\"abc\")).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n});\n\ndescribe(\"parseIssueId\", () => {\n it(\"should remove trailing punctuation from issue ID\", () => {\n expect(\n // trailing period and exclamation\n parseIssueId(\"CLOUDFLARE-MCP-41.!\"),\n ).toBe(\"CLOUDFLARE-MCP-41\");\n });\n\n it(\"should not modify a clean issue ID\", () => {\n expect(parseIssueId(\"CLOUDFLARE-MCP-41\")).toBe(\"CLOUDFLARE-MCP-41\");\n });\n\n it(\"should remove special characters except dash and underscore\", () => {\n expect(parseIssueId(\"ID_123-456!@#\")).toBe(\"ID_123-456\");\n });\n});\n\ndescribe(\"parseIssueParams\", () => {\n it(\"should parse from issueUrl\", () => {\n expect(\n parseIssueParams({\n issueUrl: \"https://sentry.io/sentry/issues/123\",\n }),\n ).toEqual({ organizationSlug: \"sentry\", issueId: \"123\" });\n });\n\n it(\"should parse from issueId and organizationSlug\", () => {\n expect(\n parseIssueParams({\n issueId: \"CLOUDFLARE-MCP-41.!\",\n organizationSlug: \"sentry-mcp-evals\",\n }),\n ).toEqual({\n organizationSlug: \"sentry-mcp-evals\",\n issueId: \"CLOUDFLARE-MCP-41\",\n });\n });\n\n it(\"should throw if neither issueId nor issueUrl is provided\", () => {\n expect(() =>\n parseIssueParams({ organizationSlug: \"foo\" }),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Either issueId or issueUrl must be provided]`,\n );\n });\n\n it(\"should throw if organizationSlug is missing and no issueUrl\", () => {\n expect(() =>\n parseIssueParams({ issueId: \"123\" }),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Organization slug is required]`,\n );\n });\n\n it(\"should throw if issueUrl is invalid\", () => {\n expect(() =>\n parseIssueParams({ issueUrl: \"not-a-url\" }),\n ).toThrowErrorMatchingInlineSnapshot(\n `[Error: Invalid Sentry issue URL. Must start with http:// or https://]`,\n );\n });\n});\n"],"mappings":";;;;;AAOA,SAAS,kBAAkB,MAAM;AAC/B,IAAG,kDAAkD,MAAM;AACzD,eACE,eAAe,uCAAuC,CACvD,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,IAAG,uEAAuE,MAAM;AAC9E,eACE,eAAe,sCAAsC,CACtD,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,IAAG,yEAAyE,MAAM;AAChF,eACE,eAAe,oDAAoD,CACpE,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,IAAG,2DAA2D,MAAM;AAClE,eAAO,eAAe,uCAAuC,CAAC,CAAC,QAAQ;GACrE,SAAS;GACT,kBAAkB;EACnB,EAAC;CACH,EAAC;AAEF,IAAG,+EAA+E,MAAM;AACtF,eACE,eAAe,0CAA0C,CAC1D,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,IAAG,uFAAuF,MAAM;AAC9F,eACE,eAAe,2CAA2C,CAC3D,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,IAAG,sCAAsC,MAAM;AAC7C,eAAO,MAAM,eAAe,GAAG,CAAC,CAAC,oCAC9B,wEACF;CACF,EAAC;AAEF,IAAG,2CAA2C,MAAM;AAClD,eAAO,MACL,eAAe,wCAAwC,CACxD,CAAC,oCACC,2EACF;CACF,EAAC;AAEF,IAAG,sDAAsD,MAAM;AAC7D,eACE,eAAe,sCAAsC,CACtD,CAAC,uBAAuB;;;;;MAKvB;CACH,EAAC;AAEF,IAAG,oDAAoD,MAAM;AAC3D,eAAO,MAAM,eAAe,MAAM,CAAC,CAAC,oCACjC,wEACF;CACF,EAAC;AACH,EAAC;AAEF,SAAS,gBAAgB,MAAM;AAC7B,IAAG,oDAAoD,MAAM;AAC3D;;GAEE,aAAa,sBAAsB;CACpC,CAAC,KAAK,oBAAoB;CAC5B,EAAC;AAEF,IAAG,sCAAsC,MAAM;AAC7C,eAAO,aAAa,oBAAoB,CAAC,CAAC,KAAK,oBAAoB;CACpE,EAAC;AAEF,IAAG,+DAA+D,MAAM;AACtE,eAAO,aAAa,gBAAgB,CAAC,CAAC,KAAK,aAAa;CACzD,EAAC;AACH,EAAC;AAEF,SAAS,oBAAoB,MAAM;AACjC,IAAG,8BAA8B,MAAM;AACrC,eACE,iBAAiB,EACf,UAAU,sCACX,EAAC,CACH,CAAC,QAAQ;GAAE,kBAAkB;GAAU,SAAS;EAAO,EAAC;CAC1D,EAAC;AAEF,IAAG,kDAAkD,MAAM;AACzD,eACE,iBAAiB;GACf,SAAS;GACT,kBAAkB;EACnB,EAAC,CACH,CAAC,QAAQ;GACR,kBAAkB;GAClB,SAAS;EACV,EAAC;CACH,EAAC;AAEF,IAAG,4DAA4D,MAAM;AACnE,eAAO,MACL,iBAAiB,EAAE,kBAAkB,MAAO,EAAC,CAC9C,CAAC,oCACC,sDACF;CACF,EAAC;AAEF,IAAG,+DAA+D,MAAM;AACtE,eAAO,MACL,iBAAiB,EAAE,SAAS,MAAO,EAAC,CACrC,CAAC,oCACC,wCACF;CACF,EAAC;AAEF,IAAG,uCAAuC,MAAM;AAC9C,eAAO,MACL,iBAAiB,EAAE,UAAU,YAAa,EAAC,CAC5C,CAAC,oCACC,wEACF;CACF,EAAC;AACH,EAAC"}
|
|
@@ -15,12 +15,12 @@ declare const PROMPT_DEFINITIONS: ({
|
|
|
15
15
|
description: string;
|
|
16
16
|
paramsSchema: {
|
|
17
17
|
organizationSlug: z.ZodOptional<z.ZodString>;
|
|
18
|
-
issueId: z.
|
|
19
|
-
issueUrl: z.
|
|
18
|
+
issueId: z.ZodString;
|
|
19
|
+
issueUrl: z.ZodString;
|
|
20
20
|
filename?: undefined;
|
|
21
21
|
};
|
|
22
22
|
})[]; //#endregion
|
|
23
23
|
|
|
24
24
|
//# sourceMappingURL=promptDefinitions.d.ts.map
|
|
25
25
|
export { PROMPT_DEFINITIONS };
|
|
26
|
-
//# sourceMappingURL=promptDefinitions-
|
|
26
|
+
//# sourceMappingURL=promptDefinitions-BR7PxWcH.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptDefinitions-BR7PxWcH.d.cts","names":[],"sources":["../src/promptDefinitions.ts"],"sourcesContent":null,"mappings":";;;cAOa;;EAAA,WAAA,EAAA,MAAA;EAuBZ,YAAA,EAAA;IAAA,gBAAA,EAAA,CAAA,CAAA,SAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ParamOrganizationSlug } from "./schema-
|
|
1
|
+
import { ParamIssueShortId, ParamIssueUrl, ParamOrganizationSlug } from "./schema-BKa41TQ4.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
//#region src/promptDefinitions.ts
|
|
@@ -7,18 +7,18 @@ const PROMPT_DEFINITIONS = [{
|
|
|
7
7
|
description: ["Use this prompt when you need to find errors in Sentry for a given file."].join("\n"),
|
|
8
8
|
paramsSchema: {
|
|
9
9
|
organizationSlug: ParamOrganizationSlug,
|
|
10
|
-
filename: z.string()
|
|
10
|
+
filename: z.string().describe("The filename to search for errors in.")
|
|
11
11
|
}
|
|
12
12
|
}, {
|
|
13
13
|
name: "fix_issue_with_seer",
|
|
14
14
|
description: ["Use this prompt when you need to fix an issue with Seer.", "You can pass in either an `issueId` and `organizationSlug`, or an `issueUrl`."].join("\n"),
|
|
15
15
|
paramsSchema: {
|
|
16
16
|
organizationSlug: ParamOrganizationSlug.optional(),
|
|
17
|
-
issueId:
|
|
18
|
-
issueUrl:
|
|
17
|
+
issueId: ParamIssueShortId,
|
|
18
|
+
issueUrl: ParamIssueUrl
|
|
19
19
|
}
|
|
20
20
|
}];
|
|
21
21
|
|
|
22
22
|
//#endregion
|
|
23
23
|
export { PROMPT_DEFINITIONS };
|
|
24
|
-
//# sourceMappingURL=promptDefinitions-
|
|
24
|
+
//# sourceMappingURL=promptDefinitions-DBNOeSg-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptDefinitions-DBNOeSg-.js","names":[],"sources":["../src/promptDefinitions.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {\n ParamIssueShortId,\n ParamIssueUrl,\n ParamOrganizationSlug,\n} from \"./schema\";\n\nexport const PROMPT_DEFINITIONS = [\n {\n name: \"find_errors_in_file\" as const,\n description: [\n \"Use this prompt when you need to find errors in Sentry for a given file.\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug,\n filename: z.string().describe(\"The filename to search for errors in.\"),\n },\n },\n {\n name: \"fix_issue_with_seer\" as const,\n description: [\n \"Use this prompt when you need to fix an issue with Seer.\",\n \"You can pass in either an `issueId` and `organizationSlug`, or an `issueUrl`.\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n issueId: ParamIssueShortId,\n issueUrl: ParamIssueUrl,\n },\n },\n];\n"],"mappings":";;;;AAOA,MAAa,qBAAqB,CAChC;CACE,MAAM;CACN,aAAa,CACX,0EACD,EAAC,KAAK,KAAK;CACZ,cAAc;EACZ,kBAAkB;EAClB,UAAU,EAAE,QAAQ,CAAC,SAAS,wCAAwC;CACvE;AACF,GACD;CACE,MAAM;CACN,aAAa,CACX,4DACA,+EACD,EAAC,KAAK,KAAK;CACZ,cAAc;EACZ,kBAAkB,sBAAsB,UAAU;EAClD,SAAS;EACT,UAAU;CACX;AACF,CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const require_chunk = require('./chunk-BtT13l48.cjs');
|
|
3
|
-
const require_schema = require('./schema-
|
|
3
|
+
const require_schema = require('./schema-jk88gqOu.cjs');
|
|
4
4
|
const zod = require_chunk.__toESM(require("zod"));
|
|
5
5
|
|
|
6
6
|
//#region src/promptDefinitions.ts
|
|
@@ -9,15 +9,15 @@ const PROMPT_DEFINITIONS = [{
|
|
|
9
9
|
description: ["Use this prompt when you need to find errors in Sentry for a given file."].join("\n"),
|
|
10
10
|
paramsSchema: {
|
|
11
11
|
organizationSlug: require_schema.ParamOrganizationSlug,
|
|
12
|
-
filename: zod.z.string()
|
|
12
|
+
filename: zod.z.string().describe("The filename to search for errors in.")
|
|
13
13
|
}
|
|
14
14
|
}, {
|
|
15
15
|
name: "fix_issue_with_seer",
|
|
16
16
|
description: ["Use this prompt when you need to fix an issue with Seer.", "You can pass in either an `issueId` and `organizationSlug`, or an `issueUrl`."].join("\n"),
|
|
17
17
|
paramsSchema: {
|
|
18
18
|
organizationSlug: require_schema.ParamOrganizationSlug.optional(),
|
|
19
|
-
issueId:
|
|
20
|
-
issueUrl:
|
|
19
|
+
issueId: require_schema.ParamIssueShortId,
|
|
20
|
+
issueUrl: require_schema.ParamIssueUrl
|
|
21
21
|
}
|
|
22
22
|
}];
|
|
23
23
|
|
|
@@ -28,4 +28,4 @@ Object.defineProperty(exports, 'PROMPT_DEFINITIONS', {
|
|
|
28
28
|
return PROMPT_DEFINITIONS;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
//# sourceMappingURL=promptDefinitions-
|
|
31
|
+
//# sourceMappingURL=promptDefinitions-pHRpPOpJ.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptDefinitions-pHRpPOpJ.cjs","names":["ParamOrganizationSlug","ParamIssueShortId","ParamIssueUrl"],"sources":["../src/promptDefinitions.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {\n ParamIssueShortId,\n ParamIssueUrl,\n ParamOrganizationSlug,\n} from \"./schema\";\n\nexport const PROMPT_DEFINITIONS = [\n {\n name: \"find_errors_in_file\" as const,\n description: [\n \"Use this prompt when you need to find errors in Sentry for a given file.\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug,\n filename: z.string().describe(\"The filename to search for errors in.\"),\n },\n },\n {\n name: \"fix_issue_with_seer\" as const,\n description: [\n \"Use this prompt when you need to fix an issue with Seer.\",\n \"You can pass in either an `issueId` and `organizationSlug`, or an `issueUrl`.\",\n ].join(\"\\n\"),\n paramsSchema: {\n organizationSlug: ParamOrganizationSlug.optional(),\n issueId: ParamIssueShortId,\n issueUrl: ParamIssueUrl,\n },\n },\n];\n"],"mappings":";;;;;;AAOA,MAAa,qBAAqB,CAChC;CACE,MAAM;CACN,aAAa,CACX,0EACD,EAAC,KAAK,KAAK;CACZ,cAAc;EACZ,kBAAkBA;EAClB,UAAU,MAAE,QAAQ,CAAC,SAAS,wCAAwC;CACvE;AACF,GACD;CACE,MAAM;CACN,aAAa,CACX,4DACA,+EACD,EAAC,KAAK,KAAK;CACZ,cAAc;EACZ,kBAAkB,qCAAsB,UAAU;EAClD,SAASC;EACT,UAAUC;CACX;AACF,CACF"}
|
|
@@ -15,12 +15,12 @@ declare const PROMPT_DEFINITIONS: ({
|
|
|
15
15
|
description: string;
|
|
16
16
|
paramsSchema: {
|
|
17
17
|
organizationSlug: z.ZodOptional<z.ZodString>;
|
|
18
|
-
issueId: z.
|
|
19
|
-
issueUrl: z.
|
|
18
|
+
issueId: z.ZodString;
|
|
19
|
+
issueUrl: z.ZodString;
|
|
20
20
|
filename?: undefined;
|
|
21
21
|
};
|
|
22
22
|
})[]; //#endregion
|
|
23
23
|
|
|
24
24
|
//# sourceMappingURL=promptDefinitions.d.ts.map
|
|
25
25
|
export { PROMPT_DEFINITIONS as PROMPT_DEFINITIONS$1 };
|
|
26
|
-
//# sourceMappingURL=promptDefinitions-
|
|
26
|
+
//# sourceMappingURL=promptDefinitions-tpKruPny.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptDefinitions-tpKruPny.d.ts","names":[],"sources":["../src/promptDefinitions.ts"],"sourcesContent":null,"mappings":";;;cAOa;;EAAA,WAAA,EAAA,MAAA;EAuBZ,YAAA,EAAA;IAAA,gBAAA,EAAA,CAAA,CAAA,SAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
require('./schema-
|
|
2
|
-
const require_promptDefinitions = require('./promptDefinitions-
|
|
1
|
+
require('./schema-jk88gqOu.cjs');
|
|
2
|
+
const require_promptDefinitions = require('./promptDefinitions-pHRpPOpJ.cjs');
|
|
3
3
|
|
|
4
4
|
exports.PROMPT_DEFINITIONS = require_promptDefinitions.PROMPT_DEFINITIONS
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PROMPT_DEFINITIONS } from "./promptDefinitions-
|
|
1
|
+
import { PROMPT_DEFINITIONS } from "./promptDefinitions-BR7PxWcH.cjs";
|
|
2
2
|
export { PROMPT_DEFINITIONS };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PROMPT_DEFINITIONS$1 as PROMPT_DEFINITIONS } from "./promptDefinitions-
|
|
1
|
+
import { PROMPT_DEFINITIONS$1 as PROMPT_DEFINITIONS } from "./promptDefinitions-tpKruPny.js";
|
|
2
2
|
export { PROMPT_DEFINITIONS };
|
package/dist/prompts.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./promptDefinitions-
|
|
2
|
-
import "./toolDefinitions-
|
|
3
|
-
import { ServerContext } from "./types-
|
|
1
|
+
import "./promptDefinitions-BR7PxWcH.cjs";
|
|
2
|
+
import "./toolDefinitions-B94CNDbt.cjs";
|
|
3
|
+
import { ServerContext } from "./types-OeoNXRm-.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/prompts.d.ts
|
|
6
6
|
declare const PROMPT_HANDLERS: {
|
|
@@ -19,8 +19,8 @@ declare const PROMPT_HANDLERS: {
|
|
|
19
19
|
issueUrl
|
|
20
20
|
}: {
|
|
21
21
|
organizationSlug: string | undefined;
|
|
22
|
-
issueId: string
|
|
23
|
-
issueUrl: string
|
|
22
|
+
issueId: string;
|
|
23
|
+
issueUrl: string;
|
|
24
24
|
filename?: unknown;
|
|
25
25
|
}) => Promise<string>;
|
|
26
26
|
};
|