@ranger-testing/ranger-cli 3.1.3-alpha.546c9e8-43 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/novaActCli.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/organizationEnvApi.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/rangerwrightCli.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/tunnelClient.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/commands/verifyFeatureNovaCli.js +1 -1
- package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
- package/package.json +2 -2
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x49b562,_0xd9de7b){const _0x472fd7=_0x39dc,_0x3aca2f=_0x49b562();while(!![]){try{const _0x240ebb=-parseInt(_0x472fd7(0x156))/0x1+parseInt(_0x472fd7(0x157))/0x2+parseInt(_0x472fd7(0x151))/0x3*(parseInt(_0x472fd7(0x150))/0x4)+parseInt(_0x472fd7(0x15c))/0x5+parseInt(_0x472fd7(0x15b))/0x6*(parseInt(_0x472fd7(0x152))/0x7)+-parseInt(_0x472fd7(0x14f))/0x8+-parseInt(_0x472fd7(0x159))/0x9*(-parseInt(_0x472fd7(0x14e))/0xa);if(_0x240ebb===_0xd9de7b)break;else _0x3aca2f['push'](_0x3aca2f['shift']());}catch(_0x27a7a9){_0x3aca2f['push'](_0x3aca2f['shift']());}}}(_0x3d1b,0x7e908));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';function _0x3d1b(){const _0x3afc28=['2586Okrqqm','1330380fqNfsf','Cimfk','\x0a✅\x20API\x20key\x20stored\x20successfully','log','5245910iBJckC','6857952VgoSCG','252644yuChSb','3tUgcpv','5663JZEjgD','user','UyrJr','organizationName','292144mjJWxo','930578PHwuhS','message','9UGHOiT','\x0a✅\x20Logged\x20in\x20to\x20'];_0x3d1b=function(){return _0x3afc28;};return _0x3d1b();}import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';function _0x39dc(_0x2f793b,_0x404c74){_0x2f793b=_0x2f793b-0x14d;const _0x3d1bdb=_0x3d1b();let _0x39dce0=_0x3d1bdb[_0x2f793b];return _0x39dce0;}import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0x2a8918=_0x39dc,_0x5b988e={'UyrJr':'Re-authenticating\x20via\x20MCP\x20bootstrap...','OPdXF':function(_0x2b92d4){return _0x2b92d4();},'Cimfk':function(_0x4135ee,_0x5306d1){return _0x4135ee(_0x5306d1);}},_0x28e606=await getMcpAuthOrigin();if(_0x28e606){console[_0x2a8918(0x14d)](_0x5b988e[_0x2a8918(0x154)]),await mcpBootstrap();return;}if(!isInteractive())throw new Error('Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');try{const _0x5d8909=await _0x5b988e['OPdXF'](runDeviceAuthFlow),_0x4fd469=await _0x5b988e[_0x2a8918(0x15d)](getCurrentUser,_0x5d8909);_0x4fd469['success']?console['log'](_0x2a8918(0x15a)+_0x4fd469[_0x2a8918(0x153)][_0x2a8918(0x155)]):console['log'](_0x2a8918(0x15e));}catch(_0x4bfca2){throw new Error('Login\x20failed:\x20'+(_0x4bfca2 instanceof Error?_0x4bfca2[_0x2a8918(0x158)]:_0x4bfca2));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x320fb5=_0x41ce;(function(_0x46d2a6,_0x557d63){const _0x2a23b5=_0x41ce,_0x42cfff=_0x46d2a6();while(!![]){try{const _0x3f8c76=-parseInt(_0x2a23b5(0x8c))/0x1+parseInt(_0x2a23b5(0x10a))/0x2+-parseInt(_0x2a23b5(0xb2))/0x3+parseInt(_0x2a23b5(0x10b))/0x4*(-parseInt(_0x2a23b5(0xde))/0x5)+parseInt(_0x2a23b5(0xa7))/0x6*(-parseInt(_0x2a23b5(0x92))/0x7)+-parseInt(_0x2a23b5(0xd8))/0x8*(-parseInt(_0x2a23b5(0x101))/0x9)+parseInt(_0x2a23b5(0xac))/0xa;if(_0x3f8c76===_0x557d63)break;else _0x42cfff['push'](_0x42cfff['shift']());}catch(_0x1a5860){_0x42cfff['push'](_0x42cfff['shift']());}}}(_0x5c39,0x953bb));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';function _0x5c39(){const _0x4a511a=['<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','BUach','refresh_token','nHLGi','now','11445TMbxyV','text','application/json','kLnyy','searchParams','cUUMu','GDqGF','CTiiW','JyELH','HTTP\x20','SVVUL','1.0.0','FmHSp','2025-03-26','nhqpx','application/json,\x20text/event-stream','code','slice','application/x-www-form-urlencoded','XinLu','nHCtT','win32','log','Requesting\x20CLI\x20token...','result','get_cli_token','xILOB','utf-8','PMHuo','set','base64url','refreshToken','pQHbx','replace','Exchanging\x20authorization\x20code...','513bHsQdU','string','kLsCK','expiresAt','token','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','status','client_secret','headers','708836sxQGuk','1852TzklJD','registration_endpoint','length','text/event-stream','GUsvW','nILkl','UApDH','stringify','split','stdout','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','KzXBx','299612ACBFSd','TJerx','BEXrt','content','error_description','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','777pMKEXX','POST','resource','proxied','WRdVk','update','Token\x20exchange\x20failed:\x20','code_challenge_method','aXLZN','.ranger','JrIGH','writeHead','miEFE','craqS','client_id','authorization_code','type','text/html','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','notifications/initialized','fbyxG','10116dfxFQx','data:','\x0aOpening\x20browser\x20for\x20authentication...','<html><body><h2>Authentication\x20failed</h2><p>','msgVJ','19677310IpHXex','listen','QtoXG','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','XFpdd','S256','2963241ENTPsZ','AIWPr','\x0aToken\x20written\x20to\x20','end','\x0aUnexpected\x20response\x20structure:','code_challenge','toString','HzejQ','error','/.well-known/oauth-protected-resource','ranger-cli','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','digest','parse','Unknown\x20error','Authorization','pathname','json','awGlD','write','sha256','jJJqN','accessToken','http://localhost:','wbUAb','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','platform','IHmYp','Registering\x20OAuth\x20client...','state','Initializing\x20MCP\x20session...','SQkwO','2.0','/callback','QNwOp','hLfKA','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','MCP\x20server\x20returned\x20HTTP\x20','115568BrcAfT'];_0x5c39=function(){return _0x4a511a;};return _0x5c39();}import{createServer}from'http';import{randomBytes,createHash}from'crypto';function _0x41ce(_0x403aa0,_0x503369){_0x403aa0=_0x403aa0-0x81;const _0x5c397d=_0x5c39();let _0x41ce6d=_0x5c397d[_0x403aa0];return _0x41ce6d;}import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),_0x320fb5(0x9b),'auth-origin.txt');export async function getMcpAuthOrigin(){const _0x55a983=_0x320fb5,_0x3b506d={'QNkEi':_0x55a983(0xf9)};try{const _0x4760cf=(await readFile(AUTH_ORIGIN_PATH,_0x3b506d['QNkEi']))['trim']();return _0x4760cf||null;}catch{return null;}}export async function mcpBootstrap(){const _0x798f3=_0x320fb5,_0x363c96={'SVVUL':function(_0x4d2595,_0x582a23){return _0x4d2595===_0x582a23;},'Nxbeg':_0x798f3(0x95),'xQHIZ':function(_0x2e6557,_0x2b3fb5){return _0x2e6557+_0x2b3fb5;},'ZhbEU':'MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','XFpdd':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'},_0x4ed2a0=getMcpAuthUrl();currentOrigin=_0x4ed2a0;const _0x645f0e=process[_0x798f3(0x89)]['isTTY']??![];console[_0x798f3(0xf4)](_0x798f3(0x91)+_0x4ed2a0+'\x0a');const _0x28fae1=await tryUnauthenticated(_0x4ed2a0);let _0x4bcafc=null;if(_0x363c96[_0x798f3(0xe8)](_0x28fae1,_0x363c96['Nxbeg']))_0x4bcafc='';else{_0x4bcafc=await loadCachedToken();if(!_0x4bcafc){if(!_0x645f0e)throw new Error(_0x363c96['xQHIZ'](_0x363c96['ZhbEU'],_0x363c96[_0x798f3(0xb0)]));_0x4bcafc=await oauthFlow(_0x4ed2a0);}}await callGetCliToken(_0x4ed2a0,_0x4bcafc);}async function tryUnauthenticated(_0x59fbcb){const _0x197f02=_0x320fb5,_0x36c0a1={'BuGfv':function(_0x457523,_0x3c2a56,_0x176daa){return _0x457523(_0x3c2a56,_0x176daa);},'QNwOp':_0x197f02(0xd2),'fbyxG':'initialize','ndzHZ':_0x197f02(0xe9),'ilOcN':_0x197f02(0x95)},_0x45e259=await _0x36c0a1['BuGfv'](fetch,_0x59fbcb,{'method':'POST','headers':{'Content-Type':_0x197f02(0xe0),'Accept':_0x197f02(0xed)},'body':JSON[_0x197f02(0x87)]({'jsonrpc':_0x36c0a1[_0x197f02(0xd4)],'id':0x1,'method':_0x36c0a1[_0x197f02(0xa6)],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x36c0a1['ndzHZ']}}})});if(_0x45e259['ok'])return await _0x45e259[_0x197f02(0xdf)](),_0x36c0a1['ilOcN'];if(_0x45e259['status']===0x191)return await _0x45e259[_0x197f02(0xdf)](),'needs-oauth';const _0x5773b5=await _0x45e259['text']();throw new Error(_0x197f02(0xd7)+_0x45e259[_0x197f02(0x107)]+':\x20'+_0x5773b5);}class OAuthTimeoutError extends Error{constructor(_0x36191b){super(_0x36191b),this['name']='OAuthTimeoutError';}}async function oauthFlow(_0x161b35){const _0xf22910=_0x320fb5,_0x2017e6={'nHLGi':function(_0x3cc118,_0x7ed772){return _0x3cc118(_0x7ed772);},'phDoP':function(_0x53f9c0,_0x2a77e4){return _0x53f9c0 instanceof _0x2a77e4;},'kLnyy':function(_0x19357e){return _0x19357e();},'JyELH':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','xILOB':function(_0x512f70){return _0x512f70();},'msgVJ':function(_0x2894ea,_0x42a3cb){return _0x2894ea(_0x42a3cb);}};try{return await _0x2017e6[_0xf22910(0xdc)](oauthFlowAttempt,_0x161b35);}catch(_0x260b30){if(_0x2017e6['phDoP'](_0x260b30,OAuthTimeoutError)&&await _0x2017e6[_0xf22910(0xe1)](loadCachedClient))return console['log'](_0x2017e6[_0xf22910(0xe6)]),await _0x2017e6[_0xf22910(0xf8)](clearCachedClient),await _0x2017e6[_0xf22910(0xab)](oauthFlowAttempt,_0x161b35);throw _0x260b30;}}async function oauthFlowAttempt(_0x5dcb7a){const _0x144461=_0x320fb5,_0x55bc4b={'GUsvW':function(_0x113c90,_0x12cec8){return _0x113c90(_0x12cec8);},'UApDH':function(_0x4496ed,_0x102994,_0x2f8706){return _0x4496ed(_0x102994,_0x2f8706);},'aULHf':'Ranger\x20CLI','CTiiW':'authorization_code','nILkl':'refresh_token','ZWRic':'code','gUnWA':'none','TJerx':function(_0xab74c6,_0x25ffec){return _0xab74c6(_0x25ffec);},'QtoXG':_0x144461(0xfc),'YSEPl':function(_0x49ec1a,_0x4ea6e2){return _0x49ec1a(_0x4ea6e2);},'zIXwd':_0x144461(0xc6),'QpjwY':function(_0x529902,_0x59c49d){return _0x529902(_0x59c49d);},'nhqpx':'redirect_uri','TQQUE':_0x144461(0x99),'SQkwO':_0x144461(0xcf),'AIWPr':_0x144461(0x94),'cqPgZ':_0x144461(0xa9),'gMbGD':_0x144461(0x100),'MCZuK':_0x144461(0x108),'NVfMQ':_0x144461(0xf0),'xAoix':'\x20done','zAQYM':function(_0x414d0a,_0x332abc,_0x545fbf,_0x20f86f){return _0x414d0a(_0x332abc,_0x545fbf,_0x20f86f);}},_0x1e4820=_0x5dcb7a[_0x144461(0xff)](/\/mcp$/,'');process['stdout'][_0x144461(0xc5)]('Discovering\x20authorization\x20server...');const _0x5f3572=await fetch(_0x1e4820+_0x144461(0xbb));if(!_0x5f3572['ok'])throw new Error(_0x144461(0xaf));const _0x26a1a0=await _0x5f3572['json'](),_0x13bbf4=_0x26a1a0['authorization_servers']?.[0x0];if(!_0x13bbf4)throw new Error(_0x144461(0x106));console['log']('\x20'+_0x13bbf4);const _0x4b7edd=await _0x55bc4b[_0x144461(0x84)](fetchAuthServerMetadata,_0x13bbf4);let _0x4c1ddc,_0x3d2d1c;const _0x28b32a=await loadCachedClient();if(_0x28b32a)_0x4c1ddc=_0x28b32a['clientId'],_0x3d2d1c=_0x28b32a['clientSecret'];else{if(_0x4b7edd[_0x144461(0x81)]){process['stdout'][_0x144461(0xc5)](_0x144461(0xce));const _0x5744fc=await _0x55bc4b[_0x144461(0x86)](fetch,_0x4b7edd[_0x144461(0x81)],{'method':'POST','headers':{'Content-Type':_0x144461(0xe0)},'body':JSON['stringify']({'client_name':_0x55bc4b['aULHf'],'redirect_uris':[_0x144461(0xc9)+CALLBACK_PORT+'/callback'],'grant_types':[_0x55bc4b[_0x144461(0xe5)],_0x55bc4b[_0x144461(0x85)]],'response_types':[_0x55bc4b['ZWRic']],'token_endpoint_auth_method':_0x55bc4b['gUnWA']})});if(!_0x5744fc['ok']){const _0x539481=await _0x5744fc[_0x144461(0xdf)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x539481);}const _0x156f12=await _0x5744fc[_0x144461(0xc3)]();_0x4c1ddc=_0x156f12[_0x144461(0xa0)],_0x3d2d1c=_0x156f12['client_secret'],await saveCachedClient(_0x4c1ddc,_0x3d2d1c),console['log']('\x20done');}else throw new Error('Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found');}const _0x1c92a2=_0x55bc4b[_0x144461(0x8d)](randomBytes,0x20)['toString'](_0x55bc4b[_0x144461(0xae)]),_0x3a0164=_0x55bc4b['YSEPl'](createHash,_0x55bc4b['zIXwd'])[_0x144461(0x97)](_0x1c92a2)[_0x144461(0xbe)](_0x144461(0xfc)),_0x2fb6e8=_0x55bc4b['QpjwY'](randomBytes,0x10)[_0x144461(0xb8)]('hex'),_0x1456df=new URL(_0x4b7edd['authorization_endpoint']);_0x1456df['searchParams'][_0x144461(0xfb)]('response_type',_0x55bc4b['ZWRic']),_0x1456df['searchParams'][_0x144461(0xfb)](_0x144461(0xa0),_0x4c1ddc),_0x1456df['searchParams'][_0x144461(0xfb)](_0x55bc4b[_0x144461(0xec)],_0x144461(0xc9)+CALLBACK_PORT+_0x144461(0xd3)),_0x1456df['searchParams']['set'](_0x144461(0xb7),_0x3a0164),_0x1456df[_0x144461(0xe2)]['set'](_0x55bc4b['TQQUE'],_0x144461(0xb1)),_0x1456df[_0x144461(0xe2)][_0x144461(0xfb)](_0x55bc4b[_0x144461(0xd1)],_0x2fb6e8);_0x26a1a0[_0x144461(0x94)]&&_0x1456df[_0x144461(0xe2)][_0x144461(0xfb)](_0x55bc4b[_0x144461(0xb3)],_0x26a1a0[_0x144461(0x94)]);console['log'](_0x55bc4b['cqPgZ']),console[_0x144461(0xf4)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x1456df['toString']()+'\x0a'),await _0x55bc4b['TJerx'](openBrowser,_0x1456df[_0x144461(0xb8)]());const _0xd140b4=await waitForCallback(_0x2fb6e8);process[_0x144461(0x89)][_0x144461(0xc5)](_0x55bc4b['gMbGD']);const _0x5dc052=new URLSearchParams({'grant_type':_0x144461(0xa1),'code':_0xd140b4,'redirect_uri':_0x144461(0xc9)+CALLBACK_PORT+_0x144461(0xd3),'client_id':_0x4c1ddc,'code_verifier':_0x1c92a2});_0x3d2d1c&&_0x5dc052[_0x144461(0xfb)](_0x55bc4b['MCZuK'],_0x3d2d1c);_0x26a1a0[_0x144461(0x94)]&&_0x5dc052['set'](_0x55bc4b['AIWPr'],_0x26a1a0[_0x144461(0x94)]);const _0x3073ad=await fetch(_0x4b7edd['token_endpoint'],{'method':_0x144461(0x93),'headers':{'Content-Type':_0x55bc4b['NVfMQ']},'body':_0x5dc052});if(!_0x3073ad['ok']){const _0x2b415d=await _0x3073ad[_0x144461(0xdf)]();throw new Error(_0x144461(0x98)+_0x2b415d);}const _0x408b07=await _0x3073ad[_0x144461(0xc3)]();return console[_0x144461(0xf4)](_0x55bc4b['xAoix']),await _0x55bc4b['zAQYM'](saveCachedToken,_0x408b07['access_token'],_0x408b07[_0x144461(0xdb)],_0x408b07['expires_in']),_0x408b07['access_token'];}async function callGetCliToken(_0x1bc5c8,_0x288031){const _0x56104e=_0x320fb5,_0x2233b7={'HzejQ':function(_0x59477b,_0x59fba9,_0x476bca){return _0x59477b(_0x59fba9,_0x476bca);},'nHCtT':'POST','hLfKA':function(_0x1ab6fb,_0x418199){return _0x1ab6fb(_0x418199);},'rROTJ':_0x56104e(0xe0),'PMHuo':_0x56104e(0xc1),'HTSed':'initialize','XinLu':_0x56104e(0xeb),'FmHSp':_0x56104e(0xe9),'miEFE':'\x20done','gfymE':_0x56104e(0xa5),'ranJA':_0x56104e(0xd2),'GDqGF':'tools/call','aXLZN':_0x56104e(0xf7),'Noieu':_0x56104e(0xb6),'SvNne':function(_0x54d962,_0x4c8c9a,_0x11c567){return _0x54d962(_0x4c8c9a,_0x11c567);},'jdqSi':'refresh.txt'},_0x3962bb={'Content-Type':_0x2233b7['rROTJ'],'Accept':'application/json,\x20text/event-stream'};_0x288031&&(_0x3962bb[_0x2233b7[_0x56104e(0xfa)]]='Bearer\x20'+_0x288031);const _0x38cb96=async _0x6cb28=>{const _0x2c92c7=_0x56104e,_0x426a73=await _0x2233b7[_0x2c92c7(0xb9)](fetch,_0x1bc5c8,{'method':_0x2233b7[_0x2c92c7(0xf2)],'headers':_0x3962bb,'body':JSON[_0x2c92c7(0x87)](_0x6cb28)});if(!_0x426a73['ok']){const _0x3aa8ca=await _0x426a73[_0x2c92c7(0xdf)]();throw new Error(_0x2c92c7(0xe7)+_0x426a73[_0x2c92c7(0x107)]+':\x20'+_0x3aa8ca);}return _0x2233b7['hLfKA'](parseResponse,_0x426a73);};process['stdout']['write'](_0x56104e(0xd0));const _0x480d18=await _0x2233b7[_0x56104e(0xd5)](_0x38cb96,{'jsonrpc':'2.0','id':0x1,'method':_0x2233b7['HTSed'],'params':{'protocolVersion':_0x2233b7[_0x56104e(0xf1)],'capabilities':{},'clientInfo':{'name':_0x56104e(0xbc),'version':_0x2233b7[_0x56104e(0xea)]}}});if(_0x480d18[_0x56104e(0xba)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x480d18[_0x56104e(0xba)]['message']??JSON['stringify'](_0x480d18[_0x56104e(0xba)])));console['log'](_0x2233b7[_0x56104e(0x9e)]),await fetch(_0x1bc5c8,{'method':_0x2233b7['nHCtT'],'headers':_0x3962bb,'body':JSON[_0x56104e(0x87)]({'jsonrpc':'2.0','method':_0x2233b7['gfymE']})})['then'](_0x124ace=>_0x124ace['text']()),process[_0x56104e(0x89)][_0x56104e(0xc5)](_0x56104e(0xf5));const _0x187fcc=await _0x2233b7[_0x56104e(0xd5)](_0x38cb96,{'jsonrpc':_0x2233b7['ranJA'],'id':0x2,'method':_0x2233b7[_0x56104e(0xe4)],'params':{'name':_0x2233b7[_0x56104e(0x9a)],'arguments':{}}});if(_0x187fcc[_0x56104e(0xba)])throw new Error('get_cli_token\x20failed:\x20'+(_0x187fcc[_0x56104e(0xba)]['message']??JSON['stringify'](_0x187fcc['error'])));console['log'](_0x2233b7['miEFE']);const _0x115192=_0x2233b7[_0x56104e(0xd5)](extractToken,_0x187fcc[_0x56104e(0xf6)]);if(!_0x115192){console['error'](_0x2233b7['Noieu']),console[_0x56104e(0xba)](JSON['stringify'](_0x187fcc[_0x56104e(0xf6)],null,0x2));throw new Error('Could\x20not\x20extract\x20token\x20from\x20MCP\x20response');}const _0x255468=_0x2233b7['SvNne'](join,homedir(),'.ranger'),_0x72ae4a=join(_0x255468,_0x2233b7['jdqSi']);await mkdir(_0x255468,{'recursive':!![]}),await writeFile(_0x72ae4a,_0x115192,{'mode':0x180}),await writeFile(join(_0x255468,'auth-origin.txt'),_0x1bc5c8,{'mode':0x180}),console[_0x56104e(0xf4)](_0x56104e(0xb4)+_0x72ae4a),console['log'](_0x56104e(0x8a));}async function fetchAuthServerMetadata(_0xbba8f2){const _0x1dfdf7=_0x320fb5,_0x1103ce=_0xbba8f2+'/.well-known/oauth-authorization-server',_0x528bfc=await fetch(_0x1103ce);if(!_0x528bfc['ok'])throw new Error(_0x1dfdf7(0xa4)+_0x1103ce+':\x20'+_0x528bfc[_0x1dfdf7(0x107)]);return _0x528bfc['json']();}function waitForCallback(_0xd1e7cd){const _0x2a581b=_0x320fb5,_0x2426e6={'JrIGH':_0x2a581b(0xd3),'IHmYp':'text/html','JpiOH':function(_0x1e5039,_0x2940fe){return _0x1e5039!==_0x2940fe;},'jJJqN':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','BUach':function(_0x3c3dce){return _0x3c3dce();},'yvpXb':function(_0x35eb87,_0xd825b1){return _0x35eb87(_0xd825b1);},'UpUKK':'127.0.0.1'};return new Promise((_0x3409de,_0x5b533d)=>{const _0x4d33c3=_0x2a581b,_0x3f0c1a=()=>{_0x4a407d['closeAllConnections'](),_0x4a407d['close']();},_0x3e067f=setTimeout(()=>{const _0x49d029=_0x41ce;_0x3f0c1a(),_0x5b533d(new OAuthTimeoutError(_0x49d029(0xbd)));},0x1d4c0),_0x4a407d=_0x2426e6['yvpXb'](createServer,(_0x366a0d,_0x580554)=>{const _0x11abd6=_0x41ce,_0x516d57=new URL(_0x366a0d['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x516d57[_0x11abd6(0xc2)]!==_0x2426e6[_0x11abd6(0x9c)]){_0x580554[_0x11abd6(0x9d)](0x194),_0x580554[_0x11abd6(0xb5)]('Not\x20found');return;}const _0x34fd5e=_0x516d57[_0x11abd6(0xe2)]['get'](_0x11abd6(0xee)),_0x46023e=_0x516d57[_0x11abd6(0xe2)]['get'](_0x11abd6(0xcf)),_0x3fd63f=_0x516d57[_0x11abd6(0xe2)]['get'](_0x11abd6(0xba));if(_0x3fd63f){const _0x52c1d6=_0x516d57['searchParams']['get'](_0x11abd6(0x90))??_0x3fd63f;_0x580554[_0x11abd6(0x9d)](0xc8,{'Content-Type':_0x2426e6[_0x11abd6(0xcd)]}),_0x580554[_0x11abd6(0xb5)](_0x11abd6(0xaa)+_0x52c1d6+_0x11abd6(0xd6)),clearTimeout(_0x3e067f),_0x3f0c1a(),_0x5b533d(new Error('OAuth\x20error:\x20'+_0x52c1d6));return;}if(!_0x34fd5e||_0x2426e6['JpiOH'](_0x46023e,_0xd1e7cd)){_0x580554[_0x11abd6(0x9d)](0x190,{'Content-Type':_0x11abd6(0xa3)}),_0x580554[_0x11abd6(0xb5)](_0x11abd6(0xd9));return;}_0x580554['writeHead'](0xc8,{'Content-Type':_0x2426e6['IHmYp']}),_0x580554[_0x11abd6(0xb5)](_0x2426e6[_0x11abd6(0xc7)]),clearTimeout(_0x3e067f),_0x2426e6[_0x11abd6(0xda)](_0x3f0c1a),_0x3409de(_0x34fd5e);});_0x4a407d[_0x4d33c3(0xad)](CALLBACK_PORT,_0x2426e6['UpUKK']);});}async function openBrowser(_0x3a7c58){const _0x544611=_0x320fb5,_0x39f653={'BEXrt':function(_0x3bec66,_0x10504b){return _0x3bec66===_0x10504b;},'WRdVk':'open','craqS':'xdg-open','kLsCK':function(_0x3e5a8c,_0xa0b90){return _0x3e5a8c(_0xa0b90);}},_0xd23e14=_0x39f653[_0x544611(0x8e)](process['platform'],'darwin')?_0x39f653[_0x544611(0x96)]:process[_0x544611(0xcc)]===_0x544611(0xf3)?'start':_0x39f653[_0x544611(0x9f)];_0x39f653[_0x544611(0x103)](exec,_0xd23e14+'\x20\x22'+_0x3a7c58+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0xb530e6=_0x320fb5,_0x43c904={'KzXBx':function(_0x463834,_0xed85dc,_0x3df281){return _0x463834(_0xed85dc,_0x3df281);},'CwLzu':'utf-8','awGlD':function(_0x1c10c3,_0x46fa31){return _0x1c10c3!==_0x46fa31;}};try{const _0x170d0f=JSON['parse'](await _0x43c904[_0xb530e6(0x8b)](readFile,TOKEN_CACHE_PATH,_0x43c904['CwLzu']));if(_0x170d0f['origin']&&_0x43c904[_0xb530e6(0xc4)](_0x170d0f['origin'],currentOrigin))return null;if(_0x170d0f[_0xb530e6(0x104)]&&Date[_0xb530e6(0xdd)]()>_0x170d0f[_0xb530e6(0x104)])return null;return _0x170d0f[_0xb530e6(0xc8)]??null;}catch{return null;}}async function saveCachedToken(_0x1585c9,_0x2237d2,_0x485c40){const _0x2eb833=_0x320fb5,_0x4727f8={'lHZWM':function(_0x2b4a1d){return _0x2b4a1d();},'wbUAb':function(_0x4fa7a9,_0x15aeeb){return _0x4fa7a9+_0x15aeeb;},'AiYqk':function(_0x4c5785,_0x41dc27){return _0x4c5785*_0x41dc27;},'vqXNS':function(_0x550719){return _0x550719();}},_0x14c099=await _0x4727f8['lHZWM'](loadCachedData),_0x592f44={..._0x14c099,'origin':currentOrigin,'accessToken':_0x1585c9,'refreshToken':_0x2237d2??_0x14c099?.[_0x2eb833(0xfd)],'expiresAt':_0x485c40?_0x4727f8[_0x2eb833(0xca)](Date[_0x2eb833(0xdd)](),_0x4727f8['AiYqk'](_0x485c40,0x3e8)):undefined};await mkdir(join(_0x4727f8['vqXNS'](homedir),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x592f44),{'mode':0x180});}async function loadCachedClient(){const _0x28f835=await loadCachedData();if(_0x28f835?.['origin']&&_0x28f835['origin']!==currentOrigin)return null;return _0x28f835?.['clientId']?{'clientId':_0x28f835['clientId'],'clientSecret':_0x28f835['clientSecret']}:null;}async function clearCachedClient(){const _0x4c3e9e={'buVJw':function(_0x408907){return _0x408907();}},_0x31c8ae=await _0x4c3e9e['buVJw'](loadCachedData);if(!_0x31c8ae)return;const {clientId:_0x52c46c,clientSecret:_0x317bac,..._0x44a23f}=_0x31c8ae;await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x44a23f),{'mode':0x180});}async function saveCachedClient(_0x54edda,_0x5bd44b){const _0xe9fdc4=_0x320fb5,_0x5a07c7={'pQHbx':function(_0x16b313){return _0x16b313();},'cUUMu':function(_0x103a5e,_0xb036d8,_0x4ffdd5){return _0x103a5e(_0xb036d8,_0x4ffdd5);}},_0x6fc591=await _0x5a07c7[_0xe9fdc4(0xfe)](loadCachedData),_0x331f03={..._0x6fc591,'origin':currentOrigin,'accessToken':_0x6fc591?.[_0xe9fdc4(0xc8)]??'','clientId':_0x54edda,'clientSecret':_0x5bd44b};await mkdir(_0x5a07c7[_0xe9fdc4(0xe3)](join,homedir(),_0xe9fdc4(0x9b)),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0xe9fdc4(0x87)](_0x331f03),{'mode':0x180});}async function loadCachedData(){const _0xf92c65=_0x320fb5;try{return JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0xf92c65(0xf9)));}catch{return null;}}async function parseResponse(_0x2cdb0b){const _0x27e4de=_0x320fb5,_0x1ee143={'zWxjw':_0x27e4de(0xa8)},_0x210a89=_0x2cdb0b[_0x27e4de(0x109)]['get']('content-type')??'';if(_0x210a89['includes'](_0x27e4de(0x83))){const _0x7dffba=await _0x2cdb0b[_0x27e4de(0xdf)]();for(const _0x3642b9 of _0x7dffba[_0x27e4de(0x88)]('\x0a')){const _0x546969=_0x3642b9['trim']();if(_0x546969['startsWith']('data:')){const _0x4a2f78=_0x546969[_0x27e4de(0xef)](_0x1ee143['zWxjw'][_0x27e4de(0x82)])['trim']();if(!_0x4a2f78)continue;try{const _0x2038a7=JSON[_0x27e4de(0xbf)](_0x4a2f78);if(_0x2038a7['id']!==undefined||_0x2038a7[_0x27e4de(0xba)])return _0x2038a7;}catch{}}}throw new Error(_0x27e4de(0xcb));}return _0x2cdb0b['json']();}function extractToken(_0x15dbb7){const _0x10d838=_0x320fb5,_0x148f0c={'fJQtm':_0x10d838(0x102),'FLydm':function(_0x1c6cd4,_0x45f385){return _0x1c6cd4===_0x45f385;},'PdpXI':_0x10d838(0xdf),'ApbuM':function(_0x2b8891,_0x523836){return _0x2b8891===_0x523836;}};if(!_0x15dbb7)return null;const _0x320786=_0x15dbb7['structuredContent'];if(_0x320786?.['token']&&typeof _0x320786[_0x10d838(0x105)]===_0x148f0c['fJQtm'])return _0x320786['token'];if(_0x15dbb7['isError']){const _0x481f69=_0x15dbb7[_0x10d838(0x8f)];throw new Error('Server\x20returned\x20error:\x20'+(_0x481f69?.[0x0]?.[_0x10d838(0xdf)]??_0x10d838(0xc0)));}const _0x165b46=_0x15dbb7[_0x10d838(0x8f)];if(_0x165b46)for(const _0x4c154f of _0x165b46){if(_0x148f0c['FLydm'](_0x4c154f[_0x10d838(0xa2)],_0x148f0c['PdpXI'])&&_0x4c154f['text']){try{const _0x31ed32=JSON['parse'](_0x4c154f[_0x10d838(0xdf)]);if(_0x148f0c['ApbuM'](typeof _0x31ed32?.['token'],'string'))return _0x31ed32[_0x10d838(0x105)];}catch{}const _0x3d10fb=_0x4c154f['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x3d10fb)return _0x3d10fb[0x1];}}return null;}
|
|
1
|
+
(function(_0x35f96f,_0x2005d4){const _0x25884c=_0x2bf3,_0x5bc7be=_0x35f96f();while(!![]){try{const _0x1e05ca=parseInt(_0x25884c(0x14d))/0x1+-parseInt(_0x25884c(0x162))/0x2+parseInt(_0x25884c(0x121))/0x3*(-parseInt(_0x25884c(0x14b))/0x4)+parseInt(_0x25884c(0xea))/0x5*(parseInt(_0x25884c(0x12b))/0x6)+parseInt(_0x25884c(0x119))/0x7*(-parseInt(_0x25884c(0x16d))/0x8)+parseInt(_0x25884c(0x15b))/0x9*(parseInt(_0x25884c(0x10e))/0xa)+parseInt(_0x25884c(0xef))/0xb;if(_0x1e05ca===_0x2005d4)break;else _0x5bc7be['push'](_0x5bc7be['shift']());}catch(_0x1c6035){_0x5bc7be['push'](_0x5bc7be['shift']());}}}(_0x3e4b,0x25279));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 _0x3e4b(){const _0x204273=['utf-8','close','RrooD','rlUWi','authorization_servers','FZHAf','slice','url','jnHnv','hzvfn','split','length','qvErp','searchParams','NxrpD','1.0.0','now','TfrqZ','error','VVGFS','OAuthTimeoutError','authorization_code','14255kXfdUU','YRkgJ','bGEEg','closeAllConnections','text/html','2199076kcTMFX','string','accessToken','.ranger','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','log','refresh_token','qPDOa','headers','parse','KLTKu','OAuth\x20error:\x20','application/json,\x20text/event-stream','hAnHQ','Discovering\x20authorization\x20server...','start','UfZIB','poPRM','oXJCW','YXhPT','end','name','response_type','Authorization','isTTY','includes','content','FcTFo','Unknown\x20error','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','93820EdVONd','code_challenge','pRCGc','tNWut','ddKYs','proxied','kdcuA','wsDRj','origin','application/json','qRNPP','958020lThevj','MCP\x20initialize\x20failed:\x20','HTTP\x20','UkUQx','write','nFFEP','BwUgs','VibxS','19392KjrxOB','clientSecret','structuredContent','code_challenge_method','token','2025-03-26','ZoDTf','EJjQf','access_token','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','54vPDIsr','Initializing\x20MCP\x20session...','sha256','clientId','/callback','digest','NLCGH','POST','match','expires_in','OIpVb','expiresAt','stdout','BEAQK','refresh.txt','resource','qMCBs','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','bpJzN','MCP\x20server\x20returned\x20HTTP\x20','set','writeHead','Exchanging\x20authorization\x20code...','\x0aToken\x20written\x20to\x20','text','AyKTd','\x20done','plCOh','registration_endpoint','PiIzs','code','auth-origin.txt','20QhbFjL','bsGFh','189474wiPtIj','HLLpi','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','cvTZS','stringify','json','tUUGO','Requesting\x20CLI\x20token...','pathname','Grwwj','hlqDQ','status','OXWCe','trim','171JLIMUz','error_description','get','platform','oNIva','toString','base64url','270164uuYWgw','SmZRo','state','message','CIGOI','TpuBj','2.0','result','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','win32','content-type','16SbCeyp','yFSEb','text/event-stream','pSKqQ'];_0x3e4b=function(){return _0x204273;};return _0x3e4b();}const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');export async function getMcpAuthOrigin(){const _0xf6023f=_0x2bf3;try{const _0x40e4d3=(await readFile(AUTH_ORIGIN_PATH,_0xf6023f(0x171)))[_0xf6023f(0x15a)]();return _0x40e4d3||null;}catch{return null;}}export async function mcpBootstrap(){const _0x4a54c3=_0x2bf3,_0x3beb3b={'hlqDQ':function(_0x3229ae,_0x3aab3b){return _0x3229ae(_0x3aab3b);},'LkciE':function(_0x3923f2,_0x405883){return _0x3923f2===_0x405883;}},_0x1cd609=getMcpAuthUrl();currentOrigin=_0x1cd609;const _0x47416c=process[_0x4a54c3(0x137)][_0x4a54c3(0x108)]??![];console[_0x4a54c3(0xf5)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x1cd609+'\x0a');const _0x4e98e1=await _0x3beb3b[_0x4a54c3(0x157)](tryUnauthenticated,_0x1cd609);let _0x307ff8=null;if(_0x3beb3b['LkciE'](_0x4e98e1,_0x4a54c3(0x113)))_0x307ff8='';else{_0x307ff8=await loadCachedToken();if(!_0x307ff8){if(!_0x47416c)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x4a54c3(0x16a));_0x307ff8=await oauthFlow(_0x1cd609);}}await callGetCliToken(_0x1cd609,_0x307ff8);}function _0x2bf3(_0x18396f,_0x29807d){_0x18396f=_0x18396f-0xdb;const _0x3e4b44=_0x3e4b();let _0x2bf315=_0x3e4b44[_0x18396f];return _0x2bf315;}async function tryUnauthenticated(_0x2afe6e){const _0x582b3b=_0x2bf3,_0x290b09={'UMpDX':function(_0x519dec,_0x2a3652,_0x2aa303){return _0x519dec(_0x2a3652,_0x2aa303);},'qvErp':_0x582b3b(0x132),'ZoDTf':'2.0','BEAQK':'initialize','kdcuA':'2025-03-26','qMCBs':_0x582b3b(0x113),'nkFJd':function(_0x1f294a,_0x35a0cf){return _0x1f294a===_0x35a0cf;},'GpkVC':'needs-oauth'},_0x52721b=await _0x290b09['UMpDX'](fetch,_0x2afe6e,{'method':_0x290b09[_0x582b3b(0xe0)],'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'},'body':JSON['stringify']({'jsonrpc':_0x290b09[_0x582b3b(0x127)],'id':0x1,'method':_0x290b09[_0x582b3b(0x138)],'params':{'protocolVersion':_0x290b09[_0x582b3b(0x114)],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x582b3b(0xe3)}}})});if(_0x52721b['ok'])return await _0x52721b[_0x582b3b(0x143)](),_0x290b09[_0x582b3b(0x13b)];if(_0x290b09['nkFJd'](_0x52721b['status'],0x191))return await _0x52721b[_0x582b3b(0x143)](),_0x290b09['GpkVC'];const _0x6bae40=await _0x52721b[_0x582b3b(0x143)]();throw new Error(_0x582b3b(0x13e)+_0x52721b['status']+':\x20'+_0x6bae40);}class OAuthTimeoutError extends Error{constructor(_0x5e4541){const _0x17dc23=_0x2bf3,_0x54da64={'NxrpD':_0x17dc23(0xe8)};super(_0x5e4541),this[_0x17dc23(0x105)]=_0x54da64[_0x17dc23(0xe2)];}}async function oauthFlow(_0x33c053){const _0x1367c2=_0x2bf3,_0x317bf9={'plCOh':function(_0x5bc9c2,_0x44316a){return _0x5bc9c2(_0x44316a);}};try{return await oauthFlowAttempt(_0x33c053);}catch(_0x4a1ab7){if(_0x4a1ab7 instanceof OAuthTimeoutError&&await loadCachedClient())return console['log']('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await clearCachedClient(),await _0x317bf9[_0x1367c2(0x146)](oauthFlowAttempt,_0x33c053);throw _0x4a1ab7;}}async function oauthFlowAttempt(_0x44321f){const _0x176e08=_0x2bf3,_0x5beafb={'nFFEP':_0x176e08(0xfe),'InwKB':function(_0x549c1b,_0x5be84d){return _0x549c1b(_0x5be84d);},'CIGOI':_0x176e08(0x10d),'edGMW':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','eyNEv':function(_0x2de7ec,_0x573e3d,_0x4a38bf){return _0x2de7ec(_0x573e3d,_0x4a38bf);},'dMqlm':'Ranger\x20CLI','YRkgJ':'refresh_token','PiIzs':_0x176e08(0x145),'Grwwj':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','IdQFW':_0x176e08(0x12d),'zeeSf':'base64url','jbBAy':'code','qPDOa':'redirect_uri','WzDYS':_0x176e08(0x124),'AyKTd':'state','QGkQE':'resource','gmnez':'\x0aOpening\x20browser\x20for\x20authentication...','xmjnE':_0x176e08(0x141),'FZHAf':_0x176e08(0xe9),'SmZRo':function(_0x392457,_0x2af9f4,_0xdef5aa){return _0x392457(_0x2af9f4,_0xdef5aa);}},_0x143141=_0x44321f['replace'](/\/mcp$/,'');process[_0x176e08(0x137)]['write'](_0x5beafb[_0x176e08(0x11e)]);const _0x118b13=await _0x5beafb['InwKB'](fetch,_0x143141+'/.well-known/oauth-protected-resource');if(!_0x118b13['ok'])throw new Error(_0x5beafb[_0x176e08(0x166)]);const _0xaad6a9=await _0x118b13['json'](),_0x34ba59=_0xaad6a9[_0x176e08(0x175)]?.[0x0];if(!_0x34ba59)throw new Error(_0x5beafb['edGMW']);console[_0x176e08(0xf5)]('\x20'+_0x34ba59);const _0x6653d4=await _0x5beafb['InwKB'](fetchAuthServerMetadata,_0x34ba59);let _0x4f5e65,_0x21a507;const _0x9d47f6=await loadCachedClient();if(_0x9d47f6)_0x4f5e65=_0x9d47f6['clientId'],_0x21a507=_0x9d47f6[_0x176e08(0x122)];else{if(_0x6653d4[_0x176e08(0x147)]){process[_0x176e08(0x137)]['write']('Registering\x20OAuth\x20client...');const _0x5a41d5=await _0x5beafb['eyNEv'](fetch,_0x6653d4['registration_endpoint'],{'method':_0x176e08(0x132),'headers':{'Content-Type':_0x176e08(0x117)},'body':JSON[_0x176e08(0x151)]({'client_name':_0x5beafb['dMqlm'],'redirect_uris':['http://localhost:'+CALLBACK_PORT+'/callback'],'grant_types':['authorization_code',_0x5beafb[_0x176e08(0xeb)]],'response_types':['code'],'token_endpoint_auth_method':'none'})});if(!_0x5a41d5['ok']){const _0x3e1241=await _0x5a41d5['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x3e1241);}const _0x3b3501=await _0x5a41d5[_0x176e08(0x152)]();_0x4f5e65=_0x3b3501['client_id'],_0x21a507=_0x3b3501['client_secret'],await saveCachedClient(_0x4f5e65,_0x21a507),console[_0x176e08(0xf5)](_0x5beafb[_0x176e08(0x148)]);}else throw new Error(_0x5beafb[_0x176e08(0x156)]);}const _0x4b7ec3=randomBytes(0x20)[_0x176e08(0x160)](_0x176e08(0x161)),_0x4b7cd8=createHash(_0x5beafb['IdQFW'])['update'](_0x4b7ec3)[_0x176e08(0x130)](_0x5beafb['zeeSf']),_0x28b3ee=randomBytes(0x10)[_0x176e08(0x160)]('hex'),_0x534a25=new URL(_0x6653d4['authorization_endpoint']);_0x534a25[_0x176e08(0xe1)][_0x176e08(0x13f)](_0x176e08(0x106),_0x5beafb['jbBAy']),_0x534a25[_0x176e08(0xe1)][_0x176e08(0x13f)]('client_id',_0x4f5e65),_0x534a25['searchParams'][_0x176e08(0x13f)](_0x5beafb[_0x176e08(0xf7)],'http://localhost:'+CALLBACK_PORT+_0x176e08(0x12f)),_0x534a25['searchParams']['set'](_0x176e08(0x10f),_0x4b7cd8),_0x534a25['searchParams']['set'](_0x5beafb['WzDYS'],'S256'),_0x534a25['searchParams']['set'](_0x5beafb[_0x176e08(0x144)],_0x28b3ee);_0xaad6a9[_0x176e08(0x13a)]&&_0x534a25[_0x176e08(0xe1)][_0x176e08(0x13f)](_0x5beafb['QGkQE'],_0xaad6a9[_0x176e08(0x13a)]);console[_0x176e08(0xf5)](_0x5beafb['gmnez']),console['log'](_0x176e08(0xf3)+_0x534a25[_0x176e08(0x160)]()+'\x0a'),await openBrowser(_0x534a25[_0x176e08(0x160)]());const _0x4d2ca4=await waitForCallback(_0x28b3ee);process[_0x176e08(0x137)]['write'](_0x5beafb['xmjnE']);const _0x40dd1=new URLSearchParams({'grant_type':_0x5beafb[_0x176e08(0x176)],'code':_0x4d2ca4,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0x176e08(0x12f),'client_id':_0x4f5e65,'code_verifier':_0x4b7ec3});_0x21a507&&_0x40dd1[_0x176e08(0x13f)]('client_secret',_0x21a507);_0xaad6a9[_0x176e08(0x13a)]&&_0x40dd1['set'](_0x5beafb['QGkQE'],_0xaad6a9['resource']);const _0x372612=await _0x5beafb[_0x176e08(0x163)](fetch,_0x6653d4['token_endpoint'],{'method':'POST','headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x40dd1});if(!_0x372612['ok']){const _0x124b1b=await _0x372612[_0x176e08(0x143)]();throw new Error('Token\x20exchange\x20failed:\x20'+_0x124b1b);}const _0x359f46=await _0x372612[_0x176e08(0x152)]();return console[_0x176e08(0xf5)](_0x5beafb['PiIzs']),await saveCachedToken(_0x359f46[_0x176e08(0x129)],_0x359f46[_0x176e08(0xf6)],_0x359f46[_0x176e08(0x134)]),_0x359f46['access_token'];}async function callGetCliToken(_0x1f7ac5,_0x11e0ed){const _0xae12dc=_0x2bf3,_0x507d68={'EJjQf':function(_0x31f185,_0x39b811,_0x4426a7){return _0x31f185(_0x39b811,_0x4426a7);},'NLCGH':_0xae12dc(0x117),'pSKqQ':_0xae12dc(0xfc),'YXhPT':_0xae12dc(0x107),'qRNPP':function(_0x473ab9,_0x233fe6){return _0x473ab9(_0x233fe6);},'OIpVb':_0xae12dc(0x168),'KLTKu':'ranger-cli','BwUgs':function(_0x1ead33,_0x124ef6,_0x5416be){return _0x1ead33(_0x124ef6,_0x5416be);},'ddKYs':'notifications/initialized','HLLpi':_0xae12dc(0x154),'yFSEb':function(_0xe3170b,_0x228130){return _0xe3170b(_0x228130);},'ADyUo':'tools/call','rlUWi':'get_cli_token','VibxS':function(_0x3e76e8,_0x456967){return _0x3e76e8(_0x456967);},'FcTFo':'\x0aUnexpected\x20response\x20structure:','pfMjy':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','KcBHO':_0xae12dc(0x139)},_0x1bdd62={'Content-Type':_0x507d68[_0xae12dc(0x131)],'Accept':_0x507d68[_0xae12dc(0x170)]};_0x11e0ed&&(_0x1bdd62[_0x507d68[_0xae12dc(0x103)]]='Bearer\x20'+_0x11e0ed);const _0x59165b=async _0x4146d7=>{const _0x7d7545=_0xae12dc,_0x5214a7=await _0x507d68[_0x7d7545(0x128)](fetch,_0x1f7ac5,{'method':_0x7d7545(0x132),'headers':_0x1bdd62,'body':JSON['stringify'](_0x4146d7)});if(!_0x5214a7['ok']){const _0x3f3464=await _0x5214a7[_0x7d7545(0x143)]();throw new Error(_0x7d7545(0x11b)+_0x5214a7['status']+':\x20'+_0x3f3464);}return parseResponse(_0x5214a7);};process[_0xae12dc(0x137)]['write'](_0xae12dc(0x12c));const _0x483c3d=await _0x507d68[_0xae12dc(0x118)](_0x59165b,{'jsonrpc':_0x507d68[_0xae12dc(0x135)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0xae12dc(0x126),'capabilities':{},'clientInfo':{'name':_0x507d68[_0xae12dc(0xfa)],'version':'1.0.0'}}});if(_0x483c3d[_0xae12dc(0xe6)])throw new Error(_0xae12dc(0x11a)+(_0x483c3d[_0xae12dc(0xe6)][_0xae12dc(0x165)]??JSON['stringify'](_0x483c3d['error'])));console[_0xae12dc(0xf5)]('\x20done'),await _0x507d68[_0xae12dc(0x11f)](fetch,_0x1f7ac5,{'method':'POST','headers':_0x1bdd62,'body':JSON[_0xae12dc(0x151)]({'jsonrpc':_0x507d68[_0xae12dc(0x135)],'method':_0x507d68[_0xae12dc(0x112)]})})['then'](_0x16c2b4=>_0x16c2b4[_0xae12dc(0x143)]()),process[_0xae12dc(0x137)][_0xae12dc(0x11d)](_0x507d68[_0xae12dc(0x14e)]);const _0x45bc8b=await _0x507d68[_0xae12dc(0x16e)](_0x59165b,{'jsonrpc':_0x507d68['OIpVb'],'id':0x2,'method':_0x507d68['ADyUo'],'params':{'name':_0x507d68[_0xae12dc(0x174)],'arguments':{}}});if(_0x45bc8b['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x45bc8b['error']['message']??JSON['stringify'](_0x45bc8b['error'])));console['log'](_0xae12dc(0x145));const _0x436d9d=_0x507d68[_0xae12dc(0x120)](extractToken,_0x45bc8b[_0xae12dc(0x169)]);if(!_0x436d9d){console['error'](_0x507d68[_0xae12dc(0x10b)]),console[_0xae12dc(0xe6)](JSON[_0xae12dc(0x151)](_0x45bc8b['result'],null,0x2));throw new Error(_0x507d68['pfMjy']);}const _0x145ed9=_0x507d68['BwUgs'](join,homedir(),'.ranger'),_0x1a3612=join(_0x145ed9,_0x507d68['KcBHO']);await mkdir(_0x145ed9,{'recursive':!![]}),await writeFile(_0x1a3612,_0x436d9d,{'mode':0x180}),await writeFile(join(_0x145ed9,_0xae12dc(0x14a)),_0x1f7ac5,{'mode':0x180}),console['log'](_0xae12dc(0x142)+_0x1a3612),console['log'](_0xae12dc(0x13c));}async function fetchAuthServerMetadata(_0x5a5b7f){const _0x27e2c7=_0x2bf3,_0xb35eaa={'UCgka':function(_0x3e2f46,_0xc3fac0){return _0x3e2f46(_0xc3fac0);}},_0x31e787=_0x5a5b7f+'/.well-known/oauth-authorization-server',_0x33a7a=await _0xb35eaa['UCgka'](fetch,_0x31e787);if(!_0x33a7a['ok'])throw new Error(_0x27e2c7(0x14f)+_0x31e787+':\x20'+_0x33a7a[_0x27e2c7(0x158)]);return _0x33a7a[_0x27e2c7(0x152)]();}function waitForCallback(_0x4d7b1b){const _0x45d732=_0x2bf3,_0x11b85e={'RuqOR':'OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','tNWut':_0x45d732(0x149),'hzvfn':_0x45d732(0xe6),'xHjtI':_0x45d732(0x15c),'oNIva':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','xwsmZ':function(_0x137535,_0xa4be2b,_0x21d4ef){return _0x137535(_0xa4be2b,_0x21d4ef);},'GUqzT':'127.0.0.1'};return new Promise((_0x43a443,_0x2f8b44)=>{const _0x2d87be=_0x45d732,_0x376918={'uOOCv':function(_0x4a22bb,_0x5a4783){return _0x4a22bb(_0x5a4783);},'UkUQx':_0x11b85e['RuqOR'],'bsGFh':function(_0x19b9a0,_0x2730ba){return _0x19b9a0!==_0x2730ba;},'ZvSUe':_0x11b85e[_0x2d87be(0x111)],'jnHnv':_0x11b85e[_0x2d87be(0xdd)],'zkGQH':_0x11b85e['xHjtI'],'vlEGZ':_0x2d87be(0xee),'TfrqZ':function(_0x57bd74,_0x17fac7){return _0x57bd74(_0x17fac7);},'hkSpP':_0x11b85e[_0x2d87be(0x15f)]},_0x19f56e=()=>{const _0x59f692=_0x2d87be;_0x478a2b[_0x59f692(0xed)](),_0x478a2b[_0x59f692(0x172)]();},_0x52c587=_0x11b85e['xwsmZ'](setTimeout,()=>{const _0x13d4bd=_0x2d87be;_0x19f56e(),_0x376918['uOOCv'](_0x2f8b44,new OAuthTimeoutError(_0x376918[_0x13d4bd(0x11c)]));},0x1d4c0),_0x478a2b=createServer((_0x1a22af,_0x3d2250)=>{const _0x1824ed=_0x2d87be,_0x49022a=new URL(_0x1a22af[_0x1824ed(0xdb)]??'/','http://localhost:'+CALLBACK_PORT);if(_0x376918['bsGFh'](_0x49022a[_0x1824ed(0x155)],_0x1824ed(0x12f))){_0x3d2250[_0x1824ed(0x140)](0x194),_0x3d2250[_0x1824ed(0x104)]('Not\x20found');return;}const _0x512726=_0x49022a['searchParams'][_0x1824ed(0x15d)](_0x376918['ZvSUe']),_0x419e14=_0x49022a['searchParams'][_0x1824ed(0x15d)](_0x1824ed(0x164)),_0x24ecef=_0x49022a[_0x1824ed(0xe1)][_0x1824ed(0x15d)](_0x376918[_0x1824ed(0xdc)]);if(_0x24ecef){const _0x419373=_0x49022a[_0x1824ed(0xe1)][_0x1824ed(0x15d)](_0x376918['zkGQH'])??_0x24ecef;_0x3d2250[_0x1824ed(0x140)](0xc8,{'Content-Type':_0x376918['vlEGZ']}),_0x3d2250[_0x1824ed(0x104)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x419373+_0x1824ed(0xf4)),clearTimeout(_0x52c587),_0x19f56e(),_0x376918[_0x1824ed(0xe5)](_0x2f8b44,new Error(_0x1824ed(0xfb)+_0x419373));return;}if(!_0x512726||_0x376918[_0x1824ed(0x14c)](_0x419e14,_0x4d7b1b)){_0x3d2250[_0x1824ed(0x140)](0x190,{'Content-Type':_0x1824ed(0xee)}),_0x3d2250[_0x1824ed(0x104)](_0x376918['hkSpP']);return;}_0x3d2250['writeHead'](0xc8,{'Content-Type':_0x1824ed(0xee)}),_0x3d2250[_0x1824ed(0x104)](_0x1824ed(0x12a)),clearTimeout(_0x52c587),_0x19f56e(),_0x43a443(_0x512726);});_0x478a2b['listen'](CALLBACK_PORT,_0x11b85e['GUqzT']);});}async function openBrowser(_0x2adffc){const _0x429aa5=_0x2bf3,_0x223cf4={'wsDRj':'darwin','OXWCe':'open','dnHLM':_0x429aa5(0x16b)},_0x4ed090=process[_0x429aa5(0x15e)]===_0x223cf4[_0x429aa5(0x115)]?_0x223cf4[_0x429aa5(0x159)]:process['platform']===_0x223cf4['dnHLM']?_0x429aa5(0xff):'xdg-open';exec(_0x4ed090+'\x20\x22'+_0x2adffc+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x3798bd=_0x2bf3,_0x3eec8e={'tUUGO':function(_0x10235c,_0x3ed142,_0xd0b43f){return _0x10235c(_0x3ed142,_0xd0b43f);},'WGGBD':function(_0x59a7cf,_0x359c47){return _0x59a7cf!==_0x359c47;},'UfZIB':function(_0xfa0de8,_0x1d32b8){return _0xfa0de8>_0x1d32b8;}};try{const _0x37fee9=JSON['parse'](await _0x3eec8e[_0x3798bd(0x153)](readFile,TOKEN_CACHE_PATH,'utf-8'));if(_0x37fee9[_0x3798bd(0x116)]&&_0x3eec8e['WGGBD'](_0x37fee9['origin'],currentOrigin))return null;if(_0x37fee9[_0x3798bd(0x136)]&&_0x3eec8e[_0x3798bd(0x100)](Date['now'](),_0x37fee9['expiresAt']))return null;return _0x37fee9[_0x3798bd(0xf1)]??null;}catch{return null;}}async function saveCachedToken(_0x4a4ca3,_0x3aa207,_0x415dbf){const _0x4b4be4=_0x2bf3,_0xff947b={'WLeMt':function(_0x26e43a,_0xa120c){return _0x26e43a*_0xa120c;},'cvTZS':function(_0x5d4651,_0x3212c5,_0x1b9c41){return _0x5d4651(_0x3212c5,_0x1b9c41);},'TpuBj':function(_0xe24e02,_0x3a0554,_0x74ea12){return _0xe24e02(_0x3a0554,_0x74ea12);},'bpJzN':function(_0x526a2d){return _0x526a2d();},'RQRYK':function(_0x20f0b6,_0x5c4fbe,_0x2ff388,_0x4224cc){return _0x20f0b6(_0x5c4fbe,_0x2ff388,_0x4224cc);}},_0x3c0269=await loadCachedData(),_0x442b04={..._0x3c0269,'origin':currentOrigin,'accessToken':_0x4a4ca3,'refreshToken':_0x3aa207??_0x3c0269?.['refreshToken'],'expiresAt':_0x415dbf?Date[_0x4b4be4(0xe4)]()+_0xff947b['WLeMt'](_0x415dbf,0x3e8):undefined};await _0xff947b[_0x4b4be4(0x150)](mkdir,_0xff947b[_0x4b4be4(0x167)](join,_0xff947b[_0x4b4be4(0x13d)](homedir),'.ranger'),{'recursive':!![]}),await _0xff947b['RQRYK'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x442b04),{'mode':0x180});}async function loadCachedClient(){const _0x3e00e4=_0x2bf3,_0x1ad431={'OvwOt':function(_0x357212){return _0x357212();},'poPRM':function(_0x4474db,_0x4a1073){return _0x4474db!==_0x4a1073;}},_0x236c2d=await _0x1ad431['OvwOt'](loadCachedData);if(_0x236c2d?.[_0x3e00e4(0x116)]&&_0x1ad431[_0x3e00e4(0x101)](_0x236c2d['origin'],currentOrigin))return null;return _0x236c2d?.[_0x3e00e4(0x12e)]?{'clientId':_0x236c2d['clientId'],'clientSecret':_0x236c2d[_0x3e00e4(0x122)]}:null;}async function clearCachedClient(){const _0x34113d=_0x2bf3,_0x4b8880={'RSDKk':function(_0x1862ce){return _0x1862ce();},'RYTzu':function(_0x4c15f3,_0xa542ff,_0x339c3e,_0x5eefc3){return _0x4c15f3(_0xa542ff,_0x339c3e,_0x5eefc3);}},_0x2b3f6d=await _0x4b8880['RSDKk'](loadCachedData);if(!_0x2b3f6d)return;const {clientId:_0x33863c,clientSecret:_0x2e3502,..._0x342053}=_0x2b3f6d;await _0x4b8880['RYTzu'](writeFile,TOKEN_CACHE_PATH,JSON[_0x34113d(0x151)](_0x342053),{'mode':0x180});}async function saveCachedClient(_0x583a1c,_0x21096f){const _0x4fe958=_0x2bf3,_0x50e5de={'hAnHQ':function(_0x3b98ae){return _0x3b98ae();},'RrooD':function(_0x896c97){return _0x896c97();}},_0x398d70=await _0x50e5de[_0x4fe958(0xfd)](loadCachedData),_0x4cee1a={..._0x398d70,'origin':currentOrigin,'accessToken':_0x398d70?.['accessToken']??'','clientId':_0x583a1c,'clientSecret':_0x21096f};await mkdir(join(_0x50e5de[_0x4fe958(0x173)](homedir),_0x4fe958(0xf2)),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x4cee1a),{'mode':0x180});}async function loadCachedData(){const _0x1c2435={'lNIoX':function(_0x3e7146,_0x3a83cf,_0x4e82c3){return _0x3e7146(_0x3a83cf,_0x4e82c3);},'zFnGw':'utf-8'};try{return JSON['parse'](await _0x1c2435['lNIoX'](readFile,TOKEN_CACHE_PATH,_0x1c2435['zFnGw']));}catch{return null;}}async function parseResponse(_0x373a48){const _0x2f3ee6=_0x2bf3,_0x1781a5={'VVGFS':_0x2f3ee6(0x16f),'pRCGc':'data:'},_0x54d80a=_0x373a48[_0x2f3ee6(0xf8)][_0x2f3ee6(0x15d)](_0x2f3ee6(0x16c))??'';if(_0x54d80a[_0x2f3ee6(0x109)](_0x1781a5[_0x2f3ee6(0xe7)])){const _0x122a90=await _0x373a48[_0x2f3ee6(0x143)]();for(const _0x342254 of _0x122a90[_0x2f3ee6(0xde)]('\x0a')){const _0xa92a0a=_0x342254[_0x2f3ee6(0x15a)]();if(_0xa92a0a['startsWith']('data:')){const _0x5d49a4=_0xa92a0a[_0x2f3ee6(0x177)](_0x1781a5[_0x2f3ee6(0x110)][_0x2f3ee6(0xdf)])['trim']();if(!_0x5d49a4)continue;try{const _0x5d5ccc=JSON[_0x2f3ee6(0xf9)](_0x5d49a4);if(_0x5d5ccc['id']!==undefined||_0x5d5ccc['error'])return _0x5d5ccc;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x373a48['json']();}function extractToken(_0x506863){const _0x295515=_0x2bf3,_0x2022be={'oXJCW':function(_0x8062f3,_0xa34404){return _0x8062f3===_0xa34404;},'bGEEg':function(_0x33a897,_0x18a18c){return _0x33a897===_0x18a18c;},'SxURg':'string'};if(!_0x506863)return null;const _0x216bca=_0x506863[_0x295515(0x123)];if(_0x216bca?.[_0x295515(0x125)]&&_0x2022be[_0x295515(0x102)](typeof _0x216bca[_0x295515(0x125)],_0x295515(0xf0)))return _0x216bca[_0x295515(0x125)];if(_0x506863['isError']){const _0x28130c=_0x506863['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x28130c?.[0x0]?.[_0x295515(0x143)]??_0x295515(0x10c)));}const _0x39f8ea=_0x506863[_0x295515(0x10a)];if(_0x39f8ea)for(const _0x1f1b26 of _0x39f8ea){if(_0x2022be['oXJCW'](_0x1f1b26['type'],_0x295515(0x143))&&_0x1f1b26['text']){try{const _0x32c1c7=JSON[_0x295515(0xf9)](_0x1f1b26[_0x295515(0x143)]);if(_0x2022be[_0x295515(0xec)](typeof _0x32c1c7?.[_0x295515(0x125)],_0x2022be['SxURg']))return _0x32c1c7['token'];}catch{}const _0x4cbab7=_0x1f1b26[_0x295515(0x143)][_0x295515(0x133)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x4cbab7)return _0x4cbab7[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x4055(_0x512fb9,_0x1f7ffd){_0x512fb9=_0x512fb9-0x1de;var _0x17c567=_0x17c5();var _0x40553a=_0x17c567[_0x512fb9];return _0x40553a;}(function(_0x3b3f95,_0x5317e4){var _0x2456a9=_0x4055,_0x351347=_0x3b3f95();while(!![]){try{var _0x16915e=parseInt(_0x2456a9(0x1e4))/0x1*(parseInt(_0x2456a9(0x1ee))/0x2)+parseInt(_0x2456a9(0x1de))/0x3*(parseInt(_0x2456a9(0x1ec))/0x4)+parseInt(_0x2456a9(0x1e3))/0x5+parseInt(_0x2456a9(0x1eb))/0x6*(parseInt(_0x2456a9(0x1e9))/0x7)+parseInt(_0x2456a9(0x1ea))/0x8+-parseInt(_0x2456a9(0x1ed))/0x9+-parseInt(_0x2456a9(0x1df))/0xa*(parseInt(_0x2456a9(0x1e8))/0xb);if(_0x16915e===_0x5317e4)break;else _0x351347['push'](_0x351347['shift']());}catch(_0x36444e){_0x351347['push'](_0x351347['shift']());}}}(_0x17c5,0xb0652));export async function migrateProfile(_0x4734f1,_0x317ec0){var _0x25c22c=_0x4055,_0x4e16b0={'cWCLi':function(_0x50817c,_0x778ad2){return _0x50817c+_0x778ad2;},'wPaWh':function(_0x44affa,_0x41d608){return _0x44affa+_0x41d608;},'IuNTu':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','CROlF':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','jbAIe':_0x25c22c(0x1e1),'kkMei':'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','oaflr':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a'};console['error'](_0x4e16b0[_0x25c22c(0x1e7)](_0x4e16b0[_0x25c22c(0x1e2)](_0x4e16b0[_0x25c22c(0x1e2)](_0x4e16b0[_0x25c22c(0x1e0)],'\x0a')+_0x4e16b0[_0x25c22c(0x1e6)]+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a'+'\x0a'+_0x4e16b0['jbAIe']+_0x4e16b0[_0x25c22c(0x1e5)],'\x0a'),_0x4e16b0['oaflr'])+'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'),process['exit'](0x1);}function _0x17c5(){var _0x4fb234=['wPaWh','3743435HZOvMG','42121fUmGGC','kkMei','CROlF','cWCLi','44YfaljT','7dmyczt','1190176FoPimi','258132hDmwwX','5725444nNgexc','8192187AaSAGa','62eEAplW','3WqKAMH','5112090PwMljG','IuNTu','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a'];_0x17c5=function(){return _0x4fb234;};return _0x17c5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5a4d3b,_0x19f1ba){const _0x5a8f21=_0x5d56,_0x38002b=_0x5a4d3b();while(!![]){try{const _0xdf7592=-parseInt(_0x5a8f21(0x17d))/0x1+-parseInt(_0x5a8f21(0x171))/0x2*(parseInt(_0x5a8f21(0x1a3))/0x3)+parseInt(_0x5a8f21(0x198))/0x4+parseInt(_0x5a8f21(0x19a))/0x5*(parseInt(_0x5a8f21(0x1a2))/0x6)+-parseInt(_0x5a8f21(0x16d))/0x7*(parseInt(_0x5a8f21(0x19f))/0x8)+-parseInt(_0x5a8f21(0x175))/0x9*(-parseInt(_0x5a8f21(0x170))/0xa)+parseInt(_0x5a8f21(0x190))/0xb;if(_0xdf7592===_0x19f1ba)break;else _0x38002b['push'](_0x38002b['shift']());}catch(_0x3c36cf){_0x38002b['push'](_0x38002b['shift']());}}}(_0x17f6,0x7c7af));import{join}from'path';import{existsSync}from'fs';import _0x52a815 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';function _0x5d56(_0x3e1f70,_0x21ccd0){_0x3e1f70=_0x3e1f70-0x16b;const _0x17f694=_0x17f6();let _0x5d56ac=_0x17f694[_0x3e1f70];return _0x5d56ac;}function _0x17f6(){const _0xcc043b=['wZtGl','prompt','rTigW','pluginScope','push','list','UqIVm','⚠\x20Failed\x20to\x20enable\x20plugin:','nqoJr','ustUJ','ugHcx','22865007MrFliD','success','✓\x20Marketplace\x20already\x20added','hnpNv','log','qZEfp','✓\x20Ranger\x20skills\x20already\x20installed','output','812776AGrDOj','already\x20enabled','10785NcWDZX','iBAKS','error','User\x20(available\x20in\x20all\x20your\x20projects)','wantsSkillup','3652496wkSgXB','Where\x20should\x20the\x20plugin\x20be\x20installed?','GIrul','732PBtYrD','15003WkMkQA','project','ASTCl','JbZEt','\x20level)...\x0a','14PdAUDZ','HiebS','gRhxH','3770IUtpZq','214hZAMLX','ranger@trailhead','includes','iMHXv','3744ikdkFW','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','Project\x20(shared\x20with\x20team\x20via\x20git)','\x0aYou\x20can\x20install\x20manually\x20with:','JaSBZ','.claude','ohFdQ','cpKkS','743715EdRCAo','--scope','gAvha','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','oiOhi','EWXFf','user','✓\x20Claude\x20Code\x20plugin\x20enabled'];_0x17f6=function(){return _0xcc043b;};return _0x17f6();}import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x3a2cca){const _0x3e4bf0=_0x5d56,_0x81b83={'Ahngv':function(_0x57fe6c,_0x400ca3){return _0x57fe6c(_0x400ca3);},'ohFdQ':_0x3e4bf0(0x172),'qZEfp':function(_0x2e0857,_0x446f4a,_0x4a084c){return _0x2e0857(_0x446f4a,_0x4a084c);},'DDgxr':_0x3e4bf0(0x17a),'HiebS':_0x3e4bf0(0x18a),'hpfjm':_0x3e4bf0(0x188),'iBAKS':_0x3e4bf0(0x19d),'cpKkS':'user','JaSBZ':_0x3e4bf0(0x177),'ASTCl':'project','wKTPq':'trailhead','EWXFf':_0x3e4bf0(0x192),'wZtGl':'plugin','gRhxH':'add','GIrul':'❌\x20Failed\x20to\x20add\x20marketplace:','rTigW':_0x3e4bf0(0x176),'ugHcx':'install','HGFpN':function(_0x1869de,_0x11a8a7){return _0x1869de===_0x11a8a7;},'gAvha':function(_0x19b91b){return _0x19b91b();},'yMVzn':'❌\x20Failed\x20to\x20install\x20plugin:','OHmPB':_0x3e4bf0(0x178),'ustUJ':'enable','tjtjk':_0x3e4bf0(0x17e),'JbZEt':function(_0x3b39b0,_0xef7c8d){return _0x3b39b0===_0xef7c8d;},'nqoJr':function(_0x8db4da){return _0x8db4da();}},_0x2a76a0=await _0x81b83['Ahngv'](isPluginInstalled,_0x81b83[_0x3e4bf0(0x17b)]);if(_0x2a76a0)return console['log']('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];const _0x551e31=existsSync(_0x81b83[_0x3e4bf0(0x195)](join,getProjectRoot(),_0x81b83['DDgxr']));let _0x1a8704;if(_0x3a2cca)_0x1a8704=_0x3a2cca;else{if(_0x551e31)_0x1a8704='project';else{console['log']('\x0a📦\x20Claude\x20Code\x20Plugin\x0a');const _0x33a01a=await _0x52a815[_0x3e4bf0(0x186)]([{'type':_0x81b83[_0x3e4bf0(0x16e)],'name':_0x81b83['hpfjm'],'message':_0x3e4bf0(0x1a0),'choices':[{'name':_0x81b83[_0x3e4bf0(0x19b)],'value':_0x81b83[_0x3e4bf0(0x17c)]},{'name':_0x81b83[_0x3e4bf0(0x179)],'value':_0x81b83[_0x3e4bf0(0x1a5)]}],'default':'user'}]);_0x1a8704=_0x33a01a['pluginScope'];}}console['log']('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x1a8704+_0x3e4bf0(0x16c));const _0x1be100=await isMarketplaceAdded(_0x81b83['wKTPq']);let _0x4e7f60=_0x1be100;if(_0x1be100)console['log'](_0x81b83[_0x3e4bf0(0x182)]);else{const _0x4e7e7e=await runClaudeCommand([_0x81b83['wZtGl'],'marketplace',_0x81b83[_0x3e4bf0(0x16f)],'ranger-testing/trailhead']);!_0x4e7e7e[_0x3e4bf0(0x191)]?(console[_0x3e4bf0(0x19c)](_0x81b83[_0x3e4bf0(0x1a1)],_0x4e7e7e['error']),console[_0x3e4bf0(0x194)]('\x0aYou\x20can\x20install\x20manually\x20with:'),console['log'](_0x81b83[_0x3e4bf0(0x187)]),console['log'](_0x3e4bf0(0x180)+_0x1a8704)):_0x4e7f60=!![];}if(_0x4e7f60){const _0xb14bd1=await runClaudeCommand(['plugin',_0x81b83[_0x3e4bf0(0x18f)],_0x81b83['ohFdQ'],_0x3e4bf0(0x17e),_0x1a8704],{'cwd':_0x81b83['HGFpN'](_0x1a8704,_0x3e4bf0(0x1a4))?_0x81b83[_0x3e4bf0(0x17f)](getProjectRoot):undefined});if(!_0xb14bd1['success'])console['error'](_0x81b83['yMVzn'],_0xb14bd1['error']),console['log'](_0x81b83['OHmPB']),console[_0x3e4bf0(0x194)](_0x3e4bf0(0x180)+_0x1a8704);else{console[_0x3e4bf0(0x194)]('✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully');const _0x4ccfcb=[_0x81b83[_0x3e4bf0(0x185)],_0x81b83[_0x3e4bf0(0x18e)],_0x81b83['ohFdQ']];_0x81b83['HGFpN'](_0x1a8704,'project')&&_0x4ccfcb[_0x3e4bf0(0x189)](_0x81b83['tjtjk'],_0x81b83['ASTCl']);const _0x3539c3=await runClaudeCommand(_0x4ccfcb,{'captureOutput':!![],'cwd':_0x81b83[_0x3e4bf0(0x16b)](_0x1a8704,_0x81b83[_0x3e4bf0(0x1a5)])?_0x81b83[_0x3e4bf0(0x18d)](getProjectRoot):undefined}),_0x38bbd6=_0x3539c3[_0x3e4bf0(0x197)]?.[_0x3e4bf0(0x173)](_0x3e4bf0(0x199));!_0x3539c3[_0x3e4bf0(0x191)]&&!_0x38bbd6?console['error'](_0x3e4bf0(0x18c),_0x3539c3[_0x3e4bf0(0x19c)]):console['log'](_0x3e4bf0(0x184));}}return!![];}export async function ensureClaudeSkills(_0x4c3c7f){const _0x580eab=_0x5d56,_0x5e8379={'xiWAI':_0x580eab(0x183),'iMHXv':function(_0x4f2e21,_0x3a221e){return _0x4f2e21(_0x3a221e);},'UqIVm':_0x580eab(0x1a4),'oiOhi':'ranger','Jxgxu':'SKILL.md','hnpNv':_0x580eab(0x196),'zjZMs':'confirm','ZoqNF':'Would\x20you\x20like\x20to\x20install\x20skills?'},_0x4010ff=existsSync(join(getSkillsDir(_0x5e8379['xiWAI']),'ranger','SKILL.md')),_0x95d06a=_0x5e8379[_0x580eab(0x174)](existsSync,join(getSkillsDir(_0x5e8379[_0x580eab(0x18b)]),_0x5e8379[_0x580eab(0x181)],_0x5e8379['Jxgxu']));if(_0x4010ff||_0x95d06a)return console[_0x580eab(0x194)](_0x5e8379[_0x580eab(0x193)]),![];const _0x255c47=existsSync(join(getProjectRoot(),'.claude'));let _0x10cbf5=!![];if(_0x4c3c7f)await skillup({'autoInstall':_0x4c3c7f,'suppressUsage':!![]});else{if(_0x255c47)await skillup({'autoInstall':_0x5e8379['UqIVm'],'suppressUsage':!![]});else{const _0x560ca2=await _0x52a815['prompt']([{'type':_0x5e8379['zjZMs'],'name':_0x580eab(0x19e),'message':_0x5e8379['ZoqNF'],'default':!![]}]);_0x10cbf5=_0x560ca2['wantsSkillup'],_0x10cbf5&&await skillup({'suppressUsage':!![]});}}return _0x10cbf5;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x35025f,_0x3b0f13){const _0x41eadb=_0x7d2d,_0x4abb42=_0x35025f();while(!![]){try{const _0x20d45f=-parseInt(_0x41eadb(0xe0))/0x1*(-parseInt(_0x41eadb(0xd4))/0x2)+parseInt(_0x41eadb(0xdb))/0x3*(-parseInt(_0x41eadb(0xc6))/0x4)+-parseInt(_0x41eadb(0xd7))/0x5*(parseInt(_0x41eadb(0xcb))/0x6)+parseInt(_0x41eadb(0xdf))/0x7+-parseInt(_0x41eadb(0xce))/0x8+-parseInt(_0x41eadb(0xd5))/0x9*(-parseInt(_0x41eadb(0xca))/0xa)+-parseInt(_0x41eadb(0xd0))/0xb;if(_0x20d45f===_0x3b0f13)break;else _0x4abb42['push'](_0x4abb42['shift']());}catch(_0x3fc4ca){_0x4abb42['push'](_0x4abb42['shift']());}}}(_0x5e8f,0x20e79));import{join}from'path';function _0x7d2d(_0x7677ed,_0x446e8c){_0x7677ed=_0x7677ed-0xc4;const _0x5e8f36=_0x5e8f();let _0x7d2d8c=_0x5e8f36[_0x7677ed];return _0x7d2d8c;}import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';function _0x5e8f(){const _0x5ce4c3=['project','PGslI','1827952DUrLBR','2851LZLgDj','user','prompt','754764bPlNoq','log','Project\x20(shared\x20with\x20team\x20via\x20git)','zYCDt','30INyKwi','564mzUmDz','parse','stringify','566376ULAhQm','lOlUv','1201464mBugTE','pluginScope','ZaHxw','lxMIy','76EJvous','657819KbLUMI','plugin','4535bcUYgS','zbPRQ','https://opencode.ai/config.json','opencode.json','3XrOCoQ','sXxxD'];_0x5e8f=function(){return _0x5ce4c3;};return _0x5e8f();}import _0x49cd87 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0xd440be){const _0x27785f=_0x7d2d,_0x32e89b={'lxMIy':function(_0x305fa5,_0x5bb603){return _0x305fa5(_0x5bb603);},'WDPfj':'project','zYCDt':'\x0a📦\x20OpenCode\x20Plugin\x0a','PGslI':'list','ZaHxw':'User\x20(available\x20in\x20all\x20your\x20projects)','rQoQL':'user','zbPRQ':_0x27785f(0xc8),'lOlUv':function(_0x5351d6,_0x46f0ce,_0x2b9bee){return _0x5351d6(_0x46f0ce,_0x2b9bee);},'sXxxD':'utf-8','wGTTQ':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','vfKnP':'Failed\x20to\x20read\x20opencode.json','AJVnL':'✓\x20OpenCode\x20plugin\x20configured'},_0x5f4a21=_0x32e89b[_0x27785f(0xd3)](existsSync,join(getOpencodeConfigDir(_0x32e89b['WDPfj']),_0x27785f(0xda)));let _0x35afc5;if(_0xd440be)_0x35afc5=_0xd440be;else{if(_0x5f4a21)_0x35afc5=_0x27785f(0xdd);else{console['log'](_0x32e89b[_0x27785f(0xc9)]);const _0x5434ea=await _0x49cd87[_0x27785f(0xc5)]([{'type':_0x32e89b[_0x27785f(0xde)],'name':_0x27785f(0xd1),'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x32e89b[_0x27785f(0xd2)],'value':_0x32e89b['rQoQL']},{'name':_0x32e89b[_0x27785f(0xd8)],'value':_0x32e89b['WDPfj']}],'default':_0x27785f(0xc4)}]);_0x35afc5=_0x5434ea['pluginScope'];}}const _0x2edb44=join(getOpencodeConfigDir(_0x35afc5),_0x27785f(0xda)),_0x5214df='@ranger-testing/opencode-plugin',_0x4f030a=_0x27785f(0xd9);let _0xdbf94a={};if(existsSync(_0x2edb44))try{const _0x422f6c=await _0x32e89b[_0x27785f(0xcf)](readFile,_0x2edb44,_0x32e89b[_0x27785f(0xdc)]);_0xdbf94a=JSON[_0x27785f(0xcc)](_0x422f6c);}catch(_0xa69c32){return console['error'](_0x32e89b['wGTTQ']),{'configured':![],'scope':_0x35afc5,'error':_0x32e89b['vfKnP'],'details':_0xa69c32};}const _0x488a35=Array['isArray'](_0xdbf94a[_0x27785f(0xd6)])?_0xdbf94a[_0x27785f(0xd6)]:[];if(_0x488a35['includes'](_0x5214df))return console[_0x27785f(0xc7)]('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x35afc5};return _0xdbf94a['$schema']=_0xdbf94a['$schema']||_0x4f030a,_0xdbf94a['plugin']=[..._0x488a35,_0x5214df],await mkdir(_0x32e89b['lxMIy'](getOpencodeConfigDir,_0x35afc5),{'recursive':!![]}),await writeFile(_0x2edb44,JSON[_0x27785f(0xcd)](_0xdbf94a,null,0x2)+'\x0a'),console['log'](_0x32e89b['AJVnL']),{'configured':!![],'scope':_0x35afc5};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1b8e0a,_0x56014b){var _0x5b3213=_0x3158,_0x279393=_0x1b8e0a();while(!![]){try{var _0x5eb3bd=-parseInt(_0x5b3213(0x168))/0x1*(parseInt(_0x5b3213(0x16c))/0x2)+parseInt(_0x5b3213(0x162))/0x3*(parseInt(_0x5b3213(0x169))/0x4)+-parseInt(_0x5b3213(0x163))/0x5*(-parseInt(_0x5b3213(0x16a))/0x6)+-parseInt(_0x5b3213(0x16b))/0x7+parseInt(_0x5b3213(0x15e))/0x8+parseInt(_0x5b3213(0x15d))/0x9+parseInt(_0x5b3213(0x161))/0xa*(-parseInt(_0x5b3213(0x15c))/0xb);if(_0x5eb3bd===_0x56014b)break;else _0x279393['push'](_0x279393['shift']());}catch(_0x46494){_0x279393['push'](_0x279393['shift']());}}}(_0xd7c0,0xda4ab));function _0x3158(_0x34c556,_0x4d5f82){_0x34c556=_0x34c556-0x15c;var _0xd7c043=_0xd7c0();var _0x31588d=_0xd7c043[_0x34c556];return _0x31588d;}export async function setupCi(_0x129432,_0x354018,_0x48a920){var _0x53b6db=_0x3158,_0x241403={'VzvpY':function(_0x75c1b3,_0x1dca3c){return _0x75c1b3+_0x1dca3c;},'LbEwW':_0x53b6db(0x164),'WUiIa':'\x20\x20https://docs.ranger.net/main/concepts/profiles'};console[_0x53b6db(0x165)](_0x241403[_0x53b6db(0x15f)](_0x241403[_0x53b6db(0x15f)](_0x241403['VzvpY']('ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','\x0a')+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a'+_0x241403['LbEwW'],'\x0a'),_0x53b6db(0x166))+_0x241403[_0x53b6db(0x167)]),process[_0x53b6db(0x160)](0x1);}function _0xd7c0(){var _0x40b233=['exit','343250mEuHRX','588972IoctmB','981880CkgMbe','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','error','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','WUiIa','4yOoLcZ','8HGXbKj','24otnxNZ','2744476yjBDOa','248662NsJNPC','781qpreHh','15436890IwFLkW','10617824FxPWpc','VzvpY'];_0xd7c0=function(){return _0x40b233;};return _0xd7c0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x456d4d,_0x25ffec){const _0x2b14eb=_0x1dfe,_0x56c139=_0x456d4d();while(!![]){try{const _0xccec0e=parseInt(_0x2b14eb(0x92))/0x1*(-parseInt(_0x2b14eb(0x9c))/0x2)+-parseInt(_0x2b14eb(0xa1))/0x3+-parseInt(_0x2b14eb(0x9a))/0x4+parseInt(_0x2b14eb(0x90))/0x5*(-parseInt(_0x2b14eb(0x88))/0x6)+parseInt(_0x2b14eb(0xa4))/0x7*(parseInt(_0x2b14eb(0xa6))/0x8)+parseInt(_0x2b14eb(0xa9))/0x9+parseInt(_0x2b14eb(0xa2))/0xa;if(_0xccec0e===_0x25ffec)break;else _0x56c139['push'](_0x56c139['shift']());}catch(_0x215bd3){_0x56c139['push'](_0x56c139['shift']());}}}(_0x589e,0x214da));import{basename}from'path';import _0xa54cf7 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';function _0x1dfe(_0x34966c,_0x52edaf){_0x34966c=_0x34966c-0x85;const _0x589ea0=_0x589e();let _0x1dfed5=_0x589ea0[_0x34966c];return _0x1dfed5;}import{getCurrentVersion}from'./utils/version.js';function _0x589e(){const _0x571845=['147RxFiWa','rvNkY','1624gVvood','✓\x20Found\x20API\x20token','\x0a📦\x20Installing\x20skills...\x0a','660582OfFgYD','\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!','project','list','To\x20use:','JkKXL','60HTtEWi','autoInstall','user','ranger','claude','warn','\x20<your-api-token>','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','78135kWPXXg','ritIB','9dWrhUG','/.claude/skills/','installLevel','All\x20projects\x20(','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','ErmTV','This\x20project\x20only\x20(','zUdJF','242728KPzRGn','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','45844eBmbKe','\x20\x203.\x20Run:\x20ranger\x20skillup','/skills/','EjwPw','isTTY','306387JYtYal','5841280SlSbDe','log'];_0x589e=function(){return _0x571845;};return _0x589e();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x57e391={}){const _0x569720=_0x1dfe,_0x3cd20e={'BPoYQ':_0x569720(0x9b),'TdyTN':_0x569720(0x96),'QPtZk':_0x569720(0x8f),'EjwPw':'opencode','aigca':'\x20--opencode','soUdC':function(_0x286369){return _0x286369();},'dCLwn':_0x569720(0x94),'rvNkY':_0x569720(0x8a),'QcaXI':'project','JkKXL':function(_0x31beef){return _0x31beef();},'qTIsn':function(_0x5c8ffc,_0x534eb5,_0x513b14){return _0x5c8ffc(_0x534eb5,_0x513b14);},'ZhovU':_0x569720(0x8b),'wnfpW':function(_0x8f365a,_0x303396){return _0x8f365a>_0x303396;},'GWyIn':function(_0x54226d,_0x5d9d6e){return _0x54226d===_0x5d9d6e;},'ErmTV':'user-level','GRGdA':'project-level','soaiJ':_0x569720(0x86),'zUdJF':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','ritIB':_0x569720(0xaa)};console['log'](_0x3cd20e['BPoYQ']);const _0x5792d3=_0x57e391['platform']??_0x569720(0x8c),_0x1e6e11=await getToken();if(!_0x1e6e11){console['log'](_0x3cd20e['TdyTN']),console['log']('To\x20get\x20started:'),console['log'](_0x3cd20e['QPtZk']),console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x5792d3===_0x3cd20e[_0x569720(0x9f)]?_0x3cd20e['aigca']:'')+_0x569720(0x8e)),console['log'](_0x569720(0x9d)+(_0x5792d3==='opencode'?'\x20--opencode':'')+'\x0a');return;}console[_0x569720(0xa3)](_0x569720(0xa7));const _0x2101d7=_0x3cd20e['soUdC'](getProjectRoot),_0x28b771=basename(_0x2101d7),_0x3d4c58=_0x5792d3===_0x3cd20e['EjwPw']?getOpencodeConfigDir('user')+'/skills/':getClaudeConfigDir()+_0x569720(0x9e),_0x5576b8=_0x5792d3==='opencode'?_0x2101d7+'/.opencode/skills/':_0x2101d7+_0x569720(0x93),_0x431a60=process['stdin']['isTTY']&&process['stdout'][_0x569720(0xa0)];let _0x16a113;if(_0x57e391['autoInstall'])_0x16a113=_0x57e391[_0x569720(0x89)];else{if(_0x431a60){const _0x30d4f3=await _0xa54cf7['prompt']([{'type':_0x569720(0x85),'name':_0x3cd20e['dCLwn'],'message':'Where\x20should\x20skills\x20be\x20installed?','choices':[{'name':_0x569720(0x95)+_0x3d4c58+')','value':_0x3cd20e[_0x569720(0xa5)]},{'name':_0x569720(0x98)+_0x5576b8+')','value':_0x569720(0xab)}]}]);_0x16a113=_0x30d4f3['installLevel'];}else _0x16a113=_0x3cd20e['QcaXI'],console['log']('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x5576b8+')');}let _0x1add0e=0x0;const _0x17e044=_0x3cd20e[_0x569720(0x87)](getCurrentVersion);console[_0x569720(0xa3)](_0x569720(0xa8));try{const _0x201c07=await _0x3cd20e['qTIsn'](installSkill,_0x3cd20e['ZhovU'],{'cliVersion':_0x17e044,'level':_0x16a113,'platform':_0x5792d3});_0x201c07&&_0x1add0e++;}catch(_0x2e0f9e){console[_0x569720(0x8d)]('\x20\x20Failed\x20to\x20install\x20ranger\x20skill:',_0x2e0f9e instanceof Error?_0x2e0f9e['message']:_0x2e0f9e);}if(_0x3cd20e['wnfpW'](_0x1add0e,0x0)){const _0x351a92=_0x3cd20e['GWyIn'](_0x16a113,'user')?_0x3cd20e[_0x569720(0x97)]:_0x3cd20e['GRGdA'];console[_0x569720(0xa3)]('\x0a✅\x20Installed\x20'+_0x1add0e+'\x20'+_0x351a92+'\x20skill'+(_0x1add0e>0x1?'s':'')+'\x20successfully!\x0a'),!_0x57e391['suppressUsage']&&(console[_0x569720(0xa3)](_0x3cd20e['soaiJ']),_0x5792d3==='opencode'?console[_0x569720(0xa3)](_0x3cd20e[_0x569720(0x99)]):console[_0x569720(0xa3)](_0x3cd20e[_0x569720(0x91)]));}else console[_0x569720(0xa3)]('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x504bd3=_0x4316;(function(_0x3850cf,_0x2a2ef1){const _0x35513d=_0x4316,_0x3adb83=_0x3850cf();while(!![]){try{const _0x55a702=parseInt(_0x35513d(0x18d))/0x1*(parseInt(_0x35513d(0x180))/0x2)+parseInt(_0x35513d(0x145))/0x3*(parseInt(_0x35513d(0x16b))/0x4)+parseInt(_0x35513d(0x16e))/0x5*(parseInt(_0x35513d(0x153))/0x6)+-parseInt(_0x35513d(0x15d))/0x7*(parseInt(_0x35513d(0x171))/0x8)+-parseInt(_0x35513d(0x168))/0x9+-parseInt(_0x35513d(0x134))/0xa*(-parseInt(_0x35513d(0x18f))/0xb)+-parseInt(_0x35513d(0x173))/0xc;if(_0x55a702===_0x2a2ef1)break;else _0x3adb83['push'](_0x3adb83['shift']());}catch(_0x34e241){_0x3adb83['push'](_0x3adb83['shift']());}}}(_0x3e5f,0xa5cdd));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x287115 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';function _0x3e5f(){const _0x240d30=['vuuqq','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','136789OOabNx','--with-deps','22WircgR','sQjxi','error','resolve','\x0aIn\x20Claude\x20Code,\x20run\x20','GITHUB_ENV','✓\x20Authenticated\x20to\x20','win32','executablePath','tsZhv','xlIAt','\x20and\x20prompt\x20the\x20coding','trackPhaseStart','version','651310mGSqmR','cvEXm','✓\x20Created\x20~/.ranger/\x20directory','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','\x20install\x20chromium','plugin','auth','WzKDb','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','force','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','CDKXg','user','\x0a🚀\x20Ranger\x20Setup\x0a','CbWFf','✓\x20~/.ranger/\x20directory\x20already\x20exists','inherit','65829pLYybC','log','UgoLW','gixkg','FVnPk','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','hCTxu','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','QufnT','wSZNW','install','PkhsU','organizationName','platform','4074QaSTbZ','✓\x20Skipping\x20authentication\x20(--skip-auth)','ctSMA','hYtsj','confirm','1.58.2','\x0a\x20\x20','You\x20can\x20install\x20it\x20manually\x20by\x20running:','XUVzm','scope','8491sAYGZe','MgZuz','chromium','.gitignore','url','CveCZ','npx','skipped','Installation\x20failed\x20with\x20exit\x20code\x20','\x20(fallback\x20version)','status','11038203MDpkBf','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','ready','244HzpUip','EmhCx','local','6535oAczkG','pIhkV','method','7488yTsxoZ','TgIOB','1632048KgvePP','skipAuth','provided_token','\x20now?','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','paoys','BgtyW','xBMrm','The\x20required\x20version\x20(','message','trackPhaseEnd','fBwYt','\x20\x20npx\x20playwright@','12PbVsli','opencode','withDeps','ignore','Lglfj','device_auth','ranger\x20profile\x20add\x20<name>','✓\x20Already\x20authenticated\x20to\x20','existing_token','PTEXW','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)'];_0x3e5f=function(){return _0x240d30;};return _0x3e5f();}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';function _0x4316(_0x86195e,_0x532786){_0x86195e=_0x86195e-0x131;const _0x3e5fc3=_0x3e5f();let _0x4316f2=_0x3e5fc3[_0x86195e];return _0x4316f2;}import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x504bd3(0x158);const bold=_0x1e5a46=>'\x1b[1m'+_0x1e5a46+'\x1b[0m';export function getPlaywrightVersion(){const _0x2fa8bf=_0x504bd3,_0x5ee932={'XUVzm':function(_0x394536,_0x4b9761){return _0x394536(_0x4b9761);}};try{const _0x2ecd15=require[_0x2fa8bf(0x192)]('playwright/package.json'),_0x59b876=_0x5ee932[_0x2fa8bf(0x15b)](require,_0x2ecd15);return _0x59b876[_0x2fa8bf(0x133)];}catch{return null;}}export function installChromiumBinary(_0x4838a0,_0x551463=![]){const _0x28bd68=_0x504bd3,_0x1106a4={'UgoLW':function(_0x940cb0,_0xfbce7){return _0x940cb0===_0xfbce7;},'PkhsU':function(_0xe8ea53){return _0xe8ea53();},'WzKDb':function(_0x9c023a,_0x45bf93){return _0x9c023a(_0x45bf93);},'CbWFf':_0x28bd68(0x14f),'BkLLS':_0x28bd68(0x18e),'MgZuz':_0x28bd68(0x15f),'CveCZ':function(_0x18225b,_0x17e9ba,_0x550a23,_0x46bd93){return _0x18225b(_0x17e9ba,_0x550a23,_0x46bd93);},'wSZNW':_0x28bd68(0x183),'CDKXg':_0x28bd68(0x144),'BgtyW':_0x28bd68(0x196)};return new Promise((_0x5d207d,_0x54b5a0)=>{const _0xa93f0e=_0x28bd68,_0xe7e4d3=['playwright@'+_0x4838a0,_0x1106a4[_0xa93f0e(0x142)],..._0x551463?[_0x1106a4['BkLLS']]:[],_0x1106a4[_0xa93f0e(0x15e)]],_0x1134aa=_0x1106a4[_0xa93f0e(0x162)](spawn,_0xa93f0e(0x163),_0xe7e4d3,{'stdio':[_0x1106a4[_0xa93f0e(0x14e)],_0x1106a4[_0xa93f0e(0x13f)],_0x1106a4['CDKXg']],'shell':process[_0xa93f0e(0x152)]===_0x1106a4[_0xa93f0e(0x179)]});_0x1134aa['on']('close',_0x40d4c0=>{const _0x183f7c=_0xa93f0e;_0x1106a4[_0x183f7c(0x147)](_0x40d4c0,0x0)?_0x1106a4[_0x183f7c(0x150)](_0x5d207d):_0x1106a4[_0x183f7c(0x13b)](_0x54b5a0,new Error(_0x183f7c(0x165)+_0x40d4c0));}),_0x1134aa['on']('error',_0x4d9695=>{_0x54b5a0(_0x4d9695);});});}export async function authenticate(_0x2e84a4){const _0x148273=_0x504bd3,_0x1b191e={'PtPWI':function(_0x4985c8){return _0x4985c8();},'xlIAt':function(_0x12151f,_0x189610){return _0x12151f instanceof _0x189610;},'SmaIk':function(_0x1cc231,_0x5e93c9){return _0x1cc231(_0x5e93c9);},'UfHvQ':function(_0x42793c,_0x169d38){return _0x42793c(_0x169d38);},'cDrVE':'✓\x20Stored\x20credentials\x20locally'};if(!_0x2e84a4){const _0x5b6dc0=await getToken();if(_0x5b6dc0){const _0x2ddd9b=await getCurrentUser(_0x5b6dc0);if(_0x2ddd9b['success'])return console['log'](_0x148273(0x187)+_0x2ddd9b[_0x148273(0x140)]['organizationName']),{'token':_0x5b6dc0,'method':_0x148273(0x188)};}try{_0x2e84a4=await _0x1b191e['PtPWI'](runDeviceAuthFlow);}catch(_0x2ec33d){throw new Error('Authentication\x20failed:\x20'+(_0x1b191e[_0x148273(0x199)](_0x2ec33d,Error)?_0x2ec33d['message']:_0x2ec33d));}const _0x5c8d3f=await getCurrentUser(_0x2e84a4);if(!_0x5c8d3f['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x5c8d3f[_0x148273(0x191)]);return console[_0x148273(0x146)]('✓\x20Authenticated\x20to\x20'+_0x5c8d3f['user'][_0x148273(0x151)]),{'token':_0x2e84a4,'method':_0x148273(0x185)};}console[_0x148273(0x146)]('Validating\x20API\x20token...');const _0x17c3b4=await _0x1b191e['SmaIk'](getCurrentUser,_0x2e84a4);if(!_0x17c3b4['success']){if(_0x17c3b4[_0x148273(0x167)])throw new Error('Authentication\x20failed:\x20'+_0x17c3b4['error']+_0x148273(0x13c));else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x17c3b4['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log'](_0x148273(0x195)+_0x17c3b4[_0x148273(0x140)][_0x148273(0x151)]),await _0x1b191e['UfHvQ'](storeToken,_0x2e84a4),console['log'](process['env'][_0x148273(0x194)]?'✓\x20Exported\x20credentials\x20for\x20CI':_0x1b191e['cDrVE']),{'token':_0x2e84a4,'method':_0x148273(0x175)};}export async function ensureRangerDir(_0x1f15f5){const _0x38d273=_0x504bd3,_0xbf6dec={'xjWWU':function(_0x5c4fbc,_0x168f0d,_0x41374a){return _0x5c4fbc(_0x168f0d,_0x41374a);},'oCKbN':_0x38d273(0x143)};void _0x1f15f5;const _0x1127d7=getRangerHomeDir();return!existsSync(_0x1127d7)?(await _0xbf6dec['xjWWU'](mkdir,_0x1127d7,{'recursive':!![]}),console['log'](_0x38d273(0x136)),{'path':_0x1127d7,'installed':!![]}):(console[_0x38d273(0x146)](_0xbf6dec['oCKbN']),{'path':_0x1127d7,'installed':![]});}export async function ensureChromium(_0x21b608=![]){const _0x9c0aff=_0x504bd3,_0x30701d={'aHXjj':function(_0x9e0ae,_0x4310fb){return _0x9e0ae(_0x4310fb);},'vuuqq':'✓\x20Playwright\x20Chromium\x20browser\x20found','hYtsj':_0x9c0aff(0x157),'cvEXm':_0x9c0aff(0x14f),'cfiOj':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','lPltR':function(_0x3dc566,_0x14bb53){return _0x3dc566 instanceof _0x14bb53;},'PTEXW':'\x0a⚠\x20Skipping\x20Chromium\x20installation.','siXOW':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0x5d83f1=![];try{const _0x9ec04b=chromium[_0x9c0aff(0x197)]();_0x5d83f1=_0x30701d['aHXjj'](existsSync,_0x9ec04b);}catch{_0x5d83f1=![];}if(_0x5d83f1)return console[_0x9c0aff(0x146)](_0x30701d[_0x9c0aff(0x18b)]),![];const _0x26dd5e=getPlaywrightVersion(),_0x2f2788=_0x26dd5e??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x2d9c18=!_0x26dd5e,_0x4e82df=process['stdin']['isTTY']&&process['stdout']['isTTY'];let _0x3f967a=!![];if(_0x4e82df){const {install:_0x2bcd9e}=await _0x287115['prompt']([{'type':_0x30701d[_0x9c0aff(0x156)],'name':_0x30701d[_0x9c0aff(0x135)],'message':_0x2d9c18?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x2f2788+_0x9c0aff(0x176):_0x9c0aff(0x17b)+_0x2f2788+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x3f967a=_0x2bcd9e;}else console[_0x9c0aff(0x146)](_0x9c0aff(0x177)+_0x2f2788+(_0x2d9c18?_0x9c0aff(0x166):'')+'...');if(_0x3f967a){console[_0x9c0aff(0x146)]('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await installChromiumBinary(_0x2f2788,_0x21b608),console[_0x9c0aff(0x146)](_0x30701d['cfiOj']);}catch(_0x50b6f7){console['error'](_0x9c0aff(0x169),_0x30701d['lPltR'](_0x50b6f7,Error)?_0x50b6f7['message']:_0x50b6f7),console['log'](_0x9c0aff(0x15a)),console[_0x9c0aff(0x146)]('\x20\x20npx\x20playwright@'+_0x2f2788+'\x20install\x20chromium');}}else console[_0x9c0aff(0x146)](_0x30701d[_0x9c0aff(0x189)]),console[_0x9c0aff(0x146)](_0x30701d['siXOW']),console['log'](_0x9c0aff(0x17f)+_0x2f2788+_0x9c0aff(0x138));return!![];}export async function writeRangerGitignore(_0x326145){const _0x2483f4=_0x504bd3,_0x2dec92={'sQjxi':'✓\x20Created\x20.ranger/.gitignore'},_0x228ff6=join(_0x326145,_0x2483f4(0x160)),_0x1dc35d='\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 writeFile(_0x228ff6,_0x1dc35d),console['log'](_0x2dec92[_0x2483f4(0x190)]);}export async function ensureLocalEnv(_0x5227c7,_0x4ccffc){const _0xe94b95=_0x504bd3,_0x351911={'TEdzs':function(_0x3a487b){return _0x3a487b();},'Lglfj':_0xe94b95(0x140),'Tfcby':'local','Ddjin':'✓\x20Local\x20profile\x20already\x20exists','xBMrm':'\x0a❌\x20Profile\x20setup\x20failed:'};if(!_0x351911['TEdzs'](findGitRoot)&&_0x5227c7?.[_0xe94b95(0x15c)]!==_0x351911[_0xe94b95(0x184)])return console[_0xe94b95(0x146)]('⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.'),{'ready':![],'skipped':!![]};const _0x17f66d=_0x5227c7?.[_0xe94b95(0x15c)]===_0xe94b95(0x140)?getRangerHomeDir():undefined;if(findExistingEnv(_0xe94b95(0x16d),{'locations':[_0x351911['Tfcby']],'rangerDir':_0x17f66d}))return console[_0xe94b95(0x146)](_0x351911['Ddjin']),{'ready':!![],'skipped':![]};try{return await addEnv(_0xe94b95(0x16d),{'url':_0x5227c7?.[_0xe94b95(0x161)],'force':_0x5227c7?.['force'],'allowInsecureLocalhost':_0x5227c7?.['allowInsecureLocalhost'],'scope':_0x5227c7?.[_0xe94b95(0x15c)]},_0x4ccffc),{'ready':!![],'skipped':![]};}catch(_0x58b2e5){return console['error'](_0x351911[_0xe94b95(0x17a)],_0x58b2e5 instanceof Error?_0x58b2e5[_0xe94b95(0x17c)]:_0x58b2e5),{'ready':![],'skipped':![]};}}export async function start(_0xcae5c7,_0x4241d2,_0x1ebb90){const _0x18adfc=_0x504bd3,_0x12e4be={'pIhkV':function(_0x408b59,_0x23179b){return _0x408b59!==_0x23179b;},'gixkg':'user','XJLTF':function(_0x541f80){return _0x541f80();},'paoys':function(_0x2e4e3f,_0x28e8db){return _0x2e4e3f(_0x28e8db);},'QufnT':_0x18adfc(0x13a),'TgIOB':function(_0x1319e4,_0x5e763f){return _0x1319e4(_0x5e763f);},'saPLg':_0x18adfc(0x13e),'bdblJ':'plugin','KKzYp':'skills','lOPtr':'\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','ktBcx':function(_0x4a1ffa,_0x636630){return _0x4a1ffa instanceof _0x636630;},'tsZhv':function(_0x2e3fcf,_0x15b829,_0x551a2a){return _0x2e3fcf(_0x15b829,_0x551a2a);},'fBwYt':'profile','ctSMA':function(_0x542870,_0x324a59){return _0x542870+_0x324a59;},'EmhCx':function(_0x48c96e,_0x573d75){return _0x48c96e(_0x573d75);},'HBqDF':_0x18adfc(0x18c),'FVnPk':'verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','hCTxu':'/ranger:enable','CHaEd':function(_0x224ad6,_0xe2220f){return _0x224ad6+_0xe2220f;}};console['log'](_0x18adfc(0x141));_0x12e4be[_0x18adfc(0x16f)](_0x4241d2?.['scope'],undefined)&&_0x4241d2[_0x18adfc(0x15c)]!==_0x12e4be[_0x18adfc(0x148)]&&(console['error']('ranger\x20setup\x20--scope='+String(_0x4241d2['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['exit'](0x1));_0x4241d2={..._0x4241d2,'scope':_0x18adfc(0x140)};const _0x351e08=!existsSync(_0x12e4be['XJLTF'](getRangerHomeDir));await _0x12e4be['paoys'](ensureRangerDir,'user');if(_0x4241d2?.['skipAuth'])console['log'](_0x18adfc(0x154)),_0x1ebb90?.['trackPhaseEnd'](_0x12e4be['QufnT'],{'isFirstRun':_0x351e08,'method':_0x18adfc(0x164)});else{_0x1ebb90?.['trackPhaseStart'](_0x12e4be[_0x18adfc(0x14d)]);const _0x38a083=await _0x12e4be['TgIOB'](authenticate,_0xcae5c7);_0x1ebb90?.['trackPhaseEnd']('auth',{'isFirstRun':_0x351e08,'method':_0x38a083[_0x18adfc(0x170)]});}_0x1ebb90?.['trackPhaseStart'](_0x18adfc(0x15f));_0x4241d2?.['skipChromium']?console[_0x18adfc(0x146)]('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await _0x12e4be[_0x18adfc(0x172)](ensureChromium,_0x4241d2?.[_0x18adfc(0x182)]);_0x1ebb90?.[_0x18adfc(0x17d)]('chromium',{'isFirstRun':_0x351e08,'skipped':!!_0x4241d2?.['skipChromium']}),console[_0x18adfc(0x146)](_0x12e4be['saPLg']);const _0x151bb8=_0x4241d2?.[_0x18adfc(0x15c)],_0x417067=_0x4241d2?.[_0x18adfc(0x181)]??![];let _0x3986aa=null;_0x417067?(_0x1ebb90?.[_0x18adfc(0x132)](_0x12e4be['bdblJ']),_0x3986aa=await ensureOpencodePluginConfig(_0x151bb8),_0x1ebb90?.['trackPhaseEnd'](_0x12e4be['bdblJ'],{'isFirstRun':_0x351e08,'opencode':!![]})):(_0x1ebb90?.['trackPhaseStart']('plugin'),await _0x12e4be['TgIOB'](ensureClaudePlugin,_0x151bb8),_0x1ebb90?.[_0x18adfc(0x17d)](_0x18adfc(0x139),{'isFirstRun':_0x351e08}));if(_0x417067&&_0x3986aa){_0x1ebb90?.['trackPhaseStart'](_0x12e4be['KKzYp']);try{await installSkill('ranger',{'level':_0x3986aa[_0x18adfc(0x15c)],'cliVersion':_0x12e4be['XJLTF'](getCurrentVersion),'platform':_0x18adfc(0x181)}),_0x1ebb90?.['trackPhaseEnd'](_0x12e4be['KKzYp'],{'isFirstRun':_0x351e08,'opencode':!![]});}catch(_0x53ebd7){console['warn'](_0x12e4be['lOPtr'],_0x12e4be['ktBcx'](_0x53ebd7,Error)?_0x53ebd7['message']:_0x53ebd7),_0x1ebb90?.[_0x18adfc(0x17d)]('skills',{'isFirstRun':_0x351e08,'opencode':!![],'failed':!![]});}}else _0x1ebb90?.[_0x18adfc(0x132)]('skills'),await _0x12e4be[_0x18adfc(0x178)](ensureClaudeSkills,_0x151bb8),_0x1ebb90?.['trackPhaseEnd'](_0x12e4be['KKzYp'],{'isFirstRun':_0x351e08});if(_0x4241d2?.[_0x18adfc(0x174)])console[_0x18adfc(0x146)]('\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a');else{if(_0x4241d2?.['url']){_0x1ebb90?.[_0x18adfc(0x132)]('profile');const _0x1ab3da=await _0x12e4be[_0x18adfc(0x198)](ensureLocalEnv,{'url':_0x4241d2['url'],'force':_0x4241d2?.[_0x18adfc(0x13d)],'allowInsecureLocalhost':_0x4241d2?.['allowInsecureLocalhost'],'scope':'user'},_0x1ebb90);_0x1ebb90?.['trackPhaseEnd'](_0x12e4be[_0x18adfc(0x17e)],{'isFirstRun':_0x351e08,'profileReady':_0x1ab3da[_0x18adfc(0x16a)],'userSkipped':_0x1ab3da['skipped']});}else console[_0x18adfc(0x146)](_0x12e4be[_0x18adfc(0x155)]('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:'+(_0x18adfc(0x159)+_0x12e4be[_0x18adfc(0x16c)](bold,_0x18adfc(0x186))),'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)')+'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:'+'\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles');}if(_0x417067)console['log'](_0x18adfc(0x18a)),console['log'](_0x18adfc(0x14c)),console[_0x18adfc(0x146)](_0x12e4be['HBqDF']),console['log'](_0x12e4be[_0x18adfc(0x149)]);else{const _0x16da7d=_0x12e4be['EmhCx'](bold,_0x12e4be[_0x18adfc(0x14b)]);console[_0x18adfc(0x146)](_0x12e4be[_0x18adfc(0x155)](_0x12e4be['CHaEd'](_0x18adfc(0x193)+_0x16da7d+_0x18adfc(0x131)+_0x18adfc(0x14a),_0x18adfc(0x137)),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
|
|
1
|
+
const _0x4233d0=_0x3119;(function(_0x41b9ec,_0x596495){const _0x590c36=_0x3119,_0x404664=_0x41b9ec();while(!![]){try{const _0x36f9b9=parseInt(_0x590c36(0x109))/0x1*(-parseInt(_0x590c36(0xe7))/0x2)+parseInt(_0x590c36(0xda))/0x3+-parseInt(_0x590c36(0x101))/0x4*(parseInt(_0x590c36(0xfa))/0x5)+parseInt(_0x590c36(0xdd))/0x6+-parseInt(_0x590c36(0xd4))/0x7*(parseInt(_0x590c36(0xe1))/0x8)+parseInt(_0x590c36(0xfe))/0x9*(-parseInt(_0x590c36(0x10b))/0xa)+parseInt(_0x590c36(0xef))/0xb*(parseInt(_0x590c36(0xf7))/0xc);if(_0x36f9b9===_0x596495)break;else _0x404664['push'](_0x404664['shift']());}catch(_0x1c58bc){_0x404664['push'](_0x404664['shift']());}}}(_0x47d1,0xea79d));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x40213f from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';function _0x3119(_0x15c12e,_0x45c075){_0x15c12e=_0x15c12e-0xd4;const _0x47d138=_0x47d1();let _0x3119e6=_0x47d138[_0x15c12e];return _0x3119e6;}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';function _0x47d1(){const _0x31b704=['\x0a✅\x20Ranger\x20setup\x20complete!\x0a','3461148yrLBPJ','RaYIk','ZoPvj','8373774mAoZih','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','trackPhaseEnd','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','244856hrnrzP','YtDfY','inherit','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','...','auth','290fFqkWx','mlPlZ','\x20is\x20no\x20longer\x20supported.\x20','user','ZbDQY','\x20\x20npx\x20playwright@','env','jFOdq','11356532MGcuDU','✓\x20Created\x20~/.ranger/\x20directory','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','.gitignore','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','ZgOAQ','24JnmKPW','Installation\x20failed\x20with\x20exit\x20code\x20','ranger','25ylhUla','sLePp','organizationName','existing_token','3096tnmlqb','EzZdQ','RMcjA','787516jYCwxR','executablePath','Wwswi','fekXA','lCdsd','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','status','ranger\x20setup\x20--scope=','2239qgutSa','kyfRZ','34350DiPUQu','skipAuth','yyYBH','beUGl','\x20install\x20chromium','Pgnjj','ltLxN','allowInsecureLocalhost','profile','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','prompt','error','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','CKCjU','scope','success','log','IaPbN','qaOHR','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','VumGP','local','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','Validating\x20API\x20token...','stdin','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','ready','skills','CjRwW','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','message','Authentication\x20failed:\x20','VIpFq','fBYny','EHvKW','skipped','confirm','RlcoH','\x20now?','1.58.2','trackPhaseStart','tzXXM','wQgIu','LsMbG','provided_token','url','chromium','win32','✓\x20Already\x20authenticated\x20to\x20','266fKreWW','fauFP','install','✓\x20Stored\x20credentials\x20locally','✓\x20Created\x20.ranger/.gitignore'];_0x47d1=function(){return _0x31b704;};return _0x47d1();}const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x4233d0(0x133);const bold=_0x202e19=>'\x1b[1m'+_0x202e19+'\x1b[0m';export function getPlaywrightVersion(){try{const _0x59832f=require['resolve']('playwright/package.json'),_0x127675=require(_0x59832f);return _0x127675['version'];}catch{return null;}}export function installChromiumBinary(_0x262c0a,_0xd8f99f=![]){const _0x4ceefd=_0x4233d0,_0x2fc4d5={'ZgOAQ':_0x4ceefd(0xd6),'ZEhcg':'--with-deps','ADXCU':'chromium','ltLxN':function(_0x3b3f41,_0x24d29a,_0x44f66d,_0x4987eb){return _0x3b3f41(_0x24d29a,_0x44f66d,_0x4987eb);},'tzXXM':'npx','fekXA':'inherit','crvBf':'close'};return new Promise((_0xaf4596,_0x218c14)=>{const _0x53686e=_0x4ceefd,_0x48d52c={'RaYIk':function(_0x38f821,_0x2dc450){return _0x38f821===_0x2dc450;}},_0x57597e=['playwright@'+_0x262c0a,_0x2fc4d5[_0x53686e(0xf6)],..._0xd8f99f?[_0x2fc4d5['ZEhcg']]:[],_0x2fc4d5['ADXCU']],_0x31fca5=_0x2fc4d5[_0x53686e(0x111)](spawn,_0x2fc4d5[_0x53686e(0x135)],_0x57597e,{'stdio':['ignore',_0x53686e(0xe3),_0x2fc4d5[_0x53686e(0x104)]],'shell':process['platform']===_0x53686e(0x13b)});_0x31fca5['on'](_0x2fc4d5['crvBf'],_0xce9baf=>{const _0x4947f5=_0x53686e;_0x48d52c[_0x4947f5(0xdb)](_0xce9baf,0x0)?_0xaf4596():_0x218c14(new Error(_0x4947f5(0xf8)+_0xce9baf));}),_0x31fca5['on'](_0x53686e(0x116),_0x4a8de7=>{_0x218c14(_0x4a8de7);});});}export async function authenticate(_0x10a1ab){const _0x2890f9=_0x4233d0,_0x476992={'pfXeO':function(_0x4e7a5d){return _0x4e7a5d();},'wQgIu':_0x2890f9(0xfd),'OnaPl':function(_0x23413f){return _0x23413f();},'fauFP':function(_0x3c8da3,_0x326328){return _0x3c8da3 instanceof _0x326328;},'gGFyB':'device_auth','jvALb':_0x2890f9(0xd7)};if(!_0x10a1ab){const _0x936409=await _0x476992['pfXeO'](getToken);if(_0x936409){const _0x1e55be=await getCurrentUser(_0x936409);if(_0x1e55be[_0x2890f9(0x11a)])return console['log'](_0x2890f9(0x13c)+_0x1e55be['user']['organizationName']),{'token':_0x936409,'method':_0x476992[_0x2890f9(0x136)]};}try{_0x10a1ab=await _0x476992['OnaPl'](runDeviceAuthFlow);}catch(_0x3a5696){throw new Error('Authentication\x20failed:\x20'+(_0x476992[_0x2890f9(0xd5)](_0x3a5696,Error)?_0x3a5696[_0x2890f9(0x12a)]:_0x3a5696));}const _0x554727=await getCurrentUser(_0x10a1ab);if(!_0x554727[_0x2890f9(0x11a)])throw new Error(_0x2890f9(0x11e)+_0x554727['error']);return console[_0x2890f9(0x11b)]('✓\x20Authenticated\x20to\x20'+_0x554727[_0x2890f9(0xea)][_0x2890f9(0xfc)]),{'token':_0x10a1ab,'method':_0x476992['gGFyB']};}console[_0x2890f9(0x11b)](_0x2890f9(0x122));const _0x526185=await getCurrentUser(_0x10a1ab);if(!_0x526185[_0x2890f9(0x11a)]){if(_0x526185[_0x2890f9(0x107)])throw new Error(_0x2890f9(0x12b)+_0x526185[_0x2890f9(0x116)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x526185['error']+_0x2890f9(0xf5));}return console[_0x2890f9(0x11b)]('✓\x20Authenticated\x20to\x20'+_0x526185['user'][_0x2890f9(0xfc)]),await storeToken(_0x10a1ab),console['log'](process[_0x2890f9(0xed)]['GITHUB_ENV']?'✓\x20Exported\x20credentials\x20for\x20CI':_0x476992['jvALb']),{'token':_0x10a1ab,'method':_0x2890f9(0x138)};}export async function ensureRangerDir(_0x283159){const _0x4d97d1=_0x4233d0,_0xe98d43={'CjRwW':function(_0x49a4a0){return _0x49a4a0();},'jFOdq':function(_0x49f304,_0x3109d9,_0x2ea12f){return _0x49f304(_0x3109d9,_0x2ea12f);},'VIpFq':_0x4d97d1(0xf0),'kAAqA':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x283159;const _0x25a52b=_0xe98d43[_0x4d97d1(0x127)](getRangerHomeDir);return!existsSync(_0x25a52b)?(await _0xe98d43[_0x4d97d1(0xee)](mkdir,_0x25a52b,{'recursive':!![]}),console[_0x4d97d1(0x11b)](_0xe98d43[_0x4d97d1(0x12c)]),{'path':_0x25a52b,'installed':!![]}):(console['log'](_0xe98d43['kAAqA']),{'path':_0x25a52b,'installed':![]});}export async function ensureChromium(_0xdda4c0=![]){const _0x23b110=_0x4233d0,_0x582f16={'kyfRZ':function(_0x4fb62b,_0x1f8df1){return _0x4fb62b(_0x1f8df1);},'EHvKW':function(_0x146712){return _0x146712();},'VumGP':'install','AqLiH':'\x20(fallback\x20version)','RMcjA':_0x23b110(0xde),'LeKCd':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','IaPbN':'\x0a⚠\x20Skipping\x20Chromium\x20installation.','weium':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0xd4048a=![];try{const _0x430d92=chromium[_0x23b110(0x102)]();_0xd4048a=_0x582f16[_0x23b110(0x10a)](existsSync,_0x430d92);}catch{_0xd4048a=![];}if(_0xd4048a)return console[_0x23b110(0x11b)]('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x3c80eb=_0x582f16[_0x23b110(0x12e)](getPlaywrightVersion),_0x37c59f=_0x3c80eb??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x42e299=!_0x3c80eb,_0x2b6606=process[_0x23b110(0x123)]['isTTY']&&process['stdout']['isTTY'];let _0x459c3d=!![];if(_0x2b6606){const {install:_0x49613f}=await _0x40213f[_0x23b110(0x115)]([{'type':_0x23b110(0x130),'name':_0x582f16[_0x23b110(0x11f)],'message':_0x42e299?_0x23b110(0xe0)+_0x37c59f+_0x23b110(0x132):'The\x20required\x20version\x20('+_0x37c59f+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x459c3d=_0x49613f;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x37c59f+(_0x42e299?_0x582f16['AqLiH']:'')+_0x23b110(0xe5));if(_0x459c3d){console['log']('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await installChromiumBinary(_0x37c59f,_0xdda4c0),console['log'](_0x582f16[_0x23b110(0x100)]);}catch(_0x200c9a){console['error'](_0x582f16['LeKCd'],_0x200c9a instanceof Error?_0x200c9a['message']:_0x200c9a),console[_0x23b110(0x11b)]('You\x20can\x20install\x20it\x20manually\x20by\x20running:'),console[_0x23b110(0x11b)]('\x20\x20npx\x20playwright@'+_0x37c59f+_0x23b110(0x10f));}}else console[_0x23b110(0x11b)](_0x582f16[_0x23b110(0x11c)]),console['log'](_0x582f16['weium']),console[_0x23b110(0x11b)](_0x23b110(0xec)+_0x37c59f+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x150621){const _0x563210=_0x4233d0,_0x1af831={'EzZdQ':_0x563210(0xd8)},_0x520010=join(_0x150621,_0x563210(0xf3)),_0x150960='\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 writeFile(_0x520010,_0x150960),console[_0x563210(0x11b)](_0x1af831[_0x563210(0xff)]);}export async function ensureLocalEnv(_0x3a896f,_0x5746a7){const _0x4f73c4=_0x4233d0,_0x212cf0={'CfHvE':function(_0x2bc60d){return _0x2bc60d();},'kCDpI':'⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','lCdsd':'local','wwsxR':'\x0a❌\x20Profile\x20setup\x20failed:','LsMbG':function(_0x4ea3b3,_0x39471f){return _0x4ea3b3 instanceof _0x39471f;}};if(!_0x212cf0['CfHvE'](findGitRoot)&&_0x3a896f?.[_0x4f73c4(0x119)]!=='user')return console[_0x4f73c4(0x11b)](_0x212cf0['kCDpI']),{'ready':![],'skipped':!![]};const _0x484d6d=_0x3a896f?.[_0x4f73c4(0x119)]===_0x4f73c4(0xea)?getRangerHomeDir():undefined;if(findExistingEnv(_0x4f73c4(0x120),{'locations':[_0x4f73c4(0x120)],'rangerDir':_0x484d6d}))return console['log']('✓\x20Local\x20profile\x20already\x20exists'),{'ready':!![],'skipped':![]};try{return await addEnv(_0x212cf0[_0x4f73c4(0x105)],{'url':_0x3a896f?.[_0x4f73c4(0x139)],'force':_0x3a896f?.['force'],'allowInsecureLocalhost':_0x3a896f?.[_0x4f73c4(0x112)],'scope':_0x3a896f?.['scope']},_0x5746a7),{'ready':!![],'skipped':![]};}catch(_0xa8864d){return console['error'](_0x212cf0['wwsxR'],_0x212cf0[_0x4f73c4(0x137)](_0xa8864d,Error)?_0xa8864d[_0x4f73c4(0x12a)]:_0xa8864d),{'ready':![],'skipped':![]};}}export async function start(_0x6d918a,_0x1582b8,_0x3f6be8){const _0x160e31=_0x4233d0,_0x32637d={'beUGl':'\x0a🚀\x20Ranger\x20Setup\x0a','yyYBH':function(_0x1f58f8,_0x485d2f){return _0x1f58f8!==_0x485d2f;},'CKCjU':function(_0x516ed3,_0x318841){return _0x516ed3!==_0x318841;},'YtDfY':function(_0x39e7c2,_0x3d39ff){return _0x39e7c2+_0x3d39ff;},'ZbDQY':_0x160e31(0xea),'fBYny':'✓\x20Skipping\x20authentication\x20(--skip-auth)','Wwswi':'auth','Pgnjj':_0x160e31(0xf2),'sLePp':function(_0x4c2d06,_0x591a2d){return _0x4c2d06(_0x591a2d);},'uKXox':_0x160e31(0xd9),'ZoPvj':'plugin','iANOK':function(_0x79ecea,_0x354a24){return _0x79ecea&&_0x354a24;},'XbQif':function(_0xb99f4,_0xab13e6,_0x514d7f){return _0xb99f4(_0xab13e6,_0x514d7f);},'qInAI':function(_0x5d3816){return _0x5d3816();},'QcApT':'opencode','RlcoH':_0x160e31(0x126),'mlPlZ':_0x160e31(0x128),'qaOHR':function(_0x3fe0d5,_0x5116d3){return _0x3fe0d5 instanceof _0x5116d3;},'VZhxp':function(_0x419087,_0x3a11e4){return _0x419087+_0x3a11e4;},'dQbHL':function(_0x55aa9f,_0x49055c){return _0x55aa9f+_0x49055c;},'HPaSI':function(_0x503f63,_0x32df1c){return _0x503f63+_0x32df1c;},'riRHV':function(_0x4eabf1,_0x3be45a){return _0x4eabf1+_0x3be45a;},'OYNzn':'ranger\x20profile\x20add\x20<name>','Gzaty':_0x160e31(0x114),'PmXpG':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','gBmMr':'/ranger:enable'};console['log'](_0x32637d[_0x160e31(0x10e)]);_0x32637d[_0x160e31(0x10d)](_0x1582b8?.['scope'],undefined)&&_0x32637d[_0x160e31(0x118)](_0x1582b8[_0x160e31(0x119)],'user')&&(console[_0x160e31(0x116)](_0x32637d['YtDfY'](_0x160e31(0x108)+String(_0x1582b8[_0x160e31(0x119)])+_0x160e31(0xe9)+_0x160e31(0x121),_0x160e31(0x124))),process['exit'](0x1));_0x1582b8={..._0x1582b8,'scope':_0x32637d[_0x160e31(0xeb)]};const _0x1cc3ef=!existsSync(getRangerHomeDir());await ensureRangerDir(_0x32637d['ZbDQY']);if(_0x1582b8?.[_0x160e31(0x10c)])console['log'](_0x32637d[_0x160e31(0x12d)]),_0x3f6be8?.[_0x160e31(0xdf)](_0x160e31(0xe6),{'isFirstRun':_0x1cc3ef,'method':_0x160e31(0x12f)});else{_0x3f6be8?.[_0x160e31(0x134)](_0x32637d[_0x160e31(0x103)]);const _0x50655e=await authenticate(_0x6d918a);_0x3f6be8?.[_0x160e31(0xdf)](_0x160e31(0xe6),{'isFirstRun':_0x1cc3ef,'method':_0x50655e['method']});}_0x3f6be8?.[_0x160e31(0x134)](_0x160e31(0x13a));_0x1582b8?.['skipChromium']?console['log'](_0x32637d[_0x160e31(0x110)]):await _0x32637d[_0x160e31(0xfb)](ensureChromium,_0x1582b8?.['withDeps']);_0x3f6be8?.[_0x160e31(0xdf)](_0x160e31(0x13a),{'isFirstRun':_0x1cc3ef,'skipped':!!_0x1582b8?.['skipChromium']}),console['log'](_0x32637d['uKXox']);const _0x57dded=_0x1582b8?.['scope'],_0x6c488f=_0x1582b8?.['opencode']??![];let _0x34cd1e=null;_0x6c488f?(_0x3f6be8?.[_0x160e31(0x134)]('plugin'),_0x34cd1e=await _0x32637d[_0x160e31(0xfb)](ensureOpencodePluginConfig,_0x57dded),_0x3f6be8?.['trackPhaseEnd'](_0x32637d[_0x160e31(0xdc)],{'isFirstRun':_0x1cc3ef,'opencode':!![]})):(_0x3f6be8?.[_0x160e31(0x134)](_0x32637d['ZoPvj']),await _0x32637d[_0x160e31(0xfb)](ensureClaudePlugin,_0x57dded),_0x3f6be8?.['trackPhaseEnd'](_0x32637d['ZoPvj'],{'isFirstRun':_0x1cc3ef}));if(_0x32637d['iANOK'](_0x6c488f,_0x34cd1e)){_0x3f6be8?.[_0x160e31(0x134)](_0x160e31(0x126));try{await _0x32637d['XbQif'](installSkill,_0x160e31(0xf9),{'level':_0x34cd1e[_0x160e31(0x119)],'cliVersion':_0x32637d['qInAI'](getCurrentVersion),'platform':_0x32637d['QcApT']}),_0x3f6be8?.[_0x160e31(0xdf)](_0x32637d['RlcoH'],{'isFirstRun':_0x1cc3ef,'opencode':!![]});}catch(_0x53bba1){console['warn'](_0x32637d[_0x160e31(0xe8)],_0x32637d[_0x160e31(0x11d)](_0x53bba1,Error)?_0x53bba1['message']:_0x53bba1),_0x3f6be8?.['trackPhaseEnd'](_0x32637d[_0x160e31(0x131)],{'isFirstRun':_0x1cc3ef,'opencode':!![],'failed':!![]});}}else _0x3f6be8?.[_0x160e31(0x134)](_0x32637d[_0x160e31(0x131)]),await _0x32637d['sLePp'](ensureClaudeSkills,_0x57dded),_0x3f6be8?.['trackPhaseEnd']('skills',{'isFirstRun':_0x1cc3ef});if(_0x1582b8?.[_0x160e31(0x10c)])console['log']('\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a');else{if(_0x1582b8?.[_0x160e31(0x139)]){_0x3f6be8?.[_0x160e31(0x134)](_0x160e31(0x113));const _0x13f168=await ensureLocalEnv({'url':_0x1582b8['url'],'force':_0x1582b8?.['force'],'allowInsecureLocalhost':_0x1582b8?.[_0x160e31(0x112)],'scope':'user'},_0x3f6be8);_0x3f6be8?.['trackPhaseEnd'](_0x160e31(0x113),{'isFirstRun':_0x1cc3ef,'profileReady':_0x13f168[_0x160e31(0x125)],'userSkipped':_0x13f168['skipped']});}else console['log'](_0x32637d['VZhxp'](_0x32637d['dQbHL'](_0x32637d['HPaSI'](_0x32637d['riRHV'](_0x160e31(0x129),'\x0a\x20\x20'+_0x32637d['sLePp'](bold,_0x32637d['OYNzn'])),_0x160e31(0xf4)),'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:'),_0x160e31(0x106)));}if(_0x6c488f)console['log'](_0x32637d['Gzaty']),console[_0x160e31(0x11b)](_0x32637d['PmXpG']),console['log']('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console['log'](_0x160e31(0xf1));else{const _0x3d8855=_0x32637d['sLePp'](bold,_0x32637d['gBmMr']);console['log'](_0x32637d[_0x160e31(0xe2)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x3d8855+'\x20and\x20prompt\x20the\x20coding'+_0x160e31(0xe4)+_0x160e31(0x117),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x342396=_0x5390;(function(_0x205183,_0x8a395e){const _0x36390d=_0x5390,_0x3c1759=_0x205183();while(!![]){try{const _0xe8927e=-parseInt(_0x36390d(0x13e))/0x1+-parseInt(_0x36390d(0xe5))/0x2*(parseInt(_0x36390d(0x14c))/0x3)+parseInt(_0x36390d(0x11e))/0x4*(-parseInt(_0x36390d(0x13c))/0x5)+parseInt(_0x36390d(0x135))/0x6+-parseInt(_0x36390d(0x134))/0x7*(-parseInt(_0x36390d(0x12c))/0x8)+parseInt(_0x36390d(0x11c))/0x9+parseInt(_0x36390d(0x13d))/0xa;if(_0xe8927e===_0x8a395e)break;else _0x3c1759['push'](_0x3c1759['shift']());}catch(_0x349958){_0x3c1759['push'](_0x3c1759['shift']());}}}(_0x55e3,0xd873e));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';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';function _0x55e3(){const _0x254a4d=['idVcJ','DEBUG','scope','\x0a---\x20Skills\x20---','@ranger-testing/opencode-plugin','cached\x20(updated\x20',':\x20configured','plugin','opencode','version','HtSFV','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','pipe','yWYDF','yzJbY','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','EwCyM','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','organizationName','hasPlaintextAuth','UDOHW','log','\x20(active)','none','vfdSw','(not\x20found)','Root:\x20','\x20\x20Active:\x20','maNPT','data','some','14159025zfNxhT','project','12qvUCom','wPnjI','ImDKU','\x20\x20Run:\x20ranger\x20setup\x20--opencode','includes','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','\x20\x20Run:\x20ranger\x20setup\x20[token]','disabled','\x20\x20Not\x20installed','enabled','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','nHzQn','name','not_installed','24kanYfK','\x20profiles\x20configured\x20(','TZxXa','status','length','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','\x1b[1m','MCfil','88291PCGauD','5552970awweEN','configured','unknown','\x0a---\x20Profiles\x20---','config','join','stderr','2892445lNcFQK','16100500IOVdmk','1217877iMKNuY','OJaUZ','isArray','parse','not_configured','\x20(up\x20to\x20date)','map','details','path','error','\x1b]8;;\x07','trim','MpLBL','\x20\x20Not\x20configured','75EBUPio','stdout','OEMRh','gDslk','nVzLk','\x20plugin(s)\x20configured','push','opencode-plugin','24534eCVHcr','cwd','\x0a\x20\x20No\x20active\x20profile\x20set','foPvt','\x0a---\x20Claude\x20Code\x20Plugin\x20---','API\x20Environment:\x20','user','dxipE','close','isDirectory',':\x20installed\x20(','CmUtT','\x20\x20\x20\x20Settings:\x20','MEJfE','xEeNE','\x1b[0m','filter','JiBae','fonlJ','settingsPath','Organization:\x20','utf-8','GLZda','\x20\x20\x20\x20Session:\x20'];_0x55e3=function(){return _0x254a4d;};return _0x55e3();}const bold=_0x28f31c=>_0x342396(0x132)+_0x28f31c+_0x342396(0xf4),link=(_0x24b133,_0x5116df)=>'\x1b]8;;file://'+_0x24b133+'\x07'+(_0x5116df||_0x24b133)+_0x342396(0x148);function _0x5390(_0x2a3d0d,_0x1f49cb){_0x2a3d0d=_0x2a3d0d-0xe3;const _0x55e369=_0x55e3();let _0x5390da=_0x55e369[_0x2a3d0d];return _0x5390da;}async function getOpencodePluginStatus(){const _0x1919b2=_0x342396,_0x95d451={'WwLXb':function(_0x5233ba,_0x3a75d5){return _0x5233ba!==_0x3a75d5;},'tDnnP':'not_installed','gVxfF':_0x1919b2(0x136),'eeeLV':'not_configured','fonlJ':function(_0x3d5a86,_0x48ebd7){return _0x3d5a86(_0x48ebd7);},'OlICv':'string','TZxXa':function(_0x47f404,_0x325d5f,_0x564430,_0xad8f5f){return _0x47f404(_0x325d5f,_0x564430,_0xad8f5f);},'udDZx':_0x1919b2(0x105),'VpaQd':'debug','ImDKU':'ignore','OJaUZ':_0x1919b2(0x147)};return new Promise(_0x4e304e=>{const _0x585f37=_0x1919b2,_0x160afa={'anBOo':_0x95d451['OlICv'],'aTGIY':_0x585f37(0xe4)},_0x445e3a=_0x95d451[_0x585f37(0x12e)](spawn,_0x95d451['udDZx'],[_0x95d451['VpaQd'],_0x585f37(0x139)],{'stdio':[_0x95d451[_0x585f37(0x120)],'pipe',_0x585f37(0x109)]});let _0x48708c='';_0x445e3a[_0x585f37(0x14d)]?.['on'](_0x585f37(0x11a),_0x5e83f6=>{_0x48708c+=_0x5e83f6['toString']();}),_0x445e3a[_0x585f37(0x13b)]?.['on'](_0x585f37(0x11a),_0x111820=>{_0x48708c+=_0x111820['toString']();}),_0x445e3a['on'](_0x95d451[_0x585f37(0x13f)],()=>{const _0x992795=_0x585f37;_0x4e304e({'status':_0x992795(0x12b)});}),_0x445e3a['on'](_0x585f37(0xed),_0x170c39=>{const _0x930511=_0x585f37;if(_0x95d451['WwLXb'](_0x170c39,0x0)){_0x4e304e({'status':_0x95d451['tDnnP']});return;}const _0x172e9d=_0x48708c['trim']();let _0x37c4e2=null;if(_0x172e9d)try{_0x37c4e2=JSON[_0x930511(0x141)](_0x172e9d);}catch{const _0x28e71c=_0x172e9d['match'](/\{[\s\S]*\}$/);if(_0x28e71c)try{_0x37c4e2=JSON[_0x930511(0x141)](_0x28e71c[0x0]);}catch{_0x37c4e2=null;}}const _0x2d53fc=Array[_0x930511(0x140)](_0x37c4e2?.['plugin'])?_0x37c4e2?.[_0x930511(0x104)]:[],_0xa3761b=_0x2d53fc[_0x930511(0x11b)](_0x33b6b2=>{const _0x32d3ab=_0x930511;if(typeof _0x33b6b2!==_0x160afa['anBOo'])return![];return _0x33b6b2[_0x32d3ab(0x122)]('@ranger-testing/opencode-plugin')||_0x33b6b2['includes'](_0x160afa['aTGIY']);});if(_0xa3761b){_0x4e304e({'status':_0x95d451['gVxfF'],'details':_0x2d53fc['length']>0x0?_0x2d53fc[_0x930511(0x130)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x2d53fc[_0x930511(0x130)]>0x0){_0x4e304e({'status':_0x95d451['eeeLV'],'details':_0x2d53fc['length']+_0x930511(0x151)});return;}_0x95d451[_0x930511(0xf7)](_0x4e304e,{'status':_0x930511(0x142)});});});}async function getSkillsFromDir(_0x7a22a1,_0x4f1ed0){const _0x4d0e7f=_0x342396,_0x5e1552={'xEeNE':function(_0x3a5159,_0x280a39){return _0x3a5159(_0x280a39);},'dxipE':function(_0x2778cd,_0x26650e,_0x4221ab){return _0x2778cd(_0x26650e,_0x4221ab);}};if(!_0x5e1552[_0x4d0e7f(0xf3)](existsSync,_0x7a22a1))return[];const _0x1a6e29=[];try{const _0x39f295=await readdir(_0x7a22a1,{'withFileTypes':!![]});for(const _0x153f20 of _0x39f295){if(_0x153f20[_0x4d0e7f(0xee)]()){const _0x3337bc=join(_0x7a22a1,_0x153f20[_0x4d0e7f(0x12a)],'SKILL.md');if(existsSync(_0x3337bc)){let _0x2b9957=_0x153f20[_0x4d0e7f(0x12a)];try{const _0x3e7364=await _0x5e1552[_0x4d0e7f(0xec)](readFile,_0x3337bc,_0x4d0e7f(0xfa)),_0x140617=_0x3e7364['match'](/name:\s*(.+)/);_0x140617&&(_0x2b9957=_0x140617[0x1][_0x4d0e7f(0x149)]());}catch{}_0x1a6e29['push']({'name':_0x153f20['name'],'displayName':_0x2b9957,'path':_0x3337bc,'level':_0x4f1ed0});}}}}catch{return[];}return _0x1a6e29;}async function getInstalledSkills(){const _0x2457df=_0x342396,_0xe02ae={'BLwCJ':function(_0x2b9622,_0x545fcc,_0x479d14){return _0x2b9622(_0x545fcc,_0x479d14);},'uQdRe':function(_0x3f1fac){return _0x3f1fac();},'wPnjI':function(_0x1c2ca3){return _0x1c2ca3();}},[_0x4c1df8,_0x4a0dbf]=await Promise['all']([_0xe02ae['BLwCJ'](getSkillsFromDir,_0xe02ae['uQdRe'](getProjectSkillsDir),_0x2457df(0x11d)),getSkillsFromDir(_0xe02ae[_0x2457df(0x11f)](getUserSkillsDir),'user')]);return{'project':_0x4c1df8,'user':_0x4a0dbf};}async function getEnvironments(){const _0x596877=_0x342396,_0x1e7561={'CmUtT':function(_0x264b83,_0x3749b2,_0x247ef5){return _0x264b83(_0x3749b2,_0x247ef5);},'SXJwq':'settings.json','uIqtz':'auth.json','MEJfE':function(_0x1f1818,_0x2eb8ae){return _0x1f1818(_0x2eb8ae);},'yzJbY':function(_0x5c83a7,_0x3b4f9d){return _0x5c83a7(_0x3b4f9d);},'maNPT':function(_0x191cc7,_0x153bb3){return _0x191cc7(_0x153bb3);},'OhBac':function(_0x1c9a02,_0x414998){return _0x1c9a02===_0x414998;},'CZQax':function(_0xa1a690){return _0xa1a690();},'foPvt':function(_0x5d3bea,_0x3703d0){return _0x5d3bea(_0x3703d0);}},{envNames:_0x26dcf0,activeEnv:_0x585fc6}=await getEnvNames(),_0x1c1491=_0x1e7561['CZQax'](getRangerDir);if(!_0x1e7561[_0x596877(0xe8)](existsSync,_0x1c1491))return{'envs':[],'activeEnv':null};const _0x4cfdf7=_0x26dcf0[_0x596877(0x144)](_0x394b23=>{const _0x3a62ee=_0x596877,_0x54b4fe=getEnvDir(_0x394b23),_0x19c9b2=_0x1e7561[_0x3a62ee(0xf0)](join,_0x54b4fe,_0x1e7561['SXJwq']),_0x50b547=_0x1e7561[_0x3a62ee(0xf0)](join,_0x54b4fe,_0x1e7561['uIqtz']),_0x1dabb6=_0x1e7561['CmUtT'](join,_0x54b4fe,'auth.json.enc');return{'name':_0x394b23,'settingsPath':_0x1e7561[_0x3a62ee(0xf2)](existsSync,_0x19c9b2)?_0x19c9b2:_0x3a62ee(0x116),'hasPlaintextAuth':_0x1e7561[_0x3a62ee(0x10b)](existsSync,_0x50b547),'hasEncryptedAuth':_0x1e7561[_0x3a62ee(0x119)](existsSync,_0x1dabb6),'isActive':_0x1e7561['OhBac'](_0x394b23,_0x585fc6)};});return{'envs':_0x4cfdf7,'activeEnv':_0x585fc6};}export async function status(){const _0x53040d=_0x342396,_0x42894b={'nVzLk':'\x0a📊\x20Ranger\x20Status\x0a','GLZda':function(_0x1892f8,_0x50a9ab){return _0x1892f8(_0x50a9ab);},'KgSGd':function(_0x4323c7,_0x24b159,_0x3b078d){return _0x4323c7(_0x24b159,_0x3b078d);},'gDslk':function(_0x4d8fb7){return _0x4d8fb7();},'BnHfz':function(_0x56b428){return _0x56b428();},'OEMRh':_0x53040d(0x142),'eYcTn':_0x53040d(0x14b),'MCfil':_0x53040d(0x121),'yWYDF':function(_0x2f71b6,_0x2693bc){return _0x2f71b6(_0x2693bc);},'CVMRu':_0x53040d(0x137),'isSOj':'enabled','AAGgP':'ranger@trailhead','JiBae':_0x53040d(0x126),'vfdSw':_0x53040d(0x100),'MpLBL':function(_0x189e80){return _0x189e80();},'sRUHO':'No\x20skills\x20installed','nFPzv':function(_0xa02547,_0xcf77a6){return _0xa02547>_0xcf77a6;},'yjATp':'\x20\x20Project-level:','khaHO':function(_0x203955,_0x71cb26){return _0x203955(_0x71cb26);},'UkyVv':function(_0x44fdac,_0x13cd93){return _0x44fdac>_0x13cd93;},'HtSFV':'\x20\x20User-level:','EwCyM':_0x53040d(0x138),'DEbxM':function(_0x1fcb2a,_0x438b5b){return _0x1fcb2a(_0x438b5b);},'UDOHW':'plaintext','nHzQn':_0x53040d(0x114),'idVcJ':function(_0x88ab2c,_0x2427f8){return _0x88ab2c!==_0x2427f8;}};console[_0x53040d(0x112)](_0x42894b[_0x53040d(0x150)]);const _0x25e024=process[_0x53040d(0xe6)](),_0x395f3d=getRangerDir();if(!_0x42894b['GLZda'](existsSync,_0x395f3d)){console['log'](_0x53040d(0x117)+_0x42894b['KgSGd'](link,_0x25e024,bold(_0x42894b[_0x53040d(0xfb)](basename,_0x25e024)))),console['log'](_0x53040d(0x131)),console[_0x53040d(0x112)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log']('Root:\x20'+link(_0x25e024,bold(_0x42894b['GLZda'](basename,_0x25e024))));const _0x2531ca=_0x42894b['gDslk'](getCurrentVersion),_0xc2b255=getLatestVersion();if(_0xc2b255['version']&&_0xc2b255[_0x53040d(0x106)]!==_0x2531ca)console[_0x53040d(0x112)]('Version:\x20'+_0x2531ca+'\x20(latest:\x20'+_0xc2b255['version']+')'),console[_0x53040d(0x112)]('\x20\x20Run:\x20ranger\x20update');else _0xc2b255['version']?console[_0x53040d(0x112)]('Version:\x20'+_0x2531ca+_0x53040d(0x143)):console[_0x53040d(0x112)]('Version:\x20'+_0x2531ca);const _0x210959=await getToken();if(_0x210959){const _0xbfd25d=await _0x42894b[_0x53040d(0xfb)](getCurrentUser,_0x210959);_0xbfd25d['success']?console[_0x53040d(0x112)](_0x53040d(0xf9)+bold(_0xbfd25d[_0x53040d(0xeb)][_0x53040d(0x10f)])):(console['log'](_0x53040d(0x10c)),console[_0x53040d(0x112)]('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console['log']('API\x20Token:\x20✗\x20Not\x20found'),console['log'](_0x53040d(0x124));process['env'][_0x53040d(0xfe)]&&(console[_0x53040d(0x112)](_0x53040d(0xea)+_0x42894b['BnHfz'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+_0x42894b[_0x53040d(0x14f)](getApiBaseUrl)));console['log']('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x300913=await getOpencodePluginStatus();if(_0x300913[_0x53040d(0x12f)]===_0x53040d(0x136))console[_0x53040d(0x112)]('\x20\x20'+_0x42894b['GLZda'](bold,_0x53040d(0x101))+_0x53040d(0x103)),_0x300913[_0x53040d(0x145)]&&console[_0x53040d(0x112)]('\x20\x20'+_0x300913['details']);else _0x300913[_0x53040d(0x12f)]===_0x42894b[_0x53040d(0x14e)]?(console['log'](_0x42894b['eYcTn']),_0x300913[_0x53040d(0x145)]&&console['log']('\x20\x20'+_0x300913[_0x53040d(0x145)]),console['log'](_0x42894b[_0x53040d(0x133)])):console[_0x53040d(0x112)](_0x53040d(0x128));console[_0x53040d(0x112)](_0x53040d(0xe9));const _0x4d03c3=await _0x42894b['yWYDF'](getPluginInfo,'ranger@trailhead');if(_0x4d03c3){const _0x41eda4=_0x4d03c3[_0x53040d(0xff)]||_0x42894b['CVMRu'],_0xf6580c=_0x4d03c3[_0x53040d(0x127)]?_0x42894b['isSOj']:_0x53040d(0x125);console[_0x53040d(0x112)]('\x20\x20'+bold(_0x42894b['AAGgP'])+_0x53040d(0xef)+_0x41eda4+',\x20'+_0xf6580c+')');}else console['log'](_0x42894b[_0x53040d(0xf6)]),console['log'](_0x53040d(0x10e));console[_0x53040d(0x112)](_0x42894b[_0x53040d(0x115)]);const {project:_0x1976a4,user:_0x18023c}=await _0x42894b[_0x53040d(0x14a)](getInstalledSkills),_0x1b77af=_0x1976a4['filter'](_0x220133=>RANGER_MANAGED_SKILLS[_0x53040d(0x122)](_0x220133['name'])),_0x1ee62c=_0x18023c[_0x53040d(0xf5)](_0x53113b=>RANGER_MANAGED_SKILLS[_0x53040d(0x122)](_0x53113b[_0x53040d(0x12a)])),_0x2ce989=_0x1b77af[_0x53040d(0x130)]+_0x1ee62c['length'];if(_0x2ce989===0x0)console[_0x53040d(0x112)](_0x42894b['sRUHO']),console['log']('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x42894b['nFPzv'](_0x1b77af[_0x53040d(0x130)],0x0)){console['log'](_0x42894b['yjATp']);for(const _0x3b6bf4 of _0x1b77af){console['log']('\x20\x20\x20\x20'+bold(_0x3b6bf4['displayName'])+':\x20'+link(_0x3b6bf4[_0x53040d(0x146)],_0x42894b['khaHO'](basename,_0x3b6bf4[_0x53040d(0x146)])));}}if(_0x42894b['UkyVv'](_0x1ee62c['length'],0x0)){console['log'](_0x42894b[_0x53040d(0x107)]);for(const _0x13622e of _0x1ee62c){console[_0x53040d(0x112)]('\x20\x20\x20\x20'+bold(_0x13622e['displayName'])+':\x20'+link(_0x13622e[_0x53040d(0x146)],_0x42894b['GLZda'](basename,_0x13622e[_0x53040d(0x146)])));}}}console[_0x53040d(0x112)](_0x42894b[_0x53040d(0x10d)]);const {envs:_0x1fcd37,activeEnv:_0x561164}=await _0x42894b['BnHfz'](getEnvironments);let _0x56e79a=[];if(_0x210959)try{_0x56e79a=await listCloudProfiles();}catch{}const _0x537842=_0x1fcd37['length']+_0x56e79a['length'];if(_0x537842===0x0)console['log']('No\x20profiles\x20configured'),console[_0x53040d(0x112)](_0x53040d(0x108));else{if(_0x42894b['nFPzv'](_0x537842,0x5)){const _0x57836b=[];_0x56e79a['length']>0x0&&_0x57836b['push'](_0x56e79a['length']+'\x20cloud'),_0x1fcd37['length']>0x0&&_0x57836b[_0x53040d(0xe3)](_0x1fcd37[_0x53040d(0x130)]+'\x20local'),console[_0x53040d(0x112)](_0x537842+_0x53040d(0x12d)+_0x57836b['join'](',\x20')+')'),_0x561164&&console['log'](_0x53040d(0x118)+_0x42894b['DEbxM'](bold,_0x561164)),console[_0x53040d(0x112)]('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x8ce0e8 of _0x56e79a){const _0x1e38e3=_0x8ce0e8['name']===_0x561164?_0x53040d(0x113):'';console[_0x53040d(0x112)]('\x20\x20'+_0x42894b[_0x53040d(0x10a)](bold,_0x8ce0e8[_0x53040d(0x12a)])+'\x20[cloud]'+_0x1e38e3);const _0x547650=_0x8ce0e8['sessionUpdatedAt']?_0x53040d(0x102)+_0x8ce0e8['sessionUpdatedAt']+')':'no\x20session';console['log'](_0x53040d(0xfc)+_0x547650);}const _0x4c6274=new Set(_0x56e79a['map'](_0x3a8705=>_0x3a8705['name']));for(const _0x4c544d of _0x1fcd37){if(_0x4c6274['has'](_0x4c544d['name']))continue;const _0x5b561d=_0x4c544d['isActive']?'\x20(active)':'',_0x150cd4=_0x4c544d['hasEncryptedAuth']?'encrypted':_0x4c544d[_0x53040d(0x110)]?_0x42894b[_0x53040d(0x111)]:_0x42894b[_0x53040d(0x129)];console['log']('\x20\x20'+_0x42894b['DEbxM'](bold,_0x4c544d['name'])+'\x20[local]'+_0x5b561d),console[_0x53040d(0x112)]('\x20\x20\x20\x20Auth:\x20'+_0x150cd4),_0x42894b[_0x53040d(0xfd)](_0x4c544d[_0x53040d(0xf8)],'(not\x20found)')&&console['log'](_0x53040d(0xf1)+_0x42894b['KgSGd'](link,_0x4c544d[_0x53040d(0xf8)],basename(_0x4c544d['settingsPath'])));}if(!_0x561164){console['log'](_0x53040d(0xe7));const _0x20f896=[..._0x56e79a[_0x53040d(0x144)](_0x398140=>_0x398140['name']),..._0x1fcd37['filter'](_0x593177=>!_0x4c6274['has'](_0x593177[_0x53040d(0x12a)]))['map'](_0x315d17=>_0x315d17['name'])];console[_0x53040d(0x112)](_0x53040d(0x123)+_0x20f896[_0x53040d(0x13a)](',\x20')+')');}}}console['log']('');}
|
|
1
|
+
const _0x21aeca=_0x3a2f;(function(_0x49b994,_0x472c5f){const _0x1c07c0=_0x3a2f,_0x558d33=_0x49b994();while(!![]){try{const _0x311042=parseInt(_0x1c07c0(0xf4))/0x1+-parseInt(_0x1c07c0(0x10a))/0x2+-parseInt(_0x1c07c0(0xad))/0x3+parseInt(_0x1c07c0(0xbe))/0x4*(parseInt(_0x1c07c0(0xc0))/0x5)+-parseInt(_0x1c07c0(0xbd))/0x6+parseInt(_0x1c07c0(0xfd))/0x7+parseInt(_0x1c07c0(0xd7))/0x8*(parseInt(_0x1c07c0(0xd6))/0x9);if(_0x311042===_0x472c5f)break;else _0x558d33['push'](_0x558d33['shift']());}catch(_0x326c31){_0x558d33['push'](_0x558d33['shift']());}}}(_0x1a17,0x26983));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';function _0x3a2f(_0x44dfbc,_0x43d437){_0x44dfbc=_0x44dfbc-0x9e;const _0x1a1728=_0x1a17();let _0x3a2fb3=_0x1a1728[_0x44dfbc];return _0x3a2fb3;}function _0x1a17(){const _0x36b762=['vJCAk','data','DEBUG','No\x20profiles\x20configured','has','disabled','HrYTQ','EtCfS','map','Olijs','LTQVQ','env','log','\x20plugin(s)\x20configured','QldLM','unknown','492882ztuZHg','VROxk','Version:\x20','oslgw','gflmv','\x1b[0m','join','BdJJn','isActive','gUKOZ','\x20\x20Project-level:','ignore','XtlJf','plugin','length','API\x20Token:\x20✗\x20Not\x20found','1804542tUUwak','12cJCqLC','KcYZm','474025zWGGuV','path','\x20\x20User-level:','Hpqyr','djPAk','jlXcQ','pipe','\x20\x20\x20\x20Session:\x20','@ranger-testing/opencode-plugin','WVIPz','isArray','hasEncryptedAuth','cwd','\x20profiles\x20configured\x20(','rgCeu','SKILL.md','mTBaW','version','eyfRV','\x20(active)',':\x20configured','\x20\x20Run:\x20ranger\x20setup\x20--opencode','889308hhrfxH','8MEifCK','\x20\x20Run:\x20ranger\x20skillup','NdBKr','settingsPath','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','hUWbg','\x20\x20\x20\x20','pvxKp','JfjBG','msstg','not_configured','AQzhJ','status','trim','\x20\x20Run:\x20ranger\x20setup\x20[token]','debug','encrypted','Root:\x20','cpWzg','Udxca','dxRmO','NvbAu','UUnJe','\x0a---\x20Claude\x20Code\x20Plugin\x20---','(not\x20found)','settings.json','details','\x20(up\x20to\x20date)','\x1b[1m','261064DXwRBj','stderr','name','kQpCk','ranger@trailhead','filter','AhMdp','match','IQPbg','1849540aiLsNs','string','\x0a📊\x20Ranger\x20Status\x0a','EdAIJ','includes','pXeAH','user','\x1b]8;;file://','cached\x20(updated\x20','push',':\x20installed\x20(','\x0a---\x20Skills\x20---','plaintext','570754pIpIyd','RCdnY'];_0x1a17=function(){return _0x36b762;};return _0x1a17();}import{getCurrentVersion,getLatestVersion}from'./utils/version.js';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=_0x483bce=>_0x21aeca(0xf3)+_0x483bce+_0x21aeca(0xb2),link=(_0x450212,_0x540109)=>_0x21aeca(0x104)+_0x450212+'\x07'+(_0x540109||_0x450212)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x108dc6=_0x21aeca,_0x306bf1={'Hpqyr':'not_installed','WVIPz':function(_0x19e23f,_0x3d390f){return _0x19e23f(_0x3d390f);},'EdAIJ':'not_configured','Olijs':function(_0x409318,_0x2b8c09,_0x46de3d,_0x5620ab){return _0x409318(_0x2b8c09,_0x46de3d,_0x5620ab);},'XAuEv':'config','kQpCk':_0x108dc6(0xb8),'AQzhJ':_0x108dc6(0xc6),'XtlJf':'data','GBCqP':'error'};return new Promise(_0x4e17fa=>{const _0x2d2c2c=_0x108dc6,_0x2a28b3={'jlXcQ':_0x2d2c2c(0xfe),'bPGBa':_0x2d2c2c(0xc8),'rZwBA':'opencode-plugin','LTQVQ':_0x306bf1[_0x2d2c2c(0xc3)],'oqHSm':'configured','KcYZm':function(_0x4bf9d4,_0x250c3a){const _0x25b480=_0x2d2c2c;return _0x306bf1[_0x25b480(0xc9)](_0x4bf9d4,_0x250c3a);},'jADsr':function(_0x1090aa,_0x52b110){const _0x1e55f5=_0x2d2c2c;return _0x306bf1[_0x1e55f5(0xc9)](_0x1090aa,_0x52b110);},'xIowG':_0x306bf1[_0x2d2c2c(0x100)]},_0x186098=_0x306bf1[_0x2d2c2c(0xa6)](spawn,'opencode',[_0x2d2c2c(0xe6),_0x306bf1['XAuEv']],{'stdio':[_0x306bf1[_0x2d2c2c(0xf7)],_0x2d2c2c(0xc6),_0x306bf1[_0x2d2c2c(0xe2)]]});let _0xb1b48e='';_0x186098['stdout']?.['on'](_0x2d2c2c(0x9e),_0x21afbf=>{_0xb1b48e+=_0x21afbf['toString']();}),_0x186098[_0x2d2c2c(0xf5)]?.['on'](_0x306bf1[_0x2d2c2c(0xb9)],_0x261f6c=>{_0xb1b48e+=_0x261f6c['toString']();}),_0x186098['on'](_0x306bf1['GBCqP'],()=>{_0x4e17fa({'status':'not_installed'});}),_0x186098['on']('close',_0x4affa5=>{const _0x353a79=_0x2d2c2c;if(_0x4affa5!==0x0){_0x4e17fa({'status':_0x2a28b3[_0x353a79(0xa7)]});return;}const _0x142ba1=_0xb1b48e['trim']();let _0x49a9fc=null;if(_0x142ba1)try{_0x49a9fc=JSON['parse'](_0x142ba1);}catch{const _0x238de8=_0x142ba1['match'](/\{[\s\S]*\}$/);if(_0x238de8)try{_0x49a9fc=JSON['parse'](_0x238de8[0x0]);}catch{_0x49a9fc=null;}}const _0x5eabe2=Array[_0x353a79(0xca)](_0x49a9fc?.[_0x353a79(0xba)])?_0x49a9fc?.[_0x353a79(0xba)]:[],_0x1d2abb=_0x5eabe2['some'](_0xf4ad44=>{const _0x3b88e7=_0x353a79;if(typeof _0xf4ad44!==_0x2a28b3[_0x3b88e7(0xc5)])return![];return _0xf4ad44[_0x3b88e7(0x101)](_0x2a28b3['bPGBa'])||_0xf4ad44[_0x3b88e7(0x101)](_0x2a28b3['rZwBA']);});if(_0x1d2abb){_0x4e17fa({'status':_0x2a28b3['oqHSm'],'details':_0x5eabe2['length']>0x0?_0x5eabe2[_0x353a79(0xbb)]+_0x353a79(0xaa):undefined});return;}if(_0x5eabe2[_0x353a79(0xbb)]>0x0){_0x2a28b3[_0x353a79(0xbf)](_0x4e17fa,{'status':_0x353a79(0xe1),'details':_0x5eabe2[_0x353a79(0xbb)]+'\x20plugin(s)\x20configured'});return;}_0x2a28b3['jADsr'](_0x4e17fa,{'status':_0x2a28b3['xIowG']});});});}async function getSkillsFromDir(_0x32f668,_0x3d1450){const _0x2cb4e8=_0x21aeca,_0x5d018d={'zcFAQ':function(_0x4714be,_0xe40a13){return _0x4714be(_0xe40a13);},'MKrFQ':function(_0x1e189c,_0x4b38cd,_0x1f61c8){return _0x1e189c(_0x4b38cd,_0x1f61c8);},'NdBKr':_0x2cb4e8(0xcf)};if(!_0x5d018d['zcFAQ'](existsSync,_0x32f668))return[];const _0x3cd01c=[];try{const _0x274a20=await _0x5d018d['MKrFQ'](readdir,_0x32f668,{'withFileTypes':!![]});for(const _0x4628d8 of _0x274a20){if(_0x4628d8['isDirectory']()){const _0x57b374=join(_0x32f668,_0x4628d8['name'],_0x5d018d[_0x2cb4e8(0xd9)]);if(_0x5d018d['zcFAQ'](existsSync,_0x57b374)){let _0x380700=_0x4628d8[_0x2cb4e8(0xf6)];try{const _0x438022=await readFile(_0x57b374,'utf-8'),_0x26360d=_0x438022[_0x2cb4e8(0xfb)](/name:\s*(.+)/);_0x26360d&&(_0x380700=_0x26360d[0x1][_0x2cb4e8(0xe4)]());}catch{}_0x3cd01c[_0x2cb4e8(0x106)]({'name':_0x4628d8[_0x2cb4e8(0xf6)],'displayName':_0x380700,'path':_0x57b374,'level':_0x3d1450});}}}}catch{return[];}return _0x3cd01c;}async function getInstalledSkills(){const _0x24d2b3=_0x21aeca,_0x47c0df={'NvbAu':function(_0x4381a0,_0x4412bd,_0x99e8a7){return _0x4381a0(_0x4412bd,_0x99e8a7);},'EPwud':'project','GFsRA':'user'},[_0x28c706,_0x5bd3ec]=await Promise['all']([_0x47c0df[_0x24d2b3(0xec)](getSkillsFromDir,getProjectSkillsDir(),_0x47c0df['EPwud']),getSkillsFromDir(getUserSkillsDir(),_0x47c0df['GFsRA'])]);return{'project':_0x28c706,'user':_0x5bd3ec};}async function getEnvironments(){const _0x7a637=_0x21aeca,_0x167ec1={'eyfRV':function(_0x6eec99,_0x2eb9f1){return _0x6eec99(_0x2eb9f1);},'BdJJn':function(_0xe35ec5,_0x2ac4f9,_0x2a9102){return _0xe35ec5(_0x2ac4f9,_0x2a9102);},'mTBaW':function(_0x5d1202,_0x41183e,_0x4b772a){return _0x5d1202(_0x41183e,_0x4b772a);},'pvxKp':function(_0x1cc222,_0x150c4a,_0x274d76){return _0x1cc222(_0x150c4a,_0x274d76);},'hUWbg':_0x7a637(0xef),'vJCAk':function(_0x555a19,_0x1b8ec6){return _0x555a19===_0x1b8ec6;},'bevOm':function(_0x148099){return _0x148099();}},{envNames:_0x52cba0,activeEnv:_0x12b8de}=await getEnvNames(),_0x1178cd=_0x167ec1['bevOm'](getRangerDir);if(!existsSync(_0x1178cd))return{'envs':[],'activeEnv':null};const _0x1d35f7=_0x52cba0['map'](_0x5e0495=>{const _0x1f1ad9=_0x7a637,_0x317f7d=_0x167ec1[_0x1f1ad9(0xd2)](getEnvDir,_0x5e0495),_0x2a7480=_0x167ec1[_0x1f1ad9(0xb4)](join,_0x317f7d,_0x1f1ad9(0xf0)),_0x4371d9=_0x167ec1[_0x1f1ad9(0xd0)](join,_0x317f7d,'auth.json'),_0x5a22a6=_0x167ec1[_0x1f1ad9(0xde)](join,_0x317f7d,'auth.json.enc');return{'name':_0x5e0495,'settingsPath':_0x167ec1['eyfRV'](existsSync,_0x2a7480)?_0x2a7480:_0x167ec1[_0x1f1ad9(0xdc)],'hasPlaintextAuth':existsSync(_0x4371d9),'hasEncryptedAuth':existsSync(_0x5a22a6),'isActive':_0x167ec1[_0x1f1ad9(0x10c)](_0x5e0495,_0x12b8de)};});return{'envs':_0x1d35f7,'activeEnv':_0x12b8de};}export async function status(){const _0x3bc402=_0x21aeca,_0xb2b07e={'djPAk':_0x3bc402(0xff),'nSnRS':function(_0x275818){return _0x275818();},'HrYTQ':function(_0x9c4b39,_0x889c84,_0x4fe147){return _0x9c4b39(_0x889c84,_0x4fe147);},'dxRmO':function(_0x23ace4,_0x55c0f5){return _0x23ace4(_0x55c0f5);},'gflmv':function(_0x356081,_0x4a10c2){return _0x356081!==_0x4a10c2;},'wOFsx':function(_0x274a72){return _0x274a72();},'Udxca':function(_0x378e82,_0x1054e9){return _0x378e82(_0x1054e9);},'UUnJe':function(_0x2899f7,_0x14e651){return _0x2899f7===_0x14e651;},'KZOwF':'configured','JfjBG':'@ranger-testing/opencode-plugin','oslgw':'\x20\x20Not\x20configured','rTUPc':_0x3bc402(0xd5),'cpWzg':_0x3bc402(0xf8),'fjHbi':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','pGmeh':_0x3bc402(0x108),'MiZJS':function(_0x40bec9,_0x23b833){return _0x40bec9+_0x23b833;},'cyEng':function(_0x1d99c0,_0x2497fd){return _0x1d99c0===_0x2497fd;},'PkAjw':'No\x20skills\x20installed','AhMdp':function(_0x9af5f1,_0x8dc499){return _0x9af5f1>_0x8dc499;},'lbZdr':_0x3bc402(0xc2),'VROxk':function(_0x4ac9a5,_0x36d648,_0x2fcca4){return _0x4ac9a5(_0x36d648,_0x2fcca4);},'msstg':function(_0x5a3c3a){return _0x5a3c3a();},'RCdnY':function(_0x280ab2,_0x35c28b){return _0x280ab2+_0x35c28b;},'QlQUa':_0x3bc402(0xa0),'IQPbg':function(_0x41d62e,_0x3da0d0){return _0x41d62e>_0x3da0d0;},'EtCfS':function(_0x5bd284,_0x5bef9e){return _0x5bd284===_0x5bef9e;},'pXeAH':'no\x20session','QldLM':_0x3bc402(0xe7),'rgCeu':'none','gUKOZ':function(_0xb9967c,_0x32663c){return _0xb9967c!==_0x32663c;}};console['log'](_0xb2b07e[_0x3bc402(0xc4)]);const _0x2ceae0=process[_0x3bc402(0xcc)](),_0x577019=_0xb2b07e['nSnRS'](getRangerDir);if(!existsSync(_0x577019)){console['log']('Root:\x20'+_0xb2b07e[_0x3bc402(0xa3)](link,_0x2ceae0,_0xb2b07e[_0x3bc402(0xeb)](bold,basename(_0x2ceae0)))),console['log'](_0x3bc402(0xdb)),console[_0x3bc402(0xa9)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x3bc402(0xe8)+link(_0x2ceae0,bold(basename(_0x2ceae0))));const _0x129972=getCurrentVersion(),_0x1e220f=getLatestVersion();if(_0x1e220f[_0x3bc402(0xd1)]&&_0xb2b07e[_0x3bc402(0xb1)](_0x1e220f[_0x3bc402(0xd1)],_0x129972))console['log']('Version:\x20'+_0x129972+'\x20(latest:\x20'+_0x1e220f[_0x3bc402(0xd1)]+')'),console[_0x3bc402(0xa9)]('\x20\x20Run:\x20ranger\x20update');else _0x1e220f[_0x3bc402(0xd1)]?console['log']('Version:\x20'+_0x129972+_0x3bc402(0xf2)):console[_0x3bc402(0xa9)](_0x3bc402(0xaf)+_0x129972);const _0x56a3da=await _0xb2b07e['wOFsx'](getToken);if(_0x56a3da){const _0x2cd883=await _0xb2b07e['Udxca'](getCurrentUser,_0x56a3da);_0x2cd883['success']?console[_0x3bc402(0xa9)]('Organization:\x20'+_0xb2b07e[_0x3bc402(0xea)](bold,_0x2cd883[_0x3bc402(0x103)]['organizationName'])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console[_0x3bc402(0xa9)]('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console['log'](_0x3bc402(0xbc)),console[_0x3bc402(0xa9)](_0x3bc402(0xe5));process[_0x3bc402(0xa8)][_0x3bc402(0x9f)]&&(console['log']('API\x20Environment:\x20'+_0xb2b07e['nSnRS'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+_0xb2b07e['wOFsx'](getApiBaseUrl)));console[_0x3bc402(0xa9)]('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x36c0c4=await getOpencodePluginStatus();if(_0xb2b07e[_0x3bc402(0xed)](_0x36c0c4[_0x3bc402(0xe3)],_0xb2b07e['KZOwF']))console['log']('\x20\x20'+_0xb2b07e[_0x3bc402(0xea)](bold,_0xb2b07e[_0x3bc402(0xdf)])+_0x3bc402(0xd4)),_0x36c0c4['details']&&console['log']('\x20\x20'+_0x36c0c4[_0x3bc402(0xf1)]);else _0x36c0c4[_0x3bc402(0xe3)]===_0x3bc402(0xe1)?(console[_0x3bc402(0xa9)](_0xb2b07e[_0x3bc402(0xb0)]),_0x36c0c4['details']&&console['log']('\x20\x20'+_0x36c0c4[_0x3bc402(0xf1)]),console[_0x3bc402(0xa9)](_0xb2b07e['rTUPc'])):console['log']('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console[_0x3bc402(0xa9)](_0x3bc402(0xee));const _0x201f70=await getPluginInfo(_0xb2b07e[_0x3bc402(0xe9)]);if(_0x201f70){const _0x2a23b6=_0x201f70['scope']||_0x3bc402(0xac),_0x346e81=_0x201f70['enabled']?'enabled':_0x3bc402(0xa2);console['log']('\x20\x20'+bold('ranger@trailhead')+_0x3bc402(0x107)+_0x2a23b6+',\x20'+_0x346e81+')');}else console[_0x3bc402(0xa9)]('\x20\x20Not\x20installed'),console[_0x3bc402(0xa9)](_0xb2b07e['fjHbi']);console[_0x3bc402(0xa9)](_0xb2b07e['pGmeh']);const {project:_0x11c5b6,user:_0x12377b}=await getInstalledSkills(),_0x3d0891=_0x11c5b6['filter'](_0x5b6ccc=>RANGER_MANAGED_SKILLS[_0x3bc402(0x101)](_0x5b6ccc[_0x3bc402(0xf6)])),_0x17ff63=_0x12377b[_0x3bc402(0xf9)](_0x488590=>RANGER_MANAGED_SKILLS['includes'](_0x488590[_0x3bc402(0xf6)])),_0x41d8fc=_0xb2b07e['MiZJS'](_0x3d0891[_0x3bc402(0xbb)],_0x17ff63['length']);if(_0xb2b07e['cyEng'](_0x41d8fc,0x0))console[_0x3bc402(0xa9)](_0xb2b07e['PkAjw']),console['log'](_0x3bc402(0xd8));else{if(_0xb2b07e['AhMdp'](_0x3d0891['length'],0x0)){console[_0x3bc402(0xa9)](_0x3bc402(0xb7));for(const _0x44b88c of _0x3d0891){console['log'](_0x3bc402(0xdd)+bold(_0x44b88c['displayName'])+':\x20'+link(_0x44b88c['path'],basename(_0x44b88c[_0x3bc402(0xc1)])));}}if(_0xb2b07e[_0x3bc402(0xfa)](_0x17ff63['length'],0x0)){console[_0x3bc402(0xa9)](_0xb2b07e['lbZdr']);for(const _0x129ecc of _0x17ff63){console['log'](_0x3bc402(0xdd)+bold(_0x129ecc['displayName'])+':\x20'+_0xb2b07e[_0x3bc402(0xae)](link,_0x129ecc[_0x3bc402(0xc1)],basename(_0x129ecc[_0x3bc402(0xc1)])));}}}console[_0x3bc402(0xa9)]('\x0a---\x20Profiles\x20---');const {envs:_0x348b9f,activeEnv:_0x47e20f}=await getEnvironments();let _0x17260c=[];if(_0x56a3da)try{_0x17260c=await _0xb2b07e[_0x3bc402(0xe0)](listCloudProfiles);}catch{}const _0x1b4df5=_0xb2b07e[_0x3bc402(0x10b)](_0x348b9f[_0x3bc402(0xbb)],_0x17260c[_0x3bc402(0xbb)]);if(_0x1b4df5===0x0)console['log'](_0xb2b07e['QlQUa']),console[_0x3bc402(0xa9)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0xb2b07e['AhMdp'](_0x1b4df5,0x5)){const _0x4c87d0=[];_0xb2b07e[_0x3bc402(0xfc)](_0x17260c['length'],0x0)&&_0x4c87d0['push'](_0x17260c['length']+'\x20cloud'),_0x348b9f[_0x3bc402(0xbb)]>0x0&&_0x4c87d0[_0x3bc402(0x106)](_0x348b9f[_0x3bc402(0xbb)]+'\x20local'),console['log'](_0x1b4df5+_0x3bc402(0xcd)+_0x4c87d0['join'](',\x20')+')'),_0x47e20f&&console['log']('\x20\x20Active:\x20'+bold(_0x47e20f)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x4b87e3 of _0x17260c){const _0x401a4a=_0xb2b07e[_0x3bc402(0xa4)](_0x4b87e3[_0x3bc402(0xf6)],_0x47e20f)?_0x3bc402(0xd3):'';console['log']('\x20\x20'+_0xb2b07e['Udxca'](bold,_0x4b87e3[_0x3bc402(0xf6)])+'\x20[cloud]'+_0x401a4a);const _0x2c4a26=_0x4b87e3['sessionUpdatedAt']?_0x3bc402(0x105)+_0x4b87e3['sessionUpdatedAt']+')':_0xb2b07e[_0x3bc402(0x102)];console[_0x3bc402(0xa9)](_0x3bc402(0xc7)+_0x2c4a26);}const _0xab2114=new Set(_0x17260c[_0x3bc402(0xa5)](_0x116705=>_0x116705[_0x3bc402(0xf6)]));for(const _0x3e56bf of _0x348b9f){if(_0xab2114[_0x3bc402(0xa1)](_0x3e56bf[_0x3bc402(0xf6)]))continue;const _0x73b944=_0x3e56bf[_0x3bc402(0xb5)]?'\x20(active)':'',_0xb3097=_0x3e56bf[_0x3bc402(0xcb)]?_0xb2b07e[_0x3bc402(0xab)]:_0x3e56bf['hasPlaintextAuth']?_0x3bc402(0x109):_0xb2b07e[_0x3bc402(0xce)];console['log']('\x20\x20'+bold(_0x3e56bf['name'])+'\x20[local]'+_0x73b944),console['log']('\x20\x20\x20\x20Auth:\x20'+_0xb3097),_0xb2b07e[_0x3bc402(0xb6)](_0x3e56bf[_0x3bc402(0xda)],_0x3bc402(0xef))&&console['log']('\x20\x20\x20\x20Settings:\x20'+link(_0x3e56bf['settingsPath'],basename(_0x3e56bf['settingsPath'])));}if(!_0x47e20f){console['log']('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x2e823c=[..._0x17260c['map'](_0x119960=>_0x119960[_0x3bc402(0xf6)]),..._0x348b9f[_0x3bc402(0xf9)](_0x13a079=>!_0xab2114['has'](_0x13a079['name']))['map'](_0x2e78be=>_0x2e78be[_0x3bc402(0xf6)])];console[_0x3bc402(0xa9)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x2e823c[_0x3bc402(0xb3)](',\x20')+')');}}}console[_0x3bc402(0xa9)]('');}
|