@negoziator/ai-commit 1.2.94 → 1.2.96
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/dist/cli.mjs +2 -2
- package/package.json +1 -1
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 Yu(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(Yu,"w$1");function Vu(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(Vu,"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),Vu(w,Yu(d),E,F),Vu(w,Yu(m),P,F)}else Vu(w,Yu(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.
|
|
22
|
+
`),n(),process.exit(1);u[a]=l}}s(Vu,"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),Vu(w,Yu(d),E,F),Vu(w,Yu(m),P,F)}else Vu(w,Yu(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.96",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=Yr;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 Yr(u,D){try{return bu.sync(u,D||{})}catch(e){if(D&&D.ignoreErrors||e.code==="EACCES")return!1;throw e}}s(Yr,"sync");const Y=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",ke=z,Vr=Y?";":":",_e=Kr,Re=s(u=>Object.assign(new Error(`not found: ${u}`),{code:"ENOENT"}),"getNotFoundError"),Me=s((u,D)=>{const e=D.colon||Vr,n=u.match(/\//)||Y&&u.match(/\\/)?[""]:[...Y?[process.cwd()]:[],...(D.path||process.env.PATH||"").split(e)],r=Y?D.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=Y?r.split(e):[""];return Y&&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,Ye=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");Ye.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-Ve+1;return Array.from({length:u},Go)},"getRealtimeSignals"),Go=s((u,D)=>({name:`SIGRT${D+1}`,number:Ve+D,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),"getRealtimeSignal"),Ve=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)=>Yo(r,u));return Object.assign({},...e)},"getSignalsByNumber"),Yo=s((u,D)=>{const e=Vo(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"),Vo=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(`
|
|
@@ -74,7 +74,7 @@ ${OD}Please open a Bug report with the information above:`),console.error(`${OD}
|
|
|
74
74
|
`;const F=Da.default(o);o.write(`${a}\r
|
|
75
75
|
`);const{statusCode:f,buffered:d}=yield F;if(f===200){if(D.once("socket",ea),e.secureEndpoint){fu("Upgrading socket connection to TLS");const h=e.servername||e.host;return Xt.default.connect(Object.assign(Object.assign({},ra(e,"host","hostname","path","port")),{socket:o,servername:h}))}return o}o.destroy();const E=new Zt.default.Socket({writable:!1});return E.readable=!0,D.once("socket",h=>{fu("replaying proxy buffer for failed request"),Xi.default(h.listenerCount("data")>0),h.push(d),h.push(null)}),E})}};s(XD,"HttpsProxyAgent");let HD=XD;RD.default=HD;function ea(u){u.resume()}s(ea,"resume");function ta(u,D){return!!(!D&&u===80||D&&u===443)}s(ta,"isDefaultPort");function na(u){return typeof u=="string"?/^https:?$/i.test(u):!1}s(na,"isHTTPS");function ra(u,...D){const e={};let n;for(n in u)D.includes(n)||(e[n]=u[n]);return e}s(ra,"omit");var oa=A&&A.__importDefault||function(u){return u&&u.__esModule?u:{default:u}};const KD=oa(RD);function Qt(u){return new KD.default(u)}s(Qt,"createHttpsProxyAgent"),function(u){u.HttpsProxyAgent=KD.default,u.prototype=KD.default.prototype}(Qt||(Qt={}));const sa={"":"<commit message>",conventional:"<type>(<optional scope>): <commit message>"},ia=s(u=>`The output response must be in format:
|
|
76
76
|
${sa[u]}`,"specifyCommitFormat"),aa={"":"",conventional:`Choose a type from the type-to-description JSON below that best describes the git diff:
|
|
77
|
-
${JSON.stringify({docs:"Documentation only changes",style:"Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",refactor:"A code change that neither fixes a bug nor adds a feature",perf:"A code change that improves performance",test:"Adding missing tests or correcting existing tests",build:"Changes that affect the build system or external dependencies",ci:"Changes to our CI configuration files and scripts",chore:"Other changes that don't modify src or test files",revert:"Reverts a previous commit",feat:"A new feature",fix:"A bug fix"},null,2)}`},ca=s((u,D,e)=>["Generate a concise git commit message written in present tense for the following code diff with the given specifications below:",`Message language: ${u}`,`Commit message must be a maximum of ${D} characters.`,"Exclude anything unnecessary such as translation. Your entire response will be passed directly into git commit.",aa[e],ia(e)].filter(Boolean).join(`
|
|
77
|
+
${JSON.stringify({docs:"Documentation only changes",style:"Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)",refactor:"A code change that neither fixes a bug nor adds a feature",perf:"A code change that improves performance",test:"Adding missing tests or correcting existing tests",build:"Changes that affect the build system or external dependencies",ci:"Changes to our CI configuration files and scripts",chore:"Other changes that don't modify src or test files",revert:"Reverts a previous commit",feat:"A new feature",fix:"A bug fix",data:"Data only changes"},null,2)}`},ca=s((u,D,e)=>["Generate a concise git commit message written in present tense for the following code diff with the given specifications below:",`Message language: ${u}`,`Commit message must be a maximum of ${D} characters.`,"Exclude anything unnecessary such as translation. Your entire response will be passed directly into git commit.","Try to focus on why the code changes was made and not only summarize the changes.",aa[e],ia(e)].filter(Boolean).join(`
|
|
78
78
|
`),"generatePrompt"),la=s(async(u,D,e,n,r,o)=>new Promise((t,i)=>{const a=JSON.stringify(n),l=mn.request({port:443,hostname:u,path:D,method:"POST",headers:{...e,"Content-Type":"application/json","Content-Length":Buffer.byteLength(a)},timeout:r,agent:void 0},C=>{const c=[];C.on("data",F=>c.push(F)),C.on("end",()=>{t({request:l,response:C,data:Buffer.concat(c).toString()})})});l.on("error",i),l.on("timeout",()=>{l.destroy(),i(new S(`Time out error: request took over ${r}ms. Try increasing the \`timeout\` config, or checking the OpenAI API status https://status.openai.com`))}),l.write(a),l.end()}),"httpsPost"),Fa=s(async(u,D,e,n)=>{const{response:r,data:o}=await la("api.openai.com","/v1/chat/completions",{Authorization:`Bearer ${u}`},D,e);if(!r.statusCode||r.statusCode<200||r.statusCode>299){let t=`OpenAI API Error: ${r.statusCode} - ${r.statusMessage}`;throw o&&(t+=`
|
|
79
79
|
|
|
80
80
|
${o}`),r.statusCode===500&&(t+=`
|