@ranger-testing/ranger-cli 2.5.4-alpha.1f7a251-7 → 2.5.4-alpha.36a12ca-10
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/verify.md +6 -12
- package/package.json +1 -1
package/build/commands/addEnv.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x68c43d,_0x5d7564){const _0x23cc30=_0xd812,_0x5bfd10=_0x68c43d();while(!![]){try{const _0x17027d=parseInt(_0x23cc30(0x183))/0x1*(parseInt(_0x23cc30(0x121))/0x2)+-parseInt(_0x23cc30(0x141))/0x3+parseInt(_0x23cc30(0x13e))/0x4*(-parseInt(_0x23cc30(0x142))/0x5)+-parseInt(_0x23cc30(0x10c))/0x6+parseInt(_0x23cc30(0x124))/0x7*(-parseInt(_0x23cc30(0x16e))/0x8)+-parseInt(_0x23cc30(0x10a))/0x9+parseInt(_0x23cc30(0x146))/0xa*(parseInt(_0x23cc30(0x125))/0xb);if(_0x17027d===_0x5d7564)break;else _0x5bfd10['push'](_0x5bfd10['shift']());}catch(_0x5c25be){_0x5bfd10['push'](_0x5bfd10['shift']());}}}(_0x3802,0x5f3b1));import{mkdir,writeFile,readFile,readdir,unlink,rm,mkdtemp,rename}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import _0x2bd8f1 from'inquirer';import{chromium}from'playwright';import{findExistingEnv,loadSettings}from'./utils/settings.js';function _0x3802(){const _0x3fcd13=['gNCmy','lpINQ','isTTY','AWHtb','emmEW','RIsHK','\x0a\x20\x20A\x20cloud\x20profile\x20named\x20\x22','newContext','local','12jAuXAI','Warning:\x20Could\x20not\x20remove\x20old\x20profile\x20backup\x20at\x20','\x20\x20Ranger\x20will\x20open\x20it\x20in\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20and\x20save\x20your\x20session.\x0a','2274960dBRxuN','790145ALsayq','\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20(','.tmp-','error','199170ZeNhKS','Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','finally','about:blank','DiJtJ','\x20\x20Could\x20not\x20encrypt:\x20No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]','\x0a\x20\x20(domains:\x20','OWrGs','OYXzE','\x20\x20Make\x20sure\x20your\x20Electron\x20app\x20(or\x20browser)\x20is\x20running\x20with\x20remote\x20debugging\x20enabled.\x0a','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','off','stdout','includes','oAoim','ricCd','startsWith','HEAD','\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.','\x20\x20\x20If\x20you\x20are\x20an\x20agent,\x20background\x20this\x20process\x20and\x20let\x20your\x20user\x20know\x20they\x20need\x20to\x20complete\x20browser\x20authentication.\x0a','hLFkM','✓\x20Encrypted\x20auth\x20saved\x20to:\x20','aiZnp','ykJeg','abort','NVyUh','list','gVOrk','No\x20auth\x20env\x20matches\x20this\x20URL.\x20Creating\x20local\x20profile.','\x22\x20already\x20exists\x20in\x20','--disable-features=WebBluetooth','\x22\x20already\x20exists.\x20Overwrite?','test','env','WezHW','force','tYZxx','pxOCC','user','oeouE','40MmxxaX','\x0a📋\x20Authentication\x20Setup','CIGLM','trackPhaseStart','settings.json','YncDL','saveToCloud','\x20--safe-mode\x20\x20\x20\x20(disables\x20browser\x20features\x20that\x20can\x20cause\x20crashes)','\x27.\x0a','goto','kkggC','no_auth_config','url_setup','\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.','⚠\x20Could\x20not\x20reach\x20','rrtNq','trim','SIGINT','Enter\x20a\x20different\x20URL','NCETq','trackPhaseEnd','111MWrVMh','catch','Browser\x20closed\x20before\x20authentication\x20was\x20saved.','length','Warning:\x20Could\x20not\x20remove\x20old\x20profile\x20at\x20','\x20\x20ranger\x20profile\x20add\x20','\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20','safeMode','Aborted.','fXkIC','Removed\x20existing\x20profile\x20at\x20','message','keys','wUpWF','sjySY','allowInsecureLocalhost','nesJM','hHzGB','origin','manual','BLnhO','✓\x20Created\x20settings:\x20','WTRKg','\x27\x20created,\x20linked\x20to\x20env\x20\x27','\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20','6882615Fqtpvr','location','2183766GBhthZ','auth.json','now','no_match','scope','root\x20(.ranger/)','user_declined','\x0aThe\x20browser\x20closed\x20unexpectedly\x20before\x20authentication\x20could\x20be\x20saved.','Found\x20auth\x20environment\x20\x27','profile.add.autoRouteSkipped','What\x20would\x20you\x20like\x20to\x20do?','log','Invalid\x20URL','VCqJP','\x20(continuing\x20with\x20--force)','rjGQM','slice','setupHeader','--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','path','\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.','12908tPTJjP','skipAuth','environments','971397ddaToy','1507JJwhhY','cdpEndpoint','✓\x20Auth\x20state\x20saved\x20to:\x20','url','bHugs','qQDkw','.backup-','input','legacy','status','prompt','\x0a🌐\x20Profile\x20Setup\x0a','jCnpN','baseUrl','oMJKF','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.'];_0x3802=function(){return _0x3fcd13;};return _0x3802();}function _0xd812(_0x45d496,_0x36ace5){_0x45d496=_0x45d496-0x101;const _0x38024f=_0x3802();let _0xd812c2=_0x38024f[_0x45d496];return _0xd812c2;}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(_0xa03a32){const _0x404808=_0xd812,_0x33998e={'ricCd':function(_0x6bcdb7,_0x240c1a,_0x3ba80a){return _0x6bcdb7(_0x240c1a,_0x3ba80a);},'nesJM':_0x404808(0x157),'fXkIC':function(_0x5762cb,_0x10123d){return _0x5762cb(_0x10123d);},'NnFOJ':function(_0x23fc0a,_0x35eb9b){return _0x23fc0a<_0x35eb9b;},'pxOCC':'TypeError'};try{const _0x2a707a=new AbortController(),_0xdc869=_0x33998e['ricCd'](setTimeout,()=>_0x2a707a[_0x404808(0x15e)](),0x1388),_0x1180de={'method':_0x33998e[_0x404808(0x101)],'signal':_0x2a707a['signal'],'redirect':_0x404808(0x104)};/^https:\/\/localhost(:\d+)?/i[_0x404808(0x166)](_0xa03a32)&&(process['env']['NODE_TLS_REJECT_UNAUTHORIZED']='0');const _0x60e940=await _0x33998e[_0x404808(0x155)](fetch,_0xa03a32,_0x1180de);delete process['env']['NODE_TLS_REJECT_UNAUTHORIZED'],_0x33998e[_0x404808(0x18c)](clearTimeout,_0xdc869);if(_0x33998e['NnFOJ'](_0x60e940['status'],0x190))return{'ok':!![]};return{'ok':![],'error':'HTTP\x20'+_0x60e940[_0x404808(0x12e)]};}catch(_0x194a6f){delete process[_0x404808(0x167)]['NODE_TLS_REJECT_UNAUTHORIZED'];const _0x11fa10=_0x194a6f,_0xc3ad62=_0x11fa10['message']||String(_0x194a6f),_0x22d3b2=_0xc3ad62['includes'](_0x404808(0x118))||_0x11fa10['name']===_0x33998e[_0x404808(0x16b)]||_0xc3ad62[_0x404808(0x153)]('fetch\x20failed');return{'ok':![],'error':_0xc3ad62,'isProtocolError':_0x22d3b2};}}async function sweepOrphanLocalProfile(_0x46ea06,_0x213eb3,_0x43a9d3){const _0x6d6ef9=_0xd812,_0x26c6e5={'lqQRn':function(_0x2cb935,_0x5ebe1c){return _0x2cb935(_0x5ebe1c);},'rjGQM':function(_0x598aef,_0x41dcdb){return _0x598aef(_0x41dcdb);},'heOvN':function(_0x3a5528,_0x5e6192,_0xa9b92f){return _0x3a5528(_0x5e6192,_0xa9b92f);}},_0x174b27=join(_0x213eb3,_0x6d6ef9(0x13d)),_0x5830f4=join(_0x174b27,_0x46ea06);_0x26c6e5['lqQRn'](existsSync,_0x5830f4)&&(_0x43a9d3&&await _0x26c6e5[_0x6d6ef9(0x11b)](isPathGitTracked,_0x5830f4)?console[_0x6d6ef9(0x117)](_0x6d6ef9(0x189)+_0x5830f4+_0x6d6ef9(0x134)):(await _0x26c6e5['heOvN'](rm,_0x5830f4,{'recursive':!![],'force':!![]}),console[_0x6d6ef9(0x117)](_0x6d6ef9(0x150)+_0x5830f4)));if(existsSync(_0x174b27)){let _0xf978ea=[];try{_0xf978ea=await readdir(_0x174b27);}catch{return;}const _0x208dac=_0x6d6ef9(0x144)+_0x46ea06+'-';for(const _0x3ecd0e of _0xf978ea){if(!_0x3ecd0e[_0x6d6ef9(0x156)](_0x208dac))continue;const _0x37a211=join(_0x174b27,_0x3ecd0e);await rm(_0x37a211,{'recursive':!![],'force':!![]}),console[_0x6d6ef9(0x117)](_0x6d6ef9(0x150)+_0x37a211);}}}async function tryAutoRouteCloudProfile(_0xea2add,_0x578120,_0x3e39e1,_0x40b620,_0x37a987){const _0x73d847=_0xd812,_0x36622d={'hHzGB':'profile.add.autoRouteSkipped','kkggC':_0x73d847(0x179),'TAviI':function(_0x23b2ed,_0x17026d,_0x54a3d0){return _0x23b2ed(_0x17026d,_0x54a3d0);},'tYZxx':_0x73d847(0x162),'vIYCz':_0x73d847(0x10f),'RIsHK':'confirm','Qmyje':function(_0x44f4a4,_0x18f5d0){return _0x44f4a4+_0x18f5d0;},'CWGaO':function(_0x5eb67d){return _0x5eb67d();},'CIGLM':function(_0x2c3062){return _0x2c3062();},'YGhKk':function(_0x3ef419,_0x5bf80f){return _0x3ef419 instanceof _0x5bf80f;}};let _0x4bf3e4;try{_0x4bf3e4=await fetchAuthConfig();}catch{return _0x37a987?.[_0x73d847(0x182)](_0x36622d['hHzGB'],{'reason':'no_auth_config','profileName':_0xea2add}),![];}if(!_0x4bf3e4||!_0x4bf3e4[_0x73d847(0x123)]||Object['keys'](_0x4bf3e4['environments'])['length']===0x0)return _0x37a987?.['trackPhaseEnd'](_0x73d847(0x115),{'reason':_0x36622d['kkggC'],'profileName':_0xea2add}),![];const _0x2e2451=_0x36622d['TAviI'](matchAuthEnvironment,_0x578120,_0x4bf3e4);if(!_0x2e2451)return console['log'](_0x36622d[_0x73d847(0x16a)]),_0x37a987?.[_0x73d847(0x182)]('profile.add.autoRouteSkipped',{'reason':_0x36622d['vIYCz'],'profileName':_0xea2add}),![];const _0x444b40=_0x4bf3e4[_0x73d847(0x123)][_0x2e2451],_0xd5d478=_0x444b40?.['domains']??[];if(_0x40b620&&!_0x3e39e1['yes']){const {saveToCloud:_0x402c23}=await _0x2bd8f1[_0x73d847(0x12f)]([{'type':_0x36622d[_0x73d847(0x13a)],'name':_0x73d847(0x174),'message':_0x73d847(0x114)+_0x2e2451+'\x27\x20matching\x20'+_0x578120+_0x73d847(0x14c)+_0xd5d478['join'](',\x20')+')\x0a\x20\x20Save\x20\x27'+_0xea2add+'\x27\x20to\x20the\x20cloud?','default':!![]}]);if(!_0x402c23)return _0x37a987?.[_0x73d847(0x182)](_0x36622d[_0x73d847(0x102)],{'reason':_0x73d847(0x112),'profileName':_0xea2add}),![];}const _0x3ab3fe=_0xd5d478['some'](_0xb116a8=>{const _0x1bc534=_0x73d847;try{return new URL(_0xb116a8)['origin']===new URL(_0x578120)[_0x1bc534(0x103)];}catch{return![];}}),_0x2eb5a8={};!_0x3ab3fe&&(_0x2eb5a8['baseUrl']=_0x578120);try{await createCloudProfile(_0xea2add,_0x2e2451,{'settings':_0x2eb5a8});}catch(_0x58eb46){if(_0x58eb46 instanceof ApiError&&_0x58eb46['status']===0x199){console[_0x73d847(0x145)](_0x73d847(0x13b)+_0xea2add+'\x22\x20already\x20exists.\x20Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20profile\x20first.');throw _0x58eb46;}return console[_0x73d847(0x117)]('\x20\x20Could\x20not\x20reach\x20Ranger\x20API\x20to\x20create\x20a\x20cloud\x20profile\x20('+(_0x58eb46 instanceof Error?_0x58eb46[_0x73d847(0x18e)]:String(_0x58eb46))+').\x20Falling\x20back\x20to\x20local\x20profile.'),_0x37a987?.['trackPhaseEnd'](_0x36622d[_0x73d847(0x102)],{'reason':_0x36622d[_0x73d847(0x178)],'profileName':_0xea2add}),![];}console[_0x73d847(0x117)](_0x36622d['Qmyje']('✓\x20Cloud\x20profile\x20\x27'+_0xea2add+_0x73d847(0x108)+_0x2e2451+_0x73d847(0x176),'\x20\x20Next:\x20RANGER_TEST_USERNAME=...\x20RANGER_TEST_PASSWORD=...\x20ranger\x20go\x20--profile\x20'+_0xea2add));try{await sweepOrphanLocalProfile(_0xea2add,_0x36622d['CWGaO'](getRangerHomeDir),![]);const _0x224ad9=getRangerDir();_0x224ad9!==_0x36622d[_0x73d847(0x170)](getRangerHomeDir)&&await sweepOrphanLocalProfile(_0xea2add,_0x224ad9,!![]);}catch(_0x38c171){console['log'](_0x73d847(0x143)+(_0x36622d['YGhKk'](_0x38c171,Error)?_0x38c171[_0x73d847(0x18e)]:String(_0x38c171))+').');}return _0x37a987?.['trackPhaseEnd']('profile.add.autoRouted',{'envKey':_0x2e2451,'profileName':_0xea2add}),!![];}export async function addEnv(_0x196292,_0x3f3c96={},_0x170263){const _0x10a28d=_0xd812,_0x130057={'ChTVd':function(_0x2dd56e,_0x33ecaa,_0x3a0aa6){return _0x2dd56e(_0x33ecaa,_0x3a0aa6);},'lpINQ':'close','rrtNq':_0x10a28d(0x13d),'OWrGs':_0x10a28d(0x16c),'lLEUu':function(_0xae0d98){return _0xae0d98();},'bHugs':function(_0x30d59a){return _0x30d59a();},'ydiaM':function(_0xdc3b7,_0x156dfc,_0x5d870a,_0x1bae4b){return _0xdc3b7(_0x156dfc,_0x5d870a,_0x1bae4b);},'wUpWF':function(_0x1d33a3,_0x54a2c2){return _0x1d33a3===_0x54a2c2;},'iqgoH':'--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.','DiJtJ':'--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.','oMJKF':'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','XnKzj':'confirm','tEgdt':'overwrite','gNCmy':'shouldReplace','icYqf':_0x10a28d(0x18b),'hLFkM':_0x10a28d(0x130),'BLnhO':_0x10a28d(0x140),'NCETq':_0x10a28d(0x12c),'XZdIp':_0x10a28d(0x132),'AuBDQ':_0x10a28d(0x147),'mFYHY':'What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?','yrqQm':function(_0x8db6a3,_0x25ae35){return _0x8db6a3||_0x25ae35;},'qQDkw':function(_0x1b0ef9,_0x4176f2){return _0x1b0ef9(_0x4176f2);},'tIOoC':'action','jCnpN':_0x10a28d(0x116),'LnwEW':_0x10a28d(0x180),'sjySY':'use_suggestion','emmEW':function(_0x5ecceb,_0x2e03b7){return _0x5ecceb===_0x2e03b7;},'oAoim':function(_0x221202,_0x90d4d5,_0x5bb650){return _0x221202(_0x90d4d5,_0x5bb650);},'ZiNHi':function(_0x4b45b9,_0x34576f){return _0x4b45b9(_0x34576f);},'jfTPU':_0x10a28d(0x10d),'wmTWG':_0x10a28d(0x16f),'lqbQc':'\x20\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20to\x20the\x20profile\x20you\x20want\x20to\x20test\x20so\x20Ranger\x20can\x20access\x20it.','WezHW':_0x10a28d(0x164),'ZliGM':'--allow-insecure-localhost','YncDL':_0x10a28d(0x113),'APtKa':'You\x20can\x20try\x20again\x20with\x20one\x20of:','jxgms':_0x10a28d(0x185),'WTRKg':function(_0x35d059,_0x5e4321,_0x5619cf){return _0x35d059(_0x5e4321,_0x5619cf);},'ykJeg':'utf-8','oeouE':function(_0x5d6523,_0x325419){return _0x5d6523+_0x325419;},'VCqJP':'.enc','prirJ':'\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.','WtLKL':_0x10a28d(0x158),'MzpZd':'browser_auth','AWHtb':'config_write','bRZsb':function(_0x230e01,_0x3cd3ef){return _0x230e01>_0x3cd3ef;},'NVyUh':function(_0x109bc1,_0xd27671,_0x8ff8a4){return _0x109bc1(_0xd27671,_0x8ff8a4);},'gVOrk':function(_0x397b39,_0x3e779c,_0x5359f5){return _0x397b39(_0x3e779c,_0x5359f5);},'lJfQO':function(_0x5b6a4b,_0x25a926,_0x595fbe){return _0x5b6a4b(_0x25a926,_0x595fbe);},'OYXzE':_0x10a28d(0x17f)},_0x3abb49=_0x3f3c96['ci']??![],_0x592351=_0x3abb49?'ci':_0x130057[_0x10a28d(0x17d)],_0x1c84ac=_0x3f3c96[_0x10a28d(0x110)]===_0x130057[_0x10a28d(0x14d)]?_0x130057['lLEUu'](getRangerHomeDir):_0x130057[_0x10a28d(0x129)](getRangerDir),_0x1131df=_0x130057['ydiaM'](join,_0x1c84ac,_0x592351,_0x196292),_0xed1dea={};if(_0x3f3c96[_0x10a28d(0x11d)])for(const _0x26b245 of _0x3f3c96[_0x10a28d(0x11d)]){const _0x21aa26=_0x26b245['indexOf'](':');if(_0x130057[_0x10a28d(0x190)](_0x21aa26,-0x1))throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0x26b245+'\x22.\x20Expected\x20\x22Name:\x20Value\x22.');const _0x575780=_0x26b245[_0x10a28d(0x11c)](0x0,_0x21aa26)['trim'](),_0x1dfc48=_0x26b245['slice'](_0x21aa26+0x1)[_0x10a28d(0x17e)]();_0xed1dea[_0x575780]=_0x1dfc48;}const _0x3a1975=join(_0x1c84ac,_0x592351);if(_0x3f3c96[_0x10a28d(0x126)]!==undefined&&_0x130057['wUpWF'](_0x3f3c96['cdpEndpoint'][_0x10a28d(0x17e)](),''))throw new Error(_0x10a28d(0x11e));if(_0x3f3c96['cdpEndpoint']&&_0x3f3c96[_0x10a28d(0x128)])throw new Error(_0x130057['iqgoH']);if(_0x3f3c96['cdpEndpoint']&&_0x3f3c96['ci'])throw new Error(_0x130057[_0x10a28d(0x14a)]);const _0xd279cc=Boolean(_0x3f3c96['cdpEndpoint']),_0x4a936a=!_0x3f3c96[_0x10a28d(0x122)]&&!_0xd279cc,_0x37c4c2=process['stdin'][_0x10a28d(0x137)]&&process[_0x10a28d(0x152)]['isTTY'];if(!_0x37c4c2&&!_0x3f3c96['url']&&!_0xd279cc)throw new Error(_0x130057[_0x10a28d(0x133)]);if(!_0x3abb49&&!_0x3f3c96[_0x10a28d(0x122)]&&!_0xd279cc&&_0x3f3c96['url']){const _0x38e28a=await tryAutoRouteCloudProfile(_0x196292,_0x3f3c96['url'],_0x3f3c96,_0x37c4c2,_0x170263);if(_0x38e28a)return;}const _0xcf4e6e=findExistingEnv(_0x196292,{'rangerDir':_0x1c84ac});let _0x17f226=null;if(_0xcf4e6e){if(!_0x37c4c2)_0x17f226=_0xcf4e6e;else{if(_0xcf4e6e['location']===_0x592351){const {overwrite:_0x37faa7}=await _0x2bd8f1[_0x10a28d(0x12f)]([{'type':_0x130057['XnKzj'],'name':_0x130057['tEgdt'],'message':'Profile\x20\x22'+_0x196292+_0x10a28d(0x165),'default':![]}]);if(!_0x37faa7){console['log'](_0x10a28d(0x18b));return;}_0x17f226=_0xcf4e6e;}else{const _0x5335f3=_0xcf4e6e[_0x10a28d(0x10b)]===_0x10a28d(0x12d)?_0x10a28d(0x111):_0xcf4e6e['location'];console[_0x10a28d(0x145)]('\x0a⚠️\x20\x20Profile\x20\x22'+_0x196292+_0x10a28d(0x163)+_0x5335f3+':\x20'+_0xcf4e6e[_0x10a28d(0x11f)]),console[_0x10a28d(0x145)]('\x20\x20\x20Creating\x20it\x20in\x20'+_0x592351+'\x20would\x20shadow\x20the\x20existing\x20profile.');const {shouldReplace:_0x259e83}=await _0x2bd8f1['prompt']([{'type':'confirm','name':_0x130057[_0x10a28d(0x135)],'message':'Delete\x20existing\x20and\x20create\x20new\x20in\x20'+_0x592351+'?','default':![]}]);if(!_0x259e83){console[_0x10a28d(0x117)](_0x130057['icYqf']);return;}_0x17f226=_0xcf4e6e;}}}_0x170263?.[_0x10a28d(0x171)](_0x10a28d(0x17a));let _0xfed378='';if(_0xd279cc)console[_0x10a28d(0x117)]('\x0a🔌\x20CDP\x20Profile\x20Setup\x0a'),console['log'](_0x10a28d(0x109)+_0x3f3c96['cdpEndpoint']),console['log'](_0x10a28d(0x14f));else{if(_0x3f3c96['url']){_0xfed378=_0x3f3c96[_0x10a28d(0x128)];const _0x4c8d8f=await checkUrlReachability(_0xfed378);if(!_0x4c8d8f['ok']&&!_0x3f3c96['force'])throw new Error('Could\x20not\x20reach\x20'+_0xfed378+':\x20'+_0x4c8d8f['error']+_0x10a28d(0x17b));!_0x4c8d8f['ok']&&_0x3f3c96[_0x10a28d(0x169)]&&console[_0x10a28d(0x117)](_0x10a28d(0x17c)+_0xfed378+':\x20'+_0x4c8d8f[_0x10a28d(0x145)]+_0x10a28d(0x11a));}else{console['log'](_0x130057[_0x10a28d(0x15a)]),console['log'](_0x10a28d(0x120)),console['log'](_0x130057[_0x10a28d(0x105)]);let _0x20cfbb=![];while(!![]){const _0x5ca959=await _0x2bd8f1['prompt']([{'type':_0x130057[_0x10a28d(0x181)],'name':_0x130057['XZdIp'],'message':_0x20cfbb?_0x130057['AuBDQ']:_0x130057['mFYHY'],'default':_0x130057['yrqQm'](_0xfed378,'http://localhost:3000')}]);_0xfed378=_0x5ca959['baseUrl'];const _0x4f5b2=await _0x130057['qQDkw'](checkUrlReachability,_0xfed378);if(_0x4f5b2['ok'])break;const _0x3be946=/^[a-zA-Z][\w+.-]*:\/\//[_0x10a28d(0x166)](_0xfed378),_0x594b2a=_0x4f5b2['isProtocolError']&&!_0x3be946,_0x3827f3=_0x594b2a?'http://'+_0xfed378:null;_0x20cfbb=!![],console[_0x10a28d(0x117)]('\x0a\x20\x20Could\x20not\x20reach\x20'+_0xfed378+':\x20'+_0x4f5b2[_0x10a28d(0x145)]);_0x3827f3&&console[_0x10a28d(0x117)]('\x20\x20Did\x20you\x20mean\x20'+_0x3827f3+'?');const {action:_0x1ec0c0}=await _0x2bd8f1[_0x10a28d(0x12f)]([{'type':_0x10a28d(0x160),'name':_0x130057['tIOoC'],'message':_0x130057[_0x10a28d(0x131)],'choices':[..._0x3827f3?[{'name':'Use\x20'+_0x3827f3,'value':'use_suggestion'}]:[],{'name':_0x130057['LnwEW'],'value':'retry'},{'name':'Continue\x20anyway','value':'continue'}]}]);if(_0x1ec0c0===_0x130057[_0x10a28d(0x191)]&&_0x3827f3){_0xfed378=_0x3827f3;const _0x21cf07=await checkUrlReachability(_0xfed378);if(_0x21cf07['ok'])break;console[_0x10a28d(0x117)]('\x0a\x20\x20Still\x20could\x20not\x20reach\x20'+_0xfed378+':\x20'+_0x21cf07[_0x10a28d(0x145)]);}else{if(_0x130057[_0x10a28d(0x139)](_0x1ec0c0,'continue'))break;}}}}_0x170263?.['trackPhaseEnd']('url_setup');const _0xa43ecc={};if(_0x17f226){const _0x52f17d=await _0x130057[_0x10a28d(0x12a)](loadSettings,_0x196292);Object['assign'](_0xa43ecc,_0x52f17d['setupHeaders']);}Object['assign'](_0xa43ecc,_0xed1dea),await mkdir(_0x3a1975,{'recursive':!![]});try{const _0x2d2dae=await _0x130057[_0x10a28d(0x12a)](readdir,_0x3a1975),_0x2920d6=_0x10a28d(0x144)+_0x196292+'-';for(const _0x3e7aea of _0x2d2dae){_0x3e7aea['startsWith'](_0x2920d6)&&await _0x130057[_0x10a28d(0x154)](rm,join(_0x3a1975,_0x3e7aea),{'recursive':!![],'force':!![]});}}catch{}const _0x4e7d7b=await _0x130057['ZiNHi'](mkdtemp,_0x130057[_0x10a28d(0x154)](join,_0x3a1975,_0x10a28d(0x144)+_0x196292+'-')),_0x169776=join(_0x4e7d7b,_0x130057['jfTPU']),_0x1f2dae=()=>{const _0x4d1671=_0x10a28d;_0x130057['ChTVd'](rm,_0x4e7d7b,{'recursive':!![],'force':!![]})[_0x4d1671(0x184)](()=>{})[_0x4d1671(0x148)](()=>{process['exit'](0x82);});};process['once'](_0x10a28d(0x17f),_0x1f2dae);const _0x2a4b5e=Boolean(_0xfed378)&&/^https:\/\/localhost(:\d+)?/i['test'](_0xfed378);try{if(_0x4a936a){_0x170263?.[_0x10a28d(0x171)]('browser_auth'),console['log'](_0x130057['wmTWG']),console[_0x10a28d(0x117)](_0x130057['lqbQc']),console['log']('\x20\x20\x20When\x20done\x20logging\x20in,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.');!_0x37c4c2?(console[_0x10a28d(0x117)]('\x0a\x20\x20\x20⚠\x20This\x20step\x20requires\x20human\x20interaction\x20in\x20a\x20browser.'),console['log'](_0x10a28d(0x159))):console['log']('');await new Promise(_0x6ed935=>setTimeout(_0x6ed935,0xbb8));const _0x59ecb8=[];_0x3f3c96['safeMode']&&_0x59ecb8['push'](_0x130057[_0x10a28d(0x168)]);const _0x39c39d=_0x3f3c96[_0x10a28d(0x192)]||_0x2a4b5e;_0x39c39d&&_0x59ecb8['push'](_0x130057['ZliGM']);const _0x7fd4a5=await chromium['launch']({'headless':![],..._0x59ecb8['length']>0x0?{'args':_0x59ecb8}:{}});try{const _0x1b73d0=Object[_0x10a28d(0x18f)](_0xa43ecc)[_0x10a28d(0x186)]>0x0,_0x3bea33={'ignoreHTTPSErrors':!![]};_0x1b73d0&&(_0x3bea33['extraHTTPHeaders']=_0xa43ecc);const _0xf93032=await _0x7fd4a5[_0x10a28d(0x13c)](_0x3bea33);await addProfileSetupBanner(_0xf93032);const _0x476a6a=await _0xf93032['newPage']();await _0x476a6a[_0x10a28d(0x177)](_0xfed378||_0x10a28d(0x149));let _0x3bb05e=![];await new Promise(_0x39a23b=>{const _0x1ba79c=_0x10a28d,_0x3d1f1a={'aiZnp':'Saving\x20authentication\x20state...'};_0x476a6a['on'](_0x130057[_0x1ba79c(0x136)],async()=>{const _0x22e302=_0x1ba79c;try{console[_0x22e302(0x117)](_0x3d1f1a[_0x22e302(0x15c)]),await _0xf93032['storageState']({'path':_0x169776}),_0x3bb05e=!![];}catch{}_0x39a23b();});});if(!_0x3bb05e){console[_0x10a28d(0x117)](_0x130057[_0x10a28d(0x173)]);!_0x3f3c96[_0x10a28d(0x18a)]&&(console[_0x10a28d(0x117)]('This\x20can\x20happen\x20due\x20to\x20a\x20browser\x20compatibility\x20issue\x20on\x20some\x20systems.\x0a'),console[_0x10a28d(0x117)](_0x130057['APtKa']),console[_0x10a28d(0x117)](_0x10a28d(0x188)+_0x196292+_0x10a28d(0x175)),console['log'](_0x10a28d(0x188)+_0x196292+'\x20--skip-auth\x20\x20\x20\x20(skip\x20browser\x20auth\x20entirely)\x0a'));throw new Error(_0x130057['jxgms']);}}finally{await _0x7fd4a5['close']()['catch'](()=>{});}if(_0x3abb49){const _0x250bd8=await _0x130057[_0x10a28d(0x107)](readFile,_0x169776,_0x130057[_0x10a28d(0x15d)]),_0x3ce693=await _0x130057['lLEUu'](getToken);if(!_0x3ce693){console[_0x10a28d(0x145)](_0x10a28d(0x14b)),await _0x130057[_0x10a28d(0x12a)](unlink,_0x169776)['catch'](()=>{});throw new Error('Missing\x20API\x20token;\x20aborting\x20CI\x20profile\x20creation.');}else{const _0x21bcc3=_0x130057[_0x10a28d(0x154)](encrypt,_0x250bd8,_0x3ce693);await _0x130057[_0x10a28d(0x107)](writeFile,_0x130057[_0x10a28d(0x16d)](_0x169776,_0x130057[_0x10a28d(0x119)]),_0x21bcc3),await unlink(_0x169776),console[_0x10a28d(0x117)](_0x10a28d(0x15b)+_0x169776+'.enc'),console[_0x10a28d(0x117)](_0x130057['prirJ']),console[_0x10a28d(0x117)](_0x130057['WtLKL']);}}else console[_0x10a28d(0x117)](_0x10a28d(0x127)+_0x169776);_0x170263?.['trackPhaseEnd'](_0x130057['MzpZd']);}_0x170263?.[_0x10a28d(0x171)](_0x130057[_0x10a28d(0x138)]);const _0x4efe52={};_0xfed378&&(_0x4efe52['baseUrl']=_0xfed378);_0x3f3c96[_0x10a28d(0x126)]&&(_0x4efe52['cdpEndpoint']=_0x3f3c96[_0x10a28d(0x126)],_0x4efe52['isElectron']=!![]);(_0x3f3c96['allowInsecureLocalhost']||_0x2a4b5e)&&(_0x4efe52[_0x10a28d(0x192)]=!![]);_0x3f3c96[_0x10a28d(0x18a)]&&(_0x4efe52[_0x10a28d(0x18a)]=!![]);_0x130057['bRZsb'](Object['keys'](_0xa43ecc)['length'],0x0)&&(_0x4efe52['setupHeaders']=_0xa43ecc);await writeFile(_0x130057['ChTVd'](join,_0x4e7d7b,_0x10a28d(0x172)),JSON['stringify'](_0x4efe52,null,0x2)),console['log'](_0x10a28d(0x106)+_0x130057['NVyUh'](join,_0x1131df,_0x10a28d(0x172)));if(_0x17f226?.[_0x10a28d(0x10b)]===_0x592351){const _0x11da8e=_0x17f226['path']+_0x10a28d(0x12b)+Date[_0x10a28d(0x10e)]();await rename(_0x17f226[_0x10a28d(0x11f)],_0x11da8e);try{await rename(_0x4e7d7b,_0x1131df);}catch(_0x3abdbd){await rename(_0x11da8e,_0x17f226['path']);throw _0x3abdbd;}try{await _0x130057[_0x10a28d(0x15f)](rm,_0x11da8e,{'recursive':!![]});}catch{console[_0x10a28d(0x117)](_0x10a28d(0x13f)+_0x11da8e);}}else{await rename(_0x4e7d7b,_0x1131df);if(_0x17f226)try{await _0x130057[_0x10a28d(0x161)](rm,_0x17f226[_0x10a28d(0x11f)],{'recursive':!![]}),console['log'](_0x10a28d(0x18d)+_0x17f226['path']);}catch{console['log'](_0x10a28d(0x187)+_0x17f226[_0x10a28d(0x11f)]);}}try{await writeActiveProfileName(_0x196292),console['log']('\x20\x20Set\x20active\x20profile:\x20'+_0x196292);}catch{console[_0x10a28d(0x117)]('Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.');}_0x170263?.['trackPhaseEnd'](_0x130057['AWHtb']),console[_0x10a28d(0x117)]('\x0a\x20\x20Profile\x20\x22'+_0x196292+'\x22\x20configured');}catch(_0x223ff1){await _0x130057['lJfQO'](rm,_0x4e7d7b,{'recursive':!![],'force':!![]});throw _0x223ff1;}finally{process[_0x10a28d(0x151)](_0x130057[_0x10a28d(0x14e)],_0x1f2dae);}}
|
|
1
|
+
(function(_0x5935af,_0x3fec67){const _0x3218d1=_0x5dea,_0x442f8b=_0x5935af();while(!![]){try{const _0x5ac69c=parseInt(_0x3218d1(0xc4))/0x1+parseInt(_0x3218d1(0xe4))/0x2+parseInt(_0x3218d1(0x118))/0x3+parseInt(_0x3218d1(0x108))/0x4*(parseInt(_0x3218d1(0xc3))/0x5)+-parseInt(_0x3218d1(0xb5))/0x6+parseInt(_0x3218d1(0xfe))/0x7*(-parseInt(_0x3218d1(0xcf))/0x8)+-parseInt(_0x3218d1(0x12f))/0x9*(parseInt(_0x3218d1(0xdc))/0xa);if(_0x5ac69c===_0x3fec67)break;else _0x442f8b['push'](_0x442f8b['shift']());}catch(_0x5cad51){_0x442f8b['push'](_0x442f8b['shift']());}}}(_0x9c8c,0x94012));import{mkdir,writeFile,readFile,readdir,unlink,rm,mkdtemp,rename}from'fs/promises';function _0x9c8c(){const _0x45946c=['\x20\x20\x20Creating\x20it\x20in\x20','\x0a\x20\x20(domains:\x20','Removed\x20existing\x20profile\x20at\x20','144lnbaZE','\x20\x20\x20If\x20you\x20are\x20an\x20agent,\x20background\x20this\x20process\x20and\x20let\x20your\x20user\x20know\x20they\x20need\x20to\x20complete\x20browser\x20authentication.\x0a','signal','\x20--safe-mode\x20\x20\x20\x20(disables\x20browser\x20features\x20that\x20can\x20cause\x20crashes)','eaFIP','user_declined','includes','prompt','legacy','jixCU','Missing\x20API\x20token;\x20aborting\x20CI\x20profile\x20creation.','⚠\x20Could\x20not\x20reach\x20','JIAJU','62490fwjaOc','Zrjbd','Warning:\x20Could\x20not\x20remove\x20old\x20profile\x20at\x20','pWZMD','ldZnb','origin','storageState','use_suggestion','68904yAXuxQ','HTTP\x20','EYvjA','length','\x22\x20configured','log','overwrite','✓\x20Encrypted\x20auth\x20saved\x20to:\x20','WHMRd','--cdp-endpoint\x20must\x20not\x20be\x20empty.\x20Provide\x20the\x20CDP\x20URL,\x20e.g.\x20--cdp-endpoint\x20http://localhost:9222','ypElB','trackPhaseStart','NOWYx','--disable-features=WebBluetooth','rWJJU','goto','env','no_auth_config','now','user','location','saveToCloud','\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20','close','push','\x27\x20created,\x20linked\x20to\x20env\x20\x27','179228TkxKPM','iKHzT','exit','test','--allow-insecure-localhost','keys','trackPhaseEnd','\x0a🔌\x20CDP\x20Profile\x20Setup\x0a','isTTY','trim','49252oaNljV','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','✓\x20Created\x20settings:\x20','.backup-','force','fetch\x20failed','finally','.tmp-','Saving\x20authentication\x20state...','aUFEe','indexOf','isProtocolError','Use\x20','RhQcv','Warning:\x20Profile\x20created,\x20but\x20failed\x20to\x20mark\x20it\x20as\x20active.','confirm','742722WbIfDS','catch','\x20—\x20not\x20removing.\x20Delete\x20manually\x20if\x20you\x20want\x20it\x20gone.','error','ayuxn','tjXwJ','jpQqO','\x0a\x20\x20\x20⚠\x20This\x20step\x20requires\x20human\x20interaction\x20in\x20a\x20browser.','WMEDQ','Warning:\x20Could\x20not\x20remove\x20old\x20profile\x20backup\x20at\x20','path','\x0a🌐\x20Profile\x20Setup\x0a','VOTWi','Profile\x20\x22','\x0a\x20\x20Could\x20not\x20reach\x20','\x0a⚠️\x20\x20Profile\x20\x22','NODE_TLS_REJECT_UNAUTHORIZED','url_setup','Could\x20not\x20reach\x20','✓\x20Auth\x20state\x20saved\x20to:\x20','\x20\x20Set\x20active\x20profile:\x20','profile.add.autoRouted','uvwpc','612VmyvqH','\x20\x20ranger\x20profile\x20add\x20','This\x20can\x20happen\x20due\x20to\x20a\x20browser\x20compatibility\x20issue\x20on\x20some\x20systems.\x0a','utf-8','vygZU','EEwKo','CTMbI','message','NcVIE','local','profile.add.autoRouteSkipped','environments','settings.json','input','status','some','Aborted.','rIIER','JSZVC','Enter\x20a\x20new\x20URL\x20(or\x20press\x20enter\x20to\x20keep\x20current):','ZgmMD','allowInsecureLocalhost','startsWith','fCZrV','about:blank','1810056KQjjsy','url','name','safeMode','http://localhost:3000','BVPxW','MIagZ','cdpEndpoint','cIdzg','uPJDX','XXLoL',').\x20Falling\x20back\x20to\x20local\x20profile.','\x20would\x20shadow\x20the\x20existing\x20profile.','\x20\x20\x20A\x20browser\x20will\x20open.\x20Please\x20log\x20in\x20to\x20the\x20profile\x20you\x20want\x20to\x20test\x20so\x20Ranger\x20can\x20access\x20it.','265KLdgAJ','859091lQFkPT','--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.','domains','\x22\x20already\x20exists.\x20Choose\x20a\x20different\x20name\x20or\x20delete\x20the\x20existing\x20profile\x20first.','baseUrl','What\x20is\x20the\x20URL\x20of\x20your\x20running\x20app?',')\x0a\x20\x20Save\x20\x27','\x22.\x20Expected\x20\x22Name:\x20Value\x22.'];_0x9c8c=function(){return _0x45946c;};return _0x9c8c();}import{join}from'path';import{existsSync}from'fs';import _0x4d5eff 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';function _0x5dea(_0xfc178c,_0x1372e7){_0xfc178c=_0xfc178c-0x9f;const _0x9c8c21=_0x9c8c();let _0x5dea10=_0x9c8c21[_0xfc178c];return _0x5dea10;}async function checkUrlReachability(_0x4a2325){const _0x1a64f5=_0x5dea,_0x3392c0={'JSZVC':function(_0x221dce,_0x378558,_0x5a545a){return _0x221dce(_0x378558,_0x5a545a);},'NOWYx':'HEAD','pWZMD':function(_0x4de510,_0xa0e09f){return _0x4de510<_0xa0e09f;},'RhQcv':function(_0x38b3cb,_0x21574a){return _0x38b3cb(_0x21574a);},'ODUtq':function(_0x4964d2,_0xa75c5c){return _0x4964d2===_0xa75c5c;}};try{const _0x5a51d4=new AbortController(),_0x3e5476=_0x3392c0[_0x1a64f5(0xae)](setTimeout,()=>_0x5a51d4['abort'](),0x1388),_0x1afb13={'method':_0x3392c0[_0x1a64f5(0xf0)],'signal':_0x5a51d4[_0x1a64f5(0xd1)],'redirect':'manual'};/^https:\/\/localhost(:\d+)?/i['test'](_0x4a2325)&&(process['env'][_0x1a64f5(0x128)]='0');const _0x5ac5fc=await fetch(_0x4a2325,_0x1afb13);delete process[_0x1a64f5(0xf4)][_0x1a64f5(0x128)],clearTimeout(_0x3e5476);if(_0x3392c0[_0x1a64f5(0xdf)](_0x5ac5fc[_0x1a64f5(0xaa)],0x190))return{'ok':!![]};return{'ok':![],'error':_0x1a64f5(0xe5)+_0x5ac5fc['status']};}catch(_0x54056c){delete process['env'][_0x1a64f5(0x128)];const _0x3d71e8=_0x54056c,_0x3162ca=_0x3d71e8['message']||_0x3392c0[_0x1a64f5(0x115)](String,_0x54056c),_0xdf02c1=_0x3162ca[_0x1a64f5(0xd5)]('Invalid\x20URL')||_0x3392c0['ODUtq'](_0x3d71e8[_0x1a64f5(0xb7)],'TypeError')||_0x3162ca[_0x1a64f5(0xd5)](_0x1a64f5(0x10d));return{'ok':![],'error':_0x3162ca,'isProtocolError':_0xdf02c1};}}async function sweepOrphanLocalProfile(_0x24a17b,_0x2295fb,_0x415213){const _0x16360d=_0x5dea,_0x326391={'Aomvu':'local','jpQqO':function(_0x398dcc,_0x2e8782,_0x762469){return _0x398dcc(_0x2e8782,_0x762469);},'VOTWi':function(_0x30b697,_0x26d209){return _0x30b697(_0x26d209);},'NZTLm':function(_0xe5e88a,_0x347f4f){return _0xe5e88a(_0x347f4f);}},_0x43e1ce=join(_0x2295fb,_0x326391['Aomvu']),_0x171f37=join(_0x43e1ce,_0x24a17b);existsSync(_0x171f37)&&(_0x415213&&await isPathGitTracked(_0x171f37)?console[_0x16360d(0xe9)]('\x20\x20Note:\x20found\x20git-tracked\x20local\x20profile\x20at\x20'+_0x171f37+_0x16360d(0x11a)):(await _0x326391[_0x16360d(0x11e)](rm,_0x171f37,{'recursive':!![],'force':!![]}),console[_0x16360d(0xe9)]('\x20\x20Cleaned\x20up\x20orphan\x20local\x20profile\x20at\x20'+_0x171f37)));if(_0x326391[_0x16360d(0x124)](existsSync,_0x43e1ce)){let _0x46809e=[];try{_0x46809e=await _0x326391['NZTLm'](readdir,_0x43e1ce);}catch{return;}const _0x5de641=_0x16360d(0x10f)+_0x24a17b+'-';for(const _0x20a7c8 of _0x46809e){if(!_0x20a7c8[_0x16360d(0xb2)](_0x5de641))continue;const _0x280d1d=join(_0x43e1ce,_0x20a7c8);await rm(_0x280d1d,{'recursive':!![],'force':!![]}),console['log'](_0x16360d(0xfa)+_0x280d1d);}}}async function tryAutoRouteCloudProfile(_0x671990,_0x464cb2,_0x1c0303,_0x19a2d7,_0xb7935){const _0x1d89c6=_0x5dea,_0x2aa99d={'bkSUC':function(_0x171e59,_0x430b41){return _0x171e59===_0x430b41;},'slXPv':function(_0x2368ed){return _0x2368ed();},'uPJDX':_0x1d89c6(0xa6),'TSVAN':function(_0x1c1dd7,_0x820af3,_0x35ab99){return _0x1c1dd7(_0x820af3,_0x35ab99);},'Umams':function(_0x172aef,_0x252750,_0x3b7b79,_0x365eb5){return _0x172aef(_0x252750,_0x3b7b79,_0x365eb5);},'MIagZ':function(_0x3bcc67,_0x55ef52){return _0x3bcc67 instanceof _0x55ef52;},'Zrjbd':function(_0x162d5f,_0xa8cb80){return _0x162d5f+_0xa8cb80;},'eaFIP':function(_0x237a9b){return _0x237a9b();},'xPGif':function(_0x452366,_0x1c5e1f){return _0x452366(_0x1c5e1f);},'JJWci':_0x1d89c6(0x12d)};let _0x5ae836;try{_0x5ae836=await _0x2aa99d['slXPv'](fetchAuthConfig);}catch{return _0xb7935?.[_0x1d89c6(0x104)](_0x1d89c6(0xa6),{'reason':_0x1d89c6(0xf5),'profileName':_0x671990}),![];}if(!_0x5ae836||!_0x5ae836['environments']||Object[_0x1d89c6(0x103)](_0x5ae836['environments'])[_0x1d89c6(0xe7)]===0x0)return _0xb7935?.['trackPhaseEnd'](_0x2aa99d['uPJDX'],{'reason':'no_auth_config','profileName':_0x671990}),![];const _0x1ba7b7=_0x2aa99d['TSVAN'](matchAuthEnvironment,_0x464cb2,_0x5ae836);if(!_0x1ba7b7)return console['log']('No\x20auth\x20env\x20matches\x20this\x20URL.\x20Creating\x20local\x20profile.'),_0xb7935?.[_0x1d89c6(0x104)](_0x2aa99d[_0x1d89c6(0xbe)],{'reason':'no_match','profileName':_0x671990}),![];const _0x48e503=_0x5ae836[_0x1d89c6(0xa7)][_0x1ba7b7],_0x5a842e=_0x48e503?.[_0x1d89c6(0xc6)]??[];if(_0x19a2d7&&!_0x1c0303['yes']){const {saveToCloud:_0xb7769c}=await _0x4d5eff[_0x1d89c6(0xd6)]([{'type':_0x1d89c6(0x117),'name':_0x1d89c6(0xf9),'message':'Found\x20auth\x20environment\x20\x27'+_0x1ba7b7+'\x27\x20matching\x20'+_0x464cb2+_0x1d89c6(0xcd)+_0x5a842e['join'](',\x20')+_0x1d89c6(0xca)+_0x671990+'\x27\x20to\x20the\x20cloud?','default':!![]}]);if(!_0xb7769c)return _0xb7935?.[_0x1d89c6(0x104)](_0x1d89c6(0xa6),{'reason':_0x1d89c6(0xd4),'profileName':_0x671990}),![];}const _0x55a14a=_0x5a842e[_0x1d89c6(0xab)](_0x3f4324=>{const _0x53dc59=_0x1d89c6;try{return _0x2aa99d['bkSUC'](new URL(_0x3f4324)[_0x53dc59(0xe1)],new URL(_0x464cb2)['origin']);}catch{return![];}}),_0x7e908d={};!_0x55a14a&&(_0x7e908d[_0x1d89c6(0xc8)]=_0x464cb2);try{await _0x2aa99d['Umams'](createCloudProfile,_0x671990,_0x1ba7b7,{'settings':_0x7e908d});}catch(_0x51ce93){if(_0x2aa99d[_0x1d89c6(0xbb)](_0x51ce93,ApiError)&&_0x51ce93['status']===0x199){console[_0x1d89c6(0x11b)]('\x0a\x20\x20A\x20cloud\x20profile\x20named\x20\x22'+_0x671990+_0x1d89c6(0xc7));throw _0x51ce93;}return console['log']('\x20\x20Could\x20not\x20reach\x20Ranger\x20API\x20to\x20create\x20a\x20cloud\x20profile\x20('+(_0x51ce93 instanceof Error?_0x51ce93['message']:String(_0x51ce93))+_0x1d89c6(0xc0)),_0xb7935?.[_0x1d89c6(0x104)](_0x2aa99d['uPJDX'],{'reason':_0x1d89c6(0xf5),'profileName':_0x671990}),![];}console['log'](_0x2aa99d[_0x1d89c6(0xdd)]('✓\x20Cloud\x20profile\x20\x27'+_0x671990+_0x1d89c6(0xfd)+_0x1ba7b7+'\x27.\x0a','\x20\x20Next:\x20RANGER_TEST_USERNAME=...\x20RANGER_TEST_PASSWORD=...\x20ranger\x20go\x20--profile\x20'+_0x671990));try{await sweepOrphanLocalProfile(_0x671990,getRangerHomeDir(),![]);const _0x46fa4d=_0x2aa99d[_0x1d89c6(0xd3)](getRangerDir);_0x46fa4d!==_0x2aa99d['eaFIP'](getRangerHomeDir)&&await sweepOrphanLocalProfile(_0x671990,_0x46fa4d,!![]);}catch(_0x500836){console[_0x1d89c6(0xe9)]('\x20\x20Note:\x20cloud\x20profile\x20created,\x20but\x20failed\x20to\x20sweep\x20orphan\x20local\x20dirs\x20('+(_0x500836 instanceof Error?_0x500836[_0x1d89c6(0xa3)]:_0x2aa99d['xPGif'](String,_0x500836))+').');}return _0xb7935?.[_0x1d89c6(0x104)](_0x2aa99d['JJWci'],{'envKey':_0x1ba7b7,'profileName':_0x671990}),!![];}export async function addEnv(_0x282262,_0x14be0f={},_0x2ec181){const _0x4f3704=_0x5dea,_0x43b30f={'ayuxn':function(_0x3ab2bd){return _0x3ab2bd();},'CTMbI':function(_0x10fcb7){return _0x10fcb7();},'BVPxW':function(_0x4cdaf2,_0x9c1e10,_0x1c5c33){return _0x4cdaf2(_0x9c1e10,_0x1c5c33);},'aUFEe':function(_0x57519f,_0x26998e){return _0x57519f(_0x26998e);},'qhTjR':function(_0x470c28,_0x136973,_0x4ab107,_0x2ab0ea,_0x5e4c17,_0x7312e7){return _0x470c28(_0x136973,_0x4ab107,_0x2ab0ea,_0x5e4c17,_0x7312e7);},'fCZrV':function(_0x126184,_0x1edc80){return _0x126184===_0x1edc80;},'VvXdF':_0x4f3704(0x117),'UWtHE':'shouldReplace','PXIWd':_0x4f3704(0x105),'uvwpc':'\x20\x20Make\x20sure\x20your\x20Electron\x20app\x20(or\x20browser)\x20is\x20running\x20with\x20remote\x20debugging\x20enabled.\x0a','UBPWH':function(_0x489cdb,_0x29aecd){return _0x489cdb(_0x29aecd);},'aTxTg':_0x4f3704(0xa9),'YwseE':_0x4f3704(0xc8),'afGQE':_0x4f3704(0xaf),'tjXwJ':'list','nWQIA':'What\x20would\x20you\x20like\x20to\x20do?','ypElB':'retry','ugThX':function(_0x39c15a,_0x55e22e){return _0x39c15a===_0x55e22e;},'vygZU':function(_0x2730b0,_0x18627e){return _0x2730b0===_0x18627e;},'EYvjA':'continue','JIAJU':_0x4f3704(0x129),'voXZj':function(_0x40e0bb,_0x1cd88d){return _0x40e0bb(_0x1cd88d);},'zuzQQ':function(_0x42ba22,_0x3ef2fd,_0x463a4e){return _0x42ba22(_0x3ef2fd,_0x463a4e);},'jixCU':function(_0x555441,_0x43a7f3,_0x26ab6d){return _0x555441(_0x43a7f3,_0x26ab6d);},'Nnnhp':'auth.json','aWHlH':'SIGINT','WHMRd':function(_0x2c482a,_0x1a6b82){return _0x2c482a(_0x1a6b82);},'tWFyg':'browser_auth','rIIER':'\x0a📋\x20Authentication\x20Setup','FkwWq':_0x4f3704(0xc2),'ZgmMD':'\x20\x20\x20When\x20done\x20logging\x20in,\x20close\x20the\x20browser\x20to\x20save\x20the\x20session.','lbPNK':_0x4f3704(0x11f),'EYFPh':_0x4f3704(0xd0),'rWJJU':function(_0x43c51f,_0x44c5e0){return _0x43c51f>_0x44c5e0;},'ldZnb':function(_0x2c08ad,_0x3a396f){return _0x2c08ad||_0x3a396f;},'IyzHh':'\x0aThe\x20browser\x20closed\x20unexpectedly\x20before\x20authentication\x20could\x20be\x20saved.','YeSaK':_0x4f3704(0x131),'cIdzg':'You\x20can\x20try\x20again\x20with\x20one\x20of:','EEwKo':_0x4f3704(0x9f),'WMEDQ':function(_0x53ea62){return _0x53ea62();},'BMYNG':'\x20\x20Could\x20not\x20encrypt:\x20No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]','Dafmc':_0x4f3704(0xd9),'rBpLG':function(_0x25b3bf,_0x206ff7,_0x3dc3ba){return _0x25b3bf(_0x206ff7,_0x3dc3ba);},'zWYTN':function(_0x277ab8,_0x2afbbd){return _0x277ab8+_0x2afbbd;},'TiXEd':'.enc','YnzaV':'\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.','XXLoL':_0x4f3704(0xa8),'QeeoA':function(_0x1e7d5a,_0x5aadfb,_0x5e75c1){return _0x1e7d5a(_0x5aadfb,_0x5e75c1);},'NcVIE':'config_write'},_0x5bbfd6=_0x14be0f['ci']??![],_0x331264=_0x5bbfd6?'ci':_0x4f3704(0xa5),_0x5b98d6=_0x14be0f['scope']===_0x4f3704(0xf7)?_0x43b30f['ayuxn'](getRangerHomeDir):_0x43b30f[_0x4f3704(0xa2)](getRangerDir),_0x11c287=join(_0x5b98d6,_0x331264,_0x282262),_0x49f941={};if(_0x14be0f['setupHeader'])for(const _0x247fff of _0x14be0f['setupHeader']){const _0x521056=_0x247fff[_0x4f3704(0x112)](':');if(_0x521056===-0x1)throw new Error('Invalid\x20--setup-header\x20format:\x20\x22'+_0x247fff+_0x4f3704(0xcb));const _0x4c8f6b=_0x247fff['slice'](0x0,_0x521056)['trim'](),_0x4f6db1=_0x247fff['slice'](_0x521056+0x1)['trim']();_0x49f941[_0x4c8f6b]=_0x4f6db1;}const _0x4a7953=_0x43b30f[_0x4f3704(0xba)](join,_0x5b98d6,_0x331264);if(_0x14be0f[_0x4f3704(0xbc)]!==undefined&&_0x14be0f['cdpEndpoint'][_0x4f3704(0x107)]()==='')throw new Error(_0x4f3704(0xed));if(_0x14be0f[_0x4f3704(0xbc)]&&_0x14be0f['url'])throw new Error('--url\x20and\x20--cdp-endpoint\x20are\x20mutually\x20exclusive.\x20Use\x20--url\x20for\x20web\x20apps\x20or\x20--cdp-endpoint\x20for\x20Electron/CDP\x20apps,\x20not\x20both.');if(_0x14be0f['cdpEndpoint']&&_0x14be0f['ci'])throw new Error(_0x4f3704(0xc5));const _0x4af6b8=_0x43b30f[_0x4f3704(0x111)](Boolean,_0x14be0f[_0x4f3704(0xbc)]),_0x395db2=!_0x14be0f['skipAuth']&&!_0x4af6b8,_0x1cf9b4=process['stdin'][_0x4f3704(0x106)]&&process['stdout']['isTTY'];if(!_0x1cf9b4&&!_0x14be0f['url']&&!_0x4af6b8)throw new Error(_0x4f3704(0x109));if(!_0x5bbfd6&&!_0x14be0f['skipAuth']&&!_0x4af6b8&&_0x14be0f[_0x4f3704(0xb6)]){const _0x1c4d59=await _0x43b30f['qhTjR'](tryAutoRouteCloudProfile,_0x282262,_0x14be0f['url'],_0x14be0f,_0x1cf9b4,_0x2ec181);if(_0x1c4d59)return;}const _0xcc2b7d=findExistingEnv(_0x282262,{'rangerDir':_0x5b98d6});let _0x2a77d5=null;if(_0xcc2b7d){if(!_0x1cf9b4)_0x2a77d5=_0xcc2b7d;else{if(_0x43b30f[_0x4f3704(0xb3)](_0xcc2b7d[_0x4f3704(0xf8)],_0x331264)){const {overwrite:_0x1216e8}=await _0x4d5eff[_0x4f3704(0xd6)]([{'type':_0x43b30f['VvXdF'],'name':_0x4f3704(0xea),'message':_0x4f3704(0x125)+_0x282262+'\x22\x20already\x20exists.\x20Overwrite?','default':![]}]);if(!_0x1216e8){console[_0x4f3704(0xe9)]('Aborted.');return;}_0x2a77d5=_0xcc2b7d;}else{const _0x1b1d10=_0x43b30f['fCZrV'](_0xcc2b7d[_0x4f3704(0xf8)],_0x4f3704(0xd7))?'root\x20(.ranger/)':_0xcc2b7d['location'];console[_0x4f3704(0x11b)](_0x4f3704(0x127)+_0x282262+'\x22\x20already\x20exists\x20in\x20'+_0x1b1d10+':\x20'+_0xcc2b7d[_0x4f3704(0x122)]),console['error'](_0x4f3704(0xcc)+_0x331264+_0x4f3704(0xc1));const {shouldReplace:_0x17f52e}=await _0x4d5eff[_0x4f3704(0xd6)]([{'type':_0x4f3704(0x117),'name':_0x43b30f['UWtHE'],'message':'Delete\x20existing\x20and\x20create\x20new\x20in\x20'+_0x331264+'?','default':![]}]);if(!_0x17f52e){console['log'](_0x4f3704(0xac));return;}_0x2a77d5=_0xcc2b7d;}}}_0x2ec181?.[_0x4f3704(0xef)](_0x4f3704(0x129));let _0x2ca134='';if(_0x4af6b8)console[_0x4f3704(0xe9)](_0x43b30f['PXIWd']),console[_0x4f3704(0xe9)]('\x20\x20Configuring\x20Ranger\x20to\x20connect\x20to:\x20'+_0x14be0f['cdpEndpoint']),console['log'](_0x43b30f[_0x4f3704(0x12e)]);else{if(_0x14be0f[_0x4f3704(0xb6)]){_0x2ca134=_0x14be0f[_0x4f3704(0xb6)];const _0x56d32c=await _0x43b30f['UBPWH'](checkUrlReachability,_0x2ca134);if(!_0x56d32c['ok']&&!_0x14be0f['force'])throw new Error(_0x4f3704(0x12a)+_0x2ca134+':\x20'+_0x56d32c[_0x4f3704(0x11b)]+'\x0aMake\x20sure\x20your\x20app\x20is\x20running,\x20then\x20try\x20again.\x20To\x20skip\x20this\x20check,\x20pass\x20--force.');!_0x56d32c['ok']&&_0x14be0f[_0x4f3704(0x10c)]&&console['log'](_0x4f3704(0xda)+_0x2ca134+':\x20'+_0x56d32c[_0x4f3704(0x11b)]+'\x20(continuing\x20with\x20--force)');}else{console[_0x4f3704(0xe9)](_0x4f3704(0x123)),console['log']('\x20\x20Make\x20sure\x20your\x20app\x20is\x20running\x20locally\x20before\x20continuing.'),console[_0x4f3704(0xe9)]('\x20\x20Ranger\x20will\x20open\x20it\x20in\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20and\x20save\x20your\x20session.\x0a');let _0x2e31f5=![];while(!![]){const _0x4585a1=await _0x4d5eff[_0x4f3704(0xd6)]([{'type':_0x43b30f['aTxTg'],'name':_0x43b30f['YwseE'],'message':_0x2e31f5?_0x43b30f['afGQE']:_0x4f3704(0xc9),'default':_0x2ca134||_0x4f3704(0xb9)}]);_0x2ca134=_0x4585a1['baseUrl'];const _0x5218e9=await checkUrlReachability(_0x2ca134);if(_0x5218e9['ok'])break;const _0x396563=/^[a-zA-Z][\w+.-]*:\/\//['test'](_0x2ca134),_0x1008eb=_0x5218e9[_0x4f3704(0x113)]&&!_0x396563,_0x4572ce=_0x1008eb?'http://'+_0x2ca134:null;_0x2e31f5=!![],console[_0x4f3704(0xe9)](_0x4f3704(0x126)+_0x2ca134+':\x20'+_0x5218e9['error']);_0x4572ce&&console[_0x4f3704(0xe9)]('\x20\x20Did\x20you\x20mean\x20'+_0x4572ce+'?');const {action:_0x3702c9}=await _0x4d5eff[_0x4f3704(0xd6)]([{'type':_0x43b30f[_0x4f3704(0x11d)],'name':'action','message':_0x43b30f['nWQIA'],'choices':[..._0x4572ce?[{'name':_0x4f3704(0x114)+_0x4572ce,'value':_0x4f3704(0xe3)}]:[],{'name':'Enter\x20a\x20different\x20URL','value':_0x43b30f[_0x4f3704(0xee)]},{'name':'Continue\x20anyway','value':'continue'}]}]);if(_0x43b30f['ugThX'](_0x3702c9,_0x4f3704(0xe3))&&_0x4572ce){_0x2ca134=_0x4572ce;const _0x3f763f=await checkUrlReachability(_0x2ca134);if(_0x3f763f['ok'])break;console[_0x4f3704(0xe9)]('\x0a\x20\x20Still\x20could\x20not\x20reach\x20'+_0x2ca134+':\x20'+_0x3f763f['error']);}else{if(_0x43b30f[_0x4f3704(0xa0)](_0x3702c9,_0x43b30f[_0x4f3704(0xe6)]))break;}}}}_0x2ec181?.[_0x4f3704(0x104)](_0x43b30f[_0x4f3704(0xdb)]);const _0x4e5005={};if(_0x2a77d5){const _0x1e9171=await _0x43b30f['voXZj'](loadSettings,_0x282262);Object['assign'](_0x4e5005,_0x1e9171['setupHeaders']);}Object['assign'](_0x4e5005,_0x49f941),await mkdir(_0x4a7953,{'recursive':!![]});try{const _0x4dba2c=await readdir(_0x4a7953),_0x4168f8='.tmp-'+_0x282262+'-';for(const _0x539591 of _0x4dba2c){_0x539591['startsWith'](_0x4168f8)&&await _0x43b30f['zuzQQ'](rm,join(_0x4a7953,_0x539591),{'recursive':!![],'force':!![]});}}catch{}const _0x1b099e=await _0x43b30f['aUFEe'](mkdtemp,_0x43b30f['jixCU'](join,_0x4a7953,'.tmp-'+_0x282262+'-')),_0x1899e4=join(_0x1b099e,_0x43b30f['Nnnhp']),_0x182fdd=()=>{const _0x44c080=_0x4f3704;rm(_0x1b099e,{'recursive':!![],'force':!![]})[_0x44c080(0x119)](()=>{})[_0x44c080(0x10e)](()=>{const _0x374d33=_0x44c080;process[_0x374d33(0x100)](0x82);});};process['once'](_0x43b30f['aWHlH'],_0x182fdd);const _0x4995b9=_0x43b30f[_0x4f3704(0xec)](Boolean,_0x2ca134)&&/^https:\/\/localhost(:\d+)?/i[_0x4f3704(0x101)](_0x2ca134);try{if(_0x395db2){_0x2ec181?.[_0x4f3704(0xef)](_0x43b30f['tWFyg']),console[_0x4f3704(0xe9)](_0x43b30f[_0x4f3704(0xad)]),console[_0x4f3704(0xe9)](_0x43b30f['FkwWq']),console['log'](_0x43b30f[_0x4f3704(0xb0)]);!_0x1cf9b4?(console[_0x4f3704(0xe9)](_0x43b30f['lbPNK']),console['log'](_0x43b30f['EYFPh'])):console['log']('');await new Promise(_0x2eebe6=>setTimeout(_0x2eebe6,0xbb8));const _0x9d5a1c=[];_0x14be0f[_0x4f3704(0xb8)]&&_0x9d5a1c[_0x4f3704(0xfc)](_0x4f3704(0xf1));const _0x2e5afa=_0x14be0f[_0x4f3704(0xb1)]||_0x4995b9;_0x2e5afa&&_0x9d5a1c['push'](_0x4f3704(0x102));const _0x395de4=await chromium['launch']({'headless':![],..._0x43b30f[_0x4f3704(0xf2)](_0x9d5a1c['length'],0x0)?{'args':_0x9d5a1c}:{}});try{const _0x5364d8=_0x43b30f['rWJJU'](Object[_0x4f3704(0x103)](_0x4e5005)['length'],0x0),_0x697a10={'ignoreHTTPSErrors':!![]};_0x5364d8&&(_0x697a10['extraHTTPHeaders']=_0x4e5005);const _0x432f97=await _0x395de4['newContext'](_0x697a10);await addProfileSetupBanner(_0x432f97);const _0xeb0adf=await _0x432f97['newPage']();await _0xeb0adf[_0x4f3704(0xf3)](_0x43b30f[_0x4f3704(0xe0)](_0x2ca134,_0x4f3704(0xb4)));let _0x2dfa42=![];await new Promise(_0xc6b593=>{const _0x5d9239=_0x4f3704,_0x2ca385={'axIos':_0x5d9239(0x110),'iKHzT':function(_0x149fb5){const _0x5e2d16=_0x5d9239;return _0x43b30f[_0x5e2d16(0x11c)](_0x149fb5);}};_0xeb0adf['on'](_0x5d9239(0xfb),async()=>{const _0x4b868e=_0x5d9239;try{console[_0x4b868e(0xe9)](_0x2ca385['axIos']),await _0x432f97[_0x4b868e(0xe2)]({'path':_0x1899e4}),_0x2dfa42=!![];}catch{}_0x2ca385[_0x4b868e(0xff)](_0xc6b593);});});if(!_0x2dfa42){console['log'](_0x43b30f['IyzHh']);!_0x14be0f[_0x4f3704(0xb8)]&&(console['log'](_0x43b30f['YeSaK']),console['log'](_0x43b30f[_0x4f3704(0xbd)]),console['log']('\x20\x20ranger\x20profile\x20add\x20'+_0x282262+_0x4f3704(0xd2)),console[_0x4f3704(0xe9)](_0x4f3704(0x130)+_0x282262+'\x20--skip-auth\x20\x20\x20\x20(skip\x20browser\x20auth\x20entirely)\x0a'));throw new Error('Browser\x20closed\x20before\x20authentication\x20was\x20saved.');}}finally{await _0x395de4['close']()['catch'](()=>{});}if(_0x5bbfd6){const _0x24f7d3=await readFile(_0x1899e4,_0x43b30f[_0x4f3704(0xa1)]),_0x40f58b=await _0x43b30f[_0x4f3704(0x120)](getToken);if(!_0x40f58b){console[_0x4f3704(0x11b)](_0x43b30f['BMYNG']),await unlink(_0x1899e4)['catch'](()=>{});throw new Error(_0x43b30f['Dafmc']);}else{const _0x35662c=_0x43b30f['rBpLG'](encrypt,_0x24f7d3,_0x40f58b);await writeFile(_0x43b30f['zWYTN'](_0x1899e4,_0x43b30f['TiXEd']),_0x35662c),await unlink(_0x1899e4),console[_0x4f3704(0xe9)](_0x4f3704(0xeb)+_0x1899e4+'.enc'),console[_0x4f3704(0xe9)](_0x43b30f['YnzaV']),console[_0x4f3704(0xe9)]('\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.');}}else console[_0x4f3704(0xe9)](_0x4f3704(0x12b)+_0x1899e4);_0x2ec181?.[_0x4f3704(0x104)]('browser_auth');}_0x2ec181?.[_0x4f3704(0xef)]('config_write');const _0x4387cc={};_0x2ca134&&(_0x4387cc['baseUrl']=_0x2ca134);_0x14be0f['cdpEndpoint']&&(_0x4387cc['cdpEndpoint']=_0x14be0f[_0x4f3704(0xbc)],_0x4387cc['isElectron']=!![]);(_0x14be0f[_0x4f3704(0xb1)]||_0x4995b9)&&(_0x4387cc['allowInsecureLocalhost']=!![]);_0x14be0f[_0x4f3704(0xb8)]&&(_0x4387cc[_0x4f3704(0xb8)]=!![]);Object['keys'](_0x4e5005)[_0x4f3704(0xe7)]>0x0&&(_0x4387cc['setupHeaders']=_0x4e5005);await writeFile(join(_0x1b099e,'settings.json'),JSON['stringify'](_0x4387cc,null,0x2)),console[_0x4f3704(0xe9)](_0x4f3704(0x10a)+_0x43b30f[_0x4f3704(0xd8)](join,_0x11c287,_0x43b30f[_0x4f3704(0xbf)]));if(_0x43b30f['ugThX'](_0x2a77d5?.['location'],_0x331264)){const _0x475d7b=_0x2a77d5[_0x4f3704(0x122)]+_0x4f3704(0x10b)+Date[_0x4f3704(0xf6)]();await rename(_0x2a77d5[_0x4f3704(0x122)],_0x475d7b);try{await rename(_0x1b099e,_0x11c287);}catch(_0x8b637a){await rename(_0x475d7b,_0x2a77d5['path']);throw _0x8b637a;}try{await rm(_0x475d7b,{'recursive':!![]});}catch{console[_0x4f3704(0xe9)](_0x4f3704(0x121)+_0x475d7b);}}else{await _0x43b30f['QeeoA'](rename,_0x1b099e,_0x11c287);if(_0x2a77d5)try{await rm(_0x2a77d5['path'],{'recursive':!![]}),console['log'](_0x4f3704(0xce)+_0x2a77d5[_0x4f3704(0x122)]);}catch{console['log'](_0x4f3704(0xde)+_0x2a77d5['path']);}}try{await _0x43b30f[_0x4f3704(0xec)](writeActiveProfileName,_0x282262),console['log'](_0x4f3704(0x12c)+_0x282262);}catch{console[_0x4f3704(0xe9)](_0x4f3704(0x116));}_0x2ec181?.['trackPhaseEnd'](_0x43b30f[_0x4f3704(0xa4)]),console[_0x4f3704(0xe9)]('\x0a\x20\x20Profile\x20\x22'+_0x282262+_0x4f3704(0xe8));}catch(_0x15099c){await _0x43b30f['zuzQQ'](rm,_0x1b099e,{'recursive':!![],'force':!![]});throw _0x15099c;}finally{process['off']('SIGINT',_0x182fdd);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b1fbd,_0x25612b){const _0x40d422=_0x39d0,_0x34e0ce=_0x2b1fbd();while(!![]){try{const _0xb3e439=parseInt(_0x40d422(0x1e2))/0x1+parseInt(_0x40d422(0x1d8))/0x2*(-parseInt(_0x40d422(0x1d2))/0x3)+-parseInt(_0x40d422(0x1db))/0x4*(parseInt(_0x40d422(0x1d3))/0x5)+-parseInt(_0x40d422(0x1e1))/0x6+parseInt(_0x40d422(0x1dc))/0x7*(-parseInt(_0x40d422(0x1d5))/0x8)+parseInt(_0x40d422(0x1dd))/0x9+parseInt(_0x40d422(0x1d0))/0xa*(parseInt(_0x40d422(0x1de))/0xb);if(_0xb3e439===_0x25612b)break;else _0x34e0ce['push'](_0x34e0ce['shift']());}catch(_0x3de4a8){_0x34e0ce['push'](_0x34e0ce['shift']());}}}(_0xf7e4,0x9014e));import{readFile,writeFile}from'fs/promises';function _0xf7e4(){const _0x4127aa=['log','\x20\x20The\x20encrypted\x20auth.json.enc\x20can\x20be\x20committed.','110AUVDgD','utf-8','12711BlgacS','2863535olTPww','No\x20API\x20token\x20found.\x20Run:\x20ranger\x20setup\x20[token]','8lBojae','DFhYm','jFgXv','382fXODNg','\x20\x20You\x20can\x20safely\x20commit\x20this\x20file\x20to\x20git.','.\x20Run\x20first:\x20ranger\x20profile\x20add\x20with\x20authentication,\x20or\x20ranger\x20profile\x20update','8ijmGom','6264097jbgJDa','2060118oyuKJv','2285679ZQbmyT','\x0a✓\x20Encrypted\x20auth\x20saved\x20to:\x20','aLvDY','37440oHGfAX','931369OvZTkd','vAdqs','\x20\x20Run\x20ranger\x20setup\x20in\x20CI\x20to\x20decrypt\x20at\x20runtime.'];_0xf7e4=function(){return _0x4127aa;};return _0xf7e4();}import{join}from'path';import{existsSync}from'fs';function _0x39d0(_0x1926bb,_0x406adb){_0x1926bb=_0x1926bb-0x1d0;const _0xf7e410=_0xf7e4();let _0x39d0f5=_0xf7e410[_0x1926bb];return _0x39d0f5;}import{encrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{getEnvDir}from'./utils/settings.js';export async function authEncrypt(_0x28cdfc){const _0x126048=_0x39d0,_0x4b5ca0={'aLvDY':function(_0x14742d,_0x2d54ab){return _0x14742d(_0x2d54ab);},'DFhYm':function(_0x38492e,_0xdeeda2){return _0x38492e+_0xdeeda2;},'PMHJb':function(_0x4273d6,_0x14550c){return _0x4273d6(_0x14550c);},'xhBwO':function(_0x4ccc33){return _0x4ccc33();},'vAdqs':_0x126048(0x1d4),'jFgXv':_0x126048(0x1d1),'ZNeLk':function(_0x418caa,_0x28a804,_0x22db6f){return _0x418caa(_0x28a804,_0x22db6f);},'Qvnlp':_0x126048(0x1e4)},_0x3b9686=_0x4b5ca0[_0x126048(0x1e0)](getEnvDir,_0x28cdfc),_0xeb874e=join(_0x3b9686,'auth.json'),_0xf1a163=_0x4b5ca0[_0x126048(0x1d6)](_0xeb874e,'.enc');if(!_0x4b5ca0['aLvDY'](existsSync,_0x3b9686))throw new Error('Profile\x20\x22'+_0x28cdfc+'\x22\x20not\x20found.\x20Run\x20first:\x20ranger\x20profile\x20add\x20'+_0x28cdfc);if(!_0x4b5ca0['PMHJb'](existsSync,_0xeb874e))throw new Error('No\x20auth.json\x20found\x20at\x20'+_0xeb874e+_0x126048(0x1da));const _0x46d97c=await _0x4b5ca0['xhBwO'](getToken);if(!_0x46d97c)throw new Error(_0x4b5ca0[_0x126048(0x1e3)]);const _0xb0d61d=await readFile(_0xeb874e,_0x4b5ca0[_0x126048(0x1d7)]),_0x1a2a4f=encrypt(_0xb0d61d,_0x46d97c);await _0x4b5ca0['ZNeLk'](writeFile,_0xf1a163,_0x1a2a4f),console[_0x126048(0x1e5)](_0x126048(0x1df)+_0xf1a163),console[_0x126048(0x1e5)](_0x126048(0x1d9)),console[_0x126048(0x1e5)](_0x4b5ca0['Qvnlp']),_0x4b5ca0['PMHJb'](existsSync,_0xf1a163)&&(console['log']('\x0a\x20\x20The\x20plaintext\x20auth.json\x20is\x20gitignored\x20for\x20security.'),console[_0x126048(0x1e5)](_0x126048(0x1e6)));}
|
package/build/commands/clean.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const _0x2f183c=_0xbe02;(function(_0x28201b,_0x1a022f){const _0x545871=_0xbe02,_0x499a5e=_0x28201b();while(!![]){try{const _0x14a291=parseInt(_0x545871(0xe8))/0x1*(parseInt(_0x545871(0x102))/0x2)+parseInt(_0x545871(0xf0))/0x3+-parseInt(_0x545871(0xda))/0x4+-parseInt(_0x545871(0xf2))/0x5*(-parseInt(_0x545871(0xcc))/0x6)+-parseInt(_0x545871(0xe6))/0x7+-parseInt(_0x545871(0xc9))/0x8+parseInt(_0x545871(0xfa))/0x9*(parseInt(_0x545871(0xee))/0xa);if(_0x14a291===_0x1a022f)break;else _0x499a5e['push'](_0x499a5e['shift']());}catch(_0x28affe){_0x499a5e['push'](_0x499a5e['shift']());}}}(_0x3471,0x2ab89));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','feature-tracker',_0x2f183c(0xf4),'e2e-test-recommender'],opencodePluginName=_0x2f183c(0xd8);function parseJsonc(_0xe853f2){const _0x53a89e=_0x2f183c,_0x61979=_0xe853f2[_0x53a89e(0xf6)](/\/\*[\s\S]*?\*\//g,''),_0x40af98=_0x61979['replace'](/^\s*\/\/.*$/gm,''),_0x7b28dd=_0x40af98[_0x53a89e(0xf6)](/,\s*([}\]])/g,'$1');return JSON['parse'](_0x7b28dd);}async function removeOpencodePluginConfig(_0x1f4a9f){const _0x2745e1=_0x2f183c,_0x1e6340={'GKsqs':function(_0x4dd3fe,_0x23ee85){return _0x4dd3fe!==_0x23ee85;},'EHDHa':'string','PpmRV':function(_0x1a3fcb,_0x2139aa){return _0x1a3fcb!==_0x2139aa;},'LOWhv':function(_0x8d840f,_0x2cfce3,_0x8742bb){return _0x8d840f(_0x2cfce3,_0x8742bb);},'CpYCj':function(_0x8abe13,_0x3e2cc4){return _0x8abe13===_0x3e2cc4;},'HYKim':function(_0x4af379,_0x147f87){return _0x4af379+_0x147f87;}};if(!existsSync(_0x1f4a9f))return![];let _0x3040e5;try{const _0x528137=await _0x1e6340[_0x2745e1(0xf3)](readFile,_0x1f4a9f,'utf-8');_0x3040e5=parseJsonc(_0x528137);}catch{return![];}const _0x4c55ea=Array[_0x2745e1(0xe5)](_0x3040e5[_0x2745e1(0xdc)])?_0x3040e5['plugin']:[];if(_0x1e6340['CpYCj'](_0x4c55ea['length'],0x0))return![];const _0x125257=_0x4c55ea['filter'](_0x14b071=>{const _0x3a0d37=_0x2745e1;if(_0x1e6340[_0x3a0d37(0xe3)](typeof _0x14b071,_0x1e6340['EHDHa']))return!![];return _0x1e6340[_0x3a0d37(0xd4)](_0x14b071,opencodePluginName);});if(_0x1e6340['CpYCj'](_0x125257[_0x2745e1(0xfd)],_0x4c55ea['length']))return![];return _0x1e6340[_0x2745e1(0xff)](_0x125257[_0x2745e1(0xfd)],0x0)?delete _0x3040e5[_0x2745e1(0xdc)]:_0x3040e5[_0x2745e1(0xdc)]=_0x125257,await writeFile(_0x1f4a9f,_0x1e6340[_0x2745e1(0xd7)](JSON['stringify'](_0x3040e5,null,0x2),'\x0a')),!![];}async function uninstallClaudePlugin(_0x312a6e){const _0x564c25=_0x2f183c,_0x583b51={'MKXHt':function(_0x2bf177,_0x3dd587){return _0x2bf177(_0x3dd587);},'NIlxK':function(_0x33731f,_0x1f27f2){return _0x33731f===_0x1f27f2;},'rVqSz':_0x564c25(0xe7),'AXqWP':_0x564c25(0xd0),'KGKod':function(_0x384a7c,_0x584c63,_0x58d2e3,_0x256c1d){return _0x384a7c(_0x584c63,_0x58d2e3,_0x256c1d);},'hIDYu':_0x564c25(0xca),'mGrlY':_0x564c25(0xde)};return new Promise(_0x5836ec=>{const _0x40c9fb=_0x564c25,_0x2f4b4b=[_0x40c9fb(0xdc),'uninstall',_0x583b51['rVqSz']];_0x312a6e&&_0x2f4b4b['push'](_0x583b51['AXqWP'],_0x312a6e);const _0x2c6918=_0x583b51['KGKod'](spawn,_0x583b51[_0x40c9fb(0xf7)],_0x2f4b4b,{'stdio':_0x40c9fb(0xed),'shell':process['platform']===_0x583b51['mGrlY']});_0x2c6918['on'](_0x40c9fb(0xe0),_0x2f1415=>{const _0x11c92f=_0x40c9fb;_0x583b51['MKXHt'](_0x5836ec,_0x583b51[_0x11c92f(0xd1)](_0x2f1415,0x0));}),_0x2c6918['on'](_0x40c9fb(0xf1),()=>{_0x5836ec(![]);});});}async function removeMarketplace(){const _0x395dca=_0x2f183c,_0x2b5c6e={'tKqCo':function(_0x1dcf00,_0x56a0fe){return _0x1dcf00===_0x56a0fe;},'QyEAp':function(_0x33433f,_0x575970){return _0x33433f(_0x575970);},'fEWRp':function(_0x2964ab,_0x192b8c,_0x26f21b,_0x22aa8e){return _0x2964ab(_0x192b8c,_0x26f21b,_0x22aa8e);},'fqKfR':_0x395dca(0xcb),'ckdqg':_0x395dca(0xe4),'skRJO':_0x395dca(0xeb),'fIrVG':_0x395dca(0xed)};return new Promise(_0x3b079b=>{const _0x45381e=_0x395dca,_0x3d3f14=_0x2b5c6e['fEWRp'](spawn,'claude',[_0x45381e(0xdc),_0x2b5c6e[_0x45381e(0xf5)],_0x2b5c6e['ckdqg'],_0x2b5c6e[_0x45381e(0xdb)]],{'stdio':_0x2b5c6e[_0x45381e(0xdf)],'shell':process['platform']==='win32'});_0x3d3f14['on'](_0x45381e(0xe0),_0x381d15=>{const _0x56ea8f=_0x45381e;_0x3b079b(_0x2b5c6e[_0x56ea8f(0xe1)](_0x381d15,0x0));}),_0x3d3f14['on']('error',()=>{_0x2b5c6e['QyEAp'](_0x3b079b,![]);});});}function _0xbe02(_0x502292,_0x389eba){_0x502292=_0x502292-0xc9;const _0x3471f1=_0x3471();let _0xbe02ee=_0x3471f1[_0x502292];return _0xbe02ee;}function _0x3471(){const _0x304183=['✓\x20Uninstalled\x20Claude\x20plugin\x20(project\x20scope)','141273iYldnB','✓\x20Removed\x20stored\x20credentials','✓\x20Removed\x20trailhead\x20marketplace','length','\x0a✅\x20Cleanup\x20complete!\x0a','CpYCj','eprMe','lrbgI','410654eFzZHj','log','ScayG','2680848vcirWL','claude','marketplace','274914BIZOGx','\x0a🧹\x20Cleaning\x20up\x20Ranger\x20artifacts...\x0a','RrDNI','bhRKX','--scope','NIlxK','✓\x20Uninstalled\x20Claude\x20plugin\x20(user\x20scope)','eTIoH','PpmRV','project','✓\x20Removed\x20project\x20skill:\x20','HYKim','@ranger-testing/opencode-plugin','xbTvP','233588OltqPQ','skRJO','plugin','YpeUG','win32','fIrVG','close','tKqCo','bTjsf','GKsqs','remove','isArray','1005942kAwiWm','ranger@trailhead','1oLGNir','✓\x20Removed\x20OpenCode\x20plugin\x20(project\x20config)','✓\x20Removed\x20OpenCode\x20user\x20skill:\x20','trailhead','✓\x20Removed\x20OpenCode\x20plugin\x20(user\x20config)','pipe','100DLOoDL','✓\x20Removed\x20.ranger/\x20directory','774777cGiClF','error','10nrtBNc','LOWhv','bug-bash','fqKfR','replace','hIDYu','vyqVF'];_0x3471=function(){return _0x304183;};return _0x3471();}export async function clean(){const _0x4fdf38=_0x2f183c,_0x543764={'NNHSz':_0x4fdf38(0xcd),'bTjsf':function(_0x35fe9f){return _0x35fe9f();},'lrbgI':function(_0x46be5a,_0x19a1f0){return _0x46be5a(_0x19a1f0);},'RrDNI':function(_0x478e1c,_0x32bb04){return _0x478e1c(_0x32bb04);},'bhRKX':function(_0xd49377,_0x1f4332,_0x33cd67){return _0xd49377(_0x1f4332,_0x33cd67);},'eprMe':_0x4fdf38(0xef),'POrNc':function(_0x3394d7){return _0x3394d7();},'MHLuK':function(_0x1b6469,_0x23690e){return _0x1b6469(_0x23690e);},'vyqVF':_0x4fdf38(0xd5),'xbTvP':function(_0x41c513,_0xfc04b5,_0x3fc126){return _0x41c513(_0xfc04b5,_0x3fc126);},'eTIoH':function(_0x283b24,_0x2bff3e){return _0x283b24(_0x2bff3e);},'YpeUG':'user','ScayG':'opencode.json','FiaAN':function(_0x54deb6,_0x51a1f4){return _0x54deb6(_0x51a1f4);},'hiAMW':_0x4fdf38(0xf9)};console[_0x4fdf38(0x103)](_0x543764['NNHSz']);let _0x40ef49=![];try{await _0x543764['bTjsf'](deleteAllCredentials),console['log'](_0x4fdf38(0xfb)),_0x40ef49=!![];}catch{}const _0x2653c0=getCacheFile();_0x543764['lrbgI'](existsSync,_0x2653c0)&&(await _0x543764[_0x4fdf38(0xce)](rm,_0x2653c0),_0x40ef49=!![]);const _0x24ed9a=_0x543764[_0x4fdf38(0xe2)](getRangerDir);_0x543764[_0x4fdf38(0x101)](existsSync,_0x24ed9a)&&(await _0x543764[_0x4fdf38(0xcf)](rm,_0x24ed9a,{'recursive':!![]}),console['log'](_0x543764[_0x4fdf38(0x100)]),_0x40ef49=!![]);const _0x3c9dda=_0x543764['POrNc'](getProjectSkillsDir);for(const _0x5d139c of skillsToRemove){const _0x3eaacb=join(_0x3c9dda,_0x5d139c);existsSync(_0x3eaacb)&&(await rm(_0x3eaacb,{'recursive':!![]}),console[_0x4fdf38(0x103)](_0x4fdf38(0xd6)+_0x5d139c),_0x40ef49=!![]);}const _0x512876=getUserSkillsDir();for(const _0x3878f8 of skillsToRemove){const _0x213d28=join(_0x512876,_0x3878f8);existsSync(_0x213d28)&&(await rm(_0x213d28,{'recursive':!![]}),console[_0x4fdf38(0x103)]('✓\x20Removed\x20user\x20skill:\x20'+_0x3878f8),_0x40ef49=!![]);}const _0x46a57f=_0x543764['MHLuK'](getOpencodeSkillsDir,_0x543764[_0x4fdf38(0xf8)]);for(const _0x10255b of skillsToRemove){const _0x3f8f1b=_0x543764['bhRKX'](join,_0x46a57f,_0x10255b);existsSync(_0x3f8f1b)&&(await _0x543764['xbTvP'](rm,_0x3f8f1b,{'recursive':!![]}),console[_0x4fdf38(0x103)]('✓\x20Removed\x20OpenCode\x20project\x20skill:\x20'+_0x10255b),_0x40ef49=!![]);}const _0x6450fb=_0x543764['eTIoH'](getOpencodeSkillsDir,_0x543764[_0x4fdf38(0xdd)]);for(const _0x11dd3b of skillsToRemove){const _0x3eb139=join(_0x6450fb,_0x11dd3b);_0x543764[_0x4fdf38(0xd3)](existsSync,_0x3eb139)&&(await rm(_0x3eb139,{'recursive':!![]}),console['log'](_0x4fdf38(0xea)+_0x11dd3b),_0x40ef49=!![]);}const _0x5476a7=join(getOpencodeConfigDir(_0x543764[_0x4fdf38(0xf8)]),_0x543764[_0x4fdf38(0x104)]);await removeOpencodePluginConfig(_0x5476a7)&&(console['log'](_0x4fdf38(0xe9)),_0x40ef49=!![]);const _0x33f4b4=_0x543764[_0x4fdf38(0xd9)](join,_0x543764['FiaAN'](getOpencodeConfigDir,_0x543764[_0x4fdf38(0xdd)]),_0x543764[_0x4fdf38(0x104)]);await _0x543764['RrDNI'](removeOpencodePluginConfig,_0x33f4b4)&&(console[_0x4fdf38(0x103)](_0x4fdf38(0xec)),_0x40ef49=!![]);const _0x23d4ef=await _0x543764['bTjsf'](uninstallClaudePlugin);_0x23d4ef&&(console[_0x4fdf38(0x103)](_0x4fdf38(0xd2)),_0x40ef49=!![]);const _0x1fc363=await _0x543764[_0x4fdf38(0xd3)](uninstallClaudePlugin,_0x543764[_0x4fdf38(0xf8)]);_0x1fc363&&(console['log'](_0x543764['hiAMW']),_0x40ef49=!![]);const _0x95d0cf=await _0x543764[_0x4fdf38(0xe2)](removeMarketplace);_0x95d0cf&&(console['log'](_0x4fdf38(0xfc)),_0x40ef49=!![]),_0x40ef49?console['log'](_0x4fdf38(0xfe)):console[_0x4fdf38(0x103)]('Nothing\x20to\x20clean\x20up.\x0a');}
|
package/build/commands/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x168740=_0x510c;(function(_0x17978a,_0x10a61c){const _0x2eab11=_0x510c,_0x24e3b3=_0x17978a();while(!![]){try{const _0x50db33=parseInt(_0x2eab11(0xa5))/0x1*(parseInt(_0x2eab11(0xaa))/0x2)+-parseInt(_0x2eab11(0x9b))/0x3+-parseInt(_0x2eab11(0xb6))/0x4+parseInt(_0x2eab11(0x9c))/0x5+-parseInt(_0x2eab11(0xb2))/0x6*(-parseInt(_0x2eab11(0xa8))/0x7)+parseInt(_0x2eab11(0xad))/0x8*(parseInt(_0x2eab11(0xa2))/0x9)+parseInt(_0x2eab11(0x99))/0xa*(-parseInt(_0x2eab11(0xa7))/0xb);if(_0x50db33===_0x10a61c)break;else _0x24e3b3['push'](_0x24e3b3['shift']());}catch(_0x498d8e){_0x24e3b3['push'](_0x24e3b3['shift']());}}}(_0x2217,0x50591));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=[_0x168740(0xb9),'allowInsecureLocalhost'];function _0x2217(){const _0x208192=['Cleared\x20local\x20overrides\x20for\x20\x22','KrKpU','isSafeInteger','10BZwqlT','\x20\x20Note:\x20\x22','61998mkNDpr','2861125CEhqgX','No\x20configuration\x20set\x20for\x20\x22','parse','endsWith','kind','startsWith','4184514eTiNeD','true','ZjCbt','6229xMMNNo','includes','15178581jBBxRG','20552ptxziT','LmvoR','118jqPbJH','\x20for\x20\x22','stringify','8lDRVHZ','local','Key\x20\x22','test','alsoExistsElsewhere','1164hpAuUt','length','UwFTh','false','978496zvaiIV','axvyp','\x20=\x20','headless','object','eVRaz','cloud','dOfnJ','log','Removed\x20','VXmwB','nhXxV','wTcnr','trim','qjgSo'];_0x2217=function(){return _0x208192;};return _0x2217();}function parseLocalValue(_0xdd19eb,_0x5a125d){const _0xcff5f6=_0x168740,_0x518831={'oaUdx':function(_0x3d397a,_0x46d89b){return _0x3d397a===_0x46d89b;},'dOfnJ':_0xcff5f6(0xa3),'WedLC':_0xcff5f6(0xb5)};if(BOOLEAN_KEYS[_0xcff5f6(0xa6)](_0xdd19eb)){if(_0x518831['oaUdx'](_0x5a125d,_0x518831[_0xcff5f6(0x8e)]))return!![];if(_0x5a125d===_0x518831['WedLC'])return![];throw new Error('Invalid\x20value\x20for\x20'+_0xdd19eb+':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22');}return _0x5a125d;}function parseOverrideValue(_0x43a12c){const _0x2c1153=_0x168740,_0x56c00c={'wTcnr':_0x2c1153(0xa3),'hFpAq':function(_0x2f501e,_0x245ccc){return _0x2f501e===_0x245ccc;},'RHhcE':function(_0xf86a42,_0x2b01e5){return _0xf86a42===_0x2b01e5;},'axvyp':function(_0x40a635,_0x2a62a4){return _0x40a635(_0x2a62a4);}};if(_0x43a12c===_0x56c00c[_0x2c1153(0x93)])return!![];if(_0x56c00c['hFpAq'](_0x43a12c,'false'))return![];if(_0x56c00c['RHhcE'](_0x43a12c,'null'))return null;if(_0x56c00c['RHhcE'](_0x43a12c,'undefined'))return undefined;if(/^-?\d+$/[_0x2c1153(0xb0)](_0x43a12c)){const _0x5031b9=_0x56c00c[_0x2c1153(0xb7)](Number,_0x43a12c);if(Number[_0x2c1153(0x98)](_0x5031b9))return _0x5031b9;}if(/^-?\d+\.\d+$/['test'](_0x43a12c)){const _0x4882fe=Number(_0x43a12c);if(!Number['isNaN'](_0x4882fe))return _0x4882fe;}const _0xa5618d=_0x43a12c[_0x2c1153(0x94)]();if(_0xa5618d[_0x2c1153(0xa1)]('{')&&_0xa5618d[_0x2c1153(0x9f)]('}')||_0xa5618d[_0x2c1153(0xa1)]('[')&&_0xa5618d[_0x2c1153(0x9f)](']'))try{return JSON[_0x2c1153(0x9e)](_0xa5618d);}catch{}return _0x43a12c;}function _0x510c(_0x575810,_0x2e728e){_0x575810=_0x575810-0x8d;const _0x2217f6=_0x2217();let _0x510ce3=_0x2217f6[_0x575810];return _0x510ce3;}async function resolveProfileTarget(_0x2b786a){const _0x5ef43a=_0x168740,_0x107674={'UqQyo':function(_0x283fb1,_0x5bfa0c){return _0x283fb1(_0x5bfa0c);},'HenNc':function(_0x29f4e9,_0xce5b5a){return _0x29f4e9(_0xce5b5a);},'OqcEa':_0x5ef43a(0xae)},_0x24c4f8=existsSync(_0x107674['UqQyo'](getEnvDir,_0x2b786a));let _0x1715a3=![];try{const _0x51b9f5=await fetchCloudProfile(_0x2b786a);_0x1715a3=_0x107674['HenNc'](Boolean,_0x51b9f5);}catch{}if(_0x1715a3)return{'kind':_0x5ef43a(0x8d),'alsoExistsElsewhere':_0x24c4f8};if(_0x24c4f8)return{'kind':_0x107674['OqcEa'],'alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x2b786a+'\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'+_0x2b786a);}function printDualExistsHint(_0xb9f4eb){const _0x2b8deb=_0x168740;console['log'](_0x2b8deb(0x9a)+_0xb9f4eb+'\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.');}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x80ed0){const _0x4d00df={'bAcbW':function(_0x295f24,_0x5a4acd){return _0x295f24??_0x5a4acd;}},_0x402d26=await fetchCloudProfile(_0x80ed0),_0x501d31=readProfileOverrides(getProjectPath(),_0x80ed0);return mergeCloudProfileSettings(_0x402d26?.['settings']??{},_0x4d00df['bAcbW'](_0x501d31,undefined));}export async function configSet(_0x1e16af,_0x47d16c,_0x2de9f4){const _0x4a3d11=_0x168740,_0x26337a={'UwFTh':function(_0x449af1,_0x3118f2){return _0x449af1(_0x3118f2);},'ynZmE':function(_0x5bb25a,_0x2bb0c4){return _0x5bb25a===_0x2bb0c4;},'VXmwB':_0x4a3d11(0x8d),'LmvoR':function(_0x2f67a1,_0x4a6629){return _0x2f67a1(_0x4a6629);},'tciXz':function(_0x28a0e9){return _0x28a0e9();}},_0x3b94b7=await _0x26337a[_0x4a3d11(0xb4)](resolveProfileTarget,_0x1e16af);if(_0x26337a['ynZmE'](_0x3b94b7['kind'],_0x26337a[_0x4a3d11(0x91)])){if(_0x3b94b7[_0x4a3d11(0xb1)])_0x26337a[_0x4a3d11(0xb4)](printDualExistsHint,_0x1e16af);const _0x46610a=_0x26337a[_0x4a3d11(0xa9)](parseOverrideValue,_0x2de9f4);setProfileOverride(_0x26337a['tciXz'](getProjectPath),_0x1e16af,_0x47d16c,_0x46610a),console[_0x4a3d11(0x8f)]('Set\x20'+_0x47d16c+'\x20=\x20'+JSON[_0x4a3d11(0xac)](_0x46610a)+_0x4a3d11(0xab)+_0x1e16af+'\x22');return;}const _0x30d924=await loadSettings(_0x1e16af),_0x3b95a3=parseLocalValue(_0x47d16c,_0x2de9f4);setNestedValue(_0x30d924,_0x47d16c,_0x3b95a3),await saveSettings(_0x1e16af,_0x30d924),console['log']('Set\x20'+_0x47d16c+_0x4a3d11(0xb8)+_0x3b95a3+'\x20for\x20\x22'+_0x1e16af+'\x22');}export async function configGet(_0x15be3e,_0x49fad1){const _0x299018=_0x168740,_0x57aaba={'KrKpU':function(_0x403933,_0x29a003){return _0x403933(_0x29a003);},'nhXxV':function(_0x7a7497,_0x310943){return _0x7a7497===_0x310943;},'eVRaz':function(_0x2312e6,_0x925a9d){return _0x2312e6===_0x925a9d;}},_0x560efc=await resolveProfileTarget(_0x15be3e);if(_0x560efc['kind']===_0x299018(0x8d)){const _0x269681=await _0x57aaba[_0x299018(0x97)](loadEffectiveCloudSettings,_0x15be3e),_0x5df510=getNestedValue(_0x269681,_0x49fad1);if(_0x57aaba['nhXxV'](_0x5df510,undefined))console['log']('(not\x20set)');else _0x57aaba['nhXxV'](typeof _0x5df510,_0x299018(0xba))?console[_0x299018(0x8f)](JSON[_0x299018(0xac)](_0x5df510,null,0x2)):console[_0x299018(0x8f)](_0x5df510);return;}const _0x572030=await loadSettings(_0x15be3e),_0x5d8ee8=getNestedValue(_0x572030,_0x49fad1);if(_0x57aaba[_0x299018(0xbb)](_0x5d8ee8,undefined))console['log']('(not\x20set)');else _0x57aaba[_0x299018(0x92)](typeof _0x5d8ee8,_0x299018(0xba))?console['log'](JSON['stringify'](_0x5d8ee8,null,0x2)):console[_0x299018(0x8f)](_0x5d8ee8);}export async function configList(_0x1b8442){const _0x5bcd76=_0x168740,_0x5b6894={'watHg':'cloud','JTpBD':function(_0x34574a,_0x369ee9){return _0x34574a(_0x369ee9);},'GOBad':function(_0x1125b2,_0x7b7843){return _0x1125b2===_0x7b7843;}},_0x52bcc5=await resolveProfileTarget(_0x1b8442);if(_0x52bcc5[_0x5bcd76(0xa0)]===_0x5b6894['watHg']){const _0x438527=await _0x5b6894['JTpBD'](loadEffectiveCloudSettings,_0x1b8442);if(!_0x438527||_0x5b6894['GOBad'](Object['keys'](_0x438527)[_0x5bcd76(0xb3)],0x0)){console['log']('No\x20configuration\x20set\x20for\x20\x22'+_0x1b8442+'\x22');return;}console[_0x5bcd76(0x8f)](JSON[_0x5bcd76(0xac)](_0x438527,null,0x2));return;}const _0x386e1b=getSettingsPath(_0x1b8442);if(!_0x5b6894['JTpBD'](existsSync,_0x386e1b)){console['log'](_0x5bcd76(0x9d)+_0x1b8442+'\x22');return;}const _0x4e77f9=await _0x5b6894['JTpBD'](loadSettings,_0x1b8442),_0x4cf706=_0x5b6894['JTpBD'](formatSettings,_0x4e77f9);!_0x4cf706?console[_0x5bcd76(0x8f)](_0x5bcd76(0x9d)+_0x1b8442+'\x22'):console['log'](_0x4cf706);}export async function configUnset(_0x492ac4,_0x2d8885){const _0x593087=_0x168740,_0x5e292b={'CgliY':function(_0x5ba11f,_0x5b1194){return _0x5ba11f(_0x5b1194);},'qjgSo':function(_0x10588a,_0x510fc7){return _0x10588a===_0x510fc7;},'QpzBU':'cloud','HiXEt':function(_0x520121,_0x4ca71f){return _0x520121(_0x4ca71f);},'ZjCbt':function(_0x3c4f33,_0x521183){return _0x3c4f33(_0x521183);}},_0x46628d=await _0x5e292b['CgliY'](resolveProfileTarget,_0x492ac4);if(_0x5e292b[_0x593087(0x95)](_0x46628d[_0x593087(0xa0)],_0x5e292b['QpzBU'])){if(_0x46628d['alsoExistsElsewhere'])_0x5e292b['HiXEt'](printDualExistsHint,_0x492ac4);const _0x16322a=unsetProfileOverride(getProjectPath(),_0x492ac4,_0x2d8885);_0x16322a?console['log'](_0x593087(0x90)+_0x2d8885+_0x593087(0xab)+_0x492ac4+'\x22'):console['log']('Key\x20\x22'+_0x2d8885+'\x22\x20not\x20found');return;}const _0x310b17=await _0x5e292b[_0x593087(0xa4)](loadSettings,_0x492ac4),_0x355c14=deleteNestedValue(_0x310b17,_0x2d8885);_0x355c14?(await saveSettings(_0x492ac4,_0x310b17),console[_0x593087(0x8f)]('Removed\x20'+_0x2d8885)):console[_0x593087(0x8f)](_0x593087(0xaf)+_0x2d8885+'\x22\x20not\x20found');}export async function configReset(_0x5ed315){const _0x484a40=_0x168740,_0x35cd2a={'DXFMV':function(_0x4b8420,_0x1c6987){return _0x4b8420(_0x1c6987);},'vpuuq':function(_0x4cf8ee,_0x361ce8,_0x16bea4){return _0x4cf8ee(_0x361ce8,_0x16bea4);},'MhhpK':function(_0x342c2a){return _0x342c2a();}},_0x5c1833=await _0x35cd2a['DXFMV'](resolveProfileTarget,_0x5ed315);if(_0x5c1833[_0x484a40(0xa0)]==='cloud'){_0x35cd2a['vpuuq'](resetProfileOverrides,_0x35cd2a['MhhpK'](getProjectPath),_0x5ed315),console[_0x484a40(0x8f)](_0x484a40(0x96)+_0x5ed315+'\x22');return;}console[_0x484a40(0x8f)]('\x22'+_0x5ed315+'\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20'+_0x5ed315+'\x20<key>\x22\x20to\x20remove\x20individual\x20values.');}
|
|
1
|
+
(function(_0xfc6844,_0x443eaf){const _0x43f1f6=_0x28f8,_0x4eecc0=_0xfc6844();while(!![]){try{const _0x326450=parseInt(_0x43f1f6(0x193))/0x1+-parseInt(_0x43f1f6(0x199))/0x2+parseInt(_0x43f1f6(0x1b9))/0x3+parseInt(_0x43f1f6(0x1ae))/0x4*(parseInt(_0x43f1f6(0x19b))/0x5)+-parseInt(_0x43f1f6(0x19d))/0x6+parseInt(_0x43f1f6(0x1b8))/0x7*(parseInt(_0x43f1f6(0x1af))/0x8)+-parseInt(_0x43f1f6(0x196))/0x9;if(_0x326450===_0x443eaf)break;else _0x4eecc0['push'](_0x4eecc0['shift']());}catch(_0x378bf3){_0x4eecc0['push'](_0x4eecc0['shift']());}}}(_0x28a4,0x7aa2e));import{existsSync}from'fs';import{loadSettings,saveSettings,getNestedValue,setNestedValue,deleteNestedValue,formatSettings,getSettingsPath,getEnvDir}from'./utils/settings.js';function _0x28a4(){const _0x5f8741=['JRoFY','No\x20configuration\x20set\x20for\x20\x22','MNryu','object','endsWith','\x22\x20is\x20a\x20local\x20profile.\x20Use\x20\x22ranger\x20profile\x20config\x20unset\x20','MbXpe','Removed\x20','\x20<key>\x22\x20to\x20remove\x20individual\x20values.','trim','SFMuw','zABQO','parse','UhJsd','\x20for\x20\x22','false','714628sFvAMB','256424jaiDMT','BcBbC','alsoExistsElsewhere','pJlPn','stringify','(not\x20set)',':\x20expected\x20\x22true\x22\x20or\x20\x22false\x22','VhKBO','ZcmfV','217IEKNpc','2609043AKiSRS','GRUyA','undefined','null','kind','\x22\x20not\x20found','true','test','startsWith','length','isSafeInteger','445637okmOQd','iBOiS','\x20=\x20','11336886GIryXF','raITo','isNaN','1839160KVNPGs','eBjyV','25zSOQaM','log','3124164bGWJDq'];_0x28a4=function(){return _0x5f8741;};return _0x28a4();}import{fetchCloudProfile}from'./utils/cloudProfile.js';import{mergeCloudProfileSettings,readProfileOverrides,resetProfileOverrides,setProfileOverride,unsetProfileOverride}from'./utils/projectsConfig.js';const BOOLEAN_KEYS=['headless','allowInsecureLocalhost'];function parseLocalValue(_0x58f6a9,_0x395b85){const _0x41b30f=_0x28f8,_0x3cafbe={'MxsiS':'true','cTsXg':function(_0x36a488,_0x3913f1){return _0x36a488===_0x3913f1;}};if(BOOLEAN_KEYS['includes'](_0x58f6a9)){if(_0x395b85===_0x3cafbe['MxsiS'])return!![];if(_0x3cafbe['cTsXg'](_0x395b85,'false'))return![];throw new Error('Invalid\x20value\x20for\x20'+_0x58f6a9+_0x41b30f(0x1b5));}return _0x395b85;}function parseOverrideValue(_0x1e3350){const _0x41a277=_0x28f8,_0x2d903e={'WXGhH':_0x41a277(0x18e),'BcBbC':function(_0x11d7cb,_0x2907c6){return _0x11d7cb===_0x2907c6;},'MbXpe':_0x41a277(0x1bc),'wMSkL':_0x41a277(0x1bb),'JRoFY':function(_0x32ad0e,_0x3cd657){return _0x32ad0e(_0x3cd657);}};if(_0x1e3350===_0x2d903e['WXGhH'])return!![];if(_0x2d903e[_0x41a277(0x1b0)](_0x1e3350,_0x41a277(0x1ad)))return![];if(_0x1e3350===_0x2d903e[_0x41a277(0x1a4)])return null;if(_0x1e3350===_0x2d903e['wMSkL'])return undefined;if(/^-?\d+$/[_0x41a277(0x18f)](_0x1e3350)){const _0x3453af=_0x2d903e[_0x41a277(0x19e)](Number,_0x1e3350);if(Number[_0x41a277(0x192)](_0x3453af))return _0x3453af;}if(/^-?\d+\.\d+$/[_0x41a277(0x18f)](_0x1e3350)){const _0x3ed186=Number(_0x1e3350);if(!Number[_0x41a277(0x198)](_0x3ed186))return _0x3ed186;}const _0x5e863f=_0x1e3350[_0x41a277(0x1a7)]();if(_0x5e863f['startsWith']('{')&&_0x5e863f['endsWith']('}')||_0x5e863f[_0x41a277(0x190)]('[')&&_0x5e863f[_0x41a277(0x1a2)](']'))try{return JSON[_0x41a277(0x1aa)](_0x5e863f);}catch{}return _0x1e3350;}async function resolveProfileTarget(_0x27ed56){const _0x223542=_0x28f8,_0x456d37={'eBjyV':function(_0x5157e3,_0x481cbf){return _0x5157e3(_0x481cbf);},'GRUyA':'local'},_0x226707=existsSync(getEnvDir(_0x27ed56));let _0x514865=![];try{const _0x500caa=await _0x456d37[_0x223542(0x19a)](fetchCloudProfile,_0x27ed56);_0x514865=_0x456d37[_0x223542(0x19a)](Boolean,_0x500caa);}catch{}if(_0x514865)return{'kind':'cloud','alsoExistsElsewhere':_0x226707};if(_0x226707)return{'kind':_0x456d37[_0x223542(0x1ba)],'alsoExistsElsewhere':![]};throw new Error('Profile\x20\x22'+_0x27ed56+'\x22\x20does\x20not\x20exist.\x20Run:\x20ranger\x20profile\x20add\x20'+_0x27ed56);}function printDualExistsHint(_0x4454b1){const _0x16ebec=_0x28f8;console[_0x16ebec(0x19c)]('\x20\x20Note:\x20\x22'+_0x4454b1+'\x22\x20also\x20exists\x20as\x20a\x20local\x20profile;\x20editing\x20the\x20cloud\x20profile.');}function getProjectPath(){return process['cwd']();}async function loadEffectiveCloudSettings(_0x3f3e38){const _0x45bf87={'hdKlA':function(_0x2ff1bf,_0xe1794e,_0x4db5ef){return _0x2ff1bf(_0xe1794e,_0x4db5ef);},'cFnLa':function(_0x1d3093,_0x59cd4b){return _0x1d3093??_0x59cd4b;}},_0x45a73b=await fetchCloudProfile(_0x3f3e38),_0x46570a=_0x45bf87['hdKlA'](readProfileOverrides,getProjectPath(),_0x3f3e38);return mergeCloudProfileSettings(_0x45a73b?.['settings']??{},_0x45bf87['cFnLa'](_0x46570a,undefined));}export async function configSet(_0x50c95f,_0x5f119b,_0x222c67){const _0x4c7dfd=_0x28f8,_0x4ad217={'KUMoL':function(_0x246d0e,_0x6610cb){return _0x246d0e(_0x6610cb);},'IdZWV':function(_0x3e28ba,_0x13ec7f){return _0x3e28ba===_0x13ec7f;},'kSwOL':function(_0x3a6635,_0xfc842e){return _0x3a6635(_0xfc842e);},'PySQL':function(_0x2c5938,_0x386e07,_0xf52731,_0x1ad612,_0x2b7e52){return _0x2c5938(_0x386e07,_0xf52731,_0x1ad612,_0x2b7e52);},'SUQlX':function(_0x70db0f){return _0x70db0f();},'MNryu':function(_0x5ab2a5,_0x991f6e,_0x4b6579){return _0x5ab2a5(_0x991f6e,_0x4b6579);}},_0x2b207e=await _0x4ad217['KUMoL'](resolveProfileTarget,_0x50c95f);if(_0x4ad217['IdZWV'](_0x2b207e['kind'],'cloud')){if(_0x2b207e['alsoExistsElsewhere'])_0x4ad217['kSwOL'](printDualExistsHint,_0x50c95f);const _0x4bd502=parseOverrideValue(_0x222c67);_0x4ad217['PySQL'](setProfileOverride,_0x4ad217['SUQlX'](getProjectPath),_0x50c95f,_0x5f119b,_0x4bd502),console[_0x4c7dfd(0x19c)]('Set\x20'+_0x5f119b+_0x4c7dfd(0x195)+JSON[_0x4c7dfd(0x1b3)](_0x4bd502)+_0x4c7dfd(0x1ac)+_0x50c95f+'\x22');return;}const _0x5945dc=await _0x4ad217['KUMoL'](loadSettings,_0x50c95f),_0x5ca594=parseLocalValue(_0x5f119b,_0x222c67);setNestedValue(_0x5945dc,_0x5f119b,_0x5ca594),await _0x4ad217[_0x4c7dfd(0x1a0)](saveSettings,_0x50c95f,_0x5945dc),console['log']('Set\x20'+_0x5f119b+_0x4c7dfd(0x195)+_0x5ca594+_0x4c7dfd(0x1ac)+_0x50c95f+'\x22');}export async function configGet(_0x5e9108,_0xce98d7){const _0x3158af=_0x28f8,_0x10ea7f={'iBOiS':function(_0xc7f07a,_0x55df3b){return _0xc7f07a===_0x55df3b;},'YGCob':'cloud','raITo':function(_0x4325fd,_0x581bed){return _0x4325fd(_0x581bed);},'DhcJS':function(_0x354a78,_0x1552fb,_0xb8ae34){return _0x354a78(_0x1552fb,_0xb8ae34);},'eRCNO':_0x3158af(0x1a1),'EiprP':function(_0x46dd90,_0x7628c2){return _0x46dd90(_0x7628c2);}},_0x1800fd=await resolveProfileTarget(_0x5e9108);if(_0x10ea7f['iBOiS'](_0x1800fd[_0x3158af(0x1bd)],_0x10ea7f['YGCob'])){const _0x3aeb9f=await _0x10ea7f[_0x3158af(0x197)](loadEffectiveCloudSettings,_0x5e9108),_0x61b93a=_0x10ea7f['DhcJS'](getNestedValue,_0x3aeb9f,_0xce98d7);if(_0x61b93a===undefined)console[_0x3158af(0x19c)](_0x3158af(0x1b4));else _0x10ea7f['iBOiS'](typeof _0x61b93a,_0x10ea7f['eRCNO'])?console[_0x3158af(0x19c)](JSON[_0x3158af(0x1b3)](_0x61b93a,null,0x2)):console['log'](_0x61b93a);return;}const _0x1782c5=await _0x10ea7f['EiprP'](loadSettings,_0x5e9108),_0x1bec42=getNestedValue(_0x1782c5,_0xce98d7);if(_0x10ea7f['iBOiS'](_0x1bec42,undefined))console[_0x3158af(0x19c)]('(not\x20set)');else _0x10ea7f[_0x3158af(0x194)](typeof _0x1bec42,_0x3158af(0x1a1))?console['log'](JSON['stringify'](_0x1bec42,null,0x2)):console[_0x3158af(0x19c)](_0x1bec42);}function _0x28f8(_0x4d70fe,_0x175981){_0x4d70fe=_0x4d70fe-0x18d;const _0x28a405=_0x28a4();let _0x28f87e=_0x28a405[_0x4d70fe];return _0x28f87e;}export async function configList(_0x1a9d28){const _0x33adc1=_0x28f8,_0x5e0aeb={'zABQO':function(_0x2135c3,_0x22c7d1){return _0x2135c3(_0x22c7d1);},'CoCVP':function(_0x2a0c2e,_0x340218){return _0x2a0c2e===_0x340218;},'ZcmfV':'cloud'},_0x6de389=await _0x5e0aeb['zABQO'](resolveProfileTarget,_0x1a9d28);if(_0x5e0aeb['CoCVP'](_0x6de389['kind'],_0x5e0aeb[_0x33adc1(0x1b7)])){const _0x387b3e=await _0x5e0aeb[_0x33adc1(0x1a9)](loadEffectiveCloudSettings,_0x1a9d28);if(!_0x387b3e||Object['keys'](_0x387b3e)[_0x33adc1(0x191)]===0x0){console['log'](_0x33adc1(0x19f)+_0x1a9d28+'\x22');return;}console['log'](JSON['stringify'](_0x387b3e,null,0x2));return;}const _0x440f7b=_0x5e0aeb[_0x33adc1(0x1a9)](getSettingsPath,_0x1a9d28);if(!existsSync(_0x440f7b)){console[_0x33adc1(0x19c)](_0x33adc1(0x19f)+_0x1a9d28+'\x22');return;}const _0x598083=await _0x5e0aeb['zABQO'](loadSettings,_0x1a9d28),_0x253a68=formatSettings(_0x598083);!_0x253a68?console['log'](_0x33adc1(0x19f)+_0x1a9d28+'\x22'):console['log'](_0x253a68);}export async function configUnset(_0x2e6ce1,_0x4b7c25){const _0x4a81ef=_0x28f8,_0x141ccf={'ARRWP':function(_0x5496e7,_0x3a39a5){return _0x5496e7(_0x3a39a5);},'pahLy':function(_0x234b55,_0x160c33){return _0x234b55(_0x160c33);},'UhJsd':function(_0xb06311){return _0xb06311();},'VhKBO':function(_0x1e2b91,_0x307873){return _0x1e2b91(_0x307873);},'EmMIj':function(_0x44a52e,_0x31ffdc,_0x2d3e67){return _0x44a52e(_0x31ffdc,_0x2d3e67);}},_0xe4dde5=await _0x141ccf['ARRWP'](resolveProfileTarget,_0x2e6ce1);if(_0xe4dde5['kind']==='cloud'){if(_0xe4dde5[_0x4a81ef(0x1b1)])_0x141ccf['pahLy'](printDualExistsHint,_0x2e6ce1);const _0x41f172=unsetProfileOverride(_0x141ccf[_0x4a81ef(0x1ab)](getProjectPath),_0x2e6ce1,_0x4b7c25);_0x41f172?console['log'](_0x4a81ef(0x1a5)+_0x4b7c25+'\x20for\x20\x22'+_0x2e6ce1+'\x22'):console[_0x4a81ef(0x19c)]('Key\x20\x22'+_0x4b7c25+_0x4a81ef(0x18d));return;}const _0x41fa03=await _0x141ccf[_0x4a81ef(0x1b6)](loadSettings,_0x2e6ce1),_0x15f8cf=deleteNestedValue(_0x41fa03,_0x4b7c25);_0x15f8cf?(await _0x141ccf['EmMIj'](saveSettings,_0x2e6ce1,_0x41fa03),console['log']('Removed\x20'+_0x4b7c25)):console['log']('Key\x20\x22'+_0x4b7c25+'\x22\x20not\x20found');}export async function configReset(_0x140f2c){const _0x3b4647=_0x28f8,_0x44e9c0={'iEpwG':function(_0x2267ed,_0x97c368){return _0x2267ed===_0x97c368;},'pJlPn':'cloud','SFMuw':function(_0x46de71,_0x3d69aa,_0x8ac8a6){return _0x46de71(_0x3d69aa,_0x8ac8a6);},'SqFyN':function(_0x1085c8){return _0x1085c8();}},_0x5a74e0=await resolveProfileTarget(_0x140f2c);if(_0x44e9c0['iEpwG'](_0x5a74e0[_0x3b4647(0x1bd)],_0x44e9c0[_0x3b4647(0x1b2)])){_0x44e9c0[_0x3b4647(0x1a8)](resetProfileOverrides,_0x44e9c0['SqFyN'](getProjectPath),_0x140f2c),console[_0x3b4647(0x19c)]('Cleared\x20local\x20overrides\x20for\x20\x22'+_0x140f2c+'\x22');return;}console['log']('\x22'+_0x140f2c+_0x3b4647(0x1a3)+_0x140f2c+_0x3b4647(0x1a6));}
|
package/build/commands/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x27cf60,_0x23b00a){const _0xa4002c=_0x259b,_0x529f9a=_0x27cf60();while(!![]){try{const _0x14722a=parseInt(_0xa4002c(0x1b8))/0x1+parseInt(_0xa4002c(0x1a5))/0x2+parseInt(_0xa4002c(0x1a1))/0x3*(-parseInt(_0xa4002c(0x1b2))/0x4)+parseInt(_0xa4002c(0x19f))/0x5+-parseInt(_0xa4002c(0x1ad))/0x6+-parseInt(_0xa4002c(0x1b6))/0x7+parseInt(_0xa4002c(0x1c2))/0x8;if(_0x14722a===_0x23b00a)break;else _0x529f9a['push'](_0x529f9a['shift']());}catch(_0x45ffb1){_0x529f9a['push'](_0x529f9a['shift']());}}}(_0x236a,0x1d2d3));import{readdir,stat}from'fs/promises';function _0x259b(_0x33a7c0,_0x23e71d){_0x33a7c0=_0x33a7c0-0x19e;const _0x236aa8=_0x236a();let _0x259b44=_0x236aa8[_0x33a7c0];return _0x259b44;}import{join}from'path';import{existsSync}from'fs';import{getRangerDir}from'./utils/rangerRoot.js';import{loadSettings}from'./utils/settings.js';import{readActiveProfileName}from'./utils/activeProfile.js';import{listCloudProfiles}from'./utils/cloudProfile.js';const NON_ENV_DIRS=['sessions','bug-bashes','reports','local','ci'];export async function getEnvNames(){const _0x3e69d0=_0x259b,_0xd58a8f={'HNhJq':function(_0x366c5c,_0x5d9ec3){return _0x366c5c(_0x5d9ec3);},'JBiZI':function(_0x5de2ba){return _0x5de2ba();},'olTgc':_0x3e69d0(0x1b3),'jXJVp':function(_0x4e541f,_0x5bb4c7){return _0x4e541f(_0x5bb4c7);},'DEXIO':function(_0x4bad0a,_0x3bd0c5){return _0x4bad0a(_0x3bd0c5);},'CsrbJ':function(_0x157757,_0x535cd2,_0x2c83f2){return _0x157757(_0x535cd2,_0x2c83f2);},'lWkan':function(_0x3a68a3,_0x172a5d,_0x25eb01){return _0x3a68a3(_0x172a5d,_0x25eb01);},'Jylik':'legacy'},_0x1dfc93=getRangerDir();if(!_0xd58a8f[_0x3e69d0(0x1b4)](existsSync,_0x1dfc93))return{'envNames':[],'activeEnv':null,'envTypes':{}};const _0x236f2b=await _0xd58a8f['JBiZI'](readActiveProfileName),_0x52acd4=[],_0x148a04={},_0x426f1b=join(_0x1dfc93,_0xd58a8f['olTgc']);if(_0xd58a8f['jXJVp'](existsSync,_0x426f1b)){const _0x494977=await readdir(_0x426f1b);for(const _0xeb7776 of _0x494977){const _0x5f59f5=join(_0x426f1b,_0xeb7776),_0x437f57=await stat(_0x5f59f5);_0x437f57['isDirectory']()&&(_0x52acd4['push'](_0xeb7776),_0x148a04[_0xeb7776]=_0xd58a8f['olTgc']);}}const _0x2638ee=join(_0x1dfc93,'ci');if(_0xd58a8f['HNhJq'](existsSync,_0x2638ee)){const _0x4a5b76=await readdir(_0x2638ee);for(const _0x1c4f7b of _0x4a5b76){const _0x26d7c8=join(_0x2638ee,_0x1c4f7b),_0x368b3c=await _0xd58a8f['DEXIO'](stat,_0x26d7c8);_0x368b3c['isDirectory']()&&(_0x52acd4[_0x3e69d0(0x1a9)](_0x1c4f7b),_0x148a04[_0x1c4f7b]='ci');}}const _0x1f9ec1=await _0xd58a8f['HNhJq'](readdir,_0x1dfc93);for(const _0x4819d2 of _0x1f9ec1){if(NON_ENV_DIRS[_0x3e69d0(0x1b1)](_0x4819d2))continue;if(_0x4819d2['startsWith']('.'))continue;if(_0x4819d2['endsWith'](_0x3e69d0(0x1bb)))continue;const _0x377f91=_0xd58a8f[_0x3e69d0(0x1a6)](join,_0x1dfc93,_0x4819d2),_0x2a00be=await stat(_0x377f91);_0x2a00be['isDirectory']()&&_0xd58a8f[_0x3e69d0(0x1b9)](existsSync,_0xd58a8f[_0x3e69d0(0x1a4)](join,_0x377f91,'settings.json'))&&(!_0x52acd4['includes'](_0x4819d2)&&(_0x52acd4[_0x3e69d0(0x1a9)](_0x4819d2),_0x148a04[_0x4819d2]=_0xd58a8f['Jylik']));}return{'envNames':_0x52acd4,'activeEnv':_0x236f2b,'envTypes':_0x148a04};}export async function envList(){const _0x46543c=_0x259b,_0x240a28={'kwTwN':function(_0x296580){return _0x296580();},'FNhUY':function(_0x43c8af,_0x450655){return _0x43c8af===_0x450655;},'imkpG':'\x0aNo\x20profiles\x20found.','kUqzt':_0x46543c(0x1ae),'XZODZ':'\x0aLocal\x20Profiles:','hVawG':_0x46543c(0x1b3),'SBMBl':'legacy','IIANh':function(_0x282f5e,_0x45087f){return _0x282f5e>_0x45087f;}},{envNames:_0xb5d78d,activeEnv:_0x35bcef,envTypes:_0x57cfd0}=await _0x240a28['kwTwN'](getEnvNames);let _0x245eb9=[];try{_0x245eb9=await _0x240a28[_0x46543c(0x1ba)](listCloudProfiles);}catch{}if(_0xb5d78d[_0x46543c(0x1ab)]===0x0&&_0x240a28[_0x46543c(0x1bd)](_0x245eb9['length'],0x0)){console['log'](_0x240a28['imkpG']),console[_0x46543c(0x1c1)](_0x240a28[_0x46543c(0x1b5)]);return;}const _0x109d4e=new Set(_0x245eb9[_0x46543c(0x1b7)](_0x398d84=>_0x398d84[_0x46543c(0x1a8)]));if(_0xb5d78d['length']>0x0){console['log'](_0x240a28['XZODZ']);for(const _0x1e2279 of _0xb5d78d['sort']()){const _0xc84058=_0x1e2279===_0x35bcef&&!_0x109d4e[_0x46543c(0x1aa)](_0x1e2279),_0x27947c=_0x57cfd0[_0x1e2279]||_0x240a28[_0x46543c(0x1a3)],_0xc3959f=await loadSettings(_0x1e2279),_0x558f70=_0x240a28[_0x46543c(0x1bd)](_0x27947c,_0x240a28[_0x46543c(0x1af)])?'':'\x20['+_0x27947c+']';console['log']('\x20\x20'+(_0xc84058?'*\x20':'\x20\x20')+_0x1e2279+_0x558f70),_0xc3959f[_0x46543c(0x1c0)]&&console[_0x46543c(0x1c1)]('\x20\x20\x20\x20\x20\x20URL:\x20'+_0xc3959f[_0x46543c(0x1c0)]),_0xc3959f['environmentDetails']&&console['log'](_0x46543c(0x1a2)+_0xc3959f[_0x46543c(0x19e)]);}}if(_0x240a28['IIANh'](_0x245eb9['length'],0x0)){console[_0x46543c(0x1c1)](_0x46543c(0x1bf));for(const _0x5096a4 of _0x245eb9[_0x46543c(0x1a0)]((_0x1bdb8f,_0x2d134e)=>_0x1bdb8f['name']['localeCompare'](_0x2d134e['name']))){const _0x1b01b8=_0x240a28[_0x46543c(0x1bd)](_0x5096a4['name'],_0x35bcef),_0x38e63b=_0x5096a4[_0x46543c(0x1ac)]?'\x20('+_0x5096a4[_0x46543c(0x1ac)]+')':'',_0x285302=_0x5096a4[_0x46543c(0x1be)]?'cached\x20(updated\x20'+_0x5096a4['sessionUpdatedAt']+')':_0x46543c(0x1b0);console[_0x46543c(0x1c1)]('\x20\x20'+(_0x1b01b8?'*\x20':'\x20\x20')+_0x5096a4['name']+'\x20[cloud]'+_0x38e63b),console['log'](_0x46543c(0x1bc)+_0x285302);}}_0x35bcef&&console[_0x46543c(0x1c1)](_0x46543c(0x1a7));}function _0x236a(){const _0x4decf1=['.txt','\x20\x20\x20\x20\x20\x20Session:\x20','FNhUY','sessionUpdatedAt','\x0aCloud\x20Profiles:','baseUrl','log','519248gSjvON','environmentDetails','790775oJJTZf','sort','3VpjAJb','\x20\x20\x20\x20\x20\x20Details:\x20','hVawG','lWkan','315490kKvcsy','CsrbJ','\x0a*\x20=\x20active\x20profile','name','push','has','length','environmentKey','1163556fhZnlY','Run:\x20ranger\x20profile\x20add\x20<profile-name>','SBMBl','no\x20session','includes','376988uGUgdT','local','HNhJq','kUqzt','898072BRhdEa','map','155170NaTaNV','DEXIO','kwTwN'];_0x236a=function(){return _0x4decf1;};return _0x236a();}
|