@microi.net/cli 5.7.5 → 5.7.7

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.
@@ -27,10 +27,10 @@ Content-Type: application/octet-stream\r
27
27
  \r
28
28
  `,"utf8"),f=Buffer.concat([...p,m]),y=Buffer.from(`\r
29
29
  --${u}--\r
30
- `,"utf8"),S=o?this.getTokenForServer(g,o.osClient,o.osClientType,o.osClientNetwork):await this.loadToken(),h=d.protocol==="https:",C=h?Qt:Yt,T=d.pathname.replace(/\/+$/,""),b={hostname:d.hostname,port:d.port||(h?443:80),path:T+e,method:"POST",timeout:a,rejectUnauthorized:this._strictTlsHosts.has(d.hostname.toLowerCase()),headers:{Accept:"application/json",...S?{Authorization:`Bearer ${S}`}:{},did:this.getDeviceId(),...o?.osClient?{OsClient:o.osClient}:{},"Content-Type":`multipart/form-data; boundary=${u}`,"Content-Length":f.length+l.size+y.length}};return new Promise((v,k)=>{let V=!1,Q=O=>{V||(V=!0,k(O))},N=C.request(b,O=>{let M=[];O.on("data",P=>M.push(P)),O.on("end",async()=>{if(V)return;let P=Buffer.concat(M).toString("utf8"),x;try{x=JSON.parse(P)}catch{Q(new Error(`\u6D41\u5F0F\u4E0A\u4F20\u54CD\u5E94\u4E0D\u662F JSON\uFF08HTTP ${O.statusCode||0}\uFF09`));return}let z=String(O.headers.authorization||"");z&&await this.setToken(z,g,o?.osClient,o?.osClientType,o?.osClientNetwork),V=!0,v(x)})});N.on("error",O=>Q(new Error(`\u6D41\u5F0F\u4E0A\u4F20\u5931\u8D25\uFF1A${vt(O)}`))),N.on("timeout",()=>{N.destroy(),Q(new Error(`\u6D41\u5F0F\u4E0A\u4F20\u8D85\u65F6\uFF08${a}ms\uFF09`))}),N.write(f);let R=it.createReadStream(c);R.on("error",O=>{N.destroy(),Q(new Error(`\u8BFB\u53D6\u672C\u5730\u53D1\u5E03\u8D44\u4EA7\u5931\u8D25\uFF1A${vt(O)}`))}),R.on("end",()=>N.end(y)),R.pipe(N,{end:!1})})}};var ot=B(require("crypto")),W=B(require("fs")),_t=B(require("path"));var Dt=B(require("child_process")),Lr=require("crypto"),ne=B(require("fs")),nn=B(require("path")),Rt=".microi-workspace-secrets.dpapi.json",Br=["Add-Type -AssemblyName System.Security;","$inputBase64 = [Console]::In.ReadToEnd().Trim();","$plain = [Convert]::FromBase64String($inputBase64);","$cipher = [Security.Cryptography.ProtectedData]::Protect($plain, $null, [Security.Cryptography.DataProtectionScope]::CurrentUser);","[Console]::Out.Write([Convert]::ToBase64String($cipher));"].join(" "),Ur=["Add-Type -AssemblyName System.Security;","$inputBase64 = [Console]::In.ReadToEnd().Trim();","$cipher = [Convert]::FromBase64String($inputBase64);","$plain = [Security.Cryptography.ProtectedData]::Unprotect($cipher, $null, [Security.Cryptography.DataProtectionScope]::CurrentUser);","[Console]::Out.Write([Convert]::ToBase64String($plain));"].join(" ");function Zt(s,e){if(process.platform!=="win32")throw new Error("\u5F53\u524D\u64CD\u4F5C\u7CFB\u7EDF\u4E0D\u652F\u6301 Windows DPAPI \u5DE5\u4F5C\u533A\u51ED\u636E\u4FDD\u9669\u5E93");let t=process.env.SystemRoot||"C:\\Windows",n=nn.join(t,"System32","WindowsPowerShell","v1.0","powershell.exe"),r=Dt.spawnSync(n,["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-Command",s],{input:e.toString("base64"),encoding:"utf8",windowsHide:!0,maxBuffer:4*1024*1024,timeout:15e3});if(r.error||r.status!==0||!String(r.stdout||"").trim())throw new Error("Windows DPAPI \u64CD\u4F5C\u5931\u8D25\uFF1B\u51ED\u636E\u672A\u5199\u5165\u660E\u6587\u6587\u4EF6");return Buffer.from(String(r.stdout).trim(),"base64")}function Zs(s){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,s)}var jn="dpapi-session-v1:",Pt="keychain-session-v1:",Un="net.microi.cli.workspace.v1",jr="net.microi.cli.session.v1",Kr=s=>(0,Lr.createHash)("sha256").update(s).digest("hex");function Kn(s,e){if(process.platform!=="darwin")throw new Error("macOS Keychain is unavailable on this platform");let t=Dt.spawnSync("/usr/bin/security",["find-generic-password","-s",s,"-a",e,"-w"],{encoding:"utf8",timeout:15e3,maxBuffer:4*1024*1024});if(t.status===44)return;if(t.error||t.status!==0)throw new Error("macOS Keychain \u8BFB\u53D6\u5931\u8D25\uFF1B\u51ED\u636E\u672A\u5199\u5165\u660E\u6587\u6587\u4EF6");let n=String(t.stdout||"").trim();if(!/^[A-Za-z0-9+/]+={0,2}$/.test(n))throw new Error("macOS Keychain \u51ED\u636E\u683C\u5F0F\u65E0\u6548");return Buffer.from(n,"base64").toString("utf8")}function Hr(s,e,t){if(process.platform!=="darwin")throw new Error("macOS Keychain is unavailable on this platform");let n=Buffer.from(t,"utf8").toString("base64"),r=`add-generic-password -U -s ${s} -a ${e} -w ${n}
30
+ `,"utf8"),S=o?this.getTokenForServer(g,o.osClient,o.osClientType,o.osClientNetwork):await this.loadToken(),h=d.protocol==="https:",C=h?Qt:Yt,T=d.pathname.replace(/\/+$/,""),b={hostname:d.hostname,port:d.port||(h?443:80),path:T+e,method:"POST",timeout:a,rejectUnauthorized:this._strictTlsHosts.has(d.hostname.toLowerCase()),headers:{Accept:"application/json",...S?{Authorization:`Bearer ${S}`}:{},did:this.getDeviceId(),...o?.osClient?{OsClient:o.osClient}:{},"Content-Type":`multipart/form-data; boundary=${u}`,"Content-Length":f.length+l.size+y.length}};return new Promise((v,k)=>{let V=!1,Q=O=>{V||(V=!0,k(O))},N=C.request(b,O=>{let M=[];O.on("data",P=>M.push(P)),O.on("end",async()=>{if(V)return;let P=Buffer.concat(M).toString("utf8"),x;try{x=JSON.parse(P)}catch{Q(new Error(`\u6D41\u5F0F\u4E0A\u4F20\u54CD\u5E94\u4E0D\u662F JSON\uFF08HTTP ${O.statusCode||0}\uFF09`));return}let z=String(O.headers.authorization||"");z&&await this.setToken(z,g,o?.osClient,o?.osClientType,o?.osClientNetwork),V=!0,v(x)})});N.on("error",O=>Q(new Error(`\u6D41\u5F0F\u4E0A\u4F20\u5931\u8D25\uFF1A${vt(O)}`))),N.on("timeout",()=>{N.destroy(),Q(new Error(`\u6D41\u5F0F\u4E0A\u4F20\u8D85\u65F6\uFF08${a}ms\uFF09`))}),N.write(f);let R=it.createReadStream(c);R.on("error",O=>{N.destroy(),Q(new Error(`\u8BFB\u53D6\u672C\u5730\u53D1\u5E03\u8D44\u4EA7\u5931\u8D25\uFF1A${vt(O)}`))}),R.on("end",()=>N.end(y)),R.pipe(N,{end:!1})})}};var ot=B(require("crypto")),W=B(require("fs")),_t=B(require("path"));var Dt=B(require("child_process")),Lr=require("crypto"),ne=B(require("fs")),nn=B(require("path")),Rt=".microi-workspace-secrets.dpapi.json",Br=["$ErrorActionPreference = 'Stop';","Add-Type -AssemblyName System.Security;","$inputBase64 = [Console]::In.ReadToEnd().Trim();","$plain = [Convert]::FromBase64String($inputBase64);","$cipher = [Security.Cryptography.ProtectedData]::Protect($plain, $null, [Security.Cryptography.DataProtectionScope]::CurrentUser);","[Console]::Out.Write([Convert]::ToBase64String($cipher));"].join(" "),Ur=["$ErrorActionPreference = 'Stop';","Add-Type -AssemblyName System.Security;","$inputBase64 = [Console]::In.ReadToEnd().Trim();","$cipher = [Convert]::FromBase64String($inputBase64);","$plain = [Security.Cryptography.ProtectedData]::Unprotect($cipher, $null, [Security.Cryptography.DataProtectionScope]::CurrentUser);","[Console]::Out.Write([Convert]::ToBase64String($plain));"].join(" ");function Zt(s,e){if(process.platform!=="win32")throw new Error("\u5F53\u524D\u64CD\u4F5C\u7CFB\u7EDF\u4E0D\u652F\u6301 Windows DPAPI \u5DE5\u4F5C\u533A\u51ED\u636E\u4FDD\u9669\u5E93");let t=process.env.SystemRoot||"C:\\Windows",n=nn.join(t,"System32","WindowsPowerShell","v1.0","powershell.exe"),r=Dt.spawnSync(n,["-NoLogo","-NoProfile","-NonInteractive","-ExecutionPolicy","Bypass","-Command",s],{input:e.toString("base64"),encoding:"utf8",windowsHide:!0,maxBuffer:4*1024*1024,timeout:15e3}),i=String(r.stdout||"").trim();if(r.error||r.status!==0||!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(i))throw new Error("Windows DPAPI \u64CD\u4F5C\u5931\u8D25\uFF1B\u51ED\u636E\u672A\u5199\u5165\u660E\u6587\u6587\u4EF6");return Buffer.from(i,"base64")}function Zs(s){Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,s)}var jn="dpapi-session-v1:",Pt="keychain-session-v1:",Un="net.microi.cli.workspace.v1",jr="net.microi.cli.session.v1",Kr=s=>(0,Lr.createHash)("sha256").update(s).digest("hex");function Kn(s,e){if(process.platform!=="darwin")throw new Error("macOS Keychain is unavailable on this platform");let t=Dt.spawnSync("/usr/bin/security",["find-generic-password","-s",s,"-a",e,"-w"],{encoding:"utf8",timeout:15e3,maxBuffer:4*1024*1024});if(t.status===44)return;if(t.error||t.status!==0)throw new Error("macOS Keychain \u8BFB\u53D6\u5931\u8D25\uFF1B\u51ED\u636E\u672A\u5199\u5165\u660E\u6587\u6587\u4EF6");let n=String(t.stdout||"").trim();if(!/^[A-Za-z0-9+/]+={0,2}$/.test(n))throw new Error("macOS Keychain \u51ED\u636E\u683C\u5F0F\u65E0\u6548");return Buffer.from(n,"base64").toString("utf8")}function Hr(s,e,t){if(process.platform!=="darwin")throw new Error("macOS Keychain is unavailable on this platform");let n=Buffer.from(t,"utf8").toString("base64"),r=`add-generic-password -U -s ${s} -a ${e} -w ${n}
31
31
  `,i=Dt.spawnSync("/usr/bin/security",["-q","-i"],{input:r,encoding:"utf8",timeout:15e3,maxBuffer:4*1024*1024});if(i.error||i.status!==0||Kn(s,e)!==t)throw new Error("macOS Keychain \u5199\u5165\u6216\u56DE\u8BFB\u5931\u8D25\uFF1B\u51ED\u636E\u672A\u5199\u5165\u660E\u6587\u6587\u4EF6")}function ei(s,e){if(process.platform!=="darwin")throw new Error("macOS Keychain is unavailable on this platform");let t=Dt.spawnSync("/usr/bin/security",["delete-generic-password","-s",s,"-a",e],{encoding:"utf8",timeout:15e3,maxBuffer:4*1024*1024});if(t.error||t.status!==0&&t.status!==44)throw new Error("macOS Keychain \u5220\u9664\u5931\u8D25")}var en=class{constructor(e){this.workspaceTokenFile=e;this.onDidChange=()=>({dispose:()=>{}})}account(e){return Kr(`${this.workspaceTokenFile}\0${e}`)}async get(e){return Kn(Un,this.account(e))}async store(e,t){Hr(Un,this.account(e),t)}async delete(e){ei(Un,this.account(e))}},bt=new Map,kt=new Map;function It(s){return typeof s=="string"&&(s.startsWith(jn)||s.startsWith(Pt))}function Wr(s){if(!s||It(s))return s;if(process.platform==="darwin"){let e=Pt+Kr(s);return Hr(jr,e.slice(Pt.length),s),e}return kt.has(s)||(kt.size>256&&kt.clear(),kt.set(s,jn+Zt(Br,Buffer.from(s,"utf8")).toString("base64"))),kt.get(s)}function Hn(s){if(typeof s!="string")return"";if(!It(s))return s;if(s.startsWith(Pt)){let e=s.slice(Pt.length);if(!/^[a-f0-9]{64}$/.test(e))throw new Error("macOS Keychain Token \u5F15\u7528\u683C\u5F0F\u65E0\u6548");let t=Kn(jr,e);if(!t)throw new Error("macOS Keychain Token \u5F15\u7528\u4E0D\u5B58\u5728");return t}return bt.has(s)||(bt.size>256&&bt.clear(),bt.set(s,Zt(Ur,Buffer.from(s.slice(jn.length),"base64")).toString("utf8"))),bt.get(s)}function ti(s){if(!Number.isInteger(s)||s<=1)return!1;try{return process.kill(s,0),!0}catch(e){return e.code==="EPERM"}}function ni(s){try{let e=JSON.parse(ne.readFileSync(s,"utf8"));return ti(Number(e?.pid))}catch{return!1}}var tn=class{constructor(e,t){this.filePath=e;this.onDidChange=()=>({dispose:()=>{}});this.protect=t?.protect||(n=>Zt(Br,n)),this.unprotect=t?.unprotect||(n=>Zt(Ur,n))}async get(e){return this.readDocument().values[e]}async store(e,t){this.mutate(n=>{n.values[e]=t})}async delete(e){this.mutate(t=>{delete t.values[e]})}mutate(e){ne.mkdirSync(nn.dirname(this.filePath),{recursive:!0});let t=`${this.filePath}.lock`,n=Date.now()+3e3,r;for(;r===void 0;)try{r=ne.openSync(t,"wx",384),ne.writeFileSync(r,`${JSON.stringify({pid:process.pid,createdAt:new Date().toISOString()})}
32
- `,"utf8")}catch(o){if(o.code!=="EEXIST")throw o;try{let a=Date.now()-ne.statSync(t).mtimeMs>3e4;(!ni(t)||a)&&ne.unlinkSync(t)}catch{}if(Date.now()>=n)throw new Error("Microi \u5DE5\u4F5C\u533A\u51ED\u636E\u4FDD\u9669\u5E93\u6B63\u88AB\u53E6\u4E00\u8FDB\u7A0B\u66F4\u65B0\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");Zs(40)}let i=`${this.filePath}.${process.pid}.${Date.now()}.tmp`;try{let o=this.readDocument();e(o);let a=Buffer.from(JSON.stringify(o),"utf8"),c={version:1,protection:"windows-dpapi-current-user",ciphertext:this.protect(a).toString("base64")};ne.writeFileSync(i,`${JSON.stringify(c,null,2)}
33
- `,{encoding:"utf8",mode:384}),ne.renameSync(i,this.filePath)}finally{try{ne.existsSync(i)&&ne.unlinkSync(i)}catch{}try{ne.closeSync(r)}catch{}try{ne.unlinkSync(t)}catch{}}}readDocument(){if(!ne.existsSync(this.filePath))return{version:1,values:{}};if(ne.statSync(this.filePath).size>2*1024*1024)throw new Error("Microi \u5DE5\u4F5C\u533A\u51ED\u636E\u4FDD\u9669\u5E93\u8D85\u8FC7\u5B89\u5168\u5927\u5C0F\u9650\u5236\uFF0C\u5DF2\u62D2\u7EDD\u8BFB\u53D6");let e;try{e=JSON.parse(ne.readFileSync(this.filePath,"utf8"))}catch{throw new Error("Microi \u5DE5\u4F5C\u533A\u51ED\u636E\u4FDD\u9669\u5E93\u65E0\u6CD5\u89E3\u6790\uFF0C\u5DF2\u4FDD\u7559\u539F\u6587\u4EF6\u4E14\u505C\u6B62\u8986\u76D6")}if(e.version!==1||e.protection!=="windows-dpapi-current-user"||typeof e.ciphertext!="string"||!e.ciphertext)throw new Error("Microi \u5DE5\u4F5C\u533A\u51ED\u636E\u4FDD\u9669\u5E93\u683C\u5F0F\u65E0\u6548\uFF0C\u5DF2\u4FDD\u7559\u539F\u6587\u4EF6\u4E14\u505C\u6B62\u8986\u76D6");try{let t=this.unprotect(Buffer.from(e.ciphertext,"base64")),n=JSON.parse(t.toString("utf8"));if(n.version!==1||!n.values||typeof n.values!="object")throw new Error("invalid document");return n.values=Object.fromEntries(Object.entries(n.values).filter(r=>typeof r[0]=="string"&&typeof r[1]=="string")),n}catch{throw new Error("Microi \u5DE5\u4F5C\u533A\u51ED\u636E\u4FDD\u9669\u5E93\u65E0\u6CD5\u7531\u5F53\u524D Windows \u7528\u6237\u89E3\u5BC6\uFF0C\u5DF2\u505C\u6B62\u8986\u76D6")}}};var ri=60*60*1e3,si=5*60,Gr=24*60*60,ii=2*60*1e3,oi=60*1e3;function ai(s,e){let t=(e||"").trim();return t?ot.publicEncrypt({key:t,padding:ot.constants.RSA_PKCS1_PADDING},Buffer.from(s,"utf-8")).toString("base64"):s}var Ce=class s{constructor(){this._isLoggedIn=!1;this._refreshInProgress=!1;this._mcpTokenFilePath="";this._mcpAuthRecoveryDirPath="";this._mcpAuthRecoveryInProgress=new Set;this._mcpAuthRecoveryFailureUntil=new Map;this._mcpAuthRecoveryPassInProgress=!1;this._lastAuthWarning="";this._lastAuthWarningTime=0;this.protectedMcpTokenKeys=new Set}static getInstance(){return s._instance||(s._instance=new s),s._instance}setSecretStorage(e){this._secretStorage=e,j.getInstance().setTokenStateChangedHandler(async()=>{await this.writeMcpTokenFile()}),j.getInstance().setAuthRecoveryHandler(async t=>{let n=I.getInstance(),r=this.normalizeApiBaseUrl(t.apiBaseUrl),i=this.normalizeOsClient(t.osClient),o=this.normalizeIdentityPart(t.osClientType),a=this.normalizeIdentityPart(t.osClientNetwork),c=n.getProfiles().filter(d=>this.normalizeApiBaseUrl(d.apiBaseUrl)===r&&this.normalizeOsClient(d.osClient)===i),l=c.find(d=>this.normalizeIdentityPart(d.osClientType)===o&&this.normalizeIdentityPart(d.osClientNetwork)===a);if(!l&&!o&&!a&&c.length===1&&(l=c[0]),!l&&c.length===0&&(l={label:t.osClient||t.apiBaseUrl,apiBaseUrl:t.apiBaseUrl,osClient:t.osClient||"",osClientType:t.osClientType,osClientNetwork:t.osClientNetwork}),!l)return this.showAuthExpiredWarning("\u68C0\u6D4B\u5230\u540C\u4E00\u670D\u52A1\u5668\u4E0E\u79DF\u6237\u5B58\u5728\u591A\u4E2A\u8FDE\u63A5\u73AF\u5883\uFF0C\u65E0\u6CD5\u5B89\u5168\u5224\u65AD\u5E94\u6062\u590D\u54EA\u4E00\u4E2A\u767B\u5F55\u8EAB\u4EFD\u3002"),!1;let g=await this.reLoginForProfile(l);return g&&(this._isLoggedIn=!0,await Je.executeCommand("setContext",nt,!0)),await this.writeMcpTokenFile(),g})}setMcpTokenFilePath(e){this._mcpTokenFilePath=e,this._mcpAuthRecoveryDirPath=e?`${e}.recovery`:""}enableProtectedMcpTokens(e){let t=this.normalizeApiBaseUrl(e.apiBaseUrl),n=this.normalizeOsClient(e.osClient);this.protectedMcpTokenKeys.add(this.mcpRecoveryIdentity(t,n,e.osClientType,e.osClientNetwork)),this.protectedMcpTokenKeys.add(n?`${t}|${n}`:t)}get mcpTokenFilePath(){return this._mcpTokenFilePath}get mcpAuthRecoveryDirPath(){return this._mcpAuthRecoveryDirPath}async loadMcpTokenFile(){if(!this._mcpTokenFilePath||!W.existsSync(this._mcpTokenFilePath))return 0;let e;try{let i=JSON.parse(W.readFileSync(this._mcpTokenFilePath,"utf-8"));if(!i||typeof i!="object"||Array.isArray(i))return 0;for(let[o,a]of Object.entries(i))It(a)&&this.protectedMcpTokenKeys.add(o);e=Object.fromEntries(Object.entries(i).map(([o,a])=>[o,Hn(a)]))}catch{return 0}let t=j.getInstance(),n=I.getInstance().getProfiles(),r=[];for(let i of n){let o=this.normalizeApiBaseUrl(i.apiBaseUrl),a=this.normalizeOsClient(i.osClient),c=this.mcpRecoveryIdentity(o,a,i.osClientType,i.osClientNetwork),g=n.filter(y=>this.normalizeApiBaseUrl(y.apiBaseUrl)===o&&this.normalizeOsClient(y.osClient)===a).length===1?[[o,a,i.osClientType,i.osClientNetwork].filter(Boolean).join("|"),[o,a,i.osClientType].filter(Boolean).join("|"),a?`${o}|${a}`:o]:[],d=typeof e[c]=="string"&&String(e[c]).trim()?String(e[c]).trim():"",u=g.map(y=>e[y]).find(y=>typeof y=="string"&&y.trim()),p=t.getTokenForServer(i.apiBaseUrl,i.osClient,i.osClientType,i.osClientNetwork),m=t.getExactTokenForServer(i.apiBaseUrl,i.osClient,i.osClientType,i.osClientNetwork),f=st(p,d||u,!!d&&!m);!f||m===f||r.push({token:f,apiBaseUrl:i.apiBaseUrl,osClient:i.osClient,osClientType:i.osClientType,osClientNetwork:i.osClientNetwork})}return t.adoptTokensFromSharedFile(r)}get isLoggedIn(){return this._isLoggedIn}secretKey(e){return I.getInstance().getWorkspaceSecretKey(e)}normalizeApiBaseUrl(e){return(e||"").trim().replace(/\/+$/,"")}normalizeOsClient(e){return(e||"").trim()}normalizeIdentityPart(e){return(e||"").trim()}mcpRecoveryIdentity(e,t,n,r){return[this.normalizeApiBaseUrl(e),this.normalizeOsClient(t),this.normalizeIdentityPart(n),this.normalizeIdentityPart(r)].join("|")}serverSecretKey(e,t,n){return this.secretKey(`${e}.${this.normalizeApiBaseUrl(t)}|${this.normalizeOsClient(n)}`)}getCredentialSecretKeys(e){return{usernameKey:this.serverSecretKey(we,e.apiBaseUrl,e.osClient),passwordKey:this.serverSecretKey(Te,e.apiBaseUrl,e.osClient)}}legacyServerSecretKey(e,t){return this.secretKey(`${e}.${this.normalizeApiBaseUrl(t)}`)}canUseLegacyCredential(e,t){let n=this.normalizeApiBaseUrl(e),r=this.normalizeOsClient(t);if(!n)return!1;let i=I.getInstance().getProfiles().filter(a=>this.normalizeApiBaseUrl(a.apiBaseUrl)===n);if(i.length===0)return!r;if(i.length===1)return!0;let o=i.filter(a=>this.normalizeOsClient(a.osClient)===r);return!!r&&o.length===i.length}async writeMcpTokenFile(){if(!this._mcpTokenFilePath)return;let e=j.getInstance(),t=I.getInstance(),n=t.getProfiles(),r=this._mcpTokenFilePath;if(!(n.some(f=>!!this.normalizeApiBaseUrl(f.apiBaseUrl)&&!!this.normalizeOsClient(f.osClient))||!!this.normalizeApiBaseUrl(t.getApiBaseUrl())&&!!this.normalizeOsClient(t.getOsClient()))&&!W.existsSync(r))return;let o={},a=new Set,c=[];for(let f of n){let y=this.normalizeApiBaseUrl(f.apiBaseUrl),S=this.normalizeOsClient(f.osClient),h=this.mcpRecoveryIdentity(y,S,f.osClientType,f.osClientNetwork);a.add(h);let C=n.filter(v=>this.normalizeApiBaseUrl(v.apiBaseUrl)===y&&this.normalizeOsClient(v.osClient)===S),T=S?`${y}|${S}`:y;C.length===1&&a.add(T);let b=e.getTokenForServer(f.apiBaseUrl,f.osClient,f.osClientType,f.osClientNetwork);c.push({profile:f,exactKey:h,legacyKey:C.length===1?T:void 0,currentToken:b,currentExactToken:e.getExactTokenForServer(f.apiBaseUrl,f.osClient,f.osClientType,f.osClientNetwork)}),b&&(o[h]=b,C.length===1&&(o[T]=b))}let l=_t.dirname(r);W.existsSync(l)||W.mkdirSync(l,{recursive:!0});let g=`${r}.lock`,d=Date.now()+3e3,u;for(;u===void 0;)try{u=W.openSync(g,"wx",384),W.writeFileSync(u,JSON.stringify({pid:process.pid,createdAt:Date.now()}),"utf-8")}catch(f){if(f.code!=="EEXIST")throw f;try{Date.now()-W.statSync(g).mtimeMs>3e4&&W.unlinkSync(g)}catch{}if(Date.now()>=d)throw new Error("Microi MCP Token \u6587\u4EF6\u6B63\u5728\u88AB CLI \u6216 VS Code \u63D2\u4EF6\u4FEE\u6539\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");await new Promise(y=>setTimeout(y,40))}let p=`${r}.${process.pid}.${Date.now()}.tmp`,m=[];try{let f={};if(W.existsSync(r)){let h=JSON.parse(W.readFileSync(r,"utf-8"));if(!h||typeof h!="object"||Array.isArray(h))throw new Error(`Microi MCP Token \u6587\u4EF6\u5FC5\u987B\u662F JSON \u5BF9\u8C61\uFF0C\u5DF2\u4FDD\u7559\u539F\u6587\u4EF6\uFF1A${r}`);for(let[C,T]of Object.entries(h))It(T)&&this.protectedMcpTokenKeys.add(C);f=Object.fromEntries(Object.entries(h).filter(C=>typeof C[1]=="string"&&!!C[1]).map(([C,T])=>[C,Hn(T)]))}for(let h of c){let C=f[h.exactKey]||"",T=h.legacyKey&&f[h.legacyKey]||"",b=st(h.currentToken,C||T,!!C&&!h.currentExactToken);b&&(o[h.exactKey]=b,h.legacyKey&&(o[h.legacyKey]=b),b!==h.currentExactToken&&m.push({profile:h.profile,token:b}))}for(let h of a)delete f[h];let y={...f,...o},S=Object.fromEntries(Object.entries(y).map(([h,C])=>[h,this.protectedMcpTokenKeys.has(h)?Wr(C):C]));W.writeFileSync(p,`${JSON.stringify(S,null,2)}
32
+ `,"utf8")}catch(o){if(o.code!=="EEXIST")throw o;try{let a=Date.now()-ne.statSync(t).mtimeMs>3e4;(!ni(t)||a)&&ne.unlinkSync(t)}catch{}if(Date.now()>=n)throw new Error("Microi \u5DE5\u4F5C\u533A\u51ED\u636E\u4FDD\u9669\u5E93\u6B63\u88AB\u53E6\u4E00\u8FDB\u7A0B\u66F4\u65B0\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");Zs(40)}let i=`${this.filePath}.${process.pid}.${Date.now()}.tmp`;try{let o=this.readDocument();e(o);let a=Buffer.from(JSON.stringify(o),"utf8"),c={version:1,protection:"windows-dpapi-current-user",ciphertext:this.protect(a).toString("base64")};if(!this.unprotect(Buffer.from(c.ciphertext,"base64")).equals(a))throw new Error("Microi \u5DE5\u4F5C\u533A\u51ED\u636E\u52A0\u5BC6\u56DE\u8BFB\u4E0D\u4E00\u81F4\uFF0C\u5DF2\u4FDD\u7559\u539F\u4FDD\u9669\u5E93");ne.writeFileSync(i,`${JSON.stringify(c,null,2)}
33
+ `,{encoding:"utf8",mode:384}),ne.renameSync(i,this.filePath)}finally{try{ne.existsSync(i)&&ne.unlinkSync(i)}catch{}try{ne.closeSync(r)}catch{}try{ne.unlinkSync(t)}catch{}}}readDocument(){if(!ne.existsSync(this.filePath))return{version:1,values:{}};if(ne.statSync(this.filePath).size>2*1024*1024)throw new Error("Microi \u5DE5\u4F5C\u533A\u51ED\u636E\u4FDD\u9669\u5E93\u8D85\u8FC7\u5B89\u5168\u5927\u5C0F\u9650\u5236\uFF0C\u5DF2\u62D2\u7EDD\u8BFB\u53D6");let e;try{e=JSON.parse(ne.readFileSync(this.filePath,"utf8"))}catch{throw new Error("Microi \u5DE5\u4F5C\u533A\u51ED\u636E\u4FDD\u9669\u5E93\u65E0\u6CD5\u89E3\u6790\uFF0C\u5DF2\u4FDD\u7559\u539F\u6587\u4EF6\u4E14\u505C\u6B62\u8986\u76D6")}if(e.version!==1||e.protection!=="windows-dpapi-current-user"||typeof e.ciphertext!="string"||!e.ciphertext)throw new Error("Microi \u5DE5\u4F5C\u533A\u51ED\u636E\u4FDD\u9669\u5E93\u683C\u5F0F\u65E0\u6548\uFF0C\u5DF2\u4FDD\u7559\u539F\u6587\u4EF6\u4E14\u505C\u6B62\u8986\u76D6");try{let t=this.unprotect(Buffer.from(e.ciphertext,"base64"));if(t.length===0)return{version:1,values:{}};let n=JSON.parse(t.toString("utf8"));if(n.version!==1||!n.values||typeof n.values!="object")throw new Error("invalid document");return n.values=Object.fromEntries(Object.entries(n.values).filter(r=>typeof r[0]=="string"&&typeof r[1]=="string")),n}catch{throw new Error("Microi \u5DE5\u4F5C\u533A\u51ED\u636E\u4FDD\u9669\u5E93\u65E0\u6CD5\u7531\u5F53\u524D Windows \u7528\u6237\u89E3\u5BC6\uFF0C\u5DF2\u505C\u6B62\u8986\u76D6")}}};var ri=60*60*1e3,si=5*60,Gr=24*60*60,ii=2*60*1e3,oi=60*1e3;function ai(s,e){let t=(e||"").trim();return t?ot.publicEncrypt({key:t,padding:ot.constants.RSA_PKCS1_PADDING},Buffer.from(s,"utf-8")).toString("base64"):s}var Ce=class s{constructor(){this._isLoggedIn=!1;this._refreshInProgress=!1;this._mcpTokenFilePath="";this._mcpAuthRecoveryDirPath="";this._mcpAuthRecoveryInProgress=new Set;this._mcpAuthRecoveryFailureUntil=new Map;this._mcpAuthRecoveryPassInProgress=!1;this._lastAuthWarning="";this._lastAuthWarningTime=0;this.protectedMcpTokenKeys=new Set}static getInstance(){return s._instance||(s._instance=new s),s._instance}setSecretStorage(e){this._secretStorage=e,j.getInstance().setTokenStateChangedHandler(async()=>{await this.writeMcpTokenFile()}),j.getInstance().setAuthRecoveryHandler(async t=>{let n=I.getInstance(),r=this.normalizeApiBaseUrl(t.apiBaseUrl),i=this.normalizeOsClient(t.osClient),o=this.normalizeIdentityPart(t.osClientType),a=this.normalizeIdentityPart(t.osClientNetwork),c=n.getProfiles().filter(d=>this.normalizeApiBaseUrl(d.apiBaseUrl)===r&&this.normalizeOsClient(d.osClient)===i),l=c.find(d=>this.normalizeIdentityPart(d.osClientType)===o&&this.normalizeIdentityPart(d.osClientNetwork)===a);if(!l&&!o&&!a&&c.length===1&&(l=c[0]),!l&&c.length===0&&(l={label:t.osClient||t.apiBaseUrl,apiBaseUrl:t.apiBaseUrl,osClient:t.osClient||"",osClientType:t.osClientType,osClientNetwork:t.osClientNetwork}),!l)return this.showAuthExpiredWarning("\u68C0\u6D4B\u5230\u540C\u4E00\u670D\u52A1\u5668\u4E0E\u79DF\u6237\u5B58\u5728\u591A\u4E2A\u8FDE\u63A5\u73AF\u5883\uFF0C\u65E0\u6CD5\u5B89\u5168\u5224\u65AD\u5E94\u6062\u590D\u54EA\u4E00\u4E2A\u767B\u5F55\u8EAB\u4EFD\u3002"),!1;let g=await this.reLoginForProfile(l);return g&&(this._isLoggedIn=!0,await Je.executeCommand("setContext",nt,!0)),await this.writeMcpTokenFile(),g})}setMcpTokenFilePath(e){this._mcpTokenFilePath=e,this._mcpAuthRecoveryDirPath=e?`${e}.recovery`:""}enableProtectedMcpTokens(e){let t=this.normalizeApiBaseUrl(e.apiBaseUrl),n=this.normalizeOsClient(e.osClient);this.protectedMcpTokenKeys.add(this.mcpRecoveryIdentity(t,n,e.osClientType,e.osClientNetwork)),this.protectedMcpTokenKeys.add(n?`${t}|${n}`:t)}get mcpTokenFilePath(){return this._mcpTokenFilePath}get mcpAuthRecoveryDirPath(){return this._mcpAuthRecoveryDirPath}async loadMcpTokenFile(){if(!this._mcpTokenFilePath||!W.existsSync(this._mcpTokenFilePath))return 0;let e;try{let i=JSON.parse(W.readFileSync(this._mcpTokenFilePath,"utf-8"));if(!i||typeof i!="object"||Array.isArray(i))return 0;for(let[o,a]of Object.entries(i))It(a)&&this.protectedMcpTokenKeys.add(o);e=Object.fromEntries(Object.entries(i).map(([o,a])=>[o,Hn(a)]))}catch{return 0}let t=j.getInstance(),n=I.getInstance().getProfiles(),r=[];for(let i of n){let o=this.normalizeApiBaseUrl(i.apiBaseUrl),a=this.normalizeOsClient(i.osClient),c=this.mcpRecoveryIdentity(o,a,i.osClientType,i.osClientNetwork),g=n.filter(y=>this.normalizeApiBaseUrl(y.apiBaseUrl)===o&&this.normalizeOsClient(y.osClient)===a).length===1?[[o,a,i.osClientType,i.osClientNetwork].filter(Boolean).join("|"),[o,a,i.osClientType].filter(Boolean).join("|"),a?`${o}|${a}`:o]:[],d=typeof e[c]=="string"&&String(e[c]).trim()?String(e[c]).trim():"",u=g.map(y=>e[y]).find(y=>typeof y=="string"&&y.trim()),p=t.getTokenForServer(i.apiBaseUrl,i.osClient,i.osClientType,i.osClientNetwork),m=t.getExactTokenForServer(i.apiBaseUrl,i.osClient,i.osClientType,i.osClientNetwork),f=st(p,d||u,!!d&&!m);!f||m===f||r.push({token:f,apiBaseUrl:i.apiBaseUrl,osClient:i.osClient,osClientType:i.osClientType,osClientNetwork:i.osClientNetwork})}return t.adoptTokensFromSharedFile(r)}get isLoggedIn(){return this._isLoggedIn}secretKey(e){return I.getInstance().getWorkspaceSecretKey(e)}normalizeApiBaseUrl(e){return(e||"").trim().replace(/\/+$/,"")}normalizeOsClient(e){return(e||"").trim()}normalizeIdentityPart(e){return(e||"").trim()}mcpRecoveryIdentity(e,t,n,r){return[this.normalizeApiBaseUrl(e),this.normalizeOsClient(t),this.normalizeIdentityPart(n),this.normalizeIdentityPart(r)].join("|")}serverSecretKey(e,t,n){return this.secretKey(`${e}.${this.normalizeApiBaseUrl(t)}|${this.normalizeOsClient(n)}`)}getCredentialSecretKeys(e){return{usernameKey:this.serverSecretKey(we,e.apiBaseUrl,e.osClient),passwordKey:this.serverSecretKey(Te,e.apiBaseUrl,e.osClient)}}legacyServerSecretKey(e,t){return this.secretKey(`${e}.${this.normalizeApiBaseUrl(t)}`)}canUseLegacyCredential(e,t){let n=this.normalizeApiBaseUrl(e),r=this.normalizeOsClient(t);if(!n)return!1;let i=I.getInstance().getProfiles().filter(a=>this.normalizeApiBaseUrl(a.apiBaseUrl)===n);if(i.length===0)return!r;if(i.length===1)return!0;let o=i.filter(a=>this.normalizeOsClient(a.osClient)===r);return!!r&&o.length===i.length}async writeMcpTokenFile(){if(!this._mcpTokenFilePath)return;let e=j.getInstance(),t=I.getInstance(),n=t.getProfiles(),r=this._mcpTokenFilePath;if(!(n.some(f=>!!this.normalizeApiBaseUrl(f.apiBaseUrl)&&!!this.normalizeOsClient(f.osClient))||!!this.normalizeApiBaseUrl(t.getApiBaseUrl())&&!!this.normalizeOsClient(t.getOsClient()))&&!W.existsSync(r))return;let o={},a=new Set,c=[];for(let f of n){let y=this.normalizeApiBaseUrl(f.apiBaseUrl),S=this.normalizeOsClient(f.osClient),h=this.mcpRecoveryIdentity(y,S,f.osClientType,f.osClientNetwork);a.add(h);let C=n.filter(v=>this.normalizeApiBaseUrl(v.apiBaseUrl)===y&&this.normalizeOsClient(v.osClient)===S),T=S?`${y}|${S}`:y;C.length===1&&a.add(T);let b=e.getTokenForServer(f.apiBaseUrl,f.osClient,f.osClientType,f.osClientNetwork);c.push({profile:f,exactKey:h,legacyKey:C.length===1?T:void 0,currentToken:b,currentExactToken:e.getExactTokenForServer(f.apiBaseUrl,f.osClient,f.osClientType,f.osClientNetwork)}),b&&(o[h]=b,C.length===1&&(o[T]=b))}let l=_t.dirname(r);W.existsSync(l)||W.mkdirSync(l,{recursive:!0});let g=`${r}.lock`,d=Date.now()+3e3,u;for(;u===void 0;)try{u=W.openSync(g,"wx",384),W.writeFileSync(u,JSON.stringify({pid:process.pid,createdAt:Date.now()}),"utf-8")}catch(f){if(f.code!=="EEXIST")throw f;try{Date.now()-W.statSync(g).mtimeMs>3e4&&W.unlinkSync(g)}catch{}if(Date.now()>=d)throw new Error("Microi MCP Token \u6587\u4EF6\u6B63\u5728\u88AB CLI \u6216 VS Code \u63D2\u4EF6\u4FEE\u6539\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");await new Promise(y=>setTimeout(y,40))}let p=`${r}.${process.pid}.${Date.now()}.tmp`,m=[];try{let f={};if(W.existsSync(r)){let h=JSON.parse(W.readFileSync(r,"utf-8"));if(!h||typeof h!="object"||Array.isArray(h))throw new Error(`Microi MCP Token \u6587\u4EF6\u5FC5\u987B\u662F JSON \u5BF9\u8C61\uFF0C\u5DF2\u4FDD\u7559\u539F\u6587\u4EF6\uFF1A${r}`);for(let[C,T]of Object.entries(h))It(T)&&this.protectedMcpTokenKeys.add(C);f=Object.fromEntries(Object.entries(h).filter(C=>typeof C[1]=="string"&&!!C[1]).map(([C,T])=>[C,Hn(T)]))}for(let h of c){let C=f[h.exactKey]||"",T=h.legacyKey&&f[h.legacyKey]||"",b=st(h.currentToken,C||T,!!C&&!h.currentExactToken);b&&(o[h.exactKey]=b,h.legacyKey&&(o[h.legacyKey]=b),b!==h.currentExactToken&&m.push({profile:h.profile,token:b}))}for(let h of a)delete f[h];let y={...f,...o},S=Object.fromEntries(Object.entries(y).map(([h,C])=>[h,this.protectedMcpTokenKeys.has(h)?Wr(C):C]));W.writeFileSync(p,`${JSON.stringify(S,null,2)}
34
34
  `,{encoding:"utf-8",mode:384}),W.renameSync(p,r)}finally{try{W.existsSync(p)&&W.unlinkSync(p)}catch{}try{W.closeSync(u)}catch{}try{W.unlinkSync(g)}catch{}}await e.adoptTokensFromSharedFile(m.map(f=>({token:f.token,apiBaseUrl:f.profile.apiBaseUrl,osClient:f.profile.osClient,osClientType:f.profile.osClientType,osClientNetwork:f.profile.osClientNetwork})))}tokenFingerprint(e){return ot.createHash("sha256").update(String(e||"")).digest("hex")}deleteMcpAuthRecoveryRequests(e,t){let n=this._mcpAuthRecoveryDirPath;if(!n||!W.existsSync(n))return;let r=[];try{r=W.readdirSync(n).filter(i=>i.endsWith(".json")).slice(0,200)}catch{return}for(let i of r){let o=_t.join(n,i);try{let a=JSON.parse(W.readFileSync(o,"utf-8")),c=this.normalizeApiBaseUrl(String(a.apiBaseUrl||"")),l=this.normalizeOsClient(String(a.osClient||"")),g=this.normalizeIdentityPart(String(a.osClientType||"")),d=this.normalizeIdentityPart(String(a.osClientNetwork||"")),u=this.mcpRecoveryIdentity(c,l,g,d);if(!g&&!d){let p=t.filter(m=>this.normalizeApiBaseUrl(m.apiBaseUrl)===c&&this.normalizeOsClient(m.osClient)===l);p.length===1&&(u=this.mcpRecoveryIdentity(p[0].apiBaseUrl,p[0].osClient,p[0].osClientType,p[0].osClientNetwork))}u===e&&W.unlinkSync(o)}catch{}}}async processMcpAuthRecoveryRequests(){let e=this._mcpAuthRecoveryDirPath;if(!(!e||!W.existsSync(e)||this._mcpAuthRecoveryPassInProgress)){this._mcpAuthRecoveryPassInProgress=!0;try{let t=[];try{t=W.readdirSync(e).filter(o=>o.endsWith(".json")).slice(0,100)}catch{return}let r=I.getInstance().getProfiles(),i=j.getInstance();for(let o of t){let a=_t.join(e,o),c={};try{c=JSON.parse(W.readFileSync(a,"utf-8"))}catch{try{W.unlinkSync(a)}catch{}continue}let l=Number(c.requestedAt||0),g=this.normalizeApiBaseUrl(String(c.apiBaseUrl||"")),d=this.normalizeOsClient(String(c.osClient||"")),u=this.normalizeIdentityPart(String(c.osClientType||"")),p=this.normalizeIdentityPart(String(c.osClientNetwork||"")),m=String(c.failedTokenHash||"").trim().toLowerCase();if(Number(c.version)!==1||!g||!l||Math.abs(Date.now()-l)>ii||!Or(m)){try{W.unlinkSync(a)}catch{}continue}let f=r.filter(h=>this.normalizeApiBaseUrl(h.apiBaseUrl)===g&&this.normalizeOsClient(h.osClient)===d),y=u||p?f.find(h=>this.normalizeIdentityPart(h.osClientType)===u&&this.normalizeIdentityPart(h.osClientNetwork)===p):f.length===1?f[0]:void 0;if(!y){try{W.unlinkSync(a)}catch{}continue}let S=this.mcpRecoveryIdentity(y.apiBaseUrl,y.osClient,y.osClientType,y.osClientNetwork);if(!this._mcpAuthRecoveryInProgress.has(S)){if((this._mcpAuthRecoveryFailureUntil.get(S)||0)>Date.now()){this.deleteMcpAuthRecoveryRequests(S,r);continue}this._mcpAuthRecoveryInProgress.add(S);try{let h=i.getTokenForServer(y.apiBaseUrl,y.osClient,y.osClientType,y.osClientNetwork);h&&this.tokenFingerprint(h)!==m?(this._mcpAuthRecoveryFailureUntil.delete(S),await this.writeMcpTokenFile()):(h&&await i.clearTokenForServer(y.apiBaseUrl,y.osClient,y.osClientType,y.osClientNetwork,h),await this.reLoginForProfile(y)?this._mcpAuthRecoveryFailureUntil.delete(S):(this._mcpAuthRecoveryFailureUntil.set(S,Date.now()+oi),this.showAuthExpiredWarning("MCP \u8EAB\u4EFD\u5DF2\u5931\u6548\uFF0C\u4FDD\u5B58\u7684\u51ED\u636E\u65E0\u6CD5\u9759\u9ED8\u6062\u590D\uFF1B\u82E5\u670D\u52A1\u5668\u542F\u7528\u4E86\u9A8C\u8BC1\u7801\uFF0C\u8BF7\u5728\u63D2\u4EF6\u914D\u7F6E\u4E2D\u4EA4\u4E92\u5F0F\u91CD\u65B0\u767B\u5F55\u3002")))}finally{this._mcpAuthRecoveryInProgress.delete(S),this.deleteMcpAuthRecoveryRequests(S,r)}}}}finally{this._mcpAuthRecoveryPassInProgress=!1}}}startMcpAuthRecoveryWatcher(){this._mcpAuthRecoveryTimer||!this._mcpAuthRecoveryDirPath||(this._mcpAuthRecoveryTimer=setInterval(()=>{this.processMcpAuthRecoveryRequests()},1e3),this.processMcpAuthRecoveryRequests())}stopMcpAuthRecoveryWatcher(){this._mcpAuthRecoveryTimer&&(clearInterval(this._mcpAuthRecoveryTimer),this._mcpAuthRecoveryTimer=void 0)}async tryAutoLogin(){let e=j.getInstance(),n=I.getInstance().getProfiles(),r=!1,i=await e.loadToken(),o=await this.loadMcpTokenFile();r=!!i||o>0||e.hasToken;let a=n.filter(d=>!e.getTokenForServer(d.apiBaseUrl,d.osClient,d.osClientType,d.osClientNetwork)),c=0,l=async()=>{for(;c<a.length;){let d=a[c++];await this.reLoginForProfile(d)&&(r=!0)}},g=Math.min(4,a.length);return await Promise.all(Array.from({length:g},()=>l())),r&&(this._isLoggedIn=!0,await Je.executeCommand("setContext",nt,!0),await this.writeMcpTokenFile()),r}async getSysConfig(e,t,n,r=!1){let i=j.getInstance(),o=I.getInstance();try{let a=await i.request({method:"POST",path:H.GET_SYS_CONFIG,body:{_SearchEqual:{IsEnable:1},OsClient:t||o.getOsClient()||void 0},apiBaseUrl:e,osClient:t,allowAuthRetry:!1,silent:r});if(a.Code===1&&a.Data)return a.Data;n&&(n.message=a.Code!==1?`\u670D\u52A1\u5668\u8FD4\u56DE\u9519\u8BEF (Code: ${a.Code})${a.Msg?"\uFF1A"+a.Msg:""}\uFF0C\u8BF7\u68C0\u67E5 OsClient \u662F\u5426\u6B63\u786E`:"\u670D\u52A1\u5668\u672A\u8FD4\u56DE\u914D\u7F6E\u6570\u636E")}catch(a){n&&(n.message=a instanceof Error?a.message:String(a))}return null}async getCaptcha(e,t){let n=j.getInstance(),r=I.getInstance();try{let i=await n.getRaw(H.GET_CAPTCHA,{OsClient:t||r.getOsClient()||""},e);if(i.data&&i.captchaId){let o=i.data.toString("base64");return{captchaId:i.captchaId,imageBase64:`data:image/png;base64,${o}`}}}catch{}return null}async login(e,t,n={}){let r=j.getInstance(),i=I.getInstance(),o=n.osClient||i.getOsClient(),a=n.silent??!1;try{let c=await this.getSysConfig(n.apiBaseUrl,o,void 0,a),l=c?.EnableCaptcha;if((l===!0||l===1||String(l||"").trim().toLowerCase()==="true")&&(!n.captchaId||!n.captchaValue)){let S="\u670D\u52A1\u5668\u5DF2\u5F00\u542F\u56FE\u5F62\u9A8C\u8BC1\u7801\uFF0C\u8BF7\u5728\u63D2\u4EF6\u914D\u7F6E\u4E2D\u4EA4\u4E92\u5F0F\u767B\u5F55\u3002";return a||A.error(`Microi: \u767B\u5F55\u5931\u8D25 - ${S}`),{ok:!1,msg:S}}let d=typeof c?.LoginRsaPublicKey=="string"&&c.LoginRsaPublicKey.trim()?c.LoginRsaPublicKey:vr,u=ai(t,d),p={Account:e,Pwd:u,OsClient:o||void 0,_ClientType:"VSCode"};n.captchaId&&n.captchaValue&&(p._CaptchaId=n.captchaId,p._CaptchaValue=n.captchaValue);let m=await r.request({method:"POST",path:H.LOGIN,body:p,bodyFormat:"form",apiBaseUrl:n.apiBaseUrl,osClient:n.osClient,osClientType:n.osClientType,osClientNetwork:n.osClientNetwork,allowAuthRetry:!1,silent:a}),y=m._headers?.authorization||"";if(m.Code===1)return y&&await r.setToken(y,n.apiBaseUrl,n.osClient,n.osClientType,n.osClientNetwork),this._secretStorage&&(n.apiBaseUrl?(await this._secretStorage.store(this.serverSecretKey(we,n.apiBaseUrl,o),e),await this._secretStorage.store(this.serverSecretKey(Te,n.apiBaseUrl,o),t)):(await this._secretStorage.store(this.secretKey(we),e),await this._secretStorage.store(this.secretKey(Te),t))),m.Data?.OsClient&&!o&&await i.updateSettings({osClient:m.Data.OsClient}),this._isLoggedIn=!0,await Je.executeCommand("setContext",nt,!0),await this.writeMcpTokenFile(),a||A.info(`Microi: \u767B\u5F55\u6210\u529F\uFF0C\u6B22\u8FCE ${m.Data?.Name||m.Data?.Account||e}`),{ok:!0,msg:""};{let S=m.Msg||"\u8BF7\u68C0\u67E5\u8D26\u53F7\u5BC6\u7801";return a||A.error(`Microi: \u767B\u5F55\u5931\u8D25 - ${S}`),{ok:!1,msg:S}}}catch(c){let l=c instanceof Error?c.message:String(c);return a||A.error(`Microi: \u767B\u5F55\u5931\u8D25 - ${l}`),{ok:!1,msg:l}}}async refreshAllTokens(){if(this._refreshInProgress)return;this._refreshInProgress=!0;let e=j.getInstance(),n=I.getInstance().getProfiles();try{for(let r of n){let i=e.getTokenForServer(r.apiBaseUrl,r.osClient,r.osClientType,r.osClientNetwork);if(!i){await this.reLoginForProfile(r);continue}try{let u=await e.request({method:"GET",path:H.GET_STATUS,apiBaseUrl:r.apiBaseUrl,osClient:r.osClient,osClientType:r.osClientType,osClientNetwork:r.osClientNetwork,allowAuthRetry:!1,silent:!0});if(Et(u))continue;if(qt(u)){await e.clearTokenForServer(r.apiBaseUrl,r.osClient,r.osClientType,r.osClientNetwork,i),await this.reLoginForProfile(r)||this.showAuthExpiredWarning(u.Msg||"\u5F53\u524D\u767B\u5F55\u8EAB\u4EFD\u5DF2\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u3002");continue}}catch{}let o=this.readJwtClientClaims(i),a=String(o?.ClientType||"").trim(),c=a.toLowerCase()!=="vscode",l=!a||a.toLowerCase()==="empty";if(c&&(await this.reLoginForProfile(r)||!l))continue;let g=String(o?.Did||"").trim(),d=a.toLowerCase()==="vscode"&&g!==e.getDeviceId();if(!(!c&&!d&&!this.shouldRefreshToken(i,o)))try{let u=await e.request({method:"POST",path:H.REFRESH_TOKEN,body:{authorization:i,OsClient:r.osClient,_ClientType:"VSCode"},apiBaseUrl:r.apiBaseUrl,osClient:r.osClient,osClientType:r.osClientType,osClientNetwork:r.osClientNetwork,allowAuthRetry:!1,silent:!0}),m=u._headers?.authorization||"";u.Code===1&&m?await e.setToken(m,r.apiBaseUrl,r.osClient,r.osClientType,r.osClientNetwork):(await e.clearTokenForServer(r.apiBaseUrl,r.osClient,r.osClientType,r.osClientNetwork,i),await this.reLoginForProfile(r)||this.showAuthExpiredWarning(u.Msg||"\u5F53\u524D\u767B\u5F55\u8EAB\u4EFD\u5DF2\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u3002"))}catch{await this.reLoginForProfile(r)}}}finally{this._isLoggedIn=e.hasToken,await Je.executeCommand("setContext",nt,this._isLoggedIn),await this.writeMcpTokenFile(),this._refreshInProgress=!1}}showAuthExpiredWarning(e){let t=String(e||"\u5F53\u524D\u767B\u5F55\u8EAB\u4EFD\u5DF2\u5931\u6548\uFF0C\u8BF7\u91CD\u65B0\u767B\u5F55\u3002"),n=Date.now();t===this._lastAuthWarning&&n-this._lastAuthWarningTime<60*1e3||(this._lastAuthWarning=t,this._lastAuthWarningTime=n,A.warn(`Microi: ${t}`))}readJwtClientClaims(e){try{let n=e.replace(/^Bearer\s+/i,"").trim().split(".");if(n.length<2)return null;let r=n[1].replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(Buffer.from(r,"base64").toString("utf-8"))}catch{return null}}shouldRefreshToken(e,t){let n=t??this.readJwtClientClaims(e),r=Number(n?.exp);if(!Number.isFinite(r)||r<=0)return!0;let i=Number(n?.MicroiTokenIssuedAt??n?.iat),o=Number.isFinite(i)&&i>0&&r>i?r-i:Gr,a=Math.min(Gr,Math.max(si,Math.floor(o/10)));return r-Math.floor(Date.now()/1e3)<=a}async getCredentialsForProfile(e,t){if(!this._secretStorage)return null;let n=this.normalizeApiBaseUrl(e),r=this.normalizeOsClient(t),i=n?await this._secretStorage.get(this.serverSecretKey(we,n,r)):void 0,o=n?await this._secretStorage.get(this.serverSecretKey(Te,n,r)):void 0;return(!i||!o)&&n&&this.canUseLegacyCredential(n,r)&&(i=i||await this._secretStorage.get(this.legacyServerSecretKey(we,n)),o=o||await this._secretStorage.get(this.legacyServerSecretKey(Te,n))),(!i||!o)&&!n&&!r&&(i=i||await this._secretStorage.get(this.secretKey(we)),o=o||await this._secretStorage.get(this.secretKey(Te))),!i||!o?null:{username:i,password:o}}async reLoginForProfile(e){if(!this._secretStorage)return!1;let t=await this.getCredentialsForProfile(e.apiBaseUrl,e.osClient);return t?(await this.login(t.username,t.password,{silent:!0,apiBaseUrl:e.apiBaseUrl,osClient:e.osClient,osClientType:e.osClientType,osClientNetwork:e.osClientNetwork})).ok:!1}async recoverProfileLogin(e){let t=await this.reLoginForProfile(e);return t&&(this._isLoggedIn=!0,await this.writeMcpTokenFile()),t}startTokenRefresh(){this.stopTokenRefresh(),this.startMcpAuthRecoveryWatcher(),this.refreshAllTokens(),this._refreshTimer=setInterval(()=>{this.refreshAllTokens()},ri),this._windowStateSubscription=fe.onDidChangeWindowState(e=>{e.focused&&this.refreshAllTokens()})}stopTokenRefresh(){this._refreshTimer&&(clearInterval(this._refreshTimer),this._refreshTimer=void 0),this._windowStateSubscription&&(this._windowStateSubscription.dispose(),this._windowStateSubscription=void 0),this.stopMcpAuthRecoveryWatcher()}async logoutProfile(e){await j.getInstance().clearTokenForServer(e.apiBaseUrl,e.osClient,e.osClientType,e.osClientNetwork),this._secretStorage&&(await this._secretStorage.delete(this.serverSecretKey(we,e.apiBaseUrl,e.osClient)),await this._secretStorage.delete(this.serverSecretKey(Te,e.apiBaseUrl,e.osClient)),this.canUseLegacyCredential(e.apiBaseUrl,e.osClient)&&(await this._secretStorage.delete(this.legacyServerSecretKey(we,e.apiBaseUrl)),await this._secretStorage.delete(this.legacyServerSecretKey(Te,e.apiBaseUrl)))),await this.writeMcpTokenFile()}async logout(){if(this.stopTokenRefresh(),await j.getInstance().clearToken(),this._secretStorage){await this._secretStorage.delete(this.secretKey(we)),await this._secretStorage.delete(this.secretKey(Te));let t=I.getInstance().getProfiles();for(let n of t)await this._secretStorage.delete(this.serverSecretKey(we,n.apiBaseUrl,n.osClient)),await this._secretStorage.delete(this.serverSecretKey(Te,n.apiBaseUrl,n.osClient)),await this._secretStorage.delete(this.legacyServerSecretKey(we,n.apiBaseUrl)),await this._secretStorage.delete(this.legacyServerSecretKey(Te,n.apiBaseUrl))}this._isLoggedIn=!1,await Je.executeCommand("setContext",nt,!1),A.info("Microi: \u5DF2\u9000\u51FA\u767B\u5F55")}};var ci=/^\s*\*?\s*Version\s*:\s*(v\d+\.\d+\.\d+)\s*$/im,qr=/^v(\d+)\.(\d+)\.(\d+)$/;function rn(s){let e=(s||"").trim();if(!e)return null;let t=e.match(qr);if(t)return`v${Number(t[1])}.${Number(t[2])}.${Number(t[3])}`;let n=e.match(ci);return n?rn(n[1]):null}function Qr(s){if(!s)return null;let e=s.match(qr);return e?{major:Number(e[1]),minor:Number(e[2]),patch:Number(e[3])}:null}function li(s,e){return s.major!==e.major?s.major-e.major:s.minor!==e.minor?s.minor-e.minor:s.patch-e.patch}function di(s){let e=null;for(let t of s){let n=Qr(t);n&&(!e||li(n,e)>0)&&(e=n)}return e?`v${e.major}.${e.minor}.${e.patch}`:null}function ui(s){let e=Qr(s);if(!e)return"v1.0.0";let{major:t,minor:n,patch:r}=e;return r<9?`v${t}.${n}.${r+1}`:(r=0,n<9?`v${t}.${n+1}.${r}`:(n=0,t+=1,`v${t}.${n}.${r}`))}function gi(s){let e=(s||"").trim();return e?e.replace(/\r\n/g,`
35
35
  `).split(`
36
36
  `).map(t=>t.trim()).filter(Boolean):["\u8BF7\u8865\u5145\u8BE5 V8 \u4EE3\u7801\u7684\u5B8C\u6574\u529F\u80FD\u8BF4\u660E\u3002"]}function pi(s){let e=s.replace(/\r\n/g,`
@@ -1,13 +1,13 @@
1
1
  {
2
- "builtAt": "2026-09-29T13:47:07.697Z",
2
+ "builtAt": "2026-09-30T11:32:20.100Z",
3
3
  "source": "../microi.skills",
4
4
  "extension": {
5
5
  "name": "v8-engine",
6
- "version": "5.7.5",
6
+ "version": "5.7.7",
7
7
  "publisher": "Microi"
8
8
  },
9
9
  "skills": {
10
- "version": "5.7.5",
10
+ "version": "5.7.7",
11
11
  "versionRule": "Microi version uses three numeric parts. Each publish increments the last part; when a part exceeds 9 it carries to the previous part: 1.0.9 -> 1.1.0, 1.9.9 -> 2.0.0.",
12
12
  "managedBy": "Microi.Agent/bump-version.js"
13
13
  },
@@ -15,11 +15,11 @@
15
15
  "dir": "dist/microi.skills",
16
16
  "files": 189,
17
17
  "skills": 67,
18
- "bytes": 2617992
18
+ "bytes": 2619962
19
19
  },
20
20
  "fileHashes": {
21
- ".microi-skills-version.json": "b4a19bbef5704d6c31fdeace2690444de610aabe35b298300cc6aaa8c179aef6",
22
- ".progressive-disclosure-manifest.json": "218616a92b7aed6415d3841cf514bcebd7e8c399cf54605f2e82e6fe9a28ee53",
21
+ ".microi-skills-version.json": "11530b449fb937580c7ea1ae0346ae14860205867b6ad0dc16212442dba0677d",
22
+ ".progressive-disclosure-manifest.json": "84b2138779ea811fdd689a8247dbb2549edba3365782672f01b54a60b5e13f1b",
23
23
  "README.md": "504222216e683f58bb20c2770ccfe2a50246424a362b33b71036282dae836051",
24
24
  "ai-engine/SKILL.md": "720a92369397c5ab2df5236b892e923a925bffcfcedf0eba58e5d647ca191417",
25
25
  "ai-engine/agents/openai.yaml": "40deb07801006a46b9a7f0020d13251955eeadd04c8e591160210479936f8b5b",
@@ -45,14 +45,14 @@
45
45
  "microi-ai-application/SKILL.md": "71bdf513a35efd8ff68c6c327caad464bc31c7528d7801722bcc7bb2afe22f01",
46
46
  "microi-ai-application/agents/openai.yaml": "8cfacaa0f628d645d3c66166cdd8a3028451d2bc638d3fddf3578df07cfaa9ed",
47
47
  "microi-ai-application/references/frontend-baseline.md": "7b376f95167325cda0d865f72e9a5c8184a916bb020bc5eea307a21289ee9609",
48
- "microi-client-frontend/SKILL.md": "8f178bb755a1f38fea42ec4cff51870a264352b9d71f9a40f4236368352d411e",
48
+ "microi-client-frontend/SKILL.md": "02df9a9db9b23dd692bd6c6c921028689cecaeda8c35f36bc691020f5fb333ed",
49
49
  "microi-client-frontend/references/progressive-01-3-动态按钮系统.md": "0178136c6675568a7423cd4eb936975a8a917a0d9faddbdcfede1611d61d3805",
50
50
  "microi-client-frontend/references/progressive-02-8-运行时高频坑复盘.md": "c0196a475fffd875da10bf5a1689f7a8add828ab9b9d588d58ae6120c25dd8d5",
51
51
  "microi-client-frontend/references/progressive-03-vue3-前端微服务宿主规则.md": "06671fa6c8b1b1b488031fc0b3eea13895e87ff6b5137538f850ee9b676c9d83",
52
52
  "microi-codex-installer/SKILL.md": "30d3a873bdc69abd4ac25028b2f73274b9df76d4768a6019686aafa3cb4f2cf9",
53
53
  "microi-codex-installer/agents/openai.yaml": "46ad108bcb70480506b68b5545692c46cc546e8915bcd2ddb64eb62ce888b6c9",
54
- "microi-codex/SKILL.md": "e2063c01719cc72db17a8a93db702d25a2f9e6e9a43c1dda7f0cfd977e61ee45",
55
- "microi-datasource-mapping/SKILL.md": "0acee5cb6a2b4cb3f56aa5bedcd7170bca739b60f7f966d30b33860ac952c399",
54
+ "microi-codex/SKILL.md": "eca0e33d58f6825e4c3edde34814bf20bbd9da6401142e05c4bddbb0d9a3115a",
55
+ "microi-datasource-mapping/SKILL.md": "051c4636d84c2b791f18aa0761e705f7b638763f17b4a6166c71cadcd2d72bf1",
56
56
  "microi-db-schema/SKILL.md": "abf7f7a5d21fa88561adc5a43deed0b64b4b5808ffc41e25788bb96de2d5fc02",
57
57
  "microi-db-schema/agents/openai.yaml": "c725a2be4c904472f9e46dc4b49aa642c9f3a4437c91a28ba7cc27167497ede7",
58
58
  "microi-db-schema/references/core-tables.md": "a4f7e8f120bf1323d74a618989579d87c7ec1c16adfcf7802ac0d344390ef69c",
@@ -63,7 +63,7 @@
63
63
  "microi-deployment/SKILL.md": "79fa626810b95150a16dcfb2864f8fba06e4f7c01fc8710f5f85cefcc41f2b6c",
64
64
  "microi-deployment/references/deployment-matrix.md": "143b1081ccddd65b1ebb404592684e3bdf0b12b5ea9a6148796f1a25dc0e6871",
65
65
  "microi-docs-coverage/SKILL.md": "ca93c8268d13eda526703ea63a8cc33fa85d9c325386f96349b423cef20e53ba",
66
- "microi-docs-coverage/references/capability-map.md": "bdfde2d54ac20306180faa0d095e9345b07b0613402f4cde3fd3d8c923a53173",
66
+ "microi-docs-coverage/references/capability-map.md": "1e64923bc81940506d9ffb488690f31ca3d9af3e46296524712ee56480bf7e28",
67
67
  "microi-docs-coverage/scripts/audit-doc-skill-coverage.mjs": "99504246f531c127ec268f913c3ca516a1e10d4eefe24b72225f932ba048a5f8",
68
68
  "microi-form-engine/SKILL.md": "9b2608b8736706a6c7aac1e8ce892e417d7917397caceb6a5b0ffd5ddea6d245",
69
69
  "microi-form-engine/references/component-catalog.md": "6fc76110fb856ab078c256cc332a86bc3788f435187c5b6e3a30d7a6d781eeda",
@@ -99,7 +99,7 @@
99
99
  "module-engine/references/module-config.md": "9e8ac8a7f65d6b563f938193d4b7c6b230d878a3513fc2a90c8b780e70ddd353",
100
100
  "ocr-engine/SKILL.md": "1bc49423b7562413073a33cc454bd046f55e23965d06dc966d7bf40192087004",
101
101
  "ocr-engine/agents/openai.yaml": "8d9bfeba3ce644b4652644f851b424ecda0f099694d60bcad0f2874691fb6d00",
102
- "page-engine/SKILL.md": "e235b59ee29a2ac23db25a811730a2c95d488e425c69659bcc791dff4edcf11a",
102
+ "page-engine/SKILL.md": "03b377b61bb584e2cadf21f9d8b10d90aa62abedd98fa85b473b9b692c7d7640",
103
103
  "page-engine/examples/compact-dashboard.json": "4f8d399ea2f6aacf7cbf3790524f5ec5e812c5b930a686bc28c737cc6b96844e",
104
104
  "page-engine/references/progressive-01-所有组件类型.md": "2de112c68482db5cc47e91fbb5ea0cd45bd209166c12c30e0896dd74bfb7892e",
105
105
  "page-engine/references/progressive-02-版本历史-并发保存与回滚.md": "913e6b3aa486761f7e76df1f40ee676e485f87601c2f62d1b03978d425452016",
@@ -209,195 +209,195 @@
209
209
  "workspace-conventions/references/progressive-03-cli-与-ide-插件错版共存约定.md": "225ee599f8810a614ffcc19fd082829cf2e8ef55a0ce7428ba8a4ede0fdb0e3c"
210
210
  },
211
211
  "fileVersions": {
212
- ".microi-skills-version.json": "5.7.5",
213
- ".progressive-disclosure-manifest.json": "5.7.5",
214
- "README.md": "5.7.5",
215
- "ai-engine/SKILL.md": "5.7.5",
216
- "ai-engine/agents/openai.yaml": "5.7.5",
217
- "ai-engine/references/ai-employees.md": "5.7.5",
218
- "ai-engine/references/self-hosted-digital-human.md": "5.7.5",
219
- "ai-platform-governance/SKILL.md": "5.7.5",
220
- "ai-platform-governance/references/progressive-01-功能开关.md": "5.7.5",
221
- "app-store/SKILL.md": "5.7.5",
222
- "app-store/agents/openai.yaml": "5.7.5",
223
- "business-blueprint/SKILL.md": "5.7.5",
224
- "datasource-engine/SKILL.md": "5.7.5",
225
- "datasource-engine/agents/openai.yaml": "5.7.5",
226
- "dos-orm/SKILL.md": "5.7.5",
227
- "dos-orm/references/api-reference.md": "5.7.5",
228
- "email-engine/SKILL.md": "5.7.5",
229
- "email-engine/references/v8-email.md": "5.7.5",
230
- "job-engine/SKILL.md": "5.7.5",
231
- "job-engine/agents/openai.yaml": "5.7.5",
232
- "message-notification/SKILL.md": "5.7.5",
233
- "message-notification/agents/openai.yaml": "5.7.5",
234
- "message-notification/references/contracts.md": "5.7.5",
235
- "microi-ai-app-auth.js": "5.7.5",
236
- "microi-ai-application/SKILL.md": "5.7.5",
237
- "microi-ai-application/agents/openai.yaml": "5.7.5",
238
- "microi-ai-application/references/frontend-baseline.md": "5.7.5",
239
- "microi-client-frontend/SKILL.md": "5.7.5",
240
- "microi-client-frontend/references/progressive-01-3-动态按钮系统.md": "5.7.5",
241
- "microi-client-frontend/references/progressive-02-8-运行时高频坑复盘.md": "5.7.5",
242
- "microi-client-frontend/references/progressive-03-vue3-前端微服务宿主规则.md": "5.7.5",
243
- "microi-codex-installer/SKILL.md": "5.7.5",
244
- "microi-codex-installer/agents/openai.yaml": "5.7.5",
245
- "microi-codex/SKILL.md": "5.7.5",
246
- "microi-datasource-mapping/SKILL.md": "5.7.5",
247
- "microi-db-schema/SKILL.md": "5.7.5",
248
- "microi-db-schema/agents/openai.yaml": "5.7.5",
249
- "microi-db-schema/references/core-tables.md": "5.7.5",
250
- "microi-db-schema/references/form-component-options.md": "5.7.5",
251
- "microi-db-schema/references/schema-overview.md": "5.7.5",
252
- "microi-db-schema/references/schema.md": "5.7.5",
253
- "microi-db-schema/references/table-catalog.md": "5.7.5",
254
- "microi-deployment/SKILL.md": "5.7.5",
255
- "microi-deployment/references/deployment-matrix.md": "5.7.5",
256
- "microi-docs-coverage/SKILL.md": "5.7.5",
257
- "microi-docs-coverage/references/capability-map.md": "5.7.5",
258
- "microi-docs-coverage/scripts/audit-doc-skill-coverage.mjs": "5.7.5",
259
- "microi-form-engine/SKILL.md": "5.7.5",
260
- "microi-form-engine/references/component-catalog.md": "5.7.5",
261
- "microi-form-engine/references/data-source-events.md": "5.7.5",
262
- "microi-form-layout/SKILL.md": "5.7.5",
263
- "microi-form-layout/references/progressive-01-3-三种分组的存储与配置.md": "5.7.5",
264
- "microi-frontend-sdk/SKILL.md": "5.7.5",
265
- "microi-frontend-sdk/references/progressive-01-token-当前登录用户与当前终端登录协议.md": "5.7.5",
266
- "microi-left-right-layout/SKILL.md": "5.7.5",
267
- "microi-microservice/SKILL.md": "5.7.5",
268
- "microi-microservice/references/runtime-delivery.md": "5.7.5",
269
- "microi-mobile-app-quality/SKILL.md": "5.7.5",
270
- "microi-mobile-app-quality/references/progressive-01-4-重要按钮必须带图标.md": "5.7.5",
271
- "microi-mobile-app-quality/references/progressive-02-9-主题切换必须真实且全局生效.md": "5.7.5",
272
- "microi-solution-quotation/SKILL.md": "5.7.5",
273
- "microi-solution-quotation/agents/openai.yaml": "5.7.5",
274
- "microi-solution-quotation/scripts/build_solution_quote.py": "5.7.5",
275
- "microi-sso/SKILL.md": "5.7.5",
276
- "microi-sso/references/acceptance.md": "5.7.5",
277
- "microi-sso/references/configuration-and-security.md": "5.7.5",
278
- "microi-sso/references/inbound.md": "5.7.5",
279
- "microi-sso/references/outbound.md": "5.7.5",
280
- "microi-system-delivery/SKILL.md": "5.7.5",
281
- "microi-system-delivery/references/progressive-01-标准工作流.md": "5.7.5",
282
- "microi-system-delivery/references/progressive-02-自动化测试必须覆盖的坑.md": "5.7.5",
283
- "microi-ui/SKILL.md": "5.7.5",
284
- "microi-ui/references/progressive-01-移动端场景蓝图.md": "5.7.5",
285
- "microi-uniapp-frontend/SKILL.md": "5.7.5",
286
- "microi-uniapp-frontend/references/progressive-01-移动端分类-双栏列表独立滚动.md": "5.7.5",
287
- "microi-uniapp-frontend/references/progressive-02-关键业务资产不得默认选中.md": "5.7.5",
288
- "microi.v8.js": "5.7.5",
289
- "module-engine/SKILL.md": "5.7.5",
290
- "module-engine/references/module-config.md": "5.7.5",
291
- "ocr-engine/SKILL.md": "5.7.5",
292
- "ocr-engine/agents/openai.yaml": "5.7.5",
293
- "page-engine/SKILL.md": "5.7.5",
294
- "page-engine/examples/compact-dashboard.json": "5.7.5",
295
- "page-engine/references/progressive-01-所有组件类型.md": "5.7.5",
296
- "page-engine/references/progressive-02-版本历史-并发保存与回滚.md": "5.7.5",
297
- "performance-testing/SKILL.md": "5.7.5",
298
- "playwright-e2e/SKILL.md": "5.7.5",
299
- "playwright-e2e/references/progressive-01-全自动登录-免验证码-但不免密码-必读.md": "5.7.5",
300
- "playwright-e2e/references/progressive-02-文字对比度与可读性自动化检查-必做.md": "5.7.5",
301
- "playwright-e2e/references/progressive-03-microi-helper-模板.md": "5.7.5",
302
- "playwright-e2e/references/progressive-04-ci-建议.md": "5.7.5",
303
- "print-engine/SKILL.md": "5.7.5",
304
- "production-readonly-audit/SKILL.md": "5.7.5",
305
- "report-engine/SKILL.md": "5.7.5",
306
- "report-engine/agents/openai.yaml": "5.7.5",
307
- "scripts/optimize-progressive-disclosure.mjs": "5.7.5",
308
- "scripts/refresh-progressive-disclosure.mjs": "5.7.5",
309
- "scripts/sync-embedded-skills.mjs": "5.7.5",
310
- "scripts/validate-progressive-disclosure.mjs": "5.7.5",
311
- "search-engine/SKILL.md": "5.7.5",
312
- "search-engine/agents/openai.yaml": "5.7.5",
313
- "spider-engine/SKILL.md": "5.7.5",
314
- "system-observability/SKILL.md": "5.7.5",
315
- "system-observability/references/memory-incident-triage.md": "5.7.5",
316
- "translate-engine/SKILL.md": "5.7.5",
317
- "translate-engine/agents/openai.yaml": "5.7.5",
318
- "ui-design/SKILL.md": "5.7.5",
319
- "ui-design/assets/pattern-showcase/app.js": "5.7.5",
320
- "ui-design/assets/pattern-showcase/index.html": "5.7.5",
321
- "ui-design/assets/pattern-showcase/styles.css": "5.7.5",
322
- "ui-design/assets/templates/MCI-DESIGN.md": "5.7.5",
323
- "ui-design/references/design-pattern-library.md": "5.7.5",
324
- "ui-design/references/mci-design-contract.md": "5.7.5",
325
- "ui-design/references/motion-and-media.md": "5.7.5",
326
- "ui-design/references/product-flow-recipes.md": "5.7.5",
327
- "ui-design/references/progressive-01-颜色体系-css-variables-支持主题切换.md": "5.7.5",
328
- "ui-design/references/progressive-02-字体.md": "5.7.5",
329
- "ui-design/references/progressive-03-动效规范-丰富但不卡.md": "5.7.5",
330
- "ui-design/references/progressive-04-组件风格速查.md": "5.7.5",
331
- "ui-design/references/progressive-05-移动端专用规范.md": "5.7.5",
332
- "ui-design/references/progressive-06-主题切换实现.md": "5.7.5",
333
- "ui-design/references/progressive-07-速查-从头搭建一个移动端页面.md": "5.7.5",
334
- "ui-design/references/progressive-08-表单分组规范-tabs-vs-collapsegroup-强制.md": "5.7.5",
335
- "uniapp-mall-assets/SKILL.md": "5.7.5",
336
- "unity-integration/SKILL.md": "5.7.5",
337
- "unity-integration/agents/openai.yaml": "5.7.5",
338
- "unity-integration/references/ai-app-delivery.md": "5.7.5",
339
- "unity-integration/references/sdk-api.md": "5.7.5",
340
- "unity-integration/references/toolbox-migration.md": "5.7.5",
341
- "unity-integration/references/webgl-hosting.md": "5.7.5",
342
- "v8-api-config/SKILL.md": "5.7.5",
343
- "v8-cache-pattern/SKILL.md": "5.7.5",
344
- "v8-crud-api/SKILL.md": "5.7.5",
345
- "v8-crud-api/references/progressive-01-查询列表-分页.md": "5.7.5",
346
- "v8-crud-api/references/progressive-02-where-条件语法速查.md": "5.7.5",
347
- "v8-debugging/SKILL.md": "5.7.5",
348
- "v8-explorer-tree/SKILL.md": "5.7.5",
349
- "v8-export-import/SKILL.md": "5.7.5",
350
- "v8-export-import/references/progressive-01-excellayout-高级自由布局.md": "5.7.5",
351
- "v8-export-import/references/progressive-02-powerpoint-导出.md": "5.7.5",
352
- "v8-export-import/references/progressive-03-安全-性能注意.md": "5.7.5",
353
- "v8-file-upload/SKILL.md": "5.7.5",
354
- "v8-file-upload/references/progressive-01-公有桶-vs-私有桶.md": "5.7.5",
355
- "v8-file-upload/references/progressive-02-office-文件在线编辑版本号规则.md": "5.7.5",
356
- "v8-formengine-http/SKILL.md": "5.7.5",
357
- "v8-frontend-events/SKILL.md": "5.7.5",
358
- "v8-frontend-events/references/bluetooth-print-api.md": "5.7.5",
359
- "v8-frontend-events/references/bluetooth-print.md": "5.7.5",
360
- "v8-frontend-events/references/progressive-01-列表事件.md": "5.7.5",
361
- "v8-http-integration/SKILL.md": "5.7.5",
362
- "v8-http-integration/references/progressive-01-get-请求.md": "5.7.5",
363
- "v8-http-integration/references/progressive-02-错误处理模式.md": "5.7.5",
364
- "v8-image-processing/SKILL.md": "5.7.5",
365
- "v8-image-processing/agents/openai.yaml": "5.7.5",
366
- "v8-image-processing/references/api-reference.md": "5.7.5",
367
- "v8-menu-buttons/SKILL.md": "5.7.5",
368
- "v8-menu-buttons/references/progressive-01-2-按钮对象-schema.md": "5.7.5",
369
- "v8-menu-buttons/references/progressive-02-8-模式-f-后台任务按钮-长任务.md": "5.7.5",
370
- "v8-menu-buttons/references/progressive-03-10-反模式-避免.md": "5.7.5",
371
- "v8-mongodb/SKILL.md": "5.7.5",
372
- "v8-mq-mqtt/SKILL.md": "5.7.5",
373
- "v8-mq-mqtt/references/mqtt-production.md": "5.7.5",
374
- "v8-mq-mqtt/references/progressive-01-v8-mqtt-iot-物联网.md": "5.7.5",
375
- "v8-mq-mqtt/scripts/check-mqtt-skill-coverage.mjs": "5.7.5",
376
- "v8-saas-multi-tenant/SKILL.md": "5.7.5",
377
- "v8-security/SKILL.md": "5.7.5",
378
- "v8-security/references/progressive-01-2-权限校验.md": "5.7.5",
379
- "v8-security/references/progressive-02-7-日志记录.md": "5.7.5",
380
- "v8-sql-query/SKILL.md": "5.7.5",
381
- "v8-table-event/SKILL.md": "5.7.5",
382
- "v8-table-event/references/progressive-01-informv8-js-表单打开事件.md": "5.7.5",
383
- "v8-table-event/references/progressive-02-前端事件名-v8-eventname-可能的值.md": "5.7.5",
384
- "v8-tcp-integration/SKILL.md": "5.7.5",
385
- "v8-tcp-integration/agents/openai.yaml": "5.7.5",
386
- "v8-template-engine/SKILL.md": "5.7.5",
387
- "v8-utilities/SKILL.md": "5.7.5",
388
- "v8-utilities/references/client-api-index.md": "5.7.5",
389
- "v8-utilities/references/platform-http-routes.md": "5.7.5",
390
- "v8-utilities/references/server-api-index.md": "5.7.5",
391
- "v8-workflow/SKILL.md": "5.7.5",
392
- "v8-workflow/references/progressive-01-节点开始-v8-事件.md": "5.7.5",
393
- "v8-workflow/references/workflow-configuration.md": "5.7.5",
394
- "vision-engine/SKILL.md": "5.7.5",
395
- "vision-engine/agents/openai.yaml": "5.7.5",
396
- "vision-engine/references/architecture-and-acceptance.md": "5.7.5",
397
- "workspace-conventions/SKILL.md": "5.7.5",
398
- "workspace-conventions/references/progressive-01-版本更新日志保护规则-强制.md": "5.7.5",
399
- "workspace-conventions/references/progressive-02-microi-net-api-本地启动约定.md": "5.7.5",
400
- "workspace-conventions/references/progressive-03-cli-与-ide-插件错版共存约定.md": "5.7.5"
212
+ ".microi-skills-version.json": "5.7.7",
213
+ ".progressive-disclosure-manifest.json": "5.7.7",
214
+ "README.md": "5.7.7",
215
+ "ai-engine/SKILL.md": "5.7.7",
216
+ "ai-engine/agents/openai.yaml": "5.7.7",
217
+ "ai-engine/references/ai-employees.md": "5.7.7",
218
+ "ai-engine/references/self-hosted-digital-human.md": "5.7.7",
219
+ "ai-platform-governance/SKILL.md": "5.7.7",
220
+ "ai-platform-governance/references/progressive-01-功能开关.md": "5.7.7",
221
+ "app-store/SKILL.md": "5.7.7",
222
+ "app-store/agents/openai.yaml": "5.7.7",
223
+ "business-blueprint/SKILL.md": "5.7.7",
224
+ "datasource-engine/SKILL.md": "5.7.7",
225
+ "datasource-engine/agents/openai.yaml": "5.7.7",
226
+ "dos-orm/SKILL.md": "5.7.7",
227
+ "dos-orm/references/api-reference.md": "5.7.7",
228
+ "email-engine/SKILL.md": "5.7.7",
229
+ "email-engine/references/v8-email.md": "5.7.7",
230
+ "job-engine/SKILL.md": "5.7.7",
231
+ "job-engine/agents/openai.yaml": "5.7.7",
232
+ "message-notification/SKILL.md": "5.7.7",
233
+ "message-notification/agents/openai.yaml": "5.7.7",
234
+ "message-notification/references/contracts.md": "5.7.7",
235
+ "microi-ai-app-auth.js": "5.7.7",
236
+ "microi-ai-application/SKILL.md": "5.7.7",
237
+ "microi-ai-application/agents/openai.yaml": "5.7.7",
238
+ "microi-ai-application/references/frontend-baseline.md": "5.7.7",
239
+ "microi-client-frontend/SKILL.md": "5.7.7",
240
+ "microi-client-frontend/references/progressive-01-3-动态按钮系统.md": "5.7.7",
241
+ "microi-client-frontend/references/progressive-02-8-运行时高频坑复盘.md": "5.7.7",
242
+ "microi-client-frontend/references/progressive-03-vue3-前端微服务宿主规则.md": "5.7.7",
243
+ "microi-codex-installer/SKILL.md": "5.7.7",
244
+ "microi-codex-installer/agents/openai.yaml": "5.7.7",
245
+ "microi-codex/SKILL.md": "5.7.7",
246
+ "microi-datasource-mapping/SKILL.md": "5.7.7",
247
+ "microi-db-schema/SKILL.md": "5.7.7",
248
+ "microi-db-schema/agents/openai.yaml": "5.7.7",
249
+ "microi-db-schema/references/core-tables.md": "5.7.7",
250
+ "microi-db-schema/references/form-component-options.md": "5.7.7",
251
+ "microi-db-schema/references/schema-overview.md": "5.7.7",
252
+ "microi-db-schema/references/schema.md": "5.7.7",
253
+ "microi-db-schema/references/table-catalog.md": "5.7.7",
254
+ "microi-deployment/SKILL.md": "5.7.7",
255
+ "microi-deployment/references/deployment-matrix.md": "5.7.7",
256
+ "microi-docs-coverage/SKILL.md": "5.7.7",
257
+ "microi-docs-coverage/references/capability-map.md": "5.7.7",
258
+ "microi-docs-coverage/scripts/audit-doc-skill-coverage.mjs": "5.7.7",
259
+ "microi-form-engine/SKILL.md": "5.7.7",
260
+ "microi-form-engine/references/component-catalog.md": "5.7.7",
261
+ "microi-form-engine/references/data-source-events.md": "5.7.7",
262
+ "microi-form-layout/SKILL.md": "5.7.7",
263
+ "microi-form-layout/references/progressive-01-3-三种分组的存储与配置.md": "5.7.7",
264
+ "microi-frontend-sdk/SKILL.md": "5.7.7",
265
+ "microi-frontend-sdk/references/progressive-01-token-当前登录用户与当前终端登录协议.md": "5.7.7",
266
+ "microi-left-right-layout/SKILL.md": "5.7.7",
267
+ "microi-microservice/SKILL.md": "5.7.7",
268
+ "microi-microservice/references/runtime-delivery.md": "5.7.7",
269
+ "microi-mobile-app-quality/SKILL.md": "5.7.7",
270
+ "microi-mobile-app-quality/references/progressive-01-4-重要按钮必须带图标.md": "5.7.7",
271
+ "microi-mobile-app-quality/references/progressive-02-9-主题切换必须真实且全局生效.md": "5.7.7",
272
+ "microi-solution-quotation/SKILL.md": "5.7.7",
273
+ "microi-solution-quotation/agents/openai.yaml": "5.7.7",
274
+ "microi-solution-quotation/scripts/build_solution_quote.py": "5.7.7",
275
+ "microi-sso/SKILL.md": "5.7.7",
276
+ "microi-sso/references/acceptance.md": "5.7.7",
277
+ "microi-sso/references/configuration-and-security.md": "5.7.7",
278
+ "microi-sso/references/inbound.md": "5.7.7",
279
+ "microi-sso/references/outbound.md": "5.7.7",
280
+ "microi-system-delivery/SKILL.md": "5.7.7",
281
+ "microi-system-delivery/references/progressive-01-标准工作流.md": "5.7.7",
282
+ "microi-system-delivery/references/progressive-02-自动化测试必须覆盖的坑.md": "5.7.7",
283
+ "microi-ui/SKILL.md": "5.7.7",
284
+ "microi-ui/references/progressive-01-移动端场景蓝图.md": "5.7.7",
285
+ "microi-uniapp-frontend/SKILL.md": "5.7.7",
286
+ "microi-uniapp-frontend/references/progressive-01-移动端分类-双栏列表独立滚动.md": "5.7.7",
287
+ "microi-uniapp-frontend/references/progressive-02-关键业务资产不得默认选中.md": "5.7.7",
288
+ "microi.v8.js": "5.7.7",
289
+ "module-engine/SKILL.md": "5.7.7",
290
+ "module-engine/references/module-config.md": "5.7.7",
291
+ "ocr-engine/SKILL.md": "5.7.7",
292
+ "ocr-engine/agents/openai.yaml": "5.7.7",
293
+ "page-engine/SKILL.md": "5.7.7",
294
+ "page-engine/examples/compact-dashboard.json": "5.7.7",
295
+ "page-engine/references/progressive-01-所有组件类型.md": "5.7.7",
296
+ "page-engine/references/progressive-02-版本历史-并发保存与回滚.md": "5.7.7",
297
+ "performance-testing/SKILL.md": "5.7.7",
298
+ "playwright-e2e/SKILL.md": "5.7.7",
299
+ "playwright-e2e/references/progressive-01-全自动登录-免验证码-但不免密码-必读.md": "5.7.7",
300
+ "playwright-e2e/references/progressive-02-文字对比度与可读性自动化检查-必做.md": "5.7.7",
301
+ "playwright-e2e/references/progressive-03-microi-helper-模板.md": "5.7.7",
302
+ "playwright-e2e/references/progressive-04-ci-建议.md": "5.7.7",
303
+ "print-engine/SKILL.md": "5.7.7",
304
+ "production-readonly-audit/SKILL.md": "5.7.7",
305
+ "report-engine/SKILL.md": "5.7.7",
306
+ "report-engine/agents/openai.yaml": "5.7.7",
307
+ "scripts/optimize-progressive-disclosure.mjs": "5.7.7",
308
+ "scripts/refresh-progressive-disclosure.mjs": "5.7.7",
309
+ "scripts/sync-embedded-skills.mjs": "5.7.7",
310
+ "scripts/validate-progressive-disclosure.mjs": "5.7.7",
311
+ "search-engine/SKILL.md": "5.7.7",
312
+ "search-engine/agents/openai.yaml": "5.7.7",
313
+ "spider-engine/SKILL.md": "5.7.7",
314
+ "system-observability/SKILL.md": "5.7.7",
315
+ "system-observability/references/memory-incident-triage.md": "5.7.7",
316
+ "translate-engine/SKILL.md": "5.7.7",
317
+ "translate-engine/agents/openai.yaml": "5.7.7",
318
+ "ui-design/SKILL.md": "5.7.7",
319
+ "ui-design/assets/pattern-showcase/app.js": "5.7.7",
320
+ "ui-design/assets/pattern-showcase/index.html": "5.7.7",
321
+ "ui-design/assets/pattern-showcase/styles.css": "5.7.7",
322
+ "ui-design/assets/templates/MCI-DESIGN.md": "5.7.7",
323
+ "ui-design/references/design-pattern-library.md": "5.7.7",
324
+ "ui-design/references/mci-design-contract.md": "5.7.7",
325
+ "ui-design/references/motion-and-media.md": "5.7.7",
326
+ "ui-design/references/product-flow-recipes.md": "5.7.7",
327
+ "ui-design/references/progressive-01-颜色体系-css-variables-支持主题切换.md": "5.7.7",
328
+ "ui-design/references/progressive-02-字体.md": "5.7.7",
329
+ "ui-design/references/progressive-03-动效规范-丰富但不卡.md": "5.7.7",
330
+ "ui-design/references/progressive-04-组件风格速查.md": "5.7.7",
331
+ "ui-design/references/progressive-05-移动端专用规范.md": "5.7.7",
332
+ "ui-design/references/progressive-06-主题切换实现.md": "5.7.7",
333
+ "ui-design/references/progressive-07-速查-从头搭建一个移动端页面.md": "5.7.7",
334
+ "ui-design/references/progressive-08-表单分组规范-tabs-vs-collapsegroup-强制.md": "5.7.7",
335
+ "uniapp-mall-assets/SKILL.md": "5.7.7",
336
+ "unity-integration/SKILL.md": "5.7.7",
337
+ "unity-integration/agents/openai.yaml": "5.7.7",
338
+ "unity-integration/references/ai-app-delivery.md": "5.7.7",
339
+ "unity-integration/references/sdk-api.md": "5.7.7",
340
+ "unity-integration/references/toolbox-migration.md": "5.7.7",
341
+ "unity-integration/references/webgl-hosting.md": "5.7.7",
342
+ "v8-api-config/SKILL.md": "5.7.7",
343
+ "v8-cache-pattern/SKILL.md": "5.7.7",
344
+ "v8-crud-api/SKILL.md": "5.7.7",
345
+ "v8-crud-api/references/progressive-01-查询列表-分页.md": "5.7.7",
346
+ "v8-crud-api/references/progressive-02-where-条件语法速查.md": "5.7.7",
347
+ "v8-debugging/SKILL.md": "5.7.7",
348
+ "v8-explorer-tree/SKILL.md": "5.7.7",
349
+ "v8-export-import/SKILL.md": "5.7.7",
350
+ "v8-export-import/references/progressive-01-excellayout-高级自由布局.md": "5.7.7",
351
+ "v8-export-import/references/progressive-02-powerpoint-导出.md": "5.7.7",
352
+ "v8-export-import/references/progressive-03-安全-性能注意.md": "5.7.7",
353
+ "v8-file-upload/SKILL.md": "5.7.7",
354
+ "v8-file-upload/references/progressive-01-公有桶-vs-私有桶.md": "5.7.7",
355
+ "v8-file-upload/references/progressive-02-office-文件在线编辑版本号规则.md": "5.7.7",
356
+ "v8-formengine-http/SKILL.md": "5.7.7",
357
+ "v8-frontend-events/SKILL.md": "5.7.7",
358
+ "v8-frontend-events/references/bluetooth-print-api.md": "5.7.7",
359
+ "v8-frontend-events/references/bluetooth-print.md": "5.7.7",
360
+ "v8-frontend-events/references/progressive-01-列表事件.md": "5.7.7",
361
+ "v8-http-integration/SKILL.md": "5.7.7",
362
+ "v8-http-integration/references/progressive-01-get-请求.md": "5.7.7",
363
+ "v8-http-integration/references/progressive-02-错误处理模式.md": "5.7.7",
364
+ "v8-image-processing/SKILL.md": "5.7.7",
365
+ "v8-image-processing/agents/openai.yaml": "5.7.7",
366
+ "v8-image-processing/references/api-reference.md": "5.7.7",
367
+ "v8-menu-buttons/SKILL.md": "5.7.7",
368
+ "v8-menu-buttons/references/progressive-01-2-按钮对象-schema.md": "5.7.7",
369
+ "v8-menu-buttons/references/progressive-02-8-模式-f-后台任务按钮-长任务.md": "5.7.7",
370
+ "v8-menu-buttons/references/progressive-03-10-反模式-避免.md": "5.7.7",
371
+ "v8-mongodb/SKILL.md": "5.7.7",
372
+ "v8-mq-mqtt/SKILL.md": "5.7.7",
373
+ "v8-mq-mqtt/references/mqtt-production.md": "5.7.7",
374
+ "v8-mq-mqtt/references/progressive-01-v8-mqtt-iot-物联网.md": "5.7.7",
375
+ "v8-mq-mqtt/scripts/check-mqtt-skill-coverage.mjs": "5.7.7",
376
+ "v8-saas-multi-tenant/SKILL.md": "5.7.7",
377
+ "v8-security/SKILL.md": "5.7.7",
378
+ "v8-security/references/progressive-01-2-权限校验.md": "5.7.7",
379
+ "v8-security/references/progressive-02-7-日志记录.md": "5.7.7",
380
+ "v8-sql-query/SKILL.md": "5.7.7",
381
+ "v8-table-event/SKILL.md": "5.7.7",
382
+ "v8-table-event/references/progressive-01-informv8-js-表单打开事件.md": "5.7.7",
383
+ "v8-table-event/references/progressive-02-前端事件名-v8-eventname-可能的值.md": "5.7.7",
384
+ "v8-tcp-integration/SKILL.md": "5.7.7",
385
+ "v8-tcp-integration/agents/openai.yaml": "5.7.7",
386
+ "v8-template-engine/SKILL.md": "5.7.7",
387
+ "v8-utilities/SKILL.md": "5.7.7",
388
+ "v8-utilities/references/client-api-index.md": "5.7.7",
389
+ "v8-utilities/references/platform-http-routes.md": "5.7.7",
390
+ "v8-utilities/references/server-api-index.md": "5.7.7",
391
+ "v8-workflow/SKILL.md": "5.7.7",
392
+ "v8-workflow/references/progressive-01-节点开始-v8-事件.md": "5.7.7",
393
+ "v8-workflow/references/workflow-configuration.md": "5.7.7",
394
+ "vision-engine/SKILL.md": "5.7.7",
395
+ "vision-engine/agents/openai.yaml": "5.7.7",
396
+ "vision-engine/references/architecture-and-acceptance.md": "5.7.7",
397
+ "workspace-conventions/SKILL.md": "5.7.7",
398
+ "workspace-conventions/references/progressive-01-版本更新日志保护规则-强制.md": "5.7.7",
399
+ "workspace-conventions/references/progressive-02-microi-net-api-本地启动约定.md": "5.7.7",
400
+ "workspace-conventions/references/progressive-03-cli-与-ide-插件错版共存约定.md": "5.7.7"
401
401
  },
402
402
  "files": [
403
403
  ".microi-skills-version.json",