@ranger-testing/ranger-cli 3.1.4 → 3.1.5-alpha.0c090c6-50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/novaActCli.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/organizationEnvApi.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/rangerwrightCli.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/scenarioOriginCheck.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/tunnelClient.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 -1
- package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
- package/package.json +6 -3
package/build/commands/addEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x102815,_0x59c963){const _0x4b34b8=_0x1829,_0x2fb6f6=_0x102815();while(!![]){try{const _0x201fcc=parseInt(_0x4b34b8(0x231))/0x1+parseInt(_0x4b34b8(0x276))/0x2*(parseInt(_0x4b34b8(0x223))/0x3)+-parseInt(_0x4b34b8(0x22f))/0x4+-parseInt(_0x4b34b8(0x22b))/0x5+-parseInt(_0x4b34b8(0x1f3))/0x6*(parseInt(_0x4b34b8(0x23e))/0x7)+parseInt(_0x4b34b8(0x1ef))/0x8*(parseInt(_0x4b34b8(0x207))/0x9)+-parseInt(_0x4b34b8(0x21d))/0xa*(-parseInt(_0x4b34b8(0x241))/0xb);if(_0x201fcc===_0x59c963)break;else _0x2fb6f6['push'](_0x2fb6f6['shift']());}catch(_0x3872d7){_0x2fb6f6['push'](_0x2fb6f6['shift']());}}}(_0xc060,0x40fbe));import{readdir,rm}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x1829(_0xbb85f9,_0xba1ebd){_0xbb85f9=_0xbb85f9-0x1ee;const _0xc060f4=_0xc060();let _0x182945=_0xc060f4[_0xbb85f9];return _0x182945;}import _0x33d178 from'inquirer';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 _0x18aec2=_0x1829;if(!process[_0x18aec2(0x24b)]['isTTY'])return;console['warn'](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x44879b){const _0x1cd7e0=_0x1829,_0x28da17={'UYYlI':function(_0x7b9cbf,_0x4b4902,_0x50f9ee){return _0x7b9cbf(_0x4b4902,_0x50f9ee);},'CfZwI':_0x1cd7e0(0x1f4),'ROSfb':function(_0x599f03,_0x29dc5c,_0x1f6899){return _0x599f03(_0x29dc5c,_0x1f6899);},'IBsjV':function(_0x4f8c19,_0x1ccdcf){return _0x4f8c19(_0x1ccdcf);},'ZgQDB':function(_0x3543a9,_0x5f2b53){return _0x3543a9<_0x5f2b53;},'EhhVR':_0x1cd7e0(0x246)};try{const _0x3b3e71=new AbortController(),_0x326f0e=_0x28da17[_0x1cd7e0(0x25a)](setTimeout,()=>_0x3b3e71['abort'](),0x1388),_0x3e8463={'method':_0x28da17['CfZwI'],'signal':_0x3b3e71[_0x1cd7e0(0x210)],'redirect':_0x1cd7e0(0x271)};/^https:\/\/localhost(:\d+)?/i['test'](_0x44879b)&&(process['env'][_0x1cd7e0(0x277)]='0');const _0xe7ab9c=await _0x28da17['ROSfb'](fetch,_0x44879b,_0x3e8463);delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'],_0x28da17['IBsjV'](clearTimeout,_0x326f0e);if(_0x28da17['ZgQDB'](_0xe7ab9c[_0x1cd7e0(0x214)],0x190))return{'ok':!![]};return{'ok':![],'error':_0x1cd7e0(0x26f)+_0xe7ab9c['status']};}catch(_0x20aabb){delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'];const _0x175e26=_0x20aabb,_0x1defcf=_0x175e26[_0x1cd7e0(0x1f5)]||_0x28da17[_0x1cd7e0(0x248)](String,_0x20aabb),_0x253c62=_0x1defcf['includes'](_0x28da17['EhhVR'])||_0x175e26[_0x1cd7e0(0x209)]==='TypeError'||_0x1defcf['includes']('fetch\x20failed');return{'ok':![],'error':_0x1defcf,'isProtocolError':_0x253c62};}}async function sweepOrphanLocalProfile(_0x4d5465,_0x3a25d5,_0x2f1ebf){const _0x18ef6e=_0x1829,_0xde4197={'LSIWK':_0x18ef6e(0x22d),'OxcrE':function(_0x4e324c,_0x19dc36,_0x4713ad){return _0x4e324c(_0x19dc36,_0x4713ad);},'zgnFk':function(_0x51ccd4,_0x528136){return _0x51ccd4(_0x528136);},'sVcYj':function(_0xda2f21,_0x4d3a26){return _0xda2f21(_0x4d3a26);},'yEjJZ':function(_0x443183,_0x56f962,_0x281646){return _0x443183(_0x56f962,_0x281646);}},_0x35aa2c=join(_0x3a25d5,_0xde4197['LSIWK']),_0x43f42e=_0xde4197[_0x18ef6e(0x25f)](join,_0x35aa2c,_0x4d5465);_0xde4197[_0x18ef6e(0x242)](existsSync,_0x43f42e)&&(_0x2f1ebf&&await _0xde4197['sVcYj'](isPathGitTracked,_0x43f42e)?console[_0x18ef6e(0x219)]('\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20'+_0x43f42e+_0x18ef6e(0x262)):(await _0xde4197['yEjJZ'](rm,_0x43f42e,{'recursive':!![],'force':!![]}),console['log'](_0x18ef6e(0x245)+_0x43f42e)));if(_0xde4197[_0x18ef6e(0x1f1)](existsSync,_0x35aa2c)){let _0x2970bf=[];try{_0x2970bf=await _0xde4197['zgnFk'](readdir,_0x35aa2c);}catch{return;}const _0x516ad7='.tmp-'+_0x4d5465+'-';for(const _0x3c6c60 of _0x2970bf){if(!_0x3c6c60[_0x18ef6e(0x216)](_0x516ad7))continue;const _0xac2d79=join(_0x35aa2c,_0x3c6c60);await rm(_0xac2d79,{'recursive':!![],'force':!![]}),console[_0x18ef6e(0x219)](_0x18ef6e(0x245)+_0xac2d79);}}}async function sweepOrphansBestEffort(_0x4d0e60){const _0x1ae122=_0x1829,_0x38fb0a={'DEKUh':function(_0x1099da,_0x2509c5,_0x4fb4c6,_0x354796){return _0x1099da(_0x2509c5,_0x4fb4c6,_0x354796);},'vzSwc':function(_0x58bdc5){return _0x58bdc5();},'RCmff':function(_0x158849){return _0x158849();},'EyJAN':function(_0xf47bc7,_0x1007b2){return _0xf47bc7 instanceof _0x1007b2;},'VoGxk':function(_0x1a44b7,_0x4b3b78){return _0x1a44b7(_0x4b3b78);}};try{await _0x38fb0a[_0x1ae122(0x252)](sweepOrphanLocalProfile,_0x4d0e60,_0x38fb0a['vzSwc'](getRangerHomeDir),![]);const _0x3e604d=getRangerDir();_0x3e604d!==_0x38fb0a['RCmff'](getRangerHomeDir)&&await sweepOrphanLocalProfile(_0x4d0e60,_0x3e604d,!![]);}catch(_0x522030){console[_0x1ae122(0x219)](_0x1ae122(0x213)+(_0x38fb0a['EyJAN'](_0x522030,Error)?_0x522030['message']:_0x38fb0a['VoGxk'](String,_0x522030))+').');}}async function markActive(_0xc2d4dd){const _0x1a5967=_0x1829,_0x4ec062={'mpEjv':function(_0x517538,_0x2ddeb2){return _0x517538(_0x2ddeb2);},'XXqdq':_0x1a5967(0x1fb)};try{await _0x4ec062[_0x1a5967(0x222)](writeActiveProfileName,_0xc2d4dd),console[_0x1a5967(0x219)]('\x20\x20Set\x20active\x20profile:\x20'+_0xc2d4dd);}catch{console[_0x1a5967(0x219)](_0x4ec062['XXqdq']);}}async function tryAutoRouteCloudProfile(_0x3f541a,_0x575e8b,_0x14ae6e,_0x14537e,_0x19b1dd){const _0x530a25=_0x1829,_0x30ae0d={'FsGHn':function(_0x5202f6,_0x52be3a){return _0x5202f6===_0x52be3a;},'KjOaF':_0x530a25(0x21a),'xaSvC':function(_0x31701e,_0x2d92d0){return _0x31701e instanceof _0x2d92d0;},'Wgqpa':function(_0x493a33,_0x1ef7a8){return _0x493a33(_0x1ef7a8);},'bykma':function(_0x5cc1cb,_0x2842f9,_0x1a28cc,_0x5e50a6,_0x14e643){return _0x5cc1cb(_0x2842f9,_0x1a28cc,_0x5e50a6,_0x14e643);},'DFNfT':'no_auth_config','KsZEU':function(_0x24e9fd,_0x3f4090){return _0x24e9fd+_0x3f4090;},'iiTWo':function(_0xf582f2,_0xd409ee){return _0xf582f2+_0xd409ee;},'bbvLE':'\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','qDoNW':'\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a','vedyA':_0x530a25(0x218),'RAflW':_0x530a25(0x23d),'aAJKy':'\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','bYyxs':function(_0x53c495,_0x4b9f4d,_0x573e2e){return _0x53c495(_0x4b9f4d,_0x573e2e);},'bqCMT':_0x530a25(0x24e),'woYZN':'\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','hgYxG':function(_0x449f36,_0x5f054a,_0x550a74,_0x325728){return _0x449f36(_0x5f054a,_0x550a74,_0x325728);},'CQhMw':function(_0x991395){return _0x991395();},'EterQ':function(_0x4e1179,_0x5c1632){return _0x4e1179+_0x5c1632;},'CfmuJ':function(_0x5e84e0,_0x5c196c){return _0x5e84e0(_0x5c196c);}};let _0x349f55;try{_0x349f55=await fetchAuthConfig();}catch(_0xc6173f){return _0x19b1dd?.['trackPhaseEnd'](_0x30ae0d[_0x530a25(0x239)],{'reason':_0x530a25(0x247),'profileName':_0x3f541a}),console['error']('\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20'+(_0x30ae0d['xaSvC'](_0xc6173f,Error)?_0xc6173f[_0x530a25(0x1f5)]:_0x30ae0d[_0x530a25(0x243)](String,_0xc6173f))),![];}if((!_0x349f55||!_0x349f55[_0x530a25(0x261)]||Object['keys'](_0x349f55[_0x530a25(0x261)])['length']===0x0)&&!_0x14ae6e['authEnv']){if(_0x14537e)return await _0x30ae0d['bykma'](captureEnvLessProfile,_0x3f541a,_0x575e8b,_0x14ae6e,_0x19b1dd);return _0x19b1dd?.[_0x530a25(0x1f9)](_0x30ae0d['KjOaF'],{'reason':_0x30ae0d['DFNfT'],'profileName':_0x3f541a}),console['error'](_0x30ae0d['KsZEU'](_0x30ae0d['iiTWo'](_0x30ae0d[_0x530a25(0x201)],'\x0a')+_0x530a25(0x269),_0x530a25(0x20d)+_0x3f541a+_0x530a25(0x1f2)+_0x575e8b+'\x20--skip-auth\x0a')+'\x0a'+_0x30ae0d['qDoNW']+_0x30ae0d[_0x530a25(0x263)]),![];}let _0x3fe42e;if(_0x14ae6e['authEnv']){if(!_0x349f55?.['environments']?.[_0x14ae6e['authEnv']]){const _0x430ff3=Object['keys'](_0x349f55?.['environments']??{});return _0x19b1dd?.['trackPhaseEnd'](_0x30ae0d[_0x530a25(0x239)],{'reason':_0x30ae0d[_0x530a25(0x229)],'profileName':_0x3f541a}),console[_0x530a25(0x21e)]('\x0a\x20\x20Auth\x20environment\x20\x22'+_0x14ae6e[_0x530a25(0x268)]+_0x530a25(0x234)+(_0x430ff3['length']?_0x530a25(0x279)+_0x430ff3['join'](',\x20')+'.':_0x30ae0d['aAJKy'])),![];}_0x3fe42e=_0x14ae6e['authEnv'];}else _0x3fe42e=_0x30ae0d[_0x530a25(0x20c)](matchAuthEnvironment,_0x575e8b,_0x349f55);if(!_0x3fe42e)return _0x19b1dd?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':_0x30ae0d['bqCMT'],'profileName':_0x3f541a}),console['error'](_0x530a25(0x266)+_0x575e8b+_0x530a25(0x204)+Object['keys'](_0x349f55?.['environments']??{})[_0x530a25(0x259)](',\x20')+'.'),![];const _0x5dc512=_0x349f55?.[_0x530a25(0x261)]?.[_0x3fe42e],_0x2304ad=_0x5dc512?.['domains']??[];if(_0x14537e&&!_0x14ae6e[_0x530a25(0x264)]){const {saveToCloud:_0x142c34}=await _0x33d178[_0x530a25(0x25b)]([{'type':_0x530a25(0x24c),'name':_0x530a25(0x200),'message':'Found\x20auth\x20environment\x20\x27'+_0x3fe42e+'\x27\x20matching\x20'+_0x575e8b+_0x530a25(0x26d)+_0x2304ad['join'](',\x20')+')\x0a\x20\x20Save\x20\x27'+_0x3f541a+'\x27\x20to\x20the\x20cloud?','default':!![]}]);if(!_0x142c34)return _0x19b1dd?.[_0x530a25(0x1f9)](_0x530a25(0x21a),{'reason':_0x530a25(0x272),'profileName':_0x3f541a}),console['error'](_0x30ae0d['woYZN']),![];}const _0x4c90eb=_0x2304ad[_0x530a25(0x1fc)](_0x1bf869=>{const _0x1ceabe=_0x530a25;try{return _0x30ae0d['FsGHn'](new URL(_0x1bf869)[_0x1ceabe(0x278)],new URL(_0x575e8b)[_0x1ceabe(0x278)]);}catch{return![];}}),_0x3014fa={};!_0x4c90eb&&(_0x3014fa['baseUrl']=_0x575e8b);try{await _0x30ae0d['hgYxG'](createCloudProfile,_0x3f541a,_0x3fe42e,{'settings':_0x3014fa}),_0x30ae0d['CQhMw'](warnCloudProfileSharedInOrg);}catch(_0x4b347e){if(_0x4b347e instanceof ApiError&&_0x4b347e['status']===0x199){console['error'](_0x30ae0d['EterQ'](_0x530a25(0x240)+_0x3f541a+_0x530a25(0x236),_0x530a25(0x22c)+_0x3f541a));throw _0x4b347e;}throw _0x4b347e;}return console[_0x530a25(0x219)](_0x30ae0d['KsZEU']('✓\x20Profile\x20\x27'+_0x3f541a+'\x27\x20created.\x0a',_0x530a25(0x24d)+_0x3f541a)),await _0x30ae0d[_0x530a25(0x274)](sweepOrphansBestEffort,_0x3f541a),_0x19b1dd?.['trackPhaseEnd'](_0x530a25(0x260),{'envKey':_0x3fe42e,'profileName':_0x3f541a}),!![];}function _0xc060(){const _0x3aacde=['1640920FvjxNg','setupHeader','165053yldieC','capture','EYiHX','\x22\x20not\x20found.','setupHeaders','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','slice','baseUrl','KjOaF','cwd','IrQFA','\x0a🌐\x20Profile\x20Setup\x0a','env_not_found','55167rbvLvr','iWDSd','\x0a\x20\x20A\x20profile\x20named\x20\x22','59851JfbRkv','zgnFk','Wgqpa','keys','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','Invalid\x20URL','no_auth_config','IBsjV','vbDQX','mCmGu','stdout','confirm','\x20\x20Next:\x20ranger\x20go\x20--profile\x20','no_match','\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22','\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a','\x27\x20created\x20with\x20a\x20captured\x20session.\x0a','DEKUh','IMvES','onSrb','ZDOKf','Use\x20','cdpEndpoint','QIZcX','join','UYYlI','prompt','lyFLg','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','url','OxcrE','profile.add.autoRouted','environments','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.','vedyA','yes','Invalid\x20--setup-header\x20format:\x20\x22','\x0a\x20\x20No\x20auth\x20env\x20matches\x20','RaHMR','authEnv','\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a','wpONR','Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','xhqCH','\x0a\x20\x20(domains:\x20','GhEvs','HTTP\x20','VtqPi','manual','user_declined','length','CfmuJ','abMOd','172ysXqAG','NODE_TLS_REJECT_UNAUTHORIZED','origin','\x20Configured\x20envs:\x20','Could\x20not\x20reach\x20','\x22.\x20Expected\x20\x22Name:\x20Value\x22.','8NPCKrn','✓\x20Profile\x20\x27','sVcYj','\x20--url\x20','114mqCmhh','HEAD','message','for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a','list','FYqec','trackPhaseEnd','WkqFz','Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.','some','hFtQQ','loFTX','\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20','saveToCloud','bbvLE','\x22:\x20','rczhM','.\x20Pass\x20--env\x20<key>\x20to\x20pick\x20one,\x20or\x20use\x20--skip-auth.\x20Configured\x20envs:\x20','OKoCq','What\x20would\x20you\x20like\x20to\x20do?','3775293hqezfx','The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a','name','continue','http://localhost:3000','bYyxs','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20','trim','TaGuH','signal','KkdAM','action','\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','status','rqWWb','startsWith','exit','\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','log','profile.add.autoRouteSkipped','skipAuth','--cdp-endpoint\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20a\x20CDP\x20profile\x20connects\x20to\x20an\x20existing\x20browser\x20and\x20has\x20no\x20auth\x20environment.','510EwZIez','error','MChAz','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','force','mpEjv','8031lhAdVw','test','lnGUB','isProtocolError','\x20\x20Did\x20you\x20mean\x20','--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','RAflW','`\x20again\x20without\x20--skip-auth.','1330500doKOSH','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','local','\x0a✓\x20Profile\x20\x27'];_0xc060=function(){return _0x3aacde;};return _0xc060();}async function createUnconfiguredCloudProfile(_0x55afef,_0x283c99){const _0x3d3f16=_0x1829,_0x1efe95={'eWVop':function(_0x2db1b9,_0xae8b09,_0xf5c6f2,_0x475180){return _0x2db1b9(_0xae8b09,_0xf5c6f2,_0x475180);},'sWzbX':function(_0x14de56){return _0x14de56();},'loFTX':function(_0x236f40,_0x5dee5c){return _0x236f40===_0x5dee5c;}};try{await _0x1efe95['eWVop'](createCloudProfile,_0x55afef,undefined,{'settings':_0x283c99}),_0x1efe95['sWzbX'](warnCloudProfileSharedInOrg);}catch(_0x565164){_0x565164 instanceof ApiError&&_0x1efe95[_0x3d3f16(0x1fe)](_0x565164['status'],0x199)&&console[_0x3d3f16(0x21e)](_0x3d3f16(0x240)+_0x55afef+_0x3d3f16(0x236)+(_0x3d3f16(0x22c)+_0x55afef));throw _0x565164;}}async function captureEnvLessProfile(_0x55b7e6,_0xb2a911,_0x52400a,_0x389895){const _0x5aa85d=_0x1829,_0x460cc2={'rqWWb':'confirm','iDDQL':_0x5aa85d(0x232),'qNhbU':'user_declined','xhqCH':function(_0x5d33cf,_0x251582){return _0x5d33cf+_0x251582;},'MChAz':function(_0x3db90e,_0x4e3fd8){return _0x3db90e>_0x4e3fd8;},'lnGUB':function(_0x459426){return _0x459426();},'RaHMR':function(_0x1555bb,_0x285da3){return _0x1555bb>_0x285da3;}};if(!_0x52400a[_0x5aa85d(0x264)]){const {capture:_0x2a8336}=await _0x33d178[_0x5aa85d(0x25b)]([{'type':_0x460cc2[_0x5aa85d(0x215)],'name':_0x460cc2['iDDQL'],'message':_0x5aa85d(0x26b),'default':!![]}]);if(!_0x2a8336)return _0x389895?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':_0x460cc2['qNhbU'],'profileName':_0x55b7e6}),console['error']('\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 _0x19c66c={};if(_0x52400a[_0x5aa85d(0x230)])for(const _0x5cd7c2 of _0x52400a['setupHeader']){const _0x18f318=_0x5cd7c2['indexOf'](':');if(_0x18f318===-0x1)continue;_0x19c66c[_0x5cd7c2['slice'](0x0,_0x18f318)['trim']()]=_0x5cd7c2['slice'](_0x460cc2[_0x5aa85d(0x26c)](_0x18f318,0x1))[_0x5aa85d(0x20e)]();}const _0x8ce281={'baseUrl':_0xb2a911};_0x460cc2[_0x5aa85d(0x21f)](Object[_0x5aa85d(0x244)](_0x19c66c)[_0x5aa85d(0x273)],0x0)&&(_0x8ce281[_0x5aa85d(0x235)]=_0x19c66c);let _0x4a6f77;try{_0x4a6f77=await createCloudProfile(_0x55b7e6,undefined,{'settings':_0x8ce281}),_0x460cc2[_0x5aa85d(0x225)](warnCloudProfileSharedInOrg);}catch(_0x407c23){_0x407c23 instanceof ApiError&&_0x407c23[_0x5aa85d(0x214)]===0x199&&console[_0x5aa85d(0x21e)]('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x55b7e6+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a'+(_0x5aa85d(0x22c)+_0x55b7e6));throw _0x407c23;}return await manualBrowserLogin(_0x4a6f77,{'key':'','domains':[_0xb2a911],'setupHeaders':_0x460cc2[_0x5aa85d(0x267)](Object['keys'](_0x19c66c)[_0x5aa85d(0x273)],0x0)?_0x19c66c:undefined}),console[_0x5aa85d(0x219)](_0x5aa85d(0x22e)+_0x55b7e6+_0x5aa85d(0x251)+('\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x55b7e6)),await sweepOrphansBestEffort(_0x55b7e6),_0x389895?.['trackPhaseEnd']('profile.add.autoRouted',{'envKey':null,'profileName':_0x55b7e6}),!![];}export async function addEnv(_0x1ca5fa,_0x11fbd0={},_0x4fbd86){const _0x50da65=_0x1829,_0x576e4e={'IMvES':function(_0x15723c,_0x36cead){return _0x15723c+_0x36cead;},'JTLIe':function(_0x2961c9,_0x441c8c){return _0x2961c9+_0x441c8c;},'TaGuH':'To\x20set\x20up\x20a\x20profile,\x20run:\x0a','FIEZi':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','arhyd':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','rczhM':'\x20\x20https://docs.ranger.net/main/concepts/profiles','lyFLg':function(_0x4089a8,_0xf63f5b){return _0x4089a8===_0xf63f5b;},'feHom':function(_0x1e97b0,_0x452970){return _0x1e97b0!==_0x452970;},'mCmGu':'--skip-auth\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20--skip-auth\x20makes\x20an\x20env-less\x20profile,\x20--env\x20binds\x20one\x20to\x20an\x20auth\x20environment.','KkdAM':_0x50da65(0x21c),'nSlLz':'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','abMOd':'\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','ZDOKf':function(_0x20d783,_0x5459e9){return _0x20d783>_0x5459e9;},'WkqFz':function(_0xa90d64,_0x1759be,_0x342450){return _0xa90d64(_0x1759be,_0x342450);},'TfbFq':'isElectron','FYqec':function(_0x21b199,_0x13c035){return _0x21b199(_0x13c035);},'OKoCq':function(_0x538016,_0x49e69c){return _0x538016(_0x49e69c);},'QIZcX':function(_0x4db911,_0x485c1f,_0x659643){return _0x4db911(_0x485c1f,_0x659643);},'paYrz':function(_0x11ee82,_0x3a638d){return _0x11ee82(_0x3a638d);},'lSMBl':_0x50da65(0x23c),'ktQtD':_0x50da65(0x25d),'iOEYQ':_0x50da65(0x250),'iWDSd':_0x50da65(0x238),'hFtQQ':'Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','wpONR':function(_0x26d6aa,_0x19a14b){return _0x26d6aa||_0x19a14b;},'vbDQX':function(_0x19430c,_0x5016f7){return _0x19430c(_0x5016f7);},'VtqPi':_0x50da65(0x212),'TvAVY':'use_suggestion','TTxZi':'retry','onSrb':function(_0x431d23,_0x4d3374){return _0x431d23===_0x4d3374;},'IrQFA':function(_0xd16662,_0x1be086){return _0xd16662(_0x1be086);},'EYiHX':_0x50da65(0x20a),'GhEvs':function(_0x528cd5,_0x161179,_0x3e95c6,_0x54fe2a,_0x53a290,_0xafb43c){return _0x528cd5(_0x161179,_0x3e95c6,_0x54fe2a,_0x53a290,_0xafb43c);}};_0x11fbd0['ci']&&(console['error'](_0x576e4e[_0x50da65(0x253)](_0x576e4e['IMvES'](_0x576e4e['JTLIe'](_0x576e4e['IMvES'](_0x50da65(0x208)+_0x50da65(0x1f6),'\x0a')+_0x576e4e[_0x50da65(0x20f)],_0x576e4e['FIEZi']),'\x0a')+_0x576e4e['arhyd'],_0x576e4e[_0x50da65(0x203)])),process[_0x50da65(0x217)](0x1));const _0x14ffa0={};if(_0x11fbd0['setupHeader'])for(const _0x132fdd of _0x11fbd0['setupHeader']){const _0x1a152c=_0x132fdd['indexOf'](':');if(_0x576e4e[_0x50da65(0x25c)](_0x1a152c,-0x1))throw new Error(_0x50da65(0x265)+_0x132fdd+_0x50da65(0x1ee));const _0x52db3f=_0x132fdd['slice'](0x0,_0x1a152c)[_0x50da65(0x20e)](),_0x54a646=_0x132fdd[_0x50da65(0x237)](_0x1a152c+0x1)['trim']();_0x14ffa0[_0x52db3f]=_0x54a646;}if(_0x576e4e['feHom'](_0x11fbd0['cdpEndpoint'],undefined)&&_0x11fbd0[_0x50da65(0x257)]['trim']()==='')throw new Error(_0x50da65(0x228));if(_0x11fbd0[_0x50da65(0x257)]&&_0x11fbd0[_0x50da65(0x25e)])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(_0x11fbd0[_0x50da65(0x268)]&&_0x11fbd0['skipAuth'])throw new Error(_0x576e4e[_0x50da65(0x24a)]);if(_0x11fbd0['authEnv']&&_0x11fbd0[_0x50da65(0x257)])throw new Error(_0x576e4e[_0x50da65(0x211)]);const _0x4a60a5=Boolean(_0x11fbd0[_0x50da65(0x257)]),_0x3d2a27=isInteractive();if(!_0x3d2a27&&!_0x11fbd0[_0x50da65(0x25e)]&&!_0x4a60a5&&!_0x11fbd0[_0x50da65(0x21b)])throw new Error(_0x576e4e['nSlLz']);if(_0x4a60a5){const _0x111bdd=_0x11fbd0['cdpEndpoint'];console['log'](_0x576e4e[_0x50da65(0x275)]),console['log'](_0x50da65(0x1ff)+_0x111bdd);const _0x269cd0={'cdpEndpoint':_0x111bdd,'isElectron':!![]};_0x576e4e[_0x50da65(0x255)](Object['keys'](_0x14ffa0)[_0x50da65(0x273)],0x0)&&(_0x269cd0[_0x50da65(0x235)]=_0x14ffa0);await _0x576e4e[_0x50da65(0x1fa)](createUnconfiguredCloudProfile,_0x1ca5fa,_0x269cd0);try{setProfileOverride(process['cwd'](),_0x1ca5fa,'cdpEndpoint',_0x111bdd),setProfileOverride(process[_0x50da65(0x23a)](),_0x1ca5fa,_0x576e4e['TfbFq'],!![]);}catch(_0x50c085){console[_0x50da65(0x21e)]('\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20'+(_0x50c085 instanceof Error?_0x50c085['message']:_0x576e4e['FYqec'](String,_0x50c085)));}console[_0x50da65(0x219)]('✓\x20Cloud\x20profile\x20\x27'+_0x1ca5fa+'\x27\x20created\x20(CDP).'),await _0x576e4e[_0x50da65(0x205)](sweepOrphansBestEffort,_0x1ca5fa),await _0x576e4e[_0x50da65(0x1f8)](markActive,_0x1ca5fa);return;}if(_0x11fbd0[_0x50da65(0x21b)]){const _0x3065d3={};_0x11fbd0[_0x50da65(0x25e)]&&(_0x3065d3['baseUrl']=_0x11fbd0['url']);Object[_0x50da65(0x244)](_0x14ffa0)['length']>0x0&&(_0x3065d3[_0x50da65(0x235)]=_0x14ffa0);await _0x576e4e[_0x50da65(0x258)](createUnconfiguredCloudProfile,_0x1ca5fa,_0x3065d3),console['log'](_0x576e4e['JTLIe'](_0x50da65(0x1f0)+_0x1ca5fa+'\x27\x20created\x20(no\x20session).\x0a','\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20'+_0x1ca5fa+_0x50da65(0x22a))),await _0x576e4e['paYrz'](sweepOrphansBestEffort,_0x1ca5fa),await markActive(_0x1ca5fa);return;}if(_0x11fbd0[_0x50da65(0x25e)]){const _0x2bfd41=_0x11fbd0[_0x50da65(0x25e)],_0x47edc5=await checkUrlReachability(_0x2bfd41);if(!_0x47edc5['ok']&&!_0x11fbd0[_0x50da65(0x221)])throw new Error(_0x50da65(0x27a)+_0x2bfd41+':\x20'+_0x47edc5['error']+'\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.');!_0x47edc5['ok']&&_0x11fbd0[_0x50da65(0x221)]&&console[_0x50da65(0x219)]('⚠\x20Could\x20not\x20reach\x20'+_0x2bfd41+':\x20'+_0x47edc5['error']+'\x20(continuing\x20with\x20--force)');}else{console['log'](_0x576e4e['lSMBl']),console['log'](_0x576e4e['ktQtD']),console['log'](_0x576e4e['iOEYQ']);let _0x3560e2='',_0x309f75=![];while(!![]){const _0x3afcee=await _0x33d178[_0x50da65(0x25b)]([{'type':'input','name':_0x576e4e[_0x50da65(0x23f)],'message':_0x309f75?_0x576e4e[_0x50da65(0x1fd)]:_0x50da65(0x220),'default':_0x576e4e[_0x50da65(0x26a)](_0x3560e2,_0x50da65(0x20b))}]);_0x3560e2=_0x3afcee['baseUrl'];const _0x410529=await _0x576e4e[_0x50da65(0x249)](checkUrlReachability,_0x3560e2);if(_0x410529['ok'])break;const _0x210686=/^[a-zA-Z][\w+.-]*:\/\//[_0x50da65(0x224)](_0x3560e2),_0x32bd3d=_0x410529[_0x50da65(0x226)]&&!_0x210686,_0x2f42c2=_0x32bd3d?'http://'+_0x3560e2:null;_0x309f75=!![],console[_0x50da65(0x219)]('\x0a\x20\x20Could\x20not\x20reach\x20'+_0x3560e2+':\x20'+_0x410529['error']);_0x2f42c2&&console['log'](_0x50da65(0x227)+_0x2f42c2+'?');const {action:_0x59d6c9}=await _0x33d178[_0x50da65(0x25b)]([{'type':_0x50da65(0x1f7),'name':_0x576e4e[_0x50da65(0x270)],'message':_0x50da65(0x206),'choices':[..._0x2f42c2?[{'name':_0x50da65(0x256)+_0x2f42c2,'value':_0x576e4e['TvAVY']}]:[],{'name':'Enter\x20a\x20different\x20URL','value':_0x576e4e['TTxZi']},{'name':'Continue\x20anyway','value':'continue'}]}]);if(_0x576e4e[_0x50da65(0x254)](_0x59d6c9,_0x576e4e['TvAVY'])&&_0x2f42c2){_0x3560e2=_0x2f42c2;const _0x14dc96=await _0x576e4e[_0x50da65(0x23b)](checkUrlReachability,_0x3560e2);if(_0x14dc96['ok'])break;console['log']('\x0a\x20\x20Still\x20could\x20not\x20reach\x20'+_0x3560e2+':\x20'+_0x14dc96[_0x50da65(0x21e)]);}else{if(_0x576e4e['onSrb'](_0x59d6c9,_0x576e4e[_0x50da65(0x233)]))break;}}_0x11fbd0={..._0x11fbd0,'url':_0x3560e2};}let _0x4caaaf=![];try{_0x4caaaf=await _0x576e4e[_0x50da65(0x26e)](tryAutoRouteCloudProfile,_0x1ca5fa,_0x11fbd0[_0x50da65(0x25e)],_0x11fbd0,_0x3d2a27,_0x4fbd86);}catch(_0x1c2255){console['error'](_0x50da65(0x24f)+_0x1ca5fa+_0x50da65(0x202)+(_0x1c2255 instanceof Error?_0x1c2255[_0x50da65(0x1f5)]:String(_0x1c2255))),process[_0x50da65(0x217)](0x1);}!_0x4caaaf&&process[_0x50da65(0x217)](0x1),await markActive(_0x1ca5fa);}
|
|
1
|
+
(function(_0x1c2323,_0xf8a57b){const _0x1ba0bf=_0x1094,_0x49a024=_0x1c2323();while(!![]){try{const _0x2b24ef=-parseInt(_0x1ba0bf(0x15d))/0x1*(parseInt(_0x1ba0bf(0x15e))/0x2)+parseInt(_0x1ba0bf(0x1b4))/0x3*(parseInt(_0x1ba0bf(0x18d))/0x4)+parseInt(_0x1ba0bf(0x14a))/0x5*(-parseInt(_0x1ba0bf(0x16a))/0x6)+-parseInt(_0x1ba0bf(0x169))/0x7*(parseInt(_0x1ba0bf(0x195))/0x8)+parseInt(_0x1ba0bf(0x13b))/0x9*(parseInt(_0x1ba0bf(0x15a))/0xa)+parseInt(_0x1ba0bf(0x171))/0xb*(parseInt(_0x1ba0bf(0x13a))/0xc)+parseInt(_0x1ba0bf(0x194))/0xd*(parseInt(_0x1ba0bf(0x13f))/0xe);if(_0x2b24ef===_0xf8a57b)break;else _0x49a024['push'](_0x49a024['shift']());}catch(_0x35e72a){_0x49a024['push'](_0x49a024['shift']());}}}(_0x2025,0x5fa44));import{readdir,rm}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x1094(_0x3f4bd0,_0x59f690){_0x3f4bd0=_0x3f4bd0-0x137;const _0x20250f=_0x2025();let _0x10948d=_0x20250f[_0x3f4bd0];return _0x10948d;}import _0x4ab354 from'inquirer';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 _0x306c90=_0x1094;if(!process['stdout'][_0x306c90(0x178)])return;console['warn'](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x25b819){const _0x869a38=_0x1094,_0x2d82a5={'hCbrb':function(_0x41adf4,_0x34b387,_0x4ae91d){return _0x41adf4(_0x34b387,_0x4ae91d);},'TAzGf':'manual','dXeUC':function(_0x545419,_0x1c2695){return _0x545419<_0x1c2695;},'jQyUv':'Invalid\x20URL','baGZN':_0x869a38(0x160),'sGYJu':_0x869a38(0x175)};try{const _0x1f77a1=new AbortController(),_0x4f2a90=_0x2d82a5['hCbrb'](setTimeout,()=>_0x1f77a1['abort'](),0x1388),_0x411ec6={'method':_0x869a38(0x137),'signal':_0x1f77a1['signal'],'redirect':_0x2d82a5[_0x869a38(0x1a3)]};/^https:\/\/localhost(:\d+)?/i[_0x869a38(0x1ae)](_0x25b819)&&(process['env'][_0x869a38(0x19c)]='0');const _0x298763=await fetch(_0x25b819,_0x411ec6);delete process['env'][_0x869a38(0x19c)],clearTimeout(_0x4f2a90);if(_0x2d82a5[_0x869a38(0x197)](_0x298763[_0x869a38(0x149)],0x190))return{'ok':!![]};return{'ok':![],'error':_0x869a38(0x168)+_0x298763['status']};}catch(_0x9bb97d){delete process[_0x869a38(0x166)][_0x869a38(0x19c)];const _0xc00267=_0x9bb97d,_0x57a04a=_0xc00267['message']||String(_0x9bb97d),_0x3aec43=_0x57a04a[_0x869a38(0x170)](_0x2d82a5[_0x869a38(0x150)])||_0xc00267[_0x869a38(0x16f)]===_0x2d82a5['baGZN']||_0x57a04a[_0x869a38(0x170)](_0x2d82a5['sGYJu']);return{'ok':![],'error':_0x57a04a,'isProtocolError':_0x3aec43};}}function _0x2025(){const _0x120a0d=['VWBwe','ltqRV','test','⚠\x20Could\x20not\x20reach\x20','length','tCyoH','cdpEndpoint','profile.add.autoRouted','492573TNSyQu','\x20(continuing\x20with\x20--force)','XvaMb','trackPhaseEnd','join','dTfKY','YSLuV','domains',')\x0a\x20\x20Save\x20\x27','ZyqHB','skipAuth','kstaZ','JkWCc','\x0a\x20\x20A\x20profile\x20named\x20\x22','HEAD','Use\x20','isElectron','263760iInjRe','135PXzZdU','keys','yes','\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20','14126cyeemg','\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','setupHeaders','\x20Configured\x20envs:\x20','gPWgF','uzXZf','trim','nvsPs','message','\x27\x20to\x20the\x20cloud?','status','5yKduss','\x20--url\x20','\x0a\x20\x20No\x20auth\x20env\x20matches\x20','✓\x20Cloud\x20profile\x20\x27','retry','error','jQyUv','baseUrl','--cdp-endpoint\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20a\x20CDP\x20profile\x20connects\x20to\x20an\x20existing\x20browser\x20and\x20has\x20no\x20auth\x20environment.','✓\x20Profile\x20\x27','action','user_declined','environments','aXzqO','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','BxnPo','264230vHQYSo','Invalid\x20--setup-header\x20format:\x20\x22','zDAdV','4ZSBMfa','1574KBVYrA','JqUWt','TypeError','authEnv','What\x20would\x20you\x20like\x20to\x20do?','JSDJF','exit','\x27\x20matching\x20','env','prompt','HTTP\x20','602FXKaze','1335546byDclT','uFvWv','The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a','`\x20again\x20without\x20--skip-auth.','\x22:\x20','name','includes','165qnRzso','.\x20Pass\x20--env\x20<key>\x20to\x20pick\x20one,\x20or\x20use\x20--skip-auth.\x20Configured\x20envs:\x20','VzUJx','kMwGh','fetch\x20failed','Found\x20auth\x20environment\x20\x27','To\x20set\x20up\x20a\x20profile,\x20run:\x0a','isTTY','FbAHt','Ycpit','\x27\x20created\x20(CDP).','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','pbEIj','url','ipypU','some','force','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','Continue\x20anyway','\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','\x27\x20created\x20with\x20a\x20captured\x20session.\x0a','\x0a\x20\x20Still\x20could\x20not\x20reach\x20','dAmdi','OhuZh','\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a','\x22\x20not\x20found.','XERWg','4MnNHvZ','use_suggestion','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a','setupHeader','confirm','Could\x20not\x20reach\x20','KDKgU','1677xYDUmC','37480CZQcYi','FhlMN','dXeUC','PGIlu','AKOxe','profile.add.autoRouteSkipped','log','NODE_TLS_REJECT_UNAUTHORIZED','ziauw','\x20\x20https://docs.ranger.net/main/concepts/profiles','\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','ujXSN','http://localhost:3000','RrcdP','TAzGf','slice','\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20','RfuNG','\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.','TbQqj','env_not_found','isProtocolError','Enter\x20a\x20different\x20URL'];_0x2025=function(){return _0x120a0d;};return _0x2025();}async function sweepOrphanLocalProfile(_0xa245f4,_0x4dee9e,_0x24f8dc){const _0x2dee58=_0x1094,_0x2c6fc5={'fKutM':function(_0x542e08,_0x3ab7e7){return _0x542e08(_0x3ab7e7);},'aGnAI':function(_0x40cb7f,_0x56e63e){return _0x40cb7f(_0x56e63e);},'pbEIj':function(_0x3d8521,_0x59ddc6,_0x34edc6){return _0x3d8521(_0x59ddc6,_0x34edc6);}},_0xde23aa=join(_0x4dee9e,'local'),_0xe7e120=join(_0xde23aa,_0xa245f4);existsSync(_0xe7e120)&&(_0x24f8dc&&await isPathGitTracked(_0xe7e120)?console[_0x2dee58(0x19b)](_0x2dee58(0x1a5)+_0xe7e120+'\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.'):(await rm(_0xe7e120,{'recursive':!![],'force':!![]}),console[_0x2dee58(0x19b)]('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0xe7e120)));if(_0x2c6fc5['fKutM'](existsSync,_0xde23aa)){let _0x148238=[];try{_0x148238=await _0x2c6fc5['aGnAI'](readdir,_0xde23aa);}catch{return;}const _0x4ff1d6='.tmp-'+_0xa245f4+'-';for(const _0x77e61f of _0x148238){if(!_0x77e61f['startsWith'](_0x4ff1d6))continue;const _0x13b531=_0x2c6fc5[_0x2dee58(0x17d)](join,_0xde23aa,_0x77e61f);await rm(_0x13b531,{'recursive':!![],'force':!![]}),console[_0x2dee58(0x19b)](_0x2dee58(0x158)+_0x13b531);}}}async function sweepOrphansBestEffort(_0x4f8f67){const _0x3b1509=_0x1094,_0x3d8add={'aXzqO':function(_0x3e647b){return _0x3e647b();},'dAmdi':function(_0x416972){return _0x416972();},'PGIlu':function(_0x5f1a73,_0x4438a8,_0x3e03ea,_0x5eca74){return _0x5f1a73(_0x4438a8,_0x3e03ea,_0x5eca74);},'AKOxe':function(_0x31819a,_0x20fa5e){return _0x31819a(_0x20fa5e);}};try{await sweepOrphanLocalProfile(_0x4f8f67,_0x3d8add[_0x3b1509(0x157)](getRangerHomeDir),![]);const _0x1c8b57=_0x3d8add[_0x3b1509(0x188)](getRangerDir);_0x1c8b57!==getRangerHomeDir()&&await _0x3d8add[_0x3b1509(0x198)](sweepOrphanLocalProfile,_0x4f8f67,_0x1c8b57,!![]);}catch(_0x680737){console[_0x3b1509(0x19b)](_0x3b1509(0x140)+(_0x680737 instanceof Error?_0x680737[_0x3b1509(0x147)]:_0x3d8add[_0x3b1509(0x199)](String,_0x680737))+').');}}async function markActive(_0x421adb){try{await writeActiveProfileName(_0x421adb),console['log']('\x20\x20Set\x20active\x20profile:\x20'+_0x421adb);}catch{console['log']('Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.');}}async function tryAutoRouteCloudProfile(_0x127ac4,_0x158ff2,_0x56aa9d,_0x2cc3cd,_0x58e5b7){const _0x36fc2e=_0x1094,_0x1435fc={'xDVeh':function(_0x594cfe,_0x53d4fd){return _0x594cfe===_0x53d4fd;},'ZvWoi':function(_0x30710b){return _0x30710b();},'JkWCc':'no_auth_config','OVhXM':function(_0x401340,_0x1cd8e1,_0x1a7cea,_0x25e75c,_0x2e2a65){return _0x401340(_0x1cd8e1,_0x1a7cea,_0x25e75c,_0x2e2a65);},'EfNcW':function(_0x1ac19c,_0x2cb406){return _0x1ac19c+_0x2cb406;},'Ycpit':function(_0x6fc3fd,_0x560c39){return _0x6fc3fd+_0x560c39;},'vPABR':function(_0x1b9f9a,_0x3d44aa){return _0x1b9f9a+_0x3d44aa;},'ujXSN':_0x36fc2e(0x19f),'EQdOe':_0x36fc2e(0x18a),'JSDJF':'\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a','OBGYh':_0x36fc2e(0x1a9),'YSLuV':function(_0x327a6c,_0x5b0829){return _0x327a6c+_0x5b0829;},'ZyIyW':'\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','vGysX':'no_match','ziauw':'saveToCloud','PkFTh':'profile.add.autoRouteSkipped','yDZuX':'\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','BxofX':function(_0x99d370,_0x1ba29d){return _0x99d370===_0x1ba29d;},'TbQqj':function(_0x40a251,_0x121be0){return _0x40a251(_0x121be0);},'ltqRV':_0x36fc2e(0x1b3)};let _0xcb9a03;try{_0xcb9a03=await _0x1435fc['ZvWoi'](fetchAuthConfig);}catch(_0x6e53a6){return _0x58e5b7?.[_0x36fc2e(0x1b7)](_0x36fc2e(0x19a),{'reason':_0x1435fc[_0x36fc2e(0x1c0)],'profileName':_0x127ac4}),console[_0x36fc2e(0x14f)]('\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20'+(_0x6e53a6 instanceof Error?_0x6e53a6['message']:String(_0x6e53a6))),![];}if((!_0xcb9a03||!_0xcb9a03['environments']||Object['keys'](_0xcb9a03[_0x36fc2e(0x156)])[_0x36fc2e(0x1b0)]===0x0)&&!_0x56aa9d[_0x36fc2e(0x161)]){if(_0x2cc3cd)return await _0x1435fc['OVhXM'](captureEnvLessProfile,_0x127ac4,_0x158ff2,_0x56aa9d,_0x58e5b7);return _0x58e5b7?.['trackPhaseEnd'](_0x36fc2e(0x19a),{'reason':'no_auth_config','profileName':_0x127ac4}),console[_0x36fc2e(0x14f)](_0x1435fc['EfNcW'](_0x1435fc['Ycpit'](_0x1435fc['vPABR'](_0x1435fc[_0x36fc2e(0x1a0)]+'\x0a',_0x1435fc['EQdOe']),'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20'+_0x127ac4+_0x36fc2e(0x14b)+_0x158ff2+'\x20--skip-auth\x0a')+'\x0a'+_0x1435fc[_0x36fc2e(0x163)],_0x36fc2e(0x185))),![];}let _0x219c30;if(_0x56aa9d[_0x36fc2e(0x161)]){if(!_0xcb9a03?.['environments']?.[_0x56aa9d['authEnv']]){const _0x4d5f7a=Object[_0x36fc2e(0x13c)](_0xcb9a03?.[_0x36fc2e(0x156)]??{});return _0x58e5b7?.['trackPhaseEnd'](_0x36fc2e(0x19a),{'reason':_0x1435fc['OBGYh'],'profileName':_0x127ac4}),console['error'](_0x1435fc[_0x36fc2e(0x1ba)]('\x0a\x20\x20Auth\x20environment\x20\x22'+_0x56aa9d['authEnv']+_0x36fc2e(0x18b),_0x4d5f7a[_0x36fc2e(0x1b0)]?_0x36fc2e(0x142)+_0x4d5f7a[_0x36fc2e(0x1b8)](',\x20')+'.':_0x1435fc['ZyIyW'])),![];}_0x219c30=_0x56aa9d['authEnv'];}else _0x219c30=matchAuthEnvironment(_0x158ff2,_0xcb9a03);if(!_0x219c30)return _0x58e5b7?.[_0x36fc2e(0x1b7)](_0x36fc2e(0x19a),{'reason':_0x1435fc['vGysX'],'profileName':_0x127ac4}),console[_0x36fc2e(0x14f)](_0x36fc2e(0x14c)+_0x158ff2+_0x36fc2e(0x172)+Object['keys'](_0xcb9a03?.[_0x36fc2e(0x156)]??{})['join'](',\x20')+'.'),![];const _0x323fa3=_0xcb9a03?.[_0x36fc2e(0x156)]?.[_0x219c30],_0x235a1a=_0x323fa3?.[_0x36fc2e(0x1bb)]??[];if(_0x2cc3cd&&!_0x56aa9d[_0x36fc2e(0x13d)]){const {saveToCloud:_0x2a05e5}=await _0x4ab354['prompt']([{'type':_0x36fc2e(0x191),'name':_0x1435fc[_0x36fc2e(0x19d)],'message':_0x36fc2e(0x176)+_0x219c30+_0x36fc2e(0x165)+_0x158ff2+'\x0a\x20\x20(domains:\x20'+_0x235a1a['join'](',\x20')+_0x36fc2e(0x1bc)+_0x127ac4+_0x36fc2e(0x148),'default':!![]}]);if(!_0x2a05e5)return _0x58e5b7?.[_0x36fc2e(0x1b7)](_0x1435fc['PkFTh'],{'reason':_0x36fc2e(0x155),'profileName':_0x127ac4}),console[_0x36fc2e(0x14f)](_0x1435fc['yDZuX']),![];}const _0x3c19d3=_0x235a1a[_0x36fc2e(0x180)](_0x3bac15=>{try{return _0x1435fc['xDVeh'](new URL(_0x3bac15)['origin'],new URL(_0x158ff2)['origin']);}catch{return![];}}),_0x5b14a3={};!_0x3c19d3&&(_0x5b14a3[_0x36fc2e(0x151)]=_0x158ff2);try{await createCloudProfile(_0x127ac4,_0x219c30,{'settings':_0x5b14a3}),warnCloudProfileSharedInOrg();}catch(_0x47c1ca){if(_0x47c1ca instanceof ApiError&&_0x1435fc['BxofX'](_0x47c1ca['status'],0x199)){console[_0x36fc2e(0x14f)](_0x1435fc['YSLuV'](_0x36fc2e(0x1c1)+_0x127ac4+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a',_0x36fc2e(0x182)+_0x127ac4));throw _0x47c1ca;}throw _0x47c1ca;}return console[_0x36fc2e(0x19b)](_0x1435fc[_0x36fc2e(0x17a)]('✓\x20Profile\x20\x27'+_0x127ac4+'\x27\x20created.\x0a','\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x127ac4)),await _0x1435fc[_0x36fc2e(0x1a8)](sweepOrphansBestEffort,_0x127ac4),_0x58e5b7?.['trackPhaseEnd'](_0x1435fc[_0x36fc2e(0x1ad)],{'envKey':_0x219c30,'profileName':_0x127ac4}),!![];}async function createUnconfiguredCloudProfile(_0x365c80,_0x12c4f8){const _0x545762=_0x1094,_0xf8d8f6={'txtTK':function(_0x10fd6f,_0xb22c75,_0x20e22b,_0x5c5d43){return _0x10fd6f(_0xb22c75,_0x20e22b,_0x5c5d43);},'dTfKY':function(_0x572c8a){return _0x572c8a();},'XERWg':function(_0x38f52a,_0x6bf0e4){return _0x38f52a===_0x6bf0e4;},'crotj':function(_0x848086,_0x5f2b24){return _0x848086+_0x5f2b24;}};try{await _0xf8d8f6['txtTK'](createCloudProfile,_0x365c80,undefined,{'settings':_0x12c4f8}),_0xf8d8f6[_0x545762(0x1b9)](warnCloudProfileSharedInOrg);}catch(_0x3f8ee8){_0x3f8ee8 instanceof ApiError&&_0xf8d8f6[_0x545762(0x18c)](_0x3f8ee8['status'],0x199)&&console[_0x545762(0x14f)](_0xf8d8f6['crotj'](_0x545762(0x1c1)+_0x365c80+_0x545762(0x183),_0x545762(0x182)+_0x365c80));throw _0x3f8ee8;}}async function captureEnvLessProfile(_0x53bcf0,_0x2725c1,_0x29bbc4,_0x3e94e9){const _0x6172e1=_0x1094,_0x1503e8={'dRnqk':'confirm','tCyoH':'Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','RfuNG':function(_0x5736c9){return _0x5736c9();},'ZyqHB':function(_0x4ce8e5,_0x1d6377){return _0x4ce8e5+_0x1d6377;},'JdhWS':function(_0x821e0f,_0x40a95d){return _0x821e0f>_0x40a95d;},'ImPEk':_0x6172e1(0x1b3)};if(!_0x29bbc4[_0x6172e1(0x13d)]){const {capture:_0x2eb811}=await _0x4ab354[_0x6172e1(0x167)]([{'type':_0x1503e8['dRnqk'],'name':'capture','message':_0x1503e8[_0x6172e1(0x1b1)],'default':!![]}]);if(!_0x2eb811)return _0x3e94e9?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':_0x6172e1(0x155),'profileName':_0x53bcf0}),console['error'](_0x6172e1(0x18f)+'\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.'),![];}const _0x3ae965={};if(_0x29bbc4['setupHeader'])for(const _0x269c63 of _0x29bbc4[_0x6172e1(0x190)]){const _0x4fcaf4=_0x269c63['indexOf'](':');if(_0x4fcaf4===-0x1)continue;_0x3ae965[_0x269c63[_0x6172e1(0x1a4)](0x0,_0x4fcaf4)[_0x6172e1(0x145)]()]=_0x269c63[_0x6172e1(0x1a4)](_0x4fcaf4+0x1)[_0x6172e1(0x145)]();}const _0xdabb8b={'baseUrl':_0x2725c1};Object[_0x6172e1(0x13c)](_0x3ae965)['length']>0x0&&(_0xdabb8b[_0x6172e1(0x141)]=_0x3ae965);let _0xe20d97;try{_0xe20d97=await createCloudProfile(_0x53bcf0,undefined,{'settings':_0xdabb8b}),_0x1503e8[_0x6172e1(0x1a6)](warnCloudProfileSharedInOrg);}catch(_0x6e7549){_0x6e7549 instanceof ApiError&&_0x6e7549[_0x6172e1(0x149)]===0x199&&console[_0x6172e1(0x14f)](_0x1503e8[_0x6172e1(0x1bd)]('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x53bcf0+_0x6172e1(0x183),_0x6172e1(0x182)+_0x53bcf0));throw _0x6e7549;}return await manualBrowserLogin(_0xe20d97,{'key':'','domains':[_0x2725c1],'setupHeaders':_0x1503e8['JdhWS'](Object['keys'](_0x3ae965)[_0x6172e1(0x1b0)],0x0)?_0x3ae965:undefined}),console['log'](_0x1503e8[_0x6172e1(0x1bd)]('\x0a✓\x20Profile\x20\x27'+_0x53bcf0+_0x6172e1(0x186),'\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x53bcf0)),await sweepOrphansBestEffort(_0x53bcf0),_0x3e94e9?.[_0x6172e1(0x1b7)](_0x1503e8['ImPEk'],{'envKey':null,'profileName':_0x53bcf0}),!![];}export async function addEnv(_0x5ea665,_0x4bea2a={},_0x2d63b1){const _0x22199c=_0x1094,_0xb06ea={'uFvWv':function(_0x571c64,_0x3a2789){return _0x571c64+_0x3a2789;},'JqUWt':function(_0x2a6ccd,_0xb741af){return _0x2a6ccd+_0xb741af;},'jnleo':function(_0x3994f9,_0x525669){return _0x3994f9+_0x525669;},'OhuZh':function(_0x2428f0,_0xd1cabf){return _0x2428f0+_0xd1cabf;},'YjjAq':_0x22199c(0x177),'Rxgxq':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','DiDmV':function(_0x3d46eb,_0x54b084){return _0x3d46eb===_0x54b084;},'VWBwe':function(_0x2f7af2,_0x1d4811){return _0x2f7af2!==_0x1d4811;},'KDKgU':function(_0x168804,_0xad1d40){return _0x168804===_0xad1d40;},'WAuaN':'--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','kstaZ':'--skip-auth\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20--skip-auth\x20makes\x20an\x20env-less\x20profile,\x20--env\x20binds\x20one\x20to\x20an\x20auth\x20environment.','FAivo':_0x22199c(0x152),'zDAdV':function(_0x5a4de4,_0x4b45f4){return _0x5a4de4(_0x4b45f4);},'RxGPO':'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','QREHN':'\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','ipypU':function(_0x28d8f2,_0x2003d2,_0x210aed){return _0x28d8f2(_0x2003d2,_0x210aed);},'FhlMN':function(_0xdfdf11,_0x409dd4,_0x262fb2,_0x5222f2,_0x47f2aa){return _0xdfdf11(_0x409dd4,_0x262fb2,_0x5222f2,_0x47f2aa);},'gPWgF':_0x22199c(0x139),'uzXZf':function(_0x3a98f5,_0x53b999){return _0x3a98f5(_0x53b999);},'BxnPo':function(_0x3913f2,_0x1cac12){return _0x3913f2(_0x1cac12);},'FbAHt':function(_0xc9c26a,_0x214e4e){return _0xc9c26a>_0x214e4e;},'FYKQx':function(_0x8e0017,_0xea143b,_0x421365){return _0x8e0017(_0xea143b,_0x421365);},'BmVnn':function(_0x34e602,_0x380d2c){return _0x34e602(_0x380d2c);},'aOjJY':'\x0a🌐\x20Profile\x20Setup\x0a','XvaMb':_0x22199c(0x17c),'XthsH':'\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a','VzUJx':'input','kMwGh':'list','wKMrp':_0x22199c(0x162),'RrcdP':_0x22199c(0x18e),'ngIYZ':'continue','VVFHv':function(_0x4ad4be,_0x6c84b5){return _0x4ad4be===_0x6c84b5;},'nvsPs':function(_0x51f149,_0x2cb7f4,_0x74794e,_0x5e679d,_0x13e4ab,_0x1e68b8){return _0x51f149(_0x2cb7f4,_0x74794e,_0x5e679d,_0x13e4ab,_0x1e68b8);}};_0x4bea2a['ci']&&(console['error'](_0xb06ea[_0x22199c(0x16b)](_0xb06ea[_0x22199c(0x15f)](_0xb06ea['JqUWt'](_0xb06ea['jnleo'](_0xb06ea[_0x22199c(0x189)](_0xb06ea['OhuZh'](_0x22199c(0x16c),'for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a'),'\x0a'),_0xb06ea['YjjAq'])+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','\x0a'),_0xb06ea['Rxgxq']),_0x22199c(0x19e))),process[_0x22199c(0x164)](0x1));const _0x575b47={};if(_0x4bea2a['setupHeader'])for(const _0x3be3ce of _0x4bea2a['setupHeader']){const _0x4319e2=_0x3be3ce['indexOf'](':');if(_0xb06ea['DiDmV'](_0x4319e2,-0x1))throw new Error(_0x22199c(0x15b)+_0x3be3ce+'\x22.\x20Expected\x20\x22Name:\x20Value\x22.');const _0x13a03c=_0x3be3ce['slice'](0x0,_0x4319e2)[_0x22199c(0x145)](),_0xec8a5b=_0x3be3ce[_0x22199c(0x1a4)](_0xb06ea[_0x22199c(0x189)](_0x4319e2,0x1))['trim']();_0x575b47[_0x13a03c]=_0xec8a5b;}if(_0xb06ea[_0x22199c(0x1ac)](_0x4bea2a['cdpEndpoint'],undefined)&&_0xb06ea[_0x22199c(0x193)](_0x4bea2a[_0x22199c(0x1b2)][_0x22199c(0x145)](),''))throw new Error(_0xb06ea['WAuaN']);if(_0x4bea2a[_0x22199c(0x1b2)]&&_0x4bea2a[_0x22199c(0x17e)])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(_0x4bea2a['authEnv']&&_0x4bea2a['skipAuth'])throw new Error(_0xb06ea[_0x22199c(0x1bf)]);if(_0x4bea2a['authEnv']&&_0x4bea2a['cdpEndpoint'])throw new Error(_0xb06ea['FAivo']);const _0x4640ab=_0xb06ea[_0x22199c(0x15c)](Boolean,_0x4bea2a[_0x22199c(0x1b2)]),_0x493c30=isInteractive();if(!_0x493c30&&!_0x4bea2a[_0x22199c(0x17e)]&&!_0x4640ab&&!_0x4bea2a[_0x22199c(0x1be)])throw new Error(_0xb06ea['RxGPO']);if(_0x4640ab){const _0x1a513c=_0x4bea2a[_0x22199c(0x1b2)];console['log'](_0xb06ea['QREHN']),console[_0x22199c(0x19b)]('\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20'+_0x1a513c);const _0x232a97={'cdpEndpoint':_0x1a513c,'isElectron':!![]};Object['keys'](_0x575b47)['length']>0x0&&(_0x232a97[_0x22199c(0x141)]=_0x575b47);await _0xb06ea[_0x22199c(0x17f)](createUnconfiguredCloudProfile,_0x5ea665,_0x232a97);try{_0xb06ea[_0x22199c(0x196)](setProfileOverride,process['cwd'](),_0x5ea665,_0x22199c(0x1b2),_0x1a513c),setProfileOverride(process['cwd'](),_0x5ea665,_0xb06ea[_0x22199c(0x143)],!![]);}catch(_0x570c90){console[_0x22199c(0x14f)]('\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20'+(_0x570c90 instanceof Error?_0x570c90[_0x22199c(0x147)]:_0xb06ea[_0x22199c(0x144)](String,_0x570c90)));}console[_0x22199c(0x19b)](_0x22199c(0x14d)+_0x5ea665+_0x22199c(0x17b)),await _0xb06ea[_0x22199c(0x159)](sweepOrphansBestEffort,_0x5ea665),await _0xb06ea[_0x22199c(0x159)](markActive,_0x5ea665);return;}if(_0x4bea2a[_0x22199c(0x1be)]){const _0x514574={};_0x4bea2a['url']&&(_0x514574[_0x22199c(0x151)]=_0x4bea2a['url']);_0xb06ea[_0x22199c(0x179)](Object[_0x22199c(0x13c)](_0x575b47)['length'],0x0)&&(_0x514574[_0x22199c(0x141)]=_0x575b47);await _0xb06ea['FYKQx'](createUnconfiguredCloudProfile,_0x5ea665,_0x514574),console[_0x22199c(0x19b)](_0xb06ea['uFvWv'](_0x22199c(0x153)+_0x5ea665+'\x27\x20created\x20(no\x20session).\x0a',_0x22199c(0x13e)+_0x5ea665+_0x22199c(0x16d))),await sweepOrphansBestEffort(_0x5ea665),await markActive(_0x5ea665);return;}if(_0x4bea2a['url']){const _0x511b21=_0x4bea2a[_0x22199c(0x17e)],_0x3c064d=await _0xb06ea['BmVnn'](checkUrlReachability,_0x511b21);if(!_0x3c064d['ok']&&!_0x4bea2a[_0x22199c(0x181)])throw new Error(_0x22199c(0x192)+_0x511b21+':\x20'+_0x3c064d[_0x22199c(0x14f)]+_0x22199c(0x1a7));!_0x3c064d['ok']&&_0x4bea2a[_0x22199c(0x181)]&&console['log'](_0x22199c(0x1af)+_0x511b21+':\x20'+_0x3c064d['error']+_0x22199c(0x1b5));}else{console['log'](_0xb06ea['aOjJY']),console[_0x22199c(0x19b)](_0xb06ea[_0x22199c(0x1b6)]),console['log'](_0xb06ea['XthsH']);let _0x15e8cf='',_0x16b631=![];while(!![]){const _0x49e16a=await _0x4ab354['prompt']([{'type':_0xb06ea[_0x22199c(0x173)],'name':'baseUrl','message':_0x16b631?'Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):':'What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','default':_0x15e8cf||_0x22199c(0x1a1)}]);_0x15e8cf=_0x49e16a[_0x22199c(0x151)];const _0x172392=await checkUrlReachability(_0x15e8cf);if(_0x172392['ok'])break;const _0x55e384=/^[a-zA-Z][\w+.-]*:\/\//[_0x22199c(0x1ae)](_0x15e8cf),_0x530026=_0x172392[_0x22199c(0x1aa)]&&!_0x55e384,_0x4872e9=_0x530026?'http://'+_0x15e8cf:null;_0x16b631=!![],console[_0x22199c(0x19b)]('\x0a\x20\x20Could\x20not\x20reach\x20'+_0x15e8cf+':\x20'+_0x172392['error']);_0x4872e9&&console[_0x22199c(0x19b)]('\x20\x20Did\x20you\x20mean\x20'+_0x4872e9+'?');const {action:_0x325c14}=await _0x4ab354[_0x22199c(0x167)]([{'type':_0xb06ea[_0x22199c(0x174)],'name':_0x22199c(0x154),'message':_0xb06ea['wKMrp'],'choices':[..._0x4872e9?[{'name':_0x22199c(0x138)+_0x4872e9,'value':_0xb06ea[_0x22199c(0x1a2)]}]:[],{'name':_0x22199c(0x1ab),'value':_0x22199c(0x14e)},{'name':_0x22199c(0x184),'value':_0xb06ea['ngIYZ']}]}]);if(_0xb06ea['VVFHv'](_0x325c14,_0xb06ea[_0x22199c(0x1a2)])&&_0x4872e9){_0x15e8cf=_0x4872e9;const _0x14412d=await checkUrlReachability(_0x15e8cf);if(_0x14412d['ok'])break;console[_0x22199c(0x19b)](_0x22199c(0x187)+_0x15e8cf+':\x20'+_0x14412d[_0x22199c(0x14f)]);}else{if(_0x325c14==='continue')break;}}_0x4bea2a={..._0x4bea2a,'url':_0x15e8cf};}let _0x2b41da=![];try{_0x2b41da=await _0xb06ea[_0x22199c(0x146)](tryAutoRouteCloudProfile,_0x5ea665,_0x4bea2a['url'],_0x4bea2a,_0x493c30,_0x2d63b1);}catch(_0x2964c5){console['error']('\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22'+_0x5ea665+_0x22199c(0x16e)+(_0x2964c5 instanceof Error?_0x2964c5[_0x22199c(0x147)]:String(_0x2964c5))),process['exit'](0x1);}!_0x2b41da&&process['exit'](0x1),await markActive(_0x5ea665);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x160c(_0x54f36b,_0x55a828){_0x54f36b=_0x54f36b-0x197;var _0x477a5d=_0x477a();var _0x160cbd=_0x477a5d[_0x54f36b];return _0x160cbd;}(function(_0x48c57f,_0x3594f9){var _0x41bf3f=_0x160c,_0x1408e2=_0x48c57f();while(!![]){try{var _0x22ac31=-parseInt(_0x41bf3f(0x1a5))/0x1*(-parseInt(_0x41bf3f(0x1a8))/0x2)+-parseInt(_0x41bf3f(0x19d))/0x3+parseInt(_0x41bf3f(0x1a4))/0x4+parseInt(_0x41bf3f(0x19f))/0x5+-parseInt(_0x41bf3f(0x1a1))/0x6*(parseInt(_0x41bf3f(0x1a3))/0x7)+parseInt(_0x41bf3f(0x199))/0x8*(-parseInt(_0x41bf3f(0x19c))/0x9)+parseInt(_0x41bf3f(0x1a6))/0xa*(parseInt(_0x41bf3f(0x19b))/0xb);if(_0x22ac31===_0x3594f9)break;else _0x1408e2['push'](_0x1408e2['shift']());}catch(_0x36e230){_0x1408e2['push'](_0x1408e2['shift']());}}}(_0x477a,0xe987f));function _0x477a(){var _0x38debe=['209BkcwuV','18dYZaIi','2929953MmTmMj','IfGRX','9529790NrlYkz','error','96xBivLz','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','231322UQkbbP','4050856IfbSkD','73247nvpXCd','221170QLvbfh','nPgcM','22DPAPKL','ranger\x20profile\x20encrypt-auth\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x0a','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','6730728uxWyzO','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a'];_0x477a=function(){return _0x38debe;};return _0x477a();}export async function authEncrypt(_0x4c7b1e){var _0x30cdc=_0x160c,_0xddcb1f={'nPgcM':function(_0x56698d,_0x14b34b){return _0x56698d+_0x14b34b;},'qLhjc':function(_0x2c2a12,_0x57043a){return _0x2c2a12+_0x57043a;},'fvXDb':_0x30cdc(0x197),'IfGRX':_0x30cdc(0x19a)};console[_0x30cdc(0x1a0)](_0xddcb1f[_0x30cdc(0x1a7)](_0xddcb1f['nPgcM'](_0xddcb1f['nPgcM'](_0xddcb1f['qLhjc'](_0xddcb1f['fvXDb'],'session\x20state\x20for\x20you,\x20so\x20encrypted\x20on-disk\x20auth\x20is\x20unnecessary.\x0a'),'\x0a'),_0x30cdc(0x1a2)),_0x30cdc(0x198))+'\x0a'+_0xddcb1f[_0x30cdc(0x19e)]+'\x20\x20https://docs.ranger.net/main/concepts/profiles'),process['exit'](0x1);}
|
package/build/commands/clean.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5a673b=_0xc3db;(function(_0x2d4dfa,_0x1b3dcf){const _0x4d421e=_0xc3db,_0x286f7e=_0x2d4dfa();while(!![]){try{const _0x95e9f5=parseInt(_0x4d421e(0x199))/0x1*(parseInt(_0x4d421e(0x19f))/0x2)+parseInt(_0x4d421e(0x189))/0x3*(parseInt(_0x4d421e(0x17f))/0x4)+-parseInt(_0x4d421e(0x1a1))/0x5*(-parseInt(_0x4d421e(0x1a7))/0x6)+parseInt(_0x4d421e(0x198))/0x7+-parseInt(_0x4d421e(0x191))/0x8*(-parseInt(_0x4d421e(0x1aa))/0x9)+-parseInt(_0x4d421e(0x176))/0xa*(-parseInt(_0x4d421e(0x1a9))/0xb)+parseInt(_0x4d421e(0x171))/0xc*(-parseInt(_0x4d421e(0x18a))/0xd);if(_0x95e9f5===_0x1b3dcf)break;else _0x286f7e['push'](_0x286f7e['shift']());}catch(_0x42a0e2){_0x286f7e['push'](_0x286f7e['shift']());}}}(_0x2cb9,0xb1650));import{rm,readFile,writeFile}from'fs/promises';import{join}from'path';function _0xc3db(_0x1e79a2,_0x93aa80){_0x1e79a2=_0x1e79a2-0x16a;const _0x2cb9a0=_0x2cb9();let _0xc3db31=_0x2cb9a0[_0x1e79a2];return _0xc3db31;}import{existsSync}from'fs';import{spawn}from'child_process';import{deleteAllCredentials}from'./utils/keychain.js';import{getProjectRoot,getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getCacheFile}from'./utils/sessionCache.js';import{getOpencodeConfigDir,getOpencodeSkillsDir}from'./utils/opencodeConfig.js';const skillsToRemove=[_0x5a673b(0x1a3),_0x5a673b(0x179),'bug-bash','e2e-test-recommender'],opencodePluginName='@ranger-testing/opencode-plugin';function parseJsonc(_0x5b25de){const _0x3e99c8=_0x5a673b,_0x10d054=_0x5b25de[_0x3e99c8(0x188)](/\/\*[\s\S]*?\*\//g,''),_0x718dfe=_0x10d054['replace'](/^\s*\/\/.*$/gm,''),_0x145f3e=_0x718dfe['replace'](/,\s*([}\]])/g,'$1');return JSON['parse'](_0x145f3e);}function _0x2cb9(){const _0x4810bb=['string','wmQJy','ignore','jhnwE','✓\x20Removed\x20.ranger/\x20directory','Nothing\x20to\x20clean\x20up.\x0a','768wsmywM','✓\x20Removed\x20project\x20skill:\x20','HmcwE','nCyhS','utf-8','--scope','PnPnK','7518364NhDymE','1voBWxK','claude','lTcEC','dWUdR','TzgQi','✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)','2765458TFuCnA','eSMXX','24385GVYJVO','Iwker','ranger','marketplace','✓\x20Removed\x20stored\x20credentials','length','564fFLvkf','MydBS','53878keuVFF','855XtaJko','yoDkW','project','TuqiF','plugin','✓\x20Removed\x20OpenCode\x20project\x20skill:\x20','log','JHMow','Ikmdj','WuiDP','xsRKq','trailhead','TtVyv','37940676afCxiw','Bdnat','mFMaJ','ranger@trailhead','platform','410DJKAti','QSxIw','hXsSK','feature-tracker','YqzoZ','LTBMK','✓\x20Removed\x20trailhead\x20marketplace','close','WmcsD','37228wkNEFw','lRQmz','wpSwk','JZMdK','FNVvx','error','remove','kmPPo','✓\x20Removed\x20OpenCode\x20user\x20skill:\x20','replace','246jNQHOi','13xLyNdG'];_0x2cb9=function(){return _0x4810bb;};return _0x2cb9();}async function removeOpencodePluginConfig(_0x15324c){const _0xbcdc6b=_0x5a673b,_0x3c31ad={'JZZaD':function(_0x21b937,_0xf15a0d){return _0x21b937!==_0xf15a0d;},'kmPPo':function(_0x3eaa14,_0x532a96){return _0x3eaa14(_0x532a96);},'LTBMK':function(_0x340f49,_0x1c5371,_0x6e2884){return _0x340f49(_0x1c5371,_0x6e2884);},'YqzoZ':_0xbcdc6b(0x195),'yoDkW':function(_0x15bbf8,_0x3f4f84){return _0x15bbf8(_0x3f4f84);},'TzgQi':function(_0x4b3257,_0x38e13f){return _0x4b3257===_0x38e13f;},'wLUdG':function(_0x1f842d,_0x41783f,_0x3b2895){return _0x1f842d(_0x41783f,_0x3b2895);},'eSMXX':function(_0x1b367a,_0x2b845e){return _0x1b367a+_0x2b845e;}};if(!_0x3c31ad[_0xbcdc6b(0x186)](existsSync,_0x15324c))return![];let _0x47079a;try{const _0x1b07b6=await _0x3c31ad[_0xbcdc6b(0x17b)](readFile,_0x15324c,_0x3c31ad[_0xbcdc6b(0x17a)]);_0x47079a=_0x3c31ad[_0xbcdc6b(0x1ab)](parseJsonc,_0x1b07b6);}catch{return![];}const _0x188a45=Array['isArray'](_0x47079a[_0xbcdc6b(0x1ae)])?_0x47079a['plugin']:[];if(_0x3c31ad['TzgQi'](_0x188a45[_0xbcdc6b(0x1a6)],0x0))return![];const _0x55887=_0x188a45['filter'](_0x1a05b6=>{const _0x6645bc=_0xbcdc6b;if(_0x3c31ad['JZZaD'](typeof _0x1a05b6,_0x6645bc(0x18b)))return!![];return _0x1a05b6!==opencodePluginName;});if(_0x55887[_0xbcdc6b(0x1a6)]===_0x188a45[_0xbcdc6b(0x1a6)])return![];return _0x3c31ad[_0xbcdc6b(0x19d)](_0x55887[_0xbcdc6b(0x1a6)],0x0)?delete _0x47079a[_0xbcdc6b(0x1ae)]:_0x47079a['plugin']=_0x55887,await _0x3c31ad['wLUdG'](writeFile,_0x15324c,_0x3c31ad[_0xbcdc6b(0x1a0)](JSON['stringify'](_0x47079a,null,0x2),'\x0a')),!![];}async function uninstallClaudePlugin(_0x320750){const _0x3abd2c=_0x5a673b,_0xf80245={'wmQJy':function(_0x24ed0c,_0x113c86){return _0x24ed0c(_0x113c86);},'dWUdR':function(_0x1b5782,_0x2beb05){return _0x1b5782===_0x2beb05;},'Bdnat':'uninstall','HmcwE':_0x3abd2c(0x174),'MydBS':_0x3abd2c(0x196),'wpSwk':_0x3abd2c(0x19a),'lRQmz':_0x3abd2c(0x17d)};return new Promise(_0x15b247=>{const _0x59ddd4=_0x3abd2c,_0xa62d80=['plugin',_0xf80245[_0x59ddd4(0x172)],_0xf80245[_0x59ddd4(0x193)]];_0x320750&&_0xa62d80['push'](_0xf80245[_0x59ddd4(0x1a8)],_0x320750);const _0x205c6e=spawn(_0xf80245[_0x59ddd4(0x181)],_0xa62d80,{'stdio':['ignore',_0x59ddd4(0x18d),_0x59ddd4(0x18d)],'cwd':_0x320750?getProjectRoot():undefined,'shell':process['platform']==='win32'});_0x205c6e['on'](_0xf80245[_0x59ddd4(0x180)],_0x4d47a2=>{const _0x5a0749=_0x59ddd4;_0xf80245[_0x5a0749(0x18c)](_0x15b247,_0xf80245[_0x5a0749(0x19c)](_0x4d47a2,0x0));}),_0x205c6e['on'](_0x59ddd4(0x184),()=>{_0x15b247(![]);});});}async function removeMarketplace(){const _0x1aae32=_0x5a673b,_0x15ad1f={'TtVyv':function(_0x4aa2dc,_0x39923e){return _0x4aa2dc===_0x39923e;},'EFQer':_0x1aae32(0x1ae),'TuqiF':_0x1aae32(0x1a4),'WuiDP':_0x1aae32(0x185),'Ikmdj':_0x1aae32(0x18d),'nCyhS':_0x1aae32(0x17d),'Iwker':_0x1aae32(0x184)};return new Promise(_0x11de49=>{const _0x290c1a=_0x1aae32,_0x43842a={'WmcsD':function(_0x3c0a40,_0x364a8d){return _0x3c0a40(_0x364a8d);}},_0x49752f=spawn('claude',[_0x15ad1f['EFQer'],_0x15ad1f[_0x290c1a(0x1ad)],_0x15ad1f[_0x290c1a(0x16d)],_0x290c1a(0x16f)],{'stdio':[_0x290c1a(0x18d),_0x290c1a(0x18d),_0x15ad1f[_0x290c1a(0x16c)]],'shell':_0x15ad1f[_0x290c1a(0x170)](process[_0x290c1a(0x175)],'win32')});_0x49752f['on'](_0x15ad1f[_0x290c1a(0x194)],_0x171772=>{_0x11de49(_0x15ad1f['TtVyv'](_0x171772,0x0));}),_0x49752f['on'](_0x15ad1f[_0x290c1a(0x1a2)],()=>{const _0x15fb3c=_0x290c1a;_0x43842a[_0x15fb3c(0x17e)](_0x11de49,![]);});});}export async function clean(){const _0x38224c=_0x5a673b,_0xdd01d6={'omGfX':'\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','QSxIw':function(_0x289845){return _0x289845();},'PnPnK':function(_0x1cbd28,_0x2151a1){return _0x1cbd28(_0x2151a1);},'ZNyVs':function(_0x10dd07){return _0x10dd07();},'jhnwE':function(_0x4de4e3,_0x447dba){return _0x4de4e3(_0x447dba);},'hXsSK':function(_0x5b4e3c,_0x9b79c,_0x3489ba){return _0x5b4e3c(_0x9b79c,_0x3489ba);},'MPKfL':function(_0x3a8da2,_0x133aae,_0xa4279){return _0x3a8da2(_0x133aae,_0xa4279);},'lTcEC':function(_0x4b19cd,_0x3211f6,_0x4cba41){return _0x4b19cd(_0x3211f6,_0x4cba41);},'sYZoN':function(_0x101096,_0x5dd40f){return _0x101096(_0x5dd40f);},'ZnYsQ':'user','JZMdK':function(_0x2e29b1,_0x360af1){return _0x2e29b1(_0x360af1);},'xsRKq':function(_0x53d0a7,_0x3aeb48,_0x17d863){return _0x53d0a7(_0x3aeb48,_0x17d863);},'FNVvx':function(_0x403722,_0xf12c93,_0x4737eb){return _0x403722(_0xf12c93,_0x4737eb);},'mFMaJ':function(_0x381bf8,_0xcd259){return _0x381bf8(_0xcd259);},'wSBvN':_0x38224c(0x19e),'xftVI':'✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)','JHMow':_0x38224c(0x1ac),'ABnoM':'✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)'};console[_0x38224c(0x16a)](_0xdd01d6['omGfX']);let _0x57c021=![];try{await _0xdd01d6[_0x38224c(0x177)](deleteAllCredentials),console[_0x38224c(0x16a)](_0x38224c(0x1a5)),_0x57c021=!![];}catch{}const _0x1e07ae=getCacheFile();_0xdd01d6[_0x38224c(0x197)](existsSync,_0x1e07ae)&&(await _0xdd01d6['PnPnK'](rm,_0x1e07ae),_0x57c021=!![]);const _0x2c4cc1=_0xdd01d6['ZNyVs'](getRangerDir);_0xdd01d6[_0x38224c(0x18e)](existsSync,_0x2c4cc1)&&(await _0xdd01d6[_0x38224c(0x178)](rm,_0x2c4cc1,{'recursive':!![]}),console['log'](_0x38224c(0x18f)),_0x57c021=!![]);const _0x53350b=getProjectSkillsDir();for(const _0x125311 of skillsToRemove){const _0x4dc2f8=_0xdd01d6['MPKfL'](join,_0x53350b,_0x125311);existsSync(_0x4dc2f8)&&(await rm(_0x4dc2f8,{'recursive':!![]}),console[_0x38224c(0x16a)](_0x38224c(0x192)+_0x125311),_0x57c021=!![]);}const _0x36eeb3=getUserSkillsDir();for(const _0x5d110e of skillsToRemove){const _0xccf543=join(_0x36eeb3,_0x5d110e);existsSync(_0xccf543)&&(await rm(_0xccf543,{'recursive':!![]}),console['log']('✓\x20Removed\x20user\x20skill:\x20'+_0x5d110e),_0x57c021=!![]);}const _0x1a7daa=getOpencodeSkillsDir('project');for(const _0x32c930 of skillsToRemove){const _0xec0c91=_0xdd01d6[_0x38224c(0x19b)](join,_0x1a7daa,_0x32c930);_0xdd01d6[_0x38224c(0x197)](existsSync,_0xec0c91)&&(await rm(_0xec0c91,{'recursive':!![]}),console[_0x38224c(0x16a)](_0x38224c(0x1af)+_0x32c930),_0x57c021=!![]);}const _0x5c2e89=_0xdd01d6['sYZoN'](getOpencodeSkillsDir,_0xdd01d6['ZnYsQ']);for(const _0x11d49a of skillsToRemove){const _0x2d45f9=join(_0x5c2e89,_0x11d49a);_0xdd01d6[_0x38224c(0x182)](existsSync,_0x2d45f9)&&(await _0xdd01d6[_0x38224c(0x16e)](rm,_0x2d45f9,{'recursive':!![]}),console[_0x38224c(0x16a)](_0x38224c(0x187)+_0x11d49a),_0x57c021=!![]);}const _0x4e7d92=_0xdd01d6[_0x38224c(0x183)](join,_0xdd01d6[_0x38224c(0x173)](getOpencodeConfigDir,_0x38224c(0x1ac)),'opencode.json');await _0xdd01d6['JZMdK'](removeOpencodePluginConfig,_0x4e7d92)&&(console['log']('✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)'),_0x57c021=!![]);const _0x104f16=join(getOpencodeConfigDir('user'),'opencode.json');await removeOpencodePluginConfig(_0x104f16)&&(console[_0x38224c(0x16a)](_0xdd01d6['wSBvN']),_0x57c021=!![]);const _0x144b0f=await uninstallClaudePlugin();_0x144b0f&&(console['log'](_0xdd01d6['xftVI']),_0x57c021=!![]);const _0x549184=await _0xdd01d6['sYZoN'](uninstallClaudePlugin,_0xdd01d6[_0x38224c(0x16b)]);_0x549184&&(console['log'](_0xdd01d6['ABnoM']),_0x57c021=!![]);const _0x4e234f=await removeMarketplace();_0x4e234f&&(console[_0x38224c(0x16a)](_0x38224c(0x17c)),_0x57c021=!![]),_0x57c021?console[_0x38224c(0x16a)]('\x0a✅\x20Cleanup\x20complete!\x0a'):console[_0x38224c(0x16a)](_0x38224c(0x190));}
|
|
1
|
+
const _0x51f633=_0xe228;(function(_0x72f611,_0x2bd7c2){const _0x37a8f6=_0xe228,_0x245b1a=_0x72f611();while(!![]){try{const _0x4f735e=parseInt(_0x37a8f6(0x88))/0x1*(parseInt(_0x37a8f6(0x6f))/0x2)+-parseInt(_0x37a8f6(0x8b))/0x3*(parseInt(_0x37a8f6(0x94))/0x4)+-parseInt(_0x37a8f6(0x99))/0x5+parseInt(_0x37a8f6(0x85))/0x6+-parseInt(_0x37a8f6(0x81))/0x7*(-parseInt(_0x37a8f6(0x7d))/0x8)+-parseInt(_0x37a8f6(0x78))/0x9+-parseInt(_0x37a8f6(0x8c))/0xa*(-parseInt(_0x37a8f6(0x9b))/0xb);if(_0x4f735e===_0x2bd7c2)break;else _0x245b1a['push'](_0x245b1a['shift']());}catch(_0x38faae){_0x245b1a['push'](_0x245b1a['shift']());}}}(_0x3b56,0xa8895));import{rm,readFile,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{spawn}from'child_process';function _0xe228(_0x1290e5,_0x4d06ca){_0x1290e5=_0x1290e5-0x69;const _0x3b56d1=_0x3b56();let _0xe228a8=_0x3b56d1[_0x1290e5];return _0xe228a8;}import{deleteAllCredentials}from'./utils/keychain.js';import{getProjectRoot,getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getCacheFile}from'./utils/sessionCache.js';import{getOpencodeConfigDir,getOpencodeSkillsDir}from'./utils/opencodeConfig.js';const skillsToRemove=['ranger','feature-tracker','bug-bash','e2e-test-recommender'],opencodePluginName=_0x51f633(0x7f);function parseJsonc(_0x425c8e){const _0x3eb514=_0x51f633,_0x1f81f2=_0x425c8e['replace'](/\/\*[\s\S]*?\*\//g,''),_0x4a11a2=_0x1f81f2['replace'](/^\s*\/\/.*$/gm,''),_0x52f98d=_0x4a11a2['replace'](/,\s*([}\]])/g,'$1');return JSON[_0x3eb514(0x86)](_0x52f98d);}async function removeOpencodePluginConfig(_0x253031){const _0x5b19a1=_0x51f633,_0x1d9f23={'UodCL':function(_0x46a661,_0x842c73){return _0x46a661!==_0x842c73;},'HcyRJ':'string','EWiTW':function(_0x14a238,_0x2aeaf6){return _0x14a238!==_0x2aeaf6;},'zhxLN':function(_0x204e2f,_0x2ad495){return _0x204e2f(_0x2ad495);},'RmpqM':function(_0x5d11f5,_0x11cca0,_0x5c3e2a){return _0x5d11f5(_0x11cca0,_0x5c3e2a);},'Dydnx':function(_0x27a61b,_0x3943e6){return _0x27a61b===_0x3943e6;},'AYZzq':function(_0x1973b7,_0x57cb8a,_0x300edd){return _0x1973b7(_0x57cb8a,_0x300edd);}};if(!_0x1d9f23[_0x5b19a1(0x84)](existsSync,_0x253031))return![];let _0x2d0b56;try{const _0x4904f2=await _0x1d9f23[_0x5b19a1(0x96)](readFile,_0x253031,'utf-8');_0x2d0b56=_0x1d9f23['zhxLN'](parseJsonc,_0x4904f2);}catch{return![];}const _0x570099=Array['isArray'](_0x2d0b56['plugin'])?_0x2d0b56['plugin']:[];if(_0x570099['length']===0x0)return![];const _0x288cc2=_0x570099[_0x5b19a1(0x8e)](_0x3ba807=>{const _0x52fec1=_0x5b19a1;if(_0x1d9f23[_0x52fec1(0x8d)](typeof _0x3ba807,_0x1d9f23[_0x52fec1(0x6b)]))return!![];return _0x1d9f23['EWiTW'](_0x3ba807,opencodePluginName);});if(_0x288cc2[_0x5b19a1(0x70)]===_0x570099[_0x5b19a1(0x70)])return![];return _0x1d9f23[_0x5b19a1(0x7a)](_0x288cc2[_0x5b19a1(0x70)],0x0)?delete _0x2d0b56['plugin']:_0x2d0b56[_0x5b19a1(0x83)]=_0x288cc2,await _0x1d9f23[_0x5b19a1(0x80)](writeFile,_0x253031,JSON[_0x5b19a1(0x6a)](_0x2d0b56,null,0x2)+'\x0a'),!![];}async function uninstallClaudePlugin(_0x32a668){const _0x5cedf3=_0x51f633,_0x8972ef={'hvzJN':function(_0x481c9c,_0x2f9605){return _0x481c9c(_0x2f9605);},'nXOKp':_0x5cedf3(0x76),'lrCed':'ranger@trailhead','YOHlq':'claude','NZnGk':_0x5cedf3(0x74),'DTxPp':function(_0x3aeee0,_0x5cc6b6){return _0x3aeee0===_0x5cc6b6;},'vnEQJ':'close'};return new Promise(_0x26e0cd=>{const _0x402424=_0x5cedf3,_0xabaaeb=[_0x402424(0x83),_0x8972ef['nXOKp'],_0x8972ef['lrCed']];_0x32a668&&_0xabaaeb['push']('--scope',_0x32a668);const _0x4e9901=spawn(_0x8972ef[_0x402424(0x7b)],_0xabaaeb,{'stdio':[_0x8972ef['NZnGk'],_0x8972ef['NZnGk'],_0x8972ef['NZnGk']],'cwd':_0x32a668?getProjectRoot():undefined,'shell':_0x8972ef[_0x402424(0x92)](process[_0x402424(0x8a)],'win32')});_0x4e9901['on'](_0x8972ef[_0x402424(0x75)],_0x1fec8b=>{const _0x97edba=_0x402424;_0x8972ef[_0x97edba(0x79)](_0x26e0cd,_0x1fec8b===0x0);}),_0x4e9901['on']('error',()=>{_0x26e0cd(![]);});});}async function removeMarketplace(){const _0x308882=_0x51f633,_0xda64cd={'LsSJh':function(_0x30cbc3,_0x490856){return _0x30cbc3(_0x490856);},'PaQed':function(_0x27f32e,_0x33f568,_0x3356fd,_0x256b54){return _0x27f32e(_0x33f568,_0x3356fd,_0x256b54);},'nYdWv':'plugin','ILWnY':'marketplace','HErAC':'remove','ZtugC':'trailhead','qCovr':'ignore','XNulR':function(_0x413c35,_0x4f1dff){return _0x413c35===_0x4f1dff;},'ByweG':_0x308882(0x77),'iKTXk':'error'};return new Promise(_0x288d69=>{const _0x11e8a2=_0x308882,_0x6edbe1={'eGsic':function(_0x3236f1,_0x3b308a){const _0x3a1ef4=_0xe228;return _0xda64cd[_0x3a1ef4(0x7e)](_0x3236f1,_0x3b308a);}},_0x3fd1f0=_0xda64cd['PaQed'](spawn,_0x11e8a2(0x93),[_0xda64cd['nYdWv'],_0xda64cd['ILWnY'],_0xda64cd['HErAC'],_0xda64cd[_0x11e8a2(0x73)]],{'stdio':[_0xda64cd['qCovr'],_0x11e8a2(0x74),_0xda64cd[_0x11e8a2(0x6c)]],'shell':_0xda64cd[_0x11e8a2(0x98)](process['platform'],_0xda64cd['ByweG'])});_0x3fd1f0['on']('close',_0x599da2=>{_0x288d69(_0x599da2===0x0);}),_0x3fd1f0['on'](_0xda64cd['iKTXk'],()=>{_0x6edbe1['eGsic'](_0x288d69,![]);});});}export async function clean(){const _0x44c822=_0x51f633,_0x923b9a={'zpciQ':function(_0x275686){return _0x275686();},'FYbEp':function(_0x3d4d97,_0x18500f){return _0x3d4d97(_0x18500f);},'szNhx':function(_0x2f7afb,_0x2ab1e5){return _0x2f7afb(_0x2ab1e5);},'RKYBP':function(_0x21c76e,_0x3792d7,_0xb80aa4){return _0x21c76e(_0x3792d7,_0xb80aa4);},'ifSwB':function(_0xf5485,_0x3ea921,_0x40d4c5){return _0xf5485(_0x3ea921,_0x40d4c5);},'ezEoG':function(_0x1f721f,_0x2ba406,_0x1ae2e2){return _0x1f721f(_0x2ba406,_0x1ae2e2);},'yPfIz':function(_0xc1216a){return _0xc1216a();},'SoYVE':function(_0x133948,_0x1fbe27,_0x51f2e2){return _0x133948(_0x1fbe27,_0x51f2e2);},'wVMor':'user','DBANm':'✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)','hNpzd':'opencode.json','Dfqzy':'✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)','dXovU':_0x44c822(0x91),'uHuPV':'✓\x20Removed\x20trailhead\x20marketplace','KOKsb':'\x0a✅\x20Cleanup\x20complete!\x0a'};console[_0x44c822(0x7c)](_0x44c822(0x72));let _0x4103e8=![];try{await deleteAllCredentials(),console[_0x44c822(0x7c)]('✓\x20Removed\x20stored\x20credentials'),_0x4103e8=!![];}catch{}const _0x13e065=_0x923b9a['zpciQ'](getCacheFile);existsSync(_0x13e065)&&(await _0x923b9a[_0x44c822(0x9a)](rm,_0x13e065),_0x4103e8=!![]);const _0x23faf5=_0x923b9a['zpciQ'](getRangerDir);_0x923b9a['szNhx'](existsSync,_0x23faf5)&&(await _0x923b9a['RKYBP'](rm,_0x23faf5,{'recursive':!![]}),console[_0x44c822(0x7c)]('✓\x20Removed\x20.ranger/\x20directory'),_0x4103e8=!![]);const _0xfacadf=getProjectSkillsDir();for(const _0x180edb of skillsToRemove){const _0x54424d=_0x923b9a['ifSwB'](join,_0xfacadf,_0x180edb);_0x923b9a[_0x44c822(0x9a)](existsSync,_0x54424d)&&(await _0x923b9a[_0x44c822(0x6d)](rm,_0x54424d,{'recursive':!![]}),console[_0x44c822(0x7c)]('✓\x20Removed\x20project\x20skill:\x20'+_0x180edb),_0x4103e8=!![]);}const _0x4358c5=_0x923b9a[_0x44c822(0x87)](getUserSkillsDir);for(const _0x41112f of skillsToRemove){const _0xc07fcd=_0x923b9a[_0x44c822(0x95)](join,_0x4358c5,_0x41112f);_0x923b9a[_0x44c822(0x97)](existsSync,_0xc07fcd)&&(await rm(_0xc07fcd,{'recursive':!![]}),console['log']('✓\x20Removed\x20user\x20skill:\x20'+_0x41112f),_0x4103e8=!![]);}const _0x3e02c3=getOpencodeSkillsDir('project');for(const _0x303320 of skillsToRemove){const _0x9769bf=join(_0x3e02c3,_0x303320);_0x923b9a['szNhx'](existsSync,_0x9769bf)&&(await rm(_0x9769bf,{'recursive':!![]}),console['log'](_0x44c822(0x90)+_0x303320),_0x4103e8=!![]);}const _0x382973=getOpencodeSkillsDir(_0x923b9a['wVMor']);for(const _0x4ee4ea of skillsToRemove){const _0x5374c6=join(_0x382973,_0x4ee4ea);existsSync(_0x5374c6)&&(await rm(_0x5374c6,{'recursive':!![]}),console['log']('✓\x20Removed\x20OpenCode\x20user\x20skill:\x20'+_0x4ee4ea),_0x4103e8=!![]);}const _0x4c1bf6=join(getOpencodeConfigDir('project'),'opencode.json');await _0x923b9a['szNhx'](removeOpencodePluginConfig,_0x4c1bf6)&&(console[_0x44c822(0x7c)](_0x923b9a[_0x44c822(0x89)]),_0x4103e8=!![]);const _0x42c81c=_0x923b9a['ezEoG'](join,getOpencodeConfigDir(_0x923b9a[_0x44c822(0x69)]),_0x923b9a['hNpzd']);await removeOpencodePluginConfig(_0x42c81c)&&(console['log'](_0x923b9a[_0x44c822(0x71)]),_0x4103e8=!![]);const _0x4de511=await uninstallClaudePlugin();_0x4de511&&(console['log']('✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)'),_0x4103e8=!![]);const _0x2d0cc1=await uninstallClaudePlugin(_0x923b9a['dXovU']);_0x2d0cc1&&(console['log']('✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)'),_0x4103e8=!![]);const _0x8d8849=await removeMarketplace();_0x8d8849&&(console[_0x44c822(0x7c)](_0x923b9a[_0x44c822(0x6e)]),_0x4103e8=!![]),_0x4103e8?console['log'](_0x923b9a[_0x44c822(0x82)]):console[_0x44c822(0x7c)](_0x44c822(0x8f));}function _0x3b56(){const _0x43f2ca=['8kiQmKd','LsSJh','@ranger-testing/opencode-plugin','AYZzq','659407JImsoz','KOKsb','plugin','zhxLN','5671194OdxlvV','parse','yPfIz','1dloqWX','DBANm','platform','80127IjMDUI','30mRzTez','UodCL','filter','Nothing\x20to\x20clean\x20up.\x0a','✓\x20Removed\x20OpenCode\x20project\x20skill:\x20','project','DTxPp','claude','64Hnlqvc','SoYVE','RmpqM','szNhx','XNulR','2678260vBeIBY','FYbEp','2726119gDbrft','wVMor','stringify','HcyRJ','qCovr','ezEoG','uHuPV','25972hDepHs','length','Dfqzy','\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','ZtugC','ignore','vnEQJ','uninstall','win32','1282968nztadE','hvzJN','Dydnx','YOHlq','log'];_0x3b56=function(){return _0x43f2ca;};return _0x3b56();}
|
package/build/commands/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x565879,_0x286d18){const _0x541775=_0x4d95,_0x229167=_0x565879();while(!![]){try{const _0x423643=parseInt(_0x541775(0xb7))/0x1*(parseInt(_0x541775(0xcb))/0x2)+parseInt(_0x541775(0xcc))/0x3*(parseInt(_0x541775(0xc2))/0x4)+-parseInt(_0x541775(0xdc))/0x5*(parseInt(_0x541775(0xe2))/0x6)+parseInt(_0x541775(0xd7))/0x7*(-parseInt(_0x541775(0xca))/0x8)+parseInt(_0x541775(0xb6))/0x9+parseInt(_0x541775(0xd2))/0xa*(parseInt(_0x541775(0xc6))/0xb)+parseInt(_0x541775(0xd4))/0xc*(-parseInt(_0x541775(0xde))/0xd);if(_0x423643===_0x286d18)break;else _0x229167['push'](_0x229167['shift']());}catch(_0x24b932){_0x229167['push'](_0x229167['shift']());}}}(_0xac86,0xbc91c));import{existsSync}from'fs';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','forceLogin'];function parseLocalValue(_0x277d44,_0x439ba7){const _0x3c408f=_0x4d95,_0x397ee0={'fnBLu':function(_0x22bdd0,_0x26b15c){return _0x22bdd0===_0x26b15c;},'znVXN':'false'};if(BOOLEAN_KEYS['includes'](_0x277d44)){if(_0x397ee0[_0x3c408f(0xd6)](_0x439ba7,_0x3c408f(0xc0)))return!![];if(_0x439ba7===_0x397ee0['znVXN'])return![];throw new Error('Invalid\x20value\x20for\x20'+_0x277d44+_0x3c408f(0xe1));}return _0x439ba7;}function parseOverrideValue(_0x401921){const _0x1ff0ca=_0x4d95,_0x2f791a={'rrLAY':_0x1ff0ca(0xc0),'qnvbu':function(_0x14126b,_0x2e3529){return _0x14126b===_0x2e3529;},'zVyMY':_0x1ff0ca(0xd9),'GLJWT':function(_0x2c3251,_0x50c6cc){return _0x2c3251(_0x50c6cc);}};if(_0x401921===_0x2f791a[_0x1ff0ca(0xc1)])return!![];if(_0x2f791a[_0x1ff0ca(0xdb)](_0x401921,_0x1ff0ca(0xd1)))return![];if(_0x401921===_0x2f791a[_0x1ff0ca(0xcf)])return null;if(_0x401921===_0x1ff0ca(0xc3))return undefined;if(/^-?\d+$/['test'](_0x401921)){const _0x5c9260=Number(_0x401921);if(Number[_0x1ff0ca(0xb9)](_0x5c9260))return _0x5c9260;}if(/^-?\d+\.\d+$/['test'](_0x401921)){const _0x9fb79d=_0x2f791a['GLJWT'](Number,_0x401921);if(!Number[_0x1ff0ca(0xb8)](_0x9fb79d))return _0x9fb79d;}const _0x3f8e16=_0x401921[_0x1ff0ca(0xba)]();if(_0x3f8e16[_0x1ff0ca(0xbc)]('{')&&_0x3f8e16[_0x1ff0ca(0xbd)]('}')||_0x3f8e16['startsWith']('[')&&_0x3f8e16[_0x1ff0ca(0xbd)](']'))try{return JSON['parse'](_0x3f8e16);}catch{}return _0x401921;}async function resolveProfileTarget(_0x344572){const _0x4fbb75=_0x4d95,_0x234fba={'DNfer':function(_0x3aede3,_0x48566b){return _0x3aede3(_0x48566b);}},_0x3b3e66=_0x234fba['DNfer'](existsSync,getEnvDir(_0x344572));let _0x4ea658=![];try{const _0x115329=await fetchCloudProfile(_0x344572);_0x4ea658=Boolean(_0x115329);}catch{}if(_0x4ea658)return{'kind':_0x4fbb75(0xbf),'alsoExistsElsewhere':_0x3b3e66};if(_0x3b3e66)return{'kind':'local','alsoExistsElsewhere':![]};throw new Error(_0x4fbb75(0xce)+_0x344572+'\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'+_0x344572);}function printDualExistsHint(_0x44c2e7){console['log']('\x20\x20Note:\x20\x22'+_0x44c2e7+'\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.');}function getProjectPath(){const _0x5d1a50=_0x4d95;return process[_0x5d1a50(0xbe)]();}function _0x4d95(_0x51cb8a,_0x739a0){_0x51cb8a=_0x51cb8a-0xb5;const _0xac86c=_0xac86();let _0x4d951b=_0xac86c[_0x51cb8a];return _0x4d951b;}async function loadEffectiveCloudSettings(_0x10e329){const _0xe6de9c=_0x4d95,_0x368ff7={'ZVOFy':function(_0xbfede,_0x31f877,_0x5e7226){return _0xbfede(_0x31f877,_0x5e7226);},'ESdma':function(_0x367cde){return _0x367cde();},'VTaqs':function(_0x28cbfe,_0x187d6a){return _0x28cbfe??_0x187d6a;}},_0x4e1a97=await fetchCloudProfile(_0x10e329),_0x3f998e=_0x368ff7['ZVOFy'](readProfileOverrides,_0x368ff7[_0xe6de9c(0xe0)](getProjectPath),_0x10e329);return mergeCloudProfileSettings(_0x4e1a97?.['settings']??{},_0x368ff7['VTaqs'](_0x3f998e,undefined));}export async function configSet(_0x23d61c,_0x180584,_0x4f7c83){const _0x366357=_0x4d95,_0x9fa122={'Kvntb':_0x366357(0xbf),'LPrUo':function(_0x5a302a,_0x5f086a){return _0x5a302a(_0x5f086a);}},_0x6a246e=await resolveProfileTarget(_0x23d61c);if(_0x6a246e['kind']===_0x9fa122['Kvntb']){if(_0x6a246e[_0x366357(0xb5)])_0x9fa122[_0x366357(0xd0)](printDualExistsHint,_0x23d61c);const _0x425fb9=parseOverrideValue(_0x4f7c83);setProfileOverride(getProjectPath(),_0x23d61c,_0x180584,_0x425fb9),console['log'](_0x366357(0xc9)+_0x180584+'\x20=\x20'+JSON['stringify'](_0x425fb9)+_0x366357(0xc8)+_0x23d61c+'\x22');return;}const _0x1c4b87=parseLocalValue(_0x180584,_0x4f7c83);setProfileOverride(getProjectPath(),_0x23d61c,_0x180584,_0x1c4b87),console['log']('Set\x20'+_0x180584+'\x20=\x20'+_0x1c4b87+_0x366357(0xc8)+_0x23d61c+'\x22');}function _0xac86(){const _0x2b87d1=['2koZYgd','673773BNIfEC','log','Profile\x20\x22','zVyMY','LPrUo','false','10MbJQrY','Cleared\x20local\x20overrides\x20for\x20\x22','13247772lmOzfN','xtvLI','fnBLu','122801xfNYTu','TmugI','null','nIiIE','qnvbu','270fHfiNe','BBtBG','13ivDopc','length','ESdma',':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22','54282eEUqIF','No\x20configuration\x20set\x20for\x20\x22','alsoExistsElsewhere','11413737Yugpch','248564cBVQSV','isNaN','isSafeInteger','trim','Key\x20\x22','startsWith','endsWith','cwd','cloud','true','rrLAY','20ZBpJhj','undefined','kind','Removed\x20','7590572evhdkG','stringify','\x20for\x20\x22','Set\x20','440LDXAWB'];_0xac86=function(){return _0x2b87d1;};return _0xac86();}export async function configGet(_0x4ad21,_0x44ba95){const _0x48930d=_0x4d95,_0x38d177={'nIiIE':'cloud','BBtBG':function(_0x2d56e7,_0x25a9f6,_0x94fe0b){return _0x2d56e7(_0x25a9f6,_0x94fe0b);},'RDDcR':function(_0x10f4d2,_0x296ef){return _0x10f4d2===_0x296ef;},'VwtSI':'object','iwliQ':function(_0x447b81,_0x2281b1){return _0x447b81(_0x2281b1);},'zKGOb':function(_0x13cfe5,_0x5d405c){return _0x13cfe5===_0x5d405c;}},_0x2d8023=await resolveProfileTarget(_0x4ad21);if(_0x2d8023[_0x48930d(0xc4)]===_0x38d177[_0x48930d(0xda)]){const _0x482038=await loadEffectiveCloudSettings(_0x4ad21),_0x49ae67=_0x38d177[_0x48930d(0xdd)](getNestedValue,_0x482038,_0x44ba95);if(_0x49ae67===undefined)console['log']('(not\x20set)');else _0x38d177['RDDcR'](typeof _0x49ae67,_0x38d177['VwtSI'])?console['log'](JSON[_0x48930d(0xc7)](_0x49ae67,null,0x2)):console['log'](_0x49ae67);return;}const _0x30eb30=await _0x38d177['iwliQ'](loadSettings,_0x4ad21),_0x40be7c=getNestedValue(_0x30eb30,_0x44ba95);if(_0x40be7c===undefined)console['log']('(not\x20set)');else _0x38d177['zKGOb'](typeof _0x40be7c,'object')?console[_0x48930d(0xcd)](JSON['stringify'](_0x40be7c,null,0x2)):console['log'](_0x40be7c);}export async function configList(_0x1a1066){const _0x1cb6d8=_0x4d95,_0x7a5e99={'uzfDe':function(_0x1ae027,_0x2725f9){return _0x1ae027(_0x2725f9);},'fKOmb':function(_0x8549a7,_0x3b6bce){return _0x8549a7===_0x3b6bce;},'kTQRv':function(_0x166130,_0x4c1083){return _0x166130(_0x4c1083);}},_0x5aa054=await _0x7a5e99['uzfDe'](resolveProfileTarget,_0x1a1066);if(_0x7a5e99['fKOmb'](_0x5aa054[_0x1cb6d8(0xc4)],_0x1cb6d8(0xbf))){const _0x5af6f8=await loadEffectiveCloudSettings(_0x1a1066);if(!_0x5af6f8||Object['keys'](_0x5af6f8)[_0x1cb6d8(0xdf)]===0x0){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x1a1066+'\x22');return;}console['log'](JSON[_0x1cb6d8(0xc7)](_0x5af6f8,null,0x2));return;}const _0x570b0b=getSettingsPath(_0x1a1066);if(!existsSync(_0x570b0b)){console['log'](_0x1cb6d8(0xe3)+_0x1a1066+'\x22');return;}const _0x2732e4=await loadSettings(_0x1a1066),_0x1404eb=_0x7a5e99['kTQRv'](formatSettings,_0x2732e4);!_0x1404eb?console[_0x1cb6d8(0xcd)](_0x1cb6d8(0xe3)+_0x1a1066+'\x22'):console[_0x1cb6d8(0xcd)](_0x1404eb);}export async function configUnset(_0x3908be,_0x17444d){const _0x110262=_0x4d95,_0x415a45={'Pkiti':function(_0x909ccf,_0x13104c){return _0x909ccf(_0x13104c);},'pEiaa':function(_0x481d4b,_0x1c23cf){return _0x481d4b(_0x1c23cf);},'THWvu':function(_0x3e33f1){return _0x3e33f1();},'olJCi':function(_0x437203,_0x141030,_0x248ec4,_0x85991c){return _0x437203(_0x141030,_0x248ec4,_0x85991c);}},_0x4436b0=await _0x415a45['Pkiti'](resolveProfileTarget,_0x3908be);if(_0x4436b0['kind']==='cloud'){if(_0x4436b0[_0x110262(0xb5)])_0x415a45['pEiaa'](printDualExistsHint,_0x3908be);const _0x53e518=unsetProfileOverride(_0x415a45['THWvu'](getProjectPath),_0x3908be,_0x17444d);_0x53e518?console['log'](_0x110262(0xc5)+_0x17444d+_0x110262(0xc8)+_0x3908be+'\x22'):console['log']('Key\x20\x22'+_0x17444d+'\x22\x20not\x20found');return;}const _0x4b817e=_0x415a45['olJCi'](unsetProfileOverride,getProjectPath(),_0x3908be,_0x17444d);if(_0x4b817e){console['log'](_0x110262(0xc5)+_0x17444d);return;}const _0x33c95e=await loadSettings(_0x3908be),_0x4f8a6e=deleteNestedValue(_0x33c95e,_0x17444d);_0x4f8a6e?console['log'](_0x110262(0xbb)+_0x17444d+'\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22'+_0x3908be+'\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.'):console['log'](_0x110262(0xbb)+_0x17444d+'\x22\x20not\x20found');}export async function configReset(_0x2bb370){const _0x1f37e6=_0x4d95,_0x1d469c={'TmugI':function(_0x450f1f,_0xb0dba6,_0x5bad78){return _0x450f1f(_0xb0dba6,_0x5bad78);},'xtvLI':function(_0x518bd3){return _0x518bd3();}},_0x25ab78=await resolveProfileTarget(_0x2bb370);if(_0x25ab78['kind']==='cloud'){_0x1d469c[_0x1f37e6(0xd8)](resetProfileOverrides,_0x1d469c[_0x1f37e6(0xd5)](getProjectPath),_0x2bb370),console['log'](_0x1f37e6(0xd3)+_0x2bb370+'\x22');return;}console[_0x1f37e6(0xcd)]('\x22'+_0x2bb370+'\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20'+_0x2bb370+'\x20<key>\x22\x20to\x20remove\x20individual\x20values.');}
|
|
1
|
+
const _0x17fb66=_0x19e6;(function(_0x13f651,_0x49cead){const _0x42551c=_0x19e6,_0x1ca070=_0x13f651();while(!![]){try{const _0x32b824=-parseInt(_0x42551c(0x1be))/0x1*(-parseInt(_0x42551c(0x1e4))/0x2)+parseInt(_0x42551c(0x1b3))/0x3*(-parseInt(_0x42551c(0x1c0))/0x4)+parseInt(_0x42551c(0x1bc))/0x5*(parseInt(_0x42551c(0x1d5))/0x6)+-parseInt(_0x42551c(0x1d0))/0x7+parseInt(_0x42551c(0x1e8))/0x8+-parseInt(_0x42551c(0x1cf))/0x9+-parseInt(_0x42551c(0x1e9))/0xa*(parseInt(_0x42551c(0x1d6))/0xb);if(_0x32b824===_0x49cead)break;else _0x1ca070['push'](_0x1ca070['shift']());}catch(_0x2442b7){_0x1ca070['push'](_0x1ca070['shift']());}}}(_0x58f0,0x64775));import{existsSync}from'fs';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=[_0x17fb66(0x1bf),_0x17fb66(0x1cd),_0x17fb66(0x1db)];function parseLocalValue(_0x2111eb,_0x5214e1){const _0x2c80df=_0x17fb66,_0x26e5f1={'VfXlK':function(_0x1b6482,_0x470e80){return _0x1b6482===_0x470e80;},'jYewx':function(_0x15dbf3,_0x2b2a39){return _0x15dbf3===_0x2b2a39;},'IsHHO':_0x2c80df(0x1c5)};if(BOOLEAN_KEYS['includes'](_0x2111eb)){if(_0x26e5f1[_0x2c80df(0x1c3)](_0x5214e1,'true'))return!![];if(_0x26e5f1['jYewx'](_0x5214e1,_0x26e5f1[_0x2c80df(0x1de)]))return![];throw new Error(_0x2c80df(0x1d8)+_0x2111eb+':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22');}return _0x5214e1;}function parseOverrideValue(_0x3e50c9){const _0x245d0f=_0x17fb66,_0x4aa6d3={'hIDZm':'true','FCHgv':function(_0x11b686,_0x2c5d66){return _0x11b686===_0x2c5d66;},'pFIYZ':_0x245d0f(0x1c5),'ufEYC':function(_0x40ae5b,_0x4d1350){return _0x40ae5b===_0x4d1350;},'tTYQA':_0x245d0f(0x1b1),'KYJxi':function(_0x3facc5,_0x30dc78){return _0x3facc5(_0x30dc78);},'Vglfj':function(_0x3a31c2,_0x1a027a){return _0x3a31c2(_0x1a027a);}};if(_0x3e50c9===_0x4aa6d3[_0x245d0f(0x1b2)])return!![];if(_0x4aa6d3['FCHgv'](_0x3e50c9,_0x4aa6d3[_0x245d0f(0x1cb)]))return![];if(_0x3e50c9===_0x245d0f(0x1b9))return null;if(_0x4aa6d3[_0x245d0f(0x1b7)](_0x3e50c9,_0x4aa6d3[_0x245d0f(0x1da)]))return undefined;if(/^-?\d+$/['test'](_0x3e50c9)){const _0x28b889=_0x4aa6d3['KYJxi'](Number,_0x3e50c9);if(Number[_0x245d0f(0x1b5)](_0x28b889))return _0x28b889;}if(/^-?\d+\.\d+$/[_0x245d0f(0x1c9)](_0x3e50c9)){const _0x57bb17=_0x4aa6d3['Vglfj'](Number,_0x3e50c9);if(!Number[_0x245d0f(0x1df)](_0x57bb17))return _0x57bb17;}const _0x144b4a=_0x3e50c9['trim']();if(_0x144b4a['startsWith']('{')&&_0x144b4a['endsWith']('}')||_0x144b4a['startsWith']('[')&&_0x144b4a[_0x245d0f(0x1b0)](']'))try{return JSON[_0x245d0f(0x1d9)](_0x144b4a);}catch{}return _0x3e50c9;}function _0x19e6(_0x2319fa,_0x23a343){_0x2319fa=_0x2319fa-0x1af;const _0x58f0c9=_0x58f0();let _0x19e615=_0x58f0c9[_0x2319fa];return _0x19e615;}async function resolveProfileTarget(_0x300c74){const _0xd0fd3=_0x17fb66,_0x97d737={'XeppC':function(_0x340f94,_0x327efa){return _0x340f94(_0x327efa);},'qTsTS':function(_0x1e977b,_0x41f0ea){return _0x1e977b(_0x41f0ea);}},_0x101a43=_0x97d737['XeppC'](existsSync,_0x97d737[_0xd0fd3(0x1dc)](getEnvDir,_0x300c74));let _0x2512f0=![];try{const _0x4818b2=await fetchCloudProfile(_0x300c74);_0x2512f0=Boolean(_0x4818b2);}catch{}if(_0x2512f0)return{'kind':_0xd0fd3(0x1b6),'alsoExistsElsewhere':_0x101a43};if(_0x101a43)return{'kind':'local','alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x300c74+'\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'+_0x300c74);}function printDualExistsHint(_0x46b70a){const _0x7cf0e6=_0x17fb66;console['log']('\x20\x20Note:\x20\x22'+_0x46b70a+_0x7cf0e6(0x1b8));}function getProjectPath(){const _0x553613=_0x17fb66;return process[_0x553613(0x1e3)]();}async function loadEffectiveCloudSettings(_0x360a3d){const _0x4065f8=_0x17fb66,_0x48ea9a={'HEeQK':function(_0x11fdd1,_0x561e29){return _0x11fdd1(_0x561e29);},'wLEcF':function(_0x29273a,_0x140441,_0x2168ef){return _0x29273a(_0x140441,_0x2168ef);}},_0x58f5ab=await _0x48ea9a['HEeQK'](fetchCloudProfile,_0x360a3d),_0x944684=readProfileOverrides(getProjectPath(),_0x360a3d);return _0x48ea9a[_0x4065f8(0x1e6)](mergeCloudProfileSettings,_0x58f5ab?.['settings']??{},_0x944684??undefined);}function _0x58f0(){const _0x417dea=['headless','348dsenNf','keys','stringify','VfXlK','cWYKw','false','wYFpU','\x20=\x20','\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.','test','hHeLa','pFIYZ','Cleared\x20local\x20overrides\x20for\x20\x22','allowInsecureLocalhost','(not\x20set)','5943492VIPkJw','1049979ZYqcre','length','ZdQPM','QdFjU','object','4907922KYrFXW','11pHRAYz','Key\x20\x22','Invalid\x20value\x20for\x20','parse','tTYQA','forceLogin','qTsTS','log','IsHHO','isNaN','\x20for\x20\x22','oynaf','svWxv','cwd','40462mlsWxi','Set\x20','wLEcF','No\x20configuration\x20set\x20for\x20\x22','2923216EKPfCs','239060iKLynG','kind','OwMbi','endsWith','undefined','hIDZm','21567UbQpYn','GSrHl','isSafeInteger','cloud','ufEYC','\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.','null','rVmED','XIjYc','5xAfKcN','ZcgOd','34RcqReg'];_0x58f0=function(){return _0x417dea;};return _0x58f0();}export async function configSet(_0x16812e,_0x55ee12,_0x148988){const _0x40f694=_0x17fb66,_0x2231d7={'yUwHi':function(_0x524ef9,_0x549a15){return _0x524ef9===_0x549a15;},'MeAlJ':'cloud','hHeLa':function(_0x276e1a,_0x280608){return _0x276e1a(_0x280608);},'eBVqD':function(_0x5ed984,_0x1f638f,_0xceee3f){return _0x5ed984(_0x1f638f,_0xceee3f);},'KeglE':function(_0x3baaf4,_0x14ac0d,_0x5f1b0e,_0x534fd6,_0x4fbe44){return _0x3baaf4(_0x14ac0d,_0x5f1b0e,_0x534fd6,_0x4fbe44);},'XIjYc':function(_0x130c62){return _0x130c62();}},_0x4a2796=await resolveProfileTarget(_0x16812e);if(_0x2231d7['yUwHi'](_0x4a2796[_0x40f694(0x1ea)],_0x2231d7['MeAlJ'])){if(_0x4a2796['alsoExistsElsewhere'])_0x2231d7[_0x40f694(0x1ca)](printDualExistsHint,_0x16812e);const _0x37f7cf=parseOverrideValue(_0x148988);setProfileOverride(getProjectPath(),_0x16812e,_0x55ee12,_0x37f7cf),console['log']('Set\x20'+_0x55ee12+'\x20=\x20'+JSON['stringify'](_0x37f7cf)+_0x40f694(0x1e0)+_0x16812e+'\x22');return;}const _0x4faaad=_0x2231d7['eBVqD'](parseLocalValue,_0x55ee12,_0x148988);_0x2231d7['KeglE'](setProfileOverride,_0x2231d7[_0x40f694(0x1bb)](getProjectPath),_0x16812e,_0x55ee12,_0x4faaad),console[_0x40f694(0x1dd)](_0x40f694(0x1e5)+_0x55ee12+_0x40f694(0x1c7)+_0x4faaad+_0x40f694(0x1e0)+_0x16812e+'\x22');}export async function configGet(_0x190a4f,_0x640c6b){const _0x3a223e=_0x17fb66,_0x241394={'lLkJX':function(_0x5cb556,_0x5400be){return _0x5cb556===_0x5400be;},'valmL':function(_0x1640c3,_0x425b2f){return _0x1640c3===_0x425b2f;},'cWYKw':_0x3a223e(0x1d4),'ZcgOd':function(_0x3d269a,_0x2ce64e){return _0x3d269a(_0x2ce64e);},'kAghI':function(_0x57f13d,_0x5519e0,_0x463152){return _0x57f13d(_0x5519e0,_0x463152);},'JebvB':function(_0xa7bc67,_0x4b235a){return _0xa7bc67===_0x4b235a;},'GSrHl':function(_0x18a84e,_0x1d3d14){return _0x18a84e===_0x1d3d14;}},_0xf5fc53=await resolveProfileTarget(_0x190a4f);if(_0xf5fc53['kind']==='cloud'){const _0x221230=await loadEffectiveCloudSettings(_0x190a4f),_0x36679f=getNestedValue(_0x221230,_0x640c6b);if(_0x241394['lLkJX'](_0x36679f,undefined))console['log']('(not\x20set)');else _0x241394['valmL'](typeof _0x36679f,_0x241394[_0x3a223e(0x1c4)])?console['log'](JSON[_0x3a223e(0x1c2)](_0x36679f,null,0x2)):console[_0x3a223e(0x1dd)](_0x36679f);return;}const _0x3508c6=await _0x241394[_0x3a223e(0x1bd)](loadSettings,_0x190a4f),_0x2ea97b=_0x241394['kAghI'](getNestedValue,_0x3508c6,_0x640c6b);if(_0x241394['JebvB'](_0x2ea97b,undefined))console[_0x3a223e(0x1dd)](_0x3a223e(0x1ce));else _0x241394[_0x3a223e(0x1b4)](typeof _0x2ea97b,_0x3a223e(0x1d4))?console[_0x3a223e(0x1dd)](JSON[_0x3a223e(0x1c2)](_0x2ea97b,null,0x2)):console['log'](_0x2ea97b);}export async function configList(_0x199138){const _0x46a68f=_0x17fb66,_0x1de1e5={'KXaBv':function(_0x4b50d6,_0x2594fa){return _0x4b50d6===_0x2594fa;},'oynaf':function(_0x2340da,_0x2d8058){return _0x2340da(_0x2d8058);},'ZdQPM':function(_0x57b714,_0x323f3d){return _0x57b714(_0x323f3d);},'ROaCV':function(_0x251fd6,_0x5eb7f5){return _0x251fd6(_0x5eb7f5);}},_0x14d345=await resolveProfileTarget(_0x199138);if(_0x1de1e5['KXaBv'](_0x14d345['kind'],_0x46a68f(0x1b6))){const _0xcff8ef=await _0x1de1e5['oynaf'](loadEffectiveCloudSettings,_0x199138);if(!_0xcff8ef||Object[_0x46a68f(0x1c1)](_0xcff8ef)[_0x46a68f(0x1d1)]===0x0){console['log'](_0x46a68f(0x1e7)+_0x199138+'\x22');return;}console[_0x46a68f(0x1dd)](JSON['stringify'](_0xcff8ef,null,0x2));return;}const _0x508f77=_0x1de1e5['oynaf'](getSettingsPath,_0x199138);if(!_0x1de1e5[_0x46a68f(0x1e1)](existsSync,_0x508f77)){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x199138+'\x22');return;}const _0x48fa9c=await _0x1de1e5[_0x46a68f(0x1d2)](loadSettings,_0x199138),_0x5e344b=_0x1de1e5['ROaCV'](formatSettings,_0x48fa9c);!_0x5e344b?console[_0x46a68f(0x1dd)](_0x46a68f(0x1e7)+_0x199138+'\x22'):console['log'](_0x5e344b);}export async function configUnset(_0x355dfe,_0x35a706){const _0x74c48=_0x17fb66,_0x2f7853={'ndriP':'cloud','svWxv':function(_0x50135d,_0x3fc150){return _0x50135d(_0x3fc150);},'OwMbi':function(_0x5a3850){return _0x5a3850();}},_0x2543f0=await resolveProfileTarget(_0x355dfe);if(_0x2543f0[_0x74c48(0x1ea)]===_0x2f7853['ndriP']){if(_0x2543f0['alsoExistsElsewhere'])_0x2f7853[_0x74c48(0x1e2)](printDualExistsHint,_0x355dfe);const _0x269c7f=unsetProfileOverride(_0x2f7853[_0x74c48(0x1af)](getProjectPath),_0x355dfe,_0x35a706);_0x269c7f?console[_0x74c48(0x1dd)]('Removed\x20'+_0x35a706+'\x20for\x20\x22'+_0x355dfe+'\x22'):console[_0x74c48(0x1dd)](_0x74c48(0x1d7)+_0x35a706+'\x22\x20not\x20found');return;}const _0x1aa4df=unsetProfileOverride(getProjectPath(),_0x355dfe,_0x35a706);if(_0x1aa4df){console[_0x74c48(0x1dd)]('Removed\x20'+_0x35a706);return;}const _0x4163ad=await _0x2f7853[_0x74c48(0x1e2)](loadSettings,_0x355dfe),_0x2a1438=deleteNestedValue(_0x4163ad,_0x35a706);_0x2a1438?console['log']('Key\x20\x22'+_0x35a706+'\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22'+_0x355dfe+_0x74c48(0x1c8)):console[_0x74c48(0x1dd)](_0x74c48(0x1d7)+_0x35a706+'\x22\x20not\x20found');}export async function configReset(_0x52bda5){const _0x59fd82=_0x17fb66,_0x1095c3={'wYFpU':function(_0x5d32a4,_0x313f46){return _0x5d32a4(_0x313f46);},'QdFjU':function(_0x470de2,_0x5e30ae){return _0x470de2===_0x5e30ae;},'rVmED':function(_0x5b4a4a){return _0x5b4a4a();}},_0x59b0fe=await _0x1095c3[_0x59fd82(0x1c6)](resolveProfileTarget,_0x52bda5);if(_0x1095c3[_0x59fd82(0x1d3)](_0x59b0fe[_0x59fd82(0x1ea)],'cloud')){resetProfileOverrides(_0x1095c3[_0x59fd82(0x1ba)](getProjectPath),_0x52bda5),console[_0x59fd82(0x1dd)](_0x59fd82(0x1cc)+_0x52bda5+'\x22');return;}console[_0x59fd82(0x1dd)]('\x22'+_0x52bda5+'\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20'+_0x52bda5+'\x20<key>\x22\x20to\x20remove\x20individual\x20values.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xcd0a2b,_0x19cb27){const _0x570230=_0x6f84,_0xffa180=_0xcd0a2b();while(!![]){try{const _0x200b9c=parseInt(_0x570230(0xac))/0x1*(-parseInt(_0x570230(0xb7))/0x2)+parseInt(_0x570230(0xbb))/0x3*(-parseInt(_0x570230(0xb3))/0x4)+parseInt(_0x570230(0xb4))/0x5*(parseInt(_0x570230(0xaa))/0x6)+-parseInt(_0x570230(0xb2))/0x7*(parseInt(_0x570230(0xbc))/0x8)+parseInt(_0x570230(0xaf))/0x9*(parseInt(_0x570230(0xad))/0xa)+parseInt(_0x570230(0xb6))/0xb+-parseInt(_0x570230(0xa9))/0xc*(-parseInt(_0x570230(0xae))/0xd);if(_0x200b9c===_0x19cb27)break;else _0xffa180['push'](_0xffa180['shift']());}catch(_0x4736db){_0xffa180['push'](_0xffa180['shift']());}}}(_0x5154,0xa8a74));import _0x30f3a6 from'inquirer';import{deleteCloudProfile,fetchCloudProfile}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';function _0x6f84(_0x14d2f4,_0x155c5e){_0x14d2f4=_0x14d2f4-0xa8;const _0x515408=_0x5154();let _0x6f84b8=_0x515408[_0x14d2f4];return _0x6f84b8;}import{clearLastProfile,resetProfileOverrides}from'./utils/projectsConfig.js';function _0x5154(){const _0x1954bb=['7HFEbtG','220ozpLYZ','2019245sBKbEC','confirmation','9366852RsImXj','2vJCKwc','Type\x20\x22','yes','xiCha','70107uIBiqf','972912mzVHgI','CZnme','cwd','\x0aWarning:\x20this\x20deletes\x20the\x20shared\x20cloud\x20profile\x20\x22','\x22\x20for\x20everyone\x20in\x20your\x20organization.','542604zEpmfz','12kSUwOZ','\x22\x20not\x20found.','1334363NFzHOG','11420kExGlP','468cCpXgY','1143bnVgok','\x22\x20to\x20confirm\x20deletion:','cxyex'];_0x5154=function(){return _0x1954bb;};return _0x5154();}export async function deleteProfile(_0x19a334,_0x192749={}){const _0x131c01=_0x6f84,_0x27bcd4={'CZnme':function(_0xa686b3){return _0xa686b3();},'AGKRd':'Profile\x20deletion\x20requires\x20an\x20interactive\x20terminal\x20so\x20the\x20profile\x20name\x20can\x20be\x20typed\x20for\x20confirmation.\x20Pass\x20--yes\x20to\x20skip\x20confirmation.','cxyex':'input','wkHrO':function(_0x260ac4,_0x4be282){return _0x260ac4!==_0x4be282;},'xiCha':function(_0x37d96b,_0x5558f8){return _0x37d96b(_0x5558f8);},'IdGJZ':function(_0x4e7729,_0x4fc447,_0x24ac51){return _0x4e7729(_0x4fc447,_0x24ac51);},'rOGnf':function(_0x3dc667,_0x139b72,_0x4688d7){return _0x3dc667(_0x139b72,_0x4688d7);}},_0x1680a7=await fetchCloudProfile(_0x19a334);if(!_0x1680a7)throw new Error('Cloud\x20profile\x20\x22'+_0x19a334+_0x131c01(0xab));if(!_0x192749[_0x131c01(0xb9)]&&!_0x27bcd4[_0x131c01(0xbd)](isInteractive))throw new Error(_0x27bcd4['AGKRd']);console['log'](_0x131c01(0xbf)+_0x19a334+_0x131c01(0xa8));if(!_0x192749['yes']){const {confirmation:_0x67c30d}=await _0x30f3a6['prompt']([{'type':_0x27bcd4[_0x131c01(0xb1)],'name':_0x131c01(0xb5),'message':_0x131c01(0xb8)+_0x19a334+_0x131c01(0xb0)}]);if(_0x27bcd4['wkHrO'](_0x67c30d,_0x19a334))throw new Error('Profile\x20deletion\x20cancelled:\x20confirmation\x20did\x20not\x20match.');}await _0x27bcd4[_0x131c01(0xba)](deleteCloudProfile,_0x19a334),_0x27bcd4['IdGJZ'](resetProfileOverrides,process['cwd'](),_0x19a334),_0x27bcd4['rOGnf'](clearLastProfile,process[_0x131c01(0xbe)](),_0x19a334),console['log']('✓\x20Deleted\x20cloud\x20profile\x20\x22'+_0x19a334+'\x22.');}
|
package/build/commands/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0xf1ccda=_0xd9b3;(function(_0x26045a,_0x2d51cb){const _0x587624=_0xd9b3,_0xe6be22=_0x26045a();while(!![]){try{const _0x3cc8b7=parseInt(_0x587624(0x16f))/0x1*(parseInt(_0x587624(0x175))/0x2)+parseInt(_0x587624(0x182))/0x3*(-parseInt(_0x587624(0x160))/0x4)+parseInt(_0x587624(0x166))/0x5+parseInt(_0x587624(0x187))/0x6+parseInt(_0x587624(0x171))/0x7*(parseInt(_0x587624(0x18d))/0x8)+parseInt(_0x587624(0x18b))/0x9*(parseInt(_0x587624(0x169))/0xa)+-parseInt(_0x587624(0x174))/0xb;if(_0x3cc8b7===_0x2d51cb)break;else _0xe6be22['push'](_0xe6be22['shift']());}catch(_0x4c84b3){_0xe6be22['push'](_0xe6be22['shift']());}}}(_0x26dc,0x9243c));import{readdir,stat}from'fs/promises';import{join}from'path';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 _0x26dc(){const _0x214cb6=['1893WjDiTC','qNMtG','get','\x0a\x20\x20','jeYeL','645672YQWKGg','baseUrl','message','\x0aNo\x20profiles\x20found.','30231yoswYm','log','8wOrqYM','environmentDetails','Run:\x20ranger\x20profile\x20add\x20<profile-name>','environmentKey','6436bwFiBL','includes','sessionUpdatedAt','jtwcH','DuGKC','\x0aCloud\x20Profiles\x20(by\x20environment):','5214665OTzUPu','\x0aLocal\x20Profiles\x20(legacy):','\x20\x20\x20\x20','750CoSuyE','\x0a*\x20=\x20active\x20profile','sessions','\x20\x20\x20\x20Session:\x20','cached\x20(updated\x20','map','2IShdyh','localeCompare','5232185cxNvGQ','Xornn','keys','16927592FhuGPi','1003326sLaiIb','sort','uiMcX','.txt','isDirectory','no\x20session','error','WfXOj','name','push','EsVuP','local','some'];_0x26dc=function(){return _0x214cb6;};return _0x26dc();}const NON_ENV_DIRS=[_0xf1ccda(0x16b),'bug-bashes','reports',_0xf1ccda(0x180),'ci'];export function shouldGroupByEnvironment(_0x33d9f4){const _0x1b5567=_0xf1ccda;return _0x33d9f4[_0x1b5567(0x181)](_0x32abb9=>_0x32abb9['environmentKey']);}export function groupCloudProfilesByEnvironment(_0x27f5ce){const _0x510196=_0xf1ccda,_0x3392ad=new Map();for(const _0x1cb188 of _0x27f5ce){const _0x452f3d=_0x1cb188['environmentKey']??null,_0x5579e0=_0x3392ad['get'](_0x452f3d);if(_0x5579e0)_0x5579e0[_0x510196(0x17e)](_0x1cb188);else _0x3392ad['set'](_0x452f3d,[_0x1cb188]);}const _0x125287=[..._0x3392ad[_0x510196(0x173)]()]['sort']((_0x505e4b,_0x4be945)=>{const _0x550118=_0x510196;if(_0x505e4b===null)return 0x1;if(_0x4be945===null)return-0x1;return _0x505e4b[_0x550118(0x170)](_0x4be945);});return _0x125287[_0x510196(0x16e)](_0x5d206c=>({'environmentKey':_0x5d206c,'profiles':_0x3392ad[_0x510196(0x184)](_0x5d206c)['sort']((_0x2f9f2d,_0x422083)=>_0x2f9f2d['name'][_0x510196(0x170)](_0x422083[_0x510196(0x17d)]))}));}export async function getEnvNames(){const _0x51c7ad=_0xf1ccda,_0x4f0ce9={'AHFyA':function(_0x404a63){return _0x404a63();},'ehhLn':function(_0x104fbf,_0x48f8dd,_0x19ccc1){return _0x104fbf(_0x48f8dd,_0x19ccc1);},'EsVuP':function(_0x11dee4,_0x387669){return _0x11dee4(_0x387669);},'jtwcH':function(_0x234871,_0x11892d,_0x5bab66){return _0x234871(_0x11892d,_0x5bab66);},'WfXOj':function(_0x52971e,_0x23b7d7,_0x1b4c95){return _0x52971e(_0x23b7d7,_0x1b4c95);},'UggzB':function(_0x138c2b,_0x3c5254){return _0x138c2b(_0x3c5254);},'oUPtz':'settings.json'},_0x4195b4=getRangerDir();if(!existsSync(_0x4195b4))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x4d6131=await _0x4f0ce9['AHFyA'](readActiveProfileName),_0x5315d9=[],_0x477992={},_0x1ec75d=_0x4f0ce9['ehhLn'](join,_0x4195b4,_0x51c7ad(0x180));if(_0x4f0ce9[_0x51c7ad(0x17f)](existsSync,_0x1ec75d)){const _0x421944=await readdir(_0x1ec75d);for(const _0x46a222 of _0x421944){const _0x4c157d=_0x4f0ce9[_0x51c7ad(0x163)](join,_0x1ec75d,_0x46a222),_0x6b311e=await stat(_0x4c157d);_0x6b311e[_0x51c7ad(0x179)]()&&(_0x5315d9[_0x51c7ad(0x17e)](_0x46a222),_0x477992[_0x46a222]=_0x51c7ad(0x180));}}const _0x4e9419=join(_0x4195b4,'ci');if(existsSync(_0x4e9419)){const _0x35c848=await _0x4f0ce9['EsVuP'](readdir,_0x4e9419);for(const _0x1f1418 of _0x35c848){const _0x47ab22=_0x4f0ce9[_0x51c7ad(0x163)](join,_0x4e9419,_0x1f1418),_0x1ea425=await _0x4f0ce9[_0x51c7ad(0x17f)](stat,_0x47ab22);_0x1ea425[_0x51c7ad(0x179)]()&&(_0x5315d9['push'](_0x1f1418),_0x477992[_0x1f1418]='ci');}}const _0x469683=await _0x4f0ce9[_0x51c7ad(0x17f)](readdir,_0x4195b4);for(const _0x28adcb of _0x469683){if(NON_ENV_DIRS[_0x51c7ad(0x161)](_0x28adcb))continue;if(_0x28adcb['startsWith']('.'))continue;if(_0x28adcb['endsWith'](_0x51c7ad(0x178)))continue;const _0x4ecb41=_0x4f0ce9[_0x51c7ad(0x17c)](join,_0x4195b4,_0x28adcb),_0x18c004=await _0x4f0ce9[_0x51c7ad(0x17f)](stat,_0x4ecb41);_0x18c004[_0x51c7ad(0x179)]()&&_0x4f0ce9['UggzB'](existsSync,join(_0x4ecb41,_0x4f0ce9['oUPtz']))&&(!_0x5315d9[_0x51c7ad(0x161)](_0x28adcb)&&(_0x5315d9[_0x51c7ad(0x17e)](_0x28adcb),_0x477992[_0x28adcb]='legacy'));}return{'envNames':_0x5315d9,'activeEnv':_0x4d6131,'envTypes':_0x477992};}function _0xd9b3(_0x16387a,_0x1b2d35){_0x16387a=_0x16387a-0x15f;const _0x26dc89=_0x26dc();let _0xd9b304=_0x26dc89[_0x16387a];return _0xd9b304;}export async function envList(){const _0x18b8a3=_0xf1ccda,_0x2ce6f6={'qNMtG':function(_0x2f2fd2,_0x472185){return _0x2f2fd2===_0x472185;},'DuGKC':_0x18b8a3(0x17a),'nmcVL':function(_0x42868a){return _0x42868a();},'GnwLu':function(_0x3c91bd,_0x19c95b){return _0x3c91bd===_0x19c95b;},'jeYeL':_0x18b8a3(0x18f),'Xornn':function(_0xcb042d,_0x2a8026){return _0xcb042d(_0x2a8026);},'uiMcX':function(_0x3ce4fd,_0x4690a2,_0x39efe3){return _0x3ce4fd(_0x4690a2,_0x39efe3);},'cnoEh':'\x0aCloud\x20Profiles:'},{envNames:_0x46375f,activeEnv:_0x423b79,envTypes:_0x1ba1b4}=await _0x2ce6f6['nmcVL'](getEnvNames);let _0xb4a0e6=[];const _0x5be9bf=await _0x2ce6f6['nmcVL'](getToken);if(_0x5be9bf)try{_0xb4a0e6=await listCloudProfiles();}catch(_0x4b0c46){console[_0x18b8a3(0x17b)]('\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profiles:\x20'+(_0x4b0c46 instanceof Error?_0x4b0c46[_0x18b8a3(0x189)]:String(_0x4b0c46)));}if(_0x2ce6f6['GnwLu'](_0x46375f['length'],0x0)&&_0xb4a0e6['length']===0x0){console[_0x18b8a3(0x18c)](_0x18b8a3(0x18a)),console['log'](_0x2ce6f6[_0x18b8a3(0x186)]);return;}const _0xa30917=new Set(_0xb4a0e6[_0x18b8a3(0x16e)](_0x4a03aa=>_0x4a03aa['name']));if(_0x46375f['length']>0x0){console['log'](_0x18b8a3(0x167));for(const _0x19ef0b of _0x46375f['sort']()){const _0x2e465b=_0x2ce6f6[_0x18b8a3(0x183)](_0x19ef0b,_0x423b79)&&!_0xa30917['has'](_0x19ef0b),_0x3ef7bf=_0x1ba1b4[_0x19ef0b]||_0x18b8a3(0x180),_0x1bd3f4=await _0x2ce6f6[_0x18b8a3(0x172)](loadSettings,_0x19ef0b),_0x5e8f92=_0x3ef7bf==='legacy'?'':'\x20['+_0x3ef7bf+']';console[_0x18b8a3(0x18c)]('\x20\x20'+(_0x2e465b?'*\x20':'\x20\x20')+_0x19ef0b+_0x5e8f92),_0x1bd3f4[_0x18b8a3(0x188)]&&console[_0x18b8a3(0x18c)]('\x20\x20\x20\x20\x20\x20URL:\x20'+_0x1bd3f4['baseUrl']),_0x1bd3f4[_0x18b8a3(0x18e)]&&console['log']('\x20\x20\x20\x20\x20\x20Details:\x20'+_0x1bd3f4[_0x18b8a3(0x18e)]);}}const _0x32031d=(_0x326c09,_0x3e2d17)=>{const _0x268dae=_0x18b8a3,_0x904e7e=_0x2ce6f6[_0x268dae(0x183)](_0x326c09['name'],_0x423b79),_0x3111ff=_0x326c09[_0x268dae(0x162)]?_0x268dae(0x16d)+_0x326c09['sessionUpdatedAt']+')':_0x2ce6f6[_0x268dae(0x164)];console[_0x268dae(0x18c)](''+_0x3e2d17+(_0x904e7e?'*\x20':'\x20\x20')+_0x326c09['name']),console[_0x268dae(0x18c)](_0x3e2d17+_0x268dae(0x16c)+_0x3111ff);};if(_0xb4a0e6['length']>0x0){if(shouldGroupByEnvironment(_0xb4a0e6)){console['log'](_0x18b8a3(0x165));for(const _0x292b9c of groupCloudProfilesByEnvironment(_0xb4a0e6)){const _0x880cbb=_0x292b9c[_0x18b8a3(0x15f)]??'(no\x20environment\x20—\x20manual\x20or\x20no\x20auth)';console[_0x18b8a3(0x18c)](_0x18b8a3(0x185)+_0x880cbb);for(const _0x461dda of _0x292b9c['profiles']){_0x2ce6f6[_0x18b8a3(0x177)](_0x32031d,_0x461dda,_0x18b8a3(0x168));}}}else{console['log'](_0x2ce6f6['cnoEh']);for(const _0x104358 of[..._0xb4a0e6][_0x18b8a3(0x176)]((_0x5c25be,_0x876b02)=>_0x5c25be['name'][_0x18b8a3(0x170)](_0x876b02['name']))){_0x32031d(_0x104358,'\x20\x20');}}}_0x423b79&&console['log'](_0x18b8a3(0x16a));}
|