@sentry/mcp-server 0.29.0 → 0.31.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 (143) hide show
  1. package/dist/auth/constants.cjs +9 -0
  2. package/dist/auth/constants.d.cts +31 -0
  3. package/dist/auth/constants.d.cts.map +1 -0
  4. package/dist/auth/constants.d.ts +31 -0
  5. package/dist/auth/constants.d.ts.map +1 -0
  6. package/dist/auth/constants.js +3 -0
  7. package/dist/auth/device-code-flow.cjs +10 -0
  8. package/dist/auth/device-code-flow.d.cts +34 -0
  9. package/dist/auth/device-code-flow.d.cts.map +1 -0
  10. package/dist/auth/device-code-flow.d.ts +34 -0
  11. package/dist/auth/device-code-flow.d.ts.map +1 -0
  12. package/dist/auth/device-code-flow.js +6 -0
  13. package/dist/auth/resolve-token.cjs +8 -0
  14. package/dist/auth/resolve-token.d.cts +17 -0
  15. package/dist/auth/resolve-token.d.cts.map +1 -0
  16. package/dist/auth/resolve-token.d.ts +17 -0
  17. package/dist/auth/resolve-token.d.ts.map +1 -0
  18. package/dist/auth/resolve-token.js +8 -0
  19. package/dist/auth/token-cache.cjs +5 -0
  20. package/dist/auth/token-cache.d.cts +11 -0
  21. package/dist/auth/token-cache.d.cts.map +1 -0
  22. package/dist/auth/token-cache.d.ts +11 -0
  23. package/dist/auth/token-cache.d.ts.map +1 -0
  24. package/dist/auth/token-cache.js +3 -0
  25. package/dist/auth/types.cjs +6 -0
  26. package/dist/auth/types.d.cts +2 -0
  27. package/dist/auth/types.d.ts +2 -0
  28. package/dist/auth/types.js +3 -0
  29. package/dist/auth-BIb4PBnL.js +79 -0
  30. package/dist/auth-BIb4PBnL.js.map +1 -0
  31. package/dist/auth-BK5LL8QY.cjs +90 -0
  32. package/dist/auth-BK5LL8QY.cjs.map +1 -0
  33. package/dist/{chunk-DoeelZqw.cjs → chunk-Cv9WC9bY.cjs} +7 -0
  34. package/dist/cli/commands/auth.cjs +11 -0
  35. package/dist/cli/commands/auth.d.cts +8 -0
  36. package/dist/cli/commands/auth.d.cts.map +1 -0
  37. package/dist/cli/commands/auth.d.ts +8 -0
  38. package/dist/cli/commands/auth.d.ts.map +1 -0
  39. package/dist/cli/commands/auth.js +10 -0
  40. package/dist/cli/parse.cjs +1 -1
  41. package/dist/cli/parse.d.cts +1 -1
  42. package/dist/cli/parse.d.cts.map +1 -1
  43. package/dist/cli/parse.d.ts +1 -1
  44. package/dist/cli/parse.d.ts.map +1 -1
  45. package/dist/cli/parse.js +1 -1
  46. package/dist/cli/resolve.cjs +4 -2
  47. package/dist/cli/resolve.d.cts +10 -4
  48. package/dist/cli/resolve.d.cts.map +1 -1
  49. package/dist/cli/resolve.d.ts +10 -4
  50. package/dist/cli/resolve.d.ts.map +1 -1
  51. package/dist/cli/resolve.js +3 -2
  52. package/dist/cli/types.d.cts +2 -2
  53. package/dist/cli/types.d.ts +2 -2
  54. package/dist/cli/usage.cjs +1 -1
  55. package/dist/cli/usage.js +1 -1
  56. package/dist/{config-HqPAzoGg.js → config--FiEKpQR.js} +1 -1
  57. package/dist/{config-CEjP2CYO-DNCUeo0R.js → config-BYPjNBPX-7d8TAxBc.js} +3 -2
  58. package/dist/config-BYPjNBPX-7d8TAxBc.js.map +1 -0
  59. package/dist/{config-CEjP2CYO-CZKUamRu.cjs → config-BYPjNBPX-Bqwc8iZW.cjs} +3 -2
  60. package/dist/config-BYPjNBPX-Bqwc8iZW.cjs.map +1 -0
  61. package/dist/config-DU03TDiU.cjs +7 -0
  62. package/dist/{resolve-DpUhCbfh.js → constants-Ciwj7kb9.js} +30 -119
  63. package/dist/constants-Ciwj7kb9.js.map +1 -0
  64. package/dist/{resolve-DFUPLqHE.cjs → constants-DmV1Benp.cjs} +65 -130
  65. package/dist/constants-DmV1Benp.cjs.map +1 -0
  66. package/dist/device-code-flow-CpGZ3Eqv.cjs +154 -0
  67. package/dist/device-code-flow-CpGZ3Eqv.cjs.map +1 -0
  68. package/dist/device-code-flow-DmgeS5QN.js +124 -0
  69. package/dist/device-code-flow-DmgeS5QN.js.map +1 -0
  70. package/dist/index.cjs +24308 -16062
  71. package/dist/index.cjs.map +1 -1
  72. package/dist/index.js +25233 -17018
  73. package/dist/index.js.map +1 -1
  74. package/dist/{parse-CEJNfXug.js → parse-BC0czE2L.js} +7 -1
  75. package/dist/parse-BC0czE2L.js.map +1 -0
  76. package/dist/{parse-DFk2004x.cjs → parse-CBlXTQfk.cjs} +8 -2
  77. package/dist/parse-CBlXTQfk.cjs.map +1 -0
  78. package/dist/resolve-BfYJ9Cqy.cjs +168 -0
  79. package/dist/resolve-BfYJ9Cqy.cjs.map +1 -0
  80. package/dist/resolve-D0W2gbu8.js +133 -0
  81. package/dist/resolve-D0W2gbu8.js.map +1 -0
  82. package/dist/resolve-token-C2eTEtoo.cjs +52 -0
  83. package/dist/resolve-token-C2eTEtoo.cjs.map +1 -0
  84. package/dist/resolve-token-pfPBO9EK.js +47 -0
  85. package/dist/resolve-token-pfPBO9EK.js.map +1 -0
  86. package/dist/{stdio-CUTR3lwv.cjs → stdio-B08zZS4X.cjs} +4 -20
  87. package/dist/stdio-B08zZS4X.cjs.map +1 -0
  88. package/dist/{stdio-BG3LYhUm.js → stdio-CUhyR_jH.js} +3 -7
  89. package/dist/stdio-CUhyR_jH.js.map +1 -0
  90. package/dist/token-D7eiINbV.js +50 -0
  91. package/dist/token-D7eiINbV.js.map +1 -0
  92. package/dist/token-Dx4qrxlx.cjs +55 -0
  93. package/dist/token-Dx4qrxlx.cjs.map +1 -0
  94. package/dist/token-cache-BTEUyVx2.js +66 -0
  95. package/dist/token-cache-BTEUyVx2.js.map +1 -0
  96. package/dist/token-cache-iqkTOca3.cjs +84 -0
  97. package/dist/token-cache-iqkTOca3.cjs.map +1 -0
  98. package/dist/token-error-Df8A7mgb.js +77 -0
  99. package/dist/token-error-Df8A7mgb.js.map +1 -0
  100. package/dist/token-error-x_miDBP3.cjs +48 -0
  101. package/dist/token-error-x_miDBP3.cjs.map +1 -0
  102. package/dist/token-util-DtX1UM9f.js +4 -0
  103. package/dist/token-util-VkLmCUNV.js +357 -0
  104. package/dist/token-util-VkLmCUNV.js.map +1 -0
  105. package/dist/token-util-bEa_1v46.cjs +9 -0
  106. package/dist/token-util-oe0G9a-s.cjs +363 -0
  107. package/dist/token-util-oe0G9a-s.cjs.map +1 -0
  108. package/dist/transports/stdio.cjs +2 -1
  109. package/dist/transports/stdio.js +2 -1
  110. package/dist/types-BN426G4g.d.ts +111 -0
  111. package/dist/types-BN426G4g.d.ts.map +1 -0
  112. package/dist/types-C8FoyqMN.js +54 -0
  113. package/dist/types-C8FoyqMN.js.map +1 -0
  114. package/dist/{types-DWpWltcD.d.cts → types-CX4uOY82.d.ts} +19 -6
  115. package/dist/types-CX4uOY82.d.ts.map +1 -0
  116. package/dist/types-ClEPUb_D.d.cts +111 -0
  117. package/dist/types-ClEPUb_D.d.cts.map +1 -0
  118. package/dist/{types-rOTvxXQO.d.ts → types-rlmLVpNO.d.cts} +19 -6
  119. package/dist/types-rlmLVpNO.d.cts.map +1 -0
  120. package/dist/types-xUmfecYm.cjs +78 -0
  121. package/dist/types-xUmfecYm.cjs.map +1 -0
  122. package/dist/{usage-Bw3IN4iE.js → usage-DB-MGezA.js} +18 -5
  123. package/dist/usage-DB-MGezA.js.map +1 -0
  124. package/dist/{usage-BZayoeC1.cjs → usage-DRK6TiDr.cjs} +18 -5
  125. package/dist/usage-DRK6TiDr.cjs.map +1 -0
  126. package/dist/version-CYYpU4RZ.js +7 -0
  127. package/dist/version-CYYpU4RZ.js.map +1 -0
  128. package/dist/version-Ca7qUBih.cjs +19 -0
  129. package/dist/version-Ca7qUBih.cjs.map +1 -0
  130. package/package.json +5 -5
  131. package/dist/config-CEjP2CYO-CZKUamRu.cjs.map +0 -1
  132. package/dist/config-CEjP2CYO-DNCUeo0R.js.map +0 -1
  133. package/dist/config-CwE3_vz4.cjs +0 -7
  134. package/dist/parse-CEJNfXug.js.map +0 -1
  135. package/dist/parse-DFk2004x.cjs.map +0 -1
  136. package/dist/resolve-DFUPLqHE.cjs.map +0 -1
  137. package/dist/resolve-DpUhCbfh.js.map +0 -1
  138. package/dist/stdio-BG3LYhUm.js.map +0 -1
  139. package/dist/stdio-CUTR3lwv.cjs.map +0 -1
  140. package/dist/types-DWpWltcD.d.cts.map +0 -1
  141. package/dist/types-rOTvxXQO.d.ts.map +0 -1
  142. package/dist/usage-BZayoeC1.cjs.map +0 -1
  143. package/dist/usage-Bw3IN4iE.js.map +0 -1
@@ -13,6 +13,7 @@ type CliArgs = {
13
13
  anthropicModel?: string;
14
14
  agentProvider?: string;
15
15
  skills?: string;
16
+ disableSkills?: string;
16
17
  agent?: boolean;
17
18
  experimental?: boolean;
18
19
  organizationSlug?: string;
@@ -30,7 +31,9 @@ type EnvArgs = {
30
31
  openaiModel?: string;
31
32
  anthropicModel?: string;
32
33
  agentProvider?: string;
34
+ clientId?: string;
33
35
  skills?: string;
36
+ disableSkills?: string;
34
37
  };
35
38
  type MergedArgs = {
36
39
  accessToken?: string;
@@ -43,7 +46,9 @@ type MergedArgs = {
43
46
  anthropicBaseUrl?: string;
44
47
  anthropicModel?: string;
45
48
  agentProvider?: string;
49
+ clientId?: string;
46
50
  skills?: string;
51
+ disableSkills?: string;
47
52
  agent?: boolean;
48
53
  experimental?: boolean;
49
54
  organizationSlug?: string;
@@ -52,8 +57,13 @@ type MergedArgs = {
52
57
  version?: boolean;
53
58
  unknownArgs: string[];
54
59
  };
55
- type ResolvedConfig = {
56
- accessToken: string;
60
+ /**
61
+ * Partially resolved config — accessToken may not yet be available
62
+ * (will be resolved via device code flow or cache).
63
+ */
64
+ type PartiallyResolvedConfig = {
65
+ accessToken?: string;
66
+ clientId: string;
57
67
  sentryHost: string;
58
68
  mcpUrl?: string;
59
69
  sentryDsn?: string;
@@ -62,12 +72,15 @@ type ResolvedConfig = {
62
72
  anthropicBaseUrl?: string;
63
73
  anthropicModel?: string;
64
74
  agentProvider?: "openai" | "anthropic";
65
- /** Primary authorization method */
66
- finalSkills?: Set<Skill>;
75
+ /** Skills granted for this session (always populated by finalize()) */
76
+ finalSkills: Set<Skill>;
67
77
  organizationSlug?: string;
68
78
  projectSlug?: string;
69
79
  };
80
+ type ResolvedConfig = Omit<PartiallyResolvedConfig, "accessToken"> & {
81
+ accessToken: string;
82
+ };
70
83
  //# sourceMappingURL=types.d.ts.map
71
84
  //#endregion
72
- export { CliArgs, EnvArgs, MergedArgs, ResolvedConfig };
73
- //# sourceMappingURL=types-DWpWltcD.d.cts.map
85
+ export { CliArgs, EnvArgs, MergedArgs, PartiallyResolvedConfig, ResolvedConfig };
86
+ //# sourceMappingURL=types-CX4uOY82.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-CX4uOY82.d.ts","names":[],"sources":["../src/cli/types.ts"],"sourcesContent":[],"mappings":";;;KAEY,OAAA;;EAAA,IAAA,CAAA,EAAA,MAAO;EAsBP,GAAA,CAAA,EAAA,MAAO;EAcP,MAAA,CAAA,EAAA,MAAU;EA2BV,SAAA,CAAA,EAAA,MAAA;EAAuB,aAAA,CAAA,EAAA,MAAA;EAAA,WAYhB,CAAA,EAAA,MAAA;EAAK,gBAAT,CAAA,EAAA,MAAA;EAAG,cAAA,CAAA,EAAA,MAAA;EAKN,aAAA,CAAA,EAAA,MAAc;EAAA,MAAA,CAAA,EAAA,MAAA;EAAA,aAAQ,CAAA,EAAA,MAAA;EAAuB,KAA5B,CAAA,EAAA,OAAA;EAAI,YAAA,CAAA,EAAA,OAAA;;;;;;;KA1DrB,OAAA;;;;;;;;;;;;;KAcA,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BA,uBAAA;;;;;;;;;;;;eAYG,IAAI;;;;KAKP,cAAA,GAAiB,KAAK"}
@@ -0,0 +1,111 @@
1
+ import { z } from "zod";
2
+
3
+ //#region src/auth/types.d.ts
4
+
5
+ /**
6
+ * Response from Sentry's device code endpoint (POST /oauth/device/code/).
7
+ * See: https://docs.sentry.io/api/auth/#device-authorization-flow
8
+ */
9
+ declare const DeviceCodeResponseSchema: z.ZodObject<{
10
+ device_code: z.ZodString;
11
+ user_code: z.ZodString;
12
+ verification_uri: z.ZodString;
13
+ verification_uri_complete: z.ZodString;
14
+ interval: z.ZodNumber;
15
+ expires_in: z.ZodNumber;
16
+ }, "strip", z.ZodTypeAny, {
17
+ device_code: string;
18
+ user_code: string;
19
+ verification_uri: string;
20
+ verification_uri_complete: string;
21
+ interval: number;
22
+ expires_in: number;
23
+ }, {
24
+ device_code: string;
25
+ user_code: string;
26
+ verification_uri: string;
27
+ verification_uri_complete: string;
28
+ interval: number;
29
+ expires_in: number;
30
+ }>;
31
+ type DeviceCodeResponse = z.infer<typeof DeviceCodeResponseSchema>;
32
+ /**
33
+ * Error response during device code token polling.
34
+ */
35
+ declare const DeviceCodeErrorSchema: z.ZodObject<{
36
+ error: z.ZodString;
37
+ error_description: z.ZodOptional<z.ZodString>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ error: string;
40
+ error_description?: string | undefined;
41
+ }, {
42
+ error: string;
43
+ error_description?: string | undefined;
44
+ }>;
45
+ /**
46
+ * Successful token response from Sentry's token endpoint.
47
+ * Mirrors the shape used by the cloudflare OAuth callback.
48
+ */
49
+ declare const TokenResponseSchema: z.ZodObject<{
50
+ access_token: z.ZodString;
51
+ refresh_token: z.ZodString;
52
+ token_type: z.ZodString;
53
+ expires_in: z.ZodNumber;
54
+ expires_at: z.ZodString;
55
+ user: z.ZodObject<{
56
+ email: z.ZodString;
57
+ id: z.ZodString;
58
+ name: z.ZodNullable<z.ZodString>;
59
+ }, "strip", z.ZodTypeAny, {
60
+ email: string;
61
+ id: string;
62
+ name: string | null;
63
+ }, {
64
+ email: string;
65
+ id: string;
66
+ name: string | null;
67
+ }>;
68
+ scope: z.ZodString;
69
+ }, "strip", z.ZodTypeAny, {
70
+ expires_in: number;
71
+ access_token: string;
72
+ refresh_token: string;
73
+ token_type: string;
74
+ expires_at: string;
75
+ user: {
76
+ email: string;
77
+ id: string;
78
+ name: string | null;
79
+ };
80
+ scope: string;
81
+ }, {
82
+ expires_in: number;
83
+ access_token: string;
84
+ refresh_token: string;
85
+ token_type: string;
86
+ expires_at: string;
87
+ user: {
88
+ email: string;
89
+ id: string;
90
+ name: string | null;
91
+ };
92
+ scope: string;
93
+ }>;
94
+ type TokenResponse = z.infer<typeof TokenResponseSchema>;
95
+ /**
96
+ * Shape of a cached token entry stored on disk.
97
+ */
98
+ type CachedToken = {
99
+ access_token: string;
100
+ refresh_token: string;
101
+ expires_at: string;
102
+ sentry_host: string;
103
+ client_id: string;
104
+ user_email: string;
105
+ scope: string;
106
+ };
107
+ declare function toCachedToken(tokenResponse: TokenResponse, sentryHost: string, clientId: string): CachedToken;
108
+ //# sourceMappingURL=types.d.ts.map
109
+ //#endregion
110
+ export { CachedToken, DeviceCodeErrorSchema, DeviceCodeResponse, DeviceCodeResponseSchema, TokenResponse, TokenResponseSchema, toCachedToken };
111
+ //# sourceMappingURL=types-ClEPUb_D.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-ClEPUb_D.d.cts","names":[],"sources":["../src/auth/types.ts"],"sourcesContent":[],"mappings":";;;;;;AAMA;;AAOE,cAPW,wBAOX,EAPmC,CAAA,CAAA,SAOnC,CAAA;eAAA,CAAA,CAAA;;;;;;UAPmC,cAAA,EAAA;EAAA,WAAA,EAAA,MAAA;EASzB,SAAA,EAAA,MAAA;EAAkB,gBAAA,EAAA,MAAA;EAAA,yBAAkB,EAAA,MAAA;EAAwB,QAArC,EAAA,MAAA;EAAK,UAAA,EAAA,MAAA;AAKxC,CAAA,EAAA;EAGE,WAAA,EAAA,MAAA;EAAA,SAAA,EAAA,MAAA;;;;YAHgC,EAAA,MAAA;AAAA,CAAA,CAAA;AASrB,KAdD,kBAAA,GAAqB,CAAA,CAAE,KA0BjC,CAAA,OA1B8C,wBA0B9C,CAAA;;;;cArBW,uBAAqB,CAAA,CAAA;SAGhC,CAAA,CAAA;;;;;;;;;;;AAM8B;AAchC;AAAyB,cAdZ,mBAcY,EAdO,CAAA,CAAA,SAcP,CAAA;EAAA,YAAkB,EAFzC,CAAA,CAAA,SAEyC;EAAmB,aAAhC,aAAA;EAAK,UAAA,aAAA;EAKvB,UAAA,aAAW;EAUP,UAAA,aAAa;EAAA,IAAA,aAAA,CAAA;IACZ,KAAA,aAAA;IAGd,EAAA,aAAA;IAAW,IAAA,eAAA,YAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAnBF,aAAA,GAAgB,CAAA,CAAE,aAAa;;;;KAK/B,WAAA;;;;;;;;;iBAUI,aAAA,gBACC,sDAGd"}
@@ -13,6 +13,7 @@ type CliArgs = {
13
13
  anthropicModel?: string;
14
14
  agentProvider?: string;
15
15
  skills?: string;
16
+ disableSkills?: string;
16
17
  agent?: boolean;
17
18
  experimental?: boolean;
18
19
  organizationSlug?: string;
@@ -30,7 +31,9 @@ type EnvArgs = {
30
31
  openaiModel?: string;
31
32
  anthropicModel?: string;
32
33
  agentProvider?: string;
34
+ clientId?: string;
33
35
  skills?: string;
36
+ disableSkills?: string;
34
37
  };
35
38
  type MergedArgs = {
36
39
  accessToken?: string;
@@ -43,7 +46,9 @@ type MergedArgs = {
43
46
  anthropicBaseUrl?: string;
44
47
  anthropicModel?: string;
45
48
  agentProvider?: string;
49
+ clientId?: string;
46
50
  skills?: string;
51
+ disableSkills?: string;
47
52
  agent?: boolean;
48
53
  experimental?: boolean;
49
54
  organizationSlug?: string;
@@ -52,8 +57,13 @@ type MergedArgs = {
52
57
  version?: boolean;
53
58
  unknownArgs: string[];
54
59
  };
55
- type ResolvedConfig = {
56
- accessToken: string;
60
+ /**
61
+ * Partially resolved config — accessToken may not yet be available
62
+ * (will be resolved via device code flow or cache).
63
+ */
64
+ type PartiallyResolvedConfig = {
65
+ accessToken?: string;
66
+ clientId: string;
57
67
  sentryHost: string;
58
68
  mcpUrl?: string;
59
69
  sentryDsn?: string;
@@ -62,12 +72,15 @@ type ResolvedConfig = {
62
72
  anthropicBaseUrl?: string;
63
73
  anthropicModel?: string;
64
74
  agentProvider?: "openai" | "anthropic";
65
- /** Primary authorization method */
66
- finalSkills?: Set<Skill>;
75
+ /** Skills granted for this session (always populated by finalize()) */
76
+ finalSkills: Set<Skill>;
67
77
  organizationSlug?: string;
68
78
  projectSlug?: string;
69
79
  };
80
+ type ResolvedConfig = Omit<PartiallyResolvedConfig, "accessToken"> & {
81
+ accessToken: string;
82
+ };
70
83
  //# sourceMappingURL=types.d.ts.map
71
84
  //#endregion
72
- export { CliArgs, EnvArgs, MergedArgs, ResolvedConfig };
73
- //# sourceMappingURL=types-rOTvxXQO.d.ts.map
85
+ export { CliArgs, EnvArgs, MergedArgs, PartiallyResolvedConfig, ResolvedConfig };
86
+ //# sourceMappingURL=types-rlmLVpNO.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-rlmLVpNO.d.cts","names":[],"sources":["../src/cli/types.ts"],"sourcesContent":[],"mappings":";;;KAEY,OAAA;;EAAA,IAAA,CAAA,EAAA,MAAO;EAsBP,GAAA,CAAA,EAAA,MAAO;EAcP,MAAA,CAAA,EAAA,MAAU;EA2BV,SAAA,CAAA,EAAA,MAAA;EAAuB,aAAA,CAAA,EAAA,MAAA;EAAA,WAYhB,CAAA,EAAA,MAAA;EAAK,gBAAT,CAAA,EAAA,MAAA;EAAG,cAAA,CAAA,EAAA,MAAA;EAKN,aAAA,CAAA,EAAA,MAAc;EAAA,MAAA,CAAA,EAAA,MAAA;EAAA,aAAQ,CAAA,EAAA,MAAA;EAAuB,KAA5B,CAAA,EAAA,OAAA;EAAI,YAAA,CAAA,EAAA,OAAA;;;;;;;KA1DrB,OAAA;;;;;;;;;;;;;KAcA,UAAA;;;;;;;;;;;;;;;;;;;;;;;;;;KA2BA,uBAAA;;;;;;;;;;;;eAYG,IAAI;;;;KAKP,cAAA,GAAiB,KAAK"}
@@ -0,0 +1,78 @@
1
+ const require_chunk = require('./chunk-Cv9WC9bY.cjs');
2
+ const zod = require_chunk.__toESM(require("zod"));
3
+
4
+ //#region src/auth/types.ts
5
+ /**
6
+ * Response from Sentry's device code endpoint (POST /oauth/device/code/).
7
+ * See: https://docs.sentry.io/api/auth/#device-authorization-flow
8
+ */
9
+ const DeviceCodeResponseSchema = zod.z.object({
10
+ device_code: zod.z.string(),
11
+ user_code: zod.z.string(),
12
+ verification_uri: zod.z.string().url(),
13
+ verification_uri_complete: zod.z.string().url(),
14
+ interval: zod.z.number().int().positive(),
15
+ expires_in: zod.z.number().int().positive()
16
+ });
17
+ /**
18
+ * Error response during device code token polling.
19
+ */
20
+ const DeviceCodeErrorSchema = zod.z.object({
21
+ error: zod.z.string(),
22
+ error_description: zod.z.string().optional()
23
+ });
24
+ /**
25
+ * Successful token response from Sentry's token endpoint.
26
+ * Mirrors the shape used by the cloudflare OAuth callback.
27
+ */
28
+ const TokenResponseSchema = zod.z.object({
29
+ access_token: zod.z.string(),
30
+ refresh_token: zod.z.string(),
31
+ token_type: zod.z.string(),
32
+ expires_in: zod.z.number(),
33
+ expires_at: zod.z.string().datetime(),
34
+ user: zod.z.object({
35
+ email: zod.z.string().email(),
36
+ id: zod.z.string(),
37
+ name: zod.z.string().nullable()
38
+ }),
39
+ scope: zod.z.string()
40
+ });
41
+ function toCachedToken(tokenResponse, sentryHost, clientId) {
42
+ return {
43
+ access_token: tokenResponse.access_token,
44
+ refresh_token: tokenResponse.refresh_token,
45
+ expires_at: tokenResponse.expires_at,
46
+ sentry_host: sentryHost,
47
+ client_id: clientId,
48
+ user_email: tokenResponse.user.email,
49
+ scope: tokenResponse.scope
50
+ };
51
+ }
52
+
53
+ //#endregion
54
+ Object.defineProperty(exports, 'DeviceCodeErrorSchema', {
55
+ enumerable: true,
56
+ get: function () {
57
+ return DeviceCodeErrorSchema;
58
+ }
59
+ });
60
+ Object.defineProperty(exports, 'DeviceCodeResponseSchema', {
61
+ enumerable: true,
62
+ get: function () {
63
+ return DeviceCodeResponseSchema;
64
+ }
65
+ });
66
+ Object.defineProperty(exports, 'TokenResponseSchema', {
67
+ enumerable: true,
68
+ get: function () {
69
+ return TokenResponseSchema;
70
+ }
71
+ });
72
+ Object.defineProperty(exports, 'toCachedToken', {
73
+ enumerable: true,
74
+ get: function () {
75
+ return toCachedToken;
76
+ }
77
+ });
78
+ //# sourceMappingURL=types-xUmfecYm.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-xUmfecYm.cjs","names":["tokenResponse: TokenResponse","sentryHost: string","clientId: string"],"sources":["../src/auth/types.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/**\n * Response from Sentry's device code endpoint (POST /oauth/device/code/).\n * See: https://docs.sentry.io/api/auth/#device-authorization-flow\n */\nexport const DeviceCodeResponseSchema = z.object({\n device_code: z.string(),\n user_code: z.string(),\n verification_uri: z.string().url(),\n verification_uri_complete: z.string().url(),\n interval: z.number().int().positive(),\n expires_in: z.number().int().positive(),\n});\n\nexport type DeviceCodeResponse = z.infer<typeof DeviceCodeResponseSchema>;\n\n/**\n * Error response during device code token polling.\n */\nexport const DeviceCodeErrorSchema = z.object({\n error: z.string(),\n error_description: z.string().optional(),\n});\n\n/**\n * Successful token response from Sentry's token endpoint.\n * Mirrors the shape used by the cloudflare OAuth callback.\n */\nexport const TokenResponseSchema = z.object({\n access_token: z.string(),\n refresh_token: z.string(),\n token_type: z.string(),\n expires_in: z.number(),\n expires_at: z.string().datetime(),\n user: z.object({\n email: z.string().email(),\n id: z.string(),\n name: z.string().nullable(),\n }),\n scope: z.string(),\n});\n\nexport type TokenResponse = z.infer<typeof TokenResponseSchema>;\n\n/**\n * Shape of a cached token entry stored on disk.\n */\nexport type CachedToken = {\n access_token: string;\n refresh_token: string;\n expires_at: string;\n sentry_host: string;\n client_id: string;\n user_email: string;\n scope: string;\n};\n\nexport function toCachedToken(\n tokenResponse: TokenResponse,\n sentryHost: string,\n clientId: string,\n): CachedToken {\n return {\n access_token: tokenResponse.access_token,\n refresh_token: tokenResponse.refresh_token,\n expires_at: tokenResponse.expires_at,\n sentry_host: sentryHost,\n client_id: clientId,\n user_email: tokenResponse.user.email,\n scope: tokenResponse.scope,\n };\n}\n"],"mappings":";;;;;;;;AAMA,MAAa,2BAA2B,MAAE,OAAO;CAC/C,aAAa,MAAE,QAAQ;CACvB,WAAW,MAAE,QAAQ;CACrB,kBAAkB,MAAE,QAAQ,CAAC,KAAK;CAClC,2BAA2B,MAAE,QAAQ,CAAC,KAAK;CAC3C,UAAU,MAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;CACrC,YAAY,MAAE,QAAQ,CAAC,KAAK,CAAC,UAAU;AACxC,EAAC;;;;AAOF,MAAa,wBAAwB,MAAE,OAAO;CAC5C,OAAO,MAAE,QAAQ;CACjB,mBAAmB,MAAE,QAAQ,CAAC,UAAU;AACzC,EAAC;;;;;AAMF,MAAa,sBAAsB,MAAE,OAAO;CAC1C,cAAc,MAAE,QAAQ;CACxB,eAAe,MAAE,QAAQ;CACzB,YAAY,MAAE,QAAQ;CACtB,YAAY,MAAE,QAAQ;CACtB,YAAY,MAAE,QAAQ,CAAC,UAAU;CACjC,MAAM,MAAE,OAAO;EACb,OAAO,MAAE,QAAQ,CAAC,OAAO;EACzB,IAAI,MAAE,QAAQ;EACd,MAAM,MAAE,QAAQ,CAAC,UAAU;CAC5B,EAAC;CACF,OAAO,MAAE,QAAQ;AAClB,EAAC;AAiBF,SAAgB,cACdA,eACAC,YACAC,UACa;AACb,QAAO;EACL,cAAc,cAAc;EAC5B,eAAe,cAAc;EAC7B,YAAY,cAAc;EAC1B,aAAa;EACb,WAAW;EACX,YAAY,cAAc,KAAK;EAC/B,OAAO,cAAc;CACtB;AACF"}
@@ -1,15 +1,23 @@
1
1
  //#region src/cli/usage.ts
2
2
  function buildUsage(packageName, allSkills) {
3
- return `Usage: ${packageName} --access-token=<token> [--host=<host>]
3
+ return `Usage: ${packageName} [--access-token=<token>] [--host=<host>]
4
+ ${packageName} auth [login|logout|status]
4
5
 
5
- Required:
6
+ Commands:
7
+ auth login Authenticate via device code flow (sentry.io only)
8
+ auth logout Clear cached authentication
9
+ auth status Show current authentication state
10
+
11
+ Authentication:
6
12
  --access-token <token> Sentry User Auth Token with API access
13
+ Optional for sentry.io (device code flow is used if omitted)
14
+ Required for self-hosted instances
7
15
 
8
16
  Common optional flags:
9
17
  --host <host> Change Sentry host (self-hosted)
10
18
  --sentry-dsn <dsn> Override DSN used for telemetry reporting
11
19
  --agent Agent mode: only expose use_sentry tool (for AI agents)
12
- --experimental Enable experimental tools (hidden by default)
20
+ --experimental Enable forward-looking tool variants and experimental features
13
21
 
14
22
  Embedded agent configuration:
15
23
  --agent-provider <provider> LLM provider: openai or anthropic (auto-detects from API keys)
@@ -23,23 +31,28 @@ Session constraints:
23
31
  --project-slug <slug> Optional project constraint
24
32
 
25
33
  Skill controls:
26
- --skills <list> Specify which skills to grant (default: all skills)
34
+ --skills <list> Specify which skills to grant (default: all skills)
35
+ --disable-skills <list> Remove specific skills (e.g. --disable-skills=seer)
27
36
 
28
37
  All skills: ${allSkills.join(", ")}
29
38
 
30
39
  Environment variables:
31
40
  SENTRY_ACCESS_TOKEN Sentry auth token (alternative to --access-token)
41
+ SENTRY_CLIENT_ID Override OAuth client ID for device code flow
32
42
  OPENAI_API_KEY OpenAI API key for AI-powered search tools
33
43
  ANTHROPIC_API_KEY Anthropic API key for AI-powered search tools
34
44
  EMBEDDED_AGENT_PROVIDER Provider override: openai or anthropic
45
+ MCP_DISABLE_SKILLS Disable specific skills (comma-separated)
35
46
 
36
47
  Examples:
48
+ ${packageName} # device code auth (sentry.io only)
37
49
  ${packageName} --access-token=TOKEN
38
50
  ${packageName} --access-token=TOKEN --skills=inspect,triage
39
51
  ${packageName} --access-token=TOKEN --host=sentry.example.com
52
+ ${packageName} --access-token=TOKEN --host=sentry.example.com --disable-skills=seer
40
53
  ${packageName} --access-token=TOKEN --agent-provider=anthropic`;
41
54
  }
42
55
 
43
56
  //#endregion
44
57
  export { buildUsage };
45
- //# sourceMappingURL=usage-Bw3IN4iE.js.map
58
+ //# sourceMappingURL=usage-DB-MGezA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage-DB-MGezA.js","names":["packageName: string","allSkills: ReadonlyArray<Skill>"],"sources":["../src/cli/usage.ts"],"sourcesContent":["import type { Skill } from \"@sentry/mcp-core/skills\";\n\nexport function buildUsage(\n packageName: string,\n allSkills: ReadonlyArray<Skill>,\n): string {\n return `Usage: ${packageName} [--access-token=<token>] [--host=<host>]\n ${packageName} auth [login|logout|status]\n\nCommands:\n auth login Authenticate via device code flow (sentry.io only)\n auth logout Clear cached authentication\n auth status Show current authentication state\n\nAuthentication:\n --access-token <token> Sentry User Auth Token with API access\n Optional for sentry.io (device code flow is used if omitted)\n Required for self-hosted instances\n\nCommon optional flags:\n --host <host> Change Sentry host (self-hosted)\n --sentry-dsn <dsn> Override DSN used for telemetry reporting\n --agent Agent mode: only expose use_sentry tool (for AI agents)\n --experimental Enable forward-looking tool variants and experimental features\n\nEmbedded agent configuration:\n --agent-provider <provider> LLM provider: openai or anthropic (auto-detects from API keys)\n --openai-base-url <url> Override OpenAI API base URL\n --openai-model <model> Override OpenAI model (default: gpt-5)\n --anthropic-base-url <url> Override Anthropic API base URL\n --anthropic-model <model> Override Anthropic model (default: claude-sonnet-4-5)\n\nSession constraints:\n --organization-slug <slug> Force all calls to an organization\n --project-slug <slug> Optional project constraint\n\nSkill controls:\n --skills <list> Specify which skills to grant (default: all skills)\n --disable-skills <list> Remove specific skills (e.g. --disable-skills=seer)\n\nAll skills: ${allSkills.join(\", \")}\n\nEnvironment variables:\n SENTRY_ACCESS_TOKEN Sentry auth token (alternative to --access-token)\n SENTRY_CLIENT_ID Override OAuth client ID for device code flow\n OPENAI_API_KEY OpenAI API key for AI-powered search tools\n ANTHROPIC_API_KEY Anthropic API key for AI-powered search tools\n EMBEDDED_AGENT_PROVIDER Provider override: openai or anthropic\n MCP_DISABLE_SKILLS Disable specific skills (comma-separated)\n\nExamples:\n ${packageName} # device code auth (sentry.io only)\n ${packageName} --access-token=TOKEN\n ${packageName} --access-token=TOKEN --skills=inspect,triage\n ${packageName} --access-token=TOKEN --host=sentry.example.com\n ${packageName} --access-token=TOKEN --host=sentry.example.com --disable-skills=seer\n ${packageName} --access-token=TOKEN --agent-provider=anthropic`;\n}\n"],"mappings":";AAEA,SAAgB,WACdA,aACAC,WACQ;AACR,SAAQ,SAAS,YAAY;SACtB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiCP,UAAU,KAAK,KAAK,CAAC;;;;;;;;;;;IAW/B,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;AACf"}
@@ -1,16 +1,24 @@
1
1
 
2
2
  //#region src/cli/usage.ts
3
3
  function buildUsage(packageName, allSkills) {
4
- return `Usage: ${packageName} --access-token=<token> [--host=<host>]
4
+ return `Usage: ${packageName} [--access-token=<token>] [--host=<host>]
5
+ ${packageName} auth [login|logout|status]
5
6
 
6
- Required:
7
+ Commands:
8
+ auth login Authenticate via device code flow (sentry.io only)
9
+ auth logout Clear cached authentication
10
+ auth status Show current authentication state
11
+
12
+ Authentication:
7
13
  --access-token <token> Sentry User Auth Token with API access
14
+ Optional for sentry.io (device code flow is used if omitted)
15
+ Required for self-hosted instances
8
16
 
9
17
  Common optional flags:
10
18
  --host <host> Change Sentry host (self-hosted)
11
19
  --sentry-dsn <dsn> Override DSN used for telemetry reporting
12
20
  --agent Agent mode: only expose use_sentry tool (for AI agents)
13
- --experimental Enable experimental tools (hidden by default)
21
+ --experimental Enable forward-looking tool variants and experimental features
14
22
 
15
23
  Embedded agent configuration:
16
24
  --agent-provider <provider> LLM provider: openai or anthropic (auto-detects from API keys)
@@ -24,20 +32,25 @@ Session constraints:
24
32
  --project-slug <slug> Optional project constraint
25
33
 
26
34
  Skill controls:
27
- --skills <list> Specify which skills to grant (default: all skills)
35
+ --skills <list> Specify which skills to grant (default: all skills)
36
+ --disable-skills <list> Remove specific skills (e.g. --disable-skills=seer)
28
37
 
29
38
  All skills: ${allSkills.join(", ")}
30
39
 
31
40
  Environment variables:
32
41
  SENTRY_ACCESS_TOKEN Sentry auth token (alternative to --access-token)
42
+ SENTRY_CLIENT_ID Override OAuth client ID for device code flow
33
43
  OPENAI_API_KEY OpenAI API key for AI-powered search tools
34
44
  ANTHROPIC_API_KEY Anthropic API key for AI-powered search tools
35
45
  EMBEDDED_AGENT_PROVIDER Provider override: openai or anthropic
46
+ MCP_DISABLE_SKILLS Disable specific skills (comma-separated)
36
47
 
37
48
  Examples:
49
+ ${packageName} # device code auth (sentry.io only)
38
50
  ${packageName} --access-token=TOKEN
39
51
  ${packageName} --access-token=TOKEN --skills=inspect,triage
40
52
  ${packageName} --access-token=TOKEN --host=sentry.example.com
53
+ ${packageName} --access-token=TOKEN --host=sentry.example.com --disable-skills=seer
41
54
  ${packageName} --access-token=TOKEN --agent-provider=anthropic`;
42
55
  }
43
56
 
@@ -48,4 +61,4 @@ Object.defineProperty(exports, 'buildUsage', {
48
61
  return buildUsage;
49
62
  }
50
63
  });
51
- //# sourceMappingURL=usage-BZayoeC1.cjs.map
64
+ //# sourceMappingURL=usage-DRK6TiDr.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage-DRK6TiDr.cjs","names":["packageName: string","allSkills: ReadonlyArray<Skill>"],"sources":["../src/cli/usage.ts"],"sourcesContent":["import type { Skill } from \"@sentry/mcp-core/skills\";\n\nexport function buildUsage(\n packageName: string,\n allSkills: ReadonlyArray<Skill>,\n): string {\n return `Usage: ${packageName} [--access-token=<token>] [--host=<host>]\n ${packageName} auth [login|logout|status]\n\nCommands:\n auth login Authenticate via device code flow (sentry.io only)\n auth logout Clear cached authentication\n auth status Show current authentication state\n\nAuthentication:\n --access-token <token> Sentry User Auth Token with API access\n Optional for sentry.io (device code flow is used if omitted)\n Required for self-hosted instances\n\nCommon optional flags:\n --host <host> Change Sentry host (self-hosted)\n --sentry-dsn <dsn> Override DSN used for telemetry reporting\n --agent Agent mode: only expose use_sentry tool (for AI agents)\n --experimental Enable forward-looking tool variants and experimental features\n\nEmbedded agent configuration:\n --agent-provider <provider> LLM provider: openai or anthropic (auto-detects from API keys)\n --openai-base-url <url> Override OpenAI API base URL\n --openai-model <model> Override OpenAI model (default: gpt-5)\n --anthropic-base-url <url> Override Anthropic API base URL\n --anthropic-model <model> Override Anthropic model (default: claude-sonnet-4-5)\n\nSession constraints:\n --organization-slug <slug> Force all calls to an organization\n --project-slug <slug> Optional project constraint\n\nSkill controls:\n --skills <list> Specify which skills to grant (default: all skills)\n --disable-skills <list> Remove specific skills (e.g. --disable-skills=seer)\n\nAll skills: ${allSkills.join(\", \")}\n\nEnvironment variables:\n SENTRY_ACCESS_TOKEN Sentry auth token (alternative to --access-token)\n SENTRY_CLIENT_ID Override OAuth client ID for device code flow\n OPENAI_API_KEY OpenAI API key for AI-powered search tools\n ANTHROPIC_API_KEY Anthropic API key for AI-powered search tools\n EMBEDDED_AGENT_PROVIDER Provider override: openai or anthropic\n MCP_DISABLE_SKILLS Disable specific skills (comma-separated)\n\nExamples:\n ${packageName} # device code auth (sentry.io only)\n ${packageName} --access-token=TOKEN\n ${packageName} --access-token=TOKEN --skills=inspect,triage\n ${packageName} --access-token=TOKEN --host=sentry.example.com\n ${packageName} --access-token=TOKEN --host=sentry.example.com --disable-skills=seer\n ${packageName} --access-token=TOKEN --agent-provider=anthropic`;\n}\n"],"mappings":";;AAEA,SAAgB,WACdA,aACAC,WACQ;AACR,SAAQ,SAAS,YAAY;SACtB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAiCP,UAAU,KAAK,KAAK,CAAC;;;;;;;;;;;IAW/B,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,YAAY;AACf"}
@@ -0,0 +1,7 @@
1
+ //#region ../mcp-core/dist/version-DRuyPBSD.js
2
+ const LIB_VERSION = typeof process !== "undefined" && "0.31.0" || "0.0.0";
3
+ const USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;
4
+
5
+ //#endregion
6
+ export { LIB_VERSION, USER_AGENT };
7
+ //# sourceMappingURL=version-CYYpU4RZ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-CYYpU4RZ.js","names":[],"sources":["../../mcp-core/dist/version-DRuyPBSD.js"],"sourcesContent":["//#region src/version.ts\nconst LIB_VERSION = typeof process !== \"undefined\" && \"0.31.0\" || \"0.0.0\";\nconst USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;\n\n//#endregion\nexport { LIB_VERSION, USER_AGENT };\n//# sourceMappingURL=version-DRuyPBSD.js.map"],"mappings":";AACA,MAAM,qBAAqB,YAAY,eAAe,YAAY;AAClE,MAAM,cAAc,aAAa,YAAY"}
@@ -0,0 +1,19 @@
1
+
2
+ //#region ../mcp-core/dist/version-DRuyPBSD.js
3
+ const LIB_VERSION = typeof process !== "undefined" && "0.31.0" || "0.0.0";
4
+ const USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;
5
+
6
+ //#endregion
7
+ Object.defineProperty(exports, 'LIB_VERSION', {
8
+ enumerable: true,
9
+ get: function () {
10
+ return LIB_VERSION;
11
+ }
12
+ });
13
+ Object.defineProperty(exports, 'USER_AGENT', {
14
+ enumerable: true,
15
+ get: function () {
16
+ return USER_AGENT;
17
+ }
18
+ });
19
+ //# sourceMappingURL=version-Ca7qUBih.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-Ca7qUBih.cjs","names":[],"sources":["../../mcp-core/dist/version-DRuyPBSD.js"],"sourcesContent":["//#region src/version.ts\nconst LIB_VERSION = typeof process !== \"undefined\" && \"0.31.0\" || \"0.0.0\";\nconst USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;\n\n//#endregion\nexport { LIB_VERSION, USER_AGENT };\n//# sourceMappingURL=version-DRuyPBSD.js.map"],"mappings":";;AACA,MAAM,qBAAqB,YAAY,eAAe,YAAY;AAClE,MAAM,cAAc,aAAa,YAAY"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sentry/mcp-server",
3
3
  "mcpName": "io.github.getsentry/sentry-mcp",
4
- "version": "0.29.0",
4
+ "version": "0.31.0",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=20"
@@ -41,7 +41,7 @@
41
41
  }
42
42
  },
43
43
  "dependencies": {
44
- "@modelcontextprotocol/sdk": "^1.21.0",
44
+ "@modelcontextprotocol/sdk": "^1.26.0",
45
45
  "@sentry/node": "10.35.0",
46
46
  "@sentry/core": "10.35.0",
47
47
  "dotenv": "^16.6.1",
@@ -53,9 +53,9 @@
53
53
  "tsx": "^4.20.3",
54
54
  "typescript": "^5.8.3",
55
55
  "vitest": "^3.2.4",
56
- "@sentry/mcp-core": "0.29.0",
57
- "@sentry/mcp-server-mocks": "0.29.0",
58
- "@sentry/mcp-server-tsconfig": "0.29.0"
56
+ "@sentry/mcp-core": "0.31.0",
57
+ "@sentry/mcp-server-tsconfig": "0.31.0",
58
+ "@sentry/mcp-server-mocks": "0.31.0"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "tsdown",
@@ -1 +0,0 @@
1
- {"version":3,"file":"config-CEjP2CYO-CZKUamRu.cjs","names":[],"sources":["../../mcp-core/dist/config-CEjP2CYO.js"],"sourcesContent":["//#region src/tools/search-events/config.ts\nconst systemPrompt = `You are a Sentry query translator. You need to:\n1. FIRST determine which dataset (spans, errors, or logs) is most appropriate for the query\n2. Query the available attributes for that dataset using the datasetAttributes tool\n3. Use the otelSemantics tool if you need OpenTelemetry semantic conventions\n4. Convert the natural language query to Sentry's search syntax (NOT SQL syntax)\n5. Decide which fields to return in the results\n\nCRITICAL: Sentry does NOT use SQL syntax. Do NOT generate SQL-like queries.\n\nDATASET SELECTION GUIDELINES:\n- spans: Performance data, traces, AI/LLM calls, database queries, HTTP requests, token usage, costs, duration metrics, user agent data, \"XYZ calls\", ambiguous operations (richest attribute set)\n- errors: Exceptions, crashes, error messages, stack traces, unhandled errors, browser/client errors\n- logs: Log entries, log messages, severity levels, debugging information\n\nFor ambiguous queries like \"calls using XYZ\", prefer spans dataset first as it contains the most comprehensive telemetry data.\n\nCRITICAL - FIELD VERIFICATION REQUIREMENT:\nBefore constructing ANY query, you MUST verify field availability:\n1. You CANNOT assume ANY field exists without checking - not even common ones\n2. This includes ALL fields: custom attributes, database fields, HTTP fields, AI fields, user fields, etc.\n3. Fields vary by project based on what data is being sent to Sentry\n4. Using an unverified field WILL cause your query to fail with \"field not found\" errors\n5. The datasetAttributes tool tells you EXACTLY which fields are available\n\nTOOL USAGE GUIDELINES:\n1. Use datasetAttributes tool to discover available fields for your chosen dataset\n2. Use otelSemantics tool when you need specific OpenTelemetry semantic convention attributes\n3. Use whoami tool when queries contain \"me\" references for user.id or user.email fields\n4. IMPORTANT: For ambiguous terms like \"user agents\", \"browser\", \"client\" - use the datasetAttributes tool to find the correct field name (typically user_agent.original) instead of assuming it's related to user.id\n\nCRITICAL - TOOL RESPONSE HANDLING:\nAll tools return responses in this format: {error?: string, result?: data}\n- If 'error' is present: The tool failed - analyze the error message and potentially retry with corrections\n- If 'result' is present: The tool succeeded - use the result data for your query construction\n- Always check for errors before using results\n\nCRITICAL - HANDLING \"DISTINCT\" OR \"UNIQUE VALUES\" QUERIES:\nWhen user asks for \"distinct\", \"unique\", \"all values of\", or \"what are the X\" queries:\n1. This ALWAYS requires an AGGREGATE query with count() function\n2. Pattern: fields=['field_name', 'count()'] to show distinct values with counts\n3. Sort by \"-count()\" to show most common values first\n4. Use datasetAttributes tool to verify the field exists before constructing query\n5. Examples:\n - \"distinct categories\" → fields=['category.name', 'count()'], sort='-count()'\n - \"unique types\" → fields=['item.type', 'count()'], sort='-count()'\n\nCRITICAL - TRAFFIC/VOLUME/COUNT QUERIES:\nWhen user asks about \"traffic\", \"volume\", \"how much\", \"how many\" (without specific metrics):\n1. This ALWAYS requires an AGGREGATE query with count() function\n2. For total counts: fields=['count()']\n3. For grouped counts: fields=['grouping_field', 'count()']\n4. Always include timeRange for period-specific queries\n5. Examples:\n - \"how much traffic in last 30 days\" → fields=['count()'], timeRange: {\"statsPeriod\": \"30d\"}\n - \"traffic on mcp-server\" → query: \"project:mcp-server\", fields=['count()']\n\nCRITICAL - HANDLING \"ME\" REFERENCES:\n- If the query contains \"me\", \"my\", \"myself\", or \"affecting me\" in the context of user.id or user.email fields, use the whoami tool to get the user's ID and email\n- For assignedTo fields, you can use \"me\" directly without translation (e.g., assignedTo:me works as-is)\n- After calling whoami, replace \"me\" references with the actual user.id or user.email values\n- If whoami fails, return an error explaining the issue\n\nQUERY MODES:\n1. INDIVIDUAL EVENTS (default): Returns raw event data\n - Used when fields contain no function() calls\n - Include recommended fields plus any user-requested fields\n\n2. AGGREGATE QUERIES: Grouping and aggregation (NOT SQL)\n - Activated when ANY field contains a function() call\n - Fields should ONLY include: aggregate functions + groupBy fields\n - Automatically groups by ALL non-function fields\n - For aggregate queries, ONLY include the aggregate functions and groupBy fields - do NOT include default fields like timestamp, id, etc.\n - You SHOULD sort aggregate results by \"-function_name()\" for descending order (highest values first)\n - For equations in aggregate queries: You SHOULD use \"-equation|...\" prefix unless user wants lowest values\n - When user asks \"how many total\", \"sum of\", or similar: They want the highest/total value, use descending sort\n\nCRITICAL LIMITATION - TIME SERIES NOT SUPPORTED:\n- Queries asking for data \"over time\", \"by hour\", \"by day\", \"time series\", or similar temporal groupings are NOT currently supported\n- If user asks for \"X over time\", return an error explaining: \"Time series aggregations are not currently supported.\"\n\nCRITICAL - DO NOT USE SQL SYNTAX:\n- NEVER use SQL functions like yesterday(), today(), now(), IS NOT NULL, IS NULL\n- NEVER use SQL date functions - use timeRange parameter instead\n- For \"yesterday\": Use timeRange: {\"statsPeriod\": \"24h\"}, NOT timestamp >= yesterday()\n- For field existence: Use has:field_name, NOT field_name IS NOT NULL\n- For field absence: Use !has:field_name, NOT field_name IS NULL\n\nMATHEMATICAL QUERY PATTERNS:\nWhen user asks mathematical questions like \"how many X\", \"total Y used\", \"sum of Z\":\n- Identify the appropriate dataset based on context\n- Use datasetAttributes tool to find available numeric fields\n- Use sum() function for totals, avg() for averages, count() for counts\n- For time-based queries (\"today\", \"yesterday\", \"this week\"), use timeRange parameter\n- For \"total\" or \"how many\" questions: Users typically want highest values first (descending sort)\n\nDERIVED METRICS AND CALCULATIONS (SPANS ONLY):\nWhen user asks for calculated metrics, ratios, or conversions:\n- Use equation fields with \"equation|\" prefix\n- Examples:\n - \"duration in milliseconds\" → fields: [\"equation|avg(span.duration) * 1000\"], sort: \"-equation|avg(span.duration) * 1000\"\n - \"combined metric total\" → fields: [\"equation|sum(metric.a) + sum(metric.b)\"], sort: \"-equation|sum(metric.a) + sum(metric.b)\"\n - \"error rate percentage\" → fields: [\"equation|failure_rate() * 100\"], sort: \"-equation|failure_rate() * 100\"\n - \"events per second\" → fields: [\"equation|count() / 3600\"], sort: \"-equation|count() / 3600\"\n- IMPORTANT: Equations are ONLY supported in the spans dataset, NOT in errors or logs\n- IMPORTANT: When sorting by equations, use \"-equation|...\" for descending order (highest values first)\n\nPERFORMANCE INVESTIGATION STRATEGY:\nWhen users ask about \"performance problems\", \"slow pages\", \"slow endpoints\", \"latency issues\",\n\"web vitals\", \"LCP\", \"CLS\", \"INP\", \"page speed\", \"load time\", \"response time\", or similar:\n\n1. ALWAYS use AGGREGATE queries first - individual samples are misleading for performance analysis\n2. Use p75() as the primary percentile for consistent performance measurement\n3. Group by transaction to identify which pages/endpoints have problems\n4. Include count() to understand sample size (low count = unreliable data)\n5. Sort by the worst-performing metric (descending with \"-\" prefix)\n\nCRITICAL: For performance investigations, return AGGREGATES grouped by the span's transaction attribute, NOT individual events.\n\nSPAN QUERY PHILOSOPHY - DUCK TYPING:\nUse \"has:attribute\" to find spans by their characteristics, NOT \"is_transaction:true\".\nThe is_transaction:true filter ONLY returns transaction boundaries (request entry/exit points).\nMost performance queries want specific span types, not just boundaries.\n\nPerformance Query Patterns (use duck typing):\n- Web Vitals: has:measurements.lcp, has:measurements.cls, has:measurements.inp\n- Database: has:db.statement or has:db.system\n- HTTP/API calls: has:http.method or has:http.url\n- External Services: has:http.url (for outbound calls)\n- AI/LLM: has:gen_ai.system or has:gen_ai.request.model\n- MCP Tools: has:mcp.tool.name\n\nWHEN TO USE is_transaction:true (rare):\n- ONLY when you specifically need transaction boundaries (full request/response cycle)\n- Example: \"total request duration by endpoint\" - you want the outermost span\n- For most queries about \"slow X\" or \"X performance\", use duck typing instead\n\nWeb Vitals Thresholds (for context when reporting):\n- LCP: Good < 2500ms, Needs Improvement 2500-4000ms, Poor >= 4000ms\n- CLS: Good < 0.1, Needs Improvement 0.1-0.25, Poor >= 0.25\n- INP: Good < 200ms, Needs Improvement 200-500ms, Poor >= 500ms\n- FCP: Good < 1800ms, Needs Improvement 1800-3000ms, Poor >= 3000ms\n- TTFB: Good < 800ms, Needs Improvement 800-1800ms, Poor >= 1800ms\n\nSORTING RULES (CRITICAL - YOU MUST ALWAYS SPECIFY A SORT):\n1. CRITICAL: Sort MUST go in the separate \"sort\" field, NEVER in the \"query\" field\n - WRONG: query: \"level:error sort:-timestamp\" ← Sort syntax in query field is FORBIDDEN\n - CORRECT: query: \"level:error\", sort: \"-timestamp\" ← Sort in separate field\n\n2. DEFAULT SORTING:\n - errors dataset: Use \"-timestamp\" (newest first)\n - spans dataset: Use \"-span.duration\" (slowest first) \n - logs dataset: Use \"-timestamp\" (newest first)\n\n3. SORTING SYNTAX:\n - Use \"-\" prefix for descending order (e.g., \"-timestamp\" for newest first)\n - Use field name without prefix for ascending order\n - For aggregate queries: sort by aggregate function results (e.g., \"-count()\" for highest count first)\n - For equation fields: You SHOULD use \"-equation|...\" for descending order (e.g., \"-equation|sum(field1) + sum(field2)\")\n - Only omit the \"-\" prefix if the user clearly wants lowest values first (rare)\n\n4. IMPORTANT SORTING REQUIREMENTS:\n - YOU MUST ALWAYS INCLUDE A SORT PARAMETER\n - CRITICAL: The field you sort by MUST be included in your fields array\n - If sorting by \"-timestamp\", include \"timestamp\" in fields\n - If sorting by \"-count()\", include \"count()\" in fields\n - This is MANDATORY - Sentry will reject queries where sort field is not in the selected fields\n\nYOUR RESPONSE FORMAT:\nReturn a JSON object with these fields:\n- \"dataset\": Which dataset you determined to use (\"spans\", \"errors\", or \"logs\")\n- \"query\": The Sentry query string for filtering results (use empty string \"\" for no filters)\n- \"fields\": Array of field names to return in results\n - For individual event queries: OPTIONAL (will use recommended fields if not provided)\n - For aggregate queries: REQUIRED (must include aggregate functions AND any groupBy fields)\n- \"sort\": Sort parameter for results (REQUIRED - YOU MUST ALWAYS SPECIFY THIS)\n- \"timeRange\": Time range parameters (optional)\n - Relative: {\"statsPeriod\": \"24h\"} for last 24 hours, \"7d\" for last 7 days, etc.\n - Absolute: {\"start\": \"2025-06-19T07:00:00\", \"end\": \"2025-06-20T06:59:59\"} for specific date ranges\n\nCORRECT QUERY PATTERNS (FOLLOW THESE):\n- For field existence: Use has:field_name (NOT field_name IS NOT NULL)\n- For field absence: Use !has:field_name (NOT field_name IS NULL)\n- For time periods: Use timeRange parameter (NOT SQL date functions)\n- Example: \"items processed yesterday\" → query: \"has:item.processed\", timeRange: {\"statsPeriod\": \"24h\"}\n\nPROCESS:\n1. Analyze the user's query\n2. Determine appropriate dataset\n3. Use datasetAttributes tool to discover available fields\n4. Use otelSemantics tool if needed for OpenTelemetry attributes\n5. Construct the final query with proper fields and sort parameters\n\nCOMMON ERRORS TO AVOID:\n- Using SQL syntax (IS NOT NULL, IS NULL, yesterday(), today(), etc.) - Use has: operator and timeRange instead\n- Using numeric functions (sum, avg, min, max, percentiles) on non-numeric fields\n- Using incorrect field names (use the otelSemantics tool to look up correct names)\n- Missing required fields in the fields array for aggregate queries\n- Invalid sort parameter not included in fields array\n- For field existence: Use has:field_name (NOT field_name IS NOT NULL)\n- For field absence: Use !has:field_name (NOT field_name IS NULL)\n- For time periods: Use timeRange parameter (NOT SQL date functions like yesterday())`;\nconst BASE_COMMON_FIELDS = {\n\tproject: \"Project slug\",\n\ttimestamp: \"When the event occurred\",\n\tenvironment: \"Environment (production, staging, development)\",\n\trelease: \"Release version\",\n\tplatform: \"Platform (javascript, python, etc.)\",\n\t\"user.id\": \"User ID\",\n\t\"user.email\": \"User email\",\n\t\"sdk.name\": \"SDK name\",\n\t\"sdk.version\": \"SDK version\"\n};\nconst NUMERIC_FIELDS = {\n\tspans: new Set([\n\t\t\"span.duration\",\n\t\t\"span.self_time\",\n\t\t\"transaction.duration\",\n\t\t\"http.status_code\",\n\t\t\"gen_ai.usage.input_tokens\",\n\t\t\"gen_ai.usage.output_tokens\",\n\t\t\"gen_ai.request.max_tokens\",\n\t\t\"measurements.lcp\",\n\t\t\"measurements.cls\",\n\t\t\"measurements.inp\",\n\t\t\"measurements.fcp\",\n\t\t\"measurements.ttfb\"\n\t]),\n\terrors: new Set([\"stack.lineno\"]),\n\tlogs: new Set([\"severity_number\", \"sentry.observed_timestamp_nanos\"])\n};\nconst DATASET_FIELDS = {\n\tspans: {\n\t\t\"span.op\": \"Span operation type (e.g., http.client, db.query, cache.get)\",\n\t\t\"span.description\": \"Detailed description of the span operation\",\n\t\t\"span.duration\": \"Duration of the span in milliseconds\",\n\t\t\"span.status\": \"Span status (ok, cancelled, unknown, etc.)\",\n\t\t\"span.self_time\": \"Time spent in this span excluding child spans\",\n\t\ttransaction: \"Transaction name/route\",\n\t\t\"transaction.duration\": \"Total transaction duration in milliseconds\",\n\t\t\"transaction.op\": \"Transaction operation type\",\n\t\t\"transaction.status\": \"Transaction status\",\n\t\tis_transaction: \"Whether this span is a transaction (true/false)\",\n\t\ttrace: \"Trace ID\",\n\t\t\"trace.span_id\": \"Span ID within the trace\",\n\t\t\"trace.parent_span_id\": \"Parent span ID\",\n\t\t\"http.method\": \"HTTP method (GET, POST, etc.)\",\n\t\t\"http.status_code\": \"HTTP response status code\",\n\t\t\"http.url\": \"Full HTTP URL\",\n\t\t\"db.system\": \"Database system (postgresql, mysql, etc.)\",\n\t\t\"db.operation\": \"Database operation (SELECT, INSERT, etc.)\",\n\t\t\"gen_ai.system\": \"AI system (e.g., anthropic, openai)\",\n\t\t\"gen_ai.request.model\": \"Model name (e.g., claude-3-5-sonnet-20241022)\",\n\t\t\"gen_ai.operation.name\": \"Operation type (e.g., chat, completion)\",\n\t\t\"gen_ai.usage.input_tokens\": \"Number of input tokens (numeric)\",\n\t\t\"gen_ai.usage.output_tokens\": \"Number of output tokens (numeric)\",\n\t\t\"mcp.tool.name\": \"Tool name (e.g., search_issues, search_events)\",\n\t\t\"mcp.session.id\": \"MCP session identifier\",\n\t\t\"measurements.lcp\": \"Largest Contentful Paint - time until largest content element is visible (ms). Good < 2500ms\",\n\t\t\"measurements.cls\": \"Cumulative Layout Shift - visual stability score (unitless). Good < 0.1\",\n\t\t\"measurements.inp\": \"Interaction to Next Paint - responsiveness to user input (ms). Good < 200ms\",\n\t\t\"measurements.fcp\": \"First Contentful Paint - time until first content is visible (ms). Good < 1800ms\",\n\t\t\"measurements.ttfb\": \"Time to First Byte - server response time (ms). Good < 800ms\",\n\t\t\"count()\": \"Count of spans\",\n\t\t\"count_unique(field)\": \"Count of unique values, e.g. count_unique(user.id)\",\n\t\t\"avg(field)\": \"Average of numeric field, e.g. avg(span.duration)\",\n\t\t\"sum(field)\": \"Sum of numeric field, e.g. sum(span.self_time)\",\n\t\t\"min(field)\": \"Minimum of numeric field, e.g. min(span.duration)\",\n\t\t\"max(field)\": \"Maximum of numeric field, e.g. max(span.duration)\",\n\t\t\"p50(field)\": \"50th percentile (median), e.g. p50(span.duration)\",\n\t\t\"p75(field)\": \"75th percentile - standard for performance analysis, e.g. p75(span.duration)\",\n\t\t\"p90(field)\": \"90th percentile, e.g. p90(span.duration)\",\n\t\t\"p95(field)\": \"95th percentile, e.g. p95(span.duration)\",\n\t\t\"p99(field)\": \"99th percentile, e.g. p99(span.duration)\",\n\t\t\"p100(field)\": \"100th percentile (max), e.g. p100(span.duration)\",\n\t\t\"epm()\": \"Events per minute rate\",\n\t\t\"failure_rate()\": \"Percentage of failed spans\"\n\t},\n\terrors: {\n\t\tmessage: \"Error message\",\n\t\tlevel: \"Error level (error, warning, info, debug)\",\n\t\t\"error.type\": \"Error type/exception class\",\n\t\t\"error.value\": \"Error value/description\",\n\t\t\"error.handled\": \"Whether the error was handled (true/false)\",\n\t\tculprit: \"Code location that caused the error\",\n\t\ttitle: \"Error title/grouping\",\n\t\t\"stack.filename\": \"File where error occurred\",\n\t\t\"stack.function\": \"Function where error occurred\",\n\t\t\"stack.module\": \"Module where error occurred\",\n\t\t\"stack.abs_path\": \"Absolute path to file\",\n\t\t\"os.name\": \"Operating system name\",\n\t\t\"browser.name\": \"Browser name\",\n\t\t\"device.family\": \"Device family\",\n\t\t\"count()\": \"Count of error events\",\n\t\t\"count_unique(field)\": \"Count of unique values, e.g. count_unique(user.id)\",\n\t\t\"count_if(field,equals,value)\": \"Conditional count, e.g. count_if(error.handled,equals,false)\",\n\t\t\"last_seen()\": \"Most recent timestamp of the group\",\n\t\t\"eps()\": \"Events per second rate\",\n\t\t\"epm()\": \"Events per minute rate\"\n\t},\n\tlogs: {\n\t\tmessage: \"Log message\",\n\t\tseverity: \"Log severity level\",\n\t\tseverity_number: \"Numeric severity level\",\n\t\t\"sentry.item_id\": \"Sentry item ID\",\n\t\t\"sentry.observed_timestamp_nanos\": \"Observed timestamp in nanoseconds\",\n\t\ttrace: \"Trace ID\",\n\t\t\"count()\": \"Count of log entries\",\n\t\t\"count_unique(field)\": \"Count of unique values, e.g. count_unique(user.id)\",\n\t\t\"avg(field)\": \"Average of numeric field, e.g. avg(severity_number)\",\n\t\t\"sum(field)\": \"Sum of numeric field\",\n\t\t\"min(field)\": \"Minimum of numeric field\",\n\t\t\"max(field)\": \"Maximum of numeric field\",\n\t\t\"p50(field)\": \"50th percentile (median)\",\n\t\t\"p75(field)\": \"75th percentile\",\n\t\t\"p90(field)\": \"90th percentile\",\n\t\t\"p95(field)\": \"95th percentile\",\n\t\t\"p99(field)\": \"99th percentile\",\n\t\t\"p100(field)\": \"100th percentile (max)\",\n\t\t\"epm()\": \"Events per minute rate\"\n\t}\n};\nconst DATASET_EXAMPLES = {\n\tspans: [\n\t\t{\n\t\t\tdescription: \"web vitals performance problems\",\n\t\t\toutput: {\n\t\t\t\tquery: \"has:measurements.lcp\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"transaction\",\n\t\t\t\t\t\"p75(measurements.lcp)\",\n\t\t\t\t\t\"p75(measurements.cls)\",\n\t\t\t\t\t\"p75(measurements.inp)\",\n\t\t\t\t\t\"count()\"\n\t\t\t\t],\n\t\t\t\tsort: \"-p75(measurements.lcp)\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"slowest database queries\",\n\t\t\toutput: {\n\t\t\t\tquery: \"has:db.statement\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"db.system\",\n\t\t\t\t\t\"db.statement\",\n\t\t\t\t\t\"count()\",\n\t\t\t\t\t\"p75(span.duration)\",\n\t\t\t\t\t\"p95(span.duration)\"\n\t\t\t\t],\n\t\t\t\tsort: \"-p75(span.duration)\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"total request duration by endpoint (transaction boundaries)\",\n\t\t\toutput: {\n\t\t\t\tquery: \"is_transaction:true\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"transaction\",\n\t\t\t\t\t\"count()\",\n\t\t\t\t\t\"avg(span.duration)\",\n\t\t\t\t\t\"p95(span.duration)\"\n\t\t\t\t],\n\t\t\t\tsort: \"-avg(span.duration)\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"slow API calls over 5 seconds\",\n\t\t\toutput: {\n\t\t\t\tquery: \"has:request.url AND span.duration:>5000\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"span.op\",\n\t\t\t\t\t\"span.description\",\n\t\t\t\t\t\"span.duration\",\n\t\t\t\t\t\"transaction\",\n\t\t\t\t\t\"timestamp\",\n\t\t\t\t\t\"trace\"\n\t\t\t\t],\n\t\t\t\tsort: \"-span.duration\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"token usage by AI model\",\n\t\t\toutput: {\n\t\t\t\tquery: \"has:gen_ai.usage.input_tokens\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"gen_ai.request.model\",\n\t\t\t\t\t\"sum(gen_ai.usage.input_tokens)\",\n\t\t\t\t\t\"sum(gen_ai.usage.output_tokens)\",\n\t\t\t\t\t\"count()\"\n\t\t\t\t],\n\t\t\t\tsort: \"-sum(gen_ai.usage.input_tokens)\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"top MCP tool calls by usage\",\n\t\t\toutput: {\n\t\t\t\tquery: \"has:mcp.tool.name\",\n\t\t\t\tfields: [\"mcp.tool.name\", \"count()\"],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"HTTP requests by user agent\",\n\t\t\toutput: {\n\t\t\t\tquery: \"has:http.method AND has:user_agent.original\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"user_agent.original\",\n\t\t\t\t\t\"count()\",\n\t\t\t\t\t\"avg(span.duration)\"\n\t\t\t\t],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"frontend performance overview\",\n\t\t\toutput: {\n\t\t\t\tquery: \"has:measurements.lcp\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"transaction\",\n\t\t\t\t\t\"p75(span.duration)\",\n\t\t\t\t\t\"p75(measurements.lcp)\",\n\t\t\t\t\t\"p75(measurements.fcp)\",\n\t\t\t\t\t\"p75(measurements.ttfb)\",\n\t\t\t\t\t\"count()\"\n\t\t\t\t],\n\t\t\t\tsort: \"-p75(span.duration)\"\n\t\t\t}\n\t\t}\n\t],\n\terrors: [\n\t\t{\n\t\t\tdescription: \"unhandled errors in production\",\n\t\t\toutput: {\n\t\t\t\tquery: \"error.handled:false AND environment:production\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"issue\",\n\t\t\t\t\t\"title\",\n\t\t\t\t\t\"timestamp\",\n\t\t\t\t\t\"message\",\n\t\t\t\t\t\"error.type\",\n\t\t\t\t\t\"culprit\"\n\t\t\t\t],\n\t\t\t\tsort: \"-timestamp\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"count errors by type\",\n\t\t\toutput: {\n\t\t\t\tquery: \"level:error\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"error.type\",\n\t\t\t\t\t\"count()\",\n\t\t\t\t\t\"last_seen()\"\n\t\t\t\t],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"errors in specific file\",\n\t\t\toutput: {\n\t\t\t\tquery: \"stack.filename:\\\"**/Button.tsx\\\"\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"issue\",\n\t\t\t\t\t\"title\",\n\t\t\t\t\t\"timestamp\",\n\t\t\t\t\t\"message\",\n\t\t\t\t\t\"stack.filename\"\n\t\t\t\t],\n\t\t\t\tsort: \"-timestamp\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"most common errors\",\n\t\t\toutput: {\n\t\t\t\tquery: \"\",\n\t\t\t\tfields: [\"title\", \"count()\"],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"unique users affected by errors\",\n\t\t\toutput: {\n\t\t\t\tquery: \"level:error\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"error.type\",\n\t\t\t\t\t\"count()\",\n\t\t\t\t\t\"count_unique(user.id)\"\n\t\t\t\t],\n\t\t\t\tsort: \"-count_unique(user.id)\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"errors by browser/user agent\",\n\t\t\toutput: {\n\t\t\t\tquery: \"level:error AND has:user_agent.original\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"user_agent.original\",\n\t\t\t\t\t\"count()\",\n\t\t\t\t\t\"count_unique(user.id)\"\n\t\t\t\t],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t}\n\t],\n\tlogs: [\n\t\t{\n\t\t\tdescription: \"error logs about database\",\n\t\t\toutput: {\n\t\t\t\tquery: \"severity:error AND message:\\\"*database*\\\"\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"timestamp\",\n\t\t\t\t\t\"message\",\n\t\t\t\t\t\"severity\",\n\t\t\t\t\t\"trace\"\n\t\t\t\t],\n\t\t\t\tsort: \"-timestamp\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"count logs by severity\",\n\t\t\toutput: {\n\t\t\t\tquery: \"\",\n\t\t\t\tfields: [\"severity\", \"count()\"],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"most common log messages\",\n\t\t\toutput: {\n\t\t\t\tquery: \"\",\n\t\t\t\tfields: [\"message\", \"count()\"],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"log volume by project\",\n\t\t\toutput: {\n\t\t\t\tquery: \"\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"project\",\n\t\t\t\t\t\"count()\",\n\t\t\t\t\t\"epm()\"\n\t\t\t\t],\n\t\t\t\tsort: \"-count()\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tdescription: \"warning logs about memory\",\n\t\t\toutput: {\n\t\t\t\tquery: \"severity:warning AND message:\\\"*memory*\\\"\",\n\t\t\t\tfields: [\n\t\t\t\t\t\"timestamp\",\n\t\t\t\t\t\"message\",\n\t\t\t\t\t\"severity\",\n\t\t\t\t\t\"trace\"\n\t\t\t\t],\n\t\t\t\tsort: \"-timestamp\"\n\t\t\t}\n\t\t}\n\t]\n};\nconst RECOMMENDED_FIELDS = {\n\terrors: {\n\t\tbasic: [\n\t\t\t\"issue\",\n\t\t\t\"title\",\n\t\t\t\"project\",\n\t\t\t\"timestamp\",\n\t\t\t\"level\",\n\t\t\t\"message\",\n\t\t\t\"error.type\",\n\t\t\t\"culprit\"\n\t\t],\n\t\tdescription: \"Basic error information including issue ID, title, timestamp, severity, and location\"\n\t},\n\tlogs: {\n\t\tbasic: [\n\t\t\t\"timestamp\",\n\t\t\t\"project\",\n\t\t\t\"message\",\n\t\t\t\"severity\",\n\t\t\t\"trace\"\n\t\t],\n\t\tdescription: \"Essential log entry information\"\n\t},\n\tspans: {\n\t\tbasic: [\n\t\t\t\"id\",\n\t\t\t\"span.op\",\n\t\t\t\"span.description\",\n\t\t\t\"span.duration\",\n\t\t\t\"transaction\",\n\t\t\t\"timestamp\",\n\t\t\t\"project\",\n\t\t\t\"trace\"\n\t\t],\n\t\tdescription: \"Core span/trace information including span ID, operation, duration, and trace context\"\n\t}\n};\n\n//#endregion\nexport { BASE_COMMON_FIELDS, DATASET_EXAMPLES, DATASET_FIELDS, NUMERIC_FIELDS, RECOMMENDED_FIELDS, systemPrompt };\n//# sourceMappingURL=config-CEjP2CYO.js.map"],"mappings":";;AACA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyMtB,MAAM,qBAAqB;CAC1B,SAAS;CACT,WAAW;CACX,aAAa;CACb,SAAS;CACT,UAAU;CACV,WAAW;CACX,cAAc;CACd,YAAY;CACZ,eAAe;AACf;AACD,MAAM,iBAAiB;CACtB,OAAO,IAAI,IAAI;EACd;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACA;CACD,QAAQ,IAAI,IAAI,CAAC,cAAe;CAChC,MAAM,IAAI,IAAI,CAAC,mBAAmB,iCAAkC;AACpE;AACD,MAAM,iBAAiB;CACtB,OAAO;EACN,WAAW;EACX,oBAAoB;EACpB,iBAAiB;EACjB,eAAe;EACf,kBAAkB;EAClB,aAAa;EACb,wBAAwB;EACxB,kBAAkB;EAClB,sBAAsB;EACtB,gBAAgB;EAChB,OAAO;EACP,iBAAiB;EACjB,wBAAwB;EACxB,eAAe;EACf,oBAAoB;EACpB,YAAY;EACZ,aAAa;EACb,gBAAgB;EAChB,iBAAiB;EACjB,wBAAwB;EACxB,yBAAyB;EACzB,6BAA6B;EAC7B,8BAA8B;EAC9B,iBAAiB;EACjB,kBAAkB;EAClB,oBAAoB;EACpB,oBAAoB;EACpB,oBAAoB;EACpB,oBAAoB;EACpB,qBAAqB;EACrB,WAAW;EACX,uBAAuB;EACvB,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,eAAe;EACf,SAAS;EACT,kBAAkB;CAClB;CACD,QAAQ;EACP,SAAS;EACT,OAAO;EACP,cAAc;EACd,eAAe;EACf,iBAAiB;EACjB,SAAS;EACT,OAAO;EACP,kBAAkB;EAClB,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,WAAW;EACX,gBAAgB;EAChB,iBAAiB;EACjB,WAAW;EACX,uBAAuB;EACvB,gCAAgC;EAChC,eAAe;EACf,SAAS;EACT,SAAS;CACT;CACD,MAAM;EACL,SAAS;EACT,UAAU;EACV,iBAAiB;EACjB,kBAAkB;EAClB,mCAAmC;EACnC,OAAO;EACP,WAAW;EACX,uBAAuB;EACvB,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,cAAc;EACd,eAAe;EACf,SAAS;CACT;AACD;AACD,MAAM,mBAAmB;CACxB,OAAO;EACN;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ,CAAC,iBAAiB,SAAU;IACpC,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;CACD;CACD,QAAQ;EACP;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ,CAAC,SAAS,SAAU;IAC5B,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;CACD;CACD,MAAM;EACL;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ,CAAC,YAAY,SAAU;IAC/B,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ,CAAC,WAAW,SAAU;IAC9B,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;EACD;GACC,aAAa;GACb,QAAQ;IACP,OAAO;IACP,QAAQ;KACP;KACA;KACA;KACA;IACA;IACD,MAAM;GACN;EACD;CACD;AACD;AACD,MAAM,qBAAqB;CAC1B,QAAQ;EACP,OAAO;GACN;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACA;EACD,aAAa;CACb;CACD,MAAM;EACL,OAAO;GACN;GACA;GACA;GACA;GACA;EACA;EACD,aAAa;CACb;CACD,OAAO;EACN,OAAO;GACN;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACA;EACD,aAAa;CACb;AACD"}