@2api-store/activate 0.5.2 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activate.mjs +2 -0
- package/dist/lib/api.mjs +1 -0
- package/dist/lib/backup.mjs +1 -0
- package/dist/lib/cmds.mjs +1 -0
- package/dist/lib/detect.mjs +1 -0
- package/dist/lib/device.mjs +1 -0
- package/dist/lib/install.mjs +1 -0
- package/dist/lib/platforms.mjs +1 -0
- package/dist/lib/pow.mjs +1 -0
- package/dist/lib/prompt.mjs +1 -0
- package/dist/lib/render.mjs +1 -0
- package/dist/lib/ui.mjs +1 -0
- package/dist/lib/write.mjs +1 -0
- package/dist/package.json +5 -0
- package/package.json +10 -5
- package/activate.mjs +0 -540
- package/lib/api.mjs +0 -184
- package/lib/backup.mjs +0 -109
- package/lib/cmds.mjs +0 -546
- package/lib/detect.mjs +0 -122
- package/lib/install.mjs +0 -110
- package/lib/platforms.mjs +0 -123
- package/lib/prompt.mjs +0 -160
- package/lib/render.mjs +0 -94
- package/lib/ui.mjs +0 -90
- package/lib/write.mjs +0 -57
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const _0x1a5267=_0x4a37;(function(_0x109892,_0x30bde3){const _0x3b5d45=_0x4a37,_0x1b9405=_0x109892();while(!![]){try{const _0x1c3a4a=parseInt(_0x3b5d45(0x1e0))/0x1*(-parseInt(_0x3b5d45(0x1da))/0x2)+-parseInt(_0x3b5d45(0x22a))/0x3+-parseInt(_0x3b5d45(0x187))/0x4+-parseInt(_0x3b5d45(0x1ea))/0x5*(parseInt(_0x3b5d45(0x252))/0x6)+-parseInt(_0x3b5d45(0x215))/0x7*(-parseInt(_0x3b5d45(0x1bb))/0x8)+parseInt(_0x3b5d45(0x1b1))/0x9*(parseInt(_0x3b5d45(0x265))/0xa)+-parseInt(_0x3b5d45(0x18e))/0xb*(-parseInt(_0x3b5d45(0x264))/0xc);if(_0x1c3a4a===_0x30bde3)break;else _0x1b9405['push'](_0x1b9405['shift']());}catch(_0x147c8b){_0x1b9405['push'](_0x1b9405['shift']());}}}(_0x2c7f,0x3192a),(process[_0x1a5267(0x1e1)]('warning'),process['env'][_0x1a5267(0x24a)]='1'));import{detectAll as _0x554da3}from'./lib/detect.mjs';import{cliActivate as _0x49454e,listGroups as _0x3de344,verifyApiKey as _0xbc128b}from'./lib/api.mjs';import{renderContent as _0x2e8cd3,expandPath as _0x4cf4c7,listModels as _0x4241e9}from'./lib/render.mjs';import{backupFile as _0x7b87ad}from'./lib/backup.mjs';import{writeFileWithPermission as _0x1edfeb,PermissionDeniedError as _0x4e346a}from'./lib/write.mjs';function _0x2c7f(){const _0x122d6a=['uBkCp','已写入\x20','(ID\x20','api_key','configs','选择\x20CLI','PowerShell','\x20\x20备份:','wlmdt','API\x20Key','--dry-run','uTEPL','dSImR','2OoVaka','EEZIg','client_type','hotWX','is_new','激活失败:','280743umuWjh','removeAllListeners','env','\x20无可自动安装的\x20npm\x20包,请手动安装后重跑(配置仍会写入)','xqACY','redeem','clientType','lWaAG','XztpQ','sk-','105SXZRqk','handler','usage','startCmd','email','macOS','toLowerCase','ukPyq','未检测到\x20codex/claude/gemini/grok/opencode(可在后续步骤按需自动安装)','部分文件权限不足,请按提示用\x20sudo\x20/\x20管理员\x20PowerShell\x20重跑:','CfVPB','已选默认模型:','RpSqr','\x20安装失败:','\x20\x20sudo\x20npx\x20-y\x20@2api-store/activate','has','已写入','\x20安装成功','replace','startsWith','BWyWY','cGYSk','stack','TgYJe','apiBase','QEroQ','nPXuy','选择默认模型(最新优先)','TJYJr','选择要激活的\x20CLI(绿色=已装,灰色=未装;默认选主\x20CLI,独立\x20CLI\x20默认不选)','AKouQ','请求\x20GET\x20/v1/models…','\x20\x20[试运行]\x20不真实写入','NQTRV','xbOcA','isLinux','error','aEVBt','DMAQV','GKfMJ','\x20个文件','FMpup','IDnPf','7plalvG','\x20\x20内容预览:','dim','qqyPH','VcydN','需要\x20node\x20>=\x2018,当前\x20','displayName','\x20项:','DjuMX','rBCSF','cOobr','OOxjn','\x20已创建,请查收邮件获取初始密码,登录后尽快修改。','CDhVT','isWindows','请输入邮箱(用于兑换码绑定\x20/\x20新账号创建)','node','输入模型\x20ID(如\x20gpt-5.6-terra)','join','PalhW','supported','435264OSXvyO','user-declined','Linux','action','catch','(新用户已创建)','iAujG','/antigravity','lCrOb','获取可用分组','jxorM','--version','name','map','QsAur','验证未通过:','请求激活服务','includes','hFlmE','UmKOv','user','forEach','alreadyInstalled','cli','cuoOW','written','IVfuf','key','green','content','MdBZC','未选择分组','NODE_NO_WARNINGS','\x20\x20目标:','message','unknown','filter','help','kZJhY','已跳过\x20','2154loQmzf','\x20安装(','all','已选分组:','(命令\x20','未查询到可用分组。请联系管理员开通分组后再激活。','string','exit','models','iVfEQ','\x20·\x20node\x20v','MVaGj','\x20\x20\x20\x20','(独立\x20CLI)','empty','version','hJeOE','HTTP\x20','1373292fCtFge','148830zznJtZ','(配置仍会写入,但请手动安装后使用)','chwQd','ETsuu','eQaam','platform','【试运行模式\x20--dry-run】不会真写文件、不会真装\x20CLI','写入失败:','log','服务端未返回适配当前系统的配置模板','bGZTy','子命令\x20','服务端未返回模型列表,{{defaultModel}}\x20将留空','检查\x20CLI\x20安装状态','QbRMg','rftqM','\x20──','Windows','VpMTT','验证\x20API\x20Key','\x20个文件(未真实写入)','dxtGL','\x0a\x0a环境变量:\x0a\x20\x20ACTIVATE_API_BASE\x20\x20\x20\x20\x20\x20覆盖\x20API\x20端点(同\x20--api-base)\x0a\x0a示例:\x0a\x20\x20npx\x20@2api-store/activate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20默认激活\x0a\x20\x20npx\x20@2api-store/activate\x20--dry-run\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20试运行\x0a\x20\x20npx\x20@2api-store/activate\x20--platform\x20openai\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20只激活\x20openai\x0a\x20\x20npx\x20@2api-store/activate\x20restore\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20从备份恢复\x0a\x20\x20npx\x20@2api-store/activate\x20reset\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20恢复官方默认\x0a\x20\x20npx\x20@2api-store/activate\x20refresh-groups\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20查看可用分组\x0a\x20\x20ACTIVATE_API_BASE=http://127.0.0.1:5566\x20npx\x20@2api-store/activate\x0a\x0a退出码:\x0a\x20\x200\x20\x20成功\x0a\x20\x201\x20\x20输入错误\x20/\x20网络失败\x20/\x20致命错误\x0a\x20\x202\x20\x20部分文件权限不足(请按提示用\x20sudo\x20/\x20管理员\x20PowerShell\x20重跑)\x0a\x20\x203\x20\x20其他写入失败\x0a','config','kaslt','iSpvB','(跳过此文件避免无备份覆盖)','statusCode','backup','AegBr','os_type','cYwAK','WOVFF','DcHds','hJtXf','length','需手动执行的\x20shell\x20命令:','anthropic','Zceum','467860taYqmX','add','split','EqCqk','\x20安装(配置仍会写入,但请手动安装后使用)','API\x20端点:','detectBin','55Gaukad','windows','skipped','dry-run','installed','shell-only','──\x20','WQZxR','argv','gAifO','VwcvQ','模式:','DcKUm','ESuPZ','base_url','--api-base','\x20(未装)','QIsjZ','VcUCf','邮箱格式不正确','backup-failed','GvUPx','test','\x20\x20-\x20','ACTIVATE_API_BASE','./package.json','sQkzC','display_name','yEBGp','BIaJg','slice','FDzGz','meta','备份并写入配置','https://2api.store','99jIvAtI','yItdT','reason','permission-denied','path','\x20\x20[shell\x20命令,请手动执行]','push','gemini','\x0a@2api-store/activate\x20v','mkcNC','139736fWmfhh','label','TWSbC','新账号:','then','环境:','rYbCd','已检测到\x20CLI:','未输入凭据','mode','eYXJP','未知错误','FcueM','pGjcf','dryRun','ZxQqf','trim','(配置已写入,请手动检查)'];_0x2c7f=function(){return _0x122d6a;};return _0x2c7f();}import{ask as _0x40267d,askSecret as _0x223174,multiSelect as _0x1a7330,select as _0xd43561,confirm as _0x220760,closePrompt as _0x3cd086}from'./lib/prompt.mjs';import{banner as _0x3fabc7,ok as _0x183821,fail as _0x209486,warn as _0x3817ff,info as _0x5ed366,step as _0x51f4b6,guide as _0x322f21,plain as _0x599dc1,chalk as _0x1c34c9}from'./lib/ui.mjs';import{getCliMeta as _0x185173,isDefaultSelected as _0x1f8546}from'./lib/platforms.mjs';import{ensureInstalled as _0x5288b4}from'./lib/install.mjs';function _0x4a37(_0x42533c,_0x383a2){_0x42533c=_0x42533c-0x187;const _0x2c7f60=_0x2c7f();let _0x4a37ae=_0x2c7f60[_0x42533c];return _0x4a37ae;}import{SUBCOMMANDS as _0x3f31ad,SUBCOMMAND_NAMES as _0x255b0c,SUB_HELP as _0x32a3b9}from'./lib/cmds.mjs';import{createRequire as _0x232411}from'node:module';const L=_0x232411(import.meta.url)(_0x1a5267(0x1a7))[_0x1a5267(0x261)],W=_0x1a5267(0x1b0);(async function(){const _0x525297=_0x1a5267,_0x446692={'vBYwq':function(_0x2e45c1,_0x4507b3){return _0x2e45c1<_0x4507b3;},'eQaam':function(_0x3b040c,_0x49c1a4){return _0x3b040c===_0x49c1a4;},'GvUPx':function(_0x2e3bcd,_0x4104fc){return _0x2e3bcd===_0x4104fc;},'esCXS':'--platform','hotWX':_0x525297(0x19d),'HYaFE':'--help','dxtGL':function(_0x50ead2,_0x35dd8f){return _0x50ead2===_0x35dd8f;},'OOxjn':_0x525297(0x235),'BIaJg':function(_0x1840c0,_0x5da25c){return _0x1840c0===_0x5da25c;},'uBkCp':function(_0x273fe6,_0x5cfb37){return _0x273fe6==_0x5cfb37;},'cGYSk':_0x525297(0x258),'zlHvd':'openai','TJYJr':'claude','lCrOb':_0x525297(0x1b8),'XztpQ':'grok','CPoTs':function(_0x1667f9){return _0x1667f9();},'vhqIG':_0x525297(0x1ef),'itoRf':_0x525297(0x22c),'gSpGi':_0x525297(0x276),'NQTRV':function(_0x320748,_0x2d9dd8){return _0x320748(_0x2d9dd8);},'TnqEa':function(_0x5880e0,_0x50ddda){return _0x5880e0>_0x50ddda;},'EqCqk':function(_0x1c6478,_0x5c56b4){return _0x1c6478(_0x5c56b4);},'AegBr':_0x525297(0x1f2),'WQZxR':function(_0x1371d,_0x7bae97){return _0x1371d(_0x7bae97);},'FcueM':_0x525297(0x26b),'EEZIg':function(_0x5133d5,_0x27b0eb){return _0x5133d5(_0x27b0eb);},'dSImR':_0x525297(0x1c3),'ShMKB':_0x525297(0x1e9),'eYatx':_0x525297(0x245),'bGZTy':_0x525297(0x24d),'VwcvQ':_0x525297(0x260),'QbRMg':function(_0x15ac4e,_0x2c1cbe){return _0x15ac4e(_0x2c1cbe);},'chwQd':'凭据格式无法识别(应为\x20sk-\x20前缀的\x20API\x20Key\x20或兑换码)','CDhVT':_0x525297(0x1d6),'VwcRS':'兑换码','CXwhB':_0x525297(0x1e5),'mkcNC':_0x525297(0x224),'GKfMJ':function(_0x10e9ce,_0x2c01da){return _0x10e9ce(_0x2c01da);},'CfVPB':_0x525297(0x233),'ETsuu':function(_0x4a643c,_0x5b233c){return _0x4a643c(_0x5b233c);},'iVfEQ':function(_0x397904,_0x1218a4){return _0x397904(_0x1218a4);},'TWSbC':_0x525297(0x257),'MdBZC':'选择绑定的分组','USJLd':_0x525297(0x249),'MVaGj':function(_0x285483,_0x4d2734){return _0x285483(_0x4d2734);},'cuoOW':function(_0x572e42,_0x52d6b5){return _0x572e42(_0x52d6b5);},'VpMTT':_0x525297(0x23a),'ESuPZ':function(_0x5b2de9,_0x14ade9){return _0x5b2de9(_0x14ade9);},'uTEPL':function(_0xdddde9,_0x39633b){return _0xdddde9(_0x39633b);},'IVfuf':function(_0x5cb3ce,_0x3b04d1){return _0x5cb3ce(_0x3b04d1);},'QIsjZ':function(_0x5df067,_0xddddc7){return _0x5df067(_0xddddc7);},'TgYJe':function(_0x33e6b7,_0x5018a8){return _0x33e6b7(_0x5018a8);},'DcHds':function(_0xb2e24c,_0x5a1a7e){return _0xb2e24c(_0x5a1a7e);},'mmfQk':_0x525297(0x25f),'VcUCf':function(_0x17e698,_0x4aa337,_0x340917,_0x28f75b){return _0x17e698(_0x4aa337,_0x340917,_0x28f75b);},'lWaAG':_0x525297(0x207),'RpSqr':'未选择任何\x20CLI,退出。','vJcrV':_0x525297(0x272),'AKouQ':function(_0x2c0b80,_0x39939c){return _0x2c0b80(_0x39939c);},'wlmdt':function(_0x20cdc6,_0x23cdab){return _0x20cdc6(_0x23cdab);},'aEVBt':function(_0x46c40a,_0x509692,_0x4b1a76){return _0x46c40a(_0x509692,_0x4b1a76);},'xqACY':_0x525297(0x22b),'xbOcA':function(_0xc2f53,_0x2cc91e){return _0xc2f53(_0x2cc91e);},'iAujG':function(_0x2163ff,_0x30f33e){return _0x2163ff(_0x30f33e);},'ukPyq':_0x525297(0x1c6),'BWyWY':function(_0x2328a9,_0x26d2d4){return _0x2328a9(_0x26d2d4);},'yEBGp':function(_0x450f36,_0x4340a2){return _0x450f36>_0x4340a2;},'cOobr':function(_0x2a33eb,_0x200664){return _0x2a33eb(_0x200664);},'Zceum':_0x525297(0x205),'yNKEl':function(_0x56d7bb,_0x2f03c3){return _0x56d7bb>_0x2f03c3;},'jxorM':function(_0x574b53,_0x77a663,_0x58b5fa,_0x24aef7){return _0x574b53(_0x77a663,_0x58b5fa,_0x24aef7);},'eYXJP':'选择默认模型','cYwAK':function(_0x596260,_0x47135d){return _0x596260===_0x47135d;},'rftqM':_0x525297(0x226),'uAnOp':_0x525297(0x271),'sQkzC':_0x525297(0x1d3),'rBCSF':function(_0x585431,_0x4faa61){return _0x585431(_0x4faa61);},'SMwWY':_0x525297(0x1b6),'rYbCd':_0x525297(0x193),'FMpup':function(_0x3f116d,_0x1032a6){return _0x3f116d(_0x1032a6);},'LgVFB':_0x525297(0x20a),'IDnPf':function(_0x41c1e1,_0x594a39){return _0x41c1e1(_0x594a39);},'hFlmE':_0x525297(0x216),'WOVFF':function(_0x7f69f8,_0x45ada8){return _0x7f69f8(_0x45ada8);},'iSpvB':_0x525297(0x191),'QEroQ':function(_0x1b2eba,_0x2446dd){return _0x1b2eba(_0x2446dd);},'QsAur':'backup-failed','jGrzo':_0x525297(0x1fa),'kZJhY':function(_0x2cd4c5,_0x1bc084){return _0x2cd4c5 instanceof _0x1bc084;},'hJeOE':_0x525297(0x1b4),'qqyPH':'failed','UmKOv':function(_0x37dafb){return _0x37dafb();},'ZxQqf':_0x525297(0x278),'DjuMX':function(_0x444cca,_0x2f1990){return _0x444cca(_0x2f1990);},'nPXuy':_0x525297(0x209),'DMAQV':function(_0x44710f,_0x196326){return _0x44710f(_0x196326);},'yItdT':'API\x20Key\x20验证通过(GET\x20/v1/models\x20→\x20200)','PalhW':function(_0x2f06b5,_0x2f3869){return _0x2f06b5(_0x2f3869);},'gAifO':'激活报告','VcydN':function(_0x1d0abd,_0x1f55c3){return _0x1d0abd>_0x1f55c3;},'FDzGz':function(_0x5110bb,_0x18a3a8){return _0x5110bb>_0x18a3a8;},'pGjcf':'备份位置:','tRaJH':_0x525297(0x1f3),'DcKUm':_0x525297(0x1f8)},_0x12c43e=process['argv'][0x2];if(_0x12c43e&&!_0x12c43e[_0x525297(0x1fd)]('-')&&_0x255b0c[_0x525297(0x1f9)](_0x12c43e)){const _0x31ae1e=process[_0x525297(0x196)][_0x525297(0x1ac)](0x3),_0x16ec78=_0x3f31ad[_0x12c43e];try{return await _0x16ec78[_0x525297(0x1eb)](_0x31ae1e)||0x0;}catch(_0x4e3c10){return _0x209486(_0x525297(0x270)+_0x12c43e+'\x20异常:'+(_0x4e3c10?.[_0x525297(0x24c)]||_0x4e3c10)),_0x4e3c10?.[_0x525297(0x200)]&&console[_0x525297(0x20e)](_0x4e3c10[_0x525297(0x200)]),0x1;}}const _0xb27d0=function(_0x1dbffb){const _0xf12193=_0x525297,_0x21b0d4={'dryRun':!0x1,'platform':null,'_':[]};for(let _0x4b355c=0x0;_0x446692['vBYwq'](_0x4b355c,_0x1dbffb['length']);_0x4b355c++){const _0x5a2782=_0x1dbffb[_0x4b355c];if(_0x446692[_0xf12193(0x269)](_0xf12193(0x1d7),_0x5a2782)||_0x446692[_0xf12193(0x269)]('-n',_0x5a2782))_0x21b0d4['dryRun']=!0x0;else{if(_0x446692[_0xf12193(0x1a3)](_0x446692['esCXS'],_0x5a2782)||_0x446692[_0xf12193(0x269)]('-p',_0x5a2782))_0x21b0d4[_0xf12193(0x26a)]=_0x1dbffb[++_0x4b355c];else{if(_0x446692[_0xf12193(0x1a3)](_0x446692[_0xf12193(0x1dd)],_0x5a2782))_0x21b0d4[_0xf12193(0x202)]=_0x1dbffb[++_0x4b355c];else{if(_0x446692[_0xf12193(0x1a3)](_0x446692['HYaFE'],_0x5a2782)||_0x446692['dxtGL']('-h',_0x5a2782))_0x21b0d4[_0xf12193(0x24f)]=!0x0;else{if(_0x446692['eQaam'](_0x446692[_0xf12193(0x220)],_0x5a2782)||_0x446692['BIaJg']('-v',_0x5a2782))_0x21b0d4[_0xf12193(0x261)]=!0x0;else{if(_0x5a2782[_0xf12193(0x1fd)]('--')&&_0x5a2782[_0xf12193(0x23b)]('=')){const [_0x312021,_0x328617]=_0x5a2782[_0xf12193(0x1ac)](0x2)[_0xf12193(0x189)](/=(.*)/,0x2);_0x21b0d4[_0x312021]=_0x328617;}else _0x5a2782[_0xf12193(0x1fd)]('--')?_0x21b0d4[_0x5a2782[_0xf12193(0x1fc)](/^--/,'')]=_0x1dbffb[++_0x4b355c]:_0x21b0d4['_'][_0xf12193(0x1b7)](_0x5a2782);}}}}}}return _0x21b0d4;}(process[_0x525297(0x196)][_0x525297(0x1ac)](0x2));if(_0xb27d0[_0x525297(0x24f)])return console['log']((_0x525297(0x1b9)+L+'\x20—\x20TokenShop\x20CLI\x20一键激活\x0a\x0a用法:\x0a\x20\x20npx\x20@2api-store/activate\x20[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20默认激活流程\x0a\x20\x20npx\x20@2api-store/activate\x20<subcommand>\x20[options]\x20\x20\x20运行子命令\x0a\x0a选项(默认激活流程):\x0a\x20\x20--dry-run,\x20-n\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20不真写配置/不真装\x20CLI,只展示将做什么\x0a\x20\x20--platform\x20<name>\x20\x20\x20\x20\x20\x20只激活指定平台(openai/anthropic/gemini/grok/antigravity)\x0a\x20\x20--api-base\x20<url>\x20\x20\x20\x20\x20\x20\x20覆盖\x20API\x20端点(默认\x20$ACTIVATE_API_BASE\x20或\x20'+W+')\x0a\x20\x20-h,\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示帮助\x0a\x20\x20-v,\x20--version\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20显示版本\x0a\x0a'+_0x32a3b9+_0x525297(0x27b))['trim']()),0x0;if(_0xb27d0['version'])return console[_0x525297(0x26d)](L),0x0;_0x446692['CPoTs'](_0x3fabc7);const _0x5920f6=_0x554da3(),_0x40b6bd=_0x5920f6['os']['isMac']?_0x446692['vhqIG']:_0x5920f6['os'][_0x525297(0x20d)]?_0x446692['itoRf']:_0x5920f6['os'][_0x525297(0x223)]?_0x446692['gSpGi']:_0x5920f6['os'][_0x525297(0x26a)];if(_0x5ed366(_0x525297(0x1c0)+_0x40b6bd+_0x525297(0x25c)+_0x5920f6[_0x525297(0x225)][_0x525297(0x261)]),!_0x5920f6['node'][_0x525297(0x229)])return _0x446692[_0x525297(0x20b)](_0x209486,_0x525297(0x21a)+_0x5920f6[_0x525297(0x225)][_0x525297(0x261)]),0x1;const _0x42b406=Object['keys'](_0x5920f6[_0x525297(0x192)]),_0x37c378=_0x42b406[_0x525297(0x237)](_0x27491f=>{const _0x15df51=_0x525297,_0x181117=_0x5920f6[_0x15df51(0x192)][_0x27491f]?.['version'];return _0x181117?_0x27491f+'@'+_0x181117:_0x27491f;});_0x446692['TnqEa'](_0x42b406['length'],0x0)?_0x446692[_0x525297(0x20b)](_0x183821,_0x525297(0x1c2)+_0x37c378[_0x525297(0x227)](',\x20')):_0x446692['EqCqk'](_0x5ed366,_0x446692[_0x525297(0x282)]);const _0x491f75=_0xb27d0[_0x525297(0x202)]||process[_0x525297(0x1e2)][_0x525297(0x1a6)]||W;_0x446692['EqCqk'](_0x5ed366,_0x525297(0x18c)+_0x491f75),_0xb27d0[_0x525297(0x1c9)]&&_0x446692[_0x525297(0x195)](_0x3817ff,_0x446692[_0x525297(0x1c7)]),_0xb27d0['platform']&&_0x5ed366('平台过滤:'+_0xb27d0[_0x525297(0x26a)]),console[_0x525297(0x26d)]();const _0x5c4562=(await _0x446692[_0x525297(0x195)](_0x223174,'请输入\x20API\x20Key(sk-...)或兑换码'))[_0x525297(0x1cb)]();if(!_0x5c4562)return _0x446692[_0x525297(0x1db)](_0x209486,_0x446692[_0x525297(0x1d9)]),0x1;const _0x36dcfa=(_0x33bded=_0x5c4562)?_0x33bded[_0x525297(0x1fd)](_0x446692['ShMKB'])?_0x446692['eYatx']:/^[a-zA-Z0-9]{16,64}$/[_0x525297(0x1a4)](_0x33bded)?_0x525297(0x1e5):_0x446692['bGZTy']:_0x446692[_0x525297(0x198)];var _0x33bded;if(_0x446692[_0x525297(0x1a3)](_0x446692[_0x525297(0x26f)],_0x36dcfa))return _0x446692[_0x525297(0x273)](_0x209486,_0x446692[_0x525297(0x267)]),0x1;_0x446692[_0x525297(0x18a)](_0x5ed366,'识别为:'+(_0x446692[_0x525297(0x269)](_0x446692['eYatx'],_0x36dcfa)?_0x446692[_0x525297(0x222)]:_0x446692['VwcRS'])+'模式');let _0x41e77a,_0x4ce4aa='',_0x2a41a4=null;if(_0x446692[_0x525297(0x1ab)](_0x446692['CXwhB'],_0x36dcfa)){if(_0x4ce4aa=(await _0x446692[_0x525297(0x1db)](_0x40267d,_0x446692[_0x525297(0x1ba)]))['trim'](),!_0x4ce4aa||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/[_0x525297(0x1a4)](_0x4ce4aa))return _0x446692[_0x525297(0x1db)](_0x209486,_0x525297(0x1a1)),0x1;_0x446692[_0x525297(0x211)](_0x51f4b6,_0x446692[_0x525297(0x1f4)]);const _0x2a050b=await _0x446692[_0x525297(0x268)](_0x3de344,{'apiBase':_0x491f75});if(_0x446692[_0x525297(0x269)](0x0,_0x2a050b[_0x525297(0x288)]))return _0x446692[_0x525297(0x25b)](_0x209486,_0x446692[_0x525297(0x1bd)]),0x1;const _0x4ba440=_0x2a050b[_0x525297(0x237)](_0x36d1d8=>({'label':''+_0x36d1d8[_0x525297(0x236)],'value':_0x36d1d8['id']})),_0x351fb3=await _0xd43561(_0x446692[_0x525297(0x248)],_0x4ba440,{'defaultIndex':0x0});if(_0x2a41a4=_0x2a050b[_0x351fb3]?.['id'],!_0x2a41a4)return _0x446692['EEZIg'](_0x209486,_0x446692['USJLd']),0x1;_0x446692[_0x525297(0x25d)](_0x183821,_0x525297(0x255)+_0x2a050b[_0x351fb3][_0x525297(0x236)]+_0x525297(0x1cf)+_0x2a41a4+')'),console['log']();}_0x446692[_0x525297(0x242)](_0x51f4b6,_0x446692[_0x525297(0x277)]);try{_0x41e77a=await _0x49454e({'credential':_0x5c4562,'email':_0x4ce4aa,'platform':_0xb27d0[_0x525297(0x26a)],'groupId':_0x2a41a4,'apiBase':_0x491f75});}catch(_0x9ca20a){return _0x209486(_0x525297(0x1df)+_0x9ca20a['message']),_0x9ca20a[_0x525297(0x280)]&&_0x446692[_0x525297(0x19b)](_0x209486,'\x20\x20HTTP\x20'+_0x9ca20a[_0x525297(0x280)]),0x1;}_0x446692[_0x525297(0x273)](_0x183821,_0x525297(0x199)+_0x41e77a[_0x525297(0x1c4)]+(_0x41e77a[_0x525297(0x23e)]?.[_0x525297(0x1de)]?_0x525297(0x22f):'')),_0x41e77a[_0x525297(0x23e)]?.[_0x525297(0x1de)]&&_0x41e77a[_0x525297(0x23e)]?.[_0x525297(0x1ee)]&&(_0x446692[_0x525297(0x1d8)](_0x5ed366,_0x525297(0x1be)+_0x41e77a[_0x525297(0x23e)][_0x525297(0x1ee)]),_0x41e77a[_0x525297(0x23e)][_0x525297(0x24c)]&&_0x446692[_0x525297(0x244)](_0x5ed366,_0x41e77a[_0x525297(0x23e)]['message'])),console[_0x525297(0x26d)]();const _0x79aee3=function(_0x1fede9){const _0x12a57e=_0x525297,_0x5815fa=new Set();for(const _0x22c040 of _0x1fede9||[]){const _0x321a97=(_0x446692[_0x12a57e(0x1cd)](_0x446692[_0x12a57e(0x1ff)],typeof _0x22c040)?_0x22c040:_0x22c040?.['id']||'')[_0x12a57e(0x1f0)]();/^(gpt|o1|o3|codex|glm|minimax|deepseek)/[_0x12a57e(0x1a4)](_0x321a97)?_0x5815fa[_0x12a57e(0x188)](_0x446692['zlHvd']):_0x321a97[_0x12a57e(0x1fd)](_0x446692[_0x12a57e(0x206)])?_0x5815fa[_0x12a57e(0x188)](_0x12a57e(0x28a)):_0x321a97[_0x12a57e(0x1fd)](_0x446692['lCrOb'])?_0x5815fa['add'](_0x446692[_0x12a57e(0x232)]):_0x321a97[_0x12a57e(0x1fd)](_0x446692[_0x12a57e(0x1e8)])&&_0x5815fa[_0x12a57e(0x188)](_0x446692[_0x12a57e(0x1e8)]);}return[..._0x5815fa];}(_0x41e77a[_0x525297(0x25a)]||[]);_0xb27d0['platform']&&!_0x79aee3[_0x525297(0x23b)](_0xb27d0[_0x525297(0x26a)])&&_0x79aee3[_0x525297(0x1b7)](_0xb27d0['platform']);const _0x223c3a=(_0x41e77a[_0x525297(0x1d1)]||[])[_0x525297(0x24e)](_0x5a64da=>!!_0x5a64da&&(!(_0x79aee3['length']>0x0&&!_0x79aee3[_0x525297(0x23b)](_0x5a64da[_0x525297(0x26a)]))&&((!_0xb27d0[_0x525297(0x26a)]||_0x5a64da[_0x525297(0x26a)]===_0xb27d0[_0x525297(0x26a)])&&(_0x5920f6['os'][_0x525297(0x223)]?_0x525297(0x18f)===_0x5a64da[_0x525297(0x283)]||_0x525297(0x254)===_0x5a64da[_0x525297(0x283)]:'unix'===_0x5a64da['os_type']||_0x525297(0x254)===_0x5a64da[_0x525297(0x283)]))));if(_0x446692[_0x525297(0x1a3)](0x0,_0x223c3a[_0x525297(0x288)]))return _0x446692[_0x525297(0x19f)](_0x209486,_0x525297(0x26e)),0x1;const _0x1168f5=new Set(),_0x485836=[];for(const _0xf86afc of _0x223c3a){const _0x22be44=_0xf86afc[_0x525297(0x26a)]+'/'+_0xf86afc[_0x525297(0x1dc)];if(_0x1168f5['has'](_0x22be44))continue;_0x1168f5[_0x525297(0x188)](_0x22be44);const _0x2ccba4=_0x446692[_0x525297(0x201)](_0x185173,_0xf86afc[_0x525297(0x1dc)]),_0x26c607=_0xf86afc[_0x525297(0x1a9)]||_0xf86afc[_0x525297(0x21b)]||_0x2ccba4?.[_0x525297(0x236)]||_0xf86afc['platform']+'\x20'+_0xf86afc[_0x525297(0x1dc)],_0x5845bb=_0x5920f6[_0x525297(0x192)][_0xf86afc[_0x525297(0x1dc)]]?.[_0x525297(0x1b5)]||_0x2ccba4&&_0x5920f6[_0x525297(0x192)][_0x2ccba4['detectBin']]?.['path'],_0x568c37=_0x446692[_0x525297(0x286)](_0x1f8546,_0xf86afc[_0x525297(0x1dc)])?'':_0x446692['mmfQk'],_0x2e3eb9=_0x5845bb?_0x1c34c9[_0x525297(0x246)](_0x26c607):_0x1c34c9['gray'](_0x26c607+_0x525297(0x19e));_0x485836['push']({'label':_0x2e3eb9+'\x20'+_0x1c34c9[_0x525297(0x217)]('['+_0xf86afc[_0x525297(0x26a)]+'/'+_0xf86afc[_0x525297(0x1dc)]+']')+_0x568c37,'config':_0xf86afc,'clientType':_0xf86afc[_0x525297(0x1dc)],'meta':_0x2ccba4,'alreadyInstalled':!!_0x5845bb});}const _0x399f5b=_0x485836[_0x525297(0x237)]((_0x4a3b56,_0x491191)=>({'item':_0x4a3b56,'i':_0x491191}))[_0x525297(0x24e)](({item:_0x390eb3})=>_0x1f8546(_0x390eb3[_0x525297(0x1e6)]))[_0x525297(0x237)](({i:_0x28df5c})=>_0x28df5c);_0x51f4b6(_0x525297(0x1d2));const _0x68b875=await _0x446692[_0x525297(0x1a0)](_0x1a7330,_0x446692[_0x525297(0x1e7)],_0x485836,{'defaultSelected':_0x399f5b});if(0x0===_0x68b875['length'])return _0x446692[_0x525297(0x244)](_0x599dc1,_0x446692[_0x525297(0x1f6)]),0x0;const _0x3a4b44=_0x68b875[_0x525297(0x237)](_0x30ca73=>_0x485836[_0x30ca73]);if(console[_0x525297(0x26d)](),!_0xb27d0['dryRun']){_0x51f4b6(_0x446692['vJcrV']);for(const _0xf8747d of _0x3a4b44){if(_0xf8747d[_0x525297(0x240)]){const _0x3758b6=_0x5920f6[_0x525297(0x192)][_0xf8747d[_0x525297(0x1e6)]]?.['version']||_0x5920f6[_0x525297(0x192)][_0xf8747d[_0x525297(0x1ae)]?.['detectBin']]?.['version'];_0x446692[_0x525297(0x18a)](_0x183821,(_0xf8747d[_0x525297(0x1ae)]?.[_0x525297(0x236)]||_0xf8747d[_0x525297(0x1e6)])+'\x20已安装'+(_0x3758b6?'(v'+_0x3758b6+')':''));continue;}if(!_0xf8747d[_0x525297(0x1ae)]||!_0xf8747d[_0x525297(0x1ae)]['installPackage']){_0x446692[_0x525297(0x208)](_0x3817ff,_0xf8747d['clientType']+_0x525297(0x1e3));continue;}_0x446692[_0x525297(0x1d5)](_0x5ed366,'未检测到\x20'+_0xf8747d[_0x525297(0x1ae)]['name']+_0x525297(0x256)+_0xf8747d[_0x525297(0x1ae)][_0x525297(0x18d)]+')');const _0xb73d99=await _0x446692[_0x525297(0x20f)](_0x5288b4,_0xf8747d['meta'],{'dryRun':_0xb27d0[_0x525297(0x1c9)]});_0xb73d99[_0x525297(0x192)]?_0x183821(_0xf8747d['meta'][_0x525297(0x236)]+_0x525297(0x1fb)+(_0xb73d99[_0x525297(0x261)]?'(v'+_0xb73d99['version']+')':'')):_0xb73d99[_0x525297(0x190)]&&_0x446692[_0x525297(0x27a)](_0x446692[_0x525297(0x1e4)],_0xb73d99[_0x525297(0x1b3)])?_0x446692[_0x525297(0x20c)](_0x3817ff,_0x525297(0x251)+_0xf8747d[_0x525297(0x1ae)][_0x525297(0x236)]+_0x525297(0x18b)):_0xb73d99['skipped']?_0x446692[_0x525297(0x230)](_0x5ed366,_0x525297(0x251)+_0xf8747d[_0x525297(0x1ae)][_0x525297(0x236)]+_0x525297(0x253)+_0xb73d99[_0x525297(0x1b3)]+')'):_0x446692[_0x525297(0x201)](_0x209486,_0xf8747d['meta'][_0x525297(0x236)]+_0x525297(0x1f7)+(_0xb73d99['error']||_0x446692[_0x525297(0x1f1)])+_0x525297(0x266));}console['log']();}const _0x4ea273=_0x446692[_0x525297(0x1fe)](_0x4241e9,_0x41e77a[_0x525297(0x25a)]||[]);let _0x52430a='';if(_0x446692[_0x525297(0x1aa)](_0x4ea273['length'],0x0)){_0x446692['cOobr'](_0x51f4b6,_0x446692[_0x525297(0x28b)]);const _0x1b9c09=0xa,_0x553547=_0x4ea273[_0x525297(0x1ac)](0x0,_0x1b9c09),_0x2af53f=_0x446692['yNKEl'](_0x4ea273[_0x525297(0x288)],_0x1b9c09),_0xb2d386=[..._0x553547[_0x525297(0x237)](_0x55f1b9=>({'label':_0x55f1b9[_0x525297(0x1bc)]+'\x20('+_0x55f1b9['id']+')'})),..._0x2af53f?[{'label':_0x1c34c9[_0x525297(0x217)]('其他(手动输入模型\x20ID)')}]:[]],_0x569e19=await _0x446692[_0x525297(0x234)](_0xd43561,_0x446692[_0x525297(0x1c5)],_0xb2d386,{'defaultIndex':0x0});_0x2af53f&&_0x446692[_0x525297(0x284)](_0x569e19,_0x553547[_0x525297(0x288)])?(_0x52430a=(await _0x446692[_0x525297(0x208)](_0x40267d,_0x446692[_0x525297(0x274)]))[_0x525297(0x1cb)](),_0x52430a||(_0x52430a=_0x553547[0x0]['id'])):_0x52430a=_0x553547[_0x569e19]['id'],_0x446692[_0x525297(0x21f)](_0x183821,_0x525297(0x1f5)+_0x52430a);}else _0x446692[_0x525297(0x20c)](_0x3817ff,_0x446692['uAnOp']);console[_0x525297(0x26d)]();const _0x5da2fd=_0x41e77a[_0x525297(0x19c)]||'',_0x2eeaeb=_0x41e77a['base_url_beta']||_0x5da2fd,_0x58a299={'apiKey':_0x41e77a[_0x525297(0x1d0)]||'','baseUrl':_0x5da2fd,'apiBase':_0x5da2fd,'apiBaseBeta':_0x2eeaeb,'antigravityApiBase':_0x5da2fd+_0x525297(0x231),'antigravityApiBaseBeta':_0x2eeaeb+_0x525297(0x231),'defaultModel':_0x52430a};_0x51f4b6(_0x525297(0x1af));const _0x4b4c0f=[];let _0x4a06d0=null;for(const _0x1785ca of _0x3a4b44){const _0x374f8c=_0x1785ca[_0x525297(0x27c)][_0x525297(0x1a9)]||_0x1785ca['config'][_0x525297(0x21b)]||_0x1785ca[_0x525297(0x1ae)]?.[_0x525297(0x236)]||_0x1785ca[_0x525297(0x1e6)];_0x446692[_0x525297(0x1d5)](_0x599dc1,_0x525297(0x194)+_0x374f8c+_0x525297(0x275));const _0x54206b=_0x1785ca[_0x525297(0x27c)]['files']||[];for(const _0x2a8170 of _0x54206b){const _0x4933e4=_0x2a8170[_0x525297(0x1b5)]||'',_0x16c04f=_0x446692[_0x525297(0x1ab)]('Terminal',_0x4933e4)||_0x446692[_0x525297(0x1a8)]===_0x4933e4,_0x40ffcb=_0x16c04f?_0x4933e4:_0x4cf4c7(_0x4933e4,{'isWindows':_0x5920f6['os'][_0x525297(0x223)]}),_0x706fef=_0x2e8cd3(_0x2a8170[_0x525297(0x247)]||'',_0x58a299);if(_0x16c04f){_0x446692[_0x525297(0x21e)](_0x599dc1,_0x446692['SMwWY']),_0x599dc1(_0x706fef[_0x525297(0x189)]('\x0a')[_0x525297(0x237)](_0x203beb=>'\x20\x20\x20\x20'+_0x203beb)['join']('\x0a')),_0x4b4c0f[_0x525297(0x1b7)]({'cli':_0x374f8c,'path':_0x4933e4,'action':_0x446692[_0x525297(0x1c1)]});continue;}if(_0x446692[_0x525297(0x213)](_0x599dc1,_0x525297(0x24b)+_0x40ffcb),_0xb27d0['dryRun']){_0x3817ff(_0x446692['LgVFB']);const _0xbde3bb=_0x706fef[_0x525297(0x189)]('\x0a'),_0x2532ce=_0xbde3bb[_0x525297(0x1ac)](0x0,0x8)[_0x525297(0x227)]('\x0a');_0x446692[_0x525297(0x214)](_0x599dc1,_0x446692[_0x525297(0x23c)]),_0x446692[_0x525297(0x285)](_0x599dc1,_0x2532ce['split']('\x0a')['map'](_0x3fdbf6=>_0x525297(0x25e)+_0x3fdbf6)[_0x525297(0x227)]('\x0a')),_0xbde3bb[_0x525297(0x288)]>0x8&&_0x446692[_0x525297(0x25b)](_0x599dc1,'\x20\x20\x20\x20...(共\x20'+_0xbde3bb[_0x525297(0x288)]+'\x20行)'),_0x4b4c0f[_0x525297(0x1b7)]({'cli':_0x374f8c,'path':_0x40ffcb,'action':_0x446692[_0x525297(0x27e)]}),console['log']();continue;}let _0xd06eff=null;try{_0xd06eff=_0x446692[_0x525297(0x203)](_0x7b87ad,_0x40ffcb),_0xd06eff&&_0x446692[_0x525297(0x201)](_0x599dc1,_0x525297(0x1d4)+_0xd06eff);}catch(_0x2eed64){_0x209486('备份失败:'+_0x2eed64[_0x525297(0x24c)]+_0x525297(0x27f)),_0x4b4c0f['push']({'cli':_0x374f8c,'path':_0x40ffcb,'action':_0x446692[_0x525297(0x238)],'error':_0x2eed64['message']});continue;}try{_0x446692[_0x525297(0x234)](_0x1edfeb,_0x40ffcb,_0x706fef,{'isWindows':_0x5920f6['os'][_0x525297(0x223)]}),_0x183821(_0x446692['jGrzo']),_0x4b4c0f[_0x525297(0x1b7)]({'cli':_0x374f8c,'path':_0x40ffcb,'action':_0x525297(0x243),'backup':_0xd06eff});}catch(_0xacc32a){_0x446692[_0x525297(0x250)](_0xacc32a,_0x4e346a)?(_0x4a06d0||(_0x4a06d0=_0xacc32a),_0x446692[_0x525297(0x1fe)](_0x209486,_0xacc32a[_0x525297(0x24c)]),_0x4b4c0f['push']({'cli':_0x374f8c,'path':_0x40ffcb,'action':_0x446692[_0x525297(0x262)],'error':_0xacc32a['message']})):(_0x209486(_0x525297(0x26c)+_0xacc32a[_0x525297(0x24c)]),_0x4b4c0f[_0x525297(0x1b7)]({'cli':_0x374f8c,'path':_0x40ffcb,'action':_0x446692[_0x525297(0x218)],'error':_0xacc32a[_0x525297(0x24c)]}));}}console[_0x525297(0x26d)]();}if(_0x446692[_0x525297(0x23d)](_0x3cd086),!_0xb27d0['dryRun']&&_0x41e77a[_0x525297(0x1d0)]&&_0x41e77a[_0x525297(0x19c)]){_0x51f4b6(_0x446692[_0x525297(0x1ca)]),_0x446692[_0x525297(0x21d)](_0x5ed366,_0x446692[_0x525297(0x204)]);const _0x1bc9e3=await _0x446692[_0x525297(0x210)](_0xbc128b,{'apiKey':_0x41e77a['api_key'],'baseUrl':_0x41e77a[_0x525297(0x19c)]});_0x1bc9e3['ok']?_0x446692[_0x525297(0x214)](_0x183821,_0x446692[_0x525297(0x1b2)]):_0x446692[_0x525297(0x228)](_0x3817ff,_0x525297(0x239)+(_0x1bc9e3[_0x525297(0x20e)]||_0x525297(0x263)+_0x1bc9e3['statusCode'])+_0x525297(0x1cc)),console['log']();}_0x51f4b6(_0x446692[_0x525297(0x197)]);const _0x17c098=_0x4b4c0f[_0x525297(0x24e)](_0x3a3452=>'written'===_0x3a3452[_0x525297(0x22d)]),_0x5e88ce=_0x4b4c0f[_0x525297(0x24e)](_0x202f0d=>'failed'===_0x202f0d['action']||_0x525297(0x1b4)===_0x202f0d[_0x525297(0x22d)]||_0x525297(0x1a2)===_0x202f0d[_0x525297(0x22d)]),_0x3f4d9c=_0x4b4c0f[_0x525297(0x24e)](_0x2b464b=>_0x525297(0x193)===_0x2b464b[_0x525297(0x22d)]),_0x53cd8e=_0x4b4c0f['filter'](_0x23289f=>_0x525297(0x191)===_0x23289f['action']);_0xb27d0[_0x525297(0x1c9)]?_0x446692[_0x525297(0x25b)](_0x599dc1,'[试运行]\x20将写入\x20'+_0x53cd8e['length']+_0x525297(0x279)):_0x446692[_0x525297(0x195)](_0x183821,_0x525297(0x1ce)+_0x17c098[_0x525297(0x288)]+_0x525297(0x212)),_0x446692[_0x525297(0x219)](_0x3f4d9c[_0x525297(0x288)],0x0)&&_0x5ed366(_0x525297(0x289)+_0x3f4d9c[_0x525297(0x288)]+'\x20项(见上方输出)'),_0x446692[_0x525297(0x1ad)](_0x5e88ce[_0x525297(0x288)],0x0)&&(_0x446692['FMpup'](_0x3817ff,'失败\x20'+_0x5e88ce[_0x525297(0x288)]+_0x525297(0x21c)),_0x5e88ce[_0x525297(0x23f)](_0x332389=>_0x3817ff(_0x525297(0x1a5)+_0x332389[_0x525297(0x241)]+'\x20'+_0x332389[_0x525297(0x1b5)])));const _0x559654=_0x4b4c0f['filter'](_0x57160e=>_0x57160e[_0x525297(0x281)])['map'](_0x41913a=>_0x41913a[_0x525297(0x281)]);if(_0x559654[_0x525297(0x288)]>0x0&&(_0x5ed366(_0x446692[_0x525297(0x1c8)]),_0x559654[_0x525297(0x23f)](_0x374b34=>_0x599dc1(_0x525297(0x1a5)+_0x374b34))),_0x41e77a['user']?.[_0x525297(0x1de)]&&(console[_0x525297(0x26d)](),_0x446692[_0x525297(0x20b)](_0x5ed366,'📧\x20新账号\x20'+(_0x41e77a[_0x525297(0x23e)]['email']||'')+_0x525297(0x221))),!_0xb27d0[_0x525297(0x1c9)]){const _0x52111c=_0x3a4b44[_0x525297(0x237)](_0xfc790e=>_0xfc790e[_0x525297(0x1ae)])['filter'](Boolean)['map'](_0x43e8a4=>({'name':_0x43e8a4['name'],'startCmd':_0x43e8a4[_0x525297(0x1ed)],'usage':_0x43e8a4[_0x525297(0x1ec)]}));_0x322f21(_0x52111c);}return _0x4a06d0?(console[_0x525297(0x26d)](),_0x446692['IVfuf'](_0x209486,_0x446692['tRaJH']),_0x446692[_0x525297(0x19b)](_0x209486,_0x446692[_0x525297(0x19a)]),0x2):_0x5e88ce[_0x525297(0x288)]>0x0?0x3:0x0;}()[_0x1a5267(0x1bf)](_0x6b2586=>{const _0x17886d=_0x1a5267,_0x183396={'HIXVG':function(_0x2323c2,_0x2fc322){return _0x2323c2||_0x2fc322;}};_0x3cd086(),process[_0x17886d(0x259)](_0x183396['HIXVG'](_0x6b2586,0x0));})[_0x1a5267(0x22e)](_0x234660=>{const _0x12ca99=_0x1a5267,_0x10fce6={'hJtXf':function(_0x4c542e,_0x257c16){return _0x4c542e(_0x257c16);},'kaslt':function(_0xaf5aff){return _0xaf5aff();}};_0x10fce6[_0x12ca99(0x287)](_0x209486,'未捕获错误:'+(_0x234660?.['message']||_0x234660)),_0x234660?.['stack']&&console[_0x12ca99(0x20e)](_0x234660['stack']),_0x10fce6[_0x12ca99(0x27d)](_0x3cd086),process[_0x12ca99(0x259)](0x1);}));
|
package/dist/lib/api.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x550a(){const _0x1e5e42=['byteLength','mxDaZ','1416CkAyOb','@2api-store/activate/0.1.0','slice','HTTP\x20','ApxFu','lrxkT','QDtkw','MrRAr','https:','rIDrL','ewZGE','验证请求超时(15s)','PiJCO','error','application/json','yJXPa','UfUrw','kkZGq','destroy','20lqjmoC','GET','OTLdM','4833XFIRVI','rhrwd','mFBbu','llLHU','KzPDW','VxuPc','156906hboGuD','write','raw','szZKs','/api/v1/cli/activate','utf8','UdJdG','statusCode','TkINN','57138tjbJMU','object','lMoZV','message','XxAPg','HfGwf','protocol','push','POST','MiSVI','NnhWJ','86774uoikVA','/api/v1/cli/groups','904686yHplMl','bkhfF','QdJXC','53212cSvkbe','响应非\x20JSON(HTTP\x20','href','HGsRj','request','WlqqV','jtObK','KMXsO','请求超时(30s)—\x20','EcgQl','PoW\x20challenge\x20获取失败:','data','vsaTY','PbeTd','stringify','concat','fJBDc','DrAbr','end','1011157ACsDQA','bwBSr','toString','timeout','WSdWH','szVsb','OjWdW','chLmi','Bearer\x20','MdOrB','bZWdp'];_0x550a=function(){return _0x1e5e42;};return _0x550a();}const _0x1b2fed=_0x57d5;(function(_0x59f40a,_0x19d0e4){const _0xa453a7=_0x57d5,_0x33a2e4=_0x59f40a();while(!![]){try{const _0x548ccc=parseInt(_0xa453a7(0x1c3))/0x1+parseInt(_0xa453a7(0x179))/0x2+parseInt(_0xa453a7(0x1ba))/0x3+-parseInt(_0xa453a7(0x17e))/0x4*(-parseInt(_0xa453a7(0x1b1))/0x5)+parseInt(_0xa453a7(0x17b))/0x6+-parseInt(_0xa453a7(0x191))/0x7+parseInt(_0xa453a7(0x19e))/0x8*(-parseInt(_0xa453a7(0x1b4))/0x9);if(_0x548ccc===_0x19d0e4)break;else _0x33a2e4['push'](_0x33a2e4['shift']());}catch(_0xddbfc9){_0x33a2e4['push'](_0x33a2e4['shift']());}}}(_0x550a,0x1ca48));import _0x4a124b from'node:https';import _0x2e2060 from'node:http';import{getDeviceId as _0x1ce896}from'./device.mjs';import{getChallenge as _0x14f424,solvePoW as _0x4b27e4}from'./pow.mjs';const n=_0x1b2fed(0x19f),a=0x7530;function i(_0x318f7c,_0xf8d2dd={}){return{'User-Agent':n,'X-Device-Id':_0x318f7c,..._0xf8d2dd};}function _0x57d5(_0x226fc3,_0x593566){_0x226fc3=_0x226fc3-0x173;const _0x550a63=_0x550a();let _0x57d5ad=_0x550a63[_0x226fc3];return _0x57d5ad;}export async function cliActivate({credential:_0x1c0509,email:_0xe90f4e,platform:_0x5d568b,groupId:_0x480b6d,apiBase:_0x50845a}){const _0x147be6=_0x1b2fed,_0xf46eab={'jtObK':function(_0x3549a6,_0x298b5f){return _0x3549a6(_0x298b5f);},'WlqqV':function(_0x3832f8,_0xa9fae4){return _0x3832f8<_0xa9fae4;},'DrAbr':function(_0x122f79,_0x32f22e){return _0x122f79(_0x32f22e);},'szZKs':function(_0x4fd6e4,_0x20ed4e){return _0x4fd6e4==_0x20ed4e;},'MdOrB':_0x147be6(0x1c4),'MiSVI':'data','ApxFu':_0x147be6(0x190),'ewZGE':_0x147be6(0x1a6),'bkhfF':_0x147be6(0x176),'HfGwf':function(_0x19608f,_0x4dfe01,_0x54fb70){return _0x19608f(_0x4dfe01,_0x54fb70);},'bZWdp':_0x147be6(0x1ac),'VxuPc':_0x147be6(0x194),'mxDaZ':_0x147be6(0x1ab),'MrRAr':function(_0x484b83,_0x32169c,_0x51f0c6){return _0x484b83(_0x32169c,_0x51f0c6);}},_0x5a292c=_0x1ce896();let _0x2f59f4,_0x48216d;try{const {challenge:_0x10e697,difficulty:_0x8ad87a}=await _0xf46eab['DrAbr'](_0x14f424,{'apiBase':_0x50845a,'deviceId':_0x5a292c});_0x2f59f4=_0x10e697,_0x48216d=_0xf46eab[_0x147be6(0x1a5)](_0x4b27e4,_0x10e697,_0x8ad87a);}catch(_0xc01557){throw new Error(_0x147be6(0x188)+_0xc01557[_0x147be6(0x1c6)]);}return new Promise((_0x5382fa,_0x14bd9e)=>{const _0x490342=_0x147be6;let _0x799db3;try{_0x799db3=new URL(_0x490342(0x1be),_0x50845a);}catch(_0x3f307a){return void _0xf46eab['jtObK'](_0x14bd9e,new Error('无效的\x20apiBase:'+_0x50845a+'('+_0x3f307a[_0x490342(0x1c6)]+')'));}const _0x27103c=_0xf46eab[_0x490342(0x1a8)]===_0x799db3[_0x490342(0x174)]?_0x4a124b:_0x2e2060,_0x2e3eb9={'credential':_0x1c0509,..._0xe90f4e?{'email':_0xe90f4e}:{},..._0x5d568b?{'platform':_0x5d568b}:{},..._0x480b6d?{'group_id':_0x480b6d}:{}},_0x81a747=JSON[_0x490342(0x18c)](_0x2e3eb9),_0x116d3a=_0x27103c[_0x490342(0x182)](_0x799db3,{'method':_0xf46eab[_0x490342(0x17c)],'headers':_0xf46eab[_0x490342(0x173)](i,_0x5a292c,{'Content-Type':_0xf46eab[_0x490342(0x19b)],'Content-Length':Buffer[_0x490342(0x19c)](_0x81a747),'X-PoW-Challenge':_0x2f59f4,'X-PoW-Nonce':_0x48216d}),'timeout':a},_0x442ec5=>{const _0x40b280=_0x490342,_0x43cefd={'PbeTd':function(_0x570ee3,_0xef851){const _0xed9760=_0x57d5;return _0xf46eab[_0xed9760(0x184)](_0x570ee3,_0xef851);},'kkZGq':function(_0x12e790,_0x454c5c){const _0x1d2ba5=_0x57d5;return _0xf46eab[_0x1d2ba5(0x183)](_0x12e790,_0x454c5c);},'TkINN':function(_0x3fe6be,_0x23da99){const _0x464c69=_0x57d5;return _0xf46eab[_0x464c69(0x18f)](_0x3fe6be,_0x23da99);},'lMoZV':function(_0x3a3a21,_0x1cf1ba){const _0x5e39d6=_0x57d5;return _0xf46eab[_0x5e39d6(0x1bd)](_0x3a3a21,_0x1cf1ba);},'HGsRj':_0xf46eab[_0x40b280(0x19a)]},_0x56450d=[];_0x442ec5['on'](_0xf46eab[_0x40b280(0x177)],_0x346632=>_0x56450d['push'](_0x346632)),_0x442ec5['on'](_0xf46eab[_0x40b280(0x1a2)],()=>{const _0x178e38=_0x40b280,_0x5e744d=Buffer[_0x178e38(0x18d)](_0x56450d)['toString'](_0x178e38(0x1bf));let _0xb73a72;try{_0xb73a72=_0x5e744d?JSON['parse'](_0x5e744d):{};}catch{const _0x2ac37a=new Error(_0x178e38(0x17f)+_0x442ec5[_0x178e38(0x1c1)]+'):'+_0x5e744d[_0x178e38(0x1a0)](0x0,0xc8));return _0x2ac37a['statusCode']=_0x442ec5[_0x178e38(0x1c1)],_0x2ac37a[_0x178e38(0x1bc)]=_0x5e744d,void _0x43cefd[_0x178e38(0x18b)](_0x14bd9e,_0x2ac37a);}if(_0x442ec5[_0x178e38(0x1c1)]>=0xc8&&_0x43cefd[_0x178e38(0x1af)](_0x442ec5[_0x178e38(0x1c1)],0x12c))_0x43cefd[_0x178e38(0x1c2)](_0x5382fa,_0xb73a72);else{const _0x4ac434=_0xb73a72?.[_0x178e38(0x1ab)],_0x15b015=(_0x4ac434&&_0x43cefd[_0x178e38(0x1c5)](_0x43cefd[_0x178e38(0x181)],typeof _0x4ac434)?_0x4ac434[_0x178e38(0x1c6)]:_0x4ac434)||_0xb73a72?.[_0x178e38(0x1c6)]||_0x178e38(0x1a1)+_0x442ec5[_0x178e38(0x1c1)],_0x311de3=new Error(_0x15b015);_0x311de3['statusCode']=_0x442ec5[_0x178e38(0x1c1)],_0x311de3['body']=_0xb73a72,_0x43cefd['PbeTd'](_0x14bd9e,_0x311de3);}});});_0x116d3a['on'](_0xf46eab[_0x490342(0x1b9)],()=>{const _0x17445e=_0x490342;_0x116d3a[_0x17445e(0x1b0)](new Error(_0x17445e(0x186)+_0x799db3[_0x17445e(0x180)]));}),_0x116d3a['on'](_0xf46eab[_0x490342(0x19d)],_0x14bd9e),_0x116d3a[_0x490342(0x1bb)](_0x81a747),_0x116d3a[_0x490342(0x190)]();});}export function listGroups({apiBase:_0x125208}){const _0x2b01a9=_0x1b2fed,_0x1f8368={'jJKjL':'utf8','WSdWH':function(_0x26518c,_0x55f1fb){return _0x26518c(_0x55f1fb);},'mFBbu':function(_0x483550,_0x3a0e70){return _0x483550<_0x3a0e70;},'XxAPg':_0x2b01a9(0x189),'UdJdG':_0x2b01a9(0x190),'KMXsO':function(_0x17d0f9,_0x2d88a1){return _0x17d0f9(_0x2d88a1);},'dkcQS':function(_0x401d0c,_0x268ff4){return _0x401d0c===_0x268ff4;},'lmFxQ':_0x2b01a9(0x1a6),'llLHU':function(_0x3cfc3f){return _0x3cfc3f();},'OTLdM':'GET','rIDrL':function(_0x133e25,_0x3fd0d8,_0x199297){return _0x133e25(_0x3fd0d8,_0x199297);},'fJBDc':_0x2b01a9(0x1ac),'TGRmx':_0x2b01a9(0x194),'QDtkw':_0x2b01a9(0x1ab)};return new Promise((_0x524c0a,_0x556d26)=>{const _0x60c6ae=_0x2b01a9,_0x5a8c2b={'szVsb':_0x1f8368['jJKjL'],'QdJXC':function(_0x523955,_0x38f76b){const _0x575167=_0x57d5;return _0x1f8368[_0x575167(0x195)](_0x523955,_0x38f76b);},'chLmi':function(_0xda1e81,_0x46f98b){return _0xda1e81>=_0x46f98b;},'UfUrw':function(_0x47ef25,_0x548868){const _0x13813e=_0x57d5;return _0x1f8368[_0x13813e(0x1b6)](_0x47ef25,_0x548868);},'EcgQl':_0x1f8368[_0x60c6ae(0x1c7)],'yJXPa':_0x1f8368[_0x60c6ae(0x1c0)]};let _0x1cced4;try{_0x1cced4=new URL(_0x60c6ae(0x17a),_0x125208);}catch(_0x51d647){return void _0x1f8368[_0x60c6ae(0x185)](_0x556d26,new Error('无效的\x20apiBase:'+_0x125208+'('+_0x51d647[_0x60c6ae(0x1c6)]+')'));}const _0x8dc3c5=_0x1f8368['dkcQS'](_0x1f8368['lmFxQ'],_0x1cced4[_0x60c6ae(0x174)])?_0x4a124b:_0x2e2060,_0x19d2d2=_0x1f8368[_0x60c6ae(0x1b7)](_0x1ce896),_0x133313=_0x8dc3c5[_0x60c6ae(0x182)](_0x1cced4,{'method':_0x1f8368[_0x60c6ae(0x1b3)],'headers':_0x1f8368[_0x60c6ae(0x1a7)](i,_0x19d2d2,{'Accept':_0x1f8368[_0x60c6ae(0x18e)]}),'timeout':a},_0x2ca7e7=>{const _0x51bc67=_0x60c6ae,_0x1ab271=[];_0x2ca7e7['on'](_0x5a8c2b[_0x51bc67(0x187)],_0x4e20a2=>_0x1ab271['push'](_0x4e20a2)),_0x2ca7e7['on'](_0x5a8c2b[_0x51bc67(0x1ad)],()=>{const _0x8b7171=_0x51bc67,_0x4aa4bb=Buffer[_0x8b7171(0x18d)](_0x1ab271)[_0x8b7171(0x193)](_0x5a8c2b[_0x8b7171(0x196)]);let _0x28393d;try{_0x28393d=_0x4aa4bb?JSON['parse'](_0x4aa4bb):{};}catch{return void _0x5a8c2b[_0x8b7171(0x17d)](_0x524c0a,[]);}if(_0x5a8c2b[_0x8b7171(0x198)](_0x2ca7e7[_0x8b7171(0x1c1)],0xc8)&&_0x5a8c2b[_0x8b7171(0x1ae)](_0x2ca7e7[_0x8b7171(0x1c1)],0x12c)){const _0x273206=Array['isArray'](_0x28393d)?_0x28393d:_0x28393d?.['groups'];_0x5a8c2b['QdJXC'](_0x524c0a,Array['isArray'](_0x273206)?_0x273206:[]);}else _0x524c0a([]);});});_0x133313['on'](_0x1f8368['TGRmx'],()=>{const _0x2cd11d=_0x60c6ae;_0x133313['destroy'](new Error(_0x2cd11d(0x186)+_0x1cced4[_0x2cd11d(0x180)]));}),_0x133313['on'](_0x1f8368[_0x60c6ae(0x1a4)],_0x598d92=>{const _0x3ec889=_0x60c6ae;_0x5a8c2b[_0x3ec889(0x17d)](_0x524c0a,[]);}),_0x133313[_0x60c6ae(0x190)]();});}export function verifyApiKey({apiKey:_0x38b46c,baseUrl:_0x25b839}){const _0x4f2c97=_0x1b2fed,_0x30bfdd={'KzPDW':_0x4f2c97(0x189),'rhrwd':'end','bwBSr':function(_0x280267,_0x427e40){return _0x280267(_0x427e40);},'PiJCO':function(_0x5c1535,_0x35067a){return _0x5c1535(_0x35067a);},'OjWdW':'https:','lrxkT':_0x4f2c97(0x1b2),'NnhWJ':_0x4f2c97(0x194)};return new Promise(_0x4691ae=>{const _0x48c6b3=_0x4f2c97,_0x1aea18={'vsaTY':function(_0x3d1e13,_0x3cbbeb){return _0x3d1e13<_0x3cbbeb;}};let _0x25da5a;try{_0x25da5a=new URL('/v1/models',_0x25b839);}catch{return void _0x30bfdd[_0x48c6b3(0x1aa)](_0x4691ae,{'ok':!0x1,'error':'无效的\x20baseUrl:'+_0x25b839});}const _0x191160=(_0x30bfdd[_0x48c6b3(0x197)]===_0x25da5a['protocol']?_0x4a124b:_0x2e2060)[_0x48c6b3(0x182)](_0x25da5a,{'method':_0x30bfdd[_0x48c6b3(0x1a3)],'headers':{'Authorization':_0x48c6b3(0x199)+_0x38b46c,'User-Agent':n},'timeout':0x3a98},_0x5cd697=>{const _0x194704=_0x48c6b3,_0x4b1884=[];_0x5cd697['on'](_0x30bfdd[_0x194704(0x1b8)],_0x1e466a=>_0x4b1884[_0x194704(0x175)](_0x1e466a)),_0x5cd697['on'](_0x30bfdd[_0x194704(0x1b5)],()=>{const _0x44d05e=_0x194704,_0x3a379f=_0x5cd697[_0x44d05e(0x1c1)]>=0xc8&&_0x1aea18[_0x44d05e(0x18a)](_0x5cd697[_0x44d05e(0x1c1)],0x12c);_0x4691ae({'ok':_0x3a379f,'statusCode':_0x5cd697[_0x44d05e(0x1c1)]});});});_0x191160['on'](_0x30bfdd[_0x48c6b3(0x178)],()=>{const _0x24c637=_0x48c6b3;_0x191160['destroy'](),_0x30bfdd[_0x24c637(0x192)](_0x4691ae,{'ok':!0x1,'error':_0x24c637(0x1a9)});}),_0x191160['on'](_0x48c6b3(0x1ab),_0x3cee97=>_0x4691ae({'ok':!0x1,'error':_0x3cee97[_0x48c6b3(0x1c6)]})),_0x191160[_0x48c6b3(0x190)]();});}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x5717ec,_0x199f43){const _0xc75db0=_0x195f,_0x1787e7=_0x5717ec();while(!![]){try{const _0x483093=parseInt(_0xc75db0(0x108))/0x1+-parseInt(_0xc75db0(0x113))/0x2+parseInt(_0xc75db0(0x112))/0x3+parseInt(_0xc75db0(0x105))/0x4*(parseInt(_0xc75db0(0x10b))/0x5)+parseInt(_0xc75db0(0x111))/0x6+parseInt(_0xc75db0(0x10f))/0x7*(parseInt(_0xc75db0(0x10a))/0x8)+parseInt(_0xc75db0(0x101))/0x9*(-parseInt(_0xc75db0(0x10c))/0xa);if(_0x483093===_0x199f43)break;else _0x1787e7['push'](_0x1787e7['shift']());}catch(_0x2d9f31){_0x1787e7['push'](_0x1787e7['shift']());}}}(_0x63ae,0x2210d));import _0x48370b from'node:fs';function _0x195f(_0x3582ea,_0x486ca4){_0x3582ea=_0x3582ea-0xfe;const _0x63ae8d=_0x63ae();let _0x195fb6=_0x63ae8d[_0x3582ea];return _0x195fb6;}import _0xe2fa65 from'node:path';export function backupFile(_0x1278f0){const _0x15c21a=_0x195f;let _0x3dcf1b=!0x1;try{_0x3dcf1b=_0x48370b['existsSync'](_0x1278f0);}catch{return null;}if(!_0x3dcf1b)return null;const _0x1de0be=_0x1278f0+'.bak.'+new Date()[_0x15c21a(0x100)]()['replace'](/[:.]/g,'-');return _0x48370b[_0x15c21a(0x109)](_0x1278f0,_0x1de0be),_0x1de0be;}export function listBackups(_0x614b7a){const _0x25db53=_0x195f,_0x30848b=[];for(const _0xcdcd54 of _0x614b7a){if(!_0xcdcd54)continue;let _0x14537c;try{_0x14537c=_0x48370b[_0x25db53(0x102)](_0xcdcd54,{'withFileTypes':!0x0});}catch{continue;}for(const _0x5ade8c of _0x14537c){if(!_0x5ade8c[_0x25db53(0x103)]())continue;const _0x5a9796=_0x5ade8c[_0x25db53(0x106)]['match'](/^(.+)\.bak\.[\dTZ:-]+$/);if(!_0x5a9796)continue;const _0x3fed7d=_0x5a9796[0x1],_0xb73358=_0xe2fa65['join'](_0xcdcd54,_0x5ade8c[_0x25db53(0x106)]),_0x4e6461=_0xe2fa65[_0x25db53(0xfe)](_0xcdcd54,_0x3fed7d);try{const _0x57d926=_0x48370b[_0x25db53(0x110)](_0xb73358);_0x30848b[_0x25db53(0x104)]({'bakPath':_0xb73358,'origPath':_0x4e6461,'mtime':_0x57d926[_0x25db53(0x107)],'dir':_0xcdcd54,'file':_0x5ade8c[_0x25db53(0x106)],'origName':_0x3fed7d,'size':_0x57d926[_0x25db53(0xff)]});}catch{}}}return _0x30848b['sort']((_0x5bfe54,_0x4563df)=>_0x4563df[_0x25db53(0x10e)]-_0x5bfe54[_0x25db53(0x10e)]),_0x30848b;}function _0x63ae(){const _0x518d70=['mtimeMs','106420MlWrVh','copyFileSync','8832wcUsjE','1270015DTfqMC','21020YbaTVL','existsSync','mtime','1631PMaBBS','statSync','147174MNSUca','626487jvMrlG','208004TuCfTa','join','size','toISOString','2601SvqDwL','readdirSync','isFile','push','4NyRRDD','name'];_0x63ae=function(){return _0x518d70;};return _0x63ae();}export function restoreBackup(_0x4194a3,_0x4e7e53){const _0x451a74=_0x195f;if(!_0x48370b[_0x451a74(0x10d)](_0x4194a3))throw new Error('备份文件不存在:'+_0x4194a3);const _0x5a90ca=_0xe2fa65['dirname'](_0x4e7e53);try{_0x48370b['mkdirSync'](_0x5a90ca,{'recursive':!0x0});}catch{}return _0x48370b[_0x451a74(0x109)](_0x4194a3,_0x4e7e53),_0x4e7e53;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x541bdf=_0x3845;(function(_0x3644fd,_0x49fc82){const _0x396948=_0x3845,_0x3aa2e2=_0x3644fd();while(!![]){try{const _0x38fec4=-parseInt(_0x396948(0x1c4))/0x1*(-parseInt(_0x396948(0x219))/0x2)+parseInt(_0x396948(0x19f))/0x3*(-parseInt(_0x396948(0x20a))/0x4)+parseInt(_0x396948(0x1aa))/0x5+-parseInt(_0x396948(0x1cb))/0x6*(-parseInt(_0x396948(0x216))/0x7)+parseInt(_0x396948(0x215))/0x8*(parseInt(_0x396948(0x25e))/0x9)+-parseInt(_0x396948(0x21f))/0xa*(-parseInt(_0x396948(0x191))/0xb)+-parseInt(_0x396948(0x180))/0xc;if(_0x38fec4===_0x49fc82)break;else _0x3aa2e2['push'](_0x3aa2e2['shift']());}catch(_0x39a93e){_0x3aa2e2['push'](_0x3aa2e2['shift']());}}}(_0x2af3,0x34112));import _0x145f0a from'node:fs';import _0x42c520 from'node:path';import _0x5ba66f from'node:os';import{backupFile as _0x2861f6,listBackups as _0x51f281,restoreBackup as _0x52f4f8}from'./backup.mjs';import{cliActivate as _0x30e125,listGroups as _0x36a3c3}from'./api.mjs';import{writeFileWithPermission as _0x1fec93,PermissionDeniedError as _0x54e376}from'./write.mjs';import{renderContent as _0x2ccff1,expandPath as _0x2c1556,listModels as _0xf75ce6}from'./render.mjs';import{getCliMeta as _0x5149cd,isDefaultSelected as _0x5f0096}from'./platforms.mjs';import{detectAll as _0x3797fa}from'./detect.mjs';import{ask as _0x3e6009,askSecret as _0x511f02,multiSelect as _0xc96d09,select as _0x589ec1,confirm as _0x54f7b2,closePrompt as _0x4def35}from'./prompt.mjs';import{banner as _0x139e42,ok as _0x59a1c7,fail as _0x131ec2,warn as _0x16122d,info as _0xb27f4f,step as _0x154257,plain as _0x10fb6d,guide as _0x2b76ed,chalk as _0x2976ea}from'./ui.mjs';const v=[_0x541bdf(0x1b4),_0x541bdf(0x1f3),_0x541bdf(0x232),'~/.gemini/settings.json'],C=[_0x541bdf(0x1ec),'%userprofile%\x5c.codex\x5cauth.json',_0x541bdf(0x1c9),_0x541bdf(0x1b0)],T=[_0x541bdf(0x1dc),_0x541bdf(0x1a3),_0x541bdf(0x213)],M=[_0x541bdf(0x1bc),_0x541bdf(0x253),'%userprofile%\x5c.gemini'];function R(_0x557296){const _0x2c6a03=_0x541bdf,_0x17327b={'SjgfL':function(_0x1e92b3,_0x59ca9b){return _0x1e92b3<_0x59ca9b;},'WZmss':_0x2c6a03(0x24b),'hQATL':function(_0x1f8f8e,_0x2f15bd){return _0x1f8f8e===_0x2f15bd;},'DOSun':_0x2c6a03(0x18c),'hEQUi':function(_0x148e8b,_0x9f72f){return _0x148e8b===_0x9f72f;}},_0x3d07a7={'dryRun':!0x1,'_':[]};for(let _0x224fec=0x0;_0x17327b[_0x2c6a03(0x23f)](_0x224fec,_0x557296[_0x2c6a03(0x19a)]);_0x224fec++){const _0xfb4309=_0x557296[_0x224fec];if(_0x17327b[_0x2c6a03(0x1d1)]===_0xfb4309||'-n'===_0xfb4309)_0x3d07a7[_0x2c6a03(0x226)]=!0x0;else{if(_0x2c6a03(0x230)===_0xfb4309)_0x3d07a7[_0x2c6a03(0x235)]=_0x557296[++_0x224fec];else{if(_0x17327b['hQATL'](_0x17327b['DOSun'],_0xfb4309)||_0x17327b[_0x2c6a03(0x1ab)]('-h',_0xfb4309))_0x3d07a7['help']=!0x0;else{if(_0xfb4309[_0x2c6a03(0x185)]('--')&&_0xfb4309['includes']('=')){const [_0x4d16b7,_0x3889cf]=_0xfb4309[_0x2c6a03(0x23c)](0x2)[_0x2c6a03(0x234)](/=(.*)/,0x2);_0x3d07a7[_0x4d16b7]=_0x3889cf;}else _0xfb4309['startsWith']('--')?_0x3d07a7[_0xfb4309[_0x2c6a03(0x1d0)](/^--/,'')]=_0x557296[++_0x224fec]:_0x3d07a7['_'][_0x2c6a03(0x193)](_0xfb4309);}}}}return _0x3d07a7;}function N(_0x1050c2,_0x217d3e){const _0x4a2285=_0x541bdf,_0x49306d={'Lqhti':function(_0x3da75d,_0x2babc5,_0x130cf4){return _0x3da75d(_0x2babc5,_0x130cf4);}};return _0x49306d[_0x4a2285(0x1ee)](_0x2c1556,_0x1050c2,{'isWindows':_0x217d3e});}function K(_0xeb98c9){const _0x56d8b0=_0x541bdf;return(_0xeb98c9?M:T)[_0x56d8b0(0x21e)](_0x783558=>N(_0x783558,_0xeb98c9));}const H=_0x541bdf(0x257)['trim']();export const SUBCOMMANDS={'restore':{'handler':async function(_0x2a59f7){const _0x83f830=_0x541bdf,_0x5d6106={'WyYKI':function(_0x13421b,_0x1a4ddb){return _0x13421b(_0x1a4ddb);},'efMyd':function(_0x34c081,_0x23daeb){return _0x34c081(_0x23daeb);},'CoYNd':function(_0x5d88d8,_0x43e555){return _0x5d88d8(_0x43e555);},'TdSQk':function(_0x110a5d,_0x552fab){return _0x110a5d(_0x552fab);},'bgtsH':'\x20|\x20','qoiOo':function(_0x599443){return _0x599443();},'Yvcvp':'扫描备份文件','xhVLV':function(_0x2df0ae,_0x1cb8aa){return _0x2df0ae(_0x1cb8aa);},'RQcdh':function(_0xc9b822,_0x2b0e34){return _0xc9b822(_0x2b0e34);},'rtlML':function(_0xc9ce13,_0x567ef0){return _0xc9ce13(_0x567ef0);},'NRcds':function(_0x28412c,_0x28f201){return _0x28412c===_0x28f201;},'YABHp':_0x83f830(0x19e),'XnhAe':function(_0x19083b,_0x322e6b){return _0x19083b(_0x322e6b);},'hZYNa':'Codex\x20CLI','bboTZ':_0x83f830(0x224),'JVesy':function(_0x41774b,_0x496cac,_0x45d61a,_0x1ace6a){return _0x41774b(_0x496cac,_0x45d61a,_0x1ace6a);},'HxyGd':_0x83f830(0x208),'gRVps':function(_0x2744b1,_0x158e7b){return _0x2744b1<_0x158e7b;},'TcXxp':function(_0x29ada1,_0x8a1c8e){return _0x29ada1>=_0x8a1c8e;},'UIQKt':function(_0x2c6aad,_0x205b0b){return _0x2c6aad(_0x205b0b);},'tDkbQ':_0x83f830(0x192),'JuoBW':function(_0x41d0f9,_0x18de06){return _0x41d0f9>_0x18de06;},'HxAnS':function(_0x55a1f6,_0x56ed50,_0x37fc6c,_0x5ae632){return _0x55a1f6(_0x56ed50,_0x37fc6c,_0x5ae632);},'bFMsj':_0x83f830(0x244),'fckzF':function(_0x2ed236,_0x1bd09e){return _0x2ed236<_0x1bd09e;},'aDSrE':_0x83f830(0x256),'HlWRm':function(_0x28768f,_0x57c2f8){return _0x28768f(_0x57c2f8);},'ocEKJ':function(_0x518d94,_0xb6a8b5){return _0x518d94(_0xb6a8b5);},'roojv':function(_0x359167,_0x16f828){return _0x359167(_0x16f828);},'sEOpK':function(_0x2d5d69,_0x59b9a6,_0x1849b6){return _0x2d5d69(_0x59b9a6,_0x1849b6);},'ykMNd':function(_0xdf72d5,_0x126676){return _0xdf72d5>_0x126676;}},_0x1ec2e1=_0x5d6106[_0x83f830(0x22a)](R,_0x2a59f7);if(_0x1ec2e1[_0x83f830(0x1db)])return console[_0x83f830(0x1e9)]('npx\x20@2api-store/activate\x20restore\x20[options]\x0a\x0a'+H),0x0;_0x5d6106[_0x83f830(0x204)](_0x139e42);const _0x5cb513=_0x3797fa();if(!_0x5cb513[_0x83f830(0x1ad)][_0x83f830(0x172)])return _0x5d6106[_0x83f830(0x1ed)](_0x131ec2,_0x83f830(0x202)+_0x5cb513[_0x83f830(0x1ad)]['version']),0x1;_0x154257(_0x5d6106[_0x83f830(0x177)]);const _0x3d6f00=_0x5d6106[_0x83f830(0x246)](K,_0x5cb513['os']['isWindows']);_0x1ec2e1[_0x83f830(0x226)]&&_0x5d6106[_0x83f830(0x1b2)](_0x16122d,_0x83f830(0x1d9)),_0x5d6106[_0x83f830(0x1f1)](_0xb27f4f,_0x83f830(0x1f7)+_0x3d6f00[_0x83f830(0x1b5)](',\x20'));const _0x11a425=_0x5d6106[_0x83f830(0x23d)](_0x51f281,_0x3d6f00);if(_0x5d6106[_0x83f830(0x1d7)](0x0,_0x11a425['length']))return _0xb27f4f(_0x5d6106['YABHp']),_0x5d6106[_0x83f830(0x23d)](_0xb27f4f,_0x83f830(0x1e3)),0x0;_0x5d6106[_0x83f830(0x20b)](_0x59a1c7,_0x83f830(0x211)+_0x11a425[_0x83f830(0x19a)]+_0x83f830(0x186));const _0x4b39f9={'.codex':_0x5d6106[_0x83f830(0x196)],'.claude':_0x83f830(0x1e4),'.gemini':_0x5d6106[_0x83f830(0x1f8)]};function _0x30a935(_0x293d7f){const _0x34fc10=_0x83f830,_0x511a74=process['env'][_0x34fc10(0x24c)]||process[_0x34fc10(0x1ae)][_0x34fc10(0x228)]||'',_0x3456b6=_0x42c520[_0x34fc10(0x1af)](_0x511a74,_0x293d7f)[_0x34fc10(0x1d0)](/\\/g,'/')['split']('/')[0x0];return _0x4b39f9[_0x3456b6]||_0x3456b6;}function _0x1ec306(_0x48d4a2){const _0x34a009=_0x83f830;return process['env']['HOME']||process[_0x34a009(0x1ae)][_0x34a009(0x228)],_0x42c520['dirname'](_0x48d4a2);}const _0xf31a6e={};for(const _0x160709 of _0x11a425){const _0x25db51=_0x5d6106['efMyd'](_0x1ec306,_0x160709[_0x83f830(0x203)]);_0xf31a6e[_0x25db51]||(_0xf31a6e[_0x25db51]=[]),_0xf31a6e[_0x25db51]['push'](_0x160709);}const _0x2c1c68=Object[_0x83f830(0x1cd)](_0xf31a6e);if(_0x5d6106[_0x83f830(0x1d7)](0x0,_0x2c1c68[_0x83f830(0x19a)]))return _0xb27f4f(_0x83f830(0x183)),0x0;console['log'](),_0x154257('选择要恢复的应用');const _0x4e055f=_0x2c1c68[_0x83f830(0x21e)](_0x3c836b=>{const _0x30a4ae=_0x83f830,_0x4fb377=_0x5d6106[_0x30a4ae(0x1f1)](_0x30a935,_0x42c520[_0x30a4ae(0x1b5)](_0x3c836b,'dummy')),_0x1ac226=_0xf31a6e[_0x3c836b]['length'];return{'label':_0x2976ea[_0x30a4ae(0x17e)](_0x4fb377)+'('+_0x1ac226+_0x30a4ae(0x1a7),'dir':_0x3c836b};}),_0x5e3408=await _0x5d6106[_0x83f830(0x25d)](_0x589ec1,_0x5d6106['HxyGd'],_0x4e055f,{'defaultIndex':0x0});if(_0x5d6106[_0x83f830(0x1ac)](_0x5e3408,0x0)||_0x5d6106[_0x83f830(0x198)](_0x5e3408,_0x4e055f[_0x83f830(0x19a)]))return _0x5d6106['XnhAe'](_0x131ec2,_0x83f830(0x19c)),0x1;const _0x32338f=_0x4e055f[_0x5e3408][_0x83f830(0x243)],_0x466821=_0x5d6106[_0x83f830(0x1a5)](_0x30a935,_0x42c520['join'](_0x32338f,_0x5d6106[_0x83f830(0x22f)])),_0xc9be2b=_0xf31a6e[_0x32338f][_0x83f830(0x1d4)]((_0x49d05c,_0x271988)=>_0x271988['mtime']-_0x49d05c[_0x83f830(0x25c)]),_0x2c8923={},_0x4a017b=[];for(const _0x323c9e of _0xc9be2b){const _0x202d05=_0x42c520['basename'](_0x323c9e[_0x83f830(0x1b1)])[_0x83f830(0x175)](/\.bak\.(.+)$/),_0x2ff0e2=(_0x202d05?_0x202d05[0x1]:'')[_0x83f830(0x1d0)](/-\d{3}Z$/,'Z');_0x2c8923[_0x2ff0e2]||(_0x2c8923[_0x2ff0e2]=[],_0x4a017b[_0x83f830(0x193)](_0x2ff0e2)),_0x2c8923[_0x2ff0e2]['push'](_0x323c9e);}for(const _0x4819c6 of _0x4a017b){const _0x34714a=_0x2c8923[_0x4819c6],_0x38d08c={};for(const _0x6c2488 of _0x34714a)(!_0x38d08c[_0x6c2488[_0x83f830(0x203)]]||_0x5d6106[_0x83f830(0x260)](_0x6c2488[_0x83f830(0x25c)],_0x38d08c[_0x6c2488[_0x83f830(0x203)]][_0x83f830(0x25c)]))&&(_0x38d08c[_0x6c2488[_0x83f830(0x203)]]=_0x6c2488);_0x2c8923[_0x4819c6]=Object[_0x83f830(0x19b)](_0x38d08c)[_0x83f830(0x1d4)]((_0xf77249,_0x292dda)=>_0x292dda[_0x83f830(0x25c)]-_0xf77249[_0x83f830(0x25c)]);}console[_0x83f830(0x1e9)](),_0x5d6106['RQcdh'](_0x154257,_0x83f830(0x22d)+_0x466821+')');const _0x3b9825=_0x4a017b[_0x83f830(0x21e)](_0x53d4f9=>{const _0x5199dd=_0x83f830,_0x1c89aa={'scIyW':function(_0x19654b,_0x4a15f3){const _0x245cd7=_0x3845;return _0x5d6106[_0x245cd7(0x22a)](_0x19654b,_0x4a15f3);},'KQdzq':function(_0xbed221,_0x2a1dd4){return _0xbed221+_0x2a1dd4;},'uckDY':function(_0x5b0e86,_0x64c29b){const _0xe3b891=_0x3845;return _0x5d6106[_0xe3b891(0x23b)](_0x5b0e86,_0x64c29b);},'RGTfb':function(_0x1e5857,_0x37dd56){const _0x3d606d=_0x3845;return _0x5d6106[_0x3d606d(0x1ed)](_0x1e5857,_0x37dd56);}},_0x52c3ec=_0x2c8923[_0x53d4f9],_0x255136=_0x52c3ec[_0x5199dd(0x21e)](_0x493d84=>_0x42c520['basename'](_0x493d84['origPath']))[_0x5199dd(0x1b5)](',\x20'),_0x19d1ee=function(_0x57349e){const _0x41b0a6=_0x5199dd;try{const _0x1282b2=new Date(_0x57349e),_0x17a05f=_0x1508e9=>String(_0x1508e9)['padStart'](0x2,'0');return _0x1282b2[_0x41b0a6(0x201)]()+'-'+_0x1c89aa[_0x41b0a6(0x1f5)](_0x17a05f,_0x1c89aa[_0x41b0a6(0x22e)](_0x1282b2[_0x41b0a6(0x1c5)](),0x1))+'-'+_0x17a05f(_0x1282b2[_0x41b0a6(0x1c8)]())+'\x20'+_0x1c89aa[_0x41b0a6(0x1f5)](_0x17a05f,_0x1282b2['getHours']())+':'+_0x1c89aa[_0x41b0a6(0x1e8)](_0x17a05f,_0x1282b2[_0x41b0a6(0x241)]())+':'+_0x1c89aa[_0x41b0a6(0x1a1)](_0x17a05f,_0x1282b2[_0x41b0a6(0x173)]());}catch{return new Date(_0x57349e)[_0x41b0a6(0x240)]();}}(_0x52c3ec[0x0][_0x5199dd(0x25c)]),_0x515a60=[];for(const _0x2dd569 of _0x52c3ec)try{const _0x1a649a=_0x145f0a['readFileSync'](_0x2dd569[_0x5199dd(0x1b1)],_0x5199dd(0x239));if(!_0x515a60[_0x5199dd(0x1ff)](_0x56ae87=>_0x56ae87[_0x5199dd(0x25b)]('…'))){const _0x1493b8=_0x1a649a[_0x5199dd(0x175)](/sk-([a-zA-Z0-9]{10,})/);if(_0x1493b8)_0x515a60[_0x5199dd(0x193)](_0x5199dd(0x245)+_0x1493b8[0x1]['slice'](-0x6));else{const _0x52c98e=_0x1a649a[_0x5199dd(0x175)](/(?:API_KEY|AUTH_TOKEN|OPENAI_API_KEY|ANTHROPIC_API_KEY|ANTHROPIC_AUTH_TOKEN)["':\s]+["']([a-zA-Z0-9._-]{10,})["']/);if(_0x52c98e)_0x515a60[_0x5199dd(0x193)](_0x5199dd(0x1b8)+_0x52c98e[0x1]['slice'](-0x6));else{const _0xfce456=_0x1a649a[_0x5199dd(0x175)](/export\s+(?:API_KEY|AUTH_TOKEN|OPENAI_API_KEY|ANTHROPIC_API_KEY|ANTHROPIC_AUTH_TOKEN)=(["']?)([a-zA-Z0-9._-]{10,})/);_0xfce456&&_0x515a60['push']('key:…'+_0xfce456[0x2][_0x5199dd(0x23c)](-0x6));}}}if(!_0x515a60[_0x5199dd(0x1ff)](_0x51e2c9=>_0x51e2c9[_0x5199dd(0x185)](_0x5199dd(0x261)))){const _0x8ce233=_0x1a649a[_0x5199dd(0x175)](/(https?:\/\/[^\s"'`}]+)/);_0x8ce233&&_0x515a60[_0x5199dd(0x193)](_0x8ce233[0x1][_0x5199dd(0x1d0)](/\/+$/,''));}if(!_0x515a60[_0x5199dd(0x1ff)](_0x1c3a96=>_0x1c3a96['startsWith'](_0x5199dd(0x1e2)))){const _0x45c57f=_0x1a649a[_0x5199dd(0x175)](/(?:^|\n)\s*model\s*[=:]\s*["']?([a-zA-Z0-9][\w.-]+)/);_0x45c57f&&_0x515a60[_0x5199dd(0x193)](_0x5199dd(0x1c6)+_0x45c57f[0x1]);}}catch{}const _0x259f93=_0x515a60[_0x5199dd(0x19a)]>0x0?'\x20'+_0x2976ea[_0x5199dd(0x1a6)](_0x515a60[_0x5199dd(0x1b5)](_0x5d6106[_0x5199dd(0x1e6)])):'';return{'label':_0x2976ea[_0x5199dd(0x23e)](_0x19d1ee)+'('+_0x52c3ec[_0x5199dd(0x19a)]+_0x5199dd(0x194)+_0x255136+')'+_0x259f93,'ts':_0x53d4f9,'group':_0x52c3ec};}),_0x70c84d=await _0x5d6106[_0x83f830(0x25a)](_0x589ec1,_0x5d6106[_0x83f830(0x1b7)],_0x3b9825,{'defaultIndex':0x0});if(_0x5d6106[_0x83f830(0x1e1)](_0x70c84d,0x0)||_0x70c84d>=_0x3b9825[_0x83f830(0x19a)])return _0x131ec2(_0x5d6106[_0x83f830(0x1fc)]),0x1;const _0x4d1e59=_0x3b9825[_0x70c84d][_0x83f830(0x200)];console[_0x83f830(0x1e9)](),_0x5d6106[_0x83f830(0x246)](_0xb27f4f,'将恢复\x20'+_0x466821+'('+_0x4d1e59['length']+_0x83f830(0x187));for(const _0x82a76a of _0x4d1e59)_0xb27f4f('\x20\x20'+_0x42c520[_0x83f830(0x23a)](_0x82a76a[_0x83f830(0x203)])+_0x83f830(0x242)+_0x42c520['basename'](_0x82a76a[_0x83f830(0x1b1)]));if(_0x1ec2e1[_0x83f830(0x226)])return _0x5d6106[_0x83f830(0x171)](_0x16122d,_0x83f830(0x1f6)),0x0;let _0x1f9813=0x0;for(const _0x484548 of _0x4d1e59){if(_0x145f0a[_0x83f830(0x1f9)](_0x484548[_0x83f830(0x203)]))try{const _0x2effe3=_0x5d6106['ocEKJ'](_0x2861f6,_0x484548[_0x83f830(0x203)]);_0x2effe3&&_0x5d6106[_0x83f830(0x1ef)](_0xb27f4f,_0x83f830(0x1c2)+_0x42c520[_0x83f830(0x23a)](_0x484548[_0x83f830(0x203)])+_0x83f830(0x184)+_0x42c520[_0x83f830(0x23a)](_0x2effe3));}catch{}try{_0x5d6106[_0x83f830(0x206)](_0x52f4f8,_0x484548[_0x83f830(0x1b1)],_0x484548['origPath']),_0x5d6106[_0x83f830(0x23d)](_0x59a1c7,'已恢复:'+_0x484548['origPath']),_0x1f9813++;}catch(_0x21b91d){_0x5d6106[_0x83f830(0x246)](_0x131ec2,'恢复失败:'+_0x484548[_0x83f830(0x203)]+'('+_0x21b91d[_0x83f830(0x1a9)]+')');}}return _0x5d6106[_0x83f830(0x182)](_0xb27f4f,_0x83f830(0x251)+_0x1f9813+_0x83f830(0x1cf)),_0x5d6106['ykMNd'](_0x1f9813,0x0)?0x0:0x3;},'description':_0x541bdf(0x225)},'reset':{'handler':async function(_0x473c7b){const _0x50551e=_0x541bdf,_0x460fed={'kjfyz':function(_0x41a2d4,_0x2b14d3){return _0x41a2d4(_0x2b14d3);},'uDvqB':function(_0x529598){return _0x529598();},'KOoLd':function(_0x3fba2d){return _0x3fba2d();},'rdLKh':function(_0x521c31,_0x4403bb){return _0x521c31(_0x4403bb);},'PRjOa':_0x50551e(0x19d),'fARqZ':function(_0x49e144,_0x37210a){return _0x49e144===_0x37210a;},'zDyBU':function(_0x1b4b58,_0x2f7792){return _0x1b4b58(_0x2f7792);},'euokp':'将处理以下文件:','oMbyQ':function(_0x520bb8,_0x5e3736){return _0x520bb8(_0x5e3736);},'HEkMd':function(_0x9bf43e,_0x5def32){return _0x9bf43e>_0x5def32;},'WEROt':_0x50551e(0x254),'tsKYS':'⚠️\x20这是破坏性操作:将删除上述配置文件并尝试从备份恢复。','saSKE':function(_0x427631,_0x12962c){return _0x427631(_0x12962c);},'awoRN':_0x50551e(0x223),'keryX':function(_0x45e4c6,_0x588e52,_0x38ef57){return _0x45e4c6(_0x588e52,_0x38ef57);},'zoPjt':_0x50551e(0x1d5),'EoYIN':_0x50551e(0x258),'ortof':function(_0x5660b2,_0x423585){return _0x5660b2(_0x423585);},'NWZRv':_0x50551e(0x1b3),'lGRVw':_0x50551e(0x247),'oLbHf':function(_0x3e1907,_0x162ca1){return _0x3e1907>_0x162ca1;},'fLOAr':function(_0xba18e5,_0x7cad00){return _0xba18e5(_0x7cad00);},'OfGhD':_0x50551e(0x1d3),'XWovl':function(_0xab5ecf,_0xb01e2d){return _0xab5ecf(_0xb01e2d);},'zCxfY':_0x50551e(0x207),'PYFlK':'EPERM','SnPwi':_0x50551e(0x236),'wuhqx':function(_0x40c37f,_0x52d97f){return _0x40c37f(_0x52d97f);},'zWTcI':function(_0x2acbfd,_0x519b26){return _0x2acbfd(_0x519b26);},'ASjzg':_0x50551e(0x176),'HUnYn':function(_0x422bb1,_0x4160d0){return _0x422bb1>_0x4160d0;},'ywWvi':function(_0x556f47,_0x4d2562){return _0x556f47(_0x4d2562);},'MwCTQ':function(_0x1f9061,_0x3167a0){return _0x1f9061(_0x3167a0);},'MuITC':function(_0x3608e4,_0x3b2181){return _0x3608e4(_0x3b2181);},'YbQEj':_0x50551e(0x212),'PiNla':function(_0x42a79e,_0x2ff937){return _0x42a79e(_0x2ff937);},'DFnyz':function(_0x1ec286,_0x21a4ec){return _0x1ec286(_0x21a4ec);},'SEyFK':_0x50551e(0x227),'ouOsG':function(_0x2e87aa,_0x46940a){return _0x2e87aa>_0x46940a;}},_0x280734=_0x460fed[_0x50551e(0x1da)](R,_0x473c7b);if(_0x280734[_0x50551e(0x1db)])return console[_0x50551e(0x1e9)]('npx\x20@2api-store/activate\x20reset\x20[options]\x0a\x0a'+H),0x0;_0x460fed['uDvqB'](_0x139e42);const _0x3ca8d2=_0x460fed[_0x50551e(0x217)](_0x3797fa);if(!_0x3ca8d2[_0x50551e(0x1ad)][_0x50551e(0x172)])return _0x460fed[_0x50551e(0x24d)](_0x131ec2,_0x50551e(0x202)+_0x3ca8d2[_0x50551e(0x1ad)]['version']),0x1;var _0x35a3b3;_0x460fed[_0x50551e(0x24d)](_0x154257,_0x460fed[_0x50551e(0x1d2)]);const _0x12dde1=((_0x35a3b3=_0x3ca8d2['os'][_0x50551e(0x1a4)])?C:v)[_0x50551e(0x21e)](_0x57a805=>N(_0x57a805,_0x35a3b3))[_0x50551e(0x1a2)](_0x35a6cc=>{const _0x1646f5=_0x50551e;try{return _0x145f0a[_0x1646f5(0x1f9)](_0x35a6cc);}catch{return!0x1;}});if(_0x460fed[_0x50551e(0x1ca)](0x0,_0x12dde1[_0x50551e(0x19a)]))return _0x460fed['zDyBU'](_0x16122d,_0x50551e(0x1c3)),_0xb27f4f(_0x50551e(0x1df)),0x0;_0x460fed['kjfyz'](_0xb27f4f,_0x460fed[_0x50551e(0x178)]),_0x12dde1[_0x50551e(0x1ce)](_0x238cb5=>_0x10fb6d('\x20\x20-\x20'+_0x2976ea['yellow'](_0x238cb5))),console[_0x50551e(0x1e9)]();const _0x348be2=_0x460fed[_0x50551e(0x221)](K,_0x3ca8d2['os'][_0x50551e(0x1a4)]),_0x3702d5=_0x51f281(_0x348be2),_0x53cb3a=_0x460fed['HEkMd'](_0x3702d5[_0x50551e(0x19a)],0x0);if(_0x53cb3a?_0x59a1c7(_0x50551e(0x222)+_0x3702d5['length']+_0x50551e(0x1e7)):_0x460fed[_0x50551e(0x24d)](_0x16122d,_0x460fed[_0x50551e(0x1bb)]),console[_0x50551e(0x1e9)](),_0x460fed[_0x50551e(0x1da)](_0x154257,_0x50551e(0x1cc)),_0x460fed[_0x50551e(0x24d)](_0x16122d,_0x460fed[_0x50551e(0x20c)]),_0x460fed['saSKE'](_0x16122d,_0x460fed['awoRN']),!await _0x460fed[_0x50551e(0x24a)](_0x54f7b2,'确认\x20reset\x20吗?',{'defaultValue':!0x1}))return _0x10fb6d(_0x460fed[_0x50551e(0x188)]),0x0;if(console[_0x50551e(0x1e9)](),_0x280734[_0x50551e(0x226)])return _0x16122d(_0x460fed['EoYIN']),_0x460fed[_0x50551e(0x20e)](_0xb27f4f,_0x460fed['NWZRv']),_0x12dde1[_0x50551e(0x1ce)](_0x4606aa=>_0x10fb6d(_0x50551e(0x189)+_0x4606aa)),_0x53cb3a&&(_0xb27f4f(_0x460fed['lGRVw']),_0x3702d5[_0x50551e(0x23c)](0x0,0x5)[_0x50551e(0x1ce)](_0x505fad=>_0x10fb6d(_0x50551e(0x1bf)+_0x505fad[_0x50551e(0x1b1)]+'\x20→\x20'+_0x505fad[_0x50551e(0x203)])),_0x460fed[_0x50551e(0x214)](_0x3702d5['length'],0x5)&&_0x460fed[_0x50551e(0x218)](_0x10fb6d,'\x20\x20...(共\x20'+_0x3702d5[_0x50551e(0x19a)]+_0x50551e(0x1a7))),0x0;_0x154257(_0x460fed[_0x50551e(0x1fe)]);const _0x56204e=[];for(const _0x10762a of _0x12dde1)try{const _0x225eaf=_0x10762a+_0x50551e(0x1fa)+new Date()['toISOString']()['replace'](/[:.]/g,'-');_0x145f0a[_0x50551e(0x1be)](_0x10762a,_0x225eaf),_0x56204e[_0x50551e(0x193)](_0x225eaf),_0x460fed[_0x50551e(0x252)](_0x10fb6d,_0x50551e(0x1d8)+_0x10762a+_0x50551e(0x184)+_0x225eaf);}catch(_0x3b8827){_0x131ec2(_0x50551e(0x20d)+_0x10762a+':'+_0x3b8827['message']+'(跳过删除此文件避免误伤)');}_0x56204e[_0x50551e(0x19a)]>0x0&&_0x59a1c7(_0x50551e(0x1de)+_0x56204e[_0x50551e(0x19a)]+'\x20个文件'),console[_0x50551e(0x1e9)](),_0x460fed[_0x50551e(0x1da)](_0x154257,_0x50551e(0x229));const _0x8e2061=[];for(const _0x3aebe9 of _0x12dde1)try{_0x145f0a[_0x50551e(0x17b)](_0x3aebe9),_0x59a1c7(_0x50551e(0x1c7)+_0x3aebe9),_0x8e2061[_0x50551e(0x193)](_0x3aebe9);}catch(_0x5c1e0b){_0x460fed[_0x50551e(0x21d)]===_0x5c1e0b[_0x50551e(0x22b)]||_0x460fed['fARqZ'](_0x460fed['PYFlK'],_0x5c1e0b[_0x50551e(0x22b)])||_0x460fed[_0x50551e(0x1ca)](_0x460fed['SnPwi'],_0x5c1e0b[_0x50551e(0x22b)])?_0x460fed[_0x50551e(0x21c)](_0x131ec2,'权限不足,无法删除\x20'+_0x3aebe9+_0x50551e(0x17a)):_0x460fed[_0x50551e(0x1ea)](_0x131ec2,_0x50551e(0x209)+_0x3aebe9+':'+_0x5c1e0b[_0x50551e(0x1a9)]);}if(console[_0x50551e(0x1e9)](),_0x53cb3a){_0x154257(_0x460fed[_0x50551e(0x174)]);const _0x25a734=new Map();for(const _0x3f16ef of _0x3702d5){const _0x1c95ff=_0x25a734[_0x50551e(0x210)](_0x3f16ef['origPath']);(!_0x1c95ff||_0x460fed[_0x50551e(0x20f)](_0x3f16ef[_0x50551e(0x25c)],_0x1c95ff['mtime']))&&_0x25a734[_0x50551e(0x1c0)](_0x3f16ef[_0x50551e(0x203)],_0x3f16ef);}let _0x55b806=0x0;for(const [_0x556f38,_0x44c6d9]of _0x25a734)try{_0x460fed[_0x50551e(0x24a)](_0x52f4f8,_0x44c6d9[_0x50551e(0x1b1)],_0x556f38),_0x460fed[_0x50551e(0x1fd)](_0x59a1c7,_0x50551e(0x1eb)+_0x44c6d9['bakPath']+_0x50551e(0x184)+_0x556f38),_0x55b806++;}catch(_0x4e20cb){_0x16122d(_0x50551e(0x205)+_0x556f38+':'+_0x4e20cb[_0x50551e(0x1a9)]+_0x50551e(0x1a8));}_0x460fed['HUnYn'](_0x55b806,0x0)&&_0x460fed[_0x50551e(0x1bd)](_0xb27f4f,'从备份恢复\x20'+_0x55b806+_0x50551e(0x1cf)),console[_0x50551e(0x1e9)]();}return _0x460fed[_0x50551e(0x249)](_0x154257,_0x460fed['YbQEj']),_0x460fed['PiNla'](_0x59a1c7,_0x50551e(0x190)+_0x8e2061[_0x50551e(0x19a)]+_0x50551e(0x195)),_0x460fed[_0x50551e(0x1b6)](_0x56204e['length'],0x0)&&(_0xb27f4f('安全备份位置(如需撤销\x20reset,手动恢复这些文件):'),_0x56204e[_0x50551e(0x1ce)](_0x1f476a=>_0x10fb6d(_0x50551e(0x1bf)+_0x1f476a))),_0x460fed[_0x50551e(0x199)](_0xb27f4f,_0x460fed['SEyFK']),_0x460fed[_0x50551e(0x255)](_0x8e2061[_0x50551e(0x19a)],0x0)?0x0:0x1;},'description':_0x541bdf(0x1dd)},'refresh-groups':{'handler':async function(_0x4fd85e){const _0x1db2f6=_0x541bdf,_0x8198f1={'DjmPB':function(_0x50964e,_0x8f5783){return _0x50964e(_0x8f5783);},'zEoyF':function(_0x2bdb75,_0x4f24c5){return _0x2bdb75(_0x4f24c5);},'kKhag':function(_0x3ace05){return _0x3ace05();},'vcQdX':function(_0x543bbd,_0x5e513e){return _0x543bbd(_0x5e513e);},'Wddzh':_0x1db2f6(0x220),'EirbR':function(_0xf1dff0,_0x6edff8){return _0xf1dff0(_0x6edff8);},'CbHpm':function(_0x110798,_0x5f5d63){return _0x110798(_0x5f5d63);},'NUKTh':_0x1db2f6(0x1ba),'uSwHf':function(_0x5bfbb5,_0x26a13f){return _0x5bfbb5(_0x26a13f);},'HjZqm':function(_0x1a1b36,_0xedb6ff){return _0x1a1b36(_0xedb6ff);},'JAhwJ':function(_0x36322d,_0x578479){return _0x36322d===_0x578479;},'zCEYY':'未查询到可用分组','iJWuT':_0x1db2f6(0x17f),'Kidqw':function(_0x732f3,_0x2df891){return _0x732f3(_0x2df891);},'OBwKP':_0x1db2f6(0x1f0),'MuQvV':function(_0x5228d8,_0x37a013){return _0x5228d8+_0x37a013;},'wKdVG':function(_0x139683,_0x391dc7){return _0x139683(_0x391dc7);},'PhKVq':_0x1db2f6(0x1f2),'bWsla':_0x1db2f6(0x1b9),'Wwdoo':function(_0x512ec7,_0xfec5e1){return _0x512ec7(_0xfec5e1);},'xEOwo':'\x20\x20•\x20使用兑换码:重新激活时选目标分组即可'},_0x3995e6=_0x8198f1[_0x1db2f6(0x17c)](R,_0x4fd85e);if(_0x3995e6[_0x1db2f6(0x1db)])return console[_0x1db2f6(0x1e9)](_0x1db2f6(0x231)+H),0x0;_0x8198f1[_0x1db2f6(0x18e)](_0x139e42);const _0x25ea7b=_0x3797fa();if(!_0x25ea7b[_0x1db2f6(0x1ad)][_0x1db2f6(0x172)])return _0x8198f1[_0x1db2f6(0x24e)](_0x131ec2,'需要\x20node\x20>=\x2018,当前\x20'+_0x25ea7b[_0x1db2f6(0x1ad)][_0x1db2f6(0x197)]),0x1;const _0x33f889=_0x3995e6[_0x1db2f6(0x235)]||process[_0x1db2f6(0x1ae)][_0x1db2f6(0x21a)]||_0x8198f1[_0x1db2f6(0x181)];_0x8198f1[_0x1db2f6(0x18d)](_0xb27f4f,'API\x20端点:'+_0x33f889),console[_0x1db2f6(0x1e9)](),_0x8198f1['CbHpm'](_0x154257,_0x8198f1['NUKTh']);let _0x838033=[];try{_0x838033=await _0x8198f1[_0x1db2f6(0x259)](_0x36a3c3,{'apiBase':_0x33f889});}catch(_0x41ee77){return _0x8198f1['HjZqm'](_0x131ec2,_0x1db2f6(0x1e0)+_0x41ee77['message']),0x1;}if(_0x8198f1[_0x1db2f6(0x18b)](0x0,_0x838033[_0x1db2f6(0x19a)]))return _0x16122d(_0x8198f1[_0x1db2f6(0x263)]),_0x8198f1[_0x1db2f6(0x18d)](_0xb27f4f,_0x8198f1[_0x1db2f6(0x1f4)]),_0x8198f1[_0x1db2f6(0x18d)](_0xb27f4f,_0x1db2f6(0x25f)+_0x33f889+_0x1db2f6(0x1a0)),0x0;_0x8198f1['Kidqw'](_0x59a1c7,_0x1db2f6(0x1d6)+_0x838033[_0x1db2f6(0x19a)]+'\x20个可用分组'),console['log'](),_0x8198f1[_0x1db2f6(0x18f)](_0x154257,_0x8198f1[_0x1db2f6(0x250)]);const _0x765333=Math[_0x1db2f6(0x24f)](0x4,..._0x838033['map'](_0x266ee5=>String(_0x266ee5['id']??'')[_0x1db2f6(0x19a)])),_0x4aca32=Math['max'](0x6,..._0x838033[_0x1db2f6(0x21e)](_0x59fd5c=>String(_0x59fd5c[_0x1db2f6(0x233)]??'')[_0x1db2f6(0x19a)])),_0x5b87c5='\x20\x20'+'ID'[_0x1db2f6(0x22c)](_0x765333)+'\x20\x20'+'名称'['padEnd'](_0x4aca32)+_0x1db2f6(0x1fb);return _0x8198f1[_0x1db2f6(0x24e)](_0x10fb6d,_0x2976ea[_0x1db2f6(0x262)][_0x1db2f6(0x17e)](_0x5b87c5)),_0x10fb6d(_0x2976ea[_0x1db2f6(0x23e)](_0x8198f1['MuQvV']('\x20\x20','─'[_0x1db2f6(0x248)](_0x8198f1['MuQvV'](_0x8198f1[_0x1db2f6(0x21b)](_0x765333,_0x4aca32),0xf))))),_0x838033[_0x1db2f6(0x1ce)]((_0x1486ce,_0x562694)=>{const _0x3a35c5=_0x1db2f6,_0x46829d=_0x8198f1[_0x3a35c5(0x18f)](String,_0x1486ce['id']??'')[_0x3a35c5(0x22c)](_0x765333),_0x497769=String(_0x1486ce['name']??'')[_0x3a35c5(0x22c)](_0x4aca32),_0x1f4b81='\x20\x20'+_0x2976ea['yellow'](_0x46829d)+'\x20\x20'+_0x2976ea[_0x3a35c5(0x17d)](_0x497769);_0x10fb6d(_0x1f4b81);}),console['log'](),_0x8198f1[_0x1db2f6(0x238)](_0xb27f4f,_0x8198f1['PhKVq']),_0x8198f1[_0x1db2f6(0x237)](_0x10fb6d,_0x8198f1[_0x1db2f6(0x1c1)]),_0x8198f1[_0x1db2f6(0x18a)](_0x10fb6d,_0x8198f1[_0x1db2f6(0x179)]),_0x8198f1[_0x1db2f6(0x18a)](_0xb27f4f,_0x1db2f6(0x1e5)),0x0;},'description':'查看可用分组(不改配置)'}};export const SUBCOMMAND_NAMES=new Set(Object[_0x541bdf(0x1cd)](SUBCOMMANDS));export{H as SUB_HELP};function _0x3845(_0x5ea60b,_0x4e3509){_0x5ea60b=_0x5ea60b-0x171;const _0x2af347=_0x2af3();let _0x384555=_0x2af347[_0x5ea60b];return _0x384555;}function _0x2af3(){const _0x40788b=['获取可用分组','WEROt','%userprofile%\x5c.codex','MwCTQ','copyFileSync','\x20\x20-\x20','set','bWsla','安全备份:','未发现\x202api.store\x20写入的配置文件(可能已\x20reset\x20或从未激活过)','145519ZMjbyc','getMonth','model:','已删除:','getDate','%userprofile%\x5c.claude\x5csettings.json','fARqZ','78QqfIRj','确认操作','keys','forEach','\x20个文件','replace','WZmss','PRjOa','安全备份当前文件','sort','已取消','查询到\x20','NRcds','\x20\x20✓\x20','【试运行模式\x20--dry-run】不会真实恢复文件','kjfyz','help','~/.codex','恢复官方默认(删\x202api.store\x20配置并从备份恢复)','已安全备份\x20','如需从备份恢复,请运行:npx\x20@2api-store/activate\x20restore','获取分组失败:','fckzF','model','提示:只有运行过\x20npx\x20@2api-store/activate\x20后才会产生备份文件','Claude\x20Code','(本命令仅展示分组,不修改\x20API\x20Key\x20或配置文件)','bgtsH','\x20个备份文件(reset\x20后将尝试恢复每个配置的最新备份)','uckDY','log','zWTcI','已恢复:','%userprofile%\x5c.codex\x5cconfig.toml','TdSQk','Lqhti','roojv','分组列表','WyYKI','💡\x20如需切换分组:','~/.codex/auth.json','iJWuT','scIyW','[试运行]\x20不真实恢复','扫描目录:','bboTZ','existsSync','.bak.reset.','\x20\x20说明','aDSrE','ywWvi','OfGhD','find','group','getFullYear','需要\x20node\x20>=\x2018,当前\x20','origPath','qoiOo','恢复失败\x20','sEOpK','EACCES','选择应用(回车=第一个)','删除失败\x20','116NhrkCO','XnhAe','tsKYS','安全备份失败\x20','ortof','HUnYn','get','找到\x20','reset\x20报告','~/.gemini','oLbHf','1592TeTHnW','25529NbNGjN','KOoLd','fLOAr','2cLnudH','ACTIVATE_API_BASE','MuQvV','wuhqx','zCxfY','map','110PxCRmq','https://2api.store','oMbyQ','发现\x20','\x20\x20\x20删除前会再备份一次(.bak.reset.<时间戳>),可手动恢复。','Gemini\x20CLI','从备份恢复配置','dryRun','下一步:如需重新激活,运行\x20npx\x20@2api-store/activate','USERPROFILE','删除\x202api.store\x20配置','efMyd','code','padEnd','选择恢复时间点(','KQdzq','tDkbQ','--api-base','npx\x20@2api-store/activate\x20refresh-groups\x20[options]\x0a\x0a','~/.claude/settings.json','name','split','apiBase','EROFS','Kidqw','wKdVG','utf8','basename','CoYNd','slice','rtlML','dim','SjgfL','toISOString','getMinutes','\x20←\x20','dir','选择时间点(回车=最新)','sk-…','xhVLV','并从最新备份恢复:','repeat','MuITC','keryX','--dry-run','HOME','rdLKh','vcQdX','max','OBwKP','共恢复\x20','XWovl','%userprofile%\x5c.claude','未找到任何备份文件(reset\x20后这些文件将直接删除,无备份可恢复)','ouOsG','未选择时间点','\x0a子命令:\x0a\x20\x20restore\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20从备份恢复(扫描\x20~/.codex\x20/\x20~/.claude\x20/\x20~/.gemini\x20下的\x20.bak.*\x20文件)\x0a\x20\x20reset\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20恢复官方默认(删\x202api.store\x20写入的配置,并从最新备份恢复)\x0a\x20\x20refresh-groups\x20\x20\x20刷新分组列表(只展示,不改\x20key/配置)\x0a\x0a所有子命令都支持\x20--api-base\x20<url>\x20覆盖端点,restore/reset\x20支持\x20--dry-run。\x0a','【试运行模式\x20--dry-run】不会真实删除/恢复文件','uSwHf','HxAnS','includes','mtime','JVesy','5823fevZlT','当前端点:','JuoBW','http','bold','zCEYY','HlWRm','supported','getSeconds','ASjzg','match','从最新备份恢复','Yvcvp','euokp','xEOwo','(请用\x20sudo\x20/\x20管理员\x20PowerShell\x20重跑)','unlinkSync','zEoyF','green','cyan','可能原因:服务端未配置分组\x20/\x20网络错误\x20/\x20端点错误','5284884WoJIjC','Wddzh','ocEKJ','无可恢复的备份','\x20→\x20','startsWith','\x20个备份文件','\x20个文件):','zoPjt','\x20\x20-\x20删除\x20','Wwdoo','JAhwJ','--help','EirbR','kKhag','DjmPB','已删除\x20','198451Eevwat','dummy','push','\x20文件:','\x20个\x202api.store\x20配置文件','hZYNa','version','TcXxp','DFnyz','length','values','未选择应用','定位\x202api.store\x20写入的配置','未找到任何备份文件(.bak.*)','5988QEGvyv','(可通过\x20--api-base\x20或\x20ACTIVATE_API_BASE\x20覆盖)','RGTfb','filter','~/.claude','isWindows','UIQKt','yellow','\x20个备份)','(文件已删除,未恢复)','message','957115didKRz','hEQUi','gRVps','node','env','relative','%userprofile%\x5c.gemini\x5csettings.json','bakPath','RQcdh','将执行:','~/.codex/config.toml','join','HEkMd','bFMsj','key:…','\x20\x20•\x20已有\x20API\x20Key\x20绑组:登录管理后台修改,或重新激活(npx\x20@2api-store/activate)'];_0x2af3=function(){return _0x40788b;};return _0x2af3();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0xff2fb7=_0x4ed2;(function(_0x5bf23d,_0x5748ed){const _0x483c84=_0x4ed2,_0x30e975=_0x5bf23d();while(!![]){try{const _0x36cd71=parseInt(_0x483c84(0x1c5))/0x1*(parseInt(_0x483c84(0x1a2))/0x2)+-parseInt(_0x483c84(0x1a4))/0x3+-parseInt(_0x483c84(0x1cf))/0x4*(-parseInt(_0x483c84(0x1cc))/0x5)+-parseInt(_0x483c84(0x1aa))/0x6+-parseInt(_0x483c84(0x1ba))/0x7*(parseInt(_0x483c84(0x19e))/0x8)+parseInt(_0x483c84(0x1c6))/0x9+parseInt(_0x483c84(0x19f))/0xa;if(_0x36cd71===_0x5748ed)break;else _0x30e975['push'](_0x30e975['shift']());}catch(_0x52f8c1){_0x30e975['push'](_0x30e975['shift']());}}}(_0x4df7,0xc4c4a));import{spawnSync as _0x1239f7}from'node:child_process';export function detectOS(){const _0x16699b=_0x4ed2,_0x353d75={'TTuMU':function(_0x49abfb,_0x515c42){return _0x49abfb===_0x515c42;},'dFMWS':_0x16699b(0x1bd),'xmIxI':'windows','JvbBQ':_0x16699b(0x1a0)},_0x147720=process[_0x16699b(0x1a5)],_0x59dfc0=_0x353d75['TTuMU'](_0x353d75[_0x16699b(0x1ce)],_0x147720);return{'platform':_0x147720,'isWindows':_0x59dfc0,'isMac':_0x16699b(0x1cd)===_0x147720,'isLinux':_0x353d75[_0x16699b(0x1b8)](_0x16699b(0x1d0),_0x147720),'osType':_0x59dfc0?_0x353d75[_0x16699b(0x1bc)]:_0x353d75[_0x16699b(0x1ae)]};}function _0x4ed2(_0x3a777f,_0x53d86a){_0x3a777f=_0x3a777f-0x19e;const _0x4df783=_0x4df7();let _0x4ed2fc=_0x4df783[_0x3a777f];return _0x4ed2fc;}export function detectNode(){const _0xa2d6ef=_0x4ed2,_0x5dce8d={'TyYbo':function(_0x130619,_0x5af827){return _0x130619>=_0x5af827;}},_0x224695=process[_0xa2d6ef(0x1a6)]['node'],_0xd75b92=parseInt(_0x224695['split']('.')[0x0],0xa);return{'version':_0x224695,'major':_0xd75b92,'supported':_0x5dce8d[_0xa2d6ef(0x1ac)](_0xd75b92,0x12)};}function _0x4df7(){const _0xc5ed48=['unix','grok','6XbfVAW','ASKEG','3174705PFbSoh','platform','versions','IUSiN','claude','gemini','9378240ENdDtg','QMlmR','TyYbo','nNZGo','JvbBQ','EzgaN','pipe','env','stdout','codex','XnqlW','where','qmPnY','mxzWU','TTuMU','match','4263RDNSib','split','xmIxI','win32','ignore','trim','isWindows','slice','ObIAf','rKUqF','opencode','339162FmbIed','5815638izxPmc','OEQos','--version','OpEEw','FaEyF','COMSPEC','1725nabCbQ','darwin','dFMWS','6136tkpCra','linux','cmd.exe','12728PmKRCN','22032580moVSOw'];_0x4df7=function(){return _0xc5ed48;};return _0x4df7();}const e=[_0xff2fb7(0x1b3),_0xff2fb7(0x1a8),_0xff2fb7(0x1a9),_0xff2fb7(0x1a1),_0xff2fb7(0x1c4)];function n(_0x5d5400,_0x4c5c7f){const _0xbada71=_0xff2fb7,_0x287638={'yPiFm':'which','nNZGo':function(_0x3f9d53,_0x3caf47,_0x4a2c21,_0x1fddb1){return _0x3f9d53(_0x3caf47,_0x4a2c21,_0x1fddb1);},'ASKEG':'utf8','QMlmR':_0xbada71(0x1b0),'qmPnY':_0xbada71(0x1be)},_0x272631=_0x4c5c7f?_0xbada71(0x1b5):_0x287638['yPiFm'];try{const _0x11b685=_0x287638[_0xbada71(0x1ad)](_0x1239f7,_0x272631,[_0x5d5400],{'encoding':_0x287638[_0xbada71(0x1a3)],'stdio':[_0xbada71(0x1be),_0x287638[_0xbada71(0x1ab)],_0x287638[_0xbada71(0x1b6)]],'timeout':0xbb8});if(0x0===_0x11b685['status']&&_0x11b685[_0xbada71(0x1b2)])return _0x11b685['stdout'][_0xbada71(0x1bf)]()[_0xbada71(0x1bb)](/\r?\n/)[0x0]||null;}catch{}return null;}function o(_0x29fa29,_0x134381){const _0x1085af=_0xff2fb7,_0x14100f={'mxzWU':_0x1085af(0x1c8),'VCxAi':'utf8','EzgaN':_0x1085af(0x1b0)};try{const _0xe45b41=_0x134381?process[_0x1085af(0x1b1)][_0x1085af(0x1cb)]||_0x1085af(0x1d1):_0x29fa29,_0x39db13=_0x1239f7(_0xe45b41,_0x134381?['/c',_0x29fa29,_0x14100f['mxzWU']]:[_0x14100f[_0x1085af(0x1b7)]],{'encoding':_0x14100f['VCxAi'],'stdio':['ignore',_0x1085af(0x1b0),_0x14100f[_0x1085af(0x1af)]],'timeout':0x1388});if(0x0===_0x39db13['status']&&_0x39db13['stdout']){const _0x355fbf=_0x39db13[_0x1085af(0x1b2)][_0x1085af(0x1bf)]()[_0x1085af(0x1bb)](/\r?\n/)[0x0],_0x5557a5=_0x355fbf[_0x1085af(0x1b9)](/(\d+\.\d+(?:\.\d+)?(?:[-.\w]*)?)/);return _0x5557a5?_0x5557a5[0x1]:_0x355fbf[_0x1085af(0x1c1)](0x0,0x28);}}catch{}return null;}export function detectInstalled(_0x271771){const _0x2a55ec=_0xff2fb7,_0x44b6cc={'XnqlW':function(_0x1d0aa1){return _0x1d0aa1();},'ObIAf':function(_0x4b2872,_0x34c350,_0x46c2fa){return _0x4b2872(_0x34c350,_0x46c2fa);},'FaEyF':function(_0x29aaac,_0x15b29f,_0x1bacff){return _0x29aaac(_0x15b29f,_0x1bacff);}},_0x5231eb=_0x44b6cc[_0x2a55ec(0x1b4)](detectOS),_0x380822=_0x44b6cc[_0x2a55ec(0x1c2)](n,_0x271771,_0x5231eb['isWindows']);if(!_0x380822)return{'installed':!0x1,'path':null,'version':null};return{'installed':!0x0,'path':_0x380822,'version':_0x44b6cc[_0x2a55ec(0x1ca)](o,_0x271771,_0x5231eb[_0x2a55ec(0x1c0)])};}export function detectInstalledCLIs(_0x378b8f){const _0x3a7ce1=_0xff2fb7,_0x229786={'IUSiN':function(_0x5413e4,_0x358a84,_0x58e983){return _0x5413e4(_0x358a84,_0x58e983);}},_0x1ab84e={};for(const _0x2354b7 of e){const _0x4b19cf=_0x229786[_0x3a7ce1(0x1a7)](n,_0x2354b7,_0x378b8f);_0x4b19cf&&(_0x1ab84e[_0x2354b7]={'path':_0x4b19cf,'version':_0x229786[_0x3a7ce1(0x1a7)](o,_0x2354b7,_0x378b8f)});}return _0x1ab84e;}export function detectAll(){const _0x49c520=_0xff2fb7,_0x2ce4b8={'rKUqF':function(_0x1b97cd){return _0x1b97cd();},'OEQos':function(_0x3a72b1){return _0x3a72b1();},'OpEEw':function(_0x146b87,_0x50038a){return _0x146b87(_0x50038a);}},_0x15b7c8=_0x2ce4b8[_0x49c520(0x1c3)](detectOS);return{'os':_0x15b7c8,'node':_0x2ce4b8[_0x49c520(0x1c7)](detectNode),'installed':_0x2ce4b8[_0x49c520(0x1c9)](detectInstalledCLIs,_0x15b7c8[_0x49c520(0x1c0)])};}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x4dcb(_0x45dd26,_0x4e3f14){_0x45dd26=_0x45dd26-0x12d;const _0x3bd9fc=_0x3bd9();let _0x4dcbed=_0x3bd9fc[_0x45dd26];return _0x4dcbed;}const _0x2f0e01=_0x4dcb;(function(_0x187127,_0x43f32a){const _0x4faf72=_0x4dcb,_0x30f5f3=_0x187127();while(!![]){try{const _0x3904ec=parseInt(_0x4faf72(0x137))/0x1+parseInt(_0x4faf72(0x148))/0x2+-parseInt(_0x4faf72(0x14b))/0x3+-parseInt(_0x4faf72(0x131))/0x4*(-parseInt(_0x4faf72(0x139))/0x5)+-parseInt(_0x4faf72(0x142))/0x6*(-parseInt(_0x4faf72(0x155))/0x7)+-parseInt(_0x4faf72(0x12d))/0x8+-parseInt(_0x4faf72(0x13d))/0x9*(parseInt(_0x4faf72(0x134))/0xa);if(_0x3904ec===_0x43f32a)break;else _0x30f5f3['push'](_0x30f5f3['shift']());}catch(_0x184d07){_0x30f5f3['push'](_0x30f5f3['shift']());}}}(_0x3bd9,0xb7216));import _0x15df00 from'node:crypto';function _0x3bd9(){const _0xc8d6a2=['createHmac','2820040MzJTWw','device-id','writeFileSync','1469864vrdRBu','mkdirSync','4415YJNBNE','GuZJh','readFileSync','exec','81KgLWMS','.2api','homedir','hgtkp','test','30cbyNPL','asJdV','hex','/var/lib/dbus/machine-id','2api-store-activate','sha256','1573438hGRxrO','VRXqc','toLowerCase','2640195MywlKT','trim','darwin','platform','WwAjh','WAQGH','ZdOWW','toString','utf8','win32','1370551EMEtAo','2929904kMRzBF','egbNR','randomBytes','digest','5884KgPZxH','RLMdJ'];_0x3bd9=function(){return _0xc8d6a2;};return _0x3bd9();}import _0x145c20 from'node:fs';import _0x424f08 from'node:path';import _0x460a95 from'node:os';import{execSync as _0x4cb4f0}from'node:child_process';const c=_0x424f08['join'](_0x460a95[_0x2f0e01(0x13f)](),_0x2f0e01(0x13e)),n=_0x424f08['join'](c,_0x2f0e01(0x135)),a=/^[0-9a-f]{64}$/;function s(){const _0x40cf34=_0x2f0e01,_0x2ef946={'RLMdJ':function(_0xf54ea1,_0x3f7785,_0x1266aa){return _0xf54ea1(_0x3f7785,_0x1266aa);},'WAQGH':'ioreg\x20-rd1\x20-c\x20IOPlatformExpertDevice','HqvEr':'linux','VRXqc':'/etc/machine-id','ZdOWW':_0x40cf34(0x145),'WwAjh':_0x40cf34(0x153),'GuZJh':_0x40cf34(0x154),'asJdV':_0x40cf34(0x147),'hgtkp':_0x40cf34(0x146),'UMmwl':_0x40cf34(0x144)},_0x9fe854=(function(){const _0x58d291=_0x40cf34;try{switch(process[_0x58d291(0x14e)]){case _0x58d291(0x14d):{const _0xeaac04=_0x2ef946[_0x58d291(0x132)](_0x4cb4f0,_0x2ef946[_0x58d291(0x150)],{'encoding':_0x58d291(0x153)}),_0x3bbd61=/IOPlatformUUID"\s*=\s*"([^"]+)"/[_0x58d291(0x13c)](_0xeaac04);if(_0x3bbd61&&_0x3bbd61[0x1])return _0x3bbd61[0x1][_0x58d291(0x14c)]();break;}case _0x2ef946['HqvEr']:for(const _0x5505da of[_0x2ef946[_0x58d291(0x149)],_0x2ef946[_0x58d291(0x151)]])try{const _0x204291=_0x145c20[_0x58d291(0x13b)](_0x5505da,_0x2ef946[_0x58d291(0x14f)])[_0x58d291(0x14c)]();if(_0x204291)return _0x204291;}catch{}break;case _0x2ef946[_0x58d291(0x13a)]:{const _0x58ffb4=_0x4cb4f0('reg\x20query\x20HKLM\x5cSOFTWARE\x5cMicrosoft\x5cCryptography\x20/v\x20MachineGuid',{'encoding':_0x2ef946[_0x58d291(0x14f)]}),_0x2accfe=/MachineGuid\s+REG_SZ\s+([0-9a-fA-F-]+)/[_0x58d291(0x13c)](_0x58ffb4);if(_0x2accfe&&_0x2accfe[0x1])return _0x2accfe[0x1][_0x58d291(0x14c)]()[_0x58d291(0x14a)]();break;}}}catch{}return _0x15df00[_0x58d291(0x12f)](0x20)[_0x58d291(0x152)](_0x58d291(0x144));}());return _0x15df00[_0x40cf34(0x133)](_0x2ef946[_0x40cf34(0x143)],_0x2ef946[_0x40cf34(0x140)])['update'](_0x9fe854)[_0x40cf34(0x130)](_0x2ef946['UMmwl']);}export function getDeviceId(){const _0x5816d6=_0x2f0e01,_0x52b91d={'egbNR':_0x5816d6(0x153),'Vhbfs':function(_0x4cbbd9){return _0x4cbbd9();}};try{const _0x893bb3=_0x145c20[_0x5816d6(0x13b)](n,_0x52b91d[_0x5816d6(0x12e)])[_0x5816d6(0x14c)]();if(a[_0x5816d6(0x141)](_0x893bb3))return _0x893bb3;}catch{}const _0x552cb6=_0x52b91d['Vhbfs'](s);try{_0x145c20[_0x5816d6(0x138)](c,{'recursive':!0x0,'mode':0x1c0}),_0x145c20[_0x5816d6(0x136)](n,_0x552cb6,{'encoding':_0x52b91d['egbNR'],'mode':0x180});}catch{}return _0x552cb6;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function _0x1687(_0xb80688,_0x4d8dcd){_0xb80688=_0xb80688-0xe8;const _0x1d57da=_0x1d57();let _0x168727=_0x1d57da[_0xb80688];return _0x168727;}function _0x1d57(){const _0x2e8dd3=['),是否现在安装?\x0a\x20\x20运行:','711543XIzzxG','BIpYo','128959spNhcA','qCEel','DTGop','10ZFgjah','version','1565990qrMlUe','HtJfo','uSzmX','user-declined','no-install-package','win32','split','name','npm\x20install\x20-g\x20','QqMUp','install','YcBpR','\x20\x20正在执行:','360gGQuwb','273vjqyms','BIpIo','npm\x20exit\x20','ZVPdx','log','platform','dryRun','status','131592pbuOzg','3571908PPJFRe','未检测到\x20','no-meta','pop','installPackage','\x20\x20[试运行]\x20将运行:','npm','detectBin','(命令\x20','message','COMSPEC','2987640yRxAQa','HBNbJ','installCmd','dry-run','JyESe','174645WRzsnE','(不真实安装)','error'];_0x1d57=function(){return _0x2e8dd3;};return _0x1d57();}(function(_0xd47eef,_0x5b1638){const _0x3aafa0=_0x1687,_0x47e2bd=_0xd47eef();while(!![]){try{const _0x1943b6=-parseInt(_0x3aafa0(0xf1))/0x1*(-parseInt(_0x3aafa0(0xf4))/0x2)+parseInt(_0x3aafa0(0xef))/0x3+-parseInt(_0x3aafa0(0x118))/0x4+-parseInt(_0x3aafa0(0xf6))/0x5+parseInt(_0x3aafa0(0x10d))/0x6+-parseInt(_0x3aafa0(0x104))/0x7*(parseInt(_0x3aafa0(0x10c))/0x8)+parseInt(_0x3aafa0(0xeb))/0x9*(parseInt(_0x3aafa0(0x103))/0xa);if(_0x1943b6===_0x5b1638)break;else _0x47e2bd['push'](_0x47e2bd['shift']());}catch(_0x2dc7f6){_0x47e2bd['push'](_0x47e2bd['shift']());}}}(_0x1d57,0x73c8f));import{spawnSync as _0x4194a8}from'node:child_process';import{detectInstalled as _0x13b4c4}from'./detect.mjs';import{confirm as _0x22c883}from'./prompt.mjs';export function installCLI(_0x2725ee,_0x37dae8={}){const _0x56b82e=_0x1687,_0x29c419={'UFFHZ':_0x56b82e(0xfa),'qCEel':_0x56b82e(0xe9),'YcBpR':function(_0x5680f2,_0x40cae4){return _0x5680f2===_0x40cae4;},'HtJfo':_0x56b82e(0xfb),'ZVPdx':'cmd.exe','uSzmX':'npm','QqMUp':_0x56b82e(0x100),'BIpYo':'inherit'};if(!_0x2725ee||!_0x2725ee[_0x56b82e(0x111)])return{'ok':!0x1,'skipped':!0x0,'reason':_0x29c419['UFFHZ']};const _0x8976dd=_0x2725ee[_0x56b82e(0x111)],_0x4d2938='npm\x20install\x20-g\x20'+_0x8976dd;if(_0x37dae8[_0x56b82e(0x10a)])return console[_0x56b82e(0x108)](_0x56b82e(0x112)+_0x4d2938+_0x56b82e(0xec)),{'ok':!0x0,'skipped':!0x0,'reason':_0x29c419[_0x56b82e(0xf2)]};console[_0x56b82e(0x108)](_0x56b82e(0x102)+_0x4d2938+'…');try{const _0x5a40db=_0x29c419[_0x56b82e(0x101)](_0x29c419[_0x56b82e(0xf7)],process[_0x56b82e(0x109)]),_0x35c58f=_0x5a40db?process['env'][_0x56b82e(0x117)]||_0x29c419[_0x56b82e(0x107)]:_0x56b82e(0x113),_0x5c27ea=_0x4194a8(_0x35c58f,_0x5a40db?['/c',_0x29c419[_0x56b82e(0xf8)],_0x29c419[_0x56b82e(0xff)],'-g',_0x8976dd]:[_0x56b82e(0x100),'-g',_0x8976dd],{'stdio':_0x29c419[_0x56b82e(0xf0)]});return _0x5c27ea[_0x56b82e(0xed)]?{'ok':!0x1,'error':_0x5c27ea[_0x56b82e(0xed)]['message']}:0x0===_0x5c27ea[_0x56b82e(0x10b)]?{'ok':!0x0}:{'ok':!0x1,'error':_0x56b82e(0x106)+_0x5c27ea[_0x56b82e(0x10b)]};}catch(_0x56653d){return{'ok':!0x1,'error':_0x56653d[_0x56b82e(0x116)]};}}export async function ensureInstalled(_0x1b6d0e,_0x374ec3={}){const _0x411770=_0x1687,_0x3d6e2c={'DTGop':function(_0x294688,_0x1f2f56){return _0x294688(_0x1f2f56);},'JyESe':function(_0x2c8a62,_0x33cb3d,_0x2b1077){return _0x2c8a62(_0x33cb3d,_0x2b1077);},'BIpIo':_0x411770(0xe9),'HBNbJ':function(_0x3938de,_0x578fb3){return _0x3938de===_0x578fb3;},'jRNem':_0x411770(0xf9),'MRljg':function(_0x1e8c15,_0x1aa1fe){return _0x1e8c15(_0x1aa1fe);}};if(!_0x1b6d0e||!_0x1b6d0e[_0x411770(0x111)])return{'installed':!0x1,'skipped':!0x0,'reason':_0x411770(0x10f)};const _0x96f042=_0x1b6d0e[_0x411770(0x114)]||_0x1b6d0e[_0x411770(0x111)][_0x411770(0xfc)]('/')[_0x411770(0x110)](),_0x191b04=_0x3d6e2c[_0x411770(0xf3)](_0x13b4c4,_0x96f042);if(_0x191b04['installed'])return{'installed':!0x0,'version':_0x191b04[_0x411770(0xf5)]};const {dryRun:_0x5a1682,autoInstall:_0x54162c}=_0x374ec3;if(_0x5a1682)return{'installed':!0x1,'skipped':!0x0,'reason':_0x3d6e2c[_0x411770(0xea)](installCLI,_0x1b6d0e,{'dryRun':!0x0})['reason']||_0x3d6e2c[_0x411770(0x105)]};let _0x54373d=_0x3d6e2c[_0x411770(0x119)](!0x0,_0x54162c);if(_0x54373d||(_0x54373d=await _0x22c883(_0x411770(0x10e)+(_0x1b6d0e[_0x411770(0xfd)]||_0x96f042)+_0x411770(0x115)+_0x96f042+_0x411770(0xee)+(_0x1b6d0e[_0x411770(0xe8)]||_0x411770(0xfe)+_0x1b6d0e[_0x411770(0x111)]),{'defaultValue':!0x0})),!_0x54373d)return{'installed':!0x1,'skipped':!0x0,'reason':_0x3d6e2c['jRNem']};const _0x297c66=installCLI(_0x1b6d0e,{'dryRun':!0x1});if(_0x297c66['ok']){const _0x332c27=_0x3d6e2c['MRljg'](_0x13b4c4,_0x96f042);return{'installed':_0x332c27['installed'],'version':_0x332c27['version'],'justInstalled':!0x0};}return{'installed':!0x1,'error':_0x297c66[_0x411770(0xed)]};}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x7850e9=_0x439b;(function(_0x3f5dc1,_0x526d5f){const _0x16bc92=_0x439b,_0x4ae919=_0x3f5dc1();while(!![]){try{const _0x10fcc9=parseInt(_0x16bc92(0xc6))/0x1+parseInt(_0x16bc92(0xe1))/0x2*(-parseInt(_0x16bc92(0xbc))/0x3)+parseInt(_0x16bc92(0xdf))/0x4*(-parseInt(_0x16bc92(0xd0))/0x5)+parseInt(_0x16bc92(0xda))/0x6*(parseInt(_0x16bc92(0xe4))/0x7)+parseInt(_0x16bc92(0xb7))/0x8+parseInt(_0x16bc92(0xca))/0x9+-parseInt(_0x16bc92(0xd5))/0xa*(-parseInt(_0x16bc92(0xe5))/0xb);if(_0x10fcc9===_0x526d5f)break;else _0x4ae919['push'](_0x4ae919['shift']());}catch(_0xefdabb){_0x4ae919['push'](_0x4ae919['shift']());}}}(_0x4d7e,0xd9e2f));function _0x4d7e(){const _0x16e8e6=['常用命令:','\x20\x20claude\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20交互模式','\x20\x20codex\x20--sandbox\x20read-only\x20--ask-for-approval\x20never\x20只读(最安全)','npm\x20install\x20-g\x20@openai/codex','~/.claude/','Codex\x20CLI\x20(WebSocket)','\x20\x20claude\x20-p\x20\x22问题\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20非交互模式(输出后退出,适合脚本)','891789DlYcso','权限模式(WebSocket\x20模式由服务端配置激活,默认每步确认):','gemini','\x20\x20claude\x20--model\x20sonnet\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20指定模型(sonnet/opus/haiku/fable)','2301885paxHmA','Gemini\x20CLI','opencode.json','~/.codex/config.toml','项目根放\x20CLAUDE.md\x20让\x20Claude\x20了解你的代码库','~/.claude.json','20450syJbgA','opencode-ai','~/.config/opencode/opencode.json','opencode','运行\x20`gemini`\x20开始;`gemini\x20--help`\x20查看选项;在项目根放\x20GEMINI.md\x20让\x20Gemini\x20了解你的代码库','23510wgPdKc','@openai/codex','Claude\x20Code','\x20\x20codex\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20查看所有选项','\x20\x20claude\x20--dangerously-skip-permissions\x20\x20\x20\x20\x20\x20\x20\x20跳过所有权限提示(=bypassPermissions,谨慎用)','9168RjhsPB','权限模式(默认每步确认):','npm\x20install\x20-g\x20opencode-ai','@google/gemini-cli','\x20\x20claude\x20\x22你的问题\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20带初始问题启动','1724mfSQrY','运行\x20`opencode`\x20开始;`opencode\x20--help`\x20查看选项;在项目根放\x20AGENTS.md\x20让\x20OpenCode\x20了解你的代码库','4ExEdrB','claude','npm\x20install\x20-g\x20@anthropic-ai/claude-code','791XrHYlw','6611IypTYJ','\x20\x20claude\x20-r\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20恢复历史会话(选择器)','join','~/.gemini/settings.json','@anthropic-ai/claude-code','\x20\x20codex\x20--yolo\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20全跳过(无\x20sandbox\x20无\x20approval,仅信任仓库)','\x20\x20claude\x20mcp\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20管理\x20MCP\x20服务器','OpenCode','codex','2314544BpKQKS','\x20\x20codex\x20--full-auto\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20全自动(sandbox\x20内自动批准,推荐)','权限模式(Shift+Tab\x20切换):default\x20/\x20acceptEdits\x20/\x20plan\x20/\x20auto\x20/\x20bypassPermissions','项目根放\x20AGENTS.md\x20让\x20Codex\x20了解你的代码库','~/.codex/auth.json','550851rULbpV','\x20\x20claude\x20-c\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20继续最近会话','Codex\x20CLI'];_0x4d7e=function(){return _0x16e8e6;};return _0x4d7e();}function _0x439b(_0x27b301,_0x112e02){_0x27b301=_0x27b301-0xb7;const _0x4d7ed9=_0x4d7e();let _0x439b00=_0x4d7ed9[_0x27b301];return _0x439b00;}export const CLI_META={'codex':{'name':_0x7850e9(0xbe),'installPackage':_0x7850e9(0xd6),'installCmd':_0x7850e9(0xc2),'startCmd':_0x7850e9(0xed),'detectBin':_0x7850e9(0xed),'configFiles':[_0x7850e9(0xcd),_0x7850e9(0xbb)],'usage':[_0x7850e9(0xdb),_0x7850e9(0xb8),_0x7850e9(0xea),_0x7850e9(0xc1),_0x7850e9(0xd8),_0x7850e9(0xba)][_0x7850e9(0xe7)]('\x0a'),'isPrimary':!0x0},'codex-ws':{'name':_0x7850e9(0xc4),'installPackage':_0x7850e9(0xd6),'installCmd':'npm\x20install\x20-g\x20@openai/codex','startCmd':_0x7850e9(0xed),'detectBin':_0x7850e9(0xed),'configFiles':['~/.codex/config.toml',_0x7850e9(0xbb)],'usage':[_0x7850e9(0xc7),_0x7850e9(0xb8),_0x7850e9(0xea),'\x20\x20codex\x20--sandbox\x20read-only\x20--ask-for-approval\x20never\x20只读(最安全)',_0x7850e9(0xd8)]['join']('\x0a'),'isPrimary':!0x1},'claude':{'name':_0x7850e9(0xd7),'installPackage':_0x7850e9(0xe9),'installCmd':_0x7850e9(0xe3),'startCmd':'claude','detectBin':_0x7850e9(0xe2),'configFiles':[_0x7850e9(0xc3),_0x7850e9(0xcf)],'usage':[_0x7850e9(0xbf),_0x7850e9(0xc0),_0x7850e9(0xde),_0x7850e9(0xc5),_0x7850e9(0xbd),_0x7850e9(0xe6),_0x7850e9(0xc9),_0x7850e9(0xeb),'\x20\x20claude\x20doctor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20诊断安装/配置','\x20\x20claude\x20update\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20更新到最新版',_0x7850e9(0xb9),_0x7850e9(0xd9),_0x7850e9(0xce)][_0x7850e9(0xe7)]('\x0a'),'isPrimary':!0x0},'gemini-cli':{'name':_0x7850e9(0xcb),'installPackage':_0x7850e9(0xdd),'installCmd':'npm\x20install\x20-g\x20@google/gemini-cli','startCmd':_0x7850e9(0xc8),'detectBin':_0x7850e9(0xc8),'configFiles':[_0x7850e9(0xe8)],'usage':_0x7850e9(0xd4),'isPrimary':!0x0},'opencode':{'name':_0x7850e9(0xec),'installPackage':_0x7850e9(0xd1),'installCmd':_0x7850e9(0xdc),'startCmd':_0x7850e9(0xd3),'detectBin':_0x7850e9(0xd3),'configFiles':[_0x7850e9(0xd2),_0x7850e9(0xcc)],'usage':_0x7850e9(0xe0),'isPrimary':!0x1}};export function getCliMeta(_0x55b161){return CLI_META[_0x55b161]||null;}export function isDefaultSelected(_0x482a6c){const _0x557263=CLI_META[_0x482a6c];return!_0x557263||_0x557263['isPrimary'];}
|
package/dist/lib/pow.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x5adbf4,_0x58e1fb){const _0x5c6282=_0x3ed5,_0x2b913c=_0x5adbf4();while(!![]){try{const _0x392681=-parseInt(_0x5c6282(0x139))/0x1*(-parseInt(_0x5c6282(0x13b))/0x2)+-parseInt(_0x5c6282(0x14f))/0x3*(-parseInt(_0x5c6282(0x156))/0x4)+parseInt(_0x5c6282(0x136))/0x5+parseInt(_0x5c6282(0x122))/0x6+-parseInt(_0x5c6282(0x14c))/0x7+parseInt(_0x5c6282(0x121))/0x8*(-parseInt(_0x5c6282(0x13d))/0x9)+-parseInt(_0x5c6282(0x147))/0xa;if(_0x392681===_0x58e1fb)break;else _0x2b913c['push'](_0x2b913c['shift']());}catch(_0x36cf34){_0x2b913c['push'](_0x2b913c['shift']());}}}(_0x1066,0x5ff70));function _0x1066(){const _0x7186e6=['push','concat','无效的\x20apiBase:','PoW\x20challenge\x20响应非\x20JSON(HTTP\x20','utf8','swIzU','challenge','9211530kgVpSE','digest','parse','XWagC','ANBjC','1800610QVNqqm','dlXKY','hUPls','21429CBFhEy','PoW\x20challenge\x20请求超时(30s)—\x20','https:','qhkIh','wscII','SiraW','body','436SPvOAC','request','208GBjNQo','2939400zpiWYo','IadJw','TCHvd','error','end','GET','update','difficulty','application/json','kMKZI','toString','statusCode','createHash','hYpfg','eaSHP','object','data','message','expires_at','TJAcy','3537745WibNKm','XhHki','hex','101119IDcsWI','fduLE','2mTalTL','CtmxZ','175050rDZYif','iZZmJ','HTTP\x20'];_0x1066=function(){return _0x7186e6;};return _0x1066();}function _0x3ed5(_0x2b1fe8,_0x36acc8){_0x2b1fe8=_0x2b1fe8-0x120;const _0x1066db=_0x1066();let _0x3ed530=_0x1066db[_0x2b1fe8];return _0x3ed530;}import _0x2b5aef from'node:https';import _0x92a51f from'node:http';import _0x12db87 from'node:crypto';export function getChallenge({apiBase:_0x29e9c9,deviceId:_0x5a4d62}){const _0x4f1494=_0x3ed5,_0xb586f9={'ANBjC':_0x4f1494(0x144),'IadJw':function(_0x5151bd,_0x15c8d0){return _0x5151bd(_0x15c8d0);},'hUPls':function(_0x4323dd,_0x4253c2){return _0x4323dd>=_0x4253c2;},'LlOiA':function(_0x13524c,_0x462327){return _0x13524c==_0x462327;},'fduLE':_0x4f1494(0x131),'qhkIh':_0x4f1494(0x132),'sweWu':_0x4f1494(0x126),'XWagC':function(_0x2a35f8,_0x4fdbda){return _0x2a35f8===_0x4fdbda;},'TJAcy':_0x4f1494(0x151),'dlXKY':_0x4f1494(0x127),'iZZmJ':_0x4f1494(0x12a),'hYpfg':'timeout','xQwKB':_0x4f1494(0x125)};return new Promise((_0x1b7f37,_0x36ebd9)=>{const _0x16e972=_0x4f1494,_0x429a22={'CtmxZ':_0xb586f9[_0x16e972(0x14b)],'kMKZI':function(_0x2bcc84,_0x5ef42e){const _0x42bf45=_0x16e972;return _0xb586f9[_0x42bf45(0x123)](_0x2bcc84,_0x5ef42e);},'SiraW':function(_0x179d74,_0x1675d6){const _0x5656f9=_0x16e972;return _0xb586f9[_0x5656f9(0x14e)](_0x179d74,_0x1675d6);},'XhHki':function(_0x5f3ddc,_0x350fb4){return _0x5f3ddc<_0x350fb4;},'eaSHP':function(_0x1944db,_0x22217e){return _0xb586f9['LlOiA'](_0x1944db,_0x22217e);},'swIzU':_0xb586f9[_0x16e972(0x13a)],'wscII':_0xb586f9[_0x16e972(0x152)],'TRJmz':_0xb586f9['sweWu']};let _0x201630;try{_0x201630=new URL('/api/v1/cli/pow/challenge',_0x29e9c9);}catch(_0x293975){return void _0xb586f9[_0x16e972(0x123)](_0x36ebd9,new Error(_0x16e972(0x142)+_0x29e9c9+'('+_0x293975['message']+')'));}const _0x52d0eb=(_0xb586f9[_0x16e972(0x14a)](_0xb586f9[_0x16e972(0x135)],_0x201630['protocol'])?_0x2b5aef:_0x92a51f)[_0x16e972(0x120)](_0x201630,{'method':_0xb586f9[_0x16e972(0x14d)],'headers':{'X-Device-Id':_0x5a4d62,'Accept':_0xb586f9[_0x16e972(0x13e)]},'timeout':0x7530},_0x352b51=>{const _0xee5ef6=_0x16e972,_0x5aee69=[];_0x352b51['on'](_0x429a22[_0xee5ef6(0x153)],_0x5ed0d5=>_0x5aee69[_0xee5ef6(0x140)](_0x5ed0d5)),_0x352b51['on'](_0x429a22['TRJmz'],()=>{const _0x59dd70=_0xee5ef6,_0x37c85f=Buffer[_0x59dd70(0x141)](_0x5aee69)[_0x59dd70(0x12c)](_0x429a22[_0x59dd70(0x13c)]);let _0x74df47;try{_0x74df47=_0x37c85f?JSON[_0x59dd70(0x149)](_0x37c85f):{};}catch{const _0x5e5abd=new Error(_0x59dd70(0x143)+_0x352b51['statusCode']+'):'+_0x37c85f['slice'](0x0,0xc8));return _0x5e5abd[_0x59dd70(0x12d)]=_0x352b51['statusCode'],_0x5e5abd['raw']=_0x37c85f,void _0x429a22[_0x59dd70(0x12b)](_0x36ebd9,_0x5e5abd);}if(_0x429a22[_0x59dd70(0x154)](_0x352b51[_0x59dd70(0x12d)],0xc8)&&_0x429a22[_0x59dd70(0x137)](_0x352b51[_0x59dd70(0x12d)],0x12c))_0x429a22[_0x59dd70(0x12b)](_0x1b7f37,{'challenge':_0x74df47[_0x59dd70(0x146)],'difficulty':_0x74df47[_0x59dd70(0x129)],'expiresAt':_0x74df47[_0x59dd70(0x134)]||_0x74df47['expiresAt']});else{const _0x40ec93=_0x74df47?.[_0x59dd70(0x125)],_0x38c280=(_0x40ec93&&_0x429a22[_0x59dd70(0x130)](_0x429a22[_0x59dd70(0x145)],typeof _0x40ec93)?_0x40ec93[_0x59dd70(0x133)]:_0x40ec93)||_0x74df47?.[_0x59dd70(0x133)]||_0x59dd70(0x13f)+_0x352b51[_0x59dd70(0x12d)],_0x5eba29=new Error(_0x38c280);_0x5eba29[_0x59dd70(0x12d)]=_0x352b51[_0x59dd70(0x12d)],_0x5eba29[_0x59dd70(0x155)]=_0x74df47,_0x36ebd9(_0x5eba29);}});});_0x52d0eb['on'](_0xb586f9[_0x16e972(0x12f)],()=>{const _0x180091=_0x16e972;_0x52d0eb['destroy'](new Error(_0x180091(0x150)+_0x201630['href']));}),_0x52d0eb['on'](_0xb586f9['xQwKB'],_0x36ebd9),_0x52d0eb[_0x16e972(0x126)]();});}export function solvePoW(_0x4a5921,_0xc77c7b){const _0x5049e6=_0x3ed5,_0x1ee529={'MzxQm':'sha256','TCHvd':_0x5049e6(0x138)},_0xe640f6='0'['repeat'](_0xc77c7b);let _0x4164ce=0x0;for(;;){if(_0x12db87[_0x5049e6(0x12e)](_0x1ee529['MzxQm'])[_0x5049e6(0x128)](_0x4a5921+':'+_0x4164ce)[_0x5049e6(0x148)](_0x1ee529[_0x5049e6(0x124)])['startsWith'](_0xe640f6))return String(_0x4164ce);_0x4164ce++;}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x4d22a7,_0x34f17b){const _0x3641ba=_0x3e70,_0x257483=_0x4d22a7();while(!![]){try{const _0x2d025e=parseInt(_0x3641ba(0x184))/0x1+-parseInt(_0x3641ba(0x194))/0x2*(-parseInt(_0x3641ba(0x1a7))/0x3)+parseInt(_0x3641ba(0x1a0))/0x4+-parseInt(_0x3641ba(0x180))/0x5*(parseInt(_0x3641ba(0x1aa))/0x6)+parseInt(_0x3641ba(0x19d))/0x7+-parseInt(_0x3641ba(0x16f))/0x8*(-parseInt(_0x3641ba(0x191))/0x9)+parseInt(_0x3641ba(0x17b))/0xa*(-parseInt(_0x3641ba(0x1a1))/0xb);if(_0x2d025e===_0x34f17b)break;else _0x257483['push'](_0x257483['shift']());}catch(_0x348a2e){_0x257483['push'](_0x257483['shift']());}}}(_0x47b2,0x62c74));import _0x4b0b35 from'node:readline';function _0x3e70(_0x5dbcad,_0x18888c){_0x5dbcad=_0x5dbcad-0x167;const _0x47b2ce=_0x47b2();let _0x3e70a3=_0x47b2ce[_0x5dbcad];return _0x3e70a3;}function _0x47b2(){const _0x427ab2=['Y/n','krUTU','input','639140TTJoqd','pop','NgJpd','label','utf8','shift','stdout','BnHQc','TMrQe','destroyed','stdin','whJVV','CIgIb','36AkPBTu','checkbox','end','2EVIcZt','data','adUFI','\x20\x20(输入序号,逗号/空格分隔;回车=默认;a=全选;n=全不选)','ggYvp','HjOAv','includes','eTNut','toLowerCase','3757446lOMKGH','push','BWuTO','2187784nXLLyK','9871873vGyRTW','yes','RUuqQ','log','kqKQm','\x20(默认)','490596nNcxxo','FpZOi','password','444klOxvM','rkqrt','fBDnE','LxFvS','CiWlo','none','IqcxL','length','qRExV','mZNqt','jWgly','map','AudXL','mTepC','split','filter','close','@inquirer/prompts','menob','901304AgYmFy','forEach','VJzNf','选择序号','join','bivuv','pOBux','select','confirm','jAnvl','write','MARTc','20InyICb','trim','OHDCA','wKGEf','y/N','9295aYrdQX'];_0x47b2=function(){return _0x427ab2;};return _0x47b2();}let t=null;async function n(){const _0x563d88=_0x3e70,_0x17243d={'LxFvS':_0x563d88(0x16d)};return t||(t=await import(_0x17243d[_0x563d88(0x1ad)])),t;}let a=null,s=null,o=null;function r(){const _0x4c599f=_0x3e70,_0x2175be={'fcHdt':function(_0x1e1ede,_0x375a81){return _0x1e1ede===_0x375a81;}};return _0x2175be['fcHdt'](!0x0,process[_0x4c599f(0x18e)]['isTTY']);}export function closePrompt(){const _0x556606=_0x3e70;a&&!a['closed']&&a[_0x556606(0x16c)](),a=null;}export async function ask(_0xde627f,{defaultValue:_0x34c9cc}={}){const _0x1f533a=_0x3e70,_0x2ddc77={'jWgly':function(_0x1000e2,_0xa00a0a){return _0x1000e2>_0xa00a0a;},'rkqrt':function(_0x377a28,_0x54a044){return _0x377a28===_0x54a044;},'kUoLO':function(_0x31fc2b,_0x44b26a){return _0x31fc2b-_0x44b26a;},'IqcxL':_0x1f533a(0x188),'ggYvp':_0x1f533a(0x195),'CiWlo':_0x1f533a(0x193),'fBDnE':function(_0x28cce7){return _0x28cce7();},'RUuqQ':function(_0x4cc860){return _0x4cc860();},'CGjmx':function(_0x40d918,_0x38527c){return _0x40d918??_0x38527c;},'pOBux':function(_0x170144,_0x38cc2f){return _0x170144??_0x38cc2f;}},_0x5385d2=_0x34c9cc?'\x20['+_0x34c9cc+']':'';if(_0x2ddc77[_0x1f533a(0x1ac)](r)){const _0x135f33=await _0x2ddc77[_0x1f533a(0x1a3)](n);return await _0x135f33[_0x1f533a(0x183)]({'message':''+_0xde627f+_0x5385d2,'default':_0x34c9cc??''})||_0x2ddc77['CGjmx'](_0x34c9cc,'');}await(s||(s=[],o=new Promise(_0x5ee0d8=>{const _0x5bb994=_0x1f533a,_0x396556={'XPlUT':function(_0x5a4da4,_0x496125){const _0x721ab=_0x3e70;return _0x2ddc77[_0x721ab(0x1b4)](_0x5a4da4,_0x496125);},'menob':function(_0x3d9dd5,_0x15b6e3){const _0x411749=_0x3e70;return _0x2ddc77[_0x411749(0x1ab)](_0x3d9dd5,_0x15b6e3);},'BWuTO':function(_0x1526f1,_0x4a9601){return _0x2ddc77['kUoLO'](_0x1526f1,_0x4a9601);}};let _0x4ffd68='';process[_0x5bb994(0x18e)]['setEncoding'](_0x2ddc77[_0x5bb994(0x1b0)]),process[_0x5bb994(0x18e)]['on'](_0x2ddc77[_0x5bb994(0x198)],_0x40a5ab=>{_0x4ffd68+=_0x40a5ab;}),process[_0x5bb994(0x18e)]['on'](_0x2ddc77[_0x5bb994(0x1ae)],()=>{const _0x46e343=_0x5bb994,_0x34f216=_0x4ffd68[_0x46e343(0x16a)](/\r?\n/);_0x396556['XPlUT'](_0x34f216[_0x46e343(0x1b1)],0x0)&&_0x396556[_0x46e343(0x16e)]('',_0x34f216[_0x396556[_0x46e343(0x19f)](_0x34f216['length'],0x1)])&&_0x34f216[_0x46e343(0x185)](),s[_0x46e343(0x19e)](..._0x34f216),_0x5ee0d8();}),process[_0x5bb994(0x18e)][_0x5bb994(0x18d)]&&_0x5ee0d8();})),o);const _0x36f566=s[_0x1f533a(0x189)]()??'';return process[_0x1f533a(0x18a)][_0x1f533a(0x179)](''+_0xde627f+_0x5385d2+':\x20'+_0x36f566+'\x0a'),_0x36f566['trim']()||_0x2ddc77[_0x1f533a(0x175)](_0x34c9cc,'');}export async function askSecret(_0x4bce2c){const _0x5b0fa5=_0x3e70,_0x44f88f={'shalv':function(_0x30c354){return _0x30c354();}};if(r())return(await _0x44f88f['shalv'](n))[_0x5b0fa5(0x1a9)]({'message':_0x4bce2c,'mask':'*'});return ask(_0x4bce2c);}export async function multiSelect(_0x1d1ad9,_0x4b3aa8,{defaultSelected:_0x13d317=[]}={}){const _0x48587a=_0x3e70,_0x124570={'jAnvl':function(_0xde559e,_0x172df7){return _0xde559e+_0x172df7;},'VJzNf':function(_0x36f835,_0x4b7848){return _0x36f835===_0x4b7848;},'qRExV':function(_0x3cbb0c){return _0x3cbb0c();},'wKGEf':_0x48587a(0x197),'mTepC':function(_0x4416e3,_0x4d3eb7,_0x56b41a){return _0x4416e3(_0x4d3eb7,_0x56b41a);},'TMrQe':'all','CIgIb':_0x48587a(0x1af)};if(_0x124570[_0x48587a(0x171)](0x0,_0x4b3aa8[_0x48587a(0x1b1)]))return[];if(_0x124570[_0x48587a(0x1b2)](r)){const _0x5418e6=await _0x124570[_0x48587a(0x1b2)](n),_0x4dce31=_0x4b3aa8[_0x48587a(0x167)]((_0x2640bb,_0x48eae5)=>({'name':_0x2640bb['label'],'value':_0x48eae5,'checked':_0x13d317[_0x48587a(0x19a)](_0x48eae5)}));return await _0x5418e6[_0x48587a(0x192)]({'message':_0x1d1ad9,'choices':_0x4dce31,'loop':!0x1,'required':!0x1});}console['log'](_0x1d1ad9),_0x4b3aa8[_0x48587a(0x170)]((_0x37f18a,_0x231d9a)=>{const _0x36024f=_0x48587a,_0x8ff9eb=_0x13d317['includes'](_0x231d9a);console[_0x36024f(0x1a4)]('\x20\x20['+(_0x8ff9eb?'x':'\x20')+']\x20'+_0x124570[_0x36024f(0x178)](_0x231d9a,0x1)+'.\x20'+_0x37f18a['label']);}),console[_0x48587a(0x1a4)](_0x124570[_0x48587a(0x17e)]);const _0x20342a=_0x13d317[_0x48587a(0x167)](_0x20ba87=>_0x20ba87+0x1)[_0x48587a(0x173)](','),_0x495a33=await _0x124570[_0x48587a(0x169)](ask,'选择',{'defaultValue':_0x20342a}),_0x498f64=_0x495a33[_0x48587a(0x17c)]()[_0x48587a(0x19c)]();if('a'===_0x498f64||_0x124570[_0x48587a(0x18c)]===_0x498f64)return _0x4b3aa8['map']((_0x26fc2a,_0x29a0f0)=>_0x29a0f0);if(_0x124570[_0x48587a(0x171)]('n',_0x498f64)||_0x124570[_0x48587a(0x171)](_0x124570[_0x48587a(0x190)],_0x498f64))return[];const _0x268321=_0x495a33[_0x48587a(0x16a)](/[,\s]+/)[_0x48587a(0x167)](_0x9b6d69=>parseInt(_0x9b6d69,0xa))[_0x48587a(0x16b)](_0x5db6a4=>!isNaN(_0x5db6a4)&&_0x5db6a4>=0x1&&_0x5db6a4<=_0x4b3aa8['length'])[_0x48587a(0x167)](_0x2937b4=>_0x2937b4-0x1);return[...new Set(_0x268321)];}export async function select(_0x24de96,_0x32710c,{defaultIndex:_0x52bbeb=0x0}={}){const _0x271174=_0x3e70,_0x3ac4fc={'whJVV':function(_0x23a9fc,_0x32ad59){return _0x23a9fc===_0x32ad59;},'mZNqt':function(_0x4b5698,_0x20d68f){return _0x4b5698+_0x20d68f;},'eTNut':function(_0x4e6ce0,_0x5dcbb2){return _0x4e6ce0===_0x5dcbb2;},'krUTU':function(_0xe9911){return _0xe9911();},'MARTc':function(_0x802bf0,_0x12cbde,_0x4d2a60){return _0x802bf0(_0x12cbde,_0x4d2a60);},'FpZOi':_0x271174(0x172),'bivuv':function(_0x41bac8,_0x2147c6){return _0x41bac8(_0x2147c6);},'OHDCA':function(_0x7ec497,_0x54eaa8,_0x5804dd){return _0x7ec497(_0x54eaa8,_0x5804dd);},'kqKQm':function(_0x604c85,_0x18d4df){return _0x604c85<_0x18d4df;},'HjOAv':function(_0x21d628,_0x16363d){return _0x21d628-_0x16363d;}};if(_0x3ac4fc[_0x271174(0x18f)](0x0,_0x32710c[_0x271174(0x1b1)]))return-0x1;if(_0x3ac4fc[_0x271174(0x19b)](0x1,_0x32710c[_0x271174(0x1b1)]))return 0x0;if(_0x3ac4fc[_0x271174(0x182)](r)){const _0x299c98=await n(),_0x509a67=_0x32710c[_0x271174(0x167)]((_0x3afb9c,_0x400a96)=>({'name':_0x3afb9c[_0x271174(0x187)],'value':_0x400a96}));return _0x299c98[_0x271174(0x176)]({'message':_0x24de96,'choices':_0x509a67,'default':_0x52bbeb,'loop':!0x1});}console[_0x271174(0x1a4)](_0x24de96),_0x32710c[_0x271174(0x170)]((_0x616cf6,_0x2e6ad6)=>{const _0x345b6b=_0x271174,_0x38d6f4=_0x3ac4fc['whJVV'](_0x2e6ad6,_0x52bbeb)?_0x345b6b(0x1a6):'';console['log']('\x20\x20'+_0x3ac4fc[_0x345b6b(0x1b3)](_0x2e6ad6,0x1)+'.\x20'+_0x616cf6[_0x345b6b(0x187)]+_0x38d6f4);});const _0x609209=await _0x3ac4fc[_0x271174(0x17a)](ask,_0x3ac4fc[_0x271174(0x1a8)],{'defaultValue':_0x3ac4fc[_0x271174(0x174)](String,_0x3ac4fc[_0x271174(0x1b3)](_0x52bbeb,0x1))}),_0x482746=_0x3ac4fc[_0x271174(0x17d)](parseInt,_0x609209,0xa);return isNaN(_0x482746)||_0x3ac4fc[_0x271174(0x1a5)](_0x482746,0x1)||_0x482746>_0x32710c[_0x271174(0x1b1)]?_0x52bbeb:_0x3ac4fc[_0x271174(0x199)](_0x482746,0x1);}export async function confirm(_0x42349f,{defaultValue:_0x31555e=!0x0}={}){const _0x5a37fd=_0x3e70,_0x2ef406={'adUFI':function(_0x206cf0){return _0x206cf0();},'WBPTs':_0x5a37fd(0x181),'NgJpd':_0x5a37fd(0x17f),'BnHQc':function(_0x5588e7,_0x31bb31,_0x32bbac){return _0x5588e7(_0x31bb31,_0x32bbac);},'AudXL':function(_0x4048be,_0x3e7193){return _0x4048be===_0x3e7193;}};if(_0x2ef406[_0x5a37fd(0x196)](r))return(await n())[_0x5a37fd(0x177)]({'message':_0x42349f,'default':_0x31555e});const _0x3e4375=_0x31555e?_0x2ef406['WBPTs']:_0x2ef406[_0x5a37fd(0x186)],_0x6f74d9=(await _0x2ef406[_0x5a37fd(0x18b)](ask,_0x42349f+'\x20('+_0x3e4375+')',{'defaultValue':_0x31555e?'y':'n'}))[_0x5a37fd(0x17c)]()[_0x5a37fd(0x19c)]();return _0x6f74d9?_0x2ef406['AudXL']('y',_0x6f74d9)||_0x2ef406[_0x5a37fd(0x168)](_0x5a37fd(0x1a2),_0x6f74d9):_0x31555e;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x36a8c4=_0x3b47;function _0x3b47(_0x5dcb2a,_0x2ec31d){_0x5dcb2a=_0x5dcb2a-0x15a;const _0x1b11f3=_0x1b11();let _0x3b4735=_0x1b11f3[_0x5dcb2a];return _0x3b4735;}(function(_0x400497,_0x273d5a){const _0x213081=_0x3b47,_0x3f4bcc=_0x400497();while(!![]){try{const _0x2bbdf2=parseInt(_0x213081(0x16c))/0x1+-parseInt(_0x213081(0x15f))/0x2*(-parseInt(_0x213081(0x181))/0x3)+parseInt(_0x213081(0x176))/0x4*(-parseInt(_0x213081(0x17f))/0x5)+-parseInt(_0x213081(0x168))/0x6*(-parseInt(_0x213081(0x164))/0x7)+parseInt(_0x213081(0x162))/0x8*(parseInt(_0x213081(0x170))/0x9)+-parseInt(_0x213081(0x161))/0xa+parseInt(_0x213081(0x178))/0xb*(-parseInt(_0x213081(0x16d))/0xc);if(_0x2bbdf2===_0x273d5a)break;else _0x3f4bcc['push'](_0x3f4bcc['shift']());}catch(_0x47619c){_0x3f4bcc['push'](_0x3f4bcc['shift']());}}}(_0x1b11,0x34b2e));export const PLACEHOLDERS=[_0x36a8c4(0x171),_0x36a8c4(0x167),_0x36a8c4(0x177),'apiBaseBeta',_0x36a8c4(0x15c),_0x36a8c4(0x163),_0x36a8c4(0x165)];function _0x1b11(){const _0x3f05dd=['string','6EKjOMt','toLowerCase','HOME','antigravityApiBase','split','htPHw','83190knFxsg','tAcGx','602210sHqHam','8XmONOn','antigravityApiBaseBeta','791DDAOun','defaultModel','replace','baseUrl','11922ipIJRu','slice','Lqzwz','MHJAn','375831TdHeNr','12PBcCSU','length','name','1659312SLuBsb','apiKey','wPsbe','sort','AoFAe','pwKGe','16NplIDT','apiBase','6327299YbSJJN','map','env','MwcAs','join','localeCompare','USERPROFILE','20795jngIRa'];_0x1b11=function(){return _0x3f05dd;};return _0x1b11();}export function renderContent(_0x8b8e4e,_0x51d1f8){const _0x36061b=_0x36a8c4,_0x4b5fc5={'MHJAn':function(_0xb43aaf,_0x17d6fb){return _0xb43aaf(_0x17d6fb);}};if(!_0x8b8e4e)return'';let _0xf941ce=_0x8b8e4e;for(const _0x3a76e8 of PLACEHOLDERS){const _0x2e3336=_0x51d1f8[_0x3a76e8];null!=_0x2e3336&&(_0xf941ce=_0xf941ce[_0x36061b(0x15d)]('{{'+_0x3a76e8+'}}')[_0x36061b(0x17c)](_0x4b5fc5[_0x36061b(0x16b)](String,_0x2e3336)));}return _0xf941ce;}export function expandPath(_0x4724bd,{isWindows:_0xbc56a6}={}){const _0x5aaafe=_0x36a8c4,_0x244fa1={'MwcAs':function(_0x4f31aa,_0xffb991){return _0x4f31aa===_0xffb991;},'zIJHk':function(_0x45b289,_0x5c29ad){return _0x45b289+_0x5c29ad;}};if(!_0x4724bd)return _0x4724bd;if(_0xbc56a6){const _0x557823=process[_0x5aaafe(0x17a)][_0x5aaafe(0x17e)]||'';return _0x4724bd['replace'](/^%userprofile%/i,_0x557823)[_0x5aaafe(0x166)](/^~/,_0x557823);}const _0x776a=process[_0x5aaafe(0x17a)][_0x5aaafe(0x15b)]||'';return _0x244fa1[_0x5aaafe(0x17b)]('~',_0x4724bd)?_0x776a:_0x4724bd['startsWith']('~/')?_0x244fa1['zIJHk'](_0x776a,_0x4724bd[_0x5aaafe(0x169)](0x1)):_0x4724bd;}function t(_0x4a597c){const _0x89e307=_0x36a8c4,_0x1f1d78={'XkzkZ':function(_0x353490,_0x46baa4){return _0x353490(_0x46baa4);},'Lqzwz':function(_0x19139a,_0xd12323){return _0x19139a||_0xd12323;},'WxNWZ':function(_0x2fb9ff,_0x4797a5,_0x59645a){return _0x2fb9ff(_0x4797a5,_0x59645a);}},_0x2672e4=_0x1f1d78['XkzkZ'](String,_0x1f1d78[_0x89e307(0x16a)](_0x4a597c,''))[_0x89e307(0x15a)]()['match'](/(\d+)\.(\d+)/);return _0x2672e4?[_0x1f1d78['WxNWZ'](parseInt,_0x2672e4[0x1],0xa),parseInt(_0x2672e4[0x2],0xa)]:[0x0,0x0];}export function listModels(_0x205984){const _0x37da53=_0x36a8c4,_0x44e618={'tAcGx':_0x37da53(0x180),'pwKGe':function(_0x1842fa,_0x463ec4){return _0x1842fa(_0x463ec4);},'wwQxt':function(_0x147c1d,_0x420bf0){return _0x147c1d(_0x420bf0);},'htPHw':function(_0x19327,_0x13b91f){return _0x19327-_0x13b91f;},'wPsbe':function(_0x55f9a3,_0x24ddfa){return _0x55f9a3(_0x24ddfa);},'AoFAe':function(_0x34c65d,_0x2682ce){return _0x34c65d===_0x2682ce;}};if(!Array['isArray'](_0x205984)||_0x44e618[_0x37da53(0x174)](0x0,_0x205984[_0x37da53(0x16e)]))return[];const _0x1f945e=_0x205984[_0x37da53(0x179)]((_0x5362b8,_0x304b7b)=>{const _0x197260=_0x37da53;if(_0x44e618[_0x197260(0x160)]==typeof _0x5362b8)return{'index':_0x304b7b,'id':_0x5362b8,'label':_0x5362b8,'raw':_0x5362b8};const _0x517113=_0x5362b8['id']||_0x5362b8[_0x197260(0x16f)]||_0x44e618[_0x197260(0x175)](String,_0x5362b8);return{'index':_0x304b7b,'id':_0x517113,'label':_0x5362b8[_0x197260(0x16f)]||_0x5362b8['id']||_0x517113,'raw':_0x5362b8};});return _0x1f945e[_0x37da53(0x173)]((_0x5c330d,_0x17051c)=>{const _0x158728=_0x37da53,_0x3eb1df=_0x44e618['wwQxt'](t,_0x5c330d['id']),_0xfaaae6=t(_0x17051c['id']);return _0xfaaae6[0x0]-_0x3eb1df[0x0]||_0x44e618[_0x158728(0x15e)](_0xfaaae6[0x1],_0x3eb1df[0x1])||_0x44e618[_0x158728(0x172)](String,_0x5c330d['id'])[_0x158728(0x17d)](String(_0x17051c['id']));}),_0x1f945e;}
|
package/dist/lib/ui.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x5b878d=_0x22f7;(function(_0x27749d,_0x48777d){const _0x6e6dbc=_0x22f7,_0xea1884=_0x27749d();while(!![]){try{const _0x5c0416=parseInt(_0x6e6dbc(0x111))/0x1+parseInt(_0x6e6dbc(0x117))/0x2+-parseInt(_0x6e6dbc(0x104))/0x3+-parseInt(_0x6e6dbc(0x108))/0x4+parseInt(_0x6e6dbc(0x102))/0x5+-parseInt(_0x6e6dbc(0x116))/0x6*(parseInt(_0x6e6dbc(0x106))/0x7)+parseInt(_0x6e6dbc(0x11c))/0x8*(parseInt(_0x6e6dbc(0x10a))/0x9);if(_0x5c0416===_0x48777d)break;else _0xea1884['push'](_0xea1884['shift']());}catch(_0x3eaef0){_0xea1884['push'](_0xea1884['shift']());}}}(_0x2a6c,0xe85ab));import _0xf36c0f from'chalk';import{createRequire as _0x230208}from'node:module';const n=_0x5b878d(0x105)+_0x230208(import.meta.url)(_0x5b878d(0x10c))[_0x5b878d(0x113)];export function banner(){const _0x486368=_0x5b878d;console[_0x486368(0x109)](_0xf36c0f[_0x486368(0x11b)][_0x486368(0x103)](n['replace'](/^\n/,'')['trimEnd']()));}export function ok(_0x2a5150){const _0xacca63=_0x5b878d;console[_0xacca63(0x109)](_0xf36c0f[_0xacca63(0x10e)]('✓\x20'+_0x2a5150));}export function fail(_0x1c1f8a){const _0x3cf0a6=_0x5b878d;console['error'](_0xf36c0f[_0x3cf0a6(0x11a)]('✗\x20'+_0x1c1f8a));}export function warn(_0x3c44d4){const _0x2e9b73=_0x5b878d;console[_0x2e9b73(0x10b)](_0xf36c0f[_0x2e9b73(0x114)]('⚠\x20'+_0x3c44d4));}export function info(_0x32ed7c){const _0x476247=_0x5b878d;console[_0x476247(0x109)](_0xf36c0f[_0x476247(0x107)]('ℹ\x20'+_0x32ed7c));}export function step(_0x32af3b){const _0x57c230=_0x5b878d;console[_0x57c230(0x109)](),console[_0x57c230(0x109)](_0xf36c0f['bold'][_0x57c230(0x103)]('■\x20'+_0x32af3b));}function _0x2a6c(){const _0x27286f=['version','yellow','启动\x20/\x20使用指南','246mtCPDz','1027534tqPWiq','\x20\x20\x20\x20启动:','dim','red','bold','1772568uTFpZo','startCmd','6918705XzCUuZ','cyan','865494opSRvS','\x20\x20____\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20_\x20\x20\x20\x20\x20\x20\x20_\x0a\x20|___\x20\x5c\x20__\x20_\x20_\x20__\x20(_)\x20\x20___|\x20|_\x20___\x20\x20_\x20__\x20___\x0a\x20\x20\x20__)\x20/\x20_`\x20|\x20\x27_\x20\x5c|\x20|\x20/\x20__|\x20__/\x20_\x20\x5c|\x20\x27__/\x20_\x20\x5c\x0a\x20\x20/\x20__/\x20(_|\x20|\x20|_)\x20|\x20|_\x5c__\x20\x5c\x20||\x20(_)\x20|\x20|\x20|\x20\x20__/\x0a\x20|_____\x5c__,_|\x20.__/|_(_)___/\x5c__\x5c___/|_|\x20\x20\x5c___|\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20|_|\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20v','230965tLAaTm','blue','1231712DGkubE','log','18toRjGG','warn','../package.json','name','green','length','usage','560294NTZeMu','IlQFp'];_0x2a6c=function(){return _0x27286f;};return _0x2a6c();}export function guide(_0x16e125){const _0x34d13f=_0x5b878d,_0xd428f4={'ouEMU':function(_0x9a24e9,_0x469362){return _0x9a24e9(_0x469362);},'IlQFp':_0x34d13f(0x115)};if(_0x16e125&&0x0!==_0x16e125[_0x34d13f(0x10f)]){_0xd428f4['ouEMU'](step,_0xd428f4[_0x34d13f(0x112)]);for(const _0x173725 of _0x16e125){const _0x178cdd=_0xf36c0f[_0x34d13f(0x11b)][_0x34d13f(0x10e)]('\x20\x20▶\x20'+_0x173725[_0x34d13f(0x10d)]),_0x5a10f9=_0xf36c0f[_0x34d13f(0x10e)](_0x34d13f(0x118)+_0x173725[_0x34d13f(0x11d)]),_0xcc5d2b=_0xf36c0f[_0x34d13f(0x119)](_0x173725[_0x34d13f(0x110)]||'');console[_0x34d13f(0x109)](_0x178cdd),console[_0x34d13f(0x109)](_0x5a10f9),_0xcc5d2b&&console['log'](_0xcc5d2b),console[_0x34d13f(0x109)]();}}}function _0x22f7(_0x54a2ad,_0x5c7b19){_0x54a2ad=_0x54a2ad-0x102;const _0x2a6c8f=_0x2a6c();let _0x22f7ac=_0x2a6c8f[_0x54a2ad];return _0x22f7ac;}export function plain(_0x33ff87){const _0x286156=_0x5b878d;console[_0x286156(0x109)](_0x33ff87);}export{_0xf36c0f as chalk};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const _0x2eafe1=_0x5653;(function(_0x3a8597,_0x4d7bec){const _0x453452=_0x5653,_0x237438=_0x3a8597();while(!![]){try{const _0x1c2c70=parseInt(_0x453452(0xfe))/0x1*(-parseInt(_0x453452(0xf3))/0x2)+parseInt(_0x453452(0xe6))/0x3*(-parseInt(_0x453452(0xfc))/0x4)+parseInt(_0x453452(0xf6))/0x5*(-parseInt(_0x453452(0xeb))/0x6)+parseInt(_0x453452(0x100))/0x7+-parseInt(_0x453452(0x101))/0x8+parseInt(_0x453452(0xff))/0x9*(parseInt(_0x453452(0xf9))/0xa)+-parseInt(_0x453452(0xe7))/0xb*(-parseInt(_0x453452(0xfa))/0xc);if(_0x1c2c70===_0x4d7bec)break;else _0x237438['push'](_0x237438['shift']());}catch(_0x44c6ba){_0x237438['push'](_0x237438['shift']());}}}(_0x31d7,0x88db6));function _0x5653(_0x16e63c,_0x41cc87){_0x16e63c=_0x16e63c-0xe6;const _0x31d740=_0x31d7();let _0x5653c6=_0x31d740[_0x16e63c];return _0x5653c6;}function _0x31d7(){const _0x27e647=['1620544fKRldl','6mdBBnP','77ZRqBkm','请用\x20sudo\x20重跑:\x0a\x20\x20\x20\x20sudo\x20npx\x20-y\x20@2api-store/activate','name','EROFS','12KodrvM','请用「管理员\x20PowerShell」重跑:\x0a\x20\x20\x20\x20Start-Process\x20powershell\x20-Verb\x20RunAs\x20-ArgumentList\x20\x22npx,-y,@2api-store/activate\x22','EPERM','cause','Mtqlv','写入失败:','has','path','20206pQMrAT','NHnoA','dirname','2488465kIEUGl','SaeWc','writeFileSync','55930RWGvzK','1922520MrzLdQ','PermissionDeniedError','115544mqZsBN','code','38cIxKLW','1035RLeVee','3048787Iebkcu'];_0x31d7=function(){return _0x27e647;};return _0x31d7();}import _0x1307cd from'node:fs';import _0x136890 from'node:path';const o=new Set(['EACCES',_0x2eafe1(0xed),_0x2eafe1(0xea)]);export class PermissionDeniedError extends Error{constructor(_0x152d9e,_0x4abb05,_0x52b983){const _0x54f280=_0x2eafe1,_0x13dbc7={'Mtqlv':_0x54f280(0xe8),'NHnoA':_0x54f280(0xfb)},_0x4c36ee=_0x52b983?_0x54f280(0xec):_0x13dbc7[_0x54f280(0xef)];super(_0x54f280(0xf0)+_0x152d9e+'('+(_0x4abb05[_0x54f280(0xfd)]||_0x4abb05['message'])+')\x0a\x20\x20'+_0x4c36ee),this[_0x54f280(0xe9)]=_0x13dbc7[_0x54f280(0xf4)],this[_0x54f280(0xfd)]=_0x4abb05['code'],this[_0x54f280(0xf2)]=_0x152d9e,this[_0x54f280(0xee)]=_0x4abb05;}}export function writeFileWithPermission(_0x48d71e,_0x395b6e,{isWindows:_0x489408=!0x1}={}){const _0x301f07=_0x2eafe1,_0x24a7a7={'SaeWc':'utf8'},_0x569702=_0x136890[_0x301f07(0xf5)](_0x48d71e);try{_0x1307cd['mkdirSync'](_0x569702,{'recursive':!0x0});}catch(_0x5353fd){if(o[_0x301f07(0xf1)](_0x5353fd['code']))throw new PermissionDeniedError(_0x48d71e,_0x5353fd,_0x489408);throw _0x5353fd;}try{_0x1307cd[_0x301f07(0xf8)](_0x48d71e,_0x395b6e,{'encoding':_0x24a7a7[_0x301f07(0xf7)],'mode':0x180});}catch(_0x43dfc1){if(o['has'](_0x43dfc1['code']))throw new PermissionDeniedError(_0x48d71e,_0x43dfc1,_0x489408);throw _0x43dfc1;}return _0x48d71e;}
|
package/package.json
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@2api-store/activate",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "TokenShop CLI 一键激活:配置本地 codex/claude/gemini/grok/opencode 指向 2api.store 中转(彩色输出 + 自动安装 CLI)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
|
-
"activate": "./activate.mjs"
|
|
7
|
+
"activate": "./dist/activate.mjs"
|
|
8
8
|
},
|
|
9
|
-
"main": "./activate.mjs",
|
|
9
|
+
"main": "./dist/activate.mjs",
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": ">=18"
|
|
12
12
|
},
|
|
13
13
|
"scripts": {
|
|
14
14
|
"check": "node --check activate.mjs && for f in lib/*.mjs; do node --check \"$f\" || exit 1; done",
|
|
15
|
+
"build": "node build.mjs",
|
|
16
|
+
"prepublishOnly": "npm run check && npm run build",
|
|
15
17
|
"smoke": "node test/smoke.mjs"
|
|
16
18
|
},
|
|
17
19
|
"files": [
|
|
18
|
-
"
|
|
19
|
-
"lib/",
|
|
20
|
+
"dist/",
|
|
20
21
|
"README.md"
|
|
21
22
|
],
|
|
22
23
|
"keywords": [
|
|
@@ -35,6 +36,10 @@
|
|
|
35
36
|
"@inquirer/prompts": "^7.0.0",
|
|
36
37
|
"chalk": "^5.4.0"
|
|
37
38
|
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"javascript-obfuscator": "^4.1.0",
|
|
41
|
+
"terser": "^5.31.0"
|
|
42
|
+
},
|
|
38
43
|
"license": "MIT",
|
|
39
44
|
"publishConfig": {
|
|
40
45
|
"access": "public"
|