UNPKG

@fleek-platform/agents-ui

Version:

The Fleek Platform Agents UI provides a simple interface for deploying, monitoring, and configuring your agents––making management straightforward

5 lines (4 loc) 5.95 kB
import{r as h,g as j}from"./index-D73ONp2G.js";function q(a,l){for(var _=0;_<l.length;_++){const E=l[_];if(typeof E!="string"&&!Array.isArray(E)){for(const p in E)if(p!=="default"&&!(p in a)){const g=Object.getOwnPropertyDescriptor(E,p);g&&Object.defineProperty(a,p,g.get?g:{enumerable:!0,get:()=>E[p]})}}}return Object.freeze(Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}))}var b={},d={exports:{}};const B="16.4.7",W={version:B};var w;function J(){if(w)return d.exports;w=1;var a={};const l=h,_=h,E=h,p=h,D=W.version,K=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function R(e){const t={};let n=e.toString();n=n.replace(/\r\n?/mg,` `);let c;for(;(c=K.exec(n))!=null;){const u=c[1];let r=c[2]||"";r=r.trim();const o=r[0];r=r.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),o==='"'&&(r=r.replace(/\\n/g,` `),r=r.replace(/\\r/g,"\r")),t[u]=r}return t}function Y(e){const t=I(e),n=i.configDotenv({path:t});if(!n.parsed){const o=new Error(`MISSING_DATA: Cannot parse ${t} for an unknown reason`);throw o.code="MISSING_DATA",o}const c=T(e).split(","),u=c.length;let r;for(let o=0;o<u;o++)try{const s=c[o].trim(),f=G(n,s);r=i.decrypt(f.ciphertext,f.key);break}catch(s){if(o+1>=u)throw s}return i.parse(r)}function F(e){console.log(`[dotenv@${D}][INFO] ${e}`)}function k(e){console.log(`[dotenv@${D}][WARN] ${e}`)}function O(e){console.log(`[dotenv@${D}][DEBUG] ${e}`)}function T(e){return e&&e.DOTENV_KEY&&e.DOTENV_KEY.length>0?e.DOTENV_KEY:a.DOTENV_KEY&&a.DOTENV_KEY.length>0?a.DOTENV_KEY:""}function G(e,t){let n;try{n=new URL(t)}catch(s){if(s.code==="ERR_INVALID_URL"){const f=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw f.code="INVALID_DOTENV_KEY",f}throw s}const c=n.password;if(!c){const s=new Error("INVALID_DOTENV_KEY: Missing key part");throw s.code="INVALID_DOTENV_KEY",s}const u=n.searchParams.get("environment");if(!u){const s=new Error("INVALID_DOTENV_KEY: Missing environment part");throw s.code="INVALID_DOTENV_KEY",s}const r=`DOTENV_VAULT_${u.toUpperCase()}`,o=e.parsed[r];if(!o){const s=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${r} in your .env.vault file.`);throw s.code="NOT_FOUND_DOTENV_ENVIRONMENT",s}return{ciphertext:o,key:c}}function I(e){let t=null;if(e&&e.path&&e.path.length>0)if(Array.isArray(e.path))for(const n of e.path)l.existsSync(n)&&(t=n.endsWith(".vault")?n:`${n}.vault`);else t=e.path.endsWith(".vault")?e.path:`${e.path}.vault`;else t=_.resolve(process.cwd(),".env.vault");return l.existsSync(t)?t:null}function m(e){return e[0]==="~"?_.join(E.homedir(),e.slice(1)):e}function L(e){F("Loading env from encrypted .env.vault");const t=i._parseVault(e);let n=a;return e&&e.processEnv!=null&&(n=e.processEnv),i.populate(n,t,e),{parsed:t}}function P(e){const t=_.resolve(process.cwd(),".env");let n="utf8";const c=!!(e&&e.debug);e&&e.encoding?n=e.encoding:c&&O("No encoding is specified. UTF-8 is used by default");let u=[t];if(e&&e.path)if(!Array.isArray(e.path))u=[m(e.path)];else{u=[];for(const f of e.path)u.push(m(f))}let r;const o={};for(const f of u)try{const v=i.parse(l.readFileSync(f,{encoding:n}));i.populate(o,v,e)}catch(v){c&&O(`Failed to load ${f} ${v.message}`),r=v}let s=a;return e&&e.processEnv!=null&&(s=e.processEnv),i.populate(s,o,e),r?{parsed:o,error:r}:{parsed:o}}function U(e){if(T(e).length===0)return i.configDotenv(e);const t=I(e);return t?i._configVault(e):(k(`You set DOTENV_KEY but you are missing a .env.vault file at ${t}. Did you forget to build it?`),i.configDotenv(e))}function M(e,t){const n=Buffer.from(t.slice(-64),"hex");let c=Buffer.from(e,"base64");const u=c.subarray(0,12),r=c.subarray(-16);c=c.subarray(12,-16);try{const o=p.createDecipheriv("aes-256-gcm",n,u);return o.setAuthTag(r),`${o.update(c)}${o.final()}`}catch(o){const s=o instanceof RangeError,f=o.message==="Invalid key length",v=o.message==="Unsupported state or unable to authenticate data";if(s||f){const N=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw N.code="INVALID_DOTENV_KEY",N}else if(v){const N=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw N.code="DECRYPTION_FAILED",N}else throw o}}function S(e,t,n={}){const c=!!(n&&n.debug),u=!!(n&&n.override);if(typeof t!="object"){const r=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw r.code="OBJECT_REQUIRED",r}for(const r of Object.keys(t))Object.prototype.hasOwnProperty.call(e,r)?(u===!0&&(e[r]=t[r]),c&&O(u===!0?`"${r}" is already defined and WAS overwritten`:`"${r}" is already defined and was NOT overwritten`)):e[r]=t[r]}const i={configDotenv:P,_configVault:L,_parseVault:Y,config:U,decrypt:M,parse:R,populate:S};return d.exports.configDotenv=i.configDotenv,d.exports._configVault=i._configVault,d.exports._parseVault=i._parseVault,d.exports.config=i.config,d.exports.decrypt=i.decrypt,d.exports.parse=i.parse,d.exports.populate=i.populate,d.exports=i,d.exports}var V,$;function H(){if($)return V;$=1;var a={};const l={};return a.DOTENV_CONFIG_ENCODING!=null&&(l.encoding=a.DOTENV_CONFIG_ENCODING),a.DOTENV_CONFIG_PATH!=null&&(l.path=a.DOTENV_CONFIG_PATH),a.DOTENV_CONFIG_DEBUG!=null&&(l.debug=a.DOTENV_CONFIG_DEBUG),a.DOTENV_CONFIG_OVERRIDE!=null&&(l.override=a.DOTENV_CONFIG_OVERRIDE),a.DOTENV_CONFIG_DOTENV_KEY!=null&&(l.DOTENV_KEY=a.DOTENV_CONFIG_DOTENV_KEY),V=l,V}var y,A;function Q(){if(A)return y;A=1;const a=/^dotenv_config_(encoding|path|debug|override|DOTENV_KEY)=(.+)$/;return y=function(_){return _.reduce(function(E,p){const g=p.match(a);return g&&(E[g[1]]=g[2]),E},{})},y}var C;function z(){return C||(C=1,function(){J().config(Object.assign({},H(),Q()(process.argv)))}()),b}var x=z();const X=j(x),ee=q({__proto__:null,default:X},[x]);export{ee as c}; //# sourceMappingURL=config-D9_iWNJv.js.map