@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
@@ -16,6 +16,7 @@ function parseArgv(argv) {
16
16
  "organization-slug": { type: "string" },
17
17
  "project-slug": { type: "string" },
18
18
  skills: { type: "string" },
19
+ "disable-skills": { type: "string" },
19
20
  agent: { type: "boolean" },
20
21
  experimental: { type: "boolean" },
21
22
  help: {
@@ -55,6 +56,7 @@ function parseArgv(argv) {
55
56
  organizationSlug: values["organization-slug"],
56
57
  projectSlug: values["project-slug"],
57
58
  skills: values.skills,
59
+ disableSkills: values["disable-skills"],
58
60
  agent: values.agent === true,
59
61
  experimental: values.experimental === true,
60
62
  help: values.help === true,
@@ -72,7 +74,9 @@ function parseEnv(env) {
72
74
  if (env.OPENAI_MODEL) fromEnv.openaiModel = env.OPENAI_MODEL;
73
75
  if (env.ANTHROPIC_MODEL) fromEnv.anthropicModel = env.ANTHROPIC_MODEL;
74
76
  if (env.EMBEDDED_AGENT_PROVIDER) fromEnv.agentProvider = env.EMBEDDED_AGENT_PROVIDER;
77
+ if (env.SENTRY_CLIENT_ID) fromEnv.clientId = env.SENTRY_CLIENT_ID;
75
78
  if (env.MCP_SKILLS) fromEnv.skills = env.MCP_SKILLS;
79
+ if (env.MCP_DISABLE_SKILLS) fromEnv.disableSkills = env.MCP_DISABLE_SKILLS;
76
80
  return fromEnv;
77
81
  }
78
82
  function merge(cli, env) {
@@ -87,7 +91,9 @@ function merge(cli, env) {
87
91
  anthropicBaseUrl: cli.anthropicBaseUrl,
88
92
  anthropicModel: cli.anthropicModel ?? env.anthropicModel,
89
93
  agentProvider: cli.agentProvider ?? env.agentProvider,
94
+ clientId: env.clientId,
90
95
  skills: cli.skills ?? env.skills,
96
+ disableSkills: cli.disableSkills ?? env.disableSkills,
91
97
  agent: cli.agent === true,
92
98
  experimental: cli.experimental === true,
93
99
  organizationSlug: cli.organizationSlug,
@@ -100,4 +106,4 @@ function merge(cli, env) {
100
106
 
101
107
  //#endregion
102
108
  export { merge, parseArgv, parseEnv };
103
- //# sourceMappingURL=parse-CEJNfXug.js.map
109
+ //# sourceMappingURL=parse-BC0czE2L.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-BC0czE2L.js","names":["argv: string[]","unknownArgs: string[]","env: NodeJS.ProcessEnv","fromEnv: EnvArgs","cli: CliArgs","env: EnvArgs"],"sources":["../src/cli/parse.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport type { CliArgs, EnvArgs, MergedArgs } from \"./types\";\n\nexport function parseArgv(argv: string[]): CliArgs {\n const options = {\n \"access-token\": { type: \"string\" as const },\n host: { type: \"string\" as const },\n url: { type: \"string\" as const },\n \"mcp-url\": { type: \"string\" as const },\n \"sentry-dsn\": { type: \"string\" as const },\n \"openai-base-url\": { type: \"string\" as const },\n \"openai-model\": { type: \"string\" as const },\n \"anthropic-base-url\": { type: \"string\" as const },\n \"anthropic-model\": { type: \"string\" as const },\n \"agent-provider\": { type: \"string\" as const },\n \"organization-slug\": { type: \"string\" as const },\n \"project-slug\": { type: \"string\" as const },\n skills: { type: \"string\" as const },\n \"disable-skills\": { type: \"string\" as const },\n agent: { type: \"boolean\" as const },\n experimental: { type: \"boolean\" as const },\n help: { type: \"boolean\" as const, short: \"h\" as const },\n version: { type: \"boolean\" as const, short: \"v\" as const },\n };\n\n const { values, positionals, tokens } = parseArgs({\n args: argv,\n options,\n allowPositionals: false,\n strict: false,\n tokens: true,\n });\n\n const knownLong = new Set(Object.keys(options));\n const knownShort = new Set([\n ...(Object.values(options)\n .map((o) => (\"short\" in o ? (o.short as string | undefined) : undefined))\n .filter(Boolean) as string[]),\n ]);\n\n const unknownArgs: string[] = [];\n for (const t of (tokens as any[]) || []) {\n if (t.kind === \"option\") {\n const name = t.name as string | undefined;\n if (name && !(knownLong.has(name) || knownShort.has(name))) {\n unknownArgs.push((t.raw as string) ?? `--${name}`);\n }\n } else if (t.kind === \"positional\") {\n unknownArgs.push((t.raw as string) ?? String(t.value ?? \"\"));\n }\n }\n\n return {\n accessToken: values[\"access-token\"] as string | undefined,\n host: values.host as string | undefined,\n url: values.url as string | undefined,\n mcpUrl: values[\"mcp-url\"] as string | undefined,\n sentryDsn: values[\"sentry-dsn\"] as string | undefined,\n openaiBaseUrl: values[\"openai-base-url\"] as string | undefined,\n openaiModel: values[\"openai-model\"] as string | undefined,\n anthropicBaseUrl: values[\"anthropic-base-url\"] as string | undefined,\n anthropicModel: values[\"anthropic-model\"] as string | undefined,\n agentProvider: values[\"agent-provider\"] as string | undefined,\n organizationSlug: values[\"organization-slug\"] as string | undefined,\n projectSlug: values[\"project-slug\"] as string | undefined,\n skills: values.skills as string | undefined,\n disableSkills: values[\"disable-skills\"] as string | undefined,\n agent: values.agent === true,\n experimental: values.experimental === true,\n help: (values.help as boolean | undefined) === true,\n version: (values.version as boolean | undefined) === true,\n unknownArgs:\n unknownArgs.length > 0 ? unknownArgs : (positionals as string[]) || [],\n };\n}\n\nexport function parseEnv(env: NodeJS.ProcessEnv): EnvArgs {\n const fromEnv: EnvArgs = {};\n if (env.SENTRY_ACCESS_TOKEN) fromEnv.accessToken = env.SENTRY_ACCESS_TOKEN;\n if (env.SENTRY_URL) fromEnv.url = env.SENTRY_URL;\n if (env.SENTRY_HOST) fromEnv.host = env.SENTRY_HOST;\n if (env.MCP_URL) fromEnv.mcpUrl = env.MCP_URL;\n if (env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN)\n fromEnv.sentryDsn = env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN;\n\n if (env.OPENAI_MODEL) fromEnv.openaiModel = env.OPENAI_MODEL;\n if (env.ANTHROPIC_MODEL) fromEnv.anthropicModel = env.ANTHROPIC_MODEL;\n if (env.EMBEDDED_AGENT_PROVIDER)\n fromEnv.agentProvider = env.EMBEDDED_AGENT_PROVIDER;\n if (env.SENTRY_CLIENT_ID) fromEnv.clientId = env.SENTRY_CLIENT_ID;\n if (env.MCP_SKILLS) fromEnv.skills = env.MCP_SKILLS;\n if (env.MCP_DISABLE_SKILLS) fromEnv.disableSkills = env.MCP_DISABLE_SKILLS;\n return fromEnv;\n}\n\nexport function merge(cli: CliArgs, env: EnvArgs): MergedArgs {\n // CLI wins over env\n return {\n accessToken: cli.accessToken ?? env.accessToken,\n // If CLI provided url/host, prefer those; else fall back to env\n url: cli.url ?? env.url,\n host: cli.host ?? env.host,\n mcpUrl: cli.mcpUrl ?? env.mcpUrl,\n sentryDsn: cli.sentryDsn ?? env.sentryDsn,\n openaiBaseUrl: cli.openaiBaseUrl,\n openaiModel: cli.openaiModel ?? env.openaiModel,\n anthropicBaseUrl: cli.anthropicBaseUrl,\n anthropicModel: cli.anthropicModel ?? env.anthropicModel,\n agentProvider: cli.agentProvider ?? env.agentProvider,\n clientId: env.clientId,\n // Skills precedence: CLI skills override env\n skills: cli.skills ?? env.skills,\n disableSkills: cli.disableSkills ?? env.disableSkills,\n agent: cli.agent === true,\n experimental: cli.experimental === true,\n organizationSlug: cli.organizationSlug,\n projectSlug: cli.projectSlug,\n help: cli.help === true,\n version: cli.version === true,\n unknownArgs: cli.unknownArgs,\n };\n}\n"],"mappings":";;;AAGA,SAAgB,UAAUA,MAAyB;CACjD,MAAM,UAAU;EACd,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,MAAM,EAAE,MAAM,SAAmB;EACjC,KAAK,EAAE,MAAM,SAAmB;EAChC,WAAW,EAAE,MAAM,SAAmB;EACtC,cAAc,EAAE,MAAM,SAAmB;EACzC,mBAAmB,EAAE,MAAM,SAAmB;EAC9C,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,sBAAsB,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AAc,IAAI,iBAAiB;EACnC,kBAAkB,IAAI;EACtB,aAAa,IAAI;EACjB,MAAM,IAAI,SAAS;EACnB,SAAS,IAAI,YAAY;EACzB,aAAa,IAAI;CAClB;AACF"}
@@ -1,4 +1,4 @@
1
- const require_chunk = require('./chunk-DoeelZqw.cjs');
1
+ const require_chunk = require('./chunk-Cv9WC9bY.cjs');
2
2
  const node_util = require_chunk.__toESM(require("node:util"));
3
3
 
4
4
  //#region src/cli/parse.ts
@@ -17,6 +17,7 @@ function parseArgv(argv) {
17
17
  "organization-slug": { type: "string" },
18
18
  "project-slug": { type: "string" },
19
19
  skills: { type: "string" },
20
+ "disable-skills": { type: "string" },
20
21
  agent: { type: "boolean" },
21
22
  experimental: { type: "boolean" },
22
23
  help: {
@@ -56,6 +57,7 @@ function parseArgv(argv) {
56
57
  organizationSlug: values["organization-slug"],
57
58
  projectSlug: values["project-slug"],
58
59
  skills: values.skills,
60
+ disableSkills: values["disable-skills"],
59
61
  agent: values.agent === true,
60
62
  experimental: values.experimental === true,
61
63
  help: values.help === true,
@@ -73,7 +75,9 @@ function parseEnv(env) {
73
75
  if (env.OPENAI_MODEL) fromEnv.openaiModel = env.OPENAI_MODEL;
74
76
  if (env.ANTHROPIC_MODEL) fromEnv.anthropicModel = env.ANTHROPIC_MODEL;
75
77
  if (env.EMBEDDED_AGENT_PROVIDER) fromEnv.agentProvider = env.EMBEDDED_AGENT_PROVIDER;
78
+ if (env.SENTRY_CLIENT_ID) fromEnv.clientId = env.SENTRY_CLIENT_ID;
76
79
  if (env.MCP_SKILLS) fromEnv.skills = env.MCP_SKILLS;
80
+ if (env.MCP_DISABLE_SKILLS) fromEnv.disableSkills = env.MCP_DISABLE_SKILLS;
77
81
  return fromEnv;
78
82
  }
79
83
  function merge(cli, env) {
@@ -88,7 +92,9 @@ function merge(cli, env) {
88
92
  anthropicBaseUrl: cli.anthropicBaseUrl,
89
93
  anthropicModel: cli.anthropicModel ?? env.anthropicModel,
90
94
  agentProvider: cli.agentProvider ?? env.agentProvider,
95
+ clientId: env.clientId,
91
96
  skills: cli.skills ?? env.skills,
97
+ disableSkills: cli.disableSkills ?? env.disableSkills,
92
98
  agent: cli.agent === true,
93
99
  experimental: cli.experimental === true,
94
100
  organizationSlug: cli.organizationSlug,
@@ -118,4 +124,4 @@ Object.defineProperty(exports, 'parseEnv', {
118
124
  return parseEnv;
119
125
  }
120
126
  });
121
- //# sourceMappingURL=parse-DFk2004x.cjs.map
127
+ //# sourceMappingURL=parse-CBlXTQfk.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-CBlXTQfk.cjs","names":["argv: string[]","unknownArgs: string[]","env: NodeJS.ProcessEnv","fromEnv: EnvArgs","cli: CliArgs","env: EnvArgs"],"sources":["../src/cli/parse.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport type { CliArgs, EnvArgs, MergedArgs } from \"./types\";\n\nexport function parseArgv(argv: string[]): CliArgs {\n const options = {\n \"access-token\": { type: \"string\" as const },\n host: { type: \"string\" as const },\n url: { type: \"string\" as const },\n \"mcp-url\": { type: \"string\" as const },\n \"sentry-dsn\": { type: \"string\" as const },\n \"openai-base-url\": { type: \"string\" as const },\n \"openai-model\": { type: \"string\" as const },\n \"anthropic-base-url\": { type: \"string\" as const },\n \"anthropic-model\": { type: \"string\" as const },\n \"agent-provider\": { type: \"string\" as const },\n \"organization-slug\": { type: \"string\" as const },\n \"project-slug\": { type: \"string\" as const },\n skills: { type: \"string\" as const },\n \"disable-skills\": { type: \"string\" as const },\n agent: { type: \"boolean\" as const },\n experimental: { type: \"boolean\" as const },\n help: { type: \"boolean\" as const, short: \"h\" as const },\n version: { type: \"boolean\" as const, short: \"v\" as const },\n };\n\n const { values, positionals, tokens } = parseArgs({\n args: argv,\n options,\n allowPositionals: false,\n strict: false,\n tokens: true,\n });\n\n const knownLong = new Set(Object.keys(options));\n const knownShort = new Set([\n ...(Object.values(options)\n .map((o) => (\"short\" in o ? (o.short as string | undefined) : undefined))\n .filter(Boolean) as string[]),\n ]);\n\n const unknownArgs: string[] = [];\n for (const t of (tokens as any[]) || []) {\n if (t.kind === \"option\") {\n const name = t.name as string | undefined;\n if (name && !(knownLong.has(name) || knownShort.has(name))) {\n unknownArgs.push((t.raw as string) ?? `--${name}`);\n }\n } else if (t.kind === \"positional\") {\n unknownArgs.push((t.raw as string) ?? String(t.value ?? \"\"));\n }\n }\n\n return {\n accessToken: values[\"access-token\"] as string | undefined,\n host: values.host as string | undefined,\n url: values.url as string | undefined,\n mcpUrl: values[\"mcp-url\"] as string | undefined,\n sentryDsn: values[\"sentry-dsn\"] as string | undefined,\n openaiBaseUrl: values[\"openai-base-url\"] as string | undefined,\n openaiModel: values[\"openai-model\"] as string | undefined,\n anthropicBaseUrl: values[\"anthropic-base-url\"] as string | undefined,\n anthropicModel: values[\"anthropic-model\"] as string | undefined,\n agentProvider: values[\"agent-provider\"] as string | undefined,\n organizationSlug: values[\"organization-slug\"] as string | undefined,\n projectSlug: values[\"project-slug\"] as string | undefined,\n skills: values.skills as string | undefined,\n disableSkills: values[\"disable-skills\"] as string | undefined,\n agent: values.agent === true,\n experimental: values.experimental === true,\n help: (values.help as boolean | undefined) === true,\n version: (values.version as boolean | undefined) === true,\n unknownArgs:\n unknownArgs.length > 0 ? unknownArgs : (positionals as string[]) || [],\n };\n}\n\nexport function parseEnv(env: NodeJS.ProcessEnv): EnvArgs {\n const fromEnv: EnvArgs = {};\n if (env.SENTRY_ACCESS_TOKEN) fromEnv.accessToken = env.SENTRY_ACCESS_TOKEN;\n if (env.SENTRY_URL) fromEnv.url = env.SENTRY_URL;\n if (env.SENTRY_HOST) fromEnv.host = env.SENTRY_HOST;\n if (env.MCP_URL) fromEnv.mcpUrl = env.MCP_URL;\n if (env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN)\n fromEnv.sentryDsn = env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN;\n\n if (env.OPENAI_MODEL) fromEnv.openaiModel = env.OPENAI_MODEL;\n if (env.ANTHROPIC_MODEL) fromEnv.anthropicModel = env.ANTHROPIC_MODEL;\n if (env.EMBEDDED_AGENT_PROVIDER)\n fromEnv.agentProvider = env.EMBEDDED_AGENT_PROVIDER;\n if (env.SENTRY_CLIENT_ID) fromEnv.clientId = env.SENTRY_CLIENT_ID;\n if (env.MCP_SKILLS) fromEnv.skills = env.MCP_SKILLS;\n if (env.MCP_DISABLE_SKILLS) fromEnv.disableSkills = env.MCP_DISABLE_SKILLS;\n return fromEnv;\n}\n\nexport function merge(cli: CliArgs, env: EnvArgs): MergedArgs {\n // CLI wins over env\n return {\n accessToken: cli.accessToken ?? env.accessToken,\n // If CLI provided url/host, prefer those; else fall back to env\n url: cli.url ?? env.url,\n host: cli.host ?? env.host,\n mcpUrl: cli.mcpUrl ?? env.mcpUrl,\n sentryDsn: cli.sentryDsn ?? env.sentryDsn,\n openaiBaseUrl: cli.openaiBaseUrl,\n openaiModel: cli.openaiModel ?? env.openaiModel,\n anthropicBaseUrl: cli.anthropicBaseUrl,\n anthropicModel: cli.anthropicModel ?? env.anthropicModel,\n agentProvider: cli.agentProvider ?? env.agentProvider,\n clientId: env.clientId,\n // Skills precedence: CLI skills override env\n skills: cli.skills ?? env.skills,\n disableSkills: cli.disableSkills ?? env.disableSkills,\n agent: cli.agent === true,\n experimental: cli.experimental === true,\n organizationSlug: cli.organizationSlug,\n projectSlug: cli.projectSlug,\n help: cli.help === true,\n version: cli.version === true,\n unknownArgs: cli.unknownArgs,\n };\n}\n"],"mappings":";;;;AAGA,SAAgB,UAAUA,MAAyB;CACjD,MAAM,UAAU;EACd,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,MAAM,EAAE,MAAM,SAAmB;EACjC,KAAK,EAAE,MAAM,SAAmB;EAChC,WAAW,EAAE,MAAM,SAAmB;EACtC,cAAc,EAAE,MAAM,SAAmB;EACzC,mBAAmB,EAAE,MAAM,SAAmB;EAC9C,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,sBAAsB,EAAE,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IAAI,iBAAiB;EACnC,kBAAkB,IAAI;EACtB,aAAa,IAAI;EACjB,MAAM,IAAI,SAAS;EACnB,SAAS,IAAI,YAAY;EACzB,aAAa,IAAI;CAClB;AACF"}
@@ -0,0 +1,168 @@
1
+ const require_constants = require('./constants-DmV1Benp.cjs');
2
+
3
+ //#region ../mcp-core/dist/skills-DN-CVDkO.js
4
+ const SKILLS = {
5
+ inspect: {
6
+ id: "inspect",
7
+ name: "Inspect Issues & Events",
8
+ description: "Search for errors, analyze traces, and explore event details",
9
+ defaultEnabled: true,
10
+ order: 1
11
+ },
12
+ seer: {
13
+ id: "seer",
14
+ name: "Seer",
15
+ description: "Sentry's AI debugger that helps you analyze, root cause, and fix issues",
16
+ defaultEnabled: true,
17
+ order: 2
18
+ },
19
+ docs: {
20
+ id: "docs",
21
+ name: "Documentation",
22
+ description: "Search and read Sentry SDK documentation",
23
+ defaultEnabled: false,
24
+ order: 3
25
+ },
26
+ triage: {
27
+ id: "triage",
28
+ name: "Triage Issues",
29
+ description: "Resolve, assign, and update issues",
30
+ defaultEnabled: false,
31
+ order: 4
32
+ },
33
+ "project-management": {
34
+ id: "project-management",
35
+ name: "Manage Projects & Teams",
36
+ description: "Create and modify projects, teams, and DSNs",
37
+ defaultEnabled: false,
38
+ order: 5
39
+ }
40
+ };
41
+ const SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);
42
+ const ALL_SKILLS = Object.keys(SKILLS);
43
+ const DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);
44
+ function isValidSkill(skill) {
45
+ return skill in SKILLS;
46
+ }
47
+ function isEnabledBySkills(grantedSkills, toolSkills) {
48
+ if (!grantedSkills || toolSkills.length === 0) return false;
49
+ return toolSkills.some((skill) => grantedSkills.has(skill));
50
+ }
51
+ function parseSkills(input) {
52
+ const valid = /* @__PURE__ */ new Set();
53
+ const invalid = [];
54
+ if (!input) return {
55
+ valid,
56
+ invalid
57
+ };
58
+ let skills = [];
59
+ if (typeof input === "string") skills = input.split(",");
60
+ else if (Array.isArray(input)) skills = input.map((v) => typeof v === "string" ? v : "");
61
+ for (const skill of skills) {
62
+ const trimmed = String(skill).trim();
63
+ if (isValidSkill(trimmed)) valid.add(trimmed);
64
+ else if (trimmed) invalid.push(trimmed);
65
+ }
66
+ return {
67
+ valid,
68
+ invalid
69
+ };
70
+ }
71
+
72
+ //#endregion
73
+ //#region src/cli/resolve.ts
74
+ function formatInvalidSkills(invalid, source) {
75
+ const prefix = source ? `${source} provided` : "Invalid skills provided";
76
+ return `Error: ${prefix}: ${invalid.join(", ")}\nAvailable skills: ${ALL_SKILLS.join(", ")}`;
77
+ }
78
+ /**
79
+ * Resolves the Sentry host from url/host inputs with validation.
80
+ * Used by both the server flow (finalize) and auth commands (resolveAuthContext)
81
+ * to ensure cache keys always match.
82
+ */
83
+ function resolveHost(url, host) {
84
+ if (url) return require_constants.validateAndParseSentryUrlThrows(url);
85
+ if (host) {
86
+ require_constants.validateSentryHostThrows(host);
87
+ return host;
88
+ }
89
+ return "sentry.io";
90
+ }
91
+ function finalize(input) {
92
+ const sentryHost = resolveHost(input.url, input.host);
93
+ let finalSkills;
94
+ if (input.skills) {
95
+ const { valid, invalid } = parseSkills(input.skills);
96
+ if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid));
97
+ if (valid.size === 0) throw new Error("Error: Invalid skills provided. No valid skills found.");
98
+ finalSkills = valid;
99
+ } else finalSkills = new Set(ALL_SKILLS);
100
+ if (input.disableSkills) {
101
+ const { valid: skillsToDisable, invalid } = parseSkills(input.disableSkills);
102
+ if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid, "--disable-skills"));
103
+ for (const skill of skillsToDisable) finalSkills.delete(skill);
104
+ if (finalSkills.size === 0) throw new Error("Error: All skills have been disabled. At least one skill must remain enabled.");
105
+ }
106
+ const resolvedOpenAiBaseUrl = input.openaiBaseUrl ? require_constants.validateOpenAiBaseUrlThrows(input.openaiBaseUrl) : void 0;
107
+ const resolvedAnthropicBaseUrl = input.anthropicBaseUrl ? require_constants.validateOpenAiBaseUrlThrows(input.anthropicBaseUrl) : void 0;
108
+ let agentProvider = void 0;
109
+ if (input.agentProvider) {
110
+ const provider = input.agentProvider.toLowerCase();
111
+ if (provider !== "openai" && provider !== "anthropic") throw new Error(`Error: Invalid agent provider "${input.agentProvider}". Must be "openai" or "anthropic".`);
112
+ agentProvider = provider;
113
+ }
114
+ return {
115
+ accessToken: input.accessToken,
116
+ clientId: input.clientId || require_constants.DEFAULT_SENTRY_CLIENT_ID,
117
+ sentryHost,
118
+ mcpUrl: input.mcpUrl,
119
+ sentryDsn: input.sentryDsn,
120
+ openaiBaseUrl: resolvedOpenAiBaseUrl,
121
+ openaiModel: input.openaiModel,
122
+ anthropicBaseUrl: resolvedAnthropicBaseUrl,
123
+ anthropicModel: input.anthropicModel,
124
+ agentProvider,
125
+ finalSkills,
126
+ organizationSlug: input.organizationSlug,
127
+ projectSlug: input.projectSlug
128
+ };
129
+ }
130
+
131
+ //#endregion
132
+ Object.defineProperty(exports, 'ALL_SKILLS', {
133
+ enumerable: true,
134
+ get: function () {
135
+ return ALL_SKILLS;
136
+ }
137
+ });
138
+ Object.defineProperty(exports, 'SKILLS', {
139
+ enumerable: true,
140
+ get: function () {
141
+ return SKILLS;
142
+ }
143
+ });
144
+ Object.defineProperty(exports, 'finalize', {
145
+ enumerable: true,
146
+ get: function () {
147
+ return finalize;
148
+ }
149
+ });
150
+ Object.defineProperty(exports, 'formatInvalidSkills', {
151
+ enumerable: true,
152
+ get: function () {
153
+ return formatInvalidSkills;
154
+ }
155
+ });
156
+ Object.defineProperty(exports, 'isEnabledBySkills', {
157
+ enumerable: true,
158
+ get: function () {
159
+ return isEnabledBySkills;
160
+ }
161
+ });
162
+ Object.defineProperty(exports, 'resolveHost', {
163
+ enumerable: true,
164
+ get: function () {
165
+ return resolveHost;
166
+ }
167
+ });
168
+ //# sourceMappingURL=resolve-BfYJ9Cqy.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-BfYJ9Cqy.cjs","names":["invalid: string[]","source?: string","url?: string","host?: string","input: MergedArgs","finalSkills: Set<Skill>","agentProvider: \"openai\" | \"anthropic\" | undefined","DEFAULT_SENTRY_CLIENT_ID"],"sources":["../../mcp-core/dist/skills-DN-CVDkO.js","../src/cli/resolve.ts"],"sourcesContent":["//#region src/skills.ts\nconst SKILLS = {\n\tinspect: {\n\t\tid: \"inspect\",\n\t\tname: \"Inspect Issues & Events\",\n\t\tdescription: \"Search for errors, analyze traces, and explore event details\",\n\t\tdefaultEnabled: true,\n\t\torder: 1\n\t},\n\tseer: {\n\t\tid: \"seer\",\n\t\tname: \"Seer\",\n\t\tdescription: \"Sentry's AI debugger that helps you analyze, root cause, and fix issues\",\n\t\tdefaultEnabled: true,\n\t\torder: 2\n\t},\n\tdocs: {\n\t\tid: \"docs\",\n\t\tname: \"Documentation\",\n\t\tdescription: \"Search and read Sentry SDK documentation\",\n\t\tdefaultEnabled: false,\n\t\torder: 3\n\t},\n\ttriage: {\n\t\tid: \"triage\",\n\t\tname: \"Triage Issues\",\n\t\tdescription: \"Resolve, assign, and update issues\",\n\t\tdefaultEnabled: false,\n\t\torder: 4\n\t},\n\t\"project-management\": {\n\t\tid: \"project-management\",\n\t\tname: \"Manage Projects & Teams\",\n\t\tdescription: \"Create and modify projects, teams, and DSNs\",\n\t\tdefaultEnabled: false,\n\t\torder: 5\n\t}\n};\nconst SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);\nasync function getSkillsArrayWithCounts() {\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst tools = toolsModule.default;\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const skill of Object.keys(SKILLS)) counts.set(skill, 0);\n\tfor (const tool of Object.values(tools)) {\n\t\tif (tool.internalOnly) continue;\n\t\tif (Array.isArray(tool.skills)) for (const skill of tool.skills) counts.set(skill, (counts.get(skill) || 0) + 1);\n\t}\n\treturn SKILLS_ARRAY.map((skill) => ({\n\t\t...skill,\n\t\ttoolCount: counts.get(skill.id) || 0\n\t}));\n}\nconst ALL_SKILLS = Object.keys(SKILLS);\nconst DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);\nfunction isValidSkill(skill) {\n\treturn skill in SKILLS;\n}\nfunction isEnabledBySkills(grantedSkills, toolSkills) {\n\tif (!grantedSkills || toolSkills.length === 0) return false;\n\treturn toolSkills.some((skill) => grantedSkills.has(skill));\n}\nfunction parseSkills(input) {\n\tconst valid = /* @__PURE__ */ new Set();\n\tconst invalid = [];\n\tif (!input) return {\n\t\tvalid,\n\t\tinvalid\n\t};\n\tlet skills = [];\n\tif (typeof input === \"string\") skills = input.split(\",\");\n\telse if (Array.isArray(input)) skills = input.map((v) => typeof v === \"string\" ? v : \"\");\n\tfor (const skill of skills) {\n\t\tconst trimmed = String(skill).trim();\n\t\tif (isValidSkill(trimmed)) valid.add(trimmed);\n\t\telse if (trimmed) invalid.push(trimmed);\n\t}\n\treturn {\n\t\tvalid,\n\t\tinvalid\n\t};\n}\nasync function getScopesForSkills(grantedSkills) {\n\tconst { DEFAULT_SCOPES } = await import(\"./constants.js\");\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst tools = toolsModule.default;\n\tconst scopes = new Set(DEFAULT_SCOPES);\n\tfor (const tool of Object.values(tools)) {\n\t\tif (tool.internalOnly) continue;\n\t\tconst toolEnabled = tool.skills.some((skill) => grantedSkills.has(skill));\n\t\tif (toolEnabled) for (const scope of tool.requiredScopes) scopes.add(scope);\n\t}\n\treturn scopes;\n}\n\n//#endregion\nexport { ALL_SKILLS, DEFAULT_SKILLS, SKILLS, SKILLS_ARRAY, getScopesForSkills, getSkillsArrayWithCounts, isEnabledBySkills, isValidSkill, parseSkills };\n//# sourceMappingURL=skills-DN-CVDkO.js.map","import { ALL_SKILLS, parseSkills, type Skill } from \"@sentry/mcp-core/skills\";\nimport {\n validateAndParseSentryUrlThrows,\n validateOpenAiBaseUrlThrows,\n validateSentryHostThrows,\n} from \"@sentry/mcp-core/utils/url-utils\";\nimport { DEFAULT_SENTRY_CLIENT_ID } from \"../auth/constants\";\nimport type { MergedArgs, PartiallyResolvedConfig } from \"./types\";\n\nexport function formatInvalidSkills(\n invalid: string[],\n source?: string,\n): string {\n const prefix = source ? `${source} provided` : \"Invalid skills provided\";\n return `Error: ${prefix}: ${invalid.join(\", \")}\\nAvailable skills: ${ALL_SKILLS.join(\", \")}`;\n}\n\n/**\n * Resolves the Sentry host from url/host inputs with validation.\n * Used by both the server flow (finalize) and auth commands (resolveAuthContext)\n * to ensure cache keys always match.\n */\nexport function resolveHost(url?: string, host?: string): string {\n if (url) {\n return validateAndParseSentryUrlThrows(url);\n }\n if (host) {\n validateSentryHostThrows(host);\n return host;\n }\n return \"sentry.io\";\n}\n\nexport function finalize(input: MergedArgs): PartiallyResolvedConfig {\n const sentryHost = resolveHost(input.url, input.host);\n\n // Skills resolution\n //\n // IMPORTANT: stdio (CLI) intentionally defaults to ALL skills when no --skills flag is provided\n //\n // This differs from the OAuth flow, which requires explicit user selection:\n // - stdio/CLI: Non-interactive, defaults to ALL skills (inspect, docs, seer, triage, project-management)\n // - OAuth: Interactive, requires user to explicitly select skills (with sensible defaults pre-checked)\n //\n // Rationale:\n // We don't want the MCP to break if users don't specify skills. stdio is typically used in\n // local development and CI/CD environments where maximum access by default is expected.\n // OAuth is used in multi-tenant hosted environments where users should consciously grant\n // permissions on a per-app basis.\n //\n // For OAuth validation that enforces minimum 1 skill selection, see:\n // packages/mcp-cloudflare/src/server/oauth/routes/callback.ts (lines 234-248)\n //\n let finalSkills: Set<Skill>;\n if (input.skills) {\n // Override: use only the specified skills\n const { valid, invalid } = parseSkills(input.skills);\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid));\n }\n if (valid.size === 0) {\n throw new Error(\"Error: Invalid skills provided. No valid skills found.\");\n }\n finalSkills = valid;\n } else {\n // Default: grant ALL skills when no flag is provided (see comment block above for rationale)\n finalSkills = new Set<Skill>(ALL_SKILLS);\n }\n\n // Disable-skills: remove specific skills from the active set\n if (input.disableSkills) {\n const { valid: skillsToDisable, invalid } = parseSkills(\n input.disableSkills,\n );\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid, \"--disable-skills\"));\n }\n for (const skill of skillsToDisable) {\n finalSkills.delete(skill);\n }\n if (finalSkills.size === 0) {\n throw new Error(\n \"Error: All skills have been disabled. At least one skill must remain enabled.\",\n );\n }\n }\n\n const resolvedOpenAiBaseUrl = input.openaiBaseUrl\n ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl)\n : undefined;\n\n // Validate anthropic base URL if provided (same validation as OpenAI)\n const resolvedAnthropicBaseUrl = input.anthropicBaseUrl\n ? validateOpenAiBaseUrlThrows(input.anthropicBaseUrl)\n : undefined;\n\n // Validate agent provider if explicitly set\n let agentProvider: \"openai\" | \"anthropic\" | undefined = undefined;\n if (input.agentProvider) {\n const provider = input.agentProvider.toLowerCase();\n if (provider !== \"openai\" && provider !== \"anthropic\") {\n throw new Error(\n `Error: Invalid agent provider \"${input.agentProvider}\". Must be \"openai\" or \"anthropic\".`,\n );\n }\n agentProvider = provider;\n }\n\n return {\n accessToken: input.accessToken,\n clientId: input.clientId || DEFAULT_SENTRY_CLIENT_ID,\n sentryHost,\n mcpUrl: input.mcpUrl,\n sentryDsn: input.sentryDsn,\n openaiBaseUrl: resolvedOpenAiBaseUrl,\n openaiModel: input.openaiModel,\n anthropicBaseUrl: resolvedAnthropicBaseUrl,\n anthropicModel: input.anthropicModel,\n agentProvider,\n finalSkills,\n organizationSlug: input.organizationSlug,\n projectSlug: input.projectSlug,\n };\n}\n"],"mappings":";;;AACA,MAAM,SAAS;CACd,SAAS;EACR,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;C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A,kBAAkB,MAAM;EACxB,aAAa,MAAM;CACpB;AACF"}
@@ -0,0 +1,133 @@
1
+ import { DEFAULT_SENTRY_CLIENT_ID, validateAndParseSentryUrlThrows, validateOpenAiBaseUrlThrows, validateSentryHostThrows } from "./constants-Ciwj7kb9.js";
2
+
3
+ //#region ../mcp-core/dist/skills-DN-CVDkO.js
4
+ const SKILLS = {
5
+ inspect: {
6
+ id: "inspect",
7
+ name: "Inspect Issues & Events",
8
+ description: "Search for errors, analyze traces, and explore event details",
9
+ defaultEnabled: true,
10
+ order: 1
11
+ },
12
+ seer: {
13
+ id: "seer",
14
+ name: "Seer",
15
+ description: "Sentry's AI debugger that helps you analyze, root cause, and fix issues",
16
+ defaultEnabled: true,
17
+ order: 2
18
+ },
19
+ docs: {
20
+ id: "docs",
21
+ name: "Documentation",
22
+ description: "Search and read Sentry SDK documentation",
23
+ defaultEnabled: false,
24
+ order: 3
25
+ },
26
+ triage: {
27
+ id: "triage",
28
+ name: "Triage Issues",
29
+ description: "Resolve, assign, and update issues",
30
+ defaultEnabled: false,
31
+ order: 4
32
+ },
33
+ "project-management": {
34
+ id: "project-management",
35
+ name: "Manage Projects & Teams",
36
+ description: "Create and modify projects, teams, and DSNs",
37
+ defaultEnabled: false,
38
+ order: 5
39
+ }
40
+ };
41
+ const SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);
42
+ const ALL_SKILLS = Object.keys(SKILLS);
43
+ const DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);
44
+ function isValidSkill(skill) {
45
+ return skill in SKILLS;
46
+ }
47
+ function isEnabledBySkills(grantedSkills, toolSkills) {
48
+ if (!grantedSkills || toolSkills.length === 0) return false;
49
+ return toolSkills.some((skill) => grantedSkills.has(skill));
50
+ }
51
+ function parseSkills(input) {
52
+ const valid = /* @__PURE__ */ new Set();
53
+ const invalid = [];
54
+ if (!input) return {
55
+ valid,
56
+ invalid
57
+ };
58
+ let skills = [];
59
+ if (typeof input === "string") skills = input.split(",");
60
+ else if (Array.isArray(input)) skills = input.map((v) => typeof v === "string" ? v : "");
61
+ for (const skill of skills) {
62
+ const trimmed = String(skill).trim();
63
+ if (isValidSkill(trimmed)) valid.add(trimmed);
64
+ else if (trimmed) invalid.push(trimmed);
65
+ }
66
+ return {
67
+ valid,
68
+ invalid
69
+ };
70
+ }
71
+
72
+ //#endregion
73
+ //#region src/cli/resolve.ts
74
+ function formatInvalidSkills(invalid, source) {
75
+ const prefix = source ? `${source} provided` : "Invalid skills provided";
76
+ return `Error: ${prefix}: ${invalid.join(", ")}\nAvailable skills: ${ALL_SKILLS.join(", ")}`;
77
+ }
78
+ /**
79
+ * Resolves the Sentry host from url/host inputs with validation.
80
+ * Used by both the server flow (finalize) and auth commands (resolveAuthContext)
81
+ * to ensure cache keys always match.
82
+ */
83
+ function resolveHost(url, host) {
84
+ if (url) return validateAndParseSentryUrlThrows(url);
85
+ if (host) {
86
+ validateSentryHostThrows(host);
87
+ return host;
88
+ }
89
+ return "sentry.io";
90
+ }
91
+ function finalize(input) {
92
+ const sentryHost = resolveHost(input.url, input.host);
93
+ let finalSkills;
94
+ if (input.skills) {
95
+ const { valid, invalid } = parseSkills(input.skills);
96
+ if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid));
97
+ if (valid.size === 0) throw new Error("Error: Invalid skills provided. No valid skills found.");
98
+ finalSkills = valid;
99
+ } else finalSkills = new Set(ALL_SKILLS);
100
+ if (input.disableSkills) {
101
+ const { valid: skillsToDisable, invalid } = parseSkills(input.disableSkills);
102
+ if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid, "--disable-skills"));
103
+ for (const skill of skillsToDisable) finalSkills.delete(skill);
104
+ if (finalSkills.size === 0) throw new Error("Error: All skills have been disabled. At least one skill must remain enabled.");
105
+ }
106
+ const resolvedOpenAiBaseUrl = input.openaiBaseUrl ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl) : void 0;
107
+ const resolvedAnthropicBaseUrl = input.anthropicBaseUrl ? validateOpenAiBaseUrlThrows(input.anthropicBaseUrl) : void 0;
108
+ let agentProvider = void 0;
109
+ if (input.agentProvider) {
110
+ const provider = input.agentProvider.toLowerCase();
111
+ if (provider !== "openai" && provider !== "anthropic") throw new Error(`Error: Invalid agent provider "${input.agentProvider}". Must be "openai" or "anthropic".`);
112
+ agentProvider = provider;
113
+ }
114
+ return {
115
+ accessToken: input.accessToken,
116
+ clientId: input.clientId || DEFAULT_SENTRY_CLIENT_ID,
117
+ sentryHost,
118
+ mcpUrl: input.mcpUrl,
119
+ sentryDsn: input.sentryDsn,
120
+ openaiBaseUrl: resolvedOpenAiBaseUrl,
121
+ openaiModel: input.openaiModel,
122
+ anthropicBaseUrl: resolvedAnthropicBaseUrl,
123
+ anthropicModel: input.anthropicModel,
124
+ agentProvider,
125
+ finalSkills,
126
+ organizationSlug: input.organizationSlug,
127
+ projectSlug: input.projectSlug
128
+ };
129
+ }
130
+
131
+ //#endregion
132
+ export { ALL_SKILLS, SKILLS, finalize, formatInvalidSkills, isEnabledBySkills, resolveHost };
133
+ //# sourceMappingURL=resolve-D0W2gbu8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-D0W2gbu8.js","names":["invalid: string[]","source?: string","url?: string","host?: string","input: MergedArgs","finalSkills: Set<Skill>","agentProvider: \"openai\" | \"anthropic\" | undefined"],"sources":["../../mcp-core/dist/skills-DN-CVDkO.js","../src/cli/resolve.ts"],"sourcesContent":["//#region src/skills.ts\nconst SKILLS = {\n\tinspect: {\n\t\tid: \"inspect\",\n\t\tname: \"Inspect Issues & Events\",\n\t\tdescription: \"Search for errors, analyze traces, and explore event details\",\n\t\tdefaultEnabled: true,\n\t\torder: 1\n\t},\n\tseer: {\n\t\tid: \"seer\",\n\t\tname: \"Seer\",\n\t\tdescription: \"Sentry's AI debugger that helps you analyze, root cause, and fix issues\",\n\t\tdefaultEnabled: true,\n\t\torder: 2\n\t},\n\tdocs: {\n\t\tid: \"docs\",\n\t\tname: \"Documentation\",\n\t\tdescription: \"Search and read Sentry SDK documentation\",\n\t\tdefaultEnabled: false,\n\t\torder: 3\n\t},\n\ttriage: {\n\t\tid: \"triage\",\n\t\tname: \"Triage Issues\",\n\t\tdescription: \"Resolve, assign, and update issues\",\n\t\tdefaultEnabled: false,\n\t\torder: 4\n\t},\n\t\"project-management\": {\n\t\tid: \"project-management\",\n\t\tname: \"Manage Projects & Teams\",\n\t\tdescription: \"Create and modify projects, teams, and DSNs\",\n\t\tdefaultEnabled: false,\n\t\torder: 5\n\t}\n};\nconst SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);\nasync function getSkillsArrayWithCounts() {\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst tools = toolsModule.default;\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const skill of Object.keys(SKILLS)) counts.set(skill, 0);\n\tfor (const tool of Object.values(tools)) {\n\t\tif (tool.internalOnly) continue;\n\t\tif (Array.isArray(tool.skills)) for (const skill of tool.skills) counts.set(skill, (counts.get(skill) || 0) + 1);\n\t}\n\treturn SKILLS_ARRAY.map((skill) => ({\n\t\t...skill,\n\t\ttoolCount: counts.get(skill.id) || 0\n\t}));\n}\nconst ALL_SKILLS = Object.keys(SKILLS);\nconst DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);\nfunction isValidSkill(skill) {\n\treturn skill in SKILLS;\n}\nfunction isEnabledBySkills(grantedSkills, toolSkills) {\n\tif (!grantedSkills || toolSkills.length === 0) return false;\n\treturn toolSkills.some((skill) => grantedSkills.has(skill));\n}\nfunction parseSkills(input) {\n\tconst valid = /* @__PURE__ */ new Set();\n\tconst invalid = [];\n\tif (!input) return {\n\t\tvalid,\n\t\tinvalid\n\t};\n\tlet skills = [];\n\tif (typeof input === \"string\") skills = input.split(\",\");\n\telse if (Array.isArray(input)) skills = input.map((v) => typeof v === \"string\" ? v : \"\");\n\tfor (const skill of skills) {\n\t\tconst trimmed = String(skill).trim();\n\t\tif (isValidSkill(trimmed)) valid.add(trimmed);\n\t\telse if (trimmed) invalid.push(trimmed);\n\t}\n\treturn {\n\t\tvalid,\n\t\tinvalid\n\t};\n}\nasync function getScopesForSkills(grantedSkills) {\n\tconst { DEFAULT_SCOPES } = await import(\"./constants.js\");\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst tools = toolsModule.default;\n\tconst scopes = new Set(DEFAULT_SCOPES);\n\tfor (const tool of Object.values(tools)) {\n\t\tif (tool.internalOnly) continue;\n\t\tconst toolEnabled = tool.skills.some((skill) => grantedSkills.has(skill));\n\t\tif (toolEnabled) for (const scope of tool.requiredScopes) scopes.add(scope);\n\t}\n\treturn scopes;\n}\n\n//#endregion\nexport { ALL_SKILLS, DEFAULT_SKILLS, SKILLS, SKILLS_ARRAY, getScopesForSkills, getSkillsArrayWithCounts, isEnabledBySkills, isValidSkill, parseSkills };\n//# sourceMappingURL=skills-DN-CVDkO.js.map","import { ALL_SKILLS, parseSkills, type Skill } from \"@sentry/mcp-core/skills\";\nimport {\n validateAndParseSentryUrlThrows,\n validateOpenAiBaseUrlThrows,\n validateSentryHostThrows,\n} from \"@sentry/mcp-core/utils/url-utils\";\nimport { DEFAULT_SENTRY_CLIENT_ID } from \"../auth/constants\";\nimport type { MergedArgs, PartiallyResolvedConfig } from \"./types\";\n\nexport function formatInvalidSkills(\n invalid: string[],\n source?: string,\n): string {\n const prefix = source ? `${source} provided` : \"Invalid skills provided\";\n return `Error: ${prefix}: ${invalid.join(\", \")}\\nAvailable skills: ${ALL_SKILLS.join(\", \")}`;\n}\n\n/**\n * Resolves the Sentry host from url/host inputs with validation.\n * Used by both the server flow (finalize) and auth commands (resolveAuthContext)\n * to ensure cache keys always match.\n */\nexport function resolveHost(url?: string, host?: string): string {\n if (url) {\n return validateAndParseSentryUrlThrows(url);\n }\n if (host) {\n validateSentryHostThrows(host);\n return host;\n }\n return \"sentry.io\";\n}\n\nexport function finalize(input: MergedArgs): PartiallyResolvedConfig {\n const sentryHost = resolveHost(input.url, input.host);\n\n // Skills resolution\n //\n // IMPORTANT: stdio (CLI) intentionally defaults to ALL skills when no --skills flag is provided\n //\n // This differs from the OAuth flow, which requires explicit user selection:\n // - stdio/CLI: Non-interactive, defaults to ALL skills (inspect, docs, seer, triage, project-management)\n // - OAuth: Interactive, requires user to explicitly select skills (with sensible defaults pre-checked)\n //\n // Rationale:\n // We don't want the MCP to break if users don't specify skills. stdio is typically used in\n // local development and CI/CD environments where maximum access by default is expected.\n // OAuth is used in multi-tenant hosted environments where users should consciously grant\n // permissions on a per-app basis.\n //\n // For OAuth validation that enforces minimum 1 skill selection, see:\n // packages/mcp-cloudflare/src/server/oauth/routes/callback.ts (lines 234-248)\n //\n let finalSkills: Set<Skill>;\n if (input.skills) {\n // Override: use only the specified skills\n const { valid, invalid } = parseSkills(input.skills);\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid));\n }\n if (valid.size === 0) {\n throw new Error(\"Error: Invalid skills provided. No valid skills found.\");\n }\n finalSkills = valid;\n } else {\n // Default: grant ALL skills when no flag is provided (see comment block above for rationale)\n finalSkills = new Set<Skill>(ALL_SKILLS);\n }\n\n // Disable-skills: remove specific skills from the active set\n if (input.disableSkills) {\n const { valid: skillsToDisable, invalid } = parseSkills(\n input.disableSkills,\n );\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid, \"--disable-skills\"));\n }\n for (const skill of skillsToDisable) {\n finalSkills.delete(skill);\n }\n if (finalSkills.size === 0) {\n throw new Error(\n \"Error: All skills have been disabled. At least one skill must remain enabled.\",\n );\n }\n }\n\n const resolvedOpenAiBaseUrl = input.openaiBaseUrl\n ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl)\n : undefined;\n\n // Validate anthropic base URL if provided (same validation as OpenAI)\n const resolvedAnthropicBaseUrl = input.anthropicBaseUrl\n ? validateOpenAiBaseUrlThrows(input.anthropicBaseUrl)\n : undefined;\n\n // Validate agent provider if explicitly set\n let agentProvider: \"openai\" | \"anthropic\" | undefined = undefined;\n if (input.agentProvider) {\n const provider = input.agentProvider.toLowerCase();\n if (provider !== \"openai\" && provider !== \"anthropic\") {\n throw new Error(\n `Error: Invalid agent provider \"${input.agentProvider}\". Must be \"openai\" or \"anthropic\".`,\n );\n }\n agentProvider = provider;\n }\n\n return {\n accessToken: input.accessToken,\n clientId: input.clientId || DEFAULT_SENTRY_CLIENT_ID,\n sentryHost,\n mcpUrl: input.mcpUrl,\n sentryDsn: input.sentryDsn,\n openaiBaseUrl: resolvedOpenAiBaseUrl,\n openaiModel: input.openaiModel,\n anthropicBaseUrl: resolvedAnthropicBaseUrl,\n anthropicModel: input.anthropicModel,\n agentProvider,\n finalSkills,\n organizationSlug: input.organizationSlug,\n projectSlug: input.projectSlug,\n };\n}\n"],"mappings":";;;AACA,MAAM,SAAS;CACd,SAAS;EACR,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,QAAQ;EACP,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,sBAAsB;EACrB,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;AACD;AACD,MAAM,eAAe,OAAO,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM;AAe5E,MAAM,aAAa,OAAO,KAAK,OAAO;AACtC,MAAM,iBAAiB,aAAa,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG;AACpF,SAAS,aAAa,OAAO;AAC5B,QAAO,SAAS;AAChB;AACD,SAAS,kBAAkB,eAAe,YAAY;AACrD,MAAK,iBAAiB,WA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AAE,OAAO,iBAAiB,SAAS,GAAG,YAC1C,MAAM,cACP;AACD,MAAI,QAAQ,SAAS,EACnB,OAAM,IAAI,MAAM,oBAAoB,SAAS,mBAAmB;AAElE,OAAK,MAAM,SAAS,gBAClB,aAAY,OAAO,MAAM;AAE3B,MAAI,YAAY,SAAS,EACvB,OAAM,IAAI,MACR;CAGL;CAED,MAAM,wBAAwB,MAAM,gBAChC,4BAA4B,MAAM,cAAc;CAIpD,MAAM,2BAA2B,MAAM,mBACnC,4BAA4B,MAAM,iBAAiB;CAIvD,IAAIC;AACJ,KAAI,MAAM,eAAe;EACvB,MAAM,WAAW,MAAM,cAAc,aAAa;AAClD,MAAI,aAAa,YAAY,aAAa,YACxC,OAAM,IAAI,OACP,iCAAiC,MAAM,cAAc;AAG1D,kBAAgB;CACjB;AAED,QAAO;EACL,aAAa,MAAM;EACnB,UAAU,MAAM,YAAY;EAC5B;EACA,QAAQ,MAAM;EACd,WAAW,MAAM;EACjB,eAAe;EACf,aAAa,MAAM;EACnB,kBAAkB;EAClB,gBAAgB,MAAM;EACtB;EACA;EACA,kBAAkB,MAAM;EACxB,aAAa,MAAM;CACpB;AACF"}
@@ -0,0 +1,52 @@
1
+ const require_constants = require('./constants-DmV1Benp.cjs');
2
+ const require_types = require('./types-xUmfecYm.cjs');
3
+ const require_device_code_flow = require('./device-code-flow-CpGZ3Eqv.cjs');
4
+ const require_token_cache = require('./token-cache-iqkTOca3.cjs');
5
+
6
+ //#region src/auth/resolve-token.ts
7
+ function withToken(partial, accessToken) {
8
+ return {
9
+ ...partial,
10
+ accessToken
11
+ };
12
+ }
13
+ /**
14
+ * Resolves the access token for the session.
15
+ *
16
+ * If an access token is already provided, returns immediately.
17
+ * If the host is sentry.io, attempts to use a cached token or
18
+ * initiates the device code flow (only when stderr is a TTY).
19
+ * For non-sentry.io hosts, throws an error requiring --access-token.
20
+ */
21
+ async function resolveAccessToken(partial) {
22
+ if (partial.accessToken) return withToken(partial, partial.accessToken);
23
+ if (!require_constants.isSentryHost(partial.sentryHost)) throw new Error("Error: No access token was provided. Device code authentication is only supported for sentry.io.\nPass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.");
24
+ const { clientId, sentryHost } = partial;
25
+ try {
26
+ const cached = await require_token_cache.readCachedToken(sentryHost, clientId);
27
+ if (cached) {
28
+ process.stderr.write(`Using cached authentication for ${cached.user_email}\n`);
29
+ return withToken(partial, cached.access_token);
30
+ }
31
+ } catch {}
32
+ if (!process.stderr.isTTY) throw new Error("Error: No access token was provided.\nRun `sentry-mcp auth login` interactively first, or pass `--access-token` / `SENTRY_ACCESS_TOKEN`.");
33
+ const tokenResponse = await require_device_code_flow.authenticate({
34
+ clientId,
35
+ host: require_constants.OAUTH_HOST
36
+ });
37
+ try {
38
+ await require_token_cache.writeCachedToken(require_types.toCachedToken(tokenResponse, sentryHost, clientId));
39
+ } catch {
40
+ process.stderr.write("Warning: Could not cache authentication token.\n");
41
+ }
42
+ return withToken(partial, tokenResponse.access_token);
43
+ }
44
+
45
+ //#endregion
46
+ Object.defineProperty(exports, 'resolveAccessToken', {
47
+ enumerable: true,
48
+ get: function () {
49
+ return resolveAccessToken;
50
+ }
51
+ });
52
+ //# sourceMappingURL=resolve-token-C2eTEtoo.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-token-C2eTEtoo.cjs","names":["partial: PartiallyResolvedConfig","accessToken: string","OAUTH_HOST"],"sources":["../src/auth/resolve-token.ts"],"sourcesContent":["import type { PartiallyResolvedConfig, ResolvedConfig } from \"../cli/types\";\nimport { isSentryIo, OAUTH_HOST } from \"./constants\";\nimport { authenticate } from \"./device-code-flow\";\nimport { readCachedToken, writeCachedToken } from \"./token-cache\";\nimport { toCachedToken } from \"./types\";\n\nfunction withToken(\n partial: PartiallyResolvedConfig,\n accessToken: string,\n): ResolvedConfig {\n return { ...partial, accessToken };\n}\n\n/**\n * Resolves the access token for the session.\n *\n * If an access token is already provided, returns immediately.\n * If the host is sentry.io, attempts to use a cached token or\n * initiates the device code flow (only when stderr is a TTY).\n * For non-sentry.io hosts, throws an error requiring --access-token.\n */\nexport async function resolveAccessToken(\n partial: PartiallyResolvedConfig,\n): Promise<ResolvedConfig> {\n if (partial.accessToken) {\n return withToken(partial, partial.accessToken);\n }\n\n if (!isSentryIo(partial.sentryHost)) {\n throw new Error(\n \"Error: No access token was provided. Device code authentication is only supported for sentry.io.\\n\" +\n \"Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.\",\n );\n }\n\n const { clientId, sentryHost } = partial;\n\n // Try cached token first (works in both interactive and non-interactive contexts)\n try {\n const cached = await readCachedToken(sentryHost, clientId);\n if (cached) {\n process.stderr.write(\n `Using cached authentication for ${cached.user_email}\\n`,\n );\n return withToken(partial, cached.access_token);\n }\n } catch {\n // Cache read failure is non-fatal\n }\n\n // Device code flow requires a human to visit a URL and authorize.\n // In non-interactive contexts (CI, piped stdio), fail immediately\n // instead of hanging on the polling loop until expiry.\n if (!process.stderr.isTTY) {\n throw new Error(\n \"Error: No access token was provided.\\n\" +\n \"Run `sentry-mcp auth login` interactively first, or pass `--access-token` / `SENTRY_ACCESS_TOKEN`.\",\n );\n }\n\n const tokenResponse = await authenticate({ clientId, host: OAUTH_HOST });\n\n try {\n await writeCachedToken(toCachedToken(tokenResponse, sentryHost, clientId));\n } catch {\n process.stderr.write(\"Warning: Could not cache authentication token.\\n\");\n }\n\n return withToken(partial, tokenResponse.access_token);\n}\n"],"mappings":";;;;;;AAMA,SAAS,UACPA,SACAC,aACgB;AAChB,QAAO;EAAE,GAAG;EAAS;CAAa;AACnC;;;;;;;;;AAUD,eAAsB,mBACpBD,SACyB;AACzB,KAAI,QAAQ,YACV,QAAO,UAAU,SAAS,QAAQ,YAAY;AAGhD,MAAK,+BAAW,QAAQ,WAAW,CACjC,OAAM,IAAI,MACR;CAKJ,MAAM,EAAE,UAAU,YAAY,GAAG;AAGjC,KAAI;EACF,MAAM,SAAS,MAAM,oCAAgB,YAAY,SAAS;AAC1D,MAAI,QAAQ;AACV,WAAQ,OAAO,OACZ,kCAAkC,OAAO,WAAW,IACtD;AACD,UAAO,UAAU,SAAS,OAAO,aAAa;EAC/C;CACF,QAAO,CAEP;AAKD,MAAK,QAAQ,OAAO,MAClB,OAAM,IAAI,MACR;CAKJ,MAAM,gBAAgB,MAAM,sCAAa;EAAE;EAAU,MAAME;CAAY,EAAC;AAExE,KAAI;AACF,QAAM,qCAAiB,4BAAc,eAAe,YAAY,SAAS,CAAC;CAC3E,QAAO;AACN,UAAQ,OAAO,MAAM,mDAAmD;CACzE;AAED,QAAO,UAAU,SAAS,cAAc,aAAa;AACtD"}
@@ -0,0 +1,47 @@
1
+ import { OAUTH_HOST, isSentryHost } from "./constants-Ciwj7kb9.js";
2
+ import { toCachedToken } from "./types-C8FoyqMN.js";
3
+ import { authenticate } from "./device-code-flow-DmgeS5QN.js";
4
+ import { readCachedToken, writeCachedToken } from "./token-cache-BTEUyVx2.js";
5
+
6
+ //#region src/auth/resolve-token.ts
7
+ function withToken(partial, accessToken) {
8
+ return {
9
+ ...partial,
10
+ accessToken
11
+ };
12
+ }
13
+ /**
14
+ * Resolves the access token for the session.
15
+ *
16
+ * If an access token is already provided, returns immediately.
17
+ * If the host is sentry.io, attempts to use a cached token or
18
+ * initiates the device code flow (only when stderr is a TTY).
19
+ * For non-sentry.io hosts, throws an error requiring --access-token.
20
+ */
21
+ async function resolveAccessToken(partial) {
22
+ if (partial.accessToken) return withToken(partial, partial.accessToken);
23
+ if (!isSentryHost(partial.sentryHost)) throw new Error("Error: No access token was provided. Device code authentication is only supported for sentry.io.\nPass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.");
24
+ const { clientId, sentryHost } = partial;
25
+ try {
26
+ const cached = await readCachedToken(sentryHost, clientId);
27
+ if (cached) {
28
+ process.stderr.write(`Using cached authentication for ${cached.user_email}\n`);
29
+ return withToken(partial, cached.access_token);
30
+ }
31
+ } catch {}
32
+ if (!process.stderr.isTTY) throw new Error("Error: No access token was provided.\nRun `sentry-mcp auth login` interactively first, or pass `--access-token` / `SENTRY_ACCESS_TOKEN`.");
33
+ const tokenResponse = await authenticate({
34
+ clientId,
35
+ host: OAUTH_HOST
36
+ });
37
+ try {
38
+ await writeCachedToken(toCachedToken(tokenResponse, sentryHost, clientId));
39
+ } catch {
40
+ process.stderr.write("Warning: Could not cache authentication token.\n");
41
+ }
42
+ return withToken(partial, tokenResponse.access_token);
43
+ }
44
+
45
+ //#endregion
46
+ export { resolveAccessToken };
47
+ //# sourceMappingURL=resolve-token-pfPBO9EK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-token-pfPBO9EK.js","names":["partial: PartiallyResolvedConfig","accessToken: string"],"sources":["../src/auth/resolve-token.ts"],"sourcesContent":["import type { PartiallyResolvedConfig, ResolvedConfig } from \"../cli/types\";\nimport { isSentryIo, OAUTH_HOST } from \"./constants\";\nimport { authenticate } from \"./device-code-flow\";\nimport { readCachedToken, writeCachedToken } from \"./token-cache\";\nimport { toCachedToken } from \"./types\";\n\nfunction withToken(\n partial: PartiallyResolvedConfig,\n accessToken: string,\n): ResolvedConfig {\n return { ...partial, accessToken };\n}\n\n/**\n * Resolves the access token for the session.\n *\n * If an access token is already provided, returns immediately.\n * If the host is sentry.io, attempts to use a cached token or\n * initiates the device code flow (only when stderr is a TTY).\n * For non-sentry.io hosts, throws an error requiring --access-token.\n */\nexport async function resolveAccessToken(\n partial: PartiallyResolvedConfig,\n): Promise<ResolvedConfig> {\n if (partial.accessToken) {\n return withToken(partial, partial.accessToken);\n }\n\n if (!isSentryIo(partial.sentryHost)) {\n throw new Error(\n \"Error: No access token was provided. Device code authentication is only supported for sentry.io.\\n\" +\n \"Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.\",\n );\n }\n\n const { clientId, sentryHost } = partial;\n\n // Try cached token first (works in both interactive and non-interactive contexts)\n try {\n const cached = await readCachedToken(sentryHost, clientId);\n if (cached) {\n process.stderr.write(\n `Using cached authentication for ${cached.user_email}\\n`,\n );\n return withToken(partial, cached.access_token);\n }\n } catch {\n // Cache read failure is non-fatal\n }\n\n // Device code flow requires a human to visit a URL and authorize.\n // In non-interactive contexts (CI, piped stdio), fail immediately\n // instead of hanging on the polling loop until expiry.\n if (!process.stderr.isTTY) {\n throw new Error(\n \"Error: No access token was provided.\\n\" +\n \"Run `sentry-mcp auth login` interactively first, or pass `--access-token` / `SENTRY_ACCESS_TOKEN`.\",\n );\n }\n\n const tokenResponse = await authenticate({ clientId, host: OAUTH_HOST });\n\n try {\n await writeCachedToken(toCachedToken(tokenResponse, sentryHost, clientId));\n } catch {\n process.stderr.write(\"Warning: Could not cache authentication token.\\n\");\n }\n\n return withToken(partial, tokenResponse.access_token);\n}\n"],"mappings":";;;;;;AAMA,SAAS,UACPA,SACAC,aACgB;AAChB,QAAO;EAAE,GAAG;EAAS;CAAa;AACnC;;;;;;;;;AAUD,eAAsB,mBACpBD,SACyB;AACzB,KAAI,QAAQ,YACV,QAAO,UAAU,SAAS,QAAQ,YAAY;AAGhD,MAAK,aAAW,QAAQ,WAAW,CACjC,OAAM,IAAI,MACR;CAKJ,MAAM,EAAE,UAAU,YAAY,GAAG;AAGjC,KAAI;EACF,MAAM,SAAS,MAAM,gBAAgB,YAAY,SAAS;AAC1D,MAAI,QAAQ;AACV,WAAQ,OAAO,OACZ,kCAAkC,OAAO,WAAW,IACtD;AACD,UAAO,UAAU,SAAS,OAAO,aAAa;EAC/C;CACF,QAAO,CAEP;AAKD,MAAK,QAAQ,OAAO,MAClB,OAAM,IAAI,MACR;CAKJ,MAAM,gBAAgB,MAAM,aAAa;EAAE;EAAU,MAAM;CAAY,EAAC;AAExE,KAAI;AACF,QAAM,iBAAiB,cAAc,eAAe,YAAY,SAAS,CAAC;CAC3E,QAAO;AACN,UAAQ,OAAO,MAAM,mDAAmD;CACzE;AAED,QAAO,UAAU,SAAS,cAAc,aAAa;AACtD"}
@@ -1,12 +1,8 @@
1
- const require_chunk = require('./chunk-DoeelZqw.cjs');
1
+ const require_chunk = require('./chunk-Cv9WC9bY.cjs');
2
+ const require_version = require('./version-Ca7qUBih.cjs');
2
3
  const __modelcontextprotocol_sdk_server_stdio_js = require_chunk.__toESM(require("@modelcontextprotocol/sdk/server/stdio.js"));
3
4
  const __sentry_node = require_chunk.__toESM(require("@sentry/node"));
4
5
 
5
- //#region ../mcp-core/dist/version-B3cY5DeW.js
6
- const LIB_VERSION = typeof process !== "undefined" && "0.29.0" || "0.0.0";
7
- const USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;
8
-
9
- //#endregion
10
6
  //#region src/transports/stdio.ts
11
7
  /**
12
8
  * Starts the MCP server with stdio transport and telemetry.
@@ -42,7 +38,7 @@ async function startStdio(server, context) {
42
38
  attributes: {
43
39
  "mcp.transport": "stdio",
44
40
  "network.transport": "pipe",
45
- "service.version": LIB_VERSION
41
+ "service.version": require_version.LIB_VERSION
46
42
  }
47
43
  }, async () => {
48
44
  const transport = new __modelcontextprotocol_sdk_server_stdio_js.StdioServerTransport();
@@ -52,22 +48,10 @@ async function startStdio(server, context) {
52
48
  }
53
49
 
54
50
  //#endregion
55
- Object.defineProperty(exports, 'LIB_VERSION', {
56
- enumerable: true,
57
- get: function () {
58
- return LIB_VERSION;
59
- }
60
- });
61
- Object.defineProperty(exports, 'USER_AGENT', {
62
- enumerable: true,
63
- get: function () {
64
- return USER_AGENT;
65
- }
66
- });
67
51
  Object.defineProperty(exports, 'startStdio', {
68
52
  enumerable: true,
69
53
  get: function () {
70
54
  return startStdio;
71
55
  }
72
56
  });
73
- //# sourceMappingURL=stdio-CUTR3lwv.cjs.map
57
+ //# sourceMappingURL=stdio-B08zZS4X.cjs.map