@ranger-testing/ranger-cli 3.1.2-alpha.059c7a3-40 → 3.1.2-alpha.b450a14-41
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(_0x38dee0,_0x4afe1e){const _0x2bffa1=_0x28c4,_0x445c03=_0x38dee0();while(!![]){try{const _0x4f4b17=parseInt(_0x2bffa1(0x1a0))/0x1*(parseInt(_0x2bffa1(0x190))/0x2)+-parseInt(_0x2bffa1(0x194))/0x3*(-parseInt(_0x2bffa1(0x19c))/0x4)+-parseInt(_0x2bffa1(0x19a))/0x5*(-parseInt(_0x2bffa1(0x198))/0x6)+-parseInt(_0x2bffa1(0x192))/0x7*(-parseInt(_0x2bffa1(0x19f))/0x8)+parseInt(_0x2bffa1(0x19e))/0x9*(-parseInt(_0x2bffa1(0x1a2))/0xa)+-parseInt(_0x2bffa1(0x193))/0xb+-parseInt(_0x2bffa1(0x199))/0xc*(parseInt(_0x2bffa1(0x18e))/0xd);if(_0x4f4b17===_0x4afe1e)break;else _0x445c03['push'](_0x445c03['shift']());}catch(_0x100195){_0x445c03['push'](_0x445c03['shift']());}}}(_0x48fc,0x27f46));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0xd1a9b6=_0x28c4,_0x17f371={'oAOuR':function(_0x2fd8ae){return _0x2fd8ae();},'HsYzE':'Re-authenticating\x20via\x20MCP\x20bootstrap...','rpxUP':_0xd1a9b6(0x18d),'aXwIb':function(_0x2dc503){return _0x2dc503();},'BRgIc':'\x0a✅\x20API\x20key\x20stored\x20successfully','blggC':function(_0x18a23c,_0x31e928){return _0x18a23c instanceof _0x31e928;}},_0x48b9d6=await _0x17f371['oAOuR'](getMcpAuthOrigin);if(_0x48b9d6){console[_0xd1a9b6(0x1a1)](_0x17f371[_0xd1a9b6(0x195)]),await _0x17f371['oAOuR'](mcpBootstrap);return;}if(!isInteractive())throw new Error(_0x17f371[_0xd1a9b6(0x196)]);try{const _0x1c32be=await _0x17f371[_0xd1a9b6(0x19d)](runDeviceAuthFlow),_0x53fb2f=await getCurrentUser(_0x1c32be);_0x53fb2f[_0xd1a9b6(0x19b)]?console[_0xd1a9b6(0x1a1)](_0xd1a9b6(0x18f)+_0x53fb2f[_0xd1a9b6(0x197)]['organizationName']):console['log'](_0x17f371[_0xd1a9b6(0x191)]);}catch(_0x40eba8){throw new Error('Login\x20failed:\x20'+(_0x17f371['blggC'](_0x40eba8,Error)?_0x40eba8['message']:_0x40eba8));}}function _0x28c4(_0x55af19,_0x1f7b67){_0x55af19=_0x55af19-0x18d;const _0x48fcae=_0x48fc();let _0x28c4a8=_0x48fcae[_0x55af19];return _0x28c4a8;}function _0x48fc(){const _0x4717bb=['success','306260ymtKng','aXwIb','63rmWqQY','6856kXvPoj','219LktJtz','log','110570QzttUm','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','1722799kaxLno','\x0a✅\x20Logged\x20in\x20to\x20','1822kqZWgq','BRgIc','2604IMaUjZ','1884993mBGlTA','3sDegll','HsYzE','rpxUP','user','144DwbhRC','24sdwpGz','17205NiuCKX'];_0x48fc=function(){return _0x4717bb;};return _0x48fc();}
|
|
@@ -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 _0x4fe080=_0x5598;(function(_0x3d7251,_0x9d01dc){const _0xc0be5b=_0x5598,_0x5d42c9=_0x3d7251();while(!![]){try{const _0x11feb6=parseInt(_0xc0be5b(0x13f))/0x1*(-parseInt(_0xc0be5b(0xed))/0x2)+-parseInt(_0xc0be5b(0x144))/0x3*(-parseInt(_0xc0be5b(0x14b))/0x4)+-parseInt(_0xc0be5b(0xe5))/0x5+parseInt(_0xc0be5b(0x127))/0x6+-parseInt(_0xc0be5b(0x110))/0x7+-parseInt(_0xc0be5b(0xd6))/0x8+parseInt(_0xc0be5b(0xe0))/0x9*(parseInt(_0xc0be5b(0xf4))/0xa);if(_0x11feb6===_0x9d01dc)break;else _0x5d42c9['push'](_0x5d42c9['shift']());}catch(_0x390fab){_0x5d42c9['push'](_0x5d42c9['shift']());}}}(_0x5c15,0x831a1));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger',_0x4fe080(0x106)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x4fe080(0x148));export async function getMcpAuthOrigin(){const _0x3dad5a=_0x4fe080,_0x8f051c={'cwtcg':'utf-8','WSlTn':function(_0x30251a,_0x3f7903){return _0x30251a||_0x3f7903;}};try{const _0x59e8fa=(await readFile(AUTH_ORIGIN_PATH,_0x8f051c[_0x3dad5a(0xcd)]))[_0x3dad5a(0xf9)]();return _0x8f051c[_0x3dad5a(0x136)](_0x59e8fa,null);}catch{return null;}}export async function mcpBootstrap(){const _0x5d6f4f=_0x4fe080,_0x57e091={'RovUt':function(_0x97b936){return _0x97b936();},'CtTmP':function(_0x46f056,_0x1aa651){return _0x46f056(_0x1aa651);},'XssSr':function(_0x5c6c61,_0x21b24a){return _0x5c6c61===_0x21b24a;},'gRUPN':function(_0x30e8ab,_0x491abd){return _0x30e8ab(_0x491abd);}},_0x57587f=_0x57e091['RovUt'](getMcpAuthUrl);currentOrigin=_0x57587f;const _0x356d8c=process['stdout']['isTTY']??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x57587f+'\x0a');const _0x3ca093=await _0x57e091[_0x5d6f4f(0x140)](tryUnauthenticated,_0x57587f);let _0x36da9f=null;if(_0x57e091['XssSr'](_0x3ca093,'proxied'))_0x36da9f='';else{_0x36da9f=await loadCachedToken();if(!_0x36da9f){if(!_0x356d8c)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x5d6f4f(0xc2));_0x36da9f=await _0x57e091[_0x5d6f4f(0xfc)](oauthFlow,_0x57587f);}}await callGetCliToken(_0x57587f,_0x36da9f);}async function tryUnauthenticated(_0xf8f1d9){const _0xfe7b76=_0x4fe080,_0x4690ba={'mAysf':function(_0x1cfaf9,_0x42177f,_0x565aa2){return _0x1cfaf9(_0x42177f,_0x565aa2);},'FmHef':'application/json,\x20text/event-stream','bFqPL':_0xfe7b76(0xc7),'mhURq':_0xfe7b76(0x10c),'RMTXP':_0xfe7b76(0x14d),'FgKAA':'1.0.0','NyqHu':'proxied','HYIlD':function(_0x16a2d7,_0x56018b){return _0x16a2d7===_0x56018b;}},_0x22faf0=await _0x4690ba[_0xfe7b76(0x11d)](fetch,_0xf8f1d9,{'method':_0xfe7b76(0xe7),'headers':{'Content-Type':_0xfe7b76(0x11a),'Accept':_0x4690ba['FmHef']},'body':JSON['stringify']({'jsonrpc':_0x4690ba[_0xfe7b76(0x112)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x4690ba['mhURq'],'capabilities':{},'clientInfo':{'name':_0x4690ba['RMTXP'],'version':_0x4690ba['FgKAA']}}})});if(_0x22faf0['ok'])return await _0x22faf0[_0xfe7b76(0xda)](),_0x4690ba['NyqHu'];if(_0x4690ba['HYIlD'](_0x22faf0['status'],0x191))return await _0x22faf0['text'](),_0xfe7b76(0xf1);const _0x574441=await _0x22faf0[_0xfe7b76(0xda)]();throw new Error(_0xfe7b76(0x10f)+_0x22faf0['status']+':\x20'+_0x574441);}function _0x5598(_0x119ce8,_0x26e5e7){_0x119ce8=_0x119ce8-0xc2;const _0x5c1566=_0x5c15();let _0x559895=_0x5c1566[_0x119ce8];return _0x559895;}class OAuthTimeoutError extends Error{constructor(_0x4ad7a9){const _0x56b168=_0x4fe080,_0x27a439={'JLoRL':'OAuthTimeoutError'};super(_0x4ad7a9),this['name']=_0x27a439[_0x56b168(0xdd)];}}async function oauthFlow(_0x4ec4ea){const _0x2e65d2=_0x4fe080,_0x512af6={'jLIrV':function(_0x2416ac,_0x3f8011){return _0x2416ac(_0x3f8011);},'gntAj':_0x2e65d2(0x133)};try{return await _0x512af6['jLIrV'](oauthFlowAttempt,_0x4ec4ea);}catch(_0x25a9df){if(_0x25a9df instanceof OAuthTimeoutError&&await loadCachedClient())return console['log'](_0x512af6[_0x2e65d2(0x149)]),await clearCachedClient(),await oauthFlowAttempt(_0x4ec4ea);throw _0x25a9df;}}async function oauthFlowAttempt(_0x1191ac){const _0x4d2428=_0x4fe080,_0x44e8d8={'btZAt':'Discovering\x20authorization\x20server...','trJwi':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','HCDKn':_0x4d2428(0x12b),'oVKvR':_0x4d2428(0xe7),'MILVe':_0x4d2428(0xc4),'Grxku':_0x4d2428(0xec),'QPXwS':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','AXtrq':function(_0x4bb9a7,_0x4e66bd){return _0x4bb9a7(_0x4e66bd);},'JsTJB':'sha256','GqQaa':function(_0x30056a,_0xcaaffd){return _0x30056a(_0xcaaffd);},'MntnH':'hex','OrxSo':_0x4d2428(0xeb),'znGrg':_0x4d2428(0x13a),'WBswi':_0x4d2428(0x122),'LeEaK':'code_challenge_method','kFevX':_0x4d2428(0x111),'DRInj':'resource','cDnIQ':_0x4d2428(0xff),'xigqE':_0x4d2428(0x132),'sslYF':function(_0x5d1483,_0x507c4c,_0x65fea1){return _0x5d1483(_0x507c4c,_0x65fea1);},'OLJrb':_0x4d2428(0xc5)},_0x28522d=_0x1191ac['replace'](/\/mcp$/,'');process['stdout'][_0x4d2428(0xdc)](_0x44e8d8[_0x4d2428(0x138)]);const _0x342f0e=await fetch(_0x28522d+_0x4d2428(0xc6));if(!_0x342f0e['ok'])throw new Error(_0x44e8d8[_0x4d2428(0xc3)]);const _0x39b199=await _0x342f0e['json'](),_0x29ebb6=_0x39b199['authorization_servers']?.[0x0];if(!_0x29ebb6)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console[_0x4d2428(0x14f)]('\x20'+_0x29ebb6);const _0x30d34f=await fetchAuthServerMetadata(_0x29ebb6);let _0x5ee89a,_0x5d7d79;const _0x1c5679=await loadCachedClient();if(_0x1c5679)_0x5ee89a=_0x1c5679[_0x4d2428(0x141)],_0x5d7d79=_0x1c5679[_0x4d2428(0x121)];else{if(_0x30d34f['registration_endpoint']){process['stdout']['write'](_0x44e8d8['HCDKn']);const _0x3d3560=await fetch(_0x30d34f['registration_endpoint'],{'method':_0x44e8d8['oVKvR'],'headers':{'Content-Type':'application/json'},'body':JSON[_0x4d2428(0x12e)]({'client_name':_0x44e8d8['MILVe'],'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x4d2428(0x12a)],'grant_types':[_0x44e8d8[_0x4d2428(0x13c)],'refresh_token'],'response_types':['code'],'token_endpoint_auth_method':_0x4d2428(0x113)})});if(!_0x3d3560['ok']){const _0x354190=await _0x3d3560['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x354190);}const _0x190cb0=await _0x3d3560['json']();_0x5ee89a=_0x190cb0[_0x4d2428(0x13a)],_0x5d7d79=_0x190cb0['client_secret'],await saveCachedClient(_0x5ee89a,_0x5d7d79),console['log']('\x20done');}else throw new Error(_0x44e8d8[_0x4d2428(0xca)]);}const _0x46b20c=randomBytes(0x20)[_0x4d2428(0xfa)]('base64url'),_0x166483=_0x44e8d8[_0x4d2428(0xdb)](createHash,_0x44e8d8['JsTJB'])['update'](_0x46b20c)[_0x4d2428(0xf0)]('base64url'),_0x5ce671=_0x44e8d8['GqQaa'](randomBytes,0x10)['toString'](_0x44e8d8[_0x4d2428(0x14a)]),_0x1f6ada=new URL(_0x30d34f['authorization_endpoint']);_0x1f6ada['searchParams']['set'](_0x44e8d8['OrxSo'],'code'),_0x1f6ada[_0x4d2428(0xf8)]['set'](_0x44e8d8['znGrg'],_0x5ee89a),_0x1f6ada['searchParams'][_0x4d2428(0x11f)]('redirect_uri','http://localhost:'+CALLBACK_PORT+_0x4d2428(0x12a)),_0x1f6ada['searchParams'][_0x4d2428(0x11f)](_0x44e8d8[_0x4d2428(0x104)],_0x166483),_0x1f6ada[_0x4d2428(0xf8)]['set'](_0x44e8d8['LeEaK'],_0x4d2428(0xde)),_0x1f6ada[_0x4d2428(0xf8)][_0x4d2428(0x11f)](_0x44e8d8[_0x4d2428(0x137)],_0x5ce671);_0x39b199[_0x4d2428(0x142)]&&_0x1f6ada['searchParams'][_0x4d2428(0x11f)](_0x44e8d8['DRInj'],_0x39b199[_0x4d2428(0x142)]);console[_0x4d2428(0x14f)](_0x44e8d8['cDnIQ']),console[_0x4d2428(0x14f)](_0x4d2428(0x13d)+_0x1f6ada['toString']()+'\x0a'),await openBrowser(_0x1f6ada['toString']());const _0x1aeadf=await waitForCallback(_0x5ce671);process['stdout'][_0x4d2428(0xdc)](_0x44e8d8['xigqE']);const _0x534309=new URLSearchParams({'grant_type':_0x44e8d8[_0x4d2428(0x13c)],'code':_0x1aeadf,'redirect_uri':_0x4d2428(0x124)+CALLBACK_PORT+'/callback','client_id':_0x5ee89a,'code_verifier':_0x46b20c});_0x5d7d79&&_0x534309['set'](_0x4d2428(0x100),_0x5d7d79);_0x39b199[_0x4d2428(0x142)]&&_0x534309[_0x4d2428(0x11f)](_0x4d2428(0x142),_0x39b199['resource']);const _0x128900=await _0x44e8d8[_0x4d2428(0xd2)](fetch,_0x30d34f['token_endpoint'],{'method':_0x4d2428(0xe7),'headers':{'Content-Type':_0x4d2428(0xdf)},'body':_0x534309});if(!_0x128900['ok']){const _0x1debbd=await _0x128900[_0x4d2428(0xda)]();throw new Error(_0x4d2428(0xfd)+_0x1debbd);}const _0x300751=await _0x128900[_0x4d2428(0x102)]();return console[_0x4d2428(0x14f)](_0x44e8d8['OLJrb']),await saveCachedToken(_0x300751[_0x4d2428(0x12d)],_0x300751[_0x4d2428(0x14e)],_0x300751['expires_in']),_0x300751[_0x4d2428(0x12d)];}async function callGetCliToken(_0x750e7f,_0x267d60){const _0x3c57aa=_0x4fe080,_0x59fa05={'jCgNP':function(_0x5b9708,_0x569c68,_0x157556){return _0x5b9708(_0x569c68,_0x157556);},'oxXtR':_0x3c57aa(0xe7),'WgKzj':'application/json','DnfDK':function(_0x2a6975,_0x5e20b7){return _0x2a6975(_0x5e20b7);},'WTbzE':'2025-03-26','fqTQT':'1.0.0','thDIs':_0x3c57aa(0xc5),'oMGyU':_0x3c57aa(0xc7),'vrRBk':_0x3c57aa(0x129),'DQEkc':'tools/call','IdfWn':'get_cli_token','yOZoi':_0x3c57aa(0x12c),'odSRK':function(_0x273d9f){return _0x273d9f();},'kKNNL':_0x3c57aa(0x12f),'wuczA':function(_0x2e3b42,_0xa387f3,_0x182a84,_0x3dfd3a){return _0x2e3b42(_0xa387f3,_0x182a84,_0x3dfd3a);},'okJMk':_0x3c57aa(0xfb)},_0x1c0b6f={'Content-Type':_0x59fa05[_0x3c57aa(0x130)],'Accept':'application/json,\x20text/event-stream'};_0x267d60&&(_0x1c0b6f['Authorization']='Bearer\x20'+_0x267d60);const _0x3e68c3=async _0x1eb8a3=>{const _0x28d5ef=_0x3c57aa,_0x32d098=await _0x59fa05[_0x28d5ef(0xd0)](fetch,_0x750e7f,{'method':_0x59fa05[_0x28d5ef(0xf5)],'headers':_0x1c0b6f,'body':JSON[_0x28d5ef(0x12e)](_0x1eb8a3)});if(!_0x32d098['ok']){const _0x30ec33=await _0x32d098['text']();throw new Error('HTTP\x20'+_0x32d098['status']+':\x20'+_0x30ec33);}return parseResponse(_0x32d098);};process['stdout']['write'](_0x3c57aa(0xf2));const _0x11b597=await _0x59fa05[_0x3c57aa(0x108)](_0x3e68c3,{'jsonrpc':_0x3c57aa(0xc7),'id':0x1,'method':_0x3c57aa(0xe8),'params':{'protocolVersion':_0x59fa05['WTbzE'],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x59fa05['fqTQT']}}});if(_0x11b597['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x11b597['error'][_0x3c57aa(0x143)]??JSON[_0x3c57aa(0x12e)](_0x11b597[_0x3c57aa(0xd3)])));console[_0x3c57aa(0x14f)](_0x59fa05[_0x3c57aa(0xea)]),await fetch(_0x750e7f,{'method':_0x59fa05['oxXtR'],'headers':_0x1c0b6f,'body':JSON[_0x3c57aa(0x12e)]({'jsonrpc':_0x59fa05[_0x3c57aa(0xe4)],'method':_0x3c57aa(0x13e)})})['then'](_0x448c49=>_0x448c49[_0x3c57aa(0xda)]()),process[_0x3c57aa(0xd1)][_0x3c57aa(0xdc)](_0x59fa05[_0x3c57aa(0xcb)]);const _0x227b1a=await _0x59fa05['DnfDK'](_0x3e68c3,{'jsonrpc':_0x59fa05[_0x3c57aa(0xe4)],'id':0x2,'method':_0x59fa05['DQEkc'],'params':{'name':_0x59fa05[_0x3c57aa(0x120)],'arguments':{}}});if(_0x227b1a[_0x3c57aa(0xd3)])throw new Error(_0x3c57aa(0x126)+(_0x227b1a[_0x3c57aa(0xd3)]['message']??JSON['stringify'](_0x227b1a['error'])));console[_0x3c57aa(0x14f)](_0x59fa05['thDIs']);const _0x281195=extractToken(_0x227b1a['result']);if(!_0x281195){console[_0x3c57aa(0xd3)](_0x59fa05[_0x3c57aa(0x135)]),console['error'](JSON['stringify'](_0x227b1a['result'],null,0x2));throw new Error('Could\x20not\x20extract\x20token\x20from\x20MCP\x20response');}const _0x56c17e=join(_0x59fa05['odSRK'](homedir),_0x59fa05['kKNNL']),_0x3573e9=_0x59fa05[_0x3c57aa(0xd0)](join,_0x56c17e,_0x3c57aa(0xce));await _0x59fa05['jCgNP'](mkdir,_0x56c17e,{'recursive':!![]}),await _0x59fa05['wuczA'](writeFile,_0x3573e9,_0x281195,{'mode':0x180}),await writeFile(join(_0x56c17e,'auth-origin.txt'),_0x750e7f,{'mode':0x180}),console[_0x3c57aa(0x14f)]('\x0aToken\x20written\x20to\x20'+_0x3573e9),console[_0x3c57aa(0x14f)](_0x59fa05[_0x3c57aa(0xf7)]);}async function fetchAuthServerMetadata(_0x3ef6ac){const _0x349f21=_0x4fe080,_0x44467c=_0x3ef6ac+'/.well-known/oauth-authorization-server',_0xc14f23=await fetch(_0x44467c);if(!_0xc14f23['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x44467c+':\x20'+_0xc14f23[_0x349f21(0xf6)]);return _0xc14f23[_0x349f21(0x102)]();}function waitForCallback(_0x174615){const _0x46ce69=_0x4fe080,_0x47098e={'UJlFe':function(_0x5c1a46,_0x2ee73b){return _0x5c1a46(_0x2ee73b);},'bjwpD':_0x46ce69(0xc8),'cFljV':function(_0xefd52e){return _0xefd52e();}};return new Promise((_0x5e1036,_0x3b1a22)=>{const _0x46f0d1=_0x46ce69,_0x3326f7={'bHHmf':function(_0x24634a,_0x4ad361){return _0x24634a!==_0x4ad361;},'mgfgh':_0x46f0d1(0x103),'lAVKb':_0x47098e['bjwpD'],'wIPHt':_0x46f0d1(0x131),'RPmnq':_0x46f0d1(0x14c),'wtHsx':function(_0x8cafc7,_0x20f970){return _0x47098e['UJlFe'](_0x8cafc7,_0x20f970);},'gQRWD':function(_0x5db9c5){return _0x47098e['cFljV'](_0x5db9c5);},'Ryxkg':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>'},_0x39ed40=()=>{const _0x113d5a=_0x46f0d1;_0x3c0ea5['closeAllConnections'](),_0x3c0ea5[_0x113d5a(0x101)]();},_0x1a3262=setTimeout(()=>{const _0x576eb9=_0x46f0d1;_0x39ed40(),_0x47098e[_0x576eb9(0x11e)](_0x3b1a22,new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x3c0ea5=createServer((_0x2fabe3,_0xb64723)=>{const _0x365bda=_0x46f0d1,_0x279342=new URL(_0x2fabe3['url']??'/',_0x365bda(0x124)+CALLBACK_PORT);if(_0x3326f7['bHHmf'](_0x279342['pathname'],'/callback')){_0xb64723[_0x365bda(0x10d)](0x194),_0xb64723[_0x365bda(0x107)](_0x3326f7[_0x365bda(0xd9)]);return;}const _0x4c8c00=_0x279342[_0x365bda(0xf8)][_0x365bda(0xe1)](_0x3326f7[_0x365bda(0x10b)]),_0x5000ae=_0x279342['searchParams']['get'](_0x365bda(0x111)),_0x131cee=_0x279342[_0x365bda(0xf8)][_0x365bda(0xe1)](_0x365bda(0xd3));if(_0x131cee){const _0x540784=_0x279342['searchParams']['get'](_0x3326f7[_0x365bda(0x128)])??_0x131cee;_0xb64723['writeHead'](0xc8,{'Content-Type':_0x3326f7[_0x365bda(0x147)]}),_0xb64723[_0x365bda(0x107)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x540784+_0x365bda(0x114)),_0x3326f7['wtHsx'](clearTimeout,_0x1a3262),_0x3326f7[_0x365bda(0xcc)](_0x39ed40),_0x3b1a22(new Error('OAuth\x20error:\x20'+_0x540784));return;}if(!_0x4c8c00||_0x3326f7[_0x365bda(0x105)](_0x5000ae,_0x174615)){_0xb64723[_0x365bda(0x10d)](0x190,{'Content-Type':_0x365bda(0x14c)}),_0xb64723['end'](_0x3326f7['Ryxkg']);return;}_0xb64723[_0x365bda(0x10d)](0xc8,{'Content-Type':_0x3326f7[_0x365bda(0x147)]}),_0xb64723[_0x365bda(0x107)]('<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'),clearTimeout(_0x1a3262),_0x39ed40(),_0x3326f7['wtHsx'](_0x5e1036,_0x4c8c00);});_0x3c0ea5[_0x46f0d1(0x146)](CALLBACK_PORT,'127.0.0.1');});}async function openBrowser(_0x43f865){const _0x460c12=_0x4fe080,_0x2b403e={'dXVky':function(_0x2b5a21,_0x3c662f){return _0x2b5a21===_0x3c662f;},'gxDFT':_0x460c12(0x109),'KUqsF':'win32','vUzye':_0x460c12(0xf3)},_0x158f26=_0x2b403e['dXVky'](process[_0x460c12(0xc9)],_0x2b403e[_0x460c12(0xd7)])?_0x460c12(0x139):process[_0x460c12(0xc9)]===_0x2b403e[_0x460c12(0x11b)]?'start':_0x2b403e[_0x460c12(0xee)];exec(_0x158f26+'\x20\x22'+_0x43f865+'\x22');}function _0x5c15(){const _0x4d7c83=['thDIs','response_type','authorization_code','18nTtpuz','vUzye','origin','digest','needs-oauth','Initializing\x20MCP\x20session...','xdg-open','22579610hevkEL','oxXtR','status','okJMk','searchParams','trim','toString','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','gRUPN','Token\x20exchange\x20failed:\x20','LvIBt','\x0aOpening\x20browser\x20for\x20authentication...','client_secret','close','json','Not\x20found','WBswi','bHHmf','mcp-oauth-tokens.json','end','DnfDK','darwin','gfLug','lAVKb','2025-03-26','writeHead','refreshToken','MCP\x20server\x20returned\x20HTTP\x20','7178668KgUlPF','state','bFqPL','none','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','parse','startsWith','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','headers','oqSWo','application/json','KUqsF','iHcJn','mAysf','UJlFe','set','IdfWn','clientSecret','code_challenge','accessToken','http://localhost:','data:','get_cli_token\x20failed:\x20','520068pdHlDb','wIPHt','Requesting\x20CLI\x20token...','/callback','Registering\x20OAuth\x20client...','\x0aUnexpected\x20response\x20structure:','access_token','stringify','.ranger','WgKzj','error_description','Exchanging\x20authorization\x20code...','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','string','yOZoi','WSlTn','kFevX','btZAt','open','client_id','zptuA','Grxku','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','notifications/initialized','83221uskVpm','CtTmP','clientId','resource','message','525SDUxpV','zNskR','listen','RPmnq','auth-origin.txt','gntAj','MntnH','10876cVIqPT','text/html','ranger-cli','refresh_token','log','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','trJwi','Ranger\x20CLI','\x20done','/.well-known/oauth-protected-resource','2.0','code','platform','QPXwS','vrRBk','gQRWD','cwtcg','refresh.txt','content','jCgNP','stdout','sslYF','error','token','text/event-stream','3443712KegLnR','gxDFT','now','mgfgh','text','AXtrq','write','JLoRL','S256','application/x-www-form-urlencoded','9uLXqTA','get','utf-8','iauBG','oMGyU','392470EVTtDH','content-type','POST','initialize','slice'];_0x5c15=function(){return _0x4d7c83;};return _0x5c15();}let currentOrigin='';async function loadCachedToken(){const _0x20c477=_0x4fe080,_0x171c1c={'gfLug':function(_0x56fda3,_0x46ab4f,_0x4c4fe0){return _0x56fda3(_0x46ab4f,_0x4c4fe0);},'KJMye':_0x20c477(0xe2)};try{const _0xbf4355=JSON[_0x20c477(0x115)](await _0x171c1c[_0x20c477(0x10a)](readFile,TOKEN_CACHE_PATH,_0x171c1c['KJMye']));if(_0xbf4355['origin']&&_0xbf4355['origin']!==currentOrigin)return null;if(_0xbf4355['expiresAt']&&Date[_0x20c477(0xd8)]()>_0xbf4355['expiresAt'])return null;return _0xbf4355[_0x20c477(0x123)]??null;}catch{return null;}}async function saveCachedToken(_0x4fd9f0,_0x366dad,_0x43cafc){const _0x4c55b3=_0x4fe080,_0x3c3767={'zNskR':function(_0x3526c0,_0x4952c6){return _0x3526c0+_0x4952c6;},'MrovC':function(_0x2f5f76){return _0x2f5f76();},'TQKSU':_0x4c55b3(0x12f)},_0x465964=await loadCachedData(),_0x9dcb34={..._0x465964,'origin':currentOrigin,'accessToken':_0x4fd9f0,'refreshToken':_0x366dad??_0x465964?.[_0x4c55b3(0x10e)],'expiresAt':_0x43cafc?_0x3c3767[_0x4c55b3(0x145)](Date[_0x4c55b3(0xd8)](),_0x43cafc*0x3e8):undefined};await mkdir(join(_0x3c3767['MrovC'](homedir),_0x3c3767['TQKSU']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x9dcb34),{'mode':0x180});}async function loadCachedClient(){const _0x3133d5=_0x4fe080,_0x1b0eaf=await loadCachedData();if(_0x1b0eaf?.['origin']&&_0x1b0eaf[_0x3133d5(0xef)]!==currentOrigin)return null;return _0x1b0eaf?.['clientId']?{'clientId':_0x1b0eaf[_0x3133d5(0x141)],'clientSecret':_0x1b0eaf[_0x3133d5(0x121)]}:null;}async function clearCachedClient(){const _0x5b5e95=_0x4fe080,_0x3ded10={'iHcJn':function(_0x37498c){return _0x37498c();},'LvIBt':function(_0x503d6e,_0x4fa3b8,_0x340219,_0x47b752){return _0x503d6e(_0x4fa3b8,_0x340219,_0x47b752);}},_0x3f0d4f=await _0x3ded10[_0x5b5e95(0x11c)](loadCachedData);if(!_0x3f0d4f)return;const {clientId:_0x84b607,clientSecret:_0x3ea6bd,..._0x450dab}=_0x3f0d4f;await _0x3ded10[_0x5b5e95(0xfe)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x450dab),{'mode':0x180});}async function saveCachedClient(_0x119b91,_0x547299){const _0x1a9f3d=_0x4fe080,_0xc7c1d={'zptuA':function(_0x57af86,_0x5d512c,_0x2e73ac){return _0x57af86(_0x5d512c,_0x2e73ac);},'oqSWo':'.ranger'},_0x5104b3=await loadCachedData(),_0x48b2e7={..._0x5104b3,'origin':currentOrigin,'accessToken':_0x5104b3?.['accessToken']??'','clientId':_0x119b91,'clientSecret':_0x547299};await _0xc7c1d[_0x1a9f3d(0x13b)](mkdir,_0xc7c1d['zptuA'](join,homedir(),_0xc7c1d[_0x1a9f3d(0x119)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x48b2e7),{'mode':0x180});}async function loadCachedData(){const _0x238809=_0x4fe080;try{return JSON[_0x238809(0x115)](await readFile(TOKEN_CACHE_PATH,_0x238809(0xe2)));}catch{return null;}}async function parseResponse(_0xb9e6e9){const _0x26754f=_0x4fe080,_0x56595d={'wUnTi':_0x26754f(0xd5),'qHfkj':_0x26754f(0x125),'iauBG':_0x26754f(0x117)},_0x505d22=_0xb9e6e9[_0x26754f(0x118)][_0x26754f(0xe1)](_0x26754f(0xe6))??'';if(_0x505d22['includes'](_0x56595d['wUnTi'])){const _0x230b64=await _0xb9e6e9['text']();for(const _0x41e071 of _0x230b64['split']('\x0a')){const _0x2c34d0=_0x41e071[_0x26754f(0xf9)]();if(_0x2c34d0[_0x26754f(0x116)]('data:')){const _0x4491ae=_0x2c34d0[_0x26754f(0xe9)](_0x56595d['qHfkj']['length'])['trim']();if(!_0x4491ae)continue;try{const _0x3abfce=JSON['parse'](_0x4491ae);if(_0x3abfce['id']!==undefined||_0x3abfce[_0x26754f(0xd3)])return _0x3abfce;}catch{}}}throw new Error(_0x56595d[_0x26754f(0xe3)]);}return _0xb9e6e9['json']();}function extractToken(_0xa7175b){const _0x58bf7a=_0x4fe080,_0x366d10={'isugs':_0x58bf7a(0x134)};if(!_0xa7175b)return null;const _0x3cf8e3=_0xa7175b['structuredContent'];if(_0x3cf8e3?.[_0x58bf7a(0xd4)]&&typeof _0x3cf8e3['token']==='string')return _0x3cf8e3['token'];if(_0xa7175b['isError']){const _0x15d703=_0xa7175b['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x15d703?.[0x0]?.[_0x58bf7a(0xda)]??'Unknown\x20error'));}const _0x1f420d=_0xa7175b[_0x58bf7a(0xcf)];if(_0x1f420d)for(const _0x4523e8 of _0x1f420d){if(_0x4523e8['type']==='text'&&_0x4523e8[_0x58bf7a(0xda)]){try{const _0x1ecf2b=JSON['parse'](_0x4523e8['text']);if(typeof _0x1ecf2b?.['token']===_0x366d10['isugs'])return _0x1ecf2b[_0x58bf7a(0xd4)];}catch{}const _0x4a4e0f=_0x4523e8['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x4a4e0f)return _0x4a4e0f[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5a71b8,_0x502e3b){var _0x2febe7=_0x7120,_0x418972=_0x5a71b8();while(!![]){try{var _0x19946b=parseInt(_0x2febe7(0x145))/0x1*(-parseInt(_0x2febe7(0x146))/0x2)+-parseInt(_0x2febe7(0x147))/0x3*(parseInt(_0x2febe7(0x13c))/0x4)+-parseInt(_0x2febe7(0x142))/0x5+parseInt(_0x2febe7(0x141))/0x6+parseInt(_0x2febe7(0x143))/0x7+-parseInt(_0x2febe7(0x13d))/0x8+-parseInt(_0x2febe7(0x149))/0x9*(-parseInt(_0x2febe7(0x13f))/0xa);if(_0x19946b===_0x502e3b)break;else _0x418972['push'](_0x418972['shift']());}catch(_0x46b279){_0x418972['push'](_0x418972['shift']());}}}(_0x58a2,0x2d33d));function _0x7120(_0x415180,_0x368b54){_0x415180=_0x415180-0x13c;var _0x58a258=_0x58a2();var _0x7120fe=_0x58a258[_0x415180];return _0x7120fe;}export async function migrateProfile(_0x20dece,_0x15c3f8){var _0x34d594=_0x7120,_0x2113cb={'iRcJC':function(_0x191c82,_0x42f1ad){return _0x191c82+_0x42f1ad;},'EFHvb':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','MwAoC':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','gXupr':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','acRHS':'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'};console[_0x34d594(0x14a)](_0x2113cb[_0x34d594(0x13e)](_0x2113cb[_0x34d594(0x13e)](_0x2113cb[_0x34d594(0x140)]+'\x0a'+_0x34d594(0x144)+_0x2113cb['MwAoC']+'\x0a',_0x34d594(0x148))+'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a'+'\x0a',_0x2113cb['gXupr'])+_0x2113cb['acRHS']),process['exit'](0x1);}function _0x58a2(){var _0x4d6e54=['To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','20yHLWzs','9862jAopkZ','12gquAxc','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','3597786IUcqdM','error','95156MviuOW','551200HJJaTN','iRcJC','10fccTWo','EFHvb','1558062CFAhjD','1463520wbAtYx','567686ufGzjM'];_0x58a2=function(){return _0x4d6e54;};return _0x58a2();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x19dd09,_0x2de59c){const _0x5c0c14=_0x2735,_0x439766=_0x19dd09();while(!![]){try{const _0x3ab31e=-parseInt(_0x5c0c14(0xcf))/0x1+parseInt(_0x5c0c14(0xa5))/0x2*(-parseInt(_0x5c0c14(0xd0))/0x3)+-parseInt(_0x5c0c14(0xd6))/0x4+-parseInt(_0x5c0c14(0xd1))/0x5+-parseInt(_0x5c0c14(0xc7))/0x6*(parseInt(_0x5c0c14(0xa7))/0x7)+-parseInt(_0x5c0c14(0xd3))/0x8*(parseInt(_0x5c0c14(0xc1))/0x9)+parseInt(_0x5c0c14(0xaf))/0xa;if(_0x3ab31e===_0x2de59c)break;else _0x439766['push'](_0x439766['shift']());}catch(_0x5a47de){_0x439766['push'](_0x439766['shift']());}}}(_0x3018,0x26f10));import{join}from'path';function _0x2735(_0x6c1d5b,_0x5651a2){_0x6c1d5b=_0x6c1d5b-0xa2;const _0x30188e=_0x3018();let _0x273525=_0x30188e[_0x6c1d5b];return _0x273525;}import{existsSync}from'fs';import _0x171137 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x310cc8){const _0x203d51=_0x2735,_0x2bcf10={'MtYcO':function(_0x2f7169,_0x632654){return _0x2f7169(_0x632654);},'YBBkR':'✓\x20Claude\x20Code\x20plugin\x20already\x20installed','viGPW':_0x203d51(0xca),'vZack':_0x203d51(0xc5),'JTbOH':_0x203d51(0xb0),'kkChY':_0x203d51(0xb8),'fOJGB':'User\x20(available\x20in\x20all\x20your\x20projects)','wYHGC':'Project\x20(shared\x20with\x20team\x20via\x20git)','XTizp':_0x203d51(0xcc),'sXdRj':'user','bKvMU':_0x203d51(0xc0),'gkvTz':'plugin','uvgtN':'marketplace','HrEqW':_0x203d51(0xb7),'TBUEU':'ranger-testing/trailhead','IPRgB':'❌\x20Failed\x20to\x20add\x20marketplace:','zYbSk':'\x0aYou\x20can\x20install\x20manually\x20with:','uPcYq':'ranger@trailhead','IYeSs':'--scope','zPoGW':function(_0x126336){return _0x126336();},'hlOoK':'✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','KkJMH':'enable','FVMJv':function(_0x3a5ed1,_0x297e71,_0x1742d5){return _0x3a5ed1(_0x297e71,_0x1742d5);},'bJUEW':function(_0x5d4c8a,_0x5da581){return _0x5d4c8a===_0x5da581;},'HpgNH':_0x203d51(0xbb)},_0x324a20=await _0x2bcf10[_0x203d51(0xbf)](isPluginInstalled,_0x203d51(0xae));if(_0x324a20)return console[_0x203d51(0xcb)](_0x2bcf10[_0x203d51(0xc2)]),![];const _0x179024=_0x2bcf10['MtYcO'](existsSync,join(getProjectRoot(),_0x2bcf10['viGPW']));let _0x2892e2;if(_0x310cc8)_0x2892e2=_0x310cc8;else{if(_0x179024)_0x2892e2='project';else{console['log'](_0x2bcf10['vZack']);const _0x22719e=await _0x171137[_0x203d51(0xa4)]([{'type':'list','name':_0x2bcf10['JTbOH'],'message':_0x2bcf10[_0x203d51(0xaa)],'choices':[{'name':_0x2bcf10['fOJGB'],'value':'user'},{'name':_0x2bcf10['wYHGC'],'value':_0x2bcf10['XTizp']}],'default':_0x2bcf10[_0x203d51(0xbd)]}]);_0x2892e2=_0x22719e['pluginScope'];}}console[_0x203d51(0xcb)](_0x203d51(0xba)+_0x2892e2+'\x20level)...\x0a');const _0x10d8b7=await _0x2bcf10['MtYcO'](isMarketplaceAdded,_0x2bcf10[_0x203d51(0xa2)]);let _0x4d5a83=_0x10d8b7;if(_0x10d8b7)console['log']('✓\x20Marketplace\x20already\x20added');else{const _0x524f0b=await runClaudeCommand([_0x2bcf10['gkvTz'],_0x2bcf10[_0x203d51(0xbe)],_0x2bcf10['HrEqW'],_0x2bcf10[_0x203d51(0xc3)]]);!_0x524f0b['success']?(console['error'](_0x2bcf10['IPRgB'],_0x524f0b[_0x203d51(0xa6)]),console[_0x203d51(0xcb)](_0x2bcf10[_0x203d51(0xb9)]),console[_0x203d51(0xcb)](_0x203d51(0xac)),console[_0x203d51(0xcb)](_0x203d51(0xbc)+_0x2892e2)):_0x4d5a83=!![];}if(_0x4d5a83){const _0xef6eb3=await runClaudeCommand([_0x2bcf10['gkvTz'],_0x203d51(0xc9),_0x2bcf10[_0x203d51(0xb4)],_0x2bcf10[_0x203d51(0xd5)],_0x2892e2],{'cwd':_0x2892e2===_0x203d51(0xcc)?_0x2bcf10[_0x203d51(0xa3)](getProjectRoot):undefined});if(!_0xef6eb3['success'])console[_0x203d51(0xa6)](_0x203d51(0xce),_0xef6eb3['error']),console['log'](_0x203d51(0xc6)),console['log'](_0x203d51(0xbc)+_0x2892e2);else{console[_0x203d51(0xcb)](_0x2bcf10['hlOoK']);const _0x4a6a77=[_0x203d51(0xb5),_0x2bcf10['KkJMH'],_0x2bcf10[_0x203d51(0xb4)]];_0x2892e2===_0x2bcf10[_0x203d51(0xc4)]&&_0x4a6a77[_0x203d51(0xc8)](_0x2bcf10[_0x203d51(0xd5)],'project');const _0x5cbd67=await _0x2bcf10['FVMJv'](runClaudeCommand,_0x4a6a77,{'captureOutput':!![],'cwd':_0x2bcf10['bJUEW'](_0x2892e2,_0x2bcf10['XTizp'])?getProjectRoot():undefined}),_0x4e4755=_0x5cbd67[_0x203d51(0xb6)]?.[_0x203d51(0xb3)]('already\x20enabled');!_0x5cbd67[_0x203d51(0xb1)]&&!_0x4e4755?console[_0x203d51(0xa6)](_0x203d51(0xcd),_0x5cbd67['error']):console[_0x203d51(0xcb)](_0x2bcf10['HpgNH']);}}return!![];}function _0x3018(){const _0x413aba=['confirm','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','ajEkH','ranger@trailhead','12023390jUQtBK','pluginScope','success','SKILL.md','includes','uPcYq','plugin','output','add','Where\x20should\x20the\x20plugin\x20be\x20installed?','zYbSk','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','✓\x20Claude\x20Code\x20plugin\x20enabled','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','sXdRj','uvgtN','MtYcO','trailhead','9sNCaje','YBBkR','TBUEU','XTizp','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','\x0aYou\x20can\x20install\x20manually\x20with:','6sJtetI','push','install','.claude','log','project','⚠\x20Failed\x20to\x20enable\x20plugin:','❌\x20Failed\x20to\x20install\x20plugin:','91176Hxngir','3ijyMpn','418140VuKTAw','wantsSkillup','754104DYRVRz','GoUTA','IYeSs','1269188ejAHyl','bKvMU','zPoGW','prompt','520794UtRYsd','error','1372518GuBlec','ranger','vsMXl','kkChY'];_0x3018=function(){return _0x413aba;};return _0x3018();}export async function ensureClaudeSkills(_0x5e0334){const _0x22e784=_0x2735,_0x3023ad={'ajEkH':function(_0x1c4e0f,_0x1da4a9){return _0x1c4e0f(_0x1da4a9);},'ZUbsW':'ranger','asoMt':function(_0x28d71e,_0x5cb07c,_0x554ca0,_0x52b668){return _0x28d71e(_0x5cb07c,_0x554ca0,_0x52b668);},'vsMXl':'SKILL.md','zVQBm':'✓\x20Ranger\x20skills\x20already\x20installed','ppkrj':function(_0x2b5a46,_0x18d54a,_0x171485){return _0x2b5a46(_0x18d54a,_0x171485);},'FAojJ':function(_0x2431e3){return _0x2431e3();},'GoUTA':'project','aYqKC':_0x22e784(0xd2)},_0x530593=_0x3023ad[_0x22e784(0xad)](existsSync,join(getSkillsDir('user'),_0x3023ad['ZUbsW'],_0x22e784(0xb2))),_0x9a174f=existsSync(_0x3023ad['asoMt'](join,getSkillsDir(_0x22e784(0xcc)),_0x22e784(0xa8),_0x3023ad[_0x22e784(0xa9)]));if(_0x530593||_0x9a174f)return console[_0x22e784(0xcb)](_0x3023ad['zVQBm']),![];const _0x275d86=existsSync(_0x3023ad['ppkrj'](join,_0x3023ad['FAojJ'](getProjectRoot),'.claude'));let _0x1a8b9d=!![];if(_0x5e0334)await skillup({'autoInstall':_0x5e0334,'suppressUsage':!![]});else{if(_0x275d86)await skillup({'autoInstall':_0x3023ad[_0x22e784(0xd4)],'suppressUsage':!![]});else{const _0x1884cb=await _0x171137[_0x22e784(0xa4)]([{'type':_0x22e784(0xab),'name':_0x3023ad['aYqKC'],'message':'Would\x20you\x20like\x20to\x20install\x20skills?','default':!![]}]);_0x1a8b9d=_0x1884cb[_0x22e784(0xd2)],_0x1a8b9d&&await skillup({'suppressUsage':!![]});}}return _0x1a8b9d;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x3423(_0x16611a,_0x4f93a3){_0x16611a=_0x16611a-0x1a4;const _0x19ba98=_0x19ba();let _0x3423b6=_0x19ba98[_0x16611a];return _0x3423b6;}function _0x19ba(){const _0x527fe3=['6wPbiFw','104302oRluLC','Project\x20(shared\x20with\x20team\x20via\x20git)','389618hcnzQi','40ygYhDe','pluginScope','9FBgoWZ','270262yWlKjD','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','project','1050126BoSmah','https://opencode.ai/config.json','plugin','154450fUpqpp','opencode.json','Failed\x20to\x20read\x20opencode.json','MsPvu','3262408yxVssP','290JictkE','isArray','KRwPt','list','\x0a📦\x20OpenCode\x20Plugin\x0a','User\x20(available\x20in\x20all\x20your\x20projects)','$schema','2119146AsHJBr','user'];_0x19ba=function(){return _0x527fe3;};return _0x19ba();}(function(_0x1f5c33,_0x13d8fb){const _0x1d7f83=_0x3423,_0x401eed=_0x1f5c33();while(!![]){try{const _0x5649b3=parseInt(_0x1d7f83(0x1a5))/0x1+parseInt(_0x1d7f83(0x1bc))/0x2*(-parseInt(_0x1d7f83(0x1b9))/0x3)+-parseInt(_0x1d7f83(0x1bd))/0x4*(-parseInt(_0x1d7f83(0x1ab))/0x5)+parseInt(_0x1d7f83(0x1b7))/0x6+-parseInt(_0x1d7f83(0x1a8))/0x7+-parseInt(_0x1d7f83(0x1af))/0x8*(parseInt(_0x1d7f83(0x1a4))/0x9)+-parseInt(_0x1d7f83(0x1b0))/0xa*(-parseInt(_0x1d7f83(0x1ba))/0xb);if(_0x5649b3===_0x13d8fb)break;else _0x401eed['push'](_0x401eed['shift']());}catch(_0x121097){_0x401eed['push'](_0x401eed['shift']());}}}(_0x19ba,0x3f736));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x5a298e from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x887173){const _0x58da82=_0x3423,_0x520093={'MsPvu':_0x58da82(0x1a7),'ofpKs':_0x58da82(0x1b4),'pAEcU':'pluginScope','aetqA':_0x58da82(0x1b5),'KRwPt':_0x58da82(0x1b8),'tBBnl':function(_0x321fcf,_0x550ce1){return _0x321fcf(_0x550ce1);},'sxmxd':_0x58da82(0x1a6),'zWfzh':_0x58da82(0x1ad),'rSDmz':function(_0x5a63eb,_0x2c072a,_0x301a97){return _0x5a63eb(_0x2c072a,_0x301a97);},'GKnDw':function(_0x18baeb,_0x18171c,_0x7ad589){return _0x18baeb(_0x18171c,_0x7ad589);}},_0xd16b4f=existsSync(join(getOpencodeConfigDir(_0x58da82(0x1a7)),'opencode.json'));let _0x50b32a;if(_0x887173)_0x50b32a=_0x887173;else{if(_0xd16b4f)_0x50b32a=_0x520093[_0x58da82(0x1ae)];else{console['log'](_0x520093['ofpKs']);const _0x4985f9=await _0x5a298e['prompt']([{'type':_0x58da82(0x1b3),'name':_0x520093['pAEcU'],'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x520093['aetqA'],'value':_0x520093[_0x58da82(0x1b2)]},{'name':_0x58da82(0x1bb),'value':_0x520093[_0x58da82(0x1ae)]}],'default':'user'}]);_0x50b32a=_0x4985f9[_0x58da82(0x1be)];}}const _0x14c981=join(_0x520093['tBBnl'](getOpencodeConfigDir,_0x50b32a),_0x58da82(0x1ac)),_0x4b6f12='@ranger-testing/opencode-plugin',_0x26a4d7=_0x58da82(0x1a9);let _0x338366={};if(existsSync(_0x14c981))try{const _0xd0dc27=await readFile(_0x14c981,'utf-8');_0x338366=JSON['parse'](_0xd0dc27);}catch(_0x5aa86d){return console['error'](_0x520093['sxmxd']),{'configured':![],'scope':_0x50b32a,'error':_0x520093['zWfzh'],'details':_0x5aa86d};}const _0x14ddf7=Array[_0x58da82(0x1b1)](_0x338366['plugin'])?_0x338366[_0x58da82(0x1aa)]:[];if(_0x14ddf7['includes'](_0x4b6f12))return console['log']('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x50b32a};return _0x338366[_0x58da82(0x1b6)]=_0x338366[_0x58da82(0x1b6)]||_0x26a4d7,_0x338366['plugin']=[..._0x14ddf7,_0x4b6f12],await _0x520093['rSDmz'](mkdir,getOpencodeConfigDir(_0x50b32a),{'recursive':!![]}),await _0x520093['GKnDw'](writeFile,_0x14c981,JSON['stringify'](_0x338366,null,0x2)+'\x0a'),console['log']('✓\x20OpenCode\x20plugin\x20configured'),{'configured':!![],'scope':_0x50b32a};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xab84c2,_0x54cb03){var _0x992549=_0x4477,_0x54ae0=_0xab84c2();while(!![]){try{var _0x2051e4=parseInt(_0x992549(0x6c))/0x1+-parseInt(_0x992549(0x71))/0x2+parseInt(_0x992549(0x6d))/0x3+-parseInt(_0x992549(0x6f))/0x4+-parseInt(_0x992549(0x70))/0x5+-parseInt(_0x992549(0x74))/0x6+parseInt(_0x992549(0x6b))/0x7*(parseInt(_0x992549(0x75))/0x8);if(_0x2051e4===_0x54cb03)break;else _0x54ae0['push'](_0x54ae0['shift']());}catch(_0x437db8){_0x54ae0['push'](_0x54ae0['shift']());}}}(_0x3495,0x8dd09));function _0x4477(_0x5bdd63,_0x10fc2e){_0x5bdd63=_0x5bdd63-0x6a;var _0x349562=_0x3495();var _0x447758=_0x349562[_0x5bdd63];return _0x447758;}function _0x3495(){var _0xfe0e71=['ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','1862344WQtkMe','4268875umUCOe','640032VdMSxR','exit','QPDjP','376296qIGOYv','246272ZtwQSt','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','231LdWzJA','884563gpfTBP','1147593lzYCPL'];_0x3495=function(){return _0xfe0e71;};return _0x3495();}export async function setupCi(_0x14ab1e,_0x5771a8,_0x530e07){var _0x27399f=_0x4477,_0x564047={'QPDjP':function(_0x22e48d,_0x362a96){return _0x22e48d+_0x362a96;}};console['error'](_0x564047[_0x27399f(0x73)](_0x564047[_0x27399f(0x73)](_0x564047[_0x27399f(0x73)](_0x564047['QPDjP'](_0x27399f(0x6e)+'\x0a','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a')+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','\x0a'),_0x27399f(0x6a)),'\x20\x20https://docs.ranger.net/main/concepts/profiles')),process[_0x27399f(0x72)](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x39f698,_0x176205){const _0x421845=_0x4b4c,_0x54ce4c=_0x39f698();while(!![]){try{const _0x350399=-parseInt(_0x421845(0x12a))/0x1+-parseInt(_0x421845(0x127))/0x2*(-parseInt(_0x421845(0x135))/0x3)+parseInt(_0x421845(0x14a))/0x4*(parseInt(_0x421845(0x141))/0x5)+-parseInt(_0x421845(0x133))/0x6+-parseInt(_0x421845(0x14d))/0x7*(-parseInt(_0x421845(0x148))/0x8)+parseInt(_0x421845(0x132))/0x9*(-parseInt(_0x421845(0x137))/0xa)+-parseInt(_0x421845(0x13e))/0xb;if(_0x350399===_0x176205)break;else _0x54ce4c['push'](_0x54ce4c['shift']());}catch(_0x20ae1b){_0x54ce4c['push'](_0x54ce4c['shift']());}}}(_0x4523,0x8f1bf));import{basename}from'path';import _0x1396b1 from'inquirer';import{getToken}from'./utils/keychain.js';function _0x4b4c(_0x3b7b4c,_0x477e21){_0x3b7b4c=_0x3b7b4c-0x124;const _0x4523e1=_0x4523();let _0x4b4c2e=_0x4523e1[_0x3b7b4c];return _0x4b4c2e;}import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';function _0x4523(){const _0x429018=['ranger','stdin','message','637641BNZvzs','1938756svTzUJ','BaBDQ','57NzTVbv','\x20\x202.\x20Run:\x20ranger\x20setup','60XLwAga','autoInstall','installLevel','Where\x20should\x20skills\x20be\x20installed?','To\x20use:','kWLzm','log','8306958Lbjmgb','\x20--opencode','claude','15SqkBUw','opencode','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','jlhrS','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','\x20skill','FNtsi','8ENSagx','djeqo','346252CjaoMy','StPiW','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','5737473JahbOm','\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!','This\x20project\x20only\x20(','ijOpS','stdout','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','UWODQ','/skills/','isTTY','To\x20get\x20started:','119694CMjAQG','/.opencode/skills/','KVxek','126848fskbmu','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','warn','user','QAoOn'];_0x4523=function(){return _0x429018;};return _0x4523();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x4a90fb={}){const _0x44f0c0=_0x4b4c,_0x44fabb={'StPiW':_0x44f0c0(0x140),'kWLzm':_0x44f0c0(0x145),'FNtsi':function(_0x4f7564,_0x3b32be){return _0x4f7564===_0x3b32be;},'jlhrS':'opencode','BaBDQ':_0x44f0c0(0x13f),'djeqo':_0x44f0c0(0x12b),'CiwYq':function(_0x248e53){return _0x248e53();},'JXnrp':function(_0x24339b,_0x302ec3){return _0x24339b===_0x302ec3;},'GRHnm':function(_0x432bfd,_0xa175aa){return _0x432bfd(_0xa175aa);},'KVxek':'installLevel','hxmRm':_0x44f0c0(0x13a),'BZruJ':_0x44f0c0(0x12d),'UWODQ':'project','ijOpS':'\x0a📦\x20Installing\x20skills...\x0a','ozNRT':function(_0x3b15de,_0x30ce1b){return _0x3b15de>_0x30ce1b;},'nVJvL':function(_0x5c52c6,_0x109d81){return _0x5c52c6>_0x109d81;},'QAoOn':_0x44f0c0(0x13b),'ZTIJX':function(_0x579257,_0x8b427f){return _0x579257===_0x8b427f;},'TLTCp':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.'};console['log']('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x43bcbd=_0x4a90fb['platform']??_0x44fabb[_0x44f0c0(0x14b)],_0x2d10a5=await getToken();if(!_0x2d10a5){const _0x3fc6de='0|3|4|1|5|2'['split']('|');let _0xc4bbfb=0x0;while(!![]){switch(_0x3fc6de[_0xc4bbfb++]){case'0':console[_0x44f0c0(0x13d)](_0x44fabb[_0x44f0c0(0x13c)]);continue;case'1':console[_0x44f0c0(0x13d)](_0x44f0c0(0x136)+(_0x44fabb[_0x44f0c0(0x147)](_0x43bcbd,_0x44fabb[_0x44f0c0(0x144)])?_0x44fabb['BaBDQ']:'')+'\x20<your-api-token>');continue;case'2':return;case'3':console['log'](_0x44f0c0(0x126));continue;case'4':console[_0x44f0c0(0x13d)](_0x44fabb[_0x44f0c0(0x149)]);continue;case'5':console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x43bcbd==='opencode'?_0x44fabb[_0x44f0c0(0x134)]:'')+'\x0a');continue;}break;}}console[_0x44f0c0(0x13d)]('✓\x20Found\x20API\x20token');const _0x567b72=_0x44fabb['CiwYq'](getProjectRoot),_0x410b13=basename(_0x567b72),_0x3233e7=_0x44fabb['JXnrp'](_0x43bcbd,_0x44fabb[_0x44f0c0(0x144)])?_0x44fabb['GRHnm'](getOpencodeConfigDir,_0x44f0c0(0x12d))+_0x44f0c0(0x124):getClaudeConfigDir()+_0x44f0c0(0x124),_0x53e0c8=_0x43bcbd===_0x44f0c0(0x142)?_0x567b72+_0x44f0c0(0x128):_0x567b72+'/.claude/skills/',_0x44313d=process[_0x44f0c0(0x130)][_0x44f0c0(0x125)]&&process[_0x44f0c0(0x151)][_0x44f0c0(0x125)];let _0x3fefc7;if(_0x4a90fb[_0x44f0c0(0x138)])_0x3fefc7=_0x4a90fb[_0x44f0c0(0x138)];else{if(_0x44313d){const _0x1f10b9=await _0x1396b1['prompt']([{'type':'list','name':_0x44fabb[_0x44f0c0(0x129)],'message':_0x44fabb['hxmRm'],'choices':[{'name':'All\x20projects\x20('+_0x3233e7+')','value':_0x44fabb['BZruJ']},{'name':_0x44f0c0(0x14f)+_0x53e0c8+')','value':_0x44fabb[_0x44f0c0(0x153)]}]}]);_0x3fefc7=_0x1f10b9[_0x44f0c0(0x139)];}else _0x3fefc7=_0x44fabb['UWODQ'],console['log'](_0x44f0c0(0x143)+_0x53e0c8+')');}let _0xbda909=0x0;const _0x435bfc=getCurrentVersion();console[_0x44f0c0(0x13d)](_0x44fabb[_0x44f0c0(0x150)]);try{const _0x4b29cb=await installSkill(_0x44f0c0(0x12f),{'cliVersion':_0x435bfc,'level':_0x3fefc7,'platform':_0x43bcbd});_0x4b29cb&&_0xbda909++;}catch(_0x1053e5){console[_0x44f0c0(0x12c)](_0x44f0c0(0x14c),_0x1053e5 instanceof Error?_0x1053e5[_0x44f0c0(0x131)]:_0x1053e5);}if(_0x44fabb['ozNRT'](_0xbda909,0x0)){const _0x3be209=_0x3fefc7===_0x44fabb['BZruJ']?'user-level':'project-level';console['log']('\x0a✅\x20Installed\x20'+_0xbda909+'\x20'+_0x3be209+_0x44f0c0(0x146)+(_0x44fabb['nVJvL'](_0xbda909,0x1)?'s':'')+'\x20successfully!\x0a'),!_0x4a90fb['suppressUsage']&&(console['log'](_0x44fabb[_0x44f0c0(0x12e)]),_0x44fabb['ZTIJX'](_0x43bcbd,_0x44f0c0(0x142))?console['log'](_0x44fabb['TLTCp']):console['log'](_0x44f0c0(0x14e)));}else console[_0x44f0c0(0x13d)](_0x44f0c0(0x152));}
|
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
|
+
(function(_0x43f370,_0xf392d5){const _0x357ed6=_0x426c,_0x41e90e=_0x43f370();while(!![]){try{const _0x295eb0=parseInt(_0x357ed6(0x1cf))/0x1*(-parseInt(_0x357ed6(0x1c2))/0x2)+parseInt(_0x357ed6(0x1b3))/0x3+-parseInt(_0x357ed6(0x223))/0x4+-parseInt(_0x357ed6(0x21f))/0x5+-parseInt(_0x357ed6(0x205))/0x6*(parseInt(_0x357ed6(0x1d6))/0x7)+parseInt(_0x357ed6(0x1b8))/0x8*(-parseInt(_0x357ed6(0x1df))/0x9)+-parseInt(_0x357ed6(0x1fc))/0xa*(-parseInt(_0x357ed6(0x213))/0xb);if(_0x295eb0===_0xf392d5)break;else _0x41e90e['push'](_0x41e90e['shift']());}catch(_0x24360e){_0x41e90e['push'](_0x41e90e['shift']());}}}(_0x2b07,0x4b485));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x426c(_0x2e38be,_0x3ef5d7){_0x2e38be=_0x2e38be-0x1b2;const _0x2b07b8=_0x2b07();let _0x426c93=_0x2b07b8[_0x2e38be];return _0x426c93;}import{createRequire}from'module';import{spawn}from'child_process';import _0x53a6b0 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);function _0x2b07(){const _0xa4696=['\x20now?','✓\x20Authenticated\x20to\x20','✓\x20Exported\x20credentials\x20for\x20CI','local','method','plugin','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','37JGZldS','REPoX','skipChromium','xsSVx','version','organizationName','Validating\x20API\x20token...','1062502YGGqRa','auXui','ranger','YhgIN','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','\x20is\x20no\x20longer\x20supported.\x20','confirm','9sdrOqx','resolve','\x0a🚀\x20Ranger\x20Setup\x0a','status','ready','url','profile','chromium','ignore','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','close','tfVZQ','UmrYq','mBjlD','rrNOB','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','trackPhaseEnd','aHNLo','\x20(fallback\x20version)','ZZJLK','success','The\x20required\x20version\x20(','skipAuth','GBGTp','rpiYp','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','1150zKfzQx','bzfNC','platform','scope','✓\x20Already\x20authenticated\x20to\x20','existing_token','pBlFQ','...','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','6SENIle','\x0aInstalling\x20Chromium\x20browser...\x0a','user','geJTy','DnDkR','igzdi','ENWEj','error','OSIwM','playwright/package.json','lHlLC','inherit','win32','isTTY','133265CeKJXZ','trackPhaseStart','warn','GITHUB_ENV','provided_token','/ranger:enable','CMTXz','YYGHh','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','exit','xdPoa','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','328850xWsfPF','\x0a\x20\x20','opencode','skipped','453280pwXGoY','message','ilOHP','--with-deps','coboP','force','✓\x20Created\x20~/.ranger/\x20directory','880017pPAfmJ','log','stdout','cevzZ','\x20and\x20prompt\x20the\x20coding','4616488KKimgi','device_auth','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','wKvSa','skills','DEcgd','lDfoE','JxYJG','25420CBziTO','npx','.gitignore','\x20\x20npx\x20playwright@',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','zHxNt'];_0x2b07=function(){return _0xa4696;};return _0x2b07();}export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x888b14=>'\x1b[1m'+_0x888b14+'\x1b[0m';export function getPlaywrightVersion(){const _0x1ae2f0=_0x426c;try{const _0x792ae4=require[_0x1ae2f0(0x1e0)](_0x1ae2f0(0x20e)),_0x140b83=require(_0x792ae4);return _0x140b83[_0x1ae2f0(0x1d3)];}catch{return null;}}export function installChromiumBinary(_0x1e8ad3,_0x2848cb=![]){const _0x138f73=_0x426c,_0x299aed={'otxmL':function(_0x32237d){return _0x32237d();},'lzHgg':_0x138f73(0x226),'ZZJLK':'chromium','NbQwg':function(_0x361c67,_0x5e3cfd,_0x4a41ff,_0x48c468){return _0x361c67(_0x5e3cfd,_0x4a41ff,_0x48c468);},'MNYEz':_0x138f73(0x1e7),'wKvSa':_0x138f73(0x210),'cwCUB':_0x138f73(0x1eb),'igzdi':'error'};return new Promise((_0x2e1aa7,_0x1e3dde)=>{const _0x2ff49d=_0x138f73,_0x58b497={'IXogc':function(_0xc7fe65,_0x58c315){return _0xc7fe65(_0x58c315);}},_0x25eab3=['playwright@'+_0x1e8ad3,'install',..._0x2848cb?[_0x299aed['lzHgg']]:[],_0x299aed[_0x2ff49d(0x1f5)]],_0x352f81=_0x299aed['NbQwg'](spawn,_0x2ff49d(0x1c3),_0x25eab3,{'stdio':[_0x299aed['MNYEz'],_0x299aed[_0x2ff49d(0x1bd)],_0x2ff49d(0x210)],'shell':process[_0x2ff49d(0x1fe)]===_0x2ff49d(0x211)});_0x352f81['on'](_0x299aed['cwCUB'],_0x4116b5=>{_0x4116b5===0x0?_0x299aed['otxmL'](_0x2e1aa7):_0x1e3dde(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x4116b5));}),_0x352f81['on'](_0x299aed[_0x2ff49d(0x20a)],_0xd15bb3=>{_0x58b497['IXogc'](_0x1e3dde,_0xd15bb3);});});}export async function authenticate(_0x2b554a){const _0x193f9b=_0x426c,_0x50455c={'xsSVx':function(_0xb8c422){return _0xb8c422();},'YhgIN':function(_0x3f3ef4,_0x1596f2){return _0x3f3ef4(_0x1596f2);},'DnDkR':function(_0x33f167,_0x81cafc){return _0x33f167(_0x81cafc);},'xGdhM':_0x193f9b(0x1b9),'SykQX':_0x193f9b(0x1d5)};if(!_0x2b554a){const _0x108d47=await _0x50455c[_0x193f9b(0x1d2)](getToken);if(_0x108d47){const _0xea928b=await _0x50455c['YhgIN'](getCurrentUser,_0x108d47);if(_0xea928b[_0x193f9b(0x1f6)])return console[_0x193f9b(0x1b4)](_0x193f9b(0x200)+_0xea928b[_0x193f9b(0x207)]['organizationName']),{'token':_0x108d47,'method':_0x193f9b(0x201)};}try{_0x2b554a=await _0x50455c[_0x193f9b(0x1d2)](runDeviceAuthFlow);}catch(_0xe0dc74){throw new Error('Authentication\x20failed:\x20'+(_0xe0dc74 instanceof Error?_0xe0dc74[_0x193f9b(0x224)]:_0xe0dc74));}const _0x33bc83=await _0x50455c[_0x193f9b(0x209)](getCurrentUser,_0x2b554a);if(!_0x33bc83['success'])throw new Error(_0x193f9b(0x1bc)+_0x33bc83[_0x193f9b(0x20c)]);return console[_0x193f9b(0x1b4)](_0x193f9b(0x1c9)+_0x33bc83['user']['organizationName']),{'token':_0x2b554a,'method':_0x50455c['xGdhM']};}console[_0x193f9b(0x1b4)](_0x50455c['SykQX']);const _0x3dc51a=await getCurrentUser(_0x2b554a);if(!_0x3dc51a[_0x193f9b(0x1f6)]){if(_0x3dc51a[_0x193f9b(0x1e2)])throw new Error('Authentication\x20failed:\x20'+_0x3dc51a[_0x193f9b(0x20c)]+_0x193f9b(0x1ce));else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x3dc51a['error']+_0x193f9b(0x21b));}return console['log']('✓\x20Authenticated\x20to\x20'+_0x3dc51a['user'][_0x193f9b(0x1d4)]),await _0x50455c[_0x193f9b(0x1d9)](storeToken,_0x2b554a),console['log'](process['env'][_0x193f9b(0x216)]?_0x193f9b(0x1ca):'✓\x20Stored\x20credentials\x20locally'),{'token':_0x2b554a,'method':_0x193f9b(0x217)};}export async function ensureRangerDir(_0x3d3bf3){const _0x3b9616=_0x426c,_0x3126b8={'tfVZQ':function(_0x14db8b,_0x2567b5,_0x546b0b){return _0x14db8b(_0x2567b5,_0x546b0b);},'REPoX':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x3d3bf3;const _0x3c5597=getRangerHomeDir();return!existsSync(_0x3c5597)?(await _0x3126b8[_0x3b9616(0x1ec)](mkdir,_0x3c5597,{'recursive':!![]}),console[_0x3b9616(0x1b4)](_0x3b9616(0x1b2)),{'path':_0x3c5597,'installed':!![]}):(console[_0x3b9616(0x1b4)](_0x3126b8[_0x3b9616(0x1d0)]),{'path':_0x3c5597,'installed':![]});}export async function ensureChromium(_0x417eef=![]){const _0x19d84a=_0x426c,_0x7f4ae0={'DUSIF':function(_0x4859b5,_0x1702e3){return _0x4859b5(_0x1702e3);},'rpiYp':function(_0xe3c78b){return _0xe3c78b();},'rFvGi':_0x19d84a(0x1de),'cevzZ':'install','JxYJG':function(_0x424526,_0x49d380,_0x873e70){return _0x424526(_0x49d380,_0x873e70);},'NcZlR':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','ztbOn':function(_0x34a666,_0x54bbb7){return _0x34a666 instanceof _0x54bbb7;},'eDefO':'You\x20can\x20install\x20it\x20manually\x20by\x20running:','bTtLM':'\x0a⚠\x20Skipping\x20Chromium\x20installation.','ppmVO':_0x19d84a(0x1ea)};let _0x5229ed=![];try{const _0xca96bb=chromium['executablePath']();_0x5229ed=_0x7f4ae0['DUSIF'](existsSync,_0xca96bb);}catch{_0x5229ed=![];}if(_0x5229ed)return console[_0x19d84a(0x1b4)]('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x216e4c=_0x7f4ae0[_0x19d84a(0x1fa)](getPlaywrightVersion),_0x16fdaf=_0x216e4c??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x10f6b3=!_0x216e4c,_0x4ce33c=process['stdin'][_0x19d84a(0x212)]&&process[_0x19d84a(0x1b5)][_0x19d84a(0x212)];let _0x289bd0=!![];if(_0x4ce33c){const {install:_0xe9797}=await _0x53a6b0['prompt']([{'type':_0x7f4ae0['rFvGi'],'name':_0x7f4ae0[_0x19d84a(0x1b6)],'message':_0x10f6b3?_0x19d84a(0x1f0)+_0x16fdaf+_0x19d84a(0x1c8):_0x19d84a(0x1f7)+_0x16fdaf+_0x19d84a(0x1c6),'default':!![]}]);_0x289bd0=_0xe9797;}else console[_0x19d84a(0x1b4)](_0x19d84a(0x1fb)+_0x16fdaf+(_0x10f6b3?_0x19d84a(0x1f4):'')+_0x19d84a(0x203));if(_0x289bd0){console[_0x19d84a(0x1b4)](_0x19d84a(0x206));try{await _0x7f4ae0[_0x19d84a(0x1c1)](installChromiumBinary,_0x16fdaf,_0x417eef),console[_0x19d84a(0x1b4)](_0x7f4ae0['NcZlR']);}catch(_0x3c6976){console['error']('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x7f4ae0['ztbOn'](_0x3c6976,Error)?_0x3c6976['message']:_0x3c6976),console[_0x19d84a(0x1b4)](_0x7f4ae0['eDefO']),console[_0x19d84a(0x1b4)](_0x19d84a(0x1c5)+_0x16fdaf+'\x20install\x20chromium');}}else console['log'](_0x7f4ae0['bTtLM']),console['log'](_0x7f4ae0['ppmVO']),console[_0x19d84a(0x1b4)]('\x20\x20npx\x20playwright@'+_0x16fdaf+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x4aafd9){const _0x3bcdc5=_0x426c,_0x13389e={'GBGTp':function(_0x217daf,_0x4e1c50,_0x2d8fb9){return _0x217daf(_0x4e1c50,_0x2d8fb9);},'ilOHP':_0x3bcdc5(0x1c4),'vAbnL':function(_0x2e0823,_0x1240fc,_0x511063){return _0x2e0823(_0x1240fc,_0x511063);},'epjvk':'✓\x20Created\x20.ranger/.gitignore'},_0x1955e7=_0x13389e[_0x3bcdc5(0x1f9)](join,_0x4aafd9,_0x13389e[_0x3bcdc5(0x225)]),_0x5fd6ed='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await _0x13389e['vAbnL'](writeFile,_0x1955e7,_0x5fd6ed),console['log'](_0x13389e['epjvk']);}export async function ensureLocalEnv(_0x468b5f,_0x2e0485){const _0x2712cc=_0x426c,_0x5b53e1={'XAfTa':'⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','rrNOB':_0x2712cc(0x207),'JfQRj':_0x2712cc(0x1cb),'ulXzI':'✓\x20Local\x20profile\x20already\x20exists','bzfNC':function(_0x180e7c,_0x52eff7,_0x3739b7,_0x3bc48e){return _0x180e7c(_0x52eff7,_0x3739b7,_0x3bc48e);},'amhyC':'\x0a❌\x20Profile\x20setup\x20failed:'};if(!findGitRoot()&&_0x468b5f?.[_0x2712cc(0x1ff)]!==_0x2712cc(0x207))return console[_0x2712cc(0x1b4)](_0x5b53e1['XAfTa']),{'ready':![],'skipped':!![]};const _0x139442=_0x468b5f?.['scope']===_0x5b53e1[_0x2712cc(0x1ef)]?getRangerHomeDir():undefined;if(findExistingEnv(_0x5b53e1['JfQRj'],{'locations':['local'],'rangerDir':_0x139442}))return console[_0x2712cc(0x1b4)](_0x5b53e1['ulXzI']),{'ready':!![],'skipped':![]};try{return await _0x5b53e1[_0x2712cc(0x1fd)](addEnv,_0x2712cc(0x1cb),{'url':_0x468b5f?.[_0x2712cc(0x1e4)],'force':_0x468b5f?.[_0x2712cc(0x228)],'allowInsecureLocalhost':_0x468b5f?.['allowInsecureLocalhost'],'scope':_0x468b5f?.[_0x2712cc(0x1ff)]},_0x2e0485),{'ready':!![],'skipped':![]};}catch(_0x494a04){return console[_0x2712cc(0x20c)](_0x5b53e1['amhyC'],_0x494a04 instanceof Error?_0x494a04['message']:_0x494a04),{'ready':![],'skipped':![]};}}export async function start(_0x23dd1d,_0x10a241,_0x17f365){const _0x596c6a=_0x426c,_0x2dfed8={'geJTy':_0x596c6a(0x207),'auXui':function(_0x3adf20,_0x4772bb){return _0x3adf20+_0x4772bb;},'mBjlD':function(_0x17defa,_0x3ab003){return _0x17defa(_0x3ab003);},'lDfoE':'auth','pBlFQ':_0x596c6a(0x1cd),'UmrYq':function(_0x241e7f,_0x3d0e30){return _0x241e7f(_0x3d0e30);},'coboP':function(_0x2145ec){return _0x2145ec();},'ENWEj':_0x596c6a(0x1be),'CMTXz':function(_0x134270,_0x96e414){return _0x134270(_0x96e414);},'xdPoa':function(_0x17c658,_0x348ee8,_0x185db1){return _0x17c658(_0x348ee8,_0x185db1);},'aHNLo':_0x596c6a(0x1e5),'zHxNt':function(_0x3d480c,_0x3af78d){return _0x3d480c+_0x3af78d;},'lHlLC':function(_0x1c44d6,_0x1f7891){return _0x1c44d6(_0x1f7891);},'IGsaJ':'ranger\x20profile\x20add\x20<name>','YYGHh':'\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','KPQMV':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','OSIwM':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','RUPOS':_0x596c6a(0x1dc),'PKgYI':function(_0x5c1abb,_0x6001c){return _0x5c1abb(_0x6001c);},'tbgvU':_0x596c6a(0x218),'DEcgd':function(_0xafed1d,_0x23b8d8){return _0xafed1d+_0x23b8d8;}};console[_0x596c6a(0x1b4)](_0x596c6a(0x1e1));_0x10a241?.['scope']!==undefined&&_0x10a241[_0x596c6a(0x1ff)]!==_0x2dfed8[_0x596c6a(0x208)]&&(console['error'](_0x2dfed8[_0x596c6a(0x1d7)]('ranger\x20setup\x20--scope='+String(_0x10a241[_0x596c6a(0x1ff)])+_0x596c6a(0x1dd),_0x596c6a(0x1ba))+'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.'),process[_0x596c6a(0x21c)](0x1));_0x10a241={..._0x10a241,'scope':'user'};const _0x10c7bc=!_0x2dfed8[_0x596c6a(0x1ee)](existsSync,getRangerHomeDir());await _0x2dfed8['mBjlD'](ensureRangerDir,_0x2dfed8[_0x596c6a(0x208)]);if(_0x10a241?.[_0x596c6a(0x1f8)])console[_0x596c6a(0x1b4)]('✓\x20Skipping\x20authentication\x20(--skip-auth)'),_0x17f365?.['trackPhaseEnd'](_0x2dfed8[_0x596c6a(0x1c0)],{'isFirstRun':_0x10c7bc,'method':'skipped'});else{_0x17f365?.['trackPhaseStart']('auth');const _0x2779d8=await authenticate(_0x23dd1d);_0x17f365?.['trackPhaseEnd'](_0x2dfed8[_0x596c6a(0x1c0)],{'isFirstRun':_0x10c7bc,'method':_0x2779d8[_0x596c6a(0x1cc)]});}_0x17f365?.[_0x596c6a(0x214)](_0x596c6a(0x1e6));_0x10a241?.[_0x596c6a(0x1d1)]?console[_0x596c6a(0x1b4)](_0x596c6a(0x21e)):await _0x2dfed8['mBjlD'](ensureChromium,_0x10a241?.['withDeps']);_0x17f365?.[_0x596c6a(0x1f2)](_0x596c6a(0x1e6),{'isFirstRun':_0x10c7bc,'skipped':!!_0x10a241?.[_0x596c6a(0x1d1)]}),console[_0x596c6a(0x1b4)]('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0x10c6fa=_0x10a241?.[_0x596c6a(0x1ff)],_0x5007d6=_0x10a241?.['opencode']??![];let _0x3e23a7=null;_0x5007d6?(_0x17f365?.['trackPhaseStart'](_0x2dfed8[_0x596c6a(0x202)]),_0x3e23a7=await ensureOpencodePluginConfig(_0x10c6fa),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8['pBlFQ'],{'isFirstRun':_0x10c7bc,'opencode':!![]})):(_0x17f365?.[_0x596c6a(0x214)](_0x2dfed8[_0x596c6a(0x202)]),await _0x2dfed8[_0x596c6a(0x1ed)](ensureClaudePlugin,_0x10c6fa),_0x17f365?.[_0x596c6a(0x1f2)]('plugin',{'isFirstRun':_0x10c7bc}));if(_0x5007d6&&_0x3e23a7){_0x17f365?.['trackPhaseStart']('skills');try{await installSkill(_0x596c6a(0x1d8),{'level':_0x3e23a7[_0x596c6a(0x1ff)],'cliVersion':_0x2dfed8[_0x596c6a(0x227)](getCurrentVersion),'platform':_0x596c6a(0x221)}),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8[_0x596c6a(0x20b)],{'isFirstRun':_0x10c7bc,'opencode':!![]});}catch(_0x7d7273){console[_0x596c6a(0x215)]('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x7d7273 instanceof Error?_0x7d7273[_0x596c6a(0x224)]:_0x7d7273),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8[_0x596c6a(0x20b)],{'isFirstRun':_0x10c7bc,'opencode':!![],'failed':!![]});}}else _0x17f365?.[_0x596c6a(0x214)](_0x2dfed8[_0x596c6a(0x20b)]),await _0x2dfed8[_0x596c6a(0x219)](ensureClaudeSkills,_0x10c6fa),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8['ENWEj'],{'isFirstRun':_0x10c7bc});if(_0x10a241?.['skipAuth'])console['log'](_0x596c6a(0x204));else{if(_0x10a241?.['url']){_0x17f365?.[_0x596c6a(0x214)]('profile');const _0x54f3f3=await _0x2dfed8[_0x596c6a(0x21d)](ensureLocalEnv,{'url':_0x10a241['url'],'force':_0x10a241?.[_0x596c6a(0x228)],'allowInsecureLocalhost':_0x10a241?.['allowInsecureLocalhost'],'scope':_0x596c6a(0x207)},_0x17f365);_0x17f365?.['trackPhaseEnd'](_0x2dfed8[_0x596c6a(0x1f3)],{'isFirstRun':_0x10c7bc,'profileReady':_0x54f3f3[_0x596c6a(0x1e3)],'userSkipped':_0x54f3f3[_0x596c6a(0x222)]});}else console[_0x596c6a(0x1b4)](_0x2dfed8['auXui'](_0x2dfed8[_0x596c6a(0x1d7)](_0x2dfed8['zHxNt'](_0x596c6a(0x1f1),_0x596c6a(0x220)+_0x2dfed8[_0x596c6a(0x20f)](bold,_0x2dfed8['IGsaJ']))+_0x596c6a(0x1e9),_0x596c6a(0x1e8)),_0x596c6a(0x1da)));}if(_0x5007d6)console['log'](_0x2dfed8[_0x596c6a(0x21a)]),console['log'](_0x2dfed8['KPQMV']),console['log'](_0x2dfed8[_0x596c6a(0x20d)]),console[_0x596c6a(0x1b4)](_0x2dfed8['RUPOS']);else{const _0x297575=_0x2dfed8['PKgYI'](bold,_0x2dfed8['tbgvU']);console['log'](_0x2dfed8[_0x596c6a(0x1c7)](_0x2dfed8['auXui'](_0x2dfed8[_0x596c6a(0x1bf)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x297575+_0x596c6a(0x1b7),'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with'),_0x596c6a(0x1db)),_0x596c6a(0x1bb)));}}
|
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 _0x54954e=_0x3c88;(function(_0x3053d3,_0x527049){const _0x4b4cea=_0x3c88,_0x4f14e2=_0x3053d3();while(!![]){try{const _0x3dad6a=parseInt(_0x4b4cea(0x14d))/0x1*(-parseInt(_0x4b4cea(0xfe))/0x2)+parseInt(_0x4b4cea(0xf2))/0x3*(parseInt(_0x4b4cea(0x111))/0x4)+-parseInt(_0x4b4cea(0xea))/0x5*(-parseInt(_0x4b4cea(0x145))/0x6)+-parseInt(_0x4b4cea(0x13a))/0x7*(parseInt(_0x4b4cea(0x123))/0x8)+parseInt(_0x4b4cea(0x143))/0x9+parseInt(_0x4b4cea(0x107))/0xa+-parseInt(_0x4b4cea(0x144))/0xb*(parseInt(_0x4b4cea(0x147))/0xc);if(_0x3dad6a===_0x527049)break;else _0x4f14e2['push'](_0x4f14e2['shift']());}catch(_0x34b089){_0x4f14e2['push'](_0x4f14e2['shift']());}}}(_0x3968,0xc8fc2));import{readFile,readdir}from'fs/promises';function _0x3c88(_0x29798d,_0x3738e4){_0x29798d=_0x29798d-0xe6;const _0x3968e2=_0x3968();let _0x3c88de=_0x3968e2[_0x29798d];return _0x3c88de;}import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x5c773b=>'\x1b[1m'+_0x5c773b+_0x54954e(0x135),link=(_0x29e6a1,_0x33d27c)=>_0x54954e(0x148)+_0x29e6a1+'\x07'+(_0x33d27c||_0x29e6a1)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x317634=_0x54954e,_0x33c722={'KVRnf':_0x317634(0xe8),'wAljD':_0x317634(0xfc),'Yddqr':_0x317634(0x149),'plEDN':'not_configured','fLplX':_0x317634(0x10c),'ALwOb':_0x317634(0x11a),'MiuYD':_0x317634(0x130),'UbdMC':_0x317634(0x137)};return new Promise(_0x177bc7=>{const _0x2400d2=_0x317634,_0x3d8336={'MwESw':_0x33c722[_0x2400d2(0x115)],'wVfqC':_0x33c722[_0x2400d2(0x110)],'cSeDW':_0x33c722[_0x2400d2(0x113)],'MGOSa':function(_0x34ee40,_0x2d4a66){return _0x34ee40(_0x2d4a66);},'HTrWB':_0x33c722['plEDN']},_0x4718c4=spawn('opencode',[_0x33c722['fLplX'],_0x33c722[_0x2400d2(0x14e)]],{'stdio':[_0x33c722['MiuYD'],'pipe','pipe']});let _0x4ffaf5='';_0x4718c4[_0x2400d2(0x11b)]?.['on']('data',_0x403523=>{const _0x5b0027=_0x2400d2;_0x4ffaf5+=_0x403523[_0x5b0027(0xf1)]();}),_0x4718c4['stderr']?.['on'](_0x33c722[_0x2400d2(0x119)],_0x10b89f=>{_0x4ffaf5+=_0x10b89f['toString']();}),_0x4718c4['on'](_0x2400d2(0x109),()=>{_0x177bc7({'status':'not_installed'});}),_0x4718c4['on'](_0x2400d2(0x128),_0x38d9ac=>{const _0x50ac10=_0x2400d2;if(_0x38d9ac!==0x0){_0x177bc7({'status':_0x50ac10(0x14f)});return;}const _0x26387f=_0x4ffaf5['trim']();let _0x1d17fd=null;if(_0x26387f)try{_0x1d17fd=JSON['parse'](_0x26387f);}catch{const _0x3384df=_0x26387f['match'](/\{[\s\S]*\}$/);if(_0x3384df)try{_0x1d17fd=JSON['parse'](_0x3384df[0x0]);}catch{_0x1d17fd=null;}}const _0x1a34ab=Array['isArray'](_0x1d17fd?.['plugin'])?_0x1d17fd?.[_0x50ac10(0xf6)]:[],_0x75775c=_0x1a34ab['some'](_0x406810=>{const _0x295c5b=_0x50ac10;if(typeof _0x406810!==_0x3d8336['MwESw'])return![];return _0x406810['includes'](_0x295c5b(0x14b))||_0x406810[_0x295c5b(0x105)](_0x3d8336[_0x295c5b(0x14a)]);});if(_0x75775c){_0x177bc7({'status':_0x3d8336['cSeDW'],'details':_0x1a34ab[_0x50ac10(0xf8)]>0x0?_0x1a34ab['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x1a34ab['length']>0x0){_0x3d8336[_0x50ac10(0xf0)](_0x177bc7,{'status':_0x3d8336['HTrWB'],'details':_0x1a34ab['length']+'\x20plugin(s)\x20configured'});return;}_0x3d8336[_0x50ac10(0xf0)](_0x177bc7,{'status':_0x50ac10(0x11e)});});});}async function getSkillsFromDir(_0x4a1428,_0x1ff255){const _0x4b848c=_0x54954e,_0x4a9667={'nzGvf':function(_0x446dc6,_0x9423a6){return _0x446dc6(_0x9423a6);},'OtxBg':function(_0x4fcb3f,_0x23f049,_0x54c405){return _0x4fcb3f(_0x23f049,_0x54c405);},'pKByD':'SKILL.md','CLnKv':function(_0x55efe6,_0x54da81){return _0x55efe6(_0x54da81);},'udWZs':function(_0x308637,_0x179c59,_0xd09979){return _0x308637(_0x179c59,_0xd09979);}};if(!_0x4a9667[_0x4b848c(0x131)](existsSync,_0x4a1428))return[];const _0x5373d3=[];try{const _0x354ee2=await _0x4a9667[_0x4b848c(0xee)](readdir,_0x4a1428,{'withFileTypes':!![]});for(const _0x2cfeb1 of _0x354ee2){if(_0x2cfeb1[_0x4b848c(0x146)]()){const _0x5f29ad=join(_0x4a1428,_0x2cfeb1[_0x4b848c(0x150)],_0x4a9667['pKByD']);if(_0x4a9667['CLnKv'](existsSync,_0x5f29ad)){let _0x11351d=_0x2cfeb1['name'];try{const _0x253b14=await _0x4a9667[_0x4b848c(0x104)](readFile,_0x5f29ad,_0x4b848c(0x11f)),_0x50cc8a=_0x253b14['match'](/name:\s*(.+)/);_0x50cc8a&&(_0x11351d=_0x50cc8a[0x1]['trim']());}catch{}_0x5373d3[_0x4b848c(0x14c)]({'name':_0x2cfeb1[_0x4b848c(0x150)],'displayName':_0x11351d,'path':_0x5f29ad,'level':_0x1ff255});}}}}catch{return[];}return _0x5373d3;}function _0x3968(){const _0x2641fa=['project','bTqBh','\x0a---\x20Profiles\x20---','\x20\x20\x20\x20Session:\x20','DEBUG','string','VSzFL','615SGMBIE','settingsPath','version','No\x20profiles\x20configured','OtxBg','\x0a---\x20Claude\x20Code\x20Plugin\x20---','MGOSa','toString','9IvaWri','YoAbc','rlUKs','scope','plugin','GIMSD','length','ranger@trailhead','UAGhE','path','opencode-plugin','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','14426jDbZbQ','disabled','all','map','Xsfmt','cwd','udWZs','includes','PWqdF','14702160UgEQTI','organizationName','error','\x0a---\x20OpenCode\x20Plugin\x20---','unknown','debug','\x20\x20\x20\x20','\x20\x20Run:\x20ranger\x20update','\x0a\x20\x20No\x20active\x20profile\x20set','wAljD','1734556QucfWz','hasEncryptedAuth','Yddqr','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','KVRnf','TClPI','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','no\x20session','UbdMC','config','stdout','has','\x0a📊\x20Ranger\x20Status\x0a','not_configured','utf-8','\x20(up\x20to\x20date)','KdKdi','Root:\x20','1208edwPIJ','\x20\x20Not\x20installed','\x20\x20\x20\x20Auth:\x20','uqyWQ','success','close','join','isActive','\x20\x20Run:\x20ranger\x20setup\x20--opencode','\x20\x20Project-level:','\x20local','\x20\x20Run:\x20ranger\x20skillup','filter','ignore','nzGvf','enabled','Organization:\x20','details','\x1b[0m','env','data',':\x20installed\x20(','log','5348grwCdt','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','cached\x20(updated\x20','displayName','hasPlaintextAuth','Version:\x20','lKRNJ','QUfWc','\x20\x20\x20\x20Settings:\x20','3658284lcilpt','29330312PSOLur','63774VfLIGy','isDirectory','12BamHwL','\x1b]8;;file://','configured','wVfqC','@ranger-testing/opencode-plugin','push','122kvtOFA','ALwOb','not_installed','name'];_0x3968=function(){return _0x2641fa;};return _0x3968();}async function getInstalledSkills(){const _0x2a73f=_0x54954e,_0x2febdb={'UWoxR':function(_0x215afd,_0x1e35b7,_0x1bc5cc){return _0x215afd(_0x1e35b7,_0x1bc5cc);},'pGrgQ':function(_0x119106){return _0x119106();}},[_0x388bc7,_0x32abe0]=await Promise[_0x2a73f(0x100)]([_0x2febdb['UWoxR'](getSkillsFromDir,_0x2febdb['pGrgQ'](getProjectSkillsDir),_0x2a73f(0x151)),_0x2febdb['UWoxR'](getSkillsFromDir,getUserSkillsDir(),'user')]);return{'project':_0x388bc7,'user':_0x32abe0};}async function getEnvironments(){const _0xc775d5={'Xsfmt':'settings.json','ZvgMF':function(_0x52802b,_0x2dd05e){return _0x52802b(_0x2dd05e);},'ZbDhG':'(not\x20found)'},{envNames:_0x2aadde,activeEnv:_0x2806fb}=await getEnvNames(),_0x4fece1=getRangerDir();if(!existsSync(_0x4fece1))return{'envs':[],'activeEnv':null};const _0x3bb61b=_0x2aadde['map'](_0x1ddcf0=>{const _0x48e338=_0x3c88,_0x18e008=getEnvDir(_0x1ddcf0),_0x3be000=join(_0x18e008,_0xc775d5[_0x48e338(0x102)]),_0x456765=join(_0x18e008,'auth.json'),_0xb72b4=join(_0x18e008,'auth.json.enc');return{'name':_0x1ddcf0,'settingsPath':_0xc775d5['ZvgMF'](existsSync,_0x3be000)?_0x3be000:_0xc775d5['ZbDhG'],'hasPlaintextAuth':existsSync(_0x456765),'hasEncryptedAuth':_0xc775d5['ZvgMF'](existsSync,_0xb72b4),'isActive':_0x1ddcf0===_0x2806fb};});return{'envs':_0x3bb61b,'activeEnv':_0x2806fb};}export async function status(){const _0xd2682f=_0x54954e,_0x31655b={'bTqBh':function(_0x32e7f3,_0x8e5526){return _0x32e7f3(_0x8e5526);},'VSzFL':function(_0xa6e807,_0x36baa9){return _0xa6e807(_0x36baa9);},'gwSoZ':function(_0x577ae2,_0x3ba73e){return _0x577ae2(_0x3ba73e);},'rwpEk':function(_0x3988ce,_0x1793f9){return _0x3988ce(_0x1793f9);},'oJBlY':function(_0x46d14c){return _0x46d14c();},'lKRNJ':function(_0x1942fd){return _0x1942fd();},'CsceK':function(_0x3b5fd5,_0x29e98e){return _0x3b5fd5(_0x29e98e);},'CxOEh':function(_0x1e34c1){return _0x1e34c1();},'hCYYH':function(_0x4fc09b){return _0x4fc09b();},'GIMSD':_0xd2682f(0x10a),'QWSnU':function(_0x16dcc2){return _0x16dcc2();},'CWBqJ':function(_0x4131d1,_0xaeed42){return _0x4131d1===_0xaeed42;},'mansY':_0xd2682f(0x149),'UAGhE':'@ranger-testing/opencode-plugin','KdKdi':function(_0x1e401f,_0x499899){return _0x1e401f===_0x499899;},'rlUKs':'\x20\x20Not\x20configured','JOyjz':_0xd2682f(0x12b),'QUfWc':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','uqyWQ':_0xd2682f(0xef),'YxxwV':_0xd2682f(0x10b),'tGHZP':_0xd2682f(0x124),'Sazrl':'\x0a---\x20Skills\x20---','gciEy':function(_0x16c5c8,_0x276414){return _0x16c5c8+_0x276414;},'PWqdF':function(_0x2e1ac9,_0x4c0b24,_0x2fbdd2){return _0x2e1ac9(_0x4c0b24,_0x2fbdd2);},'qoaeg':function(_0x3d95cd,_0x3b2c04){return _0x3d95cd>_0x3b2c04;},'YoAbc':_0xd2682f(0x153),'yqlfC':function(_0x4fef68){return _0x4fef68();},'rZXRg':function(_0x1e30c4,_0x436d85){return _0x1e30c4+_0x436d85;},'RtAAn':function(_0x474727,_0x3cd2eb){return _0x474727>_0x3cd2eb;},'IAtaM':function(_0x2b70f5,_0x351d4a){return _0x2b70f5>_0x351d4a;},'TClPI':'\x20(active)','fgfZI':'(not\x20found)'};console['log'](_0xd2682f(0x11d));const _0x45fea1=process[_0xd2682f(0x103)](),_0x1abbe4=getRangerDir();if(!_0x31655b[_0xd2682f(0x152)](existsSync,_0x1abbe4)){console['log']('Root:\x20'+link(_0x45fea1,_0x31655b[_0xd2682f(0xe9)](bold,_0x31655b['gwSoZ'](basename,_0x45fea1)))),console['log'](_0xd2682f(0x13b)),console[_0xd2682f(0x139)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0xd2682f(0x139)](_0xd2682f(0x122)+link(_0x45fea1,_0x31655b['gwSoZ'](bold,_0x31655b['rwpEk'](basename,_0x45fea1))));const _0x84951d=getCurrentVersion(),_0x23db44=_0x31655b['oJBlY'](getLatestVersion);if(_0x23db44['version']&&_0x23db44[_0xd2682f(0xec)]!==_0x84951d)console[_0xd2682f(0x139)](_0xd2682f(0x13f)+_0x84951d+'\x20(latest:\x20'+_0x23db44[_0xd2682f(0xec)]+')'),console['log'](_0xd2682f(0x10e));else _0x23db44[_0xd2682f(0xec)]?console[_0xd2682f(0x139)]('Version:\x20'+_0x84951d+_0xd2682f(0x120)):console[_0xd2682f(0x139)](_0xd2682f(0x13f)+_0x84951d);const _0x480c38=await _0x31655b[_0xd2682f(0x140)](getToken);if(_0x480c38){const _0x350dcd=await _0x31655b['CsceK'](getCurrentUser,_0x480c38);_0x350dcd[_0xd2682f(0x127)]?console[_0xd2682f(0x139)](_0xd2682f(0x133)+bold(_0x350dcd['user'][_0xd2682f(0x108)])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0xd2682f(0x139)]('API\x20Token:\x20✗\x20Not\x20found'),console[_0xd2682f(0x139)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0xd2682f(0x136)][_0xd2682f(0xe7)]&&(console[_0xd2682f(0x139)]('API\x20Environment:\x20'+_0x31655b['CxOEh'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+_0x31655b['hCYYH'](getApiBaseUrl)));console[_0xd2682f(0x139)](_0x31655b[_0xd2682f(0xf7)]);const _0xe6148=await _0x31655b['QWSnU'](getOpencodePluginStatus);if(_0x31655b['CWBqJ'](_0xe6148['status'],_0x31655b['mansY']))console['log']('\x20\x20'+bold(_0x31655b[_0xd2682f(0xfa)])+':\x20configured'),_0xe6148[_0xd2682f(0x134)]&&console['log']('\x20\x20'+_0xe6148['details']);else _0x31655b[_0xd2682f(0x121)](_0xe6148['status'],'not_configured')?(console[_0xd2682f(0x139)](_0x31655b[_0xd2682f(0xf4)]),_0xe6148[_0xd2682f(0x134)]&&console[_0xd2682f(0x139)]('\x20\x20'+_0xe6148['details']),console['log'](_0x31655b['JOyjz'])):console[_0xd2682f(0x139)](_0x31655b[_0xd2682f(0x141)]);console['log'](_0x31655b[_0xd2682f(0x126)]);const _0x300893=await getPluginInfo(_0xd2682f(0xf9));if(_0x300893){const _0xf8cdc8=_0x300893[_0xd2682f(0xf5)]||_0x31655b['YxxwV'],_0x120ddc=_0x300893[_0xd2682f(0x132)]?_0xd2682f(0x132):_0xd2682f(0xff);console['log']('\x20\x20'+bold(_0xd2682f(0xf9))+_0xd2682f(0x138)+_0xf8cdc8+',\x20'+_0x120ddc+')');}else console['log'](_0x31655b['tGHZP']),console[_0xd2682f(0x139)](_0xd2682f(0x114));console[_0xd2682f(0x139)](_0x31655b['Sazrl']);const {project:_0xb10494,user:_0x229cd8}=await getInstalledSkills(),_0x9cb307=_0xb10494[_0xd2682f(0x12f)](_0x18bcbb=>RANGER_MANAGED_SKILLS[_0xd2682f(0x105)](_0x18bcbb[_0xd2682f(0x150)])),_0x1785de=_0x229cd8[_0xd2682f(0x12f)](_0x50cb7f=>RANGER_MANAGED_SKILLS[_0xd2682f(0x105)](_0x50cb7f[_0xd2682f(0x150)])),_0x1428eb=_0x31655b['gciEy'](_0x9cb307[_0xd2682f(0xf8)],_0x1785de[_0xd2682f(0xf8)]);if(_0x31655b['KdKdi'](_0x1428eb,0x0))console['log']('No\x20skills\x20installed'),console['log'](_0xd2682f(0x12e));else{if(_0x9cb307[_0xd2682f(0xf8)]>0x0){console['log'](_0xd2682f(0x12c));for(const _0x1efea3 of _0x9cb307){console['log'](_0xd2682f(0x10d)+bold(_0x1efea3['displayName'])+':\x20'+_0x31655b[_0xd2682f(0x106)](link,_0x1efea3[_0xd2682f(0xfb)],basename(_0x1efea3[_0xd2682f(0xfb)])));}}if(_0x31655b['qoaeg'](_0x1785de[_0xd2682f(0xf8)],0x0)){console[_0xd2682f(0x139)]('\x20\x20User-level:');for(const _0x422ac5 of _0x1785de){console[_0xd2682f(0x139)]('\x20\x20\x20\x20'+_0x31655b['VSzFL'](bold,_0x422ac5[_0xd2682f(0x13d)])+':\x20'+link(_0x422ac5['path'],basename(_0x422ac5['path'])));}}}console['log'](_0x31655b[_0xd2682f(0xf3)]);const {envs:_0x4d3a2c,activeEnv:_0x1ede43}=await _0x31655b['CxOEh'](getEnvironments);let _0x235c65=[];if(_0x480c38)try{_0x235c65=await _0x31655b['yqlfC'](listCloudProfiles);}catch{}const _0x2dabee=_0x31655b['rZXRg'](_0x4d3a2c[_0xd2682f(0xf8)],_0x235c65[_0xd2682f(0xf8)]);if(_0x31655b['KdKdi'](_0x2dabee,0x0))console[_0xd2682f(0x139)](_0xd2682f(0xed)),console[_0xd2682f(0x139)](_0xd2682f(0x117));else{if(_0x31655b['RtAAn'](_0x2dabee,0x5)){const _0xb77f09=[];_0x235c65['length']>0x0&&_0xb77f09['push'](_0x235c65['length']+'\x20cloud'),_0x31655b['IAtaM'](_0x4d3a2c['length'],0x0)&&_0xb77f09[_0xd2682f(0x14c)](_0x4d3a2c['length']+_0xd2682f(0x12d)),console[_0xd2682f(0x139)](_0x2dabee+'\x20profiles\x20configured\x20('+_0xb77f09[_0xd2682f(0x129)](',\x20')+')'),_0x1ede43&&console['log']('\x20\x20Active:\x20'+bold(_0x1ede43)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x227afc of _0x235c65){const _0x60e761=_0x227afc['name']===_0x1ede43?'\x20(active)':'';console[_0xd2682f(0x139)]('\x20\x20'+bold(_0x227afc[_0xd2682f(0x150)])+'\x20[cloud]'+_0x60e761);const _0x5b6b06=_0x227afc['sessionUpdatedAt']?_0xd2682f(0x13c)+_0x227afc['sessionUpdatedAt']+')':_0xd2682f(0x118);console['log'](_0xd2682f(0xe6)+_0x5b6b06);}const _0x7e9a43=new Set(_0x235c65[_0xd2682f(0x101)](_0x44f5dc=>_0x44f5dc[_0xd2682f(0x150)]));for(const _0x25b987 of _0x4d3a2c){if(_0x7e9a43[_0xd2682f(0x11c)](_0x25b987['name']))continue;const _0x48842d=_0x25b987[_0xd2682f(0x12a)]?_0x31655b[_0xd2682f(0x116)]:'',_0x45666d=_0x25b987[_0xd2682f(0x112)]?'encrypted':_0x25b987[_0xd2682f(0x13e)]?'plaintext':'none';console['log']('\x20\x20'+_0x31655b['rwpEk'](bold,_0x25b987[_0xd2682f(0x150)])+'\x20[local]'+_0x48842d),console[_0xd2682f(0x139)](_0xd2682f(0x125)+_0x45666d),_0x25b987[_0xd2682f(0xeb)]!==_0x31655b['fgfZI']&&console['log'](_0xd2682f(0x142)+_0x31655b[_0xd2682f(0x106)](link,_0x25b987['settingsPath'],basename(_0x25b987[_0xd2682f(0xeb)])));}if(!_0x1ede43){console['log'](_0xd2682f(0x10f));const _0x36a968=[..._0x235c65['map'](_0x5c063b=>_0x5c063b[_0xd2682f(0x150)]),..._0x4d3a2c[_0xd2682f(0x12f)](_0xb7e5b6=>!_0x7e9a43[_0xd2682f(0x11c)](_0xb7e5b6['name']))['map'](_0x243a7e=>_0x243a7e[_0xd2682f(0x150)])];console['log'](_0xd2682f(0xfd)+_0x36a968['join'](',\x20')+')');}}}console[_0xd2682f(0x139)]('');}
|