aicommits 1.4.0 → 1.4.1

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/cli.mjs +18 -14
  2. package/package.json +1 -1
package/dist/cli.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import cu from"tty";import{Buffer as Mt}from"node:buffer";import L from"node:path";import lu from"node:child_process";import g,{stdin as fu,stdout as du}from"node:process";import Gt from"child_process";import V from"path";import Ee from"fs";import Ut from"node:url";import Wt,{constants as pu}from"node:os";import Kt from"assert";import qt from"events";import zt from"buffer";import ge from"stream";import Vt from"util";import*as ee from"node:readline";import Fu from"node:readline";import{WriteStream as Ht}from"node:tty";import v from"fs/promises";import Yt from"os";import Jt from"https";import{encoding_for_model as Xt}from"@dqbd/tiktoken";import{fileURLToPath as Zt}from"url";const Qt="known-flag",en="unknown-flag",un="argument",{stringify:H}=JSON,tn=/\B([A-Z])/g,nn=e=>e.replace(tn,"-$1").toLowerCase(),{hasOwnProperty:Dn}=Object.prototype,Y=(e,u)=>Dn.call(e,u),rn=e=>Array.isArray(e),mu=e=>typeof e=="function"?[e,!1]:rn(e)?[e[0],!0]:mu(e.type),on=(e,u)=>e===Boolean?u!=="false":u,sn=(e,u)=>typeof u=="boolean"?u:e===Number&&u===""?Number.NaN:e(u),an=/[\s.:=]/,cn=e=>{const u=`Flag name ${H(e)}`;if(e.length===0)throw new Error(`${u} cannot be empty`);if(e.length===1)throw new Error(`${u} must be longer than a character`);const t=e.match(an);if(t)throw new Error(`${u} cannot contain ${H(t?.[0])}`)},ln=e=>{const u={},t=(n,D)=>{if(Y(u,n))throw new Error(`Duplicate flags named ${H(n)}`);u[n]=D};for(const n in e){if(!Y(e,n))continue;cn(n);const D=e[n],r=[[],...mu(D),D];t(n,r);const i=nn(n);if(n!==i&&t(i,r),"alias"in D&&typeof D.alias=="string"){const{alias:o}=D,s=`Flag alias ${H(o)} for flag ${H(n)}`;if(o.length===0)throw new Error(`${s} cannot be empty`);if(o.length>1)throw new Error(`${s} must be a single character`);t(o,r)}}return u},fn=(e,u)=>{const t={};for(const n in e){if(!Y(e,n))continue;const[D,,r,i]=u[n];if(D.length===0&&"default"in i){let{default:o}=i;typeof o=="function"&&(o=o()),t[n]=o}else t[n]=r?D:D.pop()}return t},ue="--",dn=/[.:=]/,pn=/^-{1,2}\w/,Fn=e=>{if(!pn.test(e))return;const u=!e.startsWith(ue);let t=e.slice(u?1:2),n;const D=t.match(dn);if(D){const{index:r}=D;n=t.slice(r+1),t=t.slice(0,r)}return[t,n,u]},mn=(e,{onFlag:u,onArgument:t})=>{let n;const D=(r,i)=>{if(typeof n!="function")return!0;n(r,i),n=void 0};for(let r=0;r<e.length;r+=1){const i=e[r];if(i===ue){D();const s=e.slice(r+1);t?.(s,[r],!0);break}const o=Fn(i);if(o){if(D(),!u)continue;const[s,a,f]=o;if(f)for(let c=0;c<s.length;c+=1){D();const l=c===s.length-1;n=u(s[c],l?a:void 0,[r,c+1,l])}else n=u(s,a,[r])}else D(i,[r])&&t?.([i],[r])}D()},Cn=(e,u)=>{for(const[t,n,D]of u.reverse()){if(n){const r=e[t];let i=r.slice(0,n);if(D||(i+=r.slice(n+1)),i!=="-"){e[t]=i;continue}}e.splice(t,1)}},hn=(e,u=process.argv.slice(2),{ignore:t}={})=>{const n=[],D=ln(e),r={},i=[];return i[ue]=[],mn(u,{onFlag(o,s,a){const f=Y(D,o);if(!t?.(f?Qt:en,o,s)){if(f){const[c,l]=D[o],d=on(l,s),F=(E,b)=>{n.push(a),b&&n.push(b),c.push(sn(l,E||""))};return d===void 0?F:F(d)}Y(r,o)||(r[o]=[]),r[o].push(s===void 0?!0:s),n.push(a)}},onArgument(o,s,a){t?.(un,u[s[0]])||(i.push(...o),a?(i[ue]=o,u.splice(s[0])):n.push(s))}}),Cn(u,n),{flags:fn(e,D),unknownFlags:r,_:i}};var En=Object.create,te=Object.defineProperty,gn=Object.defineProperties,Bn=Object.getOwnPropertyDescriptor,wn=Object.getOwnPropertyDescriptors,bn=Object.getOwnPropertyNames,Cu=Object.getOwnPropertySymbols,yn=Object.getPrototypeOf,hu=Object.prototype.hasOwnProperty,$n=Object.prototype.propertyIsEnumerable,Eu=(e,u,t)=>u in e?te(e,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[u]=t,ne=(e,u)=>{for(var t in u||(u={}))hu.call(u,t)&&Eu(e,t,u[t]);if(Cu)for(var t of Cu(u))$n.call(u,t)&&Eu(e,t,u[t]);return e},Be=(e,u)=>gn(e,wn(u)),An=e=>te(e,"__esModule",{value:!0}),vn=(e,u)=>()=>(e&&(u=e(e=0)),u),xn=(e,u)=>()=>(u||e((u={exports:{}}).exports,u),u.exports),Sn=(e,u,t,n)=>{if(u&&typeof u=="object"||typeof u=="function")for(let D of bn(u))!hu.call(e,D)&&(t||D!=="default")&&te(e,D,{get:()=>u[D],enumerable:!(n=Bn(u,D))||n.enumerable});return e},On=(e,u)=>Sn(An(te(e!=null?En(yn(e)):{},"default",!u&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),y=vn(()=>{}),In=xn((e,u)=>{y(),u.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});y(),y(),y();var Tn=e=>{var u,t,n;let D=(u=process.stdout.columns)!=null?u:Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(D)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:D}:{columns:(t=e.columns)!=null?t:[],stdoutColumns:(n=e.stdoutColumns)!=null?n:D}};y(),y(),y(),y(),y();function Pn({onlyFirst:e=!1}={}){let u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(u,e?void 0:"g")}function gu(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Pn(),"")}y();function kn(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}var Rn=On(In(),1);function k(e){if(typeof e!="string"||e.length===0||(e=gu(e),e.length===0))return 0;e=e.replace((0,Rn.default)()," ");let u=0;for(let t=0;t<e.length;t++){let n=e.codePointAt(t);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&t++,u+=kn(n)?2:1)}return u}var Bu=e=>Math.max(...e.split(`
3
- `).map(k)),_n=e=>{let u=[];for(let t of e){let{length:n}=t,D=n-u.length;for(let r=0;r<D;r+=1)u.push(0);for(let r=0;r<n;r+=1){let i=Bu(t[r]);i>u[r]&&(u[r]=i)}}return u};y();var wu=/^\d+%$/,bu={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},jn=(e,u)=>{var t;let n=[];for(let D=0;D<e.length;D+=1){let r=(t=u[D])!=null?t:"auto";if(typeof r=="number"||r==="auto"||r==="content-width"||typeof r=="string"&&wu.test(r)){n.push(Be(ne({},bu),{width:r,contentWidth:e[D]}));continue}if(r&&typeof r=="object"){let i=Be(ne(ne({},bu),r),{contentWidth:e[D]});i.horizontalPadding=i.paddingLeft+i.paddingRight,n.push(i);continue}throw new Error(`Invalid column width: ${JSON.stringify(r)}`)}return n};function Nn(e,u){for(let t of e){let{width:n}=t;if(n==="content-width"&&(t.width=t.contentWidth),n==="auto"){let s=Math.min(20,t.contentWidth);t.width=s,t.autoOverflow=t.contentWidth-s}if(typeof n=="string"&&wu.test(n)){let s=Number.parseFloat(n.slice(0,-1))/100;t.width=Math.floor(u*s)-(t.paddingLeft+t.paddingRight)}let{horizontalPadding:D}=t,r=1,i=r+D;if(i>=u){let s=i-u,a=Math.ceil(t.paddingLeft/D*s),f=s-a;t.paddingLeft-=a,t.paddingRight-=f,t.horizontalPadding=t.paddingLeft+t.paddingRight}t.paddingLeftString=t.paddingLeft?" ".repeat(t.paddingLeft):"",t.paddingRightString=t.paddingRight?" ".repeat(t.paddingRight):"";let o=u-t.horizontalPadding;t.width=Math.max(Math.min(t.width,o),r)}}var yu=()=>Object.assign([],{columns:0});function Ln(e,u){let t=[yu()],[n]=t;for(let D of e){let r=D.width+D.horizontalPadding;n.columns+r>u&&(n=yu(),t.push(n)),n.push(D),n.columns+=r}for(let D of t){let r=D.reduce((l,d)=>l+d.width+d.horizontalPadding,0),i=u-r;if(i===0)continue;let o=D.filter(l=>"autoOverflow"in l),s=o.filter(l=>l.autoOverflow>0),a=s.reduce((l,d)=>l+d.autoOverflow,0),f=Math.min(a,i);for(let l of s){let d=Math.floor(l.autoOverflow/a*f);l.width+=d,i-=d}let c=Math.floor(i/o.length);for(let l=0;l<o.length;l+=1){let d=o[l];l===o.length-1?d.width+=i:d.width+=c,i-=c}}return t}function Mn(e,u,t){let n=jn(t,u);return Nn(n,e),Ln(n,e)}y(),y(),y();var we=10,$u=(e=0)=>u=>`\x1B[${u+e}m`,Au=(e=0)=>u=>`\x1B[${38+e};5;${u}m`,vu=(e=0)=>(u,t,n)=>`\x1B[${38+e};2;${u};${t};${n}m`;function Gn(){let e=new Map,u={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};u.color.gray=u.color.blackBright,u.bgColor.bgGray=u.bgColor.bgBlackBright,u.color.grey=u.color.blackBright,u.bgColor.bgGrey=u.bgColor.bgBlackBright;for(let[t,n]of Object.entries(u)){for(let[D,r]of Object.entries(n))u[D]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[D]=u[D],e.set(r[0],r[1]);Object.defineProperty(u,t,{value:n,enumerable:!1})}return Object.defineProperty(u,"codes",{value:e,enumerable:!1}),u.color.close="\x1B[39m",u.bgColor.close="\x1B[49m",u.color.ansi=$u(),u.color.ansi256=Au(),u.color.ansi16m=vu(),u.bgColor.ansi=$u(we),u.bgColor.ansi256=Au(we),u.bgColor.ansi16m=vu(we),Object.defineProperties(u,{rgbToAnsi256:{value:(t,n,D)=>t===n&&n===D?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(D/255*5),enumerable:!1},hexToRgb:{value:t=>{let n=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!n)return[0,0,0];let{colorString:D}=n.groups;D.length===3&&(D=D.split("").map(i=>i+i).join(""));let r=Number.parseInt(D,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:t=>u.rgbToAnsi256(...u.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,D,r;if(t>=232)n=((t-232)*10+8)/255,D=n,r=n;else{t-=16;let s=t%36;n=Math.floor(t/36)/5,D=Math.floor(s/6)/5,r=s%6/5}let i=Math.max(n,D,r)*2;if(i===0)return 30;let o=30+(Math.round(r)<<2|Math.round(D)<<1|Math.round(n));return i===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,n,D)=>u.ansi256ToAnsi(u.rgbToAnsi256(t,n,D)),enumerable:!1},hexToAnsi:{value:t=>u.ansi256ToAnsi(u.hexToAnsi256(t)),enumerable:!1}}),u}var Un=Gn(),Wn=Un,De=new Set(["\x1B","\x9B"]),Kn=39,be="\x07",xu="[",qn="]",Su="m",ye=`${qn}8;;`,Ou=e=>`${De.values().next().value}${xu}${e}${Su}`,Iu=e=>`${De.values().next().value}${ye}${e}${be}`,zn=e=>e.split(" ").map(u=>k(u)),$e=(e,u,t)=>{let n=[...u],D=!1,r=!1,i=k(gu(e[e.length-1]));for(let[o,s]of n.entries()){let a=k(s);if(i+a<=t?e[e.length-1]+=s:(e.push(s),i=0),De.has(s)&&(D=!0,r=n.slice(o+1).join("").startsWith(ye)),D){r?s===be&&(D=!1,r=!1):s===Su&&(D=!1);continue}i+=a,i===t&&o<n.length-1&&(e.push(""),i=0)}!i&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Vn=e=>{let u=e.split(" "),t=u.length;for(;t>0&&!(k(u[t-1])>0);)t--;return t===u.length?e:u.slice(0,t).join(" ")+u.slice(t).join("")},Hn=(e,u,t={})=>{if(t.trim!==!1&&e.trim()==="")return"";let n="",D,r,i=zn(e),o=[""];for(let[a,f]of e.split(" ").entries()){t.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let c=k(o[o.length-1]);if(a!==0&&(c>=u&&(t.wordWrap===!1||t.trim===!1)&&(o.push(""),c=0),(c>0||t.trim===!1)&&(o[o.length-1]+=" ",c++)),t.hard&&i[a]>u){let l=u-c,d=1+Math.floor((i[a]-l-1)/u);Math.floor((i[a]-1)/u)<d&&o.push(""),$e(o,f,u);continue}if(c+i[a]>u&&c>0&&i[a]>0){if(t.wordWrap===!1&&c<u){$e(o,f,u);continue}o.push("")}if(c+i[a]>u&&t.wordWrap===!1){$e(o,f,u);continue}o[o.length-1]+=f}t.trim!==!1&&(o=o.map(a=>Vn(a)));let s=[...o.join(`
4
- `)];for(let[a,f]of s.entries()){if(n+=f,De.has(f)){let{groups:l}=new RegExp(`(?:\\${xu}(?<code>\\d+)m|\\${ye}(?<uri>.*)${be})`).exec(s.slice(a).join(""))||{groups:{}};if(l.code!==void 0){let d=Number.parseFloat(l.code);D=d===Kn?void 0:d}else l.uri!==void 0&&(r=l.uri.length===0?void 0:l.uri)}let c=Wn.codes.get(Number(D));s[a+1]===`
5
- `?(r&&(n+=Iu("")),D&&c&&(n+=Ou(c))):f===`
2
+ import cu from"tty";import{Buffer as Mt}from"node:buffer";import L from"node:path";import lu from"node:child_process";import g,{stdin as fu,stdout as du}from"node:process";import Gt from"child_process";import V from"path";import Ee from"fs";import Ut from"node:url";import Wt,{constants as pu}from"node:os";import Kt from"assert";import qt from"events";import zt from"buffer";import ge from"stream";import Vt from"util";import*as ee from"node:readline";import Fu from"node:readline";import{WriteStream as Ht}from"node:tty";import v from"fs/promises";import Yt from"os";import Jt from"https";import{encoding_for_model as Xt}from"@dqbd/tiktoken";import{fileURLToPath as Zt}from"url";const Qt="known-flag",en="unknown-flag",un="argument",{stringify:H}=JSON,tn=/\B([A-Z])/g,nn=e=>e.replace(tn,"-$1").toLowerCase(),{hasOwnProperty:Dn}=Object.prototype,Y=(e,u)=>Dn.call(e,u),rn=e=>Array.isArray(e),mu=e=>typeof e=="function"?[e,!1]:rn(e)?[e[0],!0]:mu(e.type),on=(e,u)=>e===Boolean?u!=="false":u,sn=(e,u)=>typeof u=="boolean"?u:e===Number&&u===""?Number.NaN:e(u),an=/[\s.:=]/,cn=e=>{const u=`Flag name ${H(e)}`;if(e.length===0)throw new Error(`${u} cannot be empty`);if(e.length===1)throw new Error(`${u} must be longer than a character`);const t=e.match(an);if(t)throw new Error(`${u} cannot contain ${H(t?.[0])}`)},ln=e=>{const u={},t=(n,D)=>{if(Y(u,n))throw new Error(`Duplicate flags named ${H(n)}`);u[n]=D};for(const n in e){if(!Y(e,n))continue;cn(n);const D=e[n],r=[[],...mu(D),D];t(n,r);const i=nn(n);if(n!==i&&t(i,r),"alias"in D&&typeof D.alias=="string"){const{alias:o}=D,s=`Flag alias ${H(o)} for flag ${H(n)}`;if(o.length===0)throw new Error(`${s} cannot be empty`);if(o.length>1)throw new Error(`${s} must be a single character`);t(o,r)}}return u},fn=(e,u)=>{const t={};for(const n in e){if(!Y(e,n))continue;const[D,,r,i]=u[n];if(D.length===0&&"default"in i){let{default:o}=i;typeof o=="function"&&(o=o()),t[n]=o}else t[n]=r?D:D.pop()}return t},ue="--",dn=/[.:=]/,pn=/^-{1,2}\w/,Fn=e=>{if(!pn.test(e))return;const u=!e.startsWith(ue);let t=e.slice(u?1:2),n;const D=t.match(dn);if(D){const{index:r}=D;n=t.slice(r+1),t=t.slice(0,r)}return[t,n,u]},mn=(e,{onFlag:u,onArgument:t})=>{let n;const D=(r,i)=>{if(typeof n!="function")return!0;n(r,i),n=void 0};for(let r=0;r<e.length;r+=1){const i=e[r];if(i===ue){D();const s=e.slice(r+1);t?.(s,[r],!0);break}const o=Fn(i);if(o){if(D(),!u)continue;const[s,a,l]=o;if(l)for(let c=0;c<s.length;c+=1){D();const f=c===s.length-1;n=u(s[c],f?a:void 0,[r,c+1,f])}else n=u(s,a,[r])}else D(i,[r])&&t?.([i],[r])}D()},Cn=(e,u)=>{for(const[t,n,D]of u.reverse()){if(n){const r=e[t];let i=r.slice(0,n);if(D||(i+=r.slice(n+1)),i!=="-"){e[t]=i;continue}}e.splice(t,1)}},hn=(e,u=process.argv.slice(2),{ignore:t}={})=>{const n=[],D=ln(e),r={},i=[];return i[ue]=[],mn(u,{onFlag(o,s,a){const l=Y(D,o);if(!t?.(l?Qt:en,o,s)){if(l){const[c,f]=D[o],d=on(f,s),F=(E,b)=>{n.push(a),b&&n.push(b),c.push(sn(f,E||""))};return d===void 0?F:F(d)}Y(r,o)||(r[o]=[]),r[o].push(s===void 0?!0:s),n.push(a)}},onArgument(o,s,a){t?.(un,u[s[0]])||(i.push(...o),a?(i[ue]=o,u.splice(s[0])):n.push(s))}}),Cn(u,n),{flags:fn(e,D),unknownFlags:r,_:i}};var En=Object.create,te=Object.defineProperty,gn=Object.defineProperties,Bn=Object.getOwnPropertyDescriptor,wn=Object.getOwnPropertyDescriptors,bn=Object.getOwnPropertyNames,Cu=Object.getOwnPropertySymbols,yn=Object.getPrototypeOf,hu=Object.prototype.hasOwnProperty,$n=Object.prototype.propertyIsEnumerable,Eu=(e,u,t)=>u in e?te(e,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[u]=t,ne=(e,u)=>{for(var t in u||(u={}))hu.call(u,t)&&Eu(e,t,u[t]);if(Cu)for(var t of Cu(u))$n.call(u,t)&&Eu(e,t,u[t]);return e},Be=(e,u)=>gn(e,wn(u)),An=e=>te(e,"__esModule",{value:!0}),vn=(e,u)=>()=>(e&&(u=e(e=0)),u),xn=(e,u)=>()=>(u||e((u={exports:{}}).exports,u),u.exports),Sn=(e,u,t,n)=>{if(u&&typeof u=="object"||typeof u=="function")for(let D of bn(u))!hu.call(e,D)&&(t||D!=="default")&&te(e,D,{get:()=>u[D],enumerable:!(n=Bn(u,D))||n.enumerable});return e},On=(e,u)=>Sn(An(te(e!=null?En(yn(e)):{},"default",!u&&e&&e.__esModule?{get:()=>e.default,enumerable:!0}:{value:e,enumerable:!0})),e),y=vn(()=>{}),In=xn((e,u)=>{y(),u.exports=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g}});y(),y(),y();var Tn=e=>{var u,t,n;let D=(u=process.stdout.columns)!=null?u:Number.POSITIVE_INFINITY;return typeof e=="function"&&(e=e(D)),e||(e={}),Array.isArray(e)?{columns:e,stdoutColumns:D}:{columns:(t=e.columns)!=null?t:[],stdoutColumns:(n=e.stdoutColumns)!=null?n:D}};y(),y(),y(),y(),y();function Pn({onlyFirst:e=!1}={}){let u=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(u,e?void 0:"g")}function gu(e){if(typeof e!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Pn(),"")}y();function kn(e){return Number.isInteger(e)?e>=4352&&(e<=4447||e===9001||e===9002||11904<=e&&e<=12871&&e!==12351||12880<=e&&e<=19903||19968<=e&&e<=42182||43360<=e&&e<=43388||44032<=e&&e<=55203||63744<=e&&e<=64255||65040<=e&&e<=65049||65072<=e&&e<=65131||65281<=e&&e<=65376||65504<=e&&e<=65510||110592<=e&&e<=110593||127488<=e&&e<=127569||131072<=e&&e<=262141):!1}var Rn=On(In(),1);function k(e){if(typeof e!="string"||e.length===0||(e=gu(e),e.length===0))return 0;e=e.replace((0,Rn.default)()," ");let u=0;for(let t=0;t<e.length;t++){let n=e.codePointAt(t);n<=31||n>=127&&n<=159||n>=768&&n<=879||(n>65535&&t++,u+=kn(n)?2:1)}return u}var Bu=e=>Math.max(...e.split(`
3
+ `).map(k)),_n=e=>{let u=[];for(let t of e){let{length:n}=t,D=n-u.length;for(let r=0;r<D;r+=1)u.push(0);for(let r=0;r<n;r+=1){let i=Bu(t[r]);i>u[r]&&(u[r]=i)}}return u};y();var wu=/^\d+%$/,bu={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},jn=(e,u)=>{var t;let n=[];for(let D=0;D<e.length;D+=1){let r=(t=u[D])!=null?t:"auto";if(typeof r=="number"||r==="auto"||r==="content-width"||typeof r=="string"&&wu.test(r)){n.push(Be(ne({},bu),{width:r,contentWidth:e[D]}));continue}if(r&&typeof r=="object"){let i=Be(ne(ne({},bu),r),{contentWidth:e[D]});i.horizontalPadding=i.paddingLeft+i.paddingRight,n.push(i);continue}throw new Error(`Invalid column width: ${JSON.stringify(r)}`)}return n};function Nn(e,u){for(let t of e){let{width:n}=t;if(n==="content-width"&&(t.width=t.contentWidth),n==="auto"){let s=Math.min(20,t.contentWidth);t.width=s,t.autoOverflow=t.contentWidth-s}if(typeof n=="string"&&wu.test(n)){let s=Number.parseFloat(n.slice(0,-1))/100;t.width=Math.floor(u*s)-(t.paddingLeft+t.paddingRight)}let{horizontalPadding:D}=t,r=1,i=r+D;if(i>=u){let s=i-u,a=Math.ceil(t.paddingLeft/D*s),l=s-a;t.paddingLeft-=a,t.paddingRight-=l,t.horizontalPadding=t.paddingLeft+t.paddingRight}t.paddingLeftString=t.paddingLeft?" ".repeat(t.paddingLeft):"",t.paddingRightString=t.paddingRight?" ".repeat(t.paddingRight):"";let o=u-t.horizontalPadding;t.width=Math.max(Math.min(t.width,o),r)}}var yu=()=>Object.assign([],{columns:0});function Ln(e,u){let t=[yu()],[n]=t;for(let D of e){let r=D.width+D.horizontalPadding;n.columns+r>u&&(n=yu(),t.push(n)),n.push(D),n.columns+=r}for(let D of t){let r=D.reduce((f,d)=>f+d.width+d.horizontalPadding,0),i=u-r;if(i===0)continue;let o=D.filter(f=>"autoOverflow"in f),s=o.filter(f=>f.autoOverflow>0),a=s.reduce((f,d)=>f+d.autoOverflow,0),l=Math.min(a,i);for(let f of s){let d=Math.floor(f.autoOverflow/a*l);f.width+=d,i-=d}let c=Math.floor(i/o.length);for(let f=0;f<o.length;f+=1){let d=o[f];f===o.length-1?d.width+=i:d.width+=c,i-=c}}return t}function Mn(e,u,t){let n=jn(t,u);return Nn(n,e),Ln(n,e)}y(),y(),y();var we=10,$u=(e=0)=>u=>`\x1B[${u+e}m`,Au=(e=0)=>u=>`\x1B[${38+e};5;${u}m`,vu=(e=0)=>(u,t,n)=>`\x1B[${38+e};2;${u};${t};${n}m`;function Gn(){let e=new Map,u={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};u.color.gray=u.color.blackBright,u.bgColor.bgGray=u.bgColor.bgBlackBright,u.color.grey=u.color.blackBright,u.bgColor.bgGrey=u.bgColor.bgBlackBright;for(let[t,n]of Object.entries(u)){for(let[D,r]of Object.entries(n))u[D]={open:`\x1B[${r[0]}m`,close:`\x1B[${r[1]}m`},n[D]=u[D],e.set(r[0],r[1]);Object.defineProperty(u,t,{value:n,enumerable:!1})}return Object.defineProperty(u,"codes",{value:e,enumerable:!1}),u.color.close="\x1B[39m",u.bgColor.close="\x1B[49m",u.color.ansi=$u(),u.color.ansi256=Au(),u.color.ansi16m=vu(),u.bgColor.ansi=$u(we),u.bgColor.ansi256=Au(we),u.bgColor.ansi16m=vu(we),Object.defineProperties(u,{rgbToAnsi256:{value:(t,n,D)=>t===n&&n===D?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(D/255*5),enumerable:!1},hexToRgb:{value:t=>{let n=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!n)return[0,0,0];let{colorString:D}=n.groups;D.length===3&&(D=D.split("").map(i=>i+i).join(""));let r=Number.parseInt(D,16);return[r>>16&255,r>>8&255,r&255]},enumerable:!1},hexToAnsi256:{value:t=>u.rgbToAnsi256(...u.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let n,D,r;if(t>=232)n=((t-232)*10+8)/255,D=n,r=n;else{t-=16;let s=t%36;n=Math.floor(t/36)/5,D=Math.floor(s/6)/5,r=s%6/5}let i=Math.max(n,D,r)*2;if(i===0)return 30;let o=30+(Math.round(r)<<2|Math.round(D)<<1|Math.round(n));return i===2&&(o+=60),o},enumerable:!1},rgbToAnsi:{value:(t,n,D)=>u.ansi256ToAnsi(u.rgbToAnsi256(t,n,D)),enumerable:!1},hexToAnsi:{value:t=>u.ansi256ToAnsi(u.hexToAnsi256(t)),enumerable:!1}}),u}var Un=Gn(),Wn=Un,De=new Set(["\x1B","\x9B"]),Kn=39,be="\x07",xu="[",qn="]",Su="m",ye=`${qn}8;;`,Ou=e=>`${De.values().next().value}${xu}${e}${Su}`,Iu=e=>`${De.values().next().value}${ye}${e}${be}`,zn=e=>e.split(" ").map(u=>k(u)),$e=(e,u,t)=>{let n=[...u],D=!1,r=!1,i=k(gu(e[e.length-1]));for(let[o,s]of n.entries()){let a=k(s);if(i+a<=t?e[e.length-1]+=s:(e.push(s),i=0),De.has(s)&&(D=!0,r=n.slice(o+1).join("").startsWith(ye)),D){r?s===be&&(D=!1,r=!1):s===Su&&(D=!1);continue}i+=a,i===t&&o<n.length-1&&(e.push(""),i=0)}!i&&e[e.length-1].length>0&&e.length>1&&(e[e.length-2]+=e.pop())},Vn=e=>{let u=e.split(" "),t=u.length;for(;t>0&&!(k(u[t-1])>0);)t--;return t===u.length?e:u.slice(0,t).join(" ")+u.slice(t).join("")},Hn=(e,u,t={})=>{if(t.trim!==!1&&e.trim()==="")return"";let n="",D,r,i=zn(e),o=[""];for(let[a,l]of e.split(" ").entries()){t.trim!==!1&&(o[o.length-1]=o[o.length-1].trimStart());let c=k(o[o.length-1]);if(a!==0&&(c>=u&&(t.wordWrap===!1||t.trim===!1)&&(o.push(""),c=0),(c>0||t.trim===!1)&&(o[o.length-1]+=" ",c++)),t.hard&&i[a]>u){let f=u-c,d=1+Math.floor((i[a]-f-1)/u);Math.floor((i[a]-1)/u)<d&&o.push(""),$e(o,l,u);continue}if(c+i[a]>u&&c>0&&i[a]>0){if(t.wordWrap===!1&&c<u){$e(o,l,u);continue}o.push("")}if(c+i[a]>u&&t.wordWrap===!1){$e(o,l,u);continue}o[o.length-1]+=l}t.trim!==!1&&(o=o.map(a=>Vn(a)));let s=[...o.join(`
4
+ `)];for(let[a,l]of s.entries()){if(n+=l,De.has(l)){let{groups:f}=new RegExp(`(?:\\${xu}(?<code>\\d+)m|\\${ye}(?<uri>.*)${be})`).exec(s.slice(a).join(""))||{groups:{}};if(f.code!==void 0){let d=Number.parseFloat(f.code);D=d===Kn?void 0:d}else f.uri!==void 0&&(r=f.uri.length===0?void 0:f.uri)}let c=Wn.codes.get(Number(D));s[a+1]===`
5
+ `?(r&&(n+=Iu("")),D&&c&&(n+=Ou(c))):l===`
6
6
  `&&(D&&c&&(n+=Ou(D)),r&&(n+=Iu(r)))}return n};function Yn(e,u,t){return String(e).normalize().replace(/\r\n/g,`
7
7
  `).split(`
8
8
  `).map(n=>Hn(n,u,t)).join(`
9
- `)}var Tu=e=>Array.from({length:e}).fill("");function Jn(e,u){let t=[],n=0;for(let D of e){let r=0,i=D.map(s=>{var a;let f=(a=u[n])!=null?a:"";n+=1,s.preprocess&&(f=s.preprocess(f)),Bu(f)>s.width&&(f=Yn(f,s.width,{hard:!0}));let c=f.split(`
10
- `);if(s.postprocess){let{postprocess:l}=s;c=c.map((d,F)=>l.call(s,d,F))}return s.paddingTop&&c.unshift(...Tu(s.paddingTop)),s.paddingBottom&&c.push(...Tu(s.paddingBottom)),c.length>r&&(r=c.length),Be(ne({},s),{lines:c})}),o=[];for(let s=0;s<r;s+=1){let a=i.map(f=>{var c;let l=(c=f.lines[s])!=null?c:"",d=Number.isFinite(f.width)?" ".repeat(f.width-k(l)):"",F=f.paddingLeftString;return f.align==="right"&&(F+=d),F+=l,f.align==="left"&&(F+=d),F+f.paddingRightString}).join("");o.push(a)}t.push(o.join(`
9
+ `)}var Tu=e=>Array.from({length:e}).fill("");function Jn(e,u){let t=[],n=0;for(let D of e){let r=0,i=D.map(s=>{var a;let l=(a=u[n])!=null?a:"";n+=1,s.preprocess&&(l=s.preprocess(l)),Bu(l)>s.width&&(l=Yn(l,s.width,{hard:!0}));let c=l.split(`
10
+ `);if(s.postprocess){let{postprocess:f}=s;c=c.map((d,F)=>f.call(s,d,F))}return s.paddingTop&&c.unshift(...Tu(s.paddingTop)),s.paddingBottom&&c.push(...Tu(s.paddingBottom)),c.length>r&&(r=c.length),Be(ne({},s),{lines:c})}),o=[];for(let s=0;s<r;s+=1){let a=i.map(l=>{var c;let f=(c=l.lines[s])!=null?c:"",d=Number.isFinite(l.width)?" ".repeat(l.width-k(f)):"",F=l.paddingLeftString;return l.align==="right"&&(F+=d),F+=f,l.align==="left"&&(F+=d),F+l.paddingRightString}).join("");o.push(a)}t.push(o.join(`
11
11
  `))}return t.join(`
12
12
  `)}function Xn(e,u){if(!e||e.length===0)return"";let t=_n(e),n=t.length;if(n===0)return"";let{stdoutColumns:D,columns:r}=Tn(u);if(r.length>n)throw new Error(`${r.length} columns defined, but only ${n} columns found`);let i=Mn(D,r,t);return e.map(o=>Jn(i,o)).join(`
13
13
  `)}y();var Zn=["<",">","=",">=","<="];function Qn(e){if(!Zn.includes(e))throw new TypeError(`Invalid breakpoint operator: ${e}`)}function eD(e){let u=Object.keys(e).map(t=>{let[n,D]=t.split(" ");Qn(n);let r=Number.parseInt(D,10);if(Number.isNaN(r))throw new TypeError(`Invalid breakpoint value: ${D}`);let i=e[t];return{operator:n,breakpoint:r,value:i}}).sort((t,n)=>n.breakpoint-t.breakpoint);return t=>{var n;return(n=u.find(({operator:D,breakpoint:r})=>D==="="&&t===r||D===">"&&t>r||D==="<"&&t<r||D===">="&&t>=r||D==="<="&&t<=r))==null?void 0:n.value}}const uD=e=>e.replace(/[\W_]([a-z\d])?/gi,(u,t)=>t?t.toUpperCase():""),tD=e=>e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),nD={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:e=>e.trim()},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function DD(e){let u=!1;return{type:"table",data:{tableData:Object.keys(e).sort((t,n)=>t.localeCompare(n)).map(t=>{const n=e[t],D="alias"in n;return D&&(u=!0),{name:t,flag:n,flagFormatted:`--${tD(t)}`,aliasesEnabled:u,aliasFormatted:D?`-${n.alias}`:void 0}}).map(t=>(t.aliasesEnabled=u,[{type:"flagName",data:t},{type:"flagDescription",data:t}])),tableBreakpoints:nD}}}const Pu=e=>!e||(e.version??(e.help?e.help.version:void 0)),ku=e=>{const u="parent"in e&&e.parent?.name;return(u?`${u} `:"")+e.name};function rD(e){const u=[];e.name&&u.push(ku(e));const t=Pu(e)??("parent"in e&&Pu(e.parent));if(t&&u.push(`v${t}`),u.length!==0)return{id:"name",type:"text",data:`${u.join(" ")}
@@ -18,13 +18,13 @@ import cu from"tty";import{Buffer as Mt}from"node:buffer";import L from"node:pat
18
18
  `)),t)return{id:"examples",type:"section",data:{title:"Examples:",body:t}}}function lD(e){if(!("alias"in e)||!e.alias)return;const{alias:u}=e;return{id:"aliases",type:"section",data:{title:"Aliases:",body:Array.isArray(u)?u.join(", "):u}}}const fD=e=>[rD,iD,oD,sD,aD,cD,lD].map(u=>u(e)).filter(Boolean),dD=cu.WriteStream.prototype.hasColors();class pD{text(u){return u}bold(u){return dD?`\x1B[1m${u}\x1B[22m`:u.toLocaleUpperCase()}indentText({text:u,spaces:t}){return u.replace(/^/gm," ".repeat(t))}heading(u){return this.bold(u)}section({title:u,body:t,indentBody:n=2}){return`${(u?`${this.heading(u)}
19
19
  `:"")+(t?this.indentText({text:this.render(t),spaces:n}):"")}
20
20
  `}table({tableData:u,tableOptions:t,tableBreakpoints:n}){return Xn(u.map(D=>D.map(r=>this.render(r))),n?eD(n):t)}flagParameter(u){return u===Boolean?"":u===String?"<string>":u===Number?"<number>":Array.isArray(u)?this.flagParameter(u[0]):"<value>"}flagOperator(u){return" "}flagName(u){const{flag:t,flagFormatted:n,aliasesEnabled:D,aliasFormatted:r}=u;let i="";if(r?i+=`${r}, `:D&&(i+=" "),i+=n,"placeholder"in t&&typeof t.placeholder=="string")i+=`${this.flagOperator(u)}${t.placeholder}`;else{const o=this.flagParameter("type"in t?t.type:t);o&&(i+=`${this.flagOperator(u)}${o}`)}return i}flagDefault(u){return JSON.stringify(u)}flagDescription({flag:u}){let t="description"in u?u.description??"":"";if("default"in u){let{default:n}=u;typeof n=="function"&&(n=n()),n&&(t+=` (default: ${this.flagDefault(n)})`)}return t}render(u){if(typeof u=="string")return u;if(Array.isArray(u))return u.map(t=>this.render(t)).join(`
21
- `);if("type"in u&&this[u.type]){const t=this[u.type];if(typeof t=="function")return t.call(this,u.data)}throw new Error(`Invalid node type: ${JSON.stringify(u)}`)}}const Ae=/^[\w.-]+$/,{stringify:x}=JSON,FD=/[|\\{}()[\]^$+*?.]/;function ve(e){const u=[];let t,n;for(const D of e){if(n)throw new Error(`Invalid parameter: Spread parameter ${x(n)} must be last`);const r=D[0],i=D[D.length-1];let o;if(r==="<"&&i===">"&&(o=!0,t))throw new Error(`Invalid parameter: Required parameter ${x(D)} cannot come after optional parameter ${x(t)}`);if(r==="["&&i==="]"&&(o=!1,t=D),o===void 0)throw new Error(`Invalid parameter: ${x(D)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let s=D.slice(1,-1);const a=s.slice(-3)==="...";a&&(n=D,s=s.slice(0,-3));const f=s.match(FD);if(f)throw new Error(`Invalid parameter: ${x(D)}. Invalid character found ${x(f[0])}`);u.push({name:s,required:o,spread:a})}return u}function xe(e,u,t,n){for(let D=0;D<u.length;D+=1){const{name:r,required:i,spread:o}=u[D],s=uD(r);if(s in e)throw new Error(`Invalid parameter: ${x(r)} is used more than once.`);const a=o?t.slice(D):t[D];if(o&&(D=u.length),i&&(!a||o&&a.length===0))return console.error(`Error: Missing required parameter ${x(r)}
22
- `),n(),process.exit(1);e[s]=a}}function mD(e){return e===void 0||e!==!1}function Ru(e,u,t,n){const D={...u.flags},r=u.version;r&&(D.version={type:Boolean,description:"Show version"});const{help:i}=u,o=mD(i);o&&!("help"in D)&&(D.help={type:Boolean,alias:"h",description:"Show help"});const s=hn(D,n,{ignore:u.ignoreArgv}),a=()=>{console.log(u.version)};if(r&&s.flags.version===!0)return a(),process.exit(0);const f=new pD,c=o&&i?.render?i.render:F=>f.render(F),l=F=>{const E=fD({...u,...F?{help:F}:{},flags:D});console.log(c(E,f))};if(o&&s.flags.help===!0)return l(),process.exit(0);if(u.parameters){let{parameters:F}=u,E=s._;const b=F.indexOf("--"),P=F.slice(b+1),S=Object.create(null);if(b>-1&&P.length>0){F=F.slice(0,b);const Q=s._["--"];E=E.slice(0,-Q.length||void 0),xe(S,ve(F),E,l),xe(S,ve(P),Q,l)}else xe(S,ve(F),E,l);Object.assign(s._,S)}const d={...s,showVersion:a,showHelp:l};return typeof t=="function"&&t(d),{command:e,...d}}function CD(e,u){const t=new Map;for(const n of u){const D=[n.options.name],{alias:r}=n.options;r&&(Array.isArray(r)?D.push(...r):D.push(r));for(const i of D){if(t.has(i))throw new Error(`Duplicate command name found: ${x(i)}`);t.set(i,n)}}return t.get(e)}function hD(e,u,t=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!Ae.test(e.name)))throw new Error(`Invalid script name: ${x(e.name)}`);const n=t[0];if(e.commands&&Ae.test(n)){const D=CD(n,e.commands);if(D)return Ru(D.options.name,{...D.options,parent:e},D.callback,t.slice(1))}return Ru(void 0,e,u,t)}function _u(e,u){if(!e)throw new Error("Command options are required");const{name:t}=e;if(e.name===void 0)throw new Error("Command name is required");if(!Ae.test(t))throw new Error(`Invalid command name ${JSON.stringify(t)}. Command names must be one word.`);return{options:e,callback:u}}var ju="1.4.0",ED="Writes your git commit messages for you with AI",I=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},R={},gD={get exports(){return R},set exports(e){R=e}},Se,Nu;function BD(){if(Nu)return Se;Nu=1,Se=n,n.sync=D;var e=Ee;function u(r,i){var o=i.pathExt!==void 0?i.pathExt:process.env.PATHEXT;if(!o||(o=o.split(";"),o.indexOf("")!==-1))return!0;for(var s=0;s<o.length;s++){var a=o[s].toLowerCase();if(a&&r.substr(-a.length).toLowerCase()===a)return!0}return!1}function t(r,i,o){return!r.isSymbolicLink()&&!r.isFile()?!1:u(i,o)}function n(r,i,o){e.stat(r,function(s,a){o(s,s?!1:t(a,r,i))})}function D(r,i){return t(e.statSync(r),r,i)}return Se}var Oe,Lu;function wD(){if(Lu)return Oe;Lu=1,Oe=u,u.sync=t;var e=Ee;function u(r,i,o){e.stat(r,function(s,a){o(s,s?!1:n(a,i))})}function t(r,i){return n(e.statSync(r),i)}function n(r,i){return r.isFile()&&D(r,i)}function D(r,i){var o=r.mode,s=r.uid,a=r.gid,f=i.uid!==void 0?i.uid:process.getuid&&process.getuid(),c=i.gid!==void 0?i.gid:process.getgid&&process.getgid(),l=parseInt("100",8),d=parseInt("010",8),F=parseInt("001",8),E=l|d,b=o&F||o&d&&a===c||o&l&&s===f||o&E&&f===0;return b}return Oe}var re;process.platform==="win32"||I.TESTING_WINDOWS?re=BD():re=wD();var bD=Ie;Ie.sync=yD;function Ie(e,u,t){if(typeof u=="function"&&(t=u,u={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,D){Ie(e,u||{},function(r,i){r?D(r):n(i)})})}re(e,u||{},function(n,D){n&&(n.code==="EACCES"||u&&u.ignoreErrors)&&(n=null,D=!1),t(n,D)})}function yD(e,u){try{return re.sync(e,u||{})}catch(t){if(u&&u.ignoreErrors||t.code==="EACCES")return!1;throw t}}const M=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Mu=V,$D=M?";":":",Gu=bD,Uu=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Wu=(e,u)=>{const t=u.colon||$D,n=e.match(/\//)||M&&e.match(/\\/)?[""]:[...M?[process.cwd()]:[],...(u.path||process.env.PATH||"").split(t)],D=M?u.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",r=M?D.split(t):[""];return M&&e.indexOf(".")!==-1&&r[0]!==""&&r.unshift(""),{pathEnv:n,pathExt:r,pathExtExe:D}},Ku=(e,u,t)=>{typeof u=="function"&&(t=u,u={}),u||(u={});const{pathEnv:n,pathExt:D,pathExtExe:r}=Wu(e,u),i=[],o=a=>new Promise((f,c)=>{if(a===n.length)return u.all&&i.length?f(i):c(Uu(e));const l=n[a],d=/^".*"$/.test(l)?l.slice(1,-1):l,F=Mu.join(d,e),E=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+F:F;f(s(E,a,0))}),s=(a,f,c)=>new Promise((l,d)=>{if(c===D.length)return l(o(f+1));const F=D[c];Gu(a+F,{pathExt:r},(E,b)=>{if(!E&&b)if(u.all)i.push(a+F);else return l(a+F);return l(s(a,f,c+1))})});return t?o(0).then(a=>t(null,a),t):o(0)},AD=(e,u)=>{u=u||{};const{pathEnv:t,pathExt:n,pathExtExe:D}=Wu(e,u),r=[];for(let i=0;i<t.length;i++){const o=t[i],s=/^".*"$/.test(o)?o.slice(1,-1):o,a=Mu.join(s,e),f=!s&&/^\.[\\\/]/.test(e)?e.slice(0,2)+a:a;for(let c=0;c<n.length;c++){const l=f+n[c];try{if(Gu.sync(l,{pathExt:D}))if(u.all)r.push(l);else return l}catch{}}}if(u.all&&r.length)return r;if(u.nothrow)return null;throw Uu(e)};var vD=Ku;Ku.sync=AD;var ie={},xD={get exports(){return ie},set exports(e){ie=e}};const qu=(e={})=>{const u=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(u).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};xD.exports=qu,ie.default=qu;const zu=V,SD=vD,OD=ie;function Vu(e,u){const t=e.options.env||process.env,n=process.cwd(),D=e.options.cwd!=null,r=D&&process.chdir!==void 0&&!process.chdir.disabled;if(r)try{process.chdir(e.options.cwd)}catch{}let i;try{i=SD.sync(e.command,{path:t[OD({env:t})],pathExt:u?zu.delimiter:void 0})}catch{}finally{r&&process.chdir(n)}return i&&(i=zu.resolve(D?e.options.cwd:"",i)),i}function ID(e){return Vu(e)||Vu(e,!0)}var TD=ID,Te={};const Pe=/([()\][%!^"`<>&|;, *?])/g;function PD(e){return e=e.replace(Pe,"^$1"),e}function kD(e,u){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(Pe,"^$1"),u&&(e=e.replace(Pe,"^$1")),e}Te.command=PD,Te.argument=kD;var RD=/^#!(.*)/;const _D=RD;var jD=(e="")=>{const u=e.match(_D);if(!u)return null;const[t,n]=u[0].replace(/#! ?/,"").split(" "),D=t.split("/").pop();return D==="env"?n:n?`${D} ${n}`:D};const ke=Ee,ND=jD;function LD(e){const t=Buffer.alloc(150);let n;try{n=ke.openSync(e,"r"),ke.readSync(n,t,0,150,0),ke.closeSync(n)}catch{}return ND(t.toString())}var MD=LD;const GD=V,Hu=TD,Yu=Te,UD=MD,WD=process.platform==="win32",KD=/\.(?:com|exe)$/i,qD=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function zD(e){e.file=Hu(e);const u=e.file&&UD(e.file);return u?(e.args.unshift(e.file),e.command=u,Hu(e)):e.file}function VD(e){if(!WD)return e;const u=zD(e),t=!KD.test(u);if(e.options.forceShell||t){const n=qD.test(u);e.command=GD.normalize(e.command),e.command=Yu.command(e.command),e.args=e.args.map(r=>Yu.argument(r,n));const D=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${D}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function HD(e,u,t){u&&!Array.isArray(u)&&(t=u,u=null),u=u?u.slice(0):[],t=Object.assign({},t);const n={command:e,args:u,options:t,file:void 0,original:{command:e,args:u}};return t.shell?n:VD(n)}var YD=HD;const Re=process.platform==="win32";function _e(e,u){return Object.assign(new Error(`${u} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${u} ${e.command}`,path:e.command,spawnargs:e.args})}function JD(e,u){if(!Re)return;const t=e.emit;e.emit=function(n,D){if(n==="exit"){const r=Ju(D,u);if(r)return t.call(e,"error",r)}return t.apply(e,arguments)}}function Ju(e,u){return Re&&e===1&&!u.file?_e(u.original,"spawn"):null}function XD(e,u){return Re&&e===1&&!u.file?_e(u.original,"spawnSync"):null}var ZD={hookChildProcess:JD,verifyENOENT:Ju,verifyENOENTSync:XD,notFoundError:_e};const Xu=Gt,je=YD,Ne=ZD;function Zu(e,u,t){const n=je(e,u,t),D=Xu.spawn(n.command,n.args,n.options);return Ne.hookChildProcess(D,n),D}function QD(e,u,t){const n=je(e,u,t),D=Xu.spawnSync(n.command,n.args,n.options);return D.error=D.error||Ne.verifyENOENTSync(D.status,n),D}gD.exports=Zu,R.spawn=Zu,R.sync=QD,R._parse=je,R._enoent=Ne;function er(e){const u=typeof e=="string"?`
21
+ `);if("type"in u&&this[u.type]){const t=this[u.type];if(typeof t=="function")return t.call(this,u.data)}throw new Error(`Invalid node type: ${JSON.stringify(u)}`)}}const Ae=/^[\w.-]+$/,{stringify:x}=JSON,FD=/[|\\{}()[\]^$+*?.]/;function ve(e){const u=[];let t,n;for(const D of e){if(n)throw new Error(`Invalid parameter: Spread parameter ${x(n)} must be last`);const r=D[0],i=D[D.length-1];let o;if(r==="<"&&i===">"&&(o=!0,t))throw new Error(`Invalid parameter: Required parameter ${x(D)} cannot come after optional parameter ${x(t)}`);if(r==="["&&i==="]"&&(o=!1,t=D),o===void 0)throw new Error(`Invalid parameter: ${x(D)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let s=D.slice(1,-1);const a=s.slice(-3)==="...";a&&(n=D,s=s.slice(0,-3));const l=s.match(FD);if(l)throw new Error(`Invalid parameter: ${x(D)}. Invalid character found ${x(l[0])}`);u.push({name:s,required:o,spread:a})}return u}function xe(e,u,t,n){for(let D=0;D<u.length;D+=1){const{name:r,required:i,spread:o}=u[D],s=uD(r);if(s in e)throw new Error(`Invalid parameter: ${x(r)} is used more than once.`);const a=o?t.slice(D):t[D];if(o&&(D=u.length),i&&(!a||o&&a.length===0))return console.error(`Error: Missing required parameter ${x(r)}
22
+ `),n(),process.exit(1);e[s]=a}}function mD(e){return e===void 0||e!==!1}function Ru(e,u,t,n){const D={...u.flags},r=u.version;r&&(D.version={type:Boolean,description:"Show version"});const{help:i}=u,o=mD(i);o&&!("help"in D)&&(D.help={type:Boolean,alias:"h",description:"Show help"});const s=hn(D,n,{ignore:u.ignoreArgv}),a=()=>{console.log(u.version)};if(r&&s.flags.version===!0)return a(),process.exit(0);const l=new pD,c=o&&i?.render?i.render:F=>l.render(F),f=F=>{const E=fD({...u,...F?{help:F}:{},flags:D});console.log(c(E,l))};if(o&&s.flags.help===!0)return f(),process.exit(0);if(u.parameters){let{parameters:F}=u,E=s._;const b=F.indexOf("--"),P=F.slice(b+1),S=Object.create(null);if(b>-1&&P.length>0){F=F.slice(0,b);const Q=s._["--"];E=E.slice(0,-Q.length||void 0),xe(S,ve(F),E,f),xe(S,ve(P),Q,f)}else xe(S,ve(F),E,f);Object.assign(s._,S)}const d={...s,showVersion:a,showHelp:f};return typeof t=="function"&&t(d),{command:e,...d}}function CD(e,u){const t=new Map;for(const n of u){const D=[n.options.name],{alias:r}=n.options;r&&(Array.isArray(r)?D.push(...r):D.push(r));for(const i of D){if(t.has(i))throw new Error(`Duplicate command name found: ${x(i)}`);t.set(i,n)}}return t.get(e)}function hD(e,u,t=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!Ae.test(e.name)))throw new Error(`Invalid script name: ${x(e.name)}`);const n=t[0];if(e.commands&&Ae.test(n)){const D=CD(n,e.commands);if(D)return Ru(D.options.name,{...D.options,parent:e},D.callback,t.slice(1))}return Ru(void 0,e,u,t)}function _u(e,u){if(!e)throw new Error("Command options are required");const{name:t}=e;if(e.name===void 0)throw new Error("Command name is required");if(!Ae.test(t))throw new Error(`Invalid command name ${JSON.stringify(t)}. Command names must be one word.`);return{options:e,callback:u}}var ju="1.4.1",ED="Writes your git commit messages for you with AI",I=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},R={},gD={get exports(){return R},set exports(e){R=e}},Se,Nu;function BD(){if(Nu)return Se;Nu=1,Se=n,n.sync=D;var e=Ee;function u(r,i){var o=i.pathExt!==void 0?i.pathExt:process.env.PATHEXT;if(!o||(o=o.split(";"),o.indexOf("")!==-1))return!0;for(var s=0;s<o.length;s++){var a=o[s].toLowerCase();if(a&&r.substr(-a.length).toLowerCase()===a)return!0}return!1}function t(r,i,o){return!r.isSymbolicLink()&&!r.isFile()?!1:u(i,o)}function n(r,i,o){e.stat(r,function(s,a){o(s,s?!1:t(a,r,i))})}function D(r,i){return t(e.statSync(r),r,i)}return Se}var Oe,Lu;function wD(){if(Lu)return Oe;Lu=1,Oe=u,u.sync=t;var e=Ee;function u(r,i,o){e.stat(r,function(s,a){o(s,s?!1:n(a,i))})}function t(r,i){return n(e.statSync(r),i)}function n(r,i){return r.isFile()&&D(r,i)}function D(r,i){var o=r.mode,s=r.uid,a=r.gid,l=i.uid!==void 0?i.uid:process.getuid&&process.getuid(),c=i.gid!==void 0?i.gid:process.getgid&&process.getgid(),f=parseInt("100",8),d=parseInt("010",8),F=parseInt("001",8),E=f|d,b=o&F||o&d&&a===c||o&f&&s===l||o&E&&l===0;return b}return Oe}var re;process.platform==="win32"||I.TESTING_WINDOWS?re=BD():re=wD();var bD=Ie;Ie.sync=yD;function Ie(e,u,t){if(typeof u=="function"&&(t=u,u={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,D){Ie(e,u||{},function(r,i){r?D(r):n(i)})})}re(e,u||{},function(n,D){n&&(n.code==="EACCES"||u&&u.ignoreErrors)&&(n=null,D=!1),t(n,D)})}function yD(e,u){try{return re.sync(e,u||{})}catch(t){if(u&&u.ignoreErrors||t.code==="EACCES")return!1;throw t}}const M=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Mu=V,$D=M?";":":",Gu=bD,Uu=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Wu=(e,u)=>{const t=u.colon||$D,n=e.match(/\//)||M&&e.match(/\\/)?[""]:[...M?[process.cwd()]:[],...(u.path||process.env.PATH||"").split(t)],D=M?u.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",r=M?D.split(t):[""];return M&&e.indexOf(".")!==-1&&r[0]!==""&&r.unshift(""),{pathEnv:n,pathExt:r,pathExtExe:D}},Ku=(e,u,t)=>{typeof u=="function"&&(t=u,u={}),u||(u={});const{pathEnv:n,pathExt:D,pathExtExe:r}=Wu(e,u),i=[],o=a=>new Promise((l,c)=>{if(a===n.length)return u.all&&i.length?l(i):c(Uu(e));const f=n[a],d=/^".*"$/.test(f)?f.slice(1,-1):f,F=Mu.join(d,e),E=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+F:F;l(s(E,a,0))}),s=(a,l,c)=>new Promise((f,d)=>{if(c===D.length)return f(o(l+1));const F=D[c];Gu(a+F,{pathExt:r},(E,b)=>{if(!E&&b)if(u.all)i.push(a+F);else return f(a+F);return f(s(a,l,c+1))})});return t?o(0).then(a=>t(null,a),t):o(0)},AD=(e,u)=>{u=u||{};const{pathEnv:t,pathExt:n,pathExtExe:D}=Wu(e,u),r=[];for(let i=0;i<t.length;i++){const o=t[i],s=/^".*"$/.test(o)?o.slice(1,-1):o,a=Mu.join(s,e),l=!s&&/^\.[\\\/]/.test(e)?e.slice(0,2)+a:a;for(let c=0;c<n.length;c++){const f=l+n[c];try{if(Gu.sync(f,{pathExt:D}))if(u.all)r.push(f);else return f}catch{}}}if(u.all&&r.length)return r;if(u.nothrow)return null;throw Uu(e)};var vD=Ku;Ku.sync=AD;var ie={},xD={get exports(){return ie},set exports(e){ie=e}};const qu=(e={})=>{const u=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(u).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};xD.exports=qu,ie.default=qu;const zu=V,SD=vD,OD=ie;function Vu(e,u){const t=e.options.env||process.env,n=process.cwd(),D=e.options.cwd!=null,r=D&&process.chdir!==void 0&&!process.chdir.disabled;if(r)try{process.chdir(e.options.cwd)}catch{}let i;try{i=SD.sync(e.command,{path:t[OD({env:t})],pathExt:u?zu.delimiter:void 0})}catch{}finally{r&&process.chdir(n)}return i&&(i=zu.resolve(D?e.options.cwd:"",i)),i}function ID(e){return Vu(e)||Vu(e,!0)}var TD=ID,Te={};const Pe=/([()\][%!^"`<>&|;, *?])/g;function PD(e){return e=e.replace(Pe,"^$1"),e}function kD(e,u){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(Pe,"^$1"),u&&(e=e.replace(Pe,"^$1")),e}Te.command=PD,Te.argument=kD;var RD=/^#!(.*)/;const _D=RD;var jD=(e="")=>{const u=e.match(_D);if(!u)return null;const[t,n]=u[0].replace(/#! ?/,"").split(" "),D=t.split("/").pop();return D==="env"?n:n?`${D} ${n}`:D};const ke=Ee,ND=jD;function LD(e){const t=Buffer.alloc(150);let n;try{n=ke.openSync(e,"r"),ke.readSync(n,t,0,150,0),ke.closeSync(n)}catch{}return ND(t.toString())}var MD=LD;const GD=V,Hu=TD,Yu=Te,UD=MD,WD=process.platform==="win32",KD=/\.(?:com|exe)$/i,qD=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function zD(e){e.file=Hu(e);const u=e.file&&UD(e.file);return u?(e.args.unshift(e.file),e.command=u,Hu(e)):e.file}function VD(e){if(!WD)return e;const u=zD(e),t=!KD.test(u);if(e.options.forceShell||t){const n=qD.test(u);e.command=GD.normalize(e.command),e.command=Yu.command(e.command),e.args=e.args.map(r=>Yu.argument(r,n));const D=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${D}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function HD(e,u,t){u&&!Array.isArray(u)&&(t=u,u=null),u=u?u.slice(0):[],t=Object.assign({},t);const n={command:e,args:u,options:t,file:void 0,original:{command:e,args:u}};return t.shell?n:VD(n)}var YD=HD;const Re=process.platform==="win32";function _e(e,u){return Object.assign(new Error(`${u} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${u} ${e.command}`,path:e.command,spawnargs:e.args})}function JD(e,u){if(!Re)return;const t=e.emit;e.emit=function(n,D){if(n==="exit"){const r=Ju(D,u);if(r)return t.call(e,"error",r)}return t.apply(e,arguments)}}function Ju(e,u){return Re&&e===1&&!u.file?_e(u.original,"spawn"):null}function XD(e,u){return Re&&e===1&&!u.file?_e(u.original,"spawnSync"):null}var ZD={hookChildProcess:JD,verifyENOENT:Ju,verifyENOENTSync:XD,notFoundError:_e};const Xu=Gt,je=YD,Ne=ZD;function Zu(e,u,t){const n=je(e,u,t),D=Xu.spawn(n.command,n.args,n.options);return Ne.hookChildProcess(D,n),D}function QD(e,u,t){const n=je(e,u,t),D=Xu.spawnSync(n.command,n.args,n.options);return D.error=D.error||Ne.verifyENOENTSync(D.status,n),D}gD.exports=Zu,R.spawn=Zu,R.sync=QD,R._parse=je,R._enoent=Ne;function er(e){const u=typeof e=="string"?`
23
23
  `:`
24
24
  `.charCodeAt(),t=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===u&&(e=e.slice(0,-1)),e[e.length-1]===t&&(e=e.slice(0,-1)),e}function Qu(e={}){const{env:u=process.env,platform:t=process.platform}=e;return t!=="win32"?"PATH":Object.keys(u).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}function ur(e={}){const{cwd:u=g.cwd(),path:t=g.env[Qu()],execPath:n=g.execPath}=e;let D;const r=u instanceof URL?Ut.fileURLToPath(u):u;let i=L.resolve(r);const o=[];for(;D!==i;)o.push(L.join(i,"node_modules/.bin")),D=i,i=L.resolve(i,"..");return o.push(L.resolve(r,n,"..")),[...o,t].join(L.delimiter)}function tr({env:e=g.env,...u}={}){e={...e};const t=Qu({env:e});return u.path=e[t],e[t]=ur(u),e}const nr=(e,u,t,n)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;const D=Object.getOwnPropertyDescriptor(e,t),r=Object.getOwnPropertyDescriptor(u,t);!Dr(D,r)&&n||Object.defineProperty(e,t,r)},Dr=function(e,u){return e===void 0||e.configurable||e.writable===u.writable&&e.enumerable===u.enumerable&&e.configurable===u.configurable&&(e.writable||e.value===u.value)},rr=(e,u)=>{const t=Object.getPrototypeOf(u);t!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,t)},ir=(e,u)=>`/* Wrapped ${e}*/
25
- ${u}`,or=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),sr=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),ar=(e,u,t)=>{const n=t===""?"":`with ${t.trim()}() `,D=ir.bind(null,n,u.toString());Object.defineProperty(D,"name",sr),Object.defineProperty(e,"toString",{...or,value:D})};function cr(e,u,{ignoreNonConfigurable:t=!1}={}){const{name:n}=e;for(const D of Reflect.ownKeys(u))nr(e,u,D,t);return rr(e,u),ar(e,u,n),e}const oe=new WeakMap,et=(e,u={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let t,n=0;const D=e.displayName||e.name||"<anonymous>",r=function(...i){if(oe.set(r,++n),n===1)t=e.apply(this,i),e=null;else if(u.throw===!0)throw new Error(`Function \`${D}\` can only be called once`);return t};return cr(r,e),oe.set(r,n),r};et.callCount=e=>{if(!oe.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return oe.get(e)};const lr=function(){const e=tt-ut+1;return Array.from({length:e},fr)},fr=function(e,u){return{name:`SIGRT${u+1}`,number:ut+u,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},ut=34,tt=64,dr=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],nt=function(){const e=lr();return[...dr,...e].map(pr)},pr=function({name:e,number:u,description:t,action:n,forced:D=!1,standard:r}){const{signals:{[e]:i}}=pu,o=i!==void 0;return{name:e,number:o?i:u,description:t,supported:o,action:n,forced:D,standard:r}},Fr=function(){const e=nt();return Object.fromEntries(e.map(mr))},mr=function({name:e,number:u,description:t,supported:n,action:D,forced:r,standard:i}){return[e,{name:e,number:u,description:t,supported:n,action:D,forced:r,standard:i}]},Cr=Fr(),hr=function(){const e=nt(),u=tt+1,t=Array.from({length:u},(n,D)=>Er(D,e));return Object.assign({},...t)},Er=function(e,u){const t=gr(e,u);if(t===void 0)return{};const{name:n,description:D,supported:r,action:i,forced:o,standard:s}=t;return{[e]:{name:n,number:e,description:D,supported:r,action:i,forced:o,standard:s}}},gr=function(e,u){const t=u.find(({name:n})=>pu.signals[n]===e);return t!==void 0?t:u.find(n=>n.number===e)};hr();const Br=({timedOut:e,timeout:u,errorCode:t,signal:n,signalDescription:D,exitCode:r,isCanceled:i})=>e?`timed out after ${u} milliseconds`:i?"was canceled":t!==void 0?`failed with ${t}`:n!==void 0?`was killed with ${n} (${D})`:r!==void 0?`failed with exit code ${r}`:"failed",Dt=({stdout:e,stderr:u,all:t,error:n,signal:D,exitCode:r,command:i,escapedCommand:o,timedOut:s,isCanceled:a,killed:f,parsed:{options:{timeout:c}}})=>{r=r===null?void 0:r,D=D===null?void 0:D;const l=D===void 0?void 0:Cr[D].description,d=n&&n.code,E=`Command ${Br({timedOut:s,timeout:c,errorCode:d,signal:D,signalDescription:l,exitCode:r,isCanceled:a})}: ${i}`,b=Object.prototype.toString.call(n)==="[object Error]",P=b?`${E}
25
+ ${u}`,or=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),sr=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),ar=(e,u,t)=>{const n=t===""?"":`with ${t.trim()}() `,D=ir.bind(null,n,u.toString());Object.defineProperty(D,"name",sr),Object.defineProperty(e,"toString",{...or,value:D})};function cr(e,u,{ignoreNonConfigurable:t=!1}={}){const{name:n}=e;for(const D of Reflect.ownKeys(u))nr(e,u,D,t);return rr(e,u),ar(e,u,n),e}const oe=new WeakMap,et=(e,u={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let t,n=0;const D=e.displayName||e.name||"<anonymous>",r=function(...i){if(oe.set(r,++n),n===1)t=e.apply(this,i),e=null;else if(u.throw===!0)throw new Error(`Function \`${D}\` can only be called once`);return t};return cr(r,e),oe.set(r,n),r};et.callCount=e=>{if(!oe.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return oe.get(e)};const lr=function(){const e=tt-ut+1;return Array.from({length:e},fr)},fr=function(e,u){return{name:`SIGRT${u+1}`,number:ut+u,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},ut=34,tt=64,dr=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],nt=function(){const e=lr();return[...dr,...e].map(pr)},pr=function({name:e,number:u,description:t,action:n,forced:D=!1,standard:r}){const{signals:{[e]:i}}=pu,o=i!==void 0;return{name:e,number:o?i:u,description:t,supported:o,action:n,forced:D,standard:r}},Fr=function(){const e=nt();return Object.fromEntries(e.map(mr))},mr=function({name:e,number:u,description:t,supported:n,action:D,forced:r,standard:i}){return[e,{name:e,number:u,description:t,supported:n,action:D,forced:r,standard:i}]},Cr=Fr(),hr=function(){const e=nt(),u=tt+1,t=Array.from({length:u},(n,D)=>Er(D,e));return Object.assign({},...t)},Er=function(e,u){const t=gr(e,u);if(t===void 0)return{};const{name:n,description:D,supported:r,action:i,forced:o,standard:s}=t;return{[e]:{name:n,number:e,description:D,supported:r,action:i,forced:o,standard:s}}},gr=function(e,u){const t=u.find(({name:n})=>pu.signals[n]===e);return t!==void 0?t:u.find(n=>n.number===e)};hr();const Br=({timedOut:e,timeout:u,errorCode:t,signal:n,signalDescription:D,exitCode:r,isCanceled:i})=>e?`timed out after ${u} milliseconds`:i?"was canceled":t!==void 0?`failed with ${t}`:n!==void 0?`was killed with ${n} (${D})`:r!==void 0?`failed with exit code ${r}`:"failed",Dt=({stdout:e,stderr:u,all:t,error:n,signal:D,exitCode:r,command:i,escapedCommand:o,timedOut:s,isCanceled:a,killed:l,parsed:{options:{timeout:c}}})=>{r=r===null?void 0:r,D=D===null?void 0:D;const f=D===void 0?void 0:Cr[D].description,d=n&&n.code,E=`Command ${Br({timedOut:s,timeout:c,errorCode:d,signal:D,signalDescription:f,exitCode:r,isCanceled:a})}: ${i}`,b=Object.prototype.toString.call(n)==="[object Error]",P=b?`${E}
26
26
  ${n.message}`:E,S=[P,u,e].filter(Boolean).join(`
27
- `);return b?(n.originalMessage=n.message,n.message=S):n=new Error(S),n.shortMessage=P,n.command=i,n.escapedCommand=o,n.exitCode=r,n.signal=D,n.signalDescription=l,n.stdout=e,n.stderr=u,t!==void 0&&(n.all=t),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=Boolean(s),n.isCanceled=a,n.killed=f&&!s,n},se=["stdin","stdout","stderr"],wr=e=>se.some(u=>e[u]!==void 0),br=e=>{if(!e)return;const{stdio:u}=e;if(u===void 0)return se.map(n=>e[n]);if(wr(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${se.map(n=>`\`${n}\``).join(", ")}`);if(typeof u=="string")return u;if(!Array.isArray(u))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof u}\``);const t=Math.max(u.length,se.length);return Array.from({length:t},(n,D)=>u[D])};var G={},rt={get exports(){return G},set exports(e){G=e}},ae={},yr={get exports(){return ae},set exports(e){ae=e}},it;function $r(){return it||(it=1,function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}(yr)),ae}var m=I.process;const _=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};if(!_(m))rt.exports=function(){return function(){}};else{var Ar=Kt,J=$r(),vr=/^win/i.test(m.platform),ce=qt;typeof ce!="function"&&(ce=ce.EventEmitter);var B;m.__signal_exit_emitter__?B=m.__signal_exit_emitter__:(B=m.__signal_exit_emitter__=new ce,B.count=0,B.emitted={}),B.infinite||(B.setMaxListeners(1/0),B.infinite=!0),rt.exports=function(e,u){if(!_(I.process))return function(){};Ar.equal(typeof e,"function","a callback must be provided for exit handler"),X===!1&&ot();var t="exit";u&&u.alwaysLast&&(t="afterexit");var n=function(){B.removeListener(t,e),B.listeners("exit").length===0&&B.listeners("afterexit").length===0&&Le()};return B.on(t,e),n};var Le=function(){!X||!_(I.process)||(X=!1,J.forEach(function(u){try{m.removeListener(u,Me[u])}catch{}}),m.emit=Ge,m.reallyExit=st,B.count-=1)};G.unload=Le;var U=function(u,t,n){B.emitted[u]||(B.emitted[u]=!0,B.emit(u,t,n))},Me={};J.forEach(function(e){Me[e]=function(){if(_(I.process)){var t=m.listeners(e);t.length===B.count&&(Le(),U("exit",null,e),U("afterexit",null,e),vr&&e==="SIGHUP"&&(e="SIGINT"),m.kill(m.pid,e))}}}),G.signals=function(){return J};var X=!1,ot=function(){X||!_(I.process)||(X=!0,B.count+=1,J=J.filter(function(u){try{return m.on(u,Me[u]),!0}catch{return!1}}),m.emit=Sr,m.reallyExit=xr)};G.load=ot;var st=m.reallyExit,xr=function(u){_(I.process)&&(m.exitCode=u||0,U("exit",m.exitCode,null),U("afterexit",m.exitCode,null),st.call(m,m.exitCode))},Ge=m.emit,Sr=function(u,t){if(u==="exit"&&_(I.process)){t!==void 0&&(m.exitCode=t);var n=Ge.apply(this,arguments);return U("exit",m.exitCode,null),U("afterexit",m.exitCode,null),n}else return Ge.apply(this,arguments)}}const Or=1e3*5,Ir=(e,u="SIGTERM",t={})=>{const n=e(u);return Tr(e,u,t,n),n},Tr=(e,u,t,n)=>{if(!Pr(u,t,n))return;const D=Rr(t),r=setTimeout(()=>{e("SIGKILL")},D);r.unref&&r.unref()},Pr=(e,{forceKillAfterTimeout:u},t)=>kr(e)&&u!==!1&&t,kr=e=>e===Wt.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Rr=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Or;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},_r=(e,u)=>{e.kill()&&(u.isCanceled=!0)},jr=(e,u,t)=>{e.kill(u),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:u}))},Nr=(e,{timeout:u,killSignal:t="SIGTERM"},n)=>{if(u===0||u===void 0)return n;let D;const r=new Promise((o,s)=>{D=setTimeout(()=>{jr(e,t,s)},u)}),i=n.finally(()=>{clearTimeout(D)});return Promise.race([r,i])},Lr=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Mr=async(e,{cleanup:u,detached:t},n)=>{if(!u||t)return n;const D=G(()=>{e.kill()});return n.finally(()=>{D()})};function Gr(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}var j={},Ur={get exports(){return j},set exports(e){j=e}};const{PassThrough:Wr}=ge;var Kr=e=>{e={...e};const{array:u}=e;let{encoding:t}=e;const n=t==="buffer";let D=!1;u?D=!(t||n):t=t||"utf8",n&&(t=null);const r=new Wr({objectMode:D});t&&r.setEncoding(t);let i=0;const o=[];return r.on("data",s=>{o.push(s),D?i=o.length:i+=s.length}),r.getBufferedValue=()=>u?o:n?Buffer.concat(o,i):o.join(""),r.getBufferedLength=()=>i,r};const{constants:qr}=zt,zr=ge,{promisify:Vr}=Vt,Hr=Kr,Yr=Vr(zr.pipeline);class at extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function Ue(e,u){if(!e)throw new Error("Expected a stream");u={maxBuffer:1/0,...u};const{maxBuffer:t}=u,n=Hr(u);return await new Promise((D,r)=>{const i=o=>{o&&n.getBufferedLength()<=qr.MAX_LENGTH&&(o.bufferedData=n.getBufferedValue()),r(o)};(async()=>{try{await Yr(e,n),D()}catch(o){i(o)}})(),n.on("data",()=>{n.getBufferedLength()>t&&i(new at)})}),n.getBufferedValue()}Ur.exports=Ue,j.buffer=(e,u)=>Ue(e,{...u,encoding:"buffer"}),j.array=(e,u)=>Ue(e,{...u,array:!0}),j.MaxBufferError=at;const{PassThrough:Jr}=ge;var Xr=function(){var e=[],u=new Jr({objectMode:!0});return u.setMaxListeners(0),u.add=t,u.isEmpty=n,u.on("unpipe",D),Array.prototype.slice.call(arguments).forEach(t),u;function t(r){return Array.isArray(r)?(r.forEach(t),this):(e.push(r),r.once("end",D.bind(null,r)),r.once("error",u.emit.bind(u,"error")),r.pipe(u,{end:!1}),this)}function n(){return e.length==0}function D(r){e=e.filter(function(i){return i!==r}),!e.length&&u.readable&&u.end()}};const Zr=(e,u)=>{u!==void 0&&(Gr(u)?u.pipe(e.stdin):e.stdin.end(u))},Qr=(e,{all:u})=>{if(!u||!e.stdout&&!e.stderr)return;const t=Xr();return e.stdout&&t.add(e.stdout),e.stderr&&t.add(e.stderr),t},We=async(e,u)=>{if(!(!e||u===void 0)){e.destroy();try{return await u}catch(t){return t.bufferedData}}},Ke=(e,{encoding:u,buffer:t,maxBuffer:n})=>{if(!(!e||!t))return u?j(e,{encoding:u,maxBuffer:n}):j.buffer(e,{maxBuffer:n})},ei=async({stdout:e,stderr:u,all:t},{encoding:n,buffer:D,maxBuffer:r},i)=>{const o=Ke(e,{encoding:n,buffer:D,maxBuffer:r}),s=Ke(u,{encoding:n,buffer:D,maxBuffer:r}),a=Ke(t,{encoding:n,buffer:D,maxBuffer:r*2});try{return await Promise.all([i,o,s,a])}catch(f){return Promise.all([{error:f,signal:f.signal,timedOut:f.timedOut},We(e,o),We(u,s),We(t,a)])}},ui=(async()=>{})().constructor.prototype,ti=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(ui,e)]),ct=(e,u)=>{for(const[t,n]of ti){const D=typeof u=="function"?(...r)=>Reflect.apply(n.value,u(),r):n.value.bind(u);Reflect.defineProperty(e,t,{...n,value:D})}return e},ni=e=>new Promise((u,t)=>{e.on("exit",(n,D)=>{u({exitCode:n,signal:D})}),e.on("error",n=>{t(n)}),e.stdin&&e.stdin.on("error",n=>{t(n)})}),lt=(e,u=[])=>Array.isArray(u)?[e,...u]:[e],Di=/^[\w.-]+$/,ri=/"/g,ii=e=>typeof e!="string"||Di.test(e)?e:`"${e.replace(ri,'\\"')}"`,oi=(e,u)=>lt(e,u).join(" "),si=(e,u)=>lt(e,u).map(t=>ii(t)).join(" "),ai=1e3*1e3*100,ci=({env:e,extendEnv:u,preferLocal:t,localDir:n,execPath:D})=>{const r=u?{...g.env,...e}:e;return t?tr({env:r,cwd:n,execPath:D}):r},li=(e,u,t={})=>{const n=R._parse(e,u,t);return e=n.command,u=n.args,t=n.options,t={maxBuffer:ai,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:t.cwd||g.cwd(),execPath:g.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...t},t.env=ci(t),t.stdio=br(t),g.platform==="win32"&&L.basename(e,".exe")==="cmd"&&u.unshift("/q"),{file:e,args:u,options:t,parsed:n}},qe=(e,u,t)=>typeof u!="string"&&!Mt.isBuffer(u)?t===void 0?void 0:"":e.stripFinalNewline?er(u):u;function le(e,u,t){const n=li(e,u,t),D=oi(e,u),r=si(e,u);Lr(n.options);let i;try{i=lu.spawn(n.file,n.args,n.options)}catch(d){const F=new lu.ChildProcess,E=Promise.reject(Dt({error:d,stdout:"",stderr:"",all:"",command:D,escapedCommand:r,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return ct(F,E)}const o=ni(i),s=Nr(i,n.options,o),a=Mr(i,n.options,s),f={isCanceled:!1};i.kill=Ir.bind(null,i.kill.bind(i)),i.cancel=_r.bind(null,i,f);const l=et(async()=>{const[{error:d,exitCode:F,signal:E,timedOut:b},P,S,Q]=await ei(i,n.options,a),iu=qe(n.options,P),ou=qe(n.options,S),su=qe(n.options,Q);if(d||F!==0||E!==null){const au=Dt({error:d,exitCode:F,signal:E,stdout:iu,stderr:ou,all:su,command:D,escapedCommand:r,parsed:n,timedOut:b,isCanceled:f.isCanceled||(n.options.signal?n.options.signal.aborted:!1),killed:i.killed});if(!n.options.reject)return au;throw au}return{command:D,escapedCommand:r,exitCode:0,stdout:iu,stderr:ou,all:su,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Zr(i,n.options.input),i.all=Qr(i,n.options),ct(i,l)}let N=!0;const W=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let ft=0;if(W.process&&W.process.env&&W.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:u,NO_COLOR:t,TERM:n}=W.process.env;u||t||e==="0"?N=!1:e==="1"||e==="2"||e==="3"?N=!0:n==="dumb"?N=!1:"CI"in W.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(D=>D in W.process.env)?N=!0:N=process.stdout.isTTY,N&&(ft=n&&n.endsWith("-256color")?2:1)}let dt={enabled:N,supportLevel:ft};function Z(e,u,t=1){const n=`\x1B[${e}m`,D=`\x1B[${u}m`,r=new RegExp(`\\x1b\\[${u}m`,"g");return i=>dt.enabled&&dt.supportLevel>=t?n+(""+i).replace(r,n)+D:""+i}const ze=Z(2,22),pt=Z(30,39),fe=Z(31,39),de=Z(32,39),Ft=Z(46,49),Ve="\x1B",h=`${Ve}[`,fi="\x07",He={to(e,u){return u?`${h}${u+1};${e+1}H`:`${h}${e+1}G`},move(e,u){let t="";return e<0?t+=`${h}${-e}D`:e>0&&(t+=`${h}${e}C`),u<0?t+=`${h}${-u}A`:u>0&&(t+=`${h}${u}B`),t},up:(e=1)=>`${h}${e}A`,down:(e=1)=>`${h}${e}B`,forward:(e=1)=>`${h}${e}C`,backward:(e=1)=>`${h}${e}D`,nextLine:(e=1)=>`${h}E`.repeat(e),prevLine:(e=1)=>`${h}F`.repeat(e),left:`${h}G`,hide:`${h}?25l`,show:`${h}?25h`,save:`${Ve}7`,restore:`${Ve}8`},di={up:(e=1)=>`${h}S`.repeat(e),down:(e=1)=>`${h}T`.repeat(e)},pi={screen:`${h}2J`,up:(e=1)=>`${h}1J`.repeat(e),down:(e=1)=>`${h}J`.repeat(e),line:`${h}2K`,lineEnd:`${h}K`,lineStart:`${h}1K`,lines(e){let u="";for(let t=0;t<e;t++)u+=this.line+(t<e-1?He.up():"");return e&&(u+=He.left),u}};var w={cursor:He,scroll:di,erase:pi,beep:fi},p={},Fi={get exports(){return p},set exports(e){p=e}};let mi=cu,Ci=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||mi.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),C=(e,u,t=e)=>n=>{let D=""+n,r=D.indexOf(u,e.length);return~r?e+mt(D,u,t,r)+u:e+D+u},mt=(e,u,t,n)=>{let D=e.substring(0,n)+t,r=e.substring(n+u.length),i=r.indexOf(u);return~i?D+mt(r,u,t,i):D+r},Ct=(e=Ci)=>({isColorSupported:e,reset:e?u=>`\x1B[0m${u}\x1B[0m`:String,bold:e?C("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:e?C("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:e?C("\x1B[3m","\x1B[23m"):String,underline:e?C("\x1B[4m","\x1B[24m"):String,inverse:e?C("\x1B[7m","\x1B[27m"):String,hidden:e?C("\x1B[8m","\x1B[28m"):String,strikethrough:e?C("\x1B[9m","\x1B[29m"):String,black:e?C("\x1B[30m","\x1B[39m"):String,red:e?C("\x1B[31m","\x1B[39m"):String,green:e?C("\x1B[32m","\x1B[39m"):String,yellow:e?C("\x1B[33m","\x1B[39m"):String,blue:e?C("\x1B[34m","\x1B[39m"):String,magenta:e?C("\x1B[35m","\x1B[39m"):String,cyan:e?C("\x1B[36m","\x1B[39m"):String,white:e?C("\x1B[37m","\x1B[39m"):String,gray:e?C("\x1B[90m","\x1B[39m"):String,bgBlack:e?C("\x1B[40m","\x1B[49m"):String,bgRed:e?C("\x1B[41m","\x1B[49m"):String,bgGreen:e?C("\x1B[42m","\x1B[49m"):String,bgYellow:e?C("\x1B[43m","\x1B[49m"):String,bgBlue:e?C("\x1B[44m","\x1B[49m"):String,bgMagenta:e?C("\x1B[45m","\x1B[49m"):String,bgCyan:e?C("\x1B[46m","\x1B[49m"):String,bgWhite:e?C("\x1B[47m","\x1B[49m"):String});Fi.exports=Ct(),p.createColors=Ct;function hi(e,u){if(e===u)return;const t=e.split(`
27
+ `);return b?(n.originalMessage=n.message,n.message=S):n=new Error(S),n.shortMessage=P,n.command=i,n.escapedCommand=o,n.exitCode=r,n.signal=D,n.signalDescription=f,n.stdout=e,n.stderr=u,t!==void 0&&(n.all=t),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=Boolean(s),n.isCanceled=a,n.killed=l&&!s,n},se=["stdin","stdout","stderr"],wr=e=>se.some(u=>e[u]!==void 0),br=e=>{if(!e)return;const{stdio:u}=e;if(u===void 0)return se.map(n=>e[n]);if(wr(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${se.map(n=>`\`${n}\``).join(", ")}`);if(typeof u=="string")return u;if(!Array.isArray(u))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof u}\``);const t=Math.max(u.length,se.length);return Array.from({length:t},(n,D)=>u[D])};var G={},rt={get exports(){return G},set exports(e){G=e}},ae={},yr={get exports(){return ae},set exports(e){ae=e}},it;function $r(){return it||(it=1,function(e){e.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],process.platform!=="win32"&&e.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&e.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")}(yr)),ae}var m=I.process;const _=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};if(!_(m))rt.exports=function(){return function(){}};else{var Ar=Kt,J=$r(),vr=/^win/i.test(m.platform),ce=qt;typeof ce!="function"&&(ce=ce.EventEmitter);var B;m.__signal_exit_emitter__?B=m.__signal_exit_emitter__:(B=m.__signal_exit_emitter__=new ce,B.count=0,B.emitted={}),B.infinite||(B.setMaxListeners(1/0),B.infinite=!0),rt.exports=function(e,u){if(!_(I.process))return function(){};Ar.equal(typeof e,"function","a callback must be provided for exit handler"),X===!1&&ot();var t="exit";u&&u.alwaysLast&&(t="afterexit");var n=function(){B.removeListener(t,e),B.listeners("exit").length===0&&B.listeners("afterexit").length===0&&Le()};return B.on(t,e),n};var Le=function(){!X||!_(I.process)||(X=!1,J.forEach(function(u){try{m.removeListener(u,Me[u])}catch{}}),m.emit=Ge,m.reallyExit=st,B.count-=1)};G.unload=Le;var U=function(u,t,n){B.emitted[u]||(B.emitted[u]=!0,B.emit(u,t,n))},Me={};J.forEach(function(e){Me[e]=function(){if(_(I.process)){var t=m.listeners(e);t.length===B.count&&(Le(),U("exit",null,e),U("afterexit",null,e),vr&&e==="SIGHUP"&&(e="SIGINT"),m.kill(m.pid,e))}}}),G.signals=function(){return J};var X=!1,ot=function(){X||!_(I.process)||(X=!0,B.count+=1,J=J.filter(function(u){try{return m.on(u,Me[u]),!0}catch{return!1}}),m.emit=Sr,m.reallyExit=xr)};G.load=ot;var st=m.reallyExit,xr=function(u){_(I.process)&&(m.exitCode=u||0,U("exit",m.exitCode,null),U("afterexit",m.exitCode,null),st.call(m,m.exitCode))},Ge=m.emit,Sr=function(u,t){if(u==="exit"&&_(I.process)){t!==void 0&&(m.exitCode=t);var n=Ge.apply(this,arguments);return U("exit",m.exitCode,null),U("afterexit",m.exitCode,null),n}else return Ge.apply(this,arguments)}}const Or=1e3*5,Ir=(e,u="SIGTERM",t={})=>{const n=e(u);return Tr(e,u,t,n),n},Tr=(e,u,t,n)=>{if(!Pr(u,t,n))return;const D=Rr(t),r=setTimeout(()=>{e("SIGKILL")},D);r.unref&&r.unref()},Pr=(e,{forceKillAfterTimeout:u},t)=>kr(e)&&u!==!1&&t,kr=e=>e===Wt.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",Rr=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Or;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},_r=(e,u)=>{e.kill()&&(u.isCanceled=!0)},jr=(e,u,t)=>{e.kill(u),t(Object.assign(new Error("Timed out"),{timedOut:!0,signal:u}))},Nr=(e,{timeout:u,killSignal:t="SIGTERM"},n)=>{if(u===0||u===void 0)return n;let D;const r=new Promise((o,s)=>{D=setTimeout(()=>{jr(e,t,s)},u)}),i=n.finally(()=>{clearTimeout(D)});return Promise.race([r,i])},Lr=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Mr=async(e,{cleanup:u,detached:t},n)=>{if(!u||t)return n;const D=G(()=>{e.kill()});return n.finally(()=>{D()})};function Gr(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}var j={},Ur={get exports(){return j},set exports(e){j=e}};const{PassThrough:Wr}=ge;var Kr=e=>{e={...e};const{array:u}=e;let{encoding:t}=e;const n=t==="buffer";let D=!1;u?D=!(t||n):t=t||"utf8",n&&(t=null);const r=new Wr({objectMode:D});t&&r.setEncoding(t);let i=0;const o=[];return r.on("data",s=>{o.push(s),D?i=o.length:i+=s.length}),r.getBufferedValue=()=>u?o:n?Buffer.concat(o,i):o.join(""),r.getBufferedLength=()=>i,r};const{constants:qr}=zt,zr=ge,{promisify:Vr}=Vt,Hr=Kr,Yr=Vr(zr.pipeline);class at extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function Ue(e,u){if(!e)throw new Error("Expected a stream");u={maxBuffer:1/0,...u};const{maxBuffer:t}=u,n=Hr(u);return await new Promise((D,r)=>{const i=o=>{o&&n.getBufferedLength()<=qr.MAX_LENGTH&&(o.bufferedData=n.getBufferedValue()),r(o)};(async()=>{try{await Yr(e,n),D()}catch(o){i(o)}})(),n.on("data",()=>{n.getBufferedLength()>t&&i(new at)})}),n.getBufferedValue()}Ur.exports=Ue,j.buffer=(e,u)=>Ue(e,{...u,encoding:"buffer"}),j.array=(e,u)=>Ue(e,{...u,array:!0}),j.MaxBufferError=at;const{PassThrough:Jr}=ge;var Xr=function(){var e=[],u=new Jr({objectMode:!0});return u.setMaxListeners(0),u.add=t,u.isEmpty=n,u.on("unpipe",D),Array.prototype.slice.call(arguments).forEach(t),u;function t(r){return Array.isArray(r)?(r.forEach(t),this):(e.push(r),r.once("end",D.bind(null,r)),r.once("error",u.emit.bind(u,"error")),r.pipe(u,{end:!1}),this)}function n(){return e.length==0}function D(r){e=e.filter(function(i){return i!==r}),!e.length&&u.readable&&u.end()}};const Zr=(e,u)=>{u!==void 0&&(Gr(u)?u.pipe(e.stdin):e.stdin.end(u))},Qr=(e,{all:u})=>{if(!u||!e.stdout&&!e.stderr)return;const t=Xr();return e.stdout&&t.add(e.stdout),e.stderr&&t.add(e.stderr),t},We=async(e,u)=>{if(!(!e||u===void 0)){e.destroy();try{return await u}catch(t){return t.bufferedData}}},Ke=(e,{encoding:u,buffer:t,maxBuffer:n})=>{if(!(!e||!t))return u?j(e,{encoding:u,maxBuffer:n}):j.buffer(e,{maxBuffer:n})},ei=async({stdout:e,stderr:u,all:t},{encoding:n,buffer:D,maxBuffer:r},i)=>{const o=Ke(e,{encoding:n,buffer:D,maxBuffer:r}),s=Ke(u,{encoding:n,buffer:D,maxBuffer:r}),a=Ke(t,{encoding:n,buffer:D,maxBuffer:r*2});try{return await Promise.all([i,o,s,a])}catch(l){return Promise.all([{error:l,signal:l.signal,timedOut:l.timedOut},We(e,o),We(u,s),We(t,a)])}},ui=(async()=>{})().constructor.prototype,ti=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(ui,e)]),ct=(e,u)=>{for(const[t,n]of ti){const D=typeof u=="function"?(...r)=>Reflect.apply(n.value,u(),r):n.value.bind(u);Reflect.defineProperty(e,t,{...n,value:D})}return e},ni=e=>new Promise((u,t)=>{e.on("exit",(n,D)=>{u({exitCode:n,signal:D})}),e.on("error",n=>{t(n)}),e.stdin&&e.stdin.on("error",n=>{t(n)})}),lt=(e,u=[])=>Array.isArray(u)?[e,...u]:[e],Di=/^[\w.-]+$/,ri=/"/g,ii=e=>typeof e!="string"||Di.test(e)?e:`"${e.replace(ri,'\\"')}"`,oi=(e,u)=>lt(e,u).join(" "),si=(e,u)=>lt(e,u).map(t=>ii(t)).join(" "),ai=1e3*1e3*100,ci=({env:e,extendEnv:u,preferLocal:t,localDir:n,execPath:D})=>{const r=u?{...g.env,...e}:e;return t?tr({env:r,cwd:n,execPath:D}):r},li=(e,u,t={})=>{const n=R._parse(e,u,t);return e=n.command,u=n.args,t=n.options,t={maxBuffer:ai,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:t.cwd||g.cwd(),execPath:g.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...t},t.env=ci(t),t.stdio=br(t),g.platform==="win32"&&L.basename(e,".exe")==="cmd"&&u.unshift("/q"),{file:e,args:u,options:t,parsed:n}},qe=(e,u,t)=>typeof u!="string"&&!Mt.isBuffer(u)?t===void 0?void 0:"":e.stripFinalNewline?er(u):u;function le(e,u,t){const n=li(e,u,t),D=oi(e,u),r=si(e,u);Lr(n.options);let i;try{i=lu.spawn(n.file,n.args,n.options)}catch(d){const F=new lu.ChildProcess,E=Promise.reject(Dt({error:d,stdout:"",stderr:"",all:"",command:D,escapedCommand:r,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return ct(F,E)}const o=ni(i),s=Nr(i,n.options,o),a=Mr(i,n.options,s),l={isCanceled:!1};i.kill=Ir.bind(null,i.kill.bind(i)),i.cancel=_r.bind(null,i,l);const f=et(async()=>{const[{error:d,exitCode:F,signal:E,timedOut:b},P,S,Q]=await ei(i,n.options,a),iu=qe(n.options,P),ou=qe(n.options,S),su=qe(n.options,Q);if(d||F!==0||E!==null){const au=Dt({error:d,exitCode:F,signal:E,stdout:iu,stderr:ou,all:su,command:D,escapedCommand:r,parsed:n,timedOut:b,isCanceled:l.isCanceled||(n.options.signal?n.options.signal.aborted:!1),killed:i.killed});if(!n.options.reject)return au;throw au}return{command:D,escapedCommand:r,exitCode:0,stdout:iu,stderr:ou,all:su,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Zr(i,n.options.input),i.all=Qr(i,n.options),ct(i,f)}let N=!0;const W=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{};let ft=0;if(W.process&&W.process.env&&W.process.stdout){const{FORCE_COLOR:e,NODE_DISABLE_COLORS:u,NO_COLOR:t,TERM:n}=W.process.env;u||t||e==="0"?N=!1:e==="1"||e==="2"||e==="3"?N=!0:n==="dumb"?N=!1:"CI"in W.process.env&&["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE","DRONE"].some(D=>D in W.process.env)?N=!0:N=process.stdout.isTTY,N&&(ft=n&&n.endsWith("-256color")?2:1)}let dt={enabled:N,supportLevel:ft};function Z(e,u,t=1){const n=`\x1B[${e}m`,D=`\x1B[${u}m`,r=new RegExp(`\\x1b\\[${u}m`,"g");return i=>dt.enabled&&dt.supportLevel>=t?n+(""+i).replace(r,n)+D:""+i}const ze=Z(2,22),pt=Z(30,39),fe=Z(31,39),de=Z(32,39),Ft=Z(46,49),Ve="\x1B",h=`${Ve}[`,fi="\x07",He={to(e,u){return u?`${h}${u+1};${e+1}H`:`${h}${e+1}G`},move(e,u){let t="";return e<0?t+=`${h}${-e}D`:e>0&&(t+=`${h}${e}C`),u<0?t+=`${h}${-u}A`:u>0&&(t+=`${h}${u}B`),t},up:(e=1)=>`${h}${e}A`,down:(e=1)=>`${h}${e}B`,forward:(e=1)=>`${h}${e}C`,backward:(e=1)=>`${h}${e}D`,nextLine:(e=1)=>`${h}E`.repeat(e),prevLine:(e=1)=>`${h}F`.repeat(e),left:`${h}G`,hide:`${h}?25l`,show:`${h}?25h`,save:`${Ve}7`,restore:`${Ve}8`},di={up:(e=1)=>`${h}S`.repeat(e),down:(e=1)=>`${h}T`.repeat(e)},pi={screen:`${h}2J`,up:(e=1)=>`${h}1J`.repeat(e),down:(e=1)=>`${h}J`.repeat(e),line:`${h}2K`,lineEnd:`${h}K`,lineStart:`${h}1K`,lines(e){let u="";for(let t=0;t<e;t++)u+=this.line+(t<e-1?He.up():"");return e&&(u+=He.left),u}};var w={cursor:He,scroll:di,erase:pi,beep:fi},p={},Fi={get exports(){return p},set exports(e){p=e}};let mi=cu,Ci=!("NO_COLOR"in process.env||process.argv.includes("--no-color"))&&("FORCE_COLOR"in process.env||process.argv.includes("--color")||process.platform==="win32"||mi.isatty(1)&&process.env.TERM!=="dumb"||"CI"in process.env),C=(e,u,t=e)=>n=>{let D=""+n,r=D.indexOf(u,e.length);return~r?e+mt(D,u,t,r)+u:e+D+u},mt=(e,u,t,n)=>{let D=e.substring(0,n)+t,r=e.substring(n+u.length),i=r.indexOf(u);return~i?D+mt(r,u,t,i):D+r},Ct=(e=Ci)=>({isColorSupported:e,reset:e?u=>`\x1B[0m${u}\x1B[0m`:String,bold:e?C("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"):String,dim:e?C("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"):String,italic:e?C("\x1B[3m","\x1B[23m"):String,underline:e?C("\x1B[4m","\x1B[24m"):String,inverse:e?C("\x1B[7m","\x1B[27m"):String,hidden:e?C("\x1B[8m","\x1B[28m"):String,strikethrough:e?C("\x1B[9m","\x1B[29m"):String,black:e?C("\x1B[30m","\x1B[39m"):String,red:e?C("\x1B[31m","\x1B[39m"):String,green:e?C("\x1B[32m","\x1B[39m"):String,yellow:e?C("\x1B[33m","\x1B[39m"):String,blue:e?C("\x1B[34m","\x1B[39m"):String,magenta:e?C("\x1B[35m","\x1B[39m"):String,cyan:e?C("\x1B[36m","\x1B[39m"):String,white:e?C("\x1B[37m","\x1B[39m"):String,gray:e?C("\x1B[90m","\x1B[39m"):String,bgBlack:e?C("\x1B[40m","\x1B[49m"):String,bgRed:e?C("\x1B[41m","\x1B[49m"):String,bgGreen:e?C("\x1B[42m","\x1B[49m"):String,bgYellow:e?C("\x1B[43m","\x1B[49m"):String,bgBlue:e?C("\x1B[44m","\x1B[49m"):String,bgMagenta:e?C("\x1B[45m","\x1B[49m"):String,bgCyan:e?C("\x1B[46m","\x1B[49m"):String,bgWhite:e?C("\x1B[47m","\x1B[49m"):String});Fi.exports=Ct(),p.createColors=Ct;function hi(e,u){if(e===u)return;const t=e.split(`
28
28
  `),n=u.split(`
29
29
  `),D=[];for(let r=0;r<Math.max(t.length,n.length);r++)t[r]!==n[r]&&D.push(r);return D}const ht=Symbol("clack:cancel");function Et(e){return e===ht}function pe(e,u){e.isTTY&&e.setRawMode(u)}const gt=new Map([["k","up"],["j","down"],["h","left"],["l","right"]]),Ei=new Set(["up","down","left","right","space","enter"]);class Bt{constructor({render:u,input:t=fu,output:n=du,...D},r=!0){this._track=!1,this._cursor=0,this.state="initial",this.error="",this.subscribers=new Map,this._prevFrame="",this.opts=D,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=u.bind(this),this._track=r,this.input=t,this.output=n}prompt(){const u=new Ht(0);return u._write=(t,n,D)=>{this._track&&(this.value=this.rl.line.replace(/\t/g,""),this._cursor=this.rl.cursor,this.emit("value",this.value)),D()},this.input.pipe(u),this.rl=Fu.createInterface({input:this.input,output:u,tabSize:2,prompt:"",escapeCodeTimeout:50}),Fu.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),pe(this.input,!0),this.render(),new Promise((t,n)=>{this.once("submit",()=>{this.output.write(w.cursor.show),pe(this.input,!1),t(this.value)}),this.once("cancel",()=>{this.output.write(w.cursor.show),pe(this.input,!1),t(ht)})})}on(u,t){const n=this.subscribers.get(u)??[];n.push({cb:t}),this.subscribers.set(u,n)}once(u,t){const n=this.subscribers.get(u)??[];n.push({cb:t,once:!0}),this.subscribers.set(u,n)}emit(u,...t){const n=this.subscribers.get(u)??[],D=[];for(const r of n)r.cb(...t),r.once&&D.push(()=>n.splice(n.indexOf(r),1));for(const r of D)r()}unsubscribe(){this.subscribers.clear()}onKeypress(u,t){if(this.state==="error"&&(this.state="active"),t?.name&&!this._track&&gt.has(t.name)&&this.emit("cursor",gt.get(t.name)),t?.name&&Ei.has(t.name)&&this.emit("cursor",t.name),u&&(u.toLowerCase()==="y"||u.toLowerCase()==="n")&&this.emit("confirm",u.toLowerCase()==="y"),u&&this.emit("key",u.toLowerCase()),t?.name==="return"){if(this.opts.validate){const n=this.opts.validate(this.value);n&&(this.error=n,this.state="error",this.rl.write(this.value))}this.state!=="error"&&(this.state="submit")}u===""&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
30
30
  `),pe(this.input,!1),this.rl.close(),this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){const u=this._prevFrame.split(`
@@ -58,17 +58,21 @@ ${uu}${ze(`aicommits v${ju}`)}`),console.error(`
58
58
  ${uu}Please open a Bug report with the information above:`),console.error(`${uu}https://github.com/Nutlope/aicommits/issues/new/choose`))},$t=async()=>{const{stdout:e}=await le("git",["rev-parse","--is-inside-work-tree"],{reject:!1});if(e!=="true")throw new A("The current directory must be a Git repository!")},At=["package-lock.json","pnpm-lock.yaml","*.lock"].map(e=>`:(exclude)${e}`),vt=async()=>{const e=["diff","--cached"],{stdout:u}=await le("git",[...e,"--name-only",...At]);if(!u)return;const{stdout:t}=await le("git",[...e,...At]);return{files:u.split(`
59
59
  `),diff:t}},Oi=e=>`Detected ${e.length.toLocaleString()} staged file${e.length>1?"s":""}`,{hasOwnProperty:tu}=Object.prototype,me=typeof process<"u"&&process.platform==="win32"?`\r
60
60
  `:`
61
- `,nu=(e,u)=>{const t=[];let n="";typeof u=="string"?u={section:u,whitespace:!1}:(u=u||Object.create(null),u.whitespace=u.whitespace===!0);const D=u.whitespace?" = ":"=";for(const r of Object.keys(e)){const i=e[r];if(i&&Array.isArray(i))for(const o of i)n+=q(r+"[]")+D+q(o)+me;else i&&typeof i=="object"?t.push(r):n+=q(r)+D+q(i)+me}u.section&&n.length&&(n="["+q(u.section)+"]"+me+n);for(const r of t){const i=xt(r).join("\\."),o=(u.section?u.section+".":"")+i,{whitespace:s}=u,a=nu(e[r],{section:o,whitespace:s});n.length&&a.length&&(n+=me),n+=a}return n},xt=e=>e.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(u=>u.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")),St=e=>{const u=Object.create(null);let t=u,n=null;const D=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,r=e.split(/[\r\n]+/g);for(const o of r){if(!o||o.match(/^\s*[;#]/))continue;const s=o.match(D);if(!s)continue;if(s[1]!==void 0){if(n=Ce(s[1]),n==="__proto__"){t=Object.create(null);continue}t=u[n]=u[n]||Object.create(null);continue}const a=Ce(s[2]),f=a.length>2&&a.slice(-2)==="[]",c=f?a.slice(0,-2):a;if(c==="__proto__")continue;const l=s[3]?Ce(s[4]):!0,d=l==="true"||l==="false"||l==="null"?JSON.parse(l):l;f&&(tu.call(t,c)?Array.isArray(t[c])||(t[c]=[t[c]]):t[c]=[]),Array.isArray(t[c])?t[c].push(d):t[c]=d}const i=[];for(const o of Object.keys(u)){if(!tu.call(u,o)||typeof u[o]!="object"||Array.isArray(u[o]))continue;const s=xt(o);t=u;const a=s.pop(),f=a.replace(/\\\./g,".");for(const c of s)c!=="__proto__"&&((!tu.call(t,c)||typeof t[c]!="object")&&(t[c]=Object.create(null)),t=t[c]);t===u&&f===a||(t[f]=u[o],i.push(o))}for(const o of i)delete u[o];return u},Ot=e=>e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"),q=e=>typeof e!="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&Ot(e)||e!==e.trim()?JSON.stringify(e):e.split(";").join("\\;").split("#").join("\\#"),Ce=(e,u)=>{if(e=(e||"").trim(),Ot(e)){e.charAt(0)==="'"&&(e=e.slice(1,-1));try{e=JSON.parse(e)}catch{}}else{let t=!1,n="";for(let D=0,r=e.length;D<r;D++){const i=e.charAt(D);if(t)"\\;#".indexOf(i)!==-1?n+=i:n+="\\"+i,t=!1;else{if(";#".indexOf(i)!==-1)break;i==="\\"?t=!0:n+=i}}return t&&(n+="\\"),n.trim()}return e};var It={parse:St,decode:St,stringify:nu,encode:nu,safe:q,unsafe:Ce};const Tt=e=>v.lstat(e).then(()=>!0,()=>!1),{hasOwnProperty:Ii}=Object.prototype,Pt=(e,u)=>Ii.call(e,u),z=(e,u,t)=>{if(!u)throw new A(`Invalid config property ${e}: ${t}`)},he={OPENAI_KEY(e){if(!e)throw new A("Please set your OpenAI API key via `aicommits config set OPENAI_KEY=<your token>`");return z("OPENAI_KEY",e.startsWith("sk-"),'Must start with "sk-"'),e},locale(e){return e?(z("locale",e,"Cannot be empty"),z("locale",/^[a-z-]+$/i.test(e),"Must be a valid locale (letters and dashes/underscores). You can consult the list of codes in: https://wikipedia.org/wiki/List_of_ISO_639-1_codes"),e):"en"},generate(e){if(!e)return 1;z("generate",/^\d+$/.test(e),"Must be an integer");const u=Number(e);return z("generate",u>0,"Must be greater than 0"),z("generate",u<=5,"Must be less or equal to 5"),u}},Du=V.join(Yt.homedir(),".aicommits"),kt=async()=>{if(!await Tt(Du))return Object.create(null);const u=await v.readFile(Du,"utf8");return It.parse(u)},ru=async e=>{const u=await kt(),t={};for(const n of Object.keys(he)){const D=he[n],r=e?.[n]??u[n];t[n]=D(r)}return t},Ti=async e=>{const u=await kt();for(const[t,n]of e){if(!Pt(he,t))throw new A(`Invalid config property: ${t}`);const D=he[t](n);u[t]=D}await v.writeFile(Du,It.stringify(u),"utf8")},Pi=(e,u)=>new Promise((t,n)=>{const D=JSON.stringify(u),r=Jt.request({port:443,hostname:"api.openai.com",path:"/v1/completions",method:"POST",headers:{"Content-Type":"application/json","Content-Length":D.length,Authorization:`Bearer ${e}`},timeout:1e4},i=>{if(!i.statusCode||i.statusCode<200||i.statusCode>299){let s=`OpenAI API Error: ${i.statusCode} - ${i.statusMessage}`;return i.statusCode===500&&(s+="; Check the API status: https://status.openai.com"),n(new A(s))}const o=[];i.on("data",s=>o.push(s)),i.on("end",()=>{t(JSON.parse(Buffer.concat(o).toString()))})});r.on("error",n),r.on("timeout",()=>{r.destroy(),n(new A("Request timed out"))}),r.write(D),r.end()}),ki=e=>e.trim().replace(/[\n\r]/g,"").replace(/(\w)\.$/,"$1"),Ri=e=>Array.from(new Set(e)),_i=(e,u)=>`Write an insightful but concise Git commit message in a complete sentence in present tense for the following diff without prefacing it with anything, the response must be in the language ${e}:
62
- ${u}`,Rt="text-davinci-003",ji=Xt(Rt),_t=async(e,u,t,n)=>{const D=_i(u,t);if(ji.encode(D).length>4e3)throw new A("The diff is too large for the OpenAI API. Try reducing the number of staged changes, or write your own commit message.");try{const r=await Pi(e,{model:Rt,prompt:D,temperature:.7,top_p:1,frequency_penalty:0,presence_penalty:0,max_tokens:200,stream:!1,n});return Ri(r.choices.map(i=>ki(i.text)))}catch(r){const i=r;throw i.code==="ENOTFOUND"?new A(`Error connecting to ${i.hostname} (${i.syscall}). Are you connected to the internet?`):i}};var Ni=async(e,u)=>(async()=>{yt(Ft(pt(" aicommits "))),await $t();const t=eu();t.start("Detecting staged files");const n=await vt();if(!n)throw new A("No staged changes found. Make sure to stage your changes with `git add`.");t.stop(`${Oi(n.files)}:
61
+ `,nu=(e,u)=>{const t=[];let n="";typeof u=="string"?u={section:u,whitespace:!1}:(u=u||Object.create(null),u.whitespace=u.whitespace===!0);const D=u.whitespace?" = ":"=";for(const r of Object.keys(e)){const i=e[r];if(i&&Array.isArray(i))for(const o of i)n+=q(r+"[]")+D+q(o)+me;else i&&typeof i=="object"?t.push(r):n+=q(r)+D+q(i)+me}u.section&&n.length&&(n="["+q(u.section)+"]"+me+n);for(const r of t){const i=xt(r).join("\\."),o=(u.section?u.section+".":"")+i,{whitespace:s}=u,a=nu(e[r],{section:o,whitespace:s});n.length&&a.length&&(n+=me),n+=a}return n},xt=e=>e.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(u=>u.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")),St=e=>{const u=Object.create(null);let t=u,n=null;const D=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,r=e.split(/[\r\n]+/g);for(const o of r){if(!o||o.match(/^\s*[;#]/))continue;const s=o.match(D);if(!s)continue;if(s[1]!==void 0){if(n=Ce(s[1]),n==="__proto__"){t=Object.create(null);continue}t=u[n]=u[n]||Object.create(null);continue}const a=Ce(s[2]),l=a.length>2&&a.slice(-2)==="[]",c=l?a.slice(0,-2):a;if(c==="__proto__")continue;const f=s[3]?Ce(s[4]):!0,d=f==="true"||f==="false"||f==="null"?JSON.parse(f):f;l&&(tu.call(t,c)?Array.isArray(t[c])||(t[c]=[t[c]]):t[c]=[]),Array.isArray(t[c])?t[c].push(d):t[c]=d}const i=[];for(const o of Object.keys(u)){if(!tu.call(u,o)||typeof u[o]!="object"||Array.isArray(u[o]))continue;const s=xt(o);t=u;const a=s.pop(),l=a.replace(/\\\./g,".");for(const c of s)c!=="__proto__"&&((!tu.call(t,c)||typeof t[c]!="object")&&(t[c]=Object.create(null)),t=t[c]);t===u&&l===a||(t[l]=u[o],i.push(o))}for(const o of i)delete u[o];return u},Ot=e=>e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"),q=e=>typeof e!="string"||e.match(/[=\r\n]/)||e.match(/^\[/)||e.length>1&&Ot(e)||e!==e.trim()?JSON.stringify(e):e.split(";").join("\\;").split("#").join("\\#"),Ce=(e,u)=>{if(e=(e||"").trim(),Ot(e)){e.charAt(0)==="'"&&(e=e.slice(1,-1));try{e=JSON.parse(e)}catch{}}else{let t=!1,n="";for(let D=0,r=e.length;D<r;D++){const i=e.charAt(D);if(t)"\\;#".indexOf(i)!==-1?n+=i:n+="\\"+i,t=!1;else{if(";#".indexOf(i)!==-1)break;i==="\\"?t=!0:n+=i}}return t&&(n+="\\"),n.trim()}return e};var It={parse:St,decode:St,stringify:nu,encode:nu,safe:q,unsafe:Ce};const Tt=e=>v.lstat(e).then(()=>!0,()=>!1),{hasOwnProperty:Ii}=Object.prototype,Pt=(e,u)=>Ii.call(e,u),z=(e,u,t)=>{if(!u)throw new A(`Invalid config property ${e}: ${t}`)},he={OPENAI_KEY(e){if(!e)throw new A("Please set your OpenAI API key via `aicommits config set OPENAI_KEY=<your token>`");return z("OPENAI_KEY",e.startsWith("sk-"),'Must start with "sk-"'),e},locale(e){return e?(z("locale",e,"Cannot be empty"),z("locale",/^[a-z-]+$/i.test(e),"Must be a valid locale (letters and dashes/underscores). You can consult the list of codes in: https://wikipedia.org/wiki/List_of_ISO_639-1_codes"),e):"en"},generate(e){if(!e)return 1;z("generate",/^\d+$/.test(e),"Must be an integer");const u=Number(e);return z("generate",u>0,"Must be greater than 0"),z("generate",u<=5,"Must be less or equal to 5"),u}},Du=V.join(Yt.homedir(),".aicommits"),kt=async()=>{if(!await Tt(Du))return Object.create(null);const u=await v.readFile(Du,"utf8");return It.parse(u)},ru=async e=>{const u=await kt(),t={};for(const n of Object.keys(he)){const D=he[n],r=e?.[n]??u[n];t[n]=D(r)}return t},Ti=async e=>{const u=await kt();for(const[t,n]of e){if(!Pt(he,t))throw new A(`Invalid config property: ${t}`);const D=he[t](n);u[t]=D}await v.writeFile(Du,It.stringify(u),"utf8")},Pi=async(e,u,t,n)=>new Promise((D,r)=>{const i=JSON.stringify(n),o=Jt.request({port:443,hostname:e,path:u,method:"POST",headers:{...t,"Content-Type":"application/json","Content-Length":Buffer.byteLength(i)},timeout:1e4},s=>{const a=[];s.on("data",l=>a.push(l)),s.on("end",()=>{D({request:o,response:s,data:Buffer.concat(a).toString()})})});o.on("error",r),o.on("timeout",()=>{o.destroy(),r(new A("Request timed out"))}),o.write(i),o.end()}),ki=async(e,u)=>{const{response:t,data:n}=await Pi("api.openai.com","/v1/completions",{Authorization:`Bearer ${e}`},u);if(!t.statusCode||t.statusCode<200||t.statusCode>299){let D=`OpenAI API Error: ${t.statusCode} - ${t.statusMessage}`;throw n&&(D+=`
62
+
63
+ ${n}`),t.statusCode===500&&(D+=`
64
+
65
+ Check the API status: https://status.openai.com`),new A(D)}return JSON.parse(n)},Ri=e=>e.trim().replace(/[\n\r]/g,"").replace(/(\w)\.$/,"$1"),_i=e=>Array.from(new Set(e)),ji=(e,u)=>`Write an insightful but concise Git commit message in a complete sentence in present tense for the following diff without prefacing it with anything, the response must be in the language ${e}:
66
+ ${u}`,Rt="text-davinci-003",Ni=Xt(Rt),_t=async(e,u,t,n)=>{const D=ji(u,t);if(Ni.encode(D).length>4e3)throw new A("The diff is too large for the OpenAI API. Try reducing the number of staged changes, or write your own commit message.");try{const r=await ki(e,{model:Rt,prompt:D,temperature:.7,top_p:1,frequency_penalty:0,presence_penalty:0,max_tokens:200,stream:!1,n});return _i(r.choices.map(i=>Ri(i.text)))}catch(r){const i=r;throw i.code==="ENOTFOUND"?new A(`Error connecting to ${i.hostname} (${i.syscall}). Are you connected to the internet?`):i}};var Li=async(e,u)=>(async()=>{yt(Ft(pt(" aicommits "))),await $t();const t=eu();t.start("Detecting staged files");const n=await vt();if(!n)throw new A("No staged changes found. Make sure to stage your changes with `git add`.");t.stop(`${Oi(n.files)}:
63
67
  ${n.files.map(s=>` ${s}`).join(`
64
68
  `)}`);const D=await ru({OPENAI_KEY:process.env.OPENAI_KEY??process.env.OPENAI_API_KEY,generate:e?.toString()}),r=eu();r.start("The AI is analyzing your changes");const i=await _t(D.OPENAI_KEY,D.locale,n.diff,D.generate);r.stop("Changes analyzed");let o;if(i.length===1){[o]=i;const s=await xi({message:`Use this commit message?
65
69
 
66
70
  ${o}
67
- `});if(!s||Et(s)){K("Commit cancelled");return}}else{const s=await Si({message:`Pick a commit message to use: ${ze("(Ctrl+c to exit)")}`,options:i.map(a=>({label:a,value:a}))});if(Et(s)){K("Commit cancelled");return}o=s}await le("git",["commit","-m",o,...u]),K(`${de("\u2714")} Successfully committed!`)})().catch(t=>{K(`${fe("\u2716")} ${t.message}`),Fe(t),process.exit(1)});const[jt,Li]=process.argv.slice(2);var Mi=()=>(async()=>{if(!jt)throw new A('Commit message file path is missing. This file should be called from the "prepare-commit-msg" git hook');if(Li)return;const e=await vt();if(!e)return;yt(Ft(pt(" aicommits ")));const u=await ru(),t=eu();t.start("The AI is analyzing your changes");const n=await _t(u.OPENAI_KEY,u.locale,e.diff,u.generate);t.stop("Changes analyzed");const D=n.length>1;let r=`# \u{1F916} AI generated commit${D?"s":""}
71
+ `});if(!s||Et(s)){K("Commit cancelled");return}}else{const s=await Si({message:`Pick a commit message to use: ${ze("(Ctrl+c to exit)")}`,options:i.map(a=>({label:a,value:a}))});if(Et(s)){K("Commit cancelled");return}o=s}await le("git",["commit","-m",o,...u]),K(`${de("\u2714")} Successfully committed!`)})().catch(t=>{K(`${fe("\u2716")} ${t.message}`),Fe(t),process.exit(1)});const[jt,Mi]=process.argv.slice(2);var Gi=()=>(async()=>{if(!jt)throw new A('Commit message file path is missing. This file should be called from the "prepare-commit-msg" git hook');if(Mi)return;const e=await vt();if(!e)return;yt(Ft(pt(" aicommits ")));const u=await ru(),t=eu();t.start("The AI is analyzing your changes");const n=await _t(u.OPENAI_KEY,u.locale,e.diff,u.generate);t.stop("Changes analyzed");const D=n.length>1;let r=`# \u{1F916} AI generated commit${D?"s":""}
68
72
  `;D?(r+=`# Select one of the following messages by uncommeting:
69
73
  `,r+=`
70
74
  ${n.map(i=>`# ${i}`).join(`
71
75
  `)}`):(r+=`# Edit the message below and commit:
72
76
  `,r+=`
73
77
  ${n[0]}
74
- `),await v.appendFile(jt,r),K(`${de("\u2714")} Saved commit message!`)})().catch(e=>{K(`${fe("\u2716")} ${e.message}`),Fe(e),process.exit(1)}),Gi=_u({name:"config",parameters:["<mode>","<key=value...>"]},e=>{(async()=>{const{mode:u,keyValue:t}=e._;if(u==="get"){const n=await ru();for(const D of t)Pt(n,D)&&console.log(`${D}=${n[D]}`);return}if(u==="set"){await Ti(t.map(n=>n.split("=")));return}throw new A(`Invalid mode: ${u}`)})().catch(u=>{console.error(`${fe("\u2716")} ${u.message}`),Fe(u),process.exit(1)})});const Nt="prepare-commit-msg",T=`.git/hooks/${Nt}`,Ui=process.argv[1].endsWith(`/${T}`);var Wi=_u({name:"hook",parameters:["<install/uninstall>"]},e=>{const u=Zt(new URL("cli.mjs",import.meta.url));(async()=>{await $t();const{installUninstall:t}=e._,n=await Tt(T);if(t==="install"){if(n){if(await v.realpath(T).catch(()=>{})===u){console.warn("The hook is already installed");return}throw new A(`A different ${Nt} hook seems to be installed. Please remove it before installing aicommits.`)}await v.mkdir(V.dirname(T),{recursive:!0}),await v.symlink(u,T,"file"),await v.chmod(T,493),console.log(`${de("\u2714")} Hook installed`);return}if(t==="uninstall"){if(!n){console.warn("Hook is not installed");return}if(await v.realpath(T)!==u){console.warn("Hook is not installed");return}await v.rm(T),console.log(`${de("\u2714")} Hook uninstalled`);return}throw new A(`Invalid mode: ${t}`)})().catch(t=>{console.error(`${fe("\u2716")} ${t.message}`),Fe(t),process.exit(1)})});const Lt=process.argv.slice(2);hD({name:"aicommits",version:ju,flags:{generate:{type:Number,description:"Number of messages to generate. (Warning: generating multiple costs more) (default: 1)",alias:"g"}},commands:[Gi,Wi],help:{description:ED},ignoreArgv:e=>e==="unknown-flag"||e==="argument"},e=>{Ui?Mi():Ni(e.flags.generate,Lt)},Lt);
78
+ `),await v.appendFile(jt,r),K(`${de("\u2714")} Saved commit message!`)})().catch(e=>{K(`${fe("\u2716")} ${e.message}`),Fe(e),process.exit(1)}),Ui=_u({name:"config",parameters:["<mode>","<key=value...>"]},e=>{(async()=>{const{mode:u,keyValue:t}=e._;if(u==="get"){const n=await ru();for(const D of t)Pt(n,D)&&console.log(`${D}=${n[D]}`);return}if(u==="set"){await Ti(t.map(n=>n.split("=")));return}throw new A(`Invalid mode: ${u}`)})().catch(u=>{console.error(`${fe("\u2716")} ${u.message}`),Fe(u),process.exit(1)})});const Nt="prepare-commit-msg",T=`.git/hooks/${Nt}`,Wi=process.argv[1].endsWith(`/${T}`);var Ki=_u({name:"hook",parameters:["<install/uninstall>"]},e=>{const u=Zt(new URL("cli.mjs",import.meta.url));(async()=>{await $t();const{installUninstall:t}=e._,n=await Tt(T);if(t==="install"){if(n){if(await v.realpath(T).catch(()=>{})===u){console.warn("The hook is already installed");return}throw new A(`A different ${Nt} hook seems to be installed. Please remove it before installing aicommits.`)}await v.mkdir(V.dirname(T),{recursive:!0}),await v.symlink(u,T,"file"),await v.chmod(T,493),console.log(`${de("\u2714")} Hook installed`);return}if(t==="uninstall"){if(!n){console.warn("Hook is not installed");return}if(await v.realpath(T)!==u){console.warn("Hook is not installed");return}await v.rm(T),console.log(`${de("\u2714")} Hook uninstalled`);return}throw new A(`Invalid mode: ${t}`)})().catch(t=>{console.error(`${fe("\u2716")} ${t.message}`),Fe(t),process.exit(1)})});const Lt=process.argv.slice(2);hD({name:"aicommits",version:ju,flags:{generate:{type:Number,description:"Number of messages to generate. (Warning: generating multiple costs more) (default: 1)",alias:"g"}},commands:[Ui,Ki],help:{description:ED},ignoreArgv:e=>e==="unknown-flag"||e==="argument"},e=>{Wi?Gi():Li(e.flags.generate,Lt)},Lt);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aicommits",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Writes your git commit messages for you with AI",
5
5
  "keywords": [
6
6
  "ai",