@sentry/mcp-server 0.14.0 → 0.15.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 (176) hide show
  1. package/dist/{analyze-issue-with-seer-DbAWpyTC.cjs → analyze-issue-with-seer-BkVrrh28.cjs} +9 -16
  2. package/dist/analyze-issue-with-seer-BkVrrh28.cjs.map +1 -0
  3. package/dist/{analyze-issue-with-seer-BsNarzJN.js → analyze-issue-with-seer-CoqsTklL.js} +9 -16
  4. package/dist/analyze-issue-with-seer-CoqsTklL.js.map +1 -0
  5. package/dist/api-client/client.d.cts +3 -3
  6. package/dist/api-client/client.d.ts +3 -3
  7. package/dist/api-client/index.d.cts +3 -3
  8. package/dist/api-client/index.d.ts +3 -3
  9. package/dist/api-client/schema.d.cts +1 -1
  10. package/dist/api-client/schema.d.ts +1 -1
  11. package/dist/api-client/types.d.cts +2 -2
  12. package/dist/api-client/types.d.ts +2 -2
  13. package/dist/{client-CILwfx6G.d.cts → client-CQ9Xe1aN.d.cts} +7 -7
  14. package/dist/{client-CILwfx6G.d.cts.map → client-CQ9Xe1aN.d.cts.map} +1 -1
  15. package/dist/{client-BCN17Wbp.d.ts → client-VCJp6Kcu.d.ts} +6 -6
  16. package/dist/{client-BCN17Wbp.d.ts.map → client-VCJp6Kcu.d.ts.map} +1 -1
  17. package/dist/{create-dsn-CDcL2DLD.js → create-dsn-D530I7Lr.js} +1 -1
  18. package/dist/{create-dsn-CDcL2DLD.js.map → create-dsn-D530I7Lr.js.map} +1 -1
  19. package/dist/{create-dsn-fESUtX3R.cjs → create-dsn-Dz8nyTFw.cjs} +1 -1
  20. package/dist/{create-dsn-fESUtX3R.cjs.map → create-dsn-Dz8nyTFw.cjs.map} +1 -1
  21. package/dist/{create-project-Bg5uDkc4.cjs → create-project-BxzRiryg.cjs} +2 -2
  22. package/dist/{create-project-Bg5uDkc4.cjs.map → create-project-BxzRiryg.cjs.map} +1 -1
  23. package/dist/{create-project-DY5mFznV.js → create-project-K1od5Rhx.js} +2 -2
  24. package/dist/{create-project-DY5mFznV.js.map → create-project-K1od5Rhx.js.map} +1 -1
  25. package/dist/{create-team-5purh64V.cjs → create-team-CJhrccc1.cjs} +1 -1
  26. package/dist/{create-team-5purh64V.cjs.map → create-team-CJhrccc1.cjs.map} +1 -1
  27. package/dist/{create-team-C2R7EUC3.js → create-team-zHz00C6Q.js} +1 -1
  28. package/dist/{create-team-C2R7EUC3.js.map → create-team-zHz00C6Q.js.map} +1 -1
  29. package/dist/{find-dsns-CvfcLB9Z.js → find-dsns-BoEP0N7B.js} +1 -1
  30. package/dist/{find-dsns-CvfcLB9Z.js.map → find-dsns-BoEP0N7B.js.map} +1 -1
  31. package/dist/{find-dsns-ZZ-thiNk.cjs → find-dsns-CK59RaUJ.cjs} +1 -1
  32. package/dist/{find-dsns-ZZ-thiNk.cjs.map → find-dsns-CK59RaUJ.cjs.map} +1 -1
  33. package/dist/{find-errors-CuRm4PzL.js → find-errors-C3oUMeRi.js} +1 -1
  34. package/dist/{find-errors-CuRm4PzL.js.map → find-errors-C3oUMeRi.js.map} +1 -1
  35. package/dist/{find-errors-Drzv7hzM.cjs → find-errors-CB9NpSxG.cjs} +1 -1
  36. package/dist/{find-errors-Drzv7hzM.cjs.map → find-errors-CB9NpSxG.cjs.map} +1 -1
  37. package/dist/{find-transactions-DZCj81jP.js → find-transactions-BiBgg-AE.js} +1 -1
  38. package/dist/{find-transactions-DZCj81jP.js.map → find-transactions-BiBgg-AE.js.map} +1 -1
  39. package/dist/{find-transactions-DIJ80wkd.cjs → find-transactions-DuZyqjhF.cjs} +1 -1
  40. package/dist/{find-transactions-DIJ80wkd.cjs.map → find-transactions-DuZyqjhF.cjs.map} +1 -1
  41. package/dist/{formatting-pUm38KOj.js → formatting-Bvyded57.js} +34 -2
  42. package/dist/formatting-Bvyded57.js.map +1 -0
  43. package/dist/{formatting-kdIeURER.d.ts → formatting-CcTK2X8V.d.cts} +7 -5
  44. package/dist/formatting-CcTK2X8V.d.cts.map +1 -0
  45. package/dist/{formatting-BlMiQa9i.cjs → formatting-D0Aki7rK.cjs} +33 -2
  46. package/dist/formatting-D0Aki7rK.cjs.map +1 -0
  47. package/dist/{formatting-utils-C3sej5ER.js → formatting-utils-DgOyTl-m.js} +1 -1
  48. package/dist/{formatting-utils-C3sej5ER.js.map → formatting-utils-DgOyTl-m.js.map} +1 -1
  49. package/dist/{formatting-utils-DDz14xeB.cjs → formatting-utils-m9R5bsRU.cjs} +1 -1
  50. package/dist/{formatting-utils-DDz14xeB.cjs.map → formatting-utils-m9R5bsRU.cjs.map} +1 -1
  51. package/dist/{formatting-CHh9Q_OW.d.cts → formatting-vtXxusbn.d.ts} +7 -5
  52. package/dist/formatting-vtXxusbn.d.ts.map +1 -0
  53. package/dist/{get-event-attachment-ChRw3jlQ.cjs → get-event-attachment-C-ig2-3F.cjs} +1 -1
  54. package/dist/{get-event-attachment-ChRw3jlQ.cjs.map → get-event-attachment-C-ig2-3F.cjs.map} +1 -1
  55. package/dist/{get-event-attachment-CuU-_5T6.js → get-event-attachment-DVCPpUMj.js} +1 -1
  56. package/dist/{get-event-attachment-CuU-_5T6.js.map → get-event-attachment-DVCPpUMj.js.map} +1 -1
  57. package/dist/{get-issue-details-CxChU4U9.js → get-issue-details-Dcmzxknx.js} +23 -10
  58. package/dist/get-issue-details-Dcmzxknx.js.map +1 -0
  59. package/dist/{get-issue-details-DFwZRbmU.cjs → get-issue-details-lBrYR9yx.cjs} +23 -10
  60. package/dist/get-issue-details-lBrYR9yx.cjs.map +1 -0
  61. package/dist/index.cjs +21 -21
  62. package/dist/index.js +21 -21
  63. package/dist/internal/formatting.cjs +2 -1
  64. package/dist/internal/formatting.d.cts +4 -4
  65. package/dist/internal/formatting.d.ts +4 -4
  66. package/dist/internal/formatting.js +2 -1
  67. package/dist/internal/test-fixtures.d.cts +44 -44
  68. package/dist/internal/test-fixtures.d.cts.map +1 -1
  69. package/dist/internal/test-fixtures.d.ts +170 -170
  70. package/dist/internal/test-fixtures.d.ts.map +1 -1
  71. package/dist/{logging-oIouXrcb.cjs → logging-CX2buXiG.cjs} +1 -1
  72. package/dist/{logging-oIouXrcb.cjs.map → logging-CX2buXiG.cjs.map} +1 -1
  73. package/dist/{logging-LnQMFw-_.js → logging-DzxYBMrn.js} +1 -1
  74. package/dist/{logging-LnQMFw-_.js.map → logging-DzxYBMrn.js.map} +1 -1
  75. package/dist/logging.cjs +1 -1
  76. package/dist/logging.js +1 -1
  77. package/dist/{schema--5m4KI84.d.ts → schema-3NeMWRAm.d.cts} +452 -452
  78. package/dist/{schema-ya35hkEL.d.cts.map → schema-3NeMWRAm.d.cts.map} +1 -1
  79. package/dist/{schema-ya35hkEL.d.cts → schema-B3CzDGJk.d.ts} +401 -401
  80. package/dist/{schema--5m4KI84.d.ts.map → schema-B3CzDGJk.d.ts.map} +1 -1
  81. package/dist/schema.d.cts.map +1 -1
  82. package/dist/{seer-utils-CzYEEZb2.cjs → seer-utils-CDm5J8ur.cjs} +2 -2
  83. package/dist/{seer-utils-CzYEEZb2.cjs.map → seer-utils-CDm5J8ur.cjs.map} +1 -1
  84. package/dist/{seer-utils-Ckr8nYlz.js → seer-utils-Cj9DXrow.js} +2 -2
  85. package/dist/{seer-utils-Ckr8nYlz.js.map → seer-utils-Cj9DXrow.js.map} +1 -1
  86. package/dist/{server-DOy-M9Ko.js → server-BSRxzYFd.js} +3 -3
  87. package/dist/{server-DOy-M9Ko.js.map → server-BSRxzYFd.js.map} +1 -1
  88. package/dist/{server-BpEIZVaZ.cjs → server-Dgkqz8bA.cjs} +3 -3
  89. package/dist/{server-BpEIZVaZ.cjs.map → server-Dgkqz8bA.cjs.map} +1 -1
  90. package/dist/server.cjs +18 -18
  91. package/dist/server.js +18 -18
  92. package/dist/{stdio-DMEgJ_fG.cjs → stdio-BQAm0Liz.cjs} +3 -3
  93. package/dist/{stdio-DMEgJ_fG.cjs.map → stdio-BQAm0Liz.cjs.map} +1 -1
  94. package/dist/{stdio-B2NDq7Ax.js → stdio-BcihaDjO.js} +3 -3
  95. package/dist/{stdio-B2NDq7Ax.js.map → stdio-BcihaDjO.js.map} +1 -1
  96. package/dist/test-setup.cjs +1 -16
  97. package/dist/test-setup.cjs.map +1 -1
  98. package/dist/test-setup.js +1 -16
  99. package/dist/test-setup.js.map +1 -1
  100. package/dist/toolDefinitions.js +2 -2
  101. package/dist/tools/analyze-issue-with-seer.cjs +4 -4
  102. package/dist/tools/analyze-issue-with-seer.js +4 -4
  103. package/dist/tools/create-dsn.cjs +1 -1
  104. package/dist/tools/create-dsn.js +1 -1
  105. package/dist/tools/create-project.cjs +2 -2
  106. package/dist/tools/create-project.js +2 -2
  107. package/dist/tools/create-team.cjs +1 -1
  108. package/dist/tools/create-team.js +1 -1
  109. package/dist/tools/find-dsns.cjs +1 -1
  110. package/dist/tools/find-dsns.js +1 -1
  111. package/dist/tools/find-errors.cjs +1 -1
  112. package/dist/tools/find-errors.js +1 -1
  113. package/dist/tools/find-transactions.cjs +1 -1
  114. package/dist/tools/find-transactions.js +1 -1
  115. package/dist/tools/get-event-attachment.cjs +1 -1
  116. package/dist/tools/get-event-attachment.js +1 -1
  117. package/dist/tools/get-issue-details.cjs +4 -3
  118. package/dist/tools/get-issue-details.js +4 -3
  119. package/dist/tools/index.cjs +17 -17
  120. package/dist/tools/index.d.cts +76 -76
  121. package/dist/tools/index.d.ts +76 -76
  122. package/dist/tools/index.js +17 -17
  123. package/dist/tools/update-issue.cjs +5 -4
  124. package/dist/tools/update-issue.js +5 -4
  125. package/dist/tools/update-project.cjs +2 -2
  126. package/dist/tools/update-project.js +2 -2
  127. package/dist/tools/utils/api-utils.d.cts +3 -3
  128. package/dist/tools/utils/api-utils.d.ts +3 -3
  129. package/dist/tools/utils/formatting-utils.cjs +1 -1
  130. package/dist/tools/utils/formatting-utils.d.cts +3 -3
  131. package/dist/tools/utils/formatting-utils.d.ts +3 -3
  132. package/dist/tools/utils/formatting-utils.js +1 -1
  133. package/dist/tools/utils/issue-utils.cjs +3 -2
  134. package/dist/tools/utils/issue-utils.d.cts +4 -4
  135. package/dist/tools/utils/issue-utils.d.ts +4 -4
  136. package/dist/tools/utils/issue-utils.js +3 -2
  137. package/dist/tools/utils/seer-utils.cjs +1 -1
  138. package/dist/tools/utils/seer-utils.d.cts +3 -3
  139. package/dist/tools/utils/seer-utils.d.ts +3 -3
  140. package/dist/tools/utils/seer-utils.js +1 -1
  141. package/dist/{tools-19Ms1kck.cjs → tools-CHnZvVEN.cjs} +12 -12
  142. package/dist/{tools-19Ms1kck.cjs.map → tools-CHnZvVEN.cjs.map} +1 -1
  143. package/dist/{tools-mThAUo_3.js → tools-CdXGgq1W.js} +12 -12
  144. package/dist/{tools-mThAUo_3.js.map → tools-CdXGgq1W.js.map} +1 -1
  145. package/dist/transports/stdio.cjs +20 -20
  146. package/dist/transports/stdio.js +20 -20
  147. package/dist/{types-Bg17IGWJ.d.cts → types-BoMP-Ro6.d.cts} +2 -2
  148. package/dist/{types-Bg17IGWJ.d.cts.map → types-BoMP-Ro6.d.cts.map} +1 -1
  149. package/dist/{types-CtTBwGbw.d.ts → types-DpV1JAZj.d.ts} +2 -2
  150. package/dist/{types-CtTBwGbw.d.ts.map → types-DpV1JAZj.d.ts.map} +1 -1
  151. package/dist/{update-issue-DmLElHPS.js → update-issue-DRTQvy6p.js} +2 -2
  152. package/dist/{update-issue-DmLElHPS.js.map → update-issue-DRTQvy6p.js.map} +1 -1
  153. package/dist/{update-issue-B6eZhAPJ.cjs → update-issue-DpkxxiNk.cjs} +2 -2
  154. package/dist/{update-issue-B6eZhAPJ.cjs.map → update-issue-DpkxxiNk.cjs.map} +1 -1
  155. package/dist/{update-project-CijYCtG1.cjs → update-project-DLDDbcGY.cjs} +2 -2
  156. package/dist/{update-project-CijYCtG1.cjs.map → update-project-DLDDbcGY.cjs.map} +1 -1
  157. package/dist/{update-project-BNPev7W8.js → update-project-YLxt2ry2.js} +2 -2
  158. package/dist/{update-project-BNPev7W8.js.map → update-project-YLxt2ry2.js.map} +1 -1
  159. package/dist/version-CcTnFB56.js +6 -0
  160. package/dist/{version-C4uvMmw0.js.map → version-CcTnFB56.js.map} +1 -1
  161. package/dist/{version-Ddz4xg_q.cjs → version-rDjaSkPw.cjs} +2 -2
  162. package/dist/{version-Ddz4xg_q.cjs.map → version-rDjaSkPw.cjs.map} +1 -1
  163. package/dist/version.cjs +1 -1
  164. package/dist/version.js +1 -1
  165. package/package.json +3 -3
  166. package/dist/analyze-issue-with-seer-BsNarzJN.js.map +0 -1
  167. package/dist/analyze-issue-with-seer-DbAWpyTC.cjs.map +0 -1
  168. package/dist/formatting-BlMiQa9i.cjs.map +0 -1
  169. package/dist/formatting-CHh9Q_OW.d.cts.map +0 -1
  170. package/dist/formatting-kdIeURER.d.ts.map +0 -1
  171. package/dist/formatting-pUm38KOj.js.map +0 -1
  172. package/dist/get-issue-details-CxChU4U9.js.map +0 -1
  173. package/dist/get-issue-details-DFwZRbmU.cjs.map +0 -1
  174. package/dist/version-C4uvMmw0.js +0 -6
  175. /package/dist/{issue-utils-BVAB6I-Z.js → issue-utils-BbCfbiY8.js} +0 -0
  176. /package/dist/{issue-utils-pdbo-5LW.cjs → issue-utils-DMKiif6C.cjs} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"find-dsns-ZZ-thiNk.cjs","names":["ParamOrganizationSlug","ParamProjectSlug","context: ServerContext"],"sources":["../src/tools/find-dsns.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_dsns\",\n description: [\n \"List all Sentry DSNs for a specific project.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Retrieve a SENTRY_DSN for a specific project\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `find_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug,\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n setTag(\"project.slug\", params.projectSlug);\n\n const clientKeys = await apiService.listClientKeys({\n organizationSlug,\n projectSlug: params.projectSlug,\n });\n let output = `# DSNs in **${organizationSlug}/${params.projectSlug}**\\n\\n`;\n if (clientKeys.length === 0) {\n output +=\n \"No DSNs were found.\\n\\nYou can create new one using the `create_dsn` tool.\";\n return output;\n }\n for (const clientKey of clientKeys) {\n output += `## ${clientKey.name}\\n`;\n output += `**ID**: ${clientKey.id}\\n`;\n output += `**DSN**: ${clientKey.dsn.public}\\n\\n`;\n }\n output += \"# Using this information\\n\\n\";\n output +=\n \"- The `SENTRY_DSN` value is a URL that you can use to initialize Sentry's SDKs.\\n\";\n return output;\n },\n});\n"],"mappings":";;;;;;;AAWA,wBAAe,8BAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkBA;EAClB,WAAW,8BAAe,UAAU;EACpC,aAAaC;CACd;CACD,MAAM,QAAQ,QAAQC,SAAwB;EAC5C,MAAM,aAAa,wCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,4BAAO,qBAAqB,iBAAiB;AAC7C,4BAAO,gBAAgB,OAAO,YAAY;EAE1C,MAAM,aAAa,MAAM,WAAW,eAAe;GACjD;GACA,aAAa,OAAO;EACrB,EAAC;EACF,IAAI,UAAU,cAAc,iBAAiB,GAAG,OAAO,YAAY;AACnE,MAAI,WAAW,WAAW,GAAG;AAC3B,aACE;AACF,UAAO;EACR;AACD,OAAK,MAAM,aAAa,YAAY;AAClC,cAAW,KAAK,UAAU,KAAK;AAC/B,cAAW,UAAU,UAAU,GAAG;AAClC,cAAW,WAAW,UAAU,IAAI,OAAO;EAC5C;AACD,YAAU;AACV,YACE;AACF,SAAO;CACR;AACF,EAAC"}
1
+ {"version":3,"file":"find-dsns-CK59RaUJ.cjs","names":["ParamOrganizationSlug","ParamProjectSlug","context: ServerContext"],"sources":["../src/tools/find-dsns.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlug,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_dsns\",\n description: [\n \"List all Sentry DSNs for a specific project.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Retrieve a SENTRY_DSN for a specific project\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `find_organizations()` first.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlug,\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n setTag(\"project.slug\", params.projectSlug);\n\n const clientKeys = await apiService.listClientKeys({\n organizationSlug,\n projectSlug: params.projectSlug,\n });\n let output = `# DSNs in **${organizationSlug}/${params.projectSlug}**\\n\\n`;\n if (clientKeys.length === 0) {\n output +=\n \"No DSNs were found.\\n\\nYou can create new one using the `create_dsn` tool.\";\n return output;\n }\n for (const clientKey of clientKeys) {\n output += `## ${clientKey.name}\\n`;\n output += `**ID**: ${clientKey.id}\\n`;\n output += `**DSN**: ${clientKey.dsn.public}\\n\\n`;\n }\n output += \"# Using this information\\n\\n\";\n output +=\n \"- The `SENTRY_DSN` value is a URL that you can use to initialize Sentry's SDKs.\\n\";\n return output;\n },\n});\n"],"mappings":";;;;;;;AAWA,wBAAe,8BAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkBA;EAClB,WAAW,8BAAe,UAAU;EACpC,aAAaC;CACd;CACD,MAAM,QAAQ,QAAQC,SAAwB;EAC5C,MAAM,aAAa,wCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,4BAAO,qBAAqB,iBAAiB;AAC7C,4BAAO,gBAAgB,OAAO,YAAY;EAE1C,MAAM,aAAa,MAAM,WAAW,eAAe;GACjD;GACA,aAAa,OAAO;EACrB,EAAC;EACF,IAAI,UAAU,cAAc,iBAAiB,GAAG,OAAO,YAAY;AACnE,MAAI,WAAW,WAAW,GAAG;AAC3B,aACE;AACF,UAAO;EACR;AACD,OAAK,MAAM,aAAa,YAAY;AAClC,cAAW,KAAK,UAAU,KAAK;AAC/B,cAAW,UAAU,UAAU,GAAG;AAClC,cAAW,WAAW,UAAU,IAAI,OAAO;EAC5C;AACD,YAAU;AACV,YACE;AACF,SAAO;CACR;AACF,EAAC"}
@@ -88,4 +88,4 @@ var find_errors_default = defineTool({
88
88
 
89
89
  //#endregion
90
90
  export { find_errors_default };
91
- //# sourceMappingURL=find-errors-CuRm4PzL.js.map
91
+ //# sourceMappingURL=find-errors-C3oUMeRi.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"find-errors-CuRm4PzL.js","names":["context: ServerContext"],"sources":["../src/tools/find-errors.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlugOrAll,\n ParamTransaction,\n ParamQuery,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_errors\",\n description: [\n \"Find errors in Sentry using advanced search syntax.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Search for production errors in a specific file.\",\n \"- Analyze error patterns and frequencies.\",\n \"- Find recent or frequently occurring errors.\",\n \"\",\n \"<examples>\",\n \"### Find common errors within a file\",\n \"\",\n \"To find common errors within a file, you can use the `filename` parameter. This is a suffix based search, so only using the filename or the direct parent folder of the file. The parent folder is preferred when the filename is in a subfolder or a common filename. If you provide generic filenames like `index.js` you're going to end up finding errors that are might be from completely different projects.\",\n \"\",\n \"```\",\n \"find_errors(organizationSlug='my-organization', filename='index.js', sortBy='count')\",\n \"```\",\n \"\",\n \"### Find recent crashes from the 'peated' project\",\n \"\",\n \"```\",\n \"find_errors(organizationSlug='my-organization', query='is:unresolved error.handled:false', projectSlug='peated', sortBy='last_seen')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you should call `find_organizations()` first.\",\n \"- If you are looking for issues, in a way that you might be looking for something like 'unresolved errors', you should use the `find_issues()` tool\",\n \"- You can use the `find_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlugOrAll.optional(),\n filename: z\n .string()\n .trim()\n .describe(\"The filename to search for errors in.\")\n .optional(),\n transaction: ParamTransaction.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"last_seen\", \"count\"])\n .optional()\n .default(\"last_seen\")\n .describe(\n \"Sort the results either by the last time they occurred or the count of occurrences.\",\n ),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n if (params.projectSlug) setTag(\"project.slug\", params.projectSlug);\n\n const eventList = await apiService.searchErrors({\n organizationSlug,\n projectSlug: params.projectSlug,\n filename: params.filename,\n query: params.query,\n transaction: params.transaction,\n sortBy: params.sortBy as \"last_seen\" | \"count\" | undefined,\n });\n let output = `# Errors in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (params.query)\n output += `These errors match the query \\`${params.query}\\`\\n`;\n if (params.filename)\n output += `These errors are limited to the file suffix \\`${params.filename}\\`\\n`;\n output += \"\\n\";\n if (eventList.length === 0) {\n output += `No results found\\n\\n`;\n output += `We searched within the ${organizationSlug} organization.\\n\\n`;\n return output;\n }\n for (const eventSummary of eventList) {\n output += `## ${eventSummary.issue}\\n\\n`;\n output += `**Description**: ${eventSummary.title}\\n`;\n output += `**Issue ID**: ${eventSummary.issue}\\n`;\n output += `**URL**: ${apiService.getIssueUrl(organizationSlug, eventSummary.issue)}\\n`;\n output += `**Project**: ${eventSummary.project}\\n`;\n output += `**Last Seen**: ${eventSummary[\"last_seen()\"]}\\n`;\n output += `**Occurrences**: ${eventSummary[\"count()\"]}\\n\\n`;\n }\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the Issue ID in commit messages (e.g. \\`Fixes <issueID>\\`) to automatically close the issue when the commit is merged.\\n`;\n output += `- You can get more details about an error by using the tool: \\`get_issue_details(organizationSlug=\"${organizationSlug}\", issueId=<issueID>)\\`\\n`;\n return output;\n },\n});\n"],"mappings":";;;;;;;AAaA,0BAAe,WAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB;EAClB,WAAW,eAAe,UAAU;EACpC,aAAa,sBAAsB,UAAU;EAC7C,UAAU,EACP,QAAQ,CACR,MAAM,CACN,SAAS,wCAAwC,CACjD,UAAU;EACb,aAAa,iBAAiB,UAAU;EACxC,OAAO,WAAW,UAAU;EAC5B,QAAQ,EACL,KAAK,CAAC,aAAa,OAAQ,EAAC,CAC5B,UAAU,CACV,QAAQ,YAAY,CACpB,SACC,sFACD;CACJ;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,sBAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,SAAO,qBAAqB,iBAAiB;AAC7C,MAAI,OAAO,YAAa,QAAO,gBAAgB,OAAO,YAAY;EAElE,MAAM,YAAY,MAAM,WAAW,aAAa;GAC9C;GACA,aAAa,OAAO;GACpB,UAAU,OAAO;GACjB,OAAO,OAAO;GACd,aAAa,OAAO;GACpB,QAAQ,OAAO;EAChB,EAAC;EACF,IAAI,UAAU,gBAAgB,mBAAmB,OAAO,eAAe,GAAG,OAAO,gBAAgB,GAAG;AACpG,MAAI,OAAO,MACT,YAAW,iCAAiC,OAAO,MAAM;AAC3D,MAAI,OAAO,SACT,YAAW,gDAAgD,OAAO,SAAS;AAC7E,YAAU;AACV,MAAI,UAAU,WAAW,GAAG;AAC1B,cAAW;AACX,cAAW,yBAAyB,iBAAiB;AACrD,UAAO;EACR;AACD,OAAK,MAAM,gBAAgB,WAAW;AACpC,cAAW,KAAK,aAAa,MAAM;AACnC,cAAW,mBAAmB,aAAa,MAAM;AACjD,cAAW,gBAAgB,aAAa,MAAM;AAC9C,cAAW,WAAW,WAAW,YAAY,kBAAkB,aAAa,MAAM,CAAC;AACnF,cAAW,eAAe,aAAa,QAAQ;AAC/C,cAAW,iBAAiB,aAAa,eAAe;AACxD,cAAW,mBAAmB,aAAa,WAAW;EACvD;AACD,YAAU;AACV,aAAW;AACX,aAAW,qGAAqG,iBAAiB;AACjI,SAAO;CACR;AACF,EAAC"}
1
+ {"version":3,"file":"find-errors-C3oUMeRi.js","names":["context: ServerContext"],"sources":["../src/tools/find-errors.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlugOrAll,\n ParamTransaction,\n ParamQuery,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_errors\",\n description: [\n \"Find errors in Sentry using advanced search syntax.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Search for production errors in a specific file.\",\n \"- Analyze error patterns and frequencies.\",\n \"- Find recent or frequently occurring errors.\",\n \"\",\n \"<examples>\",\n \"### Find common errors within a file\",\n \"\",\n \"To find common errors within a file, you can use the `filename` parameter. This is a suffix based search, so only using the filename or the direct parent folder of the file. The parent folder is preferred when the filename is in a subfolder or a common filename. If you provide generic filenames like `index.js` you're going to end up finding errors that are might be from completely different projects.\",\n \"\",\n \"```\",\n \"find_errors(organizationSlug='my-organization', filename='index.js', sortBy='count')\",\n \"```\",\n \"\",\n \"### Find recent crashes from the 'peated' project\",\n \"\",\n \"```\",\n \"find_errors(organizationSlug='my-organization', query='is:unresolved error.handled:false', projectSlug='peated', sortBy='last_seen')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you should call `find_organizations()` first.\",\n \"- If you are looking for issues, in a way that you might be looking for something like 'unresolved errors', you should use the `find_issues()` tool\",\n \"- You can use the `find_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlugOrAll.optional(),\n filename: z\n .string()\n .trim()\n .describe(\"The filename to search for errors in.\")\n .optional(),\n transaction: ParamTransaction.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"last_seen\", \"count\"])\n .optional()\n .default(\"last_seen\")\n .describe(\n \"Sort the results either by the last time they occurred or the count of occurrences.\",\n ),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n if (params.projectSlug) setTag(\"project.slug\", params.projectSlug);\n\n const eventList = await apiService.searchErrors({\n organizationSlug,\n projectSlug: params.projectSlug,\n filename: params.filename,\n query: params.query,\n transaction: params.transaction,\n sortBy: params.sortBy as \"last_seen\" | \"count\" | undefined,\n });\n let output = `# Errors in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (params.query)\n output += `These errors match the query \\`${params.query}\\`\\n`;\n if (params.filename)\n output += `These errors are limited to the file suffix \\`${params.filename}\\`\\n`;\n output += \"\\n\";\n if (eventList.length === 0) {\n output += `No results found\\n\\n`;\n output += `We searched within the ${organizationSlug} organization.\\n\\n`;\n return output;\n }\n for (const eventSummary of eventList) {\n output += `## ${eventSummary.issue}\\n\\n`;\n output += `**Description**: ${eventSummary.title}\\n`;\n output += `**Issue ID**: ${eventSummary.issue}\\n`;\n output += `**URL**: ${apiService.getIssueUrl(organizationSlug, eventSummary.issue)}\\n`;\n output += `**Project**: ${eventSummary.project}\\n`;\n output += `**Last Seen**: ${eventSummary[\"last_seen()\"]}\\n`;\n output += `**Occurrences**: ${eventSummary[\"count()\"]}\\n\\n`;\n }\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the Issue ID in commit messages (e.g. \\`Fixes <issueID>\\`) to automatically close the issue when the commit is merged.\\n`;\n output += `- You can get more details about an error by using the tool: \\`get_issue_details(organizationSlug=\"${organizationSlug}\", issueId=<issueID>)\\`\\n`;\n return output;\n },\n});\n"],"mappings":";;;;;;;AAaA,0BAAe,WAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkB;EAClB,WAAW,eAAe,UAAU;EACpC,aAAa,sBAAsB,UAAU;EAC7C,UAAU,EACP,QAAQ,CACR,MAAM,CACN,SAAS,wCAAwC,CACjD,UAAU;EACb,aAAa,iBAAiB,UAAU;EACxC,OAAO,WAAW,UAAU;EAC5B,QAAQ,EACL,KAAK,CAAC,aAAa,OAAQ,EAAC,CAC5B,UAAU,CACV,QAAQ,YAAY,CACpB,SACC,sFACD;CACJ;CACD,MAAM,QAAQ,QAAQA,SAAwB;EAC5C,MAAM,aAAa,sBAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,SAAO,qBAAqB,iBAAiB;AAC7C,MAAI,OAAO,YAAa,QAAO,gBAAgB,OAAO,YAAY;EAElE,MAAM,YAAY,MAAM,WAAW,aAAa;GAC9C;GACA,aAAa,OAAO;GACpB,UAAU,OAAO;GACjB,OAAO,OAAO;GACd,aAAa,OAAO;GACpB,QAAQ,OAAO;EAChB,EAAC;EACF,IAAI,UAAU,gBAAgB,mBAAmB,OAAO,eAAe,GAAG,OAAO,gBAAgB,GAAG;AACpG,MAAI,OAAO,MACT,YAAW,iCAAiC,OAAO,MAAM;AAC3D,MAAI,OAAO,SACT,YAAW,gDAAgD,OAAO,SAAS;AAC7E,YAAU;AACV,MAAI,UAAU,WAAW,GAAG;AAC1B,cAAW;AACX,cAAW,yBAAyB,iBAAiB;AACrD,UAAO;EACR;AACD,OAAK,MAAM,gBAAgB,WAAW;AACpC,cAAW,KAAK,aAAa,MAAM;AACnC,cAAW,mBAAmB,aAAa,MAAM;AACjD,cAAW,gBAAgB,aAAa,MAAM;AAC9C,cAAW,WAAW,WAAW,YAAY,kBAAkB,aAAa,MAAM,CAAC;AACnF,cAAW,eAAe,aAAa,QAAQ;AAC/C,cAAW,iBAAiB,aAAa,eAAe;AACxD,cAAW,mBAAmB,aAAa,WAAW;EACvD;AACD,YAAU;AACV,aAAW;AACX,aAAW,qGAAqG,iBAAiB;AACjI,SAAO;CACR;AACF,EAAC"}
@@ -94,4 +94,4 @@ Object.defineProperty(exports, 'find_errors_default', {
94
94
  return find_errors_default;
95
95
  }
96
96
  });
97
- //# sourceMappingURL=find-errors-Drzv7hzM.cjs.map
97
+ //# sourceMappingURL=find-errors-CB9NpSxG.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"find-errors-Drzv7hzM.cjs","names":["ParamOrganizationSlug","context: ServerContext"],"sources":["../src/tools/find-errors.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlugOrAll,\n ParamTransaction,\n ParamQuery,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_errors\",\n description: [\n \"Find errors in Sentry using advanced search syntax.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Search for production errors in a specific file.\",\n \"- Analyze error patterns and frequencies.\",\n \"- Find recent or frequently occurring errors.\",\n \"\",\n \"<examples>\",\n \"### Find common errors within a file\",\n \"\",\n \"To find common errors within a file, you can use the `filename` parameter. This is a suffix based search, so only using the filename or the direct parent folder of the file. The parent folder is preferred when the filename is in a subfolder or a common filename. If you provide generic filenames like `index.js` you're going to end up finding errors that are might be from completely different projects.\",\n \"\",\n \"```\",\n \"find_errors(organizationSlug='my-organization', filename='index.js', sortBy='count')\",\n \"```\",\n \"\",\n \"### Find recent crashes from the 'peated' project\",\n \"\",\n \"```\",\n \"find_errors(organizationSlug='my-organization', query='is:unresolved error.handled:false', projectSlug='peated', sortBy='last_seen')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you should call `find_organizations()` first.\",\n \"- If you are looking for issues, in a way that you might be looking for something like 'unresolved errors', you should use the `find_issues()` tool\",\n \"- You can use the `find_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlugOrAll.optional(),\n filename: z\n .string()\n .trim()\n .describe(\"The filename to search for errors in.\")\n .optional(),\n transaction: ParamTransaction.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"last_seen\", \"count\"])\n .optional()\n .default(\"last_seen\")\n .describe(\n \"Sort the results either by the last time they occurred or the count of occurrences.\",\n ),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n if (params.projectSlug) setTag(\"project.slug\", params.projectSlug);\n\n const eventList = await apiService.searchErrors({\n organizationSlug,\n projectSlug: params.projectSlug,\n filename: params.filename,\n query: params.query,\n transaction: params.transaction,\n sortBy: params.sortBy as \"last_seen\" | \"count\" | undefined,\n });\n let output = `# Errors in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (params.query)\n output += `These errors match the query \\`${params.query}\\`\\n`;\n if (params.filename)\n output += `These errors are limited to the file suffix \\`${params.filename}\\`\\n`;\n output += \"\\n\";\n if (eventList.length === 0) {\n output += `No results found\\n\\n`;\n output += `We searched within the ${organizationSlug} organization.\\n\\n`;\n return output;\n }\n for (const eventSummary of eventList) {\n output += `## ${eventSummary.issue}\\n\\n`;\n output += `**Description**: ${eventSummary.title}\\n`;\n output += `**Issue ID**: ${eventSummary.issue}\\n`;\n output += `**URL**: ${apiService.getIssueUrl(organizationSlug, eventSummary.issue)}\\n`;\n output += `**Project**: ${eventSummary.project}\\n`;\n output += `**Last Seen**: ${eventSummary[\"last_seen()\"]}\\n`;\n output += `**Occurrences**: ${eventSummary[\"count()\"]}\\n\\n`;\n }\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the Issue ID in commit messages (e.g. \\`Fixes <issueID>\\`) to automatically close the issue when the commit is merged.\\n`;\n output += `- You can get more details about an error by using the tool: \\`get_issue_details(organizationSlug=\"${organizationSlug}\", issueId=<issueID>)\\`\\n`;\n return output;\n },\n});\n"],"mappings":";;;;;;;;AAaA,0BAAe,8BAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkBA;EAClB,WAAW,8BAAe,UAAU;EACpC,aAAa,qCAAsB,UAAU;EAC7C,UAAU,MACP,QAAQ,CACR,MAAM,CACN,SAAS,wCAAwC,CACjD,UAAU;EACb,aAAa,gCAAiB,UAAU;EACxC,OAAO,0BAAW,UAAU;EAC5B,QAAQ,MACL,KAAK,CAAC,aAAa,OAAQ,EAAC,CAC5B,UAAU,CACV,QAAQ,YAAY,CACpB,SACC,sFACD;CACJ;CACD,MAAM,QAAQ,QAAQC,SAAwB;EAC5C,MAAM,aAAa,wCAAsB,SAAS,EAChD,WAAW,OAAO,UACnB,EAAC;EACF,MAAM,mBAAmB,OAAO;AAEhC,4BAAO,qBAAqB,iBAAiB;AAC7C,MAAI,OAAO,YAAa,2BAAO,gBAAgB,OAAO,YAAY;EAElE,MAAM,YAAY,MAAM,WAAW,aAAa;GAC9C;GACA,aAAa,OAAO;GACpB,UAAU,OAAO;GACjB,OAAO,OAAO;GACd,aAAa,OAAO;GACpB,QAAQ,OAAO;EAChB,EAAC;EACF,IAAI,UAAU,gBAAgB,mBAAmB,OAAO,eAAe,GAAG,OAAO,gBAAgB,GAAG;AACpG,MAAI,OAAO,MACT,YAAW,iCAAiC,OAAO,MAAM;AAC3D,MAAI,OAAO,SACT,YAAW,gDAAgD,OAAO,SAAS;AAC7E,YAAU;AACV,MAAI,UAAU,WAAW,GAAG;AAC1B,cAAW;AACX,cAAW,yBAAyB,iBAAiB;AACrD,UAAO;EACR;AACD,OAAK,MAAM,gBAAgB,WAAW;AACpC,cAAW,KAAK,aAAa,MAAM;AACnC,cAAW,mBAAmB,aAAa,MAAM;AACjD,cAAW,gBAAgB,aAAa,MAAM;AAC9C,cAAW,WAAW,WAAW,YAAY,kBAAkB,aAAa,MAAM,CAAC;AACnF,cAAW,eAAe,aAAa,QAAQ;AAC/C,cAAW,iBAAiB,aAAa,eAAe;AACxD,cAAW,mBAAmB,aAAa,WAAW;EACvD;AACD,YAAU;AACV,aAAW;AACX,aAAW,qGAAqG,iBAAiB;AACjI,SAAO;CACR;AACF,EAAC"}
1
+ {"version":3,"file":"find-errors-CB9NpSxG.cjs","names":["ParamOrganizationSlug","context: ServerContext"],"sources":["../src/tools/find-errors.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlugOrAll,\n ParamTransaction,\n ParamQuery,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_errors\",\n description: [\n \"Find errors in Sentry using advanced search syntax.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Search for production errors in a specific file.\",\n \"- Analyze error patterns and frequencies.\",\n \"- Find recent or frequently occurring errors.\",\n \"\",\n \"<examples>\",\n \"### Find common errors within a file\",\n \"\",\n \"To find common errors within a file, you can use the `filename` parameter. This is a suffix based search, so only using the filename or the direct parent folder of the file. The parent folder is preferred when the filename is in a subfolder or a common filename. If you provide generic filenames like `index.js` you're going to end up finding errors that are might be from completely different projects.\",\n \"\",\n \"```\",\n \"find_errors(organizationSlug='my-organization', filename='index.js', sortBy='count')\",\n \"```\",\n \"\",\n \"### Find recent crashes from the 'peated' project\",\n \"\",\n \"```\",\n \"find_errors(organizationSlug='my-organization', query='is:unresolved error.handled:false', projectSlug='peated', sortBy='last_seen')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you should call `find_organizations()` first.\",\n \"- If you are looking for issues, in a way that you might be looking for something like 'unresolved errors', you should use the `find_issues()` tool\",\n \"- You can use the `find_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlugOrAll.optional(),\n filename: z\n .string()\n .trim()\n .describe(\"The filename to search for errors in.\")\n .optional(),\n transaction: ParamTransaction.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"last_seen\", \"count\"])\n .optional()\n .default(\"last_seen\")\n .describe(\n \"Sort the results either by the last time they occurred or the count of occurrences.\",\n ),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n if (params.projectSlug) setTag(\"project.slug\", params.projectSlug);\n\n const eventList = await apiService.searchErrors({\n organizationSlug,\n projectSlug: params.projectSlug,\n filename: params.filename,\n query: params.query,\n transaction: params.transaction,\n sortBy: params.sortBy as \"last_seen\" | \"count\" | undefined,\n });\n let output = `# Errors in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (params.query)\n output += `These errors match the query \\`${params.query}\\`\\n`;\n if (params.filename)\n output += `These errors are limited to the file suffix \\`${params.filename}\\`\\n`;\n output += \"\\n\";\n if (eventList.length === 0) {\n output += `No results found\\n\\n`;\n output += `We searched within the ${organizationSlug} organization.\\n\\n`;\n return output;\n }\n for (const eventSummary of eventList) {\n output += `## ${eventSummary.issue}\\n\\n`;\n output += `**Description**: ${eventSummary.title}\\n`;\n output += `**Issue ID**: ${eventSummary.issue}\\n`;\n output += `**URL**: ${apiService.getIssueUrl(organizationSlug, eventSummary.issue)}\\n`;\n output += `**Project**: ${eventSummary.project}\\n`;\n output += `**Last Seen**: ${eventSummary[\"last_seen()\"]}\\n`;\n output += `**Occurrences**: ${eventSummary[\"count()\"]}\\n\\n`;\n }\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the Issue ID in commit messages (e.g. \\`Fixes <issueID>\\`) to automatically close the issue when the commit is merged.\\n`;\n output += `- You can get more details about an error by using the tool: \\`get_issue_details(organizationSlug=\"${organizationSlug}\", issueId=<issueID>)\\`\\n`;\n return output;\n },\n});\n"],"mappings":";;;;;;;;AAaA,0BAAe,8BAAW;CACxB,MAAM;CACN,aAA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WAAW,WAAW,YAAY,kBAAkB,aAAa,MAAM,CAAC;AACnF,cAAW,eAAe,aAAa,QAAQ;AAC/C,cAAW,iBAAiB,aAAa,eAAe;AACxD,cAAW,mBAAmB,aAAa,WAAW;EACvD;AACD,YAAU;AACV,aAAW;AACX,aAAW,qGAAqG,iBAAiB;AACjI,SAAO;CACR;AACF,EAAC"}
@@ -80,4 +80,4 @@ var find_transactions_default = defineTool({
80
80
 
81
81
  //#endregion
82
82
  export { find_transactions_default };
83
- //# sourceMappingURL=find-transactions-DZCj81jP.js.map
83
+ //# sourceMappingURL=find-transactions-BiBgg-AE.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"find-transactions-DZCj81jP.js","names":["context: ServerContext"],"sources":["../src/tools/find-transactions.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlugOrAll,\n ParamTransaction,\n ParamQuery,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_transactions\",\n description: [\n \"Find transactions in Sentry using advanced search syntax.\",\n \"\",\n \"Transactions are segments of traces that are associated with a specific route or endpoint.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Search for production transaction data to understand performance.\",\n \"- Analyze traces and latency patterns.\",\n \"- Find examples of recent requests to endpoints.\",\n \"\",\n \"<examples>\",\n \"### Find slow requests to a route\",\n \"\",\n \"...\",\n \"\",\n \"```\",\n \"find_transactions(organizationSlug='my-organization', transaction='/checkout', sortBy='duration')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `find_organizations()` first.\",\n \"- You can use the `find_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlugOrAll.optional(),\n transaction: ParamTransaction.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"timestamp\", \"duration\"])\n .optional()\n .default(\"timestamp\")\n .describe(\n \"Sort the results either by the timestamp of the request (most recent first) or the duration of the request (longest first).\",\n ),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n if (params.projectSlug) setTag(\"project.slug\", params.projectSlug);\n\n const eventList = await apiService.searchSpans({\n organizationSlug,\n projectSlug: params.projectSlug,\n transaction: params.transaction,\n query: params.query,\n sortBy: params.sortBy as \"timestamp\" | \"duration\" | undefined,\n });\n let output = `# Transactions in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (params.query)\n output += `These spans match the query \\`${params.query}\\`\\n`;\n if (params.transaction)\n output += `These spans are limited to the transaction \\`${params.transaction}\\`\\n`;\n output += \"\\n\";\n if (eventList.length === 0) {\n output += `No results found\\n\\n`;\n output += `We searched within the ${organizationSlug} organization.\\n\\n`;\n return output;\n }\n for (const eventSummary of eventList) {\n output += `## \\`${eventSummary.transaction}\\`\\n\\n`;\n output += `**Span ID**: ${eventSummary.id}\\n`;\n output += `**Trace ID**: ${eventSummary.trace}\\n`;\n output += `**Span Operation**: ${eventSummary[\"span.op\"]}\\n`;\n output += `**Span Description**: ${eventSummary[\"span.description\"]}\\n`;\n output += `**Duration**: ${eventSummary[\"span.duration\"]}\\n`;\n output += `**Timestamp**: ${eventSummary.timestamp}\\n`;\n output += `**Project**: ${eventSummary.project}\\n`;\n output += `**URL**: ${apiService.getTraceUrl(organizationSlug, eventSummary.trace)}\\n\\n`;\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B,aAAa,oBAAoB;AACpE,cAAW,gBAAgB,aAAa,iBAAiB;AACzD,cAAW,iBAAiB,aAAa,UAAU;AACnD,cAAW,eAAe,aAAa,QAAQ;AAC/C,cAAW,WAAW,WAAW,YAAY,kBAAkB,aAAa,MAAM,CAAC;EACpF;AACD,SAAO;CACR;AACF,EAAC"}
1
+ {"version":3,"file":"find-transactions-BiBgg-AE.js","names":["context: ServerContext"],"sources":["../src/tools/find-transactions.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlugOrAll,\n ParamTransaction,\n ParamQuery,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_transactions\",\n description: [\n \"Find transactions in Sentry using advanced search syntax.\",\n \"\",\n \"Transactions are segments of traces that are associated with a specific route or endpoint.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Search for production transaction data to understand performance.\",\n \"- Analyze traces and latency patterns.\",\n \"- Find examples of recent requests to endpoints.\",\n \"\",\n \"<examples>\",\n \"### Find slow requests to a route\",\n \"\",\n \"...\",\n \"\",\n \"```\",\n \"find_transactions(organizationSlug='my-organization', transaction='/checkout', sortBy='duration')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `find_organizations()` first.\",\n \"- You can use the `find_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlugOrAll.optional(),\n transaction: ParamTransaction.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"timestamp\", \"duration\"])\n .optional()\n .default(\"timestamp\")\n .describe(\n \"Sort the results either by the timestamp of the request (most recent first) or the duration of the request (longest first).\",\n ),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n if (params.projectSlug) setTag(\"project.slug\", params.projectSlug);\n\n const eventList = await apiService.searchSpans({\n organizationSlug,\n projectSlug: params.projectSlug,\n transaction: params.transaction,\n query: params.query,\n sortBy: params.sortBy as \"timestamp\" | \"duration\" | undefined,\n });\n let output = `# Transactions in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (params.query)\n output += `These spans match the query \\`${params.query}\\`\\n`;\n if (params.transaction)\n output += `These spans are limited to the transaction \\`${params.transaction}\\`\\n`;\n output += \"\\n\";\n if (eventList.length === 0) {\n output += `No results found\\n\\n`;\n output += `We searched within the ${organizationSlug} organization.\\n\\n`;\n return output;\n }\n for (const eventSummary of eventList) {\n output += `## \\`${eventSummary.transaction}\\`\\n\\n`;\n output += `**Span ID**: ${eventSummary.id}\\n`;\n output += `**Trace ID**: ${eventSummary.trace}\\n`;\n output += `**Span Operation**: ${eventSummary[\"span.op\"]}\\n`;\n output += `**Span Description**: ${eventSummary[\"span.description\"]}\\n`;\n output += `**Duration**: ${eventSummary[\"span.duration\"]}\\n`;\n output += `**Timestamp**: ${eventSummary.timestamp}\\n`;\n output += `**Project**: ${eventSummary.project}\\n`;\n output += `**URL**: ${apiService.getTraceUrl(organizationSlug, eventSummary.trace)}\\n\\n`;\n }\n return output;\n },\n});\n"],"mappings":";;;;;;;AAaA,gCAAe,WAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;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O;CACR;AACF,EAAC"}
@@ -86,4 +86,4 @@ Object.defineProperty(exports, 'find_transactions_default', {
86
86
  return find_transactions_default;
87
87
  }
88
88
  });
89
- //# sourceMappingURL=find-transactions-DIJ80wkd.cjs.map
89
+ //# sourceMappingURL=find-transactions-DuZyqjhF.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"find-transactions-DIJ80wkd.cjs","names":["ParamOrganizationSlug","context: ServerContext"],"sources":["../src/tools/find-transactions.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlugOrAll,\n ParamTransaction,\n ParamQuery,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_transactions\",\n description: [\n \"Find transactions in Sentry using advanced search syntax.\",\n \"\",\n \"Transactions are segments of traces that are associated with a specific route or endpoint.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Search for production transaction data to understand performance.\",\n \"- Analyze traces and latency patterns.\",\n \"- Find examples of recent requests to endpoints.\",\n \"\",\n \"<examples>\",\n \"### Find slow requests to a route\",\n \"\",\n \"...\",\n \"\",\n \"```\",\n \"find_transactions(organizationSlug='my-organization', transaction='/checkout', sortBy='duration')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `find_organizations()` first.\",\n \"- You can use the `find_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlugOrAll.optional(),\n transaction: ParamTransaction.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"timestamp\", \"duration\"])\n .optional()\n .default(\"timestamp\")\n .describe(\n \"Sort the results either by the timestamp of the request (most recent first) or the duration of the request (longest first).\",\n ),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n if (params.projectSlug) setTag(\"project.slug\", params.projectSlug);\n\n const eventList = await apiService.searchSpans({\n organizationSlug,\n projectSlug: params.projectSlug,\n transaction: params.transaction,\n query: params.query,\n sortBy: params.sortBy as \"timestamp\" | \"duration\" | undefined,\n });\n let output = `# Transactions in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (params.query)\n output += `These spans match the query \\`${params.query}\\`\\n`;\n if (params.transaction)\n output += `These spans are limited to the transaction \\`${params.transaction}\\`\\n`;\n output += \"\\n\";\n if (eventList.length === 0) {\n output += `No results found\\n\\n`;\n output += `We searched within the ${organizationSlug} organization.\\n\\n`;\n return output;\n }\n for (const eventSummary of eventList) {\n output += `## \\`${eventSummary.transaction}\\`\\n\\n`;\n output += `**Span ID**: ${eventSummary.id}\\n`;\n output += `**Trace ID**: ${eventSummary.trace}\\n`;\n output += `**Span Operation**: ${eventSummary[\"span.op\"]}\\n`;\n output += `**Span Description**: ${eventSummary[\"span.description\"]}\\n`;\n output += `**Duration**: ${eventSummary[\"span.duration\"]}\\n`;\n output += `**Timestamp**: ${eventSummary.timestamp}\\n`;\n output += `**Project**: ${eventSummary.project}\\n`;\n output += `**URL**: ${apiService.getTraceUrl(organizationSlug, eventSummary.trace)}\\n\\n`;\n }\n return output;\n },\n});\n"],"mappings":";;;;;;;;AAaA,gCAAe,8BAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;E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AAC;EACpF;AACD,SAAO;CACR;AACF,EAAC"}
1
+ {"version":3,"file":"find-transactions-DuZyqjhF.cjs","names":["ParamOrganizationSlug","context: ServerContext"],"sources":["../src/tools/find-transactions.ts"],"sourcesContent":["import { z } from \"zod\";\nimport { setTag } from \"@sentry/core\";\nimport { defineTool } from \"./utils/defineTool\";\nimport { apiServiceFromContext } from \"./utils/api-utils\";\nimport type { ServerContext } from \"../types\";\nimport {\n ParamOrganizationSlug,\n ParamRegionUrl,\n ParamProjectSlugOrAll,\n ParamTransaction,\n ParamQuery,\n} from \"../schema\";\n\nexport default defineTool({\n name: \"find_transactions\",\n description: [\n \"Find transactions in Sentry using advanced search syntax.\",\n \"\",\n \"Transactions are segments of traces that are associated with a specific route or endpoint.\",\n \"\",\n \"Use this tool when you need to:\",\n \"- Search for production transaction data to understand performance.\",\n \"- Analyze traces and latency patterns.\",\n \"- Find examples of recent requests to endpoints.\",\n \"\",\n \"<examples>\",\n \"### Find slow requests to a route\",\n \"\",\n \"...\",\n \"\",\n \"```\",\n \"find_transactions(organizationSlug='my-organization', transaction='/checkout', sortBy='duration')\",\n \"```\",\n \"\",\n \"</examples>\",\n \"\",\n \"<hints>\",\n \"- If the user passes a parameter in the form of name/otherName, its likely in the format of <organizationSlug>/<projectSlug>.\",\n \"- If only one parameter is provided, and it could be either `organizationSlug` or `projectSlug`, its probably `organizationSlug`, but if you're really uncertain you might want to call `find_organizations()` first.\",\n \"- You can use the `find_tags()` tool to see what user-defined tags are available.\",\n \"</hints>\",\n ].join(\"\\n\"),\n inputSchema: {\n organizationSlug: ParamOrganizationSlug,\n regionUrl: ParamRegionUrl.optional(),\n projectSlug: ParamProjectSlugOrAll.optional(),\n transaction: ParamTransaction.optional(),\n query: ParamQuery.optional(),\n sortBy: z\n .enum([\"timestamp\", \"duration\"])\n .optional()\n .default(\"timestamp\")\n .describe(\n \"Sort the results either by the timestamp of the request (most recent first) or the duration of the request (longest first).\",\n ),\n },\n async handler(params, context: ServerContext) {\n const apiService = apiServiceFromContext(context, {\n regionUrl: params.regionUrl,\n });\n const organizationSlug = params.organizationSlug;\n\n setTag(\"organization.slug\", organizationSlug);\n if (params.projectSlug) setTag(\"project.slug\", params.projectSlug);\n\n const eventList = await apiService.searchSpans({\n organizationSlug,\n projectSlug: params.projectSlug,\n transaction: params.transaction,\n query: params.query,\n sortBy: params.sortBy as \"timestamp\" | \"duration\" | undefined,\n });\n let output = `# Transactions in **${organizationSlug}${params.projectSlug ? `/${params.projectSlug}` : \"\"}**\\n\\n`;\n if (params.query)\n output += `These spans match the query \\`${params.query}\\`\\n`;\n if (params.transaction)\n output += `These spans are limited to the transaction \\`${params.transaction}\\`\\n`;\n output += \"\\n\";\n if (eventList.length === 0) {\n output += `No results found\\n\\n`;\n output += `We searched within the ${organizationSlug} organization.\\n\\n`;\n return output;\n }\n for (const eventSummary of eventList) {\n output += `## \\`${eventSummary.transaction}\\`\\n\\n`;\n output += `**Span ID**: ${eventSummary.id}\\n`;\n output += `**Trace ID**: ${eventSummary.trace}\\n`;\n output += `**Span Operation**: ${eventSummary[\"span.op\"]}\\n`;\n output += `**Span Description**: ${eventSummary[\"span.description\"]}\\n`;\n output += `**Duration**: ${eventSummary[\"span.duration\"]}\\n`;\n output += `**Timestamp**: ${eventSummary.timestamp}\\n`;\n output += `**Project**: ${eventSummary.project}\\n`;\n output += `**URL**: ${apiService.getTraceUrl(organizationSlug, eventSummary.trace)}\\n\\n`;\n }\n return output;\n },\n});\n"],"mappings":";;;;;;;;AAaA,gCAAe,8BAAW;CACxB,MAAM;CACN,aAAa;EACX;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACD,EAAC,KAAK,KAAK;CACZ,aAAa;EACX,kBAAkBA;EAClB,WAAW,8BAAe,UAAU;EACpC,aAAa,qCAAsB,UAAU;EAC7C,aAAa,gCAAiB,UAAU;EACxC,OAAO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EXTENSIONS = {
3
5
  ".java": "java",
@@ -334,13 +336,42 @@ function formatContexts(contexts) {
334
336
  }).join("\n")}`).join("\n\n")}\n\n`;
335
337
  }
336
338
  /**
339
+ * Formats Seer AI analysis context for inclusion in issue details.
340
+ * Provides a minimal summary showing just the key solution when available.
341
+ *
342
+ * @param autofixState - The autofix state containing Seer analysis data
343
+ * @returns Formatted markdown string with Seer context, or empty string if no analysis exists
344
+ */
345
+ function formatSeerContext(autofixState) {
346
+ if (!autofixState.autofix) return "";
347
+ const { autofix } = autofixState;
348
+ const parts = [];
349
+ parts.push("## Seer AI Analysis");
350
+ parts.push("");
351
+ if (isTerminalStatus(autofix.status) && autofix.steps.length > 0) {
352
+ const completedSteps = autofix.steps.filter((step) => step.status === "COMPLETED");
353
+ const solutionStep = completedSteps.find((step) => step.type === "solution");
354
+ if (solutionStep) {
355
+ const solutionDescription = solutionStep.description;
356
+ if (solutionDescription && typeof solutionDescription === "string" && solutionDescription.trim()) parts.push(solutionDescription.trim());
357
+ else {
358
+ const solutionOutput = getOutputForAutofixStep(solutionStep);
359
+ const lines = solutionOutput.split("\n");
360
+ const firstParagraph = lines.find((line) => line.trim().length > 50 && !line.startsWith("#") && !line.startsWith("*"));
361
+ if (firstParagraph) parts.push(firstParagraph.trim());
362
+ }
363
+ }
364
+ }
365
+ return `${parts.join("\n")}\n\n`;
366
+ }
367
+ /**
337
368
  * Formats a Sentry issue with its latest event into comprehensive markdown output.
338
369
  * Includes issue metadata, event details, and usage instructions.
339
370
  *
340
371
  * @param params - Object containing organization slug, issue, event, and API service
341
372
  * @returns Formatted markdown string with complete issue information
342
373
  */
343
- function formatIssueOutput({ organizationSlug, issue, event, apiService }) {
374
+ function formatIssueOutput({ organizationSlug, issue, event, apiService, autofixState }) {
344
375
  let output = `# Issue ${issue.shortId} in **${organizationSlug}**\n\n`;
345
376
  output += `**Description**: ${issue.title}\n`;
346
377
  output += `**Culprit**: ${issue.culprit}\n`;
@@ -359,6 +390,7 @@ function formatIssueOutput({ organizationSlug, issue, event, apiService }) {
359
390
  if (event.message) output += `**Message**:\n${event.message}\n`;
360
391
  output += "\n";
361
392
  output += formatEventOutput(event);
393
+ if (autofixState) output += formatSeerContext(autofixState);
362
394
  output += "# Using this information\n\n";
363
395
  output += `- You can reference the IssueID in commit messages (e.g. \`Fixes ${issue.shortId}\`) to automatically close the issue when the commit is merged.\n`;
364
396
  output += "- The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\n";
@@ -367,4 +399,4 @@ function formatIssueOutput({ organizationSlug, issue, event, apiService }) {
367
399
 
368
400
  //#endregion
369
401
  export { formatEventOutput, formatFrameHeader, formatIssueOutput };
370
- //# sourceMappingURL=formatting-pUm38KOj.js.map
402
+ //# sourceMappingURL=formatting-Bvyded57.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatting-Bvyded57.js","names":["LANGUAGE_EXTENSIONS: Record<string, string>","LANGUAGE_MODULE_PATTERNS: Array<[RegExp, string]>","frame: z.infer<typeof FrameInterface>","platform?: string | null","frameIndex?: number","event: Event","parts: string[]","data: z.infer<typeof ErrorEntrySchema>","platform: string | null","index: number","totalExceptions: number","data: z.infer<typeof RequestEntrySchema>","data: z.infer<typeof MessageEntrySchema>","data: z.infer<typeof ThreadsEntrySchema>","lines: string[]","value: unknown","vars: Record<string, unknown>","frames: z.infer<typeof FrameInterface>[]","contexts: z.infer<typeof EventSchema>[\"contexts\"]","autofixState: AutofixRunState"],"sources":["../src/internal/formatting.ts"],"sourcesContent":["/**\n * LLM response formatting utilities for Sentry data.\n *\n * Converts Sentry API responses into structured markdown format optimized\n * for LLM consumption. Handles stacktraces, event details, issue summaries,\n * and contextual information with consistent formatting patterns.\n */\nimport type { z } from \"zod\";\nimport type { Event, Issue, AutofixRunState } from \"../api-client/types\";\nimport type {\n ErrorEntrySchema,\n ErrorEventSchema,\n EventSchema,\n FrameInterface,\n RequestEntrySchema,\n MessageEntrySchema,\n ThreadsEntrySchema,\n SentryApiService,\n} from \"../api-client\";\nimport {\n getOutputForAutofixStep,\n getStatusDisplayName,\n isTerminalStatus,\n} from \"../tools/utils/seer-utils\";\n\n// Language detection mappings\nconst LANGUAGE_EXTENSIONS: Record<string, string> = {\n \".java\": \"java\",\n \".py\": \"python\",\n \".js\": \"javascript\",\n \".jsx\": \"javascript\",\n \".ts\": \"javascript\",\n \".tsx\": \"javascript\",\n \".rb\": \"ruby\",\n \".php\": \"php\",\n};\n\nconst LANGUAGE_MODULE_PATTERNS: Array<[RegExp, string]> = [\n [/^(java\\.|com\\.|org\\.)/, \"java\"],\n];\n\n/**\n * Detects the programming language of a stack frame based on the file extension.\n * Falls back to the platform parameter if no filename is available or extension is unrecognized.\n *\n * @param frame - The stack frame containing file and location information\n * @param platform - Optional platform hint to use as fallback\n * @returns The detected language or platform fallback or \"unknown\"\n */\nfunction detectLanguage(\n frame: z.infer<typeof FrameInterface>,\n platform?: string | null,\n): string {\n // Check filename extensions\n if (frame.filename) {\n const ext = frame.filename.toLowerCase().match(/\\.[^.]+$/)?.[0];\n if (ext && LANGUAGE_EXTENSIONS[ext]) {\n return LANGUAGE_EXTENSIONS[ext];\n }\n }\n\n // Check module patterns\n if (frame.module) {\n for (const [pattern, language] of LANGUAGE_MODULE_PATTERNS) {\n if (pattern.test(frame.module)) {\n return language;\n }\n }\n }\n\n // Fallback to platform or unknown\n return platform || \"unknown\";\n}\n\n/**\n * Formats a stack frame into a language-specific string representation.\n * Different languages have different conventions for displaying stack traces.\n *\n * @param frame - The stack frame to format\n * @param frameIndex - Optional frame index for languages that display frame numbers\n * @param platform - Optional platform hint for language detection fallback\n * @returns Formatted stack frame string\n */\nexport function formatFrameHeader(\n frame: z.infer<typeof FrameInterface>,\n frameIndex?: number,\n platform?: string | null,\n) {\n const language = detectLanguage(frame, platform);\n\n switch (language) {\n case \"java\": {\n // at com.example.ClassName.methodName(FileName.java:123)\n const className = frame.module || \"UnknownClass\";\n const method = frame.function || \"<unknown>\";\n const source = frame.filename || \"Unknown Source\";\n const location = frame.lineNo ? `:${frame.lineNo}` : \"\";\n return `at ${className}.${method}(${source}${location})`;\n }\n\n case \"python\": {\n // File \"/path/to/file.py\", line 42, in function_name\n const file =\n frame.filename || frame.absPath || frame.module || \"<unknown>\";\n const func = frame.function || \"<module>\";\n const line = frame.lineNo ? `, line ${frame.lineNo}` : \"\";\n return ` File \"${file}\"${line}, in ${func}`;\n }\n\n case \"javascript\": {\n // Original compact format: filename:line:col (function)\n // This preserves backward compatibility\n return `${[frame.filename, frame.lineNo, frame.colNo]\n .filter((i) => !!i)\n .join(\":\")}${frame.function ? ` (${frame.function})` : \"\"}`;\n }\n\n case \"ruby\": {\n // from /path/to/file.rb:42:in `method_name'\n const file = frame.filename || frame.module || \"<unknown>\";\n const func = frame.function ? ` \\`${frame.function}\\`` : \"\";\n const line = frame.lineNo ? `:${frame.lineNo}:in` : \"\";\n return ` from ${file}${line}${func}`;\n }\n\n case \"php\": {\n // #0 /path/to/file.php(42): functionName()\n const file = frame.filename || \"<unknown>\";\n const line = frame.lineNo ? `(${frame.lineNo})` : \"\";\n const func = frame.function || \"<unknown>\";\n const prefix = frameIndex !== undefined ? `#${frameIndex} ` : \"\";\n return `${prefix}${file}${line}: ${func}()`;\n }\n\n default: {\n // Generic format for unknown languages\n const func = frame.function || \"<unknown>\";\n const location = frame.filename || frame.module || \"<unknown>\";\n const line = frame.lineNo ? `:${frame.lineNo}` : \"\";\n const col = frame.colNo != null ? `:${frame.colNo}` : \"\";\n return ` at ${func} (${location}${line}${col})`;\n }\n }\n}\n\n/**\n * Formats a Sentry event into a structured markdown output.\n * Includes error messages, stack traces, request info, and contextual data.\n *\n * @param event - The Sentry event to format\n * @returns Formatted markdown string\n */\nexport function formatEventOutput(event: Event) {\n let output = \"\";\n\n // Look for the primary error information\n const messageEntry = event.entries.find((e) => e.type === \"message\");\n const exceptionEntry = event.entries.find((e) => e.type === \"exception\");\n const threadsEntry = event.entries.find((e) => e.type === \"threads\");\n const requestEntry = event.entries.find((e) => e.type === \"request\");\n\n // Error message (if present)\n if (messageEntry) {\n output += formatMessageInterfaceOutput(\n event,\n messageEntry.data as z.infer<typeof MessageEntrySchema>,\n );\n }\n\n // Stack trace (from exception or threads)\n if (exceptionEntry) {\n output += formatExceptionInterfaceOutput(\n event,\n exceptionEntry.data as z.infer<typeof ErrorEntrySchema>,\n );\n } else if (threadsEntry) {\n output += formatThreadsInterfaceOutput(\n event,\n threadsEntry.data as z.infer<typeof ThreadsEntrySchema>,\n );\n }\n\n // Request info (if HTTP error)\n if (requestEntry) {\n output += formatRequestInterfaceOutput(\n event,\n requestEntry.data as z.infer<typeof RequestEntrySchema>,\n );\n }\n\n output += formatContexts(event.contexts);\n return output;\n}\n\n/**\n * Extracts the context line matching the frame's line number for inline display.\n * This is used in the full stacktrace view to show the actual line of code\n * that caused the error inline with the stack frame.\n *\n * @param frame - The stack frame containing context lines\n * @returns The line of code at the frame's line number, or empty string if not available\n */\nfunction renderInlineContext(frame: z.infer<typeof FrameInterface>): string {\n if (!frame.context?.length || !frame.lineNo) {\n return \"\";\n }\n\n const contextLine = frame.context.find(([lineNo]) => lineNo === frame.lineNo);\n return contextLine ? `\\n${contextLine[1]}` : \"\";\n}\n\n/**\n * Renders an enhanced view of a stack frame with context lines and variables.\n * Used for the \"Most Relevant Frame\" section to provide detailed information\n * about the most relevant application frame where the error occurred.\n *\n * @param frame - The stack frame to render with enhanced information\n * @param event - The Sentry event containing platform information for language detection\n * @returns Formatted string with frame header, context lines, and variables table\n */\nfunction renderEnhancedFrame(\n frame: z.infer<typeof FrameInterface>,\n event: Event,\n): string {\n const parts: string[] = [];\n\n parts.push(\"**Most Relevant Frame:**\");\n parts.push(\"─────────────────────\");\n parts.push(formatFrameHeader(frame, undefined, event.platform));\n\n // Add context lines if available\n if (frame.context?.length) {\n const contextLines = renderContextLines(frame);\n if (contextLines) {\n parts.push(\"\");\n parts.push(contextLines);\n }\n }\n\n // Add variables table if available\n if (frame.vars && Object.keys(frame.vars).length > 0) {\n parts.push(\"\");\n parts.push(renderVariablesTable(frame.vars));\n }\n\n return parts.join(\"\\n\");\n}\n\nfunction formatExceptionInterfaceOutput(\n event: Event,\n data: z.infer<typeof ErrorEntrySchema>,\n) {\n const parts: string[] = [];\n\n // Handle both single exception (value) and chained exceptions (values)\n const exceptions = data.values || (data.value ? [data.value] : []);\n\n if (exceptions.length === 0) {\n return \"\";\n }\n\n // For chained exceptions, they are typically ordered from innermost to outermost\n // We'll render them in reverse order (outermost first) to match how they occurred\n const isChained = exceptions.length > 1;\n\n // Create a copy before reversing to avoid mutating the original array\n [...exceptions].reverse().forEach((exception, index) => {\n if (!exception) return;\n\n // Add language-specific chain indicator for multiple exceptions\n if (isChained && index > 0) {\n parts.push(\"\");\n parts.push(\n getExceptionChainMessage(event.platform, index, exceptions.length),\n );\n parts.push(\"\");\n }\n\n // Use the actual exception type and value as the heading\n const exceptionTitle = `${exception.type}${exception.value ? `: ${exception.value}` : \"\"}`;\n\n parts.push(index === 0 ? \"### Error\" : `### ${exceptionTitle}`);\n parts.push(\"\");\n\n // Add the error details in a code block for the first exception\n // to maintain backward compatibility\n if (index === 0) {\n parts.push(\"```\");\n parts.push(exceptionTitle);\n parts.push(\"```\");\n parts.push(\"\");\n }\n\n if (!exception.stacktrace || !exception.stacktrace.frames) {\n parts.push(\"**Stacktrace:**\");\n parts.push(\"```\");\n parts.push(\"No stacktrace available\");\n parts.push(\"```\");\n return;\n }\n\n const frames = exception.stacktrace.frames;\n\n // Only show enhanced frame for the first (outermost) exception to avoid overwhelming output\n if (index === 0) {\n const firstInAppFrame = findFirstInAppFrame(frames);\n if (\n firstInAppFrame &&\n (firstInAppFrame.context?.length || firstInAppFrame.vars)\n ) {\n parts.push(renderEnhancedFrame(firstInAppFrame, event));\n parts.push(\"\");\n parts.push(\"**Full Stacktrace:**\");\n parts.push(\"────────────────\");\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n\n parts.push(\"```\");\n parts.push(\n frames\n .map((frame) => {\n const header = formatFrameHeader(frame, undefined, event.platform);\n const context = renderInlineContext(frame);\n return `${header}${context}`;\n })\n .join(\"\\n\"),\n );\n parts.push(\"```\");\n });\n\n parts.push(\"\");\n parts.push(\"\");\n\n return parts.join(\"\\n\");\n}\n\n/**\n * Get the appropriate exception chain message based on the platform\n */\nfunction getExceptionChainMessage(\n platform: string | null,\n index: number,\n totalExceptions: number,\n): string {\n // Default message for unknown platforms\n const defaultMessage =\n \"**During handling of the above exception, another exception occurred:**\";\n\n if (!platform) {\n return defaultMessage;\n }\n\n switch (platform.toLowerCase()) {\n case \"python\":\n // Python has two distinct messages, but without additional metadata\n // we default to the implicit chaining message\n return \"**During handling of the above exception, another exception occurred:**\";\n\n case \"java\":\n return \"**Caused by:**\";\n\n case \"csharp\":\n case \"dotnet\":\n return \"**---> Inner Exception:**\";\n\n case \"ruby\":\n return \"**Caused by:**\";\n\n case \"go\":\n return \"**Wrapped error:**\";\n\n case \"rust\":\n return `**Caused by (${index}):**`;\n\n default:\n return defaultMessage;\n }\n}\n\nfunction formatRequestInterfaceOutput(\n event: Event,\n data: z.infer<typeof RequestEntrySchema>,\n) {\n if (!data.method || !data.url) {\n return \"\";\n }\n return `### HTTP Request\\n\\n**Method:** ${data.method}\\n**URL:** ${data.url}\\n\\n`;\n}\n\nfunction formatMessageInterfaceOutput(\n event: Event,\n data: z.infer<typeof MessageEntrySchema>,\n) {\n if (!data.formatted && !data.message) {\n return \"\";\n }\n const message = data.formatted || data.message || \"\";\n return `### Error\\n\\n${\"```\"}\\n${message}\\n${\"```\"}\\n\\n`;\n}\n\nfunction formatThreadsInterfaceOutput(\n event: Event,\n data: z.infer<typeof ThreadsEntrySchema>,\n) {\n if (!data.values || data.values.length === 0) {\n return \"\";\n }\n\n // Find the crashed thread only\n const crashedThread = data.values.find((t) => t.crashed);\n\n if (!crashedThread?.stacktrace?.frames) {\n return \"\";\n }\n\n const parts: string[] = [];\n\n // Include thread name if available\n if (crashedThread.name) {\n parts.push(`**Thread** (${crashedThread.name})`);\n parts.push(\"\");\n }\n\n const frames = crashedThread.stacktrace.frames;\n\n // Find and format the first in-app frame with enhanced view\n const firstInAppFrame = findFirstInAppFrame(frames);\n if (\n firstInAppFrame &&\n (firstInAppFrame.context?.length || firstInAppFrame.vars)\n ) {\n parts.push(renderEnhancedFrame(firstInAppFrame, event));\n parts.push(\"\");\n parts.push(\"**Full Stacktrace:**\");\n parts.push(\"────────────────\");\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n\n parts.push(\"```\");\n parts.push(\n frames\n .map((frame) => {\n const header = formatFrameHeader(frame, undefined, event.platform);\n const context = renderInlineContext(frame);\n return `${header}${context}`;\n })\n .join(\"\\n\"),\n );\n parts.push(\"```\");\n parts.push(\"\");\n\n return parts.join(\"\\n\");\n}\n\n/**\n * Renders surrounding source code context for a stack frame.\n * Shows a window of code lines around the error line with visual indicators.\n *\n * @param frame - The stack frame containing context lines\n * @param contextSize - Number of lines to show before and after the error line (default: 3)\n * @returns Formatted context lines with line numbers and arrow indicator for the error line\n */\nfunction renderContextLines(\n frame: z.infer<typeof FrameInterface>,\n contextSize = 3,\n): string {\n if (!frame.context || frame.context.length === 0 || !frame.lineNo) {\n return \"\";\n }\n\n const lines: string[] = [];\n const errorLine = frame.lineNo;\n const maxLineNoWidth = Math.max(\n ...frame.context.map(([lineNo]) => lineNo.toString().length),\n );\n\n for (const [lineNo, code] of frame.context) {\n const isErrorLine = lineNo === errorLine;\n const lineNoStr = lineNo.toString().padStart(maxLineNoWidth, \" \");\n\n if (Math.abs(lineNo - errorLine) <= contextSize) {\n if (isErrorLine) {\n lines.push(` → ${lineNoStr} │ ${code}`);\n } else {\n lines.push(` ${lineNoStr} │ ${code}`);\n }\n }\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Formats a variable value for display in the variables table.\n * Handles different types appropriately and safely, converting complex objects\n * to readable representations and handling edge cases like circular references.\n *\n * @param value - The variable value to format (can be any type)\n * @param maxLength - Maximum length for stringified objects/arrays (default: 80)\n * @returns Human-readable string representation of the value\n */\nfunction formatVariableValue(value: unknown, maxLength = 80): string {\n try {\n if (typeof value === \"string\") {\n return `\"${value}\"`;\n }\n if (value === null) {\n return \"null\";\n }\n if (value === undefined) {\n return \"undefined\";\n }\n if (typeof value === \"object\") {\n const stringified = JSON.stringify(value);\n if (stringified.length > maxLength) {\n // Leave room for \", ...]\" or \", ...}\"\n const truncateAt = maxLength - 6;\n let truncated = stringified.substring(0, truncateAt);\n\n // Find the last complete element by looking for the last comma\n const lastComma = truncated.lastIndexOf(\",\");\n if (lastComma > 0) {\n truncated = truncated.substring(0, lastComma);\n }\n\n // Add the appropriate ending\n if (Array.isArray(value)) {\n return `${truncated}, ...]`;\n }\n return `${truncated}, ...}`;\n }\n return stringified;\n }\n return String(value);\n } catch {\n // Handle circular references or other stringify errors\n return `<${typeof value}>`;\n }\n}\n\n/**\n * Renders a table of local variables in a tree-like format.\n * Uses box-drawing characters to create a visual hierarchy of variables\n * and their values at the point where the error occurred.\n *\n * @param vars - Object containing variable names as keys and their values\n * @returns Formatted variables table with tree-style prefix characters\n */\nfunction renderVariablesTable(vars: Record<string, unknown>): string {\n const entries = Object.entries(vars);\n if (entries.length === 0) {\n return \"\";\n }\n\n const lines: string[] = [\"Local Variables:\"];\n const lastIndex = entries.length - 1;\n\n entries.forEach(([key, value], index) => {\n const prefix = index === lastIndex ? \"└─\" : \"├─\";\n const valueStr = formatVariableValue(value);\n lines.push(`${prefix} ${key}: ${valueStr}`);\n });\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Finds the first application frame (in_app) in a stack trace.\n * Searches from the bottom of the stack (oldest frame) to find the first\n * frame that belongs to the user's application code rather than libraries.\n *\n * @param frames - Array of stack frames, typically in reverse chronological order\n * @returns The first in-app frame found, or undefined if none exist\n */\nfunction findFirstInAppFrame(\n frames: z.infer<typeof FrameInterface>[],\n): z.infer<typeof FrameInterface> | undefined {\n // Frames are usually in reverse order (most recent first)\n // We want the first in-app frame from the bottom\n for (let i = frames.length - 1; i >= 0; i--) {\n if (frames[i].inApp === true) {\n return frames[i];\n }\n }\n return undefined;\n}\n\nfunction formatContexts(contexts: z.infer<typeof EventSchema>[\"contexts\"]) {\n if (!contexts || Object.keys(contexts).length === 0) {\n return \"\";\n }\n return `### Additional Context\\n\\nThese are additional context provided by the user when they're instrumenting their application.\\n\\n${Object.entries(\n contexts,\n )\n .map(\n ([name, data]) =>\n `**${name}**\\n${Object.entries(data)\n .filter(([key, _]) => key !== \"type\")\n .map(([key, value]) => {\n return `${key}: ${JSON.stringify(value, undefined, 2)}`;\n })\n .join(\"\\n\")}`,\n )\n .join(\"\\n\\n\")}\\n\\n`;\n}\n\n/**\n * Formats Seer AI analysis context for inclusion in issue details.\n * Provides a minimal summary showing just the key solution when available.\n *\n * @param autofixState - The autofix state containing Seer analysis data\n * @returns Formatted markdown string with Seer context, or empty string if no analysis exists\n */\nfunction formatSeerContext(autofixState: AutofixRunState): string {\n if (!autofixState.autofix) {\n return \"\";\n }\n\n const { autofix } = autofixState;\n const parts: string[] = [];\n\n parts.push(\"## Seer AI Analysis\");\n parts.push(\"\");\n\n // For completed analyses, show just the key solution\n if (isTerminalStatus(autofix.status) && autofix.steps.length > 0) {\n const completedSteps = autofix.steps.filter(\n (step) => step.status === \"COMPLETED\",\n );\n\n // Find the solution step and show its description directly\n const solutionStep = completedSteps.find(\n (step) => step.type === \"solution\",\n );\n\n if (solutionStep) {\n // For solution steps, use the description directly\n const solutionDescription = solutionStep.description;\n if (\n solutionDescription &&\n typeof solutionDescription === \"string\" &&\n solutionDescription.trim()\n ) {\n parts.push(solutionDescription.trim());\n } else {\n // Fallback to extracting from output if no description\n const solutionOutput = getOutputForAutofixStep(solutionStep);\n const lines = solutionOutput.split(\"\\n\");\n const firstParagraph = lines.find(\n (line) =>\n line.trim().length > 50 &&\n !line.startsWith(\"#\") &&\n !line.startsWith(\"*\"),\n );\n if (firstParagraph) {\n parts.push(firstParagraph.trim());\n }\n }\n }\n }\n return `${parts.join(\"\\n\")}\\n\\n`;\n}\n\n/**\n * Formats a Sentry issue with its latest event into comprehensive markdown output.\n * Includes issue metadata, event details, and usage instructions.\n *\n * @param params - Object containing organization slug, issue, event, and API service\n * @returns Formatted markdown string with complete issue information\n */\nexport function formatIssueOutput({\n organizationSlug,\n issue,\n event,\n apiService,\n autofixState,\n}: {\n organizationSlug: string;\n issue: Issue;\n event: Event;\n apiService: SentryApiService;\n autofixState?: AutofixRunState;\n}) {\n let output = `# Issue ${issue.shortId} in **${organizationSlug}**\\n\\n`;\n output += `**Description**: ${issue.title}\\n`;\n output += `**Culprit**: ${issue.culprit}\\n`;\n output += `**First Seen**: ${new Date(issue.firstSeen).toISOString()}\\n`;\n output += `**Last Seen**: ${new Date(issue.lastSeen).toISOString()}\\n`;\n output += `**Occurrences**: ${issue.count}\\n`;\n output += `**Users Impacted**: ${issue.userCount}\\n`;\n output += `**Status**: ${issue.status}\\n`;\n output += `**Platform**: ${issue.platform}\\n`;\n output += `**Project**: ${issue.project.name}\\n`;\n output += `**URL**: ${apiService.getIssueUrl(organizationSlug, issue.shortId)}\\n`;\n output += \"\\n\";\n output += \"## Event Details\\n\\n\";\n output += `**Event ID**: ${event.id}\\n`;\n if (event.type === \"error\") {\n output += `**Occurred At**: ${new Date((event as z.infer<typeof ErrorEventSchema>).dateCreated).toISOString()}\\n`;\n }\n if (event.message) {\n output += `**Message**:\\n${event.message}\\n`;\n }\n output += \"\\n\";\n output += formatEventOutput(event);\n\n // Add Seer context if available\n if (autofixState) {\n output += formatSeerContext(autofixState);\n }\n\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the IssueID in commit messages (e.g. \\`Fixes ${issue.shortId}\\`) to automatically close the issue when the commit is merged.\\n`;\n output +=\n \"- The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\\n\";\n return output;\n}\n"],"mappings":";;;AA0BA,MAAMA,sBAA8C;CAClD,SAAS;CACT,OAAO;CACP,OAAO;CACP,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tTBwGbw.js";
3
- import { SentryApiService } from "./client-BCN17Wbp.js";
1
+ import { FrameInterface } from "./schema-3NeMWRAm.cjs";
2
+ import { AutofixRunState, Event, Issue } from "./types-BoMP-Ro6.cjs";
3
+ import { SentryApiService } from "./client-CQ9Xe1aN.cjs";
4
4
  import { z } from "zod";
5
5
 
6
6
  //#region src/internal/formatting.d.ts
@@ -34,14 +34,16 @@ declare function formatIssueOutput({
34
34
  organizationSlug,
35
35
  issue,
36
36
  event,
37
- apiService
37
+ apiService,
38
+ autofixState
38
39
  }: {
39
40
  organizationSlug: string;
40
41
  issue: Issue;
41
42
  event: Event;
42
43
  apiService: SentryApiService;
44
+ autofixState?: AutofixRunState;
43
45
  }): string;
44
46
  //# sourceMappingURL=formatting.d.ts.map
45
47
  //#endregion
46
48
  export { formatEventOutput, formatFrameHeader, formatIssueOutput };
47
- //# sourceMappingURL=formatting-kdIeURER.d.ts.map
49
+ //# sourceMappingURL=formatting-CcTK2X8V.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatting-CcTK2X8V.d.cts","names":[],"sources":["../src/internal/formatting.ts"],"sourcesContent":[],"mappings":";;;;;;;AAoFgB;AAoEhB;AA2gBA;;;;;;;AAQS,iBAxlBO,iBAAA,CAwlBP,KAAA,EAvlBA,CAAA,CAAE,KAulBF,CAAA,OAvlBe,cAulBf,CAAA,EAAA,UAAA,CAAA,EAAA,MAAA,EAAA,QAAA,CAAA,EAAA,MAAA,GAAA,IAAA,CAAA,EAAA,MAAA;;;;AAGuB;;;;iBAthBhB,iBAAA,QAAyB;;;;;;;;iBA2gBzB,iBAAA;;;;;;;;SAQP;SACA;cACK;iBACG"}
@@ -1,3 +1,4 @@
1
+ const require_seer_utils = require('./seer-utils-CDm5J8ur.cjs');
1
2
 
2
3
  //#region src/internal/formatting.ts
3
4
  const LANGUAGE_EXTENSIONS = {
@@ -335,13 +336,42 @@ function formatContexts(contexts) {
335
336
  }).join("\n")}`).join("\n\n")}\n\n`;
336
337
  }
337
338
  /**
339
+ * Formats Seer AI analysis context for inclusion in issue details.
340
+ * Provides a minimal summary showing just the key solution when available.
341
+ *
342
+ * @param autofixState - The autofix state containing Seer analysis data
343
+ * @returns Formatted markdown string with Seer context, or empty string if no analysis exists
344
+ */
345
+ function formatSeerContext(autofixState) {
346
+ if (!autofixState.autofix) return "";
347
+ const { autofix } = autofixState;
348
+ const parts = [];
349
+ parts.push("## Seer AI Analysis");
350
+ parts.push("");
351
+ if (require_seer_utils.isTerminalStatus(autofix.status) && autofix.steps.length > 0) {
352
+ const completedSteps = autofix.steps.filter((step) => step.status === "COMPLETED");
353
+ const solutionStep = completedSteps.find((step) => step.type === "solution");
354
+ if (solutionStep) {
355
+ const solutionDescription = solutionStep.description;
356
+ if (solutionDescription && typeof solutionDescription === "string" && solutionDescription.trim()) parts.push(solutionDescription.trim());
357
+ else {
358
+ const solutionOutput = require_seer_utils.getOutputForAutofixStep(solutionStep);
359
+ const lines = solutionOutput.split("\n");
360
+ const firstParagraph = lines.find((line) => line.trim().length > 50 && !line.startsWith("#") && !line.startsWith("*"));
361
+ if (firstParagraph) parts.push(firstParagraph.trim());
362
+ }
363
+ }
364
+ }
365
+ return `${parts.join("\n")}\n\n`;
366
+ }
367
+ /**
338
368
  * Formats a Sentry issue with its latest event into comprehensive markdown output.
339
369
  * Includes issue metadata, event details, and usage instructions.
340
370
  *
341
371
  * @param params - Object containing organization slug, issue, event, and API service
342
372
  * @returns Formatted markdown string with complete issue information
343
373
  */
344
- function formatIssueOutput({ organizationSlug, issue, event, apiService }) {
374
+ function formatIssueOutput({ organizationSlug, issue, event, apiService, autofixState }) {
345
375
  let output = `# Issue ${issue.shortId} in **${organizationSlug}**\n\n`;
346
376
  output += `**Description**: ${issue.title}\n`;
347
377
  output += `**Culprit**: ${issue.culprit}\n`;
@@ -360,6 +390,7 @@ function formatIssueOutput({ organizationSlug, issue, event, apiService }) {
360
390
  if (event.message) output += `**Message**:\n${event.message}\n`;
361
391
  output += "\n";
362
392
  output += formatEventOutput(event);
393
+ if (autofixState) output += formatSeerContext(autofixState);
363
394
  output += "# Using this information\n\n";
364
395
  output += `- You can reference the IssueID in commit messages (e.g. \`Fixes ${issue.shortId}\`) to automatically close the issue when the commit is merged.\n`;
365
396
  output += "- The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\n";
@@ -385,4 +416,4 @@ Object.defineProperty(exports, 'formatIssueOutput', {
385
416
  return formatIssueOutput;
386
417
  }
387
418
  });
388
- //# sourceMappingURL=formatting-BlMiQa9i.cjs.map
419
+ //# sourceMappingURL=formatting-D0Aki7rK.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatting-D0Aki7rK.cjs","names":["LANGUAGE_EXTENSIONS: Record<string, string>","LANGUAGE_MODULE_PATTERNS: Array<[RegExp, string]>","frame: z.infer<typeof FrameInterface>","platform?: string | null","frameIndex?: number","event: Event","parts: string[]","data: z.infer<typeof ErrorEntrySchema>","platform: string | null","index: number","totalExceptions: number","data: z.infer<typeof RequestEntrySchema>","data: z.infer<typeof MessageEntrySchema>","data: z.infer<typeof ThreadsEntrySchema>","lines: string[]","value: unknown","vars: Record<string, unknown>","frames: z.infer<typeof FrameInterface>[]","contexts: z.infer<typeof EventSchema>[\"contexts\"]","autofixState: AutofixRunState"],"sources":["../src/internal/formatting.ts"],"sourcesContent":["/**\n * LLM response formatting utilities for Sentry data.\n *\n * Converts Sentry API responses into structured markdown format optimized\n * for LLM consumption. Handles stacktraces, event details, issue summaries,\n * and contextual information with consistent formatting patterns.\n */\nimport type { z } from \"zod\";\nimport type { Event, Issue, AutofixRunState } from \"../api-client/types\";\nimport type {\n ErrorEntrySchema,\n ErrorEventSchema,\n EventSchema,\n FrameInterface,\n RequestEntrySchema,\n MessageEntrySchema,\n ThreadsEntrySchema,\n SentryApiService,\n} from \"../api-client\";\nimport {\n getOutputForAutofixStep,\n getStatusDisplayName,\n isTerminalStatus,\n} from \"../tools/utils/seer-utils\";\n\n// Language detection mappings\nconst LANGUAGE_EXTENSIONS: Record<string, string> = {\n \".java\": \"java\",\n \".py\": \"python\",\n \".js\": \"javascript\",\n \".jsx\": \"javascript\",\n \".ts\": \"javascript\",\n \".tsx\": \"javascript\",\n \".rb\": \"ruby\",\n \".php\": \"php\",\n};\n\nconst LANGUAGE_MODULE_PATTERNS: Array<[RegExp, string]> = [\n [/^(java\\.|com\\.|org\\.)/, \"java\"],\n];\n\n/**\n * Detects the programming language of a stack frame based on the file extension.\n * Falls back to the platform parameter if no filename is available or extension is unrecognized.\n *\n * @param frame - The stack frame containing file and location information\n * @param platform - Optional platform hint to use as fallback\n * @returns The detected language or platform fallback or \"unknown\"\n */\nfunction detectLanguage(\n frame: z.infer<typeof FrameInterface>,\n platform?: string | null,\n): string {\n // Check filename extensions\n if (frame.filename) {\n const ext = frame.filename.toLowerCase().match(/\\.[^.]+$/)?.[0];\n if (ext && LANGUAGE_EXTENSIONS[ext]) {\n return LANGUAGE_EXTENSIONS[ext];\n }\n }\n\n // Check module patterns\n if (frame.module) {\n for (const [pattern, language] of LANGUAGE_MODULE_PATTERNS) {\n if (pattern.test(frame.module)) {\n return language;\n }\n }\n }\n\n // Fallback to platform or unknown\n return platform || \"unknown\";\n}\n\n/**\n * Formats a stack frame into a language-specific string representation.\n * Different languages have different conventions for displaying stack traces.\n *\n * @param frame - The stack frame to format\n * @param frameIndex - Optional frame index for languages that display frame numbers\n * @param platform - Optional platform hint for language detection fallback\n * @returns Formatted stack frame string\n */\nexport function formatFrameHeader(\n frame: z.infer<typeof FrameInterface>,\n frameIndex?: number,\n platform?: string | null,\n) {\n const language = detectLanguage(frame, platform);\n\n switch (language) {\n case \"java\": {\n // at com.example.ClassName.methodName(FileName.java:123)\n const className = frame.module || \"UnknownClass\";\n const method = frame.function || \"<unknown>\";\n const source = frame.filename || \"Unknown Source\";\n const location = frame.lineNo ? `:${frame.lineNo}` : \"\";\n return `at ${className}.${method}(${source}${location})`;\n }\n\n case \"python\": {\n // File \"/path/to/file.py\", line 42, in function_name\n const file =\n frame.filename || frame.absPath || frame.module || \"<unknown>\";\n const func = frame.function || \"<module>\";\n const line = frame.lineNo ? `, line ${frame.lineNo}` : \"\";\n return ` File \"${file}\"${line}, in ${func}`;\n }\n\n case \"javascript\": {\n // Original compact format: filename:line:col (function)\n // This preserves backward compatibility\n return `${[frame.filename, frame.lineNo, frame.colNo]\n .filter((i) => !!i)\n .join(\":\")}${frame.function ? ` (${frame.function})` : \"\"}`;\n }\n\n case \"ruby\": {\n // from /path/to/file.rb:42:in `method_name'\n const file = frame.filename || frame.module || \"<unknown>\";\n const func = frame.function ? ` \\`${frame.function}\\`` : \"\";\n const line = frame.lineNo ? `:${frame.lineNo}:in` : \"\";\n return ` from ${file}${line}${func}`;\n }\n\n case \"php\": {\n // #0 /path/to/file.php(42): functionName()\n const file = frame.filename || \"<unknown>\";\n const line = frame.lineNo ? `(${frame.lineNo})` : \"\";\n const func = frame.function || \"<unknown>\";\n const prefix = frameIndex !== undefined ? `#${frameIndex} ` : \"\";\n return `${prefix}${file}${line}: ${func}()`;\n }\n\n default: {\n // Generic format for unknown languages\n const func = frame.function || \"<unknown>\";\n const location = frame.filename || frame.module || \"<unknown>\";\n const line = frame.lineNo ? `:${frame.lineNo}` : \"\";\n const col = frame.colNo != null ? `:${frame.colNo}` : \"\";\n return ` at ${func} (${location}${line}${col})`;\n }\n }\n}\n\n/**\n * Formats a Sentry event into a structured markdown output.\n * Includes error messages, stack traces, request info, and contextual data.\n *\n * @param event - The Sentry event to format\n * @returns Formatted markdown string\n */\nexport function formatEventOutput(event: Event) {\n let output = \"\";\n\n // Look for the primary error information\n const messageEntry = event.entries.find((e) => e.type === \"message\");\n const exceptionEntry = event.entries.find((e) => e.type === \"exception\");\n const threadsEntry = event.entries.find((e) => e.type === \"threads\");\n const requestEntry = event.entries.find((e) => e.type === \"request\");\n\n // Error message (if present)\n if (messageEntry) {\n output += formatMessageInterfaceOutput(\n event,\n messageEntry.data as z.infer<typeof MessageEntrySchema>,\n );\n }\n\n // Stack trace (from exception or threads)\n if (exceptionEntry) {\n output += formatExceptionInterfaceOutput(\n event,\n exceptionEntry.data as z.infer<typeof ErrorEntrySchema>,\n );\n } else if (threadsEntry) {\n output += formatThreadsInterfaceOutput(\n event,\n threadsEntry.data as z.infer<typeof ThreadsEntrySchema>,\n );\n }\n\n // Request info (if HTTP error)\n if (requestEntry) {\n output += formatRequestInterfaceOutput(\n event,\n requestEntry.data as z.infer<typeof RequestEntrySchema>,\n );\n }\n\n output += formatContexts(event.contexts);\n return output;\n}\n\n/**\n * Extracts the context line matching the frame's line number for inline display.\n * This is used in the full stacktrace view to show the actual line of code\n * that caused the error inline with the stack frame.\n *\n * @param frame - The stack frame containing context lines\n * @returns The line of code at the frame's line number, or empty string if not available\n */\nfunction renderInlineContext(frame: z.infer<typeof FrameInterface>): string {\n if (!frame.context?.length || !frame.lineNo) {\n return \"\";\n }\n\n const contextLine = frame.context.find(([lineNo]) => lineNo === frame.lineNo);\n return contextLine ? `\\n${contextLine[1]}` : \"\";\n}\n\n/**\n * Renders an enhanced view of a stack frame with context lines and variables.\n * Used for the \"Most Relevant Frame\" section to provide detailed information\n * about the most relevant application frame where the error occurred.\n *\n * @param frame - The stack frame to render with enhanced information\n * @param event - The Sentry event containing platform information for language detection\n * @returns Formatted string with frame header, context lines, and variables table\n */\nfunction renderEnhancedFrame(\n frame: z.infer<typeof FrameInterface>,\n event: Event,\n): string {\n const parts: string[] = [];\n\n parts.push(\"**Most Relevant Frame:**\");\n parts.push(\"─────────────────────\");\n parts.push(formatFrameHeader(frame, undefined, event.platform));\n\n // Add context lines if available\n if (frame.context?.length) {\n const contextLines = renderContextLines(frame);\n if (contextLines) {\n parts.push(\"\");\n parts.push(contextLines);\n }\n }\n\n // Add variables table if available\n if (frame.vars && Object.keys(frame.vars).length > 0) {\n parts.push(\"\");\n parts.push(renderVariablesTable(frame.vars));\n }\n\n return parts.join(\"\\n\");\n}\n\nfunction formatExceptionInterfaceOutput(\n event: Event,\n data: z.infer<typeof ErrorEntrySchema>,\n) {\n const parts: string[] = [];\n\n // Handle both single exception (value) and chained exceptions (values)\n const exceptions = data.values || (data.value ? [data.value] : []);\n\n if (exceptions.length === 0) {\n return \"\";\n }\n\n // For chained exceptions, they are typically ordered from innermost to outermost\n // We'll render them in reverse order (outermost first) to match how they occurred\n const isChained = exceptions.length > 1;\n\n // Create a copy before reversing to avoid mutating the original array\n [...exceptions].reverse().forEach((exception, index) => {\n if (!exception) return;\n\n // Add language-specific chain indicator for multiple exceptions\n if (isChained && index > 0) {\n parts.push(\"\");\n parts.push(\n getExceptionChainMessage(event.platform, index, exceptions.length),\n );\n parts.push(\"\");\n }\n\n // Use the actual exception type and value as the heading\n const exceptionTitle = `${exception.type}${exception.value ? `: ${exception.value}` : \"\"}`;\n\n parts.push(index === 0 ? \"### Error\" : `### ${exceptionTitle}`);\n parts.push(\"\");\n\n // Add the error details in a code block for the first exception\n // to maintain backward compatibility\n if (index === 0) {\n parts.push(\"```\");\n parts.push(exceptionTitle);\n parts.push(\"```\");\n parts.push(\"\");\n }\n\n if (!exception.stacktrace || !exception.stacktrace.frames) {\n parts.push(\"**Stacktrace:**\");\n parts.push(\"```\");\n parts.push(\"No stacktrace available\");\n parts.push(\"```\");\n return;\n }\n\n const frames = exception.stacktrace.frames;\n\n // Only show enhanced frame for the first (outermost) exception to avoid overwhelming output\n if (index === 0) {\n const firstInAppFrame = findFirstInAppFrame(frames);\n if (\n firstInAppFrame &&\n (firstInAppFrame.context?.length || firstInAppFrame.vars)\n ) {\n parts.push(renderEnhancedFrame(firstInAppFrame, event));\n parts.push(\"\");\n parts.push(\"**Full Stacktrace:**\");\n parts.push(\"────────────────\");\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n\n parts.push(\"```\");\n parts.push(\n frames\n .map((frame) => {\n const header = formatFrameHeader(frame, undefined, event.platform);\n const context = renderInlineContext(frame);\n return `${header}${context}`;\n })\n .join(\"\\n\"),\n );\n parts.push(\"```\");\n });\n\n parts.push(\"\");\n parts.push(\"\");\n\n return parts.join(\"\\n\");\n}\n\n/**\n * Get the appropriate exception chain message based on the platform\n */\nfunction getExceptionChainMessage(\n platform: string | null,\n index: number,\n totalExceptions: number,\n): string {\n // Default message for unknown platforms\n const defaultMessage =\n \"**During handling of the above exception, another exception occurred:**\";\n\n if (!platform) {\n return defaultMessage;\n }\n\n switch (platform.toLowerCase()) {\n case \"python\":\n // Python has two distinct messages, but without additional metadata\n // we default to the implicit chaining message\n return \"**During handling of the above exception, another exception occurred:**\";\n\n case \"java\":\n return \"**Caused by:**\";\n\n case \"csharp\":\n case \"dotnet\":\n return \"**---> Inner Exception:**\";\n\n case \"ruby\":\n return \"**Caused by:**\";\n\n case \"go\":\n return \"**Wrapped error:**\";\n\n case \"rust\":\n return `**Caused by (${index}):**`;\n\n default:\n return defaultMessage;\n }\n}\n\nfunction formatRequestInterfaceOutput(\n event: Event,\n data: z.infer<typeof RequestEntrySchema>,\n) {\n if (!data.method || !data.url) {\n return \"\";\n }\n return `### HTTP Request\\n\\n**Method:** ${data.method}\\n**URL:** ${data.url}\\n\\n`;\n}\n\nfunction formatMessageInterfaceOutput(\n event: Event,\n data: z.infer<typeof MessageEntrySchema>,\n) {\n if (!data.formatted && !data.message) {\n return \"\";\n }\n const message = data.formatted || data.message || \"\";\n return `### Error\\n\\n${\"```\"}\\n${message}\\n${\"```\"}\\n\\n`;\n}\n\nfunction formatThreadsInterfaceOutput(\n event: Event,\n data: z.infer<typeof ThreadsEntrySchema>,\n) {\n if (!data.values || data.values.length === 0) {\n return \"\";\n }\n\n // Find the crashed thread only\n const crashedThread = data.values.find((t) => t.crashed);\n\n if (!crashedThread?.stacktrace?.frames) {\n return \"\";\n }\n\n const parts: string[] = [];\n\n // Include thread name if available\n if (crashedThread.name) {\n parts.push(`**Thread** (${crashedThread.name})`);\n parts.push(\"\");\n }\n\n const frames = crashedThread.stacktrace.frames;\n\n // Find and format the first in-app frame with enhanced view\n const firstInAppFrame = findFirstInAppFrame(frames);\n if (\n firstInAppFrame &&\n (firstInAppFrame.context?.length || firstInAppFrame.vars)\n ) {\n parts.push(renderEnhancedFrame(firstInAppFrame, event));\n parts.push(\"\");\n parts.push(\"**Full Stacktrace:**\");\n parts.push(\"────────────────\");\n } else {\n parts.push(\"**Stacktrace:**\");\n }\n\n parts.push(\"```\");\n parts.push(\n frames\n .map((frame) => {\n const header = formatFrameHeader(frame, undefined, event.platform);\n const context = renderInlineContext(frame);\n return `${header}${context}`;\n })\n .join(\"\\n\"),\n );\n parts.push(\"```\");\n parts.push(\"\");\n\n return parts.join(\"\\n\");\n}\n\n/**\n * Renders surrounding source code context for a stack frame.\n * Shows a window of code lines around the error line with visual indicators.\n *\n * @param frame - The stack frame containing context lines\n * @param contextSize - Number of lines to show before and after the error line (default: 3)\n * @returns Formatted context lines with line numbers and arrow indicator for the error line\n */\nfunction renderContextLines(\n frame: z.infer<typeof FrameInterface>,\n contextSize = 3,\n): string {\n if (!frame.context || frame.context.length === 0 || !frame.lineNo) {\n return \"\";\n }\n\n const lines: string[] = [];\n const errorLine = frame.lineNo;\n const maxLineNoWidth = Math.max(\n ...frame.context.map(([lineNo]) => lineNo.toString().length),\n );\n\n for (const [lineNo, code] of frame.context) {\n const isErrorLine = lineNo === errorLine;\n const lineNoStr = lineNo.toString().padStart(maxLineNoWidth, \" \");\n\n if (Math.abs(lineNo - errorLine) <= contextSize) {\n if (isErrorLine) {\n lines.push(` → ${lineNoStr} │ ${code}`);\n } else {\n lines.push(` ${lineNoStr} │ ${code}`);\n }\n }\n }\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Formats a variable value for display in the variables table.\n * Handles different types appropriately and safely, converting complex objects\n * to readable representations and handling edge cases like circular references.\n *\n * @param value - The variable value to format (can be any type)\n * @param maxLength - Maximum length for stringified objects/arrays (default: 80)\n * @returns Human-readable string representation of the value\n */\nfunction formatVariableValue(value: unknown, maxLength = 80): string {\n try {\n if (typeof value === \"string\") {\n return `\"${value}\"`;\n }\n if (value === null) {\n return \"null\";\n }\n if (value === undefined) {\n return \"undefined\";\n }\n if (typeof value === \"object\") {\n const stringified = JSON.stringify(value);\n if (stringified.length > maxLength) {\n // Leave room for \", ...]\" or \", ...}\"\n const truncateAt = maxLength - 6;\n let truncated = stringified.substring(0, truncateAt);\n\n // Find the last complete element by looking for the last comma\n const lastComma = truncated.lastIndexOf(\",\");\n if (lastComma > 0) {\n truncated = truncated.substring(0, lastComma);\n }\n\n // Add the appropriate ending\n if (Array.isArray(value)) {\n return `${truncated}, ...]`;\n }\n return `${truncated}, ...}`;\n }\n return stringified;\n }\n return String(value);\n } catch {\n // Handle circular references or other stringify errors\n return `<${typeof value}>`;\n }\n}\n\n/**\n * Renders a table of local variables in a tree-like format.\n * Uses box-drawing characters to create a visual hierarchy of variables\n * and their values at the point where the error occurred.\n *\n * @param vars - Object containing variable names as keys and their values\n * @returns Formatted variables table with tree-style prefix characters\n */\nfunction renderVariablesTable(vars: Record<string, unknown>): string {\n const entries = Object.entries(vars);\n if (entries.length === 0) {\n return \"\";\n }\n\n const lines: string[] = [\"Local Variables:\"];\n const lastIndex = entries.length - 1;\n\n entries.forEach(([key, value], index) => {\n const prefix = index === lastIndex ? \"└─\" : \"├─\";\n const valueStr = formatVariableValue(value);\n lines.push(`${prefix} ${key}: ${valueStr}`);\n });\n\n return lines.join(\"\\n\");\n}\n\n/**\n * Finds the first application frame (in_app) in a stack trace.\n * Searches from the bottom of the stack (oldest frame) to find the first\n * frame that belongs to the user's application code rather than libraries.\n *\n * @param frames - Array of stack frames, typically in reverse chronological order\n * @returns The first in-app frame found, or undefined if none exist\n */\nfunction findFirstInAppFrame(\n frames: z.infer<typeof FrameInterface>[],\n): z.infer<typeof FrameInterface> | undefined {\n // Frames are usually in reverse order (most recent first)\n // We want the first in-app frame from the bottom\n for (let i = frames.length - 1; i >= 0; i--) {\n if (frames[i].inApp === true) {\n return frames[i];\n }\n }\n return undefined;\n}\n\nfunction formatContexts(contexts: z.infer<typeof EventSchema>[\"contexts\"]) {\n if (!contexts || Object.keys(contexts).length === 0) {\n return \"\";\n }\n return `### Additional Context\\n\\nThese are additional context provided by the user when they're instrumenting their application.\\n\\n${Object.entries(\n contexts,\n )\n .map(\n ([name, data]) =>\n `**${name}**\\n${Object.entries(data)\n .filter(([key, _]) => key !== \"type\")\n .map(([key, value]) => {\n return `${key}: ${JSON.stringify(value, undefined, 2)}`;\n })\n .join(\"\\n\")}`,\n )\n .join(\"\\n\\n\")}\\n\\n`;\n}\n\n/**\n * Formats Seer AI analysis context for inclusion in issue details.\n * Provides a minimal summary showing just the key solution when available.\n *\n * @param autofixState - The autofix state containing Seer analysis data\n * @returns Formatted markdown string with Seer context, or empty string if no analysis exists\n */\nfunction formatSeerContext(autofixState: AutofixRunState): string {\n if (!autofixState.autofix) {\n return \"\";\n }\n\n const { autofix } = autofixState;\n const parts: string[] = [];\n\n parts.push(\"## Seer AI Analysis\");\n parts.push(\"\");\n\n // For completed analyses, show just the key solution\n if (isTerminalStatus(autofix.status) && autofix.steps.length > 0) {\n const completedSteps = autofix.steps.filter(\n (step) => step.status === \"COMPLETED\",\n );\n\n // Find the solution step and show its description directly\n const solutionStep = completedSteps.find(\n (step) => step.type === \"solution\",\n );\n\n if (solutionStep) {\n // For solution steps, use the description directly\n const solutionDescription = solutionStep.description;\n if (\n solutionDescription &&\n typeof solutionDescription === \"string\" &&\n solutionDescription.trim()\n ) {\n parts.push(solutionDescription.trim());\n } else {\n // Fallback to extracting from output if no description\n const solutionOutput = getOutputForAutofixStep(solutionStep);\n const lines = solutionOutput.split(\"\\n\");\n const firstParagraph = lines.find(\n (line) =>\n line.trim().length > 50 &&\n !line.startsWith(\"#\") &&\n !line.startsWith(\"*\"),\n );\n if (firstParagraph) {\n parts.push(firstParagraph.trim());\n }\n }\n }\n }\n return `${parts.join(\"\\n\")}\\n\\n`;\n}\n\n/**\n * Formats a Sentry issue with its latest event into comprehensive markdown output.\n * Includes issue metadata, event details, and usage instructions.\n *\n * @param params - Object containing organization slug, issue, event, and API service\n * @returns Formatted markdown string with complete issue information\n */\nexport function formatIssueOutput({\n organizationSlug,\n issue,\n event,\n apiService,\n autofixState,\n}: {\n organizationSlug: string;\n issue: Issue;\n event: Event;\n apiService: SentryApiService;\n autofixState?: AutofixRunState;\n}) {\n let output = `# Issue ${issue.shortId} in **${organizationSlug}**\\n\\n`;\n output += `**Description**: ${issue.title}\\n`;\n output += `**Culprit**: ${issue.culprit}\\n`;\n output += `**First Seen**: ${new Date(issue.firstSeen).toISOString()}\\n`;\n output += `**Last Seen**: ${new Date(issue.lastSeen).toISOString()}\\n`;\n output += `**Occurrences**: ${issue.count}\\n`;\n output += `**Users Impacted**: ${issue.userCount}\\n`;\n output += `**Status**: ${issue.status}\\n`;\n output += `**Platform**: ${issue.platform}\\n`;\n output += `**Project**: ${issue.project.name}\\n`;\n output += `**URL**: ${apiService.getIssueUrl(organizationSlug, issue.shortId)}\\n`;\n output += \"\\n\";\n output += \"## Event Details\\n\\n\";\n output += `**Event ID**: ${event.id}\\n`;\n if (event.type === \"error\") {\n output += `**Occurred At**: ${new Date((event as z.infer<typeof ErrorEventSchema>).dateCreated).toISOString()}\\n`;\n }\n if (event.message) {\n output += `**Message**:\\n${event.message}\\n`;\n }\n output += \"\\n\";\n output += formatEventOutput(event);\n\n // Add Seer context if available\n if (autofixState) {\n output += formatSeerContext(autofixState);\n }\n\n output += \"# Using this information\\n\\n\";\n output += `- You can reference the IssueID in commit messages (e.g. \\`Fixes ${issue.shortId}\\`) to automatically close the issue when the commit is merged.\\n`;\n output +=\n \"- The stacktrace includes both first-party application code as well as third-party code, its important to triage to first-party code.\\n\";\n return output;\n}\n"],"mappings":";;;AA0BA,MAAMA,sBAA8C;CAClD,SAAS;CACT,OAAO;CACP,OAAO;CACP,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,OAAO;CACP,QAAQ;AACT;AAED,MAAMC,2BAAoD,CACxD,CAAC,yBAAyB,MAA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,SACC,KAAK,MAAM,CAAC,SAAS,OACpB,KAAK,WAAW,IAAI,KACpB,KAAK,WAAW,IAAI,CACxB;AACD,QAAI,eACF,OAAM,KAAK,eAAe,MAAM,CAAC;GAEpC;EACF;CACF;AACD,WAAU,MAAM,KAAK,KAAK,CAAC;AAC5B;;;;;;;;AASD,SAAgB,kBAAkB,EAChC,kBACA,OACA,OACA,YACA,cAOD,EAAE;CACD,IAAI,UAAU,UAAU,MAAM,QAAQ,QAAQ,iBAAiB;AAC/D,YAAW,mBAAmB,MAAM,MAAM;AAC1C,YAAW,eAAe,MAAM,QAAQ;AACxC,YAAW,kBAAkB,IAAI,KAAK,MAAM,WAAW,aAAa,CAAC;AACrE,YAAW,iBAAiB,IAAI,KAAK,MAAM,UAAU,aAAa,CAAC;AACnE,YAAW,mBAAmB,MAAM,MAAM;AAC1C,YAAW,sBAAsB,MAAM,UAAU;AACjD,YAAW,cAAc,MAAM,OAAO;AACtC,YAAW,gBAAgB,MAAM,SAAS;AAC1C,YAAW,eAAe,MAAM,QAAQ,KAAK;AAC7C,YAAW,WAAW,WAAW,YAAY,kBAAkB,MAAM,QAAQ,CAAC;AAC9E,WAAU;AACV,WAAU;AACV,YAAW,gBAAgB,MAAM,GAAG;AACpC,KAAI,MAAM,SAAS,QACjB,YAAW,mBAAmB,IAAI,KAAM,MAA2C,aAAa,aAAa,CAAC;AAEhH,KAAI,MAAM,QACR,YAAW,gBAAgB,MAAM,QAAQ;AAE3C,WAAU;AACV,WAAU,kBAAkB,MAAM;AAGlC,KAAI,aACF,WAAU,kBAAkB,aAAa;AAG3C,WAAU;AACV,YAAW,mEAAmE,MAAM,QAAQ;AAC5F,WACE;AACF,QAAO;AACR"}
@@ -11,4 +11,4 @@ function formatAssignedTo(assignedTo) {
11
11
 
12
12
  //#endregion
13
13
  export { formatAssignedTo };
14
- //# sourceMappingURL=formatting-utils-C3sej5ER.js.map
14
+ //# sourceMappingURL=formatting-utils-DgOyTl-m.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatting-utils-C3sej5ER.js","names":["assignedTo: AssignedTo"],"sources":["../src/tools/utils/formatting-utils.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { AssignedToSchema } from \"../../api-client/index\";\n\ntype AssignedTo = z.infer<typeof AssignedToSchema>;\n\n/**\n * Helper function to format assignedTo field for display\n */\nexport function formatAssignedTo(assignedTo: AssignedTo): string {\n if (!assignedTo) {\n return \"Unassigned\";\n }\n\n if (typeof assignedTo === \"string\") {\n return assignedTo;\n }\n\n if (typeof assignedTo === \"object\" && assignedTo.name) {\n return assignedTo.name;\n }\n\n return \"Unknown\";\n}\n"],"mappings":";;;;AAQA,SAAgB,iBAAiBA,YAAgC;AAC/D,MAAK,WACH,QAAO;AAGT,YAAW,eAAe,SACxB,QAAO;AAGT,YAAW,eAAe,YAAY,WAAW,KAC/C,QAAO,WAAW;AAGpB,QAAO;AACR"}
1
+ {"version":3,"file":"formatting-utils-DgOyTl-m.js","names":["assignedTo: AssignedTo"],"sources":["../src/tools/utils/formatting-utils.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { AssignedToSchema } from \"../../api-client/index\";\n\ntype AssignedTo = z.infer<typeof AssignedToSchema>;\n\n/**\n * Helper function to format assignedTo field for display\n */\nexport function formatAssignedTo(assignedTo: AssignedTo): string {\n if (!assignedTo) {\n return \"Unassigned\";\n }\n\n if (typeof assignedTo === \"string\") {\n return assignedTo;\n }\n\n if (typeof assignedTo === \"object\" && assignedTo.name) {\n return assignedTo.name;\n }\n\n return \"Unknown\";\n}\n"],"mappings":";;;;AAQA,SAAgB,iBAAiBA,YAAgC;AAC/D,MAAK,WACH,QAAO;AAGT,YAAW,eAAe,SACxB,QAAO;AAGT,YAAW,eAAe,YAAY,WAAW,KAC/C,QAAO,WAAW;AAGpB,QAAO;AACR"}
@@ -17,4 +17,4 @@ Object.defineProperty(exports, 'formatAssignedTo', {
17
17
  return formatAssignedTo;
18
18
  }
19
19
  });
20
- //# sourceMappingURL=formatting-utils-DDz14xeB.cjs.map
20
+ //# sourceMappingURL=formatting-utils-m9R5bsRU.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatting-utils-DDz14xeB.cjs","names":["assignedTo: AssignedTo"],"sources":["../src/tools/utils/formatting-utils.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { AssignedToSchema } from \"../../api-client/index\";\n\ntype AssignedTo = z.infer<typeof AssignedToSchema>;\n\n/**\n * Helper function to format assignedTo field for display\n */\nexport function formatAssignedTo(assignedTo: AssignedTo): string {\n if (!assignedTo) {\n return \"Unassigned\";\n }\n\n if (typeof assignedTo === \"string\") {\n return assignedTo;\n }\n\n if (typeof assignedTo === \"object\" && assignedTo.name) {\n return assignedTo.name;\n }\n\n return \"Unknown\";\n}\n"],"mappings":";;;;;AAQA,SAAgB,iBAAiBA,YAAgC;AAC/D,MAAK,WACH,QAAO;AAGT,YAAW,eAAe,SACxB,QAAO;AAGT,YAAW,eAAe,YAAY,WAAW,KAC/C,QAAO,WAAW;AAGpB,QAAO;AACR"}
1
+ {"version":3,"file":"formatting-utils-m9R5bsRU.cjs","names":["assignedTo: AssignedTo"],"sources":["../src/tools/utils/formatting-utils.ts"],"sourcesContent":["import type { z } from \"zod\";\nimport type { AssignedToSchema } from \"../../api-client/index\";\n\ntype AssignedTo = z.infer<typeof AssignedToSchema>;\n\n/**\n * Helper function to format assignedTo field for display\n */\nexport function formatAssignedTo(assignedTo: AssignedTo): string {\n if (!assignedTo) {\n return \"Unassigned\";\n }\n\n if (typeof assignedTo === \"string\") {\n return assignedTo;\n }\n\n if (typeof assignedTo === \"object\" && assignedTo.name) {\n return assignedTo.name;\n }\n\n return \"Unknown\";\n}\n"],"mappings":";;;;;AAQA,SAAgB,iBAAiBA,YAAgC;AAC/D,MAAK,WACH,QAAO;AAGT,YAAW,eAAe,SACxB,QAAO;AAGT,YAAW,eAAe,YAAY,WAAW,KAC/C,QAAO,WAAW;AAGpB,QAAO;AACR"}
@@ -1,6 +1,6 @@
1
- import { FrameInterface } from "./schema-ya35hkEL.cjs";
2
- import { Event, Issue } from "./types-Bg17IGWJ.cjs";
3
- import { SentryApiService } from "./client-CILwfx6G.cjs";
1
+ import { FrameInterface } from "./schema-B3CzDGJk.js";
2
+ import { AutofixRunState, Event, Issue } from "./types-DpV1JAZj.js";
3
+ import { SentryApiService } from "./client-VCJp6Kcu.js";
4
4
  import { z } from "zod";
5
5
 
6
6
  //#region src/internal/formatting.d.ts
@@ -34,14 +34,16 @@ declare function formatIssueOutput({
34
34
  organizationSlug,
35
35
  issue,
36
36
  event,
37
- apiService
37
+ apiService,
38
+ autofixState
38
39
  }: {
39
40
  organizationSlug: string;
40
41
  issue: Issue;
41
42
  event: Event;
42
43
  apiService: SentryApiService;
44
+ autofixState?: AutofixRunState;
43
45
  }): string;
44
46
  //# sourceMappingURL=formatting.d.ts.map
45
47
  //#endregion
46
48
  export { formatEventOutput, formatFrameHeader, formatIssueOutput };
47
- //# sourceMappingURL=formatting-CHh9Q_OW.d.cts.map
49
+ //# sourceMappingURL=formatting-vtXxusbn.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatting-vtXxusbn.d.ts","names":[],"sources":["../src/internal/formatting.ts"],"sourcesContent":[],"mappings":";;;;;;;AAoFgB;AAoEhB;AA2gBA;;;;;;;AAQS,iBAxlBO,iBAAA,CAwlBP,KAAA,EAvlBA,CAAA,CAAE,KAulBF,CAAA,OAvlBe,cAulBf,CAAA,EAAA,UAAA,CAAA,EAAA,MAAA,EAAA,QAAA,CAAA,EAAA,MAAA,GAAA,IAAA,CAAA,EAAA,MAAA;;;;AAGuB;;;;iBAthBhB,iBAAA,QAAyB;;;;;;;;iBA2gBzB,iBAAA;;;;;;;;SAQP;SACA;cACK;iBACG"}
@@ -141,4 +141,4 @@ Object.defineProperty(exports, 'get_event_attachment_default', {
141
141
  return get_event_attachment_default;
142
142
  }
143
143
  });
144
- //# sourceMappingURL=get-event-attachment-ChRw3jlQ.cjs.map
144
+ //# sourceMappingURL=get-event-attachment-C-ig2-3F.cjs.map