@ranger-testing/ranger-cli 2.5.4-alpha.0e8b82c-9 โ 2.5.4-alpha.27e3ee8-11
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/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/package.json +1 -1
package/build/commands/addEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1c5759,_0x2080f4){const _0x3868bf=_0x24d9,_0xb2a021=_0x1c5759();while(!![]){try{const _0x2bb567=parseInt(_0x3868bf(0xa5))/0x1*(-parseInt(_0x3868bf(0x101))/0x2)+-parseInt(_0x3868bf(0xb8))/0x3*(-parseInt(_0x3868bf(0xa0))/0x4)+parseInt(_0x3868bf(0xa6))/0x5+parseInt(_0x3868bf(0xd7))/0x6+-parseInt(_0x3868bf(0xbb))/0x7+-parseInt(_0x3868bf(0x114))/0x8*(parseInt(_0x3868bf(0xa2))/0x9)+parseInt(_0x3868bf(0x92))/0xa*(-parseInt(_0x3868bf(0xcf))/0xb);if(_0x2bb567===_0x2080f4)break;else _0xb2a021['push'](_0xb2a021['shift']());}catch(_0x547d13){_0xb2a021['push'](_0xb2a021['shift']());}}}(_0x56cf,0x6626d));import{mkdir,writeFile,readFile,readdir,unlink,rm,mkdtemp,rename}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x4b1ead from'inquirer';import{chromium}from'playwright';import{findExistingEnv,loadSettings}from'./utils/settings.js';import{encrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{addProfileSetupBanner}from'./utils/profileSetupBanner.js';import{fetchAuthConfig,createCloudProfile,ApiError}from'./utils/cloudProfile.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{isPathGitTracked}from'./utils/gitTracked.js';async function checkUrlReachability(_0x510be7){const _0x574399=_0x24d9,_0x557f6e={'xuexM':function(_0x1f5962,_0xba3350,_0x36f3a1){return _0x1f5962(_0xba3350,_0x36f3a1);},'xtlHB':function(_0x230bd4,_0xa3c9c1){return _0x230bd4<_0xa3c9c1;},'HOgZJ':function(_0x17c8e0,_0x196207){return _0x17c8e0(_0x196207);},'WJMmF':function(_0x3932d8,_0x308f15){return _0x3932d8===_0x308f15;}};try{const _0x57166f=new AbortController(),_0x58eede=setTimeout(()=>_0x57166f[_0x574399(0xbf)](),0x1388),_0x65bc66={'method':_0x574399(0x9f),'signal':_0x57166f[_0x574399(0xff)],'redirect':'manual'};/^https:\/\/localhost(:\d+)?/i['test'](_0x510be7)&&(process[_0x574399(0xe8)]['NODE_TLS_REJECT_UNAUTHORIZED']='0');const _0x229f20=await _0x557f6e['xuexM'](fetch,_0x510be7,_0x65bc66);delete process[_0x574399(0xe8)]['NODE_TLS_REJECT_UNAUTHORIZED'],clearTimeout(_0x58eede);if(_0x557f6e[_0x574399(0xba)](_0x229f20['status'],0x190))return{'ok':!![]};return{'ok':![],'error':_0x574399(0x106)+_0x229f20['status']};}catch(_0x593217){delete process[_0x574399(0xe8)]['NODE_TLS_REJECT_UNAUTHORIZED'];const _0x34a5d8=_0x593217,_0x1c965a=_0x34a5d8[_0x574399(0x9b)]||_0x557f6e[_0x574399(0x94)](String,_0x593217),_0x3835a3=_0x1c965a[_0x574399(0x9a)]('Invalid\x20URL')||_0x557f6e[_0x574399(0x113)](_0x34a5d8[_0x574399(0x95)],'TypeError')||_0x1c965a[_0x574399(0x9a)](_0x574399(0x90));return{'ok':![],'error':_0x1c965a,'isProtocolError':_0x3835a3};}}async function sweepOrphanLocalProfile(_0x34c266,_0x198d4a,_0x39d15f){const _0x3add1c=_0x24d9,_0x16d548={'qjbyA':function(_0x2051e2,_0x170bb9,_0xf7a76c){return _0x2051e2(_0x170bb9,_0xf7a76c);},'IuENj':'local','ELZwC':function(_0x470f07,_0xbf15ca,_0x37b1dc){return _0x470f07(_0xbf15ca,_0x37b1dc);},'XHbar':function(_0x4fc0f4,_0xb0a931){return _0x4fc0f4(_0xb0a931);},'MZmVD':function(_0x4fc91d,_0x1c247d){return _0x4fc91d(_0x1c247d);},'MAWfu':function(_0x4820a0,_0x173706,_0x418949){return _0x4820a0(_0x173706,_0x418949);}},_0x2ab380=_0x16d548['qjbyA'](join,_0x198d4a,_0x16d548['IuENj']),_0x23d4d6=_0x16d548[_0x3add1c(0x9e)](join,_0x2ab380,_0x34c266);_0x16d548['XHbar'](existsSync,_0x23d4d6)&&(_0x39d15f&&await isPathGitTracked(_0x23d4d6)?console[_0x3add1c(0xf2)](_0x3add1c(0xb9)+_0x23d4d6+'\x20โ\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.'):(await _0x16d548['qjbyA'](rm,_0x23d4d6,{'recursive':!![],'force':!![]}),console['log']('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0x23d4d6)));if(_0x16d548[_0x3add1c(0x10f)](existsSync,_0x2ab380)){let _0x25c0be=[];try{_0x25c0be=await readdir(_0x2ab380);}catch{return;}const _0x1d4c6d=_0x3add1c(0xbc)+_0x34c266+'-';for(const _0x3256ab of _0x25c0be){if(!_0x3256ab[_0x3add1c(0xa4)](_0x1d4c6d))continue;const _0x3665b2=join(_0x2ab380,_0x3256ab);await _0x16d548['MAWfu'](rm,_0x3665b2,{'recursive':!![],'force':!![]}),console[_0x3add1c(0xf2)](_0x3add1c(0xca)+_0x3665b2);}}}function _0x56cf(){const _0x498842=['HTTP\x20','yes','\x0a\x20\x20A\x20cloud\x20profile\x20named\x20\x22','bBGca','VDjdC','root\x20(.ranger/)','Saahg','url_setup','Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.','MZmVD','--ci\x20and\x20--cdp-endpoint\x20cannot\x20be\x20used\x20together.\x20Electron/CDP\x20profiles\x20only\x20work\x20with\x20a\x20locally\x20running\x20app\x20and\x20are\x20not\x20supported\x20in\x20CI.','--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','fUKGF','WJMmF','7712AKngFQ','gWhxw','overwrite','kuVfe','safeMode','use_suggestion','This\x20can\x20happen\x20due\x20to\x20a\x20browser\x20compatibility\x20issue\x20on\x20some\x20systems.\x0a','NcDzp','setupHeader','setupHeaders','\x22\x20already\x20exists.\x20Overwrite?','\x20\x20Could\x20not\x20encrypt:\x20No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]','status','heCbl','AzHYJ','.backup-','now','fetch\x20failed','Warning:\x20Could\x20not\x20remove\x20old\x20profile\x20backup\x20at\x20','115890rvwrUr','continue','HOgZJ','name','error','settings.json','baseUrl','\x0a\x20\x20\x20โ \x20This\x20step\x20requires\x20human\x20interaction\x20in\x20a\x20browser.','includes','message','\x22.\x20Expected\x20\x22Name:\x20Value\x22.','hxUkJ','ELZwC','HEAD','13364YNxnek','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','5274ykCqZL','czHLY','startsWith','51958QLKQmH','3525545hwWcgF','test','indexOf','OZLfj','origin','xPVRd','scope','Delete\x20existing\x20and\x20create\x20new\x20in\x20','You\x20can\x20try\x20again\x20with\x20one\x20of:','vVXqW','exit','legacy','retry','WOgxp','TlYxq','stdout','JkaBR','wPULv','471VYKmvf','\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20','xtlHB','4022984rzVcTi','.tmp-','Removed\x20existing\x20profile\x20at\x20','environments','abort','local','catch','finally','\x20\x20Did\x20you\x20mean\x20','storageState','confirm','No\x20auth\x20env\x20matches\x20this\x20URL.\x20Creating\x20local\x20profile.','trim','\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20','What\x20would\x20you\x20like\x20to\x20do?','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','VykFS','FATmr','length','fxofC','154aSmEOW','force','allowInsecureLocalhost','tfHdd','ZWAax','\x0a\x20\x20Profile\x20\x22','โ\x20Auth\x20state\x20saved\x20to:\x20','\x20\x20\x20Creating\x20it\x20in\x20','3255522lekfpc','Continue\x20anyway','โ\x20Created\x20settings:\x20','\x20\x20ranger\x20profile\x20add\x20','DVCZr','SojPv','MKdaI','.enc','saveToCloud','Could\x20not\x20reach\x20','WpsqX','url','qrlMB',')\x0a\x20\x20Save\x20\x27','QOjmT','isTTY','\x20\x20\x20When\x20done\x20logging\x20in,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.','env','\x20--skip-auth\x20\x20\x20\x20(skip\x20browser\x20auth\x20entirely)\x0a','SIGINT','goto','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','user','slice','\x22\x20already\x20exists\x20in\x20','\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.','auth.json','log','cdpEndpoint','Aborted.','http://','off','\x27\x20created,\x20linked\x20to\x20env\x20\x27','keys',').\x20Falling\x20back\x20to\x20local\x20profile.','trackPhaseEnd','push','ldipx','Saving\x20authentication\x20state...','quzwF','signal','rlQMX','2UneaHV','stdin','location','mPaeP','\x20would\x20shadow\x20the\x20existing\x20profile.'];_0x56cf=function(){return _0x498842;};return _0x56cf();}function _0x24d9(_0x649306,_0x4c3416){_0x649306=_0x649306-0x8a;const _0x56cf98=_0x56cf();let _0x24d916=_0x56cf98[_0x649306];return _0x24d916;}async function tryAutoRouteCloudProfile(_0x4e7d39,_0x5d7f2b,_0x7924ff,_0x1634e2,_0x5ea04c){const _0x37c3ca=_0x24d9,_0x167097={'WpsqX':function(_0x4e4fad){return _0x4e4fad();},'NcDzp':'profile.add.autoRouteSkipped','MKdaI':'no_auth_config','QOjmT':function(_0x5ce7d4,_0x407090){return _0x5ce7d4===_0x407090;},'Twyeb':function(_0x445767,_0x1149b4,_0x2bda99){return _0x445767(_0x1149b4,_0x2bda99);},'mPaeP':_0x37c3ca(0xc6),'SGOEM':function(_0x37c074,_0x13c178){return _0x37c074 instanceof _0x13c178;},'czHLY':function(_0x580ebf,_0x8bd1ce){return _0x580ebf instanceof _0x8bd1ce;},'sUwwg':function(_0x452695,_0x4b7efe){return _0x452695(_0x4b7efe);},'HDVEX':function(_0x8402d3,_0x453e18){return _0x8402d3+_0x453e18;},'JusHN':function(_0x30eaa8,_0x3846c6,_0x196679,_0x540b81){return _0x30eaa8(_0x3846c6,_0x196679,_0x540b81);},'fUKGF':function(_0x5194f0,_0x4f4114){return _0x5194f0 instanceof _0x4f4114;},'HhnPw':function(_0x24bb77,_0x17dbd2){return _0x24bb77(_0x17dbd2);},'CDBvt':'profile.add.autoRouted'};let _0x256c2e;try{_0x256c2e=await _0x167097[_0x37c3ca(0xe1)](fetchAuthConfig);}catch{return _0x5ea04c?.['trackPhaseEnd'](_0x167097[_0x37c3ca(0x11b)],{'reason':_0x167097[_0x37c3ca(0xdd)],'profileName':_0x4e7d39}),![];}if(!_0x256c2e||!_0x256c2e['environments']||_0x167097[_0x37c3ca(0xe5)](Object['keys'](_0x256c2e[_0x37c3ca(0xbe)])[_0x37c3ca(0xcd)],0x0))return _0x5ea04c?.['trackPhaseEnd'](_0x167097['NcDzp'],{'reason':_0x167097[_0x37c3ca(0xdd)],'profileName':_0x4e7d39}),![];const _0x47078e=_0x167097['Twyeb'](matchAuthEnvironment,_0x5d7f2b,_0x256c2e);if(!_0x47078e)return console[_0x37c3ca(0xf2)](_0x167097[_0x37c3ca(0x104)]),_0x5ea04c?.[_0x37c3ca(0xfa)]('profile.add.autoRouteSkipped',{'reason':'no_match','profileName':_0x4e7d39}),![];const _0x57ea24=_0x256c2e['environments'][_0x47078e],_0x5ecc9a=_0x57ea24?.['domains']??[];if(_0x1634e2&&!_0x7924ff[_0x37c3ca(0x107)]){const {saveToCloud:_0x4f296a}=await _0x4b1ead['prompt']([{'type':'confirm','name':_0x37c3ca(0xdf),'message':'Found\x20auth\x20environment\x20\x27'+_0x47078e+'\x27\x20matching\x20'+_0x5d7f2b+'\x0a\x20\x20(domains:\x20'+_0x5ecc9a['join'](',\x20')+_0x37c3ca(0xe4)+_0x4e7d39+'\x27\x20to\x20the\x20cloud?','default':!![]}]);if(!_0x4f296a)return _0x5ea04c?.['trackPhaseEnd'](_0x167097[_0x37c3ca(0x11b)],{'reason':'user_declined','profileName':_0x4e7d39}),![];}const _0x3b8399=_0x5ecc9a['some'](_0x5f0e1c=>{const _0x524d62=_0x37c3ca;try{return new URL(_0x5f0e1c)[_0x524d62(0xaa)]===new URL(_0x5d7f2b)['origin'];}catch{return![];}}),_0x597d41={};!_0x3b8399&&(_0x597d41[_0x37c3ca(0x98)]=_0x5d7f2b);try{await createCloudProfile(_0x4e7d39,_0x47078e,{'settings':_0x597d41});}catch(_0x55d303){if(_0x167097['SGOEM'](_0x55d303,ApiError)&&_0x55d303[_0x37c3ca(0x8b)]===0x199){console['error'](_0x37c3ca(0x108)+_0x4e7d39+'\x22\x20already\x20exists.\x20Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20profile\x20first.');throw _0x55d303;}return console['log']('\x20\x20Could\x20not\x20reach\x20Ranger\x20API\x20to\x20create\x20a\x20cloud\x20profile\x20('+(_0x167097[_0x37c3ca(0xa3)](_0x55d303,Error)?_0x55d303[_0x37c3ca(0x9b)]:_0x167097['sUwwg'](String,_0x55d303))+_0x37c3ca(0xf9)),_0x5ea04c?.['trackPhaseEnd'](_0x167097['NcDzp'],{'reason':_0x167097['MKdaI'],'profileName':_0x4e7d39}),![];}console[_0x37c3ca(0xf2)](_0x167097['HDVEX']('โ\x20Cloud\x20profile\x20\x27'+_0x4e7d39+_0x37c3ca(0xf7)+_0x47078e+'\x27.\x0a','\x20\x20Next:\x20RANGER_TEST_USERNAME=...\x20RANGER_TEST_PASSWORD=...\x20ranger\x20go\x20--profile\x20'+_0x4e7d39));try{await sweepOrphanLocalProfile(_0x4e7d39,getRangerHomeDir(),![]);const _0x45cecc=getRangerDir();_0x45cecc!==getRangerHomeDir()&&await _0x167097['JusHN'](sweepOrphanLocalProfile,_0x4e7d39,_0x45cecc,!![]);}catch(_0x33bffa){console[_0x37c3ca(0xf2)]('\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20('+(_0x167097[_0x37c3ca(0x112)](_0x33bffa,Error)?_0x33bffa[_0x37c3ca(0x9b)]:_0x167097['HhnPw'](String,_0x33bffa))+').');}return _0x5ea04c?.['trackPhaseEnd'](_0x167097['CDBvt'],{'envKey':_0x47078e,'profileName':_0x4e7d39}),!![];}export async function addEnv(_0x1085bd,_0x5a0d29={},_0x55a47f){const _0xf1fabd=_0x24d9,_0x20fdae={'fxofC':_0xf1fabd(0xfd),'vwFMW':function(_0x293e2d){return _0x293e2d();},'FATmr':function(_0x277e7f,_0x7638c1,_0x29db33,_0x353546){return _0x277e7f(_0x7638c1,_0x29db33,_0x353546);},'SojPv':function(_0x4c179e,_0x536796){return _0x4c179e===_0x536796;},'ARoTM':function(_0x383fd3,_0x1050b){return _0x383fd3+_0x1050b;},'cLwmM':'Please\x20provide\x20--url\x20when\x20running\x20in\x20non-interactive\x20mode.\x0aMake\x20sure\x20the\x20service\x20is\x20running\x20on\x20that\x20port\x20before\x20retrying.\x0aExample:\x20ranger\x20profile\x20add\x20local\x20--url\x20http://localhost:3000','Saahg':function(_0x1a4a7b,_0x2d3a63,_0x3e056e,_0x2c7eca,_0x597ed6,_0x5276ee){return _0x1a4a7b(_0x2d3a63,_0x3e056e,_0x2c7eca,_0x597ed6,_0x5276ee);},'WOgxp':function(_0x45e51d,_0x36b608,_0x2ba5d2){return _0x45e51d(_0x36b608,_0x2ba5d2);},'OJnRt':function(_0x6d259a,_0x1ab749){return _0x6d259a===_0x1ab749;},'bBGca':_0xf1fabd(0x116),'vVXqW':_0xf1fabd(0xb1),'qrlMB':_0xf1fabd(0x10b),'pXGoR':'shouldReplace','heCbl':_0xf1fabd(0xf4),'ZWAax':function(_0x16f4dc,_0x8b537a){return _0x16f4dc(_0x8b537a);},'hxUkJ':_0xf1fabd(0xec),'QkmKq':'input','TlYxq':'What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','VykFS':function(_0x387811,_0xceba9b){return _0x387811||_0xceba9b;},'qqhXU':function(_0x5ad8e8,_0x2ccc78){return _0x5ad8e8(_0x2ccc78);},'CoNwq':'list','xPVRd':'use_suggestion','NVdmi':'Enter\x20a\x20different\x20URL','quzwF':_0xf1fabd(0xb2),'yYKum':_0xf1fabd(0xd8),'DVCZr':_0xf1fabd(0x93),'XOwiQ':_0xf1fabd(0xf1),'jgYSc':'\x0a๐\x20Authentication\x20Setup','kuVfe':_0xf1fabd(0xe7),'VbGsx':'\x20\x20\x20If\x20you\x20are\x20an\x20agent,\x20background\x20this\x20process\x20and\x20let\x20your\x20user\x20know\x20they\x20need\x20to\x20complete\x20browser\x20authentication.\x0a','OZLfj':'--disable-features=WebBluetooth','WkPGw':'--allow-insecure-localhost','gWhxw':'\x0aThe\x20browser\x20closed\x20unexpectedly\x20before\x20authentication\x20could\x20be\x20saved.','MaxJY':_0xf1fabd(0xae),'dZBYL':_0xf1fabd(0x8a),'JkaBR':function(_0x43194e,_0x71415d){return _0x43194e(_0x71415d);},'rlQMX':function(_0x566bb0,_0x5024c0){return _0x566bb0+_0x5024c0;},'VDjdC':'\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.','wPULv':_0xf1fabd(0xf0),'AzHYJ':'config_write','cwqbM':function(_0xe62d74,_0x2bc4d5){return _0xe62d74>_0x2bc4d5;},'ldipx':'settings.json','eWkiP':_0xf1fabd(0x10e),'CZOfr':function(_0x2c1178,_0x19109c,_0x4bd35d){return _0x2c1178(_0x19109c,_0x4bd35d);},'tfHdd':_0xf1fabd(0xea)},_0x2eab1c=_0x5a0d29['ci']??![],_0x624588=_0x2eab1c?'ci':_0xf1fabd(0xc0),_0x92db54=_0x5a0d29[_0xf1fabd(0xac)]===_0xf1fabd(0xed)?getRangerHomeDir():getRangerDir(),_0x286c0d=_0x20fdae[_0xf1fabd(0xcc)](join,_0x92db54,_0x624588,_0x1085bd),_0x3b4faa={};if(_0x5a0d29[_0xf1fabd(0x11c)])for(const _0x3fbc74 of _0x5a0d29[_0xf1fabd(0x11c)]){const _0x26cd0f=_0x3fbc74[_0xf1fabd(0xa8)](':');if(_0x20fdae[_0xf1fabd(0xdc)](_0x26cd0f,-0x1))throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0x3fbc74+_0xf1fabd(0x9c));const _0xea89c5=_0x3fbc74['slice'](0x0,_0x26cd0f)[_0xf1fabd(0xc7)](),_0x2ce3b6=_0x3fbc74[_0xf1fabd(0xee)](_0x20fdae['ARoTM'](_0x26cd0f,0x1))[_0xf1fabd(0xc7)]();_0x3b4faa[_0xea89c5]=_0x2ce3b6;}const _0x54768a=join(_0x92db54,_0x624588);if(_0x5a0d29['cdpEndpoint']!==undefined&&_0x5a0d29[_0xf1fabd(0xf3)][_0xf1fabd(0xc7)]()==='')throw new Error(_0xf1fabd(0x111));if(_0x5a0d29['cdpEndpoint']&&_0x5a0d29[_0xf1fabd(0xe2)])throw new Error('--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.');if(_0x5a0d29['cdpEndpoint']&&_0x5a0d29['ci'])throw new Error(_0xf1fabd(0x110));const _0x47ab91=Boolean(_0x5a0d29['cdpEndpoint']),_0x13a0df=!_0x5a0d29['skipAuth']&&!_0x47ab91,_0x4e3639=process[_0xf1fabd(0x102)][_0xf1fabd(0xe6)]&&process[_0xf1fabd(0xb5)]['isTTY'];if(!_0x4e3639&&!_0x5a0d29[_0xf1fabd(0xe2)]&&!_0x47ab91)throw new Error(_0x20fdae['cLwmM']);if(!_0x2eab1c&&!_0x5a0d29['skipAuth']&&!_0x47ab91&&_0x5a0d29[_0xf1fabd(0xe2)]){const _0x525c49=await _0x20fdae[_0xf1fabd(0x10c)](tryAutoRouteCloudProfile,_0x1085bd,_0x5a0d29[_0xf1fabd(0xe2)],_0x5a0d29,_0x4e3639,_0x55a47f);if(_0x525c49)return;}const _0x410f59=_0x20fdae[_0xf1fabd(0xb3)](findExistingEnv,_0x1085bd,{'rangerDir':_0x92db54});let _0x89727a=null;if(_0x410f59){if(!_0x4e3639)_0x89727a=_0x410f59;else{if(_0x20fdae['OJnRt'](_0x410f59['location'],_0x624588)){const {overwrite:_0xa353e6}=await _0x4b1ead['prompt']([{'type':'confirm','name':_0x20fdae[_0xf1fabd(0x109)],'message':'Profile\x20\x22'+_0x1085bd+_0xf1fabd(0x11e),'default':![]}]);if(!_0xa353e6){console['log']('Aborted.');return;}_0x89727a=_0x410f59;}else{const _0x49aa43=_0x20fdae['OJnRt'](_0x410f59[_0xf1fabd(0x103)],_0x20fdae[_0xf1fabd(0xaf)])?_0x20fdae[_0xf1fabd(0xe3)]:_0x410f59['location'];console['error']('\x0aโ ๏ธ\x20\x20Profile\x20\x22'+_0x1085bd+_0xf1fabd(0xef)+_0x49aa43+':\x20'+_0x410f59['path']),console[_0xf1fabd(0x96)](_0xf1fabd(0xd6)+_0x624588+_0xf1fabd(0x105));const {shouldReplace:_0x1e6871}=await _0x4b1ead['prompt']([{'type':_0xf1fabd(0xc5),'name':_0x20fdae['pXGoR'],'message':_0xf1fabd(0xad)+_0x624588+'?','default':![]}]);if(!_0x1e6871){console[_0xf1fabd(0xf2)](_0x20fdae[_0xf1fabd(0x8c)]);return;}_0x89727a=_0x410f59;}}}_0x55a47f?.['trackPhaseStart'](_0xf1fabd(0x10d));let _0x3cff70='';if(_0x47ab91)console['log']('\x0a๐\x20CDP\x20Profile\x20Setup\x0a'),console[_0xf1fabd(0xf2)](_0xf1fabd(0xc8)+_0x5a0d29[_0xf1fabd(0xf3)]),console[_0xf1fabd(0xf2)]('\x20\x20Make\x20sure\x20your\x20Electron\x20app\x20(or\x20browser)\x20is\x20running\x20with\x20remote\x20debugging\x20enabled.\x0a');else{if(_0x5a0d29['url']){_0x3cff70=_0x5a0d29[_0xf1fabd(0xe2)];const _0x5a7277=await _0x20fdae[_0xf1fabd(0xd3)](checkUrlReachability,_0x3cff70);if(!_0x5a7277['ok']&&!_0x5a0d29[_0xf1fabd(0xd0)])throw new Error(_0xf1fabd(0xe0)+_0x3cff70+':\x20'+_0x5a7277[_0xf1fabd(0x96)]+'\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.');!_0x5a7277['ok']&&_0x5a0d29[_0xf1fabd(0xd0)]&&console['log']('โ \x20Could\x20not\x20reach\x20'+_0x3cff70+':\x20'+_0x5a7277['error']+'\x20(continuing\x20with\x20--force)');}else{console['log']('\x0a๐\x20Profile\x20Setup\x0a'),console[_0xf1fabd(0xf2)](_0x20fdae[_0xf1fabd(0x9d)]),console[_0xf1fabd(0xf2)]('\x20\x20Ranger\x20will\x20open\x20it\x20in\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20and\x20save\x20your\x20session.\x0a');let _0x5eb5a3=![];while(!![]){const _0x182d96=await _0x4b1ead['prompt']([{'type':_0x20fdae['QkmKq'],'name':'baseUrl','message':_0x5eb5a3?'Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):':_0x20fdae[_0xf1fabd(0xb4)],'default':_0x20fdae[_0xf1fabd(0xcb)](_0x3cff70,'http://localhost:3000')}]);_0x3cff70=_0x182d96['baseUrl'];const _0x4bdf37=await _0x20fdae['qqhXU'](checkUrlReachability,_0x3cff70);if(_0x4bdf37['ok'])break;const _0x31d959=/^[a-zA-Z][\w+.-]*:\/\//[_0xf1fabd(0xa7)](_0x3cff70),_0x9bcb2b=_0x4bdf37['isProtocolError']&&!_0x31d959,_0x5148b2=_0x9bcb2b?_0xf1fabd(0xf5)+_0x3cff70:null;_0x5eb5a3=!![],console[_0xf1fabd(0xf2)]('\x0a\x20\x20Could\x20not\x20reach\x20'+_0x3cff70+':\x20'+_0x4bdf37['error']);_0x5148b2&&console[_0xf1fabd(0xf2)](_0xf1fabd(0xc3)+_0x5148b2+'?');const {action:_0x546d55}=await _0x4b1ead['prompt']([{'type':_0x20fdae['CoNwq'],'name':'action','message':_0xf1fabd(0xc9),'choices':[..._0x5148b2?[{'name':'Use\x20'+_0x5148b2,'value':_0x20fdae[_0xf1fabd(0xab)]}]:[],{'name':_0x20fdae['NVdmi'],'value':_0x20fdae[_0xf1fabd(0xfe)]},{'name':_0x20fdae['yYKum'],'value':_0x20fdae[_0xf1fabd(0xdb)]}]}]);if(_0x546d55===_0xf1fabd(0x119)&&_0x5148b2){_0x3cff70=_0x5148b2;const _0x4d0c04=await _0x20fdae['qqhXU'](checkUrlReachability,_0x3cff70);if(_0x4d0c04['ok'])break;console['log']('\x0a\x20\x20Still\x20could\x20not\x20reach\x20'+_0x3cff70+':\x20'+_0x4d0c04[_0xf1fabd(0x96)]);}else{if(_0x20fdae['OJnRt'](_0x546d55,_0xf1fabd(0x93)))break;}}}}_0x55a47f?.[_0xf1fabd(0xfa)]('url_setup');const _0x454211={};if(_0x89727a){const _0x58a398=await loadSettings(_0x1085bd);Object['assign'](_0x454211,_0x58a398['setupHeaders']);}Object['assign'](_0x454211,_0x3b4faa),await _0x20fdae['WOgxp'](mkdir,_0x54768a,{'recursive':!![]});try{const _0x418051=await readdir(_0x54768a),_0x38a9a4='.tmp-'+_0x1085bd+'-';for(const _0x2e84a8 of _0x418051){_0x2e84a8[_0xf1fabd(0xa4)](_0x38a9a4)&&await rm(join(_0x54768a,_0x2e84a8),{'recursive':!![],'force':!![]});}}catch{}const _0x5be861=await _0x20fdae[_0xf1fabd(0xd3)](mkdtemp,_0x20fdae['WOgxp'](join,_0x54768a,_0xf1fabd(0xbc)+_0x1085bd+'-')),_0x1ea235=join(_0x5be861,_0x20fdae['XOwiQ']),_0x23f8f7=()=>{const _0x3e15d7=_0xf1fabd;rm(_0x5be861,{'recursive':!![],'force':!![]})[_0x3e15d7(0xc1)](()=>{})[_0x3e15d7(0xc2)](()=>{const _0x32e63c=_0x3e15d7;process[_0x32e63c(0xb0)](0x82);});};process['once']('SIGINT',_0x23f8f7);const _0x3a74c2=Boolean(_0x3cff70)&&/^https:\/\/localhost(:\d+)?/i['test'](_0x3cff70);try{if(_0x13a0df){_0x55a47f?.['trackPhaseStart']('browser_auth'),console['log'](_0x20fdae['jgYSc']),console[_0xf1fabd(0xf2)]('\x20\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20to\x20the\x20profile\x20you\x20want\x20to\x20test\x20so\x20Ranger\x20can\x20access\x20it.'),console['log'](_0x20fdae[_0xf1fabd(0x117)]);!_0x4e3639?(console[_0xf1fabd(0xf2)](_0xf1fabd(0x99)),console[_0xf1fabd(0xf2)](_0x20fdae['VbGsx'])):console['log']('');await new Promise(_0x3694ed=>setTimeout(_0x3694ed,0xbb8));const _0x34e854=[];_0x5a0d29[_0xf1fabd(0x118)]&&_0x34e854[_0xf1fabd(0xfb)](_0x20fdae[_0xf1fabd(0xa9)]);const _0x5438b9=_0x5a0d29['allowInsecureLocalhost']||_0x3a74c2;_0x5438b9&&_0x34e854[_0xf1fabd(0xfb)](_0x20fdae['WkPGw']);const _0x7a1b6e=await chromium['launch']({'headless':![],..._0x34e854[_0xf1fabd(0xcd)]>0x0?{'args':_0x34e854}:{}});try{const _0x33414c=Object['keys'](_0x454211)[_0xf1fabd(0xcd)]>0x0,_0x475084={'ignoreHTTPSErrors':!![]};_0x33414c&&(_0x475084['extraHTTPHeaders']=_0x454211);const _0x3f739f=await _0x7a1b6e['newContext'](_0x475084);await addProfileSetupBanner(_0x3f739f);const _0x6e68af=await _0x3f739f['newPage']();await _0x6e68af[_0xf1fabd(0xeb)](_0x20fdae['VykFS'](_0x3cff70,'about:blank'));let _0x43111b=![];await new Promise(_0x5f266a=>{_0x6e68af['on']('close',async()=>{const _0x506ff2=_0x24d9;try{console[_0x506ff2(0xf2)](_0x20fdae[_0x506ff2(0xce)]),await _0x3f739f[_0x506ff2(0xc4)]({'path':_0x1ea235}),_0x43111b=!![];}catch{}_0x20fdae['vwFMW'](_0x5f266a);});});if(!_0x43111b){console[_0xf1fabd(0xf2)](_0x20fdae[_0xf1fabd(0x115)]);!_0x5a0d29[_0xf1fabd(0x118)]&&(console[_0xf1fabd(0xf2)](_0xf1fabd(0x11a)),console['log'](_0x20fdae['MaxJY']),console['log'](_0xf1fabd(0xda)+_0x1085bd+'\x20--safe-mode\x20\x20\x20\x20(disables\x20browser\x20features\x20that\x20can\x20cause\x20crashes)'),console['log']('\x20\x20ranger\x20profile\x20add\x20'+_0x1085bd+_0xf1fabd(0xe9)));throw new Error(_0xf1fabd(0xa1));}}finally{await _0x7a1b6e['close']()['catch'](()=>{});}if(_0x2eab1c){const _0x23211e=await readFile(_0x1ea235,'utf-8'),_0x1e630e=await _0x20fdae['vwFMW'](getToken);if(!_0x1e630e){console[_0xf1fabd(0x96)](_0x20fdae['dZBYL']),await _0x20fdae[_0xf1fabd(0xb6)](unlink,_0x1ea235)['catch'](()=>{});throw new Error('Missing\x20API\x20token;\x20aborting\x20CI\x20profile\x20creation.');}else{const _0x3eccef=encrypt(_0x23211e,_0x1e630e);await writeFile(_0x20fdae[_0xf1fabd(0x100)](_0x1ea235,'.enc'),_0x3eccef),await unlink(_0x1ea235),console[_0xf1fabd(0xf2)]('โ\x20Encrypted\x20auth\x20saved\x20to:\x20'+_0x1ea235+_0xf1fabd(0xde)),console[_0xf1fabd(0xf2)](_0x20fdae[_0xf1fabd(0x10a)]),console['log'](_0x20fdae[_0xf1fabd(0xb7)]);}}else console[_0xf1fabd(0xf2)](_0xf1fabd(0xd5)+_0x1ea235);_0x55a47f?.[_0xf1fabd(0xfa)]('browser_auth');}_0x55a47f?.['trackPhaseStart'](_0x20fdae[_0xf1fabd(0x8d)]);const _0x2ba283={};_0x3cff70&&(_0x2ba283[_0xf1fabd(0x98)]=_0x3cff70);_0x5a0d29[_0xf1fabd(0xf3)]&&(_0x2ba283['cdpEndpoint']=_0x5a0d29[_0xf1fabd(0xf3)],_0x2ba283['isElectron']=!![]);(_0x5a0d29[_0xf1fabd(0xd1)]||_0x3a74c2)&&(_0x2ba283[_0xf1fabd(0xd1)]=!![]);_0x5a0d29[_0xf1fabd(0x118)]&&(_0x2ba283[_0xf1fabd(0x118)]=!![]);_0x20fdae['cwqbM'](Object[_0xf1fabd(0xf8)](_0x454211)[_0xf1fabd(0xcd)],0x0)&&(_0x2ba283[_0xf1fabd(0x11d)]=_0x454211);await writeFile(join(_0x5be861,_0x20fdae[_0xf1fabd(0xfc)]),JSON['stringify'](_0x2ba283,null,0x2)),console['log'](_0xf1fabd(0xd9)+join(_0x286c0d,_0xf1fabd(0x97)));if(_0x89727a?.[_0xf1fabd(0x103)]===_0x624588){const _0x2b5dee=_0x89727a['path']+_0xf1fabd(0x8e)+Date[_0xf1fabd(0x8f)]();await _0x20fdae[_0xf1fabd(0xb3)](rename,_0x89727a['path'],_0x2b5dee);try{await rename(_0x5be861,_0x286c0d);}catch(_0x2c3f25){await rename(_0x2b5dee,_0x89727a['path']);throw _0x2c3f25;}try{await rm(_0x2b5dee,{'recursive':!![]});}catch{console[_0xf1fabd(0xf2)](_0xf1fabd(0x91)+_0x2b5dee);}}else{await _0x20fdae['WOgxp'](rename,_0x5be861,_0x286c0d);if(_0x89727a)try{await _0x20fdae['WOgxp'](rm,_0x89727a['path'],{'recursive':!![]}),console[_0xf1fabd(0xf2)](_0xf1fabd(0xbd)+_0x89727a['path']);}catch{console['log']('Warning:\x20Could\x20not\x20remove\x20old\x20profile\x20at\x20'+_0x89727a['path']);}}try{await writeActiveProfileName(_0x1085bd),console['log']('\x20\x20Set\x20active\x20profile:\x20'+_0x1085bd);}catch{console[_0xf1fabd(0xf2)](_0x20fdae['eWkiP']);}_0x55a47f?.['trackPhaseEnd'](_0x20fdae[_0xf1fabd(0x8d)]),console['log'](_0xf1fabd(0xd4)+_0x1085bd+'\x22\x20configured');}catch(_0x47eef8){await _0x20fdae['CZOfr'](rm,_0x5be861,{'recursive':!![],'force':!![]});throw _0x47eef8;}finally{process[_0xf1fabd(0xf6)](_0x20fdae[_0xf1fabd(0xd2)],_0x23f8f7);}}
|
|
1
|
+
(function(_0x284f41,_0x383e1c){const _0x259c8d=_0x388a,_0x25d891=_0x284f41();while(!![]){try{const _0x307d83=parseInt(_0x259c8d(0x1c0))/0x1+parseInt(_0x259c8d(0x1a7))/0x2*(parseInt(_0x259c8d(0x1b9))/0x3)+parseInt(_0x259c8d(0x176))/0x4*(parseInt(_0x259c8d(0x1ac))/0x5)+parseInt(_0x259c8d(0x1b6))/0x6+parseInt(_0x259c8d(0x17a))/0x7*(-parseInt(_0x259c8d(0x196))/0x8)+parseInt(_0x259c8d(0x18a))/0x9*(-parseInt(_0x259c8d(0x1b0))/0xa)+-parseInt(_0x259c8d(0x15e))/0xb;if(_0x307d83===_0x383e1c)break;else _0x25d891['push'](_0x25d891['shift']());}catch(_0x5aeb69){_0x25d891['push'](_0x25d891['shift']());}}}(_0x47ba,0xe3676));import{mkdir,writeFile,readFile,readdir,unlink,rm,mkdtemp,rename}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0xb212f4 from'inquirer';import{chromium}from'playwright';import{findExistingEnv,loadSettings}from'./utils/settings.js';import{encrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';function _0x47ba(){const _0x25d38c=['Continue\x20anyway','\x22\x20already\x20exists.\x20Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20profile\x20first.','LrlSt','SEATr','VFKnr','test','isElectron','auth.json','356512omZtGU','XBRen','user','\x0a๐\x20CDP\x20Profile\x20Setup\x0a','Saving\x20authentication\x20state...','\x20(continuing\x20with\x20--force)','\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.','signal','keNHN','baseUrl','YIJkc','fhOpK','\x22.\x20Expected\x20\x22Name:\x20Value\x22.','Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','\x0a๐\x20Profile\x20Setup\x0a','--disable-features=WebBluetooth','user_declined','44606doUvga','uYAvT','\x0a\x20\x20Still\x20could\x20not\x20reach\x20','NODE_TLS_REJECT_UNAUTHORIZED','error','1455xZffcv','force','setupHeader','log','130fpXUfS','allowInsecureLocalhost','Warning:\x20Could\x20not\x20remove\x20old\x20profile\x20at\x20','LeCoV','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','โ \x20Could\x20not\x20reach\x20','5135754wWPNLR','Removed\x20existing\x20profile\x20at\x20','oLkKG','51vFCfVV','off','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','trackPhaseEnd','\x20\x20\x20Creating\x20it\x20in\x20','trackPhaseStart','No\x20auth\x20env\x20matches\x20this\x20URL.\x20Creating\x20local\x20profile.','894486gbAkzm','env','utf-8','VEExW','browser_auth','rGWLN','isTTY','JDupF','FbZrm','nMjae','dCcvl','local','assign','config_write','goto','fDHjH','location','url_setup','launch','Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.','BBsxf','environments','NBcBu','startsWith','url','http://localhost:3000','\x20--skip-auth\x20\x20\x20\x20(skip\x20browser\x20auth\x20entirely)\x0a','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','What\x20would\x20you\x20like\x20to\x20do?','.tmp-','http://','18224921hlzkIa','\x20would\x20shadow\x20the\x20existing\x20profile.','SkART','wyePx','Delete\x20existing\x20and\x20create\x20new\x20in\x20','shouldReplace','yes','confirm','extraHTTPHeaders','prompt','OpdQK','oQnvg','\x0a\x20\x20Profile\x20\x22','Profile\x20\x22','profile.add.autoRouteSkipped','--allow-insecure-localhost','cdpEndpoint','ngmed','storageState','\x0aโ ๏ธ\x20\x20Profile\x20\x22','\x22\x20already\x20exists.\x20Overwrite?','Warning:\x20Could\x20not\x20remove\x20old\x20profile\x20backup\x20at\x20','path','.backup-','9304BAegWL','stdin','length','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','28rFOaDY','catch','safeMode','\x20\x20Could\x20not\x20reach\x20Ranger\x20API\x20to\x20create\x20a\x20cloud\x20profile\x20(','\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20','keys','XcYWE','HhuYI','no_auth_config','slice','message','\x20\x20Next:\x20RANGER_TEST_USERNAME=...\x20RANGER_TEST_PASSWORD=...\x20ranger\x20go\x20--profile\x20','jDjHH','skipAuth','profile.add.autoRouted','overwrite','27657zeEJHr','Please\x20provide\x20--url\x20when\x20running\x20in\x20non-interactive\x20mode.\x0aMake\x20sure\x20the\x20service\x20is\x20running\x20on\x20that\x20port\x20before\x20retrying.\x0aExample:\x20ranger\x20profile\x20add\x20local\x20--url\x20http://localhost:3000','\x0a\x20\x20(domains:\x20','continue'];_0x47ba=function(){return _0x25d38c;};return _0x47ba();}import{writeActiveProfileName}from'./utils/activeProfile.js';import{addProfileSetupBanner}from'./utils/profileSetupBanner.js';import{fetchAuthConfig,createCloudProfile,ApiError}from'./utils/cloudProfile.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{isPathGitTracked}from'./utils/gitTracked.js';async function checkUrlReachability(_0x29e694){const _0x153624=_0x388a,_0xeff23b={'HvDPK':'HEAD','hdTLh':function(_0x51f8e0,_0x395027){return _0x51f8e0<_0x395027;},'TESkv':'Invalid\x20URL','hTFgA':'TypeError','uaNpZ':'fetch\x20failed'};try{const _0x4a5c81=new AbortController(),_0x34a09b=setTimeout(()=>_0x4a5c81['abort'](),0x1388),_0x1d2e19={'method':_0xeff23b['HvDPK'],'signal':_0x4a5c81[_0x153624(0x19d)],'redirect':'manual'};/^https:\/\/localhost(:\d+)?/i['test'](_0x29e694)&&(process['env'][_0x153624(0x1aa)]='0');const _0x39fead=await fetch(_0x29e694,_0x1d2e19);delete process[_0x153624(0x1c1)]['NODE_TLS_REJECT_UNAUTHORIZED'],clearTimeout(_0x34a09b);if(_0xeff23b['hdTLh'](_0x39fead['status'],0x190))return{'ok':!![]};return{'ok':![],'error':'HTTP\x20'+_0x39fead['status']};}catch(_0x1c38b5){delete process[_0x153624(0x1c1)]['NODE_TLS_REJECT_UNAUTHORIZED'];const _0x49c63a=_0x1c38b5,_0xabefca=_0x49c63a[_0x153624(0x184)]||String(_0x1c38b5),_0x144a09=_0xabefca['includes'](_0xeff23b['TESkv'])||_0x49c63a['name']===_0xeff23b['hTFgA']||_0xabefca['includes'](_0xeff23b['uaNpZ']);return{'ok':![],'error':_0xabefca,'isProtocolError':_0x144a09};}}async function sweepOrphanLocalProfile(_0x3f81ef,_0x1c3508,_0x30ff0b){const _0x28e750=_0x388a,_0x2b0dd1={'XBRen':_0x28e750(0x14a),'QZMZj':function(_0x54bfc,_0x538a33){return _0x54bfc(_0x538a33);},'uMTHR':function(_0x48f422,_0x4af949){return _0x48f422(_0x4af949);}},_0x5d9629=join(_0x1c3508,_0x2b0dd1[_0x28e750(0x197)]),_0x415f35=join(_0x5d9629,_0x3f81ef);_0x2b0dd1['QZMZj'](existsSync,_0x415f35)&&(_0x30ff0b&&await _0x2b0dd1['uMTHR'](isPathGitTracked,_0x415f35)?console[_0x28e750(0x1af)]('\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20'+_0x415f35+'\x20โ\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.'):(await rm(_0x415f35,{'recursive':!![],'force':!![]}),console[_0x28e750(0x1af)]('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0x415f35)));if(existsSync(_0x5d9629)){let _0x4d2772=[];try{_0x4d2772=await readdir(_0x5d9629);}catch{return;}const _0x45d610='.tmp-'+_0x3f81ef+'-';for(const _0x3d49a9 of _0x4d2772){if(!_0x3d49a9['startsWith'](_0x45d610))continue;const _0x57b3e2=join(_0x5d9629,_0x3d49a9);await rm(_0x57b3e2,{'recursive':!![],'force':!![]}),console[_0x28e750(0x1af)](_0x28e750(0x1bb)+_0x57b3e2);}}}function _0x388a(_0x370c49,_0x2d6c87){_0x370c49=_0x370c49-0x149;const _0x47baca=_0x47ba();let _0x388a4a=_0x47baca[_0x370c49];return _0x388a4a;}async function tryAutoRouteCloudProfile(_0x5a5304,_0x5a439d,_0x549788,_0x2ecd9f,_0x2a7620){const _0x2d6171=_0x388a,_0x4ec078={'lcTpy':'profile.add.autoRouteSkipped','VFKnr':'no_auth_config','BBsxf':function(_0x3860d9,_0x38845e,_0x5bb02d){return _0x3860d9(_0x38845e,_0x5bb02d);},'NycVb':'saveToCloud','HsxgO':function(_0x145c56,_0x153de2){return _0x145c56===_0x153de2;},'DoDSt':function(_0x3df9d3,_0x476da1,_0x1f8450,_0x3b977f){return _0x3df9d3(_0x476da1,_0x1f8450,_0x3b977f);},'FbZrm':function(_0x36b92f){return _0x36b92f();},'ypaDZ':function(_0x13e892,_0xcdd706){return _0x13e892!==_0xcdd706;},'rSKHI':function(_0xab108d,_0x45329a){return _0xab108d instanceof _0x45329a;},'ZocLR':_0x2d6171(0x188)};let _0x2e88a2;try{_0x2e88a2=await fetchAuthConfig();}catch{return _0x2a7620?.[_0x2d6171(0x1bc)]('profile.add.autoRouteSkipped',{'reason':_0x2d6171(0x182),'profileName':_0x5a5304}),![];}if(!_0x2e88a2||!_0x2e88a2[_0x2d6171(0x154)]||Object[_0x2d6171(0x17f)](_0x2e88a2[_0x2d6171(0x154)])['length']===0x0)return _0x2a7620?.['trackPhaseEnd'](_0x4ec078['lcTpy'],{'reason':_0x4ec078[_0x2d6171(0x192)],'profileName':_0x5a5304}),![];const _0x41b3e2=_0x4ec078[_0x2d6171(0x153)](matchAuthEnvironment,_0x5a439d,_0x2e88a2);if(!_0x41b3e2)return console['log'](_0x2d6171(0x1bf)),_0x2a7620?.[_0x2d6171(0x1bc)](_0x2d6171(0x16c),{'reason':'no_match','profileName':_0x5a5304}),![];const _0x3674bf=_0x2e88a2[_0x2d6171(0x154)][_0x41b3e2],_0x29b6d8=_0x3674bf?.['domains']??[];if(_0x2ecd9f&&!_0x549788[_0x2d6171(0x164)]){const {saveToCloud:_0x3d3ffd}=await _0xb212f4['prompt']([{'type':'confirm','name':_0x4ec078['NycVb'],'message':'Found\x20auth\x20environment\x20\x27'+_0x41b3e2+'\x27\x20matching\x20'+_0x5a439d+_0x2d6171(0x18c)+_0x29b6d8['join'](',\x20')+')\x0a\x20\x20Save\x20\x27'+_0x5a5304+'\x27\x20to\x20the\x20cloud?','default':!![]}]);if(!_0x3d3ffd)return _0x2a7620?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':_0x2d6171(0x1a6),'profileName':_0x5a5304}),![];}const _0x2cebfe=_0x29b6d8['some'](_0x4ec450=>{try{return new URL(_0x4ec450)['origin']===new URL(_0x5a439d)['origin'];}catch{return![];}}),_0x561d5a={};!_0x2cebfe&&(_0x561d5a['baseUrl']=_0x5a439d);try{await createCloudProfile(_0x5a5304,_0x41b3e2,{'settings':_0x561d5a});}catch(_0x2893f3){if(_0x2893f3 instanceof ApiError&&_0x4ec078['HsxgO'](_0x2893f3['status'],0x199)){console['error']('\x0a\x20\x20A\x20cloud\x20profile\x20named\x20\x22'+_0x5a5304+_0x2d6171(0x18f));throw _0x2893f3;}return console['log'](_0x2d6171(0x17d)+(_0x2893f3 instanceof Error?_0x2893f3[_0x2d6171(0x184)]:String(_0x2893f3))+').\x20Falling\x20back\x20to\x20local\x20profile.'),_0x2a7620?.[_0x2d6171(0x1bc)](_0x4ec078['lcTpy'],{'reason':_0x2d6171(0x182),'profileName':_0x5a5304}),![];}console['log']('โ\x20Cloud\x20profile\x20\x27'+_0x5a5304+'\x27\x20created,\x20linked\x20to\x20env\x20\x27'+_0x41b3e2+'\x27.\x0a'+(_0x2d6171(0x185)+_0x5a5304));try{await _0x4ec078['DoDSt'](sweepOrphanLocalProfile,_0x5a5304,getRangerHomeDir(),![]);const _0x2c0d57=_0x4ec078[_0x2d6171(0x1c8)](getRangerDir);_0x4ec078['ypaDZ'](_0x2c0d57,getRangerHomeDir())&&await sweepOrphanLocalProfile(_0x5a5304,_0x2c0d57,!![]);}catch(_0x409074){console[_0x2d6171(0x1af)]('\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20('+(_0x4ec078['rSKHI'](_0x409074,Error)?_0x409074['message']:String(_0x409074))+').');}return _0x2a7620?.[_0x2d6171(0x1bc)](_0x4ec078['ZocLR'],{'envKey':_0x41b3e2,'profileName':_0x5a5304}),!![];}export async function addEnv(_0x2dfc8b,_0x3a96ef={},_0xa22274){const _0x471767=_0x388a,_0x455d5c={'BnLZi':_0x471767(0x14a),'onjgh':_0x471767(0x198),'uksto':function(_0x3ad179){return _0x3ad179();},'IHnuT':function(_0x23f719,_0xf4ff25,_0x11d2b8,_0x272dc5){return _0x23f719(_0xf4ff25,_0x11d2b8,_0x272dc5);},'VEExW':function(_0x5ca49f,_0x593b3d,_0x57ba82){return _0x5ca49f(_0x593b3d,_0x57ba82);},'YUebN':function(_0x1f05cb,_0x57712a){return _0x1f05cb===_0x57712a;},'irlYi':'--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','JSwpO':'--ci\x20and\x20--cdp-endpoint\x20cannot\x20be\x20used\x20together.\x20Electron/CDP\x20profiles\x20only\x20work\x20with\x20a\x20locally\x20running\x20app\x20and\x20are\x20not\x20supported\x20in\x20CI.','NBcBu':function(_0x7e4dbe,_0x449747){return _0x7e4dbe(_0x449747);},'WVCPD':_0x471767(0x18b),'HGufM':function(_0x2334e8,_0x58de8c,_0xe6aadf,_0x2aea40,_0xab70f1,_0x15b8c9){return _0x2334e8(_0x58de8c,_0xe6aadf,_0x2aea40,_0xab70f1,_0x15b8c9);},'hulpm':'confirm','nPKXQ':_0x471767(0x189),'JDupF':'Aborted.','HhuYI':'legacy','DmwXK':_0x471767(0x163),'rGWLN':_0x471767(0x1a4),'fDHjH':_0x471767(0x179),'ngmed':'\x20\x20Ranger\x20will\x20open\x20it\x20in\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20and\x20save\x20your\x20session.\x0a','nGLhN':_0x471767(0x1b4),'HntAt':_0x471767(0x158),'LeCoV':function(_0x27e1a6,_0x27e828){return _0x27e1a6(_0x27e828);},'YIJkc':'list','Nrqxf':'action','fhOpK':'use_suggestion','SKxJE':_0x471767(0x18e),'oLkKG':function(_0x3c465a,_0x292d57){return _0x3c465a(_0x292d57);},'oqYpP':_0x471767(0x150),'LrlSt':function(_0x1153ed,_0x364f8e,_0x358246){return _0x1153ed(_0x364f8e,_0x358246);},'nMjae':function(_0x2b3d64,_0x25089a,_0x2d11ad){return _0x2b3d64(_0x25089a,_0x2d11ad);},'XcYWE':'\x0a๐\x20Authentication\x20Setup','jDjHH':'\x20\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20to\x20the\x20profile\x20you\x20want\x20to\x20test\x20so\x20Ranger\x20can\x20access\x20it.','mVMbt':'\x0a\x20\x20\x20โ \x20This\x20step\x20requires\x20human\x20interaction\x20in\x20a\x20browser.','SkART':'\x20\x20\x20If\x20you\x20are\x20an\x20agent,\x20background\x20this\x20process\x20and\x20let\x20your\x20user\x20know\x20they\x20need\x20to\x20complete\x20browser\x20authentication.\x0a','oQnvg':function(_0x301895,_0x38df99){return _0x301895>_0x38df99;},'SEATr':'\x0aThe\x20browser\x20closed\x20unexpectedly\x20before\x20authentication\x20could\x20be\x20saved.','dCcvl':'This\x20can\x20happen\x20due\x20to\x20a\x20browser\x20compatibility\x20issue\x20on\x20some\x20systems.\x0a','wyePx':_0x471767(0x15a),'OpdQK':'\x20\x20Could\x20not\x20encrypt:\x20No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]','uJNvg':function(_0x48e6b8,_0x11f084,_0x493dfc){return _0x48e6b8(_0x11f084,_0x493dfc);},'uYAvT':function(_0x353998,_0x1b2162){return _0x353998+_0x1b2162;},'NxKNq':_0x471767(0x19c),'lpQGT':function(_0x3833ac,_0x484478){return _0x3833ac>_0x484478;},'QcKfW':function(_0x50652d,_0x49f222,_0x8867ac){return _0x50652d(_0x49f222,_0x8867ac);},'Wqsdn':'settings.json','keNHN':function(_0x4a2117,_0x339435,_0xfd9bb6){return _0x4a2117(_0x339435,_0xfd9bb6);},'jZuXO':function(_0x4be912,_0xcb10df,_0x18e90e){return _0x4be912(_0xcb10df,_0x18e90e);},'CPKwj':_0x471767(0x152),'nxfas':_0x471767(0x14c),'xFkiT':'SIGINT'},_0x10a9ad=_0x3a96ef['ci']??![],_0x29751d=_0x10a9ad?'ci':_0x455d5c['BnLZi'],_0x3879e2=_0x3a96ef['scope']===_0x455d5c['onjgh']?getRangerHomeDir():_0x455d5c['uksto'](getRangerDir),_0x878a31=_0x455d5c['IHnuT'](join,_0x3879e2,_0x29751d,_0x2dfc8b),_0x4a8af1={};if(_0x3a96ef[_0x471767(0x1ae)])for(const _0x3b44cc of _0x3a96ef[_0x471767(0x1ae)]){const _0x11f2db=_0x3b44cc['indexOf'](':');if(_0x11f2db===-0x1)throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0x3b44cc+_0x471767(0x1a2));const _0x1599b4=_0x3b44cc[_0x471767(0x183)](0x0,_0x11f2db)['trim'](),_0x172ffd=_0x3b44cc['slice'](_0x11f2db+0x1)['trim']();_0x4a8af1[_0x1599b4]=_0x172ffd;}const _0x3d753d=_0x455d5c[_0x471767(0x1c3)](join,_0x3879e2,_0x29751d);if(_0x3a96ef['cdpEndpoint']!==undefined&&_0x455d5c['YUebN'](_0x3a96ef[_0x471767(0x16e)]['trim'](),''))throw new Error(_0x455d5c['irlYi']);if(_0x3a96ef['cdpEndpoint']&&_0x3a96ef[_0x471767(0x157)])throw new Error('--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.');if(_0x3a96ef[_0x471767(0x16e)]&&_0x3a96ef['ci'])throw new Error(_0x455d5c['JSwpO']);const _0x59e6f0=_0x455d5c['NBcBu'](Boolean,_0x3a96ef[_0x471767(0x16e)]),_0x41ba29=!_0x3a96ef['skipAuth']&&!_0x59e6f0,_0x151e99=process[_0x471767(0x177)][_0x471767(0x1c6)]&&process['stdout']['isTTY'];if(!_0x151e99&&!_0x3a96ef[_0x471767(0x157)]&&!_0x59e6f0)throw new Error(_0x455d5c['WVCPD']);if(!_0x10a9ad&&!_0x3a96ef[_0x471767(0x187)]&&!_0x59e6f0&&_0x3a96ef[_0x471767(0x157)]){const _0x52fbfa=await _0x455d5c['HGufM'](tryAutoRouteCloudProfile,_0x2dfc8b,_0x3a96ef['url'],_0x3a96ef,_0x151e99,_0xa22274);if(_0x52fbfa)return;}const _0x5bb030=findExistingEnv(_0x2dfc8b,{'rangerDir':_0x3879e2});let _0x54f6c2=null;if(_0x5bb030){if(!_0x151e99)_0x54f6c2=_0x5bb030;else{if(_0x455d5c['YUebN'](_0x5bb030['location'],_0x29751d)){const {overwrite:_0x11027a}=await _0xb212f4[_0x471767(0x167)]([{'type':_0x455d5c['hulpm'],'name':_0x455d5c['nPKXQ'],'message':_0x471767(0x16b)+_0x2dfc8b+_0x471767(0x172),'default':![]}]);if(!_0x11027a){console['log'](_0x455d5c[_0x471767(0x1c7)]);return;}_0x54f6c2=_0x5bb030;}else{const _0x444e11=_0x5bb030[_0x471767(0x14f)]===_0x455d5c[_0x471767(0x181)]?'root\x20(.ranger/)':_0x5bb030['location'];console[_0x471767(0x1ab)](_0x471767(0x171)+_0x2dfc8b+'\x22\x20already\x20exists\x20in\x20'+_0x444e11+':\x20'+_0x5bb030['path']),console['error'](_0x471767(0x1bd)+_0x29751d+_0x471767(0x15f));const {shouldReplace:_0x391dca}=await _0xb212f4['prompt']([{'type':_0x471767(0x165),'name':_0x455d5c['DmwXK'],'message':_0x471767(0x162)+_0x29751d+'?','default':![]}]);if(!_0x391dca){console[_0x471767(0x1af)](_0x455d5c[_0x471767(0x1c7)]);return;}_0x54f6c2=_0x5bb030;}}}_0xa22274?.[_0x471767(0x1be)]('url_setup');let _0x4ee169='';if(_0x59e6f0)console['log'](_0x471767(0x199)),console[_0x471767(0x1af)](_0x471767(0x17e)+_0x3a96ef['cdpEndpoint']),console['log']('\x20\x20Make\x20sure\x20your\x20Electron\x20app\x20(or\x20browser)\x20is\x20running\x20with\x20remote\x20debugging\x20enabled.\x0a');else{if(_0x3a96ef['url']){_0x4ee169=_0x3a96ef['url'];const _0x48f3e4=await checkUrlReachability(_0x4ee169);if(!_0x48f3e4['ok']&&!_0x3a96ef[_0x471767(0x1ad)])throw new Error('Could\x20not\x20reach\x20'+_0x4ee169+':\x20'+_0x48f3e4['error']+'\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.');!_0x48f3e4['ok']&&_0x3a96ef['force']&&console['log'](_0x471767(0x1b5)+_0x4ee169+':\x20'+_0x48f3e4['error']+_0x471767(0x19b));}else{console['log'](_0x455d5c[_0x471767(0x1c5)]),console[_0x471767(0x1af)](_0x455d5c[_0x471767(0x14e)]),console[_0x471767(0x1af)](_0x455d5c[_0x471767(0x16f)]);let _0x270d95=![];while(!![]){const _0x4c9cbc=await _0xb212f4[_0x471767(0x167)]([{'type':'input','name':'baseUrl','message':_0x270d95?_0x471767(0x1a3):_0x455d5c['nGLhN'],'default':_0x4ee169||_0x455d5c['HntAt']}]);_0x4ee169=_0x4c9cbc[_0x471767(0x19f)];const _0x3d7053=await _0x455d5c[_0x471767(0x1b3)](checkUrlReachability,_0x4ee169);if(_0x3d7053['ok'])break;const _0x1dfa8a=/^[a-zA-Z][\w+.-]*:\/\//[_0x471767(0x193)](_0x4ee169),_0x6c1434=_0x3d7053['isProtocolError']&&!_0x1dfa8a,_0x135ee3=_0x6c1434?_0x471767(0x15d)+_0x4ee169:null;_0x270d95=!![],console[_0x471767(0x1af)]('\x0a\x20\x20Could\x20not\x20reach\x20'+_0x4ee169+':\x20'+_0x3d7053[_0x471767(0x1ab)]);_0x135ee3&&console['log']('\x20\x20Did\x20you\x20mean\x20'+_0x135ee3+'?');const {action:_0x31043c}=await _0xb212f4['prompt']([{'type':_0x455d5c[_0x471767(0x1a0)],'name':_0x455d5c['Nrqxf'],'message':_0x471767(0x15b),'choices':[..._0x135ee3?[{'name':'Use\x20'+_0x135ee3,'value':_0x455d5c[_0x471767(0x1a1)]}]:[],{'name':'Enter\x20a\x20different\x20URL','value':'retry'},{'name':_0x455d5c['SKxJE'],'value':_0x471767(0x18d)}]}]);if(_0x31043c==='use_suggestion'&&_0x135ee3){_0x4ee169=_0x135ee3;const _0x478569=await _0x455d5c['oLkKG'](checkUrlReachability,_0x4ee169);if(_0x478569['ok'])break;console['log'](_0x471767(0x1a9)+_0x4ee169+':\x20'+_0x478569['error']);}else{if(_0x455d5c['YUebN'](_0x31043c,_0x471767(0x18d)))break;}}}}_0xa22274?.[_0x471767(0x1bc)](_0x455d5c['oqYpP']);const _0x3d4831={};if(_0x54f6c2){const _0xeee565=await _0x455d5c[_0x471767(0x1b8)](loadSettings,_0x2dfc8b);Object[_0x471767(0x14b)](_0x3d4831,_0xeee565['setupHeaders']);}Object[_0x471767(0x14b)](_0x3d4831,_0x4a8af1),await _0x455d5c['VEExW'](mkdir,_0x3d753d,{'recursive':!![]});try{const _0x4ce033=await readdir(_0x3d753d),_0xf2dd4c=_0x471767(0x15c)+_0x2dfc8b+'-';for(const _0x43768e of _0x4ce033){_0x43768e[_0x471767(0x156)](_0xf2dd4c)&&await _0x455d5c[_0x471767(0x190)](rm,_0x455d5c[_0x471767(0x1c3)](join,_0x3d753d,_0x43768e),{'recursive':!![],'force':!![]});}}catch{}const _0x4dadd4=await mkdtemp(join(_0x3d753d,'.tmp-'+_0x2dfc8b+'-')),_0x187e8a=_0x455d5c[_0x471767(0x1c9)](join,_0x4dadd4,_0x471767(0x195)),_0x1f0a19=()=>{const _0x272e8d=_0x471767;rm(_0x4dadd4,{'recursive':!![],'force':!![]})[_0x272e8d(0x17b)](()=>{})['finally'](()=>{process['exit'](0x82);});};process['once']('SIGINT',_0x1f0a19);const _0x57248=_0x455d5c['LeCoV'](Boolean,_0x4ee169)&&/^https:\/\/localhost(:\d+)?/i[_0x471767(0x193)](_0x4ee169);try{if(_0x41ba29){_0xa22274?.[_0x471767(0x1be)](_0x471767(0x1c4)),console[_0x471767(0x1af)](_0x455d5c[_0x471767(0x180)]),console[_0x471767(0x1af)](_0x455d5c[_0x471767(0x186)]),console[_0x471767(0x1af)]('\x20\x20\x20When\x20done\x20logging\x20in,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.');!_0x151e99?(console[_0x471767(0x1af)](_0x455d5c['mVMbt']),console['log'](_0x455d5c[_0x471767(0x160)])):console[_0x471767(0x1af)]('');await new Promise(_0x1dabb=>setTimeout(_0x1dabb,0xbb8));const _0x5754bf=[];_0x3a96ef[_0x471767(0x17c)]&&_0x5754bf['push'](_0x471767(0x1a5));const _0x4eda3e=_0x3a96ef['allowInsecureLocalhost']||_0x57248;_0x4eda3e&&_0x5754bf['push'](_0x471767(0x16d));const _0x4cbadd=await chromium[_0x471767(0x151)]({'headless':![],..._0x455d5c[_0x471767(0x169)](_0x5754bf[_0x471767(0x178)],0x0)?{'args':_0x5754bf}:{}});try{const _0x41f147=_0x455d5c['oQnvg'](Object[_0x471767(0x17f)](_0x3d4831)['length'],0x0),_0x17c0d9={'ignoreHTTPSErrors':!![]};_0x41f147&&(_0x17c0d9[_0x471767(0x166)]=_0x3d4831);const _0x393ef5=await _0x4cbadd['newContext'](_0x17c0d9);await addProfileSetupBanner(_0x393ef5);const _0x5dd1d0=await _0x393ef5['newPage']();await _0x5dd1d0[_0x471767(0x14d)](_0x4ee169||'about:blank');let _0x471b58=![];await new Promise(_0x364ce8=>{const _0x259f54={'QuFbB':function(_0x4a921d){return _0x4a921d();}};_0x5dd1d0['on']('close',async()=>{const _0xb56ce2=_0x388a;try{console['log'](_0xb56ce2(0x19a)),await _0x393ef5[_0xb56ce2(0x170)]({'path':_0x187e8a}),_0x471b58=!![];}catch{}_0x259f54['QuFbB'](_0x364ce8);});});if(!_0x471b58){console[_0x471767(0x1af)](_0x455d5c[_0x471767(0x191)]);!_0x3a96ef[_0x471767(0x17c)]&&(console['log'](_0x455d5c[_0x471767(0x149)]),console['log']('You\x20can\x20try\x20again\x20with\x20one\x20of:'),console[_0x471767(0x1af)]('\x20\x20ranger\x20profile\x20add\x20'+_0x2dfc8b+'\x20--safe-mode\x20\x20\x20\x20(disables\x20browser\x20features\x20that\x20can\x20cause\x20crashes)'),console[_0x471767(0x1af)]('\x20\x20ranger\x20profile\x20add\x20'+_0x2dfc8b+_0x471767(0x159)));throw new Error(_0x455d5c[_0x471767(0x161)]);}}finally{await _0x4cbadd['close']()[_0x471767(0x17b)](()=>{});}if(_0x10a9ad){const _0x895b69=await readFile(_0x187e8a,_0x471767(0x1c2)),_0x376d7b=await getToken();if(!_0x376d7b){console['error'](_0x455d5c[_0x471767(0x168)]),await _0x455d5c['LeCoV'](unlink,_0x187e8a)['catch'](()=>{});throw new Error('Missing\x20API\x20token;\x20aborting\x20CI\x20profile\x20creation.');}else{const _0x4f83d2=_0x455d5c['uJNvg'](encrypt,_0x895b69,_0x376d7b);await writeFile(_0x455d5c[_0x471767(0x1a8)](_0x187e8a,'.enc'),_0x4f83d2),await unlink(_0x187e8a),console[_0x471767(0x1af)]('โ\x20Encrypted\x20auth\x20saved\x20to:\x20'+_0x187e8a+'.enc'),console['log'](_0x455d5c['NxKNq']),console['log']('\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.');}}else console[_0x471767(0x1af)]('โ\x20Auth\x20state\x20saved\x20to:\x20'+_0x187e8a);_0xa22274?.[_0x471767(0x1bc)](_0x471767(0x1c4));}_0xa22274?.[_0x471767(0x1be)](_0x471767(0x14c));const _0x168af6={};_0x4ee169&&(_0x168af6['baseUrl']=_0x4ee169);_0x3a96ef['cdpEndpoint']&&(_0x168af6[_0x471767(0x16e)]=_0x3a96ef[_0x471767(0x16e)],_0x168af6[_0x471767(0x194)]=!![]);(_0x3a96ef[_0x471767(0x1b1)]||_0x57248)&&(_0x168af6['allowInsecureLocalhost']=!![]);_0x3a96ef['safeMode']&&(_0x168af6['safeMode']=!![]);_0x455d5c['lpQGT'](Object[_0x471767(0x17f)](_0x3d4831)['length'],0x0)&&(_0x168af6['setupHeaders']=_0x3d4831);await _0x455d5c['QcKfW'](writeFile,join(_0x4dadd4,_0x455d5c['Wqsdn']),JSON['stringify'](_0x168af6,null,0x2)),console['log']('โ\x20Created\x20settings:\x20'+join(_0x878a31,_0x455d5c['Wqsdn']));if(_0x54f6c2?.['location']===_0x29751d){const _0x51dcb1=_0x54f6c2['path']+_0x471767(0x175)+Date['now']();await rename(_0x54f6c2['path'],_0x51dcb1);try{await _0x455d5c[_0x471767(0x19e)](rename,_0x4dadd4,_0x878a31);}catch(_0x2b7e22){await rename(_0x51dcb1,_0x54f6c2['path']);throw _0x2b7e22;}try{await _0x455d5c['keNHN'](rm,_0x51dcb1,{'recursive':!![]});}catch{console['log'](_0x471767(0x173)+_0x51dcb1);}}else{await _0x455d5c['jZuXO'](rename,_0x4dadd4,_0x878a31);if(_0x54f6c2)try{await rm(_0x54f6c2[_0x471767(0x174)],{'recursive':!![]}),console['log'](_0x471767(0x1b7)+_0x54f6c2[_0x471767(0x174)]);}catch{console['log'](_0x471767(0x1b2)+_0x54f6c2['path']);}}try{await _0x455d5c[_0x471767(0x155)](writeActiveProfileName,_0x2dfc8b),console[_0x471767(0x1af)]('\x20\x20Set\x20active\x20profile:\x20'+_0x2dfc8b);}catch{console['log'](_0x455d5c['CPKwj']);}_0xa22274?.[_0x471767(0x1bc)](_0x455d5c['nxfas']),console[_0x471767(0x1af)](_0x471767(0x16a)+_0x2dfc8b+'\x22\x20configured');}catch(_0x238b74){await rm(_0x4dadd4,{'recursive':!![],'force':!![]});throw _0x238b74;}finally{process[_0x471767(0x1ba)](_0x455d5c['xFkiT'],_0x1f0a19);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x28d36b,_0x418691){const _0x147476=_0x3ced,_0x568a10=_0x28d36b();while(!![]){try{const _0x5b26c3=-parseInt(_0x147476(0x73))/0x1+parseInt(_0x147476(0x6b))/0x2*(-parseInt(_0x147476(0x72))/0x3)+parseInt(_0x147476(0x77))/0x4*(-parseInt(_0x147476(0x7c))/0x5)+parseInt(_0x147476(0x7d))/0x6+-parseInt(_0x147476(0x75))/0x7+parseInt(_0x147476(0x6f))/0x8+-parseInt(_0x147476(0x6d))/0x9*(-parseInt(_0x147476(0x6e))/0xa);if(_0x5b26c3===_0x418691)break;else _0x568a10['push'](_0x568a10['shift']());}catch(_0xeff877){_0x568a10['push'](_0x568a10['shift']());}}}(_0x2289,0xe2157));import{readFile,writeFile}from'fs/promises';import{join}from'path';function _0x3ced(_0x446fed,_0x1faf8f){_0x446fed=_0x446fed-0x6b;const _0x228972=_0x2289();let _0x3ceded=_0x228972[_0x446fed];return _0x3ceded;}import{existsSync}from'fs';import{encrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{getEnvDir}from'./utils/settings.js';export async function authEncrypt(_0x15d848){const _0x21f470=_0x3ced,_0x19d4c0={'UfYkk':function(_0x1145e4,_0x21edcd){return _0x1145e4(_0x21edcd);},'ADkTy':function(_0x37fa30,_0x2febac,_0x406d4b){return _0x37fa30(_0x2febac,_0x406d4b);},'DXcHf':_0x21f470(0x78),'EtHpV':_0x21f470(0x74),'vUIZI':function(_0x322e67,_0x5babd6){return _0x322e67(_0x5babd6);},'cEWiN':function(_0x9ce0aa){return _0x9ce0aa();},'FwcuL':'utf-8'},_0x23c3a7=_0x19d4c0[_0x21f470(0x71)](getEnvDir,_0x15d848),_0x4695e9=_0x19d4c0['ADkTy'](join,_0x23c3a7,_0x19d4c0[_0x21f470(0x6c)]),_0x4ba541=_0x4695e9+_0x19d4c0[_0x21f470(0x70)];if(!_0x19d4c0['UfYkk'](existsSync,_0x23c3a7))throw new Error(_0x21f470(0x7a)+_0x15d848+_0x21f470(0x7e)+_0x15d848);if(!_0x19d4c0[_0x21f470(0x7b)](existsSync,_0x4695e9))throw new Error('No\x20auth.json\x20found\x20at\x20'+_0x4695e9+'.\x20Run\x20first:\x20ranger\x20profile\x20add\x20with\x20authentication,\x20or\x20ranger\x20profile\x20update');const _0x22b4ff=await _0x19d4c0[_0x21f470(0x7f)](getToken);if(!_0x22b4ff)throw new Error('No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]');const _0x3305b2=await readFile(_0x4695e9,_0x19d4c0['FwcuL']),_0x555bca=encrypt(_0x3305b2,_0x22b4ff);await writeFile(_0x4ba541,_0x555bca),console['log']('\x0aโ\x20Encrypted\x20auth\x20saved\x20to:\x20'+_0x4ba541),console[_0x21f470(0x76)]('\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.'),console[_0x21f470(0x76)](_0x21f470(0x79)),_0x19d4c0[_0x21f470(0x7b)](existsSync,_0x4ba541)&&(console['log']('\x0a\x20\x20The\x20plaintext\x20auth.json\x20is\x20gitignored\x20for\x20security.'),console[_0x21f470(0x76)]('\x20\x20The\x20encrypted\x20auth.json.enc\x20can\x20be\x20committed.'));}function _0x2289(){const _0x4dcf5e=['4cMKiYO','DXcHf','9TCEwKm','39685840gLfNWO','101224XJKZRO','EtHpV','UfYkk','2265414OiQsKw','1160017SNTnWS','.enc','2526825PDMAvJ','log','188NQoizh','auth.json','\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.','Profile\x20\x22','vUIZI','195650azOUDQ','10891080nYAFRy','\x22\x20not\x20found.\x20Run\x20first:\x20ranger\x20profile\x20add\x20','cEWiN'];_0x2289=function(){return _0x4dcf5e;};return _0x2289();}
|
package/build/commands/clean.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x4e87a6=_0x1610;function _0x12b4(){const _0x17ee0c=['PQtGP','error','\x0aโ
\x20Cleanup\x20complete!\x0a','โ\x20Removed\x20stored\x20credentials','twbYq','RDqnb','fqRxb','user','opencode.json','โ\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)','taTHC','plugin','2849718XrtLKu','close','HSfMl','jGyCU','claude','ignore','hGNON','isArray','2895220masudM','filter','SQrNQ','replace','--scope','length','log','771064adNuvq','3108012tkVSCJ','marketplace','trailhead','kxeuB','โ\x20Removed\x20project\x20skill:\x20','SMVKo','5879990ahZjQS','โ\x20Removed\x20OpenCode\x20project\x20skill:\x20','mbHBN','win32','WHpWJ','@ranger-testing/opencode-plugin','JfeyI','fXElV','project','INFex','ueyyb','iSSPU','wGqXM','โ\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)','remove','28211SBXFjC','parse','lphyh','string','18332608JaaPeW','โ\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)'];_0x12b4=function(){return _0x17ee0c;};return _0x12b4();}(function(_0x3790ef,_0x249ba0){const _0x48d4f3=_0x1610,_0x33da22=_0x3790ef();while(!![]){try{const _0x55e3e4=parseInt(_0x48d4f3(0xbe))/0x1+-parseInt(_0x48d4f3(0xd8))/0x2+parseInt(_0x48d4f3(0xa9))/0x3+parseInt(_0x48d4f3(0xa8))/0x4+-parseInt(_0x48d4f3(0xaf))/0x5+-parseInt(_0x48d4f3(0xd0))/0x6+parseInt(_0x48d4f3(0xc2))/0x7;if(_0x55e3e4===_0x249ba0)break;else _0x33da22['push'](_0x33da22['shift']());}catch(_0x4061dd){_0x33da22['push'](_0x33da22['shift']());}}}(_0x12b4,0xbdc94));import{rm,readFile,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{spawn}from'child_process';import{deleteAllCredentials}from'./utils/keychain.js';import{getProjectRoot,getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getCacheFile}from'./utils/sessionCache.js';import{getOpencodeConfigDir,getOpencodeSkillsDir}from'./utils/opencodeConfig.js';const skillsToRemove=['ranger','feature-tracker','bug-bash','e2e-test-recommender'],opencodePluginName=_0x4e87a6(0xb4);function parseJsonc(_0x186e2b){const _0x14778a=_0x4e87a6,_0x454843=_0x186e2b[_0x14778a(0xdb)](/\/\*[\s\S]*?\*\//g,''),_0x299f59=_0x454843['replace'](/^\s*\/\/.*$/gm,''),_0x9a4253=_0x299f59['replace'](/,\s*([}\]])/g,'$1');return JSON[_0x14778a(0xbf)](_0x9a4253);}async function removeOpencodePluginConfig(_0x560b9d){const _0x2643c9=_0x4e87a6,_0x537068={'lphyh':function(_0x259f95,_0x4f5520){return _0x259f95!==_0x4f5520;},'jGyCU':function(_0x1af0ba,_0x17ad0e,_0x31d24e){return _0x1af0ba(_0x17ad0e,_0x31d24e);},'JfeyI':function(_0x597e1c,_0x6fbd0e){return _0x597e1c===_0x6fbd0e;}};if(!existsSync(_0x560b9d))return![];let _0x473039;try{const _0x54b629=await _0x537068[_0x2643c9(0xd3)](readFile,_0x560b9d,'utf-8');_0x473039=parseJsonc(_0x54b629);}catch{return![];}const _0x29e65c=Array[_0x2643c9(0xd7)](_0x473039['plugin'])?_0x473039['plugin']:[];if(_0x29e65c[_0x2643c9(0xa6)]===0x0)return![];const _0x473ca2=_0x29e65c[_0x2643c9(0xd9)](_0x145dbb=>{const _0x54531a=_0x2643c9;if(_0x537068[_0x54531a(0xc0)](typeof _0x145dbb,_0x54531a(0xc1)))return!![];return _0x145dbb!==opencodePluginName;});if(_0x537068[_0x2643c9(0xb5)](_0x473ca2[_0x2643c9(0xa6)],_0x29e65c[_0x2643c9(0xa6)]))return![];return _0x473ca2['length']===0x0?delete _0x473039['plugin']:_0x473039[_0x2643c9(0xcf)]=_0x473ca2,await writeFile(_0x560b9d,JSON['stringify'](_0x473039,null,0x2)+'\x0a'),!![];}async function uninstallClaudePlugin(_0x35501a){const _0x11d8f2=_0x4e87a6,_0x1165c9={'rgLFT':function(_0x5cdd2e,_0x27b5f3){return _0x5cdd2e===_0x27b5f3;},'taTHC':function(_0x4a4fce,_0xd110fa,_0x3d248e,_0x190838){return _0x4a4fce(_0xd110fa,_0x3d248e,_0x190838);},'wGqXM':'ignore','FTZSq':'close','twbYq':_0x11d8f2(0xc5)};return new Promise(_0x2ade24=>{const _0x235f02=_0x11d8f2,_0x3a300c=[_0x235f02(0xcf),'uninstall','ranger@trailhead'];_0x35501a&&_0x3a300c['push'](_0x235f02(0xdc),_0x35501a);const _0xb6454a=_0x1165c9[_0x235f02(0xce)](spawn,_0x235f02(0xd4),_0x3a300c,{'stdio':[_0x1165c9['wGqXM'],_0x1165c9[_0x235f02(0xbb)],_0x1165c9[_0x235f02(0xbb)]],'cwd':_0x35501a?getProjectRoot():undefined,'shell':_0x1165c9['rgLFT'](process['platform'],_0x235f02(0xb2))});_0xb6454a['on'](_0x1165c9['FTZSq'],_0x4094e7=>{_0x2ade24(_0x1165c9['rgLFT'](_0x4094e7,0x0));}),_0xb6454a['on'](_0x1165c9[_0x235f02(0xc8)],()=>{_0x2ade24(![]);});});}function _0x1610(_0x1c54f0,_0xd6860e){_0x1c54f0=_0x1c54f0-0xa6;const _0x12b48d=_0x12b4();let _0x161079=_0x12b48d[_0x1c54f0];return _0x161079;}async function removeMarketplace(){const _0x114541=_0x4e87a6,_0x56ffdf={'WHpWJ':function(_0x594f92,_0x5d8fc6){return _0x594f92(_0x5d8fc6);},'kxeuB':function(_0x426728,_0x5d51bc,_0x29e0e6,_0xe583e4){return _0x426728(_0x5d51bc,_0x29e0e6,_0xe583e4);},'pUXAy':_0x114541(0xd4),'MTCZK':_0x114541(0xaa),'UNKUJ':'ignore','VeNst':function(_0x2f547d,_0x342ab9){return _0x2f547d===_0x342ab9;},'zlTLI':_0x114541(0xb2),'ZYCvt':'error'};return new Promise(_0x24e238=>{const _0x1eb419=_0x114541,_0x2e4302={'LZEnQ':function(_0x501fab,_0xf07c72){const _0x12b51d=_0x1610;return _0x56ffdf[_0x12b51d(0xb3)](_0x501fab,_0xf07c72);}},_0x3e2878=_0x56ffdf[_0x1eb419(0xac)](spawn,_0x56ffdf['pUXAy'],['plugin',_0x56ffdf['MTCZK'],_0x1eb419(0xbd),_0x1eb419(0xab)],{'stdio':[_0x56ffdf['UNKUJ'],_0x1eb419(0xd5),'ignore'],'shell':_0x56ffdf['VeNst'](process['platform'],_0x56ffdf['zlTLI'])});_0x3e2878['on'](_0x1eb419(0xd1),_0x1fff75=>{_0x2e4302['LZEnQ'](_0x24e238,_0x1fff75===0x0);}),_0x3e2878['on'](_0x56ffdf['ZYCvt'],()=>{_0x24e238(![]);});});}export async function clean(){const _0x4c3fc7=_0x4e87a6,_0x15b346={'nGNlD':'\x0a๐งน\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','mbHBN':_0x4c3fc7(0xc7),'ueyyb':function(_0x4899f3,_0x490f4f){return _0x4899f3(_0x490f4f);},'iSSPU':function(_0x500e8b,_0x5c5a4b,_0x2589fd){return _0x500e8b(_0x5c5a4b,_0x2589fd);},'mjPdV':function(_0xd881fc){return _0xd881fc();},'HSfMl':function(_0x5b8cc7,_0xe7fcd9,_0x4627b3){return _0x5b8cc7(_0xe7fcd9,_0x4627b3);},'SMVKo':function(_0x1b5430,_0x3dad3f){return _0x1b5430(_0x3dad3f);},'PQtGP':function(_0x2dedc8,_0x4b076,_0x579481){return _0x2dedc8(_0x4b076,_0x579481);},'INFex':_0x4c3fc7(0xcb),'RDqnb':function(_0x38701f,_0x3c4ba5,_0x10de89){return _0x38701f(_0x3c4ba5,_0x10de89);},'JqGdZ':function(_0x501031,_0x21d3e8){return _0x501031(_0x21d3e8);},'mhdqb':_0x4c3fc7(0xcc),'SQrNQ':function(_0x5879a1,_0x1607c0){return _0x5879a1(_0x1607c0);},'UsQCs':function(_0x3a013c,_0x8237b0,_0x37acdd){return _0x3a013c(_0x8237b0,_0x37acdd);},'hGNON':_0x4c3fc7(0xbc),'fqRxb':_0x4c3fc7(0xb7),'HNKmr':'โ\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)','fXElV':'โ\x20Removed\x20trailhead\x20marketplace','HhSxw':_0x4c3fc7(0xc6),'KNocM':'Nothing\x20to\x20clean\x20up.\x0a'};console['log'](_0x15b346['nGNlD']);let _0x1a2fa8=![];try{await deleteAllCredentials(),console[_0x4c3fc7(0xa7)](_0x15b346[_0x4c3fc7(0xb1)]),_0x1a2fa8=!![];}catch{}const _0x3d99e8=getCacheFile();existsSync(_0x3d99e8)&&(await _0x15b346[_0x4c3fc7(0xb9)](rm,_0x3d99e8),_0x1a2fa8=!![]);const _0x2b1835=getRangerDir();_0x15b346['ueyyb'](existsSync,_0x2b1835)&&(await _0x15b346[_0x4c3fc7(0xba)](rm,_0x2b1835,{'recursive':!![]}),console['log']('โ\x20Removed\x20.ranger/\x20directory'),_0x1a2fa8=!![]);const _0x2937f5=getProjectSkillsDir();for(const _0x5c38f2 of skillsToRemove){const _0x1b2ff9=join(_0x2937f5,_0x5c38f2);existsSync(_0x1b2ff9)&&(await rm(_0x1b2ff9,{'recursive':!![]}),console[_0x4c3fc7(0xa7)](_0x4c3fc7(0xad)+_0x5c38f2),_0x1a2fa8=!![]);}const _0x261399=_0x15b346['mjPdV'](getUserSkillsDir);for(const _0x244e45 of skillsToRemove){const _0x543dcf=join(_0x261399,_0x244e45);existsSync(_0x543dcf)&&(await _0x15b346['HSfMl'](rm,_0x543dcf,{'recursive':!![]}),console[_0x4c3fc7(0xa7)]('โ\x20Removed\x20user\x20skill:\x20'+_0x244e45),_0x1a2fa8=!![]);}const _0x5c802b=getOpencodeSkillsDir('project');for(const _0x3a6e9d of skillsToRemove){const _0x3e289b=_0x15b346['iSSPU'](join,_0x5c802b,_0x3a6e9d);_0x15b346[_0x4c3fc7(0xae)](existsSync,_0x3e289b)&&(await _0x15b346[_0x4c3fc7(0xc4)](rm,_0x3e289b,{'recursive':!![]}),console[_0x4c3fc7(0xa7)](_0x4c3fc7(0xb0)+_0x3a6e9d),_0x1a2fa8=!![]);}const _0x33d126=getOpencodeSkillsDir(_0x15b346[_0x4c3fc7(0xb8)]);for(const _0x5bd546 of skillsToRemove){const _0x281d30=_0x15b346[_0x4c3fc7(0xc9)](join,_0x33d126,_0x5bd546);existsSync(_0x281d30)&&(await _0x15b346[_0x4c3fc7(0xd2)](rm,_0x281d30,{'recursive':!![]}),console[_0x4c3fc7(0xa7)]('โ\x20Removed\x20OpenCode\x20user\x20skill:\x20'+_0x5bd546),_0x1a2fa8=!![]);}const _0x575c3a=join(_0x15b346['JqGdZ'](getOpencodeConfigDir,_0x4c3fc7(0xb7)),_0x15b346['mhdqb']);await _0x15b346[_0x4c3fc7(0xda)](removeOpencodePluginConfig,_0x575c3a)&&(console[_0x4c3fc7(0xa7)](_0x4c3fc7(0xc3)),_0x1a2fa8=!![]);const _0x3fddc1=_0x15b346['UsQCs'](join,getOpencodeConfigDir(_0x15b346[_0x4c3fc7(0xb8)]),_0x15b346['mhdqb']);await removeOpencodePluginConfig(_0x3fddc1)&&(console[_0x4c3fc7(0xa7)](_0x15b346[_0x4c3fc7(0xd6)]),_0x1a2fa8=!![]);const _0x244489=await uninstallClaudePlugin();_0x244489&&(console['log'](_0x4c3fc7(0xcd)),_0x1a2fa8=!![]);const _0xe99a3d=await uninstallClaudePlugin(_0x15b346[_0x4c3fc7(0xca)]);_0xe99a3d&&(console['log'](_0x15b346['HNKmr']),_0x1a2fa8=!![]);const _0x3ff1ea=await removeMarketplace();_0x3ff1ea&&(console[_0x4c3fc7(0xa7)](_0x15b346[_0x4c3fc7(0xb6)]),_0x1a2fa8=!![]),_0x1a2fa8?console[_0x4c3fc7(0xa7)](_0x15b346['HhSxw']):console['log'](_0x15b346['KNocM']);}
|
package/build/commands/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x537e63=_0x2ea2;(function(_0x2db7b3,_0x58da3f){const _0x477931=_0x2ea2,_0x4fa68b=_0x2db7b3();while(!![]){try{const _0x3d1c15=parseInt(_0x477931(0xae))/0x1+-parseInt(_0x477931(0xac))/0x2*(parseInt(_0x477931(0xc2))/0x3)+-parseInt(_0x477931(0x9f))/0x4*(-parseInt(_0x477931(0x96))/0x5)+-parseInt(_0x477931(0x8f))/0x6*(-parseInt(_0x477931(0xb8))/0x7)+parseInt(_0x477931(0x93))/0x8+parseInt(_0x477931(0xc1))/0x9+-parseInt(_0x477931(0x8e))/0xa;if(_0x3d1c15===_0x58da3f)break;else _0x4fa68b['push'](_0x4fa68b['shift']());}catch(_0x25c61a){_0x4fa68b['push'](_0x4fa68b['shift']());}}}(_0x48b4,0x2d494));import{existsSync}from'fs';import{loadSettings,saveSettings,getNestedValue,setNestedValue,deleteNestedValue,formatSettings,getSettingsPath,getEnvDir}from'./utils/settings.js';import{fetchCloudProfile}from'./utils/cloudProfile.js';import{mergeCloudProfileSettings,readProfileOverrides,resetProfileOverrides,setProfileOverride,unsetProfileOverride}from'./utils/projectsConfig.js';const BOOLEAN_KEYS=[_0x537e63(0xba),_0x537e63(0x9c)];function _0x2ea2(_0x2eaa28,_0x33b3b3){_0x2eaa28=_0x2eaa28-0x8d;const _0x48b40a=_0x48b4();let _0x2ea2c7=_0x48b40a[_0x2eaa28];return _0x2ea2c7;}function parseLocalValue(_0x56f5be,_0x2b7d82){const _0x43d495=_0x537e63,_0x110cf5={'aqnlb':function(_0x14f5d9,_0x4b6642){return _0x14f5d9===_0x4b6642;}};if(BOOLEAN_KEYS[_0x43d495(0x90)](_0x56f5be)){if(_0x110cf5['aqnlb'](_0x2b7d82,'true'))return!![];if(_0x2b7d82===_0x43d495(0xb9))return![];throw new Error('Invalid\x20value\x20for\x20'+_0x56f5be+_0x43d495(0xa5));}return _0x2b7d82;}function parseOverrideValue(_0xad351d){const _0x58b08b=_0x537e63,_0x2ae324={'yCXyD':'true','tmSzw':_0x58b08b(0xb9),'YVniv':_0x58b08b(0xa0),'SZRvD':function(_0x2c5e9d,_0xf90a30){return _0x2c5e9d===_0xf90a30;},'rgjvq':_0x58b08b(0xa1),'MWwFf':function(_0x15cd2d,_0x2fe385){return _0x15cd2d(_0x2fe385);},'kJIvH':function(_0x19677f,_0x10408c){return _0x19677f(_0x10408c);}};if(_0xad351d===_0x2ae324[_0x58b08b(0xbe)])return!![];if(_0xad351d===_0x2ae324['tmSzw'])return![];if(_0xad351d===_0x2ae324[_0x58b08b(0xc3)])return null;if(_0x2ae324[_0x58b08b(0xad)](_0xad351d,_0x2ae324['rgjvq']))return undefined;if(/^-?\d+$/['test'](_0xad351d)){const _0x53b157=_0x2ae324['MWwFf'](Number,_0xad351d);if(Number[_0x58b08b(0x95)](_0x53b157))return _0x53b157;}if(/^-?\d+\.\d+$/[_0x58b08b(0x97)](_0xad351d)){const _0x45e155=_0x2ae324['kJIvH'](Number,_0xad351d);if(!Number['isNaN'](_0x45e155))return _0x45e155;}const _0x744c3a=_0xad351d['trim']();if(_0x744c3a[_0x58b08b(0xa9)]('{')&&_0x744c3a[_0x58b08b(0xa3)]('}')||_0x744c3a['startsWith']('[')&&_0x744c3a['endsWith'](']'))try{return JSON[_0x58b08b(0xb3)](_0x744c3a);}catch{}return _0xad351d;}async function resolveProfileTarget(_0x11131d){const _0x854930=_0x537e63,_0x4f6fe0={'znByE':function(_0x187547,_0x4243b0){return _0x187547(_0x4243b0);},'iapqH':_0x854930(0x91)},_0x4e5745=existsSync(_0x4f6fe0['znByE'](getEnvDir,_0x11131d));let _0x28bcd3=![];try{const _0x25c041=await _0x4f6fe0[_0x854930(0xb5)](fetchCloudProfile,_0x11131d);_0x28bcd3=Boolean(_0x25c041);}catch{}if(_0x28bcd3)return{'kind':_0x854930(0xb6),'alsoExistsElsewhere':_0x4e5745};if(_0x4e5745)return{'kind':_0x4f6fe0['iapqH'],'alsoExistsElsewhere':![]};throw new Error(_0x854930(0xab)+_0x11131d+_0x854930(0xa8)+_0x11131d);}function printDualExistsHint(_0xf7c622){const _0x280fd2=_0x537e63;console['log']('\x20\x20Note:\x20\x22'+_0xf7c622+_0x280fd2(0xb2));}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x3753fa){const _0x1abf9f=_0x537e63,_0x3f7c7a=await fetchCloudProfile(_0x3753fa),_0x347113=readProfileOverrides(getProjectPath(),_0x3753fa);return mergeCloudProfileSettings(_0x3f7c7a?.[_0x1abf9f(0xb4)]??{},_0x347113??undefined);}export async function configSet(_0x5d672e,_0x4cf499,_0x18fb39){const _0x36e6a0=_0x537e63,_0x577484={'XjtdK':function(_0x216eb6,_0x232ec9){return _0x216eb6(_0x232ec9);},'piCCi':function(_0x5561b9,_0x5e6555){return _0x5561b9(_0x5e6555);},'mtHRa':function(_0x522bb1,_0x3857f7){return _0x522bb1(_0x3857f7);},'ScUiy':function(_0x45f813,_0x3e37ee,_0x3b2440){return _0x45f813(_0x3e37ee,_0x3b2440);},'zLZpu':function(_0x4d0c4c,_0x317d7b,_0x302e5c,_0x23a510){return _0x4d0c4c(_0x317d7b,_0x302e5c,_0x23a510);}},_0x2c524f=await _0x577484['XjtdK'](resolveProfileTarget,_0x5d672e);if(_0x2c524f['kind']==='cloud'){if(_0x2c524f['alsoExistsElsewhere'])printDualExistsHint(_0x5d672e);const _0x525276=_0x577484[_0x36e6a0(0x9e)](parseOverrideValue,_0x18fb39);setProfileOverride(getProjectPath(),_0x5d672e,_0x4cf499,_0x525276),console['log']('Set\x20'+_0x4cf499+'\x20=\x20'+JSON[_0x36e6a0(0x99)](_0x525276)+'\x20for\x20\x22'+_0x5d672e+'\x22');return;}const _0x44bc85=await _0x577484['mtHRa'](loadSettings,_0x5d672e),_0x2138a0=_0x577484['ScUiy'](parseLocalValue,_0x4cf499,_0x18fb39);_0x577484['zLZpu'](setNestedValue,_0x44bc85,_0x4cf499,_0x2138a0),await _0x577484[_0x36e6a0(0xb1)](saveSettings,_0x5d672e,_0x44bc85),console[_0x36e6a0(0xbc)]('Set\x20'+_0x4cf499+_0x36e6a0(0xa6)+_0x2138a0+_0x36e6a0(0x9b)+_0x5d672e+'\x22');}export async function configGet(_0x1dce39,_0xafa20c){const _0x2acd0c=_0x537e63,_0x23e19a={'cjfqj':function(_0x46a020,_0x53f8fd){return _0x46a020(_0x53f8fd);},'dyqfk':function(_0x7e474b,_0x5001a6){return _0x7e474b===_0x5001a6;},'RtmBd':function(_0x1d79b2,_0x2c7073){return _0x1d79b2===_0x2c7073;},'lrPvm':'object','VbtFy':function(_0x164b0e,_0x4117bf){return _0x164b0e===_0x4117bf;}},_0x4f6ed8=await _0x23e19a['cjfqj'](resolveProfileTarget,_0x1dce39);if(_0x23e19a[_0x2acd0c(0xc0)](_0x4f6ed8['kind'],'cloud')){const _0x1d80db=await loadEffectiveCloudSettings(_0x1dce39),_0x33f67a=getNestedValue(_0x1d80db,_0xafa20c);if(_0x23e19a['dyqfk'](_0x33f67a,undefined))console[_0x2acd0c(0xbc)]('(not\x20set)');else _0x23e19a[_0x2acd0c(0xbd)](typeof _0x33f67a,_0x23e19a[_0x2acd0c(0xb0)])?console[_0x2acd0c(0xbc)](JSON[_0x2acd0c(0x99)](_0x33f67a,null,0x2)):console[_0x2acd0c(0xbc)](_0x33f67a);return;}const _0x4af466=await _0x23e19a[_0x2acd0c(0x92)](loadSettings,_0x1dce39),_0x4d06ec=getNestedValue(_0x4af466,_0xafa20c);if(_0x4d06ec===undefined)console[_0x2acd0c(0xbc)]('(not\x20set)');else _0x23e19a[_0x2acd0c(0xa2)](typeof _0x4d06ec,_0x2acd0c(0xc5))?console[_0x2acd0c(0xbc)](JSON['stringify'](_0x4d06ec,null,0x2)):console['log'](_0x4d06ec);}export async function configList(_0x43ffc1){const _0x323680=_0x537e63,_0x357adf={'RmBMT':function(_0x25741b,_0x33665e){return _0x25741b(_0x33665e);},'JTvfE':function(_0x64a0ad,_0x45ec9b){return _0x64a0ad(_0x45ec9b);}},_0x280c18=await _0x357adf['RmBMT'](resolveProfileTarget,_0x43ffc1);if(_0x280c18['kind']===_0x323680(0xb6)){const _0x20f1fe=await _0x357adf['RmBMT'](loadEffectiveCloudSettings,_0x43ffc1);if(!_0x20f1fe||Object[_0x323680(0xbb)](_0x20f1fe)[_0x323680(0x8d)]===0x0){console[_0x323680(0xbc)]('No\x20configuration\x20set\x20for\x20\x22'+_0x43ffc1+'\x22');return;}console['log'](JSON[_0x323680(0x99)](_0x20f1fe,null,0x2));return;}const _0x5911c2=_0x357adf[_0x323680(0xaf)](getSettingsPath,_0x43ffc1);if(!existsSync(_0x5911c2)){console[_0x323680(0xbc)]('No\x20configuration\x20set\x20for\x20\x22'+_0x43ffc1+'\x22');return;}const _0x5ac074=await loadSettings(_0x43ffc1),_0x126a5b=_0x357adf['RmBMT'](formatSettings,_0x5ac074);!_0x126a5b?console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x43ffc1+'\x22'):console[_0x323680(0xbc)](_0x126a5b);}export async function configUnset(_0x16f69f,_0x5c94db){const _0x1e3fe2=_0x537e63,_0x408669={'UNfTF':function(_0x12c03c,_0x44defd){return _0x12c03c(_0x44defd);},'jWqOZ':function(_0x5d370c,_0x432734){return _0x5d370c===_0x432734;},'IKTUN':'cloud','YXMuP':function(_0x2b41be,_0x43fcbb,_0x54bf53){return _0x2b41be(_0x43fcbb,_0x54bf53);}},_0x4aab2f=await _0x408669[_0x1e3fe2(0x98)](resolveProfileTarget,_0x16f69f);if(_0x408669[_0x1e3fe2(0xb7)](_0x4aab2f[_0x1e3fe2(0xc4)],_0x408669[_0x1e3fe2(0x9d)])){if(_0x4aab2f[_0x1e3fe2(0xa4)])printDualExistsHint(_0x16f69f);const _0x2f40ca=unsetProfileOverride(getProjectPath(),_0x16f69f,_0x5c94db);_0x2f40ca?console['log']('Removed\x20'+_0x5c94db+_0x1e3fe2(0x9b)+_0x16f69f+'\x22'):console['log'](_0x1e3fe2(0xc6)+_0x5c94db+'\x22\x20not\x20found');return;}const _0x34d8cb=await loadSettings(_0x16f69f),_0x199ed8=_0x408669['YXMuP'](deleteNestedValue,_0x34d8cb,_0x5c94db);_0x199ed8?(await _0x408669[_0x1e3fe2(0x9a)](saveSettings,_0x16f69f,_0x34d8cb),console['log']('Removed\x20'+_0x5c94db)):console['log'](_0x1e3fe2(0xc6)+_0x5c94db+'\x22\x20not\x20found');}export async function configReset(_0xb4bff8){const _0x562388=_0x537e63,_0x37550d={'VAxUm':'cloud','xquRl':function(_0x4e7c86,_0x23f674,_0x4e0d34){return _0x4e7c86(_0x23f674,_0x4e0d34);}},_0x8b933b=await resolveProfileTarget(_0xb4bff8);if(_0x8b933b[_0x562388(0xc4)]===_0x37550d[_0x562388(0xbf)]){_0x37550d['xquRl'](resetProfileOverrides,getProjectPath(),_0xb4bff8),console[_0x562388(0xbc)](_0x562388(0xaa)+_0xb4bff8+'\x22');return;}console['log']('\x22'+_0xb4bff8+_0x562388(0x94)+_0xb4bff8+_0x562388(0xa7));}function _0x48b4(){const _0x512637=['Profile\x20\x22','10OdSbBS','SZRvD','292851HzKzfJ','JTvfE','lrPvm','ScUiy','\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.','parse','settings','znByE','cloud','jWqOZ','1337KtIKMs','false','headless','keys','log','RtmBd','yCXyD','VAxUm','dyqfk','557847ylUvnT','202509QICxWi','YVniv','kind','object','Key\x20\x22','length','3436670wGAEpC','6570XydffM','includes','local','cjfqj','726336aUfrIt','\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20','isSafeInteger','145xSlUZc','test','UNfTF','stringify','YXMuP','\x20for\x20\x22','allowInsecureLocalhost','IKTUN','piCCi','29228nERLlA','null','undefined','VbtFy','endsWith','alsoExistsElsewhere',':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22','\x20=\x20','\x20<key>\x22\x20to\x20remove\x20individual\x20values.','\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20','startsWith','Cleared\x20local\x20overrides\x20for\x20\x22'];_0x48b4=function(){return _0x512637;};return _0x48b4();}
|
|
1
|
+
const _0x1c608c=_0x5a7e;(function(_0x3664df,_0x217800){const _0x5deae3=_0x5a7e,_0x5853de=_0x3664df();while(!![]){try{const _0x4f1651=parseInt(_0x5deae3(0x174))/0x1*(parseInt(_0x5deae3(0x169))/0x2)+-parseInt(_0x5deae3(0x151))/0x3*(parseInt(_0x5deae3(0x17f))/0x4)+parseInt(_0x5deae3(0x16f))/0x5*(-parseInt(_0x5deae3(0x160))/0x6)+-parseInt(_0x5deae3(0x185))/0x7*(parseInt(_0x5deae3(0x155))/0x8)+parseInt(_0x5deae3(0x15b))/0x9*(-parseInt(_0x5deae3(0x163))/0xa)+-parseInt(_0x5deae3(0x187))/0xb+-parseInt(_0x5deae3(0x152))/0xc*(-parseInt(_0x5deae3(0x180))/0xd);if(_0x4f1651===_0x217800)break;else _0x5853de['push'](_0x5853de['shift']());}catch(_0x50f32e){_0x5853de['push'](_0x5853de['shift']());}}}(_0x27dd,0x87c89));import{existsSync}from'fs';import{loadSettings,saveSettings,getNestedValue,setNestedValue,deleteNestedValue,formatSettings,getSettingsPath,getEnvDir}from'./utils/settings.js';import{fetchCloudProfile}from'./utils/cloudProfile.js';import{mergeCloudProfileSettings,readProfileOverrides,resetProfileOverrides,setProfileOverride,unsetProfileOverride}from'./utils/projectsConfig.js';const BOOLEAN_KEYS=[_0x1c608c(0x153),'allowInsecureLocalhost'];function parseLocalValue(_0x1ab743,_0x386975){const _0x23483e=_0x1c608c,_0xcc2215={'NQjZl':function(_0x3975c9,_0x5af0cc){return _0x3975c9===_0x5af0cc;},'nTyUC':_0x23483e(0x186),'sxxeC':'false'};if(BOOLEAN_KEYS[_0x23483e(0x17e)](_0x1ab743)){if(_0xcc2215['NQjZl'](_0x386975,_0xcc2215[_0x23483e(0x157)]))return!![];if(_0xcc2215[_0x23483e(0x17c)](_0x386975,_0xcc2215['sxxeC']))return![];throw new Error(_0x23483e(0x15c)+_0x1ab743+':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22');}return _0x386975;}function parseOverrideValue(_0x3ff548){const _0xe63b63=_0x1c608c,_0x3a448f={'RXMYi':function(_0x101bf1,_0x5e84af){return _0x101bf1===_0x5e84af;},'qJtfX':_0xe63b63(0x186),'SWlkn':_0xe63b63(0x154),'eWnWp':function(_0x1f9c5d,_0x21c996){return _0x1f9c5d===_0x21c996;},'xSPzX':_0xe63b63(0x184),'tMgBb':function(_0x327084,_0x1da49b){return _0x327084(_0x1da49b);}};if(_0x3a448f['RXMYi'](_0x3ff548,_0x3a448f['qJtfX']))return!![];if(_0x3ff548==='false')return![];if(_0x3a448f['RXMYi'](_0x3ff548,_0x3a448f[_0xe63b63(0x15e)]))return null;if(_0x3a448f[_0xe63b63(0x173)](_0x3ff548,_0x3a448f[_0xe63b63(0x16d)]))return undefined;if(/^-?\d+$/[_0xe63b63(0x15f)](_0x3ff548)){const _0xc04e83=_0x3a448f[_0xe63b63(0x17b)](Number,_0x3ff548);if(Number['isSafeInteger'](_0xc04e83))return _0xc04e83;}if(/^-?\d+\.\d+$/['test'](_0x3ff548)){const _0x34d6c3=_0x3a448f['tMgBb'](Number,_0x3ff548);if(!Number[_0xe63b63(0x177)](_0x34d6c3))return _0x34d6c3;}const _0x591259=_0x3ff548['trim']();if(_0x591259['startsWith']('{')&&_0x591259[_0xe63b63(0x161)]('}')||_0x591259['startsWith']('[')&&_0x591259[_0xe63b63(0x161)](']'))try{return JSON['parse'](_0x591259);}catch{}return _0x3ff548;}async function resolveProfileTarget(_0x132463){const _0x4ecd20=_0x1c608c,_0x3e218f={'EQidF':function(_0x5f4c21,_0x15a5f4){return _0x5f4c21(_0x15a5f4);},'oIgmp':_0x4ecd20(0x14f),'GEfHs':'local'},_0x17b309=existsSync(_0x3e218f[_0x4ecd20(0x165)](getEnvDir,_0x132463));let _0x586467=![];try{const _0x566e04=await fetchCloudProfile(_0x132463);_0x586467=_0x3e218f[_0x4ecd20(0x165)](Boolean,_0x566e04);}catch{}if(_0x586467)return{'kind':_0x3e218f[_0x4ecd20(0x158)],'alsoExistsElsewhere':_0x17b309};if(_0x17b309)return{'kind':_0x3e218f['GEfHs'],'alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x132463+'\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'+_0x132463);}function printDualExistsHint(_0x2efc7e){const _0x234e22=_0x1c608c;console[_0x234e22(0x17a)]('\x20\x20Note:\x20\x22'+_0x2efc7e+_0x234e22(0x16c));}function getProjectPath(){const _0xf349a7=_0x1c608c;return process[_0xf349a7(0x17d)]();}async function loadEffectiveCloudSettings(_0x11cf11){const _0x33dbdf=_0x1c608c,_0x2283ff={'LPjQz':function(_0x26e4c7,_0x16e3e2,_0x4d8430){return _0x26e4c7(_0x16e3e2,_0x4d8430);},'jxLJk':function(_0x423088){return _0x423088();},'EaGfd':function(_0x9b426b,_0x466676,_0xbb4fe5){return _0x9b426b(_0x466676,_0xbb4fe5);}},_0x1a4c23=await fetchCloudProfile(_0x11cf11),_0xf603cd=_0x2283ff[_0x33dbdf(0x150)](readProfileOverrides,_0x2283ff['jxLJk'](getProjectPath),_0x11cf11);return _0x2283ff['EaGfd'](mergeCloudProfileSettings,_0x1a4c23?.['settings']??{},_0xf603cd??undefined);}export async function configSet(_0x9d2313,_0x53e544,_0x32370d){const _0x1200f5=_0x1c608c,_0x234393={'CpOkq':function(_0xc3d99c,_0x24fa2c){return _0xc3d99c(_0x24fa2c);},'MIihP':function(_0x34cb51,_0x2dd0c4){return _0x34cb51===_0x2dd0c4;},'BYLEk':function(_0x35edb1,_0x465a6d){return _0x35edb1(_0x465a6d);},'vzZQT':function(_0xb2adfe){return _0xb2adfe();},'OqwyQ':function(_0x3619ec,_0x31f912,_0x397e26){return _0x3619ec(_0x31f912,_0x397e26);}},_0x97d919=await _0x234393['CpOkq'](resolveProfileTarget,_0x9d2313);if(_0x234393['MIihP'](_0x97d919[_0x1200f5(0x159)],'cloud')){if(_0x97d919['alsoExistsElsewhere'])_0x234393[_0x1200f5(0x171)](printDualExistsHint,_0x9d2313);const _0x2f79f9=_0x234393['BYLEk'](parseOverrideValue,_0x32370d);setProfileOverride(_0x234393['vzZQT'](getProjectPath),_0x9d2313,_0x53e544,_0x2f79f9),console[_0x1200f5(0x17a)](_0x1200f5(0x167)+_0x53e544+'\x20=\x20'+JSON['stringify'](_0x2f79f9)+_0x1200f5(0x14e)+_0x9d2313+'\x22');return;}const _0x28913d=await loadSettings(_0x9d2313),_0x7e0ebb=_0x234393[_0x1200f5(0x15a)](parseLocalValue,_0x53e544,_0x32370d);setNestedValue(_0x28913d,_0x53e544,_0x7e0ebb),await _0x234393[_0x1200f5(0x15a)](saveSettings,_0x9d2313,_0x28913d),console[_0x1200f5(0x17a)](_0x1200f5(0x167)+_0x53e544+'\x20=\x20'+_0x7e0ebb+_0x1200f5(0x14e)+_0x9d2313+'\x22');}function _0x5a7e(_0x566dc0,_0xb33f4f){_0x566dc0=_0x566dc0-0x14e;const _0x27dd80=_0x27dd();let _0x5a7e43=_0x27dd80[_0x566dc0];return _0x5a7e43;}export async function configGet(_0xb4e064,_0x505bc4){const _0x1f8534=_0x1c608c,_0x5734f8={'ThcyC':function(_0x140265,_0x32392b){return _0x140265(_0x32392b);},'JTebH':function(_0x4053b2,_0x45bf96,_0x4e2503){return _0x4053b2(_0x45bf96,_0x4e2503);},'wWOkg':function(_0x3813b0,_0x105d69){return _0x3813b0===_0x105d69;},'NyWxZ':'object','LCZSg':function(_0xb20e80,_0x4669fa,_0x1812c1){return _0xb20e80(_0x4669fa,_0x1812c1);},'MgVKr':function(_0x46ca43,_0x202a90){return _0x46ca43===_0x202a90;}},_0x5c0425=await resolveProfileTarget(_0xb4e064);if(_0x5c0425[_0x1f8534(0x159)]==='cloud'){const _0x1e75bf=await _0x5734f8[_0x1f8534(0x182)](loadEffectiveCloudSettings,_0xb4e064),_0x58865f=_0x5734f8[_0x1f8534(0x162)](getNestedValue,_0x1e75bf,_0x505bc4);if(_0x5734f8['wWOkg'](_0x58865f,undefined))console[_0x1f8534(0x17a)](_0x1f8534(0x178));else typeof _0x58865f===_0x5734f8[_0x1f8534(0x156)]?console[_0x1f8534(0x17a)](JSON[_0x1f8534(0x16e)](_0x58865f,null,0x2)):console['log'](_0x58865f);return;}const _0x5304d5=await _0x5734f8[_0x1f8534(0x182)](loadSettings,_0xb4e064),_0x4ac093=_0x5734f8['LCZSg'](getNestedValue,_0x5304d5,_0x505bc4);if(_0x4ac093===undefined)console[_0x1f8534(0x17a)]('(not\x20set)');else _0x5734f8[_0x1f8534(0x166)](typeof _0x4ac093,_0x1f8534(0x188))?console[_0x1f8534(0x17a)](JSON['stringify'](_0x4ac093,null,0x2)):console[_0x1f8534(0x17a)](_0x4ac093);}function _0x27dd(){const _0x580252=['\x22\x20not\x20found','\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.','xSPzX','stringify','5culomd','\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20','CpOkq','qigtK','eWnWp','554924RgYsdr','No\x20configuration\x20set\x20for\x20\x22','Cleared\x20local\x20overrides\x20for\x20\x22','isNaN','(not\x20set)','RWBmS','log','tMgBb','NQjZl','cwd','includes','35324jZuNxt','793nVZLbn','length','ThcyC','igzDq','undefined','1233589KPpxBe','true','2856942lVihcK','object','\x20for\x20\x22','cloud','LPjQz','225NTlAhg','360792vOMpTF','headless','null','16eJBsdR','NyWxZ','nTyUC','oIgmp','kind','OqwyQ','859149GDdswO','Invalid\x20value\x20for\x20','Key\x20\x22','SWlkn','test','3815394sUMWXP','endsWith','JTebH','50VFtSbI','oAZBd','EQidF','MgVKr','Set\x20','MHxTP','4RoosIr','Removed\x20'];_0x27dd=function(){return _0x580252;};return _0x27dd();}export async function configList(_0x5a7a1f){const _0x465847=_0x1c608c,_0x5e1b97={'igzDq':function(_0x15bf13,_0x281c25){return _0x15bf13(_0x281c25);},'riavx':function(_0x5f0819,_0x363db2){return _0x5f0819===_0x363db2;}},_0x21fc9b=await resolveProfileTarget(_0x5a7a1f);if(_0x21fc9b['kind']==='cloud'){const _0x305abd=await _0x5e1b97['igzDq'](loadEffectiveCloudSettings,_0x5a7a1f);if(!_0x305abd||_0x5e1b97['riavx'](Object['keys'](_0x305abd)[_0x465847(0x181)],0x0)){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x5a7a1f+'\x22');return;}console['log'](JSON['stringify'](_0x305abd,null,0x2));return;}const _0x240fb7=getSettingsPath(_0x5a7a1f);if(!existsSync(_0x240fb7)){console['log'](_0x465847(0x175)+_0x5a7a1f+'\x22');return;}const _0x14ce59=await _0x5e1b97[_0x465847(0x183)](loadSettings,_0x5a7a1f),_0x1ba89a=_0x5e1b97[_0x465847(0x183)](formatSettings,_0x14ce59);!_0x1ba89a?console[_0x465847(0x17a)](_0x465847(0x175)+_0x5a7a1f+'\x22'):console[_0x465847(0x17a)](_0x1ba89a);}export async function configUnset(_0x163e37,_0x3bbb39){const _0x5e0e72=_0x1c608c,_0x6c378f={'RWBmS':function(_0x48c505,_0x5cb2ca){return _0x48c505(_0x5cb2ca);},'mTwoA':function(_0x45f425,_0x216f8a){return _0x45f425===_0x216f8a;},'qigtK':function(_0x3fcdbf,_0x308923,_0x319d36,_0x219a8e){return _0x3fcdbf(_0x308923,_0x319d36,_0x219a8e);},'oAZBd':function(_0x208d16){return _0x208d16();},'fexOG':function(_0x40ebda,_0x33ced8,_0x434d13){return _0x40ebda(_0x33ced8,_0x434d13);}},_0x11f607=await _0x6c378f[_0x5e0e72(0x179)](resolveProfileTarget,_0x163e37);if(_0x6c378f['mTwoA'](_0x11f607[_0x5e0e72(0x159)],'cloud')){if(_0x11f607['alsoExistsElsewhere'])printDualExistsHint(_0x163e37);const _0x37f663=_0x6c378f[_0x5e0e72(0x172)](unsetProfileOverride,_0x6c378f[_0x5e0e72(0x164)](getProjectPath),_0x163e37,_0x3bbb39);_0x37f663?console[_0x5e0e72(0x17a)]('Removed\x20'+_0x3bbb39+_0x5e0e72(0x14e)+_0x163e37+'\x22'):console['log'](_0x5e0e72(0x15d)+_0x3bbb39+_0x5e0e72(0x16b));return;}const _0x17fd88=await loadSettings(_0x163e37),_0x35843b=_0x6c378f['fexOG'](deleteNestedValue,_0x17fd88,_0x3bbb39);_0x35843b?(await saveSettings(_0x163e37,_0x17fd88),console['log'](_0x5e0e72(0x16a)+_0x3bbb39)):console['log'](_0x5e0e72(0x15d)+_0x3bbb39+'\x22\x20not\x20found');}export async function configReset(_0x52974f){const _0x4d55ba=_0x1c608c,_0xc6c5e={'MHxTP':function(_0x59db44,_0x1c69a1){return _0x59db44(_0x1c69a1);},'iFeEH':'cloud','sLOPf':function(_0x1ae572){return _0x1ae572();}},_0x19617a=await _0xc6c5e[_0x4d55ba(0x168)](resolveProfileTarget,_0x52974f);if(_0x19617a[_0x4d55ba(0x159)]===_0xc6c5e['iFeEH']){resetProfileOverrides(_0xc6c5e['sLOPf'](getProjectPath),_0x52974f),console[_0x4d55ba(0x17a)](_0x4d55ba(0x176)+_0x52974f+'\x22');return;}console[_0x4d55ba(0x17a)]('\x22'+_0x52974f+_0x4d55ba(0x170)+_0x52974f+'\x20<key>\x22\x20to\x20remove\x20individual\x20values.');}
|
package/build/commands/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0xce35da=_0x5f4e;(function(_0x2e8384,_0x546aed){const _0x416d6d=_0x5f4e,_0x261a70=_0x2e8384();while(!![]){try{const _0x40d404=parseInt(_0x416d6d(0x13d))/0x1+-parseInt(_0x416d6d(0x14a))/0x2*(-parseInt(_0x416d6d(0x12e))/0x3)+-parseInt(_0x416d6d(0x139))/0x4+-parseInt(_0x416d6d(0x145))/0x5+parseInt(_0x416d6d(0x13e))/0x6*(-parseInt(_0x416d6d(0x148))/0x7)+-parseInt(_0x416d6d(0x132))/0x8*(parseInt(_0x416d6d(0x131))/0x9)+-parseInt(_0x416d6d(0x13c))/0xa*(-parseInt(_0x416d6d(0x137))/0xb);if(_0x40d404===_0x546aed)break;else _0x261a70['push'](_0x261a70['shift']());}catch(_0x2d2ae6){_0x261a70['push'](_0x261a70['shift']());}}}(_0x2def,0x974ff));import{readdir,stat}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{getRangerDir}from'./utils/rangerRoot.js';function _0x5f4e(_0x254e5c,_0x504d50){_0x254e5c=_0x254e5c-0x12e;const _0x2defbd=_0x2def();let _0x5f4e7a=_0x2defbd[_0x254e5c];return _0x5f4e7a;}import{loadSettings}from'./utils/settings.js';import{readActiveProfileName}from'./utils/activeProfile.js';function _0x2def(){const _0x4f3baf=['\x20\x20\x20\x20\x20\x20Details:\x20','endsWith','length','.txt','sessionUpdatedAt','pYyuJ','2949890wEPToQ','XvQNs','push','707uqagDX','settings.json','2000378ZtZchv','\x0aNo\x20profiles\x20found.','name','sessions','3SZUqQz','local','xJQUQ','94455qAOlya','824plgkGZ','log','environmentDetails','fLxHT','isDirectory','176yPyypg','environmentKey','3330624axMAwF','lQGkw','includes','1280140wMTJYk','405554fcFJcY','19638OfxiSh'];_0x2def=function(){return _0x4f3baf;};return _0x2def();}import{listCloudProfiles}from'./utils/cloudProfile.js';const NON_ENV_DIRS=[_0xce35da(0x14d),'bug-bashes','reports','local','ci'];export async function getEnvNames(){const _0x456fab=_0xce35da,_0x3341a4={'cgaIa':function(_0x5c8ab6){return _0x5c8ab6();},'OexLb':function(_0x539dee,_0x1e1bee){return _0x539dee(_0x1e1bee);},'pYyuJ':function(_0x2e085b,_0x148cca,_0x237527){return _0x2e085b(_0x148cca,_0x237527);},'ZTDLi':function(_0x3987cc,_0x37f183){return _0x3987cc(_0x37f183);},'AbcXf':function(_0x15a260,_0x281c60){return _0x15a260(_0x281c60);},'yhCqM':function(_0x1826a5,_0x488644){return _0x1826a5(_0x488644);},'FMWUg':function(_0x147956,_0x5679f5,_0x44e758){return _0x147956(_0x5679f5,_0x44e758);},'Sngnx':function(_0xb5722a,_0x57a063,_0x2ad2ca){return _0xb5722a(_0x57a063,_0x2ad2ca);},'vwrFt':_0x456fab(0x149),'XvQNs':'legacy'},_0x3fb575=_0x3341a4['cgaIa'](getRangerDir);if(!_0x3341a4['OexLb'](existsSync,_0x3fb575))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x3872e0=await readActiveProfileName(),_0x27dfd0=[],_0x2fde06={},_0x1d0890=_0x3341a4[_0x456fab(0x144)](join,_0x3fb575,'local');if(_0x3341a4['ZTDLi'](existsSync,_0x1d0890)){const _0x164257=await _0x3341a4['AbcXf'](readdir,_0x1d0890);for(const _0x2ba4be of _0x164257){const _0xc70f3b=join(_0x1d0890,_0x2ba4be),_0x23430a=await stat(_0xc70f3b);_0x23430a[_0x456fab(0x136)]()&&(_0x27dfd0[_0x456fab(0x147)](_0x2ba4be),_0x2fde06[_0x2ba4be]=_0x456fab(0x12f));}}const _0x520c06=_0x3341a4[_0x456fab(0x144)](join,_0x3fb575,'ci');if(_0x3341a4['yhCqM'](existsSync,_0x520c06)){const _0x364d71=await readdir(_0x520c06);for(const _0x285bb4 of _0x364d71){const _0x2d58c3=_0x3341a4[_0x456fab(0x144)](join,_0x520c06,_0x285bb4),_0x434f73=await stat(_0x2d58c3);_0x434f73[_0x456fab(0x136)]()&&(_0x27dfd0['push'](_0x285bb4),_0x2fde06[_0x285bb4]='ci');}}const _0x2382aa=await _0x3341a4['yhCqM'](readdir,_0x3fb575);for(const _0x3fb6e7 of _0x2382aa){if(NON_ENV_DIRS['includes'](_0x3fb6e7))continue;if(_0x3fb6e7['startsWith']('.'))continue;if(_0x3fb6e7[_0x456fab(0x140)](_0x456fab(0x142)))continue;const _0x484a44=_0x3341a4['FMWUg'](join,_0x3fb575,_0x3fb6e7),_0x2b85d9=await stat(_0x484a44);_0x2b85d9['isDirectory']()&&_0x3341a4['OexLb'](existsSync,_0x3341a4['Sngnx'](join,_0x484a44,_0x3341a4['vwrFt']))&&(!_0x27dfd0[_0x456fab(0x13b)](_0x3fb6e7)&&(_0x27dfd0['push'](_0x3fb6e7),_0x2fde06[_0x3fb6e7]=_0x3341a4[_0x456fab(0x146)]));}return{'envNames':_0x27dfd0,'activeEnv':_0x3872e0,'envTypes':_0x2fde06};}export async function envList(){const _0x38ee89=_0xce35da,_0x795e62={'lQGkw':function(_0x5a0b6e){return _0x5a0b6e();},'xSzMh':'Run:\x20ranger\x20profile\x20add\x20<profile-name>','iejlI':function(_0x534152,_0x2c1d04){return _0x534152>_0x2c1d04;},'fLxHT':'\x0aLocal\x20Profiles:','VaSMS':function(_0x4368cf,_0x44c71a){return _0x4368cf===_0x44c71a;},'bPbjd':'legacy','ONDvF':'\x0aCloud\x20Profiles:','xJQUQ':'no\x20session'},{envNames:_0x2f23d5,activeEnv:_0x3a4f01,envTypes:_0x12398e}=await getEnvNames();let _0x4a41cb=[];try{_0x4a41cb=await _0x795e62[_0x38ee89(0x13a)](listCloudProfiles);}catch{}if(_0x2f23d5[_0x38ee89(0x141)]===0x0&&_0x4a41cb['length']===0x0){console['log'](_0x38ee89(0x14b)),console['log'](_0x795e62['xSzMh']);return;}const _0x5e3532=new Set(_0x4a41cb['map'](_0x1b55bb=>_0x1b55bb[_0x38ee89(0x14c)]));if(_0x795e62['iejlI'](_0x2f23d5[_0x38ee89(0x141)],0x0)){console['log'](_0x795e62[_0x38ee89(0x135)]);for(const _0x5cdeb5 of _0x2f23d5['sort']()){const _0x337a7f=_0x5cdeb5===_0x3a4f01&&!_0x5e3532['has'](_0x5cdeb5),_0x17c920=_0x12398e[_0x5cdeb5]||'local',_0x4a8d2b=await loadSettings(_0x5cdeb5),_0x2ede8c=_0x795e62['VaSMS'](_0x17c920,_0x795e62['bPbjd'])?'':'\x20['+_0x17c920+']';console['log']('\x20\x20'+(_0x337a7f?'*\x20':'\x20\x20')+_0x5cdeb5+_0x2ede8c),_0x4a8d2b['baseUrl']&&console[_0x38ee89(0x133)]('\x20\x20\x20\x20\x20\x20URL:\x20'+_0x4a8d2b['baseUrl']),_0x4a8d2b[_0x38ee89(0x134)]&&console['log'](_0x38ee89(0x13f)+_0x4a8d2b[_0x38ee89(0x134)]);}}if(_0x4a41cb['length']>0x0){console[_0x38ee89(0x133)](_0x795e62['ONDvF']);for(const _0x532147 of _0x4a41cb['sort']((_0x5406f0,_0x3d757a)=>_0x5406f0['name']['localeCompare'](_0x3d757a['name']))){const _0x3a8353=_0x532147['name']===_0x3a4f01,_0x33e56a=_0x532147[_0x38ee89(0x138)]?'\x20('+_0x532147[_0x38ee89(0x138)]+')':'',_0x113372=_0x532147['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x532147[_0x38ee89(0x143)]+')':_0x795e62[_0x38ee89(0x130)];console[_0x38ee89(0x133)]('\x20\x20'+(_0x3a8353?'*\x20':'\x20\x20')+_0x532147['name']+'\x20[cloud]'+_0x33e56a),console[_0x38ee89(0x133)]('\x20\x20\x20\x20\x20\x20Session:\x20'+_0x113372);}}_0x3a4f01&&console[_0x38ee89(0x133)]('\x0a*\x20=\x20active\x20profile');}
|