@sentry/mcp-server 0.33.0 → 0.35.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.
- package/dist/auth/constants.cjs +1 -1
- package/dist/auth/constants.js +1 -1
- package/dist/auth/device-code-flow.cjs +4 -4
- package/dist/auth/device-code-flow.d.ts +1 -1
- package/dist/auth/device-code-flow.js +4 -4
- package/dist/auth/resolve-token.cjs +6 -6
- package/dist/auth/resolve-token.d.ts +1 -1
- package/dist/auth/resolve-token.js +6 -6
- package/dist/auth/token-cache.cjs +1 -1
- package/dist/auth/token-cache.d.ts +1 -1
- package/dist/auth/token-cache.js +1 -1
- package/dist/auth/types.cjs +1 -1
- package/dist/auth/types.d.ts +1 -1
- package/dist/auth/types.js +1 -1
- package/dist/{auth-UwueZrbT.cjs → auth-DeUVu86q.cjs} +7 -7
- package/dist/{auth-UwueZrbT.cjs.map → auth-DeUVu86q.cjs.map} +1 -1
- package/dist/{auth-BJo6H1uD.js → auth-NuILycy3.js} +7 -7
- package/dist/{auth-BJo6H1uD.js.map → auth-NuILycy3.js.map} +1 -1
- package/dist/blob-utils-B9a20TSV.js +3 -0
- package/dist/blob-utils-CGHZbDNh-CN3juEJQ.cjs +66 -0
- package/dist/blob-utils-CGHZbDNh-CN3juEJQ.cjs.map +1 -0
- package/dist/blob-utils-CGHZbDNh-Dhzb2_wT.js +54 -0
- package/dist/blob-utils-CGHZbDNh-Dhzb2_wT.js.map +1 -0
- package/dist/blob-utils-dQmZRlIb.cjs +3 -0
- package/dist/cli/commands/auth.cjs +8 -8
- package/dist/cli/commands/auth.js +8 -8
- package/dist/cli/parse.cjs +1 -1
- package/dist/cli/parse.d.ts +1 -1
- package/dist/cli/parse.js +1 -1
- package/dist/cli/resolve.cjs +2 -2
- package/dist/cli/resolve.d.ts +1 -1
- package/dist/cli/resolve.js +2 -2
- package/dist/cli/types.d.ts +1 -1
- package/dist/cli/usage.cjs +1 -1
- package/dist/cli/usage.js +1 -1
- package/dist/{config-k-CwrU2A.js → config-Bnslg67w.js} +1 -1
- package/dist/config-IA5hZFjI.cjs +7 -0
- package/dist/{config-CSIYxVpS-ClZCOpEv.cjs → config-YHBj037H-DI-vM9pT.cjs} +21 -14
- package/dist/config-YHBj037H-DI-vM9pT.cjs.map +1 -0
- package/dist/{config-CSIYxVpS-cfJbXQHs.js → config-YHBj037H-DRbUBG2X.js} +21 -14
- package/dist/config-YHBj037H-DRbUBG2X.js.map +1 -0
- package/dist/{constants-wVeitIuo.cjs → constants-Bgs-7WBj.cjs} +19 -3
- package/dist/constants-Bgs-7WBj.cjs.map +1 -0
- package/dist/{constants-DjY87Pdc.js → constants-BjQ5jCEg.js} +14 -4
- package/dist/constants-BjQ5jCEg.js.map +1 -0
- package/dist/{device-code-flow-BJxgQqnk.js → device-code-flow-CltWJnOC.js} +4 -4
- package/dist/{device-code-flow-BJxgQqnk.js.map → device-code-flow-CltWJnOC.js.map} +1 -1
- package/dist/{device-code-flow-BMOB5yEt.cjs → device-code-flow-b6KaQzNJ.cjs} +4 -4
- package/dist/{device-code-flow-BMOB5yEt.cjs.map → device-code-flow-b6KaQzNJ.cjs.map} +1 -1
- package/dist/index.cjs +20936 -19667
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +20935 -19666
- package/dist/index.js.map +1 -1
- package/dist/{parse-B7klESpr.js → parse-BSFxOAQG.js} +1 -1
- package/dist/{parse-B7klESpr.js.map → parse-BSFxOAQG.js.map} +1 -1
- package/dist/{parse-BR-mFmYz.cjs → parse-BTaa9TK5.cjs} +1 -1
- package/dist/{parse-BR-mFmYz.cjs.map → parse-BTaa9TK5.cjs.map} +1 -1
- package/dist/{resolve-C24qYHAk.cjs → resolve-D4TZw-d-.cjs} +10 -3
- package/dist/resolve-D4TZw-d-.cjs.map +1 -0
- package/dist/{resolve-BrniID8M.js → resolve-D9XJMdCX.js} +10 -3
- package/dist/resolve-D9XJMdCX.js.map +1 -0
- package/dist/{resolve-token-ZTTdPX3U.cjs → resolve-token-BfHulcsU.cjs} +5 -5
- package/dist/{resolve-token-ZTTdPX3U.cjs.map → resolve-token-BfHulcsU.cjs.map} +1 -1
- package/dist/{resolve-token-xrdqUeT7.js → resolve-token-DitlJMRA.js} +5 -5
- package/dist/{resolve-token-xrdqUeT7.js.map → resolve-token-DitlJMRA.js.map} +1 -1
- package/dist/{stdio-CMTtwTjK.cjs → stdio-CHTzpWeM.cjs} +3 -3
- package/dist/{stdio-CMTtwTjK.cjs.map → stdio-CHTzpWeM.cjs.map} +1 -1
- package/dist/{stdio-CrPIATQh.js → stdio-Eif0LiAU.js} +3 -3
- package/dist/{stdio-CrPIATQh.js.map → stdio-Eif0LiAU.js.map} +1 -1
- package/dist/{token-Dx4qrxlx.cjs → token-URCv7LSS.cjs} +2 -2
- package/dist/{token-Dx4qrxlx.cjs.map → token-URCv7LSS.cjs.map} +1 -1
- package/dist/{token-D7eiINbV.js → token-YhriRz-K.js} +2 -2
- package/dist/{token-D7eiINbV.js.map → token-YhriRz-K.js.map} +1 -1
- package/dist/{token-cache-iqkTOca3.cjs → token-cache-914WGYb3.cjs} +1 -1
- package/dist/{token-cache-iqkTOca3.cjs.map → token-cache-914WGYb3.cjs.map} +1 -1
- package/dist/{token-cache-BTEUyVx2.js → token-cache-DHBN2ixb.js} +1 -1
- package/dist/{token-cache-BTEUyVx2.js.map → token-cache-DHBN2ixb.js.map} +1 -1
- package/dist/{token-util-DtX1UM9f.js → token-util-7XgZqk3d.js} +1 -1
- package/dist/{token-util-bEa_1v46.cjs → token-util-B-ZIWywO.cjs} +1 -1
- package/dist/{token-util-VkLmCUNV.js → token-util-Dnkz6ExF.js} +1 -1
- package/dist/{token-util-VkLmCUNV.js.map → token-util-Dnkz6ExF.js.map} +1 -1
- package/dist/{token-util-oe0G9a-s.cjs → token-util-I45r8kkb.cjs} +1 -1
- package/dist/{token-util-oe0G9a-s.cjs.map → token-util-I45r8kkb.cjs.map} +1 -1
- package/dist/transports/stdio.cjs +2 -2
- package/dist/transports/stdio.js +2 -2
- package/dist/{types-DEixQGjv.d.ts → types-BdLzKRyK.d.ts} +1 -1
- package/dist/{types-DEixQGjv.d.ts.map → types-BdLzKRyK.d.ts.map} +1 -1
- package/dist/{types-DDkgkRP9.d.ts → types-C0xriI9T.d.ts} +1 -1
- package/dist/{types-DDkgkRP9.d.ts.map → types-C0xriI9T.d.ts.map} +1 -1
- package/dist/{types-DViCeKUc.cjs → types-CxTPg1vE.cjs} +1 -1
- package/dist/{types-DViCeKUc.cjs.map → types-CxTPg1vE.cjs.map} +1 -1
- package/dist/{types-C336ZSwF.js → types-nsyASfJr.js} +1 -1
- package/dist/{types-C336ZSwF.js.map → types-nsyASfJr.js.map} +1 -1
- package/dist/{usage-CJXm-LBM.js → usage-CyXue87B.js} +1 -1
- package/dist/{usage-CJXm-LBM.js.map → usage-CyXue87B.js.map} +1 -1
- package/dist/{usage-5IJewEUC.cjs → usage-WAgAGh1G.cjs} +1 -1
- package/dist/{usage-5IJewEUC.cjs.map → usage-WAgAGh1G.cjs.map} +1 -1
- package/dist/version-BbMRHfZS.js +7 -0
- package/dist/version-BbMRHfZS.js.map +1 -0
- package/dist/{version-CG1gvrBK.cjs → version-BsYB56vP.cjs} +3 -3
- package/dist/version-BsYB56vP.cjs.map +1 -0
- package/package.json +4 -4
- package/dist/config-CSIYxVpS-ClZCOpEv.cjs.map +0 -1
- package/dist/config-CSIYxVpS-cfJbXQHs.js.map +0 -1
- package/dist/config-gtQq2u0M.cjs +0 -7
- package/dist/constants-DjY87Pdc.js.map +0 -1
- package/dist/constants-wVeitIuo.cjs.map +0 -1
- package/dist/resolve-BrniID8M.js.map +0 -1
- package/dist/resolve-C24qYHAk.cjs.map +0 -1
- package/dist/version-C-VwoRFq.js +0 -7
- package/dist/version-C-VwoRFq.js.map +0 -1
- package/dist/version-CG1gvrBK.cjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-
|
|
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,OAAO,EAAE,MAAM,UAAoB;EACnC,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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,SAAmB;EAC3C,QAAQ,EAAE,MAAM,SAAmB;EACnC,kBAAkB,EAAE,MAAM,SAAmB;EAC7C,OAAO,EAAE,MAA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|
|
1
|
+
const require_constants = require('./constants-Bgs-7WBj.cjs');
|
|
2
2
|
|
|
3
|
-
//#region ../mcp-core/dist/skills-
|
|
3
|
+
//#region ../mcp-core/dist/skills-C74pcZxh.js
|
|
4
4
|
const SKILLS = {
|
|
5
5
|
inspect: {
|
|
6
6
|
id: "inspect",
|
|
@@ -36,6 +36,13 @@ const SKILLS = {
|
|
|
36
36
|
description: "Create and modify projects, teams, and DSNs",
|
|
37
37
|
defaultEnabled: false,
|
|
38
38
|
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
|
|
39
46
|
}
|
|
40
47
|
};
|
|
41
48
|
const SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);
|
|
@@ -169,4 +176,4 @@ Object.defineProperty(exports, 'resolveHost', {
|
|
|
169
176
|
return resolveHost;
|
|
170
177
|
}
|
|
171
178
|
});
|
|
172
|
-
//# sourceMappingURL=resolve-
|
|
179
|
+
//# sourceMappingURL=resolve-D4TZw-d-.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-D4TZw-d-.cjs","names":["invalid: string[]","source?: string","url?: string","host?: string","input: MergedArgs","finalSkills: Set<Skill>","agentProvider: \"openai\" | \"azure-openai\" | \"anthropic\" | undefined","DEFAULT_SENTRY_CLIENT_ID"],"sources":["../../mcp-core/dist/skills-C74pcZxh.js","../src/cli/resolve.ts"],"sourcesContent":["//#region src/skills.ts\nconst SKILLS = {\n\tinspect: {\n\t\tid: \"inspect\",\n\t\tname: \"Inspect Issues & Events\",\n\t\tdescription: \"Search for errors, analyze traces, and explore event details\",\n\t\tdefaultEnabled: true,\n\t\torder: 1\n\t},\n\tseer: {\n\t\tid: \"seer\",\n\t\tname: \"Seer\",\n\t\tdescription: \"Sentry's AI debugger that helps you analyze, root cause, and fix issues\",\n\t\tdefaultEnabled: true,\n\t\torder: 2\n\t},\n\tdocs: {\n\t\tid: \"docs\",\n\t\tname: \"Documentation\",\n\t\tdescription: \"Search and read Sentry SDK documentation\",\n\t\tdefaultEnabled: false,\n\t\torder: 3\n\t},\n\ttriage: {\n\t\tid: \"triage\",\n\t\tname: \"Triage Issues\",\n\t\tdescription: \"Resolve, assign, and update issues\",\n\t\tdefaultEnabled: false,\n\t\torder: 4\n\t},\n\t\"project-management\": {\n\t\tid: \"project-management\",\n\t\tname: \"Manage Projects & Teams\",\n\t\tdescription: \"Create and modify projects, teams, and DSNs\",\n\t\tdefaultEnabled: false,\n\t\torder: 5\n\t},\n\tpreprod: {\n\t\tid: \"preprod\",\n\t\tname: \"Preprod Snapshots\",\n\t\tdescription: \"Inspect visual regression snapshot tests from CI — view changed images and diff masks\",\n\t\tdefaultEnabled: false,\n\t\torder: 6\n\t}\n};\nconst SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);\nasync function getSkillsArrayWithCounts() {\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst tools = toolsModule.default;\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const skill of Object.keys(SKILLS)) counts.set(skill, 0);\n\tfor (const tool of Object.values(tools)) {\n\t\tif (tool.internalOnly) continue;\n\t\tif (Array.isArray(tool.skills)) for (const skill of tool.skills) counts.set(skill, (counts.get(skill) || 0) + 1);\n\t}\n\treturn SKILLS_ARRAY.map((skill) => ({\n\t\t...skill,\n\t\ttoolCount: counts.get(skill.id) || 0\n\t}));\n}\nconst ALL_SKILLS = Object.keys(SKILLS);\nconst DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);\nfunction isValidSkill(skill) {\n\treturn skill in SKILLS;\n}\nfunction isEnabledBySkills(grantedSkills, toolSkills) {\n\tif (!grantedSkills || toolSkills.length === 0) return false;\n\treturn toolSkills.some((skill) => grantedSkills.has(skill));\n}\nfunction parseSkills(input) {\n\tconst valid = /* @__PURE__ */ new Set();\n\tconst invalid = [];\n\tif (!input) return {\n\t\tvalid,\n\t\tinvalid\n\t};\n\tlet skills = [];\n\tif (typeof input === \"string\") skills = input.split(\",\");\n\telse if (Array.isArray(input)) skills = input.map((v) => typeof v === \"string\" ? v : \"\");\n\tfor (const skill of skills) {\n\t\tconst trimmed = String(skill).trim();\n\t\tif (isValidSkill(trimmed)) valid.add(trimmed);\n\t\telse if (trimmed) invalid.push(trimmed);\n\t}\n\treturn {\n\t\tvalid,\n\t\tinvalid\n\t};\n}\nasync function getScopesForSkills(grantedSkills) {\n\tconst { DEFAULT_SCOPES } = await import(\"./constants.js\");\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst tools = toolsModule.default;\n\tconst scopes = new Set(DEFAULT_SCOPES);\n\tfor (const tool of Object.values(tools)) {\n\t\tif (tool.internalOnly) continue;\n\t\tconst toolEnabled = tool.skills.some((skill) => grantedSkills.has(skill));\n\t\tif (toolEnabled) for (const scope of tool.requiredScopes) scopes.add(scope);\n\t}\n\treturn scopes;\n}\n\n//#endregion\nexport { ALL_SKILLS, DEFAULT_SKILLS, SKILLS, SKILLS_ARRAY, getScopesForSkills, getSkillsArrayWithCounts, isEnabledBySkills, isValidSkill, parseSkills };\n//# sourceMappingURL=skills-C74pcZxh.js.map","import { ALL_SKILLS, parseSkills, type Skill } 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 skills when no --skills flag is provided\n //\n // This differs from the OAuth flow, which requires explicit user selection:\n // - stdio/CLI: Non-interactive, defaults to ALL skills (inspect, docs, seer, triage, project-management)\n // - OAuth: Interactive, requires user to explicitly select skills (with sensible defaults pre-checked)\n //\n // Rationale:\n // We don't want the MCP to break if users don't specify skills. stdio is typically used in\n // local development and CI/CD environments where maximum access by default is expected.\n // OAuth is used in multi-tenant hosted environments where users should consciously grant\n // permissions on a per-app basis.\n //\n // For OAuth validation that enforces minimum 1 skill selection, see:\n // packages/mcp-cloudflare/src/server/oauth/routes/callback.ts (lines 234-248)\n //\n let finalSkills: Set<Skill>;\n if (input.skills) {\n // Override: use only the specified skills\n const { valid, invalid } = parseSkills(input.skills);\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid));\n }\n if (valid.size === 0) {\n throw new Error(\"Error: Invalid skills provided. No valid skills found.\");\n }\n finalSkills = valid;\n } else {\n // Default: grant ALL skills when no flag is provided (see comment block above for rationale)\n finalSkills = new Set<Skill>(ALL_SKILLS);\n }\n\n // Disable-skills: remove specific skills from the active set\n if (input.disableSkills) {\n const { valid: skillsToDisable, invalid } = parseSkills(\n input.disableSkills,\n );\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid, \"--disable-skills\"));\n }\n for (const skill of skillsToDisable) {\n finalSkills.delete(skill);\n }\n if (finalSkills.size === 0) {\n throw new Error(\n \"Error: All skills have been disabled. At least one skill must remain enabled.\",\n );\n }\n }\n\n const resolvedOpenAiBaseUrl = input.openaiBaseUrl\n ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl)\n : undefined;\n\n // Validate anthropic base URL if provided (same validation as OpenAI)\n const resolvedAnthropicBaseUrl = input.anthropicBaseUrl\n ? validateOpenAiBaseUrlThrows(input.anthropicBaseUrl)\n : undefined;\n\n // Validate agent provider if explicitly set\n let agentProvider: \"openai\" | \"azure-openai\" | \"anthropic\" | undefined =\n undefined;\n if (input.agentProvider) {\n const provider = input.agentProvider.toLowerCase();\n if (\n provider !== \"openai\" &&\n provider !== \"azure-openai\" &&\n provider !== \"anthropic\"\n ) {\n throw new Error(\n `Error: Invalid agent provider \"${input.agentProvider}\". Must be \"openai\", \"azure-openai\", or \"anthropic\".`,\n );\n }\n agentProvider = provider;\n }\n\n return {\n accessToken: input.accessToken,\n clientId: input.clientId || DEFAULT_SENTRY_CLIENT_ID,\n sentryHost,\n 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;EACh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,YACb,aAAa,kBACb,aAAa,YAEb,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,6 +1,6 @@
|
|
|
1
|
-
import { DEFAULT_SENTRY_CLIENT_ID, isSentryHost, validateAndParseSentryUrlThrows, validateOpenAiBaseUrlThrows, validateSentryHostThrows } from "./constants-
|
|
1
|
+
import { DEFAULT_SENTRY_CLIENT_ID, isSentryHost, validateAndParseSentryUrlThrows, validateOpenAiBaseUrlThrows, validateSentryHostThrows } from "./constants-BjQ5jCEg.js";
|
|
2
2
|
|
|
3
|
-
//#region ../mcp-core/dist/skills-
|
|
3
|
+
//#region ../mcp-core/dist/skills-C74pcZxh.js
|
|
4
4
|
const SKILLS = {
|
|
5
5
|
inspect: {
|
|
6
6
|
id: "inspect",
|
|
@@ -36,6 +36,13 @@ const SKILLS = {
|
|
|
36
36
|
description: "Create and modify projects, teams, and DSNs",
|
|
37
37
|
defaultEnabled: false,
|
|
38
38
|
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
|
|
39
46
|
}
|
|
40
47
|
};
|
|
41
48
|
const SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);
|
|
@@ -134,4 +141,4 @@ function finalize(input) {
|
|
|
134
141
|
|
|
135
142
|
//#endregion
|
|
136
143
|
export { ALL_SKILLS, SKILLS, finalize, formatInvalidSkills, isEnabledBySkills, resolveHost };
|
|
137
|
-
//# sourceMappingURL=resolve-
|
|
144
|
+
//# sourceMappingURL=resolve-D9XJMdCX.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-D9XJMdCX.js","names":["invalid: string[]","source?: string","url?: string","host?: string","input: MergedArgs","finalSkills: Set<Skill>","agentProvider: \"openai\" | \"azure-openai\" | \"anthropic\" | undefined"],"sources":["../../mcp-core/dist/skills-C74pcZxh.js","../src/cli/resolve.ts"],"sourcesContent":["//#region src/skills.ts\nconst SKILLS = {\n\tinspect: {\n\t\tid: \"inspect\",\n\t\tname: \"Inspect Issues & Events\",\n\t\tdescription: \"Search for errors, analyze traces, and explore event details\",\n\t\tdefaultEnabled: true,\n\t\torder: 1\n\t},\n\tseer: {\n\t\tid: \"seer\",\n\t\tname: \"Seer\",\n\t\tdescription: \"Sentry's AI debugger that helps you analyze, root cause, and fix issues\",\n\t\tdefaultEnabled: true,\n\t\torder: 2\n\t},\n\tdocs: {\n\t\tid: \"docs\",\n\t\tname: \"Documentation\",\n\t\tdescription: \"Search and read Sentry SDK documentation\",\n\t\tdefaultEnabled: false,\n\t\torder: 3\n\t},\n\ttriage: {\n\t\tid: \"triage\",\n\t\tname: \"Triage Issues\",\n\t\tdescription: \"Resolve, assign, and update issues\",\n\t\tdefaultEnabled: false,\n\t\torder: 4\n\t},\n\t\"project-management\": {\n\t\tid: \"project-management\",\n\t\tname: \"Manage Projects & Teams\",\n\t\tdescription: \"Create and modify projects, teams, and DSNs\",\n\t\tdefaultEnabled: false,\n\t\torder: 5\n\t},\n\tpreprod: {\n\t\tid: \"preprod\",\n\t\tname: \"Preprod Snapshots\",\n\t\tdescription: \"Inspect visual regression snapshot tests from CI — view changed images and diff masks\",\n\t\tdefaultEnabled: false,\n\t\torder: 6\n\t}\n};\nconst SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);\nasync function getSkillsArrayWithCounts() {\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst tools = toolsModule.default;\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const skill of Object.keys(SKILLS)) counts.set(skill, 0);\n\tfor (const tool of Object.values(tools)) {\n\t\tif (tool.internalOnly) continue;\n\t\tif (Array.isArray(tool.skills)) for (const skill of tool.skills) counts.set(skill, (counts.get(skill) || 0) + 1);\n\t}\n\treturn SKILLS_ARRAY.map((skill) => ({\n\t\t...skill,\n\t\ttoolCount: counts.get(skill.id) || 0\n\t}));\n}\nconst ALL_SKILLS = Object.keys(SKILLS);\nconst DEFAULT_SKILLS = SKILLS_ARRAY.filter((s) => s.defaultEnabled).map((s) => s.id);\nfunction isValidSkill(skill) {\n\treturn skill in SKILLS;\n}\nfunction isEnabledBySkills(grantedSkills, toolSkills) {\n\tif (!grantedSkills || toolSkills.length === 0) return false;\n\treturn toolSkills.some((skill) => grantedSkills.has(skill));\n}\nfunction parseSkills(input) {\n\tconst valid = /* @__PURE__ */ new Set();\n\tconst invalid = [];\n\tif (!input) return {\n\t\tvalid,\n\t\tinvalid\n\t};\n\tlet skills = [];\n\tif (typeof input === \"string\") skills = input.split(\",\");\n\telse if (Array.isArray(input)) skills = input.map((v) => typeof v === \"string\" ? v : \"\");\n\tfor (const skill of skills) {\n\t\tconst trimmed = String(skill).trim();\n\t\tif (isValidSkill(trimmed)) valid.add(trimmed);\n\t\telse if (trimmed) invalid.push(trimmed);\n\t}\n\treturn {\n\t\tvalid,\n\t\tinvalid\n\t};\n}\nasync function getScopesForSkills(grantedSkills) {\n\tconst { DEFAULT_SCOPES } = await import(\"./constants.js\");\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst tools = toolsModule.default;\n\tconst scopes = new Set(DEFAULT_SCOPES);\n\tfor (const tool of Object.values(tools)) {\n\t\tif (tool.internalOnly) continue;\n\t\tconst toolEnabled = tool.skills.some((skill) => grantedSkills.has(skill));\n\t\tif (toolEnabled) for (const scope of tool.requiredScopes) scopes.add(scope);\n\t}\n\treturn scopes;\n}\n\n//#endregion\nexport { ALL_SKILLS, DEFAULT_SKILLS, SKILLS, SKILLS_ARRAY, getScopesForSkills, getSkillsArrayWithCounts, isEnabledBySkills, isValidSkill, parseSkills };\n//# sourceMappingURL=skills-C74pcZxh.js.map","import { ALL_SKILLS, parseSkills, type Skill } 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 skills when no --skills flag is provided\n //\n // This differs from the OAuth flow, which requires explicit user selection:\n // - stdio/CLI: Non-interactive, defaults to ALL skills (inspect, docs, seer, triage, project-management)\n // - OAuth: Interactive, requires user to explicitly select skills (with sensible defaults pre-checked)\n //\n // Rationale:\n // We don't want the MCP to break if users don't specify skills. stdio is typically used in\n // local development and CI/CD environments where maximum access by default is expected.\n // OAuth is used in multi-tenant hosted environments where users should consciously grant\n // permissions on a per-app basis.\n //\n // For OAuth validation that enforces minimum 1 skill selection, see:\n // packages/mcp-cloudflare/src/server/oauth/routes/callback.ts (lines 234-248)\n //\n let finalSkills: Set<Skill>;\n if (input.skills) {\n // Override: use only the specified skills\n const { valid, invalid } = parseSkills(input.skills);\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid));\n }\n if (valid.size === 0) {\n throw new Error(\"Error: Invalid skills provided. No valid skills found.\");\n }\n finalSkills = valid;\n } else {\n // Default: grant ALL skills when no flag is provided (see comment block above for rationale)\n finalSkills = new Set<Skill>(ALL_SKILLS);\n }\n\n // Disable-skills: remove specific skills from the active set\n if (input.disableSkills) {\n const { valid: skillsToDisable, invalid } = parseSkills(\n input.disableSkills,\n );\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid, \"--disable-skills\"));\n }\n for (const skill of skillsToDisable) {\n finalSkills.delete(skill);\n }\n if (finalSkills.size === 0) {\n throw new Error(\n \"Error: All skills have been disabled. At least one skill must remain enabled.\",\n );\n }\n }\n\n const resolvedOpenAiBaseUrl = input.openaiBaseUrl\n ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl)\n : undefined;\n\n // Validate anthropic base URL if provided (same validation as OpenAI)\n const resolvedAnthropicBaseUrl = input.anthropicBaseUrl\n ? validateOpenAiBaseUrlThrows(input.anthropicBaseUrl)\n : undefined;\n\n // Validate agent provider if explicitly set\n let agentProvider: \"openai\" | \"azure-openai\" | \"anthropic\" | undefined =\n undefined;\n if (input.agentProvider) {\n const provider = input.agentProvider.toLowerCase();\n if (\n provider !== \"openai\" &&\n provider !== \"azure-openai\" &&\n provider !== \"anthropic\"\n ) {\n throw new Error(\n `Error: Invalid agent provider \"${input.agentProvider}\". Must be \"openai\", \"azure-openai\", or \"anthropic\".`,\n );\n }\n agentProvider = provider;\n }\n\n return {\n accessToken: input.accessToken,\n clientId: input.clientId || DEFAULT_SENTRY_CLIENT_ID,\n sentryHost,\n 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,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;CACD,SAAS;EACR,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;AACD;AACD,MAAM,eAAe,OAAO,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM;AAe5E,MAAM,aAAa,OAAO,KAAK,OAAO;AACtC,MAAM,iBAAiB,aAAa,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG;AACpF,SAAS,aAAa,OAAO;AAC5B,QAAO,SAAS;AAChB;AACD,SAAS,kBAAkB,eAAe,YAAY;AACrD,MAAK,iBAAiB,WAAW,WAAW,EAAG,QAAO;AACtD,QAAO,WAAW,KAAK,CAAC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AAS,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;AAEJ,KAAI,MAAM,eAAe;EACvB,MAAM,WAAW,MAAM,cAAc,aAAa;AAClD,MACE,aAAa,YACb,aAAa,kBACb,aAAa,YAEb,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,7 +1,7 @@
|
|
|
1
|
-
const require_constants = require('./constants-
|
|
2
|
-
const require_types = require('./types-
|
|
3
|
-
const require_device_code_flow = require('./device-code-flow-
|
|
4
|
-
const require_token_cache = require('./token-cache-
|
|
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');
|
|
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-
|
|
52
|
+
//# sourceMappingURL=resolve-token-BfHulcsU.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-token-
|
|
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,7 +1,7 @@
|
|
|
1
|
-
import { OAUTH_HOST, isSentryHost } from "./constants-
|
|
2
|
-
import { toCachedToken } from "./types-
|
|
3
|
-
import { authenticate } from "./device-code-flow-
|
|
4
|
-
import { readCachedToken, writeCachedToken } from "./token-cache-
|
|
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";
|
|
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-
|
|
47
|
+
//# sourceMappingURL=resolve-token-DitlJMRA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-token-
|
|
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,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require('./chunk-Cv9WC9bY.cjs');
|
|
2
|
-
const require_version = require('./version-
|
|
2
|
+
const require_version = require('./version-BsYB56vP.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
|
|
|
@@ -36,7 +36,7 @@ async function startStdio(server, context) {
|
|
|
36
36
|
return await __sentry_node.startSpan({
|
|
37
37
|
name: "mcp.server/stdio",
|
|
38
38
|
attributes: {
|
|
39
|
-
"
|
|
39
|
+
"app.transport": "stdio",
|
|
40
40
|
"network.transport": "pipe",
|
|
41
41
|
"service.version": require_version.LIB_VERSION
|
|
42
42
|
}
|
|
@@ -54,4 +54,4 @@ Object.defineProperty(exports, 'startStdio', {
|
|
|
54
54
|
return startStdio;
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
|
-
//# sourceMappingURL=stdio-
|
|
57
|
+
//# sourceMappingURL=stdio-CHTzpWeM.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio-
|
|
1
|
+
{"version":3,"file":"stdio-CHTzpWeM.cjs","names":["server: McpServer","context: ServerContext","LIB_VERSION","StdioServerTransport"],"sources":["../src/transports/stdio.ts"],"sourcesContent":["/**\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 type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport * as Sentry from \"@sentry/node\";\nimport { LIB_VERSION } from \"@sentry/mcp-core/version\";\nimport type { ServerContext } from \"@sentry/mcp-core/types\";\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 - Server context with authentication and configuration (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(server: McpServer, context: ServerContext) {\n await Sentry.startNewTrace(async () => {\n return await Sentry.startSpan(\n {\n name: \"mcp.server/stdio\",\n attributes: {\n \"app.transport\": \"stdio\",\n \"network.transport\": \"pipe\",\n \"service.version\": LIB_VERSION,\n },\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,eAAsB,WAAWA,QAAmBC,SAAwB;AAC1E,OAAM,cAAO,cAAc,YAAY;AACrC,SAAO,MAAM,cAAO,UAClB;GACE,MAAM;GACN,YAAY;IACV,iBAAiB;IACjB,qBAAqB;IACrB,mBAAmBC;GACpB;EACF,GACD,YAAY;GAEV,MAAM,YAAY,IAAIC;AACtB,SAAM,OAAO,QAAQ,UAAU;EAChC,EACF;CACF,EAAC;AACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LIB_VERSION } from "./version-
|
|
1
|
+
import { LIB_VERSION } from "./version-BbMRHfZS.js";
|
|
2
2
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
3
3
|
import * as Sentry from "@sentry/node";
|
|
4
4
|
|
|
@@ -35,7 +35,7 @@ async function startStdio(server, context) {
|
|
|
35
35
|
return await Sentry.startSpan({
|
|
36
36
|
name: "mcp.server/stdio",
|
|
37
37
|
attributes: {
|
|
38
|
-
"
|
|
38
|
+
"app.transport": "stdio",
|
|
39
39
|
"network.transport": "pipe",
|
|
40
40
|
"service.version": LIB_VERSION
|
|
41
41
|
}
|
|
@@ -48,4 +48,4 @@ async function startStdio(server, context) {
|
|
|
48
48
|
|
|
49
49
|
//#endregion
|
|
50
50
|
export { startStdio };
|
|
51
|
-
//# sourceMappingURL=stdio-
|
|
51
|
+
//# sourceMappingURL=stdio-Eif0LiAU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio-
|
|
1
|
+
{"version":3,"file":"stdio-Eif0LiAU.js","names":["server: McpServer","context: ServerContext"],"sources":["../src/transports/stdio.ts"],"sourcesContent":["/**\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 type { McpServer } from \"@modelcontextprotocol/sdk/server/mcp.js\";\nimport * as Sentry from \"@sentry/node\";\nimport { LIB_VERSION } from \"@sentry/mcp-core/version\";\nimport type { ServerContext } from \"@sentry/mcp-core/types\";\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 - Server context with authentication and configuration (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(server: McpServer, context: ServerContext) {\n await Sentry.startNewTrace(async () => {\n return await Sentry.startSpan(\n {\n name: \"mcp.server/stdio\",\n attributes: {\n \"app.transport\": \"stdio\",\n \"network.transport\": \"pipe\",\n \"service.version\": LIB_VERSION,\n },\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,eAAsB,WAAWA,QAAmBC,SAAwB;AAC1E,OAAM,OAAO,cAAc,YAAY;AACrC,SAAO,MAAM,OAAO,UAClB;GACE,MAAM;GACN,YAAY;IACV,iBAAiB;IACjB,qBAAqB;IACrB,mBAAmB;GACpB;EACF,GACD,YAAY;GAEV,MAAM,YAAY,IAAI;AACtB,SAAM,OAAO,QAAQ,UAAU;EAChC,EACF;CACF,EAAC;AACH"}
|
|
@@ -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-
|
|
3
|
+
const require_token_util$1 = require('./token-util-I45r8kkb.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-
|
|
55
|
+
//# sourceMappingURL=token-URCv7LSS.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-
|
|
1
|
+
{"version":3,"file":"token-URCv7LSS.cjs","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,5 +1,5 @@
|
|
|
1
1
|
import { __commonJS, require_token_error } from "./token-error-Df8A7mgb.js";
|
|
2
|
-
import { require_token_util } from "./token-util-
|
|
2
|
+
import { require_token_util } from "./token-util-Dnkz6ExF.js";
|
|
3
3
|
|
|
4
4
|
//#region ../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js
|
|
5
5
|
var require_token = __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js"(exports, module) {
|
|
@@ -47,4 +47,4 @@ var require_token = __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.1.0/no
|
|
|
47
47
|
//#endregion
|
|
48
48
|
export default require_token();
|
|
49
49
|
|
|
50
|
-
//# sourceMappingURL=token-
|
|
50
|
+
//# sourceMappingURL=token-YhriRz-K.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-
|
|
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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-cache-
|
|
1
|
+
{"version":3,"file":"token-cache-914WGYb3.cjs","names":["host: string","clientId: string","data: CacheFile","token: CachedToken"],"sources":["../src/auth/token-cache.ts"],"sourcesContent":["/**\n * Persistent token cache for device code auth.\n * Tokens are stored at ~/.sentry/mcp.json, keyed by {host}:{clientId}.\n * See docs/stdio-auth.md for cache format and security details.\n */\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport * as os from \"node:os\";\nimport type { CachedToken } from \"./types\";\n\n/** Safety window: treat tokens as expired 5 minutes before actual expiry. */\nconst EXPIRY_SAFETY_MS = 5 * 60 * 1000;\n\nfunction getCacheFilePath(): string {\n if (process.env.SENTRY_MCP_AUTH_CACHE) {\n return process.env.SENTRY_MCP_AUTH_CACHE;\n }\n return path.join(os.homedir(), \".sentry\", \"mcp.json\");\n}\n\nfunction cacheKey(host: string, clientId: string): string {\n return `${host}:${clientId}`;\n}\n\ntype CacheFile = Record<string, CachedToken>;\n\nasync function readCacheFile(): Promise<CacheFile> {\n try {\n const raw = await fs.readFile(getCacheFilePath(), \"utf-8\");\n return JSON.parse(raw) as CacheFile;\n } catch {\n return {};\n }\n}\n\nasync function writeCacheFile(data: CacheFile): Promise<void> {\n const filePath = getCacheFilePath();\n const dir = path.dirname(filePath);\n\n await fs.mkdir(dir, { recursive: true, mode: 0o700 });\n\n // Atomic write: write to temp file then rename\n const tmpPath = `${filePath}.tmp.${process.pid}`;\n await fs.writeFile(tmpPath, JSON.stringify(data, null, 2), {\n encoding: \"utf-8\",\n mode: 0o600,\n });\n await fs.rename(tmpPath, filePath);\n}\n\nexport async function readCachedToken(\n host: string,\n clientId: string,\n): Promise<CachedToken | null> {\n const data = await readCacheFile();\n const key = cacheKey(host, clientId);\n const entry = data[key];\n if (!entry) return null;\n\n const expiresAt = new Date(entry.expires_at).getTime();\n if (\n !Number.isFinite(expiresAt) ||\n expiresAt - Date.now() <= EXPIRY_SAFETY_MS\n ) {\n delete data[key];\n await writeCacheFile(data);\n return null;\n }\n\n return entry;\n}\n\nexport async function writeCachedToken(token: CachedToken): Promise<void> {\n const data = await readCacheFile();\n data[cacheKey(token.sentry_host, token.client_id)] = token;\n await writeCacheFile(data);\n}\n\nexport async function clearCachedToken(\n host: string,\n clientId: string,\n): Promise<void> {\n const data = await readCacheFile();\n const key = cacheKey(host, clientId);\n if (key in data) {\n delete data[key];\n await writeCacheFile(data);\n }\n}\n"],"mappings":";;;;;;;AAWA,MAAM,mBAAmB,IAAI,KAAK;AAElC,SAAS,mBAA2B;AAClC,KAAI,QAAQ,IAAI,sBACd,QAAO,QAAQ,IAAI;AAErB,QAAO,UAAK,KAAK,QAAG,SAAS,EAAE,WAAW,WAAW;AACtD;AAED,SAAS,SAASA,MAAcC,UAA0B;AACxD,WAAU,KAAK,GAAG;AACnB;AAID,eAAe,gBAAoC;AACjD,KAAI;EACF,MAAM,MAAM,MAAM,iBAAG,SAAS,kBAAkB,EAAE,QAAQ;AAC1D,SAAO,KAAK,MAAM,IAAI;CACvB,QAAO;AACN,SAAO,CAAE;CACV;AACF;AAED,eAAe,eAAeC,MAAgC;CAC5D,MAAM,WAAW,kBAAkB;CACnC,MAAM,MAAM,UAAK,QAAQ,SAAS;AAElC,OAAM,iBAAG,MAAM,KAAK;EAAE,WAAW;EAAM,MAAM;CAAO,EAAC;CAGrD,MAAM,aAAa,SAAS,OAAO,QAAQ;AAC3C,OAAM,iBAAG,UAAU,SAAS,KAAK,UAAU,MAAM,MAAM,EAAE,EAAE;EACzD,UAAU;EACV,MAAM;CACP,EAAC;AACF,OAAM,iBAAG,OAAO,SAAS,SAAS;AACnC;AAED,eAAsB,gBACpBF,MACAC,UAC6B;CAC7B,MAAM,OAAO,MAAM,eAAe;CAClC,MAAM,MAAM,SAAS,MAAM,SAAS;CACpC,MAAM,QAAQ,KAAK;AACnB,MAAK,MAAO,QAAO;CAEnB,MAAM,YAAY,IAAI,KAAK,MAAM,YAAY,SAAS;AACtD,MACG,OAAO,SAAS,UAAU,IAC3B,YAAY,KAAK,KAAK,IAAI,kBAC1B;AACA,SAAO,KAAK;AACZ,QAAM,eAAe,KAAK;AAC1B,SAAO;CACR;AAED,QAAO;AACR;AAED,eAAsB,iBAAiBE,OAAmC;CACxE,MAAM,OAAO,MAAM,eAAe;AAClC,MAAK,SAAS,MAAM,aAAa,MAAM,UAAU,IAAI;AACrD,OAAM,eAAe,KAAK;AAC3B;AAED,eAAsB,iBACpBH,MACAC,UACe;CACf,MAAM,OAAO,MAAM,eAAe;CAClC,MAAM,MAAM,SAAS,MAAM,SAAS;AACpC,KAAI,OAAO,MAAM;AACf,SAAO,KAAK;AACZ,QAAM,eAAe,KAAK;CAC3B;AACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token-cache-
|
|
1
|
+
{"version":3,"file":"token-cache-DHBN2ixb.js","names":["host: string","clientId: string","data: CacheFile","token: CachedToken"],"sources":["../src/auth/token-cache.ts"],"sourcesContent":["/**\n * Persistent token cache for device code auth.\n * Tokens are stored at ~/.sentry/mcp.json, keyed by {host}:{clientId}.\n * See docs/stdio-auth.md for cache format and security details.\n */\nimport * as fs from \"node:fs/promises\";\nimport * as path from \"node:path\";\nimport * as os from \"node:os\";\nimport type { CachedToken } from \"./types\";\n\n/** Safety window: treat tokens as expired 5 minutes before actual expiry. */\nconst EXPIRY_SAFETY_MS = 5 * 60 * 1000;\n\nfunction getCacheFilePath(): string {\n if (process.env.SENTRY_MCP_AUTH_CACHE) {\n return process.env.SENTRY_MCP_AUTH_CACHE;\n }\n return path.join(os.homedir(), \".sentry\", \"mcp.json\");\n}\n\nfunction cacheKey(host: string, clientId: string): string {\n return `${host}:${clientId}`;\n}\n\ntype CacheFile = Record<string, CachedToken>;\n\nasync function readCacheFile(): Promise<CacheFile> {\n try {\n const raw = await fs.readFile(getCacheFilePath(), \"utf-8\");\n return JSON.parse(raw) as CacheFile;\n } catch {\n return {};\n }\n}\n\nasync function writeCacheFile(data: CacheFile): Promise<void> {\n const filePath = getCacheFilePath();\n const dir = path.dirname(filePath);\n\n await fs.mkdir(dir, { recursive: true, mode: 0o700 });\n\n // Atomic write: write to temp file then rename\n const tmpPath = `${filePath}.tmp.${process.pid}`;\n await fs.writeFile(tmpPath, JSON.stringify(data, null, 2), {\n encoding: \"utf-8\",\n mode: 0o600,\n });\n await fs.rename(tmpPath, filePath);\n}\n\nexport async function readCachedToken(\n host: string,\n clientId: string,\n): Promise<CachedToken | null> {\n const data = await readCacheFile();\n const key = cacheKey(host, clientId);\n const entry = data[key];\n if (!entry) return null;\n\n const expiresAt = new Date(entry.expires_at).getTime();\n if (\n !Number.isFinite(expiresAt) ||\n expiresAt - Date.now() <= EXPIRY_SAFETY_MS\n ) {\n delete data[key];\n await writeCacheFile(data);\n return null;\n }\n\n return entry;\n}\n\nexport async function writeCachedToken(token: CachedToken): Promise<void> {\n const data = await readCacheFile();\n data[cacheKey(token.sentry_host, token.client_id)] = token;\n await writeCacheFile(data);\n}\n\nexport async function clearCachedToken(\n host: string,\n clientId: string,\n): Promise<void> {\n const data = await readCacheFile();\n const key = cacheKey(host, clientId);\n if (key in data) {\n delete data[key];\n await writeCacheFile(data);\n }\n}\n"],"mappings":";;;;;;AAWA,MAAM,mBAAmB,IAAI,KAAK;AAElC,SAAS,mBAA2B;AAClC,KAAI,QAAQ,IAAI,sBACd,QAAO,QAAQ,IAAI;AAErB,QAAO,KAAK,KAAK,GAAG,SAAS,EAAE,WA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