@negoziator/ai-commit 1.2.62 → 1.2.64

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
@@ -83,7 +83,7 @@ aicommit config set <key>=<value>
83
83
  | `OPENAI_KEY` | N/A | The OpenAI API key. |
84
84
  | `locale` | `en` | Locale for the generated commit messages. |
85
85
  | `generate` | `1` | Number of commit messages to generate. |
86
- | `model` | `gpt-3.5-turbo` | The Chat Completions model to use. |
86
+ | `model` | `gpt-4o-mini` | The Chat Completions model to use. |
87
87
  | `timeout` | `10000` ms | Network request timeout to the OpenAI API. |
88
88
  | `max-length` | `50` | Maximum character length of the generated commit message. |
89
89
  | `type` | `""` | Type of commit message to generate. |
package/dist/cli.mjs CHANGED
@@ -19,7 +19,7 @@ var an=Object.defineProperty;var s=(u,D)=>an(u,"name",{value:D,configurable:!0})
19
19
  `:"")+(e?this.indentText({text:this.render(e),spaces:n}):"")}
20
20
  `}table({tableData:D,tableOptions:e,tableBreakpoints:n}){return br(D.map(r=>r.map(o=>this.render(o))),n?wr(n):e)}flagParameter(D){return D===Boolean?"":D===String?"<string>":D===Number?"<number>":Array.isArray(D)?this.flagParameter(D[0]):"<value>"}flagOperator(D){return" "}flagName(D){const{flag:e,flagFormatted:n,aliasesEnabled:r,aliasFormatted:o}=D;let t="";if(o?t+=`${o}, `:r&&(t+=" "),t+=n,"placeholder"in e&&typeof e.placeholder=="string")t+=`${this.flagOperator(D)}${e.placeholder}`;else{const i=this.flagParameter("type"in e?e.type:e);i&&(t+=`${this.flagOperator(D)}${i}`)}return t}flagDefault(D){return JSON.stringify(D)}flagDescription({flag:D}){let e="description"in D?D.description??"":"";if("default"in D){let{default:n}=D;typeof n=="function"&&(n=n()),n&&(e+=` (default: ${this.flagDefault(n)})`)}return e}render(D){if(typeof D=="string")return D;if(Array.isArray(D))return D.map(e=>this.render(e)).join(`
21
21
  `);if("type"in D&&this[D.type]){const e=this[D.type];if(typeof e=="function")return e.call(this,D.data)}throw new Error(`Invalid node type: ${JSON.stringify(D)}`)}},s(uu,"M"),uu);const Ku=/^[\w.-]+$/,{stringify:_}=JSON,Lr=/[|\\{}()[\]^$+*?.]/;function Vu(u){const D=[];let e,n;for(const r of u){if(n)throw new Error(`Invalid parameter: Spread parameter ${_(n)} must be last`);const o=r[0],t=r[r.length-1];let i;if(o==="<"&&t===">"&&(i=!0,e))throw new Error(`Invalid parameter: Required parameter ${_(r)} cannot come after optional parameter ${_(e)}`);if(o==="["&&t==="]"&&(i=!1,e=r),i===void 0)throw new Error(`Invalid parameter: ${_(r)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let a=r.slice(1,-1);const l=a.slice(-3)==="...";l&&(n=r,a=a.slice(0,-3));const C=a.match(Lr);if(C)throw new Error(`Invalid parameter: ${_(r)}. Invalid character found ${_(C[0])}`);D.push({name:a,required:i,spread:l})}return D}s(Vu,"w$1");function Yu(u,D,e,n){for(let r=0;r<D.length;r+=1){const{name:o,required:t,spread:i}=D[r],a=$r(o);if(a in u)throw new Error(`Invalid parameter: ${_(o)} is used more than once.`);const l=i?e.slice(r):e[r];if(i&&(r=D.length),t&&(!l||i&&l.length===0))return console.error(`Error: Missing required parameter ${_(o)}
22
- `),n(),process.exit(1);u[a]=l}}s(Yu,"b$2");function Gr(u){return u===void 0||u!==!1}s(Gr,"W$1");function Se(u,D,e,n){const r={...D.flags},o=D.version;o&&(r.version={type:Boolean,description:"Show version"});const{help:t}=D,i=Gr(t);i&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const a=Un(r,n,{ignore:D.ignoreArgv}),l=s(()=>{console.log(D.version)},"f");if(o&&a.flags.version===!0)return l(),process.exit(0);const C=new Nr,c=i&&t?.render?t.render:d=>C.render(d),F=s(d=>{const E=Mr({...D,...d?{help:d}:{},flags:r});console.log(c(E,C))},"u");if(i&&a.flags.help===!0)return F(),process.exit(0);if(D.parameters){let{parameters:d}=D,E=a._;const h=d.indexOf("--"),m=d.slice(h+1),w=Object.create(null);if(h>-1&&m.length>0){d=d.slice(0,h);const P=a._["--"];E=E.slice(0,-P.length||void 0),Yu(w,Vu(d),E,F),Yu(w,Vu(m),P,F)}else Yu(w,Vu(d),E,F);Object.assign(a._,w)}const f={...a,showVersion:l,showHelp:F};return typeof e=="function"&&e(f),{command:u,...f}}s(Se,"x$2");function Wr(u,D){const e=new Map;for(const n of D){const r=[n.options.name],{alias:o}=n.options;o&&(Array.isArray(o)?r.push(...o):r.push(o));for(const t of r){if(e.has(t))throw new Error(`Duplicate command name found: ${_(t)}`);e.set(t,n)}}return e.get(u)}s(Wr,"z$1");function Ur(u,D,e=process.argv.slice(2)){if(!u)throw new Error("Options is required");if("name"in u&&(!u.name||!Ku.test(u.name)))throw new Error(`Invalid script name: ${_(u.name)}`);const n=e[0];if(u.commands&&Ku.test(n)){const r=Wr(n,u.commands);if(r)return Se(r.options.name,{...r.options,parent:u},r.callback,e.slice(1))}return Se(void 0,u,D,e)}s(Ur,"Z$1");function Oe(u,D){if(!u)throw new Error("Command options are required");const{name:e}=u;if(u.name===void 0)throw new Error("Command name is required");if(!Ku.test(e))throw new Error(`Invalid command name ${JSON.stringify(e)}. Command names must be one word.`);return{options:u,callback:D}}s(Oe,"G");var Te="1.2.62",qr="Writes your git commit messages for you with AI",A=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function H(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}s(H,"getDefaultExportFromCjs");var K={exports:{}},Ju,Ie;function zr(){if(Ie)return Ju;Ie=1,Ju=n,n.sync=r;var u=Lu;function D(o,t){var i=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!i||(i=i.split(";"),i.indexOf("")!==-1))return!0;for(var a=0;a<i.length;a++){var l=i[a].toLowerCase();if(l&&o.substr(-l.length).toLowerCase()===l)return!0}return!1}s(D,"checkPathExt");function e(o,t,i){return!o.isSymbolicLink()&&!o.isFile()?!1:D(t,i)}s(e,"checkStat");function n(o,t,i){u.stat(o,function(a,l){i(a,a?!1:e(l,o,t))})}s(n,"isexe");function r(o,t){return e(u.statSync(o),o,t)}return s(r,"sync"),Ju}s(zr,"requireWindows");var Zu,Pe;function Hr(){if(Pe)return Zu;Pe=1,Zu=D,D.sync=e;var u=Lu;function D(o,t,i){u.stat(o,function(a,l){i(a,a?!1:n(l,t))})}s(D,"isexe");function e(o,t){return n(u.statSync(o),t)}s(e,"sync");function n(o,t){return o.isFile()&&r(o,t)}s(n,"checkStat");function r(o,t){var i=o.mode,a=o.uid,l=o.gid,C=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),c=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),F=parseInt("100",8),f=parseInt("010",8),d=parseInt("001",8),E=F|f,h=i&d||i&f&&l===c||i&F&&a===C||i&E&&C===0;return h}return s(r,"checkMode"),Zu}s(Hr,"requireMode");var bu;process.platform==="win32"||A.TESTING_WINDOWS?bu=zr():bu=Hr();var Kr=Xu;Xu.sync=Vr;function Xu(u,D,e){if(typeof D=="function"&&(e=D,D={}),!e){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,r){Xu(u,D||{},function(o,t){o?r(o):n(t)})})}bu(u,D||{},function(n,r){n&&(n.code==="EACCES"||D&&D.ignoreErrors)&&(n=null,r=!1),e(n,r)})}s(Xu,"isexe$1");function Vr(u,D){try{return bu.sync(u,D||{})}catch(e){if(D&&D.ignoreErrors||e.code==="EACCES")return!1;throw e}}s(Vr,"sync");const V=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",ke=z,Yr=V?";":":",_e=Kr,Re=s(u=>Object.assign(new Error(`not found: ${u}`),{code:"ENOENT"}),"getNotFoundError"),Me=s((u,D)=>{const e=D.colon||Yr,n=u.match(/\//)||V&&u.match(/\\/)?[""]:[...V?[process.cwd()]:[],...(D.path||process.env.PATH||"").split(e)],r=V?D.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=V?r.split(e):[""];return V&&u.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:r}},"getPathInfo"),je=s((u,D,e)=>{typeof D=="function"&&(e=D,D={}),D||(D={});const{pathEnv:n,pathExt:r,pathExtExe:o}=Me(u,D),t=[],i=s(l=>new Promise((C,c)=>{if(l===n.length)return D.all&&t.length?C(t):c(Re(u));const F=n[l],f=/^".*"$/.test(F)?F.slice(1,-1):F,d=ke.join(f,u),E=!f&&/^\.[\\\/]/.test(u)?u.slice(0,2)+d:d;C(a(E,l,0))}),"step"),a=s((l,C,c)=>new Promise((F,f)=>{if(c===r.length)return F(i(C+1));const d=r[c];_e(l+d,{pathExt:o},(E,h)=>{if(!E&&h)if(D.all)t.push(l+d);else return F(l+d);return F(a(l,C,c+1))})}),"subStep");return e?i(0).then(l=>e(null,l),e):i(0)},"which$1"),Jr=s((u,D)=>{D=D||{};const{pathEnv:e,pathExt:n,pathExtExe:r}=Me(u,D),o=[];for(let t=0;t<e.length;t++){const i=e[t],a=/^".*"$/.test(i)?i.slice(1,-1):i,l=ke.join(a,u),C=!a&&/^\.[\\\/]/.test(u)?u.slice(0,2)+l:l;for(let c=0;c<n.length;c++){const F=C+n[c];try{if(_e.sync(F,{pathExt:r}))if(D.all)o.push(F);else return F}catch{}}}if(D.all&&o.length)return o;if(D.nothrow)return null;throw Re(u)},"whichSync");var Zr=je;je.sync=Jr;var Qu={exports:{}};const Ne=s((u={})=>{const D=u.env||process.env;return(u.platform||process.platform)!=="win32"?"PATH":Object.keys(D).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey$1");Qu.exports=Ne,Qu.exports.default=Ne;var Xr=Qu.exports;const Le=z,Qr=Zr,uo=Xr;function Ge(u,D){const e=u.options.env||process.env,n=process.cwd(),r=u.options.cwd!=null,o=r&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(u.options.cwd)}catch{}let t;try{t=Qr.sync(u.command,{path:e[uo({env:e})],pathExt:D?Le.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return t&&(t=Le.resolve(r?u.options.cwd:"",t)),t}s(Ge,"resolveCommandAttempt");function Do(u){return Ge(u)||Ge(u,!0)}s(Do,"resolveCommand$1");var eo=Do,uD={};const DD=/([()\][%!^"`<>&|;, *?])/g;function to(u){return u=u.replace(DD,"^$1"),u}s(to,"escapeCommand");function no(u,D){return u=`${u}`,u=u.replace(/(\\*)"/g,'$1$1\\"'),u=u.replace(/(\\*)$/,"$1$1"),u=`"${u}"`,u=u.replace(DD,"^$1"),D&&(u=u.replace(DD,"^$1")),u}s(no,"escapeArgument"),uD.command=to,uD.argument=no;var ro=/^#!(.*)/;const oo=ro;var so=s((u="")=>{const D=u.match(oo);if(!D)return null;const[e,n]=D[0].replace(/#! ?/,"").split(" "),r=e.split("/").pop();return r==="env"?n:n?`${r} ${n}`:r},"shebangCommand$1");const eD=Lu,io=so;function ao(u){const e=Buffer.alloc(150);let n;try{n=eD.openSync(u,"r"),eD.readSync(n,e,0,150,0),eD.closeSync(n)}catch{}return io(e.toString())}s(ao,"readShebang$1");var co=ao;const lo=z,We=eo,Ue=uD,Fo=co,Co=process.platform==="win32",fo=/\.(?:com|exe)$/i,Eo=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function po(u){u.file=We(u);const D=u.file&&Fo(u.file);return D?(u.args.unshift(u.file),u.command=D,We(u)):u.file}s(po,"detectShebang");function ho(u){if(!Co)return u;const D=po(u),e=!fo.test(D);if(u.options.forceShell||e){const n=Eo.test(D);u.command=lo.normalize(u.command),u.command=Ue.command(u.command),u.args=u.args.map(o=>Ue.argument(o,n));const r=[u.command].concat(u.args).join(" ");u.args=["/d","/s","/c",`"${r}"`],u.command=process.env.comspec||"cmd.exe",u.options.windowsVerbatimArguments=!0}return u}s(ho,"parseNonShell");function mo(u,D,e){D&&!Array.isArray(D)&&(e=D,D=null),D=D?D.slice(0):[],e=Object.assign({},e);const n={command:u,args:D,options:e,file:void 0,original:{command:u,args:D}};return e.shell?n:ho(n)}s(mo,"parse$1");var go=mo;const tD=process.platform==="win32";function nD(u,D){return Object.assign(new Error(`${D} ${u.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${D} ${u.command}`,path:u.command,spawnargs:u.args})}s(nD,"notFoundError");function Bo(u,D){if(!tD)return;const e=u.emit;u.emit=function(n,r){if(n==="exit"){const o=qe(r,D);if(o)return e.call(u,"error",o)}return e.apply(u,arguments)}}s(Bo,"hookChildProcess");function qe(u,D){return tD&&u===1&&!D.file?nD(D.original,"spawn"):null}s(qe,"verifyENOENT");function bo(u,D){return tD&&u===1&&!D.file?nD(D.original,"spawnSync"):null}s(bo,"verifyENOENTSync");var yo={hookChildProcess:Bo,verifyENOENT:qe,verifyENOENTSync:bo,notFoundError:nD};const ze=Fn,rD=go,oD=yo;function He(u,D,e){const n=rD(u,D,e),r=ze.spawn(n.command,n.args,n.options);return oD.hookChildProcess(r,n),r}s(He,"spawn");function Ao(u,D,e){const n=rD(u,D,e),r=ze.spawnSync(n.command,n.args,n.options);return r.error=r.error||oD.verifyENOENTSync(r.status,n),r}s(Ao,"spawnSync"),K.exports=He,K.exports.spawn=He,K.exports.sync=Ao,K.exports._parse=rD,K.exports._enoent=oD;var wo=K.exports,$o=H(wo);function vo(u){const D=typeof u=="string"?`
22
+ `),n(),process.exit(1);u[a]=l}}s(Yu,"b$2");function Gr(u){return u===void 0||u!==!1}s(Gr,"W$1");function Se(u,D,e,n){const r={...D.flags},o=D.version;o&&(r.version={type:Boolean,description:"Show version"});const{help:t}=D,i=Gr(t);i&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const a=Un(r,n,{ignore:D.ignoreArgv}),l=s(()=>{console.log(D.version)},"f");if(o&&a.flags.version===!0)return l(),process.exit(0);const C=new Nr,c=i&&t?.render?t.render:d=>C.render(d),F=s(d=>{const E=Mr({...D,...d?{help:d}:{},flags:r});console.log(c(E,C))},"u");if(i&&a.flags.help===!0)return F(),process.exit(0);if(D.parameters){let{parameters:d}=D,E=a._;const h=d.indexOf("--"),m=d.slice(h+1),w=Object.create(null);if(h>-1&&m.length>0){d=d.slice(0,h);const P=a._["--"];E=E.slice(0,-P.length||void 0),Yu(w,Vu(d),E,F),Yu(w,Vu(m),P,F)}else Yu(w,Vu(d),E,F);Object.assign(a._,w)}const f={...a,showVersion:l,showHelp:F};return typeof e=="function"&&e(f),{command:u,...f}}s(Se,"x$2");function Wr(u,D){const e=new Map;for(const n of D){const r=[n.options.name],{alias:o}=n.options;o&&(Array.isArray(o)?r.push(...o):r.push(o));for(const t of r){if(e.has(t))throw new Error(`Duplicate command name found: ${_(t)}`);e.set(t,n)}}return e.get(u)}s(Wr,"z$1");function Ur(u,D,e=process.argv.slice(2)){if(!u)throw new Error("Options is required");if("name"in u&&(!u.name||!Ku.test(u.name)))throw new Error(`Invalid script name: ${_(u.name)}`);const n=e[0];if(u.commands&&Ku.test(n)){const r=Wr(n,u.commands);if(r)return Se(r.options.name,{...r.options,parent:u},r.callback,e.slice(1))}return Se(void 0,u,D,e)}s(Ur,"Z$1");function Oe(u,D){if(!u)throw new Error("Command options are required");const{name:e}=u;if(u.name===void 0)throw new Error("Command name is required");if(!Ku.test(e))throw new Error(`Invalid command name ${JSON.stringify(e)}. Command names must be one word.`);return{options:u,callback:D}}s(Oe,"G");var Te="1.2.64",qr="Writes your git commit messages for you with AI",A=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function H(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}s(H,"getDefaultExportFromCjs");var K={exports:{}},Ju,Ie;function zr(){if(Ie)return Ju;Ie=1,Ju=n,n.sync=r;var u=Lu;function D(o,t){var i=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!i||(i=i.split(";"),i.indexOf("")!==-1))return!0;for(var a=0;a<i.length;a++){var l=i[a].toLowerCase();if(l&&o.substr(-l.length).toLowerCase()===l)return!0}return!1}s(D,"checkPathExt");function e(o,t,i){return!o.isSymbolicLink()&&!o.isFile()?!1:D(t,i)}s(e,"checkStat");function n(o,t,i){u.stat(o,function(a,l){i(a,a?!1:e(l,o,t))})}s(n,"isexe");function r(o,t){return e(u.statSync(o),o,t)}return s(r,"sync"),Ju}s(zr,"requireWindows");var Zu,Pe;function Hr(){if(Pe)return Zu;Pe=1,Zu=D,D.sync=e;var u=Lu;function D(o,t,i){u.stat(o,function(a,l){i(a,a?!1:n(l,t))})}s(D,"isexe");function e(o,t){return n(u.statSync(o),t)}s(e,"sync");function n(o,t){return o.isFile()&&r(o,t)}s(n,"checkStat");function r(o,t){var i=o.mode,a=o.uid,l=o.gid,C=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),c=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),F=parseInt("100",8),f=parseInt("010",8),d=parseInt("001",8),E=F|f,h=i&d||i&f&&l===c||i&F&&a===C||i&E&&C===0;return h}return s(r,"checkMode"),Zu}s(Hr,"requireMode");var bu;process.platform==="win32"||A.TESTING_WINDOWS?bu=zr():bu=Hr();var Kr=Xu;Xu.sync=Vr;function Xu(u,D,e){if(typeof D=="function"&&(e=D,D={}),!e){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,r){Xu(u,D||{},function(o,t){o?r(o):n(t)})})}bu(u,D||{},function(n,r){n&&(n.code==="EACCES"||D&&D.ignoreErrors)&&(n=null,r=!1),e(n,r)})}s(Xu,"isexe$1");function Vr(u,D){try{return bu.sync(u,D||{})}catch(e){if(D&&D.ignoreErrors||e.code==="EACCES")return!1;throw e}}s(Vr,"sync");const V=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",ke=z,Yr=V?";":":",_e=Kr,Re=s(u=>Object.assign(new Error(`not found: ${u}`),{code:"ENOENT"}),"getNotFoundError"),Me=s((u,D)=>{const e=D.colon||Yr,n=u.match(/\//)||V&&u.match(/\\/)?[""]:[...V?[process.cwd()]:[],...(D.path||process.env.PATH||"").split(e)],r=V?D.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=V?r.split(e):[""];return V&&u.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:r}},"getPathInfo"),je=s((u,D,e)=>{typeof D=="function"&&(e=D,D={}),D||(D={});const{pathEnv:n,pathExt:r,pathExtExe:o}=Me(u,D),t=[],i=s(l=>new Promise((C,c)=>{if(l===n.length)return D.all&&t.length?C(t):c(Re(u));const F=n[l],f=/^".*"$/.test(F)?F.slice(1,-1):F,d=ke.join(f,u),E=!f&&/^\.[\\\/]/.test(u)?u.slice(0,2)+d:d;C(a(E,l,0))}),"step"),a=s((l,C,c)=>new Promise((F,f)=>{if(c===r.length)return F(i(C+1));const d=r[c];_e(l+d,{pathExt:o},(E,h)=>{if(!E&&h)if(D.all)t.push(l+d);else return F(l+d);return F(a(l,C,c+1))})}),"subStep");return e?i(0).then(l=>e(null,l),e):i(0)},"which$1"),Jr=s((u,D)=>{D=D||{};const{pathEnv:e,pathExt:n,pathExtExe:r}=Me(u,D),o=[];for(let t=0;t<e.length;t++){const i=e[t],a=/^".*"$/.test(i)?i.slice(1,-1):i,l=ke.join(a,u),C=!a&&/^\.[\\\/]/.test(u)?u.slice(0,2)+l:l;for(let c=0;c<n.length;c++){const F=C+n[c];try{if(_e.sync(F,{pathExt:r}))if(D.all)o.push(F);else return F}catch{}}}if(D.all&&o.length)return o;if(D.nothrow)return null;throw Re(u)},"whichSync");var Zr=je;je.sync=Jr;var Qu={exports:{}};const Ne=s((u={})=>{const D=u.env||process.env;return(u.platform||process.platform)!=="win32"?"PATH":Object.keys(D).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"},"pathKey$1");Qu.exports=Ne,Qu.exports.default=Ne;var Xr=Qu.exports;const Le=z,Qr=Zr,uo=Xr;function Ge(u,D){const e=u.options.env||process.env,n=process.cwd(),r=u.options.cwd!=null,o=r&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(u.options.cwd)}catch{}let t;try{t=Qr.sync(u.command,{path:e[uo({env:e})],pathExt:D?Le.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return t&&(t=Le.resolve(r?u.options.cwd:"",t)),t}s(Ge,"resolveCommandAttempt");function Do(u){return Ge(u)||Ge(u,!0)}s(Do,"resolveCommand$1");var eo=Do,uD={};const DD=/([()\][%!^"`<>&|;, *?])/g;function to(u){return u=u.replace(DD,"^$1"),u}s(to,"escapeCommand");function no(u,D){return u=`${u}`,u=u.replace(/(\\*)"/g,'$1$1\\"'),u=u.replace(/(\\*)$/,"$1$1"),u=`"${u}"`,u=u.replace(DD,"^$1"),D&&(u=u.replace(DD,"^$1")),u}s(no,"escapeArgument"),uD.command=to,uD.argument=no;var ro=/^#!(.*)/;const oo=ro;var so=s((u="")=>{const D=u.match(oo);if(!D)return null;const[e,n]=D[0].replace(/#! ?/,"").split(" "),r=e.split("/").pop();return r==="env"?n:n?`${r} ${n}`:r},"shebangCommand$1");const eD=Lu,io=so;function ao(u){const e=Buffer.alloc(150);let n;try{n=eD.openSync(u,"r"),eD.readSync(n,e,0,150,0),eD.closeSync(n)}catch{}return io(e.toString())}s(ao,"readShebang$1");var co=ao;const lo=z,We=eo,Ue=uD,Fo=co,Co=process.platform==="win32",fo=/\.(?:com|exe)$/i,Eo=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function po(u){u.file=We(u);const D=u.file&&Fo(u.file);return D?(u.args.unshift(u.file),u.command=D,We(u)):u.file}s(po,"detectShebang");function ho(u){if(!Co)return u;const D=po(u),e=!fo.test(D);if(u.options.forceShell||e){const n=Eo.test(D);u.command=lo.normalize(u.command),u.command=Ue.command(u.command),u.args=u.args.map(o=>Ue.argument(o,n));const r=[u.command].concat(u.args).join(" ");u.args=["/d","/s","/c",`"${r}"`],u.command=process.env.comspec||"cmd.exe",u.options.windowsVerbatimArguments=!0}return u}s(ho,"parseNonShell");function mo(u,D,e){D&&!Array.isArray(D)&&(e=D,D=null),D=D?D.slice(0):[],e=Object.assign({},e);const n={command:u,args:D,options:e,file:void 0,original:{command:u,args:D}};return e.shell?n:ho(n)}s(mo,"parse$1");var go=mo;const tD=process.platform==="win32";function nD(u,D){return Object.assign(new Error(`${D} ${u.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${D} ${u.command}`,path:u.command,spawnargs:u.args})}s(nD,"notFoundError");function Bo(u,D){if(!tD)return;const e=u.emit;u.emit=function(n,r){if(n==="exit"){const o=qe(r,D);if(o)return e.call(u,"error",o)}return e.apply(u,arguments)}}s(Bo,"hookChildProcess");function qe(u,D){return tD&&u===1&&!D.file?nD(D.original,"spawn"):null}s(qe,"verifyENOENT");function bo(u,D){return tD&&u===1&&!D.file?nD(D.original,"spawnSync"):null}s(bo,"verifyENOENTSync");var yo={hookChildProcess:Bo,verifyENOENT:qe,verifyENOENTSync:bo,notFoundError:nD};const ze=Fn,rD=go,oD=yo;function He(u,D,e){const n=rD(u,D,e),r=ze.spawn(n.command,n.args,n.options);return oD.hookChildProcess(r,n),r}s(He,"spawn");function Ao(u,D,e){const n=rD(u,D,e),r=ze.spawnSync(n.command,n.args,n.options);return r.error=r.error||oD.verifyENOENTSync(r.status,n),r}s(Ao,"spawnSync"),K.exports=He,K.exports.spawn=He,K.exports.sync=Ao,K.exports._parse=rD,K.exports._enoent=oD;var wo=K.exports,$o=H(wo);function vo(u){const D=typeof u=="string"?`
23
23
  `:10,e=typeof u=="string"?"\r":13;return u[u.length-1]===D&&(u=u.slice(0,-1)),u[u.length-1]===e&&(u=u.slice(0,-1)),u}s(vo,"stripFinalNewline");function Ke(u={}){const{env:D=process.env,platform:e=process.platform}=u;return e!=="win32"?"PATH":Object.keys(D).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}s(Ke,"pathKey");const xo=s(({cwd:u=y.cwd(),path:D=y.env[Ke()],preferLocal:e=!0,execPath:n=y.execPath,addExecPath:r=!0}={})=>{const o=u instanceof URL?te(u):u,t=q.resolve(o),i=[];return e&&So(i,t),r&&Oo(i,n,t),[...i,D].join(q.delimiter)},"npmRunPath"),So=s((u,D)=>{let e;for(;e!==D;)u.push(q.join(D,"node_modules/.bin")),e=D,D=q.resolve(D,"..")},"applyPreferLocal"),Oo=s((u,D,e)=>{const n=D instanceof URL?te(D):D;u.push(q.resolve(e,n,".."))},"applyExecPath"),To=s(({env:u=y.env,...D}={})=>{u={...u};const e=Ke({env:u});return D.path=u[e],u[e]=xo(D),u},"npmRunPathEnv"),Io=s((u,D,e,n)=>{if(e==="length"||e==="prototype"||e==="arguments"||e==="caller")return;const r=Object.getOwnPropertyDescriptor(u,e),o=Object.getOwnPropertyDescriptor(D,e);!Po(r,o)&&n||Object.defineProperty(u,e,o)},"copyProperty"),Po=s(function(u,D){return u===void 0||u.configurable||u.writable===D.writable&&u.enumerable===D.enumerable&&u.configurable===D.configurable&&(u.writable||u.value===D.value)},"canCopyProperty"),ko=s((u,D)=>{const e=Object.getPrototypeOf(D);e!==Object.getPrototypeOf(u)&&Object.setPrototypeOf(u,e)},"changePrototype"),_o=s((u,D)=>`/* Wrapped ${u}*/
24
24
  ${D}`,"wrappedToString"),Ro=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Mo=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),jo=s((u,D,e)=>{const n=e===""?"":`with ${e.trim()}() `,r=_o.bind(null,n,D.toString());Object.defineProperty(r,"name",Mo),Object.defineProperty(u,"toString",{...Ro,value:r})},"changeToString");function No(u,D,{ignoreNonConfigurable:e=!1}={}){const{name:n}=u;for(const r of Reflect.ownKeys(D))Io(u,D,r,e);return ko(u,D),jo(u,D,n),u}s(No,"mimicFunction");const yu=new WeakMap,Ve=s((u,D={})=>{if(typeof u!="function")throw new TypeError("Expected a function");let e,n=0;const r=u.displayName||u.name||"<anonymous>",o=s(function(...t){if(yu.set(o,++n),n===1)e=u.apply(this,t),u=null;else if(D.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return e},"onetime");return No(o,u),yu.set(o,n),o},"onetime");Ve.callCount=u=>{if(!yu.has(u))throw new Error(`The given function \`${u.name}\` is not wrapped by the \`onetime\` package`);return yu.get(u)};const Lo=s(()=>{const u=Je-Ye+1;return Array.from({length:u},Go)},"getRealtimeSignals"),Go=s((u,D)=>({name:`SIGRT${D+1}`,number:Ye+D,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),"getRealtimeSignal"),Ye=34,Je=64,Wo=[{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"}],Ze=s(()=>{const u=Lo();return[...Wo,...u].map(Uo)},"getSignals"),Uo=s(({name:u,number:D,description:e,action:n,forced:r=!1,standard:o})=>{const{signals:{[u]:t}}=ne,i=t!==void 0;return{name:u,number:i?t:D,description:e,supported:i,action:n,forced:r,standard:o}},"normalizeSignal"),qo=s(()=>{const u=Ze();return Object.fromEntries(u.map(zo))},"getSignalsByName"),zo=s(({name:u,number:D,description:e,supported:n,action:r,forced:o,standard:t})=>[u,{name:u,number:D,description:e,supported:n,action:r,forced:o,standard:t}],"getSignalByName"),Ho=qo(),Ko=s(()=>{const u=Ze(),D=Je+1,e=Array.from({length:D},(n,r)=>Vo(r,u));return Object.assign({},...e)},"getSignalsByNumber"),Vo=s((u,D)=>{const e=Yo(u,D);if(e===void 0)return{};const{name:n,description:r,supported:o,action:t,forced:i,standard:a}=e;return{[u]:{name:n,number:u,description:r,supported:o,action:t,forced:i,standard:a}}},"getSignalByNumber"),Yo=s((u,D)=>{const e=D.find(({name:n})=>ne.signals[n]===u);return e!==void 0?e:D.find(n=>n.number===u)},"findSignalByNumber");Ko();const Jo=s(({timedOut:u,timeout:D,errorCode:e,signal:n,signalDescription:r,exitCode:o,isCanceled:t})=>u?`timed out after ${D} milliseconds`:t?"was canceled":e!==void 0?`failed with ${e}`:n!==void 0?`was killed with ${n} (${r})`:o!==void 0?`failed with exit code ${o}`:"failed","getErrorPrefix"),Xe=s(({stdout:u,stderr:D,all:e,error:n,signal:r,exitCode:o,command:t,escapedCommand:i,timedOut:a,isCanceled:l,killed:C,parsed:{options:{timeout:c,cwd:F=y.cwd()}}})=>{o=o===null?void 0:o,r=r===null?void 0:r;const f=r===void 0?void 0:Ho[r].description,d=n&&n.code,h=`Command ${Jo({timedOut:a,timeout:c,errorCode:d,signal:r,signalDescription:f,exitCode:o,isCanceled:l})}: ${t}`,m=Object.prototype.toString.call(n)==="[object Error]",w=m?`${h}
25
25
  ${n.message}`:h,P=[w,D,u].filter(Boolean).join(`
@@ -61,7 +61,7 @@ ${OD}${ED(`aicommit v${Te}`)}`),console.error(`
61
61
  ${OD}Please open a Bug report with the information above:`),console.error(`${OD}https://github.com/NegoZiatoR/ai-commit/issues/new/choose`))},"handleCliError"),Pt=s(async()=>{const{stdout:u,failed:D}=await Z("git",["rev-parse","--show-toplevel"],{reject:!1});if(D)throw new S("The current directory must be a Git repository!");return u},"assertGitRepo"),TD=s(u=>`:(exclude)${u}`,"excludeFromDiff"),kt=["package-lock.json","*.lock"].map(TD),_t=s(async u=>{const D=["diff","--cached","--diff-algorithm=minimal"],{stdout:e}=await Z("git",[...D,"--name-only",...kt,...u?u.map(TD):[]]);if(!e)return;const{stdout:n}=await Z("git",[...D,...kt,...u?u.map(TD):[]]);return{files:e.split(`
62
62
  `),diff:n}},"getStagedDiff"),Ti=s(u=>`Detected ${u.length.toLocaleString()} staged file${u.length>1?"s":""}`,"getDetectedMessage"),{hasOwnProperty:ID}=Object.prototype,PD=s((u,D={})=>{typeof D=="string"&&(D={section:D}),D.align=D.align===!0,D.newline=D.newline===!0,D.sort=D.sort===!0,D.whitespace=D.whitespace===!0||D.align===!0,D.platform=D.platform||typeof process<"u"&&process.platform,D.bracketedArray=D.bracketedArray!==!1;const e=D.platform==="win32"?`\r
63
63
  `:`
64
- `,n=D.whitespace?" = ":"=",r=[],o=D.sort?Object.keys(u).sort():Object.keys(u);let t=0;D.align&&(t=M(o.filter(l=>u[l]===null||Array.isArray(u[l])||typeof u[l]!="object").map(l=>Array.isArray(u[l])?`${l}[]`:l).concat([""]).reduce((l,C)=>M(l).length>=M(C).length?l:C)).length);let i="";const a=D.bracketedArray?"[]":"";for(const l of o){const C=u[l];if(C&&Array.isArray(C))for(const c of C)i+=M(`${l}${a}`).padEnd(t," ")+n+M(c)+e;else C&&typeof C=="object"?r.push(l):i+=M(l).padEnd(t," ")+n+M(C)+e}D.section&&i.length&&(i="["+M(D.section)+"]"+(D.newline?e+e:e)+i);for(const l of r){const C=Rt(l,".").join("\\."),c=(D.section?D.section+".":"")+C,F=PD(u[l],{...D,section:c});i.length&&F.length&&(i+=e),i+=F}return i},"encode");function Rt(u,D){var e=0,n=0,r=0,o=[];do if(r=u.indexOf(D,e),r!==-1){if(e=r+D.length,r>0&&u[r-1]==="\\")continue;o.push(u.slice(n,r)),n=r+D.length}while(r!==-1);return o.push(u.slice(n)),o}s(Rt,"splitSections");const Mt=s((u,D={})=>{D.bracketedArray=D.bracketedArray!==!1;const e=Object.create(null);let n=e,r=null;const o=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,t=u.split(/[\r\n]+/g),i={};for(const l of t){if(!l||l.match(/^\s*[;#]/)||l.match(/^\s*$/))continue;const C=l.match(o);if(!C)continue;if(C[1]!==void 0){if(r=Pu(C[1]),r==="__proto__"){n=Object.create(null);continue}n=e[r]=e[r]||Object.create(null);continue}const c=Pu(C[2]);let F;D.bracketedArray?F=c.length>2&&c.slice(-2)==="[]":(i[c]=(i?.[c]||0)+1,F=i[c]>1);const f=F&&c.endsWith("[]")?c.slice(0,-2):c;if(f==="__proto__")continue;const d=C[3]?Pu(C[4]):!0,E=d==="true"||d==="false"||d==="null"?JSON.parse(d):d;F&&(ID.call(n,f)?Array.isArray(n[f])||(n[f]=[n[f]]):n[f]=[]),Array.isArray(n[f])?n[f].push(E):n[f]=E}const a=[];for(const l of Object.keys(e)){if(!ID.call(e,l)||typeof e[l]!="object"||Array.isArray(e[l]))continue;const C=Rt(l,".");n=e;const c=C.pop(),F=c.replace(/\\\./g,".");for(const f of C)f!=="__proto__"&&((!ID.call(n,f)||typeof n[f]!="object")&&(n[f]=Object.create(null)),n=n[f]);n===e&&F===c||(n[F]=e[l],a.push(l))}for(const l of a)delete e[l];return e},"decode"),jt=s(u=>u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'"),"isQuoted"),M=s(u=>typeof u!="string"||u.match(/[=\r\n]/)||u.match(/^\[/)||u.length>1&&jt(u)||u!==u.trim()?JSON.stringify(u):u.split(";").join("\\;").split("#").join("\\#"),"safe"),Pu=s(u=>{if(u=(u||"").trim(),jt(u)){u.charAt(0)==="'"&&(u=u.slice(1,-1));try{u=JSON.parse(u)}catch{}}else{let D=!1,e="";for(let n=0,r=u.length;n<r;n++){const o=u.charAt(n);if(D)"\\;#".indexOf(o)!==-1?e+=o:e+="\\"+o,D=!1;else{if(";#".indexOf(o)!==-1)break;o==="\\"?D=!0:e+=o}}return D&&(e+="\\"),e.trim()}return u},"unsafe");var Ii={parse:Mt,decode:Mt,stringify:PD,encode:PD,safe:M,unsafe:Pu},Nt=H(Ii);const Lt=s(u=>T.lstat(u).then(()=>!0,()=>!1),"fileExists"),Pi=["","conventional"],{hasOwnProperty:ki}=Object.prototype,Gt=s((u,D)=>ki.call(u,D),"hasOwn"),x=s((u,D,e)=>{if(!D)throw new S(`Invalid config property ${u}: ${e}`)},"parseAssert"),ku={OPENAI_KEY(u){if(!u)throw new S("Please set your OpenAI API key via `aicommit config set OPENAI_KEY=<your token>`");return x("OPENAI_KEY",u.startsWith("sk-"),'Must start with "sk-"'),u},locale(u){return u?(x("locale",u,"Cannot be empty"),x("locale",/^[a-z-]+$/i.test(u),"Must be a valid locale (letters and dashes/underscores). You can consult the list of codes in: https://wikipedia.org/wiki/List_of_ISO_639-1_codes"),u):"en"},generate(u){if(!u)return 1;x("generate",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return x("generate",D>0,"Must be greater than 0"),x("generate",D<=5,"Must be less or equal to 5"),D},type(u){return u?(x("type",Pi.includes(u),"Invalid commit type"),u):""},proxy(u){if(!(!u||u.length===0))return x("proxy",/^https?:\/\//.test(u),"Must be a valid URL"),u},model(u){return!u||u.length===0?"gpt-3.5-turbo":u},timeout(u){if(!u)return 1e4;x("timeout",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return x("timeout",D>=500,"Must be greater than 500ms"),D},temperature(u){if(!u)return .2;x("temperature",/^(2|\d)(\.\d{1,2})?$/.test(u),"Must be decimal between 0 and 2");const D=Number(u);return x("temperature",D>0,"Must be greater than 0"),x("temperature",D<=2,"Must be less than or equal to 2"),D},"max-length"(u){if(!u)return 50;x("max-length",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return x("max-length",D>=20,"Must be greater than 20 characters"),D},"auto-confirm"(u){return u?typeof u=="boolean"?u:(x("auto-confirm",/^(?:true|false)$/.test(u),"Must be a boolean"),u==="true"):!1},"prepend-reference"(u){return u?typeof u=="boolean"?u:(x("prepend-reference",/^(?:true|false)$/.test(u),"Must be a boolean"),u==="true"):!1}},kD=z.join(ae.homedir(),".aicommit"),Wt=s(async()=>{if(!await Lt(kD))return Object.create(null);const D=await T.readFile(kD,"utf8");return Nt.parse(D)},"readConfigFile"),_D=s(async(u,D)=>{const e=await Wt(),n={};for(const r of Object.keys(ku)){const o=ku[r],t=u?.[r]??e[r];if(D)try{n[r]=o(t)}catch{}else n[r]=o(t)}return n},"getConfig"),_i=s(async u=>{const D=await Wt();for(const[e,n]of u){if(!Gt(ku,e))throw new S(`Invalid config property: ${e}`);const r=ku[e](n);D[e]=r}await T.writeFile(kD,Nt.stringify(D),"utf8")},"setConfigs");var RD={},MD={exports:{}},_u={exports:{}},jD,Ut;function Ri(){if(Ut)return jD;Ut=1;var u=1e3,D=u*60,e=D*60,n=e*24,r=n*7,o=n*365.25;jD=s(function(C,c){c=c||{};var F=typeof C;if(F==="string"&&C.length>0)return t(C);if(F==="number"&&isFinite(C))return c.long?a(C):i(C);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(C))},"ms");function t(C){if(C=String(C),!(C.length>100)){var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(C);if(c){var F=parseFloat(c[1]),f=(c[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return F*o;case"weeks":case"week":case"w":return F*r;case"days":case"day":case"d":return F*n;case"hours":case"hour":case"hrs":case"hr":case"h":return F*e;case"minutes":case"minute":case"mins":case"min":case"m":return F*D;case"seconds":case"second":case"secs":case"sec":case"s":return F*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return F;default:return}}}}s(t,"parse");function i(C){var c=Math.abs(C);return c>=n?Math.round(C/n)+"d":c>=e?Math.round(C/e)+"h":c>=D?Math.round(C/D)+"m":c>=u?Math.round(C/u)+"s":C+"ms"}s(i,"fmtShort");function a(C){var c=Math.abs(C);return c>=n?l(C,c,n,"day"):c>=e?l(C,c,e,"hour"):c>=D?l(C,c,D,"minute"):c>=u?l(C,c,u,"second"):C+" ms"}s(a,"fmtLong");function l(C,c,F,f){var d=c>=F*1.5;return Math.round(C/F)+" "+f+(d?"s":"")}return s(l,"plural"),jD}s(Ri,"requireMs");var ND,qt;function zt(){if(qt)return ND;qt=1;function u(D){n.debug=n,n.default=n,n.coerce=l,n.disable=t,n.enable=o,n.enabled=i,n.humanize=Ri(),n.destroy=C,Object.keys(D).forEach(c=>{n[c]=D[c]}),n.names=[],n.skips=[],n.formatters={};function e(c){let F=0;for(let f=0;f<c.length;f++)F=(F<<5)-F+c.charCodeAt(f),F|=0;return n.colors[Math.abs(F)%n.colors.length]}s(e,"selectColor"),n.selectColor=e;function n(c){let F,f=null,d,E;function h(...m){if(!h.enabled)return;const w=h,P=Number(new Date),du=P-(F||P);w.diff=du,w.prev=F,w.curr=P,F=P,m[0]=n.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");let j=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,(U,on)=>{if(U==="%%")return"%";j++;const QD=n.formatters[on];if(typeof QD=="function"){const sn=m[j];U=QD.call(w,sn),m.splice(j,1),j--}return U}),n.formatArgs.call(w,m),(w.log||n.log).apply(w,m)}return s(h,"debug"),h.namespace=c,h.useColors=n.useColors(),h.color=n.selectColor(c),h.extend=r,h.destroy=n.destroy,Object.defineProperty(h,"enabled",{enumerable:!0,configurable:!1,get:s(()=>f!==null?f:(d!==n.namespaces&&(d=n.namespaces,E=n.enabled(c)),E),"get"),set:s(m=>{f=m},"set")}),typeof n.init=="function"&&n.init(h),h}s(n,"createDebug");function r(c,F){const f=n(this.namespace+(typeof F>"u"?":":F)+c);return f.log=this.log,f}s(r,"extend");function o(c){n.save(c),n.namespaces=c,n.names=[],n.skips=[];let F;const f=(typeof c=="string"?c:"").split(/[\s,]+/),d=f.length;for(F=0;F<d;F++)f[F]&&(c=f[F].replace(/\*/g,".*?"),c[0]==="-"?n.skips.push(new RegExp("^"+c.slice(1)+"$")):n.names.push(new RegExp("^"+c+"$")))}s(o,"enable");function t(){const c=[...n.names.map(a),...n.skips.map(a).map(F=>"-"+F)].join(",");return n.enable(""),c}s(t,"disable");function i(c){if(c[c.length-1]==="*")return!0;let F,f;for(F=0,f=n.skips.length;F<f;F++)if(n.skips[F].test(c))return!1;for(F=0,f=n.names.length;F<f;F++)if(n.names[F].test(c))return!0;return!1}s(i,"enabled");function a(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}s(a,"toNamespace");function l(c){return c instanceof Error?c.stack||c.message:c}s(l,"coerce");function C(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s(C,"destroy"),n.enable(n.load()),n}return s(u,"setup"),ND=u,ND}s(zt,"requireCommon");var Ht;function Mi(){return Ht||(Ht=1,function(u,D){D.formatArgs=n,D.save=r,D.load=o,D.useColors=e,D.storage=t(),D.destroy=(()=>{let a=!1;return()=>{a||(a=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),D.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function e(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let a;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(a=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(a[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}s(e,"useColors");function n(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+u.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;a.splice(1,0,l,"color: inherit");let C=0,c=0;a[0].replace(/%[a-zA-Z%]/g,F=>{F!=="%%"&&(C++,F==="%c"&&(c=C))}),a.splice(c,0,l)}s(n,"formatArgs"),D.log=console.debug||console.log||(()=>{});function r(a){try{a?D.storage.setItem("debug",a):D.storage.removeItem("debug")}catch{}}s(r,"save");function o(){let a;try{a=D.storage.getItem("debug")}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=process.env.DEBUG),a}s(o,"load");function t(){try{return localStorage}catch{}}s(t,"localstorage"),u.exports=zt()(D);const{formatters:i}=u.exports;i.j=function(a){try{return JSON.stringify(a)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}}(_u,_u.exports)),_u.exports}s(Mi,"requireBrowser");var Ru={exports:{}},LD,Kt;function ji(){return Kt||(Kt=1,LD=s((u,D=process.argv)=>{const e=u.startsWith("-")?"":u.length===1?"-":"--",n=D.indexOf(e+u),r=D.indexOf("--");return n!==-1&&(r===-1||n<r)},"hasFlag")),LD}s(ji,"requireHasFlag");var GD,Vt;function Ni(){if(Vt)return GD;Vt=1;const u=ae,D=Eu,e=ji(),{env:n}=process;let r;e("no-color")||e("no-colors")||e("color=false")||e("color=never")?r=0:(e("color")||e("colors")||e("color=true")||e("color=always"))&&(r=1),"FORCE_COLOR"in n&&(n.FORCE_COLOR==="true"?r=1:n.FORCE_COLOR==="false"?r=0:r=n.FORCE_COLOR.length===0?1:Math.min(parseInt(n.FORCE_COLOR,10),3));function o(a){return a===0?!1:{level:a,hasBasic:!0,has256:a>=2,has16m:a>=3}}s(o,"translateLevel");function t(a,l){if(r===0)return 0;if(e("color=16m")||e("color=full")||e("color=truecolor"))return 3;if(e("color=256"))return 2;if(a&&!l&&r===void 0)return 0;const C=r||0;if(n.TERM==="dumb")return C;if(process.platform==="win32"){const c=u.release().split(".");return Number(c[0])>=10&&Number(c[2])>=10586?Number(c[2])>=14931?3:2:1}if("CI"in n)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(c=>c in n)||n.CI_NAME==="codeship"?1:C;if("TEAMCITY_VERSION"in n)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION)?1:0;if(n.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in n){const c=parseInt((n.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n.TERM_PROGRAM){case"iTerm.app":return c>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(n.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM)||"COLORTERM"in n?1:C}s(t,"supportsColor");function i(a){const l=t(a,a&&a.isTTY);return o(l)}return s(i,"getSupportLevel"),GD={supportsColor:i,stdout:o(t(!0,D.isatty(1))),stderr:o(t(!0,D.isatty(2)))},GD}s(Ni,"requireSupportsColor");var Yt;function Li(){return Yt||(Yt=1,function(u,D){const e=Eu,n=se;D.init=C,D.log=i,D.formatArgs=o,D.save=a,D.load=l,D.useColors=r,D.destroy=n.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),D.colors=[6,2,3,4,5,1];try{const F=Ni();F&&(F.stderr||F).level>=2&&(D.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}D.inspectOpts=Object.keys(process.env).filter(F=>/^debug_/i.test(F)).reduce((F,f)=>{const d=f.substring(6).toLowerCase().replace(/_([a-z])/g,(h,m)=>m.toUpperCase());let E=process.env[f];return/^(yes|on|true|enabled)$/i.test(E)?E=!0:/^(no|off|false|disabled)$/i.test(E)?E=!1:E==="null"?E=null:E=Number(E),F[d]=E,F},{});function r(){return"colors"in D.inspectOpts?!!D.inspectOpts.colors:e.isatty(process.stderr.fd)}s(r,"useColors");function o(F){const{namespace:f,useColors:d}=this;if(d){const E=this.color,h="\x1B[3"+(E<8?E:"8;5;"+E),m=` ${h};1m${f} \x1B[0m`;F[0]=m+F[0].split(`
64
+ `,n=D.whitespace?" = ":"=",r=[],o=D.sort?Object.keys(u).sort():Object.keys(u);let t=0;D.align&&(t=M(o.filter(l=>u[l]===null||Array.isArray(u[l])||typeof u[l]!="object").map(l=>Array.isArray(u[l])?`${l}[]`:l).concat([""]).reduce((l,C)=>M(l).length>=M(C).length?l:C)).length);let i="";const a=D.bracketedArray?"[]":"";for(const l of o){const C=u[l];if(C&&Array.isArray(C))for(const c of C)i+=M(`${l}${a}`).padEnd(t," ")+n+M(c)+e;else C&&typeof C=="object"?r.push(l):i+=M(l).padEnd(t," ")+n+M(C)+e}D.section&&i.length&&(i="["+M(D.section)+"]"+(D.newline?e+e:e)+i);for(const l of r){const C=Rt(l,".").join("\\."),c=(D.section?D.section+".":"")+C,F=PD(u[l],{...D,section:c});i.length&&F.length&&(i+=e),i+=F}return i},"encode");function Rt(u,D){var e=0,n=0,r=0,o=[];do if(r=u.indexOf(D,e),r!==-1){if(e=r+D.length,r>0&&u[r-1]==="\\")continue;o.push(u.slice(n,r)),n=r+D.length}while(r!==-1);return o.push(u.slice(n)),o}s(Rt,"splitSections");const Mt=s((u,D={})=>{D.bracketedArray=D.bracketedArray!==!1;const e=Object.create(null);let n=e,r=null;const o=/^\[([^\]]*)\]\s*$|^([^=]+)(=(.*))?$/i,t=u.split(/[\r\n]+/g),i={};for(const l of t){if(!l||l.match(/^\s*[;#]/)||l.match(/^\s*$/))continue;const C=l.match(o);if(!C)continue;if(C[1]!==void 0){if(r=Pu(C[1]),r==="__proto__"){n=Object.create(null);continue}n=e[r]=e[r]||Object.create(null);continue}const c=Pu(C[2]);let F;D.bracketedArray?F=c.length>2&&c.slice(-2)==="[]":(i[c]=(i?.[c]||0)+1,F=i[c]>1);const f=F&&c.endsWith("[]")?c.slice(0,-2):c;if(f==="__proto__")continue;const d=C[3]?Pu(C[4]):!0,E=d==="true"||d==="false"||d==="null"?JSON.parse(d):d;F&&(ID.call(n,f)?Array.isArray(n[f])||(n[f]=[n[f]]):n[f]=[]),Array.isArray(n[f])?n[f].push(E):n[f]=E}const a=[];for(const l of Object.keys(e)){if(!ID.call(e,l)||typeof e[l]!="object"||Array.isArray(e[l]))continue;const C=Rt(l,".");n=e;const c=C.pop(),F=c.replace(/\\\./g,".");for(const f of C)f!=="__proto__"&&((!ID.call(n,f)||typeof n[f]!="object")&&(n[f]=Object.create(null)),n=n[f]);n===e&&F===c||(n[F]=e[l],a.push(l))}for(const l of a)delete e[l];return e},"decode"),jt=s(u=>u.startsWith('"')&&u.endsWith('"')||u.startsWith("'")&&u.endsWith("'"),"isQuoted"),M=s(u=>typeof u!="string"||u.match(/[=\r\n]/)||u.match(/^\[/)||u.length>1&&jt(u)||u!==u.trim()?JSON.stringify(u):u.split(";").join("\\;").split("#").join("\\#"),"safe"),Pu=s(u=>{if(u=(u||"").trim(),jt(u)){u.charAt(0)==="'"&&(u=u.slice(1,-1));try{u=JSON.parse(u)}catch{}}else{let D=!1,e="";for(let n=0,r=u.length;n<r;n++){const o=u.charAt(n);if(D)"\\;#".indexOf(o)!==-1?e+=o:e+="\\"+o,D=!1;else{if(";#".indexOf(o)!==-1)break;o==="\\"?D=!0:e+=o}}return D&&(e+="\\"),e.trim()}return u},"unsafe");var Ii={parse:Mt,decode:Mt,stringify:PD,encode:PD,safe:M,unsafe:Pu},Nt=H(Ii);const Lt=s(u=>T.lstat(u).then(()=>!0,()=>!1),"fileExists"),Pi=["","conventional"],{hasOwnProperty:ki}=Object.prototype,Gt=s((u,D)=>ki.call(u,D),"hasOwn"),x=s((u,D,e)=>{if(!D)throw new S(`Invalid config property ${u}: ${e}`)},"parseAssert"),ku={OPENAI_KEY(u){if(!u)throw new S("Please set your OpenAI API key via `aicommit config set OPENAI_KEY=<your token>`");return x("OPENAI_KEY",u.startsWith("sk-"),'Must start with "sk-"'),u},locale(u){return u?(x("locale",u,"Cannot be empty"),x("locale",/^[a-z-]+$/i.test(u),"Must be a valid locale (letters and dashes/underscores). You can consult the list of codes in: https://wikipedia.org/wiki/List_of_ISO_639-1_codes"),u):"en"},generate(u){if(!u)return 1;x("generate",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return x("generate",D>0,"Must be greater than 0"),x("generate",D<=5,"Must be less or equal to 5"),D},type(u){return u?(x("type",Pi.includes(u),"Invalid commit type"),u):""},proxy(u){if(!(!u||u.length===0))return x("proxy",/^https?:\/\//.test(u),"Must be a valid URL"),u},model(u){return!u||u.length===0?"gpt-4o-mini":u},timeout(u){if(!u)return 1e4;x("timeout",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return x("timeout",D>=500,"Must be greater than 500ms"),D},temperature(u){if(!u)return .2;x("temperature",/^(2|\d)(\.\d{1,2})?$/.test(u),"Must be decimal between 0 and 2");const D=Number(u);return x("temperature",D>0,"Must be greater than 0"),x("temperature",D<=2,"Must be less than or equal to 2"),D},"max-length"(u){if(!u)return 50;x("max-length",/^\d+$/.test(u),"Must be an integer");const D=Number(u);return x("max-length",D>=20,"Must be greater than 20 characters"),D},"auto-confirm"(u){return u?typeof u=="boolean"?u:(x("auto-confirm",/^(?:true|false)$/.test(u),"Must be a boolean"),u==="true"):!1},"prepend-reference"(u){return u?typeof u=="boolean"?u:(x("prepend-reference",/^(?:true|false)$/.test(u),"Must be a boolean"),u==="true"):!1}},kD=z.join(ae.homedir(),".aicommit"),Wt=s(async()=>{if(!await Lt(kD))return Object.create(null);const D=await T.readFile(kD,"utf8");return Nt.parse(D)},"readConfigFile"),_D=s(async(u,D)=>{const e=await Wt(),n={};for(const r of Object.keys(ku)){const o=ku[r],t=u?.[r]??e[r];if(D)try{n[r]=o(t)}catch{}else n[r]=o(t)}return n},"getConfig"),_i=s(async u=>{const D=await Wt();for(const[e,n]of u){if(!Gt(ku,e))throw new S(`Invalid config property: ${e}`);const r=ku[e](n);D[e]=r}await T.writeFile(kD,Nt.stringify(D),"utf8")},"setConfigs");var RD={},MD={exports:{}},_u={exports:{}},jD,Ut;function Ri(){if(Ut)return jD;Ut=1;var u=1e3,D=u*60,e=D*60,n=e*24,r=n*7,o=n*365.25;jD=s(function(C,c){c=c||{};var F=typeof C;if(F==="string"&&C.length>0)return t(C);if(F==="number"&&isFinite(C))return c.long?a(C):i(C);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(C))},"ms");function t(C){if(C=String(C),!(C.length>100)){var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(C);if(c){var F=parseFloat(c[1]),f=(c[2]||"ms").toLowerCase();switch(f){case"years":case"year":case"yrs":case"yr":case"y":return F*o;case"weeks":case"week":case"w":return F*r;case"days":case"day":case"d":return F*n;case"hours":case"hour":case"hrs":case"hr":case"h":return F*e;case"minutes":case"minute":case"mins":case"min":case"m":return F*D;case"seconds":case"second":case"secs":case"sec":case"s":return F*u;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return F;default:return}}}}s(t,"parse");function i(C){var c=Math.abs(C);return c>=n?Math.round(C/n)+"d":c>=e?Math.round(C/e)+"h":c>=D?Math.round(C/D)+"m":c>=u?Math.round(C/u)+"s":C+"ms"}s(i,"fmtShort");function a(C){var c=Math.abs(C);return c>=n?l(C,c,n,"day"):c>=e?l(C,c,e,"hour"):c>=D?l(C,c,D,"minute"):c>=u?l(C,c,u,"second"):C+" ms"}s(a,"fmtLong");function l(C,c,F,f){var d=c>=F*1.5;return Math.round(C/F)+" "+f+(d?"s":"")}return s(l,"plural"),jD}s(Ri,"requireMs");var ND,qt;function zt(){if(qt)return ND;qt=1;function u(D){n.debug=n,n.default=n,n.coerce=l,n.disable=t,n.enable=o,n.enabled=i,n.humanize=Ri(),n.destroy=C,Object.keys(D).forEach(c=>{n[c]=D[c]}),n.names=[],n.skips=[],n.formatters={};function e(c){let F=0;for(let f=0;f<c.length;f++)F=(F<<5)-F+c.charCodeAt(f),F|=0;return n.colors[Math.abs(F)%n.colors.length]}s(e,"selectColor"),n.selectColor=e;function n(c){let F,f=null,d,E;function h(...m){if(!h.enabled)return;const w=h,P=Number(new Date),du=P-(F||P);w.diff=du,w.prev=F,w.curr=P,F=P,m[0]=n.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");let j=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,(U,on)=>{if(U==="%%")return"%";j++;const QD=n.formatters[on];if(typeof QD=="function"){const sn=m[j];U=QD.call(w,sn),m.splice(j,1),j--}return U}),n.formatArgs.call(w,m),(w.log||n.log).apply(w,m)}return s(h,"debug"),h.namespace=c,h.useColors=n.useColors(),h.color=n.selectColor(c),h.extend=r,h.destroy=n.destroy,Object.defineProperty(h,"enabled",{enumerable:!0,configurable:!1,get:s(()=>f!==null?f:(d!==n.namespaces&&(d=n.namespaces,E=n.enabled(c)),E),"get"),set:s(m=>{f=m},"set")}),typeof n.init=="function"&&n.init(h),h}s(n,"createDebug");function r(c,F){const f=n(this.namespace+(typeof F>"u"?":":F)+c);return f.log=this.log,f}s(r,"extend");function o(c){n.save(c),n.namespaces=c,n.names=[],n.skips=[];let F;const f=(typeof c=="string"?c:"").split(/[\s,]+/),d=f.length;for(F=0;F<d;F++)f[F]&&(c=f[F].replace(/\*/g,".*?"),c[0]==="-"?n.skips.push(new RegExp("^"+c.slice(1)+"$")):n.names.push(new RegExp("^"+c+"$")))}s(o,"enable");function t(){const c=[...n.names.map(a),...n.skips.map(a).map(F=>"-"+F)].join(",");return n.enable(""),c}s(t,"disable");function i(c){if(c[c.length-1]==="*")return!0;let F,f;for(F=0,f=n.skips.length;F<f;F++)if(n.skips[F].test(c))return!1;for(F=0,f=n.names.length;F<f;F++)if(n.names[F].test(c))return!0;return!1}s(i,"enabled");function a(c){return c.toString().substring(2,c.toString().length-2).replace(/\.\*\?$/,"*")}s(a,"toNamespace");function l(c){return c instanceof Error?c.stack||c.message:c}s(l,"coerce");function C(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return s(C,"destroy"),n.enable(n.load()),n}return s(u,"setup"),ND=u,ND}s(zt,"requireCommon");var Ht;function Mi(){return Ht||(Ht=1,function(u,D){D.formatArgs=n,D.save=r,D.load=o,D.useColors=e,D.storage=t(),D.destroy=(()=>{let a=!1;return()=>{a||(a=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),D.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function e(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let a;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(a=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(a[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}s(e,"useColors");function n(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+u.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;a.splice(1,0,l,"color: inherit");let C=0,c=0;a[0].replace(/%[a-zA-Z%]/g,F=>{F!=="%%"&&(C++,F==="%c"&&(c=C))}),a.splice(c,0,l)}s(n,"formatArgs"),D.log=console.debug||console.log||(()=>{});function r(a){try{a?D.storage.setItem("debug",a):D.storage.removeItem("debug")}catch{}}s(r,"save");function o(){let a;try{a=D.storage.getItem("debug")}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=process.env.DEBUG),a}s(o,"load");function t(){try{return localStorage}catch{}}s(t,"localstorage"),u.exports=zt()(D);const{formatters:i}=u.exports;i.j=function(a){try{return JSON.stringify(a)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}}(_u,_u.exports)),_u.exports}s(Mi,"requireBrowser");var Ru={exports:{}},LD,Kt;function ji(){return Kt||(Kt=1,LD=s((u,D=process.argv)=>{const e=u.startsWith("-")?"":u.length===1?"-":"--",n=D.indexOf(e+u),r=D.indexOf("--");return n!==-1&&(r===-1||n<r)},"hasFlag")),LD}s(ji,"requireHasFlag");var GD,Vt;function Ni(){if(Vt)return GD;Vt=1;const u=ae,D=Eu,e=ji(),{env:n}=process;let r;e("no-color")||e("no-colors")||e("color=false")||e("color=never")?r=0:(e("color")||e("colors")||e("color=true")||e("color=always"))&&(r=1),"FORCE_COLOR"in n&&(n.FORCE_COLOR==="true"?r=1:n.FORCE_COLOR==="false"?r=0:r=n.FORCE_COLOR.length===0?1:Math.min(parseInt(n.FORCE_COLOR,10),3));function o(a){return a===0?!1:{level:a,hasBasic:!0,has256:a>=2,has16m:a>=3}}s(o,"translateLevel");function t(a,l){if(r===0)return 0;if(e("color=16m")||e("color=full")||e("color=truecolor"))return 3;if(e("color=256"))return 2;if(a&&!l&&r===void 0)return 0;const C=r||0;if(n.TERM==="dumb")return C;if(process.platform==="win32"){const c=u.release().split(".");return Number(c[0])>=10&&Number(c[2])>=10586?Number(c[2])>=14931?3:2:1}if("CI"in n)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(c=>c in n)||n.CI_NAME==="codeship"?1:C;if("TEAMCITY_VERSION"in n)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(n.TEAMCITY_VERSION)?1:0;if(n.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in n){const c=parseInt((n.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(n.TERM_PROGRAM){case"iTerm.app":return c>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(n.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(n.TERM)||"COLORTERM"in n?1:C}s(t,"supportsColor");function i(a){const l=t(a,a&&a.isTTY);return o(l)}return s(i,"getSupportLevel"),GD={supportsColor:i,stdout:o(t(!0,D.isatty(1))),stderr:o(t(!0,D.isatty(2)))},GD}s(Ni,"requireSupportsColor");var Yt;function Li(){return Yt||(Yt=1,function(u,D){const e=Eu,n=se;D.init=C,D.log=i,D.formatArgs=o,D.save=a,D.load=l,D.useColors=r,D.destroy=n.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),D.colors=[6,2,3,4,5,1];try{const F=Ni();F&&(F.stderr||F).level>=2&&(D.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}D.inspectOpts=Object.keys(process.env).filter(F=>/^debug_/i.test(F)).reduce((F,f)=>{const d=f.substring(6).toLowerCase().replace(/_([a-z])/g,(h,m)=>m.toUpperCase());let E=process.env[f];return/^(yes|on|true|enabled)$/i.test(E)?E=!0:/^(no|off|false|disabled)$/i.test(E)?E=!1:E==="null"?E=null:E=Number(E),F[d]=E,F},{});function r(){return"colors"in D.inspectOpts?!!D.inspectOpts.colors:e.isatty(process.stderr.fd)}s(r,"useColors");function o(F){const{namespace:f,useColors:d}=this;if(d){const E=this.color,h="\x1B[3"+(E<8?E:"8;5;"+E),m=` ${h};1m${f} \x1B[0m`;F[0]=m+F[0].split(`
65
65
  `).join(`
66
66
  `+m),F.push(h+"m+"+u.exports.humanize(this.diff)+"\x1B[0m")}else F[0]=t()+f+" "+F[0]}s(o,"formatArgs");function t(){return D.inspectOpts.hideDate?"":new Date().toISOString()+" "}s(t,"getDate");function i(...F){return process.stderr.write(n.formatWithOptions(D.inspectOpts,...F)+`
67
67
  `)}s(i,"log");function a(F){F?process.env.DEBUG=F:delete process.env.DEBUG}s(a,"save");function l(){return process.env.DEBUG}s(l,"load");function C(F){F.inspectOpts={};const f=Object.keys(D.inspectOpts);for(let d=0;d<f.length;d++)F.inspectOpts[f[d]]=D.inspectOpts[f[d]]}s(C,"init"),u.exports=zt()(D);const{formatters:c}=u.exports;c.o=function(F){return this.inspectOpts.colors=this.useColors,n.inspect(F,this.inspectOpts).split(`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@negoziator/ai-commit",
3
- "version": "1.2.62",
3
+ "version": "1.2.64",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -20,8 +20,5 @@
20
20
  "bin": {
21
21
  "aicommit": "./dist/cli.mjs",
22
22
  "aic": "./dist/cli.mjs"
23
- },
24
- "dependencies": {
25
- "@dqbd/tiktoken": "^1.0.2"
26
23
  }
27
24
  }