@ranger-testing/ranger-cli 3.1.3-alpha.546c9e8-43 → 3.1.3
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/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 +2 -2
package/build/commands/addEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0xe765e4=_0xfa59;(function(_0x53ec30,_0x38924a){const _0x1944b5=_0xfa59,_0x45b646=_0x53ec30();while(!![]){try{const _0x36dc85=-parseInt(_0x1944b5(0x203))/0x1+-parseInt(_0x1944b5(0x1f0))/0x2+-parseInt(_0x1944b5(0x1b0))/0x3+-parseInt(_0x1944b5(0x1d6))/0x4+-parseInt(_0x1944b5(0x1c1))/0x5+parseInt(_0x1944b5(0x1be))/0x6*(parseInt(_0x1944b5(0x18a))/0x7)+parseInt(_0x1944b5(0x1d3))/0x8;if(_0x36dc85===_0x38924a)break;else _0x45b646['push'](_0x45b646['shift']());}catch(_0x31e08d){_0x45b646['push'](_0x45b646['shift']());}}}(_0xfbf4,0x5268b));import{readdir,rm}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x46318a from'inquirer';import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';function _0xfbf4(){const _0x107042=['ZAgKY','force','FlqoT','keys','--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','url','\x0a✓\x20Profile\x20\x27','\x0a\x20\x20A\x20profile\x20named\x20\x22','name','\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','To\x20set\x20up\x20a\x20profile,\x20run:\x0a','environments','yes','origin','fetch\x20failed','\x27\x20matching\x20',')\x0a\x20\x20Save\x20\x27','nRhgK','abort','exit','The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a','Could\x20not\x20reach\x20','use_suggestion','baseUrl','message','some','Continue\x20anyway','\x20\x20https://docs.ranger.net/main/concepts/profiles','setupHeader','log','\x27\x20created\x20(no\x20session).\x0a','1488297SEiFdO','ieUfl','xrGYE','Found\x20auth\x20environment\x20\x27','\x0a\x20\x20(domains:\x20','cdpEndpoint','jnwLQ','warn','trackPhaseEnd','IfxOO','VsVAV','\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.','edwSN','kXpnb','11724WpKWSt','BeiDB','join','1210005vhZfFw','MfDfB','eHVSu','\x20(continuing\x20with\x20--force)','HhfqD','fFHeN','\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a','no_auth_config','AooMR','This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization','FnJcb','YwgZY','cwd','\x0a🌐\x20Profile\x20Setup\x0a','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','KYkkq','qjZvU','✓\x20Cloud\x20profile\x20\x27','11807848gPOwDF','user_declined','\x20\x20Set\x20active\x20profile:\x20','1806352kuzBIV','\x22.\x20Expected\x20\x22Name:\x20Value\x22.','⚠\x20Could\x20not\x20reach\x20','✓\x20Profile\x20\x27','length','\x20\x20Next:\x20ranger\x20go\x20--profile\x20','profile.add.autoRouted','bAxeG','VkpVR','tBoMK','awKRp','xbTUz','\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','test','error','dspvg','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','neNsQ','rUrvY','continue','saveToCloud','FgKxH','\x20--skip-auth\x0a','startsWith','setupHeaders','628358HTPDTT','confirm','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','\x27\x20created.\x0a','\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.','local','PKfFZ','\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a','KQsCy','\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','.\x20Configured\x20envs:\x20','trim','\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','EWerB','cKsZe','prompt','kvOVv','wIscc','224675lzYKKi','capture','status','\x20--url\x20','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.','SFSkX','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','VVBLi','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','\x27\x20to\x20the\x20cloud?','ovUsh','slice','stdout','\x27\x20created\x20with\x20a\x20captured\x20session.\x0a','NODE_TLS_REJECT_UNAUTHORIZED','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','2114jSUlfR','includes','Invalid\x20URL','Use\x20','skipAuth','IqPCt','mRuFv'];_0xfbf4=function(){return _0x107042;};return _0xfbf4();}import{writeActiveProfileName}from'./utils/activeProfile.js';function _0xfa59(_0x3b9287,_0x10df09){_0x3b9287=_0x3b9287-0x18a;const _0xfbf4c8=_0xfbf4();let _0xfa59f5=_0xfbf4c8[_0x3b9287];return _0xfa59f5;}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=_0xe765e4(0x1ca);function warnCloudProfileSharedInOrg(){const _0x19d008=_0xe765e4;if(!process[_0x19d008(0x20f)]['isTTY'])return;console[_0x19d008(0x1b7)](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x205a60){const _0x56eae5=_0xe765e4,_0x5e5d72={'ShVZz':'HEAD','IqPCt':function(_0x227c04,_0x25b53d){return _0x227c04===_0x25b53d;},'fFHeN':'TypeError','qjZvU':_0x56eae5(0x19f)};try{const _0x513fad=new AbortController(),_0x4d5263=setTimeout(()=>_0x513fad[_0x56eae5(0x1a3)](),0x1388),_0xd39728={'method':_0x5e5d72['ShVZz'],'signal':_0x513fad['signal'],'redirect':'manual'};/^https:\/\/localhost(:\d+)?/i[_0x56eae5(0x1e4)](_0x205a60)&&(process['env']['NODE_TLS_REJECT_UNAUTHORIZED']='0');const _0x39e365=await fetch(_0x205a60,_0xd39728);delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'],clearTimeout(_0x4d5263);if(_0x39e365['status']<0x190)return{'ok':!![]};return{'ok':![],'error':'HTTP\x20'+_0x39e365[_0x56eae5(0x205)]};}catch(_0x127bda){delete process['env'][_0x56eae5(0x211)];const _0x4cd24b=_0x127bda,_0x1a988a=_0x4cd24b[_0x56eae5(0x1a9)]||String(_0x127bda),_0x385afc=_0x1a988a['includes'](_0x56eae5(0x18c))||_0x5e5d72[_0x56eae5(0x18f)](_0x4cd24b[_0x56eae5(0x199)],_0x5e5d72[_0x56eae5(0x1c6)])||_0x1a988a[_0x56eae5(0x18b)](_0x5e5d72[_0x56eae5(0x1d1)]);return{'ok':![],'error':_0x1a988a,'isProtocolError':_0x385afc};}}async function sweepOrphanLocalProfile(_0x1487b3,_0x597cc3,_0x4acf14){const _0x2c7792=_0xe765e4,_0x9ab1a4={'mRuFv':function(_0x16b335,_0x4bd2cb,_0x468748){return _0x16b335(_0x4bd2cb,_0x468748);},'FgKxH':function(_0x2f2fc7,_0x3abb00){return _0x2f2fc7(_0x3abb00);},'yfWpm':function(_0x1ea58f,_0x4f6e93,_0x90f00e){return _0x1ea58f(_0x4f6e93,_0x90f00e);}},_0x301cbd=_0x9ab1a4['mRuFv'](join,_0x597cc3,_0x2c7792(0x1f5)),_0x1a69c7=join(_0x301cbd,_0x1487b3);existsSync(_0x1a69c7)&&(_0x4acf14&&await _0x9ab1a4['FgKxH'](isPathGitTracked,_0x1a69c7)?console['log']('\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20'+_0x1a69c7+_0x2c7792(0x207)):(await _0x9ab1a4[_0x2c7792(0x190)](rm,_0x1a69c7,{'recursive':!![],'force':!![]}),console['log'](_0x2c7792(0x1fa)+_0x1a69c7)));if(existsSync(_0x301cbd)){let _0x4f2686=[];try{_0x4f2686=await _0x9ab1a4[_0x2c7792(0x1ec)](readdir,_0x301cbd);}catch{return;}const _0x21963e='.tmp-'+_0x1487b3+'-';for(const _0xb90948 of _0x4f2686){if(!_0xb90948[_0x2c7792(0x1ee)](_0x21963e))continue;const _0x10cefe=_0x9ab1a4['yfWpm'](join,_0x301cbd,_0xb90948);await rm(_0x10cefe,{'recursive':!![],'force':!![]}),console['log'](_0x2c7792(0x1fa)+_0x10cefe);}}}async function sweepOrphansBestEffort(_0x41e7be){const _0x6cd507=_0xe765e4,_0x451085={'kASWM':function(_0x4e8db0){return _0x4e8db0();},'ieUfl':function(_0x546c45,_0xda98e6){return _0x546c45!==_0xda98e6;},'AooMR':function(_0x599be5,_0x320849){return _0x599be5 instanceof _0x320849;},'XLinW':function(_0x336640,_0x1de482){return _0x336640(_0x1de482);}};try{await sweepOrphanLocalProfile(_0x41e7be,_0x451085['kASWM'](getRangerHomeDir),![]);const _0x558e0c=getRangerDir();_0x451085[_0x6cd507(0x1b1)](_0x558e0c,getRangerHomeDir())&&await sweepOrphanLocalProfile(_0x41e7be,_0x558e0c,!![]);}catch(_0x1c9c87){console['log'](_0x6cd507(0x19a)+(_0x451085[_0x6cd507(0x1c9)](_0x1c9c87,Error)?_0x1c9c87[_0x6cd507(0x1a9)]:_0x451085['XLinW'](String,_0x1c9c87))+').');}}async function markActive(_0x46d2df){const _0x15e8bd=_0xe765e4,_0x59042c={'bAxeG':function(_0x5410bd,_0x592caa){return _0x5410bd(_0x592caa);},'dfXWM':'Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.'};try{await _0x59042c[_0x15e8bd(0x1dd)](writeActiveProfileName,_0x46d2df),console[_0x15e8bd(0x1ae)](_0x15e8bd(0x1d5)+_0x46d2df);}catch{console[_0x15e8bd(0x1ae)](_0x59042c['dfXWM']);}}async function tryAutoRouteCloudProfile(_0xff821d,_0x4e2340,_0xb58227,_0x2da0ec,_0x38d886){const _0x3a4ae2=_0xe765e4,_0x259f10={'aevpT':function(_0x1933c7){return _0x1933c7();},'FlqoT':'profile.add.autoRouteSkipped','nRhgK':function(_0x2df1b3,_0x1edaf2){return _0x2df1b3 instanceof _0x1edaf2;},'XyKxu':function(_0x5b9019,_0x363a78,_0x2c8a07,_0x515d9b,_0x25a813){return _0x5b9019(_0x363a78,_0x2c8a07,_0x515d9b,_0x25a813);},'kFBkQ':function(_0x5aadec,_0x7dc398){return _0x5aadec+_0x7dc398;},'fxTBs':function(_0x57a5fd,_0x2f94a6){return _0x57a5fd+_0x2f94a6;},'nKzSC':'\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','IfxOO':_0x3a4ae2(0x1c7),'FnJcb':'no_match','kXpnb':'user_declined','KYkkq':_0x3a4ae2(0x20b),'ZAgKY':function(_0x11edb1,_0x59589b,_0x36ff73,_0x1e0be3){return _0x11edb1(_0x59589b,_0x36ff73,_0x1e0be3);},'VkpVR':function(_0x401e87,_0x2df00f){return _0x401e87===_0x2df00f;},'jnwLQ':function(_0x320fe2,_0x183c63){return _0x320fe2(_0x183c63);}};let _0x3bc160;try{_0x3bc160=await _0x259f10['aevpT'](fetchAuthConfig);}catch(_0x2143fa){return _0x38d886?.[_0x3a4ae2(0x1b8)](_0x259f10['FlqoT'],{'reason':_0x3a4ae2(0x1c8),'profileName':_0xff821d}),console[_0x3a4ae2(0x1e5)](_0x3a4ae2(0x1f9)+(_0x259f10[_0x3a4ae2(0x1a2)](_0x2143fa,Error)?_0x2143fa[_0x3a4ae2(0x1a9)]:String(_0x2143fa))),![];}if(!_0x3bc160||!_0x3bc160['environments']||Object[_0x3a4ae2(0x194)](_0x3bc160[_0x3a4ae2(0x19c)])[_0x3a4ae2(0x1da)]===0x0){if(_0x2da0ec)return await _0x259f10['XyKxu'](captureEnvLessProfile,_0xff821d,_0x4e2340,_0xb58227,_0x38d886);return _0x38d886?.['trackPhaseEnd'](_0x259f10[_0x3a4ae2(0x193)],{'reason':'no_auth_config','profileName':_0xff821d}),console[_0x3a4ae2(0x1e5)](_0x259f10['kFBkQ'](_0x259f10['kFBkQ'](_0x259f10['fxTBs'](_0x259f10['fxTBs'](_0x259f10['nKzSC'],'\x0a'),_0x259f10[_0x3a4ae2(0x1b9)])+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20'+_0xff821d+_0x3a4ae2(0x206)+_0x4e2340+_0x3a4ae2(0x1ed))+'\x0a','\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a'),_0x3a4ae2(0x1fd))),![];}const _0x242a1e=matchAuthEnvironment(_0x4e2340,_0x3bc160);if(!_0x242a1e)return _0x38d886?.[_0x3a4ae2(0x1b8)](_0x259f10['FlqoT'],{'reason':_0x259f10[_0x3a4ae2(0x1cb)],'profileName':_0xff821d}),console['error']('\x0a\x20\x20No\x20auth\x20env\x20matches\x20'+_0x4e2340+_0x3a4ae2(0x1fb)+Object['keys'](_0x3bc160[_0x3a4ae2(0x19c)])['join'](',\x20')+'.'),![];const _0x1dc8f4=_0x3bc160[_0x3a4ae2(0x19c)][_0x242a1e],_0x10e125=_0x1dc8f4?.['domains']??[];if(_0x2da0ec&&!_0xb58227[_0x3a4ae2(0x19d)]){const {saveToCloud:_0x43fd12}=await _0x46318a['prompt']([{'type':_0x3a4ae2(0x1f1),'name':_0x3a4ae2(0x1eb),'message':_0x3a4ae2(0x1b3)+_0x242a1e+_0x3a4ae2(0x1a0)+_0x4e2340+_0x3a4ae2(0x1b4)+_0x10e125[_0x3a4ae2(0x1c0)](',\x20')+_0x3a4ae2(0x1a1)+_0xff821d+_0x3a4ae2(0x20c),'default':!![]}]);if(!_0x43fd12)return _0x38d886?.[_0x3a4ae2(0x1b8)]('profile.add.autoRouteSkipped',{'reason':_0x259f10[_0x3a4ae2(0x1bd)],'profileName':_0xff821d}),console['error'](_0x259f10[_0x3a4ae2(0x1d0)]),![];}const _0x1ec97f=_0x10e125[_0x3a4ae2(0x1aa)](_0x5e5548=>{const _0x236c0c=_0x3a4ae2;try{return new URL(_0x5e5548)['origin']===new URL(_0x4e2340)[_0x236c0c(0x19e)];}catch{return![];}}),_0x18f5a6={};!_0x1ec97f&&(_0x18f5a6['baseUrl']=_0x4e2340);try{await _0x259f10[_0x3a4ae2(0x191)](createCloudProfile,_0xff821d,_0x242a1e,{'settings':_0x18f5a6}),warnCloudProfileSharedInOrg();}catch(_0x22a43a){if(_0x259f10[_0x3a4ae2(0x1a2)](_0x22a43a,ApiError)&&_0x259f10[_0x3a4ae2(0x1de)](_0x22a43a['status'],0x199)){console[_0x3a4ae2(0x1e5)]('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0xff821d+_0x3a4ae2(0x1cf)+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0xff821d));throw _0x22a43a;}throw _0x22a43a;}return console[_0x3a4ae2(0x1ae)](_0x3a4ae2(0x1d9)+_0xff821d+_0x3a4ae2(0x1f3)+(_0x3a4ae2(0x1db)+_0xff821d)),await _0x259f10[_0x3a4ae2(0x1b6)](sweepOrphansBestEffort,_0xff821d),_0x38d886?.['trackPhaseEnd'](_0x3a4ae2(0x1dc),{'envKey':_0x242a1e,'profileName':_0xff821d}),!![];}async function createUnconfiguredCloudProfile(_0x237cac,_0x1b88e9){const _0x4712a3=_0xe765e4,_0x3a9a71={'UNYFV':function(_0x4d86e3){return _0x4d86e3();},'DBGwq':function(_0x4f8805,_0x6c3470){return _0x4f8805===_0x6c3470;},'Prjji':function(_0x4e5bf6,_0x53ba3e){return _0x4e5bf6+_0x53ba3e;}};try{await createCloudProfile(_0x237cac,undefined,{'settings':_0x1b88e9}),_0x3a9a71['UNYFV'](warnCloudProfileSharedInOrg);}catch(_0x80634f){_0x80634f instanceof ApiError&&_0x3a9a71['DBGwq'](_0x80634f['status'],0x199)&&console['error'](_0x3a9a71['Prjji'](_0x4712a3(0x198)+_0x237cac+_0x4712a3(0x1cf),'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x237cac));throw _0x80634f;}}async function captureEnvLessProfile(_0x5b3014,_0x1ea8d8,_0x39310b,_0x4e291e){const _0x24fc36=_0xe765e4,_0x8cde2e={'neNsQ':_0x24fc36(0x1f1),'WnKrV':_0x24fc36(0x204),'xrGYE':'profile.add.autoRouteSkipped','obGeC':function(_0x4ae583,_0x1e46ba){return _0x4ae583===_0x1e46ba;},'tBoMK':function(_0x140fc1,_0xa04419){return _0x140fc1>_0xa04419;},'MfDfB':function(_0x5bfb65,_0x1128cf,_0x513aa8,_0x150903){return _0x5bfb65(_0x1128cf,_0x513aa8,_0x150903);},'OYrCT':function(_0x2ad03f,_0xe793bf){return _0x2ad03f instanceof _0xe793bf;},'SFSkX':function(_0x361b02,_0x13dcd2,_0x30ae21){return _0x361b02(_0x13dcd2,_0x30ae21);},'WkiOm':function(_0x37375c,_0x31c8aa){return _0x37375c+_0x31c8aa;},'KQsCy':'profile.add.autoRouted'};if(!_0x39310b[_0x24fc36(0x19d)]){const {capture:_0x560cd8}=await _0x46318a['prompt']([{'type':_0x8cde2e[_0x24fc36(0x1e8)],'name':_0x8cde2e['WnKrV'],'message':'Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','default':!![]}]);if(!_0x560cd8)return _0x4e291e?.[_0x24fc36(0x1b8)](_0x8cde2e[_0x24fc36(0x1b2)],{'reason':_0x24fc36(0x1d4),'profileName':_0x5b3014}),console[_0x24fc36(0x1e5)]('\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a'+_0x24fc36(0x1bb)),![];}const _0x8008f5={};if(_0x39310b['setupHeader'])for(const _0x2f08b3 of _0x39310b['setupHeader']){const _0x3b3601=_0x2f08b3['indexOf'](':');if(_0x8cde2e['obGeC'](_0x3b3601,-0x1))continue;_0x8008f5[_0x2f08b3[_0x24fc36(0x20e)](0x0,_0x3b3601)['trim']()]=_0x2f08b3[_0x24fc36(0x20e)](_0x3b3601+0x1)['trim']();}const _0x4ca576={'baseUrl':_0x1ea8d8};_0x8cde2e[_0x24fc36(0x1df)](Object[_0x24fc36(0x194)](_0x8008f5)['length'],0x0)&&(_0x4ca576['setupHeaders']=_0x8008f5);let _0x4edc73;try{_0x4edc73=await _0x8cde2e[_0x24fc36(0x1c2)](createCloudProfile,_0x5b3014,undefined,{'settings':_0x4ca576}),warnCloudProfileSharedInOrg();}catch(_0x143a4c){_0x8cde2e['OYrCT'](_0x143a4c,ApiError)&&_0x8cde2e['obGeC'](_0x143a4c['status'],0x199)&&console[_0x24fc36(0x1e5)](_0x24fc36(0x198)+_0x5b3014+_0x24fc36(0x1cf)+(_0x24fc36(0x1f2)+_0x5b3014));throw _0x143a4c;}return await _0x8cde2e[_0x24fc36(0x208)](manualBrowserLogin,_0x4edc73,{'key':'','domains':[_0x1ea8d8],'setupHeaders':Object['keys'](_0x8008f5)[_0x24fc36(0x1da)]>0x0?_0x8008f5:undefined}),console['log'](_0x8cde2e['WkiOm'](_0x24fc36(0x197)+_0x5b3014+_0x24fc36(0x210),_0x24fc36(0x1db)+_0x5b3014)),await sweepOrphansBestEffort(_0x5b3014),_0x4e291e?.[_0x24fc36(0x1b8)](_0x8cde2e[_0x24fc36(0x1f8)],{'envKey':null,'profileName':_0x5b3014}),!![];}export async function addEnv(_0x2c005e,_0x4c358d={},_0x2b243a){const _0x19f3ee=_0xe765e4,_0x44689b={'cKsZe':function(_0x4010b2,_0xa48a74){return _0x4010b2+_0xa48a74;},'QmDmj':function(_0x27fac0,_0x378784){return _0x27fac0+_0x378784;},'SoPPL':_0x19f3ee(0x1a5),'BeiDB':'for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a','ijLRY':_0x19f3ee(0x19b),'YwgZY':_0x19f3ee(0x1e7),'WiymP':function(_0xd07ca4,_0x3da214){return _0xd07ca4+_0x3da214;},'oonDs':function(_0x146823,_0x108d33){return _0x146823===_0x108d33;},'PAKfS':function(_0xf2a5f){return _0xf2a5f();},'QFqMN':_0x19f3ee(0x1e2),'PKfFZ':function(_0xf61394,_0x8cd216){return _0xf61394>_0x8cd216;},'awKRp':function(_0x4fb5c2,_0x1eb444,_0x267ade){return _0x4fb5c2(_0x1eb444,_0x267ade);},'rUrvY':function(_0xa6c135,_0x201b41,_0x564a39,_0x9f15e8,_0x379afb){return _0xa6c135(_0x201b41,_0x564a39,_0x9f15e8,_0x379afb);},'RKKfQ':'cdpEndpoint','xbTUz':function(_0x3885ee,_0x5a0078){return _0x3885ee(_0x5a0078);},'VsVAV':function(_0x48b47d,_0x98cede){return _0x48b47d(_0x98cede);},'EWerB':function(_0x3bf171,_0x53fe21){return _0x3bf171>_0x53fe21;},'VVBLi':'input','kvOVv':_0x19f3ee(0x1e3),'edwSN':function(_0x26394a,_0x578827){return _0x26394a||_0x578827;},'wIscc':'http://localhost:3000','ovUsh':'What\x20would\x20you\x20like\x20to\x20do?','eHVSu':_0x19f3ee(0x1a7),'sHQwW':'Enter\x20a\x20different\x20URL','cUTVG':_0x19f3ee(0x1ab),'HhfqD':_0x19f3ee(0x1ea),'dspvg':function(_0x50ae6d,_0x4a30c1,_0x1410a3,_0x7b9fe9,_0x23fff7,_0x5e653b){return _0x50ae6d(_0x4a30c1,_0x1410a3,_0x7b9fe9,_0x23fff7,_0x5e653b);},'BhxyS':function(_0x2bb47d,_0x3d42a1){return _0x2bb47d instanceof _0x3d42a1;}};_0x4c358d['ci']&&(console['error'](_0x44689b[_0x19f3ee(0x1ff)](_0x44689b['QmDmj'](_0x44689b['SoPPL']+_0x44689b[_0x19f3ee(0x1bf)]+'\x0a',_0x44689b['ijLRY'])+_0x19f3ee(0x209)+'\x0a',_0x44689b[_0x19f3ee(0x1cc)])+_0x19f3ee(0x1ac)),process[_0x19f3ee(0x1a4)](0x1));const _0x58eb06={};if(_0x4c358d['setupHeader'])for(const _0xee112d of _0x4c358d[_0x19f3ee(0x1ad)]){const _0x21cdaf=_0xee112d['indexOf'](':');if(_0x21cdaf===-0x1)throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0xee112d+_0x19f3ee(0x1d7));const _0x285489=_0xee112d['slice'](0x0,_0x21cdaf)[_0x19f3ee(0x1fc)](),_0x4840a1=_0xee112d['slice'](_0x44689b['WiymP'](_0x21cdaf,0x1))['trim']();_0x58eb06[_0x285489]=_0x4840a1;}if(_0x4c358d[_0x19f3ee(0x1b5)]!==undefined&&_0x44689b['oonDs'](_0x4c358d['cdpEndpoint']['trim'](),''))throw new Error('--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222');if(_0x4c358d[_0x19f3ee(0x1b5)]&&_0x4c358d[_0x19f3ee(0x196)])throw new Error(_0x19f3ee(0x195));const _0x5d3bc4=Boolean(_0x4c358d['cdpEndpoint']),_0x52ebd9=_0x44689b['PAKfS'](isInteractive);if(!_0x52ebd9&&!_0x4c358d[_0x19f3ee(0x196)]&&!_0x5d3bc4&&!_0x4c358d['skipAuth'])throw new Error(_0x19f3ee(0x212));if(_0x5d3bc4){const _0x51b8cf=_0x4c358d[_0x19f3ee(0x1b5)];console['log'](_0x44689b['QFqMN']),console[_0x19f3ee(0x1ae)]('\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20'+_0x51b8cf);const _0x381a91={'cdpEndpoint':_0x51b8cf,'isElectron':!![]};_0x44689b[_0x19f3ee(0x1f6)](Object['keys'](_0x58eb06)['length'],0x0)&&(_0x381a91[_0x19f3ee(0x1ef)]=_0x58eb06);await _0x44689b[_0x19f3ee(0x1e0)](createUnconfiguredCloudProfile,_0x2c005e,_0x381a91);try{_0x44689b['rUrvY'](setProfileOverride,process[_0x19f3ee(0x1cd)](),_0x2c005e,_0x44689b['RKKfQ'],_0x51b8cf),_0x44689b[_0x19f3ee(0x1e9)](setProfileOverride,process[_0x19f3ee(0x1cd)](),_0x2c005e,'isElectron',!![]);}catch(_0x571b3e){console[_0x19f3ee(0x1e5)]('\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20'+(_0x571b3e instanceof Error?_0x571b3e[_0x19f3ee(0x1a9)]:String(_0x571b3e)));}console['log'](_0x19f3ee(0x1d2)+_0x2c005e+'\x27\x20created\x20(CDP).'),await _0x44689b['xbTUz'](sweepOrphansBestEffort,_0x2c005e),await _0x44689b[_0x19f3ee(0x1ba)](markActive,_0x2c005e);return;}if(_0x4c358d[_0x19f3ee(0x18e)]){const _0x588915={};_0x4c358d['url']&&(_0x588915[_0x19f3ee(0x1a8)]=_0x4c358d['url']);_0x44689b[_0x19f3ee(0x1fe)](Object['keys'](_0x58eb06)['length'],0x0)&&(_0x588915['setupHeaders']=_0x58eb06);await _0x44689b['awKRp'](createUnconfiguredCloudProfile,_0x2c005e,_0x588915),console['log']('✓\x20Profile\x20\x27'+_0x2c005e+_0x19f3ee(0x1af)+('\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20'+_0x2c005e+'`\x20again\x20without\x20--skip-auth.')),await _0x44689b[_0x19f3ee(0x1e1)](sweepOrphansBestEffort,_0x2c005e),await markActive(_0x2c005e);return;}if(_0x4c358d[_0x19f3ee(0x196)]){const _0xc457ae=_0x4c358d[_0x19f3ee(0x196)],_0x23c481=await _0x44689b['VsVAV'](checkUrlReachability,_0xc457ae);if(!_0x23c481['ok']&&!_0x4c358d['force'])throw new Error(_0x19f3ee(0x1a6)+_0xc457ae+':\x20'+_0x23c481[_0x19f3ee(0x1e5)]+_0x19f3ee(0x1f4));!_0x23c481['ok']&&_0x4c358d[_0x19f3ee(0x192)]&&console[_0x19f3ee(0x1ae)](_0x19f3ee(0x1d8)+_0xc457ae+':\x20'+_0x23c481['error']+_0x19f3ee(0x1c4));}else{console[_0x19f3ee(0x1ae)](_0x19f3ee(0x1ce)),console[_0x19f3ee(0x1ae)]('\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.'),console[_0x19f3ee(0x1ae)](_0x19f3ee(0x1f7));let _0x6bb0cb='',_0x1b6d02=![];while(!![]){const _0xd0bc2=await _0x46318a[_0x19f3ee(0x200)]([{'type':_0x44689b[_0x19f3ee(0x20a)],'name':_0x19f3ee(0x1a8),'message':_0x1b6d02?'Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):':_0x44689b[_0x19f3ee(0x201)],'default':_0x44689b[_0x19f3ee(0x1bc)](_0x6bb0cb,_0x44689b[_0x19f3ee(0x202)])}]);_0x6bb0cb=_0xd0bc2['baseUrl'];const _0x12e803=await checkUrlReachability(_0x6bb0cb);if(_0x12e803['ok'])break;const _0xe4ec11=/^[a-zA-Z][\w+.-]*:\/\//['test'](_0x6bb0cb),_0x584a5e=_0x12e803['isProtocolError']&&!_0xe4ec11,_0x50e9fc=_0x584a5e?'http://'+_0x6bb0cb:null;_0x1b6d02=!![],console['log']('\x0a\x20\x20Could\x20not\x20reach\x20'+_0x6bb0cb+':\x20'+_0x12e803[_0x19f3ee(0x1e5)]);_0x50e9fc&&console[_0x19f3ee(0x1ae)]('\x20\x20Did\x20you\x20mean\x20'+_0x50e9fc+'?');const {action:_0x28589a}=await _0x46318a[_0x19f3ee(0x200)]([{'type':'list','name':'action','message':_0x44689b[_0x19f3ee(0x20d)],'choices':[..._0x50e9fc?[{'name':_0x19f3ee(0x18d)+_0x50e9fc,'value':_0x44689b['eHVSu']}]:[],{'name':_0x44689b['sHQwW'],'value':'retry'},{'name':_0x44689b['cUTVG'],'value':_0x44689b[_0x19f3ee(0x1c5)]}]}]);if(_0x28589a===_0x44689b[_0x19f3ee(0x1c3)]&&_0x50e9fc){_0x6bb0cb=_0x50e9fc;const _0x144acb=await _0x44689b[_0x19f3ee(0x1ba)](checkUrlReachability,_0x6bb0cb);if(_0x144acb['ok'])break;console[_0x19f3ee(0x1ae)]('\x0a\x20\x20Still\x20could\x20not\x20reach\x20'+_0x6bb0cb+':\x20'+_0x144acb['error']);}else{if(_0x28589a===_0x19f3ee(0x1ea))break;}}_0x4c358d={..._0x4c358d,'url':_0x6bb0cb};}let _0xbf3e57=![];try{_0xbf3e57=await _0x44689b[_0x19f3ee(0x1e6)](tryAutoRouteCloudProfile,_0x2c005e,_0x4c358d['url'],_0x4c358d,_0x52ebd9,_0x2b243a);}catch(_0x5e4e6c){console['error']('\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22'+_0x2c005e+'\x22:\x20'+(_0x44689b['BhxyS'](_0x5e4e6c,Error)?_0x5e4e6c[_0x19f3ee(0x1a9)]:String(_0x5e4e6c))),process['exit'](0x1);}!_0xbf3e57&&process['exit'](0x1),await markActive(_0x2c005e);}
|
|
1
|
+
function _0x2039(){const _0x16a4fa=['list','kITMq','\x27\x20created\x20(no\x20session).\x0a','dhYar','retry','environments','length','startsWith','setupHeaders','profile.add.autoRouted','NUANO','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','\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','LhmXK','eoAHL','NODE_TLS_REJECT_UNAUTHORIZED','tEFHF','cdpEndpoint','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a','TSLfc','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','kMpQz','CHOZr','What\x20would\x20you\x20like\x20to\x20do?','Syftg','lNUzK','2724575YgGDmS','\x0a\x20\x20(domains:\x20','\x20--skip-auth\x0a','Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.','CktQu','2772080dtxoTH','RgzGI','\x0a\x20\x20No\x20auth\x20env\x20matches\x20','\x27\x20created.\x0a','4656216ixLZbl','RYTPs','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.','7843608fpHPvk','knQLP','error','confirm','log','\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','indexOf','fOmfz','\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.','udcIp','IpGGw','join','includes','isTTY','capture','slice','domains','YYZZS','BjsFA','gZxho','uIdKY','\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a','ogQOY','Continue\x20anyway','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','7OLmfqd','eyqYx','name','`\x20again\x20without\x20--skip-auth.','trackPhaseEnd','ycUIr','nuoMh','\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20','BAKXD','message','Enter\x20a\x20different\x20URL','Could\x20not\x20reach\x20','\x20\x20Next:\x20ranger\x20go\x20--profile\x20','env','ovvlZ','GVIid','fetch\x20failed','\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a','prompt','yRbds','\x0a\x20\x20Still\x20could\x20not\x20reach\x20','cwd','--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','GZKVP','1132944YCRfod','status','yyTrO','\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.','bnZaR','\x0a\x20\x20A\x20profile\x20named\x20\x22','signal','\x0a🌐\x20Profile\x20Setup\x0a','url','stdout','Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','baseUrl','\x20--url\x20','1180998rKGbxl','\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','test','rVtpA','manual','\x20\x20Set\x20active\x20profile:\x20','\x27\x20to\x20the\x20cloud?','\x20(continuing\x20with\x20--force)','678897NiGOAQ','VURfN','keys','use_suggestion','action','continue','HEAD','.\x20Configured\x20envs:\x20','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20','exit','gFVed','skipAuth','6KvIcSs','bcuDB','setupHeader','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','To\x20set\x20up\x20a\x20profile,\x20run:\x0a'];_0x2039=function(){return _0x16a4fa;};return _0x2039();}(function(_0x126a57,_0x5e2f22){const _0x3f7bf3=_0x41c2,_0x3607f8=_0x126a57();while(!![]){try{const _0x18b904=parseInt(_0x3f7bf3(0xe0))/0x1+-parseInt(_0x3f7bf3(0xcb))/0x2+parseInt(_0x3f7bf3(0xd8))/0x3+parseInt(_0x3f7bf3(0x112))/0x4+-parseInt(_0x3f7bf3(0x10d))/0x5*(parseInt(_0x3f7bf3(0xed))/0x6)+-parseInt(_0x3f7bf3(0xb3))/0x7*(-parseInt(_0x3f7bf3(0x116))/0x8)+-parseInt(_0x3f7bf3(0x119))/0x9;if(_0x18b904===_0x5e2f22)break;else _0x3607f8['push'](_0x3607f8['shift']());}catch(_0x4450e2){_0x3607f8['push'](_0x3607f8['shift']());}}}(_0x2039,0x590a7));import{readdir,rm}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x41c2(_0x1d7877,_0x491db5){_0x1d7877=_0x1d7877-0x9e;const _0x203993=_0x2039();let _0x41c2c1=_0x203993[_0x1d7877];return _0x41c2c1;}import _0x5eb420 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 _0x475300=_0x41c2;if(!process[_0x475300(0xd4)][_0x475300(0xa7)])return;console['warn'](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x3a4816){const _0x37b5cc=_0x41c2,_0x2d620d={'LhmXK':function(_0x20436b,_0x143b58,_0x2e1137){return _0x20436b(_0x143b58,_0x2e1137);},'tEFHF':_0x37b5cc(0xe6),'wSKRN':'Invalid\x20URL','CHOZr':function(_0x115f1e,_0x53cb97){return _0x115f1e===_0x53cb97;},'gZxho':'TypeError','ovvlZ':_0x37b5cc(0xc3)};try{const _0x4ad933=new AbortController(),_0x1264df=_0x2d620d[_0x37b5cc(0xff)](setTimeout,()=>_0x4ad933['abort'](),0x1388),_0x264a07={'method':_0x2d620d[_0x37b5cc(0x102)],'signal':_0x4ad933[_0x37b5cc(0xd1)],'redirect':_0x37b5cc(0xdc)};/^https:\/\/localhost(:\d+)?/i['test'](_0x3a4816)&&(process[_0x37b5cc(0xc0)][_0x37b5cc(0x101)]='0');const _0x33b50a=await fetch(_0x3a4816,_0x264a07);delete process[_0x37b5cc(0xc0)]['NODE_TLS_REJECT_UNAUTHORIZED'],clearTimeout(_0x1264df);if(_0x33b50a[_0x37b5cc(0xcc)]<0x190)return{'ok':!![]};return{'ok':![],'error':'HTTP\x20'+_0x33b50a['status']};}catch(_0x58ee59){delete process['env'][_0x37b5cc(0x101)];const _0x4c1638=_0x58ee59,_0x5b16fc=_0x4c1638[_0x37b5cc(0xbc)]||String(_0x58ee59),_0x5e7163=_0x5b16fc['includes'](_0x2d620d['wSKRN'])||_0x2d620d[_0x37b5cc(0x109)](_0x4c1638[_0x37b5cc(0xb5)],_0x2d620d[_0x37b5cc(0xad)])||_0x5b16fc[_0x37b5cc(0xa6)](_0x2d620d[_0x37b5cc(0xc1)]);return{'ok':![],'error':_0x5b16fc,'isProtocolError':_0x5e7163};}}async function sweepOrphanLocalProfile(_0x2344f9,_0x52fc81,_0x87f39b){const _0x3535d2=_0x41c2,_0x139d6e={'kITMq':function(_0x3d08c0,_0xe69f83,_0x1e1468){return _0x3d08c0(_0xe69f83,_0x1e1468);},'eyqYx':function(_0x3a730a,_0x3f1072,_0x1a5d2e){return _0x3a730a(_0x3f1072,_0x1a5d2e);},'nuoMh':function(_0x146124,_0x2337ad){return _0x146124(_0x2337ad);},'yRbds':function(_0x38bd42,_0x1169e5,_0x505dd0){return _0x38bd42(_0x1169e5,_0x505dd0);}},_0x4d4aaf=_0x139d6e[_0x3535d2(0xf3)](join,_0x52fc81,'local'),_0x5565d6=_0x139d6e[_0x3535d2(0xb4)](join,_0x4d4aaf,_0x2344f9);_0x139d6e[_0x3535d2(0xb9)](existsSync,_0x5565d6)&&(_0x87f39b&&await _0x139d6e[_0x3535d2(0xb9)](isPathGitTracked,_0x5565d6)?console[_0x3535d2(0x9e)](_0x3535d2(0xba)+_0x5565d6+_0x3535d2(0x118)):(await rm(_0x5565d6,{'recursive':!![],'force':!![]}),console['log'](_0x3535d2(0x104)+_0x5565d6)));if(_0x139d6e['nuoMh'](existsSync,_0x4d4aaf)){let _0xfb97b8=[];try{_0xfb97b8=await _0x139d6e[_0x3535d2(0xb9)](readdir,_0x4d4aaf);}catch{return;}const _0x4609ff='.tmp-'+_0x2344f9+'-';for(const _0x33ebb1 of _0xfb97b8){if(!_0x33ebb1[_0x3535d2(0xf9)](_0x4609ff))continue;const _0x3158fd=_0x139d6e['yRbds'](join,_0x4d4aaf,_0x33ebb1);await _0x139d6e[_0x3535d2(0xc6)](rm,_0x3158fd,{'recursive':!![],'force':!![]}),console[_0x3535d2(0x9e)](_0x3535d2(0x104)+_0x3158fd);}}}async function sweepOrphansBestEffort(_0x30f7c1){const _0x5c0e50=_0x41c2,_0x213e0d={'RgzGI':function(_0x8f8e2){return _0x8f8e2();}};try{await sweepOrphanLocalProfile(_0x30f7c1,getRangerHomeDir(),![]);const _0x3a0de4=getRangerDir();_0x3a0de4!==_0x213e0d[_0x5c0e50(0x113)](getRangerHomeDir)&&await sweepOrphanLocalProfile(_0x30f7c1,_0x3a0de4,!![]);}catch(_0x52d433){console['log'](_0x5c0e50(0xd9)+(_0x52d433 instanceof Error?_0x52d433['message']:String(_0x52d433))+').');}}async function markActive(_0x5858e6){const _0x2d6dbd=_0x41c2,_0xd2c9fa={'yZUre':function(_0x94bab8,_0xe6c78d){return _0x94bab8(_0xe6c78d);},'bRsXG':_0x2d6dbd(0x110)};try{await _0xd2c9fa['yZUre'](writeActiveProfileName,_0x5858e6),console['log'](_0x2d6dbd(0xdd)+_0x5858e6);}catch{console['log'](_0xd2c9fa['bRsXG']);}}async function tryAutoRouteCloudProfile(_0x3e611a,_0x4c4786,_0x2ceac2,_0x4e5553,_0x406845){const _0x3c094c=_0x41c2,_0x152008={'rVtpA':function(_0x4490b0,_0x342187){return _0x4490b0===_0x342187;},'RVPAs':'profile.add.autoRouteSkipped','YYZZS':'no_auth_config','VURfN':function(_0x22af16,_0x4e4817){return _0x22af16(_0x4e4817);},'cuuuM':function(_0x402bac,_0xf8192b){return _0x402bac+_0xf8192b;},'gYjhx':function(_0x5d2a29,_0x546fcf){return _0x5d2a29+_0x546fcf;},'GVIid':_0x3c094c(0xfe),'cUuev':_0x3c094c(0xaf),'xlgQR':function(_0x459920,_0x19397f,_0x721211){return _0x459920(_0x19397f,_0x721211);},'uCVOA':'saveToCloud','NUANO':'user_declined','ubNJU':'\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','Syftg':function(_0x59128b,_0xa10a9d,_0x7043e7,_0x4a55b2){return _0x59128b(_0xa10a9d,_0x7043e7,_0x4a55b2);},'ycUIr':_0x3c094c(0xfb)};let _0x29c1a2;try{_0x29c1a2=await fetchAuthConfig();}catch(_0x287e35){return _0x406845?.[_0x3c094c(0xb7)](_0x152008['RVPAs'],{'reason':_0x152008[_0x3c094c(0xab)],'profileName':_0x3e611a}),console[_0x3c094c(0x11b)]('\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20'+(_0x287e35 instanceof Error?_0x287e35[_0x3c094c(0xbc)]:_0x152008[_0x3c094c(0xe1)](String,_0x287e35))),![];}if(!_0x29c1a2||!_0x29c1a2[_0x3c094c(0xf7)]||Object['keys'](_0x29c1a2[_0x3c094c(0xf7)])['length']===0x0){if(_0x4e5553)return await captureEnvLessProfile(_0x3e611a,_0x4c4786,_0x2ceac2,_0x406845);return _0x406845?.['trackPhaseEnd'](_0x152008['RVPAs'],{'reason':_0x152008[_0x3c094c(0xab)],'profileName':_0x3e611a}),console[_0x3c094c(0x11b)](_0x152008['cuuuM'](_0x152008['cuuuM'](_0x152008['gYjhx'](_0x152008[_0x3c094c(0xc2)]+'\x0a'+_0x152008['cUuev'],'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20'+_0x3e611a+_0x3c094c(0xd7)+_0x4c4786+_0x3c094c(0x10f))+'\x0a',_0x3c094c(0x105)),'\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login')),![];}const _0x5cccad=_0x152008['xlgQR'](matchAuthEnvironment,_0x4c4786,_0x29c1a2);if(!_0x5cccad)return _0x406845?.[_0x3c094c(0xb7)]('profile.add.autoRouteSkipped',{'reason':'no_match','profileName':_0x3e611a}),console['error'](_0x3c094c(0x114)+_0x4c4786+_0x3c094c(0xe7)+Object[_0x3c094c(0xe2)](_0x29c1a2[_0x3c094c(0xf7)])[_0x3c094c(0xa5)](',\x20')+'.'),![];const _0x462a40=_0x29c1a2[_0x3c094c(0xf7)][_0x5cccad],_0x15158c=_0x462a40?.[_0x3c094c(0xaa)]??[];if(_0x4e5553&&!_0x2ceac2['yes']){const {saveToCloud:_0x2cfe15}=await _0x5eb420['prompt']([{'type':_0x3c094c(0x11c),'name':_0x152008['uCVOA'],'message':'Found\x20auth\x20environment\x20\x27'+_0x5cccad+'\x27\x20matching\x20'+_0x4c4786+_0x3c094c(0x10e)+_0x15158c['join'](',\x20')+')\x0a\x20\x20Save\x20\x27'+_0x3e611a+_0x3c094c(0xde),'default':!![]}]);if(!_0x2cfe15)return _0x406845?.['trackPhaseEnd'](_0x152008['RVPAs'],{'reason':_0x152008[_0x3c094c(0xfc)],'profileName':_0x3e611a}),console[_0x3c094c(0x11b)](_0x152008['ubNJU']),![];}const _0x51f890=_0x15158c['some'](_0x442af3=>{const _0x5d1bad=_0x3c094c;try{return _0x152008[_0x5d1bad(0xdb)](new URL(_0x442af3)['origin'],new URL(_0x4c4786)['origin']);}catch{return![];}}),_0x389658={};!_0x51f890&&(_0x389658[_0x3c094c(0xd6)]=_0x4c4786);try{await _0x152008[_0x3c094c(0x10b)](createCloudProfile,_0x3e611a,_0x5cccad,{'settings':_0x389658}),warnCloudProfileSharedInOrg();}catch(_0x82d916){if(_0x82d916 instanceof ApiError&&_0x82d916[_0x3c094c(0xcc)]===0x199){console['error'](_0x152008['gYjhx'](_0x3c094c(0xd0)+_0x3e611a+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a',_0x3c094c(0x107)+_0x3e611a));throw _0x82d916;}throw _0x82d916;}return console[_0x3c094c(0x9e)]('✓\x20Profile\x20\x27'+_0x3e611a+_0x3c094c(0x115)+(_0x3c094c(0xbf)+_0x3e611a)),await sweepOrphansBestEffort(_0x3e611a),_0x406845?.['trackPhaseEnd'](_0x152008[_0x3c094c(0xb8)],{'envKey':_0x5cccad,'profileName':_0x3e611a}),!![];}async function createUnconfiguredCloudProfile(_0x2a6e41,_0x3f06a8){const _0x323a4c=_0x41c2,_0x55c9c3={'kYrew':function(_0x170503,_0x366237,_0x479f2d,_0x4b5a98){return _0x170503(_0x366237,_0x479f2d,_0x4b5a98);}};try{await _0x55c9c3['kYrew'](createCloudProfile,_0x2a6e41,undefined,{'settings':_0x3f06a8}),warnCloudProfileSharedInOrg();}catch(_0x251a41){_0x251a41 instanceof ApiError&&_0x251a41[_0x323a4c(0xcc)]===0x199&&console[_0x323a4c(0x11b)]('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x2a6e41+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a'+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x2a6e41));throw _0x251a41;}}async function captureEnvLessProfile(_0x4baf6d,_0x42cde5,_0x4cbeeb,_0x2171b4){const _0x3145c0=_0x41c2,_0x56985d={'kMpQz':_0x3145c0(0x11c),'FTXtP':_0x3145c0(0xd5),'pBTlt':'profile.add.autoRouteSkipped','PcAWx':function(_0x5cec01,_0x48a5a5){return _0x5cec01+_0x48a5a5;},'TSLfc':function(_0x4fec05,_0x4b3d5c){return _0x4fec05===_0x4b3d5c;},'udcIp':function(_0x17d052,_0x2aad13){return _0x17d052>_0x2aad13;},'OqJlX':function(_0x325256,_0x434aef,_0x47c96e,_0x100ad6){return _0x325256(_0x434aef,_0x47c96e,_0x100ad6);},'dhYar':function(_0xd3f84c){return _0xd3f84c();},'Torlf':function(_0x31de24,_0x55e7e7){return _0x31de24 instanceof _0x55e7e7;},'rVdul':function(_0x5c21b2,_0x54882f){return _0x5c21b2+_0x54882f;}};if(!_0x4cbeeb['yes']){const {capture:_0x539589}=await _0x5eb420['prompt']([{'type':_0x56985d[_0x3145c0(0x108)],'name':_0x3145c0(0xa8),'message':_0x56985d['FTXtP'],'default':!![]}]);if(!_0x539589)return _0x2171b4?.[_0x3145c0(0xb7)](_0x56985d['pBTlt'],{'reason':'user_declined','profileName':_0x4baf6d}),console['error'](_0x56985d['PcAWx']('\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a',_0x3145c0(0xce))),![];}const _0x30e4d7={};if(_0x4cbeeb[_0x3145c0(0xef)])for(const _0x480220 of _0x4cbeeb['setupHeader']){const _0x3af1a2=_0x480220[_0x3145c0(0xa0)](':');if(_0x56985d[_0x3145c0(0x106)](_0x3af1a2,-0x1))continue;_0x30e4d7[_0x480220['slice'](0x0,_0x3af1a2)['trim']()]=_0x480220[_0x3145c0(0xa9)](_0x56985d['PcAWx'](_0x3af1a2,0x1))['trim']();}const _0x2174e6={'baseUrl':_0x42cde5};_0x56985d[_0x3145c0(0xa3)](Object[_0x3145c0(0xe2)](_0x30e4d7)[_0x3145c0(0xf8)],0x0)&&(_0x2174e6['setupHeaders']=_0x30e4d7);let _0x4899b3;try{_0x4899b3=await _0x56985d['OqJlX'](createCloudProfile,_0x4baf6d,undefined,{'settings':_0x2174e6}),_0x56985d[_0x3145c0(0xf5)](warnCloudProfileSharedInOrg);}catch(_0x26895){_0x56985d['Torlf'](_0x26895,ApiError)&&_0x26895['status']===0x199&&console['error'](_0x3145c0(0xd0)+_0x4baf6d+_0x3145c0(0xfd)+('\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x4baf6d));throw _0x26895;}return await manualBrowserLogin(_0x4899b3,{'key':'','domains':[_0x42cde5],'setupHeaders':Object['keys'](_0x30e4d7)[_0x3145c0(0xf8)]>0x0?_0x30e4d7:undefined}),console[_0x3145c0(0x9e)](_0x56985d['rVdul']('\x0a✓\x20Profile\x20\x27'+_0x4baf6d+'\x27\x20created\x20with\x20a\x20captured\x20session.\x0a','\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x4baf6d)),await sweepOrphansBestEffort(_0x4baf6d),_0x2171b4?.['trackPhaseEnd']('profile.add.autoRouted',{'envKey':null,'profileName':_0x4baf6d}),!![];}export async function addEnv(_0x206be3,_0x33c23f={},_0x56d170){const _0x52773c=_0x41c2,_0x45798d={'ogQOY':function(_0xef8486,_0x14cbfe){return _0xef8486+_0x14cbfe;},'BjsFA':function(_0x2b7757,_0x40aa16){return _0x2b7757+_0x40aa16;},'KSBeX':'The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a','fOmfz':'for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a','BwDbs':_0x52773c(0xf1),'gFVed':_0x52773c(0xb2),'BAKXD':'\x20\x20https://docs.ranger.net/main/concepts/profiles','GZKVP':function(_0x292775,_0x4fc343){return _0x292775===_0x4fc343;},'nhziL':'--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','SFMIo':'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','lPTkk':function(_0x5d8f43,_0x41f9e5){return _0x5d8f43>_0x41f9e5;},'CktQu':function(_0x8f1e74,_0x3f16ca,_0x1e9ca0){return _0x8f1e74(_0x3f16ca,_0x1e9ca0);},'bcuDB':function(_0x69678,_0x3aaf16){return _0x69678 instanceof _0x3aaf16;},'IpGGw':function(_0x581f5c,_0xab920a){return _0x581f5c(_0xab920a);},'eoAHL':function(_0x4d8d88,_0x2f0b8c){return _0x4d8d88(_0x2f0b8c);},'lJYkq':function(_0x2e0416,_0x4c1d95){return _0x2e0416>_0x4c1d95;},'RseHq':function(_0x8222e6,_0x82ea0){return _0x8222e6+_0x82ea0;},'yyTrO':_0x52773c(0xc4),'knQLP':'input','oyyPO':function(_0x375283,_0xdda4fe){return _0x375283(_0xdda4fe);},'lSSof':_0x52773c(0xe4),'bnZaR':_0x52773c(0x10a),'gikqW':_0x52773c(0xf6),'oLBnR':_0x52773c(0xb1),'uIdKY':_0x52773c(0xe5),'RYTPs':function(_0x2c95ac,_0xfc2df4){return _0x2c95ac===_0xfc2df4;},'oDvwW':function(_0x12d460,_0xf9027f,_0x1a9316,_0x1200a4,_0x37d19e,_0x4f4dd5){return _0x12d460(_0xf9027f,_0x1a9316,_0x1200a4,_0x37d19e,_0x4f4dd5);},'lNUzK':function(_0x322a86,_0x4f0d63){return _0x322a86(_0x4f0d63);}};_0x33c23f['ci']&&(console[_0x52773c(0x11b)](_0x45798d[_0x52773c(0xb0)](_0x45798d['ogQOY'](_0x45798d[_0x52773c(0xac)](_0x45798d['KSBeX']+_0x45798d[_0x52773c(0xa1)]+'\x0a',_0x45798d['BwDbs'])+_0x45798d[_0x52773c(0xeb)]+'\x0a','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a'),_0x45798d[_0x52773c(0xbb)])),process[_0x52773c(0xea)](0x1));const _0x39c1e7={};if(_0x33c23f['setupHeader'])for(const _0x2cb8fb of _0x33c23f[_0x52773c(0xef)]){const _0x2086d0=_0x2cb8fb['indexOf'](':');if(_0x45798d[_0x52773c(0xca)](_0x2086d0,-0x1))throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0x2cb8fb+'\x22.\x20Expected\x20\x22Name:\x20Value\x22.');const _0x37e536=_0x2cb8fb['slice'](0x0,_0x2086d0)['trim'](),_0xf93833=_0x2cb8fb['slice'](_0x45798d['ogQOY'](_0x2086d0,0x1))['trim']();_0x39c1e7[_0x37e536]=_0xf93833;}if(_0x33c23f['cdpEndpoint']!==undefined&&_0x33c23f[_0x52773c(0x103)]['trim']()==='')throw new Error(_0x52773c(0xc9));if(_0x33c23f['cdpEndpoint']&&_0x33c23f['url'])throw new Error(_0x45798d['nhziL']);const _0x15f0bb=Boolean(_0x33c23f['cdpEndpoint']),_0x5a2692=isInteractive();if(!_0x5a2692&&!_0x33c23f[_0x52773c(0xd3)]&&!_0x15f0bb&&!_0x33c23f[_0x52773c(0xec)])throw new Error(_0x45798d['SFMIo']);if(_0x15f0bb){const _0x4950b8=_0x33c23f[_0x52773c(0x103)];console[_0x52773c(0x9e)](_0x52773c(0x9f)),console['log']('\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20'+_0x4950b8);const _0x164ef4={'cdpEndpoint':_0x4950b8,'isElectron':!![]};_0x45798d['lPTkk'](Object[_0x52773c(0xe2)](_0x39c1e7)[_0x52773c(0xf8)],0x0)&&(_0x164ef4[_0x52773c(0xfa)]=_0x39c1e7);await _0x45798d[_0x52773c(0x111)](createUnconfiguredCloudProfile,_0x206be3,_0x164ef4);try{setProfileOverride(process['cwd'](),_0x206be3,'cdpEndpoint',_0x4950b8),setProfileOverride(process[_0x52773c(0xc8)](),_0x206be3,'isElectron',!![]);}catch(_0xad2252){console[_0x52773c(0x11b)]('\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20'+(_0x45798d['bcuDB'](_0xad2252,Error)?_0xad2252['message']:_0x45798d['IpGGw'](String,_0xad2252)));}console['log']('✓\x20Cloud\x20profile\x20\x27'+_0x206be3+'\x27\x20created\x20(CDP).'),await _0x45798d[_0x52773c(0x100)](sweepOrphansBestEffort,_0x206be3),await _0x45798d[_0x52773c(0xa4)](markActive,_0x206be3);return;}if(_0x33c23f['skipAuth']){const _0x1cde6e={};_0x33c23f['url']&&(_0x1cde6e['baseUrl']=_0x33c23f[_0x52773c(0xd3)]);_0x45798d['lJYkq'](Object['keys'](_0x39c1e7)['length'],0x0)&&(_0x1cde6e[_0x52773c(0xfa)]=_0x39c1e7);await createUnconfiguredCloudProfile(_0x206be3,_0x1cde6e),console[_0x52773c(0x9e)](_0x45798d['RseHq']('✓\x20Profile\x20\x27'+_0x206be3+_0x52773c(0xf4),_0x52773c(0xe9)+_0x206be3+_0x52773c(0xb6))),await sweepOrphansBestEffort(_0x206be3),await markActive(_0x206be3);return;}if(_0x33c23f[_0x52773c(0xd3)]){const _0x363eb2=_0x33c23f['url'],_0x4845f1=await checkUrlReachability(_0x363eb2);if(!_0x4845f1['ok']&&!_0x33c23f['force'])throw new Error(_0x52773c(0xbe)+_0x363eb2+':\x20'+_0x4845f1[_0x52773c(0x11b)]+_0x52773c(0xa2));!_0x4845f1['ok']&&_0x33c23f['force']&&console['log']('⚠\x20Could\x20not\x20reach\x20'+_0x363eb2+':\x20'+_0x4845f1[_0x52773c(0x11b)]+_0x52773c(0xdf));}else{console['log'](_0x52773c(0xd2)),console[_0x52773c(0x9e)](_0x52773c(0xe8)),console[_0x52773c(0x9e)](_0x45798d[_0x52773c(0xcd)]);let _0x1aafba='',_0x5574f8=![];while(!![]){const _0x34d63b=await _0x5eb420['prompt']([{'type':_0x45798d[_0x52773c(0x11a)],'name':_0x52773c(0xd6),'message':_0x5574f8?'Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):':_0x52773c(0xf0),'default':_0x1aafba||'http://localhost:3000'}]);_0x1aafba=_0x34d63b['baseUrl'];const _0xcd4014=await _0x45798d['oyyPO'](checkUrlReachability,_0x1aafba);if(_0xcd4014['ok'])break;const _0x15348b=/^[a-zA-Z][\w+.-]*:\/\//[_0x52773c(0xda)](_0x1aafba),_0x135e72=_0xcd4014['isProtocolError']&&!_0x15348b,_0x1ec49b=_0x135e72?'http://'+_0x1aafba:null;_0x5574f8=!![],console[_0x52773c(0x9e)]('\x0a\x20\x20Could\x20not\x20reach\x20'+_0x1aafba+':\x20'+_0xcd4014['error']);_0x1ec49b&&console['log']('\x20\x20Did\x20you\x20mean\x20'+_0x1ec49b+'?');const {action:_0x4b4677}=await _0x5eb420[_0x52773c(0xc5)]([{'type':_0x52773c(0xf2),'name':_0x45798d['lSSof'],'message':_0x45798d[_0x52773c(0xcf)],'choices':[..._0x1ec49b?[{'name':'Use\x20'+_0x1ec49b,'value':_0x52773c(0xe3)}]:[],{'name':_0x52773c(0xbd),'value':_0x45798d['gikqW']},{'name':_0x45798d['oLBnR'],'value':_0x45798d[_0x52773c(0xae)]}]}]);if(_0x45798d[_0x52773c(0x117)](_0x4b4677,'use_suggestion')&&_0x1ec49b){_0x1aafba=_0x1ec49b;const _0x9ae17e=await _0x45798d[_0x52773c(0xa4)](checkUrlReachability,_0x1aafba);if(_0x9ae17e['ok'])break;console['log'](_0x52773c(0xc7)+_0x1aafba+':\x20'+_0x9ae17e['error']);}else{if(_0x4b4677==='continue')break;}}_0x33c23f={..._0x33c23f,'url':_0x1aafba};}let _0x5e89e1=![];try{_0x5e89e1=await _0x45798d['oDvwW'](tryAutoRouteCloudProfile,_0x206be3,_0x33c23f[_0x52773c(0xd3)],_0x33c23f,_0x5a2692,_0x56d170);}catch(_0x255b0a){console[_0x52773c(0x11b)]('\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22'+_0x206be3+'\x22:\x20'+(_0x45798d[_0x52773c(0xee)](_0x255b0a,Error)?_0x255b0a['message']:String(_0x255b0a))),process[_0x52773c(0xea)](0x1);}!_0x5e89e1&&process['exit'](0x1),await _0x45798d[_0x52773c(0x10c)](markActive,_0x206be3);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x36d827,_0x4e7b3e){var _0x3d07e1=_0x4a99,_0x5708ce=_0x36d827();while(!![]){try{var _0x5287a3=parseInt(_0x3d07e1(0x1f8))/0x1+parseInt(_0x3d07e1(0x1f3))/0x2+-parseInt(_0x3d07e1(0x1fc))/0x3*(-parseInt(_0x3d07e1(0x1f2))/0x4)+parseInt(_0x3d07e1(0x1fb))/0x5*(parseInt(_0x3d07e1(0x1f7))/0x6)+parseInt(_0x3d07e1(0x1ff))/0x7+-parseInt(_0x3d07e1(0x1fe))/0x8+-parseInt(_0x3d07e1(0x200))/0x9;if(_0x5287a3===_0x4e7b3e)break;else _0x5708ce['push'](_0x5708ce['shift']());}catch(_0x255953){_0x5708ce['push'](_0x5708ce['shift']());}}}(_0x4535,0xcc8f8));function _0x4a99(_0x38ea45,_0x576fed){_0x38ea45=_0x38ea45-0x1f2;var _0x453556=_0x4535();var _0x4a99f3=_0x453556[_0x38ea45];return _0x4a99f3;}function _0x4535(){var _0x549100=['12336872kzRETn','9209606fSSzPU','34473483IFidIL','5580784aPfwaB','3041576BOzkeH','BEGaW','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','ranger\x20profile\x20encrypt-auth\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x0a','12WPUKel','859006mMPQJs','dlbrw','error','2799320shjeuD','3RxinsH','exit'];_0x4535=function(){return _0x549100;};return _0x4535();}export async function authEncrypt(_0x128f83){var _0x4430c3=_0x4a99,_0x373347={'KCjYf':function(_0x1426f5,_0x1890e8){return _0x1426f5+_0x1890e8;},'dlbrw':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','BEGaW':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','GKzdP':_0x4430c3(0x1f5)};console[_0x4430c3(0x1fa)](_0x373347['KCjYf'](_0x373347['KCjYf'](_0x4430c3(0x1f6),'session\x20state\x20for\x20you,\x20so\x20encrypted\x20on-disk\x20auth\x20is\x20unnecessary.\x0a')+'\x0a'+_0x373347[_0x4430c3(0x1f9)]+_0x373347[_0x4430c3(0x1f4)]+'\x0a'+_0x373347['GKzdP'],'\x20\x20https://docs.ranger.net/main/concepts/profiles')),process[_0x4430c3(0x1fd)](0x1);}
|
package/build/commands/clean.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x44a6(){const _0x804e33=['EISMa','user','AcnMC','length','jcGhE','close','MQiDw','stringify','✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)','uninstall','99196VrMVFN','win32','log','3APWuuR','✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)','\x0a✅\x20Cleanup\x20complete!\x0a','--scope','filter','hCUKf','NsCUq','woZgY','marketplace','9KYCCgY','QDGfd','✓\x20Removed\x20trailhead\x20marketplace','OWBGV','HOOvg','wePwh','GtybN','Retjq','magxf','ScDXz','MUpEp','RTbxQ','3200020NPJwCs','@ranger-testing/opencode-plugin','697434DmPloq','474280lfXUdP','VCmvL','trailhead','iwiJz','VKrCl','ignore','VYrAj','668636JfIdVt','LpPzx','785766VeGejP','noQZu','1324872EngIXH','7ybGUEj','replace','\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','remove','RglzS','✓\x20Removed\x20user\x20skill:\x20','project','ZNqlo','plugin','wnRyw'];_0x44a6=function(){return _0x804e33;};return _0x44a6();}const _0x3094c7=_0x1dd7;(function(_0xe50e34,_0x2b1888){const _0x22d7df=_0x1dd7,_0x558a87=_0xe50e34();while(!![]){try{const _0x1a0a5f=-parseInt(_0x22d7df(0x1dd))/0x1+parseInt(_0x22d7df(0x1f7))/0x2+parseInt(_0x22d7df(0x1e0))/0x3*(parseInt(_0x22d7df(0x1ff))/0x4)+-parseInt(_0x22d7df(0x1f8))/0x5+parseInt(_0x22d7df(0x1c6))/0x6*(parseInt(_0x22d7df(0x1c9))/0x7)+-parseInt(_0x22d7df(0x1c8))/0x8*(-parseInt(_0x22d7df(0x1e9))/0x9)+-parseInt(_0x22d7df(0x1f5))/0xa;if(_0x1a0a5f===_0x2b1888)break;else _0x558a87['push'](_0x558a87['shift']());}catch(_0x48117e){_0x558a87['push'](_0x558a87['shift']());}}}(_0x44a6,0x48d98));import{rm,readFile,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{spawn}from'child_process';function _0x1dd7(_0x1ff149,_0x5b9a24){_0x1ff149=_0x1ff149-0x1c5;const _0x44a604=_0x44a6();let _0x1dd723=_0x44a604[_0x1ff149];return _0x1dd723;}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=_0x3094c7(0x1f6);function parseJsonc(_0x1b4294){const _0x485910=_0x3094c7,_0x212b91=_0x1b4294['replace'](/\/\*[\s\S]*?\*\//g,''),_0x3ac7f5=_0x212b91[_0x485910(0x1ca)](/^\s*\/\/.*$/gm,''),_0x5e09c0=_0x3ac7f5[_0x485910(0x1ca)](/,\s*([}\]])/g,'$1');return JSON['parse'](_0x5e09c0);}async function removeOpencodePluginConfig(_0x37802e){const _0x2015c1=_0x3094c7,_0x3b5ff8={'RTbxQ':function(_0x541354,_0x3cae8b){return _0x541354!==_0x3cae8b;},'jcGhE':function(_0x8ab66d,_0x13cb01){return _0x8ab66d!==_0x13cb01;},'AcnMC':function(_0x58e30d,_0x34c8fb){return _0x58e30d(_0x34c8fb);},'noQZu':'utf-8','bzTWi':function(_0x53d69f,_0x3d6950){return _0x53d69f(_0x3d6950);},'hCUKf':function(_0x12ac1a,_0x346e1a){return _0x12ac1a===_0x346e1a;},'Retjq':function(_0x446352,_0x2959a3,_0x365ce3){return _0x446352(_0x2959a3,_0x365ce3);},'SlqGS':function(_0x40c773,_0x2a7248){return _0x40c773+_0x2a7248;}};if(!_0x3b5ff8[_0x2015c1(0x1d5)](existsSync,_0x37802e))return![];let _0x577ec1;try{const _0x529c91=await readFile(_0x37802e,_0x3b5ff8[_0x2015c1(0x1c7)]);_0x577ec1=_0x3b5ff8['bzTWi'](parseJsonc,_0x529c91);}catch{return![];}const _0x3b63d1=Array['isArray'](_0x577ec1[_0x2015c1(0x1d1)])?_0x577ec1['plugin']:[];if(_0x3b63d1[_0x2015c1(0x1d6)]===0x0)return![];const _0x52c572=_0x3b63d1[_0x2015c1(0x1e4)](_0x2f2740=>{const _0x2561fb=_0x2015c1;if(_0x3b5ff8[_0x2561fb(0x1f4)](typeof _0x2f2740,'string'))return!![];return _0x3b5ff8[_0x2561fb(0x1d7)](_0x2f2740,opencodePluginName);});if(_0x3b5ff8[_0x2015c1(0x1e5)](_0x52c572['length'],_0x3b63d1['length']))return![];return _0x52c572[_0x2015c1(0x1d6)]===0x0?delete _0x577ec1[_0x2015c1(0x1d1)]:_0x577ec1['plugin']=_0x52c572,await _0x3b5ff8[_0x2015c1(0x1f0)](writeFile,_0x37802e,_0x3b5ff8['SlqGS'](JSON[_0x2015c1(0x1da)](_0x577ec1,null,0x2),'\x0a')),!![];}async function uninstallClaudePlugin(_0x2b3891){const _0x2f48fc=_0x3094c7,_0x99c4ff={'WUusT':'ranger@trailhead','oKjJR':_0x2f48fc(0x1e3),'GtybN':'claude','AhzHi':_0x2f48fc(0x1fd),'VYrAj':function(_0x4abc05,_0x5a27ab){return _0x4abc05===_0x5a27ab;},'GBymj':_0x2f48fc(0x1de),'TBTjm':_0x2f48fc(0x1d8)};return new Promise(_0x10f2df=>{const _0x5188ad=_0x2f48fc,_0x3f2dfc={'VCmvL':function(_0x67123,_0x58dcac){return _0x67123(_0x58dcac);}},_0x355ee8=[_0x5188ad(0x1d1),_0x5188ad(0x1dc),_0x99c4ff['WUusT']];_0x2b3891&&_0x355ee8['push'](_0x99c4ff['oKjJR'],_0x2b3891);const _0xe785a8=spawn(_0x99c4ff[_0x5188ad(0x1ef)],_0x355ee8,{'stdio':[_0x5188ad(0x1fd),_0x99c4ff['AhzHi'],_0x5188ad(0x1fd)],'cwd':_0x2b3891?getProjectRoot():undefined,'shell':_0x99c4ff[_0x5188ad(0x1fe)](process['platform'],_0x99c4ff['GBymj'])});_0xe785a8['on'](_0x99c4ff['TBTjm'],_0x11270e=>{_0x10f2df(_0x11270e===0x0);}),_0xe785a8['on']('error',()=>{const _0x3b3f46=_0x5188ad;_0x3f2dfc[_0x3b3f46(0x1f9)](_0x10f2df,![]);});});}async function removeMarketplace(){const _0x230ca4=_0x3094c7,_0x346106={'mwMjQ':function(_0x489e35,_0x144686){return _0x489e35===_0x144686;},'OWBGV':function(_0x1fe947,_0x5866a1){return _0x1fe947(_0x5866a1);},'CBpLY':function(_0xfb3073,_0x2a09ee,_0x9adb20,_0x1ab484){return _0xfb3073(_0x2a09ee,_0x9adb20,_0x1ab484);},'BrGgu':'plugin','magxf':_0x230ca4(0x1e8),'GmzFI':_0x230ca4(0x1cc),'NsCUq':_0x230ca4(0x1fd),'RIKvQ':function(_0xea57b6,_0x1caf3f){return _0xea57b6===_0x1caf3f;},'LpPzx':_0x230ca4(0x1d8),'RglzS':'error'};return new Promise(_0x47a6e8=>{const _0x298257=_0x230ca4,_0x280082={'ZNqlo':function(_0x17bca9,_0x363776){const _0x2597ac=_0x1dd7;return _0x346106[_0x2597ac(0x1ec)](_0x17bca9,_0x363776);}},_0xe265f3=_0x346106['CBpLY'](spawn,'claude',[_0x346106['BrGgu'],_0x346106[_0x298257(0x1f1)],_0x346106['GmzFI'],_0x298257(0x1fa)],{'stdio':[_0x346106[_0x298257(0x1e6)],_0x298257(0x1fd),_0x298257(0x1fd)],'shell':_0x346106['RIKvQ'](process['platform'],_0x298257(0x1de))});_0xe265f3['on'](_0x346106[_0x298257(0x1c5)],_0x43e4f1=>{_0x47a6e8(_0x346106['mwMjQ'](_0x43e4f1,0x0));}),_0xe265f3['on'](_0x346106[_0x298257(0x1cd)],()=>{const _0xfd21a=_0x298257;_0x280082[_0xfd21a(0x1d0)](_0x47a6e8,![]);});});}export async function clean(){const _0x3a9eb7=_0x3094c7,_0x4386f9={'Hbqou':function(_0x2539ff){return _0x2539ff();},'Pxktl':'✓\x20Removed\x20stored\x20credentials','ZTAVQ':function(_0x231350){return _0x231350();},'QDGfd':function(_0xd29bbf,_0x51a42e){return _0xd29bbf(_0x51a42e);},'eCRdD':function(_0x5c7315,_0x2e3f23){return _0x5c7315(_0x2e3f23);},'VkYxk':function(_0x5efb14,_0x24496a,_0x385b3c){return _0x5efb14(_0x24496a,_0x385b3c);},'wePwh':function(_0x11c72c,_0x472032,_0x564bf4){return _0x11c72c(_0x472032,_0x564bf4);},'MUpEp':function(_0x16c6b6,_0x33ad42,_0x1a5565){return _0x16c6b6(_0x33ad42,_0x1a5565);},'woZgY':function(_0x2f35a2,_0x3bb8a5){return _0x2f35a2(_0x3bb8a5);},'wnRyw':function(_0x470911,_0x54b24b,_0x386bc3){return _0x470911(_0x54b24b,_0x386bc3);},'FMDqT':_0x3a9eb7(0x1cf),'HOOvg':'opencode.json','EISMa':_0x3a9eb7(0x1e1),'VKrCl':'user','MQiDw':'✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)','ScDXz':'✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)','HUtyD':function(_0x31fa72){return _0x31fa72();},'iwiJz':'Nothing\x20to\x20clean\x20up.\x0a'};console[_0x3a9eb7(0x1df)](_0x3a9eb7(0x1cb));let _0x34ebb4=![];try{await _0x4386f9['Hbqou'](deleteAllCredentials),console[_0x3a9eb7(0x1df)](_0x4386f9['Pxktl']),_0x34ebb4=!![];}catch{}const _0x57ace5=_0x4386f9['ZTAVQ'](getCacheFile);_0x4386f9[_0x3a9eb7(0x1ea)](existsSync,_0x57ace5)&&(await _0x4386f9['eCRdD'](rm,_0x57ace5),_0x34ebb4=!![]);const _0x274ddc=getRangerDir();existsSync(_0x274ddc)&&(await rm(_0x274ddc,{'recursive':!![]}),console[_0x3a9eb7(0x1df)]('✓\x20Removed\x20.ranger/\x20directory'),_0x34ebb4=!![]);const _0x530854=getProjectSkillsDir();for(const _0x599711 of skillsToRemove){const _0x5b7998=_0x4386f9['VkYxk'](join,_0x530854,_0x599711);existsSync(_0x5b7998)&&(await _0x4386f9[_0x3a9eb7(0x1ee)](rm,_0x5b7998,{'recursive':!![]}),console['log']('✓\x20Removed\x20project\x20skill:\x20'+_0x599711),_0x34ebb4=!![]);}const _0x2cc6c2=_0x4386f9['Hbqou'](getUserSkillsDir);for(const _0x33a144 of skillsToRemove){const _0x1cad15=join(_0x2cc6c2,_0x33a144);_0x4386f9['QDGfd'](existsSync,_0x1cad15)&&(await _0x4386f9[_0x3a9eb7(0x1f3)](rm,_0x1cad15,{'recursive':!![]}),console[_0x3a9eb7(0x1df)](_0x3a9eb7(0x1ce)+_0x33a144),_0x34ebb4=!![]);}const _0x52d02b=getOpencodeSkillsDir(_0x3a9eb7(0x1cf));for(const _0x1d2b26 of skillsToRemove){const _0x5712f5=_0x4386f9[_0x3a9eb7(0x1ee)](join,_0x52d02b,_0x1d2b26);existsSync(_0x5712f5)&&(await rm(_0x5712f5,{'recursive':!![]}),console[_0x3a9eb7(0x1df)]('✓\x20Removed\x20OpenCode\x20project\x20skill:\x20'+_0x1d2b26),_0x34ebb4=!![]);}const _0x3020ca=_0x4386f9[_0x3a9eb7(0x1e7)](getOpencodeSkillsDir,_0x3a9eb7(0x1d4));for(const _0x5e6f8c of skillsToRemove){const _0x4d00f7=join(_0x3020ca,_0x5e6f8c);existsSync(_0x4d00f7)&&(await _0x4386f9[_0x3a9eb7(0x1d2)](rm,_0x4d00f7,{'recursive':!![]}),console[_0x3a9eb7(0x1df)]('✓\x20Removed\x20OpenCode\x20user\x20skill:\x20'+_0x5e6f8c),_0x34ebb4=!![]);}const _0x17db26=join(getOpencodeConfigDir(_0x4386f9['FMDqT']),_0x4386f9[_0x3a9eb7(0x1ed)]);await removeOpencodePluginConfig(_0x17db26)&&(console[_0x3a9eb7(0x1df)](_0x4386f9[_0x3a9eb7(0x1d3)]),_0x34ebb4=!![]);const _0x5cb4a1=join(_0x4386f9[_0x3a9eb7(0x1e7)](getOpencodeConfigDir,_0x4386f9[_0x3a9eb7(0x1fc)]),_0x4386f9[_0x3a9eb7(0x1ed)]);await removeOpencodePluginConfig(_0x5cb4a1)&&(console['log'](_0x4386f9[_0x3a9eb7(0x1d9)]),_0x34ebb4=!![]);const _0x5f69c7=await _0x4386f9['Hbqou'](uninstallClaudePlugin);_0x5f69c7&&(console[_0x3a9eb7(0x1df)](_0x4386f9[_0x3a9eb7(0x1f2)]),_0x34ebb4=!![]);const _0xa68a89=await uninstallClaudePlugin('project');_0xa68a89&&(console['log'](_0x3a9eb7(0x1db)),_0x34ebb4=!![]);const _0x193b1d=await _0x4386f9['HUtyD'](removeMarketplace);_0x193b1d&&(console['log'](_0x3a9eb7(0x1eb)),_0x34ebb4=!![]),_0x34ebb4?console[_0x3a9eb7(0x1df)](_0x3a9eb7(0x1e2)):console[_0x3a9eb7(0x1df)](_0x4386f9[_0x3a9eb7(0x1fb)]);}
|
|
1
|
+
const _0x167a59=_0x57a5;(function(_0x4cfb24,_0x30afe3){const _0x447656=_0x57a5,_0x4d7b9a=_0x4cfb24();while(!![]){try{const _0x37c62d=-parseInt(_0x447656(0xf2))/0x1*(parseInt(_0x447656(0x10f))/0x2)+-parseInt(_0x447656(0xf0))/0x3*(-parseInt(_0x447656(0x11d))/0x4)+-parseInt(_0x447656(0x10c))/0x5*(-parseInt(_0x447656(0x121))/0x6)+-parseInt(_0x447656(0x11b))/0x7*(-parseInt(_0x447656(0xfa))/0x8)+parseInt(_0x447656(0xfd))/0x9+-parseInt(_0x447656(0xf9))/0xa+-parseInt(_0x447656(0x119))/0xb*(-parseInt(_0x447656(0x10e))/0xc);if(_0x37c62d===_0x30afe3)break;else _0x4d7b9a['push'](_0x4d7b9a['shift']());}catch(_0x1d604d){_0x4d7b9a['push'](_0x4d7b9a['shift']());}}}(_0x1794,0x5ac17));import{rm,readFile,writeFile}from'fs/promises';import{join}from'path';function _0x1794(){const _0x2d3f2d=['12sxOPOm','58444pZpqlE','LGLaz','JBtZk','\x0a✅\x20Cleanup\x20complete!\x0a','qgweW','isArray','opencode.json','close','JPKnk','fyKhb','1151711fypGfK','rYNkb','2858198ecTzbq','XOOWd','381884JTyyzz','push','GANqW','✓\x20Removed\x20.ranger/\x20directory','297324VvuiWi','✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)','plugin','platform','PDrMH','gPhPN','AlLjW','✓\x20Removed\x20OpenCode\x20project\x20skill:\x20','parse','length','rJCgD','✓\x20Removed\x20trailhead\x20marketplace','kRLoP','CiXGc','9GlZzzt','hbSaT','19hfRGZb','\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','@ranger-testing/opencode-plugin','NdMiQ','filter','error','remove','4803900wAzcwi','8ZWvdse','FNCNV','✓\x20Removed\x20user\x20skill:\x20','4579263SduJDl','user','MjzuE','win32','replace','project','log','rtiSh','VeyOv','ukJll','UtsUT','marketplace','ZXmZu','ddeZR','ignore','10nvCLhv','XtqXh'];_0x1794=function(){return _0x2d3f2d;};return _0x1794();}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';function _0x57a5(_0x45cfae,_0x5c8d9e){_0x45cfae=_0x45cfae-0xe3;const _0x1794bb=_0x1794();let _0x57a528=_0x1794bb[_0x45cfae];return _0x57a528;}import{getCacheFile}from'./utils/sessionCache.js';import{getOpencodeConfigDir,getOpencodeSkillsDir}from'./utils/opencodeConfig.js';const skillsToRemove=['ranger','feature-tracker','bug-bash','e2e-test-recommender'],opencodePluginName=_0x167a59(0xf4);function parseJsonc(_0x2afa8a){const _0x2445c2=_0x167a59,_0x416aab=_0x2afa8a['replace'](/\/\*[\s\S]*?\*\//g,''),_0xab41c=_0x416aab[_0x2445c2(0x101)](/^\s*\/\/.*$/gm,''),_0x40a659=_0xab41c[_0x2445c2(0x101)](/,\s*([}\]])/g,'$1');return JSON[_0x2445c2(0xea)](_0x40a659);}async function removeOpencodePluginConfig(_0x142119){const _0x3434e5=_0x167a59,_0x5386da={'VeyOv':function(_0x3ddfda,_0x445c2c){return _0x3ddfda!==_0x445c2c;},'Pthrj':'string','YZZgM':function(_0x461ee7,_0x5dc18d){return _0x461ee7(_0x5dc18d);},'UtsUT':function(_0x237519,_0xa6589f,_0x3871d7){return _0x237519(_0xa6589f,_0x3871d7);},'JBtZk':function(_0x51e98c,_0x497696){return _0x51e98c===_0x497696;},'LdVuo':function(_0x278404,_0x5afce8){return _0x278404===_0x5afce8;},'gPhPN':function(_0x5de9a2,_0xcfdb4){return _0x5de9a2+_0xcfdb4;}};if(!_0x5386da['YZZgM'](existsSync,_0x142119))return![];let _0x14d604;try{const _0xa301bb=await _0x5386da['UtsUT'](readFile,_0x142119,'utf-8');_0x14d604=parseJsonc(_0xa301bb);}catch{return![];}const _0x3c450a=Array[_0x3434e5(0x114)](_0x14d604[_0x3434e5(0xe4)])?_0x14d604['plugin']:[];if(_0x5386da[_0x3434e5(0x111)](_0x3c450a[_0x3434e5(0xeb)],0x0))return![];const _0x261bd1=_0x3c450a[_0x3434e5(0xf6)](_0x15a9d9=>{const _0x2de863=_0x3434e5;if(_0x5386da[_0x2de863(0x105)](typeof _0x15a9d9,_0x5386da['Pthrj']))return!![];return _0x15a9d9!==opencodePluginName;});if(_0x5386da['LdVuo'](_0x261bd1[_0x3434e5(0xeb)],_0x3c450a[_0x3434e5(0xeb)]))return![];return _0x5386da[_0x3434e5(0x111)](_0x261bd1[_0x3434e5(0xeb)],0x0)?delete _0x14d604['plugin']:_0x14d604[_0x3434e5(0xe4)]=_0x261bd1,await _0x5386da[_0x3434e5(0x107)](writeFile,_0x142119,_0x5386da[_0x3434e5(0xe7)](JSON['stringify'](_0x14d604,null,0x2),'\x0a')),!![];}async function uninstallClaudePlugin(_0x3708e7){const _0x6136ba=_0x167a59,_0x5da422={'ZXmZu':_0x6136ba(0xe4),'rtiSh':'uninstall','RRlMJ':'--scope','ukJll':function(_0x15bb86,_0x4f0efc,_0x3b5352,_0x17f368){return _0x15bb86(_0x4f0efc,_0x3b5352,_0x17f368);},'ueUzj':'claude','fyKhb':_0x6136ba(0x10b),'JPKnk':function(_0x5d54d7){return _0x5d54d7();}};return new Promise(_0x510205=>{const _0x2f44cb=_0x6136ba,_0x3e63fd=[_0x5da422[_0x2f44cb(0x109)],_0x5da422[_0x2f44cb(0x104)],'ranger@trailhead'];_0x3708e7&&_0x3e63fd[_0x2f44cb(0x11e)](_0x5da422['RRlMJ'],_0x3708e7);const _0x4c7417=_0x5da422[_0x2f44cb(0x106)](spawn,_0x5da422['ueUzj'],_0x3e63fd,{'stdio':[_0x5da422[_0x2f44cb(0x118)],_0x5da422['fyKhb'],_0x2f44cb(0x10b)],'cwd':_0x3708e7?_0x5da422[_0x2f44cb(0x117)](getProjectRoot):undefined,'shell':process[_0x2f44cb(0xe5)]==='win32'});_0x4c7417['on'](_0x2f44cb(0x116),_0x5516af=>{_0x510205(_0x5516af===0x0);}),_0x4c7417['on']('error',()=>{_0x510205(![]);});});}async function removeMarketplace(){const _0x770a33=_0x167a59,_0x45522b={'WwIiz':function(_0x4092a7,_0x28e560){return _0x4092a7(_0x28e560);},'fLRqE':function(_0x58e83d,_0x46b477,_0x16b65b,_0x487169){return _0x58e83d(_0x46b477,_0x16b65b,_0x487169);},'ndaPR':'claude','zEHFe':_0x770a33(0x108),'kRLoP':'ignore','Hvhep':function(_0x428421,_0x32bdfd){return _0x428421===_0x32bdfd;},'ucxtI':'close','rJCgD':_0x770a33(0xf7)};return new Promise(_0x1c4d11=>{const _0x350fa3=_0x770a33,_0x2778f3=_0x45522b['fLRqE'](spawn,_0x45522b['ndaPR'],[_0x350fa3(0xe4),_0x45522b['zEHFe'],_0x350fa3(0xf8),'trailhead'],{'stdio':[_0x350fa3(0x10b),_0x45522b[_0x350fa3(0xee)],_0x45522b['kRLoP']],'shell':_0x45522b['Hvhep'](process['platform'],_0x350fa3(0x100))});_0x2778f3['on'](_0x45522b['ucxtI'],_0x49fe9b=>{_0x1c4d11(_0x49fe9b===0x0);}),_0x2778f3['on'](_0x45522b[_0x350fa3(0xec)],()=>{_0x45522b['WwIiz'](_0x1c4d11,![]);});});}export async function clean(){const _0x3c1b1b=_0x167a59,_0x3a1d9a={'aZhAE':function(_0x153017){return _0x153017();},'zbDLM':'✓\x20Removed\x20stored\x20credentials','TOoDT':function(_0x180311,_0x162318){return _0x180311(_0x162318);},'NdMiQ':function(_0x34ec22){return _0x34ec22();},'CiXGc':function(_0x47615a,_0x1f5f40){return _0x47615a(_0x1f5f40);},'MjzuE':_0x3c1b1b(0x120),'rYNkb':function(_0xdad3d0){return _0xdad3d0();},'LGLaz':function(_0x2bbadd,_0x14f123,_0x56d739){return _0x2bbadd(_0x14f123,_0x56d739);},'FNCNV':function(_0x161e3f,_0x520ce7){return _0x161e3f(_0x520ce7);},'ddeZR':_0x3c1b1b(0x102),'qgweW':function(_0x5f1d04,_0xb9b9b,_0x42ced6){return _0x5f1d04(_0xb9b9b,_0x42ced6);},'XOOWd':_0x3c1b1b(0x115),'hbSaT':function(_0x3c0ace,_0x383fd4){return _0x3c0ace(_0x383fd4);},'GANqW':'✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)','afjES':function(_0x3876f3,_0x271040){return _0x3876f3(_0x271040);},'XtqXh':'✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)','ReRek':_0x3c1b1b(0xe3),'AlLjW':_0x3c1b1b(0xed),'PDrMH':_0x3c1b1b(0x112),'aMKzJ':'Nothing\x20to\x20clean\x20up.\x0a'};console['log'](_0x3c1b1b(0xf3));let _0x2ad03f=![];try{await _0x3a1d9a['aZhAE'](deleteAllCredentials),console['log'](_0x3a1d9a['zbDLM']),_0x2ad03f=!![];}catch{}const _0x2de3d7=getCacheFile();_0x3a1d9a['TOoDT'](existsSync,_0x2de3d7)&&(await _0x3a1d9a['TOoDT'](rm,_0x2de3d7),_0x2ad03f=!![]);const _0x1b28f3=_0x3a1d9a[_0x3c1b1b(0xf5)](getRangerDir);_0x3a1d9a['CiXGc'](existsSync,_0x1b28f3)&&(await rm(_0x1b28f3,{'recursive':!![]}),console[_0x3c1b1b(0x103)](_0x3a1d9a[_0x3c1b1b(0xff)]),_0x2ad03f=!![]);const _0x414810=_0x3a1d9a[_0x3c1b1b(0x11a)](getProjectSkillsDir);for(const _0x4c4707 of skillsToRemove){const _0x33d633=_0x3a1d9a['LGLaz'](join,_0x414810,_0x4c4707);_0x3a1d9a['FNCNV'](existsSync,_0x33d633)&&(await rm(_0x33d633,{'recursive':!![]}),console['log']('✓\x20Removed\x20project\x20skill:\x20'+_0x4c4707),_0x2ad03f=!![]);}const _0x2ec510=getUserSkillsDir();for(const _0x1e9dd1 of skillsToRemove){const _0x461e80=_0x3a1d9a['LGLaz'](join,_0x2ec510,_0x1e9dd1);_0x3a1d9a[_0x3c1b1b(0xfb)](existsSync,_0x461e80)&&(await _0x3a1d9a[_0x3c1b1b(0x110)](rm,_0x461e80,{'recursive':!![]}),console['log'](_0x3c1b1b(0xfc)+_0x1e9dd1),_0x2ad03f=!![]);}const _0x317668=getOpencodeSkillsDir(_0x3a1d9a[_0x3c1b1b(0x10a)]);for(const _0x44d43c of skillsToRemove){const _0x203c73=join(_0x317668,_0x44d43c);_0x3a1d9a[_0x3c1b1b(0xef)](existsSync,_0x203c73)&&(await rm(_0x203c73,{'recursive':!![]}),console[_0x3c1b1b(0x103)](_0x3c1b1b(0xe9)+_0x44d43c),_0x2ad03f=!![]);}const _0x420d37=_0x3a1d9a[_0x3c1b1b(0xfb)](getOpencodeSkillsDir,_0x3c1b1b(0xfe));for(const _0x4b0fb5 of skillsToRemove){const _0x379fcf=_0x3a1d9a[_0x3c1b1b(0x113)](join,_0x420d37,_0x4b0fb5);existsSync(_0x379fcf)&&(await rm(_0x379fcf,{'recursive':!![]}),console['log']('✓\x20Removed\x20OpenCode\x20user\x20skill:\x20'+_0x4b0fb5),_0x2ad03f=!![]);}const _0x2bc4ee=_0x3a1d9a[_0x3c1b1b(0x113)](join,_0x3a1d9a['FNCNV'](getOpencodeConfigDir,_0x3a1d9a[_0x3c1b1b(0x10a)]),_0x3a1d9a[_0x3c1b1b(0x11c)]);await _0x3a1d9a[_0x3c1b1b(0xf1)](removeOpencodePluginConfig,_0x2bc4ee)&&(console[_0x3c1b1b(0x103)](_0x3a1d9a[_0x3c1b1b(0x11f)]),_0x2ad03f=!![]);const _0x37c916=join(_0x3a1d9a['afjES'](getOpencodeConfigDir,'user'),'opencode.json');await removeOpencodePluginConfig(_0x37c916)&&(console[_0x3c1b1b(0x103)](_0x3a1d9a[_0x3c1b1b(0x10d)]),_0x2ad03f=!![]);const _0xe4fe93=await _0x3a1d9a[_0x3c1b1b(0x11a)](uninstallClaudePlugin);_0xe4fe93&&(console[_0x3c1b1b(0x103)]('✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)'),_0x2ad03f=!![]);const _0xf9cd27=await _0x3a1d9a['TOoDT'](uninstallClaudePlugin,_0x3a1d9a[_0x3c1b1b(0x10a)]);_0xf9cd27&&(console['log'](_0x3a1d9a['ReRek']),_0x2ad03f=!![]);const _0x28e4b7=await removeMarketplace();_0x28e4b7&&(console[_0x3c1b1b(0x103)](_0x3a1d9a[_0x3c1b1b(0xe8)]),_0x2ad03f=!![]),_0x2ad03f?console[_0x3c1b1b(0x103)](_0x3a1d9a[_0x3c1b1b(0xe6)]):console[_0x3c1b1b(0x103)](_0x3a1d9a['aMKzJ']);}
|
package/build/commands/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x2fa313=_0x49a0;function _0xf490(){const _0x4d80c5=['kind','startsWith','70bYvjWV','ixmAv','keys','3piSUWl','No\x20configuration\x20set\x20for\x20\x22','log','undefined','\x20<key>\x22\x20to\x20remove\x20individual\x20values.','forceLogin','wQxbA','VHKYe','elKAz','422566bgCuTa','9711449nOuHht','parse','stringify','cloud','63930sZBwmn','alsoExistsElsewhere','null','17647lYAyLM','GpxoR','1564920xyPFff','129412YXroAE','1143YyqBVw','\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.','qRqVx','zzNKh','\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20','kRMer','\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20','Key\x20\x22','qzAXC','(not\x20set)','EaPsl',':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22','isSafeInteger','irCqL','12fSXdIO','\x22\x20not\x20found','faZJe','Removed\x20','false','test','true','5752IKfJqq','\x20for\x20\x22','25FAeWuS','OAlkb','Invalid\x20value\x20for\x20','GTkoM'];_0xf490=function(){return _0x4d80c5;};return _0xf490();}(function(_0x1facd2,_0x406465){const _0x1dee8a=_0x49a0,_0x7922f=_0x1facd2();while(!![]){try{const _0x992b06=parseInt(_0x1dee8a(0xf7))/0x1+-parseInt(_0x1dee8a(0xef))/0x2*(parseInt(_0x1dee8a(0xe6))/0x3)+parseInt(_0x1dee8a(0xfa))/0x4*(-parseInt(_0x1dee8a(0xdd))/0x5)+-parseInt(_0x1dee8a(0xf4))/0x6*(parseInt(_0x1dee8a(0xe3))/0x7)+parseInt(_0x1dee8a(0xdb))/0x8*(-parseInt(_0x1dee8a(0xfb))/0x9)+-parseInt(_0x1dee8a(0xf9))/0xa+-parseInt(_0x1dee8a(0xf0))/0xb*(-parseInt(_0x1dee8a(0x109))/0xc);if(_0x992b06===_0x406465)break;else _0x7922f['push'](_0x7922f['shift']());}catch(_0x4fb7f0){_0x7922f['push'](_0x7922f['shift']());}}}(_0xf490,0x2a42f));import{existsSync}from'fs';import{loadSettings,getNestedValue,deleteNestedValue,formatSettings,getSettingsPath,getEnvDir}from'./utils/settings.js';function _0x49a0(_0x3e255b,_0x596955){_0x3e255b=_0x3e255b-0xd6;const _0xf49081=_0xf490();let _0x49a037=_0xf49081[_0x3e255b];return _0x49a037;}import{fetchCloudProfile}from'./utils/cloudProfile.js';import{mergeCloudProfileSettings,readProfileOverrides,resetProfileOverrides,setProfileOverride,unsetProfileOverride}from'./utils/projectsConfig.js';const BOOLEAN_KEYS=['headless','allowInsecureLocalhost',_0x2fa313(0xeb)];function parseLocalValue(_0x4ac392,_0xb89ff8){const _0x109eda=_0x2fa313,_0x341a6={'GagHi':function(_0x124481,_0x351577){return _0x124481===_0x351577;},'EaPsl':'false'};if(BOOLEAN_KEYS['includes'](_0x4ac392)){if(_0x341a6['GagHi'](_0xb89ff8,'true'))return!![];if(_0x341a6['GagHi'](_0xb89ff8,_0x341a6[_0x109eda(0x105)]))return![];throw new Error(_0x109eda(0xdf)+_0x4ac392+_0x109eda(0x106));}return _0xb89ff8;}function parseOverrideValue(_0x227927){const _0x34e045=_0x2fa313,_0x1bfe18={'bGPfe':_0x34e045(0xda),'fdgco':_0x34e045(0xd8),'wQxbA':_0x34e045(0xf6),'KFLvU':function(_0x569f11,_0x3648a1){return _0x569f11===_0x3648a1;},'faZJe':_0x34e045(0xe9)};if(_0x227927===_0x1bfe18['bGPfe'])return!![];if(_0x227927===_0x1bfe18['fdgco'])return![];if(_0x227927===_0x1bfe18[_0x34e045(0xec)])return null;if(_0x1bfe18['KFLvU'](_0x227927,_0x1bfe18[_0x34e045(0xd6)]))return undefined;if(/^-?\d+$/[_0x34e045(0xd9)](_0x227927)){const _0x58b63e=Number(_0x227927);if(Number[_0x34e045(0x107)](_0x58b63e))return _0x58b63e;}if(/^-?\d+\.\d+$/[_0x34e045(0xd9)](_0x227927)){const _0x42f540=Number(_0x227927);if(!Number['isNaN'](_0x42f540))return _0x42f540;}const _0x5d7fe1=_0x227927['trim']();if(_0x5d7fe1['startsWith']('{')&&_0x5d7fe1['endsWith']('}')||_0x5d7fe1[_0x34e045(0xe2)]('[')&&_0x5d7fe1['endsWith'](']'))try{return JSON[_0x34e045(0xf1)](_0x5d7fe1);}catch{}return _0x227927;}async function resolveProfileTarget(_0x2f9adc){const _0x1ba68f=_0x2fa313,_0x38d894={'eXgow':function(_0x344775,_0x222924){return _0x344775(_0x222924);},'zzNKh':function(_0x38e634,_0x52b826){return _0x38e634(_0x52b826);},'UVQhX':_0x1ba68f(0xf3)},_0x5e7d8e=_0x38d894['eXgow'](existsSync,getEnvDir(_0x2f9adc));let _0x1b517d=![];try{const _0x31b048=await _0x38d894['zzNKh'](fetchCloudProfile,_0x2f9adc);_0x1b517d=_0x38d894[_0x1ba68f(0xfe)](Boolean,_0x31b048);}catch{}if(_0x1b517d)return{'kind':_0x38d894['UVQhX'],'alsoExistsElsewhere':_0x5e7d8e};if(_0x5e7d8e)return{'kind':'local','alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x2f9adc+_0x1ba68f(0xff)+_0x2f9adc);}function printDualExistsHint(_0xe25c37){const _0x1fd943=_0x2fa313;console['log']('\x20\x20Note:\x20\x22'+_0xe25c37+_0x1fd943(0xfc));}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x9335d2){const _0x346a66=_0x2fa313,_0xbe76bf={'irCqL':function(_0x18e9de,_0x4d1bf0){return _0x18e9de(_0x4d1bf0);},'OAlkb':function(_0x44e698,_0x1b9b9a,_0x37b54f){return _0x44e698(_0x1b9b9a,_0x37b54f);},'kRMer':function(_0x4e6ef6){return _0x4e6ef6();},'ixmAv':function(_0x45c05b,_0x1ffd16){return _0x45c05b??_0x1ffd16;}},_0x4f691e=await _0xbe76bf[_0x346a66(0x108)](fetchCloudProfile,_0x9335d2),_0x4d241b=_0xbe76bf[_0x346a66(0xde)](readProfileOverrides,_0xbe76bf[_0x346a66(0x100)](getProjectPath),_0x9335d2);return mergeCloudProfileSettings(_0x4f691e?.['settings']??{},_0xbe76bf[_0x346a66(0xe4)](_0x4d241b,undefined));}export async function configSet(_0x2e51f8,_0x27f139,_0x15c593){const _0x52b912=_0x2fa313,_0x470eb9={'YeJKx':function(_0x54e398,_0x1fd05e){return _0x54e398===_0x1fd05e;},'ZSSxI':'cloud','FWxqh':function(_0x1f007e,_0x13a822){return _0x1f007e(_0x13a822);},'OcYvE':function(_0xb81410,_0x455f11){return _0xb81410(_0x455f11);},'pskBh':function(_0x154654,_0x23069f,_0x3cbbcb){return _0x154654(_0x23069f,_0x3cbbcb);},'upJSl':function(_0x3cff55,_0x4bbdec,_0x149746,_0x4e7bed,_0x3a93cd){return _0x3cff55(_0x4bbdec,_0x149746,_0x4e7bed,_0x3a93cd);},'EZyBa':function(_0x21d19d){return _0x21d19d();}},_0x3f133b=await resolveProfileTarget(_0x2e51f8);if(_0x470eb9['YeJKx'](_0x3f133b[_0x52b912(0xe1)],_0x470eb9['ZSSxI'])){if(_0x3f133b[_0x52b912(0xf5)])_0x470eb9['FWxqh'](printDualExistsHint,_0x2e51f8);const _0x489703=_0x470eb9['OcYvE'](parseOverrideValue,_0x15c593);setProfileOverride(getProjectPath(),_0x2e51f8,_0x27f139,_0x489703),console[_0x52b912(0xe8)]('Set\x20'+_0x27f139+'\x20=\x20'+JSON[_0x52b912(0xf2)](_0x489703)+'\x20for\x20\x22'+_0x2e51f8+'\x22');return;}const _0x4459b8=_0x470eb9['pskBh'](parseLocalValue,_0x27f139,_0x15c593);_0x470eb9['upJSl'](setProfileOverride,_0x470eb9['EZyBa'](getProjectPath),_0x2e51f8,_0x27f139,_0x4459b8),console['log']('Set\x20'+_0x27f139+'\x20=\x20'+_0x4459b8+_0x52b912(0xdc)+_0x2e51f8+'\x22');}export async function configGet(_0x5f3836,_0x388a03){const _0x4b64a9=_0x2fa313,_0x3ae951={'GpxoR':function(_0x149588,_0x5ec339){return _0x149588===_0x5ec339;},'NPLHd':function(_0x1b78d0,_0x36ac25){return _0x1b78d0(_0x36ac25);},'FQkFz':function(_0x38d1f9,_0xdfb82f,_0x1740e9){return _0x38d1f9(_0xdfb82f,_0x1740e9);},'yMehH':'object'},_0x4302f1=await resolveProfileTarget(_0x5f3836);if(_0x3ae951['GpxoR'](_0x4302f1['kind'],'cloud')){const _0x4c0876=await _0x3ae951['NPLHd'](loadEffectiveCloudSettings,_0x5f3836),_0x50b806=_0x3ae951['FQkFz'](getNestedValue,_0x4c0876,_0x388a03);if(_0x50b806===undefined)console[_0x4b64a9(0xe8)]('(not\x20set)');else _0x3ae951[_0x4b64a9(0xf8)](typeof _0x50b806,_0x3ae951['yMehH'])?console['log'](JSON[_0x4b64a9(0xf2)](_0x50b806,null,0x2)):console[_0x4b64a9(0xe8)](_0x50b806);return;}const _0x1aa805=await loadSettings(_0x5f3836),_0x500345=getNestedValue(_0x1aa805,_0x388a03);if(_0x3ae951['GpxoR'](_0x500345,undefined))console['log'](_0x4b64a9(0x104));else typeof _0x500345===_0x3ae951['yMehH']?console[_0x4b64a9(0xe8)](JSON[_0x4b64a9(0xf2)](_0x500345,null,0x2)):console[_0x4b64a9(0xe8)](_0x500345);}export async function configList(_0x7673be){const _0x11e801=_0x2fa313,_0x26d0cf={'cAWye':function(_0x306152,_0x58c3d9){return _0x306152(_0x58c3d9);},'elKAz':function(_0x3e5165,_0x125594){return _0x3e5165===_0x125594;},'ayjjH':function(_0x4dd7f0,_0x425a8c){return _0x4dd7f0(_0x425a8c);}},_0x5b872c=await resolveProfileTarget(_0x7673be);if(_0x5b872c['kind']==='cloud'){const _0xaf71f2=await _0x26d0cf['cAWye'](loadEffectiveCloudSettings,_0x7673be);if(!_0xaf71f2||_0x26d0cf[_0x11e801(0xee)](Object[_0x11e801(0xe5)](_0xaf71f2)['length'],0x0)){console[_0x11e801(0xe8)]('No\x20configuration\x20set\x20for\x20\x22'+_0x7673be+'\x22');return;}console[_0x11e801(0xe8)](JSON[_0x11e801(0xf2)](_0xaf71f2,null,0x2));return;}const _0x4e1c27=_0x26d0cf['ayjjH'](getSettingsPath,_0x7673be);if(!existsSync(_0x4e1c27)){console[_0x11e801(0xe8)]('No\x20configuration\x20set\x20for\x20\x22'+_0x7673be+'\x22');return;}const _0x176058=await loadSettings(_0x7673be),_0x139b87=_0x26d0cf['ayjjH'](formatSettings,_0x176058);!_0x139b87?console['log'](_0x11e801(0xe7)+_0x7673be+'\x22'):console['log'](_0x139b87);}export async function configUnset(_0x3bea3d,_0x1e9098){const _0x6fa831=_0x2fa313,_0x85dd9a={'qzAXC':function(_0x2616f1,_0x51659a){return _0x2616f1(_0x51659a);},'MLGQH':function(_0x4c0dfc,_0x5c9577){return _0x4c0dfc===_0x5c9577;},'qRqVx':function(_0x5e4fa){return _0x5e4fa();}},_0x4faf4c=await _0x85dd9a['qzAXC'](resolveProfileTarget,_0x3bea3d);if(_0x85dd9a['MLGQH'](_0x4faf4c[_0x6fa831(0xe1)],'cloud')){if(_0x4faf4c[_0x6fa831(0xf5)])_0x85dd9a[_0x6fa831(0x103)](printDualExistsHint,_0x3bea3d);const _0xf6f165=unsetProfileOverride(getProjectPath(),_0x3bea3d,_0x1e9098);_0xf6f165?console['log'](_0x6fa831(0xd7)+_0x1e9098+_0x6fa831(0xdc)+_0x3bea3d+'\x22'):console[_0x6fa831(0xe8)]('Key\x20\x22'+_0x1e9098+'\x22\x20not\x20found');return;}const _0x583411=unsetProfileOverride(_0x85dd9a[_0x6fa831(0xfd)](getProjectPath),_0x3bea3d,_0x1e9098);if(_0x583411){console[_0x6fa831(0xe8)](_0x6fa831(0xd7)+_0x1e9098);return;}const _0x916574=await loadSettings(_0x3bea3d),_0x2a88b5=deleteNestedValue(_0x916574,_0x1e9098);_0x2a88b5?console[_0x6fa831(0xe8)]('Key\x20\x22'+_0x1e9098+'\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22'+_0x3bea3d+'\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.'):console['log'](_0x6fa831(0x102)+_0x1e9098+_0x6fa831(0x10a));}export async function configReset(_0x500e85){const _0x423467=_0x2fa313,_0x13662f={'GTkoM':function(_0x13c22c,_0x243545){return _0x13c22c(_0x243545);},'VHKYe':function(_0x3adf00){return _0x3adf00();}},_0x272c54=await _0x13662f[_0x423467(0xe0)](resolveProfileTarget,_0x500e85);if(_0x272c54[_0x423467(0xe1)]===_0x423467(0xf3)){resetProfileOverrides(_0x13662f[_0x423467(0xed)](getProjectPath),_0x500e85),console['log']('Cleared\x20local\x20overrides\x20for\x20\x22'+_0x500e85+'\x22');return;}console['log']('\x22'+_0x500e85+_0x423467(0x101)+_0x500e85+_0x423467(0xea));}
|
|
1
|
+
const _0x7eba42=_0x4cf8;(function(_0x1ae65e,_0x3b7b1b){const _0x4e1717=_0x4cf8,_0x10b3b1=_0x1ae65e();while(!![]){try{const _0x199c58=-parseInt(_0x4e1717(0x106))/0x1+-parseInt(_0x4e1717(0xf2))/0x2*(-parseInt(_0x4e1717(0x103))/0x3)+parseInt(_0x4e1717(0x102))/0x4*(parseInt(_0x4e1717(0xfb))/0x5)+parseInt(_0x4e1717(0x10e))/0x6*(-parseInt(_0x4e1717(0xf8))/0x7)+parseInt(_0x4e1717(0xec))/0x8*(-parseInt(_0x4e1717(0x105))/0x9)+parseInt(_0x4e1717(0xfd))/0xa+parseInt(_0x4e1717(0xfc))/0xb;if(_0x199c58===_0x3b7b1b)break;else _0x10b3b1['push'](_0x10b3b1['shift']());}catch(_0x525cf1){_0x10b3b1['push'](_0x10b3b1['shift']());}}}(_0x23ea,0x9e53f));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',_0x7eba42(0x10c),'forceLogin'];function parseLocalValue(_0x17e9cc,_0x591b15){const _0x2b1ec1=_0x7eba42,_0x1e08b8={'ufLWH':'false'};if(BOOLEAN_KEYS[_0x2b1ec1(0x113)](_0x17e9cc)){if(_0x591b15===_0x2b1ec1(0xe8))return!![];if(_0x591b15===_0x1e08b8['ufLWH'])return![];throw new Error(_0x2b1ec1(0xe9)+_0x17e9cc+':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22');}return _0x591b15;}function parseOverrideValue(_0x3243e4){const _0x1c944b=_0x7eba42,_0x15b5a3={'yMOCg':function(_0x566b69,_0xeb2555){return _0x566b69===_0xeb2555;},'eTPJz':function(_0x4dba58,_0xc3aa62){return _0x4dba58===_0xc3aa62;},'wYuzS':_0x1c944b(0xee)};if(_0x3243e4===_0x1c944b(0xe8))return!![];if(_0x15b5a3['yMOCg'](_0x3243e4,'false'))return![];if(_0x15b5a3[_0x1c944b(0xf3)](_0x3243e4,'null'))return null;if(_0x3243e4===_0x15b5a3['wYuzS'])return undefined;if(/^-?\d+$/[_0x1c944b(0xf7)](_0x3243e4)){const _0x44fe66=Number(_0x3243e4);if(Number['isSafeInteger'](_0x44fe66))return _0x44fe66;}if(/^-?\d+\.\d+$/[_0x1c944b(0xf7)](_0x3243e4)){const _0x11b51f=Number(_0x3243e4);if(!Number[_0x1c944b(0xe7)](_0x11b51f))return _0x11b51f;}const _0x3e79df=_0x3243e4[_0x1c944b(0xef)]();if(_0x3e79df['startsWith']('{')&&_0x3e79df[_0x1c944b(0x10d)]('}')||_0x3e79df[_0x1c944b(0xff)]('[')&&_0x3e79df[_0x1c944b(0x10d)](']'))try{return JSON[_0x1c944b(0x104)](_0x3e79df);}catch{}return _0x3243e4;}async function resolveProfileTarget(_0x3f9a65){const _0x33775d={'edggX':function(_0x1c0c14,_0x4f428d){return _0x1c0c14(_0x4f428d);},'NOXGe':'local'},_0xd69969=existsSync(getEnvDir(_0x3f9a65));let _0x317e60=![];try{const _0x53b1f2=await fetchCloudProfile(_0x3f9a65);_0x317e60=_0x33775d['edggX'](Boolean,_0x53b1f2);}catch{}if(_0x317e60)return{'kind':'cloud','alsoExistsElsewhere':_0xd69969};if(_0xd69969)return{'kind':_0x33775d['NOXGe'],'alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x3f9a65+'\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'+_0x3f9a65);}function _0x4cf8(_0x5709e5,_0x4a4396){_0x5709e5=_0x5709e5-0xe6;const _0x23ea9a=_0x23ea();let _0x4cf8ca=_0x23ea9a[_0x5709e5];return _0x4cf8ca;}function printDualExistsHint(_0x33e0a1){const _0x5b6719=_0x7eba42;console['log'](_0x5b6719(0x101)+_0x33e0a1+'\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.');}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0xd55985){const _0x1610b7=_0x7eba42,_0x52a876={'hkosH':function(_0x43c8c0,_0x14866c){return _0x43c8c0(_0x14866c);},'mvrMs':function(_0x1800e9,_0x23c86a,_0x1f9719){return _0x1800e9(_0x23c86a,_0x1f9719);},'uktZb':function(_0x375dbc,_0x480e06){return _0x375dbc??_0x480e06;}},_0x15a663=await _0x52a876[_0x1610b7(0xf6)](fetchCloudProfile,_0xd55985),_0x3fe77a=readProfileOverrides(getProjectPath(),_0xd55985);return _0x52a876[_0x1610b7(0xf1)](mergeCloudProfileSettings,_0x15a663?.['settings']??{},_0x52a876[_0x1610b7(0x10b)](_0x3fe77a,undefined));}export async function configSet(_0x42bd46,_0x2e521f,_0x49adca){const _0x57c48b=_0x7eba42,_0x45f706={'wLhQo':function(_0x529332,_0x5b1558){return _0x529332(_0x5b1558);},'QZhpw':function(_0x1947da,_0x3debae){return _0x1947da===_0x3debae;},'OxBPS':function(_0xcef653,_0x859665,_0x5f25e9,_0x508e3b,_0x2e8e9c){return _0xcef653(_0x859665,_0x5f25e9,_0x508e3b,_0x2e8e9c);},'SwBsM':function(_0x2d836a){return _0x2d836a();},'cprXc':function(_0x44af85,_0x3630a4,_0x4760e0,_0x534402,_0xfdc802){return _0x44af85(_0x3630a4,_0x4760e0,_0x534402,_0xfdc802);},'MstSa':function(_0x163009){return _0x163009();}},_0x574783=await _0x45f706['wLhQo'](resolveProfileTarget,_0x42bd46);if(_0x45f706['QZhpw'](_0x574783['kind'],_0x57c48b(0x111))){if(_0x574783['alsoExistsElsewhere'])printDualExistsHint(_0x42bd46);const _0x16c7b6=parseOverrideValue(_0x49adca);_0x45f706[_0x57c48b(0x10f)](setProfileOverride,_0x45f706[_0x57c48b(0xe6)](getProjectPath),_0x42bd46,_0x2e521f,_0x16c7b6),console['log']('Set\x20'+_0x2e521f+_0x57c48b(0xf0)+JSON['stringify'](_0x16c7b6)+'\x20for\x20\x22'+_0x42bd46+'\x22');return;}const _0x2964ed=parseLocalValue(_0x2e521f,_0x49adca);_0x45f706[_0x57c48b(0xf9)](setProfileOverride,_0x45f706[_0x57c48b(0x110)](getProjectPath),_0x42bd46,_0x2e521f,_0x2964ed),console['log']('Set\x20'+_0x2e521f+_0x57c48b(0xf0)+_0x2964ed+_0x57c48b(0xea)+_0x42bd46+'\x22');}export async function configGet(_0x89661f,_0x23e30c){const _0x3d57ff=_0x7eba42,_0x3fa0f5={'kDKUp':function(_0x5ae269,_0x5ba055){return _0x5ae269(_0x5ba055);},'gKWnB':function(_0x1afecc,_0x8a91f4,_0x70ddae){return _0x1afecc(_0x8a91f4,_0x70ddae);},'rqirw':function(_0x5e700b,_0x4fa6a4){return _0x5e700b===_0x4fa6a4;}},_0x37c316=await _0x3fa0f5['kDKUp'](resolveProfileTarget,_0x89661f);if(_0x37c316['kind']===_0x3d57ff(0x111)){const _0x16c5be=await loadEffectiveCloudSettings(_0x89661f),_0x1bab36=_0x3fa0f5[_0x3d57ff(0xed)](getNestedValue,_0x16c5be,_0x23e30c);if(_0x3fa0f5['rqirw'](_0x1bab36,undefined))console['log']('(not\x20set)');else typeof _0x1bab36===_0x3d57ff(0xf4)?console[_0x3d57ff(0x108)](JSON['stringify'](_0x1bab36,null,0x2)):console['log'](_0x1bab36);return;}const _0x3f8ccf=await _0x3fa0f5[_0x3d57ff(0xf5)](loadSettings,_0x89661f),_0x4790a7=getNestedValue(_0x3f8ccf,_0x23e30c);if(_0x4790a7===undefined)console['log'](_0x3d57ff(0x100));else typeof _0x4790a7===_0x3d57ff(0xf4)?console['log'](JSON[_0x3d57ff(0x112)](_0x4790a7,null,0x2)):console[_0x3d57ff(0x108)](_0x4790a7);}export async function configList(_0x356718){const _0x23a09f=_0x7eba42,_0x166482={'VOiUM':function(_0x4b8268,_0x62e82f){return _0x4b8268(_0x62e82f);},'zkGkm':function(_0x1bea60,_0x4a3e8f){return _0x1bea60===_0x4a3e8f;}},_0x54ffb6=await _0x166482['VOiUM'](resolveProfileTarget,_0x356718);if(_0x166482['zkGkm'](_0x54ffb6[_0x23a09f(0xfe)],_0x23a09f(0x111))){const _0x5c63b6=await _0x166482['VOiUM'](loadEffectiveCloudSettings,_0x356718);if(!_0x5c63b6||_0x166482[_0x23a09f(0xeb)](Object['keys'](_0x5c63b6)['length'],0x0)){console[_0x23a09f(0x108)]('No\x20configuration\x20set\x20for\x20\x22'+_0x356718+'\x22');return;}console['log'](JSON[_0x23a09f(0x112)](_0x5c63b6,null,0x2));return;}const _0x2534af=_0x166482['VOiUM'](getSettingsPath,_0x356718);if(!existsSync(_0x2534af)){console[_0x23a09f(0x108)]('No\x20configuration\x20set\x20for\x20\x22'+_0x356718+'\x22');return;}const _0x34cd84=await _0x166482[_0x23a09f(0x107)](loadSettings,_0x356718),_0x22e9c1=formatSettings(_0x34cd84);!_0x22e9c1?console['log'](_0x23a09f(0x109)+_0x356718+'\x22'):console['log'](_0x22e9c1);}function _0x23ea(){const _0x48cf06=['Removed\x20','4273760PqXxTS','5254865QvnuhB','6637110HtbZXb','kind','startsWith','(not\x20set)','\x20\x20Note:\x20\x22','4jwpszK','183PfozfG','parse','108558yLzXoG','350786EjZlkX','VOiUM','log','No\x20configuration\x20set\x20for\x20\x22','\x20<key>\x22\x20to\x20remove\x20individual\x20values.','uktZb','allowInsecureLocalhost','endsWith','126EdCTnX','OxBPS','MstSa','cloud','stringify','includes','SwBsM','isNaN','true','Invalid\x20value\x20for\x20','\x20for\x20\x22','zkGkm','688RKhDao','gKWnB','undefined','trim','\x20=\x20','mvrMs','27988CSmNav','eTPJz','object','kDKUp','hkosH','test','271061lAwrBJ','cprXc'];_0x23ea=function(){return _0x48cf06;};return _0x23ea();}export async function configUnset(_0x23fa28,_0x12bcf4){const _0x47dfe9=_0x7eba42,_0x455fbd={'SwVXf':_0x47dfe9(0x111),'zyYDA':function(_0x242efb,_0x1bbe7b,_0x4afaa6,_0x4c21c1){return _0x242efb(_0x1bbe7b,_0x4afaa6,_0x4c21c1);}},_0x5600c8=await resolveProfileTarget(_0x23fa28);if(_0x5600c8['kind']===_0x455fbd['SwVXf']){if(_0x5600c8['alsoExistsElsewhere'])printDualExistsHint(_0x23fa28);const _0x4ea75d=_0x455fbd['zyYDA'](unsetProfileOverride,getProjectPath(),_0x23fa28,_0x12bcf4);_0x4ea75d?console[_0x47dfe9(0x108)](_0x47dfe9(0xfa)+_0x12bcf4+'\x20for\x20\x22'+_0x23fa28+'\x22'):console[_0x47dfe9(0x108)]('Key\x20\x22'+_0x12bcf4+'\x22\x20not\x20found');return;}const _0x4c00f7=unsetProfileOverride(getProjectPath(),_0x23fa28,_0x12bcf4);if(_0x4c00f7){console['log']('Removed\x20'+_0x12bcf4);return;}const _0x44c2b8=await loadSettings(_0x23fa28),_0x19417f=deleteNestedValue(_0x44c2b8,_0x12bcf4);_0x19417f?console['log']('Key\x20\x22'+_0x12bcf4+'\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22'+_0x23fa28+'\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.'):console[_0x47dfe9(0x108)]('Key\x20\x22'+_0x12bcf4+'\x22\x20not\x20found');}export async function configReset(_0x25b68e){const _0x198fe4=_0x7eba42,_0x39153e={'ChjIz':function(_0x28792e){return _0x28792e();}},_0xab25cb=await resolveProfileTarget(_0x25b68e);if(_0xab25cb['kind']==='cloud'){resetProfileOverrides(_0x39153e['ChjIz'](getProjectPath),_0x25b68e),console[_0x198fe4(0x108)]('Cleared\x20local\x20overrides\x20for\x20\x22'+_0x25b68e+'\x22');return;}console[_0x198fe4(0x108)]('\x22'+_0x25b68e+'\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20'+_0x25b68e+_0x198fe4(0x10a));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xdcd401,_0x32cd59){const _0x18afc1=_0xdac4,_0x40e615=_0xdcd401();while(!![]){try{const _0x2ccd15=-parseInt(_0x18afc1(0xa3))/0x1*(parseInt(_0x18afc1(0xab))/0x2)+-parseInt(_0x18afc1(0xad))/0x3+parseInt(_0x18afc1(0xa9))/0x4*(-parseInt(_0x18afc1(0x9d))/0x5)+-parseInt(_0x18afc1(0xaa))/0x6*(parseInt(_0x18afc1(0x9c))/0x7)+-parseInt(_0x18afc1(0x9f))/0x8+parseInt(_0x18afc1(0xa0))/0x9*(parseInt(_0x18afc1(0xa2))/0xa)+parseInt(_0x18afc1(0xa6))/0xb*(parseInt(_0x18afc1(0xa4))/0xc);if(_0x2ccd15===_0x32cd59)break;else _0x40e615['push'](_0x40e615['shift']());}catch(_0x4cb03c){_0x40e615['push'](_0x40e615['shift']());}}}(_0x19e7,0xea9a1));function _0x19e7(){const _0x31123c=['Profile\x20deletion\x20requires\x20an\x20interactive\x20terminal\x20so\x20the\x20profile\x20name\x20can\x20be\x20typed\x20for\x20confirmation.\x20Pass\x20--yes\x20to\x20skip\x20confirmation.','Type\x20\x22','16gGRBXQ','5442rxIgDl','2040ZYlvBq','cwd','5187963wGNpml','\x22\x20not\x20found.','log','8659lJhzio','953480NdYvKh','bhoZV','13666904KFcxKB','4014324YMqzrI','\x22\x20for\x20everyone\x20in\x20your\x20organization.','10ufAwtG','1727BOggxF','12zcIzIb','\x22\x20to\x20confirm\x20deletion:','83587460REeOCZ'];_0x19e7=function(){return _0x31123c;};return _0x19e7();}import _0x122080 from'inquirer';import{deleteCloudProfile,fetchCloudProfile}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';function _0xdac4(_0x540e63,_0x4bc40f){_0x540e63=_0x540e63-0x9a;const _0x19e75a=_0x19e7();let _0xdac48=_0x19e75a[_0x540e63];return _0xdac48;}import{clearLastProfile,resetProfileOverrides}from'./utils/projectsConfig.js';export async function deleteProfile(_0x91b87c,_0x58365e={}){const _0xc009aa=_0xdac4,_0x1cf3c1={'Rjicl':_0xc009aa(0xa7),'bhoZV':'confirmation','PQswg':function(_0x21bb3c,_0x3b715a,_0x1f26c6){return _0x21bb3c(_0x3b715a,_0x1f26c6);}},_0x2da840=await fetchCloudProfile(_0x91b87c);if(!_0x2da840)throw new Error('Cloud\x20profile\x20\x22'+_0x91b87c+_0xc009aa(0x9a));if(!_0x58365e['yes']&&!isInteractive())throw new Error(_0x1cf3c1['Rjicl']);console['log']('\x0aWarning:\x20this\x20deletes\x20the\x20shared\x20cloud\x20profile\x20\x22'+_0x91b87c+_0xc009aa(0xa1));if(!_0x58365e['yes']){const {confirmation:_0x1be421}=await _0x122080['prompt']([{'type':'input','name':_0x1cf3c1[_0xc009aa(0x9e)],'message':_0xc009aa(0xa8)+_0x91b87c+_0xc009aa(0xa5)}]);if(_0x1be421!==_0x91b87c)throw new Error('Profile\x20deletion\x20cancelled:\x20confirmation\x20did\x20not\x20match.');}await deleteCloudProfile(_0x91b87c),resetProfileOverrides(process['cwd'](),_0x91b87c),_0x1cf3c1['PQswg'](clearLastProfile,process[_0xc009aa(0xac)](),_0x91b87c),console[_0xc009aa(0x9b)]('✓\x20Deleted\x20cloud\x20profile\x20\x22'+_0x91b87c+'\x22.');}
|
package/build/commands/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x28c6b0=_0x10e5;(function(_0x57ffa1,_0x1190ab){const _0x1c77e6=_0x10e5,_0x4d965e=_0x57ffa1();while(!![]){try{const _0x2c03e2=-parseInt(_0x1c77e6(0x199))/0x1*(-parseInt(_0x1c77e6(0x18a))/0x2)+-parseInt(_0x1c77e6(0x1a4))/0x3+-parseInt(_0x1c77e6(0x19d))/0x4*(-parseInt(_0x1c77e6(0x1ae))/0x5)+-parseInt(_0x1c77e6(0x189))/0x6+parseInt(_0x1c77e6(0x1ac))/0x7+-parseInt(_0x1c77e6(0x192))/0x8+parseInt(_0x1c77e6(0x1a7))/0x9*(parseInt(_0x1c77e6(0x1a5))/0xa);if(_0x2c03e2===_0x1190ab)break;else _0x4d965e['push'](_0x4d965e['shift']());}catch(_0x22ba66){_0x4d965e['push'](_0x4d965e['shift']());}}}(_0x6e66,0x44a3a));import{readdir,stat}from'fs/promises';function _0x6e66(){const _0x5bbef0=['7034PQdMcz','message','name','\x0aCloud\x20Profiles:','PmGyO','\x20\x20\x20\x20\x20\x20URL:\x20','\x20[cloud]','isDirectory','3642144PqvBWr','WoDqZ','\x0aNo\x20profiles\x20found.','includes','jsLjk','.txt','KudJn','50ZuGXNW','\x20\x20\x20\x20\x20\x20Session:\x20','\x20\x20\x20\x20\x20\x20Details:\x20','legacy','195988nfKNrA','baseUrl','Run:\x20ranger\x20profile\x20add\x20<profile-name>','length','startsWith','OfkSL','reports','1213239oDDuhG','35770LqIvvP','sort','1710OklLUX','eMCev','local','BAJhv','no\x20session','765044rilRXf','has','45kXJbYe','\x0a*\x20=\x20active\x20profile','push','log','environmentDetails','1589508YbJfXO'];_0x6e66=function(){return _0x5bbef0;};return _0x6e66();}import{join}from'path';function _0x10e5(_0x4083f6,_0x5aebfd){_0x4083f6=_0x4083f6-0x189;const _0x6e667d=_0x6e66();let _0x10e57b=_0x6e667d[_0x4083f6];return _0x10e57b;}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';const NON_ENV_DIRS=['sessions','bug-bashes',_0x28c6b0(0x1a3),_0x28c6b0(0x1a9),'ci'];export async function getEnvNames(){const _0x58ab55=_0x28c6b0,_0x234bfd={'eMCev':function(_0x1eefa7,_0x211193){return _0x1eefa7(_0x211193);},'jsLjk':'local','OJHIG':function(_0x11fa13,_0x567618,_0x2306b1){return _0x11fa13(_0x567618,_0x2306b1);},'mzHUP':function(_0x55bbd8,_0x52cfce){return _0x55bbd8(_0x52cfce);},'DyJCz':function(_0x277319,_0x1bea77){return _0x277319(_0x1bea77);},'WoDqZ':function(_0x46b996,_0x246ee7){return _0x46b996(_0x246ee7);},'AkPwq':_0x58ab55(0x197),'BAJhv':function(_0x17ac30,_0x22d5fd,_0x24e53a){return _0x17ac30(_0x22d5fd,_0x24e53a);},'OfkSL':'settings.json'},_0x4d0f93=getRangerDir();if(!_0x234bfd[_0x58ab55(0x1a8)](existsSync,_0x4d0f93))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x1ca217=await readActiveProfileName(),_0x39f1c0=[],_0x529dd9={},_0x3c7f23=join(_0x4d0f93,_0x234bfd[_0x58ab55(0x196)]);if(_0x234bfd[_0x58ab55(0x1a8)](existsSync,_0x3c7f23)){const _0x489e53=await readdir(_0x3c7f23);for(const _0x1b2c19 of _0x489e53){const _0x538a1a=_0x234bfd['OJHIG'](join,_0x3c7f23,_0x1b2c19),_0x588138=await _0x234bfd[_0x58ab55(0x1a8)](stat,_0x538a1a);_0x588138['isDirectory']()&&(_0x39f1c0['push'](_0x1b2c19),_0x529dd9[_0x1b2c19]=_0x234bfd[_0x58ab55(0x196)]);}}const _0x281ae7=join(_0x4d0f93,'ci');if(_0x234bfd['mzHUP'](existsSync,_0x281ae7)){const _0x2823e1=await _0x234bfd['eMCev'](readdir,_0x281ae7);for(const _0x3fdad8 of _0x2823e1){const _0x21b4b8=_0x234bfd['OJHIG'](join,_0x281ae7,_0x3fdad8),_0x171f44=await _0x234bfd['DyJCz'](stat,_0x21b4b8);_0x171f44['isDirectory']()&&(_0x39f1c0[_0x58ab55(0x1b0)](_0x3fdad8),_0x529dd9[_0x3fdad8]='ci');}}const _0x5c85f5=await _0x234bfd[_0x58ab55(0x193)](readdir,_0x4d0f93);for(const _0x3ba1d3 of _0x5c85f5){if(NON_ENV_DIRS[_0x58ab55(0x195)](_0x3ba1d3))continue;if(_0x3ba1d3[_0x58ab55(0x1a1)]('.'))continue;if(_0x3ba1d3['endsWith'](_0x234bfd['AkPwq']))continue;const _0x5b284b=_0x234bfd[_0x58ab55(0x1aa)](join,_0x4d0f93,_0x3ba1d3),_0x181f47=await stat(_0x5b284b);_0x181f47[_0x58ab55(0x191)]()&&existsSync(_0x234bfd[_0x58ab55(0x1aa)](join,_0x5b284b,_0x234bfd[_0x58ab55(0x1a2)]))&&(!_0x39f1c0['includes'](_0x3ba1d3)&&(_0x39f1c0['push'](_0x3ba1d3),_0x529dd9[_0x3ba1d3]=_0x58ab55(0x19c)));}return{'envNames':_0x39f1c0,'activeEnv':_0x1ca217,'envTypes':_0x529dd9};}export async function envList(){const _0x606aeb=_0x28c6b0,_0x33d42d={'PmGyO':function(_0x170393,_0x20d782){return _0x170393===_0x20d782;},'cVNDZ':_0x606aeb(0x19f),'KudJn':'\x0aLocal\x20Profiles\x20(legacy):','fZRuX':function(_0x56bdad,_0x37e199){return _0x56bdad===_0x37e199;},'TCtYT':_0x606aeb(0x1a9),'hnDmh':function(_0x518482,_0x3702b6){return _0x518482>_0x3702b6;},'oMBEh':_0x606aeb(0x1ab)},{envNames:_0x4f927a,activeEnv:_0x40581f,envTypes:_0x5db72f}=await getEnvNames();let _0x37d9c8=[];const _0x106635=await getToken();if(_0x106635)try{_0x37d9c8=await listCloudProfiles();}catch(_0x110357){console['error']('\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profiles:\x20'+(_0x110357 instanceof Error?_0x110357[_0x606aeb(0x18b)]:String(_0x110357)));}if(_0x4f927a[_0x606aeb(0x1a0)]===0x0&&_0x33d42d[_0x606aeb(0x18e)](_0x37d9c8['length'],0x0)){console['log'](_0x606aeb(0x194)),console['log'](_0x33d42d['cVNDZ']);return;}const _0x52f0cf=new Set(_0x37d9c8['map'](_0x5c172a=>_0x5c172a[_0x606aeb(0x18c)]));if(_0x4f927a[_0x606aeb(0x1a0)]>0x0){console[_0x606aeb(0x1b1)](_0x33d42d[_0x606aeb(0x198)]);for(const _0x501953 of _0x4f927a[_0x606aeb(0x1a6)]()){const _0x490398=_0x33d42d['fZRuX'](_0x501953,_0x40581f)&&!_0x52f0cf[_0x606aeb(0x1ad)](_0x501953),_0x27e7d0=_0x5db72f[_0x501953]||_0x33d42d['TCtYT'],_0x1cb9e5=await loadSettings(_0x501953),_0x2f4b93=_0x27e7d0==='legacy'?'':'\x20['+_0x27e7d0+']';console[_0x606aeb(0x1b1)]('\x20\x20'+(_0x490398?'*\x20':'\x20\x20')+_0x501953+_0x2f4b93),_0x1cb9e5[_0x606aeb(0x19e)]&&console['log'](_0x606aeb(0x18f)+_0x1cb9e5['baseUrl']),_0x1cb9e5['environmentDetails']&&console[_0x606aeb(0x1b1)](_0x606aeb(0x19b)+_0x1cb9e5[_0x606aeb(0x1b2)]);}}if(_0x33d42d['hnDmh'](_0x37d9c8['length'],0x0)){console['log'](_0x606aeb(0x18d));for(const _0x341607 of _0x37d9c8[_0x606aeb(0x1a6)]((_0x524696,_0x1fbd54)=>_0x524696['name']['localeCompare'](_0x1fbd54[_0x606aeb(0x18c)]))){const _0x376a93=_0x33d42d[_0x606aeb(0x18e)](_0x341607['name'],_0x40581f),_0x2286ab=_0x341607['environmentKey']?'\x20('+_0x341607['environmentKey']+')':'',_0x18727d=_0x341607['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x341607['sessionUpdatedAt']+')':_0x33d42d['oMBEh'];console['log']('\x20\x20'+(_0x376a93?'*\x20':'\x20\x20')+_0x341607['name']+_0x606aeb(0x190)+_0x2286ab),console['log'](_0x606aeb(0x19a)+_0x18727d);}}_0x40581f&&console[_0x606aeb(0x1b1)](_0x606aeb(0x1af));}
|