@ranger-testing/ranger-cli 2.5.4-alpha.a70fc60-4 → 2.5.4-alpha.bc88254-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/skills/ranger/SKILL.md +4 -3
- package/build/skills/ranger/verify.md +15 -3
- package/package.json +1 -1
package/build/commands/addEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x71a7d,_0x51ddf7){const _0xbf4ef3=_0x4d42,_0x35c9b5=_0x71a7d();while(!![]){try{const _0x415b6f=-parseInt(_0xbf4ef3(0x1f0))/0x1*(-parseInt(_0xbf4ef3(0x215))/0x2)+parseInt(_0xbf4ef3(0x217))/0x3*(parseInt(_0xbf4ef3(0x20c))/0x4)+parseInt(_0xbf4ef3(0x1ca))/0x5+-parseInt(_0xbf4ef3(0x224))/0x6*(-parseInt(_0xbf4ef3(0x1d0))/0x7)+-parseInt(_0xbf4ef3(0x1d4))/0x8+parseInt(_0xbf4ef3(0x1c5))/0x9+-parseInt(_0xbf4ef3(0x1e0))/0xa*(parseInt(_0xbf4ef3(0x214))/0xb);if(_0x415b6f===_0x51ddf7)break;else _0x35c9b5['push'](_0x35c9b5['shift']());}catch(_0x3f90ea){_0x35c9b5['push'](_0x35c9b5['shift']());}}}(_0x77c4,0x81a97));import{mkdir,writeFile,readFile,readdir,unlink,rm,mkdtemp,rename}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0xd634aa from'inquirer';function _0x77c4(){const _0x112e82=['\x20\x20\x20When\x20done\x20logging\x20in,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.','error','join','setupHeader','continue','✓\x20Cloud\x20profile\x20\x27','confirm','\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20','TNvlG','user','config_write','TiGif','UAjKt','isTTY','local','trackPhaseEnd','user_declined','--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','buxHt','prompt','--ci\x20and\x20--cdp-endpoint\x20cannot\x20be\x20used\x20together.\x20Electron/CDP\x20profiles\x20only\x20work\x20with\x20a\x20locally\x20running\x20app\x20and\x20are\x20not\x20supported\x20in\x20CI.','safeMode','now','\x0a🌐\x20Profile\x20Setup\x0a','NDVNw','✓\x20Created\x20settings:\x20','⚠\x20Could\x20not\x20reach\x20','--allow-insecure-localhost','keys','\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20','Missing\x20API\x20token;\x20aborting\x20CI\x20profile\x20creation.','✓\x20Auth\x20state\x20saved\x20to:\x20','includes','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','vGwDp','You\x20can\x20try\x20again\x20with\x20one\x20of:','\x0a⚠️\x20\x20Profile\x20\x22','cdpEndpoint','8520696TNxBEn','test','gyQWf','XFtIs','yqOeN','3290645uAhnXx','GXDLa','ZxVKu','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','esfCr','assign','1778ZXdAgQ','.backup-','http://','eMTUq','1056168bmmJhJ','BDDzI','.tmp-','SmQfT','Continue\x20anyway','location','--disable-features=WebBluetooth','saveToCloud','push','environments','Could\x20not\x20reach\x20','retry','31430AFwVrO','gnmKe','Profile\x20\x22','once','\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','skipAuth','IulGl','XVeFk','FMzoA','OqiHq','SIGINT','http://localhost:3000','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','setupHeaders','Invalid\x20URL','newContext','81NDCoxW','--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','log','\x0a\x20\x20(domains:\x20','PtlZz','Use\x20','LCJTi','qhWNv','MaxPE','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.','path','url_setup','allowInsecureLocalhost','WvKDV','yes','TBhxF','slice','overwrite','close','about:blank','settings.json','auVxs','\x22\x20already\x20exists.\x20Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20profile\x20first.','✓\x20Encrypted\x20auth\x20saved\x20to:\x20','domains','BYCrK','\x20\x20Ranger\x20will\x20open\x20it\x20in\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20and\x20save\x20your\x20session.\x0a','\x0a📋\x20Authentication\x20Setup','1220IWStpa','no_auth_config','\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.','\x20would\x20shadow\x20the\x20existing\x20profile.','NODE_TLS_REJECT_UNAUTHORIZED','wMpRj','thGJK','url','8481HicmuT','13318WpdTpx','no_match','7323vNFnqv','.enc','\x20(continuing\x20with\x20--force)','catch','force','\x0aThe\x20browser\x20closed\x20unexpectedly\x20before\x20authentication\x20could\x20be\x20saved.','message','ACBhS','utf-8','WaDZt','off','Delete\x20existing\x20and\x20create\x20new\x20in\x20','scope','4668FfAHNQ','deQpN','storageState','name','bTPAm','VCYVW','root\x20(.ranger/)','IqIFY','Saving\x20authentication\x20state...','No\x20auth\x20env\x20matches\x20this\x20URL.\x20Creating\x20local\x20profile.','length','\x20--skip-auth\x20\x20\x20\x20(skip\x20browser\x20auth\x20entirely)\x0a','kNyGg','fetch\x20failed','ONwAR','HTitM','isProtocolError','stdin'];_0x77c4=function(){return _0x112e82;};return _0x77c4();}import{chromium}from'playwright';import{findExistingEnv,loadSettings}from'./utils/settings.js';import{encrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{addProfileSetupBanner}from'./utils/profileSetupBanner.js';function _0x4d42(_0x2837d2,_0x4ed4fe){_0x2837d2=_0x2837d2-0x1b3;const _0x77c489=_0x77c4();let _0x4d424d=_0x77c489[_0x2837d2];return _0x4d424d;}import{fetchAuthConfig,createCloudProfile,ApiError}from'./utils/cloudProfile.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{isPathGitTracked}from'./utils/gitTracked.js';async function checkUrlReachability(_0x5e977b){const _0x4f66c2=_0x4d42,_0x2edecf={'FMzoA':function(_0x25911b,_0x475f55,_0x14ac0e){return _0x25911b(_0x475f55,_0x14ac0e);},'SmQfT':function(_0x102637,_0x45e0e3){return _0x102637<_0x45e0e3;},'thGJK':function(_0xd52908,_0x4d65da){return _0xd52908===_0x4d65da;},'WvKDV':'TypeError','eMTUq':_0x4f66c2(0x231)};try{const _0x3b6719=new AbortController(),_0x2e3eea=_0x2edecf[_0x4f66c2(0x1e8)](setTimeout,()=>_0x3b6719['abort'](),0x1388),_0x5614d4={'method':'HEAD','signal':_0x3b6719['signal'],'redirect':'manual'};/^https:\/\/localhost(:\d+)?/i[_0x4f66c2(0x1c6)](_0x5e977b)&&(process['env'][_0x4f66c2(0x210)]='0');const _0x2e7a8a=await fetch(_0x5e977b,_0x5614d4);delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'],clearTimeout(_0x2e3eea);if(_0x2edecf[_0x4f66c2(0x1d7)](_0x2e7a8a['status'],0x190))return{'ok':!![]};return{'ok':![],'error':'HTTP\x20'+_0x2e7a8a['status']};}catch(_0x263a6){delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'];const _0x30dfb0=_0x263a6,_0x291d35=_0x30dfb0['message']||String(_0x263a6),_0x2b074c=_0x291d35[_0x4f66c2(0x1bf)](_0x4f66c2(0x1ee))||_0x2edecf[_0x4f66c2(0x212)](_0x30dfb0[_0x4f66c2(0x227)],_0x2edecf[_0x4f66c2(0x1fd)])||_0x291d35[_0x4f66c2(0x1bf)](_0x2edecf[_0x4f66c2(0x1d3)]);return{'ok':![],'error':_0x291d35,'isProtocolError':_0x2b074c};}}async function sweepOrphanLocalProfile(_0x314286,_0x3db909,_0x596488){const _0x1206b5=_0x4d42,_0x5c5fa7={'IulGl':function(_0x31e698,_0x15fbca,_0x40c1bf){return _0x31e698(_0x15fbca,_0x40c1bf);},'XFtIs':function(_0xc14f,_0x16bbc5){return _0xc14f(_0x16bbc5);},'HTitM':function(_0x469efd,_0x232159){return _0x469efd(_0x232159);}},_0x1fc32c=_0x5c5fa7[_0x1206b5(0x1e6)](join,_0x3db909,_0x1206b5(0x244)),_0x226018=join(_0x1fc32c,_0x314286);_0x5c5fa7[_0x1206b5(0x1c8)](existsSync,_0x226018)&&(_0x596488&&await _0x5c5fa7['HTitM'](isPathGitTracked,_0x226018)?console[_0x1206b5(0x1f2)](_0x1206b5(0x23d)+_0x226018+_0x1206b5(0x1f9)):(await rm(_0x226018,{'recursive':!![],'force':!![]}),console['log'](_0x1206b5(0x1c0)+_0x226018)));if(_0x5c5fa7[_0x1206b5(0x233)](existsSync,_0x1fc32c)){let _0x4505cc=[];try{_0x4505cc=await _0x5c5fa7['HTitM'](readdir,_0x1fc32c);}catch{return;}const _0x8e688f=_0x1206b5(0x1d6)+_0x314286+'-';for(const _0x273e3f of _0x4505cc){if(!_0x273e3f['startsWith'](_0x8e688f))continue;const _0x1fcb8d=join(_0x1fc32c,_0x273e3f);await rm(_0x1fcb8d,{'recursive':!![],'force':!![]}),console[_0x1206b5(0x1f2)](_0x1206b5(0x1c0)+_0x1fcb8d);}}}async function tryAutoRouteCloudProfile(_0xd1a878,_0x1012db,_0x4ad738,_0x26a082,_0x437a93){const _0xa04fb4=_0x4d42,_0x19a956={'tgUvy':function(_0x201e1f,_0x124510){return _0x201e1f===_0x124510;},'buxHt':_0xa04fb4(0x20d),'YNeQR':function(_0x5c1209,_0x5054e3,_0xf6733e){return _0x5c1209(_0x5054e3,_0xf6733e);},'esfCr':'profile.add.autoRouteSkipped','XLGiV':_0xa04fb4(0x216),'ITXPy':_0xa04fb4(0x1db),'ACBhS':_0xa04fb4(0x246),'PtlZz':function(_0xfbe4e6,_0x12bfe2){return _0xfbe4e6 instanceof _0x12bfe2;},'DytKt':function(_0x5efad0,_0x4628ec){return _0x5efad0===_0x4628ec;},'UAjKt':function(_0x5a52c7,_0x4dde22){return _0x5a52c7+_0x4dde22;},'deQpN':function(_0x19cad1,_0x3fae21){return _0x19cad1!==_0x3fae21;},'PCFmC':function(_0x4ced9b){return _0x4ced9b();},'hMruD':function(_0x1478ae,_0x15e22f,_0x39f9b8,_0x119b78){return _0x1478ae(_0x15e22f,_0x39f9b8,_0x119b78);},'dMZzk':function(_0xfa2165,_0x4a81e1){return _0xfa2165 instanceof _0x4a81e1;}};let _0x495d9c;try{_0x495d9c=await fetchAuthConfig();}catch{return _0x437a93?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':'no_auth_config','profileName':_0xd1a878}),![];}if(!_0x495d9c||!_0x495d9c[_0xa04fb4(0x1dd)]||Object['keys'](_0x495d9c[_0xa04fb4(0x1dd)])[_0xa04fb4(0x22e)]===0x0)return _0x437a93?.[_0xa04fb4(0x245)]('profile.add.autoRouteSkipped',{'reason':_0x19a956[_0xa04fb4(0x248)],'profileName':_0xd1a878}),![];const _0x46993d=_0x19a956['YNeQR'](matchAuthEnvironment,_0x1012db,_0x495d9c);if(!_0x46993d)return console['log'](_0xa04fb4(0x22d)),_0x437a93?.[_0xa04fb4(0x245)](_0x19a956[_0xa04fb4(0x1ce)],{'reason':_0x19a956['XLGiV'],'profileName':_0xd1a878}),![];const _0xe20c3e=_0x495d9c['environments'][_0x46993d],_0x346cf7=_0xe20c3e?.[_0xa04fb4(0x208)]??[];if(_0x26a082&&!_0x4ad738[_0xa04fb4(0x1fe)]){const {saveToCloud:_0x543245}=await _0xd634aa['prompt']([{'type':_0xa04fb4(0x23c),'name':_0x19a956['ITXPy'],'message':'Found\x20auth\x20environment\x20\x27'+_0x46993d+'\x27\x20matching\x20'+_0x1012db+_0xa04fb4(0x1f3)+_0x346cf7[_0xa04fb4(0x238)](',\x20')+')\x0a\x20\x20Save\x20\x27'+_0xd1a878+'\x27\x20to\x20the\x20cloud?','default':!![]}]);if(!_0x543245)return _0x437a93?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':_0x19a956[_0xa04fb4(0x21e)],'profileName':_0xd1a878}),![];}const _0x5cd20c=_0x346cf7['some'](_0x459fb9=>{try{return _0x19a956['tgUvy'](new URL(_0x459fb9)['origin'],new URL(_0x1012db)['origin']);}catch{return![];}}),_0x3e7168={};!_0x5cd20c&&(_0x3e7168['baseUrl']=_0x1012db);try{await createCloudProfile(_0xd1a878,_0x46993d,_0x3e7168);}catch(_0x309ad6){if(_0x19a956['PtlZz'](_0x309ad6,ApiError)&&_0x19a956['DytKt'](_0x309ad6['status'],0x199)){console['error']('\x0a\x20\x20A\x20cloud\x20profile\x20named\x20\x22'+_0xd1a878+_0xa04fb4(0x206));throw _0x309ad6;}return console[_0xa04fb4(0x1f2)]('\x20\x20Could\x20not\x20reach\x20Ranger\x20API\x20to\x20create\x20a\x20cloud\x20profile\x20('+(_0x19a956[_0xa04fb4(0x1f4)](_0x309ad6,Error)?_0x309ad6['message']:String(_0x309ad6))+').\x20Falling\x20back\x20to\x20local\x20profile.'),_0x437a93?.['trackPhaseEnd']('profile.add.autoRouteSkipped',{'reason':'no_auth_config','profileName':_0xd1a878}),![];}console['log'](_0x19a956[_0xa04fb4(0x242)](_0xa04fb4(0x23b)+_0xd1a878+'\x27\x20created,\x20linked\x20to\x20env\x20\x27'+_0x46993d+'\x27.\x0a','\x20\x20Next:\x20RANGER_TEST_USERNAME=...\x20RANGER_TEST_PASSWORD=...\x20ranger\x20go\x20--profile\x20'+_0xd1a878));try{await sweepOrphanLocalProfile(_0xd1a878,getRangerHomeDir(),![]);const _0x2c3aa3=getRangerDir();_0x19a956[_0xa04fb4(0x225)](_0x2c3aa3,_0x19a956['PCFmC'](getRangerHomeDir))&&await _0x19a956['hMruD'](sweepOrphanLocalProfile,_0xd1a878,_0x2c3aa3,!![]);}catch(_0x210774){console['log']('\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20('+(_0x19a956['dMZzk'](_0x210774,Error)?_0x210774[_0xa04fb4(0x21d)]:String(_0x210774))+').');}return _0x437a93?.['trackPhaseEnd']('profile.add.autoRouted',{'envKey':_0x46993d,'profileName':_0xd1a878}),!![];}export async function addEnv(_0x2241b0,_0x4c4c35={},_0x5bd2d2){const _0x3ae18f=_0x4d42,_0x3dde0e={'OmtiU':_0x3ae18f(0x22c),'WaDZt':function(_0xb15e62){return _0xb15e62();},'kbVSr':_0x3ae18f(0x23f),'DetlJ':function(_0x548722,_0xe9245a){return _0x548722===_0xe9245a;},'siGic':function(_0xfdc23,_0x39c0f4){return _0xfdc23+_0x39c0f4;},'yqOeN':function(_0x256601,_0x3a7420){return _0x256601!==_0x3a7420;},'xFBjW':_0x3ae18f(0x247),'XVeFk':_0x3ae18f(0x1b3),'ZxVKu':_0x3ae18f(0x1ec),'UVxjt':function(_0x395efd,_0x1762bd,_0x38dd51,_0xaf74f0,_0x3fd147,_0x1ace40){return _0x395efd(_0x1762bd,_0x38dd51,_0xaf74f0,_0x3fd147,_0x1ace40);},'gyQWf':function(_0x144af7,_0x3b879e,_0x1be555){return _0x144af7(_0x3b879e,_0x1be555);},'urqjf':_0x3ae18f(0x23c),'TBhxF':_0x3ae18f(0x201),'kNyGg':'legacy','VCYVW':_0x3ae18f(0x22a),'JfBfr':'Aborted.','BYCrK':_0x3ae18f(0x1fb),'ONwAR':_0x3ae18f(0x1e4),'OqiHq':'\x20\x20Make\x20sure\x20your\x20Electron\x20app\x20(or\x20browser)\x20is\x20running\x20with\x20remote\x20debugging\x20enabled.\x0a','ghJes':'input','yYjoL':'Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','ZGKRl':function(_0x47a93d,_0x172298){return _0x47a93d||_0x172298;},'EeLCP':_0x3ae18f(0x1eb),'gnmKe':function(_0x1e94cb,_0xc86a0d){return _0x1e94cb(_0xc86a0d);},'pvAPR':_0x3ae18f(0x1df),'TiGif':function(_0x2f6c5c,_0x404ac9){return _0x2f6c5c===_0x404ac9;},'yNJlS':function(_0x4db60d,_0x5130f7,_0xfb8fd8){return _0x4db60d(_0x5130f7,_0xfb8fd8);},'qhWNv':_0x3ae18f(0x20b),'sGajP':'\x0a\x20\x20\x20⚠\x20This\x20step\x20requires\x20human\x20interaction\x20in\x20a\x20browser.','TNvlG':_0x3ae18f(0x1da),'auVxs':_0x3ae18f(0x1ba),'bTPAm':function(_0x4550fd,_0x1b9567){return _0x4550fd>_0x1b9567;},'GJIYf':_0x3ae18f(0x203),'LCJTi':_0x3ae18f(0x21c),'vGwDp':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','GXDLa':function(_0x4b9a6a,_0x241f79,_0x137082){return _0x4b9a6a(_0x241f79,_0x137082);},'yfAws':_0x3ae18f(0x1bd),'xDUSE':_0x3ae18f(0x218),'XqPPb':'\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.','wMpRj':'browser_auth','NDVNw':'settings.json','IqIFY':'Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.','MaxPE':_0x3ae18f(0x240),'BDDzI':'SIGINT'},_0x40070e=_0x4c4c35['ci']??![],_0x22904a=_0x40070e?'ci':'local',_0x36d69a=_0x4c4c35[_0x3ae18f(0x223)]===_0x3dde0e['kbVSr']?_0x3dde0e[_0x3ae18f(0x220)](getRangerHomeDir):_0x3dde0e['WaDZt'](getRangerDir),_0x558205=join(_0x36d69a,_0x22904a,_0x2241b0),_0xbd216e={};if(_0x4c4c35[_0x3ae18f(0x239)])for(const _0x8af290 of _0x4c4c35[_0x3ae18f(0x239)]){const _0x3b038d=_0x8af290['indexOf'](':');if(_0x3dde0e['DetlJ'](_0x3b038d,-0x1))throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0x8af290+'\x22.\x20Expected\x20\x22Name:\x20Value\x22.');const _0x30cc98=_0x8af290[_0x3ae18f(0x200)](0x0,_0x3b038d)['trim'](),_0x1ac070=_0x8af290[_0x3ae18f(0x200)](_0x3dde0e['siGic'](_0x3b038d,0x1))['trim']();_0xbd216e[_0x30cc98]=_0x1ac070;}const _0xf0936c=join(_0x36d69a,_0x22904a);if(_0x3dde0e[_0x3ae18f(0x1c9)](_0x4c4c35['cdpEndpoint'],undefined)&&_0x4c4c35['cdpEndpoint']['trim']()==='')throw new Error(_0x3ae18f(0x1f1));if(_0x4c4c35[_0x3ae18f(0x1c4)]&&_0x4c4c35['url'])throw new Error(_0x3dde0e['xFBjW']);if(_0x4c4c35['cdpEndpoint']&&_0x4c4c35['ci'])throw new Error(_0x3dde0e[_0x3ae18f(0x1e7)]);const _0x36f5e2=Boolean(_0x4c4c35['cdpEndpoint']),_0x39d9d5=!_0x4c4c35['skipAuth']&&!_0x36f5e2,_0xdb64d0=process[_0x3ae18f(0x235)]['isTTY']&&process['stdout'][_0x3ae18f(0x243)];if(!_0xdb64d0&&!_0x4c4c35[_0x3ae18f(0x213)]&&!_0x36f5e2)throw new Error(_0x3dde0e[_0x3ae18f(0x1cc)]);if(!_0x40070e&&!_0x4c4c35[_0x3ae18f(0x1e5)]&&!_0x36f5e2&&_0x4c4c35['url']){const _0x1bc0e3=await _0x3dde0e['UVxjt'](tryAutoRouteCloudProfile,_0x2241b0,_0x4c4c35[_0x3ae18f(0x213)],_0x4c4c35,_0xdb64d0,_0x5bd2d2);if(_0x1bc0e3)return;}const _0x50a274=_0x3dde0e[_0x3ae18f(0x1c7)](findExistingEnv,_0x2241b0,{'rangerDir':_0x36d69a});let _0x456671=null;if(_0x50a274){if(!_0xdb64d0)_0x456671=_0x50a274;else{if(_0x50a274['location']===_0x22904a){const {overwrite:_0x751b77}=await _0xd634aa['prompt']([{'type':_0x3dde0e['urqjf'],'name':_0x3dde0e[_0x3ae18f(0x1ff)],'message':_0x3ae18f(0x1e2)+_0x2241b0+'\x22\x20already\x20exists.\x20Overwrite?','default':![]}]);if(!_0x751b77){console['log']('Aborted.');return;}_0x456671=_0x50a274;}else{const _0x5b3898=_0x50a274['location']===_0x3dde0e[_0x3ae18f(0x230)]?_0x3dde0e[_0x3ae18f(0x229)]:_0x50a274['location'];console[_0x3ae18f(0x237)](_0x3ae18f(0x1c3)+_0x2241b0+'\x22\x20already\x20exists\x20in\x20'+_0x5b3898+':\x20'+_0x50a274['path']),console[_0x3ae18f(0x237)]('\x20\x20\x20Creating\x20it\x20in\x20'+_0x22904a+_0x3ae18f(0x20f));const {shouldReplace:_0x304b9e}=await _0xd634aa[_0x3ae18f(0x249)]([{'type':_0x3ae18f(0x23c),'name':'shouldReplace','message':_0x3ae18f(0x222)+_0x22904a+'?','default':![]}]);if(!_0x304b9e){console['log'](_0x3dde0e['JfBfr']);return;}_0x456671=_0x50a274;}}}_0x5bd2d2?.['trackPhaseStart'](_0x3dde0e[_0x3ae18f(0x209)]);let _0x5487ae='';if(_0x36f5e2)console['log'](_0x3dde0e[_0x3ae18f(0x232)]),console['log'](_0x3ae18f(0x1bc)+_0x4c4c35[_0x3ae18f(0x1c4)]),console[_0x3ae18f(0x1f2)](_0x3dde0e[_0x3ae18f(0x1e9)]);else{if(_0x4c4c35[_0x3ae18f(0x213)]){_0x5487ae=_0x4c4c35['url'];const _0x46aa2c=await checkUrlReachability(_0x5487ae);if(!_0x46aa2c['ok']&&!_0x4c4c35[_0x3ae18f(0x21b)])throw new Error(_0x3ae18f(0x1de)+_0x5487ae+':\x20'+_0x46aa2c['error']+_0x3ae18f(0x20e));!_0x46aa2c['ok']&&_0x4c4c35['force']&&console['log'](_0x3ae18f(0x1b9)+_0x5487ae+':\x20'+_0x46aa2c[_0x3ae18f(0x237)]+_0x3ae18f(0x219));}else{console[_0x3ae18f(0x1f2)](_0x3ae18f(0x1b6)),console[_0x3ae18f(0x1f2)]('\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.'),console[_0x3ae18f(0x1f2)](_0x3ae18f(0x20a));let _0x50ea6c=![];while(!![]){const _0x553338=await _0xd634aa[_0x3ae18f(0x249)]([{'type':_0x3dde0e['ghJes'],'name':'baseUrl','message':_0x50ea6c?_0x3dde0e['yYjoL']:_0x3ae18f(0x1cd),'default':_0x3dde0e['ZGKRl'](_0x5487ae,_0x3dde0e['EeLCP'])}]);_0x5487ae=_0x553338['baseUrl'];const _0x42866c=await _0x3dde0e['gnmKe'](checkUrlReachability,_0x5487ae);if(_0x42866c['ok'])break;const _0x5caba9=/^[a-zA-Z][\w+.-]*:\/\//[_0x3ae18f(0x1c6)](_0x5487ae),_0x1cd9c5=_0x42866c[_0x3ae18f(0x234)]&&!_0x5caba9,_0x541e28=_0x1cd9c5?_0x3ae18f(0x1d2)+_0x5487ae:null;_0x50ea6c=!![],console['log']('\x0a\x20\x20Could\x20not\x20reach\x20'+_0x5487ae+':\x20'+_0x42866c[_0x3ae18f(0x237)]);_0x541e28&&console[_0x3ae18f(0x1f2)]('\x20\x20Did\x20you\x20mean\x20'+_0x541e28+'?');const {action:_0x2fe68b}=await _0xd634aa['prompt']([{'type':'list','name':'action','message':'What\x20would\x20you\x20like\x20to\x20do?','choices':[..._0x541e28?[{'name':_0x3ae18f(0x1f5)+_0x541e28,'value':'use_suggestion'}]:[],{'name':'Enter\x20a\x20different\x20URL','value':_0x3dde0e['pvAPR']},{'name':_0x3ae18f(0x1d8),'value':_0x3ae18f(0x23a)}]}]);if(_0x2fe68b==='use_suggestion'&&_0x541e28){_0x5487ae=_0x541e28;const _0x311dc9=await _0x3dde0e[_0x3ae18f(0x1e1)](checkUrlReachability,_0x5487ae);if(_0x311dc9['ok'])break;console['log']('\x0a\x20\x20Still\x20could\x20not\x20reach\x20'+_0x5487ae+':\x20'+_0x311dc9[_0x3ae18f(0x237)]);}else{if(_0x3dde0e[_0x3ae18f(0x241)](_0x2fe68b,_0x3ae18f(0x23a)))break;}}}}_0x5bd2d2?.['trackPhaseEnd'](_0x3ae18f(0x1fb));const _0x290fec={};if(_0x456671){const _0x45f1f1=await loadSettings(_0x2241b0);Object['assign'](_0x290fec,_0x45f1f1['setupHeaders']);}Object[_0x3ae18f(0x1cf)](_0x290fec,_0xbd216e),await _0x3dde0e['gyQWf'](mkdir,_0xf0936c,{'recursive':!![]});try{const _0x49252e=await _0x3dde0e[_0x3ae18f(0x1e1)](readdir,_0xf0936c),_0x19fbdb='.tmp-'+_0x2241b0+'-';for(const _0x4c1e1f of _0x49252e){_0x4c1e1f['startsWith'](_0x19fbdb)&&await _0x3dde0e['gyQWf'](rm,join(_0xf0936c,_0x4c1e1f),{'recursive':!![],'force':!![]});}}catch{}const _0x10da60=await _0x3dde0e['gnmKe'](mkdtemp,_0x3dde0e['yNJlS'](join,_0xf0936c,_0x3ae18f(0x1d6)+_0x2241b0+'-')),_0x28e91e=join(_0x10da60,'auth.json'),_0x4d911e=()=>{const _0x2ece48=_0x3ae18f;rm(_0x10da60,{'recursive':!![],'force':!![]})[_0x2ece48(0x21a)](()=>{})['finally'](()=>{process['exit'](0x82);});};process[_0x3ae18f(0x1e3)](_0x3ae18f(0x1ea),_0x4d911e);const _0x134664=_0x3dde0e[_0x3ae18f(0x1e1)](Boolean,_0x5487ae)&&/^https:\/\/localhost(:\d+)?/i[_0x3ae18f(0x1c6)](_0x5487ae);try{if(_0x39d9d5){_0x5bd2d2?.['trackPhaseStart']('browser_auth'),console[_0x3ae18f(0x1f2)](_0x3dde0e[_0x3ae18f(0x1f7)]),console[_0x3ae18f(0x1f2)]('\x20\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20to\x20the\x20profile\x20you\x20want\x20to\x20test\x20so\x20Ranger\x20can\x20access\x20it.'),console['log'](_0x3ae18f(0x236));!_0xdb64d0?(console[_0x3ae18f(0x1f2)](_0x3dde0e['sGajP']),console[_0x3ae18f(0x1f2)]('\x20\x20\x20If\x20you\x20are\x20an\x20agent,\x20background\x20this\x20process\x20and\x20let\x20your\x20user\x20know\x20they\x20need\x20to\x20complete\x20browser\x20authentication.\x0a')):console['log']('');await new Promise(_0x3cf4cd=>setTimeout(_0x3cf4cd,0xbb8));const _0x898b17=[];_0x4c4c35['safeMode']&&_0x898b17[_0x3ae18f(0x1dc)](_0x3dde0e[_0x3ae18f(0x23e)]);const _0x196e51=_0x4c4c35['allowInsecureLocalhost']||_0x134664;_0x196e51&&_0x898b17['push'](_0x3dde0e[_0x3ae18f(0x205)]);const _0x4a6b95=await chromium['launch']({'headless':![],..._0x3dde0e['bTPAm'](_0x898b17['length'],0x0)?{'args':_0x898b17}:{}});try{const _0x375afb=_0x3dde0e[_0x3ae18f(0x228)](Object[_0x3ae18f(0x1bb)](_0x290fec)[_0x3ae18f(0x22e)],0x0),_0x4e54d0={'ignoreHTTPSErrors':!![]};_0x375afb&&(_0x4e54d0['extraHTTPHeaders']=_0x290fec);const _0xe7d785=await _0x4a6b95[_0x3ae18f(0x1ef)](_0x4e54d0);await addProfileSetupBanner(_0xe7d785);const _0x269ac4=await _0xe7d785['newPage']();await _0x269ac4['goto'](_0x5487ae||_0x3dde0e['GJIYf']);let _0x327738=![];await new Promise(_0x3a3816=>{const _0x6c67dd=_0x3ae18f;_0x269ac4['on'](_0x6c67dd(0x202),async()=>{const _0x5097a5=_0x6c67dd;try{console['log'](_0x3dde0e['OmtiU']),await _0xe7d785[_0x5097a5(0x226)]({'path':_0x28e91e}),_0x327738=!![];}catch{}_0x3dde0e[_0x5097a5(0x220)](_0x3a3816);});});if(!_0x327738){console['log'](_0x3dde0e[_0x3ae18f(0x1f6)]);!_0x4c4c35[_0x3ae18f(0x1b4)]&&(console['log']('This\x20can\x20happen\x20due\x20to\x20a\x20browser\x20compatibility\x20issue\x20on\x20some\x20systems.\x0a'),console[_0x3ae18f(0x1f2)](_0x3ae18f(0x1c2)),console['log']('\x20\x20ranger\x20profile\x20add\x20'+_0x2241b0+'\x20--safe-mode\x20\x20\x20\x20(disables\x20browser\x20features\x20that\x20can\x20cause\x20crashes)'),console[_0x3ae18f(0x1f2)]('\x20\x20ranger\x20profile\x20add\x20'+_0x2241b0+_0x3ae18f(0x22f)));throw new Error(_0x3dde0e[_0x3ae18f(0x1c1)]);}}finally{await _0x4a6b95[_0x3ae18f(0x202)]()['catch'](()=>{});}if(_0x40070e){const _0x300250=await _0x3dde0e[_0x3ae18f(0x1cb)](readFile,_0x28e91e,_0x3ae18f(0x21f)),_0x5e1798=await _0x3dde0e['WaDZt'](getToken);if(!_0x5e1798){console[_0x3ae18f(0x237)]('\x20\x20Could\x20not\x20encrypt:\x20No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]'),await unlink(_0x28e91e)[_0x3ae18f(0x21a)](()=>{});throw new Error(_0x3dde0e['yfAws']);}else{const _0x4c018c=_0x3dde0e[_0x3ae18f(0x1c7)](encrypt,_0x300250,_0x5e1798);await writeFile(_0x28e91e+_0x3dde0e['xDUSE'],_0x4c018c),await unlink(_0x28e91e),console[_0x3ae18f(0x1f2)](_0x3ae18f(0x207)+_0x28e91e+_0x3ae18f(0x218)),console['log']('\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.'),console[_0x3ae18f(0x1f2)](_0x3dde0e['XqPPb']);}}else console['log'](_0x3ae18f(0x1be)+_0x28e91e);_0x5bd2d2?.['trackPhaseEnd'](_0x3dde0e[_0x3ae18f(0x211)]);}_0x5bd2d2?.['trackPhaseStart'](_0x3ae18f(0x240));const _0x4e5777={};_0x5487ae&&(_0x4e5777['baseUrl']=_0x5487ae);_0x4c4c35['cdpEndpoint']&&(_0x4e5777['cdpEndpoint']=_0x4c4c35['cdpEndpoint'],_0x4e5777['isElectron']=!![]);(_0x4c4c35['allowInsecureLocalhost']||_0x134664)&&(_0x4e5777[_0x3ae18f(0x1fc)]=!![]);_0x4c4c35['safeMode']&&(_0x4e5777['safeMode']=!![]);_0x3dde0e[_0x3ae18f(0x228)](Object[_0x3ae18f(0x1bb)](_0x290fec)[_0x3ae18f(0x22e)],0x0)&&(_0x4e5777[_0x3ae18f(0x1ed)]=_0x290fec);await writeFile(_0x3dde0e['gyQWf'](join,_0x10da60,_0x3ae18f(0x204)),JSON['stringify'](_0x4e5777,null,0x2)),console['log'](_0x3ae18f(0x1b8)+join(_0x558205,_0x3dde0e[_0x3ae18f(0x1b7)]));if(_0x456671?.[_0x3ae18f(0x1d9)]===_0x22904a){const _0xfad95b=_0x456671['path']+_0x3ae18f(0x1d1)+Date[_0x3ae18f(0x1b5)]();await _0x3dde0e['yNJlS'](rename,_0x456671['path'],_0xfad95b);try{await _0x3dde0e['gyQWf'](rename,_0x10da60,_0x558205);}catch(_0x9de3fa){await rename(_0xfad95b,_0x456671['path']);throw _0x9de3fa;}try{await rm(_0xfad95b,{'recursive':!![]});}catch{console[_0x3ae18f(0x1f2)]('Warning:\x20Could\x20not\x20remove\x20old\x20profile\x20backup\x20at\x20'+_0xfad95b);}}else{await rename(_0x10da60,_0x558205);if(_0x456671)try{await rm(_0x456671['path'],{'recursive':!![]}),console['log']('Removed\x20existing\x20profile\x20at\x20'+_0x456671[_0x3ae18f(0x1fa)]);}catch{console[_0x3ae18f(0x1f2)]('Warning:\x20Could\x20not\x20remove\x20old\x20profile\x20at\x20'+_0x456671['path']);}}try{await _0x3dde0e[_0x3ae18f(0x1e1)](writeActiveProfileName,_0x2241b0),console['log']('\x20\x20Set\x20active\x20profile:\x20'+_0x2241b0);}catch{console[_0x3ae18f(0x1f2)](_0x3dde0e[_0x3ae18f(0x22b)]);}_0x5bd2d2?.[_0x3ae18f(0x245)](_0x3dde0e[_0x3ae18f(0x1f8)]),console[_0x3ae18f(0x1f2)]('\x0a\x20\x20Profile\x20\x22'+_0x2241b0+'\x22\x20configured');}catch(_0x2693fc){await rm(_0x10da60,{'recursive':!![],'force':!![]});throw _0x2693fc;}finally{process[_0x3ae18f(0x221)](_0x3dde0e[_0x3ae18f(0x1d5)],_0x4d911e);}}
|
|
1
|
+
(function(_0x2d488c,_0x337335){const _0x179b2b=_0x3323,_0xe1962f=_0x2d488c();while(!![]){try{const _0x3237e9=parseInt(_0x179b2b(0x254))/0x1+-parseInt(_0x179b2b(0x25c))/0x2*(-parseInt(_0x179b2b(0x25f))/0x3)+parseInt(_0x179b2b(0x251))/0x4+-parseInt(_0x179b2b(0x23e))/0x5*(parseInt(_0x179b2b(0x269))/0x6)+parseInt(_0x179b2b(0x238))/0x7*(parseInt(_0x179b2b(0x220))/0x8)+parseInt(_0x179b2b(0x23f))/0x9+-parseInt(_0x179b2b(0x237))/0xa*(parseInt(_0x179b2b(0x215))/0xb);if(_0x3237e9===_0x337335)break;else _0xe1962f['push'](_0xe1962f['shift']());}catch(_0x363cd7){_0xe1962f['push'](_0xe1962f['shift']());}}}(_0x5046,0xe81f7));import{mkdir,writeFile,readFile,readdir,unlink,rm,mkdtemp,rename}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x4b7edf from'inquirer';import{chromium}from'playwright';import{findExistingEnv,loadSettings}from'./utils/settings.js';import{encrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{getRangerDir,getRangerHomeDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{addProfileSetupBanner}from'./utils/profileSetupBanner.js';import{fetchAuthConfig,createCloudProfile,ApiError}from'./utils/cloudProfile.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{isPathGitTracked}from'./utils/gitTracked.js';async function checkUrlReachability(_0x26a5a0){const _0x3d1c6f=_0x3323,_0xe568c5={'UNHQK':function(_0x2a5eab,_0x254ebc,_0x4121f5){return _0x2a5eab(_0x254ebc,_0x4121f5);},'LHHwa':_0x3d1c6f(0x1ed),'CAisl':function(_0xf87871,_0x5e8f67){return _0xf87871(_0x5e8f67);},'OhhZT':function(_0x3f665f,_0xc9f416){return _0x3f665f<_0xc9f416;},'aWVCA':function(_0x47bcd1,_0x4c63a2){return _0x47bcd1===_0x4c63a2;}};try{const _0x53e054=new AbortController(),_0x109c72=_0xe568c5[_0x3d1c6f(0x206)](setTimeout,()=>_0x53e054[_0x3d1c6f(0x1ef)](),0x1388),_0x302dc7={'method':_0x3d1c6f(0x1f2),'signal':_0x53e054['signal'],'redirect':_0xe568c5['LHHwa']};/^https:\/\/localhost(:\d+)?/i[_0x3d1c6f(0x256)](_0x26a5a0)&&(process['env']['NODE_TLS_REJECT_UNAUTHORIZED']='0');const _0x3ec9bc=await _0xe568c5[_0x3d1c6f(0x206)](fetch,_0x26a5a0,_0x302dc7);delete process['env'][_0x3d1c6f(0x26a)],_0xe568c5['CAisl'](clearTimeout,_0x109c72);if(_0xe568c5[_0x3d1c6f(0x214)](_0x3ec9bc['status'],0x190))return{'ok':!![]};return{'ok':![],'error':_0x3d1c6f(0x264)+_0x3ec9bc['status']};}catch(_0x4ae19e){delete process[_0x3d1c6f(0x25a)][_0x3d1c6f(0x26a)];const _0x3c4072=_0x4ae19e,_0x3bf5af=_0x3c4072[_0x3d1c6f(0x1ff)]||_0xe568c5[_0x3d1c6f(0x241)](String,_0x4ae19e),_0x5a2971=_0x3bf5af['includes'](_0x3d1c6f(0x227))||_0xe568c5[_0x3d1c6f(0x261)](_0x3c4072['name'],_0x3d1c6f(0x22a))||_0x3bf5af[_0x3d1c6f(0x249)](_0x3d1c6f(0x252));return{'ok':![],'error':_0x3bf5af,'isProtocolError':_0x5a2971};}}function _0x3323(_0x5e9127,_0x42e655){_0x5e9127=_0x5e9127-0x1d9;const _0x50463c=_0x5046();let _0x332399=_0x50463c[_0x5e9127];return _0x332399;}function _0x5046(){const _0x489400=['\x0a⚠️\x20\x20Profile\x20\x22','trackPhaseStart','\x0a📋\x20Authentication\x20Setup','ZdeRA','cdjMW','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.','\x22\x20already\x20exists.\x20Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20profile\x20first.','isElectron','prompt','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','UdmVE','cTwQY','manual','\x0a\x20\x20(domains:\x20','abort','AUiAg','join','HEAD','jqZFU','local','xtKwg','confirm','profile.add.autoRouteSkipped','\x20\x20Ranger\x20will\x20open\x20it\x20in\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20and\x20save\x20your\x20session.\x0a','\x20\x20Next:\x20RANGER_TEST_USERNAME=...\x20RANGER_TEST_PASSWORD=...\x20ranger\x20go\x20--profile\x20','allowInsecureLocalhost','off','TcYul','twdsA','Found\x20auth\x20environment\x20\x27','message','\x0aThe\x20browser\x20closed\x20unexpectedly\x20before\x20authentication\x20could\x20be\x20saved.','\x20\x20Could\x20not\x20encrypt:\x20No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','What\x20would\x20you\x20like\x20to\x20do?','mIDmO','settings.json','UNHQK','\x22\x20configured','Aborted.','trackPhaseEnd','\x20\x20Set\x20active\x20profile:\x20','log','✓\x20Encrypted\x20auth\x20saved\x20to:\x20','svUmh','KPVuj','Enter\x20a\x20different\x20URL','.enc','location','stdin','\x0a\x20\x20Profile\x20\x22','OhhZT','143TZRhtJ','input','no_match','zfQft','\x0a\x20\x20A\x20cloud\x20profile\x20named\x20\x22','uJECX','wfmAR','once','tZUXf','shouldReplace','ajuks','32TkVcPp','GTiAw','\x20--safe-mode\x20\x20\x20\x20(disables\x20browser\x20features\x20that\x20can\x20cause\x20crashes)','force','\x20\x20\x20Creating\x20it\x20in\x20','xJECf','rmwue','Invalid\x20URL','.tmp-','WPAMl','TypeError','EbUSy','startsWith','length','Use\x20','isTTY','fHCrB','status','url','domains','environments','Warning:\x20Could\x20not\x20remove\x20old\x20profile\x20backup\x20at\x20','kDGlo','1865830ktnfEP','1762544gbwSZR','error','keys','browser_auth','path','url_setup','135DVHHMC','671697sxRLPC','\x22.\x20Expected\x20\x22Name:\x20Value\x22.','CAisl','\x20--skip-auth\x20\x20\x20\x20(skip\x20browser\x20auth\x20entirely)\x0a','legacy','HsMMB','http://localhost:3000','extraHTTPHeaders','http://','newPage','includes','✓\x20Created\x20settings:\x20','SIGINT','stdout','pLyOF','origin','\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20','about:blank','526072wktXnw','fetch\x20failed','cdpEndpoint','668296eHArCo','JJUCt','test','AlnSI','newContext','user','env','skipAuth','31112xBiFOh','assign','EVWAq','318vPzXUG','fLFQS','aWVCA','action','crgjI','HTTP\x20','catch',')\x0a\x20\x20Save\x20\x27','STASY','\x0a🌐\x20Profile\x20Setup\x0a','34266gmsuCJ','NODE_TLS_REJECT_UNAUTHORIZED','slice','bgVTg','RmIxI','no_auth_config','mjDVz','jArNV','✓\x20Cloud\x20profile\x20\x27','user_declined','close','YQZhQ','safeMode','\x27\x20matching\x20'];_0x5046=function(){return _0x489400;};return _0x5046();}async function sweepOrphanLocalProfile(_0x55761d,_0x2caac0,_0xbdcaaf){const _0x3af569=_0x3323,_0x5569dc={'fHCrB':function(_0x515c93,_0x1e7e93,_0x517904){return _0x515c93(_0x1e7e93,_0x517904);},'jqZFU':function(_0x23e6a5,_0x364028){return _0x23e6a5(_0x364028);},'GTiAw':function(_0x1e5684,_0x556540,_0x2bc99f){return _0x1e5684(_0x556540,_0x2bc99f);}},_0xa37fab=_0x5569dc[_0x3af569(0x230)](join,_0x2caac0,_0x3af569(0x1f4)),_0x315d44=join(_0xa37fab,_0x55761d);_0x5569dc[_0x3af569(0x1f3)](existsSync,_0x315d44)&&(_0xbdcaaf&&await _0x5569dc['jqZFU'](isPathGitTracked,_0x315d44)?console[_0x3af569(0x20b)]('\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20'+_0x315d44+_0x3af569(0x1e4)):(await rm(_0x315d44,{'recursive':!![],'force':!![]}),console[_0x3af569(0x20b)](_0x3af569(0x1ea)+_0x315d44)));if(_0x5569dc[_0x3af569(0x1f3)](existsSync,_0xa37fab)){let _0x3040e1=[];try{_0x3040e1=await _0x5569dc['jqZFU'](readdir,_0xa37fab);}catch{return;}const _0x353050=_0x3af569(0x228)+_0x55761d+'-';for(const _0x38655d of _0x3040e1){if(!_0x38655d[_0x3af569(0x22c)](_0x353050))continue;const _0x2db486=_0x5569dc[_0x3af569(0x221)](join,_0xa37fab,_0x38655d);await _0x5569dc['fHCrB'](rm,_0x2db486,{'recursive':!![],'force':!![]}),console['log']('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0x2db486);}}}async function tryAutoRouteCloudProfile(_0x407640,_0x30b096,_0x4bee55,_0x50f703,_0x503d19){const _0x3b523c=_0x3323,_0x428d52={'jokMS':function(_0x48a86b,_0x74f19b){return _0x48a86b===_0x74f19b;},'KPVuj':_0x3b523c(0x26e),'wfmAR':'No\x20auth\x20env\x20matches\x20this\x20URL.\x20Creating\x20local\x20profile.','CZusB':_0x3b523c(0x1f7),'zfQft':_0x3b523c(0x217),'jcoCD':'saveToCloud','gDVOE':function(_0x39d288,_0x45b078){return _0x39d288 instanceof _0x45b078;},'jArNV':function(_0x2b4c95,_0x28664){return _0x2b4c95+_0x28664;},'drqdH':function(_0x3dd7a4){return _0x3dd7a4();},'HMbOL':function(_0x2d2731,_0x34024e,_0x4c1b32,_0x198851){return _0x2d2731(_0x34024e,_0x4c1b32,_0x198851);}};let _0x7838c3;try{_0x7838c3=await fetchAuthConfig();}catch{return _0x503d19?.[_0x3b523c(0x209)](_0x3b523c(0x1f7),{'reason':_0x428d52[_0x3b523c(0x20e)],'profileName':_0x407640}),![];}if(!_0x7838c3||!_0x7838c3[_0x3b523c(0x234)]||_0x428d52['jokMS'](Object[_0x3b523c(0x23a)](_0x7838c3[_0x3b523c(0x234)])['length'],0x0))return _0x503d19?.[_0x3b523c(0x209)]('profile.add.autoRouteSkipped',{'reason':_0x428d52['KPVuj'],'profileName':_0x407640}),![];const _0x2fa673=matchAuthEnvironment(_0x30b096,_0x7838c3);if(!_0x2fa673)return console['log'](_0x428d52[_0x3b523c(0x21b)]),_0x503d19?.['trackPhaseEnd'](_0x428d52['CZusB'],{'reason':_0x428d52[_0x3b523c(0x218)],'profileName':_0x407640}),![];const _0x1b3a51=_0x7838c3['environments'][_0x2fa673],_0x399e44=_0x1b3a51?.[_0x3b523c(0x233)]??[];if(_0x50f703&&!_0x4bee55['yes']){const {saveToCloud:_0x4a2347}=await _0x4b7edf['prompt']([{'type':_0x3b523c(0x1f6),'name':_0x428d52['jcoCD'],'message':_0x3b523c(0x1fe)+_0x2fa673+_0x3b523c(0x1de)+_0x30b096+_0x3b523c(0x1ee)+_0x399e44[_0x3b523c(0x1f1)](',\x20')+_0x3b523c(0x266)+_0x407640+'\x27\x20to\x20the\x20cloud?','default':!![]}]);if(!_0x4a2347)return _0x503d19?.[_0x3b523c(0x209)](_0x3b523c(0x1f7),{'reason':_0x3b523c(0x1da),'profileName':_0x407640}),![];}const _0x2a1e7b=_0x399e44['some'](_0x3de8a4=>{const _0x397aa9=_0x3b523c;try{return _0x428d52['jokMS'](new URL(_0x3de8a4)[_0x397aa9(0x24e)],new URL(_0x30b096)['origin']);}catch{return![];}}),_0x4dbd3a={};!_0x2a1e7b&&(_0x4dbd3a['baseUrl']=_0x30b096);try{await createCloudProfile(_0x407640,_0x2fa673,{'settings':_0x4dbd3a});}catch(_0xb6f6b7){if(_0x428d52['gDVOE'](_0xb6f6b7,ApiError)&&_0xb6f6b7[_0x3b523c(0x231)]===0x199){console['error'](_0x3b523c(0x219)+_0x407640+_0x3b523c(0x1e5));throw _0xb6f6b7;}return console[_0x3b523c(0x20b)]('\x20\x20Could\x20not\x20reach\x20Ranger\x20API\x20to\x20create\x20a\x20cloud\x20profile\x20('+(_0xb6f6b7 instanceof Error?_0xb6f6b7[_0x3b523c(0x1ff)]:String(_0xb6f6b7))+').\x20Falling\x20back\x20to\x20local\x20profile.'),_0x503d19?.[_0x3b523c(0x209)](_0x3b523c(0x1f7),{'reason':_0x428d52['KPVuj'],'profileName':_0x407640}),![];}console[_0x3b523c(0x20b)](_0x428d52[_0x3b523c(0x270)](_0x3b523c(0x1d9)+_0x407640+'\x27\x20created,\x20linked\x20to\x20env\x20\x27'+_0x2fa673+'\x27.\x0a',_0x3b523c(0x1f9)+_0x407640));try{await sweepOrphanLocalProfile(_0x407640,getRangerHomeDir(),![]);const _0x1ea6c5=_0x428d52['drqdH'](getRangerDir);_0x1ea6c5!==getRangerHomeDir()&&await _0x428d52['HMbOL'](sweepOrphanLocalProfile,_0x407640,_0x1ea6c5,!![]);}catch(_0x5413b9){console[_0x3b523c(0x20b)]('\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20('+(_0x5413b9 instanceof Error?_0x5413b9[_0x3b523c(0x1ff)]:String(_0x5413b9))+').');}return _0x503d19?.['trackPhaseEnd']('profile.add.autoRouted',{'envKey':_0x2fa673,'profileName':_0x407640}),!![];}export async function addEnv(_0x486961,_0x1b515d={},_0x4d7a36){const _0x576089=_0x3323,_0xbc6c54={'qpByT':function(_0x522290,_0x39ce20,_0x4de90b){return _0x522290(_0x39ce20,_0x4de90b);},'xJECf':'Saving\x20authentication\x20state...','uJECX':function(_0x398770){return _0x398770();},'mjDVz':'close','TewIB':function(_0x2831b1,_0x298e06){return _0x2831b1===_0x298e06;},'Vepec':_0x576089(0x259),'YQZhQ':function(_0x132362,_0x928ebd,_0x3d4d27,_0x41f4e1){return _0x132362(_0x928ebd,_0x3d4d27,_0x41f4e1);},'xtKwg':function(_0x11ff9f,_0x5cf0bc){return _0x11ff9f===_0x5cf0bc;},'WPAMl':function(_0x4df7d6,_0x3a9e38){return _0x4df7d6+_0x3a9e38;},'lABCR':function(_0x1afc12,_0xa15c27,_0x34a870){return _0x1afc12(_0xa15c27,_0x34a870);},'awcBY':'--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','TcYul':'--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','EhJqw':'--ci\x20and\x20--cdp-endpoint\x20cannot\x20be\x20used\x20together.\x20Electron/CDP\x20profiles\x20only\x20work\x20with\x20a\x20locally\x20running\x20app\x20and\x20are\x20not\x20supported\x20in\x20CI.','pLyOF':function(_0x1fca78,_0x2628ff){return _0x1fca78(_0x2628ff);},'HsMMB':function(_0x2044bf,_0x22ace7,_0x41b129,_0x5c6b6e,_0x13bbfb,_0xa86e2e){return _0x2044bf(_0x22ace7,_0x41b129,_0x5c6b6e,_0x13bbfb,_0xa86e2e);},'STASY':function(_0x108e0a,_0x37cde0,_0x256f59){return _0x108e0a(_0x37cde0,_0x256f59);},'ZOibz':function(_0x44ab76,_0x1336bd){return _0x44ab76===_0x1336bd;},'AXNRI':'confirm','dbHiz':'overwrite','bgVTg':'Aborted.','nEtqF':function(_0x427ea7,_0x2fb6a7){return _0x427ea7===_0x2fb6a7;},'JJUCt':'root\x20(.ranger/)','GYlqg':_0x576089(0x21e),'svUmh':_0x576089(0x1e9),'EZolr':'\x20\x20Make\x20sure\x20your\x20Electron\x20app\x20(or\x20browser)\x20is\x20running\x20with\x20remote\x20debugging\x20enabled.\x0a','NhkIt':_0x576089(0x268),'LhxvT':_0x576089(0x216),'WdXGx':'baseUrl','hoCAb':'Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','EbUSy':_0x576089(0x1e8),'HgvRK':function(_0x361895,_0x19d7f9){return _0x361895||_0x19d7f9;},'mThyr':_0x576089(0x203),'cTwQY':'use_suggestion','zfhpq':'Continue\x20anyway','twdsA':'continue','VtSpz':function(_0x314768,_0x5e6c0d){return _0x314768(_0x5e6c0d);},'rmwue':function(_0x39f604,_0xb0bcd0){return _0x39f604===_0xb0bcd0;},'AlnSI':function(_0x32aca6,_0x5e19bc){return _0x32aca6(_0x5e19bc);},'yAiFj':function(_0x561fbc,_0x4d7c38,_0x1f4955){return _0x561fbc(_0x4d7c38,_0x1f4955);},'cdjMW':_0x576089(0x23b),'mIDmO':'\x20\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20to\x20the\x20profile\x20you\x20want\x20to\x20test\x20so\x20Ranger\x20can\x20access\x20it.','UdmVE':'\x20\x20\x20If\x20you\x20are\x20an\x20agent,\x20background\x20this\x20process\x20and\x20let\x20your\x20user\x20know\x20they\x20need\x20to\x20complete\x20browser\x20authentication.\x0a','ooWca':'--allow-insecure-localhost','crgjI':function(_0xac8f26,_0x463751){return _0xac8f26>_0x463751;},'fLFQS':function(_0x53babf,_0x379e75){return _0x53babf>_0x379e75;},'ruIFx':function(_0x4ed510,_0x14735e){return _0x4ed510||_0x14735e;},'mrrGs':_0x576089(0x250),'ajuks':_0x576089(0x200),'irWYt':'This\x20can\x20happen\x20due\x20to\x20a\x20browser\x20compatibility\x20issue\x20on\x20some\x20systems.\x0a','ZdeRA':'You\x20can\x20try\x20again\x20with\x20one\x20of:','AUiAg':'Browser\x20closed\x20before\x20authentication\x20was\x20saved.','tZUXf':function(_0x249034,_0x2049bc,_0x4d7193){return _0x249034(_0x2049bc,_0x4d7193);},'QMETp':'utf-8','IgEYk':_0x576089(0x201),'RmIxI':'\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.','wfGPs':'\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.','kDGlo':'config_write','EVWAq':_0x576089(0x205),'rwgNA':function(_0x254a62,_0x59f4a3,_0x34552f){return _0x254a62(_0x59f4a3,_0x34552f);},'Qyxbo':function(_0x531163,_0x137f51){return _0x531163(_0x137f51);},'CCNJT':'SIGINT'},_0x468717=_0x1b515d['ci']??![],_0x179249=_0x468717?'ci':'local',_0x5b926e=_0xbc6c54['TewIB'](_0x1b515d['scope'],_0xbc6c54['Vepec'])?_0xbc6c54[_0x576089(0x21a)](getRangerHomeDir):getRangerDir(),_0x1d70f8=_0xbc6c54[_0x576089(0x1dc)](join,_0x5b926e,_0x179249,_0x486961),_0x11bbb3={};if(_0x1b515d['setupHeader'])for(const _0x2a641a of _0x1b515d['setupHeader']){const _0x575f85=_0x2a641a['indexOf'](':');if(_0xbc6c54[_0x576089(0x1f5)](_0x575f85,-0x1))throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0x2a641a+_0x576089(0x240));const _0x3bef42=_0x2a641a[_0x576089(0x26b)](0x0,_0x575f85)['trim'](),_0x135bd1=_0x2a641a['slice'](_0xbc6c54[_0x576089(0x229)](_0x575f85,0x1))['trim']();_0x11bbb3[_0x3bef42]=_0x135bd1;}const _0x551bb4=_0xbc6c54['lABCR'](join,_0x5b926e,_0x179249);if(_0x1b515d['cdpEndpoint']!==undefined&&_0x1b515d['cdpEndpoint']['trim']()==='')throw new Error(_0xbc6c54['awcBY']);if(_0x1b515d['cdpEndpoint']&&_0x1b515d['url'])throw new Error(_0xbc6c54[_0x576089(0x1fc)]);if(_0x1b515d['cdpEndpoint']&&_0x1b515d['ci'])throw new Error(_0xbc6c54['EhJqw']);const _0xd3da24=_0xbc6c54['pLyOF'](Boolean,_0x1b515d['cdpEndpoint']),_0x4c0092=!_0x1b515d[_0x576089(0x25b)]&&!_0xd3da24,_0x442154=process[_0x576089(0x212)][_0x576089(0x22f)]&&process[_0x576089(0x24c)][_0x576089(0x22f)];if(!_0x442154&&!_0x1b515d[_0x576089(0x232)]&&!_0xd3da24)throw new Error('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');if(!_0x468717&&!_0x1b515d['skipAuth']&&!_0xd3da24&&_0x1b515d['url']){const _0x3848b1=await _0xbc6c54[_0x576089(0x244)](tryAutoRouteCloudProfile,_0x486961,_0x1b515d['url'],_0x1b515d,_0x442154,_0x4d7a36);if(_0x3848b1)return;}const _0x3c42e7=_0xbc6c54['STASY'](findExistingEnv,_0x486961,{'rangerDir':_0x5b926e});let _0x41d81d=null;if(_0x3c42e7){if(!_0x442154)_0x41d81d=_0x3c42e7;else{if(_0xbc6c54['ZOibz'](_0x3c42e7[_0x576089(0x211)],_0x179249)){const {overwrite:_0xf4761e}=await _0x4b7edf['prompt']([{'type':_0xbc6c54['AXNRI'],'name':_0xbc6c54['dbHiz'],'message':'Profile\x20\x22'+_0x486961+'\x22\x20already\x20exists.\x20Overwrite?','default':![]}]);if(!_0xf4761e){console['log'](_0xbc6c54[_0x576089(0x26c)]);return;}_0x41d81d=_0x3c42e7;}else{const _0x1aed2b=_0xbc6c54['nEtqF'](_0x3c42e7[_0x576089(0x211)],_0x576089(0x243))?_0xbc6c54[_0x576089(0x255)]:_0x3c42e7[_0x576089(0x211)];console['error'](_0x576089(0x1df)+_0x486961+'\x22\x20already\x20exists\x20in\x20'+_0x1aed2b+':\x20'+_0x3c42e7[_0x576089(0x23c)]),console['error'](_0x576089(0x224)+_0x179249+'\x20would\x20shadow\x20the\x20existing\x20profile.');const {shouldReplace:_0x55c3a7}=await _0x4b7edf[_0x576089(0x1e7)]([{'type':_0xbc6c54['AXNRI'],'name':_0xbc6c54['GYlqg'],'message':'Delete\x20existing\x20and\x20create\x20new\x20in\x20'+_0x179249+'?','default':![]}]);if(!_0x55c3a7){console[_0x576089(0x20b)](_0x576089(0x208));return;}_0x41d81d=_0x3c42e7;}}}_0x4d7a36?.['trackPhaseStart'](_0x576089(0x23d));let _0x3ba633='';if(_0xd3da24)console[_0x576089(0x20b)](_0xbc6c54[_0x576089(0x20d)]),console['log'](_0x576089(0x24f)+_0x1b515d['cdpEndpoint']),console['log'](_0xbc6c54['EZolr']);else{if(_0x1b515d['url']){_0x3ba633=_0x1b515d['url'];const _0x7f72ad=await _0xbc6c54['pLyOF'](checkUrlReachability,_0x3ba633);if(!_0x7f72ad['ok']&&!_0x1b515d['force'])throw new Error('Could\x20not\x20reach\x20'+_0x3ba633+':\x20'+_0x7f72ad[_0x576089(0x239)]+'\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.');!_0x7f72ad['ok']&&_0x1b515d[_0x576089(0x223)]&&console[_0x576089(0x20b)]('⚠\x20Could\x20not\x20reach\x20'+_0x3ba633+':\x20'+_0x7f72ad[_0x576089(0x239)]+'\x20(continuing\x20with\x20--force)');}else{console[_0x576089(0x20b)](_0xbc6c54['NhkIt']),console['log'](_0x576089(0x202)),console['log'](_0x576089(0x1f8));let _0x21605f=![];while(!![]){const _0x5eb6c7=await _0x4b7edf[_0x576089(0x1e7)]([{'type':_0xbc6c54['LhxvT'],'name':_0xbc6c54['WdXGx'],'message':_0x21605f?_0xbc6c54['hoCAb']:_0xbc6c54[_0x576089(0x22b)],'default':_0xbc6c54['HgvRK'](_0x3ba633,_0x576089(0x245))}]);_0x3ba633=_0x5eb6c7['baseUrl'];const _0x346718=await _0xbc6c54[_0x576089(0x24d)](checkUrlReachability,_0x3ba633);if(_0x346718['ok'])break;const _0x1de915=/^[a-zA-Z][\w+.-]*:\/\//['test'](_0x3ba633),_0x45bb90=_0x346718['isProtocolError']&&!_0x1de915,_0x340d8d=_0x45bb90?_0x576089(0x247)+_0x3ba633:null;_0x21605f=!![],console['log']('\x0a\x20\x20Could\x20not\x20reach\x20'+_0x3ba633+':\x20'+_0x346718['error']);_0x340d8d&&console['log']('\x20\x20Did\x20you\x20mean\x20'+_0x340d8d+'?');const {action:_0x233b69}=await _0x4b7edf[_0x576089(0x1e7)]([{'type':'list','name':_0x576089(0x262),'message':_0xbc6c54['mThyr'],'choices':[..._0x340d8d?[{'name':_0x576089(0x22e)+_0x340d8d,'value':_0xbc6c54['cTwQY']}]:[],{'name':_0x576089(0x20f),'value':'retry'},{'name':_0xbc6c54['zfhpq'],'value':_0xbc6c54[_0x576089(0x1fd)]}]}]);if(_0x233b69===_0xbc6c54[_0x576089(0x1ec)]&&_0x340d8d){_0x3ba633=_0x340d8d;const _0x252e3b=await _0xbc6c54['VtSpz'](checkUrlReachability,_0x3ba633);if(_0x252e3b['ok'])break;console['log']('\x0a\x20\x20Still\x20could\x20not\x20reach\x20'+_0x3ba633+':\x20'+_0x252e3b['error']);}else{if(_0xbc6c54[_0x576089(0x226)](_0x233b69,'continue'))break;}}}}_0x4d7a36?.['trackPhaseEnd'](_0x576089(0x23d));const _0x1ce3c5={};if(_0x41d81d){const _0x59684a=await _0xbc6c54[_0x576089(0x257)](loadSettings,_0x486961);Object['assign'](_0x1ce3c5,_0x59684a['setupHeaders']);}Object[_0x576089(0x25d)](_0x1ce3c5,_0x11bbb3),await mkdir(_0x551bb4,{'recursive':!![]});try{const _0x49ce44=await readdir(_0x551bb4),_0x33feef=_0x576089(0x228)+_0x486961+'-';for(const _0x395a5e of _0x49ce44){_0x395a5e['startsWith'](_0x33feef)&&await _0xbc6c54['yAiFj'](rm,join(_0x551bb4,_0x395a5e),{'recursive':!![],'force':!![]});}}catch{}const _0xa31594=await mkdtemp(_0xbc6c54[_0x576089(0x267)](join,_0x551bb4,_0x576089(0x228)+_0x486961+'-')),_0x3f1c83=join(_0xa31594,'auth.json'),_0x1abc1e=()=>{_0xbc6c54['qpByT'](rm,_0xa31594,{'recursive':!![],'force':!![]})['catch'](()=>{})['finally'](()=>{process['exit'](0x82);});};process[_0x576089(0x21c)](_0x576089(0x24b),_0x1abc1e);const _0x14c93f=Boolean(_0x3ba633)&&/^https:\/\/localhost(:\d+)?/i['test'](_0x3ba633);try{if(_0x4c0092){_0x4d7a36?.[_0x576089(0x1e0)](_0xbc6c54[_0x576089(0x1e3)]),console[_0x576089(0x20b)](_0x576089(0x1e1)),console['log'](_0xbc6c54[_0x576089(0x204)]),console['log']('\x20\x20\x20When\x20done\x20logging\x20in,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.');!_0x442154?(console['log']('\x0a\x20\x20\x20⚠\x20This\x20step\x20requires\x20human\x20interaction\x20in\x20a\x20browser.'),console[_0x576089(0x20b)](_0xbc6c54[_0x576089(0x1eb)])):console['log']('');await new Promise(_0x338618=>setTimeout(_0x338618,0xbb8));const _0x3301eb=[];_0x1b515d['safeMode']&&_0x3301eb['push']('--disable-features=WebBluetooth');const _0x466a13=_0x1b515d['allowInsecureLocalhost']||_0x14c93f;_0x466a13&&_0x3301eb['push'](_0xbc6c54['ooWca']);const _0x3232ac=await chromium['launch']({'headless':![],..._0xbc6c54[_0x576089(0x263)](_0x3301eb['length'],0x0)?{'args':_0x3301eb}:{}});try{const _0x5be301=_0xbc6c54[_0x576089(0x260)](Object[_0x576089(0x23a)](_0x1ce3c5)[_0x576089(0x22d)],0x0),_0x55da7e={'ignoreHTTPSErrors':!![]};_0x5be301&&(_0x55da7e[_0x576089(0x246)]=_0x1ce3c5);const _0x516726=await _0x3232ac[_0x576089(0x258)](_0x55da7e);await addProfileSetupBanner(_0x516726);const _0xab0eac=await _0x516726[_0x576089(0x248)]();await _0xab0eac['goto'](_0xbc6c54['ruIFx'](_0x3ba633,_0xbc6c54['mrrGs']));let _0x5ee981=![];await new Promise(_0x2be61e=>{const _0x58a2ef=_0x576089;_0xab0eac['on'](_0xbc6c54[_0x58a2ef(0x26f)],async()=>{const _0x923f1d=_0x58a2ef;try{console[_0x923f1d(0x20b)](_0xbc6c54[_0x923f1d(0x225)]),await _0x516726['storageState']({'path':_0x3f1c83}),_0x5ee981=!![];}catch{}_0xbc6c54['uJECX'](_0x2be61e);});});if(!_0x5ee981){console['log'](_0xbc6c54[_0x576089(0x21f)]);!_0x1b515d[_0x576089(0x1dd)]&&(console['log'](_0xbc6c54['irWYt']),console['log'](_0xbc6c54[_0x576089(0x1e2)]),console['log']('\x20\x20ranger\x20profile\x20add\x20'+_0x486961+_0x576089(0x222)),console[_0x576089(0x20b)]('\x20\x20ranger\x20profile\x20add\x20'+_0x486961+_0x576089(0x242)));throw new Error(_0xbc6c54[_0x576089(0x1f0)]);}}finally{await _0x3232ac[_0x576089(0x1db)]()['catch'](()=>{});}if(_0x468717){const _0x46ed0b=await _0xbc6c54[_0x576089(0x21d)](readFile,_0x3f1c83,_0xbc6c54['QMETp']),_0x550467=await _0xbc6c54['uJECX'](getToken);if(!_0x550467){console[_0x576089(0x239)](_0xbc6c54['IgEYk']),await unlink(_0x3f1c83)[_0x576089(0x265)](()=>{});throw new Error('Missing\x20API\x20token;\x20aborting\x20CI\x20profile\x20creation.');}else{const _0x13b1bc=encrypt(_0x46ed0b,_0x550467);await writeFile(_0x3f1c83+_0x576089(0x210),_0x13b1bc),await _0xbc6c54['AlnSI'](unlink,_0x3f1c83),console['log'](_0x576089(0x20c)+_0x3f1c83+_0x576089(0x210)),console['log'](_0xbc6c54[_0x576089(0x26d)]),console[_0x576089(0x20b)](_0xbc6c54['wfGPs']);}}else console['log']('✓\x20Auth\x20state\x20saved\x20to:\x20'+_0x3f1c83);_0x4d7a36?.['trackPhaseEnd'](_0xbc6c54[_0x576089(0x1e3)]);}_0x4d7a36?.[_0x576089(0x1e0)](_0xbc6c54[_0x576089(0x236)]);const _0x4151a8={};_0x3ba633&&(_0x4151a8['baseUrl']=_0x3ba633);_0x1b515d[_0x576089(0x253)]&&(_0x4151a8['cdpEndpoint']=_0x1b515d[_0x576089(0x253)],_0x4151a8[_0x576089(0x1e6)]=!![]);(_0x1b515d[_0x576089(0x1fa)]||_0x14c93f)&&(_0x4151a8['allowInsecureLocalhost']=!![]);_0x1b515d[_0x576089(0x1dd)]&&(_0x4151a8['safeMode']=!![]);Object['keys'](_0x1ce3c5)['length']>0x0&&(_0x4151a8['setupHeaders']=_0x1ce3c5);await writeFile(_0xbc6c54['yAiFj'](join,_0xa31594,'settings.json'),JSON['stringify'](_0x4151a8,null,0x2)),console[_0x576089(0x20b)](_0x576089(0x24a)+join(_0x1d70f8,_0xbc6c54[_0x576089(0x25e)]));if(_0x41d81d?.[_0x576089(0x211)]===_0x179249){const _0x3f96f1=_0x41d81d[_0x576089(0x23c)]+'.backup-'+Date['now']();await rename(_0x41d81d['path'],_0x3f96f1);try{await rename(_0xa31594,_0x1d70f8);}catch(_0x274159){await _0xbc6c54['rwgNA'](rename,_0x3f96f1,_0x41d81d[_0x576089(0x23c)]);throw _0x274159;}try{await rm(_0x3f96f1,{'recursive':!![]});}catch{console['log'](_0x576089(0x235)+_0x3f96f1);}}else{await _0xbc6c54[_0x576089(0x21d)](rename,_0xa31594,_0x1d70f8);if(_0x41d81d)try{await rm(_0x41d81d['path'],{'recursive':!![]}),console[_0x576089(0x20b)]('Removed\x20existing\x20profile\x20at\x20'+_0x41d81d['path']);}catch{console[_0x576089(0x20b)]('Warning:\x20Could\x20not\x20remove\x20old\x20profile\x20at\x20'+_0x41d81d[_0x576089(0x23c)]);}}try{await _0xbc6c54['Qyxbo'](writeActiveProfileName,_0x486961),console[_0x576089(0x20b)](_0x576089(0x20a)+_0x486961);}catch{console['log']('Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.');}_0x4d7a36?.[_0x576089(0x209)](_0xbc6c54['kDGlo']),console['log'](_0x576089(0x213)+_0x486961+_0x576089(0x207));}catch(_0x261fe0){await rm(_0xa31594,{'recursive':!![],'force':!![]});throw _0x261fe0;}finally{process[_0x576089(0x1fb)](_0xbc6c54['CCNJT'],_0x1abc1e);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x24afb8,_0x23a363){const _0x2a96e2=_0x2e82,_0x2edadb=_0x24afb8();while(!![]){try{const _0xd385c2=-parseInt(_0x2a96e2(0x16b))/0x1+parseInt(_0x2a96e2(0x172))/0x2+parseInt(_0x2a96e2(0x17f))/0x3*(-parseInt(_0x2a96e2(0x16c))/0x4)+parseInt(_0x2a96e2(0x170))/0x5+parseInt(_0x2a96e2(0x174))/0x6*(-parseInt(_0x2a96e2(0x177))/0x7)+-parseInt(_0x2a96e2(0x178))/0x8+parseInt(_0x2a96e2(0x16d))/0x9*(parseInt(_0x2a96e2(0x176))/0xa);if(_0xd385c2===_0x23a363)break;else _0x2edadb['push'](_0x2edadb['shift']());}catch(_0x1b60a6){_0x2edadb['push'](_0x2edadb['shift']());}}}(_0x353d,0xd14a3));import{readFile,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x353d(){const _0x5c1611=['\x0a\x20\x20The\x20plaintext\x20auth.json\x20is\x20gitignored\x20for\x20security.','Profile\x20\x22','gphsK','.enc','187599NIBTCu','RMpNh','1608020WFvVAy','8cLlRWC','11565CqARLw','utf-8','auth.json','7236670nCLUKS','\x20\x20The\x20encrypted\x20auth.json.enc\x20can\x20be\x20committed.','1711676enBOaP','HTGyI','3160662bcHBDo','xMRqb','21410OuClFo','21lNNbAC','7069512aFQFGF','log','No\x20auth.json\x20found\x20at\x20'];_0x353d=function(){return _0x5c1611;};return _0x353d();}import{encrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';function _0x2e82(_0x2550d4,_0x26ee1e){_0x2550d4=_0x2550d4-0x16a;const _0x353d87=_0x353d();let _0x2e825d=_0x353d87[_0x2550d4];return _0x2e825d;}import{getEnvDir}from'./utils/settings.js';export async function authEncrypt(_0x2b7b3d){const _0x3a835b=_0x2e82,_0x5ea5dc={'HTGyI':function(_0x515fbd,_0x5b7142){return _0x515fbd(_0x5b7142);},'RMpNh':function(_0x3dcaba,_0x33d9cb,_0x2a4a6d){return _0x3dcaba(_0x33d9cb,_0x2a4a6d);},'xMRqb':function(_0x17d50d,_0x3c162a){return _0x17d50d+_0x3c162a;},'aZmFs':_0x3a835b(0x17e),'FFPkb':function(_0x5e0c7c,_0x56dd3c){return _0x5e0c7c(_0x56dd3c);},'gphsK':function(_0x1da8c1){return _0x1da8c1();}},_0x6f8086=_0x5ea5dc[_0x3a835b(0x173)](getEnvDir,_0x2b7b3d),_0x4d80c0=_0x5ea5dc['RMpNh'](join,_0x6f8086,_0x3a835b(0x16f)),_0x2ef9e9=_0x5ea5dc[_0x3a835b(0x175)](_0x4d80c0,_0x5ea5dc['aZmFs']);if(!_0x5ea5dc['FFPkb'](existsSync,_0x6f8086))throw new Error(_0x3a835b(0x17c)+_0x2b7b3d+'\x22\x20not\x20found.\x20Run\x20first:\x20ranger\x20profile\x20add\x20'+_0x2b7b3d);if(!_0x5ea5dc['FFPkb'](existsSync,_0x4d80c0))throw new Error(_0x3a835b(0x17a)+_0x4d80c0+'.\x20Run\x20first:\x20ranger\x20profile\x20add\x20with\x20authentication,\x20or\x20ranger\x20profile\x20update');const _0x421d45=await _0x5ea5dc[_0x3a835b(0x17d)](getToken);if(!_0x421d45)throw new Error('No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]');const _0x30a758=await _0x5ea5dc[_0x3a835b(0x16a)](readFile,_0x4d80c0,_0x3a835b(0x16e)),_0x30c4b2=encrypt(_0x30a758,_0x421d45);await writeFile(_0x2ef9e9,_0x30c4b2),console['log']('\x0a✓\x20Encrypted\x20auth\x20saved\x20to:\x20'+_0x2ef9e9),console[_0x3a835b(0x179)]('\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.'),console['log']('\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.'),existsSync(_0x2ef9e9)&&(console[_0x3a835b(0x179)](_0x3a835b(0x17b)),console['log'](_0x3a835b(0x171)));}
|
package/build/commands/clean.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x72e0b6=_0x1d8f;(function(_0x2c41de,_0x3710cd){const _0x94d5b2=_0x1d8f,_0x1ee0fa=_0x2c41de();while(!![]){try{const _0x10276=parseInt(_0x94d5b2(0xda))/0x1+parseInt(_0x94d5b2(0xe2))/0x2*(-parseInt(_0x94d5b2(0xdb))/0x3)+-parseInt(_0x94d5b2(0xcf))/0x4*(-parseInt(_0x94d5b2(0xcd))/0x5)+-parseInt(_0x94d5b2(0xfc))/0x6*(-parseInt(_0x94d5b2(0xce))/0x7)+parseInt(_0x94d5b2(0xfb))/0x8+-parseInt(_0x94d5b2(0xcc))/0x9+-parseInt(_0x94d5b2(0xd4))/0xa;if(_0x10276===_0x3710cd)break;else _0x1ee0fa['push'](_0x1ee0fa['shift']());}catch(_0x2d8380){_0x1ee0fa['push'](_0x1ee0fa['shift']());}}}(_0x1962,0xbbc72));import{rm,readFile,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{spawn}from'child_process';import{deleteAllCredentials}from'./utils/keychain.js';import{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',_0x72e0b6(0xee),_0x72e0b6(0xf4),_0x72e0b6(0xd8)],opencodePluginName='@ranger-testing/opencode-plugin';function parseJsonc(_0x3b75d1){const _0x4cf505=_0x72e0b6,_0x416efb=_0x3b75d1['replace'](/\/\*[\s\S]*?\*\//g,''),_0x38ad0e=_0x416efb['replace'](/^\s*\/\/.*$/gm,''),_0x10c611=_0x38ad0e[_0x4cf505(0x100)](/,\s*([}\]])/g,'$1');return JSON['parse'](_0x10c611);}function _0x1d8f(_0x303a0f,_0x1a2a1a){_0x303a0f=_0x303a0f-0xcc;const _0x1962fd=_0x1962();let _0x1d8f03=_0x1962fd[_0x303a0f];return _0x1d8f03;}async function removeOpencodePluginConfig(_0x18791c){const _0x560d49=_0x72e0b6,_0x3c6460={'RFHkh':_0x560d49(0xe3),'jwSOT':function(_0x2bdb11,_0x19bdd8){return _0x2bdb11!==_0x19bdd8;},'axtRl':function(_0x4c0b99,_0x439b57,_0x3fe187){return _0x4c0b99(_0x439b57,_0x3fe187);},'LUiCW':_0x560d49(0xdc),'ntnpg':function(_0x1b9c7a,_0x32f35a){return _0x1b9c7a(_0x32f35a);}};if(!existsSync(_0x18791c))return![];let _0xb329b1;try{const _0x739fc0=await _0x3c6460['axtRl'](readFile,_0x18791c,_0x3c6460[_0x560d49(0xe9)]);_0xb329b1=_0x3c6460[_0x560d49(0xde)](parseJsonc,_0x739fc0);}catch{return![];}const _0x284d91=Array[_0x560d49(0xf9)](_0xb329b1[_0x560d49(0xe7)])?_0xb329b1[_0x560d49(0xe7)]:[];if(_0x284d91[_0x560d49(0xe0)]===0x0)return![];const _0x3b5f9d=_0x284d91[_0x560d49(0xe1)](_0x2926db=>{const _0x56d246=_0x560d49;if(typeof _0x2926db!==_0x3c6460[_0x56d246(0xd3)])return!![];return _0x3c6460[_0x56d246(0xf8)](_0x2926db,opencodePluginName);});if(_0x3b5f9d[_0x560d49(0xe0)]===_0x284d91['length'])return![];return _0x3b5f9d[_0x560d49(0xe0)]===0x0?delete _0xb329b1['plugin']:_0xb329b1['plugin']=_0x3b5f9d,await writeFile(_0x18791c,JSON['stringify'](_0xb329b1,null,0x2)+'\x0a'),!![];}function _0x1962(){const _0x5ddbe5=['ntnpg','user','length','filter','678090KUbbPf','string','Vhtpk','QKprD','IIJBj','plugin','RORfS','LUiCW','pipe','✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)','Nothing\x20to\x20clean\x20up.\x0a','remove','feature-tracker','close','HncfM','XfrLJ','platform','bxyKF','bug-bash','--scope','✓\x20Removed\x20project\x20skill:\x20','LaaeZ','jwSOT','isArray','win32','11850904OQfiJA','12HZAdHM','bBbUQ','zFSaT','ranger@trailhead','replace','jTvoF','3091743gHCWrp','369545TBVRhT','3682987olBvHD','32shbORi','log','KqztI','claude','RFHkh','16099300oMOPZH','PJDCS','✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)','trupo','e2e-test-recommender','aGPxc','614813cGAfhS','9IUoSBt','utf-8','error'];_0x1962=function(){return _0x5ddbe5;};return _0x1962();}async function uninstallClaudePlugin(_0x5b7da8){const _0x350e93=_0x72e0b6,_0x30aa8f={'BYaht':function(_0x4a8a67,_0x1e40b5,_0x6006ef,_0x356420){return _0x4a8a67(_0x1e40b5,_0x6006ef,_0x356420);},'aGPxc':_0x350e93(0xea),'KqztI':_0x350e93(0xfa)};return new Promise(_0x77a0d9=>{const _0x4b1e01=_0x350e93,_0x4b12e9=[_0x4b1e01(0xe7),'uninstall',_0x4b1e01(0xff)];_0x5b7da8&&_0x4b12e9['push'](_0x4b1e01(0xf5),_0x5b7da8);const _0x5b2914=_0x30aa8f['BYaht'](spawn,_0x4b1e01(0xd2),_0x4b12e9,{'stdio':_0x30aa8f[_0x4b1e01(0xd9)],'shell':process[_0x4b1e01(0xf2)]===_0x30aa8f[_0x4b1e01(0xd1)]});_0x5b2914['on'](_0x4b1e01(0xef),_0x141529=>{_0x77a0d9(_0x141529===0x0);}),_0x5b2914['on']('error',()=>{_0x77a0d9(![]);});});}async function removeMarketplace(){const _0x4cbff4=_0x72e0b6,_0x2361f6={'MqQuW':function(_0x2f42e8,_0x3daaef,_0x1e7164,_0x407121){return _0x2f42e8(_0x3daaef,_0x1e7164,_0x407121);},'WokRy':'plugin','zFSaT':'marketplace','tNzLX':'trailhead','IATOx':'pipe','KvMJY':_0x4cbff4(0xef),'IIJBj':_0x4cbff4(0xdd)};return new Promise(_0x1d1840=>{const _0x24968c=_0x4cbff4,_0x2683f4={'Ookil':function(_0x4c9ba1,_0x255091){return _0x4c9ba1(_0x255091);},'XfrLJ':function(_0x15e3bf,_0x3494db){return _0x15e3bf===_0x3494db;}},_0x164cdb=_0x2361f6['MqQuW'](spawn,_0x24968c(0xd2),[_0x2361f6['WokRy'],_0x2361f6[_0x24968c(0xfe)],_0x24968c(0xed),_0x2361f6['tNzLX']],{'stdio':_0x2361f6['IATOx'],'shell':process['platform']===_0x24968c(0xfa)});_0x164cdb['on'](_0x2361f6['KvMJY'],_0x236fa3=>{const _0x3f2915=_0x24968c;_0x2683f4['Ookil'](_0x1d1840,_0x2683f4[_0x3f2915(0xf1)](_0x236fa3,0x0));}),_0x164cdb['on'](_0x2361f6[_0x24968c(0xe6)],()=>{_0x2683f4['Ookil'](_0x1d1840,![]);});});}export async function clean(){const _0x218672=_0x72e0b6,_0x36632f={'EhFVM':'\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','trupo':'✓\x20Removed\x20stored\x20credentials','lvXSF':function(_0x4dc24f){return _0x4dc24f();},'jTvoF':function(_0x21f093){return _0x21f093();},'HncfM':function(_0x3ae8d3,_0x597bb6){return _0x3ae8d3(_0x597bb6);},'ayiFv':function(_0xedbdf5,_0x338e5a,_0x2cbdd2){return _0xedbdf5(_0x338e5a,_0x2cbdd2);},'QKprD':function(_0x23fd77,_0x5e2e0f){return _0x23fd77(_0x5e2e0f);},'Vhtpk':'project','LaaeZ':function(_0x405faa,_0x50e140,_0x46eae9){return _0x405faa(_0x50e140,_0x46eae9);},'bxyKF':_0x218672(0xdf),'PJDCS':function(_0x166a95,_0x4e569a,_0x3a87cb){return _0x166a95(_0x4e569a,_0x3a87cb);},'FIqoZ':function(_0x31a5a9,_0x1d6567){return _0x31a5a9(_0x1d6567);},'bcYBi':'✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)','bBbUQ':function(_0x59eccb){return _0x59eccb();},'PIFIE':'\x0a✅\x20Cleanup\x20complete!\x0a','RORfS':_0x218672(0xec)};console['log'](_0x36632f['EhFVM']);let _0x2d447b=![];try{await deleteAllCredentials(),console[_0x218672(0xd0)](_0x36632f[_0x218672(0xd7)]),_0x2d447b=!![];}catch{}const _0x1bf4b6=_0x36632f['lvXSF'](getCacheFile);existsSync(_0x1bf4b6)&&(await rm(_0x1bf4b6),_0x2d447b=!![]);const _0x107269=_0x36632f[_0x218672(0x101)](getRangerDir);_0x36632f[_0x218672(0xf0)](existsSync,_0x107269)&&(await rm(_0x107269,{'recursive':!![]}),console['log']('✓\x20Removed\x20.ranger/\x20directory'),_0x2d447b=!![]);const _0x3725ca=getProjectSkillsDir();for(const _0x5ac2ce of skillsToRemove){const _0x374ff9=_0x36632f['ayiFv'](join,_0x3725ca,_0x5ac2ce);_0x36632f[_0x218672(0xe5)](existsSync,_0x374ff9)&&(await rm(_0x374ff9,{'recursive':!![]}),console[_0x218672(0xd0)](_0x218672(0xf6)+_0x5ac2ce),_0x2d447b=!![]);}const _0x1500c2=_0x36632f['jTvoF'](getUserSkillsDir);for(const _0x4d86c6 of skillsToRemove){const _0x4ea15c=_0x36632f['ayiFv'](join,_0x1500c2,_0x4d86c6);existsSync(_0x4ea15c)&&(await rm(_0x4ea15c,{'recursive':!![]}),console['log']('✓\x20Removed\x20user\x20skill:\x20'+_0x4d86c6),_0x2d447b=!![]);}const _0x564590=getOpencodeSkillsDir(_0x36632f[_0x218672(0xe4)]);for(const _0x581c1a of skillsToRemove){const _0x53f7e2=_0x36632f[_0x218672(0xf7)](join,_0x564590,_0x581c1a);_0x36632f['HncfM'](existsSync,_0x53f7e2)&&(await _0x36632f[_0x218672(0xf7)](rm,_0x53f7e2,{'recursive':!![]}),console[_0x218672(0xd0)]('✓\x20Removed\x20OpenCode\x20project\x20skill:\x20'+_0x581c1a),_0x2d447b=!![]);}const _0x3d7d48=getOpencodeSkillsDir(_0x36632f[_0x218672(0xf3)]);for(const _0x1f27bc of skillsToRemove){const _0x2a5c55=join(_0x3d7d48,_0x1f27bc);existsSync(_0x2a5c55)&&(await rm(_0x2a5c55,{'recursive':!![]}),console['log']('✓\x20Removed\x20OpenCode\x20user\x20skill:\x20'+_0x1f27bc),_0x2d447b=!![]);}const _0x34a026=_0x36632f[_0x218672(0xd5)](join,_0x36632f['QKprD'](getOpencodeConfigDir,_0x36632f[_0x218672(0xe4)]),'opencode.json');await _0x36632f['FIqoZ'](removeOpencodePluginConfig,_0x34a026)&&(console['log'](_0x36632f['bcYBi']),_0x2d447b=!![]);const _0x5bf7d6=join(_0x36632f[_0x218672(0xf0)](getOpencodeConfigDir,_0x36632f[_0x218672(0xf3)]),'opencode.json');await removeOpencodePluginConfig(_0x5bf7d6)&&(console['log']('✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)'),_0x2d447b=!![]);const _0x4adf0d=await _0x36632f[_0x218672(0xfd)](uninstallClaudePlugin);_0x4adf0d&&(console['log'](_0x218672(0xd6)),_0x2d447b=!![]);const _0x328b05=await _0x36632f[_0x218672(0xf0)](uninstallClaudePlugin,_0x36632f[_0x218672(0xe4)]);_0x328b05&&(console[_0x218672(0xd0)](_0x218672(0xeb)),_0x2d447b=!![]);const _0x125301=await _0x36632f[_0x218672(0xfd)](removeMarketplace);_0x125301&&(console[_0x218672(0xd0)]('✓\x20Removed\x20trailhead\x20marketplace'),_0x2d447b=!![]),_0x2d447b?console[_0x218672(0xd0)](_0x36632f['PIFIE']):console['log'](_0x36632f[_0x218672(0xe8)]);}
|
package/build/commands/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x31d297=_0x43b2;(function(_0x5367d7,_0x4809ae){const _0x1ada3d=_0x43b2,_0x177f83=_0x5367d7();while(!![]){try{const _0x251c35=-parseInt(_0x1ada3d(0xb0))/0x1+parseInt(_0x1ada3d(0xc1))/0x2+parseInt(_0x1ada3d(0xb4))/0x3+-parseInt(_0x1ada3d(0x9e))/0x4+parseInt(_0x1ada3d(0xb1))/0x5*(-parseInt(_0x1ada3d(0xbb))/0x6)+parseInt(_0x1ada3d(0x9f))/0x7*(-parseInt(_0x1ada3d(0xc5))/0x8)+parseInt(_0x1ada3d(0xa8))/0x9;if(_0x251c35===_0x4809ae)break;else _0x177f83['push'](_0x177f83['shift']());}catch(_0x236ea8){_0x177f83['push'](_0x177f83['shift']());}}}(_0x1e78,0xcc00b));import{existsSync}from'fs';function _0x1e78(){const _0xa77e4c=['854618HKRCiJ','175zEoOTe','kuwBZ','EUcOS','3531468hyBABk','wqWqR','cGhnM','isNaN','WElqQ','log','\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20','62838WWyAnh','Invalid\x20value\x20for\x20','keys','test','OgxFV','fZTUG','692070IQCMmt','Fyvur','headless','endsWith','645896uXnYIo','\x20for\x20\x22','No\x20configuration\x20set\x20for\x20\x22','allowInsecureLocalhost','Hfpfp','BLuMJ','Cleared\x20local\x20overrides\x20for\x20\x22','trim','LObfw','cloud','alsoExistsElsewhere','1805632jcMbTp','105freWrj','local','true','kind','startsWith','settings','object','stringify','uOmYQ','19764360RegMUl','fbAwk','parse','(not\x20set)','\x20\x20Note:\x20\x22','Removed\x20','\x20=\x20','FSuNJ'];_0x1e78=function(){return _0xa77e4c;};return _0x1e78();}import{loadSettings,saveSettings,getNestedValue,setNestedValue,deleteNestedValue,formatSettings,getSettingsPath,getEnvDir}from'./utils/settings.js';import{fetchCloudProfile}from'./utils/cloudProfile.js';import{mergeCloudProfileSettings,readProfileOverrides,resetProfileOverrides,setProfileOverride,unsetProfileOverride}from'./utils/projectsConfig.js';const BOOLEAN_KEYS=[_0x31d297(0xc3),_0x31d297(0xc8)];function parseLocalValue(_0x190094,_0x1abed6){const _0x4a46ee=_0x31d297,_0x1c4535={'VYovc':function(_0x362399,_0x1f9f9a){return _0x362399===_0x1f9f9a;},'BLuMJ':_0x4a46ee(0xa1),'wqWqR':function(_0x284b5c,_0x5ceaeb){return _0x284b5c===_0x5ceaeb;},'WvGHr':'false'};if(BOOLEAN_KEYS['includes'](_0x190094)){if(_0x1c4535['VYovc'](_0x1abed6,_0x1c4535[_0x4a46ee(0xca)]))return!![];if(_0x1c4535[_0x4a46ee(0xb5)](_0x1abed6,_0x1c4535['WvGHr']))return![];throw new Error(_0x4a46ee(0xbc)+_0x190094+':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22');}return _0x1abed6;}function parseOverrideValue(_0x23078f){const _0x1e6be6=_0x31d297,_0x6032ad={'kuwBZ':function(_0x343e62,_0x21e8e0){return _0x343e62===_0x21e8e0;},'iHDod':'false','kXVfa':'null','ijvdN':function(_0x4eabac,_0xc4b9ae){return _0x4eabac===_0xc4b9ae;},'XwUQW':'undefined','uLcgd':function(_0x5886ed,_0x5a1cac){return _0x5886ed(_0x5a1cac);},'iQAUg':function(_0x56bd16,_0x2d0eb0){return _0x56bd16(_0x2d0eb0);}};if(_0x6032ad[_0x1e6be6(0xb2)](_0x23078f,'true'))return!![];if(_0x23078f===_0x6032ad['iHDod'])return![];if(_0x6032ad[_0x1e6be6(0xb2)](_0x23078f,_0x6032ad['kXVfa']))return null;if(_0x6032ad['ijvdN'](_0x23078f,_0x6032ad['XwUQW']))return undefined;if(/^-?\d+$/['test'](_0x23078f)){const _0x188f70=_0x6032ad['uLcgd'](Number,_0x23078f);if(Number['isSafeInteger'](_0x188f70))return _0x188f70;}if(/^-?\d+\.\d+$/[_0x1e6be6(0xbe)](_0x23078f)){const _0x45a022=_0x6032ad['iQAUg'](Number,_0x23078f);if(!Number[_0x1e6be6(0xb7)](_0x45a022))return _0x45a022;}const _0x1963e3=_0x23078f[_0x1e6be6(0xcc)]();if(_0x1963e3['startsWith']('{')&&_0x1963e3[_0x1e6be6(0xc4)]('}')||_0x1963e3[_0x1e6be6(0xa3)]('[')&&_0x1963e3[_0x1e6be6(0xc4)](']'))try{return JSON[_0x1e6be6(0xaa)](_0x1963e3);}catch{}return _0x23078f;}async function resolveProfileTarget(_0x33e501){const _0x39a6fd=_0x31d297,_0x4dda4c={'ICoxi':function(_0x3ae0bc,_0x5dc947){return _0x3ae0bc(_0x5dc947);},'Fyvur':function(_0x2e617a,_0x219d1a){return _0x2e617a(_0x219d1a);},'oZNut':function(_0x22796c,_0x59e7a0){return _0x22796c(_0x59e7a0);},'VhWZC':_0x39a6fd(0xa0)},_0x1e56e4=_0x4dda4c['ICoxi'](existsSync,_0x4dda4c[_0x39a6fd(0xc2)](getEnvDir,_0x33e501));let _0x5cdb07=![];try{const _0xfd4239=await fetchCloudProfile(_0x33e501);_0x5cdb07=_0x4dda4c['oZNut'](Boolean,_0xfd4239);}catch{}if(_0x5cdb07)return{'kind':'cloud','alsoExistsElsewhere':_0x1e56e4};if(_0x1e56e4)return{'kind':_0x4dda4c['VhWZC'],'alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x33e501+_0x39a6fd(0xba)+_0x33e501);}function _0x43b2(_0x37da2e,_0x409a31){_0x37da2e=_0x37da2e-0x9e;const _0x1e7897=_0x1e78();let _0x43b2f2=_0x1e7897[_0x37da2e];return _0x43b2f2;}function printDualExistsHint(_0x409beb){const _0x92096b=_0x31d297;console['log'](_0x92096b(0xac)+_0x409beb+'\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.');}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x423e01){const _0x59b465=_0x31d297,_0x1b2256={'pNuQr':function(_0x1dfba6,_0x3fd712){return _0x1dfba6(_0x3fd712);},'fZTUG':function(_0x1d93a9,_0x36cf8a,_0x315b80){return _0x1d93a9(_0x36cf8a,_0x315b80);},'fbAwk':function(_0x4513b0){return _0x4513b0();}},_0x508618=await _0x1b2256['pNuQr'](fetchCloudProfile,_0x423e01),_0x6a6255=_0x1b2256[_0x59b465(0xc0)](readProfileOverrides,_0x1b2256[_0x59b465(0xa9)](getProjectPath),_0x423e01);return _0x1b2256['fZTUG'](mergeCloudProfileSettings,_0x508618?.[_0x59b465(0xa4)]??{},_0x6a6255??undefined);}export async function configSet(_0x5c8fa4,_0x20116b,_0x39fdce){const _0x35ad96=_0x31d297,_0x1bd163={'ouQaF':function(_0x2781c9,_0x302342){return _0x2781c9(_0x302342);},'UOxWC':'cloud','WElqQ':function(_0x54716e,_0x5170fc,_0x1b6f18,_0x39e7d7,_0x4e5851){return _0x54716e(_0x5170fc,_0x1b6f18,_0x39e7d7,_0x4e5851);},'OgxFV':function(_0x45042e){return _0x45042e();},'uOmYQ':function(_0x17776b,_0x2fdde7,_0xf06a6){return _0x17776b(_0x2fdde7,_0xf06a6);}},_0x2f94a4=await _0x1bd163['ouQaF'](resolveProfileTarget,_0x5c8fa4);if(_0x2f94a4['kind']===_0x1bd163['UOxWC']){if(_0x2f94a4[_0x35ad96(0xcf)])printDualExistsHint(_0x5c8fa4);const _0x6665c4=parseOverrideValue(_0x39fdce);_0x1bd163[_0x35ad96(0xb8)](setProfileOverride,_0x1bd163[_0x35ad96(0xbf)](getProjectPath),_0x5c8fa4,_0x20116b,_0x6665c4),console[_0x35ad96(0xb9)]('Set\x20'+_0x20116b+_0x35ad96(0xae)+JSON['stringify'](_0x6665c4)+'\x20for\x20\x22'+_0x5c8fa4+'\x22');return;}const _0x4ce4a9=await loadSettings(_0x5c8fa4),_0x4244a6=parseLocalValue(_0x20116b,_0x39fdce);setNestedValue(_0x4ce4a9,_0x20116b,_0x4244a6),await _0x1bd163[_0x35ad96(0xa7)](saveSettings,_0x5c8fa4,_0x4ce4a9),console[_0x35ad96(0xb9)]('Set\x20'+_0x20116b+'\x20=\x20'+_0x4244a6+_0x35ad96(0xc6)+_0x5c8fa4+'\x22');}export async function configGet(_0x53812d,_0x2e309d){const _0x56dee3=_0x31d297,_0x2b65c8={'QyQqG':function(_0x2aa62f,_0x2db3b5){return _0x2aa62f===_0x2db3b5;},'iereK':'cloud','FtSEe':function(_0x53d801,_0x5c1e1f){return _0x53d801===_0x5c1e1f;},'dlNyA':function(_0x458bf0,_0x387248,_0x17f7a3){return _0x458bf0(_0x387248,_0x17f7a3);},'rQFJj':function(_0x35b435,_0x53629f){return _0x35b435===_0x53629f;},'cGhnM':_0x56dee3(0xa5)},_0x547365=await resolveProfileTarget(_0x53812d);if(_0x2b65c8['QyQqG'](_0x547365['kind'],_0x2b65c8['iereK'])){const _0x3d0dca=await loadEffectiveCloudSettings(_0x53812d),_0x5dd8e7=getNestedValue(_0x3d0dca,_0x2e309d);if(_0x2b65c8['FtSEe'](_0x5dd8e7,undefined))console['log'](_0x56dee3(0xab));else _0x2b65c8['FtSEe'](typeof _0x5dd8e7,_0x56dee3(0xa5))?console['log'](JSON[_0x56dee3(0xa6)](_0x5dd8e7,null,0x2)):console['log'](_0x5dd8e7);return;}const _0xde9398=await loadSettings(_0x53812d),_0x53b506=_0x2b65c8['dlNyA'](getNestedValue,_0xde9398,_0x2e309d);if(_0x2b65c8['rQFJj'](_0x53b506,undefined))console[_0x56dee3(0xb9)](_0x56dee3(0xab));else typeof _0x53b506===_0x2b65c8[_0x56dee3(0xb6)]?console['log'](JSON[_0x56dee3(0xa6)](_0x53b506,null,0x2)):console['log'](_0x53b506);}export async function configList(_0x2f00ef){const _0x588728=_0x31d297,_0x44c4fa={'FSuNJ':function(_0x391b41,_0x46326c){return _0x391b41(_0x46326c);},'tZAmg':'cloud','KYDil':function(_0x491ae2,_0x382363){return _0x491ae2(_0x382363);},'aFeeh':function(_0x21723b,_0x40669a){return _0x21723b(_0x40669a);}},_0x15cc60=await _0x44c4fa[_0x588728(0xaf)](resolveProfileTarget,_0x2f00ef);if(_0x15cc60[_0x588728(0xa2)]===_0x44c4fa['tZAmg']){const _0x281540=await _0x44c4fa['KYDil'](loadEffectiveCloudSettings,_0x2f00ef);if(!_0x281540||Object[_0x588728(0xbd)](_0x281540)['length']===0x0){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x2f00ef+'\x22');return;}console['log'](JSON['stringify'](_0x281540,null,0x2));return;}const _0x330684=_0x44c4fa['FSuNJ'](getSettingsPath,_0x2f00ef);if(!_0x44c4fa[_0x588728(0xaf)](existsSync,_0x330684)){console[_0x588728(0xb9)](_0x588728(0xc7)+_0x2f00ef+'\x22');return;}const _0x48c362=await loadSettings(_0x2f00ef),_0x34b210=_0x44c4fa['aFeeh'](formatSettings,_0x48c362);!_0x34b210?console[_0x588728(0xb9)](_0x588728(0xc7)+_0x2f00ef+'\x22'):console[_0x588728(0xb9)](_0x34b210);}export async function configUnset(_0x3c63c4,_0x5cbcf6){const _0x9ee4b=_0x31d297,_0x5d1523={'Hfpfp':function(_0x1df866,_0x3bad5f){return _0x1df866(_0x3bad5f);},'EUcOS':'cloud','kgvKe':function(_0xfe9199,_0x5ad5f5,_0x550e80,_0x3bfe31){return _0xfe9199(_0x5ad5f5,_0x550e80,_0x3bfe31);},'tSmYr':function(_0x3cded7){return _0x3cded7();}},_0x36f957=await _0x5d1523[_0x9ee4b(0xc9)](resolveProfileTarget,_0x3c63c4);if(_0x36f957['kind']===_0x5d1523[_0x9ee4b(0xb3)]){if(_0x36f957['alsoExistsElsewhere'])printDualExistsHint(_0x3c63c4);const _0x476187=_0x5d1523['kgvKe'](unsetProfileOverride,_0x5d1523['tSmYr'](getProjectPath),_0x3c63c4,_0x5cbcf6);_0x476187?console[_0x9ee4b(0xb9)]('Removed\x20'+_0x5cbcf6+_0x9ee4b(0xc6)+_0x3c63c4+'\x22'):console['log']('Key\x20\x22'+_0x5cbcf6+'\x22\x20not\x20found');return;}const _0x17d22c=await loadSettings(_0x3c63c4),_0x815f85=deleteNestedValue(_0x17d22c,_0x5cbcf6);_0x815f85?(await saveSettings(_0x3c63c4,_0x17d22c),console[_0x9ee4b(0xb9)](_0x9ee4b(0xad)+_0x5cbcf6)):console['log']('Key\x20\x22'+_0x5cbcf6+'\x22\x20not\x20found');}export async function configReset(_0x1e36b6){const _0x4c0e8f=_0x31d297,_0x4c3307={'KhvVJ':function(_0x131a22,_0x9f25a3){return _0x131a22(_0x9f25a3);},'LObfw':function(_0x57da6d){return _0x57da6d();}},_0x203914=await _0x4c3307['KhvVJ'](resolveProfileTarget,_0x1e36b6);if(_0x203914['kind']===_0x4c0e8f(0xce)){resetProfileOverrides(_0x4c3307[_0x4c0e8f(0xcd)](getProjectPath),_0x1e36b6),console['log'](_0x4c0e8f(0xcb)+_0x1e36b6+'\x22');return;}console[_0x4c0e8f(0xb9)]('\x22'+_0x1e36b6+'\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20'+_0x1e36b6+'\x20<key>\x22\x20to\x20remove\x20individual\x20values.');}
|
|
1
|
+
const _0x59fecd=_0x43c2;(function(_0x3268d6,_0x176c1a){const _0xcc867c=_0x43c2,_0x405b89=_0x3268d6();while(!![]){try{const _0x39b801=parseInt(_0xcc867c(0x17c))/0x1*(-parseInt(_0xcc867c(0x19d))/0x2)+parseInt(_0xcc867c(0x18d))/0x3*(parseInt(_0xcc867c(0x189))/0x4)+parseInt(_0xcc867c(0x18f))/0x5*(-parseInt(_0xcc867c(0x194))/0x6)+parseInt(_0xcc867c(0x17a))/0x7+parseInt(_0xcc867c(0x1a0))/0x8*(-parseInt(_0xcc867c(0x182))/0x9)+-parseInt(_0xcc867c(0x197))/0xa+-parseInt(_0xcc867c(0x192))/0xb*(-parseInt(_0xcc867c(0x17b))/0xc);if(_0x39b801===_0x176c1a)break;else _0x405b89['push'](_0x405b89['shift']());}catch(_0x52b56a){_0x405b89['push'](_0x405b89['shift']());}}}(_0x311b,0xb343a));function _0x43c2(_0x467eba,_0x493ec4){_0x467eba=_0x467eba-0x16b;const _0x311bfb=_0x311b();let _0x43c282=_0x311bfb[_0x467eba];return _0x43c282;}import{existsSync}from'fs';import{loadSettings,saveSettings,getNestedValue,setNestedValue,deleteNestedValue,formatSettings,getSettingsPath,getEnvDir}from'./utils/settings.js';import{fetchCloudProfile}from'./utils/cloudProfile.js';import{mergeCloudProfileSettings,readProfileOverrides,resetProfileOverrides,setProfileOverride,unsetProfileOverride}from'./utils/projectsConfig.js';const BOOLEAN_KEYS=[_0x59fecd(0x183),'allowInsecureLocalhost'];function parseLocalValue(_0x4a854a,_0x183b91){const _0x12d004=_0x59fecd,_0x3e3f92={'phjFm':'true'};if(BOOLEAN_KEYS[_0x12d004(0x186)](_0x4a854a)){if(_0x183b91===_0x3e3f92[_0x12d004(0x193)])return!![];if(_0x183b91==='false')return![];throw new Error(_0x12d004(0x172)+_0x4a854a+_0x12d004(0x170));}return _0x183b91;}function _0x311b(){const _0x591261=['log','parse','3504174MxBNnf','alsoExistsElsewhere','25OGzqBr','test','xUlgl','5500583mwdghC','phjFm','775218xuAzcT','object','CtbFp','6785210XOabnn','vmZZW','startsWith','QldwA','YoYqF','\x20for\x20\x22','102670sCAAdt','\x20<key>\x22\x20to\x20remove\x20individual\x20values.','\x20\x20Note:\x20\x22','8gecNXA','Removed\x20','YeMIR','GtnEx','syfVF','DTOLO','trim','GUULA','Cleared\x20local\x20overrides\x20for\x20\x22','local','cloud','Set\x20',':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22','xdZuC','Invalid\x20value\x20for\x20','true','null','keys','cvJBq','endsWith','Key\x20\x22','(not\x20set)','10268734hJMWwe','12Thmmvq','14TDZQXQ','kind','aqAva','NASsw','\x22\x20not\x20found','stringify','3218229VSwMRA','headless','LFich','undefined','includes','isNaN','\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.','4tDtpqk','\x20=\x20'];_0x311b=function(){return _0x591261;};return _0x311b();}function parseOverrideValue(_0x5e61f0){const _0x4ace18=_0x59fecd,_0x1460f3={'umuHs':function(_0x505922,_0x120726){return _0x505922===_0x120726;},'GUULA':_0x4ace18(0x185)};if(_0x5e61f0===_0x4ace18(0x173))return!![];if(_0x1460f3['umuHs'](_0x5e61f0,'false'))return![];if(_0x1460f3['umuHs'](_0x5e61f0,_0x4ace18(0x174)))return null;if(_0x5e61f0===_0x1460f3[_0x4ace18(0x16b)])return undefined;if(/^-?\d+$/['test'](_0x5e61f0)){const _0x423784=Number(_0x5e61f0);if(Number['isSafeInteger'](_0x423784))return _0x423784;}if(/^-?\d+\.\d+$/[_0x4ace18(0x190)](_0x5e61f0)){const _0x389d68=Number(_0x5e61f0);if(!Number[_0x4ace18(0x187)](_0x389d68))return _0x389d68;}const _0x40e622=_0x5e61f0[_0x4ace18(0x1a6)]();if(_0x40e622[_0x4ace18(0x199)]('{')&&_0x40e622[_0x4ace18(0x177)]('}')||_0x40e622[_0x4ace18(0x199)]('[')&&_0x40e622[_0x4ace18(0x177)](']'))try{return JSON[_0x4ace18(0x18c)](_0x40e622);}catch{}return _0x5e61f0;}async function resolveProfileTarget(_0x273a00){const _0x1a1434=_0x59fecd,_0x1cc261={'syfVF':function(_0x4569e4,_0x4bcaf4){return _0x4569e4(_0x4bcaf4);},'vObzw':function(_0x2e2ecd,_0x516448){return _0x2e2ecd(_0x516448);},'jZWVJ':function(_0x1a71a1,_0x167309){return _0x1a71a1(_0x167309);}},_0x93490d=_0x1cc261[_0x1a1434(0x1a4)](existsSync,getEnvDir(_0x273a00));let _0xf3fad7=![];try{const _0x529baf=await _0x1cc261['vObzw'](fetchCloudProfile,_0x273a00);_0xf3fad7=_0x1cc261['jZWVJ'](Boolean,_0x529baf);}catch{}if(_0xf3fad7)return{'kind':'cloud','alsoExistsElsewhere':_0x93490d};if(_0x93490d)return{'kind':_0x1a1434(0x16d),'alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x273a00+'\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'+_0x273a00);}function printDualExistsHint(_0x8043be){const _0x38bab3=_0x59fecd;console[_0x38bab3(0x18b)](_0x38bab3(0x19f)+_0x8043be+_0x38bab3(0x188));}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x5af29e){const _0x360a4d=_0x59fecd,_0x560efc={'iFRSF':function(_0x2fe962,_0x2521c4){return _0x2fe962(_0x2521c4);},'TKFnK':function(_0x107fc8,_0x2116e0,_0x242738){return _0x107fc8(_0x2116e0,_0x242738);},'QldwA':function(_0x4797d3,_0x352315){return _0x4797d3??_0x352315;}},_0x1260e2=await _0x560efc['iFRSF'](fetchCloudProfile,_0x5af29e),_0x76472b=readProfileOverrides(getProjectPath(),_0x5af29e);return _0x560efc['TKFnK'](mergeCloudProfileSettings,_0x1260e2?.['settings']??{},_0x560efc[_0x360a4d(0x19a)](_0x76472b,undefined));}export async function configSet(_0x110e99,_0x407fee,_0x5a136f){const _0x145e79=_0x59fecd,_0x1fb1a3={'vmZZW':function(_0xbd3c7d,_0x3222c5){return _0xbd3c7d(_0x3222c5);},'GtnEx':function(_0x4031de){return _0x4031de();},'Xxfie':function(_0x3bd81b,_0x25990d,_0x4f2873){return _0x3bd81b(_0x25990d,_0x4f2873);},'BCEUX':function(_0xf41f37,_0x29ba26,_0x3a35c0,_0x118ee0){return _0xf41f37(_0x29ba26,_0x3a35c0,_0x118ee0);},'xdZuC':function(_0x37b0c6,_0xe12ba2,_0x3c156d){return _0x37b0c6(_0xe12ba2,_0x3c156d);}},_0xfef237=await _0x1fb1a3['vmZZW'](resolveProfileTarget,_0x110e99);if(_0xfef237[_0x145e79(0x17d)]==='cloud'){if(_0xfef237[_0x145e79(0x18e)])printDualExistsHint(_0x110e99);const _0x242c5f=_0x1fb1a3['vmZZW'](parseOverrideValue,_0x5a136f);setProfileOverride(_0x1fb1a3[_0x145e79(0x1a3)](getProjectPath),_0x110e99,_0x407fee,_0x242c5f),console[_0x145e79(0x18b)](_0x145e79(0x16f)+_0x407fee+_0x145e79(0x18a)+JSON[_0x145e79(0x181)](_0x242c5f)+_0x145e79(0x19c)+_0x110e99+'\x22');return;}const _0x3d518f=await _0x1fb1a3[_0x145e79(0x198)](loadSettings,_0x110e99),_0x544a96=_0x1fb1a3['Xxfie'](parseLocalValue,_0x407fee,_0x5a136f);_0x1fb1a3['BCEUX'](setNestedValue,_0x3d518f,_0x407fee,_0x544a96),await _0x1fb1a3[_0x145e79(0x171)](saveSettings,_0x110e99,_0x3d518f),console[_0x145e79(0x18b)](_0x145e79(0x16f)+_0x407fee+'\x20=\x20'+_0x544a96+_0x145e79(0x19c)+_0x110e99+'\x22');}export async function configGet(_0x39b507,_0x2950ba){const _0x212103=_0x59fecd,_0x865ac0={'YeMIR':function(_0x4a40b6,_0x437abc){return _0x4a40b6(_0x437abc);},'bRNlu':'cloud','hmMvK':function(_0x1aeb93,_0x4c6213,_0x21ae71){return _0x1aeb93(_0x4c6213,_0x21ae71);},'xUlgl':function(_0x825c3b,_0x48626c){return _0x825c3b===_0x48626c;},'NIKnk':function(_0x488c7c,_0x41660f){return _0x488c7c(_0x41660f);},'LFich':function(_0x113b69,_0x38dacf){return _0x113b69===_0x38dacf;}},_0x27943f=await _0x865ac0[_0x212103(0x1a2)](resolveProfileTarget,_0x39b507);if(_0x27943f['kind']===_0x865ac0['bRNlu']){const _0x5dbdc5=await loadEffectiveCloudSettings(_0x39b507),_0x65caa3=_0x865ac0['hmMvK'](getNestedValue,_0x5dbdc5,_0x2950ba);if(_0x865ac0['xUlgl'](_0x65caa3,undefined))console[_0x212103(0x18b)]('(not\x20set)');else _0x865ac0[_0x212103(0x191)](typeof _0x65caa3,_0x212103(0x195))?console['log'](JSON[_0x212103(0x181)](_0x65caa3,null,0x2)):console[_0x212103(0x18b)](_0x65caa3);return;}const _0x49d37c=await _0x865ac0['NIKnk'](loadSettings,_0x39b507),_0x51af4c=getNestedValue(_0x49d37c,_0x2950ba);if(_0x51af4c===undefined)console[_0x212103(0x18b)](_0x212103(0x179));else _0x865ac0[_0x212103(0x184)](typeof _0x51af4c,'object')?console[_0x212103(0x18b)](JSON['stringify'](_0x51af4c,null,0x2)):console[_0x212103(0x18b)](_0x51af4c);}export async function configList(_0x141e26){const _0x3a88ea=_0x59fecd,_0x5b1f21={'CtbFp':function(_0x2b07a8,_0x2beda6){return _0x2b07a8===_0x2beda6;},'aqAva':'cloud','YoYqF':function(_0x2743c8,_0x4c42fd){return _0x2743c8(_0x4c42fd);}},_0x4afa20=await resolveProfileTarget(_0x141e26);if(_0x5b1f21[_0x3a88ea(0x196)](_0x4afa20['kind'],_0x5b1f21[_0x3a88ea(0x17e)])){const _0x36c057=await loadEffectiveCloudSettings(_0x141e26);if(!_0x36c057||_0x5b1f21[_0x3a88ea(0x196)](Object[_0x3a88ea(0x175)](_0x36c057)['length'],0x0)){console[_0x3a88ea(0x18b)]('No\x20configuration\x20set\x20for\x20\x22'+_0x141e26+'\x22');return;}console['log'](JSON[_0x3a88ea(0x181)](_0x36c057,null,0x2));return;}const _0x5a6070=getSettingsPath(_0x141e26);if(!existsSync(_0x5a6070)){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x141e26+'\x22');return;}const _0xdc1222=await _0x5b1f21[_0x3a88ea(0x19b)](loadSettings,_0x141e26),_0x25d906=formatSettings(_0xdc1222);!_0x25d906?console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x141e26+'\x22'):console[_0x3a88ea(0x18b)](_0x25d906);}export async function configUnset(_0x5de4e1,_0x13eb66){const _0x3f5875=_0x59fecd,_0x416ab0={'gOBrW':function(_0x58a4c4,_0x53faf9){return _0x58a4c4(_0x53faf9);},'cvJBq':function(_0x5c033d,_0x25469a){return _0x5c033d===_0x25469a;}},_0x51337d=await _0x416ab0['gOBrW'](resolveProfileTarget,_0x5de4e1);if(_0x416ab0[_0x3f5875(0x176)](_0x51337d[_0x3f5875(0x17d)],'cloud')){if(_0x51337d['alsoExistsElsewhere'])printDualExistsHint(_0x5de4e1);const _0x483336=unsetProfileOverride(getProjectPath(),_0x5de4e1,_0x13eb66);_0x483336?console[_0x3f5875(0x18b)]('Removed\x20'+_0x13eb66+_0x3f5875(0x19c)+_0x5de4e1+'\x22'):console[_0x3f5875(0x18b)](_0x3f5875(0x178)+_0x13eb66+_0x3f5875(0x180));return;}const _0x13654d=await loadSettings(_0x5de4e1),_0xbea227=deleteNestedValue(_0x13654d,_0x13eb66);_0xbea227?(await saveSettings(_0x5de4e1,_0x13654d),console['log'](_0x3f5875(0x1a1)+_0x13eb66)):console['log'](_0x3f5875(0x178)+_0x13eb66+_0x3f5875(0x180));}export async function configReset(_0x5c8921){const _0x26a0a6=_0x59fecd,_0x536804={'DTOLO':function(_0x3cbb9a,_0x4feca5){return _0x3cbb9a(_0x4feca5);},'RCRiT':function(_0x5a8d8b,_0x26aeaa){return _0x5a8d8b===_0x26aeaa;},'NASsw':function(_0x1f823b,_0x5e5350,_0x5da2bf){return _0x1f823b(_0x5e5350,_0x5da2bf);}},_0xfc2378=await _0x536804[_0x26a0a6(0x1a5)](resolveProfileTarget,_0x5c8921);if(_0x536804['RCRiT'](_0xfc2378[_0x26a0a6(0x17d)],_0x26a0a6(0x16e))){_0x536804[_0x26a0a6(0x17f)](resetProfileOverrides,getProjectPath(),_0x5c8921),console[_0x26a0a6(0x18b)](_0x26a0a6(0x16c)+_0x5c8921+'\x22');return;}console['log']('\x22'+_0x5c8921+'\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20'+_0x5c8921+_0x26a0a6(0x19e));}
|
package/build/commands/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const _0x347a3a=_0x23dc;(function(_0x1e3cf4,_0x5b3763){const _0x55148f=_0x23dc,_0x967605=_0x1e3cf4();while(!![]){try{const _0x3b7b6e=parseInt(_0x55148f(0x121))/0x1+-parseInt(_0x55148f(0x132))/0x2*(-parseInt(_0x55148f(0x12a))/0x3)+-parseInt(_0x55148f(0x122))/0x4*(-parseInt(_0x55148f(0x135))/0x5)+-parseInt(_0x55148f(0x144))/0x6+-parseInt(_0x55148f(0x13c))/0x7*(parseInt(_0x55148f(0x134))/0x8)+parseInt(_0x55148f(0x12d))/0x9*(-parseInt(_0x55148f(0x12f))/0xa)+parseInt(_0x55148f(0x142))/0xb;if(_0x3b7b6e===_0x5b3763)break;else _0x967605['push'](_0x967605['shift']());}catch(_0x3f62d0){_0x967605['push'](_0x967605['shift']());}}}(_0xf9e9,0xcfe44));import{readdir,stat}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{getRangerDir}from'./utils/rangerRoot.js';function _0x23dc(_0x47519b,_0x4118ff){_0x47519b=_0x47519b-0x11d;const _0xf9e9dd=_0xf9e9();let _0x23dc9c=_0xf9e9dd[_0x47519b];return _0x23dc9c;}import{loadSettings}from'./utils/settings.js';import{readActiveProfileName}from'./utils/activeProfile.js';import{listCloudProfiles}from'./utils/cloudProfile.js';const NON_ENV_DIRS=[_0x347a3a(0x137),_0x347a3a(0x13a),_0x347a3a(0x12b),'local','ci'];export async function getEnvNames(){const _0x35beba=_0x347a3a,_0x54c8ab={'kxjsf':function(_0x28d3cf){return _0x28d3cf();},'saAZX':'local','xdKVn':function(_0x2a4004,_0x382d4d){return _0x2a4004(_0x382d4d);},'qIdMq':function(_0x4d156b,_0x17ddc3,_0x77bd23){return _0x4d156b(_0x17ddc3,_0x77bd23);},'DVmwQ':_0x35beba(0x13e),'szqXV':'settings.json'},_0x503f9f=getRangerDir();if(!existsSync(_0x503f9f))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0xc881ae=await _0x54c8ab['kxjsf'](readActiveProfileName),_0xcf100=[],_0x4d49b8={},_0xfc78f8=join(_0x503f9f,_0x54c8ab['saAZX']);if(_0x54c8ab['xdKVn'](existsSync,_0xfc78f8)){const _0x4c5edc=await _0x54c8ab[_0x35beba(0x12c)](readdir,_0xfc78f8);for(const _0x3f43af of _0x4c5edc){const _0x4702e8=join(_0xfc78f8,_0x3f43af),_0x285349=await _0x54c8ab[_0x35beba(0x12c)](stat,_0x4702e8);_0x285349['isDirectory']()&&(_0xcf100[_0x35beba(0x13f)](_0x3f43af),_0x4d49b8[_0x3f43af]=_0x35beba(0x12e));}}const _0x10d22b=join(_0x503f9f,'ci');if(_0x54c8ab['xdKVn'](existsSync,_0x10d22b)){const _0x411991=await readdir(_0x10d22b);for(const _0x8af420 of _0x411991){const _0x2e95df=_0x54c8ab['qIdMq'](join,_0x10d22b,_0x8af420),_0x543a83=await _0x54c8ab['xdKVn'](stat,_0x2e95df);_0x543a83['isDirectory']()&&(_0xcf100[_0x35beba(0x13f)](_0x8af420),_0x4d49b8[_0x8af420]='ci');}}const _0x4b71d8=await readdir(_0x503f9f);for(const _0x1dc673 of _0x4b71d8){if(NON_ENV_DIRS[_0x35beba(0x126)](_0x1dc673))continue;if(_0x1dc673[_0x35beba(0x131)]('.'))continue;if(_0x1dc673['endsWith'](_0x54c8ab['DVmwQ']))continue;const _0x548cc2=join(_0x503f9f,_0x1dc673),_0x49c1b2=await _0x54c8ab['xdKVn'](stat,_0x548cc2);_0x49c1b2[_0x35beba(0x120)]()&&_0x54c8ab['xdKVn'](existsSync,join(_0x548cc2,_0x54c8ab['szqXV']))&&(!_0xcf100['includes'](_0x1dc673)&&(_0xcf100['push'](_0x1dc673),_0x4d49b8[_0x1dc673]=_0x35beba(0x136)));}return{'envNames':_0xcf100,'activeEnv':_0xc881ae,'envTypes':_0x4d49b8};}export async function envList(){const _0x340435=_0x347a3a,_0x52a6fa={'VATnf':function(_0x229ccc){return _0x229ccc();},'hUDsm':function(_0x154753,_0x501916){return _0x154753===_0x501916;},'dxKmP':'Run:\x20ranger\x20profile\x20add\x20<profile-name>','OMQXX':'local','PJXTF':function(_0x2faf9e,_0x29d763){return _0x2faf9e===_0x29d763;},'KpDlw':function(_0x4941b0,_0x4e9b02){return _0x4941b0===_0x4e9b02;},'VrBET':'no\x20session'},{envNames:_0x4de96e,activeEnv:_0x164300,envTypes:_0x20a42b}=await _0x52a6fa['VATnf'](getEnvNames);let _0x15958c=[];try{_0x15958c=await listCloudProfiles();}catch{}if(_0x52a6fa['hUDsm'](_0x4de96e[_0x340435(0x128)],0x0)&&_0x15958c['length']===0x0){console[_0x340435(0x143)](_0x340435(0x13b)),console['log'](_0x52a6fa[_0x340435(0x133)]);return;}const _0x1607dd=new Set(_0x15958c[_0x340435(0x123)](_0x30191b=>_0x30191b[_0x340435(0x140)]));if(_0x4de96e['length']>0x0){console['log']('\x0aLocal\x20Profiles:');for(const _0x1b17f3 of _0x4de96e[_0x340435(0x13d)]()){const _0x5102ba=_0x1b17f3===_0x164300&&!_0x1607dd['has'](_0x1b17f3),_0x370348=_0x20a42b[_0x1b17f3]||_0x52a6fa[_0x340435(0x11d)],_0x450ea1=await loadSettings(_0x1b17f3),_0xe03ce=_0x52a6fa[_0x340435(0x125)](_0x370348,'legacy')?'':'\x20['+_0x370348+']';console[_0x340435(0x143)]('\x20\x20'+(_0x5102ba?'*\x20':'\x20\x20')+_0x1b17f3+_0xe03ce),_0x450ea1['baseUrl']&&console['log']('\x20\x20\x20\x20\x20\x20URL:\x20'+_0x450ea1[_0x340435(0x141)]),_0x450ea1['environmentDetails']&&console[_0x340435(0x143)]('\x20\x20\x20\x20\x20\x20Details:\x20'+_0x450ea1['environmentDetails']);}}if(_0x15958c[_0x340435(0x128)]>0x0){console[_0x340435(0x143)]('\x0aCloud\x20Profiles:');for(const _0x88bc7f of _0x15958c['sort']((_0x335e8c,_0x259a4a)=>_0x335e8c['name'][_0x340435(0x138)](_0x259a4a['name']))){const _0x34a184=_0x52a6fa[_0x340435(0x129)](_0x88bc7f['name'],_0x164300),_0x4cc061=_0x88bc7f['environmentKey']?'\x20('+_0x88bc7f[_0x340435(0x124)]+')':'',_0x2659f6=_0x88bc7f['sessionUpdatedAt']?_0x340435(0x11f)+_0x88bc7f[_0x340435(0x130)]+')':_0x52a6fa['VrBET'];console[_0x340435(0x143)]('\x20\x20'+(_0x34a184?'*\x20':'\x20\x20')+_0x88bc7f['name']+_0x340435(0x11e)+_0x4cc061),console[_0x340435(0x143)](_0x340435(0x127)+_0x2659f6);}}_0x164300&&console[_0x340435(0x143)](_0x340435(0x139));}function _0xf9e9(){const _0x19fbd0=['push','name','baseUrl','30893269riFMDy','log','8755440mifFwZ','OMQXX','\x20[cloud]','cached\x20(updated\x20','isDirectory','149420tKjeXH','1048808GaaPsp','map','environmentKey','PJXTF','includes','\x20\x20\x20\x20\x20\x20Session:\x20','length','KpDlw','606273IAIsBO','reports','xdKVn','3339567NbXZrR','local','30NcbnVO','sessionUpdatedAt','startsWith','8stZLbq','dxKmP','302256dNxXMj','5tobYgY','legacy','sessions','localeCompare','\x0a*\x20=\x20active\x20profile','bug-bashes','\x0aNo\x20profiles\x20found.','112iidXtI','sort','.txt'];_0xf9e9=function(){return _0x19fbd0;};return _0xf9e9();}
|