aicommit2
Version:
A Reactive CLI that generates commit messages for Git and Jujutsu with various AI
18 lines (15 loc) • 19.1 kB
JavaScript
import ae from"http";import ce from"https";import{j as w,k as ue,d as le,K as I}from"./cli-8ee62906.mjs";import fe from"net";import pe from"tls";import de from"url";import he from"assert";import V from"tty";import me from"util";import Ce from"os";import ge from"events";import{l as ye,a as be,b as we,c as Fe,d as ve,e as _e}from"./ai.service-d8e94c3a.mjs";var S={},L={exports:{}},E={exports:{}},D,W;function Oe(){if(W)return D;W=1;var t=1e3,n=t*60,i=n*60,e=i*24,f=e*7,s=e*365.25;D=function(u,r){r=r||{};var o=typeof u;if(o==="string"&&u.length>0)return p(u);if(o==="number"&&isFinite(u))return r.long?a(u):h(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function p(u){if(u=String(u),!(u.length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(r){var o=parseFloat(r[1]),c=(r[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return o*s;case"weeks":case"week":case"w":return o*f;case"days":case"day":case"d":return o*e;case"hours":case"hour":case"hrs":case"hr":case"h":return o*i;case"minutes":case"minute":case"mins":case"min":case"m":return o*n;case"seconds":case"second":case"secs":case"sec":case"s":return o*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}function h(u){var r=Math.abs(u);return r>=e?Math.round(u/e)+"d":r>=i?Math.round(u/i)+"h":r>=n?Math.round(u/n)+"m":r>=t?Math.round(u/t)+"s":u+"ms"}function a(u){var r=Math.abs(u);return r>=e?l(u,r,e,"day"):r>=i?l(u,r,i,"hour"):r>=n?l(u,r,n,"minute"):r>=t?l(u,r,t,"second"):u+" ms"}function l(u,r,o,c){var d=r>=o*1.5;return Math.round(u/o)+" "+c+(d?"s":"")}return D}var j,Y;function K(){if(Y)return j;Y=1;function t(n){e.debug=e,e.default=e,e.coerce=l,e.disable=h,e.enable=s,e.enabled=a,e.humanize=Oe(),e.destroy=u,Object.keys(n).forEach(r=>{e[r]=n[r]}),e.names=[],e.skips=[],e.formatters={};function i(r){let o=0;for(let c=0;c<r.length;c++)o=(o<<5)-o+r.charCodeAt(c),o|=0;return e.colors[Math.abs(o)%e.colors.length]}e.selectColor=i;function e(r){let o,c=null,d,C;function m(...g){if(!m.enabled)return;const y=m,F=Number(new Date),T=F-(o||F);y.diff=T,y.prev=o,y.curr=F,o=F,g[0]=e.coerce(g[0]),typeof g[0]!="string"&&g.unshift("%O");let v=0;g[0]=g[0].replace(/%([a-zA-Z%])/g,(O,k)=>{if(O==="%%")return"%";v++;const b=e.formatters[k];if(typeof b=="function"){const ie=g[v];O=b.call(y,ie),g.splice(v,1),v--}return O}),e.formatArgs.call(y,g),(y.log||e.log).apply(y,g)}return m.namespace=r,m.useColors=e.useColors(),m.color=e.selectColor(r),m.extend=f,m.destroy=e.destroy,Object.defineProperty(m,"enabled",{enumerable:!0,configurable:!1,get:()=>c!==null?c:(d!==e.namespaces&&(d=e.namespaces,C=e.enabled(r)),C),set:g=>{c=g}}),typeof e.init=="function"&&e.init(m),m}function f(r,o){const c=e(this.namespace+(typeof o>"u"?":":o)+r);return c.log=this.log,c}function s(r){e.save(r),e.namespaces=r,e.names=[],e.skips=[];const o=(typeof r=="string"?r:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const c of o)c[0]==="-"?e.skips.push(c.slice(1)):e.names.push(c)}function p(r,o){let c=0,d=0,C=-1,m=0;for(;c<r.length;)if(d<o.length&&(o[d]===r[c]||o[d]==="*"))o[d]==="*"?(C=d,m=c,d++):(c++,d++);else if(C!==-1)d=C+1,m++,c=m;else return!1;for(;d<o.length&&o[d]==="*";)d++;return d===o.length}function h(){const r=[...e.names,...e.skips.map(o=>"-"+o)].join(",");return e.enable(""),r}function a(r){for(const o of e.skips)if(p(r,o))return!1;for(const o of e.names)if(p(r,o))return!0;return!1}function l(r){return r instanceof Error?r.stack||r.message:r}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return e.enable(e.load()),e}return j=t,j}E.exports;var Z;function Ee(){return Z||(Z=1,function(t,n){n.formatArgs=e,n.save=f,n.load=s,n.useColors=i,n.storage=p(),n.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`."))}})(),n.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 i(){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+)/)}function e(a){if(a[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+a[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const l="color: "+this.color;a.splice(1,0,l,"color: inherit");let u=0,r=0;a[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(u++,o==="%c"&&(r=u))}),a.splice(r,0,l)}n.log=console.debug||console.log||(()=>{});function f(a){try{a?n.storage.setItem("debug",a):n.storage.removeItem("debug")}catch{}}function s(){let a;try{a=n.storage.getItem("debug")||n.storage.getItem("DEBUG")}catch{}return!a&&typeof process<"u"&&"env"in process&&(a=process.env.DEBUG),a}function p(){try{return localStorage}catch{}}t.exports=K()(n);const{formatters:h}=t.exports;h.j=function(a){try{return JSON.stringify(a)}catch(l){return"[UnexpectedJSONParseError]: "+l.message}}}(E,E.exports)),E.exports}var $={exports:{}},B,X;function $e(){return X||(X=1,B=(t,n=process.argv)=>{const i=t.startsWith("-")?"":t.length===1?"-":"--",e=n.indexOf(i+t),f=n.indexOf("--");return e!==-1&&(f===-1||e<f)}),B}var N,Q;function Ae(){if(Q)return N;Q=1;const t=Ce,n=V,i=$e(),{env:e}=process;let f;i("no-color")||i("no-colors")||i("color=false")||i("color=never")?f=0:(i("color")||i("colors")||i("color=true")||i("color=always"))&&(f=1),"FORCE_COLOR"in e&&(e.FORCE_COLOR==="true"?f=1:e.FORCE_COLOR==="false"?f=0:f=e.FORCE_COLOR.length===0?1:Math.min(parseInt(e.FORCE_COLOR,10),3));function s(a){return a===0?!1:{level:a,hasBasic:!0,has256:a>=2,has16m:a>=3}}function p(a,l){if(f===0)return 0;if(i("color=16m")||i("color=full")||i("color=truecolor"))return 3;if(i("color=256"))return 2;if(a&&!l&&f===void 0)return 0;const u=f||0;if(e.TERM==="dumb")return u;if(process.platform==="win32"){const r=t.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in e)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in e)||e.CI_NAME==="codeship"?1:u;if("TEAMCITY_VERSION"in e)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(e.TEAMCITY_VERSION)?1:0;if(e.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in e){const r=parseInt((e.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(e.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(e.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(e.TERM)||"COLORTERM"in e?1:u}function h(a){const l=p(a,a&&a.isTTY);return s(l)}return N={supportsColor:h,stdout:s(p(!0,n.isatty(1))),stderr:s(p(!0,n.isatty(2)))},N}$.exports;var ee;function xe(){return ee||(ee=1,function(t,n){const i=V,e=me;n.init=u,n.log=h,n.formatArgs=s,n.save=a,n.load=l,n.useColors=f,n.destroy=e.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),n.colors=[6,2,3,4,5,1];try{const o=Ae();o&&(o.stderr||o).level>=2&&(n.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{}n.inspectOpts=Object.keys(process.env).filter(o=>/^debug_/i.test(o)).reduce((o,c)=>{const d=c.substring(6).toLowerCase().replace(/_([a-z])/g,(m,g)=>g.toUpperCase());let C=process.env[c];return/^(yes|on|true|enabled)$/i.test(C)?C=!0:/^(no|off|false|disabled)$/i.test(C)?C=!1:C==="null"?C=null:C=Number(C),o[d]=C,o},{});function f(){return"colors"in n.inspectOpts?!!n.inspectOpts.colors:i.isatty(process.stderr.fd)}function s(o){const{namespace:c,useColors:d}=this;if(d){const C=this.color,m="\x1B[3"+(C<8?C:"8;5;"+C),g=` ${m};1m${c} \x1B[0m`;o[0]=g+o[0].split(`
`).join(`
`+g),o.push(m+"m+"+t.exports.humanize(this.diff)+"\x1B[0m")}else o[0]=p()+c+" "+o[0]}function p(){return n.inspectOpts.hideDate?"":new Date().toISOString()+" "}function h(...o){return process.stderr.write(e.formatWithOptions(n.inspectOpts,...o)+`
`)}function a(o){o?process.env.DEBUG=o:delete process.env.DEBUG}function l(){return process.env.DEBUG}function u(o){o.inspectOpts={};const c=Object.keys(n.inspectOpts);for(let d=0;d<c.length;d++)o.inspectOpts[c[d]]=n.inspectOpts[c[d]]}t.exports=K()(n);const{formatters:r}=t.exports;r.o=function(o){return this.inspectOpts.colors=this.useColors,e.inspect(o,this.inspectOpts).split(`
`).map(c=>c.trim()).join(" ")},r.O=function(o){return this.inspectOpts.colors=this.useColors,e.inspect(o,this.inspectOpts)}}($,$.exports)),$.exports}typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?L.exports=Ee():L.exports=xe();var U=L.exports,q={};Object.defineProperty(q,"__esModule",{value:!0});function Pe(t){return function(n,i){return new Promise((e,f)=>{t.call(this,n,i,(s,p)=>{s?f(s):e(p)})})}}q.default=Pe;var te=w&&w.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const Re=ge,Ie=te(U),Me=te(q),A=Ie.default("agent-base");function Te(t){return!!t&&typeof t.addRequest=="function"}function H(){const{stack:t}=new Error;return typeof t!="string"?!1:t.split(`
`).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}function M(t,n){return new M.Agent(t,n)}(function(t){class n extends Re.EventEmitter{constructor(e,f){super();let s=f;typeof e=="function"?this.callback=e:e&&(s=e),this.timeout=null,s&&typeof s.timeout=="number"&&(this.timeout=s.timeout),this.maxFreeSockets=1,this.maxSockets=1,this.maxTotalSockets=1/0,this.sockets={},this.freeSockets={},this.requests={},this.options={}}get defaultPort(){return typeof this.explicitDefaultPort=="number"?this.explicitDefaultPort:H()?443:80}set defaultPort(e){this.explicitDefaultPort=e}get protocol(){return typeof this.explicitProtocol=="string"?this.explicitProtocol:H()?"https:":"http:"}set protocol(e){this.explicitProtocol=e}callback(e,f,s){throw new Error('"agent-base" has no default implementation, you must subclass and override `callback()`')}addRequest(e,f){const s=Object.assign({},f);typeof s.secureEndpoint!="boolean"&&(s.secureEndpoint=H()),s.host==null&&(s.host="localhost"),s.port==null&&(s.port=s.secureEndpoint?443:80),s.protocol==null&&(s.protocol=s.secureEndpoint?"https:":"http:"),s.host&&s.path&&delete s.path,delete s.agent,delete s.hostname,delete s._defaultAgent,delete s.defaultPort,delete s.createConnection,e._last=!0,e.shouldKeepAlive=!1;let p=!1,h=null;const a=s.timeout||this.timeout,l=c=>{e._hadError||(e.emit("error",c),e._hadError=!0)},u=()=>{h=null,p=!0;const c=new Error(`A "socket" was not created for HTTP request before ${a}ms`);c.code="ETIMEOUT",l(c)},r=c=>{p||(h!==null&&(clearTimeout(h),h=null),l(c))},o=c=>{if(p)return;if(h!=null&&(clearTimeout(h),h=null),Te(c)){A("Callback returned another Agent instance %o",c.constructor.name),c.addRequest(e,s);return}if(c){c.once("free",()=>{this.freeSocket(c,s)}),e.onSocket(c);return}const d=new Error(`no Duplex stream was returned to agent-base for \`${e.method} ${e.path}\``);l(d)};if(typeof this.callback!="function"){l(new Error("`callback` is not defined"));return}this.promisifiedCallback||(this.callback.length>=3?(A("Converting legacy callback function to promise"),this.promisifiedCallback=Me.default(this.callback)):this.promisifiedCallback=this.callback),typeof a=="number"&&a>0&&(h=setTimeout(u,a)),"port"in s&&typeof s.port!="number"&&(s.port=Number(s.port));try{A("Resolving socket for %o request: %o",s.protocol,`${e.method} ${e.path}`),Promise.resolve(this.promisifiedCallback(e,s)).then(o,r)}catch(c){Promise.reject(c).catch(r)}}freeSocket(e,f){A("Freeing socket %o %o",e.constructor.name,f),e.destroy()}destroy(){A("Destroying agent %o",this.constructor.name)}}t.Agent=n,t.prototype=t.Agent.prototype})(M||(M={}));var ke=M,G={},Se=w&&w.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(G,"__esModule",{value:!0});const Le=Se(U),x=Le.default("https-proxy-agent:parse-proxy-response");function De(t){return new Promise((n,i)=>{let e=0;const f=[];function s(){const r=t.read();r?u(r):t.once("readable",s)}function p(){t.removeListener("end",a),t.removeListener("error",l),t.removeListener("close",h),t.removeListener("readable",s)}function h(r){x("onclose had error %o",r)}function a(){x("onend")}function l(r){p(),x("onerror %o",r),i(r)}function u(r){f.push(r),e+=r.length;const o=Buffer.concat(f,e);if(o.indexOf(`\r
\r
`)===-1){x("have not received end of HTTP headers yet..."),s();return}const d=o.toString("ascii",0,o.indexOf(`\r
`)),C=+d.split(" ")[1];x("got proxy server response: %o",d),n({statusCode:C,buffered:o})}t.on("error",l),t.on("close",h),t.on("end",a),s()})}G.default=De;var je=w&&w.__awaiter||function(t,n,i,e){function f(s){return s instanceof i?s:new i(function(p){p(s)})}return new(i||(i=Promise))(function(s,p){function h(u){try{l(e.next(u))}catch(r){p(r)}}function a(u){try{l(e.throw(u))}catch(r){p(r)}}function l(u){u.done?s(u.value):f(u.value).then(h,a)}l((e=e.apply(t,n||[])).next())})},_=w&&w.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(S,"__esModule",{value:!0});const re=_(fe),oe=_(pe),Be=_(de),Ne=_(he),Ue=_(U),qe=ke,He=_(G),P=Ue.default("https-proxy-agent:agent");class Ge extends qe.Agent{constructor(n){let i;if(typeof n=="string"?i=Be.default.parse(n):i=n,!i)throw new Error("an HTTP(S) proxy server `host` and `port` must be specified!");P("creating new HttpsProxyAgent instance: %o",i),super(i);const e=Object.assign({},i);this.secureProxy=i.secureProxy||Ve(e.protocol),e.host=e.hostname||e.host,typeof e.port=="string"&&(e.port=parseInt(e.port,10)),!e.port&&e.host&&(e.port=this.secureProxy?443:80),this.secureProxy&&!("ALPNProtocols"in e)&&(e.ALPNProtocols=["http 1.1"]),e.host&&e.path&&(delete e.path,delete e.pathname),this.proxy=e}callback(n,i){return je(this,void 0,void 0,function*(){const{proxy:e,secureProxy:f}=this;let s;f?(P("Creating `tls.Socket`: %o",e),s=oe.default.connect(e)):(P("Creating `net.Socket`: %o",e),s=re.default.connect(e));const p=Object.assign({},e.headers);let a=`CONNECT ${`${i.host}:${i.port}`} HTTP/1.1\r
`;e.auth&&(p["Proxy-Authorization"]=`Basic ${Buffer.from(e.auth).toString("base64")}`);let{host:l,port:u,secureEndpoint:r}=i;Je(u,r)||(l+=`:${u}`),p.Host=l,p.Connection="close";for(const m of Object.keys(p))a+=`${m}: ${p[m]}\r
`;const o=He.default(s);s.write(`${a}\r
`);const{statusCode:c,buffered:d}=yield o;if(c===200){if(n.once("socket",ze),i.secureEndpoint){P("Upgrading socket connection to TLS");const m=i.servername||i.host;return oe.default.connect(Object.assign(Object.assign({},We(i,"host","hostname","path","port")),{socket:s,servername:m}))}return s}s.destroy();const C=new re.default.Socket({writable:!1});return C.readable=!0,n.once("socket",m=>{P("replaying proxy buffer for failed request"),Ne.default(m.listenerCount("data")>0),m.push(d),m.push(null)}),C})}}S.default=Ge;function ze(t){t.resume()}function Je(t,n){return!!(!n&&t===80||n&&t===443)}function Ve(t){return typeof t=="string"?/^https:?$/i.test(t):!1}function We(t,...n){const i={};let e;for(e in t)n.includes(e)||(i[e]=t[e]);return i}var Ye=w&&w.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const z=Ye(S);function J(t){return new z.default(t)}(function(t){t.HttpsProxyAgent=z.default,t.prototype=z.default.prototype})(J||(J={}));var Ke=J,Ze=ue(Ke);const Xe=async(t,n,i,e,f,s,p)=>new Promise((h,a)=>{const l=JSON.stringify(e),r=(t.protocol.includes("https")?ce:ae).request({port:p||void 0,hostname:t.hostname,path:n,method:"POST",headers:{"Content-Type":"application/json","Content-Length":Buffer.byteLength(l),...i},timeout:f,agent:s?Ze(s):void 0},o=>{const c=[];o.on("data",d=>c.push(d)),o.on("end",()=>{h({request:r,response:o,data:Buffer.concat(c).toString()})})});r.on("error",a),r.on("timeout",()=>{r.destroy(),a(new I(`Time out error: request took over ${f}ms. Try increasing the \`timeout\` config`))}),r.write(l),r.end()}),Qe=async(t,n,i,e,f,s)=>{const p=new URL(t),{response:h,data:a}=await Xe(p,n,{Authorization:`Bearer ${i}`},e,f,s);if(!h.statusCode||h.statusCode<200||h.statusCode>299){let l=`API Error: ${h.statusCode} - ${h.statusMessage}`;throw a&&(l+=`
${a}`),h.statusCode===500&&(l+=`
Check the API status: ${t}`),new I(l)}try{return JSON.parse(a)}catch(l){throw new I(`Failed to parse API response as JSON: ${l.message}
Response: ${a.substring(0,200)}`)}},ne=t=>t.trim(),et=["gpt-5","gpt-5-mini","gpt-5-nano","gpt-5-codex","o1","o1-mini","o1-pro","o3","o3-mini","o3-pro","o4-mini"],se=t=>{const n=t.toLowerCase(),i=n.includes("/")&&n.split("/").pop()||n;return et.some(e=>i===e||i.startsWith(`${e}-`)||i.startsWith(`${e}.`))},tt=async(t,n,i,e,f,s,p,h,a,l,u,r,o,c,d)=>{try{const C=le(s,o,d),m=se(f),g={model:f,messages:[{role:"system",content:u},{role:"user",content:C}],stream:!1,n:1,frequency_penalty:0,presence_penalty:0,...m?{max_completion_tokens:h,temperature:1}:{max_tokens:h,top_p:l,temperature:a}},y=new URL(n),F=`${y.protocol}//${y.host}${i}`,T={Authorization:`Bearer ${e}`,"Content-Type":"application/json"};ye(s,o,t,f,F,T,r),be(s,o,t,u,C,r),we(s,o,t,g,r);const v=Date.now(),R=await Qe(n,i,e,g,p,c),O=Date.now()-v;Fe(s,o,t,R,r);const k=R.choices.filter(b=>b.message?.content).map(b=>ne(b.message.content)).join();return ve(s,o,t,O,k,r),R.choices.filter(b=>b.message?.content).map(b=>ne(b.message.content))}catch(C){_e(s,o,t,C,r);const m=C;throw m.code==="ENOTFOUND"?new I(`Error connecting to ${m.hostname} (${m.syscall})`):m}};export{tt as g,se as i};