@ranger-testing/ranger-cli 3.1.7-alpha.34400c2-56 → 3.1.7-alpha.44736ee-66
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/actors.js +1 -0
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/novaActCli.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/organizationEnvApi.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/rangerwrightCli.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/scenarioOriginCheck.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/tunnelClient.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/commands/verifyFeatureNovaCli.js +1 -1
- package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
- package/build/skills/ranger/SKILL.md +8 -0
- package/package.json +2 -2
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x4694(_0x2e0414,_0x19caec){_0x2e0414=_0x2e0414-0x72;const _0x11ffe7=_0x11ff();let _0x46943b=_0x11ffe7[_0x2e0414];return _0x46943b;}(function(_0x31cf46,_0x21d071){const _0x2be1fc=_0x4694,_0x2e3328=_0x31cf46();while(!![]){try{const _0x3aa81=-parseInt(_0x2be1fc(0x7e))/0x1+parseInt(_0x2be1fc(0x76))/0x2*(-parseInt(_0x2be1fc(0x7d))/0x3)+-parseInt(_0x2be1fc(0x77))/0x4+-parseInt(_0x2be1fc(0x82))/0x5+parseInt(_0x2be1fc(0x81))/0x6*(parseInt(_0x2be1fc(0x7b))/0x7)+parseInt(_0x2be1fc(0x74))/0x8*(-parseInt(_0x2be1fc(0x73))/0x9)+parseInt(_0x2be1fc(0x7f))/0xa*(parseInt(_0x2be1fc(0x78))/0xb);if(_0x3aa81===_0x21d071)break;else _0x2e3328['push'](_0x2e3328['shift']());}catch(_0x25eab1){_0x2e3328['push'](_0x2e3328['shift']());}}}(_0x11ff,0xa74bb));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';function _0x11ff(){const _0x52d84e=['Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','249390ThzetC','180862mNLfyx','3530ScwLat','Login\x20failed:\x20','318LhDEzi','2254360nojWRU','SePHN','7244298WbUEXj','8riIZDZ','success','12qKVOzK','3542876PlaonS','98318JXYnnN','log','\x0a✅\x20API\x20key\x20stored\x20successfully','46396skIJNS'];_0x11ff=function(){return _0x52d84e;};return _0x11ff();}import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0x3b1bcd=_0x4694,_0x334045={'FQWvL':'Re-authenticating\x20via\x20MCP\x20bootstrap...','SePHN':function(_0x272fd5){return _0x272fd5();}},_0x2302f7=await getMcpAuthOrigin();if(_0x2302f7){console[_0x3b1bcd(0x79)](_0x334045['FQWvL']),await mcpBootstrap();return;}if(!_0x334045[_0x3b1bcd(0x72)](isInteractive))throw new Error(_0x3b1bcd(0x7c));try{const _0x3e8258=await runDeviceAuthFlow(),_0x5bacd5=await getCurrentUser(_0x3e8258);_0x5bacd5[_0x3b1bcd(0x75)]?console[_0x3b1bcd(0x79)]('\x0a✅\x20Logged\x20in\x20to\x20'+_0x5bacd5['user']['organizationName']):console[_0x3b1bcd(0x79)](_0x3b1bcd(0x7a));}catch(_0x10857c){throw new Error(_0x3b1bcd(0x80)+(_0x10857c instanceof Error?_0x10857c['message']:_0x10857c));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x30a5a7=_0x4a9b;function _0x5ec4(){const _0x98aa48=['\x20done','type','initialize','client_secret','utf-8','2.0','hex','aSTiO','http://localhost:','dHQgF','MnELY','expiresAt','JNieh','slice','resource','aZPzH','notifications/initialized','closeAllConnections','text','result','message','expires_in','CiaEw','origin','74382AGUJru','ranger-cli','LAjsT','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','stringify','write','zLwlx','name','1661895EXhFGR','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','digest','hetUb','BGZbc','753651SYtbbl','POST','application/json','bpSjM','bcMye','MCP\x20initialize\x20failed:\x20','/callback','pAFIi','VsBMC','ikwLg','status','XBYGj','tqFIS','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','/.well-known/oauth-protected-resource','trim','.ranger','EOGBp','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','toString','aMCGK','Initializing\x20MCP\x20session...','content','client_id','state','string','NsCUp','WSQDO','XlrDH','bEepc','access_token','1315roCuiW','Client\x20registration\x20failed:\x20','log','split','token','structuredContent','bELpb','xdg-open','QjQOw','jqDkJ','get_cli_token','clientId','Nwrgm','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','18EKxHGF','code','OdwIX','ZvUGj','pKRHO','yzeuR','headers','text/html','MIVkd','MCDKH','bDnZq','clientSecret','yBveH','\x0aOpening\x20browser\x20for\x20authentication...','stdout','get','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','end','Ranger\x20CLI','civAp','error','378DEieyU','application/json,\x20text/event-stream','ugJTz','Not\x20found','authorization_servers','authorization_endpoint','writeHead','kASIP','32uyRaDa','refresh.txt','update','jpMqd','PvalS','none','AVKpZ','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','HTTP\x20','KjtIT','OAuthTimeoutError','DtsKl','error_description','isTTY','parse','3697170rYbHUe','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','hUVWq','BsjTz','now','UTvJL','set','proxied','zxOKr','XHVPC','listen','17548JbcfKQ','auth-origin.txt','RzqWN','authorization_code','json','dWuUa','197970wWGobn','oCsBK','41750346BMRqmv','then','2025-03-26','Exchanging\x20authorization\x20code...','uIbsv','open','jUoRr','searchParams'];_0x5ec4=function(){return _0x98aa48;};return _0x5ec4();}(function(_0x17d86e,_0xe24a5){const _0x5638ae=_0x4a9b,_0x4a3e8d=_0x17d86e();while(!![]){try{const _0x24d2c4=-parseInt(_0x5638ae(0xec))/0x1+parseInt(_0x5638ae(0xc2))/0x2*(parseInt(_0x5638ae(0x85))/0x3)+-parseInt(_0x5638ae(0xbc))/0x4*(parseInt(_0x5638ae(0x77))/0x5)+parseInt(_0x5638ae(0xe4))/0x6*(-parseInt(_0x5638ae(0x9a))/0x7)+-parseInt(_0x5638ae(0xa2))/0x8*(-parseInt(_0x5638ae(0xf1))/0x9)+-parseInt(_0x5638ae(0xb1))/0xa+parseInt(_0x5638ae(0xc4))/0xb;if(_0x24d2c4===_0xe24a5)break;else _0x4a3e8d['push'](_0x4a3e8d['shift']());}catch(_0xcf3979){_0x4a3e8d['push'](_0x4a3e8d['shift']());}}}(_0x5ec4,0xd4491));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x30a5a7(0xbd));export async function getMcpAuthOrigin(){const _0x469ec5=_0x30a5a7;try{const _0x2ed0da=(await readFile(AUTH_ORIGIN_PATH,_0x469ec5(0xd0)))['trim']();return _0x2ed0da||null;}catch{return null;}}export async function mcpBootstrap(){const _0x38f835=_0x30a5a7,_0x5a5a31={'ZvUGj':function(_0x32e2a2){return _0x32e2a2();},'ugJTz':function(_0x509a85,_0xbe7fd8){return _0x509a85(_0xbe7fd8);},'uhdKB':function(_0x27447d,_0x3b2731){return _0x27447d===_0x3b2731;},'HBtNx':'proxied','WSQDO':function(_0x5a0a47,_0x49ac3c){return _0x5a0a47+_0x49ac3c;},'MCDKH':function(_0xf608e2,_0x5244cb){return _0xf608e2(_0x5244cb);},'OhErW':function(_0x56e3ab,_0x2d395d,_0x4d0f10){return _0x56e3ab(_0x2d395d,_0x4d0f10);}},_0x295698=_0x5a5a31[_0x38f835(0x88)](getMcpAuthUrl);currentOrigin=_0x295698;const _0x3d687a=process[_0x38f835(0x93)][_0x38f835(0xaf)]??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x295698+'\x0a');const _0x10b4a4=await _0x5a5a31[_0x38f835(0x9c)](tryUnauthenticated,_0x295698);let _0x258d22=null;if(_0x5a5a31['uhdKB'](_0x10b4a4,_0x5a5a31['HBtNx']))_0x258d22='';else{_0x258d22=await _0x5a5a31[_0x38f835(0x88)](loadCachedToken);if(!_0x258d22){if(!_0x3d687a)throw new Error(_0x5a5a31[_0x38f835(0x73)](_0x38f835(0xb2),'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'));_0x258d22=await _0x5a5a31[_0x38f835(0x8e)](oauthFlow,_0x295698);}}await _0x5a5a31['OhErW'](callGetCliToken,_0x295698,_0x258d22);}async function tryUnauthenticated(_0x1651dc){const _0x19319c=_0x30a5a7,_0x27edf0={'EOGBp':function(_0x57db75,_0x38feb8,_0x158e7d){return _0x57db75(_0x38feb8,_0x158e7d);},'yzeuR':_0x19319c(0xf2),'zxOKr':'application/json,\x20text/event-stream','nOgAd':_0x19319c(0xd1),'ZkWyV':_0x19319c(0xce),'jqDkJ':'2025-03-26','LJhqL':_0x19319c(0xe5),'iFtFK':_0x19319c(0xb8),'drlmm':function(_0x9e8430,_0x4f8894){return _0x9e8430===_0x4f8894;}},_0x4bf58d=await _0x27edf0[_0x19319c(0x102)](fetch,_0x1651dc,{'method':_0x27edf0[_0x19319c(0x8a)],'headers':{'Content-Type':'application/json','Accept':_0x27edf0[_0x19319c(0xb9)]},'body':JSON[_0x19319c(0xe8)]({'jsonrpc':_0x27edf0['nOgAd'],'id':0x1,'method':_0x27edf0['ZkWyV'],'params':{'protocolVersion':_0x27edf0[_0x19319c(0x80)],'capabilities':{},'clientInfo':{'name':_0x27edf0['LJhqL'],'version':'1.0.0'}}})});if(_0x4bf58d['ok'])return await _0x4bf58d['text'](),_0x27edf0['iFtFK'];if(_0x27edf0['drlmm'](_0x4bf58d[_0x19319c(0xfb)],0x191))return await _0x4bf58d['text'](),'needs-oauth';const _0x5208ca=await _0x4bf58d[_0x19319c(0xde)]();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x4bf58d[_0x19319c(0xfb)]+':\x20'+_0x5208ca);}class OAuthTimeoutError extends Error{constructor(_0x3b93ad){const _0x3d6f0d=_0x30a5a7,_0x16c29b={'QjQOw':_0x3d6f0d(0xac)};super(_0x3b93ad),this[_0x3d6f0d(0xeb)]=_0x16c29b[_0x3d6f0d(0x7f)];}}async function oauthFlow(_0x3f55ce){const _0x4c230c={'wefQi':function(_0x59004c,_0x1d9e53){return _0x59004c(_0x1d9e53);},'ieysY':function(_0x592158,_0x2bdf53){return _0x592158 instanceof _0x2bdf53;},'gCTJx':function(_0x1565f6){return _0x1565f6();}};try{return await _0x4c230c['wefQi'](oauthFlowAttempt,_0x3f55ce);}catch(_0x2b9f04){if(_0x4c230c['ieysY'](_0x2b9f04,OAuthTimeoutError)&&await _0x4c230c['gCTJx'](loadCachedClient))return console['log']('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await _0x4c230c['gCTJx'](clearCachedClient),await oauthFlowAttempt(_0x3f55ce);throw _0x2b9f04;}}async function oauthFlowAttempt(_0x25a1fa){const _0x3fef66=_0x30a5a7,_0x40c624={'XlrDH':'Discovering\x20authorization\x20server...','pKRHO':_0x3fef66(0xe7),'dHQgF':function(_0xfd9d95,_0x19f7fb){return _0xfd9d95(_0x19f7fb);},'bDnZq':'Registering\x20OAuth\x20client...','vHKWk':_0x3fef66(0x97),'ZjIsz':function(_0x214f88,_0x3429e4,_0x1827ec){return _0x214f88(_0x3429e4,_0x1827ec);},'DtsKl':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','XHVPC':function(_0x221cbc,_0x23145f){return _0x221cbc(_0x23145f);},'zLwlx':'base64url','aMCGK':'sha256','NsCUp':function(_0x576d53,_0x2bf27f){return _0x576d53(_0x2bf27f);},'TFpFQ':_0x3fef66(0xd2),'BSsyP':'code','VsBMC':'resource','TtyGa':_0x3fef66(0x92),'hUVWq':_0x3fef66(0xbf),'gvrPn':'application/x-www-form-urlencoded','zRlSR':function(_0x2248bd,_0x5e168f,_0x51c7c6,_0x28f5bc){return _0x2248bd(_0x5e168f,_0x51c7c6,_0x28f5bc);}},_0x519eae=_0x25a1fa['replace'](/\/mcp$/,'');process['stdout']['write'](_0x40c624[_0x3fef66(0x74)]);const _0x28f85f=await fetch(_0x519eae+_0x3fef66(0xff));if(!_0x28f85f['ok'])throw new Error(_0x3fef66(0x95));const _0x156625=await _0x28f85f['json'](),_0x323b98=_0x156625[_0x3fef66(0x9e)]?.[0x0];if(!_0x323b98)throw new Error(_0x40c624[_0x3fef66(0x89)]);console['log']('\x20'+_0x323b98);const _0xe2f5cf=await _0x40c624[_0x3fef66(0xd5)](fetchAuthServerMetadata,_0x323b98);let _0x113320,_0x4c130a;const _0x5d0dcb=await loadCachedClient();if(_0x5d0dcb)_0x113320=_0x5d0dcb[_0x3fef66(0x82)],_0x4c130a=_0x5d0dcb[_0x3fef66(0x90)];else{if(_0xe2f5cf['registration_endpoint']){process[_0x3fef66(0x93)][_0x3fef66(0xe9)](_0x40c624[_0x3fef66(0x8f)]);const _0x597ce6=await fetch(_0xe2f5cf['registration_endpoint'],{'method':'POST','headers':{'Content-Type':'application/json'},'body':JSON['stringify']({'client_name':_0x40c624['vHKWk'],'redirect_uris':[_0x3fef66(0xd4)+CALLBACK_PORT+_0x3fef66(0xf7)],'grant_types':['authorization_code','refresh_token'],'response_types':[_0x3fef66(0x86)],'token_endpoint_auth_method':_0x3fef66(0xa7)})});if(!_0x597ce6['ok']){const _0x27ad8c=await _0x597ce6['text']();throw new Error(_0x3fef66(0x78)+_0x27ad8c);}const _0x2390d7=await _0x597ce6[_0x3fef66(0xc0)]();_0x113320=_0x2390d7[_0x3fef66(0x6f)],_0x4c130a=_0x2390d7['client_secret'],await _0x40c624['ZjIsz'](saveCachedClient,_0x113320,_0x4c130a),console[_0x3fef66(0x79)](_0x3fef66(0xcc));}else throw new Error(_0x40c624[_0x3fef66(0xad)]);}const _0x511e43=_0x40c624['XHVPC'](randomBytes,0x20)[_0x3fef66(0x6b)](_0x40c624['zLwlx']),_0xab237f=_0x40c624[_0x3fef66(0xba)](createHash,_0x40c624[_0x3fef66(0x6c)])[_0x3fef66(0xa4)](_0x511e43)[_0x3fef66(0xee)](_0x40c624[_0x3fef66(0xea)]),_0xb82781=_0x40c624[_0x3fef66(0x72)](randomBytes,0x10)[_0x3fef66(0x6b)](_0x40c624['TFpFQ']),_0x453f5e=new URL(_0xe2f5cf[_0x3fef66(0x9f)]);_0x453f5e['searchParams']['set']('response_type',_0x40c624['BSsyP']),_0x453f5e['searchParams']['set']('client_id',_0x113320),_0x453f5e['searchParams']['set']('redirect_uri','http://localhost:'+CALLBACK_PORT+_0x3fef66(0xf7)),_0x453f5e[_0x3fef66(0xcb)]['set']('code_challenge',_0xab237f),_0x453f5e[_0x3fef66(0xcb)]['set']('code_challenge_method','S256'),_0x453f5e[_0x3fef66(0xcb)]['set'](_0x3fef66(0x70),_0xb82781);_0x156625['resource']&&_0x453f5e[_0x3fef66(0xcb)]['set'](_0x40c624[_0x3fef66(0xf9)],_0x156625[_0x3fef66(0xda)]);console[_0x3fef66(0x79)](_0x40c624['TtyGa']),console['log'](_0x3fef66(0xfe)+_0x453f5e[_0x3fef66(0x6b)]()+'\x0a'),await openBrowser(_0x453f5e['toString']());const _0x24f059=await _0x40c624['XHVPC'](waitForCallback,_0xb82781);process[_0x3fef66(0x93)][_0x3fef66(0xe9)](_0x3fef66(0xc7));const _0x1727f9=new URLSearchParams({'grant_type':_0x40c624[_0x3fef66(0xb3)],'code':_0x24f059,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0x3fef66(0xf7),'client_id':_0x113320,'code_verifier':_0x511e43});_0x4c130a&&_0x1727f9['set'](_0x3fef66(0xcf),_0x4c130a);_0x156625[_0x3fef66(0xda)]&&_0x1727f9[_0x3fef66(0xb7)](_0x40c624[_0x3fef66(0xf9)],_0x156625[_0x3fef66(0xda)]);const _0x563e62=await _0x40c624['ZjIsz'](fetch,_0xe2f5cf['token_endpoint'],{'method':'POST','headers':{'Content-Type':_0x40c624['gvrPn']},'body':_0x1727f9});if(!_0x563e62['ok']){const _0x51050a=await _0x563e62[_0x3fef66(0xde)]();throw new Error('Token\x20exchange\x20failed:\x20'+_0x51050a);}const _0x1fff43=await _0x563e62['json']();return console[_0x3fef66(0x79)](_0x3fef66(0xcc)),await _0x40c624['zRlSR'](saveCachedToken,_0x1fff43[_0x3fef66(0x76)],_0x1fff43['refresh_token'],_0x1fff43[_0x3fef66(0xe1)]),_0x1fff43[_0x3fef66(0x76)];}async function callGetCliToken(_0x20edeb,_0x4e0424){const _0x57eb61=_0x30a5a7,_0x1d9e00={'BsjTz':function(_0x4938c9,_0xff80d3,_0x3847a2){return _0x4938c9(_0xff80d3,_0x3847a2);},'GDpzS':function(_0x4560c7,_0x4b087c){return _0x4560c7(_0x4b087c);},'TDJct':_0x57eb61(0x9b),'tNYOP':'Authorization','ebczc':_0x57eb61(0x6d),'Qxgob':function(_0x3c5c55,_0x40aaa5){return _0x3c5c55(_0x40aaa5);},'pAFIi':_0x57eb61(0xce),'MnELY':'ranger-cli','XBYGj':'\x20done','Nwrgm':function(_0x1be165,_0x536c86,_0x5c5580){return _0x1be165(_0x536c86,_0x5c5580);},'kASIP':'POST','MIVkd':_0x57eb61(0xd1),'vIpXu':'tools/call','Jdado':_0x57eb61(0x81),'xmVRw':_0x57eb61(0x103),'OMedH':_0x57eb61(0xa3),'JNieh':function(_0x11ed29,_0x54b047,_0xef4eba){return _0x11ed29(_0x54b047,_0xef4eba);},'CiaEw':function(_0x534bbd,_0x1f1ca6,_0x41fd5a,_0x426378){return _0x534bbd(_0x1f1ca6,_0x41fd5a,_0x426378);}},_0x1ee467={'Content-Type':_0x57eb61(0xf3),'Accept':_0x1d9e00['TDJct']};_0x4e0424&&(_0x1ee467[_0x1d9e00['tNYOP']]='Bearer\x20'+_0x4e0424);const _0x2e7127=async _0x2a5f8d=>{const _0xefe81e=_0x57eb61,_0x5e1cdd=await _0x1d9e00[_0xefe81e(0xb4)](fetch,_0x20edeb,{'method':_0xefe81e(0xf2),'headers':_0x1ee467,'body':JSON['stringify'](_0x2a5f8d)});if(!_0x5e1cdd['ok']){const _0x5db0c7=await _0x5e1cdd[_0xefe81e(0xde)]();throw new Error(_0xefe81e(0xaa)+_0x5e1cdd[_0xefe81e(0xfb)]+':\x20'+_0x5db0c7);}return _0x1d9e00['GDpzS'](parseResponse,_0x5e1cdd);};process['stdout']['write'](_0x1d9e00['ebczc']);const _0x286595=await _0x1d9e00['Qxgob'](_0x2e7127,{'jsonrpc':_0x57eb61(0xd1),'id':0x1,'method':_0x1d9e00[_0x57eb61(0xf8)],'params':{'protocolVersion':_0x57eb61(0xc6),'capabilities':{},'clientInfo':{'name':_0x1d9e00[_0x57eb61(0xd6)],'version':'1.0.0'}}});if(_0x286595['error'])throw new Error(_0x57eb61(0xf6)+(_0x286595['error'][_0x57eb61(0xe0)]??JSON[_0x57eb61(0xe8)](_0x286595['error'])));console['log'](_0x1d9e00[_0x57eb61(0xfc)]),await _0x1d9e00[_0x57eb61(0x83)](fetch,_0x20edeb,{'method':_0x1d9e00[_0x57eb61(0xa1)],'headers':_0x1ee467,'body':JSON['stringify']({'jsonrpc':_0x1d9e00[_0x57eb61(0x8d)],'method':_0x57eb61(0xdc)})})[_0x57eb61(0xc5)](_0x36ea58=>_0x36ea58['text']()),process['stdout'][_0x57eb61(0xe9)]('Requesting\x20CLI\x20token...');const _0x14e48f=await _0x1d9e00['GDpzS'](_0x2e7127,{'jsonrpc':_0x57eb61(0xd1),'id':0x2,'method':_0x1d9e00['vIpXu'],'params':{'name':_0x1d9e00['Jdado'],'arguments':{}}});if(_0x14e48f['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x14e48f[_0x57eb61(0x99)]['message']??JSON[_0x57eb61(0xe8)](_0x14e48f[_0x57eb61(0x99)])));console[_0x57eb61(0x79)](_0x57eb61(0xcc));const _0x24dd86=extractToken(_0x14e48f['result']);if(!_0x24dd86){console[_0x57eb61(0x99)]('\x0aUnexpected\x20response\x20structure:'),console[_0x57eb61(0x99)](JSON['stringify'](_0x14e48f[_0x57eb61(0xdf)],null,0x2));throw new Error(_0x1d9e00['xmVRw']);}const _0x5155f1=join(homedir(),'.ranger'),_0xe58e5c=_0x1d9e00['BsjTz'](join,_0x5155f1,_0x1d9e00['OMedH']);await _0x1d9e00[_0x57eb61(0xd8)](mkdir,_0x5155f1,{'recursive':!![]}),await writeFile(_0xe58e5c,_0x24dd86,{'mode':0x180}),await _0x1d9e00[_0x57eb61(0xe2)](writeFile,join(_0x5155f1,'auth-origin.txt'),_0x20edeb,{'mode':0x180}),console['log']('\x0aToken\x20written\x20to\x20'+_0xe58e5c),console[_0x57eb61(0x79)]('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0x146266){const _0xf0b46d=_0x30a5a7,_0x3ed482=_0x146266+'/.well-known/oauth-authorization-server',_0x33f267=await fetch(_0x3ed482);if(!_0x33f267['ok'])throw new Error(_0xf0b46d(0x84)+_0x3ed482+':\x20'+_0x33f267[_0xf0b46d(0xfb)]);return _0x33f267[_0xf0b46d(0xc0)]();}function waitForCallback(_0x47b9ec){const _0x1e08aa=_0x30a5a7,_0x38117b={'bcMye':function(_0x23eab7){return _0x23eab7();},'KjtIT':'OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','BGZbc':'/callback','aSTiO':_0x1e08aa(0x86),'rUsES':_0x1e08aa(0x99),'dWuUa':_0x1e08aa(0xae),'XxtYk':_0x1e08aa(0xa9),'bELpb':'127.0.0.1'};return new Promise((_0x30a8bc,_0x4aceed)=>{const _0x23a576=_0x1e08aa,_0x4e9ecf={'AVKpZ':function(_0x453d23){const _0x3fca11=_0x4a9b;return _0x38117b[_0x3fca11(0xf5)](_0x453d23);},'LAjsT':function(_0x12285a,_0x532436){return _0x12285a(_0x532436);},'jpMqd':_0x38117b[_0x23a576(0xab)],'ubAgU':_0x38117b[_0x23a576(0xf0)],'uIbsv':_0x23a576(0x9d),'kBbRs':_0x38117b[_0x23a576(0xd3)],'bEepc':_0x38117b['rUsES'],'MaYYb':_0x38117b[_0x23a576(0xc1)],'UnWQL':function(_0x46b440,_0x25cce1){return _0x46b440!==_0x25cce1;},'PvalS':_0x38117b['XxtYk']},_0x2b3c80=()=>{const _0x52fdc0=_0x23a576;_0x23aad9[_0x52fdc0(0xdd)](),_0x23aad9['close']();},_0x4eb72b=setTimeout(()=>{const _0x24658f=_0x23a576;_0x4e9ecf[_0x24658f(0xa8)](_0x2b3c80),_0x4e9ecf[_0x24658f(0xe6)](_0x4aceed,new OAuthTimeoutError(_0x4e9ecf[_0x24658f(0xa5)]));},0x1d4c0),_0x23aad9=createServer((_0x5d9ab4,_0x53fab9)=>{const _0x28482b=_0x23a576,_0x51fb97=new URL(_0x5d9ab4['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x51fb97['pathname']!==_0x4e9ecf['ubAgU']){_0x53fab9['writeHead'](0x194),_0x53fab9[_0x28482b(0x96)](_0x4e9ecf[_0x28482b(0xc8)]);return;}const _0x15f258=_0x51fb97['searchParams'][_0x28482b(0x94)](_0x4e9ecf['kBbRs']),_0x4b9a71=_0x51fb97['searchParams']['get'](_0x28482b(0x70)),_0x1ac5d4=_0x51fb97[_0x28482b(0xcb)][_0x28482b(0x94)](_0x4e9ecf[_0x28482b(0x75)]);if(_0x1ac5d4){const _0x5922e7=_0x51fb97['searchParams']['get'](_0x4e9ecf['MaYYb'])??_0x1ac5d4;_0x53fab9[_0x28482b(0xa0)](0xc8,{'Content-Type':_0x28482b(0x8c)}),_0x53fab9[_0x28482b(0x96)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x5922e7+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),_0x4e9ecf[_0x28482b(0xe6)](clearTimeout,_0x4eb72b),_0x2b3c80(),_0x4e9ecf['LAjsT'](_0x4aceed,new Error('OAuth\x20error:\x20'+_0x5922e7));return;}if(!_0x15f258||_0x4e9ecf['UnWQL'](_0x4b9a71,_0x47b9ec)){_0x53fab9[_0x28482b(0xa0)](0x190,{'Content-Type':'text/html'}),_0x53fab9[_0x28482b(0x96)](_0x4e9ecf[_0x28482b(0xa6)]);return;}_0x53fab9['writeHead'](0xc8,{'Content-Type':'text/html'}),_0x53fab9[_0x28482b(0x96)](_0x28482b(0xed)),_0x4e9ecf['LAjsT'](clearTimeout,_0x4eb72b),_0x2b3c80(),_0x4e9ecf[_0x28482b(0xe6)](_0x30a8bc,_0x15f258);});_0x23aad9[_0x23a576(0xbb)](CALLBACK_PORT,_0x38117b[_0x23a576(0x7d)]);});}async function openBrowser(_0xcd14f6){const _0x4016eb=_0x30a5a7,_0x47c46c={'naiFA':'win32','hetUb':'start','jUoRr':_0x4016eb(0x7e),'vdzQh':function(_0x29d810,_0x5b9aa7){return _0x29d810(_0x5b9aa7);}},_0x591d15=process['platform']==='darwin'?_0x4016eb(0xc9):process['platform']===_0x47c46c['naiFA']?_0x47c46c[_0x4016eb(0xef)]:_0x47c46c[_0x4016eb(0xca)];_0x47c46c['vdzQh'](exec,_0x591d15+'\x20\x22'+_0xcd14f6+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x358795=_0x30a5a7,_0x886076={'yBveH':function(_0x266fcc,_0xce7c71,_0x9ca5b3){return _0x266fcc(_0xce7c71,_0x9ca5b3);},'OdwIX':function(_0x46eae1,_0x55365d){return _0x46eae1>_0x55365d;}};try{const _0x4bbf95=JSON[_0x358795(0xb0)](await _0x886076[_0x358795(0x91)](readFile,TOKEN_CACHE_PATH,'utf-8'));if(_0x4bbf95[_0x358795(0xe3)]&&_0x4bbf95['origin']!==currentOrigin)return null;if(_0x4bbf95[_0x358795(0xd7)]&&_0x886076[_0x358795(0x87)](Date[_0x358795(0xb5)](),_0x4bbf95[_0x358795(0xd7)]))return null;return _0x4bbf95['accessToken']??null;}catch{return null;}}function _0x4a9b(_0x11e6ad,_0x1449c0){_0x11e6ad=_0x11e6ad-0x6b;const _0x5ec415=_0x5ec4();let _0x4a9b9c=_0x5ec415[_0x11e6ad];return _0x4a9b9c;}async function saveCachedToken(_0x40f547,_0x41a5b5,_0x9ded84){const _0x3c7f41=_0x30a5a7,_0x4a4e0c={'KtWVW':function(_0x316d4f,_0x22aa27){return _0x316d4f+_0x22aa27;},'aZPzH':function(_0x44fd8e,_0x2d1dc6){return _0x44fd8e*_0x2d1dc6;},'kKVNv':function(_0x4b4f56,_0x1cd5d4,_0x345af8){return _0x4b4f56(_0x1cd5d4,_0x345af8);},'wguZr':function(_0x4419e7){return _0x4419e7();},'bpSjM':function(_0x3cb756,_0x4e921e,_0x4e4a0a,_0x15ca68){return _0x3cb756(_0x4e921e,_0x4e4a0a,_0x15ca68);}},_0x4a5d73=await loadCachedData(),_0x5dffa3={..._0x4a5d73,'origin':currentOrigin,'accessToken':_0x40f547,'refreshToken':_0x41a5b5??_0x4a5d73?.['refreshToken'],'expiresAt':_0x9ded84?_0x4a4e0c['KtWVW'](Date['now'](),_0x4a4e0c[_0x3c7f41(0xdb)](_0x9ded84,0x3e8)):undefined};await _0x4a4e0c['kKVNv'](mkdir,join(_0x4a4e0c['wguZr'](homedir),_0x3c7f41(0x101)),{'recursive':!![]}),await _0x4a4e0c[_0x3c7f41(0xf4)](writeFile,TOKEN_CACHE_PATH,JSON[_0x3c7f41(0xe8)](_0x5dffa3),{'mode':0x180});}async function loadCachedClient(){const _0x1bfe68=_0x30a5a7,_0x1da485={'RzqWN':function(_0x8a2d9e){return _0x8a2d9e();},'tqFIS':function(_0x107115,_0x97eec5){return _0x107115!==_0x97eec5;}},_0x3e8630=await _0x1da485[_0x1bfe68(0xbe)](loadCachedData);if(_0x3e8630?.['origin']&&_0x1da485[_0x1bfe68(0xfd)](_0x3e8630['origin'],currentOrigin))return null;return _0x3e8630?.[_0x1bfe68(0x82)]?{'clientId':_0x3e8630['clientId'],'clientSecret':_0x3e8630[_0x1bfe68(0x90)]}:null;}async function clearCachedClient(){const _0x23c0ff=_0x30a5a7,_0x314527=await loadCachedData();if(!_0x314527)return;const {clientId:_0x5f1375,clientSecret:_0x4b497f,..._0x502721}=_0x314527;await writeFile(TOKEN_CACHE_PATH,JSON[_0x23c0ff(0xe8)](_0x502721),{'mode':0x180});}async function saveCachedClient(_0x5bb508,_0x2f5fb4){const _0x226006=_0x30a5a7,_0x5530f4={'ikwLg':function(_0x4fedb6){return _0x4fedb6();}},_0x10b5ee=await _0x5530f4[_0x226006(0xfa)](loadCachedData),_0x23b3bb={..._0x10b5ee,'origin':currentOrigin,'accessToken':_0x10b5ee?.['accessToken']??'','clientId':_0x5bb508,'clientSecret':_0x2f5fb4};await mkdir(join(homedir(),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x23b3bb),{'mode':0x180});}async function loadCachedData(){const _0x55c95d=_0x30a5a7,_0x41e616={'UTvJL':function(_0x592af7,_0x46134b,_0x5451bf){return _0x592af7(_0x46134b,_0x5451bf);},'FOQgh':'utf-8'};try{return JSON[_0x55c95d(0xb0)](await _0x41e616[_0x55c95d(0xb6)](readFile,TOKEN_CACHE_PATH,_0x41e616['FOQgh']));}catch{return null;}}async function parseResponse(_0x5bf8cb){const _0xa4fa91=_0x30a5a7,_0x43b44a={'oCDDE':'content-type','oozzb':'data:'},_0x3ddaba=_0x5bf8cb[_0xa4fa91(0x8b)]['get'](_0x43b44a['oCDDE'])??'';if(_0x3ddaba['includes']('text/event-stream')){const _0xde21c0=await _0x5bf8cb['text']();for(const _0x2d9505 of _0xde21c0[_0xa4fa91(0x7a)]('\x0a')){const _0x49343e=_0x2d9505[_0xa4fa91(0x100)]();if(_0x49343e['startsWith']('data:')){const _0x1d0342=_0x49343e[_0xa4fa91(0xd9)](_0x43b44a['oozzb']['length'])[_0xa4fa91(0x100)]();if(!_0x1d0342)continue;try{const _0x4d5417=JSON['parse'](_0x1d0342);if(_0x4d5417['id']!==undefined||_0x4d5417[_0xa4fa91(0x99)])return _0x4d5417;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x5bf8cb['json']();}function extractToken(_0x2d4374){const _0x41beb1=_0x30a5a7,_0x49e548={'oCsBK':function(_0x50da01,_0x1ae4a9){return _0x50da01===_0x1ae4a9;},'civAp':'text'};if(!_0x2d4374)return null;const _0x59c2f9=_0x2d4374[_0x41beb1(0x7c)];if(_0x59c2f9?.[_0x41beb1(0x7b)]&&typeof _0x59c2f9[_0x41beb1(0x7b)]===_0x41beb1(0x71))return _0x59c2f9[_0x41beb1(0x7b)];if(_0x2d4374['isError']){const _0x36cc34=_0x2d4374[_0x41beb1(0x6e)];throw new Error('Server\x20returned\x20error:\x20'+(_0x36cc34?.[0x0]?.[_0x41beb1(0xde)]??'Unknown\x20error'));}const _0x4ef4e1=_0x2d4374['content'];if(_0x4ef4e1)for(const _0x48ab65 of _0x4ef4e1){if(_0x49e548[_0x41beb1(0xc3)](_0x48ab65[_0x41beb1(0xcd)],_0x49e548[_0x41beb1(0x98)])&&_0x48ab65['text']){try{const _0xdced4b=JSON['parse'](_0x48ab65[_0x41beb1(0xde)]);if(typeof _0xdced4b?.['token']===_0x41beb1(0x71))return _0xdced4b['token'];}catch{}const _0x1ccf15=_0x48ab65[_0x41beb1(0xde)]['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x1ccf15)return _0x1ccf15[0x1];}}return null;}
|
|
1
|
+
const _0x167d0e=_0x590a;(function(_0x42f04b,_0x445788){const _0x138435=_0x590a,_0x388f18=_0x42f04b();while(!![]){try{const _0x12c084=-parseInt(_0x138435(0xe2))/0x1+-parseInt(_0x138435(0xda))/0x2*(parseInt(_0x138435(0xc6))/0x3)+parseInt(_0x138435(0x117))/0x4*(parseInt(_0x138435(0x147))/0x5)+-parseInt(_0x138435(0xe0))/0x6+parseInt(_0x138435(0xdd))/0x7+parseInt(_0x138435(0x140))/0x8+parseInt(_0x138435(0x121))/0x9;if(_0x12c084===_0x445788)break;else _0x388f18['push'](_0x388f18['shift']());}catch(_0x45deb9){_0x388f18['push'](_0x388f18['shift']());}}}(_0x265f,0x928fa));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger',_0x167d0e(0x13c)),AUTH_ORIGIN_PATH=join(homedir(),_0x167d0e(0xc3),_0x167d0e(0xcd));export async function getMcpAuthOrigin(){const _0x349ae7=_0x167d0e,_0x49ce02={'ejanp':function(_0x4dd926,_0x3046f9,_0x5de3d9){return _0x4dd926(_0x3046f9,_0x5de3d9);},'vxwfb':function(_0x3deede,_0x5144ea){return _0x3deede||_0x5144ea;}};try{const _0x4da360=(await _0x49ce02['ejanp'](readFile,AUTH_ORIGIN_PATH,_0x349ae7(0x14d)))['trim']();return _0x49ce02[_0x349ae7(0x116)](_0x4da360,null);}catch{return null;}}export async function mcpBootstrap(){const _0x5d5415=_0x167d0e,_0x407cd9={'FicNw':function(_0x2e81ae,_0x3df5a4){return _0x2e81ae(_0x3df5a4);},'kfiHJ':function(_0x2a7223,_0x2466c2){return _0x2a7223===_0x2466c2;},'Igmkx':function(_0x5601dc,_0x20e445){return _0x5601dc+_0x20e445;},'WnAmj':'MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','QArXc':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','qTDbF':function(_0x5007d9,_0x3885e3,_0x3be99d){return _0x5007d9(_0x3885e3,_0x3be99d);}},_0x27dc2b=getMcpAuthUrl();currentOrigin=_0x27dc2b;const _0x36b15e=process[_0x5d5415(0x14b)][_0x5d5415(0x107)]??![];console[_0x5d5415(0xcf)](_0x5d5415(0xca)+_0x27dc2b+'\x0a');const _0x2bca0e=await _0x407cd9['FicNw'](tryUnauthenticated,_0x27dc2b);let _0x5a6382=null;if(_0x407cd9[_0x5d5415(0xe7)](_0x2bca0e,_0x5d5415(0xde)))_0x5a6382='';else{_0x5a6382=await loadCachedToken();if(!_0x5a6382){if(!_0x36b15e)throw new Error(_0x407cd9[_0x5d5415(0xe1)](_0x407cd9['WnAmj'],_0x407cd9['QArXc']));_0x5a6382=await _0x407cd9[_0x5d5415(0x13e)](oauthFlow,_0x27dc2b);}}await _0x407cd9[_0x5d5415(0x13d)](callGetCliToken,_0x27dc2b,_0x5a6382);}async function tryUnauthenticated(_0x2293ad){const _0x46eb3f=_0x167d0e,_0x26bec8={'Lhwfj':function(_0x1a41f8,_0x4bdebe,_0x461a75){return _0x1a41f8(_0x4bdebe,_0x461a75);},'QlPqO':'2.0','UnVma':'2025-03-26','kjcbA':'ranger-cli','sijah':_0x46eb3f(0xc2),'vxSPB':function(_0x41a998,_0x2698d4){return _0x41a998===_0x2698d4;}},_0x270e59=await _0x26bec8['Lhwfj'](fetch,_0x2293ad,{'method':'POST','headers':{'Content-Type':'application/json','Accept':_0x46eb3f(0x144)},'body':JSON['stringify']({'jsonrpc':_0x26bec8[_0x46eb3f(0x12d)],'id':0x1,'method':_0x46eb3f(0xcc),'params':{'protocolVersion':_0x26bec8[_0x46eb3f(0x129)],'capabilities':{},'clientInfo':{'name':_0x26bec8['kjcbA'],'version':_0x26bec8[_0x46eb3f(0x145)]}}})});if(_0x270e59['ok'])return await _0x270e59['text'](),_0x46eb3f(0xde);if(_0x26bec8['vxSPB'](_0x270e59['status'],0x191))return await _0x270e59[_0x46eb3f(0x131)](),'needs-oauth';const _0x212068=await _0x270e59['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x270e59[_0x46eb3f(0x112)]+':\x20'+_0x212068);}class OAuthTimeoutError extends Error{constructor(_0x2e9011){const _0x10860b={'ZTcYj':'OAuthTimeoutError'};super(_0x2e9011),this['name']=_0x10860b['ZTcYj'];}}async function oauthFlow(_0x2aee50){const _0x2d4d06=_0x167d0e,_0x3a4d8b={'skFkf':function(_0x2154f3,_0x15dc94){return _0x2154f3 instanceof _0x15dc94;},'ZwMAb':_0x2d4d06(0x113),'gRyws':function(_0x612579){return _0x612579();}};try{return await oauthFlowAttempt(_0x2aee50);}catch(_0x506aa2){if(_0x3a4d8b[_0x2d4d06(0x104)](_0x506aa2,OAuthTimeoutError)&&await loadCachedClient())return console['log'](_0x3a4d8b[_0x2d4d06(0x134)]),await _0x3a4d8b['gRyws'](clearCachedClient),await oauthFlowAttempt(_0x2aee50);throw _0x506aa2;}}async function oauthFlowAttempt(_0x59f31d){const _0x3048d3=_0x167d0e,_0x17d9eb={'vWgqF':'Discovering\x20authorization\x20server...','ZFpFm':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','GzDse':'application/json','ikWkt':function(_0x7ed4c7,_0x530225){return _0x7ed4c7(_0x530225);},'SkNXZ':_0x3048d3(0x124),'BlgZM':function(_0x53d324,_0x2a9372){return _0x53d324(_0x2a9372);},'wvHPs':'hex','ljwfm':'client_id','zKMUk':_0x3048d3(0xbc),'TVtCl':_0x3048d3(0xc0),'mmcuz':_0x3048d3(0xed),'SzRwR':_0x3048d3(0x11b),'eyrCH':_0x3048d3(0x149),'fmyBb':'POST','Odqci':_0x3048d3(0xe4)},_0x562bd0=_0x59f31d[_0x3048d3(0xf1)](/\/mcp$/,'');process[_0x3048d3(0x14b)][_0x3048d3(0x118)](_0x17d9eb['vWgqF']);const _0x391927=await fetch(_0x562bd0+_0x3048d3(0xe5));if(!_0x391927['ok'])throw new Error('Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server');const _0x7d7113=await _0x391927[_0x3048d3(0x130)](),_0x53f534=_0x7d7113[_0x3048d3(0x10d)]?.[0x0];if(!_0x53f534)throw new Error(_0x17d9eb['ZFpFm']);console[_0x3048d3(0xcf)]('\x20'+_0x53f534);const _0x81e881=await fetchAuthServerMetadata(_0x53f534);let _0x2c72d8,_0x32f2b2;const _0x5eb2fc=await loadCachedClient();if(_0x5eb2fc)_0x2c72d8=_0x5eb2fc['clientId'],_0x32f2b2=_0x5eb2fc[_0x3048d3(0x105)];else{if(_0x81e881[_0x3048d3(0x10a)]){process['stdout']['write'](_0x3048d3(0x111));const _0x448d00=await fetch(_0x81e881['registration_endpoint'],{'method':_0x3048d3(0x14a),'headers':{'Content-Type':_0x17d9eb['GzDse']},'body':JSON['stringify']({'client_name':'Ranger\x20CLI','redirect_uris':[_0x3048d3(0xfe)+CALLBACK_PORT+'/callback'],'grant_types':['authorization_code',_0x3048d3(0xc8)],'response_types':['code'],'token_endpoint_auth_method':'none'})});if(!_0x448d00['ok']){const _0x57f1f3=await _0x448d00['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x57f1f3);}const _0x1066d6=await _0x448d00['json']();_0x2c72d8=_0x1066d6['client_id'],_0x32f2b2=_0x1066d6['client_secret'],await saveCachedClient(_0x2c72d8,_0x32f2b2),console[_0x3048d3(0xcf)](_0x3048d3(0x108));}else throw new Error(_0x3048d3(0xb9));}const _0x59d16a=_0x17d9eb[_0x3048d3(0x136)](randomBytes,0x20)[_0x3048d3(0xfa)](_0x17d9eb['SkNXZ']),_0x24814c=_0x17d9eb['BlgZM'](createHash,_0x3048d3(0xe9))['update'](_0x59d16a)['digest'](_0x17d9eb[_0x3048d3(0xff)]),_0x392e4b=randomBytes(0x10)[_0x3048d3(0xfa)](_0x17d9eb['wvHPs']),_0x5676f8=new URL(_0x81e881['authorization_endpoint']);_0x5676f8[_0x3048d3(0xc4)]['set']('response_type','code'),_0x5676f8[_0x3048d3(0xc4)]['set'](_0x17d9eb[_0x3048d3(0xf9)],_0x2c72d8),_0x5676f8[_0x3048d3(0xc4)]['set'](_0x3048d3(0xea),_0x3048d3(0xfe)+CALLBACK_PORT+_0x3048d3(0x12f)),_0x5676f8[_0x3048d3(0xc4)][_0x3048d3(0xd0)](_0x17d9eb[_0x3048d3(0x109)],_0x24814c),_0x5676f8['searchParams']['set'](_0x3048d3(0x115),_0x17d9eb[_0x3048d3(0xb8)]),_0x5676f8['searchParams']['set']('state',_0x392e4b);_0x7d7113[_0x3048d3(0xed)]&&_0x5676f8['searchParams']['set'](_0x17d9eb[_0x3048d3(0x13a)],_0x7d7113[_0x3048d3(0xed)]);console['log'](_0x3048d3(0x100)),console[_0x3048d3(0xcf)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x5676f8['toString']()+'\x0a'),await _0x17d9eb['ikWkt'](openBrowser,_0x5676f8[_0x3048d3(0xfa)]());const _0x1f0699=await waitForCallback(_0x392e4b);process[_0x3048d3(0x14b)]['write'](_0x17d9eb[_0x3048d3(0xd1)]);const _0x4c6ce7=new URLSearchParams({'grant_type':_0x17d9eb[_0x3048d3(0x141)],'code':_0x1f0699,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0x3048d3(0x12f),'client_id':_0x2c72d8,'code_verifier':_0x59d16a});_0x32f2b2&&_0x4c6ce7['set']('client_secret',_0x32f2b2);_0x7d7113['resource']&&_0x4c6ce7['set']('resource',_0x7d7113['resource']);const _0x21eb77=await fetch(_0x81e881['token_endpoint'],{'method':_0x17d9eb[_0x3048d3(0xfc)],'headers':{'Content-Type':_0x17d9eb[_0x3048d3(0x12a)]},'body':_0x4c6ce7});if(!_0x21eb77['ok']){const _0x231505=await _0x21eb77[_0x3048d3(0x131)]();throw new Error(_0x3048d3(0x137)+_0x231505);}const _0x2f0156=await _0x21eb77['json']();return console[_0x3048d3(0xcf)](_0x3048d3(0x108)),await saveCachedToken(_0x2f0156['access_token'],_0x2f0156[_0x3048d3(0xc8)],_0x2f0156['expires_in']),_0x2f0156['access_token'];}async function callGetCliToken(_0x1db705,_0x2e65bc){const _0x2c3494=_0x167d0e,_0xa45b21={'AMRzt':'POST','jNKfe':'application/json,\x20text/event-stream','ntDXK':_0x2c3494(0xe6),'sKtfr':_0x2c3494(0xbf),'CYWvN':'2.0','sBLhA':'\x20done','kfoKV':'tools/call','nLYqM':'get_cli_token','OCrsQ':function(_0xe33ece,_0x4622eb,_0x2ed8bb){return _0xe33ece(_0x4622eb,_0x2ed8bb);},'QLqFG':_0x2c3494(0xc3),'zkagL':function(_0x21a5c5,_0x139232,_0x4f947c){return _0x21a5c5(_0x139232,_0x4f947c);},'mjPuo':function(_0x105da4,_0x5cd7f0,_0x35d910,_0xb6b565){return _0x105da4(_0x5cd7f0,_0x35d910,_0xb6b565);}},_0x5d1d1e={'Content-Type':_0x2c3494(0x11d),'Accept':_0xa45b21[_0x2c3494(0xd9)]};_0x2e65bc&&(_0x5d1d1e[_0xa45b21['ntDXK']]='Bearer\x20'+_0x2e65bc);const _0x375c3c=async _0x3a63fc=>{const _0x22f3fa=_0x2c3494,_0x2e0c37=await fetch(_0x1db705,{'method':_0xa45b21[_0x22f3fa(0xec)],'headers':_0x5d1d1e,'body':JSON[_0x22f3fa(0xf4)](_0x3a63fc)});if(!_0x2e0c37['ok']){const _0x5a85cd=await _0x2e0c37['text']();throw new Error('HTTP\x20'+_0x2e0c37['status']+':\x20'+_0x5a85cd);}return parseResponse(_0x2e0c37);};process[_0x2c3494(0x14b)][_0x2c3494(0x118)](_0xa45b21[_0x2c3494(0xc7)]);const _0x4fdf25=await _0x375c3c({'jsonrpc':_0xa45b21[_0x2c3494(0x126)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x2c3494(0xd3),'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x2c3494(0xc2)}}});if(_0x4fdf25['error'])throw new Error(_0x2c3494(0x12b)+(_0x4fdf25['error'][_0x2c3494(0xf8)]??JSON[_0x2c3494(0xf4)](_0x4fdf25['error'])));console[_0x2c3494(0xcf)](_0xa45b21[_0x2c3494(0xeb)]),await fetch(_0x1db705,{'method':'POST','headers':_0x5d1d1e,'body':JSON['stringify']({'jsonrpc':_0x2c3494(0x120),'method':_0x2c3494(0xe3)})})[_0x2c3494(0x12c)](_0x5bb1e4=>_0x5bb1e4[_0x2c3494(0x131)]()),process['stdout']['write']('Requesting\x20CLI\x20token...');const _0x1506be=await _0x375c3c({'jsonrpc':_0x2c3494(0x120),'id':0x2,'method':_0xa45b21[_0x2c3494(0x12e)],'params':{'name':_0xa45b21['nLYqM'],'arguments':{}}});if(_0x1506be['error'])throw new Error(_0x2c3494(0x132)+(_0x1506be[_0x2c3494(0x133)][_0x2c3494(0xf8)]??JSON['stringify'](_0x1506be[_0x2c3494(0x133)])));console[_0x2c3494(0xcf)]('\x20done');const _0x43eba2=extractToken(_0x1506be[_0x2c3494(0xd7)]);if(!_0x43eba2){console[_0x2c3494(0x133)](_0x2c3494(0xee)),console[_0x2c3494(0x133)](JSON[_0x2c3494(0xf4)](_0x1506be[_0x2c3494(0xd7)],null,0x2));throw new Error(_0x2c3494(0x13f));}const _0x387b7a=_0xa45b21['OCrsQ'](join,homedir(),_0xa45b21['QLqFG']),_0x4ba3a5=_0xa45b21[_0x2c3494(0xf7)](join,_0x387b7a,'refresh.txt');await mkdir(_0x387b7a,{'recursive':!![]}),await writeFile(_0x4ba3a5,_0x43eba2,{'mode':0x180}),await _0xa45b21[_0x2c3494(0xba)](writeFile,join(_0x387b7a,_0x2c3494(0xcd)),_0x1db705,{'mode':0x180}),console['log']('\x0aToken\x20written\x20to\x20'+_0x4ba3a5),console[_0x2c3494(0xcf)]('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0xccf5d0){const _0x2aec8b=_0x167d0e,_0x227409={'LyMYM':function(_0x29f678,_0x6cb09c){return _0x29f678(_0x6cb09c);}},_0x20b2a9=_0xccf5d0+_0x2aec8b(0x10b),_0x355456=await _0x227409['LyMYM'](fetch,_0x20b2a9);if(!_0x355456['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x20b2a9+':\x20'+_0x355456['status']);return _0x355456[_0x2aec8b(0x130)]();}function waitForCallback(_0x452e68){const _0x1d5b72=_0x167d0e,_0x1c903d={'YQfhn':_0x1d5b72(0x138),'sHnQX':_0x1d5b72(0xf6),'fLPTv':'error','RVfjF':'error_description','YuiXJ':function(_0x221eb4,_0x55fafd){return _0x221eb4(_0x55fafd);},'pmTMV':function(_0x45b522){return _0x45b522();},'ulMLI':function(_0x4dded2,_0x39911a){return _0x4dded2!==_0x39911a;},'kKUHm':_0x1d5b72(0xd2),'rMibA':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','svAVP':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','qLqIL':function(_0x4be25f){return _0x4be25f();},'qbgIx':function(_0x4fb188,_0x1ed32d,_0x82c983){return _0x4fb188(_0x1ed32d,_0x82c983);},'lfOIE':'127.0.0.1'};return new Promise((_0x2b96be,_0x498768)=>{const _0xd8ac7a=_0x1d5b72,_0x2bf2e6={'qkMYG':function(_0x28fdbb){return _0x1c903d['qLqIL'](_0x28fdbb);}},_0x566d42=()=>{const _0xb3ee87=_0x590a;_0x384c15[_0xb3ee87(0xbe)](),_0x384c15['close']();},_0x4159f9=_0x1c903d[_0xd8ac7a(0x10f)](setTimeout,()=>{const _0x27eae6=_0xd8ac7a;_0x2bf2e6[_0x27eae6(0xf3)](_0x566d42),_0x498768(new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x384c15=_0x1c903d[_0xd8ac7a(0x11e)](createServer,(_0x461b27,_0x1f1b25)=>{const _0xe03c83=_0xd8ac7a,_0xc9fa3b=new URL(_0x461b27[_0xe03c83(0x11a)]??'/',_0xe03c83(0xfe)+CALLBACK_PORT);if(_0xc9fa3b['pathname']!=='/callback'){_0x1f1b25['writeHead'](0x194),_0x1f1b25['end'](_0x1c903d['YQfhn']);return;}const _0x3da2d8=_0xc9fa3b[_0xe03c83(0xc4)][_0xe03c83(0xfb)](_0x1c903d['sHnQX']),_0x2d5843=_0xc9fa3b['searchParams']['get'](_0xe03c83(0x114)),_0x1f8849=_0xc9fa3b['searchParams'][_0xe03c83(0xfb)](_0x1c903d[_0xe03c83(0x146)]);if(_0x1f8849){const _0x83dfca=_0xc9fa3b[_0xe03c83(0xc4)]['get'](_0x1c903d[_0xe03c83(0xd5)])??_0x1f8849;_0x1f1b25[_0xe03c83(0x101)](0xc8,{'Content-Type':'text/html'}),_0x1f1b25['end']('<html><body><h2>Authentication\x20failed</h2><p>'+_0x83dfca+_0xe03c83(0xce)),_0x1c903d[_0xe03c83(0x11e)](clearTimeout,_0x4159f9),_0x1c903d[_0xe03c83(0x122)](_0x566d42),_0x498768(new Error(_0xe03c83(0x110)+_0x83dfca));return;}if(!_0x3da2d8||_0x1c903d['ulMLI'](_0x2d5843,_0x452e68)){_0x1f1b25['writeHead'](0x190,{'Content-Type':_0x1c903d[_0xe03c83(0x123)]}),_0x1f1b25[_0xe03c83(0x14e)](_0x1c903d['rMibA']);return;}_0x1f1b25['writeHead'](0xc8,{'Content-Type':_0x1c903d['kKUHm']}),_0x1f1b25[_0xe03c83(0x14e)](_0x1c903d['svAVP']),_0x1c903d[_0xe03c83(0x11e)](clearTimeout,_0x4159f9),_0x1c903d['qLqIL'](_0x566d42),_0x2b96be(_0x3da2d8);});_0x384c15['listen'](CALLBACK_PORT,_0x1c903d[_0xd8ac7a(0xe8)]);});}async function openBrowser(_0x436945){const _0x26f925=_0x167d0e,_0xd4253={'XKHhv':function(_0x420fbc,_0x2b186f){return _0x420fbc===_0x2b186f;},'XQyoN':'open','BlWDd':_0x26f925(0x143),'qMTvD':_0x26f925(0x148),'HQcOh':function(_0x5d6574,_0x10f8fb){return _0x5d6574(_0x10f8fb);}},_0x2ddd6c=_0xd4253['XKHhv'](process[_0x26f925(0xf2)],_0x26f925(0xfd))?_0xd4253[_0x26f925(0x102)]:process[_0x26f925(0xf2)]===_0xd4253[_0x26f925(0xbb)]?'start':_0xd4253[_0x26f925(0xd6)];_0xd4253[_0x26f925(0x139)](exec,_0x2ddd6c+'\x20\x22'+_0x436945+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0xbe3899=_0x167d0e;try{const _0x247650=JSON['parse'](await readFile(TOKEN_CACHE_PATH,'utf-8'));if(_0x247650[_0xbe3899(0xf0)]&&_0x247650['origin']!==currentOrigin)return null;if(_0x247650['expiresAt']&&Date[_0xbe3899(0xc9)]()>_0x247650[_0xbe3899(0x11c)])return null;return _0x247650[_0xbe3899(0xd4)]??null;}catch{return null;}}async function saveCachedToken(_0x500986,_0x38ec66,_0x3b5a26){const _0x284556=_0x167d0e,_0x434e8a={'bflVN':function(_0x4b6925){return _0x4b6925();},'kNqds':function(_0x3da21c,_0x12aefd){return _0x3da21c+_0x12aefd;},'vtXCz':function(_0x241105,_0x64fa4,_0x5198d5){return _0x241105(_0x64fa4,_0x5198d5);},'JchoX':function(_0x3515dd){return _0x3515dd();},'OopwK':'.ranger'},_0x336b30=await _0x434e8a[_0x284556(0x106)](loadCachedData),_0x20c88f={..._0x336b30,'origin':currentOrigin,'accessToken':_0x500986,'refreshToken':_0x38ec66??_0x336b30?.[_0x284556(0x103)],'expiresAt':_0x3b5a26?_0x434e8a['kNqds'](Date['now'](),_0x3b5a26*0x3e8):undefined};await _0x434e8a[_0x284556(0xdb)](mkdir,join(_0x434e8a[_0x284556(0x14c)](homedir),_0x434e8a[_0x284556(0x119)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x20c88f),{'mode':0x180});}async function loadCachedClient(){const _0x38359c=_0x167d0e,_0x4097e8={'adUrf':function(_0x200986){return _0x200986();},'PqQet':function(_0x87ce1d,_0x14e931){return _0x87ce1d!==_0x14e931;}},_0x4655af=await _0x4097e8[_0x38359c(0x10e)](loadCachedData);if(_0x4655af?.['origin']&&_0x4097e8[_0x38359c(0xdc)](_0x4655af[_0x38359c(0xf0)],currentOrigin))return null;return _0x4655af?.['clientId']?{'clientId':_0x4655af[_0x38359c(0x135)],'clientSecret':_0x4655af['clientSecret']}:null;}function _0x265f(){const _0x4447f7=['error','ZwMAb','clientId','ikWkt','Token\x20exchange\x20failed:\x20','Not\x20found','HQcOh','mmcuz','EptYt','mcp-oauth-tokens.json','qTDbF','FicNw','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','5279688CBLxyP','eyrCH','qSLdC','win32','application/json,\x20text/event-stream','sijah','fLPTv','3230CDdSZa','xdg-open','authorization_code','POST','stdout','JchoX','utf-8','end','TVtCl','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','mjPuo','BlWDd','code_challenge','split','closeAllConnections','Initializing\x20MCP\x20session...','S256','NoHbx','1.0.0','.ranger','searchParams','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','3473679ebwSiI','sKtfr','refresh_token','now','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','slice','initialize','auth-origin.txt','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','log','set','SzRwR','text/html','2025-03-26','accessToken','RVfjF','qMTvD','result','TnPYN','jNKfe','2sfFkWf','vtXCz','PqQet','6152076gYTBQR','proxied','text/event-stream','4568520tcCwXe','Igmkx','379412oXgefa','notifications/initialized','application/x-www-form-urlencoded','/.well-known/oauth-protected-resource','Authorization','kfiHJ','lfOIE','sha256','redirect_uri','sBLhA','AMRzt','resource','\x0aUnexpected\x20response\x20structure:','Server\x20returned\x20error:\x20','origin','replace','platform','qkMYG','stringify','token','code','zkagL','message','ljwfm','toString','get','fmyBb','darwin','http://localhost:','SkNXZ','\x0aOpening\x20browser\x20for\x20authentication...','writeHead','XQyoN','refreshToken','skFkf','clientSecret','bflVN','isTTY','\x20done','zKMUk','registration_endpoint','/.well-known/oauth-authorization-server','isError','authorization_servers','adUrf','qbgIx','OAuth\x20error:\x20','Registering\x20OAuth\x20client...','status','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','state','code_challenge_method','vxwfb','468UhgdBZ','write','OopwK','url','Exchanging\x20authorization\x20code...','expiresAt','application/json','YuiXJ','UBDKn','2.0','11561652VKxhRw','pmTMV','kKUHm','base64url','startsWith','CYWvN','parse','content','UnVma','Odqci','MCP\x20initialize\x20failed:\x20','then','QlPqO','kfoKV','/callback','json','text','get_cli_token\x20failed:\x20'];_0x265f=function(){return _0x4447f7;};return _0x265f();}async function clearCachedClient(){const _0x593c32=_0x167d0e,_0x99a4e9={'fltnc':function(_0x1280b0){return _0x1280b0();}},_0x5251d9=await _0x99a4e9['fltnc'](loadCachedData);if(!_0x5251d9)return;const {clientId:_0x46c892,clientSecret:_0x17aa67,..._0x50a7ba}=_0x5251d9;await writeFile(TOKEN_CACHE_PATH,JSON[_0x593c32(0xf4)](_0x50a7ba),{'mode':0x180});}function _0x590a(_0xdda0dc,_0x3cf717){_0xdda0dc=_0xdda0dc-0xb8;const _0x265fa1=_0x265f();let _0x590a06=_0x265fa1[_0xdda0dc];return _0x590a06;}async function saveCachedClient(_0x4a5b43,_0x3d407a){const _0x165a53=_0x167d0e,_0x25bb3f={'TnPYN':function(_0x2259f8,_0x5a77c2,_0x542f00,_0x5a39a1){return _0x2259f8(_0x5a77c2,_0x542f00,_0x5a39a1);}},_0x44b8cc=await loadCachedData(),_0xdfdc3c={..._0x44b8cc,'origin':currentOrigin,'accessToken':_0x44b8cc?.[_0x165a53(0xd4)]??'','clientId':_0x4a5b43,'clientSecret':_0x3d407a};await mkdir(join(homedir(),_0x165a53(0xc3)),{'recursive':!![]}),await _0x25bb3f[_0x165a53(0xd8)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0xdfdc3c),{'mode':0x180});}async function loadCachedData(){const _0x3d4943=_0x167d0e;try{return JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x3d4943(0x14d)));}catch{return null;}}async function parseResponse(_0x3bdc0e){const _0x1f6edf=_0x167d0e,_0x26b08e={'EptYt':_0x1f6edf(0xdf),'NoHbx':'data:'},_0x1023c4=_0x3bdc0e['headers'][_0x1f6edf(0xfb)]('content-type')??'';if(_0x1023c4['includes'](_0x26b08e[_0x1f6edf(0x13b)])){const _0x11a3fb=await _0x3bdc0e[_0x1f6edf(0x131)]();for(const _0x24a1b2 of _0x11a3fb[_0x1f6edf(0xbd)]('\x0a')){const _0x3e4fd5=_0x24a1b2['trim']();if(_0x3e4fd5[_0x1f6edf(0x125)](_0x26b08e['NoHbx'])){const _0x4bfd19=_0x3e4fd5[_0x1f6edf(0xcb)](_0x26b08e[_0x1f6edf(0xc1)]['length'])['trim']();if(!_0x4bfd19)continue;try{const _0x298772=JSON['parse'](_0x4bfd19);if(_0x298772['id']!==undefined||_0x298772[_0x1f6edf(0x133)])return _0x298772;}catch{}}}throw new Error(_0x1f6edf(0xc5));}return _0x3bdc0e['json']();}function extractToken(_0x12da51){const _0x217de1=_0x167d0e,_0x5a3761={'UBDKn':function(_0xd3aac2,_0x56f8cf){return _0xd3aac2===_0x56f8cf;},'qSLdC':'string','WxHLv':'text'};if(!_0x12da51)return null;const _0x2cb22b=_0x12da51['structuredContent'];if(_0x2cb22b?.['token']&&_0x5a3761[_0x217de1(0x11f)](typeof _0x2cb22b[_0x217de1(0xf5)],_0x5a3761[_0x217de1(0x142)]))return _0x2cb22b[_0x217de1(0xf5)];if(_0x12da51[_0x217de1(0x10c)]){const _0x258942=_0x12da51[_0x217de1(0x128)];throw new Error(_0x217de1(0xef)+(_0x258942?.[0x0]?.['text']??'Unknown\x20error'));}const _0x4a2808=_0x12da51['content'];if(_0x4a2808)for(const _0x447491 of _0x4a2808){if(_0x5a3761[_0x217de1(0x11f)](_0x447491['type'],_0x5a3761['WxHLv'])&&_0x447491[_0x217de1(0x131)]){try{const _0x5db8c1=JSON[_0x217de1(0x127)](_0x447491['text']);if(typeof _0x5db8c1?.[_0x217de1(0xf5)]===_0x5a3761[_0x217de1(0x142)])return _0x5db8c1['token'];}catch{}const _0xc2f426=_0x447491[_0x217de1(0x131)]['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0xc2f426)return _0xc2f426[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x385e3a,_0x234ad5){var _0xb3ac0e=_0x5b4c,_0x466fd7=_0x385e3a();while(!![]){try{var _0x510d2d=parseInt(_0xb3ac0e(0x11c))/0x1+-parseInt(_0xb3ac0e(0x117))/0x2+-parseInt(_0xb3ac0e(0x116))/0x3+-parseInt(_0xb3ac0e(0x122))/0x4*(-parseInt(_0xb3ac0e(0x11d))/0x5)+parseInt(_0xb3ac0e(0x11f))/0x6+parseInt(_0xb3ac0e(0x11a))/0x7+-parseInt(_0xb3ac0e(0x118))/0x8*(parseInt(_0xb3ac0e(0x11e))/0x9);if(_0x510d2d===_0x234ad5)break;else _0x466fd7['push'](_0x466fd7['shift']());}catch(_0x25f7a6){_0x466fd7['push'](_0x466fd7['shift']());}}}(_0x333e,0x2fcc9));function _0x5b4c(_0x3b2a19,_0x1b0005){_0x3b2a19=_0x3b2a19-0x115;var _0x333e55=_0x333e();var _0x5b4cdf=_0x333e55[_0x3b2a19];return _0x5b4cdf;}function _0x333e(){var _0x2adb85=['zDLnF','KlNjH','8qQFpkV','cAXFY','1143864AqcpaQ','58784tIbuFP','181336GjRWJs','vcmNl','2510305DaOzOY','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','366945zPikDX','91955alTTmJ','117zFtUni','832764sURujI'];_0x333e=function(){return _0x2adb85;};return _0x333e();}export async function migrateProfile(_0x20c43d,_0x2db926){var _0x28263c=_0x5b4c,_0x24d80f={'vcmNl':function(_0x331232,_0x313a77){return _0x331232+_0x313a77;},'zDLnF':function(_0x3a39e0,_0x46c739){return _0x3a39e0+_0x46c739;},'cAXFY':function(_0x718726,_0x3732a4){return _0x718726+_0x3732a4;},'LvANP':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','KlNjH':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a'};console['error'](_0x24d80f[_0x28263c(0x119)](_0x24d80f['vcmNl'](_0x24d80f[_0x28263c(0x120)](_0x24d80f[_0x28263c(0x115)](_0x24d80f['cAXFY'](_0x24d80f['cAXFY'](_0x24d80f['LvANP'],'\x0a')+_0x28263c(0x11b),'\x20\x20ranger\x20profile\x20add\x20<name>\x0a')+'\x0a','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a'),'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a')+'\x0a',_0x24d80f[_0x28263c(0x121)]),'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.')),process['exit'](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x34e1b0,_0x7cdde6){const _0x158759=_0x2af1,_0x55719c=_0x34e1b0();while(!![]){try{const _0x2ca25b=-parseInt(_0x158759(0x135))/0x1*(parseInt(_0x158759(0x130))/0x2)+parseInt(_0x158759(0x12e))/0x3+-parseInt(_0x158759(0x121))/0x4*(-parseInt(_0x158759(0x13e))/0x5)+parseInt(_0x158759(0x144))/0x6*(-parseInt(_0x158759(0x137))/0x7)+-parseInt(_0x158759(0x131))/0x8+parseInt(_0x158759(0x151))/0x9+parseInt(_0x158759(0x134))/0xa*(parseInt(_0x158759(0x12b))/0xb);if(_0x2ca25b===_0x7cdde6)break;else _0x55719c['push'](_0x55719c['shift']());}catch(_0x50001e){_0x55719c['push'](_0x55719c['shift']());}}}(_0x2a0b,0x7bdb4));function _0x2a0b(){const _0x5ecb95=['XiONC','xvqxB','WumoG','SlqTn','plugin','output','14549007Sklznm','UgUlJ','oSzuo','1020888yOdwkX','Would\x20you\x20like\x20to\x20install\x20skills?','58grBdtm','7044600BlZfkH','❌\x20Failed\x20to\x20add\x20marketplace:','marketplace','10PBrLnn','31922xvfcDL','pluginScope','14xfZLQf','.claude','✓\x20Ranger\x20skills\x20already\x20installed','Project\x20(shared\x20with\x20team\x20via\x20git)','jaEOK','SKILL.md','already\x20enabled','5jSMYPl','kkbbf','confirm','ranger@trailhead','BzfVJ','qLmBn','1459506UvWYmo','prompt','GQuGz','--scope','⚠\x20Failed\x20to\x20enable\x20plugin:','push','AvpZM','BsXWL','TbtGu','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','Where\x20should\x20the\x20plugin\x20be\x20installed?','user','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','1902897tVLmEI','success','jyAnC','gzUkX','error','wantsSkillup','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','ranger','3703060OYTviS','User\x20(available\x20in\x20all\x20your\x20projects)','project','log'];_0x2a0b=function(){return _0x5ecb95;};return _0x2a0b();}import{join}from'path';import{existsSync}from'fs';import _0x1ae7f9 from'inquirer';import{skillup}from'../skillup.js';function _0x2af1(_0x40b835,_0x184422){_0x40b835=_0x40b835-0x11c;const _0x2a0bca=_0x2a0b();let _0x2af1bb=_0x2a0bca[_0x40b835];return _0x2af1bb;}import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0xa44395){const _0x4ad165=_0x2af1,_0x3bc3d2={'OxjEh':_0x4ad165(0x141),'dZICF':_0x4ad165(0x14d),'BsXWL':_0x4ad165(0x136),'WumoG':_0x4ad165(0x122),'niZzj':function(_0x5bb05f,_0x309216){return _0x5bb05f(_0x309216);},'SqCcF':function(_0x100ede,_0x3e43cb){return _0x100ede(_0x3e43cb);},'qLmBn':'plugin','ASoBC':'add','gzUkX':_0x4ad165(0x132),'GQuGz':'\x0aYou\x20can\x20install\x20manually\x20with:','jyAnC':_0x4ad165(0x147),'AOGCf':function(_0x56c83a){return _0x56c83a();},'kkbbf':'❌\x20Failed\x20to\x20install\x20plugin:','oSzuo':_0x4ad165(0x11f),'xvqxB':function(_0x452778,_0x283574){return _0x452778===_0x283574;},'TbtGu':'project','AvpZM':function(_0x2bf23d,_0x254769,_0x41b04d){return _0x2bf23d(_0x254769,_0x41b04d);},'dwogi':function(_0x2428ae){return _0x2428ae();},'vjbiq':_0x4ad165(0x13d),'jaEOK':_0x4ad165(0x148)},_0x1009ea=await isPluginInstalled(_0x3bc3d2['OxjEh']);if(_0x1009ea)return console[_0x4ad165(0x124)]('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];const _0xdc3166=existsSync(join(getProjectRoot(),_0x4ad165(0x138)));let _0x122451;if(_0xa44395)_0x122451=_0xa44395;else{if(_0xdc3166)_0x122451='project';else{console[_0x4ad165(0x124)](_0x3bc3d2['dZICF']);const _0x49b10f=await _0x1ae7f9[_0x4ad165(0x145)]([{'type':'list','name':_0x3bc3d2[_0x4ad165(0x14b)],'message':_0x4ad165(0x14e),'choices':[{'name':_0x3bc3d2[_0x4ad165(0x127)],'value':_0x4ad165(0x14f)},{'name':_0x4ad165(0x13a),'value':_0x4ad165(0x123)}],'default':'user'}]);_0x122451=_0x49b10f[_0x4ad165(0x136)];}}console['log'](_0x4ad165(0x11e)+_0x122451+'\x20level)...\x0a');const _0x160c1d=await _0x3bc3d2['niZzj'](isMarketplaceAdded,'trailhead');let _0x11d09e=_0x160c1d;if(_0x160c1d)console['log']('✓\x20Marketplace\x20already\x20added');else{const _0x427632=await _0x3bc3d2['SqCcF'](runClaudeCommand,[_0x3bc3d2[_0x4ad165(0x143)],_0x4ad165(0x133),_0x3bc3d2['ASoBC'],'ranger-testing/trailhead']);!_0x427632['success']?(console[_0x4ad165(0x11c)](_0x3bc3d2[_0x4ad165(0x154)],_0x427632['error']),console['log'](_0x3bc3d2[_0x4ad165(0x146)]),console['log']('\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'),console[_0x4ad165(0x124)](_0x4ad165(0x150)+_0x122451)):_0x11d09e=!![];}if(_0x11d09e){const _0x33c7b7=await runClaudeCommand([_0x3bc3d2['qLmBn'],'install','ranger@trailhead',_0x3bc3d2[_0x4ad165(0x153)],_0x122451],{'cwd':_0x122451===_0x4ad165(0x123)?_0x3bc3d2['AOGCf'](getProjectRoot):undefined});if(!_0x33c7b7['success'])console[_0x4ad165(0x11c)](_0x3bc3d2[_0x4ad165(0x13f)],_0x33c7b7['error']),console['log'](_0x3bc3d2[_0x4ad165(0x146)]),console[_0x4ad165(0x124)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x122451);else{console[_0x4ad165(0x124)](_0x3bc3d2[_0x4ad165(0x12d)]);const _0x2af590=[_0x4ad165(0x129),'enable','ranger@trailhead'];_0x3bc3d2[_0x4ad165(0x126)](_0x122451,_0x3bc3d2[_0x4ad165(0x14c)])&&_0x2af590[_0x4ad165(0x149)]('--scope',_0x4ad165(0x123));const _0x3ed66c=await _0x3bc3d2[_0x4ad165(0x14a)](runClaudeCommand,_0x2af590,{'captureOutput':!![],'cwd':_0x122451==='project'?_0x3bc3d2['dwogi'](getProjectRoot):undefined}),_0x11732c=_0x3ed66c[_0x4ad165(0x12a)]?.['includes'](_0x3bc3d2['vjbiq']);!_0x3ed66c[_0x4ad165(0x152)]&&!_0x11732c?console['error'](_0x3bc3d2[_0x4ad165(0x13b)],_0x3ed66c['error']):console[_0x4ad165(0x124)]('✓\x20Claude\x20Code\x20plugin\x20enabled');}}return!![];}export async function ensureClaudeSkills(_0x5cabd1){const _0x282239=_0x2af1,_0x3d1602={'UgUlJ':function(_0x5b4c90,_0x246d66){return _0x5b4c90(_0x246d66);},'LHwlt':'user','BzfVJ':'ranger','OFOBD':function(_0x32a555,_0x4feffe,_0x2fc620,_0xb9ad7d){return _0x32a555(_0x4feffe,_0x2fc620,_0xb9ad7d);},'SlqTn':_0x282239(0x123),'iaEnm':'SKILL.md','XiONC':function(_0x369f3f,_0x438423){return _0x369f3f||_0x438423;}},_0xfefadc=existsSync(join(_0x3d1602['UgUlJ'](getSkillsDir,_0x3d1602['LHwlt']),_0x3d1602[_0x282239(0x142)],_0x282239(0x13c))),_0x372c0d=_0x3d1602[_0x282239(0x12c)](existsSync,_0x3d1602['OFOBD'](join,_0x3d1602[_0x282239(0x12c)](getSkillsDir,_0x3d1602[_0x282239(0x128)]),_0x282239(0x120),_0x3d1602['iaEnm']));if(_0x3d1602[_0x282239(0x125)](_0xfefadc,_0x372c0d))return console[_0x282239(0x124)](_0x282239(0x139)),![];const _0x34b73c=existsSync(join(getProjectRoot(),'.claude'));let _0x35c0b2=!![];if(_0x5cabd1)await _0x3d1602['UgUlJ'](skillup,{'autoInstall':_0x5cabd1,'suppressUsage':!![]});else{if(_0x34b73c)await _0x3d1602[_0x282239(0x12c)](skillup,{'autoInstall':_0x3d1602['SlqTn'],'suppressUsage':!![]});else{const _0x592145=await _0x1ae7f9['prompt']([{'type':_0x282239(0x140),'name':'wantsSkillup','message':_0x282239(0x12f),'default':!![]}]);_0x35c0b2=_0x592145[_0x282239(0x11d)],_0x35c0b2&&await _0x3d1602[_0x282239(0x12c)](skillup,{'suppressUsage':!![]});}}return _0x35c0b2;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3f93c2,_0x15e5a5){const _0x22d9af=_0x4ac1,_0x410883=_0x3f93c2();while(!![]){try{const _0x12ce4f=-parseInt(_0x22d9af(0x19d))/0x1*(parseInt(_0x22d9af(0x195))/0x2)+parseInt(_0x22d9af(0x194))/0x3+parseInt(_0x22d9af(0x1a7))/0x4+parseInt(_0x22d9af(0x199))/0x5+-parseInt(_0x22d9af(0x19f))/0x6+-parseInt(_0x22d9af(0x197))/0x7*(parseInt(_0x22d9af(0x1a1))/0x8)+parseInt(_0x22d9af(0x193))/0x9;if(_0x12ce4f===_0x15e5a5)break;else _0x410883['push'](_0x410883['shift']());}catch(_0x4c198d){_0x410883['push'](_0x410883['shift']());}}}(_0x2d34,0xcaffa));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x31e100 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';function _0x2d34(){const _0x364cbc=['Tuzby','pluginScope','plugin','user','19147869frBMDn','223494wVhnIG','2DBEarc','hrxsz','14854avdJTT','ZlZFa','3170125PuMlDs','iALNM','Project\x20(shared\x20with\x20team\x20via\x20git)','error','1472399TuahZQ','@ranger-testing/opencode-plugin','648048NqOhTH','PNMHo','1904sKMfwg','✓\x20OpenCode\x20plugin\x20already\x20configured','parse','project','isArray','\x0a📦\x20OpenCode\x20Plugin\x0a','323444BwRzAO','stringify','$schema','opencode.json','list'];_0x2d34=function(){return _0x364cbc;};return _0x2d34();}function _0x4ac1(_0x3f2747,_0x37f66c){_0x3f2747=_0x3f2747-0x192;const _0x2d3431=_0x2d34();let _0x4ac166=_0x2d3431[_0x3f2747];return _0x4ac166;}export async function ensureOpencodePluginConfig(_0x56114c){const _0x53a898=_0x4ac1,_0x39703d={'Dthxb':function(_0x2723ac,_0x462db3,_0x46eb5f){return _0x2723ac(_0x462db3,_0x46eb5f);},'PNMHo':_0x53a898(0x1a4),'syige':_0x53a898(0x1a6),'ZlZFa':_0x53a898(0x1ab),'Tuzby':'Where\x20should\x20the\x20plugin\x20be\x20installed?','iALNM':'User\x20(available\x20in\x20all\x20your\x20projects)','nrugr':function(_0x764f3,_0x6170){return _0x764f3(_0x6170);},'zgDsH':_0x53a898(0x1aa),'ctRMN':'https://opencode.ai/config.json','hrxsz':'utf-8','FdDXL':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','dtgTU':'✓\x20OpenCode\x20plugin\x20configured'},_0x1961b0=existsSync(_0x39703d['Dthxb'](join,getOpencodeConfigDir(_0x53a898(0x1a4)),_0x53a898(0x1aa)));let _0x158486;if(_0x56114c)_0x158486=_0x56114c;else{if(_0x1961b0)_0x158486=_0x39703d[_0x53a898(0x1a0)];else{console['log'](_0x39703d['syige']);const _0x532470=await _0x31e100['prompt']([{'type':_0x39703d[_0x53a898(0x198)],'name':_0x53a898(0x1ad),'message':_0x39703d[_0x53a898(0x1ac)],'choices':[{'name':_0x39703d[_0x53a898(0x19a)],'value':'user'},{'name':_0x53a898(0x19b),'value':_0x53a898(0x1a4)}],'default':_0x53a898(0x192)}]);_0x158486=_0x532470[_0x53a898(0x1ad)];}}const _0x29aa4b=join(_0x39703d['nrugr'](getOpencodeConfigDir,_0x158486),_0x39703d['zgDsH']),_0x49326c=_0x53a898(0x19e),_0x52650b=_0x39703d['ctRMN'];let _0x24b3d2={};if(existsSync(_0x29aa4b))try{const _0x265ef7=await readFile(_0x29aa4b,_0x39703d[_0x53a898(0x196)]);_0x24b3d2=JSON[_0x53a898(0x1a3)](_0x265ef7);}catch(_0x497051){return console[_0x53a898(0x19c)](_0x39703d['FdDXL']),{'configured':![],'scope':_0x158486,'error':'Failed\x20to\x20read\x20opencode.json','details':_0x497051};}const _0x416b7d=Array[_0x53a898(0x1a5)](_0x24b3d2[_0x53a898(0x1ae)])?_0x24b3d2['plugin']:[];if(_0x416b7d['includes'](_0x49326c))return console['log'](_0x53a898(0x1a2)),{'configured':![],'scope':_0x158486};return _0x24b3d2[_0x53a898(0x1a9)]=_0x24b3d2['$schema']||_0x52650b,_0x24b3d2['plugin']=[..._0x416b7d,_0x49326c],await _0x39703d['Dthxb'](mkdir,getOpencodeConfigDir(_0x158486),{'recursive':!![]}),await writeFile(_0x29aa4b,JSON[_0x53a898(0x1a8)](_0x24b3d2,null,0x2)+'\x0a'),console['log'](_0x39703d['dtgTU']),{'configured':!![],'scope':_0x158486};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x460e(){var _0x1ac68e=['375415itenka','2226235kpRYjE','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','DSjYN','PHRWw','POjAs','70LQNaaJ','890091VJNyRG','ahpIk','3wOwVKm','5624116HJiRSu','3080592ItpLSq','3765952xibVhA','12TVCGfr','6650518LMkfMj','error'];_0x460e=function(){return _0x1ac68e;};return _0x460e();}function _0x565b(_0x58f015,_0x2dc9fb){_0x58f015=_0x58f015-0x153;var _0x460eeb=_0x460e();var _0x565b9e=_0x460eeb[_0x58f015];return _0x565b9e;}(function(_0x235022,_0x57ef91){var _0x353e4e=_0x565b,_0x4909dd=_0x235022();while(!![]){try{var _0x4dd447=-parseInt(_0x353e4e(0x153))/0x1+parseInt(_0x353e4e(0x15e))/0x2+-parseInt(_0x353e4e(0x15c))/0x3*(parseInt(_0x353e4e(0x15d))/0x4)+-parseInt(_0x353e4e(0x154))/0x5+parseInt(_0x353e4e(0x160))/0x6*(parseInt(_0x353e4e(0x161))/0x7)+parseInt(_0x353e4e(0x15f))/0x8+parseInt(_0x353e4e(0x15a))/0x9*(-parseInt(_0x353e4e(0x159))/0xa);if(_0x4dd447===_0x57ef91)break;else _0x4909dd['push'](_0x4909dd['shift']());}catch(_0x410d54){_0x4909dd['push'](_0x4909dd['shift']());}}}(_0x460e,0xf23cc));export async function setupCi(_0x4d4ac5,_0x4a473d,_0x24e64c){var _0x564461=_0x565b,_0x8faacc={'DSjYN':function(_0x1af3f3,_0x55f1e9){return _0x1af3f3+_0x55f1e9;},'POjAs':function(_0x136005,_0x20088b){return _0x136005+_0x20088b;},'KDPrn':function(_0x1356a7,_0x3e49fd){return _0x1356a7+_0x3e49fd;},'ahpIk':function(_0x5a706b,_0x5973ed){return _0x5a706b+_0x5973ed;},'PHRWw':'ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','pjTxR':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a'};console[_0x564461(0x162)](_0x8faacc[_0x564461(0x156)](_0x8faacc[_0x564461(0x158)](_0x8faacc['KDPrn'](_0x8faacc[_0x564461(0x15b)](_0x8faacc[_0x564461(0x156)](_0x8faacc[_0x564461(0x157)],'\x0a')+_0x8faacc['pjTxR'],'\x20\x20ranger\x20profile\x20add\x20<name>\x0a'),'\x0a'),_0x564461(0x155)),'\x20\x20https://docs.ranger.net/main/concepts/profiles')),process['exit'](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function _0x7afe(){const _0x3742b0=['VWCKM','mZUHQ','3205645IDtpzL','12NyGuZQ','cpdYv','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','8992090HOJkNV','Where\x20should\x20skills\x20be\x20installed?','isTTY','iKVYw','1830376sXQlvy','oIQLI','user-level','56527dYeEDX','project','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','\x20<your-api-token>','list','GaZEb','18juCndF','warn','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','/.opencode/skills/','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','autoInstall','installLevel','message','HKLCC','RsywF','4328856RvWRuf','\x20\x202.\x20Run:\x20ranger\x20setup','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','stdin','\x20--opencode','/skills/','UCkyq','claude','rLrFp','QDNFg','cCjqV','log','30ElakNH','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','6065148XUTPak','CGcnr','4573980VTICWP','user','To\x20get\x20started:'];_0x7afe=function(){return _0x3742b0;};return _0x7afe();}(function(_0x1c7b1f,_0x47b1f2){const _0x597a76=_0x2c41,_0x5f49d1=_0x1c7b1f();while(!![]){try{const _0x3f8994=parseInt(_0x597a76(0x15d))/0x1*(-parseInt(_0x597a76(0x149))/0x2)+parseInt(_0x597a76(0x14d))/0x3+parseInt(_0x597a76(0x14b))/0x4+-parseInt(_0x597a76(0x152))/0x5*(-parseInt(_0x597a76(0x153))/0x6)+-parseInt(_0x597a76(0x13d))/0x7+-parseInt(_0x597a76(0x15a))/0x8+-parseInt(_0x597a76(0x133))/0x9*(parseInt(_0x597a76(0x156))/0xa);if(_0x3f8994===_0x47b1f2)break;else _0x5f49d1['push'](_0x5f49d1['shift']());}catch(_0xb4be97){_0x5f49d1['push'](_0x5f49d1['shift']());}}}(_0x7afe,0xca8ed));import{basename}from'path';import _0xc68913 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';function _0x2c41(_0x9ae6a2,_0x3890fc){_0x9ae6a2=_0x9ae6a2-0x12f;const _0x7afe10=_0x7afe();let _0x2c41e9=_0x7afe10[_0x9ae6a2];return _0x2c41e9;}import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x21e9c6={}){const _0x426e90=_0x2c41,_0x58d64c={'fuAnt':_0x426e90(0x155),'RsywF':'❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','NdNwZ':_0x426e90(0x14f),'cpdYv':_0x426e90(0x137),'GaZEb':'opencode','rLrFp':function(_0x3b83bf,_0x3ec91b){return _0x3b83bf===_0x3ec91b;},'iKVYw':function(_0x1857be){return _0x1857be();},'HKLCC':function(_0x3ffbaa,_0x4145d7){return _0x3ffbaa(_0x4145d7);},'CGcnr':_0x426e90(0x131),'WjCpf':_0x426e90(0x139),'QDNFg':'user','cCjqV':_0x426e90(0x15e),'VWCKM':function(_0x1ad6fb){return _0x1ad6fb();},'wZnoJ':'\x0a📦\x20Installing\x20skills...\x0a','YaQFD':function(_0x10a636,_0x20f1be,_0x4d59eb){return _0x10a636(_0x20f1be,_0x4d59eb);},'UCkyq':'ranger','qJzFj':_0x426e90(0x12f),'mZUHQ':_0x426e90(0x15c),'BoRyR':'project-level','tSnDP':function(_0x4c59cb,_0x5d2ff5){return _0x4c59cb>_0x5d2ff5;},'oIQLI':function(_0x21c457,_0x472934){return _0x21c457===_0x472934;}};console['log'](_0x58d64c['fuAnt']);const _0x33caf5=_0x21e9c6['platform']??_0x426e90(0x144),_0x10553d=await getToken();if(!_0x10553d){console[_0x426e90(0x148)](_0x58d64c[_0x426e90(0x13c)]),console['log'](_0x58d64c['NdNwZ']),console['log'](_0x58d64c[_0x426e90(0x154)]),console[_0x426e90(0x148)](_0x426e90(0x13e)+(_0x33caf5===_0x58d64c[_0x426e90(0x132)]?_0x426e90(0x141):'')+_0x426e90(0x130)),console[_0x426e90(0x148)]('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x58d64c[_0x426e90(0x145)](_0x33caf5,_0x58d64c['GaZEb'])?'\x20--opencode':'')+'\x0a');return;}console['log']('✓\x20Found\x20API\x20token');const _0x5744c1=_0x58d64c[_0x426e90(0x159)](getProjectRoot),_0x15050d=_0x58d64c[_0x426e90(0x13b)](basename,_0x5744c1),_0x1fdaa1=_0x33caf5==='opencode'?getOpencodeConfigDir(_0x426e90(0x14e))+'/skills/':getClaudeConfigDir()+_0x426e90(0x142),_0x25035e=_0x33caf5===_0x58d64c[_0x426e90(0x132)]?_0x5744c1+_0x426e90(0x136):_0x5744c1+'/.claude/skills/',_0x2c5999=process[_0x426e90(0x140)][_0x426e90(0x158)]&&process['stdout'][_0x426e90(0x158)];let _0x19ea10;if(_0x21e9c6[_0x426e90(0x138)])_0x19ea10=_0x21e9c6['autoInstall'];else{if(_0x2c5999){const _0x13ff8a=await _0xc68913['prompt']([{'type':_0x58d64c[_0x426e90(0x14c)],'name':_0x58d64c['WjCpf'],'message':_0x426e90(0x157),'choices':[{'name':'All\x20projects\x20('+_0x1fdaa1+')','value':_0x58d64c[_0x426e90(0x146)]},{'name':'This\x20project\x20only\x20('+_0x25035e+')','value':_0x58d64c[_0x426e90(0x147)]}]}]);_0x19ea10=_0x13ff8a['installLevel'];}else _0x19ea10=_0x58d64c['cCjqV'],console['log'](_0x426e90(0x135)+_0x25035e+')');}let _0x5830c7=0x0;const _0x4f4d7a=_0x58d64c[_0x426e90(0x150)](getCurrentVersion);console[_0x426e90(0x148)](_0x58d64c['wZnoJ']);try{const _0x428da6=await _0x58d64c['YaQFD'](installSkill,_0x58d64c[_0x426e90(0x143)],{'cliVersion':_0x4f4d7a,'level':_0x19ea10,'platform':_0x33caf5});_0x428da6&&_0x5830c7++;}catch(_0x3ea946){console[_0x426e90(0x134)](_0x58d64c['qJzFj'],_0x3ea946 instanceof Error?_0x3ea946[_0x426e90(0x13a)]:_0x3ea946);}if(_0x5830c7>0x0){const _0x273c5d=_0x58d64c['rLrFp'](_0x19ea10,_0x426e90(0x14e))?_0x58d64c[_0x426e90(0x151)]:_0x58d64c['BoRyR'];console[_0x426e90(0x148)]('\x0a✅\x20Installed\x20'+_0x5830c7+'\x20'+_0x273c5d+'\x20skill'+(_0x58d64c['tSnDP'](_0x5830c7,0x1)?'s':'')+'\x20successfully!\x0a'),!_0x21e9c6['suppressUsage']&&(console[_0x426e90(0x148)]('To\x20use:'),_0x58d64c[_0x426e90(0x15b)](_0x33caf5,'opencode')?console[_0x426e90(0x148)](_0x426e90(0x13f)):console[_0x426e90(0x148)]('\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!'));}else console[_0x426e90(0x148)](_0x426e90(0x14a));}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5f14c3=_0x21b5;(function(_0x4459db,_0x48102e){const _0x4e36d7=_0x21b5,_0x45b380=_0x4459db();while(!![]){try{const _0x585d8b=parseInt(_0x4e36d7(0x17e))/0x1+parseInt(_0x4e36d7(0x1a9))/0x2*(parseInt(_0x4e36d7(0x162))/0x3)+parseInt(_0x4e36d7(0x13d))/0x4*(parseInt(_0x4e36d7(0x157))/0x5)+-parseInt(_0x4e36d7(0x13f))/0x6*(-parseInt(_0x4e36d7(0x15d))/0x7)+parseInt(_0x4e36d7(0x195))/0x8*(-parseInt(_0x4e36d7(0x13e))/0x9)+parseInt(_0x4e36d7(0x191))/0xa*(-parseInt(_0x4e36d7(0x15f))/0xb)+-parseInt(_0x4e36d7(0x17a))/0xc*(parseInt(_0x4e36d7(0x13a))/0xd);if(_0x585d8b===_0x48102e)break;else _0x45b380['push'](_0x45b380['shift']());}catch(_0x284af8){_0x45b380['push'](_0x45b380['shift']());}}}(_0x2851,0x9ef88));import{mkdir,writeFile}from'fs/promises';import{join,dirname}from'path';import{existsSync}from'fs';import{createRequire}from'module';import _0x373dd0 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';function _0x2851(){const _0x42b344=['withDeps','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','kill','skills','execPath','12345708tiUSoD','Aukfc','EcJWT','playwright@','1221051wtoPgr','\x20is\x20no\x20longer\x20supported.\x20','NwLHh','\x0aIn\x20Claude\x20Code,\x20run\x20','error','RANGER_CHROMIUM_INSTALL_TIMEOUT_MS','\x0a🚀\x20Ranger\x20Setup\x0a','rVQsP','local','zgtgN','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','xzQih','round','cli.js','ready','exit','rPjbX','rIIXM','10VVtQRA','cCABp','SIGKILL','nzmow','5609360mznllV','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','force','dQXSP','AvZZl','lcLZx','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','user','Wigkt','platform','log','\x0a\x20\x20','eMmfG','opencode','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','install','rRQaI','FHmYF','profile','✓\x20Exported\x20credentials\x20for\x20CI','232612xOXEFY','nZxBs','✓\x20Playwright\x20Chromium\x20browser\x20found','version','provided_token','Chromium\x20install\x20timed\x20out\x20after\x20','success','jyosP',');\x20retrying...','rqmDS','hbsFB','✓\x20~/.ranger/\x20directory\x20already\x20exists','skipChromium','\x1b[1m','HUXyC','stdin','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','scope','13geISbR','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','\x20now?','34652HiioXl','9fXCNhF','276zkXFUf','skipAuth','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','allowInsecureLocalhost','JDwju','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','✓\x20Local\x20profile\x20already\x20exists','chromium','\x20install\x20chromium','You\x20can\x20install\x20it\x20manually\x20by\x20running:','win32','\x20and\x20prompt\x20the\x20coding','\x0a❌\x20Profile\x20setup\x20failed:','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','omMlD','ranger\x20setup\x20--scope=','✓\x20Created\x20.ranger/.gitignore','executablePath','ieohU','The\x20required\x20version\x20(','mKMaL','530WmbXgc','resolve','url','ignore','wSXtR','fFZpD','115521NJACKH','confirm','9528882dEQJcf','✓\x20Authenticated\x20to\x20','/ranger:enable','9mUGHJv','jowaI','Installation\x20failed\x20with\x20exit\x20code\x20','ranger\x20profile\x20add\x20<name>','\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','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','s).\x20On\x20a\x20slow\x20or\x20proxied\x20connection,\x20raise\x20the\x20limit\x20and\x20retry,\x20e.g.:\x0a','iCsaS','trackPhaseStart','EsnKE','playwright/package.json','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','✓\x20Skipping\x20authentication\x20(--skip-auth)','skipped','Validating\x20API\x20token...','message','trackPhaseEnd','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20'];_0x2851=function(){return _0x42b344;};return _0x2851();}import{installSkill}from'./utils/skills.js';import{spawn}from'child_process';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.56.1';const bold=_0x2339a8=>_0x5f14c3(0x135)+_0x2339a8+'\x1b[0m';export function getPlaywrightVersion(){const _0xfcee9e=_0x5f14c3,_0x3c674d={'EsnKE':_0xfcee9e(0x16c)};try{const _0x5d8a2e=require[_0xfcee9e(0x158)](_0x3c674d[_0xfcee9e(0x16b)]),_0x5539c1=require(_0x5d8a2e);return _0x5539c1[_0xfcee9e(0x1ac)];}catch{return null;}}function resolveBundledPlaywrightCli(){const _0x16c851=_0x5f14c3,_0x5a2f1f={'Fureb':function(_0x16be10,_0x59236d,_0x1efb47){return _0x16be10(_0x59236d,_0x1efb47);},'mTVjI':function(_0x5b7751,_0x25505f){return _0x5b7751(_0x25505f);}};try{const _0x45db94=_0x5a2f1f['Fureb'](join,_0x5a2f1f['mTVjI'](dirname,require['resolve'](_0x16c851(0x16c))),_0x16c851(0x18c));return _0x5a2f1f['mTVjI'](existsSync,_0x45db94)?_0x45db94:null;}catch{return null;}}function _0x21b5(_0x1ce770,_0x429180){_0x1ce770=_0x1ce770-0x131;const _0x285163=_0x2851();let _0x21b540=_0x285163[_0x1ce770];return _0x21b540;}const CHROMIUM_INSTALL_TIMEOUT_MS=Number(process['env'][_0x5f14c3(0x183)])||0x927c0;class ChromiumInstallTimeoutError extends Error{}export async function installChromiumBinary(_0x5c28c9,_0x126dc2=![]){const _0x39b219=_0x5f14c3,_0x59acf7={'HUXyC':'npx','QDqPc':'--with-deps','rPjbX':'chromium','rVQsP':function(_0x5d4d59,_0x26854a){return _0x5d4d59 instanceof _0x26854a;},'XxbbF':function(_0x32bec4,_0x474254){return _0x32bec4+_0x474254;},'wSXtR':function(_0x1c1523,_0x583440){return _0x1c1523/_0x583440;},'LLEVm':function(_0x5a241b,_0x213234){return _0x5a241b(_0x213234);}},_0x28b7b5=resolveBundledPlaywrightCli(),_0x142296=_0x28b7b5?process[_0x39b219(0x179)]:_0x59acf7[_0x39b219(0x136)],_0x31b53f=[_0x28b7b5??_0x39b219(0x17d)+_0x5c28c9,_0x39b219(0x1a4),..._0x126dc2?[_0x59acf7['QDqPc']]:[],_0x59acf7[_0x39b219(0x18f)]];let _0x5884f1=![];for(let _0x52d0c6=0x1;;_0x52d0c6++){try{await runChromiumInstall(_0x142296,_0x31b53f);return;}catch(_0x31d81e){_0x59acf7[_0x39b219(0x185)](_0x31d81e,ChromiumInstallTimeoutError)&&!_0x5884f1&&(_0x5884f1=!![],console[_0x39b219(0x19f)](_0x59acf7['XxbbF']('\x0a\x20\x20Chromium\x20install\x20timed\x20out\x20(limit\x20'+Math[_0x39b219(0x18b)](_0x59acf7[_0x39b219(0x15b)](CHROMIUM_INSTALL_TIMEOUT_MS,0x3e8))+_0x39b219(0x168),'\x20\x20\x20\x20RANGER_CHROMIUM_INSTALL_TIMEOUT_MS=1800000\x20ranger\x20setup\x20deps')));if(_0x52d0c6>=0x3)throw _0x31d81e;const _0x4a1977=_0x31d81e instanceof Error?_0x31d81e[_0x39b219(0x171)]:_0x59acf7['LLEVm'](String,_0x31d81e);console['log']('\x20\x20Chromium\x20install\x20attempt\x20'+_0x52d0c6+'\x20failed\x20('+_0x4a1977+_0x39b219(0x1b1));}}}function runChromiumInstall(_0x7d9dcf,_0x1f745f){const _0x2b325e={'EcJWT':function(_0x5f2a39,_0x2d32d1){return _0x5f2a39(_0x2d32d1);},'AFBju':function(_0x3417c5,_0x2f9b75){return _0x3417c5(_0x2f9b75);},'XUroS':function(_0x12e9c0,_0x167486){return _0x12e9c0===_0x167486;},'eMmfG':function(_0x4a4439){return _0x4a4439();},'omMlD':function(_0x27cc40,_0x220622){return _0x27cc40(_0x220622);},'UHBHa':function(_0x4d24a6,_0x55b9d5,_0x46a4e8,_0x3edf2f){return _0x4d24a6(_0x55b9d5,_0x46a4e8,_0x3edf2f);},'tLyDB':'inherit','NwLHh':function(_0x49a605,_0x1e7dfb){return _0x49a605===_0x1e7dfb;}};return new Promise((_0x4cfba7,_0x36ed1d)=>{const _0x465a8d=_0x21b5,_0x1f97ec=_0x2b325e['UHBHa'](spawn,_0x7d9dcf,_0x1f745f,{'stdio':[_0x465a8d(0x15a),_0x2b325e['tLyDB'],_0x2b325e['tLyDB']],'shell':_0x2b325e[_0x465a8d(0x180)](process[_0x465a8d(0x19e)],_0x465a8d(0x14b))}),_0x3c074b=setTimeout(()=>{const _0x2d7f63=_0x465a8d;_0x1f97ec[_0x2d7f63(0x177)](_0x2d7f63(0x193)),_0x2b325e[_0x2d7f63(0x17c)](_0x36ed1d,new ChromiumInstallTimeoutError(_0x2d7f63(0x1ae)+Math['round'](CHROMIUM_INSTALL_TIMEOUT_MS/0x3e8)+'s'));},CHROMIUM_INSTALL_TIMEOUT_MS);_0x1f97ec['on']('close',_0x1ca051=>{const _0x42a491=_0x465a8d;_0x2b325e['AFBju'](clearTimeout,_0x3c074b);if(_0x2b325e['XUroS'](_0x1ca051,0x0))_0x2b325e[_0x42a491(0x1a1)](_0x4cfba7);else _0x2b325e[_0x42a491(0x150)](_0x36ed1d,new Error(_0x42a491(0x164)+_0x1ca051));}),_0x1f97ec['on'](_0x465a8d(0x182),_0x460e3d=>{_0x2b325e['AFBju'](clearTimeout,_0x3c074b),_0x2b325e['EcJWT'](_0x36ed1d,_0x460e3d);});});}export async function authenticate(_0x318c18){const _0x2ccf61=_0x5f14c3,_0x2d4276={'MpDDM':function(_0x41e497,_0x1bedb4){return _0x41e497 instanceof _0x1bedb4;},'JDwju':'device_auth','Aukfc':function(_0x1950c3,_0x1023ea){return _0x1950c3(_0x1023ea);},'xXSRl':'✓\x20Stored\x20credentials\x20locally'};if(!_0x318c18){const _0x555ca8=await getToken();if(_0x555ca8){const _0x88636d=await getCurrentUser(_0x555ca8);if(_0x88636d['success'])return console['log']('✓\x20Already\x20authenticated\x20to\x20'+_0x88636d['user']['organizationName']),{'token':_0x555ca8,'method':'existing_token'};}try{_0x318c18=await runDeviceAuthFlow();}catch(_0x506862){throw new Error('Authentication\x20failed:\x20'+(_0x2d4276['MpDDM'](_0x506862,Error)?_0x506862[_0x2ccf61(0x171)]:_0x506862));}const _0x5f1d89=await getCurrentUser(_0x318c18);if(!_0x5f1d89[_0x2ccf61(0x1af)])throw new Error(_0x2ccf61(0x175)+_0x5f1d89['error']);return console[_0x2ccf61(0x19f)](_0x2ccf61(0x160)+_0x5f1d89['user']['organizationName']),{'token':_0x318c18,'method':_0x2d4276[_0x2ccf61(0x143)]};}console['log'](_0x2ccf61(0x170));const _0x5ef9c7=await getCurrentUser(_0x318c18);if(!_0x5ef9c7[_0x2ccf61(0x1af)]){if(_0x5ef9c7['status'])throw new Error('Authentication\x20failed:\x20'+_0x5ef9c7['error']+_0x2ccf61(0x16d));else throw new Error(_0x2ccf61(0x141)+_0x5ef9c7[_0x2ccf61(0x182)]+_0x2ccf61(0x13b));}return console[_0x2ccf61(0x19f)](_0x2ccf61(0x160)+_0x5ef9c7[_0x2ccf61(0x19c)]['organizationName']),await _0x2d4276[_0x2ccf61(0x17b)](storeToken,_0x318c18),console[_0x2ccf61(0x19f)](process['env']['GITHUB_ENV']?_0x2ccf61(0x1a8):_0x2d4276['xXSRl']),{'token':_0x318c18,'method':_0x2ccf61(0x1ad)};}export async function ensureRangerDir(_0x179660){const _0x196963=_0x5f14c3,_0x3d61a3={'lcLZx':function(_0x3d54de){return _0x3d54de();},'xzQih':function(_0x249cde,_0x5f295c){return _0x249cde(_0x5f295c);},'cCABp':_0x196963(0x133)};void _0x179660;const _0x118273=_0x3d61a3[_0x196963(0x19a)](getRangerHomeDir);return!_0x3d61a3[_0x196963(0x18a)](existsSync,_0x118273)?(await mkdir(_0x118273,{'recursive':!![]}),console['log']('✓\x20Created\x20~/.ranger/\x20directory'),{'path':_0x118273,'installed':!![]}):(console['log'](_0x3d61a3[_0x196963(0x192)]),{'path':_0x118273,'installed':![]});}export async function ensureChromium(_0x18efcc=![]){const _0x31d33f=_0x5f14c3,_0x2536c6={'IHzSL':function(_0x58cce1,_0x3e7bd4){return _0x58cce1(_0x3e7bd4);},'xedZh':function(_0x39ccbc){return _0x39ccbc();},'rDaKt':'install','jyosP':'\x20(fallback\x20version)','muwoA':_0x31d33f(0x14a),'rqlCz':'\x0a⚠\x20Skipping\x20Chromium\x20installation.'};let _0x47d754=![];try{const _0x377493=chromium[_0x31d33f(0x153)]();_0x47d754=_0x2536c6['IHzSL'](existsSync,_0x377493);}catch{_0x47d754=![];}if(_0x47d754)return console['log'](_0x31d33f(0x1ab)),![];const _0x299cc1=_0x2536c6['xedZh'](getPlaywrightVersion),_0x507fe2=_0x299cc1??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x4a8432=!_0x299cc1,_0x300467=process[_0x31d33f(0x137)]['isTTY']&&process['stdout']['isTTY'];let _0x456710=!![];if(_0x300467){const {install:_0x8ee85c}=await _0x373dd0['prompt']([{'type':_0x31d33f(0x15e),'name':_0x2536c6['rDaKt'],'message':_0x4a8432?_0x31d33f(0x167)+_0x507fe2+_0x31d33f(0x13c):_0x31d33f(0x155)+_0x507fe2+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x456710=_0x8ee85c;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x507fe2+(_0x4a8432?_0x2536c6[_0x31d33f(0x1b0)]:'')+'...');if(_0x456710){console[_0x31d33f(0x19f)]('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await installChromiumBinary(_0x507fe2,_0x18efcc),console['log'](_0x31d33f(0x189));}catch(_0x12b3f9){console[_0x31d33f(0x182)](_0x31d33f(0x144),_0x12b3f9 instanceof Error?_0x12b3f9['message']:_0x12b3f9),console[_0x31d33f(0x19f)](_0x2536c6['muwoA']),console['log']('\x20\x20npx\x20playwright@'+_0x507fe2+_0x31d33f(0x149));}}else console['log'](_0x2536c6['rqlCz']),console['log']('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console['log']('\x20\x20npx\x20playwright@'+_0x507fe2+_0x31d33f(0x149));return!![];}export async function writeRangerGitignore(_0x444b4b){const _0x46f9a6=_0x5f14c3,_0x33b3b7={'GEcdU':function(_0x191aaf,_0x17eef4,_0x35fbc2){return _0x191aaf(_0x17eef4,_0x35fbc2);},'AvZZl':function(_0x5b9d05,_0x16c63d,_0x49559d){return _0x5b9d05(_0x16c63d,_0x49559d);}},_0x575978=_0x33b3b7['GEcdU'](join,_0x444b4b,'.gitignore'),_0x10602d=_0x46f9a6(0x166);await _0x33b3b7[_0x46f9a6(0x199)](writeFile,_0x575978,_0x10602d),console['log'](_0x46f9a6(0x152));}export async function ensureLocalEnv(_0x45815b,_0x3776e5){const _0x2debda=_0x5f14c3,_0x49299a={'VeAui':function(_0x3175ab,_0xc7cf08){return _0x3175ab!==_0xc7cf08;},'SdrTo':function(_0x2cc055,_0x28a581){return _0x2cc055===_0x28a581;},'ieohU':'user','TrNvn':function(_0x3b0c8e){return _0x3b0c8e();},'nzmow':function(_0x376faf,_0x40894c,_0xf0365a){return _0x376faf(_0x40894c,_0xf0365a);},'SCQRp':_0x2debda(0x186),'Rtdzo':_0x2debda(0x147)};if(!findGitRoot()&&_0x49299a['VeAui'](_0x45815b?.['scope'],'user'))return console['log']('⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.'),{'ready':![],'skipped':!![]};const _0x20542f=_0x49299a['SdrTo'](_0x45815b?.['scope'],_0x49299a[_0x2debda(0x154)])?_0x49299a['TrNvn'](getRangerHomeDir):undefined;if(_0x49299a[_0x2debda(0x194)](findExistingEnv,_0x2debda(0x186),{'locations':[_0x49299a['SCQRp']],'rangerDir':_0x20542f}))return console[_0x2debda(0x19f)](_0x49299a['Rtdzo']),{'ready':!![],'skipped':![]};try{return await addEnv(_0x2debda(0x186),{'url':_0x45815b?.['url'],'force':_0x45815b?.[_0x2debda(0x197)],'allowInsecureLocalhost':_0x45815b?.[_0x2debda(0x142)],'scope':_0x45815b?.[_0x2debda(0x139)]},_0x3776e5),{'ready':!![],'skipped':![]};}catch(_0x216260){return console[_0x2debda(0x182)](_0x2debda(0x14d),_0x216260 instanceof Error?_0x216260[_0x2debda(0x171)]:_0x216260),{'ready':![],'skipped':![]};}}export async function start(_0x499607,_0x2e6dec,_0x94ed62){const _0x563d09=_0x5f14c3,_0x5c4aa7={'hxakO':_0x563d09(0x184),'zIbMD':function(_0x5948ee,_0x49a6a7){return _0x5948ee!==_0x49a6a7;},'fFZpD':function(_0x7dd38f,_0x8c0051){return _0x7dd38f!==_0x8c0051;},'GFSQK':_0x563d09(0x19c),'iCsaS':function(_0x27f1a5,_0xfd946d){return _0x27f1a5+_0xfd946d;},'hbsFB':function(_0x1c6d53,_0x3e35c2){return _0x1c6d53(_0x3e35c2);},'dQXSP':function(_0x2e7db8){return _0x2e7db8();},'wsCwU':_0x563d09(0x16e),'rIIXM':'skipped','nZxBs':'auth','rqmDS':'chromium','Wigkt':'plugin','gwZxc':function(_0x1d92a5){return _0x1d92a5();},'jowaI':_0x563d09(0x1a2),'rRQaI':function(_0xf1ac4d,_0x565440){return _0xf1ac4d instanceof _0x565440;},'GrVBV':'skills','BnGaU':function(_0x16faa7,_0x1a0dd2){return _0x16faa7(_0x1a0dd2);},'wbOZG':function(_0x28c2f3,_0x3bd6f5,_0x4c61cd){return _0x28c2f3(_0x3bd6f5,_0x4c61cd);},'KZjrH':_0x563d09(0x1a7),'JJPqu':function(_0x404465,_0x10ac92){return _0x404465+_0x10ac92;},'FHmYF':_0x563d09(0x165),'mKMaL':_0x563d09(0x145),'rQTpc':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','zgtgN':function(_0x3be2ce,_0x11ea06){return _0x3be2ce+_0x11ea06;}};console['log'](_0x5c4aa7['hxakO']);_0x5c4aa7['zIbMD'](_0x2e6dec?.[_0x563d09(0x139)],undefined)&&_0x5c4aa7[_0x563d09(0x15c)](_0x2e6dec['scope'],_0x5c4aa7['GFSQK'])&&(console['error'](_0x5c4aa7['iCsaS'](_0x5c4aa7['iCsaS'](_0x563d09(0x151)+String(_0x2e6dec['scope'])+_0x563d09(0x17f),_0x563d09(0x173)),_0x563d09(0x196))),process[_0x563d09(0x18e)](0x1));_0x2e6dec={..._0x2e6dec,'scope':'user'};const _0x514273=!_0x5c4aa7['hbsFB'](existsSync,_0x5c4aa7[_0x563d09(0x198)](getRangerHomeDir));await ensureRangerDir(_0x563d09(0x19c));if(_0x2e6dec?.[_0x563d09(0x140)])console[_0x563d09(0x19f)](_0x5c4aa7['wsCwU']),_0x94ed62?.['trackPhaseEnd']('auth',{'isFirstRun':_0x514273,'method':_0x5c4aa7[_0x563d09(0x190)]});else{_0x94ed62?.['trackPhaseStart']('auth');const _0x8bca65=await authenticate(_0x499607);_0x94ed62?.['trackPhaseEnd'](_0x5c4aa7[_0x563d09(0x1aa)],{'isFirstRun':_0x514273,'method':_0x8bca65['method']});}_0x94ed62?.['trackPhaseStart'](_0x563d09(0x148));_0x2e6dec?.[_0x563d09(0x134)]?console[_0x563d09(0x19f)]('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await ensureChromium(_0x2e6dec?.[_0x563d09(0x174)]);_0x94ed62?.['trackPhaseEnd'](_0x5c4aa7[_0x563d09(0x131)],{'isFirstRun':_0x514273,'skipped':!!_0x2e6dec?.[_0x563d09(0x134)]}),console[_0x563d09(0x19f)]('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0xb70ad3=_0x2e6dec?.[_0x563d09(0x139)],_0x11fdc4=_0x2e6dec?.[_0x563d09(0x1a2)]??![];let _0x7904d1=null;_0x11fdc4?(_0x94ed62?.[_0x563d09(0x16a)](_0x5c4aa7['Wigkt']),_0x7904d1=await _0x5c4aa7[_0x563d09(0x132)](ensureOpencodePluginConfig,_0xb70ad3),_0x94ed62?.[_0x563d09(0x172)](_0x5c4aa7[_0x563d09(0x19d)],{'isFirstRun':_0x514273,'opencode':!![]})):(_0x94ed62?.[_0x563d09(0x16a)](_0x5c4aa7[_0x563d09(0x19d)]),await _0x5c4aa7['hbsFB'](ensureClaudePlugin,_0xb70ad3),_0x94ed62?.['trackPhaseEnd']('plugin',{'isFirstRun':_0x514273}));if(_0x11fdc4&&_0x7904d1){_0x94ed62?.['trackPhaseStart']('skills');try{await installSkill('ranger',{'level':_0x7904d1['scope'],'cliVersion':_0x5c4aa7['gwZxc'](getCurrentVersion),'platform':_0x5c4aa7[_0x563d09(0x163)]}),_0x94ed62?.['trackPhaseEnd'](_0x563d09(0x178),{'isFirstRun':_0x514273,'opencode':!![]});}catch(_0x4fa653){console['warn'](_0x563d09(0x138),_0x5c4aa7[_0x563d09(0x1a5)](_0x4fa653,Error)?_0x4fa653['message']:_0x4fa653),_0x94ed62?.['trackPhaseEnd'](_0x5c4aa7['GrVBV'],{'isFirstRun':_0x514273,'opencode':!![],'failed':!![]});}}else _0x94ed62?.['trackPhaseStart'](_0x5c4aa7['GrVBV']),await _0x5c4aa7['BnGaU'](ensureClaudeSkills,_0xb70ad3),_0x94ed62?.[_0x563d09(0x172)](_0x563d09(0x178),{'isFirstRun':_0x514273});if(_0x2e6dec?.[_0x563d09(0x140)])console[_0x563d09(0x19f)](_0x563d09(0x1a3));else{if(_0x2e6dec?.['url']){_0x94ed62?.[_0x563d09(0x16a)](_0x563d09(0x1a7));const _0x41ce4d=await _0x5c4aa7['wbOZG'](ensureLocalEnv,{'url':_0x2e6dec[_0x563d09(0x159)],'force':_0x2e6dec?.['force'],'allowInsecureLocalhost':_0x2e6dec?.[_0x563d09(0x142)],'scope':_0x5c4aa7['GFSQK']},_0x94ed62);_0x94ed62?.[_0x563d09(0x172)](_0x5c4aa7['KZjrH'],{'isFirstRun':_0x514273,'profileReady':_0x41ce4d[_0x563d09(0x18d)],'userSkipped':_0x41ce4d[_0x563d09(0x16f)]});}else console['log'](_0x5c4aa7['JJPqu'](_0x5c4aa7[_0x563d09(0x169)](_0x563d09(0x19b)+(_0x563d09(0x1a0)+bold(_0x5c4aa7[_0x563d09(0x1a6)]))+'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:'),_0x563d09(0x188)));}if(_0x11fdc4)console[_0x563d09(0x19f)](_0x5c4aa7[_0x563d09(0x156)]),console['log'](_0x563d09(0x14f)),console['log'](_0x5c4aa7['rQTpc']),console[_0x563d09(0x19f)](_0x563d09(0x14e));else{const _0x388c89=bold(_0x563d09(0x161));console['log'](_0x5c4aa7[_0x563d09(0x187)](_0x563d09(0x181)+_0x388c89+_0x563d09(0x14c)+'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with',_0x563d09(0x146))+_0x563d09(0x176));}}
|
|
1
|
+
const _0x7ab54d=_0x5177;(function(_0xd9e5a3,_0x1b1ea7){const _0x7c0b89=_0x5177,_0x5104f1=_0xd9e5a3();while(!![]){try{const _0x5172f8=-parseInt(_0x7c0b89(0x150))/0x1+-parseInt(_0x7c0b89(0x18d))/0x2*(-parseInt(_0x7c0b89(0x1b6))/0x3)+parseInt(_0x7c0b89(0x166))/0x4*(-parseInt(_0x7c0b89(0x1bb))/0x5)+-parseInt(_0x7c0b89(0x176))/0x6+parseInt(_0x7c0b89(0x1bd))/0x7+parseInt(_0x7c0b89(0x162))/0x8*(parseInt(_0x7c0b89(0x155))/0x9)+parseInt(_0x7c0b89(0x161))/0xa;if(_0x5172f8===_0x1b1ea7)break;else _0x5104f1['push'](_0x5104f1['shift']());}catch(_0x48ae35){_0x5104f1['push'](_0x5104f1['shift']());}}}(_0x4109,0x3d79d));import{mkdir,writeFile}from'fs/promises';import{join,dirname}from'path';import{existsSync}from'fs';import{createRequire}from'module';import _0x3015e0 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';function _0x5177(_0x47819e,_0x5d46e4){_0x47819e=_0x47819e-0x14a;const _0x4109d5=_0x4109();let _0x517760=_0x4109d5[_0x47819e];return _0x517760;}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';import{spawn}from'child_process';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x7ab54d(0x15d);const bold=_0x4137a8=>'\x1b[1m'+_0x4137a8+'\x1b[0m';export function getPlaywrightVersion(){const _0x21caee=_0x7ab54d;try{const _0x10213=require['resolve']('playwright/package.json'),_0x3a035f=require(_0x10213);return _0x3a035f[_0x21caee(0x17f)];}catch{return null;}}function resolveBundledPlaywrightCli(){const _0x2113e4=_0x7ab54d,_0x5c8729={'VJbiJ':function(_0x1b6c92,_0xb0a39a){return _0x1b6c92(_0xb0a39a);}};try{const _0x5f4be5=join(dirname(require[_0x2113e4(0x18c)]('playwright/package.json')),'cli.js');return _0x5c8729['VJbiJ'](existsSync,_0x5f4be5)?_0x5f4be5:null;}catch{return null;}}const CHROMIUM_INSTALL_TIMEOUT_MS=Number(process[_0x7ab54d(0x17e)][_0x7ab54d(0x1a5)])||0x927c0;class ChromiumInstallTimeoutError extends Error{}export async function installChromiumBinary(_0x34e174,_0x2f8632=![]){const _0x289876=_0x7ab54d,_0xb744c3={'wyCwg':'--with-deps','DNlHA':'chromium','KlnZS':function(_0x7d5115,_0x2187ce,_0x104984){return _0x7d5115(_0x2187ce,_0x104984);},'CDDgc':function(_0xcfa639,_0xc67e08){return _0xcfa639 instanceof _0xc67e08;},'yhtWx':function(_0xe6d463,_0x4be51a){return _0xe6d463+_0x4be51a;}},_0x5cbfb3=resolveBundledPlaywrightCli(),_0x2e1982=_0x5cbfb3?process[_0x289876(0x153)]:'npx',_0x313cd8=[_0x5cbfb3??'playwright@'+_0x34e174,_0x289876(0x14a),..._0x2f8632?[_0xb744c3[_0x289876(0x17a)]]:[],_0xb744c3['DNlHA']];let _0x5d8b7c=![];for(let _0x39819=0x1;;_0x39819++){try{await _0xb744c3[_0x289876(0x18f)](runChromiumInstall,_0x2e1982,_0x313cd8);return;}catch(_0x3e5ee6){_0xb744c3['CDDgc'](_0x3e5ee6,ChromiumInstallTimeoutError)&&!_0x5d8b7c&&(_0x5d8b7c=!![],console['log'](_0xb744c3[_0x289876(0x194)]('\x0a\x20\x20Chromium\x20install\x20timed\x20out\x20(limit\x20'+Math[_0x289876(0x174)](CHROMIUM_INSTALL_TIMEOUT_MS/0x3e8)+_0x289876(0x177),'\x20\x20\x20\x20RANGER_CHROMIUM_INSTALL_TIMEOUT_MS=1800000\x20ranger\x20setup\x20deps')));if(_0x39819>=0x3)throw _0x3e5ee6;const _0x204d0d=_0x3e5ee6 instanceof Error?_0x3e5ee6['message']:String(_0x3e5ee6);console['log'](_0x289876(0x15e)+_0x39819+_0x289876(0x197)+_0x204d0d+_0x289876(0x1b7));}}}function _0x4109(){const _0x19a398=['resolve','22fsgibX','eiJlZ','KlnZS','ivwCJ','mrPAj','You\x20can\x20install\x20it\x20manually\x20by\x20running:','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','yhtWx','ROkeD','ISehH','\x20failed\x20(','/ranger:enable','✓\x20Local\x20profile\x20already\x20exists','✓\x20~/.ranger/\x20directory\x20already\x20exists','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','AFwfQ','opencode','trackPhaseEnd','UHxsV','url','iRfRr','.gitignore','ihUgm','force','RANGER_CHROMIUM_INSTALL_TIMEOUT_MS','✓\x20Skipping\x20authentication\x20(--skip-auth)','...','platform','profile','IKKeL','upoUM','ccoXn','EVGLq','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','KTIsC','nyuOt','✓\x20Already\x20authenticated\x20to\x20','stdout','auth','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','\x20(fallback\x20version)','57207cnxuCj',');\x20retrying...','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','ready','message','872975LRWLxG','plugin','196413DVNosb','UlCHn','ranger\x20profile\x20add\x20<name>','install','Authentication\x20failed:\x20','RvSML','URmuq','GITHUB_ENV','\x20install\x20chromium','329681ZzFyTQ','close','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','execPath','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','342810qjvKeU','✓\x20Authenticated\x20to\x20','skipAuth','trackPhaseStart','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','TAfza','ZymSh','Validating\x20API\x20token...','1.56.1','\x20\x20Chromium\x20install\x20attempt\x20','skipped','yUJhU','5720990EuHWJd','24wOHUhd','skills','withDeps','fNtzN','4RdRdkG','skipChromium','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','XPJRM','qlynj','warn','rjKKl','log','scope','SKQoq','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','status','RgdCJ','ljWmQ','round','local','1008636DsHECX','s).\x20On\x20a\x20slow\x20or\x20proxied\x20connection,\x20raise\x20the\x20limit\x20and\x20retry,\x20e.g.:\x0a','error','\x0aIn\x20Claude\x20Code,\x20run\x20','wyCwg','lUhcq','DtZLK','executablePath','env','version','success','confirm','dWWfn','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','existing_token','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','device_auth','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','user','\x20\x20npx\x20playwright@','BonEW'];_0x4109=function(){return _0x19a398;};return _0x4109();}function runChromiumInstall(_0x3bafc0,_0x46777a){const _0x5a2043=_0x7ab54d,_0x485755={'yUJhU':function(_0x71f01a,_0x5ea65d){return _0x71f01a(_0x5ea65d);},'BonEW':function(_0x4a355f){return _0x4a355f();},'Qhkkz':function(_0x40f68c,_0x4d8f1f){return _0x40f68c(_0x4d8f1f);},'WHIlT':'inherit','UHxsV':'win32','sTKHr':function(_0x33d3ac,_0x1fb379,_0x34a05b){return _0x33d3ac(_0x1fb379,_0x34a05b);},'AFwfQ':_0x5a2043(0x151)};return new Promise((_0x376d88,_0x20ecaa)=>{const _0x3dbaa7=_0x5a2043,_0x1bbc8e={'OnGTw':'SIGKILL','dWWfn':function(_0x4fdfc6,_0x1ba68d){return _0x485755['Qhkkz'](_0x4fdfc6,_0x1ba68d);}},_0x15a555=spawn(_0x3bafc0,_0x46777a,{'stdio':['ignore','inherit',_0x485755['WHIlT']],'shell':process[_0x3dbaa7(0x1a8)]===_0x485755[_0x3dbaa7(0x19f)]}),_0x44afad=_0x485755['sTKHr'](setTimeout,()=>{const _0x4d27f8=_0x3dbaa7;_0x15a555['kill'](_0x1bbc8e['OnGTw']),_0x1bbc8e[_0x4d27f8(0x182)](_0x20ecaa,new ChromiumInstallTimeoutError('Chromium\x20install\x20timed\x20out\x20after\x20'+Math['round'](CHROMIUM_INSTALL_TIMEOUT_MS/0x3e8)+'s'));},CHROMIUM_INSTALL_TIMEOUT_MS);_0x15a555['on'](_0x485755[_0x3dbaa7(0x19c)],_0xe021cb=>{const _0x2db4d0=_0x3dbaa7;_0x485755[_0x2db4d0(0x160)](clearTimeout,_0x44afad);if(_0xe021cb===0x0)_0x485755[_0x2db4d0(0x18b)](_0x376d88);else _0x20ecaa(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0xe021cb));}),_0x15a555['on']('error',_0x4e9229=>{clearTimeout(_0x44afad),_0x485755['yUJhU'](_0x20ecaa,_0x4e9229);});});}export async function authenticate(_0x5f14c9){const _0x4375f2=_0x7ab54d,_0x421f17={'xsayu':function(_0x5a0f99){return _0x5a0f99();},'lWGss':function(_0x5a2883,_0x15bb1f){return _0x5a2883(_0x15bb1f);},'VvelB':function(_0x59ce30,_0x3d15cf){return _0x59ce30(_0x3d15cf);},'FOdnA':'✓\x20Stored\x20credentials\x20locally','fNtzN':'provided_token'};if(!_0x5f14c9){const _0x25a622=await getToken();if(_0x25a622){const _0x18f356=await getCurrentUser(_0x25a622);if(_0x18f356[_0x4375f2(0x180)])return console['log'](_0x4375f2(0x1b1)+_0x18f356[_0x4375f2(0x189)]['organizationName']),{'token':_0x25a622,'method':_0x4375f2(0x184)};}try{_0x5f14c9=await _0x421f17['xsayu'](runDeviceAuthFlow);}catch(_0x379cb7){throw new Error(_0x4375f2(0x14b)+(_0x379cb7 instanceof Error?_0x379cb7['message']:_0x379cb7));}const _0x27e9be=await _0x421f17['lWGss'](getCurrentUser,_0x5f14c9);if(!_0x27e9be['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x27e9be[_0x4375f2(0x178)]);return console['log']('✓\x20Authenticated\x20to\x20'+_0x27e9be[_0x4375f2(0x189)]['organizationName']),{'token':_0x5f14c9,'method':_0x4375f2(0x187)};}console['log'](_0x4375f2(0x15c));const _0x549f12=await getCurrentUser(_0x5f14c9);if(!_0x549f12['success']){if(_0x549f12[_0x4375f2(0x171)])throw new Error('Authentication\x20failed:\x20'+_0x549f12['error']+_0x4375f2(0x185));else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x549f12[_0x4375f2(0x178)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x4375f2(0x16d)](_0x4375f2(0x156)+_0x549f12['user']['organizationName']),await _0x421f17['VvelB'](storeToken,_0x5f14c9),console[_0x4375f2(0x16d)](process[_0x4375f2(0x17e)][_0x4375f2(0x14e)]?'✓\x20Exported\x20credentials\x20for\x20CI':_0x421f17['FOdnA']),{'token':_0x5f14c9,'method':_0x421f17[_0x4375f2(0x165)]};}export async function ensureRangerDir(_0x70835c){const _0x547658=_0x7ab54d,_0x2e22d3={'ivwCJ':function(_0x77eb3d,_0x16bb5a){return _0x77eb3d(_0x16bb5a);},'RvSML':function(_0x3729ae,_0x32b7df,_0x513bfb){return _0x3729ae(_0x32b7df,_0x513bfb);},'opLPC':_0x547658(0x19a)};void _0x70835c;const _0x3b2972=getRangerHomeDir();return!_0x2e22d3[_0x547658(0x190)](existsSync,_0x3b2972)?(await _0x2e22d3[_0x547658(0x14c)](mkdir,_0x3b2972,{'recursive':!![]}),console['log']('✓\x20Created\x20~/.ranger/\x20directory'),{'path':_0x3b2972,'installed':!![]}):(console[_0x547658(0x16d)](_0x2e22d3['opLPC']),{'path':_0x3b2972,'installed':![]});}export async function ensureChromium(_0x2f237f=![]){const _0x5748bb=_0x7ab54d,_0x54eeac={'qlynj':function(_0x4e2151,_0x29c8fe){return _0x4e2151(_0x29c8fe);},'IOkdA':'✓\x20Playwright\x20Chromium\x20browser\x20found','TAfza':function(_0x7ca29,_0xe55a75){return _0x7ca29??_0xe55a75;},'SKQoq':_0x5748bb(0x181),'vEnPY':_0x5748bb(0x1b5),'KTIsC':'\x0aInstalling\x20Chromium\x20browser...\x0a','EVGLq':_0x5748bb(0x19b),'IKKeL':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','XPJRM':_0x5748bb(0x192),'UlCHn':'\x0a⚠\x20Skipping\x20Chromium\x20installation.'};let _0x201264=![];try{const _0x450bcc=chromium[_0x5748bb(0x17d)]();_0x201264=_0x54eeac[_0x5748bb(0x16a)](existsSync,_0x450bcc);}catch{_0x201264=![];}if(_0x201264)return console[_0x5748bb(0x16d)](_0x54eeac['IOkdA']),![];const _0x1f94ae=getPlaywrightVersion(),_0xdb5213=_0x54eeac[_0x5748bb(0x15a)](_0x1f94ae,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x10c9a6=!_0x1f94ae,_0x441259=process['stdin']['isTTY']&&process[_0x5748bb(0x1b2)]['isTTY'];let _0x51735e=!![];if(_0x441259){const {install:_0xde849c}=await _0x3015e0['prompt']([{'type':_0x54eeac[_0x5748bb(0x16f)],'name':_0x5748bb(0x14a),'message':_0x10c9a6?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0xdb5213+'\x20now?':'The\x20required\x20version\x20('+_0xdb5213+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x51735e=_0xde849c;}else console[_0x5748bb(0x16d)](_0x5748bb(0x152)+_0xdb5213+(_0x10c9a6?_0x54eeac['vEnPY']:'')+_0x5748bb(0x1a7));if(_0x51735e){console[_0x5748bb(0x16d)](_0x54eeac[_0x5748bb(0x1af)]);try{await installChromiumBinary(_0xdb5213,_0x2f237f),console[_0x5748bb(0x16d)](_0x54eeac[_0x5748bb(0x1ad)]);}catch(_0x374798){console['error'](_0x54eeac[_0x5748bb(0x1aa)],_0x374798 instanceof Error?_0x374798[_0x5748bb(0x1ba)]:_0x374798),console[_0x5748bb(0x16d)](_0x54eeac[_0x5748bb(0x169)]),console[_0x5748bb(0x16d)](_0x5748bb(0x18a)+_0xdb5213+'\x20install\x20chromium');}}else console['log'](_0x54eeac[_0x5748bb(0x1be)]),console[_0x5748bb(0x16d)](_0x5748bb(0x193)),console[_0x5748bb(0x16d)](_0x5748bb(0x18a)+_0xdb5213+_0x5748bb(0x14f));return!![];}export async function writeRangerGitignore(_0x266745){const _0x1cdf62=_0x7ab54d,_0x5b4231={'DtZLK':function(_0x281aa,_0x25a959,_0x3eb049){return _0x281aa(_0x25a959,_0x3eb049);}},_0x22894a=_0x5b4231[_0x1cdf62(0x17c)](join,_0x266745,_0x1cdf62(0x1a2)),_0x27c30e='\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 _0x5b4231[_0x1cdf62(0x17c)](writeFile,_0x22894a,_0x27c30e),console['log']('✓\x20Created\x20.ranger/.gitignore');}export async function ensureLocalEnv(_0x1f57bc,_0x231259){const _0x2813c1=_0x7ab54d,_0x49dc0e={'URmuq':function(_0x457218){return _0x457218();},'HZqqa':function(_0x58f74f,_0x366650){return _0x58f74f!==_0x366650;},'eiJlZ':function(_0x497d98,_0x442da2,_0x11b3de){return _0x497d98(_0x442da2,_0x11b3de);},'ljWmQ':_0x2813c1(0x175),'WSSRN':_0x2813c1(0x199),'aNuQM':function(_0x2ce56b,_0x4d50c1){return _0x2ce56b instanceof _0x4d50c1;}};if(!_0x49dc0e[_0x2813c1(0x14d)](findGitRoot)&&_0x49dc0e['HZqqa'](_0x1f57bc?.['scope'],'user'))return console['log']('⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.'),{'ready':![],'skipped':!![]};const _0x4062aa=_0x1f57bc?.[_0x2813c1(0x16e)]==='user'?getRangerHomeDir():undefined;if(_0x49dc0e[_0x2813c1(0x18e)](findExistingEnv,_0x49dc0e[_0x2813c1(0x173)],{'locations':['local'],'rangerDir':_0x4062aa}))return console[_0x2813c1(0x16d)](_0x49dc0e['WSSRN']),{'ready':!![],'skipped':![]};try{return await addEnv('local',{'url':_0x1f57bc?.['url'],'force':_0x1f57bc?.['force'],'allowInsecureLocalhost':_0x1f57bc?.['allowInsecureLocalhost'],'scope':_0x1f57bc?.[_0x2813c1(0x16e)]},_0x231259),{'ready':!![],'skipped':![]};}catch(_0x174a3e){return console['error']('\x0a❌\x20Profile\x20setup\x20failed:',_0x49dc0e['aNuQM'](_0x174a3e,Error)?_0x174a3e['message']:_0x174a3e),{'ready':![],'skipped':![]};}}export async function start(_0x71f1cd,_0x5e617e,_0x3f7571){const _0xbde622=_0x7ab54d,_0x111234={'lUhcq':'\x0a🚀\x20Ranger\x20Setup\x0a','MrihC':function(_0x355156,_0x423c8d){return _0x355156!==_0x423c8d;},'lfNSS':function(_0x8f8f1e,_0x467fa9){return _0x8f8f1e!==_0x467fa9;},'zFVba':function(_0x33a0c8,_0x398b90){return _0x33a0c8+_0x398b90;},'NQnsF':function(_0x2ed64e,_0x67156f){return _0x2ed64e(_0x67156f);},'wrQMg':function(_0x1ff136){return _0x1ff136();},'ehuTK':_0xbde622(0x1a6),'ROkeD':'auth','upoUM':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','oGjRR':function(_0x3e8fb4,_0x1dd4c1){return _0x3e8fb4(_0x1dd4c1);},'ZPBCS':_0xbde622(0x154),'gGmzX':_0xbde622(0x1bc),'nyuOt':function(_0x13420a,_0x525675){return _0x13420a&&_0x525675;},'RgdCJ':'skills','ZQRNg':'ranger','dQemq':'opencode','GMvtW':_0xbde622(0x188),'iRfRr':function(_0x1aa9ae,_0x41499b){return _0x1aa9ae+_0x41499b;},'ihUgm':function(_0x52aa28,_0x433877){return _0x52aa28+_0x433877;},'fzigw':function(_0x5d80a3,_0x3512e4){return _0x5d80a3(_0x3512e4);},'ccoXn':_0xbde622(0x1bf),'ISehH':_0xbde622(0x183),'mrPAj':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','oDqoj':'verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','rjKKl':function(_0x5362f7,_0x19c362){return _0x5362f7(_0x19c362);},'ZymSh':_0xbde622(0x198)};console[_0xbde622(0x16d)](_0x111234[_0xbde622(0x17b)]);_0x111234['MrihC'](_0x5e617e?.[_0xbde622(0x16e)],undefined)&&_0x111234['lfNSS'](_0x5e617e[_0xbde622(0x16e)],_0xbde622(0x189))&&(console['error'](_0x111234['zFVba']('ranger\x20setup\x20--scope='+String(_0x5e617e['scope'])+'\x20is\x20no\x20longer\x20supported.\x20','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20')+'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.'),process['exit'](0x1));_0x5e617e={..._0x5e617e,'scope':_0xbde622(0x189)};const _0x51762d=!_0x111234['NQnsF'](existsSync,_0x111234['wrQMg'](getRangerHomeDir));await ensureRangerDir('user');if(_0x5e617e?.['skipAuth'])console[_0xbde622(0x16d)](_0x111234['ehuTK']),_0x3f7571?.[_0xbde622(0x19e)](_0x111234['ROkeD'],{'isFirstRun':_0x51762d,'method':_0xbde622(0x15f)});else{_0x3f7571?.['trackPhaseStart'](_0xbde622(0x1b3));const _0xad1ae5=await authenticate(_0x71f1cd);_0x3f7571?.['trackPhaseEnd'](_0x111234[_0xbde622(0x195)],{'isFirstRun':_0x51762d,'method':_0xad1ae5['method']});}_0x3f7571?.[_0xbde622(0x158)]('chromium');_0x5e617e?.['skipChromium']?console['log'](_0x111234[_0xbde622(0x1ab)]):await _0x111234['oGjRR'](ensureChromium,_0x5e617e?.[_0xbde622(0x164)]);_0x3f7571?.['trackPhaseEnd']('chromium',{'isFirstRun':_0x51762d,'skipped':!!_0x5e617e?.[_0xbde622(0x167)]}),console['log'](_0x111234['ZPBCS']);const _0x4ed577=_0x5e617e?.[_0xbde622(0x16e)],_0x2ef655=_0x5e617e?.[_0xbde622(0x19d)]??![];let _0x3f93ad=null;_0x2ef655?(_0x3f7571?.['trackPhaseStart'](_0x111234['gGmzX']),_0x3f93ad=await ensureOpencodePluginConfig(_0x4ed577),_0x3f7571?.['trackPhaseEnd']('plugin',{'isFirstRun':_0x51762d,'opencode':!![]})):(_0x3f7571?.[_0xbde622(0x158)]('plugin'),await ensureClaudePlugin(_0x4ed577),_0x3f7571?.['trackPhaseEnd'](_0xbde622(0x1bc),{'isFirstRun':_0x51762d}));if(_0x111234[_0xbde622(0x1b0)](_0x2ef655,_0x3f93ad)){_0x3f7571?.[_0xbde622(0x158)](_0x111234[_0xbde622(0x172)]);try{await installSkill(_0x111234['ZQRNg'],{'level':_0x3f93ad['scope'],'cliVersion':_0x111234['wrQMg'](getCurrentVersion),'platform':_0x111234['dQemq']}),_0x3f7571?.['trackPhaseEnd'](_0x111234['RgdCJ'],{'isFirstRun':_0x51762d,'opencode':!![]});}catch(_0x43c0a3){console[_0xbde622(0x16b)](_0x111234['GMvtW'],_0x43c0a3 instanceof Error?_0x43c0a3['message']:_0x43c0a3),_0x3f7571?.[_0xbde622(0x19e)]('skills',{'isFirstRun':_0x51762d,'opencode':!![],'failed':!![]});}}else _0x3f7571?.[_0xbde622(0x158)](_0xbde622(0x163)),await ensureClaudeSkills(_0x4ed577),_0x3f7571?.[_0xbde622(0x19e)](_0x111234['RgdCJ'],{'isFirstRun':_0x51762d});if(_0x5e617e?.[_0xbde622(0x157)])console['log']('\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a');else{if(_0x5e617e?.['url']){_0x3f7571?.['trackPhaseStart'](_0xbde622(0x1a9));const _0x1e6390=await ensureLocalEnv({'url':_0x5e617e[_0xbde622(0x1a0)],'force':_0x5e617e?.[_0xbde622(0x1a4)],'allowInsecureLocalhost':_0x5e617e?.['allowInsecureLocalhost'],'scope':_0xbde622(0x189)},_0x3f7571);_0x3f7571?.[_0xbde622(0x19e)]('profile',{'isFirstRun':_0x51762d,'profileReady':_0x1e6390[_0xbde622(0x1b9)],'userSkipped':_0x1e6390['skipped']});}else console['log'](_0x111234[_0xbde622(0x1a1)](_0x111234[_0xbde622(0x1a3)](_0xbde622(0x1b8)+('\x0a\x20\x20'+_0x111234['fzigw'](bold,_0x111234[_0xbde622(0x1ac)]))+_0xbde622(0x168),_0xbde622(0x170)),_0xbde622(0x159)));}if(_0x2ef655)console[_0xbde622(0x16d)](_0x111234[_0xbde622(0x196)]),console['log'](_0x111234[_0xbde622(0x191)]),console['log'](_0xbde622(0x1b4)),console['log'](_0x111234['oDqoj']);else{const _0x3c2e7c=_0x111234[_0xbde622(0x16c)](bold,_0x111234[_0xbde622(0x15b)]);console['log'](_0x111234['ihUgm'](_0x111234['zFVba'](_0xbde622(0x179)+_0x3c2e7c+'\x20and\x20prompt\x20the\x20coding'+'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with',_0xbde622(0x1ae)),_0xbde622(0x186)));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x118608=_0x20c0;(function(_0x3525ea,_0x2dd603){const _0x772659=_0x20c0,_0x59fab5=_0x3525ea();while(!![]){try{const _0x1f7f08=-parseInt(_0x772659(0x1c6))/0x1+-parseInt(_0x772659(0x1a3))/0x2*(parseInt(_0x772659(0x1db))/0x3)+-parseInt(_0x772659(0x1e2))/0x4+-parseInt(_0x772659(0x1da))/0x5+-parseInt(_0x772659(0x1c0))/0x6+-parseInt(_0x772659(0x19a))/0x7+parseInt(_0x772659(0x18e))/0x8;if(_0x1f7f08===_0x2dd603)break;else _0x59fab5['push'](_0x59fab5['shift']());}catch(_0x2225d4){_0x59fab5['push'](_0x59fab5['shift']());}}}(_0x5ba2,0x39e88));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';function _0x20c0(_0x4da880,_0x50b1ab){_0x4da880=_0x4da880-0x186;const _0x5ba234=_0x5ba2();let _0x20c0bd=_0x5ba234[_0x4da880];return _0x20c0bd;}import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';function _0x5ba2(){const _0x1b086d=['No\x20profiles\x20configured','\x20(active)','502612jUHvPy','config','\x1b[1m','push','\x20plugin(s)\x20configured','\x0a---\x20Skills\x20---','JpQRR','\x1b[0m','Root:\x20','KrCLW','JyfLl','auth.json','status','API\x20Token:\x20✗\x20Not\x20found','EZnmB','path','all','cached\x20(updated\x20','ptbIU','name','SJqxh','9392520ntragV','(not\x20found)','plugin','AgsBu','\x0a---\x20Claude\x20Code\x20Plugin\x20---','settingsPath','has','opencode','\x1b]8;;\x07','\x20\x20Run:\x20ranger\x20setup\x20[token]','opencode-plugin','vbTlp','431760EwZkvx','auth.json.enc','not_configured','join','sessionUpdatedAt','yuEjy','\x20\x20Run:\x20ranger\x20skillup','dIDgL',':\x20installed\x20(','126428rNhvjx','sDbPG','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','@ranger-testing/opencode-plugin','Version:\x20','version','Organization:\x20','string','enabled','LcUrd','length','data','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','utf-8','\x20[local]','match','oFRzQ','\x20\x20Not\x20installed','\x20profiles\x20configured\x20(','UyqtD','filter','trim','XFixV','log','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','includes','displayName','user','omrwP','313680Sidmrg','mbBWn','\x0a---\x20Profiles\x20---','zIBFF','toString','IPTqM','282238YpYvmt','hjBEI','API\x20Environment:\x20','plaintext','debug','oZKVZ','not_installed','none','hasEncryptedAuth','cwd','qoRfT','VJsMH','no\x20session','VweSN','\x20\x20Run:\x20ranger\x20setup\x20--opencode','error','map','\x20(latest:\x20','ocJeP','pipe','1759040TnSogf','3lWUWqe','\x1b]8;;file://','\x20\x20User-level:','details','cIEzj'];_0x5ba2=function(){return _0x1b086d;};return _0x5ba2();}import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x566a0a=>_0x118608(0x1e4)+_0x566a0a+_0x118608(0x1e9),link=(_0x2d9cd2,_0x556697)=>_0x118608(0x1dc)+_0x2d9cd2+'\x07'+(_0x556697||_0x2d9cd2)+_0x118608(0x196);async function getOpencodePluginStatus(){const _0xde4382=_0x118608,_0x4aed32={'UyqtD':function(_0x47c6c0,_0x3e00f8){return _0x47c6c0(_0x3e00f8);},'zIBFF':function(_0x34b62e,_0x91c9cb){return _0x34b62e!==_0x91c9cb;},'xUCNq':'configured','iYhRe':'not_configured','yQCOp':_0xde4382(0x1a6),'ptbIU':_0xde4382(0x198),'ikAqI':function(_0x1b594a,_0x49cae5,_0x3eaca4,_0x13e8bb){return _0x1b594a(_0x49cae5,_0x3eaca4,_0x13e8bb);},'ocJeP':'ignore','IPTqM':_0xde4382(0x1d9),'KjyPY':'close'};return new Promise(_0x11532e=>{const _0x17d1a5=_0xde4382,_0x1ccd62={'oFRzQ':function(_0x473095,_0x15fdeb){return _0x473095!==_0x15fdeb;},'wZHpq':_0x4aed32['yQCOp'],'cIEzj':_0x4aed32[_0x17d1a5(0x18b)]},_0x472c4d=_0x4aed32['ikAqI'](spawn,_0x17d1a5(0x195),[_0x17d1a5(0x1ca),_0x17d1a5(0x1e3)],{'stdio':[_0x4aed32[_0x17d1a5(0x1d8)],_0x4aed32['IPTqM'],_0x4aed32[_0x17d1a5(0x1c5)]]});let _0xb25d33='';_0x472c4d['stdout']?.['on']('data',_0x2992ad=>{const _0x4754bf=_0x17d1a5;_0xb25d33+=_0x2992ad[_0x4754bf(0x1c4)]();}),_0x472c4d['stderr']?.['on'](_0x17d1a5(0x1ae),_0x3c3d27=>{const _0x243019=_0x17d1a5;_0xb25d33+=_0x3c3d27[_0x243019(0x1c4)]();}),_0x472c4d['on'](_0x17d1a5(0x1d5),()=>{const _0x834e95=_0x17d1a5;_0x4aed32[_0x834e95(0x1b6)](_0x11532e,{'status':_0x834e95(0x1cc)});}),_0x472c4d['on'](_0x4aed32['KjyPY'],_0x5400b1=>{const _0x24bf16=_0x17d1a5;if(_0x4aed32[_0x24bf16(0x1c3)](_0x5400b1,0x0)){_0x11532e({'status':'not_installed'});return;}const _0x1a1b9f=_0xb25d33[_0x24bf16(0x1b8)]();let _0x1f5b58=null;if(_0x1a1b9f)try{_0x1f5b58=JSON['parse'](_0x1a1b9f);}catch{const _0x42bc48=_0x1a1b9f['match'](/\{[\s\S]*\}$/);if(_0x42bc48)try{_0x1f5b58=JSON['parse'](_0x42bc48[0x0]);}catch{_0x1f5b58=null;}}const _0x39d840=Array['isArray'](_0x1f5b58?.[_0x24bf16(0x190)])?_0x1f5b58?.[_0x24bf16(0x190)]:[],_0x3f600a=_0x39d840['some'](_0x2a5cf5=>{const _0x2416fb=_0x24bf16;if(_0x1ccd62[_0x2416fb(0x1b3)](typeof _0x2a5cf5,_0x2416fb(0x1aa)))return![];return _0x2a5cf5[_0x2416fb(0x1bc)](_0x1ccd62['wZHpq'])||_0x2a5cf5['includes'](_0x1ccd62[_0x2416fb(0x1df)]);});if(_0x3f600a){_0x11532e({'status':_0x4aed32['xUCNq'],'details':_0x39d840[_0x24bf16(0x1ad)]>0x0?_0x39d840['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x39d840[_0x24bf16(0x1ad)]>0x0){_0x11532e({'status':_0x24bf16(0x19c),'details':_0x39d840[_0x24bf16(0x1ad)]+_0x24bf16(0x1e6)});return;}_0x11532e({'status':_0x4aed32['iYhRe']});});});}async function getSkillsFromDir(_0xe253fc,_0x53b153){const _0x1281cd=_0x118608,_0x5bfb22={'SJqxh':function(_0x432d77,_0x236407,_0x3c4f8f){return _0x432d77(_0x236407,_0x3c4f8f);},'hfaCS':'SKILL.md','mbBWn':function(_0x2b8f43,_0x3ed109){return _0x2b8f43(_0x3ed109);}};if(!existsSync(_0xe253fc))return[];const _0x464e89=[];try{const _0x3ba262=await _0x5bfb22[_0x1281cd(0x18d)](readdir,_0xe253fc,{'withFileTypes':!![]});for(const _0x2e45b8 of _0x3ba262){if(_0x2e45b8['isDirectory']()){const _0x1541d2=join(_0xe253fc,_0x2e45b8[_0x1281cd(0x18c)],_0x5bfb22['hfaCS']);if(_0x5bfb22[_0x1281cd(0x1c1)](existsSync,_0x1541d2)){let _0x5bde38=_0x2e45b8[_0x1281cd(0x18c)];try{const _0x1c2b4d=await readFile(_0x1541d2,_0x1281cd(0x1b0)),_0x4a43ca=_0x1c2b4d[_0x1281cd(0x1b2)](/name:\s*(.+)/);_0x4a43ca&&(_0x5bde38=_0x4a43ca[0x1][_0x1281cd(0x1b8)]());}catch{}_0x464e89[_0x1281cd(0x1e5)]({'name':_0x2e45b8['name'],'displayName':_0x5bde38,'path':_0x1541d2,'level':_0x53b153});}}}}catch{return[];}return _0x464e89;}async function getInstalledSkills(){const _0x141051=_0x118608,_0x36b6bc={'DeLjv':function(_0x40f7a5,_0x437468,_0x2f671c){return _0x40f7a5(_0x437468,_0x2f671c);},'qoRfT':function(_0x2771bd){return _0x2771bd();},'othfY':function(_0x1cab0e){return _0x1cab0e();},'omrwP':'user'},[_0x68ec01,_0x2667bb]=await Promise[_0x141051(0x189)]([_0x36b6bc['DeLjv'](getSkillsFromDir,_0x36b6bc[_0x141051(0x1d0)](getProjectSkillsDir),'project'),_0x36b6bc['DeLjv'](getSkillsFromDir,_0x36b6bc['othfY'](getUserSkillsDir),_0x36b6bc[_0x141051(0x1bf)])]);return{'project':_0x68ec01,'user':_0x2667bb};}async function getEnvironments(){const _0x3337c6=_0x118608,_0xc49825={'vbTlp':function(_0x46e16a,_0x4c890d){return _0x46e16a(_0x4c890d);},'sDbPG':function(_0x161dcb,_0x21196,_0x5bfcec){return _0x161dcb(_0x21196,_0x5bfcec);},'vtPXt':_0x3337c6(0x18f),'PSZZA':function(_0x2a0f1f,_0x1b2b47){return _0x2a0f1f===_0x1b2b47;}},{envNames:_0x1eccee,activeEnv:_0x193b48}=await getEnvNames(),_0x4e5f87=getRangerDir();if(!existsSync(_0x4e5f87))return{'envs':[],'activeEnv':null};const _0x520792=_0x1eccee[_0x3337c6(0x1d6)](_0x802456=>{const _0x16f8b3=_0x3337c6,_0x372cc9=_0xc49825[_0x16f8b3(0x199)](getEnvDir,_0x802456),_0x56d82b=join(_0x372cc9,'settings.json'),_0x2908c1=_0xc49825[_0x16f8b3(0x1a4)](join,_0x372cc9,_0x16f8b3(0x1ed)),_0x10bb7f=join(_0x372cc9,_0x16f8b3(0x19b));return{'name':_0x802456,'settingsPath':_0xc49825['vbTlp'](existsSync,_0x56d82b)?_0x56d82b:_0xc49825['vtPXt'],'hasPlaintextAuth':_0xc49825['vbTlp'](existsSync,_0x2908c1),'hasEncryptedAuth':existsSync(_0x10bb7f),'isActive':_0xc49825['PSZZA'](_0x802456,_0x193b48)};});return{'envs':_0x520792,'activeEnv':_0x193b48};}export async function status(){const _0x24ba55=_0x118608,_0x316c85={'lYKri':'\x0a📊\x20Ranger\x20Status\x0a','KrXTM':function(_0x34c432,_0x147582){return _0x34c432(_0x147582);},'dIDgL':function(_0x1dfc94){return _0x1dfc94();},'jqIej':function(_0x587c31){return _0x587c31();},'EZnmB':function(_0x1199f2){return _0x1199f2();},'VJsMH':function(_0x349d49,_0xd2b251){return _0x349d49===_0xd2b251;},'LcUrd':'configured','yuEjy':function(_0x18d5a9,_0x47ade4){return _0x18d5a9(_0x47ade4);},'NkLvV':_0x24ba55(0x1a6),'AgsBu':'not_configured','eDgnw':_0x24ba55(0x192),'saEAM':'ranger@trailhead','DuRUr':_0x24ba55(0x1ab),'oZKVZ':'disabled','KrCLW':function(_0x5d2135,_0x546fb6){return _0x5d2135+_0x546fb6;},'JyfLl':'No\x20skills\x20installed','oucse':function(_0x11a81c,_0x3b96ed){return _0x11a81c>_0x3b96ed;},'JpQRR':function(_0xdb3f14,_0x449f98){return _0xdb3f14>_0x449f98;},'kmbVK':function(_0x29fc20,_0x49eda2){return _0x29fc20+_0x49eda2;},'XFixV':_0x24ba55(0x1e0),'VweSN':_0x24ba55(0x1c9),'xHswV':_0x24ba55(0x18f),'hjBEI':function(_0x248537,_0x13f6e5,_0x51314d){return _0x248537(_0x13f6e5,_0x51314d);}};console['log'](_0x316c85['lYKri']);const _0x4afc25=process[_0x24ba55(0x1cf)](),_0x5c4c19=getRangerDir();if(!_0x316c85['KrXTM'](existsSync,_0x5c4c19)){console['log'](_0x24ba55(0x1ea)+link(_0x4afc25,_0x316c85['KrXTM'](bold,basename(_0x4afc25)))),console[_0x24ba55(0x1ba)]('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console[_0x24ba55(0x1ba)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x24ba55(0x1ea)+link(_0x4afc25,bold(_0x316c85['KrXTM'](basename,_0x4afc25))));const _0x73cd81=_0x316c85[_0x24ba55(0x1a1)](getCurrentVersion),_0x89964a=getLatestVersion();if(_0x89964a[_0x24ba55(0x1a8)]&&_0x89964a['version']!==_0x73cd81)console[_0x24ba55(0x1ba)]('Version:\x20'+_0x73cd81+_0x24ba55(0x1d7)+_0x89964a[_0x24ba55(0x1a8)]+')'),console[_0x24ba55(0x1ba)]('\x20\x20Run:\x20ranger\x20update');else _0x89964a['version']?console[_0x24ba55(0x1ba)](_0x24ba55(0x1a7)+_0x73cd81+'\x20(up\x20to\x20date)'):console[_0x24ba55(0x1ba)](_0x24ba55(0x1a7)+_0x73cd81);const _0x13f897=await getToken();if(_0x13f897){const _0x1fba62=await getCurrentUser(_0x13f897);_0x1fba62['success']?console['log'](_0x24ba55(0x1a9)+_0x316c85['KrXTM'](bold,_0x1fba62[_0x24ba55(0x1be)]['organizationName'])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console['log'](_0x24ba55(0x186)),console['log'](_0x24ba55(0x197));process['env']['DEBUG']&&(console[_0x24ba55(0x1ba)](_0x24ba55(0x1c8)+_0x316c85['jqIej'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+_0x316c85[_0x24ba55(0x187)](getApiBaseUrl)));console['log']('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x55fb12=await _0x316c85[_0x24ba55(0x187)](getOpencodePluginStatus);if(_0x316c85[_0x24ba55(0x1d1)](_0x55fb12[_0x24ba55(0x1ee)],_0x316c85[_0x24ba55(0x1ac)]))console['log']('\x20\x20'+_0x316c85[_0x24ba55(0x19f)](bold,_0x316c85['NkLvV'])+':\x20configured'),_0x55fb12[_0x24ba55(0x1de)]&&console[_0x24ba55(0x1ba)]('\x20\x20'+_0x55fb12['details']);else _0x55fb12['status']===_0x316c85[_0x24ba55(0x191)]?(console[_0x24ba55(0x1ba)]('\x20\x20Not\x20configured'),_0x55fb12[_0x24ba55(0x1de)]&&console[_0x24ba55(0x1ba)]('\x20\x20'+_0x55fb12[_0x24ba55(0x1de)]),console['log'](_0x24ba55(0x1d4))):console['log'](_0x24ba55(0x1bb));console['log'](_0x316c85['eDgnw']);const _0x415862=await getPluginInfo(_0x316c85['saEAM']);if(_0x415862){const _0xdd349c=_0x415862['scope']||'unknown',_0x18b24a=_0x415862[_0x24ba55(0x1ab)]?_0x316c85['DuRUr']:_0x316c85[_0x24ba55(0x1cb)];console[_0x24ba55(0x1ba)]('\x20\x20'+bold(_0x316c85['saEAM'])+_0x24ba55(0x1a2)+_0xdd349c+',\x20'+_0x18b24a+')');}else console[_0x24ba55(0x1ba)](_0x24ba55(0x1b4)),console[_0x24ba55(0x1ba)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)');console[_0x24ba55(0x1ba)](_0x24ba55(0x1e7));const {project:_0x545289,user:_0x1d6dec}=await getInstalledSkills(),_0x27b91f=_0x545289['filter'](_0x53d8bf=>RANGER_MANAGED_SKILLS['includes'](_0x53d8bf['name'])),_0x706fee=_0x1d6dec['filter'](_0x45d167=>RANGER_MANAGED_SKILLS['includes'](_0x45d167['name'])),_0x35441e=_0x316c85[_0x24ba55(0x1eb)](_0x27b91f['length'],_0x706fee[_0x24ba55(0x1ad)]);if(_0x35441e===0x0)console['log'](_0x316c85[_0x24ba55(0x1ec)]),console[_0x24ba55(0x1ba)](_0x24ba55(0x1a0));else{if(_0x316c85['oucse'](_0x27b91f[_0x24ba55(0x1ad)],0x0)){console['log']('\x20\x20Project-level:');for(const _0x3f8ba9 of _0x27b91f){console['log']('\x20\x20\x20\x20'+_0x316c85['KrXTM'](bold,_0x3f8ba9[_0x24ba55(0x1bd)])+':\x20'+link(_0x3f8ba9['path'],basename(_0x3f8ba9[_0x24ba55(0x188)])));}}if(_0x316c85[_0x24ba55(0x1e8)](_0x706fee['length'],0x0)){console['log'](_0x24ba55(0x1dd));for(const _0x50feac of _0x706fee){console['log']('\x20\x20\x20\x20'+bold(_0x50feac[_0x24ba55(0x1bd)])+':\x20'+link(_0x50feac['path'],_0x316c85[_0x24ba55(0x19f)](basename,_0x50feac['path'])));}}}console['log'](_0x24ba55(0x1c2));const {envs:_0x114f92,activeEnv:_0x4f9d25}=await getEnvironments();let _0xe51241=[];if(_0x13f897)try{_0xe51241=await _0x316c85['jqIej'](listCloudProfiles);}catch{}const _0x9f923d=_0x316c85['kmbVK'](_0x114f92['length'],_0xe51241['length']);if(_0x9f923d===0x0)console['log'](_0x316c85[_0x24ba55(0x1b9)]),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0x9f923d>0x5){const _0x51329e=[];_0xe51241[_0x24ba55(0x1ad)]>0x0&&_0x51329e['push'](_0xe51241['length']+'\x20cloud'),_0x114f92['length']>0x0&&_0x51329e['push'](_0x114f92[_0x24ba55(0x1ad)]+'\x20local'),console['log'](_0x9f923d+_0x24ba55(0x1b5)+_0x51329e[_0x24ba55(0x19d)](',\x20')+')'),_0x4f9d25&&console[_0x24ba55(0x1ba)]('\x20\x20Active:\x20'+bold(_0x4f9d25)),console['log'](_0x24ba55(0x1af));}else{for(const _0x2878ef of _0xe51241){const _0xab58c9=_0x316c85['VJsMH'](_0x2878ef['name'],_0x4f9d25)?'\x20(active)':'';console[_0x24ba55(0x1ba)]('\x20\x20'+_0x316c85['yuEjy'](bold,_0x2878ef['name'])+'\x20[cloud]'+_0xab58c9);const _0x33bb6f=_0x2878ef['sessionUpdatedAt']?_0x24ba55(0x18a)+_0x2878ef[_0x24ba55(0x19e)]+')':_0x24ba55(0x1d2);console['log']('\x20\x20\x20\x20Session:\x20'+_0x33bb6f);}const _0x9a2bb7=new Set(_0xe51241[_0x24ba55(0x1d6)](_0x2bb714=>_0x2bb714[_0x24ba55(0x18c)]));for(const _0x4ebd14 of _0x114f92){if(_0x9a2bb7['has'](_0x4ebd14[_0x24ba55(0x18c)]))continue;const _0x55f449=_0x4ebd14['isActive']?_0x24ba55(0x1e1):'',_0x3371d7=_0x4ebd14[_0x24ba55(0x1ce)]?'encrypted':_0x4ebd14['hasPlaintextAuth']?_0x316c85[_0x24ba55(0x1d3)]:_0x24ba55(0x1cd);console[_0x24ba55(0x1ba)]('\x20\x20'+_0x316c85['yuEjy'](bold,_0x4ebd14['name'])+_0x24ba55(0x1b1)+_0x55f449),console[_0x24ba55(0x1ba)]('\x20\x20\x20\x20Auth:\x20'+_0x3371d7),_0x4ebd14[_0x24ba55(0x193)]!==_0x316c85['xHswV']&&console[_0x24ba55(0x1ba)]('\x20\x20\x20\x20Settings:\x20'+_0x316c85[_0x24ba55(0x1c7)](link,_0x4ebd14[_0x24ba55(0x193)],_0x316c85['KrXTM'](basename,_0x4ebd14['settingsPath'])));}if(!_0x4f9d25){console[_0x24ba55(0x1ba)]('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x326cf1=[..._0xe51241[_0x24ba55(0x1d6)](_0x3e8f9d=>_0x3e8f9d['name']),..._0x114f92[_0x24ba55(0x1b7)](_0x5797af=>!_0x9a2bb7[_0x24ba55(0x194)](_0x5797af['name']))['map'](_0x80538=>_0x80538[_0x24ba55(0x18c)])];console[_0x24ba55(0x1ba)](_0x24ba55(0x1a5)+_0x326cf1[_0x24ba55(0x19d)](',\x20')+')');}}}console[_0x24ba55(0x1ba)]('');}
|
|
1
|
+
const _0x59cd0c=_0x9fe0;(function(_0x4e3336,_0x51b35b){const _0x3b63ac=_0x9fe0,_0x4baf48=_0x4e3336();while(!![]){try{const _0x62dd30=-parseInt(_0x3b63ac(0x197))/0x1*(parseInt(_0x3b63ac(0x17c))/0x2)+-parseInt(_0x3b63ac(0x185))/0x3+parseInt(_0x3b63ac(0x190))/0x4+-parseInt(_0x3b63ac(0x198))/0x5+-parseInt(_0x3b63ac(0x16e))/0x6+parseInt(_0x3b63ac(0x167))/0x7+parseInt(_0x3b63ac(0x145))/0x8*(parseInt(_0x3b63ac(0x14c))/0x9);if(_0x62dd30===_0x51b35b)break;else _0x4baf48['push'](_0x4baf48['shift']());}catch(_0x21791d){_0x4baf48['push'](_0x4baf48['shift']());}}}(_0x23a1,0xcccdc));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';function _0x23a1(){const _0x1a07b8=['auth.json','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available',':\x20installed\x20(','tiXRN','opencode-plugin','8611379ReXuMI','plugin','\x20\x20User-level:','status','match','API\x20Token:\x20✗\x20Not\x20found','iDOck','766506wjqfWU','\x20plugin(s)\x20configured','\x1b]8;;\x07','toString','\x20(up\x20to\x20date)','ignore','MuVGF','settings.json','unknown','name','@ranger-testing/opencode-plugin','\x20local','EeTee','\x0a📊\x20Ranger\x20Status\x0a','41656Vyxyqc','vVoNi','pCXZh','\x20\x20\x20\x20Auth:\x20','(not\x20found)','ranger@trailhead','SGksW','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','success','145887saqPIQ','details','\x20\x20Not\x20configured','Version:\x20','not_configured','mOjBr','length','DEBUG','push','yhAHT','map','695356ZvaBJr','parse','\x0a---\x20Profiles\x20---','\x20cloud','\x20\x20Run:\x20ranger\x20skillup','AxAPr','some','56aBpOzr','2907875AIqZwB','bhWRP','sessionUpdatedAt','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','settingsPath','\x0a\x20\x20No\x20active\x20profile\x20set','SKILL.md','none','auth.json.enc','fosfv','encrypted','pAjHi','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','yXsUO','\x1b]8;;file://','not_installed','836408KBALDC','\x20\x20Run:\x20ranger\x20setup\x20[token]','rzTMw','data','iGyZR','No\x20skills\x20installed','log','117UcVdcx','xYSmn','cJmwg','RpfqI','trim','configured','has','CRzRN','hasEncryptedAuth','EMmFK','ZzDJA','DIyWA','filter','YegQw','join','Root:\x20','includes','YfDqU','version','API\x20Environment:\x20','cwd','displayName'];_0x23a1=function(){return _0x1a07b8;};return _0x23a1();}import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';function _0x9fe0(_0x126316,_0x55d0c1){_0x126316=_0x126316-0x13a;const _0x23a1ba=_0x23a1();let _0x9fe021=_0x23a1ba[_0x126316];return _0x9fe021;}import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x1d870d=>'\x1b[1m'+_0x1d870d+'\x1b[0m',link=(_0x399b64,_0x27a64a)=>_0x59cd0c(0x143)+_0x399b64+'\x07'+(_0x27a64a||_0x399b64)+_0x59cd0c(0x170);async function getOpencodePluginStatus(){const _0x5858a3=_0x59cd0c,_0x2b8df5={'EeTee':function(_0x3597f6,_0x413ad0){return _0x3597f6!==_0x413ad0;},'EMmFK':function(_0x5de81b,_0x5af777){return _0x5de81b!==_0x5af777;},'IVooJ':function(_0x2478cb,_0x3f5331){return _0x2478cb(_0x3f5331);},'CRzRN':_0x5858a3(0x151),'rzTMw':function(_0x530094,_0x1dba18){return _0x530094>_0x1dba18;},'XfIWR':function(_0x251a7c,_0x3fb321){return _0x251a7c(_0x3fb321);},'tiXRN':function(_0x1ea4bb,_0x52229e,_0x247f2d,_0x377155){return _0x1ea4bb(_0x52229e,_0x247f2d,_0x377155);},'bVEmL':'opencode','ZQaaj':'pipe','dUJKg':'error'};return new Promise(_0x413596=>{const _0x4ec2cc=_0x5858a3,_0x49d4bb={'Rgixm':function(_0x36cff3,_0x14d7ca){return _0x2b8df5['XfIWR'](_0x36cff3,_0x14d7ca);},'xJrRF':_0x4ec2cc(0x144)},_0x432bbc=_0x2b8df5[_0x4ec2cc(0x165)](spawn,_0x2b8df5['bVEmL'],['debug','config'],{'stdio':[_0x4ec2cc(0x173),_0x2b8df5['ZQaaj'],_0x2b8df5['ZQaaj']]});let _0x2dfbb7='';_0x432bbc['stdout']?.['on'](_0x4ec2cc(0x148),_0x49e3df=>{const _0x5e9a5b=_0x4ec2cc;_0x2dfbb7+=_0x49e3df[_0x5e9a5b(0x171)]();}),_0x432bbc['stderr']?.['on']('data',_0x285295=>{const _0x240be5=_0x4ec2cc;_0x2dfbb7+=_0x285295[_0x240be5(0x171)]();}),_0x432bbc['on'](_0x2b8df5['dUJKg'],()=>{_0x49d4bb['Rgixm'](_0x413596,{'status':_0x49d4bb['xJrRF']});}),_0x432bbc['on']('close',_0x19687d=>{const _0x56551c=_0x4ec2cc,_0x25faba={'paNGW':function(_0x36bdea,_0x89aabb){const _0x5c6672=_0x9fe0;return _0x2b8df5[_0x5c6672(0x17a)](_0x36bdea,_0x89aabb);}};if(_0x2b8df5[_0x56551c(0x155)](_0x19687d,0x0)){_0x413596({'status':_0x56551c(0x144)});return;}const _0x659f0a=_0x2dfbb7[_0x56551c(0x150)]();let _0x58d490=null;if(_0x659f0a)try{_0x58d490=JSON['parse'](_0x659f0a);}catch{const _0x18494c=_0x659f0a[_0x56551c(0x16b)](/\{[\s\S]*\}$/);if(_0x18494c)try{_0x58d490=JSON[_0x56551c(0x191)](_0x18494c[0x0]);}catch{_0x58d490=null;}}const _0x1d4056=Array['isArray'](_0x58d490?.[_0x56551c(0x168)])?_0x58d490?.[_0x56551c(0x168)]:[],_0xf4a79d=_0x1d4056[_0x56551c(0x196)](_0x42ccaf=>{const _0x369192=_0x56551c;if(_0x25faba['paNGW'](typeof _0x42ccaf,'string'))return![];return _0x42ccaf['includes'](_0x369192(0x178))||_0x42ccaf['includes'](_0x369192(0x166));});if(_0xf4a79d){_0x2b8df5['IVooJ'](_0x413596,{'status':_0x2b8df5[_0x56551c(0x153)],'details':_0x1d4056[_0x56551c(0x18b)]>0x0?_0x1d4056[_0x56551c(0x18b)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x2b8df5[_0x56551c(0x147)](_0x1d4056[_0x56551c(0x18b)],0x0)){_0x413596({'status':'not_configured','details':_0x1d4056['length']+_0x56551c(0x16f)});return;}_0x2b8df5['IVooJ'](_0x413596,{'status':_0x56551c(0x189)});});});}async function getSkillsFromDir(_0x24c236,_0x19f141){const _0x436eec=_0x59cd0c,_0x206bf0={'yXsUO':function(_0x3b71c1,_0x1d4358){return _0x3b71c1(_0x1d4358);},'bhWRP':function(_0x5c8a21,_0x5cf2ab,_0x3e9897,_0x44d889){return _0x5c8a21(_0x5cf2ab,_0x3e9897,_0x44d889);},'fosfv':'utf-8'};if(!_0x206bf0[_0x436eec(0x142)](existsSync,_0x24c236))return[];const _0x2012b4=[];try{const _0x577795=await readdir(_0x24c236,{'withFileTypes':!![]});for(const _0x4f3cb7 of _0x577795){if(_0x4f3cb7['isDirectory']()){const _0x45f9ba=_0x206bf0[_0x436eec(0x199)](join,_0x24c236,_0x4f3cb7['name'],_0x436eec(0x13b));if(existsSync(_0x45f9ba)){let _0x564414=_0x4f3cb7[_0x436eec(0x177)];try{const _0x2023ef=await readFile(_0x45f9ba,_0x206bf0[_0x436eec(0x13e)]),_0x196712=_0x2023ef['match'](/name:\s*(.+)/);_0x196712&&(_0x564414=_0x196712[0x1][_0x436eec(0x150)]());}catch{}_0x2012b4[_0x436eec(0x18d)]({'name':_0x4f3cb7[_0x436eec(0x177)],'displayName':_0x564414,'path':_0x45f9ba,'level':_0x19f141});}}}}catch{return[];}return _0x2012b4;}async function getInstalledSkills(){const _0x50dd7f={'wEoRH':'user'},[_0x2d463e,_0x23ff22]=await Promise['all']([getSkillsFromDir(getProjectSkillsDir(),'project'),getSkillsFromDir(getUserSkillsDir(),_0x50dd7f['wEoRH'])]);return{'project':_0x2d463e,'user':_0x23ff22};}async function getEnvironments(){const _0x1ebfc5=_0x59cd0c,_0x80804b={'YfDqU':function(_0x1a6d18,_0x2145b9){return _0x1a6d18(_0x2145b9);},'FflOh':function(_0x20ab5b,_0x511ee0,_0x2e20a4){return _0x20ab5b(_0x511ee0,_0x2e20a4);},'DIyWA':function(_0x2692f4,_0x55e2e9,_0x3736a5){return _0x2692f4(_0x55e2e9,_0x3736a5);},'vVoNi':function(_0x2993e6,_0x31f23e){return _0x2993e6(_0x31f23e);},'iGyZR':function(_0x1d9a6f,_0x3f3448){return _0x1d9a6f===_0x3f3448;}},{envNames:_0x408638,activeEnv:_0x542695}=await getEnvNames(),_0x10e919=getRangerDir();if(!existsSync(_0x10e919))return{'envs':[],'activeEnv':null};const _0x3baeb9=_0x408638[_0x1ebfc5(0x18f)](_0x3c9d7c=>{const _0x158705=_0x1ebfc5,_0xea0b55=_0x80804b['YfDqU'](getEnvDir,_0x3c9d7c),_0x48d7c4=_0x80804b['FflOh'](join,_0xea0b55,_0x158705(0x175)),_0x541f35=_0x80804b[_0x158705(0x157)](join,_0xea0b55,_0x158705(0x162)),_0x1cf3fd=join(_0xea0b55,_0x158705(0x13d));return{'name':_0x3c9d7c,'settingsPath':_0x80804b[_0x158705(0x15d)](existsSync,_0x48d7c4)?_0x48d7c4:_0x158705(0x180),'hasPlaintextAuth':_0x80804b[_0x158705(0x15d)](existsSync,_0x541f35),'hasEncryptedAuth':_0x80804b[_0x158705(0x17d)](existsSync,_0x1cf3fd),'isActive':_0x80804b[_0x158705(0x149)](_0x3c9d7c,_0x542695)};});return{'envs':_0x3baeb9,'activeEnv':_0x542695};}export async function status(){const _0x1803bb=_0x59cd0c,_0x5d2104={'mOjBr':function(_0x64d096,_0x531c13){return _0x64d096(_0x531c13);},'MuVGF':function(_0x42cbff,_0x285cb0){return _0x42cbff(_0x285cb0);},'RpfqI':function(_0x22e456,_0x2579b7,_0x55e346){return _0x22e456(_0x2579b7,_0x55e346);},'NRAbF':function(_0x44fb6c){return _0x44fb6c();},'SGksW':function(_0x32c5e9,_0x308006){return _0x32c5e9!==_0x308006;},'LjaSg':'\x0a---\x20OpenCode\x20Plugin\x20---','pCXZh':function(_0x436b93,_0x5994d3){return _0x436b93===_0x5994d3;},'cCfdo':'configured','YegQw':function(_0x1befbf,_0x176da6){return _0x1befbf(_0x176da6);},'pMzRT':_0x1803bb(0x189),'dTlSu':'\x20\x20Run:\x20ranger\x20setup\x20--opencode','xYSmn':'\x0a---\x20Claude\x20Code\x20Plugin\x20---','pYUsR':_0x1803bb(0x181),'AxAPr':_0x1803bb(0x183),'mWBjG':'\x0a---\x20Skills\x20---','ocVjb':function(_0xf3f46f,_0x2d12fb){return _0xf3f46f+_0x2d12fb;},'pAjHi':function(_0x20997d,_0x42aa96){return _0x20997d>_0x42aa96;},'CPclb':function(_0x2db62d,_0x5ae109){return _0x2db62d>_0x5ae109;},'SYdVl':_0x1803bb(0x169),'QzJfJ':function(_0x2058ee,_0x259a4b){return _0x2058ee(_0x259a4b);},'cJmwg':_0x1803bb(0x192),'yhAHT':function(_0x4100e9){return _0x4100e9();},'GjyJp':'No\x20profiles\x20configured','vuJMd':function(_0x50842d,_0x5df0ae){return _0x50842d>_0x5df0ae;},'iDOck':'no\x20session','XtzqN':function(_0x3b87f2,_0x539c3b){return _0x3b87f2!==_0x539c3b;},'ZzDJA':'(not\x20found)','qtgOr':function(_0xeec791,_0x561771,_0x36e547){return _0xeec791(_0x561771,_0x36e547);}};console['log'](_0x1803bb(0x17b));const _0x54a905=process[_0x1803bb(0x160)](),_0x3e3cdd=getRangerDir();if(!_0x5d2104['mOjBr'](existsSync,_0x3e3cdd)){console['log']('Root:\x20'+link(_0x54a905,bold(_0x5d2104[_0x1803bb(0x174)](basename,_0x54a905)))),console['log']('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console[_0x1803bb(0x14b)](_0x1803bb(0x141));return;}console['log'](_0x1803bb(0x15b)+_0x5d2104[_0x1803bb(0x14f)](link,_0x54a905,_0x5d2104['mOjBr'](bold,_0x5d2104[_0x1803bb(0x18a)](basename,_0x54a905))));const _0x54d498=_0x5d2104['NRAbF'](getCurrentVersion),_0x139b9f=getLatestVersion();if(_0x139b9f[_0x1803bb(0x15e)]&&_0x5d2104[_0x1803bb(0x182)](_0x139b9f['version'],_0x54d498))console[_0x1803bb(0x14b)](_0x1803bb(0x188)+_0x54d498+'\x20(latest:\x20'+_0x139b9f[_0x1803bb(0x15e)]+')'),console[_0x1803bb(0x14b)]('\x20\x20Run:\x20ranger\x20update');else _0x139b9f[_0x1803bb(0x15e)]?console[_0x1803bb(0x14b)]('Version:\x20'+_0x54d498+_0x1803bb(0x172)):console['log'](_0x1803bb(0x188)+_0x54d498);const _0x1bc441=await getToken();if(_0x1bc441){const _0x2c5ac6=await getCurrentUser(_0x1bc441);_0x2c5ac6[_0x1803bb(0x184)]?console['log']('Organization:\x20'+_0x5d2104[_0x1803bb(0x18a)](bold,_0x2c5ac6['user']['organizationName'])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console[_0x1803bb(0x14b)](_0x1803bb(0x146)));}else console[_0x1803bb(0x14b)](_0x1803bb(0x16c)),console[_0x1803bb(0x14b)](_0x1803bb(0x146));process['env'][_0x1803bb(0x18c)]&&(console[_0x1803bb(0x14b)](_0x1803bb(0x15f)+getCurrentEnvironment()),console[_0x1803bb(0x14b)]('API\x20URL:\x20'+getApiBaseUrl()));console['log'](_0x5d2104['LjaSg']);const _0x2972bb=await getOpencodePluginStatus();if(_0x5d2104[_0x1803bb(0x17e)](_0x2972bb[_0x1803bb(0x16a)],_0x5d2104['cCfdo']))console['log']('\x20\x20'+_0x5d2104['YegQw'](bold,'@ranger-testing/opencode-plugin')+':\x20configured'),_0x2972bb[_0x1803bb(0x186)]&&console[_0x1803bb(0x14b)]('\x20\x20'+_0x2972bb[_0x1803bb(0x186)]);else _0x2972bb['status']===_0x5d2104['pMzRT']?(console['log'](_0x1803bb(0x187)),_0x2972bb[_0x1803bb(0x186)]&&console['log']('\x20\x20'+_0x2972bb['details']),console['log'](_0x5d2104['dTlSu'])):console[_0x1803bb(0x14b)](_0x1803bb(0x163));console['log'](_0x5d2104[_0x1803bb(0x14d)]);const _0x4454f4=await getPluginInfo(_0x5d2104['pYUsR']);if(_0x4454f4){const _0x83042b=_0x4454f4['scope']||_0x1803bb(0x176),_0x52a1d1=_0x4454f4['enabled']?'enabled':'disabled';console[_0x1803bb(0x14b)]('\x20\x20'+bold(_0x1803bb(0x181))+_0x1803bb(0x164)+_0x83042b+',\x20'+_0x52a1d1+')');}else console[_0x1803bb(0x14b)]('\x20\x20Not\x20installed'),console[_0x1803bb(0x14b)](_0x5d2104[_0x1803bb(0x195)]);console['log'](_0x5d2104['mWBjG']);const {project:_0x31ad8b,user:_0x23be5e}=await getInstalledSkills(),_0x521956=_0x31ad8b['filter'](_0x153b15=>RANGER_MANAGED_SKILLS['includes'](_0x153b15[_0x1803bb(0x177)])),_0x7a80ef=_0x23be5e[_0x1803bb(0x158)](_0xe543f8=>RANGER_MANAGED_SKILLS[_0x1803bb(0x15c)](_0xe543f8['name'])),_0x2f559b=_0x5d2104['ocVjb'](_0x521956[_0x1803bb(0x18b)],_0x7a80ef[_0x1803bb(0x18b)]);if(_0x2f559b===0x0)console[_0x1803bb(0x14b)](_0x1803bb(0x14a)),console[_0x1803bb(0x14b)](_0x1803bb(0x194));else{if(_0x5d2104[_0x1803bb(0x140)](_0x521956[_0x1803bb(0x18b)],0x0)){console['log']('\x20\x20Project-level:');for(const _0xe03a08 of _0x521956){console[_0x1803bb(0x14b)]('\x20\x20\x20\x20'+bold(_0xe03a08[_0x1803bb(0x161)])+':\x20'+_0x5d2104['RpfqI'](link,_0xe03a08['path'],basename(_0xe03a08['path'])));}}if(_0x5d2104['CPclb'](_0x7a80ef['length'],0x0)){console['log'](_0x5d2104['SYdVl']);for(const _0x2f7f6f of _0x7a80ef){console[_0x1803bb(0x14b)]('\x20\x20\x20\x20'+_0x5d2104['YegQw'](bold,_0x2f7f6f['displayName'])+':\x20'+link(_0x2f7f6f['path'],_0x5d2104['QzJfJ'](basename,_0x2f7f6f['path'])));}}}console['log'](_0x5d2104[_0x1803bb(0x14e)]);const {envs:_0x3efecc,activeEnv:_0x574f81}=await getEnvironments();let _0x1a194c=[];if(_0x1bc441)try{_0x1a194c=await _0x5d2104[_0x1803bb(0x18e)](listCloudProfiles);}catch{}const _0x1a98be=_0x3efecc[_0x1803bb(0x18b)]+_0x1a194c[_0x1803bb(0x18b)];if(_0x1a98be===0x0)console[_0x1803bb(0x14b)](_0x5d2104['GjyJp']),console[_0x1803bb(0x14b)](_0x1803bb(0x19b));else{if(_0x5d2104['CPclb'](_0x1a98be,0x5)){const _0x3718ff=[];_0x1a194c[_0x1803bb(0x18b)]>0x0&&_0x3718ff['push'](_0x1a194c[_0x1803bb(0x18b)]+_0x1803bb(0x193)),_0x5d2104['vuJMd'](_0x3efecc[_0x1803bb(0x18b)],0x0)&&_0x3718ff[_0x1803bb(0x18d)](_0x3efecc[_0x1803bb(0x18b)]+_0x1803bb(0x179)),console['log'](_0x1a98be+'\x20profiles\x20configured\x20('+_0x3718ff['join'](',\x20')+')'),_0x574f81&&console['log']('\x20\x20Active:\x20'+_0x5d2104['mOjBr'](bold,_0x574f81)),console[_0x1803bb(0x14b)]('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x33047f of _0x1a194c){const _0x1be2e0=_0x5d2104['pCXZh'](_0x33047f[_0x1803bb(0x177)],_0x574f81)?'\x20(active)':'';console['log']('\x20\x20'+bold(_0x33047f[_0x1803bb(0x177)])+'\x20[cloud]'+_0x1be2e0);const _0xa30b10=_0x33047f['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x33047f[_0x1803bb(0x19a)]+')':_0x5d2104[_0x1803bb(0x16d)];console[_0x1803bb(0x14b)]('\x20\x20\x20\x20Session:\x20'+_0xa30b10);}const _0x55d520=new Set(_0x1a194c['map'](_0x5f1fd1=>_0x5f1fd1['name']));for(const _0x1fc13c of _0x3efecc){if(_0x55d520['has'](_0x1fc13c['name']))continue;const _0x4f92a9=_0x1fc13c['isActive']?'\x20(active)':'',_0x21d9c3=_0x1fc13c[_0x1803bb(0x154)]?_0x1803bb(0x13f):_0x1fc13c['hasPlaintextAuth']?'plaintext':_0x1803bb(0x13c);console['log']('\x20\x20'+bold(_0x1fc13c['name'])+'\x20[local]'+_0x4f92a9),console['log'](_0x1803bb(0x17f)+_0x21d9c3),_0x5d2104['XtzqN'](_0x1fc13c['settingsPath'],_0x5d2104[_0x1803bb(0x156)])&&console[_0x1803bb(0x14b)]('\x20\x20\x20\x20Settings:\x20'+_0x5d2104['qtgOr'](link,_0x1fc13c[_0x1803bb(0x19c)],_0x5d2104[_0x1803bb(0x159)](basename,_0x1fc13c[_0x1803bb(0x19c)])));}if(!_0x574f81){console['log'](_0x1803bb(0x13a));const _0x2009e2=[..._0x1a194c[_0x1803bb(0x18f)](_0x375ee4=>_0x375ee4[_0x1803bb(0x177)]),..._0x3efecc['filter'](_0x5c6bff=>!_0x55d520[_0x1803bb(0x152)](_0x5c6bff[_0x1803bb(0x177)]))[_0x1803bb(0x18f)](_0x2ce676=>_0x2ce676[_0x1803bb(0x177)])];console[_0x1803bb(0x14b)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x2009e2[_0x1803bb(0x15a)](',\x20')+')');}}}console[_0x1803bb(0x14b)]('');}
|