@tableau/mcp-server 2.7.4 → 2.9.3

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.
@@ -1,3 +1,3 @@
1
- "use strict";var xe=Object.create;var j=Object.defineProperty;var He=Object.getOwnPropertyDescriptor;var ke=Object.getOwnPropertyNames;var Ke=Object.getPrototypeOf,Ge=Object.prototype.hasOwnProperty;var Ye=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ke(t))!Ge.call(e,i)&&i!==r&&j(e,i,{get:()=>t[i],enumerable:!(o=He(t,i))||o.enumerable});return e};var je=(e,t,r)=>(r=e!=null?xe(Ke(e)):{},Ye(t||!e||!e.__esModule?j(r,"default",{value:e,enumerable:!0}):r,e));var ee=je(require("dotenv"));var X=require("path");var p=require("fs");var z=require("path");var Be;var B=()=>Be;var Fe=["debug","info","notice","warning","error","critical","alert","emergency"],E=Object.fromEntries(Fe.map((e,t)=>[e,t]));function We(e,t){return E[e]>=E[t]}function Je(e){return e in E}function F(e){let t=e?.trim();return t&&Je(t)?t:"info"}function $e(e){return e instanceof Error?{name:e.name,message:e.message,stack:e.stack,...e.cause!==void 0&&{cause:e.cause}}:e}function P(e){let t=W();if(We(e.level,t.logLevel)){if(e.data=$e(e.data),t.loggers.has("appLogger")){let r=JSON.stringify(e);t.transport==="http"?console.log(r):process.stderr.write(r+`
2
- `)}t.loggers.has("fileLogger")&&B()?.log(e)}}var ze=["fileLogger","appLogger"],qe=new Set(ze);function J(e){return e?new Set(e.split(",").map(t=>t.trim()).filter(t=>qe.has(t))):new Set(["appLogger"])}var Qe=["stdio","http"];function _(e){return!!Qe.find(t=>t===e)}function $(){if(typeof __dirname=="string")return __dirname;throw new Error("__dirname is not set")}var l={fromSeconds:e=>e*1e3,fromMinutes:e=>e*60*1e3,fromHours:e=>e*60*60*1e3,fromDays:e=>e*24*60*60*1e3,fromWeeks:e=>e*7*24*60*60*1e3,fromMonths:e=>e*30*24*60*60*1e3,fromYears:e=>e*365.25*24*60*60*1e3};function a(e,{defaultValue:t,minValue:r,maxValue:o}={defaultValue:0,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.POSITIVE_INFINITY}){if(!e)return t;let i=parseFloat(e);return isNaN(i)||r!==void 0&&i<r||o!==void 0&&i>o?t:i}var Xe=$(),c=class{transport;defaultNotificationLevel;logLevel;loggers;fileLoggerDirectory;maxRequestTimeoutMs;notificationPayloadMaxBytes;constructor(){let t=R(process.env),{TRANSPORT:r,DEFAULT_NOTIFICATION_LEVEL:o,LOG_LEVEL:i,ENABLED_LOGGERS:u,FILE_LOGGER_DIRECTORY:f,MAX_REQUEST_TIMEOUT_MS:v,NOTIFICATION_PAYLOAD_MAX_BYTES:S}=t;this.transport=_(r)?r:"stdio",this.defaultNotificationLevel=o??"debug",this.logLevel=F(i),this.loggers=J(u),this.fileLoggerDirectory=f||(0,z.join)(Xe,"logs"),this.maxRequestTimeoutMs=a(v,{defaultValue:l.fromMinutes(10),minValue:5e3,maxValue:l.fromHours(1)}),this.notificationPayloadMaxBytes=a(S,{defaultValue:8192,minValue:1})}};function R(e){return Object.entries(e).reduce((t,[r,o])=>(o?.startsWith("${user_config.")?t[r]="":t[r]=o,t),{})}var W=()=>new c;var n=require("zod"),Ht=n.z.record(n.z.string(),n.z.union([n.z.string(),n.z.number(),n.z.boolean(),n.z.undefined()])),Ze=n.z.enum(["noop","custom"]),et=n.z.object({provider:n.z.literal("noop")}),L=n.z.object({module:n.z.string({required_error:'Custom provider requires "module" path'})}).passthrough(),tt=n.z.object({provider:n.z.literal("custom"),providerConfig:L}),kt=n.z.discriminatedUnion("provider",[et,tt]);function q(e){return Ze.safeParse(e).success}function s(e,t){if(!e)throw new Error(t||"Invariant Violation")}var rt=["pat","uat","direct-trust","oauth"];function ot(e){return rt.some(t=>t===e)}var O=class extends c{auth;server;sslKey;sslCert;httpPort;corsOriginConfig;siteName;patName;patValue;jwtUsername;connectedAppClientId;connectedAppSecretId;connectedAppSecretValue;uatTenantId;uatIssuer;uatUsernameClaimName;uatPrivateKey;uatKeyId;jwtAdditionalPayload;datasourceCredentials;disableLogMasking;disableSessionManagement;tableauServerVersionCheckIntervalInHours;passthroughAuthUserSessionCheckIntervalInMinutes;mcpSiteSettingsCheckIntervalInMinutes;enableMcpSiteSettings;allowSitesToConfigureRequestOverrides;enablePassthroughAuth;oauth;telemetry;latencyMetricName;productTelemetryEndpoint;productTelemetryEnabled;isHyperforce;breakGlassDisableGlobally;adminToolsEnabled;constructor(){super();let t=R(process.env),{AUTH:r,SERVER:o,SITE_NAME:i,TRANSPORT:u,SSL_KEY:f,SSL_CERT:v,HTTP_PORT_ENV_VAR_NAME:S,CORS_ORIGIN_CONFIG:te,PAT_NAME:C,PAT_VALUE:w,JWT_SUB_CLAIM:h,CONNECTED_APP_CLIENT_ID:U,CONNECTED_APP_SECRET_ID:N,CONNECTED_APP_SECRET_VALUE:M,UAT_TENANT_ID:V,UAT_ISSUER:D,UAT_USERNAME_CLAIM_NAME:re,UAT_USERNAME_CLAIM:x,UAT_PRIVATE_KEY:y,UAT_PRIVATE_KEY_PATH:m,UAT_KEY_ID:oe,JWT_ADDITIONAL_PAYLOAD:ie,DATASOURCE_CREDENTIALS:ne,DISABLE_LOG_MASKING:se,DISABLE_SESSION_MANAGEMENT:ae,TABLEAU_SERVER_VERSION_CHECK_INTERVAL_IN_HOURS:le,PASSTHROUGH_AUTH_USER_SESSION_CHECK_INTERVAL_IN_MINUTES:ue,MCP_SITE_SETTINGS_CHECK_INTERVAL_IN_MINUTES:me,ENABLE_MCP_SITE_SETTINGS:de,ALLOW_SITES_TO_CONFIGURE_REQUEST_OVERRIDES:ce,ENABLE_PASSTHROUGH_AUTH:pe,DANGEROUSLY_DISABLE_OAUTH:he,OAUTH_EMBEDDED_AUTHZ_SERVER:Te,OAUTH_ISSUER:T,OAUTH_LOCK_SITE:ge,OAUTH_JWE_PRIVATE_KEY:Ee,OAUTH_JWE_PRIVATE_KEY_PATH:_e,OAUTH_JWE_PRIVATE_KEY_PASSPHRASE:fe,OAUTH_RESOURCE_URI:ve,OAUTH_GLOBAL_RESOURCE_URI:Se,OAUTH_REDIRECT_URI:ye,OAUTH_CLIENT_ID_SECRET_PAIRS:A,OAUTH_CIMD_DNS_SERVERS:H,ADVERTISE_API_SCOPES:Ae,OAUTH_AUTHORIZATION_CODE_TIMEOUT_MS:Ie,OAUTH_ACCESS_TOKEN_TIMEOUT_MS:be,OAUTH_REFRESH_TOKEN_TIMEOUT_MS:Pe,OAUTH_DISABLE_SCOPES:Re,TELEMETRY_PROVIDER:k,TELEMETRY_PROVIDER_CONFIG:K,LATENCY_METRIC_NAME:Le,PRODUCT_TELEMETRY_ENDPOINT:Oe,PRODUCT_TELEMETRY_ENABLED:Ce,IS_HYPERFORCE:we,BREAK_GLASS_DISABLE_GLOBALLY:Ue,ADMIN_TOOLS_ENABLED:Ne}=t,I="";this.siteName=i??"",this.sslKey=f?.trim()??"",this.sslCert=v?.trim()??"",this.httpPort=a(t[S?.trim()||"PORT"],{defaultValue:3927,minValue:1,maxValue:65535}),this.corsOriginConfig=nt(te?.trim()??""),this.datasourceCredentials=ne??"",this.disableLogMasking=se==="true",this.disableSessionManagement=ae==="true",this.tableauServerVersionCheckIntervalInHours=a(le,{defaultValue:1,minValue:1,maxValue:168}),this.passthroughAuthUserSessionCheckIntervalInMinutes=a(ue,{defaultValue:10,minValue:0,maxValue:1440}),this.mcpSiteSettingsCheckIntervalInMinutes=a(me,{defaultValue:10,minValue:1,maxValue:1440}),this.enableMcpSiteSettings=de!=="false",this.allowSitesToConfigureRequestOverrides=ce==="true",this.enablePassthroughAuth=pe==="true";let b=he==="true",Me=!(Re==="true"),Ve=Te!=="false";if(this.allowSitesToConfigureRequestOverrides&&!this.enableMcpSiteSettings)throw new Error('ALLOW_SITES_TO_CONFIGURE_REQUEST_OVERRIDES is "true", but MCP site settings are not enabled.');if(this.oauth={enabled:b?!1:!!T,embeddedAuthzServer:Ve,issuer:T??"",resourceUri:ve??`http://127.0.0.1:${this.httpPort}`,globalResourceUri:Se??"",redirectUri:ye||(T?`${T}/Callback`:""),lockSite:ge!=="false",jwePrivateKey:Ee??"",jwePrivateKeyPath:_e??"",jwePrivateKeyPassphrase:fe||void 0,dnsServers:H?H.split(",").map(g=>g.trim()):["1.1.1.1","1.0.0.1"],authzCodeTimeoutMs:a(Ie,{defaultValue:l.fromMinutes(10),minValue:0,maxValue:l.fromHours(1)}),accessTokenTimeoutMs:a(be,{defaultValue:l.fromHours(1),minValue:0,maxValue:l.fromDays(30)}),refreshTokenTimeoutMs:a(Pe,{defaultValue:l.fromDays(30),minValue:0,maxValue:l.fromYears(1)}),clientIdSecretPairs:A?A.split(",").reduce((g,De)=>{let[G,Y]=De.split(":");return G&&Y&&(g[G]=Y),g},{}):null,enforceScopes:Me,advertiseApiScopes:Ae==="true"},this.oauth.clientIdSecretPairs&&Object.keys(this.oauth.clientIdSecretPairs).length===0)throw new Error(`OAUTH_CLIENT_ID_SECRET_PAIRS is in an invalid format: ${A}. Should be in the format: clientId:secret`);if((q(k)?k:"noop")==="custom"){if(!K)throw new Error('TELEMETRY_PROVIDER_CONFIG is required when TELEMETRY_PROVIDER is "custom"');this.telemetry={provider:"custom",providerConfig:L.parse(JSON.parse(K))}}else this.telemetry={provider:"noop"};if(this.latencyMetricName=Le||"http_server_1agg1_request_duration",this.productTelemetryEndpoint=Oe||"https://prod.telemetry.tableausoftware.com",this.productTelemetryEnabled=Ce!=="false",this.isHyperforce=we==="true",this.breakGlassDisableGlobally=Ue==="true",this.adminToolsEnabled=Ne==="true",this.auth=ot(r)?r:this.oauth.enabled?"oauth":"pat",this.transport=_(u)?u:this.oauth.enabled?"http":"stdio",this.transport==="http"&&!b&&!this.oauth.issuer)throw new Error('OAUTH_ISSUER must be set when TRANSPORT is "http" unless DANGEROUSLY_DISABLE_OAUTH is "true"');if(this.auth==="oauth"){if(b)throw new Error('When AUTH is "oauth", DANGEROUSLY_DISABLE_OAUTH cannot be "true"');if(!this.oauth.issuer)throw new Error('When AUTH is "oauth", OAUTH_ISSUER must be set')}else s(o,"The environment variable SERVER is not set"),it(o);if(this.oauth.enabled){if(this.oauth.embeddedAuthzServer){if(s(this.oauth.redirectUri,"The environment variable OAUTH_REDIRECT_URI is not set"),!this.oauth.jwePrivateKey&&!this.oauth.jwePrivateKeyPath)throw new Error("One of the environment variables: OAUTH_JWE_PRIVATE_KEY_PATH or OAUTH_JWE_PRIVATE_KEY must be set");if(this.oauth.jwePrivateKey&&this.oauth.jwePrivateKeyPath)throw new Error("Only one of the environment variables: OAUTH_JWE_PRIVATE_KEY or OAUTH_JWE_PRIVATE_KEY_PATH must be set");if(this.oauth.jwePrivateKeyPath&&process.env.TABLEAU_MCP_TEST!=="true"&&!(0,p.existsSync)(this.oauth.jwePrivateKeyPath))throw new Error(`OAuth JWE private key path does not exist: ${this.oauth.jwePrivateKeyPath}`)}if(this.transport==="stdio")throw new Error('TRANSPORT must be "http" when OAUTH_ISSUER is set')}if(this.auth==="pat")s(C,"The environment variable PAT_NAME is not set"),s(w,"The environment variable PAT_VALUE is not set");else if(this.auth==="direct-trust")s(h,"The environment variable JWT_SUB_CLAIM is not set"),s(U,"The environment variable CONNECTED_APP_CLIENT_ID is not set"),s(N,"The environment variable CONNECTED_APP_SECRET_ID is not set"),s(M,"The environment variable CONNECTED_APP_SECRET_VALUE is not set"),I=h??"";else if(this.auth==="uat"){if(s(V,"The environment variable UAT_TENANT_ID is not set"),s(D,"The environment variable UAT_ISSUER is not set"),!x&&!h)throw new Error("One of the environment variables: UAT_USERNAME_CLAIM or JWT_SUB_CLAIM must be set");if(I=x??h??"",!y&&!m)throw new Error("One of the environment variables: UAT_PRIVATE_KEY_PATH or UAT_PRIVATE_KEY must be set");if(y&&m)throw new Error("Only one of the environment variables: UAT_PRIVATE_KEY or UAT_PRIVATE_KEY_PATH must be set");if(m&&process.env.TABLEAU_MCP_TEST!=="true"&&!(0,p.existsSync)(m))throw new Error(`UAT private key path does not exist: ${m}`)}this.server=o??"",this.patName=C??"",this.patValue=w??"",this.jwtUsername=I??"",this.connectedAppClientId=U??"",this.connectedAppSecretId=N??"",this.connectedAppSecretValue=M??"",this.uatTenantId=V??"",this.uatIssuer=D??"",this.uatUsernameClaimName=re||"email",this.uatPrivateKey=y||(m?(0,p.readFileSync)(m,"utf8"):""),this.uatKeyId=oe??"",this.jwtAdditionalPayload=ie||"{}"}};function it(e){if(!["https://","http://"].find(t=>e.startsWith(t)))throw new Error(`The environment variable SERVER must start with "http://" or "https://": ${e}`);try{let t=new URL(e)}catch(t){let r=t instanceof Error?t.message:String(t);throw new Error(`The environment variable SERVER is not a valid URL: ${e} -- ${r}`)}}function nt(e){if(!e)return!0;if(e.match(/^true|false$/i))return e.toLowerCase()==="true";if(e==="*")return"*";if(e.startsWith("[")&&e.endsWith("]"))try{return JSON.parse(e).map(r=>new URL(r).origin)}catch{throw new Error(`The environment variable CORS_ORIGIN_CONFIG is not a valid array of URLs: ${e}`)}try{return new URL(e).origin}catch{throw new Error(`The environment variable CORS_ORIGIN_CONFIG is not a valid URL: ${e}`)}}var Q=()=>new O;var d=class{initialize(){}recordMetric(t,r,o){}recordHistogram(t,r,o){}};function st(e){return Object.getOwnPropertyNames(e.prototype).filter(t=>t!=="constructor"&&typeof e.prototype[t]=="function")}function at(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function lt(e){if(!at(e))throw new Error("Provider must be an object");let r=st(d).filter(o=>typeof e[o]!="function");if(r.length>0)throw new Error(`Custom provider missing required methods: ${r.join(", ")}`)}function Z(){let e=Q(),t;try{switch(e.telemetry.provider){case"custom":t=ut(e.telemetry.providerConfig);break;case"noop":t=new d;break}return t.initialize(),global.__telemetryProvider=t,t}catch(r){P({message:"Failed to initialize telemetry provider",level:"error",logger:"telemetry",data:r}),P({message:"Falling back to NoOp telemetry provider",level:"info",logger:"telemetry"});let o=new d;return o.initialize(),global.__telemetryProvider=o,o}}function ut(e){if(!e?.module)throw new Error(`Custom telemetry provider requires "module" in providerConfig. Example: TELEMETRY_PROVIDER_CONFIG='{"module":"./my-telemetry.js"}'`);let t=e.module;if(typeof t!="string")throw new Error('Custom telemetry provider requires "module" to be a string');let r;t.startsWith(".")||t.startsWith("/")?r=(0,X.resolve)(process.cwd(),t):r=t;try{let o=require(r),i=o.default||o.TelemetryProvider;if(!i)throw new Error(`Module ${t} must export a default class or named export "TelemetryProvider" that implements the TelemetryProvider interface`);let u=new i(e);return lt(u),u}catch(o){let i=`Failed to load custom telemetry provider from "${t}". `;throw o instanceof Error&&"code"in o&&o.code==="MODULE_NOT_FOUND"?i+="Module not found. If using a file path, ensure the file exists and the path is correct. If using an npm package, ensure it is installed.":i+=`Error: ${o}`,new Error(i)}}ee.default.config();try{Z()}catch(e){console.warn("Failed to initialize telemetry:",e)}
1
+ "use strict";var De=Object.create;var B=Object.defineProperty;var xe=Object.getOwnPropertyDescriptor;var He=Object.getOwnPropertyNames;var ke=Object.getPrototypeOf,Ke=Object.prototype.hasOwnProperty;var Ge=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of He(t))!Ke.call(e,i)&&i!==r&&B(e,i,{get:()=>t[i],enumerable:!(o=xe(t,i))||o.enumerable});return e};var Ye=(e,t,r)=>(r=e!=null?De(ke(e)):{},Ge(t||!e||!e.__esModule?B(r,"default",{value:e,enumerable:!0}):r,e));var te=Ye(require("dotenv"));var Z=require("path");var p=require("fs");var q=require("path");var je;var F=()=>je;var Be=["debug","info","notice","warning","error","critical","alert","emergency"],E=Object.fromEntries(Be.map((e,t)=>[e,t]));function Fe(e,t){return E[e]>=E[t]}function We(e){return e in E}function W(e){let t=e?.trim();return t&&We(t)?t:"info"}function Je(e){return e instanceof Error?{name:e.name,message:e.message,stack:e.stack,...e.cause!==void 0&&{cause:e.cause}}:e}function R(e){let t=J();if(Fe(e.level,t.logLevel)){if(e.data=Je(e.data),t.loggers.has("appLogger")){let r=JSON.stringify(e);t.transport==="http"?console.log(r):process.stderr.write(r+`
2
+ `)}t.loggers.has("fileLogger")&&F()?.log(e)}}var $e=["fileLogger","appLogger"],ze=new Set($e);function $(e){return e?new Set(e.split(",").map(t=>t.trim()).filter(t=>ze.has(t))):new Set(["appLogger"])}var qe=["stdio","http"];function _(e){return!!qe.find(t=>t===e)}function z(){if(typeof __dirname=="string")return __dirname;throw new Error("__dirname is not set")}var l={fromSeconds:e=>e*1e3,fromMinutes:e=>e*60*1e3,fromHours:e=>e*60*60*1e3,fromDays:e=>e*24*60*60*1e3,fromWeeks:e=>e*7*24*60*60*1e3,fromMonths:e=>e*30*24*60*60*1e3,fromYears:e=>e*365.25*24*60*60*1e3};function a(e,{defaultValue:t,minValue:r,maxValue:o}={defaultValue:0,minValue:Number.NEGATIVE_INFINITY,maxValue:Number.POSITIVE_INFINITY}){if(!e)return t;let i=parseFloat(e);return isNaN(i)||r!==void 0&&i<r||o!==void 0&&i>o?t:i}var Qe=z(),c=class{transport;defaultNotificationLevel;logLevel;loggers;fileLoggerDirectory;disableLogMasking;maxRequestTimeoutMs;notificationPayloadMaxBytes;constructor(){let t=L(process.env),{TRANSPORT:r,DEFAULT_NOTIFICATION_LEVEL:o,LOG_LEVEL:i,ENABLED_LOGGERS:u,FILE_LOGGER_DIRECTORY:f,DISABLE_LOG_MASKING:v,MAX_REQUEST_TIMEOUT_MS:S,NOTIFICATION_PAYLOAD_MAX_BYTES:y}=t;this.transport=_(r)?r:"stdio",this.defaultNotificationLevel=o??"debug",this.logLevel=W(i),this.loggers=$(u),this.fileLoggerDirectory=f||(0,q.join)(Qe,"logs"),this.disableLogMasking=v==="true",this.maxRequestTimeoutMs=a(S,{defaultValue:l.fromMinutes(10),minValue:5e3,maxValue:l.fromHours(1)}),this.notificationPayloadMaxBytes=a(y,{defaultValue:8192,minValue:1})}};function L(e){return Object.entries(e).reduce((t,[r,o])=>(o?.startsWith("${user_config.")?t[r]="":t[r]=o,t),{})}var J=()=>new c;var n=require("zod"),xt=n.z.record(n.z.string(),n.z.union([n.z.string(),n.z.number(),n.z.boolean(),n.z.undefined()])),Xe=n.z.enum(["noop","custom"]),Ze=n.z.object({provider:n.z.literal("noop")}),O=n.z.object({module:n.z.string({required_error:'Custom provider requires "module" path'})}).passthrough(),et=n.z.object({provider:n.z.literal("custom"),providerConfig:O}),Ht=n.z.discriminatedUnion("provider",[Ze,et]);function Q(e){return Xe.safeParse(e).success}function s(e,t){if(!e)throw new Error(t||"Invariant Violation")}var tt=["pat","uat","direct-trust","oauth"];function rt(e){return tt.some(t=>t===e)}var C=class extends c{auth;server;sslKey;sslCert;httpPort;corsOriginConfig;siteName;patName;patValue;jwtUsername;connectedAppClientId;connectedAppSecretId;connectedAppSecretValue;uatTenantId;uatIssuer;uatUsernameClaimName;uatPrivateKey;uatKeyId;jwtAdditionalPayload;datasourceCredentials;disableSessionManagement;tableauServerVersionCheckIntervalInHours;passthroughAuthUserSessionCheckIntervalInMinutes;mcpSiteSettingsCheckIntervalInMinutes;enableMcpSiteSettings;allowSitesToConfigureRequestOverrides;enablePassthroughAuth;oauth;telemetry;latencyMetricName;productTelemetryEndpoint;productTelemetryEnabled;isHyperforce;breakGlassDisableGlobally;adminToolsEnabled;constructor(){super();let t=L(process.env),{AUTH:r,SERVER:o,SITE_NAME:i,TRANSPORT:u,SSL_KEY:f,SSL_CERT:v,HTTP_PORT_ENV_VAR_NAME:S,CORS_ORIGIN_CONFIG:y,PAT_NAME:w,PAT_VALUE:U,JWT_SUB_CLAIM:h,CONNECTED_APP_CLIENT_ID:N,CONNECTED_APP_SECRET_ID:M,CONNECTED_APP_SECRET_VALUE:V,UAT_TENANT_ID:D,UAT_ISSUER:x,UAT_USERNAME_CLAIM_NAME:re,UAT_USERNAME_CLAIM:H,UAT_PRIVATE_KEY:A,UAT_PRIVATE_KEY_PATH:m,UAT_KEY_ID:oe,JWT_ADDITIONAL_PAYLOAD:ie,DATASOURCE_CREDENTIALS:ne,DISABLE_SESSION_MANAGEMENT:se,TABLEAU_SERVER_VERSION_CHECK_INTERVAL_IN_HOURS:ae,PASSTHROUGH_AUTH_USER_SESSION_CHECK_INTERVAL_IN_MINUTES:le,MCP_SITE_SETTINGS_CHECK_INTERVAL_IN_MINUTES:ue,ENABLE_MCP_SITE_SETTINGS:me,ALLOW_SITES_TO_CONFIGURE_REQUEST_OVERRIDES:de,ENABLE_PASSTHROUGH_AUTH:ce,DANGEROUSLY_DISABLE_OAUTH:pe,OAUTH_EMBEDDED_AUTHZ_SERVER:he,OAUTH_ISSUER:T,OAUTH_LOCK_SITE:Te,OAUTH_JWE_PRIVATE_KEY:ge,OAUTH_JWE_PRIVATE_KEY_PATH:Ee,OAUTH_JWE_PRIVATE_KEY_PASSPHRASE:_e,OAUTH_RESOURCE_URI:fe,OAUTH_GLOBAL_RESOURCE_URI:ve,OAUTH_REDIRECT_URI:Se,OAUTH_CLIENT_ID_SECRET_PAIRS:I,OAUTH_CIMD_DNS_SERVERS:k,ADVERTISE_API_SCOPES:ye,OAUTH_AUTHORIZATION_CODE_TIMEOUT_MS:Ae,OAUTH_ACCESS_TOKEN_TIMEOUT_MS:Ie,OAUTH_REFRESH_TOKEN_TIMEOUT_MS:be,OAUTH_DISABLE_SCOPES:Pe,TELEMETRY_PROVIDER:K,TELEMETRY_PROVIDER_CONFIG:G,LATENCY_METRIC_NAME:Re,PRODUCT_TELEMETRY_ENDPOINT:Le,PRODUCT_TELEMETRY_ENABLED:Oe,IS_HYPERFORCE:Ce,BREAK_GLASS_DISABLE_GLOBALLY:we,ADMIN_TOOLS_ENABLED:Ue}=t,b="";this.siteName=i??"",this.sslKey=f?.trim()??"",this.sslCert=v?.trim()??"",this.httpPort=a(t[S?.trim()||"PORT"],{defaultValue:3927,minValue:1,maxValue:65535}),this.corsOriginConfig=it(y?.trim()??""),this.datasourceCredentials=ne??"",this.disableSessionManagement=se==="true",this.tableauServerVersionCheckIntervalInHours=a(ae,{defaultValue:1,minValue:1,maxValue:168}),this.passthroughAuthUserSessionCheckIntervalInMinutes=a(le,{defaultValue:10,minValue:0,maxValue:1440}),this.mcpSiteSettingsCheckIntervalInMinutes=a(ue,{defaultValue:10,minValue:1,maxValue:1440}),this.enableMcpSiteSettings=me!=="false",this.allowSitesToConfigureRequestOverrides=de==="true",this.enablePassthroughAuth=ce==="true";let P=pe==="true",Ne=!(Pe==="true"),Me=he!=="false";if(this.allowSitesToConfigureRequestOverrides&&!this.enableMcpSiteSettings)throw new Error('ALLOW_SITES_TO_CONFIGURE_REQUEST_OVERRIDES is "true", but MCP site settings are not enabled.');if(this.oauth={enabled:P?!1:!!T,embeddedAuthzServer:Me,issuer:T??"",resourceUri:fe??`http://127.0.0.1:${this.httpPort}`,globalResourceUri:ve??"",redirectUri:Se||(T?`${T}/Callback`:""),lockSite:Te!=="false",jwePrivateKey:ge??"",jwePrivateKeyPath:Ee??"",jwePrivateKeyPassphrase:_e||void 0,dnsServers:k?k.split(",").map(g=>g.trim()):["1.1.1.1","1.0.0.1"],authzCodeTimeoutMs:a(Ae,{defaultValue:l.fromMinutes(10),minValue:0,maxValue:l.fromHours(1)}),accessTokenTimeoutMs:a(Ie,{defaultValue:l.fromHours(1),minValue:0,maxValue:l.fromDays(30)}),refreshTokenTimeoutMs:a(be,{defaultValue:l.fromDays(30),minValue:0,maxValue:l.fromYears(1)}),clientIdSecretPairs:I?I.split(",").reduce((g,Ve)=>{let[Y,j]=Ve.split(":");return Y&&j&&(g[Y]=j),g},{}):null,enforceScopes:Ne,advertiseApiScopes:ye==="true"},this.oauth.clientIdSecretPairs&&Object.keys(this.oauth.clientIdSecretPairs).length===0)throw new Error(`OAUTH_CLIENT_ID_SECRET_PAIRS is in an invalid format: ${I}. Should be in the format: clientId:secret`);if((Q(K)?K:"noop")==="custom"){if(!G)throw new Error('TELEMETRY_PROVIDER_CONFIG is required when TELEMETRY_PROVIDER is "custom"');this.telemetry={provider:"custom",providerConfig:O.parse(JSON.parse(G))}}else this.telemetry={provider:"noop"};if(this.latencyMetricName=Re||"http_server_1agg1_request_duration",this.productTelemetryEndpoint=Le||"https://prod.telemetry.tableausoftware.com",this.productTelemetryEnabled=Oe!=="false",this.isHyperforce=Ce==="true",this.breakGlassDisableGlobally=we==="true",this.adminToolsEnabled=Ue==="true",this.auth=rt(r)?r:this.oauth.enabled?"oauth":"pat",this.transport=_(u)?u:this.oauth.enabled?"http":"stdio",this.transport==="http"&&!P&&!this.oauth.issuer)throw new Error('OAUTH_ISSUER must be set when TRANSPORT is "http" unless DANGEROUSLY_DISABLE_OAUTH is "true"');if(this.auth==="oauth"){if(P)throw new Error('When AUTH is "oauth", DANGEROUSLY_DISABLE_OAUTH cannot be "true"');if(!this.oauth.issuer)throw new Error('When AUTH is "oauth", OAUTH_ISSUER must be set')}else s(o,"The environment variable SERVER is not set"),ot(o);if(this.oauth.enabled){if(this.oauth.embeddedAuthzServer){if(s(this.oauth.redirectUri,"The environment variable OAUTH_REDIRECT_URI is not set"),!this.oauth.jwePrivateKey&&!this.oauth.jwePrivateKeyPath)throw new Error("One of the environment variables: OAUTH_JWE_PRIVATE_KEY_PATH or OAUTH_JWE_PRIVATE_KEY must be set");if(this.oauth.jwePrivateKey&&this.oauth.jwePrivateKeyPath)throw new Error("Only one of the environment variables: OAUTH_JWE_PRIVATE_KEY or OAUTH_JWE_PRIVATE_KEY_PATH must be set");if(this.oauth.jwePrivateKeyPath&&process.env.TABLEAU_MCP_TEST!=="true"&&!(0,p.existsSync)(this.oauth.jwePrivateKeyPath))throw new Error(`OAuth JWE private key path does not exist: ${this.oauth.jwePrivateKeyPath}`)}if(this.transport==="stdio")throw new Error('TRANSPORT must be "http" when OAUTH_ISSUER is set')}if(this.auth==="pat")s(w,"The environment variable PAT_NAME is not set"),s(U,"The environment variable PAT_VALUE is not set");else if(this.auth==="direct-trust")s(h,"The environment variable JWT_SUB_CLAIM is not set"),s(N,"The environment variable CONNECTED_APP_CLIENT_ID is not set"),s(M,"The environment variable CONNECTED_APP_SECRET_ID is not set"),s(V,"The environment variable CONNECTED_APP_SECRET_VALUE is not set"),b=h??"";else if(this.auth==="uat"){if(s(D,"The environment variable UAT_TENANT_ID is not set"),s(x,"The environment variable UAT_ISSUER is not set"),!H&&!h)throw new Error("One of the environment variables: UAT_USERNAME_CLAIM or JWT_SUB_CLAIM must be set");if(b=H??h??"",!A&&!m)throw new Error("One of the environment variables: UAT_PRIVATE_KEY_PATH or UAT_PRIVATE_KEY must be set");if(A&&m)throw new Error("Only one of the environment variables: UAT_PRIVATE_KEY or UAT_PRIVATE_KEY_PATH must be set");if(m&&process.env.TABLEAU_MCP_TEST!=="true"&&!(0,p.existsSync)(m))throw new Error(`UAT private key path does not exist: ${m}`)}this.server=o??"",this.patName=w??"",this.patValue=U??"",this.jwtUsername=b??"",this.connectedAppClientId=N??"",this.connectedAppSecretId=M??"",this.connectedAppSecretValue=V??"",this.uatTenantId=D??"",this.uatIssuer=x??"",this.uatUsernameClaimName=re||"email",this.uatPrivateKey=A||(m?(0,p.readFileSync)(m,"utf8"):""),this.uatKeyId=oe??"",this.jwtAdditionalPayload=ie||"{}"}};function ot(e){if(!["https://","http://"].find(t=>e.startsWith(t)))throw new Error(`The environment variable SERVER must start with "http://" or "https://": ${e}`);try{let t=new URL(e)}catch(t){let r=t instanceof Error?t.message:String(t);throw new Error(`The environment variable SERVER is not a valid URL: ${e} -- ${r}`)}}function it(e){if(!e)return!0;if(e.match(/^true|false$/i))return e.toLowerCase()==="true";if(e==="*")return"*";if(e.startsWith("[")&&e.endsWith("]"))try{return JSON.parse(e).map(r=>new URL(r).origin)}catch{throw new Error(`The environment variable CORS_ORIGIN_CONFIG is not a valid array of URLs: ${e}`)}try{return new URL(e).origin}catch{throw new Error(`The environment variable CORS_ORIGIN_CONFIG is not a valid URL: ${e}`)}}var X=()=>new C;var d=class{initialize(){}recordMetric(t,r,o){}recordHistogram(t,r,o){}};function nt(e){return Object.getOwnPropertyNames(e.prototype).filter(t=>t!=="constructor"&&typeof e.prototype[t]=="function")}function st(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function at(e){if(!st(e))throw new Error("Provider must be an object");let r=nt(d).filter(o=>typeof e[o]!="function");if(r.length>0)throw new Error(`Custom provider missing required methods: ${r.join(", ")}`)}function ee(){let e=X(),t;try{switch(e.telemetry.provider){case"custom":t=lt(e.telemetry.providerConfig);break;case"noop":t=new d;break}return t.initialize(),global.__telemetryProvider=t,t}catch(r){R({message:"Failed to initialize telemetry provider",level:"error",logger:"telemetry",data:r}),R({message:"Falling back to NoOp telemetry provider",level:"info",logger:"telemetry"});let o=new d;return o.initialize(),global.__telemetryProvider=o,o}}function lt(e){if(!e?.module)throw new Error(`Custom telemetry provider requires "module" in providerConfig. Example: TELEMETRY_PROVIDER_CONFIG='{"module":"./my-telemetry.js"}'`);let t=e.module;if(typeof t!="string")throw new Error('Custom telemetry provider requires "module" to be a string');let r;t.startsWith(".")||t.startsWith("/")?r=(0,Z.resolve)(process.cwd(),t):r=t;try{let o=require(r),i=o.default||o.TelemetryProvider;if(!i)throw new Error(`Module ${t} must export a default class or named export "TelemetryProvider" that implements the TelemetryProvider interface`);let u=new i(e);return at(u),u}catch(o){let i=`Failed to load custom telemetry provider from "${t}". `;throw o instanceof Error&&"code"in o&&o.code==="MODULE_NOT_FOUND"?i+="Module not found. If using a file path, ensure the file exists and the path is correct. If using an npm package, ensure it is installed.":i+=`Error: ${o}`,new Error(i)}}te.default.config();try{ee()}catch(e){console.warn("Failed to initialize telemetry:",e)}
3
3
  //# sourceMappingURL=tracing.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/telemetry/tracing.ts", "../../src/telemetry/init.ts", "../../src/config.ts", "../../src/config.shared.ts", "../../src/logging/fileLogger.ts", "../../src/logging/types.ts", "../../src/logging/logger.ts", "../../src/logging/loggerType.ts", "../../src/transports.ts", "../../src/utils/getDirname.ts", "../../src/utils/milliseconds.ts", "../../src/utils/parseNumber.ts", "../../src/telemetry/types.ts", "../../src/utils/invariant.ts", "../../src/telemetry/noop.ts"],
4
- "sourcesContent": ["/**\n * APM agent preload script\n *\n * Use with node -r flag to start APM agent before application code:\n * node -r ./build/telemetry/tracing.js build/index.js\n *\n * Environment variables:\n * - TELEMETRY_PROVIDER=custom - Use custom telemetry provider (default: noop)\n */\n\n// Load .env before anything else\nimport dotenv from 'dotenv';\ndotenv.config();\n\nimport { initializeTelemetry } from './init.js';\n\ntry {\n initializeTelemetry();\n} catch (error) {\n console.warn('Failed to initialize telemetry:', error);\n}\n", "/**\n * Telemetry initialization and provider factory\n */\n\nimport { resolve } from 'path';\n\nimport { getConfig } from '../config.js';\nimport { log } from '../logging/logger.js';\nimport { NoOpTelemetryProvider } from './noop.js';\nimport { TelemetryProvider } from './types.js';\n\n/**\n * Get all instance methods from a class prototype\n */\nfunction getInstanceMethods(cls: new (...args: unknown[]) => unknown): string[] {\n return Object.getOwnPropertyNames(cls.prototype).filter(\n (name) => name !== 'constructor' && typeof cls.prototype[name] === 'function',\n );\n}\n\nfunction isRecord(obj: unknown): obj is Record<string, unknown> {\n return typeof obj === 'object' && obj !== null && !Array.isArray(obj);\n}\n\n/**\n * Validate that a provider implements all required TelemetryProvider methods\n */\nfunction validateTelemetryProvider(provider: unknown): asserts provider is TelemetryProvider {\n if (!isRecord(provider)) {\n throw new Error('Provider must be an object');\n }\n\n const requiredMethods = getInstanceMethods(NoOpTelemetryProvider);\n // Keep only methods that provider doesn't have (i.e., missing or miscategorized methods)\n const missingMethods = requiredMethods.filter((method) => typeof provider[method] !== 'function');\n\n if (missingMethods.length > 0) {\n throw new Error(`Custom provider missing required methods: ${missingMethods.join(', ')}`);\n }\n}\n\n// Use global to share provider across bundles (tracing.js and index.js)\ndeclare global {\n var __telemetryProvider: TelemetryProvider | undefined;\n}\n\n/**\n * Get the current telemetry provider instance.\n * If not initialized, returns a NoOp provider.\n *\n * @returns The telemetry provider\n */\nexport function getTelemetryProvider(): TelemetryProvider {\n if (!global.__telemetryProvider) {\n // return a NoOp provider for this request if telemetry hasn't been initialized\n return new NoOpTelemetryProvider();\n }\n return global.__telemetryProvider;\n}\n\n/**\n * Initialize the telemetry provider based on configuration.\n *\n * This function should be called early in application startup, before any\n * HTTP requests or other instrumented operations occur.\n *\n * @returns A configured telemetry provider\n *\n * @example\n * function main() {\n * // Initialize telemetry first\n * const telemetry = initializeTelemetry();\n *\n * // Start application...\n * }\n */\nexport function initializeTelemetry(): TelemetryProvider {\n const config = getConfig();\n let provider: TelemetryProvider;\n\n try {\n // Select provider based on configuration\n switch (config.telemetry.provider) {\n case 'custom':\n // Load custom provider from user's filesystem\n provider = loadCustomProvider(config.telemetry.providerConfig);\n break;\n\n case 'noop':\n provider = new NoOpTelemetryProvider();\n break;\n }\n\n // Initialize the provider\n provider.initialize();\n global.__telemetryProvider = provider;\n return provider;\n } catch (error) {\n log({\n message: 'Failed to initialize telemetry provider',\n level: 'error',\n logger: 'telemetry',\n data: error,\n });\n log({ message: 'Falling back to NoOp telemetry provider', level: 'info', logger: 'telemetry' });\n\n // Fallback to NoOp on error - telemetry failures shouldn't break the application\n const fallbackProvider = new NoOpTelemetryProvider();\n fallbackProvider.initialize();\n global.__telemetryProvider = fallbackProvider;\n return fallbackProvider;\n }\n}\n\n/**\n * Load a custom telemetry provider from user's filesystem or npm package.\n *\n * The custom provider module should export a default class that implements TelemetryProvider.\n *\n * @param config - Provider configuration containing the module path\n * @returns A configured custom telemetry provider\n *\n * @example Custom provider from file\n * TELEMETRY_PROVIDER=custom\n * TELEMETRY_PROVIDER_CONFIG='{\"module\":\"./my-telemetry.js\"}'\n */\nfunction loadCustomProvider(config?: Record<string, unknown>): TelemetryProvider {\n if (!config?.module) {\n throw new Error(\n 'Custom telemetry provider requires \"module\" in providerConfig. ' +\n 'Example: TELEMETRY_PROVIDER_CONFIG=\\'{\"module\":\"./my-telemetry.js\"}\\'',\n );\n }\n\n const modulePath = config.module;\n\n if (typeof modulePath !== 'string') {\n throw new Error('Custom telemetry provider requires \"module\" to be a string');\n }\n\n // Determine if it's a file path or npm package name\n let resolvedPath: string;\n\n if (modulePath.startsWith('.') || modulePath.startsWith('/')) {\n // File path - resolve relative to process working directory (user's project root)\n resolvedPath = resolve(process.cwd(), modulePath);\n } else {\n // npm package name - require as-is\n resolvedPath = modulePath;\n }\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports -- Sync load for preload script\n const module = require(resolvedPath);\n\n // Look for default export or named export \"TelemetryProvider\"\n const ProviderClass = module.default || module.TelemetryProvider;\n\n if (!ProviderClass) {\n throw new Error(\n `Module ${modulePath} must export a default class or named export \"TelemetryProvider\" ` +\n 'that implements the TelemetryProvider interface',\n );\n }\n\n // Instantiate the provider with the full config\n const provider = new ProviderClass(config);\n\n // Validate the provider implements TelemetryProvider interface\n validateTelemetryProvider(provider);\n return provider;\n } catch (error) {\n // Provide helpful error message with common issues\n let errorMessage = `Failed to load custom telemetry provider from \"${modulePath}\". `;\n\n if (error instanceof Error && 'code' in error && error.code === 'MODULE_NOT_FOUND') {\n errorMessage +=\n 'Module not found. ' +\n 'If using a file path, ensure the file exists and the path is correct. ' +\n 'If using an npm package, ensure it is installed.';\n } else {\n errorMessage += `Error: ${error}`;\n }\n\n throw new Error(errorMessage);\n }\n}\n", "import { CorsOptions } from 'cors';\nimport { existsSync, readFileSync } from 'fs';\n\nimport { BaseConfig, removeClaudeMcpBundleUserConfigTemplates } from './config.shared.js';\nimport { isTelemetryProvider, providerConfigSchema, TelemetryConfig } from './telemetry/types.js';\nimport { isTransport } from './transports.js';\nimport invariant from './utils/invariant.js';\nimport { milliseconds } from './utils/milliseconds.js';\nimport { parseNumber } from './utils/parseNumber.js';\n\nconst authTypes = ['pat', 'uat', 'direct-trust', 'oauth'] as const;\ntype AuthType = (typeof authTypes)[number];\n\nfunction isAuthType(auth: unknown): auth is AuthType {\n return authTypes.some((type) => type === auth);\n}\n\nexport class Config extends BaseConfig {\n auth: AuthType;\n server: string;\n sslKey: string;\n sslCert: string;\n httpPort: number;\n corsOriginConfig: CorsOptions['origin'];\n siteName: string;\n patName: string;\n patValue: string;\n jwtUsername: string;\n connectedAppClientId: string;\n connectedAppSecretId: string;\n connectedAppSecretValue: string;\n uatTenantId: string;\n uatIssuer: string;\n uatUsernameClaimName: string;\n uatPrivateKey: string;\n uatKeyId: string;\n jwtAdditionalPayload: string;\n datasourceCredentials: string;\n disableLogMasking: boolean;\n disableSessionManagement: boolean;\n tableauServerVersionCheckIntervalInHours: number;\n passthroughAuthUserSessionCheckIntervalInMinutes: number;\n mcpSiteSettingsCheckIntervalInMinutes: number;\n enableMcpSiteSettings: boolean;\n allowSitesToConfigureRequestOverrides: boolean;\n enablePassthroughAuth: boolean;\n oauth: {\n enabled: boolean;\n embeddedAuthzServer: boolean;\n issuer: string;\n redirectUri: string;\n resourceUri: string;\n globalResourceUri: string;\n lockSite: boolean;\n jwePrivateKey: string;\n jwePrivateKeyPath: string;\n jwePrivateKeyPassphrase: string | undefined;\n authzCodeTimeoutMs: number;\n accessTokenTimeoutMs: number;\n refreshTokenTimeoutMs: number;\n clientIdSecretPairs: Record<string, string> | null;\n dnsServers: string[];\n enforceScopes: boolean;\n advertiseApiScopes: boolean;\n };\n telemetry: TelemetryConfig;\n latencyMetricName: string;\n productTelemetryEndpoint: string;\n productTelemetryEnabled: boolean;\n isHyperforce: boolean;\n breakGlassDisableGlobally: boolean;\n adminToolsEnabled: boolean;\n\n constructor() {\n super();\n\n const cleansedVars = removeClaudeMcpBundleUserConfigTemplates(process.env);\n const {\n AUTH: auth,\n SERVER: server,\n SITE_NAME: siteName,\n TRANSPORT: transport,\n SSL_KEY: sslKey,\n SSL_CERT: sslCert,\n HTTP_PORT_ENV_VAR_NAME: httpPortEnvVarName,\n CORS_ORIGIN_CONFIG: corsOriginConfig,\n PAT_NAME: patName,\n PAT_VALUE: patValue,\n JWT_SUB_CLAIM: jwtSubClaim,\n CONNECTED_APP_CLIENT_ID: clientId,\n CONNECTED_APP_SECRET_ID: secretId,\n CONNECTED_APP_SECRET_VALUE: secretValue,\n UAT_TENANT_ID: uatTenantId,\n UAT_ISSUER: uatIssuer,\n UAT_USERNAME_CLAIM_NAME: uatUsernameClaimName,\n UAT_USERNAME_CLAIM: uatUsernameClaim,\n UAT_PRIVATE_KEY: uatPrivateKey,\n UAT_PRIVATE_KEY_PATH: uatPrivateKeyPath,\n UAT_KEY_ID: uatKeyId,\n JWT_ADDITIONAL_PAYLOAD: jwtAdditionalPayload,\n DATASOURCE_CREDENTIALS: datasourceCredentials,\n DISABLE_LOG_MASKING: disableLogMasking,\n DISABLE_SESSION_MANAGEMENT: disableSessionManagement,\n TABLEAU_SERVER_VERSION_CHECK_INTERVAL_IN_HOURS: tableauServerVersionCheckIntervalInHours,\n PASSTHROUGH_AUTH_USER_SESSION_CHECK_INTERVAL_IN_MINUTES:\n passthroughAuthUserSessionCheckIntervalInMinutes,\n MCP_SITE_SETTINGS_CHECK_INTERVAL_IN_MINUTES: mcpSiteSettingsCheckIntervalInMinutes,\n ENABLE_MCP_SITE_SETTINGS: enableMcpSiteSettings,\n ALLOW_SITES_TO_CONFIGURE_REQUEST_OVERRIDES: allowSitesToConfigureRequestOverrides,\n ENABLE_PASSTHROUGH_AUTH: enablePassthroughAuth,\n DANGEROUSLY_DISABLE_OAUTH: disableOauth,\n OAUTH_EMBEDDED_AUTHZ_SERVER: oauthEmbeddedAuthzServer,\n OAUTH_ISSUER: oauthIssuer,\n OAUTH_LOCK_SITE: oauthLockSite,\n OAUTH_JWE_PRIVATE_KEY: oauthJwePrivateKey,\n OAUTH_JWE_PRIVATE_KEY_PATH: oauthJwePrivateKeyPath,\n OAUTH_JWE_PRIVATE_KEY_PASSPHRASE: oauthJwePrivateKeyPassphrase,\n OAUTH_RESOURCE_URI: oauthResourceUri,\n OAUTH_GLOBAL_RESOURCE_URI: oauthGlobalResourceUri,\n OAUTH_REDIRECT_URI: redirectUri,\n OAUTH_CLIENT_ID_SECRET_PAIRS: oauthClientIdSecretPairs,\n OAUTH_CIMD_DNS_SERVERS: dnsServers,\n ADVERTISE_API_SCOPES: advertiseApiScopes,\n OAUTH_AUTHORIZATION_CODE_TIMEOUT_MS: authzCodeTimeoutMs,\n OAUTH_ACCESS_TOKEN_TIMEOUT_MS: accessTokenTimeoutMs,\n OAUTH_REFRESH_TOKEN_TIMEOUT_MS: refreshTokenTimeoutMs,\n OAUTH_DISABLE_SCOPES: oauthDisableScopes,\n TELEMETRY_PROVIDER: telemetryProvider,\n TELEMETRY_PROVIDER_CONFIG: telemetryProviderConfig,\n LATENCY_METRIC_NAME: latencyMetricName,\n PRODUCT_TELEMETRY_ENDPOINT: productTelemetryEndpoint,\n PRODUCT_TELEMETRY_ENABLED: productTelemetryEnabled,\n IS_HYPERFORCE: isHyperforce,\n BREAK_GLASS_DISABLE_GLOBALLY: breakGlassDisableGlobally,\n ADMIN_TOOLS_ENABLED: adminToolsEnabled,\n } = cleansedVars;\n\n let jwtUsername = '';\n\n this.siteName = siteName ?? '';\n\n this.sslKey = sslKey?.trim() ?? '';\n this.sslCert = sslCert?.trim() ?? '';\n this.httpPort = parseNumber(cleansedVars[httpPortEnvVarName?.trim() || 'PORT'], {\n defaultValue: 3927,\n minValue: 1,\n maxValue: 65535,\n });\n this.corsOriginConfig = getCorsOriginConfig(corsOriginConfig?.trim() ?? '');\n this.datasourceCredentials = datasourceCredentials ?? '';\n this.disableLogMasking = disableLogMasking === 'true';\n this.disableSessionManagement = disableSessionManagement === 'true';\n\n this.tableauServerVersionCheckIntervalInHours = parseNumber(\n tableauServerVersionCheckIntervalInHours,\n {\n defaultValue: 1,\n minValue: 1,\n maxValue: 24 * 7, // 7 days\n },\n );\n\n this.passthroughAuthUserSessionCheckIntervalInMinutes = parseNumber(\n passthroughAuthUserSessionCheckIntervalInMinutes,\n {\n defaultValue: 10,\n minValue: 0,\n maxValue: 60 * 24, // 24 hours\n },\n );\n\n this.mcpSiteSettingsCheckIntervalInMinutes = parseNumber(\n mcpSiteSettingsCheckIntervalInMinutes,\n {\n defaultValue: 10,\n minValue: 1,\n maxValue: 60 * 24, // 24 hours\n },\n );\n\n this.enableMcpSiteSettings = enableMcpSiteSettings !== 'false';\n this.allowSitesToConfigureRequestOverrides = allowSitesToConfigureRequestOverrides === 'true';\n this.enablePassthroughAuth = enablePassthroughAuth === 'true';\n const disableOauthOverride = disableOauth === 'true';\n const disableScopes = oauthDisableScopes === 'true';\n const enforceScopes = !disableScopes;\n const embeddedAuthzServer = oauthEmbeddedAuthzServer !== 'false';\n\n if (this.allowSitesToConfigureRequestOverrides && !this.enableMcpSiteSettings) {\n throw new Error(\n 'ALLOW_SITES_TO_CONFIGURE_REQUEST_OVERRIDES is \"true\", but MCP site settings are not enabled.',\n );\n }\n\n this.oauth = {\n enabled: disableOauthOverride ? false : !!oauthIssuer,\n embeddedAuthzServer,\n issuer: oauthIssuer ?? '',\n resourceUri: oauthResourceUri ?? `http://127.0.0.1:${this.httpPort}`,\n globalResourceUri: oauthGlobalResourceUri ?? '',\n redirectUri: redirectUri || (oauthIssuer ? `${oauthIssuer}/Callback` : ''),\n lockSite: oauthLockSite !== 'false', // Site locking is enabled by default\n jwePrivateKey: oauthJwePrivateKey ?? '',\n jwePrivateKeyPath: oauthJwePrivateKeyPath ?? '',\n jwePrivateKeyPassphrase: oauthJwePrivateKeyPassphrase || undefined,\n dnsServers: dnsServers\n ? dnsServers.split(',').map((ip) => ip.trim())\n : ['1.1.1.1', '1.0.0.1' /* Cloudflare public DNS */],\n authzCodeTimeoutMs: parseNumber(authzCodeTimeoutMs, {\n defaultValue: milliseconds.fromMinutes(10),\n minValue: 0,\n maxValue: milliseconds.fromHours(1),\n }),\n accessTokenTimeoutMs: parseNumber(accessTokenTimeoutMs, {\n defaultValue: milliseconds.fromHours(1),\n minValue: 0,\n maxValue: milliseconds.fromDays(30),\n }),\n refreshTokenTimeoutMs: parseNumber(refreshTokenTimeoutMs, {\n defaultValue: milliseconds.fromDays(30),\n minValue: 0,\n maxValue: milliseconds.fromYears(1),\n }),\n clientIdSecretPairs: oauthClientIdSecretPairs\n ? oauthClientIdSecretPairs.split(',').reduce<Record<string, string>>((acc, curr) => {\n const [clientId, secret] = curr.split(':');\n if (clientId && secret) {\n acc[clientId] = secret;\n }\n return acc;\n }, {})\n : null,\n enforceScopes,\n advertiseApiScopes: advertiseApiScopes === 'true',\n };\n\n if (\n this.oauth.clientIdSecretPairs &&\n Object.keys(this.oauth.clientIdSecretPairs).length === 0\n ) {\n throw new Error(\n `OAUTH_CLIENT_ID_SECRET_PAIRS is in an invalid format: ${oauthClientIdSecretPairs}. Should be in the format: clientId:secret`,\n );\n }\n\n const parsedProvider = isTelemetryProvider(telemetryProvider) ? telemetryProvider : 'noop';\n if (parsedProvider === 'custom') {\n if (!telemetryProviderConfig) {\n throw new Error(\n 'TELEMETRY_PROVIDER_CONFIG is required when TELEMETRY_PROVIDER is \"custom\"',\n );\n }\n this.telemetry = {\n provider: 'custom',\n providerConfig: providerConfigSchema.parse(JSON.parse(telemetryProviderConfig)),\n };\n } else {\n this.telemetry = {\n provider: 'noop',\n };\n }\n\n this.latencyMetricName = latencyMetricName || 'http_server_1agg1_request_duration';\n this.productTelemetryEndpoint =\n productTelemetryEndpoint || 'https://prod.telemetry.tableausoftware.com';\n this.productTelemetryEnabled = productTelemetryEnabled !== 'false';\n this.isHyperforce = isHyperforce === 'true';\n this.breakGlassDisableGlobally = breakGlassDisableGlobally === 'true';\n this.adminToolsEnabled = adminToolsEnabled === 'true';\n\n this.auth = isAuthType(auth) ? auth : this.oauth.enabled ? 'oauth' : 'pat';\n this.transport = isTransport(transport) ? transport : this.oauth.enabled ? 'http' : 'stdio';\n\n if (this.transport === 'http' && !disableOauthOverride && !this.oauth.issuer) {\n throw new Error(\n 'OAUTH_ISSUER must be set when TRANSPORT is \"http\" unless DANGEROUSLY_DISABLE_OAUTH is \"true\"',\n );\n }\n\n if (this.auth === 'oauth') {\n if (disableOauthOverride) {\n throw new Error('When AUTH is \"oauth\", DANGEROUSLY_DISABLE_OAUTH cannot be \"true\"');\n }\n\n if (!this.oauth.issuer) {\n throw new Error('When AUTH is \"oauth\", OAUTH_ISSUER must be set');\n }\n } else {\n invariant(server, 'The environment variable SERVER is not set');\n validateServer(server);\n }\n\n if (this.oauth.enabled) {\n if (this.oauth.embeddedAuthzServer) {\n invariant(this.oauth.redirectUri, 'The environment variable OAUTH_REDIRECT_URI is not set');\n\n if (!this.oauth.jwePrivateKey && !this.oauth.jwePrivateKeyPath) {\n throw new Error(\n 'One of the environment variables: OAUTH_JWE_PRIVATE_KEY_PATH or OAUTH_JWE_PRIVATE_KEY must be set',\n );\n }\n\n if (this.oauth.jwePrivateKey && this.oauth.jwePrivateKeyPath) {\n throw new Error(\n 'Only one of the environment variables: OAUTH_JWE_PRIVATE_KEY or OAUTH_JWE_PRIVATE_KEY_PATH must be set',\n );\n }\n\n if (\n this.oauth.jwePrivateKeyPath &&\n process.env.TABLEAU_MCP_TEST !== 'true' &&\n !existsSync(this.oauth.jwePrivateKeyPath)\n ) {\n throw new Error(\n `OAuth JWE private key path does not exist: ${this.oauth.jwePrivateKeyPath}`,\n );\n }\n }\n\n if (this.transport === 'stdio') {\n throw new Error('TRANSPORT must be \"http\" when OAUTH_ISSUER is set');\n }\n }\n\n if (this.auth === 'pat') {\n invariant(patName, 'The environment variable PAT_NAME is not set');\n invariant(patValue, 'The environment variable PAT_VALUE is not set');\n } else if (this.auth === 'direct-trust') {\n invariant(jwtSubClaim, 'The environment variable JWT_SUB_CLAIM is not set');\n invariant(clientId, 'The environment variable CONNECTED_APP_CLIENT_ID is not set');\n invariant(secretId, 'The environment variable CONNECTED_APP_SECRET_ID is not set');\n invariant(secretValue, 'The environment variable CONNECTED_APP_SECRET_VALUE is not set');\n\n jwtUsername = jwtSubClaim ?? '';\n } else if (this.auth === 'uat') {\n invariant(uatTenantId, 'The environment variable UAT_TENANT_ID is not set');\n invariant(uatIssuer, 'The environment variable UAT_ISSUER is not set');\n\n if (!uatUsernameClaim && !jwtSubClaim) {\n throw new Error(\n 'One of the environment variables: UAT_USERNAME_CLAIM or JWT_SUB_CLAIM must be set',\n );\n }\n\n jwtUsername = uatUsernameClaim ?? jwtSubClaim ?? '';\n\n if (!uatPrivateKey && !uatPrivateKeyPath) {\n throw new Error(\n 'One of the environment variables: UAT_PRIVATE_KEY_PATH or UAT_PRIVATE_KEY must be set',\n );\n }\n\n if (uatPrivateKey && uatPrivateKeyPath) {\n throw new Error(\n 'Only one of the environment variables: UAT_PRIVATE_KEY or UAT_PRIVATE_KEY_PATH must be set',\n );\n }\n\n if (\n uatPrivateKeyPath &&\n process.env.TABLEAU_MCP_TEST !== 'true' &&\n !existsSync(uatPrivateKeyPath)\n ) {\n throw new Error(`UAT private key path does not exist: ${uatPrivateKeyPath}`);\n }\n }\n\n this.server = server ?? '';\n this.patName = patName ?? '';\n this.patValue = patValue ?? '';\n this.jwtUsername = jwtUsername ?? '';\n this.connectedAppClientId = clientId ?? '';\n this.connectedAppSecretId = secretId ?? '';\n this.connectedAppSecretValue = secretValue ?? '';\n this.uatTenantId = uatTenantId ?? '';\n this.uatIssuer = uatIssuer ?? '';\n this.uatUsernameClaimName = uatUsernameClaimName || 'email';\n this.uatPrivateKey =\n uatPrivateKey || (uatPrivateKeyPath ? readFileSync(uatPrivateKeyPath, 'utf8') : '');\n this.uatKeyId = uatKeyId ?? '';\n this.jwtAdditionalPayload = jwtAdditionalPayload || '{}';\n }\n}\n\nfunction validateServer(server: string): void {\n if (!['https://', 'http://'].find((prefix) => server.startsWith(prefix))) {\n throw new Error(\n `The environment variable SERVER must start with \"http://\" or \"https://\": ${server}`,\n );\n }\n\n try {\n const _ = new URL(server);\n } catch (error: unknown) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n throw new Error(\n `The environment variable SERVER is not a valid URL: ${server} -- ${errorMessage}`,\n );\n }\n}\n\nfunction getCorsOriginConfig(corsOriginConfig: string): CorsOptions['origin'] {\n if (!corsOriginConfig) {\n return true;\n }\n\n if (corsOriginConfig.match(/^true|false$/i)) {\n return corsOriginConfig.toLowerCase() === 'true';\n }\n\n if (corsOriginConfig === '*') {\n return '*';\n }\n\n if (corsOriginConfig.startsWith('[') && corsOriginConfig.endsWith(']')) {\n try {\n const origins = JSON.parse(corsOriginConfig) as Array<string>;\n return origins.map((origin) => new URL(origin).origin);\n } catch {\n throw new Error(\n `The environment variable CORS_ORIGIN_CONFIG is not a valid array of URLs: ${corsOriginConfig}`,\n );\n }\n }\n\n try {\n return new URL(corsOriginConfig).origin;\n } catch {\n throw new Error(\n `The environment variable CORS_ORIGIN_CONFIG is not a valid URL: ${corsOriginConfig}`,\n );\n }\n}\n\nexport const getConfig = (): Config => new Config();\n", "import { join } from 'path';\n\nimport { parseLogLevel } from './logging/logger.js';\nimport { LoggerType, parseLoggerTypes } from './logging/loggerType.js';\nimport { LogLevel } from './logging/types.js';\nimport { isTransport, TransportName } from './transports.js';\nimport { getDirname } from './utils/getDirname.js';\nimport { milliseconds } from './utils/milliseconds.js';\nimport { parseNumber } from './utils/parseNumber.js';\n\nconst __dirname = getDirname();\n\nexport class BaseConfig {\n transport: TransportName;\n defaultNotificationLevel: string;\n logLevel: LogLevel;\n loggers: Set<LoggerType>;\n fileLoggerDirectory: string;\n maxRequestTimeoutMs: number;\n notificationPayloadMaxBytes: number;\n\n constructor() {\n const cleansedVars = removeClaudeMcpBundleUserConfigTemplates(process.env);\n const {\n TRANSPORT: transport,\n DEFAULT_NOTIFICATION_LEVEL: defaultNotificationLevel,\n LOG_LEVEL: logLevel,\n ENABLED_LOGGERS: logging,\n FILE_LOGGER_DIRECTORY: fileLoggerDirectory,\n MAX_REQUEST_TIMEOUT_MS: maxRequestTimeoutMs,\n NOTIFICATION_PAYLOAD_MAX_BYTES: notificationPayloadMaxBytes,\n } = cleansedVars;\n\n this.transport = isTransport(transport) ? transport : 'stdio';\n this.defaultNotificationLevel = defaultNotificationLevel ?? 'debug';\n this.logLevel = parseLogLevel(logLevel);\n this.loggers = parseLoggerTypes(logging);\n this.fileLoggerDirectory = fileLoggerDirectory || join(__dirname, 'logs');\n this.maxRequestTimeoutMs = parseNumber(maxRequestTimeoutMs, {\n defaultValue: milliseconds.fromMinutes(10),\n minValue: 5000,\n maxValue: milliseconds.fromHours(1),\n });\n this.notificationPayloadMaxBytes = parseNumber(notificationPayloadMaxBytes, {\n defaultValue: 8192,\n minValue: 1,\n });\n }\n}\n\n// When the user does not provide a site name in the Claude MCP Bundle configuration,\n// Claude doesn't replace its value and sets the site name to \"${user_config.site_name}\".\nexport function removeClaudeMcpBundleUserConfigTemplates(\n envVars: Record<string, string | undefined>,\n): Record<string, string | undefined> {\n return Object.entries(envVars).reduce<Record<string, string | undefined>>((acc, [key, value]) => {\n if (value?.startsWith('${user_config.')) {\n acc[key] = '';\n } else {\n acc[key] = value;\n }\n return acc;\n }, {});\n}\n\nexport const getBaseConfig = (): BaseConfig => new BaseConfig();\n", "import { appendFile } from 'node:fs/promises';\n\nimport { existsSync, mkdirSync } from 'fs';\nimport { join } from 'path';\n\nimport { getExceptionMessage } from '../utils/getExceptionMessage.js';\nimport type { LogEntry } from './types.js';\n\nlet _fileLogger: FileLogger | undefined;\n\nexport const setFileLogger = (logger: FileLogger): void => {\n _fileLogger = logger;\n};\n\nexport const getFileLogger = (): FileLogger | undefined => _fileLogger;\n\nexport class FileLogger {\n private readonly _logDirectory: string;\n private readonly _fileMutexes = new Map<string, Promise<void>>();\n\n constructor({ logDirectory }: { logDirectory: string }) {\n this._logDirectory = logDirectory;\n\n if (!existsSync(this._logDirectory)) {\n mkdirSync(this._logDirectory, { recursive: true });\n }\n }\n\n async log(entry: LogEntry): Promise<void> {\n // Create a new log file each hour e.g. 2025-10-15T21-00-00-000Z.log\n const timestamp = new Date().toISOString();\n const filename = `${new Date(new Date().setMinutes(0, 0, 0)).toISOString().replace(/[:.]/g, '-')}.log`;\n const logFilePath = join(this._logDirectory, filename);\n\n // Get or create a mutex for this specific log file\n const mutexKey = logFilePath;\n const currentMutex = this._fileMutexes.get(mutexKey) ?? Promise.resolve();\n\n // Chain the file write operation after the current mutex\n const newMutex = currentMutex.then(async () => {\n try {\n // appendFile will create the file if it doesn't exist\n await appendFile(logFilePath, JSON.stringify({ timestamp, ...entry }) + '\\n');\n } catch (error) {\n process.stderr.write(\n `Failed to write to log file ${logFilePath}: ${getExceptionMessage(error)}\\n`,\n );\n }\n });\n\n this._fileMutexes.set(mutexKey, newMutex);\n\n // Clean up completed mutexes to prevent memory leaks\n newMutex.finally(() => {\n if (this._fileMutexes.get(mutexKey) === newMutex) {\n this._fileMutexes.delete(mutexKey);\n }\n });\n\n // Wait for the file write operation to complete\n await newMutex;\n }\n}\n", "import type { LoggingLevel } from '@modelcontextprotocol/sdk/types.js';\n\nexport type LogLevel = LoggingLevel;\nexport const orderedLogLevels = [\n 'debug',\n 'info',\n 'notice',\n 'warning',\n 'error',\n 'critical',\n 'alert',\n 'emergency',\n] as const;\n\nexport const logLevelSeverity = Object.fromEntries(\n orderedLogLevels.map((level, index) => [level, index]),\n) as Record<LogLevel, number>;\n\nexport type LogEntry = {\n message: string;\n data?: unknown;\n level: LogLevel;\n logger: string | undefined;\n};\n", "import { getBaseConfig } from '../config.shared.js';\nimport { getFileLogger } from './fileLogger.js';\nimport { LogEntry, LogLevel, logLevelSeverity } from './types.js';\n\nexport function shouldLog(entryLevel: LogLevel, minLevel: LogLevel): boolean {\n return logLevelSeverity[entryLevel] >= logLevelSeverity[minLevel];\n}\n\nfunction isLogLevel(value: string): value is LogLevel {\n return value in logLevelSeverity;\n}\n\nexport function parseLogLevel(value: string | undefined): LogLevel {\n const level = value?.trim();\n if (level && isLogLevel(level)) {\n return level;\n }\n return 'info';\n}\n\n/**\n * Custom JSON.stringify replacer that serializes Error objects properly.\n * Removes the config field from AxiosError to avoid logging sensitive headers.\n */\nfunction errorReplacer(data: unknown): unknown {\n if (data instanceof Error) {\n return {\n name: data.name,\n message: data.message,\n stack: data.stack,\n ...(data.cause !== undefined && { cause: data.cause }),\n };\n }\n\n return data;\n}\n\nexport function log(entry: LogEntry): void {\n const config = getBaseConfig();\n if (!shouldLog(entry.level, config.logLevel)) {\n return;\n }\n\n // we are removing any unnecessary fields that may also leak sensitive data\n entry.data = errorReplacer(entry.data);\n\n if (config.loggers.has('appLogger')) {\n const message = JSON.stringify(entry);\n if (config.transport === 'http') {\n // eslint-disable-next-line no-console -- console.log is intentional here since the transport is not stdio.\n console.log(message);\n } else {\n process.stderr.write(message + '\\n');\n }\n }\n if (config.loggers.has('fileLogger')) {\n getFileLogger()?.log(entry);\n }\n}\n", "export const loggerTypes = ['fileLogger', 'appLogger'] as const;\nexport type LoggerType = (typeof loggerTypes)[number];\nconst validLoggerTypes = new Set(loggerTypes);\n\nexport function parseLoggerTypes(value: string | undefined): Set<LoggerType> {\n if (!value) {\n return new Set<LoggerType>(['appLogger']);\n }\n return new Set(\n value\n .split(',')\n .map((s) => s.trim())\n .filter((s): s is LoggerType => validLoggerTypes.has(s as LoggerType)),\n );\n}\n", "const transports = ['stdio', 'http'] as const;\nexport type TransportName = (typeof transports)[number];\nexport function isTransport(transport: unknown): transport is TransportName {\n return !!transports.find((t) => t === transport);\n}\n", "export function getDirname(): string {\n if (typeof __dirname === 'string') {\n return __dirname;\n }\n\n throw new Error('__dirname is not set');\n}\n", "export const milliseconds = {\n fromSeconds: (seconds: number) => seconds * 1000,\n fromMinutes: (minutes: number) => minutes * 60 * 1000,\n fromHours: (hours: number) => hours * 60 * 60 * 1000,\n fromDays: (days: number) => days * 24 * 60 * 60 * 1000,\n fromWeeks: (weeks: number) => weeks * 7 * 24 * 60 * 60 * 1000,\n fromMonths: (months: number) => months * 30 * 24 * 60 * 60 * 1000,\n fromYears: (years: number) => years * 365.25 * 24 * 60 * 60 * 1000,\n};\n", "export function parseNumber(\n value: string | undefined,\n {\n defaultValue,\n minValue,\n maxValue,\n }: { defaultValue: number; minValue?: number; maxValue?: number } = {\n defaultValue: 0,\n minValue: Number.NEGATIVE_INFINITY,\n maxValue: Number.POSITIVE_INFINITY,\n },\n): number {\n if (!value) {\n return defaultValue;\n }\n\n const number = parseFloat(value);\n return isNaN(number) ||\n (minValue !== undefined && number < minValue) ||\n (maxValue !== undefined && number > maxValue)\n ? defaultValue\n : number;\n}\n", "import { z } from 'zod';\n\n/**\n * Telemetry provider interface for metrics collection.\n */\nexport interface TelemetryProvider {\n /**\n * Initialize the telemetry provider.\n */\n initialize(): void;\n\n /**\n * Record a custom metric with the given name and attributes.\n *\n * @param name - The metric name (e.g., 'apm_mcp_tool_calls')\n * @param value - The metric value (default: 1 for counters)\n * @param attributes - Dimensions/tags for the metric\n *\n * @example\n * ```typescript\n * telemetry.recordMetric('apm_mcp_tool_calls', 1, {\n * tool_name: 'list-pulse-metric-subscriptions',\n * });\n * ```\n */\n recordMetric(name: string, value: number, attributes: TelemetryAttributes): void;\n\n /**\n * Record a histogram observation (e.g., latency) with the given name and attributes.\n *\n * @param name - The metric name (e.g., 'http_server_request_duration')\n * @param value - The observed value (e.g., duration in milliseconds)\n * @param attributes - Dimensions/tags for the metric\n *\n * @example\n * ```typescript\n * telemetry.recordHistogram('apm_mcp_tool_duration', 142.5, {\n * tool_name: 'get-datasource-metadata',\n * success: true,\n * });\n * ```\n */\n recordHistogram(name: string, value: number, attributes: TelemetryAttributes): void;\n}\n\n/**\n * Schema for telemetry attributes.\n * Values can be strings, numbers, booleans, or undefined.\n */\nexport const telemetryAttributesSchema = z.record(\n z.string(),\n z.union([z.string(), z.number(), z.boolean(), z.undefined()]),\n);\nexport type TelemetryAttributes = z.infer<typeof telemetryAttributesSchema>;\n\n/**\n * Valid telemetry provider names\n */\nexport const telemetryProviderSchema = z.enum(['noop', 'custom']);\nexport type TelemetryProviderType = z.infer<typeof telemetryProviderSchema>;\n\n/**\n * Schema for noop telemetry config (no telemetry)\n */\nexport const noopTelemetryConfigSchema = z.object({\n provider: z.literal('noop'),\n});\n\n/**\n * Schema for custom telemetry provider config.\n * Requires 'module' field, allows additional provider-specific options.\n */\nexport const providerConfigSchema = z\n .object({\n module: z.string({ required_error: 'Custom provider requires \"module\" path' }),\n })\n .passthrough();\n\n/**\n * Schema for custom telemetry config\n *\n * @example\n * ```json\n * {\n * \"provider\": \"custom\",\n * \"providerConfig\": {\n * \"module\": \"./my-otel-provider.js\"\n * }\n * }\n * ```\n */\nexport const customTelemetryConfigSchema = z.object({\n provider: z.literal('custom'),\n providerConfig: providerConfigSchema,\n});\n\n/**\n * Combined telemetry config schema (discriminated union)\n */\nexport const telemetryConfigSchema = z.discriminatedUnion('provider', [\n noopTelemetryConfigSchema,\n customTelemetryConfigSchema,\n]);\n\nexport type TelemetryConfig = z.infer<typeof telemetryConfigSchema>;\n\n/**\n * Type guard for telemetry provider names\n */\nexport function isTelemetryProvider(provider: unknown): provider is TelemetryProviderType {\n return telemetryProviderSchema.safeParse(provider).success;\n}\n", "export default function invariant(condition: unknown, message?: string): asserts condition {\n if (!condition) {\n throw new Error(message ? message : 'Invariant Violation');\n }\n}\n", "/**\n * NoOp telemetry provider - does nothing.\n * This is the default provider when telemetry is disabled.\n *\n * Zero overhead implementation that can be safely used in production\n * when telemetry is not needed.\n */\n\nimport { TelemetryAttributes, TelemetryProvider } from './types.js';\n\nexport class NoOpTelemetryProvider implements TelemetryProvider {\n initialize(): void {\n // No-op\n }\n\n recordMetric(_name: string, _value: number, _attributes: TelemetryAttributes): void {\n // No-op\n }\n\n recordHistogram(_name: string, _value: number, _attributes: TelemetryAttributes): void {\n // No-op\n }\n}\n"],
5
- "mappings": "qeAWA,IAAAA,GAAmB,sBCPnB,IAAAC,EAAwB,gBCHxB,IAAAC,EAAyC,cCDzC,IAAAC,EAAqB,gBCQrB,IAAIC,GAMG,IAAMC,EAAgB,IAA8BC,GCXpD,IAAMC,GAAmB,CAC9B,QACA,OACA,SACA,UACA,QACA,WACA,QACA,WACF,EAEaC,EAAmB,OAAO,YACrCD,GAAiB,IAAI,CAACE,EAAOC,IAAU,CAACD,EAAOC,CAAK,CAAC,CACvD,ECZO,SAASC,GAAUC,EAAsBC,EAA6B,CAC3E,OAAOC,EAAiBF,CAAU,GAAKE,EAAiBD,CAAQ,CAClE,CAEA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,CAAC,EACDC,EAAI,CAAE,QAAS,0CAA2C,MAAO,OAAQ,OAAQ,WAAY,CAAC,EAG9F,IAAMC,EAAmB,IAAIH,EAC7B,OAAAG,EAAiB,WAAW,EAC5B,OAAO,oBAAsBA,EACtBA,CACT,CACF,CAcA,SAASJ,GAAmBH,EAAqD,CAC/E,GAAI,CAACA,GAAQ,OACX,MAAM,IAAI,MACR,oIAEF,EAGF,IAAMQ,EAAaR,EAAO,OAE1B,GAAI,OAAOQ,GAAe,SACxB,MAAM,IAAI,MAAM,4DAA4D,EAI9E,IAAIC,EAEAD,EAAW,WAAW,GAAG,GAAKA,EAAW,WAAW,GAAG,EAEzDC,KAAe,WAAQ,QAAQ,IAAI,EAAGD,CAAU,EAGhDC,EAAeD,EAGjB,GAAI,CAEF,IAAME,EAAS,QAAQD,CAAY,EAG7BE,EAAgBD,EAAO,SAAWA,EAAO,kBAE/C,GAAI,CAACC,EACH,MAAM,IAAI,MACR,UAAUH,CAAU,kHAEtB,EAIF,IAAMN,EAAW,IAAIS,EAAcX,CAAM,EAGzC,OAAAY,GAA0BV,CAAQ,EAC3BA,CACT,OAASG,EAAO,CAEd,IAAIQ,EAAe,kDAAkDL,CAAU,MAE/E,MAAIH,aAAiB,OAAS,SAAUA,GAASA,EAAM,OAAS,mBAC9DQ,GACE,2IAIFA,GAAgB,UAAUR,CAAK,GAG3B,IAAI,MAAMQ,CAAY,CAC9B,CACF,CD9KA,GAAAC,QAAO,OAAO,EAId,GAAI,CACFC,EAAoB,CACtB,OAASC,EAAO,CACd,QAAQ,KAAK,kCAAmCA,CAAK,CACvD",
6
- "names": ["import_dotenv", "import_path", "import_fs", "import_path", "_fileLogger", "getFileLogger", "_fileLogger", "orderedLogLevels", "logLevelSeverity", "level", "index", "shouldLog", "entryLevel", "minLevel", "logLevelSeverity", "isLogLevel", "value", "parseLogLevel", "level", "errorReplacer", "data", "log", "entry", "config", "getBaseConfig", "message", "getFileLogger", "loggerTypes", "validLoggerTypes", "parseLoggerTypes", "value", "s", "transports", "isTransport", "transport", "getDirname", "milliseconds", "seconds", "minutes", "hours", "days", "weeks", "months", "years", "parseNumber", "value", "defaultValue", "minValue", "maxValue", "number", "__dirname", "getDirname", "BaseConfig", "cleansedVars", "removeClaudeMcpBundleUserConfigTemplates", "transport", "defaultNotificationLevel", "logLevel", "logging", "fileLoggerDirectory", "maxRequestTimeoutMs", "notificationPayloadMaxBytes", "isTransport", "parseLogLevel", "parseLoggerTypes", "parseNumber", "milliseconds", "envVars", "acc", "key", "value", "getBaseConfig", "import_zod", "telemetryAttributesSchema", "telemetryProviderSchema", "noopTelemetryConfigSchema", "providerConfigSchema", "customTelemetryConfigSchema", "telemetryConfigSchema", "isTelemetryProvider", "provider", "invariant", "condition", "message", "authTypes", "isAuthType", "auth", "type", "Config", "BaseConfig", "cleansedVars", "removeClaudeMcpBundleUserConfigTemplates", "server", "siteName", "transport", "sslKey", "sslCert", "httpPortEnvVarName", "corsOriginConfig", "patName", "patValue", "jwtSubClaim", "clientId", "secretId", "secretValue", "uatTenantId", "uatIssuer", "uatUsernameClaimName", "uatUsernameClaim", "uatPrivateKey", "uatPrivateKeyPath", "uatKeyId", "jwtAdditionalPayload", "datasourceCredentials", "disableLogMasking", "disableSessionManagement", "tableauServerVersionCheckIntervalInHours", "passthroughAuthUserSessionCheckIntervalInMinutes", "mcpSiteSettingsCheckIntervalInMinutes", "enableMcpSiteSettings", "allowSitesToConfigureRequestOverrides", "enablePassthroughAuth", "disableOauth", "oauthEmbeddedAuthzServer", "oauthIssuer", "oauthLockSite", "oauthJwePrivateKey", "oauthJwePrivateKeyPath", "oauthJwePrivateKeyPassphrase", "oauthResourceUri", "oauthGlobalResourceUri", "redirectUri", "oauthClientIdSecretPairs", "dnsServers", "advertiseApiScopes", "authzCodeTimeoutMs", "accessTokenTimeoutMs", "refreshTokenTimeoutMs", "oauthDisableScopes", "telemetryProvider", "telemetryProviderConfig", "latencyMetricName", "productTelemetryEndpoint", "productTelemetryEnabled", "isHyperforce", "breakGlassDisableGlobally", "adminToolsEnabled", "jwtUsername", "parseNumber", "getCorsOriginConfig", "disableOauthOverride", "enforceScopes", "embeddedAuthzServer", "ip", "milliseconds", "acc", "curr", "secret", "isTelemetryProvider", "providerConfigSchema", "isTransport", "invariant", "validateServer", "prefix", "_", "error", "errorMessage", "origin", "getConfig", "NoOpTelemetryProvider", "_name", "_value", "_attributes", "getInstanceMethods", "cls", "name", "isRecord", "obj", "validateTelemetryProvider", "provider", "missingMethods", "NoOpTelemetryProvider", "method", "initializeTelemetry", "config", "getConfig", "provider", "loadCustomProvider", "NoOpTelemetryProvider", "error", "log", "fallbackProvider", "modulePath", "resolvedPath", "module", "ProviderClass", "validateTelemetryProvider", "errorMessage", "dotenv", "initializeTelemetry", "error"]
4
+ "sourcesContent": ["/**\n * APM agent preload script\n *\n * Use with node -r flag to start APM agent before application code:\n * node -r ./build/telemetry/tracing.js build/index.js\n *\n * Environment variables:\n * - TELEMETRY_PROVIDER=custom - Use custom telemetry provider (default: noop)\n */\n\n// Load .env before anything else\nimport dotenv from 'dotenv';\ndotenv.config();\n\nimport { initializeTelemetry } from './init.js';\n\ntry {\n initializeTelemetry();\n} catch (error) {\n console.warn('Failed to initialize telemetry:', error);\n}\n", "/**\n * Telemetry initialization and provider factory\n */\n\nimport { resolve } from 'path';\n\nimport { getConfig } from '../config.js';\nimport { log } from '../logging/logger.js';\nimport { NoOpTelemetryProvider } from './noop.js';\nimport { TelemetryProvider } from './types.js';\n\n/**\n * Get all instance methods from a class prototype\n */\nfunction getInstanceMethods(cls: new (...args: unknown[]) => unknown): string[] {\n return Object.getOwnPropertyNames(cls.prototype).filter(\n (name) => name !== 'constructor' && typeof cls.prototype[name] === 'function',\n );\n}\n\nfunction isRecord(obj: unknown): obj is Record<string, unknown> {\n return typeof obj === 'object' && obj !== null && !Array.isArray(obj);\n}\n\n/**\n * Validate that a provider implements all required TelemetryProvider methods\n */\nfunction validateTelemetryProvider(provider: unknown): asserts provider is TelemetryProvider {\n if (!isRecord(provider)) {\n throw new Error('Provider must be an object');\n }\n\n const requiredMethods = getInstanceMethods(NoOpTelemetryProvider);\n // Keep only methods that provider doesn't have (i.e., missing or miscategorized methods)\n const missingMethods = requiredMethods.filter((method) => typeof provider[method] !== 'function');\n\n if (missingMethods.length > 0) {\n throw new Error(`Custom provider missing required methods: ${missingMethods.join(', ')}`);\n }\n}\n\n// Use global to share provider across bundles (tracing.js and index.js)\ndeclare global {\n var __telemetryProvider: TelemetryProvider | undefined;\n}\n\n/**\n * Get the current telemetry provider instance.\n * If not initialized, returns a NoOp provider.\n *\n * @returns The telemetry provider\n */\nexport function getTelemetryProvider(): TelemetryProvider {\n if (!global.__telemetryProvider) {\n // return a NoOp provider for this request if telemetry hasn't been initialized\n return new NoOpTelemetryProvider();\n }\n return global.__telemetryProvider;\n}\n\n/**\n * Initialize the telemetry provider based on configuration.\n *\n * This function should be called early in application startup, before any\n * HTTP requests or other instrumented operations occur.\n *\n * @returns A configured telemetry provider\n *\n * @example\n * function main() {\n * // Initialize telemetry first\n * const telemetry = initializeTelemetry();\n *\n * // Start application...\n * }\n */\nexport function initializeTelemetry(): TelemetryProvider {\n const config = getConfig();\n let provider: TelemetryProvider;\n\n try {\n // Select provider based on configuration\n switch (config.telemetry.provider) {\n case 'custom':\n // Load custom provider from user's filesystem\n provider = loadCustomProvider(config.telemetry.providerConfig);\n break;\n\n case 'noop':\n provider = new NoOpTelemetryProvider();\n break;\n }\n\n // Initialize the provider\n provider.initialize();\n global.__telemetryProvider = provider;\n return provider;\n } catch (error) {\n log({\n message: 'Failed to initialize telemetry provider',\n level: 'error',\n logger: 'telemetry',\n data: error,\n });\n log({ message: 'Falling back to NoOp telemetry provider', level: 'info', logger: 'telemetry' });\n\n // Fallback to NoOp on error - telemetry failures shouldn't break the application\n const fallbackProvider = new NoOpTelemetryProvider();\n fallbackProvider.initialize();\n global.__telemetryProvider = fallbackProvider;\n return fallbackProvider;\n }\n}\n\n/**\n * Load a custom telemetry provider from user's filesystem or npm package.\n *\n * The custom provider module should export a default class that implements TelemetryProvider.\n *\n * @param config - Provider configuration containing the module path\n * @returns A configured custom telemetry provider\n *\n * @example Custom provider from file\n * TELEMETRY_PROVIDER=custom\n * TELEMETRY_PROVIDER_CONFIG='{\"module\":\"./my-telemetry.js\"}'\n */\nfunction loadCustomProvider(config?: Record<string, unknown>): TelemetryProvider {\n if (!config?.module) {\n throw new Error(\n 'Custom telemetry provider requires \"module\" in providerConfig. ' +\n 'Example: TELEMETRY_PROVIDER_CONFIG=\\'{\"module\":\"./my-telemetry.js\"}\\'',\n );\n }\n\n const modulePath = config.module;\n\n if (typeof modulePath !== 'string') {\n throw new Error('Custom telemetry provider requires \"module\" to be a string');\n }\n\n // Determine if it's a file path or npm package name\n let resolvedPath: string;\n\n if (modulePath.startsWith('.') || modulePath.startsWith('/')) {\n // File path - resolve relative to process working directory (user's project root)\n resolvedPath = resolve(process.cwd(), modulePath);\n } else {\n // npm package name - require as-is\n resolvedPath = modulePath;\n }\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports -- Sync load for preload script\n const module = require(resolvedPath);\n\n // Look for default export or named export \"TelemetryProvider\"\n const ProviderClass = module.default || module.TelemetryProvider;\n\n if (!ProviderClass) {\n throw new Error(\n `Module ${modulePath} must export a default class or named export \"TelemetryProvider\" ` +\n 'that implements the TelemetryProvider interface',\n );\n }\n\n // Instantiate the provider with the full config\n const provider = new ProviderClass(config);\n\n // Validate the provider implements TelemetryProvider interface\n validateTelemetryProvider(provider);\n return provider;\n } catch (error) {\n // Provide helpful error message with common issues\n let errorMessage = `Failed to load custom telemetry provider from \"${modulePath}\". `;\n\n if (error instanceof Error && 'code' in error && error.code === 'MODULE_NOT_FOUND') {\n errorMessage +=\n 'Module not found. ' +\n 'If using a file path, ensure the file exists and the path is correct. ' +\n 'If using an npm package, ensure it is installed.';\n } else {\n errorMessage += `Error: ${error}`;\n }\n\n throw new Error(errorMessage);\n }\n}\n", "import { CorsOptions } from 'cors';\nimport { existsSync, readFileSync } from 'fs';\n\nimport { BaseConfig, removeClaudeMcpBundleUserConfigTemplates } from './config.shared.js';\nimport { isTelemetryProvider, providerConfigSchema, TelemetryConfig } from './telemetry/types.js';\nimport { isTransport } from './transports.js';\nimport invariant from './utils/invariant.js';\nimport { milliseconds } from './utils/milliseconds.js';\nimport { parseNumber } from './utils/parseNumber.js';\n\nconst authTypes = ['pat', 'uat', 'direct-trust', 'oauth'] as const;\ntype AuthType = (typeof authTypes)[number];\n\nfunction isAuthType(auth: unknown): auth is AuthType {\n return authTypes.some((type) => type === auth);\n}\n\nexport class Config extends BaseConfig {\n auth: AuthType;\n server: string;\n sslKey: string;\n sslCert: string;\n httpPort: number;\n corsOriginConfig: CorsOptions['origin'];\n siteName: string;\n patName: string;\n patValue: string;\n jwtUsername: string;\n connectedAppClientId: string;\n connectedAppSecretId: string;\n connectedAppSecretValue: string;\n uatTenantId: string;\n uatIssuer: string;\n uatUsernameClaimName: string;\n uatPrivateKey: string;\n uatKeyId: string;\n jwtAdditionalPayload: string;\n datasourceCredentials: string;\n disableSessionManagement: boolean;\n tableauServerVersionCheckIntervalInHours: number;\n passthroughAuthUserSessionCheckIntervalInMinutes: number;\n mcpSiteSettingsCheckIntervalInMinutes: number;\n enableMcpSiteSettings: boolean;\n allowSitesToConfigureRequestOverrides: boolean;\n enablePassthroughAuth: boolean;\n oauth: {\n enabled: boolean;\n embeddedAuthzServer: boolean;\n issuer: string;\n redirectUri: string;\n resourceUri: string;\n globalResourceUri: string;\n lockSite: boolean;\n jwePrivateKey: string;\n jwePrivateKeyPath: string;\n jwePrivateKeyPassphrase: string | undefined;\n authzCodeTimeoutMs: number;\n accessTokenTimeoutMs: number;\n refreshTokenTimeoutMs: number;\n clientIdSecretPairs: Record<string, string> | null;\n dnsServers: string[];\n enforceScopes: boolean;\n advertiseApiScopes: boolean;\n };\n telemetry: TelemetryConfig;\n latencyMetricName: string;\n productTelemetryEndpoint: string;\n productTelemetryEnabled: boolean;\n isHyperforce: boolean;\n breakGlassDisableGlobally: boolean;\n adminToolsEnabled: boolean;\n\n constructor() {\n super();\n\n const cleansedVars = removeClaudeMcpBundleUserConfigTemplates(process.env);\n const {\n AUTH: auth,\n SERVER: server,\n SITE_NAME: siteName,\n TRANSPORT: transport,\n SSL_KEY: sslKey,\n SSL_CERT: sslCert,\n HTTP_PORT_ENV_VAR_NAME: httpPortEnvVarName,\n CORS_ORIGIN_CONFIG: corsOriginConfig,\n PAT_NAME: patName,\n PAT_VALUE: patValue,\n JWT_SUB_CLAIM: jwtSubClaim,\n CONNECTED_APP_CLIENT_ID: clientId,\n CONNECTED_APP_SECRET_ID: secretId,\n CONNECTED_APP_SECRET_VALUE: secretValue,\n UAT_TENANT_ID: uatTenantId,\n UAT_ISSUER: uatIssuer,\n UAT_USERNAME_CLAIM_NAME: uatUsernameClaimName,\n UAT_USERNAME_CLAIM: uatUsernameClaim,\n UAT_PRIVATE_KEY: uatPrivateKey,\n UAT_PRIVATE_KEY_PATH: uatPrivateKeyPath,\n UAT_KEY_ID: uatKeyId,\n JWT_ADDITIONAL_PAYLOAD: jwtAdditionalPayload,\n DATASOURCE_CREDENTIALS: datasourceCredentials,\n DISABLE_SESSION_MANAGEMENT: disableSessionManagement,\n TABLEAU_SERVER_VERSION_CHECK_INTERVAL_IN_HOURS: tableauServerVersionCheckIntervalInHours,\n PASSTHROUGH_AUTH_USER_SESSION_CHECK_INTERVAL_IN_MINUTES:\n passthroughAuthUserSessionCheckIntervalInMinutes,\n MCP_SITE_SETTINGS_CHECK_INTERVAL_IN_MINUTES: mcpSiteSettingsCheckIntervalInMinutes,\n ENABLE_MCP_SITE_SETTINGS: enableMcpSiteSettings,\n ALLOW_SITES_TO_CONFIGURE_REQUEST_OVERRIDES: allowSitesToConfigureRequestOverrides,\n ENABLE_PASSTHROUGH_AUTH: enablePassthroughAuth,\n DANGEROUSLY_DISABLE_OAUTH: disableOauth,\n OAUTH_EMBEDDED_AUTHZ_SERVER: oauthEmbeddedAuthzServer,\n OAUTH_ISSUER: oauthIssuer,\n OAUTH_LOCK_SITE: oauthLockSite,\n OAUTH_JWE_PRIVATE_KEY: oauthJwePrivateKey,\n OAUTH_JWE_PRIVATE_KEY_PATH: oauthJwePrivateKeyPath,\n OAUTH_JWE_PRIVATE_KEY_PASSPHRASE: oauthJwePrivateKeyPassphrase,\n OAUTH_RESOURCE_URI: oauthResourceUri,\n OAUTH_GLOBAL_RESOURCE_URI: oauthGlobalResourceUri,\n OAUTH_REDIRECT_URI: redirectUri,\n OAUTH_CLIENT_ID_SECRET_PAIRS: oauthClientIdSecretPairs,\n OAUTH_CIMD_DNS_SERVERS: dnsServers,\n ADVERTISE_API_SCOPES: advertiseApiScopes,\n OAUTH_AUTHORIZATION_CODE_TIMEOUT_MS: authzCodeTimeoutMs,\n OAUTH_ACCESS_TOKEN_TIMEOUT_MS: accessTokenTimeoutMs,\n OAUTH_REFRESH_TOKEN_TIMEOUT_MS: refreshTokenTimeoutMs,\n OAUTH_DISABLE_SCOPES: oauthDisableScopes,\n TELEMETRY_PROVIDER: telemetryProvider,\n TELEMETRY_PROVIDER_CONFIG: telemetryProviderConfig,\n LATENCY_METRIC_NAME: latencyMetricName,\n PRODUCT_TELEMETRY_ENDPOINT: productTelemetryEndpoint,\n PRODUCT_TELEMETRY_ENABLED: productTelemetryEnabled,\n IS_HYPERFORCE: isHyperforce,\n BREAK_GLASS_DISABLE_GLOBALLY: breakGlassDisableGlobally,\n ADMIN_TOOLS_ENABLED: adminToolsEnabled,\n } = cleansedVars;\n\n let jwtUsername = '';\n\n this.siteName = siteName ?? '';\n\n this.sslKey = sslKey?.trim() ?? '';\n this.sslCert = sslCert?.trim() ?? '';\n this.httpPort = parseNumber(cleansedVars[httpPortEnvVarName?.trim() || 'PORT'], {\n defaultValue: 3927,\n minValue: 1,\n maxValue: 65535,\n });\n this.corsOriginConfig = getCorsOriginConfig(corsOriginConfig?.trim() ?? '');\n this.datasourceCredentials = datasourceCredentials ?? '';\n this.disableSessionManagement = disableSessionManagement === 'true';\n\n this.tableauServerVersionCheckIntervalInHours = parseNumber(\n tableauServerVersionCheckIntervalInHours,\n {\n defaultValue: 1,\n minValue: 1,\n maxValue: 24 * 7, // 7 days\n },\n );\n\n this.passthroughAuthUserSessionCheckIntervalInMinutes = parseNumber(\n passthroughAuthUserSessionCheckIntervalInMinutes,\n {\n defaultValue: 10,\n minValue: 0,\n maxValue: 60 * 24, // 24 hours\n },\n );\n\n this.mcpSiteSettingsCheckIntervalInMinutes = parseNumber(\n mcpSiteSettingsCheckIntervalInMinutes,\n {\n defaultValue: 10,\n minValue: 1,\n maxValue: 60 * 24, // 24 hours\n },\n );\n\n this.enableMcpSiteSettings = enableMcpSiteSettings !== 'false';\n this.allowSitesToConfigureRequestOverrides = allowSitesToConfigureRequestOverrides === 'true';\n this.enablePassthroughAuth = enablePassthroughAuth === 'true';\n const disableOauthOverride = disableOauth === 'true';\n const disableScopes = oauthDisableScopes === 'true';\n const enforceScopes = !disableScopes;\n const embeddedAuthzServer = oauthEmbeddedAuthzServer !== 'false';\n\n if (this.allowSitesToConfigureRequestOverrides && !this.enableMcpSiteSettings) {\n throw new Error(\n 'ALLOW_SITES_TO_CONFIGURE_REQUEST_OVERRIDES is \"true\", but MCP site settings are not enabled.',\n );\n }\n\n this.oauth = {\n enabled: disableOauthOverride ? false : !!oauthIssuer,\n embeddedAuthzServer,\n issuer: oauthIssuer ?? '',\n resourceUri: oauthResourceUri ?? `http://127.0.0.1:${this.httpPort}`,\n globalResourceUri: oauthGlobalResourceUri ?? '',\n redirectUri: redirectUri || (oauthIssuer ? `${oauthIssuer}/Callback` : ''),\n lockSite: oauthLockSite !== 'false', // Site locking is enabled by default\n jwePrivateKey: oauthJwePrivateKey ?? '',\n jwePrivateKeyPath: oauthJwePrivateKeyPath ?? '',\n jwePrivateKeyPassphrase: oauthJwePrivateKeyPassphrase || undefined,\n dnsServers: dnsServers\n ? dnsServers.split(',').map((ip) => ip.trim())\n : ['1.1.1.1', '1.0.0.1' /* Cloudflare public DNS */],\n authzCodeTimeoutMs: parseNumber(authzCodeTimeoutMs, {\n defaultValue: milliseconds.fromMinutes(10),\n minValue: 0,\n maxValue: milliseconds.fromHours(1),\n }),\n accessTokenTimeoutMs: parseNumber(accessTokenTimeoutMs, {\n defaultValue: milliseconds.fromHours(1),\n minValue: 0,\n maxValue: milliseconds.fromDays(30),\n }),\n refreshTokenTimeoutMs: parseNumber(refreshTokenTimeoutMs, {\n defaultValue: milliseconds.fromDays(30),\n minValue: 0,\n maxValue: milliseconds.fromYears(1),\n }),\n clientIdSecretPairs: oauthClientIdSecretPairs\n ? oauthClientIdSecretPairs.split(',').reduce<Record<string, string>>((acc, curr) => {\n const [clientId, secret] = curr.split(':');\n if (clientId && secret) {\n acc[clientId] = secret;\n }\n return acc;\n }, {})\n : null,\n enforceScopes,\n advertiseApiScopes: advertiseApiScopes === 'true',\n };\n\n if (\n this.oauth.clientIdSecretPairs &&\n Object.keys(this.oauth.clientIdSecretPairs).length === 0\n ) {\n throw new Error(\n `OAUTH_CLIENT_ID_SECRET_PAIRS is in an invalid format: ${oauthClientIdSecretPairs}. Should be in the format: clientId:secret`,\n );\n }\n\n const parsedProvider = isTelemetryProvider(telemetryProvider) ? telemetryProvider : 'noop';\n if (parsedProvider === 'custom') {\n if (!telemetryProviderConfig) {\n throw new Error(\n 'TELEMETRY_PROVIDER_CONFIG is required when TELEMETRY_PROVIDER is \"custom\"',\n );\n }\n this.telemetry = {\n provider: 'custom',\n providerConfig: providerConfigSchema.parse(JSON.parse(telemetryProviderConfig)),\n };\n } else {\n this.telemetry = {\n provider: 'noop',\n };\n }\n\n this.latencyMetricName = latencyMetricName || 'http_server_1agg1_request_duration';\n this.productTelemetryEndpoint =\n productTelemetryEndpoint || 'https://prod.telemetry.tableausoftware.com';\n this.productTelemetryEnabled = productTelemetryEnabled !== 'false';\n this.isHyperforce = isHyperforce === 'true';\n this.breakGlassDisableGlobally = breakGlassDisableGlobally === 'true';\n this.adminToolsEnabled = adminToolsEnabled === 'true';\n\n this.auth = isAuthType(auth) ? auth : this.oauth.enabled ? 'oauth' : 'pat';\n this.transport = isTransport(transport) ? transport : this.oauth.enabled ? 'http' : 'stdio';\n\n if (this.transport === 'http' && !disableOauthOverride && !this.oauth.issuer) {\n throw new Error(\n 'OAUTH_ISSUER must be set when TRANSPORT is \"http\" unless DANGEROUSLY_DISABLE_OAUTH is \"true\"',\n );\n }\n\n if (this.auth === 'oauth') {\n if (disableOauthOverride) {\n throw new Error('When AUTH is \"oauth\", DANGEROUSLY_DISABLE_OAUTH cannot be \"true\"');\n }\n\n if (!this.oauth.issuer) {\n throw new Error('When AUTH is \"oauth\", OAUTH_ISSUER must be set');\n }\n } else {\n invariant(server, 'The environment variable SERVER is not set');\n validateServer(server);\n }\n\n if (this.oauth.enabled) {\n if (this.oauth.embeddedAuthzServer) {\n invariant(this.oauth.redirectUri, 'The environment variable OAUTH_REDIRECT_URI is not set');\n\n if (!this.oauth.jwePrivateKey && !this.oauth.jwePrivateKeyPath) {\n throw new Error(\n 'One of the environment variables: OAUTH_JWE_PRIVATE_KEY_PATH or OAUTH_JWE_PRIVATE_KEY must be set',\n );\n }\n\n if (this.oauth.jwePrivateKey && this.oauth.jwePrivateKeyPath) {\n throw new Error(\n 'Only one of the environment variables: OAUTH_JWE_PRIVATE_KEY or OAUTH_JWE_PRIVATE_KEY_PATH must be set',\n );\n }\n\n if (\n this.oauth.jwePrivateKeyPath &&\n process.env.TABLEAU_MCP_TEST !== 'true' &&\n !existsSync(this.oauth.jwePrivateKeyPath)\n ) {\n throw new Error(\n `OAuth JWE private key path does not exist: ${this.oauth.jwePrivateKeyPath}`,\n );\n }\n }\n\n if (this.transport === 'stdio') {\n throw new Error('TRANSPORT must be \"http\" when OAUTH_ISSUER is set');\n }\n }\n\n if (this.auth === 'pat') {\n invariant(patName, 'The environment variable PAT_NAME is not set');\n invariant(patValue, 'The environment variable PAT_VALUE is not set');\n } else if (this.auth === 'direct-trust') {\n invariant(jwtSubClaim, 'The environment variable JWT_SUB_CLAIM is not set');\n invariant(clientId, 'The environment variable CONNECTED_APP_CLIENT_ID is not set');\n invariant(secretId, 'The environment variable CONNECTED_APP_SECRET_ID is not set');\n invariant(secretValue, 'The environment variable CONNECTED_APP_SECRET_VALUE is not set');\n\n jwtUsername = jwtSubClaim ?? '';\n } else if (this.auth === 'uat') {\n invariant(uatTenantId, 'The environment variable UAT_TENANT_ID is not set');\n invariant(uatIssuer, 'The environment variable UAT_ISSUER is not set');\n\n if (!uatUsernameClaim && !jwtSubClaim) {\n throw new Error(\n 'One of the environment variables: UAT_USERNAME_CLAIM or JWT_SUB_CLAIM must be set',\n );\n }\n\n jwtUsername = uatUsernameClaim ?? jwtSubClaim ?? '';\n\n if (!uatPrivateKey && !uatPrivateKeyPath) {\n throw new Error(\n 'One of the environment variables: UAT_PRIVATE_KEY_PATH or UAT_PRIVATE_KEY must be set',\n );\n }\n\n if (uatPrivateKey && uatPrivateKeyPath) {\n throw new Error(\n 'Only one of the environment variables: UAT_PRIVATE_KEY or UAT_PRIVATE_KEY_PATH must be set',\n );\n }\n\n if (\n uatPrivateKeyPath &&\n process.env.TABLEAU_MCP_TEST !== 'true' &&\n !existsSync(uatPrivateKeyPath)\n ) {\n throw new Error(`UAT private key path does not exist: ${uatPrivateKeyPath}`);\n }\n }\n\n this.server = server ?? '';\n this.patName = patName ?? '';\n this.patValue = patValue ?? '';\n this.jwtUsername = jwtUsername ?? '';\n this.connectedAppClientId = clientId ?? '';\n this.connectedAppSecretId = secretId ?? '';\n this.connectedAppSecretValue = secretValue ?? '';\n this.uatTenantId = uatTenantId ?? '';\n this.uatIssuer = uatIssuer ?? '';\n this.uatUsernameClaimName = uatUsernameClaimName || 'email';\n this.uatPrivateKey =\n uatPrivateKey || (uatPrivateKeyPath ? readFileSync(uatPrivateKeyPath, 'utf8') : '');\n this.uatKeyId = uatKeyId ?? '';\n this.jwtAdditionalPayload = jwtAdditionalPayload || '{}';\n }\n}\n\nfunction validateServer(server: string): void {\n if (!['https://', 'http://'].find((prefix) => server.startsWith(prefix))) {\n throw new Error(\n `The environment variable SERVER must start with \"http://\" or \"https://\": ${server}`,\n );\n }\n\n try {\n const _ = new URL(server);\n } catch (error: unknown) {\n const errorMessage = error instanceof Error ? error.message : String(error);\n throw new Error(\n `The environment variable SERVER is not a valid URL: ${server} -- ${errorMessage}`,\n );\n }\n}\n\nfunction getCorsOriginConfig(corsOriginConfig: string): CorsOptions['origin'] {\n if (!corsOriginConfig) {\n return true;\n }\n\n if (corsOriginConfig.match(/^true|false$/i)) {\n return corsOriginConfig.toLowerCase() === 'true';\n }\n\n if (corsOriginConfig === '*') {\n return '*';\n }\n\n if (corsOriginConfig.startsWith('[') && corsOriginConfig.endsWith(']')) {\n try {\n const origins = JSON.parse(corsOriginConfig) as Array<string>;\n return origins.map((origin) => new URL(origin).origin);\n } catch {\n throw new Error(\n `The environment variable CORS_ORIGIN_CONFIG is not a valid array of URLs: ${corsOriginConfig}`,\n );\n }\n }\n\n try {\n return new URL(corsOriginConfig).origin;\n } catch {\n throw new Error(\n `The environment variable CORS_ORIGIN_CONFIG is not a valid URL: ${corsOriginConfig}`,\n );\n }\n}\n\nexport const getConfig = (): Config => new Config();\n", "import { join } from 'path';\n\nimport { parseLogLevel } from './logging/logger.js';\nimport { LoggerType, parseLoggerTypes } from './logging/loggerType.js';\nimport { LogLevel } from './logging/types.js';\nimport { isTransport, TransportName } from './transports.js';\nimport { getDirname } from './utils/getDirname.js';\nimport { milliseconds } from './utils/milliseconds.js';\nimport { parseNumber } from './utils/parseNumber.js';\n\nconst __dirname = getDirname();\n\nexport class BaseConfig {\n transport: TransportName;\n defaultNotificationLevel: string;\n logLevel: LogLevel;\n loggers: Set<LoggerType>;\n fileLoggerDirectory: string;\n disableLogMasking: boolean;\n maxRequestTimeoutMs: number;\n notificationPayloadMaxBytes: number;\n\n constructor() {\n const cleansedVars = removeClaudeMcpBundleUserConfigTemplates(process.env);\n const {\n TRANSPORT: transport,\n DEFAULT_NOTIFICATION_LEVEL: defaultNotificationLevel,\n LOG_LEVEL: logLevel,\n ENABLED_LOGGERS: logging,\n FILE_LOGGER_DIRECTORY: fileLoggerDirectory,\n DISABLE_LOG_MASKING: disableLogMasking,\n MAX_REQUEST_TIMEOUT_MS: maxRequestTimeoutMs,\n NOTIFICATION_PAYLOAD_MAX_BYTES: notificationPayloadMaxBytes,\n } = cleansedVars;\n\n this.transport = isTransport(transport) ? transport : 'stdio';\n this.defaultNotificationLevel = defaultNotificationLevel ?? 'debug';\n this.logLevel = parseLogLevel(logLevel);\n this.loggers = parseLoggerTypes(logging);\n this.fileLoggerDirectory = fileLoggerDirectory || join(__dirname, 'logs');\n this.disableLogMasking = disableLogMasking === 'true';\n this.maxRequestTimeoutMs = parseNumber(maxRequestTimeoutMs, {\n defaultValue: milliseconds.fromMinutes(10),\n minValue: 5000,\n maxValue: milliseconds.fromHours(1),\n });\n this.notificationPayloadMaxBytes = parseNumber(notificationPayloadMaxBytes, {\n defaultValue: 8192,\n minValue: 1,\n });\n }\n}\n\n// When the user does not provide a site name in the Claude MCP Bundle configuration,\n// Claude doesn't replace its value and sets the site name to \"${user_config.site_name}\".\nexport function removeClaudeMcpBundleUserConfigTemplates(\n envVars: Record<string, string | undefined>,\n): Record<string, string | undefined> {\n return Object.entries(envVars).reduce<Record<string, string | undefined>>((acc, [key, value]) => {\n if (value?.startsWith('${user_config.')) {\n acc[key] = '';\n } else {\n acc[key] = value;\n }\n return acc;\n }, {});\n}\n\nexport const getBaseConfig = (): BaseConfig => new BaseConfig();\n", "import { appendFile } from 'node:fs/promises';\n\nimport { existsSync, mkdirSync } from 'fs';\nimport { join } from 'path';\n\nimport { getExceptionMessage } from '../utils/getExceptionMessage.js';\nimport type { LogEntry } from './types.js';\n\nlet _fileLogger: FileLogger | undefined;\n\nexport const setFileLogger = (logger: FileLogger): void => {\n _fileLogger = logger;\n};\n\nexport const getFileLogger = (): FileLogger | undefined => _fileLogger;\n\nexport class FileLogger {\n private readonly _logDirectory: string;\n private readonly _fileMutexes = new Map<string, Promise<void>>();\n\n constructor({ logDirectory }: { logDirectory: string }) {\n this._logDirectory = logDirectory;\n\n if (!existsSync(this._logDirectory)) {\n mkdirSync(this._logDirectory, { recursive: true });\n }\n }\n\n async log(entry: LogEntry): Promise<void> {\n // Create a new log file each hour e.g. 2025-10-15T21-00-00-000Z.log\n const timestamp = new Date().toISOString();\n const filename = `${new Date(new Date().setMinutes(0, 0, 0)).toISOString().replace(/[:.]/g, '-')}.log`;\n const logFilePath = join(this._logDirectory, filename);\n\n // Get or create a mutex for this specific log file\n const mutexKey = logFilePath;\n const currentMutex = this._fileMutexes.get(mutexKey) ?? Promise.resolve();\n\n // Chain the file write operation after the current mutex\n const newMutex = currentMutex.then(async () => {\n try {\n // appendFile will create the file if it doesn't exist\n await appendFile(logFilePath, JSON.stringify({ timestamp, ...entry }) + '\\n');\n } catch (error) {\n process.stderr.write(\n `Failed to write to log file ${logFilePath}: ${getExceptionMessage(error)}\\n`,\n );\n }\n });\n\n this._fileMutexes.set(mutexKey, newMutex);\n\n // Clean up completed mutexes to prevent memory leaks\n newMutex.finally(() => {\n if (this._fileMutexes.get(mutexKey) === newMutex) {\n this._fileMutexes.delete(mutexKey);\n }\n });\n\n // Wait for the file write operation to complete\n await newMutex;\n }\n}\n", "import type { LoggingLevel } from '@modelcontextprotocol/sdk/types.js';\n\nexport type LogLevel = LoggingLevel;\nexport const orderedLogLevels = [\n 'debug',\n 'info',\n 'notice',\n 'warning',\n 'error',\n 'critical',\n 'alert',\n 'emergency',\n] as const;\n\nexport const logLevelSeverity = Object.fromEntries(\n orderedLogLevels.map((level, index) => [level, index]),\n) as Record<LogLevel, number>;\n\nexport type LogEntry = {\n message: string;\n data?: unknown;\n level: LogLevel;\n logger: string | undefined;\n};\n", "import { getBaseConfig } from '../config.shared.js';\nimport { getFileLogger } from './fileLogger.js';\nimport { LogEntry, LogLevel, logLevelSeverity } from './types.js';\n\nexport function shouldLog(entryLevel: LogLevel, minLevel: LogLevel): boolean {\n return logLevelSeverity[entryLevel] >= logLevelSeverity[minLevel];\n}\n\nfunction isLogLevel(value: string): value is LogLevel {\n return value in logLevelSeverity;\n}\n\nexport function parseLogLevel(value: string | undefined): LogLevel {\n const level = value?.trim();\n if (level && isLogLevel(level)) {\n return level;\n }\n return 'info';\n}\n\n/**\n * Custom JSON.stringify replacer that serializes Error objects properly.\n * Removes the config field from AxiosError to avoid logging sensitive headers.\n */\nfunction errorReplacer(data: unknown): unknown {\n if (data instanceof Error) {\n return {\n name: data.name,\n message: data.message,\n stack: data.stack,\n ...(data.cause !== undefined && { cause: data.cause }),\n };\n }\n\n return data;\n}\n\nexport function log(entry: LogEntry): void {\n const config = getBaseConfig();\n if (!shouldLog(entry.level, config.logLevel)) {\n return;\n }\n\n // we are removing any unnecessary fields that may also leak sensitive data\n entry.data = errorReplacer(entry.data);\n\n if (config.loggers.has('appLogger')) {\n const message = JSON.stringify(entry);\n if (config.transport === 'http') {\n // eslint-disable-next-line no-console -- console.log is intentional here since the transport is not stdio.\n console.log(message);\n } else {\n process.stderr.write(message + '\\n');\n }\n }\n if (config.loggers.has('fileLogger')) {\n getFileLogger()?.log(entry);\n }\n}\n", "export const loggerTypes = ['fileLogger', 'appLogger'] as const;\nexport type LoggerType = (typeof loggerTypes)[number];\nconst validLoggerTypes = new Set(loggerTypes);\n\nexport function parseLoggerTypes(value: string | undefined): Set<LoggerType> {\n if (!value) {\n return new Set<LoggerType>(['appLogger']);\n }\n return new Set(\n value\n .split(',')\n .map((s) => s.trim())\n .filter((s): s is LoggerType => validLoggerTypes.has(s as LoggerType)),\n );\n}\n", "const transports = ['stdio', 'http'] as const;\nexport type TransportName = (typeof transports)[number];\nexport function isTransport(transport: unknown): transport is TransportName {\n return !!transports.find((t) => t === transport);\n}\n", "export function getDirname(): string {\n if (typeof __dirname === 'string') {\n return __dirname;\n }\n\n throw new Error('__dirname is not set');\n}\n", "export const milliseconds = {\n fromSeconds: (seconds: number) => seconds * 1000,\n fromMinutes: (minutes: number) => minutes * 60 * 1000,\n fromHours: (hours: number) => hours * 60 * 60 * 1000,\n fromDays: (days: number) => days * 24 * 60 * 60 * 1000,\n fromWeeks: (weeks: number) => weeks * 7 * 24 * 60 * 60 * 1000,\n fromMonths: (months: number) => months * 30 * 24 * 60 * 60 * 1000,\n fromYears: (years: number) => years * 365.25 * 24 * 60 * 60 * 1000,\n};\n", "export function parseNumber(\n value: string | undefined,\n {\n defaultValue,\n minValue,\n maxValue,\n }: { defaultValue: number; minValue?: number; maxValue?: number } = {\n defaultValue: 0,\n minValue: Number.NEGATIVE_INFINITY,\n maxValue: Number.POSITIVE_INFINITY,\n },\n): number {\n if (!value) {\n return defaultValue;\n }\n\n const number = parseFloat(value);\n return isNaN(number) ||\n (minValue !== undefined && number < minValue) ||\n (maxValue !== undefined && number > maxValue)\n ? defaultValue\n : number;\n}\n", "import { z } from 'zod';\n\n/**\n * Telemetry provider interface for metrics collection.\n */\nexport interface TelemetryProvider {\n /**\n * Initialize the telemetry provider.\n */\n initialize(): void;\n\n /**\n * Record a custom metric with the given name and attributes.\n *\n * @param name - The metric name (e.g., 'apm_mcp_tool_calls')\n * @param value - The metric value (default: 1 for counters)\n * @param attributes - Dimensions/tags for the metric\n *\n * @example\n * ```typescript\n * telemetry.recordMetric('apm_mcp_tool_calls', 1, {\n * tool_name: 'list-pulse-metric-subscriptions',\n * });\n * ```\n */\n recordMetric(name: string, value: number, attributes: TelemetryAttributes): void;\n\n /**\n * Record a histogram observation (e.g., latency) with the given name and attributes.\n *\n * @param name - The metric name (e.g., 'http_server_request_duration')\n * @param value - The observed value (e.g., duration in milliseconds)\n * @param attributes - Dimensions/tags for the metric\n *\n * @example\n * ```typescript\n * telemetry.recordHistogram('apm_mcp_tool_duration', 142.5, {\n * tool_name: 'get-datasource-metadata',\n * success: true,\n * });\n * ```\n */\n recordHistogram(name: string, value: number, attributes: TelemetryAttributes): void;\n}\n\n/**\n * Schema for telemetry attributes.\n * Values can be strings, numbers, booleans, or undefined.\n */\nexport const telemetryAttributesSchema = z.record(\n z.string(),\n z.union([z.string(), z.number(), z.boolean(), z.undefined()]),\n);\nexport type TelemetryAttributes = z.infer<typeof telemetryAttributesSchema>;\n\n/**\n * Valid telemetry provider names\n */\nexport const telemetryProviderSchema = z.enum(['noop', 'custom']);\nexport type TelemetryProviderType = z.infer<typeof telemetryProviderSchema>;\n\n/**\n * Schema for noop telemetry config (no telemetry)\n */\nexport const noopTelemetryConfigSchema = z.object({\n provider: z.literal('noop'),\n});\n\n/**\n * Schema for custom telemetry provider config.\n * Requires 'module' field, allows additional provider-specific options.\n */\nexport const providerConfigSchema = z\n .object({\n module: z.string({ required_error: 'Custom provider requires \"module\" path' }),\n })\n .passthrough();\n\n/**\n * Schema for custom telemetry config\n *\n * @example\n * ```json\n * {\n * \"provider\": \"custom\",\n * \"providerConfig\": {\n * \"module\": \"./my-otel-provider.js\"\n * }\n * }\n * ```\n */\nexport const customTelemetryConfigSchema = z.object({\n provider: z.literal('custom'),\n providerConfig: providerConfigSchema,\n});\n\n/**\n * Combined telemetry config schema (discriminated union)\n */\nexport const telemetryConfigSchema = z.discriminatedUnion('provider', [\n noopTelemetryConfigSchema,\n customTelemetryConfigSchema,\n]);\n\nexport type TelemetryConfig = z.infer<typeof telemetryConfigSchema>;\n\n/**\n * Type guard for telemetry provider names\n */\nexport function isTelemetryProvider(provider: unknown): provider is TelemetryProviderType {\n return telemetryProviderSchema.safeParse(provider).success;\n}\n", "export default function invariant(condition: unknown, message?: string): asserts condition {\n if (!condition) {\n throw new Error(message ? message : 'Invariant Violation');\n }\n}\n", "/**\n * NoOp telemetry provider - does nothing.\n * This is the default provider when telemetry is disabled.\n *\n * Zero overhead implementation that can be safely used in production\n * when telemetry is not needed.\n */\n\nimport { TelemetryAttributes, TelemetryProvider } from './types.js';\n\nexport class NoOpTelemetryProvider implements TelemetryProvider {\n initialize(): void {\n // No-op\n }\n\n recordMetric(_name: string, _value: number, _attributes: TelemetryAttributes): void {\n // No-op\n }\n\n recordHistogram(_name: string, _value: number, _attributes: TelemetryAttributes): void {\n // No-op\n }\n}\n"],
5
+ "mappings": "qeAWA,IAAAA,GAAmB,sBCPnB,IAAAC,EAAwB,gBCHxB,IAAAC,EAAyC,cCDzC,IAAAC,EAAqB,gBCQrB,IAAIC,GAMG,IAAMC,EAAgB,IAA8BC,GCXpD,IAAMC,GAAmB,CAC9B,QACA,OACA,SACA,UACA,QACA,WACA,QACA,WACF,EAEaC,EAAmB,OAAO,YACrCD,GAAiB,IAAI,CAACE,EAAOC,IAAU,CAACD,EAAOC,CAAK,CAAC,CACvD,ECZO,SAASC,GAAUC,EAAsBC,EAA6B,CAC3E,OAAOC,EAAiBF,CAAU,GAAKE,EAAiBD,CAAQ,CAClE,CAEA,SAASE,GAAWC,EAAkC,CACpD,OAAOA,KAASF,CAClB,CAEO,SAASG,EAAcD,EAAqC,CACjE,IAAME,EAAQF,GAAO,KAAK,EAC1B,OAAIE,GAASH,GAAWG,CAAK,EACpBA,EAEF,MACT,CAMA,SAASC,GAAcC,EAAwB,CAC7C,OAAIA,aAAgB,MACX,CACL,KAAMA,EAAK,KACX,QAASA,EAAK,QACd,MAAOA,EAAK,MACZ,GAAIA,EAAK,QAAU,QAAa,CAAE,MAAOA,EAAK,KAAM,CACtD,EAGKA,CACT,CAEO,SAASC,EAAIC,EAAuB,CACzC,IAAMC,EAASC,EAAc,EAC7B,GAAKb,GAAUW,EAAM,MAAOC,EAAO,QAAQ,EAO3C,IAFAD,EAAM,KAAOH,GAAcG,EAAM,IAAI,EAEjCC,EAAO,QAAQ,IAAI,WAAW,EAAG,CACnC,IAAME,EAAU,KAAK,UAAUH,CAAK,EAChCC,EAAO,YAAc,OAEvB,QAAQ,IAAIE,CAAO,EAEnB,QAAQ,OAAO,MAAMA,EAAU;AAAA,CAAI,CAEvC,CACIF,EAAO,QAAQ,IAAI,YAAY,GACjCG,EAAc,GAAG,IAAIJ,CAAK,EAE9B,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kDAAkDL,CAAU,MAE/E,MAAIH,aAAiB,OAAS,SAAUA,GAASA,EAAM,OAAS,mBAC9DQ,GACE,2IAIFA,GAAgB,UAAUR,CAAK,GAG3B,IAAI,MAAMQ,CAAY,CAC9B,CACF,CD9KA,GAAAC,QAAO,OAAO,EAId,GAAI,CACFC,GAAoB,CACtB,OAASC,EAAO,CACd,QAAQ,KAAK,kCAAmCA,CAAK,CACvD",
6
+ "names": ["import_dotenv", "import_path", "import_fs", "import_path", "_fileLogger", "getFileLogger", "_fileLogger", "orderedLogLevels", "logLevelSeverity", "level", "index", "shouldLog", "entryLevel", "minLevel", "logLevelSeverity", "isLogLevel", "value", "parseLogLevel", "level", "errorReplacer", "data", "log", "entry", "config", "getBaseConfig", "message", "getFileLogger", "loggerTypes", "validLoggerTypes", "parseLoggerTypes", "value", "s", "transports", "isTransport", "transport", "getDirname", "milliseconds", "seconds", "minutes", "hours", "days", "weeks", "months", "years", "parseNumber", "value", "defaultValue", "minValue", "maxValue", "number", "__dirname", "getDirname", "BaseConfig", "cleansedVars", "removeClaudeMcpBundleUserConfigTemplates", "transport", "defaultNotificationLevel", "logLevel", "logging", "fileLoggerDirectory", "disableLogMasking", "maxRequestTimeoutMs", "notificationPayloadMaxBytes", "isTransport", "parseLogLevel", "parseLoggerTypes", "parseNumber", "milliseconds", "envVars", "acc", "key", "value", "getBaseConfig", "import_zod", "telemetryAttributesSchema", "telemetryProviderSchema", "noopTelemetryConfigSchema", "providerConfigSchema", "customTelemetryConfigSchema", "telemetryConfigSchema", "isTelemetryProvider", "provider", "invariant", "condition", "message", "authTypes", "isAuthType", "auth", "type", "Config", "BaseConfig", "cleansedVars", "removeClaudeMcpBundleUserConfigTemplates", "server", "siteName", "transport", "sslKey", "sslCert", "httpPortEnvVarName", "corsOriginConfig", "patName", "patValue", "jwtSubClaim", "clientId", "secretId", "secretValue", "uatTenantId", "uatIssuer", "uatUsernameClaimName", "uatUsernameClaim", "uatPrivateKey", "uatPrivateKeyPath", "uatKeyId", "jwtAdditionalPayload", "datasourceCredentials", "disableSessionManagement", "tableauServerVersionCheckIntervalInHours", "passthroughAuthUserSessionCheckIntervalInMinutes", "mcpSiteSettingsCheckIntervalInMinutes", "enableMcpSiteSettings", "allowSitesToConfigureRequestOverrides", "enablePassthroughAuth", "disableOauth", "oauthEmbeddedAuthzServer", "oauthIssuer", "oauthLockSite", "oauthJwePrivateKey", "oauthJwePrivateKeyPath", "oauthJwePrivateKeyPassphrase", "oauthResourceUri", "oauthGlobalResourceUri", "redirectUri", "oauthClientIdSecretPairs", "dnsServers", "advertiseApiScopes", "authzCodeTimeoutMs", "accessTokenTimeoutMs", "refreshTokenTimeoutMs", "oauthDisableScopes", "telemetryProvider", "telemetryProviderConfig", "latencyMetricName", "productTelemetryEndpoint", "productTelemetryEnabled", "isHyperforce", "breakGlassDisableGlobally", "adminToolsEnabled", "jwtUsername", "parseNumber", "getCorsOriginConfig", "disableOauthOverride", "enforceScopes", "embeddedAuthzServer", "ip", "milliseconds", "acc", "curr", "secret", "isTelemetryProvider", "providerConfigSchema", "isTransport", "invariant", "validateServer", "prefix", "_", "error", "errorMessage", "origin", "getConfig", "NoOpTelemetryProvider", "_name", "_value", "_attributes", "getInstanceMethods", "cls", "name", "isRecord", "obj", "validateTelemetryProvider", "provider", "missingMethods", "NoOpTelemetryProvider", "method", "initializeTelemetry", "config", "getConfig", "provider", "loadCustomProvider", "NoOpTelemetryProvider", "error", "log", "fallbackProvider", "modulePath", "resolvedPath", "module", "ProviderClass", "validateTelemetryProvider", "errorMessage", "dotenv", "initializeTelemetry", "error"]
7
7
  }
@@ -70,7 +70,7 @@ Boolean requesting whether a visible border and background is provided by the ho
70
70
  - omitted: host decides border`)});m({method:u("ui/request-display-mode"),params:m({mode:Re.describe("The display mode being requested.")})});var _f=m({mode:Re.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),bf=T([u("model"),u("app")]).describe("Tool visibility scope - who can access the tool.");m({resourceUri:l().optional(),visibility:I(bf).optional().describe(`Who can access this tool. Default: ["model", "app"]
71
71
  - "model": Tool visible to and callable by the agent
72
72
  - "app": Tool callable by the app from this server only`),csp:pe().optional(),permissions:pe().optional()});m({mimeTypes:I(l()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});m({method:u("ui/download-file"),params:m({contents:I(T([Nc,Tc])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})});m({method:u("ui/message"),params:m({role:u("user").describe('Message role, currently only "user" is supported.'),content:I(rt).describe("Message content blocks (text, image, etc.).")})});m({method:u("ui/notifications/sandbox-resource-ready"),params:m({html:l().describe("HTML content to load into the inner iframe."),sandbox:l().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:Ri.optional().describe("CSP configuration from resource metadata."),permissions:Zi.optional().describe("Sandbox permissions from resource metadata.")})});var $f=m({method:u("ui/notifications/tool-result"),params:$n.describe("Standard MCP tool execution result.")}),Rc=m({toolInfo:m({id:Qe.optional().describe("JSON-RPC id of the tools/call request."),tool:Di.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:rf.optional().describe("Current color theme preference."),styles:ff.optional().describe("Style configuration for theming the app."),displayMode:Re.optional().describe("How the UI is currently displayed."),availableDisplayModes:I(Re).optional().describe("Display modes the host supports."),containerDimensions:T([m({height:x().describe("Fixed container height in pixels.")}),m({maxHeight:T([x(),Ue()]).optional().describe("Maximum container height in pixels.")})]).and(T([m({width:x().describe("Fixed container width in pixels.")}),m({maxWidth:T([x(),Ue()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
73
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:l().optional().describe("User's language and region preference in BCP 47 format."),timeZone:l().optional().describe("User's timezone in IANA format."),userAgent:l().optional().describe("Host application identifier."),platform:T([u("web"),u("desktop"),u("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:m({touch:Z().optional().describe("Whether the device supports touch input."),hover:Z().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:m({top:x().describe("Top safe area inset in pixels."),right:x().describe("Right safe area inset in pixels."),bottom:x().describe("Bottom safe area inset in pixels."),left:x().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),yf=m({method:u("ui/notifications/host-context-changed"),params:Rc.describe("Partial context update containing only changed fields.")});m({method:u("ui/update-model-context"),params:m({content:I(rt).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:U(l(),C().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});m({method:u("ui/initialize"),params:m({appInfo:_n.describe("App identification (name and version)."),appCapabilities:vf.describe("Features and capabilities this app provides."),protocolVersion:l().describe("Protocol version this app supports.")})});var kf=m({protocolVersion:l().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:_n.describe("Host application identification and version."),hostCapabilities:gf.describe("Features and capabilities provided by the host."),hostContext:Rc.describe("Rich context about the host environment.")}).passthrough(),Sf={target:"draft-2020-12"};async function uo(t,n){let r=t["~standard"];if(r.jsonSchema)return r.jsonSchema[n](Sf);if(r.vendor==="zod"){let{z:o}=await Ac(()=>Promise.resolve().then(()=>lm),void 0,import.meta.url);return o.toJSONSchema(t,{io:n})}throw Error(`Schema (vendor: ${r.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function co(t,n,r=""){let o=await t["~standard"].validate(n);if(o.issues){let e=o.issues.map(i=>{let a=i.path?.map(s=>typeof s=="object"?s.key:s).join(".");return a?`${a}: ${i.message}`:i.message}).join("; ");throw Error(r+e)}return o.value}class Ci extends Xp{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(n){if(this._initializedSent)return;let r=`[ext-apps] App.${n}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(r);console.warn(`${r}. This will throw in a future release.`)}eventSchemas={toolinput:lf,toolinputpartial:df,toolresult:$f,toolcancelled:mf,hostcontextchanged:yf};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(n){if(!Ci.ONE_SHOT_EVENTS.has(n)||this._everHadListener.has(n)||(this._everHadListener.add(n),!this._initializedSent))return;let r=`[ext-apps] "${String(n)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(r);console.warn(r)}setEventHandler(n,r){r&&this._assertHandlerTiming(n),super.setEventHandler(n,r)}addEventListener(n,r){this._assertHandlerTiming(n),super.addEventListener(n,r)}onEventDispatch(n,r){n==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...r})}constructor(n,r={},o={autoResize:!0}){super(o),this._appInfo=n,this._capabilities=r,this.options=o,o.allowUnsafeEval||J({jitless:!0}),this.setRequestHandler(bn,e=>(console.log("Received ping:",e.params),{})),this.setEventHandler("hostcontextchanged",void 0)}registerCapabilities(n){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._capabilities=Yp(this._capabilities,n)}registerTool(n,r,o){if(this._registeredTools[n])throw Error(`Tool ${n} is already registered`);let e=this,i=()=>{e._initializedSent&&e._capabilities.tools?.listChanged&&e.sendToolListChanged()},a=r.inputSchema!==void 0,s={title:r.title,description:r.description,inputSchema:r.inputSchema,outputSchema:r.outputSchema,annotations:r.annotations,_meta:r._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(p){Object.assign(this,p),i()},remove(){e._registeredTools[n]===s&&(delete e._registeredTools[n],i())},handler:async(p,v)=>{if(!s.enabled)throw Error(`Tool ${n} is disabled`);let h;if(a){let d=s.inputSchema,b=d?await co(d,p??{},`Invalid input for tool ${n}: `):p??{};h=await o(b,v)}else h=await o(v);return s.outputSchema&&!h.isError&&(h.structuredContent=await co(s.outputSchema,h.structuredContent,`Invalid output for tool ${n}: `)),h}};return this._registeredTools[n]=s,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),s}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(n,r)=>{let o=this._registeredTools[n.name];if(!o)throw Error(`Tool ${n.name} not found`);return o.handler(n.arguments,r)},this.onlisttools=async(n,r)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([o,e])=>e.enabled).map(async([o,e])=>{let i={name:o,title:e.title,description:e.description,inputSchema:e.inputSchema?await uo(e.inputSchema,"input"):{type:"object",properties:{}}};return e.outputSchema&&(i.outputSchema=await uo(e.outputSchema,"output")),e.annotations&&(i.annotations=e.annotations),e._meta&&(i._meta=e._meta),i}))}))}async sendToolListChanged(n={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:n})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(n){this.setEventHandler("toolinput",n)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(n){this.setEventHandler("toolinputpartial",n)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(n){this.setEventHandler("toolresult",n)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(n){this.setEventHandler("toolcancelled",n)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(n){this.setEventHandler("hostcontextchanged",n)}_onteardown;get onteardown(){return this._onteardown}set onteardown(n){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,n),this._onteardown=n,this.replaceRequestHandler(hf,(r,o)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(r.params,o)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(n){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,n),this._oncalltool=n,this.replaceRequestHandler(Pc,(r,o)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(r.params,o)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(n){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,n),this._onlisttools=n,this.replaceRequestHandler(Oc,(r,o)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(r.params,o)})}assertCapabilityForMethod(n){switch(n){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${n})`);break}}assertRequestHandlerCapability(n){switch(n){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${n})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${n} registered`)}}assertNotificationCapability(n){}assertTaskCapability(n){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(n){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(n,r){if(this._assertInitialized("callServerTool"),typeof n=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${n}"). Did you mean: callServerTool({ name: "${n}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:n},$n,{onprogress:()=>{},resetTimeoutOnProgress:!0,...r})}async readServerResource(n,r){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:n},jc,r)}async listServerResources(n,r){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:n},xc,r)}async createSamplingMessage(n,r){this._assertInitialized("createSamplingMessage");let o=n.tools?Dc:Ec;return await this.request({method:"sampling/createMessage",params:n},o,r)}sendMessage(n,r){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:n},cf,r)}sendLog(n){return this.notification({method:"notifications/message",params:n})}updateModelContext(n,r){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:n},$i,r)}openLink(n,r){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:n},sf,r)}sendOpenLink=this.openLink;downloadFile(n,r){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:n},uf,r)}requestTeardown(n={}){return this.notification({method:"ui/notifications/request-teardown",params:n})}requestDisplayMode(n,r){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:n},_f,r)}sendSizeChanged(n){return this.notification({method:"ui/notifications/size-changed",params:n})}setupSizeChangedNotifications(){let n=!1,r=0,o=0,e=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1;let a=document.documentElement,s=a.style.height;a.style.height="max-content";let p=Math.ceil(a.getBoundingClientRect().height);a.style.height=s;let v=Math.ceil(window.innerWidth);(v!==r||p!==o)&&(r=v,o=p,this.sendSizeChanged({width:v,height:p}))}))};e();let i=new ResizeObserver(e);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(n=new nf(window.parent,window.parent),r){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1,await super.connect(n);try{let o=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:ef}},kf,r);if(o===void 0)throw Error(`Server sent invalid initialize result: ${o}`);this._hostCapabilities=o.hostCapabilities,this._hostInfo=o.hostInfo,this._hostContext=o.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(o){throw this.close(),o}}}const wf="2.7.4",If={version:wf},zf=new Ci({name:"Tableau MCP App",version:If.version});zf.connect().then(()=>{console.info("Tableau MCP App connected!")});</script>
73
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:l().optional().describe("User's language and region preference in BCP 47 format."),timeZone:l().optional().describe("User's timezone in IANA format."),userAgent:l().optional().describe("Host application identifier."),platform:T([u("web"),u("desktop"),u("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:m({touch:Z().optional().describe("Whether the device supports touch input."),hover:Z().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:m({top:x().describe("Top safe area inset in pixels."),right:x().describe("Right safe area inset in pixels."),bottom:x().describe("Bottom safe area inset in pixels."),left:x().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),yf=m({method:u("ui/notifications/host-context-changed"),params:Rc.describe("Partial context update containing only changed fields.")});m({method:u("ui/update-model-context"),params:m({content:I(rt).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:U(l(),C().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})});m({method:u("ui/initialize"),params:m({appInfo:_n.describe("App identification (name and version)."),appCapabilities:vf.describe("Features and capabilities this app provides."),protocolVersion:l().describe("Protocol version this app supports.")})});var kf=m({protocolVersion:l().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:_n.describe("Host application identification and version."),hostCapabilities:gf.describe("Features and capabilities provided by the host."),hostContext:Rc.describe("Rich context about the host environment.")}).passthrough(),Sf={target:"draft-2020-12"};async function uo(t,n){let r=t["~standard"];if(r.jsonSchema)return r.jsonSchema[n](Sf);if(r.vendor==="zod"){let{z:o}=await Ac(()=>Promise.resolve().then(()=>lm),void 0,import.meta.url);return o.toJSONSchema(t,{io:n})}throw Error(`Schema (vendor: ${r.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function co(t,n,r=""){let o=await t["~standard"].validate(n);if(o.issues){let e=o.issues.map(i=>{let a=i.path?.map(s=>typeof s=="object"?s.key:s).join(".");return a?`${a}: ${i.message}`:i.message}).join("; ");throw Error(r+e)}return o.value}class Ci extends Xp{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_assertInitialized(n){if(this._initializedSent)return;let r=`[ext-apps] App.${n}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(r);console.warn(`${r}. This will throw in a future release.`)}eventSchemas={toolinput:lf,toolinputpartial:df,toolresult:$f,toolcancelled:mf,hostcontextchanged:yf};static ONE_SHOT_EVENTS=new Set(["toolinput","toolinputpartial","toolresult","toolcancelled"]);_everHadListener=new Set;_assertHandlerTiming(n){if(!Ci.ONE_SHOT_EVENTS.has(n)||this._everHadListener.has(n)||(this._everHadListener.add(n),!this._initializedSent))return;let r=`[ext-apps] "${String(n)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(r);console.warn(r)}setEventHandler(n,r){r&&this._assertHandlerTiming(n),super.setEventHandler(n,r)}addEventListener(n,r){this._assertHandlerTiming(n),super.addEventListener(n,r)}onEventDispatch(n,r){n==="hostcontextchanged"&&(this._hostContext={...this._hostContext,...r})}constructor(n,r={},o={autoResize:!0}){super(o),this._appInfo=n,this._capabilities=r,this.options=o,o.allowUnsafeEval||J({jitless:!0}),this.setRequestHandler(bn,e=>(console.log("Received ping:",e.params),{})),this.setEventHandler("hostcontextchanged",void 0)}registerCapabilities(n){if(this.transport)throw Error("Cannot register capabilities after transport is established");this._capabilities=Yp(this._capabilities,n)}registerTool(n,r,o){if(this._registeredTools[n])throw Error(`Tool ${n} is already registered`);let e=this,i=()=>{e._initializedSent&&e._capabilities.tools?.listChanged&&e.sendToolListChanged()},a=r.inputSchema!==void 0,s={title:r.title,description:r.description,inputSchema:r.inputSchema,outputSchema:r.outputSchema,annotations:r.annotations,_meta:r._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(p){Object.assign(this,p),i()},remove(){e._registeredTools[n]===s&&(delete e._registeredTools[n],i())},handler:async(p,v)=>{if(!s.enabled)throw Error(`Tool ${n} is disabled`);let h;if(a){let d=s.inputSchema,b=d?await co(d,p??{},`Invalid input for tool ${n}: `):p??{};h=await o(b,v)}else h=await o(v);return s.outputSchema&&!h.isError&&(h.structuredContent=await co(s.outputSchema,h.structuredContent,`Invalid output for tool ${n}: `)),h}};return this._registeredTools[n]=s,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),s}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(n,r)=>{let o=this._registeredTools[n.name];if(!o)throw Error(`Tool ${n.name} not found`);return o.handler(n.arguments,r)},this.onlisttools=async(n,r)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([o,e])=>e.enabled).map(async([o,e])=>{let i={name:o,title:e.title,description:e.description,inputSchema:e.inputSchema?await uo(e.inputSchema,"input"):{type:"object",properties:{}}};return e.outputSchema&&(i.outputSchema=await uo(e.outputSchema,"output")),e.annotations&&(i.annotations=e.annotations),e._meta&&(i._meta=e._meta),i}))}))}async sendToolListChanged(n={}){this._assertInitialized("sendToolListChanged"),await this.notification({method:"notifications/tools/list_changed",params:n})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler("toolinput")}set ontoolinput(n){this.setEventHandler("toolinput",n)}get ontoolinputpartial(){return this.getEventHandler("toolinputpartial")}set ontoolinputpartial(n){this.setEventHandler("toolinputpartial",n)}get ontoolresult(){return this.getEventHandler("toolresult")}set ontoolresult(n){this.setEventHandler("toolresult",n)}get ontoolcancelled(){return this.getEventHandler("toolcancelled")}set ontoolcancelled(n){this.setEventHandler("toolcancelled",n)}get onhostcontextchanged(){return this.getEventHandler("hostcontextchanged")}set onhostcontextchanged(n){this.setEventHandler("hostcontextchanged",n)}_onteardown;get onteardown(){return this._onteardown}set onteardown(n){this.warnIfRequestHandlerReplaced("onteardown",this._onteardown,n),this._onteardown=n,this.replaceRequestHandler(hf,(r,o)=>{if(!this._onteardown)throw Error("No onteardown handler set");return this._onteardown(r.params,o)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(n){this.warnIfRequestHandlerReplaced("oncalltool",this._oncalltool,n),this._oncalltool=n,this.replaceRequestHandler(Pc,(r,o)=>{if(!this._oncalltool)throw Error("No oncalltool handler set");return this._oncalltool(r.params,o)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(n){this.warnIfRequestHandlerReplaced("onlisttools",this._onlisttools,n),this._onlisttools=n,this.replaceRequestHandler(Oc,(r,o)=>{if(!this._onlisttools)throw Error("No onlisttools handler set");return this._onlisttools(r.params,o)})}assertCapabilityForMethod(n){switch(n){case"sampling/createMessage":if(!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${n})`);break}}assertRequestHandlerCapability(n){switch(n){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${n})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${n} registered`)}}assertNotificationCapability(n){}assertTaskCapability(n){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability(n){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool(n,r){if(this._assertInitialized("callServerTool"),typeof n=="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${n}"). Did you mean: callServerTool({ name: "${n}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:n},$n,{onprogress:()=>{},resetTimeoutOnProgress:!0,...r})}async readServerResource(n,r){return this._assertInitialized("readServerResource"),await this.request({method:"resources/read",params:n},jc,r)}async listServerResources(n,r){return this._assertInitialized("listServerResources"),await this.request({method:"resources/list",params:n},xc,r)}async createSamplingMessage(n,r){this._assertInitialized("createSamplingMessage");let o=n.tools?Dc:Ec;return await this.request({method:"sampling/createMessage",params:n},o,r)}sendMessage(n,r){return this._assertInitialized("sendMessage"),this.request({method:"ui/message",params:n},cf,r)}sendLog(n){return this.notification({method:"notifications/message",params:n})}updateModelContext(n,r){return this._assertInitialized("updateModelContext"),this.request({method:"ui/update-model-context",params:n},$i,r)}openLink(n,r){return this._assertInitialized("openLink"),this.request({method:"ui/open-link",params:n},sf,r)}sendOpenLink=this.openLink;downloadFile(n,r){return this._assertInitialized("downloadFile"),this.request({method:"ui/download-file",params:n},uf,r)}requestTeardown(n={}){return this.notification({method:"ui/notifications/request-teardown",params:n})}requestDisplayMode(n,r){return this._assertInitialized("requestDisplayMode"),this.request({method:"ui/request-display-mode",params:n},_f,r)}sendSizeChanged(n){return this.notification({method:"ui/notifications/size-changed",params:n})}setupSizeChangedNotifications(){let n=!1,r=0,o=0,e=()=>{n||(n=!0,requestAnimationFrame(()=>{n=!1;let a=document.documentElement,s=a.style.height;a.style.height="max-content";let p=Math.ceil(a.getBoundingClientRect().height);a.style.height=s;let v=Math.ceil(window.innerWidth);(v!==r||p!==o)&&(r=v,o=p,this.sendSizeChanged({width:v,height:p}))}))};e();let i=new ResizeObserver(e);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(n=new nf(window.parent,window.parent),r){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");this._initializedSent=!1,await super.connect(n);try{let o=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:ef}},kf,r);if(o===void 0)throw Error(`Server sent invalid initialize result: ${o}`);this._hostCapabilities=o.hostCapabilities,this._hostInfo=o.hostInfo,this._hostContext=o.hostContext,await this.notification({method:"ui/notifications/initialized"}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(o){throw this.close(),o}}}const wf="2.9.3",If={version:wf},zf=new Ci({name:"Tableau MCP App",version:If.version});zf.connect().then(()=>{console.info("Tableau MCP App connected!")});</script>
74
74
  <style rel="stylesheet" crossorigin>*{box-sizing:border-box}body{font-family:system-ui,-apple-system,sans-serif;margin:0;padding:0}.main{width:100%;max-width:425px;display:flex;align-items:center;justify-content:center;min-height:300px}.hero{text-align:center;padding:2rem}.emoji{font-size:4rem;margin-bottom:1rem;animation:bounce 2s ease-in-out infinite}.hero h1{font-size:1.75rem;font-weight:700;color:#1f2937;margin:0 0 .5rem}.hero p{color:#6b7280;margin:0 0 1.5rem}.sparkle{font-size:2rem;animation:rotate 4s linear infinite;display:inline-block}@keyframes bounce{0%,to{transform:translateY(0)}50%{transform:translateY(-10px)}}@keyframes rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}</style>
75
75
  </head>
76
76
  <body>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tableau/mcp-server",
3
3
  "description": "Helping agents see and understand data.",
4
- "version": "2.7.4",
4
+ "version": "2.9.3",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/tableau/tableau-mcp.git"
@@ -58,6 +58,7 @@
58
58
  "dependencies": {
59
59
  "@modelcontextprotocol/ext-apps": "^1.7.2",
60
60
  "@modelcontextprotocol/sdk": "^1.26.0",
61
+ "@xmldom/xmldom": "^0.9.10",
61
62
  "@zodios/core": "^10.9.6",
62
63
  "cookie-parser": "^1.4.7",
63
64
  "cors": "^2.8.5",
@@ -67,6 +68,7 @@
67
68
  "jose": "^6.0.12",
68
69
  "ssrfcheck": "^1.2.0",
69
70
  "ts-results-es": "^5.0.1",
71
+ "xpath": "^0.0.34",
70
72
  "zod": "^3.24.3",
71
73
  "zod-validation-error": "^4.0.1"
72
74
  },