@ranger-testing/ranger-cli 3.0.1-alpha.aab0a1c-26 → 3.0.1-alpha.c0b290b-36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/novaActCli.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/organizationEnvApi.js +1 -0
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/rangerwrightCli.js +1 -0
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/tunnelClient.js +1 -0
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/commands/verifyFeatureNovaCli.js +1 -1
- package/build/commands/verifyFeatureRangerwrightCli.js +1 -0
- package/package.json +5 -2
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x28d003,_0x51e2bc){const _0x44065b=_0x4a1a,_0x2a899a=_0x28d003();while(!![]){try{const _0x58e26b=-parseInt(_0x44065b(0x179))/0x1*(parseInt(_0x44065b(0x176))/0x2)+parseInt(_0x44065b(0x178))/0x3+-parseInt(_0x44065b(0x17e))/0x4+parseInt(_0x44065b(0x172))/0x5+-parseInt(_0x44065b(0x17b))/0x6*(-parseInt(_0x44065b(0x173))/0x7)+-parseInt(_0x44065b(0x181))/0x8*(parseInt(_0x44065b(0x175))/0x9)+-parseInt(_0x44065b(0x182))/0xa;if(_0x58e26b===_0x51e2bc)break;else _0x2a899a['push'](_0x2a899a['shift']());}catch(_0x3b4037){_0x2a899a['push'](_0x2a899a['shift']());}}}(_0x5528,0x5831f));function _0x4a1a(_0x16c2ea,_0x6509a1){_0x16c2ea=_0x16c2ea-0x172;const _0x552880=_0x5528();let _0x4a1acf=_0x552880[_0x16c2ea];return _0x4a1acf;}import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0x19f24f=_0x4a1a,_0x38c797={'wSFeG':function(_0x3b01f3){return _0x3b01f3();},'TUBVe':function(_0x5535c3){return _0x5535c3();},'kGMdw':function(_0x529ddd,_0x1c6c6f){return _0x529ddd(_0x1c6c6f);}},_0x13a91e=await getMcpAuthOrigin();if(_0x13a91e){console['log'](_0x19f24f(0x174)),await _0x38c797[_0x19f24f(0x180)](mcpBootstrap);return;}if(!_0x38c797[_0x19f24f(0x17c)](isInteractive))throw new Error(_0x19f24f(0x177));try{const _0x22ec25=await runDeviceAuthFlow(),_0x47996c=await _0x38c797['kGMdw'](getCurrentUser,_0x22ec25);_0x47996c['success']?console['log'](_0x19f24f(0x17a)+_0x47996c[_0x19f24f(0x184)][_0x19f24f(0x17d)]):console['log'](_0x19f24f(0x17f));}catch(_0x4877f9){throw new Error(_0x19f24f(0x183)+(_0x4877f9 instanceof Error?_0x4877f9['message']:_0x4877f9));}}function _0x5528(){const _0x1df594=['TUBVe','organizationName','1720264RziqZO','\x0a✅\x20API\x20key\x20stored\x20successfully','wSFeG','8pQFKeX','1086980RrCAnG','Login\x20failed:\x20','user','2803410OYjswq','175JiEOzQ','Re-authenticating\x20via\x20MCP\x20bootstrap...','34407ahSqzu','932034rVIZVO','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','357432GCeVyJ','1YNSDTI','\x0a✅\x20Logged\x20in\x20to\x20','165606bkcwYL'];_0x5528=function(){return _0x1df594;};return _0x5528();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x419226=_0x5ecb;(function(_0x539b40,_0x40f1f0){const _0x5bd845=_0x5ecb,_0xda3602=_0x539b40();while(!![]){try{const _0x47f1d2=parseInt(_0x5bd845(0x148))/0x1+parseInt(_0x5bd845(0x10f))/0x2*(-parseInt(_0x5bd845(0x146))/0x3)+-parseInt(_0x5bd845(0x11a))/0x4*(-parseInt(_0x5bd845(0xbb))/0x5)+parseInt(_0x5bd845(0x10a))/0x6+-parseInt(_0x5bd845(0x133))/0x7+parseInt(_0x5bd845(0x150))/0x8*(parseInt(_0x5bd845(0x111))/0x9)+-parseInt(_0x5bd845(0x10e))/0xa*(-parseInt(_0x5bd845(0xe4))/0xb);if(_0x47f1d2===_0x40f1f0)break;else _0xda3602['push'](_0xda3602['shift']());}catch(_0x179560){_0xda3602['push'](_0xda3602['shift']());}}}(_0x1596,0xb2940));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger',_0x419226(0x12d)),AUTH_ORIGIN_PATH=join(homedir(),_0x419226(0xd3),_0x419226(0x102));export async function getMcpAuthOrigin(){const _0xfc1d31=_0x419226;try{const _0x316c5e=(await readFile(AUTH_ORIGIN_PATH,'utf-8'))[_0xfc1d31(0x127)]();return _0x316c5e||null;}catch{return null;}}export async function mcpBootstrap(){const _0x2ecbc4=_0x419226,_0x407733={'kxCvF':function(_0x48dc62,_0x8eae1d){return _0x48dc62(_0x8eae1d);},'pgVry':_0x2ecbc4(0xc7),'sBIus':function(_0x20a8a4,_0x12d6ef){return _0x20a8a4(_0x12d6ef);}},_0x514931=getMcpAuthUrl();currentOrigin=_0x514931;const _0x22cc9b=process['stdout'][_0x2ecbc4(0xd4)]??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x514931+'\x0a');const _0x4b4ba8=await _0x407733['kxCvF'](tryUnauthenticated,_0x514931);let _0x3b5ab8=null;if(_0x4b4ba8===_0x2ecbc4(0x131))_0x3b5ab8='';else{_0x3b5ab8=await loadCachedToken();if(!_0x3b5ab8){if(!_0x22cc9b)throw new Error(_0x407733[_0x2ecbc4(0xd8)]+'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.');_0x3b5ab8=await _0x407733['sBIus'](oauthFlow,_0x514931);}}await callGetCliToken(_0x514931,_0x3b5ab8);}async function tryUnauthenticated(_0x3aa773){const _0x35b0b3=_0x419226,_0x4decd6={'DWifG':_0x35b0b3(0x106),'yhajD':'application/json','xDElL':_0x35b0b3(0xea),'qBDwj':_0x35b0b3(0xdb),'WOOvI':_0x35b0b3(0x114),'aBmbF':'ranger-cli','cWsWN':_0x35b0b3(0xfd),'JRHIz':_0x35b0b3(0x131)},_0x78b92e=await fetch(_0x3aa773,{'method':_0x4decd6[_0x35b0b3(0x147)],'headers':{'Content-Type':_0x4decd6['yhajD'],'Accept':_0x4decd6[_0x35b0b3(0xe0)]},'body':JSON[_0x35b0b3(0x101)]({'jsonrpc':_0x4decd6['qBDwj'],'id':0x1,'method':_0x4decd6[_0x35b0b3(0xc4)],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x4decd6['aBmbF'],'version':_0x4decd6['cWsWN']}}})});if(_0x78b92e['ok'])return await _0x78b92e[_0x35b0b3(0xeb)](),_0x4decd6['JRHIz'];if(_0x78b92e['status']===0x191)return await _0x78b92e[_0x35b0b3(0xeb)](),'needs-oauth';const _0x5b3cef=await _0x78b92e[_0x35b0b3(0xeb)]();throw new Error(_0x35b0b3(0x112)+_0x78b92e[_0x35b0b3(0x140)]+':\x20'+_0x5b3cef);}function _0x1596(){const _0x256285=['utf-8','split','eCYtL','token','.ranger','isTTY','<html><body><h2>Authentication\x20failed</h2><p>','none','nnFcz','pgVry','now','HTTP\x20','2.0','replace','client_secret','client_id','sqUJO','xDElL','HMNOM','Ranger\x20CLI','write','33mWFwfi','platform','expiresAt','searchParams','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','FwlZs','application/json,\x20text/event-stream','text','type','rKJod','MCP\x20initialize\x20failed:\x20','SWnjR','application/x-www-form-urlencoded','WPTQE','bDhMH','open','sBEnw','\x0aUnexpected\x20response\x20structure:','content','content-type','then','oYoHR','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','opnzg','match','1.0.0','string','access_token','code','stringify','auth-origin.txt','OaGlp','tools/call','Discovering\x20authorization\x20server...','POST','xVirB','\x0aOpening\x20browser\x20for\x20authentication...','VkXzp','2726790ntRnmk','Initializing\x20MCP\x20session...','MptHM','kSaLs','1956330hNyzzc','2vRfjkd','bGgVQ','522BOwHrA','MCP\x20server\x20returned\x20HTTP\x20','qIVYK','initialize','accessToken','OAuth\x20error:\x20','slice','clientId','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','884616LypmUt','text/html','parse','url','CNSgQ','VJkLk','/callback','KBFLI','refresh_token','start','igxsf','writeHead','Requesting\x20CLI\x20token...','trim','omGyz','XHjfD','Tqcwi','RugcX','\x20done','mcp-oauth-tokens.json','origin','expires_in','resource','proxied','toString','9695476YwNsMc','data:','sha256','JqLQm','http://localhost:','application/json','S256','set','get_cli_token\x20failed:\x20','AFARq','NrZcL','stdout','error','status','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','Authorization','PzooR','result','nbnYC','3398757SHExuZ','DWifG','626825uwplFN','127.0.0.1','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','code_challenge','Token\x20exchange\x20failed:\x20','clientSecret','qeXgN','digest','157096YRdvJV','WzPUy','OhDzR','sOqsm','10wcFndr','log','qLuMP','dfhYS','error_description','kTuoS','bUXgw','sfrqr','get','WOOvI','end','authorization_servers','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','state','code_challenge_method','mVGst','length','text/event-stream','\x0aToken\x20written\x20to\x20','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found'];_0x1596=function(){return _0x256285;};return _0x1596();}class OAuthTimeoutError extends Error{constructor(_0x43fcb3){const _0x1b6a1d=_0x419226,_0x36b176={'MptHM':'OAuthTimeoutError'};super(_0x43fcb3),this['name']=_0x36b176[_0x1b6a1d(0x10c)];}}async function oauthFlow(_0xa17684){const _0x2e4fd8={'meCNz':function(_0xdc3606){return _0xdc3606();},'rbYbD':function(_0x1c0b67){return _0x1c0b67();}};try{return await oauthFlowAttempt(_0xa17684);}catch(_0x2385a0){if(_0x2385a0 instanceof OAuthTimeoutError&&await _0x2e4fd8['meCNz'](loadCachedClient))return console['log']('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await _0x2e4fd8['rbYbD'](clearCachedClient),await oauthFlowAttempt(_0xa17684);throw _0x2385a0;}}async function oauthFlowAttempt(_0x2cbbc){const _0x13d536=_0x419226,_0x428edd={'VkXzp':function(_0x18a0a5,_0xcf4e5e){return _0x18a0a5(_0xcf4e5e);},'RugcX':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','igxsf':'POST','bGgVQ':_0x13d536(0x138),'MnbHZ':_0x13d536(0xe2),'faXzD':_0x13d536(0xd6),'WPTQE':_0x13d536(0xce),'AFARq':'base64url','oPNdp':'client_id','oYoHR':'redirect_uri','kTuoS':_0x13d536(0xc9),'gTBhS':_0x13d536(0x130),'rvgOz':function(_0x145916,_0x466bc0){return _0x145916(_0x466bc0);},'Tqcwi':'Exchanging\x20authorization\x20code...','GPIeC':'authorization_code','WzPUy':function(_0x4ba49b,_0x3768cb,_0x5a5b65){return _0x4ba49b(_0x3768cb,_0x5a5b65);},'XIdTG':_0x13d536(0xf0),'sfrqr':function(_0x127d7f,_0x2e4f79,_0x3ba3ac,_0x16ce71){return _0x127d7f(_0x2e4f79,_0x3ba3ac,_0x16ce71);}},_0x487511=_0x2cbbc[_0x13d536(0xdc)](/\/mcp$/,'');process[_0x13d536(0x13e)]['write'](_0x13d536(0x105));const _0x35eaf1=await _0x428edd['VkXzp'](fetch,_0x487511+'/.well-known/oauth-protected-resource');if(!_0x35eaf1['ok'])throw new Error(_0x428edd[_0x13d536(0x12b)]);const _0x2010c5=await _0x35eaf1['json'](),_0x29a08c=_0x2010c5[_0x13d536(0xc6)]?.[0x0];if(!_0x29a08c)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console['log']('\x20'+_0x29a08c);const _0x502b13=await _0x428edd[_0x13d536(0x109)](fetchAuthServerMetadata,_0x29a08c);let _0x249c92,_0x489945;const _0x3b5236=await loadCachedClient();if(_0x3b5236)_0x249c92=_0x3b5236[_0x13d536(0x118)],_0x489945=_0x3b5236[_0x13d536(0x14d)];else{if(_0x502b13['registration_endpoint']){process[_0x13d536(0x13e)]['write']('Registering\x20OAuth\x20client...');const _0x5c3c83=await fetch(_0x502b13['registration_endpoint'],{'method':_0x428edd[_0x13d536(0x124)],'headers':{'Content-Type':_0x428edd[_0x13d536(0x110)]},'body':JSON['stringify']({'client_name':_0x428edd['MnbHZ'],'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x13d536(0x120)],'grant_types':['authorization_code',_0x13d536(0x122)],'response_types':[_0x13d536(0x100)],'token_endpoint_auth_method':_0x428edd['faXzD']})});if(!_0x5c3c83['ok']){const _0x4516d4=await _0x5c3c83['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x4516d4);}const _0x1d8e9b=await _0x5c3c83['json']();_0x249c92=_0x1d8e9b[_0x13d536(0xde)],_0x489945=_0x1d8e9b['client_secret'],await saveCachedClient(_0x249c92,_0x489945),console[_0x13d536(0xbc)](_0x13d536(0x12c));}else throw new Error(_0x428edd[_0x13d536(0xf1)]);}const _0x1eedb1=randomBytes(0x20)['toString'](_0x428edd[_0x13d536(0x13c)]),_0x4fa6b4=createHash(_0x13d536(0x135))['update'](_0x1eedb1)[_0x13d536(0x14f)]('base64url'),_0x416285=randomBytes(0x10)[_0x13d536(0x132)]('hex'),_0x19af95=new URL(_0x502b13['authorization_endpoint']);_0x19af95[_0x13d536(0xe7)]['set']('response_type',_0x13d536(0x100)),_0x19af95[_0x13d536(0xe7)]['set'](_0x428edd['oPNdp'],_0x249c92),_0x19af95['searchParams']['set'](_0x428edd[_0x13d536(0xf9)],'http://localhost:'+CALLBACK_PORT+_0x13d536(0x120)),_0x19af95[_0x13d536(0xe7)]['set'](_0x13d536(0x14b),_0x4fa6b4),_0x19af95[_0x13d536(0xe7)][_0x13d536(0x13a)](_0x428edd[_0x13d536(0xc0)],_0x13d536(0x139)),_0x19af95[_0x13d536(0xe7)]['set'](_0x13d536(0xc8),_0x416285);_0x2010c5['resource']&&_0x19af95['searchParams']['set'](_0x428edd['gTBhS'],_0x2010c5['resource']);console[_0x13d536(0xbc)](_0x13d536(0x108)),console['log'](_0x13d536(0xe8)+_0x19af95[_0x13d536(0x132)]()+'\x0a'),await _0x428edd['rvgOz'](openBrowser,_0x19af95['toString']());const _0x453349=await _0x428edd[_0x13d536(0x109)](waitForCallback,_0x416285);process[_0x13d536(0x13e)][_0x13d536(0xe3)](_0x428edd[_0x13d536(0x12a)]);const _0x11a78d=new URLSearchParams({'grant_type':_0x428edd['GPIeC'],'code':_0x453349,'redirect_uri':_0x13d536(0x137)+CALLBACK_PORT+'/callback','client_id':_0x249c92,'code_verifier':_0x1eedb1});_0x489945&&_0x11a78d[_0x13d536(0x13a)](_0x13d536(0xdd),_0x489945);_0x2010c5[_0x13d536(0x130)]&&_0x11a78d['set'](_0x13d536(0x130),_0x2010c5[_0x13d536(0x130)]);const _0x5bf7f2=await _0x428edd[_0x13d536(0xb8)](fetch,_0x502b13['token_endpoint'],{'method':_0x428edd['igxsf'],'headers':{'Content-Type':_0x428edd['XIdTG']},'body':_0x11a78d});if(!_0x5bf7f2['ok']){const _0x4a5a55=await _0x5bf7f2['text']();throw new Error(_0x13d536(0x14c)+_0x4a5a55);}const _0x109a1f=await _0x5bf7f2['json']();return console[_0x13d536(0xbc)](_0x13d536(0x12c)),await _0x428edd[_0x13d536(0xc2)](saveCachedToken,_0x109a1f[_0x13d536(0xff)],_0x109a1f['refresh_token'],_0x109a1f[_0x13d536(0x12f)]),_0x109a1f['access_token'];}async function callGetCliToken(_0x2df49e,_0x31c25d){const _0x109e60=_0x419226,_0x4c6fbb={'OaGlp':function(_0x3c1635,_0x425ed2){return _0x3c1635(_0x425ed2);},'FwlZs':_0x109e60(0x138),'zUTrv':_0x109e60(0x10b),'nbnYC':_0x109e60(0xdb),'xLkDp':'2025-03-26','SWnjR':'\x20done','Yraec':function(_0x3d45ef,_0x430ce3,_0x31c380){return _0x3d45ef(_0x430ce3,_0x31c380);},'CNSgQ':_0x109e60(0x106),'pCXFN':'notifications/initialized','xwVxv':_0x109e60(0x126),'omGyz':_0x109e60(0x104),'pfOhz':'get_cli_token','NrZcL':_0x109e60(0x14a),'sYBuV':'.ranger','sOqsm':function(_0x16edff,_0x41fd13,_0x1c11f8){return _0x16edff(_0x41fd13,_0x1c11f8);},'mVGst':function(_0x105ed2,_0x3d8082,_0x589c1d,_0x5964a4){return _0x105ed2(_0x3d8082,_0x589c1d,_0x5964a4);}},_0x135900={'Content-Type':_0x4c6fbb[_0x109e60(0xe9)],'Accept':'application/json,\x20text/event-stream'};_0x31c25d&&(_0x135900[_0x109e60(0x142)]='Bearer\x20'+_0x31c25d);const _0x28be52=async _0x528d71=>{const _0x737dab=_0x109e60,_0x52bfb4=await fetch(_0x2df49e,{'method':_0x737dab(0x106),'headers':_0x135900,'body':JSON[_0x737dab(0x101)](_0x528d71)});if(!_0x52bfb4['ok']){const _0x7ff4cf=await _0x52bfb4[_0x737dab(0xeb)]();throw new Error(_0x737dab(0xda)+_0x52bfb4[_0x737dab(0x140)]+':\x20'+_0x7ff4cf);}return _0x4c6fbb['OaGlp'](parseResponse,_0x52bfb4);};process['stdout']['write'](_0x4c6fbb['zUTrv']);const _0x2701e8=await _0x4c6fbb[_0x109e60(0x103)](_0x28be52,{'jsonrpc':_0x4c6fbb['nbnYC'],'id':0x1,'method':_0x109e60(0x114),'params':{'protocolVersion':_0x4c6fbb['xLkDp'],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x109e60(0xfd)}}});if(_0x2701e8['error'])throw new Error(_0x109e60(0xee)+(_0x2701e8[_0x109e60(0x13f)]['message']??JSON['stringify'](_0x2701e8[_0x109e60(0x13f)])));console[_0x109e60(0xbc)](_0x4c6fbb[_0x109e60(0xef)]),await _0x4c6fbb['Yraec'](fetch,_0x2df49e,{'method':_0x4c6fbb[_0x109e60(0x11e)],'headers':_0x135900,'body':JSON['stringify']({'jsonrpc':_0x4c6fbb[_0x109e60(0x145)],'method':_0x4c6fbb['pCXFN']})})[_0x109e60(0xf8)](_0x10db3a=>_0x10db3a[_0x109e60(0xeb)]()),process[_0x109e60(0x13e)]['write'](_0x4c6fbb['xwVxv']);const _0x34213a=await _0x28be52({'jsonrpc':_0x4c6fbb[_0x109e60(0x145)],'id':0x2,'method':_0x4c6fbb[_0x109e60(0x128)],'params':{'name':_0x4c6fbb['pfOhz'],'arguments':{}}});if(_0x34213a[_0x109e60(0x13f)])throw new Error(_0x109e60(0x13b)+(_0x34213a['error']['message']??JSON['stringify'](_0x34213a[_0x109e60(0x13f)])));console[_0x109e60(0xbc)](_0x4c6fbb['SWnjR']);const _0x25c418=_0x4c6fbb['OaGlp'](extractToken,_0x34213a[_0x109e60(0x144)]);if(!_0x25c418){console[_0x109e60(0x13f)](_0x109e60(0xf5)),console['error'](JSON['stringify'](_0x34213a[_0x109e60(0x144)],null,0x2));throw new Error(_0x4c6fbb[_0x109e60(0x13d)]);}const _0x3f67c2=join(homedir(),_0x4c6fbb['sYBuV']),_0x387fa5=_0x4c6fbb[_0x109e60(0xba)](join,_0x3f67c2,'refresh.txt');await _0x4c6fbb['Yraec'](mkdir,_0x3f67c2,{'recursive':!![]}),await _0x4c6fbb[_0x109e60(0xca)](writeFile,_0x387fa5,_0x25c418,{'mode':0x180}),await _0x4c6fbb['mVGst'](writeFile,join(_0x3f67c2,_0x109e60(0x102)),_0x2df49e,{'mode':0x180}),console['log'](_0x109e60(0xcd)+_0x387fa5),console[_0x109e60(0xbc)]('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0x1225d5){const _0x3a86f5=_0x419226,_0x3ad2d1={'PzooR':function(_0x3afdad,_0x2ef28a){return _0x3afdad(_0x2ef28a);}},_0x156c64=_0x1225d5+'/.well-known/oauth-authorization-server',_0x27cfb2=await _0x3ad2d1[_0x3a86f5(0x143)](fetch,_0x156c64);if(!_0x27cfb2['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x156c64+':\x20'+_0x27cfb2[_0x3a86f5(0x140)]);return _0x27cfb2['json']();}function waitForCallback(_0x26d86b){const _0x5b4ba3=_0x419226,_0x439ba1={'sqUJO':function(_0x10ce80,_0x564f55){return _0x10ce80(_0x564f55);},'TFHvZ':'code','qIVYK':'state','rKJod':_0x5b4ba3(0x13f),'JqLQm':function(_0xb10b55){return _0xb10b55();},'XHjfD':function(_0x26831c,_0x3ef3e2){return _0x26831c!==_0x3ef3e2;},'xVirB':'text/html','OhDzR':_0x5b4ba3(0x119),'kSaLs':_0x5b4ba3(0xfa),'eCYtL':function(_0x3e256f,_0x186202){return _0x3e256f(_0x186202);},'krrfi':_0x5b4ba3(0x149)};return new Promise((_0x1ba979,_0xdc7bfd)=>{const _0x3fa886=()=>{_0x56cf4f['closeAllConnections'](),_0x56cf4f['close']();},_0x2adab1=setTimeout(()=>{_0x3fa886(),_0x439ba1['sqUJO'](_0xdc7bfd,new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x56cf4f=_0x439ba1['eCYtL'](createServer,(_0x499843,_0x52977d)=>{const _0x1c2f3f=_0x5ecb,_0x4fb961=new URL(_0x499843[_0x1c2f3f(0x11d)]??'/',_0x1c2f3f(0x137)+CALLBACK_PORT);if(_0x4fb961['pathname']!==_0x1c2f3f(0x120)){_0x52977d['writeHead'](0x194),_0x52977d['end']('Not\x20found');return;}const _0x1bbb97=_0x4fb961[_0x1c2f3f(0xe7)][_0x1c2f3f(0xc3)](_0x439ba1['TFHvZ']),_0x2132c9=_0x4fb961['searchParams'][_0x1c2f3f(0xc3)](_0x439ba1[_0x1c2f3f(0x113)]),_0xad35c6=_0x4fb961['searchParams']['get'](_0x439ba1[_0x1c2f3f(0xed)]);if(_0xad35c6){const _0x34ffc9=_0x4fb961['searchParams'][_0x1c2f3f(0xc3)](_0x1c2f3f(0xbf))??_0xad35c6;_0x52977d[_0x1c2f3f(0x125)](0xc8,{'Content-Type':_0x1c2f3f(0x11b)}),_0x52977d['end'](_0x1c2f3f(0xd5)+_0x34ffc9+_0x1c2f3f(0x141)),clearTimeout(_0x2adab1),_0x439ba1['JqLQm'](_0x3fa886),_0xdc7bfd(new Error(_0x1c2f3f(0x116)+_0x34ffc9));return;}if(!_0x1bbb97||_0x439ba1[_0x1c2f3f(0x129)](_0x2132c9,_0x26d86b)){_0x52977d[_0x1c2f3f(0x125)](0x190,{'Content-Type':_0x439ba1[_0x1c2f3f(0x107)]}),_0x52977d['end'](_0x439ba1[_0x1c2f3f(0xb9)]);return;}_0x52977d['writeHead'](0xc8,{'Content-Type':'text/html'}),_0x52977d[_0x1c2f3f(0xc5)](_0x439ba1[_0x1c2f3f(0x10d)]),_0x439ba1[_0x1c2f3f(0xd1)](clearTimeout,_0x2adab1),_0x439ba1[_0x1c2f3f(0x136)](_0x3fa886),_0x439ba1[_0x1c2f3f(0xdf)](_0x1ba979,_0x1bbb97);});_0x56cf4f['listen'](CALLBACK_PORT,_0x439ba1['krrfi']);});}async function openBrowser(_0x317f9f){const _0x47a63d=_0x419226,_0x404ffb={'xmtDZ':function(_0x3e5f04,_0x207b87){return _0x3e5f04===_0x207b87;},'HMNOM':_0x47a63d(0xf3),'VJkLk':function(_0x298099,_0x122a1d){return _0x298099===_0x122a1d;},'iWAgF':'win32','pQeUA':function(_0x26b849,_0x24427d){return _0x26b849(_0x24427d);}},_0x27ac39=_0x404ffb['xmtDZ'](process['platform'],'darwin')?_0x404ffb[_0x47a63d(0xe1)]:_0x404ffb[_0x47a63d(0x11f)](process[_0x47a63d(0xe5)],_0x404ffb['iWAgF'])?_0x47a63d(0x123):'xdg-open';_0x404ffb['pQeUA'](exec,_0x27ac39+'\x20\x22'+_0x317f9f+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x219d92=_0x419226;try{const _0x4bef85=JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x219d92(0xcf)));if(_0x4bef85['origin']&&_0x4bef85['origin']!==currentOrigin)return null;if(_0x4bef85[_0x219d92(0xe6)]&&Date['now']()>_0x4bef85['expiresAt'])return null;return _0x4bef85['accessToken']??null;}catch{return null;}}function _0x5ecb(_0x5eb244,_0x4dce5b){_0x5eb244=_0x5eb244-0xb8;const _0x1596e0=_0x1596();let _0x5ecb89=_0x1596e0[_0x5eb244];return _0x5ecb89;}async function saveCachedToken(_0x5b9ec8,_0x145c9a,_0x405de1){const _0x19a184=_0x419226,_0x56f443={'VkoKB':function(_0x39afff){return _0x39afff();},'JqxZw':function(_0x2e83d1,_0x475b59){return _0x2e83d1+_0x475b59;},'opnzg':function(_0x48e363,_0x4bb431,_0x4df4ca){return _0x48e363(_0x4bb431,_0x4df4ca);},'bUXgw':function(_0x5b63ca,_0x47be41,_0x71f73b){return _0x5b63ca(_0x47be41,_0x71f73b);}},_0x39c1cc=await _0x56f443['VkoKB'](loadCachedData),_0x34385a={..._0x39c1cc,'origin':currentOrigin,'accessToken':_0x5b9ec8,'refreshToken':_0x145c9a??_0x39c1cc?.['refreshToken'],'expiresAt':_0x405de1?_0x56f443['JqxZw'](Date[_0x19a184(0xd9)](),_0x405de1*0x3e8):undefined};await _0x56f443[_0x19a184(0xfb)](mkdir,_0x56f443[_0x19a184(0xc1)](join,homedir(),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x34385a),{'mode':0x180});}async function loadCachedClient(){const _0x3bd032=_0x419226,_0x402e22={'zDLbf':function(_0x3b2928,_0x19bda8){return _0x3b2928!==_0x19bda8;}},_0x3591f0=await loadCachedData();if(_0x3591f0?.[_0x3bd032(0x12e)]&&_0x402e22['zDLbf'](_0x3591f0[_0x3bd032(0x12e)],currentOrigin))return null;return _0x3591f0?.[_0x3bd032(0x118)]?{'clientId':_0x3591f0[_0x3bd032(0x118)],'clientSecret':_0x3591f0['clientSecret']}:null;}async function clearCachedClient(){const _0x5ea2da=_0x419226,_0xd5d20={'KBFLI':function(_0x5acfa1){return _0x5acfa1();},'sBEnw':function(_0x1a1fd1,_0x3af8dd,_0xc307df,_0x5697e0){return _0x1a1fd1(_0x3af8dd,_0xc307df,_0x5697e0);}},_0x81871d=await _0xd5d20[_0x5ea2da(0x121)](loadCachedData);if(!_0x81871d)return;const {clientId:_0xf76226,clientSecret:_0x553b03,..._0x37bc81}=_0x81871d;await _0xd5d20[_0x5ea2da(0xf4)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x37bc81),{'mode':0x180});}async function saveCachedClient(_0x37a205,_0x14f156){const _0x95087a=_0x419226,_0x297667={'nnFcz':function(_0x4ea97f,_0x7fb692,_0x2adbd1){return _0x4ea97f(_0x7fb692,_0x2adbd1);},'APIvl':function(_0x4563be,_0x456778,_0x2e7466,_0xa65035){return _0x4563be(_0x456778,_0x2e7466,_0xa65035);}},_0x2ab262=await loadCachedData(),_0x3f0048={..._0x2ab262,'origin':currentOrigin,'accessToken':_0x2ab262?.[_0x95087a(0x115)]??'','clientId':_0x37a205,'clientSecret':_0x14f156};await _0x297667[_0x95087a(0xd7)](mkdir,_0x297667['nnFcz'](join,homedir(),_0x95087a(0xd3)),{'recursive':!![]}),await _0x297667['APIvl'](writeFile,TOKEN_CACHE_PATH,JSON[_0x95087a(0x101)](_0x3f0048),{'mode':0x180});}async function loadCachedData(){const _0x200f66=_0x419226,_0x5129b4={'bDhMH':function(_0x12d437,_0x19c88e,_0x216c65){return _0x12d437(_0x19c88e,_0x216c65);}};try{return JSON[_0x200f66(0x11c)](await _0x5129b4[_0x200f66(0xf2)](readFile,TOKEN_CACHE_PATH,'utf-8'));}catch{return null;}}async function parseResponse(_0x3cc469){const _0x2da24d=_0x419226,_0x599d50={'qLuMP':_0x2da24d(0xf7),'JVDgT':'data:','LKySh':function(_0x4566e2,_0x3346c1){return _0x4566e2!==_0x3346c1;},'dfhYS':'No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream'},_0x4e1b02=_0x3cc469['headers'][_0x2da24d(0xc3)](_0x599d50[_0x2da24d(0xbd)])??'';if(_0x4e1b02['includes'](_0x2da24d(0xcc))){const _0x46cf0c=await _0x3cc469['text']();for(const _0x3601b7 of _0x46cf0c[_0x2da24d(0xd0)]('\x0a')){const _0xb65e1a=_0x3601b7[_0x2da24d(0x127)]();if(_0xb65e1a['startsWith'](_0x2da24d(0x134))){const _0x490dee=_0xb65e1a[_0x2da24d(0x117)](_0x599d50['JVDgT'][_0x2da24d(0xcb)])[_0x2da24d(0x127)]();if(!_0x490dee)continue;try{const _0x23d50a=JSON[_0x2da24d(0x11c)](_0x490dee);if(_0x599d50['LKySh'](_0x23d50a['id'],undefined)||_0x23d50a[_0x2da24d(0x13f)])return _0x23d50a;}catch{}}}throw new Error(_0x599d50[_0x2da24d(0xbe)]);}return _0x3cc469['json']();}function extractToken(_0x1dac99){const _0x2001f6=_0x419226,_0x48fa4c={'qeXgN':'Unknown\x20error','LVrwS':function(_0x3f95a9,_0x59060c){return _0x3f95a9===_0x59060c;},'IiEZQ':_0x2001f6(0xfe)};if(!_0x1dac99)return null;const _0x4ea8db=_0x1dac99['structuredContent'];if(_0x4ea8db?.['token']&&typeof _0x4ea8db[_0x2001f6(0xd2)]==='string')return _0x4ea8db['token'];if(_0x1dac99['isError']){const _0x5ee303=_0x1dac99[_0x2001f6(0xf6)];throw new Error('Server\x20returned\x20error:\x20'+(_0x5ee303?.[0x0]?.[_0x2001f6(0xeb)]??_0x48fa4c[_0x2001f6(0x14e)]));}const _0x24b598=_0x1dac99['content'];if(_0x24b598)for(const _0x4b8bd8 of _0x24b598){if(_0x48fa4c['LVrwS'](_0x4b8bd8[_0x2001f6(0xec)],_0x2001f6(0xeb))&&_0x4b8bd8['text']){try{const _0x1ac476=JSON['parse'](_0x4b8bd8['text']);if(typeof _0x1ac476?.[_0x2001f6(0xd2)]===_0x48fa4c['IiEZQ'])return _0x1ac476['token'];}catch{}const _0x107277=_0x4b8bd8['text'][_0x2001f6(0xfc)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x107277)return _0x107277[0x1];}}return null;}
|
|
1
|
+
const _0x130e48=_0x37c6;(function(_0x4c0314,_0xf37bb5){const _0x47c2f7=_0x37c6,_0x508769=_0x4c0314();while(!![]){try{const _0xe119de=parseInt(_0x47c2f7(0xda))/0x1*(parseInt(_0x47c2f7(0x107))/0x2)+-parseInt(_0x47c2f7(0xd1))/0x3*(-parseInt(_0x47c2f7(0xde))/0x4)+parseInt(_0x47c2f7(0xdb))/0x5*(-parseInt(_0x47c2f7(0xdc))/0x6)+-parseInt(_0x47c2f7(0xbb))/0x7+-parseInt(_0x47c2f7(0xb7))/0x8*(parseInt(_0x47c2f7(0x11e))/0x9)+-parseInt(_0x47c2f7(0xf5))/0xa+parseInt(_0x47c2f7(0x9f))/0xb*(parseInt(_0x47c2f7(0xf3))/0xc);if(_0xe119de===_0xf37bb5)break;else _0x508769['push'](_0x508769['shift']());}catch(_0x441422){_0x508769['push'](_0x508769['shift']());}}}(_0x15c0,0xa0aa3));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';function _0x15c0(){const _0xa89671=['proxied','expires_in','trim','gCDUV','POST','GlLBy','code','string','XfQNU','application/json,\x20text/event-stream','237992ShNbuW','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','1.0.0','set','7791007NoXOWS','ymQAf','token','type','gQHda','Authorization','stdout','ODTIy','BLtdl','iwvvJ','client_id','resource','MCP\x20server\x20returned\x20HTTP\x20','authorization_code','result','base64url','refresh_token','expiresAt','parse','text','tools/call','/.well-known/oauth-protected-resource','9niUHVx','state','token_endpoint','auQOs','SUjPq','notifications/initialized','Not\x20found','qrJFB','headers','34231CCPoTK','170WxxfHp','57648MrgQaN','127.0.0.1','1377536BFSqBO','get','rFgIq','error_description','qbDxp','HGoNO','writeHead','refreshToken','rQyuy','Exchanging\x20authorization\x20code...','platform','origin','stringify','log','none','sha256','data:','application/json','listen','.ranger','message','1836FgYfnn','oEijt','12089520UQTlGY','clientSecret','bqWyG','access_token','LBxuj','Qwvnb','\x20done','searchParams','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','write','now','auth-origin.txt','\x0aOpening\x20browser\x20for\x20authentication...','win32','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','wCMVy','match','thuAw','66aslOzp','json','2.0','dzbal','text/html','YvRyj','error','/callback','code_challenge','clientId','MuQGU','toString','znbPj','AlBuH','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','registration_endpoint','HrHtX','Initializing\x20MCP\x20session...','qOlol','UmDTG','isTTY','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','HTTP\x20','27AWQuDB','Ranger\x20CLI','get_cli_token','lUyEp','client_secret','YqBpv','\x0aToken\x20written\x20to\x20','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','pathname','name','Registering\x20OAuth\x20client...','TWFxA','oCVJy','includes','bfiui','\x0aUnexpected\x20response\x20structure:','isError','MCP\x20initialize\x20failed:\x20','end','fYFNR','http://localhost:','88660biSXKE','utf-8','ucgLN','status','KDSdm','jHWgA','NBNJM','Requesting\x20CLI\x20token...','wywTn','authorization_servers','response_type','slice','<html><body><h2>Authentication\x20failed</h2><p>','lwkzC'];_0x15c0=function(){return _0xa89671;};return _0x15c0();}const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),_0x130e48(0xf1),'auth-origin.txt');export async function getMcpAuthOrigin(){const _0x3012d2=_0x130e48,_0xaec417={'pXdcF':function(_0x2ed65d,_0x4f58bb){return _0x2ed65d||_0x4f58bb;}};try{const _0x55cdf8=(await readFile(AUTH_ORIGIN_PATH,'utf-8'))[_0x3012d2(0xaf)]();return _0xaec417['pXdcF'](_0x55cdf8,null);}catch{return null;}}export async function mcpBootstrap(){const _0x2494e6=_0x130e48,_0x31dd1c={'dlMPs':function(_0x19b93e){return _0x19b93e();},'cebnw':function(_0x528b96,_0x39bba9){return _0x528b96===_0x39bba9;},'qrJFB':'proxied','wCMVy':function(_0x2f3cf0){return _0x2f3cf0();},'OTPOw':function(_0x540e92,_0x4e8a3d){return _0x540e92+_0x4e8a3d;},'iVkVe':_0x2494e6(0x91),'lNkCc':function(_0x1650f1,_0x25e8a2,_0x1e7ba6){return _0x1650f1(_0x25e8a2,_0x1e7ba6);}},_0x49f22a=_0x31dd1c['dlMPs'](getMcpAuthUrl);currentOrigin=_0x49f22a;const _0x35eec8=process[_0x2494e6(0xc1)][_0x2494e6(0x11b)]??![];console[_0x2494e6(0xeb)](_0x2494e6(0xb8)+_0x49f22a+'\x0a');const _0x3c87b2=await tryUnauthenticated(_0x49f22a);let _0x388b72=null;if(_0x31dd1c['cebnw'](_0x3c87b2,_0x31dd1c[_0x2494e6(0xd8)]))_0x388b72='';else{_0x388b72=await _0x31dd1c[_0x2494e6(0x104)](loadCachedToken);if(!_0x388b72){if(!_0x35eec8)throw new Error(_0x31dd1c['OTPOw'](_0x2494e6(0xfd),_0x31dd1c['iVkVe']));_0x388b72=await oauthFlow(_0x49f22a);}}await _0x31dd1c['lNkCc'](callGetCliToken,_0x49f22a,_0x388b72);}async function tryUnauthenticated(_0x41a056){const _0x23656b=_0x130e48,_0x14972e={'YdpHc':'POST','jMNoD':_0x23656b(0x109),'NBNJM':'initialize','VEGEq':'ranger-cli','qOlol':function(_0x360010,_0x314d5e){return _0x360010===_0x314d5e;}},_0xe45e46=await fetch(_0x41a056,{'method':_0x14972e['YdpHc'],'headers':{'Content-Type':_0x23656b(0xef),'Accept':'application/json,\x20text/event-stream'},'body':JSON['stringify']({'jsonrpc':_0x14972e['jMNoD'],'id':0x1,'method':_0x14972e[_0x23656b(0xa5)],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x14972e['VEGEq'],'version':'1.0.0'}}})});if(_0xe45e46['ok'])return await _0xe45e46[_0x23656b(0xce)](),_0x23656b(0xad);if(_0x14972e[_0x23656b(0x119)](_0xe45e46['status'],0x191))return await _0xe45e46['text'](),'needs-oauth';const _0x105da9=await _0xe45e46[_0x23656b(0xce)]();throw new Error(_0x23656b(0xc7)+_0xe45e46['status']+':\x20'+_0x105da9);}class OAuthTimeoutError extends Error{constructor(_0xcdcc86){const _0x146bfe=_0x130e48,_0x48c7a8={'thuAw':'OAuthTimeoutError'};super(_0xcdcc86),this[_0x146bfe(0x93)]=_0x48c7a8[_0x146bfe(0x106)];}}async function oauthFlow(_0x318cb8){const _0x30b60b={'cKtov':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'};try{return await oauthFlowAttempt(_0x318cb8);}catch(_0x439905){if(_0x439905 instanceof OAuthTimeoutError&&await loadCachedClient())return console['log'](_0x30b60b['cKtov']),await clearCachedClient(),await oauthFlowAttempt(_0x318cb8);throw _0x439905;}}async function oauthFlowAttempt(_0xa4afd7){const _0x2b8241=_0x130e48,_0x53461a={'nSccq':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','ZPykV':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','lwkzC':function(_0x2d3517,_0x599c2e){return _0x2d3517(_0x599c2e);},'SUjPq':function(_0x3e7ee3){return _0x3e7ee3();},'fYFNR':_0x2b8241(0x94),'GlLBy':_0x2b8241(0xcb),'wywTn':'code','qVJQj':function(_0x3ce60e,_0x2364ab,_0x5cd100){return _0x3ce60e(_0x2364ab,_0x5cd100);},'ucgLN':'\x20done','TWFxA':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','thUBT':'base64url','bFmmH':function(_0x3622c6,_0x4cff23){return _0x3622c6(_0x4cff23);},'aqZDt':_0x2b8241(0xed),'HGoNO':function(_0x1e9185,_0x2f04c8){return _0x1e9185(_0x2f04c8);},'gqRsF':_0x2b8241(0xa9),'cegUc':'redirect_uri','iKggt':_0x2b8241(0xd2),'dadMj':function(_0x47143c,_0x4e3787){return _0x47143c(_0x4e3787);},'lUyEp':_0x2b8241(0xc8),'rJDYM':'resource','dzbal':_0x2b8241(0xb1),'bfiui':'application/x-www-form-urlencoded'},_0x12b532=_0xa4afd7['replace'](/\/mcp$/,'');process[_0x2b8241(0xc1)][_0x2b8241(0xfe)]('Discovering\x20authorization\x20server...');const _0x5c5e14=await fetch(_0x12b532+_0x2b8241(0xd0));if(!_0x5c5e14['ok'])throw new Error(_0x53461a['nSccq']);const _0x2e56f3=await _0x5c5e14[_0x2b8241(0x108)](),_0x56bd37=_0x2e56f3[_0x2b8241(0xa8)]?.[0x0];if(!_0x56bd37)throw new Error(_0x53461a['ZPykV']);console['log']('\x20'+_0x56bd37);const _0x231dc3=await _0x53461a[_0x2b8241(0xac)](fetchAuthServerMetadata,_0x56bd37);let _0xeba8ad,_0x2a3b57;const _0x1e362a=await _0x53461a[_0x2b8241(0xd5)](loadCachedClient);if(_0x1e362a)_0xeba8ad=_0x1e362a[_0x2b8241(0x110)],_0x2a3b57=_0x1e362a['clientSecret'];else{if(_0x231dc3['registration_endpoint']){process['stdout']['write'](_0x53461a[_0x2b8241(0x9d)]);const _0x480b32=await fetch(_0x231dc3[_0x2b8241(0x116)],{'method':'POST','headers':{'Content-Type':_0x2b8241(0xef)},'body':JSON[_0x2b8241(0xea)]({'client_name':_0x2b8241(0x11f),'redirect_uris':[_0x2b8241(0x9e)+CALLBACK_PORT+'/callback'],'grant_types':[_0x2b8241(0xc8),_0x53461a[_0x2b8241(0xb2)]],'response_types':[_0x53461a[_0x2b8241(0xa7)]],'token_endpoint_auth_method':_0x2b8241(0xec)})});if(!_0x480b32['ok']){const _0x3cdb40=await _0x480b32[_0x2b8241(0xce)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x3cdb40);}const _0x15b840=await _0x480b32['json']();_0xeba8ad=_0x15b840[_0x2b8241(0xc5)],_0x2a3b57=_0x15b840[_0x2b8241(0x122)],await _0x53461a['qVJQj'](saveCachedClient,_0xeba8ad,_0x2a3b57),console[_0x2b8241(0xeb)](_0x53461a[_0x2b8241(0xa1)]);}else throw new Error(_0x53461a[_0x2b8241(0x95)]);}const _0x4cb6a9=_0x53461a['lwkzC'](randomBytes,0x20)[_0x2b8241(0x112)](_0x53461a['thUBT']),_0x4ff2d1=_0x53461a['bFmmH'](createHash,_0x53461a['aqZDt'])['update'](_0x4cb6a9)['digest'](_0x2b8241(0xca)),_0x4140bb=_0x53461a['HGoNO'](randomBytes,0x10)['toString']('hex'),_0x1f6374=new URL(_0x231dc3['authorization_endpoint']);_0x1f6374['searchParams']['set'](_0x53461a['gqRsF'],_0x2b8241(0xb3)),_0x1f6374[_0x2b8241(0xfc)][_0x2b8241(0xba)]('client_id',_0xeba8ad),_0x1f6374['searchParams']['set'](_0x53461a['cegUc'],'http://localhost:'+CALLBACK_PORT+'/callback'),_0x1f6374[_0x2b8241(0xfc)][_0x2b8241(0xba)](_0x2b8241(0x10f),_0x4ff2d1),_0x1f6374[_0x2b8241(0xfc)]['set']('code_challenge_method','S256'),_0x1f6374['searchParams']['set'](_0x53461a['iKggt'],_0x4140bb);_0x2e56f3['resource']&&_0x1f6374['searchParams']['set'](_0x2b8241(0xc6),_0x2e56f3[_0x2b8241(0xc6)]);console[_0x2b8241(0xeb)](_0x2b8241(0x101)),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x1f6374['toString']()+'\x0a'),await _0x53461a[_0x2b8241(0xe3)](openBrowser,_0x1f6374[_0x2b8241(0x112)]());const _0x397184=await _0x53461a['dadMj'](waitForCallback,_0x4140bb);process['stdout']['write'](_0x2b8241(0xe7));const _0x203d2e=new URLSearchParams({'grant_type':_0x53461a[_0x2b8241(0x121)],'code':_0x397184,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0xeba8ad,'code_verifier':_0x4cb6a9});_0x2a3b57&&_0x203d2e[_0x2b8241(0xba)](_0x2b8241(0x122),_0x2a3b57);_0x2e56f3['resource']&&_0x203d2e['set'](_0x53461a['rJDYM'],_0x2e56f3['resource']);const _0x1f6e0b=await fetch(_0x231dc3[_0x2b8241(0xd3)],{'method':_0x53461a[_0x2b8241(0x10a)],'headers':{'Content-Type':_0x53461a[_0x2b8241(0x98)]},'body':_0x203d2e});if(!_0x1f6e0b['ok']){const _0x4e9f0d=await _0x1f6e0b['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0x4e9f0d);}const _0x6e231b=await _0x1f6e0b[_0x2b8241(0x108)]();return console[_0x2b8241(0xeb)](_0x2b8241(0xfb)),await saveCachedToken(_0x6e231b['access_token'],_0x6e231b['refresh_token'],_0x6e231b[_0x2b8241(0xae)]),_0x6e231b[_0x2b8241(0xf8)];}async function callGetCliToken(_0x24124e,_0x551189){const _0x235ceb=_0x130e48,_0x19b534={'GoIox':function(_0x5beada,_0xf622b5,_0x47c365){return _0x5beada(_0xf622b5,_0x47c365);},'jHWgA':'application/json','iwvvJ':function(_0x5cf5c7,_0x5a1671){return _0x5cf5c7(_0x5a1671);},'rFgIq':_0x235ceb(0x109),'zjblg':'2025-03-26','KDSdm':'ranger-cli','znbPj':_0x235ceb(0xb9),'HrHtX':_0x235ceb(0xb1),'xCVDF':_0x235ceb(0xd6),'bppDd':_0x235ceb(0xa6),'rCtom':_0x235ceb(0xcf),'nxoWW':_0x235ceb(0x120),'JRJxH':_0x235ceb(0x99),'DNYOl':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','MuQGU':function(_0x2e809c){return _0x2e809c();},'ttDyj':function(_0x325b02,_0x501241,_0x2bd54b){return _0x325b02(_0x501241,_0x2bd54b);},'YvRyj':'refresh.txt','UmDTG':function(_0x2c5b53,_0x1f4626,_0x358ce4){return _0x2c5b53(_0x1f4626,_0x358ce4);},'ODTIy':function(_0x410514,_0x49ca01,_0x5e7cfc,_0x388adb){return _0x410514(_0x49ca01,_0x5e7cfc,_0x388adb);},'pBjMx':'Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a'},_0x31e93c={'Content-Type':_0x19b534[_0x235ceb(0xa4)],'Accept':_0x235ceb(0xb6)};_0x551189&&(_0x31e93c[_0x235ceb(0xc0)]='Bearer\x20'+_0x551189);const _0x4656fe=async _0x4ec375=>{const _0x445725=_0x235ceb,_0x3e8682=await _0x19b534['GoIox'](fetch,_0x24124e,{'method':'POST','headers':_0x31e93c,'body':JSON['stringify'](_0x4ec375)});if(!_0x3e8682['ok']){const _0x2d9543=await _0x3e8682[_0x445725(0xce)]();throw new Error(_0x445725(0x11d)+_0x3e8682[_0x445725(0xa2)]+':\x20'+_0x2d9543);}return parseResponse(_0x3e8682);};process[_0x235ceb(0xc1)]['write'](_0x235ceb(0x118));const _0x21e6ba=await _0x19b534[_0x235ceb(0xc4)](_0x4656fe,{'jsonrpc':_0x19b534[_0x235ceb(0xe0)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x19b534['zjblg'],'capabilities':{},'clientInfo':{'name':_0x19b534[_0x235ceb(0xa3)],'version':_0x19b534[_0x235ceb(0x113)]}}});if(_0x21e6ba['error'])throw new Error(_0x235ceb(0x9b)+(_0x21e6ba['error'][_0x235ceb(0xf2)]??JSON['stringify'](_0x21e6ba['error'])));console['log'](_0x235ceb(0xfb)),await fetch(_0x24124e,{'method':_0x19b534[_0x235ceb(0x117)],'headers':_0x31e93c,'body':JSON['stringify']({'jsonrpc':_0x19b534[_0x235ceb(0xe0)],'method':_0x19b534['xCVDF']})})['then'](_0xf433b5=>_0xf433b5['text']()),process[_0x235ceb(0xc1)][_0x235ceb(0xfe)](_0x19b534['bppDd']);const _0x35e9bb=await _0x4656fe({'jsonrpc':'2.0','id':0x2,'method':_0x19b534['rCtom'],'params':{'name':_0x19b534['nxoWW'],'arguments':{}}});if(_0x35e9bb['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x35e9bb['error'][_0x235ceb(0xf2)]??JSON[_0x235ceb(0xea)](_0x35e9bb['error'])));console['log']('\x20done');const _0x1049c9=_0x19b534['iwvvJ'](extractToken,_0x35e9bb[_0x235ceb(0xc9)]);if(!_0x1049c9){console[_0x235ceb(0x10d)](_0x19b534['JRJxH']),console['error'](JSON[_0x235ceb(0xea)](_0x35e9bb['result'],null,0x2));throw new Error(_0x19b534['DNYOl']);}const _0x4fdd13=join(_0x19b534[_0x235ceb(0x111)](homedir),'.ranger'),_0x502e26=_0x19b534['ttDyj'](join,_0x4fdd13,_0x19b534[_0x235ceb(0x10c)]);await _0x19b534[_0x235ceb(0x11a)](mkdir,_0x4fdd13,{'recursive':!![]}),await _0x19b534[_0x235ceb(0xc2)](writeFile,_0x502e26,_0x1049c9,{'mode':0x180}),await writeFile(join(_0x4fdd13,_0x235ceb(0x100)),_0x24124e,{'mode':0x180}),console[_0x235ceb(0xeb)](_0x235ceb(0x90)+_0x502e26),console[_0x235ceb(0xeb)](_0x19b534['pBjMx']);}async function fetchAuthServerMetadata(_0x333bc7){const _0x29780b=_0x333bc7+'/.well-known/oauth-authorization-server',_0x41c148=await fetch(_0x29780b);if(!_0x41c148['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x29780b+':\x20'+_0x41c148['status']);return _0x41c148['json']();}function waitForCallback(_0x12fed5){const _0x3868ef=_0x130e48,_0x363278={'uznjd':function(_0x35aeb9,_0x5bf73b){return _0x35aeb9(_0x5bf73b);},'tieAi':function(_0x2fe3d8,_0xbfccba){return _0x2fe3d8!==_0xbfccba;},'ZtgzN':_0x3868ef(0xd7),'auQOs':_0x3868ef(0xb3),'bqWyG':_0x3868ef(0x10d),'wAJLq':function(_0x339508,_0x442d88){return _0x339508(_0x442d88);},'Bhqsb':function(_0x29c53b){return _0x29c53b();},'KHQed':function(_0x5ee3aa,_0xa12faf){return _0x5ee3aa(_0xa12faf);},'MbwKi':function(_0x1f2133,_0x55b9c6){return _0x1f2133!==_0x55b9c6;},'Qwvnb':_0x3868ef(0x10b),'aipRR':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','NDgGW':function(_0x3bcd78){return _0x3bcd78();},'oCVJy':function(_0x2efaba,_0x270bb1){return _0x2efaba(_0x270bb1);}};return new Promise((_0x177a70,_0x1eff4f)=>{const _0x1e9ac0=_0x3868ef,_0x287ca4=()=>{_0xca202d['closeAllConnections'](),_0xca202d['close']();},_0x1cb0f8=setTimeout(()=>{const _0x4b1fee=_0x37c6;_0x287ca4(),_0x363278['uznjd'](_0x1eff4f,new OAuthTimeoutError(_0x4b1fee(0x11c)));},0x1d4c0),_0xca202d=_0x363278[_0x1e9ac0(0x96)](createServer,(_0x1502a7,_0x29055b)=>{const _0x428c18=_0x1e9ac0,_0x491330=new URL(_0x1502a7['url']??'/',_0x428c18(0x9e)+CALLBACK_PORT);if(_0x363278['tieAi'](_0x491330[_0x428c18(0x92)],_0x428c18(0x10e))){_0x29055b[_0x428c18(0xe4)](0x194),_0x29055b['end'](_0x363278['ZtgzN']);return;}const _0xb5f67c=_0x491330[_0x428c18(0xfc)]['get'](_0x363278[_0x428c18(0xd4)]),_0xb133bb=_0x491330['searchParams'][_0x428c18(0xdf)](_0x428c18(0xd2)),_0xcb59e9=_0x491330['searchParams']['get'](_0x363278[_0x428c18(0xf7)]);if(_0xcb59e9){const _0x51ccf9=_0x491330['searchParams'][_0x428c18(0xdf)](_0x428c18(0xe1))??_0xcb59e9;_0x29055b['writeHead'](0xc8,{'Content-Type':'text/html'}),_0x29055b[_0x428c18(0x9c)](_0x428c18(0xab)+_0x51ccf9+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),_0x363278['wAJLq'](clearTimeout,_0x1cb0f8),_0x363278['Bhqsb'](_0x287ca4),_0x363278['KHQed'](_0x1eff4f,new Error('OAuth\x20error:\x20'+_0x51ccf9));return;}if(!_0xb5f67c||_0x363278['MbwKi'](_0xb133bb,_0x12fed5)){_0x29055b['writeHead'](0x190,{'Content-Type':_0x363278[_0x428c18(0xfa)]}),_0x29055b[_0x428c18(0x9c)](_0x363278['aipRR']);return;}_0x29055b['writeHead'](0xc8,{'Content-Type':_0x428c18(0x10b)}),_0x29055b[_0x428c18(0x9c)](_0x428c18(0x103)),clearTimeout(_0x1cb0f8),_0x363278['NDgGW'](_0x287ca4),_0x177a70(_0xb5f67c);});_0xca202d[_0x1e9ac0(0xf0)](CALLBACK_PORT,_0x1e9ac0(0xdd));});}async function openBrowser(_0x3dee48){const _0x16c2c6=_0x130e48,_0x426eb5={'BLtdl':'darwin','dxGLU':'open','gCDUV':_0x16c2c6(0x102),'KaWfL':'start','gQHda':'xdg-open'},_0x3c8bee=process[_0x16c2c6(0xe8)]===_0x426eb5[_0x16c2c6(0xc3)]?_0x426eb5['dxGLU']:process[_0x16c2c6(0xe8)]===_0x426eb5[_0x16c2c6(0xb0)]?_0x426eb5['KaWfL']:_0x426eb5[_0x16c2c6(0xbf)];exec(_0x3c8bee+'\x20\x22'+_0x3dee48+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x5ab17c=_0x130e48,_0x5f01bf={'pHgWM':function(_0x25a9cf,_0x485023,_0x1a9fc8){return _0x25a9cf(_0x485023,_0x1a9fc8);},'cosdS':function(_0x51e082,_0x34ff7d){return _0x51e082!==_0x34ff7d;},'LBxuj':function(_0x4e5c41,_0x30f800){return _0x4e5c41>_0x30f800;}};try{const _0x275c88=JSON[_0x5ab17c(0xcd)](await _0x5f01bf['pHgWM'](readFile,TOKEN_CACHE_PATH,_0x5ab17c(0xa0)));if(_0x275c88[_0x5ab17c(0xe9)]&&_0x5f01bf['cosdS'](_0x275c88[_0x5ab17c(0xe9)],currentOrigin))return null;if(_0x275c88[_0x5ab17c(0xcc)]&&_0x5f01bf[_0x5ab17c(0xf9)](Date[_0x5ab17c(0xff)](),_0x275c88['expiresAt']))return null;return _0x275c88['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x306374,_0x4f1fc2,_0x353f38){const _0x320203=_0x130e48,_0x333079={'ymQAf':function(_0x42675a,_0x1938bd){return _0x42675a*_0x1938bd;},'AlBuH':function(_0x579b0a,_0x1f696c,_0x2e896c){return _0x579b0a(_0x1f696c,_0x2e896c);}},_0x819a53=await loadCachedData(),_0x527ec7={..._0x819a53,'origin':currentOrigin,'accessToken':_0x306374,'refreshToken':_0x4f1fc2??_0x819a53?.[_0x320203(0xe5)],'expiresAt':_0x353f38?Date[_0x320203(0xff)]()+_0x333079[_0x320203(0xbc)](_0x353f38,0x3e8):undefined};await _0x333079['AlBuH'](mkdir,_0x333079[_0x320203(0x114)](join,homedir(),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x320203(0xea)](_0x527ec7),{'mode':0x180});}async function loadCachedClient(){const _0x4d714d=_0x130e48,_0x2aa672=await loadCachedData();if(_0x2aa672?.['origin']&&_0x2aa672['origin']!==currentOrigin)return null;return _0x2aa672?.[_0x4d714d(0x110)]?{'clientId':_0x2aa672['clientId'],'clientSecret':_0x2aa672[_0x4d714d(0xf6)]}:null;}async function clearCachedClient(){const _0x5d2a3d=_0x130e48,_0x1569aa={'YqBpv':function(_0x164be1){return _0x164be1();}},_0x56a829=await _0x1569aa[_0x5d2a3d(0x8f)](loadCachedData);if(!_0x56a829)return;const {clientId:_0x5740ac,clientSecret:_0x574656,..._0x1a9736}=_0x56a829;await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x1a9736),{'mode':0x180});}async function saveCachedClient(_0x128d83,_0x1f2542){const _0x4c280b=_0x130e48,_0x2becaa={'oEijt':function(_0xe16279){return _0xe16279();},'IDkNc':function(_0x1f74e0,_0x5274ba,_0x3c60a3){return _0x1f74e0(_0x5274ba,_0x3c60a3);},'gpPpj':'.ranger'},_0x2ffd27=await _0x2becaa[_0x4c280b(0xf4)](loadCachedData),_0x330abc={..._0x2ffd27,'origin':currentOrigin,'accessToken':_0x2ffd27?.['accessToken']??'','clientId':_0x128d83,'clientSecret':_0x1f2542};await _0x2becaa['IDkNc'](mkdir,join(homedir(),_0x2becaa['gpPpj']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x4c280b(0xea)](_0x330abc),{'mode':0x180});}function _0x37c6(_0x402886,_0x178b1f){_0x402886=_0x402886-0x8f;const _0x15c075=_0x15c0();let _0x37c64e=_0x15c075[_0x402886];return _0x37c64e;}async function loadCachedData(){const _0x1ed408=_0x130e48;try{return JSON[_0x1ed408(0xcd)](await readFile(TOKEN_CACHE_PATH,'utf-8'));}catch{return null;}}async function parseResponse(_0x164325){const _0x20948d=_0x130e48,_0xa02264=_0x164325[_0x20948d(0xd9)]['get']('content-type')??'';if(_0xa02264[_0x20948d(0x97)]('text/event-stream')){const _0xa39f13=await _0x164325[_0x20948d(0xce)]();for(const _0x58d1d9 of _0xa39f13['split']('\x0a')){const _0x43bcc5=_0x58d1d9['trim']();if(_0x43bcc5['startsWith'](_0x20948d(0xee))){const _0x220da1=_0x43bcc5[_0x20948d(0xaa)](_0x20948d(0xee)['length'])['trim']();if(!_0x220da1)continue;try{const _0x2172d5=JSON['parse'](_0x220da1);if(_0x2172d5['id']!==undefined||_0x2172d5[_0x20948d(0x10d)])return _0x2172d5;}catch{}}}throw new Error(_0x20948d(0x115));}return _0x164325[_0x20948d(0x108)]();}function extractToken(_0x4b348b){const _0x31dca6=_0x130e48,_0x1c7b83={'RpMJI':function(_0x212992,_0x2734d1){return _0x212992===_0x2734d1;},'XfQNU':function(_0x5db410,_0x2f371f){return _0x5db410===_0x2f371f;},'qbDxp':_0x31dca6(0xce),'rQyuy':'string'};if(!_0x4b348b)return null;const _0x587372=_0x4b348b['structuredContent'];if(_0x587372?.[_0x31dca6(0xbd)]&&_0x1c7b83['RpMJI'](typeof _0x587372['token'],_0x31dca6(0xb4)))return _0x587372[_0x31dca6(0xbd)];if(_0x4b348b[_0x31dca6(0x9a)]){const _0x45cc3d=_0x4b348b['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x45cc3d?.[0x0]?.['text']??'Unknown\x20error'));}const _0x23b1e7=_0x4b348b['content'];if(_0x23b1e7)for(const _0x153544 of _0x23b1e7){if(_0x1c7b83[_0x31dca6(0xb5)](_0x153544[_0x31dca6(0xbe)],_0x1c7b83[_0x31dca6(0xe2)])&&_0x153544[_0x31dca6(0xce)]){try{const _0x141903=JSON['parse'](_0x153544['text']);if(typeof _0x141903?.['token']===_0x1c7b83[_0x31dca6(0xe6)])return _0x141903['token'];}catch{}const _0x2089f7=_0x153544[_0x31dca6(0xce)][_0x31dca6(0x105)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x2089f7)return _0x2089f7[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1b096a,_0x1999b2){var _0x2799ff=_0x1b3f,_0xeec332=_0x1b096a();while(!![]){try{var _0x3c8b13=parseInt(_0x2799ff(0x1e8))/0x1+-parseInt(_0x2799ff(0x1e7))/0x2*(-parseInt(_0x2799ff(0x1ec))/0x3)+-parseInt(_0x2799ff(0x1ed))/0x4+parseInt(_0x2799ff(0x1f1))/0x5*(parseInt(_0x2799ff(0x1ef))/0x6)+-parseInt(_0x2799ff(0x1eb))/0x7*(parseInt(_0x2799ff(0x1f3))/0x8)+parseInt(_0x2799ff(0x1e4))/0x9+-parseInt(_0x2799ff(0x1e5))/0xa;if(_0x3c8b13===_0x1999b2)break;else _0xeec332['push'](_0xeec332['shift']());}catch(_0x2d4c87){_0xeec332['push'](_0xeec332['shift']());}}}(_0x4f9e,0x7abcd));function _0x1b3f(_0x29bb69,_0x1e3530){_0x29bb69=_0x29bb69-0x1e3;var _0x4f9e28=_0x4f9e();var _0x1b3f55=_0x4f9e28[_0x29bb69];return _0x1b3f55;}export async function migrateProfile(_0x4844ed,_0x4b9f3c){var _0x549447=_0x1b3f,_0x325682={'JWsEt':function(_0x132bb9,_0x3b38f5){return _0x132bb9+_0x3b38f5;},'ulIJM':function(_0x804cea,_0x1e4227){return _0x804cea+_0x1e4227;},'ybppp':_0x549447(0x1e6),'mFTSr':_0x549447(0x1e3),'NhodV':_0x549447(0x1ea),'WWken':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a'};console[_0x549447(0x1f5)](_0x325682[_0x549447(0x1ee)](_0x325682['ulIJM'](_0x325682[_0x549447(0x1ee)](_0x325682['ybppp']+'\x0a',_0x325682[_0x549447(0x1f0)]),_0x549447(0x1f4))+'\x0a',_0x549447(0x1e9))+_0x325682[_0x549447(0x1f2)]+'\x0a'+_0x325682['WWken']+'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'),process['exit'](0x1);}function _0x4f9e(){var _0x35beb9=['error','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','7920837dDRwWv','713370CKNWJv','ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','14LqykxX','580784FlFiMk','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','6480691gnUbgN','58545EQeANC','1071728BHiZOg','JWsEt','6BhYRNg','mFTSr','851665ECBtwh','NhodV','8WmPQog','\x20\x20ranger\x20profile\x20add\x20<name>\x0a'];_0x4f9e=function(){return _0x35beb9;};return _0x4f9e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x172eea,_0x594b7f){const _0x5b1572=_0x5741,_0x4fc462=_0x172eea();while(!![]){try{const _0x40fb0f=-parseInt(_0x5b1572(0x105))/0x1+-parseInt(_0x5b1572(0xed))/0x2+parseInt(_0x5b1572(0xfc))/0x3+parseInt(_0x5b1572(0xfe))/0x4*(parseInt(_0x5b1572(0x107))/0x5)+-parseInt(_0x5b1572(0xd7))/0x6+-parseInt(_0x5b1572(0x109))/0x7+-parseInt(_0x5b1572(0xf9))/0x8*(-parseInt(_0x5b1572(0xfa))/0x9);if(_0x40fb0f===_0x594b7f)break;else _0x4fc462['push'](_0x4fc462['shift']());}catch(_0x16d0c2){_0x4fc462['push'](_0x4fc462['shift']());}}}(_0x4165,0x402fb));import{join}from'path';function _0x5741(_0x2bf4a2,_0x23441b){_0x2bf4a2=_0x2bf4a2-0xd4;const _0x4165b3=_0x4165();let _0x574193=_0x4165b3[_0x2bf4a2];return _0x574193;}import{existsSync}from'fs';import _0x2f9eca from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x2168bd){const _0x1c2194=_0x5741,_0x47efd5={'sorga':function(_0xd1b2bf,_0xf8a3cf){return _0xd1b2bf(_0xf8a3cf);},'PAeVx':function(_0x1689a2,_0xf9bcde,_0xa7e18e){return _0x1689a2(_0xf9bcde,_0xa7e18e);},'TVkLW':function(_0x1f6d00){return _0x1f6d00();},'ISOeu':'.claude','Tfglb':'project','YXCjz':_0x1c2194(0xe3),'wrKQE':_0x1c2194(0xdc),'CYgWk':'user','nEbMo':_0x1c2194(0xd5),'PEsbR':_0x1c2194(0xe9),'twLrR':_0x1c2194(0x102),'eQBig':_0x1c2194(0xe7),'aAFAN':'plugin','ExCqN':'--scope','VPflU':function(_0x4e4859,_0x4c8efc){return _0x4e4859===_0x4c8efc;},'gVTFS':_0x1c2194(0xd6),'IOyZR':_0x1c2194(0xef),'JLoUV':'⚠\x20Failed\x20to\x20enable\x20plugin:'},_0x2dbaeb=await isPluginInstalled('ranger@trailhead');if(_0x2dbaeb)return console['log'](_0x1c2194(0xfd)),![];const _0xcb0a5f=_0x47efd5[_0x1c2194(0xec)](existsSync,_0x47efd5[_0x1c2194(0xf6)](join,_0x47efd5['TVkLW'](getProjectRoot),_0x47efd5['ISOeu']));let _0x29cc99;if(_0x2168bd)_0x29cc99=_0x2168bd;else{if(_0xcb0a5f)_0x29cc99=_0x47efd5[_0x1c2194(0xf3)];else{console[_0x1c2194(0xf7)]('\x0a📦\x20Claude\x20Code\x20Plugin\x0a');const _0x261554=await _0x2f9eca[_0x1c2194(0xdf)]([{'type':_0x47efd5[_0x1c2194(0xff)],'name':'pluginScope','message':_0x47efd5[_0x1c2194(0xe2)],'choices':[{'name':_0x1c2194(0xf1),'value':_0x47efd5['CYgWk']},{'name':_0x1c2194(0xf2),'value':_0x47efd5['Tfglb']}],'default':_0x47efd5[_0x1c2194(0xde)]}]);_0x29cc99=_0x261554['pluginScope'];}}console['log']('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x29cc99+'\x20level)...\x0a');const _0x2ab200=await isMarketplaceAdded('trailhead');let _0x29a056=_0x2ab200;if(_0x2ab200)console[_0x1c2194(0xf7)](_0x1c2194(0xe1));else{const _0x4a3fb9=await runClaudeCommand([_0x1c2194(0x104),_0x47efd5[_0x1c2194(0xf4)],'add',_0x47efd5[_0x1c2194(0x103)]]);!_0x4a3fb9[_0x1c2194(0xf5)]?(console['error'](_0x47efd5['twLrR'],_0x4a3fb9[_0x1c2194(0x100)]),console[_0x1c2194(0xf7)](_0x47efd5['eQBig']),console[_0x1c2194(0xf7)](_0x1c2194(0xfb)),console[_0x1c2194(0xf7)](_0x1c2194(0xd8)+_0x29cc99)):_0x29a056=!![];}if(_0x29a056){const _0x4a7f21=await _0x47efd5[_0x1c2194(0xf6)](runClaudeCommand,[_0x47efd5[_0x1c2194(0xdd)],'install',_0x1c2194(0x106),_0x47efd5['ExCqN'],_0x29cc99],{'cwd':_0x47efd5['VPflU'](_0x29cc99,_0x47efd5[_0x1c2194(0xf3)])?_0x47efd5['TVkLW'](getProjectRoot):undefined});if(!_0x4a7f21['success'])console[_0x1c2194(0x100)]('❌\x20Failed\x20to\x20install\x20plugin:',_0x4a7f21['error']),console['log'](_0x47efd5['eQBig']),console['log'](_0x1c2194(0xd8)+_0x29cc99);else{console['log'](_0x47efd5[_0x1c2194(0xe5)]);const _0x3cef5f=[_0x47efd5['aAFAN'],_0x1c2194(0xda),_0x1c2194(0x106)];_0x29cc99===_0x47efd5[_0x1c2194(0xf3)]&&_0x3cef5f[_0x1c2194(0xee)](_0x1c2194(0xeb),_0x47efd5[_0x1c2194(0xf3)]);const _0x336828=await runClaudeCommand(_0x3cef5f,{'captureOutput':!![],'cwd':_0x47efd5['VPflU'](_0x29cc99,_0x47efd5['Tfglb'])?_0x47efd5[_0x1c2194(0xea)](getProjectRoot):undefined}),_0x320ff7=_0x336828['output']?.[_0x1c2194(0xe0)](_0x47efd5[_0x1c2194(0xf0)]);!_0x336828[_0x1c2194(0xf5)]&&!_0x320ff7?console['error'](_0x47efd5[_0x1c2194(0xe4)],_0x336828[_0x1c2194(0x100)]):console[_0x1c2194(0xf7)](_0x1c2194(0x108));}}return!![];}export async function ensureClaudeSkills(_0x3a0e33){const _0x19aebc=_0x5741,_0x23b3a5={'yEVsX':function(_0xc218bc,_0x40ab43){return _0xc218bc(_0x40ab43);},'uXUsb':function(_0x3fe156,_0x1dd0ee,_0x369bcd,_0x19afeb){return _0x3fe156(_0x1dd0ee,_0x369bcd,_0x19afeb);},'TDsQx':'user','yCreF':_0x19aebc(0x101),'jybXa':'SKILL.md','hUMeA':'project','kOQrG':function(_0x4e1447,_0x88cb80){return _0x4e1447||_0x88cb80;},'InrSL':function(_0x4354e4){return _0x4354e4();},'FcNls':'.claude','jPKym':'wantsSkillup','ekoZG':'Would\x20you\x20like\x20to\x20install\x20skills?'},_0x329d06=_0x23b3a5[_0x19aebc(0x10a)](existsSync,_0x23b3a5['uXUsb'](join,getSkillsDir(_0x23b3a5['TDsQx']),_0x23b3a5['yCreF'],_0x23b3a5['jybXa'])),_0x419d05=existsSync(join(_0x23b3a5['yEVsX'](getSkillsDir,_0x23b3a5[_0x19aebc(0xf8)]),_0x23b3a5[_0x19aebc(0xe6)],'SKILL.md'));if(_0x23b3a5[_0x19aebc(0xe8)](_0x329d06,_0x419d05))return console[_0x19aebc(0xf7)]('✓\x20Ranger\x20skills\x20already\x20installed'),![];const _0x596f87=existsSync(join(_0x23b3a5['InrSL'](getProjectRoot),_0x23b3a5[_0x19aebc(0xd4)]));let _0x4bd9a6=!![];if(_0x3a0e33)await _0x23b3a5[_0x19aebc(0x10a)](skillup,{'autoInstall':_0x3a0e33,'suppressUsage':!![]});else{if(_0x596f87)await _0x23b3a5[_0x19aebc(0x10a)](skillup,{'autoInstall':_0x23b3a5[_0x19aebc(0xf8)],'suppressUsage':!![]});else{const _0x2d6d33=await _0x2f9eca[_0x19aebc(0xdf)]([{'type':_0x19aebc(0xd9),'name':_0x23b3a5['jPKym'],'message':_0x23b3a5['ekoZG'],'default':!![]}]);_0x4bd9a6=_0x2d6d33[_0x19aebc(0xdb)],_0x4bd9a6&&await skillup({'suppressUsage':!![]});}}return _0x4bd9a6;}function _0x4165(){const _0x939724=['301308uTHdaD','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','24MNJaIr','YXCjz','error','ranger','❌\x20Failed\x20to\x20add\x20marketplace:','PEsbR','plugin','33541ssvJxX','ranger@trailhead','372915LXRgzr','✓\x20Claude\x20Code\x20plugin\x20enabled','1686993Gmsmba','yEVsX','FcNls','marketplace','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','3127332yxpjYl','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','confirm','enable','wantsSkillup','Where\x20should\x20the\x20plugin\x20be\x20installed?','aAFAN','CYgWk','prompt','includes','✓\x20Marketplace\x20already\x20added','wrKQE','list','JLoUV','gVTFS','yCreF','\x0aYou\x20can\x20install\x20manually\x20with:','kOQrG','ranger-testing/trailhead','TVkLW','--scope','sorga','983018dgwDeS','push','already\x20enabled','IOyZR','User\x20(available\x20in\x20all\x20your\x20projects)','Project\x20(shared\x20with\x20team\x20via\x20git)','Tfglb','nEbMo','success','PAeVx','log','hUMeA','8017952FgIuqS','9MKpPwe','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'];_0x4165=function(){return _0x939724;};return _0x4165();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3eef76,_0x332ceb){const _0x479530=_0x2cf7,_0x6e23bf=_0x3eef76();while(!![]){try{const _0x5723b5=parseInt(_0x479530(0x134))/0x1+parseInt(_0x479530(0x13b))/0x2*(parseInt(_0x479530(0x138))/0x3)+-parseInt(_0x479530(0x13e))/0x4*(-parseInt(_0x479530(0x145))/0x5)+-parseInt(_0x479530(0x13f))/0x6*(parseInt(_0x479530(0x13a))/0x7)+parseInt(_0x479530(0x13c))/0x8+parseInt(_0x479530(0x147))/0x9*(-parseInt(_0x479530(0x14d))/0xa)+-parseInt(_0x479530(0x151))/0xb;if(_0x5723b5===_0x332ceb)break;else _0x6e23bf['push'](_0x6e23bf['shift']());}catch(_0x44676f){_0x6e23bf['push'](_0x6e23bf['shift']());}}}(_0x3031,0x9db8c));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x307e6b from'inquirer';function _0x2cf7(_0x345b19,_0x563fd2){_0x345b19=_0x345b19-0x12c;const _0x303186=_0x3031();let _0x2cf7c6=_0x303186[_0x345b19];return _0x2cf7c6;}import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0xa27943){const _0x1f06e8=_0x2cf7,_0x5ce635={'TUKBT':function(_0x25a754,_0x3ab001){return _0x25a754(_0x3ab001);},'UFwgN':function(_0x17359c,_0xcafdfd){return _0x17359c(_0xcafdfd);},'nweRk':_0x1f06e8(0x12c),'YMnkq':'project','sBVhE':'pluginScope','OuDEV':'Project\x20(shared\x20with\x20team\x20via\x20git)','mIzEA':_0x1f06e8(0x141),'qIPtq':_0x1f06e8(0x140),'rwgHf':_0x1f06e8(0x135),'YPcJa':_0x1f06e8(0x132),'TKSFT':_0x1f06e8(0x146),'xQIzR':function(_0xd3c827,_0x359d63,_0x25594e){return _0xd3c827(_0x359d63,_0x25594e);},'TaMwR':function(_0x5483ed,_0x4bd6d9){return _0x5483ed+_0x4bd6d9;},'FziFJ':_0x1f06e8(0x142)},_0x2572f1=_0x5ce635['TUKBT'](existsSync,join(_0x5ce635['UFwgN'](getOpencodeConfigDir,'project'),_0x5ce635[_0x1f06e8(0x14a)]));let _0x1eb744;if(_0xa27943)_0x1eb744=_0xa27943;else{if(_0x2572f1)_0x1eb744=_0x5ce635[_0x1f06e8(0x139)];else{console['log'](_0x1f06e8(0x130));const _0x592e06=await _0x307e6b['prompt']([{'type':_0x1f06e8(0x14c),'name':_0x5ce635['sBVhE'],'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x1f06e8(0x14f),'value':_0x1f06e8(0x12f)},{'name':_0x5ce635['OuDEV'],'value':'project'}],'default':'user'}]);_0x1eb744=_0x592e06['pluginScope'];}}const _0x4ae00c=join(getOpencodeConfigDir(_0x1eb744),_0x5ce635['nweRk']),_0xa55cc7='@ranger-testing/opencode-plugin',_0x5934e9=_0x5ce635[_0x1f06e8(0x133)];let _0x29d244={};if(existsSync(_0x4ae00c))try{const _0x20f6b7=await readFile(_0x4ae00c,_0x5ce635[_0x1f06e8(0x14b)]);_0x29d244=JSON[_0x1f06e8(0x149)](_0x20f6b7);}catch(_0x20888a){return console[_0x1f06e8(0x137)](_0x5ce635[_0x1f06e8(0x12e)]),{'configured':![],'scope':_0x1eb744,'error':_0x5ce635[_0x1f06e8(0x148)],'details':_0x20888a};}const _0x4cafe4=Array[_0x1f06e8(0x150)](_0x29d244['plugin'])?_0x29d244[_0x1f06e8(0x131)]:[];if(_0x4cafe4[_0x1f06e8(0x144)](_0xa55cc7))return console[_0x1f06e8(0x14e)](_0x5ce635[_0x1f06e8(0x143)]),{'configured':![],'scope':_0x1eb744};return _0x29d244['$schema']=_0x29d244['$schema']||_0x5934e9,_0x29d244['plugin']=[..._0x4cafe4,_0xa55cc7],await _0x5ce635[_0x1f06e8(0x13d)](mkdir,getOpencodeConfigDir(_0x1eb744),{'recursive':!![]}),await _0x5ce635[_0x1f06e8(0x13d)](writeFile,_0x4ae00c,_0x5ce635[_0x1f06e8(0x136)](JSON['stringify'](_0x29d244,null,0x2),'\x0a')),console[_0x1f06e8(0x14e)](_0x5ce635[_0x1f06e8(0x12d)]),{'configured':!![],'scope':_0x1eb744};}function _0x3031(){const _0x590b50=['qIPtq','list','50340mwLEQZ','log','User\x20(available\x20in\x20all\x20your\x20projects)','isArray','27409195mAxuGH','opencode.json','FziFJ','rwgHf','user','\x0a📦\x20OpenCode\x20Plugin\x0a','plugin','Failed\x20to\x20read\x20opencode.json','mIzEA','739687lbKesX','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','TaMwR','error','6ImIRFb','YMnkq','2342053PDqWIn','1092466YvtxQC','4385576OYNImR','xQIzR','8WYmMJo','6LJNBjJ','utf-8','https://opencode.ai/config.json','✓\x20OpenCode\x20plugin\x20configured','TKSFT','includes','3208235shnrPh','✓\x20OpenCode\x20plugin\x20already\x20configured','342rxqZGd','YPcJa','parse','nweRk'];_0x3031=function(){return _0x590b50;};return _0x3031();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x2107(_0x4822bb,_0x482b0e){_0x4822bb=_0x4822bb-0x1a1;var _0x3fd018=_0x3fd0();var _0x21075e=_0x3fd018[_0x4822bb];return _0x21075e;}function _0x3fd0(){var _0x909ac1=['7504376ZfAQaZ','2503066EVGfEw','290682QsFtMZ','3QTJqRR','1848124KNWlHi','aITGY','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','kGGKe','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','VZAaR','94350wehGRM','160YctWSA','14772150iwIzQr','1255252FiFRXQ'];_0x3fd0=function(){return _0x909ac1;};return _0x3fd0();}(function(_0x326a59,_0x34bbfd){var _0xc03978=_0x2107,_0x315a69=_0x326a59();while(!![]){try{var _0x427e94=parseInt(_0xc03978(0x1a4))/0x1+-parseInt(_0xc03978(0x1a6))/0x2+parseInt(_0xc03978(0x1a8))/0x3*(parseInt(_0xc03978(0x1a9))/0x4)+-parseInt(_0xc03978(0x1a2))/0x5*(parseInt(_0xc03978(0x1a1))/0x6)+parseInt(_0xc03978(0x1a7))/0x7+-parseInt(_0xc03978(0x1a5))/0x8+parseInt(_0xc03978(0x1a3))/0x9;if(_0x427e94===_0x34bbfd)break;else _0x315a69['push'](_0x315a69['shift']());}catch(_0x2dc05e){_0x315a69['push'](_0x315a69['shift']());}}}(_0x3fd0,0xacb33));export async function setupCi(_0x3e8726,_0x596238,_0x4f8273){var _0x5285de=_0x2107,_0x228132={'kGGKe':function(_0x490110,_0x4ee1d9){return _0x490110+_0x4ee1d9;},'CkAAC':function(_0x439cdb,_0x33e721){return _0x439cdb+_0x33e721;},'QBMnT':'ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','aITGY':_0x5285de(0x1ab),'omhaY':_0x5285de(0x1ad),'VZAaR':'\x20\x20https://docs.ranger.net/main/concepts/profiles'};console['error'](_0x228132[_0x5285de(0x1ac)](_0x228132['CkAAC'](_0x228132['CkAAC'](_0x228132['QBMnT'],'\x0a'),_0x228132[_0x5285de(0x1aa)])+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a'+'\x0a',_0x228132['omhaY'])+_0x228132[_0x5285de(0x1ae)]),process['exit'](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4fd6ec,_0x3d4ed5){const _0x3f5626=_0xdd38,_0x4f4c08=_0x4fd6ec();while(!![]){try{const _0x391790=parseInt(_0x3f5626(0x102))/0x1+-parseInt(_0x3f5626(0x114))/0x2*(-parseInt(_0x3f5626(0x11a))/0x3)+parseInt(_0x3f5626(0xed))/0x4*(-parseInt(_0x3f5626(0xf8))/0x5)+-parseInt(_0x3f5626(0x116))/0x6+parseInt(_0x3f5626(0xf7))/0x7*(parseInt(_0x3f5626(0xf3))/0x8)+-parseInt(_0x3f5626(0xfc))/0x9+parseInt(_0x3f5626(0x104))/0xa;if(_0x391790===_0x3d4ed5)break;else _0x4f4c08['push'](_0x4f4c08['shift']());}catch(_0x43d05e){_0x4f4c08['push'](_0x4f4c08['shift']());}}}(_0x1e46,0xbddc6));import{basename}from'path';import _0x24dc20 from'inquirer';import{getToken}from'./utils/keychain.js';function _0xdd38(_0x4ced9c,_0x1e81bc){_0x4ced9c=_0x4ced9c-0xec;const _0x1e4631=_0x1e46();let _0xdd38ee=_0x1e4631[_0x4ced9c];return _0xdd38ee;}import{installSkill}from'./utils/skills.js';function _0x1e46(){const _0x6a95b3=['\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','zUSxb','user','16ZhsDJD','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','/skills/','/.claude/skills/','1058036seFljY','4445835VPvdJh','anfss','claude','message','9291600juDTAM','\x0a📦\x20Installing\x20skills...\x0a','ngXvZ','\x20--opencode','To\x20get\x20started:','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','892166oWRhkE','GeagW','22244410KJLHeN','installLevel','project-level','split','stdin','log','warn','prompt','DIjzz','\x20successfully!\x0a','autoInstall','\x20<your-api-token>','yfbrn','Where\x20should\x20skills\x20be\x20installed?','LMIvX','opencode','3428eqBsKT','isTTY','7331208OyrUmQ','suppressUsage','jzjWJ','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','879oObtYo','oQhEN','project','All\x20projects\x20(','4Abbppu','\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!','This\x20project\x20only\x20('];_0x1e46=function(){return _0x6a95b3;};return _0x1e46();}import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x1aeddc={}){const _0x550176=_0xdd38,_0xb1faaf={'FbGKB':'0|5|1|2|3|4','hNpwY':_0x550176(0xf4),'oQhEN':_0x550176(0xf0),'anfss':function(_0x4fe91c,_0x3d52f3){return _0x4fe91c===_0x3d52f3;},'UDuYA':'opencode','zUSxb':'\x20--opencode','ZWgPD':'✓\x20Found\x20API\x20token','LMIvX':function(_0x134867,_0x5e61cf){return _0x134867(_0x5e61cf);},'ykqrT':'list','GeagW':'user','jzjWJ':_0x550176(0x11c),'BMbas':_0x550176(0xfd),'LKhdl':function(_0x517552,_0x54f86f,_0x3bf22b){return _0x517552(_0x54f86f,_0x3bf22b);},'yfbrn':'ranger','DIjzz':'user-level','ngXvZ':_0x550176(0x106),'zxAds':function(_0x168378,_0x27128d){return _0x168378>_0x27128d;},'UwqLd':_0x550176(0xee)};console[_0x550176(0x109)]('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x45b147=_0x1aeddc['platform']??_0x550176(0xfa),_0x2ffd10=await getToken();if(!_0x2ffd10){const _0xf62828=_0xb1faaf['FbGKB'][_0x550176(0x107)]('|');let _0x35ca34=0x0;while(!![]){switch(_0xf62828[_0x35ca34++]){case'0':console[_0x550176(0x109)](_0xb1faaf['hNpwY']);continue;case'1':console[_0x550176(0x109)](_0xb1faaf[_0x550176(0x11b)]);continue;case'2':console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0xb1faaf['anfss'](_0x45b147,_0xb1faaf['UDuYA'])?_0x550176(0xff):'')+_0x550176(0x10f));continue;case'3':console[_0x550176(0x109)]('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x45b147===_0x550176(0x113)?_0xb1faaf[_0x550176(0xf1)]:'')+'\x0a');continue;case'4':return;case'5':console[_0x550176(0x109)](_0x550176(0x100));continue;}break;}}console[_0x550176(0x109)](_0xb1faaf['ZWgPD']);const _0x3cb1c3=getProjectRoot(),_0x43618e=basename(_0x3cb1c3),_0x13bf3d=_0x45b147===_0x550176(0x113)?_0xb1faaf[_0x550176(0x112)](getOpencodeConfigDir,_0x550176(0xf2))+_0x550176(0xf5):getClaudeConfigDir()+_0x550176(0xf5),_0x265bef=_0xb1faaf[_0x550176(0xf9)](_0x45b147,_0x550176(0x113))?_0x3cb1c3+'/.opencode/skills/':_0x3cb1c3+_0x550176(0xf6),_0x1f7f43=process[_0x550176(0x108)]['isTTY']&&process['stdout'][_0x550176(0x115)];let _0x554709;if(_0x1aeddc[_0x550176(0x10e)])_0x554709=_0x1aeddc['autoInstall'];else{if(_0x1f7f43){const _0x9fa13=await _0x24dc20[_0x550176(0x10b)]([{'type':_0xb1faaf['ykqrT'],'name':_0x550176(0x105),'message':_0x550176(0x111),'choices':[{'name':_0x550176(0xec)+_0x13bf3d+')','value':_0xb1faaf[_0x550176(0x103)]},{'name':_0x550176(0xef)+_0x265bef+')','value':_0x550176(0x11c)}]}]);_0x554709=_0x9fa13['installLevel'];}else _0x554709=_0xb1faaf[_0x550176(0x118)],console['log']('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x265bef+')');}let _0xbe9d44=0x0;const _0x22db8c=getCurrentVersion();console['log'](_0xb1faaf['BMbas']);try{const _0x3eaac8=await _0xb1faaf['LKhdl'](installSkill,_0xb1faaf[_0x550176(0x110)],{'cliVersion':_0x22db8c,'level':_0x554709,'platform':_0x45b147});_0x3eaac8&&_0xbe9d44++;}catch(_0xc4a6da){console[_0x550176(0x10a)](_0x550176(0x119),_0xc4a6da instanceof Error?_0xc4a6da[_0x550176(0xfb)]:_0xc4a6da);}if(_0xbe9d44>0x0){const _0x167d22=_0x554709==='user'?_0xb1faaf[_0x550176(0x10c)]:_0xb1faaf[_0x550176(0xfe)];console['log']('\x0a✅\x20Installed\x20'+_0xbe9d44+'\x20'+_0x167d22+'\x20skill'+(_0xb1faaf['zxAds'](_0xbe9d44,0x1)?'s':'')+_0x550176(0x10d)),!_0x1aeddc[_0x550176(0x117)]&&(console['log']('To\x20use:'),_0x45b147===_0x550176(0x113)?console['log']('\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.'):console['log'](_0xb1faaf['UwqLd']));}else console['log'](_0x550176(0x101));}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0xe9931d=_0x5adf;(function(_0x115024,_0x1a2f10){const _0x2f2f8a=_0x5adf,_0x410b6d=_0x115024();while(!![]){try{const _0x2878ff=parseInt(_0x2f2f8a(0x1c8))/0x1*(-parseInt(_0x2f2f8a(0x19e))/0x2)+parseInt(_0x2f2f8a(0x194))/0x3*(parseInt(_0x2f2f8a(0x16b))/0x4)+-parseInt(_0x2f2f8a(0x172))/0x5+-parseInt(_0x2f2f8a(0x173))/0x6+parseInt(_0x2f2f8a(0x17b))/0x7*(parseInt(_0x2f2f8a(0x178))/0x8)+parseInt(_0x2f2f8a(0x1c9))/0x9+parseInt(_0x2f2f8a(0x197))/0xa*(parseInt(_0x2f2f8a(0x1a3))/0xb);if(_0x2878ff===_0x1a2f10)break;else _0x410b6d['push'](_0x410b6d['shift']());}catch(_0x67abc6){_0x410b6d['push'](_0x410b6d['shift']());}}}(_0xaae9,0x6e663));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x4ca0b8 from'inquirer';function _0x5adf(_0x27ca92,_0x33171c){_0x27ca92=_0x27ca92-0x169;const _0xaae9f8=_0xaae9();let _0x5adfac=_0xaae9f8[_0x27ca92];return _0x5adfac;}import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';function _0xaae9(){const _0x429c40=['TPjbV','\x20install\x20chromium','✓\x20Local\x20profile\x20already\x20exists','url','1ryHYhN','6363045hiCniy','UefQH','local','success','4JIYrpZ','auth','iwuCq','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','1.58.2','iUcHz','\x0a⚠\x20Skipping\x20Chromium\x20installation.','1370845kSBUGD','4671222NnABOe','inherit','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','PaGaV','557616GzBWkp','provided_token','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','21sPXmdK','force','playwright@','eLnQn','prompt','status','trackPhaseStart','\x0a❌\x20Profile\x20setup\x20failed:','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','--with-deps','Sspbk','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','The\x20required\x20version\x20(','\x1b[0m','GITHUB_ENV','TIHmt','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','organizationName','skipAuth','error','chromium','Authentication\x20failed:\x20','brAgC','ready','GEFvd','734259OKWKBI','JCUYQ','trackPhaseEnd','15910dcFQNg','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','.gitignore','rELvb','lkpMi','allowInsecureLocalhost','skipChromium','231524VJbtOI','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','TdQLF','XxRqY','3179ppfDma','taRcT','KulIr','withDeps','scope','user','platform','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','message','You\x20can\x20install\x20it\x20manually\x20by\x20running:','log','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','fdlBN','\x20now?','\x20and\x20prompt\x20the\x20coding','Validating\x20API\x20token...','✓\x20Authenticated\x20to\x20','xyKPe','FpzdQ','install','GEWeA','plugin','ignore','PQRNj','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','ranger','szcQm','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','\x1b[1m','\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','version','profile'];_0xaae9=function(){return _0x429c40;};return _0xaae9();}import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0xe9931d(0x16f);const bold=_0x5b3bf3=>_0xe9931d(0x1bf)+_0x5b3bf3+_0xe9931d(0x188);export function getPlaywrightVersion(){const _0x3d0136=_0xe9931d;try{const _0x13c5bc=require['resolve']('playwright/package.json'),_0x2142e7=require(_0x13c5bc);return _0x2142e7[_0x3d0136(0x1c2)];}catch{return null;}}export function installChromiumBinary(_0x8e02b9,_0x14d6ce=![]){const _0x41e31d=_0xe9931d,_0x39c8ce={'desaT':_0x41e31d(0x1b6),'tChFM':_0x41e31d(0x184),'xMxvW':function(_0x1425d3,_0x3b6e52,_0x51230f,_0x7f1331){return _0x1425d3(_0x3b6e52,_0x51230f,_0x7f1331);},'GEFvd':'npx','iUcHz':_0x41e31d(0x1b9),'aMBMH':function(_0x1336f3,_0x343cd5){return _0x1336f3===_0x343cd5;},'lkpMi':_0x41e31d(0x18e)};return new Promise((_0x49e726,_0x592b69)=>{const _0xe891a4=_0x41e31d,_0x37608e=[_0xe891a4(0x17d)+_0x8e02b9,_0x39c8ce['desaT'],..._0x14d6ce?[_0x39c8ce['tChFM']]:[],'chromium'],_0xd27c4d=_0x39c8ce['xMxvW'](spawn,_0x39c8ce[_0xe891a4(0x193)],_0x37608e,{'stdio':[_0x39c8ce[_0xe891a4(0x170)],'inherit',_0xe891a4(0x174)],'shell':_0x39c8ce['aMBMH'](process[_0xe891a4(0x1a9)],'win32')});_0xd27c4d['on']('close',_0xf99c8c=>{_0xf99c8c===0x0?_0x49e726():_0x592b69(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0xf99c8c));}),_0xd27c4d['on'](_0x39c8ce[_0xe891a4(0x19b)],_0x58ac38=>{_0x592b69(_0x58ac38);});});}export async function authenticate(_0x34ac96){const _0x16644f=_0xe9931d,_0x193e3f={'ZNtYr':function(_0x213cf1){return _0x213cf1();},'RybGi':'existing_token','UfcAf':function(_0x213594,_0x33f69d){return _0x213594 instanceof _0x33f69d;},'awhlC':_0x16644f(0x1b2),'fZLNE':function(_0x4caf66,_0x17312e){return _0x4caf66(_0x17312e);},'zXvFC':'✓\x20Exported\x20credentials\x20for\x20CI','PaGaV':'✓\x20Stored\x20credentials\x20locally'};if(!_0x34ac96){const _0x52ab47=await _0x193e3f['ZNtYr'](getToken);if(_0x52ab47){const _0x3e4eaa=await getCurrentUser(_0x52ab47);if(_0x3e4eaa['success'])return console[_0x16644f(0x1ad)]('✓\x20Already\x20authenticated\x20to\x20'+_0x3e4eaa['user']['organizationName']),{'token':_0x52ab47,'method':_0x193e3f['RybGi']};}try{_0x34ac96=await runDeviceAuthFlow();}catch(_0x489c78){throw new Error(_0x16644f(0x190)+(_0x193e3f['UfcAf'](_0x489c78,Error)?_0x489c78[_0x16644f(0x1ab)]:_0x489c78));}const _0x1c5180=await getCurrentUser(_0x34ac96);if(!_0x1c5180[_0x16644f(0x16a)])throw new Error(_0x16644f(0x19f)+_0x1c5180['error']);return console[_0x16644f(0x1ad)]('✓\x20Authenticated\x20to\x20'+_0x1c5180['user'][_0x16644f(0x18c)]),{'token':_0x34ac96,'method':'device_auth'};}console['log'](_0x193e3f['awhlC']);const _0x4f6aa6=await getCurrentUser(_0x34ac96);if(!_0x4f6aa6[_0x16644f(0x16a)]){if(_0x4f6aa6[_0x16644f(0x180)])throw new Error(_0x16644f(0x190)+_0x4f6aa6['error']+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error(_0x16644f(0x1be)+_0x4f6aa6[_0x16644f(0x18e)]+_0x16644f(0x1a0));}return console[_0x16644f(0x1ad)](_0x16644f(0x1b3)+_0x4f6aa6[_0x16644f(0x1a8)][_0x16644f(0x18c)]),await _0x193e3f['fZLNE'](storeToken,_0x34ac96),console[_0x16644f(0x1ad)](process['env'][_0x16644f(0x189)]?_0x193e3f['zXvFC']:_0x193e3f[_0x16644f(0x177)]),{'token':_0x34ac96,'method':_0x16644f(0x179)};}export async function ensureRangerDir(_0x1200dd){const _0x5aa2f2=_0xe9931d,_0x34e63f={'EcVxW':'✓\x20Created\x20~/.ranger/\x20directory'};void _0x1200dd;const _0x402a94=getRangerHomeDir();return!existsSync(_0x402a94)?(await mkdir(_0x402a94,{'recursive':!![]}),console[_0x5aa2f2(0x1ad)](_0x34e63f['EcVxW']),{'path':_0x402a94,'installed':!![]}):(console['log']('✓\x20~/.ranger/\x20directory\x20already\x20exists'),{'path':_0x402a94,'installed':![]});}export async function ensureChromium(_0x54860b=![]){const _0x529ea0=_0xe9931d,_0x37c39e={'jqNLx':function(_0x37eb37,_0xae1ef7){return _0x37eb37??_0xae1ef7;},'pHQex':'confirm','bnNPJ':'install','gdKDJ':'\x20(fallback\x20version)','Sspbk':_0x529ea0(0x198),'MsKFQ':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','xMrSv':function(_0x2bc99f,_0x17f89){return _0x2bc99f instanceof _0x17f89;}};let _0x5cb9f9=![];try{const _0x3d3a8b=chromium['executablePath']();_0x5cb9f9=existsSync(_0x3d3a8b);}catch{_0x5cb9f9=![];}if(_0x5cb9f9)return console['log']('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x59d9bd=getPlaywrightVersion(),_0x5e5021=_0x37c39e['jqNLx'](_0x59d9bd,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0xbabbc9=!_0x59d9bd,_0x3f4ca9=process['stdin']['isTTY']&&process['stdout']['isTTY'];let _0x383a73=!![];if(_0x3f4ca9){const {install:_0x4678cf}=await _0x4ca0b8[_0x529ea0(0x17f)]([{'type':_0x37c39e['pHQex'],'name':_0x37c39e['bnNPJ'],'message':_0xbabbc9?_0x529ea0(0x1ae)+_0x5e5021+_0x529ea0(0x1b0):_0x529ea0(0x187)+_0x5e5021+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x383a73=_0x4678cf;}else console[_0x529ea0(0x1ad)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x5e5021+(_0xbabbc9?_0x37c39e['gdKDJ']:'')+'...');if(_0x383a73){console[_0x529ea0(0x1ad)]('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await installChromiumBinary(_0x5e5021,_0x54860b),console[_0x529ea0(0x1ad)](_0x37c39e[_0x529ea0(0x185)]);}catch(_0x1ba8a6){console['error'](_0x37c39e['MsKFQ'],_0x37c39e['xMrSv'](_0x1ba8a6,Error)?_0x1ba8a6[_0x529ea0(0x1ab)]:_0x1ba8a6),console[_0x529ea0(0x1ad)](_0x529ea0(0x1ac)),console['log']('\x20\x20npx\x20playwright@'+_0x5e5021+_0x529ea0(0x1c5));}}else console['log'](_0x529ea0(0x171)),console[_0x529ea0(0x1ad)](_0x529ea0(0x186)),console['log']('\x20\x20npx\x20playwright@'+_0x5e5021+_0x529ea0(0x1c5));return!![];}export async function writeRangerGitignore(_0x3f1111){const _0x48cfae=_0xe9931d,_0x8b9d57={'PQRNj':'✓\x20Created\x20.ranger/.gitignore'},_0x34df31=join(_0x3f1111,_0x48cfae(0x199)),_0x4090b5=_0x48cfae(0x1c0);await writeFile(_0x34df31,_0x4090b5),console[_0x48cfae(0x1ad)](_0x8b9d57[_0x48cfae(0x1ba)]);}export async function ensureLocalEnv(_0x43e13a,_0x5d735c){const _0x5015f2=_0xe9931d,_0x4f6163={'KulIr':function(_0x573915){return _0x573915();},'XxRqY':function(_0x2326a9,_0x357349){return _0x2326a9!==_0x357349;},'TIHmt':'user','opUTL':function(_0x43329f,_0x3daf81){return _0x43329f===_0x3daf81;},'rbOXI':function(_0x43d5c3,_0x263224,_0x2d5354,_0x5e7d13){return _0x43d5c3(_0x263224,_0x2d5354,_0x5e7d13);},'wuZOy':_0x5015f2(0x169)};if(!_0x4f6163[_0x5015f2(0x1a5)](findGitRoot)&&_0x4f6163[_0x5015f2(0x1a2)](_0x43e13a?.['scope'],_0x4f6163[_0x5015f2(0x18a)]))return console['log']('⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.'),{'ready':![],'skipped':!![]};const _0x42bbd1=_0x4f6163['opUTL'](_0x43e13a?.[_0x5015f2(0x1a7)],_0x5015f2(0x1a8))?getRangerHomeDir():undefined;if(findExistingEnv('local',{'locations':['local'],'rangerDir':_0x42bbd1}))return console['log'](_0x5015f2(0x1c6)),{'ready':!![],'skipped':![]};try{return await _0x4f6163['rbOXI'](addEnv,_0x4f6163['wuZOy'],{'url':_0x43e13a?.[_0x5015f2(0x1c7)],'force':_0x43e13a?.[_0x5015f2(0x17c)],'allowInsecureLocalhost':_0x43e13a?.[_0x5015f2(0x19c)],'scope':_0x43e13a?.[_0x5015f2(0x1a7)]},_0x5d735c),{'ready':!![],'skipped':![]};}catch(_0x3adeae){return console['error'](_0x5015f2(0x182),_0x3adeae instanceof Error?_0x3adeae['message']:_0x3adeae),{'ready':![],'skipped':![]};}}export async function start(_0x4677aa,_0x229652,_0x31dfe3){const _0x7a9910=_0xe9931d,_0x49f58e={'taRcT':function(_0x2fcdca,_0x5109ec){return _0x2fcdca+_0x5109ec;},'GEWeA':function(_0x218a14,_0x4e11b8){return _0x218a14(_0x4e11b8);},'JCUYQ':_0x7a9910(0x1a8),'Lhxcf':function(_0x294a12){return _0x294a12();},'iwuCq':'✓\x20Skipping\x20authentication\x20(--skip-auth)','xyKPe':'skipped','fdlBN':'auth','SuYVO':_0x7a9910(0x1aa),'eLnQn':'chromium','TPjbV':_0x7a9910(0x183),'TdQLF':'plugin','FpzdQ':'skills','brAgC':function(_0x3797c3,_0x2b5d99,_0x4af167){return _0x3797c3(_0x2b5d99,_0x4af167);},'iXHXI':function(_0x12b9bf){return _0x12b9bf();},'rELvb':_0x7a9910(0x17a),'szcQm':function(_0x80609a,_0x7007b1){return _0x80609a+_0x7007b1;},'IvWfq':function(_0x188b40,_0x5499c5){return _0x188b40+_0x5499c5;},'UefQH':function(_0x575b82,_0x3f4642){return _0x575b82(_0x3f4642);},'UODzf':function(_0x3eb838,_0x37ff4b){return _0x3eb838+_0x37ff4b;}};console[_0x7a9910(0x1ad)]('\x0a🚀\x20Ranger\x20Setup\x0a');_0x229652?.[_0x7a9910(0x1a7)]!==undefined&&_0x229652['scope']!=='user'&&(console['error'](_0x49f58e[_0x7a9910(0x1a4)]('ranger\x20setup\x20--scope='+_0x49f58e['GEWeA'](String,_0x229652['scope'])+'\x20is\x20no\x20longer\x20supported.\x20'+'Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20',_0x7a9910(0x1c1))),process['exit'](0x1));_0x229652={..._0x229652,'scope':_0x49f58e[_0x7a9910(0x195)]};const _0xadd1d4=!_0x49f58e['GEWeA'](existsSync,_0x49f58e['Lhxcf'](getRangerHomeDir));await _0x49f58e['GEWeA'](ensureRangerDir,_0x49f58e[_0x7a9910(0x195)]);if(_0x229652?.['skipAuth'])console[_0x7a9910(0x1ad)](_0x49f58e[_0x7a9910(0x16d)]),_0x31dfe3?.['trackPhaseEnd'](_0x7a9910(0x16c),{'isFirstRun':_0xadd1d4,'method':_0x49f58e[_0x7a9910(0x1b4)]});else{_0x31dfe3?.['trackPhaseStart'](_0x49f58e[_0x7a9910(0x1af)]);const _0x11caa7=await authenticate(_0x4677aa);_0x31dfe3?.['trackPhaseEnd'](_0x7a9910(0x16c),{'isFirstRun':_0xadd1d4,'method':_0x11caa7['method']});}_0x31dfe3?.['trackPhaseStart'](_0x7a9910(0x18f));_0x229652?.[_0x7a9910(0x19d)]?console[_0x7a9910(0x1ad)](_0x49f58e['SuYVO']):await _0x49f58e[_0x7a9910(0x1b7)](ensureChromium,_0x229652?.[_0x7a9910(0x1a6)]);_0x31dfe3?.[_0x7a9910(0x196)](_0x49f58e[_0x7a9910(0x17e)],{'isFirstRun':_0xadd1d4,'skipped':!!_0x229652?.[_0x7a9910(0x19d)]}),console[_0x7a9910(0x1ad)](_0x49f58e[_0x7a9910(0x1c4)]);const _0x14b8ed=_0x229652?.[_0x7a9910(0x1a7)],_0x493358=_0x229652?.['opencode']??![];let _0x3dc8f6=null;_0x493358?(_0x31dfe3?.[_0x7a9910(0x181)]('plugin'),_0x3dc8f6=await _0x49f58e['GEWeA'](ensureOpencodePluginConfig,_0x14b8ed),_0x31dfe3?.['trackPhaseEnd'](_0x49f58e['TdQLF'],{'isFirstRun':_0xadd1d4,'opencode':!![]})):(_0x31dfe3?.['trackPhaseStart'](_0x7a9910(0x1b8)),await ensureClaudePlugin(_0x14b8ed),_0x31dfe3?.['trackPhaseEnd'](_0x49f58e[_0x7a9910(0x1a1)],{'isFirstRun':_0xadd1d4}));if(_0x493358&&_0x3dc8f6){_0x31dfe3?.[_0x7a9910(0x181)](_0x49f58e['FpzdQ']);try{await _0x49f58e[_0x7a9910(0x191)](installSkill,_0x7a9910(0x1bc),{'level':_0x3dc8f6['scope'],'cliVersion':_0x49f58e['iXHXI'](getCurrentVersion),'platform':'opencode'}),_0x31dfe3?.['trackPhaseEnd'](_0x49f58e['FpzdQ'],{'isFirstRun':_0xadd1d4,'opencode':!![]});}catch(_0xd96454){console['warn'](_0x49f58e[_0x7a9910(0x19a)],_0xd96454 instanceof Error?_0xd96454[_0x7a9910(0x1ab)]:_0xd96454),_0x31dfe3?.['trackPhaseEnd'](_0x49f58e['FpzdQ'],{'isFirstRun':_0xadd1d4,'opencode':!![],'failed':!![]});}}else _0x31dfe3?.[_0x7a9910(0x181)](_0x49f58e[_0x7a9910(0x1b5)]),await _0x49f58e[_0x7a9910(0x1b7)](ensureClaudeSkills,_0x14b8ed),_0x31dfe3?.['trackPhaseEnd']('skills',{'isFirstRun':_0xadd1d4});if(_0x229652?.[_0x7a9910(0x18d)])console[_0x7a9910(0x1ad)]('\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a');else{if(_0x229652?.[_0x7a9910(0x1c7)]){_0x31dfe3?.[_0x7a9910(0x181)](_0x7a9910(0x1c3));const _0x52103f=await ensureLocalEnv({'url':_0x229652['url'],'force':_0x229652?.[_0x7a9910(0x17c)],'allowInsecureLocalhost':_0x229652?.[_0x7a9910(0x19c)],'scope':'user'},_0x31dfe3);_0x31dfe3?.[_0x7a9910(0x196)]('profile',{'isFirstRun':_0xadd1d4,'profileReady':_0x52103f[_0x7a9910(0x192)],'userSkipped':_0x52103f['skipped']});}else console[_0x7a9910(0x1ad)](_0x49f58e[_0x7a9910(0x1bd)](_0x49f58e['IvWfq']('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:'+('\x0a\x20\x20'+_0x49f58e[_0x7a9910(0x1ca)](bold,'ranger\x20profile\x20add\x20<name>'))+_0x7a9910(0x16e),'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:'),_0x7a9910(0x1bb)));}if(_0x493358)console['log']('\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)'),console[_0x7a9910(0x1ad)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console[_0x7a9910(0x1ad)]('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console[_0x7a9910(0x1ad)](_0x7a9910(0x18b));else{const _0x2083dd=bold('/ranger:enable');console[_0x7a9910(0x1ad)](_0x49f58e['UODzf']('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x2083dd+_0x7a9910(0x1b1)+_0x7a9910(0x175)+'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser',_0x7a9910(0x176)));}}
|
|
1
|
+
(function(_0x2a448f,_0x2051cd){const _0x291b28=_0x12ba,_0x5c4609=_0x2a448f();while(!![]){try{const _0x48be58=parseInt(_0x291b28(0x1cf))/0x1*(parseInt(_0x291b28(0x1a4))/0x2)+parseInt(_0x291b28(0x1a2))/0x3*(parseInt(_0x291b28(0x1d1))/0x4)+-parseInt(_0x291b28(0x1d6))/0x5*(parseInt(_0x291b28(0x1bc))/0x6)+parseInt(_0x291b28(0x1bf))/0x7*(parseInt(_0x291b28(0x1b1))/0x8)+parseInt(_0x291b28(0x1e9))/0x9+-parseInt(_0x291b28(0x1ff))/0xa*(-parseInt(_0x291b28(0x1c0))/0xb)+-parseInt(_0x291b28(0x1fc))/0xc;if(_0x48be58===_0x2051cd)break;else _0x5c4609['push'](_0x5c4609['shift']());}catch(_0x512093){_0x5c4609['push'](_0x5c4609['shift']());}}}(_0xa85a,0x26a8f));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x4c2724 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x54695c=>'\x1b[1m'+_0x54695c+'\x1b[0m';export function getPlaywrightVersion(){try{const _0x589e13=require['resolve']('playwright/package.json'),_0xee4670=require(_0x589e13);return _0xee4670['version'];}catch{return null;}}export function installChromiumBinary(_0x1ed062,_0x34e810=![]){const _0x1962b7={'VwsiW':function(_0x2bebf4,_0xaecbb9){return _0x2bebf4(_0xaecbb9);},'zAEAx':function(_0x59a156,_0x2817c9){return _0x59a156(_0x2817c9);},'WJRnW':'--with-deps','FRGLO':function(_0xee57c6,_0x140fb5,_0x5000b8,_0x28a3cf){return _0xee57c6(_0x140fb5,_0x5000b8,_0x28a3cf);},'DoVmQ':'ignore','MYJAq':'inherit','ebqxS':function(_0x15b610,_0x46dd06){return _0x15b610===_0x46dd06;}};return new Promise((_0x1f9529,_0x4cd275)=>{const _0x30859d=_0x12ba,_0x4feff5=[_0x30859d(0x1d5)+_0x1ed062,'install',..._0x34e810?[_0x1962b7['WJRnW']]:[],'chromium'],_0x197c5d=_0x1962b7['FRGLO'](spawn,'npx',_0x4feff5,{'stdio':[_0x1962b7['DoVmQ'],_0x1962b7['MYJAq'],_0x30859d(0x1b4)],'shell':_0x1962b7['ebqxS'](process[_0x30859d(0x1e8)],'win32')});_0x197c5d['on']('close',_0x29a6ff=>{const _0x178985=_0x30859d;_0x29a6ff===0x0?_0x1f9529():_0x1962b7[_0x178985(0x1b0)](_0x4cd275,new Error(_0x178985(0x1f0)+_0x29a6ff));}),_0x197c5d['on'](_0x30859d(0x1c5),_0x2aca6d=>{const _0x2a35b4=_0x30859d;_0x1962b7[_0x2a35b4(0x1c4)](_0x4cd275,_0x2aca6d);});});}export async function authenticate(_0x24b236){const _0x31feaf=_0x12ba,_0x1f784b={'YarAj':function(_0xbe3e83){return _0xbe3e83();},'vzvLF':function(_0x2f1b9c,_0x2ba19b){return _0x2f1b9c instanceof _0x2ba19b;},'JlVMg':_0x31feaf(0x19b),'AugpI':function(_0x59b35c,_0x528cf5){return _0x59b35c(_0x528cf5);},'LbnyB':function(_0x3428b9,_0x1913c1){return _0x3428b9(_0x1913c1);},'btihF':'✓\x20Exported\x20credentials\x20for\x20CI','iQjnV':'✓\x20Stored\x20credentials\x20locally'};if(!_0x24b236){const _0x4885a2=await getToken();if(_0x4885a2){const _0x5519e7=await getCurrentUser(_0x4885a2);if(_0x5519e7['success'])return console['log'](_0x31feaf(0x1e2)+_0x5519e7['user']['organizationName']),{'token':_0x4885a2,'method':'existing_token'};}try{_0x24b236=await _0x1f784b['YarAj'](runDeviceAuthFlow);}catch(_0x4a3454){throw new Error(_0x31feaf(0x1e7)+(_0x1f784b[_0x31feaf(0x1ce)](_0x4a3454,Error)?_0x4a3454[_0x31feaf(0x1a9)]:_0x4a3454));}const _0x453a45=await getCurrentUser(_0x24b236);if(!_0x453a45['success'])throw new Error(_0x31feaf(0x1f2)+_0x453a45[_0x31feaf(0x1c5)]);return console['log'](_0x31feaf(0x1eb)+_0x453a45['user']['organizationName']),{'token':_0x24b236,'method':_0x31feaf(0x1d9)};}console[_0x31feaf(0x1e1)](_0x1f784b[_0x31feaf(0x1f3)]);const _0x5166d5=await _0x1f784b[_0x31feaf(0x1ee)](getCurrentUser,_0x24b236);if(!_0x5166d5[_0x31feaf(0x1ab)]){if(_0x5166d5['status'])throw new Error('Authentication\x20failed:\x20'+_0x5166d5['error']+_0x31feaf(0x1ed));else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x5166d5['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log'](_0x31feaf(0x1eb)+_0x5166d5['user'][_0x31feaf(0x1fe)]),await _0x1f784b[_0x31feaf(0x199)](storeToken,_0x24b236),console['log'](process[_0x31feaf(0x1d7)]['GITHUB_ENV']?_0x1f784b['btihF']:_0x1f784b['iQjnV']),{'token':_0x24b236,'method':'provided_token'};}function _0xa85a(){const _0x25168f=['✓\x20Authenticated\x20to\x20','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','AugpI','HSgbs','Installation\x20failed\x20with\x20exit\x20code\x20','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','JlVMg','install','withDeps','qECXP','UiVVB','fJJyv','DUAxn','✓\x20Created\x20~/.ranger/\x20directory','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','10338492BlRzAZ','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','organizationName','10YONLiq','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','user','cFqMN','LbnyB','method','Validating\x20API\x20token...','CXfle','plugin','kznyj','trackPhaseEnd','chromium','PEojV','3Upxyck','sJKDC','2hpsAtg','✓\x20Playwright\x20Chromium\x20browser\x20found','scope','\x20install\x20chromium','profile','message','rWfgu','success','oDgiq','DjNwT','Kalig','MPhbT','VwsiW','96440JrMcwn','exit','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','inherit','✓\x20~/.ranger/\x20directory\x20already\x20exists','skipAuth','\x20\x20npx\x20playwright@','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','.gitignore','GBBEz','skills','348dsJxpC','ranger\x20profile\x20add\x20<name>','oxCIW','133GJPoxm','2165977odfEZE','The\x20required\x20version\x20(','ilobe','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','zAEAx','error','ready','force','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','mxINu','eljJY','\x0a⚠\x20Skipping\x20Chromium\x20installation.','auth','trackPhaseStart','vzvLF','90801FvWkIq','allowInsecureLocalhost','1025476JlMcFc','oahsh','skipChromium','...','playwright@','1195NWapcv','env','klgzX','device_auth','opencode','skipped','\x20and\x20prompt\x20the\x20coding','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','QHQRx','You\x20can\x20install\x20it\x20manually\x20by\x20running:','\x0a🚀\x20Ranger\x20Setup\x0a','log','✓\x20Already\x20authenticated\x20to\x20','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','GGPRw','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','Authentication\x20failed:\x20','platform','2345688vJsokw','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'];_0xa85a=function(){return _0x25168f;};return _0xa85a();}function _0x12ba(_0xd9a340,_0x2e3851){_0xd9a340=_0xd9a340-0x199;const _0xa85a69=_0xa85a();let _0x12baa0=_0xa85a69[_0xd9a340];return _0x12baa0;}export async function ensureRangerDir(_0x544878){const _0x5bcb99=_0x12ba,_0x440e95={'kznyj':_0x5bcb99(0x1fa)};void _0x544878;const _0x3de11b=getRangerHomeDir();return!existsSync(_0x3de11b)?(await mkdir(_0x3de11b,{'recursive':!![]}),console[_0x5bcb99(0x1e1)](_0x440e95[_0x5bcb99(0x19e)]),{'path':_0x3de11b,'installed':!![]}):(console['log'](_0x5bcb99(0x1b5)),{'path':_0x3de11b,'installed':![]});}export async function ensureChromium(_0x180f9c=![]){const _0x12f677=_0x12ba,_0x996f87={'yddUx':function(_0x575367,_0x307490){return _0x575367(_0x307490);},'Nwelb':_0x12f677(0x1a5),'WOiSW':function(_0x3b02a2){return _0x3b02a2();},'jRfca':function(_0x2f8b6c,_0x4c257c){return _0x2f8b6c??_0x4c257c;},'cFqMN':'confirm','DUAxn':'\x20(fallback\x20version)','awiVQ':'\x0aInstalling\x20Chromium\x20browser...\x0a','FEcUs':function(_0x28819f,_0x37290f,_0x1dc9f){return _0x28819f(_0x37290f,_0x1dc9f);},'oDgiq':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','oahsh':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','DjNwT':function(_0x16b3a7,_0x40a6db){return _0x16b3a7 instanceof _0x40a6db;},'hqHxr':_0x12f677(0x1df),'GBBEz':_0x12f677(0x1e5)};let _0x28d960=![];try{const _0x2aebc0=chromium['executablePath']();_0x28d960=_0x996f87['yddUx'](existsSync,_0x2aebc0);}catch{_0x28d960=![];}if(_0x28d960)return console['log'](_0x996f87['Nwelb']),![];const _0x54aed3=_0x996f87['WOiSW'](getPlaywrightVersion),_0x592f29=_0x996f87['jRfca'](_0x54aed3,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x3b4d5d=!_0x54aed3,_0x1153ae=process['stdin']['isTTY']&&process['stdout']['isTTY'];let _0x36b858=!![];if(_0x1153ae){const {install:_0x1af919}=await _0x4c2724['prompt']([{'type':_0x996f87[_0x12f677(0x202)],'name':_0x12f677(0x1f4),'message':_0x3b4d5d?_0x12f677(0x1fd)+_0x592f29+'\x20now?':_0x12f677(0x1c1)+_0x592f29+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x36b858=_0x1af919;}else console[_0x12f677(0x1e1)](_0x12f677(0x1c8)+_0x592f29+(_0x3b4d5d?_0x996f87[_0x12f677(0x1f9)]:'')+_0x12f677(0x1d4));if(_0x36b858){console['log'](_0x996f87['awiVQ']);try{await _0x996f87['FEcUs'](installChromiumBinary,_0x592f29,_0x180f9c),console[_0x12f677(0x1e1)](_0x996f87[_0x12f677(0x1ac)]);}catch(_0x53d257){console[_0x12f677(0x1c5)](_0x996f87[_0x12f677(0x1d2)],_0x996f87[_0x12f677(0x1ad)](_0x53d257,Error)?_0x53d257[_0x12f677(0x1a9)]:_0x53d257),console['log'](_0x996f87['hqHxr']),console[_0x12f677(0x1e1)](_0x12f677(0x1b7)+_0x592f29+_0x12f677(0x1a7));}}else console[_0x12f677(0x1e1)](_0x12f677(0x1cb)),console['log'](_0x996f87[_0x12f677(0x1ba)]),console[_0x12f677(0x1e1)](_0x12f677(0x1b7)+_0x592f29+_0x12f677(0x1a7));return!![];}export async function writeRangerGitignore(_0x432a63){const _0xf8b95b=_0x12ba,_0x2dfc81={'SMGZe':_0xf8b95b(0x1b9),'UiVVB':function(_0x465af5,_0x1836bf,_0x2f71ac){return _0x465af5(_0x1836bf,_0x2f71ac);},'klgzX':'✓\x20Created\x20.ranger/.gitignore'},_0x4eb6ea=join(_0x432a63,_0x2dfc81['SMGZe']),_0x469c25='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await _0x2dfc81[_0xf8b95b(0x1f7)](writeFile,_0x4eb6ea,_0x469c25),console['log'](_0x2dfc81[_0xf8b95b(0x1d8)]);}export async function ensureLocalEnv(_0x536d5e,_0x14bd16){const _0x2583e=_0x12ba,_0x1607dd={'QHQRx':function(_0x4f9918){return _0x4f9918();},'mqVkW':function(_0x27dbc0,_0x131b8f){return _0x27dbc0!==_0x131b8f;},'PEojV':_0x2583e(0x201),'Kalig':'local','TsCGZ':'✓\x20Local\x20profile\x20already\x20exists','cIlMP':function(_0x5b4758,_0x34f5ec,_0x47edcf,_0x3c0617){return _0x5b4758(_0x34f5ec,_0x47edcf,_0x3c0617);}};if(!_0x1607dd[_0x2583e(0x1de)](findGitRoot)&&_0x1607dd['mqVkW'](_0x536d5e?.['scope'],_0x1607dd[_0x2583e(0x1a1)]))return console['log'](_0x2583e(0x1ec)),{'ready':![],'skipped':!![]};const _0x2acbf6=_0x536d5e?.['scope']==='user'?getRangerHomeDir():undefined;if(findExistingEnv('local',{'locations':[_0x1607dd[_0x2583e(0x1ae)]],'rangerDir':_0x2acbf6}))return console['log'](_0x1607dd['TsCGZ']),{'ready':!![],'skipped':![]};try{return await _0x1607dd['cIlMP'](addEnv,'local',{'url':_0x536d5e?.['url'],'force':_0x536d5e?.[_0x2583e(0x1c7)],'allowInsecureLocalhost':_0x536d5e?.[_0x2583e(0x1d0)],'scope':_0x536d5e?.[_0x2583e(0x1a6)]},_0x14bd16),{'ready':!![],'skipped':![]};}catch(_0x32fe9c){return console['error']('\x0a❌\x20Profile\x20setup\x20failed:',_0x32fe9c instanceof Error?_0x32fe9c[_0x2583e(0x1a9)]:_0x32fe9c),{'ready':![],'skipped':![]};}}export async function start(_0x4681dd,_0xc91495,_0x3e62bd){const _0x19d97d=_0x12ba,_0x55d538={'JdLjf':function(_0x3bdfff,_0x1811bb){return _0x3bdfff!==_0x1811bb;},'dSQVj':function(_0x47d3ae,_0x2dc240){return _0x47d3ae+_0x2dc240;},'OjKfG':function(_0x180e47,_0x27b9b2){return _0x180e47+_0x27b9b2;},'rWfgu':function(_0x3a866c,_0x311af2){return _0x3a866c(_0x311af2);},'HSgbs':'user','oxCIW':function(_0x562830){return _0x562830();},'nAfdU':_0x19d97d(0x1cc),'CXfle':_0x19d97d(0x1db),'zDVmR':'chromium','sJKDC':_0x19d97d(0x1b3),'GGPRw':function(_0x3fd5c5,_0x251f33){return _0x3fd5c5(_0x251f33);},'mxINu':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','MPhbT':_0x19d97d(0x19d),'MRXAL':function(_0xd80e92,_0x3d93b7,_0x2d0c83){return _0xd80e92(_0x3d93b7,_0x2d0c83);},'qECXP':'ranger','WkQrv':_0x19d97d(0x1dd),'eljJY':'skills','fJJyv':'\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','ilobe':function(_0x5de278,_0x1499e0){return _0x5de278+_0x1499e0;},'fGZXQ':_0x19d97d(0x1bd),'tsGPP':_0x19d97d(0x1c3),'PtBBw':function(_0xb0f437,_0x4167da){return _0xb0f437+_0x4167da;}};console[_0x19d97d(0x1e1)](_0x19d97d(0x1e0));_0x55d538['JdLjf'](_0xc91495?.[_0x19d97d(0x1a6)],undefined)&&_0xc91495['scope']!=='user'&&(console[_0x19d97d(0x1c5)](_0x55d538['dSQVj'](_0x55d538['OjKfG']('ranger\x20setup\x20--scope='+_0x55d538[_0x19d97d(0x1aa)](String,_0xc91495['scope'])+'\x20is\x20no\x20longer\x20supported.\x20','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20'),'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.')),process[_0x19d97d(0x1b2)](0x1));_0xc91495={..._0xc91495,'scope':_0x55d538[_0x19d97d(0x1ef)]};const _0xc8cc2d=!_0x55d538[_0x19d97d(0x1aa)](existsSync,_0x55d538[_0x19d97d(0x1be)](getRangerHomeDir));await ensureRangerDir(_0x19d97d(0x201));if(_0xc91495?.[_0x19d97d(0x1b6)])console['log']('✓\x20Skipping\x20authentication\x20(--skip-auth)'),_0x3e62bd?.[_0x19d97d(0x19f)](_0x55d538['nAfdU'],{'isFirstRun':_0xc8cc2d,'method':_0x55d538[_0x19d97d(0x19c)]});else{_0x3e62bd?.[_0x19d97d(0x1cd)](_0x19d97d(0x1cc));const _0x38b8a9=await authenticate(_0x4681dd);_0x3e62bd?.['trackPhaseEnd'](_0x19d97d(0x1cc),{'isFirstRun':_0xc8cc2d,'method':_0x38b8a9[_0x19d97d(0x19a)]});}_0x3e62bd?.[_0x19d97d(0x1cd)](_0x55d538['zDVmR']);_0xc91495?.['skipChromium']?console[_0x19d97d(0x1e1)](_0x55d538[_0x19d97d(0x1a3)]):await _0x55d538[_0x19d97d(0x1e4)](ensureChromium,_0xc91495?.[_0x19d97d(0x1f5)]);_0x3e62bd?.['trackPhaseEnd'](_0x19d97d(0x1a0),{'isFirstRun':_0xc8cc2d,'skipped':!!_0xc91495?.[_0x19d97d(0x1d3)]}),console[_0x19d97d(0x1e1)](_0x55d538[_0x19d97d(0x1c9)]);const _0x29e2fd=_0xc91495?.[_0x19d97d(0x1a6)],_0x1504f7=_0xc91495?.[_0x19d97d(0x1da)]??![];let _0xc880b5=null;_0x1504f7?(_0x3e62bd?.['trackPhaseStart']('plugin'),_0xc880b5=await ensureOpencodePluginConfig(_0x29e2fd),_0x3e62bd?.['trackPhaseEnd'](_0x55d538['MPhbT'],{'isFirstRun':_0xc8cc2d,'opencode':!![]})):(_0x3e62bd?.[_0x19d97d(0x1cd)]('plugin'),await ensureClaudePlugin(_0x29e2fd),_0x3e62bd?.[_0x19d97d(0x19f)](_0x55d538[_0x19d97d(0x1af)],{'isFirstRun':_0xc8cc2d}));if(_0x1504f7&&_0xc880b5){_0x3e62bd?.[_0x19d97d(0x1cd)](_0x19d97d(0x1bb));try{await _0x55d538['MRXAL'](installSkill,_0x55d538[_0x19d97d(0x1f6)],{'level':_0xc880b5['scope'],'cliVersion':getCurrentVersion(),'platform':'opencode'}),_0x3e62bd?.['trackPhaseEnd'](_0x19d97d(0x1bb),{'isFirstRun':_0xc8cc2d,'opencode':!![]});}catch(_0x51d9f2){console['warn'](_0x55d538['WkQrv'],_0x51d9f2 instanceof Error?_0x51d9f2['message']:_0x51d9f2),_0x3e62bd?.[_0x19d97d(0x19f)](_0x55d538['eljJY'],{'isFirstRun':_0xc8cc2d,'opencode':!![],'failed':!![]});}}else _0x3e62bd?.['trackPhaseStart'](_0x19d97d(0x1bb)),await _0x55d538[_0x19d97d(0x1aa)](ensureClaudeSkills,_0x29e2fd),_0x3e62bd?.['trackPhaseEnd'](_0x55d538[_0x19d97d(0x1ca)],{'isFirstRun':_0xc8cc2d});if(_0xc91495?.['skipAuth'])console[_0x19d97d(0x1e1)](_0x55d538[_0x19d97d(0x1f8)]);else{if(_0xc91495?.['url']){_0x3e62bd?.[_0x19d97d(0x1cd)](_0x19d97d(0x1a8));const _0x15b54e=await ensureLocalEnv({'url':_0xc91495['url'],'force':_0xc91495?.[_0x19d97d(0x1c7)],'allowInsecureLocalhost':_0xc91495?.['allowInsecureLocalhost'],'scope':'user'},_0x3e62bd);_0x3e62bd?.['trackPhaseEnd']('profile',{'isFirstRun':_0xc8cc2d,'profileReady':_0x15b54e[_0x19d97d(0x1c6)],'userSkipped':_0x15b54e[_0x19d97d(0x1db)]});}else console[_0x19d97d(0x1e1)](_0x55d538['ilobe'](_0x55d538['dSQVj'](_0x55d538[_0x19d97d(0x1c2)]('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','\x0a\x20\x20'+bold(_0x55d538['fGZXQ'])),_0x19d97d(0x200))+_0x19d97d(0x1fb),_0x19d97d(0x1f1)));}if(_0x1504f7)console[_0x19d97d(0x1e1)](_0x19d97d(0x1e6)),console[_0x19d97d(0x1e1)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console['log'](_0x19d97d(0x1b8)),console['log'](_0x55d538['tsGPP']);else{const _0x586c49=bold('/ranger:enable');console['log'](_0x55d538['PtBBw']('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x586c49+_0x19d97d(0x1dc)+_0x19d97d(0x1e3),'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser')+_0x19d97d(0x1ea));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3dbb79=_0x2935;(function(_0x368026,_0x467622){const _0x259429=_0x2935,_0x3858e1=_0x368026();while(!![]){try{const _0xc29d98=-parseInt(_0x259429(0x21a))/0x1+parseInt(_0x259429(0x237))/0x2+-parseInt(_0x259429(0x236))/0x3*(parseInt(_0x259429(0x211))/0x4)+parseInt(_0x259429(0x20f))/0x5*(parseInt(_0x259429(0x1dd))/0x6)+-parseInt(_0x259429(0x1fb))/0x7+-parseInt(_0x259429(0x223))/0x8*(parseInt(_0x259429(0x22f))/0x9)+parseInt(_0x259429(0x201))/0xa*(parseInt(_0x259429(0x1f6))/0xb);if(_0xc29d98===_0x467622)break;else _0x3858e1['push'](_0x3858e1['shift']());}catch(_0x3c86a2){_0x3858e1['push'](_0x3858e1['shift']());}}}(_0xf656,0x28767));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';function _0x2935(_0x43357b,_0x34f1a5){_0x43357b=_0x43357b-0x1da;const _0xf6567=_0xf656();let _0x293547=_0xf6567[_0x43357b];return _0x293547;}import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x5e49b3=>_0x3dbb79(0x214)+_0x5e49b3+_0x3dbb79(0x1ed),link=(_0x10b0aa,_0x48076d)=>'\x1b]8;;file://'+_0x10b0aa+'\x07'+(_0x48076d||_0x10b0aa)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x1a346c=_0x3dbb79,_0x2f40eb={'Bfufa':function(_0x499ad4,_0x3b4173){return _0x499ad4(_0x3b4173);},'rboGv':_0x1a346c(0x225),'RNumb':_0x1a346c(0x20d),'YkEFs':_0x1a346c(0x1e7),'Exmsq':function(_0x501f24,_0x2ac04b){return _0x501f24!==_0x2ac04b;},'nMphg':function(_0xdd6d6f,_0x50c3b7){return _0xdd6d6f(_0x50c3b7);},'CCyGC':_0x1a346c(0x1e3),'lBjTK':_0x1a346c(0x212),'RUOKw':'debug','NFbfH':_0x1a346c(0x1fc),'beGge':'ignore','zLJXc':'pipe','WozzB':'data'};return new Promise(_0x472b46=>{const _0x33a6bb=_0x1a346c,_0x8d31d7=spawn(_0x2f40eb['lBjTK'],[_0x2f40eb[_0x33a6bb(0x213)],_0x2f40eb[_0x33a6bb(0x1f4)]],{'stdio':[_0x2f40eb['beGge'],_0x2f40eb[_0x33a6bb(0x241)],'pipe']});let _0xbc8df2='';_0x8d31d7['stdout']?.['on'](_0x2f40eb['WozzB'],_0x112bfd=>{_0xbc8df2+=_0x112bfd['toString']();}),_0x8d31d7['stderr']?.['on'](_0x2f40eb[_0x33a6bb(0x234)],_0x5312a5=>{_0xbc8df2+=_0x5312a5['toString']();}),_0x8d31d7['on'](_0x33a6bb(0x1ef),()=>{const _0x29e0fd=_0x33a6bb;_0x2f40eb['Bfufa'](_0x472b46,{'status':_0x2f40eb[_0x29e0fd(0x243)]});}),_0x8d31d7['on'](_0x33a6bb(0x229),_0x51c8c5=>{const _0x17a8c3=_0x33a6bb,_0x2b10fc={'wjYFj':function(_0x45cb75,_0x220c5b){return _0x45cb75!==_0x220c5b;},'cXVeh':_0x2f40eb['RNumb'],'PfnbF':_0x17a8c3(0x210),'BGwla':_0x2f40eb[_0x17a8c3(0x21e)]};if(_0x2f40eb[_0x17a8c3(0x249)](_0x51c8c5,0x0)){_0x472b46({'status':_0x2f40eb['rboGv']});return;}const _0xef5ac8=_0xbc8df2[_0x17a8c3(0x206)]();let _0x323db7=null;if(_0xef5ac8)try{_0x323db7=JSON['parse'](_0xef5ac8);}catch{const _0x4407f8=_0xef5ac8['match'](/\{[\s\S]*\}$/);if(_0x4407f8)try{_0x323db7=JSON['parse'](_0x4407f8[0x0]);}catch{_0x323db7=null;}}const _0x19e83d=Array[_0x17a8c3(0x24e)](_0x323db7?.['plugin'])?_0x323db7?.[_0x17a8c3(0x20c)]:[],_0x2ed9f4=_0x19e83d[_0x17a8c3(0x226)](_0x278cc6=>{const _0x379cd8=_0x17a8c3;if(_0x2b10fc['wjYFj'](typeof _0x278cc6,_0x2b10fc[_0x379cd8(0x22e)]))return![];return _0x278cc6[_0x379cd8(0x1fa)](_0x2b10fc[_0x379cd8(0x205)])||_0x278cc6[_0x379cd8(0x1fa)](_0x2b10fc['BGwla']);});if(_0x2ed9f4){_0x2f40eb[_0x17a8c3(0x22b)](_0x472b46,{'status':_0x17a8c3(0x21f),'details':_0x19e83d['length']>0x0?_0x19e83d['length']+_0x17a8c3(0x1e8):undefined});return;}if(_0x19e83d['length']>0x0){_0x2f40eb['nMphg'](_0x472b46,{'status':_0x2f40eb[_0x17a8c3(0x23d)],'details':_0x19e83d['length']+'\x20plugin(s)\x20configured'});return;}_0x472b46({'status':'not_configured'});});});}async function getSkillsFromDir(_0x3fc56e,_0x33ed71){const _0xf2d75c=_0x3dbb79,_0x5b3d18={'lnyon':function(_0x4763fc,_0x2c9b8a){return _0x4763fc(_0x2c9b8a);},'FkdxK':function(_0x3d7305,_0x22d394,_0x74bb9f){return _0x3d7305(_0x22d394,_0x74bb9f);},'rKgwL':'SKILL.md'};if(!_0x5b3d18[_0xf2d75c(0x21b)](existsSync,_0x3fc56e))return[];const _0x2e187e=[];try{const _0x36ec40=await _0x5b3d18['FkdxK'](readdir,_0x3fc56e,{'withFileTypes':!![]});for(const _0x428338 of _0x36ec40){if(_0x428338['isDirectory']()){const _0x1391f2=join(_0x3fc56e,_0x428338['name'],_0x5b3d18[_0xf2d75c(0x1dc)]);if(_0x5b3d18[_0xf2d75c(0x21b)](existsSync,_0x1391f2)){let _0x392783=_0x428338[_0xf2d75c(0x235)];try{const _0x32c3df=await readFile(_0x1391f2,_0xf2d75c(0x231)),_0x3b134d=_0x32c3df['match'](/name:\s*(.+)/);_0x3b134d&&(_0x392783=_0x3b134d[0x1]['trim']());}catch{}_0x2e187e[_0xf2d75c(0x1ea)]({'name':_0x428338['name'],'displayName':_0x392783,'path':_0x1391f2,'level':_0x33ed71});}}}}catch{return[];}return _0x2e187e;}async function getInstalledSkills(){const _0x418a60=_0x3dbb79,_0x456afc={'XlBKt':function(_0x40a143,_0x42d012,_0x28050c){return _0x40a143(_0x42d012,_0x28050c);},'uGSqD':function(_0x67c26c){return _0x67c26c();},'VUXSB':_0x418a60(0x200),'UZyqQ':'user'},[_0x2fad6f,_0x455c7e]=await Promise['all']([_0x456afc[_0x418a60(0x24f)](getSkillsFromDir,_0x456afc['uGSqD'](getProjectSkillsDir),_0x456afc['VUXSB']),getSkillsFromDir(getUserSkillsDir(),_0x456afc[_0x418a60(0x221)])]);return{'project':_0x2fad6f,'user':_0x455c7e};}async function getEnvironments(){const _0x54e237=_0x3dbb79,_0x109d66={'WgQHq':function(_0x3ced36,_0x35ed02){return _0x3ced36(_0x35ed02);},'ydHTw':function(_0x5176ec,_0x3896c9,_0x37e07a){return _0x5176ec(_0x3896c9,_0x37e07a);},'OmwAa':function(_0x37ebcf,_0x27b4ae){return _0x37ebcf(_0x27b4ae);},'clnAN':function(_0x160efe){return _0x160efe();},'RBKFV':function(_0x666018,_0x3848f7){return _0x666018(_0x3848f7);}},{envNames:_0xd094ca,activeEnv:_0x485235}=await getEnvNames(),_0x1a7bc6=_0x109d66[_0x54e237(0x1fd)](getRangerDir);if(!_0x109d66[_0x54e237(0x1fe)](existsSync,_0x1a7bc6))return{'envs':[],'activeEnv':null};const _0x5744af=_0xd094ca[_0x54e237(0x22d)](_0x4702f2=>{const _0xd68b08=_0x54e237,_0x439f3d=_0x109d66[_0xd68b08(0x215)](getEnvDir,_0x4702f2),_0x1987e0=_0x109d66[_0xd68b08(0x1ee)](join,_0x439f3d,_0xd68b08(0x239)),_0xd04975=join(_0x439f3d,_0xd68b08(0x227)),_0x40d288=join(_0x439f3d,'auth.json.enc');return{'name':_0x4702f2,'settingsPath':_0x109d66[_0xd68b08(0x222)](existsSync,_0x1987e0)?_0x1987e0:'(not\x20found)','hasPlaintextAuth':existsSync(_0xd04975),'hasEncryptedAuth':_0x109d66['WgQHq'](existsSync,_0x40d288),'isActive':_0x4702f2===_0x485235};});return{'envs':_0x5744af,'activeEnv':_0x485235};}function _0xf656(){const _0xd83904=['includes','1476965yXLQxR','config','clnAN','RBKFV','log','project','44910ulRCgP','roXob','bwyip','\x20profiles\x20configured\x20(','PfnbF','trim','BFzRq','xUumR','\x20\x20\x20\x20','\x20cloud','\x20\x20\x20\x20Auth:\x20','plugin','string','XUcfZ','20FwEMtX','@ranger-testing/opencode-plugin','4ggxPNz','opencode','RUOKw','\x1b[1m','WgQHq','Root:\x20','\x20\x20Active:\x20','path','enabled','241132iGldlw','lnyon','\x20[cloud]','\x0a\x20\x20No\x20active\x20profile\x20set','YkEFs','configured','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','UZyqQ','OmwAa','3376pPxtij','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','not_installed','some','auth.json','hasPlaintextAuth','close','join','Bfufa','VxVdJ','map','cXVeh','1467hokApd','fkTah','utf-8','success','\x0a📊\x20Ranger\x20Status\x0a','WozzB','name','264141ZFWUaQ','143796WYHycO','cached\x20(updated\x20','settings.json','Bddau','has','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','CCyGC','version','slGKD','SqGAK','zLJXc','isActive','rboGv','plaintext','vRPGY','env','API\x20Environment:\x20','none','Exmsq','\x20\x20\x20\x20Session:\x20','ranger@trailhead','details','qDCkL','isArray','XlBKt','\x20\x20User-level:','TCiYN','rKgwL','360336rtaqLa','\x20\x20Not\x20installed','cwd','displayName','rfwHO','length','not_configured','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','HrHTu','kQBwF','opencode-plugin','\x20plugin(s)\x20configured','\x20\x20Run:\x20ranger\x20skillup','push','dwhuo','hasEncryptedAuth','\x1b[0m','ydHTw','error','Version:\x20','no\x20session','\x20\x20Run:\x20ranger\x20setup\x20--opencode','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','NFbfH','No\x20skills\x20installed','1133UOAfuA','API\x20URL:\x20','BlMkM','\x20\x20Run:\x20ranger\x20setup\x20[token]'];_0xf656=function(){return _0xd83904;};return _0xf656();}export async function status(){const _0x292582=_0x3dbb79,_0x440016={'rfwHO':function(_0x2f1198){return _0x2f1198();},'roXob':function(_0x51acce,_0x159999){return _0x51acce!==_0x159999;},'WYtra':function(_0x36d52f,_0x2b99d6){return _0x36d52f(_0x2b99d6);},'SqGAK':function(_0x29ae7f,_0x2dc9b4){return _0x29ae7f===_0x2dc9b4;},'BlMkM':_0x292582(0x21f),'VxVdJ':'\x20\x20Not\x20configured','VTKTe':_0x292582(0x1f2),'dwhuo':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','bwyip':'\x0a---\x20Claude\x20Code\x20Plugin\x20---','triNK':function(_0x1ddf68,_0x242fa5){return _0x1ddf68(_0x242fa5);},'BFzRq':'unknown','lEbGC':_0x292582(0x219),'fkTah':'disabled','slGKD':function(_0x452b77,_0x4c4e9b){return _0x452b77(_0x4c4e9b);},'XUcfZ':_0x292582(0x1f5),'Bddau':function(_0x386bdf,_0x26ad7d){return _0x386bdf(_0x26ad7d);},'HrHTu':function(_0x2633ba,_0x4bc8e8){return _0x2633ba>_0x4bc8e8;},'TCiYN':function(_0x2fd43d,_0x1fe444,_0x32f850){return _0x2fd43d(_0x1fe444,_0x32f850);},'pFWTI':'\x0a---\x20Profiles\x20---','Opjes':function(_0x21fcb5){return _0x21fcb5();},'XacWU':function(_0x3d1e95,_0x16a08a){return _0x3d1e95+_0x16a08a;},'btDSw':'No\x20profiles\x20configured','vRPGY':function(_0x33c7df,_0x159e31){return _0x33c7df>_0x159e31;},'kQBwF':'\x20(active)','xUumR':_0x292582(0x1f1),'qDCkL':'encrypted','BuYfm':_0x292582(0x244)};console[_0x292582(0x1ff)](_0x292582(0x233));const _0x16b3bf=process[_0x292582(0x1df)](),_0x5703a2=getRangerDir();if(!existsSync(_0x5703a2)){console['log'](_0x292582(0x216)+link(_0x16b3bf,bold(basename(_0x16b3bf)))),console['log']('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console[_0x292582(0x1ff)](_0x292582(0x224));return;}console[_0x292582(0x1ff)]('Root:\x20'+link(_0x16b3bf,bold(basename(_0x16b3bf))));const _0xab9074=_0x440016[_0x292582(0x1e1)](getCurrentVersion),_0x4bcee2=getLatestVersion();if(_0x4bcee2[_0x292582(0x23e)]&&_0x440016[_0x292582(0x202)](_0x4bcee2['version'],_0xab9074))console[_0x292582(0x1ff)]('Version:\x20'+_0xab9074+'\x20(latest:\x20'+_0x4bcee2['version']+')'),console[_0x292582(0x1ff)]('\x20\x20Run:\x20ranger\x20update');else _0x4bcee2['version']?console[_0x292582(0x1ff)](_0x292582(0x1f0)+_0xab9074+'\x20(up\x20to\x20date)'):console[_0x292582(0x1ff)]('Version:\x20'+_0xab9074);const _0x37ed3e=await getToken();if(_0x37ed3e){const _0x330ed8=await getCurrentUser(_0x37ed3e);_0x330ed8[_0x292582(0x232)]?console[_0x292582(0x1ff)]('Organization:\x20'+_0x440016['WYtra'](bold,_0x330ed8['user']['organizationName'])):(console['log'](_0x292582(0x23c)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0x292582(0x1ff)]('API\x20Token:\x20✗\x20Not\x20found'),console['log'](_0x292582(0x1f9));process[_0x292582(0x246)]['DEBUG']&&(console[_0x292582(0x1ff)](_0x292582(0x247)+getCurrentEnvironment()),console[_0x292582(0x1ff)](_0x292582(0x1f7)+getApiBaseUrl()));console[_0x292582(0x1ff)]('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x5a4217=await getOpencodePluginStatus();if(_0x440016[_0x292582(0x240)](_0x5a4217['status'],_0x440016[_0x292582(0x1f8)]))console[_0x292582(0x1ff)]('\x20\x20'+bold(_0x292582(0x210))+':\x20configured'),_0x5a4217['details']&&console['log']('\x20\x20'+_0x5a4217['details']);else _0x5a4217['status']===_0x292582(0x1e3)?(console[_0x292582(0x1ff)](_0x440016[_0x292582(0x22c)]),_0x5a4217[_0x292582(0x24c)]&&console['log']('\x20\x20'+_0x5a4217[_0x292582(0x24c)]),console[_0x292582(0x1ff)](_0x440016['VTKTe'])):console[_0x292582(0x1ff)](_0x440016[_0x292582(0x1eb)]);console['log'](_0x440016[_0x292582(0x203)]);const _0x24b98c=await _0x440016['triNK'](getPluginInfo,_0x292582(0x24b));if(_0x24b98c){const _0x4d7db4=_0x24b98c['scope']||_0x440016[_0x292582(0x207)],_0x9aa320=_0x24b98c[_0x292582(0x219)]?_0x440016['lEbGC']:_0x440016[_0x292582(0x230)];console[_0x292582(0x1ff)]('\x20\x20'+_0x440016['slGKD'](bold,'ranger@trailhead')+':\x20installed\x20('+_0x4d7db4+',\x20'+_0x9aa320+')');}else console[_0x292582(0x1ff)](_0x292582(0x1de)),console[_0x292582(0x1ff)](_0x292582(0x220));console[_0x292582(0x1ff)]('\x0a---\x20Skills\x20---');const {project:_0x8cb6b0,user:_0x3874e6}=await _0x440016[_0x292582(0x1e1)](getInstalledSkills),_0xa23d54=_0x8cb6b0['filter'](_0x5107da=>RANGER_MANAGED_SKILLS[_0x292582(0x1fa)](_0x5107da['name'])),_0x31c0dd=_0x3874e6['filter'](_0x56aef7=>RANGER_MANAGED_SKILLS['includes'](_0x56aef7[_0x292582(0x235)])),_0x42f703=_0xa23d54[_0x292582(0x1e2)]+_0x31c0dd[_0x292582(0x1e2)];if(_0x440016['SqGAK'](_0x42f703,0x0))console[_0x292582(0x1ff)](_0x440016[_0x292582(0x20e)]),console['log'](_0x292582(0x1e9));else{if(_0xa23d54['length']>0x0){console['log']('\x20\x20Project-level:');for(const _0x2a90e3 of _0xa23d54){console[_0x292582(0x1ff)]('\x20\x20\x20\x20'+bold(_0x2a90e3[_0x292582(0x1e0)])+':\x20'+link(_0x2a90e3[_0x292582(0x218)],_0x440016[_0x292582(0x23a)](basename,_0x2a90e3['path'])));}}if(_0x440016[_0x292582(0x1e5)](_0x31c0dd[_0x292582(0x1e2)],0x0)){console[_0x292582(0x1ff)](_0x292582(0x1da));for(const _0x294932 of _0x31c0dd){console[_0x292582(0x1ff)](_0x292582(0x209)+bold(_0x294932['displayName'])+':\x20'+_0x440016[_0x292582(0x1db)](link,_0x294932[_0x292582(0x218)],basename(_0x294932[_0x292582(0x218)])));}}}console[_0x292582(0x1ff)](_0x440016['pFWTI']);const {envs:_0x1563e7,activeEnv:_0x391aa8}=await _0x440016['Opjes'](getEnvironments);let _0x20885d=[];if(_0x37ed3e)try{_0x20885d=await listCloudProfiles();}catch{}const _0x217c56=_0x440016['XacWU'](_0x1563e7[_0x292582(0x1e2)],_0x20885d[_0x292582(0x1e2)]);if(_0x217c56===0x0)console[_0x292582(0x1ff)](_0x440016['btDSw']),console[_0x292582(0x1ff)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0x440016[_0x292582(0x245)](_0x217c56,0x5)){const _0x14aad8=[];_0x20885d['length']>0x0&&_0x14aad8['push'](_0x20885d['length']+_0x292582(0x20a)),_0x1563e7['length']>0x0&&_0x14aad8['push'](_0x1563e7[_0x292582(0x1e2)]+'\x20local'),console['log'](_0x217c56+_0x292582(0x204)+_0x14aad8[_0x292582(0x22a)](',\x20')+')'),_0x391aa8&&console[_0x292582(0x1ff)](_0x292582(0x217)+bold(_0x391aa8)),console[_0x292582(0x1ff)](_0x292582(0x1f3));}else{for(const _0x1ff3af of _0x20885d){const _0x15aa13=_0x1ff3af['name']===_0x391aa8?_0x440016['kQBwF']:'';console['log']('\x20\x20'+bold(_0x1ff3af[_0x292582(0x235)])+_0x292582(0x21c)+_0x15aa13);const _0x20859b=_0x1ff3af['sessionUpdatedAt']?_0x292582(0x238)+_0x1ff3af['sessionUpdatedAt']+')':_0x440016[_0x292582(0x208)];console['log'](_0x292582(0x24a)+_0x20859b);}const _0x3b51d4=new Set(_0x20885d['map'](_0x3b27c1=>_0x3b27c1[_0x292582(0x235)]));for(const _0x34d269 of _0x1563e7){if(_0x3b51d4[_0x292582(0x23b)](_0x34d269['name']))continue;const _0x20b0c5=_0x34d269[_0x292582(0x242)]?_0x440016[_0x292582(0x1e6)]:'',_0x5e6a49=_0x34d269[_0x292582(0x1ec)]?_0x440016[_0x292582(0x24d)]:_0x34d269[_0x292582(0x228)]?_0x440016['BuYfm']:_0x292582(0x248);console['log']('\x20\x20'+_0x440016[_0x292582(0x23f)](bold,_0x34d269['name'])+'\x20[local]'+_0x20b0c5),console['log'](_0x292582(0x20b)+_0x5e6a49),_0x34d269['settingsPath']!=='(not\x20found)'&&console[_0x292582(0x1ff)]('\x20\x20\x20\x20Settings:\x20'+link(_0x34d269['settingsPath'],basename(_0x34d269['settingsPath'])));}if(!_0x391aa8){console['log'](_0x292582(0x21d));const _0x55e03d=[..._0x20885d[_0x292582(0x22d)](_0x818daf=>_0x818daf['name']),..._0x1563e7['filter'](_0x5886a3=>!_0x3b51d4['has'](_0x5886a3['name']))[_0x292582(0x22d)](_0x3e3f5d=>_0x3e3f5d['name'])];console['log'](_0x292582(0x1e4)+_0x55e03d[_0x292582(0x22a)](',\x20')+')');}}}console['log']('');}
|
|
1
|
+
const _0x5eef89=_0x1876;(function(_0x70a5e0,_0x351e6a){const _0x50774e=_0x1876,_0x540809=_0x70a5e0();while(!![]){try{const _0x231a95=parseInt(_0x50774e(0x221))/0x1*(-parseInt(_0x50774e(0x20a))/0x2)+parseInt(_0x50774e(0x1f7))/0x3+parseInt(_0x50774e(0x1d7))/0x4+parseInt(_0x50774e(0x215))/0x5*(parseInt(_0x50774e(0x1ba))/0x6)+parseInt(_0x50774e(0x1ef))/0x7*(-parseInt(_0x50774e(0x1c0))/0x8)+parseInt(_0x50774e(0x1c4))/0x9*(-parseInt(_0x50774e(0x1f5))/0xa)+parseInt(_0x50774e(0x1f4))/0xb;if(_0x231a95===_0x351e6a)break;else _0x540809['push'](_0x540809['shift']());}catch(_0x4b04c6){_0x540809['push'](_0x540809['shift']());}}}(_0x4e45,0xf3e1f));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';function _0x4e45(){const _0x2a0325=['TvVQK','3923980JMwmYu','some','\x1b]8;;\x07','isDirectory','API\x20Token:\x20✗\x20Not\x20found','scope','yUqTF','\x20\x20Active:\x20','(not\x20found)','\x20\x20Run:\x20ranger\x20setup\x20[token]','\x20\x20Run:\x20ranger\x20setup\x20--opencode','trim','log','EahJd','sessionUpdatedAt','Version:\x20','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','qHOHw','name','fAXzc','encrypted','\x20\x20Project-level:','match','toString','2898SQpdkO','\x0a📊\x20Ranger\x20Status\x0a','settingsPath','isActive','nYHNg','23437359SFcWCG','220QPpTSt','@ranger-testing/opencode-plugin','4637121ZBPcJd','\x20plugin(s)\x20configured','version','stdout','eBZIO','PWPDd','data','filter','LwKEz','DEBUG','\x20profiles\x20configured\x20(','cmvyU','lvdPK','has','length','\x20[local]','opencode-plugin','\x20\x20\x20\x20','includes','10FvSTeN','NBKzB','status','path',':\x20configured','\x1b[1m','No\x20profiles\x20configured','JuWii','\x20\x20\x20\x20Settings:\x20','details','\x20(latest:\x20','6245GvcyrD',':\x20installed\x20(','settings.json','configured','project','kXEpC','glAcb','gOKou','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','YiVeQ','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','133127oRVbFb','iljEz','not_installed','TVVqh','iJZkn','ZNlyL','618pUFTrw','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','organizationName','unknown','EeyHl','displayName','31168uBAYTR','\x0a\x20\x20No\x20active\x20profile\x20set','auth.json','\x20[cloud]','617112sdLckV','user','AFCfH','vgCQn','merlh','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','GwASg','opencode','\x20\x20Not\x20installed','iRQRt','map','API\x20URL:\x20','plaintext','cached\x20(updated\x20','Root:\x20','API\x20Environment:\x20','eGxKV','\x20\x20User-level:'];_0x4e45=function(){return _0x2a0325;};return _0x4e45();}import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x136466=>_0x5eef89(0x20f)+_0x136466+'\x1b[0m',link=(_0x1fd636,_0xbe65c8)=>'\x1b]8;;file://'+_0x1fd636+'\x07'+(_0xbe65c8||_0x1fd636)+_0x5eef89(0x1d9);function _0x1876(_0x4e33bc,_0x64e9ba){_0x4e33bc=_0x4e33bc-0x1b9;const _0x4e455a=_0x4e45();let _0x1876b9=_0x4e455a[_0x4e33bc];return _0x1876b9;}async function getOpencodePluginStatus(){const _0x3de4ad=_0x5eef89,_0x16fba0={'eBZIO':_0x3de4ad(0x207),'glAcb':_0x3de4ad(0x223),'HKXIZ':function(_0x25fdb5,_0x55a7e4){return _0x25fdb5(_0x55a7e4);},'IvNkA':function(_0x416456,_0x2e51e9){return _0x416456>_0x2e51e9;},'TvVQK':'not_configured','JuWii':function(_0xaeacac,_0xb6ac07,_0x1ac92c,_0x16febd){return _0xaeacac(_0xb6ac07,_0x1ac92c,_0x16febd);},'EeyHl':'config','lvdPK':_0x3de4ad(0x1fd),'YiVeQ':'close'};return new Promise(_0x112ed1=>{const _0x36354f=_0x3de4ad,_0x26b8f4={'mdGez':_0x16fba0[_0x36354f(0x21b)]},_0x41e89c=_0x16fba0[_0x36354f(0x211)](spawn,_0x36354f(0x1cb),['debug',_0x16fba0[_0x36354f(0x1be)]],{'stdio':['ignore','pipe','pipe']});let _0x3a290b='';_0x41e89c[_0x36354f(0x1fa)]?.['on'](_0x16fba0['lvdPK'],_0x5bb722=>{_0x3a290b+=_0x5bb722['toString']();}),_0x41e89c['stderr']?.['on'](_0x16fba0[_0x36354f(0x203)],_0x340352=>{const _0x142ddc=_0x36354f;_0x3a290b+=_0x340352[_0x142ddc(0x1ee)]();}),_0x41e89c['on']('error',()=>{_0x112ed1({'status':_0x26b8f4['mdGez']});}),_0x41e89c['on'](_0x16fba0[_0x36354f(0x21e)],_0x24b99c=>{const _0x266463=_0x36354f,_0x15c3bf={'nYHNg':function(_0x3b2300,_0x5d3ee9){return _0x3b2300!==_0x5d3ee9;},'iljEz':_0x16fba0[_0x266463(0x1fb)]};if(_0x24b99c!==0x0){_0x112ed1({'status':_0x16fba0[_0x266463(0x21b)]});return;}const _0x7d938=_0x3a290b['trim']();let _0x124c4f=null;if(_0x7d938)try{_0x124c4f=JSON['parse'](_0x7d938);}catch{const _0x1002c7=_0x7d938[_0x266463(0x1ed)](/\{[\s\S]*\}$/);if(_0x1002c7)try{_0x124c4f=JSON['parse'](_0x1002c7[0x0]);}catch{_0x124c4f=null;}}const _0x25f678=Array['isArray'](_0x124c4f?.['plugin'])?_0x124c4f?.['plugin']:[],_0x54f4c5=_0x25f678[_0x266463(0x1d8)](_0x278b27=>{const _0x362812=_0x266463;if(_0x15c3bf[_0x362812(0x1f3)](typeof _0x278b27,'string'))return![];return _0x278b27[_0x362812(0x209)](_0x362812(0x1f6))||_0x278b27['includes'](_0x15c3bf[_0x362812(0x222)]);});if(_0x54f4c5){_0x16fba0['HKXIZ'](_0x112ed1,{'status':_0x266463(0x218),'details':_0x25f678[_0x266463(0x205)]>0x0?_0x25f678[_0x266463(0x205)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x16fba0['IvNkA'](_0x25f678[_0x266463(0x205)],0x0)){_0x112ed1({'status':_0x16fba0[_0x266463(0x1d6)],'details':_0x25f678['length']+_0x266463(0x1f8)});return;}_0x112ed1({'status':_0x16fba0[_0x266463(0x1d6)]});});});}async function getSkillsFromDir(_0x256c50,_0x39b6e0){const _0x3aa096=_0x5eef89,_0x10e404={'PWPDd':function(_0x45ac91,_0x265894){return _0x45ac91(_0x265894);},'esgPs':function(_0x4c03fc,_0x5f50a7,_0x124971){return _0x4c03fc(_0x5f50a7,_0x124971);},'LwKEz':'SKILL.md','cmvyU':function(_0x811ddd,_0x166d0b){return _0x811ddd(_0x166d0b);}};if(!_0x10e404[_0x3aa096(0x1fc)](existsSync,_0x256c50))return[];const _0x594d11=[];try{const _0x5c6de6=await _0x10e404['esgPs'](readdir,_0x256c50,{'withFileTypes':!![]});for(const _0x2d95b8 of _0x5c6de6){if(_0x2d95b8[_0x3aa096(0x1da)]()){const _0x46c354=join(_0x256c50,_0x2d95b8[_0x3aa096(0x1e9)],_0x10e404[_0x3aa096(0x1ff)]);if(_0x10e404[_0x3aa096(0x202)](existsSync,_0x46c354)){let _0x33498c=_0x2d95b8['name'];try{const _0x33c24f=await readFile(_0x46c354,'utf-8'),_0x5ef705=_0x33c24f[_0x3aa096(0x1ed)](/name:\s*(.+)/);_0x5ef705&&(_0x33498c=_0x5ef705[0x1][_0x3aa096(0x1e2)]());}catch{}_0x594d11['push']({'name':_0x2d95b8[_0x3aa096(0x1e9)],'displayName':_0x33498c,'path':_0x46c354,'level':_0x39b6e0});}}}}catch{return[];}return _0x594d11;}async function getInstalledSkills(){const _0x37c64d=_0x5eef89,_0x43ce51={'hojNz':function(_0x31141e,_0x412574,_0x363286){return _0x31141e(_0x412574,_0x363286);},'TVVqh':function(_0x56aef1){return _0x56aef1();},'iQBGU':'user'},[_0x2b943d,_0x3fc39d]=await Promise['all']([getSkillsFromDir(getProjectSkillsDir(),_0x37c64d(0x219)),_0x43ce51['hojNz'](getSkillsFromDir,_0x43ce51[_0x37c64d(0x224)](getUserSkillsDir),_0x43ce51['iQBGU'])]);return{'project':_0x2b943d,'user':_0x3fc39d};}async function getEnvironments(){const _0xeecf5d=_0x5eef89,_0x3981cf={'iJZkn':function(_0x432d3e,_0x51b22a){return _0x432d3e(_0x51b22a);},'ZNlyL':function(_0x376511,_0xe5b72a,_0x7dab73){return _0x376511(_0xe5b72a,_0x7dab73);},'qHOHw':function(_0x55eafa){return _0x55eafa();},'fAXzc':function(_0xa31fe){return _0xa31fe();}},{envNames:_0x42a5d1,activeEnv:_0x42714d}=await _0x3981cf[_0xeecf5d(0x1e8)](getEnvNames),_0x47bb0c=_0x3981cf[_0xeecf5d(0x1ea)](getRangerDir);if(!_0x3981cf['iJZkn'](existsSync,_0x47bb0c))return{'envs':[],'activeEnv':null};const _0x45706a=_0x42a5d1[_0xeecf5d(0x1ce)](_0x4fdf0c=>{const _0x3c4c6c=_0xeecf5d,_0x56bb70=_0x3981cf[_0x3c4c6c(0x225)](getEnvDir,_0x4fdf0c),_0x30cb31=_0x3981cf[_0x3c4c6c(0x1b9)](join,_0x56bb70,_0x3c4c6c(0x217)),_0x5c91cc=join(_0x56bb70,_0x3c4c6c(0x1c2)),_0x1df43d=_0x3981cf[_0x3c4c6c(0x1b9)](join,_0x56bb70,'auth.json.enc');return{'name':_0x4fdf0c,'settingsPath':_0x3981cf[_0x3c4c6c(0x225)](existsSync,_0x30cb31)?_0x30cb31:_0x3c4c6c(0x1df),'hasPlaintextAuth':_0x3981cf[_0x3c4c6c(0x225)](existsSync,_0x5c91cc),'hasEncryptedAuth':_0x3981cf[_0x3c4c6c(0x225)](existsSync,_0x1df43d),'isActive':_0x4fdf0c===_0x42714d};});return{'envs':_0x45706a,'activeEnv':_0x42714d};}export async function status(){const _0x74912=_0x5eef89,_0xe6627e={'TUSIW':function(_0x1e8b51){return _0x1e8b51();},'vgCQn':function(_0x1a6ad6,_0x3b1a65){return _0x1a6ad6(_0x3b1a65);},'fDKrq':function(_0x4864f4,_0x26e915){return _0x4864f4(_0x26e915);},'Xhsiz':function(_0x14e6e1,_0x2bb096){return _0x14e6e1(_0x2bb096);},'ftuRi':function(_0x39eeb8,_0x414a30){return _0x39eeb8(_0x414a30);},'bpsKo':function(_0x1ce96e){return _0x1ce96e();},'NaWyW':function(_0x238dda){return _0x238dda();},'VZQJe':function(_0x21d46f,_0x4d9787){return _0x21d46f(_0x4d9787);},'Ctnwc':'\x0a---\x20OpenCode\x20Plugin\x20---','yUqTF':function(_0x562b5a,_0x32e418){return _0x562b5a===_0x32e418;},'Vfmcg':function(_0x1ef0ca,_0x4e9891){return _0x1ef0ca(_0x4e9891);},'mAaBp':_0x74912(0x1f6),'AFCfH':'not_configured','XMEXZ':_0x74912(0x1e1),'daDgh':_0x74912(0x21f),'kXEpC':'\x0a---\x20Claude\x20Code\x20Plugin\x20---','merlh':'ranger@trailhead','iRQRt':_0x74912(0x1cc),'NBKzB':_0x74912(0x1bb),'WmyRo':'\x0a---\x20Skills\x20---','wqhbN':function(_0x5ecb6f){return _0x5ecb6f();},'GwASg':function(_0x39b7a6,_0x54170a){return _0x39b7a6+_0x54170a;},'EahJd':function(_0x2f8648,_0x22e3f4){return _0x2f8648>_0x22e3f4;},'gOKou':_0x74912(0x1ec),'JwEaX':_0x74912(0x1d5),'VetBF':'\x0a---\x20Profiles\x20---','TQrJQ':function(_0x30f8be){return _0x30f8be();},'MFdOD':_0x74912(0x210),'SOMxZ':'no\x20session','eGxKV':'\x20(active)','tqICb':'(not\x20found)'};console[_0x74912(0x1e3)](_0x74912(0x1f0));const _0x14284b=process['cwd'](),_0x5b6d39=_0xe6627e['TUSIW'](getRangerDir);if(!_0xe6627e[_0x74912(0x1c7)](existsSync,_0x5b6d39)){console[_0x74912(0x1e3)](_0x74912(0x1d2)+link(_0x14284b,bold(_0xe6627e['fDKrq'](basename,_0x14284b)))),console['log'](_0x74912(0x220)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x74912(0x1d2)+link(_0x14284b,_0xe6627e['Xhsiz'](bold,_0xe6627e['ftuRi'](basename,_0x14284b))));const _0x56984f=_0xe6627e['bpsKo'](getCurrentVersion),_0x282f9b=_0xe6627e['NaWyW'](getLatestVersion);if(_0x282f9b[_0x74912(0x1f9)]&&_0x282f9b['version']!==_0x56984f)console['log'](_0x74912(0x1e6)+_0x56984f+_0x74912(0x214)+_0x282f9b['version']+')'),console[_0x74912(0x1e3)]('\x20\x20Run:\x20ranger\x20update');else _0x282f9b[_0x74912(0x1f9)]?console[_0x74912(0x1e3)]('Version:\x20'+_0x56984f+'\x20(up\x20to\x20date)'):console[_0x74912(0x1e3)]('Version:\x20'+_0x56984f);const _0x718982=await getToken();if(_0x718982){const _0x5be1f0=await getCurrentUser(_0x718982);_0x5be1f0['success']?console['log']('Organization:\x20'+_0xe6627e['VZQJe'](bold,_0x5be1f0[_0x74912(0x1c5)][_0x74912(0x1bc)])):(console['log'](_0x74912(0x1c9)),console[_0x74912(0x1e3)](_0x74912(0x1e0)));}else console['log'](_0x74912(0x1db)),console[_0x74912(0x1e3)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process['env'][_0x74912(0x200)]&&(console[_0x74912(0x1e3)](_0x74912(0x1d3)+getCurrentEnvironment()),console['log'](_0x74912(0x1cf)+_0xe6627e['NaWyW'](getApiBaseUrl)));console[_0x74912(0x1e3)](_0xe6627e['Ctnwc']);const _0x5d4ed1=await getOpencodePluginStatus();if(_0xe6627e[_0x74912(0x1dd)](_0x5d4ed1[_0x74912(0x20c)],_0x74912(0x218)))console[_0x74912(0x1e3)]('\x20\x20'+_0xe6627e['Vfmcg'](bold,_0xe6627e['mAaBp'])+_0x74912(0x20e)),_0x5d4ed1['details']&&console[_0x74912(0x1e3)]('\x20\x20'+_0x5d4ed1[_0x74912(0x213)]);else _0xe6627e['yUqTF'](_0x5d4ed1['status'],_0xe6627e[_0x74912(0x1c6)])?(console['log']('\x20\x20Not\x20configured'),_0x5d4ed1[_0x74912(0x213)]&&console['log']('\x20\x20'+_0x5d4ed1['details']),console['log'](_0xe6627e['XMEXZ'])):console[_0x74912(0x1e3)](_0xe6627e['daDgh']);console[_0x74912(0x1e3)](_0xe6627e[_0x74912(0x21a)]);const _0x53a810=await getPluginInfo(_0xe6627e[_0x74912(0x1c8)]);if(_0x53a810){const _0x611d2d=_0x53a810[_0x74912(0x1dc)]||_0x74912(0x1bd),_0x101c47=_0x53a810['enabled']?'enabled':'disabled';console[_0x74912(0x1e3)]('\x20\x20'+bold('ranger@trailhead')+_0x74912(0x216)+_0x611d2d+',\x20'+_0x101c47+')');}else console[_0x74912(0x1e3)](_0xe6627e[_0x74912(0x1cd)]),console[_0x74912(0x1e3)](_0xe6627e[_0x74912(0x20b)]);console[_0x74912(0x1e3)](_0xe6627e['WmyRo']);const {project:_0x4f6f8c,user:_0x4bc40c}=await _0xe6627e['wqhbN'](getInstalledSkills),_0x2d4651=_0x4f6f8c[_0x74912(0x1fe)](_0x1bec69=>RANGER_MANAGED_SKILLS['includes'](_0x1bec69['name'])),_0x9e049f=_0x4bc40c[_0x74912(0x1fe)](_0x54996=>RANGER_MANAGED_SKILLS[_0x74912(0x209)](_0x54996[_0x74912(0x1e9)])),_0x5c46d9=_0xe6627e[_0x74912(0x1ca)](_0x2d4651[_0x74912(0x205)],_0x9e049f['length']);if(_0x5c46d9===0x0)console['log']('No\x20skills\x20installed'),console[_0x74912(0x1e3)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0xe6627e['EahJd'](_0x2d4651['length'],0x0)){console['log'](_0xe6627e[_0x74912(0x21c)]);for(const _0x1039b0 of _0x2d4651){console['log'](_0x74912(0x208)+_0xe6627e['Xhsiz'](bold,_0x1039b0[_0x74912(0x1bf)])+':\x20'+link(_0x1039b0['path'],basename(_0x1039b0['path'])));}}if(_0x9e049f['length']>0x0){console[_0x74912(0x1e3)](_0xe6627e['JwEaX']);for(const _0x5e442d of _0x9e049f){console['log']('\x20\x20\x20\x20'+bold(_0x5e442d['displayName'])+':\x20'+link(_0x5e442d[_0x74912(0x20d)],_0xe6627e['fDKrq'](basename,_0x5e442d[_0x74912(0x20d)])));}}}console['log'](_0xe6627e['VetBF']);const {envs:_0x4e3f40,activeEnv:_0x1960ea}=await getEnvironments();let _0x362e01=[];if(_0x718982)try{_0x362e01=await _0xe6627e['TQrJQ'](listCloudProfiles);}catch{}const _0x339135=_0xe6627e['GwASg'](_0x4e3f40[_0x74912(0x205)],_0x362e01['length']);if(_0x339135===0x0)console['log'](_0xe6627e['MFdOD']),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0xe6627e[_0x74912(0x1e4)](_0x339135,0x5)){const _0x2515cf=[];_0x362e01[_0x74912(0x205)]>0x0&&_0x2515cf['push'](_0x362e01[_0x74912(0x205)]+'\x20cloud'),_0x4e3f40['length']>0x0&&_0x2515cf['push'](_0x4e3f40['length']+'\x20local'),console['log'](_0x339135+_0x74912(0x201)+_0x2515cf['join'](',\x20')+')'),_0x1960ea&&console['log'](_0x74912(0x1de)+_0xe6627e['Vfmcg'](bold,_0x1960ea)),console['log'](_0x74912(0x21d));}else{for(const _0x1896ef of _0x362e01){const _0x1dbdfb=_0x1896ef[_0x74912(0x1e9)]===_0x1960ea?'\x20(active)':'';console[_0x74912(0x1e3)]('\x20\x20'+bold(_0x1896ef['name'])+_0x74912(0x1c3)+_0x1dbdfb);const _0xd23674=_0x1896ef[_0x74912(0x1e5)]?_0x74912(0x1d1)+_0x1896ef['sessionUpdatedAt']+')':_0xe6627e['SOMxZ'];console['log']('\x20\x20\x20\x20Session:\x20'+_0xd23674);}const _0x3d6f38=new Set(_0x362e01[_0x74912(0x1ce)](_0x2f6316=>_0x2f6316['name']));for(const _0x32541f of _0x4e3f40){if(_0x3d6f38[_0x74912(0x204)](_0x32541f['name']))continue;const _0x5c97f6=_0x32541f[_0x74912(0x1f2)]?_0xe6627e[_0x74912(0x1d4)]:'',_0x32ac1c=_0x32541f['hasEncryptedAuth']?_0x74912(0x1eb):_0x32541f['hasPlaintextAuth']?_0x74912(0x1d0):'none';console[_0x74912(0x1e3)]('\x20\x20'+bold(_0x32541f[_0x74912(0x1e9)])+_0x74912(0x206)+_0x5c97f6),console['log']('\x20\x20\x20\x20Auth:\x20'+_0x32ac1c),_0x32541f['settingsPath']!==_0xe6627e['tqICb']&&console['log'](_0x74912(0x212)+link(_0x32541f[_0x74912(0x1f1)],basename(_0x32541f['settingsPath'])));}if(!_0x1960ea){console['log'](_0x74912(0x1c1));const _0x2217ed=[..._0x362e01['map'](_0x462aa7=>_0x462aa7['name']),..._0x4e3f40[_0x74912(0x1fe)](_0x1894c3=>!_0x3d6f38[_0x74912(0x204)](_0x1894c3[_0x74912(0x1e9)]))['map'](_0x18b9a4=>_0x18b9a4['name'])];console['log'](_0x74912(0x1e7)+_0x2217ed['join'](',\x20')+')');}}}console[_0x74912(0x1e3)]('');}
|