@sentry/mcp-server 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +2 -2
- package/dist/api-client/client.test.js +2 -2
- 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 +3 -3
- package/dist/api-client/types.d.ts +3 -3
- package/dist/client-4jq_wVgn.d.ts +522 -0
- package/dist/client-4jq_wVgn.d.ts.map +1 -0
- package/dist/client-B7vZ6JMk.cjs +572 -0
- package/dist/client-B7vZ6JMk.cjs.map +1 -0
- package/dist/client-CAoHZbyK.js +561 -0
- package/dist/client-CAoHZbyK.js.map +1 -0
- package/dist/client-DkY0ifZf.d.cts +522 -0
- package/dist/client-DkY0ifZf.d.cts.map +1 -0
- package/dist/formatting-BaARL2gT.js.map +1 -1
- package/dist/formatting-C2kN0ok6.cjs.map +1 -1
- 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.d.cts +4 -3
- package/dist/internal/formatting.d.cts.map +1 -1
- package/dist/internal/formatting.d.ts +4 -3
- package/dist/internal/formatting.d.ts.map +1 -1
- package/dist/internal/issue-helpers.cjs +1 -1
- package/dist/internal/issue-helpers.d.cts +8 -0
- package/dist/internal/issue-helpers.d.cts.map +1 -1
- package/dist/internal/issue-helpers.d.ts +8 -0
- package/dist/internal/issue-helpers.d.ts.map +1 -1
- package/dist/internal/issue-helpers.js +1 -1
- package/dist/internal/issue-helpers.test.cjs +1 -1
- package/dist/internal/issue-helpers.test.js +1 -1
- package/dist/{issue-helpers-CSNNO03f.js → issue-helpers-BMVLc3mR.js} +9 -1
- package/dist/issue-helpers-BMVLc3mR.js.map +1 -0
- package/dist/{issue-helpers-71XgJVXC.cjs → issue-helpers-D712fGT2.cjs} +9 -1
- package/dist/issue-helpers-D712fGT2.cjs.map +1 -0
- package/dist/logging-ByvSjT6V.cjs.map +1 -1
- package/dist/logging-CXLD0FFB.js.map +1 -1
- package/dist/logging.d.cts +30 -1
- package/dist/logging.d.cts.map +1 -1
- package/dist/logging.d.ts +30 -1
- package/dist/logging.d.ts.map +1 -1
- package/dist/{promptDefinitions-D3ll3qCd.cjs → promptDefinitions-BTLIBcGt.cjs} +9 -2
- package/dist/promptDefinitions-BTLIBcGt.cjs.map +1 -0
- package/dist/{promptDefinitions-H0q1_X-K.d.ts → promptDefinitions-CF2VWdQ6.d.cts} +9 -1
- package/dist/promptDefinitions-CF2VWdQ6.d.cts.map +1 -0
- package/dist/{promptDefinitions-DMucOchd.d.cts → promptDefinitions-D5FSQckL.d.ts} +9 -1
- package/dist/promptDefinitions-D5FSQckL.d.ts.map +1 -0
- package/dist/{promptDefinitions-aKmUZWWO.js → promptDefinitions-D8yow1m0.js} +9 -2
- package/dist/promptDefinitions-D8yow1m0.js.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-DMwoay8l.cjs → prompts-CDbQrutV.cjs} +3 -2
- package/dist/prompts-CDbQrutV.cjs.map +1 -0
- package/dist/{prompts-CzD0yl7Z.js → prompts-Dt3A8Qfl.js} +4 -2
- package/dist/prompts-Dt3A8Qfl.js.map +1 -0
- package/dist/prompts.cjs +2 -1
- package/dist/prompts.d.cts +3 -3
- package/dist/prompts.d.cts.map +1 -1
- package/dist/prompts.d.ts +3 -3
- package/dist/prompts.d.ts.map +1 -1
- package/dist/prompts.js +2 -1
- package/dist/{resources-x-GaokG8.js → resources-Bol20Xuo.js} +13 -1
- package/dist/resources-Bol20Xuo.js.map +1 -0
- package/dist/{resources-D6TW2ER0.cjs → resources-DNyoutxH.cjs} +13 -1
- package/dist/resources-DNyoutxH.cjs.map +1 -0
- package/dist/resources.cjs +1 -1
- package/dist/resources.d.cts +9 -0
- package/dist/resources.d.cts.map +1 -1
- package/dist/resources.d.ts +9 -0
- package/dist/resources.d.ts.map +1 -1
- package/dist/resources.js +1 -1
- package/dist/{schema-C-MLkWMc.d.ts → schema-BJv7kREf.d.cts} +178 -66
- package/dist/schema-BJv7kREf.d.cts.map +1 -0
- package/dist/{schema-B8lT632E.cjs → schema-BTfISwFu.cjs} +29 -2
- package/dist/schema-BTfISwFu.cjs.map +1 -0
- package/dist/{schema-DqxkW9Tx.d.cts → schema-BnxGHL_i.d.ts} +178 -66
- package/dist/schema-BnxGHL_i.d.ts.map +1 -0
- package/dist/{schema-DkyWSqp_.cjs → schema-BsvGMALe.cjs} +37 -6
- package/dist/schema-BsvGMALe.cjs.map +1 -0
- package/dist/{schema-CewAKS9A.js → schema-C_hp0BR7.js} +32 -7
- package/dist/schema-C_hp0BR7.js.map +1 -0
- package/dist/schema-Dv6aLZgz.js +32 -0
- package/dist/schema-Dv6aLZgz.js.map +1 -0
- package/dist/schema.cjs +3 -1
- package/dist/schema.d.cts +13 -3
- package/dist/schema.d.cts.map +1 -1
- package/dist/schema.d.ts +13 -3
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +2 -2
- package/dist/{server-qpWdf-ST.js → server-C7cHq_pc.js} +57 -9
- package/dist/server-C7cHq_pc.js.map +1 -0
- package/dist/{server-pGtEIwE3.cjs → server-DeutbO8v.cjs} +57 -9
- package/dist/server-DeutbO8v.cjs.map +1 -0
- package/dist/server.cjs +10 -10
- package/dist/server.d.cts +23 -4
- package/dist/server.d.cts.map +1 -1
- package/dist/server.d.ts +23 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +10 -10
- package/dist/stdio-B73CCTly.cjs +47 -0
- package/dist/stdio-B73CCTly.cjs.map +1 -0
- package/dist/stdio-ZQLC-i5Q.js +41 -0
- package/dist/stdio-ZQLC-i5Q.js.map +1 -0
- package/dist/test-setup.cjs +420 -257
- package/dist/test-setup.cjs.map +1 -1
- package/dist/test-setup.js +420 -257
- package/dist/test-setup.js.map +1 -1
- package/dist/{toolDefinitions-Dp13BpEu.d.cts → toolDefinitions-BOMF-zIC.d.ts} +115 -17
- package/dist/toolDefinitions-BOMF-zIC.d.ts.map +1 -0
- package/dist/{toolDefinitions-BtHN8t_d.cjs → toolDefinitions-CUegGcWU.cjs} +117 -6
- package/dist/toolDefinitions-CUegGcWU.cjs.map +1 -0
- package/dist/{toolDefinitions-BSC2D_S-.js → toolDefinitions-DFAxp3nr.js} +117 -6
- package/dist/toolDefinitions-DFAxp3nr.js.map +1 -0
- package/dist/{toolDefinitions-fQrpWznJ.d.ts → toolDefinitions-Ipvr4Acw.d.cts} +115 -17
- package/dist/toolDefinitions-Ipvr4Acw.d.cts.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-4Rtn4WEf.js → tools-DpiQwSTY.js} +137 -11
- package/dist/tools-DpiQwSTY.js.map +1 -0
- package/dist/{tools-DHHqAqP9.cjs → tools-DyOqlsCW.cjs} +137 -11
- package/dist/tools-DyOqlsCW.cjs.map +1 -0
- package/dist/tools.cjs +4 -4
- package/dist/tools.d.cts +91 -7
- package/dist/tools.d.cts.map +1 -1
- package/dist/tools.d.ts +91 -7
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +4 -4
- package/dist/tools.test.cjs +290 -10
- package/dist/tools.test.cjs.map +1 -1
- package/dist/tools.test.js +290 -10
- package/dist/tools.test.js.map +1 -1
- package/dist/transports/stdio.cjs +11 -11
- package/dist/transports/stdio.d.cts +26 -4
- package/dist/transports/stdio.d.cts.map +1 -1
- package/dist/transports/stdio.d.ts +26 -4
- package/dist/transports/stdio.d.ts.map +1 -1
- package/dist/transports/stdio.js +11 -11
- package/dist/{types-CfJ51LyL.d.ts → types-D5TPcOfv.d.ts} +4 -3
- package/dist/types-D5TPcOfv.d.ts.map +1 -0
- package/dist/{types-CbLyQvVe.d.cts → types-DRF2IoP_.d.cts} +4 -3
- package/dist/types-DRF2IoP_.d.cts.map +1 -0
- package/dist/{types-DuUmV9zh.d.ts → types-Daq2fm0E.d.ts} +5 -3
- package/dist/types-Daq2fm0E.d.ts.map +1 -0
- package/dist/{types-CcffrLXB.d.cts → types-NIQW7KyF.d.cts} +5 -3
- package/dist/types-NIQW7KyF.d.cts.map +1 -0
- package/dist/types.d.cts +3 -3
- package/dist/types.d.ts +3 -3
- package/dist/{version-CRzAHHGZ.cjs → version-BNmubeQI.cjs} +2 -2
- package/dist/{version-CRzAHHGZ.cjs.map → version-BNmubeQI.cjs.map} +1 -1
- package/dist/version-CRto5Sn_.js +6 -0
- package/dist/{version-BT9r_3jm.js.map → version-CRto5Sn_.js.map} +1 -1
- package/dist/version.cjs +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -3
- package/dist/client-Bxf4MxOz.d.cts +0 -179
- package/dist/client-Bxf4MxOz.d.cts.map +0 -1
- package/dist/client-D5xFZtxK.js +0 -224
- package/dist/client-D5xFZtxK.js.map +0 -1
- package/dist/client-DOhBiaMJ.d.ts +0 -179
- package/dist/client-DOhBiaMJ.d.ts.map +0 -1
- package/dist/client-GKHZSXgV.cjs +0 -235
- package/dist/client-GKHZSXgV.cjs.map +0 -1
- package/dist/issue-helpers-71XgJVXC.cjs.map +0 -1
- package/dist/issue-helpers-CSNNO03f.js.map +0 -1
- package/dist/promptDefinitions-D3ll3qCd.cjs.map +0 -1
- package/dist/promptDefinitions-DMucOchd.d.cts.map +0 -1
- package/dist/promptDefinitions-H0q1_X-K.d.ts.map +0 -1
- package/dist/promptDefinitions-aKmUZWWO.js.map +0 -1
- package/dist/prompts-CzD0yl7Z.js.map +0 -1
- package/dist/prompts-DMwoay8l.cjs.map +0 -1
- package/dist/resources-D6TW2ER0.cjs.map +0 -1
- package/dist/resources-x-GaokG8.js.map +0 -1
- package/dist/schema-B8lT632E.cjs.map +0 -1
- package/dist/schema-BkHf97d7.js +0 -17
- package/dist/schema-BkHf97d7.js.map +0 -1
- package/dist/schema-C-MLkWMc.d.ts.map +0 -1
- package/dist/schema-CewAKS9A.js.map +0 -1
- package/dist/schema-DkyWSqp_.cjs.map +0 -1
- package/dist/schema-DqxkW9Tx.d.cts.map +0 -1
- package/dist/server-pGtEIwE3.cjs.map +0 -1
- package/dist/server-qpWdf-ST.js.map +0 -1
- package/dist/stdio-D8u2W847.js +0 -19
- package/dist/stdio-D8u2W847.js.map +0 -1
- package/dist/stdio-DydB2Pxu.cjs +0 -25
- package/dist/stdio-DydB2Pxu.cjs.map +0 -1
- package/dist/toolDefinitions-BSC2D_S-.js.map +0 -1
- package/dist/toolDefinitions-BtHN8t_d.cjs.map +0 -1
- package/dist/toolDefinitions-Dp13BpEu.d.cts.map +0 -1
- package/dist/toolDefinitions-fQrpWznJ.d.ts.map +0 -1
- package/dist/tools-4Rtn4WEf.js.map +0 -1
- package/dist/tools-DHHqAqP9.cjs.map +0 -1
- package/dist/types-CbLyQvVe.d.cts.map +0 -1
- package/dist/types-CcffrLXB.d.cts.map +0 -1
- package/dist/types-CfJ51LyL.d.ts.map +0 -1
- package/dist/types-DuUmV9zh.d.ts.map +0 -1
- package/dist/version-BT9r_3jm.js +0 -6
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "./errors-BJSrT6Ou.js";
|
|
3
|
-
import "./schema-
|
|
4
|
-
import "./client-
|
|
3
|
+
import "./schema-C_hp0BR7.js";
|
|
4
|
+
import "./client-CAoHZbyK.js";
|
|
5
5
|
import "./types-6zHoEWAx.js";
|
|
6
6
|
import "./api-client-CNv_hbPO.js";
|
|
7
7
|
import "./formatting-BaARL2gT.js";
|
|
8
|
-
import "./issue-helpers-
|
|
8
|
+
import "./issue-helpers-BMVLc3mR.js";
|
|
9
9
|
import "./logging-CXLD0FFB.js";
|
|
10
|
-
import "./tools-
|
|
11
|
-
import "./schema-
|
|
12
|
-
import "./toolDefinitions-
|
|
13
|
-
import "./resources-
|
|
14
|
-
import "./promptDefinitions-
|
|
15
|
-
import "./prompts-
|
|
16
|
-
import "./server-
|
|
17
|
-
import { startStdio } from "./stdio-
|
|
18
|
-
import { LIB_VERSION } from "./version-
|
|
10
|
+
import "./tools-DpiQwSTY.js";
|
|
11
|
+
import "./schema-Dv6aLZgz.js";
|
|
12
|
+
import "./toolDefinitions-DFAxp3nr.js";
|
|
13
|
+
import "./resources-Bol20Xuo.js";
|
|
14
|
+
import "./promptDefinitions-D8yow1m0.js";
|
|
15
|
+
import "./prompts-Dt3A8Qfl.js";
|
|
16
|
+
import "./server-C7cHq_pc.js";
|
|
17
|
+
import { startStdio } from "./stdio-ZQLC-i5Q.js";
|
|
18
|
+
import { LIB_VERSION } from "./version-CRto5Sn_.js";
|
|
19
19
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
20
20
|
import * as Sentry from "@sentry/node";
|
|
21
21
|
|
|
@@ -55,7 +55,7 @@ Sentry.init({
|
|
|
55
55
|
"mcp.transport": "stdio",
|
|
56
56
|
"sentry.host": host
|
|
57
57
|
} },
|
|
58
|
-
release: "0.
|
|
58
|
+
release: "0.12.0",
|
|
59
59
|
integrations: [Sentry.consoleLoggingIntegration(), Sentry.zodErrorsIntegration()],
|
|
60
60
|
environment: "stdio"
|
|
61
61
|
});
|
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\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":";;;;;;;;;;;;;;;;;;;;;;
|
|
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\n/**\n * Main CLI entry point for the Sentry MCP server.\n *\n * Handles command-line argument parsing, environment configuration, Sentry\n * initialization, and starts the MCP server with stdio transport. Requires\n * a Sentry access token and optionally accepts host and DSN configuration.\n *\n * @example CLI Usage\n * ```bash\n * npx @sentry/mcp-server --access-token=TOKEN --host=sentry.io\n * ```\n */\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":";;;;;;;;;;;;;;;;;;;;;;AAqBA,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,10 +1,11 @@
|
|
|
1
|
-
import { FrameInterface } from "../schema-
|
|
2
|
-
import { Event, Issue } from "../types-
|
|
3
|
-
import { SentryApiService } from "../client-
|
|
1
|
+
import { FrameInterface } from "../schema-BJv7kREf.cjs";
|
|
2
|
+
import { Event, Issue } from "../types-NIQW7KyF.cjs";
|
|
3
|
+
import { SentryApiService } from "../client-DkY0ifZf.cjs";
|
|
4
4
|
import "../index-BPSCxsMC.cjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/internal/formatting.d.ts
|
|
8
|
+
|
|
8
9
|
declare function formatFrameHeader(frame: z.infer<typeof FrameInterface>, platform: string | undefined | null): string;
|
|
9
10
|
declare function formatEventOutput(event: Event): string;
|
|
10
11
|
declare function formatIssueOutput({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.cts","names":[],"sources":["../../src/internal/formatting.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formatting.d.cts","names":[],"sources":["../../src/internal/formatting.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAmBS,iBADO,iBAAA,CACL,KAAA,EAAF,CAAA,CAAE,KAAA,CAAA,OAAa,cAAb,CAAA,EAAA,QAAA,EAAA,MAAA,GAAA,SAAA,GAAA,IAAA,CAAA,EAAA,MAAA;AAAK,iBAeA,iBAAA,CAfA,KAAA,EAeyB,KAfzB,CAAA,EAAA,MAAA;AAeA,iBAgFA,iBAAA,CAhF8B;EAAA,gBAAA;EAAA,KAAA;EAAA,KAAA;EAAA;CAAA,EAAA;EAgF9B,gBAAA,EAAA,MAAiB;EAAA,KAAA,EAOxB,KAPwB;EAAA,KAC/B,EAOO,KAPP;EAAgB,UAChB,EAOY,gBAPZ;CAAK,CAAA,EAAA,MACL"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { FrameInterface } from "../schema-
|
|
2
|
-
import { Event, Issue } from "../types-
|
|
3
|
-
import { SentryApiService } from "../client-
|
|
1
|
+
import { FrameInterface } from "../schema-BnxGHL_i.js";
|
|
2
|
+
import { Event, Issue } from "../types-Daq2fm0E.js";
|
|
3
|
+
import { SentryApiService } from "../client-4jq_wVgn.js";
|
|
4
4
|
import "../index-h64gcVNJ.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/internal/formatting.d.ts
|
|
8
|
+
|
|
8
9
|
declare function formatFrameHeader(frame: z.infer<typeof FrameInterface>, platform: string | undefined | null): string;
|
|
9
10
|
declare function formatEventOutput(event: Event): string;
|
|
10
11
|
declare function formatIssueOutput({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatting.d.ts","names":[],"sources":["../../src/internal/formatting.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","names":[],"sources":["../../src/internal/formatting.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAmBS,iBADO,iBAAA,CACL,KAAA,EAAF,CAAA,CAAE,KAAA,CAAA,OAAa,cAAb,CAAA,EAAA,QAAA,EAAA,MAAA,GAAA,SAAA,GAAA,IAAA,CAAA,EAAA,MAAA;AAAK,iBAeA,iBAAA,CAfA,KAAA,EAeyB,KAfzB,CAAA,EAAA,MAAA;AAeA,iBAgFA,iBAAA,CAhF8B;EAAA,gBAAA;EAAA,KAAA;EAAA,KAAA;EAAA;CAAA,EAAA;EAgF9B,gBAAA,EAAA,MAAiB;EAAA,KAAA,EAOxB,KAPwB;EAAA,KAC/B,EAOO,KAPP;EAAgB,UAChB,EAOY,gBAPZ;CAAK,CAAA,EAAA,MACL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_issue_helpers = require('../issue-helpers-
|
|
1
|
+
const require_issue_helpers = require('../issue-helpers-D712fGT2.cjs');
|
|
2
2
|
|
|
3
3
|
exports.extractIssueId = require_issue_helpers.extractIssueId;
|
|
4
4
|
exports.parseIssueId = require_issue_helpers.parseIssueId;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
//#region src/internal/issue-helpers.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Issue parameter parsing and validation utilities.
|
|
4
|
+
*
|
|
5
|
+
* Handles flexible input formats for Sentry issues (URLs vs explicit parameters),
|
|
6
|
+
* extracts organization and issue identifiers, and validates issue ID formats.
|
|
7
|
+
* Provides robust parsing for LLM-generated parameters that may contain formatting
|
|
8
|
+
* inconsistencies.
|
|
9
|
+
*/
|
|
2
10
|
/**
|
|
3
11
|
* Extracts the Sentry issue ID and organization slug from a full URL
|
|
4
12
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue-helpers.d.cts","names":[],"sources":["../../src/internal/issue-helpers.ts"],"sourcesContent":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"issue-helpers.d.cts","names":[],"sources":["../../src/internal/issue-helpers.ts"],"sourcesContent":[],"mappings":";;AAgBA;AAmEA;AAyBA;;;;;AAGkB;;;;;;;iBA/FF,cAAA;;;;;;;;;;;;iBAmEA,YAAA;;;;;;;;iBAyBA,gBAAA"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
//#region src/internal/issue-helpers.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Issue parameter parsing and validation utilities.
|
|
4
|
+
*
|
|
5
|
+
* Handles flexible input formats for Sentry issues (URLs vs explicit parameters),
|
|
6
|
+
* extracts organization and issue identifiers, and validates issue ID formats.
|
|
7
|
+
* Provides robust parsing for LLM-generated parameters that may contain formatting
|
|
8
|
+
* inconsistencies.
|
|
9
|
+
*/
|
|
2
10
|
/**
|
|
3
11
|
* Extracts the Sentry issue ID and organization slug from a full URL
|
|
4
12
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issue-helpers.d.ts","names":[],"sources":["../../src/internal/issue-helpers.ts"],"sourcesContent":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"issue-helpers.d.ts","names":[],"sources":["../../src/internal/issue-helpers.ts"],"sourcesContent":[],"mappings":";;AAgBA;AAmEA;AAyBA;;;;;AAGkB;;;;;;;iBA/FF,cAAA;;;;;;;;;;;;iBAmEA,YAAA;;;;;;;;iBAyBA,gBAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_dist = require('../dist-BlIWGSIM.cjs');
|
|
2
2
|
const require_vi_bdSIJ99Y = require('../vi.bdSIJ99Y-Dft_B_Ta.cjs');
|
|
3
|
-
const require_issue_helpers = require('../issue-helpers-
|
|
3
|
+
const require_issue_helpers = require('../issue-helpers-D712fGT2.cjs');
|
|
4
4
|
|
|
5
5
|
//#region src/internal/issue-helpers.test.ts
|
|
6
6
|
require_dist.describe("extractIssueId", () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, it } from "../dist-DDpQABxe.js";
|
|
2
2
|
import { globalExpect } from "../vi.bdSIJ99Y-BfJr7I2s.js";
|
|
3
|
-
import { extractIssueId, parseIssueId, parseIssueParams } from "../issue-helpers-
|
|
3
|
+
import { extractIssueId, parseIssueId, parseIssueParams } from "../issue-helpers-BMVLc3mR.js";
|
|
4
4
|
|
|
5
5
|
//#region src/internal/issue-helpers.test.ts
|
|
6
6
|
describe("extractIssueId", () => {
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
//#region src/internal/issue-helpers.ts
|
|
2
2
|
/**
|
|
3
|
+
* Issue parameter parsing and validation utilities.
|
|
4
|
+
*
|
|
5
|
+
* Handles flexible input formats for Sentry issues (URLs vs explicit parameters),
|
|
6
|
+
* extracts organization and issue identifiers, and validates issue ID formats.
|
|
7
|
+
* Provides robust parsing for LLM-generated parameters that may contain formatting
|
|
8
|
+
* inconsistencies.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
3
11
|
* Extracts the Sentry issue ID and organization slug from a full URL
|
|
4
12
|
*
|
|
5
13
|
* @param url - A full Sentry issue URL
|
|
@@ -73,4 +81,4 @@ function parseIssueParams({ issueUrl, issueId, organizationSlug }) {
|
|
|
73
81
|
|
|
74
82
|
//#endregion
|
|
75
83
|
export { extractIssueId, parseIssueId, parseIssueParams };
|
|
76
|
-
//# sourceMappingURL=issue-helpers-
|
|
84
|
+
//# sourceMappingURL=issue-helpers-BMVLc3mR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-helpers-BMVLc3mR.js","names":["url: string","parsedUrl: URL","organizationSlug: string | undefined","issueId: string"],"sources":["../src/internal/issue-helpers.ts"],"sourcesContent":["/**\n * Issue parameter parsing and validation utilities.\n *\n * Handles flexible input formats for Sentry issues (URLs vs explicit parameters),\n * extracts organization and issue identifiers, and validates issue ID formats.\n * Provides robust parsing for LLM-generated parameters that may contain formatting\n * inconsistencies.\n */\n\n/**\n * Extracts the Sentry issue ID and organization slug from a full URL\n *\n * @param url - A full Sentry issue URL\n * @returns Object containing the numeric issue ID and organization slug (if found)\n * @throws Error if the input is invalid\n */\nexport function extractIssueId(url: string): {\n issueId: string;\n organizationSlug: string;\n} {\n if (!url || typeof url !== \"string\") {\n throw new Error(\n \"Invalid Sentry issue URL. URL must be a non-empty string.\",\n );\n }\n\n if (!url.startsWith(\"http://\") && !url.startsWith(\"https://\")) {\n throw new Error(\n \"Invalid Sentry issue URL. Must start with http:// or https://\",\n );\n }\n\n let parsedUrl: URL;\n try {\n parsedUrl = new URL(url);\n } catch (error) {\n throw new Error(`Invalid Sentry issue URL. Unable to parse URL: ${url}`);\n }\n\n const pathParts = parsedUrl.pathname.split(\"/\").filter(Boolean);\n if (pathParts.length < 2 || !pathParts.includes(\"issues\")) {\n throw new Error(\n \"Invalid Sentry issue URL. Path must contain '/issues/{issue_id}'\",\n );\n }\n\n const issueId = pathParts[pathParts.indexOf(\"issues\") + 1];\n if (!issueId) {\n throw new Error(\"Unable to determine issue ID from URL.\");\n }\n\n // Extract organization slug from either the path or subdomain\n let organizationSlug: string | undefined;\n if (pathParts.includes(\"organizations\")) {\n organizationSlug = pathParts[pathParts.indexOf(\"organizations\") + 1];\n } else if (pathParts.length > 1 && pathParts[0] !== \"issues\") {\n // If URL is like sentry.io/sentry/issues/123\n organizationSlug = pathParts[0];\n } else {\n // Check for subdomain\n const hostParts = parsedUrl.hostname.split(\".\");\n if (hostParts.length > 2 && hostParts[0] !== \"www\") {\n organizationSlug = hostParts[0];\n }\n }\n\n if (!organizationSlug) {\n throw new Error(\n \"Invalid Sentry issue URL. Could not determine organization.\",\n );\n }\n\n return { issueId, organizationSlug };\n}\n\n/**\n * Sometimes the LLM will pass in a funky issue shortId. For example it might pass\n * in \"CLOUDFLARE-MCP-41.\" instead of \"CLOUDFLARE-MCP-41\". This function attempts to\n * fix common issues.\n *\n * @param issueId - The issue ID to parse\n * @returns The parsed issue ID\n */\nexport function parseIssueId(issueId: string) {\n let finalIssueId = issueId;\n // remove trailing punctuation\n finalIssueId = finalIssueId.replace(/[^\\w-]/g, \"\");\n\n // Validate against common Sentry issue ID patterns\n // Either numeric IDs or PROJECT-ABC123 format\n const validFormatRegex = /^(\\d+|[A-Za-z][\\w-]*-[A-Za-z0-9]+)$/;\n\n if (!validFormatRegex.test(finalIssueId)) {\n throw new Error(\n `Invalid issue ID format: \"${finalIssueId}\". Expected either a numeric ID or a project code followed by an alphanumeric identifier (e.g., \"PROJECT-ABC123\").`,\n );\n }\n\n return finalIssueId;\n}\n\n/**\n * Parses issue parameters from a variety of formats.\n *\n * @param params - Object containing issue URL, issue ID, and organization slug\n * @returns Object containing the parsed organization slug and issue ID\n * @throws Error if the input is invalid\n */\nexport function parseIssueParams({\n issueUrl,\n issueId,\n organizationSlug,\n}: {\n issueUrl?: string | null;\n issueId?: string | null;\n organizationSlug?: string | null;\n}): {\n organizationSlug: string;\n issueId: string;\n} {\n if (issueUrl) {\n const resolved = extractIssueId(issueUrl);\n if (!resolved) {\n throw new Error(\n \"Invalid Sentry issue URL. Path should contain '/issues/{issue_id}'\",\n );\n }\n return {\n ...resolved,\n issueId: parseIssueId(resolved.issueId),\n };\n }\n\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n\n if (issueId) {\n return {\n organizationSlug,\n issueId: parseIssueId(issueId),\n };\n }\n\n throw new Error(\"Either issueId or issueUrl must be provided\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAgBA,SAAgB,eAAeA,KAG7B;AACA,MAAK,cAAc,QAAQ,SACzB,OAAM,IAAI,MACR;AAIJ,MAAK,IAAI,WAAW,UAAU,KAAK,IAAI,WAAW,WAAW,CAC3D,OAAM,IAAI,MACR;CAIJ,IAAIC;AACJ,KAAI;AACF,cAAY,IAAI,IAAI;CACrB,SAAQ,OAAO;AACd,QAAM,IAAI,OAAO,iDAAiD,IAAI;CACvE;CAED,MAAM,YAAY,UAAU,SAAS,MAAM,IAAI,CAAC,OAAO,QAAQ;AAC/D,KAAI,UAAU,SAAS,MAAM,UAAU,SAAS,SAAS,CACvD,OAAM,IAAI,MACR;CAIJ,MAAM,UAAU,UAAU,UAAU,QAAQ,SAAS,GAAG;AACxD,MAAK,QACH,OAAM,IAAI,MAAM;CAIlB,IAAIC;AACJ,KAAI,UAAU,SAAS,gBAAgB,CACrC,oBAAmB,UAAU,UAAU,QAAQ,gBAAgB,GAAG;UACzD,UAAU,SAAS,KAAK,UAAU,OAAO,SAElD,oBAAmB,UAAU;MACxB;EAEL,MAAM,YAAY,UAAU,SAAS,MAAM,IAAI;AAC/C,MAAI,UAAU,SAAS,KAAK,UAAU,OAAO,MAC3C,oBAAmB,UAAU;CAEhC;AAED,MAAK,iBACH,OAAM,IAAI,MACR;AAIJ,QAAO;EAAE;EAAS;CAAkB;AACrC;;;;;;;;;AAUD,SAAgB,aAAaC,SAAiB;CAC5C,IAAI,eAAe;AAEnB,gBAAe,aAAa,QAAQ,WAAW,GAAG;CAIlD,MAAM,mBAAmB;AAEzB,MAAK,iBAAiB,KAAK,aAAa,CACtC,OAAM,IAAI,OACP,4BAA4B,aAAa;AAI9C,QAAO;AACR;;;;;;;;AASD,SAAgB,iBAAiB,EAC/B,UACA,SACA,kBAKD,EAGC;AACA,KAAI,UAAU;EACZ,MAAM,WAAW,eAAe,SAAS;AACzC,OAAK,SACH,OAAM,IAAI,MACR;AAGJ,SAAO;GACL,GAAG;GACH,SAAS,aAAa,SAAS,QAAQ;EACxC;CACF;AAED,MAAK,iBACH,OAAM,IAAI,MAAM;AAGlB,KAAI,QACF,QAAO;EACL;EACA,SAAS,aAAa,QAAQ;CAC/B;AAGH,OAAM,IAAI,MAAM;AACjB"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
|
|
2
2
|
//#region src/internal/issue-helpers.ts
|
|
3
3
|
/**
|
|
4
|
+
* Issue parameter parsing and validation utilities.
|
|
5
|
+
*
|
|
6
|
+
* Handles flexible input formats for Sentry issues (URLs vs explicit parameters),
|
|
7
|
+
* extracts organization and issue identifiers, and validates issue ID formats.
|
|
8
|
+
* Provides robust parsing for LLM-generated parameters that may contain formatting
|
|
9
|
+
* inconsistencies.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
4
12
|
* Extracts the Sentry issue ID and organization slug from a full URL
|
|
5
13
|
*
|
|
6
14
|
* @param url - A full Sentry issue URL
|
|
@@ -91,4 +99,4 @@ Object.defineProperty(exports, 'parseIssueParams', {
|
|
|
91
99
|
return parseIssueParams;
|
|
92
100
|
}
|
|
93
101
|
});
|
|
94
|
-
//# sourceMappingURL=issue-helpers-
|
|
102
|
+
//# sourceMappingURL=issue-helpers-D712fGT2.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue-helpers-D712fGT2.cjs","names":["url: string","parsedUrl: URL","organizationSlug: string | undefined","issueId: string"],"sources":["../src/internal/issue-helpers.ts"],"sourcesContent":["/**\n * Issue parameter parsing and validation utilities.\n *\n * Handles flexible input formats for Sentry issues (URLs vs explicit parameters),\n * extracts organization and issue identifiers, and validates issue ID formats.\n * Provides robust parsing for LLM-generated parameters that may contain formatting\n * inconsistencies.\n */\n\n/**\n * Extracts the Sentry issue ID and organization slug from a full URL\n *\n * @param url - A full Sentry issue URL\n * @returns Object containing the numeric issue ID and organization slug (if found)\n * @throws Error if the input is invalid\n */\nexport function extractIssueId(url: string): {\n issueId: string;\n organizationSlug: string;\n} {\n if (!url || typeof url !== \"string\") {\n throw new Error(\n \"Invalid Sentry issue URL. URL must be a non-empty string.\",\n );\n }\n\n if (!url.startsWith(\"http://\") && !url.startsWith(\"https://\")) {\n throw new Error(\n \"Invalid Sentry issue URL. Must start with http:// or https://\",\n );\n }\n\n let parsedUrl: URL;\n try {\n parsedUrl = new URL(url);\n } catch (error) {\n throw new Error(`Invalid Sentry issue URL. Unable to parse URL: ${url}`);\n }\n\n const pathParts = parsedUrl.pathname.split(\"/\").filter(Boolean);\n if (pathParts.length < 2 || !pathParts.includes(\"issues\")) {\n throw new Error(\n \"Invalid Sentry issue URL. Path must contain '/issues/{issue_id}'\",\n );\n }\n\n const issueId = pathParts[pathParts.indexOf(\"issues\") + 1];\n if (!issueId) {\n throw new Error(\"Unable to determine issue ID from URL.\");\n }\n\n // Extract organization slug from either the path or subdomain\n let organizationSlug: string | undefined;\n if (pathParts.includes(\"organizations\")) {\n organizationSlug = pathParts[pathParts.indexOf(\"organizations\") + 1];\n } else if (pathParts.length > 1 && pathParts[0] !== \"issues\") {\n // If URL is like sentry.io/sentry/issues/123\n organizationSlug = pathParts[0];\n } else {\n // Check for subdomain\n const hostParts = parsedUrl.hostname.split(\".\");\n if (hostParts.length > 2 && hostParts[0] !== \"www\") {\n organizationSlug = hostParts[0];\n }\n }\n\n if (!organizationSlug) {\n throw new Error(\n \"Invalid Sentry issue URL. Could not determine organization.\",\n );\n }\n\n return { issueId, organizationSlug };\n}\n\n/**\n * Sometimes the LLM will pass in a funky issue shortId. For example it might pass\n * in \"CLOUDFLARE-MCP-41.\" instead of \"CLOUDFLARE-MCP-41\". This function attempts to\n * fix common issues.\n *\n * @param issueId - The issue ID to parse\n * @returns The parsed issue ID\n */\nexport function parseIssueId(issueId: string) {\n let finalIssueId = issueId;\n // remove trailing punctuation\n finalIssueId = finalIssueId.replace(/[^\\w-]/g, \"\");\n\n // Validate against common Sentry issue ID patterns\n // Either numeric IDs or PROJECT-ABC123 format\n const validFormatRegex = /^(\\d+|[A-Za-z][\\w-]*-[A-Za-z0-9]+)$/;\n\n if (!validFormatRegex.test(finalIssueId)) {\n throw new Error(\n `Invalid issue ID format: \"${finalIssueId}\". Expected either a numeric ID or a project code followed by an alphanumeric identifier (e.g., \"PROJECT-ABC123\").`,\n );\n }\n\n return finalIssueId;\n}\n\n/**\n * Parses issue parameters from a variety of formats.\n *\n * @param params - Object containing issue URL, issue ID, and organization slug\n * @returns Object containing the parsed organization slug and issue ID\n * @throws Error if the input is invalid\n */\nexport function parseIssueParams({\n issueUrl,\n issueId,\n organizationSlug,\n}: {\n issueUrl?: string | null;\n issueId?: string | null;\n organizationSlug?: string | null;\n}): {\n organizationSlug: string;\n issueId: string;\n} {\n if (issueUrl) {\n const resolved = extractIssueId(issueUrl);\n if (!resolved) {\n throw new Error(\n \"Invalid Sentry issue URL. Path should contain '/issues/{issue_id}'\",\n );\n }\n return {\n ...resolved,\n issueId: parseIssueId(resolved.issueId),\n };\n }\n\n if (!organizationSlug) {\n throw new Error(\"Organization slug is required\");\n }\n\n if (issueId) {\n return {\n organizationSlug,\n issueId: parseIssueId(issueId),\n };\n }\n\n throw new Error(\"Either issueId or issueUrl must be provided\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,SAAgB,eAAeA,KAG7B;AACA,MAAK,cAAc,QAAQ,SACzB,OAAM,IAAI,MACR;AAIJ,MAAK,IAAI,WAAW,UAAU,KAAK,IAAI,WAAW,WAAW,CAC3D,OAAM,IAAI,MACR;CAIJ,IAAIC;AACJ,KAAI;AACF,cAAY,IAAI,IAAI;CACrB,SAAQ,OAAO;AACd,QAAM,IAAI,OAAO,iDAAiD,IAAI;CACvE;CAED,MAAM,YAAY,UAAU,SAAS,MAAM,IAAI,CAAC,OAAO,QAAQ;AAC/D,KAAI,UAAU,SAAS,MAAM,UAAU,SAAS,SAAS,CACvD,OAAM,IAAI,MACR;CAIJ,MAAM,UAAU,UAAU,UAAU,QAAQ,SAAS,GAAG;AACxD,MAAK,QACH,OAAM,IAAI,MAAM;CAIlB,IAAIC;AACJ,KAAI,UAAU,SAAS,gBAAgB,CACrC,oBAAmB,UAAU,UAAU,QAAQ,gBAAgB,GAAG;UACzD,UAAU,SAAS,KAAK,UAAU,OAAO,SAElD,oBAAmB,UAAU;MACxB;EAEL,MAAM,YAAY,UAAU,SAAS,MAAM,IAAI;AAC/C,MAAI,UAAU,SAAS,KAAK,UAAU,OAAO,MAC3C,oBAAmB,UAAU;CAEhC;AAED,MAAK,iBACH,OAAM,IAAI,MACR;AAIJ,QAAO;EAAE;EAAS;CAAkB;AACrC;;;;;;;;;AAUD,SAAgB,aAAaC,SAAiB;CAC5C,IAAI,eAAe;AAEnB,gBAAe,aAAa,QAAQ,WAAW,GAAG;CAIlD,MAAM,mBAAmB;AAEzB,MAAK,iBAAiB,KAAK,aAAa,CACtC,OAAM,IAAI,OACP,4BAA4B,aAAa;AAI9C,QAAO;AACR;;;;;;;;AASD,SAAgB,iBAAiB,EAC/B,UACA,SACA,kBAKD,EAGC;AACA,KAAI,UAAU;EACZ,MAAM,WAAW,eAAe,SAAS;AACzC,OAAK,SACH,OAAM,IAAI,MACR;AAGJ,SAAO;GACL,GAAG;GACH,SAAS,aAAa,SAAS,QAAQ;EACxC;CACF;AAED,MAAK,iBACH,OAAM,IAAI,MAAM;AAGlB,KAAI,QACF,QAAO;EACL;EACA,SAAS,aAAa,QAAQ;CAC/B;AAGH,OAAM,IAAI,MAAM;AACjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging-ByvSjT6V.cjs","names":["error: string | Error | unknown","contexts?: Record<string, Record<string, any>>","attachments?: Record<string, string | Uint8Array>"],"sources":["../src/logging.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"logging-ByvSjT6V.cjs","names":["error: string | Error | unknown","contexts?: Record<string, Record<string, any>>","attachments?: Record<string, string | Uint8Array>"],"sources":["../src/logging.ts"],"sourcesContent":["/**\n * Logging and telemetry utilities for error reporting.\n *\n * Provides centralized error logging with Sentry integration. Handles both\n * console logging for development and structured error reporting for production\n * monitoring and debugging.\n */\nimport { captureException, captureMessage, withScope } from \"@sentry/core\";\n\n/**\n * Logs errors to console and Sentry with optional context and attachments.\n *\n * Supports both Error objects and string messages. Returns a Sentry event ID\n * that can be included in user-facing error messages for debugging support.\n *\n * @param error - Error object or message string to log\n * @param contexts - Additional context data for Sentry\n * @param attachments - Files or data to attach to the Sentry event\n * @returns Sentry event ID for referencing this error, or undefined if logging fails\n *\n * @example Error Object Logging\n * ```typescript\n * try {\n * await riskyOperation();\n * } catch (error) {\n * const eventId = logError(error, {\n * operation: { name: \"riskyOperation\", params: {...} }\n * });\n * return `Error occurred. Event ID: ${eventId}`;\n * }\n * ```\n *\n * @example String Message Logging\n * ```typescript\n * const eventId = logError(\"Configuration validation failed\", {\n * config: { provided: userConfig, expected: expectedFormat }\n * });\n * ```\n */\nexport function logError(\n error: Error | unknown,\n contexts?: Record<string, Record<string, any>>,\n attachments?: Record<string, string | Uint8Array>,\n): string | undefined;\nexport function logError(\n message: string,\n contexts?: Record<string, Record<string, any>>,\n attachments?: Record<string, string | Uint8Array>,\n): string | undefined;\nexport function logError(\n error: string | Error | unknown,\n contexts?: Record<string, Record<string, any>>,\n attachments?: Record<string, string | Uint8Array>,\n): string | undefined {\n const level = \"error\";\n\n console.error(error);\n\n const eventId = withScope((scope) => {\n if (attachments) {\n for (const [key, data] of Object.entries(attachments)) {\n scope.addAttachment({\n data,\n filename: key,\n });\n }\n }\n\n return typeof error === \"string\"\n ? captureMessage(error, {\n contexts,\n level,\n })\n : captureException(error, {\n contexts,\n level,\n });\n });\n\n return eventId;\n}\n"],"mappings":";;;;AAiDA,SAAgB,SACdA,OACAC,UACAC,aACoB;CACpB,MAAM,QAAQ;AAEd,SAAQ,MAAM,MAAM;CAEpB,MAAM,UAAU,6BAAU,CAAC,UAAU;AACnC,MAAI,YACF,MAAK,MAAM,CAAC,KAAK,KAAK,IAAI,OAAO,QAAQ,YAAY,CACnD,OAAM,cAAc;GAClB;GACA,UAAU;EACX,EAAC;AAIN,gBAAc,UAAU,WACpB,kCAAe,OAAO;GACpB;GACA;EACD,EAAC,GACF,oCAAiB,OAAO;GACtB;GACA;EACD,EAAC;CACP,EAAC;AAEF,QAAO;AACR"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging-CXLD0FFB.js","names":["error: string | Error | unknown","contexts?: Record<string, Record<string, any>>","attachments?: Record<string, string | Uint8Array>"],"sources":["../src/logging.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"logging-CXLD0FFB.js","names":["error: string | Error | unknown","contexts?: Record<string, Record<string, any>>","attachments?: Record<string, string | Uint8Array>"],"sources":["../src/logging.ts"],"sourcesContent":["/**\n * Logging and telemetry utilities for error reporting.\n *\n * Provides centralized error logging with Sentry integration. Handles both\n * console logging for development and structured error reporting for production\n * monitoring and debugging.\n */\nimport { captureException, captureMessage, withScope } from \"@sentry/core\";\n\n/**\n * Logs errors to console and Sentry with optional context and attachments.\n *\n * Supports both Error objects and string messages. Returns a Sentry event ID\n * that can be included in user-facing error messages for debugging support.\n *\n * @param error - Error object or message string to log\n * @param contexts - Additional context data for Sentry\n * @param attachments - Files or data to attach to the Sentry event\n * @returns Sentry event ID for referencing this error, or undefined if logging fails\n *\n * @example Error Object Logging\n * ```typescript\n * try {\n * await riskyOperation();\n * } catch (error) {\n * const eventId = logError(error, {\n * operation: { name: \"riskyOperation\", params: {...} }\n * });\n * return `Error occurred. Event ID: ${eventId}`;\n * }\n * ```\n *\n * @example String Message Logging\n * ```typescript\n * const eventId = logError(\"Configuration validation failed\", {\n * config: { provided: userConfig, expected: expectedFormat }\n * });\n * ```\n */\nexport function logError(\n error: Error | unknown,\n contexts?: Record<string, Record<string, any>>,\n attachments?: Record<string, string | Uint8Array>,\n): string | undefined;\nexport function logError(\n message: string,\n contexts?: Record<string, Record<string, any>>,\n attachments?: Record<string, string | Uint8Array>,\n): string | undefined;\nexport function logError(\n error: string | Error | unknown,\n contexts?: Record<string, Record<string, any>>,\n attachments?: Record<string, string | Uint8Array>,\n): string | undefined {\n const level = \"error\";\n\n console.error(error);\n\n const eventId = withScope((scope) => {\n if (attachments) {\n for (const [key, data] of Object.entries(attachments)) {\n scope.addAttachment({\n data,\n filename: key,\n });\n }\n }\n\n return typeof error === \"string\"\n ? captureMessage(error, {\n contexts,\n level,\n })\n : captureException(error, {\n contexts,\n level,\n });\n });\n\n return eventId;\n}\n"],"mappings":";;;AAiDA,SAAgB,SACdA,OACAC,UACAC,aACoB;CACpB,MAAM,QAAQ;AAEd,SAAQ,MAAM,MAAM;CAEpB,MAAM,UAAU,UAAU,CAAC,UAAU;AACnC,MAAI,YACF,MAAK,MAAM,CAAC,KAAK,KAAK,IAAI,OAAO,QAAQ,YAAY,CACnD,OAAM,cAAc;GAClB;GACA,UAAU;EACX,EAAC;AAIN,gBAAc,UAAU,WACpB,eAAe,OAAO;GACpB;GACA;EACD,EAAC,GACF,iBAAiB,OAAO;GACtB;GACA;EACD,EAAC;CACP,EAAC;AAEF,QAAO;AACR"}
|
package/dist/logging.d.cts
CHANGED
|
@@ -1,8 +1,37 @@
|
|
|
1
1
|
//#region src/logging.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Logs errors to console and Sentry with optional context and attachments.
|
|
4
|
+
*
|
|
5
|
+
* Supports both Error objects and string messages. Returns a Sentry event ID
|
|
6
|
+
* that can be included in user-facing error messages for debugging support.
|
|
7
|
+
*
|
|
8
|
+
* @param error - Error object or message string to log
|
|
9
|
+
* @param contexts - Additional context data for Sentry
|
|
10
|
+
* @param attachments - Files or data to attach to the Sentry event
|
|
11
|
+
* @returns Sentry event ID for referencing this error, or undefined if logging fails
|
|
12
|
+
*
|
|
13
|
+
* @example Error Object Logging
|
|
14
|
+
* ```typescript
|
|
15
|
+
* try {
|
|
16
|
+
* await riskyOperation();
|
|
17
|
+
* } catch (error) {
|
|
18
|
+
* const eventId = logError(error, {
|
|
19
|
+
* operation: { name: "riskyOperation", params: {...} }
|
|
20
|
+
* });
|
|
21
|
+
* return `Error occurred. Event ID: ${eventId}`;
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example String Message Logging
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const eventId = logError("Configuration validation failed", {
|
|
28
|
+
* config: { provided: userConfig, expected: expectedFormat }
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
2
32
|
declare function logError(error: Error | unknown, contexts?: Record<string, Record<string, any>>, attachments?: Record<string, string | Uint8Array>): string | undefined;
|
|
3
33
|
declare function logError(message: string, contexts?: Record<string, Record<string, any>>, attachments?: Record<string, string | Uint8Array>): string | undefined;
|
|
4
34
|
//# sourceMappingURL=logging.d.ts.map
|
|
5
|
-
|
|
6
35
|
//#endregion
|
|
7
36
|
export { logError };
|
|
8
37
|
//# sourceMappingURL=logging.d.cts.map
|
package/dist/logging.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.cts","names":[],"sources":["../src/logging.ts"],"sourcesContent":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"logging.d.cts","names":[],"sources":["../src/logging.ts"],"sourcesContent":[],"mappings":";;AAuCA;;;;;;;AAGsB;AAEtB;;;;;;AAGsB;;;;;;;;;;;;;;;iBARN,QAAA,QACP,4BACI,eAAe,oCACZ,wBAAwB;iBAExB,QAAA,6BAEH,eAAe,oCACZ,wBAAwB"}
|
package/dist/logging.d.ts
CHANGED
|
@@ -1,8 +1,37 @@
|
|
|
1
1
|
//#region src/logging.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Logs errors to console and Sentry with optional context and attachments.
|
|
4
|
+
*
|
|
5
|
+
* Supports both Error objects and string messages. Returns a Sentry event ID
|
|
6
|
+
* that can be included in user-facing error messages for debugging support.
|
|
7
|
+
*
|
|
8
|
+
* @param error - Error object or message string to log
|
|
9
|
+
* @param contexts - Additional context data for Sentry
|
|
10
|
+
* @param attachments - Files or data to attach to the Sentry event
|
|
11
|
+
* @returns Sentry event ID for referencing this error, or undefined if logging fails
|
|
12
|
+
*
|
|
13
|
+
* @example Error Object Logging
|
|
14
|
+
* ```typescript
|
|
15
|
+
* try {
|
|
16
|
+
* await riskyOperation();
|
|
17
|
+
* } catch (error) {
|
|
18
|
+
* const eventId = logError(error, {
|
|
19
|
+
* operation: { name: "riskyOperation", params: {...} }
|
|
20
|
+
* });
|
|
21
|
+
* return `Error occurred. Event ID: ${eventId}`;
|
|
22
|
+
* }
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example String Message Logging
|
|
26
|
+
* ```typescript
|
|
27
|
+
* const eventId = logError("Configuration validation failed", {
|
|
28
|
+
* config: { provided: userConfig, expected: expectedFormat }
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
2
32
|
declare function logError(error: Error | unknown, contexts?: Record<string, Record<string, any>>, attachments?: Record<string, string | Uint8Array>): string | undefined;
|
|
3
33
|
declare function logError(message: string, contexts?: Record<string, Record<string, any>>, attachments?: Record<string, string | Uint8Array>): string | undefined;
|
|
4
34
|
//# sourceMappingURL=logging.d.ts.map
|
|
5
|
-
|
|
6
35
|
//#endregion
|
|
7
36
|
export { logError };
|
|
8
37
|
//# sourceMappingURL=logging.d.ts.map
|
package/dist/logging.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logging.d.ts","names":[],"sources":["../src/logging.ts"],"sourcesContent":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"logging.d.ts","names":[],"sources":["../src/logging.ts"],"sourcesContent":[],"mappings":";;AAuCA;;;;;;;AAGsB;AAEtB;;;;;;AAGsB;;;;;;;;;;;;;;;iBARN,QAAA,QACP,4BACI,eAAe,oCACZ,wBAAwB;iBAExB,QAAA,6BAEH,eAAe,oCACZ,wBAAwB"}
|
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-DWy1uDak.cjs');
|
|
2
|
-
const require_schema = require('./schema-
|
|
2
|
+
const require_schema = require('./schema-BTfISwFu.cjs');
|
|
3
3
|
const zod = require_chunk.__toESM(require("zod"));
|
|
4
4
|
|
|
5
5
|
//#region src/promptDefinitions.ts
|
|
6
|
+
/**
|
|
7
|
+
* All MCP prompt definitions for the Sentry server.
|
|
8
|
+
*
|
|
9
|
+
* Used by server.ts to register prompts with the MCP server and by prompts.ts
|
|
10
|
+
* for implementation handlers. Each definition includes name, description, and
|
|
11
|
+
* Zod parameter schema for multi-step workflows.
|
|
12
|
+
*/
|
|
6
13
|
const PROMPT_DEFINITIONS = [{
|
|
7
14
|
name: "find_errors_in_file",
|
|
8
15
|
description: ["Use this prompt when you need to find errors in Sentry for a given file."].join("\n"),
|
|
@@ -27,4 +34,4 @@ Object.defineProperty(exports, 'PROMPT_DEFINITIONS', {
|
|
|
27
34
|
return PROMPT_DEFINITIONS;
|
|
28
35
|
}
|
|
29
36
|
});
|
|
30
|
-
//# sourceMappingURL=promptDefinitions-
|
|
37
|
+
//# sourceMappingURL=promptDefinitions-BTLIBcGt.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptDefinitions-BTLIBcGt.cjs","names":["ParamOrganizationSlug","ParamIssueShortId","ParamIssueUrl"],"sources":["../src/promptDefinitions.ts"],"sourcesContent":["/**\n * Prompt definitions for the Sentry MCP server.\n *\n * Declarative definitions for all MCP prompts that provide multi-step workflows\n * and guided interactions with Sentry. Prompts orchestrate sequences of tool calls\n * with structured guidance for complex tasks.\n *\n * @example Prompt Definition Structure\n * ```typescript\n * {\n * name: \"prompt_name\" as const,\n * description: [\n * \"Brief prompt description and purpose.\",\n * \"Additional context about when to use this prompt.\",\n * ].join(\"\\n\"),\n * paramsSchema: {\n * organizationSlug: ParamOrganizationSlug,\n * optionalParam: ParamSchema.optional(),\n * },\n * }\n * ```\n */\nimport { z } from \"zod\";\nimport {\n ParamIssueShortId,\n ParamIssueUrl,\n ParamOrganizationSlug,\n} from \"./schema\";\n\n/**\n * All MCP prompt definitions for the Sentry server.\n *\n * Used by server.ts to register prompts with the MCP server and by prompts.ts\n * for implementation handlers. Each definition includes name, description, and\n * Zod parameter schema for multi-step workflows.\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":";;;;;;;;;;;;AAoCA,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"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/promptDefinitions.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* All MCP prompt definitions for the Sentry server.
|
|
7
|
+
*
|
|
8
|
+
* Used by server.ts to register prompts with the MCP server and by prompts.ts
|
|
9
|
+
* for implementation handlers. Each definition includes name, description, and
|
|
10
|
+
* Zod parameter schema for multi-step workflows.
|
|
11
|
+
*/
|
|
4
12
|
declare const PROMPT_DEFINITIONS: ({
|
|
5
13
|
name: "find_errors_in_file";
|
|
6
14
|
description: string;
|
|
@@ -23,4 +31,4 @@ declare const PROMPT_DEFINITIONS: ({
|
|
|
23
31
|
//# sourceMappingURL=promptDefinitions.d.ts.map
|
|
24
32
|
//#endregion
|
|
25
33
|
export { PROMPT_DEFINITIONS };
|
|
26
|
-
//# sourceMappingURL=promptDefinitions-
|
|
34
|
+
//# sourceMappingURL=promptDefinitions-CF2VWdQ6.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptDefinitions-CF2VWdQ6.d.cts","names":[],"sources":["../src/promptDefinitions.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;cAoCa;;;;sBAuBZ,CAAA,CAAA"}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
|
|
3
3
|
//#region src/promptDefinitions.d.ts
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* All MCP prompt definitions for the Sentry server.
|
|
7
|
+
*
|
|
8
|
+
* Used by server.ts to register prompts with the MCP server and by prompts.ts
|
|
9
|
+
* for implementation handlers. Each definition includes name, description, and
|
|
10
|
+
* Zod parameter schema for multi-step workflows.
|
|
11
|
+
*/
|
|
4
12
|
declare const PROMPT_DEFINITIONS: ({
|
|
5
13
|
name: "find_errors_in_file";
|
|
6
14
|
description: string;
|
|
@@ -23,4 +31,4 @@ declare const PROMPT_DEFINITIONS: ({
|
|
|
23
31
|
//# sourceMappingURL=promptDefinitions.d.ts.map
|
|
24
32
|
//#endregion
|
|
25
33
|
export { PROMPT_DEFINITIONS };
|
|
26
|
-
//# sourceMappingURL=promptDefinitions-
|
|
34
|
+
//# sourceMappingURL=promptDefinitions-D5FSQckL.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptDefinitions-D5FSQckL.d.ts","names":[],"sources":["../src/promptDefinitions.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;cAoCa;;;;sBAuBZ,CAAA,CAAA"}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
import { ParamIssueShortId, ParamIssueUrl, ParamOrganizationSlug } from "./schema-
|
|
1
|
+
import { ParamIssueShortId, ParamIssueUrl, ParamOrganizationSlug } from "./schema-Dv6aLZgz.js";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
//#region src/promptDefinitions.ts
|
|
5
|
+
/**
|
|
6
|
+
* All MCP prompt definitions for the Sentry server.
|
|
7
|
+
*
|
|
8
|
+
* Used by server.ts to register prompts with the MCP server and by prompts.ts
|
|
9
|
+
* for implementation handlers. Each definition includes name, description, and
|
|
10
|
+
* Zod parameter schema for multi-step workflows.
|
|
11
|
+
*/
|
|
5
12
|
const PROMPT_DEFINITIONS = [{
|
|
6
13
|
name: "find_errors_in_file",
|
|
7
14
|
description: ["Use this prompt when you need to find errors in Sentry for a given file."].join("\n"),
|
|
@@ -21,4 +28,4 @@ const PROMPT_DEFINITIONS = [{
|
|
|
21
28
|
|
|
22
29
|
//#endregion
|
|
23
30
|
export { PROMPT_DEFINITIONS };
|
|
24
|
-
//# sourceMappingURL=promptDefinitions-
|
|
31
|
+
//# sourceMappingURL=promptDefinitions-D8yow1m0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"promptDefinitions-D8yow1m0.js","names":[],"sources":["../src/promptDefinitions.ts"],"sourcesContent":["/**\n * Prompt definitions for the Sentry MCP server.\n *\n * Declarative definitions for all MCP prompts that provide multi-step workflows\n * and guided interactions with Sentry. Prompts orchestrate sequences of tool calls\n * with structured guidance for complex tasks.\n *\n * @example Prompt Definition Structure\n * ```typescript\n * {\n * name: \"prompt_name\" as const,\n * description: [\n * \"Brief prompt description and purpose.\",\n * \"Additional context about when to use this prompt.\",\n * ].join(\"\\n\"),\n * paramsSchema: {\n * organizationSlug: ParamOrganizationSlug,\n * optionalParam: ParamSchema.optional(),\n * },\n * }\n * ```\n */\nimport { z } from \"zod\";\nimport {\n ParamIssueShortId,\n ParamIssueUrl,\n ParamOrganizationSlug,\n} from \"./schema\";\n\n/**\n * All MCP prompt definitions for the Sentry server.\n *\n * Used by server.ts to register prompts with the MCP server and by prompts.ts\n * for implementation handlers. Each definition includes name, description, and\n * Zod parameter schema for multi-step workflows.\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":";;;;;;;;;;;AAoCA,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,4 +1,4 @@
|
|
|
1
|
-
require('./schema-
|
|
2
|
-
const require_promptDefinitions = require('./promptDefinitions-
|
|
1
|
+
require('./schema-BTfISwFu.cjs');
|
|
2
|
+
const require_promptDefinitions = require('./promptDefinitions-BTLIBcGt.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-CF2VWdQ6.cjs";
|
|
2
2
|
export { PROMPT_DEFINITIONS };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { PROMPT_DEFINITIONS } from "./promptDefinitions-
|
|
1
|
+
import { PROMPT_DEFINITIONS } from "./promptDefinitions-D5FSQckL.js";
|
|
2
2
|
export { PROMPT_DEFINITIONS };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const require_errors = require('./errors-B9fwS-aP.cjs');
|
|
1
2
|
|
|
2
3
|
//#region src/prompts.ts
|
|
3
4
|
const PROMPT_HANDLERS = {
|
|
@@ -13,7 +14,7 @@ const PROMPT_HANDLERS = {
|
|
|
13
14
|
let issueMessage;
|
|
14
15
|
if (issueUrl) issueMessage = `The Sentry issue is ${issueUrl}`;
|
|
15
16
|
else if (organizationSlug && issueId) issueMessage = `The Sentry issue is ${issueId} in the organization ${organizationSlug}`;
|
|
16
|
-
else throw new
|
|
17
|
+
else throw new require_errors.UserInputError("Either issueUrl or organizationSlug and issueId must be provided");
|
|
17
18
|
return [
|
|
18
19
|
`I want to use Seer to fix an issue in Sentry.`,
|
|
19
20
|
"",
|
|
@@ -35,4 +36,4 @@ Object.defineProperty(exports, 'PROMPT_HANDLERS', {
|
|
|
35
36
|
return PROMPT_HANDLERS;
|
|
36
37
|
}
|
|
37
38
|
});
|
|
38
|
-
//# sourceMappingURL=prompts-
|
|
39
|
+
//# sourceMappingURL=prompts-CDbQrutV.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts-CDbQrutV.cjs","names":["issueMessage: string","UserInputError"],"sources":["../src/prompts.ts"],"sourcesContent":["/**\n * Prompt implementation handlers for the Sentry MCP server.\n *\n * Contains runtime implementations for all MCP prompts defined in `promptDefinitions.ts`.\n * Each handler generates context-aware instructions that guide LLMs through\n * complex multi-step workflows involving Sentry operations.\n *\n * @example Basic Handler Pattern\n * ```typescript\n * prompt_name: async (context, params) => {\n * const instructions = [\n * \"Primary objective and context\",\n * \"\",\n * \"1. First step with specific tool call\",\n * \"2. Second step with conditional logic\",\n * \"3. Final step with recommendations\",\n * ];\n * return instructions.join(\"\\n\");\n * },\n * ```\n */\nimport { UserInputError } from \"./errors\";\nimport type { PromptHandlers } from \"./types\";\n\nexport const PROMPT_HANDLERS = {\n find_errors_in_file: async (context, { organizationSlug, filename }) =>\n [\n `I want to find errors in Sentry, within the organization ${organizationSlug}, for the file ${filename}`,\n \"\",\n \"You should use the tool `search_errors` to find errors in Sentry.\",\n \"\",\n \"If the filename is ambiguous, such as something like `index.ts`, and in most cases, you should pass it in with its direct parent.\",\n \"For example: if the file is `app/utils/index.ts`, you should pass in `utils/index.ts` or `app/utils/index.ts` depending on if the file is actually part of the applications source path.\",\n ].join(\"\\n\"),\n fix_issue_with_seer: async (\n context,\n { organizationSlug, issueId, issueUrl },\n ) => {\n let issueMessage: string;\n if (issueUrl) {\n issueMessage = `The Sentry issue is ${issueUrl}`;\n } else if (organizationSlug && issueId) {\n issueMessage = `The Sentry issue is ${issueId} in the organization ${organizationSlug}`;\n } else {\n throw new UserInputError(\n \"Either issueUrl or organizationSlug and issueId must be provided\",\n );\n }\n return [\n `I want to use Seer to fix an issue in Sentry.`,\n \"\",\n issueMessage,\n \"\",\n \"1. Call the tool `get_seer_issue_fix_status` to see if its already in progress.\",\n \"2a. If it isn't, you can start it with the tool `begin_seer_issue_fix`.\",\n \"2b. If it is, you can call the tool `get_seer_issue_fix_status` to check the status of the analysis.\",\n \"3. Repeat step 2b until the task has completed.\",\n \"4. Help me apply the fix to my application, if you are able to. Think carefully when doing this.\",\n ].join(\"\\n\");\n },\n} satisfies PromptHandlers;\n"],"mappings":";;;AAwBA,MAAa,kBAAkB;CAC7B,qBAAqB,OAAO,SAAS,EAAE,kBAAkB,UAAU,KACjE;GACG,2DAA2D,iBAAiB,iBAAiB,SAAS;EACvG;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACd,qBAAqB,OACnB,SACA,EAAE,kBAAkB,SAAS,UAAU,KACpC;EACH,IAAIA;AACJ,MAAI,SACF,iBAAgB,sBAAsB,SAAS;WACtC,oBAAoB,QAC7B,iBAAgB,sBAAsB,QAAQ,uBAAuB,iBAAiB;MAEtF,OAAM,IAAIC,8BACR;AAGJ,SAAO;IACJ;GACD;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;CACb;AACF"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { UserInputError } from "./errors-BJSrT6Ou.js";
|
|
2
|
+
|
|
1
3
|
//#region src/prompts.ts
|
|
2
4
|
const PROMPT_HANDLERS = {
|
|
3
5
|
find_errors_in_file: async (context, { organizationSlug, filename }) => [
|
|
@@ -12,7 +14,7 @@ const PROMPT_HANDLERS = {
|
|
|
12
14
|
let issueMessage;
|
|
13
15
|
if (issueUrl) issueMessage = `The Sentry issue is ${issueUrl}`;
|
|
14
16
|
else if (organizationSlug && issueId) issueMessage = `The Sentry issue is ${issueId} in the organization ${organizationSlug}`;
|
|
15
|
-
else throw new
|
|
17
|
+
else throw new UserInputError("Either issueUrl or organizationSlug and issueId must be provided");
|
|
16
18
|
return [
|
|
17
19
|
`I want to use Seer to fix an issue in Sentry.`,
|
|
18
20
|
"",
|
|
@@ -29,4 +31,4 @@ const PROMPT_HANDLERS = {
|
|
|
29
31
|
|
|
30
32
|
//#endregion
|
|
31
33
|
export { PROMPT_HANDLERS };
|
|
32
|
-
//# sourceMappingURL=prompts-
|
|
34
|
+
//# sourceMappingURL=prompts-Dt3A8Qfl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts-Dt3A8Qfl.js","names":["issueMessage: string"],"sources":["../src/prompts.ts"],"sourcesContent":["/**\n * Prompt implementation handlers for the Sentry MCP server.\n *\n * Contains runtime implementations for all MCP prompts defined in `promptDefinitions.ts`.\n * Each handler generates context-aware instructions that guide LLMs through\n * complex multi-step workflows involving Sentry operations.\n *\n * @example Basic Handler Pattern\n * ```typescript\n * prompt_name: async (context, params) => {\n * const instructions = [\n * \"Primary objective and context\",\n * \"\",\n * \"1. First step with specific tool call\",\n * \"2. Second step with conditional logic\",\n * \"3. Final step with recommendations\",\n * ];\n * return instructions.join(\"\\n\");\n * },\n * ```\n */\nimport { UserInputError } from \"./errors\";\nimport type { PromptHandlers } from \"./types\";\n\nexport const PROMPT_HANDLERS = {\n find_errors_in_file: async (context, { organizationSlug, filename }) =>\n [\n `I want to find errors in Sentry, within the organization ${organizationSlug}, for the file ${filename}`,\n \"\",\n \"You should use the tool `search_errors` to find errors in Sentry.\",\n \"\",\n \"If the filename is ambiguous, such as something like `index.ts`, and in most cases, you should pass it in with its direct parent.\",\n \"For example: if the file is `app/utils/index.ts`, you should pass in `utils/index.ts` or `app/utils/index.ts` depending on if the file is actually part of the applications source path.\",\n ].join(\"\\n\"),\n fix_issue_with_seer: async (\n context,\n { organizationSlug, issueId, issueUrl },\n ) => {\n let issueMessage: string;\n if (issueUrl) {\n issueMessage = `The Sentry issue is ${issueUrl}`;\n } else if (organizationSlug && issueId) {\n issueMessage = `The Sentry issue is ${issueId} in the organization ${organizationSlug}`;\n } else {\n throw new UserInputError(\n \"Either issueUrl or organizationSlug and issueId must be provided\",\n );\n }\n return [\n `I want to use Seer to fix an issue in Sentry.`,\n \"\",\n issueMessage,\n \"\",\n \"1. Call the tool `get_seer_issue_fix_status` to see if its already in progress.\",\n \"2a. If it isn't, you can start it with the tool `begin_seer_issue_fix`.\",\n \"2b. If it is, you can call the tool `get_seer_issue_fix_status` to check the status of the analysis.\",\n \"3. Repeat step 2b until the task has completed.\",\n \"4. Help me apply the fix to my application, if you are able to. Think carefully when doing this.\",\n ].join(\"\\n\");\n },\n} satisfies PromptHandlers;\n"],"mappings":";;;AAwBA,MAAa,kBAAkB;CAC7B,qBAAqB,OAAO,SAAS,EAAE,kBAAkB,UAAU,KACjE;GACG,2DAA2D,iBAAiB,iBAAiB,SAAS;EACvG;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACd,qBAAqB,OACnB,SACA,EAAE,kBAAkB,SAAS,UAAU,KACpC;EACH,IAAIA;AACJ,MAAI,SACF,iBAAgB,sBAAsB,SAAS;WACtC,oBAAoB,QAC7B,iBAAgB,sBAAsB,QAAQ,uBAAuB,iBAAiB;MAEtF,OAAM,IAAI,eACR;AAGJ,SAAO;IACJ;GACD;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACD,EAAC,KAAK,KAAK;CACb;AACF"}
|
package/dist/prompts.cjs
CHANGED
package/dist/prompts.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "./promptDefinitions-
|
|
2
|
-
import "./toolDefinitions-
|
|
3
|
-
import { ServerContext } from "./types-
|
|
1
|
+
import "./promptDefinitions-CF2VWdQ6.cjs";
|
|
2
|
+
import "./toolDefinitions-Ipvr4Acw.cjs";
|
|
3
|
+
import { ServerContext } from "./types-DRF2IoP_.cjs";
|
|
4
4
|
|
|
5
5
|
//#region src/prompts.d.ts
|
|
6
6
|
declare const PROMPT_HANDLERS: {
|
package/dist/prompts.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.cts","names":[],"sources":["../src/prompts.ts"],"sourcesContent":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"prompts.d.cts","names":[],"sources":["../src/prompts.ts"],"sourcesContent":[],"mappings":";;;;;cAwBa;iCAoCa;;;EAAA;;;;IApCb,QAAA,CAAA,EAAA,OAoCa;EAAA,CAAA,EAAA,UAAA,CAAA,MAAA,CAAA;EAAA,mBAAA,EAAA,CAAA,OAAA,eAAA,EAAA;IAAA,gBAAA;IAAA,OAAA;IAAA;GAAA,EAAA"}
|