@ranger-testing/ranger-cli 3.0.1-alpha.ffffb5b-28 → 3.1.1-alpha.08fb70e-39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/novaActCli.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/organizationEnvApi.js +1 -0
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/rangerwrightCli.js +1 -0
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/tunnelClient.js +1 -0
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/commands/verifyFeatureNovaCli.js +1 -1
- package/build/commands/verifyFeatureRangerwrightCli.js +1 -0
- package/package.json +4 -1
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b9a00,_0x542d53){const _0x161a21=_0xf954,_0x365e34=_0x1b9a00();while(!![]){try{const _0x20da29=parseInt(_0x161a21(0x19e))/0x1+-parseInt(_0x161a21(0x199))/0x2+parseInt(_0x161a21(0x1a5))/0x3+parseInt(_0x161a21(0x196))/0x4+-parseInt(_0x161a21(0x19a))/0x5+parseInt(_0x161a21(0x1a3))/0x6*(parseInt(_0x161a21(0x19d))/0x7)+-parseInt(_0x161a21(0x1a4))/0x8;if(_0x20da29===_0x542d53)break;else _0x365e34['push'](_0x365e34['shift']());}catch(_0x5ebcda){_0x365e34['push'](_0x365e34['shift']());}}}(_0x7d33,0x7d1fb));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';function _0x7d33(){const _0x45661b=['5649vlymCX','979041iEzflA','hwFRk','Hhvdf','message','success','3102MMwXyc','14324056hYcUGI','2964102mXoXIa','log','3563996CPLkcX','kSDjF','organizationName','1061126EVsSMc','2208580SCsYWS','\x0a✅\x20API\x20key\x20stored\x20successfully','Re-authenticating\x20via\x20MCP\x20bootstrap...'];_0x7d33=function(){return _0x45661b;};return _0x7d33();}import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';function _0xf954(_0x483c95,_0x9f8b23){_0x483c95=_0x483c95-0x195;const _0x7d33da=_0x7d33();let _0xf954b8=_0x7d33da[_0x483c95];return _0xf954b8;}import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0x2d2ab1=_0xf954,_0x36831a={'kSDjF':function(_0x1c9e99){return _0x1c9e99();},'Hhvdf':'Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','hwFRk':_0x2d2ab1(0x19b)},_0x443a81=await getMcpAuthOrigin();if(_0x443a81){console['log'](_0x2d2ab1(0x19c)),await _0x36831a[_0x2d2ab1(0x197)](mcpBootstrap);return;}if(!isInteractive())throw new Error(_0x36831a[_0x2d2ab1(0x1a0)]);try{const _0x51e5e1=await _0x36831a[_0x2d2ab1(0x197)](runDeviceAuthFlow),_0x30f560=await getCurrentUser(_0x51e5e1);_0x30f560[_0x2d2ab1(0x1a2)]?console['log']('\x0a✅\x20Logged\x20in\x20to\x20'+_0x30f560['user'][_0x2d2ab1(0x198)]):console[_0x2d2ab1(0x195)](_0x36831a[_0x2d2ab1(0x19f)]);}catch(_0x51ec81){throw new Error('Login\x20failed:\x20'+(_0x51ec81 instanceof Error?_0x51ec81[_0x2d2ab1(0x1a1)]:_0x51ec81));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x530b10=_0x5dc1;(function(_0x270c26,_0x2482f3){const _0x4c7ce6=_0x5dc1,_0x2df368=_0x270c26();while(!![]){try{const _0x225079=-parseInt(_0x4c7ce6(0x122))/0x1*(-parseInt(_0x4c7ce6(0xd6))/0x2)+parseInt(_0x4c7ce6(0x12a))/0x3+-parseInt(_0x4c7ce6(0x110))/0x4*(-parseInt(_0x4c7ce6(0x125))/0x5)+-parseInt(_0x4c7ce6(0xeb))/0x6+parseInt(_0x4c7ce6(0xfd))/0x7*(parseInt(_0x4c7ce6(0xb0))/0x8)+-parseInt(_0x4c7ce6(0x118))/0x9+parseInt(_0x4c7ce6(0x11c))/0xa*(-parseInt(_0x4c7ce6(0xfa))/0xb);if(_0x225079===_0x2482f3)break;else _0x2df368['push'](_0x2df368['shift']());}catch(_0x53df1b){_0x2df368['push'](_0x2df368['shift']());}}}(_0x2e1b,0x755e0));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(),_0x530b10(0x114),'mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');export async function getMcpAuthOrigin(){const _0x47f09d=_0x530b10,_0x427d41={'YYazz':'utf-8','tuaZl':function(_0x5bac57,_0x2693b5){return _0x5bac57||_0x2693b5;}};try{const _0x6802ea=(await readFile(AUTH_ORIGIN_PATH,_0x427d41['YYazz']))[_0x47f09d(0xa3)]();return _0x427d41['tuaZl'](_0x6802ea,null);}catch{return null;}}export async function mcpBootstrap(){const _0xe1ae0c=_0x530b10,_0x42bf20={'yajPw':function(_0x558593,_0x340ee0){return _0x558593(_0x340ee0);},'iKAHl':function(_0x2c675e){return _0x2c675e();},'NQCAM':function(_0xe637a7,_0x59b868){return _0xe637a7+_0x59b868;},'fmrXN':'MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','CYxNU':function(_0x29388a,_0x2d3de3,_0x200cc3){return _0x29388a(_0x2d3de3,_0x200cc3);}},_0x1e4941=getMcpAuthUrl();currentOrigin=_0x1e4941;const _0x49839a=process['stdout']['isTTY']??![];console['log'](_0xe1ae0c(0xed)+_0x1e4941+'\x0a');const _0x52aef8=await _0x42bf20['yajPw'](tryUnauthenticated,_0x1e4941);let _0x176769=null;if(_0x52aef8===_0xe1ae0c(0x121))_0x176769='';else{_0x176769=await _0x42bf20['iKAHl'](loadCachedToken);if(!_0x176769){if(!_0x49839a)throw new Error(_0x42bf20['NQCAM'](_0x42bf20[_0xe1ae0c(0x10c)],_0xe1ae0c(0x107)));_0x176769=await _0x42bf20[_0xe1ae0c(0xe3)](oauthFlow,_0x1e4941);}}await _0x42bf20[_0xe1ae0c(0x9f)](callGetCliToken,_0x1e4941,_0x176769);}function _0x2e1b(){const _0x4f4a81=['/.well-known/oauth-protected-resource','url','close','client_id','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','yajPw','state','base64url','error','UhLjW','get','sytvs','cUACs','893820wnLZUJ','isError','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','Initializing\x20MCP\x20session...','startsWith','OIJmw','log','origin','UuHGR','status','pathname','refresh_token','Token\x20exchange\x20failed:\x20','iwMJX','Exchanging\x20authorization\x20code...','12860441ALMfcz','application/json,\x20text/event-stream','mZLon','604170RrFgZq','get_cli_token\x20failed:\x20','OGedG','DPGDS','BQVms','2.0','aOddD','ydnCA','end','MCP\x20initialize\x20failed:\x20','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','expires_in','token','ZPMNx','gpMad','fmrXN','qpzwQ','flqRP','Yoojg','1268876rvJMho','registration_endpoint','\x20done','FgWgd','.ranger','code','headers','yxzSj','4423959VVKhqO','CWjIH','zOFoh','uvuvt','10wiaIGd','Registering\x20OAuth\x20client...','2025-03-26','string','aVLax','proxied','411RfBONH','UPnOH','needs-oauth','10UdzApF','POST','xdg-open','toString','structuredContent','1003755NvUSYR','utf-8','length','listen','RwivN','\x0aOpening\x20browser\x20for\x20authentication...','VjwaW','access_token','\x0aToken\x20written\x20to\x20','CYxNU','update','Requesting\x20CLI\x20token...','NeDQW','trim','HTTP\x20','text','write','/callback','vKBlj','xJlNS','clientId','now','json','match','1.0.0','expiresAt','88qNwElw','slice','writeHead','text/html','CYHbr','data:','authorization_servers','Qmptu','127.0.0.1','clientSecret','content','includes','redirect_uri','notifications/initialized','resource','parse','token_endpoint','searchParams','CdVZi','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','replace','initialize','darwin','stdout','stringify','VCBUn','none','message','ranger-cli','\x0aUnexpected\x20response\x20structure:','authorization_code','name','http://localhost:','set','faOpt','Qfbcu','digest','code_challenge_method','1810kCXEjN','text/event-stream','uxhWC','uYCdo','kGQfH','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','sha256','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata'];_0x2e1b=function(){return _0x4f4a81;};return _0x2e1b();}function _0x5dc1(_0x43ae25,_0x247cf8){_0x43ae25=_0x43ae25-0x9b;const _0x2e1bf2=_0x2e1b();let _0x5dc12b=_0x2e1bf2[_0x43ae25];return _0x5dc12b;}async function tryUnauthenticated(_0x19a120){const _0x277099=_0x530b10,_0x44396b={'gpncf':'POST','pMkcS':_0x277099(0xfb),'ydnCA':_0x277099(0x11e),'Dhjna':function(_0x3839dd,_0x4a29a6){return _0x3839dd===_0x4a29a6;},'NeDQW':_0x277099(0x124)},_0xaedeae=await fetch(_0x19a120,{'method':_0x44396b['gpncf'],'headers':{'Content-Type':'application/json','Accept':_0x44396b['pMkcS']},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x1,'method':'initialize','params':{'protocolVersion':_0x44396b[_0x277099(0x104)],'capabilities':{},'clientInfo':{'name':_0x277099(0xcc),'version':_0x277099(0xae)}}})});if(_0xaedeae['ok'])return await _0xaedeae[_0x277099(0xa5)](),'proxied';if(_0x44396b['Dhjna'](_0xaedeae[_0x277099(0xf4)],0x191))return await _0xaedeae['text'](),_0x44396b[_0x277099(0xa2)];const _0x42498f=await _0xaedeae['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0xaedeae[_0x277099(0xf4)]+':\x20'+_0x42498f);}class OAuthTimeoutError extends Error{constructor(_0x4700e7){const _0x16062f=_0x530b10;super(_0x4700e7),this[_0x16062f(0xcf)]='OAuthTimeoutError';}}async function oauthFlow(_0x54e94e){const _0x3dac65=_0x530b10,_0x4872a0={'Qmptu':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'};try{return await oauthFlowAttempt(_0x54e94e);}catch(_0x5b7474){if(_0x5b7474 instanceof OAuthTimeoutError&&await loadCachedClient())return console['log'](_0x4872a0[_0x3dac65(0xb7)]),await clearCachedClient(),await oauthFlowAttempt(_0x54e94e);throw _0x5b7474;}}async function oauthFlowAttempt(_0x40eb47){const _0x4096ce=_0x530b10,_0x5d453d={'VnAJl':function(_0x1812dd){return _0x1812dd();},'CYHbr':function(_0x1d7165,_0x5f33c5,_0xcd1148){return _0x1d7165(_0x5f33c5,_0xcd1148);},'yVgMK':'POST','NCmvg':'application/json','RwivN':_0x4096ce(0xce),'uvuvt':'refresh_token','kGQfH':_0x4096ce(0xe5),'UuHGR':_0x4096ce(0xd5),'aVLax':'S256','DPGDS':_0x4096ce(0xe4),'YRGAL':_0x4096ce(0xbe),'DPJqo':function(_0x25fb94,_0x4d3188){return _0x25fb94(_0x4d3188);},'rsgcT':function(_0x53d877,_0x5dac4f){return _0x53d877(_0x5dac4f);},'CWjIH':_0x4096ce(0xf9),'uxhWC':'client_secret','Qfbcu':'application/x-www-form-urlencoded','faOpt':'\x20done','qtGTK':function(_0x240d0f,_0xd73cf0,_0x3b51cd,_0x5248b4){return _0x240d0f(_0xd73cf0,_0x3b51cd,_0x5248b4);}},_0x4afd56=_0x40eb47[_0x4096ce(0xc4)](/\/mcp$/,'');process['stdout']['write']('Discovering\x20authorization\x20server...');const _0x51318b=await fetch(_0x4afd56+_0x4096ce(0xde));if(!_0x51318b['ok'])throw new Error('Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server');const _0x459143=await _0x51318b['json'](),_0x3efa65=_0x459143[_0x4096ce(0xb6)]?.[0x0];if(!_0x3efa65)throw new Error(_0x4096ce(0xdd));console['log']('\x20'+_0x3efa65);const _0x47afea=await fetchAuthServerMetadata(_0x3efa65);let _0x5d8cc7,_0x2d8dd4;const _0x45d6e4=await _0x5d453d['VnAJl'](loadCachedClient);if(_0x45d6e4)_0x5d8cc7=_0x45d6e4['clientId'],_0x2d8dd4=_0x45d6e4[_0x4096ce(0xb9)];else{if(_0x47afea['registration_endpoint']){process[_0x4096ce(0xc7)][_0x4096ce(0xa6)](_0x4096ce(0x11d));const _0x5d3116=await _0x5d453d[_0x4096ce(0xb4)](fetch,_0x47afea[_0x4096ce(0x111)],{'method':_0x5d453d['yVgMK'],'headers':{'Content-Type':_0x5d453d['NCmvg']},'body':JSON['stringify']({'client_name':'Ranger\x20CLI','redirect_uris':[_0x4096ce(0xd0)+CALLBACK_PORT+_0x4096ce(0xa7)],'grant_types':[_0x5d453d['RwivN'],_0x5d453d[_0x4096ce(0x11b)]],'response_types':[_0x4096ce(0x115)],'token_endpoint_auth_method':_0x4096ce(0xca)})});if(!_0x5d3116['ok']){const _0x583f92=await _0x5d3116['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x583f92);}const _0x329fc1=await _0x5d3116[_0x4096ce(0xac)]();_0x5d8cc7=_0x329fc1[_0x4096ce(0xe1)],_0x2d8dd4=_0x329fc1['client_secret'],await saveCachedClient(_0x5d8cc7,_0x2d8dd4),console[_0x4096ce(0xf1)](_0x4096ce(0x112));}else throw new Error(_0x4096ce(0xc3));}const _0x12868d=randomBytes(0x20)['toString']('base64url'),_0x5b440e=createHash(_0x4096ce(0xdc))[_0x4096ce(0xa0)](_0x12868d)[_0x4096ce(0xd4)](_0x5d453d[_0x4096ce(0xda)]),_0x27afa4=randomBytes(0x10)[_0x4096ce(0x128)]('hex'),_0x1b9ffe=new URL(_0x47afea['authorization_endpoint']);_0x1b9ffe['searchParams']['set']('response_type','code'),_0x1b9ffe[_0x4096ce(0xc1)]['set'](_0x4096ce(0xe1),_0x5d8cc7),_0x1b9ffe['searchParams'][_0x4096ce(0xd1)](_0x4096ce(0xbc),'http://localhost:'+CALLBACK_PORT+'/callback'),_0x1b9ffe['searchParams'][_0x4096ce(0xd1)]('code_challenge',_0x5b440e),_0x1b9ffe[_0x4096ce(0xc1)]['set'](_0x5d453d[_0x4096ce(0xf3)],_0x5d453d[_0x4096ce(0x120)]),_0x1b9ffe[_0x4096ce(0xc1)][_0x4096ce(0xd1)](_0x5d453d[_0x4096ce(0x100)],_0x27afa4);_0x459143[_0x4096ce(0xbe)]&&_0x1b9ffe[_0x4096ce(0xc1)]['set'](_0x5d453d['YRGAL'],_0x459143['resource']);console[_0x4096ce(0xf1)](_0x4096ce(0x9b)),console['log'](_0x4096ce(0xe2)+_0x1b9ffe[_0x4096ce(0x128)]()+'\x0a'),await _0x5d453d['DPJqo'](openBrowser,_0x1b9ffe['toString']());const _0x34533b=await _0x5d453d['rsgcT'](waitForCallback,_0x27afa4);process['stdout'][_0x4096ce(0xa6)](_0x5d453d[_0x4096ce(0x119)]);const _0x421a93=new URLSearchParams({'grant_type':_0x5d453d[_0x4096ce(0x12e)],'code':_0x34533b,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0x5d8cc7,'code_verifier':_0x12868d});_0x2d8dd4&&_0x421a93['set'](_0x5d453d[_0x4096ce(0xd8)],_0x2d8dd4);_0x459143[_0x4096ce(0xbe)]&&_0x421a93[_0x4096ce(0xd1)]('resource',_0x459143[_0x4096ce(0xbe)]);const _0xa35a49=await _0x5d453d['CYHbr'](fetch,_0x47afea[_0x4096ce(0xc0)],{'method':'POST','headers':{'Content-Type':_0x5d453d[_0x4096ce(0xd3)]},'body':_0x421a93});if(!_0xa35a49['ok']){const _0x102276=await _0xa35a49['text']();throw new Error(_0x4096ce(0xf7)+_0x102276);}const _0x5b013b=await _0xa35a49[_0x4096ce(0xac)]();return console['log'](_0x5d453d[_0x4096ce(0xd2)]),await _0x5d453d['qtGTK'](saveCachedToken,_0x5b013b[_0x4096ce(0x9d)],_0x5b013b[_0x4096ce(0xf6)],_0x5b013b[_0x4096ce(0x108)]),_0x5b013b[_0x4096ce(0x9d)];}async function callGetCliToken(_0x2f3783,_0x214404){const _0x163056=_0x530b10,_0x1d7aba={'zOFoh':function(_0x3c79fb,_0x31c0ab){return _0x3c79fb(_0x31c0ab);},'StFFk':'application/json','sytvs':'application/json,\x20text/event-stream','UhLjW':'Authorization','mETke':_0x163056(0xee),'MdBLh':_0x163056(0x102),'xJlNS':_0x163056(0xc5),'vSVRW':_0x163056(0xae),'igbVU':_0x163056(0x112),'iwMJX':function(_0x12533c,_0x613d56,_0x5029a2){return _0x12533c(_0x613d56,_0x5029a2);},'QfIMV':_0x163056(0x126),'cUACs':_0x163056(0xa1),'kOvWb':'tools/call','gpMad':function(_0x7ff7be,_0x47d5f5){return _0x7ff7be(_0x47d5f5);},'IubIf':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','tkFuu':function(_0x594931){return _0x594931();},'flqRP':function(_0x47c0c9,_0x24f78c,_0x190b81,_0x45854e){return _0x47c0c9(_0x24f78c,_0x190b81,_0x45854e);},'IFUen':'Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a'},_0x5671d2={'Content-Type':_0x1d7aba['StFFk'],'Accept':_0x1d7aba[_0x163056(0xe9)]};_0x214404&&(_0x5671d2[_0x1d7aba[_0x163056(0xe7)]]='Bearer\x20'+_0x214404);const _0x1f575b=async _0x4512b2=>{const _0x5c1a5d=_0x163056,_0x5e38df=await fetch(_0x2f3783,{'method':_0x5c1a5d(0x126),'headers':_0x5671d2,'body':JSON[_0x5c1a5d(0xc8)](_0x4512b2)});if(!_0x5e38df['ok']){const _0x2deeb3=await _0x5e38df[_0x5c1a5d(0xa5)]();throw new Error(_0x5c1a5d(0xa4)+_0x5e38df[_0x5c1a5d(0xf4)]+':\x20'+_0x2deeb3);}return _0x1d7aba[_0x5c1a5d(0x11a)](parseResponse,_0x5e38df);};process[_0x163056(0xc7)]['write'](_0x1d7aba['mETke']);const _0x40c278=await _0x1f575b({'jsonrpc':_0x1d7aba['MdBLh'],'id':0x1,'method':_0x1d7aba[_0x163056(0xa9)],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x163056(0xcc),'version':_0x1d7aba['vSVRW']}}});if(_0x40c278['error'])throw new Error(_0x163056(0x106)+(_0x40c278[_0x163056(0xe6)][_0x163056(0xcb)]??JSON[_0x163056(0xc8)](_0x40c278[_0x163056(0xe6)])));console['log'](_0x1d7aba['igbVU']),await _0x1d7aba[_0x163056(0xf8)](fetch,_0x2f3783,{'method':_0x1d7aba['QfIMV'],'headers':_0x5671d2,'body':JSON[_0x163056(0xc8)]({'jsonrpc':'2.0','method':_0x163056(0xbd)})})['then'](_0xd2728b=>_0xd2728b[_0x163056(0xa5)]()),process['stdout'][_0x163056(0xa6)](_0x1d7aba[_0x163056(0xea)]);const _0x303447=await _0x1f575b({'jsonrpc':_0x163056(0x102),'id':0x2,'method':_0x1d7aba['kOvWb'],'params':{'name':'get_cli_token','arguments':{}}});if(_0x303447[_0x163056(0xe6)])throw new Error(_0x163056(0xfe)+(_0x303447['error'][_0x163056(0xcb)]??JSON['stringify'](_0x303447['error'])));console[_0x163056(0xf1)](_0x1d7aba['igbVU']);const _0x48cc8e=_0x1d7aba[_0x163056(0x10b)](extractToken,_0x303447['result']);if(!_0x48cc8e){console[_0x163056(0xe6)](_0x163056(0xcd)),console[_0x163056(0xe6)](JSON['stringify'](_0x303447['result'],null,0x2));throw new Error(_0x1d7aba['IubIf']);}const _0xd9ae96=join(_0x1d7aba['tkFuu'](homedir),_0x163056(0x114)),_0x1639ef=_0x1d7aba['iwMJX'](join,_0xd9ae96,'refresh.txt');await mkdir(_0xd9ae96,{'recursive':!![]}),await _0x1d7aba['flqRP'](writeFile,_0x1639ef,_0x48cc8e,{'mode':0x180}),await _0x1d7aba[_0x163056(0x10e)](writeFile,join(_0xd9ae96,'auth-origin.txt'),_0x2f3783,{'mode':0x180}),console[_0x163056(0xf1)](_0x163056(0x9e)+_0x1639ef),console['log'](_0x1d7aba['IFUen']);}async function fetchAuthServerMetadata(_0x3ad8a8){const _0x4ca1c7=_0x530b10,_0x3479aa=_0x3ad8a8+'/.well-known/oauth-authorization-server',_0x175134=await fetch(_0x3479aa);if(!_0x175134['ok'])throw new Error(_0x4ca1c7(0xdb)+_0x3479aa+':\x20'+_0x175134[_0x4ca1c7(0xf4)]);return _0x175134[_0x4ca1c7(0xac)]();}function waitForCallback(_0x506077){const _0x3d2584=_0x530b10,_0xbbf426={'DAQRh':function(_0x180aff){return _0x180aff();},'ftKEJ':_0x3d2584(0xa7),'zLwaa':'error','BQVms':function(_0x3502e2,_0x157b19){return _0x3502e2(_0x157b19);},'zpFRO':'text/html','FgWgd':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','VsWmz':_0x3d2584(0xb8)};return new Promise((_0x4e212a,_0x2c7152)=>{const _0x4faec5=_0x3d2584,_0x28ad13={'KttTl':function(_0x5801cd){return _0xbbf426['DAQRh'](_0x5801cd);},'qpzwQ':function(_0x5a10d9,_0x3cb7fd){return _0x5a10d9!==_0x3cb7fd;},'VjwaW':_0xbbf426['ftKEJ'],'bOIdp':'Not\x20found','ZPMNx':_0xbbf426['zLwaa'],'TmLQr':function(_0x1829b0,_0x3b6896){const _0x24b569=_0x5dc1;return _0xbbf426[_0x24b569(0x101)](_0x1829b0,_0x3b6896);},'VXHUb':function(_0x458a69){return _0x458a69();},'vKBlj':_0xbbf426['zpFRO'],'yxzSj':_0xbbf426[_0x4faec5(0x113)],'rZFlC':function(_0x1c8dfa,_0x5785c0){return _0x1c8dfa(_0x5785c0);}},_0x4ad5f8=()=>{const _0x5ad6f0=_0x4faec5;_0x54a58c['closeAllConnections'](),_0x54a58c[_0x5ad6f0(0xe0)]();},_0x39b4b8=setTimeout(()=>{_0x28ad13['KttTl'](_0x4ad5f8),_0x2c7152(new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x54a58c=_0xbbf426['BQVms'](createServer,(_0x131cbe,_0x2a340d)=>{const _0x76d9c1=_0x4faec5,_0x5b95e2=new URL(_0x131cbe[_0x76d9c1(0xdf)]??'/','http://localhost:'+CALLBACK_PORT);if(_0x28ad13[_0x76d9c1(0x10d)](_0x5b95e2[_0x76d9c1(0xf5)],_0x28ad13[_0x76d9c1(0x9c)])){_0x2a340d[_0x76d9c1(0xb2)](0x194),_0x2a340d[_0x76d9c1(0x105)](_0x28ad13['bOIdp']);return;}const _0xfc928b=_0x5b95e2[_0x76d9c1(0xc1)][_0x76d9c1(0xe8)]('code'),_0x115e36=_0x5b95e2['searchParams']['get'](_0x76d9c1(0xe4)),_0xaa3f04=_0x5b95e2['searchParams']['get'](_0x28ad13[_0x76d9c1(0x10a)]);if(_0xaa3f04){const _0x25ba43=_0x5b95e2['searchParams'][_0x76d9c1(0xe8)]('error_description')??_0xaa3f04;_0x2a340d['writeHead'](0xc8,{'Content-Type':_0x76d9c1(0xb3)}),_0x2a340d[_0x76d9c1(0x105)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x25ba43+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),_0x28ad13['TmLQr'](clearTimeout,_0x39b4b8),_0x28ad13['VXHUb'](_0x4ad5f8),_0x2c7152(new Error('OAuth\x20error:\x20'+_0x25ba43));return;}if(!_0xfc928b||_0x28ad13[_0x76d9c1(0x10d)](_0x115e36,_0x506077)){_0x2a340d['writeHead'](0x190,{'Content-Type':_0x28ad13[_0x76d9c1(0xa8)]}),_0x2a340d[_0x76d9c1(0x105)]('<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>');return;}_0x2a340d['writeHead'](0xc8,{'Content-Type':_0x28ad13['vKBlj']}),_0x2a340d[_0x76d9c1(0x105)](_0x28ad13[_0x76d9c1(0x117)]),_0x28ad13['rZFlC'](clearTimeout,_0x39b4b8),_0x4ad5f8(),_0x4e212a(_0xfc928b);});_0x54a58c[_0x4faec5(0x12d)](CALLBACK_PORT,_0xbbf426['VsWmz']);});}async function openBrowser(_0x56d8c2){const _0x36332d=_0x530b10,_0x453c48={'vafYl':'win32'},_0x19c18c=process['platform']===_0x36332d(0xc6)?'open':process['platform']===_0x453c48['vafYl']?'start':_0x36332d(0x127);exec(_0x19c18c+'\x20\x22'+_0x56d8c2+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x50661c=_0x530b10,_0x332210={'CdVZi':function(_0x23ac4e,_0x15272c,_0xd5c003){return _0x23ac4e(_0x15272c,_0xd5c003);},'naCPg':'utf-8'};try{const _0x59020c=JSON[_0x50661c(0xbf)](await _0x332210[_0x50661c(0xc2)](readFile,TOKEN_CACHE_PATH,_0x332210['naCPg']));if(_0x59020c['origin']&&_0x59020c['origin']!==currentOrigin)return null;if(_0x59020c['expiresAt']&&Date[_0x50661c(0xab)]()>_0x59020c[_0x50661c(0xaf)])return null;return _0x59020c['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x488e65,_0x2b014d,_0xe3f1c6){const _0x46acd6=_0x530b10,_0x3106b1={'OIJmw':function(_0x5906fe){return _0x5906fe();}},_0x4d19a1=await _0x3106b1[_0x46acd6(0xf0)](loadCachedData),_0x4e481e={..._0x4d19a1,'origin':currentOrigin,'accessToken':_0x488e65,'refreshToken':_0x2b014d??_0x4d19a1?.['refreshToken'],'expiresAt':_0xe3f1c6?Date['now']()+_0xe3f1c6*0x3e8:undefined};await mkdir(join(homedir(),_0x46acd6(0x114)),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x4e481e),{'mode':0x180});}async function loadCachedClient(){const _0x3705b0=_0x530b10,_0xaa275b={'UQoxD':function(_0x5647b3){return _0x5647b3();},'aOddD':function(_0x36f8ef,_0x171837){return _0x36f8ef!==_0x171837;}},_0x4f9df7=await _0xaa275b['UQoxD'](loadCachedData);if(_0x4f9df7?.[_0x3705b0(0xf2)]&&_0xaa275b[_0x3705b0(0x103)](_0x4f9df7['origin'],currentOrigin))return null;return _0x4f9df7?.[_0x3705b0(0xaa)]?{'clientId':_0x4f9df7['clientId'],'clientSecret':_0x4f9df7['clientSecret']}:null;}async function clearCachedClient(){const _0x51c97d=_0x530b10,_0x2a7ce6={'Mrvsi':function(_0x38d2db){return _0x38d2db();}},_0x3a48e9=await _0x2a7ce6['Mrvsi'](loadCachedData);if(!_0x3a48e9)return;const {clientId:_0x2760d7,clientSecret:_0x5eb1ea,..._0x483d8b}=_0x3a48e9;await writeFile(TOKEN_CACHE_PATH,JSON[_0x51c97d(0xc8)](_0x483d8b),{'mode':0x180});}async function saveCachedClient(_0x7f266,_0x1b2c01){const _0x47c235=_0x530b10,_0x1ed429={'IEnol':function(_0xd80f6c){return _0xd80f6c();},'UPnOH':function(_0x1d39df,_0x243c0e,_0x1912fe){return _0x1d39df(_0x243c0e,_0x1912fe);},'bdGgn':function(_0x33cebf,_0x2d80cc,_0x3bf408){return _0x33cebf(_0x2d80cc,_0x3bf408);},'VCBUn':function(_0x3df4aa){return _0x3df4aa();},'mZLon':'.ranger'},_0x19d126=await _0x1ed429['IEnol'](loadCachedData),_0x580575={..._0x19d126,'origin':currentOrigin,'accessToken':_0x19d126?.['accessToken']??'','clientId':_0x7f266,'clientSecret':_0x1b2c01};await _0x1ed429[_0x47c235(0x123)](mkdir,_0x1ed429['bdGgn'](join,_0x1ed429[_0x47c235(0xc9)](homedir),_0x1ed429[_0x47c235(0xfc)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x47c235(0xc8)](_0x580575),{'mode':0x180});}async function loadCachedData(){const _0x3c1978=_0x530b10,_0x132bda={'uYCdo':function(_0x355964,_0x4a68d5,_0x22d1af){return _0x355964(_0x4a68d5,_0x22d1af);}};try{return JSON['parse'](await _0x132bda[_0x3c1978(0xd9)](readFile,TOKEN_CACHE_PATH,_0x3c1978(0x12b)));}catch{return null;}}async function parseResponse(_0x180647){const _0x2f4568=_0x530b10,_0x20f215={'oKwbN':_0x2f4568(0xd7),'isBDD':_0x2f4568(0xb5),'OGedG':function(_0x2e82a8,_0x54a8e7){return _0x2e82a8!==_0x54a8e7;}},_0xa879ab=_0x180647[_0x2f4568(0x116)][_0x2f4568(0xe8)]('content-type')??'';if(_0xa879ab[_0x2f4568(0xbb)](_0x20f215['oKwbN'])){const _0xc1e20d=await _0x180647[_0x2f4568(0xa5)]();for(const _0x37319b of _0xc1e20d['split']('\x0a')){const _0xb3be2b=_0x37319b['trim']();if(_0xb3be2b[_0x2f4568(0xef)](_0x20f215['isBDD'])){const _0x49c404=_0xb3be2b[_0x2f4568(0xb1)]('data:'[_0x2f4568(0x12c)])['trim']();if(!_0x49c404)continue;try{const _0x13e5c9=JSON['parse'](_0x49c404);if(_0x20f215[_0x2f4568(0xff)](_0x13e5c9['id'],undefined)||_0x13e5c9[_0x2f4568(0xe6)])return _0x13e5c9;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x180647[_0x2f4568(0xac)]();}function extractToken(_0x557c5c){const _0x5d3e90=_0x530b10,_0x8fbd3c={'bjrGQ':'Unknown\x20error','Yoojg':function(_0xd218ad,_0x34cf78){return _0xd218ad===_0x34cf78;},'Svmkw':_0x5d3e90(0x11f)};if(!_0x557c5c)return null;const _0x6ec253=_0x557c5c[_0x5d3e90(0x129)];if(_0x6ec253?.['token']&&typeof _0x6ec253[_0x5d3e90(0x109)]===_0x5d3e90(0x11f))return _0x6ec253['token'];if(_0x557c5c[_0x5d3e90(0xec)]){const _0x332c75=_0x557c5c['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x332c75?.[0x0]?.['text']??_0x8fbd3c['bjrGQ']));}const _0xad464f=_0x557c5c[_0x5d3e90(0xba)];if(_0xad464f)for(const _0x4b7646 of _0xad464f){if(_0x8fbd3c[_0x5d3e90(0x10f)](_0x4b7646['type'],'text')&&_0x4b7646[_0x5d3e90(0xa5)]){try{const _0x4e062c=JSON['parse'](_0x4b7646[_0x5d3e90(0xa5)]);if(typeof _0x4e062c?.['token']===_0x8fbd3c['Svmkw'])return _0x4e062c['token'];}catch{}const _0xd0d45d=_0x4b7646[_0x5d3e90(0xa5)][_0x5d3e90(0xad)](/(rngr_[A-Za-z0-9_-]+)/);if(_0xd0d45d)return _0xd0d45d[0x1];}}return null;}
|
|
1
|
+
const _0x957390=_0x5b46;(function(_0x27c270,_0x3d91e7){const _0x4b498c=_0x5b46,_0x391a35=_0x27c270();while(!![]){try{const _0x3b17a2=-parseInt(_0x4b498c(0x203))/0x1*(-parseInt(_0x4b498c(0x22d))/0x2)+-parseInt(_0x4b498c(0x23e))/0x3+parseInt(_0x4b498c(0x24f))/0x4+parseInt(_0x4b498c(0x208))/0x5*(-parseInt(_0x4b498c(0x247))/0x6)+-parseInt(_0x4b498c(0x242))/0x7*(-parseInt(_0x4b498c(0x207))/0x8)+-parseInt(_0x4b498c(0x26c))/0x9+parseInt(_0x4b498c(0x23a))/0xa;if(_0x3b17a2===_0x3d91e7)break;else _0x391a35['push'](_0x391a35['shift']());}catch(_0x51fb37){_0x391a35['push'](_0x391a35['shift']());}}}(_0x1b32,0x254a5));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(),_0x957390(0x1df),_0x957390(0x1e4)),AUTH_ORIGIN_PATH=join(homedir(),_0x957390(0x1df),_0x957390(0x21d));export async function getMcpAuthOrigin(){const _0x29f4d8=_0x957390,_0x5c5780={'sgwyX':_0x29f4d8(0x1fa),'ObeRh':function(_0x27eb0d,_0x137e43){return _0x27eb0d||_0x137e43;}};try{const _0x47f22d=(await readFile(AUTH_ORIGIN_PATH,_0x5c5780[_0x29f4d8(0x1fe)]))[_0x29f4d8(0x243)]();return _0x5c5780['ObeRh'](_0x47f22d,null);}catch{return null;}}export async function mcpBootstrap(){const _0x19a310=_0x957390,_0x29f111={'GFdMI':function(_0x17979d){return _0x17979d();},'FhCcG':function(_0x27e7c7,_0x447601){return _0x27e7c7(_0x447601);},'bRnZB':function(_0x2704b8,_0x493cdf){return _0x2704b8===_0x493cdf;},'GZuBL':'proxied','TkuBm':'MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','glPxU':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'},_0x4c81fa=_0x29f111['GFdMI'](getMcpAuthUrl);currentOrigin=_0x4c81fa;const _0x2523db=process[_0x19a310(0x1e1)][_0x19a310(0x214)]??![];console['log'](_0x19a310(0x21b)+_0x4c81fa+'\x0a');const _0x14a27a=await _0x29f111[_0x19a310(0x209)](tryUnauthenticated,_0x4c81fa);let _0x30bfb4=null;if(_0x29f111[_0x19a310(0x1fd)](_0x14a27a,_0x29f111[_0x19a310(0x260)]))_0x30bfb4='';else{_0x30bfb4=await loadCachedToken();if(!_0x30bfb4){if(!_0x2523db)throw new Error(_0x29f111[_0x19a310(0x271)]+_0x29f111['glPxU']);_0x30bfb4=await oauthFlow(_0x4c81fa);}}await callGetCliToken(_0x4c81fa,_0x30bfb4);}async function tryUnauthenticated(_0x167def){const _0xed664=_0x957390,_0x2d5a0d={'wENiJ':'POST','FDSDp':'application/json','PahkM':'application/json,\x20text/event-stream','yulkK':_0xed664(0x27b),'faDRd':_0xed664(0x24c),'zXvak':_0xed664(0x223),'sqKNl':_0xed664(0x262)},_0x3b12d9=await fetch(_0x167def,{'method':_0x2d5a0d[_0xed664(0x24e)],'headers':{'Content-Type':_0x2d5a0d[_0xed664(0x21c)],'Accept':_0x2d5a0d['PahkM']},'body':JSON[_0xed664(0x22e)]({'jsonrpc':_0x2d5a0d['yulkK'],'id':0x1,'method':_0x2d5a0d[_0xed664(0x255)],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x2d5a0d['zXvak'],'version':_0xed664(0x23f)}}})});if(_0x3b12d9['ok'])return await _0x3b12d9['text'](),_0xed664(0x219);if(_0x3b12d9[_0xed664(0x211)]===0x191)return await _0x3b12d9[_0xed664(0x252)](),_0x2d5a0d['sqKNl'];const _0x5f5ba5=await _0x3b12d9[_0xed664(0x252)]();throw new Error(_0xed664(0x277)+_0x3b12d9['status']+':\x20'+_0x5f5ba5);}function _0x5b46(_0x1080d0,_0xe72a58){_0x1080d0=_0x1080d0-0x1dd;const _0x1b3274=_0x1b32();let _0x5b465b=_0x1b3274[_0x1080d0];return _0x5b465b;}function _0x1b32(){const _0x40cfb2=['1993284rMBHft','authorization_endpoint','deHvW','<html><body><h2>Authentication\x20failed</h2><p>','QzIWh','TkuBm','OAuthTimeoutError','expiresAt','accessToken','platform','access_token','MCP\x20server\x20returned\x20HTTP\x20','structuredContent','MhWUJ','EDrqX','2.0','NrRBf','code_challenge','.ranger','content-type','stdout','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','EPVbg','mcp-oauth-tokens.json','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','registration_endpoint','base64url','update','gFJSq','Discovering\x20authorization\x20server...','kOAJk','VndvL','string','TSpaJ','127.0.0.1','includes','close','LgRYN','Token\x20exchange\x20failed:\x20','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','TGCLO','nwOqv','OAuth\x20error:\x20','PADgR','Ranger\x20CLI','utf-8','\x20done','refreshToken','bRnZB','sgwyX','kapFs','Initializing\x20MCP\x20session...','S256','pathname','1227nUUoZp','application/json,\x20text/event-stream','Exchanging\x20authorization\x20code...','log','32nPOSdG','12295uamBJW','FhCcG','code','Requesting\x20CLI\x20token...','Registering\x20OAuth\x20client...','yecfu','content','write','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','status','FxDwJ','wKJRV','isTTY','expires_in','listen','get','client_id','proxied','refresh.txt','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','FDSDp','auth-origin.txt','token','resource','2025-03-26','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','start','ranger-cli','daQEi','Authorization','\x0aToken\x20written\x20to\x20','now','POST','name','end','Unknown\x20error','application/json','474TbeICe','stringify','sha256','application/x-www-form-urlencoded','origin','parse','ugZpF','Pjprz','/.well-known/oauth-protected-resource','JENJY','LWOdz','/callback','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','699020gULXmS','KmQcS','kYTpR','redirect_uri','342129CfZsep','1.0.0','url','whUDS','428743qyGsPC','trim','startsWith','code_challenge_method','error','720jnTHVj','set','slice','http://localhost:','text/event-stream','initialize','LgaXp','wENiJ','710572sbZbUJ','jiXzS','message','text','OjPCb','get_cli_token\x20failed:\x20','faDRd','Mitsv','/.well-known/oauth-authorization-server','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','HTTP\x20','hwvzt','state','json','toString','xdg-open','text/html','GZuBL','split','needs-oauth','oBIOa','authorization_servers','MCP\x20initialize\x20failed:\x20','match','TEsNT','TJUUC','OgJwl','KQkDT','searchParams'];_0x1b32=function(){return _0x40cfb2;};return _0x1b32();}class OAuthTimeoutError extends Error{constructor(_0x530272){const _0x298957=_0x957390,_0x46c46c={'wKJRV':_0x298957(0x272)};super(_0x530272),this[_0x298957(0x229)]=_0x46c46c[_0x298957(0x213)];}}async function oauthFlow(_0x5818b5){const _0x5ec315=_0x957390,_0x123bf8={'kUzyw':_0x5ec315(0x210),'vNalT':function(_0x3cdb54,_0x59633b){return _0x3cdb54(_0x59633b);}};try{return await oauthFlowAttempt(_0x5818b5);}catch(_0xe51440){if(_0xe51440 instanceof OAuthTimeoutError&&await loadCachedClient())return console[_0x5ec315(0x206)](_0x123bf8['kUzyw']),await clearCachedClient(),await _0x123bf8['vNalT'](oauthFlowAttempt,_0x5818b5);throw _0xe51440;}}async function oauthFlowAttempt(_0x2cce5b){const _0x4d84a7=_0x957390,_0x44466c={'FAgdJ':_0x4d84a7(0x1ea),'LgRYN':function(_0x3d930b,_0x48e18d){return _0x3d930b(_0x48e18d);},'oBIOa':function(_0x39ea48){return _0x39ea48();},'YiDZm':_0x4d84a7(0x20c),'deHvW':'POST','daQEi':'application/json','IPcTJ':_0x4d84a7(0x1f9),'OgJwl':'\x20done','aljxq':function(_0x348f07,_0x36f1c0){return _0x348f07(_0x36f1c0);},'GGIkT':_0x4d84a7(0x1e7),'kYTpR':_0x4d84a7(0x22f),'TGCLO':'hex','FxDwJ':'response_type','EDrqX':'code','whUDS':_0x4d84a7(0x23d),'JDNoJ':_0x4d84a7(0x245),'MhWUJ':_0x4d84a7(0x201),'LWOdz':_0x4d84a7(0x25b),'WfhCS':'resource','VndvL':function(_0x2c7fd9,_0x579225){return _0x2c7fd9(_0x579225);},'lMoQu':'client_secret','zKBCl':function(_0x18c3b1,_0x1f6ef3,_0x324743,_0x207e0e){return _0x18c3b1(_0x1f6ef3,_0x324743,_0x207e0e);}},_0x400d99=_0x2cce5b['replace'](/\/mcp$/,'');process[_0x4d84a7(0x1e1)][_0x4d84a7(0x20f)](_0x44466c['FAgdJ']);const _0xb6a409=await fetch(_0x400d99+_0x4d84a7(0x235));if(!_0xb6a409['ok'])throw new Error(_0x4d84a7(0x221));const _0x1f6498=await _0xb6a409['json'](),_0x48d905=_0x1f6498[_0x4d84a7(0x264)]?.[0x0];if(!_0x48d905)throw new Error(_0x4d84a7(0x1f4));console[_0x4d84a7(0x206)]('\x20'+_0x48d905);const _0xcecb0d=await _0x44466c[_0x4d84a7(0x1f2)](fetchAuthServerMetadata,_0x48d905);let _0x3f11ae,_0x3f6868;const _0x41cb37=await _0x44466c[_0x4d84a7(0x263)](loadCachedClient);if(_0x41cb37)_0x3f11ae=_0x41cb37['clientId'],_0x3f6868=_0x41cb37['clientSecret'];else{if(_0xcecb0d[_0x4d84a7(0x1e6)]){process[_0x4d84a7(0x1e1)]['write'](_0x44466c['YiDZm']);const _0x3411ec=await fetch(_0xcecb0d['registration_endpoint'],{'method':_0x44466c[_0x4d84a7(0x26e)],'headers':{'Content-Type':_0x44466c[_0x4d84a7(0x224)]},'body':JSON[_0x4d84a7(0x22e)]({'client_name':_0x44466c['IPcTJ'],'redirect_uris':[_0x4d84a7(0x24a)+CALLBACK_PORT+'/callback'],'grant_types':['authorization_code','refresh_token'],'response_types':[_0x4d84a7(0x20a)],'token_endpoint_auth_method':'none'})});if(!_0x3411ec['ok']){const _0x264ada=await _0x3411ec[_0x4d84a7(0x252)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x264ada);}const _0x14a5f7=await _0x3411ec[_0x4d84a7(0x25c)]();_0x3f11ae=_0x14a5f7[_0x4d84a7(0x218)],_0x3f6868=_0x14a5f7['client_secret'],await saveCachedClient(_0x3f11ae,_0x3f6868),console['log'](_0x44466c['OgJwl']);}else throw new Error('Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found');}const _0x28035b=_0x44466c['aljxq'](randomBytes,0x20)['toString'](_0x44466c['GGIkT']),_0x30c604=createHash(_0x44466c[_0x4d84a7(0x23c)])[_0x4d84a7(0x1e8)](_0x28035b)['digest']('base64url'),_0x76656d=randomBytes(0x10)['toString'](_0x44466c[_0x4d84a7(0x1f5)]),_0x5da3e9=new URL(_0xcecb0d[_0x4d84a7(0x26d)]);_0x5da3e9[_0x4d84a7(0x26b)]['set'](_0x44466c[_0x4d84a7(0x212)],_0x44466c[_0x4d84a7(0x27a)]),_0x5da3e9['searchParams']['set']('client_id',_0x3f11ae),_0x5da3e9[_0x4d84a7(0x26b)][_0x4d84a7(0x248)](_0x44466c[_0x4d84a7(0x241)],_0x4d84a7(0x24a)+CALLBACK_PORT+'/callback'),_0x5da3e9[_0x4d84a7(0x26b)]['set'](_0x4d84a7(0x1de),_0x30c604),_0x5da3e9[_0x4d84a7(0x26b)][_0x4d84a7(0x248)](_0x44466c['JDNoJ'],_0x44466c[_0x4d84a7(0x279)]),_0x5da3e9['searchParams']['set'](_0x44466c[_0x4d84a7(0x237)],_0x76656d);_0x1f6498['resource']&&_0x5da3e9['searchParams'][_0x4d84a7(0x248)](_0x44466c['WfhCS'],_0x1f6498['resource']);console[_0x4d84a7(0x206)]('\x0aOpening\x20browser\x20for\x20authentication...'),console[_0x4d84a7(0x206)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x5da3e9[_0x4d84a7(0x25d)]()+'\x0a'),await openBrowser(_0x5da3e9[_0x4d84a7(0x25d)]());const _0x204195=await _0x44466c[_0x4d84a7(0x1ec)](waitForCallback,_0x76656d);process['stdout']['write'](_0x4d84a7(0x205));const _0x3cab1f=new URLSearchParams({'grant_type':'authorization_code','code':_0x204195,'redirect_uri':_0x4d84a7(0x24a)+CALLBACK_PORT+_0x4d84a7(0x238),'client_id':_0x3f11ae,'code_verifier':_0x28035b});_0x3f6868&&_0x3cab1f[_0x4d84a7(0x248)](_0x44466c['lMoQu'],_0x3f6868);_0x1f6498['resource']&&_0x3cab1f['set'](_0x4d84a7(0x21f),_0x1f6498[_0x4d84a7(0x21f)]);const _0x3f32a9=await fetch(_0xcecb0d['token_endpoint'],{'method':_0x44466c['deHvW'],'headers':{'Content-Type':_0x4d84a7(0x230)},'body':_0x3cab1f});if(!_0x3f32a9['ok']){const _0x45da3e=await _0x3f32a9['text']();throw new Error(_0x4d84a7(0x1f3)+_0x45da3e);}const _0xc6cc44=await _0x3f32a9['json']();return console[_0x4d84a7(0x206)](_0x44466c[_0x4d84a7(0x269)]),await _0x44466c['zKBCl'](saveCachedToken,_0xc6cc44[_0x4d84a7(0x276)],_0xc6cc44['refresh_token'],_0xc6cc44[_0x4d84a7(0x215)]),_0xc6cc44['access_token'];}async function callGetCliToken(_0x54ec96,_0x281555){const _0x177884=_0x957390,_0x59b50f={'EPVbg':function(_0x4cee7f,_0x3e23d2,_0x48740d){return _0x4cee7f(_0x3e23d2,_0x48740d);},'bHYDb':_0x177884(0x228),'qJeEo':_0x177884(0x22c),'NrRBf':_0x177884(0x204),'ugZpF':_0x177884(0x225),'PfnmT':function(_0x318e8b,_0x101ef3){return _0x318e8b(_0x101ef3);},'hwvzt':_0x177884(0x24c),'XcJxb':_0x177884(0x220),'QzIWh':_0x177884(0x223),'gFJSq':'1.0.0','yLhbA':'2.0','TEsNT':'tools/call','JENJY':'\x20done','pzxHx':'\x0aUnexpected\x20response\x20structure:','vCyOl':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','Pjprz':function(_0x37ff76){return _0x37ff76();},'jXABl':_0x177884(0x1df),'euDsR':_0x177884(0x21a),'KQkDT':function(_0xf5ccd0,_0x4388dc,_0x344b10,_0x12bc3a){return _0xf5ccd0(_0x4388dc,_0x344b10,_0x12bc3a);},'nwOqv':function(_0x518dc1,_0x27b1a9,_0x1a8ce5){return _0x518dc1(_0x27b1a9,_0x1a8ce5);}},_0x4dc3cf={'Content-Type':_0x59b50f['qJeEo'],'Accept':_0x59b50f[_0x177884(0x1dd)]};_0x281555&&(_0x4dc3cf[_0x59b50f[_0x177884(0x233)]]='Bearer\x20'+_0x281555);const _0x52ba8e=async _0x5b16d0=>{const _0x532022=_0x177884,_0x3f05fd=await _0x59b50f[_0x532022(0x1e3)](fetch,_0x54ec96,{'method':_0x59b50f['bHYDb'],'headers':_0x4dc3cf,'body':JSON[_0x532022(0x22e)](_0x5b16d0)});if(!_0x3f05fd['ok']){const _0x260381=await _0x3f05fd[_0x532022(0x252)]();throw new Error(_0x532022(0x259)+_0x3f05fd[_0x532022(0x211)]+':\x20'+_0x260381);}return parseResponse(_0x3f05fd);};process[_0x177884(0x1e1)]['write'](_0x177884(0x200));const _0x406085=await _0x59b50f['PfnmT'](_0x52ba8e,{'jsonrpc':'2.0','id':0x1,'method':_0x59b50f[_0x177884(0x25a)],'params':{'protocolVersion':_0x59b50f['XcJxb'],'capabilities':{},'clientInfo':{'name':_0x59b50f[_0x177884(0x270)],'version':_0x59b50f[_0x177884(0x1e9)]}}});if(_0x406085[_0x177884(0x246)])throw new Error(_0x177884(0x265)+(_0x406085[_0x177884(0x246)][_0x177884(0x251)]??JSON[_0x177884(0x22e)](_0x406085[_0x177884(0x246)])));console['log'](_0x177884(0x1fb)),await fetch(_0x54ec96,{'method':_0x177884(0x228),'headers':_0x4dc3cf,'body':JSON[_0x177884(0x22e)]({'jsonrpc':_0x177884(0x27b),'method':'notifications/initialized'})})['then'](_0x1d70a5=>_0x1d70a5[_0x177884(0x252)]()),process['stdout'][_0x177884(0x20f)](_0x177884(0x20b));const _0x20cb04=await _0x52ba8e({'jsonrpc':_0x59b50f['yLhbA'],'id':0x2,'method':_0x59b50f[_0x177884(0x267)],'params':{'name':'get_cli_token','arguments':{}}});if(_0x20cb04[_0x177884(0x246)])throw new Error(_0x177884(0x254)+(_0x20cb04['error'][_0x177884(0x251)]??JSON['stringify'](_0x20cb04[_0x177884(0x246)])));console[_0x177884(0x206)](_0x59b50f[_0x177884(0x236)]);const _0x35e805=extractToken(_0x20cb04['result']);if(!_0x35e805){console['error'](_0x59b50f['pzxHx']),console[_0x177884(0x246)](JSON[_0x177884(0x22e)](_0x20cb04['result'],null,0x2));throw new Error(_0x59b50f['vCyOl']);}const _0x5d8099=join(_0x59b50f[_0x177884(0x234)](homedir),_0x59b50f['jXABl']),_0x5cbea6=join(_0x5d8099,_0x59b50f['euDsR']);await mkdir(_0x5d8099,{'recursive':!![]}),await writeFile(_0x5cbea6,_0x35e805,{'mode':0x180}),await _0x59b50f[_0x177884(0x26a)](writeFile,_0x59b50f[_0x177884(0x1f6)](join,_0x5d8099,'auth-origin.txt'),_0x54ec96,{'mode':0x180}),console['log'](_0x177884(0x226)+_0x5cbea6),console[_0x177884(0x206)]('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0x20241f){const _0x19f272=_0x957390,_0x550029=_0x20241f+_0x19f272(0x257),_0x2ea9da=await fetch(_0x550029);if(!_0x2ea9da['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x550029+':\x20'+_0x2ea9da['status']);return _0x2ea9da[_0x19f272(0x25c)]();}function waitForCallback(_0x4a7c31){const _0x264121=_0x957390,_0x563468={'DVrki':_0x264121(0x238),'LgaXp':'Not\x20found','eeWWe':'state','MsOSK':function(_0x84a3d0,_0x29b00b){return _0x84a3d0(_0x29b00b);},'ldxzP':'text/html','znquX':_0x264121(0x1e5),'OjPCb':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','PADgR':function(_0x20f160,_0x203284){return _0x20f160(_0x203284);},'jJUpU':function(_0x4b76b2){return _0x4b76b2();},'KmQcS':function(_0x1fc51c){return _0x1fc51c();}};return new Promise((_0x4eb031,_0x12dc91)=>{const _0x7961bd=_0x264121,_0x3008e1={'oKNai':function(_0x3d41c2){const _0x57654c=_0x5b46;return _0x563468[_0x57654c(0x23b)](_0x3d41c2);},'OlKIx':function(_0x18b6f2,_0x3505c8){return _0x18b6f2(_0x3505c8);}},_0x363b61=()=>{const _0x12d8d1=_0x5b46;_0xaf83eb['closeAllConnections'](),_0xaf83eb[_0x12d8d1(0x1f1)]();},_0x3ce15a=setTimeout(()=>{const _0x1d42fa=_0x5b46;_0x3008e1['oKNai'](_0x363b61),_0x3008e1['OlKIx'](_0x12dc91,new OAuthTimeoutError(_0x1d42fa(0x239)));},0x1d4c0),_0xaf83eb=_0x563468['PADgR'](createServer,(_0x1de2aa,_0x3c4448)=>{const _0x5a913c=_0x5b46,_0x456095=new URL(_0x1de2aa[_0x5a913c(0x240)]??'/','http://localhost:'+CALLBACK_PORT);if(_0x456095[_0x5a913c(0x202)]!==_0x563468['DVrki']){_0x3c4448['writeHead'](0x194),_0x3c4448['end'](_0x563468[_0x5a913c(0x24d)]);return;}const _0x349e6b=_0x456095['searchParams']['get']('code'),_0x4677b4=_0x456095['searchParams']['get'](_0x563468['eeWWe']),_0x1351e8=_0x456095['searchParams'][_0x5a913c(0x217)](_0x5a913c(0x246));if(_0x1351e8){const _0x56b9f9=_0x456095['searchParams'][_0x5a913c(0x217)]('error_description')??_0x1351e8;_0x3c4448['writeHead'](0xc8,{'Content-Type':'text/html'}),_0x3c4448[_0x5a913c(0x22a)](_0x5a913c(0x26f)+_0x56b9f9+_0x5a913c(0x1e2)),_0x563468['MsOSK'](clearTimeout,_0x3ce15a),_0x363b61(),_0x12dc91(new Error(_0x5a913c(0x1f7)+_0x56b9f9));return;}if(!_0x349e6b||_0x4677b4!==_0x4a7c31){_0x3c4448['writeHead'](0x190,{'Content-Type':_0x563468['ldxzP']}),_0x3c4448['end'](_0x563468['znquX']);return;}_0x3c4448['writeHead'](0xc8,{'Content-Type':_0x5a913c(0x25f)}),_0x3c4448[_0x5a913c(0x22a)](_0x563468[_0x5a913c(0x253)]),_0x563468[_0x5a913c(0x1f8)](clearTimeout,_0x3ce15a),_0x563468['jJUpU'](_0x363b61),_0x4eb031(_0x349e6b);});_0xaf83eb[_0x7961bd(0x216)](CALLBACK_PORT,_0x7961bd(0x1ef));});}async function openBrowser(_0x5a5a26){const _0x1093c6=_0x957390,_0x597621={'MvLCi':function(_0x55b14b,_0x2488e5){return _0x55b14b===_0x2488e5;},'qDfZU':'open','yecfu':function(_0x31987c,_0x3cea04){return _0x31987c===_0x3cea04;},'kOAJk':_0x1093c6(0x222),'jiXzS':function(_0x12d719,_0x223baf){return _0x12d719(_0x223baf);}},_0x4e1e9b=_0x597621['MvLCi'](process[_0x1093c6(0x275)],'darwin')?_0x597621['qDfZU']:_0x597621[_0x1093c6(0x20d)](process['platform'],'win32')?_0x597621[_0x1093c6(0x1eb)]:_0x1093c6(0x25e);_0x597621[_0x1093c6(0x250)](exec,_0x4e1e9b+'\x20\x22'+_0x5a5a26+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x56eefd=_0x957390,_0x576f27={'fvllb':function(_0x3295a2,_0xd2e4e0){return _0x3295a2!==_0xd2e4e0;}};try{const _0x38d40f=JSON['parse'](await readFile(TOKEN_CACHE_PATH,'utf-8'));if(_0x38d40f['origin']&&_0x576f27['fvllb'](_0x38d40f['origin'],currentOrigin))return null;if(_0x38d40f[_0x56eefd(0x273)]&&Date['now']()>_0x38d40f['expiresAt'])return null;return _0x38d40f[_0x56eefd(0x274)]??null;}catch{return null;}}async function saveCachedToken(_0x4ec445,_0x5b42fb,_0x481f01){const _0x1c52c4=_0x957390,_0x1482d3={'BVzLd':function(_0x5ceca7,_0x33cbae){return _0x5ceca7*_0x33cbae;},'JuICJ':function(_0x34b1a4){return _0x34b1a4();}},_0x66620d=await loadCachedData(),_0x267cc3={..._0x66620d,'origin':currentOrigin,'accessToken':_0x4ec445,'refreshToken':_0x5b42fb??_0x66620d?.[_0x1c52c4(0x1fc)],'expiresAt':_0x481f01?Date[_0x1c52c4(0x227)]()+_0x1482d3['BVzLd'](_0x481f01,0x3e8):undefined};await mkdir(join(_0x1482d3['JuICJ'](homedir),_0x1c52c4(0x1df)),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x1c52c4(0x22e)](_0x267cc3),{'mode':0x180});}async function loadCachedClient(){const _0x512e5d=_0x957390,_0x5c22d0={'jMNsb':function(_0x5ba777,_0x593fd0){return _0x5ba777!==_0x593fd0;}},_0x2c0a96=await loadCachedData();if(_0x2c0a96?.['origin']&&_0x5c22d0['jMNsb'](_0x2c0a96[_0x512e5d(0x231)],currentOrigin))return null;return _0x2c0a96?.['clientId']?{'clientId':_0x2c0a96['clientId'],'clientSecret':_0x2c0a96['clientSecret']}:null;}async function clearCachedClient(){const _0xda9dbe=_0x957390,_0x23e132={'ejFhn':function(_0x32e637){return _0x32e637();},'Mitsv':function(_0x3d4566,_0x5bd262,_0x4a3812,_0x4a1609){return _0x3d4566(_0x5bd262,_0x4a3812,_0x4a1609);}},_0x15b66b=await _0x23e132['ejFhn'](loadCachedData);if(!_0x15b66b)return;const {clientId:_0xdbfd1c,clientSecret:_0x5613ea,..._0x2c53dd}=_0x15b66b;await _0x23e132[_0xda9dbe(0x256)](writeFile,TOKEN_CACHE_PATH,JSON[_0xda9dbe(0x22e)](_0x2c53dd),{'mode':0x180});}async function saveCachedClient(_0x55d2dc,_0x1a67d5){const _0xdfae=_0x957390,_0x3c1373={'TSpaJ':function(_0x1a3af1,_0x2f93ff,_0x5668ac,_0x4f2dda){return _0x1a3af1(_0x2f93ff,_0x5668ac,_0x4f2dda);}},_0x3cebb7=await loadCachedData(),_0x24c443={..._0x3cebb7,'origin':currentOrigin,'accessToken':_0x3cebb7?.[_0xdfae(0x274)]??'','clientId':_0x55d2dc,'clientSecret':_0x1a67d5};await mkdir(join(homedir(),'.ranger'),{'recursive':!![]}),await _0x3c1373[_0xdfae(0x1ee)](writeFile,TOKEN_CACHE_PATH,JSON[_0xdfae(0x22e)](_0x24c443),{'mode':0x180});}async function loadCachedData(){const _0x284b4a=_0x957390,_0x523ffc={'CdUyZ':function(_0xdf60d1,_0x40716c,_0x2c50d1){return _0xdf60d1(_0x40716c,_0x2c50d1);},'egZXM':_0x284b4a(0x1fa)};try{return JSON[_0x284b4a(0x232)](await _0x523ffc['CdUyZ'](readFile,TOKEN_CACHE_PATH,_0x523ffc['egZXM']));}catch{return null;}}async function parseResponse(_0x313db5){const _0x118d7c=_0x957390,_0x26f859={'kapFs':_0x118d7c(0x1e0),'adSfj':_0x118d7c(0x258)},_0x421251=_0x313db5['headers']['get'](_0x26f859[_0x118d7c(0x1ff)])??'';if(_0x421251[_0x118d7c(0x1f0)](_0x118d7c(0x24b))){const _0x35d3ad=await _0x313db5[_0x118d7c(0x252)]();for(const _0xbcefe6 of _0x35d3ad[_0x118d7c(0x261)]('\x0a')){const _0x5ee6cd=_0xbcefe6['trim']();if(_0x5ee6cd[_0x118d7c(0x244)]('data:')){const _0x2bb231=_0x5ee6cd[_0x118d7c(0x249)]('data:'['length'])[_0x118d7c(0x243)]();if(!_0x2bb231)continue;try{const _0x2aa38f=JSON['parse'](_0x2bb231);if(_0x2aa38f['id']!==undefined||_0x2aa38f[_0x118d7c(0x246)])return _0x2aa38f;}catch{}}}throw new Error(_0x26f859['adSfj']);}return _0x313db5[_0x118d7c(0x25c)]();}function extractToken(_0x4343ae){const _0x59ed8d=_0x957390,_0x574325={'Mybsc':function(_0x213480,_0x22c524){return _0x213480===_0x22c524;},'TJUUC':_0x59ed8d(0x252),'Oyrsd':'string'};if(!_0x4343ae)return null;const _0x20b377=_0x4343ae[_0x59ed8d(0x278)];if(_0x20b377?.['token']&&typeof _0x20b377['token']===_0x59ed8d(0x1ed))return _0x20b377[_0x59ed8d(0x21e)];if(_0x4343ae['isError']){const _0x34baf7=_0x4343ae['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x34baf7?.[0x0]?.[_0x59ed8d(0x252)]??_0x59ed8d(0x22b)));}const _0x16b1aa=_0x4343ae[_0x59ed8d(0x20e)];if(_0x16b1aa)for(const _0x3c2a75 of _0x16b1aa){if(_0x574325['Mybsc'](_0x3c2a75['type'],_0x574325[_0x59ed8d(0x268)])&&_0x3c2a75[_0x59ed8d(0x252)]){try{const _0x1ee3af=JSON[_0x59ed8d(0x232)](_0x3c2a75['text']);if(typeof _0x1ee3af?.[_0x59ed8d(0x21e)]===_0x574325['Oyrsd'])return _0x1ee3af[_0x59ed8d(0x21e)];}catch{}const _0x5ba70e=_0x3c2a75[_0x59ed8d(0x252)][_0x59ed8d(0x266)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x5ba70e)return _0x5ba70e[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4e9376,_0x5ce5c6){var _0x473115=_0x17cd,_0x50f578=_0x4e9376();while(!![]){try{var _0x5e786b=parseInt(_0x473115(0xa9))/0x1*(parseInt(_0x473115(0xa7))/0x2)+-parseInt(_0x473115(0xb1))/0x3+parseInt(_0x473115(0xac))/0x4+-parseInt(_0x473115(0xaa))/0x5+-parseInt(_0x473115(0xab))/0x6*(parseInt(_0x473115(0xb0))/0x7)+parseInt(_0x473115(0xaf))/0x8*(-parseInt(_0x473115(0xa6))/0x9)+-parseInt(_0x473115(0xae))/0xa*(-parseInt(_0x473115(0xb2))/0xb);if(_0x5e786b===_0x5ce5c6)break;else _0x50f578['push'](_0x50f578['shift']());}catch(_0xf68b71){_0x50f578['push'](_0x50f578['shift']());}}}(_0x58e2,0x84a1e));function _0x17cd(_0x660deb,_0x1ec127){_0x660deb=_0x660deb-0xa5;var _0x58e283=_0x58e2();var _0x17cd71=_0x58e283[_0x660deb];return _0x17cd71;}export async function migrateProfile(_0x258322,_0x22b716){var _0x2f052f=_0x17cd,_0x2e5fac={'QmJix':function(_0x356d18,_0x4bb847){return _0x356d18+_0x4bb847;},'mvLgl':function(_0x28736f,_0x10e92a){return _0x28736f+_0x10e92a;},'rImMP':function(_0x13f599,_0x46beb0){return _0x13f599+_0x46beb0;},'yjLgq':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','KELoW':_0x2f052f(0xad)};console['error'](_0x2e5fac[_0x2f052f(0xb3)](_0x2e5fac[_0x2f052f(0xb3)](_0x2e5fac['mvLgl'](_0x2e5fac[_0x2f052f(0xb3)](_0x2e5fac['rImMP'](_0x2f052f(0xa8),'\x0a')+_0x2e5fac['yjLgq'],'\x20\x20ranger\x20profile\x20add\x20<name>\x0a')+'\x0a'+'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a',_0x2e5fac[_0x2f052f(0xa5)])+'\x0a','Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a'),'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.')),process['exit'](0x1);}function _0x58e2(){var _0x4fe8ea=['KELoW','215235wGYZie','4xDAJyk','ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','8731hHHdaQ','1381670aaBigs','6uvvJsK','3684536CbvBuh','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','255430NMGjhG','24ysckwr','4260424QXbXqH','921255RdWuOX','374VbrZvn','QmJix'];_0x58e2=function(){return _0x4fe8ea;};return _0x58e2();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x19f21e,_0x4e3645){const _0x56be21=_0x4c7d,_0x27830f=_0x19f21e();while(!![]){try{const _0x38d353=-parseInt(_0x56be21(0x17e))/0x1*(-parseInt(_0x56be21(0x17f))/0x2)+-parseInt(_0x56be21(0x15a))/0x3+-parseInt(_0x56be21(0x170))/0x4+parseInt(_0x56be21(0x174))/0x5+-parseInt(_0x56be21(0x172))/0x6*(parseInt(_0x56be21(0x15d))/0x7)+-parseInt(_0x56be21(0x159))/0x8*(parseInt(_0x56be21(0x17b))/0x9)+parseInt(_0x56be21(0x164))/0xa;if(_0x38d353===_0x4e3645)break;else _0x27830f['push'](_0x27830f['shift']());}catch(_0x2d4948){_0x27830f['push'](_0x27830f['shift']());}}}(_0x2fd6,0xf2c61));import{join}from'path';import{existsSync}from'fs';import _0x1ad4de from'inquirer';function _0x4c7d(_0x970f22,_0xfcd1cd){_0x970f22=_0x970f22-0x157;const _0x2fd6b6=_0x2fd6();let _0x4c7dc9=_0x2fd6b6[_0x970f22];return _0x4c7dc9;}import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x52c041){const _0x316edb=_0x4c7d,_0x3af656={'zKaoc':function(_0x27820b,_0x13c0f1){return _0x27820b(_0x13c0f1);},'NvWLu':_0x316edb(0x169),'mPDXW':function(_0x473cf2,_0x2600ca){return _0x473cf2(_0x2600ca);},'WIVvf':function(_0x368dba,_0x565ee6,_0x3093d2){return _0x368dba(_0x565ee6,_0x3093d2);},'iSqkQ':function(_0x52b829){return _0x52b829();},'YgJLO':'.claude','aquLA':'project','lhQbl':_0x316edb(0x16d),'lgcRy':_0x316edb(0x18c),'eFrok':'Where\x20should\x20the\x20plugin\x20be\x20installed?','vhuuP':'user','MVAtU':_0x316edb(0x18d),'nLtiE':'plugin','lWfCa':'marketplace','tmHIO':'add','YWEDh':_0x316edb(0x188),'HXMSx':function(_0x1331dc,_0x2e354e,_0x2d88e8){return _0x1331dc(_0x2e354e,_0x2d88e8);},'eBUBO':'install','kOaKs':_0x316edb(0x161),'DSwiu':'❌\x20Failed\x20to\x20install\x20plugin:','OrRGi':'enable','WcNtR':function(_0x426f13,_0x51782c){return _0x426f13===_0x51782c;}},_0x5411c2=await _0x3af656[_0x316edb(0x171)](isPluginInstalled,_0x3af656[_0x316edb(0x17c)]);if(_0x5411c2)return console[_0x316edb(0x16c)]('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];const _0x3fce7e=_0x3af656['mPDXW'](existsSync,_0x3af656[_0x316edb(0x178)](join,_0x3af656[_0x316edb(0x189)](getProjectRoot),_0x3af656['YgJLO']));let _0x33d7f1;if(_0x52c041)_0x33d7f1=_0x52c041;else{if(_0x3fce7e)_0x33d7f1=_0x3af656[_0x316edb(0x183)];else{console[_0x316edb(0x16c)](_0x3af656['lhQbl']);const _0x14ed53=await _0x1ad4de['prompt']([{'type':_0x3af656[_0x316edb(0x163)],'name':_0x316edb(0x190),'message':_0x3af656[_0x316edb(0x165)],'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x3af656['vhuuP']},{'name':_0x316edb(0x179),'value':_0x3af656['aquLA']}],'default':'user'}]);_0x33d7f1=_0x14ed53['pluginScope'];}}console['log'](_0x316edb(0x187)+_0x33d7f1+'\x20level)...\x0a');const _0x4c7898=await isMarketplaceAdded(_0x3af656[_0x316edb(0x16b)]);let _0x29acb0=_0x4c7898;if(_0x4c7898)console[_0x316edb(0x16c)](_0x316edb(0x168));else{const _0x1118a4=await runClaudeCommand([_0x3af656[_0x316edb(0x182)],_0x3af656['lWfCa'],_0x3af656[_0x316edb(0x184)],_0x316edb(0x15c)]);!_0x1118a4[_0x316edb(0x16a)]?(console[_0x316edb(0x160)]('❌\x20Failed\x20to\x20add\x20marketplace:',_0x1118a4['error']),console[_0x316edb(0x16c)](_0x316edb(0x181)),console[_0x316edb(0x16c)](_0x3af656[_0x316edb(0x18a)]),console[_0x316edb(0x16c)](_0x316edb(0x18f)+_0x33d7f1)):_0x29acb0=!![];}if(_0x29acb0){const _0x531e0f=await _0x3af656['HXMSx'](runClaudeCommand,[_0x316edb(0x15b),_0x3af656['eBUBO'],_0x3af656[_0x316edb(0x17c)],_0x3af656[_0x316edb(0x17d)],_0x33d7f1],{'cwd':_0x33d7f1==='project'?getProjectRoot():undefined});if(!_0x531e0f[_0x316edb(0x16a)])console[_0x316edb(0x160)](_0x3af656[_0x316edb(0x186)],_0x531e0f[_0x316edb(0x160)]),console[_0x316edb(0x16c)](_0x316edb(0x181)),console['log'](_0x316edb(0x18f)+_0x33d7f1);else{console['log'](_0x316edb(0x180));const _0x16d3ab=[_0x316edb(0x15b),_0x3af656[_0x316edb(0x16f)],_0x3af656['NvWLu']];_0x33d7f1===_0x316edb(0x173)&&_0x16d3ab['push'](_0x316edb(0x161),_0x3af656['aquLA']);const _0x33a8d2=await runClaudeCommand(_0x16d3ab,{'captureOutput':!![],'cwd':_0x3af656[_0x316edb(0x18e)](_0x33d7f1,_0x3af656['aquLA'])?_0x3af656[_0x316edb(0x189)](getProjectRoot):undefined}),_0x59ba20=_0x33a8d2['output']?.['includes'](_0x316edb(0x18b));!_0x33a8d2[_0x316edb(0x16a)]&&!_0x59ba20?console['error']('⚠\x20Failed\x20to\x20enable\x20plugin:',_0x33a8d2[_0x316edb(0x160)]):console['log'](_0x316edb(0x175));}}return!![];}export async function ensureClaudeSkills(_0x590790){const _0xfa9f81=_0x4c7d,_0x3648bb={'DqEAt':function(_0x27d23b,_0x55f75f){return _0x27d23b(_0x55f75f);},'yjRCC':_0xfa9f81(0x177),'VCknD':_0xfa9f81(0x15e),'SyXBU':_0xfa9f81(0x173),'hDRbV':'SKILL.md','YDLyT':function(_0xf12c4b,_0x3791f7){return _0xf12c4b||_0x3791f7;},'UTPFK':_0xfa9f81(0x162),'vfURW':function(_0x315076,_0x352b68){return _0x315076(_0x352b68);},'dZHDd':function(_0x437141,_0x2e8d4d,_0x144321){return _0x437141(_0x2e8d4d,_0x144321);},'muAzV':'wantsSkillup'},_0x488692=existsSync(join(_0x3648bb[_0xfa9f81(0x158)](getSkillsDir,_0x3648bb['yjRCC']),_0x3648bb[_0xfa9f81(0x16e)],_0xfa9f81(0x15f))),_0x2535df=existsSync(join(getSkillsDir(_0x3648bb['SyXBU']),_0xfa9f81(0x15e),_0x3648bb[_0xfa9f81(0x176)]));if(_0x3648bb[_0xfa9f81(0x185)](_0x488692,_0x2535df))return console[_0xfa9f81(0x16c)](_0x3648bb['UTPFK']),![];const _0x10afa7=_0x3648bb[_0xfa9f81(0x166)](existsSync,_0x3648bb['dZHDd'](join,getProjectRoot(),'.claude'));let _0x381333=!![];if(_0x590790)await skillup({'autoInstall':_0x590790,'suppressUsage':!![]});else{if(_0x10afa7)await skillup({'autoInstall':_0x3648bb[_0xfa9f81(0x157)],'suppressUsage':!![]});else{const _0x4e033f=await _0x1ad4de['prompt']([{'type':'confirm','name':_0x3648bb['muAzV'],'message':_0xfa9f81(0x167),'default':!![]}]);_0x381333=_0x4e033f[_0xfa9f81(0x17a)],_0x381333&&await skillup({'suppressUsage':!![]});}}return _0x381333;}function _0x2fd6(){const _0x24e4af=['4259874xbkgtp','plugin','ranger-testing/trailhead','7OdqBKY','ranger','SKILL.md','error','--scope','✓\x20Ranger\x20skills\x20already\x20installed','lgcRy','30126340VZlEwk','eFrok','vfURW','Would\x20you\x20like\x20to\x20install\x20skills?','✓\x20Marketplace\x20already\x20added','ranger@trailhead','success','MVAtU','log','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','VCknD','OrRGi','689560NfIkPU','zKaoc','6758742LIBgvq','project','86595iJcifh','✓\x20Claude\x20Code\x20plugin\x20enabled','hDRbV','user','WIVvf','Project\x20(shared\x20with\x20team\x20via\x20git)','wantsSkillup','144hwbjVo','NvWLu','kOaKs','1MxxeMv','2681962jYsUAz','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','\x0aYou\x20can\x20install\x20manually\x20with:','nLtiE','aquLA','tmHIO','YDLyT','DSwiu','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','iSqkQ','YWEDh','already\x20enabled','list','trailhead','WcNtR','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','pluginScope','SyXBU','DqEAt','328864orvbfP'];_0x2fd6=function(){return _0x24e4af;};return _0x2fd6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4337ab,_0x4a92bc){const _0x59df6a=_0x1ca4,_0x378983=_0x4337ab();while(!![]){try{const _0x48d7d9=parseInt(_0x59df6a(0x1e6))/0x1+-parseInt(_0x59df6a(0x1d6))/0x2+parseInt(_0x59df6a(0x1da))/0x3*(parseInt(_0x59df6a(0x1ea))/0x4)+parseInt(_0x59df6a(0x1d7))/0x5*(parseInt(_0x59df6a(0x1e9))/0x6)+parseInt(_0x59df6a(0x1f1))/0x7+-parseInt(_0x59df6a(0x1ef))/0x8*(parseInt(_0x59df6a(0x1e8))/0x9)+-parseInt(_0x59df6a(0x1de))/0xa*(-parseInt(_0x59df6a(0x1f2))/0xb);if(_0x48d7d9===_0x4a92bc)break;else _0x378983['push'](_0x378983['shift']());}catch(_0x22ffdf){_0x378983['push'](_0x378983['shift']());}}}(_0x2b51,0xa9e55));function _0x2b51(){const _0x497726=['1748828AtUYBC','isArray','opencode.json','gVkmK','Failed\x20to\x20read\x20opencode.json','8hePowc','\x0a📦\x20OpenCode\x20Plugin\x0a','996982UDOzEe','612095ieIiwu','utf-8','fItXM','LNhCL','FiohA','1230678kTvnGP','763025lnFpab','QVmjo','cVlKr','3YSrdHZ','xSHli','YbbtU','user','20FGYwuB','zsUxF','ZYQBB','plugin','$schema','log','https://opencode.ai/config.json','@ranger-testing/opencode-plugin','837852hUSBwT','project','8825112cGDAed','30lXgSue'];_0x2b51=function(){return _0x497726;};return _0x2b51();}import{join}from'path';import{existsSync}from'fs';function _0x1ca4(_0x4d30ce,_0x4d3c59){_0x4d30ce=_0x4d30ce-0x1d3;const _0x2b51bf=_0x2b51();let _0x1ca4e2=_0x2b51bf[_0x4d30ce];return _0x1ca4e2;}import{mkdir,readFile,writeFile}from'fs/promises';import _0x5b6fe3 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x321efe){const _0x2d3bcc=_0x1ca4,_0x174418={'QVmjo':_0x2d3bcc(0x1e7),'gVkmK':_0x2d3bcc(0x1f0),'ZYQBB':'Project\x20(shared\x20with\x20team\x20via\x20git)','LNhCL':_0x2d3bcc(0x1dd),'FiohA':function(_0x21d6b5,_0x4e646c){return _0x21d6b5(_0x4e646c);},'YbbtU':'opencode.json','BUQUJ':_0x2d3bcc(0x1e4),'kqpqy':function(_0x283f87,_0x8ee817,_0x314ac3){return _0x283f87(_0x8ee817,_0x314ac3);},'zsUxF':_0x2d3bcc(0x1f3),'fItXM':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','cVlKr':_0x2d3bcc(0x1ee),'xSHli':'✓\x20OpenCode\x20plugin\x20already\x20configured','YrGjt':function(_0x240103,_0x5cf93e,_0x44b802){return _0x240103(_0x5cf93e,_0x44b802);}},_0x45df0a=existsSync(join(getOpencodeConfigDir(_0x174418[_0x2d3bcc(0x1d8)]),_0x2d3bcc(0x1ec)));let _0x15f990;if(_0x321efe)_0x15f990=_0x321efe;else{if(_0x45df0a)_0x15f990=_0x174418['QVmjo'];else{console[_0x2d3bcc(0x1e3)](_0x174418[_0x2d3bcc(0x1ed)]);const _0x206e5a=await _0x5b6fe3['prompt']([{'type':'list','name':'pluginScope','message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x2d3bcc(0x1dd)},{'name':_0x174418[_0x2d3bcc(0x1e0)],'value':_0x2d3bcc(0x1e7)}],'default':_0x174418[_0x2d3bcc(0x1d4)]}]);_0x15f990=_0x206e5a['pluginScope'];}}const _0x59eb54=join(_0x174418[_0x2d3bcc(0x1d5)](getOpencodeConfigDir,_0x15f990),_0x174418[_0x2d3bcc(0x1dc)]),_0x4af081=_0x2d3bcc(0x1e5),_0x589afb=_0x174418['BUQUJ'];let _0x42e465={};if(_0x174418['FiohA'](existsSync,_0x59eb54))try{const _0x333ee4=await _0x174418['kqpqy'](readFile,_0x59eb54,_0x174418[_0x2d3bcc(0x1df)]);_0x42e465=JSON['parse'](_0x333ee4);}catch(_0x483116){return console['error'](_0x174418[_0x2d3bcc(0x1d3)]),{'configured':![],'scope':_0x15f990,'error':_0x174418[_0x2d3bcc(0x1d9)],'details':_0x483116};}const _0x139dbb=Array[_0x2d3bcc(0x1eb)](_0x42e465['plugin'])?_0x42e465[_0x2d3bcc(0x1e1)]:[];if(_0x139dbb['includes'](_0x4af081))return console[_0x2d3bcc(0x1e3)](_0x174418[_0x2d3bcc(0x1db)]),{'configured':![],'scope':_0x15f990};return _0x42e465[_0x2d3bcc(0x1e2)]=_0x42e465['$schema']||_0x589afb,_0x42e465[_0x2d3bcc(0x1e1)]=[..._0x139dbb,_0x4af081],await mkdir(getOpencodeConfigDir(_0x15f990),{'recursive':!![]}),await _0x174418['YrGjt'](writeFile,_0x59eb54,JSON['stringify'](_0x42e465,null,0x2)+'\x0a'),console['log']('✓\x20OpenCode\x20plugin\x20configured'),{'configured':!![],'scope':_0x15f990};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x793f(_0x3328ca,_0x99eb1){_0x3328ca=_0x3328ca-0x158;var _0x1133ec=_0x1133();var _0x793f82=_0x1133ec[_0x3328ca];return _0x793f82;}(function(_0x16254b,_0x1d7a24){var _0x4d9fe2=_0x793f,_0x246b8a=_0x16254b();while(!![]){try{var _0x5dd772=-parseInt(_0x4d9fe2(0x158))/0x1+parseInt(_0x4d9fe2(0x160))/0x2+-parseInt(_0x4d9fe2(0x15e))/0x3+parseInt(_0x4d9fe2(0x15f))/0x4+parseInt(_0x4d9fe2(0x15c))/0x5+parseInt(_0x4d9fe2(0x15d))/0x6+-parseInt(_0x4d9fe2(0x161))/0x7;if(_0x5dd772===_0x1d7a24)break;else _0x246b8a['push'](_0x246b8a['shift']());}catch(_0x39d681){_0x246b8a['push'](_0x246b8a['shift']());}}}(_0x1133,0x28ed5));export async function setupCi(_0x21895f,_0x540ec6,_0x3efe38){var _0x2e45ac=_0x793f,_0x2ebdda={'VgWOC':function(_0x3fa96e,_0x3b27ea){return _0x3fa96e+_0x3b27ea;}};console['error'](_0x2ebdda[_0x2e45ac(0x15a)](_0x2ebdda[_0x2e45ac(0x15a)](_0x2ebdda[_0x2e45ac(0x15a)](_0x2e45ac(0x159)+'\x0a'+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a',_0x2e45ac(0x15b)),'\x0a')+'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','\x20\x20https://docs.ranger.net/main/concepts/profiles')),process[_0x2e45ac(0x162)](0x1);}function _0x1133(){var _0x15f4fc=['91314VbeRgB','112263ajLmVb','872416XnxyVR','416648MbDIgR','1320025mTcKSe','exit','303539hnCDeP','ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','VgWOC','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','1277625yhPFWN'];_0x1133=function(){return _0x15f4fc;};return _0x1133();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x59ffc3,_0x29301e){const _0x2d37e5=_0x1e74,_0x322df6=_0x59ffc3();while(!![]){try{const _0x240b2e=-parseInt(_0x2d37e5(0xe1))/0x1+parseInt(_0x2d37e5(0xe6))/0x2*(parseInt(_0x2d37e5(0xd5))/0x3)+parseInt(_0x2d37e5(0x101))/0x4*(parseInt(_0x2d37e5(0xf3))/0x5)+parseInt(_0x2d37e5(0xfd))/0x6*(parseInt(_0x2d37e5(0xd8))/0x7)+-parseInt(_0x2d37e5(0xfc))/0x8*(parseInt(_0x2d37e5(0xe2))/0x9)+parseInt(_0x2d37e5(0xf9))/0xa*(-parseInt(_0x2d37e5(0xe8))/0xb)+parseInt(_0x2d37e5(0xed))/0xc*(parseInt(_0x2d37e5(0xeb))/0xd);if(_0x240b2e===_0x29301e)break;else _0x322df6['push'](_0x322df6['shift']());}catch(_0x36552a){_0x322df6['push'](_0x322df6['shift']());}}}(_0x5d44,0x826aa));import{basename}from'path';import _0x390ffe from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';function _0x1e74(_0x3963bb,_0x3cb604){_0x3963bb=_0x3963bb-0xd5;const _0x5d4463=_0x5d44();let _0x1e74ae=_0x5d4463[_0x3963bb];return _0x1e74ae;}function _0x5d44(){const _0x20b80f=['\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!','24WhUZYu','156468KyYCnk','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','\x20--opencode','4rhWbrF','All\x20projects\x20(','1569YYCybk','list','user-level','7IkAbsj','project','UXHQe','NVGyX','NFmBG','platform','pBmKy','\x20successfully!\x0a','eySTf','1047424AZKvkj','21843psGTrA','qDPhp','warn','ZjUTE','1822NzNqbV','To\x20get\x20started:','1760zIwnkS','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','Where\x20should\x20skills\x20be\x20installed?','26AqALWj','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','5674572ZTNbOB','prompt','/.opencode/skills/','/skills/','ranger','PlDjo','2578990YELOBc','qBkbW','isTTY','\x20skill','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','SeTdh','23450tOmcVR','log'];_0x5d44=function(){return _0x20b80f;};return _0x5d44();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x29f23a={}){const _0x2904e9=_0x1e74,_0x391fee={'JLSKZ':'\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','wAiTU':'claude','NFmBG':'\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','NVGyX':'opencode','IViae':'\x20--opencode','ZjUTE':function(_0x430bd5,_0x3a4442){return _0x430bd5===_0x3a4442;},'eySTf':function(_0x4cbfb4,_0x4ee395){return _0x4cbfb4(_0x4ee395);},'UXHQe':'user','qBkbW':function(_0x2e9279,_0xcf9912){return _0x2e9279===_0xcf9912;},'yQEyY':_0x2904e9(0xea),'SeTdh':'\x0a📦\x20Installing\x20skills...\x0a','GPpUe':_0x2904e9(0xf1),'PlDjo':function(_0x4135d2,_0x565c25){return _0x4135d2>_0x565c25;},'qDPhp':_0x2904e9(0xd7),'pBmKy':function(_0x24fe33,_0x539059){return _0x24fe33>_0x539059;}};console[_0x2904e9(0xfa)](_0x391fee['JLSKZ']);const _0xd0f1f9=_0x29f23a[_0x2904e9(0xdd)]??_0x391fee['wAiTU'],_0x93ba77=await getToken();if(!_0x93ba77){console[_0x2904e9(0xfa)](_0x2904e9(0xff)),console['log'](_0x2904e9(0xe7)),console['log'](_0x391fee[_0x2904e9(0xdc)]),console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0xd0f1f9===_0x391fee[_0x2904e9(0xdb)]?_0x391fee['IViae']:'')+'\x20<your-api-token>'),console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x391fee[_0x2904e9(0xe5)](_0xd0f1f9,_0x391fee['NVGyX'])?_0x2904e9(0x100):'')+'\x0a');return;}console['log']('✓\x20Found\x20API\x20token');const _0xf24e9c=getProjectRoot(),_0x459eec=_0x391fee[_0x2904e9(0xe0)](basename,_0xf24e9c),_0x2ae00b=_0xd0f1f9===_0x391fee['NVGyX']?getOpencodeConfigDir(_0x391fee['UXHQe'])+_0x2904e9(0xf0):getClaudeConfigDir()+_0x2904e9(0xf0),_0x59f8d3=_0x391fee['qBkbW'](_0xd0f1f9,'opencode')?_0xf24e9c+_0x2904e9(0xef):_0xf24e9c+'/.claude/skills/',_0x2ffc1d=process['stdin'][_0x2904e9(0xf5)]&&process['stdout']['isTTY'];let _0x26e545;if(_0x29f23a['autoInstall'])_0x26e545=_0x29f23a['autoInstall'];else{if(_0x2ffc1d){const _0x8cc84d=await _0x390ffe[_0x2904e9(0xee)]([{'type':_0x2904e9(0xd6),'name':'installLevel','message':_0x391fee['yQEyY'],'choices':[{'name':_0x2904e9(0x102)+_0x2ae00b+')','value':'user'},{'name':'This\x20project\x20only\x20('+_0x59f8d3+')','value':'project'}]}]);_0x26e545=_0x8cc84d['installLevel'];}else _0x26e545=_0x2904e9(0xd9),console['log'](_0x2904e9(0xec)+_0x59f8d3+')');}let _0x33bb43=0x0;const _0x884cd0=getCurrentVersion();console[_0x2904e9(0xfa)](_0x391fee[_0x2904e9(0xf8)]);try{const _0x5a8981=await installSkill(_0x391fee['GPpUe'],{'cliVersion':_0x884cd0,'level':_0x26e545,'platform':_0xd0f1f9});_0x5a8981&&_0x33bb43++;}catch(_0x2f9397){console[_0x2904e9(0xe4)](_0x2904e9(0xf7),_0x2f9397 instanceof Error?_0x2f9397['message']:_0x2f9397);}if(_0x391fee[_0x2904e9(0xf2)](_0x33bb43,0x0)){const _0x2f711c=_0x391fee['qBkbW'](_0x26e545,_0x391fee[_0x2904e9(0xda)])?_0x391fee[_0x2904e9(0xe3)]:'project-level';console['log']('\x0a✅\x20Installed\x20'+_0x33bb43+'\x20'+_0x2f711c+_0x2904e9(0xf6)+(_0x391fee[_0x2904e9(0xde)](_0x33bb43,0x1)?'s':'')+_0x2904e9(0xdf)),!_0x29f23a['suppressUsage']&&(console[_0x2904e9(0xfa)]('To\x20use:'),_0x391fee[_0x2904e9(0xf4)](_0xd0f1f9,'opencode')?console['log'](_0x2904e9(0xe9)):console['log'](_0x2904e9(0xfb)));}else console[_0x2904e9(0xfa)](_0x2904e9(0xfe));}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5071b4=_0xa611;(function(_0x481740,_0x2269b7){const _0x89418=_0xa611,_0x182230=_0x481740();while(!![]){try{const _0x396d11=parseInt(_0x89418(0xc2))/0x1*(parseInt(_0x89418(0xaf))/0x2)+-parseInt(_0x89418(0xe1))/0x3+-parseInt(_0x89418(0xda))/0x4*(-parseInt(_0x89418(0xe2))/0x5)+-parseInt(_0x89418(0xb0))/0x6*(-parseInt(_0x89418(0xa8))/0x7)+parseInt(_0x89418(0xf9))/0x8*(parseInt(_0x89418(0xe0))/0x9)+parseInt(_0x89418(0xbd))/0xa*(parseInt(_0x89418(0xb4))/0xb)+parseInt(_0x89418(0xe9))/0xc*(-parseInt(_0x89418(0xf2))/0xd);if(_0x396d11===_0x2269b7)break;else _0x182230['push'](_0x182230['shift']());}catch(_0x23bd5a){_0x182230['push'](_0x182230['shift']());}}}(_0xea47,0x56cf9));function _0xa611(_0x2b0afe,_0x5b400d){_0x2b0afe=_0x2b0afe-0x98;const _0xea47fc=_0xea47();let _0xa61153=_0xea47fc[_0x2b0afe];return _0xa61153;}import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x43049a 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=_0x5071b4(0xf6);function _0xea47(){const _0x42f9ae=['You\x20can\x20install\x20it\x20manually\x20by\x20running:','Authentication\x20failed:\x20','GITHUB_ENV','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','68agyVxJ','knxHp','scope','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','ranger\x20profile\x20add\x20<name>','oAZhu','UEdit','NwUiA','npx','success','slopL','chromium','version','\x0a❌\x20Profile\x20setup\x20failed:','allowInsecureLocalhost','yMJMQ','bBeQr','✓\x20Playwright\x20Chromium\x20browser\x20found','inherit','FmlcH','skipped','QKGIC','vtlOh','\x20is\x20no\x20longer\x20supported.\x20','20paSrti','skipChromium','error','trackPhaseStart','user','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','126HfjlZs','243249TMYodR','566025KtBimk','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','SjFTn','auth','platform','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','\x0a\x20\x20','1291692jlSLzs','kUDzj','CfZEL','✓\x20Created\x20.ranger/.gitignore','\x20install\x20chromium','install','✓\x20Created\x20~/.ranger/\x20directory','trackPhaseEnd','HqZxD','208ygWmCz','AgJEo','naVBn','message','1.58.2','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','cQQqe','218096DiXzlq','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','The\x20required\x20version\x20(','opencode','exit','PgtdA','close','aqvvA','nBycZ','ranger','status','warn','/ranger:enable','oRKpd','resolve','log','playwright/package.json','CQPsA','url','VDkpv','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','organizationName','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','✓\x20Exported\x20credentials\x20for\x20CI','2254nhiPDv','joiio','\x0a🚀\x20Ranger\x20Setup\x0a',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','.gitignore','\x0aIn\x20Claude\x20Code,\x20run\x20','isTTY','6158EXQkRP','8106GmxFSM','✓\x20~/.ranger/\x20directory\x20already\x20exists','ignore','cipvg','11cSmQRo','✓\x20Authenticated\x20to\x20','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','\x0a⚠\x20Skipping\x20Chromium\x20installation.','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','plugin','zFRtL','provided_token','prompt','5668290ycyDDi'];_0xea47=function(){return _0x42f9ae;};return _0xea47();}const bold=_0x113809=>'\x1b[1m'+_0x113809+'\x1b[0m';export function getPlaywrightVersion(){const _0x4e5837=_0x5071b4,_0x4f2d70={'AgJEo':_0x4e5837(0x9f),'aqvvA':function(_0x3327bf,_0x4444b9){return _0x3327bf(_0x4444b9);}};try{const _0x3421c9=require[_0x4e5837(0x9d)](_0x4f2d70[_0x4e5837(0xf3)]),_0x48f374=_0x4f2d70[_0x4e5837(0x100)](require,_0x3421c9);return _0x48f374[_0x4e5837(0xce)];}catch{return null;}}export function installChromiumBinary(_0x1aaa73,_0x3e5832=![]){const _0x4ffbbd=_0x5071b4,_0x35c3a9={'joiio':function(_0x3c286e,_0x39bd45){return _0x3c286e(_0x39bd45);},'VabGo':_0x4ffbbd(0xee),'slopL':_0x4ffbbd(0xcd),'yVALp':function(_0x4b0c2d,_0x59454d,_0x5b3ade,_0x2015bb){return _0x4b0c2d(_0x59454d,_0x5b3ade,_0x2015bb);},'qfqKr':_0x4ffbbd(0xb2),'FmlcH':_0x4ffbbd(0xd4),'guwcN':'win32','SjFTn':_0x4ffbbd(0xff),'YcaRO':'error'};return new Promise((_0x35d6c5,_0xe47e9d)=>{const _0xe49cfd=_0x4ffbbd,_0x33f688=['playwright@'+_0x1aaa73,_0x35c3a9['VabGo'],..._0x3e5832?['--with-deps']:[],_0x35c3a9[_0xe49cfd(0xcc)]],_0x140478=_0x35c3a9['yVALp'](spawn,_0xe49cfd(0xca),_0x33f688,{'stdio':[_0x35c3a9['qfqKr'],_0x35c3a9[_0xe49cfd(0xd5)],_0x35c3a9['FmlcH']],'shell':process[_0xe49cfd(0xe6)]===_0x35c3a9['guwcN']});_0x140478['on'](_0x35c3a9[_0xe49cfd(0xe4)],_0x3d68f5=>{const _0x372b27=_0xe49cfd;_0x3d68f5===0x0?_0x35d6c5():_0x35c3a9[_0x372b27(0xa9)](_0xe47e9d,new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x3d68f5));}),_0x140478['on'](_0x35c3a9['YcaRO'],_0x50ba48=>{_0xe47e9d(_0x50ba48);});});}export async function authenticate(_0x3c3559){const _0x154730=_0x5071b4,_0x382005={'JWffR':function(_0x5b7873){return _0x5b7873();},'zFRtL':'device_auth','xTlIn':'Validating\x20API\x20token...','EzCvD':'✓\x20Stored\x20credentials\x20locally'};if(!_0x3c3559){const _0x25e074=await _0x382005['JWffR'](getToken);if(_0x25e074){const _0x34ff74=await getCurrentUser(_0x25e074);if(_0x34ff74['success'])return console[_0x154730(0x9e)]('✓\x20Already\x20authenticated\x20to\x20'+_0x34ff74[_0x154730(0xde)][_0x154730(0xa5)]),{'token':_0x25e074,'method':'existing_token'};}try{_0x3c3559=await runDeviceAuthFlow();}catch(_0x1f4c97){throw new Error(_0x154730(0xbf)+(_0x1f4c97 instanceof Error?_0x1f4c97['message']:_0x1f4c97));}const _0x26d99e=await getCurrentUser(_0x3c3559);if(!_0x26d99e[_0x154730(0xcb)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x26d99e['error']);return console['log']('✓\x20Authenticated\x20to\x20'+_0x26d99e[_0x154730(0xde)]['organizationName']),{'token':_0x3c3559,'method':_0x382005[_0x154730(0xba)]};}console['log'](_0x382005['xTlIn']);const _0xe32222=await getCurrentUser(_0x3c3559);if(!_0xe32222[_0x154730(0xcb)]){if(_0xe32222[_0x154730(0x99)])throw new Error(_0x154730(0xbf)+_0xe32222['error']+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0xe32222['error']+_0x154730(0xb6));}return console['log'](_0x154730(0xb5)+_0xe32222[_0x154730(0xde)][_0x154730(0xa5)]),await storeToken(_0x3c3559),console['log'](process['env'][_0x154730(0xc0)]?_0x154730(0xa7):_0x382005['EzCvD']),{'token':_0x3c3559,'method':_0x154730(0xbb)};}export async function ensureRangerDir(_0x1282b8){const _0x36cbba=_0x5071b4,_0x2e7cc3={'KrVOR':function(_0x5bb5bf){return _0x5bb5bf();},'qBGDb':_0x36cbba(0xb1)};void _0x1282b8;const _0x2ddcf6=_0x2e7cc3['KrVOR'](getRangerHomeDir);return!existsSync(_0x2ddcf6)?(await mkdir(_0x2ddcf6,{'recursive':!![]}),console[_0x36cbba(0x9e)](_0x36cbba(0xef)),{'path':_0x2ddcf6,'installed':!![]}):(console['log'](_0x2e7cc3['qBGDb']),{'path':_0x2ddcf6,'installed':![]});}export async function ensureChromium(_0xd49fe8=![]){const _0x14d772=_0x5071b4,_0x2e4207={'yMJMQ':'\x20(fallback\x20version)','UEdit':'\x0aInstalling\x20Chromium\x20browser...\x0a','knxHp':_0x14d772(0xa6),'PuZEr':function(_0x33f637,_0x16c6dc){return _0x33f637 instanceof _0x16c6dc;},'nBycZ':_0x14d772(0xbe),'oAZhu':_0x14d772(0xb7),'bBeQr':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0x1db60d=![];try{const _0x4fc80d=chromium['executablePath']();_0x1db60d=existsSync(_0x4fc80d);}catch{_0x1db60d=![];}if(_0x1db60d)return console['log'](_0x14d772(0xd3)),![];const _0x142927=getPlaywrightVersion(),_0xa20970=_0x142927??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x1bcbdb=!_0x142927,_0x135424=process['stdin'][_0x14d772(0xae)]&&process['stdout']['isTTY'];let _0x3581b9=!![];if(_0x135424){const {install:_0x49ee6a}=await _0x43049a[_0x14d772(0xbc)]([{'type':'confirm','name':_0x14d772(0xee),'message':_0x1bcbdb?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0xa20970+'\x20now?':_0x14d772(0xfb)+_0xa20970+_0x14d772(0xab),'default':!![]}]);_0x3581b9=_0x49ee6a;}else console[_0x14d772(0x9e)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0xa20970+(_0x1bcbdb?_0x2e4207[_0x14d772(0xd1)]:'')+'...');if(_0x3581b9){console['log'](_0x2e4207[_0x14d772(0xc8)]);try{await installChromiumBinary(_0xa20970,_0xd49fe8),console[_0x14d772(0x9e)]('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x411962){console[_0x14d772(0xdc)](_0x2e4207[_0x14d772(0xc3)],_0x2e4207['PuZEr'](_0x411962,Error)?_0x411962[_0x14d772(0xf5)]:_0x411962),console['log'](_0x2e4207[_0x14d772(0x101)]),console[_0x14d772(0x9e)]('\x20\x20npx\x20playwright@'+_0xa20970+_0x14d772(0xed));}}else console['log'](_0x2e4207[_0x14d772(0xc7)]),console['log'](_0x2e4207[_0x14d772(0xd2)]),console[_0x14d772(0x9e)]('\x20\x20npx\x20playwright@'+_0xa20970+_0x14d772(0xed));return!![];}export async function writeRangerGitignore(_0x25f82e){const _0x57efa9=_0x5071b4,_0x353a59={'naVBn':_0x57efa9(0xec)},_0x5cfc48=join(_0x25f82e,_0x57efa9(0xac)),_0x52f151='\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(_0x5cfc48,_0x52f151),console[_0x57efa9(0x9e)](_0x353a59[_0x57efa9(0xf4)]);}export async function ensureLocalEnv(_0x217f87,_0x38dbd4){const _0x45181f=_0x5071b4,_0x1847d7={'MDUYk':function(_0x59f2f7){return _0x59f2f7();},'HkZSG':function(_0x3471a0,_0x55dfb0){return _0x3471a0!==_0x55dfb0;},'qOtiC':_0x45181f(0xde),'zsppW':'⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','rJipg':function(_0x25db7f){return _0x25db7f();},'vtlOh':'local','jOJTI':function(_0x2b7b89,_0x115a80,_0x9fb389,_0xbe72d8){return _0x2b7b89(_0x115a80,_0x9fb389,_0xbe72d8);},'jksyd':_0x45181f(0xcf),'TcqLQ':function(_0xebee52,_0x4b1d4a){return _0xebee52 instanceof _0x4b1d4a;}};if(!_0x1847d7['MDUYk'](findGitRoot)&&_0x1847d7['HkZSG'](_0x217f87?.['scope'],_0x1847d7['qOtiC']))return console['log'](_0x1847d7['zsppW']),{'ready':![],'skipped':!![]};const _0x41eeae=_0x217f87?.['scope']===_0x45181f(0xde)?_0x1847d7['rJipg'](getRangerHomeDir):undefined;if(findExistingEnv(_0x1847d7[_0x45181f(0xd8)],{'locations':[_0x1847d7[_0x45181f(0xd8)]],'rangerDir':_0x41eeae}))return console['log']('✓\x20Local\x20profile\x20already\x20exists'),{'ready':!![],'skipped':![]};try{return await _0x1847d7['jOJTI'](addEnv,'local',{'url':_0x217f87?.[_0x45181f(0xa1)],'force':_0x217f87?.['force'],'allowInsecureLocalhost':_0x217f87?.[_0x45181f(0xd0)],'scope':_0x217f87?.['scope']},_0x38dbd4),{'ready':!![],'skipped':![]};}catch(_0x38d814){return console[_0x45181f(0xdc)](_0x1847d7['jksyd'],_0x1847d7['TcqLQ'](_0x38d814,Error)?_0x38d814[_0x45181f(0xf5)]:_0x38d814),{'ready':![],'skipped':![]};}}export async function start(_0x44f8e0,_0xe22092,_0x5a1ef9){const _0x1168ef=_0x5071b4,_0x5764b7={'QxCpq':'user','PgtdA':function(_0x118c1b,_0x364eaf){return _0x118c1b(_0x364eaf);},'cipvg':function(_0x333a50){return _0x333a50();},'CfZEL':_0x1168ef(0xd6),'SzAzr':_0x1168ef(0xe5),'oRKpd':function(_0x5d9449,_0x4984dd){return _0x5d9449(_0x4984dd);},'Jntlh':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','vyjse':'chromium','IdPEo':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','NwUiA':_0x1168ef(0xb9),'HqZxD':function(_0x43012d,_0x5a9429){return _0x43012d(_0x5a9429);},'cQQqe':function(_0x378339,_0x445a12){return _0x378339&&_0x445a12;},'CQPsA':'skills','QKGIC':function(_0x147c55,_0x14ec06,_0x4e2dad){return _0x147c55(_0x14ec06,_0x4e2dad);},'Dyjpl':_0x1168ef(0x98),'PVVaw':_0x1168ef(0xfc),'sSfgC':function(_0x46d90c,_0x330524){return _0x46d90c instanceof _0x330524;},'kUDzj':function(_0x3be144,_0x4c4e94){return _0x3be144(_0x4c4e94);},'TZpET':_0x1168ef(0xa4),'UlGEN':function(_0x5a0704,_0x3c203d,_0x2ae8ea){return _0x5a0704(_0x3c203d,_0x2ae8ea);},'VDkpv':'profile','FeKAB':_0x1168ef(0xc6),'gsylj':_0x1168ef(0xfa),'fXgbY':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','OdvpU':_0x1168ef(0xe7),'oBgEc':function(_0x8bd2eb,_0x490721){return _0x8bd2eb+_0x490721;}};console[_0x1168ef(0x9e)](_0x1168ef(0xaa));_0xe22092?.['scope']!==undefined&&_0xe22092['scope']!==_0x5764b7['QxCpq']&&(console[_0x1168ef(0xdc)]('ranger\x20setup\x20--scope='+String(_0xe22092['scope'])+_0x1168ef(0xd9)+_0x1168ef(0xc5)+_0x1168ef(0xb8)),process[_0x1168ef(0xfd)](0x1));_0xe22092={..._0xe22092,'scope':_0x1168ef(0xde)};const _0x4ab3f4=!_0x5764b7[_0x1168ef(0xfe)](existsSync,_0x5764b7[_0x1168ef(0xb3)](getRangerHomeDir));await ensureRangerDir(_0x1168ef(0xde));if(_0xe22092?.['skipAuth'])console['log']('✓\x20Skipping\x20authentication\x20(--skip-auth)'),_0x5a1ef9?.['trackPhaseEnd'](_0x1168ef(0xe5),{'isFirstRun':_0x4ab3f4,'method':_0x5764b7[_0x1168ef(0xeb)]});else{_0x5a1ef9?.[_0x1168ef(0xdd)](_0x5764b7['SzAzr']);const _0x427694=await _0x5764b7[_0x1168ef(0x9c)](authenticate,_0x44f8e0);_0x5a1ef9?.['trackPhaseEnd'](_0x5764b7['SzAzr'],{'isFirstRun':_0x4ab3f4,'method':_0x427694['method']});}_0x5a1ef9?.[_0x1168ef(0xdd)](_0x1168ef(0xcd));_0xe22092?.['skipChromium']?console['log'](_0x5764b7['Jntlh']):await _0x5764b7['PgtdA'](ensureChromium,_0xe22092?.['withDeps']);_0x5a1ef9?.['trackPhaseEnd'](_0x5764b7['vyjse'],{'isFirstRun':_0x4ab3f4,'skipped':!!_0xe22092?.[_0x1168ef(0xdb)]}),console['log'](_0x5764b7['IdPEo']);const _0x3b113d=_0xe22092?.['scope'],_0x4510d4=_0xe22092?.[_0x1168ef(0xfc)]??![];let _0x5b5fc8=null;_0x4510d4?(_0x5a1ef9?.['trackPhaseStart'](_0x5764b7['NwUiA']),_0x5b5fc8=await ensureOpencodePluginConfig(_0x3b113d),_0x5a1ef9?.[_0x1168ef(0xf0)](_0x5764b7[_0x1168ef(0xc9)],{'isFirstRun':_0x4ab3f4,'opencode':!![]})):(_0x5a1ef9?.['trackPhaseStart'](_0x1168ef(0xb9)),await _0x5764b7[_0x1168ef(0xf1)](ensureClaudePlugin,_0x3b113d),_0x5a1ef9?.[_0x1168ef(0xf0)]('plugin',{'isFirstRun':_0x4ab3f4}));if(_0x5764b7[_0x1168ef(0xf8)](_0x4510d4,_0x5b5fc8)){_0x5a1ef9?.['trackPhaseStart'](_0x5764b7['CQPsA']);try{await _0x5764b7[_0x1168ef(0xd7)](installSkill,_0x5764b7['Dyjpl'],{'level':_0x5b5fc8[_0x1168ef(0xc4)],'cliVersion':getCurrentVersion(),'platform':_0x5764b7['PVVaw']}),_0x5a1ef9?.[_0x1168ef(0xf0)](_0x5764b7[_0x1168ef(0xa0)],{'isFirstRun':_0x4ab3f4,'opencode':!![]});}catch(_0x1cff47){console[_0x1168ef(0x9a)](_0x1168ef(0xdf),_0x5764b7['sSfgC'](_0x1cff47,Error)?_0x1cff47[_0x1168ef(0xf5)]:_0x1cff47),_0x5a1ef9?.[_0x1168ef(0xf0)](_0x5764b7['CQPsA'],{'isFirstRun':_0x4ab3f4,'opencode':!![],'failed':!![]});}}else _0x5a1ef9?.['trackPhaseStart']('skills'),await _0x5764b7[_0x1168ef(0xea)](ensureClaudeSkills,_0x3b113d),_0x5a1ef9?.[_0x1168ef(0xf0)](_0x5764b7['CQPsA'],{'isFirstRun':_0x4ab3f4});if(_0xe22092?.['skipAuth'])console['log'](_0x5764b7['TZpET']);else{if(_0xe22092?.[_0x1168ef(0xa1)]){_0x5a1ef9?.[_0x1168ef(0xdd)]('profile');const _0x27d255=await _0x5764b7['UlGEN'](ensureLocalEnv,{'url':_0xe22092[_0x1168ef(0xa1)],'force':_0xe22092?.['force'],'allowInsecureLocalhost':_0xe22092?.[_0x1168ef(0xd0)],'scope':_0x5764b7['QxCpq']},_0x5a1ef9);_0x5a1ef9?.[_0x1168ef(0xf0)](_0x5764b7[_0x1168ef(0xa2)],{'isFirstRun':_0x4ab3f4,'profileReady':_0x27d255['ready'],'userSkipped':_0x27d255[_0x1168ef(0xd6)]});}else console[_0x1168ef(0x9e)]('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:'+(_0x1168ef(0xe8)+_0x5764b7[_0x1168ef(0xfe)](bold,_0x5764b7['FeKAB']))+'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)'+'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:'+_0x1168ef(0xe3));}if(_0x4510d4)console[_0x1168ef(0x9e)](_0x5764b7['gsylj']),console['log'](_0x1168ef(0xc1)),console[_0x1168ef(0x9e)](_0x5764b7['fXgbY']),console['log'](_0x5764b7['OdvpU']);else{const _0x2075c1=bold(_0x1168ef(0x9b));console['log'](_0x5764b7['oBgEc'](_0x5764b7['oBgEc'](_0x1168ef(0xad)+_0x2075c1+'\x20and\x20prompt\x20the\x20coding','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with'),_0x1168ef(0xa3))+_0x1168ef(0xf7));}}
|
|
1
|
+
const _0x4af01b=_0x4f5d;(function(_0x299cd2,_0x37095c){const _0x2c639c=_0x4f5d,_0x570231=_0x299cd2();while(!![]){try{const _0x32a438=parseInt(_0x2c639c(0x1e8))/0x1+-parseInt(_0x2c639c(0x1d3))/0x2+parseInt(_0x2c639c(0x20c))/0x3+-parseInt(_0x2c639c(0x222))/0x4+-parseInt(_0x2c639c(0x205))/0x5+-parseInt(_0x2c639c(0x1f0))/0x6+-parseInt(_0x2c639c(0x1f1))/0x7*(-parseInt(_0x2c639c(0x1d5))/0x8);if(_0x32a438===_0x37095c)break;else _0x570231['push'](_0x570231['shift']());}catch(_0x4dff60){_0x570231['push'](_0x570231['shift']());}}}(_0x4497,0x863c4));import{mkdir,writeFile}from'fs/promises';import{join}from'path';function _0x4f5d(_0x2a53f0,_0x169b28){_0x2a53f0=_0x2a53f0-0x1c1;const _0x449707=_0x4497();let _0x4f5dd2=_0x449707[_0x2a53f0];return _0x4f5dd2;}import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x265b21 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';function _0x4497(){const _0x528d50=['\x20and\x20prompt\x20the\x20coding','GITHUB_ENV','lCTSm','warn','status','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','ranger\x20setup\x20--scope=','uJHRw','organizationName','\x20\x20npx\x20playwright@','QyfzZ','user','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','chromium','873384PEjmou','Ddcsc','playwright@','confirm','scope','error','withDeps','\x20install\x20chromium','2503920GqdeHe','14581553cjqPjS','DNEWZ','nITBE','XoWtw','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','local','crWcq','allowInsecureLocalhost','Bvvzd','ksfCi','NzMgQ','\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','expxo','message','skipChromium','\x0aInstalling\x20Chromium\x20browser...\x0a','--with-deps','VeGmB','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','XPRPo','3456830kGhWOX','success','✓\x20~/.ranger/\x20directory\x20already\x20exists','profile','\x1b[0m','nQGnK','KMrKu','230115hRjHrZ','iSNmY','\x0aIn\x20Claude\x20Code,\x20run\x20','\x0a❌\x20Profile\x20setup\x20failed:','ZZtSs','✓\x20Created\x20.ranger/.gitignore','skills','\x20now?','✓\x20Playwright\x20Chromium\x20browser\x20found','ZHuJt','✓\x20Already\x20authenticated\x20to\x20','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','platform','CPGfT','skipAuth','url','version','log','PAmds','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','lSPao','prompt','2064112DeAvZk','trackPhaseStart','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','GvqIv','trackPhaseEnd','playwright/package.json','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','opencode','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','bohAh','isTTY','stdout','The\x20required\x20version\x20(','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','inherit','force','skipped','\x0a⚠\x20Skipping\x20Chromium\x20installation.','env','nOenM','You\x20can\x20install\x20it\x20manually\x20by\x20running:','exit','✓\x20Local\x20profile\x20already\x20exists','QsJvW','uNHZT','nEHaC','RcMTp','plugin','1717252oShMLs',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','8uMfVZj','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','method','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','install'];_0x4497=function(){return _0x528d50;};return _0x4497();}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=_0x378fb7=>'\x1b[1m'+_0x378fb7+_0x4af01b(0x209);export function getPlaywrightVersion(){const _0x4dc051=_0x4af01b;try{const _0x29185e=require['resolve'](_0x4dc051(0x227)),_0x1d9a2f=require(_0x29185e);return _0x1d9a2f[_0x4dc051(0x21c)];}catch{return null;}}export function installChromiumBinary(_0x48e354,_0x378e02=![]){const _0x226063=_0x4af01b,_0x2728c0={'ZHuJt':function(_0x51a0b1,_0x34d0e1){return _0x51a0b1===_0x34d0e1;},'Bvvzd':_0x226063(0x201),'nEHaC':'chromium','SKHZX':'npx','khTEG':'ignore','lCTSm':'close'};return new Promise((_0xbc62fe,_0x32a0c9)=>{const _0x436608=_0x226063,_0x85c4c3={'ZZtSs':function(_0x1ed9f1,_0x5e79bf){const _0x4c31a5=_0x4f5d;return _0x2728c0[_0x4c31a5(0x215)](_0x1ed9f1,_0x5e79bf);},'XPRPo':function(_0x81ffa){return _0x81ffa();},'GvqIv':function(_0x4c33bd,_0x4f602a){return _0x4c33bd(_0x4f602a);}},_0x20d0d6=[_0x436608(0x1ea)+_0x48e354,'install',..._0x378e02?[_0x2728c0[_0x436608(0x1f9)]]:[],_0x2728c0[_0x436608(0x1d0)]],_0x54ec8a=spawn(_0x2728c0['SKHZX'],_0x20d0d6,{'stdio':[_0x2728c0['khTEG'],_0x436608(0x1c5),'inherit'],'shell':process[_0x436608(0x218)]==='win32'});_0x54ec8a['on'](_0x2728c0[_0x436608(0x1dc)],_0x34e83a=>{const _0x465297=_0x436608;_0x85c4c3[_0x465297(0x210)](_0x34e83a,0x0)?_0x85c4c3[_0x465297(0x204)](_0xbc62fe):_0x85c4c3[_0x465297(0x225)](_0x32a0c9,new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x34e83a));}),_0x54ec8a['on'](_0x436608(0x1ed),_0x219443=>{_0x32a0c9(_0x219443);});});}export async function authenticate(_0x4e5aa2){const _0x21eef9=_0x4af01b,_0x3317ff={'XoWtw':function(_0xdceeed){return _0xdceeed();},'ksfCi':'existing_token','cphzm':'Validating\x20API\x20token...','PAmds':function(_0x744742,_0x84ef6){return _0x744742(_0x84ef6);},'KMrKu':function(_0x268750,_0x22fbfd){return _0x268750(_0x22fbfd);},'PgOQF':'✓\x20Stored\x20credentials\x20locally','dHECB':'provided_token'};if(!_0x4e5aa2){const _0x38d95a=await _0x3317ff[_0x21eef9(0x1f4)](getToken);if(_0x38d95a){const _0x50042d=await getCurrentUser(_0x38d95a);if(_0x50042d[_0x21eef9(0x206)])return console['log'](_0x21eef9(0x216)+_0x50042d['user']['organizationName']),{'token':_0x38d95a,'method':_0x3317ff[_0x21eef9(0x1fa)]};}try{_0x4e5aa2=await runDeviceAuthFlow();}catch(_0x3b3a43){throw new Error('Authentication\x20failed:\x20'+(_0x3b3a43 instanceof Error?_0x3b3a43['message']:_0x3b3a43));}const _0x1165fe=await getCurrentUser(_0x4e5aa2);if(!_0x1165fe[_0x21eef9(0x206)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x1165fe[_0x21eef9(0x1ed)]);return console[_0x21eef9(0x21d)]('✓\x20Authenticated\x20to\x20'+_0x1165fe[_0x21eef9(0x1e5)][_0x21eef9(0x1e2)]),{'token':_0x4e5aa2,'method':'device_auth'};}console['log'](_0x3317ff['cphzm']);const _0x3660b6=await _0x3317ff[_0x21eef9(0x21e)](getCurrentUser,_0x4e5aa2);if(!_0x3660b6['success']){if(_0x3660b6[_0x21eef9(0x1de)])throw new Error('Authentication\x20failed:\x20'+_0x3660b6['error']+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error(_0x21eef9(0x21f)+_0x3660b6[_0x21eef9(0x1ed)]+_0x21eef9(0x203));}return console[_0x21eef9(0x21d)]('✓\x20Authenticated\x20to\x20'+_0x3660b6['user'][_0x21eef9(0x1e2)]),await _0x3317ff[_0x21eef9(0x20b)](storeToken,_0x4e5aa2),console['log'](process[_0x21eef9(0x1c9)][_0x21eef9(0x1db)]?'✓\x20Exported\x20credentials\x20for\x20CI':_0x3317ff['PgOQF']),{'token':_0x4e5aa2,'method':_0x3317ff['dHECB']};}export async function ensureRangerDir(_0xf3f19d){const _0x52bb06=_0x4af01b;void _0xf3f19d;const _0x2010fc=getRangerHomeDir();return!existsSync(_0x2010fc)?(await mkdir(_0x2010fc,{'recursive':!![]}),console[_0x52bb06(0x21d)]('✓\x20Created\x20~/.ranger/\x20directory'),{'path':_0x2010fc,'installed':!![]}):(console['log'](_0x52bb06(0x207)),{'path':_0x2010fc,'installed':![]});}export async function ensureChromium(_0x489ee6=![]){const _0x531116=_0x4af01b,_0x3b4dc2={'qRmvd':function(_0x9f46c5){return _0x9f46c5();},'seSmn':_0x531116(0x1eb),'nQGnK':_0x531116(0x200),'expxo':function(_0x17aa06,_0x13c62b,_0x46fc05){return _0x17aa06(_0x13c62b,_0x46fc05);},'SeRgm':function(_0x417f56,_0x5e3857){return _0x417f56 instanceof _0x5e3857;},'noYXt':_0x531116(0x1cb),'VeJxu':_0x531116(0x1c8)};let _0x411efe=![];try{const _0x5e23f4=chromium['executablePath']();_0x411efe=existsSync(_0x5e23f4);}catch{_0x411efe=![];}if(_0x411efe)return console[_0x531116(0x21d)](_0x531116(0x214)),![];const _0x2f86cd=_0x3b4dc2['qRmvd'](getPlaywrightVersion),_0x368146=_0x2f86cd??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x13da6a=!_0x2f86cd,_0x32b826=process['stdin']['isTTY']&&process[_0x531116(0x1c2)][_0x531116(0x1c1)];let _0x59f06c=!![];if(_0x32b826){const {install:_0x26b24c}=await _0x265b21[_0x531116(0x221)]([{'type':_0x3b4dc2['seSmn'],'name':_0x531116(0x1d9),'message':_0x13da6a?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x368146+_0x531116(0x213):_0x531116(0x1c3)+_0x368146+_0x531116(0x1d4),'default':!![]}]);_0x59f06c=_0x26b24c;}else console[_0x531116(0x21d)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x368146+(_0x13da6a?'\x20(fallback\x20version)':'')+'...');if(_0x59f06c){console[_0x531116(0x21d)](_0x3b4dc2[_0x531116(0x20a)]);try{await _0x3b4dc2[_0x531116(0x1fd)](installChromiumBinary,_0x368146,_0x489ee6),console[_0x531116(0x21d)](_0x531116(0x1e6));}catch(_0x5c6e03){console['error'](_0x531116(0x1d8),_0x3b4dc2['SeRgm'](_0x5c6e03,Error)?_0x5c6e03[_0x531116(0x1fe)]:_0x5c6e03),console['log'](_0x3b4dc2['noYXt']),console['log']('\x20\x20npx\x20playwright@'+_0x368146+_0x531116(0x1ef));}}else console['log'](_0x3b4dc2['VeJxu']),console[_0x531116(0x21d)]('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console[_0x531116(0x21d)](_0x531116(0x1e3)+_0x368146+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0xdec19c){const _0x4042bd=_0x4af01b,_0xe700f3=join(_0xdec19c,'.gitignore'),_0x2c9a14=_0x4042bd(0x1fc);await writeFile(_0xe700f3,_0x2c9a14),console['log'](_0x4042bd(0x211));}export async function ensureLocalEnv(_0x312f63,_0x414efe){const _0x39bf72=_0x4af01b,_0x1a31f1={'VeGmB':function(_0x3fe4ef){return _0x3fe4ef();},'iSNmY':function(_0x4fc17d,_0x49e1fd){return _0x4fc17d!==_0x49e1fd;},'QbkaF':function(_0x4a59b0,_0x42a728){return _0x4a59b0===_0x42a728;},'kCsOs':function(_0x385915,_0x23d706,_0x3ee2c4){return _0x385915(_0x23d706,_0x3ee2c4);},'uJHRw':_0x39bf72(0x1f6),'zALXA':function(_0x338863,_0x36c1f3,_0x45ee32,_0x20dff7){return _0x338863(_0x36c1f3,_0x45ee32,_0x20dff7);},'Znfug':function(_0x207fc4,_0x3d9d0e){return _0x207fc4 instanceof _0x3d9d0e;}};if(!_0x1a31f1[_0x39bf72(0x202)](findGitRoot)&&_0x1a31f1[_0x39bf72(0x20d)](_0x312f63?.['scope'],_0x39bf72(0x1e5)))return console['log'](_0x39bf72(0x224)),{'ready':![],'skipped':!![]};const _0x6015f8=_0x1a31f1['QbkaF'](_0x312f63?.[_0x39bf72(0x1ec)],_0x39bf72(0x1e5))?getRangerHomeDir():undefined;if(_0x1a31f1['kCsOs'](findExistingEnv,_0x1a31f1[_0x39bf72(0x1e1)],{'locations':[_0x1a31f1[_0x39bf72(0x1e1)]],'rangerDir':_0x6015f8}))return console[_0x39bf72(0x21d)](_0x39bf72(0x1cd)),{'ready':!![],'skipped':![]};try{return await _0x1a31f1['zALXA'](addEnv,_0x1a31f1[_0x39bf72(0x1e1)],{'url':_0x312f63?.['url'],'force':_0x312f63?.[_0x39bf72(0x1c6)],'allowInsecureLocalhost':_0x312f63?.['allowInsecureLocalhost'],'scope':_0x312f63?.['scope']},_0x414efe),{'ready':!![],'skipped':![]};}catch(_0x372ef9){return console[_0x39bf72(0x1ed)](_0x39bf72(0x20f),_0x1a31f1['Znfug'](_0x372ef9,Error)?_0x372ef9[_0x39bf72(0x1fe)]:_0x372ef9),{'ready':![],'skipped':![]};}}export async function start(_0x1ab33d,_0x2bbf7d,_0x19d421){const _0x151159=_0x4af01b,_0x3a34ae={'YQsMK':'\x0a🚀\x20Ranger\x20Setup\x0a','QsJvW':function(_0x6e149c,_0x23b095){return _0x6e149c!==_0x23b095;},'nITBE':_0x151159(0x1e5),'uNHZT':function(_0x559b90,_0x344937){return _0x559b90+_0x344937;},'Ddcsc':function(_0x34acfb,_0x47c6cd){return _0x34acfb(_0x47c6cd);},'dsmDL':function(_0x599a92){return _0x599a92();},'VPprD':'auth','nOenM':_0x151159(0x1e7),'DNEWZ':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','NzMgQ':_0x151159(0x1d2),'WHOVE':function(_0x4cbd02,_0x48f7e3){return _0x4cbd02(_0x48f7e3);},'bohAh':function(_0x405f95,_0x2e301b,_0x52e89d){return _0x405f95(_0x2e301b,_0x52e89d);},'nHZtK':'ranger','mhwtg':function(_0x1fc0f1){return _0x1fc0f1();},'QyfzZ':'opencode','AXUGV':_0x151159(0x212),'CPGfT':_0x151159(0x208),'jiEEb':function(_0x28a6f9,_0xc7c2bd){return _0x28a6f9(_0xc7c2bd);},'RcMTp':'\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','crWcq':'/ranger:enable','MWMJH':function(_0x206b44,_0x47e1eb){return _0x206b44+_0x47e1eb;},'lSPao':function(_0x55f559,_0x4288d6){return _0x55f559+_0x4288d6;}};console[_0x151159(0x21d)](_0x3a34ae['YQsMK']);_0x3a34ae[_0x151159(0x1ce)](_0x2bbf7d?.[_0x151159(0x1ec)],undefined)&&_0x3a34ae['QsJvW'](_0x2bbf7d[_0x151159(0x1ec)],_0x3a34ae['nITBE'])&&(console['error'](_0x3a34ae['uNHZT'](_0x151159(0x1e0)+String(_0x2bbf7d['scope'])+'\x20is\x20no\x20longer\x20supported.\x20'+_0x151159(0x1f5),_0x151159(0x1c4))),process[_0x151159(0x1cc)](0x1));_0x2bbf7d={..._0x2bbf7d,'scope':_0x3a34ae['nITBE']};const _0x42058e=!_0x3a34ae[_0x151159(0x1e9)](existsSync,_0x3a34ae['dsmDL'](getRangerHomeDir));await _0x3a34ae['Ddcsc'](ensureRangerDir,_0x3a34ae['nITBE']);if(_0x2bbf7d?.[_0x151159(0x21a)])console[_0x151159(0x21d)]('✓\x20Skipping\x20authentication\x20(--skip-auth)'),_0x19d421?.[_0x151159(0x226)]('auth',{'isFirstRun':_0x42058e,'method':_0x151159(0x1c7)});else{_0x19d421?.[_0x151159(0x223)](_0x3a34ae['VPprD']);const _0x19125d=await _0x3a34ae[_0x151159(0x1e9)](authenticate,_0x1ab33d);_0x19d421?.['trackPhaseEnd'](_0x3a34ae['VPprD'],{'isFirstRun':_0x42058e,'method':_0x19125d[_0x151159(0x1d7)]});}_0x19d421?.['trackPhaseStart'](_0x3a34ae[_0x151159(0x1ca)]);_0x2bbf7d?.['skipChromium']?console['log'](_0x151159(0x22a)):await _0x3a34ae['Ddcsc'](ensureChromium,_0x2bbf7d?.[_0x151159(0x1ee)]);_0x19d421?.[_0x151159(0x226)](_0x3a34ae[_0x151159(0x1ca)],{'isFirstRun':_0x42058e,'skipped':!!_0x2bbf7d?.[_0x151159(0x1ff)]}),console['log'](_0x3a34ae[_0x151159(0x1f2)]);const _0x2e1280=_0x2bbf7d?.[_0x151159(0x1ec)],_0xb62d1e=_0x2bbf7d?.[_0x151159(0x229)]??![];let _0x22013c=null;_0xb62d1e?(_0x19d421?.[_0x151159(0x223)](_0x3a34ae[_0x151159(0x1fb)]),_0x22013c=await ensureOpencodePluginConfig(_0x2e1280),_0x19d421?.['trackPhaseEnd'](_0x3a34ae['NzMgQ'],{'isFirstRun':_0x42058e,'opencode':!![]})):(_0x19d421?.[_0x151159(0x223)](_0x3a34ae['NzMgQ']),await _0x3a34ae['WHOVE'](ensureClaudePlugin,_0x2e1280),_0x19d421?.['trackPhaseEnd'](_0x3a34ae['NzMgQ'],{'isFirstRun':_0x42058e}));if(_0xb62d1e&&_0x22013c){_0x19d421?.['trackPhaseStart'](_0x151159(0x212));try{await _0x3a34ae['bohAh'](installSkill,_0x3a34ae['nHZtK'],{'level':_0x22013c[_0x151159(0x1ec)],'cliVersion':_0x3a34ae['mhwtg'](getCurrentVersion),'platform':_0x3a34ae[_0x151159(0x1e4)]}),_0x19d421?.[_0x151159(0x226)](_0x3a34ae['AXUGV'],{'isFirstRun':_0x42058e,'opencode':!![]});}catch(_0x16d294){console[_0x151159(0x1dd)]('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x16d294 instanceof Error?_0x16d294['message']:_0x16d294),_0x19d421?.[_0x151159(0x226)](_0x3a34ae['AXUGV'],{'isFirstRun':_0x42058e,'opencode':!![],'failed':!![]});}}else _0x19d421?.['trackPhaseStart'](_0x3a34ae['AXUGV']),await ensureClaudeSkills(_0x2e1280),_0x19d421?.['trackPhaseEnd']('skills',{'isFirstRun':_0x42058e});if(_0x2bbf7d?.['skipAuth'])console['log']('\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a');else{if(_0x2bbf7d?.['url']){_0x19d421?.[_0x151159(0x223)](_0x3a34ae[_0x151159(0x219)]);const _0x5c9c78=await _0x3a34ae[_0x151159(0x22b)](ensureLocalEnv,{'url':_0x2bbf7d[_0x151159(0x21b)],'force':_0x2bbf7d?.['force'],'allowInsecureLocalhost':_0x2bbf7d?.[_0x151159(0x1f8)],'scope':_0x3a34ae[_0x151159(0x1f3)]},_0x19d421);_0x19d421?.[_0x151159(0x226)](_0x3a34ae['CPGfT'],{'isFirstRun':_0x42058e,'profileReady':_0x5c9c78['ready'],'userSkipped':_0x5c9c78[_0x151159(0x1c7)]});}else console[_0x151159(0x21d)](_0x3a34ae['uNHZT']('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:'+('\x0a\x20\x20'+_0x3a34ae['jiEEb'](bold,'ranger\x20profile\x20add\x20<name>'))+_0x151159(0x228),_0x151159(0x217))+'\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles');}if(_0xb62d1e)console['log'](_0x3a34ae[_0x151159(0x1d1)]),console[_0x151159(0x21d)](_0x151159(0x1df)),console[_0x151159(0x21d)]('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console[_0x151159(0x21d)](_0x151159(0x1d6));else{const _0x3639db=bold(_0x3a34ae[_0x151159(0x1f7)]);console['log'](_0x3a34ae['MWMJH'](_0x3a34ae[_0x151159(0x1cf)](_0x3a34ae[_0x151159(0x220)](_0x151159(0x20e)+_0x3639db+_0x151159(0x1da),'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with'),'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x50e73a=_0x17d5;(function(_0x50bac9,_0x31a000){const _0x36dd0e=_0x17d5,_0xe4db85=_0x50bac9();while(!![]){try{const _0xa3e6d6=parseInt(_0x36dd0e(0xef))/0x1*(parseInt(_0x36dd0e(0xcf))/0x2)+parseInt(_0x36dd0e(0xbb))/0x3+-parseInt(_0x36dd0e(0xec))/0x4+-parseInt(_0x36dd0e(0xa9))/0x5+-parseInt(_0x36dd0e(0xdf))/0x6+parseInt(_0x36dd0e(0x9e))/0x7+-parseInt(_0x36dd0e(0xe9))/0x8*(-parseInt(_0x36dd0e(0xb6))/0x9);if(_0xa3e6d6===_0x31a000)break;else _0xe4db85['push'](_0xe4db85['shift']());}catch(_0x224d0e){_0xe4db85['push'](_0xe4db85['shift']());}}}(_0x5988,0x19e5f));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';function _0x5988(){const _0x4c70e7=['\x20\x20\x20\x20Auth:\x20','settings.json','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','VGsez','\x0a---\x20Claude\x20Code\x20Plugin\x20---','DEBUG','QEnCx','isDirectory','GYPWl','BrmTw','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','hasPlaintextAuth','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','trim','nAGhI','toString','krfDh','1094XLUVFm','\x20\x20Not\x20configured','ranger@trailhead','muywj','env','\x0a\x20\x20No\x20active\x20profile\x20set','API\x20Token:\x20✗\x20Not\x20found','pipe','\x20[local]','plugin','\x20(latest:\x20','scope','MEKTY','\x20\x20User-level:','\x20local','LyZSQ','608190xETKZk','UYmXS','tBvoR','hasEncryptedAuth','vTJMa','no\x20session','ulrze','\x20\x20Project-level:','log','\x1b[0m','32720vQnzAx','cached\x20(updated\x20','filter','618396sIfeKh','\x20(up\x20to\x20date)','not_configured','31nKNSzX','AihiS','\x20\x20Run:\x20ranger\x20update','Tyxlj','user','ZXLhd',':\x20installed\x20(','includes','\x0a---\x20Profiles\x20---','data','\x20\x20Run:\x20ranger\x20setup\x20--opencode','length','SKILL.md','mxwTJ','\x20\x20Run:\x20ranger\x20setup\x20[token]','cwd','\x0a---\x20OpenCode\x20Plugin\x20---','AxiMm','\x20plugin(s)\x20configured','opencode','organizationName','Organization:\x20','path','displayName','(not\x20found)','AuPQa','match','Version:\x20','LzSmF','close','1271907fXQrtV','parse','iDCIk','vhOtl','ABcKp','map','sessionUpdatedAt','\x20[cloud]','\x20cloud','Groro','enabled','323685SnNLaP','configured','has','GjcpK','vnRRk','debug','push','version','\x20\x20Not\x20installed','\x20profiles\x20configured\x20(','oIxjz','uLLMi','fnQQZ','450mACmKg','UgXaS','name','API\x20Environment:\x20','\x20\x20Active:\x20','70866aUahkq','status'];_0x5988=function(){return _0x4c70e7;};return _0x5988();}import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';function _0x17d5(_0x2fddc6,_0x157cf8){_0x2fddc6=_0x2fddc6-0x95;const _0x598886=_0x5988();let _0x17d537=_0x598886[_0x2fddc6];return _0x17d537;}const bold=_0x4e2489=>'\x1b[1m'+_0x4e2489+_0x50e73a(0xe8),link=(_0x1fdf95,_0x243c40)=>'\x1b]8;;file://'+_0x1fdf95+'\x07'+(_0x243c40||_0x1fdf95)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x517c55=_0x50e73a,_0x5d469b={'LzSmF':'not_installed','mxwTJ':function(_0x4328b9,_0x6707f){return _0x4328b9(_0x6707f);},'pDFhe':function(_0x3be071,_0x145d5b){return _0x3be071>_0x145d5b;},'DiYSt':function(_0x308fec,_0x4f160e){return _0x308fec(_0x4f160e);},'poeSV':'string','GjcpK':_0x517c55(0xae),'vTJMa':'config','Tyxlj':'ignore','UgXaS':_0x517c55(0xd6),'GYPWl':_0x517c55(0xf8),'AihiS':_0x517c55(0x9d)};return new Promise(_0x3e15f9=>{const _0x3b4a6d=_0x517c55,_0xa06055={'rlNDG':function(_0x30819f,_0x5e47a7){return _0x30819f(_0x5e47a7);},'FNAff':_0x5d469b[_0x3b4a6d(0x9c)],'weXso':_0x5d469b['poeSV']},_0x3c874a=spawn(_0x3b4a6d(0x102),[_0x5d469b[_0x3b4a6d(0xac)],_0x5d469b[_0x3b4a6d(0xe3)]],{'stdio':[_0x5d469b[_0x3b4a6d(0xf2)],_0x5d469b[_0x3b4a6d(0xb7)],_0x5d469b[_0x3b4a6d(0xb7)]]});let _0x9915d1='';_0x3c874a['stdout']?.['on'](_0x5d469b[_0x3b4a6d(0xc6)],_0x2b0225=>{_0x9915d1+=_0x2b0225['toString']();}),_0x3c874a['stderr']?.['on'](_0x5d469b[_0x3b4a6d(0xc6)],_0x392ac6=>{const _0x548d46=_0x3b4a6d;_0x9915d1+=_0x392ac6[_0x548d46(0xcd)]();}),_0x3c874a['on']('error',()=>{_0xa06055['rlNDG'](_0x3e15f9,{'status':_0xa06055['FNAff']});}),_0x3c874a['on'](_0x5d469b[_0x3b4a6d(0xf0)],_0x188ded=>{const _0x1de884=_0x3b4a6d;if(_0x188ded!==0x0){_0x3e15f9({'status':_0x5d469b['LzSmF']});return;}const _0x431a9d=_0x9915d1[_0x1de884(0xcb)]();let _0x2195cf=null;if(_0x431a9d)try{_0x2195cf=JSON[_0x1de884(0x9f)](_0x431a9d);}catch{const _0x41d74c=_0x431a9d[_0x1de884(0x9a)](/\{[\s\S]*\}$/);if(_0x41d74c)try{_0x2195cf=JSON['parse'](_0x41d74c[0x0]);}catch{_0x2195cf=null;}}const _0x4a572b=Array['isArray'](_0x2195cf?.[_0x1de884(0xd8)])?_0x2195cf?.[_0x1de884(0xd8)]:[],_0x4f690a=_0x4a572b['some'](_0x1ea02d=>{const _0x21248c=_0x1de884;if(typeof _0x1ea02d!==_0xa06055['weXso'])return![];return _0x1ea02d[_0x21248c(0xf6)]('@ranger-testing/opencode-plugin')||_0x1ea02d['includes']('opencode-plugin');});if(_0x4f690a){_0x5d469b[_0x1de884(0xfc)](_0x3e15f9,{'status':_0x1de884(0xaa),'details':_0x5d469b['pDFhe'](_0x4a572b[_0x1de884(0xfa)],0x0)?_0x4a572b['length']+_0x1de884(0x101):undefined});return;}if(_0x5d469b['pDFhe'](_0x4a572b[_0x1de884(0xfa)],0x0)){_0x5d469b['DiYSt'](_0x3e15f9,{'status':_0x1de884(0xee),'details':_0x4a572b['length']+_0x1de884(0x101)});return;}_0x3e15f9({'status':_0x1de884(0xee)});});});}async function getSkillsFromDir(_0x5c039a,_0x2a82a1){const _0x10b153=_0x50e73a,_0x6abe21={'tBvoR':function(_0x1aa745,_0x5136ae){return _0x1aa745(_0x5136ae);},'oIxjz':function(_0x2c8b8f,_0x1b07d9,_0x319bbe){return _0x2c8b8f(_0x1b07d9,_0x319bbe);},'BrmTw':_0x10b153(0xfb),'tlFoS':'utf-8'};if(!_0x6abe21[_0x10b153(0xe1)](existsSync,_0x5c039a))return[];const _0x3e0877=[];try{const _0x1b2edd=await _0x6abe21[_0x10b153(0xb3)](readdir,_0x5c039a,{'withFileTypes':!![]});for(const _0x55044e of _0x1b2edd){if(_0x55044e[_0x10b153(0xc5)]()){const _0x3a9d00=join(_0x5c039a,_0x55044e['name'],_0x6abe21[_0x10b153(0xc7)]);if(existsSync(_0x3a9d00)){let _0x3397e0=_0x55044e['name'];try{const _0x89d04f=await readFile(_0x3a9d00,_0x6abe21['tlFoS']),_0x5c7789=_0x89d04f['match'](/name:\s*(.+)/);_0x5c7789&&(_0x3397e0=_0x5c7789[0x1]['trim']());}catch{}_0x3e0877['push']({'name':_0x55044e[_0x10b153(0xb8)],'displayName':_0x3397e0,'path':_0x3a9d00,'level':_0x2a82a1});}}}}catch{return[];}return _0x3e0877;}async function getInstalledSkills(){const _0x26ed98={'xvqZj':'project','rKtcw':function(_0x95fca8,_0x2e39df,_0x1f42b2){return _0x95fca8(_0x2e39df,_0x1f42b2);},'Fdqft':function(_0x10db7a){return _0x10db7a();}},[_0x37b261,_0x42a65b]=await Promise['all']([getSkillsFromDir(getProjectSkillsDir(),_0x26ed98['xvqZj']),_0x26ed98['rKtcw'](getSkillsFromDir,_0x26ed98['Fdqft'](getUserSkillsDir),'user')]);return{'project':_0x37b261,'user':_0x42a65b};}async function getEnvironments(){const _0x5f0c01=_0x50e73a,_0x578fbf={'vhOtl':function(_0x4c7b70,_0x2d29f3){return _0x4c7b70(_0x2d29f3);},'nAGhI':function(_0x22fcea,_0xadf5ef,_0x7ed983){return _0x22fcea(_0xadf5ef,_0x7ed983);},'nZxhj':_0x5f0c01(0xbe),'IOzZC':function(_0x20412f,_0x4c2da7){return _0x20412f(_0x4c2da7);},'VGsez':function(_0x4e1ac2){return _0x4e1ac2();}},{envNames:_0x1bfe23,activeEnv:_0x3727e3}=await _0x578fbf[_0x5f0c01(0xc1)](getEnvNames),_0x4627db=getRangerDir();if(!existsSync(_0x4627db))return{'envs':[],'activeEnv':null};const _0x2d0113=_0x1bfe23[_0x5f0c01(0xa3)](_0x51d9fa=>{const _0x4bc166=_0x5f0c01,_0x1f0005=_0x578fbf[_0x4bc166(0xa1)](getEnvDir,_0x51d9fa),_0x2fabc6=_0x578fbf[_0x4bc166(0xcc)](join,_0x1f0005,_0x578fbf['nZxhj']),_0x1dac73=join(_0x1f0005,'auth.json'),_0x2b2eca=_0x578fbf['nAGhI'](join,_0x1f0005,'auth.json.enc');return{'name':_0x51d9fa,'settingsPath':_0x578fbf['vhOtl'](existsSync,_0x2fabc6)?_0x2fabc6:_0x4bc166(0x98),'hasPlaintextAuth':existsSync(_0x1dac73),'hasEncryptedAuth':_0x578fbf['IOzZC'](existsSync,_0x2b2eca),'isActive':_0x51d9fa===_0x3727e3};});return{'envs':_0x2d0113,'activeEnv':_0x3727e3};}export async function status(){const _0x4a75e0=_0x50e73a,_0x32d95f={'QEnCx':'\x0a📊\x20Ranger\x20Status\x0a','muywj':function(_0x25da02,_0x245da8){return _0x25da02(_0x245da8);},'Groro':function(_0x283dfe,_0x275196,_0x513080){return _0x283dfe(_0x275196,_0x513080);},'ZXLhd':function(_0x44f627,_0x3945f9){return _0x44f627(_0x3945f9);},'AuPQa':function(_0x56bc5b){return _0x56bc5b();},'ulrze':function(_0x992db0,_0x490216){return _0x992db0!==_0x490216;},'gDUsT':function(_0x345972){return _0x345972();},'SwGtP':_0x4a75e0(0xaa),'AxiMm':function(_0x5cd06a,_0x14edbf){return _0x5cd06a===_0x14edbf;},'hrtBM':_0x4a75e0(0xee),'YgdjW':_0x4a75e0(0xd0),'krfDh':function(_0x42fd5c,_0x428a92){return _0x42fd5c(_0x428a92);},'UYmXS':_0x4a75e0(0xd1),'vnRRk':'unknown','SUrQf':'disabled','zIMXl':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','iDCIk':'\x0a---\x20Skills\x20---','etNCj':function(_0x1dd5e4,_0x2b03a7){return _0x1dd5e4>_0x2b03a7;},'QQPYC':_0x4a75e0(0xdc),'fnQQZ':_0x4a75e0(0xf7),'MEKTY':function(_0x5f18eb){return _0x5f18eb();},'uLLMi':function(_0x28cd4f,_0x322230){return _0x28cd4f+_0x322230;},'ABcKp':'No\x20profiles\x20configured','ILksC':function(_0x193d56,_0x360f66){return _0x193d56>_0x360f66;},'CUdOS':'\x20(active)','LyZSQ':function(_0x192ae8,_0x397bd3){return _0x192ae8(_0x397bd3);},'NTVpE':_0x4a75e0(0xe4),'bmNaQ':'encrypted','cTpsc':'(not\x20found)'};console['log'](_0x32d95f[_0x4a75e0(0xc4)]);const _0x5f4591=process[_0x4a75e0(0xfe)](),_0x1231c2=getRangerDir();if(!_0x32d95f['muywj'](existsSync,_0x1231c2)){console['log']('Root:\x20'+_0x32d95f[_0x4a75e0(0xa7)](link,_0x5f4591,_0x32d95f[_0x4a75e0(0xd2)](bold,basename(_0x5f4591)))),console['log'](_0x4a75e0(0xc0)),console[_0x4a75e0(0xe7)](_0x4a75e0(0xc8));return;}console[_0x4a75e0(0xe7)]('Root:\x20'+link(_0x5f4591,_0x32d95f['ZXLhd'](bold,_0x32d95f['ZXLhd'](basename,_0x5f4591))));const _0x419951=_0x32d95f[_0x4a75e0(0x99)](getCurrentVersion),_0x5e1f49=getLatestVersion();if(_0x5e1f49['version']&&_0x32d95f[_0x4a75e0(0xe5)](_0x5e1f49[_0x4a75e0(0xb0)],_0x419951))console[_0x4a75e0(0xe7)](_0x4a75e0(0x9b)+_0x419951+_0x4a75e0(0xd9)+_0x5e1f49['version']+')'),console[_0x4a75e0(0xe7)](_0x4a75e0(0xf1));else _0x5e1f49['version']?console['log']('Version:\x20'+_0x419951+_0x4a75e0(0xed)):console['log'](_0x4a75e0(0x9b)+_0x419951);const _0x4a2822=await getToken();if(_0x4a2822){const _0x90059b=await _0x32d95f[_0x4a75e0(0xd2)](getCurrentUser,_0x4a2822);_0x90059b['success']?console[_0x4a75e0(0xe7)](_0x4a75e0(0x95)+_0x32d95f[_0x4a75e0(0xf4)](bold,_0x90059b[_0x4a75e0(0xf3)][_0x4a75e0(0x103)])):(console['log'](_0x4a75e0(0xbf)),console[_0x4a75e0(0xe7)](_0x4a75e0(0xfd)));}else console['log'](_0x4a75e0(0xd5)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0x4a75e0(0xd3)][_0x4a75e0(0xc3)]&&(console[_0x4a75e0(0xe7)](_0x4a75e0(0xb9)+_0x32d95f['AuPQa'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+getApiBaseUrl()));console['log'](_0x4a75e0(0xff));const _0x216350=await _0x32d95f['gDUsT'](getOpencodePluginStatus);if(_0x216350['status']===_0x32d95f['SwGtP'])console['log']('\x20\x20'+bold('@ranger-testing/opencode-plugin')+':\x20configured'),_0x216350['details']&&console['log']('\x20\x20'+_0x216350['details']);else _0x32d95f[_0x4a75e0(0x100)](_0x216350[_0x4a75e0(0xbc)],_0x32d95f['hrtBM'])?(console['log'](_0x32d95f['YgdjW']),_0x216350['details']&&console[_0x4a75e0(0xe7)]('\x20\x20'+_0x216350['details']),console[_0x4a75e0(0xe7)](_0x4a75e0(0xf9))):console[_0x4a75e0(0xe7)]('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console['log'](_0x4a75e0(0xc2));const _0x55579f=await _0x32d95f[_0x4a75e0(0xce)](getPluginInfo,_0x32d95f[_0x4a75e0(0xe0)]);if(_0x55579f){const _0x338a90=_0x55579f[_0x4a75e0(0xda)]||_0x32d95f[_0x4a75e0(0xad)],_0x5e98bd=_0x55579f[_0x4a75e0(0xa8)]?'enabled':_0x32d95f['SUrQf'];console[_0x4a75e0(0xe7)]('\x20\x20'+_0x32d95f['krfDh'](bold,_0x4a75e0(0xd1))+_0x4a75e0(0xf5)+_0x338a90+',\x20'+_0x5e98bd+')');}else console['log'](_0x4a75e0(0xb1)),console['log'](_0x32d95f['zIMXl']);console['log'](_0x32d95f[_0x4a75e0(0xa0)]);const {project:_0x22b6ae,user:_0xf0c510}=await _0x32d95f[_0x4a75e0(0x99)](getInstalledSkills),_0x30a236=_0x22b6ae[_0x4a75e0(0xeb)](_0x276e38=>RANGER_MANAGED_SKILLS[_0x4a75e0(0xf6)](_0x276e38['name'])),_0x3bad95=_0xf0c510['filter'](_0x1a8389=>RANGER_MANAGED_SKILLS[_0x4a75e0(0xf6)](_0x1a8389[_0x4a75e0(0xb8)])),_0x320287=_0x30a236['length']+_0x3bad95[_0x4a75e0(0xfa)];if(_0x32d95f['AxiMm'](_0x320287,0x0))console['log']('No\x20skills\x20installed'),console[_0x4a75e0(0xe7)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x32d95f['etNCj'](_0x30a236['length'],0x0)){console['log'](_0x4a75e0(0xe6));for(const _0x275e17 of _0x30a236){console['log']('\x20\x20\x20\x20'+bold(_0x275e17['displayName'])+':\x20'+_0x32d95f[_0x4a75e0(0xa7)](link,_0x275e17['path'],_0x32d95f[_0x4a75e0(0xce)](basename,_0x275e17[_0x4a75e0(0x96)])));}}if(_0x3bad95[_0x4a75e0(0xfa)]>0x0){console['log'](_0x32d95f['QQPYC']);for(const _0x441c2a of _0x3bad95){console[_0x4a75e0(0xe7)]('\x20\x20\x20\x20'+bold(_0x441c2a[_0x4a75e0(0x97)])+':\x20'+_0x32d95f[_0x4a75e0(0xa7)](link,_0x441c2a['path'],_0x32d95f['krfDh'](basename,_0x441c2a['path'])));}}}console['log'](_0x32d95f[_0x4a75e0(0xb5)]);const {envs:_0x500df7,activeEnv:_0x369aae}=await getEnvironments();let _0xa41ca2=[];if(_0x4a2822)try{_0xa41ca2=await _0x32d95f[_0x4a75e0(0xdb)](listCloudProfiles);}catch{}const _0xf33bd2=_0x32d95f[_0x4a75e0(0xb4)](_0x500df7['length'],_0xa41ca2['length']);if(_0x32d95f[_0x4a75e0(0x100)](_0xf33bd2,0x0))console[_0x4a75e0(0xe7)](_0x32d95f[_0x4a75e0(0xa2)]),console[_0x4a75e0(0xe7)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0x32d95f['etNCj'](_0xf33bd2,0x5)){const _0x3a6220=[];_0x32d95f['etNCj'](_0xa41ca2['length'],0x0)&&_0x3a6220['push'](_0xa41ca2[_0x4a75e0(0xfa)]+_0x4a75e0(0xa6)),_0x32d95f['ILksC'](_0x500df7[_0x4a75e0(0xfa)],0x0)&&_0x3a6220[_0x4a75e0(0xaf)](_0x500df7[_0x4a75e0(0xfa)]+_0x4a75e0(0xdd)),console['log'](_0xf33bd2+_0x4a75e0(0xb2)+_0x3a6220['join'](',\x20')+')'),_0x369aae&&console['log'](_0x4a75e0(0xba)+bold(_0x369aae)),console[_0x4a75e0(0xe7)](_0x4a75e0(0xca));}else{for(const _0x51cc8a of _0xa41ca2){const _0xe3bc35=_0x32d95f[_0x4a75e0(0x100)](_0x51cc8a['name'],_0x369aae)?_0x32d95f['CUdOS']:'';console[_0x4a75e0(0xe7)]('\x20\x20'+_0x32d95f[_0x4a75e0(0xde)](bold,_0x51cc8a[_0x4a75e0(0xb8)])+_0x4a75e0(0xa5)+_0xe3bc35);const _0xe4ad7b=_0x51cc8a[_0x4a75e0(0xa4)]?_0x4a75e0(0xea)+_0x51cc8a['sessionUpdatedAt']+')':_0x32d95f['NTVpE'];console[_0x4a75e0(0xe7)]('\x20\x20\x20\x20Session:\x20'+_0xe4ad7b);}const _0x109a81=new Set(_0xa41ca2[_0x4a75e0(0xa3)](_0x4cc34a=>_0x4cc34a['name']));for(const _0x19d2b0 of _0x500df7){if(_0x109a81['has'](_0x19d2b0[_0x4a75e0(0xb8)]))continue;const _0x19956b=_0x19d2b0['isActive']?_0x32d95f['CUdOS']:'',_0x1bdaab=_0x19d2b0[_0x4a75e0(0xe2)]?_0x32d95f['bmNaQ']:_0x19d2b0[_0x4a75e0(0xc9)]?'plaintext':'none';console[_0x4a75e0(0xe7)]('\x20\x20'+_0x32d95f['ZXLhd'](bold,_0x19d2b0[_0x4a75e0(0xb8)])+_0x4a75e0(0xd7)+_0x19956b),console['log'](_0x4a75e0(0xbd)+_0x1bdaab),_0x19d2b0['settingsPath']!==_0x32d95f['cTpsc']&&console['log']('\x20\x20\x20\x20Settings:\x20'+_0x32d95f[_0x4a75e0(0xa7)](link,_0x19d2b0['settingsPath'],basename(_0x19d2b0['settingsPath'])));}if(!_0x369aae){console[_0x4a75e0(0xe7)](_0x4a75e0(0xd4));const _0xb832d=[..._0xa41ca2[_0x4a75e0(0xa3)](_0x5787bf=>_0x5787bf['name']),..._0x500df7['filter'](_0x508a4e=>!_0x109a81[_0x4a75e0(0xab)](_0x508a4e['name']))['map'](_0x26cd40=>_0x26cd40[_0x4a75e0(0xb8)])];console['log']('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0xb832d['join'](',\x20')+')');}}}console['log']('');}
|
|
1
|
+
const _0x263f84=_0x57af;(function(_0x189476,_0x2c7239){const _0x4f77b0=_0x57af,_0x518551=_0x189476();while(!![]){try{const _0x38527c=parseInt(_0x4f77b0(0x1ba))/0x1+parseInt(_0x4f77b0(0x202))/0x2+parseInt(_0x4f77b0(0x20a))/0x3*(parseInt(_0x4f77b0(0x1bf))/0x4)+-parseInt(_0x4f77b0(0x22d))/0x5*(-parseInt(_0x4f77b0(0x1f0))/0x6)+-parseInt(_0x4f77b0(0x205))/0x7+-parseInt(_0x4f77b0(0x226))/0x8+parseInt(_0x4f77b0(0x209))/0x9*(-parseInt(_0x4f77b0(0x1ec))/0xa);if(_0x38527c===_0x2c7239)break;else _0x518551['push'](_0x518551['shift']());}catch(_0x3f5ee7){_0x518551['push'](_0x518551['shift']());}}}(_0x2b33,0x789de));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';function _0x57af(_0x14f284,_0x44a76f){_0x14f284=_0x14f284-0x1b8;const _0x2b3313=_0x2b33();let _0x57af27=_0x2b3313[_0x14f284];return _0x57af27;}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';function _0x2b33(){const _0x1fb0e4=['\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','gAYSD','organizationName','trim','iDgEb','eGuTG','\x20(active)','No\x20skills\x20installed','toString','plugin','status','API\x20URL:\x20','OPxGD','env','\x20\x20\x20\x20','UtYPf','kNlVC','includes','CkGix','user','\x0a📊\x20Ranger\x20Status\x0a','log','sessionUpdatedAt','some','\x1b[1m','(not\x20found)','project','jlZVN','path','isActive','\x20\x20Not\x20configured','kDUih','\x20[local]','Ithxs','\x0a---\x20Skills\x20---','ihNUJ','enabled','push','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','9590KUfhfg','\x20\x20\x20\x20Session:\x20','hasPlaintextAuth','TbHsT','6cmPWEY','\x20local','GoFUV','ruHEZ','lFJip','luAUD','API\x20Environment:\x20','map','vWeRx','Tlkem','UjJjZ','dcWgA','\x0a---\x20Claude\x20Code\x20Plugin\x20---','RsTHP','isArray','stdout','kDMua','\x0a\x20\x20No\x20active\x20profile\x20set','774118NMwoRW','\x20\x20\x20\x20Settings:\x20','\x20\x20Run:\x20ranger\x20setup\x20[token]','3057831oZyLUy','length','settingsPath','success','1962jbrApS','14589wxhDfN','Version:\x20','pxSqY','UrOsp','pqLZT',':\x20installed\x20(','opencode','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','nwBKk','data','cached\x20(updated\x20','ranger@trailhead','filter','pipe','\x1b]8;;file://','@ranger-testing/opencode-plugin','MzSIm','version','settings.json','RbUiM','HrAGK','\x20\x20User-level:','has','jaGwI','Root:\x20','\x20cloud','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','join','841704qWnKOI','\x20plugin(s)\x20configured','unknown','config','Ipsdj','\x20\x20Run:\x20ranger\x20update','\x20\x20Run:\x20ranger\x20skillup','3003415EavkbF','opencode-plugin','aDjey','9399CSyGxC','\x20\x20Active:\x20','Organization:\x20','\x20(up\x20to\x20date)','name','204Iyrfdy','API\x20Token:\x20✗\x20Not\x20found','scope','IldkK','parse','all'];_0x2b33=function(){return _0x1fb0e4;};return _0x2b33();}import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x459b52=>_0x263f84(0x1dd)+_0x459b52+'\x1b[0m',link=(_0xf53db9,_0x5efce2)=>_0x263f84(0x218)+_0xf53db9+'\x07'+(_0x5efce2||_0xf53db9)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x4260fe=_0x263f84,_0x4dbf6f={'SvHww':function(_0x3de946,_0x32ee63){return _0x3de946(_0x32ee63);},'sZaly':function(_0x4ca3ca,_0x4a0286){return _0x4ca3ca!==_0x4a0286;},'GoFUV':function(_0x740d2b,_0x2530bc){return _0x740d2b(_0x2530bc);},'fhUus':function(_0x318632,_0xb50cae){return _0x318632>_0xb50cae;},'UjJjZ':'not_configured','dpWWw':_0x4260fe(0x1b8),'TbHsT':function(_0x544852,_0x483ff7,_0x41e7dd,_0x152478){return _0x544852(_0x483ff7,_0x41e7dd,_0x152478);},'xAfpk':'ignore','kDMua':_0x4260fe(0x217),'jaGwI':'data'};return new Promise(_0x283d77=>{const _0x4f53c2=_0x4260fe,_0xa44268={'ihNUJ':'@ranger-testing/opencode-plugin','IldkK':_0x4dbf6f['dpWWw']},_0x152095=_0x4dbf6f[_0x4f53c2(0x1ef)](spawn,_0x4f53c2(0x210),['debug',_0x4f53c2(0x229)],{'stdio':[_0x4dbf6f['xAfpk'],_0x4dbf6f[_0x4f53c2(0x200)],_0x4f53c2(0x217)]});let _0x4da4b1='';_0x152095[_0x4f53c2(0x1ff)]?.['on'](_0x4dbf6f[_0x4f53c2(0x221)],_0x59325a=>{const _0x239e94=_0x4f53c2;_0x4da4b1+=_0x59325a[_0x239e94(0x1cd)]();}),_0x152095['stderr']?.['on'](_0x4f53c2(0x213),_0x35b3ae=>{_0x4da4b1+=_0x35b3ae['toString']();}),_0x152095['on']('error',()=>{_0x4dbf6f['SvHww'](_0x283d77,{'status':'not_installed'});}),_0x152095['on']('close',_0x4b1319=>{const _0x1da5c3=_0x4f53c2;if(_0x4dbf6f['sZaly'](_0x4b1319,0x0)){_0x283d77({'status':'not_installed'});return;}const _0x2917e9=_0x4da4b1[_0x1da5c3(0x1c8)]();let _0x23d1f7=null;if(_0x2917e9)try{_0x23d1f7=JSON['parse'](_0x2917e9);}catch{const _0x31aa04=_0x2917e9['match'](/\{[\s\S]*\}$/);if(_0x31aa04)try{_0x23d1f7=JSON[_0x1da5c3(0x1c3)](_0x31aa04[0x0]);}catch{_0x23d1f7=null;}}const _0x1372f1=Array[_0x1da5c3(0x1fe)](_0x23d1f7?.['plugin'])?_0x23d1f7?.[_0x1da5c3(0x1ce)]:[],_0x13d1af=_0x1372f1[_0x1da5c3(0x1dc)](_0x339e4a=>{const _0x3cf2ee=_0x1da5c3;if(typeof _0x339e4a!=='string')return![];return _0x339e4a['includes'](_0xa44268[_0x3cf2ee(0x1e8)])||_0x339e4a[_0x3cf2ee(0x1d6)](_0xa44268[_0x3cf2ee(0x1c2)]);});if(_0x13d1af){_0x4dbf6f[_0x1da5c3(0x1f2)](_0x283d77,{'status':'configured','details':_0x4dbf6f['fhUus'](_0x1372f1['length'],0x0)?_0x1372f1['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x1372f1[_0x1da5c3(0x206)]>0x0){_0x283d77({'status':_0x4dbf6f[_0x1da5c3(0x1fa)],'details':_0x1372f1['length']+_0x1da5c3(0x227)});return;}_0x283d77({'status':_0x4dbf6f['UjJjZ']});});});}async function getSkillsFromDir(_0x766fe5,_0x5c1f8e){const _0x4fecbe=_0x263f84,_0x454676={'gAYSD':function(_0x413a14,_0x131a7a,_0x12f91b){return _0x413a14(_0x131a7a,_0x12f91b);},'Ipsdj':'SKILL.md','eGuTG':function(_0x339406,_0x19a4f4){return _0x339406(_0x19a4f4);},'gcPLh':'utf-8'};if(!existsSync(_0x766fe5))return[];const _0x5d1b50=[];try{const _0x5d4be8=await _0x454676[_0x4fecbe(0x1c6)](readdir,_0x766fe5,{'withFileTypes':!![]});for(const _0x52c05e of _0x5d4be8){if(_0x52c05e['isDirectory']()){const _0x50b9aa=join(_0x766fe5,_0x52c05e['name'],_0x454676[_0x4fecbe(0x22a)]);if(_0x454676[_0x4fecbe(0x1ca)](existsSync,_0x50b9aa)){let _0x18703b=_0x52c05e[_0x4fecbe(0x1be)];try{const _0x5052a1=await _0x454676['gAYSD'](readFile,_0x50b9aa,_0x454676['gcPLh']),_0x442af6=_0x5052a1['match'](/name:\s*(.+)/);_0x442af6&&(_0x18703b=_0x442af6[0x1]['trim']());}catch{}_0x5d1b50['push']({'name':_0x52c05e[_0x4fecbe(0x1be)],'displayName':_0x18703b,'path':_0x50b9aa,'level':_0x5c1f8e});}}}}catch{return[];}return _0x5d1b50;}async function getInstalledSkills(){const _0x5a1730=_0x263f84,_0x908163={'WjDJV':function(_0x43e361,_0x135639,_0x3ad673){return _0x43e361(_0x135639,_0x3ad673);},'FHACV':function(_0x5b94d5){return _0x5b94d5();},'UtYPf':_0x5a1730(0x1df),'ruHEZ':_0x5a1730(0x1d8)},[_0x3c8a25,_0x1217ac]=await Promise[_0x5a1730(0x1c4)]([_0x908163['WjDJV'](getSkillsFromDir,_0x908163['FHACV'](getProjectSkillsDir),_0x908163[_0x5a1730(0x1d4)]),getSkillsFromDir(getUserSkillsDir(),_0x908163[_0x5a1730(0x1f3)])]);return{'project':_0x3c8a25,'user':_0x1217ac};}async function getEnvironments(){const _0x4a37f1=_0x263f84,_0x4c29ff={'OcJPX':function(_0x554280,_0x39c092,_0x499538){return _0x554280(_0x39c092,_0x499538);},'nwBKk':'auth.json','TzInN':'auth.json.enc','LRvhC':function(_0x4f15dd,_0x4e8069){return _0x4f15dd(_0x4e8069);},'poaZr':function(_0x559d8a,_0x4f9a0d){return _0x559d8a===_0x4f9a0d;},'PUzyk':function(_0x15835d){return _0x15835d();},'iDgEb':function(_0x22ba09,_0x2fd1c1){return _0x22ba09(_0x2fd1c1);}},{envNames:_0x4eaf5a,activeEnv:_0x1121f4}=await _0x4c29ff['PUzyk'](getEnvNames),_0x16fd3f=getRangerDir();if(!_0x4c29ff[_0x4a37f1(0x1c9)](existsSync,_0x16fd3f))return{'envs':[],'activeEnv':null};const _0x4149dd=_0x4eaf5a['map'](_0x360cfd=>{const _0xfbcb18=_0x4a37f1,_0x5bae71=getEnvDir(_0x360cfd),_0xbe455b=join(_0x5bae71,_0xfbcb18(0x21c)),_0x30c11c=_0x4c29ff['OcJPX'](join,_0x5bae71,_0x4c29ff[_0xfbcb18(0x212)]),_0x3e823b=join(_0x5bae71,_0x4c29ff['TzInN']);return{'name':_0x360cfd,'settingsPath':_0x4c29ff['LRvhC'](existsSync,_0xbe455b)?_0xbe455b:'(not\x20found)','hasPlaintextAuth':existsSync(_0x30c11c),'hasEncryptedAuth':existsSync(_0x3e823b),'isActive':_0x4c29ff['poaZr'](_0x360cfd,_0x1121f4)};});return{'envs':_0x4149dd,'activeEnv':_0x1121f4};}export async function status(){const _0x16c63b=_0x263f84,_0x38ba4f={'EoHjq':function(_0x70df7a,_0x1998b5,_0x58412b){return _0x70df7a(_0x1998b5,_0x58412b);},'RbUiM':function(_0x57b3f8,_0x32ab1d){return _0x57b3f8(_0x32ab1d);},'pxSqY':function(_0x10e95,_0x159246){return _0x10e95(_0x159246);},'dKtEG':function(_0xbd4433){return _0xbd4433();},'lFJip':function(_0x52efce){return _0x52efce();},'RsTHP':function(_0x300df6,_0x11a89d){return _0x300df6===_0x11a89d;},'RLQEA':'configured','kNlVC':function(_0x19d337,_0x134d4f){return _0x19d337(_0x134d4f);},'pqLZT':'not_configured','Tlkem':'ranger@trailhead','kDUih':_0x16c63b(0x228),'luAUD':_0x16c63b(0x224),'HrAGK':_0x16c63b(0x1e7),'OPxGD':function(_0x44bf55){return _0x44bf55();},'DWGxC':_0x16c63b(0x1cc),'oLkpY':function(_0x520397,_0x103604){return _0x520397>_0x103604;},'vWeRx':_0x16c63b(0x21f),'CkGix':function(_0x370894,_0x3d463e){return _0x370894(_0x3d463e);},'EaXnc':function(_0x2bca7d,_0x47dd5b){return _0x2bca7d+_0x47dd5b;},'MzSIm':'no\x20session','aDjey':'plaintext','jlZVN':'none','UrOsp':function(_0x44a079,_0x1ee3db){return _0x44a079(_0x1ee3db);},'dcWgA':function(_0x3c47f6,_0x28a48e){return _0x3c47f6!==_0x28a48e;},'Ithxs':_0x16c63b(0x1de)};console['log'](_0x16c63b(0x1d9));const _0x24c58d=process['cwd'](),_0x3ccf9f=getRangerDir();if(!existsSync(_0x3ccf9f)){console[_0x16c63b(0x1da)]('Root:\x20'+_0x38ba4f['EoHjq'](link,_0x24c58d,_0x38ba4f['RbUiM'](bold,_0x38ba4f[_0x16c63b(0x21d)](basename,_0x24c58d)))),console['log']('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log'](_0x16c63b(0x211));return;}console['log'](_0x16c63b(0x222)+link(_0x24c58d,_0x38ba4f[_0x16c63b(0x20c)](bold,_0x38ba4f['RbUiM'](basename,_0x24c58d))));const _0x5f08fa=_0x38ba4f['dKtEG'](getCurrentVersion),_0x2e9479=getLatestVersion();if(_0x2e9479['version']&&_0x2e9479[_0x16c63b(0x21b)]!==_0x5f08fa)console['log']('Version:\x20'+_0x5f08fa+'\x20(latest:\x20'+_0x2e9479['version']+')'),console['log'](_0x16c63b(0x22b));else _0x2e9479[_0x16c63b(0x21b)]?console['log'](_0x16c63b(0x20b)+_0x5f08fa+_0x16c63b(0x1bd)):console[_0x16c63b(0x1da)](_0x16c63b(0x20b)+_0x5f08fa);const _0x4fe4de=await getToken();if(_0x4fe4de){const _0x1ae857=await getCurrentUser(_0x4fe4de);_0x1ae857[_0x16c63b(0x208)]?console['log'](_0x16c63b(0x1bc)+bold(_0x1ae857[_0x16c63b(0x1d8)][_0x16c63b(0x1c7)])):(console[_0x16c63b(0x1da)]('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log'](_0x16c63b(0x204)));}else console['log'](_0x16c63b(0x1c0)),console['log'](_0x16c63b(0x204));process[_0x16c63b(0x1d2)]['DEBUG']&&(console['log'](_0x16c63b(0x1f6)+getCurrentEnvironment()),console[_0x16c63b(0x1da)](_0x16c63b(0x1d0)+getApiBaseUrl()));console[_0x16c63b(0x1da)]('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x46d178=await _0x38ba4f[_0x16c63b(0x1f4)](getOpencodePluginStatus);if(_0x38ba4f['RsTHP'](_0x46d178['status'],_0x38ba4f['RLQEA']))console['log']('\x20\x20'+_0x38ba4f[_0x16c63b(0x1d5)](bold,_0x16c63b(0x219))+':\x20configured'),_0x46d178['details']&&console[_0x16c63b(0x1da)]('\x20\x20'+_0x46d178['details']);else _0x38ba4f[_0x16c63b(0x1fd)](_0x46d178[_0x16c63b(0x1cf)],_0x38ba4f[_0x16c63b(0x20e)])?(console['log'](_0x16c63b(0x1e3)),_0x46d178['details']&&console['log']('\x20\x20'+_0x46d178['details']),console[_0x16c63b(0x1da)]('\x20\x20Run:\x20ranger\x20setup\x20--opencode')):console['log']('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console['log'](_0x16c63b(0x1fc));const _0x37adb5=await getPluginInfo(_0x38ba4f[_0x16c63b(0x1f9)]);if(_0x37adb5){const _0x23af5e=_0x37adb5[_0x16c63b(0x1c1)]||_0x38ba4f[_0x16c63b(0x1e4)],_0x2dbf5f=_0x37adb5['enabled']?_0x16c63b(0x1e9):'disabled';console[_0x16c63b(0x1da)]('\x20\x20'+bold(_0x16c63b(0x215))+_0x16c63b(0x20f)+_0x23af5e+',\x20'+_0x2dbf5f+')');}else console['log']('\x20\x20Not\x20installed'),console[_0x16c63b(0x1da)](_0x38ba4f[_0x16c63b(0x1f5)]);console[_0x16c63b(0x1da)](_0x38ba4f[_0x16c63b(0x21e)]);const {project:_0x6ffff6,user:_0xa9991f}=await _0x38ba4f[_0x16c63b(0x1d1)](getInstalledSkills),_0xd8fd77=_0x6ffff6['filter'](_0x22fb9e=>RANGER_MANAGED_SKILLS[_0x16c63b(0x1d6)](_0x22fb9e[_0x16c63b(0x1be)])),_0xa2a411=_0xa9991f['filter'](_0x247ace=>RANGER_MANAGED_SKILLS['includes'](_0x247ace['name'])),_0x531a41=_0xd8fd77['length']+_0xa2a411['length'];if(_0x531a41===0x0)console[_0x16c63b(0x1da)](_0x38ba4f['DWGxC']),console['log'](_0x16c63b(0x22c));else{if(_0x38ba4f['oLkpY'](_0xd8fd77[_0x16c63b(0x206)],0x0)){console['log']('\x20\x20Project-level:');for(const _0x59687b of _0xd8fd77){console[_0x16c63b(0x1da)](_0x16c63b(0x1d3)+bold(_0x59687b['displayName'])+':\x20'+link(_0x59687b[_0x16c63b(0x1e1)],basename(_0x59687b['path'])));}}if(_0xa2a411['length']>0x0){console[_0x16c63b(0x1da)](_0x38ba4f[_0x16c63b(0x1f8)]);for(const _0x249cd7 of _0xa2a411){console[_0x16c63b(0x1da)](_0x16c63b(0x1d3)+bold(_0x249cd7['displayName'])+':\x20'+_0x38ba4f['EoHjq'](link,_0x249cd7[_0x16c63b(0x1e1)],_0x38ba4f[_0x16c63b(0x1d7)](basename,_0x249cd7['path'])));}}}console[_0x16c63b(0x1da)]('\x0a---\x20Profiles\x20---');const {envs:_0x280cda,activeEnv:_0x13cc10}=await getEnvironments();let _0x1cfd13=[];if(_0x4fe4de)try{_0x1cfd13=await _0x38ba4f[_0x16c63b(0x1f4)](listCloudProfiles);}catch{}const _0x55405b=_0x38ba4f['EaXnc'](_0x280cda['length'],_0x1cfd13[_0x16c63b(0x206)]);if(_0x55405b===0x0)console['log']('No\x20profiles\x20configured'),console[_0x16c63b(0x1da)](_0x16c63b(0x1c5));else{if(_0x55405b>0x5){const _0x56ed1c=[];_0x1cfd13['length']>0x0&&_0x56ed1c['push'](_0x1cfd13[_0x16c63b(0x206)]+_0x16c63b(0x223)),_0x280cda[_0x16c63b(0x206)]>0x0&&_0x56ed1c[_0x16c63b(0x1ea)](_0x280cda[_0x16c63b(0x206)]+_0x16c63b(0x1f1)),console[_0x16c63b(0x1da)](_0x55405b+'\x20profiles\x20configured\x20('+_0x56ed1c[_0x16c63b(0x225)](',\x20')+')'),_0x13cc10&&console[_0x16c63b(0x1da)](_0x16c63b(0x1bb)+_0x38ba4f['RbUiM'](bold,_0x13cc10)),console['log'](_0x16c63b(0x1eb));}else{for(const _0x4d8bca of _0x1cfd13){const _0x4bdffc=_0x38ba4f[_0x16c63b(0x1fd)](_0x4d8bca[_0x16c63b(0x1be)],_0x13cc10)?_0x16c63b(0x1cb):'';console['log']('\x20\x20'+bold(_0x4d8bca['name'])+'\x20[cloud]'+_0x4bdffc);const _0xfd916=_0x4d8bca[_0x16c63b(0x1db)]?_0x16c63b(0x214)+_0x4d8bca['sessionUpdatedAt']+')':_0x38ba4f[_0x16c63b(0x21a)];console['log'](_0x16c63b(0x1ed)+_0xfd916);}const _0x517ab9=new Set(_0x1cfd13['map'](_0x1e6538=>_0x1e6538['name']));for(const _0x42df72 of _0x280cda){if(_0x517ab9[_0x16c63b(0x220)](_0x42df72[_0x16c63b(0x1be)]))continue;const _0x4a4669=_0x42df72[_0x16c63b(0x1e2)]?'\x20(active)':'',_0x53a712=_0x42df72['hasEncryptedAuth']?'encrypted':_0x42df72[_0x16c63b(0x1ee)]?_0x38ba4f[_0x16c63b(0x1b9)]:_0x38ba4f[_0x16c63b(0x1e0)];console['log']('\x20\x20'+_0x38ba4f[_0x16c63b(0x20d)](bold,_0x42df72['name'])+_0x16c63b(0x1e5)+_0x4a4669),console[_0x16c63b(0x1da)]('\x20\x20\x20\x20Auth:\x20'+_0x53a712),_0x38ba4f[_0x16c63b(0x1fb)](_0x42df72[_0x16c63b(0x207)],_0x38ba4f[_0x16c63b(0x1e6)])&&console['log'](_0x16c63b(0x203)+link(_0x42df72['settingsPath'],_0x38ba4f[_0x16c63b(0x21d)](basename,_0x42df72['settingsPath'])));}if(!_0x13cc10){console['log'](_0x16c63b(0x201));const _0x32c67f=[..._0x1cfd13['map'](_0x3c5840=>_0x3c5840[_0x16c63b(0x1be)]),..._0x280cda[_0x16c63b(0x216)](_0x47f33c=>!_0x517ab9[_0x16c63b(0x220)](_0x47f33c[_0x16c63b(0x1be)]))[_0x16c63b(0x1f7)](_0x4af643=>_0x4af643[_0x16c63b(0x1be)])];console[_0x16c63b(0x1da)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x32c67f['join'](',\x20')+')');}}}console[_0x16c63b(0x1da)]('');}
|