@negoziator/ai-commit 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,6 +7,7 @@
7
7
  </div>
8
8
 
9
9
  ---
10
+ _Originated from [Nutlope/aicommits](https://github.com/Nutlope/aicommits_)_ which is no longer maintained.
10
11
 
11
12
  ## Setup
12
13
 
@@ -41,7 +42,7 @@ aicommit --version
41
42
  If it's not the [latest version](https://github.com/negoziator/aicommit/releases/latest), run:
42
43
 
43
44
  ```sh
44
- npm update -g @negozitor/ai-commit
45
+ npm update -g @negoziator/ai-commit
45
46
  ```
46
47
 
47
48
  ## Usage
@@ -260,8 +261,7 @@ Video coming soon where I rebuild it from scratch to show you how to easily buil
260
261
 
261
262
  ## Maintainers
262
263
 
263
- - **Lars Schou
264
- **: [@NegoZiatoR](https://github.com/NegoZiatoR) [<img src="https://img.shields.io/twitter/follow/negoziator?style=flat&label=negoziator&logo=twitter&color=0bf&logoColor=fff" align="center">](https://twitter.com/negoziator)
264
+ - **Lars Schou**: [@NegoZiatoR](https://github.com/NegoZiatoR) [<img src="https://img.shields.io/twitter/follow/negoziator?style=flat&label=negoziator&logo=twitter&color=0bf&logoColor=fff" align="center">](https://twitter.com/negoziator)
265
265
 
266
266
  ## Contributing
267
267
 
package/dist/cli.mjs CHANGED
@@ -19,7 +19,7 @@ import ce from"tty";import{Buffer as $n}from"node:buffer";import U from"node:pat
19
19
  `:"")+(n?this.indentText({text:this.render(n),spaces:u}):"")}
20
20
  `}table({tableData:t,tableOptions:n,tableBreakpoints:u}){return _r(t.map(r=>r.map(o=>this.render(o))),u?Mr(u):n)}flagParameter(t){return t===Boolean?"":t===String?"<string>":t===Number?"<number>":Array.isArray(t)?this.flagParameter(t[0]):"<value>"}flagOperator(t){return" "}flagName(t){const{flag:n,flagFormatted:u,aliasesEnabled:r,aliasFormatted:o}=t;let s="";if(o?s+=`${o}, `:r&&(s+=" "),s+=u,"placeholder"in n&&typeof n.placeholder=="string")s+=`${this.flagOperator(t)}${n.placeholder}`;else{const i=this.flagParameter("type"in n?n.type:n);i&&(s+=`${this.flagOperator(t)}${i}`)}return s}flagDefault(t){return JSON.stringify(t)}flagDescription({flag:t}){let n="description"in t?t.description??"":"";if("default"in t){let{default:u}=t;typeof u=="function"&&(u=u()),u&&(n+=` (default: ${this.flagDefault(u)})`)}return n}render(t){if(typeof t=="string")return t;if(Array.isArray(t))return t.map(n=>this.render(n)).join(`
21
21
  `);if("type"in t&&this[t.type]){const n=this[t.type];if(typeof n=="function")return n.call(this,t.data)}throw new Error(`Invalid node type: ${JSON.stringify(t)}`)}}const Ne=/^[\w.-]+$/,{stringify:I}=JSON,Zr=/[|\\{}()[\]^$+*?.]/;function Le(e){const t=[];let n,u;for(const r of e){if(u)throw new Error(`Invalid parameter: Spread parameter ${I(u)} must be last`);const o=r[0],s=r[r.length-1];let i;if(o==="<"&&s===">"&&(i=!0,n))throw new Error(`Invalid parameter: Required parameter ${I(r)} cannot come after optional parameter ${I(n)}`);if(o==="["&&s==="]"&&(i=!1,n=r),i===void 0)throw new Error(`Invalid parameter: ${I(r)}. Must be wrapped in <> (required parameter) or [] (optional parameter)`);let D=r.slice(1,-1);const l=D.slice(-3)==="...";l&&(u=r,D=D.slice(0,-3));const f=D.match(Zr);if(f)throw new Error(`Invalid parameter: ${I(r)}. Invalid character found ${I(f[0])}`);t.push({name:D,required:i,spread:l})}return t}function Ge(e,t,n,u){for(let r=0;r<t.length;r+=1){const{name:o,required:s,spread:i}=t[r],D=jr(o);if(D in e)throw new Error(`Invalid parameter: ${I(o)} is used more than once.`);const l=i?n.slice(r):n[r];if(i&&(r=t.length),s&&(!l||i&&l.length===0))return console.error(`Error: Missing required parameter ${I(o)}
22
- `),u(),process.exit(1);e[D]=l}}function Qr(e){return e===void 0||e!==!1}function su(e,t,n,u){const r={...t.flags},o=t.version;o&&(r.version={type:Boolean,description:"Show version"});const{help:s}=t,i=Qr(s);i&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const D=tr(r,u,{ignore:t.ignoreArgv}),l=()=>{console.log(t.version)};if(o&&D.flags.version===!0)return l(),process.exit(0);const f=new Xr,a=i&&s?.render?s.render:p=>f.render(p),c=p=>{const h=Yr({...t,...p?{help:p}:{},flags:r});console.log(a(h,f))};if(i&&D.flags.help===!0)return c(),process.exit(0);if(t.parameters){let{parameters:p}=t,h=D._;const C=p.indexOf("--"),F=p.slice(C+1),B=Object.create(null);if(C>-1&&F.length>0){p=p.slice(0,C);const P=D._["--"];h=h.slice(0,-P.length||void 0),Ge(B,Le(p),h,c),Ge(B,Le(F),P,c)}else Ge(B,Le(p),h,c);Object.assign(D._,B)}const d={...D,showVersion:l,showHelp:c};return typeof n=="function"&&n(d),{command:e,...d}}function eo(e,t){const n=new Map;for(const u of t){const r=[u.options.name],{alias:o}=u.options;o&&(Array.isArray(o)?r.push(...o):r.push(o));for(const s of r){if(n.has(s))throw new Error(`Duplicate command name found: ${I(s)}`);n.set(s,u)}}return n.get(e)}function to(e,t,n=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!Ne.test(e.name)))throw new Error(`Invalid script name: ${I(e.name)}`);const u=n[0];if(e.commands&&Ne.test(u)){const r=eo(u,e.commands);if(r)return su(r.options.name,{...r.options,parent:e},r.callback,n.slice(1))}return su(void 0,e,t,n)}function iu(e,t){if(!e)throw new Error("Command options are required");const{name:n}=e;if(e.name===void 0)throw new Error("Command name is required");if(!Ne.test(n))throw new Error(`Invalid command name ${JSON.stringify(n)}. Command names must be one word.`);return{options:e,callback:t}}var Du="1.0.7",uo="Writes your git commit messages for you with AI",w=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},M={},no={get exports(){return M},set exports(e){M=e}},Ue,au;function ro(){if(au)return Ue;au=1,Ue=u,u.sync=r;var e=Ie;function t(o,s){var i=s.pathExt!==void 0?s.pathExt:process.env.PATHEXT;if(!i||(i=i.split(";"),i.indexOf("")!==-1))return!0;for(var D=0;D<i.length;D++){var l=i[D].toLowerCase();if(l&&o.substr(-l.length).toLowerCase()===l)return!0}return!1}function n(o,s,i){return!o.isSymbolicLink()&&!o.isFile()?!1:t(s,i)}function u(o,s,i){e.stat(o,function(D,l){i(D,D?!1:n(l,o,s))})}function r(o,s){return n(e.statSync(o),o,s)}return Ue}var We,cu;function oo(){if(cu)return We;cu=1,We=t,t.sync=n;var e=Ie;function t(o,s,i){e.stat(o,function(D,l){i(D,D?!1:u(l,s))})}function n(o,s){return u(e.statSync(o),s)}function u(o,s){return o.isFile()&&r(o,s)}function r(o,s){var i=o.mode,D=o.uid,l=o.gid,f=s.uid!==void 0?s.uid:process.getuid&&process.getuid(),a=s.gid!==void 0?s.gid:process.getgid&&process.getgid(),c=parseInt("100",8),d=parseInt("010",8),p=parseInt("001",8),h=c|d,C=i&p||i&d&&l===a||i&c&&D===f||i&h&&f===0;return C}return We}var he;process.platform==="win32"||w.TESTING_WINDOWS?he=ro():he=oo();var so=He;He.sync=io;function He(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(u,r){He(e,t||{},function(o,s){o?r(o):u(s)})})}he(e,t||{},function(u,r){u&&(u.code==="EACCES"||t&&t.ignoreErrors)&&(u=null,r=!1),n(u,r)})}function io(e,t){try{return he.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}const H=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",lu=W,Do=H?";":":",fu=so,du=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),pu=(e,t)=>{const n=t.colon||Do,u=e.match(/\//)||H&&e.match(/\\/)?[""]:[...H?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],r=H?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=H?r.split(n):[""];return H&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:u,pathExt:o,pathExtExe:r}},mu=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});const{pathEnv:u,pathExt:r,pathExtExe:o}=pu(e,t),s=[],i=l=>new Promise((f,a)=>{if(l===u.length)return t.all&&s.length?f(s):a(du(e));const c=u[l],d=/^".*"$/.test(c)?c.slice(1,-1):c,p=lu.join(d,e),h=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+p:p;f(D(h,l,0))}),D=(l,f,a)=>new Promise((c,d)=>{if(a===r.length)return c(i(f+1));const p=r[a];fu(l+p,{pathExt:o},(h,C)=>{if(!h&&C)if(t.all)s.push(l+p);else return c(l+p);return c(D(l,f,a+1))})});return n?i(0).then(l=>n(null,l),n):i(0)},ao=(e,t)=>{t=t||{};const{pathEnv:n,pathExt:u,pathExtExe:r}=pu(e,t),o=[];for(let s=0;s<n.length;s++){const i=n[s],D=/^".*"$/.test(i)?i.slice(1,-1):i,l=lu.join(D,e),f=!D&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let a=0;a<u.length;a++){const c=f+u[a];try{if(fu.sync(c,{pathExt:r}))if(t.all)o.push(c);else return c}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw du(e)};var co=mu;mu.sync=ao;var Ce={},lo={get exports(){return Ce},set exports(e){Ce=e}};const hu=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(u=>u.toUpperCase()==="PATH")||"Path"};lo.exports=hu,Ce.default=hu;const Cu=W,fo=co,po=Ce;function Fu(e,t){const n=e.options.env||process.env,u=process.cwd(),r=e.options.cwd!=null,o=r&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let s;try{s=fo.sync(e.command,{path:n[po({env:n})],pathExt:t?Cu.delimiter:void 0})}catch{}finally{o&&process.chdir(u)}return s&&(s=Cu.resolve(r?e.options.cwd:"",s)),s}function mo(e){return Fu(e)||Fu(e,!0)}var ho=mo,qe={};const ze=/([()\][%!^"`<>&|;, *?])/g;function Co(e){return e=e.replace(ze,"^$1"),e}function Fo(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(ze,"^$1"),t&&(e=e.replace(ze,"^$1")),e}qe.command=Co,qe.argument=Fo;var go=/^#!(.*)/;const Eo=go;var yo=(e="")=>{const t=e.match(Eo);if(!t)return null;const[n,u]=t[0].replace(/#! ?/,"").split(" "),r=n.split("/").pop();return r==="env"?u:u?`${r} ${u}`:r};const Ke=Ie,bo=yo;function wo(e){const n=Buffer.alloc(150);let u;try{u=Ke.openSync(e,"r"),Ke.readSync(u,n,0,150,0),Ke.closeSync(u)}catch{}return bo(n.toString())}var Bo=wo;const $o=W,gu=ho,Eu=qe,vo=Bo,Ao=process.platform==="win32",xo=/\.(?:com|exe)$/i,So=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Oo(e){e.file=gu(e);const t=e.file&&vo(e.file);return t?(e.args.unshift(e.file),e.command=t,gu(e)):e.file}function To(e){if(!Ao)return e;const t=Oo(e),n=!xo.test(t);if(e.options.forceShell||n){const u=So.test(t);e.command=$o.normalize(e.command),e.command=Eu.command(e.command),e.args=e.args.map(o=>Eu.argument(o,u));const r=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${r}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Io(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);const u={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?u:To(u)}var Po=Io;const Ve=process.platform==="win32";function Ye(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function _o(e,t){if(!Ve)return;const n=e.emit;e.emit=function(u,r){if(u==="exit"){const o=yu(r,t);if(o)return n.call(e,"error",o)}return n.apply(e,arguments)}}function yu(e,t){return Ve&&e===1&&!t.file?Ye(t.original,"spawn"):null}function Ro(e,t){return Ve&&e===1&&!t.file?Ye(t.original,"spawnSync"):null}var ko={hookChildProcess:_o,verifyENOENT:yu,verifyENOENTSync:Ro,notFoundError:Ye};const bu=vn,Je=Po,Xe=ko;function wu(e,t,n){const u=Je(e,t,n),r=bu.spawn(u.command,u.args,u.options);return Xe.hookChildProcess(r,u),r}function Mo(e,t,n){const u=Je(e,t,n),r=bu.spawnSync(u.command,u.args,u.options);return r.error=r.error||Xe.verifyENOENTSync(r.status,u),r}no.exports=wu,M.spawn=wu,M.sync=Mo,M._parse=Je,M._enoent=Xe;function jo(e){const t=typeof e=="string"?`
22
+ `),u(),process.exit(1);e[D]=l}}function Qr(e){return e===void 0||e!==!1}function su(e,t,n,u){const r={...t.flags},o=t.version;o&&(r.version={type:Boolean,description:"Show version"});const{help:s}=t,i=Qr(s);i&&!("help"in r)&&(r.help={type:Boolean,alias:"h",description:"Show help"});const D=tr(r,u,{ignore:t.ignoreArgv}),l=()=>{console.log(t.version)};if(o&&D.flags.version===!0)return l(),process.exit(0);const f=new Xr,a=i&&s?.render?s.render:p=>f.render(p),c=p=>{const h=Yr({...t,...p?{help:p}:{},flags:r});console.log(a(h,f))};if(i&&D.flags.help===!0)return c(),process.exit(0);if(t.parameters){let{parameters:p}=t,h=D._;const C=p.indexOf("--"),F=p.slice(C+1),B=Object.create(null);if(C>-1&&F.length>0){p=p.slice(0,C);const P=D._["--"];h=h.slice(0,-P.length||void 0),Ge(B,Le(p),h,c),Ge(B,Le(F),P,c)}else Ge(B,Le(p),h,c);Object.assign(D._,B)}const d={...D,showVersion:l,showHelp:c};return typeof n=="function"&&n(d),{command:e,...d}}function eo(e,t){const n=new Map;for(const u of t){const r=[u.options.name],{alias:o}=u.options;o&&(Array.isArray(o)?r.push(...o):r.push(o));for(const s of r){if(n.has(s))throw new Error(`Duplicate command name found: ${I(s)}`);n.set(s,u)}}return n.get(e)}function to(e,t,n=process.argv.slice(2)){if(!e)throw new Error("Options is required");if("name"in e&&(!e.name||!Ne.test(e.name)))throw new Error(`Invalid script name: ${I(e.name)}`);const u=n[0];if(e.commands&&Ne.test(u)){const r=eo(u,e.commands);if(r)return su(r.options.name,{...r.options,parent:e},r.callback,n.slice(1))}return su(void 0,e,t,n)}function iu(e,t){if(!e)throw new Error("Command options are required");const{name:n}=e;if(e.name===void 0)throw new Error("Command name is required");if(!Ne.test(n))throw new Error(`Invalid command name ${JSON.stringify(n)}. Command names must be one word.`);return{options:e,callback:t}}var Du="1.0.8",uo="Writes your git commit messages for you with AI",w=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},M={},no={get exports(){return M},set exports(e){M=e}},Ue,au;function ro(){if(au)return Ue;au=1,Ue=u,u.sync=r;var e=Ie;function t(o,s){var i=s.pathExt!==void 0?s.pathExt:process.env.PATHEXT;if(!i||(i=i.split(";"),i.indexOf("")!==-1))return!0;for(var D=0;D<i.length;D++){var l=i[D].toLowerCase();if(l&&o.substr(-l.length).toLowerCase()===l)return!0}return!1}function n(o,s,i){return!o.isSymbolicLink()&&!o.isFile()?!1:t(s,i)}function u(o,s,i){e.stat(o,function(D,l){i(D,D?!1:n(l,o,s))})}function r(o,s){return n(e.statSync(o),o,s)}return Ue}var We,cu;function oo(){if(cu)return We;cu=1,We=t,t.sync=n;var e=Ie;function t(o,s,i){e.stat(o,function(D,l){i(D,D?!1:u(l,s))})}function n(o,s){return u(e.statSync(o),s)}function u(o,s){return o.isFile()&&r(o,s)}function r(o,s){var i=o.mode,D=o.uid,l=o.gid,f=s.uid!==void 0?s.uid:process.getuid&&process.getuid(),a=s.gid!==void 0?s.gid:process.getgid&&process.getgid(),c=parseInt("100",8),d=parseInt("010",8),p=parseInt("001",8),h=c|d,C=i&p||i&d&&l===a||i&c&&D===f||i&h&&f===0;return C}return We}var he;process.platform==="win32"||w.TESTING_WINDOWS?he=ro():he=oo();var so=He;He.sync=io;function He(e,t,n){if(typeof t=="function"&&(n=t,t={}),!n){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(u,r){He(e,t||{},function(o,s){o?r(o):u(s)})})}he(e,t||{},function(u,r){u&&(u.code==="EACCES"||t&&t.ignoreErrors)&&(u=null,r=!1),n(u,r)})}function io(e,t){try{return he.sync(e,t||{})}catch(n){if(t&&t.ignoreErrors||n.code==="EACCES")return!1;throw n}}const H=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",lu=W,Do=H?";":":",fu=so,du=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),pu=(e,t)=>{const n=t.colon||Do,u=e.match(/\//)||H&&e.match(/\\/)?[""]:[...H?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(n)],r=H?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=H?r.split(n):[""];return H&&e.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:u,pathExt:o,pathExtExe:r}},mu=(e,t,n)=>{typeof t=="function"&&(n=t,t={}),t||(t={});const{pathEnv:u,pathExt:r,pathExtExe:o}=pu(e,t),s=[],i=l=>new Promise((f,a)=>{if(l===u.length)return t.all&&s.length?f(s):a(du(e));const c=u[l],d=/^".*"$/.test(c)?c.slice(1,-1):c,p=lu.join(d,e),h=!d&&/^\.[\\\/]/.test(e)?e.slice(0,2)+p:p;f(D(h,l,0))}),D=(l,f,a)=>new Promise((c,d)=>{if(a===r.length)return c(i(f+1));const p=r[a];fu(l+p,{pathExt:o},(h,C)=>{if(!h&&C)if(t.all)s.push(l+p);else return c(l+p);return c(D(l,f,a+1))})});return n?i(0).then(l=>n(null,l),n):i(0)},ao=(e,t)=>{t=t||{};const{pathEnv:n,pathExt:u,pathExtExe:r}=pu(e,t),o=[];for(let s=0;s<n.length;s++){const i=n[s],D=/^".*"$/.test(i)?i.slice(1,-1):i,l=lu.join(D,e),f=!D&&/^\.[\\\/]/.test(e)?e.slice(0,2)+l:l;for(let a=0;a<u.length;a++){const c=f+u[a];try{if(fu.sync(c,{pathExt:r}))if(t.all)o.push(c);else return c}catch{}}}if(t.all&&o.length)return o;if(t.nothrow)return null;throw du(e)};var co=mu;mu.sync=ao;var Ce={},lo={get exports(){return Ce},set exports(e){Ce=e}};const hu=(e={})=>{const t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(u=>u.toUpperCase()==="PATH")||"Path"};lo.exports=hu,Ce.default=hu;const Cu=W,fo=co,po=Ce;function Fu(e,t){const n=e.options.env||process.env,u=process.cwd(),r=e.options.cwd!=null,o=r&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(e.options.cwd)}catch{}let s;try{s=fo.sync(e.command,{path:n[po({env:n})],pathExt:t?Cu.delimiter:void 0})}catch{}finally{o&&process.chdir(u)}return s&&(s=Cu.resolve(r?e.options.cwd:"",s)),s}function mo(e){return Fu(e)||Fu(e,!0)}var ho=mo,qe={};const ze=/([()\][%!^"`<>&|;, *?])/g;function Co(e){return e=e.replace(ze,"^$1"),e}function Fo(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(ze,"^$1"),t&&(e=e.replace(ze,"^$1")),e}qe.command=Co,qe.argument=Fo;var go=/^#!(.*)/;const Eo=go;var yo=(e="")=>{const t=e.match(Eo);if(!t)return null;const[n,u]=t[0].replace(/#! ?/,"").split(" "),r=n.split("/").pop();return r==="env"?u:u?`${r} ${u}`:r};const Ke=Ie,bo=yo;function wo(e){const n=Buffer.alloc(150);let u;try{u=Ke.openSync(e,"r"),Ke.readSync(u,n,0,150,0),Ke.closeSync(u)}catch{}return bo(n.toString())}var Bo=wo;const $o=W,gu=ho,Eu=qe,vo=Bo,Ao=process.platform==="win32",xo=/\.(?:com|exe)$/i,So=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Oo(e){e.file=gu(e);const t=e.file&&vo(e.file);return t?(e.args.unshift(e.file),e.command=t,gu(e)):e.file}function To(e){if(!Ao)return e;const t=Oo(e),n=!xo.test(t);if(e.options.forceShell||n){const u=So.test(t);e.command=$o.normalize(e.command),e.command=Eu.command(e.command),e.args=e.args.map(o=>Eu.argument(o,u));const r=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${r}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function Io(e,t,n){t&&!Array.isArray(t)&&(n=t,t=null),t=t?t.slice(0):[],n=Object.assign({},n);const u={command:e,args:t,options:n,file:void 0,original:{command:e,args:t}};return n.shell?u:To(u)}var Po=Io;const Ve=process.platform==="win32";function Ye(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function _o(e,t){if(!Ve)return;const n=e.emit;e.emit=function(u,r){if(u==="exit"){const o=yu(r,t);if(o)return n.call(e,"error",o)}return n.apply(e,arguments)}}function yu(e,t){return Ve&&e===1&&!t.file?Ye(t.original,"spawn"):null}function Ro(e,t){return Ve&&e===1&&!t.file?Ye(t.original,"spawnSync"):null}var ko={hookChildProcess:_o,verifyENOENT:yu,verifyENOENTSync:Ro,notFoundError:Ye};const bu=vn,Je=Po,Xe=ko;function wu(e,t,n){const u=Je(e,t,n),r=bu.spawn(u.command,u.args,u.options);return Xe.hookChildProcess(r,u),r}function Mo(e,t,n){const u=Je(e,t,n),r=bu.spawnSync(u.command,u.args,u.options);return r.error=r.error||Xe.verifyENOENTSync(r.status,u),r}no.exports=wu,M.spawn=wu,M.sync=Mo,M._parse=Je,M._enoent=Xe;function jo(e){const t=typeof e=="string"?`
23
23
  `:`
24
24
  `.charCodeAt(),n=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===n&&(e=e.slice(0,-1)),e}function Bu(e={}){const{env:t=process.env,platform:n=process.platform}=e;return n!=="win32"?"PATH":Object.keys(t).reverse().find(u=>u.toUpperCase()==="PATH")||"Path"}function No(e={}){const{cwd:t=b.cwd(),path:n=b.env[Bu()],execPath:u=b.execPath}=e;let r;const o=t instanceof URL?An.fileURLToPath(t):t;let s=U.resolve(o);const i=[];for(;r!==s;)i.push(U.join(s,"node_modules/.bin")),r=s,s=U.resolve(s,"..");return i.push(U.resolve(o,u,"..")),[...i,n].join(U.delimiter)}function Lo({env:e=b.env,...t}={}){e={...e};const n=Bu({env:e});return t.path=e[n],e[n]=No(t),e}const Go=(e,t,n,u)=>{if(n==="length"||n==="prototype"||n==="arguments"||n==="caller")return;const r=Object.getOwnPropertyDescriptor(e,n),o=Object.getOwnPropertyDescriptor(t,n);!Uo(r,o)&&u||Object.defineProperty(e,n,o)},Uo=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},Wo=(e,t)=>{const n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)},Ho=(e,t)=>`/* Wrapped ${e}*/
25
25
  ${t}`,qo=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),zo=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Ko=(e,t,n)=>{const u=n===""?"":`with ${n.trim()}() `,r=Ho.bind(null,u,t.toString());Object.defineProperty(r,"name",zo),Object.defineProperty(e,"toString",{...qo,value:r})};function Vo(e,t,{ignoreNonConfigurable:n=!1}={}){const{name:u}=e;for(const r of Reflect.ownKeys(t))Go(e,t,r,n);return Wo(e,t),Ko(e,t,u),e}const Fe=new WeakMap,$u=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let n,u=0;const r=e.displayName||e.name||"<anonymous>",o=function(...s){if(Fe.set(o,++u),u===1)n=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${r}\` can only be called once`);return n};return Vo(o,e),Fe.set(o,u),o};$u.callCount=e=>{if(!Fe.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Fe.get(e)};const Yo=function(){const e=Au-vu+1;return Array.from({length:e},Jo)},Jo=function(e,t){return{name:`SIGRT${t+1}`,number:vu+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},vu=34,Au=64,Xo=[{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"}],xu=function(){const e=Yo();return[...Xo,...e].map(Zo)},Zo=function({name:e,number:t,description:n,action:u,forced:r=!1,standard:o}){const{signals:{[e]:s}}=Rt,i=s!==void 0;return{name:e,number:i?s:t,description:n,supported:i,action:u,forced:r,standard:o}},Qo=function(){const e=xu();return Object.fromEntries(e.map(es))},es=function({name:e,number:t,description:n,supported:u,action:r,forced:o,standard:s}){return[e,{name:e,number:t,description:n,supported:u,action:r,forced:o,standard:s}]},ts=Qo(),us=function(){const e=xu(),t=Au+1,n=Array.from({length:t},(u,r)=>ns(r,e));return Object.assign({},...n)},ns=function(e,t){const n=rs(e,t);if(n===void 0)return{};const{name:u,description:r,supported:o,action:s,forced:i,standard:D}=n;return{[e]:{name:u,number:e,description:r,supported:o,action:s,forced:i,standard:D}}},rs=function(e,t){const n=t.find(({name:u})=>Rt.signals[u]===e);return n!==void 0?n:t.find(u=>u.number===e)};us();const os=({timedOut:e,timeout:t,errorCode:n,signal:u,signalDescription:r,exitCode:o,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":n!==void 0?`failed with ${n}`:u!==void 0?`was killed with ${u} (${r})`:o!==void 0?`failed with exit code ${o}`:"failed",Su=({stdout:e,stderr:t,all:n,error:u,signal:r,exitCode:o,command:s,escapedCommand:i,timedOut:D,isCanceled:l,killed:f,parsed:{options:{timeout:a}}})=>{o=o===null?void 0:o,r=r===null?void 0:r;const c=r===void 0?void 0:ts[r].description,d=u&&u.code,h=`Command ${os({timedOut:D,timeout:a,errorCode:d,signal:r,signalDescription:c,exitCode:o,isCanceled:l})}: ${s}`,C=Object.prototype.toString.call(u)==="[object Error]",F=C?`${h}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@negoziator/ai-commit",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },