@sequenzy/cli 0.0.191 → 0.0.192

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -191,7 +191,7 @@ Check the top-level render call using <`+Be+">."}return de}}function Gr(Q,de){{i
191
191
  <%s {...props} />
192
192
  React keys must be passed directly to JSX without using spread:
193
193
  let props = %s;
194
- <%s key={someKey} {...props} />`,Qs,bo,$s,bo),gc[bo+Qs]=!0}}if(Q===n)Pr(dn);else Ni(dn);return dn}}var fr=Rl;Gye.Fragment=n,Gye.jsxDEV=fr})()});var dw={};RZ(dw,{program:()=>aT,createCommand:()=>cT,createOption:()=>lT,createArgument:()=>uT,Command:()=>dT,Option:()=>pT,Argument:()=>mT,Help:()=>fT,CommanderError:()=>gT,InvalidArgumentError:()=>AT,InvalidOptionArgumentError:()=>hT},{program:(lDe)=>aT=lDe,createCommand:(lDe)=>cT=lDe,createOption:(lDe)=>lT=lDe,createArgument:(lDe)=>uT=lDe,Command:(lDe)=>dT=lDe,Option:(lDe)=>pT=lDe,Argument:(lDe)=>mT=lDe,Help:(lDe)=>fT=lDe,CommanderError:(lDe)=>gT=lDe,InvalidArgumentError:(lDe)=>AT=lDe,InvalidOptionArgumentError:(lDe)=>hT=lDe});var{Argument:iT}=mh(),{Command:uw}=rT(),{CommanderError:a9,InvalidArgumentError:oT}=jm(),{Help:c9}=sw(),{Option:sT}=aw();var aT=new uw,cT=(e)=>new uw(e),lT=(e,t)=>new sT(e,t),uT=(e,t)=>new iT(e,t),dT=uw,pT=sT,mT=iT,fT=c9,gT=a9,AT=oT,hT=oT;var{program:dDe,createCommand:pDe,createArgument:mDe,createOption:fDe,CommanderError:yT,InvalidArgumentError:gDe,InvalidOptionArgumentError:ADe,Command:bT,Argument:hDe,Option:yDe,Help:bDe}=dw;var fh={name:"@sequenzy/cli",version:"0.0.191",description:"Sequenzy CLI for email marketing from the terminal",type:"module",bin:{sequenzy:"./dist/index.js"},main:"./src/index.tsx",types:"./src/index.tsx",exports:{".":"./src/index.tsx"},scripts:{dev:"bun --watch src/index.tsx",build:"bun ../../scripts/build-ink-cli.ts",start:"node dist/index.js",lint:"eslint src","type-check":"bun check",test:"sh ../../scripts/run-package-tests.sh src","test:watch":"bun test --watch",prepublishOnly:"bun run build"},dependencies:{commander:"^12.1.0",ink:"^5.0.1","ink-spinner":"^5.0.0","ink-text-input":"^6.0.0","ink-select-input":"^6.0.0","ink-table":"^3.1.0",open:"^10.1.0",react:"^18.3.1",conf:"^13.0.0"},devDependencies:{"@emailer/shared":"workspace:*","@types/bun":"latest","@types/node":"^22.0.0","@types/react":"^18.3.0","bun-types":"latest",typescript:"^7.0.2"},files:["dist"],keywords:["sequenzy","email","cli","marketing"],license:"MIT",repository:{type:"git",url:"https://github.com/sequenzy/sequenzy"}};import{isDeepStrictEqual as Ice}from"node:util";import p1 from"node:process";import au from"node:fs";import m1 from"node:path";import ff from"node:crypto";import Cce from"node:assert";var eu=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")};var pw=new Set(["__proto__","prototype","constructor"]),u9=new Set("0123456789");function gh(e){let t=[],n="",r="start",i=!1;for(let a of e)switch(a){case"\\":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(i)n+=a;r="property",i=!i;break}case".":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="property";break}if(i){i=!1,n+=a;break}if(pw.has(n))return[];t.push(n),n="",r="property";break}case"[":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="index";break}if(i){i=!1,n+=a;break}if(r==="property"){if(pw.has(n))return[];t.push(n),n=""}r="index";break}case"]":{if(r==="index"){t.push(Number.parseInt(n,10)),n="",r="indexEnd";break}if(r==="indexEnd")throw Error("Invalid character after an index")}default:{if(r==="index"&&!u9.has(a))throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(r==="start")r="property";if(i)i=!1,n+="\\";n+=a}}if(i)n+="\\";switch(r){case"property":{if(pw.has(n))return[];t.push(n);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function mw(e,t){if(typeof t!=="number"&&Array.isArray(e)){let n=Number.parseInt(t,10);return Number.isInteger(n)&&e[n]===e[t]}return!1}function vT(e,t){if(mw(e,t))throw Error("Cannot use string index")}function ET(e,t,n){if(!eu(e)||typeof t!=="string")return n===void 0?e:n;let r=gh(t);if(r.length===0)return n;for(let i=0;i<r.length;i++){let a=r[i];if(mw(e,a))e=i===r.length-1?void 0:null;else e=e[a];if(e===void 0||e===null){if(i!==r.length-1)return n;break}}return e===void 0?n:e}function fw(e,t,n){if(!eu(e)||typeof t!=="string")return e;let r=e,i=gh(t);for(let a=0;a<i.length;a++){let c=i[a];if(vT(e,c),a===i.length-1)e[c]=n;else if(!eu(e[c]))e[c]=typeof i[a+1]==="number"?[]:{};e=e[c]}return r}function IT(e,t){if(!eu(e)||typeof t!=="string")return!1;let n=gh(t);for(let r=0;r<n.length;r++){let i=n[r];if(vT(e,i),r===n.length-1)return delete e[i],!0;if(e=e[i],!eu(e))return!1}}function CT(e,t){if(!eu(e)||typeof t!=="string")return!1;let n=gh(t);if(n.length===0)return!1;for(let r of n){if(!eu(e)||!(r in e)||mw(e,r))return!1;e=e[r]}return!0}import Yn from"node:path";import wT from"node:os";import gw from"node:process";var Nc=wT.homedir(),Aw=wT.tmpdir(),{env:Cd}=gw,d9=(e)=>{let t=Yn.join(Nc,"Library");return{data:Yn.join(t,"Application Support",e),config:Yn.join(t,"Preferences",e),cache:Yn.join(t,"Caches",e),log:Yn.join(t,"Logs",e),temp:Yn.join(Aw,e)}},p9=(e)=>{let t=Cd.APPDATA||Yn.join(Nc,"AppData","Roaming"),n=Cd.LOCALAPPDATA||Yn.join(Nc,"AppData","Local");return{data:Yn.join(n,e,"Data"),config:Yn.join(t,e,"Config"),cache:Yn.join(n,e,"Cache"),log:Yn.join(n,e,"Log"),temp:Yn.join(Aw,e)}},m9=(e)=>{let t=Yn.basename(Nc);return{data:Yn.join(Cd.XDG_DATA_HOME||Yn.join(Nc,".local","share"),e),config:Yn.join(Cd.XDG_CONFIG_HOME||Yn.join(Nc,".config"),e),cache:Yn.join(Cd.XDG_CACHE_HOME||Yn.join(Nc,".cache"),e),log:Yn.join(Cd.XDG_STATE_HOME||Yn.join(Nc,".local","state"),e),temp:Yn.join(Aw,t,e)}};function hw(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(gw.platform==="darwin")return d9(e);if(gw.platform==="win32")return p9(e);return m9(e)}import E9 from"node:path";import nn from"node:fs";import{promisify as wi}from"node:util";var f9=(e,t)=>{let{onError:n}=t;return function(...i){return e.apply(void 0,i).catch(n)}},ra=f9;var g9=(e,t)=>{let{onError:n}=t;return function(...i){try{return e.apply(void 0,i)}catch(a){return n(a)}}},bs=g9;var ST=250;var A9=(e,t)=>{let{isRetriable:n}=t;return function(i){let{timeout:a}=i,c=i.interval??ST,l=Date.now()+a;return function d(...f){return e.apply(void 0,f).catch((h)=>{if(!n(h))throw h;if(Date.now()>=l)throw h;let y=Math.round(c*Math.random());if(y>0)return new Promise((C)=>setTimeout(C,y)).then(()=>d.apply(void 0,f));else return d.apply(void 0,f)})}}},ia=A9;var h9=(e,t)=>{let{isRetriable:n}=t;return function(i){let{timeout:a}=i,c=Date.now()+a;return function(...d){while(!0)try{return e.apply(void 0,d)}catch(f){if(!n(f))throw f;if(Date.now()>=c)throw f;continue}}}},oa=h9;import BT from"node:process";var zm={isChangeErrorOk:(e)=>{if(!zm.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!DT&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!zm.isNodeError(e))return!1;let{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM")return!0;return!1},onChangeError:(e)=>{if(!zm.isNodeError(e))throw e;if(zm.isChangeErrorOk(e))return;throw e}},yw=zm;var Mm={onError:yw.onChangeError},no={onError:()=>{return}},DT=BT.getuid?!BT.getuid():!1,Ai={isRetriable:yw.isRetriableError};var y9={attempt:{chmod:ra(wi(nn.chmod),Mm),chown:ra(wi(nn.chown),Mm),close:ra(wi(nn.close),no),fsync:ra(wi(nn.fsync),no),mkdir:ra(wi(nn.mkdir),no),realpath:ra(wi(nn.realpath),no),stat:ra(wi(nn.stat),no),unlink:ra(wi(nn.unlink),no),chmodSync:bs(nn.chmodSync,Mm),chownSync:bs(nn.chownSync,Mm),closeSync:bs(nn.closeSync,no),existsSync:bs(nn.existsSync,no),fsyncSync:bs(nn.fsync,no),mkdirSync:bs(nn.mkdirSync,no),realpathSync:bs(nn.realpathSync,no),statSync:bs(nn.statSync,no),unlinkSync:bs(nn.unlinkSync,no)},retry:{close:ia(wi(nn.close),Ai),fsync:ia(wi(nn.fsync),Ai),open:ia(wi(nn.open),Ai),readFile:ia(wi(nn.readFile),Ai),rename:ia(wi(nn.rename),Ai),stat:ia(wi(nn.stat),Ai),write:ia(wi(nn.write),Ai),writeFile:ia(wi(nn.writeFile),Ai),closeSync:oa(nn.closeSync,Ai),fsyncSync:oa(nn.fsyncSync,Ai),openSync:oa(nn.openSync,Ai),readFileSync:oa(nn.readFileSync,Ai),renameSync:oa(nn.renameSync,Ai),statSync:oa(nn.statSync,Ai),writeSync:oa(nn.writeSync,Ai),writeFileSync:oa(nn.writeFileSync,Ai)}},Xr=y9;import tu from"node:process";var _T="utf8",bw=438,xT=511;var kT={},RT=tu.geteuid?tu.geteuid():-1,TT=tu.getegid?tu.getegid():-1;var QT=1000,$T=!!tu.getuid,KDe=tu.getuid?!tu.getuid():!1,vw=128;var NT=(e)=>e instanceof Error&&("code"in e);var Ew=(e)=>typeof e==="string",Ah=(e)=>e===void 0;import v9 from"node:path";import wd from"node:process";import OT from"node:process";var PT=OT.platform==="linux",hh=OT.platform==="win32";var Iw=["SIGHUP","SIGINT","SIGTERM"];if(!hh)Iw.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(PT)Iw.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var qT=Iw;class FT{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(e)=>{if(this.exited)return;this.exited=!0;for(let t of this.callbacks)t();if(e)if(hh&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))wd.kill(wd.pid,"SIGTERM");else wd.kill(wd.pid,e)},this.hook=()=>{wd.once("exit",()=>this.exit());for(let e of qT)try{wd.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var LT=new FT;var b9=LT.register,UT=b9;var Bo={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),n=Date.now().toString().slice(-10),r="tmp-",i=`.tmp-${n}${t}`;return`${e}${i}`},get:(e,t,n=!0)=>{let r=Bo.truncate(t(e));if(r in Bo.store)return Bo.get(e,t,n);return Bo.store[r]=n,[r,()=>delete Bo.store[r]]},purge:(e)=>{if(!Bo.store[e])return;delete Bo.store[e],Xr.attempt.unlink(e)},purgeSync:(e)=>{if(!Bo.store[e])return;delete Bo.store[e],Xr.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Bo.store)Bo.purgeSync(e)},truncate:(e)=>{let t=v9.basename(e);if(t.length<=vw)return e;let n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;let r=t.length-vw;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};UT(Bo.purgeSyncAll);var Hm=Bo;function Cw(e,t,n=kT){if(Ew(n))return Cw(e,t,{encoding:n});let i={timeout:n.timeout??QT},a=null,c=null,l=null;try{let d=Xr.attempt.realpathSync(e),f=!!d;e=d||e,[c,a]=Hm.get(e,n.tmpCreate||Hm.create,n.tmpPurge!==!1);let h=$T&&Ah(n.chown),y=Ah(n.mode);if(f&&(h||y)){let v=Xr.attempt.statSync(e);if(v){if(n={...n},h)n.chown={uid:v.uid,gid:v.gid};if(y)n.mode=v.mode}}if(!f){let v=E9.dirname(e);Xr.attempt.mkdirSync(v,{mode:xT,recursive:!0})}if(l=Xr.retry.openSync(i)(c,"w",n.mode||bw),n.tmpCreated)n.tmpCreated(c);if(Ew(t))Xr.retry.writeSync(i)(l,t,0,n.encoding||_T);else if(!Ah(t))Xr.retry.writeSync(i)(l,t,0,t.length,0);if(n.fsync!==!1)if(n.fsyncWait!==!1)Xr.retry.fsyncSync(i)(l);else Xr.attempt.fsync(l);if(Xr.retry.closeSync(i)(l),l=null,n.chown&&(n.chown.uid!==RT||n.chown.gid!==TT))Xr.attempt.chownSync(c,n.chown.uid,n.chown.gid);if(n.mode&&n.mode!==bw)Xr.attempt.chmodSync(c,n.mode);try{Xr.retry.renameSync(i)(c,e)}catch(v){if(!NT(v))throw v;if(v.code!=="ENAMETOOLONG")throw v;Xr.retry.renameSync(i)(c,Hm.truncate(e))}a(),c=null}finally{if(l)Xr.attempt.closeSync(l);if(c)Hm.purge(c)}}var g1=yt(ZP(),1),A1=yt(vq(),1);var goe=(e,t,n,r)=>{if(n==="length"||n==="prototype")return;if(n==="arguments"||n==="caller")return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);if(!Aoe(i,a)&&r)return;Object.defineProperty(e,n,a)},Aoe=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},hoe=(e,t)=>{let n=Object.getPrototypeOf(t);if(n===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,n)},yoe=(e,t)=>`/* Wrapped ${e}*/
194
+ <%s key={someKey} {...props} />`,Qs,bo,$s,bo),gc[bo+Qs]=!0}}if(Q===n)Pr(dn);else Ni(dn);return dn}}var fr=Rl;Gye.Fragment=n,Gye.jsxDEV=fr})()});var dw={};RZ(dw,{program:()=>aT,createCommand:()=>cT,createOption:()=>lT,createArgument:()=>uT,Command:()=>dT,Option:()=>pT,Argument:()=>mT,Help:()=>fT,CommanderError:()=>gT,InvalidArgumentError:()=>AT,InvalidOptionArgumentError:()=>hT},{program:(lDe)=>aT=lDe,createCommand:(lDe)=>cT=lDe,createOption:(lDe)=>lT=lDe,createArgument:(lDe)=>uT=lDe,Command:(lDe)=>dT=lDe,Option:(lDe)=>pT=lDe,Argument:(lDe)=>mT=lDe,Help:(lDe)=>fT=lDe,CommanderError:(lDe)=>gT=lDe,InvalidArgumentError:(lDe)=>AT=lDe,InvalidOptionArgumentError:(lDe)=>hT=lDe});var{Argument:iT}=mh(),{Command:uw}=rT(),{CommanderError:a9,InvalidArgumentError:oT}=jm(),{Help:c9}=sw(),{Option:sT}=aw();var aT=new uw,cT=(e)=>new uw(e),lT=(e,t)=>new sT(e,t),uT=(e,t)=>new iT(e,t),dT=uw,pT=sT,mT=iT,fT=c9,gT=a9,AT=oT,hT=oT;var{program:dDe,createCommand:pDe,createArgument:mDe,createOption:fDe,CommanderError:yT,InvalidArgumentError:gDe,InvalidOptionArgumentError:ADe,Command:bT,Argument:hDe,Option:yDe,Help:bDe}=dw;var fh={name:"@sequenzy/cli",version:"0.0.192",description:"Sequenzy CLI for email marketing from the terminal",type:"module",bin:{sequenzy:"./dist/index.js"},main:"./src/index.tsx",types:"./src/index.tsx",exports:{".":"./src/index.tsx"},scripts:{dev:"bun --watch src/index.tsx",build:"bun ../../scripts/build-ink-cli.ts",start:"node dist/index.js",lint:"eslint src","type-check":"bun check",test:"sh ../../scripts/run-package-tests.sh src","test:watch":"bun test --watch",prepublishOnly:"bun run build"},dependencies:{commander:"^12.1.0",ink:"^5.0.1","ink-spinner":"^5.0.0","ink-text-input":"^6.0.0","ink-select-input":"^6.0.0","ink-table":"^3.1.0",open:"^10.1.0",react:"^18.3.1",conf:"^13.0.0"},devDependencies:{"@emailer/shared":"workspace:*","@types/bun":"latest","@types/node":"^22.0.0","@types/react":"^18.3.0","bun-types":"latest",typescript:"^7.0.2"},files:["dist"],keywords:["sequenzy","email","cli","marketing"],license:"MIT",repository:{type:"git",url:"https://github.com/sequenzy/sequenzy"}};import{isDeepStrictEqual as Ice}from"node:util";import p1 from"node:process";import au from"node:fs";import m1 from"node:path";import ff from"node:crypto";import Cce from"node:assert";var eu=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")};var pw=new Set(["__proto__","prototype","constructor"]),u9=new Set("0123456789");function gh(e){let t=[],n="",r="start",i=!1;for(let a of e)switch(a){case"\\":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(i)n+=a;r="property",i=!i;break}case".":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="property";break}if(i){i=!1,n+=a;break}if(pw.has(n))return[];t.push(n),n="",r="property";break}case"[":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="index";break}if(i){i=!1,n+=a;break}if(r==="property"){if(pw.has(n))return[];t.push(n),n=""}r="index";break}case"]":{if(r==="index"){t.push(Number.parseInt(n,10)),n="",r="indexEnd";break}if(r==="indexEnd")throw Error("Invalid character after an index")}default:{if(r==="index"&&!u9.has(a))throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(r==="start")r="property";if(i)i=!1,n+="\\";n+=a}}if(i)n+="\\";switch(r){case"property":{if(pw.has(n))return[];t.push(n);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function mw(e,t){if(typeof t!=="number"&&Array.isArray(e)){let n=Number.parseInt(t,10);return Number.isInteger(n)&&e[n]===e[t]}return!1}function vT(e,t){if(mw(e,t))throw Error("Cannot use string index")}function ET(e,t,n){if(!eu(e)||typeof t!=="string")return n===void 0?e:n;let r=gh(t);if(r.length===0)return n;for(let i=0;i<r.length;i++){let a=r[i];if(mw(e,a))e=i===r.length-1?void 0:null;else e=e[a];if(e===void 0||e===null){if(i!==r.length-1)return n;break}}return e===void 0?n:e}function fw(e,t,n){if(!eu(e)||typeof t!=="string")return e;let r=e,i=gh(t);for(let a=0;a<i.length;a++){let c=i[a];if(vT(e,c),a===i.length-1)e[c]=n;else if(!eu(e[c]))e[c]=typeof i[a+1]==="number"?[]:{};e=e[c]}return r}function IT(e,t){if(!eu(e)||typeof t!=="string")return!1;let n=gh(t);for(let r=0;r<n.length;r++){let i=n[r];if(vT(e,i),r===n.length-1)return delete e[i],!0;if(e=e[i],!eu(e))return!1}}function CT(e,t){if(!eu(e)||typeof t!=="string")return!1;let n=gh(t);if(n.length===0)return!1;for(let r of n){if(!eu(e)||!(r in e)||mw(e,r))return!1;e=e[r]}return!0}import Yn from"node:path";import wT from"node:os";import gw from"node:process";var Nc=wT.homedir(),Aw=wT.tmpdir(),{env:Cd}=gw,d9=(e)=>{let t=Yn.join(Nc,"Library");return{data:Yn.join(t,"Application Support",e),config:Yn.join(t,"Preferences",e),cache:Yn.join(t,"Caches",e),log:Yn.join(t,"Logs",e),temp:Yn.join(Aw,e)}},p9=(e)=>{let t=Cd.APPDATA||Yn.join(Nc,"AppData","Roaming"),n=Cd.LOCALAPPDATA||Yn.join(Nc,"AppData","Local");return{data:Yn.join(n,e,"Data"),config:Yn.join(t,e,"Config"),cache:Yn.join(n,e,"Cache"),log:Yn.join(n,e,"Log"),temp:Yn.join(Aw,e)}},m9=(e)=>{let t=Yn.basename(Nc);return{data:Yn.join(Cd.XDG_DATA_HOME||Yn.join(Nc,".local","share"),e),config:Yn.join(Cd.XDG_CONFIG_HOME||Yn.join(Nc,".config"),e),cache:Yn.join(Cd.XDG_CACHE_HOME||Yn.join(Nc,".cache"),e),log:Yn.join(Cd.XDG_STATE_HOME||Yn.join(Nc,".local","state"),e),temp:Yn.join(Aw,t,e)}};function hw(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(gw.platform==="darwin")return d9(e);if(gw.platform==="win32")return p9(e);return m9(e)}import E9 from"node:path";import nn from"node:fs";import{promisify as wi}from"node:util";var f9=(e,t)=>{let{onError:n}=t;return function(...i){return e.apply(void 0,i).catch(n)}},ra=f9;var g9=(e,t)=>{let{onError:n}=t;return function(...i){try{return e.apply(void 0,i)}catch(a){return n(a)}}},bs=g9;var ST=250;var A9=(e,t)=>{let{isRetriable:n}=t;return function(i){let{timeout:a}=i,c=i.interval??ST,l=Date.now()+a;return function d(...f){return e.apply(void 0,f).catch((h)=>{if(!n(h))throw h;if(Date.now()>=l)throw h;let y=Math.round(c*Math.random());if(y>0)return new Promise((C)=>setTimeout(C,y)).then(()=>d.apply(void 0,f));else return d.apply(void 0,f)})}}},ia=A9;var h9=(e,t)=>{let{isRetriable:n}=t;return function(i){let{timeout:a}=i,c=Date.now()+a;return function(...d){while(!0)try{return e.apply(void 0,d)}catch(f){if(!n(f))throw f;if(Date.now()>=c)throw f;continue}}}},oa=h9;import BT from"node:process";var zm={isChangeErrorOk:(e)=>{if(!zm.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!DT&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!zm.isNodeError(e))return!1;let{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM")return!0;return!1},onChangeError:(e)=>{if(!zm.isNodeError(e))throw e;if(zm.isChangeErrorOk(e))return;throw e}},yw=zm;var Mm={onError:yw.onChangeError},no={onError:()=>{return}},DT=BT.getuid?!BT.getuid():!1,Ai={isRetriable:yw.isRetriableError};var y9={attempt:{chmod:ra(wi(nn.chmod),Mm),chown:ra(wi(nn.chown),Mm),close:ra(wi(nn.close),no),fsync:ra(wi(nn.fsync),no),mkdir:ra(wi(nn.mkdir),no),realpath:ra(wi(nn.realpath),no),stat:ra(wi(nn.stat),no),unlink:ra(wi(nn.unlink),no),chmodSync:bs(nn.chmodSync,Mm),chownSync:bs(nn.chownSync,Mm),closeSync:bs(nn.closeSync,no),existsSync:bs(nn.existsSync,no),fsyncSync:bs(nn.fsync,no),mkdirSync:bs(nn.mkdirSync,no),realpathSync:bs(nn.realpathSync,no),statSync:bs(nn.statSync,no),unlinkSync:bs(nn.unlinkSync,no)},retry:{close:ia(wi(nn.close),Ai),fsync:ia(wi(nn.fsync),Ai),open:ia(wi(nn.open),Ai),readFile:ia(wi(nn.readFile),Ai),rename:ia(wi(nn.rename),Ai),stat:ia(wi(nn.stat),Ai),write:ia(wi(nn.write),Ai),writeFile:ia(wi(nn.writeFile),Ai),closeSync:oa(nn.closeSync,Ai),fsyncSync:oa(nn.fsyncSync,Ai),openSync:oa(nn.openSync,Ai),readFileSync:oa(nn.readFileSync,Ai),renameSync:oa(nn.renameSync,Ai),statSync:oa(nn.statSync,Ai),writeSync:oa(nn.writeSync,Ai),writeFileSync:oa(nn.writeFileSync,Ai)}},Xr=y9;import tu from"node:process";var _T="utf8",bw=438,xT=511;var kT={},RT=tu.geteuid?tu.geteuid():-1,TT=tu.getegid?tu.getegid():-1;var QT=1000,$T=!!tu.getuid,KDe=tu.getuid?!tu.getuid():!1,vw=128;var NT=(e)=>e instanceof Error&&("code"in e);var Ew=(e)=>typeof e==="string",Ah=(e)=>e===void 0;import v9 from"node:path";import wd from"node:process";import OT from"node:process";var PT=OT.platform==="linux",hh=OT.platform==="win32";var Iw=["SIGHUP","SIGINT","SIGTERM"];if(!hh)Iw.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(PT)Iw.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var qT=Iw;class FT{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(e)=>{if(this.exited)return;this.exited=!0;for(let t of this.callbacks)t();if(e)if(hh&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))wd.kill(wd.pid,"SIGTERM");else wd.kill(wd.pid,e)},this.hook=()=>{wd.once("exit",()=>this.exit());for(let e of qT)try{wd.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var LT=new FT;var b9=LT.register,UT=b9;var Bo={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),n=Date.now().toString().slice(-10),r="tmp-",i=`.tmp-${n}${t}`;return`${e}${i}`},get:(e,t,n=!0)=>{let r=Bo.truncate(t(e));if(r in Bo.store)return Bo.get(e,t,n);return Bo.store[r]=n,[r,()=>delete Bo.store[r]]},purge:(e)=>{if(!Bo.store[e])return;delete Bo.store[e],Xr.attempt.unlink(e)},purgeSync:(e)=>{if(!Bo.store[e])return;delete Bo.store[e],Xr.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Bo.store)Bo.purgeSync(e)},truncate:(e)=>{let t=v9.basename(e);if(t.length<=vw)return e;let n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;let r=t.length-vw;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};UT(Bo.purgeSyncAll);var Hm=Bo;function Cw(e,t,n=kT){if(Ew(n))return Cw(e,t,{encoding:n});let i={timeout:n.timeout??QT},a=null,c=null,l=null;try{let d=Xr.attempt.realpathSync(e),f=!!d;e=d||e,[c,a]=Hm.get(e,n.tmpCreate||Hm.create,n.tmpPurge!==!1);let h=$T&&Ah(n.chown),y=Ah(n.mode);if(f&&(h||y)){let v=Xr.attempt.statSync(e);if(v){if(n={...n},h)n.chown={uid:v.uid,gid:v.gid};if(y)n.mode=v.mode}}if(!f){let v=E9.dirname(e);Xr.attempt.mkdirSync(v,{mode:xT,recursive:!0})}if(l=Xr.retry.openSync(i)(c,"w",n.mode||bw),n.tmpCreated)n.tmpCreated(c);if(Ew(t))Xr.retry.writeSync(i)(l,t,0,n.encoding||_T);else if(!Ah(t))Xr.retry.writeSync(i)(l,t,0,t.length,0);if(n.fsync!==!1)if(n.fsyncWait!==!1)Xr.retry.fsyncSync(i)(l);else Xr.attempt.fsync(l);if(Xr.retry.closeSync(i)(l),l=null,n.chown&&(n.chown.uid!==RT||n.chown.gid!==TT))Xr.attempt.chownSync(c,n.chown.uid,n.chown.gid);if(n.mode&&n.mode!==bw)Xr.attempt.chmodSync(c,n.mode);try{Xr.retry.renameSync(i)(c,e)}catch(v){if(!NT(v))throw v;if(v.code!=="ENAMETOOLONG")throw v;Xr.retry.renameSync(i)(c,Hm.truncate(e))}a(),c=null}finally{if(l)Xr.attempt.closeSync(l);if(c)Hm.purge(c)}}var g1=yt(ZP(),1),A1=yt(vq(),1);var goe=(e,t,n,r)=>{if(n==="length"||n==="prototype")return;if(n==="arguments"||n==="caller")return;let i=Object.getOwnPropertyDescriptor(e,n),a=Object.getOwnPropertyDescriptor(t,n);if(!Aoe(i,a)&&r)return;Object.defineProperty(e,n,a)},Aoe=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},hoe=(e,t)=>{let n=Object.getPrototypeOf(t);if(n===Object.getPrototypeOf(e))return;Object.setPrototypeOf(e,n)},yoe=(e,t)=>`/* Wrapped ${e}*/
195
195
  ${t}`,boe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),voe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Eoe=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,i=yoe.bind(null,r,t.toString());Object.defineProperty(i,"name",voe);let{writable:a,enumerable:c,configurable:l}=boe;Object.defineProperty(e,"toString",{value:i,writable:a,enumerable:c,configurable:l})};function SS(e,t,{ignoreNonConfigurable:n=!1}={}){let{name:r}=e;for(let i of Reflect.ownKeys(t))goe(e,t,i,n);return hoe(e,t),Eoe(e,t,r),e}var Ioe=(e,t={})=>{if(typeof e!=="function")throw TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);let{wait:n=0,maxWait:r=Number.POSITIVE_INFINITY,before:i=!1,after:a=!0}=t;if(n<0||r<0)throw RangeError("`wait` and `maxWait` must not be negative.");if(!i&&!a)throw Error("Both `before` and `after` are false, function wouldn't be called.");let c,l,d,f=function(...h){let y=this,v=()=>{if(c=void 0,l)clearTimeout(l),l=void 0;if(a)d=e.apply(y,h)},C=()=>{if(l=void 0,c)clearTimeout(c),c=void 0;if(a)d=e.apply(y,h)},R=i&&!c;if(clearTimeout(c),c=setTimeout(v,n),r>0&&r!==Number.POSITIVE_INFINITY&&!l)l=setTimeout(C,r);if(R)d=e.apply(y,h);return d};return SS(f,e),f.cancel=()=>{if(c)clearTimeout(c),c=void 0;if(l)clearTimeout(l),l=void 0},f},DS=Ioe;var cu=yt(c1(),1);var gce=Object.prototype.toString;function u1(e,t,n){if(!e)return!1;if(e.constructor===t)return!0;return gce.call(e)===n}function d1(e){return u1(e,Uint8Array,"[object Uint8Array]")}function Ace(e){return u1(e,ArrayBuffer,"[object ArrayBuffer]")}function hce(e){return d1(e)||Ace(e)}function yce(e){if(!d1(e))throw TypeError(`Expected \`Uint8Array\`, got \`${typeof e}\``)}function bce(e){if(!hce(e))throw TypeError(`Expected \`Uint8Array\` or \`ArrayBuffer\`, got \`${typeof e}\``)}function LS(e,t){if(e.length===0)return new Uint8Array(0);t??=e.reduce((i,a)=>i+a.length,0);let n=new Uint8Array(t),r=0;for(let i of e)yce(i),n.set(i,r),r+=i.length;return n}var l1={utf8:new globalThis.TextDecoder("utf8")};function US(e,t="utf8"){return bce(e),l1[t]??=new globalThis.TextDecoder(t),l1[t].decode(e)}function vce(e){if(typeof e!=="string")throw TypeError(`Expected \`string\`, got \`${typeof e}\``)}var Ece=new globalThis.TextEncoder;function xy(e){return vce(e),Ece.encode(e)}var Pke=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));var wce=A1.default.default,f1="aes-256-cbc",Yd=()=>Object.create(null),Sce=(e)=>e!==void 0&&e!==null,Dce=(e,t)=>{let n=new Set(["undefined","symbol","function"]),r=typeof t;if(n.has(r))throw TypeError(`Setting a value of type \`${r}\` for key \`${e}\` is not allowed as it's not supported by JSON`)},ky="__internal__",jS=`${ky}.migrations.version`;class Ry{path;events;#r;#t;#e;#n={};constructor(e={}){let t={configName:"config",fileExtension:"json",projectSuffix:"nodejs",clearInvalidConfig:!1,accessPropertiesByDotNotation:!0,configFileMode:438,...e};if(!t.cwd){if(!t.projectName)throw Error("Please specify the `projectName` option.");t.cwd=hw(t.projectName,{suffix:t.projectSuffix}).config}if(this.#e=t,t.schema??t.ajvOptions??t.rootSchema){if(t.schema&&typeof t.schema!=="object")throw TypeError("The `schema` option must be an object.");let a=new g1.Ajv2020({allErrors:!0,useDefaults:!0,...t.ajvOptions});wce(a);let c={...t.rootSchema,type:"object",properties:t.schema};this.#r=a.compile(c);for(let[l,d]of Object.entries(t.schema??{}))if(d?.default)this.#n[l]=d.default}if(t.defaults)this.#n={...this.#n,...t.defaults};if(t.serialize)this._serialize=t.serialize;if(t.deserialize)this._deserialize=t.deserialize;this.events=new EventTarget,this.#t=t.encryptionKey;let n=t.fileExtension?`.${t.fileExtension}`:"";this.path=m1.resolve(t.cwd,`${t.configName??"config"}${n}`);let r=this.store,i=Object.assign(Yd(),t.defaults,r);if(t.migrations){if(!t.projectVersion)throw Error("Please specify the `projectVersion` option.");this._migrate(t.migrations,t.projectVersion,t.beforeEachMigration)}this._validate(i);try{Cce.deepEqual(r,i)}catch{this.store=i}if(t.watch)this._watch()}get(e,t){if(this.#e.accessPropertiesByDotNotation)return this._get(e,t);let{store:n}=this;return e in n?n[e]:t}set(e,t){if(typeof e!=="string"&&typeof e!=="object")throw TypeError(`Expected \`key\` to be of type \`string\` or \`object\`, got ${typeof e}`);if(typeof e!=="object"&&t===void 0)throw TypeError("Use `delete()` to clear values");if(this._containsReservedKey(e))throw TypeError(`Please don't use the ${ky} key, as it's used to manage this module internal operations.`);let{store:n}=this,r=(i,a)=>{if(Dce(i,a),this.#e.accessPropertiesByDotNotation)fw(n,i,a);else n[i]=a};if(typeof e==="object"){let i=e;for(let[a,c]of Object.entries(i))r(a,c)}else r(e,t);this.store=n}has(e){if(this.#e.accessPropertiesByDotNotation)return CT(this.store,e);return e in this.store}reset(...e){for(let t of e)if(Sce(this.#n[t]))this.set(t,this.#n[t])}delete(e){let{store:t}=this;if(this.#e.accessPropertiesByDotNotation)IT(t,e);else delete t[e];this.store=t}clear(){this.store=Yd();for(let e of Object.keys(this.#n))this.reset(e)}onDidChange(e,t){if(typeof e!=="string")throw TypeError(`Expected \`key\` to be of type \`string\`, got ${typeof e}`);if(typeof t!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof t}`);return this._handleChange(()=>this.get(e),t)}onDidAnyChange(e){if(typeof e!=="function")throw TypeError(`Expected \`callback\` to be of type \`function\`, got ${typeof e}`);return this._handleChange(()=>this.store,e)}get size(){return Object.keys(this.store).length}get store(){try{let e=au.readFileSync(this.path,this.#t?null:"utf8"),t=this._encryptData(e),n=this._deserialize(t);return this._validate(n),Object.assign(Yd(),n)}catch(e){if(e?.code==="ENOENT")return this._ensureDirectory(),Yd();if(this.#e.clearInvalidConfig&&e.name==="SyntaxError")return Yd();throw e}}set store(e){this._ensureDirectory(),this._validate(e),this._write(e),this.events.dispatchEvent(new Event("change"))}*[Symbol.iterator](){for(let[e,t]of Object.entries(this.store))yield[e,t]}_encryptData(e){if(!this.#t)return typeof e==="string"?e:US(e);try{let t=e.slice(0,16),n=ff.pbkdf2Sync(this.#t,t.toString(),1e4,32,"sha512"),r=ff.createDecipheriv(f1,n,t),i=e.slice(17),a=typeof i==="string"?xy(i):i;return US(LS([r.update(a),r.final()]))}catch{}return e.toString()}_handleChange(e,t){let n=e(),r=()=>{let i=n,a=e();if(Ice(a,i))return;n=a,t.call(this,a,i)};return this.events.addEventListener("change",r),()=>{this.events.removeEventListener("change",r)}}_deserialize=(e)=>JSON.parse(e);_serialize=(e)=>JSON.stringify(e,void 0,"\t");_validate(e){if(!this.#r)return;if(this.#r(e)||!this.#r.errors)return;let n=this.#r.errors.map(({instancePath:r,message:i=""})=>`\`${r.slice(1)}\` ${i}`);throw Error("Config schema violation: "+n.join("; "))}_ensureDirectory(){au.mkdirSync(m1.dirname(this.path),{recursive:!0})}_write(e){let t=this._serialize(e);if(this.#t){let n=ff.randomBytes(16),r=ff.pbkdf2Sync(this.#t,n.toString(),1e4,32,"sha512"),i=ff.createCipheriv(f1,r,n);t=LS([n,xy(":"),i.update(xy(t)),i.final()])}if(p1.env.SNAP)au.writeFileSync(this.path,t,{mode:this.#e.configFileMode});else try{Cw(this.path,t,{mode:this.#e.configFileMode})}catch(n){if(n?.code==="EXDEV"){au.writeFileSync(this.path,t,{mode:this.#e.configFileMode});return}throw n}}_watch(){if(this._ensureDirectory(),!au.existsSync(this.path))this._write(Yd());if(p1.platform==="win32")au.watch(this.path,{persistent:!1},DS(()=>{this.events.dispatchEvent(new Event("change"))},{wait:100}));else au.watchFile(this.path,{persistent:!1},DS(()=>{this.events.dispatchEvent(new Event("change"))},{wait:5000}))}_migrate(e,t,n){let r=this._get(jS,"0.0.0"),i=Object.keys(e).filter((c)=>this._shouldPerformMigration(c,r,t)),a={...this.store};for(let c of i)try{if(n)n(this,{fromVersion:r,toVersion:c,finalVersion:t,versions:i});let l=e[c];l?.(this),this._set(jS,c),r=c,a={...this.store}}catch(l){throw this.store=a,Error(`Something went wrong during the migration! Changes applied to the store until this failed migration will be restored. ${l}`)}if(this._isVersionInRangeFormat(r)||!cu.default.eq(r,t))this._set(jS,t)}_containsReservedKey(e){if(typeof e==="object"){if(Object.keys(e)[0]===ky)return!0}if(typeof e!=="string")return!1;if(this.#e.accessPropertiesByDotNotation){if(e.startsWith(`${ky}.`))return!0;return!1}return!1}_isVersionInRangeFormat(e){return cu.default.clean(e)===null}_shouldPerformMigration(e,t,n){if(this._isVersionInRangeFormat(e)){if(t!=="0.0.0"&&cu.default.satisfies(t,e))return!1;return cu.default.satisfies(n,e)}if(cu.default.lte(e,t))return!1;if(cu.default.gt(e,n))return!1;return!0}_get(e,t){return ET(this.store,e,t)}_set(e,t){let{store:n}=this;fw(n,e,t),this.store=n}}var zS="com.sequenzy.cli",MS="api-key",HS=typeof globalThis.Bun<"u",nl=new Ry({projectName:"sequenzy",schema:{userId:{type:"string"},userEmail:{type:"string"},_apiKey:{type:"string"}}});async function GS(){let e=process.env.SEQUENZY_API_KEY;if(e)return e;if(HS)try{let t=await globalThis.Bun.secrets.get({service:zS,name:MS});if(t)return t}catch{}return nl.get("_apiKey")}async function h1(e){if(HS)try{await globalThis.Bun.secrets.set({service:zS,name:MS,value:e,allowUnrestrictedAccess:!1});return}catch{}nl.set("_apiKey",e)}async function y1(){if(HS)try{await globalThis.Bun.secrets.delete({service:zS,name:MS})}catch{}nl.delete("_apiKey")}async function j(){return!!await GS()}function Ty(){return{userId:nl.get("userId"),userEmail:nl.get("userEmail")}}function b1(e){if(e.userId!==void 0)nl.set("userId",e.userId);if(e.userEmail!==void 0)nl.set("userEmail",e.userEmail)}function v1(){nl.clear()}function E1(e,t=Date.now()){if(!e?.trim())return;let n=e.trim();if(/^\d+$/.test(n)){let i=Number(n);return Number.isSafeInteger(i)?i:void 0}if(!/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), \d{2} [A-Z][a-z]{2} \d{4} \d{2}:\d{2}:\d{2} GMT$/.test(n))return;let r=Date.parse(n);if(!Number.isFinite(r)||new Date(r).toUTCString().slice(5)!==n.slice(5))return;return Math.max(0,Math.ceil((r-t)/1000))}function I1(e,t,n){if(e&&/^[A-Z][A-Z0-9_]{1,95}$/.test(e))return e;switch(t){case 0:return"NETWORK_ERROR";case 400:case 422:return"VALIDATION_ERROR";case 401:return"UNAUTHORIZED";case 403:return"FORBIDDEN";case 404:return"NOT_FOUND";case 409:return"CONFLICT";case 429:return"RATE_LIMITED";default:return t!==void 0?t>=500?"SERVER_ERROR":"HTTP_ERROR":n}}var Bce=process.env.SEQUENZY_API_URL??"https://api.sequenzy.com";class A extends Error{statusCode;rawDetails;code;retryAfterSeconds;constructor(e,t,n,r,i){super(e);this.statusCode=t;this.rawDetails=n;this.code=r;this.retryAfterSeconds=i;this.name="ApiError"}}function _ce(e,t){if(typeof e!=="string")return;if(typeof t!=="string"||t==="root")return e;let n=t.slice(1).replaceAll("/",".");return e.includes(`'${n}'`)?e:`${n}: ${e}`}function xce(e){if(!e.trim())return{message:"Request failed"};try{let t=JSON.parse(e);if(typeof t==="string")return{message:t};if(!t||typeof t!=="object"||Array.isArray(t))return{message:"Request failed"};let n=t,r=n.error&&typeof n.error==="object"?n.error:void 0,i=r?.code??n.code,a=n.type==="validation"?_ce(n.summary,n.property):void 0,c=typeof n.error==="string"?n.error:typeof a==="string"?a:r?.message??n.message;return{message:typeof c==="string"?c:"Request failed",...typeof i==="string"?{code:i}:{}}}catch{return{message:e}}}async function E(e,t,n,r,i){let a=await GS();if(!a)throw new A("Not logged in. Run `sequenzy login` first.",401);let c={"Content-Type":"application/json",Authorization:`Bearer ${a}`,"x-sequenzy-client":`cli/${fh.version}`};if(r)c["x-company-id"]=r;Object.assign(c,i);let l;try{l=await fetch(`${Bce}${t}`,{method:e,headers:c,body:n?JSON.stringify(n):void 0})}catch(d){throw new A(d instanceof Error?d.message:"Failed to reach Sequenzy API",0,void 0,"NETWORK_ERROR")}if(!l.ok){let d=await l.text(),f=xce(d);throw new A(f.message,l.status,d,f.code,E1(l.headers.get("Retry-After")))}return l.json()}var C1=!1;function JS(e){C1=e}function Qy(){return C1}var WS="https://docs.sequenzy.com",Ka=`${WS}/concepts/cli`,VS=`${WS}/authentication`,w1="https://sequenzy.com/dashboard";function S1(e){if(e instanceof A)return{message:e.message,statusCode:e.statusCode,code:e.code,rawDetails:e.rawDetails};if(e instanceof Error)return{message:e.message};return{message:String(e)}}function kce(e){let t=e.match(/api key is missing required scopes?:\s*(.+)$/i);if(!t?.[1])return[];return[...new Set(t[1].match(/[a-z_]+:[a-z_]+/gi)??[])]}function D1(e){let t=S1(e),n=t.message.trim()||"Unknown error",r=n.toLowerCase(),i=t.rawDetails?.trim()||n;if(t.code==="CLI_AUTH_REQUIRED"||r.includes("not logged in"))return{title:"Authentication required",description:"This command needs a Sequenzy API key, but the CLI could not find one in your local login state or environment.",howToFix:"Run `sequenzy login` and approve the session, or set `SEQUENZY_API_KEY` for non-interactive environments.",docsUrl:Ka,details:i};if(r.includes("already logged in"))return{title:"CLI already authenticated",description:"The CLI already has a saved Sequenzy login for this machine.",howToFix:"Run `sequenzy logout` first if you want to switch accounts, then run `sequenzy login` again.",docsUrl:Ka,details:i};if(t.statusCode===401||t.code==="UNAUTHORIZED")return{title:"Authentication failed",description:"The request reached Sequenzy, but the current API key was rejected.",howToFix:"Run `sequenzy login` again, or replace the key with a valid personal API key that still has access to your account.",docsUrl:VS,details:i};if(t.code==="COMPANY_CREATE_REQUIRES_PERSONAL_KEY")return{title:"Personal account key required",description:"Company creation is account-level and cannot be performed with a company/workspace-scoped API key.",howToFix:"Create or use a personal account key beginning with `seq_user_` from Account → API Keys, replace `SEQUENZY_API_KEY`, and retry the same command; alternatively, create the company in the Sequenzy dashboard. Widening the current company key or switching companies will not fix this restriction.",docsUrl:VS,details:i};let a=kce(n);if(a.length>0){let c=a.map((f)=>`\`${f}\``).join(", "),l=a.every((f)=>f.endsWith(":read"))?"the Read-only or Safer agent access preset":"Safer agent access when it covers the task, or Custom permissions",d=a.includes("api_keys:manage")?` This command manages API keys, so the missing scope cannot be granted through the API by the key that is missing it. If the active key has \`account:read\`, run \`sequenzy api-keys handoff\` (add \`--replaces current\` when rotating) to get a dashboard link that opens the create-key form prefilled, then give it to the workspace owner. It creates nothing and never prints a key. If handoff is also denied because \`account:read\` is missing, open ${w1} directly and choose the matching API Keys page.`:"";return{title:"API key permission required",description:`The current API key is valid, but this operation requires the missing ${a.length===1?"scope":"scopes"}: ${c}.`,howToFix:`Permissions can be widened on the key you are already using - no new key and no re-login. Run \`sequenzy account\` to see the active key, its type, and its API Keys settings URL, then have the key owner enable ${c} there. Personal keys open Account → API Keys; company keys open workspace Settings → API Keys. If account metadata is unavailable, open ${w1} directly and choose the matching API Keys page. When the active key type is \`company\` and it holds \`api_keys:manage\`, run \`sequenzy api-keys list --json\` and then \`sequenzy api-keys update <api-key-id> --scopes\` with the current scopes plus ${c}, or \`--preset\` covering all of them (${l}). Personal keys cannot be changed through \`sequenzy api-keys update\`. Both options replace the whole selection rather than merging. Retry the same command once the key is updated. Issuing a replacement key and swapping \`SEQUENZY_API_KEY\` also works but is not required.${d}`,docsUrl:Ka,details:i}}if(t.statusCode===403||r.includes("access denied"))return{title:"Access denied",description:"The current API key is valid, but it does not have permission to perform this action or access the requested company.",howToFix:"Use an API key with access to the target company, or switch to a company you can access before retrying.",docsUrl:VS,details:i};if(t.statusCode===404||r.includes("not found"))return{title:"Requested resource not found",description:"Sequenzy could not find the company, template, campaign, sequence, or subscriber you asked for.",howToFix:"Double-check the ID or email value and list the resource first before retrying the command.",docsUrl:Ka,details:i};if(t.statusCode===429||r.includes("rate limit"))return{title:"Rate limited",description:"Sequenzy temporarily slowed this request because too many requests were sent in a short period.",howToFix:"Wait a moment and retry. If an agent is looping, reduce the retry frequency before calling the CLI again.",docsUrl:Ka,details:i};if(t.code==="AB_TEST_VARIANT_CONTENT_EDIT"||r.includes("update_ab_test_variant")&&(r.includes("a/b test")||r.includes("ab test")))return{title:"A/B variant copy cannot be edited here",description:n,howToFix:"Use `sequenzy ab-tests update-variant` with the `abTestId` and `variantId` from `sequenzy sequences get` or `sequenzy ab-tests get`. Repeat once per variant for a whole-step rewrite. If the sequence is live or the test has activity, pass `--confirm-live-change`. Do not retry with `sequenzy templates update` or `sequenzy sequences update-node`.",docsUrl:`${WS}/concepts/cli#editing-the-copy-of-a-sequence-ab-step`,details:i};if(r.includes("--subject")||r.includes("--template")||r.includes("is required"))return{title:"Invalid command input",description:"The CLI command arguments are incomplete or incompatible for this action.",howToFix:"Review the flags you passed, add the missing values, and run the command again.",docsUrl:Ka,details:i};if(t.code==="NETWORK_ERROR"||r.includes("fetch failed")||r.includes("failed to initiate login"))return{title:"Network or configuration error",description:"The CLI could not reach the Sequenzy API or app URL from this environment.",howToFix:"Check your network connection and verify `SEQUENZY_API_URL` or `SEQUENZY_APP_URL` if you override them locally.",docsUrl:Ka,details:i};if(t.statusCode&&t.statusCode>=500)return{title:"Sequenzy server error",description:"The request reached Sequenzy, but the server could not complete it successfully.",howToFix:"Retry once. If the error persists, keep the details below and check the docs before escalating.",docsUrl:Ka,details:i};return{title:"Command failed",description:"The CLI could not complete the requested operation.",howToFix:"Review the details below, adjust the command or credentials, and retry.",docsUrl:Ka,details:i}}function M(){return new A("Not logged in. Run `sequenzy login` first.",401,void 0,"CLI_AUTH_REQUIRED")}function gf(e){let t=D1(e);return[`Sequenzy CLI error: ${t.title}`,`Description: ${t.description}`,`How to fix: ${t.howToFix}`,`Docs: ${t.docsUrl}`,`Details: ${t.details}`].join(`
196
196
  `)}function Rce(e){let t=S1(e),n=D1(e),r=(t.rawDetails===t.message?n.description:t.message.trim())||n.description;return{success:!1,error:{code:I1(t.code,t.statusCode,"CLI_ERROR"),message:r.replace(/\bBearer\s+[^\s]+/gi,"Bearer [redacted]").replace(/\bseq_(?:user_)?[A-Za-z0-9_-]{8,}\b/g,"[redacted key]"),...t.statusCode!==void 0?{statusCode:t.statusCode}:{},howToFix:n.howToFix,docsUrl:n.docsUrl,...e instanceof A&&e.retryAfterSeconds!==void 0?{retryAfterSeconds:e.retryAfterSeconds}:{}}}}function k(e,t={}){console.error(t.json??Qy()?JSON.stringify(Rce(e)):gf(e))}import{readFileSync as Tce}from"node:fs";import{isatty as B1}from"node:tty";var rl;function _1(){rl=void 0}function KS(e){if(new Set(e).size>1)throw new A("Only one text input may read stdin (-) per command. Use regular files for the other inputs.",400,void 0,"CLI_INVALID_INPUT")}async function x1(){if(B1(0))throw new A("Pipe text into stdin when using a text file '-'.",400,void 0,"CLI_INVALID_INPUT");try{process.stdin.setEncoding("utf8");let e="";for await(let t of process.stdin)e+=String(t);rl={text:e}}catch(e){throw new A(`Failed to read stdin: ${e instanceof Error?e.message:"Unknown error"}`,400,void 0,"CLI_INPUT_READ_FAILED")}}function k1(e,t){if(e==="-"){if(rl){if(rl.field)KS([rl.field,t]);return rl.field=t,rl.text}if(B1(0))throw new A(`Pipe text into stdin when using ${t} file '-'.`,400,void 0,"CLI_INVALID_INPUT")}try{let n=Tce(e==="-"?0:e,"utf8");if(e==="-")rl={field:t,text:n};return n}catch(n){throw new A(`Failed to read ${t} file '${e}': ${n instanceof Error?n.message:"Unknown error"}`,400,void 0,"CLI_INPUT_READ_FAILED")}}function $y(e){return e.optsWithGlobals().json===!0||e.commands.some($y)}async function Qce(e){JS(e.optsWithGlobals().json===!0),_1();let t=Object.entries(e.optsWithGlobals()).filter(([n,r])=>r==="-"&&n.endsWith("File")||n==="audienceJson"&&r==="@-").map(([n])=>n);if(e.parent?.name()==="subscribers"&&["import","events-import"].includes(e.name())&&e.args[0]==="-")t.push("subscriber import");if(KS(t),t.length>0)await x1()}function R1(e){let t=e.configureOutput().writeErr;e.configureOutput({writeErr:(n)=>{if(!$y(e))t?.(n)}}),e.exitOverride(),e.hook("preAction",(n,r)=>Qce(r))}async function T1(e,t){JS(!1);try{await e.parseAsync(t)}catch(n){if(n instanceof yT){if(n.exitCode===0)return;if($y(e))k(new A(n.message,400,void 0,"CLI_INVALID_INPUT"),{json:!0});process.exitCode=n.exitCode;return}k(n,{json:$y(e)}),process.exitCode=1}}var Ny="Variant copy is edited with `sequenzy ab-tests update-variant`, not with `sequenzy sequences update-node`.";var Q1;function ce(e,t,n){function r(l,d){if(!l._zod)Object.defineProperty(l,"_zod",{value:{def:d,constr:c,traits:new Set},enumerable:!1});if(l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,d);let f=c.prototype,h=Object.keys(f);for(let y=0;y<h.length;y++){let v=h[y];if(!(v in l))l[v]=f[v].bind(l)}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function c(l){var d;let f=n?.Parent?new a:this;r(f,l),(d=f._zod).deferred??(d.deferred=[]);for(let h of f._zod.deferred)h();return f}return Object.defineProperty(c,"init",{value:r}),Object.defineProperty(c,Symbol.hasInstance,{value:(l)=>{if(n?.Parent&&l instanceof n.Parent)return!0;return l?._zod?.traits?.has(e)}}),Object.defineProperty(c,"name",{value:e}),c}var vRe=Symbol("zod_brand");class Ya extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Af extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(Q1=globalThis).__zod_globalConfig??(Q1.__zod_globalConfig={});var Zd=globalThis.__zod_globalConfig;function Za(e){if(e)Object.assign(Zd,e);return Zd}function Py(e){let t=Object.values(e).filter((r)=>typeof r==="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function yf(e,t){if(typeof t==="bigint")return t.toString();return t}function qy(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw Error("cached value already set")}}}function Fy(e){return e===null||e===void 0}function Ly(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}var $1=Symbol("evaluating");function hn(e,t,n){let r=void 0;Object.defineProperty(e,t,{get(){if(r===$1)return;if(r===void 0)r=$1,r=n();return r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function lu(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function il(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function ZS(e){return JSON.stringify(e)}function N1(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var XS="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function hf(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var O1=qy(()=>{if(Zd.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Xd(e){if(hf(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let n=t.prototype;if(hf(n)===!1)return!1;if(Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)return!1;return!0}function e0(e){if(Xd(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}var P1=new Set(["string","number","symbol"]);function ol(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function va(e,t,n){let r=new e._zod.constr(t??e._zod.def);if(!t||n?.parent)r._zod.parent=e;return r}function bt(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function q1(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}var $ce={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Nce(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let a=il(e._zod.def,{get shape(){let c={};for(let l in t){if(!(l in n.shape))throw Error(`Unrecognized key: "${l}"`);if(!t[l])continue;c[l]=n.shape[l]}return lu(this,"shape",c),c},checks:[]});return va(e,a)}function Oce(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let a=il(e._zod.def,{get shape(){let c={...e._zod.def.shape};for(let l in t){if(!(l in n.shape))throw Error(`Unrecognized key: "${l}"`);if(!t[l])continue;delete c[l]}return lu(this,"shape",c),c},checks:[]});return va(e,a)}function Pce(e,t){if(!Xd(t))throw Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let a=e._zod.def.shape;for(let c in t)if(Object.getOwnPropertyDescriptor(a,c)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let i=il(e._zod.def,{get shape(){let a={...e._zod.def.shape,...t};return lu(this,"shape",a),a}});return va(e,i)}function qce(e,t){if(!Xd(t))throw Error("Invalid input to safeExtend: expected a plain object");let n=il(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return lu(this,"shape",r),r}});return va(e,n)}function Fce(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=il(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return lu(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return va(e,n)}function Lce(e,t,n){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let c=il(t._zod.def,{get shape(){let l=t._zod.def.shape,d={...l};if(n)for(let f in n){if(!(f in l))throw Error(`Unrecognized key: "${f}"`);if(!n[f])continue;d[f]=e?new e({type:"optional",innerType:l[f]}):l[f]}else for(let f in l)d[f]=e?new e({type:"optional",innerType:l[f]}):l[f];return lu(this,"shape",d),d},checks:[]});return va(t,c)}function Uce(e,t,n){let r=il(t._zod.def,{get shape(){let i=t._zod.def.shape,a={...i};if(n)for(let c in n){if(!(c in a))throw Error(`Unrecognized key: "${c}"`);if(!n[c])continue;a[c]=new e({type:"nonoptional",innerType:i[c]})}else for(let c in i)a[c]=new e({type:"nonoptional",innerType:i[c]});return lu(this,"shape",a),a}});return va(t,r)}function uu(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function F1(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Uy(e,t){return t.map((n)=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Oy(e){return typeof e==="string"?e:e?.message}function Xa(e,t,n){let r=e.message?e.message:Oy(e.inst?._zod.def?.error?.(e))??Oy(t?.error?.(e))??Oy(n.customError?.(e))??Oy(n.localeError?.(e))??"Invalid input",{inst:i,continue:a,input:c,...l}=e;if(l.path??(l.path=[]),l.message=r,t?.reportInput)l.input=c;return l}function jy(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function du(...e){let[t,n,r]=e;if(typeof t==="string")return{message:t,code:"custom",input:n,inst:r};return{...t}}var L1=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,yf,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},zy=ce("$ZodError",L1),t0=ce("$ZodError",L1,{Parent:Error});function U1(e,t=(n)=>n.message){let n={},r=[];for(let i of e.issues)if(i.path.length>0)n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i));else r.push(t(i));return{formErrors:r,fieldErrors:n}}function j1(e,t=(n)=>n.message){let n={_errors:[]},r=(i,a=[])=>{for(let c of i.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map((l)=>r({issues:l},[...a,...c.path]));else if(c.code==="invalid_key")r({issues:c.issues},[...a,...c.path]);else if(c.code==="invalid_element")r({issues:c.issues},[...a,...c.path]);else{let l=[...a,...c.path];if(l.length===0)n._errors.push(t(c));else{let d=n,f=0;while(f<l.length){let h=l[f];if(f!==l.length-1)d[h]=d[h]||{_errors:[]};else d[h]=d[h]||{_errors:[]},d[h]._errors.push(t(c));d=d[h],f++}}}};return r(e),n}var My=(e)=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},c=t._zod.run({value:n,issues:[]},a);if(c instanceof Promise)throw new Ya;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map((d)=>Xa(d,a,Za())));throw XS(l,i?.callee),l}return c.value};var Hy=(e)=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},c=t._zod.run({value:n,issues:[]},a);if(c instanceof Promise)c=await c;if(c.issues.length){let l=new(i?.Err??e)(c.issues.map((d)=>Xa(d,a,Za())));throw XS(l,i?.callee),l}return c.value};var bf=(e)=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Ya;return a.issues.length?{success:!1,error:new(e??zy)(a.issues.map((c)=>Xa(c,i,Za())))}:{success:!0,data:a.value}},z1=bf(t0),vf=(e)=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)a=await a;return a.issues.length?{success:!1,error:new e(a.issues.map((c)=>Xa(c,i,Za())))}:{success:!0,data:a.value}},M1=vf(t0),H1=(e)=>(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return My(e)(t,n,i)};var G1=(e)=>(t,n,r)=>My(e)(t,n,r);var J1=(e)=>async(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return Hy(e)(t,n,i)};var V1=(e)=>async(t,n,r)=>Hy(e)(t,n,r);var W1=(e)=>(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return bf(e)(t,n,i)};var K1=(e)=>(t,n,r)=>bf(e)(t,n,r);var Y1=(e)=>async(t,n,r)=>{let i=r?{...r,direction:"backward"}:{direction:"backward"};return vf(e)(t,n,i)};var Z1=(e)=>async(t,n,r)=>vf(e)(t,n,r);var X1=/^[cC][0-9a-z]{6,}$/,eL=/^[0-9a-z]+$/,tL=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nL=/^[0-9a-vA-V]{20}$/,rL=/^[A-Za-z0-9]{27}$/,iL=/^[a-zA-Z0-9_-]{21}$/,oL=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var sL=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,n0=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)};var aL=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var zce="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function cL(){return new RegExp(zce,"u")}var lL=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,uL=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;var dL=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,pL=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mL=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,r0=/^[A-Za-z0-9_-]*$/;var fL=/^https?$/,gL=/^\+[1-9]\d{6,14}$/,AL="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",hL=new RegExp(`^${AL}$`);function yL(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function bL(e){return new RegExp(`^${yL(e)}$`)}function vL(e){let t=yL({precision:e.precision}),n=["Z"];if(e.local)n.push("");if(e.offset)n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${n.join("|")})`;return new RegExp(`^${AL}T(?:${r})$`)}var EL=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)};var IL=/^[^A-Z]*$/,CL=/^[^a-z]*$/;var _o=ce("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])});var wL=ce("$ZodCheckMaxLength",(e,t)=>{var n;_o.init(e,t),(n=e._zod.def).when??(n.when=(r)=>{let i=r.value;return!Fy(i)&&i.length!==void 0}),e._zod.onattach.push((r)=>{let i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<i)r._zod.bag.maximum=t.maximum}),e._zod.check=(r)=>{let i=r.value;if(i.length<=t.maximum)return;let c=jy(i);r.issues.push({origin:c,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),SL=ce("$ZodCheckMinLength",(e,t)=>{var n;_o.init(e,t),(n=e._zod.def).when??(n.when=(r)=>{let i=r.value;return!Fy(i)&&i.length!==void 0}),e._zod.onattach.push((r)=>{let i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>i)r._zod.bag.minimum=t.minimum}),e._zod.check=(r)=>{let i=r.value;if(i.length>=t.minimum)return;let c=jy(i);r.issues.push({origin:c,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),DL=ce("$ZodCheckLengthEquals",(e,t)=>{var n;_o.init(e,t),(n=e._zod.def).when??(n.when=(r)=>{let i=r.value;return!Fy(i)&&i.length!==void 0}),e._zod.onattach.push((r)=>{let i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=(r)=>{let i=r.value,a=i.length;if(a===t.length)return;let c=jy(i),l=a>t.length;r.issues.push({origin:c,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Ef=ce("$ZodCheckStringFormat",(e,t)=>{var n,r;if(_o.init(e,t),e._zod.onattach.push((i)=>{let a=i._zod.bag;if(a.format=t.format,t.pattern)a.patterns??(a.patterns=new Set),a.patterns.add(t.pattern)}),t.pattern)(n=e._zod).check??(n.check=(i)=>{if(t.pattern.lastIndex=0,t.pattern.test(i.value))return;i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(r=e._zod).check??(r.check=()=>{})}),BL=ce("$ZodCheckRegex",(e,t)=>{Ef.init(e,t),e._zod.check=(n)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_L=ce("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=IL),Ef.init(e,t)}),xL=ce("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=CL),Ef.init(e,t)}),kL=ce("$ZodCheckIncludes",(e,t)=>{_o.init(e,t);let n=ol(t.includes),r=new RegExp(typeof t.position==="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push((i)=>{let a=i._zod.bag;a.patterns??(a.patterns=new Set),a.patterns.add(r)}),e._zod.check=(i)=>{if(i.value.includes(t.includes,t.position))return;i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),RL=ce("$ZodCheckStartsWith",(e,t)=>{_o.init(e,t);let n=new RegExp(`^${ol(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push((r)=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=(r)=>{if(r.value.startsWith(t.prefix))return;r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),TL=ce("$ZodCheckEndsWith",(e,t)=>{_o.init(e,t);let n=new RegExp(`.*${ol(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push((r)=>{let i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=(r)=>{if(r.value.endsWith(t.suffix))return;r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});var QL=ce("$ZodCheckOverwrite",(e,t)=>{_o.init(e,t),e._zod.check=(n)=>{n.value=t.tx(n.value)}});class i0{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(`
197
197
  `).filter((a)=>a),r=Math.min(...n.map((a)=>a.length-a.trimStart().length)),i=n.map((a)=>a.slice(r)).map((a)=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let e=Function,t=this?.args,r=[...(this?.content??[""]).map((i)=>` ${i}`)];return new e(...t,r.join(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sequenzy/cli",
3
- "version": "0.0.191",
3
+ "version": "0.0.192",
4
4
  "description": "Sequenzy CLI for email marketing from the terminal",
5
5
  "type": "module",
6
6
  "bin": {