@ranger-testing/ranger-cli 3.1.5 → 3.1.6-alpha.4287155-52
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/scenarioOriginCheck.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
|
-
(function(
|
|
1
|
+
function _0x2be1(){const _0x1fb4bd=['user','5258112bcSdPm','Re-authenticating\x20via\x20MCP\x20bootstrap...','995ZJBihT','71902AhtuUp','17XSprxU','log','9076gJeocz','22GcXngb','11525200ifmLLK','cgMut','1008SDbCDI','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','organizationName','message','30592sPzTEI','3225177JjuCXY','3138107SIqFNl','\x0a✅\x20Logged\x20in\x20to\x20','Login\x20failed:\x20'];_0x2be1=function(){return _0x1fb4bd;};return _0x2be1();}(function(_0x3273bd,_0x2e2604){const _0x577b70=_0x378e,_0x5bb4de=_0x3273bd();while(!![]){try{const _0x24bd82=-parseInt(_0x577b70(0x136))/0x1*(-parseInt(_0x577b70(0x135))/0x2)+-parseInt(_0x577b70(0x12d))/0x3+parseInt(_0x577b70(0x138))/0x4*(parseInt(_0x577b70(0x134))/0x5)+-parseInt(_0x577b70(0x132))/0x6+-parseInt(_0x577b70(0x12e))/0x7+parseInt(_0x577b70(0x12c))/0x8*(-parseInt(_0x577b70(0x128))/0x9)+-parseInt(_0x577b70(0x13a))/0xa*(-parseInt(_0x577b70(0x139))/0xb);if(_0x24bd82===_0x2e2604)break;else _0x5bb4de['push'](_0x5bb4de['shift']());}catch(_0x35816a){_0x5bb4de['push'](_0x5bb4de['shift']());}}}(_0x2be1,0x83c5a));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';function _0x378e(_0x5ead5e,_0x347511){_0x5ead5e=_0x5ead5e-0x128;const _0x2be193=_0x2be1();let _0x378eb3=_0x2be193[_0x5ead5e];return _0x378eb3;}export async function login(){const _0x4e5756=_0x378e,_0x528347={'ySwbC':_0x4e5756(0x133),'HKwcn':function(_0x4a85f5){return _0x4a85f5();},'cgMut':_0x4e5756(0x129),'KWyqq':function(_0x1ccad3,_0x2e941b){return _0x1ccad3(_0x2e941b);},'ibnbh':'\x0a✅\x20API\x20key\x20stored\x20successfully'},_0x45ff8b=await getMcpAuthOrigin();if(_0x45ff8b){console[_0x4e5756(0x137)](_0x528347['ySwbC']),await mcpBootstrap();return;}if(!_0x528347['HKwcn'](isInteractive))throw new Error(_0x528347[_0x4e5756(0x13b)]);try{const _0x4acebd=await runDeviceAuthFlow(),_0x2cef33=await _0x528347['KWyqq'](getCurrentUser,_0x4acebd);_0x2cef33['success']?console[_0x4e5756(0x137)](_0x4e5756(0x12f)+_0x2cef33[_0x4e5756(0x131)][_0x4e5756(0x12a)]):console['log'](_0x528347['ibnbh']);}catch(_0x4b97ec){throw new Error(_0x4e5756(0x130)+(_0x4b97ec instanceof Error?_0x4b97ec[_0x4e5756(0x12b)]:_0x4b97ec));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x46d098,_0x254e96){const _0x14e9d8=_0x5647,_0x240d8a=_0x46d098();while(!![]){try{const _0x34c28e=parseInt(_0x14e9d8(0x225))/0x1*(parseInt(_0x14e9d8(0x248))/0x2)+-parseInt(_0x14e9d8(0x1f2))/0x3*(parseInt(_0x14e9d8(0x22e))/0x4)+-parseInt(_0x14e9d8(0x1d9))/0x5*(parseInt(_0x14e9d8(0x213))/0x6)+parseInt(_0x14e9d8(0x201))/0x7*(parseInt(_0x14e9d8(0x1c0))/0x8)+parseInt(_0x14e9d8(0x1dd))/0x9*(parseInt(_0x14e9d8(0x22d))/0xa)+-parseInt(_0x14e9d8(0x1cd))/0xb*(parseInt(_0x14e9d8(0x1f5))/0xc)+-parseInt(_0x14e9d8(0x1db))/0xd*(-parseInt(_0x14e9d8(0x1c4))/0xe);if(_0x34c28e===_0x254e96)break;else _0x240d8a['push'](_0x240d8a['shift']());}catch(_0x265c57){_0x240d8a['push'](_0x240d8a['shift']());}}}(_0x5364,0x9f617));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';function _0x5364(){const _0x5ac4f0=['pathname','redirect_uri','parse','pXXbD','DaBTa','txSYj','QIVbC','\x0aUnexpected\x20response\x20structure:','authorization_endpoint','360AkjktY','set','write','Not\x20found','2219238CSbTxQ','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','slice','error_description','proxied','HTTP\x20','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','QPfGW','qjrrT','11dvYGqd','clientSecret','text','Requesting\x20CLI\x20token...','HIZme','POST','resource','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','Bkhis','error','OAuth\x20error:\x20','then','20Jtvxzl','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','65QIgZhG','text/html','4383aRmZDo','message','\x0aToken\x20written\x20to\x20','platform','client_id','text/event-stream','DDbSz','status','searchParams','hSSPD','token','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','registration_endpoint','Client\x20registration\x20failed:\x20','\x20done','ijSMB','closeAllConnections','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','result','json','UGrJz','111219tZikRs','xdg-open','digest','772644AoDezZ','client_secret','authorization_code','code_challenge_method','iIImR','<html><body><h2>Authentication\x20failed</h2><p>','ChBiQ','Nfpsa','start','notifications/initialized','win32','Yewqr','4207jLvMMk','base64url','FQKoS','2.0','trim','refresh_token','stringify','stdout','lrccH','YXcRq','http://localhost:','aKzgp','Exchanging\x20authorization\x20code...','data:','isError','YChfA','code','Token\x20exchange\x20failed:\x20','178122PcnWov','content','now','get_cli_token\x20failed:\x20','response_type','startsWith','match','url','UrqRO','KTSUs','.ranger','lISsr','toString','application/json','/callback','hex','split','utf-8','6344RZmijs','end','clientId','DJKkF','pUaln','bdNcQ','RWbGX','Registering\x20OAuth\x20client...','10370IqpWdV','76WnUcQP','content-type','auth-origin.txt','qhwOK','token_endpoint','get','log','LruHZ','origin','DlAge','sPHDZ','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','hAKgY','Bearer\x20','mOvxM','1.0.0','type','length','ZoJwd','darwin','NXSAO','127.0.0.1','writeHead','Server\x20returned\x20error:\x20','HUgjI','CqoFq','68eOUGyl','ranger-cli','XTesG','RXglB','vMVsH'];_0x5364=function(){return _0x5ac4f0;};return _0x5364();}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','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');export async function getMcpAuthOrigin(){const _0x1f2ee2=_0x5647,_0x3b4495={'hSSPD':_0x1f2ee2(0x224),'qhwOK':function(_0x3a4903,_0x3920f1){return _0x3a4903||_0x3920f1;}};try{const _0x4d1209=(await readFile(AUTH_ORIGIN_PATH,_0x3b4495[_0x1f2ee2(0x1e6)]))['trim']();return _0x3b4495[_0x1f2ee2(0x231)](_0x4d1209,null);}catch{return null;}}export async function mcpBootstrap(){const _0x41aafe=_0x5647,_0x8e1e1d={'lrccH':function(_0x133b23,_0x3c936d){return _0x133b23(_0x3c936d);},'revRL':function(_0x3c12eb,_0x492dd4){return _0x3c12eb===_0x492dd4;},'DAjdr':_0x41aafe(0x1d4),'pXXbD':_0x41aafe(0x1e8)},_0x4c200b=getMcpAuthUrl();currentOrigin=_0x4c200b;const _0x559244=process['stdout']['isTTY']??![];console[_0x41aafe(0x234)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x4c200b+'\x0a');const _0x257adb=await _0x8e1e1d[_0x41aafe(0x209)](tryUnauthenticated,_0x4c200b);let _0x842b2f=null;if(_0x8e1e1d['revRL'](_0x257adb,'proxied'))_0x842b2f='';else{_0x842b2f=await loadCachedToken();if(!_0x842b2f){if(!_0x559244)throw new Error(_0x8e1e1d['DAjdr']+_0x8e1e1d[_0x41aafe(0x1ba)]);_0x842b2f=await _0x8e1e1d[_0x41aafe(0x209)](oauthFlow,_0x4c200b);}}await callGetCliToken(_0x4c200b,_0x842b2f);}async function tryUnauthenticated(_0x297d32){const _0x263bfd=_0x5647,_0x4b9a24={'jcGcs':'POST','SfnXB':'application/json,\x20text/event-stream','Nfpsa':'2.0','qjrrT':'2025-03-26','mOvxM':_0x263bfd(0x249),'YOMTr':_0x263bfd(0x23d),'VocqA':_0x263bfd(0x1c8)},_0x5d4f05=await fetch(_0x297d32,{'method':_0x4b9a24['jcGcs'],'headers':{'Content-Type':_0x263bfd(0x220),'Accept':_0x4b9a24['SfnXB']},'body':JSON[_0x263bfd(0x207)]({'jsonrpc':_0x4b9a24[_0x263bfd(0x1fc)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x4b9a24[_0x263bfd(0x1cc)],'capabilities':{},'clientInfo':{'name':_0x4b9a24[_0x263bfd(0x23c)],'version':_0x4b9a24['YOMTr']}}})});if(_0x5d4f05['ok'])return await _0x5d4f05[_0x263bfd(0x1cf)](),_0x4b9a24['VocqA'];if(_0x5d4f05['status']===0x191)return await _0x5d4f05['text'](),'needs-oauth';const _0x1d9382=await _0x5d4f05[_0x263bfd(0x1cf)]();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x5d4f05[_0x263bfd(0x1e4)]+':\x20'+_0x1d9382);}class OAuthTimeoutError extends Error{constructor(_0x318dc7){const _0x265dee={'fiBtG':'OAuthTimeoutError'};super(_0x318dc7),this['name']=_0x265dee['fiBtG'];}}async function oauthFlow(_0x377f6d){const _0x5b4152=_0x5647,_0x5c7106={'RXglB':function(_0x1c23c5,_0x132fd7){return _0x1c23c5(_0x132fd7);},'QPfGW':function(_0x3895a5,_0x2dd7d3){return _0x3895a5 instanceof _0x2dd7d3;},'FQKoS':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','lSCou':function(_0x8b173b){return _0x8b173b();}};try{return await _0x5c7106[_0x5b4152(0x24b)](oauthFlowAttempt,_0x377f6d);}catch(_0x145ba0){if(_0x5c7106[_0x5b4152(0x1cb)](_0x145ba0,OAuthTimeoutError)&&await loadCachedClient())return console[_0x5b4152(0x234)](_0x5c7106[_0x5b4152(0x203)]),await _0x5c7106['lSCou'](clearCachedClient),await _0x5c7106['RXglB'](oauthFlowAttempt,_0x377f6d);throw _0x145ba0;}}async function oauthFlowAttempt(_0x472187){const _0xbc54b3=_0x5647,_0x2d1a54={'NPyAE':'Discovering\x20authorization\x20server...','DJKkF':function(_0x28414c,_0x1d2d3f){return _0x28414c(_0x1d2d3f);},'Nubfb':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','lISsr':function(_0x48ef95,_0x5a92a4){return _0x48ef95(_0x5a92a4);},'KTSUs':function(_0x2cc0dc,_0x1521e1,_0x56f715){return _0x2cc0dc(_0x1521e1,_0x56f715);},'iIImR':'Ranger\x20CLI','DaBTa':_0xbc54b3(0x211),'aKzgp':'\x20done','ahpxH':_0xbc54b3(0x222),'HIZme':_0xbc54b3(0x217),'CqoFq':_0xbc54b3(0x1e1),'RWbGX':'code_challenge','DlAge':'S256','bFuln':'resource','ofwZQ':'authorization_code','rhGoN':_0xbc54b3(0x1f6),'Yewqr':'POST'},_0x3c75bd=_0x472187['replace'](/\/mcp$/,'');process['stdout'][_0xbc54b3(0x1c2)](_0x2d1a54['NPyAE']);const _0x56cc65=await _0x2d1a54[_0xbc54b3(0x228)](fetch,_0x3c75bd+'/.well-known/oauth-protected-resource');if(!_0x56cc65['ok'])throw new Error('Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server');const _0x32ef9d=await _0x56cc65['json'](),_0x174b89=_0x32ef9d['authorization_servers']?.[0x0];if(!_0x174b89)throw new Error(_0x2d1a54['Nubfb']);console[_0xbc54b3(0x234)]('\x20'+_0x174b89);const _0x10d659=await _0x2d1a54[_0xbc54b3(0x21e)](fetchAuthServerMetadata,_0x174b89);let _0x5cc0e2,_0x15ce2f;const _0xbeb0a4=await loadCachedClient();if(_0xbeb0a4)_0x5cc0e2=_0xbeb0a4[_0xbc54b3(0x227)],_0x15ce2f=_0xbeb0a4[_0xbc54b3(0x1ce)];else{if(_0x10d659[_0xbc54b3(0x1e9)]){process[_0xbc54b3(0x208)][_0xbc54b3(0x1c2)](_0xbc54b3(0x22c));const _0x42e410=await _0x2d1a54[_0xbc54b3(0x21c)](fetch,_0x10d659['registration_endpoint'],{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify']({'client_name':_0x2d1a54[_0xbc54b3(0x1f9)],'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0xbc54b3(0x221)],'grant_types':[_0xbc54b3(0x1f7),_0xbc54b3(0x206)],'response_types':[_0x2d1a54[_0xbc54b3(0x1bb)]],'token_endpoint_auth_method':'none'})});if(!_0x42e410['ok']){const _0x4cd45b=await _0x42e410[_0xbc54b3(0x1cf)]();throw new Error(_0xbc54b3(0x1ea)+_0x4cd45b);}const _0x50dfaf=await _0x42e410[_0xbc54b3(0x1f0)]();_0x5cc0e2=_0x50dfaf['client_id'],_0x15ce2f=_0x50dfaf['client_secret'],await _0x2d1a54['KTSUs'](saveCachedClient,_0x5cc0e2,_0x15ce2f),console['log'](_0x2d1a54[_0xbc54b3(0x20c)]);}else throw new Error(_0xbc54b3(0x1ee));}const _0x29b93d=randomBytes(0x20)['toString'](_0xbc54b3(0x202)),_0x376fd1=createHash('sha256')['update'](_0x29b93d)[_0xbc54b3(0x1f4)]('base64url'),_0x568791=randomBytes(0x10)['toString'](_0x2d1a54['ahpxH']),_0x17b5e3=new URL(_0x10d659[_0xbc54b3(0x1bf)]);_0x17b5e3[_0xbc54b3(0x1e5)][_0xbc54b3(0x1c1)](_0x2d1a54[_0xbc54b3(0x1d1)],_0xbc54b3(0x211)),_0x17b5e3['searchParams']['set'](_0x2d1a54[_0xbc54b3(0x247)],_0x5cc0e2),_0x17b5e3['searchParams'][_0xbc54b3(0x1c1)](_0xbc54b3(0x24e),_0xbc54b3(0x20b)+CALLBACK_PORT+_0xbc54b3(0x221)),_0x17b5e3['searchParams'][_0xbc54b3(0x1c1)](_0x2d1a54[_0xbc54b3(0x22b)],_0x376fd1),_0x17b5e3[_0xbc54b3(0x1e5)][_0xbc54b3(0x1c1)](_0xbc54b3(0x1f8),_0x2d1a54[_0xbc54b3(0x237)]),_0x17b5e3[_0xbc54b3(0x1e5)]['set']('state',_0x568791);_0x32ef9d['resource']&&_0x17b5e3[_0xbc54b3(0x1e5)]['set'](_0x2d1a54['bFuln'],_0x32ef9d[_0xbc54b3(0x1d3)]);console[_0xbc54b3(0x234)]('\x0aOpening\x20browser\x20for\x20authentication...'),console[_0xbc54b3(0x234)](_0xbc54b3(0x1da)+_0x17b5e3[_0xbc54b3(0x21f)]()+'\x0a'),await openBrowser(_0x17b5e3[_0xbc54b3(0x21f)]());const _0x5c6691=await waitForCallback(_0x568791);process['stdout']['write'](_0xbc54b3(0x20d));const _0x3c2d27=new URLSearchParams({'grant_type':_0x2d1a54['ofwZQ'],'code':_0x5c6691,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0x5cc0e2,'code_verifier':_0x29b93d});_0x15ce2f&&_0x3c2d27['set'](_0x2d1a54['rhGoN'],_0x15ce2f);_0x32ef9d['resource']&&_0x3c2d27[_0xbc54b3(0x1c1)](_0xbc54b3(0x1d3),_0x32ef9d['resource']);const _0x46f9c0=await fetch(_0x10d659[_0xbc54b3(0x232)],{'method':_0x2d1a54[_0xbc54b3(0x200)],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x3c2d27});if(!_0x46f9c0['ok']){const _0x463c8d=await _0x46f9c0['text']();throw new Error(_0xbc54b3(0x212)+_0x463c8d);}const _0x5530bd=await _0x46f9c0[_0xbc54b3(0x1f0)]();return console['log'](_0xbc54b3(0x1eb)),await saveCachedToken(_0x5530bd['access_token'],_0x5530bd[_0xbc54b3(0x206)],_0x5530bd['expires_in']),_0x5530bd['access_token'];}async function callGetCliToken(_0x241548,_0x294771){const _0x446842=_0x5647,_0x28cae0={'YChfA':function(_0x4480d2,_0x32a58c,_0x1f0650){return _0x4480d2(_0x32a58c,_0x1f0650);},'UUwBx':'POST','iCOxS':function(_0xc38829,_0x1a1a00){return _0xc38829(_0x1a1a00);},'DDbSz':_0x446842(0x220),'hVJPi':'application/json,\x20text/event-stream','cpveD':function(_0x241df7,_0x3f2c44){return _0x241df7(_0x3f2c44);},'NXSAO':'\x20done','UGrJz':_0x446842(0x204),'ChBiQ':function(_0x2da46f){return _0x2da46f();},'olEGw':function(_0x599495,_0x339e65,_0x2707c9,_0x3b4867){return _0x599495(_0x339e65,_0x2707c9,_0x3b4867);},'QIVbC':function(_0x1c2333,_0x49c9f2,_0x3df947){return _0x1c2333(_0x49c9f2,_0x3df947);},'GGKnJ':'Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a'},_0x1de6f8={'Content-Type':_0x28cae0[_0x446842(0x1e3)],'Accept':_0x28cae0['hVJPi']};_0x294771&&(_0x1de6f8['Authorization']=_0x446842(0x23b)+_0x294771);const _0x17c5bc=async _0xbb9671=>{const _0xcd5538=_0x446842,_0x120f82=await _0x28cae0[_0xcd5538(0x210)](fetch,_0x241548,{'method':_0x28cae0['UUwBx'],'headers':_0x1de6f8,'body':JSON['stringify'](_0xbb9671)});if(!_0x120f82['ok']){const _0x4bc076=await _0x120f82['text']();throw new Error(_0xcd5538(0x1c9)+_0x120f82['status']+':\x20'+_0x4bc076);}return _0x28cae0['iCOxS'](parseResponse,_0x120f82);};process[_0x446842(0x208)][_0x446842(0x1c2)]('Initializing\x20MCP\x20session...');const _0x53cde7=await _0x28cae0['cpveD'](_0x17c5bc,{'jsonrpc':_0x446842(0x204),'id':0x1,'method':'initialize','params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x446842(0x249),'version':_0x446842(0x23d)}}});if(_0x53cde7['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x53cde7['error']['message']??JSON['stringify'](_0x53cde7[_0x446842(0x1d6)])));console[_0x446842(0x234)](_0x28cae0[_0x446842(0x242)]),await _0x28cae0[_0x446842(0x210)](fetch,_0x241548,{'method':_0x446842(0x1d2),'headers':_0x1de6f8,'body':JSON['stringify']({'jsonrpc':_0x446842(0x204),'method':_0x446842(0x1fe)})})[_0x446842(0x1d8)](_0x4000d0=>_0x4000d0[_0x446842(0x1cf)]()),process['stdout'][_0x446842(0x1c2)](_0x446842(0x1d0));const _0x5643da=await _0x28cae0['cpveD'](_0x17c5bc,{'jsonrpc':_0x28cae0[_0x446842(0x1f1)],'id':0x2,'method':'tools/call','params':{'name':'get_cli_token','arguments':{}}});if(_0x5643da['error'])throw new Error(_0x446842(0x216)+(_0x5643da[_0x446842(0x1d6)][_0x446842(0x1de)]??JSON['stringify'](_0x5643da[_0x446842(0x1d6)])));console['log'](_0x28cae0['NXSAO']);const _0x264240=_0x28cae0['iCOxS'](extractToken,_0x5643da['result']);if(!_0x264240){console[_0x446842(0x1d6)](_0x446842(0x1be)),console['error'](JSON[_0x446842(0x207)](_0x5643da[_0x446842(0x1ef)],null,0x2));throw new Error('Could\x20not\x20extract\x20token\x20from\x20MCP\x20response');}const _0x19df59=join(_0x28cae0[_0x446842(0x1fb)](homedir),_0x446842(0x21d)),_0x1599ef=join(_0x19df59,'refresh.txt');await mkdir(_0x19df59,{'recursive':!![]}),await _0x28cae0['olEGw'](writeFile,_0x1599ef,_0x264240,{'mode':0x180}),await writeFile(_0x28cae0[_0x446842(0x1bd)](join,_0x19df59,_0x446842(0x230)),_0x241548,{'mode':0x180}),console[_0x446842(0x234)](_0x446842(0x1df)+_0x1599ef),console[_0x446842(0x234)](_0x28cae0['GGKnJ']);}function _0x5647(_0x583971,_0x38b926){_0x583971=_0x583971-0x1b9;const _0x5364e4=_0x5364();let _0x5647e1=_0x5364e4[_0x583971];return _0x5647e1;}async function fetchAuthServerMetadata(_0x3c7f90){const _0x2217f7={'uHcDE':function(_0x5089bf,_0x315172){return _0x5089bf(_0x315172);}},_0x115c13=_0x3c7f90+'/.well-known/oauth-authorization-server',_0x4e45ef=await _0x2217f7['uHcDE'](fetch,_0x115c13);if(!_0x4e45ef['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x115c13+':\x20'+_0x4e45ef['status']);return _0x4e45ef['json']();}function waitForCallback(_0x2ec856){const _0x349825=_0x5647,_0x2e65c1={'OZgui':function(_0x3e4024){return _0x3e4024();},'VBMPs':'OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','ijSMB':function(_0x44443b,_0x19e038){return _0x44443b!==_0x19e038;},'EJBpk':_0x349825(0x1c3),'UrqRO':_0x349825(0x1dc),'HoeYZ':_0x349825(0x1c5),'bdNcQ':function(_0x11c2bf,_0x158815,_0x4acbc8){return _0x11c2bf(_0x158815,_0x4acbc8);},'ZypIk':function(_0x36664b,_0x26dbe7){return _0x36664b(_0x26dbe7);},'YXcRq':_0x349825(0x243)};return new Promise((_0x58552a,_0x16a058)=>{const _0x36170a=_0x349825,_0xf094c1={'ZoJwd':function(_0x370e28){return _0x2e65c1['OZgui'](_0x370e28);},'LruHZ':_0x2e65c1['VBMPs'],'VoTUc':function(_0x35ef88,_0x58943c){const _0x3bd7d3=_0x5647;return _0x2e65c1[_0x3bd7d3(0x1ec)](_0x35ef88,_0x58943c);},'FDskN':_0x36170a(0x221),'HUgjI':_0x2e65c1['EJBpk'],'JELhL':'error','IGoit':_0x2e65c1[_0x36170a(0x21b)],'PBLJk':_0x2e65c1['HoeYZ']},_0x52b730=()=>{const _0x18dafb=_0x36170a;_0x81f6ae[_0x18dafb(0x1ed)](),_0x81f6ae['close']();},_0x5e2b99=_0x2e65c1[_0x36170a(0x22a)](setTimeout,()=>{const _0x3b55f9=_0x36170a;_0xf094c1[_0x3b55f9(0x240)](_0x52b730),_0x16a058(new OAuthTimeoutError(_0xf094c1[_0x3b55f9(0x235)]));},0x1d4c0),_0x81f6ae=_0x2e65c1['ZypIk'](createServer,(_0xb273d8,_0x1c3815)=>{const _0x53b978=_0x36170a,_0x26cf8c=new URL(_0xb273d8[_0x53b978(0x21a)]??'/','http://localhost:'+CALLBACK_PORT);if(_0xf094c1['VoTUc'](_0x26cf8c[_0x53b978(0x24d)],_0xf094c1['FDskN'])){_0x1c3815[_0x53b978(0x244)](0x194),_0x1c3815[_0x53b978(0x226)](_0xf094c1[_0x53b978(0x246)]);return;}const _0x3f5cc8=_0x26cf8c[_0x53b978(0x1e5)][_0x53b978(0x233)](_0x53b978(0x211)),_0x4b68f=_0x26cf8c[_0x53b978(0x1e5)]['get']('state'),_0x429ade=_0x26cf8c[_0x53b978(0x1e5)]['get'](_0xf094c1['JELhL']);if(_0x429ade){const _0x3e6ebb=_0x26cf8c[_0x53b978(0x1e5)][_0x53b978(0x233)](_0x53b978(0x1c7))??_0x429ade;_0x1c3815[_0x53b978(0x244)](0xc8,{'Content-Type':'text/html'}),_0x1c3815['end'](_0x53b978(0x1fa)+_0x3e6ebb+_0x53b978(0x239)),clearTimeout(_0x5e2b99),_0xf094c1['ZoJwd'](_0x52b730),_0x16a058(new Error(_0x53b978(0x1d7)+_0x3e6ebb));return;}if(!_0x3f5cc8||_0x4b68f!==_0x2ec856){_0x1c3815[_0x53b978(0x244)](0x190,{'Content-Type':_0x53b978(0x1dc)}),_0x1c3815[_0x53b978(0x226)](_0x53b978(0x1ca));return;}_0x1c3815['writeHead'](0xc8,{'Content-Type':_0xf094c1['IGoit']}),_0x1c3815[_0x53b978(0x226)](_0xf094c1['PBLJk']),clearTimeout(_0x5e2b99),_0xf094c1['ZoJwd'](_0x52b730),_0x58552a(_0x3f5cc8);});_0x81f6ae['listen'](CALLBACK_PORT,_0x2e65c1[_0x36170a(0x20a)]);});}async function openBrowser(_0x1003fa){const _0x405d19=_0x5647,_0x891325={'pgqRV':'open','hAKgY':_0x405d19(0x1ff),'Bkhis':_0x405d19(0x1fd),'sPHDZ':function(_0x5066a6,_0x434137){return _0x5066a6(_0x434137);}},_0x13e369=process[_0x405d19(0x1e0)]===_0x405d19(0x241)?_0x891325['pgqRV']:process['platform']===_0x891325[_0x405d19(0x23a)]?_0x891325[_0x405d19(0x1d5)]:_0x405d19(0x1f3);_0x891325[_0x405d19(0x238)](exec,_0x13e369+'\x20\x22'+_0x1003fa+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x1e1473=_0x5647,_0x1680a9={'XTesG':function(_0x26d2b7,_0x3acbd7){return _0x26d2b7!==_0x3acbd7;}};try{const _0x5bee68=JSON[_0x1e1473(0x1b9)](await readFile(TOKEN_CACHE_PATH,'utf-8'));if(_0x5bee68[_0x1e1473(0x236)]&&_0x1680a9[_0x1e1473(0x24a)](_0x5bee68['origin'],currentOrigin))return null;if(_0x5bee68['expiresAt']&&Date['now']()>_0x5bee68['expiresAt'])return null;return _0x5bee68['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x4fcaf6,_0x31a220,_0x545947){const _0x2a1d3b=_0x5647,_0x53b7a4={'hbdcD':function(_0x425451){return _0x425451();},'vMVsH':function(_0x25fda3,_0x332c2e){return _0x25fda3+_0x332c2e;}},_0x4e64e0=await _0x53b7a4['hbdcD'](loadCachedData),_0x5b935e={..._0x4e64e0,'origin':currentOrigin,'accessToken':_0x4fcaf6,'refreshToken':_0x31a220??_0x4e64e0?.['refreshToken'],'expiresAt':_0x545947?_0x53b7a4[_0x2a1d3b(0x24c)](Date[_0x2a1d3b(0x215)](),_0x545947*0x3e8):undefined};await mkdir(join(homedir(),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x5b935e),{'mode':0x180});}async function loadCachedClient(){const _0x46f20f=_0x5647,_0x397760=await loadCachedData();if(_0x397760?.[_0x46f20f(0x236)]&&_0x397760['origin']!==currentOrigin)return null;return _0x397760?.['clientId']?{'clientId':_0x397760['clientId'],'clientSecret':_0x397760[_0x46f20f(0x1ce)]}:null;}async function clearCachedClient(){const _0x174080=_0x5647,_0x415305={'txSYj':function(_0x1ccf70,_0x280e7f,_0x2710b8,_0x12c783){return _0x1ccf70(_0x280e7f,_0x2710b8,_0x12c783);}},_0x48f188=await loadCachedData();if(!_0x48f188)return;const {clientId:_0x5edf82,clientSecret:_0x5355f4,..._0x570802}=_0x48f188;await _0x415305[_0x174080(0x1bc)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x570802),{'mode':0x180});}async function saveCachedClient(_0x5045c4,_0x547a44){const _0x353264=_0x5647,_0x11fa62={'whSdb':function(_0x3a3497){return _0x3a3497();},'jdAFo':function(_0x7b1281,_0x3d7a1b,_0xe74d38){return _0x7b1281(_0x3d7a1b,_0xe74d38);}},_0x2dd66c=await _0x11fa62['whSdb'](loadCachedData),_0x26ef16={..._0x2dd66c,'origin':currentOrigin,'accessToken':_0x2dd66c?.['accessToken']??'','clientId':_0x5045c4,'clientSecret':_0x547a44};await _0x11fa62['jdAFo'](mkdir,_0x11fa62['jdAFo'](join,homedir(),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x353264(0x207)](_0x26ef16),{'mode':0x180});}async function loadCachedData(){const _0x34b68b={'mmIxY':function(_0x2c7fdb,_0x4b6b19,_0x5a6661){return _0x2c7fdb(_0x4b6b19,_0x5a6661);},'pjRcO':'utf-8'};try{return JSON['parse'](await _0x34b68b['mmIxY'](readFile,TOKEN_CACHE_PATH,_0x34b68b['pjRcO']));}catch{return null;}}async function parseResponse(_0x4f709c){const _0x4076b3=_0x5647,_0x47b890={'uplqa':_0x4076b3(0x22f),'UBTak':'data:','WjeAx':'No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream'},_0x5c10cf=_0x4f709c['headers'][_0x4076b3(0x233)](_0x47b890['uplqa'])??'';if(_0x5c10cf['includes'](_0x4076b3(0x1e2))){const _0x58a5a8=await _0x4f709c[_0x4076b3(0x1cf)]();for(const _0x420fe8 of _0x58a5a8[_0x4076b3(0x223)]('\x0a')){const _0x1216eb=_0x420fe8['trim']();if(_0x1216eb[_0x4076b3(0x218)](_0x47b890['UBTak'])){const _0x391ac3=_0x1216eb[_0x4076b3(0x1c6)](_0x4076b3(0x20e)[_0x4076b3(0x23f)])[_0x4076b3(0x205)]();if(!_0x391ac3)continue;try{const _0x2e30c0=JSON[_0x4076b3(0x1b9)](_0x391ac3);if(_0x2e30c0['id']!==undefined||_0x2e30c0[_0x4076b3(0x1d6)])return _0x2e30c0;}catch{}}}throw new Error(_0x47b890['WjeAx']);}return _0x4f709c['json']();}function extractToken(_0x410a30){const _0x528760=_0x5647,_0xc85236={'pUaln':'text','FLWpM':'string'};if(!_0x410a30)return null;const _0x58ed08=_0x410a30['structuredContent'];if(_0x58ed08?.[_0x528760(0x1e7)]&&typeof _0x58ed08[_0x528760(0x1e7)]==='string')return _0x58ed08[_0x528760(0x1e7)];if(_0x410a30[_0x528760(0x20f)]){const _0x463b5c=_0x410a30[_0x528760(0x214)];throw new Error(_0x528760(0x245)+(_0x463b5c?.[0x0]?.['text']??'Unknown\x20error'));}const _0x9fa9a5=_0x410a30[_0x528760(0x214)];if(_0x9fa9a5)for(const _0x4c83a7 of _0x9fa9a5){if(_0x4c83a7[_0x528760(0x23e)]===_0xc85236[_0x528760(0x229)]&&_0x4c83a7['text']){try{const _0x31a8a6=JSON['parse'](_0x4c83a7[_0x528760(0x1cf)]);if(typeof _0x31a8a6?.['token']===_0xc85236['FLWpM'])return _0x31a8a6[_0x528760(0x1e7)];}catch{}const _0x2f04a9=_0x4c83a7[_0x528760(0x1cf)][_0x528760(0x219)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x2f04a9)return _0x2f04a9[0x1];}}return null;}
|
|
1
|
+
(function(_0x39b0ef,_0x3438d9){const _0x145488=_0x404f,_0x291be4=_0x39b0ef();while(!![]){try{const _0x4d3ae1=parseInt(_0x145488(0x164))/0x1+-parseInt(_0x145488(0x117))/0x2*(parseInt(_0x145488(0x137))/0x3)+-parseInt(_0x145488(0x101))/0x4+parseInt(_0x145488(0x138))/0x5+parseInt(_0x145488(0x12c))/0x6+-parseInt(_0x145488(0x135))/0x7*(parseInt(_0x145488(0xd2))/0x8)+parseInt(_0x145488(0xd7))/0x9;if(_0x4d3ae1===_0x3438d9)break;else _0x291be4['push'](_0x291be4['shift']());}catch(_0x358a07){_0x291be4['push'](_0x291be4['shift']());}}}(_0x1d6e,0x2995f));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','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');export async function getMcpAuthOrigin(){const _0x39e500=_0x404f,_0x3049a4={'AGwcU':_0x39e500(0x14b)};try{const _0x39cb18=(await readFile(AUTH_ORIGIN_PATH,_0x3049a4['AGwcU']))[_0x39e500(0xfc)]();return _0x39cb18||null;}catch{return null;}}function _0x404f(_0x4342e0,_0xbf7a8a){_0x4342e0=_0x4342e0-0xd0;const _0x1d6e23=_0x1d6e();let _0x404f2a=_0x1d6e23[_0x4342e0];return _0x404f2a;}export async function mcpBootstrap(){const _0x20f80c=_0x404f,_0x2f250f={'vnmLW':function(_0x3859b6){return _0x3859b6();},'ALTnc':function(_0x46de64,_0x23e7b6){return _0x46de64(_0x23e7b6);},'rduBf':'proxied','AwkgQ':_0x20f80c(0xe8),'QLrbu':_0x20f80c(0xe2),'IYEbP':function(_0x55b7a2,_0x43f939,_0x4460de){return _0x55b7a2(_0x43f939,_0x4460de);}},_0x171971=_0x2f250f['vnmLW'](getMcpAuthUrl);currentOrigin=_0x171971;const _0x30d076=process[_0x20f80c(0x15d)]['isTTY']??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x171971+'\x0a');const _0x2cf514=await _0x2f250f['ALTnc'](tryUnauthenticated,_0x171971);let _0x2fc4e5=null;if(_0x2cf514===_0x2f250f['rduBf'])_0x2fc4e5='';else{_0x2fc4e5=await loadCachedToken();if(!_0x2fc4e5){if(!_0x30d076)throw new Error(_0x2f250f[_0x20f80c(0xf8)]+_0x2f250f[_0x20f80c(0x102)]);_0x2fc4e5=await oauthFlow(_0x171971);}}await _0x2f250f[_0x20f80c(0xf9)](callGetCliToken,_0x171971,_0x2fc4e5);}async function tryUnauthenticated(_0x2d32d6){const _0x498b8f=_0x404f,_0x143117={'GSDqX':'POST','sRDRj':_0x498b8f(0xec),'KnmBX':_0x498b8f(0xdc),'AmsNZ':'2025-03-26','SiYsD':_0x498b8f(0xde),'qPDcX':function(_0x9db65e,_0xe8d3cf){return _0x9db65e===_0xe8d3cf;}},_0x5351fa=await fetch(_0x2d32d6,{'method':_0x143117['GSDqX'],'headers':{'Content-Type':_0x143117[_0x498b8f(0x118)],'Accept':_0x143117['KnmBX']},'body':JSON[_0x498b8f(0x111)]({'jsonrpc':_0x498b8f(0x13b),'id':0x1,'method':_0x498b8f(0x130),'params':{'protocolVersion':_0x143117[_0x498b8f(0x122)],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x143117['SiYsD']}}})});if(_0x5351fa['ok'])return await _0x5351fa['text'](),'proxied';if(_0x143117[_0x498b8f(0xe6)](_0x5351fa[_0x498b8f(0x108)],0x191))return await _0x5351fa[_0x498b8f(0x12f)](),'needs-oauth';const _0x4b2935=await _0x5351fa['text']();throw new Error(_0x498b8f(0xf4)+_0x5351fa['status']+':\x20'+_0x4b2935);}class OAuthTimeoutError extends Error{constructor(_0x2bdc29){const _0x1fadb8=_0x404f;super(_0x2bdc29),this['name']=_0x1fadb8(0x155);}}async function oauthFlow(_0xde1927){const _0x5a0fe6=_0x404f,_0x46b105={'GhWYB':function(_0x2bd603){return _0x2bd603();},'whbcj':_0x5a0fe6(0x121),'CUsiG':function(_0x5cae55,_0x1d37da){return _0x5cae55(_0x1d37da);}};try{return await oauthFlowAttempt(_0xde1927);}catch(_0x593540){if(_0x593540 instanceof OAuthTimeoutError&&await _0x46b105[_0x5a0fe6(0x113)](loadCachedClient))return console['log'](_0x46b105[_0x5a0fe6(0x150)]),await clearCachedClient(),await _0x46b105[_0x5a0fe6(0xea)](oauthFlowAttempt,_0xde1927);throw _0x593540;}}async function oauthFlowAttempt(_0x4992bd){const _0x275697=_0x404f,_0x1ed3b4={'QOGid':'Discovering\x20authorization\x20server...','FYdZg':_0x275697(0xf1),'YdvcL':_0x275697(0x125),'bbOOG':function(_0x89cad7,_0x195474){return _0x89cad7(_0x195474);},'TAkHc':function(_0x39da07){return _0x39da07();},'cLQbf':function(_0xf9964a,_0x4b75f8,_0x3fc169){return _0xf9964a(_0x4b75f8,_0x3fc169);},'cDODZ':_0x275697(0xfe),'tVHNa':_0x275697(0x120),'oEkba':'authorization_code','fqkyk':function(_0xeadcd0,_0x580d4f,_0x1a0b2d){return _0xeadcd0(_0x580d4f,_0x1a0b2d);},'eBgWz':_0x275697(0x129),'LQfuT':'base64url','PTjrg':_0x275697(0x11d),'OduLd':function(_0x271e74,_0x286372){return _0x271e74(_0x286372);},'UcVqb':'hex','axURZ':'redirect_uri','MjCUt':_0x275697(0x126),'ubLAj':_0x275697(0x124),'SbBoS':_0x275697(0x15f),'Kvqll':_0x275697(0xfd),'VptlC':function(_0x16b19c,_0x88318d){return _0x16b19c(_0x88318d);},'ksicI':_0x275697(0x133),'bIwWJ':'client_secret','HzRQv':'resource','ZBCXH':'application/x-www-form-urlencoded'},_0x78ec6c=_0x4992bd[_0x275697(0xe0)](/\/mcp$/,'');process['stdout']['write'](_0x1ed3b4['QOGid']);const _0x2349f4=await fetch(_0x78ec6c+'/.well-known/oauth-protected-resource');if(!_0x2349f4['ok'])throw new Error(_0x1ed3b4['FYdZg']);const _0xecc848=await _0x2349f4[_0x275697(0x114)](),_0x2ad9bf=_0xecc848[_0x275697(0x149)]?.[0x0];if(!_0x2ad9bf)throw new Error(_0x1ed3b4[_0x275697(0x15b)]);console[_0x275697(0x10a)]('\x20'+_0x2ad9bf);const _0x4995e2=await _0x1ed3b4[_0x275697(0x161)](fetchAuthServerMetadata,_0x2ad9bf);let _0x2bcc00,_0x33223c;const _0x56e9d5=await _0x1ed3b4['TAkHc'](loadCachedClient);if(_0x56e9d5)_0x2bcc00=_0x56e9d5['clientId'],_0x33223c=_0x56e9d5[_0x275697(0xe5)];else{if(_0x4995e2[_0x275697(0x142)]){process['stdout']['write']('Registering\x20OAuth\x20client...');const _0x2243fd=await _0x1ed3b4[_0x275697(0x157)](fetch,_0x4995e2['registration_endpoint'],{'method':_0x1ed3b4[_0x275697(0xf2)],'headers':{'Content-Type':'application/json'},'body':JSON[_0x275697(0x111)]({'client_name':_0x1ed3b4['tVHNa'],'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x275697(0xd1)],'grant_types':[_0x1ed3b4[_0x275697(0x13c)],'refresh_token'],'response_types':[_0x275697(0x110)],'token_endpoint_auth_method':_0x275697(0x128)})});if(!_0x2243fd['ok']){const _0x36c6ac=await _0x2243fd[_0x275697(0x12f)]();throw new Error(_0x275697(0xdf)+_0x36c6ac);}const _0x566d88=await _0x2243fd[_0x275697(0x114)]();_0x2bcc00=_0x566d88[_0x275697(0x153)],_0x33223c=_0x566d88['client_secret'],await _0x1ed3b4['fqkyk'](saveCachedClient,_0x2bcc00,_0x33223c),console[_0x275697(0x10a)]('\x20done');}else throw new Error(_0x1ed3b4['eBgWz']);}const _0x5a189d=randomBytes(0x20)['toString'](_0x1ed3b4[_0x275697(0xf6)]),_0x1f2a95=createHash(_0x1ed3b4['PTjrg'])['update'](_0x5a189d)['digest']('base64url'),_0x318ae0=_0x1ed3b4['OduLd'](randomBytes,0x10)[_0x275697(0x13f)](_0x1ed3b4['UcVqb']),_0x11443a=new URL(_0x4995e2['authorization_endpoint']);_0x11443a['searchParams'][_0x275697(0xf3)](_0x275697(0x14d),'code'),_0x11443a[_0x275697(0xe3)]['set'](_0x275697(0x153),_0x2bcc00),_0x11443a[_0x275697(0xe3)]['set'](_0x1ed3b4[_0x275697(0x132)],'http://localhost:'+CALLBACK_PORT+_0x275697(0xd1)),_0x11443a['searchParams']['set'](_0x1ed3b4[_0x275697(0x123)],_0x1f2a95),_0x11443a['searchParams']['set'](_0x1ed3b4['ubLAj'],_0x1ed3b4['SbBoS']),_0x11443a['searchParams']['set'](_0x1ed3b4['Kvqll'],_0x318ae0);_0xecc848['resource']&&_0x11443a[_0x275697(0xe3)]['set'](_0x275697(0xd9),_0xecc848['resource']);console[_0x275697(0x10a)]('\x0aOpening\x20browser\x20for\x20authentication...'),console[_0x275697(0x10a)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x11443a['toString']()+'\x0a'),await _0x1ed3b4[_0x275697(0x163)](openBrowser,_0x11443a['toString']());const _0xdc621e=await waitForCallback(_0x318ae0);process['stdout']['write'](_0x1ed3b4['ksicI']);const _0x134c70=new URLSearchParams({'grant_type':_0x1ed3b4[_0x275697(0x13c)],'code':_0xdc621e,'redirect_uri':_0x275697(0x15a)+CALLBACK_PORT+'/callback','client_id':_0x2bcc00,'code_verifier':_0x5a189d});_0x33223c&&_0x134c70['set'](_0x1ed3b4['bIwWJ'],_0x33223c);_0xecc848['resource']&&_0x134c70[_0x275697(0xf3)](_0x1ed3b4[_0x275697(0x112)],_0xecc848['resource']);const _0x19e01f=await _0x1ed3b4[_0x275697(0x157)](fetch,_0x4995e2['token_endpoint'],{'method':'POST','headers':{'Content-Type':_0x1ed3b4['ZBCXH']},'body':_0x134c70});if(!_0x19e01f['ok']){const _0x395702=await _0x19e01f[_0x275697(0x12f)]();throw new Error(_0x275697(0x10e)+_0x395702);}const _0x244808=await _0x19e01f[_0x275697(0x114)]();return console[_0x275697(0x10a)]('\x20done'),await saveCachedToken(_0x244808['access_token'],_0x244808[_0x275697(0x158)],_0x244808[_0x275697(0x11b)]),_0x244808['access_token'];}async function callGetCliToken(_0x17d9dc,_0x40b8bc){const _0x192842=_0x404f,_0x71a303={'eToLJ':function(_0x15191e,_0x2609bb,_0x30347a){return _0x15191e(_0x2609bb,_0x30347a);},'iACgU':function(_0x506064,_0x55c042){return _0x506064(_0x55c042);},'gQrGd':_0x192842(0x13b),'MtbOq':_0x192842(0x10d),'SWKWz':'1.0.0','wFFLK':'\x20done','mrJiC':_0x192842(0xed),'zLEBa':_0x192842(0xd4),'UsdbF':_0x192842(0xe7),'EsTwE':function(_0x19f81f,_0x2f4c01){return _0x19f81f(_0x2f4c01);},'NDyCu':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','updrE':function(_0x230960,_0x3b9b4f,_0x121d11){return _0x230960(_0x3b9b4f,_0x121d11);},'uZrCh':_0x192842(0xdd),'RHJOX':'refresh.txt','TAmKs':function(_0x5afd2b,_0x43c2c8,_0x5b2d2c){return _0x5afd2b(_0x43c2c8,_0x5b2d2c);}},_0x4a38de={'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'};_0x40b8bc&&(_0x4a38de[_0x192842(0xf5)]=_0x192842(0xd8)+_0x40b8bc);const _0x151663=async _0x53cb5a=>{const _0x3dcf7c=_0x192842,_0x9abf5c=await _0x71a303[_0x3dcf7c(0x12e)](fetch,_0x17d9dc,{'method':'POST','headers':_0x4a38de,'body':JSON[_0x3dcf7c(0x111)](_0x53cb5a)});if(!_0x9abf5c['ok']){const _0x9eef9d=await _0x9abf5c['text']();throw new Error(_0x3dcf7c(0x11f)+_0x9abf5c[_0x3dcf7c(0x108)]+':\x20'+_0x9eef9d);}return _0x71a303['iACgU'](parseResponse,_0x9abf5c);};process[_0x192842(0x15d)][_0x192842(0x136)](_0x192842(0x10f));const _0x235eaa=await _0x71a303['iACgU'](_0x151663,{'jsonrpc':_0x71a303['gQrGd'],'id':0x1,'method':_0x192842(0x130),'params':{'protocolVersion':_0x71a303[_0x192842(0x105)],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x71a303['SWKWz']}}});if(_0x235eaa[_0x192842(0xeb)])throw new Error(_0x192842(0x151)+(_0x235eaa[_0x192842(0xeb)][_0x192842(0x10b)]??JSON['stringify'](_0x235eaa['error'])));console['log'](_0x71a303['wFFLK']),await fetch(_0x17d9dc,{'method':_0x192842(0xfe),'headers':_0x4a38de,'body':JSON[_0x192842(0x111)]({'jsonrpc':'2.0','method':_0x192842(0xff)})})[_0x192842(0x13d)](_0x41eeaf=>_0x41eeaf[_0x192842(0x12f)]()),process[_0x192842(0x15d)]['write'](_0x71a303[_0x192842(0xef)]);const _0x8d4e7c=await _0x151663({'jsonrpc':_0x71a303[_0x192842(0x131)],'id':0x2,'method':_0x71a303['zLEBa'],'params':{'name':_0x71a303['UsdbF'],'arguments':{}}});if(_0x8d4e7c[_0x192842(0xeb)])throw new Error('get_cli_token\x20failed:\x20'+(_0x8d4e7c[_0x192842(0xeb)][_0x192842(0x10b)]??JSON[_0x192842(0x111)](_0x8d4e7c['error'])));console['log'](_0x192842(0x152));const _0x265c99=_0x71a303[_0x192842(0xda)](extractToken,_0x8d4e7c[_0x192842(0x14a)]);if(!_0x265c99){console['error']('\x0aUnexpected\x20response\x20structure:'),console['error'](JSON['stringify'](_0x8d4e7c[_0x192842(0x14a)],null,0x2));throw new Error(_0x71a303['NDyCu']);}const _0x4d1258=_0x71a303[_0x192842(0x116)](join,homedir(),_0x71a303[_0x192842(0x109)]),_0x1a3557=join(_0x4d1258,_0x71a303['RHJOX']);await _0x71a303[_0x192842(0x106)](mkdir,_0x4d1258,{'recursive':!![]}),await writeFile(_0x1a3557,_0x265c99,{'mode':0x180}),await writeFile(join(_0x4d1258,_0x192842(0x141)),_0x17d9dc,{'mode':0x180}),console['log']('\x0aToken\x20written\x20to\x20'+_0x1a3557),console[_0x192842(0x10a)](_0x192842(0x11e));}async function fetchAuthServerMetadata(_0xc0bba7){const _0x1ac1ac={'UcZSX':function(_0x575036,_0x3b562c){return _0x575036(_0x3b562c);}},_0x5779b0=_0xc0bba7+'/.well-known/oauth-authorization-server',_0xbed0b7=await _0x1ac1ac['UcZSX'](fetch,_0x5779b0);if(!_0xbed0b7['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x5779b0+':\x20'+_0xbed0b7['status']);return _0xbed0b7['json']();}function waitForCallback(_0x5a1621){const _0x5c5559=_0x404f,_0x26033b={'uEvcW':function(_0x48e6b0){return _0x48e6b0();},'bOCss':function(_0x348869,_0x44e929){return _0x348869(_0x44e929);},'LqpoB':'OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','lSCkW':_0x5c5559(0x13e),'RBoSd':function(_0x4d6e7c,_0x3cbef3){return _0x4d6e7c(_0x3cbef3);},'vcdAs':function(_0x406914){return _0x406914();},'jzztC':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','HhOkU':function(_0x33afb3){return _0x33afb3();},'HNmBa':function(_0x45e995,_0xdb00a7,_0x18ed9f){return _0x45e995(_0xdb00a7,_0x18ed9f);},'udbxS':function(_0x1e348a,_0x5e5dbd){return _0x1e348a(_0x5e5dbd);},'iePuE':'127.0.0.1'};return new Promise((_0x840707,_0x5e5e81)=>{const _0x2f09b6=_0x5c5559,_0x35c9e7=()=>{_0x426c75['closeAllConnections'](),_0x426c75['close']();},_0x54ffcb=_0x26033b['HNmBa'](setTimeout,()=>{const _0x5a33a2=_0x404f;_0x26033b[_0x5a33a2(0x127)](_0x35c9e7),_0x26033b[_0x5a33a2(0x134)](_0x5e5e81,new OAuthTimeoutError(_0x26033b['LqpoB']));},0x1d4c0),_0x426c75=_0x26033b['udbxS'](createServer,(_0x397b98,_0x176179)=>{const _0x28827b=_0x404f,_0x273a52=new URL(_0x397b98['url']??'/',_0x28827b(0x15a)+CALLBACK_PORT);if(_0x273a52['pathname']!==_0x28827b(0xd1)){_0x176179['writeHead'](0x194),_0x176179['end']('Not\x20found');return;}const _0x28f744=_0x273a52['searchParams'][_0x28827b(0x15c)]('code'),_0x1da4bf=_0x273a52['searchParams']['get']('state'),_0x7bd307=_0x273a52['searchParams'][_0x28827b(0x15c)]('error');if(_0x7bd307){const _0x148aab=_0x273a52['searchParams']['get'](_0x28827b(0x140))??_0x7bd307;_0x176179[_0x28827b(0xee)](0xc8,{'Content-Type':_0x26033b['lSCkW']}),_0x176179['end'](_0x28827b(0x156)+_0x148aab+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),_0x26033b[_0x28827b(0x145)](clearTimeout,_0x54ffcb),_0x26033b[_0x28827b(0x107)](_0x35c9e7),_0x5e5e81(new Error(_0x28827b(0x139)+_0x148aab));return;}if(!_0x28f744||_0x1da4bf!==_0x5a1621){_0x176179[_0x28827b(0xee)](0x190,{'Content-Type':_0x26033b[_0x28827b(0xd6)]}),_0x176179['end'](_0x26033b['jzztC']);return;}_0x176179[_0x28827b(0xee)](0xc8,{'Content-Type':'text/html'}),_0x176179[_0x28827b(0x14c)](_0x28827b(0x11c)),clearTimeout(_0x54ffcb),_0x26033b['HhOkU'](_0x35c9e7),_0x26033b['bOCss'](_0x840707,_0x28f744);});_0x426c75[_0x2f09b6(0x165)](CALLBACK_PORT,_0x26033b[_0x2f09b6(0x154)]);});}async function openBrowser(_0x323e8b){const _0x550a89=_0x404f,_0x346eab={'PAzvm':function(_0x277dbe,_0x4622fb){return _0x277dbe===_0x4622fb;},'uBvhY':_0x550a89(0xd3),'qcchj':_0x550a89(0x103),'eoAkr':function(_0x288a2b,_0xe7d224){return _0x288a2b===_0xe7d224;},'NrVCT':'win32','Tyyvn':'start','nIdvP':function(_0x546493,_0x54de25){return _0x546493(_0x54de25);}},_0xe34594=_0x346eab[_0x550a89(0x15e)](process[_0x550a89(0x162)],_0x346eab['uBvhY'])?_0x346eab[_0x550a89(0x148)]:_0x346eab[_0x550a89(0x143)](process['platform'],_0x346eab['NrVCT'])?_0x346eab['Tyyvn']:_0x550a89(0xf0);_0x346eab['nIdvP'](exec,_0xe34594+'\x20\x22'+_0x323e8b+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x54414a=_0x404f,_0x23f099={'xqfad':function(_0x16e95f,_0x4f8a09,_0xacd204){return _0x16e95f(_0x4f8a09,_0xacd204);},'xQBmV':function(_0x5c836a,_0x48c062){return _0x5c836a!==_0x48c062;},'deOJQ':function(_0x5bf910,_0x5cd541){return _0x5bf910>_0x5cd541;}};try{const _0x4fbbc0=JSON[_0x54414a(0x14f)](await _0x23f099[_0x54414a(0x104)](readFile,TOKEN_CACHE_PATH,'utf-8'));if(_0x4fbbc0[_0x54414a(0x100)]&&_0x23f099['xQBmV'](_0x4fbbc0[_0x54414a(0x100)],currentOrigin))return null;if(_0x4fbbc0['expiresAt']&&_0x23f099[_0x54414a(0xd5)](Date['now'](),_0x4fbbc0['expiresAt']))return null;return _0x4fbbc0['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0xb3e04,_0x5a5720,_0x2a0ed6){const _0x50d280=_0x404f,_0x4800a7={'isEif':function(_0x1604dd,_0x5c68c8,_0x2113d2){return _0x1604dd(_0x5c68c8,_0x2113d2);},'YFNTF':function(_0x26a643,_0x211d2a,_0x485ebd){return _0x26a643(_0x211d2a,_0x485ebd);},'nEsOR':function(_0x270f1c){return _0x270f1c();},'ClnKe':function(_0x19b856,_0x556d6d,_0x1f33a7,_0x9aff17){return _0x19b856(_0x556d6d,_0x1f33a7,_0x9aff17);}},_0xdb7b4=await loadCachedData(),_0x4d420f={..._0xdb7b4,'origin':currentOrigin,'accessToken':_0xb3e04,'refreshToken':_0x5a5720??_0xdb7b4?.['refreshToken'],'expiresAt':_0x2a0ed6?Date[_0x50d280(0xdb)]()+_0x2a0ed6*0x3e8:undefined};await _0x4800a7['isEif'](mkdir,_0x4800a7['YFNTF'](join,_0x4800a7['nEsOR'](homedir),'.ranger'),{'recursive':!![]}),await _0x4800a7[_0x50d280(0x160)](writeFile,TOKEN_CACHE_PATH,JSON[_0x50d280(0x111)](_0x4d420f),{'mode':0x180});}async function loadCachedClient(){const _0x27a41d=_0x404f,_0x2065cd={'pFhYZ':function(_0x23fb9c){return _0x23fb9c();}},_0x239a7c=await _0x2065cd['pFhYZ'](loadCachedData);if(_0x239a7c?.[_0x27a41d(0x100)]&&_0x239a7c[_0x27a41d(0x100)]!==currentOrigin)return null;return _0x239a7c?.[_0x27a41d(0xe1)]?{'clientId':_0x239a7c['clientId'],'clientSecret':_0x239a7c[_0x27a41d(0xe5)]}:null;}function _0x1d6e(){const _0x280eee=['PAzvm','S256','ClnKe','bbOOG','platform','VptlC','300755dggiXT','listen','match','/callback','16VNAqRb','darwin','tools/call','deOJQ','lSCkW','1427220YtdtMl','Bearer\x20','resource','EsTwE','now','application/json,\x20text/event-stream','.ranger','1.0.0','Client\x20registration\x20failed:\x20','replace','clientId','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','searchParams','rHJuL','clientSecret','qPDcX','get_cli_token','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','wjXoL','CUsiG','error','application/json','Requesting\x20CLI\x20token...','writeHead','mrJiC','xdg-open','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','cDODZ','set','MCP\x20server\x20returned\x20HTTP\x20','Authorization','LQfuT','jlysD','AwkgQ','IYEbP','data:','djwyL','trim','state','POST','notifications/initialized','origin','730860XUfdcw','QLrbu','open','xqfad','MtbOq','TAmKs','vcdAs','status','uZrCh','log','message','content-type','2025-03-26','Token\x20exchange\x20failed:\x20','Initializing\x20MCP\x20session...','code','stringify','HzRQv','GhWYB','json','type','updrE','2lTAehT','sRDRj','YbRrd','OVtdf','expires_in','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','sha256','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','HTTP\x20','Ranger\x20CLI','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','AmsNZ','MjCUt','code_challenge_method','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','code_challenge','uEvcW','none','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','includes','text/event-stream','396534ZKEoWa','xNUlB','eToLJ','text','initialize','gQrGd','axURZ','Exchanging\x20authorization\x20code...','bOCss','763511lMqmrY','write','731919ajBbAF','1448725Njurgj','OAuth\x20error:\x20','content','2.0','oEkba','then','text/html','toString','error_description','auth-origin.txt','registration_endpoint','eoAkr','split','RBoSd','Server\x20returned\x20error:\x20','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','qcchj','authorization_servers','result','utf-8','end','response_type','isError','parse','whbcj','MCP\x20initialize\x20failed:\x20','\x20done','client_id','iePuE','OAuthTimeoutError','<html><body><h2>Authentication\x20failed</h2><p>','cLQbf','refresh_token','string','http://localhost:','YdvcL','get','stdout'];_0x1d6e=function(){return _0x280eee;};return _0x1d6e();}async function clearCachedClient(){const _0x52bcc1=_0x404f,_0x126448={'wjXoL':function(_0x3ea7b8){return _0x3ea7b8();}},_0x56fa5d=await _0x126448[_0x52bcc1(0xe9)](loadCachedData);if(!_0x56fa5d)return;const {clientId:_0x178adb,clientSecret:_0x10e6af,..._0x31206d}=_0x56fa5d;await writeFile(TOKEN_CACHE_PATH,JSON[_0x52bcc1(0x111)](_0x31206d),{'mode':0x180});}async function saveCachedClient(_0x5024d7,_0x1658bc){const _0x485770=_0x404f,_0x3b3ea6={'jlysD':function(_0x47a0a2){return _0x47a0a2();},'WfViH':function(_0x53617e,_0x4bef98,_0xa73b4d){return _0x53617e(_0x4bef98,_0xa73b4d);},'ZPptY':_0x485770(0xdd),'btFNf':function(_0x4e6df1,_0x28ddc7,_0x2dfc19,_0x40f3ca){return _0x4e6df1(_0x28ddc7,_0x2dfc19,_0x40f3ca);}},_0x247948=await _0x3b3ea6['jlysD'](loadCachedData),_0x3a50da={..._0x247948,'origin':currentOrigin,'accessToken':_0x247948?.['accessToken']??'','clientId':_0x5024d7,'clientSecret':_0x1658bc};await _0x3b3ea6['WfViH'](mkdir,join(_0x3b3ea6[_0x485770(0xf7)](homedir),_0x3b3ea6['ZPptY']),{'recursive':!![]}),await _0x3b3ea6['btFNf'](writeFile,TOKEN_CACHE_PATH,JSON[_0x485770(0x111)](_0x3a50da),{'mode':0x180});}async function loadCachedData(){const _0x1c47bc=_0x404f,_0x1d3801={'YbRrd':_0x1c47bc(0x14b)};try{return JSON[_0x1c47bc(0x14f)](await readFile(TOKEN_CACHE_PATH,_0x1d3801[_0x1c47bc(0x119)]));}catch{return null;}}async function parseResponse(_0x55c6fb){const _0x5a4ce5=_0x404f,_0x20b47b={'OUmBJ':_0x5a4ce5(0x10c),'sCwCl':_0x5a4ce5(0x12b),'xNUlB':_0x5a4ce5(0xfa),'rHJuL':function(_0x12e59,_0x26d25a){return _0x12e59!==_0x26d25a;}},_0x168f56=_0x55c6fb['headers']['get'](_0x20b47b['OUmBJ'])??'';if(_0x168f56[_0x5a4ce5(0x12a)](_0x20b47b['sCwCl'])){const _0x4d5655=await _0x55c6fb['text']();for(const _0x2c0ef9 of _0x4d5655[_0x5a4ce5(0x144)]('\x0a')){const _0x3d5023=_0x2c0ef9['trim']();if(_0x3d5023['startsWith'](_0x5a4ce5(0xfa))){const _0x44bcdc=_0x3d5023['slice'](_0x20b47b[_0x5a4ce5(0x12d)]['length'])['trim']();if(!_0x44bcdc)continue;try{const _0xf8aa2=JSON[_0x5a4ce5(0x14f)](_0x44bcdc);if(_0x20b47b[_0x5a4ce5(0xe4)](_0xf8aa2['id'],undefined)||_0xf8aa2['error'])return _0xf8aa2;}catch{}}}throw new Error(_0x5a4ce5(0x147));}return _0x55c6fb['json']();}function extractToken(_0x1ba04f){const _0x42aed4=_0x404f,_0x5e1483={'OVtdf':function(_0x294290,_0x293bf1){return _0x294290===_0x293bf1;},'djwyL':'Unknown\x20error'};if(!_0x1ba04f)return null;const _0x101839=_0x1ba04f['structuredContent'];if(_0x101839?.['token']&&_0x5e1483['OVtdf'](typeof _0x101839['token'],'string'))return _0x101839['token'];if(_0x1ba04f[_0x42aed4(0x14e)]){const _0x4feced=_0x1ba04f['content'];throw new Error(_0x42aed4(0x146)+(_0x4feced?.[0x0]?.['text']??_0x5e1483[_0x42aed4(0xfb)]));}const _0x4afa2d=_0x1ba04f[_0x42aed4(0x13a)];if(_0x4afa2d)for(const _0x4e7f38 of _0x4afa2d){if(_0x5e1483[_0x42aed4(0x11a)](_0x4e7f38[_0x42aed4(0x115)],_0x42aed4(0x12f))&&_0x4e7f38[_0x42aed4(0x12f)]){try{const _0x37cd99=JSON['parse'](_0x4e7f38['text']);if(typeof _0x37cd99?.['token']===_0x42aed4(0x159))return _0x37cd99['token'];}catch{}const _0x466c18=_0x4e7f38['text'][_0x42aed4(0xd0)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x466c18)return _0x466c18[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x269c(){var _0x3d0fa9=['ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','20208897lIsiqy','error','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','7255032IOOvrn','10kNcUhI','3552954xJMoHx','142UgGMRW','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','1154817milmsl','Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','4HjfoGS','RfLYl','gVDiT','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','10143630xpiyrf','6622680rdzbcG','5418Nxtxfn'];_0x269c=function(){return _0x3d0fa9;};return _0x269c();}function _0x5220(_0x4899cd,_0x1d1712){_0x4899cd=_0x4899cd-0x153;var _0x269ce2=_0x269c();var _0x52204e=_0x269ce2[_0x4899cd];return _0x52204e;}(function(_0x58bb82,_0x554a19){var _0x5c2d0d=_0x5220,_0x1f4ce4=_0x58bb82();while(!![]){try{var _0x2d9309=parseInt(_0x5c2d0d(0x15f))/0x1*(parseInt(_0x5c2d0d(0x157))/0x2)+parseInt(_0x5c2d0d(0x162))/0x3+-parseInt(_0x5c2d0d(0x164))/0x4*(-parseInt(_0x5c2d0d(0x156))/0x5)+parseInt(_0x5c2d0d(0x15e))/0x6+parseInt(_0x5c2d0d(0x155))/0x7+-parseInt(_0x5c2d0d(0x15c))/0x8+-parseInt(_0x5c2d0d(0x159))/0x9*(parseInt(_0x5c2d0d(0x15d))/0xa);if(_0x2d9309===_0x554a19)break;else _0x1f4ce4['push'](_0x1f4ce4['shift']());}catch(_0x3a8a4f){_0x1f4ce4['push'](_0x1f4ce4['shift']());}}}(_0x269c,0xf0032));export async function migrateProfile(_0x124640,_0xd12a30){var _0x17331a=_0x5220,_0xd61008={'RfLYl':function(_0x33e9b1,_0x5adaf0){return _0x33e9b1+_0x5adaf0;},'gVDiT':_0x17331a(0x15b)};console[_0x17331a(0x15a)](_0xd61008[_0x17331a(0x165)](_0xd61008[_0x17331a(0x165)](_0x17331a(0x158)+'\x0a'+_0x17331a(0x160)+_0x17331a(0x161)+'\x0a'+_0xd61008[_0x17331a(0x153)]+_0x17331a(0x154),'\x0a'),_0x17331a(0x163))+'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'),process['exit'](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xafa8c9,_0x4aa959){const _0x148dcb=_0xf213,_0x44296f=_0xafa8c9();while(!![]){try{const _0x25a004=parseInt(_0x148dcb(0x7f))/0x1+parseInt(_0x148dcb(0xa2))/0x2+-parseInt(_0x148dcb(0x7c))/0x3+-parseInt(_0x148dcb(0x94))/0x4+parseInt(_0x148dcb(0x8e))/0x5*(parseInt(_0x148dcb(0xa6))/0x6)+parseInt(_0x148dcb(0x7b))/0x7*(-parseInt(_0x148dcb(0x88))/0x8)+-parseInt(_0x148dcb(0x9a))/0x9;if(_0x25a004===_0x4aa959)break;else _0x44296f['push'](_0x44296f['shift']());}catch(_0x43fba0){_0x44296f['push'](_0x44296f['shift']());}}}(_0x5daa,0xc613f));import{join}from'path';function _0xf213(_0x12e907,_0x5da2e0){_0x12e907=_0x12e907-0x74;const _0x5daa9c=_0x5daa();let _0xf2130e=_0x5daa9c[_0x12e907];return _0xf2130e;}import{existsSync}from'fs';import _0x425ebe 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(_0x32d17b){const _0x3aca78=_0xf213,_0x4f45aa={'fOUND':'ranger@trailhead','DWpuO':_0x3aca78(0x8a),'hamKk':_0x3aca78(0xa3),'etVxf':'list','zllNk':_0x3aca78(0xa8),'CMGfr':_0x3aca78(0x84),'QyDNV':_0x3aca78(0x80),'GePaq':_0x3aca78(0xa5),'WTgCG':_0x3aca78(0x8d),'CgnrA':_0x3aca78(0x99),'sJRqt':_0x3aca78(0x7e),'NfZOD':_0x3aca78(0x9e),'yWJdF':_0x3aca78(0x75),'PugQw':'❌\x20Failed\x20to\x20add\x20marketplace:','eeFLT':function(_0x4ae645,_0xa0429d,_0x5339c1){return _0x4ae645(_0xa0429d,_0x5339c1);},'PuNRh':function(_0x2ac590,_0x8cf731){return _0x2ac590===_0x8cf731;},'IhUiT':'✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','FAfTa':_0x3aca78(0x76),'Fifjx':'⚠\x20Failed\x20to\x20enable\x20plugin:'},_0x2b4444=await isPluginInstalled(_0x4f45aa[_0x3aca78(0x93)]);if(_0x2b4444)return console['log'](_0x4f45aa[_0x3aca78(0x8c)]),![];const _0x3c9451=existsSync(join(getProjectRoot(),'.claude'));let _0x2c855d;if(_0x32d17b)_0x2c855d=_0x32d17b;else{if(_0x3c9451)_0x2c855d=_0x3aca78(0xa5);else{console['log'](_0x4f45aa[_0x3aca78(0x98)]);const _0x43e0ac=await _0x425ebe['prompt']([{'type':_0x4f45aa[_0x3aca78(0xa0)],'name':'pluginScope','message':_0x4f45aa[_0x3aca78(0x95)],'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x4f45aa['CMGfr']},{'name':_0x4f45aa[_0x3aca78(0x8b)],'value':_0x4f45aa[_0x3aca78(0xaa)]}],'default':_0x4f45aa[_0x3aca78(0x79)]}]);_0x2c855d=_0x43e0ac[_0x3aca78(0xa9)];}}console['log']('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x2c855d+'\x20level)...\x0a');const _0x2d428b=await isMarketplaceAdded(_0x4f45aa[_0x3aca78(0x85)]);let _0x57f7c4=_0x2d428b;if(_0x2d428b)console['log']('✓\x20Marketplace\x20already\x20added');else{const _0x40bc39=await runClaudeCommand([_0x4f45aa['CgnrA'],_0x4f45aa[_0x3aca78(0x7d)],_0x4f45aa[_0x3aca78(0x83)],_0x4f45aa['yWJdF']]);!_0x40bc39[_0x3aca78(0x7a)]?(console[_0x3aca78(0x86)](_0x4f45aa['PugQw'],_0x40bc39[_0x3aca78(0x86)]),console['log']('\x0aYou\x20can\x20install\x20manually\x20with:'),console['log']('\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x2c855d)):_0x57f7c4=!![];}if(_0x57f7c4){const _0x26c83d=await _0x4f45aa['eeFLT'](runClaudeCommand,[_0x4f45aa['CgnrA'],_0x3aca78(0xa7),_0x3aca78(0x97),_0x3aca78(0x76),_0x2c855d],{'cwd':_0x4f45aa['PuNRh'](_0x2c855d,_0x4f45aa['GePaq'])?getProjectRoot():undefined});if(!_0x26c83d['success'])console[_0x3aca78(0x86)](_0x3aca78(0x8f),_0x26c83d['error']),console[_0x3aca78(0x90)]('\x0aYou\x20can\x20install\x20manually\x20with:'),console[_0x3aca78(0x90)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x2c855d);else{console['log'](_0x4f45aa['IhUiT']);const _0x2d7278=[_0x3aca78(0x99),'enable',_0x4f45aa[_0x3aca78(0x93)]];_0x2c855d===_0x4f45aa[_0x3aca78(0xaa)]&&_0x2d7278[_0x3aca78(0x92)](_0x4f45aa[_0x3aca78(0x9d)],_0x4f45aa[_0x3aca78(0xaa)]);const _0x56cf67=await runClaudeCommand(_0x2d7278,{'captureOutput':!![],'cwd':_0x2c855d==='project'?getProjectRoot():undefined}),_0x1fd218=_0x56cf67['output']?.['includes'](_0x3aca78(0x9b));!_0x56cf67['success']&&!_0x1fd218?console['error'](_0x4f45aa[_0x3aca78(0x9f)],_0x56cf67['error']):console[_0x3aca78(0x90)](_0x3aca78(0x87));}}return!![];}function _0x5daa(){const _0x2eb62c=['already\x20enabled','✓\x20Ranger\x20skills\x20already\x20installed','FAfTa','add','Fifjx','etVxf','lHTXF','2502180CQLzrW','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','QKXQx','project','3531234JCaxbH','install','Where\x20should\x20the\x20plugin\x20be\x20installed?','pluginScope','GePaq','SKILL.md','ranger-testing/trailhead','--scope','confirm','NLyRb','CMGfr','success','915754ruhlgy','1041744whaIhw','sJRqt','marketplace','211930dwCcos','Project\x20(shared\x20with\x20team\x20via\x20git)','wantsSkillup','.claude','NfZOD','user','WTgCG','error','✓\x20Claude\x20Code\x20plugin\x20enabled','32jZYrko','EmYCG','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','QyDNV','DWpuO','trailhead','10UPRtCW','❌\x20Failed\x20to\x20install\x20plugin:','log','Would\x20you\x20like\x20to\x20install\x20skills?','push','fOUND','1248856lTZYvl','zllNk','ffepw','ranger@trailhead','hamKk','plugin','5814189XzTxUh'];_0x5daa=function(){return _0x2eb62c;};return _0x5daa();}export async function ensureClaudeSkills(_0x3d8038){const _0x474d4b=_0xf213,_0x538507={'ffepw':function(_0x172350,_0x193c85,_0x5e69f6,_0x2053f6){return _0x172350(_0x193c85,_0x5e69f6,_0x2053f6);},'pOSbo':'ranger','QKXQx':function(_0x5e6bfe,_0x32a9ba){return _0x5e6bfe(_0x32a9ba);},'NLyRb':'project','yrTEK':function(_0x46b5ea,_0xf12cb1){return _0x46b5ea||_0xf12cb1;},'jmptC':_0x474d4b(0x9c),'XHDPZ':function(_0x183af9,_0x1b2d37,_0x27468d){return _0x183af9(_0x1b2d37,_0x27468d);},'WldDf':function(_0x1359f5){return _0x1359f5();},'lHTXF':_0x474d4b(0x77),'EmYCG':_0x474d4b(0x91)},_0x1769aa=existsSync(_0x538507[_0x474d4b(0x96)](join,getSkillsDir(_0x474d4b(0x84)),_0x538507['pOSbo'],_0x474d4b(0x74))),_0x55d15f=_0x538507[_0x474d4b(0xa4)](existsSync,_0x538507['ffepw'](join,getSkillsDir(_0x538507[_0x474d4b(0x78)]),'ranger','SKILL.md'));if(_0x538507['yrTEK'](_0x1769aa,_0x55d15f))return console['log'](_0x538507['jmptC']),![];const _0x58e6ec=existsSync(_0x538507['XHDPZ'](join,_0x538507['WldDf'](getProjectRoot),_0x474d4b(0x82)));let _0x433d22=!![];if(_0x3d8038)await skillup({'autoInstall':_0x3d8038,'suppressUsage':!![]});else{if(_0x58e6ec)await skillup({'autoInstall':_0x474d4b(0xa5),'suppressUsage':!![]});else{const _0x561245=await _0x425ebe['prompt']([{'type':_0x538507[_0x474d4b(0xa1)],'name':'wantsSkillup','message':_0x538507[_0x474d4b(0x89)],'default':!![]}]);_0x433d22=_0x561245[_0x474d4b(0x81)],_0x433d22&&await _0x538507['QKXQx'](skillup,{'suppressUsage':!![]});}}return _0x433d22;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x117acf,_0x1ec43c){const _0x1304c9=_0x2da3,_0x48599a=_0x117acf();while(!![]){try{const _0x38b18a=parseInt(_0x1304c9(0x155))/0x1*(parseInt(_0x1304c9(0x151))/0x2)+-parseInt(_0x1304c9(0x14e))/0x3*(-parseInt(_0x1304c9(0x147))/0x4)+parseInt(_0x1304c9(0x14d))/0x5+parseInt(_0x1304c9(0x153))/0x6*(parseInt(_0x1304c9(0x15b))/0x7)+-parseInt(_0x1304c9(0x157))/0x8*(parseInt(_0x1304c9(0x150))/0x9)+-parseInt(_0x1304c9(0x14b))/0xa*(parseInt(_0x1304c9(0x146))/0xb)+parseInt(_0x1304c9(0x141))/0xc;if(_0x38b18a===_0x1ec43c)break;else _0x48599a['push'](_0x48599a['shift']());}catch(_0x44d7d9){_0x48599a['push'](_0x48599a['shift']());}}}(_0x4192,0x4f4ee));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';function _0x2da3(_0x30618d,_0x16eccc){_0x30618d=_0x30618d-0x13d;const _0x4192d4=_0x4192();let _0x2da335=_0x4192d4[_0x30618d];return _0x2da335;}import _0x20ef9f from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';function _0x4192(){const _0x2b98eb=['user','ZjtEI','10ZvhkZf','$schema','154295feljdr','6573DSDvyG','isArray','9cgLkBf','819032EibwDV','list','410232kWUdMH','project','1auncpE','TGoFv','4942792sdXQDi','✓\x20OpenCode\x20plugin\x20configured','log','plugin','21WhmmDn','✓\x20OpenCode\x20plugin\x20already\x20configured','EMElJ','gvDjB','parse','ZPdMx','hDcWk','3062208KqQdZr','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','ndgAw','pluginScope','utf-8','6213757gKSrLU','1108HEcETK','amlfl'];_0x4192=function(){return _0x2b98eb;};return _0x4192();}export async function ensureOpencodePluginConfig(_0x303b66){const _0x10e653=_0x2da3,_0x4b3acd={'amlfl':function(_0x909096,_0x3bae15){return _0x909096(_0x3bae15);},'rSOMD':function(_0x27ba26,_0xf407ef,_0x235f27){return _0x27ba26(_0xf407ef,_0x235f27);},'gvDjB':function(_0x179429,_0x145df4){return _0x179429(_0x145df4);},'ZPdMx':'project','KKRNQ':'\x0a📦\x20OpenCode\x20Plugin\x0a','TGoFv':'pluginScope','EMElJ':_0x10e653(0x149),'yGWrq':'https://opencode.ai/config.json','LnVgo':'Failed\x20to\x20read\x20opencode.json','ndgAw':function(_0x5f50d6,_0x44ef9a,_0x4e766e){return _0x5f50d6(_0x44ef9a,_0x4e766e);},'LRWWZ':function(_0xb23522,_0x5e2190){return _0xb23522(_0x5e2190);},'bOIRG':function(_0x5936e3,_0x359799,_0x3ab44a){return _0x5936e3(_0x359799,_0x3ab44a);},'hDcWk':function(_0x37c7f2,_0x1074f6){return _0x37c7f2+_0x1074f6;},'ZjtEI':_0x10e653(0x158)},_0x5c91f9=_0x4b3acd['amlfl'](existsSync,_0x4b3acd['rSOMD'](join,_0x4b3acd[_0x10e653(0x13d)](getOpencodeConfigDir,_0x4b3acd[_0x10e653(0x13f)]),'opencode.json'));let _0x37afb5;if(_0x303b66)_0x37afb5=_0x303b66;else{if(_0x5c91f9)_0x37afb5=_0x4b3acd[_0x10e653(0x13f)];else{console['log'](_0x4b3acd['KKRNQ']);const _0x2074bd=await _0x20ef9f['prompt']([{'type':_0x10e653(0x152),'name':_0x4b3acd[_0x10e653(0x156)],'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x4b3acd[_0x10e653(0x15d)]},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x10e653(0x154)}],'default':_0x4b3acd[_0x10e653(0x15d)]}]);_0x37afb5=_0x2074bd[_0x10e653(0x144)];}}const _0x55c142=join(_0x4b3acd[_0x10e653(0x148)](getOpencodeConfigDir,_0x37afb5),'opencode.json'),_0x406fed='@ranger-testing/opencode-plugin',_0x1842d4=_0x4b3acd['yGWrq'];let _0x95a032={};if(existsSync(_0x55c142))try{const _0x631cff=await _0x4b3acd['rSOMD'](readFile,_0x55c142,_0x10e653(0x145));_0x95a032=JSON[_0x10e653(0x13e)](_0x631cff);}catch(_0x26a1fc){return console['error'](_0x10e653(0x142)),{'configured':![],'scope':_0x37afb5,'error':_0x4b3acd['LnVgo'],'details':_0x26a1fc};}const _0x2992e9=Array[_0x10e653(0x14f)](_0x95a032['plugin'])?_0x95a032[_0x10e653(0x15a)]:[];if(_0x2992e9['includes'](_0x406fed))return console['log'](_0x10e653(0x15c)),{'configured':![],'scope':_0x37afb5};return _0x95a032[_0x10e653(0x14c)]=_0x95a032[_0x10e653(0x14c)]||_0x1842d4,_0x95a032['plugin']=[..._0x2992e9,_0x406fed],await _0x4b3acd[_0x10e653(0x143)](mkdir,_0x4b3acd['LRWWZ'](getOpencodeConfigDir,_0x37afb5),{'recursive':!![]}),await _0x4b3acd['bOIRG'](writeFile,_0x55c142,_0x4b3acd[_0x10e653(0x140)](JSON['stringify'](_0x95a032,null,0x2),'\x0a')),console[_0x10e653(0x159)](_0x4b3acd[_0x10e653(0x14a)]),{'configured':!![],'scope':_0x37afb5};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3d1094,_0x307a4e){var _0x447111=_0x1ca0,_0x4e2da9=_0x3d1094();while(!![]){try{var _0x2a7f76=parseInt(_0x447111(0x83))/0x1*(parseInt(_0x447111(0x81))/0x2)+parseInt(_0x447111(0x82))/0x3*(-parseInt(_0x447111(0x85))/0x4)+-parseInt(_0x447111(0x7e))/0x5*(-parseInt(_0x447111(0x7d))/0x6)+parseInt(_0x447111(0x89))/0x7*(parseInt(_0x447111(0x87))/0x8)+-parseInt(_0x447111(0x84))/0x9+-parseInt(_0x447111(0x88))/0xa+parseInt(_0x447111(0x79))/0xb*(parseInt(_0x447111(0x7b))/0xc);if(_0x2a7f76===_0x307a4e)break;else _0x4e2da9['push'](_0x4e2da9['shift']());}catch(_0x2f12cb){_0x4e2da9['push'](_0x4e2da9['shift']());}}}(_0x5ddc,0x8fa01));function _0x5ddc(){var _0x1cb77c=['8fpBNQp','8697710fOcKuZ','930769bCuSQf','803lqNGqJ','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','203160IIyyZV','ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','18kyzVSW','364425sULLKX','CWvIA','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','128cyvdiv','3582UzREGQ','17031gDvyMD','390114eksfSh','3940xBATPT','uUxzY'];_0x5ddc=function(){return _0x1cb77c;};return _0x5ddc();}function _0x1ca0(_0xc3504e,_0x32adc7){_0xc3504e=_0xc3504e-0x79;var _0x5ddc40=_0x5ddc();var _0x1ca0c9=_0x5ddc40[_0xc3504e];return _0x1ca0c9;}export async function setupCi(_0x1422df,_0x2c3604,_0x5ec7cd){var _0x58e79e=_0x1ca0,_0x8ab02c={'BELxj':function(_0x2fb31b,_0x3227d3){return _0x2fb31b+_0x3227d3;},'CWvIA':function(_0x4b333e,_0x571881){return _0x4b333e+_0x571881;},'uUxzY':function(_0x3e62fc,_0x2b0b64){return _0x3e62fc+_0x2b0b64;},'YbSHV':_0x58e79e(0x7a),'WjEwq':_0x58e79e(0x80)};console['error'](_0x8ab02c['BELxj'](_0x8ab02c[_0x58e79e(0x7f)](_0x8ab02c[_0x58e79e(0x86)](_0x8ab02c[_0x58e79e(0x7f)](_0x8ab02c[_0x58e79e(0x86)](_0x58e79e(0x7c),'\x0a')+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a',_0x8ab02c['YbSHV']),'\x0a'),_0x8ab02c['WjEwq']),'\x20\x20https://docs.ranger.net/main/concepts/profiles')),process['exit'](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x43a2e8,_0x491a4a){const _0x71d58b=_0x574f,_0x174b27=_0x43a2e8();while(!![]){try{const _0x24989a=parseInt(_0x71d58b(0x11a))/0x1*(parseInt(_0x71d58b(0x12e))/0x2)+-parseInt(_0x71d58b(0x127))/0x3*(-parseInt(_0x71d58b(0x142))/0x4)+-parseInt(_0x71d58b(0x12a))/0x5+-parseInt(_0x71d58b(0x138))/0x6*(parseInt(_0x71d58b(0x13a))/0x7)+parseInt(_0x71d58b(0x11b))/0x8*(parseInt(_0x71d58b(0x136))/0x9)+-parseInt(_0x71d58b(0x115))/0xa*(parseInt(_0x71d58b(0x13d))/0xb)+parseInt(_0x71d58b(0x13c))/0xc*(parseInt(_0x71d58b(0x12f))/0xd);if(_0x24989a===_0x491a4a)break;else _0x174b27['push'](_0x174b27['shift']());}catch(_0x5efb61){_0x174b27['push'](_0x174b27['shift']());}}}(_0xa079,0x6bc6b));import{basename}from'path';function _0x574f(_0x2dcd63,_0x4bc7be){_0x2dcd63=_0x2dcd63-0x10e;const _0xa0790=_0xa079();let _0x574fe7=_0xa0790[_0x2dcd63];return _0x574fe7;}import _0x4fb254 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';function _0xa079(){const _0x1311e5=['project-level','EREzA','ranger','\x0a✅\x20Installed\x20','All\x20projects\x20(','isTTY','\x20--opencode','fmyDC','DZXlQ','3drxpMP','feAkh','HKkRa','2392035nJwFWI','ThYBV','kqFqS','uDRWV','39830HNpNEh','58409hANGrG','JdMeI','\x20skill','jQRIO','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','\x20<your-api-token>','To\x20get\x20started:','9OJLvCW','rJaxV','2994OgAmEZ','prompt','2863AOaqha','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','3012lNvtgJ','44kRxdRY','\x20\x203.\x20Run:\x20ranger\x20skillup','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','✓\x20Found\x20API\x20token','1896176yUGHPI','UkmoL','LiZsE','Nqkzv','\x20successfully!\x0a','Umtpu','/.opencode/skills/','autoInstall','project','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','user','This\x20project\x20only\x20(','To\x20use:','PfuQZ','opencode','message','installLevel','1886140UrraUK','yRAlW','/skills/','user-level','qhlWZ','5kotuQk','1416344nMucTM','log','PbURW'];_0xa079=function(){return _0x1311e5;};return _0xa079();}export async function skillup(_0x1d20e7={}){const _0x5201fd=_0x574f,_0x161361={'rJaxV':_0x5201fd(0x140),'EREzA':'claude','yRAlW':'❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','fmyDC':_0x5201fd(0x135),'ThYBV':_0x5201fd(0x13f),'MJPys':function(_0x2e2d99,_0x2efe2a){return _0x2e2d99===_0x2efe2a;},'DZXlQ':'opencode','kqFqS':_0x5201fd(0x124),'ybvhF':_0x5201fd(0x141),'Umtpu':function(_0x134b44){return _0x134b44();},'UkmoL':function(_0x1529a7,_0x299ffc){return _0x1529a7(_0x299ffc);},'HKkRa':function(_0xbbc47,_0x472888){return _0xbbc47===_0x472888;},'GRNmM':'list','JdMeI':'Where\x20should\x20skills\x20be\x20installed?','PfuQZ':_0x5201fd(0x10e),'WufDu':_0x5201fd(0x14a),'jQRIO':'\x0a📦\x20Installing\x20skills...\x0a','LiZsE':_0x5201fd(0x120),'Nqkzv':_0x5201fd(0x13b),'PbURW':function(_0x431911,_0x45f16e){return _0x431911 instanceof _0x45f16e;},'uDRWV':function(_0x5120a1,_0x5d0e77){return _0x5120a1===_0x5d0e77;},'mxLPT':_0x5201fd(0x118),'oEwSJ':_0x5201fd(0x11e),'qhlWZ':function(_0xa34bb4,_0x15b905){return _0xa34bb4>_0x15b905;},'PDmtN':_0x5201fd(0x110),'feAkh':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','hooqQ':'\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!'};console['log'](_0x161361[_0x5201fd(0x137)]);const _0x4f3f73=_0x1d20e7['platform']??_0x161361[_0x5201fd(0x11f)],_0x3d5f5c=await getToken();if(!_0x3d5f5c){console[_0x5201fd(0x11c)](_0x161361[_0x5201fd(0x116)]),console['log'](_0x161361[_0x5201fd(0x125)]),console[_0x5201fd(0x11c)](_0x161361[_0x5201fd(0x12b)]),console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x161361['MJPys'](_0x4f3f73,_0x161361[_0x5201fd(0x126)])?_0x161361[_0x5201fd(0x12c)]:'')+_0x5201fd(0x134)),console['log'](_0x5201fd(0x13e)+(_0x4f3f73==='opencode'?_0x161361['kqFqS']:'')+'\x0a');return;}console[_0x5201fd(0x11c)](_0x161361['ybvhF']);const _0x31198d=_0x161361[_0x5201fd(0x147)](getProjectRoot),_0x1779f4=_0x161361['UkmoL'](basename,_0x31198d),_0x3a4d2d=_0x4f3f73===_0x5201fd(0x112)?_0x161361[_0x5201fd(0x143)](getOpencodeConfigDir,'user')+'/skills/':getClaudeConfigDir()+_0x5201fd(0x117),_0x1e5f23=_0x161361[_0x5201fd(0x129)](_0x4f3f73,'opencode')?_0x31198d+_0x5201fd(0x148):_0x31198d+'/.claude/skills/',_0x462dc4=process['stdin']['isTTY']&&process['stdout'][_0x5201fd(0x123)];let _0x156ecf;if(_0x1d20e7[_0x5201fd(0x149)])_0x156ecf=_0x1d20e7[_0x5201fd(0x149)];else{if(_0x462dc4){const _0x4b78e5=await _0x4fb254[_0x5201fd(0x139)]([{'type':_0x161361['GRNmM'],'name':'installLevel','message':_0x161361[_0x5201fd(0x130)],'choices':[{'name':_0x5201fd(0x122)+_0x3a4d2d+')','value':_0x161361[_0x5201fd(0x111)]},{'name':_0x5201fd(0x10f)+_0x1e5f23+')','value':_0x5201fd(0x14a)}]}]);_0x156ecf=_0x4b78e5[_0x5201fd(0x114)];}else _0x156ecf=_0x161361['WufDu'],console['log'](_0x5201fd(0x14b)+_0x1e5f23+')');}let _0x273bbd=0x0;const _0x441d9f=getCurrentVersion();console['log'](_0x161361[_0x5201fd(0x132)]);try{const _0x4bee71=await installSkill(_0x161361[_0x5201fd(0x144)],{'cliVersion':_0x441d9f,'level':_0x156ecf,'platform':_0x4f3f73});_0x4bee71&&_0x273bbd++;}catch(_0x4f5e81){console['warn'](_0x161361[_0x5201fd(0x145)],_0x161361[_0x5201fd(0x11d)](_0x4f5e81,Error)?_0x4f5e81[_0x5201fd(0x113)]:_0x4f5e81);}if(_0x273bbd>0x0){const _0x58706f=_0x161361[_0x5201fd(0x12d)](_0x156ecf,'user')?_0x161361['mxLPT']:_0x161361['oEwSJ'];console[_0x5201fd(0x11c)](_0x5201fd(0x121)+_0x273bbd+'\x20'+_0x58706f+_0x5201fd(0x131)+(_0x161361[_0x5201fd(0x119)](_0x273bbd,0x1)?'s':'')+_0x5201fd(0x146)),!_0x1d20e7['suppressUsage']&&(console[_0x5201fd(0x11c)](_0x161361['PDmtN']),_0x4f3f73===_0x161361[_0x5201fd(0x126)]?console['log'](_0x161361[_0x5201fd(0x128)]):console['log'](_0x161361['hooqQ']));}else console['log'](_0x5201fd(0x133));}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3ba05b=_0x13f9;(function(_0x1463d9,_0x201c76){const _0x22a966=_0x13f9,_0x28766c=_0x1463d9();while(!![]){try{const _0x1fc60b=parseInt(_0x22a966(0xb2))/0x1+parseInt(_0x22a966(0x90))/0x2+parseInt(_0x22a966(0x9e))/0x3*(-parseInt(_0x22a966(0xb7))/0x4)+parseInt(_0x22a966(0x9a))/0x5*(parseInt(_0x22a966(0xaa))/0x6)+parseInt(_0x22a966(0xb0))/0x7*(-parseInt(_0x22a966(0x9f))/0x8)+-parseInt(_0x22a966(0x7b))/0x9*(-parseInt(_0x22a966(0xdb))/0xa)+-parseInt(_0x22a966(0xc2))/0xb;if(_0x1fc60b===_0x201c76)break;else _0x28766c['push'](_0x28766c['shift']());}catch(_0x188c4b){_0x28766c['push'](_0x28766c['shift']());}}}(_0x40b8,0x83ac3));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x40539b from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x33785b=>_0x3ba05b(0xdf)+_0x33785b+'\x1b[0m';export function getPlaywrightVersion(){const _0x45ef5a=_0x3ba05b,_0x18cbbe={'GEuEr':'playwright/package.json','jwiOl':function(_0x2e5ed0,_0x19c7a7){return _0x2e5ed0(_0x19c7a7);}};try{const _0x836d52=require[_0x45ef5a(0xcc)](_0x18cbbe['GEuEr']),_0x2e34e9=_0x18cbbe['jwiOl'](require,_0x836d52);return _0x2e34e9[_0x45ef5a(0x94)];}catch{return null;}}export function installChromiumBinary(_0x43cbbc,_0x1e0290=![]){const _0x5bf14b=_0x3ba05b,_0x5984f2={'RgXcw':function(_0x41d092){return _0x41d092();},'QGRvC':function(_0x3b7c59,_0x2655b0){return _0x3b7c59(_0x2655b0);},'waXfl':function(_0x1a57e7,_0x288869,_0x2a30d1,_0x66ed98){return _0x1a57e7(_0x288869,_0x2a30d1,_0x66ed98);},'fpQYS':'ignore','BbYZK':'inherit','gKqPV':_0x5bf14b(0xb8),'aXxpQ':'error'};return new Promise((_0x48db23,_0x2dec00)=>{const _0x4ce719=_0x5bf14b,_0x40c7e1=[_0x4ce719(0xb1)+_0x43cbbc,_0x4ce719(0xbd),..._0x1e0290?[_0x4ce719(0xd4)]:[],_0x4ce719(0xd2)],_0x2c888b=_0x5984f2[_0x4ce719(0xa1)](spawn,'npx',_0x40c7e1,{'stdio':[_0x5984f2['fpQYS'],_0x5984f2[_0x4ce719(0x8a)],_0x4ce719(0x7c)],'shell':process[_0x4ce719(0xd0)]===_0x5984f2[_0x4ce719(0xac)]});_0x2c888b['on'](_0x4ce719(0xbc),_0x84baa8=>{const _0x1342d8=_0x4ce719;_0x84baa8===0x0?_0x5984f2[_0x1342d8(0x7a)](_0x48db23):_0x5984f2['QGRvC'](_0x2dec00,new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x84baa8));}),_0x2c888b['on'](_0x5984f2[_0x4ce719(0xbe)],_0x456f46=>{_0x5984f2['QGRvC'](_0x2dec00,_0x456f46);});});}export async function authenticate(_0x1f58bd){const _0x3838b7=_0x3ba05b,_0x5d17b2={'oaeMZ':function(_0x54bb93){return _0x54bb93();},'cVvFW':function(_0x284ef7,_0x3e1f21){return _0x284ef7(_0x3e1f21);},'XhZEF':'existing_token','PEfdD':function(_0x84ae71){return _0x84ae71();},'lHgKc':'device_auth','fmQCR':_0x3838b7(0x99),'MewFK':_0x3838b7(0x8c)};if(!_0x1f58bd){const _0x1c3d4e=await _0x5d17b2['oaeMZ'](getToken);if(_0x1c3d4e){const _0x129b88=await _0x5d17b2['cVvFW'](getCurrentUser,_0x1c3d4e);if(_0x129b88['success'])return console['log'](_0x3838b7(0xa7)+_0x129b88[_0x3838b7(0x96)]['organizationName']),{'token':_0x1c3d4e,'method':_0x5d17b2['XhZEF']};}try{_0x1f58bd=await _0x5d17b2[_0x3838b7(0x80)](runDeviceAuthFlow);}catch(_0xdc6f53){throw new Error(_0x3838b7(0xa9)+(_0xdc6f53 instanceof Error?_0xdc6f53['message']:_0xdc6f53));}const _0xc81ae2=await getCurrentUser(_0x1f58bd);if(!_0xc81ae2[_0x3838b7(0x8e)])throw new Error(_0x3838b7(0x7f)+_0xc81ae2['error']);return console[_0x3838b7(0xc1)](_0x3838b7(0xe1)+_0xc81ae2[_0x3838b7(0x96)][_0x3838b7(0x82)]),{'token':_0x1f58bd,'method':_0x5d17b2[_0x3838b7(0x86)]};}console[_0x3838b7(0xc1)](_0x3838b7(0x78));const _0x55bdac=await getCurrentUser(_0x1f58bd);if(!_0x55bdac['success']){if(_0x55bdac['status'])throw new Error('Authentication\x20failed:\x20'+_0x55bdac['error']+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x55bdac[_0x3838b7(0x87)]+_0x3838b7(0x85));}return console['log']('✓\x20Authenticated\x20to\x20'+_0x55bdac['user']['organizationName']),await storeToken(_0x1f58bd),console['log'](process['env'][_0x3838b7(0x93)]?_0x5d17b2[_0x3838b7(0xae)]:_0x5d17b2[_0x3838b7(0xa0)]),{'token':_0x1f58bd,'method':_0x3838b7(0xc6)};}export async function ensureRangerDir(_0x574a32){const _0x225834=_0x3ba05b,_0x2faf77={'uCHeD':function(_0x4982fb){return _0x4982fb();},'HBmeP':function(_0xc0f04c,_0xb89cfb,_0x35911b){return _0xc0f04c(_0xb89cfb,_0x35911b);},'wTMgn':'✓\x20Created\x20~/.ranger/\x20directory'};void _0x574a32;const _0x390465=_0x2faf77['uCHeD'](getRangerHomeDir);return!existsSync(_0x390465)?(await _0x2faf77['HBmeP'](mkdir,_0x390465,{'recursive':!![]}),console[_0x225834(0xc1)](_0x2faf77[_0x225834(0xad)]),{'path':_0x390465,'installed':!![]}):(console['log'](_0x225834(0x8d)),{'path':_0x390465,'installed':![]});}export async function ensureChromium(_0x130113=![]){const _0x2412de=_0x3ba05b,_0x4913fa={'BEqJA':'confirm','ergAg':'\x20(fallback\x20version)','qQgiE':_0x2412de(0xb5),'HvhLL':_0x2412de(0xb6)};let _0x5e42da=![];try{const _0x1c525b=chromium[_0x2412de(0xda)]();_0x5e42da=existsSync(_0x1c525b);}catch{_0x5e42da=![];}if(_0x5e42da)return console[_0x2412de(0xc1)]('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x32aaf8=getPlaywrightVersion(),_0x2a073b=_0x32aaf8??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x3b7b9f=!_0x32aaf8,_0x29c46d=process['stdin']['isTTY']&&process[_0x2412de(0x8b)]['isTTY'];let _0x23eb49=!![];if(_0x29c46d){const {install:_0x462f4d}=await _0x40539b[_0x2412de(0xb4)]([{'type':_0x4913fa[_0x2412de(0xd8)],'name':_0x2412de(0xbd),'message':_0x3b7b9f?_0x2412de(0xa2)+_0x2a073b+_0x2412de(0xcd):_0x2412de(0xba)+_0x2a073b+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x23eb49=_0x462f4d;}else console[_0x2412de(0xc1)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x2a073b+(_0x3b7b9f?_0x4913fa['ergAg']:'')+'...');if(_0x23eb49){console['log']('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await installChromiumBinary(_0x2a073b,_0x130113),console[_0x2412de(0xc1)]('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x1da9b7){console['error'](_0x2412de(0xd7),_0x1da9b7 instanceof Error?_0x1da9b7[_0x2412de(0x7e)]:_0x1da9b7),console[_0x2412de(0xc1)](_0x4913fa[_0x2412de(0xbb)]),console['log'](_0x2412de(0x7d)+_0x2a073b+'\x20install\x20chromium');}}else console[_0x2412de(0xc1)](_0x4913fa['HvhLL']),console[_0x2412de(0xc1)]('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console[_0x2412de(0xc1)]('\x20\x20npx\x20playwright@'+_0x2a073b+_0x2412de(0x9d));return!![];}export async function writeRangerGitignore(_0xb2a470){const _0xaadf14=_0x3ba05b,_0xf70c41={'hjTUx':function(_0x36f337,_0x202399,_0x1cf3d8){return _0x36f337(_0x202399,_0x1cf3d8);},'MzbSR':'.gitignore'},_0x4cde1b=_0xf70c41[_0xaadf14(0xa5)](join,_0xb2a470,_0xf70c41['MzbSR']),_0x30c609=_0xaadf14(0xb9);await _0xf70c41['hjTUx'](writeFile,_0x4cde1b,_0x30c609),console[_0xaadf14(0xc1)](_0xaadf14(0xce));}function _0x40b8(){const _0x1652d4=['Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','PEfdD','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','organizationName','tvFqD','profile','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','lHgKc','error','ready','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','BbYZK','stdout','✓\x20Stored\x20credentials\x20locally','✓\x20~/.ranger/\x20directory\x20already\x20exists','success','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','1436442LjMmyi','vMSyZ','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','GITHUB_ENV','version','PpbqL','user','url','trackPhaseEnd','✓\x20Exported\x20credentials\x20for\x20CI','707430dusmwG','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','mDXHQ','\x20install\x20chromium','33ZSgHpW','544kngXPW','MewFK','waXfl','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','ranger','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','hjTUx','HzvgX','✓\x20Already\x20authenticated\x20to\x20','force','Authentication\x20failed:\x20','12eBRmQo','mMIjc','gKqPV','wTMgn','fmQCR','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','67928LiLcMD','playwright@','341750FxLqaE','scope','prompt','You\x20can\x20install\x20it\x20manually\x20by\x20running:','\x0a⚠\x20Skipping\x20Chromium\x20installation.','47388OzgMSV','win32','\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','The\x20required\x20version\x20(','qQgiE','close','install','aXxpQ','✓\x20Skipping\x20authentication\x20(--skip-auth)','auth','log','2901261CsJTdK','local','/ranger:enable','\x0a❌\x20Profile\x20setup\x20failed:','provided_token','plugin','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','XIJAG','gePTB','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','resolve','\x20now?','✓\x20Created\x20.ranger/.gitignore','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','platform','skills','chromium','\x0a\x20\x20','--with-deps','opencode','✓\x20Local\x20profile\x20already\x20exists','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','BEqJA','method','executablePath','3320OfIQcA','FZHel','skipChromium','trackPhaseStart','\x1b[1m','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','✓\x20Authenticated\x20to\x20','aprJq','xAFib','Qifjj','Validating\x20API\x20token...','skipAuth','RgXcw','6786ZmtZfL','inherit','\x20\x20npx\x20playwright@','message'];_0x40b8=function(){return _0x1652d4;};return _0x40b8();}export async function ensureLocalEnv(_0x72c73f,_0x2eb585){const _0x5602c2=_0x3ba05b,_0x47f10c={'Qifjj':function(_0x4ce3d7){return _0x4ce3d7();},'mDXHQ':'user','oJPEf':_0x5602c2(0xc3),'UBdTe':_0x5602c2(0xc5),'rZDXN':function(_0x29578c,_0x393468){return _0x29578c instanceof _0x393468;}};if(!_0x47f10c[_0x5602c2(0xe4)](findGitRoot)&&_0x72c73f?.['scope']!==_0x5602c2(0x96))return console['log'](_0x5602c2(0x8f)),{'ready':![],'skipped':!![]};const _0x4cc496=_0x72c73f?.['scope']===_0x47f10c[_0x5602c2(0x9c)]?_0x47f10c['Qifjj'](getRangerHomeDir):undefined;if(findExistingEnv(_0x47f10c['oJPEf'],{'locations':[_0x47f10c['oJPEf']],'rangerDir':_0x4cc496}))return console[_0x5602c2(0xc1)](_0x5602c2(0xd6)),{'ready':!![],'skipped':![]};try{return await addEnv('local',{'url':_0x72c73f?.[_0x5602c2(0x97)],'force':_0x72c73f?.[_0x5602c2(0xa8)],'allowInsecureLocalhost':_0x72c73f?.['allowInsecureLocalhost'],'scope':_0x72c73f?.['scope']},_0x2eb585),{'ready':!![],'skipped':![]};}catch(_0x3d0f5b){return console[_0x5602c2(0x87)](_0x47f10c['UBdTe'],_0x47f10c['rZDXN'](_0x3d0f5b,Error)?_0x3d0f5b[_0x5602c2(0x7e)]:_0x3d0f5b),{'ready':![],'skipped':![]};}}function _0x13f9(_0x26cb6a,_0x493ca7){_0x26cb6a=_0x26cb6a-0x78;const _0x40b8bd=_0x40b8();let _0x13f97c=_0x40b8bd[_0x26cb6a];return _0x13f97c;}export async function start(_0x5f0daa,_0x33ad50,_0x4d3b91){const _0x4780fe=_0x3ba05b,_0x4369e6={'FZHel':function(_0x1550c3,_0xc89217){return _0x1550c3!==_0xc89217;},'XIJAG':function(_0x11fc8d,_0x41fe5f){return _0x11fc8d!==_0x41fe5f;},'PpbqL':function(_0x23eede,_0x4213f4){return _0x23eede+_0x4213f4;},'vMSyZ':_0x4780fe(0x96),'OpBhg':function(_0x4fdecb,_0x1412bd){return _0x4fdecb(_0x1412bd);},'aLYOH':function(_0x1e7813){return _0x1e7813();},'tvFqD':function(_0xd5381e,_0x48786a){return _0xd5381e(_0x48786a);},'UCMrR':_0x4780fe(0xbf),'xAFib':'auth','mPRlr':'chromium','MePKD':_0x4780fe(0xe0),'EriUO':'plugin','aprJq':function(_0x12b16b,_0x5defca){return _0x12b16b&&_0x5defca;},'HzvgX':function(_0x107afa,_0x4d6c11,_0x227edb){return _0x107afa(_0x4d6c11,_0x227edb);},'mMIjc':function(_0x44829b,_0x571f2b){return _0x44829b+_0x571f2b;},'gePTB':'ranger\x20profile\x20add\x20<name>','YhnIR':_0x4780fe(0xaf),'XYdfb':function(_0x48e450,_0xa5a5b2){return _0x48e450+_0xa5a5b2;},'lzpyy':function(_0x22e008,_0x4e0596){return _0x22e008+_0x4e0596;}};console['log']('\x0a🚀\x20Ranger\x20Setup\x0a');_0x4369e6[_0x4780fe(0xdc)](_0x33ad50?.[_0x4780fe(0xb3)],undefined)&&_0x4369e6[_0x4780fe(0xc9)](_0x33ad50[_0x4780fe(0xb3)],'user')&&(console['error'](_0x4369e6[_0x4780fe(0x95)]('ranger\x20setup\x20--scope='+String(_0x33ad50['scope'])+'\x20is\x20no\x20longer\x20supported.\x20'+'Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.')),process['exit'](0x1));_0x33ad50={..._0x33ad50,'scope':_0x4369e6[_0x4780fe(0x91)]};const _0x205a4f=!_0x4369e6['OpBhg'](existsSync,_0x4369e6['aLYOH'](getRangerHomeDir));await _0x4369e6[_0x4780fe(0x83)](ensureRangerDir,_0x4369e6[_0x4780fe(0x91)]);if(_0x33ad50?.['skipAuth'])console[_0x4780fe(0xc1)](_0x4369e6['UCMrR']),_0x4d3b91?.['trackPhaseEnd'](_0x4369e6[_0x4780fe(0xe3)],{'isFirstRun':_0x205a4f,'method':'skipped'});else{_0x4d3b91?.['trackPhaseStart'](_0x4369e6[_0x4780fe(0xe3)]);const _0xcf335=await authenticate(_0x5f0daa);_0x4d3b91?.['trackPhaseEnd'](_0x4780fe(0xc0),{'isFirstRun':_0x205a4f,'method':_0xcf335[_0x4780fe(0xd9)]});}_0x4d3b91?.[_0x4780fe(0xde)]('chromium');_0x33ad50?.['skipChromium']?console[_0x4780fe(0xc1)](_0x4780fe(0x9b)):await _0x4369e6['tvFqD'](ensureChromium,_0x33ad50?.['withDeps']);_0x4d3b91?.['trackPhaseEnd'](_0x4369e6['mPRlr'],{'isFirstRun':_0x205a4f,'skipped':!!_0x33ad50?.[_0x4780fe(0xdd)]}),console[_0x4780fe(0xc1)](_0x4369e6['MePKD']);const _0x55fbb5=_0x33ad50?.['scope'],_0x453cc6=_0x33ad50?.['opencode']??![];let _0x2c32a8=null;_0x453cc6?(_0x4d3b91?.[_0x4780fe(0xde)]('plugin'),_0x2c32a8=await ensureOpencodePluginConfig(_0x55fbb5),_0x4d3b91?.['trackPhaseEnd'](_0x4780fe(0xc7),{'isFirstRun':_0x205a4f,'opencode':!![]})):(_0x4d3b91?.[_0x4780fe(0xde)](_0x4780fe(0xc7)),await ensureClaudePlugin(_0x55fbb5),_0x4d3b91?.['trackPhaseEnd'](_0x4369e6['EriUO'],{'isFirstRun':_0x205a4f}));if(_0x4369e6[_0x4780fe(0xe2)](_0x453cc6,_0x2c32a8)){_0x4d3b91?.['trackPhaseStart'](_0x4780fe(0xd1));try{await _0x4369e6[_0x4780fe(0xa6)](installSkill,_0x4780fe(0xa3),{'level':_0x2c32a8['scope'],'cliVersion':getCurrentVersion(),'platform':_0x4780fe(0xd5)}),_0x4d3b91?.['trackPhaseEnd']('skills',{'isFirstRun':_0x205a4f,'opencode':!![]});}catch(_0x1c79ac){console['warn'](_0x4780fe(0xcb),_0x1c79ac instanceof Error?_0x1c79ac[_0x4780fe(0x7e)]:_0x1c79ac),_0x4d3b91?.[_0x4780fe(0x98)](_0x4780fe(0xd1),{'isFirstRun':_0x205a4f,'opencode':!![],'failed':!![]});}}else _0x4d3b91?.['trackPhaseStart']('skills'),await ensureClaudeSkills(_0x55fbb5),_0x4d3b91?.[_0x4780fe(0x98)](_0x4780fe(0xd1),{'isFirstRun':_0x205a4f});if(_0x33ad50?.[_0x4780fe(0x79)])console[_0x4780fe(0xc1)]('\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a');else{if(_0x33ad50?.[_0x4780fe(0x97)]){_0x4d3b91?.[_0x4780fe(0xde)](_0x4780fe(0x84));const _0x432985=await ensureLocalEnv({'url':_0x33ad50[_0x4780fe(0x97)],'force':_0x33ad50?.['force'],'allowInsecureLocalhost':_0x33ad50?.['allowInsecureLocalhost'],'scope':'user'},_0x4d3b91);_0x4d3b91?.['trackPhaseEnd']('profile',{'isFirstRun':_0x205a4f,'profileReady':_0x432985[_0x4780fe(0x88)],'userSkipped':_0x432985['skipped']});}else console[_0x4780fe(0xc1)](_0x4369e6[_0x4780fe(0xab)](_0x4369e6[_0x4780fe(0x95)](_0x4369e6[_0x4780fe(0x95)](_0x4780fe(0x81),_0x4780fe(0xd3)+_0x4369e6['OpBhg'](bold,_0x4369e6[_0x4780fe(0xca)])),_0x4780fe(0xcf))+'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:',_0x4780fe(0x89)));}if(_0x453cc6)console['log'](_0x4780fe(0x92)),console[_0x4780fe(0xc1)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console['log']('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console['log'](_0x4369e6['YhnIR']);else{const _0x3fddb4=bold(_0x4780fe(0xc4));console['log'](_0x4369e6['XYdfb'](_0x4369e6['lzpyy']('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x3fddb4+'\x20and\x20prompt\x20the\x20coding',_0x4780fe(0xc8)),_0x4780fe(0xa4))+'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');}}
|
|
1
|
+
const _0xee8c52=_0xf4fc;(function(_0x1e53f1,_0xfae5c9){const _0x158de4=_0xf4fc,_0xc1b7b4=_0x1e53f1();while(!![]){try{const _0x210149=parseInt(_0x158de4(0x190))/0x1*(parseInt(_0x158de4(0x1a8))/0x2)+parseInt(_0x158de4(0x18a))/0x3+parseInt(_0x158de4(0x1a5))/0x4*(parseInt(_0x158de4(0x18b))/0x5)+parseInt(_0x158de4(0x1a3))/0x6*(-parseInt(_0x158de4(0x1d2))/0x7)+parseInt(_0x158de4(0x1cb))/0x8*(-parseInt(_0x158de4(0x1a4))/0x9)+-parseInt(_0x158de4(0x177))/0xa*(parseInt(_0x158de4(0x1c1))/0xb)+parseInt(_0x158de4(0x172))/0xc*(parseInt(_0x158de4(0x17c))/0xd);if(_0x210149===_0xfae5c9)break;else _0xc1b7b4['push'](_0xc1b7b4['shift']());}catch(_0x257a77){_0xc1b7b4['push'](_0xc1b7b4['shift']());}}}(_0x48f0,0x1f060));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x2e19bb 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';function _0xf4fc(_0x33f36b,_0x1eb169){_0x33f36b=_0x33f36b-0x16d;const _0x48f068=_0x48f0();let _0xf4fc29=_0x48f068[_0x33f36b];return _0xf4fc29;}import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x1a40ab=>_0xee8c52(0x1cc)+_0x1a40ab+_0xee8c52(0x1ab);export function getPlaywrightVersion(){const _0xf18707=_0xee8c52,_0x3cb6fb={'RIhkG':_0xf18707(0x1b6)};try{const _0x384107=require['resolve'](_0x3cb6fb['RIhkG']),_0x3295ab=require(_0x384107);return _0x3295ab['version'];}catch{return null;}}export function installChromiumBinary(_0x3ce5c2,_0x1052c4=![]){const _0x271b8f=_0xee8c52,_0x1e4124={'NkSKh':function(_0x1e9ad2,_0x224850){return _0x1e9ad2(_0x224850);},'ztTvD':_0x271b8f(0x1cf),'vqaKq':'inherit','NsCeb':function(_0x144ed4,_0x5c9c82){return _0x144ed4===_0x5c9c82;},'iaXrt':'win32','eHAob':'error'};return new Promise((_0x2ff793,_0x3024d5)=>{const _0x5d8745=_0x271b8f,_0x5974c1={'sUWSL':function(_0x4f613e,_0x558d5d){const _0x26f997=_0xf4fc;return _0x1e4124[_0x26f997(0x19f)](_0x4f613e,_0x558d5d);}},_0x5a61f6=['playwright@'+_0x3ce5c2,_0x1e4124['ztTvD'],..._0x1052c4?['--with-deps']:[],_0x5d8745(0x19e)],_0x449b8d=spawn('npx',_0x5a61f6,{'stdio':[_0x5d8745(0x18d),_0x1e4124[_0x5d8745(0x17d)],_0x1e4124['vqaKq']],'shell':_0x1e4124['NsCeb'](process[_0x5d8745(0x188)],_0x1e4124[_0x5d8745(0x186)])});_0x449b8d['on'](_0x5d8745(0x16e),_0x18e1f0=>{const _0x56b8b0=_0x5d8745;_0x18e1f0===0x0?_0x2ff793():_0x5974c1['sUWSL'](_0x3024d5,new Error(_0x56b8b0(0x1d5)+_0x18e1f0));}),_0x449b8d['on'](_0x1e4124['eHAob'],_0x15778f=>{const _0x1d086a=_0x5d8745;_0x5974c1[_0x1d086a(0x1ca)](_0x3024d5,_0x15778f);});});}function _0x48f0(){const _0x230eeb=['The\x20required\x20version\x20(',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','147530tuBdos','SVFlY','method','hDpMH','isTTY','13QMWkOa','vqaKq','provided_token','uzobH','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','xbVvS','scope','skipChromium','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','idXbj','iaXrt','.gitignore','platform','\x20and\x20prompt\x20the\x20coding','145461JoqvJg','5tsbsGo','mhAyl','ignore','trackPhaseEnd','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','17GoGNsU','organizationName','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','You\x20can\x20install\x20it\x20manually\x20by\x20running:','skipped','npRpR','mmPbS','HhDLe','PrjvC','jAckI','✓\x20~/.ranger/\x20directory\x20already\x20exists','rPwZy','url','BPTUn','chromium','NkSKh','env','rNOza','✓\x20Already\x20authenticated\x20to\x20','1506Hbnzin','1053WpmEtW','955372uGJrye','allowInsecureLocalhost','ranger\x20setup\x20--scope=','4298uYiaXf','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','\x0a⚠\x20Skipping\x20Chromium\x20installation.','\x1b[0m','trackPhaseStart','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','warn','auth','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','success','HccNR','UFyAx','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','playwright/package.json','ApXMo','✓\x20Playwright\x20Chromium\x20browser\x20found','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','ELcig','local','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','toaCR','KSixZ','opencode','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','11XNJOcu','dsYvY','\x20install\x20chromium','JjIMe','plugin','\x0aInstalling\x20Chromium\x20browser...\x0a','GITHUB_ENV','czXRM','ranger','sUWSL','16224hvNBnk','\x1b[1m','MTdlf','skills','install','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','\x20(fallback\x20version)','6559qLityt','NRQay','\x0a🚀\x20Ranger\x20Setup\x0a','Installation\x20failed\x20with\x20exit\x20code\x20','user','\x0a\x20\x20','log','message','close','error','Authentication\x20failed:\x20','skipAuth','3485100JlKAdl','wcHJD','aKSSg'];_0x48f0=function(){return _0x230eeb;};return _0x48f0();}export async function authenticate(_0x44d195){const _0x51b443=_0xee8c52,_0x493966={'aKSSg':function(_0x4c2eac,_0x3c120a){return _0x4c2eac(_0x3c120a);},'lBbwu':'existing_token','tXEgX':function(_0x5b4920,_0x15f677){return _0x5b4920 instanceof _0x15f677;},'jAckI':'Validating\x20API\x20token...','SwTEb':function(_0x257eff,_0x587f2b){return _0x257eff(_0x587f2b);},'mgdHz':'✓\x20Exported\x20credentials\x20for\x20CI','JjIMe':'✓\x20Stored\x20credentials\x20locally','mhAyl':_0x51b443(0x17e)};if(!_0x44d195){const _0x4b1806=await getToken();if(_0x4b1806){const _0x556094=await _0x493966[_0x51b443(0x174)](getCurrentUser,_0x4b1806);if(_0x556094[_0x51b443(0x1b2)])return console[_0x51b443(0x1d8)](_0x51b443(0x1a2)+_0x556094['user'][_0x51b443(0x191)]),{'token':_0x4b1806,'method':_0x493966['lBbwu']};}try{_0x44d195=await runDeviceAuthFlow();}catch(_0x4265e7){throw new Error('Authentication\x20failed:\x20'+(_0x493966['tXEgX'](_0x4265e7,Error)?_0x4265e7['message']:_0x4265e7));}const _0x368e75=await _0x493966[_0x51b443(0x174)](getCurrentUser,_0x44d195);if(!_0x368e75[_0x51b443(0x1b2)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x368e75['error']);return console[_0x51b443(0x1d8)]('✓\x20Authenticated\x20to\x20'+_0x368e75['user'][_0x51b443(0x191)]),{'token':_0x44d195,'method':'device_auth'};}console['log'](_0x493966[_0x51b443(0x199)]);const _0x3a5175=await getCurrentUser(_0x44d195);if(!_0x3a5175[_0x51b443(0x1b2)]){if(_0x3a5175['status'])throw new Error(_0x51b443(0x170)+_0x3a5175[_0x51b443(0x16f)]+_0x51b443(0x1d0));else throw new Error(_0x51b443(0x1b5)+_0x3a5175[_0x51b443(0x16f)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log']('✓\x20Authenticated\x20to\x20'+_0x3a5175['user']['organizationName']),await _0x493966['SwTEb'](storeToken,_0x44d195),console['log'](process[_0x51b443(0x1a0)][_0x51b443(0x1c7)]?_0x493966['mgdHz']:_0x493966[_0x51b443(0x1c4)]),{'token':_0x44d195,'method':_0x493966[_0x51b443(0x18c)]};}export async function ensureRangerDir(_0x78f016){const _0x26268c=_0xee8c52,_0x4d1ea0={'xbVvS':function(_0x49a8f0){return _0x49a8f0();},'AKcPe':'✓\x20Created\x20~/.ranger/\x20directory','paaYS':_0x26268c(0x19a)};void _0x78f016;const _0x1a7b89=_0x4d1ea0[_0x26268c(0x181)](getRangerHomeDir);return!existsSync(_0x1a7b89)?(await mkdir(_0x1a7b89,{'recursive':!![]}),console[_0x26268c(0x1d8)](_0x4d1ea0['AKcPe']),{'path':_0x1a7b89,'installed':!![]}):(console['log'](_0x4d1ea0['paaYS']),{'path':_0x1a7b89,'installed':![]});}export async function ensureChromium(_0x21ef8d=![]){const _0x25ea04=_0xee8c52,_0x349f0e={'UFyAx':function(_0x5ecc7a,_0x5919b7){return _0x5ecc7a(_0x5919b7);},'toaCR':_0x25ea04(0x1b8),'hHiaS':function(_0x263fe8){return _0x263fe8();},'tEWUg':function(_0x15cf67,_0x60e88b){return _0x15cf67??_0x60e88b;},'ApXMo':'confirm','MTdlf':_0x25ea04(0x1d1),'HccNR':function(_0x5f5b88,_0x1f857b,_0x5ec3ed){return _0x5f5b88(_0x1f857b,_0x5ec3ed);},'gGDRJ':_0x25ea04(0x1ad),'npRpR':function(_0x7c0137,_0x2228c3){return _0x7c0137 instanceof _0x2228c3;}};let _0x373266=![];try{const _0x5aa224=chromium['executablePath']();_0x373266=_0x349f0e[_0x25ea04(0x1b4)](existsSync,_0x5aa224);}catch{_0x373266=![];}if(_0x373266)return console[_0x25ea04(0x1d8)](_0x349f0e[_0x25ea04(0x1bd)]),![];const _0x9d1339=_0x349f0e['hHiaS'](getPlaywrightVersion),_0xff42bb=_0x349f0e['tEWUg'](_0x9d1339,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x18e53c=!_0x9d1339,_0x33c907=process['stdin'][_0x25ea04(0x17b)]&&process['stdout'][_0x25ea04(0x17b)];let _0x124f29=!![];if(_0x33c907){const {install:_0x3cdb64}=await _0x2e19bb['prompt']([{'type':_0x349f0e[_0x25ea04(0x1b7)],'name':'install','message':_0x18e53c?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0xff42bb+'\x20now?':_0x25ea04(0x175)+_0xff42bb+_0x25ea04(0x176),'default':!![]}]);_0x124f29=_0x3cdb64;}else console[_0x25ea04(0x1d8)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0xff42bb+(_0x18e53c?_0x349f0e[_0x25ea04(0x1cd)]:'')+'...');if(_0x124f29){console['log'](_0x25ea04(0x1c6));try{await _0x349f0e[_0x25ea04(0x1b3)](installChromiumBinary,_0xff42bb,_0x21ef8d),console['log']('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x2e963e){console[_0x25ea04(0x16f)](_0x349f0e['gGDRJ'],_0x349f0e[_0x25ea04(0x195)](_0x2e963e,Error)?_0x2e963e['message']:_0x2e963e),console[_0x25ea04(0x1d8)](_0x25ea04(0x193)),console[_0x25ea04(0x1d8)]('\x20\x20npx\x20playwright@'+_0xff42bb+'\x20install\x20chromium');}}else console[_0x25ea04(0x1d8)](_0x25ea04(0x1aa)),console[_0x25ea04(0x1d8)](_0x25ea04(0x180)),console['log']('\x20\x20npx\x20playwright@'+_0xff42bb+_0x25ea04(0x1c3));return!![];}export async function writeRangerGitignore(_0x19e8bb){const _0x45241e=_0xee8c52,_0x477de3={'rNOza':function(_0x6f51eb,_0xba8202,_0x58b26f){return _0x6f51eb(_0xba8202,_0x58b26f);},'HhDLe':'✓\x20Created\x20.ranger/.gitignore'},_0x437dc7=_0x477de3[_0x45241e(0x1a1)](join,_0x19e8bb,_0x45241e(0x187)),_0x38257e='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await writeFile(_0x437dc7,_0x38257e),console['log'](_0x477de3[_0x45241e(0x197)]);}export async function ensureLocalEnv(_0x5e512a,_0x298ef5){const _0x47e2d7=_0xee8c52,_0x54b666={'krnHc':function(_0x51add0,_0x4330d8){return _0x51add0!==_0x4330d8;},'LqyMH':'user','idXbj':function(_0x366701,_0x4323ce){return _0x366701===_0x4323ce;},'wcHJD':_0x47e2d7(0x1bb),'hDpMH':'✓\x20Local\x20profile\x20already\x20exists','JUURy':function(_0x58062e,_0x38e309,_0x2225e7,_0x5f36b5){return _0x58062e(_0x38e309,_0x2225e7,_0x5f36b5);},'BPTUn':'\x0a❌\x20Profile\x20setup\x20failed:','ygzXp':function(_0x584d7e,_0x529aac){return _0x584d7e instanceof _0x529aac;}};if(!findGitRoot()&&_0x54b666['krnHc'](_0x5e512a?.[_0x47e2d7(0x182)],_0x54b666['LqyMH']))return console['log']('⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.'),{'ready':![],'skipped':!![]};const _0x38ac72=_0x54b666[_0x47e2d7(0x185)](_0x5e512a?.[_0x47e2d7(0x182)],_0x47e2d7(0x1d6))?getRangerHomeDir():undefined;if(findExistingEnv(_0x47e2d7(0x1bb),{'locations':[_0x54b666['wcHJD']],'rangerDir':_0x38ac72}))return console['log'](_0x54b666[_0x47e2d7(0x17a)]),{'ready':!![],'skipped':![]};try{return await _0x54b666['JUURy'](addEnv,_0x54b666[_0x47e2d7(0x173)],{'url':_0x5e512a?.[_0x47e2d7(0x19c)],'force':_0x5e512a?.['force'],'allowInsecureLocalhost':_0x5e512a?.[_0x47e2d7(0x1a6)],'scope':_0x5e512a?.['scope']},_0x298ef5),{'ready':!![],'skipped':![]};}catch(_0x151512){return console['error'](_0x54b666[_0x47e2d7(0x19d)],_0x54b666['ygzXp'](_0x151512,Error)?_0x151512['message']:_0x151512),{'ready':![],'skipped':![]};}}export async function start(_0x9d93f2,_0x2a1c14,_0xa8fccf){const _0x5b6932=_0xee8c52,_0x441045={'NRQay':_0x5b6932(0x1d4),'iFCqH':'user','EIUJa':function(_0x152078,_0x4a7152){return _0x152078+_0x4a7152;},'uzobH':function(_0x45986d,_0x44af28){return _0x45986d(_0x44af28);},'ELcig':'✓\x20Skipping\x20authentication\x20(--skip-auth)','cDlCr':'auth','czXRM':'chromium','dsYvY':_0x5b6932(0x1c5),'rPwZy':function(_0x382b9d,_0x4897b6,_0x51cab7){return _0x382b9d(_0x4897b6,_0x51cab7);},'ZxesS':_0x5b6932(0x1a9),'SVFlY':function(_0x595e19,_0x550636){return _0x595e19 instanceof _0x550636;},'NzsYs':_0x5b6932(0x1ce),'KSixZ':_0x5b6932(0x1b0),'rclyc':'profile','mmPbS':function(_0x1cc154,_0x1cb720,_0x4713a5){return _0x1cc154(_0x1cb720,_0x4713a5);},'WeZzV':function(_0x42947e,_0x1013ad){return _0x42947e+_0x1013ad;},'VakFd':'ranger\x20profile\x20add\x20<name>','SIeyQ':'verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','PrjvC':function(_0x4ad29f,_0x496161){return _0x4ad29f+_0x496161;}};console['log'](_0x441045[_0x5b6932(0x1d3)]);_0x2a1c14?.[_0x5b6932(0x182)]!==undefined&&_0x2a1c14[_0x5b6932(0x182)]!==_0x441045['iFCqH']&&(console[_0x5b6932(0x16f)](_0x441045['EIUJa'](_0x5b6932(0x1a7)+String(_0x2a1c14['scope'])+'\x20is\x20no\x20longer\x20supported.\x20','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20')+_0x5b6932(0x1c0)),process['exit'](0x1));_0x2a1c14={..._0x2a1c14,'scope':'user'};const _0x242043=!_0x441045[_0x5b6932(0x17f)](existsSync,getRangerHomeDir());await ensureRangerDir(_0x441045['iFCqH']);if(_0x2a1c14?.[_0x5b6932(0x171)])console['log'](_0x441045[_0x5b6932(0x1ba)]),_0xa8fccf?.['trackPhaseEnd'](_0x441045['cDlCr'],{'isFirstRun':_0x242043,'method':'skipped'});else{_0xa8fccf?.['trackPhaseStart']('auth');const _0x211ccb=await _0x441045['uzobH'](authenticate,_0x9d93f2);_0xa8fccf?.['trackPhaseEnd'](_0x5b6932(0x1af),{'isFirstRun':_0x242043,'method':_0x211ccb[_0x5b6932(0x179)]});}_0xa8fccf?.['trackPhaseStart'](_0x441045[_0x5b6932(0x1c8)]);_0x2a1c14?.[_0x5b6932(0x183)]?console['log'](_0x5b6932(0x1b9)):await _0x441045[_0x5b6932(0x17f)](ensureChromium,_0x2a1c14?.['withDeps']);_0xa8fccf?.['trackPhaseEnd'](_0x5b6932(0x19e),{'isFirstRun':_0x242043,'skipped':!!_0x2a1c14?.['skipChromium']}),console['log'](_0x5b6932(0x18f));const _0x10c0ea=_0x2a1c14?.['scope'],_0x11a10d=_0x2a1c14?.[_0x5b6932(0x1bf)]??![];let _0x3c408d=null;_0x11a10d?(_0xa8fccf?.['trackPhaseStart']('plugin'),_0x3c408d=await ensureOpencodePluginConfig(_0x10c0ea),_0xa8fccf?.[_0x5b6932(0x18e)](_0x441045[_0x5b6932(0x1c2)],{'isFirstRun':_0x242043,'opencode':!![]})):(_0xa8fccf?.[_0x5b6932(0x1ac)](_0x5b6932(0x1c5)),await ensureClaudePlugin(_0x10c0ea),_0xa8fccf?.[_0x5b6932(0x18e)](_0x441045[_0x5b6932(0x1c2)],{'isFirstRun':_0x242043}));if(_0x11a10d&&_0x3c408d){_0xa8fccf?.[_0x5b6932(0x1ac)](_0x5b6932(0x1ce));try{await _0x441045[_0x5b6932(0x19b)](installSkill,_0x5b6932(0x1c9),{'level':_0x3c408d['scope'],'cliVersion':getCurrentVersion(),'platform':_0x5b6932(0x1bf)}),_0xa8fccf?.[_0x5b6932(0x18e)]('skills',{'isFirstRun':_0x242043,'opencode':!![]});}catch(_0x4e5ec7){console[_0x5b6932(0x1ae)](_0x441045['ZxesS'],_0x441045[_0x5b6932(0x178)](_0x4e5ec7,Error)?_0x4e5ec7[_0x5b6932(0x16d)]:_0x4e5ec7),_0xa8fccf?.['trackPhaseEnd']('skills',{'isFirstRun':_0x242043,'opencode':!![],'failed':!![]});}}else _0xa8fccf?.[_0x5b6932(0x1ac)](_0x441045['NzsYs']),await ensureClaudeSkills(_0x10c0ea),_0xa8fccf?.[_0x5b6932(0x18e)](_0x5b6932(0x1ce),{'isFirstRun':_0x242043});if(_0x2a1c14?.['skipAuth'])console['log'](_0x441045[_0x5b6932(0x1be)]);else{if(_0x2a1c14?.[_0x5b6932(0x19c)]){_0xa8fccf?.[_0x5b6932(0x1ac)](_0x441045['rclyc']);const _0x390759=await _0x441045[_0x5b6932(0x196)](ensureLocalEnv,{'url':_0x2a1c14['url'],'force':_0x2a1c14?.['force'],'allowInsecureLocalhost':_0x2a1c14?.[_0x5b6932(0x1a6)],'scope':_0x441045['iFCqH']},_0xa8fccf);_0xa8fccf?.['trackPhaseEnd']('profile',{'isFirstRun':_0x242043,'profileReady':_0x390759['ready'],'userSkipped':_0x390759[_0x5b6932(0x194)]});}else console[_0x5b6932(0x1d8)](_0x441045['WeZzV'](_0x5b6932(0x1bc),_0x5b6932(0x1d7)+bold(_0x441045['VakFd']))+'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)'+'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:'+'\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles');}if(_0x11a10d)console[_0x5b6932(0x1d8)](_0x5b6932(0x184)),console['log']('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console[_0x5b6932(0x1d8)](_0x5b6932(0x1b1)),console[_0x5b6932(0x1d8)](_0x441045['SIeyQ']);else{const _0x16bb38=bold('/ranger:enable');console['log'](_0x441045[_0x5b6932(0x198)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x16bb38+_0x5b6932(0x189),'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with')+'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'+_0x5b6932(0x192));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x4cd6ed=_0x2d06;(function(_0x36cd33,_0x22f5b1){const _0x3cd277=_0x2d06,_0x104eab=_0x36cd33();while(!![]){try{const _0x55583f=-parseInt(_0x3cd277(0x9b))/0x1*(-parseInt(_0x3cd277(0xd5))/0x2)+-parseInt(_0x3cd277(0xb7))/0x3*(-parseInt(_0x3cd277(0xfc))/0x4)+-parseInt(_0x3cd277(0x8e))/0x5*(parseInt(_0x3cd277(0xdd))/0x6)+parseInt(_0x3cd277(0x97))/0x7*(parseInt(_0x3cd277(0xe7))/0x8)+-parseInt(_0x3cd277(0x9f))/0x9*(-parseInt(_0x3cd277(0xd4))/0xa)+-parseInt(_0x3cd277(0x90))/0xb*(parseInt(_0x3cd277(0xac))/0xc)+-parseInt(_0x3cd277(0xca))/0xd;if(_0x55583f===_0x22f5b1)break;else _0x104eab['push'](_0x104eab['shift']());}catch(_0x37dbfc){_0x104eab['push'](_0x104eab['shift']());}}}(_0x4875,0xedd3e));import{readFile,readdir}from'fs/promises';function _0x4875(){const _0x335b14=['\x20\x20\x20\x20Settings:\x20','HVcvO','NHAju','6HJZiWQ','opencode-plugin','\x20\x20Run:\x20ranger\x20update','\x20\x20Run:\x20ranger\x20setup\x20[token]','lZmqd','parse','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','settings.json','not_configured','includes','8cXOgHk','iHKHV','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','No\x20profiles\x20configured','API\x20URL:\x20','filter','pqhDY','mNZLD','hasEncryptedAuth','version','none','tKDte','has','\x20\x20\x20\x20Auth:\x20','ranger@trailhead','success','configured','zgPfA','\x20\x20\x20\x20','Version:\x20','HEDBq','20DHbfHX','qYDMw','GHEoY','TvbZm','plugin','9384405xcYJUa','No\x20skills\x20installed','16862857jDyiAv','oPeKP','SwVsN','OyXey','fLFXH','(not\x20found)','unknown','4540214kFVnjl','name','\x20\x20Not\x20configured','API\x20Environment:\x20','661eqeykr','gAPKU','\x0a📊\x20Ranger\x20Status\x0a','\x20\x20Run:\x20ranger\x20skillup','27HzSlMg','utf-8','edLKu','@ranger-testing/opencode-plugin','isArray','opencode','some','match','\x20\x20\x20\x20Session:\x20','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','scqUu','\x0a---\x20Profiles\x20---','UxHfT','12xRNQob','rMUOm','\x20\x20User-level:','UKVgf','\x20(up\x20to\x20date)','bbkrl','\x20\x20Not\x20installed','details','log','\x1b[1m','assNL','408297umqiSd','disabled','sessionUpdatedAt','QRMBg','pipe','RnnjD','debug','map','cached\x20(updated\x20','enabled','NFBnS','\x0a---\x20Claude\x20Code\x20Plugin\x20---','not_installed','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','organizationName','CnctV','path','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','Organization:\x20','1310673SDDWcH','FENwi','join','user','plaintext','Root:\x20','CENMB','length','GSoYJ','data','4065550GPRjrQ','5858FMypee','isDirectory','\x20[local]','lejAw','\x20(active)'];_0x4875=function(){return _0x335b14;};return _0x4875();}import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';function _0x2d06(_0x5de0f8,_0x4370ee){_0x5de0f8=_0x5de0f8-0x8e;const _0x4875e5=_0x4875();let _0x2d0627=_0x4875e5[_0x5de0f8];return _0x2d0627;}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=_0x33541b=>_0x4cd6ed(0xb5)+_0x33541b+'\x1b[0m',link=(_0x86b2b8,_0x1cb39c)=>'\x1b]8;;file://'+_0x86b2b8+'\x07'+(_0x1cb39c||_0x86b2b8)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x3eabbe=_0x4cd6ed,_0x519f02={'TvbZm':'string','assNL':_0x3eabbe(0xde),'zgPfA':function(_0x131659,_0x298da0){return _0x131659!==_0x298da0;},'lejAw':function(_0x575bee,_0xfd45af){return _0x575bee(_0xfd45af);},'pqhDY':_0x3eabbe(0xf7),'oFiii':function(_0x13fe89,_0x18d263){return _0x13fe89>_0x18d263;},'mNZLD':function(_0x3e74fe,_0x3dd52d){return _0x3e74fe(_0x3dd52d);},'lVXRr':function(_0xa93c00,_0x5b6fb0){return _0xa93c00(_0x5b6fb0);},'FENwi':_0x3eabbe(0xe5),'iHKHV':function(_0x44e0f8,_0x1e2c57){return _0x44e0f8(_0x1e2c57);},'rMUOm':_0x3eabbe(0xa4),'oPeKP':_0x3eabbe(0xbd),'HEDBq':'config','OyXey':'ignore','shCNM':'pipe','NFBnS':_0x3eabbe(0xd3)};return new Promise(_0x54c2f4=>{const _0x5abcda=_0x3eabbe,_0x3d5907={'tKDte':function(_0xd993c,_0x41a543){const _0x5bb3af=_0x2d06;return _0x519f02[_0x5bb3af(0xe8)](_0xd993c,_0x41a543);}},_0x5ab02d=spawn(_0x519f02[_0x5abcda(0xad)],[_0x519f02[_0x5abcda(0x91)],_0x519f02[_0x5abcda(0xfb)]],{'stdio':[_0x519f02[_0x5abcda(0x93)],_0x519f02['shCNM'],_0x5abcda(0xbb)]});let _0x2017ae='';_0x5ab02d['stdout']?.['on'](_0x519f02[_0x5abcda(0xc1)],_0x45aaa1=>{_0x2017ae+=_0x45aaa1['toString']();}),_0x5ab02d['stderr']?.['on']('data',_0xedb072=>{_0x2017ae+=_0xedb072['toString']();}),_0x5ab02d['on']('error',()=>{const _0x51a533=_0x5abcda;_0x3d5907[_0x51a533(0xf2)](_0x54c2f4,{'status':_0x51a533(0xc3)});}),_0x5ab02d['on']('close',_0x18ae9e=>{const _0x1ae982=_0x5abcda,_0x859e4e={'GHEoY':_0x519f02[_0x1ae982(0xff)],'bbkrl':_0x519f02[_0x1ae982(0xb6)]};if(_0x519f02[_0x1ae982(0xf8)](_0x18ae9e,0x0)){_0x519f02['lejAw'](_0x54c2f4,{'status':_0x1ae982(0xc3)});return;}const _0x120e06=_0x2017ae['trim']();let _0x22e0c8=null;if(_0x120e06)try{_0x22e0c8=JSON['parse'](_0x120e06);}catch{const _0x359170=_0x120e06['match'](/\{[\s\S]*\}$/);if(_0x359170)try{_0x22e0c8=JSON[_0x1ae982(0xe2)](_0x359170[0x0]);}catch{_0x22e0c8=null;}}const _0x345a03=Array[_0x1ae982(0xa3)](_0x22e0c8?.[_0x1ae982(0x100)])?_0x22e0c8?.['plugin']:[],_0x314989=_0x345a03[_0x1ae982(0xa5)](_0x293653=>{const _0x3fa740=_0x1ae982;if(typeof _0x293653!==_0x859e4e[_0x3fa740(0xfe)])return![];return _0x293653['includes'](_0x3fa740(0xa2))||_0x293653['includes'](_0x859e4e[_0x3fa740(0xb1)]);});if(_0x314989){_0x519f02[_0x1ae982(0xd8)](_0x54c2f4,{'status':_0x519f02[_0x1ae982(0xed)],'details':_0x519f02['oFiii'](_0x345a03[_0x1ae982(0xd1)],0x0)?_0x345a03[_0x1ae982(0xd1)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x345a03['length']>0x0){_0x519f02[_0x1ae982(0xee)](_0x54c2f4,{'status':_0x1ae982(0xe5),'details':_0x345a03['length']+'\x20plugin(s)\x20configured'});return;}_0x519f02['lVXRr'](_0x54c2f4,{'status':_0x519f02[_0x1ae982(0xcb)]});});});}async function getSkillsFromDir(_0xa28512,_0x172ac4){const _0x2dae58=_0x4cd6ed,_0x3ec649={'eLPnU':function(_0x1627a4,_0x5cec9d){return _0x1627a4(_0x5cec9d);},'UxHfT':function(_0x47fed7,_0x343b4f,_0x4695e8,_0x2c1550){return _0x47fed7(_0x343b4f,_0x4695e8,_0x2c1550);}};if(!_0x3ec649['eLPnU'](existsSync,_0xa28512))return[];const _0x4173cb=[];try{const _0x198634=await readdir(_0xa28512,{'withFileTypes':!![]});for(const _0x2c16f2 of _0x198634){if(_0x2c16f2[_0x2dae58(0xd6)]()){const _0x31d2e4=_0x3ec649[_0x2dae58(0xab)](join,_0xa28512,_0x2c16f2[_0x2dae58(0x98)],'SKILL.md');if(existsSync(_0x31d2e4)){let _0x575842=_0x2c16f2['name'];try{const _0x37fee7=await readFile(_0x31d2e4,_0x2dae58(0xa0)),_0x3355a1=_0x37fee7[_0x2dae58(0xa6)](/name:\s*(.+)/);_0x3355a1&&(_0x575842=_0x3355a1[0x1]['trim']());}catch{}_0x4173cb['push']({'name':_0x2c16f2['name'],'displayName':_0x575842,'path':_0x31d2e4,'level':_0x172ac4});}}}}catch{return[];}return _0x4173cb;}async function getInstalledSkills(){const _0x10ab62=_0x4cd6ed,_0x41f3ac={'DQMNq':function(_0x29ac83,_0x3b8242,_0x4623c3){return _0x29ac83(_0x3b8242,_0x4623c3);},'wEGwL':function(_0xfcb0b7){return _0xfcb0b7();},'lZmqd':'project'},[_0x2ce421,_0x20f9cb]=await Promise['all']([_0x41f3ac['DQMNq'](getSkillsFromDir,_0x41f3ac['wEGwL'](getProjectSkillsDir),_0x41f3ac[_0x10ab62(0xe1)]),_0x41f3ac['DQMNq'](getSkillsFromDir,getUserSkillsDir(),'user')]);return{'project':_0x2ce421,'user':_0x20f9cb};}async function getEnvironments(){const _0x5007c7=_0x4cd6ed,_0x4e9f62={'DukXB':_0x5007c7(0xe4),'RnnjD':function(_0xd2ae0c,_0x451241,_0x967b53){return _0xd2ae0c(_0x451241,_0x967b53);},'SwVsN':'auth.json.enc','PUfEO':function(_0x4e19d4,_0x56a3c8){return _0x4e19d4(_0x56a3c8);},'PdWho':'(not\x20found)','mShCV':function(_0x5cd63b,_0x4f7d22){return _0x5cd63b===_0x4f7d22;}},{envNames:_0x1e27fe,activeEnv:_0x572782}=await getEnvNames(),_0x321fed=getRangerDir();if(!existsSync(_0x321fed))return{'envs':[],'activeEnv':null};const _0xdc3c86=_0x1e27fe['map'](_0x492d74=>{const _0x8a6711=_0x5007c7,_0x3f6643=getEnvDir(_0x492d74),_0x5cc161=join(_0x3f6643,_0x4e9f62['DukXB']),_0x38f38a=_0x4e9f62[_0x8a6711(0xbc)](join,_0x3f6643,'auth.json'),_0x32862d=_0x4e9f62['RnnjD'](join,_0x3f6643,_0x4e9f62[_0x8a6711(0x92)]);return{'name':_0x492d74,'settingsPath':_0x4e9f62['PUfEO'](existsSync,_0x5cc161)?_0x5cc161:_0x4e9f62['PdWho'],'hasPlaintextAuth':existsSync(_0x38f38a),'hasEncryptedAuth':existsSync(_0x32862d),'isActive':_0x4e9f62['mShCV'](_0x492d74,_0x572782)};});return{'envs':_0xdc3c86,'activeEnv':_0x572782};}export async function status(){const _0x10a7d2=_0x4cd6ed,_0x94b7da={'QRMBg':_0x10a7d2(0x9d),'fLFXH':function(_0x36ded6,_0x4ebe38,_0x25bd87){return _0x36ded6(_0x4ebe38,_0x25bd87);},'CENMB':function(_0x30cde2,_0x451cac){return _0x30cde2(_0x451cac);},'mPMRr':function(_0x1475d7){return _0x1475d7();},'UKVgf':'\x0a---\x20OpenCode\x20Plugin\x20---','CnctV':function(_0x1cecea){return _0x1cecea();},'PJsNp':function(_0xd8b28c,_0x2daf2f){return _0xd8b28c===_0x2daf2f;},'gAPKU':'configured','HVcvO':'not_configured','vRsmt':_0x10a7d2(0x96),'DJMjP':_0x10a7d2(0xb8),'edLKu':function(_0x553eb7,_0x4b47c9){return _0x553eb7+_0x4b47c9;},'scqUu':function(_0xaf40a1,_0x165d4f){return _0xaf40a1(_0x165d4f);},'dAFwb':_0x10a7d2(0xae),'XzbQJ':function(_0x3f2da4,_0x3be574){return _0x3f2da4>_0x3be574;},'jAVdI':function(_0x23df02,_0x405c40){return _0x23df02(_0x405c40);},'OvQtd':function(_0x1993be,_0x442585){return _0x1993be===_0x442585;},'GSoYJ':_0x10a7d2(0xd9),'qYDMw':function(_0x1d03d3,_0xb9addd){return _0x1d03d3(_0xb9addd);},'NHAju':_0x10a7d2(0x95),'CQHwC':function(_0x2c89c7,_0x39525e){return _0x2c89c7(_0x39525e);}};console[_0x10a7d2(0xb4)](_0x94b7da[_0x10a7d2(0xba)]);const _0xdb0a34=process['cwd'](),_0x215ed4=getRangerDir();if(!existsSync(_0x215ed4)){console['log'](_0x10a7d2(0xcf)+_0x94b7da[_0x10a7d2(0x94)](link,_0xdb0a34,bold(basename(_0xdb0a34)))),console['log'](_0x10a7d2(0xa8)),console['log'](_0x10a7d2(0xc4));return;}console['log']('Root:\x20'+link(_0xdb0a34,bold(_0x94b7da[_0x10a7d2(0xd0)](basename,_0xdb0a34))));const _0x19ebf7=getCurrentVersion(),_0x255db6=_0x94b7da['mPMRr'](getLatestVersion);if(_0x255db6['version']&&_0x255db6['version']!==_0x19ebf7)console[_0x10a7d2(0xb4)]('Version:\x20'+_0x19ebf7+'\x20(latest:\x20'+_0x255db6[_0x10a7d2(0xf0)]+')'),console['log'](_0x10a7d2(0xdf));else _0x255db6[_0x10a7d2(0xf0)]?console[_0x10a7d2(0xb4)](_0x10a7d2(0xfa)+_0x19ebf7+_0x10a7d2(0xb0)):console[_0x10a7d2(0xb4)](_0x10a7d2(0xfa)+_0x19ebf7);const _0x1cb8df=await getToken();if(_0x1cb8df){const _0xd9e15=await getCurrentUser(_0x1cb8df);_0xd9e15[_0x10a7d2(0xf6)]?console['log'](_0x10a7d2(0xc9)+bold(_0xd9e15[_0x10a7d2(0xcd)][_0x10a7d2(0xc5)])):(console['log'](_0x10a7d2(0xe9)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console['log']('API\x20Token:\x20✗\x20Not\x20found'),console['log'](_0x10a7d2(0xe0));process['env']['DEBUG']&&(console[_0x10a7d2(0xb4)](_0x10a7d2(0x9a)+getCurrentEnvironment()),console[_0x10a7d2(0xb4)](_0x10a7d2(0xeb)+_0x94b7da['mPMRr'](getApiBaseUrl)));console[_0x10a7d2(0xb4)](_0x94b7da[_0x10a7d2(0xaf)]);const _0x4990a7=await _0x94b7da[_0x10a7d2(0xc6)](getOpencodePluginStatus);if(_0x94b7da['PJsNp'](_0x4990a7['status'],_0x94b7da[_0x10a7d2(0x9c)]))console[_0x10a7d2(0xb4)]('\x20\x20'+bold('@ranger-testing/opencode-plugin')+':\x20configured'),_0x4990a7['details']&&console['log']('\x20\x20'+_0x4990a7[_0x10a7d2(0xb3)]);else _0x4990a7['status']===_0x94b7da[_0x10a7d2(0xdb)]?(console[_0x10a7d2(0xb4)](_0x10a7d2(0x99)),_0x4990a7[_0x10a7d2(0xb3)]&&console['log']('\x20\x20'+_0x4990a7['details']),console['log']('\x20\x20Run:\x20ranger\x20setup\x20--opencode')):console['log']('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console[_0x10a7d2(0xb4)](_0x10a7d2(0xc2));const _0x449c70=await getPluginInfo(_0x10a7d2(0xf5));if(_0x449c70){const _0x4bc470=_0x449c70['scope']||_0x94b7da['vRsmt'],_0x4917ea=_0x449c70[_0x10a7d2(0xc0)]?'enabled':_0x94b7da['DJMjP'];console[_0x10a7d2(0xb4)]('\x20\x20'+bold('ranger@trailhead')+':\x20installed\x20('+_0x4bc470+',\x20'+_0x4917ea+')');}else console[_0x10a7d2(0xb4)](_0x10a7d2(0xb2)),console['log'](_0x10a7d2(0xc8));console['log']('\x0a---\x20Skills\x20---');const {project:_0x53fe90,user:_0x14d0a3}=await getInstalledSkills(),_0x323f33=_0x53fe90['filter'](_0x52a558=>RANGER_MANAGED_SKILLS[_0x10a7d2(0xe6)](_0x52a558[_0x10a7d2(0x98)])),_0x2b700b=_0x14d0a3[_0x10a7d2(0xec)](_0x130792=>RANGER_MANAGED_SKILLS[_0x10a7d2(0xe6)](_0x130792[_0x10a7d2(0x98)])),_0x359799=_0x94b7da[_0x10a7d2(0xa1)](_0x323f33[_0x10a7d2(0xd1)],_0x2b700b['length']);if(_0x94b7da['PJsNp'](_0x359799,0x0))console[_0x10a7d2(0xb4)](_0x10a7d2(0x8f)),console['log'](_0x10a7d2(0x9e));else{if(_0x323f33['length']>0x0){console['log']('\x20\x20Project-level:');for(const _0x55471c of _0x323f33){console[_0x10a7d2(0xb4)](_0x10a7d2(0xf9)+bold(_0x55471c['displayName'])+':\x20'+_0x94b7da['fLFXH'](link,_0x55471c['path'],_0x94b7da[_0x10a7d2(0xa9)](basename,_0x55471c[_0x10a7d2(0xc7)])));}}if(_0x2b700b[_0x10a7d2(0xd1)]>0x0){console[_0x10a7d2(0xb4)](_0x94b7da['dAFwb']);for(const _0x348b4e of _0x2b700b){console['log']('\x20\x20\x20\x20'+bold(_0x348b4e['displayName'])+':\x20'+_0x94b7da[_0x10a7d2(0x94)](link,_0x348b4e[_0x10a7d2(0xc7)],basename(_0x348b4e['path'])));}}}console['log'](_0x10a7d2(0xaa));const {envs:_0x44e013,activeEnv:_0x37b6cb}=await getEnvironments();let _0x576155=[];if(_0x1cb8df)try{_0x576155=await listCloudProfiles();}catch{}const _0x3556d4=_0x44e013[_0x10a7d2(0xd1)]+_0x576155[_0x10a7d2(0xd1)];if(_0x3556d4===0x0)console[_0x10a7d2(0xb4)](_0x10a7d2(0xea)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0x94b7da['XzbQJ'](_0x3556d4,0x5)){const _0x3102a9=[];_0x94b7da['XzbQJ'](_0x576155['length'],0x0)&&_0x3102a9['push'](_0x576155['length']+'\x20cloud'),_0x44e013[_0x10a7d2(0xd1)]>0x0&&_0x3102a9['push'](_0x44e013[_0x10a7d2(0xd1)]+'\x20local'),console[_0x10a7d2(0xb4)](_0x3556d4+'\x20profiles\x20configured\x20('+_0x3102a9['join'](',\x20')+')'),_0x37b6cb&&console[_0x10a7d2(0xb4)]('\x20\x20Active:\x20'+_0x94b7da['jAVdI'](bold,_0x37b6cb)),console[_0x10a7d2(0xb4)]('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x5da8f3 of _0x576155){const _0x4863bf=_0x94b7da['OvQtd'](_0x5da8f3['name'],_0x37b6cb)?_0x94b7da[_0x10a7d2(0xd2)]:'';console[_0x10a7d2(0xb4)]('\x20\x20'+_0x94b7da[_0x10a7d2(0xfd)](bold,_0x5da8f3[_0x10a7d2(0x98)])+'\x20[cloud]'+_0x4863bf);const _0x2f47bf=_0x5da8f3[_0x10a7d2(0xb9)]?_0x10a7d2(0xbf)+_0x5da8f3[_0x10a7d2(0xb9)]+')':'no\x20session';console[_0x10a7d2(0xb4)](_0x10a7d2(0xa7)+_0x2f47bf);}const _0x4aba90=new Set(_0x576155[_0x10a7d2(0xbe)](_0x4d249a=>_0x4d249a[_0x10a7d2(0x98)]));for(const _0x2bf4ac of _0x44e013){if(_0x4aba90[_0x10a7d2(0xf3)](_0x2bf4ac['name']))continue;const _0x177ab8=_0x2bf4ac['isActive']?_0x94b7da['GSoYJ']:'',_0x43e580=_0x2bf4ac[_0x10a7d2(0xef)]?'encrypted':_0x2bf4ac['hasPlaintextAuth']?_0x10a7d2(0xce):_0x10a7d2(0xf1);console['log']('\x20\x20'+bold(_0x2bf4ac[_0x10a7d2(0x98)])+_0x10a7d2(0xd7)+_0x177ab8),console[_0x10a7d2(0xb4)](_0x10a7d2(0xf4)+_0x43e580),_0x2bf4ac['settingsPath']!==_0x94b7da[_0x10a7d2(0xdc)]&&console['log'](_0x10a7d2(0xda)+link(_0x2bf4ac['settingsPath'],_0x94b7da['CQHwC'](basename,_0x2bf4ac['settingsPath'])));}if(!_0x37b6cb){console[_0x10a7d2(0xb4)]('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x44eada=[..._0x576155['map'](_0x21144b=>_0x21144b['name']),..._0x44e013[_0x10a7d2(0xec)](_0x1eed2e=>!_0x4aba90[_0x10a7d2(0xf3)](_0x1eed2e['name']))['map'](_0x2e0eb3=>_0x2e0eb3[_0x10a7d2(0x98)])];console[_0x10a7d2(0xb4)](_0x10a7d2(0xe3)+_0x44eada[_0x10a7d2(0xcc)](',\x20')+')');}}}console['log']('');}
|
|
1
|
+
const _0x43dea7=_0x22ad;function _0x49bc(){const _0x35694a=['Version:\x20','264BgIulh','\x20\x20Not\x20installed','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','iThld','\x20\x20Project-level:','\x0a---\x20OpenCode\x20Plugin\x20---','JshHv','stdout','has','pipe','opencode','4952670Mgmsjs','\x20\x20Run:\x20ranger\x20skillup','parse','\x20\x20\x20\x20','5787761vLfaFu','ignore','SkvCs','\x20cloud','GkmXf','eDaqH','env','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','286055GHDWcb','XAPQJ','LNViI','\x1b[0m','gDWZO','filter','1009260KNrxsr','push','VQpta','length','120196TvbwYz','aFEHd','LmREw','map','ODsZG','not_configured','name','\x20\x20Run:\x20ranger\x20setup\x20[token]','displayName','@ranger-testing/opencode-plugin','34247312GlEfkZ','isActive','\x0a---\x20Claude\x20Code\x20Plugin\x20---','status','auth.json','path','version','NMThR','\x20plugin(s)\x20configured','CswDT','unknown','data','opencode-plugin','user','dnmtm','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','NXwcX','Root:\x20','sessionUpdatedAt','\x20profiles\x20configured\x20(','tuLMd','\x20[cloud]','plugin','log','ranger@trailhead','sSyLW','match','\x1b]8;;\x07','no\x20session','settings.json','JKEkX','HHByG','\x1b]8;;file://','\x20\x20User-level:','VrTnC','rygAP','stderr','MySsD','8xjXniX','33exXUCs','uOwWi','DYhWc','\x20local','join','IfVKe','details','settingsPath','2uFNZEt','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','hasPlaintextAuth','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','No\x20profiles\x20configured','cwd','\x1b[1m','unBGz','Mndhw','122015UFvlMm','UEwGm','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','configured','disabled','Organization:\x20','all','SKILL.md'];_0x49bc=function(){return _0x35694a;};return _0x49bc();}(function(_0x8e4370,_0xe04fb0){const _0xee47f6=_0x22ad,_0x5ecd8a=_0x8e4370();while(!![]){try{const _0x88ad7c=parseInt(_0xee47f6(0x128))/0x1*(-parseInt(_0xee47f6(0x16b))/0x2)+-parseInt(_0xee47f6(0x163))/0x3*(-parseInt(_0xee47f6(0x132))/0x4)+-parseInt(_0xee47f6(0x174))/0x5*(parseInt(_0xee47f6(0x17d))/0x6)+-parseInt(_0xee47f6(0x120))/0x7+parseInt(_0xee47f6(0x162))/0x8*(-parseInt(_0xee47f6(0x12e))/0x9)+-parseInt(_0xee47f6(0x188))/0xa+parseInt(_0xee47f6(0x13c))/0xb;if(_0x88ad7c===_0xe04fb0)break;else _0x5ecd8a['push'](_0x5ecd8a['shift']());}catch(_0x214f47){_0x5ecd8a['push'](_0x5ecd8a['shift']());}}}(_0x49bc,0x9eaba));import{readFile,readdir}from'fs/promises';function _0x22ad(_0x343266,_0x2f5d27){_0x343266=_0x343266-0x11f;const _0x49bc52=_0x49bc();let _0x22adf2=_0x49bc52[_0x343266];return _0x22adf2;}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=_0x145265=>_0x43dea7(0x171)+_0x145265+_0x43dea7(0x12b),link=(_0x12b1b2,_0x5429ca)=>_0x43dea7(0x15c)+_0x12b1b2+'\x07'+(_0x5429ca||_0x12b1b2)+_0x43dea7(0x157);async function getOpencodePluginStatus(){const _0x2b2260=_0x43dea7,_0x5cf835={'eNynB':'not_installed','uOwWi':function(_0x3c028f,_0x54d45){return _0x3c028f(_0x54d45);},'NXwcX':'configured','vBcOP':function(_0x3f7254,_0x182046){return _0x3f7254>_0x182046;},'LmREw':_0x2b2260(0x137),'PBZfs':function(_0x1eba21,_0x295b4c){return _0x1eba21(_0x295b4c);},'cLlxo':_0x2b2260(0x13b),'wEiSt':function(_0x151b55,_0x306840,_0x2555ae,_0x2d9088){return _0x151b55(_0x306840,_0x2555ae,_0x2d9088);},'VQpta':_0x2b2260(0x187),'jjrhU':'debug','XAPQJ':_0x2b2260(0x121),'GkmXf':'pipe','CswDT':_0x2b2260(0x147),'mpVGk':'close'};return new Promise(_0xa2196e=>{const _0x5f9ccd=_0x2b2260,_0x3950bf={'unBGz':function(_0x951d49,_0x8abb54){return _0x5cf835['uOwWi'](_0x951d49,_0x8abb54);},'VsCvQ':function(_0x5333da,_0x1081e5){return _0x5333da!==_0x1081e5;},'KOKAu':_0x5cf835['cLlxo']},_0x3f8df1=_0x5cf835['wEiSt'](spawn,_0x5cf835[_0x5f9ccd(0x130)],[_0x5cf835['jjrhU'],'config'],{'stdio':[_0x5cf835[_0x5f9ccd(0x129)],_0x5f9ccd(0x186),_0x5cf835[_0x5f9ccd(0x124)]]});let _0x13a6f0='';_0x3f8df1[_0x5f9ccd(0x184)]?.['on'](_0x5cf835[_0x5f9ccd(0x145)],_0xb79c7a=>{_0x13a6f0+=_0xb79c7a['toString']();}),_0x3f8df1[_0x5f9ccd(0x160)]?.['on'](_0x5cf835['CswDT'],_0x4b65f0=>{_0x13a6f0+=_0x4b65f0['toString']();}),_0x3f8df1['on']('error',()=>{const _0x22d55e=_0x5f9ccd;_0x3950bf[_0x22d55e(0x172)](_0xa2196e,{'status':'not_installed'});}),_0x3f8df1['on'](_0x5cf835['mpVGk'],_0x1a78ea=>{const _0x166780=_0x5f9ccd;if(_0x1a78ea!==0x0){_0xa2196e({'status':_0x5cf835['eNynB']});return;}const _0x4585ce=_0x13a6f0['trim']();let _0x1489dc=null;if(_0x4585ce)try{_0x1489dc=JSON[_0x166780(0x18a)](_0x4585ce);}catch{const _0x1bbce5=_0x4585ce[_0x166780(0x156)](/\{[\s\S]*\}$/);if(_0x1bbce5)try{_0x1489dc=JSON[_0x166780(0x18a)](_0x1bbce5[0x0]);}catch{_0x1489dc=null;}}const _0x2aaa48=Array['isArray'](_0x1489dc?.[_0x166780(0x152)])?_0x1489dc?.['plugin']:[],_0x20be7a=_0x2aaa48['some'](_0x36bcdf=>{const _0x214464=_0x166780;if(_0x3950bf['VsCvQ'](typeof _0x36bcdf,'string'))return![];return _0x36bcdf['includes'](_0x3950bf['KOKAu'])||_0x36bcdf['includes'](_0x214464(0x148));});if(_0x20be7a){_0x5cf835['uOwWi'](_0xa2196e,{'status':_0x5cf835[_0x166780(0x14c)],'details':_0x5cf835['vBcOP'](_0x2aaa48[_0x166780(0x131)],0x0)?_0x2aaa48[_0x166780(0x131)]+_0x166780(0x144):undefined});return;}if(_0x5cf835['vBcOP'](_0x2aaa48['length'],0x0)){_0x5cf835[_0x166780(0x164)](_0xa2196e,{'status':_0x5cf835[_0x166780(0x134)],'details':_0x2aaa48['length']+'\x20plugin(s)\x20configured'});return;}_0x5cf835['PBZfs'](_0xa2196e,{'status':'not_configured'});});});}async function getSkillsFromDir(_0x3b9161,_0x1c49c6){const _0x23d35b=_0x43dea7,_0x515fb9={'LNViI':function(_0x48bcdd,_0x2eedac,_0x170bb5){return _0x48bcdd(_0x2eedac,_0x170bb5);},'jAyvs':function(_0x10c90d,_0x78ee70,_0x10a0de,_0x237b74){return _0x10c90d(_0x78ee70,_0x10a0de,_0x237b74);},'apVOi':'utf-8'};if(!existsSync(_0x3b9161))return[];const _0x598170=[];try{const _0x4b815c=await _0x515fb9[_0x23d35b(0x12a)](readdir,_0x3b9161,{'withFileTypes':!![]});for(const _0x557a46 of _0x4b815c){if(_0x557a46['isDirectory']()){const _0x2ae513=_0x515fb9['jAyvs'](join,_0x3b9161,_0x557a46['name'],_0x23d35b(0x17b));if(existsSync(_0x2ae513)){let _0x5ee67c=_0x557a46[_0x23d35b(0x138)];try{const _0x488019=await readFile(_0x2ae513,_0x515fb9['apVOi']),_0x6a6841=_0x488019[_0x23d35b(0x156)](/name:\s*(.+)/);_0x6a6841&&(_0x5ee67c=_0x6a6841[0x1]['trim']());}catch{}_0x598170['push']({'name':_0x557a46[_0x23d35b(0x138)],'displayName':_0x5ee67c,'path':_0x2ae513,'level':_0x1c49c6});}}}}catch{return[];}return _0x598170;}async function getInstalledSkills(){const _0x21bcc8=_0x43dea7,_0x3ee209={'eDaqH':function(_0x242f72,_0x27d0f3,_0x292f34){return _0x242f72(_0x27d0f3,_0x292f34);},'rygAP':function(_0x38a581){return _0x38a581();},'jimDb':_0x21bcc8(0x149)},[_0x6211fc,_0x5524fc]=await Promise[_0x21bcc8(0x17a)]([_0x3ee209[_0x21bcc8(0x125)](getSkillsFromDir,_0x3ee209[_0x21bcc8(0x15f)](getProjectSkillsDir),'project'),getSkillsFromDir(getUserSkillsDir(),_0x3ee209['jimDb'])]);return{'project':_0x6211fc,'user':_0x5524fc};}async function getEnvironments(){const _0x168320=_0x43dea7,_0x28dc1f={'SkvCs':function(_0x4c5921,_0x5c1ad8){return _0x4c5921(_0x5c1ad8);},'vnQmO':function(_0x13be2d,_0x3fa13e,_0x22bbdf){return _0x13be2d(_0x3fa13e,_0x22bbdf);},'kOoSw':function(_0x1103ae,_0x5766d4,_0x303fe1){return _0x1103ae(_0x5766d4,_0x303fe1);},'NMThR':'(not\x20found)','iOAvY':function(_0x34d86b,_0x5f035a){return _0x34d86b===_0x5f035a;},'dnmtm':function(_0x48a272){return _0x48a272();}},{envNames:_0x1652a0,activeEnv:_0x498d77}=await getEnvNames(),_0x13b564=_0x28dc1f[_0x168320(0x14a)](getRangerDir);if(!_0x28dc1f[_0x168320(0x122)](existsSync,_0x13b564))return{'envs':[],'activeEnv':null};const _0x5d073d=_0x1652a0[_0x168320(0x135)](_0x527cd7=>{const _0x14bb18=_0x168320,_0x4245e8=_0x28dc1f[_0x14bb18(0x122)](getEnvDir,_0x527cd7),_0xe633cd=_0x28dc1f['vnQmO'](join,_0x4245e8,_0x14bb18(0x159)),_0xedfb11=_0x28dc1f['kOoSw'](join,_0x4245e8,_0x14bb18(0x140)),_0x25da44=join(_0x4245e8,'auth.json.enc');return{'name':_0x527cd7,'settingsPath':existsSync(_0xe633cd)?_0xe633cd:_0x28dc1f[_0x14bb18(0x143)],'hasPlaintextAuth':existsSync(_0xedfb11),'hasEncryptedAuth':_0x28dc1f[_0x14bb18(0x122)](existsSync,_0x25da44),'isActive':_0x28dc1f['iOAvY'](_0x527cd7,_0x498d77)};});return{'envs':_0x5d073d,'activeEnv':_0x498d77};}export async function status(){const _0x3f2e80=_0x43dea7,_0x1248c3={'gpgwB':'\x0a📊\x20Ranger\x20Status\x0a','HHByG':function(_0xbac7ce,_0x2cdbf7){return _0xbac7ce(_0x2cdbf7);},'MySsD':function(_0x3879d5,_0xda29ab){return _0x3879d5(_0xda29ab);},'ubqdu':function(_0x2ca159,_0x18c816,_0x41577f){return _0x2ca159(_0x18c816,_0x41577f);},'QniBj':function(_0x10b8e0,_0x45619a){return _0x10b8e0!==_0x45619a;},'sSyLW':function(_0x3e884a,_0x14607c){return _0x3e884a(_0x14607c);},'tuLMd':function(_0x1f1a7d){return _0x1f1a7d();},'ZbPyM':function(_0xad570a,_0x26bb33){return _0xad570a===_0x26bb33;},'ShCpF':_0x3f2e80(0x177),'YSXUN':function(_0x5c8cbc,_0x490eeb){return _0x5c8cbc===_0x490eeb;},'evshI':'\x20\x20Run:\x20ranger\x20setup\x20--opencode','pyRZK':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','JshHv':function(_0x191626,_0x46a5e6){return _0x191626(_0x46a5e6);},'Mndhw':_0x3f2e80(0x17e),'NczGH':'No\x20skills\x20installed','IfVKe':function(_0x3d0ed5,_0x9e9878){return _0x3d0ed5>_0x9e9878;},'gDWZO':_0x3f2e80(0x181),'lLNlK':function(_0xd9746,_0x3935c0){return _0xd9746>_0x3935c0;},'iThld':function(_0x3a9836){return _0x3a9836();},'aqvxD':function(_0x4d08ee,_0x4af2af){return _0x4d08ee+_0x4af2af;},'ODsZG':function(_0x40f557,_0x102556){return _0x40f557===_0x102556;},'UEwGm':function(_0x5120a1,_0x554c9f){return _0x5120a1>_0x554c9f;},'TTxnK':function(_0x44da02,_0x2f51de){return _0x44da02===_0x2f51de;},'VrTnC':'\x20(active)','JKEkX':_0x3f2e80(0x158),'aFEHd':'encrypted','ZkWbb':'(not\x20found)','DYhWc':function(_0x50c00d,_0x81db3e,_0x538ecd){return _0x50c00d(_0x81db3e,_0x538ecd);}};console['log'](_0x1248c3['gpgwB']);const _0x1dcc8b=process[_0x3f2e80(0x170)](),_0x447ca8=getRangerDir();if(!_0x1248c3['HHByG'](existsSync,_0x447ca8)){console[_0x3f2e80(0x153)]('Root:\x20'+link(_0x1dcc8b,_0x1248c3[_0x3f2e80(0x161)](bold,basename(_0x1dcc8b)))),console[_0x3f2e80(0x153)](_0x3f2e80(0x16c)),console['log'](_0x3f2e80(0x14b));return;}console[_0x3f2e80(0x153)](_0x3f2e80(0x14d)+_0x1248c3['ubqdu'](link,_0x1dcc8b,bold(basename(_0x1dcc8b))));const _0x58aebb=getCurrentVersion(),_0x33198d=getLatestVersion();if(_0x33198d[_0x3f2e80(0x142)]&&_0x1248c3['QniBj'](_0x33198d[_0x3f2e80(0x142)],_0x58aebb))console['log'](_0x3f2e80(0x17c)+_0x58aebb+'\x20(latest:\x20'+_0x33198d[_0x3f2e80(0x142)]+')'),console['log']('\x20\x20Run:\x20ranger\x20update');else _0x33198d[_0x3f2e80(0x142)]?console[_0x3f2e80(0x153)](_0x3f2e80(0x17c)+_0x58aebb+'\x20(up\x20to\x20date)'):console[_0x3f2e80(0x153)]('Version:\x20'+_0x58aebb);const _0x54f523=await getToken();if(_0x54f523){const _0x160d9a=await getCurrentUser(_0x54f523);_0x160d9a['success']?console['log'](_0x3f2e80(0x179)+_0x1248c3[_0x3f2e80(0x155)](bold,_0x160d9a['user']['organizationName'])):(console[_0x3f2e80(0x153)](_0x3f2e80(0x16e)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0x3f2e80(0x153)]('API\x20Token:\x20✗\x20Not\x20found'),console[_0x3f2e80(0x153)](_0x3f2e80(0x139));process[_0x3f2e80(0x126)]['DEBUG']&&(console['log']('API\x20Environment:\x20'+getCurrentEnvironment()),console[_0x3f2e80(0x153)]('API\x20URL:\x20'+getApiBaseUrl()));console['log'](_0x3f2e80(0x182));const _0x381801=await _0x1248c3[_0x3f2e80(0x150)](getOpencodePluginStatus);if(_0x1248c3['ZbPyM'](_0x381801['status'],_0x1248c3['ShCpF']))console[_0x3f2e80(0x153)]('\x20\x20'+bold('@ranger-testing/opencode-plugin')+':\x20configured'),_0x381801[_0x3f2e80(0x169)]&&console['log']('\x20\x20'+_0x381801['details']);else _0x1248c3['YSXUN'](_0x381801[_0x3f2e80(0x13f)],_0x3f2e80(0x137))?(console[_0x3f2e80(0x153)]('\x20\x20Not\x20configured'),_0x381801[_0x3f2e80(0x169)]&&console[_0x3f2e80(0x153)]('\x20\x20'+_0x381801['details']),console[_0x3f2e80(0x153)](_0x1248c3['evshI'])):console[_0x3f2e80(0x153)](_0x1248c3['pyRZK']);console['log'](_0x3f2e80(0x13e));const _0xa7acd=await _0x1248c3[_0x3f2e80(0x183)](getPluginInfo,'ranger@trailhead');if(_0xa7acd){const _0x2e50d6=_0xa7acd['scope']||_0x3f2e80(0x146),_0xfc803c=_0xa7acd['enabled']?'enabled':_0x3f2e80(0x178);console[_0x3f2e80(0x153)]('\x20\x20'+bold(_0x3f2e80(0x154))+':\x20installed\x20('+_0x2e50d6+',\x20'+_0xfc803c+')');}else console['log'](_0x1248c3[_0x3f2e80(0x173)]),console[_0x3f2e80(0x153)](_0x3f2e80(0x176));console[_0x3f2e80(0x153)]('\x0a---\x20Skills\x20---');const {project:_0x328ad6,user:_0x25dc77}=await getInstalledSkills(),_0x593011=_0x328ad6[_0x3f2e80(0x12d)](_0x31e3b0=>RANGER_MANAGED_SKILLS['includes'](_0x31e3b0[_0x3f2e80(0x138)])),_0xbcbc55=_0x25dc77['filter'](_0x2b8925=>RANGER_MANAGED_SKILLS['includes'](_0x2b8925['name'])),_0x16fd1e=_0x593011[_0x3f2e80(0x131)]+_0xbcbc55['length'];if(_0x16fd1e===0x0)console['log'](_0x1248c3['NczGH']),console['log'](_0x3f2e80(0x189));else{if(_0x1248c3[_0x3f2e80(0x168)](_0x593011['length'],0x0)){console[_0x3f2e80(0x153)](_0x1248c3[_0x3f2e80(0x12c)]);for(const _0x1dc828 of _0x593011){console['log']('\x20\x20\x20\x20'+_0x1248c3['sSyLW'](bold,_0x1dc828[_0x3f2e80(0x13a)])+':\x20'+link(_0x1dc828[_0x3f2e80(0x141)],_0x1248c3[_0x3f2e80(0x15b)](basename,_0x1dc828['path'])));}}if(_0x1248c3['lLNlK'](_0xbcbc55['length'],0x0)){console['log'](_0x3f2e80(0x15d));for(const _0x2c6b0e of _0xbcbc55){console[_0x3f2e80(0x153)](_0x3f2e80(0x11f)+_0x1248c3[_0x3f2e80(0x155)](bold,_0x2c6b0e['displayName'])+':\x20'+link(_0x2c6b0e[_0x3f2e80(0x141)],basename(_0x2c6b0e[_0x3f2e80(0x141)])));}}}console['log']('\x0a---\x20Profiles\x20---');const {envs:_0x1d595f,activeEnv:_0x46b364}=await getEnvironments();let _0x5bafe7=[];if(_0x54f523)try{_0x5bafe7=await _0x1248c3[_0x3f2e80(0x180)](listCloudProfiles);}catch{}const _0x16a17c=_0x1248c3['aqvxD'](_0x1d595f['length'],_0x5bafe7['length']);if(_0x1248c3[_0x3f2e80(0x136)](_0x16a17c,0x0))console[_0x3f2e80(0x153)](_0x3f2e80(0x16f)),console['log'](_0x3f2e80(0x127));else{if(_0x1248c3['lLNlK'](_0x16a17c,0x5)){const _0x4b1da2=[];_0x5bafe7[_0x3f2e80(0x131)]>0x0&&_0x4b1da2[_0x3f2e80(0x12f)](_0x5bafe7['length']+_0x3f2e80(0x123)),_0x1248c3[_0x3f2e80(0x175)](_0x1d595f[_0x3f2e80(0x131)],0x0)&&_0x4b1da2['push'](_0x1d595f['length']+_0x3f2e80(0x166)),console[_0x3f2e80(0x153)](_0x16a17c+_0x3f2e80(0x14f)+_0x4b1da2['join'](',\x20')+')'),_0x46b364&&console['log']('\x20\x20Active:\x20'+bold(_0x46b364)),console[_0x3f2e80(0x153)](_0x3f2e80(0x17f));}else{for(const _0x58a75d of _0x5bafe7){const _0x190898=_0x1248c3['TTxnK'](_0x58a75d[_0x3f2e80(0x138)],_0x46b364)?_0x1248c3[_0x3f2e80(0x15e)]:'';console[_0x3f2e80(0x153)]('\x20\x20'+bold(_0x58a75d['name'])+_0x3f2e80(0x151)+_0x190898);const _0x3da1a5=_0x58a75d[_0x3f2e80(0x14e)]?'cached\x20(updated\x20'+_0x58a75d['sessionUpdatedAt']+')':_0x1248c3[_0x3f2e80(0x15a)];console['log']('\x20\x20\x20\x20Session:\x20'+_0x3da1a5);}const _0x205148=new Set(_0x5bafe7['map'](_0x41df48=>_0x41df48['name']));for(const _0x47d848 of _0x1d595f){if(_0x205148[_0x3f2e80(0x185)](_0x47d848['name']))continue;const _0x3638cd=_0x47d848[_0x3f2e80(0x13d)]?_0x1248c3['VrTnC']:'',_0x5786c6=_0x47d848['hasEncryptedAuth']?_0x1248c3[_0x3f2e80(0x133)]:_0x47d848[_0x3f2e80(0x16d)]?'plaintext':'none';console[_0x3f2e80(0x153)]('\x20\x20'+bold(_0x47d848['name'])+'\x20[local]'+_0x3638cd),console['log']('\x20\x20\x20\x20Auth:\x20'+_0x5786c6),_0x47d848['settingsPath']!==_0x1248c3['ZkWbb']&&console[_0x3f2e80(0x153)]('\x20\x20\x20\x20Settings:\x20'+_0x1248c3[_0x3f2e80(0x165)](link,_0x47d848['settingsPath'],basename(_0x47d848[_0x3f2e80(0x16a)])));}if(!_0x46b364){console['log']('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x15af74=[..._0x5bafe7['map'](_0x488e7f=>_0x488e7f['name']),..._0x1d595f['filter'](_0x51c38b=>!_0x205148[_0x3f2e80(0x185)](_0x51c38b[_0x3f2e80(0x138)]))['map'](_0x32a046=>_0x32a046['name'])];console[_0x3f2e80(0x153)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x15af74[_0x3f2e80(0x167)](',\x20')+')');}}}console[_0x3f2e80(0x153)]('');}
|