@uibot/hub-runtime 0.18.1 → 0.20.0
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/index.js +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var Br=Object.create;var{getPrototypeOf:Ur,defineProperty:Oe,getOwnPropertyNames:Nr}=Object;var Le=Object.prototype.hasOwnProperty;function Fr(e){return this[e]}var _r,qr,Hr=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var o=t?_r??=new WeakMap:qr??=new WeakMap,i=o.get(e);if(i)return i}r=e!=null?Br(Ur(e)):{};let s=t||!e||!e.__esModule||!Le.call(e,"default")?Oe(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of Nr(e))if(!Le.call(s,a))Oe(s,a,{get:Fr.bind(e,a),enumerable:!0})}if(n)o.set(e,s);return s};var m=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var D=m(function(fs,Be){var Mr=Number.MAX_SAFE_INTEGER||9007199254740991,$r=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Be.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Mr,RELEASE_TYPES:$r,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var U=m(function(ys,Ue){var Vr=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Ue.exports=Vr});var O=m(function(v,Ne){var{MAX_SAFE_COMPONENT_LENGTH:ce,MAX_SAFE_BUILD_LENGTH:jr,MAX_LENGTH:Gr}=D(),Wr=U();v=Ne.exports={};var zr=v.re=[],Yr=v.safeRe=[],d=v.src=[],Kr=v.safeSrc=[],p=v.t={},Xr=0,ue="[a-zA-Z0-9-]",Jr=[["\\s",1],["\\d",Gr],[ue,jr]],Qr=(e)=>{for(let[t,r]of Jr)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},f=(e,t,r)=>{let n=Qr(t),o=Xr++;Wr(e,o,t),p[e]=o,d[o]=t,Kr[o]=n,zr[o]=new RegExp(t,r?"g":void 0),Yr[o]=new RegExp(n,r?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*");f("NUMERICIDENTIFIERLOOSE","\\d+");f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ue}*`);f("MAINVERSION",`(${d[p.NUMERICIDENTIFIER]})\\.(${d[p.NUMERICIDENTIFIER]})\\.(${d[p.NUMERICIDENTIFIER]})`);f("MAINVERSIONLOOSE",`(${d[p.NUMERICIDENTIFIERLOOSE]})\\.(${d[p.NUMERICIDENTIFIERLOOSE]})\\.(${d[p.NUMERICIDENTIFIERLOOSE]})`);f("PRERELEASEIDENTIFIER",`(?:${d[p.NONNUMERICIDENTIFIER]}|${d[p.NUMERICIDENTIFIER]})`);f("PRERELEASEIDENTIFIERLOOSE",`(?:${d[p.NONNUMERICIDENTIFIER]}|${d[p.NUMERICIDENTIFIERLOOSE]})`);f("PRERELEASE",`(?:-(${d[p.PRERELEASEIDENTIFIER]}(?:\\.${d[p.PRERELEASEIDENTIFIER]})*))`);f("PRERELEASELOOSE",`(?:-?(${d[p.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[p.PRERELEASEIDENTIFIERLOOSE]})*))`);f("BUILDIDENTIFIER",`${ue}+`);f("BUILD",`(?:\\+(${d[p.BUILDIDENTIFIER]}(?:\\.${d[p.BUILDIDENTIFIER]})*))`);f("FULLPLAIN",`v?${d[p.MAINVERSION]}${d[p.PRERELEASE]}?${d[p.BUILD]}?`);f("FULL",`^${d[p.FULLPLAIN]}$`);f("LOOSEPLAIN",`[v=\\s]*${d[p.MAINVERSIONLOOSE]}${d[p.PRERELEASELOOSE]}?${d[p.BUILD]}?`);f("LOOSE",`^${d[p.LOOSEPLAIN]}$`);f("GTLT","((?:<|>)?=?)");f("XRANGEIDENTIFIERLOOSE",`${d[p.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);f("XRANGEIDENTIFIER",`${d[p.NUMERICIDENTIFIER]}|x|X|\\*`);f("XRANGEPLAIN",`[v=\\s]*(${d[p.XRANGEIDENTIFIER]})(?:\\.(${d[p.XRANGEIDENTIFIER]})(?:\\.(${d[p.XRANGEIDENTIFIER]})(?:${d[p.PRERELEASE]})?${d[p.BUILD]}?)?)?`);f("XRANGEPLAINLOOSE",`[v=\\s]*(${d[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[p.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[p.XRANGEIDENTIFIERLOOSE]})(?:${d[p.PRERELEASELOOSE]})?${d[p.BUILD]}?)?)?`);f("XRANGE",`^${d[p.GTLT]}\\s*${d[p.XRANGEPLAIN]}$`);f("XRANGELOOSE",`^${d[p.GTLT]}\\s*${d[p.XRANGEPLAINLOOSE]}$`);f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${ce}})(?:\\.(\\d{1,${ce}}))?(?:\\.(\\d{1,${ce}}))?`);f("COERCE",`${d[p.COERCEPLAIN]}(?:$|[^\\d])`);f("COERCEFULL",d[p.COERCEPLAIN]+`(?:${d[p.PRERELEASE]})?(?:${d[p.BUILD]})?(?:$|[^\\d])`);f("COERCERTL",d[p.COERCE],!0);f("COERCERTLFULL",d[p.COERCEFULL],!0);f("LONETILDE","(?:~>?)");f("TILDETRIM",`(\\s*)${d[p.LONETILDE]}\\s+`,!0);v.tildeTrimReplace="$1~";f("TILDE",`^${d[p.LONETILDE]}${d[p.XRANGEPLAIN]}$`);f("TILDELOOSE",`^${d[p.LONETILDE]}${d[p.XRANGEPLAINLOOSE]}$`);f("LONECARET","(?:\\^)");f("CARETTRIM",`(\\s*)${d[p.LONECARET]}\\s+`,!0);v.caretTrimReplace="$1^";f("CARET",`^${d[p.LONECARET]}${d[p.XRANGEPLAIN]}$`);f("CARETLOOSE",`^${d[p.LONECARET]}${d[p.XRANGEPLAINLOOSE]}$`);f("COMPARATORLOOSE",`^${d[p.GTLT]}\\s*(${d[p.LOOSEPLAIN]})$|^$`);f("COMPARATOR",`^${d[p.GTLT]}\\s*(${d[p.FULLPLAIN]})$|^$`);f("COMPARATORTRIM",`(\\s*)${d[p.GTLT]}\\s*(${d[p.LOOSEPLAIN]}|${d[p.XRANGEPLAIN]})`,!0);v.comparatorTrimReplace="$1$2$3";f("HYPHENRANGE",`^\\s*(${d[p.XRANGEPLAIN]})\\s+-\\s+(${d[p.XRANGEPLAIN]})\\s*$`);f("HYPHENRANGELOOSE",`^\\s*(${d[p.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[p.XRANGEPLAINLOOSE]})\\s*$`);f("STAR","(<|>)?=?\\s*\\*");f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var z=m(function(Cs,Fe){var Zr=Object.freeze({loose:!0}),en=Object.freeze({}),tn=(e)=>{if(!e)return en;if(typeof e!=="object")return Zr;return e};Fe.exports=tn});var de=m(function(bs,He){var _e=/^[0-9]+$/,qe=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=_e.test(e),n=_e.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},rn=(e,t)=>qe(t,e);He.exports={compareIdentifiers:qe,rcompareIdentifiers:rn}});var x=m(function(hs,$e){var Y=U(),{MAX_LENGTH:Me,MAX_SAFE_INTEGER:K}=D(),{safeRe:X,t:J}=O(),nn=z(),{compareIdentifiers:pe}=de(),on=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(pe(e[n],r[n])!==0)return!1;return!0};class E{constructor(e,t){if(t=nn(t),e instanceof E)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Me)throw TypeError(`version is longer than ${Me} characters`);Y("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?X[J.LOOSE]:X[J.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>K||this.major<0)throw TypeError("Invalid major version");if(this.minor>K||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>K||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let o=+n;if(o>=0&&o<K)return o}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(Y("SemVer.compare",this.version,this.options,e),!(e instanceof E)){if(typeof e==="string"&&e===this.version)return 0;e=new E(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof E))e=new E(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof E))e=new E(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(Y("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return pe(r,n)}while(++t)}compareBuild(e){if(!(e instanceof E))e=new E(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(Y("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return pe(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?X[J.PRERELEASELOOSE]:X[J.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let o=this.prerelease.length;while(--o>=0)if(typeof this.prerelease[o]==="number")this.prerelease[o]++,o=-2;if(o===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let o=[t,n];if(r===!1)o=[t];if(on(this.prerelease,t)){let i=this.prerelease[t.split(".").length];if(isNaN(i))this.prerelease=o}else this.prerelease=o}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}$e.exports=E});var T=m(function(xs,je){var Ve=x(),sn=(e,t,r=!1)=>{if(e instanceof Ve)return e;try{return new Ve(e,t)}catch(n){if(!r)return null;throw n}};je.exports=sn});var We=m(function(Rs,Ge){var an=T(),ln=(e,t)=>{let r=an(e,t);return r?r.version:null};Ge.exports=ln});var Ye=m(function(Is,ze){var cn=T(),un=(e,t)=>{let r=cn(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};ze.exports=un});var Je=m(function(ks,Xe){var Ke=x(),dn=(e,t,r,n,o)=>{if(typeof r==="string")o=n,n=r,r=void 0;try{return new Ke(e instanceof Ke?e.version:e,r).inc(t,n,o).version}catch(i){return null}};Xe.exports=dn});var et=m(function(Ps,Ze){var Qe=T(),pn=(e,t)=>{let r=Qe(e,null,!0),n=Qe(t,null,!0),o=r.compare(n);if(o===0)return null;let i=o>0,s=i?r:n,a=i?n:r,l=!!s.prerelease.length;if(!!a.prerelease.length&&!l){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let u=l?"pre":"";if(r.major!==n.major)return u+"major";if(r.minor!==n.minor)return u+"minor";if(r.patch!==n.patch)return u+"patch";return"prerelease"};Ze.exports=pn});var rt=m(function(As,tt){var gn=x(),mn=(e,t)=>new gn(e,t).major;tt.exports=mn});var ot=m(function(ws,nt){var fn=x(),yn=(e,t)=>new fn(e,t).minor;nt.exports=yn});var st=m(function(Es,it){var Cn=x(),bn=(e,t)=>new Cn(e,t).patch;it.exports=bn});var lt=m(function(Ss,at){var hn=T(),xn=(e,t)=>{let r=hn(e,t);return r&&r.prerelease.length?r.prerelease:null};at.exports=xn});var P=m(function(vs,ut){var ct=x(),Rn=(e,t,r)=>new ct(e,r).compare(new ct(t,r));ut.exports=Rn});var pt=m(function(Ts,dt){var In=P(),kn=(e,t,r)=>In(t,e,r);dt.exports=kn});var mt=m(function(Ds,gt){var Pn=P(),An=(e,t)=>Pn(e,t,!0);gt.exports=An});var Q=m(function(Os,yt){var ft=x(),wn=(e,t,r)=>{let n=new ft(e,r),o=new ft(t,r);return n.compare(o)||n.compareBuild(o)};yt.exports=wn});var bt=m(function(Ls,Ct){var En=Q(),Sn=(e,t)=>e.sort((r,n)=>En(r,n,t));Ct.exports=Sn});var xt=m(function(Bs,ht){var vn=Q(),Tn=(e,t)=>e.sort((r,n)=>vn(n,r,t));ht.exports=Tn});var N=m(function(Us,Rt){var Dn=P(),On=(e,t,r)=>Dn(e,t,r)>0;Rt.exports=On});var Z=m(function(Ns,It){var Ln=P(),Bn=(e,t,r)=>Ln(e,t,r)<0;It.exports=Bn});var ge=m(function(Fs,kt){var Un=P(),Nn=(e,t,r)=>Un(e,t,r)===0;kt.exports=Nn});var me=m(function(_s,Pt){var Fn=P(),_n=(e,t,r)=>Fn(e,t,r)!==0;Pt.exports=_n});var ee=m(function(qs,At){var qn=P(),Hn=(e,t,r)=>qn(e,t,r)>=0;At.exports=Hn});var te=m(function(Hs,wt){var Mn=P(),$n=(e,t,r)=>Mn(e,t,r)<=0;wt.exports=$n});var fe=m(function(Ms,Et){var Vn=ge(),jn=me(),Gn=N(),Wn=ee(),zn=Z(),Yn=te(),Kn=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return Vn(e,r,n);case"!=":return jn(e,r,n);case">":return Gn(e,r,n);case">=":return Wn(e,r,n);case"<":return zn(e,r,n);case"<=":return Yn(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};Et.exports=Kn});var vt=m(function($s,St){var Xn=x(),Jn=T(),{safeRe:re,t:ne}=O(),Qn=(e,t)=>{if(e instanceof Xn)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?re[ne.COERCEFULL]:re[ne.COERCE]);else{let l=t.includePrerelease?re[ne.COERCERTLFULL]:re[ne.COERCERTL],c;while((c=l.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||c.index+c[0].length!==r.index+r[0].length)r=c;l.lastIndex=c.index+c[1].length+c[2].length}l.lastIndex=-1}if(r===null)return null;let n=r[2],o=r[3]||"0",i=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Jn(`${n}.${o}.${i}${s}${a}`,t)};St.exports=Qn});var Dt=m(function(Vs,Tt){var Zn=T(),eo=D(),to=x(),ro=(e,t,r)=>{if(!eo.RELEASE_TYPES.includes(t))return null;let n=no(e,r);return n&&oo(n,t)},no=(e,t)=>{let r=e instanceof to?e.version:e;return Zn(r,t)},oo=(e,t)=>{if(io(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},io=(e)=>e.startsWith("pre");Tt.exports=ro});var Bt=m(function(js,Lt){class Ot{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}Lt.exports=Ot});var A=m(function(Gs,_t){var so=/\s+/g;class F{constructor(e,t){if(t=lo(t),e instanceof F)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new F(e.raw,t);if(e instanceof ye)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(so," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!Nt(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&bo(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(Co,"");let r=((this.options.includePrerelease&&fo)|(this.options.loose&&yo))+":"+e,n=Ut.get(r);if(n)return n;let o=this.options.loose,i=o?I[R.HYPHENRANGELOOSE]:I[R.HYPHENRANGE];e=e.replace(i,vo(this.options.includePrerelease)),b("hyphen replace",e),e=e.replace(I[R.COMPARATORTRIM],po),b("comparator trim",e),e=e.replace(I[R.TILDETRIM],go),b("tilde trim",e),e=e.replace(I[R.CARETTRIM],mo),b("caret trim",e);let s=e.split(" ").map((u)=>ho(u,this.options)).join(" ").split(/\s+/).map((u)=>So(u,this.options));if(o)s=s.filter((u)=>(b("loose invalid filter",u,this.options),!!u.match(I[R.COMPARATORLOOSE])));b("range list",s);let a=new Map,l=s.map((u)=>new ye(u,this.options));for(let u of l){if(Nt(u))return[u];a.set(u.value,u)}if(a.size>1&&a.has(""))a.delete("");let c=[...a.values()];return Ut.set(r,c),c}intersects(e,t){if(!(e instanceof F))throw TypeError("a Range is required");return this.set.some((r)=>Ft(r,t)&&e.set.some((n)=>Ft(n,t)&&r.every((o)=>n.every((i)=>o.intersects(i,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new co(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(To(this.set[t],e,this.options))return!0;return!1}}_t.exports=F;var ao=Bt(),Ut=new ao,lo=z(),ye=_(),b=U(),co=x(),{safeRe:I,src:uo,t:R,comparatorTrimReplace:po,tildeTrimReplace:go,caretTrimReplace:mo}=O(),{FLAG_INCLUDE_PRERELEASE:fo,FLAG_LOOSE:yo}=D(),Co=new RegExp(uo[R.BUILD],"g"),Nt=(e)=>e.value==="<0.0.0-0",bo=(e)=>e.value==="",Ft=(e,t)=>{let r=!0,n=e.slice(),o=n.pop();while(r&&n.length)r=n.every((i)=>o.intersects(i,t)),o=n.pop();return r},ho=(e,t)=>(e=e.replace(I[R.BUILD],""),b("comp",e,t),e=ko(e,t),b("caret",e),e=Ro(e,t),b("tildes",e),e=Ao(e,t),b("xrange",e),e=Eo(e,t),b("stars",e),e),h=(e)=>!e||e.toLowerCase()==="x"||e==="*",xo=(e,t,r)=>h(e)&&!h(t)||h(t)&&r&&!h(r),Ro=(e,t)=>e.trim().split(/\s+/).map((r)=>Io(r,t)).join(" "),Io=(e,t)=>{let r=t.loose?I[R.TILDELOOSE]:I[R.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(o,i,s,a,l)=>{b("tilde",e,o,i,s,a,l);let c;if(h(i))c="";else if(h(s))c=`>=${i}.0.0${n} <${+i+1}.0.0-0`;else if(h(a))c=`>=${i}.${s}.0${n} <${i}.${+s+1}.0-0`;else if(l)b("replaceTilde pr",l),c=`>=${i}.${s}.${a}-${l} <${i}.${+s+1}.0-0`;else c=`>=${i}.${s}.${a} <${i}.${+s+1}.0-0`;return b("tilde return",c),c})},ko=(e,t)=>e.trim().split(/\s+/).map((r)=>Po(r,t)).join(" "),Po=(e,t)=>{b("caret",e,t);let r=t.loose?I[R.CARETLOOSE]:I[R.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(o,i,s,a,l)=>{b("caret",e,o,i,s,a,l);let c;if(h(i))c="";else if(h(s))c=`>=${i}.0.0${n} <${+i+1}.0.0-0`;else if(h(a))if(i==="0")c=`>=${i}.${s}.0${n} <${i}.${+s+1}.0-0`;else c=`>=${i}.${s}.0${n} <${+i+1}.0.0-0`;else if(l)if(b("replaceCaret pr",l),i==="0")if(s==="0")c=`>=${i}.${s}.${a}-${l} <${i}.${s}.${+a+1}-0`;else c=`>=${i}.${s}.${a}-${l} <${i}.${+s+1}.0-0`;else c=`>=${i}.${s}.${a}-${l} <${+i+1}.0.0-0`;else if(b("no pr"),i==="0")if(s==="0")c=`>=${i}.${s}.${a} <${i}.${s}.${+a+1}-0`;else c=`>=${i}.${s}.${a} <${i}.${+s+1}.0-0`;else c=`>=${i}.${s}.${a} <${+i+1}.0.0-0`;return b("caret return",c),c})},Ao=(e,t)=>(b("replaceXRanges",e,t),e.split(/\s+/).map((r)=>wo(r,t)).join(" ")),wo=(e,t)=>{e=e.trim();let r=t.loose?I[R.XRANGELOOSE]:I[R.XRANGE];return e.replace(r,(n,o,i,s,a,l)=>{if(b("xRange",e,n,o,i,s,a,l),xo(i,s,a))return e;let c=h(i),u=c||h(s),y=u||h(a),C=y;if(o==="="&&C)o="";if(l=t.includePrerelease?"-0":"",c)if(o===">"||o==="<")n="<0.0.0-0";else n="*";else if(o&&C){if(u)s=0;if(a=0,o===">")if(o=">=",u)i=+i+1,s=0,a=0;else s=+s+1,a=0;else if(o==="<=")if(o="<",u)i=+i+1;else s=+s+1;if(o==="<")l="-0";n=`${o+i}.${s}.${a}${l}`}else if(u)n=`>=${i}.0.0${l} <${+i+1}.0.0-0`;else if(y)n=`>=${i}.${s}.0${l} <${i}.${+s+1}.0-0`;return b("xRange return",n),n})},Eo=(e,t)=>(b("replaceStars",e,t),e.trim().replace(I[R.STAR],"")),So=(e,t)=>(b("replaceGTE0",e,t),e.trim().replace(I[t.includePrerelease?R.GTE0PRE:R.GTE0],"")),vo=(e)=>(t,r,n,o,i,s,a,l,c,u,y,C)=>{if(h(n))r="";else if(h(o))r=`>=${n}.0.0${e?"-0":""}`;else if(h(i))r=`>=${n}.${o}.0${e?"-0":""}`;else if(s)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(h(c))l="";else if(h(u))l=`<${+c+1}.0.0-0`;else if(h(y))l=`<${c}.${+u+1}.0-0`;else if(C)l=`<=${c}.${u}.${y}-${C}`;else if(e)l=`<${c}.${u}.${+y+1}-0`;else l=`<=${l}`;return`${r} ${l}`.trim()},To=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(b(e[n].semver),e[n].semver===ye.ANY)continue;if(e[n].semver.prerelease.length>0){let o=e[n].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}}return!1}return!0}});var _=m(function(Ws,jt){var q=Symbol("SemVer ANY");class oe{static get ANY(){return q}constructor(e,t){if(t=qt(t),e instanceof oe)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),be("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===q)this.value="";else this.value=this.operator+this.semver.version;be("comp",this)}parse(e){let t=this.options.loose?Ht[Mt.COMPARATORLOOSE]:Ht[Mt.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=q;else this.semver=new $t(r[2],this.options.loose)}toString(){return this.value}test(e){if(be("Comparator.test",e,this.options.loose),this.semver===q||e===q)return!0;if(typeof e==="string")try{e=new $t(e,this.options)}catch(t){return!1}return Ce(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof oe))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Vt(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Vt(this.value,t).test(e.semver)}if(t=qt(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(Ce(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(Ce(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}jt.exports=oe;var qt=z(),{safeRe:Ht,t:Mt}=O(),Ce=fe(),be=U(),$t=x(),Vt=A()});var H=m(function(zs,Gt){var Do=A(),Oo=(e,t,r)=>{try{t=new Do(t,r)}catch(n){return!1}return t.test(e)};Gt.exports=Oo});var zt=m(function(Ys,Wt){var Lo=A(),Bo=(e,t)=>new Lo(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));Wt.exports=Bo});var Kt=m(function(Ks,Yt){var Uo=x(),No=A(),Fo=(e,t,r)=>{let n=null,o=null,i=null;try{i=new No(t,r)}catch(s){return null}return e.forEach((s)=>{if(i.test(s)){if(!n||o.compare(s)===-1)n=s,o=new Uo(n,r)}}),n};Yt.exports=Fo});var Jt=m(function(Xs,Xt){var _o=x(),qo=A(),Ho=(e,t,r)=>{let n=null,o=null,i=null;try{i=new qo(t,r)}catch(s){return null}return e.forEach((s)=>{if(i.test(s)){if(!n||o.compare(s)===1)n=s,o=new _o(n,r)}}),n};Xt.exports=Ho});var er=m(function(Js,Zt){var he=x(),Mo=A(),Qt=N(),$o=(e,t)=>{e=new Mo(e,t);let r=new he("0.0.0");if(e.test(r))return r;if(r=new he("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let o=e.set[n],i=null;if(o.forEach((s)=>{let a=new he(s.semver.version);switch(s.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!i||Qt(a,i))i=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${s.operator}`)}}),i&&(!r||Qt(r,i)))r=i}if(r&&e.test(r))return r;return null};Zt.exports=$o});var rr=m(function(Qs,tr){var Vo=A(),jo=(e,t)=>{try{return new Vo(e,t).range||"*"}catch(r){return null}};tr.exports=jo});var ie=m(function(Zs,sr){var Go=x(),ir=_(),{ANY:Wo}=ir,zo=A(),Yo=H(),nr=N(),or=Z(),Ko=te(),Xo=ee(),Jo=(e,t,r,n)=>{e=new Go(e,n),t=new zo(t,n);let o,i,s,a,l;switch(r){case">":o=nr,i=Ko,s=or,a=">",l=">=";break;case"<":o=or,i=Xo,s=nr,a="<",l="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(Yo(e,t,n))return!1;for(let c=0;c<t.set.length;++c){let u=t.set[c],y=null,C=null;if(u.forEach((g)=>{if(g.semver===Wo)g=new ir(">=0.0.0");if(y=y||g,C=C||g,o(g.semver,y.semver,n))y=g;else if(s(g.semver,C.semver,n))C=g}),y.operator===a||y.operator===l)return!1;if((!C.operator||C.operator===a)&&i(e,C.semver))return!1;else if(C.operator===l&&s(e,C.semver))return!1}return!0};sr.exports=Jo});var lr=m(function(ea,ar){var Qo=ie(),Zo=(e,t,r)=>Qo(e,t,">",r);ar.exports=Zo});var ur=m(function(ta,cr){var ei=ie(),ti=(e,t,r)=>ei(e,t,"<",r);cr.exports=ti});var gr=m(function(ra,pr){var dr=A(),ri=(e,t,r)=>(e=new dr(e,r),t=new dr(t,r),e.intersects(t,r));pr.exports=ri});var fr=m(function(na,mr){var ni=H(),oi=P();mr.exports=(e,t,r)=>{let n=[],o=null,i=null,s=e.sort((u,y)=>oi(u,y,r));for(let u of s)if(ni(u,t,r)){if(i=u,!o)o=u}else{if(i)n.push([o,i]);i=null,o=null}if(o)n.push([o,null]);let a=[];for(let[u,y]of n)if(u===y)a.push(u);else if(!y&&u===s[0])a.push("*");else if(!y)a.push(`>=${u}`);else if(u===s[0])a.push(`<=${y}`);else a.push(`${u} - ${y}`);let l=a.join(" || "),c=typeof t.raw==="string"?t.raw:String(t);return l.length<c.length?l:t}});var Rr=m(function(oa,xr){var yr=A(),Ie=_(),{ANY:xe}=Ie,Re=H(),ke=P(),ii=(e,t,r={})=>{if(e===t)return!0;e=new yr(e,r),t=new yr(t,r);let n=!1;e:for(let o of e.set){for(let i of t.set){let s=ai(o,i,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},si=[new Ie(">=0.0.0-0")],Cr=[new Ie(">=0.0.0")],ai=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===xe)if(t.length===1&&t[0].semver===xe)return!0;else if(r.includePrerelease)e=si;else e=Cr;if(t.length===1&&t[0].semver===xe)if(r.includePrerelease)return!0;else t=Cr;let n=new Set,o,i;for(let g of e)if(g.operator===">"||g.operator===">=")o=br(o,g,r);else if(g.operator==="<"||g.operator==="<=")i=hr(i,g,r);else n.add(g.semver);if(n.size>1)return null;let s;if(o&&i){if(s=ke(o.semver,i.semver,r),s>0)return null;else if(s===0&&(o.operator!==">="||i.operator!=="<="))return null}for(let g of n){if(o&&!Re(g,String(o),r))return null;if(i&&!Re(g,String(i),r))return null;for(let Lr of t)if(!Re(g,String(Lr),r))return!1;return!0}let a,l,c,u,y=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,C=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;if(y&&y.prerelease.length===1&&i.operator==="<"&&y.prerelease[0]===0)y=!1;for(let g of t){if(u=u||g.operator===">"||g.operator===">=",c=c||g.operator==="<"||g.operator==="<=",o){if(C){if(g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===C.major&&g.semver.minor===C.minor&&g.semver.patch===C.patch)C=!1}if(g.operator===">"||g.operator===">="){if(a=br(o,g,r),a===g&&a!==o)return!1}else if(o.operator===">="&&!g.test(o.semver))return!1}if(i){if(y){if(g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===y.major&&g.semver.minor===y.minor&&g.semver.patch===y.patch)y=!1}if(g.operator==="<"||g.operator==="<="){if(l=hr(i,g,r),l===g&&l!==i)return!1}else if(i.operator==="<="&&!g.test(i.semver))return!1}if(!g.operator&&(i||o)&&s!==0)return!1}if(o&&c&&!i&&s!==0)return!1;if(i&&u&&!o&&s!==0)return!1;if(C||y)return!1;return!0},br=(e,t,r)=>{if(!e)return t;let n=ke(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},hr=(e,t,r)=>{if(!e)return t;let n=ke(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};xr.exports=ii});var Ar=m(function(ia,Pr){var Pe=O(),Ir=D(),li=x(),kr=de(),ci=T(),ui=We(),di=Ye(),pi=Je(),gi=et(),mi=rt(),fi=ot(),yi=st(),Ci=lt(),bi=P(),hi=pt(),xi=mt(),Ri=Q(),Ii=bt(),ki=xt(),Pi=N(),Ai=Z(),wi=ge(),Ei=me(),Si=ee(),vi=te(),Ti=fe(),Di=vt(),Oi=Dt(),Li=_(),Bi=A(),Ui=H(),Ni=zt(),Fi=Kt(),_i=Jt(),qi=er(),Hi=rr(),Mi=ie(),$i=lr(),Vi=ur(),ji=gr(),Gi=fr(),Wi=Rr();Pr.exports={parse:ci,valid:ui,clean:di,inc:pi,diff:gi,major:mi,minor:fi,patch:yi,prerelease:Ci,compare:bi,rcompare:hi,compareLoose:xi,compareBuild:Ri,sort:Ii,rsort:ki,gt:Pi,lt:Ai,eq:wi,neq:Ei,gte:Si,lte:vi,cmp:Ti,coerce:Di,truncate:Oi,Comparator:Li,Range:Bi,satisfies:Ui,toComparators:Ni,maxSatisfying:Fi,minSatisfying:_i,minVersion:qi,validRange:Hi,outside:Mi,gtr:$i,ltr:Vi,intersects:ji,simplifyRange:Gi,subset:Wi,SemVer:li,re:Pe.re,src:Pe.src,tokens:Pe.t,SEMVER_SPEC_VERSION:Ir.SEMVER_SPEC_VERSION,RELEASE_TYPES:Ir.RELEASE_TYPES,compareIdentifiers:kr.compareIdentifiers,rcompareIdentifiers:kr.rcompareIdentifiers}});var zi=Hr(Ar(),1);function wr(e){return e}function Er(e){return e}function M(e){return e}function Yi(){return{name:"UIBot Hub Runtime",workflows:[{id:"component-request",description:"Request, generate, evaluate, and publish missing components",triggers:["api:component-request","compiler:gap-detected","renderer:unknown-component"]},{id:"component-review",description:"Review generated artifacts and feed the evaluator pipeline",triggers:["workflow:component-request:generated"]},{id:"component-evolve",description:"Run scheduled reevaluations and trigger upgrade tasks",triggers:["cron:daily-02:00"]}],protocols:{rest:!0,a2a:!0,mcp:!0},observability:"builtin"}}function la(){let e=wr({pluginId:"uibot.hub-runtime",version:"0.1.0",displayName:"UIBot Hub Runtime",description:"Official UIBot Hub runtime for orchestration, protocol surfaces, and evaluations.",sdkRange:"^0.1.0",engineRange:"^0.1.0",capabilities:[{id:"uibot.hub.runtime",type:"agent:runtime",description:"UIBot Hub workflow runtime for orchestration"},{id:"uibot.hub.a2a",type:"protocol:adapter",description:"A2A adapter provided by UIBot Hub runtime"},{id:"uibot.hub.mcp",type:"protocol:adapter",description:"MCP adapter provided by UIBot Hub runtime"},{id:"uibot.hub.evals",type:"evaluation:runner",description:"Evaluation bridge executed via UIBot Hub workflow surfaces"}],permissions:[{resource:"network:https",reason:"Connect to model providers and remote registries",required:!0},{resource:"remote:execute",reason:"Coordinate signed remote workers for long-running generation jobs",required:!1}]});return Er({manifest:e,register(t){let r=Yi(),n=[M({id:"uibot.hub.runtime",type:"agent:runtime",description:"UIBot Hub workflow runtime",contribution:r}),M({id:"uibot.hub.a2a",type:"protocol:adapter",description:"A2A support through UIBot Hub runtime",contribution:r.protocols}),M({id:"uibot.hub.mcp",type:"protocol:adapter",description:"MCP support through UIBot Hub runtime",contribution:r.protocols}),M({id:"uibot.hub.evals",type:"evaluation:runner",description:"Evaluation entrypoints managed by UIBot Hub workflows",contribution:r.workflows})];for(let o of n)t.addCapability(o)}})}function se(e){return{...e,request:{...e.request},...e.artifact?{artifact:{...e.artifact}}:{}}}function Ki(e,t){let r=t.status??e.status,n={...e,status:r,updatedAt:t.updatedAt??new Date().toISOString()};if(typeof t.progress==="number")n.progress=t.progress;else if(r==="ready")n.progress=100;else if(r==="failed")delete n.progress;if(t.artifact)n.artifact=t.artifact;else if(r!=="ready")delete n.artifact;if(typeof t.error==="string")n.error=t.error;else if(r!=="failed")delete n.error;if(r==="ready")delete n.error;return n}function Sr(){let e=new Map;return{createTask(t){let r=t.createdAt??new Date().toISOString(),n={taskId:t.taskId,request:{...t.request},status:"pending",createdAt:r,updatedAt:r};return e.set(n.taskId,n),se(n)},getTask(t){let r=e.get(t);return r?se(r):void 0},listTasks(){return[...e.values()].map((t)=>se(t))},updateTask(t,r){let n=e.get(t);if(!n)throw Error(`Hub task not found: ${t}`);let o=Ki(n,r);return e.set(t,o),se(o)}}}function vr(e){if(e instanceof Error)return e.message;return typeof e==="string"?e:"Unknown Hub task error"}function Ae(e="/api/hub"){return(e.startsWith("/")?e:`/${e}`).replace(/\/+$/,"")||"/api/hub"}function Xi(e,t,r){function n(o,i){return t.updateTask(e,{status:o,...typeof i?.progress==="number"?{progress:i.progress}:{},updatedAt:r().toISOString()})}return{taskId:e,getSnapshot(){let o=t.getTask(e);if(!o)throw Error(`Hub task not found: ${e}`);return o},markPending(o){return n("pending",typeof o==="number"?{progress:o}:void 0)},markRunning(o){return n("running",typeof o==="number"?{progress:o}:void 0)},markReady(o){return t.updateTask(e,{status:"ready",artifact:o,updatedAt:r().toISOString()})},markFailed(o){return t.updateTask(e,{status:"failed",error:o,updatedAt:r().toISOString()})}}}function Ji(e){switch(e.status){case"ready":if(!e.artifact)throw Error(`Hub task ${e.taskId} is ready but artifact is missing`);return{taskId:e.taskId,status:"ready",artifact:e.artifact};case"failed":return{taskId:e.taskId,status:"failed",error:e.error??"Unknown Hub task error"};case"pending":case"running":return{taskId:e.taskId,status:e.status,...typeof e.progress==="number"?{progress:e.progress}:{}}}}function Qi(e,t){Promise.resolve().then(async()=>{let r=await e.run(t);if(r)t.markReady(r)}).catch((r)=>{t.markFailed(vr(r))})}function pa(e){let t=Ae(e.basePath),r=e.taskStore??Sr(),n=e.clock??(()=>new Date),o=e.createTaskId??(()=>crypto.randomUUID());return{async requestComponent(i){let s=o(),a=r.createTask({taskId:s,request:i,createdAt:n().toISOString()}),l=Xi(s,r,n),c;try{c=await e.requestComponent({payload:i,task:a,controller:l})}catch(C){throw l.markFailed(vr(C)),C}if(c.mode==="ready")return l.markReady(c.artifact),{status:"ready",artifact:c.artifact};if(c.initialStatus==="running")l.markRunning(c.progress);else if(typeof c.progress==="number")l.markPending(c.progress);Qi(c,l);let u=l.getSnapshot();if(u.status==="ready"&&u.artifact)return{status:"ready",artifact:u.artifact};if(u.status==="failed")throw Error(u.error??"Unknown Hub task error");return{status:u.status==="running"?"running":"pending",taskId:s,pollUrl:`${t}/tasks/${s}`}},getTask(i){return r.getTask(i)},listTasks(){return r.listTasks()},getTaskStatus(i){let s=r.getTask(i);return s?Ji(s):void 0}}}function we(e,t=200){return Response.json(e,{status:t})}function L(e,t){return we({error:t},e)}function fa(e){let t=Ae(e.basePath),r=`${t}/components/request`,n=`${t}/tasks/`;return async function(i){let s=new URL(i.url);if(i.method==="POST"&&s.pathname===r){let a;try{a=await i.json()}catch{return L(400,"Invalid JSON payload")}if(!a.name)return L(400,"Field 'name' is required");try{let l=await e.service.requestComponent(a),c=l.status==="ready"?200:202;return we(l,c)}catch(l){return L(500,l instanceof Error?l.message:"Hub request failed")}}if(i.method==="GET"&&s.pathname.startsWith(n)){let a=decodeURIComponent(s.pathname.slice(n.length));if(!a||a.includes("/"))return L(404,"Task not found");let l=e.service.getTaskStatus(a);return l?we(l):L(404,"Task not found")}return L(404,"Not found")}}function Zi(e){return{mode:"ready",artifact:e.artifact}}function es(e){return{mode:"async",...e.initialStatus?{initialStatus:e.initialStatus}:{},...typeof e.progress==="number"?{progress:e.progress}:{},async run(){return e.waitForResult?await e.waitForResult():void 0}}}function Ca(e){let t=e.workflowId??"component-request";return async function(n){let o=await e.runtime.runWorkflow({workflowId:t,input:n.payload,taskId:n.task.taskId});return o.state==="ready"?Zi(o):es(o)}}function ts(e){if(e.status==="ready")return{status:"completed",state:"ready",artifact:e.artifact};return{id:e.taskId,status:"working",state:e.status}}function rs(e){switch(e.status){case"ready":return{id:e.taskId,status:"completed",state:"ready",artifact:e.artifact};case"failed":return{id:e.taskId,status:"failed",state:"failed",error:e.error};case"pending":case"running":return{id:e.taskId,status:"working",state:e.status,...typeof e.progress==="number"?{progress:e.progress}:{}}}}function Ee(e,t){return{jsonrpc:"2.0",id:e,result:t}}function V(e,t,r){return{jsonrpc:"2.0",id:e,error:{code:t,message:r}}}function ns(e,t){return{name:"UIBot ComponentHub",description:"AI-driven component hub that generates, maintains, and evolves UI components on demand.",url:e.replace(/\/+$/,""),version:"1.0.0",protocolVersion:"1.0",provider:{organization:"UIBot",url:"https://github.com/Foundj/uibot"},capabilities:{streaming:!1,pushNotifications:!1,stateTransitionHistory:!1},authentication:{schemes:["none","bearer"]},skills:[{id:"component-request",name:"Request Component Generation",description:"Request generation of a missing UI component.",inputModes:["text","data"],outputModes:["text","data"],examples:["Generate a KanbanBoard component","I need a multi-step form wizard component"]},{id:"get-task-status",name:"Get Task Status",description:"Read the status of an existing Hub task.",inputModes:["data"],outputModes:["data"]}],...t}}function ae(e,t=200){return Response.json(e,{status:t})}function ha(e){let t=ns(e.baseUrl,e.card),r=e.agentCardPath??"/.well-known/agent.json",n=e.rpcPath??"/api/a2a",o=async(s)=>{let a=s.id??null;try{switch(s.method){case"agent.getCard":return Ee(a,t);case"component.request":{let l=s.params??{},c=typeof l.name==="string"?l.name:"";if(!c)return V(a,-32602,"Field 'name' is required");let u=await e.service.requestComponent({name:c,...typeof l.context==="string"?{context:l.context}:{},...typeof l.requestedBy==="string"?{requestedBy:l.requestedBy}:{},...l.priority==="low"||l.priority==="normal"||l.priority==="high"?{priority:l.priority}:{}});return Ee(a,{task:ts(u)})}case"tasks.get":{let l=s.params??{},c=typeof l.taskId==="string"?l.taskId:"";if(!c)return V(a,-32602,"Field 'taskId' is required");let u=e.service.getTaskStatus(c);if(!u)return V(a,-32004,"Task not found");return Ee(a,{task:rs(u)})}}}catch(l){return V(a,-32000,l instanceof Error?l.message:"A2A request failed")}};return{card:t,handleJsonRpc:o,handleHttp:async(s)=>{let a=new URL(s.url);if(s.method==="GET"&&a.pathname===r)return ae(t);if(s.method==="POST"&&a.pathname===n){let l;try{l=await s.json()}catch{return ae(V(null,-32700,"Invalid JSON payload"),400)}let c=await o(l),u="error"in c?400:200;return ae(c,u)}return ae({error:"Not found"},404)}}}var ss={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},gl=Array.from(new Set(Object.values(ss).flat()));var Se=["component","template","design-guide","example","skill","block","package","theme"],ve=["experimental","candidate","recommended"];var Te=Object.freeze([Object.freeze({name:"manifest",summary:"Describe query operations and list the derived resource index.",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:"search",summary:"Search resources with deterministic bilingual ranking and reasons.",positionals:Object.freeze([Object.freeze({name:"text",property:"text",type:"string",required:!1})]),options:Object.freeze([Object.freeze({name:"kind",property:"kinds",type:"resource-kind",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"tag",property:"tags",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"category",property:"categories",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"capability",property:"capabilities",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"maturity",property:"maturities",type:"resource-maturity",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"limit",property:"limit",type:"positive-integer"})])}),Object.freeze({name:"get",summary:"Resolve one canonical resource id or unambiguous alias.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])}),Object.freeze({name:"build",summary:"Plan dependency closure and gaps without writing or installing.",positionals:Object.freeze([Object.freeze({name:"root",property:"roots",type:"string",required:!0,variadic:!0})]),options:Object.freeze([])}),Object.freeze({name:"docs",summary:"Read curated public documentation for one resource.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"locale",property:"locale",type:"string"},{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"examples",summary:"Read one bounded page of examples and exact dependencies. Follow nextPage for complete source.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"install-plan",summary:"Describe distribution channels without installing or writing.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])})]);var as=["background","foreground","card","card-foreground","popover","popover-foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","border","input","ring","destructive","destructive-foreground","success","success-foreground","warning","warning-foreground"],bl=[...as,"radius","font-display","font-body","font-mono"];var Or=["resource-mcp-invalid-argument","resource-query-failed"];function G(e,t){return`Tool '${e}' is not wired in this build: no '${t}' discovery provider was supplied. `+`This is not an empty result \u2014 supply a 'discovery.${t}' provider to enable it.`}function Tr(e){return`Tool '${e}' is not wired in this build: no Hub service was supplied. Supply a service to enable component requests and task status.`}function ls(e){if(e.status==="ready")return{status:"ready",artifact:e.artifact};return{status:e.status,taskId:e.taskId,pollUrl:e.pollUrl}}function cs(e){switch(e.status){case"ready":return{taskId:e.taskId,status:"ready",artifact:e.artifact};case"failed":return{taskId:e.taskId,status:"failed",error:e.error};case"pending":case"running":return{taskId:e.taskId,status:e.status,...typeof e.progress==="number"?{progress:e.progress}:{}}}}function S(e){return{content:[{type:"json",json:e}]}}function k(e){return{content:[{type:"text",text:e}],isError:!0}}function De(e,t){return{content:[{type:"json",json:{error:{code:e,detail:t}}}],isError:!0}}var W="uibot_resource_";function us(e){return`${W}${e}`}function Dr(e,t){let r;if(e==="resource-kind")r={type:"string",enum:[...Se]};else if(e==="resource-maturity")r={type:"string",enum:[...ve]};else if(e==="positive-integer")r={type:"integer",minimum:1};else r={type:"string"};return t?{type:"array",items:r}:r}function ds(){return Te.map((e)=>{let t={},r=[];for(let n of e.positionals)if(t[n.property]=Dr(n.type,"variadic"in n&&n.variadic===!0),n.required)r.push(n.property);for(let n of e.options)t[n.property]=Dr(n.type,"multiple"in n&&n.multiple===!0);return{name:us(e.name),description:e.summary,inputSchema:{type:"object",properties:t,additionalProperties:!1,...r.length?{required:r}:{}}}})}class w extends Error{detail;code=Or[0];constructor(e){super(e);this.detail=e;this.name="ResourceMcpArgumentError"}}function j(e,t){let r=new Set(t),n=Object.keys(e).find((o)=>!r.has(o));if(n)throw new w(`unsupported argument: ${n}`)}function le(e,t){let r=e[t];if(r===void 0)return;if(typeof r!=="string"||!r.trim())throw new w(`${t} must be a non-empty string`);return r}function B(e,t,r){let n=e[t];if(n===void 0)return;if(!Array.isArray(n)||n.length===0||n.some((o)=>typeof o!=="string"||!o.trim()))throw new w(`${t} must be a non-empty string array`);if(r){let o=n.find((i)=>!r.includes(i));if(o)throw new w(`${t} contains unsupported value: ${o}`)}return n}function ps(e){if(e instanceof w)return De(e.code,e.detail);if(e&&typeof e==="object"){let t=e;if(typeof t.code==="string"){let r=typeof t.detail==="string"?t.detail:typeof t.message==="string"?t.message:t.code;return De(t.code,r)}}return De(Or[1],"resource query callback failed")}async function gs(e,t,r){try{if(e==="manifest")return j(t,[]),S({data:{index:await r.manifest()}});if(e==="search"){j(t,["text","kinds","tags","categories","capabilities","maturities","limit"]);let o=le(t,"text"),i=B(t,"kinds",Se),s=B(t,"tags"),a=B(t,"categories"),l=B(t,"capabilities"),c=B(t,"maturities",ve),u=t.limit;if(u!==void 0&&(typeof u!=="number"||!Number.isInteger(u)||u<=0))throw new w("limit must be a positive integer");let y={...o?{text:o}:{},...i?{kinds:i}:{},...s?{tags:s}:{},...a?{categories:a}:{},...l?{capabilities:l}:{},...c?{maturities:c}:{},...typeof u==="number"?{limit:u}:{}};return S({data:{matches:await r.search(y)}})}if(e==="get"){j(t,["id"]);let o=le(t,"id");if(!o)throw new w("id must be a non-empty string");return S({data:{resource:await r.get(o)}})}if(e==="docs"||e==="examples"||e==="install-plan"){j(t,e==="docs"?["id","locale","page"]:e==="examples"?["id","page"]:["id"]);let o=le(t,"id");if(!o)throw new w("id must be a non-empty string");let i=le(t,"locale");if(i&&i!=="zh"&&i!=="en")throw new w("locale must be zh or en");if(!(e==="docs"?r.docs:e==="examples"?r.examples:r.installPlan))return k(G(e,e));let a=t.page;if(a!==void 0&&(typeof a!=="number"||!Number.isSafeInteger(a)||a<1))throw new w("page must be a positive integer");let l=e==="docs"?await r.docs?.(o,i,a):e==="examples"?await r.examples?.(o,a):await r.installPlan?.(o);return S({data:l})}j(t,["roots"]);let n=B(t,"roots");if(!n)throw new w("roots must be a non-empty string array");return S({data:{plan:await r.build(n)}})}catch(n){return ps(n)}}function Rc(e){let t=[{name:"uibot_request_component",description:"Request a missing component from the UIBot Hub runtime.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Component name"},context:{type:"string",description:"Optional usage context"},requestedBy:{type:"string",description:"Requester identifier"},priority:{type:"string",enum:["low","normal","high"]}},required:["name"]}},{name:"uibot_get_task_status",description:"Read the status of a Hub task.",inputSchema:{type:"object",properties:{taskId:{type:"string",description:"Hub task identifier"}},required:["taskId"]}},{name:"uibot_list_catalog",description:"List catalog components available to agents (read-only discovery). Returns name/description/category entries.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Optional substring filter on name/description"}}}},{name:"uibot_get_design_md",description:"Get design-md entries (read-only). Omit id to list summaries; provide id for one full entry.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Optional design-md id"}}}},{name:"uibot_list_templates",description:"List installable UIBot templates (read-only discovery).",inputSchema:{type:"object",properties:{query:{type:"string",description:"Optional substring filter"}}}},{name:"uibot_validate",description:"Validate a generated artifact. Pass `spec` (UIBot Spec object, or JSON/YAML text) to compile it against the catalog and get missing-component gaps and warnings; pass `html` to run the design-quality rules. Fix every gap before handing the result on.",inputSchema:{type:"object",properties:{spec:{description:"UIBot Spec object, or its JSON/YAML text"},html:{type:"string",description:"Generated HTML document"}}}},...ds()];return{listTools(){return t.filter((r)=>{if(r.name==="uibot_request_component")return e.serviceAvailable!==!1;if(r.name==="uibot_get_task_status")return e.serviceAvailable!==!1;if(r.name==="uibot_list_catalog")return e.discovery?.listCatalog!=null;if(r.name==="uibot_get_design_md")return e.discovery?.getDesignMd!=null;if(r.name==="uibot_list_templates")return e.discovery?.listTemplates!=null;if(r.name==="uibot_validate")return e.validate!=null;if(r.name.startsWith(W)){let n=r.name.slice(W.length),o=n==="install-plan"?"installPlan":n;return e.resourceQuery!=null&&typeof e.resourceQuery[o]==="function"}return!0})},async callTool(r,n){if(r.startsWith(W)){let o=r.slice(W.length);if(!Te.some((s)=>s.name===o))return k(`Unknown tool: ${r}`);if(!e.resourceQuery)return k(G(r,"resourceQuery"));return gs(o,n,e.resourceQuery)}if(r==="uibot_request_component"){if(e.serviceAvailable===!1)return k(Tr(r));let o=typeof n.name==="string"?n.name:"";if(!o)return k("Field 'name' is required");let i=await e.service.requestComponent({name:o,...typeof n.context==="string"?{context:n.context}:{},...typeof n.requestedBy==="string"?{requestedBy:n.requestedBy}:{},...n.priority==="low"||n.priority==="normal"||n.priority==="high"?{priority:n.priority}:{}});return S(ls(i))}if(r==="uibot_get_task_status"){if(e.serviceAvailable===!1)return k(Tr(r));let o=typeof n.taskId==="string"?n.taskId:"";if(!o)return k("Field 'taskId' is required");let i=e.service.getTaskStatus(o);return i?S(cs(i)):k("Task not found")}if(r==="uibot_list_catalog"){let o=e.discovery?.listCatalog;if(!o)return k(G(r,"listCatalog"));let i=await o(),s=Array.isArray(i)?i:[],a=typeof n.query==="string"?n.query.toLowerCase():"",l=a?s.filter((c)=>JSON.stringify(c).toLowerCase().includes(a)):s;return S({items:l,count:l.length})}if(r==="uibot_get_design_md"){let o=e.discovery?.getDesignMd;if(!o)return k(G(r,"getDesignMd"));let i=typeof n.id==="string"?n.id:void 0,s=await o(i)??(i?null:[]);return S({id:i??null,data:s})}if(r==="uibot_list_templates"){let o=e.discovery?.listTemplates;if(!o)return k(G(r,"listTemplates"));let i=await o(),s=Array.isArray(i)?i:[],a=typeof n.query==="string"?n.query.toLowerCase():"",l=a?s.filter((c)=>JSON.stringify(c).toLowerCase().includes(a)):s;return S({items:l,count:l.length})}if(r==="uibot_validate"){if(!e.validate)return k(`Tool '${r}' is not wired in this build: no 'validate' provider was supplied.`);let o=typeof n.html==="string"?n.html:void 0;if(n.spec===void 0&&o===void 0)return k("Provide 'spec' or 'html'");try{return S(await e.validate({...n.spec===void 0?{}:{spec:n.spec},...o===void 0?{}:{html:o}}))}catch(i){return k(i instanceof Error?i.message:String(i))}}return k(`Unknown tool: ${r}`)}}}export{Or as RESOURCE_MCP_ERROR_CODES,ns as createDefaultUIBotHubA2AAgentCard,Yi as createDefaultUIBotHubBlueprint,Sr as createInMemoryUIBotHubTaskStore,ha as createUIBotHubA2AHandler,fa as createUIBotHubHttpHandler,Rc as createUIBotHubMcpAdapter,la as createUIBotHubPlugin,pa as createUIBotHubService,Ca as createUIBotHubWorkflowRequestRunner,Ae as normalizeHubBasePath};
|
|
2
|
+
var Br=Object.create;var{getPrototypeOf:Ur,defineProperty:Be,getOwnPropertyNames:_r}=Object;var Ue=Object.prototype.hasOwnProperty;function Fr(e){return this[e]}var qr,Hr,Mr=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var o=t?qr??=new WeakMap:Hr??=new WeakMap,i=o.get(e);if(i)return i}r=e!=null?Br(Ur(e)):{};let s=t||!e||!e.__esModule||!Ue.call(e,"default")?Be(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of _r(e))if(!Ue.call(s,a))Be(s,a,{get:Fr.bind(e,a),enumerable:!0})}if(n)o.set(e,s);return s};var m=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var O=m(function(ys,_e){var $r=Number.MAX_SAFE_INTEGER||9007199254740991,jr=["major","premajor","minor","preminor","patch","prepatch","prerelease"];_e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:$r,RELEASE_TYPES:jr,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var U=m(function(hs,Fe){var Vr=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Fe.exports=Vr});var N=m(function(v,qe){var{MAX_SAFE_COMPONENT_LENGTH:me,MAX_SAFE_BUILD_LENGTH:zr,MAX_LENGTH:Gr}=O(),Wr=U();v=qe.exports={};var Kr=v.re=[],Yr=v.safeRe=[],u=v.src=[],Jr=v.safeSrc=[],d=v.t={},Xr=0,fe="[a-zA-Z0-9-]",Qr=[["\\s",1],["\\d",Gr],[fe,zr]],Zr=(e)=>{for(let[t,r]of Qr)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},f=(e,t,r)=>{let n=Zr(t),o=Xr++;Wr(e,o,t),d[e]=o,u[o]=t,Jr[o]=n,Kr[o]=new RegExp(t,r?"g":void 0),Yr[o]=new RegExp(n,r?"g":void 0)};f("NUMERICIDENTIFIER","0|[1-9]\\d*");f("NUMERICIDENTIFIERLOOSE","\\d+");f("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${fe}*`);f("MAINVERSION",`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`);f("MAINVERSIONLOOSE",`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`);f("PRERELEASEIDENTIFIER",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIER]})`);f("PRERELEASEIDENTIFIERLOOSE",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIERLOOSE]})`);f("PRERELEASE",`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`);f("PRERELEASELOOSE",`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`);f("BUILDIDENTIFIER",`${fe}+`);f("BUILD",`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`);f("FULLPLAIN",`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`);f("FULL",`^${u[d.FULLPLAIN]}$`);f("LOOSEPLAIN",`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`);f("LOOSE",`^${u[d.LOOSEPLAIN]}$`);f("GTLT","((?:<|>)?=?)");f("XRANGEIDENTIFIERLOOSE",`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);f("XRANGEIDENTIFIER",`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`);f("XRANGEPLAIN",`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`);f("XRANGEPLAINLOOSE",`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`);f("XRANGE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`);f("XRANGELOOSE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`);f("COERCEPLAIN",`(^|[^\\d])(\\d{1,${me}})(?:\\.(\\d{1,${me}}))?(?:\\.(\\d{1,${me}}))?`);f("COERCE",`${u[d.COERCEPLAIN]}(?:$|[^\\d])`);f("COERCEFULL",u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?(?:${u[d.BUILD]})?(?:$|[^\\d])`);f("COERCERTL",u[d.COERCE],!0);f("COERCERTLFULL",u[d.COERCEFULL],!0);f("LONETILDE","(?:~>?)");f("TILDETRIM",`(\\s*)${u[d.LONETILDE]}\\s+`,!0);v.tildeTrimReplace="$1~";f("TILDE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`);f("TILDELOOSE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`);f("LONECARET","(?:\\^)");f("CARETTRIM",`(\\s*)${u[d.LONECARET]}\\s+`,!0);v.caretTrimReplace="$1^";f("CARET",`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`);f("CARETLOOSE",`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`);f("COMPARATORLOOSE",`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`);f("COMPARATOR",`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`);f("COMPARATORTRIM",`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0);v.comparatorTrimReplace="$1$2$3";f("HYPHENRANGE",`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`);f("HYPHENRANGELOOSE",`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`);f("STAR","(<|>)?=?\\s*\\*");f("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");f("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Y=m(function(bs,He){var en=Object.freeze({loose:!0}),tn=Object.freeze({}),rn=(e)=>{if(!e)return tn;if(typeof e!=="object")return en;return e};He.exports=rn});var ye=m(function(Cs,je){var Me=/^[0-9]+$/,$e=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=Me.test(e),n=Me.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},nn=(e,t)=>$e(t,e);je.exports={compareIdentifiers:$e,rcompareIdentifiers:nn}});var I=m(function(Is,ze){var J=U(),{MAX_LENGTH:Ve,MAX_SAFE_INTEGER:X}=O(),{safeRe:Q,t:Z}=N(),on=Y(),{compareIdentifiers:he}=ye(),sn=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(he(e[n],r[n])!==0)return!1;return!0};class A{constructor(e,t){if(t=on(t),e instanceof A)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else e=e.version;else if(typeof e!=="string")throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Ve)throw TypeError(`version is longer than ${Ve} characters`);J("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Q[Z.LOOSE]:Q[Z.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>X||this.major<0)throw TypeError("Invalid major version");if(this.minor>X||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>X||this.patch<0)throw TypeError("Invalid patch version");if(!r[4])this.prerelease=[];else this.prerelease=r[4].split(".").map((n)=>{if(/^[0-9]+$/.test(n)){let o=+n;if(o>=0&&o<X)return o}return n});this.build=r[5]?r[5].split("."):[],this.format()}format(){if(this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length)this.version+=`-${this.prerelease.join(".")}`;return this.version}toString(){return this.version}compare(e){if(J("SemVer.compare",this.version,this.options,e),!(e instanceof A)){if(typeof e==="string"&&e===this.version)return 0;e=new A(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof A))e=new A(e,this.options);if(this.major<e.major)return-1;if(this.major>e.major)return 1;if(this.minor<e.minor)return-1;if(this.minor>e.minor)return 1;if(this.patch<e.patch)return-1;if(this.patch>e.patch)return 1;return 0}comparePre(e){if(!(e instanceof A))e=new A(e,this.options);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],n=e.prerelease[t];if(J("prerelease compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return he(r,n)}while(++t)}compareBuild(e){if(!(e instanceof A))e=new A(e,this.options);let t=0;do{let r=this.build[t],n=e.build[t];if(J("build compare",t,r,n),r===void 0&&n===void 0)return 0;else if(n===void 0)return 1;else if(r===void 0)return-1;else if(r===n)continue;else return he(r,n)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&r===!1)throw Error("invalid increment argument: identifier is empty");if(t){let n=`-${t}`.match(this.options.loose?Q[Z.PRERELEASELOOSE]:Q[Z.PRERELEASE]);if(!n||n[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",t,r);this.inc("pre",t,r);break;case"release":if(this.prerelease.length===0)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0,this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":{let n=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[n];else{let o=this.prerelease.length;while(--o>=0)if(typeof this.prerelease[o]==="number")this.prerelease[o]++,o=-2;if(o===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let o=[t,n];if(r===!1)o=[t];if(sn(this.prerelease,t)){let i=this.prerelease[t.split(".").length];if(isNaN(i))this.prerelease=o}else this.prerelease=o}break}default:throw Error(`invalid increment argument: ${e}`)}if(this.raw=this.format(),this.build.length)this.raw+=`+${this.build.join(".")}`;return this}}ze.exports=A});var T=m(function(Rs,We){var Ge=I(),an=(e,t,r=!1)=>{if(e instanceof Ge)return e;try{return new Ge(e,t)}catch(n){if(!r)return null;throw n}};We.exports=an});var Ye=m(function(xs,Ke){var cn=T(),ln=(e,t)=>{let r=cn(e,t);return r?r.version:null};Ke.exports=ln});var Xe=m(function(ks,Je){var un=T(),dn=(e,t)=>{let r=un(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Je.exports=dn});var et=m(function(Ps,Ze){var Qe=I(),pn=(e,t,r,n,o)=>{if(typeof r==="string")o=n,n=r,r=void 0;try{return new Qe(e instanceof Qe?e.version:e,r).inc(t,n,o).version}catch(i){return null}};Ze.exports=pn});var nt=m(function(ws,rt){var tt=T(),gn=(e,t)=>{let r=tt(e,null,!0),n=tt(t,null,!0),o=r.compare(n);if(o===0)return null;let i=o>0,s=i?r:n,a=i?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0){if(a.minor&&!a.patch)return"minor";return"patch"}}let p=c?"pre":"";if(r.major!==n.major)return p+"major";if(r.minor!==n.minor)return p+"minor";if(r.patch!==n.patch)return p+"patch";return"prerelease"};rt.exports=gn});var it=m(function(Ss,ot){var mn=I(),fn=(e,t)=>new mn(e,t).major;ot.exports=fn});var at=m(function(As,st){var yn=I(),hn=(e,t)=>new yn(e,t).minor;st.exports=hn});var lt=m(function(Es,ct){var bn=I(),Cn=(e,t)=>new bn(e,t).patch;ct.exports=Cn});var dt=m(function(vs,ut){var In=T(),Rn=(e,t)=>{let r=In(e,t);return r&&r.prerelease.length?r.prerelease:null};ut.exports=Rn});var P=m(function(Ts,gt){var pt=I(),xn=(e,t,r)=>new pt(e,r).compare(new pt(t,r));gt.exports=xn});var ft=m(function(Ds,mt){var kn=P(),Pn=(e,t,r)=>kn(t,e,r);mt.exports=Pn});var ht=m(function(Os,yt){var wn=P(),Sn=(e,t)=>wn(e,t,!0);yt.exports=Sn});var ee=m(function(Ns,Ct){var bt=I(),An=(e,t,r)=>{let n=new bt(e,r),o=new bt(t,r);return n.compare(o)||n.compareBuild(o)};Ct.exports=An});var Rt=m(function(Ls,It){var En=ee(),vn=(e,t)=>e.sort((r,n)=>En(r,n,t));It.exports=vn});var kt=m(function(Bs,xt){var Tn=ee(),Dn=(e,t)=>e.sort((r,n)=>Tn(n,r,t));xt.exports=Dn});var _=m(function(Us,Pt){var On=P(),Nn=(e,t,r)=>On(e,t,r)>0;Pt.exports=Nn});var te=m(function(_s,wt){var Ln=P(),Bn=(e,t,r)=>Ln(e,t,r)<0;wt.exports=Bn});var be=m(function(Fs,St){var Un=P(),_n=(e,t,r)=>Un(e,t,r)===0;St.exports=_n});var Ce=m(function(qs,At){var Fn=P(),qn=(e,t,r)=>Fn(e,t,r)!==0;At.exports=qn});var re=m(function(Hs,Et){var Hn=P(),Mn=(e,t,r)=>Hn(e,t,r)>=0;Et.exports=Mn});var ne=m(function(Ms,vt){var $n=P(),jn=(e,t,r)=>$n(e,t,r)<=0;vt.exports=jn});var Ie=m(function($s,Tt){var Vn=be(),zn=Ce(),Gn=_(),Wn=re(),Kn=te(),Yn=ne(),Jn=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e===r;case"!==":if(typeof e==="object")e=e.version;if(typeof r==="object")r=r.version;return e!==r;case"":case"=":case"==":return Vn(e,r,n);case"!=":return zn(e,r,n);case">":return Gn(e,r,n);case">=":return Wn(e,r,n);case"<":return Kn(e,r,n);case"<=":return Yn(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};Tt.exports=Jn});var Ot=m(function(js,Dt){var Xn=I(),Qn=T(),{safeRe:oe,t:ie}=N(),Zn=(e,t)=>{if(e instanceof Xn)return e;if(typeof e==="number")e=String(e);if(typeof e!=="string")return null;t=t||{};let r=null;if(!t.rtl)r=e.match(t.includePrerelease?oe[ie.COERCEFULL]:oe[ie.COERCE]);else{let c=t.includePrerelease?oe[ie.COERCERTLFULL]:oe[ie.COERCERTL],l;while((l=c.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||l.index+l[0].length!==r.index+r[0].length)r=l;c.lastIndex=l.index+l[1].length+l[2].length}c.lastIndex=-1}if(r===null)return null;let n=r[2],o=r[3]||"0",i=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Qn(`${n}.${o}.${i}${s}${a}`,t)};Dt.exports=Zn});var Bt=m(function(Vs,Lt){var eo=T(),Nt=O(),to=I(),ro=(e,t,r)=>{if(!Nt.RELEASE_TYPES.includes(t))return null;let n=no(e,r);return n&&oo(n,t)},no=(e,t)=>{let r=e instanceof to?e.version:e;return eo(r,t)},oo=(e,t)=>{if(io(t))return e.version;switch(e.prerelease=[],t){case"major":e.minor=0,e.patch=0;break;case"minor":e.patch=0;break}return e.format()},io=(e)=>e.startsWith("pre");Lt.exports=ro});var Ft=m(function(zs,_t){class Ut{constructor(){this.max=1000,this.map=new Map}get(e){let t=this.map.get(e);if(t===void 0)return;else return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&t!==void 0){if(this.map.size>=this.max){let n=this.map.keys().next().value;this.delete(n)}this.map.set(e,t)}return this}}_t.exports=Ut});var w=m(function(Gs,$t){var so=/\s+/g;class F{constructor(e,t){if(t=co(t),e instanceof F)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new F(e.raw,t);if(e instanceof se)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(so," "),this.set=this.raw.split("||").map((r)=>this.parseRange(r.trim())).filter((r)=>r.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter((n)=>!Ht(n[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let n of this.set)if(n.length===1&&bo(n[0])){this.set=[n];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){if(e>0)this.formatted+="||";let t=this.set[e];for(let r=0;r<t.length;r++){if(r>0)this.formatted+=" ";this.formatted+=t[r].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){e=e.replace(ho,"");let r=((this.options.includePrerelease&&fo)|(this.options.loose&&yo))+":"+e,n=qt.get(r);if(n)return n;let o=this.options.loose,i=o?x[R.HYPHENRANGELOOSE]:x[R.HYPHENRANGE];e=e.replace(i,vo(this.options.includePrerelease)),b("hyphen replace",e),e=e.replace(x[R.COMPARATORTRIM],po),b("comparator trim",e),e=e.replace(x[R.TILDETRIM],go),b("tilde trim",e),e=e.replace(x[R.CARETTRIM],mo),b("caret trim",e);let s=e.split(" ").map((p)=>Co(p,this.options)).join(" ").split(/\s+/).map((p)=>Eo(p,this.options));if(o)s=s.filter((p)=>(b("loose invalid filter",p,this.options),!!p.match(x[R.COMPARATORLOOSE])));b("range list",s);let a=new Map,c=s.map((p)=>new se(p,this.options));for(let p of c){if(Ht(p))return[p];a.set(p.value,p)}if(a.size>1&&a.has(""))a.delete("");let l=[...a.values()];return qt.set(r,l),l}intersects(e,t){if(!(e instanceof F))throw TypeError("a Range is required");return this.set.some((r)=>Mt(r,t)&&e.set.some((n)=>Mt(n,t)&&r.every((o)=>n.every((i)=>o.intersects(i,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new lo(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(To(this.set[t],e,this.options))return!0;return!1}}$t.exports=F;var ao=Ft(),qt=new ao,co=Y(),se=q(),b=U(),lo=I(),{safeRe:x,src:uo,t:R,comparatorTrimReplace:po,tildeTrimReplace:go,caretTrimReplace:mo}=N(),{FLAG_INCLUDE_PRERELEASE:fo,FLAG_LOOSE:yo}=O(),ho=new RegExp(uo[R.BUILD],"g"),Ht=(e)=>e.value==="<0.0.0-0",bo=(e)=>e.value==="",Mt=(e,t)=>{let r=!0,n=e.slice(),o=n.pop();while(r&&n.length)r=n.every((i)=>o.intersects(i,t)),o=n.pop();return r},Co=(e,t)=>(e=e.replace(x[R.BUILD],""),b("comp",e,t),e=ko(e,t),b("caret",e),e=Ro(e,t),b("tildes",e),e=wo(e,t),b("xrange",e),e=Ao(e,t),b("stars",e),e),C=(e)=>!e||e.toLowerCase()==="x"||e==="*",Io=(e,t,r)=>C(e)&&!C(t)||C(t)&&r&&!C(r),Ro=(e,t)=>e.trim().split(/\s+/).map((r)=>xo(r,t)).join(" "),xo=(e,t)=>{let r=t.loose?x[R.TILDELOOSE]:x[R.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(o,i,s,a,c)=>{b("tilde",e,o,i,s,a,c);let l;if(C(i))l="";else if(C(s))l=`>=${i}.0.0${n} <${+i+1}.0.0-0`;else if(C(a))l=`>=${i}.${s}.0${n} <${i}.${+s+1}.0-0`;else if(c)b("replaceTilde pr",c),l=`>=${i}.${s}.${a}-${c} <${i}.${+s+1}.0-0`;else l=`>=${i}.${s}.${a} <${i}.${+s+1}.0-0`;return b("tilde return",l),l})},ko=(e,t)=>e.trim().split(/\s+/).map((r)=>Po(r,t)).join(" "),Po=(e,t)=>{b("caret",e,t);let r=t.loose?x[R.CARETLOOSE]:x[R.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(o,i,s,a,c)=>{b("caret",e,o,i,s,a,c);let l;if(C(i))l="";else if(C(s))l=`>=${i}.0.0${n} <${+i+1}.0.0-0`;else if(C(a))if(i==="0")l=`>=${i}.${s}.0${n} <${i}.${+s+1}.0-0`;else l=`>=${i}.${s}.0${n} <${+i+1}.0.0-0`;else if(c)if(b("replaceCaret pr",c),i==="0")if(s==="0")l=`>=${i}.${s}.${a}-${c} <${i}.${s}.${+a+1}-0`;else l=`>=${i}.${s}.${a}-${c} <${i}.${+s+1}.0-0`;else l=`>=${i}.${s}.${a}-${c} <${+i+1}.0.0-0`;else if(b("no pr"),i==="0")if(s==="0")l=`>=${i}.${s}.${a} <${i}.${s}.${+a+1}-0`;else l=`>=${i}.${s}.${a} <${i}.${+s+1}.0-0`;else l=`>=${i}.${s}.${a} <${+i+1}.0.0-0`;return b("caret return",l),l})},wo=(e,t)=>(b("replaceXRanges",e,t),e.split(/\s+/).map((r)=>So(r,t)).join(" ")),So=(e,t)=>{e=e.trim();let r=t.loose?x[R.XRANGELOOSE]:x[R.XRANGE];return e.replace(r,(n,o,i,s,a,c)=>{if(b("xRange",e,n,o,i,s,a,c),Io(i,s,a))return e;let l=C(i),p=l||C(s),y=p||C(a),h=y;if(o==="="&&h)o="";if(c=t.includePrerelease?"-0":"",l)if(o===">"||o==="<")n="<0.0.0-0";else n="*";else if(o&&h){if(p)s=0;if(a=0,o===">")if(o=">=",p)i=+i+1,s=0,a=0;else s=+s+1,a=0;else if(o==="<=")if(o="<",p)i=+i+1;else s=+s+1;if(o==="<")c="-0";n=`${o+i}.${s}.${a}${c}`}else if(p)n=`>=${i}.0.0${c} <${+i+1}.0.0-0`;else if(y)n=`>=${i}.${s}.0${c} <${i}.${+s+1}.0-0`;return b("xRange return",n),n})},Ao=(e,t)=>(b("replaceStars",e,t),e.trim().replace(x[R.STAR],"")),Eo=(e,t)=>(b("replaceGTE0",e,t),e.trim().replace(x[t.includePrerelease?R.GTE0PRE:R.GTE0],"")),vo=(e)=>(t,r,n,o,i,s,a,c,l,p,y,h)=>{if(C(n))r="";else if(C(o))r=`>=${n}.0.0${e?"-0":""}`;else if(C(i))r=`>=${n}.${o}.0${e?"-0":""}`;else if(s)r=`>=${r}`;else r=`>=${r}${e?"-0":""}`;if(C(l))c="";else if(C(p))c=`<${+l+1}.0.0-0`;else if(C(y))c=`<${l}.${+p+1}.0-0`;else if(h)c=`<=${l}.${p}.${y}-${h}`;else if(e)c=`<${l}.${p}.${+y+1}-0`;else c=`<=${c}`;return`${r} ${c}`.trim()},To=(e,t,r)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let n=0;n<e.length;n++){if(b(e[n].semver),e[n].semver===se.ANY)continue;if(e[n].semver.prerelease.length>0){let o=e[n].semver;if(o.major===t.major&&o.minor===t.minor&&o.patch===t.patch)return!0}}return!1}return!0}});var q=m(function(Ws,Kt){var H=Symbol("SemVer ANY");class ae{static get ANY(){return H}constructor(e,t){if(t=jt(t),e instanceof ae)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),xe("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===H)this.value="";else this.value=this.operator+this.semver.version;xe("comp",this)}parse(e){let t=this.options.loose?Vt[zt.COMPARATORLOOSE]:Vt[zt.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);if(this.operator=r[1]!==void 0?r[1]:"",this.operator==="=")this.operator="";if(!r[2])this.semver=H;else this.semver=new Gt(r[2],this.options.loose)}toString(){return this.value}test(e){if(xe("Comparator.test",e,this.options.loose),this.semver===H||e===H)return!0;if(typeof e==="string")try{e=new Gt(e,this.options)}catch(t){return!1}return Re(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof ae))throw TypeError("a Comparator is required");if(this.operator===""){if(this.value==="")return!0;return new Wt(e.value,t).test(this.value)}else if(e.operator===""){if(e.value==="")return!0;return new Wt(this.value,t).test(e.semver)}if(t=jt(t),t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0"))return!1;if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))return!1;if(this.operator.startsWith(">")&&e.operator.startsWith(">"))return!0;if(this.operator.startsWith("<")&&e.operator.startsWith("<"))return!0;if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("="))return!0;if(Re(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(Re(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Kt.exports=ae;var jt=Y(),{safeRe:Vt,t:zt}=N(),Re=Ie(),xe=U(),Gt=I(),Wt=w()});var M=m(function(Ks,Yt){var Do=w(),Oo=(e,t,r)=>{try{t=new Do(t,r)}catch(n){return!1}return t.test(e)};Yt.exports=Oo});var Xt=m(function(Ys,Jt){var No=w(),Lo=(e,t)=>new No(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));Jt.exports=Lo});var Zt=m(function(Js,Qt){var Bo=I(),Uo=w(),_o=(e,t,r)=>{let n=null,o=null,i=null;try{i=new Uo(t,r)}catch(s){return null}return e.forEach((s)=>{if(i.test(s)){if(!n||o.compare(s)===-1)n=s,o=new Bo(n,r)}}),n};Qt.exports=_o});var tr=m(function(Xs,er){var Fo=I(),qo=w(),Ho=(e,t,r)=>{let n=null,o=null,i=null;try{i=new qo(t,r)}catch(s){return null}return e.forEach((s)=>{if(i.test(s)){if(!n||o.compare(s)===1)n=s,o=new Fo(n,r)}}),n};er.exports=Ho});var or=m(function(Qs,nr){var ke=I(),Mo=w(),rr=_(),$o=(e,t)=>{e=new Mo(e,t);let r=new ke("0.0.0");if(e.test(r))return r;if(r=new ke("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let o=e.set[n],i=null;if(o.forEach((s)=>{let a=new ke(s.semver.version);switch(s.operator){case">":if(a.prerelease.length===0)a.patch++;else a.prerelease.push(0);a.raw=a.format();case"":case">=":if(!i||rr(a,i))i=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${s.operator}`)}}),i&&(!r||rr(r,i)))r=i}if(r&&e.test(r))return r;return null};nr.exports=$o});var sr=m(function(Zs,ir){var jo=w(),Vo=(e,t)=>{try{return new jo(e,t).range||"*"}catch(r){return null}};ir.exports=Vo});var ce=m(function(ea,ur){var zo=I(),lr=q(),{ANY:Go}=lr,Wo=w(),Ko=M(),ar=_(),cr=te(),Yo=ne(),Jo=re(),Xo=(e,t,r,n)=>{e=new zo(e,n),t=new Wo(t,n);let o,i,s,a,c;switch(r){case">":o=ar,i=Yo,s=cr,a=">",c=">=";break;case"<":o=cr,i=Jo,s=ar,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(Ko(e,t,n))return!1;for(let l=0;l<t.set.length;++l){let p=t.set[l],y=null,h=null;if(p.forEach((g)=>{if(g.semver===Go)g=new lr(">=0.0.0");if(y=y||g,h=h||g,o(g.semver,y.semver,n))y=g;else if(s(g.semver,h.semver,n))h=g}),y.operator===a||y.operator===c)return!1;if((!h.operator||h.operator===a)&&i(e,h.semver))return!1;else if(h.operator===c&&s(e,h.semver))return!1}return!0};ur.exports=Xo});var pr=m(function(ta,dr){var Qo=ce(),Zo=(e,t,r)=>Qo(e,t,">",r);dr.exports=Zo});var mr=m(function(ra,gr){var ei=ce(),ti=(e,t,r)=>ei(e,t,"<",r);gr.exports=ti});var hr=m(function(na,yr){var fr=w(),ri=(e,t,r)=>(e=new fr(e,r),t=new fr(t,r),e.intersects(t,r));yr.exports=ri});var Cr=m(function(oa,br){var ni=M(),oi=P();br.exports=(e,t,r)=>{let n=[],o=null,i=null,s=e.sort((p,y)=>oi(p,y,r));for(let p of s)if(ni(p,t,r)){if(i=p,!o)o=p}else{if(i)n.push([o,i]);i=null,o=null}if(o)n.push([o,null]);let a=[];for(let[p,y]of n)if(p===y)a.push(p);else if(!y&&p===s[0])a.push("*");else if(!y)a.push(`>=${p}`);else if(p===s[0])a.push(`<=${y}`);else a.push(`${p} - ${y}`);let c=a.join(" || "),l=typeof t.raw==="string"?t.raw:String(t);return c.length<l.length?c:t}});var wr=m(function(ia,Pr){var Ir=w(),Se=q(),{ANY:Pe}=Se,we=M(),Ae=P(),ii=(e,t,r={})=>{if(e===t)return!0;e=new Ir(e,r),t=new Ir(t,r);let n=!1;e:for(let o of e.set){for(let i of t.set){let s=ai(o,i,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},si=[new Se(">=0.0.0-0")],Rr=[new Se(">=0.0.0")],ai=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Pe)if(t.length===1&&t[0].semver===Pe)return!0;else if(r.includePrerelease)e=si;else e=Rr;if(t.length===1&&t[0].semver===Pe)if(r.includePrerelease)return!0;else t=Rr;let n=new Set,o,i;for(let g of e)if(g.operator===">"||g.operator===">=")o=xr(o,g,r);else if(g.operator==="<"||g.operator==="<=")i=kr(i,g,r);else n.add(g.semver);if(n.size>1)return null;let s;if(o&&i){if(s=Ae(o.semver,i.semver,r),s>0)return null;else if(s===0&&(o.operator!==">="||i.operator!=="<="))return null}for(let g of n){if(o&&!we(g,String(o),r))return null;if(i&&!we(g,String(i),r))return null;for(let K of t)if(!we(g,String(K),r))return!1;return!0}let a,c,l,p,y=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,h=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;if(y&&y.prerelease.length===1&&i.operator==="<"&&y.prerelease[0]===0)y=!1;for(let g of t){if(p=p||g.operator===">"||g.operator===">=",l=l||g.operator==="<"||g.operator==="<=",o){if(h){if(g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===h.major&&g.semver.minor===h.minor&&g.semver.patch===h.patch)h=!1}if(g.operator===">"||g.operator===">="){if(a=xr(o,g,r),a===g&&a!==o)return!1}else if(o.operator===">="&&!g.test(o.semver))return!1}if(i){if(y){if(g.semver.prerelease&&g.semver.prerelease.length&&g.semver.major===y.major&&g.semver.minor===y.minor&&g.semver.patch===y.patch)y=!1}if(g.operator==="<"||g.operator==="<="){if(c=kr(i,g,r),c===g&&c!==i)return!1}else if(i.operator==="<="&&!g.test(i.semver))return!1}if(!g.operator&&(i||o)&&s!==0)return!1}if(o&&l&&!i&&s!==0)return!1;if(i&&p&&!o&&s!==0)return!1;if(h||y)return!1;return!0},xr=(e,t,r)=>{if(!e)return t;let n=Ae(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},kr=(e,t,r)=>{if(!e)return t;let n=Ae(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};Pr.exports=ii});var Ar=m(function(sa,Sr){var L=N(),le=O(),ci=I(),ue=ye(),li=T(),ui=Ye(),di=Xe(),pi=et(),gi=nt(),mi=it(),fi=at(),yi=lt(),hi=dt(),bi=P(),Ci=ft(),Ii=ht(),Ri=ee(),xi=Rt(),ki=kt(),Pi=_(),wi=te(),Si=be(),Ai=Ce(),Ei=re(),vi=ne(),Ti=Ie(),Di=Ot(),Oi=Bt(),Ni=q(),Li=w(),Bi=M(),Ui=Xt(),_i=Zt(),Fi=tr(),qi=or(),Hi=sr(),Mi=ce(),$i=pr(),ji=mr(),Vi=hr(),zi=Cr(),Gi=wr();Sr.exports={parse:li,valid:ui,clean:di,inc:pi,diff:gi,major:mi,minor:fi,patch:yi,prerelease:hi,compare:bi,rcompare:Ci,compareLoose:Ii,compareBuild:Ri,sort:xi,rsort:ki,gt:Pi,lt:wi,eq:Si,neq:Ai,gte:Ei,lte:vi,cmp:Ti,coerce:Di,truncate:Oi,Comparator:Ni,Range:Li,satisfies:Bi,toComparators:Ui,maxSatisfying:_i,minSatisfying:Fi,minVersion:qi,validRange:Hi,outside:Mi,gtr:$i,ltr:ji,intersects:Vi,simplifyRange:zi,subset:Gi,SemVer:ci,re:L.re,src:L.src,tokens:L.t,SEMVER_SPEC_VERSION:le.SEMVER_SPEC_VERSION,RELEASE_TYPES:le.RELEASE_TYPES,compareIdentifiers:ue.compareIdentifiers,rcompareIdentifiers:ue.rcompareIdentifiers}});var Wi=Mr(Ar(),1);function Er(e){return e}function vr(e){return e}function j(e){return e}function Ki(){return{name:"UIBot Hub Runtime",workflows:[{id:"component-request",description:"Request, generate, evaluate, and publish missing components",triggers:["api:component-request","compiler:gap-detected","renderer:unknown-component"]},{id:"component-review",description:"Review generated artifacts and feed the evaluator pipeline",triggers:["workflow:component-request:generated"]},{id:"component-evolve",description:"Run scheduled reevaluations and trigger upgrade tasks",triggers:["cron:daily-02:00"]}],protocols:{rest:!0,a2a:!0,mcp:!0},observability:"builtin"}}function la(){let e=Er({pluginId:"uibot.hub-runtime",version:"0.1.0",displayName:"UIBot Hub Runtime",description:"Official UIBot Hub runtime for orchestration, protocol surfaces, and evaluations.",sdkRange:"^0.1.0",engineRange:"^0.1.0",capabilities:[{id:"uibot.hub.runtime",type:"agent:runtime",description:"UIBot Hub workflow runtime for orchestration"},{id:"uibot.hub.a2a",type:"protocol:adapter",description:"A2A adapter provided by UIBot Hub runtime"},{id:"uibot.hub.mcp",type:"protocol:adapter",description:"MCP adapter provided by UIBot Hub runtime"},{id:"uibot.hub.evals",type:"evaluation:runner",description:"Evaluation bridge executed via UIBot Hub workflow surfaces"}],permissions:[{resource:"network:https",reason:"Connect to model providers and remote registries",required:!0},{resource:"remote:execute",reason:"Coordinate signed remote workers for long-running generation jobs",required:!1}]});return vr({manifest:e,register(t){let r=Ki(),n=[j({id:"uibot.hub.runtime",type:"agent:runtime",description:"UIBot Hub workflow runtime",contribution:r}),j({id:"uibot.hub.a2a",type:"protocol:adapter",description:"A2A support through UIBot Hub runtime",contribution:r.protocols}),j({id:"uibot.hub.mcp",type:"protocol:adapter",description:"MCP support through UIBot Hub runtime",contribution:r.protocols}),j({id:"uibot.hub.evals",type:"evaluation:runner",description:"Evaluation entrypoints managed by UIBot Hub workflows",contribution:r.workflows})];for(let o of n)t.addCapability(o)}})}function de(e){return{...e,request:{...e.request},...e.artifact?{artifact:{...e.artifact}}:{}}}function Yi(e,t){let r=t.status??e.status,n={...e,status:r,updatedAt:t.updatedAt??new Date().toISOString()};if(typeof t.progress==="number")n.progress=t.progress;else if(r==="ready")n.progress=100;else if(r==="failed")delete n.progress;if(t.artifact)n.artifact=t.artifact;else if(r!=="ready")delete n.artifact;if(typeof t.error==="string")n.error=t.error;else if(r!=="failed")delete n.error;if(r==="ready")delete n.error;return n}function Tr(){let e=new Map;return{createTask(t){let r=t.createdAt??new Date().toISOString(),n={taskId:t.taskId,request:{...t.request},status:"pending",createdAt:r,updatedAt:r};return e.set(n.taskId,n),de(n)},getTask(t){let r=e.get(t);return r?de(r):void 0},listTasks(){return[...e.values()].map((t)=>de(t))},updateTask(t,r){let n=e.get(t);if(!n)throw Error(`Hub task not found: ${t}`);let o=Yi(n,r);return e.set(t,o),de(o)}}}function Dr(e){if(e instanceof Error)return e.message;return typeof e==="string"?e:"Unknown Hub task error"}function Ee(e="/api/hub"){return(e.startsWith("/")?e:`/${e}`).replace(/\/+$/,"")||"/api/hub"}function Ji(e,t,r){function n(o,i){return t.updateTask(e,{status:o,...typeof i?.progress==="number"?{progress:i.progress}:{},updatedAt:r().toISOString()})}return{taskId:e,getSnapshot(){let o=t.getTask(e);if(!o)throw Error(`Hub task not found: ${e}`);return o},markPending(o){return n("pending",typeof o==="number"?{progress:o}:void 0)},markRunning(o){return n("running",typeof o==="number"?{progress:o}:void 0)},markReady(o){return t.updateTask(e,{status:"ready",artifact:o,updatedAt:r().toISOString()})},markFailed(o){return t.updateTask(e,{status:"failed",error:o,updatedAt:r().toISOString()})}}}function Xi(e){switch(e.status){case"ready":if(!e.artifact)throw Error(`Hub task ${e.taskId} is ready but artifact is missing`);return{taskId:e.taskId,status:"ready",artifact:e.artifact};case"failed":return{taskId:e.taskId,status:"failed",error:e.error??"Unknown Hub task error"};case"pending":case"running":return{taskId:e.taskId,status:e.status,...typeof e.progress==="number"?{progress:e.progress}:{}}}}function Qi(e,t){Promise.resolve().then(async()=>{let r=await e.run(t);if(r)t.markReady(r)}).catch((r)=>{t.markFailed(Dr(r))})}function ga(e){let t=Ee(e.basePath),r=e.taskStore??Tr(),n=e.clock??(()=>new Date),o=e.createTaskId??(()=>crypto.randomUUID());return{async requestComponent(i){let s=o(),a=r.createTask({taskId:s,request:i,createdAt:n().toISOString()}),c=Ji(s,r,n),l;try{l=await e.requestComponent({payload:i,task:a,controller:c})}catch(h){throw c.markFailed(Dr(h)),h}if(l.mode==="ready")return c.markReady(l.artifact),{status:"ready",artifact:l.artifact};if(l.initialStatus==="running")c.markRunning(l.progress);else if(typeof l.progress==="number")c.markPending(l.progress);Qi(l,c);let p=c.getSnapshot();if(p.status==="ready"&&p.artifact)return{status:"ready",artifact:p.artifact};if(p.status==="failed")throw Error(p.error??"Unknown Hub task error");return{status:p.status==="running"?"running":"pending",taskId:s,pollUrl:`${t}/tasks/${s}`}},getTask(i){return r.getTask(i)},listTasks(){return r.listTasks()},getTaskStatus(i){let s=r.getTask(i);return s?Xi(s):void 0}}}function ve(e,t=200){return Response.json(e,{status:t})}function B(e,t){return ve({error:t},e)}function ya(e){let t=Ee(e.basePath),r=`${t}/components/request`,n=`${t}/tasks/`;return async function(i){let s=new URL(i.url);if(i.method==="POST"&&s.pathname===r){let a;try{a=await i.json()}catch{return B(400,"Invalid JSON payload")}if(!a.name)return B(400,"Field 'name' is required");try{let c=await e.service.requestComponent(a),l=c.status==="ready"?200:202;return ve(c,l)}catch(c){return B(500,c instanceof Error?c.message:"Hub request failed")}}if(i.method==="GET"&&s.pathname.startsWith(n)){let a=decodeURIComponent(s.pathname.slice(n.length));if(!a||a.includes("/"))return B(404,"Task not found");let c=e.service.getTaskStatus(a);return c?ve(c):B(404,"Task not found")}return B(404,"Not found")}}function Zi(e){return{mode:"ready",artifact:e.artifact}}function es(e){return{mode:"async",...e.initialStatus?{initialStatus:e.initialStatus}:{},...typeof e.progress==="number"?{progress:e.progress}:{},async run(){return e.waitForResult?await e.waitForResult():void 0}}}function ba(e){let t=e.workflowId??"component-request";return async function(n){let o=await e.runtime.runWorkflow({workflowId:t,input:n.payload,taskId:n.task.taskId});return o.state==="ready"?Zi(o):es(o)}}function ts(e){if(e.status==="ready")return{status:"completed",state:"ready",artifact:e.artifact};return{id:e.taskId,status:"working",state:e.status}}function rs(e){switch(e.status){case"ready":return{id:e.taskId,status:"completed",state:"ready",artifact:e.artifact};case"failed":return{id:e.taskId,status:"failed",state:"failed",error:e.error};case"pending":case"running":return{id:e.taskId,status:"working",state:e.status,...typeof e.progress==="number"?{progress:e.progress}:{}}}}function Te(e,t){return{jsonrpc:"2.0",id:e,result:t}}function V(e,t,r){return{jsonrpc:"2.0",id:e,error:{code:t,message:r}}}function ns(e,t){return{name:"UIBot ComponentHub",description:"AI-driven component hub that generates, maintains, and evolves UI components on demand.",url:e.replace(/\/+$/,""),version:"1.0.0",protocolVersion:"1.0",provider:{organization:"UIBot",url:"https://github.com/Foundj/uibot"},capabilities:{streaming:!1,pushNotifications:!1,stateTransitionHistory:!1},authentication:{schemes:["none","bearer"]},skills:[{id:"component-request",name:"Request Component Generation",description:"Request generation of a missing UI component.",inputModes:["text","data"],outputModes:["text","data"],examples:["Generate a KanbanBoard component","I need a multi-step form wizard component"]},{id:"get-task-status",name:"Get Task Status",description:"Read the status of an existing Hub task.",inputModes:["data"],outputModes:["data"]}],...t}}function pe(e,t=200){return Response.json(e,{status:t})}function Ia(e){let t=ns(e.baseUrl,e.card),r=e.agentCardPath??"/.well-known/agent.json",n=e.rpcPath??"/api/a2a",o=async(s)=>{let a=s.id??null;try{switch(s.method){case"agent.getCard":return Te(a,t);case"component.request":{let c=s.params??{},l=typeof c.name==="string"?c.name:"";if(!l)return V(a,-32602,"Field 'name' is required");let p=await e.service.requestComponent({name:l,...typeof c.context==="string"?{context:c.context}:{},...typeof c.requestedBy==="string"?{requestedBy:c.requestedBy}:{},...c.priority==="low"||c.priority==="normal"||c.priority==="high"?{priority:c.priority}:{}});return Te(a,{task:ts(p)})}case"tasks.get":{let c=s.params??{},l=typeof c.taskId==="string"?c.taskId:"";if(!l)return V(a,-32602,"Field 'taskId' is required");let p=e.service.getTaskStatus(l);if(!p)return V(a,-32004,"Task not found");return Te(a,{task:rs(p)})}}}catch(c){return V(a,-32000,c instanceof Error?c.message:"A2A request failed")}};return{card:t,handleJsonRpc:o,handleHttp:async(s)=>{let a=new URL(s.url);if(s.method==="GET"&&a.pathname===r)return pe(t);if(s.method==="POST"&&a.pathname===n){let c;try{c=await s.json()}catch{return pe(V(null,-32700,"Invalid JSON payload"),400)}let l=await o(c),p="error"in l?400:200;return pe(l,p)}return pe({error:"Not found"},404)}}}var ss={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},mc=Array.from(new Set(Object.values(ss).flat()));var De=["component","template","design-guide","example","skill","block","package","theme"],Oe=["experimental","candidate","recommended"];var Ne=Object.freeze([Object.freeze({name:"manifest",summary:"Describe query operations and list the derived resource index.",positionals:Object.freeze([]),options:Object.freeze([])}),Object.freeze({name:"search",summary:"Search resources with deterministic bilingual ranking and reasons.",positionals:Object.freeze([Object.freeze({name:"text",property:"text",type:"string",required:!1})]),options:Object.freeze([...[["function","functions"],["scenario","scenarios"],["unit","units"],["industry","industries"]].map(([e,t])=>Object.freeze({name:e,property:t,type:"string",multiple:!0,cliEncoding:"comma-separated"})),Object.freeze({name:"kind",property:"kinds",type:"resource-kind",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"tag",property:"tags",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"category",property:"categories",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"capability",property:"capabilities",type:"string",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"maturity",property:"maturities",type:"resource-maturity",multiple:!0,cliEncoding:"comma-separated"}),Object.freeze({name:"limit",property:"limit",type:"positive-integer"})])}),Object.freeze({name:"get",summary:"Resolve one canonical resource id or unambiguous alias.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])}),Object.freeze({name:"build",summary:"Plan dependency closure and gaps without writing or installing.",positionals:Object.freeze([Object.freeze({name:"root",property:"roots",type:"string",required:!0,variadic:!0})]),options:Object.freeze([])}),Object.freeze({name:"docs",summary:"Read curated public documentation for one resource.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"locale",property:"locale",type:"string"},{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"examples",summary:"Read one bounded page of examples and exact dependencies. Follow nextPage for complete source.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([{name:"page",property:"page",type:"positive-integer"}])}),Object.freeze({name:"install-plan",summary:"Describe distribution channels and fixed snapshot identity/closure without installing or writing.",positionals:Object.freeze([Object.freeze({name:"id-or-alias",property:"id",type:"string",required:!0})]),options:Object.freeze([])})]);var as=["background","foreground","card","card-foreground","popover","popover-foreground","primary","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","accent","accent-foreground","border","input","ring","destructive","destructive-foreground","success","success-foreground","warning","warning-foreground"],Cc=[...as,"radius","font-display","font-body","font-mono"];var Lr=["resource-mcp-invalid-argument","resource-query-failed"];function G(e,t){return`Tool '${e}' is not wired in this build: no '${t}' discovery provider was supplied. `+`This is not an empty result \u2014 supply a 'discovery.${t}' provider to enable it.`}function Or(e){return`Tool '${e}' is not wired in this build: no Hub service was supplied. Supply a service to enable component requests and task status.`}function ls(e){if(e.status==="ready")return{status:"ready",artifact:e.artifact};return{status:e.status,taskId:e.taskId,pollUrl:e.pollUrl}}function us(e){switch(e.status){case"ready":return{taskId:e.taskId,status:"ready",artifact:e.artifact};case"failed":return{taskId:e.taskId,status:"failed",error:e.error};case"pending":case"running":return{taskId:e.taskId,status:e.status,...typeof e.progress==="number"?{progress:e.progress}:{}}}}function E(e){return{content:[{type:"json",json:e}]}}function k(e){return{content:[{type:"text",text:e}],isError:!0}}function Le(e,t){return{content:[{type:"json",json:{error:{code:e,detail:t}}}],isError:!0}}var W="uibot_resource_";function ds(e){return`${W}${e}`}function Nr(e,t){let r;if(e==="resource-kind")r={type:"string",enum:[...De]};else if(e==="resource-maturity")r={type:"string",enum:[...Oe]};else if(e==="positive-integer")r={type:"integer",minimum:1};else r={type:"string"};return t?{type:"array",items:r}:r}function ps(){return Ne.map((e)=>{let t={},r=[];for(let n of e.positionals)if(t[n.property]=Nr(n.type,"variadic"in n&&n.variadic===!0),n.required)r.push(n.property);for(let n of e.options)t[n.property]=Nr(n.type,"multiple"in n&&n.multiple===!0);return{name:ds(e.name),description:e.summary,inputSchema:{type:"object",properties:t,additionalProperties:!1,...r.length?{required:r}:{}}}})}class S extends Error{detail;code=Lr[0];constructor(e){super(e);this.detail=e;this.name="ResourceMcpArgumentError"}}function z(e,t){let r=new Set(t),n=Object.keys(e).find((o)=>!r.has(o));if(n)throw new S(`unsupported argument: ${n}`)}function ge(e,t){let r=e[t];if(r===void 0)return;if(typeof r!=="string"||!r.trim())throw new S(`${t} must be a non-empty string`);return r}function D(e,t,r){let n=e[t];if(n===void 0)return;if(!Array.isArray(n)||n.length===0||n.some((o)=>typeof o!=="string"||!o.trim()))throw new S(`${t} must be a non-empty string array`);if(r){let o=n.find((i)=>!r.includes(i));if(o)throw new S(`${t} contains unsupported value: ${o}`)}return n}function gs(e){if(e instanceof S)return Le(e.code,e.detail);if(e&&typeof e==="object"){let t=e;if(typeof t.code==="string"){let r=typeof t.detail==="string"?t.detail:typeof t.message==="string"?t.message:t.code;return Le(t.code,r)}}return Le(Lr[1],"resource query callback failed")}async function ms(e,t,r){try{if(e==="manifest")return z(t,[]),E({data:{index:await r.manifest()}});if(e==="search"){z(t,["text","kinds","tags","categories","capabilities","maturities","functions","scenarios","units","industries","limit"]);let o=ge(t,"text"),i=D(t,"kinds",De),s=D(t,"tags"),a=D(t,"categories"),c=D(t,"capabilities"),l=D(t,"maturities",Oe),p=Object.fromEntries(["functions","scenarios","units","industries"].flatMap((g)=>{let K=D(t,g);return K?[[g,K]]:[]})),y=t.limit;if(y!==void 0&&(typeof y!=="number"||!Number.isInteger(y)||y<=0))throw new S("limit must be a positive integer");let h={...p,...o?{text:o}:{},...i?{kinds:i}:{},...s?{tags:s}:{},...a?{categories:a}:{},...c?{capabilities:c}:{},...l?{maturities:l}:{},...typeof y==="number"?{limit:y}:{}};return E({data:{matches:await r.search(h)}})}if(e==="get"){z(t,["id"]);let o=ge(t,"id");if(!o)throw new S("id must be a non-empty string");return E({data:{resource:await r.get(o)}})}if(e==="docs"||e==="examples"||e==="install-plan"){z(t,e==="docs"?["id","locale","page"]:e==="examples"?["id","page"]:["id"]);let o=ge(t,"id");if(!o)throw new S("id must be a non-empty string");let i=ge(t,"locale");if(i&&i!=="zh"&&i!=="en")throw new S("locale must be zh or en");if(!(e==="docs"?r.docs:e==="examples"?r.examples:r.installPlan))return k(G(e,e));let a=t.page;if(a!==void 0&&(typeof a!=="number"||!Number.isSafeInteger(a)||a<1))throw new S("page must be a positive integer");let c=e==="docs"?await r.docs?.(o,i,a):e==="examples"?await r.examples?.(o,a):await r.installPlan?.(o);return E({data:c})}z(t,["roots"]);let n=D(t,"roots");if(!n)throw new S("roots must be a non-empty string array");return E({data:{plan:await r.build(n)}})}catch(n){return gs(n)}}function Kl(e){let t=[{name:"uibot_request_component",description:"Request a missing component from the UIBot Hub runtime.",inputSchema:{type:"object",properties:{name:{type:"string",description:"Component name"},context:{type:"string",description:"Optional usage context"},requestedBy:{type:"string",description:"Requester identifier"},priority:{type:"string",enum:["low","normal","high"]}},required:["name"]}},{name:"uibot_get_task_status",description:"Read the status of a Hub task.",inputSchema:{type:"object",properties:{taskId:{type:"string",description:"Hub task identifier"}},required:["taskId"]}},{name:"uibot_list_catalog",description:"List catalog components available to agents (read-only discovery). Returns name/description/category entries.",inputSchema:{type:"object",properties:{query:{type:"string",description:"Optional substring filter on name/description"}}}},{name:"uibot_get_design_md",description:"Get design-md entries (read-only). Omit id to list summaries; provide id for one full entry.",inputSchema:{type:"object",properties:{id:{type:"string",description:"Optional design-md id"}}}},{name:"uibot_list_templates",description:"List installable UIBot templates (read-only discovery).",inputSchema:{type:"object",properties:{query:{type:"string",description:"Optional substring filter"}}}},{name:"uibot_validate",description:"Validate a generated artifact. Pass `spec` (UIBot Spec object, or JSON/YAML text) to compile it against the catalog and get missing-component gaps and warnings; pass `html` to run the design-quality rules. Fix every gap before handing the result on.",inputSchema:{type:"object",properties:{spec:{description:"UIBot Spec object, or its JSON/YAML text"},html:{type:"string",description:"Generated HTML document"}}}},...ps()];return{listTools(){return t.filter((r)=>{if(r.name==="uibot_request_component")return e.serviceAvailable!==!1;if(r.name==="uibot_get_task_status")return e.serviceAvailable!==!1;if(r.name==="uibot_list_catalog")return e.discovery?.listCatalog!=null;if(r.name==="uibot_get_design_md")return e.discovery?.getDesignMd!=null;if(r.name==="uibot_list_templates")return e.discovery?.listTemplates!=null;if(r.name==="uibot_validate")return e.validate!=null;if(r.name.startsWith(W)){let n=r.name.slice(W.length),o=n==="install-plan"?"installPlan":n;return e.resourceQuery!=null&&typeof e.resourceQuery[o]==="function"}return!0})},async callTool(r,n){if(r.startsWith(W)){let o=r.slice(W.length);if(!Ne.some((s)=>s.name===o))return k(`Unknown tool: ${r}`);if(!e.resourceQuery)return k(G(r,"resourceQuery"));return ms(o,n,e.resourceQuery)}if(r==="uibot_request_component"){if(e.serviceAvailable===!1)return k(Or(r));let o=typeof n.name==="string"?n.name:"";if(!o)return k("Field 'name' is required");let i=await e.service.requestComponent({name:o,...typeof n.context==="string"?{context:n.context}:{},...typeof n.requestedBy==="string"?{requestedBy:n.requestedBy}:{},...n.priority==="low"||n.priority==="normal"||n.priority==="high"?{priority:n.priority}:{}});return E(ls(i))}if(r==="uibot_get_task_status"){if(e.serviceAvailable===!1)return k(Or(r));let o=typeof n.taskId==="string"?n.taskId:"";if(!o)return k("Field 'taskId' is required");let i=e.service.getTaskStatus(o);return i?E(us(i)):k("Task not found")}if(r==="uibot_list_catalog"){let o=e.discovery?.listCatalog;if(!o)return k(G(r,"listCatalog"));let i=await o(),s=Array.isArray(i)?i:[],a=typeof n.query==="string"?n.query.toLowerCase():"",c=a?s.filter((l)=>JSON.stringify(l).toLowerCase().includes(a)):s;return E({items:c,count:c.length})}if(r==="uibot_get_design_md"){let o=e.discovery?.getDesignMd;if(!o)return k(G(r,"getDesignMd"));let i=typeof n.id==="string"?n.id:void 0,s=await o(i)??(i?null:[]);return E({id:i??null,data:s})}if(r==="uibot_list_templates"){let o=e.discovery?.listTemplates;if(!o)return k(G(r,"listTemplates"));let i=await o(),s=Array.isArray(i)?i:[],a=typeof n.query==="string"?n.query.toLowerCase():"",c=a?s.filter((l)=>JSON.stringify(l).toLowerCase().includes(a)):s;return E({items:c,count:c.length})}if(r==="uibot_validate"){if(!e.validate)return k(`Tool '${r}' is not wired in this build: no 'validate' provider was supplied.`);let o=typeof n.html==="string"?n.html:void 0;if(n.spec===void 0&&o===void 0)return k("Provide 'spec' or 'html'");try{return E(await e.validate({...n.spec===void 0?{}:{spec:n.spec},...o===void 0?{}:{html:o}}))}catch(i){return k(i instanceof Error?i.message:String(i))}}return k(`Unknown tool: ${r}`)}}}export{Lr as RESOURCE_MCP_ERROR_CODES,ns as createDefaultUIBotHubA2AAgentCard,Ki as createDefaultUIBotHubBlueprint,Tr as createInMemoryUIBotHubTaskStore,Ia as createUIBotHubA2AHandler,ya as createUIBotHubHttpHandler,Kl as createUIBotHubMcpAdapter,la as createUIBotHubPlugin,ga as createUIBotHubService,ba as createUIBotHubWorkflowRequestRunner,Ee as normalizeHubBasePath};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uibot/hub-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@uibot/contracts": "^0.
|
|
31
|
-
"@uibot/plugin-sdk": "^0.
|
|
30
|
+
"@uibot/contracts": "^0.20.0",
|
|
31
|
+
"@uibot/plugin-sdk": "^0.20.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@uibot/application": "^0.
|
|
34
|
+
"@uibot/application": "^0.20.0"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "rm -rf dist && bun build --minify ./src/index.ts --outdir ./dist --format esm --target bun && bun x tsc -p tsconfig.json",
|