@uibot/hub-runtime 0.19.0 → 0.22.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/dist/mcp.d.ts +12 -0
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var Br=Object.create;var{getPrototypeOf:_r,defineProperty:Be,getOwnPropertyNames:Ur}=Object;var _e=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(_r(e)):{};let s=t||!e||!e.__esModule||!_e.call(e,"default")?Be(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of Ur(e))if(!_e.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(fs,Ue){var $r=Number.MAX_SAFE_INTEGER||9007199254740991,jr=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Ue.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 _=m(function(ys,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=_();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(hs,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(bs,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 R=m(function(Cs,ze){var J=_(),{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=R(),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(Is,Ke){var cn=T(),ln=(e,t)=>{let r=cn(e,t);return r?r.version:null};Ke.exports=ln});var Xe=m(function(xs,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(ks,Ze){var Qe=R(),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(Ps,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=R(),fn=(e,t)=>new mn(e,t).major;ot.exports=fn});var at=m(function(ws,st){var yn=R(),hn=(e,t)=>new yn(e,t).minor;st.exports=hn});var lt=m(function(As,ct){var bn=R(),Cn=(e,t)=>new bn(e,t).patch;ct.exports=Cn});var dt=m(function(Es,ut){var Rn=T(),In=(e,t)=>{let r=Rn(e,t);return r&&r.prerelease.length?r.prerelease:null};ut.exports=In});var P=m(function(vs,gt){var pt=R(),xn=(e,t,r)=>new pt(e,r).compare(new pt(t,r));gt.exports=xn});var ft=m(function(Ts,mt){var kn=P(),Pn=(e,t,r)=>kn(t,e,r);mt.exports=Pn});var ht=m(function(Ds,yt){var Sn=P(),wn=(e,t)=>Sn(e,t,!0);yt.exports=wn});var ee=m(function(Os,Ct){var bt=R(),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 It=m(function(Ns,Rt){var En=ee(),vn=(e,t)=>e.sort((r,n)=>En(r,n,t));Rt.exports=vn});var kt=m(function(Ls,xt){var Tn=ee(),Dn=(e,t)=>e.sort((r,n)=>Tn(n,r,t));xt.exports=Dn});var U=m(function(Bs,Pt){var On=P(),Nn=(e,t,r)=>On(e,t,r)>0;Pt.exports=Nn});var te=m(function(_s,St){var Ln=P(),Bn=(e,t,r)=>Ln(e,t,r)<0;St.exports=Bn});var be=m(function(Us,wt){var _n=P(),Un=(e,t,r)=>_n(e,t,r)===0;wt.exports=Un});var Ce=m(function(Fs,At){var Fn=P(),qn=(e,t,r)=>Fn(e,t,r)!==0;At.exports=qn});var re=m(function(qs,Et){var Hn=P(),Mn=(e,t,r)=>Hn(e,t,r)>=0;Et.exports=Mn});var ne=m(function(Hs,vt){var $n=P(),jn=(e,t,r)=>$n(e,t,r)<=0;vt.exports=jn});var Re=m(function(Ms,Tt){var Vn=be(),zn=Ce(),Gn=U(),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($s,Dt){var Xn=R(),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(js,Lt){var eo=T(),Nt=O(),to=R(),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(Vs,Ut){class _t{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}}Ut.exports=_t});var S=m(function(zs,$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[I.HYPHENRANGELOOSE]:x[I.HYPHENRANGE];e=e.replace(i,vo(this.options.includePrerelease)),b("hyphen replace",e),e=e.replace(x[I.COMPARATORTRIM],po),b("comparator trim",e),e=e.replace(x[I.TILDETRIM],go),b("tilde trim",e),e=e.replace(x[I.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[I.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=_(),lo=R(),{safeRe:x,src:uo,t:I,comparatorTrimReplace:po,tildeTrimReplace:go,caretTrimReplace:mo}=N(),{FLAG_INCLUDE_PRERELEASE:fo,FLAG_LOOSE:yo}=O(),ho=new RegExp(uo[I.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[I.BUILD],""),b("comp",e,t),e=ko(e,t),b("caret",e),e=Io(e,t),b("tildes",e),e=So(e,t),b("xrange",e),e=Ao(e,t),b("stars",e),e),C=(e)=>!e||e.toLowerCase()==="x"||e==="*",Ro=(e,t,r)=>C(e)&&!C(t)||C(t)&&r&&!C(r),Io=(e,t)=>e.trim().split(/\s+/).map((r)=>xo(r,t)).join(" "),xo=(e,t)=>{let r=t.loose?x[I.TILDELOOSE]:x[I.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[I.CARETLOOSE]:x[I.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})},So=(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?x[I.XRANGELOOSE]:x[I.XRANGE];return e.replace(r,(n,o,i,s,a,c)=>{if(b("xRange",e,n,o,i,s,a,c),Ro(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[I.STAR],"")),Eo=(e,t)=>(b("replaceGTE0",e,t),e.trim().replace(x[t.includePrerelease?I.GTE0PRE:I.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(Gs,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 Ie(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(Ie(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(Ie(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(),Ie=Re(),xe=_(),Gt=R(),Wt=S()});var M=m(function(Ws,Yt){var Do=S(),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(Ks,Jt){var No=S(),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(Ys,Qt){var Bo=R(),_o=S(),Uo=(e,t,r)=>{let n=null,o=null,i=null;try{i=new _o(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=Uo});var tr=m(function(Js,er){var Fo=R(),qo=S(),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(Xs,nr){var ke=R(),Mo=S(),rr=U(),$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(Qs,ir){var jo=S(),Vo=(e,t)=>{try{return new jo(e,t).range||"*"}catch(r){return null}};ir.exports=Vo});var ce=m(function(Zs,ur){var zo=R(),lr=q(),{ANY:Go}=lr,Wo=S(),Ko=M(),ar=U(),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(ea,dr){var Qo=ce(),Zo=(e,t,r)=>Qo(e,t,">",r);dr.exports=Zo});var mr=m(function(ta,gr){var ei=ce(),ti=(e,t,r)=>ei(e,t,"<",r);gr.exports=ti});var hr=m(function(ra,yr){var fr=S(),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(na,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 Sr=m(function(oa,Pr){var Rr=S(),we=q(),{ANY:Pe}=we,Se=M(),Ae=P(),ii=(e,t,r={})=>{if(e===t)return!0;e=new Rr(e,r),t=new Rr(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 we(">=0.0.0-0")],Ir=[new we(">=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=Ir;if(t.length===1&&t[0].semver===Pe)if(r.includePrerelease)return!0;else t=Ir;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&&!Se(g,String(o),r))return null;if(i&&!Se(g,String(i),r))return null;for(let K of t)if(!Se(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(ia,wr){var L=N(),le=O(),ci=R(),ue=ye(),li=T(),ui=Ye(),di=Xe(),pi=et(),gi=nt(),mi=it(),fi=at(),yi=lt(),hi=dt(),bi=P(),Ci=ft(),Ri=ht(),Ii=ee(),xi=It(),ki=kt(),Pi=U(),Si=te(),wi=be(),Ai=Ce(),Ei=re(),vi=ne(),Ti=Re(),Di=Ot(),Oi=Bt(),Ni=q(),Li=S(),Bi=M(),_i=Xt(),Ui=Zt(),Fi=tr(),qi=or(),Hi=sr(),Mi=ce(),$i=pr(),ji=mr(),Vi=hr(),zi=Cr(),Gi=Sr();wr.exports={parse:li,valid:ui,clean:di,inc:pi,diff:gi,major:mi,minor:fi,patch:yi,prerelease:hi,compare:bi,rcompare:Ci,compareLoose:Ri,compareBuild:Ii,sort:xi,rsort:ki,gt:Pi,lt:Si,eq:wi,neq:Ai,gte:Ei,lte:vi,cmp:Ti,coerce:Di,truncate:Oi,Comparator:Ni,Range:Li,satisfies:Bi,toComparators:_i,maxSatisfying:Ui,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 ca(){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 pa(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 fa(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 ha(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 Ca(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"]},gc=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"],bc=[...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 cs(e){if(e.status==="ready")return{status:"ready",artifact:e.artifact};return{status:e.status,taskId:e.taskId,pollUrl:e.pollUrl}}function ls(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 us(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 ds(){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:us(e.name),description:e.summary,inputSchema:{type:"object",properties:t,additionalProperties:!1,...r.length?{required:r}:{}}}})}class w 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 w(`unsupported argument: ${n}`)}function ge(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 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 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 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 gs(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 w("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 w("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 w("id must be a non-empty string");let i=ge(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 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 w("roots must be a non-empty string array");return E({data:{plan:await r.build(n)}})}catch(n){return ps(n)}}function zl(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(!Ne.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(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(cs(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(ls(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,Ca as createUIBotHubA2AHandler,fa as createUIBotHubHttpHandler,zl as createUIBotHubMcpAdapter,ca as createUIBotHubPlugin,pa as createUIBotHubService,ha as createUIBotHubWorkflowRequestRunner,Ee as normalizeHubBasePath};
|
|
2
|
+
var _r=Object.create;var{getPrototypeOf:Ur,defineProperty:Le,getOwnPropertyNames:Fr}=Object;var _e=Object.prototype.hasOwnProperty;function qr(e){return this[e]}var Hr,jr,Mr=(e,t,r)=>{var n=e!=null&&typeof e==="object";if(n){var i=t?Hr??=new WeakMap:jr??=new WeakMap,o=i.get(e);if(o)return o}r=e!=null?_r(Ur(e)):{};let s=t||!e||!e.__esModule||!_e.call(e,"default")?Le(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of Fr(e))if(!_e.call(s,a))Le(s,a,{get:qr.bind(e,a),enumerable:!0})}if(n)i.set(e,s);return s};var f=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var D=f(function(hs,Ue){var Vr=Number.MAX_SAFE_INTEGER||9007199254740991,$r=["major","premajor","minor","preminor","patch","prepatch","prerelease"];Ue.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Vr,RELEASE_TYPES:$r,SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var U=f(function(bs,Fe){var zr=typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};Fe.exports=zr});var B=f(function(E,qe){var{MAX_SAFE_COMPONENT_LENGTH:me,MAX_SAFE_BUILD_LENGTH:Gr,MAX_LENGTH:Wr}=D(),Kr=U();E=qe.exports={};var Yr=E.re=[],Jr=E.safeRe=[],d=E.src=[],Xr=E.safeSrc=[],u=E.t={},Zr=0,ye="[a-zA-Z0-9-]",Qr=[["\\s",1],["\\d",Wr],[ye,Gr]],en=(e)=>{for(let[t,r]of Qr)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},m=(e,t,r)=>{let n=en(t),i=Zr++;Kr(e,i,t),u[e]=i,d[i]=t,Xr[i]=n,Yr[i]=new RegExp(t,r?"g":void 0),Jr[i]=new RegExp(n,r?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*");m("NUMERICIDENTIFIERLOOSE","\\d+");m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ye}*`);m("MAINVERSION",`(${d[u.NUMERICIDENTIFIER]})\\.(${d[u.NUMERICIDENTIFIER]})\\.(${d[u.NUMERICIDENTIFIER]})`);m("MAINVERSIONLOOSE",`(${d[u.NUMERICIDENTIFIERLOOSE]})\\.(${d[u.NUMERICIDENTIFIERLOOSE]})\\.(${d[u.NUMERICIDENTIFIERLOOSE]})`);m("PRERELEASEIDENTIFIER",`(?:${d[u.NONNUMERICIDENTIFIER]}|${d[u.NUMERICIDENTIFIER]})`);m("PRERELEASEIDENTIFIERLOOSE",`(?:${d[u.NONNUMERICIDENTIFIER]}|${d[u.NUMERICIDENTIFIERLOOSE]})`);m("PRERELEASE",`(?:-(${d[u.PRERELEASEIDENTIFIER]}(?:\\.${d[u.PRERELEASEIDENTIFIER]})*))`);m("PRERELEASELOOSE",`(?:-?(${d[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${d[u.PRERELEASEIDENTIFIERLOOSE]})*))`);m("BUILDIDENTIFIER",`${ye}+`);m("BUILD",`(?:\\+(${d[u.BUILDIDENTIFIER]}(?:\\.${d[u.BUILDIDENTIFIER]})*))`);m("FULLPLAIN",`v?${d[u.MAINVERSION]}${d[u.PRERELEASE]}?${d[u.BUILD]}?`);m("FULL",`^${d[u.FULLPLAIN]}$`);m("LOOSEPLAIN",`[v=\\s]*${d[u.MAINVERSIONLOOSE]}${d[u.PRERELEASELOOSE]}?${d[u.BUILD]}?`);m("LOOSE",`^${d[u.LOOSEPLAIN]}$`);m("GTLT","((?:<|>)?=?)");m("XRANGEIDENTIFIERLOOSE",`${d[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);m("XRANGEIDENTIFIER",`${d[u.NUMERICIDENTIFIER]}|x|X|\\*`);m("XRANGEPLAIN",`[v=\\s]*(${d[u.XRANGEIDENTIFIER]})(?:\\.(${d[u.XRANGEIDENTIFIER]})(?:\\.(${d[u.XRANGEIDENTIFIER]})(?:${d[u.PRERELEASE]})?${d[u.BUILD]}?)?)?`);m("XRANGEPLAINLOOSE",`[v=\\s]*(${d[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[u.XRANGEIDENTIFIERLOOSE]})(?:\\.(${d[u.XRANGEIDENTIFIERLOOSE]})(?:${d[u.PRERELEASELOOSE]})?${d[u.BUILD]}?)?)?`);m("XRANGE",`^${d[u.GTLT]}\\s*${d[u.XRANGEPLAIN]}$`);m("XRANGELOOSE",`^${d[u.GTLT]}\\s*${d[u.XRANGEPLAINLOOSE]}$`);m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${me}})(?:\\.(\\d{1,${me}}))?(?:\\.(\\d{1,${me}}))?`);m("COERCE",`${d[u.COERCEPLAIN]}(?:$|[^\\d])`);m("COERCEFULL",d[u.COERCEPLAIN]+`(?:${d[u.PRERELEASE]})?(?:${d[u.BUILD]})?(?:$|[^\\d])`);m("COERCERTL",d[u.COERCE],!0);m("COERCERTLFULL",d[u.COERCEFULL],!0);m("LONETILDE","(?:~>?)");m("TILDETRIM",`(\\s*)${d[u.LONETILDE]}\\s+`,!0);E.tildeTrimReplace="$1~";m("TILDE",`^${d[u.LONETILDE]}${d[u.XRANGEPLAIN]}$`);m("TILDELOOSE",`^${d[u.LONETILDE]}${d[u.XRANGEPLAINLOOSE]}$`);m("LONECARET","(?:\\^)");m("CARETTRIM",`(\\s*)${d[u.LONECARET]}\\s+`,!0);E.caretTrimReplace="$1^";m("CARET",`^${d[u.LONECARET]}${d[u.XRANGEPLAIN]}$`);m("CARETLOOSE",`^${d[u.LONECARET]}${d[u.XRANGEPLAINLOOSE]}$`);m("COMPARATORLOOSE",`^${d[u.GTLT]}\\s*(${d[u.LOOSEPLAIN]})$|^$`);m("COMPARATOR",`^${d[u.GTLT]}\\s*(${d[u.FULLPLAIN]})$|^$`);m("COMPARATORTRIM",`(\\s*)${d[u.GTLT]}\\s*(${d[u.LOOSEPLAIN]}|${d[u.XRANGEPLAIN]})`,!0);E.comparatorTrimReplace="$1$2$3";m("HYPHENRANGE",`^\\s*(${d[u.XRANGEPLAIN]})\\s+-\\s+(${d[u.XRANGEPLAIN]})\\s*$`);m("HYPHENRANGELOOSE",`^\\s*(${d[u.XRANGEPLAINLOOSE]})\\s+-\\s+(${d[u.XRANGEPLAINLOOSE]})\\s*$`);m("STAR","(<|>)?=?\\s*\\*");m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var Y=f(function(Cs,He){var tn=Object.freeze({loose:!0}),rn=Object.freeze({}),nn=(e)=>{if(!e)return rn;if(typeof e!=="object")return tn;return e};He.exports=nn});var he=f(function(ks,Ve){var je=/^[0-9]+$/,Me=(e,t)=>{if(typeof e==="number"&&typeof t==="number")return e===t?0:e<t?-1:1;let r=je.test(e),n=je.test(t);if(r&&n)e=+e,t=+t;return e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},on=(e,t)=>Me(t,e);Ve.exports={compareIdentifiers:Me,rcompareIdentifiers:on}});var I=f(function(Is,ze){var J=U(),{MAX_LENGTH:$e,MAX_SAFE_INTEGER:X}=D(),{safeRe:Z,t:Q}=B(),sn=Y(),{compareIdentifiers:be}=he(),an=(e,t)=>{let r=t.split(".");if(r.length>e.length)return!1;for(let n=0;n<r.length;n++)if(be(e[n],r[n])!==0)return!1;return!0};class v{constructor(e,t){if(t=sn(t),e instanceof v)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>$e)throw TypeError(`version is longer than ${$e} characters`);J("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?Z[Q.LOOSE]:Z[Q.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 i=+n;if(i>=0&&i<X)return i}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 v)){if(typeof e==="string"&&e===this.version)return 0;e=new v(e,this.options)}if(e.version===this.version)return 0;return this.compareMain(e)||this.comparePre(e)}compareMain(e){if(!(e instanceof v))e=new v(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 v))e=new v(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 be(r,n)}while(++t)}compareBuild(e){if(!(e instanceof v))e=new v(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 be(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?Z[Q.PRERELEASELOOSE]:Z[Q.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 i=this.prerelease.length;while(--i>=0)if(typeof this.prerelease[i]==="number")this.prerelease[i]++,i=-2;if(i===-1){if(t===this.prerelease.join(".")&&r===!1)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(n)}}if(t){let i=[t,n];if(r===!1)i=[t];if(an(this.prerelease,t)){let o=this.prerelease[t.split(".").length];if(isNaN(o))this.prerelease=i}else this.prerelease=i}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=v});var T=f(function(xs,We){var Ge=I(),cn=(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=cn});var Ye=f(function(Rs,Ke){var ln=T(),dn=(e,t)=>{let r=ln(e,t);return r?r.version:null};Ke.exports=dn});var Xe=f(function(ws,Je){var un=T(),pn=(e,t)=>{let r=un(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};Je.exports=pn});var et=f(function(Ss,Qe){var Ze=I(),gn=(e,t,r,n,i)=>{if(typeof r==="string")i=n,n=r,r=void 0;try{return new Ze(e instanceof Ze?e.version:e,r).inc(t,n,i).version}catch(o){return null}};Qe.exports=gn});var nt=f(function(Ps,rt){var tt=T(),fn=(e,t)=>{let r=tt(e,null,!0),n=tt(t,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?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=fn});var ot=f(function(As,it){var mn=I(),yn=(e,t)=>new mn(e,t).major;it.exports=yn});var at=f(function(vs,st){var hn=I(),bn=(e,t)=>new hn(e,t).minor;st.exports=bn});var lt=f(function(Es,ct){var Cn=I(),kn=(e,t)=>new Cn(e,t).patch;ct.exports=kn});var ut=f(function(Ts,dt){var In=T(),xn=(e,t)=>{let r=In(e,t);return r&&r.prerelease.length?r.prerelease:null};dt.exports=xn});var w=f(function(Os,gt){var pt=I(),Rn=(e,t,r)=>new pt(e,r).compare(new pt(t,r));gt.exports=Rn});var mt=f(function(Ds,ft){var wn=w(),Sn=(e,t,r)=>wn(t,e,r);ft.exports=Sn});var ht=f(function(Bs,yt){var Pn=w(),An=(e,t)=>Pn(e,t,!0);yt.exports=An});var ee=f(function(Ns,Ct){var bt=I(),vn=(e,t,r)=>{let n=new bt(e,r),i=new bt(t,r);return n.compare(i)||n.compareBuild(i)};Ct.exports=vn});var It=f(function(Ls,kt){var En=ee(),Tn=(e,t)=>e.sort((r,n)=>En(r,n,t));kt.exports=Tn});var Rt=f(function(_s,xt){var On=ee(),Dn=(e,t)=>e.sort((r,n)=>On(n,r,t));xt.exports=Dn});var F=f(function(Us,wt){var Bn=w(),Nn=(e,t,r)=>Bn(e,t,r)>0;wt.exports=Nn});var te=f(function(Fs,St){var Ln=w(),_n=(e,t,r)=>Ln(e,t,r)<0;St.exports=_n});var Ce=f(function(qs,Pt){var Un=w(),Fn=(e,t,r)=>Un(e,t,r)===0;Pt.exports=Fn});var ke=f(function(Hs,At){var qn=w(),Hn=(e,t,r)=>qn(e,t,r)!==0;At.exports=Hn});var re=f(function(js,vt){var jn=w(),Mn=(e,t,r)=>jn(e,t,r)>=0;vt.exports=Mn});var ne=f(function(Ms,Et){var Vn=w(),$n=(e,t,r)=>Vn(e,t,r)<=0;Et.exports=$n});var Ie=f(function(Vs,Tt){var zn=Ce(),Gn=ke(),Wn=F(),Kn=re(),Yn=te(),Jn=ne(),Xn=(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 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);case"<=":return Jn(e,r,n);default:throw TypeError(`Invalid operator: ${t}`)}};Tt.exports=Xn});var Dt=f(function($s,Ot){var Zn=I(),Qn=T(),{safeRe:ie,t:oe}=B(),ei=(e,t)=>{if(e instanceof Zn)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?ie[oe.COERCEFULL]:ie[oe.COERCE]);else{let c=t.includePrerelease?ie[oe.COERCERTLFULL]:ie[oe.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],i=r[3]||"0",o=r[4]||"0",s=t.includePrerelease&&r[5]?`-${r[5]}`:"",a=t.includePrerelease&&r[6]?`+${r[6]}`:"";return Qn(`${n}.${i}.${o}${s}${a}`,t)};Ot.exports=ei});var Lt=f(function(zs,Nt){var ti=T(),Bt=D(),ri=I(),ni=(e,t,r)=>{if(!Bt.RELEASE_TYPES.includes(t))return null;let n=ii(e,r);return n&&oi(n,t)},ii=(e,t)=>{let r=e instanceof ri?e.version:e;return ti(r,t)},oi=(e,t)=>{if(si(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()},si=(e)=>e.startsWith("pre");Nt.exports=ni});var Ft=f(function(Gs,Ut){class _t{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}}Ut.exports=_t});var S=f(function(Ws,Mt){var ai=/\s+/g;class q{constructor(e,t){if(t=li(t),e instanceof q)if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;else return new q(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(ai," "),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&&bi(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(hi,"");let r=((this.options.includePrerelease&&mi)|(this.options.loose&&yi))+":"+e,n=qt.get(r);if(n)return n;let i=this.options.loose,o=i?R[x.HYPHENRANGELOOSE]:R[x.HYPHENRANGE];e=e.replace(o,Ei(this.options.includePrerelease)),b("hyphen replace",e),e=e.replace(R[x.COMPARATORTRIM],pi),b("comparator trim",e),e=e.replace(R[x.TILDETRIM],gi),b("tilde trim",e),e=e.replace(R[x.CARETTRIM],fi),b("caret trim",e);let s=e.split(" ").map((p)=>Ci(p,this.options)).join(" ").split(/\s+/).map((p)=>vi(p,this.options));if(i)s=s.filter((p)=>(b("loose invalid filter",p,this.options),!!p.match(R[x.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 q))throw TypeError("a Range is required");return this.set.some((r)=>jt(r,t)&&e.set.some((n)=>jt(n,t)&&r.every((i)=>n.every((o)=>i.intersects(o,t)))))}test(e){if(!e)return!1;if(typeof e==="string")try{e=new di(e,this.options)}catch(t){return!1}for(let t=0;t<this.set.length;t++)if(Ti(this.set[t],e,this.options))return!0;return!1}}Mt.exports=q;var ci=Ft(),qt=new ci,li=Y(),se=H(),b=U(),di=I(),{safeRe:R,src:ui,t:x,comparatorTrimReplace:pi,tildeTrimReplace:gi,caretTrimReplace:fi}=B(),{FLAG_INCLUDE_PRERELEASE:mi,FLAG_LOOSE:yi}=D(),hi=new RegExp(ui[x.BUILD],"g"),Ht=(e)=>e.value==="<0.0.0-0",bi=(e)=>e.value==="",jt=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();while(r&&n.length)r=n.every((o)=>i.intersects(o,t)),i=n.pop();return r},Ci=(e,t)=>(e=e.replace(R[x.BUILD],""),b("comp",e,t),e=Ri(e,t),b("caret",e),e=Ii(e,t),b("tildes",e),e=Si(e,t),b("xrange",e),e=Ai(e,t),b("stars",e),e),C=(e)=>!e||e.toLowerCase()==="x"||e==="*",ki=(e,t,r)=>C(e)&&!C(t)||C(t)&&r&&!C(r),Ii=(e,t)=>e.trim().split(/\s+/).map((r)=>xi(r,t)).join(" "),xi=(e,t)=>{let r=t.loose?R[x.TILDELOOSE]:R[x.TILDE],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{b("tilde",e,i,o,s,a,c);let l;if(C(o))l="";else if(C(s))l=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(C(a))l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`;else if(c)b("replaceTilde pr",c),l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;return b("tilde return",l),l})},Ri=(e,t)=>e.trim().split(/\s+/).map((r)=>wi(r,t)).join(" "),wi=(e,t)=>{b("caret",e,t);let r=t.loose?R[x.CARETLOOSE]:R[x.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(i,o,s,a,c)=>{b("caret",e,i,o,s,a,c);let l;if(C(o))l="";else if(C(s))l=`>=${o}.0.0${n} <${+o+1}.0.0-0`;else if(C(a))if(o==="0")l=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`;else if(c)if(b("replaceCaret pr",c),o==="0")if(s==="0")l=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`;else l=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`;else if(b("no pr"),o==="0")if(s==="0")l=`>=${o}.${s}.${a} <${o}.${s}.${+a+1}-0`;else l=`>=${o}.${s}.${a} <${o}.${+s+1}.0-0`;else l=`>=${o}.${s}.${a} <${+o+1}.0.0-0`;return b("caret return",l),l})},Si=(e,t)=>(b("replaceXRanges",e,t),e.split(/\s+/).map((r)=>Pi(r,t)).join(" ")),Pi=(e,t)=>{e=e.trim();let r=t.loose?R[x.XRANGELOOSE]:R[x.XRANGE];return e.replace(r,(n,i,o,s,a,c)=>{if(b("xRange",e,n,i,o,s,a,c),ki(o,s,a))return e;let l=C(o),p=l||C(s),y=p||C(a),h=y;if(i==="="&&h)i="";if(c=t.includePrerelease?"-0":"",l)if(i===">"||i==="<")n="<0.0.0-0";else n="*";else if(i&&h){if(p)s=0;if(a=0,i===">")if(i=">=",p)o=+o+1,s=0,a=0;else s=+s+1,a=0;else if(i==="<=")if(i="<",p)o=+o+1;else s=+s+1;if(i==="<")c="-0";n=`${i+o}.${s}.${a}${c}`}else if(p)n=`>=${o}.0.0${c} <${+o+1}.0.0-0`;else if(y)n=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`;return b("xRange return",n),n})},Ai=(e,t)=>(b("replaceStars",e,t),e.trim().replace(R[x.STAR],"")),vi=(e,t)=>(b("replaceGTE0",e,t),e.trim().replace(R[t.includePrerelease?x.GTE0PRE:x.GTE0],"")),Ei=(e)=>(t,r,n,i,o,s,a,c,l,p,y,h)=>{if(C(n))r="";else if(C(i))r=`>=${n}.0.0${e?"-0":""}`;else if(C(o))r=`>=${n}.${i}.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()},Ti=(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 i=e[n].semver;if(i.major===t.major&&i.minor===t.minor&&i.patch===t.patch)return!0}}return!1}return!0}});var H=f(function(Ks,Kt){var j=Symbol("SemVer ANY");class ae{static get ANY(){return j}constructor(e,t){if(t=Vt(t),e instanceof ae)if(e.loose===!!t.loose)return e;else e=e.value;if(e=e.trim().split(/\s+/).join(" "),Re("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===j)this.value="";else this.value=this.operator+this.semver.version;Re("comp",this)}parse(e){let t=this.options.loose?$t[zt.COMPARATORLOOSE]:$t[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=j;else this.semver=new Gt(r[2],this.options.loose)}toString(){return this.value}test(e){if(Re("Comparator.test",e,this.options.loose),this.semver===j||e===j)return!0;if(typeof e==="string")try{e=new Gt(e,this.options)}catch(t){return!1}return xe(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=Vt(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(xe(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))return!0;if(xe(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))return!0;return!1}}Kt.exports=ae;var Vt=Y(),{safeRe:$t,t:zt}=B(),xe=Ie(),Re=U(),Gt=I(),Wt=S()});var M=f(function(Ys,Yt){var Oi=S(),Di=(e,t,r)=>{try{t=new Oi(t,r)}catch(n){return!1}return t.test(e)};Yt.exports=Di});var Xt=f(function(Js,Jt){var Bi=S(),Ni=(e,t)=>new Bi(e,t).set.map((r)=>r.map((n)=>n.value).join(" ").trim().split(" "));Jt.exports=Ni});var Qt=f(function(Xs,Zt){var Li=I(),_i=S(),Ui=(e,t,r)=>{let n=null,i=null,o=null;try{o=new _i(t,r)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!n||i.compare(s)===-1)n=s,i=new Li(n,r)}}),n};Zt.exports=Ui});var tr=f(function(Zs,er){var Fi=I(),qi=S(),Hi=(e,t,r)=>{let n=null,i=null,o=null;try{o=new qi(t,r)}catch(s){return null}return e.forEach((s)=>{if(o.test(s)){if(!n||i.compare(s)===1)n=s,i=new Fi(n,r)}}),n};er.exports=Hi});var ir=f(function(Qs,nr){var we=I(),ji=S(),rr=F(),Mi=(e,t)=>{e=new ji(e,t);let r=new we("0.0.0");if(e.test(r))return r;if(r=new we("0.0.0-0"),e.test(r))return r;r=null;for(let n=0;n<e.set.length;++n){let i=e.set[n],o=null;if(i.forEach((s)=>{let a=new we(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(!o||rr(a,o))o=a;break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||rr(r,o)))r=o}if(r&&e.test(r))return r;return null};nr.exports=Mi});var sr=f(function(ea,or){var Vi=S(),$i=(e,t)=>{try{return new Vi(e,t).range||"*"}catch(r){return null}};or.exports=$i});var ce=f(function(ta,dr){var zi=I(),lr=H(),{ANY:Gi}=lr,Wi=S(),Ki=M(),ar=F(),cr=te(),Yi=ne(),Ji=re(),Xi=(e,t,r,n)=>{e=new zi(e,n),t=new Wi(t,n);let i,o,s,a,c;switch(r){case">":i=ar,o=Yi,s=cr,a=">",c=">=";break;case"<":i=cr,o=Ji,s=ar,a="<",c="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(Ki(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===Gi)g=new lr(">=0.0.0");if(y=y||g,h=h||g,i(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)&&o(e,h.semver))return!1;else if(h.operator===c&&s(e,h.semver))return!1}return!0};dr.exports=Xi});var pr=f(function(ra,ur){var Zi=ce(),Qi=(e,t,r)=>Zi(e,t,">",r);ur.exports=Qi});var fr=f(function(na,gr){var eo=ce(),to=(e,t,r)=>eo(e,t,"<",r);gr.exports=to});var hr=f(function(ia,yr){var mr=S(),ro=(e,t,r)=>(e=new mr(e,r),t=new mr(t,r),e.intersects(t,r));yr.exports=ro});var Cr=f(function(oa,br){var no=M(),io=w();br.exports=(e,t,r)=>{let n=[],i=null,o=null,s=e.sort((p,y)=>io(p,y,r));for(let p of s)if(no(p,t,r)){if(o=p,!i)i=p}else{if(o)n.push([i,o]);o=null,i=null}if(i)n.push([i,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 Sr=f(function(sa,wr){var kr=S(),Ae=H(),{ANY:Se}=Ae,Pe=M(),ve=w(),oo=(e,t,r={})=>{if(e===t)return!0;e=new kr(e,r),t=new kr(t,r);let n=!1;e:for(let i of e.set){for(let o of t.set){let s=ao(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},so=[new Ae(">=0.0.0-0")],Ir=[new Ae(">=0.0.0")],ao=(e,t,r)=>{if(e===t)return!0;if(e.length===1&&e[0].semver===Se)if(t.length===1&&t[0].semver===Se)return!0;else if(r.includePrerelease)e=so;else e=Ir;if(t.length===1&&t[0].semver===Se)if(r.includePrerelease)return!0;else t=Ir;let n=new Set,i,o;for(let g of e)if(g.operator===">"||g.operator===">=")i=xr(i,g,r);else if(g.operator==="<"||g.operator==="<=")o=Rr(o,g,r);else n.add(g.semver);if(n.size>1)return null;let s;if(i&&o){if(s=ve(i.semver,o.semver,r),s>0)return null;else if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let g of n){if(i&&!Pe(g,String(i),r))return null;if(o&&!Pe(g,String(o),r))return null;for(let K of t)if(!Pe(g,String(K),r))return!1;return!0}let a,c,l,p,y=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,h=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;if(y&&y.prerelease.length===1&&o.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==="<=",i){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(i,g,r),a===g&&a!==i)return!1}else if(i.operator===">="&&!g.test(i.semver))return!1}if(o){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=Rr(o,g,r),c===g&&c!==o)return!1}else if(o.operator==="<="&&!g.test(o.semver))return!1}if(!g.operator&&(o||i)&&s!==0)return!1}if(i&&l&&!o&&s!==0)return!1;if(o&&p&&!i&&s!==0)return!1;if(h||y)return!1;return!0},xr=(e,t,r)=>{if(!e)return t;let n=ve(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e},Rr=(e,t,r)=>{if(!e)return t;let n=ve(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};wr.exports=oo});var Ar=f(function(aa,Pr){var N=B(),le=D(),co=I(),de=he(),lo=T(),uo=Ye(),po=Xe(),go=et(),fo=nt(),mo=ot(),yo=at(),ho=lt(),bo=ut(),Co=w(),ko=mt(),Io=ht(),xo=ee(),Ro=It(),wo=Rt(),So=F(),Po=te(),Ao=Ce(),vo=ke(),Eo=re(),To=ne(),Oo=Ie(),Do=Dt(),Bo=Lt(),No=H(),Lo=S(),_o=M(),Uo=Xt(),Fo=Qt(),qo=tr(),Ho=ir(),jo=sr(),Mo=ce(),Vo=pr(),$o=fr(),zo=hr(),Go=Cr(),Wo=Sr();Pr.exports={parse:lo,valid:uo,clean:po,inc:go,diff:fo,major:mo,minor:yo,patch:ho,prerelease:bo,compare:Co,rcompare:ko,compareLoose:Io,compareBuild:xo,sort:Ro,rsort:wo,gt:So,lt:Po,eq:Ao,neq:vo,gte:Eo,lte:To,cmp:Oo,coerce:Do,truncate:Bo,Comparator:No,Range:Lo,satisfies:_o,toComparators:Uo,maxSatisfying:Fo,minSatisfying:qo,minVersion:Ho,validRange:jo,outside:Mo,gtr:Vo,ltr:$o,intersects:zo,simplifyRange:Go,subset:Wo,SemVer:co,re:N.re,src:N.src,tokens:N.t,SEMVER_SPEC_VERSION:le.SEMVER_SPEC_VERSION,RELEASE_TYPES:le.RELEASE_TYPES,compareIdentifiers:de.compareIdentifiers,rcompareIdentifiers:de.rcompareIdentifiers}});var Ko=Mr(Ar(),1);function vr(e){return e}function Er(e){return e}function V(e){return e}function Yo(){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 da(){let e=vr({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=Yo(),n=[V({id:"uibot.hub.runtime",type:"agent:runtime",description:"UIBot Hub workflow runtime",contribution:r}),V({id:"uibot.hub.a2a",type:"protocol:adapter",description:"A2A support through UIBot Hub runtime",contribution:r.protocols}),V({id:"uibot.hub.mcp",type:"protocol:adapter",description:"MCP support through UIBot Hub runtime",contribution:r.protocols}),V({id:"uibot.hub.evals",type:"evaluation:runner",description:"Evaluation entrypoints managed by UIBot Hub workflows",contribution:r.workflows})];for(let i of n)t.addCapability(i)}})}function ue(e){return{...e,request:{...e.request},...e.artifact?{artifact:{...e.artifact}}:{}}}function Jo(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),ue(n)},getTask(t){let r=e.get(t);return r?ue(r):void 0},listTasks(){return[...e.values()].map((t)=>ue(t))},updateTask(t,r){let n=e.get(t);if(!n)throw Error(`Hub task not found: ${t}`);let i=Jo(n,r);return e.set(t,i),ue(i)}}}function Or(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 Xo(e,t,r){function n(i,o){return t.updateTask(e,{status:i,...typeof o?.progress==="number"?{progress:o.progress}:{},updatedAt:r().toISOString()})}return{taskId:e,getSnapshot(){let i=t.getTask(e);if(!i)throw Error(`Hub task not found: ${e}`);return i},markPending(i){return n("pending",typeof i==="number"?{progress:i}:void 0)},markRunning(i){return n("running",typeof i==="number"?{progress:i}:void 0)},markReady(i){return t.updateTask(e,{status:"ready",artifact:i,updatedAt:r().toISOString()})},markFailed(i){return t.updateTask(e,{status:"failed",error:i,updatedAt:r().toISOString()})}}}function Zo(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 Qo(e,t){Promise.resolve().then(async()=>{let r=await e.run(t);if(r)t.markReady(r)}).catch((r)=>{t.markFailed(Or(r))})}function fa(e){let t=Ee(e.basePath),r=e.taskStore??Tr(),n=e.clock??(()=>new Date),i=e.createTaskId??(()=>crypto.randomUUID());return{async requestComponent(o){let s=i(),a=r.createTask({taskId:s,request:o,createdAt:n().toISOString()}),c=Xo(s,r,n),l;try{l=await e.requestComponent({payload:o,task:a,controller:c})}catch(h){throw c.markFailed(Or(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);Qo(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(o){return r.getTask(o)},listTasks(){return r.listTasks()},getTaskStatus(o){let s=r.getTask(o);return s?Zo(s):void 0}}}function Te(e,t=200){return Response.json(e,{status:t})}function L(e,t){return Te({error:t},e)}function ha(e){let t=Ee(e.basePath),r=`${t}/components/request`,n=`${t}/tasks/`;return async function(o){let s=new URL(o.url);if(o.method==="POST"&&s.pathname===r){let a;try{a=await o.json()}catch{return L(400,"Invalid JSON payload")}if(!a.name)return L(400,"Field 'name' is required");try{let c=await e.service.requestComponent(a),l=c.status==="ready"?200:202;return Te(c,l)}catch(c){return L(500,c instanceof Error?c.message:"Hub request failed")}}if(o.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 c=e.service.getTaskStatus(a);return c?Te(c):L(404,"Task not found")}return L(404,"Not found")}}function es(e){return{mode:"ready",artifact:e.artifact}}function ts(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 i=await e.runtime.runWorkflow({workflowId:t,input:n.payload,taskId:n.task.taskId});return i.state==="ready"?es(i):ts(i)}}function rs(e){if(e.status==="ready")return{status:"completed",state:"ready",artifact:e.artifact};return{id:e.taskId,status:"working",state:e.status}}function ns(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 Oe(e,t){return{jsonrpc:"2.0",id:e,result:t}}function z(e,t,r){return{jsonrpc:"2.0",id:e,error:{code:t,message:r}}}function is(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=is(e.baseUrl,e.card),r=e.agentCardPath??"/.well-known/agent.json",n=e.rpcPath??"/api/a2a",i=async(s)=>{let a=s.id??null;try{switch(s.method){case"agent.getCard":return Oe(a,t);case"component.request":{let c=s.params??{},l=typeof c.name==="string"?c.name:"";if(!l)return z(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 Oe(a,{task:rs(p)})}case"tasks.get":{let c=s.params??{},l=typeof c.taskId==="string"?c.taskId:"";if(!l)return z(a,-32602,"Field 'taskId' is required");let p=e.service.getTaskStatus(l);if(!p)return z(a,-32004,"Task not found");return Oe(a,{task:ns(p)})}}}catch(c){return z(a,-32000,c instanceof Error?c.message:"A2A request failed")}};return{card:t,handleJsonRpc:i,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(z(null,-32700,"Invalid JSON payload"),400)}let l=await i(c),p="error"in l?400:200;return pe(l,p)}return pe({error:"Not found"},404)}}}var as={spec:["html","markdown","zip"],prototype:["html","zip"],deck:["html","pptx","zip"],poster:["html","zip"]},mc=Array.from(new Set(Object.values(as).flat()));var De=["component","template","design-guide","example","skill","block","package","theme"],Be=["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 cs=["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"],kc=[...cs,"radius","font-display","font-body","font-mono"];var Lr=["resource-mcp-invalid-argument","resource-query-failed"];function _(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 Br(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 ds(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 P(e){return{content:[{type:"json",json:e}]}}function k(e){return{content:[{type:"text",text:e}],isError:!0}}function fe(e,t){return{content:[{type:"json",json:{error:{code:e,detail:t}}}],isError:!0}}var W="uibot_resource_";function ps(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:[...Be]};else if(e==="positive-integer")r={type:"integer",minimum:1};else r={type:"string"};return t?{type:"array",items:r}:r}function gs(){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:ps(e.name),description:e.summary,inputSchema:{type:"object",properties:t,additionalProperties:!1,...r.length?{required:r}:{}}}})}class A extends Error{detail;code=Lr[0];constructor(e){super(e);this.detail=e;this.name="ResourceMcpArgumentError"}}function G(e,t){let r=new Set(t),n=Object.keys(e).find((i)=>!r.has(i));if(n)throw new A(`unsupported argument: ${n}`)}function ge(e,t){let r=e[t];if(r===void 0)return;if(typeof r!=="string"||!r.trim())throw new A(`${t} must be a non-empty string`);return r}function O(e,t,r){let n=e[t];if(n===void 0)return;if(!Array.isArray(n)||n.length===0||n.some((i)=>typeof i!=="string"||!i.trim()))throw new A(`${t} must be a non-empty string array`);if(r){let i=n.find((o)=>!r.includes(o));if(i)throw new A(`${t} contains unsupported value: ${i}`)}return n}function fs(e){if(e instanceof A)return fe(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 fe(t.code,r)}}return fe(Lr[1],"resource query callback failed")}async function ms(e,t,r){try{if(e==="manifest")return G(t,[]),P({data:{index:await r.manifest()}});if(e==="search"){G(t,["text","kinds","tags","categories","capabilities","maturities","functions","scenarios","units","industries","limit"]);let i=ge(t,"text"),o=O(t,"kinds",De),s=O(t,"tags"),a=O(t,"categories"),c=O(t,"capabilities"),l=O(t,"maturities",Be),p=Object.fromEntries(["functions","scenarios","units","industries"].flatMap((g)=>{let K=O(t,g);return K?[[g,K]]:[]})),y=t.limit;if(y!==void 0&&(typeof y!=="number"||!Number.isInteger(y)||y<=0))throw new A("limit must be a positive integer");let h={...p,...i?{text:i}:{},...o?{kinds:o}:{},...s?{tags:s}:{},...a?{categories:a}:{},...c?{capabilities:c}:{},...l?{maturities:l}:{},...typeof y==="number"?{limit:y}:{}};return P({data:{matches:await r.search(h)}})}if(e==="get"){G(t,["id"]);let i=ge(t,"id");if(!i)throw new A("id must be a non-empty string");return P({data:{resource:await r.get(i)}})}if(e==="docs"||e==="examples"||e==="install-plan"){G(t,e==="docs"?["id","locale","page"]:e==="examples"?["id","page"]:["id"]);let i=ge(t,"id");if(!i)throw new A("id must be a non-empty string");let o=ge(t,"locale");if(o&&o!=="zh"&&o!=="en")throw new A("locale must be zh or en");if(!(e==="docs"?r.docs:e==="examples"?r.examples:r.installPlan))return k(_(e,e));let a=t.page;if(a!==void 0&&(typeof a!=="number"||!Number.isSafeInteger(a)||a<1))throw new A("page must be a positive integer");let c=e==="docs"?await r.docs?.(i,o,a):e==="examples"?await r.examples?.(i,a):await r.installPlan?.(i);return P({data:c})}G(t,["roots"]);let n=O(t,"roots");if(!n)throw new A("roots must be a non-empty string array");return P({data:{plan:await r.build(n)}})}catch(n){return fs(n)}}function ud(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 run deterministic autofix (unless `autofix: false`), strictly compile it against the catalog and return JSON-path gaps, warnings and multi-page route reachability; or pass `html` to run design-quality rules.",inputSchema:{type:"object",properties:{spec:{description:"UIBot Spec object, or its JSON/YAML text"},html:{type:"string",description:"Generated HTML document"},autofix:{type:"boolean",description:"Automatically repair undeclared page.state roots, misplaced block fields, duplicate ids and relative paths before strict compilation (default: true)"}}}},{name:"uibot_spec_compose",description:"Compose a valid multi-page UIBot Spec 2.0 application deterministically from an AppBlueprint (pages, solutions/variants, shellVariant, entities, mock collections and theme) without hand-authoring full JSON.",inputSchema:{type:"object",properties:{title:{type:"string",description:"Application title"},shellVariant:{type:"string",description:"Target L4 shell variant id (e.g. admin-sidebar, top-navbar, console-drilldown)"},pages:{type:"array",description:"Blueprint page entries ({ solutionId, familyId, variantId, path, title, configuration } or custom blocks pages)"},entities:{type:"object",description:"Data entities map keyed by entity name"},connections:{type:"array",description:"Collection connection definitions ({ id, entity, mockSeed, mockGenerate })"},mockSeed:{type:"object",description:"Optional entity-keyed seed arrays used to populate mock collections"},layout:{type:"object",description:"Optional global AppLayoutOptions overrides"},design:{type:"object",description:"Optional UIBotDesignSystem metadata"},menus:{type:"object",description:"Optional navigation menu configuration"},auth:{type:"object",description:"Optional AuthConfig metadata"},autofix:{type:"boolean",description:"Run deterministic autofix after composing (default: true)"},format:{type:"string",enum:["json","yaml"],description:"Output serialization format: 'json' returns `spec` (default), 'yaml' returns `yaml`"}},required:["pages"]}},{name:"uibot_variant_list",description:"List switchable UIBot variant families (L1-L4) with semantic slot contracts, variant IDs and optional matches against a supplied Spec.",inputSchema:{type:"object",properties:{familyId:{type:"string",description:"Exact variant family id (e.g. shell.workspace.v1)"},resourceId:{type:"string",description:"Filter families containing this resource id"},level:{type:"string",enum:["L1","L2","L3","L4"],description:"Capability level filter"},targetKind:{type:"string",enum:["shell","page","frame","section","block"],description:"Target kind filter"},query:{type:"string",description:"Substring search across family/variant metadata"},spec:{description:"Optional UIBot Spec (object or JSON/YAML string) to annotate currentMatches"}}}},{name:"uibot_spec_swap",description:"Losslessly swap an L1-L4 variant (shell, page, frame, section or block) inside an existing UIBot Spec using semantic slot projection and return unmappedWarnings without dropping bindings.",inputSchema:{type:"object",properties:{spec:{description:"Source UIBot Spec object or JSON/YAML text"},target:{type:"object",description:"Swap target descriptor: { kind: 'shell'|'page'|'frame'|'section'|'block', pageId?, blockId?, role? }"},targetVariant:{type:"string",description:"Target variant id"},targetVariantId:{type:"string",description:"Alias of targetVariant"},familyId:{type:"string",description:"Optional explicit variant family id"},preserveCustomizations:{type:"boolean",description:"Preserve customized props/titles/events across swap (default: true)"},pageMapping:{type:"object",description:"Optional page id/path overrides when swapping"},autofix:{type:"boolean",description:"Run deterministic autofix after swap (default: true)"},format:{type:"string",enum:["json","yaml"],description:"Output serialization format: 'json' returns `spec` (default), 'yaml' returns `yaml`"}},required:["spec","target"]}},{name:"uibot_spec_patch",description:"Apply an atomic sequence of surgical SpecPatchOp mutations (insertBlock, replaceBlock, removeBlock, moveBlock, updateProps, setEvents, addPage, removePage, updatePage, setPageState, upsertEntity, upsertConnection, setLayout, swapVariant) with full rollback on error.",inputSchema:{type:"object",properties:{spec:{description:"Source UIBot Spec object or JSON/YAML text"},operations:{type:"array",description:"Ordered SpecPatchOp[] list"},autofix:{type:"boolean",description:"Run deterministic autofix after patching (default: true)"},format:{type:"string",enum:["json","yaml"],description:"Output serialization format: 'json' returns `spec` (default), 'yaml' returns `yaml`"}},required:["spec","operations"]}},...gs()],r={uibot_spec_compose:"compose",uibot_variant_list:"listVariants",uibot_spec_swap:"swap",uibot_spec_patch:"patch"};return{listTools(){return t.filter((n)=>{if(n.name==="uibot_request_component")return e.serviceAvailable!==!1;if(n.name==="uibot_get_task_status")return e.serviceAvailable!==!1;if(n.name==="uibot_list_catalog")return e.discovery?.listCatalog!=null;if(n.name==="uibot_get_design_md")return e.discovery?.getDesignMd!=null;if(n.name==="uibot_list_templates")return e.discovery?.listTemplates!=null;if(n.name==="uibot_validate")return e.validate!=null;if(n.name in r){let i=r[n.name];return typeof e.specOps?.[i]==="function"}if(n.name.startsWith(W)){let i=n.name.slice(W.length),o=i==="install-plan"?"installPlan":i;return e.resourceQuery!=null&&typeof e.resourceQuery[o]==="function"}return!0})},async callTool(n,i){if(n.startsWith(W)){let o=n.slice(W.length);if(!Ne.some((a)=>a.name===o))return k(`Unknown tool: ${n}`);if(!e.resourceQuery)return k(_(n,"resourceQuery"));return ms(o,i,e.resourceQuery)}if(n==="uibot_request_component"){if(e.serviceAvailable===!1)return k(Br(n));let o=typeof i.name==="string"?i.name:"";if(!o)return k("Field 'name' is required");let s=await e.service.requestComponent({name:o,...typeof i.context==="string"?{context:i.context}:{},...typeof i.requestedBy==="string"?{requestedBy:i.requestedBy}:{},...i.priority==="low"||i.priority==="normal"||i.priority==="high"?{priority:i.priority}:{}});return P(ds(s))}if(n==="uibot_get_task_status"){if(e.serviceAvailable===!1)return k(Br(n));let o=typeof i.taskId==="string"?i.taskId:"";if(!o)return k("Field 'taskId' is required");let s=e.service.getTaskStatus(o);return s?P(us(s)):k("Task not found")}if(n==="uibot_list_catalog"){let o=e.discovery?.listCatalog;if(!o)return k(_(n,"listCatalog"));let s=await o(),a=Array.isArray(s)?s:[],c=typeof i.query==="string"?i.query.toLowerCase():"",l=c?a.filter((p)=>JSON.stringify(p).toLowerCase().includes(c)):a;return P({items:l,count:l.length})}if(n==="uibot_get_design_md"){let o=e.discovery?.getDesignMd;if(!o)return k(_(n,"getDesignMd"));let s=typeof i.id==="string"?i.id:void 0,a=await o(s)??(s?null:[]);return P({id:s??null,data:a})}if(n==="uibot_list_templates"){let o=e.discovery?.listTemplates;if(!o)return k(_(n,"listTemplates"));let s=await o(),a=Array.isArray(s)?s:[],c=typeof i.query==="string"?i.query.toLowerCase():"",l=c?a.filter((p)=>JSON.stringify(p).toLowerCase().includes(c)):a;return P({items:l,count:l.length})}if(n in r){let o=r[n],s=e.specOps?.[o];if(!s)return k(_(n,`specOps.${o}`));try{return P(await s(i))}catch(a){if(a&&typeof a==="object"&&"code"in a){let c=a;if(typeof c.code==="string"){let l=typeof c.detail==="string"?c.detail:typeof c.message==="string"?c.message:c.code;return fe(c.code,l)}}return k(a instanceof Error?a.message:String(a))}}if(n==="uibot_validate"){if(!e.validate)return k(`Tool '${n}' is not wired in this build: no 'validate' provider was supplied.`);let o=typeof i.html==="string"?i.html:void 0;if(i.spec===void 0&&o===void 0)return k("Provide 'spec' or 'html'");if(i.autofix!==void 0&&typeof i.autofix!=="boolean")return k("Field 'autofix' must be a boolean");try{return P(await e.validate({...i.spec===void 0?{}:{spec:i.spec},...o===void 0?{}:{html:o},...typeof i.autofix==="boolean"?{autofix:i.autofix}:{}}))}catch(s){return k(s instanceof Error?s.message:String(s))}}return k(`Unknown tool: ${n}`)}}}export{Lr as RESOURCE_MCP_ERROR_CODES,is as createDefaultUIBotHubA2AAgentCard,Yo as createDefaultUIBotHubBlueprint,Tr as createInMemoryUIBotHubTaskStore,Ia as createUIBotHubA2AHandler,ha as createUIBotHubHttpHandler,ud as createUIBotHubMcpAdapter,da as createUIBotHubPlugin,fa as createUIBotHubService,Ca as createUIBotHubWorkflowRequestRunner,Ee as normalizeHubBasePath};
|
package/dist/mcp.d.ts
CHANGED
|
@@ -37,6 +37,12 @@ export interface UIBotHubResourceQueryCallbacks {
|
|
|
37
37
|
examples?(id: string, page?: number): Promise<unknown> | unknown;
|
|
38
38
|
installPlan?(id: string): Promise<unknown> | unknown;
|
|
39
39
|
}
|
|
40
|
+
export interface UIBotHubSpecOpsCallbacks {
|
|
41
|
+
compose?(args: Record<string, unknown>): Promise<unknown> | unknown;
|
|
42
|
+
listVariants?(args: Record<string, unknown>): Promise<unknown> | unknown;
|
|
43
|
+
swap?(args: Record<string, unknown>): Promise<unknown> | unknown;
|
|
44
|
+
patch?(args: Record<string, unknown>): Promise<unknown> | unknown;
|
|
45
|
+
}
|
|
40
46
|
export interface CreateUIBotHubMcpAdapterOptions {
|
|
41
47
|
service: UIBotHubService;
|
|
42
48
|
/**
|
|
@@ -64,6 +70,11 @@ export interface CreateUIBotHubMcpAdapterOptions {
|
|
|
64
70
|
* Hub runtime owns only MCP transport mapping and never imports registry.
|
|
65
71
|
*/
|
|
66
72
|
resourceQuery?: UIBotHubResourceQueryCallbacks;
|
|
73
|
+
/**
|
|
74
|
+
* Pure-compute Spec composition, variant inspection/swap and atomic patch
|
|
75
|
+
* callbacks (ADR 0015). Omitted callbacks are not advertised in listTools.
|
|
76
|
+
*/
|
|
77
|
+
specOps?: UIBotHubSpecOpsCallbacks;
|
|
67
78
|
/**
|
|
68
79
|
* Validates a generated artifact before an agent hands it on: a UIBot Spec
|
|
69
80
|
* (object, or JSON/YAML text) is compiled against the catalog; HTML is checked
|
|
@@ -72,6 +83,7 @@ export interface CreateUIBotHubMcpAdapterOptions {
|
|
|
72
83
|
validate?: (input: {
|
|
73
84
|
spec?: unknown;
|
|
74
85
|
html?: string;
|
|
86
|
+
autofix?: boolean;
|
|
75
87
|
}) => Promise<unknown> | unknown;
|
|
76
88
|
}
|
|
77
89
|
export declare function createUIBotHubMcpAdapter(options: CreateUIBotHubMcpAdapterOptions): UIBotHubMcpAdapter;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uibot/hub-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.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.22.0",
|
|
31
|
+
"@uibot/plugin-sdk": "^0.22.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@uibot/application": "^0.
|
|
34
|
+
"@uibot/application": "^0.22.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",
|