@cloudbase/cloudbase-mcp
Version:
腾讯云开发 MCP Server,通过AI提示词和MCP协议+云开发,让开发更智能、更高效,当你在Cursor/ VSCode GitHub Copilot/WinSurf/CodeBuddy/Augment Code/Claude Code等AI编程工具里写代码时,它能自动帮你生成可直接部署的前后端应用+小程序,并一键发布到腾讯云开发 CloudBase。
2 lines • 4.61 MB
JavaScript
#!/usr/bin/env node
(()=>{var e={71:(e,t,n)=>{"use strict";e.exports={CRC32Stream:n(35485),DeflateCRC32Stream:n(40951)}},85:(e,t,n)=>{var a=n(28354),r=n(28768);function i(e,t,n){e[t]=function(){return delete e[t],n.apply(this,arguments),this[t].apply(this,arguments)}}function o(e,t){if(!(this instanceof o))return new o(e,t);r.call(this,t),i(this,"_read",function(){var n=e.call(this,t),a=this.emit.bind(this,"error");n.on("error",a),n.pipe(this)}),this.emit("readable")}function s(e,t){if(!(this instanceof s))return new s(e,t);r.call(this,t),i(this,"_write",function(){var n=e.call(this,t),a=this.emit.bind(this,"error");n.on("error",a),this.pipe(n)}),this.emit("writable")}e.exports={Readable:o,Writable:s},a.inherits(o,r),a.inherits(s,r)},95:function(e,t,n){"use strict";var a=this&&this.__decorate||function(e,t,n,a){var r,i=arguments.length,o=i<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,a);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(o=(i<3?r(o):i>3?r(t,n,o):r(t,n))||o);return i>3&&o&&Object.defineProperty(t,n,o),o},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CloudRunService=void 0,t.codeToZip=u,t.parseObjectToDiffConfigItem=d;const i=r(n(99133)),o=n(21605),s=r(n(39902)),c=n(62358);class l{constructor(e){this.environment=e,this.tcbrService=new c.CloudService(e.cloudBaseContext,"tcbr","2022-02-17"),this.tcbService=new c.CloudService(e.cloudBaseContext,"tcb","2018-06-08")}async init(e){const{serverName:t,template:n="helloworld",targetPath:a="."}=e||{},r=(await this.getTemplates()).find(e=>e.identifier===n);if(!r||!r.zipFileStore)throw new Error(`未找到匹配的模板: ${n}`);const i=r.zipFileStore,o=s.default.resolve(a,t);return await(0,c.downloadAndExtractRemoteZip)(i,o),{projectDir:o}}async download(e){var t,n;const a=this.environment.lazyEnvironmentConfig,{serverName:r,targetPath:i}=e,o=null===(n=null===(t=(await this.detail({serverName:r})).OnlineVersionInfos)||void 0===t?void 0:t[0])||void 0===n?void 0:n.VersionName;if(!o)throw new Error("未找到云托管服务版本");const l=await this.tcbService.request("DescribeCloudBaseBuildService",{EnvId:a.EnvId,ServiceName:r,ServiceVersion:o});if(!(null==l?void 0:l.DownloadUrl))throw new Error(`云托管代码下载地址为空(请求ID: ${l.RequestId})`);await(0,c.downloadAndExtractRemoteZip)(null==l?void 0:l.DownloadUrl,s.default.resolve(i))}async list(e){const t=this.environment.lazyEnvironmentConfig;return this.tcbrService.request("DescribeCloudRunServers",Object.assign({EnvId:t.EnvId},{PageSize:(null==e?void 0:e.pageSize)||10,PageNum:(null==e?void 0:e.pageNum)||1,ServerName:null==e?void 0:e.serverName,ServerType:null==e?void 0:e.serverType}))}async detail(e){const t=this.environment.lazyEnvironmentConfig;return this.tcbrService.request("DescribeCloudRunServerDetail",{EnvId:t.EnvId,ServerName:e.serverName})}async delete(e){const t=this.environment.lazyEnvironmentConfig;return this.tcbrService.request("DeleteCloudRunServer",{EnvId:t.EnvId,ServerName:e.serverName})}async deploy(e){const{serverName:t,targetPath:n=process.cwd(),serverConfig:a}=e;if(!t)throw new Error("Missing required parameters: serviceName");const r=this.environment.lazyEnvironmentConfig,{UploadUrl:i,UploadHeaders:l,PackageName:p,PackageVersion:d}=await this.tcbService.request("DescribeCloudBaseBuildService",{EnvId:r.EnvId,ServiceName:t}),m={DeployType:"package",PackageName:p,PackageVersion:d},f=await u(n,{installDependency:void 0===(null==a?void 0:a.InstallDependency)||a.InstallDependency});if(await(0,c.upload)({url:i,file:f,headers:(l||[]).reduce((e,t)=>(e[t.Key]=t.Value,e),{})||{},method:"PUT"}),await this._checkFunctionExist(t)){const e=await this.detail({serverName:t}),n=Object.assign(Object.assign(Object.assign({},a),{OpenAccessTypes:["OA","PUBLIC","MINIAPP"]}),"function:"===(null==e?void 0:e.ServerConfig.Tag)?{Port:3e3}:{});return"function:"===(null==e?void 0:e.ServerConfig.Tag)&&(m.BuildPacks={LanguageVersion:"20.18",RepoLanguage:"Node.js"}),m.ReleaseType="FULL",this._upsertFunction(!1,{name:t,deployInfo:m,serverConfig:n})}{let e="function";((null==a?void 0:a.Dockerfile)||await(0,o.pathExists)(s.default.join(n,"Dockerfile")))&&(e="container"),"function"===e&&(m.BuildPacks={LanguageVersion:"20.18",RepoLanguage:"Node.js"});const i=Object.assign(Object.assign(Object.assign({OpenAccessTypes:["OA","PUBLIC","MINIAPP"],MinNum:0,EnvParams:JSON.stringify({}),InitialDelaySeconds:0,CustomLogs:"",HasDockerfile:!0,CreateTime:"",EnvId:r.EnvId,ServerName:t,Port:"container"===e?80:3e3,Dockerfile:"Dockerfile",BuildDir:""},a),"function"===e?{Port:3e3}:{}),{Tag:"container"===e?"":"function:"});return this._upsertFunction(!0,{name:t,deployInfo:m,serverConfig:i})}}async getTemplates(){return(0,c.fetchTemplates)(["tcbrFunc","tcbrContainer"])}async _checkFunctionExist(e){try{return await this.detail({serverName:e}),!0}catch(e){if("ResourceNotFound"===e.code||"InvalidParameter"===e.code&&"service data illegal"===e.original.Message)return!1;throw e}}_upsertFunction(e,t){const{name:n,deployInfo:a,serverConfig:r}=t,i=this.environment.lazyEnvironmentConfig,o=d(r);return this.tcbrService.request(e?"CreateCloudRunServer":"UpdateCloudRunServer",{EnvId:i.EnvId,ServerName:n,DeployInfo:a,Items:o})}}async function u(e,t){const n=(0,i.default)("zip",{zlib:{level:1}}),a=[],r=new Promise((e,t)=>{n.on("data",e=>{a.push(e)}),n.on("end",()=>{e(Buffer.concat(a))}),n.on("error",e=>{t(e)})});return await async function e(a,r=!1,i=""){const c=await(0,o.readdir)(a,{withFileTypes:!0});for(let o of c){const c=s.default.join(a,o.name),l=s.default.join(i,o.name);if(o.isDirectory()){if(["logs",".git"].includes(o.name))continue;if((null==t?void 0:t.installDependency)&&["node_modules"].includes(o.name))continue;await e(c,!1,l)}else{if(r&&[""].includes(o.name))continue;n.file(c,{name:l})}}}(s.default.resolve(e),!0),await n.finalize(),r}t.CloudRunService=l,a([(0,c.preLazy)()],l.prototype,"init",null),a([(0,c.preLazy)()],l.prototype,"download",null),a([(0,c.preLazy)()],l.prototype,"list",null),a([(0,c.preLazy)()],l.prototype,"detail",null),a([(0,c.preLazy)()],l.prototype,"delete",null),a([(0,c.preLazy)()],l.prototype,"deploy",null);const p={Cpu:"CpuSpecs",Mem:"MemSpecs",OpenAccessTypes:"AccessTypes",EnvParams:"EnvParam",CustomLogs:"LogPath"};function d(e){const t=Object.entries(e),n=[];return t.forEach(([e,t])=>{const a=p[e]||e;["CustomLogs","EnvParams","CreateTime","Dockerfile","BuildDir","LogType","LogSetId","LogTopicId","LogParseType","Tag","InternalAccess","InternalDomain","OperationMode","SessionAffinity"].includes(e)?t&&n.push({Key:a,Value:t}):["MinNum","MaxNum","InitialDelaySeconds","Port"].includes(e)?n.push({Key:a,IntValue:t}):["HasDockerfile"].includes(e)?n.push({Key:a,BoolValue:t}):["Cpu","Mem"].includes(e)?n.push({Key:a,FloatValue:t}):["OpenAccessTypes","EntryPoint","Cmd"].includes(e)?n.push({Key:a,ArrayValue:t}):["PolicyDetails"].includes(e)?n.push({Key:a,PolicyDetails:t}):["TimerScale"].includes(e)&&n.push({Key:a,TimerScale:t})}),n}},119:function(e,t,n){!function(e){"use strict";var t={1:"۱",2:"۲",3:"۳",4:"۴",5:"۵",6:"۶",7:"۷",8:"۸",9:"۹",0:"۰"},n={"۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9","۰":"0"};e.defineLocale("fa",{months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),weekdays:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysShort:"یکشنبه_دوشنبه_سهشنبه_چهارشنبه_پنجشنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekdaysParseExact:!0,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiemParse:/قبل از ظهر|بعد از ظهر/,isPM:function(e){return/بعد از ظهر/.test(e)},meridiem:function(e,t,n){return e<12?"قبل از ظهر":"بعد از ظهر"},calendar:{sameDay:"[امروز ساعت] LT",nextDay:"[فردا ساعت] LT",nextWeek:"dddd [ساعت] LT",lastDay:"[دیروز ساعت] LT",lastWeek:"dddd [پیش] [ساعت] LT",sameElse:"L"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",ss:"%d ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"},preparse:function(e){return e.replace(/[۰-۹]/g,function(e){return n[e]}).replace(/،/g,",")},postformat:function(e){return e.replace(/\d/g,function(e){return t[e]}).replace(/,/g,"،")},dayOfMonthOrdinalParse:/\d{1,2}م/,ordinal:"%dم",week:{dow:6,doy:12}})}(n(95093))},149:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(39902),r=n(98631),i=n(57705);t.default=class{constructor(e){this._settings=e,this._fsStatSettings=new r.Settings({followSymbolicLink:this._settings.followSymbolicLinks,fs:this._settings.fs,throwErrorOnBrokenSymbolicLink:this._settings.followSymbolicLinks})}_getFullEntryPath(e){return a.resolve(this._settings.cwd,e)}_makeEntry(e,t){const n={name:t,path:t,dirent:i.fs.createDirentFromStats(t,e)};return this._settings.stats&&(n.stats=e),n}_isFatalError(e){return!i.errno.isEnoentCodeError(e)&&!this._settings.suppressErrors}}},199:(e,t,n)=>{const a=n(28354),r=n(74075),i=n(27910),o=n(17437),s=n(12994),c=n(51324),l=n(58189),u=n(3214),p=i.pipeline,d=n(8325),m=Buffer.alloc(4);function f(e){if(!(this instanceof f))return new f(e);const t=this;t._opts=e||{verbose:!1},o.call(t,t._opts),t.on("finish",function(){t.emit("end"),t.emit("close")}),t._readRecord().catch(function(e){t.__emittedError&&t.__emittedError===e||t.emit("error",e)})}m.writeUInt32LE(101010256,0),a.inherits(f,o),f.prototype._readRecord=function(){const e=this;return e.pull(4).then(function(t){if(0===t.length)return;const n=t.readUInt32LE(0);if(875721283===n)return e._readCrxHeader();if(67324752===n)return e._readFile();if(33639248===n)return e.reachedCD=!0,e._readCentralDirectoryFileHeader();if(101010256===n)return e._readEndOfCentralDirectoryRecord();if(e.reachedCD){const t=!0;return e.pull(m,t).then(function(){return e._readEndOfCentralDirectoryRecord()})}e.emit("error",new Error("invalid signature: 0x"+n.toString(16)))}).then(function(t){if(t)return e._readRecord()})},f.prototype._readCrxHeader=function(){const e=this;return e.pull(12).then(function(t){return e.crxHeader=d.parse(t,[["version",4],["pubKeyLength",4],["signatureLength",4]]),e.pull(e.crxHeader.pubKeyLength+e.crxHeader.signatureLength)}).then(function(t){return e.crxHeader.publicKey=t.slice(0,e.crxHeader.pubKeyLength),e.crxHeader.signature=t.slice(e.crxHeader.pubKeyLength),e.emit("crx-header",e.crxHeader),!0})},f.prototype._readFile=function(){const e=this;return e.pull(26).then(function(t){const n=d.parse(t,[["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2]]);return n.lastModifiedDateTime=u(n.lastModifiedDate,n.lastModifiedTime),e.crxHeader&&(n.crxHeader=e.crxHeader),e.pull(n.fileNameLength).then(function(t){const a=t.toString("utf8"),o=i.PassThrough();let u=!1;return o.autodrain=function(){u=!0;const e=o.pipe(s());return e.promise=function(){return new Promise(function(t,n){e.on("finish",t),e.on("error",n)})},e},o.buffer=function(){return c(o)},o.path=a,o.props={},o.props.path=a,o.props.pathBuffer=t,o.props.flags={isUnicode:!!(2048&n.flags)},o.type=0===n.uncompressedSize&&/[/\\]$/.test(a)?"Directory":"File",e._opts.verbose&&("Directory"===o.type?console.log(" creating:",a):"File"===o.type&&(0===n.compressionMethod?console.log(" extracting:",a):console.log(" inflating:",a))),e.pull(n.extraFieldLength).then(function(t){const s=l(t,n);o.vars=n,o.extra=s,e._opts.forceStream?e.push(o):(e.emit("entry",o),(e._readableState.pipesCount||e._readableState.pipes&&e._readableState.pipes.length)&&e.push(o)),e._opts.verbose&&console.log({filename:a,vars:n,extra:s});const c=!(8&n.flags)||n.compressedSize>0;let d;o.__autodraining=u;const m=n.compressionMethod&&!u?r.createInflateRaw():i.PassThrough();return c?(o.size=n.uncompressedSize,d=n.compressedSize):(d=Buffer.alloc(4),d.writeUInt32LE(134695760,0)),new Promise(function(t,n){p(e.stream(d),m,o,function(a){return a?n(a):c?t(c):e._processDataDescriptor(o).then(t).catch(n)})})})})})},f.prototype._processDataDescriptor=function(e){return this.pull(16).then(function(t){const n=d.parse(t,[["dataDescriptorSignature",4],["crc32",4],["compressedSize",4],["uncompressedSize",4]]);return e.size=n.uncompressedSize,!0})},f.prototype._readCentralDirectoryFileHeader=function(){const e=this;return e.pull(42).then(function(t){const n=d.parse(t,[["versionMadeBy",2],["versionsNeededToExtract",2],["flags",2],["compressionMethod",2],["lastModifiedTime",2],["lastModifiedDate",2],["crc32",4],["compressedSize",4],["uncompressedSize",4],["fileNameLength",2],["extraFieldLength",2],["fileCommentLength",2],["diskNumber",2],["internalFileAttributes",2],["externalFileAttributes",4],["offsetToLocalFileHeader",4]]);return e.pull(n.fileNameLength).then(function(t){return n.fileName=t.toString("utf8"),e.pull(n.extraFieldLength)}).then(function(){return e.pull(n.fileCommentLength)}).then(function(){return!0})})},f.prototype._readEndOfCentralDirectoryRecord=function(){const e=this;return e.pull(18).then(function(t){const n=d.parse(t,[["diskNumber",2],["diskStart",2],["numberOfRecordsOnDisk",2],["numberOfRecords",2],["sizeOfCentralDirectory",4],["offsetToStartOfCentralDirectory",4],["commentLength",2]]);return e.pull(n.commentLength).then(function(){e.end(),e.push(null)})})},f.prototype.promise=function(){const e=this;return new Promise(function(t,n){e.on("finish",t),e.on("error",n)})},e.exports=f},247:e=>{"use strict";e.exports=JSON.parse('{"$id":"query.json#","$schema":"http://json-schema.org/draft-06/schema#","type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"},"comment":{"type":"string"}}}')},259:e=>{function t(e){this.name="Bzip2Error",this.message=e,this.stack=(new Error).stack}t.prototype=new Error;var n=function(e){throw new t(e)},a={};a.Bzip2Error=t,a.crcTable=[0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188],a.array=function(e){var t=0,n=0,a=[0,1,3,7,15,31,63,127,255];return function(r){for(var i=0;r>0;){var o=8-t;r>=o?(i<<=o,i|=a[o]&e[n++],t=0,r-=o):(i<<=r,i|=(e[n]&a[r]<<8-r-t)>>8-r-t,t+=r,r=0)}return i}},a.simple=function(e,t){var n=a.array(e),r=!1,i=1e5*a.header(n),o=new Int32Array(i);do{r=a.decompress(n,t,o,i)}while(!r)},a.header=function(e){this.byteCount=new Int32Array(256),this.symToByte=new Uint8Array(256),this.mtfSymbol=new Int32Array(256),this.selectors=new Uint8Array(32768),4348520!=e(24)&&n("No magic number found");var t=e(8)-48;return(t<1||t>9)&&n("Not a BZIP archive"),t},a.decompress=function(e,t,a,r,i){for(var o=-1,s="",c=0;c<6;c++)s+=e(8).toString(16);if("177245385090"==s)return(0|e(32))!==i&&n("Error in bzip2: crc32 do not match"),e(null),null;"314159265359"!=s&&n("eek not valid bzip data");var l=0|e(32);e(1)&&n("unsupported obsolete version");var u=e(24);u>r&&n("Initial position larger than buffer size");var p=e(16),d=0;for(c=0;c<16;c++)if(p&1<<15-c){var m=e(16);for(g=0;g<16;g++)m&1<<15-g&&(this.symToByte[d++]=16*c+g)}var f=e(3);(f<2||f>6)&&n("another error");var h=e(15);for(0==h&&n("meh"),c=0;c<f;c++)this.mtfSymbol[c]=c;for(c=0;c<h;c++){for(var g=0;e(1);g++)g>=f&&n("whoops another error");var v=this.mtfSymbol[g];for(m=g-1;m>=0;m--)this.mtfSymbol[m+1]=this.mtfSymbol[m];this.mtfSymbol[0]=v,this.selectors[c]=v}var y,b,_,x,w=d+2,k=[],S=new Uint8Array(258),E=new Uint16Array(21);for(g=0;g<f;g++){for(p=e(5),c=0;c<w;c++){for(;(p<1||p>20)&&n("I gave up a while ago on writing error messages"),e(1);)e(1)?p--:p++;S[c]=p}var j,D;for(j=D=S[0],c=1;c<w;c++)S[c]>D?D=S[c]:S[c]<j&&(j=S[c]);(y=k[g]={}).permute=new Int32Array(258),y.limit=new Int32Array(21),y.base=new Int32Array(21),y.minLen=j,y.maxLen=D;var T=y.base,C=y.limit,L=0;for(c=j;c<=D;c++)for(p=0;p<w;p++)S[p]==c&&(y.permute[L++]=p);for(c=j;c<=D;c++)E[c]=C[c]=0;for(c=0;c<w;c++)E[S[c]]++;for(L=p=0,c=j;c<D;c++)L+=E[c],C[c]=L-1,L<<=1,T[c+1]=L-(p+=E[c]);C[D]=L+E[D]-1,T[j]=0}for(c=0;c<256;c++)this.mtfSymbol[c]=c,this.byteCount[c]=0;for(b=_=w=x=0;;){for(w--||(w=49,x>=h&&n("meow i'm a kitty, that's an error"),T=(y=k[this.selectors[x++]]).base,C=y.limit),g=e(c=y.minLen);c>y.maxLen&&n("rawr i'm a dinosaur"),!(g<=C[c]);)c++,g=g<<1|e(1);((g-=T[c])<0||g>=258)&&n("moo i'm a cow");var O=y.permute[g];if(0!=O&&1!=O){if(b)for(b=0,_+p>r&&n("Boom."),v=this.symToByte[this.mtfSymbol[0]],this.byteCount[v]+=p;p--;)a[_++]=v;if(O>d)break;for(_>=r&&n("I can't think of anything. Error"),c=O-1,v=this.mtfSymbol[c],m=c-1;m>=0;m--)this.mtfSymbol[m+1]=this.mtfSymbol[m];this.mtfSymbol[0]=v,v=this.symToByte[v],this.byteCount[v]++,a[_++]=v}else b||(b=1,p=0),p+=0==O?b:2*b,b<<=1}for((u<0||u>=_)&&n("I'm a monkey and I'm throwing something at someone, namely you"),g=0,c=0;c<256;c++)m=g+this.byteCount[c],this.byteCount[c]=g,g=m;for(c=0;c<_;c++)v=255&a[c],a[this.byteCount[v]]|=c<<8,this.byteCount[v]++;var M,P,A,I=0,R=0,N=0;for(_&&(R=255&(I=a[u]),I>>=8,N=-1);_;){for(_--,P=R,R=255&(I=a[I]),I>>=8,3==N++?(M=R,A=P,R=-1):(M=1,A=R);M--;)o=4294967295&(o<<8^this.crcTable[255&(o>>24^A)]),t(A);R!=P&&(N=0)}return(0|(o=(-1^o)>>>0))!=(0|l)&&n("Error in bzip2: crc32 do not match"),4294967295&(o^(i<<1|i>>>31))},e.exports=a},270:(e,t,n)=>{"use strict";const a=n(53908),r=n(78311);e.exports=(e,t,n)=>{let i=null,o=null,s=null;try{s=new r(t,n)}catch(e){return null}return e.forEach(e=>{s.test(e)&&(i&&1!==o.compare(e)||(i=e,o=new a(i,n)))}),i}},528:e=>{"use strict";e.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const n=e.indexOf(t);return-1===n?[e]:[e.slice(0,n),e.slice(n+t.length)]}},555:(e,t,n)=>{"use strict";const a=n(62711),{warn:r}=n(92159);t.version=n(6256).version,t.transports=n(23475),t.config=n(4575),t.addColors=a.levels,t.format=a.format,t.createLogger=n(2751),t.Logger=n(68010),t.ExceptionHandler=n(70504),t.RejectionHandler=n(42134),t.Container=n(47083),t.Transport=n(83623),t.loggers=new t.Container;const i=t.createLogger();Object.keys(t.config.npm.levels).concat(["log","query","stream","add","remove","clear","profile","startTimer","handleExceptions","unhandleExceptions","handleRejections","unhandleRejections","configure","child"]).forEach(e=>t[e]=(...t)=>i[e](...t)),Object.defineProperty(t,"level",{get:()=>i.level,set(e){i.level=e}}),Object.defineProperty(t,"exceptions",{get:()=>i.exceptions}),Object.defineProperty(t,"rejections",{get:()=>i.rejections}),["exitOnError"].forEach(e=>{Object.defineProperty(t,e,{get:()=>i[e],set(t){i[e]=t}})}),Object.defineProperty(t,"default",{get:()=>({exceptionHandlers:i.exceptionHandlers,rejectionHandlers:i.rejectionHandlers,transports:i.transports})}),r.deprecated(t,"setLevels"),r.forFunctions(t,"useFormat",["cli"]),r.forProperties(t,"useFormat",["padLevels","stripColors"]),r.forFunctions(t,"deprecated",["addRewriter","addFilter","clone","extend"]),r.forProperties(t,"deprecated",["emitErrs","levelLength"])},622:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.simplifyEnvList=l,t.registerEnvTools=function(e){const t=e.cloudBaseOptions,n=()=>(0,i.getCloudBaseManager)({cloudBaseOptions:t,mcpServer:e}),u="string"==typeof t?.envId&&t?.envId.length>0;e.registerTool?.("login",{title:"登录云开发",description:"登录云开发环境,在生成包含云开发 CloudBase 相关功能前**必须**先调用此工具进行登录。登录云开发环境并选择要使用的环境。",inputSchema:{forceUpdate:a.z.boolean().optional().describe("是否强制重新选择环境")},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0,category:"env"}},async({forceUpdate:t=!1})=>{let n=!1;try{for(;;){(0,o.debug)("[env] Calling _promptAndSetEnvironmentId with server:",{hasServer:!!e,serverType:typeof e,hasServerServer:!!e?.server,hasServerIde:!!e?.ide,serverIde:e?.ide});const{selectedEnvId:a,cancelled:l,error:u,noEnvs:p,switch:d}=await(0,s._promptAndSetEnvironmentId)(t,{server:e,loginFromCloudBaseLoginPage:n,ignoreEnvVars:n});if(n=Boolean(d),(0,o.debug)("login",{selectedEnvId:a,cancelled:l,error:u,noEnvs:p,switchAccount:d}),u)return{content:[{type:"text",text:u}]};if(l)return{content:[{type:"text",text:"用户取消了登录"}]};if(d){(0,o.debug)("User requested switch account, logging out...");try{await(0,r.logout)(),(0,i.resetCloudBaseManagerCache)(),(0,o.debug)("Logged out successfully, restarting login flow..."),n=!0;continue}catch(e){(0,o.debug)("Logout failed during switch",{error:e});continue}}if(a){let t="";if("CodeBuddy"!==(e.ide||process.env.INTEGRATION_IDE))try{t=await(0,c.getClaudePrompt)()}catch(e){(0,o.debug)("Failed to get CLAUDE prompt",{error:e})}return{content:[{type:"text",text:`✅ 登录成功,当前环境: ${a}`+(t?`\n\n⚠️ 重要提示:后续所有云开发相关的开发工作必须严格遵循以下开发规范和最佳实践:\n\n${t}`:"")}]}}throw new Error("登录失败")}}catch(e){return{content:[{type:"text",text:`登录失败: ${e instanceof Error?e.message:String(e)}`}]}}}),e.registerTool?.("logout",{title:"退出登录",description:"退出云开发环境",inputSchema:{confirm:a.z.literal("yes").describe("确认操作,默认传 yes")},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!0,openWorldHint:!1,category:"env"}},async()=>{try{return await(0,r.logout)(),(0,i.resetCloudBaseManagerCache)(),{content:[{type:"text",text:"✅ 已退出登录"}]}}catch(e){return{content:[{type:"text",text:`退出失败: ${e instanceof Error?e.message:String(e)}`}]}}}),e.registerTool?.("envQuery",{title:"环境查询",description:"查询云开发环境相关信息,支持查询环境列表、当前环境信息、安全域名和静态网站托管配置。(原工具名:listEnvs/getEnvInfo/getEnvAuthDomains/getWebsiteConfig,为兼容旧AI规则可继续使用这些名称)",inputSchema:{action:a.z.enum(["list","info","domains","hosting"]).describe("查询类型:list=环境列表,info=当前环境信息,domains=安全域名列表,hosting=静态网站托管配置")},annotations:{readOnlyHint:!0,openWorldHint:!0,category:"env"}},async({action:a})=>{try{let r;switch(a){case"list":try{const n=await(0,i.getCloudBaseManager)({cloudBaseOptions:t,requireEnvId:!0,mcpServer:e});r=await n.commonService("tcb").call({Action:"DescribeEnvs",Param:{EnvTypes:["weda","baas"],IsVisible:!1,Channels:["dcloud","iotenable","tem","scene_module"]}}),(0,i.logCloudBaseResult)(e.logger,r),r&&r.EnvList?r={EnvList:r.EnvList}:r&&r.Data&&r.Data.EnvList?r={EnvList:r.Data.EnvList}:((0,o.debug)("Unexpected response format, falling back to listEnvs()"),r=await n.env.listEnvs(),(0,i.logCloudBaseResult)(e.logger,r)),r&&Array.isArray(r.EnvList)&&(r.EnvList=l(r.EnvList))}catch(n){(0,o.debug)("获取环境列表时出错,尝试降级到 listEnvs():",n instanceof Error?n:new Error(String(n)));try{const n=await(0,i.getCloudBaseManager)({cloudBaseOptions:t,requireEnvId:!0,mcpServer:e});r=await n.env.listEnvs(),(0,i.logCloudBaseResult)(e.logger,r),r&&Array.isArray(r.EnvList)&&(r.EnvList=l(r.EnvList))}catch(e){return(0,o.debug)("降级到 listEnvs() 也失败:",e instanceof Error?e:new Error(String(e))),{content:[{type:"text",text:"获取环境列表时出错: "+(e instanceof Error?e.message:String(e))}]}}}u&&r&&Array.isArray(r.EnvList)&&r.EnvList.length>1&&(r.EnvList=r.EnvList.filter(e=>e.EnvId===t?.envId));break;case"info":const s=await n();r=await s.env.getEnvInfo(),(0,i.logCloudBaseResult)(e.logger,r);break;case"domains":const c=await n();r=await c.env.getEnvAuthDomains(),(0,i.logCloudBaseResult)(e.logger,r);break;case"hosting":const p=await n();r=await p.hosting.getWebsiteConfig(),(0,i.logCloudBaseResult)(e.logger,r);break;default:throw new Error(`不支持的查询类型: ${a}`)}let s=JSON.stringify(r,null,2);const p=e.ide||process.env.INTEGRATION_IDE;if("info"===a&&"CodeBuddy"!==p)try{const e=await(0,c.getClaudePrompt)();e&&(s+=`\n\n⚠️ 重要提示:后续所有云开发相关的开发工作必须严格遵循以下开发规范和最佳实践:\n\n${e}`)}catch(e){(0,o.debug)("Failed to get CLAUDE prompt in envQuery",{error:e})}return{content:[{type:"text",text:s}]}}catch(e){return{content:[{type:"text",text:`环境查询失败: ${e instanceof Error?e.message:String(e)}`}]}}}),e.registerTool?.("envDomainManagement",{title:"环境域名管理",description:"管理云开发环境的安全域名,支持添加和删除操作。(原工具名:createEnvDomain/deleteEnvDomain,为兼容旧AI规则可继续使用这些名称)",inputSchema:{action:a.z.enum(["create","delete"]).describe("操作类型:create=添加域名,delete=删除域名"),domains:a.z.array(a.z.string()).describe("安全域名数组")},annotations:{readOnlyHint:!1,destructiveHint:!1,idempotentHint:!1,openWorldHint:!0,category:"env"}},async({action:t,domains:a})=>{try{const r=await n();let o;switch(t){case"create":o=await r.env.createEnvDomain(a),(0,i.logCloudBaseResult)(e.logger,o);break;case"delete":o=await r.env.deleteEnvDomain(a),(0,i.logCloudBaseResult)(e.logger,o);break;default:throw new Error(`不支持的操作类型: ${t}`)}return{content:[{type:"text",text:`${JSON.stringify(o,null,2)}\n\n请注意安全域名需要10分钟才能生效,用户也应该了解这一点。`}]}}catch(e){return{content:[{type:"text",text:`域名管理操作失败: ${e instanceof Error?e.message:String(e)}`}]}}})};const a=n(21614),r=n(77291),i=n(3431),o=n(13039),s=n(3461),c=n(64215);function l(e){return Array.isArray(e)?e.map(e=>{const t={};return void 0!==e.EnvId&&(t.EnvId=e.EnvId),void 0!==e.Alias&&(t.Alias=e.Alias),void 0!==e.Status&&(t.Status=e.Status),void 0!==e.EnvType&&(t.EnvType=e.EnvType),void 0!==e.Region&&(t.Region=e.Region),void 0!==e.PackageName&&(t.PackageName=e.PackageName),void 0!==e.IsDefault&&(t.IsDefault=e.IsDefault),t}):e}},687:(e,t,n)=>{var a=n(19534).BigInteger,r=n(92236).ECCurveFp;function i(e,t,n,a){this.curve=e,this.g=t,this.n=n,this.h=a}function o(e){return new a(e,16)}i.prototype.getCurve=function(){return this.curve},i.prototype.getG=function(){return this.g},i.prototype.getN=function(){return this.n},i.prototype.getH=function(){return this.h},e.exports={secp128r1:function(){var e=o("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF"),t=o("FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC"),n=o("E87579C11079F43DD824993C2CEE5ED3"),s=o("FFFFFFFE0000000075A30D1B9038A115"),c=a.ONE,l=new r(e,t,n),u=l.decodePointHex("04161FF7528B899B2D0C28607CA52C5B86CF5AC8395BAFEB13C02DA292DDED7A83");return new i(l,u,s,c)},secp160k1:function(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73"),t=a.ZERO,n=o("7"),s=o("0100000000000000000001B8FA16DFAB9ACA16B6B3"),c=a.ONE,l=new r(e,t,n),u=l.decodePointHex("043B4C382CE37AA192A4019E763036F4F5DD4D7EBB938CF935318FDCED6BC28286531733C3F03C4FEE");return new i(l,u,s,c)},secp160r1:function(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF"),t=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC"),n=o("1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45"),s=o("0100000000000000000001F4C8F927AED3CA752257"),c=a.ONE,l=new r(e,t,n),u=l.decodePointHex("044A96B5688EF573284664698968C38BB913CBFC8223A628553168947D59DCC912042351377AC5FB32");return new i(l,u,s,c)},secp192k1:function(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37"),t=a.ZERO,n=o("3"),s=o("FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D"),c=a.ONE,l=new r(e,t,n),u=l.decodePointHex("04DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D");return new i(l,u,s,c)},secp192r1:function(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF"),t=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC"),n=o("64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1"),s=o("FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831"),c=a.ONE,l=new r(e,t,n),u=l.decodePointHex("04188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF101207192B95FFC8DA78631011ED6B24CDD573F977A11E794811");return new i(l,u,s,c)},secp224r1:function(){var e=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001"),t=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE"),n=o("B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4"),s=o("FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D"),c=a.ONE,l=new r(e,t,n),u=l.decodePointHex("04B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34");return new i(l,u,s,c)},secp256r1:function(){var e=o("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF"),t=o("FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC"),n=o("5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B"),s=o("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551"),c=a.ONE,l=new r(e,t,n),u=l.decodePointHex("046B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C2964FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5");return new i(l,u,s,c)}}},743:(e,t,n)=>{var a=n(28354).inherits,r=n(89007).ZipArchiveOutputStream,i=n(89007).ZipArchiveEntry,o=n(97727),s=e.exports=function(e){if(!(this instanceof s))return new s(e);(e=this.options=e||{}).zlib=e.zlib||{},r.call(this,e),"number"==typeof e.level&&e.level>=0&&(e.zlib.level=e.level,delete e.level),e.forceZip64||"number"!=typeof e.zlib.level||0!==e.zlib.level||(e.store=!0),e.namePrependSlash=e.namePrependSlash||!1,e.comment&&e.comment.length>0&&this.setComment(e.comment)};a(s,r),s.prototype._normalizeFileData=function(e){var t="directory"===(e=o.defaults(e,{type:"file",name:null,namePrependSlash:this.options.namePrependSlash,linkname:null,date:null,mode:null,store:this.options.store,comment:""})).type,n="symlink"===e.type;return e.name&&(e.name=o.sanitizePath(e.name),n||"/"!==e.name.slice(-1)?t&&(e.name+="/"):(t=!0,e.type="directory")),(t||n)&&(e.store=!0),e.date=o.dateify(e.date),e},s.prototype.entry=function(e,t,n){if("function"!=typeof n&&(n=this._emitErrorCallback.bind(this)),"file"===(t=this._normalizeFileData(t)).type||"directory"===t.type||"symlink"===t.type)if("string"==typeof t.name&&0!==t.name.length){if("symlink"!==t.type||"string"==typeof t.linkname){var a=new i(t.name);return a.setTime(t.date,this.options.forceLocalTime),t.namePrependSlash&&a.setName(t.name,!0),t.store&&a.setMethod(0),t.comment.length>0&&a.setComment(t.comment),"symlink"===t.type&&"number"!=typeof t.mode&&(t.mode=40960),"number"==typeof t.mode&&("symlink"===t.type&&(t.mode|=40960),a.setUnixMode(t.mode)),"symlink"===t.type&&"string"==typeof t.linkname&&(e=Buffer.from(t.linkname)),r.prototype.entry.call(this,a,e,n)}n(new Error("entry linkname must be a non-empty string value when type equals symlink"))}else n(new Error("entry name must be a non-empty string value"));else n(new Error(t.type+" entries not currently supported"))},s.prototype.finalize=function(){this.finish()}},757:(e,t,n)=>{"use strict";var a=n(79551),r=n(54926),i=n(70388),o=n(12550),s=n(15442),c=n(55511),l=n(92861).Buffer;function u(e){this.request=e,this.params=null}u.prototype.buildParams=function(e,t,n,a,r,i){var c={};for(var l in e)c["oauth_"+l]=e[l];c.oauth_version||(c.oauth_version="1.0"),c.oauth_timestamp||(c.oauth_timestamp=Math.floor(Date.now()/1e3).toString()),c.oauth_nonce||(c.oauth_nonce=o().replace(/-/g,"")),c.oauth_signature_method||(c.oauth_signature_method="HMAC-SHA1");var u=c.oauth_consumer_secret||c.oauth_private_key;delete c.oauth_consumer_secret,delete c.oauth_private_key;var p=c.oauth_token_secret;delete c.oauth_token_secret;var d=c.oauth_realm;delete c.oauth_realm,delete c.oauth_transport_method;var m=t.protocol+"//"+t.host+t.pathname,f=i.parse([].concat(a,r,i.stringify(c)).join("&"));return c.oauth_signature=s.sign(c.oauth_signature_method,n,m,f,u,p),d&&(c.realm=d),c},u.prototype.buildBodyHash=function(e,t){["HMAC-SHA1","RSA-SHA1"].indexOf(e.signature_method||"HMAC-SHA1")<0&&this.request.emit("error",new Error("oauth: "+e.signature_method+" signature_method not supported with body_hash signing."));var n=c.createHash("sha1");n.update(t||"");var a=n.digest("hex");return l.from(a,"hex").toString("base64")},u.prototype.concatParams=function(e,t,n){n=n||"";var a=Object.keys(e).filter(function(e){return"realm"!==e&&"oauth_signature"!==e}).sort();return e.realm&&a.splice(0,0,"realm"),a.push("oauth_signature"),a.map(function(t){return t+"="+n+s.rfc3986(e[t])+n}).join(t)},u.prototype.onRequest=function(e){var t=this;t.params=e;var n,o,s=t.request.uri||{},c=t.request.method||"",l=i(t.request.headers),u=t.request.body||"",p=t.request.qsLib||r,d=l.get("content-type")||"",m="application/x-www-form-urlencoded",f=e.transport_method||"header";d.slice(0,33)===m&&(d=m,n=u),s.query&&(o=s.query),"body"!==f||"POST"===c&&d===m||t.request.emit("error",new Error("oauth: transport_method of body requires POST and content-type "+m)),n||"boolean"!=typeof e.body_hash||(e.body_hash=t.buildBodyHash(e,t.request.body.toString()));var h=t.buildParams(e,s,c,o,n,p);switch(f){case"header":t.request.setHeader("Authorization","OAuth "+t.concatParams(h,",",'"'));break;case"query":var g=t.request.uri.href+=(o?"&":"?")+t.concatParams(h,"&");t.request.uri=a.parse(g),t.request.path=t.request.uri.path;break;case"body":t.request.body=(n?n+"&":"")+t.concatParams(h,"&");break;default:t.request.emit("error",new Error("oauth: transport_method invalid"))}},t.W=u},920:(e,t,n)=>{"use strict";var a=n(69675),r=n(58859),i=n(14803),o=n(80507),s=n(72271)||o||i;e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new a("Side channel does not contain "+r(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,n){e||(e=s()),e.set(t,n)}};return t}},1045:e=>{"use strict";e.exports=JSON.parse('{"$id":"cache.json#","$schema":"http://json-schema.org/draft-06/schema#","properties":{"beforeRequest":{"oneOf":[{"type":"null"},{"$ref":"beforeRequest.json#"}]},"afterRequest":{"oneOf":[{"type":"null"},{"$ref":"afterRequest.json#"}]},"comment":{"type":"string"}}}')},1143:(e,t,n)=>{var a=n(12412),r=n(28354);function i(e){var t,n,i,o,l,u,p,d,m,f=["([^%]*)","%","(['\\-+ #0]*?)","([1-9]\\d*)?","(\\.([1-9]\\d*))?","[lhjztL]*?","([diouxXfFeEgGaAcCsSp%jr])"].join(""),h=new RegExp(f),g=Array.prototype.slice.call(arguments,1),v="",y=1;for(a.equal("string",typeof e);null!==(m=h.exec(e));)if(v+=m[1],e=e.substring(m[0].length),t=m[2]||"",n=m[3]||0,i=m[4]||"",l=!1,p=!1,u=" ","%"!=(o=m[6])){if(0===g.length)throw new Error("too few args to sprintf");if(d=g.shift(),y++,t.match(/[\' #]/))throw new Error("unsupported flags: "+t);if(i.length>0)throw new Error("non-zero precision not supported");switch(t.match(/-/)&&(l=!0),t.match(/0/)&&(u="0"),t.match(/\+/)&&(p=!0),o){case"s":if(null==d)throw new Error("argument "+y+": attempted to print undefined or null as a string");v+=s(u,n,l,d.toString());break;case"d":d=Math.floor(d);case"f":v+=(p=p&&d>0?"+":"")+s(u,n,l,d.toString());break;case"x":v+=s(u,n,l,d.toString(16));break;case"j":0===n&&(n=10),v+=r.inspect(d,!1,n);break;case"r":v+=c(d);break;default:throw new Error("unsupported conversion: "+o)}}else v+="%";return v+e}function o(e){var t=Array.prototype.slice.call(arguments,1);return e.write(i.apply(this,t))}function s(e,t,n,a){for(var r=a;r.length<t;)n?r+=e:r=e+r;return r}function c(e){var t;if(!(e instanceof Error))throw new Error(i("invalid type for %%r: %j",e));if(t="EXCEPTION: "+e.constructor.name+": "+e.stack,e.cause&&"function"==typeof e.cause){var n=e.cause();n&&(t+="\nCaused by: "+c(n))}return t}t.sprintf=i,t.printf=function(){var e=Array.prototype.slice.call(arguments);e.unshift(process.stdout),o.apply(null,e)},t.fprintf=o},1221:function(e,t,n){!function(e){"use strict";var t=["جنوري","فيبروري","مارچ","اپريل","مئي","جون","جولاءِ","آگسٽ","سيپٽمبر","آڪٽوبر","نومبر","ڊسمبر"],n=["آچر","سومر","اڱارو","اربع","خميس","جمع","ڇنڇر"];e.defineLocale("sd",{months:t,monthsShort:t,weekdays:n,weekdaysShort:n,weekdaysMin:n,longDateFormat:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},meridiemParse:/صبح|شام/,isPM:function(e){return"شام"===e},meridiem:function(e,t,n){return e<12?"صبح":"شام"},calendar:{sameDay:"[اڄ] LT",nextDay:"[سڀاڻي] LT",nextWeek:"dddd [اڳين هفتي تي] LT",lastDay:"[ڪالهه] LT",lastWeek:"[گزريل هفتي] dddd [تي] LT",sameElse:"L"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",ss:"%d سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"},preparse:function(e){return e.replace(/،/g,",")},postformat:function(e){return e.replace(/,/g,"،")},week:{dow:1,doy:4}})}(n(95093))},1239:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const a=n(99029),r=n(94227),i=n(62586),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>a.str`should match "${e.ifClause}" schema`,params:({params:e})=>a._`{failingKeyword: ${e.ifClause}}`},code(e){const{gen:t,parentSchema:n,it:r}=e;void 0===n.then&&void 0===n.else&&i.checkStrictMode(r,'"if" without "then" and "else" is ignored');const o=s(r,"then"),c=s(r,"else");if(!o&&!c)return;const l=t.let("valid",!0),u=t.name("_valid");if(function(){const t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}(),e.reset(),o&&c){const n=t.let("ifClause");e.setParams({ifClause:n}),t.if(u,p("then",n),p("else",n))}else o?t.if(u,p("then")):t.if(a.not(u),p("else"));function p(n,r){return()=>{const i=e.subschema({keyword:n},u);t.assign(l,u),e.mergeValidEvaluated(i,l),r?t.assign(r,a._`${n}`):e.setParams({ifClause:n})}}e.pass(l,()=>e.error(!0))}};function s(e,t){const n=e.schema[t];return void 0!==n&&!r.alwaysValidSchema(e,n)}t.default=o},1243:(e,t)=>{const n={INVALID_LOC:"Invalid LOC header (bad signature)",INVALID_CEN:"Invalid CEN header (bad signature)",INVALID_END:"Invalid END header (bad signature)",DESCRIPTOR_NOT_EXIST:"No descriptor present",DESCRIPTOR_UNKNOWN:"Unknown descriptor format",DESCRIPTOR_FAULTY:"Descriptor data is malformed",NO_DATA:"Nothing to decompress",BAD_CRC:"CRC32 checksum failed {0}",FILE_IN_THE_WAY:"There is a file in the way: {0}",UNKNOWN_METHOD:"Invalid/unsupported compression method",AVAIL_DATA:"inflate::Available inflate data did not terminate",INVALID_DISTANCE:"inflate::Invalid literal/length or distance code in fixed or dynamic block",TO_MANY_CODES:"inflate::Dynamic block code description: too many length or distance codes",INVALID_REPEAT_LEN:"inflate::Dynamic block code description: repeat more than specified lengths",INVALID_REPEAT_FIRST:"inflate::Dynamic block code description: repeat lengths with no first length",INCOMPLETE_CODES:"inflate::Dynamic block code description: code lengths codes incomplete",INVALID_DYN_DISTANCE:"inflate::Dynamic block code description: invalid distance code lengths",INVALID_CODES_LEN:"inflate::Dynamic block code description: invalid literal/length code lengths",INVALID_STORE_BLOCK:"inflate::Stored block length did not match one's complement",INVALID_BLOCK_TYPE:"inflate::Invalid block type (type == 3)",CANT_EXTRACT_FILE:"Could not extract the file",CANT_OVERRIDE:"Target file already exists",DISK_ENTRY_TOO_LARGE:"Number of disk entries is too large",NO_ZIP:"No zip file was loaded",NO_ENTRY:"Entry doesn't exist",DIRECTORY_CONTENT_ERROR:"A directory cannot have content",FILE_NOT_FOUND:'File not found: "{0}"',NOT_IMPLEMENTED:"Not implemented",INVALID_FILENAME:"Invalid filename",INVALID_FORMAT:"Invalid or unsupported zip format. No END header found",INVALID_PASS_PARAM:"Incompatible password parameter",WRONG_PASSWORD:"Wrong Password",COMMENT_TOO_LONG:"Comment is too long",EXTRA_FIELD_PARSE_ERROR:"Extra field parsing error"};function a(e){return function(...t){return t.length&&(e=e.replace(/\{(\d)\}/g,(e,n)=>t[n]||"")),new Error("ADM-ZIP: "+e)}}for(const e of Object.keys(n))t[e]=a(n[e])},1283:e=>{"use strict";e.exports=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)var n={__proto__:t(e)};else n=Object.create(null);return Object.getOwnPropertyNames(e).forEach(function(t){Object.defineProperty(n,t,Object.getOwnPropertyDescriptor(e,t))}),n};var t=Object.getPrototypeOf||function(e){return e.__proto__}},1294:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UnsubscribeRequestSchema=t.SubscribeRequestSchema=t.ResourceListChangedNotificationSchema=t.ReadResourceResultSchema=t.ReadResourceRequestSchema=t.ListResourceTemplatesResultSchema=t.ListResourceTemplatesRequestSchema=t.ListResourcesResultSchema=t.ListResourcesRequestSchema=t.ResourceTemplateSchema=t.ResourceSchema=t.BlobResourceContentsSchema=t.TextResourceContentsSchema=t.ResourceContentsSchema=t.PaginatedResultSchema=t.PaginatedRequestSchema=t.ProgressNotificationSchema=t.ProgressSchema=t.PingRequestSchema=t.isInitializedNotification=t.InitializedNotificationSchema=t.InitializeResultSchema=t.ServerCapabilitiesSchema=t.isInitializeRequest=t.InitializeRequestSchema=t.ClientCapabilitiesSchema=t.ImplementationSchema=t.BaseMetadataSchema=t.CancelledNotificationSchema=t.EmptyResultSchema=t.JSONRPCMessageSchema=t.isJSONRPCError=t.JSONRPCErrorSchema=t.ErrorCode=t.isJSONRPCResponse=t.JSONRPCResponseSchema=t.isJSONRPCNotification=t.JSONRPCNotificationSchema=t.isJSONRPCRequest=t.JSONRPCRequestSchema=t.RequestIdSchema=t.ResultSchema=t.NotificationSchema=t.RequestSchema=t.CursorSchema=t.ProgressTokenSchema=t.JSONRPC_VERSION=t.SUPPORTED_PROTOCOL_VERSIONS=t.DEFAULT_NEGOTIATED_PROTOCOL_VERSION=t.LATEST_PROTOCOL_VERSION=void 0,t.ClientResultSchema=t.ClientNotificationSchema=t.ClientRequestSchema=t.RootsListChangedNotificationSchema=t.ListRootsResultSchema=t.ListRootsRequestSchema=t.RootSchema=t.CompleteResultSchema=t.CompleteRequestSchema=t.PromptReferenceSchema=t.ResourceReferenceSchema=t.ResourceTemplateReferenceSchema=t.ElicitResultSchema=t.ElicitRequestSchema=t.PrimitiveSchemaDefinitionSchema=t.EnumSchemaSchema=t.NumberSchemaSchema=t.StringSchemaSchema=t.BooleanSchemaSchema=t.CreateMessageResultSchema=t.CreateMessageRequestSchema=t.SamplingMessageSchema=t.ModelPreferencesSchema=t.ModelHintSchema=t.LoggingMessageNotificationSchema=t.SetLevelRequestSchema=t.LoggingLevelSchema=t.ToolListChangedNotificationSchema=t.CallToolRequestSchema=t.CompatibilityCallToolResultSchema=t.CallToolResultSchema=t.ListToolsResultSchema=t.ListToolsRequestSchema=t.ToolSchema=t.ToolAnnotationsSchema=t.PromptListChangedNotificationSchema=t.GetPromptResultSchema=t.PromptMessageSchema=t.ContentBlockSchema=t.ResourceLinkSchema=t.EmbeddedResourceSchema=t.AudioContentSchema=t.ImageContentSchema=t.TextContentSchema=t.GetPromptRequestSchema=t.ListPromptsResultSchema=t.ListPromptsRequestSchema=t.PromptSchema=t.PromptArgumentSchema=t.ResourceUpdatedNotificationSchema=void 0,t.McpError=t.ServerResultSchema=t.ServerNotificationSchema=t.ServerRequestSchema=void 0;const a=n(21614);t.LATEST_PROTOCOL_VERSION="2025-06-18",t.DEFAULT_NEGOTIATED_PROTOCOL_VERSION="2025-03-26",t.SUPPORTED_PROTOCOL_VERSIONS=[t.LATEST_PROTOCOL_VERSION,"2025-03-26","2024-11-05","2024-10-07"],t.JSONRPC_VERSION="2.0",t.ProgressTokenSchema=a.z.union([a.z.string(),a.z.number().int()]),t.CursorSchema=a.z.string();const r=a.z.object({progressToken:a.z.optional(t.ProgressTokenSchema)}).passthrough(),i=a.z.object({_meta:a.z.optional(r)}).passthrough();t.RequestSchema=a.z.object({method:a.z.string(),params:a.z.optional(i)});const o=a.z.object({_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough();var s;t.NotificationSchema=a.z.object({method:a.z.string(),params:a.z.optional(o)}),t.ResultSchema=a.z.object({_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),t.RequestIdSchema=a.z.union([a.z.string(),a.z.number().int()]),t.JSONRPCRequestSchema=a.z.object({jsonrpc:a.z.literal(t.JSONRPC_VERSION),id:t.RequestIdSchema}).merge(t.RequestSchema).strict(),t.isJSONRPCRequest=e=>t.JSONRPCRequestSchema.safeParse(e).success,t.JSONRPCNotificationSchema=a.z.object({jsonrpc:a.z.literal(t.JSONRPC_VERSION)}).merge(t.NotificationSchema).strict(),t.isJSONRPCNotification=e=>t.JSONRPCNotificationSchema.safeParse(e).success,t.JSONRPCResponseSchema=a.z.object({jsonrpc:a.z.literal(t.JSONRPC_VERSION),id:t.RequestIdSchema,result:t.ResultSchema}).strict(),t.isJSONRPCResponse=e=>t.JSONRPCResponseSchema.safeParse(e).success,function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"}(s||(t.ErrorCode=s={})),t.JSONRPCErrorSchema=a.z.object({jsonrpc:a.z.literal(t.JSONRPC_VERSION),id:t.RequestIdSchema,error:a.z.object({code:a.z.number().int(),message:a.z.string(),data:a.z.optional(a.z.unknown())})}).strict(),t.isJSONRPCError=e=>t.JSONRPCErrorSchema.safeParse(e).success,t.JSONRPCMessageSchema=a.z.union([t.JSONRPCRequestSchema,t.JSONRPCNotificationSchema,t.JSONRPCResponseSchema,t.JSONRPCErrorSchema]),t.EmptyResultSchema=t.ResultSchema.strict(),t.CancelledNotificationSchema=t.NotificationSchema.extend({method:a.z.literal("notifications/cancelled"),params:o.extend({requestId:t.RequestIdSchema,reason:a.z.string().optional()})}),t.BaseMetadataSchema=a.z.object({name:a.z.string(),title:a.z.optional(a.z.string())}).passthrough(),t.ImplementationSchema=t.BaseMetadataSchema.extend({version:a.z.string()}),t.ClientCapabilitiesSchema=a.z.object({experimental:a.z.optional(a.z.object({}).passthrough()),sampling:a.z.optional(a.z.object({}).passthrough()),elicitation:a.z.optional(a.z.object({}).passthrough()),roots:a.z.optional(a.z.object({listChanged:a.z.optional(a.z.boolean())}).passthrough())}).passthrough(),t.InitializeRequestSchema=t.RequestSchema.extend({method:a.z.literal("initialize"),params:i.extend({protocolVersion:a.z.string(),capabilities:t.ClientCapabilitiesSchema,clientInfo:t.ImplementationSchema})}),t.isInitializeRequest=e=>t.InitializeRequestSchema.safeParse(e).success,t.ServerCapabilitiesSchema=a.z.object({experimental:a.z.optional(a.z.object({}).passthrough()),logging:a.z.optional(a.z.object({}).passthrough()),completions:a.z.optional(a.z.object({}).passthrough()),prompts:a.z.optional(a.z.object({listChanged:a.z.optional(a.z.boolean())}).passthrough()),resources:a.z.optional(a.z.object({subscribe:a.z.optional(a.z.boolean()),listChanged:a.z.optional(a.z.boolean())}).passthrough()),tools:a.z.optional(a.z.object({listChanged:a.z.optional(a.z.boolean())}).passthrough())}).passthrough(),t.InitializeResultSchema=t.ResultSchema.extend({protocolVersion:a.z.string(),capabilities:t.ServerCapabilitiesSchema,serverInfo:t.ImplementationSchema,instructions:a.z.optional(a.z.string())}),t.InitializedNotificationSchema=t.NotificationSchema.extend({method:a.z.literal("notifications/initialized")}),t.isInitializedNotification=e=>t.InitializedNotificationSchema.safeParse(e).success,t.PingRequestSchema=t.RequestSchema.extend({method:a.z.literal("ping")}),t.ProgressSchema=a.z.object({progress:a.z.number(),total:a.z.optional(a.z.number()),message:a.z.optional(a.z.string())}).passthrough(),t.ProgressNotificationSchema=t.NotificationSchema.extend({method:a.z.literal("notifications/progress"),params:o.merge(t.ProgressSchema).extend({progressToken:t.ProgressTokenSchema})}),t.PaginatedRequestSchema=t.RequestSchema.extend({params:i.extend({cursor:a.z.optional(t.CursorSchema)}).optional()}),t.PaginatedResultSchema=t.ResultSchema.extend({nextCursor:a.z.optional(t.CursorSchema)}),t.ResourceContentsSchema=a.z.object({uri:a.z.string(),mimeType:a.z.optional(a.z.string()),_meta:a.z.optional(a.z.object({}).passthrough())}).passthrough(),t.TextResourceContentsSchema=t.ResourceContentsSchema.extend({text:a.z.string()}),t.BlobResourceContentsSchema=t.ResourceContentsSchema.extend({blob:a.z.string().base64()}),t.ResourceSchema=t.BaseMetadataSchema.extend({uri:a.z.string(),description:a.z.optional(a.z.string()),mimeType:a.z.optional(a.z.string()),_meta:a.z.optional(a.z.object({}).passthrough())}),t.ResourceTemplateSchema=t.BaseMe