@gilbert_oliveira/commit-wizard 2.0.3 → 2.1.0

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.
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  [![npm version](https://img.shields.io/npm/v/@gilbert_oliveira/commit-wizard.svg)](https://www.npmjs.com/package/@gilbert_oliveira/commit-wizard)
10
10
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
11
11
 
12
- Um CLI desenvolvido com Bun.js que analisa suas mudanças no Git e gera mensagens de commit personalizadas usando a API da OpenAI.
12
+ Um CLI desenvolvido para Node.js que analisa suas mudanças no Git e gera mensagens de commit personalizadas usando a API da OpenAI.
13
13
 
14
14
  ## 📊 Status do Projeto
15
15
 
@@ -60,13 +60,13 @@ Um CLI desenvolvido com Bun.js que analisa suas mudanças no Git e gera mensagen
60
60
 
61
61
  ### Pré-requisitos
62
62
 
63
- - [Bun](https://bun.sh/) instalado
63
+ - Node.js 18+ instalado
64
64
  - Chave da API OpenAI
65
65
 
66
66
  ### Instalação Global
67
67
 
68
68
  ```bash
69
- bun install -g @gilbert_oliveira/commit-wizard
69
+ npm install -g @gilbert_oliveira/commit-wizard
70
70
  ```
71
71
 
72
72
  ### Uso via npx (sem instalação)
@@ -358,9 +358,7 @@ commit-wizard --split
358
358
  ### Executar Testes
359
359
 
360
360
  ```bash
361
- bun test # Todos os testes
362
- bun test src/__tests__ # Testes unitários
363
- bun test tests/ # Testes de integração
361
+ npm run test # Todos os testes
364
362
  ```
365
363
 
366
364
  ### Desenvolvimento Local
@@ -368,14 +366,15 @@ bun test tests/ # Testes de integração
368
366
  ```bash
369
367
  git clone https://github.com/gilbert-oliveira/commit-wizard
370
368
  cd commit-wizard
371
- bun install
372
- bun run dev
369
+
370
+ npm install
371
+ npm run dev
373
372
  ```
374
373
 
375
374
  ### Build
376
375
 
377
376
  ```bash
378
- bun run build
377
+ npm run build
379
378
  ```
380
379
 
381
380
  ---
@@ -437,7 +436,7 @@ MIT © [Gilbert Oliveira](https://github.com/gilbert-oliveira)
437
436
 
438
437
  - [Documentação da OpenAI](https://platform.openai.com/docs)
439
438
  - [Conventional Commits](https://www.conventionalcommits.org/)
440
- - [Bun.js](https://bun.sh/)
439
+ - [Node.js](https://nodejs.org/) (alternativa)
441
440
  - [📋 Guia para Contribuidores](.github/README.md) - Informações sobre desenvolvimento e CI/CD
442
441
 
443
442
  ---
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
@@ -1,71 +1,19 @@
1
- #!/usr/bin/env bun
2
- // @bun
3
- var c9=Object.create;var{getPrototypeOf:u9,defineProperty:n1,getOwnPropertyNames:g9}=Object;var p9=Object.prototype.hasOwnProperty;var F=(b,I,$)=>{$=b!=null?c9(u9(b)):{};let H=I||!b||!b.__esModule?n1($,"default",{value:b,enumerable:!0}):$;for(let Y of g9(b))if(!p9.call(H,Y))n1(H,Y,{get:()=>b[Y],enumerable:!0});return H};var O=(b,I)=>()=>(I||b((I={exports:{}}).exports,I),I.exports);var b1=(b,I)=>{for(var $ in I)n1(b,$,{get:I[$],enumerable:!0,configurable:!0,set:(H)=>I[$]=()=>H})};var N=(b,I)=>()=>(b&&(I=b(b=0)),I);var A=import.meta.require;var a1=O((F$,qI)=>{var l1={to(b,I){if(!I)return`\x1B[${b+1}G`;return`\x1B[${I+1};${b+1}H`},move(b,I){let $="";if(b<0)$+=`\x1B[${-b}D`;else if(b>0)$+=`\x1B[${b}C`;if(I<0)$+=`\x1B[${-I}A`;else if(I>0)$+=`\x1B[${I}B`;return $},up:(b=1)=>`\x1B[${b}A`,down:(b=1)=>`\x1B[${b}B`,forward:(b=1)=>`\x1B[${b}C`,backward:(b=1)=>`\x1B[${b}D`,nextLine:(b=1)=>"\x1B[E".repeat(b),prevLine:(b=1)=>"\x1B[F".repeat(b),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},n9={up:(b=1)=>"\x1B[S".repeat(b),down:(b=1)=>"\x1B[T".repeat(b)},l9={screen:"\x1B[2J",up:(b=1)=>"\x1B[1J".repeat(b),down:(b=1)=>"\x1B[J".repeat(b),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines(b){let I="";for(let $=0;$<b;$++)I+=this.line+($<b-1?l1.up():"");if(b)I+=l1.left;return I}};qI.exports={cursor:l1,scroll:n9,erase:l9,beep:"\x07"}});var r1=O((v$,i1)=>{var K1=process||{},QI=K1.argv||[],N1=K1.env||{},a9=!(!!N1.NO_COLOR||QI.includes("--no-color"))&&(!!N1.FORCE_COLOR||QI.includes("--color")||K1.platform==="win32"||(K1.stdout||{}).isTTY&&N1.TERM!=="dumb"||!!N1.CI),i9=(b,I,$=b)=>(H)=>{let Y=""+H,X=Y.indexOf(I,b.length);return~X?b+r9(Y,I,$,X)+I:b+Y+I},r9=(b,I,$,H)=>{let Y="",X=0;do Y+=b.substring(X,H)+$,X=H+I.length,H=b.indexOf(I,X);while(~H);return Y+b.substring(X)},UI=(b=a9)=>{let I=b?i9:()=>String;return{isColorSupported:b,reset:I("\x1B[0m","\x1B[0m"),bold:I("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:I("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:I("\x1B[3m","\x1B[23m"),underline:I("\x1B[4m","\x1B[24m"),inverse:I("\x1B[7m","\x1B[27m"),hidden:I("\x1B[8m","\x1B[28m"),strikethrough:I("\x1B[9m","\x1B[29m"),black:I("\x1B[30m","\x1B[39m"),red:I("\x1B[31m","\x1B[39m"),green:I("\x1B[32m","\x1B[39m"),yellow:I("\x1B[33m","\x1B[39m"),blue:I("\x1B[34m","\x1B[39m"),magenta:I("\x1B[35m","\x1B[39m"),cyan:I("\x1B[36m","\x1B[39m"),white:I("\x1B[37m","\x1B[39m"),gray:I("\x1B[90m","\x1B[39m"),bgBlack:I("\x1B[40m","\x1B[49m"),bgRed:I("\x1B[41m","\x1B[49m"),bgGreen:I("\x1B[42m","\x1B[49m"),bgYellow:I("\x1B[43m","\x1B[49m"),bgBlue:I("\x1B[44m","\x1B[49m"),bgMagenta:I("\x1B[45m","\x1B[49m"),bgCyan:I("\x1B[46m","\x1B[49m"),bgWhite:I("\x1B[47m","\x1B[49m"),blackBright:I("\x1B[90m","\x1B[39m"),redBright:I("\x1B[91m","\x1B[39m"),greenBright:I("\x1B[92m","\x1B[39m"),yellowBright:I("\x1B[93m","\x1B[39m"),blueBright:I("\x1B[94m","\x1B[39m"),magentaBright:I("\x1B[95m","\x1B[39m"),cyanBright:I("\x1B[96m","\x1B[39m"),whiteBright:I("\x1B[97m","\x1B[39m"),bgBlackBright:I("\x1B[100m","\x1B[49m"),bgRedBright:I("\x1B[101m","\x1B[49m"),bgGreenBright:I("\x1B[102m","\x1B[49m"),bgYellowBright:I("\x1B[103m","\x1B[49m"),bgBlueBright:I("\x1B[104m","\x1B[49m"),bgMagentaBright:I("\x1B[105m","\x1B[49m"),bgCyanBright:I("\x1B[106m","\x1B[49m"),bgWhiteBright:I("\x1B[107m","\x1B[49m")}};i1.exports=UI();i1.exports.createColors=UI});import{stdin as t9,stdout as o9}from"process";import VI from"readline";import{Writable as s9}from"stream";function e9({onlyFirst:b=!1}={}){let I=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(I,b?void 0:"g")}function BI(b){if(typeof b!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof b}\``);return b.replace(b4,"")}function _I(b){return b&&b.__esModule&&Object.prototype.hasOwnProperty.call(b,"default")?b.default:b}function I1(b,I={}){if(typeof b!="string"||b.length===0||(I={ambiguousIsNarrow:!0,...I},b=BI(b),b.length===0))return 0;b=b.replace(H4()," ");let $=I.ambiguousIsNarrow?1:2,H=0;for(let Y of b){let X=Y.codePointAt(0);if(X<=31||X>=127&&X<=159||X>=768&&X<=879)continue;switch(G4.eastAsianWidth(Y)){case"F":case"W":H+=2;break;case"A":H+=$;break;default:H+=1}}return H}function Z4(){let b=new Map;for(let[I,$]of Object.entries(L)){for(let[H,Y]of Object.entries($))L[H]={open:`\x1B[${Y[0]}m`,close:`\x1B[${Y[1]}m`},$[H]=L[H],b.set(Y[0],Y[1]);Object.defineProperty(L,I,{value:$,enumerable:!1})}return Object.defineProperty(L,"codes",{value:b,enumerable:!1}),L.color.close="\x1B[39m",L.bgColor.close="\x1B[49m",L.color.ansi=WI(),L.color.ansi256=zI(),L.color.ansi16m=NI(),L.bgColor.ansi=WI(t1),L.bgColor.ansi256=zI(t1),L.bgColor.ansi16m=NI(t1),Object.defineProperties(L,{rgbToAnsi256:{value:(I,$,H)=>I===$&&$===H?I<8?16:I>248?231:Math.round((I-8)/247*24)+232:16+36*Math.round(I/255*5)+6*Math.round($/255*5)+Math.round(H/255*5),enumerable:!1},hexToRgb:{value:(I)=>{let $=/[a-f\d]{6}|[a-f\d]{3}/i.exec(I.toString(16));if(!$)return[0,0,0];let[H]=$;H.length===3&&(H=[...H].map((X)=>X+X).join(""));let Y=Number.parseInt(H,16);return[Y>>16&255,Y>>8&255,Y&255]},enumerable:!1},hexToAnsi256:{value:(I)=>L.rgbToAnsi256(...L.hexToRgb(I)),enumerable:!1},ansi256ToAnsi:{value:(I)=>{if(I<8)return 30+I;if(I<16)return 90+(I-8);let $,H,Y;if(I>=232)$=((I-232)*10+8)/255,H=$,Y=$;else{I-=16;let Z=I%36;$=Math.floor(I/36)/5,H=Math.floor(Z/6)/5,Y=Z%6/5}let X=Math.max($,H,Y)*2;if(X===0)return 30;let G=30+(Math.round(Y)<<2|Math.round(H)<<1|Math.round($));return X===2&&(G+=60),G},enumerable:!1},rgbToAnsi:{value:(I,$,H)=>L.ansi256ToAnsi(L.rgbToAnsi256(I,$,H)),enumerable:!1},hexToAnsi:{value:(I)=>L.ansi256ToAnsi(L.hexToAnsi256(I)),enumerable:!1}}),L}function SI(b,I,$){return String(b).normalize().replace(/\r\n/g,`
4
- `).split(`
5
- `).map((H)=>W4(H,I,$)).join(`
6
- `)}function RI(b,I){if(typeof b=="string")return S1.aliases.get(b)===I;for(let $ of b)if($!==void 0&&RI($,I))return!0;return!1}function N4(b,I){if(b===I)return;let $=b.split(`
7
- `),H=I.split(`
8
- `),Y=[];for(let X=0;X<Math.max($.length,H.length);X++)$[X]!==H[X]&&Y.push(X);return Y}function P(b){return b===s1}function j1(b,I){let $=b;$.isTTY&&$.setRawMode(I)}class L1{constructor(b,I=!0){E(this,"input"),E(this,"output"),E(this,"_abortSignal"),E(this,"rl"),E(this,"opts"),E(this,"_render"),E(this,"_track",!1),E(this,"_prevFrame",""),E(this,"_subscribers",new Map),E(this,"_cursor",0),E(this,"state","initial"),E(this,"error",""),E(this,"value");let{input:$=t9,output:H=o9,render:Y,signal:X,...G}=b;this.opts=G,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=Y.bind(this),this._track=I,this._abortSignal=X,this.input=$,this.output=H}unsubscribe(){this._subscribers.clear()}setSubscriber(b,I){let $=this._subscribers.get(b)??[];$.push(I),this._subscribers.set(b,$)}on(b,I){this.setSubscriber(b,{cb:I})}once(b,I){this.setSubscriber(b,{cb:I,once:!0})}emit(b,...I){let $=this._subscribers.get(b)??[],H=[];for(let Y of $)Y.cb(...I),Y.once&&H.push(()=>$.splice($.indexOf(Y),1));for(let Y of H)Y()}prompt(){return new Promise((b,I)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),b(s1);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let $=new s9;$._write=(H,Y,X)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),X()},this.input.pipe($),this.rl=VI.createInterface({input:this.input,output:$,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),VI.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),j1(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(y.cursor.show),this.output.off("resize",this.render),j1(this.input,!1),b(this.value)}),this.once("cancel",()=>{this.output.write(y.cursor.show),this.output.off("resize",this.render),j1(this.input,!1),b(s1)})})}onKeypress(b,I){if(this.state==="error"&&(this.state="active"),I?.name&&(!this._track&&S1.aliases.has(I.name)&&this.emit("cursor",S1.aliases.get(I.name)),S1.actions.has(I.name)&&this.emit("cursor",I.name)),b&&(b.toLowerCase()==="y"||b.toLowerCase()==="n")&&this.emit("confirm",b.toLowerCase()==="y"),b==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),b&&this.emit("key",b.toLowerCase()),I?.name==="return"){if(this.opts.validate){let $=this.opts.validate(this.value);$&&(this.error=$ instanceof Error?$.message:$,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}RI([b,I?.name,I?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
9
- `),j1(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let b=SI(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
10
- `).length-1;this.output.write(y.cursor.move(-999,b*-1))}render(){let b=SI(this._render(this)??"",process.stdout.columns,{hard:!0});if(b!==this._prevFrame){if(this.state==="initial")this.output.write(y.cursor.hide);else{let I=N4(this._prevFrame,b);if(this.restoreCursor(),I&&I?.length===1){let $=I[0];this.output.write(y.cursor.move(0,$)),this.output.write(y.erase.lines(1));let H=b.split(`
11
- `);this.output.write(H[$]),this._prevFrame=b,this.output.write(y.cursor.move(0,H.length-$-1));return}if(I&&I?.length>1){let $=I[0];this.output.write(y.cursor.move(0,$)),this.output.write(y.erase.down());let H=b.split(`
12
- `).slice($);this.output.write(H.join(`
13
- `)),this._prevFrame=b;return}this.output.write(y.erase.down())}this.output.write(b),this.state==="initial"&&(this.state="active"),this._prevFrame=b}}}var y,LI,b4,MI,I4,G4,$4=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},H4,t1=10,WI=(b=0)=>(I)=>`\x1B[${I+b}m`,zI=(b=0)=>(I)=>`\x1B[${38+b};5;${I}m`,NI=(b=0)=>(I,$,H)=>`\x1B[${38+b};2;${I};${$};${H}m`,L,Y4,X4,J4,T1,q4=39,e1="\x07",OI="[",Q4="]",AI="m",bb,KI=(b)=>`${T1.values().next().value}${OI}${b}${AI}`,jI=(b)=>`${T1.values().next().value}${bb}${b}${e1}`,U4=(b)=>b.split(" ").map((I)=>I1(I)),o1=(b,I,$)=>{let H=[...I],Y=!1,X=!1,G=I1(BI(b[b.length-1]));for(let[Z,J]of H.entries()){let q=I1(J);if(G+q<=$?b[b.length-1]+=J:(b.push(J),G=0),T1.has(J)&&(Y=!0,X=H.slice(Z+1).join("").startsWith(bb)),Y){X?J===e1&&(Y=!1,X=!1):J===AI&&(Y=!1);continue}G+=q,G===$&&Z<H.length-1&&(b.push(""),G=0)}!G&&b[b.length-1].length>0&&b.length>1&&(b[b.length-2]+=b.pop())},V4=(b)=>{let I=b.split(" "),$=I.length;for(;$>0&&!(I1(I[$-1])>0);)$--;return $===I.length?b:I.slice(0,$).join(" ")+I.slice($).join("")},W4=(b,I,$={})=>{if($.trim!==!1&&b.trim()==="")return"";let H="",Y,X,G=U4(b),Z=[""];for(let[q,Q]of b.split(" ").entries()){$.trim!==!1&&(Z[Z.length-1]=Z[Z.length-1].trimStart());let W=I1(Z[Z.length-1]);if(q!==0&&(W>=I&&($.wordWrap===!1||$.trim===!1)&&(Z.push(""),W=0),(W>0||$.trim===!1)&&(Z[Z.length-1]+=" ",W++)),$.hard&&G[q]>I){let z=I-W,K=1+Math.floor((G[q]-z-1)/I);Math.floor((G[q]-1)/I)<K&&Z.push(""),o1(Z,Q,I);continue}if(W+G[q]>I&&W>0&&G[q]>0){if($.wordWrap===!1&&W<I){o1(Z,Q,I);continue}Z.push("")}if(W+G[q]>I&&$.wordWrap===!1){o1(Z,Q,I);continue}Z[Z.length-1]+=Q}$.trim!==!1&&(Z=Z.map((q)=>V4(q)));let J=[...Z.join(`
14
- `)];for(let[q,Q]of J.entries()){if(H+=Q,T1.has(Q)){let{groups:z}=new RegExp(`(?:\\${OI}(?<code>\\d+)m|\\${bb}(?<uri>.*)${e1})`).exec(J.slice(q).join(""))||{groups:{}};if(z.code!==void 0){let K=Number.parseFloat(z.code);Y=K===q4?void 0:K}else z.uri!==void 0&&(X=z.uri.length===0?void 0:z.uri)}let W=J4.codes.get(Number(Y));J[q+1]===`
15
- `?(X&&(H+=jI("")),Y&&W&&(H+=KI(W))):Q===`
16
- `&&(Y&&W&&(H+=KI(Y)),X&&(H+=jI(X)))}return H},z4,S1,D$,s1,K4,j4=(b,I,$)=>(I in b)?K4(b,I,{enumerable:!0,configurable:!0,writable:!0,value:$}):b[I]=$,E=(b,I,$)=>(j4(b,typeof I!="symbol"?I+"":I,$),$),Ib,S4,T4,L4=(b,I,$)=>(I in b)?T4(b,I,{enumerable:!0,configurable:!0,writable:!0,value:$}):b[I]=$,TI=(b,I,$)=>(L4(b,typeof I!="symbol"?I+"":I,$),$),Gb,$b;var Hb=N(()=>{y=F(a1(),1),LI=F(r1(),1);b4=e9();MI={exports:{}};(function(b){var I={};b.exports=I,I.eastAsianWidth=function(H){var Y=H.charCodeAt(0),X=H.length==2?H.charCodeAt(1):0,G=Y;return 55296<=Y&&Y<=56319&&56320<=X&&X<=57343&&(Y&=1023,X&=1023,G=Y<<10|X,G+=65536),G==12288||65281<=G&&G<=65376||65504<=G&&G<=65510?"F":G==8361||65377<=G&&G<=65470||65474<=G&&G<=65479||65482<=G&&G<=65487||65490<=G&&G<=65495||65498<=G&&G<=65500||65512<=G&&G<=65518?"H":4352<=G&&G<=4447||4515<=G&&G<=4519||4602<=G&&G<=4607||9001<=G&&G<=9002||11904<=G&&G<=11929||11931<=G&&G<=12019||12032<=G&&G<=12245||12272<=G&&G<=12283||12289<=G&&G<=12350||12353<=G&&G<=12438||12441<=G&&G<=12543||12549<=G&&G<=12589||12593<=G&&G<=12686||12688<=G&&G<=12730||12736<=G&&G<=12771||12784<=G&&G<=12830||12832<=G&&G<=12871||12880<=G&&G<=13054||13056<=G&&G<=19903||19968<=G&&G<=42124||42128<=G&&G<=42182||43360<=G&&G<=43388||44032<=G&&G<=55203||55216<=G&&G<=55238||55243<=G&&G<=55291||63744<=G&&G<=64255||65040<=G&&G<=65049||65072<=G&&G<=65106||65108<=G&&G<=65126||65128<=G&&G<=65131||110592<=G&&G<=110593||127488<=G&&G<=127490||127504<=G&&G<=127546||127552<=G&&G<=127560||127568<=G&&G<=127569||131072<=G&&G<=194367||177984<=G&&G<=196605||196608<=G&&G<=262141?"W":32<=G&&G<=126||162<=G&&G<=163||165<=G&&G<=166||G==172||G==175||10214<=G&&G<=10221||10629<=G&&G<=10630?"Na":G==161||G==164||167<=G&&G<=168||G==170||173<=G&&G<=174||176<=G&&G<=180||182<=G&&G<=186||188<=G&&G<=191||G==198||G==208||215<=G&&G<=216||222<=G&&G<=225||G==230||232<=G&&G<=234||236<=G&&G<=237||G==240||242<=G&&G<=243||247<=G&&G<=250||G==252||G==254||G==257||G==273||G==275||G==283||294<=G&&G<=295||G==299||305<=G&&G<=307||G==312||319<=G&&G<=322||G==324||328<=G&&G<=331||G==333||338<=G&&G<=339||358<=G&&G<=359||G==363||G==462||G==464||G==466||G==468||G==470||G==472||G==474||G==476||G==593||G==609||G==708||G==711||713<=G&&G<=715||G==717||G==720||728<=G&&G<=731||G==733||G==735||768<=G&&G<=879||913<=G&&G<=929||931<=G&&G<=937||945<=G&&G<=961||963<=G&&G<=969||G==1025||1040<=G&&G<=1103||G==1105||G==8208||8211<=G&&G<=8214||8216<=G&&G<=8217||8220<=G&&G<=8221||8224<=G&&G<=8226||8228<=G&&G<=8231||G==8240||8242<=G&&G<=8243||G==8245||G==8251||G==8254||G==8308||G==8319||8321<=G&&G<=8324||G==8364||G==8451||G==8453||G==8457||G==8467||G==8470||8481<=G&&G<=8482||G==8486||G==8491||8531<=G&&G<=8532||8539<=G&&G<=8542||8544<=G&&G<=8555||8560<=G&&G<=8569||G==8585||8592<=G&&G<=8601||8632<=G&&G<=8633||G==8658||G==8660||G==8679||G==8704||8706<=G&&G<=8707||8711<=G&&G<=8712||G==8715||G==8719||G==8721||G==8725||G==8730||8733<=G&&G<=8736||G==8739||G==8741||8743<=G&&G<=8748||G==8750||8756<=G&&G<=8759||8764<=G&&G<=8765||G==8776||G==8780||G==8786||8800<=G&&G<=8801||8804<=G&&G<=8807||8810<=G&&G<=8811||8814<=G&&G<=8815||8834<=G&&G<=8835||8838<=G&&G<=8839||G==8853||G==8857||G==8869||G==8895||G==8978||9312<=G&&G<=9449||9451<=G&&G<=9547||9552<=G&&G<=9587||9600<=G&&G<=9615||9618<=G&&G<=9621||9632<=G&&G<=9633||9635<=G&&G<=9641||9650<=G&&G<=9651||9654<=G&&G<=9655||9660<=G&&G<=9661||9664<=G&&G<=9665||9670<=G&&G<=9672||G==9675||9678<=G&&G<=9681||9698<=G&&G<=9701||G==9711||9733<=G&&G<=9734||G==9737||9742<=G&&G<=9743||9748<=G&&G<=9749||G==9756||G==9758||G==9792||G==9794||9824<=G&&G<=9825||9827<=G&&G<=9829||9831<=G&&G<=9834||9836<=G&&G<=9837||G==9839||9886<=G&&G<=9887||9918<=G&&G<=9919||9924<=G&&G<=9933||9935<=G&&G<=9953||G==9955||9960<=G&&G<=9983||G==10045||G==10071||10102<=G&&G<=10111||11093<=G&&G<=11097||12872<=G&&G<=12879||57344<=G&&G<=63743||65024<=G&&G<=65039||G==65533||127232<=G&&G<=127242||127248<=G&&G<=127277||127280<=G&&G<=127337||127344<=G&&G<=127386||917760<=G&&G<=917999||983040<=G&&G<=1048573||1048576<=G&&G<=1114109?"A":"N"},I.characterLength=function(H){var Y=this.eastAsianWidth(H);return Y=="F"||Y=="W"||Y=="A"?2:1};function $(H){return H.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}I.length=function(H){for(var Y=$(H),X=0,G=0;G<Y.length;G++)X=X+this.characterLength(Y[G]);return X},I.slice=function(H,Y,X){textLen=I.length(H),Y=Y||0,X=X||1,Y<0&&(Y=textLen+Y),X<0&&(X=textLen+X);for(var G="",Z=0,J=$(H),q=0;q<J.length;q++){var Q=J[q],W=I.length(Q);if(Z>=Y-(W==2?1:0))if(Z+W<=X)G+=Q;else break;Z+=W}return G}})(MI);I4=MI.exports,G4=_I(I4),H4=_I($4);L={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],gray:[90,39],grey:[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],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};Object.keys(L.modifier);Y4=Object.keys(L.color),X4=Object.keys(L.bgColor);[...Y4];J4=Z4(),T1=new Set(["\x1B","\x9B"]),bb=`${Q4}8;;`;z4=["up","down","left","right","space","enter","cancel"],S1={actions:new Set(z4),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};D$=globalThis.process.platform.startsWith("win"),s1=Symbol("clack:cancel");K4=Object.defineProperty;Ib=class Ib extends L1{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor(b){super(b,!1),this.value=!!b.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(I)=>{this.output.write(y.cursor.move(0,-1)),this.value=I,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}};S4=new WeakMap;T4=Object.defineProperty;Gb=class Gb extends L1{constructor(b){super(b,!1),TI(this,"options"),TI(this,"cursor",0),this.options=b.options,this.cursor=this.options.findIndex(({value:I})=>I===b.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(I)=>{switch(I){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}};$b=class $b extends L1{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}\u2588`;let b=this.value.slice(0,this.cursor),[I,...$]=this.value.slice(this.cursor);return`${b}${LI.default.inverse(I)}${$.join("")}`}get cursor(){return this._cursor}constructor(b){super(b),this.on("finalize",()=>{this.value||(this.value=b.defaultValue)})}}});import{stripVTControlCharacters as Yb}from"util";import v from"process";function B4(){return v.platform!=="win32"?v.env.TERM!=="linux":!!v.env.CI||!!v.env.WT_SESSION||!!v.env.TERMINUS_SUBLIME||v.env.ConEmuTask==="{cmd::Cmder}"||v.env.TERM_PROGRAM==="Terminus-Sublime"||v.env.TERM_PROGRAM==="vscode"||v.env.TERM==="xterm-256color"||v.env.TERM==="alacritty"||v.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var U,yI,_4,B=(b,I)=>_4?b:I,M4,O4,A4,Jb,R4,T,a,Xb,Zb,r$,t$,o$,s$,EI,E4,y4,P4,w4,x4,k4,F4,qb=(b)=>{switch(b){case"initial":case"active":return U.default.cyan(M4);case"cancel":return U.default.red(O4);case"error":return U.default.yellow(A4);case"submit":return U.default.green(Jb)}},v4=(b)=>{let{cursor:I,options:$,style:H}=b,Y=b.maxItems??Number.POSITIVE_INFINITY,X=Math.max(process.stdout.rows-4,0),G=Math.min(X,Math.max(Y,5)),Z=0;I>=Z+G-3?Z=Math.max(Math.min(I-G+3,$.length-G),0):I<Z+2&&(Z=Math.max(I-2,0));let J=G<$.length&&Z>0,q=G<$.length&&Z+G<$.length;return $.slice(Z,Z+G).map((Q,W,z)=>{let K=W===0&&J,S=W===z.length-1&&q;return K||S?U.default.dim("..."):H(Q,W+Z===I)})},PI=(b)=>new $b({validate:b.validate,placeholder:b.placeholder,defaultValue:b.defaultValue,initialValue:b.initialValue,render(){let I=`${U.default.gray(T)}
17
- ${qb(this.state)} ${b.message}
18
- `,$=b.placeholder?U.default.inverse(b.placeholder[0])+U.default.dim(b.placeholder.slice(1)):U.default.inverse(U.default.hidden("_")),H=this.value?this.valueWithCursor:$;switch(this.state){case"error":return`${I.trim()}
19
- ${U.default.yellow(T)} ${H}
20
- ${U.default.yellow(a)} ${U.default.yellow(this.error)}
21
- `;case"submit":return`${I}${U.default.gray(T)} ${U.default.dim(this.value||b.placeholder)}`;case"cancel":return`${I}${U.default.gray(T)} ${U.default.strikethrough(U.default.dim(this.value??""))}${this.value?.trim()?`
22
- ${U.default.gray(T)}`:""}`;default:return`${I}${U.default.cyan(T)} ${H}
23
- ${U.default.cyan(a)}
24
- `}}}).prompt(),g=(b)=>{let I=b.active??"Yes",$=b.inactive??"No";return new Ib({active:I,inactive:$,initialValue:b.initialValue??!0,render(){let H=`${U.default.gray(T)}
25
- ${qb(this.state)} ${b.message}
26
- `,Y=this.value?I:$;switch(this.state){case"submit":return`${H}${U.default.gray(T)} ${U.default.dim(Y)}`;case"cancel":return`${H}${U.default.gray(T)} ${U.default.strikethrough(U.default.dim(Y))}
27
- ${U.default.gray(T)}`;default:return`${H}${U.default.cyan(T)} ${this.value?`${U.default.green(Xb)} ${I}`:`${U.default.dim(Zb)} ${U.default.dim(I)}`} ${U.default.dim("/")} ${this.value?`${U.default.dim(Zb)} ${U.default.dim($)}`:`${U.default.green(Xb)} ${$}`}
28
- ${U.default.cyan(a)}
29
- `}}}).prompt()},G1=(b)=>{let I=($,H)=>{let Y=$.label??String($.value);switch(H){case"selected":return`${U.default.dim(Y)}`;case"active":return`${U.default.green(Xb)} ${Y} ${$.hint?U.default.dim(`(${$.hint})`):""}`;case"cancelled":return`${U.default.strikethrough(U.default.dim(Y))}`;default:return`${U.default.dim(Zb)} ${U.default.dim(Y)}`}};return new Gb({options:b.options,initialValue:b.initialValue,render(){let $=`${U.default.gray(T)}
30
- ${qb(this.state)} ${b.message}
31
- `;switch(this.state){case"submit":return`${$}${U.default.gray(T)} ${I(this.options[this.cursor],"selected")}`;case"cancel":return`${$}${U.default.gray(T)} ${I(this.options[this.cursor],"cancelled")}
32
- ${U.default.gray(T)}`;default:return`${$}${U.default.cyan(T)} ${v4({cursor:this.cursor,options:this.options,maxItems:b.maxItems,style:(H,Y)=>I(H,Y?"active":"inactive")}).join(`
33
- ${U.default.cyan(T)} `)}
34
- ${U.default.cyan(a)}
35
- `}}}).prompt()},i=(b="",I="")=>{let $=`
36
- ${b}
37
- `.split(`
38
- `),H=Yb(I).length,Y=Math.max($.reduce((G,Z)=>{let J=Yb(Z);return J.length>G?J.length:G},0),H)+2,X=$.map((G)=>`${U.default.gray(T)} ${U.default.dim(G)}${" ".repeat(Y-Yb(G).length)}${U.default.gray(T)}`).join(`
39
- `);process.stdout.write(`${U.default.gray(T)}
40
- ${U.default.green(Jb)} ${U.default.reset(I)} ${U.default.gray(EI.repeat(Math.max(Y-H-1,1))+E4)}
41
- ${X}
42
- ${U.default.gray(y4+EI.repeat(Y+2)+P4)}
43
- `)},wI=(b="")=>{process.stdout.write(`${U.default.gray(a)} ${U.default.red(b)}
44
-
45
- `)},xI=(b="")=>{process.stdout.write(`${U.default.gray(R4)} ${b}
46
- `)},kI=(b="")=>{process.stdout.write(`${U.default.gray(T)}
47
- ${U.default.gray(a)} ${b}
48
-
49
- `)},V,e$;var r=N(()=>{Hb();Hb();U=F(r1(),1),yI=F(a1(),1);_4=B4(),M4=B("\u25C6","*"),O4=B("\u25A0","x"),A4=B("\u25B2","x"),Jb=B("\u25C7","o"),R4=B("\u250C","T"),T=B("\u2502","|"),a=B("\u2514","\u2014"),Xb=B("\u25CF",">"),Zb=B("\u25CB"," "),r$=B("\u25FB","[\u2022]"),t$=B("\u25FC","[+]"),o$=B("\u25FB","[ ]"),s$=B("\u25AA","\u2022"),EI=B("\u2500","-"),E4=B("\u256E","+"),y4=B("\u251C","+"),P4=B("\u256F","+"),w4=B("\u25CF","\u2022"),x4=B("\u25C6","*"),k4=B("\u25B2","!"),F4=B("\u25A0","x"),V={message:(b="",{symbol:I=U.default.gray(T)}={})=>{let $=[`${U.default.gray(T)}`];if(b){let[H,...Y]=b.split(`
50
- `);$.push(`${I} ${H}`,...Y.map((X)=>`${U.default.gray(T)} ${X}`))}process.stdout.write(`${$.join(`
51
- `)}
52
- `)},info:(b)=>{V.message(b,{symbol:U.default.blue(w4)})},success:(b)=>{V.message(b,{symbol:U.default.green(x4)})},step:(b)=>{V.message(b,{symbol:U.default.green(Jb)})},warn:(b)=>{V.message(b,{symbol:U.default.yellow(k4)})},warning:(b)=>{V.warn(b)},error:(b)=>{V.message(b,{symbol:U.default.red(F4)})}},e$=`${U.default.gray(T)} `});var FI=O((G6,C4)=>{C4.exports={name:"dotenv",version:"17.2.0",description:"Loads environment variables from .env file",main:"lib/main.js",types:"lib/main.d.ts",exports:{".":{types:"./lib/main.d.ts",require:"./lib/main.js",default:"./lib/main.js"},"./config":"./config.js","./config.js":"./config.js","./lib/env-options":"./lib/env-options.js","./lib/env-options.js":"./lib/env-options.js","./lib/cli-options":"./lib/cli-options.js","./lib/cli-options.js":"./lib/cli-options.js","./package.json":"./package.json"},scripts:{"dts-check":"tsc --project tests/types/tsconfig.json",lint:"standard",pretest:"npm run lint && npm run dts-check",test:"tap run --allow-empty-coverage --disable-coverage --timeout=60000","test:coverage":"tap run --show-full-coverage --timeout=60000 --coverage-report=text --coverage-report=lcov",prerelease:"npm test",release:"standard-version"},repository:{type:"git",url:"git://github.com/motdotla/dotenv.git"},homepage:"https://github.com/motdotla/dotenv#readme",funding:"https://dotenvx.com",keywords:["dotenv","env",".env","environment","variables","config","settings"],readmeFilename:"README.md",license:"BSD-2-Clause",devDependencies:{"@types/node":"^18.11.3",decache:"^4.6.2",sinon:"^14.0.1",standard:"^17.0.0","standard-version":"^9.5.0",tap:"^19.2.0",typescript:"^4.8.4"},engines:{node:">=12"},browser:{fs:!1}}});var fI=O(($6,f)=>{var Qb=A("fs"),B1=A("path"),h4=A("os"),m4=A("crypto"),D4=FI(),Ub=D4.version,vI=["\uD83D\uDD10 encrypt with dotenvx: https://dotenvx.com","\uD83D\uDD10 prevent committing .env to code: https://dotenvx.com/precommit","\uD83D\uDD10 prevent building .env in docker: https://dotenvx.com/prebuild","\uD83D\uDEE0\uFE0F run anywhere with `dotenvx run -- yourcommand`","\u2699\uFE0F specify custom .env file path with { path: '/custom/path/.env' }","\u2699\uFE0F enable debug logging with { debug: true }","\u2699\uFE0F override existing env vars with { override: true }","\u2699\uFE0F suppress all logs with { quiet: true }","\u2699\uFE0F write to custom object with { processEnv: myObject }","\u2699\uFE0F load multiple .env files with { path: ['.env.local', '.env'] }"];function f4(){return vI[Math.floor(Math.random()*vI.length)]}function t(b){if(typeof b==="string")return!["false","0","no","off",""].includes(b.toLowerCase());return Boolean(b)}function d4(){return process.stdout.isTTY}function c4(b){return d4()?`\x1B[2m${b}\x1B[0m`:b}var u4=/(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;function g4(b){let I={},$=b.toString();$=$.replace(/\r\n?/mg,`
53
- `);let H;while((H=u4.exec($))!=null){let Y=H[1],X=H[2]||"";X=X.trim();let G=X[0];if(X=X.replace(/^(['"`])([\s\S]*)\1$/mg,"$2"),G==='"')X=X.replace(/\\n/g,`
54
- `),X=X.replace(/\\r/g,"\r");I[Y]=X}return I}function p4(b){b=b||{};let I=DI(b);b.path=I;let $=M.configDotenv(b);if(!$.parsed){let G=new Error(`MISSING_DATA: Cannot parse ${I} for an unknown reason`);throw G.code="MISSING_DATA",G}let H=mI(b).split(","),Y=H.length,X;for(let G=0;G<Y;G++)try{let Z=H[G].trim(),J=l4($,Z);X=M.decrypt(J.ciphertext,J.key);break}catch(Z){if(G+1>=Y)throw Z}return M.parse(X)}function n4(b){console.error(`[dotenv@${Ub}][WARN] ${b}`)}function $1(b){console.log(`[dotenv@${Ub}][DEBUG] ${b}`)}function hI(b){console.log(`[dotenv@${Ub}] ${b}`)}function mI(b){if(b&&b.DOTENV_KEY&&b.DOTENV_KEY.length>0)return b.DOTENV_KEY;if(process.env.DOTENV_KEY&&process.env.DOTENV_KEY.length>0)return process.env.DOTENV_KEY;return""}function l4(b,I){let $;try{$=new URL(I)}catch(Z){if(Z.code==="ERR_INVALID_URL"){let J=new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");throw J.code="INVALID_DOTENV_KEY",J}throw Z}let H=$.password;if(!H){let Z=new Error("INVALID_DOTENV_KEY: Missing key part");throw Z.code="INVALID_DOTENV_KEY",Z}let Y=$.searchParams.get("environment");if(!Y){let Z=new Error("INVALID_DOTENV_KEY: Missing environment part");throw Z.code="INVALID_DOTENV_KEY",Z}let X=`DOTENV_VAULT_${Y.toUpperCase()}`,G=b.parsed[X];if(!G){let Z=new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${X} in your .env.vault file.`);throw Z.code="NOT_FOUND_DOTENV_ENVIRONMENT",Z}return{ciphertext:G,key:H}}function DI(b){let I=null;if(b&&b.path&&b.path.length>0)if(Array.isArray(b.path)){for(let $ of b.path)if(Qb.existsSync($))I=$.endsWith(".vault")?$:`${$}.vault`}else I=b.path.endsWith(".vault")?b.path:`${b.path}.vault`;else I=B1.resolve(process.cwd(),".env.vault");if(Qb.existsSync(I))return I;return null}function CI(b){return b[0]==="~"?B1.join(h4.homedir(),b.slice(1)):b}function a4(b){let I=t(process.env.DOTENV_CONFIG_DEBUG||b&&b.debug),$=t(process.env.DOTENV_CONFIG_QUIET||b&&b.quiet);if(I||!$)hI("Loading env from encrypted .env.vault");let H=M._parseVault(b),Y=process.env;if(b&&b.processEnv!=null)Y=b.processEnv;return M.populate(Y,H,b),{parsed:H}}function i4(b){let I=B1.resolve(process.cwd(),".env"),$="utf8",H=process.env;if(b&&b.processEnv!=null)H=b.processEnv;let Y=t(H.DOTENV_CONFIG_DEBUG||b&&b.debug),X=t(H.DOTENV_CONFIG_QUIET||b&&b.quiet);if(b&&b.encoding)$=b.encoding;else if(Y)$1("No encoding is specified. UTF-8 is used by default");let G=[I];if(b&&b.path)if(!Array.isArray(b.path))G=[CI(b.path)];else{G=[];for(let Q of b.path)G.push(CI(Q))}let Z,J={};for(let Q of G)try{let W=M.parse(Qb.readFileSync(Q,{encoding:$}));M.populate(J,W,b)}catch(W){if(Y)$1(`Failed to load ${Q} ${W.message}`);Z=W}let q=M.populate(H,J,b);if(Y=t(H.DOTENV_CONFIG_DEBUG||Y),X=t(H.DOTENV_CONFIG_QUIET||X),Y||!X){let Q=Object.keys(q).length,W=[];for(let z of G)try{let K=B1.relative(process.cwd(),z);W.push(K)}catch(K){if(Y)$1(`Failed to load ${z} ${K.message}`);Z=K}hI(`injecting env (${Q}) from ${W.join(",")} ${c4(`(tip: ${f4()})`)}`)}if(Z)return{parsed:J,error:Z};else return{parsed:J}}function r4(b){if(mI(b).length===0)return M.configDotenv(b);let I=DI(b);if(!I)return n4(`You set DOTENV_KEY but you are missing a .env.vault file at ${I}. Did you forget to build it?`),M.configDotenv(b);return M._configVault(b)}function t4(b,I){let $=Buffer.from(I.slice(-64),"hex"),H=Buffer.from(b,"base64"),Y=H.subarray(0,12),X=H.subarray(-16);H=H.subarray(12,-16);try{let G=m4.createDecipheriv("aes-256-gcm",$,Y);return G.setAuthTag(X),`${G.update(H)}${G.final()}`}catch(G){let Z=G instanceof RangeError,J=G.message==="Invalid key length",q=G.message==="Unsupported state or unable to authenticate data";if(Z||J){let Q=new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");throw Q.code="INVALID_DOTENV_KEY",Q}else if(q){let Q=new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");throw Q.code="DECRYPTION_FAILED",Q}else throw G}}function o4(b,I,$={}){let H=Boolean($&&$.debug),Y=Boolean($&&$.override),X={};if(typeof I!=="object"){let G=new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");throw G.code="OBJECT_REQUIRED",G}for(let G of Object.keys(I))if(Object.prototype.hasOwnProperty.call(b,G)){if(Y===!0)b[G]=I[G],X[G]=I[G];if(H)if(Y===!0)$1(`"${G}" is already defined and WAS overwritten`);else $1(`"${G}" is already defined and was NOT overwritten`)}else b[G]=I[G],X[G]=I[G];return X}var M={configDotenv:i4,_configVault:a4,_parseVault:p4,config:r4,decrypt:t4,parse:g4,populate:o4};$6.configDotenv=M.configDotenv;$6._configVault=M._configVault;$6._parseVault=M._parseVault;$6.config=M.config;$6.decrypt=M.decrypt;$6.parse=M.parse;$6.populate=M.populate;f.exports=M});import{existsSync as dI,readFileSync as cI}from"fs";import{join as uI}from"path";function nI(b){let I;try{I=uI(process.cwd(),".commit-wizardrc")}catch{I="/tmp/.commit-wizardrc"}let $=uI(process.env.HOME||process.env.USERPROFILE||"/tmp",".commit-wizardrc"),H={...Y3};try{if(dI($)){let X=cI($,"utf-8"),G=JSON.parse(X);H=gI(H,G)}}catch{console.warn("\u26A0\uFE0F Erro ao ler configura\xE7\xE3o global: Erro desconhecido")}let Y=b||I;try{if(dI(Y)){let X=cI(Y,"utf-8"),G=JSON.parse(X);H=gI(H,G)}}catch{console.warn("\u26A0\uFE0F Erro ao ler .commit-wizardrc: Erro desconhecido")}if(H.openai.apiKey=process.env.OPENAI_API_KEY,process.env.COMMIT_WIZARD_DEBUG==="true");if(process.env.COMMIT_WIZARD_DRY_RUN==="true")H.dryRun=!0;return H}function gI(b,I){return{...b,...I,openai:{...b.openai,...I.openai},smartSplit:{...b.smartSplit,...I.smartSplit},cache:{...b.cache,...I.cache}}}function lI(b){let I=[];if(!b.openai.apiKey)I.push("OPENAI_API_KEY n\xE3o encontrada nas vari\xE1veis de ambiente");if(b.openai.maxTokens<10||b.openai.maxTokens>4000)I.push("maxTokens deve estar entre 10 e 4000");if(b.openai.temperature<0||b.openai.temperature>2)I.push("temperature deve estar entre 0 e 2");if(!["pt","en","es","fr","de","it","ja","ko","zh"].includes(b.language))I.push("language deve ser um idioma suportado (pt, en, es, fr, de, it, ja, ko, zh)");if(!["conventional","simple","detailed"].includes(b.commitStyle))I.push("commitStyle deve ser conventional, simple ou detailed");if(b.smartSplit.minGroupSize<1)I.push("smartSplit.minGroupSize deve ser pelo menos 1");if(b.smartSplit.maxGroups<1||b.smartSplit.maxGroups>10)I.push("smartSplit.maxGroups deve estar entre 1 e 10");if(b.smartSplit.confidenceThreshold<0||b.smartSplit.confidenceThreshold>1)I.push("smartSplit.confidenceThreshold deve estar entre 0 e 1");if(b.cache.ttl<1)I.push("cache.ttl deve ser pelo menos 1 minuto");if(b.cache.maxSize<1)I.push("cache.maxSize deve ser pelo menos 1");return I}var pI,Y3;var aI=N(()=>{pI=F(fI(),1);pI.default.config();Y3={openai:{model:"gpt-4o",maxTokens:150,temperature:0.7,timeout:30000,retries:2},language:"pt",commitStyle:"conventional",autoCommit:!1,splitCommits:!1,dryRun:!1,smartSplit:{enabled:!0,minGroupSize:1,maxGroups:5,confidenceThreshold:0.7},cache:{enabled:!0,ttl:60,maxSize:100}}});var c={};b1(c,{isGitRepository:()=>Vb,getGitStatus:()=>Wb,getFileDiff:()=>X3,getDiffStats:()=>zb,executeFileCommit:()=>H1,executeCommit:()=>u,escapeShellArg:()=>_1});import{execSync as d}from"child_process";function _1(b){return`'${b.replace(/'/g,`'"'"'`)}'`}function Vb(){try{return d("git rev-parse --git-dir",{stdio:"ignore"}),!0}catch{return!1}}function Wb(){try{let I=d("git diff --cached --name-only",{encoding:"utf-8",stdio:"pipe"}).trim().split(`
55
- `).filter((H)=>H.length>0),$=I.length>0?d("git diff --cached",{encoding:"utf-8",stdio:"pipe"}):"";return{hasStaged:I.length>0,stagedFiles:I,diff:$.trim()}}catch(b){throw new Error(`Erro ao obter status do Git: ${b instanceof Error?b.message:"Erro desconhecido"}`)}}function X3(b){try{return d(`git diff --cached -- "${b}"`,{encoding:"utf-8",stdio:"pipe"})}catch(I){throw new Error(`Erro ao obter diff do arquivo ${b}: ${I instanceof Error?I.message:"Erro desconhecido"}`)}}function u(b){try{let I=_1(b);return d(`git commit -m ${I}`,{stdio:"pipe"}),{success:!0,hash:d("git rev-parse HEAD",{encoding:"utf-8",stdio:"pipe"}).trim(),message:b}}catch(I){return{success:!1,error:I instanceof Error?I.message:"Erro desconhecido ao executar commit"}}}function H1(b,I){try{let $=_1(I),H=_1(b);return d(`git commit ${H} -m ${$}`,{stdio:"pipe"}),{success:!0,hash:d("git rev-parse HEAD",{encoding:"utf-8",stdio:"pipe"}).trim(),message:I}}catch($){return{success:!1,error:$ instanceof Error?$.message:"Erro desconhecido ao executar commit do arquivo"}}}function zb(){try{let I=d("git diff --cached --numstat",{encoding:"utf-8",stdio:"pipe"}).trim().split(`
56
- `).filter((Y)=>Y.length>0),$=0,H=0;return I.forEach((Y)=>{let[X,G]=Y.split("\t");if(X&&X!=="-")$+=parseInt(X)||0;if(G&&G!=="-")H+=parseInt(G)||0}),{added:$,removed:H,files:I.length}}catch{return{added:0,removed:0,files:0}}}var D=()=>{};var eI={};b1(eI,{processOpenAIMessage:()=>oI,generateWithRetry:()=>M1,generateCommitMessage:()=>sI,extractCommitTypeFromMessage:()=>rI,detectCommitType:()=>tI,buildPrompt:()=>iI});function iI(b,I,$){let H=I.language==="pt"?"portugu\xEAs":"english",Y=Z3(I.commitStyle,I.language),X=6000,G=b.length>6000?b.substring(0,6000)+`
57
- ... (diff truncado)`:b,Z=$.length>10?`${$.length} arquivos: ${$.slice(0,5).join(", ")}...`:$.join(", ");return`Gere mensagem de commit em ${H} (${I.commitStyle}).
1
+ #!/usr/bin/env node
2
+ var je=Object.defineProperty;var b=(e,t)=>()=>(e&&(t=e(e=0)),t);var P=(e,t)=>{for(var o in t)je(e,o,{get:t[o],enumerable:!0})};import at from"path";import{fileURLToPath as mt}from"url";var d=b(()=>{"use strict"});import{existsSync as re,readFileSync as ae}from"fs";import{join as ce}from"path";import De from"dotenv";function le(e){let t;try{t=ce(process.cwd(),".commit-wizardrc")}catch{t="/tmp/.commit-wizardrc"}let o=ce(process.env.HOME||process.env.USERPROFILE||"/tmp",".commit-wizardrc"),i={...Te};try{if(re(o)){let s=ae(o,"utf-8"),a=JSON.parse(s);i=me(i,a)}}catch{console.warn("\u26A0\uFE0F Erro ao ler configura\xE7\xE3o global: Erro desconhecido")}let n=e||t;try{if(re(n)){let s=ae(n,"utf-8"),a=JSON.parse(s);i=me(i,a)}}catch{console.warn("\u26A0\uFE0F Erro ao ler .commit-wizardrc: Erro desconhecido")}return i.openai.apiKey=process.env.OPENAI_API_KEY,process.env.COMMIT_WIZARD_DEBUG,process.env.COMMIT_WIZARD_DRY_RUN==="true"&&(i.dryRun=!0),i}function me(e,t){return{...e,...t,openai:{...e.openai,...t.openai},smartSplit:{...e.smartSplit,...t.smartSplit},cache:{...e.cache,...t.cache}}}function ue(e){let t=[];return e.openai.apiKey||t.push("OPENAI_API_KEY n\xE3o encontrada nas vari\xE1veis de ambiente"),(e.openai.maxTokens<10||e.openai.maxTokens>4e3)&&t.push("maxTokens deve estar entre 10 e 4000"),(e.openai.temperature<0||e.openai.temperature>2)&&t.push("temperature deve estar entre 0 e 2"),["pt","en","es","fr","de","it","ja","ko","zh"].includes(e.language)||t.push("language deve ser um idioma suportado (pt, en, es, fr, de, it, ja, ko, zh)"),["conventional","simple","detailed"].includes(e.commitStyle)||t.push("commitStyle deve ser conventional, simple ou detailed"),e.smartSplit.minGroupSize<1&&t.push("smartSplit.minGroupSize deve ser pelo menos 1"),(e.smartSplit.maxGroups<1||e.smartSplit.maxGroups>10)&&t.push("smartSplit.maxGroups deve estar entre 1 e 10"),(e.smartSplit.confidenceThreshold<0||e.smartSplit.confidenceThreshold>1)&&t.push("smartSplit.confidenceThreshold deve estar entre 0 e 1"),e.cache.ttl<1&&t.push("cache.ttl deve ser pelo menos 1 minuto"),e.cache.maxSize<1&&t.push("cache.maxSize deve ser pelo menos 1"),t}var Te,pe=b(()=>{"use strict";d();De.config();Te={openai:{model:"gpt-4o",maxTokens:150,temperature:.7,timeout:3e4,retries:2},language:"pt",commitStyle:"conventional",autoCommit:!1,splitCommits:!1,dryRun:!1,smartSplit:{enabled:!0,minGroupSize:1,maxGroups:5,confidenceThreshold:.7},cache:{enabled:!0,ttl:60,maxSize:100}}});var E={};P(E,{escapeShellArg:()=>T,executeCommit:()=>z,executeFileCommit:()=>j,getDiffStats:()=>J,getFileDiff:()=>qe,getGitStatus:()=>K,isGitRepository:()=>V});import{execSync as A}from"child_process";function T(e){return`'${e.replace(/'/g,`'"'"'`)}'`}function V(){try{return A("git rev-parse --git-dir",{stdio:"ignore"}),!0}catch{return!1}}function K(){try{let t=A("git diff --cached --name-only",{encoding:"utf-8",stdio:"pipe"}).trim().split(`
3
+ `).filter(i=>i.length>0),o=t.length>0?A("git diff --cached",{encoding:"utf-8",stdio:"pipe"}):"";return{hasStaged:t.length>0,stagedFiles:t,diff:o.trim()}}catch(e){throw new Error(`Erro ao obter status do Git: ${e instanceof Error?e.message:"Erro desconhecido"}`)}}function qe(e){try{return A(`git diff --cached -- "${e}"`,{encoding:"utf-8",stdio:"pipe"})}catch(t){throw new Error(`Erro ao obter diff do arquivo ${e}: ${t instanceof Error?t.message:"Erro desconhecido"}`)}}function z(e){try{let t=T(e);return A(`git commit -m ${t}`,{stdio:"pipe"}),{success:!0,hash:A("git rev-parse HEAD",{encoding:"utf-8",stdio:"pipe"}).trim(),message:e}}catch(t){return{success:!1,error:t instanceof Error?t.message:"Erro desconhecido ao executar commit"}}}function j(e,t){try{let o=T(t),i=T(e);return A(`git commit ${i} -m ${o}`,{stdio:"pipe"}),{success:!0,hash:A("git rev-parse HEAD",{encoding:"utf-8",stdio:"pipe"}).trim(),message:t}}catch(o){return{success:!1,error:o instanceof Error?o.message:"Erro desconhecido ao executar commit do arquivo"}}}function J(){try{let t=A("git diff --cached --numstat",{encoding:"utf-8",stdio:"pipe"}).trim().split(`
4
+ `).filter(n=>n.length>0),o=0,i=0;return t.forEach(n=>{let[s,a]=n.split(" ");s&&s!=="-"&&(o+=parseInt(s)||0),a&&a!=="-"&&(i+=parseInt(a)||0)}),{added:o,removed:i,files:t.length}}catch{return{added:0,removed:0,files:0}}}var S=b(()=>{"use strict";d()});var xe={};P(xe,{buildPrompt:()=>de,detectCommitType:()=>ge,extractCommitTypeFromMessage:()=>fe,generateCommitMessage:()=>ye,generateWithRetry:()=>q,processOpenAIMessage:()=>he});function de(e,t,o){let i=t.language==="pt"?"portugu\xEAs":"english",n=ke(t.commitStyle,t.language),s=6e3,a=e.length>s?e.substring(0,s)+`
5
+ ... (diff truncado)`:e,c=o.length>10?`${o.length} arquivos: ${o.slice(0,5).join(", ")}...`:o.join(", ");return`Gere mensagem de commit em ${i} (${t.commitStyle}).
58
6
 
59
- Arquivos: ${Z}
7
+ Arquivos: ${c}
60
8
 
61
- ${Y}
9
+ ${n}
62
10
 
63
11
  Diff:
64
12
  \`\`\`
65
- ${G}
13
+ ${a}
66
14
  \`\`\`
67
15
 
68
- Mensagem:`}function Z3(b,I){let $={pt:{conventional:`- Use formato: tipo(escopo): descri\xE7\xE3o
16
+ Mensagem:`}function ke(e,t){let o={pt:{conventional:`- Use formato: tipo(escopo): descri\xE7\xE3o
69
17
  - Tipos v\xE1lidos: feat, fix, docs, style, refactor, test, chore, build, ci
70
18
  - Exemplo: "feat(auth): adicionar valida\xE7\xE3o de email"
71
19
  - Mantenha a primeira linha com at\xE9 50 caracteres`,simple:`- Use formato simples e direto
@@ -83,31 +31,25 @@ Mensagem:`}function Z3(b,I){let $={pt:{conventional:`- Use formato: tipo(escopo)
83
31
  - Maximum 50 characters`,detailed:`- First line: summary under 50 characters
84
32
  - Add explanatory body if needed
85
33
  - Use imperative mood
86
- - Be descriptive but concise`}},H=I==="pt"?"pt":"en";return $[H][b]||$[H].conventional}function rI(b){let I={feat:/^(feat|feature)(\([^)]+\))?:/i,fix:/^(fix|bugfix)(\([^)]+\))?:/i,docs:/^(docs|documentation)(\([^)]+\))?:/i,style:/^(style|format)(\([^)]+\))?:/i,refactor:/^(refactor|refactoring)(\([^)]+\))?:/i,test:/^(test|testing)(\([^)]+\))?:/i,chore:/^(chore|maintenance)(\([^)]+\))?:/i,build:/^(build|ci)(\([^)]+\))?:/i,ci:/^(ci|continuous-integration)(\([^)]+\))?:/i};for(let[$,H]of Object.entries(I))if(H.test(b))return $;return null}function tI(b,I){let $=b.toLowerCase(),H=I.join(" ").toLowerCase();if(H.includes("test")||H.includes("spec")||$.includes("test("))return"test";if(H.includes("readme")||H.includes(".md")||H.includes("docs"))return"docs";if(H.includes("package.json")||H.includes("dockerfile")||H.includes(".yml")||H.includes(".yaml")||H.includes("webpack")||H.includes("tsconfig"))return"build";if(H.includes(".css")||H.includes(".scss")||$.includes("style")||$.includes("format"))return"style";if($.includes("fix")||$.includes("bug")||$.includes("error")||$.includes("issue"))return"fix";if($.includes("add")||$.includes("new")||$.includes("create")||$.includes("implement"))return"feat";if($.includes("refactor")||$.includes("restructure")||$.includes("rename"))return"refactor";return"chore"}function oI(b){if(b.match(/^```[\s\S]*```$/))b=b.replace(/^```(?:plaintext|javascript|typescript|python|java|html|css|json|xml|yaml|yml|bash|shell|text)?\s*/,"").replace(/\s*```$/,"");return b=b.trim(),b}async function sI(b,I,$){try{if(!I.openai.apiKey)return{success:!1,error:"Chave da OpenAI n\xE3o encontrada. Configure OPENAI_API_KEY nas vari\xE1veis de ambiente."};let H=iI(b,I,$),Y=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${I.openai.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify({model:I.openai.model,messages:[{role:"user",content:H}],max_tokens:Math.min(I.openai.maxTokens,150),temperature:I.openai.temperature})});if(!Y.ok){let q=await Y.json().catch(()=>({}));return{success:!1,error:`Erro da OpenAI (${Y.status}): ${q.error?.message||"Erro desconhecido"}`}}let G=(await Y.json()).choices?.[0]?.message?.content?.trim();if(!G)return{success:!1,error:"OpenAI retornou resposta vazia"};G=oI(G);let Z=rI(G),J=tI(b,$);return{success:!0,suggestion:{message:G,type:Z||J,confidence:0.8}}}catch(H){return{success:!1,error:`Erro ao conectar com OpenAI: ${H instanceof Error?H.message:"Erro desconhecido"}`}}}async function M1(b,I,$,H=3){let Y="";for(let X=0;X<H;X++){let G=await sI(b,I,$);if(G.success)return G;if(Y=G.error||"Erro desconhecido",X<H-1)await new Promise((Z)=>setTimeout(Z,Math.pow(2,X)*1000))}return{success:!1,error:`Falha ap\xF3s ${H} tentativas. \xDAltimo erro: ${Y}`}}import b0 from"fs";function J3(){try{return b0.statSync("/.dockerenv"),!0}catch{return!1}}function q3(){try{return b0.readFileSync("/proc/self/cgroup","utf8").includes("docker")}catch{return!1}}function Kb(){if(Nb===void 0)Nb=J3()||q3();return Nb}var Nb;var I0=()=>{};import Q3 from"fs";function O1(){if(jb===void 0)jb=U3()||Kb();return jb}var jb,U3=()=>{try{return Q3.statSync("/run/.containerenv"),!0}catch{return!1}};var G0=N(()=>{I0()});import H0 from"process";import V3 from"os";import W3 from"fs";var $0=()=>{if(H0.platform!=="linux")return!1;if(V3.release().toLowerCase().includes("microsoft")){if(O1())return!1;return!0}try{return W3.readFileSync("/proc/version","utf8").toLowerCase().includes("microsoft")?!O1():!1}catch{return!1}},Y0;var X0=N(()=>{G0();Y0=H0.env.__IS_WSL_TEST__?$0:$0()});var U0=O((S6,Q0)=>{Q0.exports=q0;q0.sync=N3;var Z0=A("fs");function z3(b,I){var $=I.pathExt!==void 0?I.pathExt:process.env.PATHEXT;if(!$)return!0;if($=$.split(";"),$.indexOf("")!==-1)return!0;for(var H=0;H<$.length;H++){var Y=$[H].toLowerCase();if(Y&&b.substr(-Y.length).toLowerCase()===Y)return!0}return!1}function J0(b,I,$){if(!b.isSymbolicLink()&&!b.isFile())return!1;return z3(I,$)}function q0(b,I,$){Z0.stat(b,function(H,Y){$(H,H?!1:J0(Y,b,I))})}function N3(b,I){return J0(Z0.statSync(b),b,I)}});var K0=O((T6,N0)=>{N0.exports=W0;W0.sync=K3;var V0=A("fs");function W0(b,I,$){V0.stat(b,function(H,Y){$(H,H?!1:z0(Y,I))})}function K3(b,I){return z0(V0.statSync(b),I)}function z0(b,I){return b.isFile()&&j3(b,I)}function j3(b,I){var{mode:$,uid:H,gid:Y}=b,X=I.uid!==void 0?I.uid:process.getuid&&process.getuid(),G=I.gid!==void 0?I.gid:process.getgid&&process.getgid(),Z=parseInt("100",8),J=parseInt("010",8),q=parseInt("001",8),Q=Z|J,W=$&q||$&J&&Y===G||$&Z&&H===X||$&Q&&X===0;return W}});var S0=O((B6,j0)=>{var L6=A("fs"),A1;if(process.platform==="win32"||global.TESTING_WINDOWS)A1=U0();else A1=K0();j0.exports=Sb;Sb.sync=S3;function Sb(b,I,$){if(typeof I==="function")$=I,I={};if(!$){if(typeof Promise!=="function")throw new TypeError("callback not provided");return new Promise(function(H,Y){Sb(b,I||{},function(X,G){if(X)Y(X);else H(G)})})}A1(b,I||{},function(H,Y){if(H){if(H.code==="EACCES"||I&&I.ignoreErrors)H=null,Y=!1}$(H,Y)})}function S3(b,I){try{return A1.sync(b,I||{})}catch($){if(I&&I.ignoreErrors||$.code==="EACCES")return!1;else throw $}}});var A0=O((_6,O0)=>{var o=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",T0=A("path"),T3=o?";":":",L0=S0(),B0=(b)=>Object.assign(new Error(`not found: ${b}`),{code:"ENOENT"}),_0=(b,I)=>{let $=I.colon||T3,H=b.match(/\//)||o&&b.match(/\\/)?[""]:[...o?[process.cwd()]:[],...(I.path||process.env.PATH||"").split($)],Y=o?I.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",X=o?Y.split($):[""];if(o){if(b.indexOf(".")!==-1&&X[0]!=="")X.unshift("")}return{pathEnv:H,pathExt:X,pathExtExe:Y}},M0=(b,I,$)=>{if(typeof I==="function")$=I,I={};if(!I)I={};let{pathEnv:H,pathExt:Y,pathExtExe:X}=_0(b,I),G=[],Z=(q)=>new Promise((Q,W)=>{if(q===H.length)return I.all&&G.length?Q(G):W(B0(b));let z=H[q],K=/^".*"$/.test(z)?z.slice(1,-1):z,S=T0.join(K,b),j=!K&&/^\.[\\\/]/.test(b)?b.slice(0,2)+S:S;Q(J(j,q,0))}),J=(q,Q,W)=>new Promise((z,K)=>{if(W===Y.length)return z(Z(Q+1));let S=Y[W];L0(q+S,{pathExt:X},(j,_)=>{if(!j&&_)if(I.all)G.push(q+S);else return z(q+S);return z(J(q,Q,W+1))})});return $?Z(0).then((q)=>$(null,q),$):Z(0)},L3=(b,I)=>{I=I||{};let{pathEnv:$,pathExt:H,pathExtExe:Y}=_0(b,I),X=[];for(let G=0;G<$.length;G++){let Z=$[G],J=/^".*"$/.test(Z)?Z.slice(1,-1):Z,q=T0.join(J,b),Q=!J&&/^\.[\\\/]/.test(b)?b.slice(0,2)+q:q;for(let W=0;W<H.length;W++){let z=Q+H[W];try{if(L0.sync(z,{pathExt:Y}))if(I.all)X.push(z);else return z}catch(K){}}}if(I.all&&X.length)return X;if(I.nothrow)return null;throw B0(b)};O0.exports=M0;M0.sync=L3});var E0=O((M6,Tb)=>{var R0=(b={})=>{let I=b.env||process.env;if((b.platform||process.platform)!=="win32")return"PATH";return Object.keys(I).reverse().find((H)=>H.toUpperCase()==="PATH")||"Path"};Tb.exports=R0;Tb.exports.default=R0});var x0=O((O6,w0)=>{var y0=A("path"),B3=A0(),_3=E0();function P0(b,I){let $=b.options.env||process.env,H=process.cwd(),Y=b.options.cwd!=null,X=Y&&process.chdir!==void 0&&!process.chdir.disabled;if(X)try{process.chdir(b.options.cwd)}catch(Z){}let G;try{G=B3.sync(b.command,{path:$[_3({env:$})],pathExt:I?y0.delimiter:void 0})}catch(Z){}finally{if(X)process.chdir(H)}if(G)G=y0.resolve(Y?b.options.cwd:"",G);return G}function M3(b){return P0(b)||P0(b,!0)}w0.exports=M3});var k0=O((R3,Bb)=>{var Lb=/([()\][%!^"`<>&|;, *?])/g;function O3(b){return b=b.replace(Lb,"^$1"),b}function A3(b,I){if(b=`${b}`,b=b.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),b=b.replace(/(?=(\\+?)?)\1$/,"$1$1"),b=`"${b}"`,b=b.replace(Lb,"^$1"),I)b=b.replace(Lb,"^$1");return b}R3.command=O3;R3.argument=A3});var v0=O((A6,F0)=>{F0.exports=/^#!(.*)/});var h0=O((R6,C0)=>{var P3=v0();C0.exports=(b="")=>{let I=b.match(P3);if(!I)return null;let[$,H]=I[0].replace(/#! ?/,"").split(" "),Y=$.split("/").pop();if(Y==="env")return H;return H?`${Y} ${H}`:Y}});var D0=O((E6,m0)=>{var _b=A("fs"),w3=h0();function x3(b){let $=Buffer.alloc(150),H;try{H=_b.openSync(b,"r"),_b.readSync(H,$,0,150,0),_b.closeSync(H)}catch(Y){}return w3($.toString())}m0.exports=x3});var u0=O((y6,c0)=>{var k3=A("path"),f0=x0(),d0=k0(),F3=D0(),v3=process.platform==="win32",C3=/\.(?:com|exe)$/i,h3=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function m3(b){b.file=f0(b);let I=b.file&&F3(b.file);if(I)return b.args.unshift(b.file),b.command=I,f0(b);return b.file}function D3(b){if(!v3)return b;let I=m3(b),$=!C3.test(I);if(b.options.forceShell||$){let H=h3.test(I);b.command=k3.normalize(b.command),b.command=d0.command(b.command),b.args=b.args.map((X)=>d0.argument(X,H));let Y=[b.command].concat(b.args).join(" ");b.args=["/d","/s","/c",`"${Y}"`],b.command=process.env.comspec||"cmd.exe",b.options.windowsVerbatimArguments=!0}return b}function f3(b,I,$){if(I&&!Array.isArray(I))$=I,I=null;I=I?I.slice(0):[],$=Object.assign({},$);let H={command:b,args:I,options:$,file:void 0,original:{command:b,args:I}};return $.shell?H:D3(H)}c0.exports=f3});var n0=O((P6,p0)=>{var Mb=process.platform==="win32";function Ob(b,I){return Object.assign(new Error(`${I} ${b.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${I} ${b.command}`,path:b.command,spawnargs:b.args})}function d3(b,I){if(!Mb)return;let $=b.emit;b.emit=function(H,Y){if(H==="exit"){let X=g0(Y,I);if(X)return $.call(b,"error",X)}return $.apply(b,arguments)}}function g0(b,I){if(Mb&&b===1&&!I.file)return Ob(I.original,"spawn");return null}function c3(b,I){if(Mb&&b===1&&!I.file)return Ob(I.original,"spawnSync");return null}p0.exports={hookChildProcess:d3,verifyENOENT:g0,verifyENOENTSync:c3,notFoundError:Ob}});var i0=O((w6,s)=>{var l0=A("child_process"),Ab=u0(),Rb=n0();function a0(b,I,$){let H=Ab(b,I,$),Y=l0.spawn(H.command,H.args,H.options);return Rb.hookChildProcess(Y,H),Y}function u3(b,I,$){let H=Ab(b,I,$),Y=l0.spawnSync(H.command,H.args,H.options);return Y.error=Y.error||Rb.verifyENOENTSync(Y.status,H),Y}s.exports=a0;s.exports.spawn=a0;s.exports.sync=u3;s.exports._parse=Ab;s.exports._enoent=Rb});function Eb(b){let I=typeof b==="string"?`
87
- `:`
88
- `.charCodeAt(),$=typeof b==="string"?"\r":"\r".charCodeAt();if(b[b.length-1]===I)b=b.slice(0,-1);if(b[b.length-1]===$)b=b.slice(0,-1);return b}function R1(b={}){let{env:I=process.env,platform:$=process.platform}=b;if($!=="win32")return"PATH";return Object.keys(I).reverse().find((H)=>H.toUpperCase()==="PATH")||"Path"}import E1 from"process";import Y1 from"path";import{fileURLToPath as r0}from"url";var g3=({cwd:b=E1.cwd(),path:I=E1.env[R1()],preferLocal:$=!0,execPath:H=E1.execPath,addExecPath:Y=!0}={})=>{let X=b instanceof URL?r0(b):b,G=Y1.resolve(X),Z=[];if($)p3(Z,G);if(Y)n3(Z,H,G);return[...Z,I].join(Y1.delimiter)},p3=(b,I)=>{let $;while($!==I)b.push(Y1.join(I,"node_modules/.bin")),$=I,I=Y1.resolve(I,"..")},n3=(b,I,$)=>{let H=I instanceof URL?r0(I):I;b.push(Y1.resolve($,H,".."))},t0=({env:b=E1.env,...I}={})=>{b={...b};let $=R1({env:b});return I.path=b[$],b[$]=g3(I),b};var o0=()=>{};function yb(b,I,{ignoreNonConfigurable:$=!1}={}){let{name:H}=b;for(let Y of Reflect.ownKeys(I))l3(b,I,Y,$);return i3(b,I),s3(b,I,H),b}var l3=(b,I,$,H)=>{if($==="length"||$==="prototype")return;if($==="arguments"||$==="caller")return;let Y=Object.getOwnPropertyDescriptor(b,$),X=Object.getOwnPropertyDescriptor(I,$);if(!a3(Y,X)&&H)return;Object.defineProperty(b,$,X)},a3=function(b,I){return b===void 0||b.configurable||b.writable===I.writable&&b.enumerable===I.enumerable&&b.configurable===I.configurable&&(b.writable||b.value===I.value)},i3=(b,I)=>{let $=Object.getPrototypeOf(I);if($===Object.getPrototypeOf(b))return;Object.setPrototypeOf(b,$)},r3=(b,I)=>`/* Wrapped ${b}*/
89
- ${I}`,t3,o3,s3=(b,I,$)=>{let H=$===""?"":`with ${$.trim()}() `,Y=r3.bind(null,H,I.toString());Object.defineProperty(Y,"name",o3),Object.defineProperty(b,"toString",{...t3,value:Y})};var s0=N(()=>{t3=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),o3=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var y1,e0=(b,I={})=>{if(typeof b!=="function")throw new TypeError("Expected a function");let $,H=0,Y=b.displayName||b.name||"<anonymous>",X=function(...G){if(y1.set(X,++H),H===1)$=b.apply(this,G),b=null;else if(I.throw===!0)throw new Error(`Function \`${Y}\` can only be called once`);return $};return yb(X,b),y1.set(X,H),X},b2;var I2=N(()=>{s0();y1=new WeakMap;e0.callCount=(b)=>{if(!y1.has(b))throw new Error(`The given function \`${b.name}\` is not wrapped by the \`onetime\` package`);return y1.get(b)};b2=e0});var G2=()=>{let b=Pb-$2+1;return Array.from({length:b},e3)},e3=(b,I)=>({name:`SIGRT${I+1}`,number:$2+I,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),$2=34,Pb=64;var H2;var Y2=N(()=>{H2=[{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"}]});import{constants as bG}from"os";var wb=()=>{let b=G2();return[...H2,...b].map(IG)},IG=({name:b,number:I,description:$,action:H,forced:Y=!1,standard:X})=>{let{signals:{[b]:G}}=bG,Z=G!==void 0;return{name:b,number:Z?G:I,description:$,supported:Z,action:H,forced:Y,standard:X}};var X2=N(()=>{Y2()});import{constants as GG}from"os";var $G=()=>{let b=wb();return Object.fromEntries(b.map(HG))},HG=({name:b,number:I,description:$,supported:H,action:Y,forced:X,standard:G})=>[b,{name:b,number:I,description:$,supported:H,action:Y,forced:X,standard:G}],Z2,YG=()=>{let b=wb(),I=Pb+1,$=Array.from({length:I},(H,Y)=>XG(Y,b));return Object.assign({},...$)},XG=(b,I)=>{let $=ZG(b,I);if($===void 0)return{};let{name:H,description:Y,supported:X,action:G,forced:Z,standard:J}=$;return{[b]:{name:H,number:b,description:Y,supported:X,action:G,forced:Z,standard:J}}},ZG=(b,I)=>{let $=I.find(({name:H})=>GG.signals[H]===b);if($!==void 0)return $;return I.find((H)=>H.number===b)},t6;var J2=N(()=>{X2();Z2=$G(),t6=YG()});import JG from"process";var qG=({timedOut:b,timeout:I,errorCode:$,signal:H,signalDescription:Y,exitCode:X,isCanceled:G})=>{if(b)return`timed out after ${I} milliseconds`;if(G)return"was canceled";if($!==void 0)return`failed with ${$}`;if(H!==void 0)return`was killed with ${H} (${Y})`;if(X!==void 0)return`failed with exit code ${X}`;return"failed"},X1=({stdout:b,stderr:I,all:$,error:H,signal:Y,exitCode:X,command:G,escapedCommand:Z,timedOut:J,isCanceled:q,killed:Q,parsed:{options:{timeout:W,cwd:z=JG.cwd()}}})=>{X=X===null?void 0:X,Y=Y===null?void 0:Y;let K=Y===void 0?void 0:Z2[Y].description,S=H&&H.code,_=`Command ${qG({timedOut:J,timeout:W,errorCode:S,signal:Y,signalDescription:K,exitCode:X,isCanceled:q})}: ${G}`,h=Object.prototype.toString.call(H)==="[object Error]",m=h?`${_}
90
- ${H.message}`:_,R=[m,I,b].filter(Boolean).join(`
91
- `);if(h)H.originalMessage=H.message,H.message=R;else H=new Error(R);if(H.shortMessage=m,H.command=G,H.escapedCommand=Z,H.exitCode=X,H.signal=Y,H.signalDescription=K,H.stdout=b,H.stderr=I,H.cwd=z,$!==void 0)H.all=$;if("bufferedData"in H)delete H.bufferedData;return H.failed=!0,H.timedOut=Boolean(J),H.isCanceled=q,H.killed=Q&&!J,H};var q2=N(()=>{J2()});var P1,QG=(b)=>P1.some((I)=>b[I]!==void 0),Q2=(b)=>{if(!b)return;let{stdio:I}=b;if(I===void 0)return P1.map((H)=>b[H]);if(QG(b))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${P1.map((H)=>`\`${H}\``).join(", ")}`);if(typeof I==="string")return I;if(!Array.isArray(I))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof I}\``);let $=Math.max(I.length,P1.length);return Array.from({length:$},(H,Y)=>I[Y])};var U2=N(()=>{P1=["stdin","stdout","stderr"]});var p;var V2=N(()=>{p=[];p.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")p.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")p.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class W2{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(kb[xb])return kb[xb];UG(kb,xb,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(b,I){this.listeners[b].push(I)}removeListener(b,I){let $=this.listeners[b],H=$.indexOf(I);if(H===-1)return;if(H===0&&$.length===1)$.length=0;else $.splice(H,1)}emit(b,I,$){if(this.emitted[b])return!1;this.emitted[b]=!0;let H=!1;for(let Y of this.listeners[b])H=Y(I,$)===!0||H;if(b==="exit")H=this.emit("afterExit",I,$)||H;return H}}class vb{}var w1=(b)=>!!b&&typeof b==="object"&&typeof b.removeListener==="function"&&typeof b.emit==="function"&&typeof b.reallyExit==="function"&&typeof b.listeners==="function"&&typeof b.kill==="function"&&typeof b.pid==="number"&&typeof b.on==="function",xb,kb,UG,VG=(b)=>{return{onExit(I,$){return b.onExit(I,$)},load(){return b.load()},unload(){return b.unload()}}},z2,N2,Fb,K2,H8,Y8;var j2=N(()=>{V2();xb=Symbol.for("signal-exit emitter"),kb=globalThis,UG=Object.defineProperty.bind(Object);z2=class z2 extends vb{onExit(){return()=>{}}load(){}unload(){}};N2=class N2 extends vb{#X=Fb.platform==="win32"?"SIGINT":"SIGHUP";#I=new W2;#b;#H;#Y;#$={};#G=!1;constructor(b){super();this.#b=b,this.#$={};for(let I of p)this.#$[I]=()=>{let $=this.#b.listeners(I),{count:H}=this.#I,Y=b;if(typeof Y.__signal_exit_emitter__==="object"&&typeof Y.__signal_exit_emitter__.count==="number")H+=Y.__signal_exit_emitter__.count;if($.length===H){this.unload();let X=this.#I.emit("exit",null,I),G=I==="SIGHUP"?this.#X:I;if(!X)b.kill(b.pid,G)}};this.#Y=b.reallyExit,this.#H=b.emit}onExit(b,I){if(!w1(this.#b))return()=>{};if(this.#G===!1)this.load();let $=I?.alwaysLast?"afterExit":"exit";return this.#I.on($,b),()=>{if(this.#I.removeListener($,b),this.#I.listeners.exit.length===0&&this.#I.listeners.afterExit.length===0)this.unload()}}load(){if(this.#G)return;this.#G=!0,this.#I.count+=1;for(let b of p)try{let I=this.#$[b];if(I)this.#b.on(b,I)}catch(I){}this.#b.emit=(b,...I)=>{return this.#J(b,...I)},this.#b.reallyExit=(b)=>{return this.#Z(b)}}unload(){if(!this.#G)return;this.#G=!1,p.forEach((b)=>{let I=this.#$[b];if(!I)throw new Error("Listener not defined for signal: "+b);try{this.#b.removeListener(b,I)}catch($){}}),this.#b.emit=this.#H,this.#b.reallyExit=this.#Y,this.#I.count-=1}#Z(b){if(!w1(this.#b))return 0;return this.#b.exitCode=b||0,this.#I.emit("exit",this.#b.exitCode,null),this.#Y.call(this.#b,this.#b.exitCode)}#J(b,...I){let $=this.#H;if(b==="exit"&&w1(this.#b)){if(typeof I[0]==="number")this.#b.exitCode=I[0];let H=$.call(this.#b,b,...I);return this.#I.emit("exit",this.#b.exitCode,null),H}else return $.call(this.#b,b,...I)}};Fb=globalThis.process,{onExit:K2,load:H8,unload:Y8}=VG(w1(Fb)?new N2(Fb):new z2)});import WG from"os";var zG=5000,S2=(b,I="SIGTERM",$={})=>{let H=b(I);return NG(b,I,$,H),H},NG=(b,I,$,H)=>{if(!KG(I,$,H))return;let Y=SG($),X=setTimeout(()=>{b("SIGKILL")},Y);if(X.unref)X.unref()},KG=(b,{forceKillAfterTimeout:I},$)=>jG(b)&&I!==!1&&$,jG=(b)=>b===WG.constants.signals.SIGTERM||typeof b==="string"&&b.toUpperCase()==="SIGTERM",SG=({forceKillAfterTimeout:b=!0})=>{if(b===!0)return zG;if(!Number.isFinite(b)||b<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${b}\` (${typeof b})`);return b},T2=(b,I)=>{if(b.kill())I.isCanceled=!0},TG=(b,I,$)=>{b.kill(I),$(Object.assign(new Error("Timed out"),{timedOut:!0,signal:I}))},L2=(b,{timeout:I,killSignal:$="SIGTERM"},H)=>{if(I===0||I===void 0)return H;let Y,X=new Promise((Z,J)=>{Y=setTimeout(()=>{TG(b,$,J)},I)}),G=H.finally(()=>{clearTimeout(Y)});return Promise.race([X,G])},B2=({timeout:b})=>{if(b!==void 0&&(!Number.isFinite(b)||b<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${b}\` (${typeof b})`)},_2=async(b,{cleanup:I,detached:$},H)=>{if(!I||$)return H;let Y=K2(()=>{b.kill()});return H.finally(()=>{Y()})};var M2=N(()=>{j2()});function x1(b){return b!==null&&typeof b==="object"&&typeof b.pipe==="function"}function Cb(b){return x1(b)&&b.writable!==!1&&typeof b._write==="function"&&typeof b._writableState==="object"}import{createWriteStream as LG}from"fs";import{ChildProcess as BG}from"child_process";var _G=(b)=>b instanceof BG&&typeof b.then==="function",hb=(b,I,$)=>{if(typeof $==="string")return b[I].pipe(LG($)),b;if(Cb($))return b[I].pipe($),b;if(!_G($))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!Cb($.stdin))throw new TypeError("The target child process's stdin must be available.");return b[I].pipe($.stdin),$},O2=(b)=>{if(b.stdout!==null)b.pipeStdout=hb.bind(void 0,b,"stdout");if(b.stderr!==null)b.pipeStderr=hb.bind(void 0,b,"stderr");if(b.all!==void 0)b.pipeAll=hb.bind(void 0,b,"all")};var A2=()=>{};var Z1=async(b,{init:I,convertChunk:$,getSize:H,truncateChunk:Y,addChunk:X,getFinalChunk:G,finalize:Z},{maxBuffer:J=Number.POSITIVE_INFINITY}={})=>{if(!OG(b))throw new Error("The first argument must be a Readable, a ReadableStream, or an async iterable.");let q=I();q.length=0;try{for await(let Q of b){let W=AG(Q),z=$[W](Q,q);y2({convertedChunk:z,state:q,getSize:H,truncateChunk:Y,addChunk:X,maxBuffer:J})}return MG({state:q,convertChunk:$,getSize:H,truncateChunk:Y,addChunk:X,getFinalChunk:G,maxBuffer:J}),Z(q)}catch(Q){throw Q.bufferedData=Z(q),Q}},MG=({state:b,getSize:I,truncateChunk:$,addChunk:H,getFinalChunk:Y,maxBuffer:X})=>{let G=Y(b);if(G!==void 0)y2({convertedChunk:G,state:b,getSize:I,truncateChunk:$,addChunk:H,maxBuffer:X})},y2=({convertedChunk:b,state:I,getSize:$,truncateChunk:H,addChunk:Y,maxBuffer:X})=>{let G=$(b),Z=I.length+G;if(Z<=X){R2(b,I,Y,Z);return}let J=H(b,X-I.length);if(J!==void 0)R2(J,I,Y,X);throw new mb},R2=(b,I,$,H)=>{I.contents=$(b,I,H),I.length=H},OG=(b)=>typeof b==="object"&&b!==null&&typeof b[Symbol.asyncIterator]==="function",AG=(b)=>{let I=typeof b;if(I==="string")return"string";if(I!=="object"||b===null)return"others";if(globalThis.Buffer?.isBuffer(b))return"buffer";let $=E2.call(b);if($==="[object ArrayBuffer]")return"arrayBuffer";if($==="[object DataView]")return"dataView";if(Number.isInteger(b.byteLength)&&Number.isInteger(b.byteOffset)&&E2.call(b.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},E2,mb;var J1=N(()=>{({toString:E2}=Object.prototype);mb=class mb extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}});var Db=(b)=>b,fb=()=>{return},db=({contents:b})=>b,k1=(b)=>{throw new Error(`Streams in object mode are not supported: ${String(b)}`)},F1=(b)=>b.length;var P2=N(()=>{J1()});async function cb(b,I){return Z1(b,vG,I)}var RG=()=>({contents:new ArrayBuffer(0)}),EG=(b)=>yG.encode(b),yG,w2=(b)=>new Uint8Array(b),x2=(b)=>new Uint8Array(b.buffer,b.byteOffset,b.byteLength),PG=(b,I)=>b.slice(0,I),wG=(b,{contents:I,length:$},H)=>{let Y=v2()?kG(I,H):xG(I,H);return new Uint8Array(Y).set(b,$),Y},xG=(b,I)=>{if(I<=b.byteLength)return b;let $=new ArrayBuffer(F2(I));return new Uint8Array($).set(new Uint8Array(b),0),$},kG=(b,I)=>{if(I<=b.maxByteLength)return b.resize(I),b;let $=new ArrayBuffer(I,{maxByteLength:F2(I)});return new Uint8Array($).set(new Uint8Array(b),0),$},F2=(b)=>k2**Math.ceil(Math.log(b)/Math.log(k2)),k2=2,FG=({contents:b,length:I})=>v2()?b:b.slice(0,I),v2=()=>("resize"in ArrayBuffer.prototype),vG;var ub=N(()=>{J1();yG=new TextEncoder,vG={init:RG,convertChunk:{string:EG,buffer:w2,arrayBuffer:w2,dataView:x2,typedArray:x2,others:k1},getSize:F1,truncateChunk:PG,addChunk:wG,getFinalChunk:fb,finalize:FG}});async function v1(b,I){if(!("Buffer"in globalThis))throw new Error("getStreamAsBuffer() is only supported in Node.js");try{return C2(await cb(b,I))}catch($){if($.bufferedData!==void 0)$.bufferedData=C2($.bufferedData);throw $}}var C2=(b)=>globalThis.Buffer.from(b);var h2=N(()=>{ub()});async function gb(b,I){return Z1(b,fG,I)}var CG=()=>({contents:"",textDecoder:new TextDecoder}),C1=(b,{textDecoder:I})=>I.decode(b,{stream:!0}),hG=(b,{contents:I})=>I+b,mG=(b,I)=>b.slice(0,I),DG=({textDecoder:b})=>{let I=b.decode();return I===""?void 0:I},fG;var m2=N(()=>{J1();fG={init:CG,convertChunk:{string:Db,buffer:C1,arrayBuffer:C1,dataView:C1,typedArray:C1,others:k1},getSize:F1,truncateChunk:mG,addChunk:hG,getFinalChunk:DG,finalize:db}});var D2=N(()=>{P2();ub();h2();m2();J1()});var d2=O((C8,f2)=>{var{PassThrough:dG}=A("stream");f2.exports=function(){var b=[],I=new dG({objectMode:!0});return I.setMaxListeners(0),I.add=$,I.isEmpty=H,I.on("unpipe",Y),Array.prototype.slice.call(arguments).forEach($),I;function $(X){if(Array.isArray(X))return X.forEach($),this;return b.push(X),X.once("end",Y.bind(null,X)),X.once("error",I.emit.bind(I,"error")),X.pipe(I,{end:!1}),this}function H(){return b.length==0}function Y(X){if(b=b.filter(function(G){return G!==X}),!b.length&&I.readable)I.end()}}});import{createReadStream as cG,readFileSync as uG}from"fs";import{setTimeout as gG}from"timers/promises";var c2,u2=(b)=>{if(b!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},pG=({input:b,inputFile:I})=>{if(typeof I!=="string")return b;return u2(b),uG(I)},g2=(b)=>{let I=pG(b);if(x1(I))throw new TypeError("The `input` option cannot be a stream in sync mode");return I},nG=({input:b,inputFile:I})=>{if(typeof I!=="string")return b;return u2(b),cG(I)},p2=(b,I)=>{let $=nG(I);if($===void 0)return;if(x1($))$.pipe(b.stdin);else b.stdin.end($)},n2=(b,{all:I})=>{if(!I||!b.stdout&&!b.stderr)return;let $=c2.default();if(b.stdout)$.add(b.stdout);if(b.stderr)$.add(b.stderr);return $},pb=async(b,I)=>{if(!b||I===void 0)return;await gG(0),b.destroy();try{return await I}catch($){return $.bufferedData}},nb=(b,{encoding:I,buffer:$,maxBuffer:H})=>{if(!b||!$)return;if(I==="utf8"||I==="utf-8")return gb(b,{maxBuffer:H});if(I===null||I==="buffer")return v1(b,{maxBuffer:H});return lG(b,H,I)},lG=async(b,I,$)=>{return(await v1(b,{maxBuffer:I})).toString($)},l2=async({stdout:b,stderr:I,all:$},{encoding:H,buffer:Y,maxBuffer:X},G)=>{let Z=nb(b,{encoding:H,buffer:Y,maxBuffer:X}),J=nb(I,{encoding:H,buffer:Y,maxBuffer:X}),q=nb($,{encoding:H,buffer:Y,maxBuffer:X*2});try{return await Promise.all([G,Z,J,q])}catch(Q){return Promise.all([{error:Q,signal:Q.signal,timedOut:Q.timedOut},pb(b,Z),pb(I,J),pb($,q)])}};var a2=N(()=>{D2();c2=F(d2(),1)});var aG,iG,lb=(b,I)=>{for(let[$,H]of iG){let Y=typeof I==="function"?(...X)=>Reflect.apply(H.value,I(),X):H.value.bind(I);Reflect.defineProperty(b,$,{...H,value:Y})}},i2=(b)=>new Promise((I,$)=>{if(b.on("exit",(H,Y)=>{I({exitCode:H,signal:Y})}),b.on("error",(H)=>{$(H)}),b.stdin)b.stdin.on("error",(H)=>{$(H)})});var r2=N(()=>{aG=(async()=>{})().constructor.prototype,iG=["then","catch","finally"].map((b)=>[b,Reflect.getOwnPropertyDescriptor(aG,b)])});import{Buffer as rG}from"buffer";import{ChildProcess as tG}from"child_process";var s2=(b,I=[])=>{if(!Array.isArray(I))return[b];return[b,...I]},oG,sG=(b)=>{if(typeof b!=="string"||oG.test(b))return b;return`"${b.replaceAll('"',"\\\"")}"`},ab=(b,I)=>s2(b,I).join(" "),ib=(b,I)=>s2(b,I).map(($)=>sG($)).join(" "),eG,t2=(b)=>{let I=typeof b;if(I==="string")return b;if(I==="number")return String(b);if(I==="object"&&b!==null&&!(b instanceof tG)&&"stdout"in b){let $=typeof b.stdout;if($==="string")return b.stdout;if(rG.isBuffer(b.stdout))return b.stdout.toString();throw new TypeError(`Unexpected "${$}" stdout in template expression`)}throw new TypeError(`Unexpected "${I}" in template expression`)},o2=(b,I,$)=>$||b.length===0||I.length===0?[...b,...I]:[...b.slice(0,-1),`${b.at(-1)}${I[0]}`,...I.slice(1)],b$=({templates:b,expressions:I,tokens:$,index:H,template:Y})=>{let X=Y??b.raw[H],G=X.split(eG).filter(Boolean),Z=o2($,G,X.startsWith(" "));if(H===I.length)return Z;let J=I[H],q=Array.isArray(J)?J.map((Q)=>t2(Q)):[t2(J)];return o2(Z,q,X.endsWith(" "))},rb=(b,I)=>{let $=[];for(let[H,Y]of b.entries())$=b$({templates:b,expressions:I,tokens:$,index:H,template:Y});return $};var e2=N(()=>{oG=/^[\w.-]+$/,eG=/ +/g});import{debuglog as I$}from"util";import G$ from"process";var b9,h1=(b,I)=>String(b).padStart(I,"0"),$$=()=>{let b=new Date;return`${h1(b.getHours(),2)}:${h1(b.getMinutes(),2)}:${h1(b.getSeconds(),2)}.${h1(b.getMilliseconds(),3)}`},tb=(b,{verbose:I})=>{if(!I)return;G$.stderr.write(`[${$$()}] ${b}
92
- `)};var I9=N(()=>{b9=I$("execa").enabled});import{Buffer as H$}from"buffer";import Y$ from"path";import ob from"child_process";import m1 from"process";function w(b,I,$){let H=H9(b,I,$),Y=ab(b,I),X=ib(b,I);tb(X,H.options),B2(H.options);let G;try{G=ob.spawn(H.file,H.args,H.options)}catch(K){let S=new ob.ChildProcess,j=Promise.reject(X1({error:K,stdout:"",stderr:"",all:"",command:Y,escapedCommand:X,parsed:H,timedOut:!1,isCanceled:!1,killed:!1}));return lb(S,j),S}let Z=i2(G),J=L2(G,H.options,Z),q=_2(G,H.options,J),Q={isCanceled:!1};G.kill=S2.bind(null,G.kill.bind(G)),G.cancel=T2.bind(null,G,Q);let z=b2(async()=>{let[{error:K,exitCode:S,signal:j,timedOut:_},h,m,R]=await l2(G,H.options,q),n=q1(H.options,h),z1=q1(H.options,m),l=q1(H.options,R);if(K||S!==0||j!==null){let JI=X1({error:K,exitCode:S,signal:j,stdout:n,stderr:z1,all:l,command:Y,escapedCommand:X,parsed:H,timedOut:_,isCanceled:Q.isCanceled||(H.options.signal?H.options.signal.aborted:!1),killed:G.killed});if(!H.options.reject)return JI;throw JI}return{command:Y,escapedCommand:X,exitCode:0,stdout:n,stderr:z1,all:l,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return p2(G,H.options),G.all=n2(G,H.options),O2(G),lb(G,z),G}function x(b,I,$){let H=H9(b,I,$),Y=ab(b,I),X=ib(b,I);tb(X,H.options);let G=g2(H.options),Z;try{Z=ob.spawnSync(H.file,H.args,{...H.options,input:G})}catch(Q){throw X1({error:Q,stdout:"",stderr:"",all:"",command:Y,escapedCommand:X,parsed:H,timedOut:!1,isCanceled:!1,killed:!1})}let J=q1(H.options,Z.stdout,Z.error),q=q1(H.options,Z.stderr,Z.error);if(Z.error||Z.status!==0||Z.signal!==null){let Q=X1({stdout:J,stderr:q,error:Z.error,signal:Z.signal,exitCode:Z.status,command:Y,escapedCommand:X,parsed:H,timedOut:Z.error&&Z.error.code==="ETIMEDOUT",isCanceled:!1,killed:Z.signal!==null});if(!H.options.reject)return Q;throw Q}return{command:Y,escapedCommand:X,exitCode:0,stdout:J,stderr:q,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}function Y9(b){function I($,...H){if(!Array.isArray($))return Y9({...b,...$});let[Y,...X]=rb($,H);return w(Y,X,G9(b))}return I.sync=($,...H)=>{if(!Array.isArray($))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[Y,...X]=rb($,H);return x(Y,X,G9(b))},I}var $9,X$=1e8,Z$=({env:b,extendEnv:I,preferLocal:$,localDir:H,execPath:Y})=>{let X=I?{...m1.env,...b}:b;if($)return t0({env:X,cwd:H,execPath:Y});return X},H9=(b,I,$={})=>{let H=$9.default._parse(b,I,$);if(b=H.command,I=H.args,$=H.options,$={maxBuffer:X$,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:$.cwd||m1.cwd(),execPath:m1.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:b9,...$},$.env=Z$($),$.stdio=Q2($),m1.platform==="win32"&&Y$.basename(b,".exe")==="cmd")I.unshift("/q");return{file:b,args:I,options:$,parsed:H}},q1=(b,I,$)=>{if(typeof I!=="string"&&!H$.isBuffer(I))return $===void 0?void 0:"";if(b.stripFinalNewline)return Eb(I);return I},J$=({input:b,inputFile:I,stdio:$})=>b===void 0&&I===void 0&&$===void 0?{stdin:"inherit"}:{},G9=(b={})=>({preferLocal:!0,...J$(b),...b}),U7;var Q1=N(()=>{$9=F(i0(),1);o0();I2();q2();U2();M2();A2();a2();r2();e2();I9();U7=Y9()});var D1=(b)=>{if(b.code==="ENOENT")throw new Error("Couldn't find the termux-api scripts. You can install them with: apt install termux-api");throw b},q$,X9;var Z9=N(()=>{Q1();q$={async copy(b){try{await w("termux-clipboard-set",b)}catch(I){D1(I)}},async paste(b){try{let{stdout:I}=await w("termux-clipboard-get",b);return I}catch(I){D1(I)}},copySync(b){try{x("termux-clipboard-set",b)}catch(I){D1(I)}},pasteSync(b){try{return x("termux-clipboard-get",b).stdout}catch(I){D1(I)}}},X9=q$});import V9 from"path";import{fileURLToPath as Q$}from"url";var U$,W9="xsel",z9,J9,q9,N9=(b,I)=>{let $;if(b.code==="ENOENT")$=new Error("Couldn't find the `xsel` binary and fallback didn't work. On Debian/Ubuntu you can install xsel with: sudo apt install xsel");else $=new Error("Both xsel and fallback failed"),$.xselError=b;return $.fallbackError=I,$},Q9=async(b,I)=>{try{let{stdout:$}=await w(W9,b,I);return $}catch($){try{let{stdout:H}=await w(z9,b,I);return H}catch(H){throw N9($,H)}}},U9=(b,I)=>{try{return x(W9,b,I).stdout}catch($){try{return x(z9,b,I).stdout}catch(H){throw N9($,H)}}},V$,K9;var j9=N(()=>{Q1();U$=V9.dirname(Q$(import.meta.url)),z9=V9.join(U$,"../fallbacks/linux/xsel"),J9=["--clipboard","--input"],q9=["--clipboard","--output"],V$={async copy(b){await Q9(J9,b)},copySync(b){U9(J9,b)},paste:(b)=>Q9(q9,b),pasteSync:(b)=>U9(q9,b)},K9=V$});var f1,W$,S9;var T9=N(()=>{Q1();f1={LC_CTYPE:"UTF-8"},W$={copy:async(b)=>w("pbcopy",{...b,env:f1}),async paste(b){let{stdout:I}=await w("pbpaste",{...b,env:f1});return I},copySync:(b)=>x("pbcopy",{...b,env:f1}),pasteSync:(b)=>x("pbpaste",{...b,env:f1}).stdout},S9=W$});import{promisify as z$}from"util";import N$ from"process";import U1 from"child_process";function L9(){let{arch:b,platform:I,env:$}=N$;if(I==="darwin"&&b==="x64")return U1.execFileSync("sysctl",["-inq","sysctl.proc_translated"],{encoding:"utf8"}).trim()==="1"?"arm64":"x64";if(b==="arm64"||b==="x64")return b;if(I==="win32"&&Object.hasOwn($,"PROCESSOR_ARCHITEW6432"))return"x64";if(I==="linux"){if(U1.execFileSync("getconf",["LONG_BIT"],{encoding:"utf8"}).trim()==="64")return"x64"}return b}var O7;var B9=N(()=>{O7=z$(U1.execFile)});function _9(){return K$.has(L9())}var K$;var M9=N(()=>{B9();K$=new Set(["arm64","x64","ppc64","riscv64"])});import O9 from"path";import{fileURLToPath as j$}from"url";var S$,T$,d1,L$,sb;var A9=N(()=>{Q1();M9();S$=O9.dirname(j$(import.meta.url)),T$=_9()?"x86_64":"i686",d1=O9.join(S$,`../fallbacks/windows/clipboard_${T$}.exe`),L$={copy:async(b)=>w(d1,["--copy"],b),async paste(b){let{stdout:I}=await w(d1,["--paste"],b);return I},copySync:(b)=>x(d1,["--copy"],b),pasteSync:(b)=>x(d1,["--paste"],b).stdout},sb=L$});import R9 from"process";var c1,V1,E9;var y9=N(()=>{X0();Z9();j9();T9();A9();c1=(()=>{switch(R9.platform){case"darwin":return S9;case"win32":return sb;case"android":{if(R9.env.PREFIX!=="/data/data/com.termux/files/usr")throw new Error("You need to install Termux for this module to work on Android: https://termux.com");return X9}default:{if(Y0)return sb;return K9}}})(),V1={};V1.write=async(b)=>{if(typeof b!=="string")throw new TypeError(`Expected a string, got ${typeof b}`);await c1.copy({input:b})};V1.read=async()=>c1.paste({stripFinalNewline:!1});V1.writeSync=(b)=>{if(typeof b!=="string")throw new TypeError(`Expected a string, got ${typeof b}`);c1.copySync({input:b})};V1.readSync=()=>c1.pasteSync({stripFinalNewline:!1});E9=V1});var II={};b1(II,{showCommitResult:()=>k,showCommitPreview:()=>u1,showCancellation:()=>e,selectFilesForCommit:()=>eb,editCommitMessage:()=>g1,copyToClipboard:()=>p1,confirmCommit:()=>B$,askContinueCommits:()=>bI});async function u1(b){i(`Tipo: ${b.type}
93
- Mensagem: "${b.message}"`,"\uD83D\uDCAD Sugest\xE3o de Commit");let I=await G1({message:"O que voc\xEA gostaria de fazer?",options:[{value:"commit",label:"\u2705 Fazer commit com esta mensagem",hint:"Executar git commit imediatamente"},{value:"edit",label:"\u270F\uFE0F Editar mensagem",hint:"Modificar a mensagem antes de commitar"},{value:"copy",label:"\uD83D\uDCCB Copiar para clipboard",hint:"Copiar mensagem e sair sem commitar"},{value:"cancel",label:"\u274C Cancelar",hint:"Sair sem fazer nada"}]});if(P(I))return{action:"cancel"};return{action:I}}async function g1(b){let I=await PI({message:"Edite a mensagem do commit:",initialValue:b,placeholder:"Digite a mensagem do commit...",validate:(H)=>{if(!H||H.trim().length===0)return"A mensagem n\xE3o pode estar vazia";if(H.trim().length>72)return"A mensagem est\xE1 muito longa (m\xE1ximo 72 caracteres recomendado)"}});if(P(I))return{action:"cancel"};let $=await g({message:`Confirma a mensagem editada: "${I}"?`});if(P($)||!$)return{action:"cancel"};return{action:"commit",message:I}}async function p1(b){try{return await E9.write(b),V.success("\u2705 Mensagem copiada para a \xE1rea de transfer\xEAncia!"),!0}catch(I){return V.error(`\u274C Erro ao copiar: ${I instanceof Error?I.message:"Erro desconhecido"}`),!1}}async function B$(b){i(`"${b}"`,"\uD83D\uDE80 Confirmar Commit");let I=await g({message:"Executar o commit agora?"});if(P(I))return!1;return I}function k(b,I,$){if(b&&I)V.success("\u2705 Commit realizado com sucesso!"),V.info(`\uD83D\uDD17 Hash: ${I.substring(0,8)}`);else V.error(`\u274C Erro ao realizar commit: ${$||"Erro desconhecido"}`)}async function eb(b){V.info("\uD83D\uDCCB Modo Split: Selecione os arquivos para este commit");let I=[];for(let $ of b){let H=await g({message:`Incluir "${$}" neste commit?`});if(P(H))break;if(H)I.push($)}return I}async function bI(b){if(b.length===0)return!1;V.info(`\uD83D\uDCC4 Arquivos restantes: ${b.join(", ")}`);let I=await g({message:"Gerar commit para os arquivos restantes?"});if(P(I))return!1;return I}function e(){wI("Opera\xE7\xE3o cancelada pelo usu\xE1rio")}var W1=N(()=>{r();y9()});var P9={};b1(P9,{showSmartSplitProgress:()=>O$,showSmartSplitGroups:()=>_$,confirmGroupCommit:()=>M$,chooseSplitMode:()=>GI});async function GI(){let b=await G1({message:"Como voc\xEA gostaria de organizar os commits?",options:[{value:"smart",label:"\uD83E\uDDE0 Smart Split (Recomendado)",hint:"IA analisa contexto e agrupa automaticamente"},{value:"manual",label:"\u270B Split Manual",hint:"Voc\xEA escolhe arquivos manualmente"},{value:"cancel",label:"\u274C Cancelar",hint:"Voltar ao modo normal"}]});if(P(b))return{action:"cancel"};if(b==="manual")return{action:"manual"};if(b==="smart")return{action:"proceed"};return{action:"cancel"}}async function _$(b){i(`Identificamos ${b.length} grupo(s) l\xF3gico(s) para seus commits:
94
-
95
- `+b.map(($,H)=>`${H+1}. **${$.name}**
96
- `+` \uD83D\uDCC4 ${$.files.join(", ")}
97
- `+` \uD83D\uDCA1 ${$.description}
98
- `+` \uD83C\uDFAF Confian\xE7a: ${Math.round($.confidence*100)}%`).join(`
99
-
100
- `),"\uD83E\uDDE0 An\xE1lise de Contexto");let I=await G1({message:"O que voc\xEA gostaria de fazer?",options:[{value:"proceed",label:"\u2705 Prosseguir com esta organiza\xE7\xE3o",hint:"Usar os grupos como sugeridos pela IA"},{value:"manual",label:"\u270B Fazer split manual",hint:"Escolher arquivos manualmente"},{value:"cancel",label:"\u274C Cancelar",hint:"Voltar ao modo normal"}]});if(P(I))return{action:"cancel"};if(I==="proceed")return{action:"proceed",groups:b};return{action:I}}async function M$(b,I){i(`**Grupo:** ${b.name}
101
- **Arquivos:** ${b.files.join(", ")}
102
- **Mensagem:** "${I}"`,"\uD83D\uDE80 Confirmar Commit do Grupo");let $=await g({message:`Fazer commit para "${b.name}"?`});if(P($))return!1;return $}function O$(b,I,$){let H=Math.round(b/I*100),Y="\u2588".repeat(Math.floor(H/10))+"\u2591".repeat(10-Math.floor(H/10));V.info(`\uD83D\uDD04 Progresso: [${Y}] ${H}% (${b}/${I})`),V.info(`\uD83D\uDCCB Processando: ${$}`)}var $I=N(()=>{r()});import A$ from"crypto";class w9{cache=new Map;config;constructor(b){this.config=b}generateHash(b,I){let $={files:b.sort(),diff:I.substring(0,1000),model:this.config.openai.model,temperature:this.config.openai.temperature};return A$.createHash("md5").update(JSON.stringify($)).digest("hex")}get(b,I){if(!this.config.cache.enabled)return{hit:!1};let $=this.generateHash(b,I),H=this.cache.get($);if(!H)return{hit:!1};let Y=Date.now(),X=this.config.cache.ttl*60*1000;if(Y-H.timestamp>X)return this.cache.delete($),{hit:!1};return{hit:!0,groups:H.groups}}set(b,I,$){if(!this.config.cache.enabled)return;if(this.cache.size>=this.config.cache.maxSize)this.cleanup();if(this.cache.size>=this.config.cache.maxSize)return;let H=this.generateHash(b,I),Y={groups:$,timestamp:Date.now(),hash:H};this.cache.set(H,Y)}cleanup(){let b=Date.now(),I=this.config.cache.ttl*60*1000;for(let[$,H]of this.cache.entries())if(b-H.timestamp>I)this.cache.delete($);if(this.cache.size>=this.config.cache.maxSize){let H=Array.from(this.cache.entries()).sort((Y,X)=>Y[1].timestamp-X[1].timestamp).slice(0,Math.ceil(this.config.cache.maxSize*0.5));for(let[Y]of H)this.cache.delete(Y)}}clear(){this.cache.clear()}getStats(){return{size:this.cache.size,maxSize:this.config.cache.maxSize,enabled:this.config.cache.enabled}}}function k9(b){x9=new w9(b)}function F9(){return x9}function v9(b,I){let $=F9();return $?$.get(b,I):{hit:!1}}function C9(b,I,$){let H=F9();if(H)H.set(b,I,$)}var x9=null;var HI=()=>{};function R$(b,I){let H=I.length>8000?I.substring(0,8000)+`
103
- ... (diff truncado)`:I,Y=b.length,X=b.reduce((Z,J)=>{let q=J.split(".").pop()||"sem-extensao";return Z[q]=(Z[q]||0)+1,Z},{}),G=Object.entries(X).map(([Z,J])=>`${Z}: ${J}`).join(", ");return`Analise os arquivos modificados e agrupe em commits l\xF3gicos.
104
-
105
- ARQUIVOS (${Y}): ${b.join(", ")}
106
- TIPOS: ${G}
34
+ - Be descriptive but concise`}},i=t==="pt"?"pt":"en";return o[i][e]||o[i].conventional}function fe(e){let t={feat:/^(feat|feature)(\([^)]+\))?:/i,fix:/^(fix|bugfix)(\([^)]+\))?:/i,docs:/^(docs|documentation)(\([^)]+\))?:/i,style:/^(style|format)(\([^)]+\))?:/i,refactor:/^(refactor|refactoring)(\([^)]+\))?:/i,test:/^(test|testing)(\([^)]+\))?:/i,chore:/^(chore|maintenance)(\([^)]+\))?:/i,build:/^(build|ci)(\([^)]+\))?:/i,ci:/^(ci|continuous-integration)(\([^)]+\))?:/i};for(let[o,i]of Object.entries(t))if(i.test(e))return o;return null}function ge(e,t){let o=e.toLowerCase(),i=t.join(" ").toLowerCase();return i.includes("test")||i.includes("spec")||o.includes("test(")?"test":i.includes("readme")||i.includes(".md")||i.includes("docs")?"docs":i.includes("package.json")||i.includes("dockerfile")||i.includes(".yml")||i.includes(".yaml")||i.includes("webpack")||i.includes("tsconfig")?"build":i.includes(".css")||i.includes(".scss")||o.includes("style")||o.includes("format")?"style":o.includes("fix")||o.includes("bug")||o.includes("error")||o.includes("issue")?"fix":o.includes("add")||o.includes("new")||o.includes("create")||o.includes("implement")?"feat":o.includes("refactor")||o.includes("restructure")||o.includes("rename")?"refactor":"chore"}function he(e){return e.match(/^```[\s\S]*```$/)&&(e=e.replace(/^```(?:plaintext|javascript|typescript|python|java|html|css|json|xml|yaml|yml|bash|shell|text)?\s*/,"").replace(/\s*```$/,"")),e=e.trim(),e}async function ye(e,t,o){try{if(!t.openai.apiKey)return{success:!1,error:"Chave da OpenAI n\xE3o encontrada. Configure OPENAI_API_KEY nas vari\xE1veis de ambiente."};let i=de(e,t,o),n=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${t.openai.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify({model:t.openai.model,messages:[{role:"user",content:i}],max_tokens:Math.min(t.openai.maxTokens,150),temperature:t.openai.temperature})});if(!n.ok){let m=await n.json().catch(()=>({}));return{success:!1,error:`Erro da OpenAI (${n.status}): ${m.error?.message||"Erro desconhecido"}`}}let a=(await n.json()).choices?.[0]?.message?.content?.trim();if(!a)return{success:!1,error:"OpenAI retornou resposta vazia"};a=he(a);let c=fe(a),r=ge(e,o);return{success:!0,suggestion:{message:a,type:c||r,confidence:.8}}}catch(i){return{success:!1,error:`Erro ao conectar com OpenAI: ${i instanceof Error?i.message:"Erro desconhecido"}`}}}async function q(e,t,o,i=3){let n="";for(let s=0;s<i;s++){let a=await ye(e,t,o);if(a.success)return a;n=a.error||"Erro desconhecido",s<i-1&&await new Promise(c=>setTimeout(c,Math.pow(2,s)*1e3))}return{success:!1,error:`Falha ap\xF3s ${i} tentativas. \xDAltimo erro: ${n}`}}var W=b(()=>{"use strict";d()});var Q={};P(Q,{askContinueCommits:()=>Y,confirmCommit:()=>He,copyToClipboard:()=>U,editCommitMessage:()=>L,selectFilesForCommit:()=>B,showCancellation:()=>G,showCommitPreview:()=>N,showCommitResult:()=>C});import{text as Ne,select as Le,confirm as k,log as R,note as Ce,cancel as Ue,isCancel as F}from"@clack/prompts";import _e from"clipboardy";async function N(e){Ce(`Tipo: ${e.type}
35
+ Mensagem: "${e.message}"`,"\u{1F4AD} Sugest\xE3o de Commit");let t=await Le({message:"O que voc\xEA gostaria de fazer?",options:[{value:"commit",label:"\u2705 Fazer commit com esta mensagem",hint:"Executar git commit imediatamente"},{value:"edit",label:"\u270F\uFE0F Editar mensagem",hint:"Modificar a mensagem antes de commitar"},{value:"copy",label:"\u{1F4CB} Copiar para clipboard",hint:"Copiar mensagem e sair sem commitar"},{value:"cancel",label:"\u274C Cancelar",hint:"Sair sem fazer nada"}]});return F(t)?{action:"cancel"}:{action:t}}async function L(e){let t=await Ne({message:"Edite a mensagem do commit:",initialValue:e,placeholder:"Digite a mensagem do commit...",validate:i=>{if(!i||i.trim().length===0)return"A mensagem n\xE3o pode estar vazia";if(i.trim().length>72)return"A mensagem est\xE1 muito longa (m\xE1ximo 72 caracteres recomendado)"}});if(F(t))return{action:"cancel"};let o=await k({message:`Confirma a mensagem editada: "${t}"?`});return F(o)||!o?{action:"cancel"}:{action:"commit",message:t}}async function U(e){try{return await _e.write(e),R.success("\u2705 Mensagem copiada para a \xE1rea de transfer\xEAncia!"),!0}catch(t){return R.error(`\u274C Erro ao copiar: ${t instanceof Error?t.message:"Erro desconhecido"}`),!1}}async function He(e){Ce(`"${e}"`,"\u{1F680} Confirmar Commit");let t=await k({message:"Executar o commit agora?"});return F(t)?!1:t}function C(e,t,o){e&&t?(R.success("\u2705 Commit realizado com sucesso!"),R.info(`\u{1F517} Hash: ${t.substring(0,8)}`)):R.error(`\u274C Erro ao realizar commit: ${o||"Erro desconhecido"}`)}async function B(e){R.info("\u{1F4CB} Modo Split: Selecione os arquivos para este commit");let t=[];for(let o of e){let i=await k({message:`Incluir "${o}" neste commit?`});if(F(i))break;i&&t.push(o)}return t}async function Y(e){if(e.length===0)return!1;R.info(`\u{1F4C4} Arquivos restantes: ${e.join(", ")}`);let t=await k({message:"Gerar commit para os arquivos restantes?"});return F(t)?!1:t}function G(){Ue("Opera\xE7\xE3o cancelada pelo usu\xE1rio")}var D=b(()=>{"use strict";d()});var we={};P(we,{chooseSplitMode:()=>X,confirmGroupCommit:()=>Je,showSmartSplitGroups:()=>Ke,showSmartSplitProgress:()=>We});import{select as ve,confirm as Ve,log as Se,note as be,isCancel as Z}from"@clack/prompts";async function X(){let e=await ve({message:"Como voc\xEA gostaria de organizar os commits?",options:[{value:"smart",label:"\u{1F9E0} Smart Split (Recomendado)",hint:"IA analisa contexto e agrupa automaticamente"},{value:"manual",label:"\u270B Split Manual",hint:"Voc\xEA escolhe arquivos manualmente"},{value:"cancel",label:"\u274C Cancelar",hint:"Voltar ao modo normal"}]});return Z(e)?{action:"cancel"}:e==="manual"?{action:"manual"}:e==="smart"?{action:"proceed"}:{action:"cancel"}}async function Ke(e){be(`Identificamos ${e.length} grupo(s) l\xF3gico(s) para seus commits:
36
+
37
+ `+e.map((o,i)=>`${i+1}. **${o.name}**
38
+ \u{1F4C4} ${o.files.join(", ")}
39
+ \u{1F4A1} ${o.description}
40
+ \u{1F3AF} Confian\xE7a: ${Math.round(o.confidence*100)}%`).join(`
41
+
42
+ `),"\u{1F9E0} An\xE1lise de Contexto");let t=await ve({message:"O que voc\xEA gostaria de fazer?",options:[{value:"proceed",label:"\u2705 Prosseguir com esta organiza\xE7\xE3o",hint:"Usar os grupos como sugeridos pela IA"},{value:"manual",label:"\u270B Fazer split manual",hint:"Escolher arquivos manualmente"},{value:"cancel",label:"\u274C Cancelar",hint:"Voltar ao modo normal"}]});return Z(t)?{action:"cancel"}:t==="proceed"?{action:"proceed",groups:e}:{action:t}}async function Je(e,t){be(`**Grupo:** ${e.name}
43
+ **Arquivos:** ${e.files.join(", ")}
44
+ **Mensagem:** "${t}"`,"\u{1F680} Confirmar Commit do Grupo");let o=await Ve({message:`Fazer commit para "${e.name}"?`});return Z(o)?!1:o}function We(e,t,o){let i=Math.round(e/t*100),n="\u2588".repeat(Math.floor(i/10))+"\u2591".repeat(10-Math.floor(i/10));Se.info(`\u{1F504} Progresso: [${n}] ${i}% (${e}/${t})`),Se.info(`\u{1F4CB} Processando: ${o}`)}var ee=b(()=>{"use strict";d()});import Be from"crypto";function Ae(e){$e=new te(e)}function Ee(){return $e}function Me(e,t){let o=Ee();return o?o.get(e,t):{hit:!1}}function ze(e,t,o){let i=Ee();i&&i.set(e,t,o)}var te,$e,ie=b(()=>{"use strict";d();te=class{cache=new Map;config;constructor(t){this.config=t}generateHash(t,o){let i={files:t.sort(),diff:o.substring(0,1e3),model:this.config.openai.model,temperature:this.config.openai.temperature};return Be.createHash("md5").update(JSON.stringify(i)).digest("hex")}get(t,o){if(!this.config.cache.enabled)return{hit:!1};let i=this.generateHash(t,o),n=this.cache.get(i);if(!n)return{hit:!1};let s=Date.now(),a=this.config.cache.ttl*60*1e3;return s-n.timestamp>a?(this.cache.delete(i),{hit:!1}):{hit:!0,groups:n.groups}}set(t,o,i){if(!this.config.cache.enabled||(this.cache.size>=this.config.cache.maxSize&&this.cleanup(),this.cache.size>=this.config.cache.maxSize))return;let n=this.generateHash(t,o),s={groups:i,timestamp:Date.now(),hash:n};this.cache.set(n,s)}cleanup(){let t=Date.now(),o=this.config.cache.ttl*60*1e3;for(let[i,n]of this.cache.entries())t-n.timestamp>o&&this.cache.delete(i);if(this.cache.size>=this.config.cache.maxSize){let n=Array.from(this.cache.entries()).sort((s,a)=>s[1].timestamp-a[1].timestamp).slice(0,Math.ceil(this.config.cache.maxSize*.5));for(let[s]of n)this.cache.delete(s)}}clear(){this.cache.clear()}getStats(){return{size:this.cache.size,maxSize:this.config.cache.maxSize,enabled:this.config.cache.enabled}}},$e=null});import{log as f}from"@clack/prompts";function Ye(e,t){let i=t.length>8e3?t.substring(0,8e3)+`
45
+ ... (diff truncado)`:t,n=e.length,s=e.reduce((c,r)=>{let m=r.split(".").pop()||"sem-extensao";return c[m]=(c[m]||0)+1,c},{}),a=Object.entries(s).map(([c,r])=>`${c}: ${r}`).join(", ");return`Analise os arquivos modificados e agrupe em commits l\xF3gicos.
46
+
47
+ ARQUIVOS (${n}): ${e.join(", ")}
48
+ TIPOS: ${a}
107
49
 
108
50
  DIFF RESUMIDO:
109
51
  \`\`\`
110
- ${H}
52
+ ${i}
111
53
  \`\`\`
112
54
 
113
55
  Agrupe arquivos relacionados. M\xE1ximo 5 grupos. Responda em JSON:
@@ -121,13 +63,13 @@ Agrupe arquivos relacionados. M\xE1ximo 5 grupos. Responda em JSON:
121
63
  "confidence": 0.8
122
64
  }
123
65
  ]
124
- }`}function E$(b){let I=b.reduce((H,Y)=>{let X=Y.split("/").slice(0,-1).join("/")||"root";if(!H[X])H[X]=[];return H[X].push(Y),H},{});return`Agrupe estes arquivos em commits l\xF3gicos baseado nos diret\xF3rios:
66
+ }`}function Qe(e){let t=e.reduce((i,n)=>{let s=n.split("/").slice(0,-1).join("/")||"root";return i[s]||(i[s]=[]),i[s].push(n),i},{});return`Agrupe estes arquivos em commits l\xF3gicos baseado nos diret\xF3rios:
125
67
 
126
68
  ARQUIVOS POR DIRET\xD3RIO:
127
- ${Object.entries(I).map(([H,Y])=>`${H}: ${Y.length} arquivo(s)`).join(`
69
+ ${Object.entries(t).map(([i,n])=>`${i}: ${n.length} arquivo(s)`).join(`
128
70
  `)}
129
71
 
130
- LISTA COMPLETA: ${b.join(", ")}
72
+ LISTA COMPLETA: ${e.join(", ")}
131
73
 
132
74
  Agrupe por funcionalidade relacionada. M\xE1ximo 5 grupos. JSON:
133
75
  {
@@ -140,35 +82,35 @@ Agrupe por funcionalidade relacionada. M\xE1ximo 5 grupos. JSON:
140
82
  "confidence": 0.7
141
83
  }
142
84
  ]
143
- }`}async function y$(b,I,$){try{if(!$.openai.apiKey)return{success:!1,error:"Chave da OpenAI n\xE3o encontrada"};let H=v9(b,I);if(H.hit&&H.groups)return{success:!0,groups:H.groups};let Y=6000,X=I.length>Y,G=X?E$(b):R$(b,I);if(X)console.warn(`\u26A0\uFE0F Diff muito grande (${I.length} chars), usando an\xE1lise baseada em nomes de arquivos`);let Z=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${$.openai.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify({model:$.openai.model,messages:[{role:"user",content:G}],max_tokens:800,temperature:0.3})});if(!Z.ok){let j=await Z.json().catch(()=>({}));return{success:!1,error:`Erro da OpenAI (${Z.status}): ${j.error?.message||"Erro desconhecido"}`}}let q=(await Z.json()).choices?.[0]?.message?.content?.trim();if(!q)return{success:!1,error:"OpenAI retornou resposta vazia"};let Q=q.match(/\{[\s\S]*\}/);if(!Q)return{success:!1,error:"Resposta da OpenAI n\xE3o cont\xE9m JSON v\xE1lido"};let W=JSON.parse(Q[0]);if(!W.groups||!Array.isArray(W.groups))return{success:!1,error:"Formato de resposta inv\xE1lido da OpenAI"};let z=W.groups.flatMap((j)=>j.files||[]),K=b.filter((j)=>!z.includes(j));if(K.length>0)W.groups[0].files=[...W.groups[0].files||[],...K];let S=W.groups.map((j)=>({id:j.id||`group-${Math.random().toString(36).substr(2,9)}`,name:j.name||"Grupo sem nome",description:j.description||"Sem descri\xE7\xE3o",files:j.files||[],diff:"",confidence:j.confidence||0.5}));return C9(b,I,S),{success:!0,groups:S}}catch(H){return{success:!1,error:`Erro ao analisar contexto: ${H instanceof Error?H.message:"Erro desconhecido"}`}}}async function P$(b){let{getFileDiff:I}=await Promise.resolve().then(() => (D(),c)),$=b.files.map((X)=>{try{let G=I(X),Z=4000;return G.length>4000?G.substring(0,4000)+`
144
- ... (diff truncado)`:G}catch{return""}}).filter((X)=>X.length>0);if($.length===0&&b.files.length>0){let{execSync:X}=await import("child_process"),G=b.files.filter((J)=>{try{return X(`test -f "${J}"`,{stdio:"ignore"}),X(`git status --porcelain -- "${J}"`,{encoding:"utf-8",stdio:"pipe"}).trim().startsWith("??")}catch{return!1}});if(G.length>0)return G.map((J)=>{try{let q=X(`cat "${J}"`,{encoding:"utf-8",stdio:"pipe"}),Q=2000,W=q.length>2000?q.substring(0,2000)+`
145
- ... (conte\xFAdo truncado)`:q;return`diff --git a/${J} b/${J}
85
+ }`}async function Ze(e,t,o){try{if(!o.openai.apiKey)return{success:!1,error:"Chave da OpenAI n\xE3o encontrada"};let i=Me(e,t);if(i.hit&&i.groups)return{success:!0,groups:i.groups};let s=t.length>6e3,a=s?Qe(e):Ye(e,t);s&&console.warn(`\u26A0\uFE0F Diff muito grande (${t.length} chars), usando an\xE1lise baseada em nomes de arquivos`);let c=await fetch("https://api.openai.com/v1/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${o.openai.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify({model:o.openai.model,messages:[{role:"user",content:a}],max_tokens:800,temperature:.3})});if(!c.ok){let p=await c.json().catch(()=>({}));return{success:!1,error:`Erro da OpenAI (${c.status}): ${p.error?.message||"Erro desconhecido"}`}}let m=(await c.json()).choices?.[0]?.message?.content?.trim();if(!m)return{success:!1,error:"OpenAI retornou resposta vazia"};let u=m.match(/\{[\s\S]*\}/);if(!u)return{success:!1,error:"Resposta da OpenAI n\xE3o cont\xE9m JSON v\xE1lido"};let g=JSON.parse(u[0]);if(!g.groups||!Array.isArray(g.groups))return{success:!1,error:"Formato de resposta inv\xE1lido da OpenAI"};let h=g.groups.flatMap(p=>p.files||[]),M=e.filter(p=>!h.includes(p));M.length>0&&(g.groups[0].files=[...g.groups[0].files||[],...M]);let y=g.groups.map(p=>({id:p.id||`group-${Math.random().toString(36).substr(2,9)}`,name:p.name||"Grupo sem nome",description:p.description||"Sem descri\xE7\xE3o",files:p.files||[],diff:"",confidence:p.confidence||.5}));return ze(e,t,y),{success:!0,groups:y}}catch(i){return{success:!1,error:`Erro ao analisar contexto: ${i instanceof Error?i.message:"Erro desconhecido"}`}}}async function Xe(e){let{getFileDiff:t}=await Promise.resolve().then(()=>(S(),E)),o=e.files.map(s=>{try{let a=t(s),c=4e3;return a.length>c?a.substring(0,c)+`
86
+ ... (diff truncado)`:a}catch{return""}}).filter(s=>s.length>0);if(o.length===0&&e.files.length>0){let{execSync:s}=await import("child_process"),a=e.files.filter(r=>{try{return s(`test -f "${r}"`,{stdio:"ignore"}),s(`git status --porcelain -- "${r}"`,{encoding:"utf-8",stdio:"pipe"}).trim().startsWith("??")}catch{return!1}});if(a.length>0)return a.map(r=>{try{let m=s(`cat "${r}"`,{encoding:"utf-8",stdio:"pipe"}),u=2e3,g=m.length>u?m.substring(0,u)+`
87
+ ... (conte\xFAdo truncado)`:m;return`diff --git a/${r} b/${r}
146
88
  new file mode 100644
147
89
  index 0000000..${Math.random().toString(36).substr(2,7)}
148
90
  --- /dev/null
149
- +++ b/${J}
150
- @@ -0,0 +1,${W.split(`
91
+ +++ b/${r}
92
+ @@ -0,0 +1,${g.split(`
151
93
  `).length} @@
152
- ${W.split(`
153
- `).map((z)=>`+${z}`).join(`
154
- `)}`}catch{return""}}).filter((J)=>J.length>0).join(`
155
- `);let Z=b.files.filter((J)=>{try{return X(`test -f "${J}"`,{stdio:"ignore"}),X("git diff --cached --name-only",{encoding:"utf-8",stdio:"pipe"}).trim().split(`
156
- `).includes(J)}catch{return!1}});if(Z.length>0)return Z.map((J)=>{try{let q=X(`cat "${J}"`,{encoding:"utf-8",stdio:"pipe"}),Q=2000,W=q.length>2000?q.substring(0,2000)+`
157
- ... (conte\xFAdo truncado)`:q;return`diff --git a/${J} b/${J}
94
+ ${g.split(`
95
+ `).map(h=>`+${h}`).join(`
96
+ `)}`}catch{return""}}).filter(r=>r.length>0).join(`
97
+ `);let c=e.files.filter(r=>{try{return s(`test -f "${r}"`,{stdio:"ignore"}),s("git diff --cached --name-only",{encoding:"utf-8",stdio:"pipe"}).trim().split(`
98
+ `).includes(r)}catch{return!1}});if(c.length>0)return c.map(r=>{try{let m=s(`cat "${r}"`,{encoding:"utf-8",stdio:"pipe"}),u=2e3,g=m.length>u?m.substring(0,u)+`
99
+ ... (conte\xFAdo truncado)`:m;return`diff --git a/${r} b/${r}
158
100
  index 0000000..${Math.random().toString(36).substr(2,7)} 100644
159
- --- a/${J}
160
- +++ b/${J}
161
- @@ -1 +1,${W.split(`
101
+ --- a/${r}
102
+ +++ b/${r}
103
+ @@ -1 +1,${g.split(`
162
104
  `).length} @@
163
- ${W.split(`
164
- `).map((z)=>`+${z}`).join(`
165
- `)}`}catch{return""}}).filter((J)=>J.length>0).join(`
166
- `)}let H=$.join(`
167
- `),Y=8000;return H.length>Y?H.substring(0,Y)+`
168
- ... (diff total truncado)`:H}async function YI(b,I,$){if(!$.silent)V.info("\uD83E\uDDE0 Modo Smart Split ativado - Agrupando arquivos por contexto");if(!$.silent)V.info("\uD83E\uDD16 Analisando contexto das mudan\xE7as...");let H=await y$(b.stagedFiles,b.diff,I);if(!H.success){if(!$.silent)V.error(`\u274C Erro na an\xE1lise de contexto: ${H.error}`);return}if(!H.groups||H.groups.length===0){if(!$.silent)V.error("\u274C Nenhum grupo foi criado pela an\xE1lise");return}if(!$.silent)V.success(`\u2705 ${H.groups.length} grupo(s) identificado(s):`),H.groups.forEach((Y,X)=>{V.info(` ${X+1}. ${Y.name} (${Y.files.length} arquivo(s))`),V.info(` \uD83D\uDCC4 ${Y.files.join(", ")}`)});if(!$.yes&&!$.silent){let{showSmartSplitGroups:Y}=await Promise.resolve().then(() => ($I(),P9)),X=await Y(H.groups);if(X.action==="cancel"){if(!$.silent)V.info("\u274C Opera\xE7\xE3o cancelada pelo usu\xE1rio");return}if(X.action==="manual"){let G={...$,split:!0,smartSplit:!1},{main:Z}=await Promise.resolve().then(() => (XI(),m9));await Z(G);return}}for(let Y=0;Y<H.groups.length;Y++){let X=H.groups[Y];if(!X){if(!$.silent)V.error(`\u274C Grupo ${Y+1} \xE9 undefined`);continue}if(!$.silent)V.info(`
169
- \uD83D\uDD04 Processando grupo ${Y+1}/${H.groups.length}: ${X.name}`);let G=await P$(X);if(!G){if(!$.silent)V.warn(`\u26A0\uFE0F Nenhum diff encontrado para o grupo: ${X.name}`),V.info(` \uD83D\uDCC4 Arquivos: ${X.files.join(", ")}`),V.info(" \uD83D\uDCA1 Poss\xEDvel causa: arquivos novos, deletados/recriados, ou sem mudan\xE7as");continue}if(!$.silent)V.info(`\uD83E\uDD16 Gerando commit para: ${X.name}`);let{generateWithRetry:Z}=await Promise.resolve().then(() => eI),J=await Z(G,I,X.files);if(!J.success){if(!$.silent)V.error(`\u274C Erro ao gerar commit para ${X.name}: ${J.error}`);continue}if(!J.suggestion){if(!$.silent)V.error(`\u274C Nenhuma sugest\xE3o gerada para ${X.name}`);continue}if(I.dryRun){if(!$.silent)V.info(`\uD83D\uDD0D Dry Run - Grupo: ${X.name}`),V.info(`\uD83D\uDCC4 Arquivos: ${X.files.join(", ")}`),V.info(`\uD83D\uDCAD Mensagem: "${J.suggestion.message}"`);continue}if($.yes){let{executeFileCommit:q}=await Promise.resolve().then(() => (D(),c)),Q;if(X.files.length===1&&X.files[0])Q=q(X.files[0],J.suggestion.message||"");else{let{execSync:W}=await import("child_process"),{escapeShellArg:z}=await Promise.resolve().then(() => (D(),c));try{let K=X.files.map((_)=>z(_)).join(" "),S=z(J.suggestion.message||"");W(`git commit ${K} -m ${S}`,{stdio:"pipe"}),Q={success:!0,hash:W("git rev-parse HEAD",{encoding:"utf-8",stdio:"pipe"}).trim(),message:J.suggestion.message||""}}catch(K){Q={success:!1,error:K instanceof Error?K.message:"Erro desconhecido ao executar commit"}}}k(Q.success,Q.hash,Q.error)}else{let{showCommitPreview:q,editCommitMessage:Q,copyToClipboard:W,showCancellation:z}=await Promise.resolve().then(() => (W1(),II));switch((await q(J.suggestion)).action){case"commit":{let{executeFileCommit:S}=await Promise.resolve().then(() => (D(),c)),j,_=J.suggestion.message||"Atualiza\xE7\xE3o de arquivos";if(X.files.length===1&&X.files[0])j=S(X.files[0],_);else{let{execSync:h}=await import("child_process"),{escapeShellArg:m}=await Promise.resolve().then(() => (D(),c));try{let R=X.files.map((l)=>m(l)).join(" "),n=m(_);h(`git commit ${R} -m ${n}`,{stdio:"pipe"}),j={success:!0,hash:h("git rev-parse HEAD",{encoding:"utf-8",stdio:"pipe"}).trim(),message:_}}catch(R){j={success:!1,error:R instanceof Error?R.message:"Erro desconhecido ao executar commit"}}}k(j.success,j.hash,j.error);break}case"edit":{let S=await Q(J.suggestion.message);if(S.action==="commit"&&S.message){let{executeFileCommit:j}=await Promise.resolve().then(() => (D(),c)),_;if(X.files.length===1&&X.files[0])_=j(X.files[0],S.message||"");else{let{execSync:h}=await import("child_process"),{escapeShellArg:m}=await Promise.resolve().then(() => (D(),c));try{let R=X.files.map((l)=>m(l)).join(" "),n=m(S.message||"");h(`git commit ${R} -m ${n}`,{stdio:"pipe"}),_={success:!0,hash:h("git rev-parse HEAD",{encoding:"utf-8",stdio:"pipe"}).trim(),message:S.message||""}}catch(R){_={success:!1,error:R instanceof Error?R.message:"Erro desconhecido ao executar commit"}}}k(_.success,_.hash,_.error)}break}case"copy":{if(await W(J.suggestion.message),!$.silent)V.info("\uD83C\uDFAF Mensagem copiada para clipboard");break}case"cancel":{z();return}}}if(Y<H.groups.length-1&&!$.yes){let{askContinueCommits:q}=await Promise.resolve().then(() => (W1(),II)),Q=H.groups.slice(Y+1).filter((z)=>z!==void 0).map((z)=>z.name);if(!await q(Q))break}}if(!$.silent)V.success("\u2705 Smart Split conclu\xEDdo!")}var h9=N(()=>{HI();W1();r()});var m9={};b1(m9,{main:()=>ZI});async function ZI(b={silent:!1,yes:!1,auto:!1,split:!1,smartSplit:!1,dryRun:!1,help:!1,version:!1}){if(!b.silent)V.info("\uD83D\uDE80 Commit Wizard iniciado!");if(!Vb()){if(V.error("\u274C N\xE3o foi encontrado um reposit\xF3rio Git neste diret\xF3rio."),!b.silent)V.info("\uD83D\uDCA1 Execute o comando em um diret\xF3rio com reposit\xF3rio Git inicializado.");process.exit(1)}if(!b.silent)V.info("\u2699\uFE0F Carregando configura\xE7\xE3o...");let I=nI();if(k9(I),b.split)I.splitCommits=!0;if(b.dryRun)I.dryRun=!0;let $=lI(I);if($.length>0)V.error("\u274C Erros na configura\xE7\xE3o:"),$.forEach((G)=>V.error(` \u2022 ${G}`)),process.exit(1);if(!b.silent)V.success(`\u2705 Configura\xE7\xE3o carregada (modelo: ${I.openai.model}, idioma: ${I.language})`);if(!b.silent)V.info("\uD83D\uDCCB Verificando arquivos staged...");let H=Wb();if(!H.hasStaged){if(V.warn("\u26A0\uFE0F Nenhum arquivo foi encontrado no stage."),!b.silent)V.info("\uD83D\uDCA1 Use `git add <arquivo>` para adicionar arquivos ao stage antes de gerar o commit.");process.exit(0)}let Y=zb();if(!b.silent)V.success(`\u2705 Encontrados ${H.stagedFiles.length} arquivo(s) staged:`),H.stagedFiles.forEach((G)=>V.info(` \uD83D\uDCC4 ${G}`)),V.info(`\uD83D\uDCCA Estat\xEDsticas: +${Y.added} -${Y.removed} linhas`);if(I.splitCommits||b.smartSplit)if(b.yes)return await YI(H,I,b);else switch((await GI()).action){case"proceed":return await YI(H,I,b);case"manual":return await w$(H,I,b);case"cancel":e();return}if(!b.silent)V.info("\uD83E\uDD16 Gerando mensagem de commit com IA...");let X=await M1(H.diff,I,H.stagedFiles);if(!X.success)V.error(`\u274C Erro ao gerar commit: ${X.error}`),process.exit(1);if(!X.suggestion)V.error("\u274C Nenhuma sugest\xE3o foi gerada"),process.exit(1);if(!b.silent)V.success("\u2728 Mensagem de commit gerada!");if(I.dryRun){V.info("\uD83D\uDD0D Modo Dry Run - Mensagem gerada:"),V.info(`"${X.suggestion.message}"`),V.info("\uD83D\uDCA1 Execute sem --dry-run para fazer o commit");return}if(b.yes){let G=u(X.suggestion.message);k(G.success,G.hash,G.error);return}while(!0)switch((await u1(X.suggestion)).action){case"commit":{let Z=u(X.suggestion.message);k(Z.success,Z.hash,Z.error);return}case"edit":{let Z=await g1(X.suggestion.message);if(Z.action==="cancel"){e();return}if(Z.action==="commit"&&Z.message){let J=u(Z.message);k(J.success,J.hash,J.error);return}break}case"copy":{if(await p1(X.suggestion.message),!b.silent)V.info('\uD83C\uDFAF Voc\xEA pode usar a mensagem copiada com: git commit -m "mensagem"');return}case"cancel":{e();return}}}async function w$(b,I,$){if(!$.silent)V.info("\uD83D\uDD04 Modo Split ativado - Commits separados por arquivo");let H=[...b.stagedFiles];while(H.length>0){let Y=$.yes?[H[0]]:await eb(H);if(Y.length===0){if(!$.silent)V.info("\u274C Nenhum arquivo selecionado");break}let{getFileDiff:X}=await Promise.resolve().then(() => (D(),c)),G=Y.filter((J)=>J!==void 0).map((J)=>{try{return X(J)}catch(q){return V.error(`\u274C Erro ao obter diff do arquivo ${J}: ${q instanceof Error?q.message:"Erro desconhecido"}`),""}}).filter((J)=>J.length>0).join(`
170
- `);if(!G){if(!$.silent)V.warn("\u26A0\uFE0F Nenhum diff encontrado para os arquivos selecionados");H=H.filter((J)=>!Y.includes(J));continue}if(!$.silent)V.info(`\uD83E\uDD16 Gerando commit para: ${Y.join(", ")}`);let Z=await M1(G,I,Y.filter((J)=>J!==void 0));if(!Z.success){V.error(`\u274C Erro ao gerar commit: ${Z.error}`),H=H.filter((J)=>!Y.includes(J));continue}if(!Z.suggestion){V.error("\u274C Nenhuma sugest\xE3o foi gerada"),H=H.filter((J)=>!Y.includes(J));continue}if(I.dryRun){V.info(`\uD83D\uDD0D Dry Run - Mensagem para ${Y.join(", ")}:`),V.info(`"${Z.suggestion.message}"`),H=H.filter((J)=>!Y.includes(J));continue}if($.yes){let J=Y.length===1&&Y[0]?await H1(Y[0],Z.suggestion.message):await u(Z.suggestion.message);k(J.success,J.hash,J.error)}else{let J=await u1(Z.suggestion);if(J.action==="commit"){let q=Y.length===1&&Y[0]?await H1(Y[0],Z.suggestion.message):await u(Z.suggestion.message);k(q.success,q.hash,q.error)}else if(J.action==="edit"){let q=await g1(Z.suggestion.message);if(q.action==="commit"&&q.message){let Q=Y.length===1&&Y[0]?await H1(Y[0],q.message):await u(q.message);k(Q.success,Q.hash,Q.error)}}else if(J.action==="copy"){if(await p1(Z.suggestion.message),!$.silent)V.info("\uD83C\uDFAF Mensagem copiada para clipboard")}else if(J.action==="cancel"){e();return}}if(H=H.filter((J)=>!Y.includes(J)),H.length>0&&!$.yes){if(!await bI(H))break}}if(!$.silent)V.success("\u2705 Modo Split conclu\xEDdo!")}var XI=N(()=>{r();aI();D();W1();$I();h9();HI()});r();XI();function D9(b){return{silent:b.includes("--silent")||b.includes("-s"),yes:b.includes("--yes")||b.includes("-y"),auto:b.includes("--auto")||b.includes("-a"),split:b.includes("--split"),smartSplit:b.includes("--smart-split"),dryRun:b.includes("--dry-run")||b.includes("-n"),help:b.includes("--help")||b.includes("-h"),version:b.includes("--version")||b.includes("-v")}}function f9(){console.log(`
171
- \uD83E\uDDD9\u200D\u2642\uFE0F Commit Wizard - Gerador inteligente de mensagens de commit
105
+ ${g.split(`
106
+ `).map(h=>`+${h}`).join(`
107
+ `)}`}catch{return""}}).filter(r=>r.length>0).join(`
108
+ `)}let i=o.join(`
109
+ `),n=8e3;return i.length>n?i.substring(0,n)+`
110
+ ... (diff total truncado)`:i}async function oe(e,t,o){o.silent||f.info("\u{1F9E0} Modo Smart Split ativado - Agrupando arquivos por contexto"),o.silent||f.info("\u{1F916} Analisando contexto das mudan\xE7as...");let i=await Ze(e.stagedFiles,e.diff,t);if(!i.success){o.silent||f.error(`\u274C Erro na an\xE1lise de contexto: ${i.error}`);return}if(!i.groups||i.groups.length===0){o.silent||f.error("\u274C Nenhum grupo foi criado pela an\xE1lise");return}if(o.silent||(f.success(`\u2705 ${i.groups.length} grupo(s) identificado(s):`),i.groups.forEach((n,s)=>{f.info(` ${s+1}. ${n.name} (${n.files.length} arquivo(s))`),f.info(` \u{1F4C4} ${n.files.join(", ")}`)})),!o.yes&&!o.silent){let{showSmartSplitGroups:n}=await Promise.resolve().then(()=>(ee(),we)),s=await n(i.groups);if(s.action==="cancel"){o.silent||f.info("\u274C Opera\xE7\xE3o cancelada pelo usu\xE1rio");return}if(s.action==="manual"){let a={...o,split:!0,smartSplit:!1},{main:c}=await Promise.resolve().then(()=>(se(),Fe));await c(a);return}}for(let n=0;n<i.groups.length;n++){let s=i.groups[n];if(!s){o.silent||f.error(`\u274C Grupo ${n+1} \xE9 undefined`);continue}o.silent||f.info(`
111
+ \u{1F504} Processando grupo ${n+1}/${i.groups.length}: ${s.name}`);let a=await Xe(s);if(!a){o.silent||(f.warn(`\u26A0\uFE0F Nenhum diff encontrado para o grupo: ${s.name}`),f.info(` \u{1F4C4} Arquivos: ${s.files.join(", ")}`),f.info(" \u{1F4A1} Poss\xEDvel causa: arquivos novos, deletados/recriados, ou sem mudan\xE7as"));continue}o.silent||f.info(`\u{1F916} Gerando commit para: ${s.name}`);let{generateWithRetry:c}=await Promise.resolve().then(()=>(W(),xe)),r=await c(a,t,s.files);if(!r.success){o.silent||f.error(`\u274C Erro ao gerar commit para ${s.name}: ${r.error}`);continue}if(!r.suggestion){o.silent||f.error(`\u274C Nenhuma sugest\xE3o gerada para ${s.name}`);continue}if(t.dryRun){o.silent||(f.info(`\u{1F50D} Dry Run - Grupo: ${s.name}`),f.info(`\u{1F4C4} Arquivos: ${s.files.join(", ")}`),f.info(`\u{1F4AD} Mensagem: "${r.suggestion.message}"`));continue}if(o.yes){let{executeFileCommit:m}=await Promise.resolve().then(()=>(S(),E)),u;if(s.files.length===1&&s.files[0])u=m(s.files[0],r.suggestion.message||"");else{let{execSync:g}=await import("child_process"),{escapeShellArg:h}=await Promise.resolve().then(()=>(S(),E));try{let M=s.files.map(x=>h(x)).join(" "),y=h(r.suggestion.message||"");g(`git commit ${M} -m ${y}`,{stdio:"pipe"}),u={success:!0,hash:g("git rev-parse HEAD",{encoding:"utf-8",stdio:"pipe"}).trim(),message:r.suggestion.message||""}}catch(M){u={success:!1,error:M instanceof Error?M.message:"Erro desconhecido ao executar commit"}}}C(u.success,u.hash,u.error)}else{let{showCommitPreview:m,editCommitMessage:u,copyToClipboard:g,showCancellation:h}=await Promise.resolve().then(()=>(D(),Q));switch((await m(r.suggestion)).action){case"commit":{let{executeFileCommit:y}=await Promise.resolve().then(()=>(S(),E)),p,x=r.suggestion.message||"Atualiza\xE7\xE3o de arquivos";if(s.files.length===1&&s.files[0])p=y(s.files[0],x);else{let{execSync:I}=await import("child_process"),{escapeShellArg:O}=await Promise.resolve().then(()=>(S(),E));try{let v=s.files.map(H=>O(H)).join(" "),_=O(x);I(`git commit ${v} -m ${_}`,{stdio:"pipe"}),p={success:!0,hash:I("git rev-parse HEAD",{encoding:"utf-8",stdio:"pipe"}).trim(),message:x}}catch(v){p={success:!1,error:v instanceof Error?v.message:"Erro desconhecido ao executar commit"}}}C(p.success,p.hash,p.error);break}case"edit":{let y=await u(r.suggestion.message);if(y.action==="commit"&&y.message){let{executeFileCommit:p}=await Promise.resolve().then(()=>(S(),E)),x;if(s.files.length===1&&s.files[0])x=p(s.files[0],y.message||"");else{let{execSync:I}=await import("child_process"),{escapeShellArg:O}=await Promise.resolve().then(()=>(S(),E));try{let v=s.files.map(H=>O(H)).join(" "),_=O(y.message||"");I(`git commit ${v} -m ${_}`,{stdio:"pipe"}),x={success:!0,hash:I("git rev-parse HEAD",{encoding:"utf-8",stdio:"pipe"}).trim(),message:y.message||""}}catch(v){x={success:!1,error:v instanceof Error?v.message:"Erro desconhecido ao executar commit"}}}C(x.success,x.hash,x.error)}break}case"copy":{await g(r.suggestion.message),o.silent||f.info("\u{1F3AF} Mensagem copiada para clipboard");break}case"cancel":{h();return}}}if(n<i.groups.length-1&&!o.yes){let{askContinueCommits:m}=await Promise.resolve().then(()=>(D(),Q)),u=i.groups.slice(n+1).filter(h=>h!==void 0).map(h=>h.name);if(!await m(u))break}}o.silent||f.success("\u2705 Smart Split conclu\xEDdo!")}var Re=b(()=>{"use strict";d();ie();D()});var Fe={};P(Fe,{main:()=>ne});import{log as l}from"@clack/prompts";async function ne(e={silent:!1,yes:!1,auto:!1,split:!1,smartSplit:!1,dryRun:!1,help:!1,version:!1}){e.silent||l.info("\u{1F680} Commit Wizard iniciado!"),V()||(l.error("\u274C N\xE3o foi encontrado um reposit\xF3rio Git neste diret\xF3rio."),e.silent||l.info("\u{1F4A1} Execute o comando em um diret\xF3rio com reposit\xF3rio Git inicializado."),process.exit(1)),e.silent||l.info("\u2699\uFE0F Carregando configura\xE7\xE3o...");let t=le();Ae(t),e.split&&(t.splitCommits=!0),e.dryRun&&(t.dryRun=!0);let o=ue(t);o.length>0&&(l.error("\u274C Erros na configura\xE7\xE3o:"),o.forEach(a=>l.error(` \u2022 ${a}`)),process.exit(1)),e.silent||l.success(`\u2705 Configura\xE7\xE3o carregada (modelo: ${t.openai.model}, idioma: ${t.language})`),e.silent||l.info("\u{1F4CB} Verificando arquivos staged...");let i=K();i.hasStaged||(l.warn("\u26A0\uFE0F Nenhum arquivo foi encontrado no stage."),e.silent||l.info("\u{1F4A1} Use `git add <arquivo>` para adicionar arquivos ao stage antes de gerar o commit."),process.exit(0));let n=J();if(e.silent||(l.success(`\u2705 Encontrados ${i.stagedFiles.length} arquivo(s) staged:`),i.stagedFiles.forEach(a=>l.info(` \u{1F4C4} ${a}`)),l.info(`\u{1F4CA} Estat\xEDsticas: +${n.added} -${n.removed} linhas`)),t.splitCommits||e.smartSplit){if(e.yes)return await oe(i,t,e);switch((await X()).action){case"proceed":return await oe(i,t,e);case"manual":return await et(i,t,e);case"cancel":G();return}}e.silent||l.info("\u{1F916} Gerando mensagem de commit com IA...");let s=await q(i.diff,t,i.stagedFiles);if(s.success||(l.error(`\u274C Erro ao gerar commit: ${s.error}`),process.exit(1)),s.suggestion||(l.error("\u274C Nenhuma sugest\xE3o foi gerada"),process.exit(1)),e.silent||l.success("\u2728 Mensagem de commit gerada!"),t.dryRun){l.info("\u{1F50D} Modo Dry Run - Mensagem gerada:"),l.info(`"${s.suggestion.message}"`),l.info("\u{1F4A1} Execute sem --dry-run para fazer o commit");return}if(e.yes){let a=z(s.suggestion.message);C(a.success,a.hash,a.error);return}for(;;)switch((await N(s.suggestion)).action){case"commit":{let c=z(s.suggestion.message);C(c.success,c.hash,c.error);return}case"edit":{let c=await L(s.suggestion.message);if(c.action==="cancel"){G();return}if(c.action==="commit"&&c.message){let r=z(c.message);C(r.success,r.hash,r.error);return}break}case"copy":{await U(s.suggestion.message),e.silent||l.info('\u{1F3AF} Voc\xEA pode usar a mensagem copiada com: git commit -m "mensagem"');return}case"cancel":{G();return}}}async function et(e,t,o){o.silent||l.info("\u{1F504} Modo Split ativado - Commits separados por arquivo");let i=[...e.stagedFiles];for(;i.length>0;){let n=o.yes?[i[0]]:await B(i);if(n.length===0){o.silent||l.info("\u274C Nenhum arquivo selecionado");break}let{getFileDiff:s}=await Promise.resolve().then(()=>(S(),E)),a=n.filter(r=>r!==void 0).map(r=>{try{return s(r)}catch(m){return l.error(`\u274C Erro ao obter diff do arquivo ${r}: ${m instanceof Error?m.message:"Erro desconhecido"}`),""}}).filter(r=>r.length>0).join(`
112
+ `);if(!a){o.silent||l.warn("\u26A0\uFE0F Nenhum diff encontrado para os arquivos selecionados"),i=i.filter(r=>!n.includes(r));continue}o.silent||l.info(`\u{1F916} Gerando commit para: ${n.join(", ")}`);let c=await q(a,t,n.filter(r=>r!==void 0));if(!c.success){l.error(`\u274C Erro ao gerar commit: ${c.error}`),i=i.filter(r=>!n.includes(r));continue}if(!c.suggestion){l.error("\u274C Nenhuma sugest\xE3o foi gerada"),i=i.filter(r=>!n.includes(r));continue}if(t.dryRun){l.info(`\u{1F50D} Dry Run - Mensagem para ${n.join(", ")}:`),l.info(`"${c.suggestion.message}"`),i=i.filter(r=>!n.includes(r));continue}if(o.yes){let r=n.length===1&&n[0]?await j(n[0],c.suggestion.message):await z(c.suggestion.message);C(r.success,r.hash,r.error)}else{let r=await N(c.suggestion);if(r.action==="commit"){let m=n.length===1&&n[0]?await j(n[0],c.suggestion.message):await z(c.suggestion.message);C(m.success,m.hash,m.error)}else if(r.action==="edit"){let m=await L(c.suggestion.message);if(m.action==="commit"&&m.message){let u=n.length===1&&n[0]?await j(n[0],m.message):await z(m.message);C(u.success,u.hash,u.error)}}else if(r.action==="copy")await U(c.suggestion.message),o.silent||l.info("\u{1F3AF} Mensagem copiada para clipboard");else if(r.action==="cancel"){G();return}}if(i=i.filter(r=>!n.includes(r)),i.length>0&&!o.yes&&!await Y(i))break}o.silent||l.success("\u2705 Modo Split conclu\xEDdo!")}var se=b(()=>{"use strict";d();pe();S();W();D();ee();Re();ie()});d();se();import{intro as tt,outro as it,log as ot}from"@clack/prompts";d();function Ge(e){return{silent:e.includes("--silent")||e.includes("-s"),yes:e.includes("--yes")||e.includes("-y"),auto:e.includes("--auto")||e.includes("-a"),split:e.includes("--split"),smartSplit:e.includes("--smart-split"),dryRun:e.includes("--dry-run")||e.includes("-n"),help:e.includes("--help")||e.includes("-h"),version:e.includes("--version")||e.includes("-v")}}function Ie(){console.log(`
113
+ \u{1F9D9}\u200D\u2642\uFE0F Commit Wizard - Gerador inteligente de mensagens de commit
172
114
 
173
115
  USAGE:
174
116
  commit-wizard [OPTIONS]
@@ -192,4 +134,4 @@ EXAMPLES:
192
134
  commit-wizard --auto # Modo totalmente autom\xE1tico
193
135
 
194
136
  Para mais informa\xE7\xF5es, visite: https://github.com/user/commit-wizard
195
- `)}function d9(){console.log("commit-wizard v1.0.0")}async function x$(){try{let b=D9(process.argv.slice(2));if(b.help)f9(),process.exit(0);if(b.version)d9(),process.exit(0);if(b.auto)b.silent=!0,b.yes=!0;if(!b.silent)xI("\uD83E\uDDD9\u200D\u2642\uFE0F Commit Wizard");if(await ZI(b),!b.silent)kI("At\xE9 logo! \u2728")}catch(b){V.error(`Erro: ${b instanceof Error?b.message:"Erro desconhecido"}`),process.exit(1)}}if(import.meta.main)x$();
137
+ `)}function Oe(){console.log("commit-wizard v1.0.0")}async function st(){try{let e=Ge(process.argv.slice(2));e.help&&(Ie(),process.exit(0)),e.version&&(Oe(),process.exit(0)),e.auto&&(e.silent=!0,e.yes=!0),e.silent||tt("\u{1F9D9}\u200D\u2642\uFE0F Commit Wizard"),await ne(e),e.silent||it("At\xE9 logo! \u2728")}catch(e){ot.error(`Erro: ${e instanceof Error?e.message:"Erro desconhecido"}`),process.exit(1)}}import.meta.url===`file://${process.argv[1]}`&&st();
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "displayName": "Commit Wizard",
4
4
  "publisher": "gilbert-oliveira",
5
5
  "description": "CLI inteligente para gerar mensagens de commit usando OpenAI",
6
- "version": "2.0.3",
6
+ "version": "2.1.0",
7
7
  "categories": [
8
8
  "Other",
9
9
  "SCM Providers"
@@ -15,26 +15,23 @@
15
15
  "commit-wizard": "./dist/commit-wizard.js"
16
16
  },
17
17
  "scripts": {
18
- "dev": "bun run bin/commit-wizard.ts",
19
- "build": "bun build bin/commit-wizard.ts --outdir=dist --target=bun --minify",
20
- "test": "bun test",
21
- "test:watch": "bun test --watch",
22
- "test:coverage": "bun test && node scripts/generate-lcov.js",
23
- "test:coverage:report": "c8 --reporter=html --reporter=text --include='src/**/*.ts' --exclude='**/*.test.ts' bun test && open coverage/lcov-report/index.html",
24
- "prepublishOnly": "bun run build && bun test",
25
- "start": "bun run bin/commit-wizard.ts",
26
- "ci:test": "bun test --reporter=verbose",
27
- "ci:build": "bun run build",
28
- "ci:lint": "bun run tsc --noEmit",
29
- "ci:security": "bun audit",
30
- "ci:integration": "bun test tests/integration.test.ts tests/smart-split.test.ts",
18
+ "dev": "npm run build && node dist/commit-wizard.js",
19
+ "build": "tsup src/bin/commit-wizard.ts --format esm --dts --out-dir dist --clean --minify --splitting false --shims",
20
+ "build:tsc": "tsc --project tsconfig.json",
21
+ "start": "node dist/commit-wizard.js",
22
+ "test": "vitest run",
23
+ "test:watch": "vitest",
24
+ "test:coverage": "vitest run --coverage",
25
+ "test:integration": "vitest run tests/integration.test.ts",
26
+ "test:ci": "vitest run --coverage.enabled --coverage.reporter=lcov --reporter=junit --outputFile=coverage/test-report.junit.xml",
27
+ "lint": "eslint . --ext .ts",
28
+ "format": "prettier --write .",
29
+ "ci:test": "vitest run",
30
+ "ci:build": "npm run build",
31
31
  "release:patch": "./scripts/release.sh patch",
32
32
  "release:minor": "./scripts/release.sh minor",
33
33
  "release:major": "./scripts/release.sh major",
34
- "check-changes": "node -e \"const { execSync } = require('child_process'); const changed = execSync('git diff --name-only HEAD~1 HEAD', { encoding: 'utf8' }).includes('package.json') || execSync('git diff --name-only HEAD~1 HEAD', { encoding: 'utf8' }).match(/(src|bin|scripts|dist)/\\.*/); console.log(changed ? '🚀 Mudanças detectadas - deploy recomendado!' : '⚠️ Nenhuma mudança significativa detectada'); process.exit(changed ? 0 : 1);\"",
35
- "type-check": "bun run tsc --noEmit",
36
- "lint": "bun run eslint --fix",
37
- "format": "bun run prettier --write ."
34
+ "check-changes": "node -e \"const { execSync } = require('child_process'); const changed = execSync('git diff --name-only HEAD~1 HEAD', { encoding: 'utf8' }).includes('package.json') || execSync('git diff --name-only HEAD~1 HEAD', { encoding: 'utf8' }).match(/(src|bin|scripts|dist)/\\.*/); console.log(changed ? '🚀 Mudanças detectadas - deploy recomendado!' : '⚠️ Nenhuma mudança significativa detectada'); process.exit(changed ? 0 : 1);\""
38
35
  },
39
36
  "keywords": [
40
37
  "git",
@@ -56,13 +53,13 @@
56
53
  },
57
54
  "homepage": "https://github.com/gilbert-oliveira/commit-wizard#readme",
58
55
  "engines": {
59
- "node": ">=18.0.0",
60
- "bun": ">=1.0.0"
56
+ "node": ">=18.0.0"
61
57
  },
62
58
  "files": [
63
59
  "bin/",
64
60
  "src/",
65
61
  "dist/",
62
+ "dist-node/",
66
63
  "README.md",
67
64
  "LICENSE",
68
65
  ".commit-wizardrc"
@@ -70,18 +67,25 @@
70
67
  "dependencies": {
71
68
  "@clack/prompts": "^0.11.0",
72
69
  "clipboardy": "^4.0.0",
73
- "simple-git": "^3.25.0",
74
- "dotenv": "^17.2.0"
70
+ "dotenv": "^17.2.0",
71
+ "simple-git": "^3.25.0"
75
72
  },
76
73
  "devDependencies": {
77
- "@types/bun": "latest",
74
+ "@types/jest": "^30.0.0",
78
75
  "@types/node": "^24.0.13",
79
76
  "@typescript-eslint/eslint-plugin": "^8.36.0",
80
77
  "@typescript-eslint/parser": "^8.36.0",
81
- "c8": "^10.1.3",
78
+ "@vitest/coverage-v8": "^3.2.4",
79
+ "@vitest/ui": "^3.2.4",
82
80
  "chalk": "^5.3.0",
83
81
  "eslint": "^9.30.1",
84
- "prettier": "^3.6.2"
82
+ "jest": "^30.0.4",
83
+ "prettier": "^3.6.2",
84
+ "ts-jest": "^29.4.0",
85
+ "ts-node": "^10.9.2",
86
+ "tsconfig-paths": "^4.2.0",
87
+ "tsup": "^8.5.0",
88
+ "vitest": "^3.2.4"
85
89
  },
86
90
  "peerDependencies": {
87
91
  "typescript": "^5"
@@ -1,8 +1,8 @@
1
- #!/usr/bin/env bun
1
+ #!/usr/bin/env node
2
2
 
3
3
  import { intro, outro, log } from '@clack/prompts';
4
- import { main } from '../src/core/index.ts';
5
- import { parseArgs, showHelp, showVersion } from '../src/utils/args.ts';
4
+ import { main } from '@core/index';
5
+ import { parseArgs, showHelp, showVersion } from '../utils/args';
6
6
 
7
7
  async function run() {
8
8
  try {
@@ -46,6 +46,7 @@ async function run() {
46
46
  }
47
47
  }
48
48
 
49
- if (import.meta.main) {
49
+ // Verificar se o arquivo está sendo executado diretamente
50
+ if (import.meta.url === `file://${process.argv[1]}`) {
50
51
  run();
51
- }
52
+ }
package/src/core/cache.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { Config } from '../config/index.ts';
2
- import type { FileGroup } from './smart-split.ts';
1
+ import type { Config } from '../config/index';
2
+ import type { FileGroup } from './smart-split';
3
3
  import crypto from 'crypto';
4
4
 
5
5
  export interface CacheEntry {
package/src/core/index.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { log } from '@clack/prompts';
2
- import { loadConfig, validateConfig } from '../config/index.ts';
2
+ import { loadConfig, validateConfig } from '../config/index';
3
3
  import {
4
4
  isGitRepository,
5
5
  getGitStatus,
6
6
  getDiffStats,
7
7
  executeCommit,
8
8
  executeFileCommit,
9
- } from '../git/index.ts';
10
- import { generateWithRetry } from './openai.ts';
9
+ } from '../git/index';
10
+ import { generateWithRetry } from './openai';
11
11
  import {
12
12
  showCommitPreview,
13
13
  editCommitMessage,
@@ -16,12 +16,12 @@ import {
16
16
  showCancellation,
17
17
  selectFilesForCommit,
18
18
  askContinueCommits,
19
- } from '../ui/index.ts';
20
- import { chooseSplitMode } from '../ui/smart-split.ts';
21
- import { handleSmartSplitMode } from './smart-split.ts';
22
- import { initializeCache } from './cache.ts';
23
- import type { CLIArgs } from '../utils/args.ts';
24
- import type { Config } from '../config/index.ts';
19
+ } from '../ui/index';
20
+ import { chooseSplitMode } from '../ui/smart-split';
21
+ import { handleSmartSplitMode } from './smart-split';
22
+ import { initializeCache } from './cache';
23
+ import type { CLIArgs } from '../utils/args';
24
+ import type { Config } from '../config/index';
25
25
 
26
26
  export async function main(
27
27
  args: CLIArgs = {
@@ -248,7 +248,7 @@ async function handleSplitMode(gitStatus: any, config: any, args: CLIArgs) {
248
248
  }
249
249
 
250
250
  // Gerar diff apenas dos arquivos selecionados
251
- const { getFileDiff } = await import('../git/index.ts');
251
+ const { getFileDiff } = await import('../git/index');
252
252
  const fileDiffs = selectedFiles
253
253
  .filter((file): file is string => file !== undefined)
254
254
  .map((file) => {
@@ -1,4 +1,4 @@
1
- import type { Config } from '../config/index.ts';
1
+ import type { Config } from '../config/index';
2
2
 
3
3
  export interface CommitSuggestion {
4
4
  message: string;
@@ -1,7 +1,7 @@
1
- import type { Config } from '../config/index.ts';
2
- import type { CLIArgs } from '../utils/args.ts';
3
- import { getCachedAnalysis, setCachedAnalysis } from './cache.ts';
4
- import { showCommitResult } from '../ui/index.ts';
1
+ import type { Config } from '../config/index';
2
+ import type { CLIArgs } from '../utils/args';
3
+ import { getCachedAnalysis, setCachedAnalysis } from './cache';
4
+ import { showCommitResult } from '../ui/index';
5
5
  import { log } from '@clack/prompts';
6
6
 
7
7
  export interface FileGroup {
@@ -251,7 +251,7 @@ export async function analyzeFileContext(
251
251
  * Gera diff para um grupo de arquivos (otimizado para tokens)
252
252
  */
253
253
  export async function generateGroupDiff(group: FileGroup): Promise<string> {
254
- const { getFileDiff } = await import('../git/index.ts');
254
+ const { getFileDiff } = await import('../git/index');
255
255
 
256
256
  const diffs = group.files
257
257
  .map((file) => {
@@ -429,7 +429,7 @@ export async function handleSmartSplitMode(
429
429
 
430
430
  // Mostrar interface de Smart Split para o usuário decidir
431
431
  if (!args.yes && !args.silent) {
432
- const { showSmartSplitGroups } = await import('../ui/smart-split.ts');
432
+ const { showSmartSplitGroups } = await import('../ui/smart-split');
433
433
  const userAction = await showSmartSplitGroups(analysis.groups);
434
434
 
435
435
  if (userAction.action === 'cancel') {
@@ -442,7 +442,7 @@ export async function handleSmartSplitMode(
442
442
  if (userAction.action === 'manual') {
443
443
  // Delegar para modo manual - re-executar com flag split
444
444
  const newArgs = { ...args, split: true, smartSplit: false };
445
- const { main } = await import('./index.ts');
445
+ const { main } = await import('./index');
446
446
  await main(newArgs);
447
447
  return;
448
448
  }
@@ -486,7 +486,7 @@ export async function handleSmartSplitMode(
486
486
  log.info(`🤖 Gerando commit para: ${group.name}`);
487
487
  }
488
488
 
489
- const { generateWithRetry } = await import('./openai.ts');
489
+ const { generateWithRetry } = await import('./openai');
490
490
  const result = await generateWithRetry(groupDiff, config, group.files);
491
491
 
492
492
  if (!result.success) {
@@ -518,7 +518,7 @@ export async function handleSmartSplitMode(
518
518
  // Interface do usuário
519
519
  if (args.yes) {
520
520
  // Modo automático
521
- const { executeFileCommit } = await import('../git/index.ts');
521
+ const { executeFileCommit } = await import('../git/index');
522
522
  let commitResult;
523
523
 
524
524
  // Fazer commit apenas dos arquivos do grupo atual
@@ -531,7 +531,7 @@ export async function handleSmartSplitMode(
531
531
  // Para múltiplos arquivos, usar commit normal mas com apenas os arquivos do grupo
532
532
  const { execSync } = await import('child_process');
533
533
  // Importar função de escape do módulo git
534
- const { escapeShellArg } = await import('../git/index.ts');
534
+ const { escapeShellArg } = await import('../git/index');
535
535
  try {
536
536
  // Fazer commit apenas dos arquivos do grupo
537
537
  const filesArg = group.files.map((f) => escapeShellArg(f)).join(' ');
@@ -576,13 +576,13 @@ export async function handleSmartSplitMode(
576
576
  editCommitMessage,
577
577
  copyToClipboard,
578
578
  showCancellation,
579
- } = await import('../ui/index.ts');
579
+ } = await import('../ui/index');
580
580
 
581
581
  const uiAction = await showCommitPreview(result.suggestion);
582
582
 
583
583
  switch (uiAction.action) {
584
584
  case 'commit': {
585
- const { executeFileCommit } = await import('../git/index.ts');
585
+ const { executeFileCommit } = await import('../git/index');
586
586
  let commitResult;
587
587
 
588
588
  // Fazer commit apenas dos arquivos do grupo atual
@@ -594,7 +594,7 @@ export async function handleSmartSplitMode(
594
594
  // Para múltiplos arquivos, usar commit normal mas com apenas os arquivos do grupo
595
595
  const { execSync } = await import('child_process');
596
596
  // Importar função de escape do módulo git
597
- const { escapeShellArg } = await import('../git/index.ts');
597
+ const { escapeShellArg } = await import('../git/index');
598
598
  try {
599
599
  // Fazer commit apenas dos arquivos do grupo
600
600
  const filesArg = group.files.map((f) => escapeShellArg(f)).join(' ');
@@ -633,7 +633,7 @@ export async function handleSmartSplitMode(
633
633
  case 'edit': {
634
634
  const editAction = await editCommitMessage(result.suggestion.message);
635
635
  if (editAction.action === 'commit' && editAction.message) {
636
- const { executeFileCommit } = await import('../git/index.ts');
636
+ const { executeFileCommit } = await import('../git/index');
637
637
  let editCommitResult;
638
638
 
639
639
  // Fazer commit apenas dos arquivos do grupo atual
@@ -646,7 +646,7 @@ export async function handleSmartSplitMode(
646
646
  // Para múltiplos arquivos, usar commit normal mas com apenas os arquivos do grupo
647
647
  const { execSync } = await import('child_process');
648
648
  // Importar função de escape do módulo git
649
- const { escapeShellArg } = await import('../git/index.ts');
649
+ const { escapeShellArg } = await import('../git/index');
650
650
  try {
651
651
  // Fazer commit apenas dos arquivos do grupo
652
652
  const filesArg = group.files.map((f) => escapeShellArg(f)).join(' ');
@@ -703,7 +703,7 @@ export async function handleSmartSplitMode(
703
703
 
704
704
  // Perguntar se quer continuar (exceto em modo automático)
705
705
  if (i < analysis.groups.length - 1 && !args.yes) {
706
- const { askContinueCommits } = await import('../ui/index.ts');
706
+ const { askContinueCommits } = await import('../ui/index');
707
707
  const remainingGroups = analysis.groups
708
708
  .slice(i + 1)
709
709
  .filter((g) => g !== undefined)
package/src/ui/index.ts CHANGED
@@ -8,7 +8,7 @@ import {
8
8
  isCancel,
9
9
  } from '@clack/prompts';
10
10
  import clipboardy from 'clipboardy';
11
- import type { CommitSuggestion } from '../core/openai.ts';
11
+ import type { CommitSuggestion } from '../core/openai';
12
12
 
13
13
  export interface UIAction {
14
14
  action: 'commit' | 'edit' | 'copy' | 'cancel';
@@ -1,5 +1,5 @@
1
1
  import { select, confirm, log, note, isCancel } from '@clack/prompts';
2
- import type { FileGroup } from '../core/smart-split.ts';
2
+ import type { FileGroup } from '../core/smart-split';
3
3
 
4
4
  export interface SmartSplitAction {
5
5
  action: 'proceed' | 'manual' | 'cancel';
@@ -1,86 +0,0 @@
1
- /**
2
- * Polyfill para stripVTControlCharacters para compatibilidade com Bun/Node.js
3
- *
4
- * Este polyfill resolve problemas de compatibilidade onde o Bun não mapeia
5
- * corretamente a função stripVTControlCharacters do módulo util do Node.js.
6
- * A função foi adicionada ao Node.js v16.14.0+ mas pode não estar disponível
7
- * em todos os ambientes ou ter problemas de mapping no Bun.
8
- */
9
-
10
- /**
11
- * Remove caracteres de controle VT de uma string
12
- * Implementação baseada na função nativa do Node.js
13
- *
14
- * @param str - String da qual remover os caracteres de controle
15
- * @returns String limpa sem caracteres de controle VT/ANSI
16
- */
17
- function stripVTControlCharacters(str: string): string {
18
- if (typeof str !== 'string') {
19
- throw new TypeError('The "str" argument must be of type string');
20
- }
21
-
22
- // Regex para caracteres de controle ANSI/VT
23
- // Baseada na implementação oficial do Node.js
24
- const esc = String.fromCharCode(27); // ESC character (\u001B)
25
- const csi = String.fromCharCode(155); // CSI character (\u009B)
26
- const ansiRegex = new RegExp(
27
- `[${esc}${csi}][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]`,
28
- 'g'
29
- );
30
-
31
- return str.replace(ansiRegex, '');
32
- }
33
-
34
- // Interceptar require/import do módulo util antes de qualquer outra coisa
35
-
36
- const Module = require('module');
37
- const originalRequire = Module.prototype.require;
38
-
39
- Module.prototype.require = function (id: string) {
40
- const result = originalRequire.apply(this, arguments);
41
-
42
- // Se estiver importando o módulo util e stripVTControlCharacters não existe, adicionar
43
- if (id === 'util' && result && !result.stripVTControlCharacters) {
44
- result.stripVTControlCharacters = stripVTControlCharacters;
45
- // Tornar a propriedade não enumerável para não interferir em iterações
46
- Object.defineProperty(result, 'stripVTControlCharacters', {
47
- value: stripVTControlCharacters,
48
- writable: false,
49
- enumerable: true,
50
- configurable: false,
51
- });
52
- }
53
-
54
- return result;
55
- };
56
-
57
- declare global {
58
- // eslint-disable-next-line @typescript-eslint/no-namespace
59
- namespace NodeJS {
60
- interface Global {
61
- stripVTControlCharacters?: typeof stripVTControlCharacters;
62
- }
63
- }
64
- }
65
-
66
- // Disponibilizar globalmente também como fallback
67
-
68
- if (
69
- typeof globalThis !== 'undefined' &&
70
- !(globalThis as any).stripVTControlCharacters
71
- ) {
72
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
73
- (globalThis as any).stripVTControlCharacters = stripVTControlCharacters;
74
- }
75
-
76
- // Tentar aplicar diretamente ao módulo util se possível
77
- try {
78
- const util = require('util');
79
- if (!util.stripVTControlCharacters) {
80
- util.stripVTControlCharacters = stripVTControlCharacters;
81
- }
82
- } catch {
83
- // Ignorar se não conseguir aplicar
84
- }
85
-
86
- export { stripVTControlCharacters };