@ranger-testing/ranger-cli 3.1.4-alpha.fb796e7-45 → 3.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/novaActCli.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/organizationEnvApi.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/rangerwrightCli.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/scenarioOriginCheck.js +1 -0
- 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 +1 -1
package/build/commands/addEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x1c611c=_0x50a7;(function(_0x55444,_0x1a52d5){const _0x43937b=_0x50a7,_0x56a93c=_0x55444();while(!![]){try{const _0x276ab6=-parseInt(_0x43937b(0xe5))/0x1*(parseInt(_0x43937b(0xd0))/0x2)+parseInt(_0x43937b(0xf3))/0x3*(parseInt(_0x43937b(0xfd))/0x4)+-parseInt(_0x43937b(0xe7))/0x5*(-parseInt(_0x43937b(0xc0))/0x6)+parseInt(_0x43937b(0xcf))/0x7+-parseInt(_0x43937b(0xf6))/0x8+-parseInt(_0x43937b(0xf5))/0x9*(parseInt(_0x43937b(0xc1))/0xa)+-parseInt(_0x43937b(0x128))/0xb*(-parseInt(_0x43937b(0xb9))/0xc);if(_0x276ab6===_0x1a52d5)break;else _0x56a93c['push'](_0x56a93c['shift']());}catch(_0x389496){_0x56a93c['push'](_0x56a93c['shift']());}}}(_0x5ee3,0x32f0a));import{readdir,rm}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x471a2b 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';function _0x5ee3(){const _0x17b74e=['cdpEndpoint','domains','isTTY','profile.add.autoRouteSkipped','\x27\x20to\x20the\x20cloud?','skipAuth','ZfUeo','HbMoK','VfRAO','Pvyns','IfdFF','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','\x20--url\x20','profile.add.autoRouted','signal','message','\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a','2651snkRWw','This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization','pOgUI','includes','OHIvW','OXoie','\x20\x20Set\x20active\x20profile:\x20','keys','\x22.\x20Expected\x20\x22Name:\x20Value\x22.','setupHeader','HEAD','zsxgt','indexOf','27156RMlsEv','KkBDu','oGthY','no_auth_config','action','continue','status','442044mPnfPH','20vYwcUG','origin','OqzOp','Invalid\x20--setup-header\x20format:\x20\x22',')\x0a\x20\x20Save\x20\x27','input','yes','length','force','EgcbW','gRFzG','osOYm','\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20','cwd','748643SjNnUE','28LmMnUR','\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.','fcMtK','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','test','\x27\x20matching\x20','To\x20set\x20up\x20a\x20profile,\x20run:\x0a','\x0a\x20\x20Still\x20could\x20not\x20reach\x20','isElectron','\x0a\x20\x20Could\x20not\x20reach\x20','HTmqJ','QlWpZ','wKnzz','error','Found\x20auth\x20environment\x20\x27','fiaFy','setupHeaders','✓\x20Profile\x20\x27','xFkZp','.\x20Configured\x20envs:\x20','env','10357mwZOrp','retry','10WqjUVi','trackPhaseEnd','VrhTg','JXlJs','\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','\x20\x20https://docs.ranger.net/main/concepts/profiles','\x0a\x20\x20A\x20profile\x20named\x20\x22','mcteK','ZryKm','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','join','qlHOs','324195kUHkXC','list','1195191uuitzC','2307992lLhJNI','\x20\x20Next:\x20ranger\x20go\x20--profile\x20','http://localhost:3000','url','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','KICcz','prompt','4mXLePm','baseUrl','TypeError','jPqNu','Could\x20not\x20reach\x20','Continue\x20anyway','UyUaR','log','\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22','local','✓\x20Cloud\x20profile\x20\x27','sJNPv','zAvbQ','NODE_TLS_REJECT_UNAUTHORIZED','environments','NNoVk','Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','user_declined','\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a','\x27\x20created\x20(no\x20session).\x0a','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','trim','warn','slice','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','ZTbJi'];_0x5ee3=function(){return _0x17b74e;};return _0x5ee3();}const CLOUD_PROFILE_SHARING_WARNING=_0x1c611c(0x129);function warnCloudProfileSharedInOrg(){const _0x3b6273=_0x1c611c;if(!process['stdout'][_0x3b6273(0x119)])return;console[_0x3b6273(0x113)](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x3d13af){const _0x10a114=_0x1c611c,_0x52ba33={'SxXCB':function(_0x15eb73,_0x294326,_0xc60753){return _0x15eb73(_0x294326,_0xc60753);},'rFDsp':_0x10a114(0xb6),'HTmqJ':function(_0x2cc892,_0xb5d0af){return _0x2cc892<_0xb5d0af;},'pOgUI':function(_0x109ef4,_0x35edb8){return _0x109ef4===_0x35edb8;},'QDOfv':_0x10a114(0xff)};try{const _0x1158a2=new AbortController(),_0x1fe3a4=_0x52ba33['SxXCB'](setTimeout,()=>_0x1158a2['abort'](),0x1388),_0x206c86={'method':_0x52ba33['rFDsp'],'signal':_0x1158a2[_0x10a114(0x125)],'redirect':'manual'};/^https:\/\/localhost(:\d+)?/i[_0x10a114(0xd4)](_0x3d13af)&&(process['env'][_0x10a114(0x10a)]='0');const _0x3d5a1b=await fetch(_0x3d13af,_0x206c86);delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'],clearTimeout(_0x1fe3a4);if(_0x52ba33[_0x10a114(0xda)](_0x3d5a1b['status'],0x190))return{'ok':!![]};return{'ok':![],'error':'HTTP\x20'+_0x3d5a1b['status']};}catch(_0x2b4e3c){delete process[_0x10a114(0xe4)][_0x10a114(0x10a)];const _0x42eae8=_0x2b4e3c,_0x22fe7b=_0x42eae8['message']||String(_0x2b4e3c),_0x1b1c3f=_0x22fe7b[_0x10a114(0x12b)]('Invalid\x20URL')||_0x52ba33[_0x10a114(0x12a)](_0x42eae8['name'],_0x52ba33['QDOfv'])||_0x22fe7b['includes']('fetch\x20failed');return{'ok':![],'error':_0x22fe7b,'isProtocolError':_0x1b1c3f};}}async function sweepOrphanLocalProfile(_0x17ac67,_0x4ca641,_0x22c31a){const _0x5d686c=_0x1c611c,_0x23be95={'pFhvf':_0x5d686c(0x106),'sJNPv':function(_0x1d1c01,_0x4dfd6d,_0x5722d7){return _0x1d1c01(_0x4dfd6d,_0x5722d7);},'eYiZG':function(_0x2ccf46,_0x34f631){return _0x2ccf46(_0x34f631);},'zzDWg':function(_0x26c503,_0x3a825b,_0x57848f){return _0x26c503(_0x3a825b,_0x57848f);},'FiNRX':function(_0x300b53,_0x239509){return _0x300b53(_0x239509);}},_0x183fe4=join(_0x4ca641,_0x23be95['pFhvf']),_0x17210b=_0x23be95[_0x5d686c(0x108)](join,_0x183fe4,_0x17ac67);_0x23be95['eYiZG'](existsSync,_0x17210b)&&(_0x22c31a&&await isPathGitTracked(_0x17210b)?console['log']('\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20'+_0x17210b+'\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.'):(await _0x23be95['zzDWg'](rm,_0x17210b,{'recursive':!![],'force':!![]}),console['log']('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0x17210b)));if(existsSync(_0x183fe4)){let _0x36812e=[];try{_0x36812e=await _0x23be95['FiNRX'](readdir,_0x183fe4);}catch{return;}const _0x5d1b54='.tmp-'+_0x17ac67+'-';for(const _0x5f1285 of _0x36812e){if(!_0x5f1285['startsWith'](_0x5d1b54))continue;const _0x3b4273=join(_0x183fe4,_0x5f1285);await _0x23be95['sJNPv'](rm,_0x3b4273,{'recursive':!![],'force':!![]}),console[_0x5d686c(0x104)](_0x5d686c(0xd3)+_0x3b4273);}}}async function sweepOrphansBestEffort(_0x378037){const _0x42749c={'oCFed':function(_0x19a58a,_0x58814e,_0x520c18,_0x2a5cd0){return _0x19a58a(_0x58814e,_0x520c18,_0x2a5cd0);},'sqsoj':function(_0xc76596){return _0xc76596();},'hJDuK':function(_0xe17a21,_0x66a3e5,_0x5248f3,_0x5abb05){return _0xe17a21(_0x66a3e5,_0x5248f3,_0x5abb05);},'MWFHP':function(_0x3c6a83,_0x117e12){return _0x3c6a83(_0x117e12);}};try{await _0x42749c['oCFed'](sweepOrphanLocalProfile,_0x378037,_0x42749c['sqsoj'](getRangerHomeDir),![]);const _0x139c9d=getRangerDir();_0x139c9d!==getRangerHomeDir()&&await _0x42749c['hJDuK'](sweepOrphanLocalProfile,_0x378037,_0x139c9d,!![]);}catch(_0x6742b5){console['log']('\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20('+(_0x6742b5 instanceof Error?_0x6742b5['message']:_0x42749c['MWFHP'](String,_0x6742b5))+').');}}async function markActive(_0x1dee8c){const _0x4b6164=_0x1c611c,_0x5304bb={'IfdFF':'Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.'};try{await writeActiveProfileName(_0x1dee8c),console['log'](_0x4b6164(0xb2)+_0x1dee8c);}catch{console['log'](_0x5304bb[_0x4b6164(0x121)]);}}function _0x50a7(_0x4400c1,_0xebb5b2){_0x4400c1=_0x4400c1-0xb1;const _0x5ee30c=_0x5ee3();let _0x50a7bc=_0x5ee30c[_0x4400c1];return _0x50a7bc;}async function tryAutoRouteCloudProfile(_0x54802a,_0x24c65e,_0x29c90c,_0x34fd7f,_0x4cc5a1){const _0x46f46e=_0x1c611c,_0x4698c3={'zAvbQ':function(_0x6b66af){return _0x6b66af();},'fcMtK':function(_0x1d3006,_0x31d5ad){return _0x1d3006(_0x31d5ad);},'OqzOp':function(_0x573b66,_0x17c413){return _0x573b66===_0x17c413;},'Pvyns':function(_0x57f72b,_0x12d4ee){return _0x57f72b+_0x12d4ee;},'zsxgt':function(_0x44a7b,_0x2d1696){return _0x44a7b+_0x2d1696;},'bRZfU':function(_0x4bcdf2,_0x52af03){return _0x4bcdf2+_0x52af03;},'QlWpZ':function(_0x4be7b8,_0x545a41){return _0x4be7b8+_0x545a41;},'KkBDu':'\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','yaojt':'\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a','jPqNu':_0x46f46e(0x127),'wwIgK':'\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','NlntW':'confirm','ukiXM':'user_declined','ANjle':function(_0x1de93a,_0x3c6f8f,_0x4dff75,_0x3a1fe6){return _0x1de93a(_0x3c6f8f,_0x4dff75,_0x3a1fe6);},'mLbgl':function(_0x1dcbe6,_0x177dd9){return _0x1dcbe6 instanceof _0x177dd9;},'RYWEq':function(_0x5b3a7a,_0x18135b){return _0x5b3a7a(_0x18135b);}};let _0x8c302e;try{_0x8c302e=await _0x4698c3['zAvbQ'](fetchAuthConfig);}catch(_0x395503){return _0x4cc5a1?.['trackPhaseEnd'](_0x46f46e(0x11a),{'reason':_0x46f46e(0xbc),'profileName':_0x54802a}),console['error'](_0x46f46e(0xcd)+(_0x395503 instanceof Error?_0x395503[_0x46f46e(0x126)]:_0x4698c3[_0x46f46e(0xd2)](String,_0x395503))),![];}if(!_0x8c302e||!_0x8c302e['environments']||_0x4698c3[_0x46f46e(0xc3)](Object[_0x46f46e(0xb3)](_0x8c302e['environments'])['length'],0x0)){if(_0x34fd7f)return await captureEnvLessProfile(_0x54802a,_0x24c65e,_0x29c90c,_0x4cc5a1);return _0x4cc5a1?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':_0x46f46e(0xbc),'profileName':_0x54802a}),console[_0x46f46e(0xdd)](_0x4698c3[_0x46f46e(0x120)](_0x4698c3['Pvyns'](_0x4698c3[_0x46f46e(0x120)](_0x4698c3[_0x46f46e(0xb7)](_0x4698c3['bRZfU'](_0x4698c3[_0x46f46e(0xdb)](_0x4698c3[_0x46f46e(0xba)],'\x0a'),_0x4698c3['yaojt']),'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20'+_0x54802a+_0x46f46e(0x123)+_0x24c65e+'\x20--skip-auth\x0a'),'\x0a'),_0x4698c3[_0x46f46e(0x100)]),_0x4698c3['wwIgK'])),![];}const _0x990be7=matchAuthEnvironment(_0x24c65e,_0x8c302e);if(!_0x990be7)return _0x4cc5a1?.[_0x46f46e(0xe8)](_0x46f46e(0x11a),{'reason':'no_match','profileName':_0x54802a}),console[_0x46f46e(0xdd)]('\x0a\x20\x20No\x20auth\x20env\x20matches\x20'+_0x24c65e+_0x46f46e(0xe3)+Object[_0x46f46e(0xb3)](_0x8c302e[_0x46f46e(0x10b)])[_0x46f46e(0xf1)](',\x20')+'.'),![];const _0x456ac7=_0x8c302e['environments'][_0x990be7],_0xd91488=_0x456ac7?.[_0x46f46e(0x118)]??[];if(_0x34fd7f&&!_0x29c90c['yes']){const {saveToCloud:_0x10936}=await _0x471a2b[_0x46f46e(0xfc)]([{'type':_0x4698c3['NlntW'],'name':'saveToCloud','message':_0x46f46e(0xde)+_0x990be7+_0x46f46e(0xd5)+_0x24c65e+'\x0a\x20\x20(domains:\x20'+_0xd91488['join'](',\x20')+_0x46f46e(0xc5)+_0x54802a+_0x46f46e(0x11b),'default':!![]}]);if(!_0x10936)return _0x4cc5a1?.[_0x46f46e(0xe8)](_0x46f46e(0x11a),{'reason':_0x4698c3['ukiXM'],'profileName':_0x54802a}),console['error']('\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.'),![];}const _0x417f4b=_0xd91488['some'](_0x1f1a96=>{const _0x26e96d=_0x46f46e;try{return new URL(_0x1f1a96)[_0x26e96d(0xc2)]===new URL(_0x24c65e)[_0x26e96d(0xc2)];}catch{return![];}}),_0x50f7cb={};!_0x417f4b&&(_0x50f7cb['baseUrl']=_0x24c65e);try{await _0x4698c3['ANjle'](createCloudProfile,_0x54802a,_0x990be7,{'settings':_0x50f7cb}),_0x4698c3[_0x46f46e(0x109)](warnCloudProfileSharedInOrg);}catch(_0x51ba95){if(_0x4698c3['mLbgl'](_0x51ba95,ApiError)&&_0x51ba95['status']===0x199){console['error'](_0x4698c3[_0x46f46e(0xb7)](_0x46f46e(0xed)+_0x54802a+_0x46f46e(0x122),'\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x54802a));throw _0x51ba95;}throw _0x51ba95;}return console['log']('✓\x20Profile\x20\x27'+_0x54802a+'\x27\x20created.\x0a'+(_0x46f46e(0xf7)+_0x54802a)),await _0x4698c3['RYWEq'](sweepOrphansBestEffort,_0x54802a),_0x4cc5a1?.['trackPhaseEnd']('profile.add.autoRouted',{'envKey':_0x990be7,'profileName':_0x54802a}),!![];}async function createUnconfiguredCloudProfile(_0x1b3e83,_0x5f4ab4){const _0x4f363d=_0x1c611c,_0x40f9c3={'NesYf':function(_0x283daf){return _0x283daf();}};try{await createCloudProfile(_0x1b3e83,undefined,{'settings':_0x5f4ab4}),_0x40f9c3['NesYf'](warnCloudProfileSharedInOrg);}catch(_0x5e9edb){_0x5e9edb instanceof ApiError&&_0x5e9edb['status']===0x199&&console['error'](_0x4f363d(0xed)+_0x1b3e83+_0x4f363d(0x122)+(_0x4f363d(0xfa)+_0x1b3e83));throw _0x5e9edb;}}async function captureEnvLessProfile(_0x3b8599,_0x15f367,_0x5d70cd,_0x3aa0cf){const _0xefd1ae=_0x1c611c,_0x4c038d={'yzSAF':'confirm','oGthY':'capture','ZryKm':_0xefd1ae(0x10d),'JXlJs':'profile.add.autoRouteSkipped','ZTbJi':function(_0x5b27d9,_0x19d8b2){return _0x5b27d9===_0x19d8b2;},'aippH':function(_0x29ad53,_0x2b0536){return _0x29ad53===_0x2b0536;},'qMcda':function(_0x1403a0,_0x1587db){return _0x1403a0+_0x1587db;},'tHshZ':function(_0x6578fb,_0x2ceae0){return _0x6578fb>_0x2ceae0;},'HgUgw':_0xefd1ae(0x124)};if(!_0x5d70cd[_0xefd1ae(0xc7)]){const {capture:_0x2a36ec}=await _0x471a2b[_0xefd1ae(0xfc)]([{'type':_0x4c038d['yzSAF'],'name':_0x4c038d[_0xefd1ae(0xbb)],'message':_0x4c038d[_0xefd1ae(0xef)],'default':!![]}]);if(!_0x2a36ec)return _0x3aa0cf?.[_0xefd1ae(0xe8)](_0x4c038d[_0xefd1ae(0xea)],{'reason':_0xefd1ae(0x10e),'profileName':_0x3b8599}),console['error'](_0xefd1ae(0x10f)+_0xefd1ae(0xd1)),![];}const _0x2a4887={};if(_0x5d70cd['setupHeader'])for(const _0x30306f of _0x5d70cd['setupHeader']){const _0x563eed=_0x30306f[_0xefd1ae(0xb8)](':');if(_0x4c038d[_0xefd1ae(0x116)](_0x563eed,-0x1))continue;_0x2a4887[_0x30306f['slice'](0x0,_0x563eed)['trim']()]=_0x30306f['slice'](_0x563eed+0x1)['trim']();}const _0x349147={'baseUrl':_0x15f367};Object['keys'](_0x2a4887)[_0xefd1ae(0xc8)]>0x0&&(_0x349147[_0xefd1ae(0xe0)]=_0x2a4887);let _0x4466a2;try{_0x4466a2=await createCloudProfile(_0x3b8599,undefined,{'settings':_0x349147}),warnCloudProfileSharedInOrg();}catch(_0x398dd4){_0x398dd4 instanceof ApiError&&_0x4c038d['aippH'](_0x398dd4[_0xefd1ae(0xbf)],0x199)&&console['error'](_0x4c038d['qMcda'](_0xefd1ae(0xed)+_0x3b8599+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20'+_0x3b8599));throw _0x398dd4;}return await manualBrowserLogin(_0x4466a2,{'key':'','domains':[_0x15f367],'setupHeaders':_0x4c038d['tHshZ'](Object[_0xefd1ae(0xb3)](_0x2a4887)['length'],0x0)?_0x2a4887:undefined}),console['log']('\x0a✓\x20Profile\x20\x27'+_0x3b8599+'\x27\x20created\x20with\x20a\x20captured\x20session.\x0a'+(_0xefd1ae(0xf7)+_0x3b8599)),await sweepOrphansBestEffort(_0x3b8599),_0x3aa0cf?.[_0xefd1ae(0xe8)](_0x4c038d['HgUgw'],{'envKey':null,'profileName':_0x3b8599}),!![];}export async function addEnv(_0x2556d3,_0x4bc6c6={},_0x3e8684){const _0x20e68e=_0x1c611c,_0x40e98b={'KICcz':function(_0x5549ca,_0x293cbc){return _0x5549ca+_0x293cbc;},'qlHOs':function(_0x51f4bd,_0x17f467){return _0x51f4bd+_0x17f467;},'ZfUeo':'The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a','YnPPp':'for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a','VfRAO':_0x20e68e(0xd6),'osOYm':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','UyUaR':function(_0x5461c4,_0x5f4901){return _0x5461c4!==_0x5f4901;},'OXoie':'--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','xlmeJ':'--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','VrhTg':function(_0x1418e8,_0x37af7a){return _0x1418e8(_0x37af7a);},'XJVEP':function(_0x45b94f){return _0x45b94f();},'HbMoK':function(_0x586e31,_0x511a51,_0x3d34d0){return _0x586e31(_0x511a51,_0x3d34d0);},'NNoVk':function(_0x245516,_0x1e4662,_0x60a8ad,_0xc91b54,_0x4cc5a6){return _0x245516(_0x1e4662,_0x60a8ad,_0xc91b54,_0x4cc5a6);},'DocJR':_0x20e68e(0x117),'EgcbW':_0x20e68e(0xd8),'xFkZp':function(_0x476a7a,_0x13466d){return _0x476a7a instanceof _0x13466d;},'KfesU':function(_0x1c7073,_0x3fa1d1){return _0x1c7073(_0x3fa1d1);},'fiaFy':function(_0x41493f,_0x63f4cc){return _0x41493f(_0x63f4cc);},'qmVmp':'\x0a🌐\x20Profile\x20Setup\x0a','kpOms':_0x20e68e(0xc6),'OHIvW':'What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','UYprH':function(_0x2479fb,_0x5c87b9){return _0x2479fb||_0x5c87b9;},'gRFzG':function(_0xcb145b,_0x387035){return _0xcb145b(_0x387035);},'VJoFr':_0x20e68e(0xf4),'wKnzz':_0x20e68e(0xbd),'OEyQI':'What\x20would\x20you\x20like\x20to\x20do?','mcteK':'use_suggestion','eRMXm':'Enter\x20a\x20different\x20URL','aCfvJ':function(_0x136cf0,_0x129052){return _0x136cf0===_0x129052;},'GTcPB':_0x20e68e(0xbe),'DZBFl':function(_0x3a7994,_0x30c41a,_0x536235,_0x215c04,_0x218d83,_0x57b457){return _0x3a7994(_0x30c41a,_0x536235,_0x215c04,_0x218d83,_0x57b457);}};_0x4bc6c6['ci']&&(console[_0x20e68e(0xdd)](_0x40e98b[_0x20e68e(0xfb)](_0x40e98b[_0x20e68e(0xf2)](_0x40e98b[_0x20e68e(0x11d)]+_0x40e98b['YnPPp'],'\x0a')+_0x40e98b[_0x20e68e(0x11f)]+_0x40e98b[_0x20e68e(0xcc)]+'\x0a',_0x20e68e(0xf0))+_0x20e68e(0xec)),process['exit'](0x1));const _0x13e73e={};if(_0x4bc6c6['setupHeader'])for(const _0x42000b of _0x4bc6c6[_0x20e68e(0xb5)]){const _0xc4ca54=_0x42000b['indexOf'](':');if(_0xc4ca54===-0x1)throw new Error(_0x20e68e(0xc4)+_0x42000b+_0x20e68e(0xb4));const _0x2530f9=_0x42000b[_0x20e68e(0x114)](0x0,_0xc4ca54)['trim'](),_0x813f7c=_0x42000b[_0x20e68e(0x114)](_0xc4ca54+0x1)['trim']();_0x13e73e[_0x2530f9]=_0x813f7c;}if(_0x40e98b[_0x20e68e(0x103)](_0x4bc6c6[_0x20e68e(0x117)],undefined)&&_0x4bc6c6[_0x20e68e(0x117)][_0x20e68e(0x112)]()==='')throw new Error(_0x40e98b[_0x20e68e(0xb1)]);if(_0x4bc6c6[_0x20e68e(0x117)]&&_0x4bc6c6['url'])throw new Error(_0x40e98b['xlmeJ']);const _0x1cf87e=_0x40e98b['VrhTg'](Boolean,_0x4bc6c6['cdpEndpoint']),_0x2d39c1=_0x40e98b['XJVEP'](isInteractive);if(!_0x2d39c1&&!_0x4bc6c6['url']&&!_0x1cf87e&&!_0x4bc6c6[_0x20e68e(0x11c)])throw new Error(_0x20e68e(0x111));if(_0x1cf87e){const _0x1ab809=_0x4bc6c6[_0x20e68e(0x117)];console[_0x20e68e(0x104)](_0x20e68e(0xeb)),console['log']('\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20'+_0x1ab809);const _0x565c8f={'cdpEndpoint':_0x1ab809,'isElectron':!![]};Object['keys'](_0x13e73e)[_0x20e68e(0xc8)]>0x0&&(_0x565c8f['setupHeaders']=_0x13e73e);await _0x40e98b[_0x20e68e(0x11e)](createUnconfiguredCloudProfile,_0x2556d3,_0x565c8f);try{_0x40e98b['NNoVk'](setProfileOverride,process[_0x20e68e(0xce)](),_0x2556d3,_0x40e98b['DocJR'],_0x1ab809),_0x40e98b[_0x20e68e(0x10c)](setProfileOverride,process['cwd'](),_0x2556d3,_0x40e98b[_0x20e68e(0xca)],!![]);}catch(_0x4c1e71){console['error']('\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20'+(_0x40e98b[_0x20e68e(0xe2)](_0x4c1e71,Error)?_0x4c1e71['message']:_0x40e98b[_0x20e68e(0xe9)](String,_0x4c1e71)));}console['log'](_0x20e68e(0x107)+_0x2556d3+'\x27\x20created\x20(CDP).'),await _0x40e98b['KfesU'](sweepOrphansBestEffort,_0x2556d3),await markActive(_0x2556d3);return;}if(_0x4bc6c6[_0x20e68e(0x11c)]){const _0x48292d={};_0x4bc6c6[_0x20e68e(0xf9)]&&(_0x48292d['baseUrl']=_0x4bc6c6[_0x20e68e(0xf9)]);Object['keys'](_0x13e73e)['length']>0x0&&(_0x48292d['setupHeaders']=_0x13e73e);await _0x40e98b[_0x20e68e(0x11e)](createUnconfiguredCloudProfile,_0x2556d3,_0x48292d),console[_0x20e68e(0x104)](_0x20e68e(0xe1)+_0x2556d3+_0x20e68e(0x110)+('\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20'+_0x2556d3+'`\x20again\x20without\x20--skip-auth.')),await _0x40e98b['KfesU'](sweepOrphansBestEffort,_0x2556d3),await markActive(_0x2556d3);return;}if(_0x4bc6c6['url']){const _0x1936b4=_0x4bc6c6[_0x20e68e(0xf9)],_0x52ea61=await _0x40e98b[_0x20e68e(0xdf)](checkUrlReachability,_0x1936b4);if(!_0x52ea61['ok']&&!_0x4bc6c6[_0x20e68e(0xc9)])throw new Error(_0x20e68e(0x101)+_0x1936b4+':\x20'+_0x52ea61[_0x20e68e(0xdd)]+'\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.');!_0x52ea61['ok']&&_0x4bc6c6['force']&&console['log']('⚠\x20Could\x20not\x20reach\x20'+_0x1936b4+':\x20'+_0x52ea61['error']+'\x20(continuing\x20with\x20--force)');}else{console[_0x20e68e(0x104)](_0x40e98b['qmVmp']),console['log'](_0x20e68e(0x115)),console['log']('\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a');let _0x5cd91f='',_0x530d2f=![];while(!![]){const _0x55440d=await _0x471a2b[_0x20e68e(0xfc)]([{'type':_0x40e98b['kpOms'],'name':'baseUrl','message':_0x530d2f?'Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):':_0x40e98b[_0x20e68e(0x12c)],'default':_0x40e98b['UYprH'](_0x5cd91f,_0x20e68e(0xf8))}]);_0x5cd91f=_0x55440d[_0x20e68e(0xfe)];const _0x3ec82a=await _0x40e98b[_0x20e68e(0xcb)](checkUrlReachability,_0x5cd91f);if(_0x3ec82a['ok'])break;const _0x2dce33=/^[a-zA-Z][\w+.-]*:\/\//['test'](_0x5cd91f),_0x2879c3=_0x3ec82a['isProtocolError']&&!_0x2dce33,_0xdf0723=_0x2879c3?'http://'+_0x5cd91f:null;_0x530d2f=!![],console[_0x20e68e(0x104)](_0x20e68e(0xd9)+_0x5cd91f+':\x20'+_0x3ec82a[_0x20e68e(0xdd)]);_0xdf0723&&console['log']('\x20\x20Did\x20you\x20mean\x20'+_0xdf0723+'?');const {action:_0x20705d}=await _0x471a2b[_0x20e68e(0xfc)]([{'type':_0x40e98b['VJoFr'],'name':_0x40e98b[_0x20e68e(0xdc)],'message':_0x40e98b['OEyQI'],'choices':[..._0xdf0723?[{'name':'Use\x20'+_0xdf0723,'value':_0x40e98b['mcteK']}]:[],{'name':_0x40e98b['eRMXm'],'value':_0x20e68e(0xe6)},{'name':_0x20e68e(0x102),'value':_0x20e68e(0xbe)}]}]);if(_0x20705d===_0x40e98b[_0x20e68e(0xee)]&&_0xdf0723){_0x5cd91f=_0xdf0723;const _0x1f7bfd=await checkUrlReachability(_0x5cd91f);if(_0x1f7bfd['ok'])break;console['log'](_0x20e68e(0xd7)+_0x5cd91f+':\x20'+_0x1f7bfd['error']);}else{if(_0x40e98b['aCfvJ'](_0x20705d,_0x40e98b['GTcPB']))break;}}_0x4bc6c6={..._0x4bc6c6,'url':_0x5cd91f};}let _0xe47456=![];try{_0xe47456=await _0x40e98b['DZBFl'](tryAutoRouteCloudProfile,_0x2556d3,_0x4bc6c6['url'],_0x4bc6c6,_0x2d39c1,_0x3e8684);}catch(_0x503bd6){console[_0x20e68e(0xdd)](_0x20e68e(0x105)+_0x2556d3+'\x22:\x20'+(_0x40e98b[_0x20e68e(0xe2)](_0x503bd6,Error)?_0x503bd6['message']:String(_0x503bd6))),process['exit'](0x1);}!_0xe47456&&process['exit'](0x1),await _0x40e98b['gRFzG'](markActive,_0x2556d3);}
|
|
1
|
+
(function(_0x102815,_0x59c963){const _0x4b34b8=_0x1829,_0x2fb6f6=_0x102815();while(!![]){try{const _0x201fcc=parseInt(_0x4b34b8(0x231))/0x1+parseInt(_0x4b34b8(0x276))/0x2*(parseInt(_0x4b34b8(0x223))/0x3)+-parseInt(_0x4b34b8(0x22f))/0x4+-parseInt(_0x4b34b8(0x22b))/0x5+-parseInt(_0x4b34b8(0x1f3))/0x6*(parseInt(_0x4b34b8(0x23e))/0x7)+parseInt(_0x4b34b8(0x1ef))/0x8*(parseInt(_0x4b34b8(0x207))/0x9)+-parseInt(_0x4b34b8(0x21d))/0xa*(-parseInt(_0x4b34b8(0x241))/0xb);if(_0x201fcc===_0x59c963)break;else _0x2fb6f6['push'](_0x2fb6f6['shift']());}catch(_0x3872d7){_0x2fb6f6['push'](_0x2fb6f6['shift']());}}}(_0xc060,0x40fbe));import{readdir,rm}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x1829(_0xbb85f9,_0xba1ebd){_0xbb85f9=_0xbb85f9-0x1ee;const _0xc060f4=_0xc060();let _0x182945=_0xc060f4[_0xbb85f9];return _0x182945;}import _0x33d178 from'inquirer';import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{fetchAuthConfig,createCloudProfile,manualBrowserLogin,ApiError}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{isPathGitTracked}from'./utils/gitTracked.js';import{setProfileOverride}from'./utils/projectsConfig.js';const CLOUD_PROFILE_SHARING_WARNING='This\x20account\x20will\x20be\x20shared\x20with\x20everyone\x20at\x20your\x20organization';function warnCloudProfileSharedInOrg(){const _0x18aec2=_0x1829;if(!process[_0x18aec2(0x24b)]['isTTY'])return;console['warn'](CLOUD_PROFILE_SHARING_WARNING);}async function checkUrlReachability(_0x44879b){const _0x1cd7e0=_0x1829,_0x28da17={'UYYlI':function(_0x7b9cbf,_0x4b4902,_0x50f9ee){return _0x7b9cbf(_0x4b4902,_0x50f9ee);},'CfZwI':_0x1cd7e0(0x1f4),'ROSfb':function(_0x599f03,_0x29dc5c,_0x1f6899){return _0x599f03(_0x29dc5c,_0x1f6899);},'IBsjV':function(_0x4f8c19,_0x1ccdcf){return _0x4f8c19(_0x1ccdcf);},'ZgQDB':function(_0x3543a9,_0x5f2b53){return _0x3543a9<_0x5f2b53;},'EhhVR':_0x1cd7e0(0x246)};try{const _0x3b3e71=new AbortController(),_0x326f0e=_0x28da17[_0x1cd7e0(0x25a)](setTimeout,()=>_0x3b3e71['abort'](),0x1388),_0x3e8463={'method':_0x28da17['CfZwI'],'signal':_0x3b3e71[_0x1cd7e0(0x210)],'redirect':_0x1cd7e0(0x271)};/^https:\/\/localhost(:\d+)?/i['test'](_0x44879b)&&(process['env'][_0x1cd7e0(0x277)]='0');const _0xe7ab9c=await _0x28da17['ROSfb'](fetch,_0x44879b,_0x3e8463);delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'],_0x28da17['IBsjV'](clearTimeout,_0x326f0e);if(_0x28da17['ZgQDB'](_0xe7ab9c[_0x1cd7e0(0x214)],0x190))return{'ok':!![]};return{'ok':![],'error':_0x1cd7e0(0x26f)+_0xe7ab9c['status']};}catch(_0x20aabb){delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'];const _0x175e26=_0x20aabb,_0x1defcf=_0x175e26[_0x1cd7e0(0x1f5)]||_0x28da17[_0x1cd7e0(0x248)](String,_0x20aabb),_0x253c62=_0x1defcf['includes'](_0x28da17['EhhVR'])||_0x175e26[_0x1cd7e0(0x209)]==='TypeError'||_0x1defcf['includes']('fetch\x20failed');return{'ok':![],'error':_0x1defcf,'isProtocolError':_0x253c62};}}async function sweepOrphanLocalProfile(_0x4d5465,_0x3a25d5,_0x2f1ebf){const _0x18ef6e=_0x1829,_0xde4197={'LSIWK':_0x18ef6e(0x22d),'OxcrE':function(_0x4e324c,_0x19dc36,_0x4713ad){return _0x4e324c(_0x19dc36,_0x4713ad);},'zgnFk':function(_0x51ccd4,_0x528136){return _0x51ccd4(_0x528136);},'sVcYj':function(_0xda2f21,_0x4d3a26){return _0xda2f21(_0x4d3a26);},'yEjJZ':function(_0x443183,_0x56f962,_0x281646){return _0x443183(_0x56f962,_0x281646);}},_0x35aa2c=join(_0x3a25d5,_0xde4197['LSIWK']),_0x43f42e=_0xde4197[_0x18ef6e(0x25f)](join,_0x35aa2c,_0x4d5465);_0xde4197[_0x18ef6e(0x242)](existsSync,_0x43f42e)&&(_0x2f1ebf&&await _0xde4197['sVcYj'](isPathGitTracked,_0x43f42e)?console[_0x18ef6e(0x219)]('\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20'+_0x43f42e+_0x18ef6e(0x262)):(await _0xde4197['yEjJZ'](rm,_0x43f42e,{'recursive':!![],'force':!![]}),console['log'](_0x18ef6e(0x245)+_0x43f42e)));if(_0xde4197[_0x18ef6e(0x1f1)](existsSync,_0x35aa2c)){let _0x2970bf=[];try{_0x2970bf=await _0xde4197['zgnFk'](readdir,_0x35aa2c);}catch{return;}const _0x516ad7='.tmp-'+_0x4d5465+'-';for(const _0x3c6c60 of _0x2970bf){if(!_0x3c6c60[_0x18ef6e(0x216)](_0x516ad7))continue;const _0xac2d79=join(_0x35aa2c,_0x3c6c60);await rm(_0xac2d79,{'recursive':!![],'force':!![]}),console[_0x18ef6e(0x219)](_0x18ef6e(0x245)+_0xac2d79);}}}async function sweepOrphansBestEffort(_0x4d0e60){const _0x1ae122=_0x1829,_0x38fb0a={'DEKUh':function(_0x1099da,_0x2509c5,_0x4fb4c6,_0x354796){return _0x1099da(_0x2509c5,_0x4fb4c6,_0x354796);},'vzSwc':function(_0x58bdc5){return _0x58bdc5();},'RCmff':function(_0x158849){return _0x158849();},'EyJAN':function(_0xf47bc7,_0x1007b2){return _0xf47bc7 instanceof _0x1007b2;},'VoGxk':function(_0x1a44b7,_0x4b3b78){return _0x1a44b7(_0x4b3b78);}};try{await _0x38fb0a[_0x1ae122(0x252)](sweepOrphanLocalProfile,_0x4d0e60,_0x38fb0a['vzSwc'](getRangerHomeDir),![]);const _0x3e604d=getRangerDir();_0x3e604d!==_0x38fb0a['RCmff'](getRangerHomeDir)&&await sweepOrphanLocalProfile(_0x4d0e60,_0x3e604d,!![]);}catch(_0x522030){console[_0x1ae122(0x219)](_0x1ae122(0x213)+(_0x38fb0a['EyJAN'](_0x522030,Error)?_0x522030['message']:_0x38fb0a['VoGxk'](String,_0x522030))+').');}}async function markActive(_0xc2d4dd){const _0x1a5967=_0x1829,_0x4ec062={'mpEjv':function(_0x517538,_0x2ddeb2){return _0x517538(_0x2ddeb2);},'XXqdq':_0x1a5967(0x1fb)};try{await _0x4ec062[_0x1a5967(0x222)](writeActiveProfileName,_0xc2d4dd),console[_0x1a5967(0x219)]('\x20\x20Set\x20active\x20profile:\x20'+_0xc2d4dd);}catch{console[_0x1a5967(0x219)](_0x4ec062['XXqdq']);}}async function tryAutoRouteCloudProfile(_0x3f541a,_0x575e8b,_0x14ae6e,_0x14537e,_0x19b1dd){const _0x530a25=_0x1829,_0x30ae0d={'FsGHn':function(_0x5202f6,_0x52be3a){return _0x5202f6===_0x52be3a;},'KjOaF':_0x530a25(0x21a),'xaSvC':function(_0x31701e,_0x2d92d0){return _0x31701e instanceof _0x2d92d0;},'Wgqpa':function(_0x493a33,_0x1ef7a8){return _0x493a33(_0x1ef7a8);},'bykma':function(_0x5cc1cb,_0x2842f9,_0x1a28cc,_0x5e50a6,_0x14e643){return _0x5cc1cb(_0x2842f9,_0x1a28cc,_0x5e50a6,_0x14e643);},'DFNfT':'no_auth_config','KsZEU':function(_0x24e9fd,_0x3f4090){return _0x24e9fd+_0x3f4090;},'iiTWo':function(_0xf582f2,_0xd409ee){return _0xf582f2+_0xd409ee;},'bbvLE':'\x0a\x20\x20Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team\x20yet\x20—\x20that\x27s\x20the\x20path\x20that\x20lets\x20Ranger\x20log\x20into\x20your\x20app\x20for\x20you\x20in\x20CI\x20/\x20background\x20agents.\x0a','qDoNW':'\x20\x20To\x20get\x20automated\x20login\x20set\x20up\x20for\x20your\x20team\x20(a\x20one-time\x20call):\x20eng@ranger.net\x0a','vedyA':_0x530a25(0x218),'RAflW':_0x530a25(0x23d),'aAJKy':'\x20Your\x20org\x20has\x20no\x20auth\x20environments\x20configured.','bYyxs':function(_0x53c495,_0x4b9f4d,_0x573e2e){return _0x53c495(_0x4b9f4d,_0x573e2e);},'bqCMT':_0x530a25(0x24e),'woYZN':'\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20cloud-managed\x20session.','hgYxG':function(_0x449f36,_0x5f054a,_0x550a74,_0x325728){return _0x449f36(_0x5f054a,_0x550a74,_0x325728);},'CQhMw':function(_0x991395){return _0x991395();},'EterQ':function(_0x4e1179,_0x5c1632){return _0x4e1179+_0x5c1632;},'CfmuJ':function(_0x5e84e0,_0x5c196c){return _0x5e84e0(_0x5c196c);}};let _0x349f55;try{_0x349f55=await fetchAuthConfig();}catch(_0xc6173f){return _0x19b1dd?.['trackPhaseEnd'](_0x30ae0d[_0x530a25(0x239)],{'reason':_0x530a25(0x247),'profileName':_0x3f541a}),console['error']('\x0a\x20\x20Could\x20not\x20fetch\x20this\x20org\x27s\x20auth\x20config:\x20'+(_0x30ae0d['xaSvC'](_0xc6173f,Error)?_0xc6173f[_0x530a25(0x1f5)]:_0x30ae0d[_0x530a25(0x243)](String,_0xc6173f))),![];}if((!_0x349f55||!_0x349f55[_0x530a25(0x261)]||Object['keys'](_0x349f55[_0x530a25(0x261)])['length']===0x0)&&!_0x14ae6e['authEnv']){if(_0x14537e)return await _0x30ae0d['bykma'](captureEnvLessProfile,_0x3f541a,_0x575e8b,_0x14ae6e,_0x19b1dd);return _0x19b1dd?.[_0x530a25(0x1f9)](_0x30ae0d['KjOaF'],{'reason':_0x30ae0d['DFNfT'],'profileName':_0x3f541a}),console['error'](_0x30ae0d['KsZEU'](_0x30ae0d['iiTWo'](_0x30ae0d[_0x530a25(0x201)],'\x0a')+_0x530a25(0x269),_0x530a25(0x20d)+_0x3f541a+_0x530a25(0x1f2)+_0x575e8b+'\x20--skip-auth\x0a')+'\x0a'+_0x30ae0d['qDoNW']+_0x30ae0d[_0x530a25(0x263)]),![];}let _0x3fe42e;if(_0x14ae6e['authEnv']){if(!_0x349f55?.['environments']?.[_0x14ae6e['authEnv']]){const _0x430ff3=Object['keys'](_0x349f55?.['environments']??{});return _0x19b1dd?.['trackPhaseEnd'](_0x30ae0d[_0x530a25(0x239)],{'reason':_0x30ae0d[_0x530a25(0x229)],'profileName':_0x3f541a}),console[_0x530a25(0x21e)]('\x0a\x20\x20Auth\x20environment\x20\x22'+_0x14ae6e[_0x530a25(0x268)]+_0x530a25(0x234)+(_0x430ff3['length']?_0x530a25(0x279)+_0x430ff3['join'](',\x20')+'.':_0x30ae0d['aAJKy'])),![];}_0x3fe42e=_0x14ae6e['authEnv'];}else _0x3fe42e=_0x30ae0d[_0x530a25(0x20c)](matchAuthEnvironment,_0x575e8b,_0x349f55);if(!_0x3fe42e)return _0x19b1dd?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':_0x30ae0d['bqCMT'],'profileName':_0x3f541a}),console['error'](_0x530a25(0x266)+_0x575e8b+_0x530a25(0x204)+Object['keys'](_0x349f55?.['environments']??{})[_0x530a25(0x259)](',\x20')+'.'),![];const _0x5dc512=_0x349f55?.[_0x530a25(0x261)]?.[_0x3fe42e],_0x2304ad=_0x5dc512?.['domains']??[];if(_0x14537e&&!_0x14ae6e[_0x530a25(0x264)]){const {saveToCloud:_0x142c34}=await _0x33d178[_0x530a25(0x25b)]([{'type':_0x530a25(0x24c),'name':_0x530a25(0x200),'message':'Found\x20auth\x20environment\x20\x27'+_0x3fe42e+'\x27\x20matching\x20'+_0x575e8b+_0x530a25(0x26d)+_0x2304ad['join'](',\x20')+')\x0a\x20\x20Save\x20\x27'+_0x3f541a+'\x27\x20to\x20the\x20cloud?','default':!![]}]);if(!_0x142c34)return _0x19b1dd?.[_0x530a25(0x1f9)](_0x530a25(0x21a),{'reason':_0x530a25(0x272),'profileName':_0x3f541a}),console['error'](_0x30ae0d['woYZN']),![];}const _0x4c90eb=_0x2304ad[_0x530a25(0x1fc)](_0x1bf869=>{const _0x1ceabe=_0x530a25;try{return _0x30ae0d['FsGHn'](new URL(_0x1bf869)[_0x1ceabe(0x278)],new URL(_0x575e8b)[_0x1ceabe(0x278)]);}catch{return![];}}),_0x3014fa={};!_0x4c90eb&&(_0x3014fa['baseUrl']=_0x575e8b);try{await _0x30ae0d['hgYxG'](createCloudProfile,_0x3f541a,_0x3fe42e,{'settings':_0x3014fa}),_0x30ae0d['CQhMw'](warnCloudProfileSharedInOrg);}catch(_0x4b347e){if(_0x4b347e instanceof ApiError&&_0x4b347e['status']===0x199){console['error'](_0x30ae0d['EterQ'](_0x530a25(0x240)+_0x3f541a+_0x530a25(0x236),_0x530a25(0x22c)+_0x3f541a));throw _0x4b347e;}throw _0x4b347e;}return console[_0x530a25(0x219)](_0x30ae0d['KsZEU']('✓\x20Profile\x20\x27'+_0x3f541a+'\x27\x20created.\x0a',_0x530a25(0x24d)+_0x3f541a)),await _0x30ae0d[_0x530a25(0x274)](sweepOrphansBestEffort,_0x3f541a),_0x19b1dd?.['trackPhaseEnd'](_0x530a25(0x260),{'envKey':_0x3fe42e,'profileName':_0x3f541a}),!![];}function _0xc060(){const _0x3aacde=['1640920FvjxNg','setupHeader','165053yldieC','capture','EYiHX','\x22\x20not\x20found.','setupHeaders','\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a','slice','baseUrl','KjOaF','cwd','IrQFA','\x0a🌐\x20Profile\x20Setup\x0a','env_not_found','55167rbvLvr','iWDSd','\x0a\x20\x20A\x20profile\x20named\x20\x22','59851JfbRkv','zgnFk','Wgqpa','keys','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','Invalid\x20URL','no_auth_config','IBsjV','vbDQX','mCmGu','stdout','confirm','\x20\x20Next:\x20ranger\x20go\x20--profile\x20','no_match','\x0a\x20\x20Failed\x20to\x20create\x20cloud\x20profile\x20\x22','\x20\x20Ranger\x20will\x20use\x20it\x20to\x20look\x20up\x20the\x20right\x20cloud\x20auth\x20env\x20to\x20attach.\x0a','\x27\x20created\x20with\x20a\x20captured\x20session.\x0a','DEKUh','IMvES','onSrb','ZDOKf','Use\x20','cdpEndpoint','QIZcX','join','UYYlI','prompt','lyFLg','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','url','OxcrE','profile.add.autoRouted','environments','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.','vedyA','yes','Invalid\x20--setup-header\x20format:\x20\x22','\x0a\x20\x20No\x20auth\x20env\x20matches\x20','RaHMR','authEnv','\x20\x20Workaround\x20for\x20now:\x20create\x20a\x20profile\x20without\x20a\x20captured\x20session\x20and\x20supply\x20one\x20later:\x0a','wpONR','Automated\x20login\x20isn\x27t\x20set\x20up\x20for\x20your\x20team.\x20Capture\x20a\x20session\x20via\x20a\x20headed\x20browser\x20instead?','xhqCH','\x0a\x20\x20(domains:\x20','GhEvs','HTTP\x20','VtqPi','manual','user_declined','length','CfmuJ','abMOd','172ysXqAG','NODE_TLS_REJECT_UNAUTHORIZED','origin','\x20Configured\x20envs:\x20','Could\x20not\x20reach\x20','\x22.\x20Expected\x20\x22Name:\x20Value\x22.','8NPCKrn','✓\x20Profile\x20\x27','sVcYj','\x20--url\x20','114mqCmhh','HEAD','message','for\x20you,\x20so\x20the\x20encrypted-CI\x20flow\x20is\x20unnecessary.\x0a','list','FYqec','trackPhaseEnd','WkqFz','Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.','some','hFtQQ','loFTX','\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20','saveToCloud','bbvLE','\x22:\x20','rczhM','.\x20Pass\x20--env\x20<key>\x20to\x20pick\x20one,\x20or\x20use\x20--skip-auth.\x20Configured\x20envs:\x20','OKoCq','What\x20would\x20you\x20like\x20to\x20do?','3775293hqezfx','The\x20--ci\x20flag\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x20session\x20state\x0a','name','continue','http://localhost:3000','bYyxs','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20add\x20','trim','TaGuH','signal','KkdAM','action','\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','status','rqWWb','startsWith','exit','\x20\x20Details:\x20https://docs.ranger.net/main/concepts/profiles#automated-login','log','profile.add.autoRouteSkipped','skipAuth','--cdp-endpoint\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20a\x20CDP\x20profile\x20connects\x20to\x20an\x20existing\x20browser\x20and\x20has\x20no\x20auth\x20environment.','510EwZIez','error','MChAz','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','force','mpEjv','8031lhAdVw','test','lnGUB','isProtocolError','\x20\x20Did\x20you\x20mean\x20','--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','RAflW','`\x20again\x20without\x20--skip-auth.','1330500doKOSH','\x20\x20\x20\x20\x20\x20ranger\x20profile\x20update\x20','local','\x0a✓\x20Profile\x20\x27'];_0xc060=function(){return _0x3aacde;};return _0xc060();}async function createUnconfiguredCloudProfile(_0x55afef,_0x283c99){const _0x3d3f16=_0x1829,_0x1efe95={'eWVop':function(_0x2db1b9,_0xae8b09,_0xf5c6f2,_0x475180){return _0x2db1b9(_0xae8b09,_0xf5c6f2,_0x475180);},'sWzbX':function(_0x14de56){return _0x14de56();},'loFTX':function(_0x236f40,_0x5dee5c){return _0x236f40===_0x5dee5c;}};try{await _0x1efe95['eWVop'](createCloudProfile,_0x55afef,undefined,{'settings':_0x283c99}),_0x1efe95['sWzbX'](warnCloudProfileSharedInOrg);}catch(_0x565164){_0x565164 instanceof ApiError&&_0x1efe95[_0x3d3f16(0x1fe)](_0x565164['status'],0x199)&&console[_0x3d3f16(0x21e)](_0x3d3f16(0x240)+_0x55afef+_0x3d3f16(0x236)+(_0x3d3f16(0x22c)+_0x55afef));throw _0x565164;}}async function captureEnvLessProfile(_0x55b7e6,_0xb2a911,_0x52400a,_0x389895){const _0x5aa85d=_0x1829,_0x460cc2={'rqWWb':'confirm','iDDQL':_0x5aa85d(0x232),'qNhbU':'user_declined','xhqCH':function(_0x5d33cf,_0x251582){return _0x5d33cf+_0x251582;},'MChAz':function(_0x3db90e,_0x4e3fd8){return _0x3db90e>_0x4e3fd8;},'lnGUB':function(_0x459426){return _0x459426();},'RaHMR':function(_0x1555bb,_0x285da3){return _0x1555bb>_0x285da3;}};if(!_0x52400a[_0x5aa85d(0x264)]){const {capture:_0x2a8336}=await _0x33d178[_0x5aa85d(0x25b)]([{'type':_0x460cc2[_0x5aa85d(0x215)],'name':_0x460cc2['iDDQL'],'message':_0x5aa85d(0x26b),'default':!![]}]);if(!_0x2a8336)return _0x389895?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':_0x460cc2['qNhbU'],'profileName':_0x55b7e6}),console['error']('\x0a\x20\x20Declined.\x20Re-run\x20with\x20--skip-auth\x20to\x20create\x20a\x20profile\x20without\x20a\x20session,\x0a'+'\x20\x20or\x20contact\x20eng@ranger.net\x20to\x20set\x20up\x20automated\x20login\x20for\x20your\x20team.'),![];}const _0x19c66c={};if(_0x52400a[_0x5aa85d(0x230)])for(const _0x5cd7c2 of _0x52400a['setupHeader']){const _0x18f318=_0x5cd7c2['indexOf'](':');if(_0x18f318===-0x1)continue;_0x19c66c[_0x5cd7c2['slice'](0x0,_0x18f318)['trim']()]=_0x5cd7c2['slice'](_0x460cc2[_0x5aa85d(0x26c)](_0x18f318,0x1))[_0x5aa85d(0x20e)]();}const _0x8ce281={'baseUrl':_0xb2a911};_0x460cc2[_0x5aa85d(0x21f)](Object[_0x5aa85d(0x244)](_0x19c66c)[_0x5aa85d(0x273)],0x0)&&(_0x8ce281[_0x5aa85d(0x235)]=_0x19c66c);let _0x4a6f77;try{_0x4a6f77=await createCloudProfile(_0x55b7e6,undefined,{'settings':_0x8ce281}),_0x460cc2[_0x5aa85d(0x225)](warnCloudProfileSharedInOrg);}catch(_0x407c23){_0x407c23 instanceof ApiError&&_0x407c23[_0x5aa85d(0x214)]===0x199&&console[_0x5aa85d(0x21e)]('\x0a\x20\x20A\x20profile\x20named\x20\x22'+_0x55b7e6+'\x22\x20already\x20exists.\x20To\x20refresh\x20its\x20session,\x20run:\x0a'+(_0x5aa85d(0x22c)+_0x55b7e6));throw _0x407c23;}return await manualBrowserLogin(_0x4a6f77,{'key':'','domains':[_0xb2a911],'setupHeaders':_0x460cc2[_0x5aa85d(0x267)](Object['keys'](_0x19c66c)[_0x5aa85d(0x273)],0x0)?_0x19c66c:undefined}),console[_0x5aa85d(0x219)](_0x5aa85d(0x22e)+_0x55b7e6+_0x5aa85d(0x251)+('\x20\x20Next:\x20ranger\x20go\x20--profile\x20'+_0x55b7e6)),await sweepOrphansBestEffort(_0x55b7e6),_0x389895?.['trackPhaseEnd']('profile.add.autoRouted',{'envKey':null,'profileName':_0x55b7e6}),!![];}export async function addEnv(_0x1ca5fa,_0x11fbd0={},_0x4fbd86){const _0x50da65=_0x1829,_0x576e4e={'IMvES':function(_0x15723c,_0x36cead){return _0x15723c+_0x36cead;},'JTLIe':function(_0x2961c9,_0x441c8c){return _0x2961c9+_0x441c8c;},'TaGuH':'To\x20set\x20up\x20a\x20profile,\x20run:\x0a','FIEZi':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','arhyd':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','rczhM':'\x20\x20https://docs.ranger.net/main/concepts/profiles','lyFLg':function(_0x4089a8,_0xf63f5b){return _0x4089a8===_0xf63f5b;},'feHom':function(_0x1e97b0,_0x452970){return _0x1e97b0!==_0x452970;},'mCmGu':'--skip-auth\x20and\x20--env\x20are\x20mutually\x20exclusive:\x20--skip-auth\x20makes\x20an\x20env-less\x20profile,\x20--env\x20binds\x20one\x20to\x20an\x20auth\x20environment.','KkdAM':_0x50da65(0x21c),'nSlLz':'Please\x20provide\x20--url\x20when\x20running\x20in\x20non-interactive\x20mode.\x0aMake\x20sure\x20the\x20service\x20is\x20running\x20on\x20that\x20port\x20before\x20retrying.\x0aExample:\x20ranger\x20profile\x20add\x20local\x20--url\x20http://localhost:3000','abMOd':'\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','ZDOKf':function(_0x20d783,_0x5459e9){return _0x20d783>_0x5459e9;},'WkqFz':function(_0xa90d64,_0x1759be,_0x342450){return _0xa90d64(_0x1759be,_0x342450);},'TfbFq':'isElectron','FYqec':function(_0x21b199,_0x13c035){return _0x21b199(_0x13c035);},'OKoCq':function(_0x538016,_0x49e69c){return _0x538016(_0x49e69c);},'QIZcX':function(_0x4db911,_0x485c1f,_0x659643){return _0x4db911(_0x485c1f,_0x659643);},'paYrz':function(_0x11ee82,_0x3a638d){return _0x11ee82(_0x3a638d);},'lSMBl':_0x50da65(0x23c),'ktQtD':_0x50da65(0x25d),'iOEYQ':_0x50da65(0x250),'iWDSd':_0x50da65(0x238),'hFtQQ':'Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','wpONR':function(_0x26d6aa,_0x19a14b){return _0x26d6aa||_0x19a14b;},'vbDQX':function(_0x19430c,_0x5016f7){return _0x19430c(_0x5016f7);},'VtqPi':_0x50da65(0x212),'TvAVY':'use_suggestion','TTxZi':'retry','onSrb':function(_0x431d23,_0x4d3374){return _0x431d23===_0x4d3374;},'IrQFA':function(_0xd16662,_0x1be086){return _0xd16662(_0x1be086);},'EYiHX':_0x50da65(0x20a),'GhEvs':function(_0x528cd5,_0x161179,_0x3e95c6,_0x54fe2a,_0x53a290,_0xafb43c){return _0x528cd5(_0x161179,_0x3e95c6,_0x54fe2a,_0x53a290,_0xafb43c);}};_0x11fbd0['ci']&&(console['error'](_0x576e4e[_0x50da65(0x253)](_0x576e4e['IMvES'](_0x576e4e['JTLIe'](_0x576e4e['IMvES'](_0x50da65(0x208)+_0x50da65(0x1f6),'\x0a')+_0x576e4e[_0x50da65(0x20f)],_0x576e4e['FIEZi']),'\x0a')+_0x576e4e['arhyd'],_0x576e4e[_0x50da65(0x203)])),process[_0x50da65(0x217)](0x1));const _0x14ffa0={};if(_0x11fbd0['setupHeader'])for(const _0x132fdd of _0x11fbd0['setupHeader']){const _0x1a152c=_0x132fdd['indexOf'](':');if(_0x576e4e[_0x50da65(0x25c)](_0x1a152c,-0x1))throw new Error(_0x50da65(0x265)+_0x132fdd+_0x50da65(0x1ee));const _0x52db3f=_0x132fdd['slice'](0x0,_0x1a152c)[_0x50da65(0x20e)](),_0x54a646=_0x132fdd[_0x50da65(0x237)](_0x1a152c+0x1)['trim']();_0x14ffa0[_0x52db3f]=_0x54a646;}if(_0x576e4e['feHom'](_0x11fbd0['cdpEndpoint'],undefined)&&_0x11fbd0[_0x50da65(0x257)]['trim']()==='')throw new Error(_0x50da65(0x228));if(_0x11fbd0[_0x50da65(0x257)]&&_0x11fbd0[_0x50da65(0x25e)])throw new Error('--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.');if(_0x11fbd0[_0x50da65(0x268)]&&_0x11fbd0['skipAuth'])throw new Error(_0x576e4e[_0x50da65(0x24a)]);if(_0x11fbd0['authEnv']&&_0x11fbd0[_0x50da65(0x257)])throw new Error(_0x576e4e[_0x50da65(0x211)]);const _0x4a60a5=Boolean(_0x11fbd0[_0x50da65(0x257)]),_0x3d2a27=isInteractive();if(!_0x3d2a27&&!_0x11fbd0[_0x50da65(0x25e)]&&!_0x4a60a5&&!_0x11fbd0[_0x50da65(0x21b)])throw new Error(_0x576e4e['nSlLz']);if(_0x4a60a5){const _0x111bdd=_0x11fbd0['cdpEndpoint'];console['log'](_0x576e4e[_0x50da65(0x275)]),console['log'](_0x50da65(0x1ff)+_0x111bdd);const _0x269cd0={'cdpEndpoint':_0x111bdd,'isElectron':!![]};_0x576e4e[_0x50da65(0x255)](Object['keys'](_0x14ffa0)[_0x50da65(0x273)],0x0)&&(_0x269cd0[_0x50da65(0x235)]=_0x14ffa0);await _0x576e4e[_0x50da65(0x1fa)](createUnconfiguredCloudProfile,_0x1ca5fa,_0x269cd0);try{setProfileOverride(process['cwd'](),_0x1ca5fa,'cdpEndpoint',_0x111bdd),setProfileOverride(process[_0x50da65(0x23a)](),_0x1ca5fa,_0x576e4e['TfbFq'],!![]);}catch(_0x50c085){console[_0x50da65(0x21e)]('\x0a\x20\x20Cloud\x20profile\x20created,\x20but\x20failed\x20to\x20write\x20per-cwd\x20CDP\x20override\x20to\x20projects.json:\x20'+(_0x50c085 instanceof Error?_0x50c085['message']:_0x576e4e['FYqec'](String,_0x50c085)));}console[_0x50da65(0x219)]('✓\x20Cloud\x20profile\x20\x27'+_0x1ca5fa+'\x27\x20created\x20(CDP).'),await _0x576e4e[_0x50da65(0x205)](sweepOrphansBestEffort,_0x1ca5fa),await _0x576e4e[_0x50da65(0x1f8)](markActive,_0x1ca5fa);return;}if(_0x11fbd0[_0x50da65(0x21b)]){const _0x3065d3={};_0x11fbd0[_0x50da65(0x25e)]&&(_0x3065d3['baseUrl']=_0x11fbd0['url']);Object[_0x50da65(0x244)](_0x14ffa0)['length']>0x0&&(_0x3065d3[_0x50da65(0x235)]=_0x14ffa0);await _0x576e4e[_0x50da65(0x258)](createUnconfiguredCloudProfile,_0x1ca5fa,_0x3065d3),console['log'](_0x576e4e['JTLIe'](_0x50da65(0x1f0)+_0x1ca5fa+'\x27\x20created\x20(no\x20session).\x0a','\x20\x20When\x20you\x27re\x20ready\x20to\x20log\x20in,\x20run\x20`ranger\x20profile\x20add\x20'+_0x1ca5fa+_0x50da65(0x22a))),await _0x576e4e['paYrz'](sweepOrphansBestEffort,_0x1ca5fa),await markActive(_0x1ca5fa);return;}if(_0x11fbd0[_0x50da65(0x25e)]){const _0x2bfd41=_0x11fbd0[_0x50da65(0x25e)],_0x47edc5=await checkUrlReachability(_0x2bfd41);if(!_0x47edc5['ok']&&!_0x11fbd0[_0x50da65(0x221)])throw new Error(_0x50da65(0x27a)+_0x2bfd41+':\x20'+_0x47edc5['error']+'\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.');!_0x47edc5['ok']&&_0x11fbd0[_0x50da65(0x221)]&&console[_0x50da65(0x219)]('⚠\x20Could\x20not\x20reach\x20'+_0x2bfd41+':\x20'+_0x47edc5['error']+'\x20(continuing\x20with\x20--force)');}else{console['log'](_0x576e4e['lSMBl']),console['log'](_0x576e4e['ktQtD']),console['log'](_0x576e4e['iOEYQ']);let _0x3560e2='',_0x309f75=![];while(!![]){const _0x3afcee=await _0x33d178[_0x50da65(0x25b)]([{'type':'input','name':_0x576e4e[_0x50da65(0x23f)],'message':_0x309f75?_0x576e4e[_0x50da65(0x1fd)]:_0x50da65(0x220),'default':_0x576e4e[_0x50da65(0x26a)](_0x3560e2,_0x50da65(0x20b))}]);_0x3560e2=_0x3afcee['baseUrl'];const _0x410529=await _0x576e4e[_0x50da65(0x249)](checkUrlReachability,_0x3560e2);if(_0x410529['ok'])break;const _0x210686=/^[a-zA-Z][\w+.-]*:\/\//[_0x50da65(0x224)](_0x3560e2),_0x32bd3d=_0x410529[_0x50da65(0x226)]&&!_0x210686,_0x2f42c2=_0x32bd3d?'http://'+_0x3560e2:null;_0x309f75=!![],console[_0x50da65(0x219)]('\x0a\x20\x20Could\x20not\x20reach\x20'+_0x3560e2+':\x20'+_0x410529['error']);_0x2f42c2&&console['log'](_0x50da65(0x227)+_0x2f42c2+'?');const {action:_0x59d6c9}=await _0x33d178[_0x50da65(0x25b)]([{'type':_0x50da65(0x1f7),'name':_0x576e4e[_0x50da65(0x270)],'message':_0x50da65(0x206),'choices':[..._0x2f42c2?[{'name':_0x50da65(0x256)+_0x2f42c2,'value':_0x576e4e['TvAVY']}]:[],{'name':'Enter\x20a\x20different\x20URL','value':_0x576e4e['TTxZi']},{'name':'Continue\x20anyway','value':'continue'}]}]);if(_0x576e4e[_0x50da65(0x254)](_0x59d6c9,_0x576e4e['TvAVY'])&&_0x2f42c2){_0x3560e2=_0x2f42c2;const _0x14dc96=await _0x576e4e[_0x50da65(0x23b)](checkUrlReachability,_0x3560e2);if(_0x14dc96['ok'])break;console['log']('\x0a\x20\x20Still\x20could\x20not\x20reach\x20'+_0x3560e2+':\x20'+_0x14dc96[_0x50da65(0x21e)]);}else{if(_0x576e4e['onSrb'](_0x59d6c9,_0x576e4e[_0x50da65(0x233)]))break;}}_0x11fbd0={..._0x11fbd0,'url':_0x3560e2};}let _0x4caaaf=![];try{_0x4caaaf=await _0x576e4e[_0x50da65(0x26e)](tryAutoRouteCloudProfile,_0x1ca5fa,_0x11fbd0[_0x50da65(0x25e)],_0x11fbd0,_0x3d2a27,_0x4fbd86);}catch(_0x1c2255){console['error'](_0x50da65(0x24f)+_0x1ca5fa+_0x50da65(0x202)+(_0x1c2255 instanceof Error?_0x1c2255[_0x50da65(0x1f5)]:String(_0x1c2255))),process[_0x50da65(0x217)](0x1);}!_0x4caaaf&&process[_0x50da65(0x217)](0x1),await markActive(_0x1ca5fa);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x34b0(_0x1467c0,_0x492c9d){_0x1467c0=_0x1467c0-0x15e;var _0x143a26=_0x143a();var _0x34b050=_0x143a26[_0x1467c0];return _0x34b050;}(function(_0x3edd1a,_0x17418b){var _0x531009=_0x34b0,_0x5c1d49=_0x3edd1a();while(!![]){try{var _0x44ef8c=parseInt(_0x531009(0x15e))/0x1*(parseInt(_0x531009(0x16c))/0x2)+parseInt(_0x531009(0x169))/0x3*(-parseInt(_0x531009(0x162))/0x4)+-parseInt(_0x531009(0x165))/0x5*(parseInt(_0x531009(0x166))/0x6)+-parseInt(_0x531009(0x15f))/0x7+parseInt(_0x531009(0x16d))/0x8*(-parseInt(_0x531009(0x16e))/0x9)+-parseInt(_0x531009(0x171))/0xa*(parseInt(_0x531009(0x16a))/0xb)+parseInt(_0x531009(0x161))/0xc;if(_0x44ef8c===_0x17418b)break;else _0x5c1d49['push'](_0x5c1d49['shift']());}catch(_0x510e8c){_0x5c1d49['push'](_0x5c1d49['shift']());}}}(_0x143a,0x3f9dc));function _0x143a(){var _0x5968b6=['195xlMjbd','341qBMPFx','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','31442PSbTxj','6008OChWNV','5328sneJrL','buJNI','VwASo','97450SaNwNS','1SIWrvZ','109130ZKkRIr','qndzx','18089436ACgjSG','29896JMsiEw','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','exit','25pfWdQD','17418pxKHax','CwyBu','keCUY'];_0x143a=function(){return _0x5968b6;};return _0x143a();}export async function authEncrypt(_0x4d5192){var _0x402c86=_0x34b0,_0x5a2e48={'CwyBu':function(_0x501055,_0x91fb88){return _0x501055+_0x91fb88;},'keCUY':function(_0x14ad29,_0x28a383){return _0x14ad29+_0x28a383;},'VwASo':function(_0x3dea10,_0x3836b0){return _0x3dea10+_0x3836b0;},'mUwAI':'ranger\x20profile\x20encrypt-auth\x20is\x20no\x20longer\x20supported.\x20Ranger\x20now\x20manages\x0a','qndzx':'session\x20state\x20for\x20you,\x20so\x20encrypted\x20on-disk\x20auth\x20is\x20unnecessary.\x0a','buJNI':'\x20\x20https://docs.ranger.net/main/concepts/profiles'};console['error'](_0x5a2e48[_0x402c86(0x167)](_0x5a2e48[_0x402c86(0x168)](_0x5a2e48[_0x402c86(0x168)](_0x5a2e48['CwyBu'](_0x5a2e48[_0x402c86(0x170)](_0x5a2e48['mUwAI'],_0x5a2e48[_0x402c86(0x160)])+'\x0a',_0x402c86(0x163)),'\x20\x20ranger\x20profile\x20add\x20<name>\x0a')+'\x0a',_0x402c86(0x16b)),_0x5a2e48[_0x402c86(0x16f)])),process[_0x402c86(0x164)](0x1);}
|
package/build/commands/clean.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x280190=_0x5757;(function(_0x581b8e,_0x10e079){const _0x419052=_0x5757,_0x40c930=_0x581b8e();while(!![]){try{const _0x29fe4f=parseInt(_0x419052(0x86))/0x1*(-parseInt(_0x419052(0x9a))/0x2)+-parseInt(_0x419052(0xa1))/0x3+-parseInt(_0x419052(0x9e))/0x4+parseInt(_0x419052(0x92))/0x5*(-parseInt(_0x419052(0xb5))/0x6)+parseInt(_0x419052(0x89))/0x7+-parseInt(_0x419052(0xb9))/0x8+parseInt(_0x419052(0xa0))/0x9*(parseInt(_0x419052(0x95))/0xa);if(_0x29fe4f===_0x10e079)break;else _0x40c930['push'](_0x40c930['shift']());}catch(_0x33b467){_0x40c930['push'](_0x40c930['shift']());}}}(_0x5ad3,0xebdd7));import{rm,readFile,writeFile}from'fs/promises';function _0x5ad3(){const _0x2fb3ad=['5771283OqWQaJ','close','✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)','stringify','LxnUE','ohltW','RbPWI','TUPhP','uninstall','298585YxNnYN','sLfOr','marketplace','20aTkqrA','MaaZP','ignore','win32','✓\x20Removed\x20OpenCode\x20project\x20skill:\x20','12dcAwfM','ERAJU','bvJkL','replace','2849780QpjgRi','plugin','20605797HHkFkL','318771JBnScI','string','moqSP','zsEwv','log','error','✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)','feature-tracker','length','parse','platform','bug-bash','vSBXR','wBuRb','utf-8','✓\x20Removed\x20user\x20skill:\x20','zJgXV','IZhMb','✓\x20Removed\x20trailhead\x20marketplace','PwFhK','138eKKDhn','project','uiOaZ','iRyJB','7478136DlZvsB','xAJsm','Mbplq','filter','218412GjxhXm','e2e-test-recommender','oCUcA'];_0x5ad3=function(){return _0x2fb3ad;};return _0x5ad3();}import{join}from'path';function _0x5757(_0x330f3e,_0x6045b6){_0x330f3e=_0x330f3e-0x85;const _0x5ad326=_0x5ad3();let _0x5757e7=_0x5ad326[_0x330f3e];return _0x5757e7;}import{existsSync}from'fs';import{spawn}from'child_process';import{deleteAllCredentials}from'./utils/keychain.js';import{getProjectRoot,getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getCacheFile}from'./utils/sessionCache.js';import{getOpencodeConfigDir,getOpencodeSkillsDir}from'./utils/opencodeConfig.js';const skillsToRemove=['ranger',_0x280190(0xa8),_0x280190(0xac),_0x280190(0x87)],opencodePluginName='@ranger-testing/opencode-plugin';function parseJsonc(_0x3729ad){const _0x171f8c=_0x280190,_0x52ca4b=_0x3729ad['replace'](/\/\*[\s\S]*?\*\//g,''),_0xacefa2=_0x52ca4b[_0x171f8c(0x9d)](/^\s*\/\/.*$/gm,''),_0x417ce0=_0xacefa2[_0x171f8c(0x9d)](/,\s*([}\]])/g,'$1');return JSON[_0x171f8c(0xaa)](_0x417ce0);}async function removeOpencodePluginConfig(_0x44e521){const _0x4650c9=_0x280190,_0x3da22f={'hBTOq':function(_0x16539f,_0x1f5bac){return _0x16539f===_0x1f5bac;},'aFMhx':function(_0x531854,_0x49faf3,_0x232b30){return _0x531854(_0x49faf3,_0x232b30);},'qZAQV':function(_0x7d0dcd,_0x43e773){return _0x7d0dcd+_0x43e773;}};if(!existsSync(_0x44e521))return![];let _0x1f20af;try{const _0x1a9cab=await readFile(_0x44e521,_0x4650c9(0xaf));_0x1f20af=parseJsonc(_0x1a9cab);}catch{return![];}const _0x496d1a=Array['isArray'](_0x1f20af[_0x4650c9(0x9f)])?_0x1f20af['plugin']:[];if(_0x496d1a['length']===0x0)return![];const _0x12c1fc=_0x496d1a[_0x4650c9(0x85)](_0x24a737=>{const _0x47af74=_0x4650c9;if(typeof _0x24a737!==_0x47af74(0xa2))return!![];return _0x24a737!==opencodePluginName;});if(_0x3da22f['hBTOq'](_0x12c1fc[_0x4650c9(0xa9)],_0x496d1a[_0x4650c9(0xa9)]))return![];return _0x3da22f['hBTOq'](_0x12c1fc[_0x4650c9(0xa9)],0x0)?delete _0x1f20af[_0x4650c9(0x9f)]:_0x1f20af[_0x4650c9(0x9f)]=_0x12c1fc,await _0x3da22f['aFMhx'](writeFile,_0x44e521,_0x3da22f['qZAQV'](JSON[_0x4650c9(0x8c)](_0x1f20af,null,0x2),'\x0a')),!![];}async function uninstallClaudePlugin(_0x472b6c){const _0x352e48=_0x280190,_0x1e2ab6={'IZhMb':function(_0x3d4f03,_0x24efec){return _0x3d4f03(_0x24efec);},'RiesY':function(_0x52401e,_0x151b4c){return _0x52401e===_0x151b4c;},'ieYwI':'ranger@trailhead','zsEwv':function(_0x5d1805,_0x2634b1,_0x1a0cbf,_0x5181e6){return _0x5d1805(_0x2634b1,_0x1a0cbf,_0x5181e6);},'vSBXR':'claude','sLfOr':_0x352e48(0x97),'bFgYn':function(_0x1086f2,_0x354695){return _0x1086f2===_0x354695;},'xdunw':_0x352e48(0x8a)};return new Promise(_0x3b7c60=>{const _0x4d383e=_0x352e48,_0x262aa5={'TUPhP':function(_0x1f7a69,_0x1628c5){return _0x1f7a69(_0x1628c5);}},_0x2d5347=['plugin',_0x4d383e(0x91),_0x1e2ab6['ieYwI']];_0x472b6c&&_0x2d5347['push']('--scope',_0x472b6c);const _0x1d6c69=_0x1e2ab6[_0x4d383e(0xa4)](spawn,_0x1e2ab6[_0x4d383e(0xad)],_0x2d5347,{'stdio':[_0x1e2ab6[_0x4d383e(0x93)],'ignore','ignore'],'cwd':_0x472b6c?getProjectRoot():undefined,'shell':_0x1e2ab6['bFgYn'](process[_0x4d383e(0xab)],_0x4d383e(0x98))});_0x1d6c69['on'](_0x1e2ab6['xdunw'],_0x75330e=>{const _0x1b87cc=_0x4d383e;_0x1e2ab6[_0x1b87cc(0xb2)](_0x3b7c60,_0x1e2ab6['RiesY'](_0x75330e,0x0));}),_0x1d6c69['on'](_0x4d383e(0xa6),()=>{const _0x52aadf=_0x4d383e;_0x262aa5[_0x52aadf(0x90)](_0x3b7c60,![]);});});}async function removeMarketplace(){const _0x454aaf=_0x280190,_0x1630d4={'fSQmm':function(_0x5b3601,_0xc1f432){return _0x5b3601===_0xc1f432;},'zJgXV':function(_0x3c1372,_0x8fc1ae,_0x63bf80,_0x8f507d){return _0x3c1372(_0x8fc1ae,_0x63bf80,_0x8f507d);},'RbPWI':'trailhead','PwFhK':_0x454aaf(0x97),'iRyJB':function(_0x49ddb5,_0x5c8020){return _0x49ddb5===_0x5c8020;},'UazUa':'win32','LxnUE':_0x454aaf(0x8a),'ohltW':_0x454aaf(0xa6)};return new Promise(_0x3b4450=>{const _0x396976=_0x454aaf,_0x30362d={'xAJsm':function(_0x30d974,_0x47bb14){return _0x30d974(_0x47bb14);}},_0x4e186a=_0x1630d4[_0x396976(0xb1)](spawn,'claude',['plugin',_0x396976(0x94),'remove',_0x1630d4[_0x396976(0x8f)]],{'stdio':[_0x1630d4[_0x396976(0xb4)],_0x396976(0x97),'ignore'],'shell':_0x1630d4[_0x396976(0xb8)](process[_0x396976(0xab)],_0x1630d4['UazUa'])});_0x4e186a['on'](_0x1630d4[_0x396976(0x8d)],_0x1f18e9=>{_0x3b4450(_0x1630d4['fSQmm'](_0x1f18e9,0x0));}),_0x4e186a['on'](_0x1630d4[_0x396976(0x8e)],()=>{const _0x13c524=_0x396976;_0x30362d[_0x13c524(0xba)](_0x3b4450,![]);});});}export async function clean(){const _0x26a193=_0x280190,_0x25be88={'oCUcA':function(_0x406b11){return _0x406b11();},'wBuRb':function(_0x3cd090,_0x159cec){return _0x3cd090(_0x159cec);},'MaaZP':function(_0x5efc71,_0xae3f77,_0x3b4e89){return _0x5efc71(_0xae3f77,_0x3b4e89);},'uiOaZ':function(_0xcf5182,_0x2c8284,_0x49a094){return _0xcf5182(_0x2c8284,_0x49a094);},'TwtaV':function(_0x5b3805,_0x1d487d){return _0x5b3805(_0x1d487d);},'EUgDB':function(_0xbb31c,_0x442233,_0x1b9ba3){return _0xbb31c(_0x442233,_0x1b9ba3);},'moqSP':function(_0x5506c1,_0x241330,_0x59bea8){return _0x5506c1(_0x241330,_0x59bea8);},'ERAJU':_0x26a193(0xb6),'QgieX':'opencode.json','DMnTI':'user','bvJkL':function(_0x34477c){return _0x34477c();},'BuaWv':_0x26a193(0xb3),'Mbplq':'\x0a✅\x20Cleanup\x20complete!\x0a'};console['log']('\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a');let _0x1ef358=![];try{await _0x25be88['oCUcA'](deleteAllCredentials),console['log']('✓\x20Removed\x20stored\x20credentials'),_0x1ef358=!![];}catch{}const _0x2010fe=_0x25be88[_0x26a193(0x88)](getCacheFile);_0x25be88[_0x26a193(0xae)](existsSync,_0x2010fe)&&(await _0x25be88[_0x26a193(0xae)](rm,_0x2010fe),_0x1ef358=!![]);const _0x3beb86=getRangerDir();existsSync(_0x3beb86)&&(await rm(_0x3beb86,{'recursive':!![]}),console[_0x26a193(0xa5)]('✓\x20Removed\x20.ranger/\x20directory'),_0x1ef358=!![]);const _0x242988=getProjectSkillsDir();for(const _0x29c76a of skillsToRemove){const _0x1ff3a5=_0x25be88['MaaZP'](join,_0x242988,_0x29c76a);existsSync(_0x1ff3a5)&&(await rm(_0x1ff3a5,{'recursive':!![]}),console[_0x26a193(0xa5)]('✓\x20Removed\x20project\x20skill:\x20'+_0x29c76a),_0x1ef358=!![]);}const _0x1b6469=getUserSkillsDir();for(const _0x3b9906 of skillsToRemove){const _0x2013fa=_0x25be88[_0x26a193(0x96)](join,_0x1b6469,_0x3b9906);_0x25be88['wBuRb'](existsSync,_0x2013fa)&&(await _0x25be88[_0x26a193(0x96)](rm,_0x2013fa,{'recursive':!![]}),console[_0x26a193(0xa5)](_0x26a193(0xb0)+_0x3b9906),_0x1ef358=!![]);}const _0x2faeee=getOpencodeSkillsDir(_0x26a193(0xb6));for(const _0x399527 of skillsToRemove){const _0x4c724c=_0x25be88[_0x26a193(0x96)](join,_0x2faeee,_0x399527);existsSync(_0x4c724c)&&(await _0x25be88['MaaZP'](rm,_0x4c724c,{'recursive':!![]}),console[_0x26a193(0xa5)](_0x26a193(0x99)+_0x399527),_0x1ef358=!![]);}const _0x23a413=getOpencodeSkillsDir('user');for(const _0x40d69f of skillsToRemove){const _0x2d9549=_0x25be88[_0x26a193(0xb7)](join,_0x23a413,_0x40d69f);_0x25be88['TwtaV'](existsSync,_0x2d9549)&&(await _0x25be88['EUgDB'](rm,_0x2d9549,{'recursive':!![]}),console[_0x26a193(0xa5)]('✓\x20Removed\x20OpenCode\x20user\x20skill:\x20'+_0x40d69f),_0x1ef358=!![]);}const _0x1b865d=_0x25be88['moqSP'](join,getOpencodeConfigDir(_0x25be88[_0x26a193(0x9b)]),_0x25be88['QgieX']);await removeOpencodePluginConfig(_0x1b865d)&&(console['log'](_0x26a193(0x8b)),_0x1ef358=!![]);const _0x270898=_0x25be88[_0x26a193(0xa3)](join,getOpencodeConfigDir(_0x25be88['DMnTI']),'opencode.json');await removeOpencodePluginConfig(_0x270898)&&(console['log'](_0x26a193(0xa7)),_0x1ef358=!![]);const _0x4f0ffb=await _0x25be88['oCUcA'](uninstallClaudePlugin);_0x4f0ffb&&(console['log']('✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)'),_0x1ef358=!![]);const _0x5d0394=await _0x25be88['wBuRb'](uninstallClaudePlugin,'project');_0x5d0394&&(console['log']('✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)'),_0x1ef358=!![]);const _0x27c895=await _0x25be88[_0x26a193(0x9c)](removeMarketplace);_0x27c895&&(console['log'](_0x25be88['BuaWv']),_0x1ef358=!![]),_0x1ef358?console['log'](_0x25be88[_0x26a193(0xbb)]):console['log']('Nothing\x20to\x20clean\x20up.\x0a');}
|
|
1
|
+
const _0x5a673b=_0xc3db;(function(_0x2d4dfa,_0x1b3dcf){const _0x4d421e=_0xc3db,_0x286f7e=_0x2d4dfa();while(!![]){try{const _0x95e9f5=parseInt(_0x4d421e(0x199))/0x1*(parseInt(_0x4d421e(0x19f))/0x2)+parseInt(_0x4d421e(0x189))/0x3*(parseInt(_0x4d421e(0x17f))/0x4)+-parseInt(_0x4d421e(0x1a1))/0x5*(-parseInt(_0x4d421e(0x1a7))/0x6)+parseInt(_0x4d421e(0x198))/0x7+-parseInt(_0x4d421e(0x191))/0x8*(-parseInt(_0x4d421e(0x1aa))/0x9)+-parseInt(_0x4d421e(0x176))/0xa*(-parseInt(_0x4d421e(0x1a9))/0xb)+parseInt(_0x4d421e(0x171))/0xc*(-parseInt(_0x4d421e(0x18a))/0xd);if(_0x95e9f5===_0x1b3dcf)break;else _0x286f7e['push'](_0x286f7e['shift']());}catch(_0x42a0e2){_0x286f7e['push'](_0x286f7e['shift']());}}}(_0x2cb9,0xb1650));import{rm,readFile,writeFile}from'fs/promises';import{join}from'path';function _0xc3db(_0x1e79a2,_0x93aa80){_0x1e79a2=_0x1e79a2-0x16a;const _0x2cb9a0=_0x2cb9();let _0xc3db31=_0x2cb9a0[_0x1e79a2];return _0xc3db31;}import{existsSync}from'fs';import{spawn}from'child_process';import{deleteAllCredentials}from'./utils/keychain.js';import{getProjectRoot,getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getCacheFile}from'./utils/sessionCache.js';import{getOpencodeConfigDir,getOpencodeSkillsDir}from'./utils/opencodeConfig.js';const skillsToRemove=[_0x5a673b(0x1a3),_0x5a673b(0x179),'bug-bash','e2e-test-recommender'],opencodePluginName='@ranger-testing/opencode-plugin';function parseJsonc(_0x5b25de){const _0x3e99c8=_0x5a673b,_0x10d054=_0x5b25de[_0x3e99c8(0x188)](/\/\*[\s\S]*?\*\//g,''),_0x718dfe=_0x10d054['replace'](/^\s*\/\/.*$/gm,''),_0x145f3e=_0x718dfe['replace'](/,\s*([}\]])/g,'$1');return JSON['parse'](_0x145f3e);}function _0x2cb9(){const _0x4810bb=['string','wmQJy','ignore','jhnwE','✓\x20Removed\x20.ranger/\x20directory','Nothing\x20to\x20clean\x20up.\x0a','768wsmywM','✓\x20Removed\x20project\x20skill:\x20','HmcwE','nCyhS','utf-8','--scope','PnPnK','7518364NhDymE','1voBWxK','claude','lTcEC','dWUdR','TzgQi','✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)','2765458TFuCnA','eSMXX','24385GVYJVO','Iwker','ranger','marketplace','✓\x20Removed\x20stored\x20credentials','length','564fFLvkf','MydBS','53878keuVFF','855XtaJko','yoDkW','project','TuqiF','plugin','✓\x20Removed\x20OpenCode\x20project\x20skill:\x20','log','JHMow','Ikmdj','WuiDP','xsRKq','trailhead','TtVyv','37940676afCxiw','Bdnat','mFMaJ','ranger@trailhead','platform','410DJKAti','QSxIw','hXsSK','feature-tracker','YqzoZ','LTBMK','✓\x20Removed\x20trailhead\x20marketplace','close','WmcsD','37228wkNEFw','lRQmz','wpSwk','JZMdK','FNVvx','error','remove','kmPPo','✓\x20Removed\x20OpenCode\x20user\x20skill:\x20','replace','246jNQHOi','13xLyNdG'];_0x2cb9=function(){return _0x4810bb;};return _0x2cb9();}async function removeOpencodePluginConfig(_0x15324c){const _0xbcdc6b=_0x5a673b,_0x3c31ad={'JZZaD':function(_0x21b937,_0xf15a0d){return _0x21b937!==_0xf15a0d;},'kmPPo':function(_0x3eaa14,_0x532a96){return _0x3eaa14(_0x532a96);},'LTBMK':function(_0x340f49,_0x1c5371,_0x6e2884){return _0x340f49(_0x1c5371,_0x6e2884);},'YqzoZ':_0xbcdc6b(0x195),'yoDkW':function(_0x15bbf8,_0x3f4f84){return _0x15bbf8(_0x3f4f84);},'TzgQi':function(_0x4b3257,_0x38e13f){return _0x4b3257===_0x38e13f;},'wLUdG':function(_0x1f842d,_0x41783f,_0x3b2895){return _0x1f842d(_0x41783f,_0x3b2895);},'eSMXX':function(_0x1b367a,_0x2b845e){return _0x1b367a+_0x2b845e;}};if(!_0x3c31ad[_0xbcdc6b(0x186)](existsSync,_0x15324c))return![];let _0x47079a;try{const _0x1b07b6=await _0x3c31ad[_0xbcdc6b(0x17b)](readFile,_0x15324c,_0x3c31ad[_0xbcdc6b(0x17a)]);_0x47079a=_0x3c31ad[_0xbcdc6b(0x1ab)](parseJsonc,_0x1b07b6);}catch{return![];}const _0x188a45=Array['isArray'](_0x47079a[_0xbcdc6b(0x1ae)])?_0x47079a['plugin']:[];if(_0x3c31ad['TzgQi'](_0x188a45[_0xbcdc6b(0x1a6)],0x0))return![];const _0x55887=_0x188a45['filter'](_0x1a05b6=>{const _0x6645bc=_0xbcdc6b;if(_0x3c31ad['JZZaD'](typeof _0x1a05b6,_0x6645bc(0x18b)))return!![];return _0x1a05b6!==opencodePluginName;});if(_0x55887[_0xbcdc6b(0x1a6)]===_0x188a45[_0xbcdc6b(0x1a6)])return![];return _0x3c31ad[_0xbcdc6b(0x19d)](_0x55887[_0xbcdc6b(0x1a6)],0x0)?delete _0x47079a[_0xbcdc6b(0x1ae)]:_0x47079a['plugin']=_0x55887,await _0x3c31ad['wLUdG'](writeFile,_0x15324c,_0x3c31ad[_0xbcdc6b(0x1a0)](JSON['stringify'](_0x47079a,null,0x2),'\x0a')),!![];}async function uninstallClaudePlugin(_0x320750){const _0x3abd2c=_0x5a673b,_0xf80245={'wmQJy':function(_0x24ed0c,_0x113c86){return _0x24ed0c(_0x113c86);},'dWUdR':function(_0x1b5782,_0x2beb05){return _0x1b5782===_0x2beb05;},'Bdnat':'uninstall','HmcwE':_0x3abd2c(0x174),'MydBS':_0x3abd2c(0x196),'wpSwk':_0x3abd2c(0x19a),'lRQmz':_0x3abd2c(0x17d)};return new Promise(_0x15b247=>{const _0x59ddd4=_0x3abd2c,_0xa62d80=['plugin',_0xf80245[_0x59ddd4(0x172)],_0xf80245[_0x59ddd4(0x193)]];_0x320750&&_0xa62d80['push'](_0xf80245[_0x59ddd4(0x1a8)],_0x320750);const _0x205c6e=spawn(_0xf80245[_0x59ddd4(0x181)],_0xa62d80,{'stdio':['ignore',_0x59ddd4(0x18d),_0x59ddd4(0x18d)],'cwd':_0x320750?getProjectRoot():undefined,'shell':process['platform']==='win32'});_0x205c6e['on'](_0xf80245[_0x59ddd4(0x180)],_0x4d47a2=>{const _0x5a0749=_0x59ddd4;_0xf80245[_0x5a0749(0x18c)](_0x15b247,_0xf80245[_0x5a0749(0x19c)](_0x4d47a2,0x0));}),_0x205c6e['on'](_0x59ddd4(0x184),()=>{_0x15b247(![]);});});}async function removeMarketplace(){const _0x1aae32=_0x5a673b,_0x15ad1f={'TtVyv':function(_0x4aa2dc,_0x39923e){return _0x4aa2dc===_0x39923e;},'EFQer':_0x1aae32(0x1ae),'TuqiF':_0x1aae32(0x1a4),'WuiDP':_0x1aae32(0x185),'Ikmdj':_0x1aae32(0x18d),'nCyhS':_0x1aae32(0x17d),'Iwker':_0x1aae32(0x184)};return new Promise(_0x11de49=>{const _0x290c1a=_0x1aae32,_0x43842a={'WmcsD':function(_0x3c0a40,_0x364a8d){return _0x3c0a40(_0x364a8d);}},_0x49752f=spawn('claude',[_0x15ad1f['EFQer'],_0x15ad1f[_0x290c1a(0x1ad)],_0x15ad1f[_0x290c1a(0x16d)],_0x290c1a(0x16f)],{'stdio':[_0x290c1a(0x18d),_0x290c1a(0x18d),_0x15ad1f[_0x290c1a(0x16c)]],'shell':_0x15ad1f[_0x290c1a(0x170)](process[_0x290c1a(0x175)],'win32')});_0x49752f['on'](_0x15ad1f[_0x290c1a(0x194)],_0x171772=>{_0x11de49(_0x15ad1f['TtVyv'](_0x171772,0x0));}),_0x49752f['on'](_0x15ad1f[_0x290c1a(0x1a2)],()=>{const _0x15fb3c=_0x290c1a;_0x43842a[_0x15fb3c(0x17e)](_0x11de49,![]);});});}export async function clean(){const _0x38224c=_0x5a673b,_0xdd01d6={'omGfX':'\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','QSxIw':function(_0x289845){return _0x289845();},'PnPnK':function(_0x1cbd28,_0x2151a1){return _0x1cbd28(_0x2151a1);},'ZNyVs':function(_0x10dd07){return _0x10dd07();},'jhnwE':function(_0x4de4e3,_0x447dba){return _0x4de4e3(_0x447dba);},'hXsSK':function(_0x5b4e3c,_0x9b79c,_0x3489ba){return _0x5b4e3c(_0x9b79c,_0x3489ba);},'MPKfL':function(_0x3a8da2,_0x133aae,_0xa4279){return _0x3a8da2(_0x133aae,_0xa4279);},'lTcEC':function(_0x4b19cd,_0x3211f6,_0x4cba41){return _0x4b19cd(_0x3211f6,_0x4cba41);},'sYZoN':function(_0x101096,_0x5dd40f){return _0x101096(_0x5dd40f);},'ZnYsQ':'user','JZMdK':function(_0x2e29b1,_0x360af1){return _0x2e29b1(_0x360af1);},'xsRKq':function(_0x53d0a7,_0x3aeb48,_0x17d863){return _0x53d0a7(_0x3aeb48,_0x17d863);},'FNVvx':function(_0x403722,_0xf12c93,_0x4737eb){return _0x403722(_0xf12c93,_0x4737eb);},'mFMaJ':function(_0x381bf8,_0xcd259){return _0x381bf8(_0xcd259);},'wSBvN':_0x38224c(0x19e),'xftVI':'✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)','JHMow':_0x38224c(0x1ac),'ABnoM':'✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)'};console[_0x38224c(0x16a)](_0xdd01d6['omGfX']);let _0x57c021=![];try{await _0xdd01d6[_0x38224c(0x177)](deleteAllCredentials),console[_0x38224c(0x16a)](_0x38224c(0x1a5)),_0x57c021=!![];}catch{}const _0x1e07ae=getCacheFile();_0xdd01d6[_0x38224c(0x197)](existsSync,_0x1e07ae)&&(await _0xdd01d6['PnPnK'](rm,_0x1e07ae),_0x57c021=!![]);const _0x2c4cc1=_0xdd01d6['ZNyVs'](getRangerDir);_0xdd01d6[_0x38224c(0x18e)](existsSync,_0x2c4cc1)&&(await _0xdd01d6[_0x38224c(0x178)](rm,_0x2c4cc1,{'recursive':!![]}),console['log'](_0x38224c(0x18f)),_0x57c021=!![]);const _0x53350b=getProjectSkillsDir();for(const _0x125311 of skillsToRemove){const _0x4dc2f8=_0xdd01d6['MPKfL'](join,_0x53350b,_0x125311);existsSync(_0x4dc2f8)&&(await rm(_0x4dc2f8,{'recursive':!![]}),console[_0x38224c(0x16a)](_0x38224c(0x192)+_0x125311),_0x57c021=!![]);}const _0x36eeb3=getUserSkillsDir();for(const _0x5d110e of skillsToRemove){const _0xccf543=join(_0x36eeb3,_0x5d110e);existsSync(_0xccf543)&&(await rm(_0xccf543,{'recursive':!![]}),console['log']('✓\x20Removed\x20user\x20skill:\x20'+_0x5d110e),_0x57c021=!![]);}const _0x1a7daa=getOpencodeSkillsDir('project');for(const _0x32c930 of skillsToRemove){const _0xec0c91=_0xdd01d6[_0x38224c(0x19b)](join,_0x1a7daa,_0x32c930);_0xdd01d6[_0x38224c(0x197)](existsSync,_0xec0c91)&&(await rm(_0xec0c91,{'recursive':!![]}),console[_0x38224c(0x16a)](_0x38224c(0x1af)+_0x32c930),_0x57c021=!![]);}const _0x5c2e89=_0xdd01d6['sYZoN'](getOpencodeSkillsDir,_0xdd01d6['ZnYsQ']);for(const _0x11d49a of skillsToRemove){const _0x2d45f9=join(_0x5c2e89,_0x11d49a);_0xdd01d6[_0x38224c(0x182)](existsSync,_0x2d45f9)&&(await _0xdd01d6[_0x38224c(0x16e)](rm,_0x2d45f9,{'recursive':!![]}),console[_0x38224c(0x16a)](_0x38224c(0x187)+_0x11d49a),_0x57c021=!![]);}const _0x4e7d92=_0xdd01d6[_0x38224c(0x183)](join,_0xdd01d6[_0x38224c(0x173)](getOpencodeConfigDir,_0x38224c(0x1ac)),'opencode.json');await _0xdd01d6['JZMdK'](removeOpencodePluginConfig,_0x4e7d92)&&(console['log']('✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)'),_0x57c021=!![]);const _0x104f16=join(getOpencodeConfigDir('user'),'opencode.json');await removeOpencodePluginConfig(_0x104f16)&&(console[_0x38224c(0x16a)](_0xdd01d6['wSBvN']),_0x57c021=!![]);const _0x144b0f=await uninstallClaudePlugin();_0x144b0f&&(console['log'](_0xdd01d6['xftVI']),_0x57c021=!![]);const _0x549184=await _0xdd01d6['sYZoN'](uninstallClaudePlugin,_0xdd01d6[_0x38224c(0x16b)]);_0x549184&&(console['log'](_0xdd01d6['ABnoM']),_0x57c021=!![]);const _0x4e234f=await removeMarketplace();_0x4e234f&&(console[_0x38224c(0x16a)](_0x38224c(0x17c)),_0x57c021=!![]),_0x57c021?console[_0x38224c(0x16a)]('\x0a✅\x20Cleanup\x20complete!\x0a'):console[_0x38224c(0x16a)](_0x38224c(0x190));}
|
package/build/commands/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _0x16fa(){const _0x5a3741=['undefined','Key\x20\x22','obtCV','uDMYz','\x20=\x20','SGMfK',':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22','endsWith','(not\x20set)','7304990pWbwsH','\x20<key>\x22\x20to\x20remove\x20individual\x20values.','9FrqdWY','isNaN','LKCYd','forceLogin','Removed\x20','\x20\x20Note:\x20\x22','log','bYeAR','mjqtv','keys','local','TPZCy','true','uRfSf','parse','Invalid\x20value\x20for\x20','7cMXesr','ooTSl','headless','PQciP','510590KkDVxM','pEOUd','18ezLJvt','jnUcY','5018804vlqcoV','8128648XffnLx','Set\x20','MjFse','kind','cloud','\x20for\x20\x22','uWpzV','PAyJC','stringify','rThbR','\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22','VRyBk','false','1637752MEZsgD','\x22\x20not\x20found','3660504FEQask','19050830NoNZiU'];_0x16fa=function(){return _0x5a3741;};return _0x16fa();}const _0xfe63c7=_0x2c7f;(function(_0xa65efc,_0x10a410){const _0x4621dc=_0x2c7f,_0x1c3c89=_0xa65efc();while(!![]){try{const _0x3ba3de=parseInt(_0x4621dc(0x14d))/0x1+-parseInt(_0x4621dc(0x13b))/0x2*(-parseInt(_0x4621dc(0x127))/0x3)+parseInt(_0x4621dc(0x13f))/0x4+parseInt(_0x4621dc(0x125))/0x5+parseInt(_0x4621dc(0x14f))/0x6+parseInt(_0x4621dc(0x137))/0x7*(-parseInt(_0x4621dc(0x140))/0x8)+parseInt(_0x4621dc(0x13d))/0x9*(-parseInt(_0x4621dc(0x150))/0xa);if(_0x3ba3de===_0x10a410)break;else _0x1c3c89['push'](_0x1c3c89['shift']());}catch(_0x246a6a){_0x1c3c89['push'](_0x1c3c89['shift']());}}}(_0x16fa,0xdc805));import{existsSync}from'fs';function _0x2c7f(_0x4ebe9e,_0x18d8b3){_0x4ebe9e=_0x4ebe9e-0x123;const _0x16fa3b=_0x16fa();let _0x2c7fcb=_0x16fa3b[_0x4ebe9e];return _0x2c7fcb;}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=[_0xfe63c7(0x139),'allowInsecureLocalhost',_0xfe63c7(0x12a)];function parseLocalValue(_0x2d6b83,_0x568125){const _0x26ee97=_0xfe63c7,_0x13fc34={'TPZCy':_0x26ee97(0x14c)};if(BOOLEAN_KEYS['includes'](_0x2d6b83)){if(_0x568125===_0x26ee97(0x133))return!![];if(_0x568125===_0x13fc34[_0x26ee97(0x132)])return![];throw new Error(_0x26ee97(0x136)+_0x2d6b83+_0x26ee97(0x157));}return _0x568125;}function parseOverrideValue(_0x12326d){const _0x27fc2a=_0xfe63c7,_0x22690c={'SRjar':function(_0x9b48b2,_0x2d6b70){return _0x9b48b2===_0x2d6b70;},'MjFse':_0x27fc2a(0x133),'ZTXou':function(_0x12a8b8,_0x1d477b){return _0x12a8b8===_0x1d477b;},'uWpzV':'false','THBgh':function(_0x6888bb,_0xa10ea4){return _0x6888bb===_0xa10ea4;},'OrYWw':function(_0x44fadf,_0x1f146a){return _0x44fadf(_0x1f146a);}};if(_0x22690c['SRjar'](_0x12326d,_0x22690c[_0x27fc2a(0x142)]))return!![];if(_0x22690c['ZTXou'](_0x12326d,_0x22690c[_0x27fc2a(0x146)]))return![];if(_0x22690c['THBgh'](_0x12326d,'null'))return null;if(_0x12326d===_0x27fc2a(0x151))return undefined;if(/^-?\d+$/['test'](_0x12326d)){const _0x5bf3b6=_0x22690c['OrYWw'](Number,_0x12326d);if(Number['isSafeInteger'](_0x5bf3b6))return _0x5bf3b6;}if(/^-?\d+\.\d+$/['test'](_0x12326d)){const _0x4b8134=Number(_0x12326d);if(!Number[_0x27fc2a(0x128)](_0x4b8134))return _0x4b8134;}const _0x3c5bf5=_0x12326d['trim']();if(_0x3c5bf5['startsWith']('{')&&_0x3c5bf5[_0x27fc2a(0x123)]('}')||_0x3c5bf5['startsWith']('[')&&_0x3c5bf5[_0x27fc2a(0x123)](']'))try{return JSON[_0x27fc2a(0x135)](_0x3c5bf5);}catch{}return _0x12326d;}async function resolveProfileTarget(_0x1d22a8){const _0xecc962=_0xfe63c7,_0x296c11={'rThbR':function(_0x4808d9,_0x5a8081){return _0x4808d9(_0x5a8081);},'PAyJC':function(_0x57e7ab,_0x36549a){return _0x57e7ab(_0x36549a);},'MdcxS':'cloud','rstXr':_0xecc962(0x131)},_0x371d66=existsSync(_0x296c11[_0xecc962(0x149)](getEnvDir,_0x1d22a8));let _0x1205eb=![];try{const _0x59872f=await fetchCloudProfile(_0x1d22a8);_0x1205eb=_0x296c11[_0xecc962(0x147)](Boolean,_0x59872f);}catch{}if(_0x1205eb)return{'kind':_0x296c11['MdcxS'],'alsoExistsElsewhere':_0x371d66};if(_0x371d66)return{'kind':_0x296c11['rstXr'],'alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x1d22a8+'\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'+_0x1d22a8);}function printDualExistsHint(_0x47947b){const _0x239fbe=_0xfe63c7;console[_0x239fbe(0x12d)](_0x239fbe(0x12c)+_0x47947b+'\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.');}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x2a8d31){const _0x519d84=_0xfe63c7,_0x26e629={'uRfSf':function(_0x4e39e1){return _0x4e39e1();},'dBYCH':function(_0x573ca8,_0x395f34,_0x2125e1){return _0x573ca8(_0x395f34,_0x2125e1);},'nzRds':function(_0x42694c,_0x66b6e6){return _0x42694c??_0x66b6e6;}},_0x1c3770=await fetchCloudProfile(_0x2a8d31),_0x53a48d=readProfileOverrides(_0x26e629[_0x519d84(0x134)](getProjectPath),_0x2a8d31);return _0x26e629['dBYCH'](mergeCloudProfileSettings,_0x1c3770?.['settings']??{},_0x26e629['nzRds'](_0x53a48d,undefined));}export async function configSet(_0x282751,_0xa773c9,_0x5f0b0a){const _0x3123d8=_0xfe63c7,_0x520a2e={'mjqtv':function(_0x5b071d,_0x169e86){return _0x5b071d(_0x169e86);},'twjuV':function(_0x1d3ca1,_0x521dc4){return _0x1d3ca1===_0x521dc4;},'uDMYz':function(_0x4f9a12){return _0x4f9a12();},'SGMfK':function(_0x5406b9,_0x8a4993,_0x37b652,_0x3f5c90,_0x4cea23){return _0x5406b9(_0x8a4993,_0x37b652,_0x3f5c90,_0x4cea23);}},_0x50e78d=await _0x520a2e[_0x3123d8(0x12f)](resolveProfileTarget,_0x282751);if(_0x520a2e['twjuV'](_0x50e78d[_0x3123d8(0x143)],'cloud')){if(_0x50e78d['alsoExistsElsewhere'])printDualExistsHint(_0x282751);const _0x2a2826=parseOverrideValue(_0x5f0b0a);setProfileOverride(_0x520a2e[_0x3123d8(0x154)](getProjectPath),_0x282751,_0xa773c9,_0x2a2826),console['log'](_0x3123d8(0x141)+_0xa773c9+'\x20=\x20'+JSON[_0x3123d8(0x148)](_0x2a2826)+_0x3123d8(0x145)+_0x282751+'\x22');return;}const _0xa1ce43=parseLocalValue(_0xa773c9,_0x5f0b0a);_0x520a2e[_0x3123d8(0x156)](setProfileOverride,_0x520a2e['uDMYz'](getProjectPath),_0x282751,_0xa773c9,_0xa1ce43),console['log'](_0x3123d8(0x141)+_0xa773c9+_0x3123d8(0x155)+_0xa1ce43+'\x20for\x20\x22'+_0x282751+'\x22');}export async function configGet(_0x469c9e,_0x22b120){const _0x52ac66=_0xfe63c7,_0x305e94={'bYeAR':function(_0x5795f7,_0x1f7dc0){return _0x5795f7(_0x1f7dc0);},'poVYw':'cloud','jnUcY':function(_0x161403,_0x98f037,_0x595f7f){return _0x161403(_0x98f037,_0x595f7f);},'LKCYd':function(_0x4096eb,_0x2c9a54){return _0x4096eb===_0x2c9a54;},'obtCV':'object'},_0x4e9abd=await _0x305e94[_0x52ac66(0x12e)](resolveProfileTarget,_0x469c9e);if(_0x4e9abd['kind']===_0x305e94['poVYw']){const _0x5b8923=await loadEffectiveCloudSettings(_0x469c9e),_0x4de384=_0x305e94[_0x52ac66(0x13e)](getNestedValue,_0x5b8923,_0x22b120);if(_0x4de384===undefined)console[_0x52ac66(0x12d)](_0x52ac66(0x124));else _0x305e94[_0x52ac66(0x129)](typeof _0x4de384,_0x305e94[_0x52ac66(0x153)])?console['log'](JSON['stringify'](_0x4de384,null,0x2)):console[_0x52ac66(0x12d)](_0x4de384);return;}const _0x3831cd=await loadSettings(_0x469c9e),_0x220cc0=getNestedValue(_0x3831cd,_0x22b120);if(_0x220cc0===undefined)console['log']('(not\x20set)');else typeof _0x220cc0==='object'?console[_0x52ac66(0x12d)](JSON[_0x52ac66(0x148)](_0x220cc0,null,0x2)):console['log'](_0x220cc0);}export async function configList(_0x1e65b7){const _0x279c1b=_0xfe63c7,_0xab14c2={'VRyBk':function(_0x2cb693,_0xd48c6){return _0x2cb693(_0xd48c6);},'PQciP':function(_0x58d28a,_0x26ca33){return _0x58d28a(_0x26ca33);}},_0x149073=await resolveProfileTarget(_0x1e65b7);if(_0x149073['kind']===_0x279c1b(0x144)){const _0x5a9ba8=await loadEffectiveCloudSettings(_0x1e65b7);if(!_0x5a9ba8||Object[_0x279c1b(0x130)](_0x5a9ba8)['length']===0x0){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x1e65b7+'\x22');return;}console[_0x279c1b(0x12d)](JSON['stringify'](_0x5a9ba8,null,0x2));return;}const _0x1a0ec=getSettingsPath(_0x1e65b7);if(!_0xab14c2[_0x279c1b(0x14b)](existsSync,_0x1a0ec)){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x1e65b7+'\x22');return;}const _0x5de22f=await loadSettings(_0x1e65b7),_0x1e4da5=_0xab14c2[_0x279c1b(0x13a)](formatSettings,_0x5de22f);!_0x1e4da5?console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x1e65b7+'\x22'):console['log'](_0x1e4da5);}export async function configUnset(_0x2117cc,_0x5cb885){const _0x8526b2=_0xfe63c7,_0x35f68c={'ooTSl':function(_0x1cd4fa){return _0x1cd4fa();},'pEOUd':function(_0x19498a,_0x195146,_0x39283b,_0x1e3198){return _0x19498a(_0x195146,_0x39283b,_0x1e3198);},'DUHzj':function(_0x478410,_0x3be1ce,_0x3474bc){return _0x478410(_0x3be1ce,_0x3474bc);}},_0x58aae6=await resolveProfileTarget(_0x2117cc);if(_0x58aae6[_0x8526b2(0x143)]==='cloud'){if(_0x58aae6['alsoExistsElsewhere'])printDualExistsHint(_0x2117cc);const _0x16b30d=unsetProfileOverride(_0x35f68c[_0x8526b2(0x138)](getProjectPath),_0x2117cc,_0x5cb885);_0x16b30d?console[_0x8526b2(0x12d)]('Removed\x20'+_0x5cb885+'\x20for\x20\x22'+_0x2117cc+'\x22'):console[_0x8526b2(0x12d)](_0x8526b2(0x152)+_0x5cb885+_0x8526b2(0x14e));return;}const _0x6cf307=_0x35f68c[_0x8526b2(0x13c)](unsetProfileOverride,getProjectPath(),_0x2117cc,_0x5cb885);if(_0x6cf307){console['log'](_0x8526b2(0x12b)+_0x5cb885);return;}const _0x4f1dd4=await loadSettings(_0x2117cc),_0x1c9394=_0x35f68c['DUHzj'](deleteNestedValue,_0x4f1dd4,_0x5cb885);_0x1c9394?console['log']('Key\x20\x22'+_0x5cb885+_0x8526b2(0x14a)+_0x2117cc+'\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.'):console['log'](_0x8526b2(0x152)+_0x5cb885+_0x8526b2(0x14e));}export async function configReset(_0x4c6958){const _0x109551=_0xfe63c7,_0x57bade={'aqoDD':function(_0x518a6f,_0xdc9ff7){return _0x518a6f(_0xdc9ff7);},'puyYC':_0x109551(0x144)},_0x4cffc8=await _0x57bade['aqoDD'](resolveProfileTarget,_0x4c6958);if(_0x4cffc8['kind']===_0x57bade['puyYC']){resetProfileOverrides(getProjectPath(),_0x4c6958),console['log']('Cleared\x20local\x20overrides\x20for\x20\x22'+_0x4c6958+'\x22');return;}console[_0x109551(0x12d)]('\x22'+_0x4c6958+'\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20'+_0x4c6958+_0x109551(0x126));}
|
|
1
|
+
(function(_0x565879,_0x286d18){const _0x541775=_0x4d95,_0x229167=_0x565879();while(!![]){try{const _0x423643=parseInt(_0x541775(0xb7))/0x1*(parseInt(_0x541775(0xcb))/0x2)+parseInt(_0x541775(0xcc))/0x3*(parseInt(_0x541775(0xc2))/0x4)+-parseInt(_0x541775(0xdc))/0x5*(parseInt(_0x541775(0xe2))/0x6)+parseInt(_0x541775(0xd7))/0x7*(-parseInt(_0x541775(0xca))/0x8)+parseInt(_0x541775(0xb6))/0x9+parseInt(_0x541775(0xd2))/0xa*(parseInt(_0x541775(0xc6))/0xb)+parseInt(_0x541775(0xd4))/0xc*(-parseInt(_0x541775(0xde))/0xd);if(_0x423643===_0x286d18)break;else _0x229167['push'](_0x229167['shift']());}catch(_0x24b932){_0x229167['push'](_0x229167['shift']());}}}(_0xac86,0xbc91c));import{existsSync}from'fs';import{loadSettings,getNestedValue,deleteNestedValue,formatSettings,getSettingsPath,getEnvDir}from'./utils/settings.js';import{fetchCloudProfile}from'./utils/cloudProfile.js';import{mergeCloudProfileSettings,readProfileOverrides,resetProfileOverrides,setProfileOverride,unsetProfileOverride}from'./utils/projectsConfig.js';const BOOLEAN_KEYS=['headless','allowInsecureLocalhost','forceLogin'];function parseLocalValue(_0x277d44,_0x439ba7){const _0x3c408f=_0x4d95,_0x397ee0={'fnBLu':function(_0x22bdd0,_0x26b15c){return _0x22bdd0===_0x26b15c;},'znVXN':'false'};if(BOOLEAN_KEYS['includes'](_0x277d44)){if(_0x397ee0[_0x3c408f(0xd6)](_0x439ba7,_0x3c408f(0xc0)))return!![];if(_0x439ba7===_0x397ee0['znVXN'])return![];throw new Error('Invalid\x20value\x20for\x20'+_0x277d44+_0x3c408f(0xe1));}return _0x439ba7;}function parseOverrideValue(_0x401921){const _0x1ff0ca=_0x4d95,_0x2f791a={'rrLAY':_0x1ff0ca(0xc0),'qnvbu':function(_0x14126b,_0x2e3529){return _0x14126b===_0x2e3529;},'zVyMY':_0x1ff0ca(0xd9),'GLJWT':function(_0x2c3251,_0x50c6cc){return _0x2c3251(_0x50c6cc);}};if(_0x401921===_0x2f791a[_0x1ff0ca(0xc1)])return!![];if(_0x2f791a[_0x1ff0ca(0xdb)](_0x401921,_0x1ff0ca(0xd1)))return![];if(_0x401921===_0x2f791a[_0x1ff0ca(0xcf)])return null;if(_0x401921===_0x1ff0ca(0xc3))return undefined;if(/^-?\d+$/['test'](_0x401921)){const _0x5c9260=Number(_0x401921);if(Number[_0x1ff0ca(0xb9)](_0x5c9260))return _0x5c9260;}if(/^-?\d+\.\d+$/['test'](_0x401921)){const _0x9fb79d=_0x2f791a['GLJWT'](Number,_0x401921);if(!Number[_0x1ff0ca(0xb8)](_0x9fb79d))return _0x9fb79d;}const _0x3f8e16=_0x401921[_0x1ff0ca(0xba)]();if(_0x3f8e16[_0x1ff0ca(0xbc)]('{')&&_0x3f8e16[_0x1ff0ca(0xbd)]('}')||_0x3f8e16['startsWith']('[')&&_0x3f8e16[_0x1ff0ca(0xbd)](']'))try{return JSON['parse'](_0x3f8e16);}catch{}return _0x401921;}async function resolveProfileTarget(_0x344572){const _0x4fbb75=_0x4d95,_0x234fba={'DNfer':function(_0x3aede3,_0x48566b){return _0x3aede3(_0x48566b);}},_0x3b3e66=_0x234fba['DNfer'](existsSync,getEnvDir(_0x344572));let _0x4ea658=![];try{const _0x115329=await fetchCloudProfile(_0x344572);_0x4ea658=Boolean(_0x115329);}catch{}if(_0x4ea658)return{'kind':_0x4fbb75(0xbf),'alsoExistsElsewhere':_0x3b3e66};if(_0x3b3e66)return{'kind':'local','alsoExistsElsewhere':![]};throw new Error(_0x4fbb75(0xce)+_0x344572+'\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'+_0x344572);}function printDualExistsHint(_0x44c2e7){console['log']('\x20\x20Note:\x20\x22'+_0x44c2e7+'\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.');}function getProjectPath(){const _0x5d1a50=_0x4d95;return process[_0x5d1a50(0xbe)]();}function _0x4d95(_0x51cb8a,_0x739a0){_0x51cb8a=_0x51cb8a-0xb5;const _0xac86c=_0xac86();let _0x4d951b=_0xac86c[_0x51cb8a];return _0x4d951b;}async function loadEffectiveCloudSettings(_0x10e329){const _0xe6de9c=_0x4d95,_0x368ff7={'ZVOFy':function(_0xbfede,_0x31f877,_0x5e7226){return _0xbfede(_0x31f877,_0x5e7226);},'ESdma':function(_0x367cde){return _0x367cde();},'VTaqs':function(_0x28cbfe,_0x187d6a){return _0x28cbfe??_0x187d6a;}},_0x4e1a97=await fetchCloudProfile(_0x10e329),_0x3f998e=_0x368ff7['ZVOFy'](readProfileOverrides,_0x368ff7[_0xe6de9c(0xe0)](getProjectPath),_0x10e329);return mergeCloudProfileSettings(_0x4e1a97?.['settings']??{},_0x368ff7['VTaqs'](_0x3f998e,undefined));}export async function configSet(_0x23d61c,_0x180584,_0x4f7c83){const _0x366357=_0x4d95,_0x9fa122={'Kvntb':_0x366357(0xbf),'LPrUo':function(_0x5a302a,_0x5f086a){return _0x5a302a(_0x5f086a);}},_0x6a246e=await resolveProfileTarget(_0x23d61c);if(_0x6a246e['kind']===_0x9fa122['Kvntb']){if(_0x6a246e[_0x366357(0xb5)])_0x9fa122[_0x366357(0xd0)](printDualExistsHint,_0x23d61c);const _0x425fb9=parseOverrideValue(_0x4f7c83);setProfileOverride(getProjectPath(),_0x23d61c,_0x180584,_0x425fb9),console['log'](_0x366357(0xc9)+_0x180584+'\x20=\x20'+JSON['stringify'](_0x425fb9)+_0x366357(0xc8)+_0x23d61c+'\x22');return;}const _0x1c4b87=parseLocalValue(_0x180584,_0x4f7c83);setProfileOverride(getProjectPath(),_0x23d61c,_0x180584,_0x1c4b87),console['log']('Set\x20'+_0x180584+'\x20=\x20'+_0x1c4b87+_0x366357(0xc8)+_0x23d61c+'\x22');}function _0xac86(){const _0x2b87d1=['2koZYgd','673773BNIfEC','log','Profile\x20\x22','zVyMY','LPrUo','false','10MbJQrY','Cleared\x20local\x20overrides\x20for\x20\x22','13247772lmOzfN','xtvLI','fnBLu','122801xfNYTu','TmugI','null','nIiIE','qnvbu','270fHfiNe','BBtBG','13ivDopc','length','ESdma',':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22','54282eEUqIF','No\x20configuration\x20set\x20for\x20\x22','alsoExistsElsewhere','11413737Yugpch','248564cBVQSV','isNaN','isSafeInteger','trim','Key\x20\x22','startsWith','endsWith','cwd','cloud','true','rrLAY','20ZBpJhj','undefined','kind','Removed\x20','7590572evhdkG','stringify','\x20for\x20\x22','Set\x20','440LDXAWB'];_0xac86=function(){return _0x2b87d1;};return _0xac86();}export async function configGet(_0x4ad21,_0x44ba95){const _0x48930d=_0x4d95,_0x38d177={'nIiIE':'cloud','BBtBG':function(_0x2d56e7,_0x25a9f6,_0x94fe0b){return _0x2d56e7(_0x25a9f6,_0x94fe0b);},'RDDcR':function(_0x10f4d2,_0x296ef){return _0x10f4d2===_0x296ef;},'VwtSI':'object','iwliQ':function(_0x447b81,_0x2281b1){return _0x447b81(_0x2281b1);},'zKGOb':function(_0x13cfe5,_0x5d405c){return _0x13cfe5===_0x5d405c;}},_0x2d8023=await resolveProfileTarget(_0x4ad21);if(_0x2d8023[_0x48930d(0xc4)]===_0x38d177[_0x48930d(0xda)]){const _0x482038=await loadEffectiveCloudSettings(_0x4ad21),_0x49ae67=_0x38d177[_0x48930d(0xdd)](getNestedValue,_0x482038,_0x44ba95);if(_0x49ae67===undefined)console['log']('(not\x20set)');else _0x38d177['RDDcR'](typeof _0x49ae67,_0x38d177['VwtSI'])?console['log'](JSON[_0x48930d(0xc7)](_0x49ae67,null,0x2)):console['log'](_0x49ae67);return;}const _0x30eb30=await _0x38d177['iwliQ'](loadSettings,_0x4ad21),_0x40be7c=getNestedValue(_0x30eb30,_0x44ba95);if(_0x40be7c===undefined)console['log']('(not\x20set)');else _0x38d177['zKGOb'](typeof _0x40be7c,'object')?console[_0x48930d(0xcd)](JSON['stringify'](_0x40be7c,null,0x2)):console['log'](_0x40be7c);}export async function configList(_0x1a1066){const _0x1cb6d8=_0x4d95,_0x7a5e99={'uzfDe':function(_0x1ae027,_0x2725f9){return _0x1ae027(_0x2725f9);},'fKOmb':function(_0x8549a7,_0x3b6bce){return _0x8549a7===_0x3b6bce;},'kTQRv':function(_0x166130,_0x4c1083){return _0x166130(_0x4c1083);}},_0x5aa054=await _0x7a5e99['uzfDe'](resolveProfileTarget,_0x1a1066);if(_0x7a5e99['fKOmb'](_0x5aa054[_0x1cb6d8(0xc4)],_0x1cb6d8(0xbf))){const _0x5af6f8=await loadEffectiveCloudSettings(_0x1a1066);if(!_0x5af6f8||Object['keys'](_0x5af6f8)[_0x1cb6d8(0xdf)]===0x0){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x1a1066+'\x22');return;}console['log'](JSON[_0x1cb6d8(0xc7)](_0x5af6f8,null,0x2));return;}const _0x570b0b=getSettingsPath(_0x1a1066);if(!existsSync(_0x570b0b)){console['log'](_0x1cb6d8(0xe3)+_0x1a1066+'\x22');return;}const _0x2732e4=await loadSettings(_0x1a1066),_0x1404eb=_0x7a5e99['kTQRv'](formatSettings,_0x2732e4);!_0x1404eb?console[_0x1cb6d8(0xcd)](_0x1cb6d8(0xe3)+_0x1a1066+'\x22'):console[_0x1cb6d8(0xcd)](_0x1404eb);}export async function configUnset(_0x3908be,_0x17444d){const _0x110262=_0x4d95,_0x415a45={'Pkiti':function(_0x909ccf,_0x13104c){return _0x909ccf(_0x13104c);},'pEiaa':function(_0x481d4b,_0x1c23cf){return _0x481d4b(_0x1c23cf);},'THWvu':function(_0x3e33f1){return _0x3e33f1();},'olJCi':function(_0x437203,_0x141030,_0x248ec4,_0x85991c){return _0x437203(_0x141030,_0x248ec4,_0x85991c);}},_0x4436b0=await _0x415a45['Pkiti'](resolveProfileTarget,_0x3908be);if(_0x4436b0['kind']==='cloud'){if(_0x4436b0[_0x110262(0xb5)])_0x415a45['pEiaa'](printDualExistsHint,_0x3908be);const _0x53e518=unsetProfileOverride(_0x415a45['THWvu'](getProjectPath),_0x3908be,_0x17444d);_0x53e518?console['log'](_0x110262(0xc5)+_0x17444d+_0x110262(0xc8)+_0x3908be+'\x22'):console['log']('Key\x20\x22'+_0x17444d+'\x22\x20not\x20found');return;}const _0x4b817e=_0x415a45['olJCi'](unsetProfileOverride,getProjectPath(),_0x3908be,_0x17444d);if(_0x4b817e){console['log'](_0x110262(0xc5)+_0x17444d);return;}const _0x33c95e=await loadSettings(_0x3908be),_0x4f8a6e=deleteNestedValue(_0x33c95e,_0x17444d);_0x4f8a6e?console['log'](_0x110262(0xbb)+_0x17444d+'\x22\x20lives\x20in\x20the\x20legacy\x20settings\x20file\x20for\x20\x22'+_0x3908be+'\x22\x20and\x20cannot\x20be\x20unset;\x20the\x20legacy\x20tree\x20is\x20read-only\x20under\x20cloud\x20profiles.'):console['log'](_0x110262(0xbb)+_0x17444d+'\x22\x20not\x20found');}export async function configReset(_0x2bb370){const _0x1f37e6=_0x4d95,_0x1d469c={'TmugI':function(_0x450f1f,_0xb0dba6,_0x5bad78){return _0x450f1f(_0xb0dba6,_0x5bad78);},'xtvLI':function(_0x518bd3){return _0x518bd3();}},_0x25ab78=await resolveProfileTarget(_0x2bb370);if(_0x25ab78['kind']==='cloud'){_0x1d469c[_0x1f37e6(0xd8)](resetProfileOverrides,_0x1d469c[_0x1f37e6(0xd5)](getProjectPath),_0x2bb370),console['log'](_0x1f37e6(0xd3)+_0x2bb370+'\x22');return;}console[_0x1f37e6(0xcd)]('\x22'+_0x2bb370+'\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20'+_0x2bb370+'\x20<key>\x22\x20to\x20remove\x20individual\x20values.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x205e08,_0x281288){const _0x3ef5a4=_0x5587,_0x30d0c3=_0x205e08();while(!![]){try{const _0x3b15b6=parseInt(_0x3ef5a4(0xdd))/0x1+-parseInt(_0x3ef5a4(0xe5))/0x2+-parseInt(_0x3ef5a4(0xe6))/0x3+parseInt(_0x3ef5a4(0xe0))/0x4+parseInt(_0x3ef5a4(0xe4))/0x5*(-parseInt(_0x3ef5a4(0xee))/0x6)+-parseInt(_0x3ef5a4(0xe2))/0x7*(parseInt(_0x3ef5a4(0xe8))/0x8)+parseInt(_0x3ef5a4(0xda))/0x9;if(_0x3b15b6===_0x281288)break;else _0x30d0c3['push'](_0x30d0c3['shift']());}catch(_0x26c4ed){_0x30d0c3['push'](_0x30d0c3['shift']());}}}(_0x239e,0x2cc3a));import _0xfff862 from'inquirer';function _0x5587(_0xcadd6f,_0x34071){_0xcadd6f=_0xcadd6f-0xda;const _0x239ea9=_0x239e();let _0x558761=_0x239ea9[_0xcadd6f];return _0x558761;}function _0x239e(){const _0x32ba3a=['1003614Jwxjwf','yes','7384HZSuJN','AfwKk','jvKBR','✓\x20Deleted\x20cloud\x20profile\x20\x22','Profile\x20deletion\x20cancelled:\x20confirmation\x20did\x20not\x20match.','cwd','30isTkCR','RQmQq','7482447WdxvcA','log','Profile\x20deletion\x20requires\x20an\x20interactive\x20terminal\x20so\x20the\x20profile\x20name\x20can\x20be\x20typed\x20for\x20confirmation.\x20Pass\x20--yes\x20to\x20skip\x20confirmation.','121165SVYpzj','prompt','\x22\x20to\x20confirm\x20deletion:','102624rkFJKZ','JpuPA','707iDpkVq','confirmation','135905cQPoER','462368GOHWgK'];_0x239e=function(){return _0x32ba3a;};return _0x239e();}import{deleteCloudProfile,fetchCloudProfile}from'./utils/cloudProfile.js';import{isInteractive}from'./utils/cloudProfileSession.js';import{clearLastProfile,resetProfileOverrides}from'./utils/projectsConfig.js';export async function deleteProfile(_0x57ca81,_0x4c9459={}){const _0x3005f7=_0x5587,_0x1fef97={'jvKBR':function(_0x3ac83b,_0x4960c7){return _0x3ac83b(_0x4960c7);},'RQmQq':'input','AfwKk':_0x3005f7(0xe3),'JpuPA':function(_0x264881,_0x42d252){return _0x264881!==_0x42d252;},'URXWg':_0x3005f7(0xec),'iHiru':function(_0x51b219,_0x277915,_0x26b643){return _0x51b219(_0x277915,_0x26b643);}},_0x44ce13=await _0x1fef97[_0x3005f7(0xea)](fetchCloudProfile,_0x57ca81);if(!_0x44ce13)throw new Error('Cloud\x20profile\x20\x22'+_0x57ca81+'\x22\x20not\x20found.');if(!_0x4c9459[_0x3005f7(0xe7)]&&!isInteractive())throw new Error(_0x3005f7(0xdc));console['log']('\x0aWarning:\x20this\x20deletes\x20the\x20shared\x20cloud\x20profile\x20\x22'+_0x57ca81+'\x22\x20for\x20everyone\x20in\x20your\x20organization.');if(!_0x4c9459['yes']){const {confirmation:_0x396794}=await _0xfff862[_0x3005f7(0xde)]([{'type':_0x1fef97[_0x3005f7(0xef)],'name':_0x1fef97[_0x3005f7(0xe9)],'message':'Type\x20\x22'+_0x57ca81+_0x3005f7(0xdf)}]);if(_0x1fef97[_0x3005f7(0xe1)](_0x396794,_0x57ca81))throw new Error(_0x1fef97['URXWg']);}await deleteCloudProfile(_0x57ca81),_0x1fef97['iHiru'](resetProfileOverrides,process[_0x3005f7(0xed)](),_0x57ca81),clearLastProfile(process[_0x3005f7(0xed)](),_0x57ca81),console[_0x3005f7(0xdb)](_0x3005f7(0xeb)+_0x57ca81+'\x22.');}
|
package/build/commands/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function _0x22bd(_0x1ec3fc,_0x299406){_0x1ec3fc=_0x1ec3fc-0x143;const _0xabf229=_0xabf2();let _0x22bd75=_0xabf229[_0x1ec3fc];return _0x22bd75;}const _0x479fc8=_0x22bd;(function(_0x5ddc39,_0x52e409){const _0x1f9d9b=_0x22bd,_0x2b378b=_0x5ddc39();while(!![]){try{const _0x3d692e=-parseInt(_0x1f9d9b(0x16d))/0x1*(parseInt(_0x1f9d9b(0x157))/0x2)+parseInt(_0x1f9d9b(0x165))/0x3+-parseInt(_0x1f9d9b(0x16e))/0x4*(parseInt(_0x1f9d9b(0x168))/0x5)+-parseInt(_0x1f9d9b(0x176))/0x6+-parseInt(_0x1f9d9b(0x172))/0x7+-parseInt(_0x1f9d9b(0x161))/0x8+parseInt(_0x1f9d9b(0x14d))/0x9*(parseInt(_0x1f9d9b(0x153))/0xa);if(_0x3d692e===_0x52e409)break;else _0x2b378b['push'](_0x2b378b['shift']());}catch(_0x1fba45){_0x2b378b['push'](_0x2b378b['shift']());}}}(_0xabf2,0x9b65f));import{readdir,stat}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{getRangerDir}from'./utils/rangerRoot.js';import{loadSettings}from'./utils/settings.js';import{readActiveProfileName}from'./utils/activeProfile.js';import{getToken}from'./utils/keychain.js';function _0xabf2(){const _0x35695e=['endsWith','3167514NSjAfB','RUVJM','\x0aCloud\x20Profiles\x20(by\x20environment):','keys','\x20\x20\x20\x20\x20\x20URL:\x20','push','Mziry','dztCM','Run:\x20ranger\x20profile\x20add\x20<profile-name>','\x0a\x20\x20','legacy','environmentDetails','ilYxX','21378726qtwiUh','isDirectory','UOzqT','some','izMNv','\x0a*\x20=\x20active\x20profile','10KfqHPL','reports','set','name','82BONnFQ','GWKFh','log','lFaPv','cached\x20(updated\x20','has','\x20\x20\x20\x20\x20\x20Details:\x20','.txt','CsxuZ','sort','4115904UqIJDx','HYmwI','includes','map','1305666uSLUeV','localeCompare','sessions','1477865ZdGtmY','settings.json','profiles','error','bug-bashes','5077JwCwiQ','4GahnKV','deVbV','startsWith','local','4395916JebSqV','\x0aCloud\x20Profiles:','sessionUpdatedAt'];_0xabf2=function(){return _0x35695e;};return _0xabf2();}import{listCloudProfiles}from'./utils/cloudProfile.js';const NON_ENV_DIRS=[_0x479fc8(0x167),_0x479fc8(0x16c),_0x479fc8(0x154),'local','ci'];export function shouldGroupByEnvironment(_0x180b61){const _0x3918ac=_0x479fc8;return _0x180b61[_0x3918ac(0x150)](_0xb9d396=>_0xb9d396['environmentKey']);}export function groupCloudProfilesByEnvironment(_0x332480){const _0x38d1ff=_0x479fc8,_0x5be08e={'ilYxX':function(_0x428756,_0xca49fa){return _0x428756===_0xca49fa;}},_0x266f3c=new Map();for(const _0x557d4f of _0x332480){const _0x2c8e87=_0x557d4f['environmentKey']??null,_0x26a2dc=_0x266f3c['get'](_0x2c8e87);if(_0x26a2dc)_0x26a2dc[_0x38d1ff(0x145)](_0x557d4f);else _0x266f3c[_0x38d1ff(0x155)](_0x2c8e87,[_0x557d4f]);}const _0x314f19=[..._0x266f3c[_0x38d1ff(0x143)]()]['sort']((_0x564707,_0x4f78ed)=>{const _0x408df0=_0x38d1ff;if(_0x5be08e['ilYxX'](_0x564707,null))return 0x1;if(_0x5be08e[_0x408df0(0x14c)](_0x4f78ed,null))return-0x1;return _0x564707[_0x408df0(0x166)](_0x4f78ed);});return _0x314f19[_0x38d1ff(0x164)](_0x3daf70=>({'environmentKey':_0x3daf70,'profiles':_0x266f3c['get'](_0x3daf70)[_0x38d1ff(0x160)]((_0x379211,_0x1e6c0e)=>_0x379211[_0x38d1ff(0x156)][_0x38d1ff(0x166)](_0x1e6c0e['name']))}));}export async function getEnvNames(){const _0x3224dc=_0x479fc8,_0xce1976={'NBwcx':function(_0x5e2965){return _0x5e2965();},'Mziry':function(_0x40ac1a,_0x245968,_0x5998f8){return _0x40ac1a(_0x245968,_0x5998f8);},'GWKFh':_0x3224dc(0x171),'RUVJM':function(_0x2b2da7,_0x58d9d0){return _0x2b2da7(_0x58d9d0);},'zUoeQ':function(_0x5077f2,_0x5e65a5){return _0x5077f2(_0x5e65a5);},'UOzqT':_0x3224dc(0x15e)},_0x129449=_0xce1976['NBwcx'](getRangerDir);if(!existsSync(_0x129449))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x2e0160=await readActiveProfileName(),_0x525dfb=[],_0x113c1c={},_0x3d88e3=_0xce1976[_0x3224dc(0x146)](join,_0x129449,_0xce1976[_0x3224dc(0x158)]);if(_0xce1976[_0x3224dc(0x177)](existsSync,_0x3d88e3)){const _0x234606=await _0xce1976[_0x3224dc(0x177)](readdir,_0x3d88e3);for(const _0x2585cd of _0x234606){const _0x4a3c5a=_0xce1976['Mziry'](join,_0x3d88e3,_0x2585cd),_0x31350f=await stat(_0x4a3c5a);_0x31350f['isDirectory']()&&(_0x525dfb['push'](_0x2585cd),_0x113c1c[_0x2585cd]='local');}}const _0x2534e8=_0xce1976[_0x3224dc(0x146)](join,_0x129449,'ci');if(existsSync(_0x2534e8)){const _0x336632=await readdir(_0x2534e8);for(const _0x4649ac of _0x336632){const _0x122c9b=_0xce1976['Mziry'](join,_0x2534e8,_0x4649ac),_0x140a81=await _0xce1976['zUoeQ'](stat,_0x122c9b);_0x140a81[_0x3224dc(0x14e)]()&&(_0x525dfb['push'](_0x4649ac),_0x113c1c[_0x4649ac]='ci');}}const _0x2f0d8d=await readdir(_0x129449);for(const _0x3bce46 of _0x2f0d8d){if(NON_ENV_DIRS[_0x3224dc(0x163)](_0x3bce46))continue;if(_0x3bce46[_0x3224dc(0x170)]('.'))continue;if(_0x3bce46[_0x3224dc(0x175)](_0xce1976[_0x3224dc(0x14f)]))continue;const _0x1910e0=join(_0x129449,_0x3bce46),_0x29b412=await _0xce1976['zUoeQ'](stat,_0x1910e0);_0x29b412['isDirectory']()&&existsSync(_0xce1976['Mziry'](join,_0x1910e0,_0x3224dc(0x169)))&&(!_0x525dfb['includes'](_0x3bce46)&&(_0x525dfb[_0x3224dc(0x145)](_0x3bce46),_0x113c1c[_0x3bce46]=_0x3224dc(0x14a)));}return{'envNames':_0x525dfb,'activeEnv':_0x2e0160,'envTypes':_0x113c1c};}export async function envList(){const _0x549c2f=_0x479fc8,_0x3e16fb={'izMNv':function(_0x212ad4,_0x115158){return _0x212ad4===_0x115158;},'jsjQu':function(_0x3c1ad1){return _0x3c1ad1();},'lFaPv':function(_0x3f893f,_0x47d129){return _0x3f893f(_0x47d129);},'CsxuZ':'\x0aLocal\x20Profiles\x20(legacy):','BAFzA':'local','sCbMP':_0x549c2f(0x14a),'dztCM':function(_0x85bb14,_0x2075ed){return _0x85bb14>_0x2075ed;},'HYmwI':function(_0x3592b8,_0x388bec){return _0x3592b8(_0x388bec);},'qxrvr':_0x549c2f(0x178),'gFDBW':'(no\x20environment\x20—\x20manual\x20or\x20no\x20auth)','deVbV':function(_0x1884f5,_0x4ec64b,_0x27cefd){return _0x1884f5(_0x4ec64b,_0x27cefd);}},{envNames:_0xa3eb6,activeEnv:_0x5ce1f6,envTypes:_0x517902}=await _0x3e16fb['jsjQu'](getEnvNames);let _0x479c77=[];const _0x476420=await _0x3e16fb['jsjQu'](getToken);if(_0x476420)try{_0x479c77=await listCloudProfiles();}catch(_0x581693){console[_0x549c2f(0x16b)]('\x0aWarning:\x20could\x20not\x20fetch\x20cloud\x20profiles:\x20'+(_0x581693 instanceof Error?_0x581693['message']:_0x3e16fb['lFaPv'](String,_0x581693)));}if(_0x3e16fb[_0x549c2f(0x151)](_0xa3eb6['length'],0x0)&&_0x3e16fb[_0x549c2f(0x151)](_0x479c77['length'],0x0)){console['log']('\x0aNo\x20profiles\x20found.'),console[_0x549c2f(0x159)](_0x549c2f(0x148));return;}const _0x5d8dfc=new Set(_0x479c77['map'](_0x3ee6c8=>_0x3ee6c8['name']));if(_0xa3eb6['length']>0x0){console['log'](_0x3e16fb[_0x549c2f(0x15f)]);for(const _0x424c3c of _0xa3eb6[_0x549c2f(0x160)]()){const _0x30c286=_0x3e16fb[_0x549c2f(0x151)](_0x424c3c,_0x5ce1f6)&&!_0x5d8dfc[_0x549c2f(0x15c)](_0x424c3c),_0x53e6b2=_0x517902[_0x424c3c]||_0x3e16fb['BAFzA'],_0x9cd596=await loadSettings(_0x424c3c),_0x118d6e=_0x53e6b2===_0x3e16fb['sCbMP']?'':'\x20['+_0x53e6b2+']';console[_0x549c2f(0x159)]('\x20\x20'+(_0x30c286?'*\x20':'\x20\x20')+_0x424c3c+_0x118d6e),_0x9cd596['baseUrl']&&console['log'](_0x549c2f(0x144)+_0x9cd596['baseUrl']),_0x9cd596['environmentDetails']&&console[_0x549c2f(0x159)](_0x549c2f(0x15d)+_0x9cd596[_0x549c2f(0x14b)]);}}const _0x2cf2df=(_0x11416a,_0x26644a)=>{const _0x4547e0=_0x549c2f,_0x16bda1=_0x3e16fb['izMNv'](_0x11416a[_0x4547e0(0x156)],_0x5ce1f6),_0x406c4a=_0x11416a['sessionUpdatedAt']?_0x4547e0(0x15b)+_0x11416a[_0x4547e0(0x174)]+')':'no\x20session';console['log'](''+_0x26644a+(_0x16bda1?'*\x20':'\x20\x20')+_0x11416a['name']),console['log'](_0x26644a+'\x20\x20\x20\x20Session:\x20'+_0x406c4a);};if(_0x3e16fb[_0x549c2f(0x147)](_0x479c77['length'],0x0)){if(_0x3e16fb[_0x549c2f(0x162)](shouldGroupByEnvironment,_0x479c77)){console['log'](_0x3e16fb['qxrvr']);for(const _0x3f61cd of _0x3e16fb[_0x549c2f(0x15a)](groupCloudProfilesByEnvironment,_0x479c77)){const _0x57966d=_0x3f61cd['environmentKey']??_0x3e16fb['gFDBW'];console['log'](_0x549c2f(0x149)+_0x57966d);for(const _0x3f99fb of _0x3f61cd[_0x549c2f(0x16a)]){_0x2cf2df(_0x3f99fb,'\x20\x20\x20\x20');}}}else{console[_0x549c2f(0x159)](_0x549c2f(0x173));for(const _0x2d9067 of[..._0x479c77][_0x549c2f(0x160)]((_0x7d4830,_0xf14cfe)=>_0x7d4830['name']['localeCompare'](_0xf14cfe['name']))){_0x3e16fb[_0x549c2f(0x16f)](_0x2cf2df,_0x2d9067,'\x20\x20');}}}_0x5ce1f6&&console[_0x549c2f(0x159)](_0x549c2f(0x152));}
|