@negoziator/ai-commit 1.2.7 → 1.2.8

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 (3) hide show
  1. package/README.md +12 -11
  2. package/dist/cli.mjs +13 -13
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -77,17 +77,18 @@ aicommit config set <key>=<value>
77
77
 
78
78
  ### Options
79
79
 
80
- | Option | Default | Description |
81
- |---------------------|----------------|-------------------------------------------------------------------------|
82
- | `OPENAI_KEY` | N/A | The OpenAI API key. |
83
- | `locale` | `en` | Locale for the generated commit messages. |
84
- | `generate` | `1` | Number of commit messages to generate. |
85
- | `model` | `gpt-3.5-turbo`| The Chat Completions model to use. |
86
- | `timeout` | `10000` ms | Network request timeout to the OpenAI API. |
87
- | `max-length` | `50` | Maximum character length of the generated commit message. |
88
- | `type` | `""` | Type of commit message to generate. |
89
- | `auto-confirm` | `false` | Automatically confirm the generated commit message without user prompt. |
90
- | `prepend-reference` | `false` | Prepend issue reference from branch name to commit message. |
80
+ | Option | Default | Description |
81
+ |---------------------|-----------------|---------------------------------------------------------------------------------------|
82
+ | `OPENAI_KEY` | N/A | The OpenAI API key. |
83
+ | `locale` | `en` | Locale for the generated commit messages. |
84
+ | `generate` | `1` | Number of commit messages to generate. |
85
+ | `model` | `gpt-3.5-turbo` | The Chat Completions model to use. |
86
+ | `timeout` | `10000` ms | Network request timeout to the OpenAI API. |
87
+ | `max-length` | `50` | Maximum character length of the generated commit message. |
88
+ | `type` | `""` | Type of commit message to generate. |
89
+ | `auto-confirm` | `false` | Automatically confirm the generated commit message without user prompt. |
90
+ | `prepend-reference` | `false` | Prepend issue reference from branch name to commit message. |
91
+ | `temperature` | `0.2` | The temperature (0.0-2.0) is used to control the randomness of the output from OpenAI |
91
92
 
92
93
  ## Maintainers
93
94
  - **Lars Schou**: <img src="https://img.shields.io/twitter/follow/negoziator?style=flat&label=negoziator&logo=twitter&color=0bf&logoColor=fff" align="center">
package/dist/cli.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import fu from"tty";import{Buffer as Vt}from"node:buffer";import W from"node:path";import qD,{ChildProcess as Jt}from"node:child_process";import A,{stdin as zD,stdout as KD}from"node:process";import Zt from"child_process";import H from"path";import ku from"fs";import Xt from"node:url";import Qt,{constants as YD}from"node:os";import VD from"assert";import JD from"events";import{createWriteStream as un,createReadStream as Dn}from"node:fs";import en from"buffer";import Mu from"stream";import ZD from"util";import{debuglog as tn}from"node:util";import*as Eu from"node:readline";import XD from"node:readline";import{WriteStream as nn}from"node:tty";import T from"fs/promises";import QD from"os";import rn from"https";import on from"net";import sn from"tls";import an,{fileURLToPath as cn,pathToFileURL as ln}from"url";const Fn="known-flag",Cn="unknown-flag",fn="argument",{stringify:Q}=JSON,En=/\B([A-Z])/g,dn=u=>u.replace(En,"-$1").toLowerCase(),{hasOwnProperty:pn}=Object.prototype,uu=(u,D)=>pn.call(u,D),hn=u=>Array.isArray(u),ue=u=>typeof u=="function"?[u,!1]:hn(u)?[u[0],!0]:ue(u.type),mn=(u,D)=>u===Boolean?D!=="false":D,gn=(u,D)=>typeof D=="boolean"?D:u===Number&&D===""?Number.NaN:u(D),Bn=/[\s.:=]/,bn=u=>{const D=`Flag name ${Q(u)}`;if(u.length===0)throw new Error(`${D} cannot be empty`);if(u.length===1)throw new Error(`${D} must be longer than a character`);const t=u.match(Bn);if(t)throw new Error(`${D} cannot contain ${Q(t?.[0])}`)},An=u=>{const D={},t=(e,r)=>{if(uu(D,e))throw new Error(`Duplicate flags named ${Q(e)}`);D[e]=r};for(const e in u){if(!uu(u,e))continue;bn(e);const r=u[e],o=[[],...ue(r),r];t(e,o);const n=dn(e);if(e!==n&&t(n,o),"alias"in r&&typeof r.alias=="string"){const{alias:s}=r,i=`Flag alias ${Q(s)} for flag ${Q(e)}`;if(s.length===0)throw new Error(`${i} cannot be empty`);if(s.length>1)throw new Error(`${i} must be a single character`);t(s,o)}}return D},yn=(u,D)=>{const t={};for(const e in u){if(!uu(u,e))continue;const[r,,o,n]=D[e];if(r.length===0&&"default"in n){let{default:s}=n;typeof s=="function"&&(s=s()),t[e]=s}else t[e]=o?r:r.pop()}return t},du="--",wn=/[.:=]/,$n=/^-{1,2}\w/,vn=u=>{if(!$n.test(u))return;const D=!u.startsWith(du);let t=u.slice(D?1:2),e;const r=t.match(wn);if(r){const{index:o}=r;e=t.slice(o+1),t=t.slice(0,o)}return[t,e,D]},xn=(u,{onFlag:D,onArgument:t})=>{let e;const r=(o,n)=>{if(typeof e!="function")return!0;e(o,n),e=void 0};for(let o=0;o<u.length;o+=1){const n=u[o];if(n===du){r();const i=u.slice(o+1);t?.(i,[o],!0);break}const s=vn(n);if(s){if(r(),!D)continue;const[i,l,F]=s;if(F)for(let a=0;a<i.length;a+=1){r();const c=a===i.length-1;e=D(i[a],c?l:void 0,[o,a+1,c])}else e=D(i,l,[o])}else r(n,[o])&&t?.([n],[o])}r()},Sn=(u,D)=>{for(const[t,e,r]of D.reverse()){if(e){const o=u[t];let n=o.slice(0,e);if(r||(n+=o.slice(e+1)),n!=="-"){u[t]=n;continue}}u.splice(t,1)}},On=(u,D=process.argv.slice(2),{ignore:t}={})=>{const e=[],r=An(u),o={},n=[];return n[du]=[],xn(D,{onFlag(s,i,l){const F=uu(r,s);if(!t?.(F?Fn:Cn,s,i)){if(F){const[a,c]=r[s],C=mn(c,i),f=(d,p)=>{e.push(l),p&&e.push(p),a.push(gn(c,d||""))};return C===void 0?f:f(C)}uu(o,s)||(o[s]=[]),o[s].push(i===void 0?!0:i),e.push(l)}},onArgument(s,i,l){t?.(fn,D[i[0]])||(n.push(...s),l?(n[du]=s,D.splice(i[0])):e.push(i))}}),Sn(D,e),{flags:yn(u,r),unknownFlags:o,_:n}};var Tn=Object.create,pu=Object.defineProperty,In=Object.defineProperties,Pn=Object.getOwnPropertyDescriptor,_n=Object.getOwnPropertyDescriptors,Rn=Object.getOwnPropertyNames,De=Object.getOwnPropertySymbols,kn=Object.getPrototypeOf,ee=Object.prototype.hasOwnProperty,Mn=Object.prototype.propertyIsEnumerable,te=(u,D,t)=>D in u?pu(u,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[D]=t,hu=(u,D)=>{for(var t in D||(D={}))ee.call(D,t)&&te(u,t,D[t]);if(De)for(var t of De(D))Mn.call(D,t)&&te(u,t,D[t]);return u},ju=(u,D)=>In(u,_n(D)),jn=u=>pu(u,"__esModule",{value:!0}),Nn=(u,D)=>()=>(u&&(D=u(u=0)),D),Ln=(u,D)=>()=>(D||u((D={exports:{}}).exports,D),D.exports),Gn=(u,D,t,e)=>{if(D&&typeof D=="object"||typeof D=="function")for(let r of Rn(D))!ee.call(u,r)&&(t||r!=="default")&&pu(u,r,{get:()=>D[r],enumerable:!(e=Pn(D,r))||e.enumerable});return u},Un=(u,D)=>Gn(jn(pu(u!=null?Tn(kn(u)):{},"default",!D&&u&&u.__esModule?{get:()=>u.default,enumerable:!0}:{value:u,enumerable:!0})),u),x=Nn(()=>{}),Wn=Ln((u,D)=>{x(),D.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}});x(),x(),x();var Hn=u=>{var D,t,e;let r=(D=process.stdout.columns)!=null?D:Number.POSITIVE_INFINITY;return typeof u=="function"&&(u=u(r)),u||(u={}),Array.isArray(u)?{columns:u,stdoutColumns:r}:{columns:(t=u.columns)!=null?t:[],stdoutColumns:(e=u.stdoutColumns)!=null?e:r}};x(),x(),x(),x(),x();function qn({onlyFirst:u=!1}={}){let D=["[\\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(D,u?void 0:"g")}function ne(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(qn(),"")}x();function zn(u){return Number.isInteger(u)?u>=4352&&(u<=4447||u===9001||u===9002||11904<=u&&u<=12871&&u!==12351||12880<=u&&u<=19903||19968<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65131||65281<=u&&u<=65376||65504<=u&&u<=65510||110592<=u&&u<=110593||127488<=u&&u<=127569||131072<=u&&u<=262141):!1}var Kn=Un(Wn(),1);function M(u){if(typeof u!="string"||u.length===0||(u=ne(u),u.length===0))return 0;u=u.replace((0,Kn.default)()," ");let D=0;for(let t=0;t<u.length;t++){let e=u.codePointAt(t);e<=31||e>=127&&e<=159||e>=768&&e<=879||(e>65535&&t++,D+=zn(e)?2:1)}return D}var re=u=>Math.max(...u.split(`
3
- `).map(M)),Yn=u=>{let D=[];for(let t of u){let{length:e}=t,r=e-D.length;for(let o=0;o<r;o+=1)D.push(0);for(let o=0;o<e;o+=1){let n=re(t[o]);n>D[o]&&(D[o]=n)}}return D};x();var oe=/^\d+%$/,se={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},Vn=(u,D)=>{var t;let e=[];for(let r=0;r<u.length;r+=1){let o=(t=D[r])!=null?t:"auto";if(typeof o=="number"||o==="auto"||o==="content-width"||typeof o=="string"&&oe.test(o)){e.push(ju(hu({},se),{width:o,contentWidth:u[r]}));continue}if(o&&typeof o=="object"){let n=ju(hu(hu({},se),o),{contentWidth:u[r]});n.horizontalPadding=n.paddingLeft+n.paddingRight,e.push(n);continue}throw new Error(`Invalid column width: ${JSON.stringify(o)}`)}return e};function Jn(u,D){for(let t of u){let{width:e}=t;if(e==="content-width"&&(t.width=t.contentWidth),e==="auto"){let i=Math.min(20,t.contentWidth);t.width=i,t.autoOverflow=t.contentWidth-i}if(typeof e=="string"&&oe.test(e)){let i=Number.parseFloat(e.slice(0,-1))/100;t.width=Math.floor(D*i)-(t.paddingLeft+t.paddingRight)}let{horizontalPadding:r}=t,o=1,n=o+r;if(n>=D){let i=n-D,l=Math.ceil(t.paddingLeft/r*i),F=i-l;t.paddingLeft-=l,t.paddingRight-=F,t.horizontalPadding=t.paddingLeft+t.paddingRight}t.paddingLeftString=t.paddingLeft?" ".repeat(t.paddingLeft):"",t.paddingRightString=t.paddingRight?" ".repeat(t.paddingRight):"";let s=D-t.horizontalPadding;t.width=Math.max(Math.min(t.width,s),o)}}var ie=()=>Object.assign([],{columns:0});function Zn(u,D){let t=[ie()],[e]=t;for(let r of u){let o=r.width+r.horizontalPadding;e.columns+o>D&&(e=ie(),t.push(e)),e.push(r),e.columns+=o}for(let r of t){let o=r.reduce((c,C)=>c+C.width+C.horizontalPadding,0),n=D-o;if(n===0)continue;let s=r.filter(c=>"autoOverflow"in c),i=s.filter(c=>c.autoOverflow>0),l=i.reduce((c,C)=>c+C.autoOverflow,0),F=Math.min(l,n);for(let c of i){let C=Math.floor(c.autoOverflow/l*F);c.width+=C,n-=C}let a=Math.floor(n/s.length);for(let c=0;c<s.length;c+=1){let C=s[c];c===s.length-1?C.width+=n:C.width+=a,n-=a}}return t}function Xn(u,D,t){let e=Vn(t,D);return Jn(e,u),Zn(e,u)}x(),x(),x();var Nu=10,ae=(u=0)=>D=>`\x1B[${D+u}m`,ce=(u=0)=>D=>`\x1B[${38+u};5;${D}m`,le=(u=0)=>(D,t,e)=>`\x1B[${38+u};2;${D};${t};${e}m`;function Qn(){let u=new Map,D={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]}};D.color.gray=D.color.blackBright,D.bgColor.bgGray=D.bgColor.bgBlackBright,D.color.grey=D.color.blackBright,D.bgColor.bgGrey=D.bgColor.bgBlackBright;for(let[t,e]of Object.entries(D)){for(let[r,o]of Object.entries(e))D[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},e[r]=D[r],u.set(o[0],o[1]);Object.defineProperty(D,t,{value:e,enumerable:!1})}return Object.defineProperty(D,"codes",{value:u,enumerable:!1}),D.color.close="\x1B[39m",D.bgColor.close="\x1B[49m",D.color.ansi=ae(),D.color.ansi256=ce(),D.color.ansi16m=le(),D.bgColor.ansi=ae(Nu),D.bgColor.ansi256=ce(Nu),D.bgColor.ansi16m=le(Nu),Object.defineProperties(D,{rgbToAnsi256:{value:(t,e,r)=>t===e&&e===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:t=>{let e=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!e)return[0,0,0];let{colorString:r}=e.groups;r.length===3&&(r=r.split("").map(n=>n+n).join(""));let o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>D.rgbToAnsi256(...D.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let e,r,o;if(t>=232)e=((t-232)*10+8)/255,r=e,o=e;else{t-=16;let i=t%36;e=Math.floor(t/36)/5,r=Math.floor(i/6)/5,o=i%6/5}let n=Math.max(e,r,o)*2;if(n===0)return 30;let s=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(e));return n===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,e,r)=>D.ansi256ToAnsi(D.rgbToAnsi256(t,e,r)),enumerable:!1},hexToAnsi:{value:t=>D.ansi256ToAnsi(D.hexToAnsi256(t)),enumerable:!1}}),D}var ur=Qn(),Dr=ur,mu=new Set(["\x1B","\x9B"]),er=39,Lu="\x07",Fe="[",tr="]",Ce="m",Gu=`${tr}8;;`,fe=u=>`${mu.values().next().value}${Fe}${u}${Ce}`,Ee=u=>`${mu.values().next().value}${Gu}${u}${Lu}`,nr=u=>u.split(" ").map(D=>M(D)),Uu=(u,D,t)=>{let e=[...D],r=!1,o=!1,n=M(ne(u[u.length-1]));for(let[s,i]of e.entries()){let l=M(i);if(n+l<=t?u[u.length-1]+=i:(u.push(i),n=0),mu.has(i)&&(r=!0,o=e.slice(s+1).join("").startsWith(Gu)),r){o?i===Lu&&(r=!1,o=!1):i===Ce&&(r=!1);continue}n+=l,n===t&&s<e.length-1&&(u.push(""),n=0)}!n&&u[u.length-1].length>0&&u.length>1&&(u[u.length-2]+=u.pop())},rr=u=>{let D=u.split(" "),t=D.length;for(;t>0&&!(M(D[t-1])>0);)t--;return t===D.length?u:D.slice(0,t).join(" ")+D.slice(t).join("")},or=(u,D,t={})=>{if(t.trim!==!1&&u.trim()==="")return"";let e="",r,o,n=nr(u),s=[""];for(let[l,F]of u.split(" ").entries()){t.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let a=M(s[s.length-1]);if(l!==0&&(a>=D&&(t.wordWrap===!1||t.trim===!1)&&(s.push(""),a=0),(a>0||t.trim===!1)&&(s[s.length-1]+=" ",a++)),t.hard&&n[l]>D){let c=D-a,C=1+Math.floor((n[l]-c-1)/D);Math.floor((n[l]-1)/D)<C&&s.push(""),Uu(s,F,D);continue}if(a+n[l]>D&&a>0&&n[l]>0){if(t.wordWrap===!1&&a<D){Uu(s,F,D);continue}s.push("")}if(a+n[l]>D&&t.wordWrap===!1){Uu(s,F,D);continue}s[s.length-1]+=F}t.trim!==!1&&(s=s.map(l=>rr(l)));let i=[...s.join(`
2
+ import fu from"tty";import{Buffer as Vt}from"node:buffer";import W from"node:path";import qD,{ChildProcess as Jt}from"node:child_process";import A,{stdin as zD,stdout as KD}from"node:process";import Zt from"child_process";import H from"path";import ku from"fs";import Xt from"node:url";import Qt,{constants as YD}from"node:os";import VD from"assert";import JD from"events";import{createWriteStream as un,createReadStream as Dn}from"node:fs";import en from"buffer";import Mu from"stream";import ZD from"util";import{debuglog as tn}from"node:util";import*as Eu from"node:readline";import XD from"node:readline";import{WriteStream as nn}from"node:tty";import T from"fs/promises";import QD from"os";import rn from"https";import on from"net";import sn from"tls";import an,{fileURLToPath as cn,pathToFileURL as ln}from"url";const Fn="known-flag",Cn="unknown-flag",fn="argument",{stringify:Q}=JSON,En=/\B([A-Z])/g,dn=u=>u.replace(En,"-$1").toLowerCase(),{hasOwnProperty:pn}=Object.prototype,uu=(u,D)=>pn.call(u,D),hn=u=>Array.isArray(u),ue=u=>typeof u=="function"?[u,!1]:hn(u)?[u[0],!0]:ue(u.type),mn=(u,D)=>u===Boolean?D!=="false":D,gn=(u,D)=>typeof D=="boolean"?D:u===Number&&D===""?Number.NaN:u(D),Bn=/[\s.:=]/,bn=u=>{const D=`Flag name ${Q(u)}`;if(u.length===0)throw new Error(`${D} cannot be empty`);if(u.length===1)throw new Error(`${D} must be longer than a character`);const t=u.match(Bn);if(t)throw new Error(`${D} cannot contain ${Q(t?.[0])}`)},An=u=>{const D={},t=(e,r)=>{if(uu(D,e))throw new Error(`Duplicate flags named ${Q(e)}`);D[e]=r};for(const e in u){if(!uu(u,e))continue;bn(e);const r=u[e],o=[[],...ue(r),r];t(e,o);const n=dn(e);if(e!==n&&t(n,o),"alias"in r&&typeof r.alias=="string"){const{alias:s}=r,i=`Flag alias ${Q(s)} for flag ${Q(e)}`;if(s.length===0)throw new Error(`${i} cannot be empty`);if(s.length>1)throw new Error(`${i} must be a single character`);t(s,o)}}return D},yn=(u,D)=>{const t={};for(const e in u){if(!uu(u,e))continue;const[r,,o,n]=D[e];if(r.length===0&&"default"in n){let{default:s}=n;typeof s=="function"&&(s=s()),t[e]=s}else t[e]=o?r:r.pop()}return t},du="--",wn=/[.:=]/,$n=/^-{1,2}\w/,vn=u=>{if(!$n.test(u))return;const D=!u.startsWith(du);let t=u.slice(D?1:2),e;const r=t.match(wn);if(r){const{index:o}=r;e=t.slice(o+1),t=t.slice(0,o)}return[t,e,D]},xn=(u,{onFlag:D,onArgument:t})=>{let e;const r=(o,n)=>{if(typeof e!="function")return!0;e(o,n),e=void 0};for(let o=0;o<u.length;o+=1){const n=u[o];if(n===du){r();const i=u.slice(o+1);t?.(i,[o],!0);break}const s=vn(n);if(s){if(r(),!D)continue;const[i,l,F]=s;if(F)for(let a=0;a<i.length;a+=1){r();const c=a===i.length-1;e=D(i[a],c?l:void 0,[o,a+1,c])}else e=D(i,l,[o])}else r(n,[o])&&t?.([n],[o])}r()},Sn=(u,D)=>{for(const[t,e,r]of D.reverse()){if(e){const o=u[t];let n=o.slice(0,e);if(r||(n+=o.slice(e+1)),n!=="-"){u[t]=n;continue}}u.splice(t,1)}},On=(u,D=process.argv.slice(2),{ignore:t}={})=>{const e=[],r=An(u),o={},n=[];return n[du]=[],xn(D,{onFlag(s,i,l){const F=uu(r,s);if(!t?.(F?Fn:Cn,s,i)){if(F){const[a,c]=r[s],C=mn(c,i),f=(d,p)=>{e.push(l),p&&e.push(p),a.push(gn(c,d||""))};return C===void 0?f:f(C)}uu(o,s)||(o[s]=[]),o[s].push(i===void 0?!0:i),e.push(l)}},onArgument(s,i,l){t?.(fn,D[i[0]])||(n.push(...s),l?(n[du]=s,D.splice(i[0])):e.push(i))}}),Sn(D,e),{flags:yn(u,r),unknownFlags:o,_:n}};var Tn=Object.create,pu=Object.defineProperty,In=Object.defineProperties,Pn=Object.getOwnPropertyDescriptor,_n=Object.getOwnPropertyDescriptors,Rn=Object.getOwnPropertyNames,De=Object.getOwnPropertySymbols,kn=Object.getPrototypeOf,ee=Object.prototype.hasOwnProperty,Mn=Object.prototype.propertyIsEnumerable,te=(u,D,t)=>D in u?pu(u,D,{enumerable:!0,configurable:!0,writable:!0,value:t}):u[D]=t,hu=(u,D)=>{for(var t in D||(D={}))ee.call(D,t)&&te(u,t,D[t]);if(De)for(var t of De(D))Mn.call(D,t)&&te(u,t,D[t]);return u},ju=(u,D)=>In(u,_n(D)),jn=u=>pu(u,"__esModule",{value:!0}),Nn=(u,D)=>()=>(u&&(D=u(u=0)),D),Ln=(u,D)=>()=>(D||u((D={exports:{}}).exports,D),D.exports),Gn=(u,D,t,e)=>{if(D&&typeof D=="object"||typeof D=="function")for(let r of Rn(D))!ee.call(u,r)&&(t||r!=="default")&&pu(u,r,{get:()=>D[r],enumerable:!(e=Pn(D,r))||e.enumerable});return u},Un=(u,D)=>Gn(jn(pu(u!=null?Tn(kn(u)):{},"default",!D&&u&&u.__esModule?{get:()=>u.default,enumerable:!0}:{value:u,enumerable:!0})),u),S=Nn(()=>{}),Wn=Ln((u,D)=>{S(),D.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}});S(),S(),S();var Hn=u=>{var D,t,e;let r=(D=process.stdout.columns)!=null?D:Number.POSITIVE_INFINITY;return typeof u=="function"&&(u=u(r)),u||(u={}),Array.isArray(u)?{columns:u,stdoutColumns:r}:{columns:(t=u.columns)!=null?t:[],stdoutColumns:(e=u.stdoutColumns)!=null?e:r}};S(),S(),S(),S(),S();function qn({onlyFirst:u=!1}={}){let D=["[\\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(D,u?void 0:"g")}function ne(u){if(typeof u!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof u}\``);return u.replace(qn(),"")}S();function zn(u){return Number.isInteger(u)?u>=4352&&(u<=4447||u===9001||u===9002||11904<=u&&u<=12871&&u!==12351||12880<=u&&u<=19903||19968<=u&&u<=42182||43360<=u&&u<=43388||44032<=u&&u<=55203||63744<=u&&u<=64255||65040<=u&&u<=65049||65072<=u&&u<=65131||65281<=u&&u<=65376||65504<=u&&u<=65510||110592<=u&&u<=110593||127488<=u&&u<=127569||131072<=u&&u<=262141):!1}var Kn=Un(Wn(),1);function M(u){if(typeof u!="string"||u.length===0||(u=ne(u),u.length===0))return 0;u=u.replace((0,Kn.default)()," ");let D=0;for(let t=0;t<u.length;t++){let e=u.codePointAt(t);e<=31||e>=127&&e<=159||e>=768&&e<=879||(e>65535&&t++,D+=zn(e)?2:1)}return D}var re=u=>Math.max(...u.split(`
3
+ `).map(M)),Yn=u=>{let D=[];for(let t of u){let{length:e}=t,r=e-D.length;for(let o=0;o<r;o+=1)D.push(0);for(let o=0;o<e;o+=1){let n=re(t[o]);n>D[o]&&(D[o]=n)}}return D};S();var oe=/^\d+%$/,se={width:"auto",align:"left",contentWidth:0,paddingLeft:0,paddingRight:0,paddingTop:0,paddingBottom:0,horizontalPadding:0,paddingLeftString:"",paddingRightString:""},Vn=(u,D)=>{var t;let e=[];for(let r=0;r<u.length;r+=1){let o=(t=D[r])!=null?t:"auto";if(typeof o=="number"||o==="auto"||o==="content-width"||typeof o=="string"&&oe.test(o)){e.push(ju(hu({},se),{width:o,contentWidth:u[r]}));continue}if(o&&typeof o=="object"){let n=ju(hu(hu({},se),o),{contentWidth:u[r]});n.horizontalPadding=n.paddingLeft+n.paddingRight,e.push(n);continue}throw new Error(`Invalid column width: ${JSON.stringify(o)}`)}return e};function Jn(u,D){for(let t of u){let{width:e}=t;if(e==="content-width"&&(t.width=t.contentWidth),e==="auto"){let i=Math.min(20,t.contentWidth);t.width=i,t.autoOverflow=t.contentWidth-i}if(typeof e=="string"&&oe.test(e)){let i=Number.parseFloat(e.slice(0,-1))/100;t.width=Math.floor(D*i)-(t.paddingLeft+t.paddingRight)}let{horizontalPadding:r}=t,o=1,n=o+r;if(n>=D){let i=n-D,l=Math.ceil(t.paddingLeft/r*i),F=i-l;t.paddingLeft-=l,t.paddingRight-=F,t.horizontalPadding=t.paddingLeft+t.paddingRight}t.paddingLeftString=t.paddingLeft?" ".repeat(t.paddingLeft):"",t.paddingRightString=t.paddingRight?" ".repeat(t.paddingRight):"";let s=D-t.horizontalPadding;t.width=Math.max(Math.min(t.width,s),o)}}var ie=()=>Object.assign([],{columns:0});function Zn(u,D){let t=[ie()],[e]=t;for(let r of u){let o=r.width+r.horizontalPadding;e.columns+o>D&&(e=ie(),t.push(e)),e.push(r),e.columns+=o}for(let r of t){let o=r.reduce((c,C)=>c+C.width+C.horizontalPadding,0),n=D-o;if(n===0)continue;let s=r.filter(c=>"autoOverflow"in c),i=s.filter(c=>c.autoOverflow>0),l=i.reduce((c,C)=>c+C.autoOverflow,0),F=Math.min(l,n);for(let c of i){let C=Math.floor(c.autoOverflow/l*F);c.width+=C,n-=C}let a=Math.floor(n/s.length);for(let c=0;c<s.length;c+=1){let C=s[c];c===s.length-1?C.width+=n:C.width+=a,n-=a}}return t}function Xn(u,D,t){let e=Vn(t,D);return Jn(e,u),Zn(e,u)}S(),S(),S();var Nu=10,ae=(u=0)=>D=>`\x1B[${D+u}m`,ce=(u=0)=>D=>`\x1B[${38+u};5;${D}m`,le=(u=0)=>(D,t,e)=>`\x1B[${38+u};2;${D};${t};${e}m`;function Qn(){let u=new Map,D={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]}};D.color.gray=D.color.blackBright,D.bgColor.bgGray=D.bgColor.bgBlackBright,D.color.grey=D.color.blackBright,D.bgColor.bgGrey=D.bgColor.bgBlackBright;for(let[t,e]of Object.entries(D)){for(let[r,o]of Object.entries(e))D[r]={open:`\x1B[${o[0]}m`,close:`\x1B[${o[1]}m`},e[r]=D[r],u.set(o[0],o[1]);Object.defineProperty(D,t,{value:e,enumerable:!1})}return Object.defineProperty(D,"codes",{value:u,enumerable:!1}),D.color.close="\x1B[39m",D.bgColor.close="\x1B[49m",D.color.ansi=ae(),D.color.ansi256=ce(),D.color.ansi16m=le(),D.bgColor.ansi=ae(Nu),D.bgColor.ansi256=ce(Nu),D.bgColor.ansi16m=le(Nu),Object.defineProperties(D,{rgbToAnsi256:{value:(t,e,r)=>t===e&&e===r?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(r/255*5),enumerable:!1},hexToRgb:{value:t=>{let e=/(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(t.toString(16));if(!e)return[0,0,0];let{colorString:r}=e.groups;r.length===3&&(r=r.split("").map(n=>n+n).join(""));let o=Number.parseInt(r,16);return[o>>16&255,o>>8&255,o&255]},enumerable:!1},hexToAnsi256:{value:t=>D.rgbToAnsi256(...D.hexToRgb(t)),enumerable:!1},ansi256ToAnsi:{value:t=>{if(t<8)return 30+t;if(t<16)return 90+(t-8);let e,r,o;if(t>=232)e=((t-232)*10+8)/255,r=e,o=e;else{t-=16;let i=t%36;e=Math.floor(t/36)/5,r=Math.floor(i/6)/5,o=i%6/5}let n=Math.max(e,r,o)*2;if(n===0)return 30;let s=30+(Math.round(o)<<2|Math.round(r)<<1|Math.round(e));return n===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(t,e,r)=>D.ansi256ToAnsi(D.rgbToAnsi256(t,e,r)),enumerable:!1},hexToAnsi:{value:t=>D.ansi256ToAnsi(D.hexToAnsi256(t)),enumerable:!1}}),D}var ur=Qn(),Dr=ur,mu=new Set(["\x1B","\x9B"]),er=39,Lu="\x07",Fe="[",tr="]",Ce="m",Gu=`${tr}8;;`,fe=u=>`${mu.values().next().value}${Fe}${u}${Ce}`,Ee=u=>`${mu.values().next().value}${Gu}${u}${Lu}`,nr=u=>u.split(" ").map(D=>M(D)),Uu=(u,D,t)=>{let e=[...D],r=!1,o=!1,n=M(ne(u[u.length-1]));for(let[s,i]of e.entries()){let l=M(i);if(n+l<=t?u[u.length-1]+=i:(u.push(i),n=0),mu.has(i)&&(r=!0,o=e.slice(s+1).join("").startsWith(Gu)),r){o?i===Lu&&(r=!1,o=!1):i===Ce&&(r=!1);continue}n+=l,n===t&&s<e.length-1&&(u.push(""),n=0)}!n&&u[u.length-1].length>0&&u.length>1&&(u[u.length-2]+=u.pop())},rr=u=>{let D=u.split(" "),t=D.length;for(;t>0&&!(M(D[t-1])>0);)t--;return t===D.length?u:D.slice(0,t).join(" ")+D.slice(t).join("")},or=(u,D,t={})=>{if(t.trim!==!1&&u.trim()==="")return"";let e="",r,o,n=nr(u),s=[""];for(let[l,F]of u.split(" ").entries()){t.trim!==!1&&(s[s.length-1]=s[s.length-1].trimStart());let a=M(s[s.length-1]);if(l!==0&&(a>=D&&(t.wordWrap===!1||t.trim===!1)&&(s.push(""),a=0),(a>0||t.trim===!1)&&(s[s.length-1]+=" ",a++)),t.hard&&n[l]>D){let c=D-a,C=1+Math.floor((n[l]-c-1)/D);Math.floor((n[l]-1)/D)<C&&s.push(""),Uu(s,F,D);continue}if(a+n[l]>D&&a>0&&n[l]>0){if(t.wordWrap===!1&&a<D){Uu(s,F,D);continue}s.push("")}if(a+n[l]>D&&t.wordWrap===!1){Uu(s,F,D);continue}s[s.length-1]+=F}t.trim!==!1&&(s=s.map(l=>rr(l)));let i=[...s.join(`
4
4
  `)];for(let[l,F]of i.entries()){if(e+=F,mu.has(F)){let{groups:c}=new RegExp(`(?:\\${Fe}(?<code>\\d+)m|\\${Gu}(?<uri>.*)${Lu})`).exec(i.slice(l).join(""))||{groups:{}};if(c.code!==void 0){let C=Number.parseFloat(c.code);r=C===er?void 0:C}else c.uri!==void 0&&(o=c.uri.length===0?void 0:c.uri)}let a=Dr.codes.get(Number(r));i[l+1]===`
5
5
  `?(o&&(e+=Ee("")),r&&a&&(e+=fe(a))):F===`
6
6
  `&&(r&&a&&(e+=fe(r)),o&&(e+=Ee(o)))}return e};function sr(u,D,t){return String(u).normalize().replace(/\r\n/g,`
@@ -10,7 +10,7 @@ import fu from"tty";import{Buffer as Vt}from"node:buffer";import W from"node:pat
10
10
  `);if(i.postprocess){let{postprocess:c}=i;a=a.map((C,f)=>c.call(i,C,f))}return i.paddingTop&&a.unshift(...de(i.paddingTop)),i.paddingBottom&&a.push(...de(i.paddingBottom)),a.length>o&&(o=a.length),ju(hu({},i),{lines:a})}),s=[];for(let i=0;i<o;i+=1){let l=n.map(F=>{var a;let c=(a=F.lines[i])!=null?a:"",C=Number.isFinite(F.width)?" ".repeat(F.width-M(c)):"",f=F.paddingLeftString;return F.align==="right"&&(f+=C),f+=c,F.align==="left"&&(f+=C),f+F.paddingRightString}).join("");s.push(l)}t.push(s.join(`
11
11
  `))}return t.join(`
12
12
  `)}function ar(u,D){if(!u||u.length===0)return"";let t=Yn(u),e=t.length;if(e===0)return"";let{stdoutColumns:r,columns:o}=Hn(D);if(o.length>e)throw new Error(`${o.length} columns defined, but only ${e} columns found`);let n=Xn(r,o,t);return u.map(s=>ir(n,s)).join(`
13
- `)}x();var cr=["<",">","=",">=","<="];function lr(u){if(!cr.includes(u))throw new TypeError(`Invalid breakpoint operator: ${u}`)}function Fr(u){let D=Object.keys(u).map(t=>{let[e,r]=t.split(" ");lr(e);let o=Number.parseInt(r,10);if(Number.isNaN(o))throw new TypeError(`Invalid breakpoint value: ${r}`);let n=u[t];return{operator:e,breakpoint:o,value:n}}).sort((t,e)=>e.breakpoint-t.breakpoint);return t=>{var e;return(e=D.find(({operator:r,breakpoint:o})=>r==="="&&t===o||r===">"&&t>o||r==="<"&&t<o||r===">="&&t>=o||r==="<="&&t<=o))==null?void 0:e.value}}const Cr=u=>u.replace(/[\W_]([a-z\d])?/gi,(D,t)=>t?t.toUpperCase():""),fr=u=>u.replace(/\B([A-Z])/g,"-$1").toLowerCase(),Er={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:u=>u.trim()},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function dr(u){let D=!1;return{type:"table",data:{tableData:Object.keys(u).sort((t,e)=>t.localeCompare(e)).map(t=>{const e=u[t],r="alias"in e;return r&&(D=!0),{name:t,flag:e,flagFormatted:`--${fr(t)}`,aliasesEnabled:D,aliasFormatted:r?`-${e.alias}`:void 0}}).map(t=>(t.aliasesEnabled=D,[{type:"flagName",data:t},{type:"flagDescription",data:t}])),tableBreakpoints:Er}}}const pe=u=>!u||(u.version??(u.help?u.help.version:void 0)),he=u=>{const D="parent"in u&&u.parent?.name;return(D?`${D} `:"")+u.name};function pr(u){const D=[];u.name&&D.push(he(u));const t=pe(u)??("parent"in u&&pe(u.parent));if(t&&D.push(`v${t}`),D.length!==0)return{id:"name",type:"text",data:`${D.join(" ")}
13
+ `)}S();var cr=["<",">","=",">=","<="];function lr(u){if(!cr.includes(u))throw new TypeError(`Invalid breakpoint operator: ${u}`)}function Fr(u){let D=Object.keys(u).map(t=>{let[e,r]=t.split(" ");lr(e);let o=Number.parseInt(r,10);if(Number.isNaN(o))throw new TypeError(`Invalid breakpoint value: ${r}`);let n=u[t];return{operator:e,breakpoint:o,value:n}}).sort((t,e)=>e.breakpoint-t.breakpoint);return t=>{var e;return(e=D.find(({operator:r,breakpoint:o})=>r==="="&&t===o||r===">"&&t>o||r==="<"&&t<o||r===">="&&t>=o||r==="<="&&t<=o))==null?void 0:e.value}}const Cr=u=>u.replace(/[\W_]([a-z\d])?/gi,(D,t)=>t?t.toUpperCase():""),fr=u=>u.replace(/\B([A-Z])/g,"-$1").toLowerCase(),Er={"> 80":[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"auto"}],"> 40":[{width:"auto",paddingLeft:2,paddingRight:8,preprocess:u=>u.trim()},{width:"100%",paddingLeft:2,paddingBottom:1}],"> 0":{stdoutColumns:1e3,columns:[{width:"content-width",paddingLeft:2,paddingRight:8},{width:"content-width"}]}};function dr(u){let D=!1;return{type:"table",data:{tableData:Object.keys(u).sort((t,e)=>t.localeCompare(e)).map(t=>{const e=u[t],r="alias"in e;return r&&(D=!0),{name:t,flag:e,flagFormatted:`--${fr(t)}`,aliasesEnabled:D,aliasFormatted:r?`-${e.alias}`:void 0}}).map(t=>(t.aliasesEnabled=D,[{type:"flagName",data:t},{type:"flagDescription",data:t}])),tableBreakpoints:Er}}}const pe=u=>!u||(u.version??(u.help?u.help.version:void 0)),he=u=>{const D="parent"in u&&u.parent?.name;return(D?`${D} `:"")+u.name};function pr(u){const D=[];u.name&&D.push(he(u));const t=pe(u)??("parent"in u&&pe(u.parent));if(t&&D.push(`v${t}`),D.length!==0)return{id:"name",type:"text",data:`${D.join(" ")}
14
14
  `}}function hr(u){const{help:D}=u;if(!(!D||!D.description))return{id:"description",type:"text",data:`${D.description}
15
15
  `}}function mr(u){const D=u.help||{};if("usage"in D)return D.usage?{id:"usage",type:"section",data:{title:"Usage:",body:Array.isArray(D.usage)?D.usage.join(`
16
16
  `):D.usage}}:void 0;if(u.name){const t=[],e=[he(u)];if(u.flags&&Object.keys(u.flags).length>0&&e.push("[flags...]"),u.parameters&&u.parameters.length>0){const{parameters:r}=u,o=r.indexOf("--"),n=o>-1&&r.slice(o+1).some(s=>s.startsWith("<"));e.push(r.map(s=>s!=="--"?s:n?"--":"[--]").join(" "))}if(e.length>1&&t.push(e.join(" ")),"commands"in u&&u.commands?.length&&t.push(`${u.name} <command>`),t.length>0)return{id:"usage",type:"section",data:{title:"Usage:",body:t.join(`
@@ -19,7 +19,7 @@ import fu from"tty";import{Buffer as Vt}from"node:buffer";import W from"node:pat
19
19
  `:"")+(t?this.indentText({text:this.render(t),spaces:e}):"")}
20
20
  `}table({tableData:D,tableOptions:t,tableBreakpoints:e}){return ar(D.map(r=>r.map(o=>this.render(o))),e?Fr(e):t)}flagParameter(D){return D===Boolean?"":D===String?"<string>":D===Number?"<number>":Array.isArray(D)?this.flagParameter(D[0]):"<value>"}flagOperator(D){return" "}flagName(D){const{flag:t,flagFormatted:e,aliasesEnabled:r,aliasFormatted:o}=D;let n="";if(o?n+=`${o}, `:r&&(n+=" "),n+=e,"placeholder"in t&&typeof t.placeholder=="string")n+=`${this.flagOperator(D)}${t.placeholder}`;else{const s=this.flagParameter("type"in t?t.type:t);s&&(n+=`${this.flagOperator(D)}${s}`)}return n}flagDefault(D){return JSON.stringify(D)}flagDescription({flag:D}){let t="description"in D?D.description??"":"";if("default"in D){let{default:e}=D;typeof e=="function"&&(e=e()),e&&(t+=` (default: ${this.flagDefault(e)})`)}return t}render(D){if(typeof D=="string")return D;if(Array.isArray(D))return D.map(t=>this.render(t)).join(`
21
21
  `);if("type"in D&&this[D.type]){const t=this[D.type];if(typeof t=="function")return t.call(this,D.data)}throw new Error(`Invalid node type: ${JSON.stringify(D)}`)}}const Wu=/^[\w.-]+$/,{stringify:_}=JSON,vr=/[|\\{}()[\]^$+*?.]/;function Hu(u){const D=[];let t,e;for(const r of u){if(e)throw new Error(`Invalid parameter: Spread parameter ${_(e)} must be last`);const o=r[0],n=r[r.length-1];let s;if(o==="<"&&n===">"&&(s=!0,t))throw new Error(`Invalid parameter: Required parameter ${_(r)} cannot come after optional parameter ${_(t)}`);if(o==="["&&n==="]"&&(s=!1,t=r),s===void 0)throw new Error(`Invalid parameter: ${_(r)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let i=r.slice(1,-1);const l=i.slice(-3)==="...";l&&(e=r,i=i.slice(0,-3));const F=i.match(vr);if(F)throw new Error(`Invalid parameter: ${_(r)}. Invalid character found ${_(F[0])}`);D.push({name:i,required:s,spread:l})}return D}function qu(u,D,t,e){for(let r=0;r<D.length;r+=1){const{name:o,required:n,spread:s}=D[r],i=Cr(o);if(i in u)throw new Error(`Invalid parameter: ${_(o)} is used more than once.`);const l=s?t.slice(r):t[r];if(s&&(r=D.length),n&&(!l||s&&l.length===0))return console.error(`Error: Missing required parameter ${_(o)}
22
- `),e(),process.exit(1);u[i]=l}}function xr(u){return u===void 0||u!==!1}function me(u,D,t,e){const r={...D.flags},o=D.version;o&&(r.version={type:Boolean,description:"Show version"});const{help:n}=D,s=xr(n);s&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const i=On(r,e,{ignore:D.ignoreArgv}),l=()=>{console.log(D.version)};if(o&&i.flags.version===!0)return l(),process.exit(0);const F=new $r,a=s&&n?.render?n.render:f=>F.render(f),c=f=>{const d=yr({...D,...f?{help:f}:{},flags:r});console.log(a(d,F))};if(s&&i.flags.help===!0)return c(),process.exit(0);if(D.parameters){let{parameters:f}=D,d=i._;const p=f.indexOf("--"),h=f.slice(p+1),w=Object.create(null);if(p>-1&&h.length>0){f=f.slice(0,p);const P=i._["--"];d=d.slice(0,-P.length||void 0),qu(w,Hu(f),d,c),qu(w,Hu(h),P,c)}else qu(w,Hu(f),d,c);Object.assign(i._,w)}const C={...i,showVersion:l,showHelp:c};return typeof t=="function"&&t(C),{command:u,...C}}function Sr(u,D){const t=new Map;for(const e of D){const r=[e.options.name],{alias:o}=e.options;o&&(Array.isArray(o)?r.push(...o):r.push(o));for(const n of r){if(t.has(n))throw new Error(`Duplicate command name found: ${_(n)}`);t.set(n,e)}}return t.get(u)}function Or(u,D,t=process.argv.slice(2)){if(!u)throw new Error("Options is required");if("name"in u&&(!u.name||!Wu.test(u.name)))throw new Error(`Invalid script name: ${_(u.name)}`);const e=t[0];if(u.commands&&Wu.test(e)){const r=Sr(e,u.commands);if(r)return me(r.options.name,{...r.options,parent:u},r.callback,t.slice(1))}return me(void 0,u,D,t)}function ge(u,D){if(!u)throw new Error("Command options are required");const{name:t}=u;if(u.name===void 0)throw new Error("Command name is required");if(!Wu.test(t))throw new Error(`Invalid command name ${JSON.stringify(t)}. Command names must be one word.`);return{options:u,callback:D}}var Be="1.2.7",Tr="Writes your git commit messages for you with AI",y=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function j(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var q={exports:{}},zu,be;function Ir(){if(be)return zu;be=1,zu=e,e.sync=r;var u=ku;function D(o,n){var s=n.pathExt!==void 0?n.pathExt:process.env.PATHEXT;if(!s||(s=s.split(";"),s.indexOf("")!==-1))return!0;for(var i=0;i<s.length;i++){var l=s[i].toLowerCase();if(l&&o.substr(-l.length).toLowerCase()===l)return!0}return!1}function t(o,n,s){return!o.isSymbolicLink()&&!o.isFile()?!1:D(n,s)}function e(o,n,s){u.stat(o,function(i,l){s(i,i?!1:t(l,o,n))})}function r(o,n){return t(u.statSync(o),o,n)}return zu}var Ku,Ae;function Pr(){if(Ae)return Ku;Ae=1,Ku=D,D.sync=t;var u=ku;function D(o,n,s){u.stat(o,function(i,l){s(i,i?!1:e(l,n))})}function t(o,n){return e(u.statSync(o),n)}function e(o,n){return o.isFile()&&r(o,n)}function r(o,n){var s=o.mode,i=o.uid,l=o.gid,F=n.uid!==void 0?n.uid:process.getuid&&process.getuid(),a=n.gid!==void 0?n.gid:process.getgid&&process.getgid(),c=parseInt("100",8),C=parseInt("010",8),f=parseInt("001",8),d=c|C,p=s&f||s&C&&l===a||s&c&&i===F||s&d&&F===0;return p}return Ku}var gu;process.platform==="win32"||y.TESTING_WINDOWS?gu=Ir():gu=Pr();var _r=Yu;Yu.sync=Rr;function Yu(u,D,t){if(typeof D=="function"&&(t=D,D={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(e,r){Yu(u,D||{},function(o,n){o?r(o):e(n)})})}gu(u,D||{},function(e,r){e&&(e.code==="EACCES"||D&&D.ignoreErrors)&&(e=null,r=!1),t(e,r)})}function Rr(u,D){try{return gu.sync(u,D||{})}catch(t){if(D&&D.ignoreErrors||t.code==="EACCES")return!1;throw t}}const z=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",ye=H,kr=z?";":":",we=_r,$e=u=>Object.assign(new Error(`not found: ${u}`),{code:"ENOENT"}),ve=(u,D)=>{const t=D.colon||kr,e=u.match(/\//)||z&&u.match(/\\/)?[""]:[...z?[process.cwd()]:[],...(D.path||process.env.PATH||"").split(t)],r=z?D.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=z?r.split(t):[""];return z&&u.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:e,pathExt:o,pathExtExe:r}},xe=(u,D,t)=>{typeof D=="function"&&(t=D,D={}),D||(D={});const{pathEnv:e,pathExt:r,pathExtExe:o}=ve(u,D),n=[],s=l=>new Promise((F,a)=>{if(l===e.length)return D.all&&n.length?F(n):a($e(u));const c=e[l],C=/^".*"$/.test(c)?c.slice(1,-1):c,f=ye.join(C,u),d=!C&&/^\.[\\\/]/.test(u)?u.slice(0,2)+f:f;F(i(d,l,0))}),i=(l,F,a)=>new Promise((c,C)=>{if(a===r.length)return c(s(F+1));const f=r[a];we(l+f,{pathExt:o},(d,p)=>{if(!d&&p)if(D.all)n.push(l+f);else return c(l+f);return c(i(l,F,a+1))})});return t?s(0).then(l=>t(null,l),t):s(0)},Mr=(u,D)=>{D=D||{};const{pathEnv:t,pathExt:e,pathExtExe:r}=ve(u,D),o=[];for(let n=0;n<t.length;n++){const s=t[n],i=/^".*"$/.test(s)?s.slice(1,-1):s,l=ye.join(i,u),F=!i&&/^\.[\\\/]/.test(u)?u.slice(0,2)+l:l;for(let a=0;a<e.length;a++){const c=F+e[a];try{if(we.sync(c,{pathExt:r}))if(D.all)o.push(c);else return c}catch{}}}if(D.all&&o.length)return o;if(D.nothrow)return null;throw $e(u)};var jr=xe;xe.sync=Mr;var Vu={exports:{}};const Se=(u={})=>{const D=u.env||process.env;return(u.platform||process.platform)!=="win32"?"PATH":Object.keys(D).reverse().find(e=>e.toUpperCase()==="PATH")||"Path"};Vu.exports=Se,Vu.exports.default=Se;var Nr=Vu.exports;const Oe=H,Lr=jr,Gr=Nr;function Te(u,D){const t=u.options.env||process.env,e=process.cwd(),r=u.options.cwd!=null,o=r&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(u.options.cwd)}catch{}let n;try{n=Lr.sync(u.command,{path:t[Gr({env:t})],pathExt:D?Oe.delimiter:void 0})}catch{}finally{o&&process.chdir(e)}return n&&(n=Oe.resolve(r?u.options.cwd:"",n)),n}function Ur(u){return Te(u)||Te(u,!0)}var Wr=Ur,Ju={};const Zu=/([()\][%!^"`<>&|;, *?])/g;function Hr(u){return u=u.replace(Zu,"^$1"),u}function qr(u,D){return u=`${u}`,u=u.replace(/(\\*)"/g,'$1$1\\"'),u=u.replace(/(\\*)$/,"$1$1"),u=`"${u}"`,u=u.replace(Zu,"^$1"),D&&(u=u.replace(Zu,"^$1")),u}Ju.command=Hr,Ju.argument=qr;var zr=/^#!(.*)/;const Kr=zr;var Yr=(u="")=>{const D=u.match(Kr);if(!D)return null;const[t,e]=D[0].replace(/#! ?/,"").split(" "),r=t.split("/").pop();return r==="env"?e:e?`${r} ${e}`:r};const Xu=ku,Vr=Yr;function Jr(u){const t=Buffer.alloc(150);let e;try{e=Xu.openSync(u,"r"),Xu.readSync(e,t,0,150,0),Xu.closeSync(e)}catch{}return Vr(t.toString())}var Zr=Jr;const Xr=H,Ie=Wr,Pe=Ju,Qr=Zr,uo=process.platform==="win32",Do=/\.(?:com|exe)$/i,eo=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function to(u){u.file=Ie(u);const D=u.file&&Qr(u.file);return D?(u.args.unshift(u.file),u.command=D,Ie(u)):u.file}function no(u){if(!uo)return u;const D=to(u),t=!Do.test(D);if(u.options.forceShell||t){const e=eo.test(D);u.command=Xr.normalize(u.command),u.command=Pe.command(u.command),u.args=u.args.map(o=>Pe.argument(o,e));const r=[u.command].concat(u.args).join(" ");u.args=["/d","/s","/c",`"${r}"`],u.command=process.env.comspec||"cmd.exe",u.options.windowsVerbatimArguments=!0}return u}function ro(u,D,t){D&&!Array.isArray(D)&&(t=D,D=null),D=D?D.slice(0):[],t=Object.assign({},t);const e={command:u,args:D,options:t,file:void 0,original:{command:u,args:D}};return t.shell?e:no(e)}var oo=ro;const Qu=process.platform==="win32";function uD(u,D){return Object.assign(new Error(`${D} ${u.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${D} ${u.command}`,path:u.command,spawnargs:u.args})}function so(u,D){if(!Qu)return;const t=u.emit;u.emit=function(e,r){if(e==="exit"){const o=_e(r,D);if(o)return t.call(u,"error",o)}return t.apply(u,arguments)}}function _e(u,D){return Qu&&u===1&&!D.file?uD(D.original,"spawn"):null}function io(u,D){return Qu&&u===1&&!D.file?uD(D.original,"spawnSync"):null}var ao={hookChildProcess:so,verifyENOENT:_e,verifyENOENTSync:io,notFoundError:uD};const Re=Zt,DD=oo,eD=ao;function ke(u,D,t){const e=DD(u,D,t),r=Re.spawn(e.command,e.args,e.options);return eD.hookChildProcess(r,e),r}function co(u,D,t){const e=DD(u,D,t),r=Re.spawnSync(e.command,e.args,e.options);return r.error=r.error||eD.verifyENOENTSync(r.status,e),r}q.exports=ke,q.exports.spawn=ke,q.exports.sync=co,q.exports._parse=DD,q.exports._enoent=eD;var lo=q.exports,Fo=j(lo);function Co(u){const D=typeof u=="string"?`
22
+ `),e(),process.exit(1);u[i]=l}}function xr(u){return u===void 0||u!==!1}function me(u,D,t,e){const r={...D.flags},o=D.version;o&&(r.version={type:Boolean,description:"Show version"});const{help:n}=D,s=xr(n);s&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const i=On(r,e,{ignore:D.ignoreArgv}),l=()=>{console.log(D.version)};if(o&&i.flags.version===!0)return l(),process.exit(0);const F=new $r,a=s&&n?.render?n.render:f=>F.render(f),c=f=>{const d=yr({...D,...f?{help:f}:{},flags:r});console.log(a(d,F))};if(s&&i.flags.help===!0)return c(),process.exit(0);if(D.parameters){let{parameters:f}=D,d=i._;const p=f.indexOf("--"),h=f.slice(p+1),w=Object.create(null);if(p>-1&&h.length>0){f=f.slice(0,p);const P=i._["--"];d=d.slice(0,-P.length||void 0),qu(w,Hu(f),d,c),qu(w,Hu(h),P,c)}else qu(w,Hu(f),d,c);Object.assign(i._,w)}const C={...i,showVersion:l,showHelp:c};return typeof t=="function"&&t(C),{command:u,...C}}function Sr(u,D){const t=new Map;for(const e of D){const r=[e.options.name],{alias:o}=e.options;o&&(Array.isArray(o)?r.push(...o):r.push(o));for(const n of r){if(t.has(n))throw new Error(`Duplicate command name found: ${_(n)}`);t.set(n,e)}}return t.get(u)}function Or(u,D,t=process.argv.slice(2)){if(!u)throw new Error("Options is required");if("name"in u&&(!u.name||!Wu.test(u.name)))throw new Error(`Invalid script name: ${_(u.name)}`);const e=t[0];if(u.commands&&Wu.test(e)){const r=Sr(e,u.commands);if(r)return me(r.options.name,{...r.options,parent:u},r.callback,t.slice(1))}return me(void 0,u,D,t)}function ge(u,D){if(!u)throw new Error("Command options are required");const{name:t}=u;if(u.name===void 0)throw new Error("Command name is required");if(!Wu.test(t))throw new Error(`Invalid command name ${JSON.stringify(t)}. Command names must be one word.`);return{options:u,callback:D}}var Be="1.2.8",Tr="Writes your git commit messages for you with AI",y=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function j(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var q={exports:{}},zu,be;function Ir(){if(be)return zu;be=1,zu=e,e.sync=r;var u=ku;function D(o,n){var s=n.pathExt!==void 0?n.pathExt:process.env.PATHEXT;if(!s||(s=s.split(";"),s.indexOf("")!==-1))return!0;for(var i=0;i<s.length;i++){var l=s[i].toLowerCase();if(l&&o.substr(-l.length).toLowerCase()===l)return!0}return!1}function t(o,n,s){return!o.isSymbolicLink()&&!o.isFile()?!1:D(n,s)}function e(o,n,s){u.stat(o,function(i,l){s(i,i?!1:t(l,o,n))})}function r(o,n){return t(u.statSync(o),o,n)}return zu}var Ku,Ae;function Pr(){if(Ae)return Ku;Ae=1,Ku=D,D.sync=t;var u=ku;function D(o,n,s){u.stat(o,function(i,l){s(i,i?!1:e(l,n))})}function t(o,n){return e(u.statSync(o),n)}function e(o,n){return o.isFile()&&r(o,n)}function r(o,n){var s=o.mode,i=o.uid,l=o.gid,F=n.uid!==void 0?n.uid:process.getuid&&process.getuid(),a=n.gid!==void 0?n.gid:process.getgid&&process.getgid(),c=parseInt("100",8),C=parseInt("010",8),f=parseInt("001",8),d=c|C,p=s&f||s&C&&l===a||s&c&&i===F||s&d&&F===0;return p}return Ku}var gu;process.platform==="win32"||y.TESTING_WINDOWS?gu=Ir():gu=Pr();var _r=Yu;Yu.sync=Rr;function Yu(u,D,t){if(typeof D=="function"&&(t=D,D={}),!t){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(e,r){Yu(u,D||{},function(o,n){o?r(o):e(n)})})}gu(u,D||{},function(e,r){e&&(e.code==="EACCES"||D&&D.ignoreErrors)&&(e=null,r=!1),t(e,r)})}function Rr(u,D){try{return gu.sync(u,D||{})}catch(t){if(D&&D.ignoreErrors||t.code==="EACCES")return!1;throw t}}const z=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",ye=H,kr=z?";":":",we=_r,$e=u=>Object.assign(new Error(`not found: ${u}`),{code:"ENOENT"}),ve=(u,D)=>{const t=D.colon||kr,e=u.match(/\//)||z&&u.match(/\\/)?[""]:[...z?[process.cwd()]:[],...(D.path||process.env.PATH||"").split(t)],r=z?D.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=z?r.split(t):[""];return z&&u.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:e,pathExt:o,pathExtExe:r}},xe=(u,D,t)=>{typeof D=="function"&&(t=D,D={}),D||(D={});const{pathEnv:e,pathExt:r,pathExtExe:o}=ve(u,D),n=[],s=l=>new Promise((F,a)=>{if(l===e.length)return D.all&&n.length?F(n):a($e(u));const c=e[l],C=/^".*"$/.test(c)?c.slice(1,-1):c,f=ye.join(C,u),d=!C&&/^\.[\\\/]/.test(u)?u.slice(0,2)+f:f;F(i(d,l,0))}),i=(l,F,a)=>new Promise((c,C)=>{if(a===r.length)return c(s(F+1));const f=r[a];we(l+f,{pathExt:o},(d,p)=>{if(!d&&p)if(D.all)n.push(l+f);else return c(l+f);return c(i(l,F,a+1))})});return t?s(0).then(l=>t(null,l),t):s(0)},Mr=(u,D)=>{D=D||{};const{pathEnv:t,pathExt:e,pathExtExe:r}=ve(u,D),o=[];for(let n=0;n<t.length;n++){const s=t[n],i=/^".*"$/.test(s)?s.slice(1,-1):s,l=ye.join(i,u),F=!i&&/^\.[\\\/]/.test(u)?u.slice(0,2)+l:l;for(let a=0;a<e.length;a++){const c=F+e[a];try{if(we.sync(c,{pathExt:r}))if(D.all)o.push(c);else return c}catch{}}}if(D.all&&o.length)return o;if(D.nothrow)return null;throw $e(u)};var jr=xe;xe.sync=Mr;var Vu={exports:{}};const Se=(u={})=>{const D=u.env||process.env;return(u.platform||process.platform)!=="win32"?"PATH":Object.keys(D).reverse().find(e=>e.toUpperCase()==="PATH")||"Path"};Vu.exports=Se,Vu.exports.default=Se;var Nr=Vu.exports;const Oe=H,Lr=jr,Gr=Nr;function Te(u,D){const t=u.options.env||process.env,e=process.cwd(),r=u.options.cwd!=null,o=r&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(u.options.cwd)}catch{}let n;try{n=Lr.sync(u.command,{path:t[Gr({env:t})],pathExt:D?Oe.delimiter:void 0})}catch{}finally{o&&process.chdir(e)}return n&&(n=Oe.resolve(r?u.options.cwd:"",n)),n}function Ur(u){return Te(u)||Te(u,!0)}var Wr=Ur,Ju={};const Zu=/([()\][%!^"`<>&|;, *?])/g;function Hr(u){return u=u.replace(Zu,"^$1"),u}function qr(u,D){return u=`${u}`,u=u.replace(/(\\*)"/g,'$1$1\\"'),u=u.replace(/(\\*)$/,"$1$1"),u=`"${u}"`,u=u.replace(Zu,"^$1"),D&&(u=u.replace(Zu,"^$1")),u}Ju.command=Hr,Ju.argument=qr;var zr=/^#!(.*)/;const Kr=zr;var Yr=(u="")=>{const D=u.match(Kr);if(!D)return null;const[t,e]=D[0].replace(/#! ?/,"").split(" "),r=t.split("/").pop();return r==="env"?e:e?`${r} ${e}`:r};const Xu=ku,Vr=Yr;function Jr(u){const t=Buffer.alloc(150);let e;try{e=Xu.openSync(u,"r"),Xu.readSync(e,t,0,150,0),Xu.closeSync(e)}catch{}return Vr(t.toString())}var Zr=Jr;const Xr=H,Ie=Wr,Pe=Ju,Qr=Zr,uo=process.platform==="win32",Do=/\.(?:com|exe)$/i,eo=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function to(u){u.file=Ie(u);const D=u.file&&Qr(u.file);return D?(u.args.unshift(u.file),u.command=D,Ie(u)):u.file}function no(u){if(!uo)return u;const D=to(u),t=!Do.test(D);if(u.options.forceShell||t){const e=eo.test(D);u.command=Xr.normalize(u.command),u.command=Pe.command(u.command),u.args=u.args.map(o=>Pe.argument(o,e));const r=[u.command].concat(u.args).join(" ");u.args=["/d","/s","/c",`"${r}"`],u.command=process.env.comspec||"cmd.exe",u.options.windowsVerbatimArguments=!0}return u}function ro(u,D,t){D&&!Array.isArray(D)&&(t=D,D=null),D=D?D.slice(0):[],t=Object.assign({},t);const e={command:u,args:D,options:t,file:void 0,original:{command:u,args:D}};return t.shell?e:no(e)}var oo=ro;const Qu=process.platform==="win32";function uD(u,D){return Object.assign(new Error(`${D} ${u.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${D} ${u.command}`,path:u.command,spawnargs:u.args})}function so(u,D){if(!Qu)return;const t=u.emit;u.emit=function(e,r){if(e==="exit"){const o=_e(r,D);if(o)return t.call(u,"error",o)}return t.apply(u,arguments)}}function _e(u,D){return Qu&&u===1&&!D.file?uD(D.original,"spawn"):null}function io(u,D){return Qu&&u===1&&!D.file?uD(D.original,"spawnSync"):null}var ao={hookChildProcess:so,verifyENOENT:_e,verifyENOENTSync:io,notFoundError:uD};const Re=Zt,DD=oo,eD=ao;function ke(u,D,t){const e=DD(u,D,t),r=Re.spawn(e.command,e.args,e.options);return eD.hookChildProcess(r,e),r}function co(u,D,t){const e=DD(u,D,t),r=Re.spawnSync(e.command,e.args,e.options);return r.error=r.error||eD.verifyENOENTSync(r.status,e),r}q.exports=ke,q.exports.spawn=ke,q.exports.sync=co,q.exports._parse=DD,q.exports._enoent=eD;var lo=q.exports,Fo=j(lo);function Co(u){const D=typeof u=="string"?`
23
23
  `:`
24
24
  `.charCodeAt(),t=typeof u=="string"?"\r":"\r".charCodeAt();return u[u.length-1]===D&&(u=u.slice(0,-1)),u[u.length-1]===t&&(u=u.slice(0,-1)),u}function Me(u={}){const{env:D=process.env,platform:t=process.platform}=u;return t!=="win32"?"PATH":Object.keys(D).reverse().find(e=>e.toUpperCase()==="PATH")||"Path"}function fo(u={}){const{cwd:D=A.cwd(),path:t=A.env[Me()],execPath:e=A.execPath}=u;let r;const o=D instanceof URL?Xt.fileURLToPath(D):D;let n=W.resolve(o);const s=[];for(;r!==n;)s.push(W.join(n,"node_modules/.bin")),r=n,n=W.resolve(n,"..");return s.push(W.resolve(o,e,"..")),[...s,t].join(W.delimiter)}function Eo({env:u=A.env,...D}={}){u={...u};const t=Me({env:u});return D.path=u[t],u[t]=fo(D),u}const po=(u,D,t,e)=>{if(t==="length"||t==="prototype"||t==="arguments"||t==="caller")return;const r=Object.getOwnPropertyDescriptor(u,t),o=Object.getOwnPropertyDescriptor(D,t);!ho(r,o)&&e||Object.defineProperty(u,t,o)},ho=function(u,D){return u===void 0||u.configurable||u.writable===D.writable&&u.enumerable===D.enumerable&&u.configurable===D.configurable&&(u.writable||u.value===D.value)},mo=(u,D)=>{const t=Object.getPrototypeOf(D);t!==Object.getPrototypeOf(u)&&Object.setPrototypeOf(u,t)},go=(u,D)=>`/* Wrapped ${u}*/
25
25
  ${D}`,Bo=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),bo=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Ao=(u,D,t)=>{const e=t===""?"":`with ${t.trim()}() `,r=go.bind(null,e,D.toString());Object.defineProperty(r,"name",bo),Object.defineProperty(u,"toString",{...Bo,value:r})};function yo(u,D,{ignoreNonConfigurable:t=!1}={}){const{name:e}=u;for(const r of Reflect.ownKeys(D))po(u,D,r,t);return mo(u,D),Ao(u,D,e),u}const Bu=new WeakMap,je=(u,D={})=>{if(typeof u!="function")throw new TypeError("Expected a function");let t,e=0;const r=u.displayName||u.name||"<anonymous>",o=function(...n){if(Bu.set(o,++e),e===1)t=u.apply(this,n),u=null;else if(D.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return t};return yo(o,u),Bu.set(o,e),o};je.callCount=u=>{if(!Bu.has(u))throw new Error(`The given function \`${u.name}\` is not wrapped by the \`onetime\` package`);return Bu.get(u)};const wo=()=>{const u=Le-Ne+1;return Array.from({length:u},$o)},$o=(u,D)=>({name:`SIGRT${D+1}`,number:Ne+D,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),Ne=34,Le=64,vo=[{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"}],Ge=()=>{const u=wo();return[...vo,...u].map(xo)},xo=({name:u,number:D,description:t,action:e,forced:r=!1,standard:o})=>{const{signals:{[u]:n}}=YD,s=n!==void 0;return{name:u,number:s?n:D,description:t,supported:s,action:e,forced:r,standard:o}},So=()=>{const u=Ge();return Object.fromEntries(u.map(Oo))},Oo=({name:u,number:D,description:t,supported:e,action:r,forced:o,standard:n})=>[u,{name:u,number:D,description:t,supported:e,action:r,forced:o,standard:n}],To=So(),Io=()=>{const u=Ge(),D=Le+1,t=Array.from({length:D},(e,r)=>Po(r,u));return Object.assign({},...t)},Po=(u,D)=>{const t=_o(u,D);if(t===void 0)return{};const{name:e,description:r,supported:o,action:n,forced:s,standard:i}=t;return{[u]:{name:e,number:u,description:r,supported:o,action:n,forced:s,standard:i}}},_o=(u,D)=>{const t=D.find(({name:e})=>YD.signals[e]===u);return t!==void 0?t:D.find(e=>e.number===u)};Io();const Ro=({timedOut:u,timeout:D,errorCode:t,signal:e,signalDescription:r,exitCode:o,isCanceled:n})=>u?`timed out after ${D} milliseconds`:n?"was canceled":t!==void 0?`failed with ${t}`:e!==void 0?`was killed with ${e} (${r})`:o!==void 0?`failed with exit code ${o}`:"failed",Ue=({stdout:u,stderr:D,all:t,error:e,signal:r,exitCode:o,command:n,escapedCommand:s,timedOut:i,isCanceled:l,killed:F,parsed:{options:{timeout:a,cwd:c=A.cwd()}}})=>{o=o===null?void 0:o,r=r===null?void 0:r;const C=r===void 0?void 0:To[r].description,f=e&&e.code,p=`Command ${Ro({timedOut:i,timeout:a,errorCode:f,signal:r,signalDescription:C,exitCode:o,isCanceled:l})}: ${n}`,h=Object.prototype.toString.call(e)==="[object Error]",w=h?`${p}
@@ -55,14 +55,14 @@ ${E.gray(BD)} ${u}
55
55
 
56
56
  `)},yD=()=>{const u=gD?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],D=gD?80:120;let t,e,r=!1,o="";const n=(F="")=>{r=!0,t=ti(),o=F.replace(/\.+$/,""),process.stdout.write(`${E.gray(I)}
57
57
  `);let a=0,c=0;e=setInterval(()=>{const C=E.magenta(u[a]),f=".".repeat(Math.floor(c)).slice(0,3);process.stdout.write(v.cursor.move(-999,0)),process.stdout.write(v.erase.down(1)),process.stdout.write(`${C} ${o}${f}`),a=a+1<u.length?a+1:0,c=c<u.length?c+.125:0},D)},s=(F="",a=0)=>{o=F??o,r=!1,clearInterval(e);const c=a===0?E.green(ht):a===1?E.red(dt):E.red(pt);process.stdout.write(v.cursor.move(-999,0)),process.stdout.write(v.erase.down(1)),process.stdout.write(`${c} ${o}
58
- `),t()},i=(F="")=>{o=F??o},l=F=>{const a=F>1?"Something went wrong":"Canceled";r&&s(a,F)};return process.on("uncaughtExceptionMonitor",()=>l(2)),process.on("unhandledRejection",()=>l(2)),process.on("SIGINT",()=>l(1)),process.on("SIGTERM",()=>l(1)),process.on("exit",l),{start:n,stop:s,message:i}};class S extends Error{}const wD=" ",Su=u=>{u instanceof Error&&!(u instanceof S)&&(u.stack&&console.error(lD(u.stack.split(`
58
+ `),t()},i=(F="")=>{o=F??o},l=F=>{const a=F>1?"Something went wrong":"Canceled";r&&s(a,F)};return process.on("uncaughtExceptionMonitor",()=>l(2)),process.on("unhandledRejection",()=>l(2)),process.on("SIGINT",()=>l(1)),process.on("SIGTERM",()=>l(1)),process.on("exit",l),{start:n,stop:s,message:i}};class O extends Error{}const wD=" ",Su=u=>{u instanceof Error&&!(u instanceof O)&&(u.stack&&console.error(lD(u.stack.split(`
59
59
  `).slice(1).join(`
60
60
  `))),console.error(`
61
61
  ${wD}${lD(`aicommit v${Be}`)}`),console.error(`
62
- ${wD}Please open a Bug report with the information above:`),console.error(`${wD}https://github.com/NegoZiatoR/ai-commit/issues/new/choose`))},Bt=async()=>{const{stdout:u,failed:D}=await V("git",["rev-parse","--show-toplevel"],{reject:!1});if(D)throw new S("The current directory must be a Git repository!");return u},$D=u=>`:(exclude)${u}`,bt=["package-lock.json","*.lock"].map($D),At=async u=>{const D=["diff","--cached","--diff-algorithm=minimal"],{stdout:t}=await V("git",[...D,"--name-only",...bt,...u?u.map($D):[]]);if(!t)return;const{stdout:e}=await V("git",[...D,...bt,...u?u.map($D):[]]);return{files:t.split(`
62
+ ${wD}Please open a Bug report with the information above:`),console.error(`${wD}https://github.com/NegoZiatoR/ai-commit/issues/new/choose`))},Bt=async()=>{const{stdout:u,failed:D}=await V("git",["rev-parse","--show-toplevel"],{reject:!1});if(D)throw new O("The current directory must be a Git repository!");return u},$D=u=>`:(exclude)${u}`,bt=["package-lock.json","*.lock"].map($D),At=async u=>{const D=["diff","--cached","--diff-algorithm=minimal"],{stdout:t}=await V("git",[...D,"--name-only",...bt,...u?u.map($D):[]]);if(!t)return;const{stdout:e}=await V("git",[...D,...bt,...u?u.map($D):[]]);return{files:t.split(`
63
63
  `),diff:e}},ai=u=>`Detected ${u.length.toLocaleString()} staged file${u.length>1?"s":""}`,{hasOwnProperty:vD}=Object.prototype,Ou=typeof process<"u"&&process.platform==="win32"?`\r
64
64
  `:`
65
- `,xD=(u,D)=>{const t=[];let e="";typeof D=="string"?D={section:D,whitespace:!1}:(D=D||Object.create(null),D.whitespace=D.whitespace===!0);const r=D.whitespace?" = ":"=";for(const o of Object.keys(u)){const n=u[o];if(n&&Array.isArray(n))for(const s of n)e+=Z(o+"[]")+r+Z(s)+Ou;else n&&typeof n=="object"?t.push(o):e+=Z(o)+r+Z(n)+Ou}D.section&&e.length&&(e="["+Z(D.section)+"]"+Ou+e);for(const o of t){const n=yt(o).join("\\."),s=(D.section?D.section+".":"")+n,{whitespace:i}=D,l=xD(u[o],{section:s,whitespace:i});e.length&&l.length&&(e+=Ou),e+=l}return e},yt=u=>u.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(D=>D.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")),wt=u=>{const D=Object.create(null);let t=D,e=null;const r=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=u.split(/[\r\n]+/g);for(const s of o){if(!s||s.match(/^\s*[;#]/))continue;const i=s.match(r);if(!i)continue;if(i[1]!==void 0){if(e=Tu(i[1]),e==="__proto__"){t=Object.create(null);continue}t=D[e]=D[e]||Object.create(null);continue}const l=Tu(i[2]),F=l.length>2&&l.slice(-2)==="[]",a=F?l.slice(0,-2):l;if(a==="__proto__")continue;const c=i[3]?Tu(i[4]):!0,C=c==="true"||c==="false"||c==="null"?JSON.parse(c):c;F&&(vD.call(t,a)?Array.isArray(t[a])||(t[a]=[t[a]]):t[a]=[]),Array.isArray(t[a])?t[a].push(C):t[a]=C}const n=[];for(const s of Object.keys(D)){if(!vD.call(D,s)||typeof D[s]!="object"||Array.isArray(D[s]))continue;const i=yt(s);t=D;const l=i.pop(),F=l.replace(/\\\./g,".");for(const a of i)a!=="__proto__"&&((!vD.call(t,a)||typeof t[a]!="object")&&(t[a]=Object.create(null)),t=t[a]);t===D&&F===l||(t[F]=D[s],n.push(s))}for(const s of n)delete D[s];return D},$t=u=>u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'"),Z=u=>typeof u!="string"||u.match(/[=\r\n]/)||u.match(/^\[/)||u.length>1&&$t(u)||u!==u.trim()?JSON.stringify(u):u.split(";").join("\\;").split("#").join("\\#"),Tu=(u,D)=>{if(u=(u||"").trim(),$t(u)){u.charAt(0)==="'"&&(u=u.slice(1,-1));try{u=JSON.parse(u)}catch{}}else{let t=!1,e="";for(let r=0,o=u.length;r<o;r++){const n=u.charAt(r);if(t)"\\;#".indexOf(n)!==-1?e+=n:e+="\\"+n,t=!1;else{if(";#".indexOf(n)!==-1)break;n==="\\"?t=!0:e+=n}}return t&&(e+="\\"),e.trim()}return u};var ci={parse:wt,decode:wt,stringify:xD,encode:xD,safe:Z,unsafe:Tu},vt=j(ci);const xt=u=>T.lstat(u).then(()=>!0,()=>!1),li=["","conventional"],{hasOwnProperty:Fi}=Object.prototype,St=(u,D)=>Fi.call(u,D),O=(u,D,t)=>{if(!D)throw new S(`Invalid config property ${u}: ${t}`)},Iu={OPENAI_KEY(u){if(!u)throw new S("Please set your OpenAI API key via `aicommit config set OPENAI_KEY=<your token>`");return O("OPENAI_KEY",u.startsWith("sk-"),'Must start with "sk-"'),u},locale(u){return u?(O("locale",u,"Cannot be empty"),O("locale",/^[a-z-]+$/i.test(u),"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"),u):"en"},generate(u){if(!u)return 1;O("generate",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return O("generate",D>0,"Must be greater than 0"),O("generate",D<=5,"Must be less or equal to 5"),D},type(u){return u?(O("type",li.includes(u),"Invalid commit type"),u):""},proxy(u){if(!(!u||u.length===0))return O("proxy",/^https?:\/\//.test(u),"Must be a valid URL"),u},model(u){return!u||u.length===0?"gpt-3.5-turbo":u},timeout(u){if(!u)return 1e4;O("timeout",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return O("timeout",D>=500,"Must be greater than 500ms"),D},"max-length"(u){if(!u)return 50;O("max-length",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return O("max-length",D>=20,"Must be greater than 20 characters"),D},"auto-confirm"(u){return u?typeof u=="boolean"?u:(O("auto-confirm",/^(?:true|false)$/.test(u),"Must be a boolean"),u==="true"):!1},"prepend-reference"(u){return u?typeof u=="boolean"?u:(O("prepend-reference",/^(?:true|false)$/.test(u),"Must be a boolean"),u==="true"):!1}},SD=H.join(QD.homedir(),".aicommit"),Ot=async()=>{if(!await xt(SD))return Object.create(null);const D=await T.readFile(SD,"utf8");return vt.parse(D)},OD=async(u,D)=>{const t=await Ot(),e={};for(const r of Object.keys(Iu)){const o=Iu[r],n=u?.[r]??t[r];if(D)try{e[r]=o(n)}catch{}else e[r]=o(n)}return e},Ci=async u=>{const D=await Ot();for(const[t,e]of u){if(!St(Iu,t))throw new S(`Invalid config property: ${t}`);const r=Iu[t](e);D[t]=r}await T.writeFile(SD,vt.stringify(D),"utf8")};var TD={},ID={exports:{}},iu={exports:{}},PD,Tt;function fi(){if(Tt)return PD;Tt=1;var u=1e3,D=u*60,t=D*60,e=t*24,r=e*7,o=e*365.25;PD=function(F,a){a=a||{};var c=typeof F;if(c==="string"&&F.length>0)return n(F);if(c==="number"&&isFinite(F))return a.long?i(F):s(F);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(F))};function n(F){if(F=String(F),!(F.length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(F);if(a){var c=parseFloat(a[1]),C=(a[2]||"ms").toLowerCase();switch(C){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*r;case"days":case"day":case"d":return c*e;case"hours":case"hour":case"hrs":case"hr":case"h":return c*t;case"minutes":case"minute":case"mins":case"min":case"m":return c*D;case"seconds":case"second":case"secs":case"sec":case"s":return c*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}function s(F){var a=Math.abs(F);return a>=e?Math.round(F/e)+"d":a>=t?Math.round(F/t)+"h":a>=D?Math.round(F/D)+"m":a>=u?Math.round(F/u)+"s":F+"ms"}function i(F){var a=Math.abs(F);return a>=e?l(F,a,e,"day"):a>=t?l(F,a,t,"hour"):a>=D?l(F,a,D,"minute"):a>=u?l(F,a,u,"second"):F+" ms"}function l(F,a,c,C){var f=a>=c*1.5;return Math.round(F/c)+" "+C+(f?"s":"")}return PD}var _D,It;function Pt(){if(It)return _D;It=1;function u(D){e.debug=e,e.default=e,e.coerce=l,e.disable=n,e.enable=o,e.enabled=s,e.humanize=fi(),e.destroy=F,Object.keys(D).forEach(a=>{e[a]=D[a]}),e.names=[],e.skips=[],e.formatters={};function t(a){let c=0;for(let C=0;C<a.length;C++)c=(c<<5)-c+a.charCodeAt(C),c|=0;return e.colors[Math.abs(c)%e.colors.length]}e.selectColor=t;function e(a){let c,C=null,f,d;function p(...h){if(!p.enabled)return;const w=p,P=Number(new Date),Cu=P-(c||P);w.diff=Cu,w.prev=c,w.curr=P,c=P,h[0]=e.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let k=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(U,Kt)=>{if(U==="%%")return"%";k++;const HD=e.formatters[Kt];if(typeof HD=="function"){const Yt=h[k];U=HD.call(w,Yt),h.splice(k,1),k--}return U}),e.formatArgs.call(w,h),(w.log||e.log).apply(w,h)}return p.namespace=a,p.useColors=e.useColors(),p.color=e.selectColor(a),p.extend=r,p.destroy=e.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>C!==null?C:(f!==e.namespaces&&(f=e.namespaces,d=e.enabled(a)),d),set:h=>{C=h}}),typeof e.init=="function"&&e.init(p),p}function r(a,c){const C=e(this.namespace+(typeof c>"u"?":":c)+a);return C.log=this.log,C}function o(a){e.save(a),e.namespaces=a,e.names=[],e.skips=[];let c;const C=(typeof a=="string"?a:"").split(/[\s,]+/),f=C.length;for(c=0;c<f;c++)C[c]&&(a=C[c].replace(/\*/g,".*?"),a[0]==="-"?e.skips.push(new RegExp("^"+a.slice(1)+"$")):e.names.push(new RegExp("^"+a+"$")))}function n(){const a=[...e.names.map(i),...e.skips.map(i).map(c=>"-"+c)].join(",");return e.enable(""),a}function s(a){if(a[a.length-1]==="*")return!0;let c,C;for(c=0,C=e.skips.length;c<C;c++)if(e.skips[c].test(a))return!1;for(c=0,C=e.names.length;c<C;c++)if(e.names[c].test(a))return!0;return!1}function i(a){return a.toString().substring(2,a.toString().length-2).replace(/\.\*\?$/,"*")}function l(a){return a instanceof Error?a.stack||a.message:a}function F(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return e.enable(e.load()),e}return _D=u,_D}iu.exports;var _t;function Ei(){return _t||(_t=1,function(u,D){D.formatArgs=e,D.save=r,D.load=o,D.useColors=t,D.storage=n(),D.destroy=(()=>{let i=!1;return()=>{i||(i=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),D.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function e(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+u.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;i.splice(1,0,l,"color: inherit");let F=0,a=0;i[0].replace(/%[a-zA-Z%]/g,c=>{c!=="%%"&&(F++,c==="%c"&&(a=F))}),i.splice(a,0,l)}D.log=console.debug||console.log||(()=>{});function r(i){try{i?D.storage.setItem("debug",i):D.storage.removeItem("debug")}catch{}}function o(){let i;try{i=D.storage.getItem("debug")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function n(){try{return localStorage}catch{}}u.exports=Pt()(D);const{formatters:s}=u.exports;s.j=function(i){try{return JSON.stringify(i)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}}(iu,iu.exports)),iu.exports}var au={exports:{}},RD,Rt;function di(){return Rt||(Rt=1,RD=(u,D=process.argv)=>{const t=u.startsWith("-")?"":u.length===1?"-":"--",e=D.indexOf(t+u),r=D.indexOf("--");return e!==-1&&(r===-1||e<r)}),RD}var kD,kt;function pi(){if(kt)return kD;kt=1;const u=QD,D=fu,t=di(),{env:e}=process;let r;t("no-color")||t("no-colors")||t("color=false")||t("color=never")?r=0:(t("color")||t("colors")||t("color=true")||t("color=always"))&&(r=1),"FORCE_COLOR"in e&&(e.FORCE_COLOR==="true"?r=1:e.FORCE_COLOR==="false"?r=0:r=e.FORCE_COLOR.length===0?1:Math.min(parseInt(e.FORCE_COLOR,10),3));function o(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function n(i,l){if(r===0)return 0;if(t("color=16m")||t("color=full")||t("color=truecolor"))return 3;if(t("color=256"))return 2;if(i&&!l&&r===void 0)return 0;const F=r||0;if(e.TERM==="dumb")return F;if(process.platform==="win32"){const a=u.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in e)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(a=>a in e)||e.CI_NAME==="codeship"?1:F;if("TEAMCITY_VERSION"in e)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(e.TEAMCITY_VERSION)?1:0;if(e.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in e){const a=parseInt((e.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(e.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(e.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(e.TERM)||"COLORTERM"in e?1:F}function s(i){const l=n(i,i&&i.isTTY);return o(l)}return kD={supportsColor:s,stdout:o(n(!0,D.isatty(1))),stderr:o(n(!0,D.isatty(2)))},kD}au.exports;var Mt;function hi(){return Mt||(Mt=1,function(u,D){const t=fu,e=ZD;D.init=F,D.log=s,D.formatArgs=o,D.save=i,D.load=l,D.useColors=r,D.destroy=e.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),D.colors=[6,2,3,4,5,1];try{const c=pi();c&&(c.stderr||c).level>=2&&(D.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}D.inspectOpts=Object.keys(process.env).filter(c=>/^debug_/i.test(c)).reduce((c,C)=>{const f=C.substring(6).toLowerCase().replace(/_([a-z])/g,(p,h)=>h.toUpperCase());let d=process.env[C];return/^(yes|on|true|enabled)$/i.test(d)?d=!0:/^(no|off|false|disabled)$/i.test(d)?d=!1:d==="null"?d=null:d=Number(d),c[f]=d,c},{});function r(){return"colors"in D.inspectOpts?!!D.inspectOpts.colors:t.isatty(process.stderr.fd)}function o(c){const{namespace:C,useColors:f}=this;if(f){const d=this.color,p="\x1B[3"+(d<8?d:"8;5;"+d),h=` ${p};1m${C} \x1B[0m`;c[0]=h+c[0].split(`
65
+ `,xD=(u,D)=>{const t=[];let e="";typeof D=="string"?D={section:D,whitespace:!1}:(D=D||Object.create(null),D.whitespace=D.whitespace===!0);const r=D.whitespace?" = ":"=";for(const o of Object.keys(u)){const n=u[o];if(n&&Array.isArray(n))for(const s of n)e+=Z(o+"[]")+r+Z(s)+Ou;else n&&typeof n=="object"?t.push(o):e+=Z(o)+r+Z(n)+Ou}D.section&&e.length&&(e="["+Z(D.section)+"]"+Ou+e);for(const o of t){const n=yt(o).join("\\."),s=(D.section?D.section+".":"")+n,{whitespace:i}=D,l=xD(u[o],{section:s,whitespace:i});e.length&&l.length&&(e+=Ou),e+=l}return e},yt=u=>u.replace(/\1/g,"LITERAL\\1LITERAL").replace(/\\\./g,"").split(/\./).map(D=>D.replace(/\1/g,"\\.").replace(/\2LITERAL\\1LITERAL\2/g,"")),wt=u=>{const D=Object.create(null);let t=D,e=null;const r=/^\[([^\]]*)\]$|^([^=]+)(=(.*))?$/i,o=u.split(/[\r\n]+/g);for(const s of o){if(!s||s.match(/^\s*[;#]/))continue;const i=s.match(r);if(!i)continue;if(i[1]!==void 0){if(e=Tu(i[1]),e==="__proto__"){t=Object.create(null);continue}t=D[e]=D[e]||Object.create(null);continue}const l=Tu(i[2]),F=l.length>2&&l.slice(-2)==="[]",a=F?l.slice(0,-2):l;if(a==="__proto__")continue;const c=i[3]?Tu(i[4]):!0,C=c==="true"||c==="false"||c==="null"?JSON.parse(c):c;F&&(vD.call(t,a)?Array.isArray(t[a])||(t[a]=[t[a]]):t[a]=[]),Array.isArray(t[a])?t[a].push(C):t[a]=C}const n=[];for(const s of Object.keys(D)){if(!vD.call(D,s)||typeof D[s]!="object"||Array.isArray(D[s]))continue;const i=yt(s);t=D;const l=i.pop(),F=l.replace(/\\\./g,".");for(const a of i)a!=="__proto__"&&((!vD.call(t,a)||typeof t[a]!="object")&&(t[a]=Object.create(null)),t=t[a]);t===D&&F===l||(t[F]=D[s],n.push(s))}for(const s of n)delete D[s];return D},$t=u=>u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'"),Z=u=>typeof u!="string"||u.match(/[=\r\n]/)||u.match(/^\[/)||u.length>1&&$t(u)||u!==u.trim()?JSON.stringify(u):u.split(";").join("\\;").split("#").join("\\#"),Tu=(u,D)=>{if(u=(u||"").trim(),$t(u)){u.charAt(0)==="'"&&(u=u.slice(1,-1));try{u=JSON.parse(u)}catch{}}else{let t=!1,e="";for(let r=0,o=u.length;r<o;r++){const n=u.charAt(r);if(t)"\\;#".indexOf(n)!==-1?e+=n:e+="\\"+n,t=!1;else{if(";#".indexOf(n)!==-1)break;n==="\\"?t=!0:e+=n}}return t&&(e+="\\"),e.trim()}return u};var ci={parse:wt,decode:wt,stringify:xD,encode:xD,safe:Z,unsafe:Tu},vt=j(ci);const xt=u=>T.lstat(u).then(()=>!0,()=>!1),li=["","conventional"],{hasOwnProperty:Fi}=Object.prototype,St=(u,D)=>Fi.call(u,D),x=(u,D,t)=>{if(!D)throw new O(`Invalid config property ${u}: ${t}`)},Iu={OPENAI_KEY(u){if(!u)throw new O("Please set your OpenAI API key via `aicommit config set OPENAI_KEY=<your token>`");return x("OPENAI_KEY",u.startsWith("sk-"),'Must start with "sk-"'),u},locale(u){return u?(x("locale",u,"Cannot be empty"),x("locale",/^[a-z-]+$/i.test(u),"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"),u):"en"},generate(u){if(!u)return 1;x("generate",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return x("generate",D>0,"Must be greater than 0"),x("generate",D<=5,"Must be less or equal to 5"),D},type(u){return u?(x("type",li.includes(u),"Invalid commit type"),u):""},proxy(u){if(!(!u||u.length===0))return x("proxy",/^https?:\/\//.test(u),"Must be a valid URL"),u},model(u){return!u||u.length===0?"gpt-3.5-turbo":u},timeout(u){if(!u)return 1e4;x("timeout",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return x("timeout",D>=500,"Must be greater than 500ms"),D},temperature(u){if(!u)return .2;x("temperature",/^(2|\d)(\.\d{1,2})?$/.test(u),"Must be decimal between 0 and 2");const D=Number(u);return x("temperature",D>0,"Must be greater than 0"),x("temperature",D<=2,"Must be less than or equal to 2"),D},"max-length"(u){if(!u)return 50;x("max-length",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return x("max-length",D>=20,"Must be greater than 20 characters"),D},"auto-confirm"(u){return u?typeof u=="boolean"?u:(x("auto-confirm",/^(?:true|false)$/.test(u),"Must be a boolean"),u==="true"):!1},"prepend-reference"(u){return u?typeof u=="boolean"?u:(x("prepend-reference",/^(?:true|false)$/.test(u),"Must be a boolean"),u==="true"):!1}},SD=H.join(QD.homedir(),".aicommit"),Ot=async()=>{if(!await xt(SD))return Object.create(null);const D=await T.readFile(SD,"utf8");return vt.parse(D)},OD=async(u,D)=>{const t=await Ot(),e={};for(const r of Object.keys(Iu)){const o=Iu[r],n=u?.[r]??t[r];if(D)try{e[r]=o(n)}catch{}else e[r]=o(n)}return e},Ci=async u=>{const D=await Ot();for(const[t,e]of u){if(!St(Iu,t))throw new O(`Invalid config property: ${t}`);const r=Iu[t](e);D[t]=r}await T.writeFile(SD,vt.stringify(D),"utf8")};var TD={},ID={exports:{}},iu={exports:{}},PD,Tt;function fi(){if(Tt)return PD;Tt=1;var u=1e3,D=u*60,t=D*60,e=t*24,r=e*7,o=e*365.25;PD=function(F,a){a=a||{};var c=typeof F;if(c==="string"&&F.length>0)return n(F);if(c==="number"&&isFinite(F))return a.long?i(F):s(F);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(F))};function n(F){if(F=String(F),!(F.length>100)){var a=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(F);if(a){var c=parseFloat(a[1]),C=(a[2]||"ms").toLowerCase();switch(C){case"years":case"year":case"yrs":case"yr":case"y":return c*o;case"weeks":case"week":case"w":return c*r;case"days":case"day":case"d":return c*e;case"hours":case"hour":case"hrs":case"hr":case"h":return c*t;case"minutes":case"minute":case"mins":case"min":case"m":return c*D;case"seconds":case"second":case"secs":case"sec":case"s":return c*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return c;default:return}}}}function s(F){var a=Math.abs(F);return a>=e?Math.round(F/e)+"d":a>=t?Math.round(F/t)+"h":a>=D?Math.round(F/D)+"m":a>=u?Math.round(F/u)+"s":F+"ms"}function i(F){var a=Math.abs(F);return a>=e?l(F,a,e,"day"):a>=t?l(F,a,t,"hour"):a>=D?l(F,a,D,"minute"):a>=u?l(F,a,u,"second"):F+" ms"}function l(F,a,c,C){var f=a>=c*1.5;return Math.round(F/c)+" "+C+(f?"s":"")}return PD}var _D,It;function Pt(){if(It)return _D;It=1;function u(D){e.debug=e,e.default=e,e.coerce=l,e.disable=n,e.enable=o,e.enabled=s,e.humanize=fi(),e.destroy=F,Object.keys(D).forEach(a=>{e[a]=D[a]}),e.names=[],e.skips=[],e.formatters={};function t(a){let c=0;for(let C=0;C<a.length;C++)c=(c<<5)-c+a.charCodeAt(C),c|=0;return e.colors[Math.abs(c)%e.colors.length]}e.selectColor=t;function e(a){let c,C=null,f,d;function p(...h){if(!p.enabled)return;const w=p,P=Number(new Date),Cu=P-(c||P);w.diff=Cu,w.prev=c,w.curr=P,c=P,h[0]=e.coerce(h[0]),typeof h[0]!="string"&&h.unshift("%O");let k=0;h[0]=h[0].replace(/%([a-zA-Z%])/g,(U,Kt)=>{if(U==="%%")return"%";k++;const HD=e.formatters[Kt];if(typeof HD=="function"){const Yt=h[k];U=HD.call(w,Yt),h.splice(k,1),k--}return U}),e.formatArgs.call(w,h),(w.log||e.log).apply(w,h)}return p.namespace=a,p.useColors=e.useColors(),p.color=e.selectColor(a),p.extend=r,p.destroy=e.destroy,Object.defineProperty(p,"enabled",{enumerable:!0,configurable:!1,get:()=>C!==null?C:(f!==e.namespaces&&(f=e.namespaces,d=e.enabled(a)),d),set:h=>{C=h}}),typeof e.init=="function"&&e.init(p),p}function r(a,c){const C=e(this.namespace+(typeof c>"u"?":":c)+a);return C.log=this.log,C}function o(a){e.save(a),e.namespaces=a,e.names=[],e.skips=[];let c;const C=(typeof a=="string"?a:"").split(/[\s,]+/),f=C.length;for(c=0;c<f;c++)C[c]&&(a=C[c].replace(/\*/g,".*?"),a[0]==="-"?e.skips.push(new RegExp("^"+a.slice(1)+"$")):e.names.push(new RegExp("^"+a+"$")))}function n(){const a=[...e.names.map(i),...e.skips.map(i).map(c=>"-"+c)].join(",");return e.enable(""),a}function s(a){if(a[a.length-1]==="*")return!0;let c,C;for(c=0,C=e.skips.length;c<C;c++)if(e.skips[c].test(a))return!1;for(c=0,C=e.names.length;c<C;c++)if(e.names[c].test(a))return!0;return!1}function i(a){return a.toString().substring(2,a.toString().length-2).replace(/\.\*\?$/,"*")}function l(a){return a instanceof Error?a.stack||a.message:a}function F(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return e.enable(e.load()),e}return _D=u,_D}iu.exports;var _t;function Ei(){return _t||(_t=1,function(u,D){D.formatArgs=e,D.save=r,D.load=o,D.useColors=t,D.storage=n(),D.destroy=(()=>{let i=!1;return()=>{i||(i=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),D.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function t(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function e(i){if(i[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+i[0]+(this.useColors?"%c ":" ")+"+"+u.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;i.splice(1,0,l,"color: inherit");let F=0,a=0;i[0].replace(/%[a-zA-Z%]/g,c=>{c!=="%%"&&(F++,c==="%c"&&(a=F))}),i.splice(a,0,l)}D.log=console.debug||console.log||(()=>{});function r(i){try{i?D.storage.setItem("debug",i):D.storage.removeItem("debug")}catch{}}function o(){let i;try{i=D.storage.getItem("debug")}catch{}return!i&&typeof process<"u"&&"env"in process&&(i=process.env.DEBUG),i}function n(){try{return localStorage}catch{}}u.exports=Pt()(D);const{formatters:s}=u.exports;s.j=function(i){try{return JSON.stringify(i)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}}(iu,iu.exports)),iu.exports}var au={exports:{}},RD,Rt;function di(){return Rt||(Rt=1,RD=(u,D=process.argv)=>{const t=u.startsWith("-")?"":u.length===1?"-":"--",e=D.indexOf(t+u),r=D.indexOf("--");return e!==-1&&(r===-1||e<r)}),RD}var kD,kt;function pi(){if(kt)return kD;kt=1;const u=QD,D=fu,t=di(),{env:e}=process;let r;t("no-color")||t("no-colors")||t("color=false")||t("color=never")?r=0:(t("color")||t("colors")||t("color=true")||t("color=always"))&&(r=1),"FORCE_COLOR"in e&&(e.FORCE_COLOR==="true"?r=1:e.FORCE_COLOR==="false"?r=0:r=e.FORCE_COLOR.length===0?1:Math.min(parseInt(e.FORCE_COLOR,10),3));function o(i){return i===0?!1:{level:i,hasBasic:!0,has256:i>=2,has16m:i>=3}}function n(i,l){if(r===0)return 0;if(t("color=16m")||t("color=full")||t("color=truecolor"))return 3;if(t("color=256"))return 2;if(i&&!l&&r===void 0)return 0;const F=r||0;if(e.TERM==="dumb")return F;if(process.platform==="win32"){const a=u.release().split(".");return Number(a[0])>=10&&Number(a[2])>=10586?Number(a[2])>=14931?3:2:1}if("CI"in e)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(a=>a in e)||e.CI_NAME==="codeship"?1:F;if("TEAMCITY_VERSION"in e)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(e.TEAMCITY_VERSION)?1:0;if(e.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in e){const a=parseInt((e.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(e.TERM_PROGRAM){case"iTerm.app":return a>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(e.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(e.TERM)||"COLORTERM"in e?1:F}function s(i){const l=n(i,i&&i.isTTY);return o(l)}return kD={supportsColor:s,stdout:o(n(!0,D.isatty(1))),stderr:o(n(!0,D.isatty(2)))},kD}au.exports;var Mt;function hi(){return Mt||(Mt=1,function(u,D){const t=fu,e=ZD;D.init=F,D.log=s,D.formatArgs=o,D.save=i,D.load=l,D.useColors=r,D.destroy=e.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),D.colors=[6,2,3,4,5,1];try{const c=pi();c&&(c.stderr||c).level>=2&&(D.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}D.inspectOpts=Object.keys(process.env).filter(c=>/^debug_/i.test(c)).reduce((c,C)=>{const f=C.substring(6).toLowerCase().replace(/_([a-z])/g,(p,h)=>h.toUpperCase());let d=process.env[C];return/^(yes|on|true|enabled)$/i.test(d)?d=!0:/^(no|off|false|disabled)$/i.test(d)?d=!1:d==="null"?d=null:d=Number(d),c[f]=d,c},{});function r(){return"colors"in D.inspectOpts?!!D.inspectOpts.colors:t.isatty(process.stderr.fd)}function o(c){const{namespace:C,useColors:f}=this;if(f){const d=this.color,p="\x1B[3"+(d<8?d:"8;5;"+d),h=` ${p};1m${C} \x1B[0m`;c[0]=h+c[0].split(`
66
66
  `).join(`
67
67
  `+h),c.push(p+"m+"+u.exports.humanize(this.diff)+"\x1B[0m")}else c[0]=n()+C+" "+c[0]}function n(){return D.inspectOpts.hideDate?"":new Date().toISOString()+" "}function s(...c){return process.stderr.write(e.format(...c)+`
68
68
  `)}function i(c){c?process.env.DEBUG=c:delete process.env.DEBUG}function l(){return process.env.DEBUG}function F(c){c.inspectOpts={};const C=Object.keys(D.inspectOpts);for(let f=0;f<C.length;f++)c.inspectOpts[C[f]]=D.inspectOpts[C[f]]}u.exports=Pt()(D);const{formatters:a}=u.exports;a.o=function(c){return this.inspectOpts.colors=this.useColors,e.inspect(c,this.inspectOpts).split(`
@@ -76,26 +76,26 @@ ${wD}Please open a Bug report with the information above:`),console.error(`${wD}
76
76
  `);const{statusCode:C,buffered:f}=yield c;if(C===200){if(D.once("socket",Ri),t.secureEndpoint){Fu("Upgrading socket connection to TLS");const p=t.servername||t.host;return Lt.default.connect(Object.assign(Object.assign({},ji(t,"host","hostname","path","port")),{socket:o,servername:p}))}return o}o.destroy();const d=new Nt.default.Socket({writable:!1});return d.readable=!0,D.once("socket",p=>{Fu("replaying proxy buffer for failed request"),Oi.default(p.listenerCount("data")>0),p.push(f),p.push(null)}),d})}}TD.default=_i;function Ri(u){u.resume()}function ki(u,D){return!!(!D&&u===80||D&&u===443)}function Mi(u){return typeof u=="string"?/^https:?$/i.test(u):!1}function ji(u,...D){const t={};let e;for(e in u)D.includes(e)||(t[e]=u[e]);return t}var Ni=y&&y.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};const GD=Ni(TD);function UD(u){return new GD.default(u)}(function(u){u.HttpsProxyAgent=GD.default,u.prototype=GD.default.prototype})(UD||(UD={}));var Li=UD,Gi=j(Li);const Ui={"":"<commit message>",conventional:"<type>(<optional scope>): <commit message>"},Wi=u=>`The output response must be in format:
77
77
  ${Ui[u]}`,Hi={"":"",conventional:`Choose a type from the type-to-description JSON below that best describes the git diff:
78
78
  ${JSON.stringify({docs:"Documentation only changes",style:"Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",refactor:"A code change that neither fixes a bug nor adds a feature",perf:"A code change that improves performance",test:"Adding missing tests or correcting existing tests",build:"Changes that affect the build system or external dependencies",ci:"Changes to our CI configuration files and scripts",chore:"Other changes that don't modify src or test files",revert:"Reverts a previous commit",feat:"A new feature",fix:"A bug fix"},null,2)}`},qi=(u,D,t)=>["Generate a concise git commit message written in present tense for the following code diff with the given specifications below:",`Message language: ${u}`,`Commit message must be a maximum of ${D} characters.`,"Exclude anything unnecessary such as translation. Your entire response will be passed directly into git commit.",Hi[t],Wi(t)].filter(Boolean).join(`
79
- `),zi=async(u,D,t,e,r,o)=>new Promise((n,s)=>{const i=JSON.stringify(e),l=rn.request({port:443,hostname:u,path:D,method:"POST",headers:{...t,"Content-Type":"application/json","Content-Length":Buffer.byteLength(i)},timeout:r,agent:o?Gi(o):void 0},F=>{const a=[];F.on("data",c=>a.push(c)),F.on("end",()=>{n({request:l,response:F,data:Buffer.concat(a).toString()})})});l.on("error",s),l.on("timeout",()=>{l.destroy(),s(new S(`Time out error: request took over ${r}ms. Try increasing the \`timeout\` config, or checking the OpenAI API status https://status.openai.com`))}),l.write(i),l.end()}),Ki=async(u,D,t,e)=>{const{response:r,data:o}=await zi("api.openai.com","/v1/chat/completions",{Authorization:`Bearer ${u}`},D,t,e);if(!r.statusCode||r.statusCode<200||r.statusCode>299){let n=`OpenAI API Error: ${r.statusCode} - ${r.statusMessage}`;throw o&&(n+=`
79
+ `),zi=async(u,D,t,e,r,o)=>new Promise((n,s)=>{const i=JSON.stringify(e),l=rn.request({port:443,hostname:u,path:D,method:"POST",headers:{...t,"Content-Type":"application/json","Content-Length":Buffer.byteLength(i)},timeout:r,agent:o?Gi(o):void 0},F=>{const a=[];F.on("data",c=>a.push(c)),F.on("end",()=>{n({request:l,response:F,data:Buffer.concat(a).toString()})})});l.on("error",s),l.on("timeout",()=>{l.destroy(),s(new O(`Time out error: request took over ${r}ms. Try increasing the \`timeout\` config, or checking the OpenAI API status https://status.openai.com`))}),l.write(i),l.end()}),Ki=async(u,D,t,e)=>{const{response:r,data:o}=await zi("api.openai.com","/v1/chat/completions",{Authorization:`Bearer ${u}`},D,t,e);if(!r.statusCode||r.statusCode<200||r.statusCode>299){let n=`OpenAI API Error: ${r.statusCode} - ${r.statusMessage}`;throw o&&(n+=`
80
80
 
81
81
  ${o}`),r.statusCode===500&&(n+=`
82
82
 
83
- Check the API status: https://status.openai.com`),new S(n)}return JSON.parse(o)},Yi=u=>u.trim().replace(/[\n\r]/g,"").replace(/(\w)\.$/,"$1"),Vi=u=>Array.from(new Set(u)),Gt=async(u,D,t,e,r,o,n,s)=>{try{const i=await Ki(u,{model:D,messages:[{role:"system",content:qi(t,o,n)},{role:"user",content:e}],temperature:.2,top_p:1,frequency_penalty:0,presence_penalty:0,max_tokens:300,stream:!1,n:r},s);return Vi(i.choices.filter(l=>l.message?.content).map(l=>Yi(l.message.content)))}catch(i){const l=i;throw l.code==="ENOTFOUND"?new S(`Error connecting to ${l.hostname} (${l.syscall}). Are you connected to the internet?`):l}};var Ji=async(u,D,t,e,r)=>(async()=>{gt(ut(Qe(" aicommit "))),await Bt();const o=yD();t&&await V("git",["add","--update"]),o.start("Detecting staged files");const n=await At(D);if(!n)throw o.stop("Detecting staged files"),new S("No staged changes found. Stage your changes manually, or automatically stage all changes with the `--all` flag.");o.stop(`${ai(n.files)}:
83
+ Check the API status: https://status.openai.com`),new O(n)}return JSON.parse(o)},Yi=u=>u.trim().replace(/[\n\r]/g,"").replace(/(\w)\.$/,"$1"),Vi=u=>Array.from(new Set(u)),Gt=async(u,D,t,e,r,o,n,s,i)=>{try{const l=await Ki(u,{model:D,messages:[{role:"system",content:qi(t,o,n)},{role:"user",content:e}],temperature:i,top_p:1,frequency_penalty:0,presence_penalty:0,max_tokens:300,stream:!1,n:r},s);return Vi(l.choices.filter(F=>F.message?.content).map(F=>Yi(F.message.content)))}catch(l){const F=l;throw F.code==="ENOTFOUND"?new O(`Error connecting to ${F.hostname} (${F.syscall}). Are you connected to the internet?`):F}};var Ji=async(u,D,t,e,r)=>(async()=>{gt(ut(Qe(" aicommit "))),await Bt();const o=yD();t&&await V("git",["add","--update"]),o.start("Detecting staged files");const n=await At(D);if(!n)throw o.stop("Detecting staged files"),new O("No staged changes found. Stage your changes manually, or automatically stage all changes with the `--all` flag.");o.stop(`${ai(n.files)}:
84
84
  ${n.files.map(c=>` ${c}`).join(`
85
- `)}`);const{env:s}=process,i=await OD({OPENAI_KEY:s.OPENAI_KEY||s.OPENAI_API_KEY,proxy:s.https_proxy||s.HTTPS_PROXY||s.http_proxy||s.HTTP_PROXY,generate:u?.toString(),type:e?.toString()}),l=yD();l.start("The AI is analyzing your changes");let F;try{F=await Gt(i.OPENAI_KEY,i.model,i.locale,n.diff,i.generate,i["max-length"],i.type,i.timeout)}finally{l.stop("Changes analyzed")}if(F.length===0)throw new S("No commit messages were generated. Try again.");let a;if(F.length===1){[a]=F;let c;if(i["auto-confirm"]?(c=!0,G(`${ou("\u2714")} Auto confirmed commit message.
85
+ `)}`);const{env:s}=process,i=await OD({OPENAI_KEY:s.OPENAI_KEY||s.OPENAI_API_KEY,proxy:s.https_proxy||s.HTTPS_PROXY||s.http_proxy||s.HTTP_PROXY,generate:u?.toString(),type:e?.toString()}),l=yD();l.start("The AI is analyzing your changes");let F;try{F=await Gt(i.OPENAI_KEY,i.model,i.locale,n.diff,i.generate,i["max-length"],i.type,i.timeout,i.temperature)}finally{l.stop("Changes analyzed")}if(F.length===0)throw new O("No commit messages were generated. Try again.");let a;if(F.length===1){[a]=F;let c;if(i["auto-confirm"]?(c=!0,G(`${ou("\u2714")} Auto confirmed commit message.
86
86
 
87
87
  ${a}
88
88
  `)):c=await si({message:`Use this commit message?
89
89
 
90
90
  ${a}
91
- `}),!c||Ct(c)){G("Commit cancelled");return}}else{const c=await ii({message:`Pick a commit message to use: ${lD("(Ctrl+c to exit)")}`,options:F.map(C=>({label:C,value:C}))});if(Ct(c)){G("Commit cancelled");return}a=c}if(i["prepend-reference"]){const{stdout:c}=await V("git",["branch","--show-current"]),C=c.match(/([a-zA-Z])+-([0-9]+)/)?.[0];C?.length&&(a=`${C?.toUpperCase()}: ${a}`)}await V("git",["commit","-m",a,...r]),G(`${ou("\u2714")} Successfully committed!`)})().catch(o=>{G(`${$u("\u2716")} ${o.message}`),Su(o),process.exit(1)});const[WD,Zi]=process.argv.slice(2);var Xi=()=>(async()=>{if(!WD)throw new S('Commit message file path is missing. This file should be called from the "prepare-commit-msg" git hook');if(Zi)return;const u=await At();if(!u)return;gt(ut(Qe(" aicommit ")));const{env:D}=process,t=await OD({proxy:D.https_proxy||D.HTTPS_PROXY||D.http_proxy||D.HTTP_PROXY}),e=yD();e.start("The AI is analyzing your changes");let r;try{r=await Gt(t.OPENAI_KEY,t.model,t.locale,u.diff,t.generate,t["max-length"],t.type,t.timeout)}finally{e.stop("Changes analyzed")}const n=await T.readFile(WD,"utf8")!=="",s=r.length>1;let i="";n&&(i=`# \u{1F916} AI generated commit${s?"s":""}
91
+ `}),!c||Ct(c)){G("Commit cancelled");return}}else{const c=await ii({message:`Pick a commit message to use: ${lD("(Ctrl+c to exit)")}`,options:F.map(C=>({label:C,value:C}))});if(Ct(c)){G("Commit cancelled");return}a=c}if(i["prepend-reference"]){const{stdout:c}=await V("git",["branch","--show-current"]),C=c.match(/([a-zA-Z])+-([0-9]+)/)?.[0];C?.length&&(a=`${C?.toUpperCase()}: ${a}`)}await V("git",["commit","-m",a,...r]),G(`${ou("\u2714")} Successfully committed!`)})().catch(o=>{G(`${$u("\u2716")} ${o.message}`),Su(o),process.exit(1)});const[WD,Zi]=process.argv.slice(2);var Xi=()=>(async()=>{if(!WD)throw new O('Commit message file path is missing. This file should be called from the "prepare-commit-msg" git hook');if(Zi)return;const u=await At();if(!u)return;gt(ut(Qe(" aicommit ")));const{env:D}=process,t=await OD({proxy:D.https_proxy||D.HTTPS_PROXY||D.http_proxy||D.HTTP_PROXY}),e=yD();e.start("The AI is analyzing your changes");let r;try{r=await Gt(t.OPENAI_KEY,t.model,t.locale,u.diff,t.generate,t["max-length"],t.type,t.timeout,t.temperature)}finally{e.stop("Changes analyzed")}const n=await T.readFile(WD,"utf8")!=="",s=r.length>1;let i="";n&&(i=`# \u{1F916} AI generated commit${s?"s":""}
92
92
  `),s?(n&&(i+=`# Select one of the following messages by uncommeting:
93
93
  `),i+=`
94
94
  ${r.map(l=>`# ${l}`).join(`
95
95
  `)}`):(n&&(i+=`# Edit the message below and commit:
96
96
  `),i+=`
97
97
  ${r[0]}
98
- `),await T.appendFile(WD,i),G(`${ou("\u2714")} Saved commit message!`)})().catch(u=>{G(`${$u("\u2716")} ${u.message}`),Su(u),process.exit(1)}),Qi=ge({name:"config",parameters:["<mode>","<key=value...>"]},u=>{(async()=>{const{mode:D,keyValue:t}=u._;if(D==="get"){const e=await OD({},!0);for(const r of t)St(e,r)&&console.log(`${r}=${e[r]}`);return}if(D==="set"){await Ci(t.map(e=>e.split("=")));return}throw new S(`Invalid mode: ${D}`)})().catch(D=>{console.error(`${$u("\u2716")} ${D.message}`),Su(D),process.exit(1)})});const Ut="prepare-commit-msg",Wt=`.git/hooks/${Ut}`,_u=cn(new URL("cli.mjs",import.meta.url)),ua=process.argv[1].replace(/\\/g,"/").endsWith(`/${Wt}`),Ht=process.platform==="win32",qt=`
98
+ `),await T.appendFile(WD,i),G(`${ou("\u2714")} Saved commit message!`)})().catch(u=>{G(`${$u("\u2716")} ${u.message}`),Su(u),process.exit(1)}),Qi=ge({name:"config",parameters:["<mode>","<key=value...>"]},u=>{(async()=>{const{mode:D,keyValue:t}=u._;if(D==="get"){const e=await OD({},!0);for(const r of t)St(e,r)&&console.log(`${r}=${e[r]}`);return}if(D==="set"){await Ci(t.map(e=>e.split("=")));return}throw new O(`Invalid mode: ${D}`)})().catch(D=>{console.error(`${$u("\u2716")} ${D.message}`),Su(D),process.exit(1)})});const Ut="prepare-commit-msg",Wt=`.git/hooks/${Ut}`,_u=cn(new URL("cli.mjs",import.meta.url)),ua=process.argv[1].replace(/\\/g,"/").endsWith(`/${Wt}`),Ht=process.platform==="win32",qt=`
99
99
  #!/usr/bin/env node
100
100
  import(${JSON.stringify(ln(_u))})
101
- `.trim();var Da=ge({name:"hook",parameters:["<install/uninstall>"]},u=>{(async()=>{const D=await Bt(),{installUninstall:t}=u._,e=H.join(D,Wt),r=await xt(e);if(t==="install"){if(r){if(await T.realpath(e).catch(()=>{})===_u){console.warn("The hook is already installed");return}throw new S(`A different ${Ut} hook seems to be installed. Please remove it before installing aicommit.`)}await T.mkdir(H.dirname(e),{recursive:!0}),Ht?await T.writeFile(e,qt):(await T.symlink(_u,e,"file"),await T.chmod(e,493)),console.log(`${ou("\u2714")} Hook installed`);return}if(t==="uninstall"){if(!r){console.warn("Hook is not installed");return}if(Ht){if(await T.readFile(e,"utf8")!==qt){console.warn("Hook is not installed");return}}else if(await T.realpath(e)!==_u){console.warn("Hook is not installed");return}await T.rm(e),console.log(`${ou("\u2714")} Hook uninstalled`);return}throw new S(`Invalid mode: ${t}`)})().catch(D=>{console.error(`${$u("\u2716")} ${D.message}`),Su(D),process.exit(1)})});const zt=process.argv.slice(2);Or({name:"aicommit",version:Be,flags:{generate:{type:Number,description:"Number of messages to generate (Warning: generating multiple costs more) (default: 1)",alias:"g"},exclude:{type:[String],description:"Files to exclude from AI analysis",alias:"x"},all:{type:Boolean,description:"Automatically stage changes in tracked files for the commit",alias:"a",default:!1},type:{type:String,description:"Type of commit message to generate",alias:"t"}},commands:[Qi,Da],help:{description:Tr},ignoreArgv:u=>u==="unknown-flag"||u==="argument"},u=>{ua?Xi():Ji(u.flags.generate,u.flags.exclude,u.flags.all,u.flags.type,zt)},zt);
101
+ `.trim();var Da=ge({name:"hook",parameters:["<install/uninstall>"]},u=>{(async()=>{const D=await Bt(),{installUninstall:t}=u._,e=H.join(D,Wt),r=await xt(e);if(t==="install"){if(r){if(await T.realpath(e).catch(()=>{})===_u){console.warn("The hook is already installed");return}throw new O(`A different ${Ut} hook seems to be installed. Please remove it before installing aicommit.`)}await T.mkdir(H.dirname(e),{recursive:!0}),Ht?await T.writeFile(e,qt):(await T.symlink(_u,e,"file"),await T.chmod(e,493)),console.log(`${ou("\u2714")} Hook installed`);return}if(t==="uninstall"){if(!r){console.warn("Hook is not installed");return}if(Ht){if(await T.readFile(e,"utf8")!==qt){console.warn("Hook is not installed");return}}else if(await T.realpath(e)!==_u){console.warn("Hook is not installed");return}await T.rm(e),console.log(`${ou("\u2714")} Hook uninstalled`);return}throw new O(`Invalid mode: ${t}`)})().catch(D=>{console.error(`${$u("\u2716")} ${D.message}`),Su(D),process.exit(1)})});const zt=process.argv.slice(2);Or({name:"aicommit",version:Be,flags:{generate:{type:Number,description:"Number of messages to generate (Warning: generating multiple costs more) (default: 1)",alias:"g"},exclude:{type:[String],description:"Files to exclude from AI analysis",alias:"x"},all:{type:Boolean,description:"Automatically stage changes in tracked files for the commit",alias:"a",default:!1},type:{type:String,description:"Type of commit message to generate",alias:"t"}},commands:[Qi,Da],help:{description:Tr},ignoreArgv:u=>u==="unknown-flag"||u==="argument"},u=>{ua?Xi():Ji(u.flags.generate,u.flags.exclude,u.flags.all,u.flags.type,zt)},zt);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@negoziator/ai-commit",
3
- "version": "1.2.7",
3
+ "version": "1.2.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },