@superglue/cli 1.1.273 → 1.1.274

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,7 +1,7 @@
1
1
  {
2
2
  "name": "superglue",
3
3
  "description": "Build, test, and manage superglue tools via the sg CLI. Use when working with superglue tools, systems, APIs, SDKs, or the sg command.",
4
- "version": "1.1.273",
4
+ "version": "1.1.274",
5
5
  "author": {
6
6
  "name": "superglue",
7
7
  "email": "hello@superglue.cloud"
package/dist/cli.js CHANGED
@@ -925,7 +925,7 @@ label[data-sg-choice]:has(input:focus-visible){box-shadow:0 0 0 1px var(--sg-rin
925
925
  @media print{:where(main){max-width:none;padding:0}[data-sg-deck]{display:block;padding:0}[data-sg-slide]{zoom:1;box-shadow:none}}
926
926
  @media (max-width:640px){.sg-mapping{grid-template-columns:1fr}.sg-mapping>i{display:none}}
927
927
  @media print{.sg-card,.sg-kpi{break-inside:avoid;box-shadow:none}h1,h2,h3,h4,h5,h6{break-after:avoid}}
928
- `.trim();var Xye=`<style data-sg-base>${Mu.ARTIFACT_BASE_CSS}</style>`;function eEe(t){return t.includes("<style data-sg-base>")?t:(0,Kye.injectHeadStyle)(t,Xye,"start")}});var UF=I(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.DeploymentConfigError=void 0;Ip.buildDeploymentConfig=cEe;var tEe=["pro","team","enterprise"],By={pro:"prod_UjB46ulzKsQ1Ef",team:"prod_UiMeaL02tN4BMg",enterprise:"prod_UapuUIQQuluzUV"},rEe=/claude-opus-5-5(?![0-9])/i;function S0(t){return rEe.test(t)?{effort:"medium"}:{}}var vy=["openai","anthropic","gemini","azure","bedrock","vertex"],nEe=["tavily","model_provider","searxng","disabled"],iEe=["openai","anthropic","azure"],oEe=["cloud","enterprise"],sEe=["aws","minio","azure"],aEe=/^(?=.{3,63}$)[a-z0-9]+(-[a-z0-9]+)*$/,xF=["email_password","google","github","okta"],w0=class{constructor(e){this.raw=e,this.issues=[]}build(){let e=this.requiredPort("API_PORT",3002,"runtime.apiPort"),r=this.requiredPort("WEB_PORT",3001,"runtime.webPort"),n=this.requiredUrl("PUBLIC_API_URL",`http://localhost:${e}`,"runtime.publicApiUrl"),i=this.url("INTERNAL_API_URL",n,"runtime.internalApiUrl"),o=this.requiredUrl("PUBLIC_APP_URL","https://app.superglue.cloud","runtime.publicAppUrl"),s=this.url("INTERNAL_APP_URL",o,"runtime.internalAppUrl"),a=this.deploymentMode(),c=this.requiredBoolean("BLOCK_LOCAL_REQUESTS",!1,"security.blockLocalRequests"),l=this.llm(this.choice("PRIMARY_LLM_PROVIDER",vy,"openai","llm.primary.provider"),this.required("PRIMARY_LLM_MODEL","llm.primary.model"),"llm.primary"),u=this.llmFallbacks(),d=this.llm(this.choice("SUMMARIZE_LLM_PROVIDER",vy,"openai","llm.summarize.provider"),this.required("SUMMARIZE_LLM_MODEL","llm.summarize.model"),"llm.summarize"),A={deployment:{mode:a,orgConcurrencyLimits:a==="enterprise"?"disabled":"tier_config"},runtime:{apiPort:e,webPort:r,publicApiUrl:n,internalApiUrl:i,publicAppUrl:o,internalAppUrl:s,scheduler:this.scheduler()},website:{contactFormToEmail:this.optional("WEBSITE_CONTACT_FORM_TO_EMAIL")??null},security:{jwtSecret:this.required("JWT_AUTH_SECRET","security.jwtSecret"),internalApiToken:this.required("INTERNAL_API_TOKEN","security.internalApiToken"),credentialsEncryptionKey:this.required("MASTER_ENCRYPTION_KEY","security.credentialsEncryptionKey"),blockLocalRequests:c,trustProxyHops:this.nonNegativeInteger("TRUST_PROXY_HOPS",1,"security.trustProxyHops")},storage:{postgres:{host:this.required("POSTGRES_HOST","storage.postgres.host"),port:this.requiredPort("POSTGRES_PORT",5432,"storage.postgres.port"),username:this.required("POSTGRES_USERNAME","storage.postgres.username"),password:this.required("POSTGRES_PASSWORD","storage.postgres.password"),database:this.required("POSTGRES_DB","storage.postgres.database"),ssl:this.requiredBoolean("POSTGRES_SSL",!0,"storage.postgres.ssl")},objectStorage:this.objectStorage()},llm:{primary:l,primaryFallbacks:u,summarize:d},externalProviders:{posthog:this.posthog(),langfuse:this.langfuse(),resend:this.resend(),loops:this.loops(),teamsBot:this.teamsBot(),outlookActionableMessages:this.outlookActionableMessages(),webSearch:this.webSearch(l.provider,u)},billing:this.billing(a),bundles:this.bundles(),features:{briefings:this.boolean("BRIEFINGS_ENABLED",!1,"features.briefings")},auth:this.auth()};if(this.issues.length>0)throw new Qy(this.issues);return A}optional(e){let r=this.raw[e]?.trim();return r||void 0}required(e,r){let n=this.optional(e);return n||(this.issues.push({path:r,message:`${e} is required.`}),"")}requiredOptional(e,r){let n=this.optional(e);return n||this.issues.push({path:r,message:`${e} is required.`}),n}boolean(e,r,n){let i=this.optional(e);return i?i==="true"?!0:i==="false"?!1:(this.issues.push({path:n,message:`${e} must be "true" or "false".`}),r):r}requiredBoolean(e,r,n){let i=this.requiredOptional(e,n);return i?i==="true"?!0:i==="false"?!1:(this.issues.push({path:n,message:`${e} must be "true" or "false".`}),r):r}port(e,r,n){let i=this.optional(e);if(!i)return r;let o=Number(i);return!Number.isInteger(o)||o<1||o>65535?(this.issues.push({path:n,message:`${e} must be a TCP port between 1 and 65535.`}),r):o}nonNegativeInteger(e,r,n){let i=this.optional(e);if(!i)return r;let o=Number(i);return!Number.isInteger(o)||o<0?(this.issues.push({path:n,message:`${e} must be a non-negative integer.`}),r):o}requiredPort(e,r,n){return this.requiredOptional(e,n)?this.port(e,r,n):r}url(e,r,n){return this.validUrl(this.optional(e)||r,e,n)??r}validUrl(e,r,n){try{return new URL(e).toString().replace(/\/$/,"")}catch{this.issues.push({path:n,message:`${r} must be a valid URL.`});return}}requiredUrl(e,r,n){return this.requiredOptional(e,n)?this.url(e,r,n):r}choice(e,r,n,i){let o=this.requiredOptional(e,i)?.toLowerCase();return o?r.includes(o)?o:(this.issues.push({path:i,message:`${e} must be one of: ${r.join(", ")}.`}),n):n}listChoice(e,r,n){let i=this.requiredOptional(e,n);if(!i)return[];let o=[],s=new Set;for(let a of i.split(",")){let c=a.trim().toLowerCase();if(!(!c||s.has(c))){if(s.add(c),r.includes(c)){o.push(c);continue}this.issues.push({path:n,message:`${e} contains unsupported value "${c}". Use one of: ${r.join(", ")}.`})}}return o.length===0&&this.issues.push({path:n,message:`${e} must include at least one provider.`}),o}list(e){return(this.optional(e)??"").split(",").map(r=>r.trim()).filter(Boolean)}deploymentMode(){return this.choice("DEPLOYMENT_MODE",oEe,"cloud","deployment.mode")}scheduler(){return this.requiredBoolean("START_SCHEDULER_SERVER",!1,"runtime.scheduler.mode")?{mode:"in_process"}:{mode:"disabled"}}objectStorage(){let e=this.choice("S3_PROVIDER",sEe,"aws","storage.objectStorage.provider");if(e==="azure")return this.azureObjectStorage();if(e==="minio")return{provider:"minio",endpoint:this.required("S3_ENDPOINT","storage.objectStorage.endpoint"),publicEndpoint:this.optional("S3_PUBLIC_ENDPOINT")??null,bucketName:this.required("MINIO_BUCKET_NAME","storage.objectStorage.bucketName"),bucketPrefix:this.optional("MINIO_BUCKET_PREFIX")?this.bucketPrefix("MINIO_BUCKET_PREFIX"):this.bucketPrefix("AWS_BUCKET_PREFIX"),accessKeyId:this.required("MINIO_ROOT_USER","storage.objectStorage.accessKeyId"),secretAccessKey:this.required("MINIO_ROOT_PASSWORD","storage.objectStorage.secretAccessKey")};let r=this.optional("AWS_S3_ACCESS_KEY_ID"),n=this.optional("AWS_S3_SECRET_ACCESS_KEY");return(r&&!n||!r&&n)&&this.issues.push({path:"storage.objectStorage.credentials",message:"AWS_S3_ACCESS_KEY_ID and AWS_S3_SECRET_ACCESS_KEY must be set together."}),{provider:"aws",region:this.required("AWS_S3_REGION","storage.objectStorage.region"),bucketName:this.required("AWS_BUCKET_NAME","storage.objectStorage.bucketName"),bucketPrefix:this.bucketPrefix("AWS_BUCKET_PREFIX"),...r&&n?{accessKeyId:r,secretAccessKey:n,...this.optional("AWS_S3_SESSION_TOKEN")&&{sessionToken:this.optional("AWS_S3_SESSION_TOKEN")}}:{}}}azureObjectStorage(){let e=this.required("AZURE_STORAGE_CONTAINER_NAME","storage.objectStorage.containerName");e&&!aEe.test(e)&&this.issues.push({path:"storage.objectStorage.containerName",message:"AZURE_STORAGE_CONTAINER_NAME must be 3-63 lowercase letters, numbers and single hyphens."});let r=this.bucketPrefix("AZURE_STORAGE_PREFIX"),n=this.optional("AZURE_STORAGE_MANAGED_IDENTITY_CLIENT_ID"),i=this.optional("AZURE_STORAGE_CONNECTION_STRING");if(i){let a=["AZURE_STORAGE_ACCOUNT_NAME","AZURE_STORAGE_ACCOUNT_KEY","AZURE_STORAGE_BLOB_ENDPOINT","AZURE_STORAGE_MANAGED_IDENTITY_CLIENT_ID"].filter(p=>this.optional(p));a.length>0&&this.issues.push({path:"storage.objectStorage.credential",message:`AZURE_STORAGE_CONNECTION_STRING cannot be combined with ${a.join(", ")}.`});let c=new Map;for(let p of i.split(";")){let f=p.indexOf("=");f>0&&c.set(p.slice(0,f).trim(),p.slice(f+1).trim())}let l=c.get("AccountName")??"",u=c.get("AccountKey")??"";(!l||!u)&&this.issues.push({path:"storage.objectStorage.credential",message:"AZURE_STORAGE_CONNECTION_STRING must contain AccountName and AccountKey."});let d=c.get("DefaultEndpointsProtocol")??"https",A=c.get("EndpointSuffix")??"core.windows.net";return{provider:"azure",accountName:l,blobEndpoint:this.validUrl(c.get("BlobEndpoint")??`${d}://${l}.blob.${A}`,"AZURE_STORAGE_CONNECTION_STRING BlobEndpoint","storage.objectStorage.blobEndpoint")??"",containerName:e,bucketPrefix:r,credential:{type:"shared_key",accountKey:u}}}let o=this.required("AZURE_STORAGE_ACCOUNT_NAME","storage.objectStorage.accountName"),s=this.optional("AZURE_STORAGE_ACCOUNT_KEY");return s&&n&&this.issues.push({path:"storage.objectStorage.credential",message:"AZURE_STORAGE_MANAGED_IDENTITY_CLIENT_ID cannot be combined with AZURE_STORAGE_ACCOUNT_KEY."}),{provider:"azure",accountName:o,blobEndpoint:this.url("AZURE_STORAGE_BLOB_ENDPOINT",`https://${o}.blob.core.windows.net`,"storage.objectStorage.blobEndpoint"),containerName:e,bucketPrefix:r,credential:s?{type:"shared_key",accountKey:s}:{type:"token",...n&&{managedIdentityClientId:n}}}}bucketPrefix(e){let r=this.optional(e)?.replace(/^\/+|\/+$/g,"");if(!r)return"";let n=r.split("/");return r.includes("\\")||n.some(i=>!i||i==="."||i==="..")?(this.issues.push({path:"storage.objectStorage.bucketPrefix",message:`${e} must be a path of non-empty segments without "." or "..".`}),""):`${r}/`}llm(e,r,n){let i=e.toLowerCase();if(!vy.includes(i))return this.issues.push({path:`${n}.provider`,message:`${n} provider must be one of: ${vy.join(", ")}.`}),{provider:"openai",apiKey:this.optional("OPENAI_API_KEY")||"",model:r};switch(i){case"openai":return this.openai(r,n);case"anthropic":return this.anthropic(r,n);case"gemini":return this.gemini(r,n);case"azure":return this.azure(r,n);case"bedrock":return this.bedrock(r,n);case"vertex":return this.vertex(r,n)}}openai(e,r){return{provider:"openai",apiKey:this.required("OPENAI_API_KEY",`${r}.apiKey`),model:e,...e==="gpt-6.1-sol"&&{reasoningEffort:"medium"},...this.optional("OPENAI_BASE_URL")&&{baseUrl:this.optional("OPENAI_BASE_URL")}}}anthropic(e,r){return{provider:"anthropic",apiKey:this.required("ANTHROPIC_API_KEY",`${r}.apiKey`),model:e,...S0(e),...this.optional("ANTHROPIC_BASE_URL")&&{baseUrl:this.optional("ANTHROPIC_BASE_URL")}}}gemini(e,r){return{provider:"gemini",apiKey:this.required("GEMINI_API_KEY",`${r}.apiKey`),model:e,...this.optional("GEMINI_BASE_URL")&&{baseUrl:this.optional("GEMINI_BASE_URL")}}}llmFallbacks(){return this.list("PRIMARY_LLM_FALLBACKS").flatMap((e,r)=>{let n=`llm.primaryFallbacks.${r}`,i=e.indexOf(":"),o=e.slice(0,i).trim(),s=e.slice(i+1).trim();return i===-1||!o||!s?(this.issues.push({path:n,message:`PRIMARY_LLM_FALLBACKS entry "${e}" must use the provider:model format.`}),[]):[this.llm(o,s,n)]})}azure(e,r){let n=this.optional("AZURE_RESOURCE_NAME"),i=this.optional("AZURE_BASE_URL");return!n&&!i&&this.issues.push({path:r,message:"AZURE_RESOURCE_NAME or AZURE_BASE_URL is required when using Azure."}),{provider:"azure",apiKey:this.required("AZURE_API_KEY",`${r}.apiKey`),model:e,...n&&{resourceName:n},...i&&{baseUrl:i},...this.optional("AZURE_API_VERSION")&&{apiVersion:this.optional("AZURE_API_VERSION")},useDeploymentBasedUrls:this.boolean("AZURE_USE_DEPLOYMENT_BASED_URLS",!1,`${r}.useDeploymentBasedUrls`)}}bedrock(e,r){let n=this.optional("BEDROCK_AWS_ACCESS_KEY_ID"),i=this.optional("BEDROCK_AWS_SECRET_ACCESS_KEY");return(n&&!i||!n&&i)&&this.issues.push({path:`${r}.credentials`,message:"BEDROCK_AWS_ACCESS_KEY_ID and BEDROCK_AWS_SECRET_ACCESS_KEY must be set together."}),{provider:"bedrock",model:e,...S0(e),region:this.required("AWS_BEDROCK_REGION",`${r}.region`),...this.optional("AWS_BASE_URL")&&{baseUrl:this.optional("AWS_BASE_URL")},...n&&i&&{accessKeyId:n,secretAccessKey:i,...this.optional("BEDROCK_AWS_SESSION_TOKEN")&&{sessionToken:this.optional("BEDROCK_AWS_SESSION_TOKEN")}}}}vertex(e,r){let n=this.optional("VERTEX_API_KEY"),i=this.optional("VERTEX_CLIENT_EMAIL"),o=this.optional("VERTEX_PRIVATE_KEY"),s=this.optional("GOOGLE_APPLICATION_CREDENTIALS"),a=i&&o?{type:"service_account",clientEmail:i,privateKey:o}:s?{type:"credentials_file",path:s}:n?{type:"api_key",apiKey:n}:null;return a||this.issues.push({path:`${r}.auth`,message:"VERTEX_API_KEY, VERTEX_CLIENT_EMAIL plus VERTEX_PRIVATE_KEY, or GOOGLE_APPLICATION_CREDENTIALS is required when using Vertex."}),e.startsWith("claude")&&a?.type==="api_key"&&this.issues.push({path:`${r}.auth`,message:"Vertex Claude models require service account or credentials-file auth."}),{provider:"vertex",model:e,...S0(e),...this.optional("VERTEX_PROJECT")&&{project:this.optional("VERTEX_PROJECT")},...this.optional("VERTEX_LOCATION")&&{location:this.optional("VERTEX_LOCATION")},auth:a||{type:"api_key",apiKey:""}}}webSearch(e,r){let n=this.choice("WEB_SEARCH_PROVIDER",nEe,"disabled","externalProviders.webSearch.provider"),i=this.optional("WEB_SEARCH_API_KEY"),o=iEe.includes(e)?e:null;return n==="disabled"?{provider:"disabled"}:n==="model_provider"?o?r.some(s=>s.provider!==o)?(this.issues.push({path:"externalProviders.webSearch",message:"WEB_SEARCH_PROVIDER=model_provider requires every PRIMARY_LLM_FALLBACKS entry to use the primary LLM provider."}),{provider:"disabled"}):{provider:"model_provider",llmProvider:o}:(this.issues.push({path:"externalProviders.webSearch",message:"WEB_SEARCH_PROVIDER=model_provider requires OpenAI, Anthropic, or Azure."}),{provider:"disabled"}):n==="tavily"?i?{provider:"tavily",apiKey:i}:(this.issues.push({path:"externalProviders.webSearch.apiKey",message:"WEB_SEARCH_API_KEY is required when WEB_SEARCH_PROVIDER=tavily."}),{provider:"disabled"}):n==="searxng"?this.searxng(i):{provider:"disabled"}}searxng(e){return{provider:"searxng",endpoint:this.required("WEB_SEARCH_ENDPOINT","externalProviders.webSearch.endpoint"),...e&&{apiKey:e}}}posthog(){return this.boolean("POSTHOG_ENABLED",!1,"externalProviders.posthog.enabled")?{enabled:!0,apiKey:this.required("POSTHOG_KEY","externalProviders.posthog.apiKey"),serverHost:this.required("POSTHOG_HOST","externalProviders.posthog.serverHost")}:{enabled:!1}}langfuse(){return this.boolean("LANGFUSE_ENABLED",!1,"externalProviders.langfuse.enabled")?{enabled:!0,publicKey:this.required("LANGFUSE_PUBLIC_KEY","externalProviders.langfuse.publicKey"),secretKey:this.required("LANGFUSE_SECRET_KEY","externalProviders.langfuse.secretKey"),baseUrl:this.required("LANGFUSE_BASE_URL","externalProviders.langfuse.baseUrl"),tracingEnvironment:this.required("LANGFUSE_TRACING_ENVIRONMENT","externalProviders.langfuse.tracingEnvironment")}:{enabled:!1}}resend(){return this.boolean("RESEND_ENABLED",!1,"externalProviders.resend.enabled")?{enabled:!0,apiKey:this.required("RESEND_API_KEY","externalProviders.resend.apiKey"),fromEmail:this.required("RESEND_FROM_EMAIL","externalProviders.resend.fromEmail")}:{enabled:!1}}loops(){return this.boolean("LOOPS_ENABLED",!1,"externalProviders.loops.enabled")?{enabled:!0,apiKey:this.required("LOOPS_API_KEY","externalProviders.loops.apiKey")}:{enabled:!1}}teamsBot(){return this.boolean("TEAMS_BOT_ENABLED",!1,"externalProviders.teamsBot.enabled")?{enabled:!0,appId:this.required("TEAMS_BOT_APP_ID","externalProviders.teamsBot.appId"),appPassword:this.required("TEAMS_BOT_APP_PASSWORD","externalProviders.teamsBot.appPassword"),tenantId:this.optional("TEAMS_BOT_TENANT_ID")??null}:{enabled:!1}}outlookActionableMessages(){let e="externalProviders.outlookActionableMessages";return this.boolean("OUTLOOK_ACTIONABLE_MESSAGES_ENABLED",!1,`${e}.enabled`)?{enabled:!0,originatorId:this.required("OUTLOOK_ACTIONABLE_MESSAGES_ORIGINATOR_ID",`${e}.originatorId`),appId:this.required("OUTLOOK_ACTIONABLE_MESSAGES_APP_ID",`${e}.appId`)}:{enabled:!1}}bundles(){let e=this.optional("SAGE_INTACCT_SENDER_ID"),r=this.optional("SAGE_INTACCT_SENDER_PASSWORD");return(e&&!r||!e&&r)&&this.issues.push({path:"bundles.sageIntacctSender",message:"SAGE_INTACCT_SENDER_ID and SAGE_INTACCT_SENDER_PASSWORD must be set together."}),{sageIntacctSender:e&&r?{senderId:e,senderPassword:r}:null}}billing(e){return e==="enterprise"?{provider:"disabled"}:{provider:"stripe",secretKey:this.required("STRIPE_SECRET_KEY","billing.secretKey"),webhookSecret:this.required("STRIPE_WEBHOOK_SECRET","billing.webhookSecret"),productIds:this.stripeProductIds()}}stripeProductIds(){let e=this.optional("STRIPE_PRODUCT_IDS");if(!e)return By;try{let r=JSON.parse(e);if(!r||typeof r!="object"||Array.isArray(r))return this.issues.push({path:"billing.productIds",message:"STRIPE_PRODUCT_IDS must be a JSON object."}),By;let n={...By};for(let i of tEe){let o=r[i];typeof o=="string"&&o.trim()&&(n[i]=o.trim())}return n}catch{return this.issues.push({path:"billing.productIds",message:"STRIPE_PRODUCT_IDS must be valid JSON."}),By}}auth(){let e=this.optional("OKTA_SCIM_TOKEN");e&&e.length<32&&this.issues.push({path:"auth.providers.okta.scimToken",message:"OKTA_SCIM_TOKEN must contain at least 32 characters."});let r=this.listChoice("AUTH_PROVIDERS",xF,"auth.providers"),n=new Map,i=this.configuredOAuthProvider("google","GOOGLE"),o=this.configuredOAuthProvider("github","GITHUB"),s=this.configuredOktaProvider();i&&n.set("google",i),o&&n.set("github",o),s&&n.set("okta",s);for(let d of r)switch(d){case"email_password":n.set(d,{provider:d});break;case"google":n.set(d,this.oauthProvider(d,"GOOGLE","auth.providers.google"));break;case"github":n.set(d,this.oauthProvider(d,"GITHUB","auth.providers.github"));break;case"okta":n.set(d,this.oktaProvider());break}let a=xF.flatMap(d=>{let A=n.get(d);return A?[A]:[]}),c=this.requiredBoolean("AUTH_DISABLE_SIGNUP",!1,"auth.disableSignup"),l=this.requiredBoolean("AUTH_DISABLE_INVITES",!1,"auth.disableInvites"),u=n.has("okta");return c&&l&&!u&&this.issues.push({path:"auth",message:"AUTH_DISABLE_SIGNUP and AUTH_DISABLE_INVITES cannot both be true without an Okta provider \u2014 no account creation path would remain."}),{providers:a,visibleProviders:r,disableSignup:c,disableInvites:l}}configuredOAuthProvider(e,r){let n=this.optional(`${r}_CLIENT_ID`),i=this.optional(`${r}_CLIENT_SECRET`);if(!(!n||!i))return{provider:e,clientId:n,clientSecret:i}}configuredOktaProvider(){let e=this.optional("OKTA_CLIENT_ID"),r=this.optional("OKTA_CLIENT_SECRET"),n=this.optional("OKTA_ISSUER"),i=this.optional("OKTA_ORG_ID"),o=this.optional("OKTA_SCIM_TOKEN");if(!(!e||!r||!n||!i))return{provider:"okta",clientId:e,clientSecret:r,issuer:n.replace(/\/$/,""),organizationId:i,...o?{scimToken:o}:{}}}oauthProvider(e,r,n){return{provider:e,clientId:this.required(`${r}_CLIENT_ID`,`${n}.clientId`),clientSecret:this.required(`${r}_CLIENT_SECRET`,`${n}.clientSecret`)}}oktaProvider(){let e=this.optional("OKTA_SCIM_TOKEN");return{provider:"okta",clientId:this.required("OKTA_CLIENT_ID","auth.providers.okta.clientId"),clientSecret:this.required("OKTA_CLIENT_SECRET","auth.providers.okta.clientSecret"),issuer:this.required("OKTA_ISSUER","auth.providers.okta.issuer").replace(/\/$/,""),organizationId:this.required("OKTA_ORG_ID","auth.providers.okta.organizationId"),...e?{scimToken:e}:{}}}},Qy=class extends Error{constructor(e){super(`Invalid deployment environment:
928
+ `.trim();var Xye=`<style data-sg-base>${Mu.ARTIFACT_BASE_CSS}</style>`;function eEe(t){return t.includes("<style data-sg-base>")?t:(0,Kye.injectHeadStyle)(t,Xye,"start")}});var UF=I(Ip=>{"use strict";Object.defineProperty(Ip,"__esModule",{value:!0});Ip.DeploymentConfigError=void 0;Ip.buildDeploymentConfig=cEe;var tEe=["pro","team","enterprise"],By={pro:"prod_UjB46ulzKsQ1Ef",team:"prod_UiMeaL02tN4BMg",enterprise:"prod_UapuUIQQuluzUV"},rEe=/claude-opus-5-5(?![0-9])/i;function S0(t){return rEe.test(t)?{effort:"medium"}:{}}var vy=["openai","anthropic","gemini","azure","bedrock","vertex"],nEe=["tavily","model_provider","searxng","disabled"],iEe=["openai","anthropic","azure"],oEe=["cloud","enterprise"],sEe=["aws","minio","azure"],aEe=/^(?=.{3,63}$)[a-z0-9]+(-[a-z0-9]+)*$/,xF=["email_password","google","github","okta"],w0=class{constructor(e){this.raw=e,this.issues=[]}build(){let e=this.requiredPort("API_PORT",3002,"runtime.apiPort"),r=this.requiredPort("WEB_PORT",3001,"runtime.webPort"),n=this.requiredUrl("PUBLIC_API_URL",`http://localhost:${e}`,"runtime.publicApiUrl"),i=this.url("INTERNAL_API_URL",n,"runtime.internalApiUrl"),o=this.requiredUrl("PUBLIC_APP_URL","https://app.superglue.cloud","runtime.publicAppUrl"),s=this.url("INTERNAL_APP_URL",o,"runtime.internalAppUrl"),a=this.deploymentMode(),c=this.requiredBoolean("BLOCK_LOCAL_REQUESTS",!1,"security.blockLocalRequests"),l=this.llm(this.choice("PRIMARY_LLM_PROVIDER",vy,"openai","llm.primary.provider"),this.required("PRIMARY_LLM_MODEL","llm.primary.model"),"llm.primary"),u=this.llmFallbacks(),d=this.llm(this.choice("SUMMARIZE_LLM_PROVIDER",vy,"openai","llm.summarize.provider"),this.required("SUMMARIZE_LLM_MODEL","llm.summarize.model"),"llm.summarize"),A={deployment:{mode:a,orgConcurrencyLimits:a==="enterprise"?"disabled":"tier_config"},runtime:{apiPort:e,webPort:r,publicApiUrl:n,internalApiUrl:i,publicAppUrl:o,internalAppUrl:s,scheduler:this.scheduler()},website:{contactFormToEmail:this.optional("WEBSITE_CONTACT_FORM_TO_EMAIL")??null},security:{jwtSecret:this.required("JWT_AUTH_SECRET","security.jwtSecret"),internalApiToken:this.required("INTERNAL_API_TOKEN","security.internalApiToken"),credentialsEncryptionKey:this.required("MASTER_ENCRYPTION_KEY","security.credentialsEncryptionKey"),blockLocalRequests:c,trustProxyHops:this.nonNegativeInteger("TRUST_PROXY_HOPS",1,"security.trustProxyHops")},storage:{postgres:{host:this.required("POSTGRES_HOST","storage.postgres.host"),port:this.requiredPort("POSTGRES_PORT",5432,"storage.postgres.port"),username:this.required("POSTGRES_USERNAME","storage.postgres.username"),password:this.required("POSTGRES_PASSWORD","storage.postgres.password"),database:this.required("POSTGRES_DB","storage.postgres.database"),ssl:this.requiredBoolean("POSTGRES_SSL",!0,"storage.postgres.ssl")},objectStorage:this.objectStorage()},llm:{primary:l,primaryFallbacks:u,summarize:d,decisionModel:this.decisionModel()},externalProviders:{posthog:this.posthog(),langfuse:this.langfuse(),resend:this.resend(),loops:this.loops(),teamsBot:this.teamsBot(),outlookActionableMessages:this.outlookActionableMessages(),webSearch:this.webSearch(l.provider,u)},billing:this.billing(a),bundles:this.bundles(),features:{briefings:this.boolean("BRIEFINGS_ENABLED",!1,"features.briefings")},auth:this.auth()};if(this.issues.length>0)throw new Qy(this.issues);return A}optional(e){let r=this.raw[e]?.trim();return r||void 0}required(e,r){let n=this.optional(e);return n||(this.issues.push({path:r,message:`${e} is required.`}),"")}requiredOptional(e,r){let n=this.optional(e);return n||this.issues.push({path:r,message:`${e} is required.`}),n}boolean(e,r,n){let i=this.optional(e);return i?i==="true"?!0:i==="false"?!1:(this.issues.push({path:n,message:`${e} must be "true" or "false".`}),r):r}requiredBoolean(e,r,n){let i=this.requiredOptional(e,n);return i?i==="true"?!0:i==="false"?!1:(this.issues.push({path:n,message:`${e} must be "true" or "false".`}),r):r}port(e,r,n){let i=this.optional(e);if(!i)return r;let o=Number(i);return!Number.isInteger(o)||o<1||o>65535?(this.issues.push({path:n,message:`${e} must be a TCP port between 1 and 65535.`}),r):o}nonNegativeInteger(e,r,n){let i=this.optional(e);if(!i)return r;let o=Number(i);return!Number.isInteger(o)||o<0?(this.issues.push({path:n,message:`${e} must be a non-negative integer.`}),r):o}requiredPort(e,r,n){return this.requiredOptional(e,n)?this.port(e,r,n):r}url(e,r,n){return this.validUrl(this.optional(e)||r,e,n)??r}validUrl(e,r,n){try{return new URL(e).toString().replace(/\/$/,"")}catch{this.issues.push({path:n,message:`${r} must be a valid URL.`});return}}requiredUrl(e,r,n){return this.requiredOptional(e,n)?this.url(e,r,n):r}choice(e,r,n,i){let o=this.requiredOptional(e,i)?.toLowerCase();return o?r.includes(o)?o:(this.issues.push({path:i,message:`${e} must be one of: ${r.join(", ")}.`}),n):n}listChoice(e,r,n){let i=this.requiredOptional(e,n);if(!i)return[];let o=[],s=new Set;for(let a of i.split(",")){let c=a.trim().toLowerCase();if(!(!c||s.has(c))){if(s.add(c),r.includes(c)){o.push(c);continue}this.issues.push({path:n,message:`${e} contains unsupported value "${c}". Use one of: ${r.join(", ")}.`})}}return o.length===0&&this.issues.push({path:n,message:`${e} must include at least one provider.`}),o}list(e){return(this.optional(e)??"").split(",").map(r=>r.trim()).filter(Boolean)}deploymentMode(){return this.choice("DEPLOYMENT_MODE",oEe,"cloud","deployment.mode")}scheduler(){return this.requiredBoolean("START_SCHEDULER_SERVER",!1,"runtime.scheduler.mode")?{mode:"in_process"}:{mode:"disabled"}}objectStorage(){let e=this.choice("S3_PROVIDER",sEe,"aws","storage.objectStorage.provider");if(e==="azure")return this.azureObjectStorage();if(e==="minio")return{provider:"minio",endpoint:this.required("S3_ENDPOINT","storage.objectStorage.endpoint"),publicEndpoint:this.optional("S3_PUBLIC_ENDPOINT")??null,bucketName:this.required("MINIO_BUCKET_NAME","storage.objectStorage.bucketName"),bucketPrefix:this.optional("MINIO_BUCKET_PREFIX")?this.bucketPrefix("MINIO_BUCKET_PREFIX"):this.bucketPrefix("AWS_BUCKET_PREFIX"),accessKeyId:this.required("MINIO_ROOT_USER","storage.objectStorage.accessKeyId"),secretAccessKey:this.required("MINIO_ROOT_PASSWORD","storage.objectStorage.secretAccessKey")};let r=this.optional("AWS_S3_ACCESS_KEY_ID"),n=this.optional("AWS_S3_SECRET_ACCESS_KEY");return(r&&!n||!r&&n)&&this.issues.push({path:"storage.objectStorage.credentials",message:"AWS_S3_ACCESS_KEY_ID and AWS_S3_SECRET_ACCESS_KEY must be set together."}),{provider:"aws",region:this.required("AWS_S3_REGION","storage.objectStorage.region"),bucketName:this.required("AWS_BUCKET_NAME","storage.objectStorage.bucketName"),bucketPrefix:this.bucketPrefix("AWS_BUCKET_PREFIX"),...r&&n?{accessKeyId:r,secretAccessKey:n,...this.optional("AWS_S3_SESSION_TOKEN")&&{sessionToken:this.optional("AWS_S3_SESSION_TOKEN")}}:{}}}azureObjectStorage(){let e=this.required("AZURE_STORAGE_CONTAINER_NAME","storage.objectStorage.containerName");e&&!aEe.test(e)&&this.issues.push({path:"storage.objectStorage.containerName",message:"AZURE_STORAGE_CONTAINER_NAME must be 3-63 lowercase letters, numbers and single hyphens."});let r=this.bucketPrefix("AZURE_STORAGE_PREFIX"),n=this.optional("AZURE_STORAGE_MANAGED_IDENTITY_CLIENT_ID"),i=this.optional("AZURE_STORAGE_CONNECTION_STRING");if(i){let a=["AZURE_STORAGE_ACCOUNT_NAME","AZURE_STORAGE_ACCOUNT_KEY","AZURE_STORAGE_BLOB_ENDPOINT","AZURE_STORAGE_MANAGED_IDENTITY_CLIENT_ID"].filter(p=>this.optional(p));a.length>0&&this.issues.push({path:"storage.objectStorage.credential",message:`AZURE_STORAGE_CONNECTION_STRING cannot be combined with ${a.join(", ")}.`});let c=new Map;for(let p of i.split(";")){let f=p.indexOf("=");f>0&&c.set(p.slice(0,f).trim(),p.slice(f+1).trim())}let l=c.get("AccountName")??"",u=c.get("AccountKey")??"";(!l||!u)&&this.issues.push({path:"storage.objectStorage.credential",message:"AZURE_STORAGE_CONNECTION_STRING must contain AccountName and AccountKey."});let d=c.get("DefaultEndpointsProtocol")??"https",A=c.get("EndpointSuffix")??"core.windows.net";return{provider:"azure",accountName:l,blobEndpoint:this.validUrl(c.get("BlobEndpoint")??`${d}://${l}.blob.${A}`,"AZURE_STORAGE_CONNECTION_STRING BlobEndpoint","storage.objectStorage.blobEndpoint")??"",containerName:e,bucketPrefix:r,credential:{type:"shared_key",accountKey:u}}}let o=this.required("AZURE_STORAGE_ACCOUNT_NAME","storage.objectStorage.accountName"),s=this.optional("AZURE_STORAGE_ACCOUNT_KEY");return s&&n&&this.issues.push({path:"storage.objectStorage.credential",message:"AZURE_STORAGE_MANAGED_IDENTITY_CLIENT_ID cannot be combined with AZURE_STORAGE_ACCOUNT_KEY."}),{provider:"azure",accountName:o,blobEndpoint:this.url("AZURE_STORAGE_BLOB_ENDPOINT",`https://${o}.blob.core.windows.net`,"storage.objectStorage.blobEndpoint"),containerName:e,bucketPrefix:r,credential:s?{type:"shared_key",accountKey:s}:{type:"token",...n&&{managedIdentityClientId:n}}}}bucketPrefix(e){let r=this.optional(e)?.replace(/^\/+|\/+$/g,"");if(!r)return"";let n=r.split("/");return r.includes("\\")||n.some(i=>!i||i==="."||i==="..")?(this.issues.push({path:"storage.objectStorage.bucketPrefix",message:`${e} must be a path of non-empty segments without "." or "..".`}),""):`${r}/`}llm(e,r,n){let i=e.toLowerCase();if(!vy.includes(i))return this.issues.push({path:`${n}.provider`,message:`${n} provider must be one of: ${vy.join(", ")}.`}),{provider:"openai",apiKey:this.optional("OPENAI_API_KEY")||"",model:r};switch(i){case"openai":return this.openai(r,n);case"anthropic":return this.anthropic(r,n);case"gemini":return this.gemini(r,n);case"azure":return this.azure(r,n);case"bedrock":return this.bedrock(r,n);case"vertex":return this.vertex(r,n)}}decisionModel(){let e="llm.decisionModel";if(!this.optional("DECISION_MODEL_LLM_PROVIDER")&&!this.optional("DECISION_MODEL_LLM"))return null;let r=this.llm(this.required("DECISION_MODEL_LLM_PROVIDER",`${e}.provider`),this.required("DECISION_MODEL_LLM",`${e}.model`),e);return r.provider!=="openai"?(this.issues.push({path:`${e}.provider`,message:"DECISION_MODEL_LLM_PROVIDER must be openai for the Decisions API."}),null):{...r,baseUrl:this.url("OPENAI_BASE_URL","https://api.openai.com/v1",`${e}.baseUrl`)}}openai(e,r){return{provider:"openai",apiKey:this.required("OPENAI_API_KEY",`${r}.apiKey`),model:e,...e==="gpt-6.1-sol"&&{reasoningEffort:"medium"},...this.optional("OPENAI_BASE_URL")&&{baseUrl:this.optional("OPENAI_BASE_URL")}}}anthropic(e,r){return{provider:"anthropic",apiKey:this.required("ANTHROPIC_API_KEY",`${r}.apiKey`),model:e,...S0(e),...this.optional("ANTHROPIC_BASE_URL")&&{baseUrl:this.optional("ANTHROPIC_BASE_URL")}}}gemini(e,r){return{provider:"gemini",apiKey:this.required("GEMINI_API_KEY",`${r}.apiKey`),model:e,...this.optional("GEMINI_BASE_URL")&&{baseUrl:this.optional("GEMINI_BASE_URL")}}}llmFallbacks(){return this.list("PRIMARY_LLM_FALLBACKS").flatMap((e,r)=>{let n=`llm.primaryFallbacks.${r}`,i=e.indexOf(":"),o=e.slice(0,i).trim(),s=e.slice(i+1).trim();return i===-1||!o||!s?(this.issues.push({path:n,message:`PRIMARY_LLM_FALLBACKS entry "${e}" must use the provider:model format.`}),[]):[this.llm(o,s,n)]})}azure(e,r){let n=this.optional("AZURE_RESOURCE_NAME"),i=this.optional("AZURE_BASE_URL");return!n&&!i&&this.issues.push({path:r,message:"AZURE_RESOURCE_NAME or AZURE_BASE_URL is required when using Azure."}),{provider:"azure",apiKey:this.required("AZURE_API_KEY",`${r}.apiKey`),model:e,...n&&{resourceName:n},...i&&{baseUrl:i},...this.optional("AZURE_API_VERSION")&&{apiVersion:this.optional("AZURE_API_VERSION")},useDeploymentBasedUrls:this.boolean("AZURE_USE_DEPLOYMENT_BASED_URLS",!1,`${r}.useDeploymentBasedUrls`)}}bedrock(e,r){let n=this.optional("BEDROCK_AWS_ACCESS_KEY_ID"),i=this.optional("BEDROCK_AWS_SECRET_ACCESS_KEY");return(n&&!i||!n&&i)&&this.issues.push({path:`${r}.credentials`,message:"BEDROCK_AWS_ACCESS_KEY_ID and BEDROCK_AWS_SECRET_ACCESS_KEY must be set together."}),{provider:"bedrock",model:e,...S0(e),region:this.required("AWS_BEDROCK_REGION",`${r}.region`),...this.optional("AWS_BASE_URL")&&{baseUrl:this.optional("AWS_BASE_URL")},...n&&i&&{accessKeyId:n,secretAccessKey:i,...this.optional("BEDROCK_AWS_SESSION_TOKEN")&&{sessionToken:this.optional("BEDROCK_AWS_SESSION_TOKEN")}}}}vertex(e,r){let n=this.optional("VERTEX_API_KEY"),i=this.optional("VERTEX_CLIENT_EMAIL"),o=this.optional("VERTEX_PRIVATE_KEY"),s=this.optional("GOOGLE_APPLICATION_CREDENTIALS"),a=i&&o?{type:"service_account",clientEmail:i,privateKey:o}:s?{type:"credentials_file",path:s}:n?{type:"api_key",apiKey:n}:null;return a||this.issues.push({path:`${r}.auth`,message:"VERTEX_API_KEY, VERTEX_CLIENT_EMAIL plus VERTEX_PRIVATE_KEY, or GOOGLE_APPLICATION_CREDENTIALS is required when using Vertex."}),e.startsWith("claude")&&a?.type==="api_key"&&this.issues.push({path:`${r}.auth`,message:"Vertex Claude models require service account or credentials-file auth."}),{provider:"vertex",model:e,...S0(e),...this.optional("VERTEX_PROJECT")&&{project:this.optional("VERTEX_PROJECT")},...this.optional("VERTEX_LOCATION")&&{location:this.optional("VERTEX_LOCATION")},auth:a||{type:"api_key",apiKey:""}}}webSearch(e,r){let n=this.choice("WEB_SEARCH_PROVIDER",nEe,"disabled","externalProviders.webSearch.provider"),i=this.optional("WEB_SEARCH_API_KEY"),o=iEe.includes(e)?e:null;return n==="disabled"?{provider:"disabled"}:n==="model_provider"?o?r.some(s=>s.provider!==o)?(this.issues.push({path:"externalProviders.webSearch",message:"WEB_SEARCH_PROVIDER=model_provider requires every PRIMARY_LLM_FALLBACKS entry to use the primary LLM provider."}),{provider:"disabled"}):{provider:"model_provider",llmProvider:o}:(this.issues.push({path:"externalProviders.webSearch",message:"WEB_SEARCH_PROVIDER=model_provider requires OpenAI, Anthropic, or Azure."}),{provider:"disabled"}):n==="tavily"?i?{provider:"tavily",apiKey:i}:(this.issues.push({path:"externalProviders.webSearch.apiKey",message:"WEB_SEARCH_API_KEY is required when WEB_SEARCH_PROVIDER=tavily."}),{provider:"disabled"}):n==="searxng"?this.searxng(i):{provider:"disabled"}}searxng(e){return{provider:"searxng",endpoint:this.required("WEB_SEARCH_ENDPOINT","externalProviders.webSearch.endpoint"),...e&&{apiKey:e}}}posthog(){return this.boolean("POSTHOG_ENABLED",!1,"externalProviders.posthog.enabled")?{enabled:!0,apiKey:this.required("POSTHOG_KEY","externalProviders.posthog.apiKey"),serverHost:this.required("POSTHOG_HOST","externalProviders.posthog.serverHost")}:{enabled:!1}}langfuse(){return this.boolean("LANGFUSE_ENABLED",!1,"externalProviders.langfuse.enabled")?{enabled:!0,publicKey:this.required("LANGFUSE_PUBLIC_KEY","externalProviders.langfuse.publicKey"),secretKey:this.required("LANGFUSE_SECRET_KEY","externalProviders.langfuse.secretKey"),baseUrl:this.required("LANGFUSE_BASE_URL","externalProviders.langfuse.baseUrl"),tracingEnvironment:this.required("LANGFUSE_TRACING_ENVIRONMENT","externalProviders.langfuse.tracingEnvironment")}:{enabled:!1}}resend(){return this.boolean("RESEND_ENABLED",!1,"externalProviders.resend.enabled")?{enabled:!0,apiKey:this.required("RESEND_API_KEY","externalProviders.resend.apiKey"),fromEmail:this.required("RESEND_FROM_EMAIL","externalProviders.resend.fromEmail")}:{enabled:!1}}loops(){return this.boolean("LOOPS_ENABLED",!1,"externalProviders.loops.enabled")?{enabled:!0,apiKey:this.required("LOOPS_API_KEY","externalProviders.loops.apiKey")}:{enabled:!1}}teamsBot(){return this.boolean("TEAMS_BOT_ENABLED",!1,"externalProviders.teamsBot.enabled")?{enabled:!0,appId:this.required("TEAMS_BOT_APP_ID","externalProviders.teamsBot.appId"),appPassword:this.required("TEAMS_BOT_APP_PASSWORD","externalProviders.teamsBot.appPassword"),tenantId:this.optional("TEAMS_BOT_TENANT_ID")??null}:{enabled:!1}}outlookActionableMessages(){let e="externalProviders.outlookActionableMessages";return this.boolean("OUTLOOK_ACTIONABLE_MESSAGES_ENABLED",!1,`${e}.enabled`)?{enabled:!0,originatorId:this.required("OUTLOOK_ACTIONABLE_MESSAGES_ORIGINATOR_ID",`${e}.originatorId`),appId:this.required("OUTLOOK_ACTIONABLE_MESSAGES_APP_ID",`${e}.appId`)}:{enabled:!1}}bundles(){let e=this.optional("SAGE_INTACCT_SENDER_ID"),r=this.optional("SAGE_INTACCT_SENDER_PASSWORD");return(e&&!r||!e&&r)&&this.issues.push({path:"bundles.sageIntacctSender",message:"SAGE_INTACCT_SENDER_ID and SAGE_INTACCT_SENDER_PASSWORD must be set together."}),{sageIntacctSender:e&&r?{senderId:e,senderPassword:r}:null}}billing(e){return e==="enterprise"?{provider:"disabled"}:{provider:"stripe",secretKey:this.required("STRIPE_SECRET_KEY","billing.secretKey"),webhookSecret:this.required("STRIPE_WEBHOOK_SECRET","billing.webhookSecret"),productIds:this.stripeProductIds()}}stripeProductIds(){let e=this.optional("STRIPE_PRODUCT_IDS");if(!e)return By;try{let r=JSON.parse(e);if(!r||typeof r!="object"||Array.isArray(r))return this.issues.push({path:"billing.productIds",message:"STRIPE_PRODUCT_IDS must be a JSON object."}),By;let n={...By};for(let i of tEe){let o=r[i];typeof o=="string"&&o.trim()&&(n[i]=o.trim())}return n}catch{return this.issues.push({path:"billing.productIds",message:"STRIPE_PRODUCT_IDS must be valid JSON."}),By}}auth(){let e=this.optional("OKTA_SCIM_TOKEN");e&&e.length<32&&this.issues.push({path:"auth.providers.okta.scimToken",message:"OKTA_SCIM_TOKEN must contain at least 32 characters."});let r=this.listChoice("AUTH_PROVIDERS",xF,"auth.providers"),n=new Map,i=this.configuredOAuthProvider("google","GOOGLE"),o=this.configuredOAuthProvider("github","GITHUB"),s=this.configuredOktaProvider();i&&n.set("google",i),o&&n.set("github",o),s&&n.set("okta",s);for(let d of r)switch(d){case"email_password":n.set(d,{provider:d});break;case"google":n.set(d,this.oauthProvider(d,"GOOGLE","auth.providers.google"));break;case"github":n.set(d,this.oauthProvider(d,"GITHUB","auth.providers.github"));break;case"okta":n.set(d,this.oktaProvider());break}let a=xF.flatMap(d=>{let A=n.get(d);return A?[A]:[]}),c=this.requiredBoolean("AUTH_DISABLE_SIGNUP",!1,"auth.disableSignup"),l=this.requiredBoolean("AUTH_DISABLE_INVITES",!1,"auth.disableInvites"),u=n.has("okta");return c&&l&&!u&&this.issues.push({path:"auth",message:"AUTH_DISABLE_SIGNUP and AUTH_DISABLE_INVITES cannot both be true without an Okta provider \u2014 no account creation path would remain."}),{providers:a,visibleProviders:r,disableSignup:c,disableInvites:l}}configuredOAuthProvider(e,r){let n=this.optional(`${r}_CLIENT_ID`),i=this.optional(`${r}_CLIENT_SECRET`);if(!(!n||!i))return{provider:e,clientId:n,clientSecret:i}}configuredOktaProvider(){let e=this.optional("OKTA_CLIENT_ID"),r=this.optional("OKTA_CLIENT_SECRET"),n=this.optional("OKTA_ISSUER"),i=this.optional("OKTA_ORG_ID"),o=this.optional("OKTA_SCIM_TOKEN");if(!(!e||!r||!n||!i))return{provider:"okta",clientId:e,clientSecret:r,issuer:n.replace(/\/$/,""),organizationId:i,...o?{scimToken:o}:{}}}oauthProvider(e,r,n){return{provider:e,clientId:this.required(`${r}_CLIENT_ID`,`${n}.clientId`),clientSecret:this.required(`${r}_CLIENT_SECRET`,`${n}.clientSecret`)}}oktaProvider(){let e=this.optional("OKTA_SCIM_TOKEN");return{provider:"okta",clientId:this.required("OKTA_CLIENT_ID","auth.providers.okta.clientId"),clientSecret:this.required("OKTA_CLIENT_SECRET","auth.providers.okta.clientSecret"),issuer:this.required("OKTA_ISSUER","auth.providers.okta.issuer").replace(/\/$/,""),organizationId:this.required("OKTA_ORG_ID","auth.providers.okta.organizationId"),...e?{scimToken:e}:{}}}},Qy=class extends Error{constructor(e){super(`Invalid deployment environment:
929
929
  ${e.map(r=>`- ${r.path}: ${r.message}`).join(`
930
930
  `)}`),this.issues=e,this.name="DeploymentConfigError"}};Ip.DeploymentConfigError=Qy;function cEe(t){return new w0(t).build()}});var MF=I(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.readProcessDeploymentEnvironment=lEe;Yc.readProcessEnvironmentValue=_0;Yc.writeProcessEnvironmentValue=uEe;Yc.isProcessEnvironmentValue=dEe;Yc.readProcessEnvironmentSnapshot=AEe;function lEe(){return process.env}function _0(t){return process.env[t]}function uEe(t,e){process.env[t]=e}function dEe(t,e){return _0(t)===e}function AEe(t){return Object.fromEntries(t.map(e=>[e,_0(e)]))}});var LF=I(PF=>{"use strict";Object.defineProperty(PF,"__esModule",{value:!0})});var qF=I((Rqe,zF)=>{"use strict";var $F=9007199254740991,pEe="[object Arguments]",fEe="[object Function]",hEe="[object GeneratorFunction]",gEe=/^(?:0|[1-9]\d*)$/;function mEe(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function yEe(t,e){return function(r){return t(e(r))}}var Ty=Object.prototype,B0=Ty.hasOwnProperty,FF=Ty.toString,EEe=Ty.propertyIsEnumerable,IEe=yEe(Object.keys,Object);function CEe(t,e){var r=BEe(t)||_Ee(t)?mEe(t.length,String):[],n=r.length,i=!!n;for(var o in t)(e||B0.call(t,o))&&!(i&&(o=="length"||SEe(o,n)))&&r.push(o);return r}function bEe(t){if(!wEe(t))return IEe(t);var e=[];for(var r in Object(t))B0.call(t,r)&&r!="constructor"&&e.push(r);return e}function SEe(t,e){return e=e??$F,!!e&&(typeof t=="number"||gEe.test(t))&&t>-1&&t%1==0&&t<e}function wEe(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Ty;return t===r}function _Ee(t){return vEe(t)&&B0.call(t,"callee")&&(!EEe.call(t,"callee")||FF.call(t)==pEe)}var BEe=Array.isArray;function jF(t){return t!=null&&TEe(t.length)&&!QEe(t)}function vEe(t){return REe(t)&&jF(t)}function QEe(t){var e=DEe(t)?FF.call(t):"";return e==fEe||e==hEe}function TEe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=$F}function DEe(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function REe(t){return!!t&&typeof t=="object"}function kEe(t){return jF(t)?CEe(t):bEe(t)}zF.exports=kEe});var E1=I((Cp,Pu)=>{"use strict";var NEe=200,e1="__lodash_hash_undefined__",OEe=800,xEe=16,t1=9007199254740991,r1="[object Arguments]",UEe="[object Array]",MEe="[object AsyncFunction]",PEe="[object Boolean]",LEe="[object Date]",$Ee="[object Error]",n1="[object Function]",FEe="[object GeneratorFunction]",jEe="[object Map]",zEe="[object Number]",qEe="[object Null]",i1="[object Object]",HEe="[object Proxy]",GEe="[object RegExp]",YEe="[object Set]",VEe="[object String]",WEe="[object Undefined]",JEe="[object WeakMap]",ZEe="[object ArrayBuffer]",KEe="[object DataView]",XEe="[object Float32Array]",eIe="[object Float64Array]",tIe="[object Int8Array]",rIe="[object Int16Array]",nIe="[object Int32Array]",iIe="[object Uint8Array]",oIe="[object Uint8ClampedArray]",sIe="[object Uint16Array]",aIe="[object Uint32Array]",cIe=/[\\^$.*+?()[\]{}|]/g,lIe=/^\[object .+?Constructor\]$/,uIe=/^(?:0|[1-9]\d*)$/,Qt={};Qt[XEe]=Qt[eIe]=Qt[tIe]=Qt[rIe]=Qt[nIe]=Qt[iIe]=Qt[oIe]=Qt[sIe]=Qt[aIe]=!0;Qt[r1]=Qt[UEe]=Qt[ZEe]=Qt[PEe]=Qt[KEe]=Qt[LEe]=Qt[$Ee]=Qt[n1]=Qt[jEe]=Qt[zEe]=Qt[i1]=Qt[GEe]=Qt[YEe]=Qt[VEe]=Qt[JEe]=!1;var o1=typeof global=="object"&&global&&global.Object===Object&&global,dIe=typeof self=="object"&&self&&self.Object===Object&&self,wp=o1||dIe||Function("return this")(),s1=typeof Cp=="object"&&Cp&&!Cp.nodeType&&Cp,bp=s1&&typeof Pu=="object"&&Pu&&!Pu.nodeType&&Pu,a1=bp&&bp.exports===s1,v0=a1&&o1.process,HF=(function(){try{var t=bp&&bp.require&&bp.require("util").types;return t||v0&&v0.binding&&v0.binding("util")}catch{}})(),GF=HF&&HF.isTypedArray;function AIe(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function pIe(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function fIe(t){return function(e){return t(e)}}function hIe(t,e){return t?.[e]}function gIe(t,e){return function(r){return t(e(r))}}var mIe=Array.prototype,yIe=Function.prototype,ky=Object.prototype,Q0=wp["__core-js_shared__"],Ny=yIe.toString,qs=ky.hasOwnProperty,YF=(function(){var t=/[^.]+$/.exec(Q0&&Q0.keys&&Q0.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})(),c1=ky.toString,EIe=Ny.call(Object),IIe=RegExp("^"+Ny.call(qs).replace(cIe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Dy=a1?wp.Buffer:void 0,VF=wp.Symbol,WF=wp.Uint8Array,JF=Dy?Dy.allocUnsafe:void 0,l1=gIe(Object.getPrototypeOf,Object),ZF=Object.create,CIe=ky.propertyIsEnumerable,bIe=mIe.splice,Vc=VF?VF.toStringTag:void 0,Ry=(function(){try{var t=O0(Object,"defineProperty");return t({},"",{}),t}catch{}})(),SIe=Dy?Dy.isBuffer:void 0,KF=Math.max,wIe=Date.now,u1=O0(wp,"Map"),Sp=O0(Object,"create"),_Ie=(function(){function t(){}return function(e){if(!Jc(e))return{};if(ZF)return ZF(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}})();function Wc(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function BIe(){this.__data__=Sp?Sp(null):{},this.size=0}function vIe(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}function QIe(t){var e=this.__data__;if(Sp){var r=e[t];return r===e1?void 0:r}return qs.call(e,t)?e[t]:void 0}function TIe(t){var e=this.__data__;return Sp?e[t]!==void 0:qs.call(e,t)}function DIe(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Sp&&e===void 0?e1:e,this}Wc.prototype.clear=BIe;Wc.prototype.delete=vIe;Wc.prototype.get=QIe;Wc.prototype.has=TIe;Wc.prototype.set=DIe;function Hs(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function RIe(){this.__data__=[],this.size=0}function kIe(t){var e=this.__data__,r=Oy(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():bIe.call(e,r,1),--this.size,!0}function NIe(t){var e=this.__data__,r=Oy(e,t);return r<0?void 0:e[r][1]}function OIe(t){return Oy(this.__data__,t)>-1}function xIe(t,e){var r=this.__data__,n=Oy(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}Hs.prototype.clear=RIe;Hs.prototype.delete=kIe;Hs.prototype.get=NIe;Hs.prototype.has=OIe;Hs.prototype.set=xIe;function Lu(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function UIe(){this.size=0,this.__data__={hash:new Wc,map:new(u1||Hs),string:new Wc}}function MIe(t){var e=Uy(this,t).delete(t);return this.size-=e?1:0,e}function PIe(t){return Uy(this,t).get(t)}function LIe(t){return Uy(this,t).has(t)}function $Ie(t,e){var r=Uy(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}Lu.prototype.clear=UIe;Lu.prototype.delete=MIe;Lu.prototype.get=PIe;Lu.prototype.has=LIe;Lu.prototype.set=$Ie;function $u(t){var e=this.__data__=new Hs(t);this.size=e.size}function FIe(){this.__data__=new Hs,this.size=0}function jIe(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}function zIe(t){return this.__data__.get(t)}function qIe(t){return this.__data__.has(t)}function HIe(t,e){var r=this.__data__;if(r instanceof Hs){var n=r.__data__;if(!u1||n.length<NEe-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new Lu(n)}return r.set(t,e),this.size=r.size,this}$u.prototype.clear=FIe;$u.prototype.delete=jIe;$u.prototype.get=zIe;$u.prototype.has=qIe;$u.prototype.set=HIe;function GIe(t,e){var r=k0(t),n=!r&&R0(t),i=!r&&!n&&f1(t),o=!r&&!n&&!i&&g1(t),s=r||n||i||o,a=s?pIe(t.length,String):[],c=a.length;for(var l in t)(e||qs.call(t,l))&&!(s&&(l=="length"||i&&(l=="offset"||l=="parent")||o&&(l=="buffer"||l=="byteLength"||l=="byteOffset")||A1(l,c)))&&a.push(l);return a}function T0(t,e,r){(r!==void 0&&!My(t[e],r)||r===void 0&&!(e in t))&&N0(t,e,r)}function YIe(t,e,r){var n=t[e];(!(qs.call(t,e)&&My(n,r))||r===void 0&&!(e in t))&&N0(t,e,r)}function Oy(t,e){for(var r=t.length;r--;)if(My(t[r][0],e))return r;return-1}function N0(t,e,r){e=="__proto__"&&Ry?Ry(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var VIe=aCe();function xy(t){return t==null?t===void 0?WEe:qEe:Vc&&Vc in Object(t)?cCe(t):fCe(t)}function XF(t){return _p(t)&&xy(t)==r1}function WIe(t){if(!Jc(t)||ACe(t))return!1;var e=U0(t)?IIe:lIe;return e.test(yCe(t))}function JIe(t){return _p(t)&&h1(t.length)&&!!Qt[xy(t)]}function ZIe(t){if(!Jc(t))return pCe(t);var e=p1(t),r=[];for(var n in t)n=="constructor"&&(e||!qs.call(t,n))||r.push(n);return r}function d1(t,e,r,n,i){t!==e&&VIe(e,function(o,s){if(i||(i=new $u),Jc(o))KIe(t,e,s,r,d1,n,i);else{var a=n?n(D0(t,s),o,s+"",t,e,i):void 0;a===void 0&&(a=o),T0(t,s,a)}},m1)}function KIe(t,e,r,n,i,o,s){var a=D0(t,r),c=D0(e,r),l=s.get(c);if(l){T0(t,r,l);return}var u=o?o(a,c,r+"",t,e,s):void 0,d=u===void 0;if(d){var A=k0(c),p=!A&&f1(c),f=!A&&!p&&g1(c);u=c,A||p||f?k0(a)?u=a:ECe(a)?u=iCe(a):p?(d=!1,u=tCe(c,!0)):f?(d=!1,u=nCe(c,!0)):u=[]:ICe(c)||R0(c)?(u=a,R0(a)?u=CCe(a):(!Jc(a)||U0(a))&&(u=lCe(c))):d=!1}d&&(s.set(c,u),i(u,c,n,o,s),s.delete(c)),T0(t,r,u)}function XIe(t,e){return gCe(hCe(t,e,y1),t+"")}var eCe=Ry?function(t,e){return Ry(t,"toString",{configurable:!0,enumerable:!1,value:SCe(e),writable:!0})}:y1;function tCe(t,e){if(e)return t.slice();var r=t.length,n=JF?JF(r):new t.constructor(r);return t.copy(n),n}function rCe(t){var e=new t.constructor(t.byteLength);return new WF(e).set(new WF(t)),e}function nCe(t,e){var r=e?rCe(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function iCe(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function oCe(t,e,r,n){var i=!r;r||(r={});for(var o=-1,s=e.length;++o<s;){var a=e[o],c=n?n(r[a],t[a],a,r,t):void 0;c===void 0&&(c=t[a]),i?N0(r,a,c):YIe(r,a,c)}return r}function sCe(t){return XIe(function(e,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,s=i>2?r[2]:void 0;for(o=t.length>3&&typeof o=="function"?(i--,o):void 0,s&&uCe(r[0],r[1],s)&&(o=i<3?void 0:o,i=1),e=Object(e);++n<i;){var a=r[n];a&&t(e,a,n,o)}return e})}function aCe(t){return function(e,r,n){for(var i=-1,o=Object(e),s=n(e),a=s.length;a--;){var c=s[t?a:++i];if(r(o[c],c,o)===!1)break}return e}}function Uy(t,e){var r=t.__data__;return dCe(e)?r[typeof e=="string"?"string":"hash"]:r.map}function O0(t,e){var r=hIe(t,e);return WIe(r)?r:void 0}function cCe(t){var e=qs.call(t,Vc),r=t[Vc];try{t[Vc]=void 0;var n=!0}catch{}var i=c1.call(t);return n&&(e?t[Vc]=r:delete t[Vc]),i}function lCe(t){return typeof t.constructor=="function"&&!p1(t)?_Ie(l1(t)):{}}function A1(t,e){var r=typeof t;return e=e??t1,!!e&&(r=="number"||r!="symbol"&&uIe.test(t))&&t>-1&&t%1==0&&t<e}function uCe(t,e,r){if(!Jc(r))return!1;var n=typeof e;return(n=="number"?x0(r)&&A1(e,r.length):n=="string"&&e in r)?My(r[e],t):!1}function dCe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ACe(t){return!!YF&&YF in t}function p1(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||ky;return t===r}function pCe(t){var e=[];if(t!=null)for(var r in Object(t))e.push(r);return e}function fCe(t){return c1.call(t)}function hCe(t,e,r){return e=KF(e===void 0?t.length-1:e,0),function(){for(var n=arguments,i=-1,o=KF(n.length-e,0),s=Array(o);++i<o;)s[i]=n[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=n[i];return a[e]=r(s),AIe(t,this,a)}}function D0(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}var gCe=mCe(eCe);function mCe(t){var e=0,r=0;return function(){var n=wIe(),i=xEe-(n-r);if(r=n,i>0){if(++e>=OEe)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function yCe(t){if(t!=null){try{return Ny.call(t)}catch{}try{return t+""}catch{}}return""}function My(t,e){return t===e||t!==t&&e!==e}var R0=XF((function(){return arguments})())?XF:function(t){return _p(t)&&qs.call(t,"callee")&&!CIe.call(t,"callee")},k0=Array.isArray;function x0(t){return t!=null&&h1(t.length)&&!U0(t)}function ECe(t){return _p(t)&&x0(t)}var f1=SIe||wCe;function U0(t){if(!Jc(t))return!1;var e=xy(t);return e==n1||e==FEe||e==MEe||e==HEe}function h1(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=t1}function Jc(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function _p(t){return t!=null&&typeof t=="object"}function ICe(t){if(!_p(t)||xy(t)!=i1)return!1;var e=l1(t);if(e===null)return!0;var r=qs.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&Ny.call(r)==EIe}var g1=GF?fIe(GF):JIe;function CCe(t){return oCe(t,m1(t))}function m1(t){return x0(t)?GIe(t,!0):ZIe(t)}var bCe=sCe(function(t,e,r){d1(t,e,r)});function SCe(t){return function(){return t}}function y1(t){return t}function wCe(){return!1}Pu.exports=bCe});var N1=I((kqe,k1)=>{"use strict";var S1=200,L0="__lodash_hash_undefined__",_Ce=1/0,BCe=9007199254740991,vCe="[object Function]",QCe="[object GeneratorFunction]",TCe=/[\\^$.*+?()[\]{}|]/g,DCe=/^\[object .+?Constructor\]$/,RCe=typeof global=="object"&&global&&global.Object===Object&&global,kCe=typeof self=="object"&&self&&self.Object===Object&&self,$0=RCe||kCe||Function("return this")();function NCe(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function OCe(t,e){for(var r=-1,n=t?t.length:0,i=0,o=[];++r<n;){var s=t[r];e(s,r,t)&&(o[i++]=s)}return o}function w1(t,e){var r=t?t.length:0;return!!r&&PCe(t,e,0)>-1}function _1(t,e,r){for(var n=-1,i=t?t.length:0;++n<i;)if(r(e,t[n]))return!0;return!1}function xCe(t,e){for(var r=-1,n=t?t.length:0,i=Array(n);++r<n;)i[r]=e(t[r],r,t);return i}function UCe(t,e){for(var r=-1,n=e.length,i=t.length;++r<n;)t[i+r]=e[r];return t}function MCe(t,e,r,n){for(var i=t.length,o=r+(n?1:-1);n?o--:++o<i;)if(e(t[o],o,t))return o;return-1}function PCe(t,e,r){if(e!==e)return MCe(t,LCe,r);for(var n=r-1,i=t.length;++n<i;)if(t[n]===e)return n;return-1}function LCe(t){return t!==t}function $Ce(t){return function(e){return t(e)}}function B1(t,e){return t.has(e)}function FCe(t,e){return t?.[e]}function jCe(t){var e=!1;if(t!=null&&typeof t.toString!="function")try{e=!!(t+"")}catch{}return e}function v1(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var zCe=Array.prototype,qCe=Function.prototype,Q1=Object.prototype,M0=$0["__core-js_shared__"],I1=(function(){var t=/[^.]+$/.exec(M0&&M0.keys&&M0.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})(),T1=qCe.toString,F0=Q1.hasOwnProperty,HCe=Q1.toString,GCe=RegExp("^"+T1.call(F0).replace(TCe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),YCe=zCe.splice,C1=Math.max,VCe=j0($0,"Map"),P0=j0($0,"Set"),Bp=j0(Object,"create");function Zc(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function WCe(){this.__data__=Bp?Bp(null):{}}function JCe(t){return this.has(t)&&delete this.__data__[t]}function ZCe(t){var e=this.__data__;if(Bp){var r=e[t];return r===L0?void 0:r}return F0.call(e,t)?e[t]:void 0}function KCe(t){var e=this.__data__;return Bp?e[t]!==void 0:F0.call(e,t)}function XCe(t,e){var r=this.__data__;return r[t]=Bp&&e===void 0?L0:e,this}Zc.prototype.clear=WCe;Zc.prototype.delete=JCe;Zc.prototype.get=ZCe;Zc.prototype.has=KCe;Zc.prototype.set=XCe;function Fu(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ebe(){this.__data__=[]}function tbe(t){var e=this.__data__,r=Py(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():YCe.call(e,r,1),!0}function rbe(t){var e=this.__data__,r=Py(e,t);return r<0?void 0:e[r][1]}function nbe(t){return Py(this.__data__,t)>-1}function ibe(t,e){var r=this.__data__,n=Py(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}Fu.prototype.clear=ebe;Fu.prototype.delete=tbe;Fu.prototype.get=rbe;Fu.prototype.has=nbe;Fu.prototype.set=ibe;function ju(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function obe(){this.__data__={hash:new Zc,map:new(VCe||Fu),string:new Zc}}function sbe(t){return Ly(this,t).delete(t)}function abe(t){return Ly(this,t).get(t)}function cbe(t){return Ly(this,t).has(t)}function lbe(t,e){return Ly(this,t).set(t,e),this}ju.prototype.clear=obe;ju.prototype.delete=sbe;ju.prototype.get=abe;ju.prototype.has=cbe;ju.prototype.set=lbe;function vp(t){var e=-1,r=t?t.length:0;for(this.__data__=new ju;++e<r;)this.add(t[e])}function ube(t){return this.__data__.set(t,L0),this}function dbe(t){return this.__data__.has(t)}vp.prototype.add=vp.prototype.push=ube;vp.prototype.has=dbe;function Py(t,e){for(var r=t.length;r--;)if(Cbe(t[r][0],e))return r;return-1}function b1(t,e,r,n){var i=-1,o=w1,s=!0,a=t.length,c=[],l=e.length;if(!a)return c;r&&(e=xCe(e,$Ce(r))),n?(o=_1,s=!1):e.length>=S1&&(o=B1,s=!1,e=new vp(e));e:for(;++i<a;){var u=t[i],d=r?r(u):u;if(u=n||u!==0?u:0,s&&d===d){for(var A=l;A--;)if(e[A]===d)continue e;c.push(u)}else o(e,d,n)||c.push(u)}return c}function Abe(t){if(!R1(t)||ybe(t))return!1;var e=D1(t)||jCe(t)?GCe:DCe;return e.test(Ebe(t))}function pbe(t,e){return e=C1(e===void 0?t.length-1:e,0),function(){for(var r=arguments,n=-1,i=C1(r.length-e,0),o=Array(i);++n<i;)o[n]=r[e+n];n=-1;for(var s=Array(e+1);++n<e;)s[n]=r[n];return s[e]=o,NCe(t,this,s)}}function fbe(t,e,r){var n=-1,i=w1,o=t.length,s=!0,a=[],c=a;if(r)s=!1,i=_1;else if(o>=S1){var l=e?null:gbe(t);if(l)return v1(l);s=!1,i=B1,c=new vp}else c=e?[]:a;e:for(;++n<o;){var u=t[n],d=e?e(u):u;if(u=r||u!==0?u:0,s&&d===d){for(var A=c.length;A--;)if(c[A]===d)continue e;e&&c.push(d),a.push(u)}else i(c,d,r)||(c!==a&&c.push(d),a.push(u))}return a}function hbe(t,e,r){for(var n=-1,i=t.length;++n<i;)var o=o?UCe(b1(o,t[n],e,r),b1(t[n],o,e,r)):t[n];return o&&o.length?fbe(o,e,r):[]}var gbe=P0&&1/v1(new P0([,-0]))[1]==_Ce?function(t){return new P0(t)}:Bbe;function Ly(t,e){var r=t.__data__;return mbe(e)?r[typeof e=="string"?"string":"hash"]:r.map}function j0(t,e){var r=FCe(t,e);return Abe(r)?r:void 0}function mbe(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function ybe(t){return!!I1&&I1 in t}function Ebe(t){if(t!=null){try{return T1.call(t)}catch{}try{return t+""}catch{}}return""}var Ibe=pbe(function(t){return hbe(OCe(t,Sbe))});function Cbe(t,e){return t===e||t!==t&&e!==e}function bbe(t){return t!=null&&wbe(t.length)&&!D1(t)}function Sbe(t){return _be(t)&&bbe(t)}function D1(t){var e=R1(t)?HCe.call(t):"";return e==vCe||e==QCe}function wbe(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=BCe}function R1(t){var e=typeof t;return!!t&&(e=="object"||e=="function")}function _be(t){return!!t&&typeof t=="object"}function Bbe(){}k1.exports=Ibe});var O1=I(Gs=>{"use strict";var G0=Gs&&Gs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Gs,"__esModule",{value:!0});Gs.toJsonSchema=kbe;Gs.convertRequiredToArray=Qp;Gs.generateDefaultFromSchema=Tp;Gs.parseJsonSafe=$y;Gs.normalizeToolSchemas=Nbe;var z0=G0(qF()),q0=G0(E1()),vbe=G0(N1());function zu(t,e){if(t===e)return!0;if(t===null||e===null||typeof t!="object"||typeof e!="object"||Array.isArray(t)!==Array.isArray(e))return!1;let r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;let i=e;return r.every(o=>o in i&&zu(t[o],i[o]))}var Qbe={required:!1,requiredDepth:Number.POSITIVE_INFINITY,postProcessFnc:null,strings:{preProcessFnc:null},arrays:{mode:"all"},objects:{preProcessFnc:null,postProcessFnc:null,additionalProperties:!0}},Tbe={string:function(e){return typeof e=="string"},number:function(e){return typeof e=="number"&&isFinite(e)},integer:function(e){return typeof e=="number"&&e%1===0},boolean:function(e){return typeof e=="boolean"},array:function(e){return e instanceof Array},null:function(e){return e===null},date:function(e){return e instanceof Date},any:function(e){return!0},object:function(e){return e&&typeof e=="object"&&!(e instanceof Array)&&!(e instanceof Date)}},qu={typeNames:["integer","number","string","array","object","boolean","null","date"],getType(t){return qu.typeNames.find(e=>Tbe[e](t))},mergeSchemaObjs(t,e){if(!t||!e)return null;let r=(0,z0.default)(t),n=(0,z0.default)(e);if(!zu(r,n)){if(t.type==="array"&&e.type==="array"&&zu((0,vbe.default)(r,n),["items"])){let o=r.length>n.length?e:t,s=r.length>n.length?t:e;if((0,z0.default)(o).reduce((c,l)=>zu(o[l],s[l])&&c,!0))return o}if(t.type!=="object"||e.type!=="object")return null}let i={};for(let o=0,{length:s}=r;o<s;o++){let a=r[o];if(qu.getType(t[a])==="object"){let c=qu.mergeSchemaObjs(t[a],e[a]);if(c)i[a]=c;else{if(t.type==="object"||e.type==="object")return{type:"object"};if(a!=="items"||t.type!=="array"||e.type!=="array")return null}}else if(a==="type")if(t[a]!==e[a])if(t[a]==="integer"&&e[a]==="number"||t[a]==="number"&&e[a]==="integer")i[a]="number";else return null;else i[a]=t[a];else{if(!zu(t[a],e[a]))return null;i[a]=t[a]}}return i}};function Dbe(t){let e;for(let r=0,{length:n}=t;r<n;r++){let i=t[r];if(r>0&&(i==="integer"&&e==="number"?i="number":i==="number"&&e==="integer"&&(e="number"),e!==i))return null;e=i}return e}function Rbe(t){return Dbe(t.map(e=>qu.getType(e)))}var H0=class{constructor(e){this.options=(0,q0.default)({},Qbe,e),this.depth=0,this.getObjectSchemaDefault=this.getObjectSchemaDefault.bind(this),this.getStringSchemaDefault=this.getStringSchemaDefault.bind(this),this.objectPostProcessDefault=this.objectPostProcessDefault.bind(this),this.commmonPostProcessDefault=this.commmonPostProcessDefault.bind(this),this.objectPostProcessDefault=this.objectPostProcessDefault.bind(this)}getCommonArrayItemSchema(e){let r=e.map(n=>{this.depth++;let i=this.getSchema(n);return this.depth--,i});return r.reduce((n,i)=>qu.mergeSchemaObjs(n,i),r.pop())}getObjectSchemaDefault(e){let r={type:"object"},n=Object.keys(e);return n.length>0&&(r.properties=n.reduce((i,o)=>(this.depth++,i[o]=this.getSchema(e[o]),this.depth--,i),{})),r}getObjectSchema(e){return this.options.objects.preProcessFnc?this.options.objects.preProcessFnc(e,this.getObjectSchemaDefault):this.getObjectSchemaDefault(e)}getArraySchemaMerging(e){let r={type:"array"},n=Rbe(e);if(n)if(r.items={type:n},n!=="integer"&&n!=="number"){let i=this.getCommonArrayItemSchema(e);i&&(r.items=i)}else this.options.required&&(r.items.required=!0);return r}getArraySchemaNoMerging(e){let r={type:"array"};return e.length>0&&(this.depth++,r.items=this.getSchema(e[0]),this.depth--),r}getArraySchemaTuple(e){let r={type:"array"};return e.length>0&&(r.items=e.map(n=>{this.depth++;let i=this.getSchema(n);return this.depth--,i})),r}getArraySchemaUniform(e){let r=this.getArraySchemaNoMerging(e);if(e.length>1)for(let n=1;n<e.length;n++){this.depth++;let i=this.getSchema(e[n]);if(this.depth--,!zu(r.items,i))throw new Error("Invalid schema, incompatible array items")}return r}getArraySchema(e){if(e.length===0)return{type:"array"};switch(this.options.arrays.mode){case"all":return this.getArraySchemaMerging(e);case"first":return this.getArraySchemaNoMerging(e);case"uniform":return this.getArraySchemaUniform(e);case"tuple":return this.getArraySchemaTuple(e);default:throw new Error(`Unknown array mode option '${this.options.arrays.mode}'`)}}getStringSchemaDefault(e){return{type:"string"}}getStringSchema(e){return this.options.strings.preProcessFnc?this.options.strings.preProcessFnc(e,this.getStringSchemaDefault):this.getStringSchemaDefault(e)}commmonPostProcessDefault(e,r,n){return this.options.required&&this.depth<=this.options.requiredDepth?(0,q0.default)({},r,{required:!0}):r}objectPostProcessDefault(e,r){return this.options.objects.additionalProperties===!1&&Object.getOwnPropertyNames(r).length>0?(0,q0.default)({},e,{additionalProperties:!1}):e}getSchema(e){let r=qu.getType(e);r||(r="null");let n;switch(r){case"object":n=this.getObjectSchema(e);break;case"array":n=this.getArraySchema(e);break;case"string":n=this.getStringSchema(e);break;default:n={type:r}}return this.options.postProcessFnc?n=this.options.postProcessFnc(r,n,e,this.commmonPostProcessDefault):n=this.commmonPostProcessDefault(r,n,e),r==="object"&&(this.options.objects.postProcessFnc?n=this.options.objects.postProcessFnc(n,e,this.objectPostProcessDefault):n=this.objectPostProcessDefault(n,e)),n}};function kbe(t,e){return new H0(e).getSchema(t)}function Qp(t){if(!t||typeof t!="object")return t;if(Array.isArray(t))return t.map(r=>Qp(r));let e={...t};if(delete e.required,e.properties&&typeof e.properties=="object"){let r=[],n={};for(let[i,o]of Object.entries(e.properties)){let s=o;if(s&&typeof s=="object"&&s.required===!0){r.push(i);let{required:a,...c}=s;n[i]=Qp(c)}else n[i]=Qp(s)}e.properties=n,r.length>0&&(e.required=r)}return e.items&&(e.items=Qp(e.items)),e}function Tp(t){if(!t||typeof t!="object")return null;if(t.const!==void 0)return t.const;if(t.enum&&Array.isArray(t.enum)&&t.enum.length>0)return t.enum[0];if(t.default!==void 0)return t.default;if(t.oneOf&&Array.isArray(t.oneOf)&&t.oneOf.length>0)return Tp(t.oneOf[0]);if(t.anyOf&&Array.isArray(t.anyOf)&&t.anyOf.length>0)return Tp(t.anyOf[0]);switch(Array.isArray(t.type)?t.type[0]:t.type){case"string":case"number":case"integer":case"boolean":return null;case"null":return null;case"array":return t.items?[]:[];case"object":let r={};if(t.properties&&typeof t.properties=="object"){let n=t.required||[];for(let[i,o]of Object.entries(t.properties))r[i]=Tp(o)}return r;default:if(t.properties&&typeof t.properties=="object"){let n={};for(let[i,o]of Object.entries(t.properties))n[i]=Tp(o);return n}return null}}function $y(t){if(typeof t!="string")return t;try{return JSON.parse(t)}catch{return t}}function Nbe(t){let e={...t};return e.inputSchema&&(e.inputSchema=$y(e.inputSchema)),e.outputSchema&&(e.outputSchema=$y(e.outputSchema)),e.responseSchema&&(e.responseSchema=$y(e.responseSchema)),e}});var U1=I(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.ADD_VALID_INVITE_MESSAGE=void 0;yr.normalizeInvitationEmail=Kc;yr.isValidInvitationEmail=V0;yr.isOrganizationInviteRole=x1;yr.parseOrganizationInviteRole=Ube;yr.getInvitationTimestamp=Mbe;yr.createInviteRow=Pbe;yr.isInviteRowEmpty=W0;yr.isInviteRowEmailInvalid=Lbe;yr.validateInviteRows=$be;yr.getInviteValidationMessage=Fbe;yr.getInviteRowsForEmails=jbe;yr.mapInvitationsToRows=zbe;yr.formatEmailList=Y0;yr.isStaleInvitationError=qbe;var Obe=yu();yr.ADD_VALID_INVITE_MESSAGE="Add at least one valid invite.";var xbe=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;function Kc(t){return t.trim().toLowerCase()}function V0(t){return xbe.test(Kc(t))}function x1(t){return t==="member"||t==="admin"}function Ube(t){return t?x1(t)?t:null:"member"}function Mbe(t){if(!t)return 0;let e=(0,Obe.getUTCTimestampMs)(t);return Number.isFinite(e)?e:0}function Pbe(t,e){return{id:t,email:"",role:"member",...e?.length?{targetOrgIds:e}:{}}}function W0(t){return!t.email.trim()&&t.role==="member"}function Lbe(t,e){let r=Kc(t.email);return r?V0(r)?e.filter(n=>Kc(n.email)===r).length>1:!0:!W0(t)}function $be(t){let e=new Set,r=[],n=[],i=[],o=0;for(let s of t){let a=Kc(s.email);if(!a){W0(s)||(o+=1);continue}if(!V0(a)){n.push(a);continue}if(e.has(a)){i.push(a);continue}if(e.add(a),s.targetOrgIds?.length)for(let c of s.targetOrgIds)r.push({email:a,role:s.role,targetOrgId:c});else r.push({email:a,role:s.role})}return{invitations:r,invalidEmails:n,duplicateEmails:i,incompleteRows:o}}function Fbe(t){return t.invalidEmails.length>0?`Fix invalid email: ${Y0(t.invalidEmails)}`:t.duplicateEmails.length>0?`Remove duplicate email: ${Y0(t.duplicateEmails)}`:t.incompleteRows>0?"Check invite rows.":t.invitations.length===0?yr.ADD_VALID_INVITE_MESSAGE:null}function jbe(t,e){let r=new Set(e.map(Kc));return t.filter(n=>r.has(Kc(n.email)))}function zbe(t,e){let r=new Map;for(let n of t){let i=r.get(n.email);if(i){n.targetOrgId&&!i.targetOrgIds?.includes(n.targetOrgId)&&(i.targetOrgIds=[...i.targetOrgIds??[],n.targetOrgId]);continue}r.set(n.email,{id:e(),email:n.email,role:n.role,...n.targetOrgId?{targetOrgIds:[n.targetOrgId]}:{}})}return[...r.values()]}function Y0(t){return t.length<=3?t.join(", "):`${t.slice(0,3).join(", ")} and ${t.length-3} more`}function qbe(t){if(!(t instanceof Error))return!1;let e=t.message.toLowerCase();return e.includes("pending invitation not found")||e.includes("invitation has expired")}});var J0=I(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.STORAGE_URI_SCHEME=void 0;Ys.isStorageUri=Gbe;Ys.parseStorageUri=Ybe;Ys.formatStorageUri=Vbe;Ys.STORAGE_URI_SCHEME="s3://";var Hbe=/^s3:\/\/([^/]+)\/(.+)$/;function Gbe(t){return!!t&&t.startsWith(Ys.STORAGE_URI_SCHEME)}function Ybe(t){let e=t.match(Hbe);return e?{bucket:e[1],key:e[2]}:null}function Vbe(t,e){return`${Ys.STORAGE_URI_SCHEME}${t}/${e}`}});var M1=I(An=>{"use strict";Object.defineProperty(An,"__esModule",{value:!0});An.ORG_LOGO_STORAGE_PATH=An.LOGO_CONTENT_TYPE=An.LOGO_CANVAS_SIZE=An.ACCEPTED_LOGO_MIME_TYPES=An.UPLOADED_LOGO_TOKEN=void 0;An.isLibraryIconToken=Zbe;An.isStoredLogo=Kbe;var Wbe=J0();An.UPLOADED_LOGO_TOKEN="upload:custom";var Jbe=["lucide:","simpleicons:"];function Zbe(t){return!!t&&Jbe.some(e=>t.startsWith(e))}function Kbe(t){return(0,Wbe.isStorageUri)(t)}An.ACCEPTED_LOGO_MIME_TYPES=["image/png","image/jpeg","image/webp"];An.LOGO_CANVAS_SIZE=512;An.LOGO_CONTENT_TYPE="image/png";An.ORG_LOGO_STORAGE_PATH="org/logo.png"});var L1=I(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.MCP_SERVER_NAME_MAX_LENGTH=Ln.MCP_SERVER_NAME_MIN_LENGTH=void 0;Ln.sanitizeMcpServerNameInput=P1;Ln.slugifyMcpServerName=tSe;Ln.validateMcpServerName=rSe;Ln.MCP_SERVER_NAME_MIN_LENGTH=2;Ln.MCP_SERVER_NAME_MAX_LENGTH=63;var Xbe=/^[a-z0-9][a-z0-9-]*[a-z0-9]$/,eSe=new Set([".well-known","oauth","health","register"]);function P1(t){return t.toLowerCase().replace(/[^a-z0-9-]/g,"-").replace(/-+/g,"-")}function tSe(t){return P1(t).replace(/^-|-$/g,"")}function rSe(t){return!t||t.length<Ln.MCP_SERVER_NAME_MIN_LENGTH||t.length>Ln.MCP_SERVER_NAME_MAX_LENGTH?`Name must be between ${Ln.MCP_SERVER_NAME_MIN_LENGTH} and ${Ln.MCP_SERVER_NAME_MAX_LENGTH} characters`:Xbe.test(t)?eSe.has(t)?`Name '${t}' is reserved`:null:"Name must contain only lowercase letters, numbers, and hyphens, and must start and end with a letter or number"}});var $1=I(Pa=>{"use strict";Object.defineProperty(Pa,"__esModule",{value:!0});Pa.MEMORY_NOTE_MAX_CHARS=Pa.MEMORY_NOTE_SCOPES=void 0;Pa.isMemoryNoteScope=nSe;Pa.MEMORY_NOTE_SCOPES=["user","org"];Pa.MEMORY_NOTE_MAX_CHARS=500;function nSe(t){return typeof t=="string"&&Pa.MEMORY_NOTE_SCOPES.includes(t)}});var Z0=I(Dp=>{"use strict";Object.defineProperty(Dp,"__esModule",{value:!0});Dp.SUPERGLUE_LOGO_SVG=void 0;Dp.parseLegacyBrandGuidelines=iSe;function iSe(t){let e=t.brand;if(!e||typeof e!="object"||Array.isArray(e))return null;let r=e.guidelines;return typeof r=="string"&&r.trim()?r:null}Dp.SUPERGLUE_LOGO_SVG='<svg viewBox="72 206 9240 2552" height="22" role="img" aria-label="superglue" xmlns="http://www.w3.org/2000/svg" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:1.5"><g><path d="M9207.13,1482.19c0,-646.571 -524.934,-1171.51 -1171.51,-1171.51l-6687.56,-0c-646.571,-0 -1171.51,524.934 -1171.51,1171.51c0,646.571 524.934,1171.51 1171.51,1171.51l6687.56,0c646.571,0 1171.51,-524.934 1171.51,-1171.51Z" style="fill:#fff;stroke:#000;stroke-width:208.33px;"/><g><path d="M1207.81,2068.52l390.187,-0l1.044,-130.41l129.367,-0l-0,-390.188l-130.411,-0l0,-130.411l-130.41,0l-0,-130.41l-130.41,0l1.043,-261.864l259.777,0l0,-129.367l-390.187,0l-0,129.367l-130.411,1.043l0,390.188l130.411,0l-0,130.411l130.41,-0l-0,130.41l130.41,-0l0,260.821l-260.82,-0l-0,130.41Zm-130.411,-130.41l129.367,-0l0,-129.367l-129.367,-0l0,129.367Zm521.642,-782.463l129.367,0l-0,-129.367l-129.367,0l-0,129.367Z" style="fill-rule:nonzero;"/><path d="M1948.54,2068.52l520.599,-0l1.043,-130.41l129.367,-0l-0,-1042.24l-259.778,0l0,1042.24l-261.864,1.043l0,-1043.28l-259.777,0l0,1042.24l130.41,-0l0,130.41Z" style="fill-rule:nonzero;"/><path d="M2689.27,2068.52l259.778,-0l1.043,-521.641l390.188,-0l1.043,-130.411l129.367,0l0,-390.188l-130.41,0l-0,-130.41l-129.367,0l-0,520.598l-261.864,1.043l1.043,-392.274l259.777,0l0,-129.367l-520.598,0l0,1172.65Z" style="fill-rule:nonzero;"/><path d="M3560.41,2068.52l651.009,-0l-0,-129.367l-391.231,-0l1.043,-392.274l259.778,-0l-0,-129.368l-260.821,0l1.043,-392.274l390.188,0l-0,-129.367l-651.009,0l0,1172.65Z" style="fill-rule:nonzero;"/><path d="M4301.14,2068.52l259.778,-0l1.043,-521.641l260.821,-0l-0,521.641l259.777,-0l0,-520.598l-130.41,-0l1.043,-131.454l129.367,0l0,-390.188l-130.41,0l-0,-130.41l-129.367,0l-0,520.598l-261.864,1.043l1.043,-392.274l259.777,0l0,-129.367l-520.598,0l0,1172.65Z" style="fill-rule:nonzero;"/><path d="M5302.69,2068.52l520.598,-0l1.043,-130.41l129.367,-0l0,-520.599l-259.777,0l-0,520.599l-261.864,1.043l1.043,-913.916l390.188,0l-0,-129.367l-520.598,0l-0,129.367l-130.411,1.043l0,911.83l130.411,-0l-0,130.41Zm521.641,-912.873l129.367,0l0,-129.367l-129.367,0l0,129.367Z" style="fill-rule:nonzero;"/><path d="M6043.42,2068.52l651.008,-0l0,-129.367l-391.231,-0l0,-1043.28l-259.777,0l-0,1172.65Z" style="fill-rule:nonzero;"/><path d="M6914.56,2068.52l520.598,-0l1.043,-130.41l129.367,-0l0,-1042.24l-259.777,0l-0,1042.24l-261.864,1.043l-0,-1043.28l-259.777,0l-0,1042.24l130.41,-0l-0,130.41Z" style="fill-rule:nonzero;"/><path d="M7655.29,2068.52l651.008,-0l0,-129.367l-391.231,-0l1.043,-392.274l259.778,-0l-0,-129.368l-260.821,0l1.043,-392.274l390.188,0l0,-129.367l-651.008,0l-0,1172.65Z" style="fill-rule:nonzero;"/></g></g></svg>'});var K0=I(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.designCustomCssSchema=Jt.designStyleSchema=Jt.DESIGN_CUSTOM_CSS_MAX_CHARS=Jt.DESIGN_STYLE_OPTIONS=void 0;Jt.compileDesignStyleCss=cSe;Jt.hasDesignStyle=lSe;var $n=ga();Jt.DESIGN_STYLE_OPTIONS={header:["rule","band","minimal","centered"],surfaces:["outline","shadow","filled","flat","accent-top","accent-left"],headingCase:["none","upper"],headingDecoration:["none","underline","bar"],tables:["lines","grid","striped","header-filled"],buttons:["rounded","pill","square"],density:["compact","regular","airy"],bullets:["disc","dash","arrow","square"]};Jt.DESIGN_CUSTOM_CSS_MAX_CHARS=2e4;var oSe=/<|url\s*\(|@import|expression\s*\(|javascript:|behavior\s*:|-moz-binding/i;Jt.designStyleSchema=$n.z.object({header:$n.z.enum(Jt.DESIGN_STYLE_OPTIONS.header).optional(),surfaces:$n.z.enum(Jt.DESIGN_STYLE_OPTIONS.surfaces).optional(),headingCase:$n.z.enum(Jt.DESIGN_STYLE_OPTIONS.headingCase).optional(),headingDecoration:$n.z.enum(Jt.DESIGN_STYLE_OPTIONS.headingDecoration).optional(),headingWeight:$n.z.number().int().min(100).max(900).optional(),headingTracking:$n.z.number().min(-.08).max(.3).optional(),headingScale:$n.z.number().min(.8).max(1.5).optional(),tables:$n.z.enum(Jt.DESIGN_STYLE_OPTIONS.tables).optional(),buttons:$n.z.enum(Jt.DESIGN_STYLE_OPTIONS.buttons).optional(),density:$n.z.enum(Jt.DESIGN_STYLE_OPTIONS.density).optional(),bullets:$n.z.enum(Jt.DESIGN_STYLE_OPTIONS.bullets).optional()}).describe("Component and layout style: header (rule, band, minimal, centered), surfaces for cards and KPI tiles (outline, shadow, filled, flat, accent-top, accent-left), headingCase (none, upper), headingDecoration (none, underline, bar), headingWeight 100-900, headingTracking in em (-0.08 to 0.3), headingScale (0.8 to 1.5), tables (lines, grid, striped, header-filled), buttons (rounded, pill, square), density (compact, regular, airy), bullets (disc, dash, arrow, square).");Jt.designCustomCssSchema=$n.z.string().max(Jt.DESIGN_CUSTOM_CSS_MAX_CHARS).refine(t=>!oSe.test(t),{message:"Custom CSS cannot contain <, url(), @import, expression(), or javascript:"}).describe("Extra CSS applied to every artifact after the theme. Style the sg-* classes and elements; no url(), @import, or <.");var F1=".sg-card,.sg-kpi,.sg-callout,.sg-table",sSe={dash:"\u2013",arrow:"\u2192"},aSe={header:{band:".sg-header{background:var(--sg-header-bg);color:var(--sg-header-ink);border:0;padding:18px 24px;border-radius:var(--sg-radius-xl)}.sg-header .sg-header-title,.sg-header .sg-header-meta,.sg-header .sg-eyebrow{color:inherit}.sg-header .sg-header-meta{opacity:.85}",minimal:".sg-header{border-bottom:0;padding-bottom:0}",centered:".sg-header{flex-direction:column;align-items:center;text-align:center;gap:10px}.sg-header .sg-header-meta{margin-left:0}main>h1,main>h1+p,.sg-header+h1,.sg-header+.sg-eyebrow,.sg-eyebrow+h1{text-align:center}"},surfaces:{shadow:`${F1}{border-color:transparent;box-shadow:0 1px 2px rgb(0 0 0/.06),0 6px 18px rgb(0 0 0/.08)}`,filled:`${F1}{background:var(--sg-surface-2);border-color:transparent;box-shadow:none}`,flat:".sg-card,.sg-kpi{background:transparent;border-color:transparent;box-shadow:none;padding-left:0;padding-right:0}.sg-callout{background:transparent;box-shadow:none}","accent-top":".sg-card,.sg-kpi{border-top:4px solid var(--sg-primary)}","accent-left":".sg-card,.sg-kpi{border-left:4px solid var(--sg-primary)}"},headingCase:{upper:"h1,h2,h3,.sg-kpi-label,.sg-table th{text-transform:uppercase}"},headingDecoration:{underline:"h2{padding-bottom:6px;border-bottom:2px solid var(--sg-primary)}",bar:'h2::before{content:"";display:block;width:40px;height:4px;margin:0 0 10px;background:var(--sg-primary);border-radius:2px}'},tables:{grid:".sg-table th,.sg-table td{border-right:1px solid var(--sg-line-2)}.sg-table th:last-child,.sg-table td:last-child{border-right:0}",striped:".sg-table tbody tr:nth-child(even) td{background:var(--sg-surface)}","header-filled":".sg-table th{background:var(--sg-primary);color:var(--sg-on-primary)}"},buttons:{pill:".sg-button{border-radius:999px}",square:".sg-button{border-radius:0}.sg-badge{border-radius:2px}"},density:{compact:"body{line-height:1.45}.sg-card,.sg-kpi{padding:10px 12px}.sg-grid{gap:8px}.sg-header{margin-bottom:16px}h2{margin-top:18px}",airy:"body{line-height:1.7}.sg-card,.sg-kpi{padding:22px 26px}.sg-grid{gap:20px}.sg-header{margin-bottom:36px}h2{margin-top:40px}"},bullets:{square:"main ul{list-style:square}"}};function cSe(t){if(!t)return"";let e=[];for(let i of Object.keys(Jt.DESIGN_STYLE_OPTIONS)){let o=t[i];if(!o)continue;let s=aSe[i][o];s&&e.push(s)}let r=t.bullets?sSe[t.bullets]:void 0;r&&e.push(`main ul{list-style:none;padding-left:1.4em}main ul>li{position:relative}main ul>li::before{content:"${r}";position:absolute;left:-1.4em;color:var(--sg-accent)}`);let n=[];return t.headingWeight!==void 0&&n.push(`font-weight:${t.headingWeight}`),t.headingTracking!==void 0&&n.push(`letter-spacing:${t.headingTracking}em`),n.length&&e.push(`h1,h2,h3{${n.join(";")}}`),t.headingScale!==void 0&&e.push(`:root{--sg-heading-scale:${t.headingScale}}`),e.join(`
931
931
  `)}function lSe(t){return!!t&&Object.values(t).some(e=>e!==void 0)}});var r2=I(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.SUPERGLUE_ATTRIBUTION_TEXT=ue.SUPERGLUE_ATTRIBUTION_URL=ue.DESIGN_LOGO_SLOT_REFERENCES=ue.designTokensSchema=ue.designFontRoleSchema=ue.designColorSchema=ue.DESIGN_FONT_FAMILY_PATTERN=ue.DESIGN_THEME_FONT_MAX_BYTES=ue.DESIGN_ASSET_LIMITS=ue.DESIGN_TEMPLATE_FORMATS=ue.DESIGN_LOGO_VARIANTS=ue.DESIGN_ASSET_KINDS=ue.DESIGN_FONT_CONTENT_TYPES=ue.DESIGN_FONT_FORMATS=ue.DESIGN_FONT_ROLES=ue.DESIGN_COLOR_ROLE_LABELS=ue.DESIGN_COLOR_ROLES=ue.DESIGN_CHART_COLOR_COUNT=ue.DESIGN_ASSET_DESCRIPTION_MAX_CHARS=ue.DESIGN_ASSET_NAME_MAX_CHARS=ue.DESIGN_GUIDELINES_MAX_CHARS=void 0;ue.applyThemeLogos=Y1;ue.hasDarkHeaderBand=V1;ue.isDeckArtifactHtml=ySe;ue.isDesignSystemEmpty=ESe;ue.hasDesignTokens=X0;ue.designFontStack=Fy;ue.relativeLuminance=W1;ue.isDarkColor=J1;ue.superglueFontRoles=Z1;ue.compileDesignSystemCss=wSe;ue.buildDesignFontFaceCss=K1;ue.selectThemeFontsForHtml=X1;ue.buildDesignThemeStyle=e2;ue.superglueLogoDataUri=TSe;ue.organizationThemeLogo=DSe;ue.injectArtifactAttribution=t2;ue.decorateArtifactHtml=NSe;var Gi=ga(),uSe=b0(),dSe=vu(),q1=I0(),ASe=Z0(),jy=K0(),H1=wy();ue.DESIGN_GUIDELINES_MAX_CHARS=8e3;ue.DESIGN_ASSET_NAME_MAX_CHARS=120;ue.DESIGN_ASSET_DESCRIPTION_MAX_CHARS=500;ue.DESIGN_CHART_COLOR_COUNT=8;ue.DESIGN_COLOR_ROLES=["background","surface","text","mutedText","border","primary","onPrimary","accent","link","success","warning","danger"];ue.DESIGN_COLOR_ROLE_LABELS={background:"Page background",surface:"Cards and panels",text:"Text",mutedText:"Secondary text",border:"Borders",primary:"Brand color",onPrimary:"Text on brand color",accent:"Second brand color",link:"Links",success:"Success",warning:"Warning",danger:"Error"};ue.DESIGN_FONT_ROLES=["heading","body","mono"];ue.DESIGN_FONT_FORMATS=["woff2","woff","ttf","otf"];ue.DESIGN_FONT_CONTENT_TYPES={woff2:"font/woff2",woff:"font/woff",ttf:"font/ttf",otf:"font/otf"};ue.DESIGN_ASSET_KINDS=["logo","font","template","reference"];ue.DESIGN_LOGO_VARIANTS=["on-dark","icon"];ue.DESIGN_TEMPLATE_FORMATS=["html","docx","pptx"];ue.DESIGN_ASSET_LIMITS={logo:{maxCount:ue.DESIGN_LOGO_VARIANTS.length,maxBytes:10*1024*1024},font:{maxCount:8,maxBytes:1024*1024},template:{maxCount:20,maxBytes:20*1024*1024},reference:{maxCount:30,maxBytes:50*1024*1024}};ue.DESIGN_THEME_FONT_MAX_BYTES=3*1024*1024;var pSe=/^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/;ue.DESIGN_FONT_FAMILY_PATTERN=/^[\p{L}\p{N} ._&+-]{1,80}$/u;var fSe=/^[\p{L}\p{N} ,._"'-]{1,200}$/u;ue.designColorSchema=Gi.z.string().trim().regex(pSe,"Use a hex color such as #1a2b3c");ue.designFontRoleSchema=Gi.z.object({family:Gi.z.string().trim().regex(ue.DESIGN_FONT_FAMILY_PATTERN,"Use a plain font family name without quotes"),fallback:Gi.z.string().trim().regex(fSe,"Use a CSS font stack such as Arial, sans-serif").optional()});ue.designTokensSchema=Gi.z.object({colors:Gi.z.partialRecord(Gi.z.enum(ue.DESIGN_COLOR_ROLES),ue.designColorSchema).optional().describe(`Hex color per role: ${ue.DESIGN_COLOR_ROLES.join(", ")}.`),chart:Gi.z.array(ue.designColorSchema).max(ue.DESIGN_CHART_COLOR_COUNT).optional().describe("Data-series colors in order, at most 8."),fonts:Gi.z.partialRecord(Gi.z.enum(ue.DESIGN_FONT_ROLES),ue.designFontRoleSchema).optional().describe("Font per role (heading, body, mono): { family, fallback? } with the family name unquoted and an optional CSS fallback stack."),radius:Gi.z.number().int().min(0).max(32).optional().describe("Corner radius in px, 0-32."),style:jy.designStyleSchema.optional(),css:jy.designCustomCssSchema.optional()});ue.DESIGN_LOGO_SLOT_REFERENCES={primary:"design/logo","on-dark":"design/logo-on-dark",icon:"design/logo-icon"};var hSe=/<img\b(?:[^>"']|"[^"]*"|'[^']*')*\sdata-sg-logo\s*=\s*"(primary|on-dark|icon)"(?:[^>"']|"[^"]*"|'[^']*')*>/gi,G1=/<(header|div)\b[^>]*\sclass\s*=\s*"[^"]*\bsg-header\b[^"]*"[^>]*>[\s\S]*?<\/\1>/gi;function j1(t,e){return t.replace(hSe,(r,n)=>{let i=e(n);return i?r.replace(/\ssrc\s*=\s*("[^"]*"|'[^']*'|[^\s"'>]+)/i,` src="${i}"`):r})}function Y1(t,e){let r=e.header?t.replace(G1,n=>j1(n,i=>i==="primary"?e.header:void 0)):t;return j1(r,n=>e[n]??e.primary)}var gSe=/<img\b(?:[^>"']|"[^"]*"|'[^']*')*\sdata-sg-logo\s*=\s*"primary"(?:[^>"']|"[^"]*"|'[^']*')*>/i;function mSe(t,e){return e?t.replace(G1,r=>r.replace(gSe,n=>`${n.replace(/^<img\b/i,'<img data-sg-logo-mark=""')}<span class="sg-header-brand">${(0,dSe.escapeText)(e.name)}</span>`)):t}function V1(t){return t.style?.header==="band"&&J1(t.colors?.primary??H1.SUPERGLUE_DESIGN.colors.primary)}function ySe(t){return/<main\b[^>]*\bdata-sg-deck\b/i.test(t)}function ESe(t){return t?!t.guidelines&&t.assets.length===0&&!X0(t.tokens):!0}function X0(t){return t?Object.keys(t.colors??{}).length>0||(t.chart?.length??0)>0||Object.keys(t.fonts??{}).length>0||t.radius!==void 0||(0,jy.hasDesignStyle)(t.style)||!!t.css?.trim():!1}var ISe='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif',CSe="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace";function Fy(t,e){let r=e.fallback??(t==="mono"?CSe:ISe);return`"${e.family}", ${r}`}function bSe(t){let e=t.slice(1);return e.length===3&&(e=[...e].map(r=>r+r).join("")),[0,2,4].map(r=>parseInt(e.slice(r,r+2),16))}function W1(t){let e=bSe(t).map(r=>{let n=r/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4});return .2126*e[0]+.7152*e[1]+.0722*e[2]}function J1(t){return W1(t)<.18}var SSe={background:["--sg-bg"],surface:["--sg-surface"],text:["--sg-ink"],mutedText:["--sg-ink-2"],border:["--sg-line"],primary:["--sg-primary","--sg-ring"],onPrimary:["--sg-on-primary"],accent:["--sg-accent"],link:["--sg-link"],success:["--sg-success"],warning:["--sg-warning"],danger:["--sg-destructive"]};function Z1(t){let e=t.fonts??{};return ue.DESIGN_FONT_ROLES.filter(r=>!e[r]&&!(r==="heading"&&e.body))}function wSe(t,{htmlTemplates:e,hasOnDarkLogo:r}){let n=t.fonts?.heading?"h1,h2,h3,h4,h5,h6{font-family:var(--sg-font-heading)}":Z1(t).includes("heading")&&!e?H1.SUPERGLUE_HEADING_CSS:"";if(!X0(t))return n;let i=[],o=t.colors??{};for(let a of ue.DESIGN_COLOR_ROLES){let c=o[a];if(c)for(let l of SSe[a])i.push(`${l}:${c}`)}o.surface&&i.push(`--sg-surface-2:color-mix(in srgb,${o.surface} 92%,var(--sg-ink))`),o.mutedText&&i.push(`--sg-ink-3:color-mix(in srgb,${o.mutedText} 75%,var(--sg-bg))`),o.border&&(i.push(`--sg-line-2:color-mix(in srgb,${o.border} 60%,var(--sg-bg))`),i.push(`--sg-input:color-mix(in srgb,${o.border} 80%,var(--sg-ink))`)),o.primary&&i.push(`--sg-primary-hover:color-mix(in srgb,${o.primary} 85%,#000)`),(t.chart??[]).forEach((a,c)=>i.push(`--sg-chart-${c+1}:${a}`));let s=t.fonts??{};return s.body&&i.push(`--sg-font-sans:${Fy("body",s.body)}`),s.heading?i.push(`--sg-font-heading:${Fy("heading",s.heading)}`):s.body&&i.push("--sg-font-heading:var(--sg-font-sans)"),s.mono&&i.push(`--sg-font-mono:${Fy("mono",s.mono)}`),t.radius!==void 0&&(i.push(`--sg-radius:${t.radius}px`),i.push(`--sg-radius-md:${Math.round(t.radius*.75)}px`),i.push(`--sg-radius-xl:${Math.round(t.radius*1.5)}px`)),[i.length?`:root{${i.join(";")}}`:"",n,(0,jy.compileDesignStyleCss)(t.style),V1(t)&&!r?".sg-header img{box-sizing:content-box;background:#fff;padding:6px 10px;border-radius:var(--sg-radius-md)}":"",t.css?.trim()??""].filter(Boolean).join(`
@@ -2261,7 +2261,7 @@ ${s}`;return}if(rC(e,i,lFe)){uFe(e,o)&&(r.retry=e.toString("utf8",o));return}if(
2261
2261
  `);t.stack=r?`${r}
2262
2262
  ${o}`:i.stack}de.exports.fetch=function(e,r=void 0){return zFe(e,r).catch(n=>{throw HJ?WJ(n,HJ):n&&typeof n=="object"&&Error.captureStackTrace(n,de.exports.fetch),n})};de.exports.Headers=xl().Headers;de.exports.Response=Pf().Response;de.exports.Request=vd().Request;de.exports.FormData=_E().FormData;var{setGlobalOrigin:qFe,getGlobalOrigin:HFe}=OB();de.exports.setGlobalOrigin=qFe;de.exports.getGlobalOrigin=HFe;var{CacheStorage:GFe}=NW(),{kConstruct:YFe}=It();de.exports.caches=new GFe(YFe);var{deleteCookie:VFe,getCookies:WFe,getSetCookies:JFe,setCookie:ZFe,parseCookie:KFe}=HW();de.exports.deleteCookie=VFe;de.exports.getCookies=WFe;de.exports.getSetCookies=JFe;de.exports.setCookie=ZFe;de.exports.parseCookie=KFe;var{parseMIMEType:XFe,serializeAMimeType:e1e}=Si();de.exports.parseMIMEType=XFe;de.exports.serializeAMimeType=e1e;var{CloseEvent:t1e,ErrorEvent:r1e,MessageEvent:n1e}=qI(),{WebSocket:i1e,ping:o1e}=wJ();de.exports.WebSocket=i1e;de.exports.CloseEvent=t1e;de.exports.ErrorEvent=r1e;de.exports.MessageEvent=n1e;de.exports.ping=o1e;de.exports.WebSocketStream=kJ().WebSocketStream;de.exports.WebSocketError=fD().WebSocketError;de.exports.request=Jf(Ld.request);de.exports.stream=Jf(Ld.stream);de.exports.pipeline=Jf(Ld.pipeline);de.exports.connect=Jf(Ld.connect);de.exports.upgrade=Jf(Ld.upgrade);de.exports.MockClient=RFe;de.exports.MockCallHistory=kFe;de.exports.MockCallHistoryLog=NFe;de.exports.MockPool=xFe;de.exports.MockAgent=OFe;de.exports.SnapshotAgent=UFe;de.exports.mockErrors=MFe;var{EventSource:s1e}=qJ();de.exports.EventSource=s1e;function a1e(){globalThis.fetch=de.exports.fetch,globalThis.Headers=de.exports.Headers,globalThis.Response=de.exports.Response,globalThis.Request=de.exports.Request,globalThis.FormData=de.exports.FormData,globalThis.WebSocket=de.exports.WebSocket,globalThis.CloseEvent=de.exports.CloseEvent,globalThis.ErrorEvent=de.exports.ErrorEvent,globalThis.MessageEvent=de.exports.MessageEvent,globalThis.EventSource=de.exports.EventSource}de.exports.install=a1e});var KJ=I(Fd=>{"use strict";Object.defineProperty(Fd,"__esModule",{value:!0});Fd.SuperglueClient=Fd.SuperglueHttpError=void 0;var $d=Bn(),In=Pw(),c1e=D_(),l1e=lj(),u1e=On(),ca=yu(),d1e=KA(),Kf=14400*1e3,Zf;if(typeof globalThis.process<"u"&&globalThis.process.versions?.node)try{let{Agent:t}=JJ();Zf=new t({headersTimeout:Kf,bodyTimeout:Kf})}catch{}function ZJ(t){if(t?.aborted)throw t.reason??new DOMException("Aborted","AbortError")}var oC=class extends Error{constructor(e,r,n,i){super(e),this.status=r,this.code=n,this.details=i,this.name="SuperglueHttpError"}};Fd.SuperglueHttpError=oC;var ID=class{constructor({apiKey:e,apiEndpoint:r,onInfrastructureError:n,refreshToken:i,sseTokenProvider:o,tokenProvider:s}){if(!e&&!s)throw new Error("SuperglueClient requires either apiKey or tokenProvider");this.tokenProvider=s??(async()=>e),this.apiEndpoint=r??"https://api.superglue.cloud",this.sseManager=new c1e.SSELogSubscriptionManager(this.apiEndpoint,o??this.tokenProvider,i),this.onInfrastructureError=n,this.refreshToken=i}async getApiKey(){return this.tokenProvider()}async fetchWithAuthRetry(e,r){let n=await this.getApiKey(),i=await e(n);if(i.status!==401||!this.refreshToken)return i;ZJ(r);let o=await this.refreshToken();return ZJ(r),!o||o===n?i:(i.body?.cancel(),e(o))}isInfrastructureError(e){return(0,u1e.isAbortError)(e)?!1:!!(e instanceof TypeError&&e.message.toLowerCase().includes("fetch")||e instanceof Error&&e.name==="TimeoutError")}async restRequest(e,r,n,i,o){let a=await(await this.restResponse({method:e,path:r,body:n,extraHeaders:i,requestInit:o})).text();if(a)return JSON.parse(a)}async restData(...e){return(await this.restRequest(...e)).data}async restResponse({method:e,path:r,body:n,extraHeaders:i,requestInit:o}){let s=`${this.apiEndpoint.replace(/\/$/,"")}${r}`,a=n!=null,c=typeof FormData<"u"&&n instanceof FormData,l=u=>{let d={Authorization:`Bearer ${u}`,...i};return a&&!c&&e!=="GET"&&(d["Content-Type"]="application/json"),fetch(s,{...o,method:e,headers:d,body:a?c?n:JSON.stringify(n):void 0,signal:o?.signal??AbortSignal.timeout(Kf),...Zf?{dispatcher:Zf}:{}})};return this.sendAuthorized(l,o?.signal)}async sendAuthorized(e,r){let n;try{n=await this.fetchWithAuthRetry(e,r)}catch(i){throw this.isInfrastructureError(i)&&this.onInfrastructureError?.(),i}if(!n.ok)throw await this.buildHttpError(n);return n}async uploadFiles(e,r){if(typeof r?.process!="boolean")throw new Error("process must be a boolean");if(e.length===0)return[];let n=e.map(u=>({...u,contentLength:u.contentLength??this.getUploadContentLength(u.content)})),o=(await this.restRequest("POST","/v1/files/uploads",{process:r.process,...r.allowUnprocessed?{allowUnprocessed:!0}:{},files:n.map(({fileName:u,contentType:d,contentLength:A})=>({fileName:u,contentLength:A,...d?{contentType:d}:{}}))})).data.files;if(o.length!==n.length)throw await Promise.all(o.map(u=>this.deleteFileUpload(u.id).catch(()=>{}))),new Error("Upload response did not match the selected files");let s=await Promise.allSettled(o.map(async(u,d)=>{let A=n[d],p=await fetch(u.uploadUrl,{method:"PUT",body:A.content,headers:{...u.uploadHeaders,...A.contentType?{"Content-Type":A.contentType}:{}},signal:AbortSignal.timeout(Math.min(Kf,u.expiresIn*1e3))});if(!p.ok)throw new Error(`Upload failed for ${A.fileName}: ${p.status} ${p.statusText}`);return u.id})),a=s.flatMap(u=>u.status==="fulfilled"?[u.value]:[]),c=new Map;if(a.length>0)try{let u=await this.restRequest("POST","/v1/files/uploads/complete",{fileIds:a});c=new Map(u.data.files.map(d=>[d.id,d]))}catch(u){c=new Map(a.map(d=>[d,{id:d,fileName:n[o.findIndex(A=>A.id===d)]?.fileName||d,contentLength:n[o.findIndex(A=>A.id===d)]?.contentLength||0,status:"failed",error:u instanceof Error?u.message:String(u)}]))}let l=o.map((u,d)=>{let A=s[d],p=n[d];return A.status==="rejected"?{id:u.id,fileName:p.fileName,contentLength:p.contentLength,status:"failed",error:A.reason instanceof Error?A.reason.message:String(A.reason)}:c.get(u.id)||{id:u.id,fileName:p.fileName,contentLength:p.contentLength,status:"failed",error:"Upload completion returned no result"}});return await Promise.all(l.filter(u=>u.status==="failed").map(u=>this.deleteFileUpload(u.id).catch(()=>{}))),l}async deleteFileUpload(e){await this.restRequest("DELETE",`/v1/files/uploads/${encodeURIComponent(e)}`)}getUploadContentLength(e){return typeof e=="string"?new TextEncoder().encode(e).byteLength:e instanceof Uint8Array?e.byteLength:e.size}async buildHttpError(e){e.status>=500&&this.onInfrastructureError?.();let r=await e.text(),n=`HTTP ${e.status}: ${r}`,i,o;try{let s=JSON.parse(r);s&&typeof s=="object"&&!Array.isArray(s)&&(o=s),typeof s?.code=="string"&&(i=s.code);let a=s.error;typeof a=="string"?n=a:a&&typeof a=="object"&&(n=a.message||JSON.stringify(a))}catch{}return new oC(n,e.status,i,o)}async streamRequest(e,r,n){let i=e.includes("?")?"&":"?",o=`${this.apiEndpoint.replace(/\/$/,"")}${e}${i}stream=true`,s=l=>fetch(o,{method:"POST",headers:{Authorization:`Bearer ${l}`,Accept:"text/event-stream","Content-Type":"application/json"},body:JSON.stringify(r),signal:n??AbortSignal.timeout(Kf),...Zf?{dispatcher:Zf}:{}}),a;try{a=await this.fetchWithAuthRetry(s,n)}catch(l){throw this.isInfrastructureError(l)&&this.onInfrastructureError?.(),l}if(!a.ok)throw await this.buildHttpError(a);if(!(a.headers.get("content-type")||"").includes("text/event-stream")){let l=await a.text();return l?JSON.parse(l):void 0}try{return await(0,l1e.consumeEventStreamResult)(a)}catch(l){throw this.isInfrastructureError(l)&&this.onInfrastructureError?.(),l}}async subscribeToLogsSSE(e={}){return this.sseManager.subscribeToLogs(e)}async disconnect(){await this.sseManager.disconnect()}async listMemoryNotes(e={}){let r=new URLSearchParams;e.scope&&r.set("scope",e.scope),e.query&&r.set("query",e.query);let n=r.toString();return this.restData("GET",`/v1/memory-notes${n?`?${n}`:""}`)}async createMemoryNote(e){return this.restData("POST","/v1/memory-notes",e)}async updateMemoryNote(e,r){return this.restData("PATCH",`/v1/memory-notes/${encodeURIComponent(e)}`,r)}async deleteMemoryNote(e){await this.restRequest("DELETE",`/v1/memory-notes/${encodeURIComponent(e)}`)}async clearMemoryNotes(e){return(await this.restRequest("DELETE",`/v1/memory-notes?scope=${e}`)).data.deleted}async getMe(){return this.restRequest("GET","/v1/me")}async completeOnboarding(){return this.restRequest("POST","/v1/me/onboarding/complete")}async runTool(e){let r=await this.restRequest("POST",`/v1/tools/${encodeURIComponent(e.toolId)}/run`,{inputs:e.payload,files:e.files,credentials:e.credentials,includeStepResultData:e.includeStepResultData,options:e.options,runId:e.runId,stateFixture:e.stateFixture},void 0,e.signal?{signal:e.signal}:void 0);return{success:r.status==="success",data:r.data,error:r.error,tool:r.tool,stepResults:r.stepResults?.map(n=>({...n}))||[],...r.fileArtifacts&&r.fileArtifacts.length>0?{fileArtifacts:r.fileArtifacts}:{},...r.metadata?.warnings?.length?{warnings:r.metadata.warnings}:{}}}async runToolConfig(e){let r=e.createRun?"/v1/tools/run?createRun=true":"/v1/tools/run",n=await this.restRequest("POST",r,{tool:e.tool,payload:e.payload,files:e.files,credentials:e.credentials,includeStepResultData:e.includeStepResultData,options:e.options,runId:e.runId,stateFixture:e.stateFixture,executionKind:e.executionKind,parentToolId:e.parentToolId,draftId:e.draftId},e.traceId?{"X-Trace-Id":e.traceId}:void 0,e.signal?{signal:e.signal}:void 0);return{success:n.status?n.status==="success":n.success??!1,data:n.data,error:n.error,tool:n.tool||e.tool,stepResults:n.stepResults?.map(o=>({...o}))||[],...n.fileArtifacts&&n.fileArtifacts.length>0?{fileArtifacts:n.fileArtifacts}:{},...n.metadata?.warnings?.length?{warnings:n.metadata.warnings}:{}}}async abortToolExecution(e){return{success:!0,runId:(await this.restRequest("POST",`/v1/runs/${encodeURIComponent(e)}/cancel`)).runId}}async executeStep({step:e,payload:r,files:n,previousResults:i,credentials:o,credentialsList:s,options:a,runId:c,systemIds:l,connectionId:u,systemAuth:d,createRun:A,parentToolId:p,stepIndex:f,stepId:h,signal:C,stream:B}){let T={step:e,payload:r,files:n,previousResults:i,credentials:o,credentialsList:s,options:a,runId:c,systemIds:l,connectionId:u,systemAuth:d,createRun:A,parentToolId:p,stepIndex:f,stepId:h};return B?this.streamRequest("/v1/tools/step/run",T,C):this.restRequest("POST","/v1/tools/step/run",T,void 0,C?{signal:C}:void 0)}async abortStep(e){return this.restRequest("POST","/v1/tools/step/abort",{runId:e})}async executeTransformOnly({outputTransform:e,outputSchema:r,inputSchema:n,payload:i,files:o,stepResults:s,options:a,runId:c,createRun:l,parentToolId:u,stepId:d,signal:A,stream:p}){let f={outputTransform:e,outputSchema:r,inputSchema:n,payload:i,files:o,stepResults:s,options:a,runId:c,createRun:l,parentToolId:u,stepId:d};return p?this.streamRequest("/v1/tools/transform/run",f,A):this.restRequest("POST","/v1/tools/transform/run",f,void 0,A?{signal:A}:void 0)}async createRun({toolId:e,toolConfig:r,toolResult:n,stepResults:i,toolPayload:o,status:s,error:a,startedAt:c,completedAt:l,executionKind:u,parentToolId:d,draftId:A}){return this.restRequest("POST","/v1/runs",{toolId:e,toolConfig:r,toolResult:n,stepResults:i,toolPayload:o,status:s,error:a,startedAt:(0,ca.toUTCISOString)(c,"run.startedAt"),completedAt:(0,ca.toUTCISOString)(l,"run.completedAt"),executionKind:u,parentToolId:d,draftId:A})}async checkRunLimit(){return this.restData("POST","/v1/runs/check-limit")}async extract({file:e,envelope:r}){if(!e)throw new Error("File must be provided for extract.");let n=new FormData;n.append("file",e);let i=r?"/v1/extract?envelope=true":"/v1/extract";return this.restRequest("POST",i,n)}mapOpenAPIRunToRun(e){let r={running:$d.RunStatus.RUNNING,success:$d.RunStatus.SUCCESS,failed:$d.RunStatus.FAILED,aborted:$d.RunStatus.ABORTED};return{runId:e.runId??e.id,toolId:e.toolId,tool:e.tool,systemIds:e.systemIds,status:r[e.status]??$d.RunStatus.FAILED,toolPayload:e.toolPayload,data:e.data,toolResult:e.data,error:e.error,stepResults:e.stepResults,options:e.options,requestSource:e.requestSource,traceId:e.traceId,resultStorageUri:e.resultStorageUri,userId:e.userId,userEmail:e.userEmail,userName:e.userName,metadata:{...e.metadata,executionKind:e.metadata?.executionKind??$d.RunExecutionKind.FULL},fileArtifacts:e.fileArtifacts}}mapOpenAPIScheduleToToolSchedule(e){return{...e,lastRunAt:e.lastRunAt?(0,ca.requireUTCDate)(e.lastRunAt,"schedule.lastRunAt"):void 0,nextRunAt:(0,ca.requireUTCDate)(e.nextRunAt,"schedule.nextRunAt"),createdAt:(0,ca.requireUTCDate)(e.createdAt,"schedule.createdAt"),updatedAt:(0,ca.requireUTCDate)(e.updatedAt,"schedule.updatedAt")}}async listRuns(e={}){let r=(0,In.createSearchListQueryParams)(e);e.toolId!==void 0&&r.set("toolId",e.toolId),e.searchUserIds?.length&&r.set("searchUserIds",e.searchUserIds.join(",")),e.includeTotal!==void 0&&r.set("includeTotal",String(e.includeTotal)),e.startedAfter!==void 0&&r.set("startedAfter",e.startedAfter instanceof Date?(0,ca.toUTCISOString)(e.startedAfter,"run.startedAfter"):e.startedAfter),e.statuses!==void 0?r.set("status",e.statuses.join(",")):e.status!==void 0&&r.set("status",e.status),e.requestSources!==void 0&&r.set("requestSources",e.requestSources.join(",")),e.executionKinds!==void 0&&r.set("executionKinds",e.executionKinds.join(",")),e.userId!==void 0&&r.set("userId",e.userId),e.systemId!==void 0&&r.set("systemId",e.systemId),e.systemIds!==void 0&&r.set("systemIds",e.systemIds.join(","));let n=r.size>0?`?${r.toString()}`:"",i=await this.restRequest("GET",`/v1/runs${n}`,void 0,void 0,{signal:e.signal});return{data:i.data.map(o=>this.mapOpenAPIRunToRun(o)),total:i.total,page:i.page,limit:i.limit,hasMore:i.hasMore}}async getComputeUsage(e){let r=new URLSearchParams({from:(0,ca.toUTCISOString)(e.from,"computeUsage.from"),to:(0,ca.toUTCISOString)(e.to,"computeUsage.to")});return this.restRequest("GET",`/v1/usage/compute?${r.toString()}`,void 0,void 0,{signal:e.signal})}async getRun(e){try{let r=await this.restRequest("GET",`/v1/runs/${encodeURIComponent(e)}`);return this.mapOpenAPIRunToRun(r)}catch(r){if(r.message?.includes("404")||r.message?.includes("not found"))return null;throw r}}async getTool(e){try{return await this.restRequest("GET",`/v1/tools/${encodeURIComponent(e)}`)}catch(r){if(r.message?.includes("404")||r.message?.includes("not found")||r.message?.includes("403")||r.message?.includes("not allowed"))return null;throw r}}async getToolState(e){return(await this.restRequest("GET",`/v1/tools/${encodeURIComponent(e)}/state`)).state}async setToolState(e,r){await this.restRequest("PUT",`/v1/tools/${encodeURIComponent(e)}/state`,{state:r})}async deleteToolState(e){return(await this.restRequest("DELETE",`/v1/tools/${encodeURIComponent(e)}/state`)).deletedKeys}async archiveTool(e,r=!0){return this.updateTool(e,{archived:r})}async bulkArchiveTools(e,r=!0){return this.restRequest("POST","/v1/tools/bulk/archive",{ids:e,archived:r})}async bulkDeleteTools(e){return this.restRequest("POST","/v1/tools/bulk/delete",{ids:e})}async listTools(e={}){let r=(0,In.createListQueryParams)(e);e.includeArchived!==void 0&&r.set("includeArchived",String(e.includeArchived));let n=r.size>0?`?${r.toString()}`:"";return this.restRequest("GET",`/v1/tools${n}`)}async listAllTools(e={}){return(0,In.listAllPages)((r,n)=>this.listTools({...e,page:r,limit:n}))}async createTool(e,r){return this.restRequest("POST","/v1/tools",{...r,id:e})}async updateTool(e,r){return this.restRequest("PUT",`/v1/tools/${encodeURIComponent(e)}`,r)}async deleteTool(e){try{return await this.restRequest("DELETE",`/v1/tools/${encodeURIComponent(e)}`),!0}catch(r){if(r.message?.includes("404"))return!1;throw r}}async renameTool(e,r){return this.restRequest("POST",`/v1/tools/${encodeURIComponent(e)}/rename`,{newId:r})}async getWorkflow(e){return this.getTool(e)}async archiveWorkflow(e,r=!0){return this.upsertWorkflow(e,{archived:r})}async createWorkflow(e,r){return this.createTool(e,r)}async updateWorkflow(e,r){return this.updateTool(e,r)}async upsertWorkflow(e,r){return await this.getTool(e)?this.updateTool(e,r):this.createTool(e,r)}async deleteWorkflow(e){return this.deleteTool(e)}async renameWorkflow(e,r){return this.renameTool(e,r)}async listProjectSummaries(e={}){let r=(0,In.createSearchListQueryParams)(e);return r.set("includeResources","false"),e.includeArchived!==void 0&&r.set("includeArchived",String(e.includeArchived)),this.restRequest("GET",`/v1/projects?${r.toString()}`)}async listAllProjectSummaries({includeArchived:e}={}){return(0,In.listAllPages)((r,n)=>this.listProjectSummaries({page:r,limit:n,...e!==void 0?{includeArchived:e}:{}}))}async listAllProjectTasks(e){return(0,In.listAllPages)((r,n)=>this.restRequest("GET",`/v1/projects/${encodeURIComponent(e)}/tasks?page=${r}&limit=${n}`))}async saveProjectTask({projectId:e,taskId:r,input:n}){let i=`/v1/projects/${encodeURIComponent(e)}/tasks${r?`/${encodeURIComponent(r)}`:""}`;return this.restData(r?"PATCH":"POST",i,n)}async listAllProjectLabels(e){return(0,In.listAllPages)((r,n)=>this.restRequest("GET",`/v1/projects/${encodeURIComponent(e)}/labels?page=${r}&limit=${n}`))}async saveProjectLabel({projectId:e,labelId:r,input:n}){let i=`/v1/projects/${encodeURIComponent(e)}/labels${r?`/${encodeURIComponent(r)}`:""}`;return this.restData(r?"PATCH":"POST",i,n)}async deleteProjectLabel({projectId:e,labelId:r}){await this.restRequest("DELETE",`/v1/projects/${encodeURIComponent(e)}/labels/${encodeURIComponent(r)}`)}async listSchedules(e={}){let r=(0,In.createListQueryParams)(e),n=r.size>0?`?${r.toString()}`:"",i=e.toolId?`/v1/tools/${encodeURIComponent(e.toolId)}/schedules${n}`:`/v1/schedules${n}`,o=await this.restRequest("GET",i);return{...o,data:o.data.map(s=>this.mapOpenAPIScheduleToToolSchedule(s))}}async listAllSchedules(e={}){return(0,In.listAllPages)((r,n)=>this.listSchedules({...e,page:r,limit:n}))}async getToolSchedule(e,r){try{let n=await this.restRequest("GET",`/v1/tools/${encodeURIComponent(e)}/schedules/${encodeURIComponent(r)}`);return this.mapOpenAPIScheduleToToolSchedule(n)}catch(n){if(n.message?.includes("404")||n.message?.includes("not found"))return null;throw n}}async createToolSchedule(e,r){let n=await this.restRequest("POST",`/v1/tools/${encodeURIComponent(e)}/schedules`,{...r,timezone:r.timezone||(0,d1e.getRuntimeTimezone)()});return this.mapOpenAPIScheduleToToolSchedule(n)}async updateToolSchedule(e,r,n){let i=await this.restRequest("PUT",`/v1/tools/${encodeURIComponent(e)}/schedules/${encodeURIComponent(r)}`,n);return this.mapOpenAPIScheduleToToolSchedule(i)}async deleteToolSchedule(e,r){return await this.restRequest("DELETE",`/v1/tools/${encodeURIComponent(e)}/schedules/${encodeURIComponent(r)}`),!0}async bulkSetSchedulesEnabled(e,r){return this.restRequest("POST","/v1/schedules/bulk/enable",{ids:e,enabled:r})}async bulkDeleteSchedules(e){return this.restRequest("POST","/v1/schedules/bulk/delete",{ids:e})}async listConnections(e={}){let r=(0,In.createListQueryParams)(e);e.systemId!==void 0&&r.set("systemId",e.systemId);let n=r.size>0?`?${r.toString()}`:"";return this.restRequest("GET",`/v1/connections${n}`)}async listAllConnections(e={}){return(0,In.listAllPages)((r,n)=>this.listConnections({...e,page:r,limit:n}))}async createOAuthApp(e){return this.restData("POST","/v1/oauth-apps",e)}async updateOAuthApp(e,r){return this.restData("PUT",`/v1/oauth-apps/${encodeURIComponent(e)}`,r)}async deleteOAuthApp(e){await this.restRequest("DELETE",`/v1/oauth-apps/${encodeURIComponent(e)}`)}async listOAuthApps({systemId:e}={}){return(0,In.listAllPages)(async(r,n)=>{let i=new URLSearchParams({page:String(r),limit:String(n),...e?{systemId:e}:{}});return this.restRequest("GET",`/v1/oauth-apps?${i}`)})}async getConnectionSetup(e){return this.restData("GET",`/v1/connections/setup/${encodeURIComponent(e)}`)}async createConnection(e){return this.restData("POST","/v1/connections",e)}async replaceConnection(e,r){return this.restData("PUT",`/v1/connections/${encodeURIComponent(e)}`,{credentials:r})}async updateConnection(e,r){return this.restData("PATCH",`/v1/connections/${encodeURIComponent(e)}`,r)}async deleteConnection(e){await this.restRequest("DELETE",`/v1/connections/${encodeURIComponent(e)}`)}async setDefaultConnection(e){await this.restRequest("POST",`/v1/connections/${encodeURIComponent(e)}/default`)}async listSystems(e={}){let r=(0,In.createListQueryParams)(e),n=r.size>0?`?${r.toString()}`:"";return this.restRequest("GET",`/v1/systems${n}`)}async listAllSystems(e={}){return(0,In.listAllPages)((r,n)=>this.listSystems({...e,page:r,limit:n}))}async createOAuthExchange(e){return(await this.restRequest("POST","/v1/oauth/exchanges",e)).data}async completeOAuthExchange(e,r){return(await this.restRequest("POST",`/v1/oauth/exchanges/${encodeURIComponent(e)}/complete`,r)).data}async describeOAuthProviderPage(e){return(await this.restRequest("POST",`/v1/oauth/exchanges/${encodeURIComponent(e)}/provider-page`)).data}async generateCredentialsLink(e){try{return{success:!0,credentialsUrl:(await this.restRequest("POST","/v1/authenticate",e||{})).data.credentialsUrl}}catch(r){return{success:!1,error:r.message}}}};Fd.SuperglueClient=ID});var eZ=I(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.UnquotedKeyStrategy=Ar.TripleQuoteStrategy=Ar.TrailingCommaStrategy=Ar.SingleQuoteStrategy=Ar.PythonLiteralStrategy=Ar.CommentStrategy=Ar.ResilientJsonParser=Ar.RepairStrategy=void 0;Ar.parseJsonResilient=A1e;Ar.parseJSON=p1e;var eo=class{validate(e){try{return JSON.parse(e),!0}catch{return!1}}};Ar.RepairStrategy=eo;var sC=class extends eo{constructor(){super(...arguments),this.name="TripleQuoteRepair",this.description="Converts triple-quoted strings to proper JSON, parsing nested JSON content"}canApply(e){return/"""/.test(e)}apply(e){return e.replace(/"""([\s\S]*?)"""/g,(r,n)=>{let i=n.trim();if(i.startsWith("{")&&i.endsWith("}")||i.startsWith("[")&&i.endsWith("]"))try{let s=JSON.parse(i);return JSON.stringify(s)}catch{return`"${n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`}return`"${n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}"`})}};Ar.TripleQuoteStrategy=sC;var aC=class extends eo{constructor(){super(...arguments),this.name="PythonLiteralRepair",this.description="Converts Python literals to JavaScript equivalents"}canApply(e){return/\b(None|True|False)\b/.test(e)}apply(e){return e.replace(/\bNone\b/g,"null").replace(/\bTrue\b/g,"true").replace(/\bFalse\b/g,"false")}};Ar.PythonLiteralStrategy=aC;var cC=class extends eo{constructor(){super(...arguments),this.name="TrailingCommaRepair",this.description="Removes trailing commas from objects and arrays"}canApply(e){return/,\s*[}\]]/.test(e)}apply(e){return e.replace(/,(\s*[}\]])/g,"$1")}};Ar.TrailingCommaStrategy=cC;var lC=class extends eo{constructor(){super(...arguments),this.name="SingleQuoteRepair",this.description="Converts single quotes to double quotes"}canApply(e){return/[{,]\s*'[^']*'\s*:/.test(e)||/:\s*'[^']*'/.test(e)}apply(e){let r=e.replace(/([{,]\s*)'([^']+)'(\s*:)/g,'$1"$2"$3');return r=r.replace(/(:\s*)'([^']+)'(\s*[,}])/g,'$1"$2"$3'),r}};Ar.SingleQuoteStrategy=lC;var uC=class extends eo{constructor(){super(...arguments),this.name="UnquotedKeyRepair",this.description="Adds quotes to unquoted object keys"}canApply(e){return/[{,]\s*[a-zA-Z_$][a-zA-Z0-9_$]*\s*:/.test(e)}apply(e){return e.replace(/([{,]\s*)([a-zA-Z_$][a-zA-Z0-9_$]*)(\s*:)/g,'$1"$2"$3')}};Ar.UnquotedKeyStrategy=uC;var dC=class extends eo{constructor(){super(...arguments),this.name="CommentRemoval",this.description="Removes JavaScript-style comments"}canApply(e){return/\/\/.*$|\/\*[\s\S]*?\*\//m.test(e)}apply(e){let r=e.replace(/\/\/.*$/gm,"");return r=r.replace(/\/\*[\s\S]*?\*\//g,""),r}};Ar.CommentStrategy=dC;var CD=class extends eo{constructor(){super(...arguments),this.name="UnescapedControlCharactersRepair",this.description="Escapes unescaped control characters (newlines, tabs, etc.) in JSON strings"}canApply(e){try{return JSON.parse(e),!1}catch(r){let n=r.message||"";return n.includes("control character")||n.includes("Bad control")||n.includes("Unexpected token")&&/[\n\r\t]/.test(e)}}apply(e){let r="",n=!1,i=!1;for(let o=0;o<e.length;o++){let s=e[o],a=o>0?e[o-1]:"";if(i){r+=s,i=!1;continue}if(s==="\\"&&n){r+=s,i=!0;continue}if(s==='"'&&a!=="\\"){n=!n,r+=s;continue}if(n)switch(s){case`
2263
2263
  `:r+="\\n";break;case"\r":r+="\\r";break;case" ":r+="\\t";break;case"\b":r+="\\b";break;case"\f":r+="\\f";break;default:let c=s.charCodeAt(0);c<32?r+="\\u"+("0000"+c.toString(16)).slice(-4):r+=s}else r+=s}return r}},bD=class extends eo{constructor(){super(...arguments),this.name="TrailingCharactersRepair",this.description="Removes trailing characters after valid JSON structure"}canApply(e){let r=e.trim();if(!r.startsWith("{")&&!r.startsWith("["))return!1;let n=0,i=0,o=!1,s=!1;for(let a=0;a<r.length;a++){let c=r[a];if(o)s?s=!1:c==="\\"?s=!0:c==='"'&&(o=!1);else if(c==='"')o=!0;else if(c==="{")n++;else if(c==="}"){if(n--,n===0&&i===0&&a>0&&a<r.length-1)return!0}else if(c==="[")i++;else if(c==="]"&&(i--,i===0&&n===0&&a>0&&a<r.length-1))return!0}return!1}apply(e){let r=e.trim(),n=0,i=0,o=!1,s=!1,a=-1;for(let c=0;c<r.length;c++){let l=r[c];if(o)s?s=!1:l==="\\"?s=!0:l==='"'&&(o=!1);else if(l==='"')o=!0;else if(l==="{")n++;else if(l==="}"){if(n--,n===0&&i===0&&c>0){a=c;break}}else if(l==="[")i++;else if(l==="]"&&(i--,i===0&&n===0&&c>0)){a=c;break}}return a>0&&a<r.length-1?r.substring(0,a+1):e}},Xf=class{constructor(e={}){this.strategies=[],this.repairLog=[],this.options={attemptRepair:!0,maxDepth:10,preserveStringsOnFailure:!1,logRepairs:!1,...e},this.initializeDefaultStrategies(),e.customStrategies&&this.strategies.push(...e.customStrategies)}initializeDefaultStrategies(){this.strategies=[new sC,new lC,new CD,new bD,new aC,new cC,new uC,new dC]}parse(e){let r=Date.now();this.repairLog=[];let n=e instanceof Buffer?e.toString("utf8"):String(e);try{return{success:!0,data:JSON.parse(n),metadata:{parseTime:Date.now()-r,strategiesApplied:[]}}}catch(s){if(!this.options.attemptRepair)return{success:!1,error:`JSON parse error: ${s}`,metadata:{parseTime:Date.now()-r}}}let i=n,o=[];for(let s of this.strategies)if(s.canApply(i)){let a=i;if(i=s.apply(i),a!==i){o.push(s.name),this.repairLog.push(s.description),this.options.logRepairs&&console.log(`Applied ${s.name}: ${s.description}`);try{return{success:!0,data:JSON.parse(i),repairs:this.repairLog,metadata:{parseTime:Date.now()-r,strategiesApplied:o}}}catch{}}}try{return{success:!0,data:JSON.parse(i),repairs:this.repairLog,metadata:{parseTime:Date.now()-r,strategiesApplied:o}}}catch(s){let a=this.aggressiveFallback(i);return a.success?{...a,repairs:[...this.repairLog,"Applied aggressive fallback"],metadata:{parseTime:Date.now()-r,strategiesApplied:[...o,"AggressiveFallback"]}}:{success:!1,error:`Failed to parse JSON after applying ${o.length} strategies: ${s}`,repairs:this.repairLog,metadata:{parseTime:Date.now()-r,strategiesApplied:o}}}}aggressiveFallback(e){try{let r=e.indexOf("{"),n=e.indexOf("[");if(r===-1&&n===-1)return{success:!1,error:"No JSON-like structure found"};let i=r===-1?n:n===-1?r:Math.min(r,n),o=e.substring(i);for(let a of this.strategies)a.canApply(o)&&(o=a.apply(o));return{success:!0,data:JSON.parse(o)}}catch(r){return{success:!1,error:`Aggressive fallback failed: ${r}`}}}addStrategy(e){this.strategies.push(e)}removeStrategy(e){this.strategies=this.strategies.filter(r=>r.name!==e)}getStrategies(){return this.strategies.map(e=>e.name)}};Ar.ResilientJsonParser=Xf;var XJ=new Xf;function A1e(t,e){return(e?new Xf(e):XJ).parse(t)}function p1e(t){let e=XJ.parse(t);if(e.success)return e.repairs&&e.repairs.length>0&&console.log("JSON parsed with repairs:",e.repairs),e.data;throw new Error(`Failed to parse JSON: ${e.error}`)}});var rZ=I(or=>{"use strict";Object.defineProperty(or,"__esModule",{value:!0});or.OAUTH_AUTH_URL_ERROR=or.MANAGED_OAUTH_APP_PREFIX=void 0;or.projectOAuthAppAuthentication=g1e;or.withoutOAuthAppOwnedFields=m1e;or.hasOAuthClientChanged=y1e;or.isDynamicOAuthConfiguration=E1e;or.isReusableOAuthAppForTemplate=I1e;or.findOrganizationOAuthApp=C1e;or.getManagedOAuthTemplateId=tZ;or.getOAuthAppSharedConfiguration=b1e;or.copyOAuthAppConfiguration=S1e;or.encryptConnectionAuthentication=w1e;or.decryptConnectionAuthentication=_1e;or.isAllowedOAuthAuthUrl=Q1e;or.isManagedOAuthEndpointAllowed=T1e;var f1e=Up(),h1e=On();function g1e(t){let{clientSecret:e,config:r,...n}=t,{extraHeaders:i,extraBodyParams:o,...s}=r??{};return{...n,...r?{config:s}:{}}}function m1e(t){if(!t.oauthAppId)return t;let{clientId:e,clientSecret:r,tokenUrl:n,...i}=t;return tZ(t)&&n?{...i,tokenUrl:n}:i}function y1e(t,e){return t.type!=="oauth2"?!1:e.type!=="oauth2"?!0:t.oauthAppId||e.oauthAppId?t.oauthAppId!==e.oauthAppId:t.clientId!==e.clientId}or.MANAGED_OAUTH_APP_PREFIX="managed:";function E1e({authentication:t,template:e}){return t.oauthClientMode==="dynamic"||!!e?.oauth?.registrationUrl&&!t.clientSecret}function I1e({app:t,template:e}){return!e?.oauth?.registrationUrl||!!t.clientSecretHash}function C1e({apps:t,systemId:e,templateId:r}){return t.filter(n=>n.source==="organization"&&(n.systemId===e||r!==void 0&&n.templateId===r)).sort((n,i)=>(n.createdAt??"").localeCompare(i.createdAt??""))[0]}function tZ(t){if(t?.type==="oauth2")return t.oauthAppId?.startsWith(or.MANAGED_OAUTH_APP_PREFIX)?t.oauthAppId.slice(or.MANAGED_OAUTH_APP_PREFIX.length):void 0}function b1e(t){let{grantType:e,scopes:r,oauthAppId:n,...i}=t;return i}function S1e({appAuthentication:t,authentication:e}){if(e?.type!=="oauth2")return{...t};let r=Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0));return{...t,...r,config:{...t.config,...e.config}}}function w1e({authentication:t,encrypt:e}){if(t.type!=="oauth2")return t;let r={...t,config:{...t.config}};t.clientSecret!==void 0&&(r.clientSecret=e({value:t.clientSecret}).value);for(let n of["extraHeaders","extraBodyParams"]){let i=t.config?.[n];i!==void 0&&(r.config[n]=e({value:(0,h1e.safeStringify)(i)}).value)}return r}function _1e({authentication:t,decrypt:e}){if(t.type!=="oauth2")return t;let r={...t,config:{...t.config}};t.clientSecret!==void 0&&(r.clientSecret=e({value:t.clientSecret}).value);for(let n of["extraHeaders","extraBodyParams"]){let i=t.config?.[n];typeof i=="string"&&(r.config[n]=JSON.parse(e({value:i}).value))}return r}or.OAUTH_AUTH_URL_ERROR="The authUrl must be an absolute https URL (http is allowed only for localhost)";var B1e=new Set(["localhost","127.0.0.1","[::1]"]),v1e=/<<[^<>]*>>/g;function Q1e(t){try{let e=new URL(t.replace(v1e,"placeholder"));return e.protocol==="https:"||e.protocol==="http:"&&B1e.has(e.hostname)}catch{return!1}}function T1e({templateId:t,endpoint:e,url:r}){let n=f1e.systems[t]?.oauth,i=n?.[e];if(!n?.managed||!i)return!1;try{let o=new URL(r),s=new URL(i);return o.protocol!=="https:"||o.port||o.username||o.password||o.hash||o.pathname!==s.pathname?!1:o.hostname===s.hostname||(n.managedEndpointHosts??[]).some(a=>a.startsWith("*.")?o.hostname.endsWith(a.slice(1)):o.hostname===a)}catch{return!1}}});var iZ=I(nZ=>{"use strict";Object.defineProperty(nZ,"__esModule",{value:!0})});var tn=I(re=>{"use strict";var D1e=re&&re.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i)}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),he=re&&re.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&D1e(e,t,r)};Object.defineProperty(re,"__esModule",{value:!0});re.SSELogSubscriptionManager=re.SuperglueHttpError=re.SuperglueClient=void 0;he(tb(),re);he(oL(),re);he(qm(),re);he(AL(),re);he(yL(),re);he(DL(),re);he(kL(),re);he(ML(),re);he(PL(),re);he($L(),re);he(Wm(),re);he(p$(),re);he(f$(),re);he(xg(),re);he(E$(),re);he(I$(),re);he(C$(),re);he(b$(),re);he(Pw(),re);he(T$(),re);he(Lw(),re);he(k$(),re);he(vu(),re);he(L$(),re);he(zw(),re);he(OF(),re);he(y0(),re);he(b0(),re);he(UF(),re);he(MF(),re);he(LF(),re);he(O1(),re);he(U1(),re);he(M1(),re);he(L1(),re);he($1(),re);he(r2(),re);he(K0(),re);he(wy(),re);he(Z0(),re);he(a2(),re);he(l2(),re);he(s_(),re);he(m2(),re);he(Hm(),re);he(w2(),re);he(B2(),re);he(Gm(),re);he(J0(),re);he(W2(),re);he(J2(),re);he(Up(),re);he(ej(),re);he(tj(),re);he(rj(),re);he(oj(),re);he(aj(),re);he(Bn(),re);he(On(),re);he(cj(),re);he(I_(),re);he(yu(),re);he(KA(),re);var oZ=KJ();Object.defineProperty(re,"SuperglueClient",{enumerable:!0,get:function(){return oZ.SuperglueClient}});Object.defineProperty(re,"SuperglueHttpError",{enumerable:!0,get:function(){return oZ.SuperglueHttpError}});var R1e=D_();Object.defineProperty(re,"SSELogSubscriptionManager",{enumerable:!0,get:function(){return R1e.SSELogSubscriptionManager}});he(eZ(),re);he(rZ(),re);he(iZ(),re)});var WC=require("commander");var Cn=De(require("fs")),cZ=De(require("os")),la=De(require("path")),eh=De(tn()),sZ=new Set(["runner","builder","admin"]),aZ={output:{mode:"stdout",directory:".superglue/output"},preset:"admin"};function ua(t){let e=la.join(process.cwd(),".superglue"),r=cZ.homedir();if(!r)return e;let n=la.join(r,".superglue");return t===!0?e:t===!1?n:Cn.existsSync(la.join(e,"config.json"))?e:n}function SD(t){return la.join(ua(t),"config.json")}function AC(t){let e=SD(t);if(!Cn.existsSync(e))return{};try{return JSON.parse(Cn.readFileSync(e,"utf-8"))}catch{return{}}}function jd(t){let e=AC(),r=t.apiKey||(0,eh.readProcessEnvironmentValue)("SUPERGLUE_API_KEY")||e.apiKey||"",n=t.endpoint||(0,eh.readProcessEnvironmentValue)("SUPERGLUE_API_ENDPOINT")||e.endpoint||"https://api.superglue.cloud",i=(0,eh.readProcessEnvironmentValue)("SUPERGLUE_WEB_ENDPOINT")||e.webEndpoint||n.replace(/:3002\b/,":3001").replace(/api\.superglue/,"app.superglue"),o=(0,eh.readProcessEnvironmentValue)("SUPERGLUE_CLI_PRESET"),s=o&&sZ.has(o)?o:e.preset&&sZ.has(e.preset)?e.preset:"admin";return{...aZ,...e,apiKey:r,endpoint:n,webEndpoint:i,preset:s,output:{...aZ.output,...e.output}}}function pC(t,e){let r=ua(e);Cn.existsSync(r)||Cn.mkdirSync(r,{recursive:!0}),Cn.writeFileSync(la.join(r,"config.json"),JSON.stringify(t,null,2)+`
2264
- `,{mode:384})}function fC(t,e){let r=la.join(ua(e),"drafts");if(Cn.existsSync(r)||Cn.mkdirSync(r,{recursive:!0}),t.output.mode==="stdout+file"){let n=la.resolve(t.output.directory);Cn.existsSync(n)||Cn.mkdirSync(n,{recursive:!0})}}var DD=De(tn());var wD=De(require("readline"));var dZ=require("child_process"),AZ=require("util");var lZ={name:"@superglue/cli",version:"1.1.273",bin:{sg:"./dist/cli.js"},files:[".claude-plugin/","dist/","skills/","LICENSE"],dependencies:{commander:"15.0.0-0","fast-json-patch":"3.1.1"},devDependencies:{"@superglue/shared":"file:../shared","@types/node":"25.5.0",tsup:"8.5.1",typescript:"5.8.3"},scripts:{build:"tsup && (cp -r skills dist/ 2>/dev/null || true)",dev:"tsup --watch","type-check":"tsc --noEmit",prepublishOnly:"npm run build"},publishConfig:{access:"public"}};var N1e=(0,AZ.promisify)(dZ.exec),rn=lZ.version;function uZ(t){let e=t.match(/^(\d+)(?:-(.+))?$/);return e?{numeric:parseInt(e[1],10),prerelease:e[2]||null}:{numeric:0,prerelease:t}}function gC(t,e){let r=t.split("."),n=e.split("."),i=Math.max(r.length,n.length);for(let o=0;o<i;o++){let s=uZ(r[o]||"0"),a=uZ(n[o]||"0");if(s.numeric<a.numeric)return-1;if(s.numeric>a.numeric||s.prerelease===null&&a.prerelease!==null)return 1;if(s.prerelease!==null&&a.prerelease===null)return-1;if(s.prerelease!==null&&a.prerelease!==null){if(s.prerelease<a.prerelease)return-1;if(s.prerelease>a.prerelease)return 1}}return 0}async function mC(){try{let t=await fetch("https://registry.npmjs.org/@superglue/cli/latest",{signal:AbortSignal.timeout(5e3)});return t.ok&&(await t.json()).version||null}catch{return null}}var hC=null;function pZ(){we()&&(hC=mC())}async function fZ(){if(!(!we()||!hC)){try{let t=new Promise(r=>{setTimeout(()=>r(null),2e3).unref()}),e=await Promise.race([hC,t]);e&&gC(rn,e)<0&&(console.error(""),console.error(`${w.cyan}${w.bold} Update available: ${rn} \u2192 ${e}${w.reset}`),console.error(`${w.cyan} Run ${w.bold}sg update${w.reset}${w.cyan} to upgrade${w.reset}`),console.error(""))}catch{}hC=null}}async function hZ(){let t=await mC();if(!t)return{success:!1,message:"Could not fetch latest version from npm"};if(gC(rn,t)>=0)return{success:!0,message:`Already on latest version (${rn})`};try{return await N1e("npm install -g @superglue/cli@latest"),{success:!0,message:`Updated from ${rn} to ${t}`}}catch(e){return{success:!1,message:`Update failed: ${e.message}. Try manually: npm install -g @superglue/cli@latest`}}}var we=()=>process.argv.includes("--table")&&process.stdout.isTTY,ki=()=>process.argv.includes("--full"),w={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m"};function gZ(t,e){let r=e||t;return`\x1B]8;;${t}\x07${w.underline}${w.cyan}${r}${w.reset}\x1B]8;;\x07`}function mZ(){if(!we())return;let t=w.reset,e=w.dim,r="\x1B[47;30m",n=[" #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- "," =@@@- @@@@ "," @@@ @@% "," -@@ @@@@= @@@ @@@ @@@@@#@ @@@@@@@ @@@@@@@ @@@@@@ @@@ @@@ @@@ @@@@@@* %@@ "," @@ @@@ *@ @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @% @@@ @@@ @@@ @@* @@# "," #@@ @@@# @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @@@ @@@ @@@ @@* @@ "," @@- @@@@= @@@ @@@ @@@@@@@ @@@@@@ @@@@@@@ @@@ @@% @@@ @@@ @@@ @@@@@. @@."," #@% .@@@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* @@ "," @@ @ @@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* *@@ "," -@@ @@@@= @@@@@@ @@@ @@@@@@@ @@@ -@@ @@@@@@ @@@@@@% @@@@@@. @@@@@@* #@@ "," :@@* @@@ "," %@@@ =@@@. "," :@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@% "];console.log(""),n.forEach(i=>{let o=i.search(/\S/),s=i.length-[...i].reverse().join("").search(/\S/)-1;if(o===-1)return console.log(" "+i);let a=i.slice(0,o),c=i.slice(o,s+1).split("").map(u=>u===" "?" ":"\u2588").join(""),l=i.slice(s+1);console.log(` ${a}${r}${c}${t}${l}`)}),console.log(` ${e} CLI v${rn}${t}`),console.log("")}function pr(t){if(!we())return{stop:()=>{},update:()=>{},log:()=>{}};let e=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],r=0,n=t,i=()=>process.stdout.write("\r\x1B[2K"),o=()=>{process.stdout.write(`\r ${w.cyan}${e[r++%e.length]}${w.reset} ${n}`)},s=setInterval(o,80);return{update:a=>{n=a},log:a=>{i(),console.log(` ${w.dim}\u2502${w.reset} ${a}`),o()},stop:a=>{clearInterval(s),i(),a&&console.log(` ${a}`)}}}function ge(t){we()?yC(t):console.log(JSON.stringify(t,null,2))}function qe(t,e){we()?(console.log(` ${w.green}\u2713${w.reset} ${t}`),e&&yC(e,4)):console.log(JSON.stringify({success:!0,message:t,...e&&typeof e=="object"?e:{data:e}}))}function U(t,e){we()?(console.error(` ${w.red}\u2717${w.reset} ${t}`),e&&yC(e,4)):console.error(JSON.stringify({success:!1,error:t,details:e}))}function Xn(t){we()&&console.log(` ${w.dim}${t}${w.reset}`)}function ql(t){we()&&(console.log(`
2264
+ `,{mode:384})}function fC(t,e){let r=la.join(ua(e),"drafts");if(Cn.existsSync(r)||Cn.mkdirSync(r,{recursive:!0}),t.output.mode==="stdout+file"){let n=la.resolve(t.output.directory);Cn.existsSync(n)||Cn.mkdirSync(n,{recursive:!0})}}var DD=De(tn());var wD=De(require("readline"));var dZ=require("child_process"),AZ=require("util");var lZ={name:"@superglue/cli",version:"1.1.274",bin:{sg:"./dist/cli.js"},files:[".claude-plugin/","dist/","skills/","LICENSE"],dependencies:{commander:"15.0.0-0","fast-json-patch":"3.1.1"},devDependencies:{"@superglue/shared":"file:../shared","@types/node":"25.5.0",tsup:"8.5.1",typescript:"5.8.3"},scripts:{build:"tsup && (cp -r skills dist/ 2>/dev/null || true)",dev:"tsup --watch","type-check":"tsc --noEmit",prepublishOnly:"npm run build"},publishConfig:{access:"public"}};var N1e=(0,AZ.promisify)(dZ.exec),rn=lZ.version;function uZ(t){let e=t.match(/^(\d+)(?:-(.+))?$/);return e?{numeric:parseInt(e[1],10),prerelease:e[2]||null}:{numeric:0,prerelease:t}}function gC(t,e){let r=t.split("."),n=e.split("."),i=Math.max(r.length,n.length);for(let o=0;o<i;o++){let s=uZ(r[o]||"0"),a=uZ(n[o]||"0");if(s.numeric<a.numeric)return-1;if(s.numeric>a.numeric||s.prerelease===null&&a.prerelease!==null)return 1;if(s.prerelease!==null&&a.prerelease===null)return-1;if(s.prerelease!==null&&a.prerelease!==null){if(s.prerelease<a.prerelease)return-1;if(s.prerelease>a.prerelease)return 1}}return 0}async function mC(){try{let t=await fetch("https://registry.npmjs.org/@superglue/cli/latest",{signal:AbortSignal.timeout(5e3)});return t.ok&&(await t.json()).version||null}catch{return null}}var hC=null;function pZ(){we()&&(hC=mC())}async function fZ(){if(!(!we()||!hC)){try{let t=new Promise(r=>{setTimeout(()=>r(null),2e3).unref()}),e=await Promise.race([hC,t]);e&&gC(rn,e)<0&&(console.error(""),console.error(`${w.cyan}${w.bold} Update available: ${rn} \u2192 ${e}${w.reset}`),console.error(`${w.cyan} Run ${w.bold}sg update${w.reset}${w.cyan} to upgrade${w.reset}`),console.error(""))}catch{}hC=null}}async function hZ(){let t=await mC();if(!t)return{success:!1,message:"Could not fetch latest version from npm"};if(gC(rn,t)>=0)return{success:!0,message:`Already on latest version (${rn})`};try{return await N1e("npm install -g @superglue/cli@latest"),{success:!0,message:`Updated from ${rn} to ${t}`}}catch(e){return{success:!1,message:`Update failed: ${e.message}. Try manually: npm install -g @superglue/cli@latest`}}}var we=()=>process.argv.includes("--table")&&process.stdout.isTTY,ki=()=>process.argv.includes("--full"),w={reset:"\x1B[0m",bold:"\x1B[1m",dim:"\x1B[2m",italic:"\x1B[3m",underline:"\x1B[4m",red:"\x1B[31m",green:"\x1B[32m",yellow:"\x1B[33m",blue:"\x1B[34m",magenta:"\x1B[35m",cyan:"\x1B[36m",white:"\x1B[37m",gray:"\x1B[90m",bgRed:"\x1B[41m",bgGreen:"\x1B[42m",bgYellow:"\x1B[43m",bgBlue:"\x1B[44m",bgMagenta:"\x1B[45m",bgCyan:"\x1B[46m"};function gZ(t,e){let r=e||t;return`\x1B]8;;${t}\x07${w.underline}${w.cyan}${r}${w.reset}\x1B]8;;\x07`}function mZ(){if(!we())return;let t=w.reset,e=w.dim,r="\x1B[47;30m",n=[" #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@- "," =@@@- @@@@ "," @@@ @@% "," -@@ @@@@= @@@ @@@ @@@@@#@ @@@@@@@ @@@@@@@ @@@@@@ @@@ @@@ @@@ @@@@@@* %@@ "," @@ @@@ *@ @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @% @@@ @@@ @@@ @@* @@# "," #@@ @@@# @@@ @@@ @@@ :@@ @@@ @@@ -@@ @@@ @@@ @@@ @@@ @@* @@ "," @@- @@@@= @@@ @@@ @@@@@@@ @@@@@@ @@@@@@@ @@@ @@% @@@ @@@ @@@ @@@@@. @@."," #@% .@@@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* @@ "," @@ @ @@@ @@@ @@@ @@@ @@@ @@@ -@@ @@@ @@% @@@ @@@ @@@ @@* *@@ "," -@@ @@@@= @@@@@@ @@@ @@@@@@@ @@@ -@@ @@@@@@ @@@@@@% @@@@@@. @@@@@@* #@@ "," :@@* @@@ "," %@@@ =@@@. "," :@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@% "];console.log(""),n.forEach(i=>{let o=i.search(/\S/),s=i.length-[...i].reverse().join("").search(/\S/)-1;if(o===-1)return console.log(" "+i);let a=i.slice(0,o),c=i.slice(o,s+1).split("").map(u=>u===" "?" ":"\u2588").join(""),l=i.slice(s+1);console.log(` ${a}${r}${c}${t}${l}`)}),console.log(` ${e} CLI v${rn}${t}`),console.log("")}function pr(t){if(!we())return{stop:()=>{},update:()=>{},log:()=>{}};let e=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],r=0,n=t,i=()=>process.stdout.write("\r\x1B[2K"),o=()=>{process.stdout.write(`\r ${w.cyan}${e[r++%e.length]}${w.reset} ${n}`)},s=setInterval(o,80);return{update:a=>{n=a},log:a=>{i(),console.log(` ${w.dim}\u2502${w.reset} ${a}`),o()},stop:a=>{clearInterval(s),i(),a&&console.log(` ${a}`)}}}function ge(t){we()?yC(t):console.log(JSON.stringify(t,null,2))}function qe(t,e){we()?(console.log(` ${w.green}\u2713${w.reset} ${t}`),e&&yC(e,4)):console.log(JSON.stringify({success:!0,message:t,...e&&typeof e=="object"?e:{data:e}}))}function U(t,e){we()?(console.error(` ${w.red}\u2717${w.reset} ${t}`),e&&yC(e,4)):console.error(JSON.stringify({success:!1,error:t,details:e}))}function Xn(t){we()&&console.log(` ${w.dim}${t}${w.reset}`)}function ql(t){we()&&(console.log(`
2265
2265
  ${w.bold}${w.cyan}${t}${w.reset}`),console.log(` ${w.dim}${"\u2500".repeat(t.length)}${w.reset}`))}function Er(t,e,r){if(!we()){console.log(JSON.stringify({success:!0,total:r?.total??t.length,items:t}));return}if(t.length===0){console.log(`
2266
2266
  ${w.dim}0 results${w.reset}
2267
2267
  `);return}let n=e||Object.keys(t[0]),i=ki()?1/0:60,o=n.map(u=>Math.min(i,Math.max(u.length,...t.map(d=>String(d[u]??"").replace(/[\n\r]+/g," ").trim().length))));console.log("");let s=n.map((u,d)=>`${w.bold}${w.cyan}${u.toUpperCase().padEnd(o[d])}${w.reset}`).join(" ");console.log(` ${s}`);let a=o.map(u=>`${w.dim}${"\u2500".repeat(u)}${w.reset}`).join(`${w.dim}\u2500\u2500${w.reset}`);console.log(` ${a}`);for(let u of t){let d=n.map((A,p)=>{let f=String(u[A]??"").replace(/[\n\r]+/g," ").trim();if(f.length>i){let C=`\u2026 (${f.length})`;f=f.slice(0,Math.max(0,i-C.length))+`${w.dim}${C}${w.reset}`}return A==="status"?`${{success:w.green,running:w.yellow,failed:w.red,aborted:w.red,error:w.red,pending:w.dim}[f.toLowerCase()]||""}${f.padEnd(o[p])}${w.reset}`:f.padEnd(o[p])}).join(" ");console.log(` ${d}`)}let c=r?.total??t.length,l=c===t.length?`${t.length} result${t.length===1?"":"s"}`:`${t.length} of ${c} result${c===1?"":"s"}`;console.log(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@superglue/cli",
3
- "version": "1.1.273",
3
+ "version": "1.1.274",
4
4
  "bin": {
5
5
  "sg": "./dist/cli.js"
6
6
  },