@sentry/mcp-server 0.35.0 → 0.37.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 (155) hide show
  1. package/dist/auth/constants.cjs +1 -1
  2. package/dist/auth/constants.d.cts +1 -1
  3. package/dist/auth/constants.d.ts +1 -1
  4. package/dist/auth/constants.js +1 -1
  5. package/dist/auth/device-code-flow.cjs +4 -4
  6. package/dist/auth/device-code-flow.d.ts +1 -1
  7. package/dist/auth/device-code-flow.js +4 -4
  8. package/dist/auth/resolve-token.cjs +6 -6
  9. package/dist/auth/resolve-token.d.cts +1 -1
  10. package/dist/auth/resolve-token.d.ts +1 -1
  11. package/dist/auth/resolve-token.js +6 -6
  12. package/dist/auth/token-cache.cjs +1 -1
  13. package/dist/auth/token-cache.d.ts +1 -1
  14. package/dist/auth/token-cache.js +1 -1
  15. package/dist/auth/types.cjs +1 -1
  16. package/dist/auth/types.d.ts +1 -1
  17. package/dist/auth/types.js +1 -1
  18. package/dist/{auth-DeUVu86q.cjs → auth-CoEHiogK.cjs} +7 -7
  19. package/dist/{auth-DeUVu86q.cjs.map → auth-CoEHiogK.cjs.map} +1 -1
  20. package/dist/{auth-NuILycy3.js → auth-DMKQfLeC.js} +7 -7
  21. package/dist/{auth-NuILycy3.js.map → auth-DMKQfLeC.js.map} +1 -1
  22. package/dist/blob-utils-C7JBV2hl.js +3 -0
  23. package/dist/blob-utils-DaykNmFv.cjs +3 -0
  24. package/dist/blob-utils-W1AQ3zH3-CbD1HBpG.cjs +4709 -0
  25. package/dist/blob-utils-W1AQ3zH3-CbD1HBpG.cjs.map +1 -0
  26. package/dist/blob-utils-W1AQ3zH3-Dqg_Ruod.js +4692 -0
  27. package/dist/blob-utils-W1AQ3zH3-Dqg_Ruod.js.map +1 -0
  28. package/dist/chunk-CunrlGP7.js +37 -0
  29. package/dist/cli/commands/auth.cjs +8 -8
  30. package/dist/cli/commands/auth.js +8 -8
  31. package/dist/cli/output.cjs +3 -0
  32. package/dist/cli/output.d.cts +7 -0
  33. package/dist/cli/output.d.cts.map +1 -0
  34. package/dist/cli/output.d.ts +7 -0
  35. package/dist/cli/output.d.ts.map +1 -0
  36. package/dist/cli/output.js +3 -0
  37. package/dist/cli/parse.cjs +1 -1
  38. package/dist/cli/parse.d.cts +1 -1
  39. package/dist/cli/parse.d.ts +1 -1
  40. package/dist/cli/parse.js +1 -1
  41. package/dist/cli/resolve.cjs +2 -2
  42. package/dist/cli/resolve.d.cts +1 -1
  43. package/dist/cli/resolve.d.cts.map +1 -1
  44. package/dist/cli/resolve.d.ts +1 -1
  45. package/dist/cli/resolve.d.ts.map +1 -1
  46. package/dist/cli/resolve.js +2 -2
  47. package/dist/cli/types.d.cts +2 -2
  48. package/dist/cli/types.d.ts +2 -2
  49. package/dist/cli/usage.cjs +1 -1
  50. package/dist/cli/usage.js +1 -1
  51. package/dist/{config-Bnslg67w.js → config-8Hjp9aiG.js} +1 -1
  52. package/dist/config-BXJMmHuY.cjs +7 -0
  53. package/dist/{config-YHBj037H-DRbUBG2X.js → config-CUeobZnr-BYvJlg7Z.js} +7 -5
  54. package/dist/config-CUeobZnr-BYvJlg7Z.js.map +1 -0
  55. package/dist/{config-YHBj037H-DI-vM9pT.cjs → config-CUeobZnr-C1uLYu0T.cjs} +7 -5
  56. package/dist/config-CUeobZnr-C1uLYu0T.cjs.map +1 -0
  57. package/dist/{constants-BjQ5jCEg.js → constants-D_84kMgg.js} +71 -9
  58. package/dist/constants-D_84kMgg.js.map +1 -0
  59. package/dist/{constants-Bgs-7WBj.cjs → constants-zNdapUB3.cjs} +94 -8
  60. package/dist/constants-zNdapUB3.cjs.map +1 -0
  61. package/dist/{device-code-flow-b6KaQzNJ.cjs → device-code-flow-C8F3AhEF.cjs} +4 -4
  62. package/dist/{device-code-flow-b6KaQzNJ.cjs.map → device-code-flow-C8F3AhEF.cjs.map} +1 -1
  63. package/dist/{device-code-flow-CltWJnOC.js → device-code-flow-CcQul2R1.js} +4 -4
  64. package/dist/{device-code-flow-CltWJnOC.js.map → device-code-flow-CcQul2R1.js.map} +1 -1
  65. package/dist/index.cjs +8286 -1828
  66. package/dist/index.cjs.map +1 -1
  67. package/dist/index.js +8284 -1825
  68. package/dist/index.js.map +1 -1
  69. package/dist/output-A_-7o7gV.js +8 -0
  70. package/dist/output-A_-7o7gV.js.map +1 -0
  71. package/dist/output-DEoNyYz7.cjs +14 -0
  72. package/dist/output-DEoNyYz7.cjs.map +1 -0
  73. package/dist/{parse-BSFxOAQG.js → parse-Da-x492e.js} +1 -1
  74. package/dist/{parse-BSFxOAQG.js.map → parse-Da-x492e.js.map} +1 -1
  75. package/dist/{parse-BTaa9TK5.cjs → parse-zwbX4Y-K.cjs} +1 -1
  76. package/dist/{parse-BTaa9TK5.cjs.map → parse-zwbX4Y-K.cjs.map} +1 -1
  77. package/dist/{resolve-D9XJMdCX.js → resolve-8tYs_T8S.js} +10 -15
  78. package/dist/resolve-8tYs_T8S.js.map +1 -0
  79. package/dist/{resolve-D4TZw-d-.cjs → resolve-CZF3TTNf.cjs} +10 -15
  80. package/dist/resolve-CZF3TTNf.cjs.map +1 -0
  81. package/dist/{resolve-token-DitlJMRA.js → resolve-token-BZT0rfog.js} +5 -5
  82. package/dist/{resolve-token-DitlJMRA.js.map → resolve-token-BZT0rfog.js.map} +1 -1
  83. package/dist/{resolve-token-BfHulcsU.cjs → resolve-token-DVtQqc4m.cjs} +5 -5
  84. package/dist/{resolve-token-BfHulcsU.cjs.map → resolve-token-DVtQqc4m.cjs.map} +1 -1
  85. package/dist/{stdio-CHTzpWeM.cjs → stdio-BuQ6IY8U.cjs} +17 -8
  86. package/dist/stdio-BuQ6IY8U.cjs.map +1 -0
  87. package/dist/{stdio-Eif0LiAU.js → stdio-CFhXG3ra.js} +17 -8
  88. package/dist/stdio-CFhXG3ra.js.map +1 -0
  89. package/dist/{token-YhriRz-K.js → token-3xpHVxQo.js} +4 -3
  90. package/dist/{token-YhriRz-K.js.map → token-3xpHVxQo.js.map} +1 -1
  91. package/dist/{token-URCv7LSS.cjs → token-C7MavkKX.cjs} +2 -2
  92. package/dist/{token-URCv7LSS.cjs.map → token-C7MavkKX.cjs.map} +1 -1
  93. package/dist/{token-cache-914WGYb3.cjs → token-cache-ATUcs1cg.cjs} +1 -1
  94. package/dist/token-cache-ATUcs1cg.cjs.map +1 -0
  95. package/dist/{token-cache-DHBN2ixb.js → token-cache-DbZp4rvg.js} +1 -1
  96. package/dist/token-cache-DbZp4rvg.js.map +1 -0
  97. package/dist/token-error-CBmJNKLY.js +43 -0
  98. package/dist/{token-error-Df8A7mgb.js.map → token-error-CBmJNKLY.js.map} +1 -1
  99. package/dist/token-util-4bIYDTMS.js +4 -0
  100. package/dist/{token-util-I45r8kkb.cjs → token-util-BRoQwIG6.cjs} +1 -1
  101. package/dist/{token-util-I45r8kkb.cjs.map → token-util-BRoQwIG6.cjs.map} +1 -1
  102. package/dist/{token-util-B-ZIWywO.cjs → token-util-DurDL44i.cjs} +1 -1
  103. package/dist/{token-util-Dnkz6ExF.js → token-util-batRsXGA.js} +3 -2
  104. package/dist/{token-util-Dnkz6ExF.js.map → token-util-batRsXGA.js.map} +1 -1
  105. package/dist/transports/stdio.cjs +2 -2
  106. package/dist/transports/stdio.d.cts +9 -5
  107. package/dist/transports/stdio.d.cts.map +1 -1
  108. package/dist/transports/stdio.d.ts +9 -5
  109. package/dist/transports/stdio.d.ts.map +1 -1
  110. package/dist/transports/stdio.js +2 -2
  111. package/dist/{types-nsyASfJr.js → types-BCSxlxZI.js} +1 -1
  112. package/dist/{types-nsyASfJr.js.map → types-BCSxlxZI.js.map} +1 -1
  113. package/dist/{types-C0xriI9T.d.ts → types-BclC2DY0.d.ts} +1 -1
  114. package/dist/{types-C0xriI9T.d.ts.map → types-BclC2DY0.d.ts.map} +1 -1
  115. package/dist/{types-BdLzKRyK.d.ts → types-DcYSHvwR.d.cts} +4 -3
  116. package/dist/types-DcYSHvwR.d.cts.map +1 -0
  117. package/dist/{types-BHd78Leq.d.cts → types-Ky5RNldv.d.ts} +4 -3
  118. package/dist/types-Ky5RNldv.d.ts.map +1 -0
  119. package/dist/{types-CxTPg1vE.cjs → types-dghCRFW4.cjs} +1 -1
  120. package/dist/{types-CxTPg1vE.cjs.map → types-dghCRFW4.cjs.map} +1 -1
  121. package/dist/{usage-WAgAGh1G.cjs → usage-D486x6Lh.cjs} +8 -5
  122. package/dist/usage-D486x6Lh.cjs.map +1 -0
  123. package/dist/{usage-CyXue87B.js → usage-QiSwuC5N.js} +8 -5
  124. package/dist/usage-QiSwuC5N.js.map +1 -0
  125. package/dist/{version-BsYB56vP.cjs → version-CDrryFjP.cjs} +3 -3
  126. package/dist/version-CDrryFjP.cjs.map +1 -0
  127. package/dist/version-COFS7UF2.js +7 -0
  128. package/dist/version-COFS7UF2.js.map +1 -0
  129. package/package.json +9 -9
  130. package/dist/blob-utils-B9a20TSV.js +0 -3
  131. package/dist/blob-utils-CGHZbDNh-CN3juEJQ.cjs +0 -66
  132. package/dist/blob-utils-CGHZbDNh-CN3juEJQ.cjs.map +0 -1
  133. package/dist/blob-utils-CGHZbDNh-Dhzb2_wT.js +0 -54
  134. package/dist/blob-utils-CGHZbDNh-Dhzb2_wT.js.map +0 -1
  135. package/dist/blob-utils-dQmZRlIb.cjs +0 -3
  136. package/dist/config-IA5hZFjI.cjs +0 -7
  137. package/dist/config-YHBj037H-DI-vM9pT.cjs.map +0 -1
  138. package/dist/config-YHBj037H-DRbUBG2X.js.map +0 -1
  139. package/dist/constants-Bgs-7WBj.cjs.map +0 -1
  140. package/dist/constants-BjQ5jCEg.js.map +0 -1
  141. package/dist/resolve-D4TZw-d-.cjs.map +0 -1
  142. package/dist/resolve-D9XJMdCX.js.map +0 -1
  143. package/dist/stdio-CHTzpWeM.cjs.map +0 -1
  144. package/dist/stdio-Eif0LiAU.js.map +0 -1
  145. package/dist/token-cache-914WGYb3.cjs.map +0 -1
  146. package/dist/token-cache-DHBN2ixb.js.map +0 -1
  147. package/dist/token-error-Df8A7mgb.js +0 -77
  148. package/dist/token-util-7XgZqk3d.js +0 -4
  149. package/dist/types-BHd78Leq.d.cts.map +0 -1
  150. package/dist/types-BdLzKRyK.d.ts.map +0 -1
  151. package/dist/usage-CyXue87B.js.map +0 -1
  152. package/dist/usage-WAgAGh1G.cjs.map +0 -1
  153. package/dist/version-BbMRHfZS.js +0 -7
  154. package/dist/version-BbMRHfZS.js.map +0 -1
  155. package/dist/version-BsYB56vP.cjs.map +0 -1
@@ -0,0 +1,8 @@
1
+ //#region src/cli/output.ts
2
+ function printCliLine(message) {
3
+ console.log(message);
4
+ }
5
+
6
+ //#endregion
7
+ export { printCliLine };
8
+ //# sourceMappingURL=output-A_-7o7gV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-A_-7o7gV.js","names":["message: string"],"sources":["../src/cli/output.ts"],"sourcesContent":["export function printCliLine(message: string): void {\n console.log(message);\n}\n"],"mappings":";AAAA,SAAgB,aAAaA,SAAuB;AAClD,SAAQ,IAAI,QAAQ;AACrB"}
@@ -0,0 +1,14 @@
1
+
2
+ //#region src/cli/output.ts
3
+ function printCliLine(message) {
4
+ console.log(message);
5
+ }
6
+
7
+ //#endregion
8
+ Object.defineProperty(exports, 'printCliLine', {
9
+ enumerable: true,
10
+ get: function () {
11
+ return printCliLine;
12
+ }
13
+ });
14
+ //# sourceMappingURL=output-DEoNyYz7.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-DEoNyYz7.cjs","names":["message: string"],"sources":["../src/cli/output.ts"],"sourcesContent":["export function printCliLine(message: string): void {\n console.log(message);\n}\n"],"mappings":";;AAAA,SAAgB,aAAaA,SAAuB;AAClD,SAAQ,IAAI,QAAQ;AACrB"}
@@ -109,4 +109,4 @@ function merge(cli, env) {
109
109
 
110
110
  //#endregion
111
111
  export { merge, parseArgv, parseEnv };
112
- //# sourceMappingURL=parse-BSFxOAQG.js.map
112
+ //# sourceMappingURL=parse-Da-x492e.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-BSFxOAQG.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 \"insecure-http\": { type: \"boolean\" 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 insecureHttp: values[\"insecure-http\"] === true,\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 insecureHttp: cli.insecureHttp === true,\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,iBAAiB,EAAE,MAAM,UAAoB;EAC7C,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,MAAM,SAAmB;EACjD,mBAAmB,EAAE,MAAM,SAAmB;EAC9C,kBAAkB,EAAE,MAAM,SAAmB;EAC7C,qBAAqB,EAAE,MAAM,SAAmB;EAChD,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,QAAQ,EAAE,MAAM,SAAmB;EACnC,kBAAkB,EAAE,MAAM,SAAmB;EAC7C,O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]","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 \"insecure-http\": { type: \"boolean\" 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 insecureHttp: values[\"insecure-http\"] === true,\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 insecureHttp: cli.insecureHttp === true,\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,iBAAiB,EAAE,MAAM,UAAoB;EAC7C,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,MAAM,SAAmB;EACjD,mBAAmB,EAAE,MAAM,SAAmB;EAC9C,kBAAkB,EAAE,MAAM,SAAmB;EAC7C,qBAAqB,EAAE,MAAM,SAAmB;EAChD,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,QAAQ,EAAE,MAAM,SAAmB;EACnC,kBAAkB,EAAE,MAAM,SAAmB;EAC7C,OAAO,EAAE,MAAM,UAAoB;EACnC,cAAc,EAAE,MAAM,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appingURL=parse-BTaa9TK5.cjs.map
130
+ //# sourceMappingURL=parse-zwbX4Y-K.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"parse-BTaa9TK5.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 \"insecure-http\": { type: \"boolean\" 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 insecureHttp: values[\"insecure-http\"] === true,\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 insecureHttp: cli.insecureHttp === true,\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,iBAAiB,EAAE,MAAM,UAAoB;EAC7C,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,MAAM,SAAmB;EACjD,mBAAmB,EAAE,MAAM,SAAmB;EAC9C,kBAAkB,EAAE,MAAM,SAAmB;EAC7C,qBAAqB,EAAE,MAAM,SAAmB;EAChD,gBAAgB,EAAE,MAAM,SA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AI,YAAY;EACzB,aAAa,IAAI;CAClB;AACF"}
1
+ {"version":3,"file":"parse-zwbX4Y-K.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 \"insecure-http\": { type: \"boolean\" 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 insecureHttp: values[\"insecure-http\"] === true,\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 insecureHttp: cli.insecureHttp === true,\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,iBAAiB,EAAE,MAAM,UAAoB;EAC7C,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,MAAM,SAAmB;EACjD,mBAAmB,EAAE,MAAM,SAAmB;EAC9C,kBAAkB,EAAE,MAAM,SAAmB;EAC7C,qBAAqB,EAAE,MAAM,SAAmB;EAChD,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,QAAQ,EAAE,MAAM,SAAmB;E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
@@ -1,11 +1,11 @@
1
- import { DEFAULT_SENTRY_CLIENT_ID, isSentryHost, validateAndParseSentryUrlThrows, validateOpenAiBaseUrlThrows, validateSentryHostThrows } from "./constants-BjQ5jCEg.js";
1
+ import { DEFAULT_SENTRY_CLIENT_ID, isSentryHost, validateAndParseSentryUrlThrows, validateOpenAiBaseUrlThrows, validateSentryHostThrows } from "./constants-D_84kMgg.js";
2
2
 
3
- //#region ../mcp-core/dist/skills-C74pcZxh.js
3
+ //#region ../mcp-core/dist/skills-C8WO-Jal.js
4
4
  const SKILLS = {
5
5
  inspect: {
6
6
  id: "inspect",
7
7
  name: "Inspect Issues & Events",
8
- description: "Search for errors, analyze traces, and explore event details",
8
+ description: "Read-only access to core Sentry data: issues, events, traces, replays, releases, monitors, profiles, documentation, and project metadata",
9
9
  defaultEnabled: true,
10
10
  order: 1
11
11
  },
@@ -19,8 +19,9 @@ const SKILLS = {
19
19
  docs: {
20
20
  id: "docs",
21
21
  name: "Documentation",
22
- description: "Search and read Sentry SDK documentation",
22
+ description: "Deprecated legacy docs-only grant. Documentation tools are now available through Inspect Issues & Events.",
23
23
  defaultEnabled: false,
24
+ deprecated: true,
24
25
  order: 3
25
26
  },
26
27
  triage: {
@@ -36,20 +37,14 @@ const SKILLS = {
36
37
  description: "Create and modify projects, teams, and DSNs",
37
38
  defaultEnabled: false,
38
39
  order: 5
39
- },
40
- preprod: {
41
- id: "preprod",
42
- name: "Preprod Snapshots",
43
- description: "Inspect visual regression snapshot tests from CI — view changed images and diff masks",
44
- defaultEnabled: false,
45
- order: 6
46
40
  }
47
41
  };
48
42
  const SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);
49
43
  const ALL_SKILLS = Object.keys(SKILLS);
44
+ const ACTIVE_SKILLS = SKILLS_ARRAY.filter((s) => !s.deprecated).map((s) => s.id);
50
45
  const DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);
51
46
  function isValidSkill(skill) {
52
- return skill in SKILLS;
47
+ return Object.hasOwn(SKILLS, skill);
53
48
  }
54
49
  function isEnabledBySkills(grantedSkills, toolSkills) {
55
50
  if (!grantedSkills || toolSkills.length === 0) return false;
@@ -106,7 +101,7 @@ function finalize(input) {
106
101
  if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid));
107
102
  if (valid.size === 0) throw new Error("Error: Invalid skills provided. No valid skills found.");
108
103
  finalSkills = valid;
109
- } else finalSkills = new Set(ALL_SKILLS);
104
+ } else finalSkills = new Set(ACTIVE_SKILLS);
110
105
  if (input.disableSkills) {
111
106
  const { valid: skillsToDisable, invalid } = parseSkills(input.disableSkills);
112
107
  if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid, "--disable-skills"));
@@ -118,7 +113,7 @@ function finalize(input) {
118
113
  let agentProvider = void 0;
119
114
  if (input.agentProvider) {
120
115
  const provider = input.agentProvider.toLowerCase();
121
- if (provider !== "openai" && provider !== "azure-openai" && provider !== "anthropic") throw new Error(`Error: Invalid agent provider "${input.agentProvider}". Must be "openai", "azure-openai", or "anthropic".`);
116
+ if (provider !== "openai" && provider !== "azure-openai" && provider !== "anthropic" && provider !== "openrouter") throw new Error(`Error: Invalid agent provider "${input.agentProvider}". Must be "openai", "azure-openai", "anthropic", or "openrouter".`);
122
117
  agentProvider = provider;
123
118
  }
124
119
  return {
@@ -141,4 +136,4 @@ function finalize(input) {
141
136
 
142
137
  //#endregion
143
138
  export { ALL_SKILLS, SKILLS, finalize, formatInvalidSkills, isEnabledBySkills, resolveHost };
144
- //# sourceMappingURL=resolve-D9XJMdCX.js.map
139
+ //# sourceMappingURL=resolve-8tYs_T8S.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-8tYs_T8S.js","names":["invalid: string[]","source?: string","url?: string","host?: string","input: MergedArgs","finalSkills: Set<Skill>","agentProvider:\n | \"openai\"\n | \"azure-openai\"\n | \"anthropic\"\n | \"openrouter\"\n | undefined"],"sources":["../../mcp-core/dist/skills-C8WO-Jal.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: \"Read-only access to core Sentry data: issues, events, traces, replays, releases, monitors, profiles, documentation, and project metadata\",\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: \"Deprecated legacy docs-only grant. Documentation tools are now available through Inspect Issues & Events.\",\n\t\tdefaultEnabled: false,\n\t\tdeprecated: true,\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 surfacesModule = await import(\"./tools/surfaces.js\");\n\tconst tools = toolsModule.default;\n\tconst isCatalogInfrastructureTool = surfacesModule.isCatalogInfrastructureToolName;\n\tconst isWrapperTool = surfacesModule.isWrapperToolName;\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const skill of Object.keys(SKILLS)) counts.set(skill, 0);\n\tfor (const [toolName, tool] of Object.entries(tools)) {\n\t\tif (isWrapperTool(toolName) || isCatalogInfrastructureTool(toolName)) 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 ACTIVE_SKILLS = SKILLS_ARRAY.filter((s) => !s.deprecated).map((s) => s.id);\nconst DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);\nfunction isValidSkill(skill) {\n\treturn Object.hasOwn(SKILLS, skill);\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 surfacesModule = await import(\"./tools/surfaces.js\");\n\tconst tools = toolsModule.default;\n\tconst isCatalogInfrastructureTool = surfacesModule.isCatalogInfrastructureToolName;\n\tconst isWrapperTool = surfacesModule.isWrapperToolName;\n\tconst scopes = new Set(DEFAULT_SCOPES);\n\tfor (const [toolName, tool] of Object.entries(tools)) {\n\t\tif (isWrapperTool(toolName) || isCatalogInfrastructureTool(toolName)) 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 { ACTIVE_SKILLS, ALL_SKILLS, DEFAULT_SKILLS, SKILLS, SKILLS_ARRAY, getScopesForSkills, getSkillsArrayWithCounts, isEnabledBySkills, isValidSkill, parseSkills };\n//# sourceMappingURL=skills-C8WO-Jal.js.map","import {\n ACTIVE_SKILLS,\n ALL_SKILLS,\n parseSkills,\n type Skill,\n} from \"@sentry/mcp-core/skills\";\nimport {\n isSentryHost,\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 if (input.insecureHttp && input.url) {\n throw new Error(\n \"Error: --insecure-http cannot be used with --url or SENTRY_URL. Use --host for insecure self-hosted instances.\",\n );\n }\n\n const sentryHost = resolveHost(input.url, input.host);\n\n if (input.insecureHttp && isSentryHost(sentryHost)) {\n throw new Error(\n \"Error: --insecure-http is only supported for self-hosted Sentry hosts.\",\n );\n }\n\n const sentryProtocol = input.insecureHttp ? \"http\" : \"https\";\n\n // Skills resolution\n //\n // IMPORTANT: stdio (CLI) intentionally defaults to all active 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 non-deprecated skills\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 active skills when no flag is provided (see comment block above for rationale)\n finalSkills = new Set<Skill>(ACTIVE_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:\n | \"openai\"\n | \"azure-openai\"\n | \"anthropic\"\n | \"openrouter\"\n | undefined = undefined;\n if (input.agentProvider) {\n const provider = input.agentProvider.toLowerCase();\n if (\n provider !== \"openai\" &&\n provider !== \"azure-openai\" &&\n provider !== \"anthropic\" &&\n provider !== \"openrouter\"\n ) {\n throw new Error(\n `Error: Invalid agent provider \"${input.agentProvider}\". Must be \"openai\", \"azure-openai\", \"anthropic\", or \"openrouter\".`,\n );\n }\n agentProvider = provider;\n }\n\n return {\n accessToken: input.accessToken,\n clientId: input.clientId || DEFAULT_SENTRY_CLIENT_ID,\n sentryHost,\n sentryProtocol,\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,YAAY;EACZ,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;AAkB5E,MAAM,aAAa,OAAO,KAAK,OAAO;AACtC,MAAM,gBAAgB,aAAa,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG;AAChF,MAAM,iBAAiB,aAAa,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG;AACpF,SAAS,aAAa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,MAAM,QAAQ;EAEhB,MAAM,EAAE,OAAO,SAAS,GAAG,YAAY,MAAM,OAAO;AACpD,MAAI,QAAQ,SAAS,EACnB,OAAM,IAAI,MAAM,oBAAoB,QAAQ;AAE9C,MAAI,MAAM,SAAS,EACjB,OAAM,IAAI,MAAM;AAElB,gBAAc;CACf,MAEC,eAAc,IAAI,IAAW;AAI/B,KAAI,MAAM,eAAe;EACvB,MAAM,EAAE,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;AAMJ,KAAI,MAAM,eAAe;EACvB,MAAM,WAAW,MAAM,cAAc,aAAa;AAClD,MACE,aAAa,YACb,aAAa,kBACb,aAAa,eACb,aAAa,aAEb,OAAM,IAAI,OACP,iCAAiC,MAAM,cAAc;AAG1D,kBAAgB;CACjB;AAED,QAAO;EACL,aAAa,MAAM;EACnB,UAAU,MAAM,YAAY;EAC5B;EACA;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"}
@@ -1,11 +1,11 @@
1
- const require_constants = require('./constants-Bgs-7WBj.cjs');
1
+ const require_constants = require('./constants-zNdapUB3.cjs');
2
2
 
3
- //#region ../mcp-core/dist/skills-C74pcZxh.js
3
+ //#region ../mcp-core/dist/skills-C8WO-Jal.js
4
4
  const SKILLS = {
5
5
  inspect: {
6
6
  id: "inspect",
7
7
  name: "Inspect Issues & Events",
8
- description: "Search for errors, analyze traces, and explore event details",
8
+ description: "Read-only access to core Sentry data: issues, events, traces, replays, releases, monitors, profiles, documentation, and project metadata",
9
9
  defaultEnabled: true,
10
10
  order: 1
11
11
  },
@@ -19,8 +19,9 @@ const SKILLS = {
19
19
  docs: {
20
20
  id: "docs",
21
21
  name: "Documentation",
22
- description: "Search and read Sentry SDK documentation",
22
+ description: "Deprecated legacy docs-only grant. Documentation tools are now available through Inspect Issues & Events.",
23
23
  defaultEnabled: false,
24
+ deprecated: true,
24
25
  order: 3
25
26
  },
26
27
  triage: {
@@ -36,20 +37,14 @@ const SKILLS = {
36
37
  description: "Create and modify projects, teams, and DSNs",
37
38
  defaultEnabled: false,
38
39
  order: 5
39
- },
40
- preprod: {
41
- id: "preprod",
42
- name: "Preprod Snapshots",
43
- description: "Inspect visual regression snapshot tests from CI — view changed images and diff masks",
44
- defaultEnabled: false,
45
- order: 6
46
40
  }
47
41
  };
48
42
  const SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);
49
43
  const ALL_SKILLS = Object.keys(SKILLS);
44
+ const ACTIVE_SKILLS = SKILLS_ARRAY.filter((s) => !s.deprecated).map((s) => s.id);
50
45
  const DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);
51
46
  function isValidSkill(skill) {
52
- return skill in SKILLS;
47
+ return Object.hasOwn(SKILLS, skill);
53
48
  }
54
49
  function isEnabledBySkills(grantedSkills, toolSkills) {
55
50
  if (!grantedSkills || toolSkills.length === 0) return false;
@@ -106,7 +101,7 @@ function finalize(input) {
106
101
  if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid));
107
102
  if (valid.size === 0) throw new Error("Error: Invalid skills provided. No valid skills found.");
108
103
  finalSkills = valid;
109
- } else finalSkills = new Set(ALL_SKILLS);
104
+ } else finalSkills = new Set(ACTIVE_SKILLS);
110
105
  if (input.disableSkills) {
111
106
  const { valid: skillsToDisable, invalid } = parseSkills(input.disableSkills);
112
107
  if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid, "--disable-skills"));
@@ -118,7 +113,7 @@ function finalize(input) {
118
113
  let agentProvider = void 0;
119
114
  if (input.agentProvider) {
120
115
  const provider = input.agentProvider.toLowerCase();
121
- if (provider !== "openai" && provider !== "azure-openai" && provider !== "anthropic") throw new Error(`Error: Invalid agent provider "${input.agentProvider}". Must be "openai", "azure-openai", or "anthropic".`);
116
+ if (provider !== "openai" && provider !== "azure-openai" && provider !== "anthropic" && provider !== "openrouter") throw new Error(`Error: Invalid agent provider "${input.agentProvider}". Must be "openai", "azure-openai", "anthropic", or "openrouter".`);
122
117
  agentProvider = provider;
123
118
  }
124
119
  return {
@@ -176,4 +171,4 @@ Object.defineProperty(exports, 'resolveHost', {
176
171
  return resolveHost;
177
172
  }
178
173
  });
179
- //# sourceMappingURL=resolve-D4TZw-d-.cjs.map
174
+ //# sourceMappingURL=resolve-CZF3TTNf.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-CZF3TTNf.cjs","names":["invalid: string[]","source?: string","url?: string","host?: string","input: MergedArgs","finalSkills: Set<Skill>","agentProvider:\n | \"openai\"\n | \"azure-openai\"\n | \"anthropic\"\n | \"openrouter\"\n | undefined","DEFAULT_SENTRY_CLIENT_ID"],"sources":["../../mcp-core/dist/skills-C8WO-Jal.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: \"Read-only access to core Sentry data: issues, events, traces, replays, releases, monitors, profiles, documentation, and project metadata\",\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: \"Deprecated legacy docs-only grant. Documentation tools are now available through Inspect Issues & Events.\",\n\t\tdefaultEnabled: false,\n\t\tdeprecated: true,\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 surfacesModule = await import(\"./tools/surfaces.js\");\n\tconst tools = toolsModule.default;\n\tconst isCatalogInfrastructureTool = surfacesModule.isCatalogInfrastructureToolName;\n\tconst isWrapperTool = surfacesModule.isWrapperToolName;\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const skill of Object.keys(SKILLS)) counts.set(skill, 0);\n\tfor (const [toolName, tool] of Object.entries(tools)) {\n\t\tif (isWrapperTool(toolName) || isCatalogInfrastructureTool(toolName)) 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 ACTIVE_SKILLS = SKILLS_ARRAY.filter((s) => !s.deprecated).map((s) => s.id);\nconst DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);\nfunction isValidSkill(skill) {\n\treturn Object.hasOwn(SKILLS, skill);\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 surfacesModule = await import(\"./tools/surfaces.js\");\n\tconst tools = toolsModule.default;\n\tconst isCatalogInfrastructureTool = surfacesModule.isCatalogInfrastructureToolName;\n\tconst isWrapperTool = surfacesModule.isWrapperToolName;\n\tconst scopes = new Set(DEFAULT_SCOPES);\n\tfor (const [toolName, tool] of Object.entries(tools)) {\n\t\tif (isWrapperTool(toolName) || isCatalogInfrastructureTool(toolName)) 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 { ACTIVE_SKILLS, ALL_SKILLS, DEFAULT_SKILLS, SKILLS, SKILLS_ARRAY, getScopesForSkills, getSkillsArrayWithCounts, isEnabledBySkills, isValidSkill, parseSkills };\n//# sourceMappingURL=skills-C8WO-Jal.js.map","import {\n ACTIVE_SKILLS,\n ALL_SKILLS,\n parseSkills,\n type Skill,\n} from \"@sentry/mcp-core/skills\";\nimport {\n isSentryHost,\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 if (input.insecureHttp && input.url) {\n throw new Error(\n \"Error: --insecure-http cannot be used with --url or SENTRY_URL. Use --host for insecure self-hosted instances.\",\n );\n }\n\n const sentryHost = resolveHost(input.url, input.host);\n\n if (input.insecureHttp && isSentryHost(sentryHost)) {\n throw new Error(\n \"Error: --insecure-http is only supported for self-hosted Sentry hosts.\",\n );\n }\n\n const sentryProtocol = input.insecureHttp ? \"http\" : \"https\";\n\n // Skills resolution\n //\n // IMPORTANT: stdio (CLI) intentionally defaults to all active 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 non-deprecated skills\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 active skills when no flag is provided (see comment block above for rationale)\n finalSkills = new Set<Skill>(ACTIVE_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:\n | \"openai\"\n | \"azure-openai\"\n | \"anthropic\"\n | \"openrouter\"\n | undefined = undefined;\n if (input.agentProvider) {\n const provider = input.agentProvider.toLowerCase();\n if (\n provider !== \"openai\" &&\n provider !== \"azure-openai\" &&\n provider !== \"anthropic\" &&\n provider !== \"openrouter\"\n ) {\n throw new Error(\n `Error: Invalid agent provider \"${input.agentProvider}\". Must be \"openai\", \"azure-openai\", \"anthropic\", or \"openrouter\".`,\n );\n }\n agentProvider = provider;\n }\n\n return {\n accessToken: input.accessToken,\n clientId: input.clientId || DEFAULT_SENTRY_CLIENT_ID,\n sentryHost,\n sentryProtocol,\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,YAAY;EACZ,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;AAkB5E,MAAM,aAAa,OAAO,KAAK,OAAO;AACtC,MAAM,gBAAgB,aAAa,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG;AAChF,MAAM,iBAAiB,aAAa,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG;AACpF,SAAS,aAAa,OAAO;AAC5B,QAAO,OAAO,OAAO,QAAQ,MAAM;AACnC;AACD,SAAS,kBAAkB,eAAe,YAAY;AACrD,MAAK,iBAAiB,WAAW,WAAW,EAAG,QAAO;AACtD,QAAO,WAAW,KAAK,CAAC,UAAU,cAAc,IAAI,MAAM,CAAC;AAC3D;AACD,SAAS,YAAY,OAAO;CAC3B,MAAM,wBAAwB,IAAI;CAClC,MAAM,UAAU,CAAE;AAClB,MAAK,MAAO,QAAO;EAClB;EACA;CACA;CACD,IAAI,SAAS,CAAE;AACf,YAAW,UAAU,SAAU,UAAS,MAAM,MAAM,IAAI;UAC/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B;AAElE,OAAK,MAAM,SAAS,gBAClB,aAAY,OAAO,MAAM;AAE3B,MAAI,YAAY,SAAS,EACvB,OAAM,IAAI,MACR;CAGL;CAED,MAAM,wBAAwB,MAAM,gBAChC,8CAA4B,MAAM,cAAc;CAIpD,MAAM,2BAA2B,MAAM,mBACnC,8CAA4B,MAAM,iBAAiB;CAIvD,IAAIC;AAMJ,KAAI,MAAM,eAAe;EACvB,MAAM,WAAW,MAAM,cAAc,aAAa;AAClD,MACE,aAAa,YACb,aAAa,kBACb,aAAa,eACb,aAAa,aAEb,OAAM,IAAI,OACP,iCAAiC,MAAM,cAAc;AAG1D,kBAAgB;CACjB;AAED,QAAO;EACL,aAAa,MAAM;EACnB,UAAU,MAAM,YAAYC;EAC5B;EACA;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"}
@@ -1,7 +1,7 @@
1
- import { OAUTH_HOST, isSentryHost } from "./constants-BjQ5jCEg.js";
2
- import { toCachedToken } from "./types-nsyASfJr.js";
3
- import { authenticate } from "./device-code-flow-CltWJnOC.js";
4
- import { readCachedToken, writeCachedToken } from "./token-cache-DHBN2ixb.js";
1
+ import { OAUTH_HOST, isSentryHost } from "./constants-D_84kMgg.js";
2
+ import { toCachedToken } from "./types-BCSxlxZI.js";
3
+ import { authenticate } from "./device-code-flow-CcQul2R1.js";
4
+ import { readCachedToken, writeCachedToken } from "./token-cache-DbZp4rvg.js";
5
5
 
6
6
  //#region src/auth/resolve-token.ts
7
7
  function withToken(partial, accessToken) {
@@ -44,4 +44,4 @@ async function resolveAccessToken(partial) {
44
44
 
45
45
  //#endregion
46
46
  export { resolveAccessToken };
47
- //# sourceMappingURL=resolve-token-DitlJMRA.js.map
47
+ //# sourceMappingURL=resolve-token-BZT0rfog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-token-DitlJMRA.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
+ {"version":3,"file":"resolve-token-BZT0rfog.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,7 +1,7 @@
1
- const require_constants = require('./constants-Bgs-7WBj.cjs');
2
- const require_types = require('./types-CxTPg1vE.cjs');
3
- const require_device_code_flow = require('./device-code-flow-b6KaQzNJ.cjs');
4
- const require_token_cache = require('./token-cache-914WGYb3.cjs');
1
+ const require_constants = require('./constants-zNdapUB3.cjs');
2
+ const require_types = require('./types-dghCRFW4.cjs');
3
+ const require_device_code_flow = require('./device-code-flow-C8F3AhEF.cjs');
4
+ const require_token_cache = require('./token-cache-ATUcs1cg.cjs');
5
5
 
6
6
  //#region src/auth/resolve-token.ts
7
7
  function withToken(partial, accessToken) {
@@ -49,4 +49,4 @@ Object.defineProperty(exports, 'resolveAccessToken', {
49
49
  return resolveAccessToken;
50
50
  }
51
51
  });
52
- //# sourceMappingURL=resolve-token-BfHulcsU.cjs.map
52
+ //# sourceMappingURL=resolve-token-DVtQqc4m.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-token-BfHulcsU.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"}
1
+ {"version":3,"file":"resolve-token-DVtQqc4m.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"}
@@ -1,9 +1,22 @@
1
1
  const require_chunk = require('./chunk-Cv9WC9bY.cjs');
2
- const require_version = require('./version-BsYB56vP.cjs');
2
+ const require_version = require('./version-CDrryFjP.cjs');
3
3
  const __modelcontextprotocol_sdk_server_stdio_js = require_chunk.__toESM(require("@modelcontextprotocol/sdk/server/stdio.js"));
4
4
  const __sentry_node = require_chunk.__toESM(require("@sentry/node"));
5
5
 
6
6
  //#region src/transports/stdio.ts
7
+ function getStdioSpanAttributes(context) {
8
+ const attributes = {
9
+ "app.transport": "stdio",
10
+ "app.server.version": require_version.LIB_VERSION,
11
+ "app.server.mode.agent": context.agentMode ?? false,
12
+ "app.server.mode.experimental": context.experimentalMode ?? false,
13
+ "network.transport": "pipe",
14
+ "service.version": require_version.LIB_VERSION
15
+ };
16
+ if (context.sentryHost) attributes["app.upstream.host"] = context.sentryHost;
17
+ if (context.mcpUrl) attributes["app.url.full"] = context.mcpUrl;
18
+ return attributes;
19
+ }
7
20
  /**
8
21
  * Starts the MCP server with stdio transport and telemetry.
9
22
  *
@@ -12,7 +25,7 @@ const __sentry_node = require_chunk.__toESM(require("@sentry/node"));
12
25
  * All operations are wrapped in Sentry tracing for observability.
13
26
  *
14
27
  * @param server - Configured and instrumented MCP server instance (with context in closures)
15
- * @param context - Server context with authentication and configuration (for telemetry attributes)
28
+ * @param context - Context values used for telemetry attributes
16
29
  *
17
30
  * @example CLI Integration
18
31
  * ```typescript
@@ -35,11 +48,7 @@ async function startStdio(server, context) {
35
48
  await __sentry_node.startNewTrace(async () => {
36
49
  return await __sentry_node.startSpan({
37
50
  name: "mcp.server/stdio",
38
- attributes: {
39
- "app.transport": "stdio",
40
- "network.transport": "pipe",
41
- "service.version": require_version.LIB_VERSION
42
- }
51
+ attributes: getStdioSpanAttributes(context)
43
52
  }, async () => {
44
53
  const transport = new __modelcontextprotocol_sdk_server_stdio_js.StdioServerTransport();
45
54
  await server.connect(transport);
@@ -54,4 +63,4 @@ Object.defineProperty(exports, 'startStdio', {
54
63
  return startStdio;
55
64
  }
56
65
  });
57
- //# sourceMappingURL=stdio-CHTzpWeM.cjs.map
66
+ //# sourceMappingURL=stdio-BuQ6IY8U.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stdio-BuQ6IY8U.cjs","names":["context: StdioServerContext","attributes: Record<string, string | boolean>","LIB_VERSION","server: McpServer","context: Context","StdioServerTransport"],"sources":["../src/transports/stdio.ts"],"sourcesContent":["import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\n/**\n * Standard I/O Transport for MCP Server.\n *\n * Provides stdio-based communication for the Sentry MCP server, typically used\n * when the server runs as a subprocess communicating via stdin/stdout pipes.\n *\n * @example Basic Usage\n * ```typescript\n * import { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\n * import { startStdio } from \"./transports/stdio.js\";\n *\n * const server = new Server();\n * const context = {\n * accessToken: process.env.SENTRY_TOKEN,\n * host: \"sentry.io\"\n * };\n *\n * await startStdio(server, context);\n * ```\n */\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { LIB_VERSION } from \"@sentry/mcp-core/version\";\nimport * as Sentry from \"@sentry/node\";\n\nexport type StdioServerContext = {\n sentryHost?: string;\n mcpUrl?: string;\n agentMode?: boolean;\n experimentalMode?: boolean;\n};\n\nfunction getStdioSpanAttributes(\n context: StdioServerContext,\n): Record<string, string | boolean> {\n const attributes: Record<string, string | boolean> = {\n \"app.transport\": \"stdio\",\n \"app.server.version\": LIB_VERSION,\n \"app.server.mode.agent\": context.agentMode ?? false,\n \"app.server.mode.experimental\": context.experimentalMode ?? false,\n \"network.transport\": \"pipe\",\n \"service.version\": LIB_VERSION,\n };\n\n if (context.sentryHost) {\n attributes[\"app.upstream.host\"] = context.sentryHost;\n }\n if (context.mcpUrl) {\n attributes[\"app.url.full\"] = context.mcpUrl;\n }\n\n return attributes;\n}\n\n/**\n * Starts the MCP server with stdio transport and telemetry.\n *\n * Connects the server using stdio transport for process-based communication.\n * Context is already captured in tool handler closures during buildServer().\n * All operations are wrapped in Sentry tracing for observability.\n *\n * @param server - Configured and instrumented MCP server instance (with context in closures)\n * @param context - Context values used for telemetry attributes\n *\n * @example CLI Integration\n * ```typescript\n * import { buildServer } from \"./server.js\";\n * import { startStdio } from \"./transports/stdio.js\";\n *\n * const context = {\n * accessToken: userToken,\n * sentryHost: \"sentry.io\",\n * userId: \"user-123\",\n * clientId: \"cursor-ide\",\n * constraints: {}\n * };\n *\n * const server = buildServer({ context }); // Context captured in closures\n * await startStdio(server, context);\n * ```\n */\nexport async function startStdio<Context extends StdioServerContext>(\n server: McpServer,\n context: Context,\n) {\n await Sentry.startNewTrace(async () => {\n return await Sentry.startSpan(\n {\n name: \"mcp.server/stdio\",\n attributes: getStdioSpanAttributes(context),\n },\n async () => {\n // Context already captured in tool handler closures during buildServer()\n const transport = new StdioServerTransport();\n await server.connect(transport);\n },\n );\n });\n}\n"],"mappings":";;;;;;AAgCA,SAAS,uBACPA,SACkC;CAClC,MAAMC,aAA+C;EACnD,iBAAiB;EACjB,sBAAsBC;EACtB,yBAAyB,QAAQ,aAAa;EAC9C,gCAAgC,QAAQ,oBAAoB;EAC5D,qBAAqB;EACrB,mBAAmBA;CACpB;AAED,KAAI,QAAQ,WACV,YAAW,uBAAuB,QAAQ;AAE5C,KAAI,QAAQ,OACV,YAAW,kBAAkB,QAAQ;AAGvC,QAAO;AACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BD,eAAsB,WACpBC,QACAC,SACA;AACA,OAAM,cAAO,cAAc,YAAY;AACrC,SAAO,MAAM,cAAO,UAClB;GACE,MAAM;GACN,YAAY,uBAAuB,QAAQ;EAC5C,GACD,YAAY;GAEV,MAAM,YAAY,IAAIC;AACtB,SAAM,OAAO,QAAQ,UAAU;EAChC,EACF;CACF,EAAC;AACH"}
@@ -1,8 +1,21 @@
1
- import { LIB_VERSION } from "./version-BbMRHfZS.js";
1
+ import { LIB_VERSION } from "./version-COFS7UF2.js";
2
2
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3
3
  import * as Sentry from "@sentry/node";
4
4
 
5
5
  //#region src/transports/stdio.ts
6
+ function getStdioSpanAttributes(context) {
7
+ const attributes = {
8
+ "app.transport": "stdio",
9
+ "app.server.version": LIB_VERSION,
10
+ "app.server.mode.agent": context.agentMode ?? false,
11
+ "app.server.mode.experimental": context.experimentalMode ?? false,
12
+ "network.transport": "pipe",
13
+ "service.version": LIB_VERSION
14
+ };
15
+ if (context.sentryHost) attributes["app.upstream.host"] = context.sentryHost;
16
+ if (context.mcpUrl) attributes["app.url.full"] = context.mcpUrl;
17
+ return attributes;
18
+ }
6
19
  /**
7
20
  * Starts the MCP server with stdio transport and telemetry.
8
21
  *
@@ -11,7 +24,7 @@ import * as Sentry from "@sentry/node";
11
24
  * All operations are wrapped in Sentry tracing for observability.
12
25
  *
13
26
  * @param server - Configured and instrumented MCP server instance (with context in closures)
14
- * @param context - Server context with authentication and configuration (for telemetry attributes)
27
+ * @param context - Context values used for telemetry attributes
15
28
  *
16
29
  * @example CLI Integration
17
30
  * ```typescript
@@ -34,11 +47,7 @@ async function startStdio(server, context) {
34
47
  await Sentry.startNewTrace(async () => {
35
48
  return await Sentry.startSpan({
36
49
  name: "mcp.server/stdio",
37
- attributes: {
38
- "app.transport": "stdio",
39
- "network.transport": "pipe",
40
- "service.version": LIB_VERSION
41
- }
50
+ attributes: getStdioSpanAttributes(context)
42
51
  }, async () => {
43
52
  const transport = new StdioServerTransport();
44
53
  await server.connect(transport);
@@ -48,4 +57,4 @@ async function startStdio(server, context) {
48
57
 
49
58
  //#endregion
50
59
  export { startStdio };
51
- //# sourceMappingURL=stdio-Eif0LiAU.js.map
60
+ //# sourceMappingURL=stdio-CFhXG3ra.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stdio-CFhXG3ra.js","names":["context: StdioServerContext","attributes: Record<string, string | boolean>","server: McpServer","context: Context"],"sources":["../src/transports/stdio.ts"],"sourcesContent":["import type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\n/**\n * Standard I/O Transport for MCP Server.\n *\n * Provides stdio-based communication for the Sentry MCP server, typically used\n * when the server runs as a subprocess communicating via stdin/stdout pipes.\n *\n * @example Basic Usage\n * ```typescript\n * import { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\n * import { startStdio } from \"./transports/stdio.js\";\n *\n * const server = new Server();\n * const context = {\n * accessToken: process.env.SENTRY_TOKEN,\n * host: \"sentry.io\"\n * };\n *\n * await startStdio(server, context);\n * ```\n */\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport { LIB_VERSION } from \"@sentry/mcp-core/version\";\nimport * as Sentry from \"@sentry/node\";\n\nexport type StdioServerContext = {\n sentryHost?: string;\n mcpUrl?: string;\n agentMode?: boolean;\n experimentalMode?: boolean;\n};\n\nfunction getStdioSpanAttributes(\n context: StdioServerContext,\n): Record<string, string | boolean> {\n const attributes: Record<string, string | boolean> = {\n \"app.transport\": \"stdio\",\n \"app.server.version\": LIB_VERSION,\n \"app.server.mode.agent\": context.agentMode ?? false,\n \"app.server.mode.experimental\": context.experimentalMode ?? false,\n \"network.transport\": \"pipe\",\n \"service.version\": LIB_VERSION,\n };\n\n if (context.sentryHost) {\n attributes[\"app.upstream.host\"] = context.sentryHost;\n }\n if (context.mcpUrl) {\n attributes[\"app.url.full\"] = context.mcpUrl;\n }\n\n return attributes;\n}\n\n/**\n * Starts the MCP server with stdio transport and telemetry.\n *\n * Connects the server using stdio transport for process-based communication.\n * Context is already captured in tool handler closures during buildServer().\n * All operations are wrapped in Sentry tracing for observability.\n *\n * @param server - Configured and instrumented MCP server instance (with context in closures)\n * @param context - Context values used for telemetry attributes\n *\n * @example CLI Integration\n * ```typescript\n * import { buildServer } from \"./server.js\";\n * import { startStdio } from \"./transports/stdio.js\";\n *\n * const context = {\n * accessToken: userToken,\n * sentryHost: \"sentry.io\",\n * userId: \"user-123\",\n * clientId: \"cursor-ide\",\n * constraints: {}\n * };\n *\n * const server = buildServer({ context }); // Context captured in closures\n * await startStdio(server, context);\n * ```\n */\nexport async function startStdio<Context extends StdioServerContext>(\n server: McpServer,\n context: Context,\n) {\n await Sentry.startNewTrace(async () => {\n return await Sentry.startSpan(\n {\n name: \"mcp.server/stdio\",\n attributes: getStdioSpanAttributes(context),\n },\n async () => {\n // Context already captured in tool handler closures during buildServer()\n const transport = new StdioServerTransport();\n await server.connect(transport);\n },\n );\n });\n}\n"],"mappings":";;;;;AAgCA,SAAS,uBACPA,SACkC;CAClC,MAAMC,aAA+C;EACnD,iBAAiB;EACjB,sBAAsB;EACtB,yBAAyB,QAAQ,aAAa;EAC9C,gCAAgC,QAAQ,oBAAoB;EAC5D,qBAAqB;EACrB,mBAAmB;CACpB;AAED,KAAI,QAAQ,WACV,YAAW,uBAAuB,QAAQ;AAE5C,KAAI,QAAQ,OACV,YAAW,kBAAkB,QAAQ;AAGvC,QAAO;AACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BD,eAAsB,WACpBC,QACAC,SACA;AACA,OAAM,OAAO,cAAc,YAAY;AACrC,SAAO,MAAM,OAAO,UAClB;GACE,MAAM;GACN,YAAY,uBAAuB,QAAQ;EAC5C,GACD,YAAY;GAEV,MAAM,YAAY,IAAI;AACtB,SAAM,OAAO,QAAQ,UAAU;EAChC,EACF;CACF,EAAC;AACH"}
@@ -1,5 +1,6 @@
1
- import { __commonJS, require_token_error } from "./token-error-Df8A7mgb.js";
2
- import { require_token_util } from "./token-util-Dnkz6ExF.js";
1
+ import { __commonJS } from "./chunk-CunrlGP7.js";
2
+ import { require_token_error } from "./token-error-CBmJNKLY.js";
3
+ import { require_token_util } from "./token-util-batRsXGA.js";
3
4
 
4
5
  //#region ../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js
5
6
  var require_token = __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js"(exports, module) {
@@ -47,4 +48,4 @@ var require_token = __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.1.0/no
47
48
  //#endregion
48
49
  export default require_token();
49
50
 
50
- //# sourceMappingURL=token-YhriRz-K.js.map
51
+ //# sourceMappingURL=token-3xpHVxQo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"token-YhriRz-K.js","names":[],"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_exports = {};\n__export(token_exports, {\n refreshToken: () => refreshToken\n});\nmodule.exports = __toCommonJS(token_exports);\nvar import_token_error = require(\"./token-error\");\nvar import_token_util = require(\"./token-util\");\nasync function refreshToken() {\n const { projectId, teamId } = (0, import_token_util.findProjectInfo)();\n let maybeToken = (0, import_token_util.loadToken)(projectId);\n if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token))) {\n const authToken = await (0, import_token_util.getVercelCliToken)();\n if (!authToken) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`\"\n );\n }\n if (!projectId) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: Try re-linking your project with `vc link`\"\n );\n }\n maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);\n if (!maybeToken) {\n throw new import_token_error.VercelOidcTokenError(\"Failed to refresh OIDC token\");\n }\n (0, import_token_util.saveToken)(maybeToken, projectId);\n }\n process.env.VERCEL_OIDC_TOKEN = maybeToken.token;\n return;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n refreshToken\n});\n"],"x_google_ignoreList":[0],"mappings":";;;;;CACA,IAAI,YAAY,OAAO;CACvB,IAAI,mBAAmB,OAAO;CAC9B,IAAI,oBAAoB,OAAO;CAC/B,IAAI,eAAe,OAAO,UAAU;CACpC,IAAI,WAAW,CAAC,QAAQ,QAAQ;AAC9B,OAAK,IAAI,QAAQ,IACf,WAAU,QAAQ,MAAM;GAAE,KAAK,IAAI;GAAO,YAAY;EAAM,EAAC;CAChE;CACD,IAAI,cAAc,CAAC,IAAI,MAAM,QAAQ,SAAS;AAC5C,MAAI,eAAe,SAAS,mBAAmB,SAAS,YACtD;QAAK,IAAI,OAAO,kBAAkB,KAAK,CACrC,MAAK,aAAa,KAAK,IAAI,IAAI,IAAI,QAAQ,OACzC,WAAU,IAAI,KAAK;IAAE,KAAK,MAAM,KAAK;IAAM,cAAc,OAAO,iBAAiB,MAAM,IAAI,KAAK,KAAK;GAAY,EAAC;EAAC;AAEzH,SAAO;CACR;CACD,IAAI,eAAe,CAAC,QAAQ,YAAY,UAAU,CAAE,GAAE,cAAc,EAAE,OAAO,KAAM,EAAC,EAAE,IAAI;CAC1F,IAAI,gBAAgB,CAAE;AACtB,UAAS,eAAe,EACtB,cAAc,MAAM,aACrB,EAAC;AACF,QAAO,UAAU,aAAa,cAAc;CAC5C,IAAI;CACJ,IAAI;CACJ,eAAe,eAAe;EAC5B,MAAM,EAAE,WAAW,QAAQ,GAAG,CAAC,GAAG,kBAAkB,kBAAkB;EACtE,IAAI,aAAa,CAAC,GAAG,kBAAkB,WAAW,UAAU;AAC5D,OAAK,cAAc,CAAC,GAAG,kBAAkB,WAAW,CAAC,GAAG,kBAAkB,iBAAiB,WAAW,MAAM,CAAC,EAAE;GAC7G,MAAM,YAAY,MAAM,CAAC,GAAG,kBAAkB,oBAAoB;AAClE,QAAK,UACH,OAAM,IAAI,mBAAmB,qBAC3B;AAGJ,QAAK,UACH,OAAM,IAAI,mBAAmB,qBAC3B;AAGJ,gBAAa,MAAM,CAAC,GAAG,kBAAkB,oBAAoB,WAAW,WAAW,OAAO;AAC1F,QAAK,WACH,OAAM,IAAI,mBAAmB,qBAAqB;AAEpD,IAAC,GAAG,kBAAkB,WAAW,YAAY,UAAU;EACxD;AACD,UAAQ,IAAI,oBAAoB,WAAW;AAC3C;CACD"}
1
+ {"version":3,"file":"token-3xpHVxQo.js","names":[],"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar token_exports = {};\n__export(token_exports, {\n refreshToken: () => refreshToken\n});\nmodule.exports = __toCommonJS(token_exports);\nvar import_token_error = require(\"./token-error\");\nvar import_token_util = require(\"./token-util\");\nasync function refreshToken() {\n const { projectId, teamId } = (0, import_token_util.findProjectInfo)();\n let maybeToken = (0, import_token_util.loadToken)(projectId);\n if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token))) {\n const authToken = await (0, import_token_util.getVercelCliToken)();\n if (!authToken) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`\"\n );\n }\n if (!projectId) {\n throw new import_token_error.VercelOidcTokenError(\n \"Failed to refresh OIDC token: Try re-linking your project with `vc link`\"\n );\n }\n maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);\n if (!maybeToken) {\n throw new import_token_error.VercelOidcTokenError(\"Failed to refresh OIDC token\");\n }\n (0, import_token_util.saveToken)(maybeToken, projectId);\n }\n process.env.VERCEL_OIDC_TOKEN = maybeToken.token;\n return;\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n refreshToken\n});\n"],"x_google_ignoreList":[0],"mappings":";;;;;;CACA,IAAI,YAAY,OAAO;CACvB,IAAI,mBAAmB,OAAO;CAC9B,IAAI,oBAAoB,OAAO;CAC/B,IAAI,eAAe,OAAO,UAAU;CACpC,IAAI,WAAW,CAAC,QAAQ,QAAQ;AAC9B,OAAK,IAAI,QAAQ,IACf,WAAU,QAAQ,MAAM;GAAE,KAAK,IAAI;GAAO,YAAY;EAAM,EAAC;CAChE;CACD,IAAI,cAAc,CAAC,IAAI,MAAM,QAAQ,SAAS;AAC5C,MAAI,eAAe,SAAS,mBAAmB,SAAS,YACtD;QAAK,IAAI,OAAO,kBAAkB,KAAK,CACrC,MAAK,aAAa,KAAK,IAAI,IAAI,IAAI,QAAQ,OACzC,WAAU,IAAI,KAAK;IAAE,KAAK,MAAM,KAAK;IAAM,cAAc,OAAO,iBAAiB,MAAM,IAAI,KAAK,KAAK;GAAY,EAAC;EAAC;AAEzH,SAAO;CACR;CACD,IAAI,eAAe,CAAC,QAAQ,YAAY,UAAU,CAAE,GAAE,cAAc,EAAE,OAAO,KAAM,EAAC,EAAE,IAAI;CAC1F,IAAI,gBAAgB,CAAE;AACtB,UAAS,eAAe,EACtB,cAAc,MAAM,aACrB,EAAC;AACF,QAAO,UAAU,aAAa,cAAc;CAC5C,IAAI;CACJ,IAAI;CACJ,eAAe,eAAe;EAC5B,MAAM,EAAE,WAAW,QAAQ,GAAG,CAAC,GAAG,kBAAkB,kBAAkB;EACtE,IAAI,aAAa,CAAC,GAAG,kBAAkB,WAAW,UAAU;AAC5D,OAAK,cAAc,CAAC,GAAG,kBAAkB,WAAW,CAAC,GAAG,kBAAkB,iBAAiB,WAAW,MAAM,CAAC,EAAE;GAC7G,MAAM,YAAY,MAAM,CAAC,GAAG,kBAAkB,oBAAoB;AAClE,QAAK,UACH,OAAM,IAAI,mBAAmB,qBAC3B;AAGJ,QAAK,UACH,OAAM,IAAI,mBAAmB,qBAC3B;AAGJ,gBAAa,MAAM,CAAC,GAAG,kBAAkB,oBAAoB,WAAW,WAAW,OAAO;AAC1F,QAAK,WACH,OAAM,IAAI,mBAAmB,qBAAqB;AAEpD,IAAC,GAAG,kBAAkB,WAAW,YAAY,UAAU;EACxD;AACD,UAAQ,IAAI,oBAAoB,WAAW;AAC3C;CACD"}
@@ -1,6 +1,6 @@
1
1
  const require_chunk = require('./chunk-Cv9WC9bY.cjs');
2
2
  const require_token_error$1 = require('./token-error-x_miDBP3.cjs');
3
- const require_token_util$1 = require('./token-util-I45r8kkb.cjs');
3
+ const require_token_util$1 = require('./token-util-BRoQwIG6.cjs');
4
4
 
5
5
  //#region ../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js
6
6
  var require_token = require_chunk.__commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js"(exports, module) {
@@ -52,4 +52,4 @@ Object.defineProperty(exports, 'default', {
52
52
  return require_token();
53
53
  }
54
54
  });
55
- //# sourceMappingURL=token-URCv7LSS.cjs.map
55
+ //# sourceMappingURL=token-C7MavkKX.cjs.map