@ranger-testing/ranger-cli 2.5.4-alpha.0e8b82c-9 → 2.5.4-alpha.1b80607-25
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/README.md +36 -14
- 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/deleteProfile.js +1 -0
- 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/legacyWarning.js +1 -0
- 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/novaActCli.js +1 -0
- 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/build/commands/verifyFeatureNovaCli.js +1 -0
- package/build/skills/ranger/SKILL.md +24 -8
- package/build/skills/ranger/create.md +16 -3
- package/build/skills/ranger/verify.md +35 -10
- package/package.json +3 -2
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(_0x3f6e34,_0x3f2072){const _0x2b837f=_0x1c00,_0x52accb=_0x3f6e34();while(!![]){try{const _0x1a6036=parseInt(_0x2b837f(0xf0))/0x1+-parseInt(_0x2b837f(0xcb))/0x2*(-parseInt(_0x2b837f(0xeb))/0x3)+-parseInt(_0x2b837f(0xf6))/0x4*(parseInt(_0x2b837f(0x101))/0x5)+parseInt(_0x2b837f(0x10b))/0x6*(-parseInt(_0x2b837f(0xfa))/0x7)+parseInt(_0x2b837f(0xf4))/0x8+parseInt(_0x2b837f(0x112))/0x9+parseInt(_0x2b837f(0x139))/0xa*(parseInt(_0x2b837f(0x121))/0xb);if(_0x1a6036===_0x3f2072)break;else _0x52accb['push'](_0x52accb['shift']());}catch(_0x4ca3a9){_0x52accb['push'](_0x52accb['shift']());}}}(_0x2a26,0xddf8e));import{readdir,rm}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x5f15cb from'inquirer';function _0x2a26(){const _0x3f25d2=['eTStz','warn','HoQuG','use_suggestion','trim','skipAuth','isElectron','no_match','\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22','yes','3UIIZiL','\x0a\x20\x20No\x20auth\x20env\x20matches\x20','DTluw','Gckqc','avSNb','481237aDlqgp','Aqooy','gKyXX','keys','3997232sgiGcQ','fwuLq','184oZJBzB','error','Could\x20not\x20reach\x20','trackPhaseEnd','7sHmltQ','capture','isProtocolError','WYCVL','\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.','join','\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','138715Nvuihu','origin','lhWiq','PYGVV','ugTWU','status','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.','ZdJuf','cwd','lSOeT','769854iaVZYo','\x27\x20created\x20(no\x20session).\x0a','HEAD','log','OaJAY','cdpEndpoint','message','6367554OpPFfL','\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','fetch\x20failed','MlTeQ','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','exit','Invalid\x20--setup-header\x20format:\x20\x22','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','length','\x27\x20matching\x20','uyYzW','\x20(continuing\x20with\x20--force)','jVeSd','profile.add.autoRouteSkipped','\x0a\x20\x20A\x20profile\x20named\x20\x22','50809oXrRft','\x0a\x20\x20Still\x20could\x20not\x20reach\x20','name','kNCKF','vDSCe','What\x20would\x20you\x20like\x20to\x20do?','PHvUE','environments','\x20\x20Next:\x20ranger\x20go\x20--profile\x20','\x20--url\x20','Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.','YIyCK','url','signal','isTTY','NODE_TLS_REJECT_UNAUTHORIZED','BfEuG','startsWith','gOhXC','UmWzH','FyFoM','force','sfUJP','HTTP\x20','1210DNNqiR','prompt','\x20--skip-auth\x0a','setupHeaders','Found\x20auth\x20environment\x20\x27','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','hSMxU','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','uvUAi','\x27\x20to\x20the\x20cloud?','132778PWYbCI','xHZZY','✓\x20Cloud\x20profile\x20\x27','\x0a✓\x20Profile\x20\x27','\x27\x20created\x20(CDP).','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','uxHgv','RKsJj','env','slice','OqDtT','\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a','pyXYm','domains','yVWHW','\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20','Vhrvz','confirm','\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','setupHeader','JtNxe','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'];_0x2a26=function(){return _0x3f25d2;};return _0x2a26();}import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{fetchAuthConfig,createCloudProfile,manualBrowserLogin,ApiError}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{isPathGitTracked}from'./utils/gitTracked.js';import{setProfileOverride}from'./utils/projectsConfig.js';const CLOUD_PROFILE_SHARING_WARNING='This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization';function warnCloudProfileSharedInOrg(){const _0x38df9f=_0x1c00;if(!process['stdout'][_0x38df9f(0x12f)])return;console[_0x38df9f(0xe2)](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x25f666){const _0x1da87a=_0x1c00,_0x4cc8be={'BfEuG':function(_0x54bb52,_0x242f1e,_0x52ab57){return _0x54bb52(_0x242f1e,_0x52ab57);},'jzSbZ':_0x1da87a(0x10d),'YZxWX':'manual','Gckqc':function(_0x587caa,_0x4adb97){return _0x587caa(_0x4adb97);},'FyFoM':function(_0x41e468,_0x57f55d){return _0x41e468<_0x57f55d;},'OqDtT':function(_0x479575,_0x4c4648){return _0x479575===_0x4c4648;},'qEeKg':_0x1da87a(0x114)};try{const _0x109179=new AbortController(),_0x336c7c=_0x4cc8be[_0x1da87a(0x131)](setTimeout,()=>_0x109179['abort'](),0x1388),_0x9fe0b7={'method':_0x4cc8be['jzSbZ'],'signal':_0x109179[_0x1da87a(0x12e)],'redirect':_0x4cc8be['YZxWX']};/^https:\/\/localhost(:\d+)?/i['test'](_0x25f666)&&(process[_0x1da87a(0xd3)]['NODE_TLS_REJECT_UNAUTHORIZED']='0');const _0x2872b6=await fetch(_0x25f666,_0x9fe0b7);delete process[_0x1da87a(0xd3)][_0x1da87a(0x130)],_0x4cc8be[_0x1da87a(0xee)](clearTimeout,_0x336c7c);if(_0x4cc8be[_0x1da87a(0x135)](_0x2872b6[_0x1da87a(0x106)],0x190))return{'ok':!![]};return{'ok':![],'error':_0x1da87a(0x138)+_0x2872b6['status']};}catch(_0x55eaf6){delete process[_0x1da87a(0xd3)]['NODE_TLS_REJECT_UNAUTHORIZED'];const _0x48f425=_0x55eaf6,_0x4e97b3=_0x48f425[_0x1da87a(0x111)]||String(_0x55eaf6),_0x38b363=_0x4e97b3['includes']('Invalid\x20URL')||_0x4cc8be[_0x1da87a(0xd5)](_0x48f425[_0x1da87a(0x123)],'TypeError')||_0x4e97b3['includes'](_0x4cc8be['qEeKg']);return{'ok':![],'error':_0x4e97b3,'isProtocolError':_0x38b363};}}async function sweepOrphanLocalProfile(_0x15cce9,_0x4d66af,_0x27d18e){const _0x973b33=_0x1c00,_0x27def4={'mOzqb':function(_0x1c30ec,_0x25d354,_0x50ec4f){return _0x1c30ec(_0x25d354,_0x50ec4f);},'YIyCK':function(_0x2db020,_0x40d8e5,_0x1696dc){return _0x2db020(_0x40d8e5,_0x1696dc);},'ZtvBD':function(_0x5e73f7,_0xfc23d7){return _0x5e73f7(_0xfc23d7);},'uyYzW':function(_0x1c42be,_0x54377f,_0x449f57){return _0x1c42be(_0x54377f,_0x449f57);}},_0x4eed14=_0x27def4['mOzqb'](join,_0x4d66af,'local'),_0xf04e77=_0x27def4[_0x973b33(0x12c)](join,_0x4eed14,_0x15cce9);_0x27def4['ZtvBD'](existsSync,_0xf04e77)&&(_0x27d18e&&await isPathGitTracked(_0xf04e77)?console[_0x973b33(0x10e)]('\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20'+_0xf04e77+_0x973b33(0x107)):(await _0x27def4[_0x973b33(0x11c)](rm,_0xf04e77,{'recursive':!![],'force':!![]}),console[_0x973b33(0x10e)](_0x973b33(0xe0)+_0xf04e77)));if(existsSync(_0x4eed14)){let _0x4b6a30=[];try{_0x4b6a30=await readdir(_0x4eed14);}catch{return;}const _0x4d5adc='.tmp-'+_0x15cce9+'-';for(const _0x19736d of _0x4b6a30){if(!_0x19736d[_0x973b33(0x132)](_0x4d5adc))continue;const _0x3e0b6f=join(_0x4eed14,_0x19736d);await rm(_0x3e0b6f,{'recursive':!![],'force':!![]}),console['log'](_0x973b33(0xe0)+_0x3e0b6f);}}}async function sweepOrphansBestEffort(_0x14d28f){const _0x1b1ace=_0x1c00,_0x2d0602={'eEZjH':function(_0x291512){return _0x291512();},'cRkdC':function(_0x3fc46a,_0x68a4d6){return _0x3fc46a!==_0x68a4d6;},'dRQCQ':function(_0x4f7acf){return _0x4f7acf();},'YBDyt':function(_0x5dd946,_0x53b8e2){return _0x5dd946 instanceof _0x53b8e2;},'eYaRY':function(_0x2ab3c5,_0x26ddb8){return _0x2ab3c5(_0x26ddb8);}};try{await sweepOrphanLocalProfile(_0x14d28f,_0x2d0602['eEZjH'](getRangerHomeDir),![]);const _0x1823ae=_0x2d0602['eEZjH'](getRangerDir);_0x2d0602['cRkdC'](_0x1823ae,_0x2d0602['dRQCQ'](getRangerHomeDir))&&await sweepOrphanLocalProfile(_0x14d28f,_0x1823ae,!![]);}catch(_0x37c8fe){console['log'](_0x1b1ace(0xdd)+(_0x2d0602['YBDyt'](_0x37c8fe,Error)?_0x37c8fe[_0x1b1ace(0x111)]:_0x2d0602['eYaRY'](String,_0x37c8fe))+').');}}async function markActive(_0x1e9879){const _0x5d0f94=_0x1c00,_0x41b9d0={'MlTeQ':function(_0x2a674b,_0x15ea9d){return _0x2a674b(_0x15ea9d);},'hfFSY':_0x5d0f94(0x12b)};try{await _0x41b9d0[_0x5d0f94(0x115)](writeActiveProfileName,_0x1e9879),console[_0x5d0f94(0x10e)]('\x20\x20Set\x20active\x20profile:\x20'+_0x1e9879);}catch{console['log'](_0x41b9d0['hfFSY']);}}async function tryAutoRouteCloudProfile(_0x543b1d,_0x40be54,_0x3a4789,_0x281f72,_0x269641){const _0x44f477=_0x1c00,_0x446667={'ilCOb':function(_0x1199f6,_0x471d5e){return _0x1199f6===_0x471d5e;},'UmWzH':_0x44f477(0x11f),'gOhXC':'no_auth_config','pyXYm':function(_0x30732c,_0xea0cc4){return _0x30732c+_0xea0cc4;},'OaJAY':function(_0x208db4,_0x461578){return _0x208db4+_0x461578;},'UZJcH':'\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a','EfFbf':_0x44f477(0xe8),'uxHgv':function(_0x278922){return _0x278922();},'PYGVV':function(_0x26996f,_0x2b9285){return _0x26996f+_0x2b9285;},'frsFP':function(_0x4a6762,_0x202e0b){return _0x4a6762(_0x202e0b);},'BlwLY':'profile.add.autoRouted'};let _0x183323;try{_0x183323=await fetchAuthConfig();}catch(_0x12186f){return _0x269641?.[_0x44f477(0xf9)]('profile.add.autoRouteSkipped',{'reason':'no_auth_config','profileName':_0x543b1d}),console['error']('\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20'+(_0x12186f instanceof Error?_0x12186f[_0x44f477(0x111)]:String(_0x12186f))),![];}if(!_0x183323||!_0x183323[_0x44f477(0x128)]||_0x446667['ilCOb'](Object['keys'](_0x183323['environments'])['length'],0x0)){if(_0x281f72)return await captureEnvLessProfile(_0x543b1d,_0x40be54,_0x3a4789,_0x269641);return _0x269641?.[_0x44f477(0xf9)](_0x446667[_0x44f477(0x134)],{'reason':_0x446667[_0x44f477(0x133)],'profileName':_0x543b1d}),console['error'](_0x446667[_0x44f477(0xd7)](_0x446667['pyXYm'](_0x446667[_0x44f477(0x10f)]('\x0a\x20\x20Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team\x20yet\x20—\x20that\x27s\x20the\x20path\x20that\x20lets\x20Ranger\x20log\x20into\x20your\x20app\x20for\x20you\x20in\x20CI\x20/\x20background\x20agents.\x0a','\x0a')+_0x446667['UZJcH']+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20'+_0x543b1d+_0x44f477(0x12a)+_0x40be54+_0x44f477(0x13b))+'\x0a','\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a'),_0x44f477(0x113))),![];}const _0x343bd8=matchAuthEnvironment(_0x40be54,_0x183323);if(!_0x343bd8)return _0x269641?.[_0x44f477(0xf9)](_0x446667['UmWzH'],{'reason':_0x446667['EfFbf'],'profileName':_0x543b1d}),console['error'](_0x44f477(0xec)+_0x40be54+'.\x20Configured\x20envs:\x20'+Object[_0x44f477(0xf3)](_0x183323['environments'])[_0x44f477(0xff)](',\x20')+'.'),![];const _0xd2989d=_0x183323[_0x44f477(0x128)][_0x343bd8],_0x1b0502=_0xd2989d?.[_0x44f477(0xd8)]??[];if(_0x281f72&&!_0x3a4789[_0x44f477(0xea)]){const {saveToCloud:_0x179a94}=await _0x5f15cb['prompt']([{'type':'confirm','name':'saveToCloud','message':_0x44f477(0x13d)+_0x343bd8+_0x44f477(0x11b)+_0x40be54+'\x0a\x20\x20(domains:\x20'+_0x1b0502[_0x44f477(0xff)](',\x20')+')\x0a\x20\x20Save\x20\x27'+_0x543b1d+_0x44f477(0x142),'default':!![]}]);if(!_0x179a94)return _0x269641?.['trackPhaseEnd'](_0x446667['UmWzH'],{'reason':'user_declined','profileName':_0x543b1d}),console[_0x44f477(0xf7)]('\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.'),![];}const _0x5eecad=_0x1b0502['some'](_0x21a174=>{const _0x24fc31=_0x44f477;try{return new URL(_0x21a174)[_0x24fc31(0x102)]===new URL(_0x40be54)['origin'];}catch{return![];}}),_0x5da8a1={};!_0x5eecad&&(_0x5da8a1['baseUrl']=_0x40be54);try{await createCloudProfile(_0x543b1d,_0x343bd8,{'settings':_0x5da8a1}),_0x446667[_0x44f477(0xd1)](warnCloudProfileSharedInOrg);}catch(_0x11639d){if(_0x11639d instanceof ApiError&&_0x11639d[_0x44f477(0x106)]===0x199){console['error'](_0x44f477(0x120)+_0x543b1d+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a'+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x543b1d));throw _0x11639d;}throw _0x11639d;}return console['log'](_0x446667[_0x44f477(0x104)]('✓\x20Profile\x20\x27'+_0x543b1d+'\x27\x20created.\x0a','\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x543b1d)),await _0x446667['frsFP'](sweepOrphansBestEffort,_0x543b1d),_0x269641?.['trackPhaseEnd'](_0x446667['BlwLY'],{'envKey':_0x343bd8,'profileName':_0x543b1d}),!![];}function _0x1c00(_0x5b573c,_0x48a88d){_0x5b573c=_0x5b573c-0xcb;const _0x2a26e0=_0x2a26();let _0x1c00d8=_0x2a26e0[_0x5b573c];return _0x1c00d8;}async function createUnconfiguredCloudProfile(_0x448ee3,_0x3f05fa){const _0x247d82=_0x1c00,_0x5c08c0={'OFpmf':function(_0x18dbf0,_0x1bbb18,_0x5c3521,_0x381f59){return _0x18dbf0(_0x1bbb18,_0x5c3521,_0x381f59);},'kmETs':function(_0x1f005b,_0x485898){return _0x1f005b instanceof _0x485898;},'jVeSd':function(_0x40defd,_0x463e35){return _0x40defd===_0x463e35;}};try{await _0x5c08c0['OFpmf'](createCloudProfile,_0x448ee3,undefined,{'settings':_0x3f05fa}),warnCloudProfileSharedInOrg();}catch(_0x441639){_0x5c08c0['kmETs'](_0x441639,ApiError)&&_0x5c08c0[_0x247d82(0x11e)](_0x441639['status'],0x199)&&console[_0x247d82(0xf7)](_0x247d82(0x120)+_0x448ee3+_0x247d82(0x13e)+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x448ee3));throw _0x441639;}}async function captureEnvLessProfile(_0x418fca,_0x39a54c,_0x1ee5b6,_0x47ad6c){const _0x3bf10c=_0x1c00,_0xc02794={'TUjcM':_0x3bf10c(0xdc),'Vhrvz':_0x3bf10c(0xfb),'Imylq':'profile.add.autoRouteSkipped','uvUAi':'user_declined','eTStz':function(_0x1685d7,_0x840cdd){return _0x1685d7+_0x840cdd;},'KTSJO':function(_0x24e2a4,_0x2492b6){return _0x24e2a4===_0x2492b6;},'lSOeT':function(_0x3ca4e3,_0x4e0fbe){return _0x3ca4e3>_0x4e0fbe;},'DTluw':function(_0x4c2f34,_0x55f13b){return _0x4c2f34 instanceof _0x55f13b;},'yVWHW':function(_0x3e2c5f,_0x4ecf0d,_0x505afc){return _0x3e2c5f(_0x4ecf0d,_0x505afc);},'EufnM':function(_0x53f8d8,_0x35a669){return _0x53f8d8(_0x35a669);}};if(!_0x1ee5b6['yes']){const {capture:_0x2af969}=await _0x5f15cb[_0x3bf10c(0x13a)]([{'type':_0xc02794['TUjcM'],'name':_0xc02794[_0x3bf10c(0xdb)],'message':'Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','default':!![]}]);if(!_0x2af969)return _0x47ad6c?.['trackPhaseEnd'](_0xc02794['Imylq'],{'reason':_0xc02794[_0x3bf10c(0x141)],'profileName':_0x418fca}),console[_0x3bf10c(0xf7)](_0xc02794['eTStz']('\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a','\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.')),![];}const _0x278151={};if(_0x1ee5b6[_0x3bf10c(0xde)])for(const _0x559cec of _0x1ee5b6['setupHeader']){const _0x30b33d=_0x559cec['indexOf'](':');if(_0xc02794['KTSJO'](_0x30b33d,-0x1))continue;_0x278151[_0x559cec[_0x3bf10c(0xd4)](0x0,_0x30b33d)[_0x3bf10c(0xe5)]()]=_0x559cec[_0x3bf10c(0xd4)](_0xc02794[_0x3bf10c(0xe1)](_0x30b33d,0x1))['trim']();}const _0x2a59a6={'baseUrl':_0x39a54c};_0xc02794[_0x3bf10c(0x10a)](Object[_0x3bf10c(0xf3)](_0x278151)[_0x3bf10c(0x11a)],0x0)&&(_0x2a59a6[_0x3bf10c(0x13c)]=_0x278151);let _0x4eb7e8;try{_0x4eb7e8=await createCloudProfile(_0x418fca,undefined,{'settings':_0x2a59a6}),warnCloudProfileSharedInOrg();}catch(_0x362049){_0xc02794[_0x3bf10c(0xed)](_0x362049,ApiError)&&_0x362049['status']===0x199&&console[_0x3bf10c(0xf7)](_0x3bf10c(0x120)+_0x418fca+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a'+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x418fca));throw _0x362049;}return await _0xc02794[_0x3bf10c(0xd9)](manualBrowserLogin,_0x4eb7e8,{'key':'','domains':[_0x39a54c],'setupHeaders':_0xc02794['lSOeT'](Object[_0x3bf10c(0xf3)](_0x278151)[_0x3bf10c(0x11a)],0x0)?_0x278151:undefined}),console[_0x3bf10c(0x10e)](_0xc02794[_0x3bf10c(0xe1)](_0x3bf10c(0xce)+_0x418fca+'\x27\x20created\x20with\x20a\x20captured\x20session.\x0a',_0x3bf10c(0x129)+_0x418fca)),await _0xc02794['EufnM'](sweepOrphansBestEffort,_0x418fca),_0x47ad6c?.[_0x3bf10c(0xf9)]('profile.add.autoRouted',{'envKey':null,'profileName':_0x418fca}),!![];}export async function addEnv(_0x3dedfe,_0x386fc8={},_0x5e30cf){const _0x4e09be=_0x1c00,_0x30ad6d={'JtNxe':function(_0x5a6685,_0x10584c){return _0x5a6685+_0x10584c;},'MQPVh':function(_0xf30161,_0x2360cb){return _0xf30161+_0x2360cb;},'KkwwF':'The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a','Aqooy':'To\x20set\x20up\x20a\x20profile,\x20run:\x0a','hcjZi':_0x4e09be(0x116),'WYCVL':function(_0x19c64d,_0x15da5b){return _0x19c64d!==_0x15da5b;},'wHqwB':function(_0x4dd9fe,_0x253d68){return _0x4dd9fe===_0x253d68;},'FDYqn':'--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','HoQuG':function(_0x4e5201,_0x24f242){return _0x4e5201(_0x24f242);},'PHvUE':function(_0x432318){return _0x432318();},'gKyXX':_0x4e09be(0x140),'xHZZY':function(_0x51df96,_0x5b24c9){return _0x51df96>_0x5b24c9;},'JUcDU':function(_0x657f68,_0x57da53,_0x3d3f27){return _0x657f68(_0x57da53,_0x3d3f27);},'kNCKF':function(_0x5d4301,_0x33f620,_0x223f8c,_0x23d7cd,_0xd5f4e9){return _0x5d4301(_0x33f620,_0x223f8c,_0x23d7cd,_0xd5f4e9);},'zbBMG':_0x4e09be(0x110),'BCTgq':_0x4e09be(0xe7),'qHVpT':function(_0x2a5f48,_0x10949d){return _0x2a5f48 instanceof _0x10949d;},'ZdJuf':function(_0x6a8dc6,_0x15a694){return _0x6a8dc6(_0x15a694);},'TEPEA':'\x0a🌐\x20Profile\x20Setup\x0a','pvbTw':'input','lhWiq':'Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','kbfzj':'What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','ALOCP':'http://localhost:3000','ugTWU':'list','sfUJP':'use_suggestion','avSNb':'retry','hSMxU':'Continue\x20anyway','RKsJj':'continue','vDSCe':function(_0x4e9f22,_0x5aa428){return _0x4e9f22===_0x5aa428;},'fwuLq':function(_0x184beb,_0x54a45e){return _0x184beb instanceof _0x54a45e;}};_0x386fc8['ci']&&(console[_0x4e09be(0xf7)](_0x30ad6d[_0x4e09be(0xdf)](_0x30ad6d['MQPVh'](_0x30ad6d['KkwwF'],'for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a')+'\x0a',_0x30ad6d[_0x4e09be(0xf1)])+_0x30ad6d['hcjZi']+'\x0a'+_0x4e09be(0xd0)+'\x20\x20https://docs.ranger.net/main/concepts/profiles'),process['exit'](0x1));const _0x268520={};if(_0x386fc8[_0x4e09be(0xde)])for(const _0x45e680 of _0x386fc8[_0x4e09be(0xde)]){const _0x5717e1=_0x45e680['indexOf'](':');if(_0x5717e1===-0x1)throw new Error(_0x4e09be(0x118)+_0x45e680+'\x22.\x20Expected\x20\x22Name:\x20Value\x22.');const _0x3f42ea=_0x45e680[_0x4e09be(0xd4)](0x0,_0x5717e1)[_0x4e09be(0xe5)](),_0x148e22=_0x45e680['slice'](_0x5717e1+0x1)[_0x4e09be(0xe5)]();_0x268520[_0x3f42ea]=_0x148e22;}if(_0x30ad6d[_0x4e09be(0xfd)](_0x386fc8[_0x4e09be(0x110)],undefined)&&_0x30ad6d['wHqwB'](_0x386fc8[_0x4e09be(0x110)][_0x4e09be(0xe5)](),''))throw new Error('--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222');if(_0x386fc8[_0x4e09be(0x110)]&&_0x386fc8[_0x4e09be(0x12d)])throw new Error(_0x30ad6d['FDYqn']);const _0xd56088=_0x30ad6d['HoQuG'](Boolean,_0x386fc8['cdpEndpoint']),_0xe6ac60=_0x30ad6d[_0x4e09be(0x127)](isInteractive);if(!_0xe6ac60&&!_0x386fc8['url']&&!_0xd56088&&!_0x386fc8['skipAuth'])throw new Error(_0x30ad6d[_0x4e09be(0xf2)]);if(_0xd56088){const _0x8ed838=_0x386fc8[_0x4e09be(0x110)];console['log'](_0x4e09be(0x100)),console['log'](_0x4e09be(0xda)+_0x8ed838);const _0x31494a={'cdpEndpoint':_0x8ed838,'isElectron':!![]};_0x30ad6d['xHZZY'](Object['keys'](_0x268520)['length'],0x0)&&(_0x31494a['setupHeaders']=_0x268520);await _0x30ad6d['JUcDU'](createUnconfiguredCloudProfile,_0x3dedfe,_0x31494a);try{_0x30ad6d['kNCKF'](setProfileOverride,process[_0x4e09be(0x109)](),_0x3dedfe,_0x30ad6d['zbBMG'],_0x8ed838),_0x30ad6d[_0x4e09be(0x124)](setProfileOverride,process[_0x4e09be(0x109)](),_0x3dedfe,_0x30ad6d['BCTgq'],!![]);}catch(_0x3c8cf0){console['error']('\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20'+(_0x30ad6d['qHVpT'](_0x3c8cf0,Error)?_0x3c8cf0[_0x4e09be(0x111)]:_0x30ad6d[_0x4e09be(0xe3)](String,_0x3c8cf0)));}console['log'](_0x4e09be(0xcd)+_0x3dedfe+_0x4e09be(0xcf)),await _0x30ad6d['ZdJuf'](sweepOrphansBestEffort,_0x3dedfe),await markActive(_0x3dedfe);return;}if(_0x386fc8[_0x4e09be(0xe6)]){const _0x1e0ef1={};_0x386fc8['url']&&(_0x1e0ef1['baseUrl']=_0x386fc8[_0x4e09be(0x12d)]);_0x30ad6d[_0x4e09be(0xcc)](Object['keys'](_0x268520)[_0x4e09be(0x11a)],0x0)&&(_0x1e0ef1['setupHeaders']=_0x268520);await _0x30ad6d['JUcDU'](createUnconfiguredCloudProfile,_0x3dedfe,_0x1e0ef1),console['log']('✓\x20Profile\x20\x27'+_0x3dedfe+_0x4e09be(0x10c)+('\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20'+_0x3dedfe+'`\x20again\x20without\x20--skip-auth.')),await sweepOrphansBestEffort(_0x3dedfe),await _0x30ad6d[_0x4e09be(0x108)](markActive,_0x3dedfe);return;}if(_0x386fc8[_0x4e09be(0x12d)]){const _0x521df1=_0x386fc8['url'],_0x3938f3=await _0x30ad6d['ZdJuf'](checkUrlReachability,_0x521df1);if(!_0x3938f3['ok']&&!_0x386fc8[_0x4e09be(0x136)])throw new Error(_0x4e09be(0xf8)+_0x521df1+':\x20'+_0x3938f3['error']+_0x4e09be(0xfe));!_0x3938f3['ok']&&_0x386fc8[_0x4e09be(0x136)]&&console['log']('⚠\x20Could\x20not\x20reach\x20'+_0x521df1+':\x20'+_0x3938f3['error']+_0x4e09be(0x11d));}else{console[_0x4e09be(0x10e)](_0x30ad6d['TEPEA']),console[_0x4e09be(0x10e)](_0x4e09be(0x119)),console['log'](_0x4e09be(0xd6));let _0x4401da='',_0x387c22=![];while(!![]){const _0x1439b0=await _0x5f15cb[_0x4e09be(0x13a)]([{'type':_0x30ad6d['pvbTw'],'name':'baseUrl','message':_0x387c22?_0x30ad6d[_0x4e09be(0x103)]:_0x30ad6d['kbfzj'],'default':_0x4401da||_0x30ad6d['ALOCP']}]);_0x4401da=_0x1439b0['baseUrl'];const _0x211c93=await checkUrlReachability(_0x4401da);if(_0x211c93['ok'])break;const _0x4d1d00=/^[a-zA-Z][\w+.-]*:\/\//['test'](_0x4401da),_0x41d648=_0x211c93[_0x4e09be(0xfc)]&&!_0x4d1d00,_0x3e4b95=_0x41d648?'http://'+_0x4401da:null;_0x387c22=!![],console['log']('\x0a\x20\x20Could\x20not\x20reach\x20'+_0x4401da+':\x20'+_0x211c93[_0x4e09be(0xf7)]);_0x3e4b95&&console[_0x4e09be(0x10e)]('\x20\x20Did\x20you\x20mean\x20'+_0x3e4b95+'?');const {action:_0x2d7111}=await _0x5f15cb[_0x4e09be(0x13a)]([{'type':_0x30ad6d[_0x4e09be(0x105)],'name':'action','message':_0x4e09be(0x126),'choices':[..._0x3e4b95?[{'name':'Use\x20'+_0x3e4b95,'value':_0x30ad6d[_0x4e09be(0x137)]}]:[],{'name':'Enter\x20a\x20different\x20URL','value':_0x30ad6d[_0x4e09be(0xef)]},{'name':_0x30ad6d[_0x4e09be(0x13f)],'value':_0x30ad6d[_0x4e09be(0xd2)]}]}]);if(_0x2d7111===_0x4e09be(0xe4)&&_0x3e4b95){_0x4401da=_0x3e4b95;const _0x1f6015=await checkUrlReachability(_0x4401da);if(_0x1f6015['ok'])break;console[_0x4e09be(0x10e)](_0x4e09be(0x122)+_0x4401da+':\x20'+_0x1f6015[_0x4e09be(0xf7)]);}else{if(_0x30ad6d[_0x4e09be(0x125)](_0x2d7111,_0x30ad6d[_0x4e09be(0xd2)]))break;}}_0x386fc8={..._0x386fc8,'url':_0x4401da};}let _0x561a87=![];try{_0x561a87=await tryAutoRouteCloudProfile(_0x3dedfe,_0x386fc8['url'],_0x386fc8,_0xe6ac60,_0x5e30cf);}catch(_0xcb458c){console['error'](_0x4e09be(0xe9)+_0x3dedfe+'\x22:\x20'+(_0x30ad6d[_0x4e09be(0xf5)](_0xcb458c,Error)?_0xcb458c[_0x4e09be(0x111)]:String(_0xcb458c))),process[_0x4e09be(0x117)](0x1);}!_0x561a87&&process[_0x4e09be(0x117)](0x1),await markActive(_0x3dedfe);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1a6b06,_0x37b0b6){var _0x43c44b=_0x44fa,_0x95ac06=_0x1a6b06();while(!![]){try{var _0x111d6c=-parseInt(_0x43c44b(0x1ba))/0x1+parseInt(_0x43c44b(0x1b8))/0x2*(parseInt(_0x43c44b(0x1b9))/0x3)+-parseInt(_0x43c44b(0x1b6))/0x4*(-parseInt(_0x43c44b(0x1bc))/0x5)+-parseInt(_0x43c44b(0x1b4))/0x6*(-parseInt(_0x43c44b(0x1b3))/0x7)+parseInt(_0x43c44b(0x1b7))/0x8*(-parseInt(_0x43c44b(0x1b0))/0x9)+-parseInt(_0x43c44b(0x1bb))/0xa+-parseInt(_0x43c44b(0x1bd))/0xb;if(_0x111d6c===_0x37b0b6)break;else _0x95ac06['push'](_0x95ac06['shift']());}catch(_0xdb5b7){_0x95ac06['push'](_0x95ac06['shift']());}}}(_0x6e16,0xb3252));function _0x6e16(){var _0x59f313=['7303620rscMYU','6013055lapdrD','3190341gkvhmd','ranger\x20profile\x20encrypt-auth\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x0a','session\x20state\x20for\x20you,\x20so\x20encrypted\x20on-disk\x20auth\x20is\x20unnecessary.\x0a','4458357LzhHwu','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','exit','1497055uOpKKa','30vKlWfD','cnWwI','4IVYats','8xrkmaX','446486rAMDUQ','3bEjBfZ','245635edHWOB'];_0x6e16=function(){return _0x59f313;};return _0x6e16();}function _0x44fa(_0x12ce07,_0x13647d){_0x12ce07=_0x12ce07-0x1af;var _0x6e167a=_0x6e16();var _0x44faa3=_0x6e167a[_0x12ce07];return _0x44faa3;}export async function authEncrypt(_0x384eea){var _0x2aff60=_0x44fa,_0x388f95={'bucGh':function(_0x4fc87e,_0x2123a5){return _0x4fc87e+_0x2123a5;},'cnWwI':_0x2aff60(0x1af),'Sligw':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a'};console['error'](_0x388f95['bucGh'](_0x388f95['bucGh'](_0x2aff60(0x1be),_0x388f95[_0x2aff60(0x1b5)])+'\x0a'+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a'+_0x388f95['Sligw'],'\x0a')+_0x2aff60(0x1b1)+'\x20\x20https://docs.ranger.net/main/concepts/profiles'),process[_0x2aff60(0x1b2)](0x1);}
|
package/build/commands/clean.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x5e44a9=_0x44a2;function _0x52ed(){const _0x2e9324=['user','8aTkGwg','filter','opencode.json','✓\x20Removed\x20user\x20skill:\x20','EQmvD','2rBudQW','plugin','kEQat','1666683MLYlzA','3780854lKlfAG','e2e-test-recommender','error','EHHXj','claude','push','1493444VGeXmV','replace','llElQ','remove','✓\x20Removed\x20OpenCode\x20user\x20skill:\x20','qDyJX','xnnQI','TYXSp','log','platform','feature-tracker','✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)','DfSIg','EXlfT','uninstall','cBWfW','vVGdc','project','dgwRx','zicXf','✓\x20Removed\x20OpenCode\x20project\x20skill:\x20','length','tzyYt','✓\x20Removed\x20stored\x20credentials','Gbotj','✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)','140163zkZAHU','zWGKE','MUNFH','✓\x20Removed\x20.ranger/\x20directory','GBxDn','jSFSw','392476OLguHC','2907390IZQPLM','win32','marketplace','close','676510rXzjBs','ignore'];_0x52ed=function(){return _0x2e9324;};return _0x52ed();}(function(_0x5caecc,_0x176711){const _0xdc92f3=_0x44a2,_0x722eac=_0x5caecc();while(!![]){try{const _0xaec50=-parseInt(_0xdc92f3(0x13e))/0x1+-parseInt(_0xdc92f3(0x14b))/0x2*(-parseInt(_0xdc92f3(0x138))/0x3)+parseInt(_0xdc92f3(0x155))/0x4+parseInt(_0xdc92f3(0x143))/0x5+parseInt(_0xdc92f3(0x13f))/0x6+-parseInt(_0xdc92f3(0x14f))/0x7+parseInt(_0xdc92f3(0x146))/0x8*(parseInt(_0xdc92f3(0x14e))/0x9);if(_0xaec50===_0x176711)break;else _0x722eac['push'](_0x722eac['shift']());}catch(_0x44518d){_0x722eac['push'](_0x722eac['shift']());}}}(_0x52ed,0x476ba));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';function _0x44a2(_0x5c5028,_0x20609f){_0x5c5028=_0x5c5028-0x130;const _0x52ed50=_0x52ed();let _0x44a2f2=_0x52ed50[_0x5c5028];return _0x44a2f2;}const skillsToRemove=['ranger',_0x5e44a9(0x15f),'bug-bash',_0x5e44a9(0x150)],opencodePluginName='@ranger-testing/opencode-plugin';function parseJsonc(_0x5d068c){const _0x3ac0ca=_0x5e44a9,_0x222dab=_0x5d068c[_0x3ac0ca(0x156)](/\/\*[\s\S]*?\*\//g,''),_0x7b652b=_0x222dab['replace'](/^\s*\/\/.*$/gm,''),_0x41dd76=_0x7b652b['replace'](/,\s*([}\]])/g,'$1');return JSON['parse'](_0x41dd76);}async function removeOpencodePluginConfig(_0x2fff3d){const _0x42e76d=_0x5e44a9,_0x599805={'DigyJ':function(_0x5587f5,_0x2d9749){return _0x5587f5!==_0x2d9749;},'EXlfT':function(_0x432722,_0x58eaa1,_0x2c0c8e){return _0x432722(_0x58eaa1,_0x2c0c8e);},'Gbotj':function(_0x2ab1b9,_0x4cb6cd){return _0x2ab1b9(_0x4cb6cd);},'QawyP':function(_0x1255d3,_0x40c265){return _0x1255d3===_0x40c265;},'xKtku':function(_0xb723de,_0x44f896){return _0xb723de+_0x44f896;}};if(!existsSync(_0x2fff3d))return![];let _0x463eb3;try{const _0xf7e379=await _0x599805[_0x42e76d(0x162)](readFile,_0x2fff3d,'utf-8');_0x463eb3=_0x599805[_0x42e76d(0x136)](parseJsonc,_0xf7e379);}catch{return![];}const _0x37c487=Array['isArray'](_0x463eb3[_0x42e76d(0x14c)])?_0x463eb3[_0x42e76d(0x14c)]:[];if(_0x37c487[_0x42e76d(0x133)]===0x0)return![];const _0x433cae=_0x37c487[_0x42e76d(0x147)](_0x53dc03=>{if(_0x599805['DigyJ'](typeof _0x53dc03,'string'))return!![];return _0x599805['DigyJ'](_0x53dc03,opencodePluginName);});if(_0x599805['QawyP'](_0x433cae['length'],_0x37c487['length']))return![];return _0x433cae[_0x42e76d(0x133)]===0x0?delete _0x463eb3[_0x42e76d(0x14c)]:_0x463eb3['plugin']=_0x433cae,await _0x599805[_0x42e76d(0x162)](writeFile,_0x2fff3d,_0x599805['xKtku'](JSON['stringify'](_0x463eb3,null,0x2),'\x0a')),!![];}async function uninstallClaudePlugin(_0x32bfed){const _0x4dcf81=_0x5e44a9,_0xa27fbe={'jSFSw':_0x4dcf81(0x163),'TZGeA':'--scope','Qffhp':_0x4dcf81(0x144),'MUNFH':function(_0x197840){return _0x197840();},'FkRdY':'close','EQmvD':_0x4dcf81(0x151)};return new Promise(_0x4b2c46=>{const _0x147eb0=_0x4dcf81,_0x24f657={'cBWfW':function(_0x68fcbe,_0x121ab6){return _0x68fcbe(_0x121ab6);}},_0x1b4a64=[_0x147eb0(0x14c),_0xa27fbe[_0x147eb0(0x13d)],'ranger@trailhead'];_0x32bfed&&_0x1b4a64[_0x147eb0(0x154)](_0xa27fbe['TZGeA'],_0x32bfed);const _0x269678=spawn('claude',_0x1b4a64,{'stdio':[_0xa27fbe['Qffhp'],_0xa27fbe['Qffhp'],'ignore'],'cwd':_0x32bfed?_0xa27fbe[_0x147eb0(0x13a)](getProjectRoot):undefined,'shell':process['platform']===_0x147eb0(0x140)});_0x269678['on'](_0xa27fbe['FkRdY'],_0x103757=>{const _0x4b897e=_0x147eb0;_0x24f657[_0x4b897e(0x164)](_0x4b2c46,_0x103757===0x0);}),_0x269678['on'](_0xa27fbe[_0x147eb0(0x14a)],()=>{_0x4b2c46(![]);});});}async function removeMarketplace(){const _0x20336d=_0x5e44a9,_0x1947da={'zicXf':function(_0x4e1185,_0xb281fd){return _0x4e1185===_0xb281fd;},'DQTTs':_0x20336d(0x153),'zWGKE':_0x20336d(0x141),'llElQ':'ignore','kEQat':_0x20336d(0x140),'rZOxS':_0x20336d(0x151)};return new Promise(_0x112f6f=>{const _0x2e67a8=_0x20336d,_0x5a038a={'vVGdc':function(_0x12cf93,_0x4f72d1){const _0x28ed0d=_0x44a2;return _0x1947da[_0x28ed0d(0x131)](_0x12cf93,_0x4f72d1);},'HhcFx':function(_0x3d9901,_0x5cac07){return _0x3d9901(_0x5cac07);}},_0x5c91d5=spawn(_0x1947da['DQTTs'],['plugin',_0x1947da[_0x2e67a8(0x139)],_0x2e67a8(0x158),'trailhead'],{'stdio':[_0x1947da[_0x2e67a8(0x157)],_0x2e67a8(0x144),_0x2e67a8(0x144)],'shell':process[_0x2e67a8(0x15e)]===_0x1947da[_0x2e67a8(0x14d)]});_0x5c91d5['on'](_0x2e67a8(0x142),_0x1b0cbf=>{const _0x2491ce=_0x2e67a8;_0x112f6f(_0x5a038a[_0x2491ce(0x165)](_0x1b0cbf,0x0));}),_0x5c91d5['on'](_0x1947da['rZOxS'],()=>{_0x5a038a['HhcFx'](_0x112f6f,![]);});});}export async function clean(){const _0x202669=_0x5e44a9,_0x4cdd50={'FQDPh':'\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','YjUXu':function(_0x1221ba){return _0x1221ba();},'TYXSp':function(_0x4d8219,_0x1cf0cd){return _0x4d8219(_0x1cf0cd);},'EHHXj':_0x202669(0x13b),'DfSIg':function(_0x314b62){return _0x314b62();},'GBxDn':function(_0x8da545,_0x1dec77,_0x10d074){return _0x8da545(_0x1dec77,_0x10d074);},'dgwRx':function(_0x2ca43f,_0x4840b6,_0x21ce8a){return _0x2ca43f(_0x4840b6,_0x21ce8a);},'fXMIA':function(_0x3ecf33,_0x4bf7a8){return _0x3ecf33(_0x4bf7a8);},'gzZKV':function(_0xd6459b,_0x565159,_0x158904){return _0xd6459b(_0x565159,_0x158904);},'FwSVX':function(_0x9ee800,_0x5bb88c,_0x36bdb9){return _0x9ee800(_0x5bb88c,_0x36bdb9);},'tzyYt':'user','qDyJX':'✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)','bIzwZ':function(_0x3246e2,_0x5d7d56){return _0x3246e2(_0x5d7d56);},'xnnQI':_0x202669(0x166),'hYolx':'\x0a✅\x20Cleanup\x20complete!\x0a'};console[_0x202669(0x15d)](_0x4cdd50['FQDPh']);let _0x446889=![];try{await _0x4cdd50['YjUXu'](deleteAllCredentials),console[_0x202669(0x15d)](_0x202669(0x135)),_0x446889=!![];}catch{}const _0x1f13a6=getCacheFile();_0x4cdd50[_0x202669(0x15c)](existsSync,_0x1f13a6)&&(await rm(_0x1f13a6),_0x446889=!![]);const _0x52fb41=_0x4cdd50['YjUXu'](getRangerDir);_0x4cdd50['TYXSp'](existsSync,_0x52fb41)&&(await rm(_0x52fb41,{'recursive':!![]}),console['log'](_0x4cdd50[_0x202669(0x152)]),_0x446889=!![]);const _0x56a7e3=_0x4cdd50['DfSIg'](getProjectSkillsDir);for(const _0x43e649 of skillsToRemove){const _0x84f7e0=_0x4cdd50[_0x202669(0x13c)](join,_0x56a7e3,_0x43e649);existsSync(_0x84f7e0)&&(await _0x4cdd50[_0x202669(0x130)](rm,_0x84f7e0,{'recursive':!![]}),console[_0x202669(0x15d)]('✓\x20Removed\x20project\x20skill:\x20'+_0x43e649),_0x446889=!![]);}const _0x22e396=getUserSkillsDir();for(const _0x3856d9 of skillsToRemove){const _0x238738=join(_0x22e396,_0x3856d9);_0x4cdd50['fXMIA'](existsSync,_0x238738)&&(await _0x4cdd50['gzZKV'](rm,_0x238738,{'recursive':!![]}),console[_0x202669(0x15d)](_0x202669(0x149)+_0x3856d9),_0x446889=!![]);}const _0x50eaa7=getOpencodeSkillsDir(_0x202669(0x166));for(const _0x399c10 of skillsToRemove){const _0x25e35c=_0x4cdd50[_0x202669(0x130)](join,_0x50eaa7,_0x399c10);existsSync(_0x25e35c)&&(await rm(_0x25e35c,{'recursive':!![]}),console['log'](_0x202669(0x132)+_0x399c10),_0x446889=!![]);}const _0x1b64c4=getOpencodeSkillsDir(_0x202669(0x145));for(const _0x911c85 of skillsToRemove){const _0x443d7d=_0x4cdd50[_0x202669(0x13c)](join,_0x1b64c4,_0x911c85);existsSync(_0x443d7d)&&(await rm(_0x443d7d,{'recursive':!![]}),console[_0x202669(0x15d)](_0x202669(0x159)+_0x911c85),_0x446889=!![]);}const _0x58834b=_0x4cdd50['FwSVX'](join,getOpencodeConfigDir(_0x202669(0x166)),'opencode.json');await removeOpencodePluginConfig(_0x58834b)&&(console['log'](_0x202669(0x137)),_0x446889=!![]);const _0x44d673=join(_0x4cdd50['TYXSp'](getOpencodeConfigDir,_0x4cdd50[_0x202669(0x134)]),_0x202669(0x148));await removeOpencodePluginConfig(_0x44d673)&&(console[_0x202669(0x15d)]('✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)'),_0x446889=!![]);const _0x345be5=await _0x4cdd50[_0x202669(0x161)](uninstallClaudePlugin);_0x345be5&&(console['log'](_0x4cdd50[_0x202669(0x15a)]),_0x446889=!![]);const _0x53f52b=await _0x4cdd50['bIzwZ'](uninstallClaudePlugin,_0x4cdd50[_0x202669(0x15b)]);_0x53f52b&&(console[_0x202669(0x15d)](_0x202669(0x160)),_0x446889=!![]);const _0x25b975=await removeMarketplace();_0x25b975&&(console[_0x202669(0x15d)]('✓\x20Removed\x20trailhead\x20marketplace'),_0x446889=!![]),_0x446889?console['log'](_0x4cdd50['hYolx']):console[_0x202669(0x15d)]('Nothing\x20to\x20clean\x20up.\x0a');}
|
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
|
+
(function(_0x308ff9,_0x4de856){const _0x24eb2c=_0xa39a,_0x70cbb8=_0x308ff9();while(!![]){try{const _0x28de35=parseInt(_0x24eb2c(0xe4))/0x1*(-parseInt(_0x24eb2c(0x10a))/0x2)+-parseInt(_0x24eb2c(0xef))/0x3*(-parseInt(_0x24eb2c(0xe3))/0x4)+-parseInt(_0x24eb2c(0x109))/0x5+-parseInt(_0x24eb2c(0xf6))/0x6+-parseInt(_0x24eb2c(0xdd))/0x7+parseInt(_0x24eb2c(0x104))/0x8+parseInt(_0x24eb2c(0xfb))/0x9;if(_0x28de35===_0x4de856)break;else _0x70cbb8['push'](_0x70cbb8['shift']());}catch(_0x2309a6){_0x70cbb8['push'](_0x70cbb8['shift']());}}}(_0x27da,0x5918c));import{existsSync}from'fs';function _0xa39a(_0x59029e,_0x10e4a8){_0x59029e=_0x59029e-0xd9;const _0x27daa3=_0x27da();let _0xa39a1f=_0x27daa3[_0x59029e];return _0xa39a1f;}import{loadSettings,getNestedValue,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=['headless','allowInsecureLocalhost'];function parseLocalValue(_0x53c6e3,_0x1096e4){const _0x293082=_0xa39a,_0x351752={'zZtOR':function(_0x2fe16a,_0x463024){return _0x2fe16a===_0x463024;}};if(BOOLEAN_KEYS[_0x293082(0xfc)](_0x53c6e3)){if(_0x351752[_0x293082(0x103)](_0x1096e4,_0x293082(0x107)))return!![];if(_0x351752[_0x293082(0x103)](_0x1096e4,_0x293082(0xe9)))return![];throw new Error('Invalid\x20value\x20for\x20'+_0x53c6e3+':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22');}return _0x1096e4;}function parseOverrideValue(_0x56c01e){const _0x4c2185=_0xa39a,_0xb16c58={'eDkay':'true','EKGnV':function(_0xffec6e,_0x2d18ab){return _0xffec6e===_0x2d18ab;},'EzSIY':'null','EgkCA':function(_0x3fcbeb,_0x584284){return _0x3fcbeb(_0x584284);},'rKVwC':function(_0x4f8524,_0x2dbd78){return _0x4f8524(_0x2dbd78);}};if(_0x56c01e===_0xb16c58[_0x4c2185(0x105)])return!![];if(_0xb16c58['EKGnV'](_0x56c01e,_0x4c2185(0xe9)))return![];if(_0x56c01e===_0xb16c58[_0x4c2185(0xf7)])return null;if(_0xb16c58['EKGnV'](_0x56c01e,_0x4c2185(0xee)))return undefined;if(/^-?\d+$/['test'](_0x56c01e)){const _0x389ea8=_0xb16c58[_0x4c2185(0xda)](Number,_0x56c01e);if(Number['isSafeInteger'](_0x389ea8))return _0x389ea8;}if(/^-?\d+\.\d+$/[_0x4c2185(0xec)](_0x56c01e)){const _0xd7a6d2=_0xb16c58[_0x4c2185(0xfd)](Number,_0x56c01e);if(!Number[_0x4c2185(0xe2)](_0xd7a6d2))return _0xd7a6d2;}const _0x24edfd=_0x56c01e['trim']();if(_0x24edfd[_0x4c2185(0xe1)]('{')&&_0x24edfd['endsWith']('}')||_0x24edfd['startsWith']('[')&&_0x24edfd['endsWith'](']'))try{return JSON[_0x4c2185(0x100)](_0x24edfd);}catch{}return _0x56c01e;}async function resolveProfileTarget(_0x191a65){const _0x4665ab=_0xa39a,_0x1fd0c9={'BqeZa':function(_0x26b354,_0x156355){return _0x26b354(_0x156355);},'Japsc':function(_0x2e5398,_0x544c17){return _0x2e5398(_0x544c17);},'MySTu':function(_0x549da9,_0x4e6252){return _0x549da9(_0x4e6252);}},_0x24daf2=existsSync(_0x1fd0c9['BqeZa'](getEnvDir,_0x191a65));let _0x281f15=![];try{const _0x3c92f5=await _0x1fd0c9['Japsc'](fetchCloudProfile,_0x191a65);_0x281f15=_0x1fd0c9[_0x4665ab(0xf4)](Boolean,_0x3c92f5);}catch{}if(_0x281f15)return{'kind':'cloud','alsoExistsElsewhere':_0x24daf2};if(_0x24daf2)return{'kind':_0x4665ab(0xe0),'alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x191a65+_0x4665ab(0xfe)+_0x191a65);}function printDualExistsHint(_0x5ab7a9){const _0x35b5fd=_0xa39a;console[_0x35b5fd(0xf3)](_0x35b5fd(0xf0)+_0x5ab7a9+'\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.');}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x435c67){const _0x5f4196=_0xa39a,_0x438274={'DeuSO':function(_0x552126){return _0x552126();},'FztYG':function(_0x1f4f0d,_0x275775,_0x3e7d15){return _0x1f4f0d(_0x275775,_0x3e7d15);},'gQKWM':function(_0x425884,_0x8c5a70){return _0x425884??_0x8c5a70;}},_0x35fd3e=await fetchCloudProfile(_0x435c67),_0x884655=readProfileOverrides(_0x438274[_0x5f4196(0xdf)](getProjectPath),_0x435c67);return _0x438274[_0x5f4196(0xd9)](mergeCloudProfileSettings,_0x35fd3e?.['settings']??{},_0x438274['gQKWM'](_0x884655,undefined));}export async function configSet(_0x196c07,_0x5de2c4,_0x9d54a3){const _0x2daaf0=_0xa39a,_0x518b8a={'YMXFc':function(_0x31df69,_0x34d449){return _0x31df69===_0x34d449;},'aERxw':_0x2daaf0(0xf9),'BhPwa':function(_0x3f0df7,_0x5f39c2){return _0x3f0df7(_0x5f39c2);},'epEOz':function(_0x34d3f2,_0x12d5e9,_0x2d5e5c,_0x1620a6,_0x4e822a){return _0x34d3f2(_0x12d5e9,_0x2d5e5c,_0x1620a6,_0x4e822a);},'ByZrV':function(_0x2b0fde){return _0x2b0fde();}},_0x19c904=await resolveProfileTarget(_0x196c07);if(_0x518b8a[_0x2daaf0(0x108)](_0x19c904['kind'],_0x518b8a[_0x2daaf0(0xf1)])){if(_0x19c904['alsoExistsElsewhere'])_0x518b8a[_0x2daaf0(0xfa)](printDualExistsHint,_0x196c07);const _0x5e6476=_0x518b8a[_0x2daaf0(0xfa)](parseOverrideValue,_0x9d54a3);_0x518b8a[_0x2daaf0(0x110)](setProfileOverride,getProjectPath(),_0x196c07,_0x5de2c4,_0x5e6476),console['log']('Set\x20'+_0x5de2c4+'\x20=\x20'+JSON[_0x2daaf0(0xea)](_0x5e6476)+'\x20for\x20\x22'+_0x196c07+'\x22');return;}const _0x2901b8=parseLocalValue(_0x5de2c4,_0x9d54a3);setProfileOverride(_0x518b8a['ByZrV'](getProjectPath),_0x196c07,_0x5de2c4,_0x2901b8),console[_0x2daaf0(0xf3)]('Set\x20'+_0x5de2c4+'\x20=\x20'+_0x2901b8+'\x20for\x20\x22'+_0x196c07+'\x22');}export async function configGet(_0x426fcd,_0x2e22a3){const _0x47b0cc=_0xa39a,_0x498a44={'vgwNb':function(_0x4efad0,_0x58c2a6,_0x5e1030){return _0x4efad0(_0x58c2a6,_0x5e1030);},'ruhHF':function(_0x2d2696,_0x165d7b){return _0x2d2696===_0x165d7b;},'bNxUR':function(_0x2cabf9,_0x245345){return _0x2cabf9===_0x245345;},'cTOnT':function(_0x1b8e05,_0x5b6c9a,_0x1b6c9a){return _0x1b8e05(_0x5b6c9a,_0x1b6c9a);}},_0x24c711=await resolveProfileTarget(_0x426fcd);if(_0x24c711[_0x47b0cc(0x10e)]==='cloud'){const _0x54f97b=await loadEffectiveCloudSettings(_0x426fcd),_0x522b41=_0x498a44[_0x47b0cc(0xed)](getNestedValue,_0x54f97b,_0x2e22a3);if(_0x498a44[_0x47b0cc(0x10c)](_0x522b41,undefined))console[_0x47b0cc(0xf3)]('(not\x20set)');else _0x498a44['bNxUR'](typeof _0x522b41,_0x47b0cc(0xdc))?console[_0x47b0cc(0xf3)](JSON[_0x47b0cc(0xea)](_0x522b41,null,0x2)):console[_0x47b0cc(0xf3)](_0x522b41);return;}const _0x3b73f5=await loadSettings(_0x426fcd),_0x5d2df4=_0x498a44['cTOnT'](getNestedValue,_0x3b73f5,_0x2e22a3);if(_0x498a44[_0x47b0cc(0x10f)](_0x5d2df4,undefined))console[_0x47b0cc(0xf3)](_0x47b0cc(0xe8));else typeof _0x5d2df4==='object'?console[_0x47b0cc(0xf3)](JSON[_0x47b0cc(0xea)](_0x5d2df4,null,0x2)):console['log'](_0x5d2df4);}function _0x27da(){const _0x2ebcf0=['\x20<key>\x22\x20to\x20remove\x20individual\x20values.','Cleared\x20local\x20overrides\x20for\x20\x22','keys','(not\x20set)','false','stringify','MfCEW','test','vgwNb','undefined','114XjJmcv','\x20\x20Note:\x20\x22','aERxw','\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.','log','MySTu','pHIvP','354336RQqBus','EzSIY','yMdeN','cloud','BhPwa','2300787kMMaOA','includes','rKVwC','\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20','Removed\x20','parse','cyXeD','alsoExistsElsewhere','zZtOR','4342872VeVHBL','eDkay','jIZDg','true','YMXFc','1379070cFThdS','6002ablhcF','\x20for\x20\x22','ruhHF','Key\x20\x22','kind','bNxUR','epEOz','FztYG','EgkCA','KhyDo','object','2342459pJELEn','\x22\x20not\x20found','DeuSO','local','startsWith','isNaN','25784XIdsla','3dIgunf'];_0x27da=function(){return _0x2ebcf0;};return _0x27da();}export async function configList(_0x4124ae){const _0x4c3154=_0xa39a,_0x439b73={'eoEzG':function(_0xfb0467,_0x57d53a){return _0xfb0467===_0x57d53a;},'pwSpW':_0x4c3154(0xf9),'cyXeD':function(_0x2db701,_0xb0c4a7){return _0x2db701(_0xb0c4a7);},'pHIvP':function(_0x30a51a,_0x8e681d){return _0x30a51a(_0x8e681d);}},_0x30a81d=await resolveProfileTarget(_0x4124ae);if(_0x439b73['eoEzG'](_0x30a81d['kind'],_0x439b73['pwSpW'])){const _0x4febad=await loadEffectiveCloudSettings(_0x4124ae);if(!_0x4febad||_0x439b73['eoEzG'](Object[_0x4c3154(0xe7)](_0x4febad)['length'],0x0)){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x4124ae+'\x22');return;}console[_0x4c3154(0xf3)](JSON[_0x4c3154(0xea)](_0x4febad,null,0x2));return;}const _0x568a18=_0x439b73[_0x4c3154(0x101)](getSettingsPath,_0x4124ae);if(!_0x439b73['cyXeD'](existsSync,_0x568a18)){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x4124ae+'\x22');return;}const _0x3e11c4=await _0x439b73[_0x4c3154(0xf5)](loadSettings,_0x4124ae),_0x2cdf44=_0x439b73['pHIvP'](formatSettings,_0x3e11c4);!_0x2cdf44?console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x4124ae+'\x22'):console[_0x4c3154(0xf3)](_0x2cdf44);}export async function configUnset(_0x5a2697,_0x46e7a5){const _0x4a4b3b=_0xa39a,_0x12a673={'jqyNz':'cloud','yNCvC':function(_0xb77a57){return _0xb77a57();},'jIZDg':function(_0x311d14){return _0x311d14();},'MfCEW':function(_0x6f3c89,_0x42f355){return _0x6f3c89(_0x42f355);}},_0x36cc9d=await resolveProfileTarget(_0x5a2697);if(_0x36cc9d['kind']===_0x12a673['jqyNz']){if(_0x36cc9d[_0x4a4b3b(0x102)])printDualExistsHint(_0x5a2697);const _0x50dbb5=unsetProfileOverride(_0x12a673['yNCvC'](getProjectPath),_0x5a2697,_0x46e7a5);_0x50dbb5?console['log'](_0x4a4b3b(0xff)+_0x46e7a5+_0x4a4b3b(0x10b)+_0x5a2697+'\x22'):console['log']('Key\x20\x22'+_0x46e7a5+_0x4a4b3b(0xde));return;}const _0x36ec44=unsetProfileOverride(_0x12a673[_0x4a4b3b(0x106)](getProjectPath),_0x5a2697,_0x46e7a5);if(_0x36ec44){console[_0x4a4b3b(0xf3)]('Removed\x20'+_0x46e7a5);return;}const _0x4690ce=await _0x12a673[_0x4a4b3b(0xeb)](loadSettings,_0x5a2697),_0x3c6109=deleteNestedValue(_0x4690ce,_0x46e7a5);_0x3c6109?console['log']('Key\x20\x22'+_0x46e7a5+'\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22'+_0x5a2697+_0x4a4b3b(0xf2)):console['log'](_0x4a4b3b(0x10d)+_0x46e7a5+_0x4a4b3b(0xde));}export async function configReset(_0x42f78){const _0x2a57fa=_0xa39a,_0x2a302c={'yMdeN':function(_0x267be6,_0x50f758){return _0x267be6(_0x50f758);},'AwWhy':function(_0x4da2aa,_0x22d013,_0x4c38be){return _0x4da2aa(_0x22d013,_0x4c38be);},'KhyDo':function(_0x52920b){return _0x52920b();}},_0x4a8b3c=await _0x2a302c[_0x2a57fa(0xf8)](resolveProfileTarget,_0x42f78);if(_0x4a8b3c[_0x2a57fa(0x10e)]==='cloud'){_0x2a302c['AwWhy'](resetProfileOverrides,_0x2a302c[_0x2a57fa(0xdb)](getProjectPath),_0x42f78),console[_0x2a57fa(0xf3)](_0x2a57fa(0xe6)+_0x42f78+'\x22');return;}console[_0x2a57fa(0xf3)]('\x22'+_0x42f78+'\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20'+_0x42f78+_0x2a57fa(0xe5));}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(_0x4ece87,_0x484600){const _0x4c200e=_0x32c4,_0x11bc79=_0x4ece87();while(!![]){try{const _0x55092b=parseInt(_0x4c200e(0x1ca))/0x1*(parseInt(_0x4c200e(0x1c8))/0x2)+parseInt(_0x4c200e(0x1cc))/0x3+parseInt(_0x4c200e(0x1bf))/0x4*(parseInt(_0x4c200e(0x1b7))/0x5)+-parseInt(_0x4c200e(0x1c1))/0x6+-parseInt(_0x4c200e(0x1cb))/0x7+-parseInt(_0x4c200e(0x1c5))/0x8*(-parseInt(_0x4c200e(0x1ba))/0x9)+-parseInt(_0x4c200e(0x1c3))/0xa;if(_0x55092b===_0x484600)break;else _0x11bc79['push'](_0x11bc79['shift']());}catch(_0x73e98b){_0x11bc79['push'](_0x11bc79['shift']());}}}(_0x330f,0x6412b));import _0x2b72cc from'inquirer';import{deleteCloudProfile,fetchCloudProfile}from'./utils/cloudProfile.js';function _0x32c4(_0x316858,_0x3135a3){_0x316858=_0x316858-0x1b6;const _0x330f8a=_0x330f();let _0x32c46f=_0x330f8a[_0x316858];return _0x32c46f;}import{isInteractive}from'./utils/cloudProfileSession.js';import{clearLastProfile,resetProfileOverrides}from'./utils/projectsConfig.js';function _0x330f(){const _0x590663=['2109425zeTdau','cwd','Cloud\x20profile\x20\x22','15417HeEQUJ','prompt','yes','wgIwo','Profile\x20deletion\x20requires\x20an\x20interactive\x20terminal\x20so\x20the\x20profile\x20name\x20can\x20be\x20typed\x20for\x20confirmation.\x20Pass\x20--yes\x20to\x20skip\x20confirmation.','4mBVJaJ','\x22\x20not\x20found.','21342AzsAyb','log','10888070rHLheU','Type\x20\x22','3512MHzBYU','\x0aWarning:\x20this\x20deletes\x20the\x20shared\x20cloud\x20profile\x20\x22','pUwEl','8828aUVyPC','UdtyE','56oTKWmd','1400035vHJeAW','843576PbTEUB','CWTrI'];_0x330f=function(){return _0x590663;};return _0x330f();}export async function deleteProfile(_0x5ee168,_0x42d709={}){const _0x1b138c=_0x32c4,_0x2849a4={'oBPnj':function(_0x4610dc,_0x45b5fe){return _0x4610dc(_0x45b5fe);},'eOvvP':function(_0x508887){return _0x508887();},'CWTrI':_0x1b138c(0x1be),'iJjOW':'confirmation','wgIwo':function(_0x14e3ca,_0x178296){return _0x14e3ca!==_0x178296;},'pCNkP':'Profile\x20deletion\x20cancelled:\x20confirmation\x20did\x20not\x20match.','pUwEl':function(_0x715046,_0x4922f7){return _0x715046(_0x4922f7);},'UdtyE':function(_0x27564f,_0x24cca3,_0x53419b){return _0x27564f(_0x24cca3,_0x53419b);}},_0x8cf4b9=await _0x2849a4['oBPnj'](fetchCloudProfile,_0x5ee168);if(!_0x8cf4b9)throw new Error(_0x1b138c(0x1b9)+_0x5ee168+_0x1b138c(0x1c0));if(!_0x42d709[_0x1b138c(0x1bc)]&&!_0x2849a4['eOvvP'](isInteractive))throw new Error(_0x2849a4[_0x1b138c(0x1b6)]);console['log'](_0x1b138c(0x1c6)+_0x5ee168+'\x22\x20for\x20everyone\x20in\x20your\x20organization.');if(!_0x42d709['yes']){const {confirmation:_0x93a3eb}=await _0x2b72cc[_0x1b138c(0x1bb)]([{'type':'input','name':_0x2849a4['iJjOW'],'message':_0x1b138c(0x1c4)+_0x5ee168+'\x22\x20to\x20confirm\x20deletion:'}]);if(_0x2849a4[_0x1b138c(0x1bd)](_0x93a3eb,_0x5ee168))throw new Error(_0x2849a4['pCNkP']);}await _0x2849a4[_0x1b138c(0x1c7)](deleteCloudProfile,_0x5ee168),resetProfileOverrides(process['cwd'](),_0x5ee168),_0x2849a4[_0x1b138c(0x1c9)](clearLastProfile,process[_0x1b138c(0x1b8)](),_0x5ee168),console[_0x1b138c(0x1c2)]('✓\x20Deleted\x20cloud\x20profile\x20\x22'+_0x5ee168+'\x22.');}
|
package/build/commands/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x11c7e5=_0x386c;(function(_0x428efb,_0x5da917){const _0x43089b=_0x386c,_0x3e6b62=_0x428efb();while(!![]){try{const _0x1b1d3f=-parseInt(_0x43089b(0x1c2))/0x1+parseInt(_0x43089b(0x1c4))/0x2*(-parseInt(_0x43089b(0x1d6))/0x3)+-parseInt(_0x43089b(0x1d7))/0x4*(-parseInt(_0x43089b(0x1d8))/0x5)+-parseInt(_0x43089b(0x1af))/0x6*(parseInt(_0x43089b(0x1bc))/0x7)+-parseInt(_0x43089b(0x1cb))/0x8*(parseInt(_0x43089b(0x1ba))/0x9)+-parseInt(_0x43089b(0x1d4))/0xa+parseInt(_0x43089b(0x1d2))/0xb;if(_0x1b1d3f===_0x5da917)break;else _0x3e6b62['push'](_0x3e6b62['shift']());}catch(_0x21d672){_0x3e6b62['push'](_0x3e6b62['shift']());}}}(_0x54b1,0xb1191));import{readdir,stat}from'fs/promises';import{join}from'path';function _0x54b1(){const _0xbcb2f4=['name','558821Emjalv','\x0a*\x20=\x20active\x20profile','2MejZuz','startsWith','rRhqN','mjtLz','message','hDvsn','legacy','776gZEARo','UYRdQ','environmentDetails','baseUrl','isDirectory','Ifcyr','reports','16514960ZUdRXG','yPfyg','1357130HQgVIf','\x0aNo\x20profiles\x20found.','1405263TtdyFL','1984fobPBu','13470qIiUMr','LDLrt','sessionUpdatedAt','LNnde','local','settings.json','localeCompare','6sDKzPo','log','error','POsTI','sNHcr','Run:\x20ranger\x20profile\x20add\x20<profile-name>','includes','push','\x0aCloud\x20Profiles:','length','\x0aLocal\x20Profiles\x20(legacy):','86301xdtAQA','bug-bashes','133721xoZIDq','environmentKey','no\x20session','aiAYE','.txt'];_0x54b1=function(){return _0xbcb2f4;};return _0x54b1();}import{existsSync}from'fs';import{getRangerDir}from'./utils/rangerRoot.js';import{loadSettings}from'./utils/settings.js';import{readActiveProfileName}from'./utils/activeProfile.js';import{getToken}from'./utils/keychain.js';import{listCloudProfiles}from'./utils/cloudProfile.js';function _0x386c(_0x32656e,_0x2ed736){_0x32656e=_0x32656e-0x1af;const _0x54b11e=_0x54b1();let _0x386c7f=_0x54b11e[_0x32656e];return _0x386c7f;}const NON_ENV_DIRS=['sessions',_0x11c7e5(0x1bb),_0x11c7e5(0x1d1),_0x11c7e5(0x1dc),'ci'];export async function getEnvNames(){const _0x7deb89=_0x11c7e5,_0x5880c3={'aiAYE':function(_0x1b2800){return _0x1b2800();},'LNnde':function(_0x43694d,_0x3aa599){return _0x43694d(_0x3aa599);},'POsTI':function(_0x425159,_0x543566){return _0x425159(_0x543566);},'LKxBl':function(_0x4412f6,_0x308d4f){return _0x4412f6(_0x308d4f);},'UYRdQ':_0x7deb89(0x1c0),'LDLrt':function(_0x24df05,_0x1a1f30,_0x231dba){return _0x24df05(_0x1a1f30,_0x231dba);},'IZPlx':function(_0x51e549,_0xb45c32,_0x3362f5){return _0x51e549(_0xb45c32,_0x3362f5);},'yPfyg':_0x7deb89(0x1dd),'hDvsn':_0x7deb89(0x1ca)},_0x38c4c5=_0x5880c3[_0x7deb89(0x1bf)](getRangerDir);if(!_0x5880c3['LNnde'](existsSync,_0x38c4c5))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x5a3f0c=await readActiveProfileName(),_0x52df63=[],_0x5219a6={},_0x159cea=join(_0x38c4c5,_0x7deb89(0x1dc));if(_0x5880c3['POsTI'](existsSync,_0x159cea)){const _0xc3ccb7=await _0x5880c3[_0x7deb89(0x1db)](readdir,_0x159cea);for(const _0x178769 of _0xc3ccb7){const _0x309ce2=join(_0x159cea,_0x178769),_0x27d636=await _0x5880c3[_0x7deb89(0x1b2)](stat,_0x309ce2);_0x27d636[_0x7deb89(0x1cf)]()&&(_0x52df63[_0x7deb89(0x1b6)](_0x178769),_0x5219a6[_0x178769]='local');}}const _0x1cc4fe=join(_0x38c4c5,'ci');if(_0x5880c3['LKxBl'](existsSync,_0x1cc4fe)){const _0x2b90db=await readdir(_0x1cc4fe);for(const _0x5d510f of _0x2b90db){const _0x1f74e4=join(_0x1cc4fe,_0x5d510f),_0x2864c7=await stat(_0x1f74e4);_0x2864c7[_0x7deb89(0x1cf)]()&&(_0x52df63[_0x7deb89(0x1b6)](_0x5d510f),_0x5219a6[_0x5d510f]='ci');}}const _0x24cea1=await _0x5880c3['LKxBl'](readdir,_0x38c4c5);for(const _0xd8f55c of _0x24cea1){if(NON_ENV_DIRS[_0x7deb89(0x1b5)](_0xd8f55c))continue;if(_0xd8f55c[_0x7deb89(0x1c5)]('.'))continue;if(_0xd8f55c['endsWith'](_0x5880c3[_0x7deb89(0x1cc)]))continue;const _0xbad7d0=_0x5880c3[_0x7deb89(0x1d9)](join,_0x38c4c5,_0xd8f55c),_0x111731=await stat(_0xbad7d0);_0x111731[_0x7deb89(0x1cf)]()&&existsSync(_0x5880c3['IZPlx'](join,_0xbad7d0,_0x5880c3[_0x7deb89(0x1d3)]))&&(!_0x52df63[_0x7deb89(0x1b5)](_0xd8f55c)&&(_0x52df63['push'](_0xd8f55c),_0x5219a6[_0xd8f55c]=_0x5880c3[_0x7deb89(0x1c9)]));}return{'envNames':_0x52df63,'activeEnv':_0x5a3f0c,'envTypes':_0x5219a6};}export async function envList(){const _0x10b32d=_0x11c7e5,_0x1a9bac={'tcDyL':function(_0x3096f3){return _0x3096f3();},'Ifcyr':function(_0x4644f6){return _0x4644f6();},'XudCf':function(_0xd2987f,_0x217987){return _0xd2987f===_0x217987;},'mjtLz':function(_0x23732d,_0x19919e){return _0x23732d>_0x19919e;},'rRhqN':function(_0x52bc89,_0x2f16da){return _0x52bc89===_0x2f16da;},'sNHcr':'legacy'},{envNames:_0x29b71b,activeEnv:_0x519a50,envTypes:_0x51a947}=await getEnvNames();let _0x3ec7d0=[];const _0x3766e0=await _0x1a9bac['tcDyL'](getToken);if(_0x3766e0)try{_0x3ec7d0=await _0x1a9bac[_0x10b32d(0x1d0)](listCloudProfiles);}catch(_0x29a947){console[_0x10b32d(0x1b1)]('\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profiles:\x20'+(_0x29a947 instanceof Error?_0x29a947[_0x10b32d(0x1c8)]:String(_0x29a947)));}if(_0x29b71b[_0x10b32d(0x1b8)]===0x0&&_0x1a9bac['XudCf'](_0x3ec7d0[_0x10b32d(0x1b8)],0x0)){console[_0x10b32d(0x1b0)](_0x10b32d(0x1d5)),console['log'](_0x10b32d(0x1b4));return;}const _0x295a59=new Set(_0x3ec7d0['map'](_0x3479c4=>_0x3479c4['name']));if(_0x1a9bac['mjtLz'](_0x29b71b['length'],0x0)){console['log'](_0x10b32d(0x1b9));for(const _0x54d59c of _0x29b71b['sort']()){const _0x1d9548=_0x1a9bac[_0x10b32d(0x1c6)](_0x54d59c,_0x519a50)&&!_0x295a59['has'](_0x54d59c),_0x59f647=_0x51a947[_0x54d59c]||_0x10b32d(0x1dc),_0x2626da=await loadSettings(_0x54d59c),_0x48ba80=_0x59f647===_0x1a9bac[_0x10b32d(0x1b3)]?'':'\x20['+_0x59f647+']';console[_0x10b32d(0x1b0)]('\x20\x20'+(_0x1d9548?'*\x20':'\x20\x20')+_0x54d59c+_0x48ba80),_0x2626da[_0x10b32d(0x1ce)]&&console['log']('\x20\x20\x20\x20\x20\x20URL:\x20'+_0x2626da['baseUrl']),_0x2626da[_0x10b32d(0x1cd)]&&console['log']('\x20\x20\x20\x20\x20\x20Details:\x20'+_0x2626da['environmentDetails']);}}if(_0x1a9bac[_0x10b32d(0x1c7)](_0x3ec7d0['length'],0x0)){console['log'](_0x10b32d(0x1b7));for(const _0x4cdf7a of _0x3ec7d0['sort']((_0x40ffcb,_0x522742)=>_0x40ffcb['name'][_0x10b32d(0x1de)](_0x522742['name']))){const _0x71d86f=_0x4cdf7a[_0x10b32d(0x1c1)]===_0x519a50,_0x3955ed=_0x4cdf7a['environmentKey']?'\x20('+_0x4cdf7a[_0x10b32d(0x1bd)]+')':'',_0x568df7=_0x4cdf7a[_0x10b32d(0x1da)]?'cached\x20(updated\x20'+_0x4cdf7a['sessionUpdatedAt']+')':_0x10b32d(0x1be);console['log']('\x20\x20'+(_0x71d86f?'*\x20':'\x20\x20')+_0x4cdf7a['name']+'\x20[cloud]'+_0x3955ed),console[_0x10b32d(0x1b0)]('\x20\x20\x20\x20\x20\x20Session:\x20'+_0x568df7);}}_0x519a50&&console[_0x10b32d(0x1b0)](_0x10b32d(0x1c3));}
|