@sentry/mcp-server 0.29.0 → 0.30.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/{chunk-DoeelZqw.cjs → chunk-Cv9WC9bY.cjs} +7 -0
- package/dist/cli/parse.cjs +1 -1
- package/dist/cli/parse.d.cts +1 -1
- package/dist/cli/parse.d.cts.map +1 -1
- package/dist/cli/parse.d.ts +1 -1
- package/dist/cli/parse.d.ts.map +1 -1
- package/dist/cli/parse.js +1 -1
- package/dist/cli/resolve.cjs +1 -1
- package/dist/cli/resolve.d.cts +2 -2
- package/dist/cli/resolve.d.cts.map +1 -1
- package/dist/cli/resolve.d.ts +2 -2
- package/dist/cli/resolve.d.ts.map +1 -1
- package/dist/cli/resolve.js +1 -1
- package/dist/cli/types.d.cts +1 -1
- 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-CEjP2CYO-DNCUeo0R.js → config-BYPjNBPX-CdPOenPb.js} +3 -2
- package/dist/config-BYPjNBPX-CdPOenPb.js.map +1 -0
- package/dist/{config-CEjP2CYO-CZKUamRu.cjs → config-BYPjNBPX-CxPh7iM8.cjs} +3 -2
- package/dist/config-BYPjNBPX-CxPh7iM8.cjs.map +1 -0
- package/dist/config-CLW41PUq.cjs +7 -0
- package/dist/{config-HqPAzoGg.js → config-NKdlAxBc.js} +1 -1
- package/dist/index.cjs +19631 -11571
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +19555 -11526
- package/dist/index.js.map +1 -1
- package/dist/{parse-DFk2004x.cjs → parse-C6k7VZkG.cjs} +6 -2
- package/dist/parse-C6k7VZkG.cjs.map +1 -0
- package/dist/{parse-CEJNfXug.js → parse-c8rvP4YQ.js} +5 -1
- package/dist/parse-c8rvP4YQ.js.map +1 -0
- package/dist/{resolve-DpUhCbfh.js → resolve-Ci97NUwJ.js} +11 -9
- package/dist/resolve-Ci97NUwJ.js.map +1 -0
- package/dist/{resolve-DFUPLqHE.cjs → resolve-CxQZsYhh.cjs} +11 -9
- package/dist/resolve-CxQZsYhh.cjs.map +1 -0
- package/dist/{stdio-CUTR3lwv.cjs → stdio-BlFtz2dW.cjs} +4 -4
- package/dist/{stdio-CUTR3lwv.cjs.map → stdio-BlFtz2dW.cjs.map} +1 -1
- package/dist/{stdio-BG3LYhUm.js → stdio-D7HAkmRe.js} +3 -3
- package/dist/{stdio-BG3LYhUm.js.map → stdio-D7HAkmRe.js.map} +1 -1
- package/dist/token-C7V4_3ji.cjs +55 -0
- package/dist/token-C7V4_3ji.cjs.map +1 -0
- package/dist/token-CwkkxgwR.js +50 -0
- package/dist/token-CwkkxgwR.js.map +1 -0
- package/dist/token-error-BCFB3iKM.cjs +48 -0
- package/dist/token-error-BCFB3iKM.cjs.map +1 -0
- package/dist/token-error-Df8A7mgb.js +77 -0
- package/dist/token-error-Df8A7mgb.js.map +1 -0
- package/dist/token-util-8fvl2CtH.cjs +9 -0
- package/dist/token-util-CMaRPlqM.cjs +363 -0
- package/dist/token-util-CMaRPlqM.cjs.map +1 -0
- package/dist/token-util-CQ4Ghf_7.js +357 -0
- package/dist/token-util-CQ4Ghf_7.js.map +1 -0
- package/dist/token-util-D5kD3Z8e.js +4 -0
- package/dist/transports/stdio.cjs +1 -1
- package/dist/transports/stdio.js +1 -1
- package/dist/{types-DWpWltcD.d.cts → types-BZvFOe59.d.ts} +6 -3
- package/dist/types-BZvFOe59.d.ts.map +1 -0
- package/dist/{types-rOTvxXQO.d.ts → types-C0DSLPbp.d.cts} +6 -3
- package/dist/types-C0DSLPbp.d.cts.map +1 -0
- package/dist/{usage-Bw3IN4iE.js → usage-BRTpzFg9.js} +5 -2
- package/dist/{usage-Bw3IN4iE.js.map → usage-BRTpzFg9.js.map} +1 -1
- package/dist/{usage-BZayoeC1.cjs → usage-DAChHAia.cjs} +5 -2
- package/dist/{usage-BZayoeC1.cjs.map → usage-DAChHAia.cjs.map} +1 -1
- package/package.json +5 -5
- package/dist/config-CEjP2CYO-CZKUamRu.cjs.map +0 -1
- package/dist/config-CEjP2CYO-DNCUeo0R.js.map +0 -1
- package/dist/config-CwE3_vz4.cjs +0 -7
- package/dist/parse-CEJNfXug.js.map +0 -1
- package/dist/parse-DFk2004x.cjs.map +0 -1
- package/dist/resolve-DFUPLqHE.cjs.map +0 -1
- package/dist/resolve-DpUhCbfh.js.map +0 -1
- package/dist/types-DWpWltcD.d.cts.map +0 -1
- package/dist/types-rOTvxXQO.d.ts.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-
|
|
1
|
+
const require_chunk = require('./chunk-Cv9WC9bY.cjs');
|
|
2
2
|
const node_util = require_chunk.__toESM(require("node:util"));
|
|
3
3
|
|
|
4
4
|
//#region src/cli/parse.ts
|
|
@@ -17,6 +17,7 @@ function parseArgv(argv) {
|
|
|
17
17
|
"organization-slug": { type: "string" },
|
|
18
18
|
"project-slug": { type: "string" },
|
|
19
19
|
skills: { type: "string" },
|
|
20
|
+
"disable-skills": { type: "string" },
|
|
20
21
|
agent: { type: "boolean" },
|
|
21
22
|
experimental: { type: "boolean" },
|
|
22
23
|
help: {
|
|
@@ -56,6 +57,7 @@ function parseArgv(argv) {
|
|
|
56
57
|
organizationSlug: values["organization-slug"],
|
|
57
58
|
projectSlug: values["project-slug"],
|
|
58
59
|
skills: values.skills,
|
|
60
|
+
disableSkills: values["disable-skills"],
|
|
59
61
|
agent: values.agent === true,
|
|
60
62
|
experimental: values.experimental === true,
|
|
61
63
|
help: values.help === true,
|
|
@@ -74,6 +76,7 @@ function parseEnv(env) {
|
|
|
74
76
|
if (env.ANTHROPIC_MODEL) fromEnv.anthropicModel = env.ANTHROPIC_MODEL;
|
|
75
77
|
if (env.EMBEDDED_AGENT_PROVIDER) fromEnv.agentProvider = env.EMBEDDED_AGENT_PROVIDER;
|
|
76
78
|
if (env.MCP_SKILLS) fromEnv.skills = env.MCP_SKILLS;
|
|
79
|
+
if (env.MCP_DISABLE_SKILLS) fromEnv.disableSkills = env.MCP_DISABLE_SKILLS;
|
|
77
80
|
return fromEnv;
|
|
78
81
|
}
|
|
79
82
|
function merge(cli, env) {
|
|
@@ -89,6 +92,7 @@ function merge(cli, env) {
|
|
|
89
92
|
anthropicModel: cli.anthropicModel ?? env.anthropicModel,
|
|
90
93
|
agentProvider: cli.agentProvider ?? env.agentProvider,
|
|
91
94
|
skills: cli.skills ?? env.skills,
|
|
95
|
+
disableSkills: cli.disableSkills ?? env.disableSkills,
|
|
92
96
|
agent: cli.agent === true,
|
|
93
97
|
experimental: cli.experimental === true,
|
|
94
98
|
organizationSlug: cli.organizationSlug,
|
|
@@ -118,4 +122,4 @@ Object.defineProperty(exports, 'parseEnv', {
|
|
|
118
122
|
return parseEnv;
|
|
119
123
|
}
|
|
120
124
|
});
|
|
121
|
-
//# sourceMappingURL=parse-
|
|
125
|
+
//# sourceMappingURL=parse-C6k7VZkG.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-C6k7VZkG.cjs","names":["argv: string[]","unknownArgs: string[]","env: NodeJS.ProcessEnv","fromEnv: EnvArgs","cli: CliArgs","env: EnvArgs"],"sources":["../src/cli/parse.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport type { CliArgs, EnvArgs, MergedArgs } from \"./types\";\n\nexport function parseArgv(argv: string[]): CliArgs {\n const options = {\n \"access-token\": { type: \"string\" as const },\n host: { type: \"string\" as const },\n url: { type: \"string\" as const },\n \"mcp-url\": { type: \"string\" as const },\n \"sentry-dsn\": { type: \"string\" as const },\n \"openai-base-url\": { type: \"string\" as const },\n \"openai-model\": { type: \"string\" as const },\n \"anthropic-base-url\": { type: \"string\" as const },\n \"anthropic-model\": { type: \"string\" as const },\n \"agent-provider\": { type: \"string\" as const },\n \"organization-slug\": { type: \"string\" as const },\n \"project-slug\": { type: \"string\" as const },\n skills: { type: \"string\" as const },\n \"disable-skills\": { type: \"string\" as const },\n agent: { type: \"boolean\" as const },\n experimental: { type: \"boolean\" as const },\n help: { type: \"boolean\" as const, short: \"h\" as const },\n version: { type: \"boolean\" as const, short: \"v\" as const },\n };\n\n const { values, positionals, tokens } = parseArgs({\n args: argv,\n options,\n allowPositionals: false,\n strict: false,\n tokens: true,\n });\n\n const knownLong = new Set(Object.keys(options));\n const knownShort = new Set([\n ...(Object.values(options)\n .map((o) => (\"short\" in o ? (o.short as string | undefined) : undefined))\n .filter(Boolean) as string[]),\n ]);\n\n const unknownArgs: string[] = [];\n for (const t of (tokens as any[]) || []) {\n if (t.kind === \"option\") {\n const name = t.name as string | undefined;\n if (name && !(knownLong.has(name) || knownShort.has(name))) {\n unknownArgs.push((t.raw as string) ?? `--${name}`);\n }\n } else if (t.kind === \"positional\") {\n unknownArgs.push((t.raw as string) ?? String(t.value ?? \"\"));\n }\n }\n\n return {\n accessToken: values[\"access-token\"] as string | undefined,\n host: values.host as string | undefined,\n url: values.url as string | undefined,\n mcpUrl: values[\"mcp-url\"] as string | undefined,\n sentryDsn: values[\"sentry-dsn\"] as string | undefined,\n openaiBaseUrl: values[\"openai-base-url\"] as string | undefined,\n openaiModel: values[\"openai-model\"] as string | undefined,\n anthropicBaseUrl: values[\"anthropic-base-url\"] as string | undefined,\n anthropicModel: values[\"anthropic-model\"] as string | undefined,\n agentProvider: values[\"agent-provider\"] as string | undefined,\n organizationSlug: values[\"organization-slug\"] as string | undefined,\n projectSlug: values[\"project-slug\"] as string | undefined,\n skills: values.skills as string | undefined,\n disableSkills: values[\"disable-skills\"] as string | undefined,\n agent: values.agent === true,\n experimental: values.experimental === true,\n help: (values.help as boolean | undefined) === true,\n version: (values.version as boolean | undefined) === true,\n unknownArgs:\n unknownArgs.length > 0 ? unknownArgs : (positionals as string[]) || [],\n };\n}\n\nexport function parseEnv(env: NodeJS.ProcessEnv): EnvArgs {\n const fromEnv: EnvArgs = {};\n if (env.SENTRY_ACCESS_TOKEN) fromEnv.accessToken = env.SENTRY_ACCESS_TOKEN;\n if (env.SENTRY_URL) fromEnv.url = env.SENTRY_URL;\n if (env.SENTRY_HOST) fromEnv.host = env.SENTRY_HOST;\n if (env.MCP_URL) fromEnv.mcpUrl = env.MCP_URL;\n if (env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN)\n fromEnv.sentryDsn = env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN;\n\n if (env.OPENAI_MODEL) fromEnv.openaiModel = env.OPENAI_MODEL;\n if (env.ANTHROPIC_MODEL) fromEnv.anthropicModel = env.ANTHROPIC_MODEL;\n if (env.EMBEDDED_AGENT_PROVIDER)\n fromEnv.agentProvider = env.EMBEDDED_AGENT_PROVIDER;\n if (env.MCP_SKILLS) fromEnv.skills = env.MCP_SKILLS;\n if (env.MCP_DISABLE_SKILLS) fromEnv.disableSkills = env.MCP_DISABLE_SKILLS;\n return fromEnv;\n}\n\nexport function merge(cli: CliArgs, env: EnvArgs): MergedArgs {\n // CLI wins over env\n return {\n accessToken: cli.accessToken ?? env.accessToken,\n // If CLI provided url/host, prefer those; else fall back to env\n url: cli.url ?? env.url,\n host: cli.host ?? env.host,\n mcpUrl: cli.mcpUrl ?? env.mcpUrl,\n sentryDsn: cli.sentryDsn ?? env.sentryDsn,\n openaiBaseUrl: cli.openaiBaseUrl,\n openaiModel: cli.openaiModel ?? env.openaiModel,\n anthropicBaseUrl: cli.anthropicBaseUrl,\n anthropicModel: cli.anthropicModel ?? env.anthropicModel,\n agentProvider: cli.agentProvider ?? env.agentProvider,\n // 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;EA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,kBAAkB,IAAI;EAC1C,eAAe,IAAI,iBAAiB,IAAI;EAExC,QAAQ,IAAI,UAAU,IAAI;EAC1B,eAAe,IAAI,iBAAiB,IAAI;EACxC,OAAO,IAAI,UAAU;EACrB,cAAc,IAAI,iBAAiB;EACnC,kBAAkB,IAAI;EACtB,aAAa,IAAI;EACjB,MAAM,IAAI,SAAS;EACnB,SAAS,IAAI,YAAY;EACzB,aAAa,IAAI;CAClB;AACF"}
|
|
@@ -16,6 +16,7 @@ function parseArgv(argv) {
|
|
|
16
16
|
"organization-slug": { type: "string" },
|
|
17
17
|
"project-slug": { type: "string" },
|
|
18
18
|
skills: { type: "string" },
|
|
19
|
+
"disable-skills": { type: "string" },
|
|
19
20
|
agent: { type: "boolean" },
|
|
20
21
|
experimental: { type: "boolean" },
|
|
21
22
|
help: {
|
|
@@ -55,6 +56,7 @@ function parseArgv(argv) {
|
|
|
55
56
|
organizationSlug: values["organization-slug"],
|
|
56
57
|
projectSlug: values["project-slug"],
|
|
57
58
|
skills: values.skills,
|
|
59
|
+
disableSkills: values["disable-skills"],
|
|
58
60
|
agent: values.agent === true,
|
|
59
61
|
experimental: values.experimental === true,
|
|
60
62
|
help: values.help === true,
|
|
@@ -73,6 +75,7 @@ function parseEnv(env) {
|
|
|
73
75
|
if (env.ANTHROPIC_MODEL) fromEnv.anthropicModel = env.ANTHROPIC_MODEL;
|
|
74
76
|
if (env.EMBEDDED_AGENT_PROVIDER) fromEnv.agentProvider = env.EMBEDDED_AGENT_PROVIDER;
|
|
75
77
|
if (env.MCP_SKILLS) fromEnv.skills = env.MCP_SKILLS;
|
|
78
|
+
if (env.MCP_DISABLE_SKILLS) fromEnv.disableSkills = env.MCP_DISABLE_SKILLS;
|
|
76
79
|
return fromEnv;
|
|
77
80
|
}
|
|
78
81
|
function merge(cli, env) {
|
|
@@ -88,6 +91,7 @@ function merge(cli, env) {
|
|
|
88
91
|
anthropicModel: cli.anthropicModel ?? env.anthropicModel,
|
|
89
92
|
agentProvider: cli.agentProvider ?? env.agentProvider,
|
|
90
93
|
skills: cli.skills ?? env.skills,
|
|
94
|
+
disableSkills: cli.disableSkills ?? env.disableSkills,
|
|
91
95
|
agent: cli.agent === true,
|
|
92
96
|
experimental: cli.experimental === true,
|
|
93
97
|
organizationSlug: cli.organizationSlug,
|
|
@@ -100,4 +104,4 @@ function merge(cli, env) {
|
|
|
100
104
|
|
|
101
105
|
//#endregion
|
|
102
106
|
export { merge, parseArgv, parseEnv };
|
|
103
|
-
//# sourceMappingURL=parse-
|
|
107
|
+
//# sourceMappingURL=parse-c8rvP4YQ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parse-c8rvP4YQ.js","names":["argv: string[]","unknownArgs: string[]","env: NodeJS.ProcessEnv","fromEnv: EnvArgs","cli: CliArgs","env: EnvArgs"],"sources":["../src/cli/parse.ts"],"sourcesContent":["import { parseArgs } from \"node:util\";\nimport type { CliArgs, EnvArgs, MergedArgs } from \"./types\";\n\nexport function parseArgv(argv: string[]): CliArgs {\n const options = {\n \"access-token\": { type: \"string\" as const },\n host: { type: \"string\" as const },\n url: { type: \"string\" as const },\n \"mcp-url\": { type: \"string\" as const },\n \"sentry-dsn\": { type: \"string\" as const },\n \"openai-base-url\": { type: \"string\" as const },\n \"openai-model\": { type: \"string\" as const },\n \"anthropic-base-url\": { type: \"string\" as const },\n \"anthropic-model\": { type: \"string\" as const },\n \"agent-provider\": { type: \"string\" as const },\n \"organization-slug\": { type: \"string\" as const },\n \"project-slug\": { type: \"string\" as const },\n skills: { type: \"string\" as const },\n \"disable-skills\": { type: \"string\" as const },\n agent: { type: \"boolean\" as const },\n experimental: { type: \"boolean\" as const },\n help: { type: \"boolean\" as const, short: \"h\" as const },\n version: { type: \"boolean\" as const, short: \"v\" as const },\n };\n\n const { values, positionals, tokens } = parseArgs({\n args: argv,\n options,\n allowPositionals: false,\n strict: false,\n tokens: true,\n });\n\n const knownLong = new Set(Object.keys(options));\n const knownShort = new Set([\n ...(Object.values(options)\n .map((o) => (\"short\" in o ? (o.short as string | undefined) : undefined))\n .filter(Boolean) as string[]),\n ]);\n\n const unknownArgs: string[] = [];\n for (const t of (tokens as any[]) || []) {\n if (t.kind === \"option\") {\n const name = t.name as string | undefined;\n if (name && !(knownLong.has(name) || knownShort.has(name))) {\n unknownArgs.push((t.raw as string) ?? `--${name}`);\n }\n } else if (t.kind === \"positional\") {\n unknownArgs.push((t.raw as string) ?? String(t.value ?? \"\"));\n }\n }\n\n return {\n accessToken: values[\"access-token\"] as string | undefined,\n host: values.host as string | undefined,\n url: values.url as string | undefined,\n mcpUrl: values[\"mcp-url\"] as string | undefined,\n sentryDsn: values[\"sentry-dsn\"] as string | undefined,\n openaiBaseUrl: values[\"openai-base-url\"] as string | undefined,\n openaiModel: values[\"openai-model\"] as string | undefined,\n anthropicBaseUrl: values[\"anthropic-base-url\"] as string | undefined,\n anthropicModel: values[\"anthropic-model\"] as string | undefined,\n agentProvider: values[\"agent-provider\"] as string | undefined,\n organizationSlug: values[\"organization-slug\"] as string | undefined,\n projectSlug: values[\"project-slug\"] as string | undefined,\n skills: values.skills as string | undefined,\n disableSkills: values[\"disable-skills\"] as string | undefined,\n agent: values.agent === true,\n experimental: values.experimental === true,\n help: (values.help as boolean | undefined) === true,\n version: (values.version as boolean | undefined) === true,\n unknownArgs:\n unknownArgs.length > 0 ? unknownArgs : (positionals as string[]) || [],\n };\n}\n\nexport function parseEnv(env: NodeJS.ProcessEnv): EnvArgs {\n const fromEnv: EnvArgs = {};\n if (env.SENTRY_ACCESS_TOKEN) fromEnv.accessToken = env.SENTRY_ACCESS_TOKEN;\n if (env.SENTRY_URL) fromEnv.url = env.SENTRY_URL;\n if (env.SENTRY_HOST) fromEnv.host = env.SENTRY_HOST;\n if (env.MCP_URL) fromEnv.mcpUrl = env.MCP_URL;\n if (env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN)\n fromEnv.sentryDsn = env.SENTRY_DSN || env.DEFAULT_SENTRY_DSN;\n\n if (env.OPENAI_MODEL) fromEnv.openaiModel = env.OPENAI_MODEL;\n if (env.ANTHROPIC_MODEL) fromEnv.anthropicModel = env.ANTHROPIC_MODEL;\n if (env.EMBEDDED_AGENT_PROVIDER)\n fromEnv.agentProvider = env.EMBEDDED_AGENT_PROVIDER;\n if (env.MCP_SKILLS) fromEnv.skills = env.MCP_SKILLS;\n if (env.MCP_DISABLE_SKILLS) fromEnv.disableSkills = env.MCP_DISABLE_SKILLS;\n return fromEnv;\n}\n\nexport function merge(cli: CliArgs, env: EnvArgs): MergedArgs {\n // CLI wins over env\n return {\n accessToken: cli.accessToken ?? env.accessToken,\n // If CLI provided url/host, prefer those; else fall back to env\n url: cli.url ?? env.url,\n host: cli.host ?? env.host,\n mcpUrl: cli.mcpUrl ?? env.mcpUrl,\n sentryDsn: cli.sentryDsn ?? env.sentryDsn,\n openaiBaseUrl: cli.openaiBaseUrl,\n openaiModel: cli.openaiModel ?? env.openaiModel,\n anthropicBaseUrl: cli.anthropicBaseUrl,\n anthropicModel: cli.anthropicModel ?? env.anthropicModel,\n agentProvider: cli.agentProvider ?? env.agentProvider,\n // Skills precedence: CLI skills override env\n skills: cli.skills ?? env.skills,\n disableSkills: cli.disableSkills ?? env.disableSkills,\n agent: cli.agent === true,\n experimental: cli.experimental === true,\n organizationSlug: cli.organizationSlug,\n projectSlug: cli.projectSlug,\n help: cli.help === true,\n version: cli.version === true,\n unknownArgs: cli.unknownArgs,\n };\n}\n"],"mappings":";;;AAGA,SAAgB,UAAUA,MAAyB;CACjD,MAAM,UAAU;EACd,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,MAAM,EAAE,MAAM,SAAmB;EACjC,KAAK,EAAE,MAAM,SAAmB;EAChC,WAAW,EAAE,MAAM,SAAmB;EACtC,cAAc,EAAE,MAAM,SAAmB;EACzC,mBAAmB,EAAE,MAAM,SAAmB;EAC9C,gBAAgB,EAAE,MAAM,SAAmB;EAC3C,sBAAsB,EAAE,MAAM,SAAmB;EACjD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SAAS,IAAI,YAAY;EACzB,aAAa,IAAI;CAClB;AACF"}
|
|
@@ -190,10 +190,9 @@ function validateOpenAiBaseUrlThrows(url) {
|
|
|
190
190
|
|
|
191
191
|
//#endregion
|
|
192
192
|
//#region src/cli/resolve.ts
|
|
193
|
-
function formatInvalidSkills(invalid,
|
|
194
|
-
const
|
|
195
|
-
|
|
196
|
-
return `Error: ${where}: ${invalid.join(", ")}\nAvailable skills: ${allSkills}`;
|
|
193
|
+
function formatInvalidSkills(invalid, source) {
|
|
194
|
+
const prefix = source ? `${source} provided` : "Invalid skills provided";
|
|
195
|
+
return `Error: ${prefix}: ${invalid.join(", ")}\nAvailable skills: ${ALL_SKILLS.join(", ")}`;
|
|
197
196
|
}
|
|
198
197
|
function finalize(input) {
|
|
199
198
|
if (!input.accessToken) throw new Error("Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.");
|
|
@@ -203,15 +202,18 @@ function finalize(input) {
|
|
|
203
202
|
validateSentryHostThrows(input.host);
|
|
204
203
|
sentryHost = input.host;
|
|
205
204
|
}
|
|
206
|
-
let finalSkills
|
|
205
|
+
let finalSkills;
|
|
207
206
|
if (input.skills) {
|
|
208
207
|
const { valid, invalid } = parseSkills(input.skills);
|
|
209
208
|
if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid));
|
|
210
209
|
if (valid.size === 0) throw new Error("Error: Invalid skills provided. No valid skills found.");
|
|
211
210
|
finalSkills = valid;
|
|
212
|
-
} else
|
|
213
|
-
|
|
214
|
-
|
|
211
|
+
} else finalSkills = new Set(ALL_SKILLS);
|
|
212
|
+
if (input.disableSkills) {
|
|
213
|
+
const { valid: skillsToDisable, invalid } = parseSkills(input.disableSkills);
|
|
214
|
+
if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid, "--disable-skills"));
|
|
215
|
+
for (const skill of skillsToDisable) finalSkills.delete(skill);
|
|
216
|
+
if (finalSkills.size === 0) throw new Error("Error: All skills have been disabled. At least one skill must remain enabled.");
|
|
215
217
|
}
|
|
216
218
|
const resolvedOpenAiBaseUrl = input.openaiBaseUrl ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl) : void 0;
|
|
217
219
|
const resolvedAnthropicBaseUrl = input.anthropicBaseUrl ? validateOpenAiBaseUrlThrows(input.anthropicBaseUrl) : void 0;
|
|
@@ -239,4 +241,4 @@ function finalize(input) {
|
|
|
239
241
|
|
|
240
242
|
//#endregion
|
|
241
243
|
export { ALL_SKILLS, SKILLS, finalize, formatInvalidSkills, getIssueUrl, getIssuesSearchUrl, getTraceUrl, isEnabledBySkills, isSentryHost };
|
|
242
|
-
//# sourceMappingURL=resolve-
|
|
244
|
+
//# sourceMappingURL=resolve-Ci97NUwJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-Ci97NUwJ.js","names":["invalid: string[]","source?: string","input: MergedArgs","finalSkills: Set<Skill>","agentProvider: \"openai\" | \"anthropic\" | undefined"],"sources":["../../mcp-core/dist/skills-DEPBbN1h.js","../../mcp-core/dist/url-utils-hSW2gkfr.js","../src/cli/resolve.ts"],"sourcesContent":["//#region src/skills.ts\nconst SKILLS = {\n\tinspect: {\n\t\tid: \"inspect\",\n\t\tname: \"Inspect Issues & Events\",\n\t\tdescription: \"Search for errors, analyze traces, and explore event details\",\n\t\tdefaultEnabled: true,\n\t\torder: 1\n\t},\n\tseer: {\n\t\tid: \"seer\",\n\t\tname: \"Seer\",\n\t\tdescription: \"Sentry's AI debugger that helps you analyze, root cause, and fix issues\",\n\t\tdefaultEnabled: true,\n\t\torder: 2\n\t},\n\tdocs: {\n\t\tid: \"docs\",\n\t\tname: \"Documentation\",\n\t\tdescription: \"Search and read Sentry SDK documentation\",\n\t\tdefaultEnabled: false,\n\t\torder: 3\n\t},\n\ttriage: {\n\t\tid: \"triage\",\n\t\tname: \"Triage Issues\",\n\t\tdescription: \"Resolve, assign, and update issues\",\n\t\tdefaultEnabled: false,\n\t\torder: 4\n\t},\n\t\"project-management\": {\n\t\tid: \"project-management\",\n\t\tname: \"Manage Projects & Teams\",\n\t\tdescription: \"Create and modify projects, teams, and DSNs\",\n\t\tdefaultEnabled: false,\n\t\torder: 5\n\t}\n};\nconst SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);\nasync function getSkillsArrayWithCounts() {\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst tools = toolsModule.default;\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const skill of Object.keys(SKILLS)) counts.set(skill, 0);\n\tfor (const tool of Object.values(tools)) if (Array.isArray(tool.skills)) for (const skill of tool.skills) counts.set(skill, (counts.get(skill) || 0) + 1);\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\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-DEPBbN1h.js.map","//#region src/utils/url-utils.ts\n/**\n* Determines if a Sentry instance is SaaS or self-hosted based on the host.\n* @param host The Sentry host (e.g., \"sentry.io\" or \"sentry.company.com\")\n* @returns true if SaaS instance, false if self-hosted\n*/\nfunction isSentryHost(host) {\n\treturn host === \"sentry.io\" || host.endsWith(\".sentry.io\");\n}\n/**\n* Generates a Sentry issue URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param issueId Issue identifier (e.g., \"PROJECT-123\")\n* @returns The complete issue URL\n*/\nfunction getIssueUrl(host, organizationSlug, issueId) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\treturn isSaas ? `https://${organizationSlug}.${webHost}/issues/${issueId}` : `https://${host}/organizations/${organizationSlug}/issues/${issueId}`;\n}\n/**\n* Generates a Sentry issues search URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param query Optional search query\n* @param projectSlugOrId Optional project slug or ID\n* @returns The complete issues search URL\n*/\nfunction getIssuesSearchUrl(host, organizationSlug, query, projectSlugOrId) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\tlet url = isSaas ? `https://${organizationSlug}.${webHost}/issues/` : `https://${host}/organizations/${organizationSlug}/issues/`;\n\tconst params = new URLSearchParams();\n\tif (projectSlugOrId) params.append(\"project\", projectSlugOrId);\n\tif (query) params.append(\"query\", query);\n\tconst queryString = params.toString();\n\tif (queryString) url += `?${queryString}`;\n\treturn url;\n}\n/**\n* Generates a Sentry trace URL for performance investigation.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param traceId Trace identifier\n* @returns The complete trace URL\n*/\nfunction getTraceUrl(host, organizationSlug, traceId) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\treturn isSaas ? `https://${organizationSlug}.${webHost}/explore/traces/trace/${traceId}` : `https://${host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;\n}\n/**\n* Generates a Sentry events explorer URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param query Search query\n* @param dataset Dataset type\n* @param projectSlug Optional project slug\n* @param fields Optional fields to display\n* @returns The complete events explorer URL\n*/\nfunction getEventsExplorerUrl(host, organizationSlug, query, dataset = \"spans\", projectSlug, fields) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\tlet url = isSaas ? `https://${organizationSlug}.${webHost}/explore/` : `https://${host}/organizations/${organizationSlug}/explore/`;\n\tconst params = new URLSearchParams();\n\tparams.append(\"query\", query);\n\tparams.append(\"dataset\", dataset);\n\tparams.append(\"layout\", \"table\");\n\tif (projectSlug) params.append(\"project\", projectSlug);\n\tif (fields && fields.length > 0) for (const field of fields) params.append(\"field\", field);\n\turl += `?${params.toString()}`;\n\treturn url;\n}\n/**\n* Internal validation function that checks if a SENTRY_HOST value contains only hostname (no protocol).\n* Throws an error if validation fails instead of exiting the process.\n*\n* @param host The hostname to validate\n* @throws {Error} If the host contains a protocol\n*/\nfunction _validateSentryHostInternal(host) {\n\tif (host.startsWith(\"http://\") || host.startsWith(\"https://\")) throw new Error(\"SENTRY_HOST should only contain a hostname (e.g., sentry.example.com). Use SENTRY_URL if you want to provide a full URL.\");\n}\n/**\n* Internal validation function that checks if a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Throws an error if validation fails instead of exiting the process.\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n* @throws {Error} If the URL is invalid or not HTTPS\n*/\nfunction _validateAndParseSentryUrlInternal(url) {\n\tif (!url.startsWith(\"https://\")) throw new Error(\"SENTRY_URL must be a full HTTPS URL (e.g., https://sentry.example.com).\");\n\ttry {\n\t\tconst parsedUrl = new URL(url);\n\t\treturn parsedUrl.host;\n\t} catch (error) {\n\t\tthrow new Error(\"SENTRY_URL must be a valid HTTPS URL (e.g., https://sentry.example.com).\");\n\t}\n}\n/**\n* Validates that a SENTRY_HOST value contains only hostname (no protocol).\n* Exits the process with error code 1 if validation fails (CLI behavior).\n*\n* @param host The hostname to validate\n*/\nfunction validateSentryHost(host) {\n\ttry {\n\t\t_validateSentryHostInternal(host);\n\t} catch (error) {\n\t\tconsole.error(`Error: ${error.message}`);\n\t\tprocess.exit(1);\n\t}\n}\n/**\n* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Exits the process with error code 1 if validation fails (CLI behavior).\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n*/\nfunction validateAndParseSentryUrl(url) {\n\ttry {\n\t\treturn _validateAndParseSentryUrlInternal(url);\n\t} catch (error) {\n\t\tconsole.error(`Error: ${error.message}`);\n\t\tprocess.exit(1);\n\t}\n}\n/**\n* Validates that a SENTRY_HOST value contains only hostname (no protocol).\n* Throws an error instead of exiting the process (for testing).\n*\n* @param host The hostname to validate\n* @throws {Error} If the host contains a protocol\n*/\nfunction validateSentryHostThrows(host) {\n\t_validateSentryHostInternal(host);\n}\n/**\n* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Throws an error instead of exiting the process (for testing).\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n* @throws {Error} If the URL is invalid or not HTTPS\n*/\nfunction validateAndParseSentryUrlThrows(url) {\n\treturn _validateAndParseSentryUrlInternal(url);\n}\n/**\n* Validates that the provided OpenAI base URL is a valid HTTP(S) URL and returns a normalized string.\n*\n* @param url The URL to validate and normalize\n* @returns The normalized URL string\n* @throws {Error} If the URL is empty, invalid, or uses an unsupported protocol\n*/\nfunction validateOpenAiBaseUrlThrows(url) {\n\tconst trimmed = url.trim();\n\tif (trimmed.length === 0) throw new Error(\"OPENAI base URL must not be empty.\");\n\tlet parsed;\n\ttry {\n\t\tparsed = new URL(trimmed);\n\t} catch (error) {\n\t\tthrow new Error(\"OPENAI base URL must be a valid HTTP or HTTPS URL (e.g., https://example.com/v1).\", { cause: error });\n\t}\n\tif (parsed.protocol !== \"https:\" && parsed.protocol !== \"http:\") throw new Error(\"OPENAI base URL must use http or https scheme (e.g., https://example.com/v1).\");\n\treturn parsed.toString();\n}\n\n//#endregion\nexport { getEventsExplorerUrl, getIssueUrl, getIssuesSearchUrl, getTraceUrl, isSentryHost, validateAndParseSentryUrl, validateAndParseSentryUrlThrows, validateOpenAiBaseUrlThrows, validateSentryHost, validateSentryHostThrows };\n//# sourceMappingURL=url-utils-hSW2gkfr.js.map","import { ALL_SKILLS, parseSkills, type Skill } from \"@sentry/mcp-core/skills\";\nimport {\n validateAndParseSentryUrlThrows,\n validateOpenAiBaseUrlThrows,\n validateSentryHostThrows,\n} from \"@sentry/mcp-core/utils/url-utils\";\nimport type { MergedArgs, ResolvedConfig } 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\nexport function finalize(input: MergedArgs): ResolvedConfig {\n // Access token required\n if (!input.accessToken) {\n throw new Error(\n \"Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.\",\n );\n }\n\n // Determine host from url/host with validation\n let sentryHost = \"sentry.io\";\n if (input.url) {\n sentryHost = validateAndParseSentryUrlThrows(input.url);\n } else if (input.host) {\n validateSentryHostThrows(input.host);\n sentryHost = input.host;\n }\n\n // Skills resolution\n //\n // IMPORTANT: stdio (CLI) intentionally defaults to ALL skills when no --skills flag is provided\n //\n // This differs from the OAuth flow, which requires explicit user selection:\n // - stdio/CLI: Non-interactive, defaults to ALL skills (inspect, docs, seer, triage, project-management)\n // - OAuth: Interactive, requires user to explicitly select skills (with sensible defaults pre-checked)\n //\n // Rationale:\n // We don't want the MCP to break if users don't specify skills. stdio is typically used in\n // local development and CI/CD environments where maximum access by default is expected.\n // OAuth is used in multi-tenant hosted environments where users should consciously grant\n // permissions on a per-app basis.\n //\n // For OAuth validation that enforces minimum 1 skill selection, see:\n // packages/mcp-cloudflare/src/server/oauth/routes/callback.ts (lines 234-248)\n //\n let finalSkills: Set<Skill>;\n if (input.skills) {\n // Override: use only the specified skills\n const { valid, invalid } = parseSkills(input.skills);\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid));\n }\n if (valid.size === 0) {\n throw new Error(\"Error: Invalid skills provided. No valid skills found.\");\n }\n finalSkills = valid;\n } else {\n // Default: grant ALL skills when no flag is provided (see comment block above for rationale)\n finalSkills = new Set<Skill>(ALL_SKILLS);\n }\n\n // Disable-skills: remove specific skills from the active set\n if (input.disableSkills) {\n const { valid: skillsToDisable, invalid } = parseSkills(\n input.disableSkills,\n );\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid, \"--disable-skills\"));\n }\n for (const skill of skillsToDisable) {\n finalSkills.delete(skill);\n }\n if (finalSkills.size === 0) {\n throw new Error(\n \"Error: All skills have been disabled. At least one skill must remain enabled.\",\n );\n }\n }\n\n const resolvedOpenAiBaseUrl = input.openaiBaseUrl\n ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl)\n : undefined;\n\n // Validate anthropic base URL if provided (same validation as OpenAI)\n const resolvedAnthropicBaseUrl = input.anthropicBaseUrl\n ? validateOpenAiBaseUrlThrows(input.anthropicBaseUrl)\n : undefined;\n\n // Validate agent provider if explicitly set\n let agentProvider: \"openai\" | \"anthropic\" | undefined = undefined;\n if (input.agentProvider) {\n const provider = input.agentProvider.toLowerCase();\n if (provider !== \"openai\" && provider !== \"anthropic\") {\n throw new Error(\n `Error: Invalid agent provider \"${input.agentProvider}\". Must be \"openai\" or \"anthropic\".`,\n );\n }\n agentProvider = provider;\n }\n\n return {\n accessToken: input.accessToken,\n sentryHost,\n mcpUrl: input.mcpUrl,\n sentryDsn: input.sentryDsn,\n openaiBaseUrl: resolvedOpenAiBaseUrl,\n openaiModel: input.openaiModel,\n anthropicBaseUrl: resolvedAnthropicBaseUrl,\n anthropicModel: input.anthropicModel,\n agentProvider,\n finalSkills,\n organizationSlug: input.organizationSlug,\n projectSlug: input.projectSlug,\n };\n}\n"],"mappings":";AACA,MAAM,SAAS;CACd,SAAS;EACR,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,QAAQ;EACP,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,sBAAsB;EACrB,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;AACD;AACD,MAAM,eAAe,OAAO,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM;AAY5E,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,W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AAI,MAAM,IACR,cAAa,gCAAgC,MAAM,IAAI;UAC9C,MAAM,MAAM;AACrB,2BAAyB,MAAM,KAAK;AACpC,eAAa,MAAM;CACpB;CAmBD,IAAIC;AACJ,KAAI,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;AACJ,KAAI,MAAM,eAAe;EACvB,MAAM,WAAW,MAAM,cAAc,aAAa;AAClD,MAAI,aAAa,YAAY,aAAa,YACxC,OAAM,IAAI,OACP,iCAAiC,MAAM,cAAc;AAG1D,kBAAgB;CACjB;AAED,QAAO;EACL,aAAa,MAAM;EACnB;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"}
|
|
@@ -191,10 +191,9 @@ function validateOpenAiBaseUrlThrows(url) {
|
|
|
191
191
|
|
|
192
192
|
//#endregion
|
|
193
193
|
//#region src/cli/resolve.ts
|
|
194
|
-
function formatInvalidSkills(invalid,
|
|
195
|
-
const
|
|
196
|
-
|
|
197
|
-
return `Error: ${where}: ${invalid.join(", ")}\nAvailable skills: ${allSkills}`;
|
|
194
|
+
function formatInvalidSkills(invalid, source) {
|
|
195
|
+
const prefix = source ? `${source} provided` : "Invalid skills provided";
|
|
196
|
+
return `Error: ${prefix}: ${invalid.join(", ")}\nAvailable skills: ${ALL_SKILLS.join(", ")}`;
|
|
198
197
|
}
|
|
199
198
|
function finalize(input) {
|
|
200
199
|
if (!input.accessToken) throw new Error("Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.");
|
|
@@ -204,15 +203,18 @@ function finalize(input) {
|
|
|
204
203
|
validateSentryHostThrows(input.host);
|
|
205
204
|
sentryHost = input.host;
|
|
206
205
|
}
|
|
207
|
-
let finalSkills
|
|
206
|
+
let finalSkills;
|
|
208
207
|
if (input.skills) {
|
|
209
208
|
const { valid, invalid } = parseSkills(input.skills);
|
|
210
209
|
if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid));
|
|
211
210
|
if (valid.size === 0) throw new Error("Error: Invalid skills provided. No valid skills found.");
|
|
212
211
|
finalSkills = valid;
|
|
213
|
-
} else
|
|
214
|
-
|
|
215
|
-
|
|
212
|
+
} else finalSkills = new Set(ALL_SKILLS);
|
|
213
|
+
if (input.disableSkills) {
|
|
214
|
+
const { valid: skillsToDisable, invalid } = parseSkills(input.disableSkills);
|
|
215
|
+
if (invalid.length > 0) throw new Error(formatInvalidSkills(invalid, "--disable-skills"));
|
|
216
|
+
for (const skill of skillsToDisable) finalSkills.delete(skill);
|
|
217
|
+
if (finalSkills.size === 0) throw new Error("Error: All skills have been disabled. At least one skill must remain enabled.");
|
|
216
218
|
}
|
|
217
219
|
const resolvedOpenAiBaseUrl = input.openaiBaseUrl ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl) : void 0;
|
|
218
220
|
const resolvedAnthropicBaseUrl = input.anthropicBaseUrl ? validateOpenAiBaseUrlThrows(input.anthropicBaseUrl) : void 0;
|
|
@@ -293,4 +295,4 @@ Object.defineProperty(exports, 'isSentryHost', {
|
|
|
293
295
|
return isSentryHost;
|
|
294
296
|
}
|
|
295
297
|
});
|
|
296
|
-
//# sourceMappingURL=resolve-
|
|
298
|
+
//# sourceMappingURL=resolve-CxQZsYhh.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-CxQZsYhh.cjs","names":["invalid: string[]","source?: string","input: MergedArgs","finalSkills: Set<Skill>","agentProvider: \"openai\" | \"anthropic\" | undefined"],"sources":["../../mcp-core/dist/skills-DEPBbN1h.js","../../mcp-core/dist/url-utils-hSW2gkfr.js","../src/cli/resolve.ts"],"sourcesContent":["//#region src/skills.ts\nconst SKILLS = {\n\tinspect: {\n\t\tid: \"inspect\",\n\t\tname: \"Inspect Issues & Events\",\n\t\tdescription: \"Search for errors, analyze traces, and explore event details\",\n\t\tdefaultEnabled: true,\n\t\torder: 1\n\t},\n\tseer: {\n\t\tid: \"seer\",\n\t\tname: \"Seer\",\n\t\tdescription: \"Sentry's AI debugger that helps you analyze, root cause, and fix issues\",\n\t\tdefaultEnabled: true,\n\t\torder: 2\n\t},\n\tdocs: {\n\t\tid: \"docs\",\n\t\tname: \"Documentation\",\n\t\tdescription: \"Search and read Sentry SDK documentation\",\n\t\tdefaultEnabled: false,\n\t\torder: 3\n\t},\n\ttriage: {\n\t\tid: \"triage\",\n\t\tname: \"Triage Issues\",\n\t\tdescription: \"Resolve, assign, and update issues\",\n\t\tdefaultEnabled: false,\n\t\torder: 4\n\t},\n\t\"project-management\": {\n\t\tid: \"project-management\",\n\t\tname: \"Manage Projects & Teams\",\n\t\tdescription: \"Create and modify projects, teams, and DSNs\",\n\t\tdefaultEnabled: false,\n\t\torder: 5\n\t}\n};\nconst SKILLS_ARRAY = Object.values(SKILLS).sort((a, b) => a.order - b.order);\nasync function getSkillsArrayWithCounts() {\n\tconst toolsModule = await import(\"./tools/index.js\");\n\tconst tools = toolsModule.default;\n\tconst counts = /* @__PURE__ */ new Map();\n\tfor (const skill of Object.keys(SKILLS)) counts.set(skill, 0);\n\tfor (const tool of Object.values(tools)) if (Array.isArray(tool.skills)) for (const skill of tool.skills) counts.set(skill, (counts.get(skill) || 0) + 1);\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\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-DEPBbN1h.js.map","//#region src/utils/url-utils.ts\n/**\n* Determines if a Sentry instance is SaaS or self-hosted based on the host.\n* @param host The Sentry host (e.g., \"sentry.io\" or \"sentry.company.com\")\n* @returns true if SaaS instance, false if self-hosted\n*/\nfunction isSentryHost(host) {\n\treturn host === \"sentry.io\" || host.endsWith(\".sentry.io\");\n}\n/**\n* Generates a Sentry issue URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param issueId Issue identifier (e.g., \"PROJECT-123\")\n* @returns The complete issue URL\n*/\nfunction getIssueUrl(host, organizationSlug, issueId) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\treturn isSaas ? `https://${organizationSlug}.${webHost}/issues/${issueId}` : `https://${host}/organizations/${organizationSlug}/issues/${issueId}`;\n}\n/**\n* Generates a Sentry issues search URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param query Optional search query\n* @param projectSlugOrId Optional project slug or ID\n* @returns The complete issues search URL\n*/\nfunction getIssuesSearchUrl(host, organizationSlug, query, projectSlugOrId) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\tlet url = isSaas ? `https://${organizationSlug}.${webHost}/issues/` : `https://${host}/organizations/${organizationSlug}/issues/`;\n\tconst params = new URLSearchParams();\n\tif (projectSlugOrId) params.append(\"project\", projectSlugOrId);\n\tif (query) params.append(\"query\", query);\n\tconst queryString = params.toString();\n\tif (queryString) url += `?${queryString}`;\n\treturn url;\n}\n/**\n* Generates a Sentry trace URL for performance investigation.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param traceId Trace identifier\n* @returns The complete trace URL\n*/\nfunction getTraceUrl(host, organizationSlug, traceId) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\treturn isSaas ? `https://${organizationSlug}.${webHost}/explore/traces/trace/${traceId}` : `https://${host}/organizations/${organizationSlug}/explore/traces/trace/${traceId}`;\n}\n/**\n* Generates a Sentry events explorer URL.\n* @param host The Sentry host (may include regional subdomain for API access)\n* @param organizationSlug Organization identifier\n* @param query Search query\n* @param dataset Dataset type\n* @param projectSlug Optional project slug\n* @param fields Optional fields to display\n* @returns The complete events explorer URL\n*/\nfunction getEventsExplorerUrl(host, organizationSlug, query, dataset = \"spans\", projectSlug, fields) {\n\tconst isSaas = isSentryHost(host);\n\tconst webHost = isSaas ? \"sentry.io\" : host;\n\tlet url = isSaas ? `https://${organizationSlug}.${webHost}/explore/` : `https://${host}/organizations/${organizationSlug}/explore/`;\n\tconst params = new URLSearchParams();\n\tparams.append(\"query\", query);\n\tparams.append(\"dataset\", dataset);\n\tparams.append(\"layout\", \"table\");\n\tif (projectSlug) params.append(\"project\", projectSlug);\n\tif (fields && fields.length > 0) for (const field of fields) params.append(\"field\", field);\n\turl += `?${params.toString()}`;\n\treturn url;\n}\n/**\n* Internal validation function that checks if a SENTRY_HOST value contains only hostname (no protocol).\n* Throws an error if validation fails instead of exiting the process.\n*\n* @param host The hostname to validate\n* @throws {Error} If the host contains a protocol\n*/\nfunction _validateSentryHostInternal(host) {\n\tif (host.startsWith(\"http://\") || host.startsWith(\"https://\")) throw new Error(\"SENTRY_HOST should only contain a hostname (e.g., sentry.example.com). Use SENTRY_URL if you want to provide a full URL.\");\n}\n/**\n* Internal validation function that checks if a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Throws an error if validation fails instead of exiting the process.\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n* @throws {Error} If the URL is invalid or not HTTPS\n*/\nfunction _validateAndParseSentryUrlInternal(url) {\n\tif (!url.startsWith(\"https://\")) throw new Error(\"SENTRY_URL must be a full HTTPS URL (e.g., https://sentry.example.com).\");\n\ttry {\n\t\tconst parsedUrl = new URL(url);\n\t\treturn parsedUrl.host;\n\t} catch (error) {\n\t\tthrow new Error(\"SENTRY_URL must be a valid HTTPS URL (e.g., https://sentry.example.com).\");\n\t}\n}\n/**\n* Validates that a SENTRY_HOST value contains only hostname (no protocol).\n* Exits the process with error code 1 if validation fails (CLI behavior).\n*\n* @param host The hostname to validate\n*/\nfunction validateSentryHost(host) {\n\ttry {\n\t\t_validateSentryHostInternal(host);\n\t} catch (error) {\n\t\tconsole.error(`Error: ${error.message}`);\n\t\tprocess.exit(1);\n\t}\n}\n/**\n* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Exits the process with error code 1 if validation fails (CLI behavior).\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n*/\nfunction validateAndParseSentryUrl(url) {\n\ttry {\n\t\treturn _validateAndParseSentryUrlInternal(url);\n\t} catch (error) {\n\t\tconsole.error(`Error: ${error.message}`);\n\t\tprocess.exit(1);\n\t}\n}\n/**\n* Validates that a SENTRY_HOST value contains only hostname (no protocol).\n* Throws an error instead of exiting the process (for testing).\n*\n* @param host The hostname to validate\n* @throws {Error} If the host contains a protocol\n*/\nfunction validateSentryHostThrows(host) {\n\t_validateSentryHostInternal(host);\n}\n/**\n* Validates that a SENTRY_URL value is a valid HTTPS URL and extracts the hostname.\n* Throws an error instead of exiting the process (for testing).\n*\n* @param url The HTTPS URL to validate and parse\n* @returns The extracted hostname from the URL\n* @throws {Error} If the URL is invalid or not HTTPS\n*/\nfunction validateAndParseSentryUrlThrows(url) {\n\treturn _validateAndParseSentryUrlInternal(url);\n}\n/**\n* Validates that the provided OpenAI base URL is a valid HTTP(S) URL and returns a normalized string.\n*\n* @param url The URL to validate and normalize\n* @returns The normalized URL string\n* @throws {Error} If the URL is empty, invalid, or uses an unsupported protocol\n*/\nfunction validateOpenAiBaseUrlThrows(url) {\n\tconst trimmed = url.trim();\n\tif (trimmed.length === 0) throw new Error(\"OPENAI base URL must not be empty.\");\n\tlet parsed;\n\ttry {\n\t\tparsed = new URL(trimmed);\n\t} catch (error) {\n\t\tthrow new Error(\"OPENAI base URL must be a valid HTTP or HTTPS URL (e.g., https://example.com/v1).\", { cause: error });\n\t}\n\tif (parsed.protocol !== \"https:\" && parsed.protocol !== \"http:\") throw new Error(\"OPENAI base URL must use http or https scheme (e.g., https://example.com/v1).\");\n\treturn parsed.toString();\n}\n\n//#endregion\nexport { getEventsExplorerUrl, getIssueUrl, getIssuesSearchUrl, getTraceUrl, isSentryHost, validateAndParseSentryUrl, validateAndParseSentryUrlThrows, validateOpenAiBaseUrlThrows, validateSentryHost, validateSentryHostThrows };\n//# sourceMappingURL=url-utils-hSW2gkfr.js.map","import { ALL_SKILLS, parseSkills, type Skill } from \"@sentry/mcp-core/skills\";\nimport {\n validateAndParseSentryUrlThrows,\n validateOpenAiBaseUrlThrows,\n validateSentryHostThrows,\n} from \"@sentry/mcp-core/utils/url-utils\";\nimport type { MergedArgs, ResolvedConfig } 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\nexport function finalize(input: MergedArgs): ResolvedConfig {\n // Access token required\n if (!input.accessToken) {\n throw new Error(\n \"Error: No access token was provided. Pass one with `--access-token` or via `SENTRY_ACCESS_TOKEN`.\",\n );\n }\n\n // Determine host from url/host with validation\n let sentryHost = \"sentry.io\";\n if (input.url) {\n sentryHost = validateAndParseSentryUrlThrows(input.url);\n } else if (input.host) {\n validateSentryHostThrows(input.host);\n sentryHost = input.host;\n }\n\n // Skills resolution\n //\n // IMPORTANT: stdio (CLI) intentionally defaults to ALL skills when no --skills flag is provided\n //\n // This differs from the OAuth flow, which requires explicit user selection:\n // - stdio/CLI: Non-interactive, defaults to ALL skills (inspect, docs, seer, triage, project-management)\n // - OAuth: Interactive, requires user to explicitly select skills (with sensible defaults pre-checked)\n //\n // Rationale:\n // We don't want the MCP to break if users don't specify skills. stdio is typically used in\n // local development and CI/CD environments where maximum access by default is expected.\n // OAuth is used in multi-tenant hosted environments where users should consciously grant\n // permissions on a per-app basis.\n //\n // For OAuth validation that enforces minimum 1 skill selection, see:\n // packages/mcp-cloudflare/src/server/oauth/routes/callback.ts (lines 234-248)\n //\n let finalSkills: Set<Skill>;\n if (input.skills) {\n // Override: use only the specified skills\n const { valid, invalid } = parseSkills(input.skills);\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid));\n }\n if (valid.size === 0) {\n throw new Error(\"Error: Invalid skills provided. No valid skills found.\");\n }\n finalSkills = valid;\n } else {\n // Default: grant ALL skills when no flag is provided (see comment block above for rationale)\n finalSkills = new Set<Skill>(ALL_SKILLS);\n }\n\n // Disable-skills: remove specific skills from the active set\n if (input.disableSkills) {\n const { valid: skillsToDisable, invalid } = parseSkills(\n input.disableSkills,\n );\n if (invalid.length > 0) {\n throw new Error(formatInvalidSkills(invalid, \"--disable-skills\"));\n }\n for (const skill of skillsToDisable) {\n finalSkills.delete(skill);\n }\n if (finalSkills.size === 0) {\n throw new Error(\n \"Error: All skills have been disabled. At least one skill must remain enabled.\",\n );\n }\n }\n\n const resolvedOpenAiBaseUrl = input.openaiBaseUrl\n ? validateOpenAiBaseUrlThrows(input.openaiBaseUrl)\n : undefined;\n\n // Validate anthropic base URL if provided (same validation as OpenAI)\n const resolvedAnthropicBaseUrl = input.anthropicBaseUrl\n ? validateOpenAiBaseUrlThrows(input.anthropicBaseUrl)\n : undefined;\n\n // Validate agent provider if explicitly set\n let agentProvider: \"openai\" | \"anthropic\" | undefined = undefined;\n if (input.agentProvider) {\n const provider = input.agentProvider.toLowerCase();\n if (provider !== \"openai\" && provider !== \"anthropic\") {\n throw new Error(\n `Error: Invalid agent provider \"${input.agentProvider}\". Must be \"openai\" or \"anthropic\".`,\n );\n }\n agentProvider = provider;\n }\n\n return {\n accessToken: input.accessToken,\n sentryHost,\n mcpUrl: input.mcpUrl,\n sentryDsn: input.sentryDsn,\n openaiBaseUrl: resolvedOpenAiBaseUrl,\n openaiModel: input.openaiModel,\n anthropicBaseUrl: resolvedAnthropicBaseUrl,\n anthropicModel: input.anthropicModel,\n agentProvider,\n finalSkills,\n organizationSlug: input.organizationSlug,\n projectSlug: input.projectSlug,\n };\n}\n"],"mappings":";;AACA,MAAM,SAAS;CACd,SAAS;EACR,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,MAAM;EACL,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,QAAQ;EACP,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;CACD,sBAAsB;EACrB,IAAI;EACJ,MAAM;EACN,aAAa;EACb,gBAAgB;EAChB,OAAO;CACP;AACD;AACD,MAAM,eAAe,OAAO,OAAO,OAAO,CAAC,KAAK,CAAC,GAAG,MAAM,EAAE,QAAQ,EAAE,MAAM;AAY5E,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,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/C,M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AI,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;AACJ,KAAI,MAAM,eAAe;EACvB,MAAM,WAAW,MAAM,cAAc,aAAa;AAClD,MAAI,aAAa,YAAY,aAAa,YACxC,OAAM,IAAI,OACP,iCAAiC,MAAM,cAAc;AAG1D,kBAAgB;CACjB;AAED,QAAO;EACL,aAAa,MAAM;EACnB;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,9 +1,9 @@
|
|
|
1
|
-
const require_chunk = require('./chunk-
|
|
1
|
+
const require_chunk = require('./chunk-Cv9WC9bY.cjs');
|
|
2
2
|
const __modelcontextprotocol_sdk_server_stdio_js = require_chunk.__toESM(require("@modelcontextprotocol/sdk/server/stdio.js"));
|
|
3
3
|
const __sentry_node = require_chunk.__toESM(require("@sentry/node"));
|
|
4
4
|
|
|
5
|
-
//#region ../mcp-core/dist/version-
|
|
6
|
-
const LIB_VERSION = typeof process !== "undefined" && "0.
|
|
5
|
+
//#region ../mcp-core/dist/version-CQ6lY8HC.js
|
|
6
|
+
const LIB_VERSION = typeof process !== "undefined" && "0.30.0" || "0.0.0";
|
|
7
7
|
const USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;
|
|
8
8
|
|
|
9
9
|
//#endregion
|
|
@@ -70,4 +70,4 @@ Object.defineProperty(exports, 'startStdio', {
|
|
|
70
70
|
return startStdio;
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
|
-
//# sourceMappingURL=stdio-
|
|
73
|
+
//# sourceMappingURL=stdio-BlFtz2dW.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio-
|
|
1
|
+
{"version":3,"file":"stdio-BlFtz2dW.cjs","names":["server: McpServer","context: ServerContext","StdioServerTransport"],"sources":["../../mcp-core/dist/version-CQ6lY8HC.js","../src/transports/stdio.ts"],"sourcesContent":["//#region src/version.ts\nconst LIB_VERSION = typeof process !== \"undefined\" && \"0.30.0\" || \"0.0.0\";\nconst USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;\n\n//#endregion\nexport { LIB_VERSION, USER_AGENT };\n//# sourceMappingURL=version-CQ6lY8HC.js.map","/**\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 \"mcp.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":";;;;;AACA,MAAM,qBAAqB,YAAY,eAAe,YAAY;AAClE,MAAM,cAAc,aAAa,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACmD7C,eAAsB,WAAWA,QAAmBC,SAAwB;AAC1E,OAAM,cAAO,cAAc,YAAY;AACrC,SAAO,MAAM,cAAO,UAClB;GACE,MAAM;GACN,YAAY;IACV,iBAAiB;IACjB,qBAAqB;IACrB,mBAAmB;GACpB;EACF,GACD,YAAY;GAEV,MAAM,YAAY,IAAIC;AACtB,SAAM,OAAO,QAAQ,UAAU;EAChC,EACF;CACF,EAAC;AACH"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
2
2
|
import * as Sentry from "@sentry/node";
|
|
3
3
|
|
|
4
|
-
//#region ../mcp-core/dist/version-
|
|
5
|
-
const LIB_VERSION = typeof process !== "undefined" && "0.
|
|
4
|
+
//#region ../mcp-core/dist/version-CQ6lY8HC.js
|
|
5
|
+
const LIB_VERSION = typeof process !== "undefined" && "0.30.0" || "0.0.0";
|
|
6
6
|
const USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
@@ -52,4 +52,4 @@ async function startStdio(server, context) {
|
|
|
52
52
|
|
|
53
53
|
//#endregion
|
|
54
54
|
export { LIB_VERSION, USER_AGENT, startStdio };
|
|
55
|
-
//# sourceMappingURL=stdio-
|
|
55
|
+
//# sourceMappingURL=stdio-D7HAkmRe.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stdio-
|
|
1
|
+
{"version":3,"file":"stdio-D7HAkmRe.js","names":["server: McpServer","context: ServerContext"],"sources":["../../mcp-core/dist/version-CQ6lY8HC.js","../src/transports/stdio.ts"],"sourcesContent":["//#region src/version.ts\nconst LIB_VERSION = typeof process !== \"undefined\" && \"0.30.0\" || \"0.0.0\";\nconst USER_AGENT = `sentry-mcp/${LIB_VERSION} (https://mcp.sentry.dev)`;\n\n//#endregion\nexport { LIB_VERSION, USER_AGENT };\n//# sourceMappingURL=version-CQ6lY8HC.js.map","/**\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 \"mcp.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":";;;;AACA,MAAM,qBAAqB,YAAY,eAAe,YAAY;AAClE,MAAM,cAAc,aAAa,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACmD7C,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"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-Cv9WC9bY.cjs');
|
|
2
|
+
const require_token_error$1 = require('./token-error-BCFB3iKM.cjs');
|
|
3
|
+
const require_token_util$1 = require('./token-util-CMaRPlqM.cjs');
|
|
4
|
+
|
|
5
|
+
//#region ../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js
|
|
6
|
+
var require_token = require_chunk.__commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js"(exports, module) {
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all) __defProp(target, name, {
|
|
13
|
+
get: all[name],
|
|
14
|
+
enumerable: true
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
19
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
20
|
+
get: () => from[key],
|
|
21
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var token_exports = {};
|
|
28
|
+
__export(token_exports, { refreshToken: () => refreshToken });
|
|
29
|
+
module.exports = __toCommonJS(token_exports);
|
|
30
|
+
var import_token_error = require_token_error$1.require_token_error();
|
|
31
|
+
var import_token_util = require_token_util$1.require_token_util();
|
|
32
|
+
async function refreshToken() {
|
|
33
|
+
const { projectId, teamId } = (0, import_token_util.findProjectInfo)();
|
|
34
|
+
let maybeToken = (0, import_token_util.loadToken)(projectId);
|
|
35
|
+
if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token))) {
|
|
36
|
+
const authToken = await (0, import_token_util.getVercelCliToken)();
|
|
37
|
+
if (!authToken) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");
|
|
38
|
+
if (!projectId) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");
|
|
39
|
+
maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);
|
|
40
|
+
if (!maybeToken) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token");
|
|
41
|
+
(0, import_token_util.saveToken)(maybeToken, projectId);
|
|
42
|
+
}
|
|
43
|
+
process.env.VERCEL_OIDC_TOKEN = maybeToken.token;
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
} });
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
Object.defineProperty(exports, 'default', {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function () {
|
|
52
|
+
return require_token();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=token-C7V4_3ji.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-C7V4_3ji.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"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { __commonJS, require_token_error } from "./token-error-Df8A7mgb.js";
|
|
2
|
+
import { require_token_util } from "./token-util-CQ4Ghf_7.js";
|
|
3
|
+
|
|
4
|
+
//#region ../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js
|
|
5
|
+
var require_token = __commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token.js"(exports, module) {
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __export = (target, all) => {
|
|
11
|
+
for (var name in all) __defProp(target, name, {
|
|
12
|
+
get: all[name],
|
|
13
|
+
enumerable: true
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
var __copyProps = (to, from, except, desc) => {
|
|
17
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
18
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
19
|
+
get: () => from[key],
|
|
20
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
return to;
|
|
24
|
+
};
|
|
25
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
26
|
+
var token_exports = {};
|
|
27
|
+
__export(token_exports, { refreshToken: () => refreshToken });
|
|
28
|
+
module.exports = __toCommonJS(token_exports);
|
|
29
|
+
var import_token_error = require_token_error();
|
|
30
|
+
var import_token_util = require_token_util();
|
|
31
|
+
async function refreshToken() {
|
|
32
|
+
const { projectId, teamId } = (0, import_token_util.findProjectInfo)();
|
|
33
|
+
let maybeToken = (0, import_token_util.loadToken)(projectId);
|
|
34
|
+
if (!maybeToken || (0, import_token_util.isExpired)((0, import_token_util.getTokenPayload)(maybeToken.token))) {
|
|
35
|
+
const authToken = await (0, import_token_util.getVercelCliToken)();
|
|
36
|
+
if (!authToken) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: Log in to Vercel CLI and link your project with `vc link`");
|
|
37
|
+
if (!projectId) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token: Try re-linking your project with `vc link`");
|
|
38
|
+
maybeToken = await (0, import_token_util.getVercelOidcToken)(authToken, projectId, teamId);
|
|
39
|
+
if (!maybeToken) throw new import_token_error.VercelOidcTokenError("Failed to refresh OIDC token");
|
|
40
|
+
(0, import_token_util.saveToken)(maybeToken, projectId);
|
|
41
|
+
}
|
|
42
|
+
process.env.VERCEL_OIDC_TOKEN = maybeToken.token;
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
} });
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
export default require_token();
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=token-CwkkxgwR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-CwkkxgwR.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"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const require_chunk = require('./chunk-Cv9WC9bY.cjs');
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token-error.js
|
|
4
|
+
var require_token_error = require_chunk.__commonJS({ "../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token-error.js"(exports, module) {
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
7
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __export = (target, all) => {
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
var __copyProps = (to, from, except, desc) => {
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
+
get: () => from[key],
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
|
+
};
|
|
24
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
25
|
+
var token_error_exports = {};
|
|
26
|
+
__export(token_error_exports, { VercelOidcTokenError: () => VercelOidcTokenError });
|
|
27
|
+
module.exports = __toCommonJS(token_error_exports);
|
|
28
|
+
var VercelOidcTokenError = class extends Error {
|
|
29
|
+
constructor(message, cause) {
|
|
30
|
+
super(message);
|
|
31
|
+
this.name = "VercelOidcTokenError";
|
|
32
|
+
this.cause = cause;
|
|
33
|
+
}
|
|
34
|
+
toString() {
|
|
35
|
+
if (this.cause) return `${this.name}: ${this.message}: ${this.cause}`;
|
|
36
|
+
return `${this.name}: ${this.message}`;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
} });
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
Object.defineProperty(exports, 'require_token_error', {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () {
|
|
45
|
+
return require_token_error;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
//# sourceMappingURL=token-error-BCFB3iKM.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"token-error-BCFB3iKM.cjs","names":[],"sources":["../../../node_modules/.pnpm/@vercel+oidc@3.1.0/node_modules/@vercel/oidc/dist/token-error.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_error_exports = {};\n__export(token_error_exports, {\n VercelOidcTokenError: () => VercelOidcTokenError\n});\nmodule.exports = __toCommonJS(token_error_exports);\nclass VercelOidcTokenError extends Error {\n constructor(message, cause) {\n super(message);\n this.name = \"VercelOidcTokenError\";\n this.cause = cause;\n }\n toString() {\n if (this.cause) {\n return `${this.name}: ${this.message}: ${this.cause}`;\n }\n return `${this.name}: ${this.message}`;\n }\n}\n// Annotate the CommonJS export names for ESM import in node:\n0 && (module.exports = {\n VercelOidcTokenError\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,sBAAsB,CAAE;AAC5B,UAAS,qBAAqB,EAC5B,sBAAsB,MAAM,qBAC7B,EAAC;AACF,QAAO,UAAU,aAAa,oBAAoB;CAClD,IAAM,uBAAN,cAAmC,MAAM;EACvC,YAAY,SAAS,OAAO;AAC1B,SAAM,QAAQ;AACd,QAAK,OAAO;AACZ,QAAK,QAAQ;EACd;EACD,WAAW;AACT,OAAI,KAAK,MACP,WAAU,KAAK,KAAK,IAAI,KAAK,QAAQ,IAAI,KAAK;AAEhD,aAAU,KAAK,KAAK,IAAI,KAAK;EAC9B;CACF"}
|