@yukino.js/yukino 0.0.21-dev → 0.0.22
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 +1 -1
- package/dist/{anthropic-LB4T3BEN.js → anthropic-5FTO3Q7W.js} +1 -1
- package/dist/browser/dist/static/{highlight-KNDEBJWF.js → highlight-7IMT657L.js} +9 -9
- package/dist/browser/dist/static/index.css +2 -2
- package/dist/browser/dist/static/index.js +81 -75
- package/dist/browser/dist/static/webapi-433PWHPB.js +4 -0
- package/dist/{chunk-NPIMUWFO.js → chunk-3FNHYMQD.js} +1 -1
- package/dist/{chunk-D6YQITPD.js → chunk-4UBQFHOG.js} +1 -1
- package/dist/{chunk-N7G2FDAI.js → chunk-5JFKXDO6.js} +1 -1
- package/dist/chunk-6YD572HB.js +4 -0
- package/dist/{chunk-XDERLDVW.js → chunk-7R67JSKQ.js} +1 -1
- package/dist/{chunk-FNQMXCCE.js → chunk-D5XGRVMZ.js} +1 -1
- package/dist/{chunk-WKKH2UE5.js → chunk-FOFOAOHI.js} +1 -1
- package/dist/{chunk-QYUIIFJY.js → chunk-GQKXEVHQ.js} +1 -1
- package/dist/{chunk-5D3QKHYQ.js → chunk-HNVICTWL.js} +1 -1
- package/dist/{chunk-7WP7SERS.js → chunk-HQ6FH7CR.js} +1 -1
- package/dist/{chunk-P6K7EQHF.js → chunk-I2KB6I3D.js} +2 -2
- package/dist/chunk-KBRCX7GE.js +30 -0
- package/dist/chunk-LLPVYWAK.js +10 -0
- package/dist/{chunk-2N7OIUQW.js → chunk-TVVVY2T4.js} +173 -173
- package/dist/{chunk-6SWKDCK3.js → chunk-WXCPYSJ3.js} +1 -1
- package/dist/{chunk-57IGGFHK.js → chunk-XB5QPPSI.js} +1 -1
- package/dist/{chunk-EQABLL4S.js → chunk-YWUBKWGK.js} +1 -1
- package/dist/{devtools-UVGRIXO2.js → devtools-BODX7K3L.js} +1 -1
- package/dist/{esm-HB7M3TZY.js → esm-4BJKCG42.js} +1 -1
- package/dist/{esm-63A57VQM.js → esm-AWTGQAUK.js} +1 -1
- package/dist/{esm-FURF4AWD.js → esm-JKMLEWEU.js} +1 -1
- package/dist/{esm-46K5BSA6.js → esm-MG7NDA4I.js} +1 -1
- package/dist/{esm-73AG4F4H.js → esm-NCNRWOJD.js} +1 -1
- package/dist/{esm-QAEO3U72.js → esm-QVP2GBDR.js} +1 -1
- package/dist/esm-ZR7DS25X.js +225 -0
- package/dist/file-type-Z4DPJWZH.js +12 -0
- package/dist/getMachineId-bsd-RSPO2LUX.js +4 -0
- package/dist/getMachineId-bsd-YMN7H6LU.js +4 -0
- package/dist/getMachineId-darwin-AOWQPOSH.js +5 -0
- package/dist/getMachineId-darwin-FEQVNOUN.js +5 -0
- package/dist/{getMachineId-win-2ZKMVYDE.js → getMachineId-win-H5SABCRW.js} +1 -1
- package/dist/{getMachineId-win-JOM5JSRW.js → getMachineId-win-RV3BPBHF.js} +1 -1
- package/dist/image-worker.js +1 -1
- package/dist/lib/{chunk-XVXFUSSS.js → chunk-IOPSBIYR.js} +1 -1
- package/dist/lib/index.d.ts +802 -802
- package/dist/lib/index.js +19 -17
- package/dist/lib/{providers-2NPR2VR4.js → providers-U3O7GOPH.js} +1 -1
- package/dist/{main-OMIZDIYB.js → main-BIBLUWZX.js} +219 -213
- package/dist/main.js +2 -2
- package/dist/{openai-UOCUBMFA.js → openai-AYEJOJTA.js} +1 -1
- package/dist/{providers-G5SKN22T.js → providers-USI6GYZC.js} +9 -9
- package/dist/{server-Z742CQSK.js → server-RGAJNHA4.js} +1 -1
- package/dist/{server-ESDMJACZ.js → server-XHQ7YJGI.js} +2 -2
- package/dist/{src-CHQYSTW5.js → src-E2NOTM6J.js} +1 -1
- package/dist/{src-HH6MC5CF.js → src-EBGRLYAR.js} +1 -1
- package/dist/{src-YWYPK5QA.js → src-HBBKRA75.js} +1 -1
- package/dist/src-P77FB5XW.js +12 -0
- package/dist/{turndown.es-NQ3KDXM7.js → turndown.es-E6SHSU5B.js} +13 -13
- package/package.json +2 -2
- package/dist/browser/dist/static/webapi-HZESKPJE.js +0 -4
- package/dist/chunk-5AOJ5ZSQ.js +0 -30
- package/dist/chunk-VM4YKTHC.js +0 -10
- package/dist/chunk-WKTO7XPO.js +0 -4
- package/dist/esm-6D27H27M.js +0 -225
- package/dist/file-type-PSFVPAEH.js +0 -12
- package/dist/getMachineId-bsd-2MDOCJCH.js +0 -4
- package/dist/getMachineId-bsd-L5XEQF74.js +0 -4
- package/dist/getMachineId-darwin-SMQEPEZ2.js +0 -5
- package/dist/getMachineId-darwin-V3OSZDJX.js +0 -5
- package/dist/src-P2WNZ6IY.js +0 -12
- /package/dist/{chunk-HKQWGX5S.js → chunk-UJIMMEIV.js} +0 -0
- /package/dist/{getMachineId-linux-OWR5YFVH.js → getMachineId-linux-337SESKP.js} +0 -0
- /package/dist/{getMachineId-linux-C4WJW6ZL.js → getMachineId-linux-P6HXMSZR.js} +0 -0
- /package/dist/{getMachineId-unsupported-M7AEHRA4.js → getMachineId-unsupported-52TDEFNE.js} +0 -0
- /package/dist/{getMachineId-unsupported-J7U5FNFT.js → getMachineId-unsupported-FWRH7XFO.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
3
|
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{g as B,h as U,i as w,j as $,k as me}from"./chunk-
|
|
4
|
+
import{g as B,h as U,i as w,j as $,k as me}from"./chunk-UJIMMEIV.js";import{b as V,c as E,m as b,n as p,o as d,q as u}from"./chunk-456FRBGE.js";u();function v(){return e=>{p.error(ge(e))}}function ge(e){return typeof e=="string"?e:JSON.stringify(Ee(e))}function Ee(e){let t={},r=e;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(t[n])return;let o=r[n];o&&(t[n]=String(o))}),r=Object.getPrototypeOf(r);return t}var de=v();function Te(e){try{de(e)}catch{}}u();import{inspect as Ae}from"util";function R(e){let t=process.env[e];if(t==null||t.trim()==="")return;let r=Number(t);if(isNaN(r)){p.warn(`Unknown value ${Ae(t)} for ${e}, expected a number, using defaults`);return}return r}function O(e){let t=process.env[e];if(!(t==null||t.trim()===""))return t}var X="2.12.1";me();var Y="process.runtime.name";var P={[w]:"opentelemetry",[Y]:"node",[B]:U,[$]:X};var m=performance;var Se=9,xe=6,ye=Math.pow(10,xe),T=Math.pow(10,Se);function G(e){let t=e/1e3,r=Math.trunc(t),n=Math.round(e%1e3*ye);return[r,n]}function he(e){let t=G(m.timeOrigin),r=G(typeof e=="number"?e:m.now());return Z(t,r)}function be(e,t){let r=t[0]-e[0],n=t[1]-e[1];return n<0&&(r-=1,n+=T),[r,n]}function Re(e){return e[0]*1e6+e[1]/1e3}function Oe(e){return e[0]*1e3+e[1]/1e6}function Pe(e){return e[0]+e[1]/T}function J(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}function Ge(e){return J(e)||typeof e=="number"||e instanceof Date}function Z(e,t){let r=[e[0]+t[0],e[1]+t[1]];return r[1]>=T&&(r[1]-=T,r[0]+=1),r}var I;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(I||(I={}));u();var Ie=E("OpenTelemetry SDK Context Key RPC_METADATA"),N;(function(e){e.HTTP="http"})(N||(N={}));function Ne(e,t){return e.setValue(Ie,t)}var Me="[object Object]",Ce="[object Null]",je="[object Undefined]",Le=Function.prototype,q=Le.toString,De=q.call(Object),Ke=Object.getPrototypeOf,Q=Object.prototype,ee=Q.hasOwnProperty,l=Symbol?Symbol.toStringTag:void 0,te=Q.toString;function M(e){if(!ke(e)||Fe(e)!==Me)return!1;let t=Ke(e);if(t===null)return!0;let r=ee.call(t,"constructor")&&t.constructor;return typeof r=="function"&&r instanceof r&&q.call(r)===De}function ke(e){return e!=null&&typeof e=="object"}function Fe(e){return e==null?e===void 0?je:Ce:l&&l in Object(e)?He(e):Ve(e)}function He(e){let t=ee.call(e,l),r=e[l],n=!1;try{e[l]=void 0,n=!0}catch{}let o=te.call(e);return n&&(t?e[l]=r:delete e[l]),o}function Ve(e){return te.call(e)}var Be=20;function Ue(...e){let t=e.shift(),r=new WeakMap;for(;e.length>0;)t=ne(t,e.shift(),0,r);return t}function C(e){return _(e)?e.slice():e}function ne(e,t,r=0,n){let o;if(!(r>Be)){if(r++,A(e)||A(t)||oe(t))o=C(t);else if(_(e)){if(o=e.slice(),_(t))for(let c=0,s=t.length;c<s;c++)o.push(C(t[c]));else if(g(t)){let c=Object.keys(t);for(let s=0,a=c.length;s<a;s++){let i=c[s];i==="__proto__"||i==="constructor"||i==="prototype"||(o[i]=C(t[i]))}}}else if(g(e))if(g(t)){if(!we(e,t))return t;o=Object.assign({},e);let c=Object.keys(t);for(let s=0,a=c.length;s<a;s++){let i=c[s];if(i==="__proto__"||i==="constructor"||i==="prototype")continue;let f=t[i];if(A(f))typeof f>"u"?delete o[i]:o[i]=f;else{let y=o[i],h=f;if(re(e,i,n)||re(t,i,n))delete o[i];else{if(g(y)&&g(h)){let F=n.get(y)||[],H=n.get(h)||[];F.push({obj:e,key:i}),H.push({obj:t,key:i}),n.set(y,F),n.set(h,H)}o[i]=ne(o[i],f,r,n)}}}}else o=t;return o}}function re(e,t,r){let n=r.get(e[t])||[];for(let o=0,c=n.length;o<c;o++){let s=n[o];if(s.key===t&&s.obj===e)return!0}return!1}function _(e){return Array.isArray(e)}function oe(e){return typeof e=="function"}function g(e){return!A(e)&&!_(e)&&!oe(e)&&typeof e=="object"}function A(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function we(e,t){return!(!M(e)||!M(t))}u();u();var ie=E("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function j(e){return e.setValue(ie,!0)}function L(e){return e.getValue(ie)===!0}var S="baggage";u();function ae(e){return e.reduce((t,r)=>{let n=`${t}${t!==""?",":""}${r}`;return n.length>8192?t:n},"")}function fe(e){return e.getAllEntries().map(([t,r])=>{let n=`${encodeURIComponent(t)}=${encodeURIComponent(r.value)}`;return r.metadata!==void 0&&(n+=";"+r.metadata.toString()),n})}function Ye(e){if(!e)return;let t=e.indexOf(";"),r=t===-1?e:e.substring(0,t),n=r.indexOf("=");if(n<=0)return;let o=r.substring(0,n).trim(),c=r.substring(n+1).trim();if(!o||!c)return;let s,a;try{s=decodeURIComponent(o),a=decodeURIComponent(c)}catch{return}let i;if(t!==-1&&t<e.length-1){let f=e.substring(t+1);i=V(f)}return{key:s,value:a,metadata:i}}function D(e,t,r,n){let o=0;for(;o<e.length&&r<180;){let c=e.indexOf(",",o),s=c===-1?e.length:c,a=s-o;if(a<=4096){let i=Ye(e.substring(o,s));if(i){let f=(r===0?0:1)+a;if(n+f>8192)break;t[i.key]=i.metadata?{value:i.value,metadata:i.metadata}:{value:i.value},r++,n+=f}}if(c===-1)break;o=c+1}return[r,n]}var K=class{inject(t,r,n){let o=d.getBaggage(t);if(!o||L(t))return;let c=fe(o).filter(a=>a.length<=4096).slice(0,180),s=ae(c);s.length>0&&n.set(r,S,s)}extract(t,r,n){let o=n.get(r,S);if(!o)return t;let c={},s=0,a=0;if(Array.isArray(o))for(let i=0;i<o.length;i++)[s,a]=D(o[i],c,s,a);else[s]=D(o,c,s,a);return s===0?t:d.setBaggage(t,d.createBaggage(c))}fields(){return[S]}};u();function ze(e){let t={};if(typeof e!="object"||e==null)return t;for(let r in e){if(!Object.prototype.hasOwnProperty.call(e,r))continue;if(!We(r)){p.warn(`Invalid attribute key: ${r}`);continue}let n=e[r];if(!ue(n)){p.warn(`Invalid attribute value set for key: ${r}`);continue}Array.isArray(n)?t[r]=n.slice():t[r]=n}return t}function We(e){return typeof e=="string"&&e!==""}function ue(e){return e==null?!0:Array.isArray(e)?Je(e):pe(typeof e)}function Je(e){let t;for(let r of e){if(r==null)continue;let n=typeof r;if(n!==t){if(!t){if(pe(n)){t=n;continue}return!1}return!1}}return!0}function pe(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}var x=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,r)=>{this._resolve=t,this._reject=r})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}};var k=class{_isCalled=!1;_deferred=new x;_callback;_that;constructor(t,r){this._callback=t,this._that=r}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(r=>this._deferred.resolve(r),r=>this._deferred.reject(r))}catch(r){this._deferred.reject(r)}}return this._deferred.promise}};u();function le(e,t){return new Promise(r=>{b.with(j(b.active()),()=>{e.export(t,r)})})}var Zt={_export:le};export{j as a,L as b,K as c,ze as d,ue as e,Te as f,R as g,O as h,P as i,m as j,G as k,he as l,be as m,Re as n,Oe as o,Pe as p,J as q,Ge as r,Z as s,I as t,N as u,Ne as v,Ue as w,k as x,Zt as y};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
3
|
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{Pa as Pn,a as kn,e as Nn,h as Rn,j as Fe,m as Mn,zc as Ze}from"./chunk-
|
|
4
|
+
import{Pa as Pn,a as kn,e as Nn,h as Rn,j as Fe,m as Mn,zc as Ze}from"./chunk-KBRCX7GE.js";import{B as A,b as Qe}from"./chunk-QSKJBSCI.js";var ie=["off","minimal","low","medium","high","xhigh","max"],Fn="high";var Dn={minimal:1024,low:2048,medium:8192,high:16384,xhigh:32768,max:65536},Yn=1024,jn=1024,en={anthropic:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY","openai-compat":"OPENAI_API_KEY"},Un=new Set(Object.keys(en)),Hn=["auto","eager","native","dispatch"],qn=["auto","dark","light"],De="config.yaml",Bn=".mcp.json",Kn="At least one provider MUST be configured.",nn="YAML parse error";function se(){return Mn(De)}var ue=A.enum(["none","minimal","low","medium","high","xhigh","max"]),ei=A.enum(["low","medium","high","xhigh","max"]),ni=A.strictObject({off:A.literal("none").nullable().optional(),minimal:ue.nullable().optional(),low:ue.nullable().optional(),medium:ue.nullable().optional(),high:ue.nullable().optional(),xhigh:ue.nullable().optional(),max:ue.nullable().optional()}),Se=A.looseObject({name:A.string(),protocol:A.enum(["anthropic","openai","openai-compat"]),base_url:A.string(),model:A.string(),api_key:A.string().optional(),thinking:A.enum(ie).optional(),reasoning:A.boolean().optional(),thinking_level_map:ni.optional(),thinking_mode:A.enum(["budget","adaptive"]).optional(),context_window:A.coerce.number().optional(),max_output_tokens:A.coerce.number().optional()});function ji(r,i){return r[i]??r[0]}function Ui(r){return ie.some(i=>i===r)}function rn(r){return ti(r,r.thinking??Fn)}function ri(r){return r==="off"?0:Dn[r]}function Hi(r,i){let c=on(i,r);return c===null||c==="none"?0:ri(c)}function on(r,i){if(i?.reasoning===!1)return null;if(r==="off")return"none";let c=i?.thinking_level_map?.[r];if(c!==void 0)return c;if(i?.protocol==="anthropic"&&i.thinking_mode==="adaptive"){if(r==="minimal")return"low";if(r==="xhigh")return"high"}return r}function ii(r,i){let c=ei.safeParse(on(r,i));return c.success?c.data:null}function oi(r){return r.reasoning===!1||r.protocol==="anthropic"&&r.thinking_mode!=="adaptive"&&Vn(r)<Yn+jn?["off"]:ie.filter(i=>{if(i==="off")return!0;if(r.protocol==="anthropic"&&r.thinking_mode==="adaptive")return ii(i,r)!==null;let c=on(i,r);return c!==null&&c!=="none"})}function ti(r,i){let c=oi(r),g="off";for(let l of ie)if(c.includes(l)&&(g=l),l===i)break;return g}function Gn(r){return{...r,thinking:rn(r),context_window:$n(r),max_output_tokens:Vn(r)}}function $n(r){return Number.isSafeInteger(r.context_window)&&(r.context_window??0)>0?r.context_window??1e6:1e6}function Vn(r){let i=r.max_output_tokens,c=Number.isSafeInteger(i)&&(i??0)>0?i??128e3:128e3;return Math.min(c,$n(r))}import{randomUUID as di}from"crypto";import{existsSync as Dr,renameSync as hi,unlinkSync as mi}from"fs";import{dirname as gi,join as yi}from"path";function ci(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Y={},Ue={},ee={},zn;function xe(){if(zn)return ee;zn=1;function r(h){return typeof h>"u"||h===null}function i(h){return typeof h=="object"&&h!==null}function c(h){return Array.isArray(h)?h:r(h)?[]:[h]}function g(h,u){if(u){let x=Object.keys(u);for(let s=0,p=x.length;s<p;s+=1){let b=x[s];h[b]=u[b]}}return h}function l(h,u){let x="";for(let s=0;s<u;s+=1)x+=h;return x}function d(h){return h===0&&Number.NEGATIVE_INFINITY===1/h}return ee.isNothing=r,ee.isObject=i,ee.toArray=c,ee.repeat=l,ee.isNegativeZero=d,ee.extend=g,ee}var tn,Wn;function Te(){if(Wn)return tn;Wn=1;function r(c,g){let l="",d=c.reason||"(unknown reason)";return c.mark?(c.mark.name&&(l+='in "'+c.mark.name+'" '),l+="("+(c.mark.line+1)+":"+(c.mark.column+1)+")",!g&&c.mark.snippet&&(l+=`
|
|
5
5
|
|
|
6
6
|
`+c.mark.snippet),d+" "+l):d}function i(c,g){Error.call(this),this.name="YAMLException",this.reason=c,this.mark=g,this.message=r(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.toString=function(g){return this.name+": "+r(this,g)},tn=i,tn}var ln,Xn;function ui(){if(Xn)return ln;Xn=1;let r=xe();function i(l,d,h,u,x){let s="",p="",b=Math.floor(x/2)-1;return u-d>b&&(s=" ... ",d=u-b+s.length),h-u>b&&(p=" ...",h=u+b-p.length),{str:s+l.slice(d,h).replace(/\t/g,"\u2192")+p,pos:u-d+s.length}}function c(l,d){return r.repeat(" ",d-l.length)+l}function g(l,d){if(d=Object.create(d||null),!l.buffer)return null;d.maxLength||(d.maxLength=79),typeof d.indent!="number"&&(d.indent=1),typeof d.linesBefore!="number"&&(d.linesBefore=3),typeof d.linesAfter!="number"&&(d.linesAfter=2);let h=/\r?\n|\r|\0/g,u=[0],x=[],s,p=-1;for(;s=h.exec(l.buffer);)x.push(s.index),u.push(s.index+s[0].length),l.position<=s.index&&p<0&&(p=u.length-2);p<0&&(p=u.length-1);let b="",O=Math.min(l.line+d.linesAfter,x.length).toString().length,R=d.maxLength-(d.indent+O+3);for(let M=1;M<=d.linesBefore&&!(p-M<0);M++){let K=i(l.buffer,u[p-M],x[p-M],l.position-(u[p]-u[p-M]),R);b=r.repeat(" ",d.indent)+c((l.line-M+1).toString(),O)+" | "+K.str+`
|
|
7
7
|
`+b}let z=i(l.buffer,u[p],x[p],l.position,R);b+=r.repeat(" ",d.indent)+c((l.line+1).toString(),O)+" | "+z.str+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
3
|
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
-
import{a as p}from"./chunk-
|
|
4
|
+
import{a as p}from"./chunk-YWUBKWGK.js";import{B as c}from"./chunk-QSKJBSCI.js";var _="@yukino.js/yukino",d="https://registry.npmjs.org/@yukino.js%2Fyukino",h="https://registry.npmjs.org/",g="latest";var m="Could not locate the Yukino installation.",I="This Yukino installation is not managed by global npm, yarn, or pnpm. Update the source checkout or reinstall using yukino-code/install.sh or yukino-code/install.ps1.",A=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?(?:\+[\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*)?$/u;function l(e){let t=A.exec(e),n=t?.[4]?.split(".")??[];if(!t||n.some(r=>/^0\d+$/u.test(r)))throw new Error(`Invalid package version: ${e}`);return{core:[BigInt(t[1]),BigInt(t[2]),BigInt(t[3])],prerelease:n}}function T(e,t){let n=l(e),r=l(t);for(let o=0;o<n.core.length;o++)if(n.core[o]!==r.core[o])return n.core[o]>r.core[o];if(n.prerelease.length===0||r.prerelease.length===0)return n.prerelease.length===0&&r.prerelease.length>0;for(let o=0;o<Math.max(n.prerelease.length,r.prerelease.length);o++){let s=n.prerelease[o],i=r.prerelease[o];if(s===i)continue;if(s===void 0||i===void 0)return i===void 0;let u=/^\d+$/u.test(s),a=/^\d+$/u.test(i);return u&&a?BigInt(s)>BigInt(i):u===a?s>i:a}return!1}async function E({tag:e=g,signal:t}={}){if(!e||encodeURIComponent(e)!==e||[".",".."].includes(e))throw new Error(`Invalid npm dist-tag: ${e}`);let n=AbortSignal.timeout(1e4),r=await fetch(`${d}/${encodeURIComponent(e)}`,{headers:{accept:"application/json","User-Agent":`yukino/${p} (${process.platform}; ${process.arch})`},signal:t?AbortSignal.any([t,n]):n});if(r.status===404)throw new Error(`No Yukino release found for npm dist-tag "${e}".`);if(!r.ok)throw new Error(`Could not check for Yukino updates (npm dist-tag "${e}"): HTTP ${r.status}`);let o=await r.json(),s=c.object({version:c.string()}).parse(o).version;return l(s),s}async function S(e){try{let t=await E({signal:e});return T(t,p)?t:void 0}catch{return}}export{_ as a,h as b,m as c,I as d,T as e,E as f,S as g};
|