@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.
Files changed (213) hide show
  1. package/dist/api-client/client.cjs +2 -2
  2. package/dist/api-client/client.d.cts +3 -3
  3. package/dist/api-client/client.d.ts +3 -3
  4. package/dist/api-client/client.js +2 -2
  5. package/dist/api-client/client.test.cjs +2 -2
  6. package/dist/api-client/client.test.js +2 -2
  7. package/dist/api-client/index.cjs +3 -2
  8. package/dist/api-client/index.d.cts +4 -4
  9. package/dist/api-client/index.d.ts +4 -4
  10. package/dist/api-client/index.js +3 -3
  11. package/dist/api-client/schema.cjs +2 -1
  12. package/dist/api-client/schema.d.cts +2 -2
  13. package/dist/api-client/schema.d.ts +2 -2
  14. package/dist/api-client/schema.js +2 -2
  15. package/dist/api-client/types.d.cts +3 -3
  16. package/dist/api-client/types.d.ts +3 -3
  17. package/dist/client-4jq_wVgn.d.ts +522 -0
  18. package/dist/client-4jq_wVgn.d.ts.map +1 -0
  19. package/dist/client-B7vZ6JMk.cjs +572 -0
  20. package/dist/client-B7vZ6JMk.cjs.map +1 -0
  21. package/dist/client-CAoHZbyK.js +561 -0
  22. package/dist/client-CAoHZbyK.js.map +1 -0
  23. package/dist/client-DkY0ifZf.d.cts +522 -0
  24. package/dist/client-DkY0ifZf.d.cts.map +1 -0
  25. package/dist/formatting-BaARL2gT.js.map +1 -1
  26. package/dist/formatting-C2kN0ok6.cjs.map +1 -1
  27. package/dist/index.cjs +13 -13
  28. package/dist/index.cjs.map +1 -1
  29. package/dist/index.js +13 -13
  30. package/dist/index.js.map +1 -1
  31. package/dist/internal/formatting.d.cts +4 -3
  32. package/dist/internal/formatting.d.cts.map +1 -1
  33. package/dist/internal/formatting.d.ts +4 -3
  34. package/dist/internal/formatting.d.ts.map +1 -1
  35. package/dist/internal/issue-helpers.cjs +1 -1
  36. package/dist/internal/issue-helpers.d.cts +8 -0
  37. package/dist/internal/issue-helpers.d.cts.map +1 -1
  38. package/dist/internal/issue-helpers.d.ts +8 -0
  39. package/dist/internal/issue-helpers.d.ts.map +1 -1
  40. package/dist/internal/issue-helpers.js +1 -1
  41. package/dist/internal/issue-helpers.test.cjs +1 -1
  42. package/dist/internal/issue-helpers.test.js +1 -1
  43. package/dist/{issue-helpers-CSNNO03f.js → issue-helpers-BMVLc3mR.js} +9 -1
  44. package/dist/issue-helpers-BMVLc3mR.js.map +1 -0
  45. package/dist/{issue-helpers-71XgJVXC.cjs → issue-helpers-D712fGT2.cjs} +9 -1
  46. package/dist/issue-helpers-D712fGT2.cjs.map +1 -0
  47. package/dist/logging-ByvSjT6V.cjs.map +1 -1
  48. package/dist/logging-CXLD0FFB.js.map +1 -1
  49. package/dist/logging.d.cts +30 -1
  50. package/dist/logging.d.cts.map +1 -1
  51. package/dist/logging.d.ts +30 -1
  52. package/dist/logging.d.ts.map +1 -1
  53. package/dist/{promptDefinitions-D3ll3qCd.cjs → promptDefinitions-BTLIBcGt.cjs} +9 -2
  54. package/dist/promptDefinitions-BTLIBcGt.cjs.map +1 -0
  55. package/dist/{promptDefinitions-H0q1_X-K.d.ts → promptDefinitions-CF2VWdQ6.d.cts} +9 -1
  56. package/dist/promptDefinitions-CF2VWdQ6.d.cts.map +1 -0
  57. package/dist/{promptDefinitions-DMucOchd.d.cts → promptDefinitions-D5FSQckL.d.ts} +9 -1
  58. package/dist/promptDefinitions-D5FSQckL.d.ts.map +1 -0
  59. package/dist/{promptDefinitions-aKmUZWWO.js → promptDefinitions-D8yow1m0.js} +9 -2
  60. package/dist/promptDefinitions-D8yow1m0.js.map +1 -0
  61. package/dist/promptDefinitions.cjs +2 -2
  62. package/dist/promptDefinitions.d.cts +1 -1
  63. package/dist/promptDefinitions.d.ts +1 -1
  64. package/dist/promptDefinitions.js +2 -2
  65. package/dist/{prompts-DMwoay8l.cjs → prompts-CDbQrutV.cjs} +3 -2
  66. package/dist/prompts-CDbQrutV.cjs.map +1 -0
  67. package/dist/{prompts-CzD0yl7Z.js → prompts-Dt3A8Qfl.js} +4 -2
  68. package/dist/prompts-Dt3A8Qfl.js.map +1 -0
  69. package/dist/prompts.cjs +2 -1
  70. package/dist/prompts.d.cts +3 -3
  71. package/dist/prompts.d.cts.map +1 -1
  72. package/dist/prompts.d.ts +3 -3
  73. package/dist/prompts.d.ts.map +1 -1
  74. package/dist/prompts.js +2 -1
  75. package/dist/{resources-x-GaokG8.js → resources-Bol20Xuo.js} +13 -1
  76. package/dist/resources-Bol20Xuo.js.map +1 -0
  77. package/dist/{resources-D6TW2ER0.cjs → resources-DNyoutxH.cjs} +13 -1
  78. package/dist/resources-DNyoutxH.cjs.map +1 -0
  79. package/dist/resources.cjs +1 -1
  80. package/dist/resources.d.cts +9 -0
  81. package/dist/resources.d.cts.map +1 -1
  82. package/dist/resources.d.ts +9 -0
  83. package/dist/resources.d.ts.map +1 -1
  84. package/dist/resources.js +1 -1
  85. package/dist/{schema-C-MLkWMc.d.ts → schema-BJv7kREf.d.cts} +178 -66
  86. package/dist/schema-BJv7kREf.d.cts.map +1 -0
  87. package/dist/{schema-B8lT632E.cjs → schema-BTfISwFu.cjs} +29 -2
  88. package/dist/schema-BTfISwFu.cjs.map +1 -0
  89. package/dist/{schema-DqxkW9Tx.d.cts → schema-BnxGHL_i.d.ts} +178 -66
  90. package/dist/schema-BnxGHL_i.d.ts.map +1 -0
  91. package/dist/{schema-DkyWSqp_.cjs → schema-BsvGMALe.cjs} +37 -6
  92. package/dist/schema-BsvGMALe.cjs.map +1 -0
  93. package/dist/{schema-CewAKS9A.js → schema-C_hp0BR7.js} +32 -7
  94. package/dist/schema-C_hp0BR7.js.map +1 -0
  95. package/dist/schema-Dv6aLZgz.js +32 -0
  96. package/dist/schema-Dv6aLZgz.js.map +1 -0
  97. package/dist/schema.cjs +3 -1
  98. package/dist/schema.d.cts +13 -3
  99. package/dist/schema.d.cts.map +1 -1
  100. package/dist/schema.d.ts +13 -3
  101. package/dist/schema.d.ts.map +1 -1
  102. package/dist/schema.js +2 -2
  103. package/dist/{server-qpWdf-ST.js → server-C7cHq_pc.js} +57 -9
  104. package/dist/server-C7cHq_pc.js.map +1 -0
  105. package/dist/{server-pGtEIwE3.cjs → server-DeutbO8v.cjs} +57 -9
  106. package/dist/server-DeutbO8v.cjs.map +1 -0
  107. package/dist/server.cjs +10 -10
  108. package/dist/server.d.cts +23 -4
  109. package/dist/server.d.cts.map +1 -1
  110. package/dist/server.d.ts +23 -4
  111. package/dist/server.d.ts.map +1 -1
  112. package/dist/server.js +10 -10
  113. package/dist/stdio-B73CCTly.cjs +47 -0
  114. package/dist/stdio-B73CCTly.cjs.map +1 -0
  115. package/dist/stdio-ZQLC-i5Q.js +41 -0
  116. package/dist/stdio-ZQLC-i5Q.js.map +1 -0
  117. package/dist/test-setup.cjs +420 -257
  118. package/dist/test-setup.cjs.map +1 -1
  119. package/dist/test-setup.js +420 -257
  120. package/dist/test-setup.js.map +1 -1
  121. package/dist/{toolDefinitions-Dp13BpEu.d.cts → toolDefinitions-BOMF-zIC.d.ts} +115 -17
  122. package/dist/toolDefinitions-BOMF-zIC.d.ts.map +1 -0
  123. package/dist/{toolDefinitions-BtHN8t_d.cjs → toolDefinitions-CUegGcWU.cjs} +117 -6
  124. package/dist/toolDefinitions-CUegGcWU.cjs.map +1 -0
  125. package/dist/{toolDefinitions-BSC2D_S-.js → toolDefinitions-DFAxp3nr.js} +117 -6
  126. package/dist/toolDefinitions-DFAxp3nr.js.map +1 -0
  127. package/dist/{toolDefinitions-fQrpWznJ.d.ts → toolDefinitions-Ipvr4Acw.d.cts} +115 -17
  128. package/dist/toolDefinitions-Ipvr4Acw.d.cts.map +1 -0
  129. package/dist/toolDefinitions.cjs +2 -2
  130. package/dist/toolDefinitions.d.cts +1 -1
  131. package/dist/toolDefinitions.d.ts +1 -1
  132. package/dist/toolDefinitions.js +2 -2
  133. package/dist/toolDefinitions.test.cjs +2 -2
  134. package/dist/toolDefinitions.test.js +2 -2
  135. package/dist/{tools-4Rtn4WEf.js → tools-DpiQwSTY.js} +137 -11
  136. package/dist/tools-DpiQwSTY.js.map +1 -0
  137. package/dist/{tools-DHHqAqP9.cjs → tools-DyOqlsCW.cjs} +137 -11
  138. package/dist/tools-DyOqlsCW.cjs.map +1 -0
  139. package/dist/tools.cjs +4 -4
  140. package/dist/tools.d.cts +91 -7
  141. package/dist/tools.d.cts.map +1 -1
  142. package/dist/tools.d.ts +91 -7
  143. package/dist/tools.d.ts.map +1 -1
  144. package/dist/tools.js +4 -4
  145. package/dist/tools.test.cjs +290 -10
  146. package/dist/tools.test.cjs.map +1 -1
  147. package/dist/tools.test.js +290 -10
  148. package/dist/tools.test.js.map +1 -1
  149. package/dist/transports/stdio.cjs +11 -11
  150. package/dist/transports/stdio.d.cts +26 -4
  151. package/dist/transports/stdio.d.cts.map +1 -1
  152. package/dist/transports/stdio.d.ts +26 -4
  153. package/dist/transports/stdio.d.ts.map +1 -1
  154. package/dist/transports/stdio.js +11 -11
  155. package/dist/{types-CfJ51LyL.d.ts → types-D5TPcOfv.d.ts} +4 -3
  156. package/dist/types-D5TPcOfv.d.ts.map +1 -0
  157. package/dist/{types-CbLyQvVe.d.cts → types-DRF2IoP_.d.cts} +4 -3
  158. package/dist/types-DRF2IoP_.d.cts.map +1 -0
  159. package/dist/{types-DuUmV9zh.d.ts → types-Daq2fm0E.d.ts} +5 -3
  160. package/dist/types-Daq2fm0E.d.ts.map +1 -0
  161. package/dist/{types-CcffrLXB.d.cts → types-NIQW7KyF.d.cts} +5 -3
  162. package/dist/types-NIQW7KyF.d.cts.map +1 -0
  163. package/dist/types.d.cts +3 -3
  164. package/dist/types.d.ts +3 -3
  165. package/dist/{version-CRzAHHGZ.cjs → version-BNmubeQI.cjs} +2 -2
  166. package/dist/{version-CRzAHHGZ.cjs.map → version-BNmubeQI.cjs.map} +1 -1
  167. package/dist/version-CRto5Sn_.js +6 -0
  168. package/dist/{version-BT9r_3jm.js.map → version-CRto5Sn_.js.map} +1 -1
  169. package/dist/version.cjs +1 -1
  170. package/dist/version.js +1 -1
  171. package/package.json +3 -3
  172. package/dist/client-Bxf4MxOz.d.cts +0 -179
  173. package/dist/client-Bxf4MxOz.d.cts.map +0 -1
  174. package/dist/client-D5xFZtxK.js +0 -224
  175. package/dist/client-D5xFZtxK.js.map +0 -1
  176. package/dist/client-DOhBiaMJ.d.ts +0 -179
  177. package/dist/client-DOhBiaMJ.d.ts.map +0 -1
  178. package/dist/client-GKHZSXgV.cjs +0 -235
  179. package/dist/client-GKHZSXgV.cjs.map +0 -1
  180. package/dist/issue-helpers-71XgJVXC.cjs.map +0 -1
  181. package/dist/issue-helpers-CSNNO03f.js.map +0 -1
  182. package/dist/promptDefinitions-D3ll3qCd.cjs.map +0 -1
  183. package/dist/promptDefinitions-DMucOchd.d.cts.map +0 -1
  184. package/dist/promptDefinitions-H0q1_X-K.d.ts.map +0 -1
  185. package/dist/promptDefinitions-aKmUZWWO.js.map +0 -1
  186. package/dist/prompts-CzD0yl7Z.js.map +0 -1
  187. package/dist/prompts-DMwoay8l.cjs.map +0 -1
  188. package/dist/resources-D6TW2ER0.cjs.map +0 -1
  189. package/dist/resources-x-GaokG8.js.map +0 -1
  190. package/dist/schema-B8lT632E.cjs.map +0 -1
  191. package/dist/schema-BkHf97d7.js +0 -17
  192. package/dist/schema-BkHf97d7.js.map +0 -1
  193. package/dist/schema-C-MLkWMc.d.ts.map +0 -1
  194. package/dist/schema-CewAKS9A.js.map +0 -1
  195. package/dist/schema-DkyWSqp_.cjs.map +0 -1
  196. package/dist/schema-DqxkW9Tx.d.cts.map +0 -1
  197. package/dist/server-pGtEIwE3.cjs.map +0 -1
  198. package/dist/server-qpWdf-ST.js.map +0 -1
  199. package/dist/stdio-D8u2W847.js +0 -19
  200. package/dist/stdio-D8u2W847.js.map +0 -1
  201. package/dist/stdio-DydB2Pxu.cjs +0 -25
  202. package/dist/stdio-DydB2Pxu.cjs.map +0 -1
  203. package/dist/toolDefinitions-BSC2D_S-.js.map +0 -1
  204. package/dist/toolDefinitions-BtHN8t_d.cjs.map +0 -1
  205. package/dist/toolDefinitions-Dp13BpEu.d.cts.map +0 -1
  206. package/dist/toolDefinitions-fQrpWznJ.d.ts.map +0 -1
  207. package/dist/tools-4Rtn4WEf.js.map +0 -1
  208. package/dist/tools-DHHqAqP9.cjs.map +0 -1
  209. package/dist/types-CbLyQvVe.d.cts.map +0 -1
  210. package/dist/types-CcffrLXB.d.cts.map +0 -1
  211. package/dist/types-CfJ51LyL.d.ts.map +0 -1
  212. package/dist/types-DuUmV9zh.d.ts.map +0 -1
  213. package/dist/version-BT9r_3jm.js +0 -6
@@ -347,8 +347,8 @@ function isNodeProcess() {
347
347
  //#region ../../node_modules/.pnpm/@open-draft+logger@0.3.0/node_modules/@open-draft/logger/lib/index.mjs
348
348
  var __defProp$4 = Object.defineProperty;
349
349
  var __export = (target, all) => {
350
- for (var name in all) __defProp$4(target, name, {
351
- get: all[name],
350
+ for (var name$2 in all) __defProp$4(target, name$2, {
351
+ get: all[name$2],
352
352
  enumerable: true
353
353
  });
354
354
  };
@@ -377,8 +377,8 @@ function green(text) {
377
377
  }
378
378
  var IS_NODE$1 = isNodeProcess();
379
379
  var Logger = class {
380
- constructor(name) {
381
- this.name = name;
380
+ constructor(name$2) {
381
+ this.name = name$2;
382
382
  this.prefix = `[${this.name}]`;
383
383
  const LOGGER_NAME = getVariable("DEBUG");
384
384
  const LOGGER_LEVEL = getVariable("LOG_LEVEL");
@@ -1284,9 +1284,9 @@ var MockHttpSocket = class extends MockSocket {
1284
1284
  const chunkBeforeRequestHeaders = chunkString.slice(0, chunkString.indexOf("\r\n") + 2);
1285
1285
  const chunkAfterRequestHeaders = chunkString.slice(chunk.indexOf("\r\n\r\n"));
1286
1286
  const rawRequestHeaders = getRawFetchHeaders(this.request.headers);
1287
- const requestHeadersString = rawRequestHeaders.filter(([name]) => {
1288
- return name.toLowerCase() !== INTERNAL_REQUEST_ID_HEADER_NAME;
1289
- }).map(([name, value]) => `${name}: ${value}`).join("\r\n");
1287
+ const requestHeadersString = rawRequestHeaders.filter(([name$2]) => {
1288
+ return name$2.toLowerCase() !== INTERNAL_REQUEST_ID_HEADER_NAME;
1289
+ }).map(([name$2, value]) => `${name$2}: ${value}`).join("\r\n");
1290
1290
  const headersChunk = `${chunkBeforeRequestHeaders}${requestHeadersString}${chunkAfterRequestHeaders}`;
1291
1291
  socket.write(headersChunk, encoding, callback);
1292
1292
  headersWritten = true;
@@ -1976,9 +1976,9 @@ function createHeadersFromXMLHttpReqestHeaders(headersString) {
1976
1976
  const lines = headersString.split(/[\r\n]+/);
1977
1977
  for (const line of lines) {
1978
1978
  if (line.trim() === "") continue;
1979
- const [name, ...parts] = line.split(": ");
1979
+ const [name$2, ...parts] = line.split(": ");
1980
1980
  const value = parts.join(": ");
1981
- headers.append(name, value);
1981
+ headers.append(name$2, value);
1982
1982
  }
1983
1983
  return headers;
1984
1984
  }
@@ -2037,9 +2037,9 @@ var XMLHttpRequestController = class {
2037
2037
  return invoke();
2038
2038
  }
2039
2039
  case "setRequestHeader": {
2040
- const [name, value] = args;
2041
- this.requestHeaders.set(name, value);
2042
- this.logger.info("setRequestHeader", name, value);
2040
+ const [name$2, value] = args;
2041
+ this.requestHeaders.set(name$2, value);
2042
+ this.logger.info("setRequestHeader", name$2, value);
2043
2043
  return invoke();
2044
2044
  }
2045
2045
  case "send": {
@@ -13180,8 +13180,8 @@ var require_memstore = __commonJS$4({ "node_modules/tough-cookie/lib/memstore.js
13180
13180
  "removeCookies",
13181
13181
  "removeAllCookies",
13182
13182
  "getAllCookies"
13183
- ].forEach((name) => {
13184
- MemoryCookieStore$1.prototype[name] = fromCallback(MemoryCookieStore$1.prototype[name]);
13183
+ ].forEach((name$2) => {
13184
+ MemoryCookieStore$1.prototype[name$2] = fromCallback(MemoryCookieStore$1.prototype[name$2]);
13185
13185
  });
13186
13186
  exports$1.MemoryCookieStore = MemoryCookieStore$1;
13187
13187
  function inspectFallback(val) {
@@ -14117,8 +14117,8 @@ var require_cookie$1 = __commonJS$4({ "node_modules/tough-cookie/lib/cookie.js"(
14117
14117
  "removeAllCookies",
14118
14118
  "serialize",
14119
14119
  "setCookie"
14120
- ].forEach((name) => {
14121
- CookieJar$1.prototype[name] = fromCallback(CookieJar$1.prototype[name]);
14120
+ ].forEach((name$2) => {
14121
+ CookieJar$1.prototype[name$2] = fromCallback(CookieJar$1.prototype[name$2]);
14122
14122
  });
14123
14123
  CookieJar$1.deserialize = fromCallback(CookieJar$1.deserialize);
14124
14124
  function syncWrap(method) {
@@ -14678,7 +14678,7 @@ var require_set_cookie = __commonJS$2({ "node_modules/set-cookie-parser/lib/set-
14678
14678
  var parts = setCookieValue.split(";").filter(isNonEmptyString);
14679
14679
  var nameValuePairStr = parts.shift();
14680
14680
  var parsed = parseNameValuePair(nameValuePairStr);
14681
- var name = parsed.name;
14681
+ var name$2 = parsed.name;
14682
14682
  var value = parsed.value;
14683
14683
  options = options ? Object.assign({}, defaultParseOptions, options) : defaultParseOptions;
14684
14684
  try {
@@ -14687,7 +14687,7 @@ var require_set_cookie = __commonJS$2({ "node_modules/set-cookie-parser/lib/set-
14687
14687
  console.error("set-cookie-parser encountered an error while decoding a cookie with value '" + value + "'. Set options.decodeValues to false to disable this feature.", e);
14688
14688
  }
14689
14689
  var cookie = {
14690
- name,
14690
+ name: name$2,
14691
14691
  value
14692
14692
  };
14693
14693
  parts.forEach(function(part) {
@@ -14704,15 +14704,15 @@ var require_set_cookie = __commonJS$2({ "node_modules/set-cookie-parser/lib/set-
14704
14704
  return cookie;
14705
14705
  }
14706
14706
  function parseNameValuePair(nameValuePairStr) {
14707
- var name = "";
14707
+ var name$2 = "";
14708
14708
  var value = "";
14709
14709
  var nameValueArr = nameValuePairStr.split("=");
14710
14710
  if (nameValueArr.length > 1) {
14711
- name = nameValueArr.shift();
14711
+ name$2 = nameValueArr.shift();
14712
14712
  value = nameValueArr.join("=");
14713
14713
  } else value = nameValuePairStr;
14714
14714
  return {
14715
- name,
14715
+ name: name$2,
14716
14716
  value
14717
14717
  };
14718
14718
  }
@@ -14791,9 +14791,9 @@ var require_set_cookie = __commonJS$2({ "node_modules/set-cookie-parser/lib/set-
14791
14791
  } });
14792
14792
  var import_set_cookie_parser = __toESM$2(require_set_cookie());
14793
14793
  var HEADERS_INVALID_CHARACTERS = /[^a-z0-9\-#$%&'*+.^_`|~]/i;
14794
- function normalizeHeaderName(name) {
14795
- if (HEADERS_INVALID_CHARACTERS.test(name) || name.trim() === "") throw new TypeError("Invalid character in header field name");
14796
- return name.trim().toLowerCase();
14794
+ function normalizeHeaderName(name$2) {
14795
+ if (HEADERS_INVALID_CHARACTERS.test(name$2) || name$2.trim() === "") throw new TypeError("Invalid character in header field name");
14796
+ return name$2.trim().toLowerCase();
14797
14797
  }
14798
14798
  var charCodesToRemove = [
14799
14799
  String.fromCharCode(10),
@@ -14858,72 +14858,72 @@ var Headers$1 = class _Headers {
14858
14858
  this[_c] = "Headers";
14859
14859
  if (["Headers", "HeadersPolyfill"].includes(init?.constructor.name) || init instanceof _Headers || typeof globalThis.Headers !== "undefined" && init instanceof globalThis.Headers) {
14860
14860
  const initialHeaders = init;
14861
- initialHeaders.forEach((value, name) => {
14862
- this.append(name, value);
14861
+ initialHeaders.forEach((value, name$2) => {
14862
+ this.append(name$2, value);
14863
14863
  }, this);
14864
- } else if (Array.isArray(init)) init.forEach(([name, value]) => {
14865
- this.append(name, Array.isArray(value) ? value.join(HEADER_VALUE_DELIMITER) : value);
14864
+ } else if (Array.isArray(init)) init.forEach(([name$2, value]) => {
14865
+ this.append(name$2, Array.isArray(value) ? value.join(HEADER_VALUE_DELIMITER) : value);
14866
14866
  });
14867
- else if (init) Object.getOwnPropertyNames(init).forEach((name) => {
14868
- const value = init[name];
14869
- this.append(name, Array.isArray(value) ? value.join(HEADER_VALUE_DELIMITER) : value);
14867
+ else if (init) Object.getOwnPropertyNames(init).forEach((name$2) => {
14868
+ const value = init[name$2];
14869
+ this.append(name$2, Array.isArray(value) ? value.join(HEADER_VALUE_DELIMITER) : value);
14870
14870
  });
14871
14871
  }
14872
14872
  [(_a = NORMALIZED_HEADERS, _b = RAW_HEADER_NAMES, _c = Symbol.toStringTag, Symbol.iterator)]() {
14873
14873
  return this.entries();
14874
14874
  }
14875
14875
  *keys() {
14876
- for (const [name] of this.entries()) yield name;
14876
+ for (const [name$2] of this.entries()) yield name$2;
14877
14877
  }
14878
14878
  *values() {
14879
14879
  for (const [, value] of this.entries()) yield value;
14880
14880
  }
14881
14881
  *entries() {
14882
14882
  let sortedKeys = Object.keys(this[NORMALIZED_HEADERS]).sort((a, b) => a.localeCompare(b));
14883
- for (const name of sortedKeys) if (name === "set-cookie") for (const value of this.getSetCookie()) yield [name, value];
14884
- else yield [name, this.get(name)];
14883
+ for (const name$2 of sortedKeys) if (name$2 === "set-cookie") for (const value of this.getSetCookie()) yield [name$2, value];
14884
+ else yield [name$2, this.get(name$2)];
14885
14885
  }
14886
14886
  /**
14887
14887
  * Returns a boolean stating whether a `Headers` object contains a certain header.
14888
14888
  */
14889
- has(name) {
14890
- if (!isValidHeaderName(name)) throw new TypeError(`Invalid header name "${name}"`);
14891
- return this[NORMALIZED_HEADERS].hasOwnProperty(normalizeHeaderName(name));
14889
+ has(name$2) {
14890
+ if (!isValidHeaderName(name$2)) throw new TypeError(`Invalid header name "${name$2}"`);
14891
+ return this[NORMALIZED_HEADERS].hasOwnProperty(normalizeHeaderName(name$2));
14892
14892
  }
14893
14893
  /**
14894
14894
  * Returns a `ByteString` sequence of all the values of a header with a given name.
14895
14895
  */
14896
- get(name) {
14897
- if (!isValidHeaderName(name)) throw TypeError(`Invalid header name "${name}"`);
14898
- return this[NORMALIZED_HEADERS][normalizeHeaderName(name)] ?? null;
14896
+ get(name$2) {
14897
+ if (!isValidHeaderName(name$2)) throw TypeError(`Invalid header name "${name$2}"`);
14898
+ return this[NORMALIZED_HEADERS][normalizeHeaderName(name$2)] ?? null;
14899
14899
  }
14900
14900
  /**
14901
14901
  * Sets a new value for an existing header inside a `Headers` object, or adds the header if it does not already exist.
14902
14902
  */
14903
- set(name, value) {
14904
- if (!isValidHeaderName(name) || !isValidHeaderValue(value)) return;
14905
- const normalizedName = normalizeHeaderName(name);
14903
+ set(name$2, value) {
14904
+ if (!isValidHeaderName(name$2) || !isValidHeaderValue(value)) return;
14905
+ const normalizedName = normalizeHeaderName(name$2);
14906
14906
  const normalizedValue = normalizeHeaderValue(value);
14907
14907
  this[NORMALIZED_HEADERS][normalizedName] = normalizeHeaderValue(normalizedValue);
14908
- this[RAW_HEADER_NAMES].set(normalizedName, name);
14908
+ this[RAW_HEADER_NAMES].set(normalizedName, name$2);
14909
14909
  }
14910
14910
  /**
14911
14911
  * Appends a new value onto an existing header inside a `Headers` object, or adds the header if it does not already exist.
14912
14912
  */
14913
- append(name, value) {
14914
- if (!isValidHeaderName(name) || !isValidHeaderValue(value)) return;
14915
- const normalizedName = normalizeHeaderName(name);
14913
+ append(name$2, value) {
14914
+ if (!isValidHeaderName(name$2) || !isValidHeaderValue(value)) return;
14915
+ const normalizedName = normalizeHeaderName(name$2);
14916
14916
  const normalizedValue = normalizeHeaderValue(value);
14917
14917
  let resolvedValue = this.has(normalizedName) ? `${this.get(normalizedName)}, ${normalizedValue}` : normalizedValue;
14918
- this.set(name, resolvedValue);
14918
+ this.set(name$2, resolvedValue);
14919
14919
  }
14920
14920
  /**
14921
14921
  * Deletes a header from the `Headers` object.
14922
14922
  */
14923
- delete(name) {
14924
- if (!isValidHeaderName(name)) return;
14925
- if (!this.has(name)) return;
14926
- const normalizedName = normalizeHeaderName(name);
14923
+ delete(name$2) {
14924
+ if (!isValidHeaderName(name$2)) return;
14925
+ if (!this.has(name$2)) return;
14926
+ const normalizedName = normalizeHeaderName(name$2);
14927
14927
  delete this[NORMALIZED_HEADERS][normalizedName];
14928
14928
  this[RAW_HEADER_NAMES].delete(normalizedName);
14929
14929
  }
@@ -14932,7 +14932,7 @@ var Headers$1 = class _Headers {
14932
14932
  * calling the given callback for each header.
14933
14933
  */
14934
14934
  forEach(callback, thisArg) {
14935
- for (const [name, value] of this.entries()) callback.call(thisArg, value, name, this);
14935
+ for (const [name$2, value] of this.entries()) callback.call(thisArg, value, name$2, this);
14936
14936
  }
14937
14937
  /**
14938
14938
  * Returns an array containing the values
@@ -15135,21 +15135,21 @@ var require_dist = __commonJS({ "../../node_modules/.pnpm/path-to-regexp@6.3.0/n
15135
15135
  continue;
15136
15136
  }
15137
15137
  if (char === ":") {
15138
- var name = "";
15138
+ var name$2 = "";
15139
15139
  var j = i + 1;
15140
15140
  while (j < str.length) {
15141
15141
  var code = str.charCodeAt(j);
15142
15142
  if (code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || code === 95) {
15143
- name += str[j++];
15143
+ name$2 += str[j++];
15144
15144
  continue;
15145
15145
  }
15146
15146
  break;
15147
15147
  }
15148
- if (!name) throw new TypeError("Missing parameter name at ".concat(i));
15148
+ if (!name$2) throw new TypeError("Missing parameter name at ".concat(i));
15149
15149
  tokens.push({
15150
15150
  type: "NAME",
15151
15151
  index: i,
15152
- value: name
15152
+ value: name$2
15153
15153
  });
15154
15154
  i = j;
15155
15155
  continue;
@@ -15241,9 +15241,9 @@ var require_dist = __commonJS({ "../../node_modules/.pnpm/path-to-regexp@6.3.0/n
15241
15241
  };
15242
15242
  while (i < tokens.length) {
15243
15243
  var char = tryConsume("CHAR");
15244
- var name = tryConsume("NAME");
15244
+ var name$2 = tryConsume("NAME");
15245
15245
  var pattern = tryConsume("PATTERN");
15246
- if (name || pattern) {
15246
+ if (name$2 || pattern) {
15247
15247
  var prefix = char || "";
15248
15248
  if (prefixes.indexOf(prefix) === -1) {
15249
15249
  path += prefix;
@@ -15254,7 +15254,7 @@ var require_dist = __commonJS({ "../../node_modules/.pnpm/path-to-regexp@6.3.0/n
15254
15254
  path = "";
15255
15255
  }
15256
15256
  result.push({
15257
- name: name || key++,
15257
+ name: name$2 || key++,
15258
15258
  prefix,
15259
15259
  suffix: "",
15260
15260
  pattern: pattern || safePattern(prefix),
@@ -15304,7 +15304,7 @@ var require_dist = __commonJS({ "../../node_modules/.pnpm/path-to-regexp@6.3.0/n
15304
15304
  */
15305
15305
  function tokensToFunction(tokens, options) {
15306
15306
  if (options === void 0) options = {};
15307
- var reFlags = flags(options);
15307
+ var reFlags = flags$1(options);
15308
15308
  var _a$1 = options.encode, encode = _a$1 === void 0 ? function(x) {
15309
15309
  return x;
15310
15310
  } : _a$1, _b$1 = options.validate, validate = _b$1 === void 0 ? true : _b$1;
@@ -15397,7 +15397,7 @@ var require_dist = __commonJS({ "../../node_modules/.pnpm/path-to-regexp@6.3.0/n
15397
15397
  /**
15398
15398
  * Get the flags for a regexp from the options.
15399
15399
  */
15400
- function flags(options) {
15400
+ function flags$1(options) {
15401
15401
  return options && options.sensitive ? "" : "i";
15402
15402
  }
15403
15403
  /**
@@ -15427,7 +15427,7 @@ var require_dist = __commonJS({ "../../node_modules/.pnpm/path-to-regexp@6.3.0/n
15427
15427
  var parts = paths.map(function(path) {
15428
15428
  return pathToRegexp(path, keys, options).source;
15429
15429
  });
15430
- return new RegExp("(?:".concat(parts.join("|"), ")"), flags(options));
15430
+ return new RegExp("(?:".concat(parts.join("|"), ")"), flags$1(options));
15431
15431
  }
15432
15432
  /**
15433
15433
  * Create a path regexp from string input.
@@ -15474,7 +15474,7 @@ var require_dist = __commonJS({ "../../node_modules/.pnpm/path-to-regexp@6.3.0/n
15474
15474
  if (!strict) route += "(?:".concat(delimiterRe, "(?=").concat(endsWithRe, "))?");
15475
15475
  if (!isEndDelimited) route += "(?=".concat(delimiterRe, "|").concat(endsWithRe, ")");
15476
15476
  }
15477
- return new RegExp(route, flags(options));
15477
+ return new RegExp(route, flags$1(options));
15478
15478
  }
15479
15479
  exports.tokensToRegexp = tokensToRegexp;
15480
15480
  /**
@@ -16723,13 +16723,13 @@ var require_cookie = __commonJS$1({ "node_modules/cookie/index.js"(exports$1) {
16723
16723
  }
16724
16724
  return min;
16725
16725
  }
16726
- function serialize(name, val, opt) {
16726
+ function serialize(name$2, val, opt) {
16727
16727
  var enc = opt && opt.encode || encodeURIComponent;
16728
16728
  if (typeof enc !== "function") throw new TypeError("option encode is invalid");
16729
- if (!cookieNameRegExp.test(name)) throw new TypeError("argument name is invalid");
16729
+ if (!cookieNameRegExp.test(name$2)) throw new TypeError("argument name is invalid");
16730
16730
  var value = enc(val);
16731
16731
  if (!cookieValueRegExp.test(value)) throw new TypeError("argument val is invalid");
16732
- var str = name + "=" + value;
16732
+ var str = name$2 + "=" + value;
16733
16733
  if (!opt) return str;
16734
16734
  if (null != opt.maxAge) {
16735
16735
  var maxAge = Math.floor(opt.maxAge);
@@ -16840,7 +16840,7 @@ function getAllRequestCookies(request) {
16840
16840
  const requestCookieHeader = request.headers.get("cookie");
16841
16841
  const cookiesFromHeaders = requestCookieHeader ? parseCookies(requestCookieHeader) : {};
16842
16842
  const cookiesFromDocument = getDocumentCookies(request);
16843
- for (const name in cookiesFromDocument) request.headers.append("cookie", source_default.serialize(name, cookiesFromDocument[name]));
16843
+ for (const name$2 in cookiesFromDocument) request.headers.append("cookie", source_default.serialize(name$2, cookiesFromDocument[name$2]));
16844
16844
  const cookiesFromStore = cookieStore.getCookiesSync(request.url);
16845
16845
  const storedCookiesObject = Object.fromEntries(cookiesFromStore.map((cookie) => [cookie.key, cookie.value]));
16846
16846
  for (const cookie of cookiesFromStore) request.headers.append("cookie", cookie.toString());
@@ -17473,7 +17473,7 @@ var autofix_state_default = { autofix };
17473
17473
 
17474
17474
  //#endregion
17475
17475
  //#region ../mcp-server-mocks/dist/fixtures/issue.json
17476
- var id$1 = "6507376925";
17476
+ var id$3 = "6507376925";
17477
17477
  var shareId = null;
17478
17478
  var shortId = "CLOUDFLARE-MCP-41";
17479
17479
  var title$1 = "Error: Tool list_organizations is already registered";
@@ -17485,7 +17485,7 @@ var status = "unresolved";
17485
17485
  var statusDetails = {};
17486
17486
  var substatus = "ongoing";
17487
17487
  var isPublic = false;
17488
- var platform$1 = "javascript";
17488
+ var platform$2 = "javascript";
17489
17489
  var project = {
17490
17490
  "id": "4509062593708032",
17491
17491
  "name": "CLOUDFLARE-MCP",
@@ -17510,7 +17510,7 @@ var metadata$1 = {
17510
17510
  };
17511
17511
  var numComments = 0;
17512
17512
  var assignedTo = null;
17513
- var isBookmarked = false;
17513
+ var isBookmarked$1 = false;
17514
17514
  var isSubscribed = false;
17515
17515
  var subscriptionDetails = null;
17516
17516
  var hasSeen = true;
@@ -17652,7 +17652,7 @@ var stats = {
17652
17652
  };
17653
17653
  var participants = [];
17654
17654
  var issue_default = {
17655
- id: id$1,
17655
+ id: id$3,
17656
17656
  shareId,
17657
17657
  shortId,
17658
17658
  title: title$1,
@@ -17664,13 +17664,13 @@ var issue_default = {
17664
17664
  statusDetails,
17665
17665
  substatus,
17666
17666
  isPublic,
17667
- platform: platform$1,
17667
+ platform: platform$2,
17668
17668
  project,
17669
17669
  type: type$1,
17670
17670
  metadata: metadata$1,
17671
17671
  numComments,
17672
17672
  assignedTo,
17673
- isBookmarked,
17673
+ isBookmarked: isBookmarked$1,
17674
17674
  isSubscribed,
17675
17675
  subscriptionDetails,
17676
17676
  hasSeen,
@@ -17699,7 +17699,7 @@ var issue_default = {
17699
17699
 
17700
17700
  //#endregion
17701
17701
  //#region ../mcp-server-mocks/dist/fixtures/event.json
17702
- var id = "7ca573c0f4814912aaa9bdc77d1a7d51";
17702
+ var id$2 = "7ca573c0f4814912aaa9bdc77d1a7d51";
17703
17703
  var groupID = "6507376925";
17704
17704
  var eventID = "7ca573c0f4814912aaa9bdc77d1a7d51";
17705
17705
  var projectID = "4509062593708032";
@@ -17968,7 +17968,7 @@ var tags = [
17968
17968
  "value": "https://mcp.sentry.dev/sse"
17969
17969
  }
17970
17970
  ];
17971
- var platform = "javascript";
17971
+ var platform$1 = "javascript";
17972
17972
  var dateReceived = "2025-04-08T21:15:04.700878Z";
17973
17973
  var errors = [{
17974
17974
  "type": "js_no_source",
@@ -18015,7 +18015,7 @@ var _meta = {
18015
18015
  };
18016
18016
  var crashFile = null;
18017
18017
  var culprit = "Object.fetch(index)";
18018
- var dateCreated = "2025-04-08T21:15:04Z";
18018
+ var dateCreated$2 = "2025-04-08T21:15:04Z";
18019
18019
  var fingerprints = ["60d1c667b173018c004e399b29dc927d"];
18020
18020
  var groupingConfig = {
18021
18021
  "enhancements": "KLUv_SAYwQAAkwKRs25ld3N0eWxlOjIwMjMtMDEtMTGQ",
@@ -18028,7 +18028,7 @@ var resolvedWith = [null];
18028
18028
  var nextEventID = null;
18029
18029
  var previousEventID = "b7ed18493f4f4817a217b03839d4c017";
18030
18030
  var event_default = {
18031
- id,
18031
+ id: id$2,
18032
18032
  groupID,
18033
18033
  eventID,
18034
18034
  projectID,
@@ -18046,14 +18046,14 @@ var event_default = {
18046
18046
  type,
18047
18047
  metadata,
18048
18048
  tags,
18049
- platform,
18049
+ platform: platform$1,
18050
18050
  dateReceived,
18051
18051
  errors,
18052
18052
  occurrence,
18053
18053
  _meta,
18054
18054
  crashFile,
18055
18055
  culprit,
18056
- dateCreated,
18056
+ dateCreated: dateCreated$2,
18057
18057
  fingerprints,
18058
18058
  groupingConfig,
18059
18059
  release,
@@ -18164,8 +18164,173 @@ var tags_default = [
18164
18164
  }
18165
18165
  ];
18166
18166
 
18167
+ //#endregion
18168
+ //#region ../mcp-server-mocks/dist/fixtures/project.json
18169
+ var team = {
18170
+ "id": "4509106733776896",
18171
+ "slug": "the-goats",
18172
+ "name": "the-goats"
18173
+ };
18174
+ var teams = [{
18175
+ "id": "4509106733776896",
18176
+ "slug": "the-goats",
18177
+ "name": "the-goats"
18178
+ }];
18179
+ var id$1 = "4509109104082945";
18180
+ var name$1 = "cloudflare-mcp";
18181
+ var slug$1 = "cloudflare-mcp";
18182
+ var isBookmarked = false;
18183
+ var isMember$1 = true;
18184
+ var access$1 = [
18185
+ "event:admin",
18186
+ "alerts:read",
18187
+ "project:write",
18188
+ "org:integrations",
18189
+ "alerts:write",
18190
+ "member:read",
18191
+ "team:write",
18192
+ "project:read",
18193
+ "event:read",
18194
+ "event:write",
18195
+ "project:admin",
18196
+ "org:read",
18197
+ "team:admin",
18198
+ "project:releases",
18199
+ "team:read"
18200
+ ];
18201
+ var hasAccess$1 = true;
18202
+ var dateCreated$1 = "2025-04-06T14:13:37.825970Z";
18203
+ var environments = [];
18204
+ var eventProcessing = { "symbolicationDegraded": false };
18205
+ var features = [
18206
+ "discard-groups",
18207
+ "alert-filters",
18208
+ "similarity-embeddings",
18209
+ "similarity-indexing",
18210
+ "similarity-view"
18211
+ ];
18212
+ var firstEvent = null;
18213
+ var firstTransactionEvent = false;
18214
+ var hasSessions = false;
18215
+ var hasProfiles = false;
18216
+ var hasReplays = false;
18217
+ var hasFeedbacks = false;
18218
+ var hasNewFeedbacks = false;
18219
+ var hasMonitors = false;
18220
+ var hasMinifiedStackTrace = false;
18221
+ var hasInsightsHttp = false;
18222
+ var hasInsightsDb = false;
18223
+ var hasInsightsAssets = false;
18224
+ var hasInsightsAppStart = false;
18225
+ var hasInsightsScreenLoad = false;
18226
+ var hasInsightsVitals = false;
18227
+ var hasInsightsCaches = false;
18228
+ var hasInsightsQueues = false;
18229
+ var hasInsightsLlmMonitoring = false;
18230
+ var platform = "node";
18231
+ var platforms = [];
18232
+ var latestRelease = null;
18233
+ var hasUserReports = false;
18234
+ var hasFlags = false;
18235
+ var latestDeploys = null;
18236
+ var project_default = {
18237
+ team,
18238
+ teams,
18239
+ id: id$1,
18240
+ name: name$1,
18241
+ slug: slug$1,
18242
+ isBookmarked,
18243
+ isMember: isMember$1,
18244
+ access: access$1,
18245
+ hasAccess: hasAccess$1,
18246
+ dateCreated: dateCreated$1,
18247
+ environments,
18248
+ eventProcessing,
18249
+ features,
18250
+ firstEvent,
18251
+ firstTransactionEvent,
18252
+ hasSessions,
18253
+ hasProfiles,
18254
+ hasReplays,
18255
+ hasFeedbacks,
18256
+ hasNewFeedbacks,
18257
+ hasMonitors,
18258
+ hasMinifiedStackTrace,
18259
+ hasInsightsHttp,
18260
+ hasInsightsDb,
18261
+ hasInsightsAssets,
18262
+ hasInsightsAppStart,
18263
+ hasInsightsScreenLoad,
18264
+ hasInsightsVitals,
18265
+ hasInsightsCaches,
18266
+ hasInsightsQueues,
18267
+ hasInsightsLlmMonitoring,
18268
+ platform,
18269
+ platforms,
18270
+ latestRelease,
18271
+ hasUserReports,
18272
+ hasFlags,
18273
+ latestDeploys
18274
+ };
18275
+
18276
+ //#endregion
18277
+ //#region ../mcp-server-mocks/dist/fixtures/team.json
18278
+ var id = "4509106740854784";
18279
+ var slug = "the-goats";
18280
+ var name = "the-goats";
18281
+ var dateCreated = "2025-04-06T14:11:23.961739Z";
18282
+ var isMember = true;
18283
+ var teamRole = "admin";
18284
+ var flags = { "idp:provisioned": false };
18285
+ var access = [
18286
+ "team:read",
18287
+ "alerts:read",
18288
+ "event:write",
18289
+ "team:write",
18290
+ "team:admin",
18291
+ "event:read",
18292
+ "org:read",
18293
+ "member:read",
18294
+ "project:admin",
18295
+ "project:write",
18296
+ "org:integrations",
18297
+ "project:releases",
18298
+ "alerts:write",
18299
+ "event:admin",
18300
+ "project:read"
18301
+ ];
18302
+ var hasAccess = true;
18303
+ var isPending = false;
18304
+ var memberCount = 1;
18305
+ var avatar = {
18306
+ "avatarType": "letter_avatar",
18307
+ "avatarUuid": null
18308
+ };
18309
+ var externalTeams = [];
18310
+ var projects = [];
18311
+ var team_default = {
18312
+ id,
18313
+ slug,
18314
+ name,
18315
+ dateCreated,
18316
+ isMember,
18317
+ teamRole,
18318
+ flags,
18319
+ access,
18320
+ hasAccess,
18321
+ isPending,
18322
+ memberCount,
18323
+ avatar,
18324
+ externalTeams,
18325
+ projects
18326
+ };
18327
+
18167
18328
  //#endregion
18168
18329
  //#region ../mcp-server-mocks/dist/index.js
18330
+ /**
18331
+ * Standard organization payload for mock responses.
18332
+ * Used across multiple endpoints for consistency.
18333
+ */
18169
18334
  const OrganizationPayload = {
18170
18335
  id: "4509106740723712",
18171
18336
  slug: "sentry-mcp-evals",
@@ -18175,6 +18340,10 @@ const OrganizationPayload = {
18175
18340
  organizationUrl: "https://sentry.io/sentry-mcp-evals"
18176
18341
  }
18177
18342
  };
18343
+ /**
18344
+ * Standard release payload for mock responses.
18345
+ * Includes typical metadata and project associations.
18346
+ */
18178
18347
  const ReleasePayload = {
18179
18348
  id: 1402755016,
18180
18349
  version: "8ce89484-0fec-4913-a2cd-e8e2d41dee36",
@@ -18415,13 +18584,53 @@ const EventsSpansPayload = {
18415
18584
  {}
18416
18585
  ]
18417
18586
  };
18587
+ /**
18588
+ * Builds MSW handlers for both SaaS and self-hosted Sentry instances.
18589
+ *
18590
+ * Creates handlers based on the controlOnly flag:
18591
+ * - controlOnly: false (default) - Creates handlers for both sentry.io and us.sentry.io
18592
+ * - controlOnly: true - Creates handlers only for sentry.io (main host)
18593
+ *
18594
+ * @param handlers - Array of handler definitions with method, path, fetch function, and optional controlOnly flag
18595
+ * @returns Array of MSW http handlers
18596
+ *
18597
+ * @example Handler Definitions
18598
+ * ```typescript
18599
+ * buildHandlers([
18600
+ * {
18601
+ * method: "get",
18602
+ * path: "/api/0/auth/",
18603
+ * fetch: () => HttpResponse.json({ user: "data" }),
18604
+ * controlOnly: true // Only available on sentry.io
18605
+ * },
18606
+ * {
18607
+ * method: "get",
18608
+ * path: "/api/0/organizations/",
18609
+ * fetch: () => HttpResponse.json([OrganizationPayload]),
18610
+ * controlOnly: false // Available on both sentry.io and us.sentry.io
18611
+ * }
18612
+ * ]);
18613
+ * ```
18614
+ */
18418
18615
  function buildHandlers(handlers) {
18419
- return [...handlers.map((handler) => http[handler.method](`https://us.sentry.io${handler.path}`, handler.fetch)), ...handlers.map((handler) => http[handler.method](`https://sentry.io${handler.path}`, handler.fetch))];
18616
+ const result = [];
18617
+ for (const handler of handlers) {
18618
+ result.push(http[handler.method](`https://sentry.io${handler.path}`, handler.fetch));
18619
+ if (!handler.controlOnly) result.push(http[handler.method](`https://us.sentry.io${handler.path}`, handler.fetch));
18620
+ }
18621
+ return result;
18420
18622
  }
18623
+ /**
18624
+ * Complete set of Sentry API mock handlers.
18625
+ *
18626
+ * Covers all endpoints used by the MCP server with realistic responses,
18627
+ * parameter validation, and error scenarios.
18628
+ */
18421
18629
  const restHandlers = buildHandlers([
18422
18630
  {
18423
18631
  method: "get",
18424
18632
  path: "/api/0/auth/",
18633
+ controlOnly: true,
18425
18634
  fetch: () => {
18426
18635
  return HttpResponse.json({
18427
18636
  id: "1",
@@ -18433,6 +18642,7 @@ const restHandlers = buildHandlers([
18433
18642
  {
18434
18643
  method: "get",
18435
18644
  path: "/api/0/users/me/regions/",
18645
+ controlOnly: true,
18436
18646
  fetch: () => {
18437
18647
  return HttpResponse.json({ regions: [{
18438
18648
  name: "us",
@@ -18458,41 +18668,7 @@ const restHandlers = buildHandlers([
18458
18668
  method: "get",
18459
18669
  path: "/api/0/organizations/sentry-mcp-evals/teams/",
18460
18670
  fetch: () => {
18461
- return HttpResponse.json([{
18462
- id: "4509106740854784",
18463
- slug: "the-goats",
18464
- name: "the-goats",
18465
- dateCreated: "2025-04-06T14:11:23.961739Z",
18466
- isMember: true,
18467
- teamRole: "admin",
18468
- flags: { "idp:provisioned": false },
18469
- access: [
18470
- "team:read",
18471
- "alerts:read",
18472
- "event:write",
18473
- "team:write",
18474
- "team:admin",
18475
- "event:read",
18476
- "org:read",
18477
- "member:read",
18478
- "project:admin",
18479
- "project:write",
18480
- "org:integrations",
18481
- "project:releases",
18482
- "alerts:write",
18483
- "event:admin",
18484
- "project:read"
18485
- ],
18486
- hasAccess: true,
18487
- isPending: false,
18488
- memberCount: 1,
18489
- avatar: {
18490
- avatarType: "letter_avatar",
18491
- avatarUuid: null
18492
- },
18493
- externalTeams: [],
18494
- projects: []
18495
- }]);
18671
+ return HttpResponse.json([team_default]);
18496
18672
  }
18497
18673
  },
18498
18674
  {
@@ -18500,73 +18676,8 @@ const restHandlers = buildHandlers([
18500
18676
  path: "/api/0/organizations/sentry-mcp-evals/projects/",
18501
18677
  fetch: () => {
18502
18678
  return HttpResponse.json([{
18503
- team: {
18504
- id: "4509106733776896",
18505
- slug: "the-goats",
18506
- name: "the-goats"
18507
- },
18508
- teams: [{
18509
- id: "4509106733776896",
18510
- slug: "the-goats",
18511
- name: "the-goats"
18512
- }],
18513
- id: "4509106749636608",
18514
- name: "cloudflare-mcp",
18515
- slug: "cloudflare-mcp",
18516
- isBookmarked: false,
18517
- isMember: true,
18518
- access: [
18519
- "event:admin",
18520
- "alerts:read",
18521
- "project:write",
18522
- "org:integrations",
18523
- "alerts:write",
18524
- "member:read",
18525
- "team:write",
18526
- "project:read",
18527
- "event:read",
18528
- "event:write",
18529
- "project:admin",
18530
- "org:read",
18531
- "team:admin",
18532
- "project:releases",
18533
- "team:read"
18534
- ],
18535
- hasAccess: true,
18536
- dateCreated: "2025-04-06T14:13:37.825970Z",
18537
- environments: [],
18538
- eventProcessing: { symbolicationDegraded: false },
18539
- features: [
18540
- "discard-groups",
18541
- "alert-filters",
18542
- "similarity-embeddings",
18543
- "similarity-indexing",
18544
- "similarity-view"
18545
- ],
18546
- firstEvent: null,
18547
- firstTransactionEvent: false,
18548
- hasSessions: false,
18549
- hasProfiles: false,
18550
- hasReplays: false,
18551
- hasFeedbacks: false,
18552
- hasNewFeedbacks: false,
18553
- hasMonitors: false,
18554
- hasMinifiedStackTrace: false,
18555
- hasInsightsHttp: false,
18556
- hasInsightsDb: false,
18557
- hasInsightsAssets: false,
18558
- hasInsightsAppStart: false,
18559
- hasInsightsScreenLoad: false,
18560
- hasInsightsVitals: false,
18561
- hasInsightsCaches: false,
18562
- hasInsightsQueues: false,
18563
- hasInsightsLlmMonitoring: false,
18564
- platform: "node",
18565
- platforms: [],
18566
- latestRelease: null,
18567
- hasUserReports: false,
18568
- hasFlags: false,
18569
- latestDeploys: null
18679
+ ...project_default,
18680
+ id: "4509106749636608"
18570
18681
  }]);
18571
18682
  }
18572
18683
  },
@@ -18575,13 +18686,9 @@ const restHandlers = buildHandlers([
18575
18686
  path: "/api/0/organizations/sentry-mcp-evals/teams/",
18576
18687
  fetch: () => {
18577
18688
  return HttpResponse.json({
18689
+ ...team_default,
18578
18690
  id: "4509109078196224",
18579
- slug: "the-goats",
18580
- name: "the-goats",
18581
18691
  dateCreated: "2025-04-07T00:05:48.196710Z",
18582
- isMember: true,
18583
- teamRole: "admin",
18584
- flags: { "idp:provisioned": false },
18585
18692
  access: [
18586
18693
  "event:read",
18587
18694
  "org:integrations",
@@ -18598,81 +18705,33 @@ const restHandlers = buildHandlers([
18598
18705
  "project:read",
18599
18706
  "project:admin",
18600
18707
  "alerts:read"
18601
- ],
18602
- hasAccess: true,
18603
- isPending: false,
18604
- memberCount: 1,
18605
- avatar: {
18606
- avatarType: "letter_avatar",
18607
- avatarUuid: null
18608
- }
18609
- });
18708
+ ]
18709
+ }, { status: 201 });
18610
18710
  }
18611
18711
  },
18612
18712
  {
18613
18713
  method: "post",
18614
18714
  path: "/api/0/teams/sentry-mcp-evals/the-goats/projects/",
18615
- fetch: () => {
18715
+ fetch: async ({ request }) => {
18716
+ const body = await request.json();
18616
18717
  return HttpResponse.json({
18617
- id: "4509109104082945",
18618
- slug: "cloudflare-mcp",
18619
- name: "cloudflare-mcp",
18620
- platform: "javascript",
18621
- dateCreated: "2025-04-07T00:12:23.143074Z",
18622
- isBookmarked: false,
18623
- isMember: true,
18624
- features: [
18625
- "discard-groups",
18626
- "alert-filters",
18627
- "similarity-embeddings",
18628
- "similarity-indexing",
18629
- "similarity-view"
18630
- ],
18631
- firstEvent: null,
18632
- firstTransactionEvent: false,
18633
- access: [
18634
- "team:write",
18635
- "alerts:write",
18636
- "event:write",
18637
- "org:read",
18638
- "alerts:read",
18639
- "event:admin",
18640
- "project:admin",
18641
- "event:read",
18642
- "org:integrations",
18643
- "project:read",
18644
- "project:releases",
18645
- "project:write",
18646
- "member:read",
18647
- "team:read",
18648
- "team:admin"
18649
- ],
18650
- hasAccess: true,
18651
- hasMinifiedStackTrace: false,
18652
- hasMonitors: false,
18653
- hasProfiles: false,
18654
- hasReplays: false,
18655
- hasFeedbacks: false,
18656
- hasFlags: false,
18657
- hasNewFeedbacks: false,
18658
- hasSessions: false,
18659
- hasInsightsHttp: false,
18660
- hasInsightsDb: false,
18661
- hasInsightsAssets: false,
18662
- hasInsightsAppStart: false,
18663
- hasInsightsScreenLoad: false,
18664
- hasInsightsVitals: false,
18665
- hasInsightsCaches: false,
18666
- hasInsightsQueues: false,
18667
- hasInsightsLlmMonitoring: false,
18668
- isInternal: false,
18669
- isPublic: false,
18670
- avatar: {
18671
- avatarType: "letter_avatar",
18672
- avatarUuid: null
18673
- },
18674
- color: "#bf3f55",
18675
- status: "active"
18718
+ ...project_default,
18719
+ name: body?.name || "cloudflare-mcp",
18720
+ slug: body?.slug || "cloudflare-mcp",
18721
+ platform: body?.platform || "node"
18722
+ });
18723
+ }
18724
+ },
18725
+ {
18726
+ method: "put",
18727
+ path: "/api/0/projects/sentry-mcp-evals/cloudflare-mcp/",
18728
+ fetch: async ({ request }) => {
18729
+ const body = await request.json();
18730
+ return HttpResponse.json({
18731
+ ...project_default,
18732
+ slug: body?.slug || "cloudflare-mcp",
18733
+ name: body?.name || "cloudflare-mcp",
18734
+ platform: body?.platform || "node"
18676
18735
  });
18677
18736
  }
18678
18737
  },
@@ -18883,8 +18942,112 @@ const restHandlers = buildHandlers([
18883
18942
  method: "post",
18884
18943
  path: "/api/0/organizations/sentry-mcp-evals/issues/PEATED-A8/autofix/",
18885
18944
  fetch: () => HttpResponse.json({ run_id: 123 })
18945
+ },
18946
+ {
18947
+ method: "post",
18948
+ path: "/api/0/projects/sentry-mcp-evals/cloudflare-mcp/teams/the-goats/",
18949
+ fetch: async ({ request }) => {
18950
+ const body = await request.json();
18951
+ return HttpResponse.json({
18952
+ ...team_default,
18953
+ id: "4509109078196224",
18954
+ slug: body?.slug || "the-goats",
18955
+ name: body?.name || "the-goats",
18956
+ dateCreated: "2025-04-07T00:05:48.196710Z"
18957
+ });
18958
+ }
18959
+ },
18960
+ {
18961
+ method: "put",
18962
+ path: "/api/0/organizations/sentry-mcp-evals/issues/CLOUDFLARE-MCP-41/",
18963
+ fetch: async ({ request }) => {
18964
+ const body = await request.json();
18965
+ const updatedIssue = {
18966
+ ...issue_default,
18967
+ status: body?.status || issue_default.status,
18968
+ assignedTo: body?.assignedTo || issue_default.assignedTo
18969
+ };
18970
+ return HttpResponse.json(updatedIssue);
18971
+ }
18972
+ },
18973
+ {
18974
+ method: "put",
18975
+ path: "/api/0/organizations/sentry-mcp-evals/issues/6507376925/",
18976
+ fetch: async ({ request }) => {
18977
+ const body = await request.json();
18978
+ const updatedIssue = {
18979
+ ...issue_default,
18980
+ status: body?.status || issue_default.status,
18981
+ assignedTo: body?.assignedTo || issue_default.assignedTo
18982
+ };
18983
+ return HttpResponse.json(updatedIssue);
18984
+ }
18985
+ },
18986
+ {
18987
+ method: "put",
18988
+ path: "/api/0/organizations/sentry-mcp-evals/issues/CLOUDFLARE-MCP-42/",
18989
+ fetch: async ({ request }) => {
18990
+ const body = await request.json();
18991
+ const updatedIssue = {
18992
+ ...issueFixture2,
18993
+ status: body?.status || issueFixture2.status,
18994
+ assignedTo: body?.assignedTo || issueFixture2.assignedTo
18995
+ };
18996
+ return HttpResponse.json(updatedIssue);
18997
+ }
18998
+ },
18999
+ {
19000
+ method: "put",
19001
+ path: "/api/0/organizations/sentry-mcp-evals/issues/6507376926/",
19002
+ fetch: async ({ request }) => {
19003
+ const body = await request.json();
19004
+ const updatedIssue = {
19005
+ ...issueFixture2,
19006
+ status: body?.status || issueFixture2.status,
19007
+ assignedTo: body?.assignedTo || issueFixture2.assignedTo
19008
+ };
19009
+ return HttpResponse.json(updatedIssue);
19010
+ }
18886
19011
  }
18887
19012
  ]);
19013
+ /**
19014
+ * Configured MSW server instance with all Sentry API mock handlers.
19015
+ *
19016
+ * Ready-to-use mock server for testing and development. Includes all endpoints
19017
+ * with realistic data, parameter validation, and error scenarios.
19018
+ *
19019
+ * @example Test Setup
19020
+ * ```typescript
19021
+ * import { mswServer } from "@sentry/mcp-server-mocks";
19022
+ *
19023
+ * beforeAll(() => mswServer.listen({ onUnhandledRequest: 'error' }));
19024
+ * afterEach(() => mswServer.resetHandlers());
19025
+ * afterAll(() => mswServer.close());
19026
+ * ```
19027
+ *
19028
+ * @example Development Usage
19029
+ * ```typescript
19030
+ * import { mswServer } from "@sentry/mcp-server-mocks";
19031
+ *
19032
+ * // Start intercepting requests
19033
+ * mswServer.listen();
19034
+ *
19035
+ * // Your MCP server will now use mock responses
19036
+ * const apiService = new SentryApiService({ host: "sentry.io" });
19037
+ * const orgs = await apiService.listOrganizations();
19038
+ * console.log(orgs); // Returns mock organization data
19039
+ * ```
19040
+ *
19041
+ * @note User Data Endpoint Restrictions
19042
+ * The following endpoints are configured with `controlOnly: true` to work ONLY
19043
+ * with the main host (sentry.io) and will NOT respond to requests from
19044
+ * region-specific hosts (us.sentry.io, de.sentry.io):
19045
+ * - `/api/0/auth/` (whoami endpoint)
19046
+ * - `/api/0/users/me/regions/` (find_organizations endpoint)
19047
+ *
19048
+ * This matches the real Sentry API behavior where user data must always be queried
19049
+ * from the main API server.
19050
+ */
18888
19051
  const mswServer = setupServer(...restHandlers);
18889
19052
 
18890
19053
  //#endregion