@ranger-testing/ranger-cli 3.1.2-alpha.059c7a3-40 → 3.1.2
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 +1 -1
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x18c185,_0x3298ab){const _0xa12e2d=_0x2aa8,_0x16a67f=_0x18c185();while(!![]){try{const _0x286067=parseInt(_0xa12e2d(0x87))/0x1+-parseInt(_0xa12e2d(0x8c))/0x2*(parseInt(_0xa12e2d(0x86))/0x3)+-parseInt(_0xa12e2d(0x88))/0x4+-parseInt(_0xa12e2d(0x83))/0x5+parseInt(_0xa12e2d(0x89))/0x6+parseInt(_0xa12e2d(0x8d))/0x7+parseInt(_0xa12e2d(0x8b))/0x8;if(_0x286067===_0x3298ab)break;else _0x16a67f['push'](_0x16a67f['shift']());}catch(_0x1008cd){_0x16a67f['push'](_0x16a67f['shift']());}}}(_0x39d2,0x8f04a));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';function _0x39d2(){const _0x22f03e=['173969YTLwXI','4230300NdZalo','2015250BYDCRX','\x0a✅\x20Logged\x20in\x20to\x20','10881424oxKGNa','161666eAzBIa','1633639miGLCe','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','Login\x20failed:\x20','1895945FvoVzF','message','Re-authenticating\x20via\x20MCP\x20bootstrap...','3wNBwDM'];_0x39d2=function(){return _0x22f03e;};return _0x39d2();}import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';function _0x2aa8(_0x2423b6,_0x268111){_0x2423b6=_0x2423b6-0x83;const _0x39d2d6=_0x39d2();let _0x2aa8f5=_0x39d2d6[_0x2423b6];return _0x2aa8f5;}export async function login(){const _0x3d133c=_0x2aa8,_0x853e0={'KXIQY':function(_0x5b8aa7){return _0x5b8aa7();},'jSWAE':_0x3d133c(0x85),'fiSym':_0x3d133c(0x8e),'tYmdJ':function(_0xf32938){return _0xf32938();},'mxBGe':function(_0xa628b0,_0x34bef9){return _0xa628b0(_0x34bef9);}},_0x3f8b3e=await _0x853e0['KXIQY'](getMcpAuthOrigin);if(_0x3f8b3e){console['log'](_0x853e0['jSWAE']),await mcpBootstrap();return;}if(!isInteractive())throw new Error(_0x853e0['fiSym']);try{const _0x2755d0=await _0x853e0['tYmdJ'](runDeviceAuthFlow),_0xd85d31=await _0x853e0['mxBGe'](getCurrentUser,_0x2755d0);_0xd85d31['success']?console['log'](_0x3d133c(0x8a)+_0xd85d31['user']['organizationName']):console['log']('\x0a✅\x20API\x20key\x20stored\x20successfully');}catch(_0x47f15a){throw new Error(_0x3d133c(0x8f)+(_0x47f15a instanceof Error?_0x47f15a[_0x3d133c(0x84)]:_0x47f15a));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3f6f7e=_0x89f1;(function(_0x4046dd,_0x43afc7){const _0xef4360=_0x89f1,_0x584f4e=_0x4046dd();while(!![]){try{const _0x3b8155=parseInt(_0xef4360(0x1e1))/0x1*(-parseInt(_0xef4360(0x18d))/0x2)+-parseInt(_0xef4360(0x1bc))/0x3+parseInt(_0xef4360(0x17b))/0x4+-parseInt(_0xef4360(0x1e3))/0x5+-parseInt(_0xef4360(0x173))/0x6*(parseInt(_0xef4360(0x1a5))/0x7)+-parseInt(_0xef4360(0x177))/0x8+parseInt(_0xef4360(0x1b1))/0x9*(parseInt(_0xef4360(0x1b8))/0xa);if(_0x3b8155===_0x43afc7)break;else _0x584f4e['push'](_0x584f4e['shift']());}catch(_0x3699e1){_0x584f4e['push'](_0x584f4e['shift']());}}}(_0x386a,0xc0ad7));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';function _0x89f1(_0xd7d2b8,_0x44c847){_0xd7d2b8=_0xd7d2b8-0x172;const _0x386a14=_0x386a();let _0x89f149=_0x386a14[_0xd7d2b8];return _0x89f149;}import{createServer}from'http';import{randomBytes,createHash}from'crypto';function _0x386a(){const _0x253541=['XPLQP','LIllR','YVgiE','type','nTQki','get','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','OORLi','authorization_code','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','\x0aOpening\x20browser\x20for\x20authentication...','xSqjB','access_token','YSEOA','ysbqO','authorization_servers','writeHead','write','1yLXXNg','WFwdM','3169650wrSSDP','utf-8','1.0.0','TaLNw','end','notifications/initialized','ESoVM','isTTY','2025-03-26','oXWYl','trim','\x20done','RwnSh','platform','error','http://localhost:','UpyoJ','127.0.0.1','content','split','registration_endpoint','zavMq','closeAllConnections','close','client_secret','structuredContent','hex','fYuQj','AnWQJ','Lxofl','nIFau','base64url','replace','Exchanging\x20authorization\x20code...','132OyfCpl','awmAk','\x0aToken\x20written\x20to\x20','\x0aUnexpected\x20response\x20structure:','9595504XTwfEp','OAuth\x20error:\x20','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','Client\x20registration\x20failed:\x20','506960TbfnLs','gMUHB','/callback','IdTAp','toString','start','now','token_endpoint','result','client_id','error_description','OAuthTimeoutError','data:','yWMGu','VjTqk','log','needs-oauth','yqqCb','942322udcjlh','OFwTA','VSfez','message','.ranger','JIIvf','text','xdg-open','code_challenge','bWwUa','fNZlp','json','text/html','sha256','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','win32','mNxmk','kpdja','authorization_endpoint','Discovering\x20authorization\x20server...','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','POST','254919MNGMzF','application/json','stringify','state','wAIsX','MCP\x20initialize\x20failed:\x20','clientId','QqfOa','zUbBE','auth-origin.txt','searchParams','parse','9egrSXQ','startsWith','Token\x20exchange\x20failed:\x20','clientSecret','open','accessToken','origin','40818110QgumSi','kQjQy','includes','set','940923FbYyyY','lBNLy','TIsTn','noqGU','match','/.well-known/oauth-authorization-server','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','status','Bearer\x20','cpbpC','initialize','luUrL','srslM','stdout','xBQgE','yevHX','Vhuqh','listen'];_0x386a=function(){return _0x253541;};return _0x386a();}import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),_0x3f6f7e(0x191),'mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x3f6f7e(0x1ae));export async function getMcpAuthOrigin(){const _0x27032f=_0x3f6f7e,_0x2efe9f={'ESoVM':'utf-8'};try{const _0x5be263=(await readFile(AUTH_ORIGIN_PATH,_0x2efe9f[_0x27032f(0x1e9)]))['trim']();return _0x5be263||null;}catch{return null;}}export async function mcpBootstrap(){const _0x57e3dc=_0x3f6f7e,_0x2fde46={'vosks':function(_0x25be98){return _0x25be98();},'MswHG':function(_0x1cb847,_0x26fffb){return _0x1cb847(_0x26fffb);}},_0x456ce3=_0x2fde46['vosks'](getMcpAuthUrl);currentOrigin=_0x456ce3;const _0x40e283=process[_0x57e3dc(0x1c9)][_0x57e3dc(0x1ea)]??![];console[_0x57e3dc(0x18a)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x456ce3+'\x0a');const _0x23c2af=await _0x2fde46['MswHG'](tryUnauthenticated,_0x456ce3);let _0x5ed8f8=null;if(_0x23c2af==='proxied')_0x5ed8f8='';else{_0x5ed8f8=await loadCachedToken();if(!_0x5ed8f8){if(!_0x40e283)throw new Error(_0x57e3dc(0x19c)+'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.');_0x5ed8f8=await oauthFlow(_0x456ce3);}}await callGetCliToken(_0x456ce3,_0x5ed8f8);}async function tryUnauthenticated(_0x185422){const _0x2fac6c=_0x3f6f7e,_0x238506={'luUrL':function(_0x4b1e80,_0x3e7fac,_0x230739){return _0x4b1e80(_0x3e7fac,_0x230739);},'YdCyX':_0x2fac6c(0x1a6),'HSFyK':'application/json,\x20text/event-stream','TIsTn':'2.0','noqGU':'2025-03-26','qZpkO':'ranger-cli','gMUHB':function(_0x51f0bc,_0x236661){return _0x51f0bc===_0x236661;},'bWwUa':_0x2fac6c(0x18b)},_0x35e5a9=await _0x238506[_0x2fac6c(0x1c7)](fetch,_0x185422,{'method':'POST','headers':{'Content-Type':_0x238506['YdCyX'],'Accept':_0x238506['HSFyK']},'body':JSON[_0x2fac6c(0x1a7)]({'jsonrpc':_0x238506[_0x2fac6c(0x1be)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x238506[_0x2fac6c(0x1bf)],'capabilities':{},'clientInfo':{'name':_0x238506['qZpkO'],'version':_0x2fac6c(0x1e5)}}})});if(_0x35e5a9['ok'])return await _0x35e5a9[_0x2fac6c(0x193)](),'proxied';if(_0x238506[_0x2fac6c(0x17c)](_0x35e5a9[_0x2fac6c(0x1c3)],0x191))return await _0x35e5a9['text'](),_0x238506[_0x2fac6c(0x196)];const _0x22426f=await _0x35e5a9['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x35e5a9['status']+':\x20'+_0x22426f);}class OAuthTimeoutError extends Error{constructor(_0x5b7c51){const _0x532030=_0x3f6f7e;super(_0x5b7c51),this['name']=_0x532030(0x186);}}async function oauthFlow(_0x3deed9){const _0x4c56ad=_0x3f6f7e,_0x3bd0ba={'aQLJT':function(_0x54de20,_0xeb0ecb){return _0x54de20 instanceof _0xeb0ecb;},'OORLi':function(_0x17cef7){return _0x17cef7();}};try{return await oauthFlowAttempt(_0x3deed9);}catch(_0x2c8411){if(_0x3bd0ba['aQLJT'](_0x2c8411,OAuthTimeoutError)&&await loadCachedClient())return console['log'](_0x4c56ad(0x1a2)),await _0x3bd0ba[_0x4c56ad(0x1d5)](clearCachedClient),await oauthFlowAttempt(_0x3deed9);throw _0x2c8411;}}async function oauthFlowAttempt(_0xeee359){const _0x27ffd7=_0x3f6f7e,_0x54d96c={'WzKAD':_0x27ffd7(0x1a1),'XZxmR':_0x27ffd7(0x1a3),'giUGP':function(_0x2878ed){return _0x2878ed();},'spOcy':'Registering\x20OAuth\x20client...','YSEOA':function(_0x123fd7,_0xc7e02b,_0x2300d2){return _0x123fd7(_0xc7e02b,_0x2300d2);},'bQDBh':'authorization_code','WFwdM':'refresh_token','gCxAS':function(_0x5f2206,_0x5506b5,_0x5c0936){return _0x5f2206(_0x5506b5,_0x5c0936);},'IBrjN':function(_0x5767fd,_0x53626d){return _0x5767fd(_0x53626d);},'Lwkme':'base64url','TaLNw':function(_0x1305cc,_0x140b3c){return _0x1305cc(_0x140b3c);},'kfIlQ':'response_type','cpbpC':'code','wAIsX':'redirect_uri','IdTAp':'S256','SlpLZ':_0x27ffd7(0x1d9),'rjbys':'resource'},_0x2edbb7=_0xeee359[_0x27ffd7(0x203)](/\/mcp$/,'');process[_0x27ffd7(0x1c9)]['write'](_0x54d96c['WzKAD']);const _0x1f72f5=await fetch(_0x2edbb7+'/.well-known/oauth-protected-resource');if(!_0x1f72f5['ok'])throw new Error('Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server');const _0x15bf71=await _0x1f72f5['json'](),_0x29d52b=_0x15bf71[_0x27ffd7(0x1de)]?.[0x0];if(!_0x29d52b)throw new Error(_0x54d96c['XZxmR']);console['log']('\x20'+_0x29d52b);const _0x3b8548=await fetchAuthServerMetadata(_0x29d52b);let _0x4c621c,_0x1c84f4;const _0x530af9=await _0x54d96c['giUGP'](loadCachedClient);if(_0x530af9)_0x4c621c=_0x530af9[_0x27ffd7(0x1ab)],_0x1c84f4=_0x530af9[_0x27ffd7(0x1b4)];else{if(_0x3b8548[_0x27ffd7(0x1f7)]){process[_0x27ffd7(0x1c9)]['write'](_0x54d96c['spOcy']);const _0x1757d0=await _0x54d96c[_0x27ffd7(0x1dc)](fetch,_0x3b8548[_0x27ffd7(0x1f7)],{'method':_0x27ffd7(0x1a4),'headers':{'Content-Type':_0x27ffd7(0x1a6)},'body':JSON[_0x27ffd7(0x1a7)]({'client_name':'Ranger\x20CLI','redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x27ffd7(0x17d)],'grant_types':[_0x54d96c['bQDBh'],_0x54d96c[_0x27ffd7(0x1e2)]],'response_types':['code'],'token_endpoint_auth_method':'none'})});if(!_0x1757d0['ok']){const _0x50ffc8=await _0x1757d0['text']();throw new Error(_0x27ffd7(0x17a)+_0x50ffc8);}const _0x90e9ae=await _0x1757d0['json']();_0x4c621c=_0x90e9ae[_0x27ffd7(0x184)],_0x1c84f4=_0x90e9ae['client_secret'],await _0x54d96c['gCxAS'](saveCachedClient,_0x4c621c,_0x1c84f4),console['log'](_0x27ffd7(0x1ee));}else throw new Error('Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found');}const _0x25a39b=randomBytes(0x20)['toString'](_0x27ffd7(0x202)),_0x29ad6c=_0x54d96c['IBrjN'](createHash,_0x27ffd7(0x19a))['update'](_0x25a39b)['digest'](_0x54d96c['Lwkme']),_0x3d7d68=_0x54d96c['TaLNw'](randomBytes,0x10)['toString'](_0x27ffd7(0x1fd)),_0x1b4144=new URL(_0x3b8548[_0x27ffd7(0x1a0)]);_0x1b4144[_0x27ffd7(0x1af)]['set'](_0x54d96c['kfIlQ'],_0x54d96c[_0x27ffd7(0x1c5)]),_0x1b4144[_0x27ffd7(0x1af)]['set'](_0x27ffd7(0x184),_0x4c621c),_0x1b4144[_0x27ffd7(0x1af)][_0x27ffd7(0x1bb)](_0x54d96c[_0x27ffd7(0x1a9)],'http://localhost:'+CALLBACK_PORT+'/callback'),_0x1b4144[_0x27ffd7(0x1af)][_0x27ffd7(0x1bb)](_0x27ffd7(0x195),_0x29ad6c),_0x1b4144[_0x27ffd7(0x1af)]['set']('code_challenge_method',_0x54d96c[_0x27ffd7(0x17e)]),_0x1b4144[_0x27ffd7(0x1af)][_0x27ffd7(0x1bb)](_0x27ffd7(0x1a8),_0x3d7d68);_0x15bf71['resource']&&_0x1b4144[_0x27ffd7(0x1af)]['set']('resource',_0x15bf71['resource']);console['log'](_0x54d96c['SlpLZ']),console[_0x27ffd7(0x18a)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x1b4144['toString']()+'\x0a'),await _0x54d96c[_0x27ffd7(0x1e6)](openBrowser,_0x1b4144[_0x27ffd7(0x17f)]());const _0x5a3215=await waitForCallback(_0x3d7d68);process['stdout'][_0x27ffd7(0x1e0)](_0x27ffd7(0x172));const _0x165307=new URLSearchParams({'grant_type':_0x27ffd7(0x1d6),'code':_0x5a3215,'redirect_uri':_0x27ffd7(0x1f2)+CALLBACK_PORT+'/callback','client_id':_0x4c621c,'code_verifier':_0x25a39b});_0x1c84f4&&_0x165307['set'](_0x27ffd7(0x1fb),_0x1c84f4);_0x15bf71['resource']&&_0x165307[_0x27ffd7(0x1bb)](_0x54d96c['rjbys'],_0x15bf71['resource']);const _0x2c903f=await fetch(_0x3b8548[_0x27ffd7(0x182)],{'method':'POST','headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x165307});if(!_0x2c903f['ok']){const _0x66b4e=await _0x2c903f[_0x27ffd7(0x193)]();throw new Error(_0x27ffd7(0x1b3)+_0x66b4e);}const _0x191fb1=await _0x2c903f['json']();return console['log']('\x20done'),await saveCachedToken(_0x191fb1['access_token'],_0x191fb1['refresh_token'],_0x191fb1['expires_in']),_0x191fb1[_0x27ffd7(0x1db)];}async function callGetCliToken(_0x121b39,_0x4ce84b){const _0x5010f6=_0x3f6f7e,_0x2e99be={'yqqCb':function(_0x544bf8,_0x4158cf,_0x9a50b4){return _0x544bf8(_0x4158cf,_0x9a50b4);},'yevHX':'application/json','QqfOa':'Authorization','kQjQy':'Initializing\x20MCP\x20session...','nIFau':function(_0x1508d7,_0x7ae00b){return _0x1508d7(_0x7ae00b);},'awmAk':'2.0','BCqMI':_0x5010f6(0x1c6),'JIIvf':_0x5010f6(0x1eb),'EkXBW':_0x5010f6(0x1e5),'lZzPj':'\x20done','dxFcy':'POST','uGoWq':function(_0x598860,_0x136901){return _0x598860(_0x136901);},'tdZwr':'tools/call','kpdja':'get_cli_token','srslM':function(_0x374aa3,_0x2e5bab){return _0x374aa3(_0x2e5bab);},'oicnW':function(_0x1974b5,_0x10e956,_0x592b84){return _0x1974b5(_0x10e956,_0x592b84);},'Ynqvj':function(_0x430700){return _0x430700();},'FRbuK':'refresh.txt','rXfKs':function(_0x2066b3,_0x4ab90a,_0x24a39c){return _0x2066b3(_0x4ab90a,_0x24a39c);},'VPIPm':function(_0x587d5f,_0x55a8fc,_0x4e28fb,_0xacaab2){return _0x587d5f(_0x55a8fc,_0x4e28fb,_0xacaab2);},'VSfez':function(_0x5c54b3,_0x57e403,_0x3c9467,_0x958d59){return _0x5c54b3(_0x57e403,_0x3c9467,_0x958d59);},'RwnSh':function(_0x49d244,_0x1da2ea,_0x5f4f75){return _0x49d244(_0x1da2ea,_0x5f4f75);}},_0x145cb6={'Content-Type':_0x2e99be[_0x5010f6(0x1cb)],'Accept':'application/json,\x20text/event-stream'};_0x4ce84b&&(_0x145cb6[_0x2e99be[_0x5010f6(0x1ac)]]=_0x5010f6(0x1c4)+_0x4ce84b);const _0x6c59b3=async _0x5b1e8b=>{const _0x38ae62=_0x5010f6,_0xcfd368=await _0x2e99be[_0x38ae62(0x18c)](fetch,_0x121b39,{'method':'POST','headers':_0x145cb6,'body':JSON['stringify'](_0x5b1e8b)});if(!_0xcfd368['ok']){const _0x14cb36=await _0xcfd368['text']();throw new Error('HTTP\x20'+_0xcfd368[_0x38ae62(0x1c3)]+':\x20'+_0x14cb36);}return parseResponse(_0xcfd368);};process[_0x5010f6(0x1c9)]['write'](_0x2e99be[_0x5010f6(0x1b9)]);const _0x4621ef=await _0x2e99be[_0x5010f6(0x201)](_0x6c59b3,{'jsonrpc':_0x2e99be[_0x5010f6(0x174)],'id':0x1,'method':_0x2e99be['BCqMI'],'params':{'protocolVersion':_0x2e99be[_0x5010f6(0x192)],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x2e99be['EkXBW']}}});if(_0x4621ef['error'])throw new Error(_0x5010f6(0x1aa)+(_0x4621ef[_0x5010f6(0x1f1)]['message']??JSON[_0x5010f6(0x1a7)](_0x4621ef[_0x5010f6(0x1f1)])));console['log'](_0x2e99be['lZzPj']),await fetch(_0x121b39,{'method':_0x2e99be['dxFcy'],'headers':_0x145cb6,'body':JSON[_0x5010f6(0x1a7)]({'jsonrpc':_0x2e99be[_0x5010f6(0x174)],'method':_0x5010f6(0x1e8)})})['then'](_0xd1f6f3=>_0xd1f6f3['text']()),process[_0x5010f6(0x1c9)]['write']('Requesting\x20CLI\x20token...');const _0xc57b3=await _0x2e99be['uGoWq'](_0x6c59b3,{'jsonrpc':_0x2e99be[_0x5010f6(0x174)],'id':0x2,'method':_0x2e99be['tdZwr'],'params':{'name':_0x2e99be[_0x5010f6(0x19f)],'arguments':{}}});if(_0xc57b3['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0xc57b3['error'][_0x5010f6(0x190)]??JSON[_0x5010f6(0x1a7)](_0xc57b3['error'])));console[_0x5010f6(0x18a)](_0x5010f6(0x1ee));const _0x38e64e=_0x2e99be[_0x5010f6(0x1c8)](extractToken,_0xc57b3[_0x5010f6(0x183)]);if(!_0x38e64e){console[_0x5010f6(0x1f1)](_0x5010f6(0x176)),console['error'](JSON['stringify'](_0xc57b3[_0x5010f6(0x183)],null,0x2));throw new Error(_0x5010f6(0x1d8));}const _0x3a2111=_0x2e99be['oicnW'](join,_0x2e99be['Ynqvj'](homedir),_0x5010f6(0x191)),_0x570d1b=join(_0x3a2111,_0x2e99be['FRbuK']);await _0x2e99be['rXfKs'](mkdir,_0x3a2111,{'recursive':!![]}),await _0x2e99be['VPIPm'](writeFile,_0x570d1b,_0x38e64e,{'mode':0x180}),await _0x2e99be[_0x5010f6(0x18f)](writeFile,_0x2e99be[_0x5010f6(0x1ef)](join,_0x3a2111,_0x5010f6(0x1ae)),_0x121b39,{'mode':0x180}),console[_0x5010f6(0x18a)](_0x5010f6(0x175)+_0x570d1b),console['log'](_0x5010f6(0x1d7));}async function fetchAuthServerMetadata(_0x4c6da9){const _0x4aa2dc=_0x3f6f7e,_0x4da126=_0x4c6da9+_0x4aa2dc(0x1c1),_0x5c1bd6=await fetch(_0x4da126);if(!_0x5c1bd6['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x4da126+':\x20'+_0x5c1bd6[_0x4aa2dc(0x1c3)]);return _0x5c1bd6[_0x4aa2dc(0x198)]();}function waitForCallback(_0x39d8b2){const _0x38b998=_0x3f6f7e,_0x1ed199={'Vhuqh':function(_0x36312a,_0x433e12){return _0x36312a!==_0x433e12;},'CPETd':'Not\x20found','tWoBc':'error','oXWYl':function(_0x59ca7b){return _0x59ca7b();},'nTQki':function(_0x4ea59b,_0x25ad32){return _0x4ea59b(_0x25ad32);},'scmKP':function(_0x576e19,_0x42cd1c,_0x3ea7a2){return _0x576e19(_0x42cd1c,_0x3ea7a2);},'OFwTA':function(_0x588154,_0x26e0ce){return _0x588154(_0x26e0ce);},'FzdgE':_0x38b998(0x1f4)};return new Promise((_0xed724a,_0x1f0993)=>{const _0x13d0f8=_0x38b998,_0x540eeb={'UpyoJ':function(_0x2e2af2,_0x222758){return _0x2e2af2(_0x222758);},'Lxofl':function(_0x1288be,_0x3d9594){const _0x3213c9=_0x89f1;return _0x1ed199[_0x3213c9(0x1cc)](_0x1288be,_0x3d9594);},'yWMGu':'/callback','fNZlp':_0x1ed199['CPETd'],'xBQgE':_0x1ed199['tWoBc'],'YVgiE':function(_0x3ffe82){const _0x1746eb=_0x89f1;return _0x1ed199[_0x1746eb(0x1ec)](_0x3ffe82);},'WUwOs':_0x13d0f8(0x19b),'xSqjB':_0x13d0f8(0x199),'cpyPI':_0x13d0f8(0x179),'oONZY':function(_0x202777,_0x919dff){const _0x1acf95=_0x13d0f8;return _0x1ed199[_0x1acf95(0x1d2)](_0x202777,_0x919dff);}},_0x4abce3=()=>{const _0x53b41d=_0x13d0f8;_0x134e8e[_0x53b41d(0x1f9)](),_0x134e8e[_0x53b41d(0x1fa)]();},_0xec3dc3=_0x1ed199['scmKP'](setTimeout,()=>{const _0x1b2f5d=_0x13d0f8;_0x4abce3(),_0x540eeb['UpyoJ'](_0x1f0993,new OAuthTimeoutError(_0x1b2f5d(0x1d4)));},0x1d4c0),_0x134e8e=_0x1ed199[_0x13d0f8(0x18e)](createServer,(_0x4cf924,_0x33e37d)=>{const _0x464525=_0x13d0f8,_0x52402a=new URL(_0x4cf924['url']??'/',_0x464525(0x1f2)+CALLBACK_PORT);if(_0x540eeb[_0x464525(0x200)](_0x52402a['pathname'],_0x540eeb[_0x464525(0x188)])){_0x33e37d['writeHead'](0x194),_0x33e37d['end'](_0x540eeb[_0x464525(0x197)]);return;}const _0x2e1543=_0x52402a['searchParams']['get']('code'),_0x13a8ef=_0x52402a[_0x464525(0x1af)][_0x464525(0x1d3)](_0x464525(0x1a8)),_0x46b3e1=_0x52402a['searchParams'][_0x464525(0x1d3)](_0x540eeb[_0x464525(0x1ca)]);if(_0x46b3e1){const _0x43b0b9=_0x52402a['searchParams']['get'](_0x464525(0x185))??_0x46b3e1;_0x33e37d['writeHead'](0xc8,{'Content-Type':'text/html'}),_0x33e37d[_0x464525(0x1e7)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x43b0b9+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),clearTimeout(_0xec3dc3),_0x540eeb[_0x464525(0x1d0)](_0x4abce3),_0x540eeb[_0x464525(0x1f3)](_0x1f0993,new Error(_0x464525(0x178)+_0x43b0b9));return;}if(!_0x2e1543||_0x13a8ef!==_0x39d8b2){_0x33e37d[_0x464525(0x1df)](0x190,{'Content-Type':'text/html'}),_0x33e37d[_0x464525(0x1e7)](_0x540eeb['WUwOs']);return;}_0x33e37d[_0x464525(0x1df)](0xc8,{'Content-Type':_0x540eeb[_0x464525(0x1da)]}),_0x33e37d['end'](_0x540eeb['cpyPI']),_0x540eeb['UpyoJ'](clearTimeout,_0xec3dc3),_0x4abce3(),_0x540eeb['oONZY'](_0xed724a,_0x2e1543);});_0x134e8e[_0x13d0f8(0x1cd)](CALLBACK_PORT,_0x1ed199['FzdgE']);});}async function openBrowser(_0x519ef3){const _0x5e086c=_0x3f6f7e,_0x4c1472={'ysbqO':'darwin','zavMq':_0x5e086c(0x1b5),'pzdEa':function(_0x2b549e,_0x519a94){return _0x2b549e===_0x519a94;},'CyQXv':_0x5e086c(0x19d),'zUbBE':_0x5e086c(0x180),'mNxmk':_0x5e086c(0x194),'AnWQJ':function(_0x253d69,_0x512aec){return _0x253d69(_0x512aec);}},_0x36b1aa=process[_0x5e086c(0x1f0)]===_0x4c1472[_0x5e086c(0x1dd)]?_0x4c1472[_0x5e086c(0x1f8)]:_0x4c1472['pzdEa'](process['platform'],_0x4c1472['CyQXv'])?_0x4c1472[_0x5e086c(0x1ad)]:_0x4c1472[_0x5e086c(0x19e)];_0x4c1472[_0x5e086c(0x1ff)](exec,_0x36b1aa+'\x20\x22'+_0x519ef3+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x3a86b0=_0x3f6f7e,_0x3623b3={'xWIxk':function(_0x8fb394,_0x50fe28){return _0x8fb394!==_0x50fe28;}};try{const _0x51c877=JSON[_0x3a86b0(0x1b0)](await readFile(TOKEN_CACHE_PATH,_0x3a86b0(0x1e4)));if(_0x51c877['origin']&&_0x3623b3['xWIxk'](_0x51c877[_0x3a86b0(0x1b7)],currentOrigin))return null;if(_0x51c877['expiresAt']&&Date['now']()>_0x51c877['expiresAt'])return null;return _0x51c877[_0x3a86b0(0x1b6)]??null;}catch{return null;}}async function saveCachedToken(_0x3f328c,_0xc8e03f,_0x23f3b6){const _0x21a45c=_0x3f6f7e,_0x3080a6={'lBNLy':function(_0x31b5c4,_0x4df9cc){return _0x31b5c4*_0x4df9cc;},'BNhZp':function(_0x317c0d,_0x3b0790,_0x355d4b){return _0x317c0d(_0x3b0790,_0x355d4b);},'aPjoK':function(_0xa8f84c,_0x62d779,_0x5f19a5,_0x4e029d){return _0xa8f84c(_0x62d779,_0x5f19a5,_0x4e029d);}},_0xc862a4=await loadCachedData(),_0x5830ec={..._0xc862a4,'origin':currentOrigin,'accessToken':_0x3f328c,'refreshToken':_0xc8e03f??_0xc862a4?.['refreshToken'],'expiresAt':_0x23f3b6?Date[_0x21a45c(0x181)]()+_0x3080a6[_0x21a45c(0x1bd)](_0x23f3b6,0x3e8):undefined};await mkdir(_0x3080a6['BNhZp'](join,homedir(),'.ranger'),{'recursive':!![]}),await _0x3080a6['aPjoK'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x5830ec),{'mode':0x180});}async function loadCachedClient(){const _0x47e0c0=_0x3f6f7e,_0x462f13=await loadCachedData();if(_0x462f13?.[_0x47e0c0(0x1b7)]&&_0x462f13['origin']!==currentOrigin)return null;return _0x462f13?.['clientId']?{'clientId':_0x462f13['clientId'],'clientSecret':_0x462f13['clientSecret']}:null;}async function clearCachedClient(){const _0x5b7bca=_0x3f6f7e,_0x2537b2={'fYuQj':function(_0x50eb98){return _0x50eb98();},'LIllR':function(_0x55a05b,_0x8f9381,_0x51214b,_0x4b1b60){return _0x55a05b(_0x8f9381,_0x51214b,_0x4b1b60);}},_0x34c19c=await _0x2537b2[_0x5b7bca(0x1fe)](loadCachedData);if(!_0x34c19c)return;const {clientId:_0x329cdc,clientSecret:_0x57d3f6,..._0x4ad136}=_0x34c19c;await _0x2537b2[_0x5b7bca(0x1cf)](writeFile,TOKEN_CACHE_PATH,JSON[_0x5b7bca(0x1a7)](_0x4ad136),{'mode':0x180});}async function saveCachedClient(_0x4e2f51,_0x4f7e4d){const _0x1e17a6=_0x3f6f7e,_0x2e60d2={'VjTqk':function(_0x582753,_0x343bfd,_0x493621){return _0x582753(_0x343bfd,_0x493621);},'ypDOB':_0x1e17a6(0x191),'lTYhW':function(_0xb7ac0b,_0x398346,_0x377743,_0x286f62){return _0xb7ac0b(_0x398346,_0x377743,_0x286f62);}},_0xcca223=await loadCachedData(),_0xdc839b={..._0xcca223,'origin':currentOrigin,'accessToken':_0xcca223?.['accessToken']??'','clientId':_0x4e2f51,'clientSecret':_0x4f7e4d};await _0x2e60d2[_0x1e17a6(0x189)](mkdir,_0x2e60d2[_0x1e17a6(0x189)](join,homedir(),_0x2e60d2['ypDOB']),{'recursive':!![]}),await _0x2e60d2['lTYhW'](writeFile,TOKEN_CACHE_PATH,JSON[_0x1e17a6(0x1a7)](_0xdc839b),{'mode':0x180});}async function loadCachedData(){const _0x1aff59=_0x3f6f7e,_0x308353={'OyAYe':_0x1aff59(0x1e4)};try{return JSON[_0x1aff59(0x1b0)](await readFile(TOKEN_CACHE_PATH,_0x308353['OyAYe']));}catch{return null;}}async function parseResponse(_0x1f8797){const _0x106fc3=_0x3f6f7e,_0x14a098={'twLCR':'content-type','jYHQY':'text/event-stream','cYXWA':_0x106fc3(0x1c2)},_0x4f72fa=_0x1f8797['headers'][_0x106fc3(0x1d3)](_0x14a098['twLCR'])??'';if(_0x4f72fa[_0x106fc3(0x1ba)](_0x14a098['jYHQY'])){const _0x318e21=await _0x1f8797[_0x106fc3(0x193)]();for(const _0xbd3d1b of _0x318e21[_0x106fc3(0x1f6)]('\x0a')){const _0x365e9d=_0xbd3d1b['trim']();if(_0x365e9d[_0x106fc3(0x1b2)](_0x106fc3(0x187))){const _0xe60230=_0x365e9d['slice']('data:'['length'])[_0x106fc3(0x1ed)]();if(!_0xe60230)continue;try{const _0x1ea0b9=JSON['parse'](_0xe60230);if(_0x1ea0b9['id']!==undefined||_0x1ea0b9[_0x106fc3(0x1f1)])return _0x1ea0b9;}catch{}}}throw new Error(_0x14a098['cYXWA']);}return _0x1f8797[_0x106fc3(0x198)]();}function extractToken(_0x3e1d15){const _0x3aa504=_0x3f6f7e,_0xa957dc={'XPLQP':function(_0x68f9f1,_0x4e3abc){return _0x68f9f1===_0x4e3abc;},'Bmoqb':'string','CsPbh':function(_0x32a72b,_0x5c9096){return _0x32a72b===_0x5c9096;}};if(!_0x3e1d15)return null;const _0x5a17f7=_0x3e1d15[_0x3aa504(0x1fc)];if(_0x5a17f7?.['token']&&_0xa957dc[_0x3aa504(0x1ce)](typeof _0x5a17f7['token'],_0xa957dc['Bmoqb']))return _0x5a17f7['token'];if(_0x3e1d15['isError']){const _0x18211b=_0x3e1d15[_0x3aa504(0x1f5)];throw new Error('Server\x20returned\x20error:\x20'+(_0x18211b?.[0x0]?.[_0x3aa504(0x193)]??'Unknown\x20error'));}const _0x55d475=_0x3e1d15[_0x3aa504(0x1f5)];if(_0x55d475)for(const _0x8928e8 of _0x55d475){if(_0xa957dc[_0x3aa504(0x1ce)](_0x8928e8[_0x3aa504(0x1d1)],'text')&&_0x8928e8['text']){try{const _0x4d8d7d=JSON['parse'](_0x8928e8['text']);if(_0xa957dc['CsPbh'](typeof _0x4d8d7d?.['token'],'string'))return _0x4d8d7d['token'];}catch{}const _0x143431=_0x8928e8['text'][_0x3aa504(0x1c0)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x143431)return _0x143431[0x1];}}return null;}
|
|
1
|
+
const _0xb32d1b=_0x2ad7;(function(_0x3628f0,_0x210ae8){const _0x311ae2=_0x2ad7,_0x29cef5=_0x3628f0();while(!![]){try{const _0x47f90d=parseInt(_0x311ae2(0x18d))/0x1*(parseInt(_0x311ae2(0x1a1))/0x2)+-parseInt(_0x311ae2(0x1bd))/0x3*(-parseInt(_0x311ae2(0x1d0))/0x4)+-parseInt(_0x311ae2(0x1bc))/0x5+-parseInt(_0x311ae2(0x145))/0x6+-parseInt(_0x311ae2(0x156))/0x7*(-parseInt(_0x311ae2(0x1aa))/0x8)+parseInt(_0x311ae2(0x1d1))/0x9+-parseInt(_0x311ae2(0x1cf))/0xa*(parseInt(_0x311ae2(0x160))/0xb);if(_0x47f90d===_0x210ae8)break;else _0x29cef5['push'](_0x29cef5['shift']());}catch(_0x355b1a){_0x29cef5['push'](_0x29cef5['shift']());}}}(_0x4796,0x3c9fb));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),_0xb32d1b(0x147),_0xb32d1b(0x17c)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');export async function getMcpAuthOrigin(){const _0x36096c=_0xb32d1b,_0x543411={'JYWoL':_0x36096c(0x197),'tCefs':function(_0x55806f,_0x2f2869){return _0x55806f||_0x2f2869;}};try{const _0x55516b=(await readFile(AUTH_ORIGIN_PATH,_0x543411[_0x36096c(0x18b)]))[_0x36096c(0x1a0)]();return _0x543411['tCefs'](_0x55516b,null);}catch{return null;}}export async function mcpBootstrap(){const _0x1eb111=_0xb32d1b,_0x21ed4a={'jnaQN':function(_0x1268f2,_0x553b89){return _0x1268f2(_0x553b89);},'uzdXH':function(_0x1e0c85,_0x57e3e8){return _0x1e0c85===_0x57e3e8;},'BpWGl':_0x1eb111(0x17a),'TSkOj':function(_0x2242af){return _0x2242af();},'vFUyf':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'},_0x4665fc=getMcpAuthUrl();currentOrigin=_0x4665fc;const _0x5ad2d1=process['stdout'][_0x1eb111(0x14b)]??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x4665fc+'\x0a');const _0x211b04=await _0x21ed4a[_0x1eb111(0x1b7)](tryUnauthenticated,_0x4665fc);let _0x4bacac=null;if(_0x21ed4a[_0x1eb111(0x186)](_0x211b04,_0x21ed4a['BpWGl']))_0x4bacac='';else{_0x4bacac=await _0x21ed4a[_0x1eb111(0x181)](loadCachedToken);if(!_0x4bacac){if(!_0x5ad2d1)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x21ed4a[_0x1eb111(0x150)]);_0x4bacac=await _0x21ed4a[_0x1eb111(0x1b7)](oauthFlow,_0x4665fc);}}await callGetCliToken(_0x4665fc,_0x4bacac);}async function tryUnauthenticated(_0x2aa9c9){const _0x48d1bb=_0xb32d1b,_0x278251={'XYXff':function(_0x3abeca,_0x1d07e4,_0x4c5a93){return _0x3abeca(_0x1d07e4,_0x4c5a93);},'VPwvM':'application/json','nvbZc':_0x48d1bb(0x184),'zhEzk':'initialize','CRqhC':'ranger-cli','SbPKN':'1.0.0','YVvRN':'needs-oauth'},_0x459f43=await _0x278251['XYXff'](fetch,_0x2aa9c9,{'method':'POST','headers':{'Content-Type':_0x278251['VPwvM'],'Accept':'application/json,\x20text/event-stream'},'body':JSON[_0x48d1bb(0x16e)]({'jsonrpc':_0x278251[_0x48d1bb(0x139)],'id':0x1,'method':_0x278251[_0x48d1bb(0x1c5)],'params':{'protocolVersion':_0x48d1bb(0x1af),'capabilities':{},'clientInfo':{'name':_0x278251['CRqhC'],'version':_0x278251[_0x48d1bb(0x136)]}}})});if(_0x459f43['ok'])return await _0x459f43['text'](),'proxied';if(_0x459f43[_0x48d1bb(0x151)]===0x191)return await _0x459f43['text'](),_0x278251[_0x48d1bb(0x1b1)];const _0xf9702b=await _0x459f43[_0x48d1bb(0x191)]();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x459f43[_0x48d1bb(0x151)]+':\x20'+_0xf9702b);}class OAuthTimeoutError extends Error{constructor(_0x388fe1){const _0x3aa777=_0xb32d1b,_0x53343c={'wfGkS':_0x3aa777(0x185)};super(_0x388fe1),this['name']=_0x53343c[_0x3aa777(0x18f)];}}async function oauthFlow(_0x9cf4bb){const _0x567316=_0xb32d1b,_0x5a3ab0={'scOPy':function(_0x40e8c7){return _0x40e8c7();},'ScnLs':_0x567316(0x19f),'jDhdM':function(_0x184934,_0x440509){return _0x184934(_0x440509);}};try{return await oauthFlowAttempt(_0x9cf4bb);}catch(_0x289b99){if(_0x289b99 instanceof OAuthTimeoutError&&await _0x5a3ab0['scOPy'](loadCachedClient))return console[_0x567316(0x17e)](_0x5a3ab0[_0x567316(0x196)]),await _0x5a3ab0[_0x567316(0x1a3)](clearCachedClient),await _0x5a3ab0[_0x567316(0x152)](oauthFlowAttempt,_0x9cf4bb);throw _0x289b99;}}function _0x4796(){const _0x47ad61=['IXdwZ','Not\x20found','8uddbPa','AYUIe','sha256','ohkMn','clientSecret','2025-03-26','AWttJ','YVvRN','resource','Unknown\x20error','writeHead','JgOEj','zecak','jnaQN','1.0.0','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','OHuCH','EwVFF','549430MTZlnA','2010HRJikr','/.well-known/oauth-authorization-server','toString','MyZtS','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','end','xFXSW','write','zhEzk','expiresAt','/callback','includes','notifications/initialized','win32','oOTxG','token','lQZxB','state','110wznkYX','2452GJKukO','1993482JfuMDG','searchParams','accessToken','origin','content','SbPKN','text/html','json','nvbZc','get','darwin','\x0aUnexpected\x20response\x20structure:','authorization_servers','zLEUd','hEgDy','application/x-www-form-urlencoded','rEiDS','DtcSk','CVaUt','text/event-stream','2186922xuHidX','application/json','.ranger','refresh.txt','ranger-cli','start','isTTY','XtHcA','registration_endpoint','clientId','data:','vFUyf','status','jDhdM','set','split','Token\x20exchange\x20failed:\x20','674219QZqIEJ','http://localhost:','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','JXWsM','Requesting\x20CLI\x20token...','LBfnW','error_description','access_token','SdWhY','wLlfy','228877IVRPXj','code_challenge_method','code','refresh_token','tVjdt','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','string','OAuth\x20error:\x20','startsWith','SJlMC','POST','PjypD','XSFeF','parse','stringify','ImPHT','yoQDA','\x20done','now','type','expires_in','RRFol','vNTyr','error','gLnhT','Authorization','proxied','XJzdK','mcp-oauth-tokens.json','client_secret','log','match','redirect_uri','TSkOj','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','<html><body><h2>Authentication\x20failed</h2><p>','2.0','OAuthTimeoutError','uzdXH','hex','Exchanging\x20authorization\x20code...','tools/call','AJUca','JYWoL','NuMTU','6970wbvhzE','/.well-known/oauth-protected-resource','wfGkS','stdout','text','eTMLH','TuErj','OMJML','NJJnA','ScnLs','utf-8','closeAllConnections','MZbFG','Client\x20registration\x20failed:\x20','yXWbA','xdg-open','client_id','pathname','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','trim','64cQMAbW','KXaVd','scOPy','zUTQg','authorization_code','olTFT','auth-origin.txt'];_0x4796=function(){return _0x47ad61;};return _0x4796();}async function oauthFlowAttempt(_0x306dc9){const _0xb2ff92=_0xb32d1b,_0x58e569={'EwVFF':'Discovering\x20authorization\x20server...','FCzaR':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','vNTyr':function(_0x5f35a2){return _0x5f35a2();},'DpeBB':'Registering\x20OAuth\x20client...','hEgDy':'POST','TuErj':_0xb2ff92(0x146),'olTFT':'Ranger\x20CLI','zLEUd':'none','RRFol':_0xb2ff92(0x171),'DtcSk':function(_0x361796,_0x43d49a){return _0x361796(_0x43d49a);},'PjypD':_0xb2ff92(0x1ac),'JgOEj':_0xb2ff92(0x187),'PvOPd':_0xb2ff92(0x180),'gUKiH':_0xb2ff92(0x161),'XtHcA':_0xb2ff92(0x1ce),'poADU':'authorization_code','AWttJ':'client_secret','NuMTU':_0xb2ff92(0x140)},_0x5ee0e8=_0x306dc9['replace'](/\/mcp$/,'');process['stdout']['write'](_0x58e569[_0xb2ff92(0x1bb)]);const _0x2f2f01=await fetch(_0x5ee0e8+_0xb2ff92(0x18e));if(!_0x2f2f01['ok'])throw new Error(_0x58e569['FCzaR']);const _0x6e96c6=await _0x2f2f01[_0xb2ff92(0x138)](),_0x29e511=_0x6e96c6[_0xb2ff92(0x13d)]?.[0x0];if(!_0x29e511)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console[_0xb2ff92(0x17e)]('\x20'+_0x29e511);const _0x4b3f0c=await fetchAuthServerMetadata(_0x29e511);let _0x258d13,_0x2f7917;const _0x301ccd=await _0x58e569[_0xb2ff92(0x176)](loadCachedClient);if(_0x301ccd)_0x258d13=_0x301ccd[_0xb2ff92(0x14e)],_0x2f7917=_0x301ccd['clientSecret'];else{if(_0x4b3f0c[_0xb2ff92(0x14d)]){process[_0xb2ff92(0x190)]['write'](_0x58e569['DpeBB']);const _0x2c382a=await fetch(_0x4b3f0c[_0xb2ff92(0x14d)],{'method':_0x58e569[_0xb2ff92(0x13f)],'headers':{'Content-Type':_0x58e569[_0xb2ff92(0x193)]},'body':JSON['stringify']({'client_name':_0x58e569[_0xb2ff92(0x1a6)],'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0xb2ff92(0x1c7)],'grant_types':[_0xb2ff92(0x1a5),_0xb2ff92(0x163)],'response_types':[_0xb2ff92(0x162)],'token_endpoint_auth_method':_0x58e569[_0xb2ff92(0x13e)]})});if(!_0x2c382a['ok']){const _0x2d8b7f=await _0x2c382a['text']();throw new Error(_0xb2ff92(0x19a)+_0x2d8b7f);}const _0x2e9ab4=await _0x2c382a['json']();_0x258d13=_0x2e9ab4[_0xb2ff92(0x19d)],_0x2f7917=_0x2e9ab4[_0xb2ff92(0x17d)],await saveCachedClient(_0x258d13,_0x2f7917),console[_0xb2ff92(0x17e)](_0x58e569['RRFol']);}else throw new Error('Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found');}const _0x40fa26=randomBytes(0x20)[_0xb2ff92(0x1bf)]('base64url'),_0x12fcf4=_0x58e569[_0xb2ff92(0x142)](createHash,_0x58e569[_0xb2ff92(0x16b)])['update'](_0x40fa26)['digest']('base64url'),_0x4c1506=_0x58e569['DtcSk'](randomBytes,0x10)[_0xb2ff92(0x1bf)](_0x58e569[_0xb2ff92(0x1b5)]),_0x33a332=new URL(_0x4b3f0c['authorization_endpoint']);_0x33a332[_0xb2ff92(0x1d2)]['set']('response_type','code'),_0x33a332[_0xb2ff92(0x1d2)]['set'](_0xb2ff92(0x19d),_0x258d13),_0x33a332['searchParams'][_0xb2ff92(0x153)](_0x58e569['PvOPd'],_0xb2ff92(0x157)+CALLBACK_PORT+_0xb2ff92(0x1c7)),_0x33a332[_0xb2ff92(0x1d2)][_0xb2ff92(0x153)]('code_challenge',_0x12fcf4),_0x33a332[_0xb2ff92(0x1d2)]['set'](_0x58e569['gUKiH'],'S256'),_0x33a332[_0xb2ff92(0x1d2)]['set'](_0x58e569[_0xb2ff92(0x14c)],_0x4c1506);_0x6e96c6['resource']&&_0x33a332['searchParams']['set'](_0xb2ff92(0x1b2),_0x6e96c6[_0xb2ff92(0x1b2)]);console['log']('\x0aOpening\x20browser\x20for\x20authentication...'),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x33a332['toString']()+'\x0a'),await openBrowser(_0x33a332[_0xb2ff92(0x1bf)]());const _0x537779=await waitForCallback(_0x4c1506);process['stdout'][_0xb2ff92(0x1c4)](_0xb2ff92(0x188));const _0x134520=new URLSearchParams({'grant_type':_0x58e569['poADU'],'code':_0x537779,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0xb2ff92(0x1c7),'client_id':_0x258d13,'code_verifier':_0x40fa26});_0x2f7917&&_0x134520['set'](_0x58e569[_0xb2ff92(0x1b0)],_0x2f7917);_0x6e96c6[_0xb2ff92(0x1b2)]&&_0x134520['set'](_0xb2ff92(0x1b2),_0x6e96c6[_0xb2ff92(0x1b2)]);const _0x1136f9=await fetch(_0x4b3f0c['token_endpoint'],{'method':_0xb2ff92(0x16a),'headers':{'Content-Type':_0x58e569[_0xb2ff92(0x18c)]},'body':_0x134520});if(!_0x1136f9['ok']){const _0x5ab091=await _0x1136f9[_0xb2ff92(0x191)]();throw new Error(_0xb2ff92(0x155)+_0x5ab091);}const _0x381048=await _0x1136f9[_0xb2ff92(0x138)]();return console['log'](_0x58e569[_0xb2ff92(0x175)]),await saveCachedToken(_0x381048[_0xb2ff92(0x15d)],_0x381048['refresh_token'],_0x381048[_0xb2ff92(0x174)]),_0x381048[_0xb2ff92(0x15d)];}async function callGetCliToken(_0x26493b,_0xbfbed2){const _0x2928e1=_0xb32d1b,_0x1a4f73={'XJzdK':function(_0x152209,_0xda61f4,_0x39fb46){return _0x152209(_0xda61f4,_0x39fb46);},'qORHm':_0x2928e1(0x16a),'FbuhH':function(_0x5c88ad,_0xd221cd){return _0x5c88ad(_0xd221cd);},'SdWhY':'application/json,\x20text/event-stream','eHUrt':'Initializing\x20MCP\x20session...','oOTxG':function(_0x5ba580,_0x577e18){return _0x5ba580(_0x577e18);},'buPbl':_0x2928e1(0x1af),'MZbFG':_0x2928e1(0x1b8),'yoQDA':_0x2928e1(0x184),'wWNTw':_0x2928e1(0x1c9),'OHuCH':_0x2928e1(0x15a),'zUTQg':'\x20done','tVjdt':function(_0x8f6fb4,_0x569a57){return _0x8f6fb4(_0x569a57);},'OMJML':_0x2928e1(0x182),'AYUIe':function(_0x44918e,_0xdb2fe1,_0x3a0eb8){return _0x44918e(_0xdb2fe1,_0x3a0eb8);},'lQZxB':_0x2928e1(0x148),'ImPHT':function(_0xd50f14,_0x50610e,_0x377e3c,_0x184f35){return _0xd50f14(_0x50610e,_0x377e3c,_0x184f35);},'hKlzv':function(_0x96548b,_0xb125d3,_0x233b94,_0x3f7350){return _0x96548b(_0xb125d3,_0x233b94,_0x3f7350);},'ohkMn':_0x2928e1(0x1a7),'yXWbA':'Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a'},_0x9732c6={'Content-Type':_0x2928e1(0x146),'Accept':_0x1a4f73[_0x2928e1(0x15e)]};_0xbfbed2&&(_0x9732c6[_0x2928e1(0x179)]='Bearer\x20'+_0xbfbed2);const _0x5c6254=async _0x1dde0d=>{const _0x280628=_0x2928e1,_0x3457d6=await _0x1a4f73[_0x280628(0x17b)](fetch,_0x26493b,{'method':_0x1a4f73['qORHm'],'headers':_0x9732c6,'body':JSON['stringify'](_0x1dde0d)});if(!_0x3457d6['ok']){const _0x299641=await _0x3457d6['text']();throw new Error('HTTP\x20'+_0x3457d6['status']+':\x20'+_0x299641);}return _0x1a4f73['FbuhH'](parseResponse,_0x3457d6);};process[_0x2928e1(0x190)][_0x2928e1(0x1c4)](_0x1a4f73['eHUrt']);const _0x5ca22d=await _0x1a4f73[_0x2928e1(0x1cb)](_0x5c6254,{'jsonrpc':_0x2928e1(0x184),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x1a4f73['buPbl'],'capabilities':{},'clientInfo':{'name':_0x2928e1(0x149),'version':_0x1a4f73[_0x2928e1(0x199)]}}});if(_0x5ca22d['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x5ca22d[_0x2928e1(0x177)]['message']??JSON['stringify'](_0x5ca22d[_0x2928e1(0x177)])));console[_0x2928e1(0x17e)]('\x20done'),await fetch(_0x26493b,{'method':'POST','headers':_0x9732c6,'body':JSON['stringify']({'jsonrpc':_0x1a4f73[_0x2928e1(0x170)],'method':_0x1a4f73['wWNTw']})})['then'](_0x4b959e=>_0x4b959e[_0x2928e1(0x191)]()),process[_0x2928e1(0x190)]['write'](_0x1a4f73[_0x2928e1(0x1ba)]);const _0x2bc54f=await _0x5c6254({'jsonrpc':_0x1a4f73[_0x2928e1(0x170)],'id':0x2,'method':_0x2928e1(0x189),'params':{'name':'get_cli_token','arguments':{}}});if(_0x2bc54f['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x2bc54f['error']['message']??JSON['stringify'](_0x2bc54f[_0x2928e1(0x177)])));console['log'](_0x1a4f73[_0x2928e1(0x1a4)]);const _0x368de7=_0x1a4f73[_0x2928e1(0x164)](extractToken,_0x2bc54f['result']);if(!_0x368de7){console['error'](_0x2928e1(0x13c)),console['error'](JSON[_0x2928e1(0x16e)](_0x2bc54f['result'],null,0x2));throw new Error(_0x1a4f73[_0x2928e1(0x194)]);}const _0x13a09a=_0x1a4f73['AYUIe'](join,homedir(),'.ranger'),_0x5a900c=_0x1a4f73[_0x2928e1(0x17b)](join,_0x13a09a,_0x1a4f73[_0x2928e1(0x1cd)]);await mkdir(_0x13a09a,{'recursive':!![]}),await _0x1a4f73[_0x2928e1(0x16f)](writeFile,_0x5a900c,_0x368de7,{'mode':0x180}),await _0x1a4f73['hKlzv'](writeFile,_0x1a4f73[_0x2928e1(0x1ab)](join,_0x13a09a,_0x1a4f73[_0x2928e1(0x1ad)]),_0x26493b,{'mode':0x180}),console['log']('\x0aToken\x20written\x20to\x20'+_0x5a900c),console['log'](_0x1a4f73[_0x2928e1(0x19b)]);}async function fetchAuthServerMetadata(_0x388faf){const _0x45b31=_0xb32d1b,_0x1cb0fb={'jnmUV':function(_0x5f5b1c,_0x5749c3){return _0x5f5b1c(_0x5749c3);}},_0x3d97b9=_0x388faf+_0x45b31(0x1be),_0x47b810=await _0x1cb0fb['jnmUV'](fetch,_0x3d97b9);if(!_0x47b810['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x3d97b9+':\x20'+_0x47b810[_0x45b31(0x151)]);return _0x47b810['json']();}function waitForCallback(_0x4e3538){const _0x35592a=_0xb32d1b,_0x316f21={'KXaVd':function(_0x5a323a,_0x83bde3){return _0x5a323a!==_0x83bde3;},'xFXSW':_0x35592a(0x1a9),'wOKkC':'state','pBiaU':'error','XSFeF':function(_0x3414af,_0x30ccca){return _0x3414af(_0x30ccca);},'rEiDS':'text/html','uCLPo':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','IXdwZ':function(_0x58b514){return _0x58b514();},'CVaUt':_0x35592a(0x1c1),'IrxcV':function(_0x2b6b02,_0x50719f){return _0x2b6b02(_0x50719f);},'LBfnW':'127.0.0.1'};return new Promise((_0x526d17,_0x153880)=>{const _0x553619=_0x35592a,_0x5e0269={'TIEZk':function(_0x4c32b9){return _0x316f21['IXdwZ'](_0x4c32b9);},'JXWsM':_0x316f21[_0x553619(0x143)]},_0x3a14cd=()=>{const _0xe56738=_0x553619;_0x4fd0b4[_0xe56738(0x198)](),_0x4fd0b4['close']();},_0x38ca0d=setTimeout(()=>{const _0x39d92c=_0x553619;_0x5e0269['TIEZk'](_0x3a14cd),_0x153880(new OAuthTimeoutError(_0x5e0269[_0x39d92c(0x159)]));},0x1d4c0),_0x4fd0b4=_0x316f21['IrxcV'](createServer,(_0x27920a,_0x573ae1)=>{const _0xe369ec=_0x553619,_0x28edbb=new URL(_0x27920a['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x316f21[_0xe369ec(0x1a2)](_0x28edbb[_0xe369ec(0x19e)],_0xe369ec(0x1c7))){_0x573ae1['writeHead'](0x194),_0x573ae1[_0xe369ec(0x1c2)](_0x316f21[_0xe369ec(0x1c3)]);return;}const _0x33ba47=_0x28edbb[_0xe369ec(0x1d2)][_0xe369ec(0x13a)](_0xe369ec(0x162)),_0x583ec7=_0x28edbb['searchParams'][_0xe369ec(0x13a)](_0x316f21['wOKkC']),_0x5582bc=_0x28edbb['searchParams']['get'](_0x316f21['pBiaU']);if(_0x5582bc){const _0x4634d2=_0x28edbb['searchParams']['get'](_0xe369ec(0x15c))??_0x5582bc;_0x573ae1[_0xe369ec(0x1b4)](0xc8,{'Content-Type':_0xe369ec(0x137)}),_0x573ae1['end'](_0xe369ec(0x183)+_0x4634d2+_0xe369ec(0x1b9)),_0x316f21['XSFeF'](clearTimeout,_0x38ca0d),_0x3a14cd(),_0x316f21[_0xe369ec(0x16c)](_0x153880,new Error(_0xe369ec(0x167)+_0x4634d2));return;}if(!_0x33ba47||_0x583ec7!==_0x4e3538){_0x573ae1[_0xe369ec(0x1b4)](0x190,{'Content-Type':_0x316f21[_0xe369ec(0x141)]}),_0x573ae1['end'](_0x316f21['uCLPo']);return;}_0x573ae1[_0xe369ec(0x1b4)](0xc8,{'Content-Type':_0xe369ec(0x137)}),_0x573ae1[_0xe369ec(0x1c2)](_0xe369ec(0x158)),_0x316f21[_0xe369ec(0x16c)](clearTimeout,_0x38ca0d),_0x316f21[_0xe369ec(0x1a8)](_0x3a14cd),_0x316f21[_0xe369ec(0x16c)](_0x526d17,_0x33ba47);});_0x4fd0b4['listen'](CALLBACK_PORT,_0x316f21[_0x553619(0x15b)]);});}async function openBrowser(_0x1197f4){const _0x26d782=_0xb32d1b,_0x50abfb={'vMJhX':function(_0x22bd66,_0x5bdf10){return _0x22bd66===_0x5bdf10;},'RqSRU':'open','aaKFh':function(_0x4137cc,_0xeb6893){return _0x4137cc===_0xeb6893;},'MyZtS':_0x26d782(0x1ca),'UddAk':_0x26d782(0x14a),'OEsHq':function(_0xe29070,_0x5ac576){return _0xe29070(_0x5ac576);}},_0x4ebd16=_0x50abfb['vMJhX'](process['platform'],_0x26d782(0x13b))?_0x50abfb['RqSRU']:_0x50abfb['aaKFh'](process['platform'],_0x50abfb[_0x26d782(0x1c0)])?_0x50abfb['UddAk']:_0x26d782(0x19c);_0x50abfb['OEsHq'](exec,_0x4ebd16+'\x20\x22'+_0x1197f4+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x1a7e21=_0xb32d1b,_0x4f3a37={'cqssX':'utf-8','NJJnA':function(_0x5c9a9e,_0x18f4a0){return _0x5c9a9e!==_0x18f4a0;}};try{const _0x52af39=JSON[_0x1a7e21(0x16d)](await readFile(TOKEN_CACHE_PATH,_0x4f3a37['cqssX']));if(_0x52af39['origin']&&_0x4f3a37[_0x1a7e21(0x195)](_0x52af39['origin'],currentOrigin))return null;if(_0x52af39[_0x1a7e21(0x1c6)]&&Date[_0x1a7e21(0x172)]()>_0x52af39[_0x1a7e21(0x1c6)])return null;return _0x52af39[_0x1a7e21(0x1d3)]??null;}catch{return null;}}function _0x2ad7(_0x2291a5,_0x3b3275){_0x2291a5=_0x2291a5-0x134;const _0x4796d9=_0x4796();let _0x2ad7be=_0x4796d9[_0x2291a5];return _0x2ad7be;}async function saveCachedToken(_0x12d3b7,_0x54d293,_0x1b5fd0){const _0x1b3d53=_0xb32d1b,_0x39f858={'LbiFa':function(_0x42018b){return _0x42018b();},'jIRnf':function(_0xc093f,_0x5d38b3){return _0xc093f*_0x5d38b3;},'zecak':function(_0x101741,_0x1122bb,_0x4d2568){return _0x101741(_0x1122bb,_0x4d2568);}},_0x1d69da=await _0x39f858['LbiFa'](loadCachedData),_0x4a69e8={..._0x1d69da,'origin':currentOrigin,'accessToken':_0x12d3b7,'refreshToken':_0x54d293??_0x1d69da?.['refreshToken'],'expiresAt':_0x1b5fd0?Date[_0x1b3d53(0x172)]()+_0x39f858['jIRnf'](_0x1b5fd0,0x3e8):undefined};await _0x39f858[_0x1b3d53(0x1b6)](mkdir,join(homedir(),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x1b3d53(0x16e)](_0x4a69e8),{'mode':0x180});}async function loadCachedClient(){const _0x4e162d=_0xb32d1b,_0x4ef705={'BzyQv':function(_0x10c14b){return _0x10c14b();}},_0x35b979=await _0x4ef705['BzyQv'](loadCachedData);if(_0x35b979?.[_0x4e162d(0x134)]&&_0x35b979[_0x4e162d(0x134)]!==currentOrigin)return null;return _0x35b979?.['clientId']?{'clientId':_0x35b979[_0x4e162d(0x14e)],'clientSecret':_0x35b979[_0x4e162d(0x1ae)]}:null;}async function clearCachedClient(){const _0x1b7af2={'LaQuv':function(_0x3e180b,_0x195f49,_0x157c3d,_0x5194d1){return _0x3e180b(_0x195f49,_0x157c3d,_0x5194d1);}},_0x11afb1=await loadCachedData();if(!_0x11afb1)return;const {clientId:_0x367c14,clientSecret:_0x20ead4,..._0x580da2}=_0x11afb1;await _0x1b7af2['LaQuv'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x580da2),{'mode':0x180});}async function saveCachedClient(_0x2300c8,_0xeafe68){const _0x23eb89=_0xb32d1b,_0x514a77={'CPVsa':function(_0x53cacb,_0x156e91,_0x5def90){return _0x53cacb(_0x156e91,_0x5def90);},'SJlMC':function(_0x5a0bcd){return _0x5a0bcd();},'wLlfy':function(_0x321ff5,_0x54386a,_0x26aa71,_0x32e94c){return _0x321ff5(_0x54386a,_0x26aa71,_0x32e94c);}},_0xc314ab=await loadCachedData(),_0x7dbc9a={..._0xc314ab,'origin':currentOrigin,'accessToken':_0xc314ab?.[_0x23eb89(0x1d3)]??'','clientId':_0x2300c8,'clientSecret':_0xeafe68};await _0x514a77['CPVsa'](mkdir,join(_0x514a77[_0x23eb89(0x169)](homedir),'.ranger'),{'recursive':!![]}),await _0x514a77[_0x23eb89(0x15f)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x7dbc9a),{'mode':0x180});}async function loadCachedData(){const _0x593bc1=_0xb32d1b,_0x19eadc={'gZatD':_0x593bc1(0x197)};try{return JSON[_0x593bc1(0x16d)](await readFile(TOKEN_CACHE_PATH,_0x19eadc['gZatD']));}catch{return null;}}async function parseResponse(_0x4d4f84){const _0x25aebb=_0xb32d1b,_0x35ee0f={'GleZU':_0x25aebb(0x14f),'AJUca':function(_0x483ab7,_0x4372d5){return _0x483ab7!==_0x4372d5;},'QOUtM':_0x25aebb(0x165)},_0x2348b0=_0x4d4f84['headers'][_0x25aebb(0x13a)]('content-type')??'';if(_0x2348b0[_0x25aebb(0x1c8)](_0x25aebb(0x144))){const _0x5299ec=await _0x4d4f84[_0x25aebb(0x191)]();for(const _0x27554f of _0x5299ec[_0x25aebb(0x154)]('\x0a')){const _0x2f3b92=_0x27554f['trim']();if(_0x2f3b92[_0x25aebb(0x168)](_0x35ee0f['GleZU'])){const _0x56b804=_0x2f3b92['slice'](_0x25aebb(0x14f)['length'])[_0x25aebb(0x1a0)]();if(!_0x56b804)continue;try{const _0x1be112=JSON[_0x25aebb(0x16d)](_0x56b804);if(_0x35ee0f[_0x25aebb(0x18a)](_0x1be112['id'],undefined)||_0x1be112[_0x25aebb(0x177)])return _0x1be112;}catch{}}}throw new Error(_0x35ee0f['QOUtM']);}return _0x4d4f84['json']();}function extractToken(_0x292d50){const _0x21b711=_0xb32d1b,_0x2ee72f={'gLnhT':'string','wiEiq':_0x21b711(0x1b3),'eTMLH':'text','jogFM':function(_0x2858fe,_0x271e48){return _0x2858fe===_0x271e48;}};if(!_0x292d50)return null;const _0x3a8e63=_0x292d50['structuredContent'];if(_0x3a8e63?.[_0x21b711(0x1cc)]&&typeof _0x3a8e63['token']===_0x2ee72f[_0x21b711(0x178)])return _0x3a8e63['token'];if(_0x292d50['isError']){const _0xa172bd=_0x292d50[_0x21b711(0x135)];throw new Error('Server\x20returned\x20error:\x20'+(_0xa172bd?.[0x0]?.['text']??_0x2ee72f['wiEiq']));}const _0x157538=_0x292d50['content'];if(_0x157538)for(const _0x3e0808 of _0x157538){if(_0x3e0808[_0x21b711(0x173)]===_0x2ee72f[_0x21b711(0x192)]&&_0x3e0808['text']){try{const _0x1d1ffd=JSON[_0x21b711(0x16d)](_0x3e0808['text']);if(_0x2ee72f['jogFM'](typeof _0x1d1ffd?.[_0x21b711(0x1cc)],_0x21b711(0x166)))return _0x1d1ffd['token'];}catch{}const _0xe307d8=_0x3e0808[_0x21b711(0x191)][_0x21b711(0x17f)](/(rngr_[A-Za-z0-9_-]+)/);if(_0xe307d8)return _0xe307d8[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x16b7(){var _0x1e4fc7=['18783sKhrmH','CvMVn','176oJrfbJ','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','RiuqR','10UVYtRE','788DEvIjc','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','1293042fLqdTm','624xzTjvV','7xCrORA','4vwvHwi','tuiwu','Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','2801985Nsyvhe','10001953oWGPdU','2195925XuQNKz','892001GaEgBx','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','12dPgTbx','WsgDl'];_0x16b7=function(){return _0x1e4fc7;};return _0x16b7();}(function(_0x46fc76,_0x582ba8){var _0x35afcf=_0x4a06,_0x40133a=_0x46fc76();while(!![]){try{var _0x530699=-parseInt(_0x35afcf(0x19b))/0x1*(parseInt(_0x35afcf(0x197))/0x2)+-parseInt(_0x35afcf(0x190))/0x3+parseInt(_0x35afcf(0x18b))/0x4*(parseInt(_0x35afcf(0x18e))/0x5)+-parseInt(_0x35afcf(0x19d))/0x6*(parseInt(_0x35afcf(0x18a))/0x7)+parseInt(_0x35afcf(0x19e))/0x8*(parseInt(_0x35afcf(0x195))/0x9)+parseInt(_0x35afcf(0x19a))/0xa*(-parseInt(_0x35afcf(0x191))/0xb)+parseInt(_0x35afcf(0x193))/0xc*(parseInt(_0x35afcf(0x18f))/0xd);if(_0x530699===_0x582ba8)break;else _0x40133a['push'](_0x40133a['shift']());}catch(_0x1f97e3){_0x40133a['push'](_0x40133a['shift']());}}}(_0x16b7,0x60597));function _0x4a06(_0x91a73b,_0x4878bb){_0x91a73b=_0x91a73b-0x18a;var _0x16b7bb=_0x16b7();var _0x4a0683=_0x16b7bb[_0x91a73b];return _0x4a0683;}export async function migrateProfile(_0x490b96,_0x4a1999){var _0xfa242c=_0x4a06,_0x401222={'OjsPh':function(_0x20d27d,_0x252f4b){return _0x20d27d+_0x252f4b;},'xjoMi':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','tuiwu':_0xfa242c(0x198),'WsgDl':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','RiuqR':_0xfa242c(0x18d),'CvMVn':'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'};console['error'](_0x401222['OjsPh'](_0x401222['xjoMi']+'\x0a'+_0xfa242c(0x19c)+_0x401222[_0xfa242c(0x18c)]+'\x0a'+_0x401222[_0xfa242c(0x194)],_0xfa242c(0x192))+'\x0a'+_0x401222[_0xfa242c(0x199)]+_0x401222[_0xfa242c(0x196)]),process['exit'](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b0b67,_0x19da6f){const _0x55c583=_0x1920,_0x143066=_0x1b0b67();while(!![]){try{const _0x351f39=parseInt(_0x55c583(0x9b))/0x1+-parseInt(_0x55c583(0xb1))/0x2*(parseInt(_0x55c583(0xbe))/0x3)+-parseInt(_0x55c583(0xcf))/0x4+-parseInt(_0x55c583(0xa2))/0x5*(-parseInt(_0x55c583(0xbd))/0x6)+parseInt(_0x55c583(0xc9))/0x7*(parseInt(_0x55c583(0xc8))/0x8)+parseInt(_0x55c583(0xb6))/0x9*(-parseInt(_0x55c583(0xc0))/0xa)+-parseInt(_0x55c583(0xb9))/0xb;if(_0x351f39===_0x19da6f)break;else _0x143066['push'](_0x143066['shift']());}catch(_0x42fa68){_0x143066['push'](_0x143066['shift']());}}}(_0x52fc,0x3fa05));function _0x1920(_0x45858e,_0x3e7d64){_0x45858e=_0x45858e-0x98;const _0x52fcb5=_0x52fc();let _0x192034=_0x52fcb5[_0x45858e];return _0x192034;}import{join}from'path';import{existsSync}from'fs';import _0x421cdc from'inquirer';function _0x52fc(){const _0x35f207=['\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','project','1983234VrsbkE','enable','list','pluginScope','524946CsvpTd','45AjFWNj','tMLWO','112570UNkByN','plugin','❌\x20Failed\x20to\x20add\x20marketplace:','WvwyZ','confirm','StTJo','Would\x20you\x20like\x20to\x20install\x20skills?','✓\x20Marketplace\x20already\x20added','1364312FlsAVX','21mARgYl','includes','install','push','success','FLyxc','130112WCRhxS','fUYHe','SKILL.md','vNiOH','log','246519AsthOW','BDMiT','zuLNJ','already\x20enabled','ranger','User\x20(available\x20in\x20all\x20your\x20projects)','⚠\x20Failed\x20to\x20enable\x20plugin:','5zCELMw','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','error','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','QqEoq','prompt','❌\x20Failed\x20to\x20install\x20plugin:','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','JxVIT','\x0aYou\x20can\x20install\x20manually\x20with:','.claude','dYPdJ','YZPZL','user','ranger-testing/trailhead','18106PkTDXI','output','SHZdZ','--scope','ranger@trailhead','189bqbRFb'];_0x52fc=function(){return _0x35f207;};return _0x52fc();}import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x285ed8){const _0x353009=_0x1920,_0x5092b3={'EwdFi':function(_0x3bb908){return _0x3bb908();},'KWRQm':_0x353009(0xa3),'fUYHe':_0x353009(0xa0),'FLyxc':_0x353009(0xb8),'BDMiT':'user','nUvwu':'trailhead','tMLWO':_0x353009(0xc7),'Eykik':_0x353009(0xc1),'JDKsd':'marketplace','zuLNJ':_0x353009(0xc2),'JxVIT':_0x353009(0xab),'shbdm':function(_0x33c952,_0x37a3ef,_0x89fd08){return _0x33c952(_0x37a3ef,_0x89fd08);},'WvwyZ':function(_0x58c9af,_0x2e7fa3){return _0x58c9af===_0x2e7fa3;},'TarKF':_0x353009(0xa8),'fbOki':_0x353009(0xba),'SHZdZ':'ranger@trailhead','QYcda':'✓\x20Claude\x20Code\x20plugin\x20enabled'},_0x7542d0=await isPluginInstalled('ranger@trailhead');if(_0x7542d0)return console['log'](_0x353009(0xa5)),![];const _0x37eb04=existsSync(join(_0x5092b3['EwdFi'](getProjectRoot),_0x353009(0xac)));let _0x89b301;if(_0x285ed8)_0x89b301=_0x285ed8;else{if(_0x37eb04)_0x89b301=_0x353009(0xb8);else{console[_0x353009(0x9a)](_0x5092b3['KWRQm']);const _0x435d24=await _0x421cdc[_0x353009(0xa7)]([{'type':_0x353009(0xbb),'name':'pluginScope','message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x5092b3[_0x353009(0xd0)],'value':_0x353009(0xaf)},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x5092b3['FLyxc']}],'default':_0x5092b3[_0x353009(0x9c)]}]);_0x89b301=_0x435d24[_0x353009(0xbc)];}}console[_0x353009(0x9a)](_0x353009(0xb7)+_0x89b301+'\x20level)...\x0a');const _0xf3aa1=await isMarketplaceAdded(_0x5092b3['nUvwu']);let _0x4a4019=_0xf3aa1;if(_0xf3aa1)console['log'](_0x5092b3[_0x353009(0xbf)]);else{const _0x2d9935=await runClaudeCommand([_0x5092b3['Eykik'],_0x5092b3['JDKsd'],'add',_0x353009(0xb0)]);!_0x2d9935[_0x353009(0xcd)]?(console['error'](_0x5092b3[_0x353009(0x9d)],_0x2d9935[_0x353009(0xa4)]),console[_0x353009(0x9a)](_0x5092b3[_0x353009(0xaa)]),console['log']('\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'),console[_0x353009(0x9a)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x89b301)):_0x4a4019=!![];}if(_0x4a4019){const _0x359225=await _0x5092b3['shbdm'](runClaudeCommand,[_0x353009(0xc1),_0x353009(0xcb),_0x353009(0xb5),_0x353009(0xb4),_0x89b301],{'cwd':_0x5092b3[_0x353009(0xc3)](_0x89b301,_0x5092b3[_0x353009(0xce)])?getProjectRoot():undefined});if(!_0x359225['success'])console['error'](_0x5092b3['TarKF'],_0x359225['error']),console['log'](_0x5092b3[_0x353009(0xaa)]),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x89b301);else{console['log'](_0x353009(0xa9));const _0xa4226c=[_0x353009(0xc1),_0x5092b3['fbOki'],_0x5092b3[_0x353009(0xb3)]];_0x89b301==='project'&&_0xa4226c[_0x353009(0xcc)]('--scope',_0x353009(0xb8));const _0x59c102=await runClaudeCommand(_0xa4226c,{'captureOutput':!![],'cwd':_0x89b301==='project'?_0x5092b3['EwdFi'](getProjectRoot):undefined}),_0x2c9795=_0x59c102[_0x353009(0xb2)]?.[_0x353009(0xca)](_0x353009(0x9e));!_0x59c102['success']&&!_0x2c9795?console[_0x353009(0xa4)](_0x353009(0xa1),_0x59c102['error']):console['log'](_0x5092b3['QYcda']);}}return!![];}export async function ensureClaudeSkills(_0x5dbd09){const _0x5641b8=_0x1920,_0x986e9={'dYPdJ':function(_0x142c8b,_0x16e1fb){return _0x142c8b(_0x16e1fb);},'QqEoq':function(_0x2b8436,_0x1fa8ea){return _0x2b8436(_0x1fa8ea);},'htdyU':'user','vNiOH':_0x5641b8(0x9f),'CBRxq':_0x5641b8(0x98),'ywdRb':function(_0x394f1e,_0x57b0ea){return _0x394f1e||_0x57b0ea;},'sSBrT':'✓\x20Ranger\x20skills\x20already\x20installed','PSaVc':function(_0x1edc5a,_0x3c23bc,_0x59b968){return _0x1edc5a(_0x3c23bc,_0x59b968);},'zAwTa':'.claude','YZPZL':_0x5641b8(0xc4),'StTJo':'wantsSkillup'},_0x2bed2a=_0x986e9[_0x5641b8(0xad)](existsSync,join(_0x986e9[_0x5641b8(0xa6)](getSkillsDir,_0x986e9['htdyU']),'ranger','SKILL.md')),_0x3be860=existsSync(join(_0x986e9[_0x5641b8(0xad)](getSkillsDir,_0x5641b8(0xb8)),_0x986e9[_0x5641b8(0x99)],_0x986e9['CBRxq']));if(_0x986e9['ywdRb'](_0x2bed2a,_0x3be860))return console['log'](_0x986e9['sSBrT']),![];const _0x407897=existsSync(_0x986e9['PSaVc'](join,getProjectRoot(),_0x986e9['zAwTa']));let _0x141baf=!![];if(_0x5dbd09)await _0x986e9[_0x5641b8(0xa6)](skillup,{'autoInstall':_0x5dbd09,'suppressUsage':!![]});else{if(_0x407897)await skillup({'autoInstall':_0x5641b8(0xb8),'suppressUsage':!![]});else{const _0x39033b=await _0x421cdc[_0x5641b8(0xa7)]([{'type':_0x986e9[_0x5641b8(0xae)],'name':_0x986e9[_0x5641b8(0xc5)],'message':_0x5641b8(0xc6),'default':!![]}]);_0x141baf=_0x39033b['wantsSkillup'],_0x141baf&&await _0x986e9[_0x5641b8(0xad)](skillup,{'suppressUsage':!![]});}}return _0x141baf;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1f76fd,_0x1e3c80){const _0x4f891b=_0x5188,_0x4cf8b7=_0x1f76fd();while(!![]){try{const _0x2a2098=parseInt(_0x4f891b(0xae))/0x1+parseInt(_0x4f891b(0xaa))/0x2+parseInt(_0x4f891b(0xb4))/0x3*(-parseInt(_0x4f891b(0xa3))/0x4)+-parseInt(_0x4f891b(0xb9))/0x5+-parseInt(_0x4f891b(0xb6))/0x6+parseInt(_0x4f891b(0xa7))/0x7+parseInt(_0x4f891b(0xbb))/0x8*(-parseInt(_0x4f891b(0xa6))/0x9);if(_0x2a2098===_0x1e3c80)break;else _0x4cf8b7['push'](_0x4cf8b7['shift']());}catch(_0x192b96){_0x4cf8b7['push'](_0x4cf8b7['shift']());}}}(_0x2965,0xa9696));import{join}from'path';import{existsSync}from'fs';function _0x2965(){const _0x597f35=['✓\x20OpenCode\x20plugin\x20configured','opencode.json','2920795GZpIeZ','Failed\x20to\x20read\x20opencode.json','27728IvyMSV','\x0a📦\x20OpenCode\x20Plugin\x0a','$schema','WBTcw','log','prompt','zHsqq','55716hKewqd','rQvxN','utf-8','9UZGABE','1675891uoyWxd','tRAky','includes','2279940bxDYTw','✓\x20OpenCode\x20plugin\x20already\x20configured','parse','UEAFK','1382269CKNxso','user','error','Where\x20should\x20the\x20plugin\x20be\x20installed?','SUjHD','https://opencode.ai/config.json','81PpDYJH','ySGDR','6624204PvyDgP'];_0x2965=function(){return _0x597f35;};return _0x2965();}import{mkdir,readFile,writeFile}from'fs/promises';import _0x2fff14 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';function _0x5188(_0x404a10,_0x57755f){_0x404a10=_0x404a10-0x9d;const _0x29656d=_0x2965();let _0x5188da=_0x29656d[_0x404a10];return _0x5188da;}export async function ensureOpencodePluginConfig(_0x460d0b){const _0x5087df=_0x5188,_0x235a19={'UEAFK':function(_0x4af438,_0x4d1194){return _0x4af438(_0x4d1194);},'FqdMe':function(_0x5192a0,_0x16166c,_0x14689f){return _0x5192a0(_0x16166c,_0x14689f);},'SUjHD':'project','WBTcw':'list','DmEry':'pluginScope','rcIKY':_0x5087df(0xb1),'ySGDR':_0x5087df(0xaf),'SHgFv':_0x5087df(0xb8),'zHsqq':'@ranger-testing/opencode-plugin','bYXnU':_0x5087df(0xb3),'lhLQu':function(_0x24e7b3,_0x3e6d42,_0x1bcc01){return _0x24e7b3(_0x3e6d42,_0x1bcc01);},'rQvxN':function(_0x4bd718,_0xe7ba,_0x39287d){return _0x4bd718(_0xe7ba,_0x39287d);},'tRAky':function(_0xf06d96,_0x576c57){return _0xf06d96+_0x576c57;}},_0x522d9b=_0x235a19[_0x5087df(0xad)](existsSync,_0x235a19['FqdMe'](join,getOpencodeConfigDir('project'),'opencode.json'));let _0x3f5c72;if(_0x460d0b)_0x3f5c72=_0x460d0b;else{if(_0x522d9b)_0x3f5c72=_0x235a19[_0x5087df(0xb2)];else{console['log'](_0x5087df(0x9d));const _0x189ac0=await _0x2fff14[_0x5087df(0xa1)]([{'type':_0x235a19[_0x5087df(0x9f)],'name':_0x235a19['DmEry'],'message':_0x235a19['rcIKY'],'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x235a19[_0x5087df(0xb5)]},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x235a19[_0x5087df(0xb2)]}],'default':'user'}]);_0x3f5c72=_0x189ac0['pluginScope'];}}const _0x34d3c5=_0x235a19['FqdMe'](join,getOpencodeConfigDir(_0x3f5c72),_0x235a19['SHgFv']),_0x4cd8de=_0x235a19[_0x5087df(0xa2)],_0x2804fa=_0x235a19['bYXnU'];let _0x3f74e4={};if(existsSync(_0x34d3c5))try{const _0x21deaf=await readFile(_0x34d3c5,_0x5087df(0xa5));_0x3f74e4=JSON[_0x5087df(0xac)](_0x21deaf);}catch(_0x2d7a8b){return console[_0x5087df(0xb0)]('⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.'),{'configured':![],'scope':_0x3f5c72,'error':_0x5087df(0xba),'details':_0x2d7a8b};}const _0x5bd211=Array['isArray'](_0x3f74e4['plugin'])?_0x3f74e4['plugin']:[];if(_0x5bd211[_0x5087df(0xa9)](_0x4cd8de))return console[_0x5087df(0xa0)](_0x5087df(0xab)),{'configured':![],'scope':_0x3f5c72};return _0x3f74e4['$schema']=_0x3f74e4[_0x5087df(0x9e)]||_0x2804fa,_0x3f74e4['plugin']=[..._0x5bd211,_0x4cd8de],await _0x235a19['lhLQu'](mkdir,getOpencodeConfigDir(_0x3f5c72),{'recursive':!![]}),await _0x235a19[_0x5087df(0xa4)](writeFile,_0x34d3c5,_0x235a19[_0x5087df(0xa8)](JSON['stringify'](_0x3f74e4,null,0x2),'\x0a')),console[_0x5087df(0xa0)](_0x5087df(0xb7)),{'configured':!![],'scope':_0x3f5c72};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x186d(){var _0x3a1005=['1772960NHOMXb','562512nVwDZi','EayRV','88101NJpkNe','12hEclvR','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','247518gZVvXa','67296yhUzoE','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','UbeUt','690dLtdnk','422440fWeDXX','150uFxhHx','37295kbsvNv'];_0x186d=function(){return _0x3a1005;};return _0x186d();}function _0x226d(_0x105427,_0x14d551){_0x105427=_0x105427-0x184;var _0x186daf=_0x186d();var _0x226de5=_0x186daf[_0x105427];return _0x226de5;}(function(_0xd3df27,_0x8a4d8f){var _0x417e18=_0x226d,_0x295ba0=_0xd3df27();while(!![]){try{var _0x3b77f3=-parseInt(_0x417e18(0x18c))/0x1+-parseInt(_0x417e18(0x190))/0x2+parseInt(_0x417e18(0x18b))/0x3*(-parseInt(_0x417e18(0x188))/0x4)+parseInt(_0x417e18(0x192))/0x5*(-parseInt(_0x417e18(0x191))/0x6)+parseInt(_0x417e18(0x184))/0x7+-parseInt(_0x417e18(0x185))/0x8+parseInt(_0x417e18(0x187))/0x9*(parseInt(_0x417e18(0x18f))/0xa);if(_0x3b77f3===_0x8a4d8f)break;else _0x295ba0['push'](_0x295ba0['shift']());}catch(_0x3c5489){_0x295ba0['push'](_0x295ba0['shift']());}}}(_0x186d,0x239ea));export async function setupCi(_0xc2497b,_0x398d41,_0x4f39d9){var _0x45a56a=_0x226d,_0x38ad42={'UbeUt':function(_0x266302,_0x1aedfd){return _0x266302+_0x1aedfd;},'EayRV':_0x45a56a(0x18a),'VPsCC':_0x45a56a(0x18d),'HKpCD':_0x45a56a(0x189),'uQBnp':'\x20\x20https://docs.ranger.net/main/concepts/profiles'};console['error'](_0x38ad42['UbeUt'](_0x38ad42[_0x45a56a(0x18e)](_0x38ad42[_0x45a56a(0x18e)](_0x38ad42[_0x45a56a(0x186)],'\x0a')+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a',_0x38ad42['VPsCC'])+'\x0a'+_0x38ad42['HKpCD'],_0x38ad42['uQBnp'])),process['exit'](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x362d6c,_0x3ea506){const _0x2b6538=_0x4950,_0x4d9407=_0x362d6c();while(!![]){try{const _0x2f0f5b=parseInt(_0x2b6538(0x17e))/0x1+-parseInt(_0x2b6538(0x186))/0x2*(-parseInt(_0x2b6538(0x17a))/0x3)+-parseInt(_0x2b6538(0x197))/0x4*(parseInt(_0x2b6538(0x192))/0x5)+-parseInt(_0x2b6538(0x172))/0x6+parseInt(_0x2b6538(0x182))/0x7+-parseInt(_0x2b6538(0x18a))/0x8*(parseInt(_0x2b6538(0x199))/0x9)+-parseInt(_0x2b6538(0x16a))/0xa*(parseInt(_0x2b6538(0x185))/0xb);if(_0x2f0f5b===_0x3ea506)break;else _0x4d9407['push'](_0x4d9407['shift']());}catch(_0x207a57){_0x4d9407['push'](_0x4d9407['shift']());}}}(_0x40cb,0xbc6c3));import{basename}from'path';import _0x1bc068 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';function _0x4950(_0x987384,_0x39c9b0){_0x987384=_0x987384-0x168;const _0x40cbf4=_0x40cb();let _0x4950e1=_0x40cbf4[_0x987384];return _0x4950e1;}function _0x40cb(){const _0xa0637f=['\x20successfully!\x0a','WgZFz','\x20<your-api-token>','248KRbAVD','\x20skill','DVcrn','/skills/','Where\x20should\x20skills\x20be\x20installed?','\x0a📦\x20Installing\x20skills...\x0a','✓\x20Found\x20API\x20token','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','335kZBAqz','project-level','user-level','autoInstall','log','22036OlQyio','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','109503gHYqhH','TMfoH','\x20\x202.\x20Run:\x20ranger\x20setup','prompt','list','/.claude/skills/','All\x20projects\x20(','installLevel','120ganixi','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','user','yfkaj','To\x20use:','xTKQj','WfHZT','\x20\x203.\x20Run:\x20ranger\x20skillup','8594298lIPxZQ','\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!','opencode','YFNxf','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','stdout','/.opencode/skills/','platform','3ruryBb','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','xfMRN','TIzQX','1333688vJOWJV','\x20--opencode','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','project','10266046wOJGdU','stdin','uwYNv','488994eBCszQ','1367248oEWHgj'];_0x40cb=function(){return _0xa0637f;};return _0x40cb();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x3f656e={}){const _0x4d73df=_0x4950,_0x3c89df={'WfHZT':'4|3|1|2|0|5','ShSNu':_0x4d73df(0x16b),'LytBj':_0x4d73df(0x17f),'lzqnH':'To\x20get\x20started:','oeAXo':_0x4d73df(0x180),'TMfoH':function(_0x14a241){return _0x14a241();},'xKVEW':_0x4d73df(0x174),'uwYNv':function(_0x3b19e5){return _0x3b19e5();},'DVcrn':function(_0x38cf8b,_0x110283){return _0x38cf8b===_0x110283;},'ooSgo':_0x4d73df(0x19d),'lvFwb':_0x4d73df(0x169),'yfkaj':_0x4d73df(0x18e),'xfMRN':_0x4d73df(0x181),'WgZFz':function(_0x4b4134){return _0x4b4134();},'TIzQX':_0x4d73df(0x18f),'YFNxf':function(_0x1da60a,_0x54a5b9,_0xb89b30){return _0x1da60a(_0x54a5b9,_0xb89b30);},'EdFgw':'ranger','xTKQj':_0x4d73df(0x193)};console['log'](_0x4d73df(0x191));const _0x519b5b=_0x3f656e[_0x4d73df(0x179)]??'claude',_0x3231d1=await getToken();if(!_0x3231d1){const _0x2f86bc=_0x3c89df[_0x4d73df(0x170)]['split']('|');let _0x157757=0x0;while(!![]){switch(_0x2f86bc[_0x157757++]){case'0':console[_0x4d73df(0x196)](_0x4d73df(0x171)+(_0x519b5b==='opencode'?'\x20--opencode':'')+'\x0a');continue;case'1':console[_0x4d73df(0x196)](_0x3c89df['ShSNu']);continue;case'2':console[_0x4d73df(0x196)](_0x4d73df(0x19b)+(_0x519b5b===_0x4d73df(0x174)?_0x3c89df['LytBj']:'')+_0x4d73df(0x189));continue;case'3':console[_0x4d73df(0x196)](_0x3c89df['lzqnH']);continue;case'4':console['log'](_0x3c89df['oeAXo']);continue;case'5':return;}break;}}console[_0x4d73df(0x196)](_0x4d73df(0x190));const _0x1f1d76=_0x3c89df[_0x4d73df(0x19a)](getProjectRoot),_0x4230c5=basename(_0x1f1d76),_0x49573f=_0x519b5b===_0x3c89df['xKVEW']?getOpencodeConfigDir(_0x4d73df(0x16c))+_0x4d73df(0x18d):_0x3c89df[_0x4d73df(0x184)](getClaudeConfigDir)+_0x4d73df(0x18d),_0x1df843=_0x3c89df['DVcrn'](_0x519b5b,_0x4d73df(0x174))?_0x1f1d76+_0x4d73df(0x178):_0x1f1d76+_0x4d73df(0x19e),_0x43b8d0=process[_0x4d73df(0x183)]['isTTY']&&process[_0x4d73df(0x177)]['isTTY'];let _0x18b551;if(_0x3f656e['autoInstall'])_0x18b551=_0x3f656e[_0x4d73df(0x195)];else{if(_0x43b8d0){const _0x56a135=await _0x1bc068[_0x4d73df(0x19c)]([{'type':_0x3c89df['ooSgo'],'name':_0x3c89df['lvFwb'],'message':_0x3c89df[_0x4d73df(0x16d)],'choices':[{'name':_0x4d73df(0x168)+_0x49573f+')','value':_0x4d73df(0x16c)},{'name':'This\x20project\x20only\x20('+_0x1df843+')','value':_0x3c89df[_0x4d73df(0x17c)]}]}]);_0x18b551=_0x56a135[_0x4d73df(0x169)];}else _0x18b551=_0x3c89df[_0x4d73df(0x17c)],console['log'](_0x4d73df(0x176)+_0x1df843+')');}let _0xbebb6a=0x0;const _0x123ada=_0x3c89df[_0x4d73df(0x188)](getCurrentVersion);console['log'](_0x3c89df[_0x4d73df(0x17d)]);try{const _0x43901a=await _0x3c89df[_0x4d73df(0x175)](installSkill,_0x3c89df['EdFgw'],{'cliVersion':_0x123ada,'level':_0x18b551,'platform':_0x519b5b});_0x43901a&&_0xbebb6a++;}catch(_0x4fe501){console['warn'](_0x4d73df(0x198),_0x4fe501 instanceof Error?_0x4fe501['message']:_0x4fe501);}if(_0xbebb6a>0x0){const _0xff202e=_0x18b551===_0x4d73df(0x16c)?_0x4d73df(0x194):_0x3c89df[_0x4d73df(0x16f)];console[_0x4d73df(0x196)]('\x0a✅\x20Installed\x20'+_0xbebb6a+'\x20'+_0xff202e+_0x4d73df(0x18b)+(_0xbebb6a>0x1?'s':'')+_0x4d73df(0x187)),!_0x3f656e['suppressUsage']&&(console[_0x4d73df(0x196)](_0x4d73df(0x16e)),_0x3c89df[_0x4d73df(0x18c)](_0x519b5b,_0x4d73df(0x174))?console[_0x4d73df(0x196)]('\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.'):console['log'](_0x4d73df(0x173)));}else console['log'](_0x4d73df(0x17b));}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0xa805c9=_0x4c83;(function(_0x4e5b5d,_0x581b5b){const _0x2ea9ad=_0x4c83,_0x2aba70=_0x4e5b5d();while(!![]){try{const _0x2cd98f=-parseInt(_0x2ea9ad(0x188))/0x1*(parseInt(_0x2ea9ad(0x18b))/0x2)+parseInt(_0x2ea9ad(0x1dc))/0x3+-parseInt(_0x2ea9ad(0x192))/0x4+parseInt(_0x2ea9ad(0x1db))/0x5+parseInt(_0x2ea9ad(0x1e1))/0x6*(-parseInt(_0x2ea9ad(0x1bc))/0x7)+-parseInt(_0x2ea9ad(0x199))/0x8+parseInt(_0x2ea9ad(0x1d8))/0x9;if(_0x2cd98f===_0x581b5b)break;else _0x2aba70['push'](_0x2aba70['shift']());}catch(_0x2acc2f){_0x2aba70['push'](_0x2aba70['shift']());}}}(_0x469e,0x23f58));import{mkdir,writeFile}from'fs/promises';function _0x4c83(_0x1f6214,_0x3a8c49){_0x1f6214=_0x1f6214-0x183;const _0x469ebb=_0x469e();let _0x4c83ae=_0x469ebb[_0x1f6214];return _0x4c83ae;}import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x3f733a from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0xa805c9(0x1b5);const bold=_0x53490b=>_0xa805c9(0x184)+_0x53490b+_0xa805c9(0x1c4);export function getPlaywrightVersion(){const _0x458870=_0xa805c9,_0x576c28={'MoXke':_0x458870(0x1a5),'QpAhO':function(_0x113f21,_0x2c3c8d){return _0x113f21(_0x2c3c8d);}};try{const _0xd74059=require['resolve'](_0x576c28[_0x458870(0x1d2)]),_0x26a044=_0x576c28[_0x458870(0x1cd)](require,_0xd74059);return _0x26a044[_0x458870(0x1b7)];}catch{return null;}}export function installChromiumBinary(_0x311010,_0x39e6e0=![]){const _0x4767ad=_0xa805c9,_0x410437={'hCQXf':'install','QSaCB':'--with-deps','SjSas':'ignore','PNKoS':_0x4767ad(0x1bf)};return new Promise((_0x3ac96a,_0x448049)=>{const _0x2263c2=_0x4767ad,_0x310e1b={'xMgXy':function(_0x1220b0,_0x5159e2){return _0x1220b0(_0x5159e2);}},_0x12e95e=['playwright@'+_0x311010,_0x410437['hCQXf'],..._0x39e6e0?[_0x410437[_0x2263c2(0x1a8)]]:[],_0x2263c2(0x1c2)],_0x372ce2=spawn('npx',_0x12e95e,{'stdio':[_0x410437['SjSas'],_0x2263c2(0x1bf),_0x410437[_0x2263c2(0x18a)]],'shell':process['platform']===_0x2263c2(0x1f9)});_0x372ce2['on'](_0x2263c2(0x1a1),_0x143211=>{const _0x73c1aa=_0x2263c2;_0x143211===0x0?_0x3ac96a():_0x448049(new Error(_0x73c1aa(0x1af)+_0x143211));}),_0x372ce2['on']('error',_0x41fe68=>{_0x310e1b['xMgXy'](_0x448049,_0x41fe68);});});}export async function authenticate(_0x47ee4){const _0x34cb20=_0xa805c9,_0xcb2d2b={'bniuT':'existing_token','oBpzD':function(_0x5072c9,_0x4f95c7){return _0x5072c9 instanceof _0x4f95c7;},'SSpyV':function(_0x292d3a,_0x10e5cc){return _0x292d3a(_0x10e5cc);},'JIXMH':function(_0x42d561,_0x22fabe){return _0x42d561(_0x22fabe);},'sySlI':_0x34cb20(0x1b9)};if(!_0x47ee4){const _0x23332b=await getToken();if(_0x23332b){const _0xd0d141=await getCurrentUser(_0x23332b);if(_0xd0d141['success'])return console[_0x34cb20(0x1f3)]('✓\x20Already\x20authenticated\x20to\x20'+_0xd0d141[_0x34cb20(0x1bb)]['organizationName']),{'token':_0x23332b,'method':_0xcb2d2b['bniuT']};}try{_0x47ee4=await runDeviceAuthFlow();}catch(_0xfea41b){throw new Error(_0x34cb20(0x1c8)+(_0xcb2d2b[_0x34cb20(0x1f2)](_0xfea41b,Error)?_0xfea41b[_0x34cb20(0x1c3)]:_0xfea41b));}const _0x1dcbc2=await _0xcb2d2b['SSpyV'](getCurrentUser,_0x47ee4);if(!_0x1dcbc2['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x1dcbc2['error']);return console['log']('✓\x20Authenticated\x20to\x20'+_0x1dcbc2[_0x34cb20(0x1bb)]['organizationName']),{'token':_0x47ee4,'method':_0x34cb20(0x1f6)};}console[_0x34cb20(0x1f3)](_0x34cb20(0x1ef));const _0x35f7db=await _0xcb2d2b[_0x34cb20(0x1ba)](getCurrentUser,_0x47ee4);if(!_0x35f7db['success']){if(_0x35f7db[_0x34cb20(0x1ce)])throw new Error(_0x34cb20(0x1c8)+_0x35f7db[_0x34cb20(0x1c0)]+_0x34cb20(0x1c9));else throw new Error(_0x34cb20(0x1f0)+_0x35f7db['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x34cb20(0x1f3)]('✓\x20Authenticated\x20to\x20'+_0x35f7db['user']['organizationName']),await _0xcb2d2b['JIXMH'](storeToken,_0x47ee4),console['log'](process[_0x34cb20(0x1cf)]['GITHUB_ENV']?_0x34cb20(0x1e5):_0x34cb20(0x1a7)),{'token':_0x47ee4,'method':_0xcb2d2b['sySlI']};}export async function ensureRangerDir(_0x2020a6){const _0x587770=_0xa805c9,_0x329e74={'BqykY':function(_0x55a575){return _0x55a575();},'LexNH':_0x587770(0x196),'GQXFL':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x2020a6;const _0x28133e=_0x329e74['BqykY'](getRangerHomeDir);return!existsSync(_0x28133e)?(await mkdir(_0x28133e,{'recursive':!![]}),console['log'](_0x329e74[_0x587770(0x1e4)]),{'path':_0x28133e,'installed':!![]}):(console['log'](_0x329e74['GQXFL']),{'path':_0x28133e,'installed':![]});}export async function ensureChromium(_0x228df9=![]){const _0x48a9db=_0xa805c9,_0x4bc9e4={'oNDWw':function(_0xace3ed,_0x48cbe4){return _0xace3ed(_0x48cbe4);},'BIqCF':_0x48a9db(0x19a),'ExsUn':function(_0x189a06,_0x217000){return _0x189a06??_0x217000;},'aTyxt':_0x48a9db(0x1a2),'ScMlB':_0x48a9db(0x195),'nvoWP':_0x48a9db(0x1ac),'kcTzm':_0x48a9db(0x1a3),'gzaKZ':_0x48a9db(0x1d7)};let _0x556217=![];try{const _0x5d5972=chromium[_0x48a9db(0x197)]();_0x556217=_0x4bc9e4['oNDWw'](existsSync,_0x5d5972);}catch{_0x556217=![];}if(_0x556217)return console[_0x48a9db(0x1f3)](_0x4bc9e4['BIqCF']),![];const _0x3b531b=getPlaywrightVersion(),_0x1449b2=_0x4bc9e4[_0x48a9db(0x1f5)](_0x3b531b,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x10daa5=!_0x3b531b,_0x45d84b=process['stdin'][_0x48a9db(0x1ab)]&&process['stdout']['isTTY'];let _0x52c8b5=!![];if(_0x45d84b){const {install:_0x479703}=await _0x3f733a['prompt']([{'type':_0x4bc9e4['aTyxt'],'name':_0x4bc9e4[_0x48a9db(0x1c6)],'message':_0x10daa5?_0x48a9db(0x1a9)+_0x1449b2+_0x48a9db(0x1da):'The\x20required\x20version\x20('+_0x1449b2+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x52c8b5=_0x479703;}else console[_0x48a9db(0x1f3)](_0x48a9db(0x186)+_0x1449b2+(_0x10daa5?'\x20(fallback\x20version)':'')+_0x48a9db(0x1c1));if(_0x52c8b5){console[_0x48a9db(0x1f3)](_0x4bc9e4[_0x48a9db(0x1df)]);try{await installChromiumBinary(_0x1449b2,_0x228df9),console[_0x48a9db(0x1f3)](_0x4bc9e4[_0x48a9db(0x1e7)]);}catch(_0xe01bd8){console['error'](_0x48a9db(0x18e),_0xe01bd8 instanceof Error?_0xe01bd8['message']:_0xe01bd8),console['log'](_0x48a9db(0x1b3)),console['log']('\x20\x20npx\x20playwright@'+_0x1449b2+_0x48a9db(0x19f));}}else console[_0x48a9db(0x1f3)](_0x4bc9e4[_0x48a9db(0x185)]),console[_0x48a9db(0x1f3)]('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console[_0x48a9db(0x1f3)](_0x48a9db(0x1c5)+_0x1449b2+'\x20install\x20chromium');return!![];}function _0x469e(){const _0x1a36b3=['Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','mOqWM','isTTY','\x0aInstalling\x20Chromium\x20browser...\x0a','scope','trackPhaseEnd','Installation\x20failed\x20with\x20exit\x20code\x20','rgxOA','auth','Mpwqm','You\x20can\x20install\x20it\x20manually\x20by\x20running:','allowInsecureLocalhost','1.58.2','yFiUF','version','mUgQE','provided_token','SSpyV','user','28vbmvpv','GPofa','\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','inherit','error','...','chromium','message','\x1b[0m','\x20\x20npx\x20playwright@','ScMlB','.gitignore','Authentication\x20failed:\x20','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','\x0aIn\x20Claude\x20Code,\x20run\x20','JepNz','QpAhO','status','env','flcHh','HcShL','MoXke','mtQUg','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','skills','ranger\x20profile\x20add\x20<name>','\x0a⚠\x20Skipping\x20Chromium\x20installation.','2201589KqFezU','\x0a\x20\x20','\x20now?','406990qPoKrB','403233zdayxI','KcSrP','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','nvoWP','tQlGR','6834nMRlML','YntsF','\x0a🚀\x20Ranger\x20Setup\x0a','LexNH','✓\x20Exported\x20credentials\x20for\x20CI','exit','kcTzm','HgajJ','ranger\x20setup\x20--scope=','TVEPs','lcrMf','skipped','GHHJw','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','Validating\x20API\x20token...','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','withDeps','oBpzD','log','ready','ExsUn','device_auth','fZCGT','siQTF','win32','trackPhaseStart','\x1b[1m','gzaKZ','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','warn','1LrFrsR','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','PNKoS','8618mCHRBT','iahGN','skipAuth','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','url','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','585696jhjTLe','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','opencode','install','✓\x20Created\x20~/.ranger/\x20directory','executablePath','sWwur','1262824rsTXti','✓\x20Playwright\x20Chromium\x20browser\x20found','✓\x20Skipping\x20authentication\x20(--skip-auth)','skipChromium','/ranger:enable','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','\x20install\x20chromium','DRSbM','close','confirm','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','Npbzi','playwright/package.json','plugin','✓\x20Stored\x20credentials\x20locally','QSaCB'];_0x469e=function(){return _0x1a36b3;};return _0x469e();}export async function writeRangerGitignore(_0x5d8012){const _0x18578e=_0xa805c9,_0x4b4cf1={'tQlGR':function(_0x5aa614,_0x41bc22,_0x24e785){return _0x5aa614(_0x41bc22,_0x24e785);},'YntsF':_0x18578e(0x1c7),'HqzqV':function(_0x1268da,_0xc93452,_0x47a797){return _0x1268da(_0xc93452,_0x47a797);},'TKODa':'✓\x20Created\x20.ranger/.gitignore'},_0x4a9d00=_0x4b4cf1[_0x18578e(0x1e0)](join,_0x5d8012,_0x4b4cf1[_0x18578e(0x1e2)]),_0x21b778=_0x18578e(0x1be);await _0x4b4cf1['HqzqV'](writeFile,_0x4a9d00,_0x21b778),console[_0x18578e(0x1f3)](_0x4b4cf1['TKODa']);}export async function ensureLocalEnv(_0xc8dc42,_0x4fb003){const _0x134eca=_0xa805c9,_0x17c479={'HgajJ':function(_0x584247,_0x4681a1){return _0x584247!==_0x4681a1;},'HcShL':'⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','Npbzi':function(_0x4d17a7){return _0x4d17a7();},'rgxOA':function(_0x15641d,_0x55d256,_0x4f6c79){return _0x15641d(_0x55d256,_0x4f6c79);},'JepNz':'local','DxNAc':'✓\x20Local\x20profile\x20already\x20exists','fZCGT':function(_0x263839,_0x377ed7,_0x1d4aa4,_0x10d27a){return _0x263839(_0x377ed7,_0x1d4aa4,_0x10d27a);},'Mpwqm':'\x0a❌\x20Profile\x20setup\x20failed:'};if(!findGitRoot()&&_0x17c479[_0x134eca(0x1e8)](_0xc8dc42?.['scope'],'user'))return console[_0x134eca(0x1f3)](_0x17c479[_0x134eca(0x1d1)]),{'ready':![],'skipped':!![]};const _0x4ea1d8=_0xc8dc42?.[_0x134eca(0x1ad)]===_0x134eca(0x1bb)?_0x17c479[_0x134eca(0x1a4)](getRangerHomeDir):undefined;if(_0x17c479[_0x134eca(0x1b0)](findExistingEnv,_0x17c479[_0x134eca(0x1cc)],{'locations':[_0x17c479[_0x134eca(0x1cc)]],'rangerDir':_0x4ea1d8}))return console['log'](_0x17c479['DxNAc']),{'ready':!![],'skipped':![]};try{return await _0x17c479[_0x134eca(0x1f7)](addEnv,_0x17c479[_0x134eca(0x1cc)],{'url':_0xc8dc42?.['url'],'force':_0xc8dc42?.['force'],'allowInsecureLocalhost':_0xc8dc42?.[_0x134eca(0x1b4)],'scope':_0xc8dc42?.['scope']},_0x4fb003),{'ready':!![],'skipped':![]};}catch(_0x57212b){return console['error'](_0x17c479[_0x134eca(0x1b2)],_0x57212b instanceof Error?_0x57212b['message']:_0x57212b),{'ready':![],'skipped':![]};}}export async function start(_0x108894,_0x2fb59d,_0x145817){const _0x419a69=_0xa805c9,_0x3ca093={'aLqmW':function(_0x2e80cb,_0x39f897){return _0x2e80cb!==_0x39f897;},'flcHh':function(_0x4ff555,_0x38cd28){return _0x4ff555+_0x38cd28;},'siQTF':function(_0xb16a6,_0x68c990){return _0xb16a6+_0x68c990;},'mOqWM':function(_0xb9e1d6,_0x2a3b61){return _0xb9e1d6(_0x2a3b61);},'KcSrP':function(_0xe6c22f){return _0xe6c22f();},'CyUvs':function(_0x3ca48d,_0x63d865){return _0x3ca48d(_0x63d865);},'YREdc':_0x419a69(0x1ec),'GHHJw':_0x419a69(0x1b1),'KDIUi':_0x419a69(0x1c2),'lcrMf':function(_0x2ac38d,_0x4ec088){return _0x2ac38d(_0x4ec088);},'BdtMe':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','eeEsV':_0x419a69(0x1a6),'mUgQE':function(_0x20d7ae,_0x5a8911,_0x48825c){return _0x20d7ae(_0x5a8911,_0x48825c);},'mWEOH':'ranger','TAUxz':_0x419a69(0x1d5),'JpXju':_0x419a69(0x1de),'TPgbZ':'\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','iahGN':'profile','mtQUg':_0x419a69(0x1d6),'DRSbM':_0x419a69(0x193),'GPofa':_0x419a69(0x191),'sWwur':function(_0x4d7393,_0x35a0ec){return _0x4d7393(_0x35a0ec);},'yFiUF':function(_0x31a8dd,_0xa2cbe6){return _0x31a8dd+_0xa2cbe6;},'TVEPs':function(_0x4fc531,_0x778ffd){return _0x4fc531+_0x778ffd;}};console[_0x419a69(0x1f3)](_0x419a69(0x1e3));_0x2fb59d?.[_0x419a69(0x1ad)]!==undefined&&_0x3ca093['aLqmW'](_0x2fb59d[_0x419a69(0x1ad)],_0x419a69(0x1bb))&&(console['error'](_0x3ca093[_0x419a69(0x1d0)](_0x3ca093[_0x419a69(0x1f8)](_0x419a69(0x1e9)+_0x3ca093[_0x419a69(0x1aa)](String,_0x2fb59d['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[_0x419a69(0x1e6)](0x1));_0x2fb59d={..._0x2fb59d,'scope':'user'};const _0x285143=!existsSync(_0x3ca093['KcSrP'](getRangerHomeDir));await _0x3ca093['CyUvs'](ensureRangerDir,'user');if(_0x2fb59d?.[_0x419a69(0x18d)])console['log'](_0x419a69(0x19b)),_0x145817?.['trackPhaseEnd']('auth',{'isFirstRun':_0x285143,'method':_0x3ca093['YREdc']});else{_0x145817?.[_0x419a69(0x183)](_0x3ca093[_0x419a69(0x1ed)]);const _0x533f7b=await authenticate(_0x108894);_0x145817?.[_0x419a69(0x1ae)](_0x3ca093[_0x419a69(0x1ed)],{'isFirstRun':_0x285143,'method':_0x533f7b['method']});}_0x145817?.[_0x419a69(0x183)](_0x3ca093['KDIUi']);_0x2fb59d?.[_0x419a69(0x19c)]?console['log']('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await _0x3ca093['lcrMf'](ensureChromium,_0x2fb59d?.[_0x419a69(0x1f1)]);_0x145817?.[_0x419a69(0x1ae)](_0x419a69(0x1c2),{'isFirstRun':_0x285143,'skipped':!!_0x2fb59d?.['skipChromium']}),console[_0x419a69(0x1f3)](_0x3ca093['BdtMe']);const _0x1b3583=_0x2fb59d?.['scope'],_0x44f6cc=_0x2fb59d?.['opencode']??![];let _0x5346f5=null;_0x44f6cc?(_0x145817?.[_0x419a69(0x183)]('plugin'),_0x5346f5=await _0x3ca093[_0x419a69(0x1eb)](ensureOpencodePluginConfig,_0x1b3583),_0x145817?.['trackPhaseEnd'](_0x419a69(0x1a6),{'isFirstRun':_0x285143,'opencode':!![]})):(_0x145817?.['trackPhaseStart']('plugin'),await _0x3ca093[_0x419a69(0x1aa)](ensureClaudePlugin,_0x1b3583),_0x145817?.['trackPhaseEnd'](_0x3ca093['eeEsV'],{'isFirstRun':_0x285143}));if(_0x44f6cc&&_0x5346f5){_0x145817?.[_0x419a69(0x183)]('skills');try{await _0x3ca093['mUgQE'](installSkill,_0x3ca093['mWEOH'],{'level':_0x5346f5[_0x419a69(0x1ad)],'cliVersion':_0x3ca093[_0x419a69(0x1dd)](getCurrentVersion),'platform':_0x419a69(0x194)}),_0x145817?.[_0x419a69(0x1ae)](_0x3ca093['TAUxz'],{'isFirstRun':_0x285143,'opencode':!![]});}catch(_0x5ce35b){console[_0x419a69(0x187)](_0x3ca093['JpXju'],_0x5ce35b instanceof Error?_0x5ce35b[_0x419a69(0x1c3)]:_0x5ce35b),_0x145817?.['trackPhaseEnd']('skills',{'isFirstRun':_0x285143,'opencode':!![],'failed':!![]});}}else _0x145817?.['trackPhaseStart']('skills'),await _0x3ca093[_0x419a69(0x1aa)](ensureClaudeSkills,_0x1b3583),_0x145817?.['trackPhaseEnd'](_0x3ca093['TAUxz'],{'isFirstRun':_0x285143});if(_0x2fb59d?.[_0x419a69(0x18d)])console[_0x419a69(0x1f3)](_0x3ca093['TPgbZ']);else{if(_0x2fb59d?.['url']){_0x145817?.['trackPhaseStart'](_0x3ca093[_0x419a69(0x18c)]);const _0x32c055=await _0x3ca093[_0x419a69(0x1b8)](ensureLocalEnv,{'url':_0x2fb59d[_0x419a69(0x18f)],'force':_0x2fb59d?.['force'],'allowInsecureLocalhost':_0x2fb59d?.[_0x419a69(0x1b4)],'scope':'user'},_0x145817);_0x145817?.[_0x419a69(0x1ae)](_0x3ca093['iahGN'],{'isFirstRun':_0x285143,'profileReady':_0x32c055[_0x419a69(0x1f4)],'userSkipped':_0x32c055['skipped']});}else console['log'](_0x3ca093[_0x419a69(0x1d0)](_0x419a69(0x189),_0x419a69(0x1d9)+bold(_0x3ca093[_0x419a69(0x1d3)]))+_0x419a69(0x19e)+_0x419a69(0x1ca)+'\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles');}if(_0x44f6cc)console[_0x419a69(0x1f3)](_0x419a69(0x1d4)),console['log']('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console[_0x419a69(0x1f3)](_0x3ca093[_0x419a69(0x1a0)]),console[_0x419a69(0x1f3)](_0x3ca093[_0x419a69(0x1bd)]);else{const _0x299034=_0x3ca093[_0x419a69(0x198)](bold,_0x419a69(0x19d));console['log'](_0x3ca093[_0x419a69(0x1b6)](_0x3ca093[_0x419a69(0x1ea)](_0x419a69(0x1cb)+_0x299034+'\x20and\x20prompt\x20the\x20coding',_0x419a69(0x190)),'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser')+_0x419a69(0x1ee));}}
|
|
1
|
+
const _0x234b51=_0x5494;(function(_0x22b581,_0x25ff83){const _0x400124=_0x5494,_0x5f1fef=_0x22b581();while(!![]){try{const _0xeb5ddf=parseInt(_0x400124(0x214))/0x1+-parseInt(_0x400124(0x1f7))/0x2*(parseInt(_0x400124(0x1e2))/0x3)+-parseInt(_0x400124(0x212))/0x4+-parseInt(_0x400124(0x204))/0x5+-parseInt(_0x400124(0x1f1))/0x6+parseInt(_0x400124(0x22c))/0x7+parseInt(_0x400124(0x224))/0x8*(parseInt(_0x400124(0x21d))/0x9);if(_0xeb5ddf===_0x25ff83)break;else _0x5f1fef['push'](_0x5f1fef['shift']());}catch(_0x382577){_0x5f1fef['push'](_0x5f1fef['shift']());}}}(_0x424f,0x277e1));function _0x424f(){const _0x1eab35=['wnCfT','skipped','message','device_auth','\x20\x20npx\x20playwright@','inherit','.gitignore','\x0aIn\x20Claude\x20Code,\x20run\x20','win32','294590HHQoIp','isTTY','allowInsecureLocalhost','ignore','✓\x20Created\x20~/.ranger/\x20directory','plugin','/ranger:enable','knvnN','scope','skipAuth','GbQMO','GITHUB_ENV','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','log','1026860MJoIzT','platform','29529coryyO','✓\x20Skipping\x20authentication\x20(--skip-auth)','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','✓\x20Authenticated\x20to\x20','url','pcrXr','\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','\x20(fallback\x20version)','method','6884244ZjdVut','opencode','skipChromium','profile','success','npx','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','8pTTtkj','Gcvpy','skills','\x20now?','DBxPq','CkBrr','qVTNM','user','1770006ZKMEPO','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','\x0a\x20\x20','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','wGxzy','✓\x20Playwright\x20Chromium\x20browser\x20found','trackPhaseEnd','asATg','1.58.2','stdin','force','auth','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','\x0a❌\x20Profile\x20setup\x20failed:','ranger\x20profile\x20add\x20<name>','cneyS','MWmtC','6zDnFWO','✓\x20Already\x20authenticated\x20to\x20','dovjL','✓\x20Exported\x20credentials\x20for\x20CI','trackPhaseStart','\x20is\x20no\x20longer\x20supported.\x20','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','\x1b[0m','hlQOj','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','error','ZJCiq','PNmZV','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','xOBCO','1531962GErpcO','wDmYi','warn','Validating\x20API\x20token...','HBuqg','nmmAq','314582seUhXi','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','organizationName','oyNnh'];_0x424f=function(){return _0x1eab35;};return _0x424f();}import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x4f2615 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';function _0x5494(_0x14a094,_0x550eaf){_0x14a094=_0x14a094-0x1df;const _0x424fd6=_0x424f();let _0x549425=_0x424fd6[_0x14a094];return _0x549425;}const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x234b51(0x234);const bold=_0x3f6d08=>'\x1b[1m'+_0x3f6d08+_0x234b51(0x1e9);export function getPlaywrightVersion(){try{const _0x36ec14=require['resolve']('playwright/package.json'),_0x11210a=require(_0x36ec14);return _0x11210a['version'];}catch{return null;}}export function installChromiumBinary(_0x4b0df,_0x32b170=![]){const _0x107585=_0x234b51,_0x2ac1b8={'asATg':function(_0x23b166){return _0x23b166();},'nPqId':function(_0x4f6741,_0x4096fd){return _0x4f6741(_0x4096fd);},'nmmAq':'install','xOBCO':'chromium','uqYSd':_0x107585(0x222),'DVIRx':_0x107585(0x207),'OELtf':_0x107585(0x200),'olIcz':function(_0x7337fa,_0x25a227){return _0x7337fa===_0x25a227;},'PNmZV':_0x107585(0x203),'yqMpn':'close','wnCfT':_0x107585(0x1ec)};return new Promise((_0x3114ca,_0xb8082d)=>{const _0x51b34f=_0x107585,_0x4efa41=['playwright@'+_0x4b0df,_0x2ac1b8[_0x51b34f(0x1f6)],..._0x32b170?['--with-deps']:[],_0x2ac1b8[_0x51b34f(0x1f0)]],_0x39f468=spawn(_0x2ac1b8['uqYSd'],_0x4efa41,{'stdio':[_0x2ac1b8['DVIRx'],_0x2ac1b8['OELtf'],_0x51b34f(0x200)],'shell':_0x2ac1b8['olIcz'](process[_0x51b34f(0x213)],_0x2ac1b8[_0x51b34f(0x1ee)])});_0x39f468['on'](_0x2ac1b8['yqMpn'],_0x49a024=>{const _0x27555e=_0x51b34f;_0x49a024===0x0?_0x2ac1b8[_0x27555e(0x233)](_0x3114ca):_0x2ac1b8['nPqId'](_0xb8082d,new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x49a024));}),_0x39f468['on'](_0x2ac1b8[_0x51b34f(0x1fb)],_0x2ce2d1=>{_0xb8082d(_0x2ce2d1);});});}export async function authenticate(_0x84a82a){const _0x41c0cd=_0x234b51,_0x39176d={'FTeka':function(_0x4ea1f7){return _0x4ea1f7();},'LJAjH':function(_0x5e58b4,_0x52cb90){return _0x5e58b4 instanceof _0x52cb90;},'nVCzk':function(_0x4e50f6,_0x3bd41f){return _0x4e50f6(_0x3bd41f);},'lWlvK':_0x41c0cd(0x1fe),'HBuqg':function(_0x4a75f0,_0x3e8e3f){return _0x4a75f0(_0x3e8e3f);},'hlQOj':'✓\x20Stored\x20credentials\x20locally','piAVY':'provided_token'};if(!_0x84a82a){const _0x29b983=await getToken();if(_0x29b983){const _0x2451ea=await getCurrentUser(_0x29b983);if(_0x2451ea[_0x41c0cd(0x221)])return console['log'](_0x41c0cd(0x1e3)+_0x2451ea[_0x41c0cd(0x22b)][_0x41c0cd(0x1f9)]),{'token':_0x29b983,'method':'existing_token'};}try{_0x84a82a=await _0x39176d['FTeka'](runDeviceAuthFlow);}catch(_0x54be8f){throw new Error('Authentication\x20failed:\x20'+(_0x39176d['LJAjH'](_0x54be8f,Error)?_0x54be8f[_0x41c0cd(0x1fd)]:_0x54be8f));}const _0x2b3973=await _0x39176d['nVCzk'](getCurrentUser,_0x84a82a);if(!_0x2b3973[_0x41c0cd(0x221)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x2b3973['error']);return console['log'](_0x41c0cd(0x217)+_0x2b3973['user'][_0x41c0cd(0x1f9)]),{'token':_0x84a82a,'method':_0x39176d['lWlvK']};}console['log'](_0x41c0cd(0x1f4));const _0x5b24da=await _0x39176d['nVCzk'](getCurrentUser,_0x84a82a);if(!_0x5b24da[_0x41c0cd(0x221)]){if(_0x5b24da['status'])throw new Error('Authentication\x20failed:\x20'+_0x5b24da['error']+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x5b24da[_0x41c0cd(0x1ec)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log'](_0x41c0cd(0x217)+_0x5b24da['user']['organizationName']),await _0x39176d[_0x41c0cd(0x1f5)](storeToken,_0x84a82a),console[_0x41c0cd(0x211)](process['env'][_0x41c0cd(0x20f)]?_0x41c0cd(0x1e5):_0x39176d[_0x41c0cd(0x1ea)]),{'token':_0x84a82a,'method':_0x39176d['piAVY']};}export async function ensureRangerDir(_0x46c8e3){const _0x5052d9=_0x234b51,_0x87898e={'ZJCiq':function(_0xc1a86e){return _0xc1a86e();},'AQwSO':function(_0x31e627,_0x108703,_0x1a813c){return _0x31e627(_0x108703,_0x1a813c);},'DBxPq':_0x5052d9(0x208)};void _0x46c8e3;const _0x3cf183=_0x87898e[_0x5052d9(0x1ed)](getRangerHomeDir);return!existsSync(_0x3cf183)?(await _0x87898e['AQwSO'](mkdir,_0x3cf183,{'recursive':!![]}),console['log'](_0x87898e[_0x5052d9(0x228)]),{'path':_0x3cf183,'installed':!![]}):(console[_0x5052d9(0x211)]('✓\x20~/.ranger/\x20directory\x20already\x20exists'),{'path':_0x3cf183,'installed':![]});}export async function ensureChromium(_0x14dd92=![]){const _0x1a2935=_0x234b51,_0x5cfd15={'oyNnh':function(_0x4f324a,_0x2b09df){return _0x4f324a(_0x2b09df);},'LtdRb':_0x1a2935(0x231),'LfQdZ':function(_0x2efcf7){return _0x2efcf7();},'dBKyg':'confirm','cneyS':'install','knvnN':'\x0aInstalling\x20Chromium\x20browser...\x0a','IoLyC':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','QYyHa':function(_0x4b9ce1,_0x365b39){return _0x4b9ce1 instanceof _0x365b39;},'WCHab':'You\x20can\x20install\x20it\x20manually\x20by\x20running:','qtmmz':_0x1a2935(0x22d)};let _0x1a884f=![];try{const _0x29b940=chromium['executablePath']();_0x1a884f=_0x5cfd15[_0x1a2935(0x1fa)](existsSync,_0x29b940);}catch{_0x1a884f=![];}if(_0x1a884f)return console['log'](_0x5cfd15['LtdRb']),![];const _0x256186=_0x5cfd15['LfQdZ'](getPlaywrightVersion),_0x5cfe40=_0x256186??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x1b3462=!_0x256186,_0x152db2=process[_0x1a2935(0x235)][_0x1a2935(0x205)]&&process['stdout'][_0x1a2935(0x205)];let _0xed74aa=!![];if(_0x152db2){const {install:_0x4d56d3}=await _0x4f2615['prompt']([{'type':_0x5cfd15['dBKyg'],'name':_0x5cfd15[_0x1a2935(0x1e0)],'message':_0x1b3462?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x5cfe40+_0x1a2935(0x227):'The\x20required\x20version\x20('+_0x5cfe40+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0xed74aa=_0x4d56d3;}else console[_0x1a2935(0x211)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x5cfe40+(_0x1b3462?_0x1a2935(0x21b):'')+'...');if(_0xed74aa){console[_0x1a2935(0x211)](_0x5cfd15[_0x1a2935(0x20b)]);try{await installChromiumBinary(_0x5cfe40,_0x14dd92),console['log'](_0x5cfd15['IoLyC']);}catch(_0x4a03b8){console['error']('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x5cfd15['QYyHa'](_0x4a03b8,Error)?_0x4a03b8[_0x1a2935(0x1fd)]:_0x4a03b8),console[_0x1a2935(0x211)](_0x5cfd15['WCHab']),console['log']('\x20\x20npx\x20playwright@'+_0x5cfe40+'\x20install\x20chromium');}}else console[_0x1a2935(0x211)]('\x0a⚠\x20Skipping\x20Chromium\x20installation.'),console['log'](_0x5cfd15['qtmmz']),console[_0x1a2935(0x211)](_0x1a2935(0x1ff)+_0x5cfe40+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0xa52130){const _0x5eb7dd=_0x234b51,_0x4f7b92={'oJuVE':_0x5eb7dd(0x201)},_0x2ef441=join(_0xa52130,_0x4f7b92['oJuVE']),_0x5e2870=_0x5eb7dd(0x21a);await writeFile(_0x2ef441,_0x5e2870),console['log']('✓\x20Created\x20.ranger/.gitignore');}export async function ensureLocalEnv(_0x1fdb67,_0xe6f23d){const _0xbd271b=_0x234b51,_0x2dd426={'GbQMO':'user','CkBrr':function(_0x3f402b,_0x8573a2,_0x5d5c61){return _0x3f402b(_0x8573a2,_0x5d5c61);},'jiNGD':'local'};if(!findGitRoot()&&_0x1fdb67?.['scope']!=='user')return console['log'](_0xbd271b(0x22f)),{'ready':![],'skipped':!![]};const _0x5977bc=_0x1fdb67?.['scope']===_0x2dd426[_0xbd271b(0x20e)]?getRangerHomeDir():undefined;if(_0x2dd426[_0xbd271b(0x229)](findExistingEnv,_0x2dd426['jiNGD'],{'locations':[_0x2dd426['jiNGD']],'rangerDir':_0x5977bc}))return console[_0xbd271b(0x211)]('✓\x20Local\x20profile\x20already\x20exists'),{'ready':!![],'skipped':![]};try{return await addEnv(_0x2dd426['jiNGD'],{'url':_0x1fdb67?.['url'],'force':_0x1fdb67?.['force'],'allowInsecureLocalhost':_0x1fdb67?.['allowInsecureLocalhost'],'scope':_0x1fdb67?.['scope']},_0xe6f23d),{'ready':!![],'skipped':![]};}catch(_0x18f75c){return console[_0xbd271b(0x1ec)](_0xbd271b(0x239),_0x18f75c instanceof Error?_0x18f75c['message']:_0x18f75c),{'ready':![],'skipped':![]};}}export async function start(_0x8eecc3,_0x182f48,_0x1f9eb7){const _0x5834ef=_0x234b51,_0xb5f357={'dovjL':function(_0x76b0af,_0x305c9e){return _0x76b0af+_0x305c9e;},'hzkEV':_0x5834ef(0x22b),'POdhX':function(_0x892829,_0x412d70){return _0x892829(_0x412d70);},'dKivV':function(_0x2d41e1){return _0x2d41e1();},'pcrXr':function(_0x4d1881,_0x58d612){return _0x4d1881(_0x58d612);},'KqEEG':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','TGjzx':_0x5834ef(0x209),'qVTNM':function(_0x40fa8c,_0xb843a8){return _0x40fa8c(_0xb843a8);},'MWmtC':function(_0x2a02ec,_0xe4ac4c){return _0x2a02ec&&_0xe4ac4c;},'CeYFq':function(_0x134f18,_0x158dfe,_0x171b48){return _0x134f18(_0x158dfe,_0x171b48);},'pkRIQ':_0x5834ef(0x21e),'tDzlp':'skills','Novyj':_0x5834ef(0x220),'wGxzy':function(_0x5c4183,_0x145b7b,_0x29a70d){return _0x5c4183(_0x145b7b,_0x29a70d);},'Gcvpy':_0x5834ef(0x210),'PlQDF':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','wDmYi':'verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','tTDoS':function(_0x4d4520,_0x3efc8f){return _0x4d4520(_0x3efc8f);},'gRSyY':function(_0x2b11fe,_0x6a9f95){return _0x2b11fe+_0x6a9f95;}};console['log']('\x0a🚀\x20Ranger\x20Setup\x0a');_0x182f48?.[_0x5834ef(0x20c)]!==undefined&&_0x182f48[_0x5834ef(0x20c)]!=='user'&&(console[_0x5834ef(0x1ec)](_0xb5f357['dovjL']('ranger\x20setup\x20--scope='+String(_0x182f48[_0x5834ef(0x20c)])+_0x5834ef(0x1e7)+'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));_0x182f48={..._0x182f48,'scope':_0xb5f357['hzkEV']};const _0x1f0af9=!_0xb5f357['POdhX'](existsSync,_0xb5f357['dKivV'](getRangerHomeDir));await _0xb5f357[_0x5834ef(0x219)](ensureRangerDir,'user');if(_0x182f48?.['skipAuth'])console[_0x5834ef(0x211)](_0x5834ef(0x215)),_0x1f9eb7?.['trackPhaseEnd']('auth',{'isFirstRun':_0x1f0af9,'method':_0x5834ef(0x1fc)});else{_0x1f9eb7?.['trackPhaseStart']('auth');const _0x5de542=await authenticate(_0x8eecc3);_0x1f9eb7?.['trackPhaseEnd'](_0x5834ef(0x237),{'isFirstRun':_0x1f0af9,'method':_0x5de542[_0x5834ef(0x21c)]});}_0x1f9eb7?.['trackPhaseStart']('chromium');_0x182f48?.[_0x5834ef(0x21f)]?console['log'](_0xb5f357['KqEEG']):await ensureChromium(_0x182f48?.['withDeps']);_0x1f9eb7?.[_0x5834ef(0x232)]('chromium',{'isFirstRun':_0x1f0af9,'skipped':!!_0x182f48?.[_0x5834ef(0x21f)]}),console[_0x5834ef(0x211)](_0x5834ef(0x1e8));const _0x332ba8=_0x182f48?.[_0x5834ef(0x20c)],_0x124dd4=_0x182f48?.['opencode']??![];let _0x34c055=null;_0x124dd4?(_0x1f9eb7?.['trackPhaseStart'](_0xb5f357['TGjzx']),_0x34c055=await _0xb5f357[_0x5834ef(0x22a)](ensureOpencodePluginConfig,_0x332ba8),_0x1f9eb7?.['trackPhaseEnd'](_0x5834ef(0x209),{'isFirstRun':_0x1f0af9,'opencode':!![]})):(_0x1f9eb7?.['trackPhaseStart']('plugin'),await ensureClaudePlugin(_0x332ba8),_0x1f9eb7?.['trackPhaseEnd']('plugin',{'isFirstRun':_0x1f0af9}));if(_0xb5f357[_0x5834ef(0x1e1)](_0x124dd4,_0x34c055)){_0x1f9eb7?.['trackPhaseStart'](_0x5834ef(0x226));try{await _0xb5f357['CeYFq'](installSkill,'ranger',{'level':_0x34c055[_0x5834ef(0x20c)],'cliVersion':_0xb5f357['dKivV'](getCurrentVersion),'platform':_0xb5f357['pkRIQ']}),_0x1f9eb7?.['trackPhaseEnd'](_0xb5f357['tDzlp'],{'isFirstRun':_0x1f0af9,'opencode':!![]});}catch(_0x3b4cb9){console[_0x5834ef(0x1f3)]('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x3b4cb9 instanceof Error?_0x3b4cb9['message']:_0x3b4cb9),_0x1f9eb7?.['trackPhaseEnd']('skills',{'isFirstRun':_0x1f0af9,'opencode':!![],'failed':!![]});}}else _0x1f9eb7?.[_0x5834ef(0x1e6)]('skills'),await ensureClaudeSkills(_0x332ba8),_0x1f9eb7?.['trackPhaseEnd'](_0xb5f357['tDzlp'],{'isFirstRun':_0x1f0af9});if(_0x182f48?.[_0x5834ef(0x20d)])console['log'](_0x5834ef(0x238));else{if(_0x182f48?.['url']){_0x1f9eb7?.[_0x5834ef(0x1e6)](_0xb5f357['Novyj']);const _0xfd9745=await _0xb5f357[_0x5834ef(0x230)](ensureLocalEnv,{'url':_0x182f48[_0x5834ef(0x218)],'force':_0x182f48?.[_0x5834ef(0x236)],'allowInsecureLocalhost':_0x182f48?.[_0x5834ef(0x206)],'scope':'user'},_0x1f9eb7);_0x1f9eb7?.['trackPhaseEnd'](_0xb5f357['Novyj'],{'isFirstRun':_0x1f0af9,'profileReady':_0xfd9745['ready'],'userSkipped':_0xfd9745[_0x5834ef(0x1fc)]});}else console[_0x5834ef(0x211)]('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:'+(_0x5834ef(0x22e)+bold(_0x5834ef(0x1df)))+'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)'+_0x5834ef(0x223)+'\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles');}if(_0x124dd4)console['log'](_0x5834ef(0x1f8)),console[_0x5834ef(0x211)](_0xb5f357[_0x5834ef(0x225)]),console[_0x5834ef(0x211)](_0xb5f357['PlQDF']),console['log'](_0xb5f357[_0x5834ef(0x1f2)]);else{const _0x2acccb=_0xb5f357['tTDoS'](bold,_0x5834ef(0x20a));console['log'](_0xb5f357['gRSyY'](_0xb5f357[_0x5834ef(0x1e4)](_0x5834ef(0x202)+_0x2acccb+'\x20and\x20prompt\x20the\x20coding',_0x5834ef(0x216)),_0x5834ef(0x1eb))+_0x5834ef(0x1ef));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5cc9fc=_0x45ed;(function(_0x1453bc,_0x141d47){const _0xa6ccfc=_0x45ed,_0x1023fa=_0x1453bc();while(!![]){try{const _0x3d5466=-parseInt(_0xa6ccfc(0x160))/0x1*(parseInt(_0xa6ccfc(0x15b))/0x2)+-parseInt(_0xa6ccfc(0x1b7))/0x3*(parseInt(_0xa6ccfc(0x17a))/0x4)+parseInt(_0xa6ccfc(0x1c1))/0x5*(-parseInt(_0xa6ccfc(0x159))/0x6)+parseInt(_0xa6ccfc(0x180))/0x7*(-parseInt(_0xa6ccfc(0x193))/0x8)+-parseInt(_0xa6ccfc(0x1aa))/0x9*(-parseInt(_0xa6ccfc(0x1bb))/0xa)+-parseInt(_0xa6ccfc(0x1b4))/0xb*(parseInt(_0xa6ccfc(0x166))/0xc)+parseInt(_0xa6ccfc(0x187))/0xd;if(_0x3d5466===_0x141d47)break;else _0x1023fa['push'](_0x1023fa['shift']());}catch(_0x369cd7){_0x1023fa['push'](_0x1023fa['shift']());}}}(_0x190c,0x93368));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';function _0x45ed(_0x33909f,_0x1b0317){_0x33909f=_0x33909f-0x158;const _0x190c27=_0x190c();let _0x45ed55=_0x190c27[_0x33909f];return _0x45ed55;}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=_0x51edc9=>_0x5cc9fc(0x18a)+_0x51edc9+_0x5cc9fc(0x1af),link=(_0xf94d6,_0x181a92)=>'\x1b]8;;file://'+_0xf94d6+'\x07'+(_0x181a92||_0xf94d6)+_0x5cc9fc(0x1bc);async function getOpencodePluginStatus(){const _0x48826f=_0x5cc9fc,_0x415f67={'lrSlQ':_0x48826f(0x1b0),'LZfXs':_0x48826f(0x194),'pgcCp':function(_0x71f936,_0x5b09ab){return _0x71f936>_0x5b09ab;},'VnihL':'not_configured','lGOYM':_0x48826f(0x18b),'mRcVk':'debug','hPAPw':_0x48826f(0x17b),'KNJYB':_0x48826f(0x1c0),'SyYfd':_0x48826f(0x1a0)};return new Promise(_0x1b59f9=>{const _0xafec6f=_0x48826f,_0x341081={'pibqs':function(_0x48dcff,_0x2680a9){return _0x48dcff(_0x2680a9);},'QKoCA':'not_installed','Bxkie':_0x415f67['lrSlQ'],'iCFAo':_0x415f67['LZfXs'],'LyUna':function(_0x42a448,_0x62366e){return _0x415f67['pgcCp'](_0x42a448,_0x62366e);},'lPLnM':_0x415f67['VnihL']},_0x498176=spawn(_0x415f67['lGOYM'],[_0x415f67[_0xafec6f(0x19c)],'config'],{'stdio':['ignore',_0x415f67['hPAPw'],_0x415f67[_0xafec6f(0x16b)]]});let _0xe7f922='';_0x498176['stdout']?.['on'](_0x415f67['KNJYB'],_0x42353f=>{_0xe7f922+=_0x42353f['toString']();}),_0x498176['stderr']?.['on']('data',_0x4c164d=>{const _0x23cdb9=_0xafec6f;_0xe7f922+=_0x4c164d[_0x23cdb9(0x19d)]();}),_0x498176['on'](_0x415f67[_0xafec6f(0x1ac)],()=>{const _0x3bd45e=_0xafec6f;_0x341081['pibqs'](_0x1b59f9,{'status':_0x341081[_0x3bd45e(0x15e)]});}),_0x498176['on'](_0xafec6f(0x16a),_0x48f2c7=>{const _0x11c60c=_0xafec6f,_0x25bbe1={'OzbsL':_0x11c60c(0x198),'QSQCp':_0x341081['Bxkie']};if(_0x48f2c7!==0x0){_0x341081['pibqs'](_0x1b59f9,{'status':'not_installed'});return;}const _0xb3e08c=_0xe7f922[_0x11c60c(0x175)]();let _0x132aaa=null;if(_0xb3e08c)try{_0x132aaa=JSON['parse'](_0xb3e08c);}catch{const _0x44aee8=_0xb3e08c['match'](/\{[\s\S]*\}$/);if(_0x44aee8)try{_0x132aaa=JSON['parse'](_0x44aee8[0x0]);}catch{_0x132aaa=null;}}const _0x2a9944=Array[_0x11c60c(0x1a7)](_0x132aaa?.[_0x11c60c(0x1a8)])?_0x132aaa?.['plugin']:[],_0x535b96=_0x2a9944['some'](_0x3f0460=>{const _0x1f9d1a=_0x11c60c;if(typeof _0x3f0460!==_0x25bbe1['OzbsL'])return![];return _0x3f0460[_0x1f9d1a(0x183)]('@ranger-testing/opencode-plugin')||_0x3f0460[_0x1f9d1a(0x183)](_0x25bbe1['QSQCp']);});if(_0x535b96){_0x341081[_0x11c60c(0x1a6)](_0x1b59f9,{'status':_0x341081['iCFAo'],'details':_0x2a9944['length']>0x0?_0x2a9944[_0x11c60c(0x19b)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x341081['LyUna'](_0x2a9944[_0x11c60c(0x19b)],0x0)){_0x1b59f9({'status':_0x11c60c(0x192),'details':_0x2a9944[_0x11c60c(0x19b)]+'\x20plugin(s)\x20configured'});return;}_0x1b59f9({'status':_0x341081[_0x11c60c(0x18c)]});});});}async function getSkillsFromDir(_0x513c05,_0xa168e2){const _0x306d20=_0x5cc9fc,_0x2c9bc7={'soFHm':function(_0x2c6f2f,_0x363495){return _0x2c6f2f(_0x363495);},'QsCxO':function(_0x4e67ea,_0x48397a,_0x40b2dc,_0x202696){return _0x4e67ea(_0x48397a,_0x40b2dc,_0x202696);},'bFwwD':_0x306d20(0x17f),'EyKWN':function(_0x27dae5,_0x4ade6f){return _0x27dae5(_0x4ade6f);},'NEPwd':function(_0x3b7b72,_0xd263c1,_0x17925f){return _0x3b7b72(_0xd263c1,_0x17925f);},'FWSFG':'utf-8'};if(!_0x2c9bc7['soFHm'](existsSync,_0x513c05))return[];const _0x4aeb10=[];try{const _0x57d832=await readdir(_0x513c05,{'withFileTypes':!![]});for(const _0x5c76cc of _0x57d832){if(_0x5c76cc[_0x306d20(0x1ba)]()){const _0x3b6bbe=_0x2c9bc7['QsCxO'](join,_0x513c05,_0x5c76cc['name'],_0x2c9bc7['bFwwD']);if(_0x2c9bc7[_0x306d20(0x1b2)](existsSync,_0x3b6bbe)){let _0x293436=_0x5c76cc['name'];try{const _0x33b4c2=await _0x2c9bc7[_0x306d20(0x191)](readFile,_0x3b6bbe,_0x2c9bc7[_0x306d20(0x15d)]),_0x5aff8a=_0x33b4c2[_0x306d20(0x170)](/name:\s*(.+)/);_0x5aff8a&&(_0x293436=_0x5aff8a[0x1][_0x306d20(0x175)]());}catch{}_0x4aeb10[_0x306d20(0x17d)]({'name':_0x5c76cc['name'],'displayName':_0x293436,'path':_0x3b6bbe,'level':_0xa168e2});}}}}catch{return[];}return _0x4aeb10;}async function getInstalledSkills(){const _0x785828=_0x5cc9fc,_0x44169f={'NGxac':function(_0x2e16f7,_0x5cc570,_0x62dbdb){return _0x2e16f7(_0x5cc570,_0x62dbdb);},'ebQLG':_0x785828(0x1ae)},[_0x201c31,_0x4bc8be]=await Promise['all']([_0x44169f['NGxac'](getSkillsFromDir,getProjectSkillsDir(),_0x44169f['ebQLG']),getSkillsFromDir(getUserSkillsDir(),_0x785828(0x16e))]);return{'project':_0x201c31,'user':_0x4bc8be};}function _0x190c(){const _0x523abb=['opencode-plugin','version','EyKWN','hasEncryptedAuth','66oxllQM','\x0a---\x20Skills\x20---','no\x20session','1563FWXJlp','API\x20URL:\x20','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','isDirectory','5683410JnliQf','\x1b]8;;\x07','details','map','MpAUD','data','170065fVsEkL','hasPlaintextAuth',':\x20installed\x20(','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','60qtToUR','plaintext','8wrXVwq','Version:\x20','FWSFG','QKoCA','(not\x20found)','21781fXKHss','gMpgv','NkvHr','\x0a---\x20Profiles\x20---','has','organizationName','1320312lDUxTv','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','status','Organization:\x20','close','hPAPw','\x20\x20\x20\x20Settings:\x20','No\x20profiles\x20configured','user','\x20(active)','match','gkIdG','SfTGP','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','rHwou','trim','\x20\x20Run:\x20ranger\x20setup\x20[token]','ranger@trailhead','scope','join','4168kWXEgK','pipe','tIufa','push','\x20\x20User-level:','SKILL.md','8341522dIvIGA','name','znzBc','includes','CmINI','LQzmG','API\x20Token:\x20✗\x20Not\x20found','37135553DKSSfz','log','iGnYr','\x1b[1m','opencode','lPLnM','settingsPath','No\x20skills\x20installed','\x20\x20\x20\x20Session:\x20','aPyUV','NEPwd','not_configured','8RVxpra','configured','tWqyD','Root:\x20','bSdyd','string','filter','lIvWM','length','mRcVk','toString','rzYZs','sessionUpdatedAt','error','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','\x20\x20Run:\x20ranger\x20skillup','\x0a---\x20OpenCode\x20Plugin\x20---','\x20cloud','SvNDb','pibqs','isArray','plugin','env','9JGZWRb','\x20\x20\x20\x20','SyYfd','displayName','project','\x1b[0m'];_0x190c=function(){return _0x523abb;};return _0x190c();}async function getEnvironments(){const _0x16ec51=_0x5cc9fc,_0x528bbf={'CmINI':function(_0x32be03,_0x4ac66f){return _0x32be03(_0x4ac66f);},'tSnmA':'settings.json','MpAUD':function(_0x4831ca,_0x2a368b,_0x2f7464){return _0x4831ca(_0x2a368b,_0x2f7464);},'aPyUV':'auth.json','aUCIx':function(_0x519c05,_0x25de24,_0x59bec2){return _0x519c05(_0x25de24,_0x59bec2);},'SdKVi':function(_0x8b7963){return _0x8b7963();},'qofGO':function(_0x5a99b0,_0x52bfcb){return _0x5a99b0(_0x52bfcb);}},{envNames:_0xad2047,activeEnv:_0x38afd1}=await getEnvNames(),_0x298dd5=_0x528bbf['SdKVi'](getRangerDir);if(!_0x528bbf['qofGO'](existsSync,_0x298dd5))return{'envs':[],'activeEnv':null};const _0xafcc3b=_0xad2047[_0x16ec51(0x1be)](_0x33fea3=>{const _0x59b4d6=_0x16ec51,_0x598e5a=_0x528bbf[_0x59b4d6(0x184)](getEnvDir,_0x33fea3),_0xa5483f=join(_0x598e5a,_0x528bbf['tSnmA']),_0x12df6f=_0x528bbf[_0x59b4d6(0x1bf)](join,_0x598e5a,_0x528bbf[_0x59b4d6(0x190)]),_0x26304f=_0x528bbf['aUCIx'](join,_0x598e5a,'auth.json.enc');return{'name':_0x33fea3,'settingsPath':existsSync(_0xa5483f)?_0xa5483f:_0x59b4d6(0x15f),'hasPlaintextAuth':existsSync(_0x12df6f),'hasEncryptedAuth':_0x528bbf[_0x59b4d6(0x184)](existsSync,_0x26304f),'isActive':_0x33fea3===_0x38afd1};});return{'envs':_0xafcc3b,'activeEnv':_0x38afd1};}export async function status(){const _0x16748f=_0x5cc9fc,_0x40a6a4={'tIufa':function(_0x5048d1){return _0x5048d1();},'NJahH':function(_0x21d3ec,_0x1713aa){return _0x21d3ec(_0x1713aa);},'gMvaQ':function(_0x5da20e,_0x40e5fa,_0x5a8ca7){return _0x5da20e(_0x40e5fa,_0x5a8ca7);},'rzYZs':function(_0x3e4c7b,_0x4bac84){return _0x3e4c7b(_0x4bac84);},'lIvWM':function(_0x357d8c){return _0x357d8c();},'bSdyd':function(_0x59786e){return _0x59786e();},'rHwou':function(_0xb1e4f7,_0x247b73){return _0xb1e4f7!==_0x247b73;},'CSjMK':_0x16748f(0x1a3),'znzBc':function(_0x1f173b,_0xeb1221){return _0x1f173b===_0xeb1221;},'iGnYr':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','avFIg':'\x20\x20Not\x20installed','qwnrk':function(_0x4fe6a0,_0x20aa34){return _0x4fe6a0+_0x20aa34;},'SfTGP':_0x16748f(0x18e),'gMpgv':'\x20\x20Project-level:','eCFIR':function(_0x49585f,_0xce1fdb){return _0x49585f(_0xce1fdb);},'tWqyD':function(_0x315203,_0x2f4286,_0x24ad29){return _0x315203(_0x2f4286,_0x24ad29);},'SvNDb':function(_0x50e266,_0x2aedb4){return _0x50e266(_0x2aedb4);},'IiyXM':function(_0x33c240,_0x3171de){return _0x33c240(_0x3171de);},'ZeVUi':function(_0x92f5fc,_0xda0b1b){return _0x92f5fc(_0xda0b1b);},'gkIdG':function(_0x3d5b33,_0x55fc07){return _0x3d5b33+_0x55fc07;},'tDmoZ':_0x16748f(0x16d),'LQzmG':function(_0x55d414,_0xe4cd33){return _0x55d414>_0xe4cd33;},'oObAR':function(_0x194a11,_0x5ded4b){return _0x194a11>_0x5ded4b;},'NkvHr':'none'};console[_0x16748f(0x188)]('\x0a📊\x20Ranger\x20Status\x0a');const _0x2000a7=process['cwd'](),_0x40d041=_0x40a6a4[_0x16748f(0x17c)](getRangerDir);if(!_0x40a6a4['NJahH'](existsSync,_0x40d041)){console[_0x16748f(0x188)](_0x16748f(0x196)+_0x40a6a4['gMvaQ'](link,_0x2000a7,bold(_0x40a6a4[_0x16748f(0x19e)](basename,_0x2000a7)))),console['log'](_0x16748f(0x1a1)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x16748f(0x188)]('Root:\x20'+_0x40a6a4['gMvaQ'](link,_0x2000a7,bold(basename(_0x2000a7))));const _0x1fa004=_0x40a6a4[_0x16748f(0x19a)](getCurrentVersion),_0x5af972=_0x40a6a4[_0x16748f(0x197)](getLatestVersion);if(_0x5af972[_0x16748f(0x1b1)]&&_0x40a6a4[_0x16748f(0x174)](_0x5af972[_0x16748f(0x1b1)],_0x1fa004))console['log'](_0x16748f(0x15c)+_0x1fa004+'\x20(latest:\x20'+_0x5af972['version']+')'),console['log']('\x20\x20Run:\x20ranger\x20update');else _0x5af972[_0x16748f(0x1b1)]?console[_0x16748f(0x188)](_0x16748f(0x15c)+_0x1fa004+'\x20(up\x20to\x20date)'):console[_0x16748f(0x188)]('Version:\x20'+_0x1fa004);const _0x2e1152=await _0x40a6a4['bSdyd'](getToken);if(_0x2e1152){const _0x2a8d00=await getCurrentUser(_0x2e1152);_0x2a8d00['success']?console['log'](_0x16748f(0x169)+_0x40a6a4['NJahH'](bold,_0x2a8d00['user'][_0x16748f(0x165)])):(console[_0x16748f(0x188)](_0x16748f(0x1b9)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console['log'](_0x16748f(0x186)),console[_0x16748f(0x188)](_0x16748f(0x176));process[_0x16748f(0x1a9)]['DEBUG']&&(console[_0x16748f(0x188)]('API\x20Environment:\x20'+_0x40a6a4[_0x16748f(0x17c)](getCurrentEnvironment)),console[_0x16748f(0x188)](_0x16748f(0x1b8)+getApiBaseUrl()));console['log'](_0x40a6a4['CSjMK']);const _0x115c6d=await getOpencodePluginStatus();if(_0x40a6a4[_0x16748f(0x182)](_0x115c6d['status'],_0x16748f(0x194)))console['log']('\x20\x20'+_0x40a6a4['rzYZs'](bold,'@ranger-testing/opencode-plugin')+':\x20configured'),_0x115c6d['details']&&console[_0x16748f(0x188)]('\x20\x20'+_0x115c6d[_0x16748f(0x1bd)]);else _0x115c6d[_0x16748f(0x168)]==='not_configured'?(console['log']('\x20\x20Not\x20configured'),_0x115c6d[_0x16748f(0x1bd)]&&console[_0x16748f(0x188)]('\x20\x20'+_0x115c6d[_0x16748f(0x1bd)]),console[_0x16748f(0x188)]('\x20\x20Run:\x20ranger\x20setup\x20--opencode')):console[_0x16748f(0x188)](_0x40a6a4[_0x16748f(0x189)]);console[_0x16748f(0x188)]('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x164b2b=await getPluginInfo(_0x16748f(0x177));if(_0x164b2b){const _0x30f6e0=_0x164b2b[_0x16748f(0x178)]||'unknown',_0x3c0f93=_0x164b2b['enabled']?'enabled':'disabled';console['log']('\x20\x20'+bold('ranger@trailhead')+_0x16748f(0x1c3)+_0x30f6e0+',\x20'+_0x3c0f93+')');}else console[_0x16748f(0x188)](_0x40a6a4['avFIg']),console[_0x16748f(0x188)](_0x16748f(0x158));console[_0x16748f(0x188)](_0x16748f(0x1b5));const {project:_0x2d869f,user:_0x5ee3a8}=await _0x40a6a4['bSdyd'](getInstalledSkills),_0x688821=_0x2d869f['filter'](_0x151c8e=>RANGER_MANAGED_SKILLS['includes'](_0x151c8e['name'])),_0x5e4167=_0x5ee3a8['filter'](_0x10e49e=>RANGER_MANAGED_SKILLS[_0x16748f(0x183)](_0x10e49e['name'])),_0x4cbaae=_0x40a6a4['qwnrk'](_0x688821['length'],_0x5e4167[_0x16748f(0x19b)]);if(_0x40a6a4['znzBc'](_0x4cbaae,0x0))console['log'](_0x40a6a4[_0x16748f(0x172)]),console[_0x16748f(0x188)](_0x16748f(0x1a2));else{if(_0x688821['length']>0x0){console['log'](_0x40a6a4[_0x16748f(0x161)]);for(const _0x590d23 of _0x688821){console[_0x16748f(0x188)](_0x16748f(0x1ab)+_0x40a6a4['eCFIR'](bold,_0x590d23['displayName'])+':\x20'+_0x40a6a4['tWqyD'](link,_0x590d23['path'],_0x40a6a4[_0x16748f(0x1a5)](basename,_0x590d23['path'])));}}if(_0x5e4167[_0x16748f(0x19b)]>0x0){console[_0x16748f(0x188)](_0x16748f(0x17e));for(const _0x38257e of _0x5e4167){console[_0x16748f(0x188)](_0x16748f(0x1ab)+_0x40a6a4['IiyXM'](bold,_0x38257e[_0x16748f(0x1ad)])+':\x20'+link(_0x38257e['path'],_0x40a6a4['ZeVUi'](basename,_0x38257e['path'])));}}}console[_0x16748f(0x188)](_0x16748f(0x163));const {envs:_0x1ee73e,activeEnv:_0x83f09a}=await getEnvironments();let _0x409750=[];if(_0x2e1152)try{_0x409750=await listCloudProfiles();}catch{}const _0x415894=_0x40a6a4[_0x16748f(0x171)](_0x1ee73e[_0x16748f(0x19b)],_0x409750[_0x16748f(0x19b)]);if(_0x40a6a4[_0x16748f(0x182)](_0x415894,0x0))console[_0x16748f(0x188)](_0x40a6a4['tDmoZ']),console['log'](_0x16748f(0x167));else{if(_0x40a6a4[_0x16748f(0x185)](_0x415894,0x5)){const _0xfcaf40=[];_0x409750[_0x16748f(0x19b)]>0x0&&_0xfcaf40[_0x16748f(0x17d)](_0x409750[_0x16748f(0x19b)]+_0x16748f(0x1a4)),_0x40a6a4['oObAR'](_0x1ee73e['length'],0x0)&&_0xfcaf40[_0x16748f(0x17d)](_0x1ee73e['length']+'\x20local'),console['log'](_0x415894+'\x20profiles\x20configured\x20('+_0xfcaf40['join'](',\x20')+')'),_0x83f09a&&console['log']('\x20\x20Active:\x20'+bold(_0x83f09a)),console[_0x16748f(0x188)](_0x16748f(0x173));}else{for(const _0x34afce of _0x409750){const _0x42ccef=_0x34afce[_0x16748f(0x181)]===_0x83f09a?_0x16748f(0x16f):'';console['log']('\x20\x20'+bold(_0x34afce['name'])+'\x20[cloud]'+_0x42ccef);const _0x61801d=_0x34afce[_0x16748f(0x19f)]?'cached\x20(updated\x20'+_0x34afce[_0x16748f(0x19f)]+')':_0x16748f(0x1b6);console['log'](_0x16748f(0x18f)+_0x61801d);}const _0x40c913=new Set(_0x409750[_0x16748f(0x1be)](_0x146d60=>_0x146d60[_0x16748f(0x181)]));for(const _0x3dcb5f of _0x1ee73e){if(_0x40c913['has'](_0x3dcb5f['name']))continue;const _0x263a3a=_0x3dcb5f['isActive']?_0x16748f(0x16f):'',_0x3d2421=_0x3dcb5f[_0x16748f(0x1b3)]?'encrypted':_0x3dcb5f[_0x16748f(0x1c2)]?_0x16748f(0x15a):_0x40a6a4[_0x16748f(0x162)];console[_0x16748f(0x188)]('\x20\x20'+bold(_0x3dcb5f[_0x16748f(0x181)])+'\x20[local]'+_0x263a3a),console['log']('\x20\x20\x20\x20Auth:\x20'+_0x3d2421),_0x40a6a4[_0x16748f(0x174)](_0x3dcb5f['settingsPath'],'(not\x20found)')&&console[_0x16748f(0x188)](_0x16748f(0x16c)+_0x40a6a4[_0x16748f(0x195)](link,_0x3dcb5f[_0x16748f(0x18d)],basename(_0x3dcb5f[_0x16748f(0x18d)])));}if(!_0x83f09a){console['log']('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x5ecd82=[..._0x409750['map'](_0x22eba4=>_0x22eba4['name']),..._0x1ee73e[_0x16748f(0x199)](_0x5b8b33=>!_0x40c913[_0x16748f(0x164)](_0x5b8b33['name']))['map'](_0xc216a8=>_0xc216a8[_0x16748f(0x181)])];console[_0x16748f(0x188)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x5ecd82[_0x16748f(0x179)](',\x20')+')');}}}console[_0x16748f(0x188)]('');}
|
|
1
|
+
const _0x71e86f=_0x410b;(function(_0xdaee1c,_0x5a797c){const _0xf94a79=_0x410b,_0x4e07ef=_0xdaee1c();while(!![]){try{const _0x2d71f2=parseInt(_0xf94a79(0x116))/0x1+-parseInt(_0xf94a79(0x132))/0x2+-parseInt(_0xf94a79(0x11a))/0x3*(-parseInt(_0xf94a79(0x148))/0x4)+parseInt(_0xf94a79(0x14c))/0x5+parseInt(_0xf94a79(0x145))/0x6+parseInt(_0xf94a79(0x109))/0x7+-parseInt(_0xf94a79(0x10c))/0x8*(parseInt(_0xf94a79(0x13c))/0x9);if(_0x2d71f2===_0x5a797c)break;else _0x4e07ef['push'](_0x4e07ef['shift']());}catch(_0x3d08b2){_0x4e07ef['push'](_0x4e07ef['shift']());}}}(_0x269c,0xed64d));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';function _0x269c(){const _0x314d00=['Root:\x20','log','AVuxv','project','GIfOS','\x20(up\x20to\x20date)','displayName','623485ykCYGZ','dLKwT','parse','MQfTT','3ZpLCKM','MqMmt','status','sessionUpdatedAt','\x20\x20User-level:','FAmLw','\x1b]8;;file://','enabled','user','hasPlaintextAuth','opencode-plugin','string','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','MtLfn','\x20(active)','scope','FhyXW','name','ranger@trailhead','UXXPs','OYMrB','\x20[local]','IzopY','dzAFA','3301430OKGOZZ','DEBUG','WkKCY','includes','SKILL.md','YKSwG','match','none','keGsD','pdvRU','797913uWKAtd','length','OHjzA','hasEncryptedAuth','some','\x20\x20Active:\x20','join','map','API\x20Token:\x20✗\x20Not\x20found','9320802kxkNOs','JGkFh','not_installed','3308296YWaCyI','DYWFV','BbAQU','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','7891585ZzSWYk','nnCXY','Version:\x20','CnnQs','(not\x20found)','unknown','\x1b]8;;\x07','\x20(latest:\x20','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','AJOgR','\x20local','ZerFM','version','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','has','not_configured','No\x20skills\x20installed','\x20\x20Run:\x20ranger\x20skillup','path','details','settingsPath','plugin','\x20\x20Run:\x20ranger\x20setup\x20[token]','push','tPGiV','BeEOm','error','pipe','utf-8','Ufxsa','auth.json.enc','DJRlD','13591515ZrgiOb','\x0a\x20\x20No\x20active\x20profile\x20set','config','352pGtOuI','Rfawz','isActive'];_0x269c=function(){return _0x314d00;};return _0x269c();}import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';function _0x410b(_0x5e5031,_0x5adc48){_0x5e5031=_0x5e5031-0xf2;const _0x269cfc=_0x269c();let _0x410b4f=_0x269cfc[_0x5e5031];return _0x410b4f;}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=_0x54bb50=>'\x1b[1m'+_0x54bb50+'\x1b[0m',link=(_0x294851,_0x3bf893)=>_0x71e86f(0x120)+_0x294851+'\x07'+(_0x3bf893||_0x294851)+_0x71e86f(0x152);async function getOpencodePluginStatus(){const _0x190186=_0x71e86f,_0x5314b0={'MqMmt':_0x190186(0x147),'uPKoi':_0x190186(0x124),'FhyXW':function(_0x12d24a,_0x5a82b3,_0x12d5ed,_0xed4638){return _0x12d24a(_0x5a82b3,_0x12d5ed,_0xed4638);},'OkFqI':'ignore','MQfTT':'pipe','MtLfn':'data','ksJwm':'close'};return new Promise(_0x19ed5e=>{const _0x585c5e=_0x190186,_0x287d86={'nnCXY':_0x585c5e(0x125),'WkKCY':_0x5314b0['uPKoi'],'keGsD':function(_0xe4d24,_0x59e361){return _0xe4d24!==_0x59e361;},'QaMWj':function(_0x4baeac,_0x16b529){return _0x4baeac(_0x16b529);},'FHGdE':function(_0x33c823,_0x530f8c){return _0x33c823>_0x530f8c;},'CnnQs':'not_configured'},_0x21adde=_0x5314b0[_0x585c5e(0x12a)](spawn,'opencode',['debug',_0x585c5e(0x10b)],{'stdio':[_0x5314b0['OkFqI'],_0x5314b0[_0x585c5e(0x119)],_0x585c5e(0x104)]});let _0x3c889c='';_0x21adde['stdout']?.['on']('data',_0x194f9b=>{_0x3c889c+=_0x194f9b['toString']();}),_0x21adde['stderr']?.['on'](_0x5314b0[_0x585c5e(0x127)],_0x37c2a3=>{_0x3c889c+=_0x37c2a3['toString']();}),_0x21adde['on'](_0x585c5e(0x103),()=>{const _0x4decdd=_0x585c5e;_0x19ed5e({'status':_0x5314b0[_0x4decdd(0x11b)]});}),_0x21adde['on'](_0x5314b0['ksJwm'],_0x20e45d=>{const _0x4638c6=_0x585c5e;if(_0x287d86[_0x4638c6(0x13a)](_0x20e45d,0x0)){_0x287d86['QaMWj'](_0x19ed5e,{'status':_0x4638c6(0x147)});return;}const _0x40aa63=_0x3c889c['trim']();let _0x336e3d=null;if(_0x40aa63)try{_0x336e3d=JSON[_0x4638c6(0x118)](_0x40aa63);}catch{const _0xbb9eb7=_0x40aa63[_0x4638c6(0x138)](/\{[\s\S]*\}$/);if(_0xbb9eb7)try{_0x336e3d=JSON[_0x4638c6(0x118)](_0xbb9eb7[0x0]);}catch{_0x336e3d=null;}}const _0x5831d7=Array['isArray'](_0x336e3d?.[_0x4638c6(0xfe)])?_0x336e3d?.['plugin']:[],_0x3226f8=_0x5831d7[_0x4638c6(0x140)](_0x2fe68c=>{const _0x4915af=_0x4638c6;if(typeof _0x2fe68c!==_0x287d86[_0x4915af(0x14d)])return![];return _0x2fe68c['includes']('@ranger-testing/opencode-plugin')||_0x2fe68c[_0x4915af(0x135)](_0x287d86[_0x4915af(0x134)]);});if(_0x3226f8){_0x19ed5e({'status':'configured','details':_0x5831d7[_0x4638c6(0x13d)]>0x0?_0x5831d7['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x287d86['FHGdE'](_0x5831d7['length'],0x0)){_0x19ed5e({'status':_0x287d86[_0x4638c6(0x14f)],'details':_0x5831d7['length']+'\x20plugin(s)\x20configured'});return;}_0x19ed5e({'status':_0x287d86['CnnQs']});});});}async function getSkillsFromDir(_0x41f85e,_0xf3ff55){const _0x4eed11=_0x71e86f,_0x324649={'nWIbe':function(_0xb6cac2,_0x4d3618){return _0xb6cac2(_0x4d3618);},'kERMD':function(_0x5aa514,_0x1fc201,_0x4e5242){return _0x5aa514(_0x1fc201,_0x4e5242);}};if(!_0x324649['nWIbe'](existsSync,_0x41f85e))return[];const _0x3c30da=[];try{const _0x5204ac=await readdir(_0x41f85e,{'withFileTypes':!![]});for(const _0x5744f6 of _0x5204ac){if(_0x5744f6['isDirectory']()){const _0x513537=join(_0x41f85e,_0x5744f6[_0x4eed11(0x12b)],_0x4eed11(0x136));if(existsSync(_0x513537)){let _0x3d4cd6=_0x5744f6[_0x4eed11(0x12b)];try{const _0x29d5af=await _0x324649['kERMD'](readFile,_0x513537,_0x4eed11(0x105)),_0x25803b=_0x29d5af[_0x4eed11(0x138)](/name:\s*(.+)/);_0x25803b&&(_0x3d4cd6=_0x25803b[0x1]['trim']());}catch{}_0x3c30da['push']({'name':_0x5744f6[_0x4eed11(0x12b)],'displayName':_0x3d4cd6,'path':_0x513537,'level':_0xf3ff55});}}}}catch{return[];}return _0x3c30da;}async function getInstalledSkills(){const _0x239ab4=_0x71e86f,_0x35b029={'OHjzA':function(_0xc4673f){return _0xc4673f();}},[_0x583d54,_0x58e076]=await Promise['all']([getSkillsFromDir(getProjectSkillsDir(),_0x239ab4(0x112)),getSkillsFromDir(_0x35b029[_0x239ab4(0x13e)](getUserSkillsDir),'user')]);return{'project':_0x583d54,'user':_0x58e076};}async function getEnvironments(){const _0x36ed9f=_0x71e86f,_0x43e50d={'BeEOm':function(_0x2817e0,_0x2d4d0d){return _0x2817e0(_0x2d4d0d);},'ppgXK':function(_0x5eb630,_0x50e507,_0x3202c4){return _0x5eb630(_0x50e507,_0x3202c4);},'DJRlD':function(_0x21181f,_0x5dbedb,_0x1d0d46){return _0x21181f(_0x5dbedb,_0x1d0d46);},'YKSwG':'auth.json','OYMrB':function(_0x24b5b4,_0x55cd37){return _0x24b5b4(_0x55cd37);},'TpfvS':function(_0xa324bc){return _0xa324bc();},'GJHJp':function(_0x4c15f0){return _0x4c15f0();}},{envNames:_0x500974,activeEnv:_0x43610f}=await _0x43e50d['TpfvS'](getEnvNames),_0xce70bf=_0x43e50d['GJHJp'](getRangerDir);if(!_0x43e50d[_0x36ed9f(0x12e)](existsSync,_0xce70bf))return{'envs':[],'activeEnv':null};const _0x4883f4=_0x500974[_0x36ed9f(0x143)](_0x5daee3=>{const _0x131a61=_0x36ed9f,_0x357bfe=_0x43e50d[_0x131a61(0x102)](getEnvDir,_0x5daee3),_0x4a24bb=_0x43e50d['ppgXK'](join,_0x357bfe,'settings.json'),_0x25059d=_0x43e50d[_0x131a61(0x108)](join,_0x357bfe,_0x43e50d[_0x131a61(0x137)]),_0x47890e=_0x43e50d['ppgXK'](join,_0x357bfe,_0x131a61(0x107));return{'name':_0x5daee3,'settingsPath':_0x43e50d['OYMrB'](existsSync,_0x4a24bb)?_0x4a24bb:'(not\x20found)','hasPlaintextAuth':existsSync(_0x25059d),'hasEncryptedAuth':existsSync(_0x47890e),'isActive':_0x5daee3===_0x43610f};});return{'envs':_0x4883f4,'activeEnv':_0x43610f};}export async function status(){const _0x34cfd5=_0x71e86f,_0x255519={'AVuxv':function(_0x4e7040){return _0x4e7040();},'Ufxsa':function(_0x1a2ffd,_0x4d90f9){return _0x1a2ffd(_0x4d90f9);},'dLKwT':function(_0x3a81ca,_0x29fb3a){return _0x3a81ca(_0x29fb3a);},'FAmLw':function(_0x6793f,_0x100368){return _0x6793f!==_0x100368;},'KrPLk':function(_0x4906eb,_0xa191cc){return _0x4906eb(_0xa191cc);},'ovTLg':'\x0a---\x20OpenCode\x20Plugin\x20---','Rfawz':function(_0x1e8ab7,_0x50fa84){return _0x1e8ab7===_0x50fa84;},'pdvRU':'configured','IzopY':_0x34cfd5(0xf8),'goxmL':'\x20\x20Not\x20configured','aCJRi':'\x20\x20Run:\x20ranger\x20setup\x20--opencode','DYWFV':'\x0a---\x20Claude\x20Code\x20Plugin\x20---','bJjCy':_0x34cfd5(0x12c),'YbWDy':_0x34cfd5(0x121),'wbgma':'\x20\x20Not\x20installed','BbAQU':function(_0x420792,_0x9b9108){return _0x420792+_0x9b9108;},'GIfOS':function(_0x17076f,_0xfff1a6){return _0x17076f===_0xfff1a6;},'dfpun':'\x20\x20Project-level:','ZerFM':function(_0x26c28e,_0x68bfcc,_0x34634f){return _0x26c28e(_0x68bfcc,_0x34634f);},'tPGiV':function(_0x503cef,_0x2cfb3b){return _0x503cef>_0x2cfb3b;},'AJOgR':_0x34cfd5(0x11e),'vwGLh':function(_0x3d2b14,_0x1bd7f0){return _0x3d2b14(_0x1bd7f0);},'VTqNB':function(_0x5d92d0,_0x1de688,_0x44508f){return _0x5d92d0(_0x1de688,_0x44508f);},'dzAFA':function(_0xcfd5c2,_0x1e7293){return _0xcfd5c2(_0x1e7293);},'YVnLI':function(_0x23161c,_0x58858c){return _0x23161c(_0x58858c);},'JGkFh':_0x34cfd5(0x128),'UXXPs':function(_0x37349c,_0x5ac70a){return _0x37349c(_0x5ac70a);}};console[_0x34cfd5(0x110)]('\x0a📊\x20Ranger\x20Status\x0a');const _0x138983=process['cwd'](),_0x411614=_0x255519['AVuxv'](getRangerDir);if(!_0x255519['Ufxsa'](existsSync,_0x411614)){console['log'](_0x34cfd5(0x10f)+link(_0x138983,_0x255519[_0x34cfd5(0x117)](bold,basename(_0x138983)))),console[_0x34cfd5(0x110)](_0x34cfd5(0x154)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x34cfd5(0x110)]('Root:\x20'+link(_0x138983,bold(_0x255519[_0x34cfd5(0x106)](basename,_0x138983))));const _0xd7fe40=getCurrentVersion(),_0x5e48ad=_0x255519[_0x34cfd5(0x111)](getLatestVersion);if(_0x5e48ad['version']&&_0x255519['FAmLw'](_0x5e48ad['version'],_0xd7fe40))console['log'](_0x34cfd5(0x14e)+_0xd7fe40+_0x34cfd5(0x153)+_0x5e48ad[_0x34cfd5(0xf5)]+')'),console[_0x34cfd5(0x110)]('\x20\x20Run:\x20ranger\x20update');else _0x5e48ad[_0x34cfd5(0xf5)]?console['log'](_0x34cfd5(0x14e)+_0xd7fe40+_0x34cfd5(0x114)):console[_0x34cfd5(0x110)](_0x34cfd5(0x14e)+_0xd7fe40);const _0x3d5e26=await getToken();if(_0x3d5e26){const _0x54b5d7=await getCurrentUser(_0x3d5e26);_0x54b5d7['success']?console[_0x34cfd5(0x110)]('Organization:\x20'+_0x255519['KrPLk'](bold,_0x54b5d7[_0x34cfd5(0x122)]['organizationName'])):(console['log'](_0x34cfd5(0x14b)),console['log'](_0x34cfd5(0xff)));}else console['log'](_0x34cfd5(0x144)),console['log'](_0x34cfd5(0xff));process['env'][_0x34cfd5(0x133)]&&(console['log']('API\x20Environment:\x20'+getCurrentEnvironment()),console[_0x34cfd5(0x110)]('API\x20URL:\x20'+getApiBaseUrl()));console['log'](_0x255519['ovTLg']);const _0x48cc78=await _0x255519[_0x34cfd5(0x111)](getOpencodePluginStatus);if(_0x255519[_0x34cfd5(0x10d)](_0x48cc78[_0x34cfd5(0x11c)],_0x255519[_0x34cfd5(0x13b)]))console[_0x34cfd5(0x110)]('\x20\x20'+_0x255519['dLKwT'](bold,'@ranger-testing/opencode-plugin')+':\x20configured'),_0x48cc78[_0x34cfd5(0xfc)]&&console['log']('\x20\x20'+_0x48cc78[_0x34cfd5(0xfc)]);else _0x48cc78['status']===_0x255519[_0x34cfd5(0x130)]?(console['log'](_0x255519['goxmL']),_0x48cc78['details']&&console['log']('\x20\x20'+_0x48cc78[_0x34cfd5(0xfc)]),console['log'](_0x255519['aCJRi'])):console['log']('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console[_0x34cfd5(0x110)](_0x255519[_0x34cfd5(0x149)]);const _0x393943=await getPluginInfo(_0x255519['bJjCy']);if(_0x393943){const _0x8b12f6=_0x393943[_0x34cfd5(0x129)]||_0x34cfd5(0x151),_0x31f308=_0x393943['enabled']?_0x255519['YbWDy']:'disabled';console['log']('\x20\x20'+_0x255519['Ufxsa'](bold,'ranger@trailhead')+':\x20installed\x20('+_0x8b12f6+',\x20'+_0x31f308+')');}else console['log'](_0x255519['wbgma']),console[_0x34cfd5(0x110)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)');console[_0x34cfd5(0x110)]('\x0a---\x20Skills\x20---');const {project:_0x54ba64,user:_0x311bb4}=await getInstalledSkills(),_0x17888a=_0x54ba64['filter'](_0x1cdf13=>RANGER_MANAGED_SKILLS['includes'](_0x1cdf13[_0x34cfd5(0x12b)])),_0x12b501=_0x311bb4['filter'](_0x3d9e49=>RANGER_MANAGED_SKILLS[_0x34cfd5(0x135)](_0x3d9e49['name'])),_0x13851b=_0x255519[_0x34cfd5(0x14a)](_0x17888a['length'],_0x12b501['length']);if(_0x255519[_0x34cfd5(0x113)](_0x13851b,0x0))console['log'](_0x34cfd5(0xf9)),console[_0x34cfd5(0x110)](_0x34cfd5(0xfa));else{if(_0x17888a['length']>0x0){console[_0x34cfd5(0x110)](_0x255519['dfpun']);for(const _0x2d858f of _0x17888a){console['log']('\x20\x20\x20\x20'+bold(_0x2d858f['displayName'])+':\x20'+_0x255519[_0x34cfd5(0xf4)](link,_0x2d858f[_0x34cfd5(0xfb)],basename(_0x2d858f['path'])));}}if(_0x255519['tPGiV'](_0x12b501['length'],0x0)){console[_0x34cfd5(0x110)](_0x255519[_0x34cfd5(0xf2)]);for(const _0x19d63b of _0x12b501){console['log']('\x20\x20\x20\x20'+_0x255519['vwGLh'](bold,_0x19d63b[_0x34cfd5(0x115)])+':\x20'+_0x255519['VTqNB'](link,_0x19d63b[_0x34cfd5(0xfb)],basename(_0x19d63b['path'])));}}}console['log']('\x0a---\x20Profiles\x20---');const {envs:_0x1e1dfc,activeEnv:_0x1a956e}=await getEnvironments();let _0x5d66ea=[];if(_0x3d5e26)try{_0x5d66ea=await _0x255519[_0x34cfd5(0x111)](listCloudProfiles);}catch{}const _0x2cc2de=_0x1e1dfc[_0x34cfd5(0x13d)]+_0x5d66ea[_0x34cfd5(0x13d)];if(_0x2cc2de===0x0)console[_0x34cfd5(0x110)]('No\x20profiles\x20configured'),console['log'](_0x34cfd5(0xf6));else{if(_0x255519[_0x34cfd5(0x101)](_0x2cc2de,0x5)){const _0x4c79e9=[];_0x5d66ea['length']>0x0&&_0x4c79e9['push'](_0x5d66ea['length']+'\x20cloud'),_0x1e1dfc['length']>0x0&&_0x4c79e9[_0x34cfd5(0x100)](_0x1e1dfc['length']+_0x34cfd5(0xf3)),console[_0x34cfd5(0x110)](_0x2cc2de+'\x20profiles\x20configured\x20('+_0x4c79e9[_0x34cfd5(0x142)](',\x20')+')'),_0x1a956e&&console['log'](_0x34cfd5(0x141)+_0x255519[_0x34cfd5(0x131)](bold,_0x1a956e)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x2c8b6e of _0x5d66ea){const _0x26bc1b=_0x255519['Rfawz'](_0x2c8b6e['name'],_0x1a956e)?_0x34cfd5(0x128):'';console['log']('\x20\x20'+_0x255519['YVnLI'](bold,_0x2c8b6e['name'])+'\x20[cloud]'+_0x26bc1b);const _0x2d5c3e=_0x2c8b6e[_0x34cfd5(0x11d)]?'cached\x20(updated\x20'+_0x2c8b6e['sessionUpdatedAt']+')':'no\x20session';console[_0x34cfd5(0x110)]('\x20\x20\x20\x20Session:\x20'+_0x2d5c3e);}const _0x5b81a6=new Set(_0x5d66ea[_0x34cfd5(0x143)](_0x269291=>_0x269291['name']));for(const _0x4324f7 of _0x1e1dfc){if(_0x5b81a6[_0x34cfd5(0xf7)](_0x4324f7['name']))continue;const _0x16594f=_0x4324f7[_0x34cfd5(0x10e)]?_0x255519[_0x34cfd5(0x146)]:'',_0x1b5d9f=_0x4324f7[_0x34cfd5(0x13f)]?'encrypted':_0x4324f7[_0x34cfd5(0x123)]?'plaintext':_0x34cfd5(0x139);console[_0x34cfd5(0x110)]('\x20\x20'+_0x255519[_0x34cfd5(0x12d)](bold,_0x4324f7['name'])+_0x34cfd5(0x12f)+_0x16594f),console[_0x34cfd5(0x110)]('\x20\x20\x20\x20Auth:\x20'+_0x1b5d9f),_0x255519[_0x34cfd5(0x11f)](_0x4324f7[_0x34cfd5(0xfd)],_0x34cfd5(0x150))&&console[_0x34cfd5(0x110)]('\x20\x20\x20\x20Settings:\x20'+link(_0x4324f7['settingsPath'],basename(_0x4324f7[_0x34cfd5(0xfd)])));}if(!_0x1a956e){console[_0x34cfd5(0x110)](_0x34cfd5(0x10a));const _0x4a3e27=[..._0x5d66ea[_0x34cfd5(0x143)](_0x2930dc=>_0x2930dc['name']),..._0x1e1dfc['filter'](_0x1c257e=>!_0x5b81a6['has'](_0x1c257e['name']))[_0x34cfd5(0x143)](_0x4396d7=>_0x4396d7[_0x34cfd5(0x12b)])];console[_0x34cfd5(0x110)](_0x34cfd5(0x126)+_0x4a3e27[_0x34cfd5(0x142)](',\x20')+')');}}}console['log']('');}
|