@ranger-testing/ranger-cli 3.1.4-alpha.ffeeafe-46 → 3.1.5-alpha.9b89f77-48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/novaActCli.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/organizationEnvApi.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/rangerwrightCli.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/scenarioOriginCheck.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/tunnelClient.js +1 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/commands/verifyFeatureNovaCli.js +1 -1
- package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
- package/package.json +2 -1
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x3345(){const _0x14bade=['log','pHTES','1000044zslZAy','organizationName','1TmarOx','2003018nRZMZV','993240SUoBow','BZzen','376574zWhTKz','4524804EAIhWy','254997hpCCTh','160DYVKzJ','success','8EhQknx','Login\x20failed:\x20','IkIup','1007485JCfBvZ','42QMBPyN','EuwnY'];_0x3345=function(){return _0x14bade;};return _0x3345();}(function(_0x1ab4b2,_0x2685d7){const _0xe649bd=_0x4bda,_0x57bc75=_0x1ab4b2();while(!![]){try{const _0x23a979=-parseInt(_0xe649bd(0x105))/0x1*(-parseInt(_0xe649bd(0x106))/0x2)+-parseInt(_0xe649bd(0x10b))/0x3*(parseInt(_0xe649bd(0x10e))/0x4)+-parseInt(_0xe649bd(0x111))/0x5+parseInt(_0xe649bd(0x116))/0x6*(-parseInt(_0xe649bd(0x112))/0x7)+parseInt(_0xe649bd(0x107))/0x8+parseInt(_0xe649bd(0x10a))/0x9+-parseInt(_0xe649bd(0x10c))/0xa*(-parseInt(_0xe649bd(0x109))/0xb);if(_0x23a979===_0x2685d7)break;else _0x57bc75['push'](_0x57bc75['shift']());}catch(_0x2c43cd){_0x57bc75['push'](_0x57bc75['shift']());}}}(_0x3345,0xc4711));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';function _0x4bda(_0x494264,_0x1473da){_0x494264=_0x494264-0x104;const _0x334536=_0x3345();let _0x4bda6e=_0x334536[_0x494264];return _0x4bda6e;}export async function login(){const _0xad4258=_0x4bda,_0x284e12={'BZzen':function(_0x7bb918){return _0x7bb918();},'IkIup':'Re-authenticating\x20via\x20MCP\x20bootstrap...','pHTES':function(_0x372e1f){return _0x372e1f();},'LHEOu':'\x0a✅\x20API\x20key\x20stored\x20successfully','EuwnY':function(_0x27869b,_0xc968c){return _0x27869b instanceof _0xc968c;}},_0x245ecd=await _0x284e12[_0xad4258(0x108)](getMcpAuthOrigin);if(_0x245ecd){console['log'](_0x284e12[_0xad4258(0x110)]),await mcpBootstrap();return;}if(!_0x284e12[_0xad4258(0x115)](isInteractive))throw new Error('Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');try{const _0xc2939f=await runDeviceAuthFlow(),_0x4c3d88=await getCurrentUser(_0xc2939f);_0x4c3d88[_0xad4258(0x10d)]?console[_0xad4258(0x114)]('\x0a✅\x20Logged\x20in\x20to\x20'+_0x4c3d88['user'][_0xad4258(0x104)]):console[_0xad4258(0x114)](_0x284e12['LHEOu']);}catch(_0x1b6ac2){throw new Error(_0xad4258(0x10f)+(_0x284e12[_0xad4258(0x113)](_0x1b6ac2,Error)?_0x1b6ac2['message']:_0x1b6ac2));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x1cacfd=_0x158d;(function(_0x5a97c1,_0x2e5aff){const _0xd8d291=_0x158d,_0x12b277=_0x5a97c1();while(!![]){try{const _0x194391=-parseInt(_0xd8d291(0x1ea))/0x1*(parseInt(_0xd8d291(0x220))/0x2)+parseInt(_0xd8d291(0x215))/0x3*(parseInt(_0xd8d291(0x1dc))/0x4)+parseInt(_0xd8d291(0x20c))/0x5*(parseInt(_0xd8d291(0x1c4))/0x6)+parseInt(_0xd8d291(0x1d2))/0x7+parseInt(_0xd8d291(0x21d))/0x8*(-parseInt(_0xd8d291(0x20f))/0x9)+-parseInt(_0xd8d291(0x1ee))/0xa*(-parseInt(_0xd8d291(0x1f0))/0xb)+-parseInt(_0xd8d291(0x23d))/0xc*(-parseInt(_0xd8d291(0x1bb))/0xd);if(_0x194391===_0x2e5aff)break;else _0x12b277['push'](_0x12b277['shift']());}catch(_0x40253b){_0x12b277['push'](_0x12b277['shift']());}}}(_0x5cd5,0x25537));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',_0x1cacfd(0x1b6)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');function _0x5cd5(){const _0x15180c=['stdout','lPiHL','533uDIxZE','S256','GLTnP','Discovering\x20authorization\x20server...','utf-8','VgJbH','tkQCQ','DJhdl','startsWith','6iGGjZU','NrcGB','listen','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','initialize','ranger-cli','MCP\x20server\x20returned\x20HTTP\x20','client_secret','writeHead','text/event-stream','CBadz','close','fNpiR','Unknown\x20error','1034859uVXNfk','string','UHlai','wMjvG','127.0.0.1','\x20done','refresh.txt','ybZXx','error','result','23524Oozkjy','client_id','state','yjcix','Bearer\x20','bZxWE','mhAaY','end','expiresAt','hGfTw','clientId','GRPLm','origin','amDRa','7YRsUUY','hex','get_cli_token','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','20EwqNfv','\x0aOpening\x20browser\x20for\x20authentication...','1464782mIHEFW','write','\x0aUnexpected\x20response\x20structure:','Dlhkx','Exchanging\x20authorization\x20code...','get','tylkh','vzhYg','2025-03-26','base64url','baFav','aIHQC','update','Initializing\x20MCP\x20session...','json','win32','AZabT','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','pjjCZ','replace','2.0','refresh_token','YIJQC','text','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','now','http://localhost:','Client\x20registration\x20failed:\x20','153445NZkHiH','qqhUd','HTTP\x20','72tySude','EzbqN','searchParams','resource','code_challenge','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','21dfwvKX','yVyKX','cwGVj','YWaGt','status','toString','access_token','rDRiX','241504oMNqsW','name','platform','84598aPWBmR','set','content','rUGxf','1.0.0','/callback','tools/call','open','url','refreshToken','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','POST','start','noOie','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','HJcfH','udcHV','registration_endpoint','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','slice','pathname','NxfLM','application/json,\x20text/event-stream','Token\x20exchange\x20failed:\x20','token','.ranger','trim','AXeWa','clientSecret','59844yUTOvA','stringify','tnwWg','VKKqn','/.well-known/oauth-authorization-server','Authorization','ucCgj','sbeQT','text/html','auth-origin.txt','SLrnn','parse','HgMkO','application/json','JvfFj','mcp-oauth-tokens.json','\x0aToken\x20written\x20to\x20','log'];_0x5cd5=function(){return _0x15180c;};return _0x5cd5();}export async function getMcpAuthOrigin(){const _0x3caa59=_0x1cacfd,_0x13f617={'tylkh':function(_0x234c0e,_0x4392f5,_0x5dd23d){return _0x234c0e(_0x4392f5,_0x5dd23d);},'sbeQT':function(_0x9e361d,_0x2b8556){return _0x9e361d||_0x2b8556;}};try{const _0x63eb08=(await _0x13f617[_0x3caa59(0x1f6)](readFile,AUTH_ORIGIN_PATH,_0x3caa59(0x1bf)))[_0x3caa59(0x23a)]();return _0x13f617[_0x3caa59(0x244)](_0x63eb08,null);}catch{return null;}}export async function mcpBootstrap(){const _0x9d1092=_0x1cacfd,_0x43d59b={'DJhdl':function(_0x309463){return _0x309463();},'udcHV':function(_0x3c79e3,_0x415720){return _0x3c79e3===_0x415720;},'ueafp':function(_0x159bb2,_0x42fa5e){return _0x159bb2+_0x42fa5e;},'lPiHL':_0x9d1092(0x232),'VgJbH':_0x9d1092(0x208)},_0x3f1136=_0x43d59b[_0x9d1092(0x1c2)](getMcpAuthUrl);currentOrigin=_0x3f1136;const _0x487c02=process[_0x9d1092(0x1b9)]['isTTY']??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x3f1136+'\x0a');const _0xac420f=await tryUnauthenticated(_0x3f1136);let _0x4a5fec=null;if(_0x43d59b[_0x9d1092(0x230)](_0xac420f,'proxied'))_0x4a5fec='';else{_0x4a5fec=await loadCachedToken();if(!_0x4a5fec){if(!_0x487c02)throw new Error(_0x43d59b['ueafp'](_0x43d59b[_0x9d1092(0x1ba)],_0x43d59b[_0x9d1092(0x1c0)]));_0x4a5fec=await oauthFlow(_0x3f1136);}}await callGetCliToken(_0x3f1136,_0x4a5fec);}async function tryUnauthenticated(_0xd99a9){const _0x1f3e6c=_0x1cacfd,_0x1eb159={'jCxkH':function(_0x3bd8d7,_0x399391,_0x26599b){return _0x3bd8d7(_0x399391,_0x26599b);},'KWyzw':_0x1f3e6c(0x22b),'eDyAu':_0x1f3e6c(0x1f8),'VJMxt':_0x1f3e6c(0x224)},_0x545d4c=await _0x1eb159['jCxkH'](fetch,_0xd99a9,{'method':_0x1eb159['KWyzw'],'headers':{'Content-Type':'application/json','Accept':_0x1f3e6c(0x236)},'body':JSON[_0x1f3e6c(0x23e)]({'jsonrpc':'2.0','id':0x1,'method':'initialize','params':{'protocolVersion':_0x1eb159['eDyAu'],'capabilities':{},'clientInfo':{'name':_0x1f3e6c(0x1c9),'version':_0x1eb159['VJMxt']}}})});if(_0x545d4c['ok'])return await _0x545d4c[_0x1f3e6c(0x207)](),'proxied';if(_0x545d4c['status']===0x191)return await _0x545d4c['text'](),'needs-oauth';const _0x777786=await _0x545d4c['text']();throw new Error(_0x1f3e6c(0x1ca)+_0x545d4c[_0x1f3e6c(0x219)]+':\x20'+_0x777786);}class OAuthTimeoutError extends Error{constructor(_0x34537f){const _0x14ef1a=_0x1cacfd,_0x1b25d1={'baFav':'OAuthTimeoutError'};super(_0x34537f),this[_0x14ef1a(0x21e)]=_0x1b25d1[_0x14ef1a(0x1fa)];}}async function oauthFlow(_0x3c4ad0){const _0x4cda5d=_0x1cacfd,_0x4350ea={'cwGVj':function(_0xe741cc,_0x5894f5){return _0xe741cc(_0x5894f5);},'cArHe':function(_0x27a260,_0x36f963){return _0x27a260 instanceof _0x36f963;},'ytghF':function(_0x115eb3){return _0x115eb3();}};try{return await _0x4350ea[_0x4cda5d(0x217)](oauthFlowAttempt,_0x3c4ad0);}catch(_0x226ebd){if(_0x4350ea['cArHe'](_0x226ebd,OAuthTimeoutError)&&await loadCachedClient())return console['log']('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await _0x4350ea['ytghF'](clearCachedClient),await oauthFlowAttempt(_0x3c4ad0);throw _0x226ebd;}}async function oauthFlowAttempt(_0x31afaf){const _0x480fd4=_0x1cacfd,_0x5de2dc={'AZabT':_0x480fd4(0x1be),'yVyKX':function(_0x523066,_0x4b54de){return _0x523066(_0x4b54de);},'mhAaY':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','EzbqN':function(_0x36bbdf){return _0x36bbdf();},'CBadz':'Registering\x20OAuth\x20client...','hGfTw':function(_0xd1c97f,_0x25c840,_0xfbd63d){return _0xd1c97f(_0x25c840,_0xfbd63d);},'cutqa':_0x480fd4(0x1b4),'uqAER':'refresh_token','JvfFj':'none','ucCgj':_0x480fd4(0x1d7),'krRtU':_0x480fd4(0x1eb),'UEinN':_0x480fd4(0x1dd),'eGBzn':'redirect_uri','NxfLM':_0x480fd4(0x213),'bZxWE':_0x480fd4(0x1bc),'aMJbs':_0x480fd4(0x1de),'SXluv':_0x480fd4(0x1ef),'GRPLm':function(_0x26c1d3,_0x4044e7){return _0x26c1d3(_0x4044e7);},'pjjCZ':function(_0x3742f8,_0x10e226){return _0x3742f8(_0x10e226);},'WrwOJ':_0x480fd4(0x212),'QQhvn':_0x480fd4(0x22b)},_0x36de2a=_0x31afaf[_0x480fd4(0x203)](/\/mcp$/,'');process['stdout'][_0x480fd4(0x1f1)](_0x5de2dc[_0x480fd4(0x200)]);const _0x3e1a24=await _0x5de2dc[_0x480fd4(0x216)](fetch,_0x36de2a+'/.well-known/oauth-protected-resource');if(!_0x3e1a24['ok'])throw new Error(_0x5de2dc[_0x480fd4(0x1e2)]);const _0x112d17=await _0x3e1a24[_0x480fd4(0x1fe)](),_0x2951bf=_0x112d17['authorization_servers']?.[0x0];if(!_0x2951bf)throw new Error(_0x480fd4(0x1c7));console[_0x480fd4(0x1b8)]('\x20'+_0x2951bf);const _0x416503=await fetchAuthServerMetadata(_0x2951bf);let _0x482426,_0x5568ea;const _0x489023=await _0x5de2dc[_0x480fd4(0x210)](loadCachedClient);if(_0x489023)_0x482426=_0x489023['clientId'],_0x5568ea=_0x489023['clientSecret'];else{if(_0x416503[_0x480fd4(0x231)]){process[_0x480fd4(0x1b9)][_0x480fd4(0x1f1)](_0x5de2dc[_0x480fd4(0x1ce)]);const _0x15dda6=await _0x5de2dc[_0x480fd4(0x1e5)](fetch,_0x416503['registration_endpoint'],{'method':'POST','headers':{'Content-Type':_0x5de2dc['cutqa']},'body':JSON[_0x480fd4(0x23e)]({'client_name':'Ranger\x20CLI','redirect_uris':[_0x480fd4(0x20a)+CALLBACK_PORT+_0x480fd4(0x225)],'grant_types':['authorization_code',_0x5de2dc['uqAER']],'response_types':['code'],'token_endpoint_auth_method':_0x5de2dc[_0x480fd4(0x1b5)]})});if(!_0x15dda6['ok']){const _0x4d5955=await _0x15dda6['text']();throw new Error(_0x480fd4(0x20b)+_0x4d5955);}const _0x5ebc48=await _0x15dda6[_0x480fd4(0x1fe)]();_0x482426=_0x5ebc48['client_id'],_0x5568ea=_0x5ebc48[_0x480fd4(0x1cb)],await saveCachedClient(_0x482426,_0x5568ea),console['log'](_0x5de2dc[_0x480fd4(0x243)]);}else throw new Error(_0x480fd4(0x1ed));}const _0x2937ba=randomBytes(0x20)['toString']('base64url'),_0x6eb2ec=_0x5de2dc['yVyKX'](createHash,'sha256')[_0x480fd4(0x1fc)](_0x2937ba)['digest'](_0x480fd4(0x1f9)),_0x4ea979=_0x5de2dc['yVyKX'](randomBytes,0x10)[_0x480fd4(0x21a)](_0x5de2dc['krRtU']),_0x54829=new URL(_0x416503['authorization_endpoint']);_0x54829[_0x480fd4(0x211)]['set']('response_type','code'),_0x54829[_0x480fd4(0x211)]['set'](_0x5de2dc['UEinN'],_0x482426),_0x54829[_0x480fd4(0x211)][_0x480fd4(0x221)](_0x5de2dc['eGBzn'],'http://localhost:'+CALLBACK_PORT+'/callback'),_0x54829['searchParams']['set'](_0x5de2dc[_0x480fd4(0x235)],_0x6eb2ec),_0x54829['searchParams'][_0x480fd4(0x221)]('code_challenge_method',_0x5de2dc[_0x480fd4(0x1e1)]),_0x54829[_0x480fd4(0x211)][_0x480fd4(0x221)](_0x5de2dc['aMJbs'],_0x4ea979);_0x112d17[_0x480fd4(0x212)]&&_0x54829[_0x480fd4(0x211)][_0x480fd4(0x221)](_0x480fd4(0x212),_0x112d17['resource']);console[_0x480fd4(0x1b8)](_0x5de2dc['SXluv']),console[_0x480fd4(0x1b8)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x54829['toString']()+'\x0a'),await _0x5de2dc[_0x480fd4(0x1e7)](openBrowser,_0x54829[_0x480fd4(0x21a)]());const _0x4219db=await _0x5de2dc[_0x480fd4(0x202)](waitForCallback,_0x4ea979);process[_0x480fd4(0x1b9)]['write'](_0x480fd4(0x1f4));const _0x42a8c3=new URLSearchParams({'grant_type':'authorization_code','code':_0x4219db,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0x482426,'code_verifier':_0x2937ba});_0x5568ea&&_0x42a8c3['set']('client_secret',_0x5568ea);_0x112d17[_0x480fd4(0x212)]&&_0x42a8c3[_0x480fd4(0x221)](_0x5de2dc['WrwOJ'],_0x112d17['resource']);const _0x240156=await fetch(_0x416503['token_endpoint'],{'method':_0x5de2dc['QQhvn'],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x42a8c3});if(!_0x240156['ok']){const _0x5ae612=await _0x240156['text']();throw new Error(_0x480fd4(0x237)+_0x5ae612);}const _0x42e3dc=await _0x240156['json']();return console['log']('\x20done'),await saveCachedToken(_0x42e3dc[_0x480fd4(0x21b)],_0x42e3dc[_0x480fd4(0x205)],_0x42e3dc['expires_in']),_0x42e3dc['access_token'];}async function callGetCliToken(_0x7cae5b,_0x2d2d4a){const _0x13e5bf=_0x1cacfd,_0x2510c1={'yjcix':function(_0x190bee,_0x58064b,_0x4b8053){return _0x190bee(_0x58064b,_0x4b8053);},'HJcfH':_0x13e5bf(0x22b),'pLANh':_0x13e5bf(0x1b4),'KzGQQ':'application/json,\x20text/event-stream','EznRC':_0x13e5bf(0x1fd),'WlnZK':'2025-03-26','HgMkO':_0x13e5bf(0x1c9),'YIJQC':_0x13e5bf(0x224),'tnwWg':_0x13e5bf(0x1d7),'rUGxf':'notifications/initialized','fNpiR':function(_0x2cf90b,_0x1e2261){return _0x2cf90b(_0x1e2261);},'cuaDV':'2.0','aIHQC':_0x13e5bf(0x226),'vzhYg':_0x13e5bf(0x1f2),'XowqU':_0x13e5bf(0x201),'ybZXx':_0x13e5bf(0x1d8),'YTWbN':_0x13e5bf(0x22a)},_0x2d2cf7={'Content-Type':_0x2510c1['pLANh'],'Accept':_0x2510c1['KzGQQ']};_0x2d2d4a&&(_0x2d2cf7[_0x13e5bf(0x242)]=_0x13e5bf(0x1e0)+_0x2d2d4a);const _0x3e9772=async _0x212f3c=>{const _0x8e1d9d=_0x13e5bf,_0x1e0509=await _0x2510c1['yjcix'](fetch,_0x7cae5b,{'method':_0x2510c1[_0x8e1d9d(0x22f)],'headers':_0x2d2cf7,'body':JSON['stringify'](_0x212f3c)});if(!_0x1e0509['ok']){const _0x39e90e=await _0x1e0509[_0x8e1d9d(0x207)]();throw new Error(_0x8e1d9d(0x20e)+_0x1e0509[_0x8e1d9d(0x219)]+':\x20'+_0x39e90e);}return parseResponse(_0x1e0509);};process['stdout']['write'](_0x2510c1['EznRC']);const _0x2af21e=await _0x3e9772({'jsonrpc':_0x13e5bf(0x204),'id':0x1,'method':_0x13e5bf(0x1c8),'params':{'protocolVersion':_0x2510c1['WlnZK'],'capabilities':{},'clientInfo':{'name':_0x2510c1[_0x13e5bf(0x1b3)],'version':_0x2510c1[_0x13e5bf(0x206)]}}});if(_0x2af21e['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x2af21e['error']['message']??JSON[_0x13e5bf(0x23e)](_0x2af21e[_0x13e5bf(0x1da)])));console['log'](_0x2510c1[_0x13e5bf(0x23f)]),await fetch(_0x7cae5b,{'method':_0x13e5bf(0x22b),'headers':_0x2d2cf7,'body':JSON[_0x13e5bf(0x23e)]({'jsonrpc':'2.0','method':_0x2510c1[_0x13e5bf(0x223)]})})['then'](_0x36e0f8=>_0x36e0f8[_0x13e5bf(0x207)]()),process[_0x13e5bf(0x1b9)][_0x13e5bf(0x1f1)]('Requesting\x20CLI\x20token...');const _0x10a9b0=await _0x2510c1[_0x13e5bf(0x1d0)](_0x3e9772,{'jsonrpc':_0x2510c1['cuaDV'],'id':0x2,'method':_0x2510c1[_0x13e5bf(0x1fb)],'params':{'name':_0x13e5bf(0x1ec),'arguments':{}}});if(_0x10a9b0['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x10a9b0['error']['message']??JSON['stringify'](_0x10a9b0['error'])));console[_0x13e5bf(0x1b8)]('\x20done');const _0x1e5324=extractToken(_0x10a9b0[_0x13e5bf(0x1db)]);if(!_0x1e5324){console['error'](_0x2510c1[_0x13e5bf(0x1f7)]),console['error'](JSON[_0x13e5bf(0x23e)](_0x10a9b0[_0x13e5bf(0x1db)],null,0x2));throw new Error(_0x2510c1['XowqU']);}const _0x32d172=_0x2510c1[_0x13e5bf(0x1df)](join,homedir(),_0x13e5bf(0x239)),_0x29c909=join(_0x32d172,_0x2510c1[_0x13e5bf(0x1d9)]);await mkdir(_0x32d172,{'recursive':!![]}),await writeFile(_0x29c909,_0x1e5324,{'mode':0x180}),await writeFile(join(_0x32d172,_0x13e5bf(0x246)),_0x7cae5b,{'mode':0x180}),console['log'](_0x13e5bf(0x1b7)+_0x29c909),console['log'](_0x2510c1['YTWbN']);}async function fetchAuthServerMetadata(_0x18bb68){const _0x4df135=_0x1cacfd,_0x594baa=_0x18bb68+_0x4df135(0x241),_0x12d9df=await fetch(_0x594baa);if(!_0x12d9df['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x594baa+':\x20'+_0x12d9df[_0x4df135(0x219)]);return _0x12d9df['json']();}function waitForCallback(_0x4cdbe0){const _0x1c0070=_0x1cacfd,_0x433c26={'bobjG':'OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','SLrnn':'/callback','YDsbC':'Not\x20found','tkQCQ':_0x1c0070(0x1de),'zcpDJ':'error_description','GLTnP':function(_0x389735,_0xad5a49){return _0x389735(_0xad5a49);},'VKKqn':_0x1c0070(0x245),'YWaGt':_0x1c0070(0x214),'wMjvG':function(_0x4cdf91,_0x122935,_0x530d18){return _0x4cdf91(_0x122935,_0x530d18);},'dYKFp':_0x1c0070(0x1d6)};return new Promise((_0x337bcf,_0x27aad9)=>{const _0x3a4111=_0x1c0070,_0x2de7eb=()=>{const _0xa28a36=_0x158d;_0x48da6c['closeAllConnections'](),_0x48da6c[_0xa28a36(0x1cf)]();},_0x5d554c=_0x433c26[_0x3a4111(0x1d5)](setTimeout,()=>{_0x2de7eb(),_0x27aad9(new OAuthTimeoutError(_0x433c26['bobjG']));},0x1d4c0),_0x48da6c=_0x433c26[_0x3a4111(0x1bd)](createServer,(_0x272135,_0xcb8506)=>{const _0x58a6a2=_0x3a4111,_0x3c37f8=new URL(_0x272135[_0x58a6a2(0x228)]??'/',_0x58a6a2(0x20a)+CALLBACK_PORT);if(_0x3c37f8[_0x58a6a2(0x234)]!==_0x433c26[_0x58a6a2(0x247)]){_0xcb8506['writeHead'](0x194),_0xcb8506['end'](_0x433c26['YDsbC']);return;}const _0x62f854=_0x3c37f8['searchParams'][_0x58a6a2(0x1f5)]('code'),_0x45a1a5=_0x3c37f8['searchParams']['get'](_0x433c26[_0x58a6a2(0x1c1)]),_0x36d8ed=_0x3c37f8['searchParams'][_0x58a6a2(0x1f5)](_0x58a6a2(0x1da));if(_0x36d8ed){const _0x3635e5=_0x3c37f8[_0x58a6a2(0x211)]['get'](_0x433c26['zcpDJ'])??_0x36d8ed;_0xcb8506['writeHead'](0xc8,{'Content-Type':_0x58a6a2(0x245)}),_0xcb8506['end']('<html><body><h2>Authentication\x20failed</h2><p>'+_0x3635e5+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),_0x433c26[_0x58a6a2(0x1bd)](clearTimeout,_0x5d554c),_0x2de7eb(),_0x27aad9(new Error('OAuth\x20error:\x20'+_0x3635e5));return;}if(!_0x62f854||_0x45a1a5!==_0x4cdbe0){_0xcb8506[_0x58a6a2(0x1cc)](0x190,{'Content-Type':_0x58a6a2(0x245)}),_0xcb8506[_0x58a6a2(0x1e3)](_0x58a6a2(0x22e));return;}_0xcb8506['writeHead'](0xc8,{'Content-Type':_0x433c26[_0x58a6a2(0x240)]}),_0xcb8506['end'](_0x433c26[_0x58a6a2(0x218)]),_0x433c26['GLTnP'](clearTimeout,_0x5d554c),_0x2de7eb(),_0x433c26['GLTnP'](_0x337bcf,_0x62f854);});_0x48da6c[_0x3a4111(0x1c6)](CALLBACK_PORT,_0x433c26['dYKFp']);});}async function openBrowser(_0x4afc25){const _0xcfbb62=_0x1cacfd,_0x10ef19={'Dlhkx':'darwin','qqhUd':function(_0x7dc487,_0x247b2f){return _0x7dc487===_0x247b2f;},'cGiBy':function(_0x3c8241,_0x2cd9db){return _0x3c8241(_0x2cd9db);}},_0x333c72=process['platform']===_0x10ef19[_0xcfbb62(0x1f3)]?_0xcfbb62(0x227):_0x10ef19[_0xcfbb62(0x20d)](process[_0xcfbb62(0x21f)],_0xcfbb62(0x1ff))?_0xcfbb62(0x22c):'xdg-open';_0x10ef19['cGiBy'](exec,_0x333c72+'\x20\x22'+_0x4afc25+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x80091e=_0x1cacfd,_0x15be03={'YkzFV':function(_0xd354e,_0x4a7f20){return _0xd354e!==_0x4a7f20;},'ZSGVo':function(_0x52078e,_0x1be7f2){return _0x52078e>_0x1be7f2;}};try{const _0x780f62=JSON[_0x80091e(0x1b2)](await readFile(TOKEN_CACHE_PATH,'utf-8'));if(_0x780f62['origin']&&_0x15be03['YkzFV'](_0x780f62[_0x80091e(0x1e8)],currentOrigin))return null;if(_0x780f62[_0x80091e(0x1e4)]&&_0x15be03['ZSGVo'](Date['now'](),_0x780f62[_0x80091e(0x1e4)]))return null;return _0x780f62['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0xb9e81c,_0x371c73,_0x11a0b4){const _0x946c6e=_0x1cacfd,_0xb47ab3={'AXeWa':function(_0x1f5e06,_0x4df92e){return _0x1f5e06+_0x4df92e;},'qkhuY':function(_0x3aa29b,_0x54d3bb,_0x5d26de){return _0x3aa29b(_0x54d3bb,_0x5d26de);},'rjjvE':function(_0x5f0149){return _0x5f0149();}},_0x286bad=await loadCachedData(),_0x285dcb={..._0x286bad,'origin':currentOrigin,'accessToken':_0xb9e81c,'refreshToken':_0x371c73??_0x286bad?.[_0x946c6e(0x229)],'expiresAt':_0x11a0b4?_0xb47ab3[_0x946c6e(0x23b)](Date[_0x946c6e(0x209)](),_0x11a0b4*0x3e8):undefined};await _0xb47ab3['qkhuY'](mkdir,join(_0xb47ab3['rjjvE'](homedir),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x946c6e(0x23e)](_0x285dcb),{'mode':0x180});}function _0x158d(_0x13cf0c,_0x3afbe4){_0x13cf0c=_0x13cf0c-0x1b2;const _0x5cd5e3=_0x5cd5();let _0x158dd0=_0x5cd5e3[_0x13cf0c];return _0x158dd0;}async function loadCachedClient(){const _0x32aad2=_0x1cacfd,_0x3227a1={'amDRa':function(_0x133b0,_0xad0372){return _0x133b0!==_0xad0372;}},_0x48d687=await loadCachedData();if(_0x48d687?.['origin']&&_0x3227a1[_0x32aad2(0x1e9)](_0x48d687['origin'],currentOrigin))return null;return _0x48d687?.['clientId']?{'clientId':_0x48d687[_0x32aad2(0x1e6)],'clientSecret':_0x48d687[_0x32aad2(0x23c)]}:null;}async function clearCachedClient(){const _0x4eead9=_0x1cacfd,_0x19df4e=await loadCachedData();if(!_0x19df4e)return;const {clientId:_0x334703,clientSecret:_0x118ba8,..._0x2082fb}=_0x19df4e;await writeFile(TOKEN_CACHE_PATH,JSON[_0x4eead9(0x23e)](_0x2082fb),{'mode':0x180});}async function saveCachedClient(_0x195e4d,_0x2e1145){const _0x55bcf6=_0x1cacfd,_0x29a8ce={'ptSIp':function(_0x39edf1,_0x5ade8b,_0x1935a3){return _0x39edf1(_0x5ade8b,_0x1935a3);},'noOie':'.ranger'},_0x55b783=await loadCachedData(),_0x2c3662={..._0x55b783,'origin':currentOrigin,'accessToken':_0x55b783?.['accessToken']??'','clientId':_0x195e4d,'clientSecret':_0x2e1145};await mkdir(_0x29a8ce['ptSIp'](join,homedir(),_0x29a8ce[_0x55bcf6(0x22d)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x2c3662),{'mode':0x180});}async function loadCachedData(){const _0x55cdbf=_0x1cacfd,_0x3031ac={'MsEJh':'utf-8'};try{return JSON[_0x55cdbf(0x1b2)](await readFile(TOKEN_CACHE_PATH,_0x3031ac['MsEJh']));}catch{return null;}}async function parseResponse(_0x418395){const _0x52aaf9=_0x1cacfd,_0x264955=_0x418395['headers']['get']('content-type')??'';if(_0x264955['includes'](_0x52aaf9(0x1cd))){const _0x2b7720=await _0x418395['text']();for(const _0x394b12 of _0x2b7720['split']('\x0a')){const _0x38fd52=_0x394b12[_0x52aaf9(0x23a)]();if(_0x38fd52[_0x52aaf9(0x1c3)]('data:')){const _0x27fc22=_0x38fd52[_0x52aaf9(0x233)]('data:'['length'])[_0x52aaf9(0x23a)]();if(!_0x27fc22)continue;try{const _0x49c06b=JSON[_0x52aaf9(0x1b2)](_0x27fc22);if(_0x49c06b['id']!==undefined||_0x49c06b[_0x52aaf9(0x1da)])return _0x49c06b;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x418395['json']();}function extractToken(_0x11d98a){const _0x4039c2=_0x1cacfd,_0x26b440={'NrcGB':'string','HtaqD':_0x4039c2(0x1d1),'rDRiX':function(_0x22a71f,_0x479769){return _0x22a71f===_0x479769;},'UHlai':'text'};if(!_0x11d98a)return null;const _0x4c778f=_0x11d98a['structuredContent'];if(_0x4c778f?.['token']&&typeof _0x4c778f[_0x4039c2(0x238)]===_0x26b440[_0x4039c2(0x1c5)])return _0x4c778f['token'];if(_0x11d98a['isError']){const _0x9609c6=_0x11d98a[_0x4039c2(0x222)];throw new Error('Server\x20returned\x20error:\x20'+(_0x9609c6?.[0x0]?.[_0x4039c2(0x207)]??_0x26b440['HtaqD']));}const _0x1b366a=_0x11d98a['content'];if(_0x1b366a)for(const _0x4e9d61 of _0x1b366a){if(_0x26b440[_0x4039c2(0x21c)](_0x4e9d61['type'],_0x26b440[_0x4039c2(0x1d4)])&&_0x4e9d61['text']){try{const _0xf7c4d=JSON['parse'](_0x4e9d61['text']);if(typeof _0xf7c4d?.[_0x4039c2(0x238)]===_0x4039c2(0x1d3))return _0xf7c4d['token'];}catch{}const _0x5c6746=_0x4e9d61['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x5c6746)return _0x5c6746[0x1];}}return null;}
|
|
1
|
+
const _0x3a9246=_0x2bd8;(function(_0x238952,_0x3fb191){const _0x331bf1=_0x2bd8,_0x21a2a9=_0x238952();while(!![]){try{const _0x53e5b1=parseInt(_0x331bf1(0x205))/0x1*(parseInt(_0x331bf1(0x26d))/0x2)+-parseInt(_0x331bf1(0x1ee))/0x3+parseInt(_0x331bf1(0x22f))/0x4+parseInt(_0x331bf1(0x267))/0x5*(-parseInt(_0x331bf1(0x1f7))/0x6)+-parseInt(_0x331bf1(0x275))/0x7+-parseInt(_0x331bf1(0x20a))/0x8+parseInt(_0x331bf1(0x24f))/0x9*(parseInt(_0x331bf1(0x216))/0xa);if(_0x53e5b1===_0x3fb191)break;else _0x21a2a9['push'](_0x21a2a9['shift']());}catch(_0x5abee6){_0x21a2a9['push'](_0x21a2a9['shift']());}}}(_0x1bf3,0x5de93));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',_0x3a9246(0x20b)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x3a9246(0x25e));export async function getMcpAuthOrigin(){const _0x208985=_0x3a9246,_0x1519f1={'CwVAg':function(_0x4429c5,_0x371204,_0x38946a){return _0x4429c5(_0x371204,_0x38946a);}};try{const _0x383570=(await _0x1519f1[_0x208985(0x204)](readFile,AUTH_ORIGIN_PATH,_0x208985(0x227)))['trim']();return _0x383570||null;}catch{return null;}}export async function mcpBootstrap(){const _0x28a099=_0x3a9246,_0x1c5956={'rvFCY':function(_0x5b0b74,_0x3f91a6){return _0x5b0b74(_0x3f91a6);},'MnNZs':'proxied','bJXoZ':'MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','mYXfQ':function(_0x57d786,_0x38229a,_0x53750c){return _0x57d786(_0x38229a,_0x53750c);}},_0x3e43a1=getMcpAuthUrl();currentOrigin=_0x3e43a1;const _0x56ccf0=process['stdout']['isTTY']??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x3e43a1+'\x0a');const _0x4d406b=await _0x1c5956[_0x28a099(0x1ec)](tryUnauthenticated,_0x3e43a1);let _0xa4a46c=null;if(_0x4d406b===_0x1c5956[_0x28a099(0x279)])_0xa4a46c='';else{_0xa4a46c=await loadCachedToken();if(!_0xa4a46c){if(!_0x56ccf0)throw new Error(_0x1c5956[_0x28a099(0x218)]+'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.');_0xa4a46c=await _0x1c5956[_0x28a099(0x1ec)](oauthFlow,_0x3e43a1);}}await _0x1c5956[_0x28a099(0x236)](callGetCliToken,_0x3e43a1,_0xa4a46c);}async function tryUnauthenticated(_0x2f2ae5){const _0x358f3b=_0x3a9246,_0x52e6e5={'ygRTx':'POST','fLwHS':'application/json,\x20text/event-stream','gvUhV':'2.0','dKalD':'ranger-cli','HJCsu':'1.0.0','SkpKa':_0x358f3b(0x26e)},_0x5f456b=await fetch(_0x2f2ae5,{'method':_0x52e6e5['ygRTx'],'headers':{'Content-Type':'application/json','Accept':_0x52e6e5['fLwHS']},'body':JSON[_0x358f3b(0x20f)]({'jsonrpc':_0x52e6e5['gvUhV'],'id':0x1,'method':'initialize','params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x52e6e5['dKalD'],'version':_0x52e6e5['HJCsu']}}})});if(_0x5f456b['ok'])return await _0x5f456b[_0x358f3b(0x253)](),'proxied';if(_0x5f456b[_0x358f3b(0x250)]===0x191)return await _0x5f456b[_0x358f3b(0x253)](),_0x52e6e5['SkpKa'];const _0x332ddf=await _0x5f456b[_0x358f3b(0x253)]();throw new Error(_0x358f3b(0x1f2)+_0x5f456b['status']+':\x20'+_0x332ddf);}class OAuthTimeoutError extends Error{constructor(_0x89e179){const _0x5d7d4b={'TeFeJ':'OAuthTimeoutError'};super(_0x89e179),this['name']=_0x5d7d4b['TeFeJ'];}}async function oauthFlow(_0x4f1bf4){const _0x31c85e=_0x3a9246,_0xe9eeb7={'KcPIq':function(_0xa17012,_0x13a44d){return _0xa17012(_0x13a44d);},'EwFjV':function(_0x2535c7,_0x183d8d){return _0x2535c7 instanceof _0x183d8d;},'EzeQU':function(_0x3ea653){return _0x3ea653();},'bNdyR':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'};try{return await _0xe9eeb7['KcPIq'](oauthFlowAttempt,_0x4f1bf4);}catch(_0x42f062){if(_0xe9eeb7[_0x31c85e(0x208)](_0x42f062,OAuthTimeoutError)&&await _0xe9eeb7['EzeQU'](loadCachedClient))return console['log'](_0xe9eeb7[_0x31c85e(0x1fc)]),await _0xe9eeb7[_0x31c85e(0x226)](clearCachedClient),await _0xe9eeb7[_0x31c85e(0x27c)](oauthFlowAttempt,_0x4f1bf4);throw _0x42f062;}}async function oauthFlowAttempt(_0x4f658f){const _0x33b825=_0x3a9246,_0x56b905={'LXzTM':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','CnFqC':_0x33b825(0x23e),'DfOuL':function(_0x1fa28d,_0x522955){return _0x1fa28d(_0x522955);},'Dyhlq':function(_0x2d935f){return _0x2d935f();},'VwCZD':_0x33b825(0x200),'neNAt':_0x33b825(0x202),'kbsAK':'\x20done','MHPHA':_0x33b825(0x24e),'djbIe':function(_0x97ff02,_0x2778f0){return _0x97ff02(_0x2778f0);},'hWMJC':'sha256','VIGUZ':_0x33b825(0x220),'RNUbG':_0x33b825(0x217),'srEoe':'code_challenge','jTLFs':'S256','cALSY':'state','byaZu':function(_0x5dcaa4,_0x16031a){return _0x5dcaa4(_0x16031a);},'XwXdL':_0x33b825(0x254),'avMmG':function(_0x60f265,_0x228f06,_0x3085be){return _0x60f265(_0x228f06,_0x3085be);},'bTNsz':function(_0x544759,_0x2d397a,_0x550171,_0x1019a3){return _0x544759(_0x2d397a,_0x550171,_0x1019a3);}},_0x23b248=_0x4f658f[_0x33b825(0x219)](/\/mcp$/,'');process[_0x33b825(0x239)][_0x33b825(0x206)]('Discovering\x20authorization\x20server...');const _0x26f54c=await fetch(_0x23b248+_0x33b825(0x245));if(!_0x26f54c['ok'])throw new Error(_0x56b905[_0x33b825(0x212)]);const _0x43f1f0=await _0x26f54c['json'](),_0x320780=_0x43f1f0['authorization_servers']?.[0x0];if(!_0x320780)throw new Error(_0x56b905['CnFqC']);console[_0x33b825(0x1ef)]('\x20'+_0x320780);const _0x9c6ed7=await _0x56b905['DfOuL'](fetchAuthServerMetadata,_0x320780);let _0x5baaf1,_0x478244;const _0x1e5ce2=await _0x56b905['Dyhlq'](loadCachedClient);if(_0x1e5ce2)_0x5baaf1=_0x1e5ce2['clientId'],_0x478244=_0x1e5ce2[_0x33b825(0x25a)];else{if(_0x9c6ed7[_0x33b825(0x24b)]){process['stdout']['write'](_0x56b905['VwCZD']);const _0x5e71f8=await fetch(_0x9c6ed7['registration_endpoint'],{'method':_0x56b905[_0x33b825(0x241)],'headers':{'Content-Type':'application/json'},'body':JSON[_0x33b825(0x20f)]({'client_name':_0x33b825(0x221),'redirect_uris':[_0x33b825(0x23f)+CALLBACK_PORT+'/callback'],'grant_types':[_0x33b825(0x254),_0x33b825(0x24a)],'response_types':['code'],'token_endpoint_auth_method':'none'})});if(!_0x5e71f8['ok']){const _0x4e3d19=await _0x5e71f8[_0x33b825(0x253)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x4e3d19);}const _0x40963b=await _0x5e71f8['json']();_0x5baaf1=_0x40963b[_0x33b825(0x215)],_0x478244=_0x40963b['client_secret'],await saveCachedClient(_0x5baaf1,_0x478244),console[_0x33b825(0x1ef)](_0x56b905[_0x33b825(0x278)]);}else throw new Error('Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found');}const _0x5632ea=_0x56b905['DfOuL'](randomBytes,0x20)[_0x33b825(0x266)](_0x56b905['MHPHA']),_0x41e182=_0x56b905['djbIe'](createHash,_0x56b905['hWMJC'])['update'](_0x5632ea)['digest']('base64url'),_0x4bc714=_0x56b905['djbIe'](randomBytes,0x10)[_0x33b825(0x266)](_0x33b825(0x25c)),_0x340861=new URL(_0x9c6ed7['authorization_endpoint']);_0x340861['searchParams'][_0x33b825(0x240)](_0x33b825(0x209),_0x56b905['VIGUZ']),_0x340861[_0x33b825(0x260)]['set'](_0x33b825(0x215),_0x5baaf1),_0x340861['searchParams'][_0x33b825(0x240)](_0x56b905[_0x33b825(0x235)],'http://localhost:'+CALLBACK_PORT+_0x33b825(0x262)),_0x340861['searchParams']['set'](_0x56b905['srEoe'],_0x41e182),_0x340861['searchParams'][_0x33b825(0x240)]('code_challenge_method',_0x56b905['jTLFs']),_0x340861[_0x33b825(0x260)]['set'](_0x56b905[_0x33b825(0x20c)],_0x4bc714);_0x43f1f0['resource']&&_0x340861['searchParams']['set']('resource',_0x43f1f0[_0x33b825(0x27b)]);console[_0x33b825(0x1ef)]('\x0aOpening\x20browser\x20for\x20authentication...'),console[_0x33b825(0x1ef)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x340861[_0x33b825(0x266)]()+'\x0a'),await _0x56b905[_0x33b825(0x274)](openBrowser,_0x340861['toString']());const _0x5fba7d=await _0x56b905[_0x33b825(0x213)](waitForCallback,_0x4bc714);process[_0x33b825(0x239)]['write']('Exchanging\x20authorization\x20code...');const _0x340dd4=new URLSearchParams({'grant_type':_0x56b905['XwXdL'],'code':_0x5fba7d,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0x33b825(0x262),'client_id':_0x5baaf1,'code_verifier':_0x5632ea});_0x478244&&_0x340dd4['set'](_0x33b825(0x273),_0x478244);_0x43f1f0[_0x33b825(0x27b)]&&_0x340dd4[_0x33b825(0x240)](_0x33b825(0x27b),_0x43f1f0['resource']);const _0x31ea4c=await _0x56b905[_0x33b825(0x268)](fetch,_0x9c6ed7['token_endpoint'],{'method':_0x56b905[_0x33b825(0x241)],'headers':{'Content-Type':_0x33b825(0x238)},'body':_0x340dd4});if(!_0x31ea4c['ok']){const _0x3c5971=await _0x31ea4c['text']();throw new Error(_0x33b825(0x210)+_0x3c5971);}const _0xa4c9b=await _0x31ea4c['json']();return console[_0x33b825(0x1ef)](_0x56b905[_0x33b825(0x278)]),await _0x56b905[_0x33b825(0x246)](saveCachedToken,_0xa4c9b['access_token'],_0xa4c9b['refresh_token'],_0xa4c9b[_0x33b825(0x222)]),_0xa4c9b[_0x33b825(0x256)];}async function callGetCliToken(_0x13d5b2,_0x382564){const _0x36a53a=_0x3a9246,_0x178e6a={'FSzpx':function(_0xc08669,_0x258508,_0x53a251){return _0xc08669(_0x258508,_0x53a251);},'jcEyI':'POST','tmUre':function(_0x6526b6,_0x3ca78e){return _0x6526b6(_0x3ca78e);},'IWZol':'application/json','jABYq':_0x36a53a(0x264),'QoxHu':'Initializing\x20MCP\x20session...','ZfQvR':function(_0x1badb6,_0x15082a){return _0x1badb6(_0x15082a);},'Fniqw':'2025-03-26','vKTRM':'Requesting\x20CLI\x20token...','oYAec':function(_0x1ecb99,_0x9233a5){return _0x1ecb99(_0x9233a5);},'MHvyI':'2.0','JAhcK':'tools/call','oLeCn':_0x36a53a(0x237),'RETeb':'\x0aUnexpected\x20response\x20structure:','lGwBM':'.ranger','rdcTS':function(_0x345ce4,_0xd008eb,_0xc1ed6c){return _0x345ce4(_0xd008eb,_0xc1ed6c);},'YRXDI':'refresh.txt','LCZNr':'Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a'},_0x56438a={'Content-Type':_0x178e6a[_0x36a53a(0x1f0)],'Accept':'application/json,\x20text/event-stream'};_0x382564&&(_0x56438a[_0x178e6a['jABYq']]=_0x36a53a(0x257)+_0x382564);const _0x2661f3=async _0x38f65b=>{const _0x2ffbd2=_0x36a53a,_0x4d49be=await _0x178e6a['FSzpx'](fetch,_0x13d5b2,{'method':_0x178e6a[_0x2ffbd2(0x20d)],'headers':_0x56438a,'body':JSON['stringify'](_0x38f65b)});if(!_0x4d49be['ok']){const _0x28c13a=await _0x4d49be[_0x2ffbd2(0x253)]();throw new Error('HTTP\x20'+_0x4d49be[_0x2ffbd2(0x250)]+':\x20'+_0x28c13a);}return _0x178e6a[_0x2ffbd2(0x242)](parseResponse,_0x4d49be);};process[_0x36a53a(0x239)][_0x36a53a(0x206)](_0x178e6a[_0x36a53a(0x23b)]);const _0x4e070c=await _0x178e6a[_0x36a53a(0x258)](_0x2661f3,{'jsonrpc':_0x36a53a(0x276),'id':0x1,'method':_0x36a53a(0x225),'params':{'protocolVersion':_0x178e6a[_0x36a53a(0x27a)],'capabilities':{},'clientInfo':{'name':_0x36a53a(0x23c),'version':'1.0.0'}}});if(_0x4e070c['error'])throw new Error(_0x36a53a(0x201)+(_0x4e070c['error'][_0x36a53a(0x1fd)]??JSON['stringify'](_0x4e070c['error'])));console[_0x36a53a(0x1ef)]('\x20done'),await fetch(_0x13d5b2,{'method':_0x36a53a(0x202),'headers':_0x56438a,'body':JSON['stringify']({'jsonrpc':'2.0','method':_0x36a53a(0x24d)})})['then'](_0x27111a=>_0x27111a[_0x36a53a(0x253)]()),process[_0x36a53a(0x239)][_0x36a53a(0x206)](_0x178e6a['vKTRM']);const _0x3b0dfc=await _0x178e6a['oYAec'](_0x2661f3,{'jsonrpc':_0x178e6a['MHvyI'],'id':0x2,'method':_0x178e6a[_0x36a53a(0x1f3)],'params':{'name':_0x178e6a['oLeCn'],'arguments':{}}});if(_0x3b0dfc['error'])throw new Error(_0x36a53a(0x261)+(_0x3b0dfc[_0x36a53a(0x26c)][_0x36a53a(0x1fd)]??JSON['stringify'](_0x3b0dfc['error'])));console[_0x36a53a(0x1ef)]('\x20done');const _0xea06c2=_0x178e6a['tmUre'](extractToken,_0x3b0dfc[_0x36a53a(0x26b)]);if(!_0xea06c2){console[_0x36a53a(0x26c)](_0x178e6a[_0x36a53a(0x1f9)]),console[_0x36a53a(0x26c)](JSON['stringify'](_0x3b0dfc['result'],null,0x2));throw new Error(_0x36a53a(0x269));}const _0x3b289a=_0x178e6a[_0x36a53a(0x1f5)](join,homedir(),_0x178e6a['lGwBM']),_0xe5a4dd=_0x178e6a['rdcTS'](join,_0x3b289a,_0x178e6a[_0x36a53a(0x1f6)]);await mkdir(_0x3b289a,{'recursive':!![]}),await writeFile(_0xe5a4dd,_0xea06c2,{'mode':0x180}),await writeFile(_0x178e6a[_0x36a53a(0x214)](join,_0x3b289a,'auth-origin.txt'),_0x13d5b2,{'mode':0x180}),console[_0x36a53a(0x1ef)]('\x0aToken\x20written\x20to\x20'+_0xe5a4dd),console['log'](_0x178e6a['LCZNr']);}async function fetchAuthServerMetadata(_0x56a95b){const _0x42d124=_0x3a9246,_0x1a8c2a=_0x56a95b+_0x42d124(0x265),_0xe7ce79=await fetch(_0x1a8c2a);if(!_0xe7ce79['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x1a8c2a+':\x20'+_0xe7ce79[_0x42d124(0x250)]);return _0xe7ce79[_0x42d124(0x277)]();}function waitForCallback(_0x16955a){const _0xcc5381=_0x3a9246,_0x42775b={'KwhvG':function(_0x55a452){return _0x55a452();},'wHanV':function(_0x2ce19f,_0x3f10b6){return _0x2ce19f!==_0x3f10b6;},'mKruE':'/callback','zJKWf':'state','SVcah':'error_description','jCMif':_0xcc5381(0x252),'QoWLe':function(_0x1e6e91,_0x5fd60a){return _0x1e6e91(_0x5fd60a);},'ekiTT':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','kbsJb':_0xcc5381(0x21e),'BjMfL':function(_0x2faa7d){return _0x2faa7d();}};return new Promise((_0x50778a,_0x22ef0b)=>{const _0x1bf248=_0xcc5381,_0x28ecdf=()=>{const _0x1b2c25=_0x2bd8;_0x513979[_0x1b2c25(0x223)](),_0x513979['close']();},_0x324941=setTimeout(()=>{const _0x29d8b4=_0x2bd8;_0x42775b[_0x29d8b4(0x228)](_0x28ecdf),_0x22ef0b(new OAuthTimeoutError(_0x29d8b4(0x233)));},0x1d4c0),_0x513979=_0x42775b['QoWLe'](createServer,(_0x1b8ab1,_0x1d9364)=>{const _0x4ece04=_0x2bd8,_0x4d0d12=new URL(_0x1b8ab1['url']??'/',_0x4ece04(0x23f)+CALLBACK_PORT);if(_0x42775b['wHanV'](_0x4d0d12['pathname'],_0x42775b[_0x4ece04(0x22b)])){_0x1d9364['writeHead'](0x194),_0x1d9364['end']('Not\x20found');return;}const _0x1a5ce3=_0x4d0d12[_0x4ece04(0x260)]['get'](_0x4ece04(0x220)),_0x2c1eb7=_0x4d0d12[_0x4ece04(0x260)][_0x4ece04(0x248)](_0x42775b['zJKWf']),_0x506d7b=_0x4d0d12['searchParams']['get'](_0x4ece04(0x26c));if(_0x506d7b){const _0x1b8555=_0x4d0d12['searchParams']['get'](_0x42775b[_0x4ece04(0x244)])??_0x506d7b;_0x1d9364[_0x4ece04(0x25f)](0xc8,{'Content-Type':_0x42775b[_0x4ece04(0x270)]}),_0x1d9364['end']('<html><body><h2>Authentication\x20failed</h2><p>'+_0x1b8555+_0x4ece04(0x259)),clearTimeout(_0x324941),_0x42775b['KwhvG'](_0x28ecdf),_0x42775b[_0x4ece04(0x272)](_0x22ef0b,new Error(_0x4ece04(0x263)+_0x1b8555));return;}if(!_0x1a5ce3||_0x42775b[_0x4ece04(0x21b)](_0x2c1eb7,_0x16955a)){_0x1d9364['writeHead'](0x190,{'Content-Type':_0x42775b[_0x4ece04(0x270)]}),_0x1d9364['end'](_0x42775b[_0x4ece04(0x22a)]);return;}_0x1d9364['writeHead'](0xc8,{'Content-Type':_0x42775b[_0x4ece04(0x270)]}),_0x1d9364[_0x4ece04(0x1f1)](_0x42775b[_0x4ece04(0x25d)]),_0x42775b['QoWLe'](clearTimeout,_0x324941),_0x42775b['BjMfL'](_0x28ecdf),_0x50778a(_0x1a5ce3);});_0x513979['listen'](CALLBACK_PORT,_0x1bf248(0x26f));});}function _0x2bd8(_0x51a005,_0x53d384){_0x51a005=_0x51a005-0x1ec;const _0x1bf3b0=_0x1bf3();let _0x2bd892=_0x1bf3b0[_0x51a005];return _0x2bd892;}async function openBrowser(_0x1cb3ab){const _0x5a19fd=_0x3a9246,_0x2f29ac={'tTcgO':function(_0x3d59ce,_0x3aea1d){return _0x3d59ce===_0x3aea1d;},'mCpsz':_0x5a19fd(0x22d),'NPanp':_0x5a19fd(0x1f8),'eHYJt':'xdg-open','ynwcT':function(_0x2c32bc,_0x7fc972){return _0x2c32bc(_0x7fc972);}},_0x185a05=_0x2f29ac['tTcgO'](process[_0x5a19fd(0x24c)],_0x2f29ac['mCpsz'])?_0x5a19fd(0x243):_0x2f29ac['tTcgO'](process['platform'],_0x2f29ac[_0x5a19fd(0x271)])?_0x5a19fd(0x211):_0x2f29ac[_0x5a19fd(0x20e)];_0x2f29ac['ynwcT'](exec,_0x185a05+'\x20\x22'+_0x1cb3ab+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x26ed14=_0x3a9246,_0x3b7ca4={'dYJuq':function(_0x199ab7,_0x3a7bef,_0x28be53){return _0x199ab7(_0x3a7bef,_0x28be53);},'nDCyc':function(_0x5ee7fa,_0x18f1a8){return _0x5ee7fa!==_0x18f1a8;}};try{const _0x483b59=JSON['parse'](await _0x3b7ca4['dYJuq'](readFile,TOKEN_CACHE_PATH,_0x26ed14(0x227)));if(_0x483b59['origin']&&_0x3b7ca4[_0x26ed14(0x23d)](_0x483b59[_0x26ed14(0x231)],currentOrigin))return null;if(_0x483b59[_0x26ed14(0x203)]&&Date['now']()>_0x483b59[_0x26ed14(0x203)])return null;return _0x483b59['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x572320,_0x39e673,_0x1395f4){const _0x513626=_0x3a9246,_0xd63b4f={'bnvHg':function(_0xf15557,_0x32a43b){return _0xf15557*_0x32a43b;},'nVcMc':function(_0x4311af,_0x574d48,_0x41eac7){return _0x4311af(_0x574d48,_0x41eac7);},'GnPJr':function(_0x494428){return _0x494428();},'BDlto':_0x513626(0x22c),'PdKIj':function(_0x15ba8e,_0x42c866,_0x402a6c,_0x1b6721){return _0x15ba8e(_0x42c866,_0x402a6c,_0x1b6721);}},_0x3a093b=await loadCachedData(),_0x3a4f8f={..._0x3a093b,'origin':currentOrigin,'accessToken':_0x572320,'refreshToken':_0x39e673??_0x3a093b?.['refreshToken'],'expiresAt':_0x1395f4?Date[_0x513626(0x1fa)]()+_0xd63b4f[_0x513626(0x23a)](_0x1395f4,0x3e8):undefined};await _0xd63b4f[_0x513626(0x230)](mkdir,join(_0xd63b4f[_0x513626(0x249)](homedir),_0xd63b4f[_0x513626(0x1fe)]),{'recursive':!![]}),await _0xd63b4f['PdKIj'](writeFile,TOKEN_CACHE_PATH,JSON[_0x513626(0x20f)](_0x3a4f8f),{'mode':0x180});}async function loadCachedClient(){const _0x8b0ff0=_0x3a9246,_0x31aca8={'IOAln':function(_0x10ce74){return _0x10ce74();}},_0x54e06b=await _0x31aca8[_0x8b0ff0(0x26a)](loadCachedData);if(_0x54e06b?.[_0x8b0ff0(0x231)]&&_0x54e06b['origin']!==currentOrigin)return null;return _0x54e06b?.[_0x8b0ff0(0x234)]?{'clientId':_0x54e06b[_0x8b0ff0(0x234)],'clientSecret':_0x54e06b[_0x8b0ff0(0x25a)]}:null;}async function clearCachedClient(){const _0x5eda65=_0x3a9246,_0x2fe3f5={'hfyuK':function(_0x4c5427){return _0x4c5427();},'ZVfES':function(_0x53c972,_0x34ab07,_0x498855,_0x458bf7){return _0x53c972(_0x34ab07,_0x498855,_0x458bf7);}},_0x209e07=await _0x2fe3f5['hfyuK'](loadCachedData);if(!_0x209e07)return;const {clientId:_0x582b20,clientSecret:_0x52b803,..._0x1e1320}=_0x209e07;await _0x2fe3f5[_0x5eda65(0x1ff)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x1e1320),{'mode':0x180});}function _0x1bf3(){const _0x29a407=['RETeb','now','WOBRg','bNdyR','message','BDlto','ZVfES','Registering\x20OAuth\x20client...','MCP\x20initialize\x20failed:\x20','POST','expiresAt','CwVAg','112917BbPfIV','write','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','EwFjV','response_type','2178504OAEaNj','mcp-oauth-tokens.json','cALSY','jcEyI','eHYJt','stringify','Token\x20exchange\x20failed:\x20','start','LXzTM','byaZu','rdcTS','client_id','10vMCcjj','redirect_uri','bJXoZ','replace','gDIOP','wHanV','length','trim','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','parse','code','Ranger\x20CLI','expires_in','closeAllConnections','content','initialize','EzeQU','utf-8','KwhvG','Unknown\x20error','ekiTT','mKruE','.ranger','darwin','data:','3020684WRyBKU','nVcMc','origin','includes','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','clientId','RNUbG','mYXfQ','get_cli_token','application/x-www-form-urlencoded','stdout','bnvHg','QoxHu','ranger-cli','nDCyc','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','http://localhost:','set','neNAt','tmUre','open','SVcah','/.well-known/oauth-protected-resource','bTNsz','eKeQh','get','GnPJr','refresh_token','registration_endpoint','platform','notifications/initialized','base64url','7850817RZKaoG','status','token','text/html','text','authorization_code','startsWith','access_token','Bearer\x20','ZfQvR','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','clientSecret','string','hex','kbsJb','auth-origin.txt','writeHead','searchParams','get_cli_token\x20failed:\x20','/callback','OAuth\x20error:\x20','Authorization','/.well-known/oauth-authorization-server','toString','869180bKUnBd','avMmG','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','IOAln','result','error','2StUmgN','needs-oauth','127.0.0.1','jCMif','NPanp','QoWLe','client_secret','DfOuL','3327863HaBTzP','2.0','json','kbsAK','MnNZs','Fniqw','resource','KcPIq','rvFCY','tmyen','781044AhNmId','log','IWZol','end','MCP\x20server\x20returned\x20HTTP\x20','JAhcK','type','FSzpx','YRXDI','12inPHWa','win32'];_0x1bf3=function(){return _0x29a407;};return _0x1bf3();}async function saveCachedClient(_0xe4e2ae,_0x55bc61){const _0x5b50a6=_0x3a9246,_0x1ce7b3={'KvtJz':function(_0xedf5f,_0xa16b23,_0x40c04c){return _0xedf5f(_0xa16b23,_0x40c04c);}},_0xecd286=await loadCachedData(),_0x188308={..._0xecd286,'origin':currentOrigin,'accessToken':_0xecd286?.['accessToken']??'','clientId':_0xe4e2ae,'clientSecret':_0x55bc61};await _0x1ce7b3['KvtJz'](mkdir,join(homedir(),_0x5b50a6(0x22c)),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x188308),{'mode':0x180});}async function loadCachedData(){const _0x3eb18e=_0x3a9246;try{return JSON[_0x3eb18e(0x21f)](await readFile(TOKEN_CACHE_PATH,_0x3eb18e(0x227)));}catch{return null;}}async function parseResponse(_0x474e6b){const _0x40de05=_0x3a9246,_0x16ef9f={'qmkyg':'content-type','eKeQh':'text/event-stream','tmyen':_0x40de05(0x22e),'WOBRg':_0x40de05(0x207)},_0x2cfeb6=_0x474e6b['headers'][_0x40de05(0x248)](_0x16ef9f['qmkyg'])??'';if(_0x2cfeb6[_0x40de05(0x232)](_0x16ef9f[_0x40de05(0x247)])){const _0x2d5e31=await _0x474e6b[_0x40de05(0x253)]();for(const _0x1cb2d1 of _0x2d5e31['split']('\x0a')){const _0x4e4b6e=_0x1cb2d1[_0x40de05(0x21d)]();if(_0x4e4b6e[_0x40de05(0x255)](_0x16ef9f[_0x40de05(0x1ed)])){const _0x2a512c=_0x4e4b6e['slice'](_0x40de05(0x22e)[_0x40de05(0x21c)])[_0x40de05(0x21d)]();if(!_0x2a512c)continue;try{const _0x105cef=JSON[_0x40de05(0x21f)](_0x2a512c);if(_0x105cef['id']!==undefined||_0x105cef[_0x40de05(0x26c)])return _0x105cef;}catch{}}}throw new Error(_0x16ef9f[_0x40de05(0x1fb)]);}return _0x474e6b[_0x40de05(0x277)]();}function extractToken(_0x342408){const _0x4597fe=_0x3a9246,_0x323a70={'ZIRln':function(_0x401eab,_0x39c618){return _0x401eab===_0x39c618;},'lFqAS':_0x4597fe(0x25b),'yXKVG':_0x4597fe(0x229),'gDIOP':function(_0x446cd8,_0x4f1204){return _0x446cd8===_0x4f1204;}};if(!_0x342408)return null;const _0x48e355=_0x342408['structuredContent'];if(_0x48e355?.['token']&&_0x323a70['ZIRln'](typeof _0x48e355['token'],_0x323a70['lFqAS']))return _0x48e355['token'];if(_0x342408['isError']){const _0x2f389d=_0x342408[_0x4597fe(0x224)];throw new Error('Server\x20returned\x20error:\x20'+(_0x2f389d?.[0x0]?.['text']??_0x323a70['yXKVG']));}const _0x49bdd2=_0x342408['content'];if(_0x49bdd2)for(const _0x24c084 of _0x49bdd2){if(_0x323a70['ZIRln'](_0x24c084[_0x4597fe(0x1f4)],_0x4597fe(0x253))&&_0x24c084[_0x4597fe(0x253)]){try{const _0x39f483=JSON[_0x4597fe(0x21f)](_0x24c084['text']);if(_0x323a70[_0x4597fe(0x21a)](typeof _0x39f483?.[_0x4597fe(0x251)],'string'))return _0x39f483['token'];}catch{}const _0x3b7ab7=_0x24c084['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x3b7ab7)return _0x3b7ab7[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x592f(_0x5a293b,_0x3c8e67){_0x5a293b=_0x5a293b-0x137;var _0x505228=_0x5052();var _0x592f5a=_0x505228[_0x5a293b];return _0x592f5a;}(function(_0x2401c1,_0x22254a){var _0x6091b0=_0x592f,_0x586a80=_0x2401c1();while(!![]){try{var _0x2bce83=parseInt(_0x6091b0(0x13f))/0x1+parseInt(_0x6091b0(0x137))/0x2+-parseInt(_0x6091b0(0x140))/0x3*(parseInt(_0x6091b0(0x142))/0x4)+parseInt(_0x6091b0(0x143))/0x5+parseInt(_0x6091b0(0x145))/0x6*(-parseInt(_0x6091b0(0x146))/0x7)+-parseInt(_0x6091b0(0x138))/0x8*(parseInt(_0x6091b0(0x13d))/0x9)+parseInt(_0x6091b0(0x13c))/0xa;if(_0x2bce83===_0x22254a)break;else _0x586a80['push'](_0x586a80['shift']());}catch(_0x1fce98){_0x586a80['push'](_0x586a80['shift']());}}}(_0x5052,0x216d8));export async function migrateProfile(_0x575ac6,_0x354c1f){var _0x157eb8=_0x592f,_0x5a46fa={'oygYg':function(_0x31c5d3,_0x2720b8){return _0x31c5d3+_0x2720b8;},'IIpZn':function(_0x59f3b1,_0x581293){return _0x59f3b1+_0x581293;},'qftZf':_0x157eb8(0x144),'nKzww':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','enBKO':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','EBqdW':'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'};console['error'](_0x5a46fa[_0x157eb8(0x13b)](_0x5a46fa[_0x157eb8(0x139)](_0x5a46fa['IIpZn'](_0x5a46fa['IIpZn']('ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','\x0a'),_0x5a46fa['qftZf'])+_0x5a46fa[_0x157eb8(0x13a)],'\x0a')+'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a')+'\x0a'+_0x5a46fa['enBKO']+_0x5a46fa[_0x157eb8(0x141)]),process[_0x157eb8(0x13e)](0x1);}function _0x5052(){var _0x269526=['847TqaHwt','283660MsWZQj','232XQwGGE','IIpZn','nKzww','oygYg','822660DmknwZ','76851tlzwpx','exit','259717lLsUoj','9qrKlgU','EBqdW','62164FEtaFk','778010UVtjyR','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','10326qFQcCE'];_0x5052=function(){return _0x269526;};return _0x5052();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x12302f,_0x33d0d2){const _0x167796=_0x2208,_0x3df60b=_0x12302f();while(!![]){try{const _0x2dfd4f=-parseInt(_0x167796(0x151))/0x1*(parseInt(_0x167796(0x15a))/0x2)+-parseInt(_0x167796(0x14a))/0x3+parseInt(_0x167796(0x12f))/0x4*(-parseInt(_0x167796(0x152))/0x5)+parseInt(_0x167796(0x154))/0x6+-parseInt(_0x167796(0x143))/0x7+parseInt(_0x167796(0x133))/0x8+parseInt(_0x167796(0x15d))/0x9;if(_0x2dfd4f===_0x33d0d2)break;else _0x3df60b['push'](_0x3df60b['shift']());}catch(_0x31385c){_0x3df60b['push'](_0x3df60b['shift']());}}}(_0x32b3,0xa4fbb));import{join}from'path';import{existsSync}from'fs';import _0xa97010 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';function _0x2208(_0x3c3060,_0x36177e){_0x3c3060=_0x3c3060-0x12a;const _0x32b3e9=_0x32b3();let _0x220874=_0x32b3e9[_0x3c3060];return _0x220874;}export async function ensureClaudePlugin(_0x2b3d66){const _0x473845=_0x2208,_0xd16d95={'mOrns':function(_0xb7debb,_0x3bfaba){return _0xb7debb(_0x3bfaba);},'MQaYn':_0x473845(0x13d),'YhtSJ':'✓\x20Claude\x20Code\x20plugin\x20already\x20installed','kGLSS':function(_0x1a9d07){return _0x1a9d07();},'rWzvm':_0x473845(0x153),'TiGli':'\x0a📦\x20Claude\x20Code\x20Plugin\x0a','EKLIh':_0x473845(0x15b),'jXTTg':_0x473845(0x158),'cAZBw':'Project\x20(shared\x20with\x20team\x20via\x20git)','oRois':function(_0x17ddb6,_0x54d5bf){return _0x17ddb6(_0x54d5bf);},'gFBDn':_0x473845(0x159),'cBwdr':_0x473845(0x15e),'NxtuI':_0x473845(0x134),'EPSKQ':_0x473845(0x13a),'UNhBa':_0x473845(0x142),'yrUGY':function(_0x9b4735,_0x184617,_0x366565){return _0x9b4735(_0x184617,_0x366565);},'xlSSU':'plugin','tqmRJ':function(_0x568eff){return _0x568eff();},'gyzVE':_0x473845(0x12d),'ZmPLS':_0x473845(0x15c),'qwoop':function(_0x3eb59b,_0x351690){return _0x3eb59b===_0x351690;},'txWtq':'--scope','yxjos':function(_0x53a064){return _0x53a064();},'fxndH':'already\x20enabled','fqRUa':'⚠\x20Failed\x20to\x20enable\x20plugin:','ZrQww':'✓\x20Claude\x20Code\x20plugin\x20enabled'},_0x1abd04=await _0xd16d95[_0x473845(0x14e)](isPluginInstalled,_0xd16d95['MQaYn']);if(_0x1abd04)return console['log'](_0xd16d95[_0x473845(0x14c)]),![];const _0x3e143e=_0xd16d95['mOrns'](existsSync,join(_0xd16d95[_0x473845(0x12e)](getProjectRoot),'.claude'));let _0x2f954c;if(_0x2b3d66)_0x2f954c=_0x2b3d66;else{if(_0x3e143e)_0x2f954c=_0xd16d95['rWzvm'];else{console['log'](_0xd16d95[_0x473845(0x163)]);const _0x3a235b=await _0xa97010['prompt']([{'type':'list','name':_0xd16d95['EKLIh'],'message':_0x473845(0x14d),'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0xd16d95[_0x473845(0x14b)]},{'name':_0xd16d95[_0x473845(0x137)],'value':'project'}],'default':_0x473845(0x158)}]);_0x2f954c=_0x3a235b[_0x473845(0x15b)];}}console['log'](_0x473845(0x15f)+_0x2f954c+_0x473845(0x138));const _0x282334=await _0xd16d95[_0x473845(0x162)](isMarketplaceAdded,'trailhead');let _0x2a2c06=_0x282334;if(_0x282334)console[_0x473845(0x14f)](_0xd16d95[_0x473845(0x156)]);else{const _0x4ae76d=await runClaudeCommand(['plugin',_0xd16d95['cBwdr'],_0xd16d95['NxtuI'],_0xd16d95['EPSKQ']]);!_0x4ae76d[_0x473845(0x12a)]?(console[_0x473845(0x160)](_0x473845(0x155),_0x4ae76d['error']),console[_0x473845(0x14f)]('\x0aYou\x20can\x20install\x20manually\x20with:'),console['log'](_0xd16d95[_0x473845(0x149)]),console[_0x473845(0x14f)](_0x473845(0x13f)+_0x2f954c)):_0x2a2c06=!![];}if(_0x2a2c06){const _0x25f92e=await _0xd16d95[_0x473845(0x12c)](runClaudeCommand,[_0xd16d95['xlSSU'],'install',_0x473845(0x13d),_0x473845(0x136),_0x2f954c],{'cwd':_0x2f954c===_0x473845(0x153)?_0xd16d95[_0x473845(0x13c)](getProjectRoot):undefined});if(!_0x25f92e[_0x473845(0x12a)])console[_0x473845(0x160)](_0xd16d95[_0x473845(0x146)],_0x25f92e[_0x473845(0x160)]),console[_0x473845(0x14f)](_0x473845(0x135)),console['log'](_0x473845(0x13f)+_0x2f954c);else{console[_0x473845(0x14f)]('✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully');const _0x402cd3=['plugin',_0xd16d95[_0x473845(0x130)],_0xd16d95['MQaYn']];_0xd16d95[_0x473845(0x144)](_0x2f954c,_0x473845(0x153))&&_0x402cd3['push'](_0xd16d95[_0x473845(0x145)],'project');const _0x40c236=await runClaudeCommand(_0x402cd3,{'captureOutput':!![],'cwd':_0xd16d95[_0x473845(0x144)](_0x2f954c,_0xd16d95[_0x473845(0x147)])?_0xd16d95['yxjos'](getProjectRoot):undefined}),_0x5cae83=_0x40c236[_0x473845(0x12b)]?.['includes'](_0xd16d95[_0x473845(0x139)]);!_0x40c236['success']&&!_0x5cae83?console['error'](_0xd16d95['fqRUa'],_0x40c236['error']):console[_0x473845(0x14f)](_0xd16d95['ZrQww']);}}return!![];}export async function ensureClaudeSkills(_0x36f164){const _0x38697b=_0x2208,_0x5577d8={'iWgJO':function(_0x464227,_0x2858e0){return _0x464227(_0x2858e0);},'bwiva':function(_0x227445,_0x338aa2){return _0x227445(_0x338aa2);},'tSHlZ':'SKILL.md','JksgX':_0x38697b(0x140),'gPnTV':function(_0x5adb13,_0x10dae2){return _0x5adb13(_0x10dae2);},'WnTCJ':_0x38697b(0x153),'rAjLC':_0x38697b(0x141)},_0x3864d4=_0x5577d8[_0x38697b(0x150)](existsSync,join(getSkillsDir('user'),'ranger',_0x38697b(0x13b))),_0x1069ce=_0x5577d8[_0x38697b(0x131)](existsSync,join(getSkillsDir('project'),'ranger',_0x5577d8[_0x38697b(0x157)]));if(_0x3864d4||_0x1069ce)return console[_0x38697b(0x14f)](_0x5577d8[_0x38697b(0x161)]),![];const _0x2f721a=_0x5577d8['gPnTV'](existsSync,join(getProjectRoot(),_0x38697b(0x132)));let _0xeda2b0=!![];if(_0x36f164)await skillup({'autoInstall':_0x36f164,'suppressUsage':!![]});else{if(_0x2f721a)await _0x5577d8[_0x38697b(0x150)](skillup,{'autoInstall':_0x5577d8['WnTCJ'],'suppressUsage':!![]});else{const _0x4af997=await _0xa97010['prompt']([{'type':'confirm','name':_0x38697b(0x148),'message':_0x5577d8[_0x38697b(0x13e)],'default':!![]}]);_0xeda2b0=_0x4af997[_0x38697b(0x148)],_0xeda2b0&&await skillup({'suppressUsage':!![]});}}return _0xeda2b0;}function _0x32b3(){const _0xb0e38e=['project','2786532qmYsFC','❌\x20Failed\x20to\x20add\x20marketplace:','gFBDn','tSHlZ','user','✓\x20Marketplace\x20already\x20added','2QDqBJm','pluginScope','enable','32194746wakDiJ','marketplace','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','error','JksgX','oRois','TiGli','success','output','yrUGY','❌\x20Failed\x20to\x20install\x20plugin:','kGLSS','3375628RcSOxv','ZmPLS','bwiva','.claude','1348424isqUHt','add','\x0aYou\x20can\x20install\x20manually\x20with:','--scope','cAZBw','\x20level)...\x0a','fxndH','ranger-testing/trailhead','SKILL.md','tqmRJ','ranger@trailhead','rAjLC','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','✓\x20Ranger\x20skills\x20already\x20installed','Would\x20you\x20like\x20to\x20install\x20skills?','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','4369134puQXZW','qwoop','txWtq','gyzVE','rWzvm','wantsSkillup','UNhBa','2161968mDcoEK','jXTTg','YhtSJ','Where\x20should\x20the\x20plugin\x20be\x20installed?','mOrns','log','iWgJO','1345673qghIXG','5gOIHSP'];_0x32b3=function(){return _0xb0e38e;};return _0x32b3();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3bd01b,_0x37f001){const _0x3482f1=_0x3f2f,_0x48f1a8=_0x3bd01b();while(!![]){try{const _0x35409e=-parseInt(_0x3482f1(0x86))/0x1*(-parseInt(_0x3482f1(0x8e))/0x2)+-parseInt(_0x3482f1(0x87))/0x3*(-parseInt(_0x3482f1(0x94))/0x4)+-parseInt(_0x3482f1(0x85))/0x5*(parseInt(_0x3482f1(0x8c))/0x6)+parseInt(_0x3482f1(0x9b))/0x7*(-parseInt(_0x3482f1(0x90))/0x8)+-parseInt(_0x3482f1(0x7f))/0x9+parseInt(_0x3482f1(0x98))/0xa*(-parseInt(_0x3482f1(0x83))/0xb)+-parseInt(_0x3482f1(0x96))/0xc*(-parseInt(_0x3482f1(0x99))/0xd);if(_0x35409e===_0x37f001)break;else _0x48f1a8['push'](_0x48f1a8['shift']());}catch(_0x5841b4){_0x48f1a8['push'](_0x48f1a8['shift']());}}}(_0x5c4f,0xe2bb9));import{join}from'path';import{existsSync}from'fs';function _0x5c4f(){const _0x12c72e=['stringify','537688FmJJUa','parse','project','GUqtd','332ngIVOx','✓\x20OpenCode\x20plugin\x20configured','30062580hYpIAU','User\x20(available\x20in\x20all\x20your\x20projects)','2246810UERcHr','13FIISaW','log','49gXFJEV','cxgSp','YOIzG','JUGRV','isArray','vYIzy','$schema','opencode.json','14392260aanTPh','@ranger-testing/opencode-plugin','RbbwY','\x0a📦\x20OpenCode\x20Plugin\x0a','22WgCAvt','user','14345spaBYh','825808falXLF','53577asZupM','vgxIh','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','list','pluginScope','2856BXjAgr','plugin','2SVbhqQ'];_0x5c4f=function(){return _0x12c72e;};return _0x5c4f();}import{mkdir,readFile,writeFile}from'fs/promises';function _0x3f2f(_0x1d894d,_0x4fba25){_0x1d894d=_0x1d894d-0x7e;const _0x5c4fa6=_0x5c4f();let _0x3f2f7b=_0x5c4fa6[_0x1d894d];return _0x3f2f7b;}import _0x2c7531 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0xce8afc){const _0x1f73f9=_0x3f2f,_0x4de47f={'tUrDa':function(_0x2171a0,_0x3913c2,_0x1e1060){return _0x2171a0(_0x3913c2,_0x1e1060);},'RbbwY':function(_0x39a828,_0x27615a){return _0x39a828(_0x27615a);},'GUqtd':'project','eSKhv':'Where\x20should\x20the\x20plugin\x20be\x20installed?','YOIzG':_0x1f73f9(0x97),'TmdRZ':_0x1f73f9(0x84),'vYIzy':function(_0x4e2b2c,_0xedac4,_0x35a520){return _0x4e2b2c(_0xedac4,_0x35a520);},'JUGRV':function(_0x3cfb9b,_0x36f9f2){return _0x3cfb9b(_0x36f9f2);},'vgxIh':function(_0x56c0e1,_0x59d9c3){return _0x56c0e1+_0x59d9c3;},'cxgSp':_0x1f73f9(0x95)},_0x179628=existsSync(_0x4de47f['tUrDa'](join,_0x4de47f[_0x1f73f9(0x81)](getOpencodeConfigDir,_0x1f73f9(0x92)),'opencode.json'));let _0x55036c;if(_0xce8afc)_0x55036c=_0xce8afc;else{if(_0x179628)_0x55036c=_0x4de47f[_0x1f73f9(0x93)];else{console[_0x1f73f9(0x9a)](_0x1f73f9(0x82));const _0x82c6bc=await _0x2c7531['prompt']([{'type':_0x1f73f9(0x8a),'name':_0x1f73f9(0x8b),'message':_0x4de47f['eSKhv'],'choices':[{'name':_0x4de47f[_0x1f73f9(0x9d)],'value':_0x1f73f9(0x84)},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x4de47f['GUqtd']}],'default':_0x4de47f['TmdRZ']}]);_0x55036c=_0x82c6bc[_0x1f73f9(0x8b)];}}const _0x5b389b=_0x4de47f[_0x1f73f9(0xa0)](join,getOpencodeConfigDir(_0x55036c),_0x1f73f9(0x7e)),_0x1e14ec=_0x1f73f9(0x80),_0x23fb9a='https://opencode.ai/config.json';let _0x11c432={};if(_0x4de47f[_0x1f73f9(0x9e)](existsSync,_0x5b389b))try{const _0x18d820=await readFile(_0x5b389b,'utf-8');_0x11c432=JSON[_0x1f73f9(0x91)](_0x18d820);}catch(_0x462b06){return console['error'](_0x1f73f9(0x89)),{'configured':![],'scope':_0x55036c,'error':'Failed\x20to\x20read\x20opencode.json','details':_0x462b06};}const _0x1f27af=Array[_0x1f73f9(0x9f)](_0x11c432['plugin'])?_0x11c432['plugin']:[];if(_0x1f27af['includes'](_0x1e14ec))return console[_0x1f73f9(0x9a)]('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x55036c};return _0x11c432[_0x1f73f9(0xa1)]=_0x11c432[_0x1f73f9(0xa1)]||_0x23fb9a,_0x11c432[_0x1f73f9(0x8d)]=[..._0x1f27af,_0x1e14ec],await mkdir(getOpencodeConfigDir(_0x55036c),{'recursive':!![]}),await writeFile(_0x5b389b,_0x4de47f[_0x1f73f9(0x88)](JSON[_0x1f73f9(0x8f)](_0x11c432,null,0x2),'\x0a')),console[_0x1f73f9(0x9a)](_0x4de47f[_0x1f73f9(0x9c)]),{'configured':!![],'scope':_0x55036c};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x569e(){var _0x5259fe=['976338imtzmp','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','error','33720wkHkKc','1313753FjGTeT','mNqAI','zrVzX','14968BOhdMs','\x20\x20https://docs.ranger.net/main/concepts/profiles','3650OFacag','5860cmkbut','1890720VdApLI','26ahCTym','972lpXvFe','5ZLMqOp'];_0x569e=function(){return _0x5259fe;};return _0x569e();}(function(_0x356c9a,_0x28ffda){var _0x14f22e=_0x560f,_0x323dea=_0x356c9a();while(!![]){try{var _0xf10409=parseInt(_0x14f22e(0xa4))/0x1*(-parseInt(_0x14f22e(0xa7))/0x2)+-parseInt(_0x14f22e(0x9b))/0x3+-parseInt(_0x14f22e(0xa5))/0x4*(-parseInt(_0x14f22e(0x9a))/0x5)+parseInt(_0x14f22e(0x9e))/0x6+parseInt(_0x14f22e(0x9f))/0x7+-parseInt(_0x14f22e(0xa2))/0x8*(-parseInt(_0x14f22e(0x99))/0x9)+parseInt(_0x14f22e(0xa6))/0xa;if(_0xf10409===_0x28ffda)break;else _0x323dea['push'](_0x323dea['shift']());}catch(_0x41092e){_0x323dea['push'](_0x323dea['shift']());}}}(_0x569e,0x34010));function _0x560f(_0x3127e8,_0x301ee7){_0x3127e8=_0x3127e8-0x99;var _0x569e1e=_0x569e();var _0x560f83=_0x569e1e[_0x3127e8];return _0x560f83;}export async function setupCi(_0x562e7b,_0x820950,_0x4c9385){var _0x2617ea=_0x560f,_0x480368={'mNqAI':function(_0x30c004,_0xdbd6ea){return _0x30c004+_0xdbd6ea;},'SUdpX':function(_0x1890d4,_0x2bafbe){return _0x1890d4+_0x2bafbe;},'afJvL':function(_0xa07296,_0x4e699a){return _0xa07296+_0x4e699a;},'qKXji':_0x2617ea(0x9c),'IInEk':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','zrVzX':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','ysxbg':_0x2617ea(0xa3)};console[_0x2617ea(0x9d)](_0x480368['mNqAI'](_0x480368[_0x2617ea(0xa0)](_0x480368['SUdpX'](_0x480368['afJvL']('ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','\x0a')+_0x480368['qKXji']+_0x480368['IInEk'],'\x0a'),_0x480368[_0x2617ea(0xa1)]),_0x480368['ysxbg'])),process['exit'](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x305669,_0x38c48f){const _0x485c4d=_0xacde,_0x478e85=_0x305669();while(!![]){try{const _0x441b58=parseInt(_0x485c4d(0xa3))/0x1*(parseInt(_0x485c4d(0x8b))/0x2)+-parseInt(_0x485c4d(0x8f))/0x3*(-parseInt(_0x485c4d(0x92))/0x4)+-parseInt(_0x485c4d(0xa0))/0x5+parseInt(_0x485c4d(0xab))/0x6*(parseInt(_0x485c4d(0xad))/0x7)+parseInt(_0x485c4d(0x9e))/0x8*(-parseInt(_0x485c4d(0xa7))/0x9)+parseInt(_0x485c4d(0x94))/0xa+-parseInt(_0x485c4d(0xa6))/0xb;if(_0x441b58===_0x38c48f)break;else _0x478e85['push'](_0x478e85['shift']());}catch(_0x25a3a5){_0x478e85['push'](_0x478e85['shift']());}}}(_0x5343,0xd730d));import{basename}from'path';import _0x2f1636 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 _0xacde(_0x85eecd,_0x1eee4f){_0x85eecd=_0x85eecd-0x8b;const _0x53430c=_0x5343();let _0xacdebf=_0x53430c[_0x85eecd];return _0xacdebf;}import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x24e044={}){const _0x1051d8=_0xacde,_0x2fea58={'PhePW':function(_0x10b482){return _0x10b482();},'sqgjz':'4|2|0|1|5|3','RYTpJ':_0x1051d8(0xb1),'Enece':function(_0x4ae3c3,_0x405fc6){return _0x4ae3c3===_0x405fc6;},'EFWXU':'opencode','WSNbV':'To\x20get\x20started:','aluam':function(_0x30a0cd,_0x37dbc3){return _0x30a0cd===_0x37dbc3;},'dMjrf':function(_0xcba51b,_0x44141f){return _0xcba51b(_0x44141f);},'ejPVF':function(_0x3d5173,_0x2386ab){return _0x3d5173(_0x2386ab);},'tVCyi':'installLevel','QAfhd':'user','WuVRH':function(_0x101d32){return _0x101d32();},'HopKd':_0x1051d8(0x8c),'ihqHF':'ranger','HVxXS':'\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','HlXzc':'project-level','zisTA':_0x1051d8(0xae),'UppEr':'\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a'};console[_0x1051d8(0x95)]('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x14af4f=_0x24e044['platform']??'claude',_0x4a876b=await _0x2fea58[_0x1051d8(0x97)](getToken);if(!_0x4a876b){const _0x322cc7=_0x2fea58['sqgjz']['split']('|');let _0x3e2f3c=0x0;while(!![]){switch(_0x322cc7[_0x3e2f3c++]){case'0':console[_0x1051d8(0x95)](_0x2fea58['RYTpJ']);continue;case'1':console[_0x1051d8(0x95)](_0x1051d8(0x90)+(_0x2fea58['Enece'](_0x14af4f,_0x2fea58['EFWXU'])?'\x20--opencode':'')+'\x20<your-api-token>');continue;case'2':console['log'](_0x2fea58[_0x1051d8(0x9d)]);continue;case'3':return;case'4':console['log']('❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a');continue;case'5':console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x2fea58['aluam'](_0x14af4f,_0x2fea58[_0x1051d8(0xa4)])?'\x20--opencode':'')+'\x0a');continue;}break;}}console['log']('✓\x20Found\x20API\x20token');const _0x5cefc4=getProjectRoot(),_0x6f09e8=_0x2fea58[_0x1051d8(0xb0)](basename,_0x5cefc4),_0x1ab681=_0x14af4f==='opencode'?_0x2fea58[_0x1051d8(0x99)](getOpencodeConfigDir,_0x1051d8(0xaa))+'/skills/':getClaudeConfigDir()+_0x1051d8(0x9a),_0x45a42e=_0x14af4f===_0x2fea58[_0x1051d8(0xa4)]?_0x5cefc4+'/.opencode/skills/':_0x5cefc4+_0x1051d8(0xa2),_0x2ce9e1=process[_0x1051d8(0xb2)][_0x1051d8(0xa5)]&&process['stdout'][_0x1051d8(0xa5)];let _0x1f7945;if(_0x24e044['autoInstall'])_0x1f7945=_0x24e044[_0x1051d8(0xa1)];else{if(_0x2ce9e1){const _0x2f223c=await _0x2f1636['prompt']([{'type':'list','name':_0x2fea58[_0x1051d8(0xac)],'message':_0x1051d8(0x9b),'choices':[{'name':_0x1051d8(0xaf)+_0x1ab681+')','value':_0x2fea58['QAfhd']},{'name':_0x1051d8(0x98)+_0x45a42e+')','value':_0x1051d8(0x91)}]}]);_0x1f7945=_0x2f223c['installLevel'];}else _0x1f7945=_0x1051d8(0x91),console['log'](_0x1051d8(0x8e)+_0x45a42e+')');}let _0xffe75c=0x0;const _0x527815=_0x2fea58['WuVRH'](getCurrentVersion);console[_0x1051d8(0x95)](_0x2fea58[_0x1051d8(0xb4)]);try{const _0x718b30=await installSkill(_0x2fea58['ihqHF'],{'cliVersion':_0x527815,'level':_0x1f7945,'platform':_0x14af4f});_0x718b30&&_0xffe75c++;}catch(_0xb809d2){console['warn'](_0x2fea58[_0x1051d8(0x9c)],_0xb809d2 instanceof Error?_0xb809d2['message']:_0xb809d2);}if(_0xffe75c>0x0){const _0x3b6af8=_0x2fea58['aluam'](_0x1f7945,_0x2fea58['QAfhd'])?_0x1051d8(0x9f):_0x2fea58[_0x1051d8(0x96)];console['log'](_0x1051d8(0x93)+_0xffe75c+'\x20'+_0x3b6af8+'\x20skill'+(_0xffe75c>0x1?'s':'')+_0x1051d8(0xa9)),!_0x24e044['suppressUsage']&&(console['log'](_0x2fea58['zisTA']),_0x14af4f===_0x2fea58[_0x1051d8(0xa4)]?console[_0x1051d8(0x95)](_0x1051d8(0xa8)):console[_0x1051d8(0x95)](_0x1051d8(0xb3)));}else console[_0x1051d8(0x95)](_0x2fea58[_0x1051d8(0x8d)]);}function _0x5343(){const _0x315234=['768926sghshl','EFWXU','isTTY','31770486UvrUPp','637803GGDHRH','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','\x20successfully!\x0a','user','1156542uBmEXM','tVCyi','21mwuRtB','To\x20use:','All\x20projects\x20(','dMjrf','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','stdin','\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!','HopKd','2TXdlHw','\x0a📦\x20Installing\x20skills...\x0a','UppEr','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','52077uUSBum','\x20\x202.\x20Run:\x20ranger\x20setup','project','376KqvUNF','\x0a✅\x20Installed\x20','9344090zPbqBT','log','HlXzc','PhePW','This\x20project\x20only\x20(','ejPVF','/skills/','Where\x20should\x20skills\x20be\x20installed?','HVxXS','WSNbV','8dJDEAc','user-level','364190Qhywld','autoInstall','/.claude/skills/'];_0x5343=function(){return _0x315234;};return _0x5343();}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1dbe0e,_0x195d6c){const _0x402f6b=_0x3fa4,_0x304a15=_0x1dbe0e();while(!![]){try{const _0x564edb=-parseInt(_0x402f6b(0x1d8))/0x1*(parseInt(_0x402f6b(0x1ff))/0x2)+parseInt(_0x402f6b(0x1e3))/0x3*(-parseInt(_0x402f6b(0x1aa))/0x4)+-parseInt(_0x402f6b(0x1ad))/0x5*(parseInt(_0x402f6b(0x1db))/0x6)+parseInt(_0x402f6b(0x1ba))/0x7*(-parseInt(_0x402f6b(0x1f0))/0x8)+parseInt(_0x402f6b(0x1ca))/0x9*(-parseInt(_0x402f6b(0x1d4))/0xa)+parseInt(_0x402f6b(0x20b))/0xb*(-parseInt(_0x402f6b(0x19e))/0xc)+parseInt(_0x402f6b(0x204))/0xd;if(_0x564edb===_0x195d6c)break;else _0x304a15['push'](_0x304a15['shift']());}catch(_0x28b57f){_0x304a15['push'](_0x304a15['shift']());}}}(_0x3960,0x82a9e));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0xbb28f0 from'inquirer';function _0x3960(){const _0x50848d=['withDeps','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','1024UjjvSi','npx','COFDw','\x0a\x20\x20','url','57924165cXkQKe','The\x20required\x20version\x20(','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','ranger\x20profile\x20add\x20<name>','✓\x20Authenticated\x20to\x20','vVwHs','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','7205sscEwd','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','LrqAH','vWNeL','skipAuth','17916HWZVPF','BONLm','✓\x20Local\x20profile\x20already\x20exists','OTZBQ','✓\x20Exported\x20credentials\x20for\x20CI','QTxPn','scope','ranger','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','install','bfGHo','4280520uMzaAB','chromium','auth','145rGSLBj','user','ahRLs','plugin','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','ranger\x20setup\x20--scope=','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','skills','\x20and\x20prompt\x20the\x20coding','bjhsi','confirm','platform','1484966AFLRoE','existing_token','WMEvE','SbZss','tMMic','ZfNoN','You\x20can\x20install\x20it\x20manually\x20by\x20running:','zqbsZ','Authentication\x20failed:\x20','hrzHZ','\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','fPhTL','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','skipped','DaptC','log','63POspQu','success','lOeYv','✓\x20Created\x20~/.ranger/\x20directory','GtgDT','GFPBF','\x0a⚠\x20Skipping\x20Chromium\x20installation.','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','RZGKg','gOpEz','501010KwRsLN','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','trackPhaseEnd','executablePath','163wNIWjU','playwright@','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','78126RqwVna','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','error','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','tCIli','isTTY','prompt','JjixM','3MVuoKb','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','URiFH','PFxjx','ivwtK','method','playwright/package.json','organizationName','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','Necsz','DAuGh','local','/ranger:enable','40cCjVdx','nOuSl','allowInsecureLocalhost','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','\x0a🚀\x20Ranger\x20Setup\x0a','\x20now?','\x20is\x20no\x20longer\x20supported.\x20','message','trackPhaseStart','✓\x20Already\x20authenticated\x20to\x20','NnlKd','YzKXw','uLrvo'];_0x3960=function(){return _0x50848d;};return _0x3960();}import{getToken,storeToken}from'./utils/keychain.js';function _0x3fa4(_0x1c66fc,_0x54bdb8){_0x1c66fc=_0x1c66fc-0x19c;const _0x39602c=_0x3960();let _0x3fa4db=_0x39602c[_0x1c66fc];return _0x3fa4db;}import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x15a7f9=>'\x1b[1m'+_0x15a7f9+'\x1b[0m';export function getPlaywrightVersion(){const _0x279910=_0x3fa4,_0x14f363={'ZfNoN':_0x279910(0x1e9)};try{const _0x108450=require['resolve'](_0x14f363[_0x279910(0x1bf)]),_0x593649=require(_0x108450);return _0x593649['version'];}catch{return null;}}export function installChromiumBinary(_0x39c347,_0x3e0586=![]){const _0x14f1c4=_0x3fa4,_0x1d6640={'byBsB':_0x14f1c4(0x1a8),'CZiFs':_0x14f1c4(0x1ab),'Mdetq':function(_0x5dc903,_0x569ccc,_0x52c55c,_0x26024c){return _0x5dc903(_0x569ccc,_0x52c55c,_0x26024c);},'SbZss':_0x14f1c4(0x200),'QTxPn':'inherit','MOPiC':'close'};return new Promise((_0x2767c7,_0x3443e0)=>{const _0x294ca0=_0x14f1c4,_0x1eb6b4={'WMEvE':function(_0x4e4277,_0x248a96){return _0x4e4277(_0x248a96);}},_0x1ce9d3=[_0x294ca0(0x1d9)+_0x39c347,_0x1d6640['byBsB'],..._0x3e0586?['--with-deps']:[],_0x1d6640['CZiFs']],_0x2cb353=_0x1d6640['Mdetq'](spawn,_0x1d6640[_0x294ca0(0x1bd)],_0x1ce9d3,{'stdio':['ignore',_0x1d6640[_0x294ca0(0x1a3)],'inherit'],'shell':process[_0x294ca0(0x1b9)]==='win32'});_0x2cb353['on'](_0x1d6640['MOPiC'],_0x4dbeae=>{_0x4dbeae===0x0?_0x2767c7():_0x3443e0(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x4dbeae));}),_0x2cb353['on']('error',_0x486b88=>{const _0x5bca15=_0x294ca0;_0x1eb6b4[_0x5bca15(0x1bc)](_0x3443e0,_0x486b88);});});}export async function authenticate(_0x2a986b){const _0x47be38=_0x3fa4,_0x516840={'RngKa':function(_0x689cc5){return _0x689cc5();},'DaptC':function(_0xbc84c2,_0x50f044){return _0xbc84c2(_0x50f044);},'tCIli':'✓\x20Stored\x20credentials\x20locally'};if(!_0x2a986b){const _0x58a8ca=await _0x516840['RngKa'](getToken);if(_0x58a8ca){const _0x3f3cc7=await _0x516840['DaptC'](getCurrentUser,_0x58a8ca);if(_0x3f3cc7['success'])return console[_0x47be38(0x1c9)](_0x47be38(0x1f9)+_0x3f3cc7[_0x47be38(0x1ae)][_0x47be38(0x1ea)]),{'token':_0x58a8ca,'method':_0x47be38(0x1bb)};}try{_0x2a986b=await runDeviceAuthFlow();}catch(_0x43fe9d){throw new Error('Authentication\x20failed:\x20'+(_0x43fe9d instanceof Error?_0x43fe9d['message']:_0x43fe9d));}const _0x4f0b7f=await _0x516840[_0x47be38(0x1c8)](getCurrentUser,_0x2a986b);if(!_0x4f0b7f[_0x47be38(0x1cb)])throw new Error(_0x47be38(0x1a7)+_0x4f0b7f['error']);return console[_0x47be38(0x1c9)](_0x47be38(0x208)+_0x4f0b7f[_0x47be38(0x1ae)]['organizationName']),{'token':_0x2a986b,'method':'device_auth'};}console[_0x47be38(0x1c9)]('Validating\x20API\x20token...');const _0x31fe95=await getCurrentUser(_0x2a986b);if(!_0x31fe95['success']){if(_0x31fe95['status'])throw new Error(_0x47be38(0x1c2)+_0x31fe95[_0x47be38(0x1dd)]+_0x47be38(0x1b4));else throw new Error(_0x47be38(0x1e4)+_0x31fe95['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log']('✓\x20Authenticated\x20to\x20'+_0x31fe95[_0x47be38(0x1ae)]['organizationName']),await storeToken(_0x2a986b),console[_0x47be38(0x1c9)](process['env']['GITHUB_ENV']?_0x47be38(0x1a2):_0x516840[_0x47be38(0x1df)]),{'token':_0x2a986b,'method':'provided_token'};}export async function ensureRangerDir(_0x3ab3fc){const _0x48cf4b=_0x3fa4,_0x3d5470={'SVJHK':function(_0x230a35){return _0x230a35();},'vVwHs':function(_0x59675d,_0xcb03ce){return _0x59675d(_0xcb03ce);},'YzKXw':function(_0x1a29b7,_0x3b0bf1,_0x3c58d6){return _0x1a29b7(_0x3b0bf1,_0x3c58d6);},'juWks':_0x48cf4b(0x1cd),'URiFH':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x3ab3fc;const _0x463454=_0x3d5470['SVJHK'](getRangerHomeDir);return!_0x3d5470[_0x48cf4b(0x209)](existsSync,_0x463454)?(await _0x3d5470[_0x48cf4b(0x1fb)](mkdir,_0x463454,{'recursive':!![]}),console[_0x48cf4b(0x1c9)](_0x3d5470['juWks']),{'path':_0x463454,'installed':!![]}):(console['log'](_0x3d5470[_0x48cf4b(0x1e5)]),{'path':_0x463454,'installed':![]});}export async function ensureChromium(_0x2bc5c3=![]){const _0xadce33=_0x3fa4,_0xdb45e0={'RZGKg':function(_0x12964d,_0x15566f){return _0x12964d??_0x15566f;},'wQGfx':_0xadce33(0x1b8),'PFxjx':function(_0x4ed591,_0x284cc7,_0xea8535){return _0x4ed591(_0x284cc7,_0xea8535);},'nOuSl':_0xadce33(0x1c6),'TtLAH':_0xadce33(0x1f3)};let _0x442d0e=![];try{const _0x26380a=chromium[_0xadce33(0x1d7)]();_0x442d0e=existsSync(_0x26380a);}catch{_0x442d0e=![];}if(_0x442d0e)return console['log']('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x2d9794=getPlaywrightVersion(),_0x4edda3=_0xdb45e0[_0xadce33(0x1d2)](_0x2d9794,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x49f27d=!_0x2d9794,_0x14dd4b=process['stdin'][_0xadce33(0x1e0)]&&process['stdout'][_0xadce33(0x1e0)];let _0x3bd057=!![];if(_0x14dd4b){const {install:_0x2d6710}=await _0xbb28f0[_0xadce33(0x1e1)]([{'type':_0xdb45e0['wQGfx'],'name':'install','message':_0x49f27d?_0xadce33(0x1a6)+_0x4edda3+_0xadce33(0x1f5):_0xadce33(0x205)+_0x4edda3+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x3bd057=_0x2d6710;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x4edda3+(_0x49f27d?'\x20(fallback\x20version)':'')+'...');if(_0x3bd057){console[_0xadce33(0x1c9)]('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await _0xdb45e0[_0xadce33(0x1e6)](installChromiumBinary,_0x4edda3,_0x2bc5c3),console[_0xadce33(0x1c9)](_0xdb45e0[_0xadce33(0x1f1)]);}catch(_0x5667dd){console[_0xadce33(0x1dd)](_0xadce33(0x1b2),_0x5667dd instanceof Error?_0x5667dd[_0xadce33(0x1f7)]:_0x5667dd),console['log'](_0xadce33(0x1c0)),console[_0xadce33(0x1c9)]('\x20\x20npx\x20playwright@'+_0x4edda3+'\x20install\x20chromium');}}else console[_0xadce33(0x1c9)](_0xadce33(0x1d0)),console['log'](_0xdb45e0['TtLAH']),console['log']('\x20\x20npx\x20playwright@'+_0x4edda3+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x2f2270){const _0x219a5c=_0x3fa4,_0x114dde={'Necsz':function(_0xe9f142,_0x66ea7c,_0x4cf36f){return _0xe9f142(_0x66ea7c,_0x4cf36f);},'TqsDw':'.gitignore','vWNeL':function(_0x483895,_0x1adca2,_0x17ae4f){return _0x483895(_0x1adca2,_0x17ae4f);}},_0xb51de3=_0x114dde[_0x219a5c(0x1ec)](join,_0x2f2270,_0x114dde['TqsDw']),_0x32f047=_0x219a5c(0x1c4);await _0x114dde[_0x219a5c(0x19c)](writeFile,_0xb51de3,_0x32f047),console['log']('✓\x20Created\x20.ranger/.gitignore');}export async function ensureLocalEnv(_0x4b79aa,_0x23afa0){const _0x1db21f=_0x3fa4,_0x12c7f={'GFPBF':function(_0x1fe615){return _0x1fe615();},'swfGi':function(_0x3e66ca,_0x18ae55){return _0x3e66ca!==_0x18ae55;},'EeoZN':'user','VTHpS':function(_0x2f90c0,_0x121f82){return _0x2f90c0===_0x121f82;},'GtgDT':_0x1db21f(0x1ee),'OTZBQ':function(_0x27b58d,_0x93ea4,_0x2d0351,_0x2f8fd4){return _0x27b58d(_0x93ea4,_0x2d0351,_0x2f8fd4);},'tMMic':'\x0a❌\x20Profile\x20setup\x20failed:','fPhTL':function(_0x1e33cc,_0x3e8bcf){return _0x1e33cc instanceof _0x3e8bcf;}};if(!_0x12c7f[_0x1db21f(0x1cf)](findGitRoot)&&_0x12c7f['swfGi'](_0x4b79aa?.[_0x1db21f(0x1a4)],_0x12c7f['EeoZN']))return console['log']('⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.'),{'ready':![],'skipped':!![]};const _0x192f6c=_0x12c7f['VTHpS'](_0x4b79aa?.['scope'],_0x12c7f['EeoZN'])?getRangerHomeDir():undefined;if(findExistingEnv(_0x1db21f(0x1ee),{'locations':[_0x12c7f[_0x1db21f(0x1ce)]],'rangerDir':_0x192f6c}))return console['log'](_0x1db21f(0x1a0)),{'ready':!![],'skipped':![]};try{return await _0x12c7f[_0x1db21f(0x1a1)](addEnv,_0x12c7f['GtgDT'],{'url':_0x4b79aa?.['url'],'force':_0x4b79aa?.['force'],'allowInsecureLocalhost':_0x4b79aa?.['allowInsecureLocalhost'],'scope':_0x4b79aa?.['scope']},_0x23afa0),{'ready':!![],'skipped':![]};}catch(_0x1a842c){return console[_0x1db21f(0x1dd)](_0x12c7f[_0x1db21f(0x1be)],_0x12c7f[_0x1db21f(0x1c5)](_0x1a842c,Error)?_0x1a842c[_0x1db21f(0x1f7)]:_0x1a842c),{'ready':![],'skipped':![]};}}export async function start(_0x1db340,_0x5a02fa,_0x1a62e1){const _0x353de9=_0x3fa4,_0x481f95={'hrzHZ':function(_0x2e1e49,_0xea51f1){return _0x2e1e49!==_0xea51f1;},'ivwtK':function(_0x55732d,_0x1c7942){return _0x55732d+_0x1c7942;},'zqbsZ':'user','HoWdf':function(_0x16a359,_0x4f866c){return _0x16a359(_0x4f866c);},'LrqAH':'✓\x20Skipping\x20authentication\x20(--skip-auth)','ahnsY':'auth','bjhsi':function(_0x1dea0f,_0x4420d6){return _0x1dea0f(_0x4420d6);},'uLrvo':'chromium','ybNJM':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','JjixM':function(_0x56506d,_0x3ab3d9){return _0x56506d(_0x3ab3d9);},'tkPoZ':function(_0x1c1a96,_0x29686c){return _0x1c1a96(_0x29686c);},'gfYND':function(_0x1a1e12,_0x2d6469){return _0x1a1e12&&_0x2d6469;},'COFDw':_0x353de9(0x1b5),'ahRLs':function(_0x55b760,_0x52d96e,_0x3f9feb){return _0x55b760(_0x52d96e,_0x3f9feb);},'BONLm':function(_0x29cc41){return _0x29cc41();},'qIbvs':_0x353de9(0x1d5),'bfGHo':function(_0x47714e,_0x350b75,_0x198e15){return _0x47714e(_0x350b75,_0x198e15);},'TYseM':'profile','XEkrW':function(_0x245995,_0x1540f8){return _0x245995+_0x1540f8;},'gOpEz':function(_0x2f74d5,_0x397096){return _0x2f74d5+_0x397096;},'xaiHP':function(_0x421e59,_0x4844fc){return _0x421e59(_0x4844fc);},'pTjPU':_0x353de9(0x207),'DAuGh':_0x353de9(0x1d1),'NnlKd':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','JLYWW':function(_0x209fef,_0x1bc223){return _0x209fef(_0x1bc223);},'lOeYv':_0x353de9(0x1ef)};console['log'](_0x353de9(0x1f4));_0x481f95[_0x353de9(0x1c3)](_0x5a02fa?.[_0x353de9(0x1a4)],undefined)&&_0x481f95['hrzHZ'](_0x5a02fa['scope'],_0x353de9(0x1ae))&&(console['error'](_0x481f95['ivwtK'](_0x481f95[_0x353de9(0x1e7)](_0x353de9(0x1b3)+String(_0x5a02fa['scope'])+_0x353de9(0x1f6),'Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20'),_0x353de9(0x20a))),process['exit'](0x1));_0x5a02fa={..._0x5a02fa,'scope':_0x481f95[_0x353de9(0x1c1)]};const _0x240126=!existsSync(getRangerHomeDir());await _0x481f95['HoWdf'](ensureRangerDir,_0x481f95[_0x353de9(0x1c1)]);if(_0x5a02fa?.['skipAuth'])console['log'](_0x481f95[_0x353de9(0x20d)]),_0x1a62e1?.[_0x353de9(0x1d6)](_0x481f95['ahnsY'],{'isFirstRun':_0x240126,'method':_0x353de9(0x1c7)});else{_0x1a62e1?.[_0x353de9(0x1f8)]('auth');const _0x206e54=await _0x481f95[_0x353de9(0x1b7)](authenticate,_0x1db340);_0x1a62e1?.[_0x353de9(0x1d6)](_0x353de9(0x1ac),{'isFirstRun':_0x240126,'method':_0x206e54[_0x353de9(0x1e8)]});}_0x1a62e1?.[_0x353de9(0x1f8)](_0x481f95[_0x353de9(0x1fc)]);_0x5a02fa?.['skipChromium']?console['log'](_0x481f95['ybNJM']):await _0x481f95[_0x353de9(0x1e2)](ensureChromium,_0x5a02fa?.[_0x353de9(0x1fd)]);_0x1a62e1?.['trackPhaseEnd'](_0x481f95['uLrvo'],{'isFirstRun':_0x240126,'skipped':!!_0x5a02fa?.['skipChromium']}),console[_0x353de9(0x1c9)](_0x353de9(0x1de));const _0x1e2fa4=_0x5a02fa?.['scope'],_0x43434d=_0x5a02fa?.['opencode']??![];let _0x5f0d5f=null;_0x43434d?(_0x1a62e1?.[_0x353de9(0x1f8)]('plugin'),_0x5f0d5f=await _0x481f95['tkPoZ'](ensureOpencodePluginConfig,_0x1e2fa4),_0x1a62e1?.[_0x353de9(0x1d6)]('plugin',{'isFirstRun':_0x240126,'opencode':!![]})):(_0x1a62e1?.[_0x353de9(0x1f8)](_0x353de9(0x1b0)),await ensureClaudePlugin(_0x1e2fa4),_0x1a62e1?.['trackPhaseEnd'](_0x353de9(0x1b0),{'isFirstRun':_0x240126}));if(_0x481f95['gfYND'](_0x43434d,_0x5f0d5f)){_0x1a62e1?.['trackPhaseStart'](_0x481f95['COFDw']);try{await _0x481f95[_0x353de9(0x1af)](installSkill,_0x353de9(0x1a5),{'level':_0x5f0d5f['scope'],'cliVersion':_0x481f95[_0x353de9(0x19f)](getCurrentVersion),'platform':'opencode'}),_0x1a62e1?.['trackPhaseEnd'](_0x481f95[_0x353de9(0x201)],{'isFirstRun':_0x240126,'opencode':!![]});}catch(_0x4aa3c0){console['warn'](_0x481f95['qIbvs'],_0x4aa3c0 instanceof Error?_0x4aa3c0[_0x353de9(0x1f7)]:_0x4aa3c0),_0x1a62e1?.[_0x353de9(0x1d6)](_0x353de9(0x1b5),{'isFirstRun':_0x240126,'opencode':!![],'failed':!![]});}}else _0x1a62e1?.[_0x353de9(0x1f8)](_0x353de9(0x1b5)),await _0x481f95['JjixM'](ensureClaudeSkills,_0x1e2fa4),_0x1a62e1?.[_0x353de9(0x1d6)](_0x353de9(0x1b5),{'isFirstRun':_0x240126});if(_0x5a02fa?.[_0x353de9(0x19d)])console[_0x353de9(0x1c9)](_0x353de9(0x206));else{if(_0x5a02fa?.['url']){_0x1a62e1?.['trackPhaseStart']('profile');const _0x178ce7=await _0x481f95[_0x353de9(0x1a9)](ensureLocalEnv,{'url':_0x5a02fa[_0x353de9(0x203)],'force':_0x5a02fa?.['force'],'allowInsecureLocalhost':_0x5a02fa?.[_0x353de9(0x1f2)],'scope':_0x481f95['zqbsZ']},_0x1a62e1);_0x1a62e1?.[_0x353de9(0x1d6)](_0x481f95['TYseM'],{'isFirstRun':_0x240126,'profileReady':_0x178ce7['ready'],'userSkipped':_0x178ce7['skipped']});}else console['log'](_0x481f95['ivwtK'](_0x481f95['XEkrW'](_0x481f95[_0x353de9(0x1d3)](_0x353de9(0x1dc),_0x353de9(0x202)+_0x481f95['xaiHP'](bold,_0x481f95['pTjPU'])),_0x353de9(0x20c)),_0x353de9(0x1da))+_0x353de9(0x1b1));}if(_0x43434d)console[_0x353de9(0x1c9)](_0x481f95[_0x353de9(0x1ed)]),console[_0x353de9(0x1c9)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console[_0x353de9(0x1c9)](_0x481f95[_0x353de9(0x1fa)]),console[_0x353de9(0x1c9)]('verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');else{const _0x2d5331=_0x481f95['JLYWW'](bold,_0x481f95[_0x353de9(0x1cc)]);console['log'](_0x481f95[_0x353de9(0x1d3)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x2d5331+_0x353de9(0x1b6),_0x353de9(0x1fe))+'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'+_0x353de9(0x1eb));}}
|
|
1
|
+
const _0x2f3c02=_0x27dc;(function(_0x300453,_0x46ac0f){const _0x22456f=_0x27dc,_0x1a3659=_0x300453();while(!![]){try{const _0xfd86c5=parseInt(_0x22456f(0x15f))/0x1*(parseInt(_0x22456f(0x17a))/0x2)+-parseInt(_0x22456f(0x198))/0x3+parseInt(_0x22456f(0x191))/0x4*(-parseInt(_0x22456f(0x182))/0x5)+parseInt(_0x22456f(0x14c))/0x6*(-parseInt(_0x22456f(0x153))/0x7)+parseInt(_0x22456f(0x130))/0x8*(parseInt(_0x22456f(0x144))/0x9)+-parseInt(_0x22456f(0x142))/0xa*(-parseInt(_0x22456f(0x183))/0xb)+-parseInt(_0x22456f(0x165))/0xc*(-parseInt(_0x22456f(0x133))/0xd);if(_0xfd86c5===_0x46ac0f)break;else _0x1a3659['push'](_0x1a3659['shift']());}catch(_0x548800){_0x1a3659['push'](_0x1a3659['shift']());}}}(_0x3356,0x3525a));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x3356(){const _0x453462=['Authentication\x20failed:\x20','ZZUix','opencode','isTTY','\x20install\x20chromium','126PnPhFB','exit','\x0aIn\x20Claude\x20Code,\x20run\x20','trackPhaseEnd','message','version','stdout','113869opsabp','force','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','1.58.2','confirm','CDpqE','tWMto','skipped','sOMoQ','OKObF','warn','log','1AfnZGn','Installation\x20failed\x20with\x20exit\x20code\x20','GITHUB_ENV','vxFub','✓\x20Local\x20profile\x20already\x20exists','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','12CHgHCP','\x20and\x20prompt\x20the\x20coding','ohVvz','✓\x20Skipping\x20authentication\x20(--skip-auth)','scope','lZfxM','env','trackPhaseStart','\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','You\x20can\x20install\x20it\x20manually\x20by\x20running:','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','VUejm','✓\x20Already\x20authenticated\x20to\x20','aPluE','organizationName','RgYAh','close','\x0a\x20\x20','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','withDeps','789962aFqeFi','playwright@','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','prompt','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','✓\x20Playwright\x20Chromium\x20browser\x20found','url','RYSYw','1685105GjwWAH','110NwVfiZ','skills','local','ranger\x20profile\x20add\x20<name>','allowInsecureLocalhost','OwZCh','\x0a⚠\x20Skipping\x20Chromium\x20installation.','playwright/package.json','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','KEedP','provided_token','zrhvo','stdin','\x20\x20npx\x20playwright@','4WRANYx','✓\x20Exported\x20credentials\x20for\x20CI','xCGbu','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','\x20(fallback\x20version)','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','user','714204YPzQsC','ZOPkY','✓\x20Created\x20.ranger/.gitignore','32HDFRDV','hmdXE','chromium','5313997DGKEfa','ranger','The\x20required\x20version\x20(','method','executablePath','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','success','zJoRf','inherit','✓\x20Authenticated\x20to\x20','ignore','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','\x20is\x20no\x20longer\x20supported.\x20','ready','xiEzF','268960comCgz','msdCH','138771SCqpNX','eRZht','error'];_0x3356=function(){return _0x453462;};return _0x3356();}import{createRequire}from'module';import{spawn}from'child_process';import _0xf7d27 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';function _0x27dc(_0x2b8fb5,_0x376f86){_0x2b8fb5=_0x2b8fb5-0x130;const _0x33566c=_0x3356();let _0x27dccc=_0x33566c[_0x2b8fb5];return _0x27dccc;}import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x2f3c02(0x156);const bold=_0xf2a9f7=>'\x1b[1m'+_0xf2a9f7+'\x1b[0m';export function getPlaywrightVersion(){const _0x22d716=_0x2f3c02,_0x14a6b0={'ZZUix':_0x22d716(0x18a),'ofWpS':function(_0x25b131,_0x3b4c10){return _0x25b131(_0x3b4c10);}};try{const _0x39102a=require['resolve'](_0x14a6b0[_0x22d716(0x148)]),_0x346435=_0x14a6b0['ofWpS'](require,_0x39102a);return _0x346435[_0x22d716(0x151)];}catch{return null;}}export function installChromiumBinary(_0x198651,_0x235c47=![]){const _0x321322=_0x2f3c02,_0x42c190={'afAjV':function(_0x3120a9,_0xc30a9e){return _0x3120a9===_0xc30a9e;},'sOMoQ':function(_0xf290f7){return _0xf290f7();},'fhssx':'--with-deps','GHAyj':'chromium','HLHFG':'npx','ZOPkY':'win32','jlhIy':_0x321322(0x176),'MJKnf':'error'};return new Promise((_0x449433,_0x290446)=>{const _0x1b2689=_0x321322,_0x42aefe={'zJoRf':function(_0x49e14c,_0x192ec5){return _0x42c190['afAjV'](_0x49e14c,_0x192ec5);},'cVnfh':function(_0x1ee3cd){const _0x53a57b=_0x27dc;return _0x42c190[_0x53a57b(0x15b)](_0x1ee3cd);}},_0x56f23c=[_0x1b2689(0x17b)+_0x198651,'install',..._0x235c47?[_0x42c190['fhssx']]:[],_0x42c190['GHAyj']],_0x2fa26d=spawn(_0x42c190['HLHFG'],_0x56f23c,{'stdio':[_0x1b2689(0x13d),_0x1b2689(0x13b),_0x1b2689(0x13b)],'shell':_0x42c190['afAjV'](process['platform'],_0x42c190[_0x1b2689(0x199)])});_0x2fa26d['on'](_0x42c190['jlhIy'],_0x19a41e=>{const _0x5618a4=_0x1b2689;_0x42aefe[_0x5618a4(0x13a)](_0x19a41e,0x0)?_0x42aefe['cVnfh'](_0x449433):_0x290446(new Error(_0x5618a4(0x160)+_0x19a41e));}),_0x2fa26d['on'](_0x42c190['MJKnf'],_0x445903=>{_0x290446(_0x445903);});});}export async function authenticate(_0x685b70){const _0x56186c=_0x2f3c02,_0x3f5e8f={'aPluE':function(_0x43a2bd){return _0x43a2bd();},'myyNK':'existing_token','POmdn':function(_0x1f6817,_0x2d7ae3){return _0x1f6817(_0x2d7ae3);},'GIUND':'device_auth','mYjhn':_0x56186c(0x192),'ImGHi':'✓\x20Stored\x20credentials\x20locally','Tedry':_0x56186c(0x18d)};if(!_0x685b70){const _0xe4d0bd=await _0x3f5e8f[_0x56186c(0x173)](getToken);if(_0xe4d0bd){const _0x520ad9=await getCurrentUser(_0xe4d0bd);if(_0x520ad9[_0x56186c(0x139)])return console['log'](_0x56186c(0x172)+_0x520ad9[_0x56186c(0x197)]['organizationName']),{'token':_0xe4d0bd,'method':_0x3f5e8f['myyNK']};}try{_0x685b70=await _0x3f5e8f[_0x56186c(0x173)](runDeviceAuthFlow);}catch(_0x252772){throw new Error('Authentication\x20failed:\x20'+(_0x252772 instanceof Error?_0x252772[_0x56186c(0x150)]:_0x252772));}const _0x12bda2=await _0x3f5e8f['POmdn'](getCurrentUser,_0x685b70);if(!_0x12bda2['success'])throw new Error(_0x56186c(0x18b)+_0x12bda2['error']);return console[_0x56186c(0x15e)](_0x56186c(0x13c)+_0x12bda2[_0x56186c(0x197)][_0x56186c(0x174)]),{'token':_0x685b70,'method':_0x3f5e8f['GIUND']};}console[_0x56186c(0x15e)]('Validating\x20API\x20token...');const _0x1f92fb=await getCurrentUser(_0x685b70);if(!_0x1f92fb[_0x56186c(0x139)]){if(_0x1f92fb['status'])throw new Error(_0x56186c(0x147)+_0x1f92fb['error']+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x1f92fb['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x56186c(0x15e)]('✓\x20Authenticated\x20to\x20'+_0x1f92fb[_0x56186c(0x197)]['organizationName']),await storeToken(_0x685b70),console[_0x56186c(0x15e)](process[_0x56186c(0x16b)][_0x56186c(0x161)]?_0x3f5e8f['mYjhn']:_0x3f5e8f['ImGHi']),{'token':_0x685b70,'method':_0x3f5e8f['Tedry']};}export async function ensureRangerDir(_0x3494f0){const _0x1ae690=_0x2f3c02,_0x48765f={'lZfxM':function(_0x5c02d1){return _0x5c02d1();},'jmKIa':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x3494f0;const _0x3cd711=_0x48765f[_0x1ae690(0x16a)](getRangerHomeDir);return!existsSync(_0x3cd711)?(await mkdir(_0x3cd711,{'recursive':!![]}),console[_0x1ae690(0x15e)]('✓\x20Created\x20~/.ranger/\x20directory'),{'path':_0x3cd711,'installed':!![]}):(console['log'](_0x48765f['jmKIa']),{'path':_0x3cd711,'installed':![]});}export async function ensureChromium(_0xfd233d=![]){const _0x1d1bc3=_0x2f3c02,_0x28c384={'aWTlg':_0x1d1bc3(0x157),'hmdXE':_0x1d1bc3(0x195),'XcnMC':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','MgBcb':function(_0x185428,_0x49a030){return _0x185428 instanceof _0x49a030;},'KEedP':_0x1d1bc3(0x189),'hpRlf':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0x1c4eaf=![];try{const _0x4e2485=chromium[_0x1d1bc3(0x137)]();_0x1c4eaf=existsSync(_0x4e2485);}catch{_0x1c4eaf=![];}if(_0x1c4eaf)return console[_0x1d1bc3(0x15e)](_0x1d1bc3(0x17f)),![];const _0x49b7fb=getPlaywrightVersion(),_0x23cb36=_0x49b7fb??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x3f763e=!_0x49b7fb,_0x486e30=process[_0x1d1bc3(0x18f)][_0x1d1bc3(0x14a)]&&process[_0x1d1bc3(0x152)]['isTTY'];let _0x585e74=!![];if(_0x486e30){const {install:_0x1a064f}=await _0xf7d27[_0x1d1bc3(0x17d)]([{'type':_0x28c384['aWTlg'],'name':'install','message':_0x3f763e?_0x1d1bc3(0x138)+_0x23cb36+'\x20now?':_0x1d1bc3(0x135)+_0x23cb36+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x585e74=_0x1a064f;}else console['log'](_0x1d1bc3(0x13e)+_0x23cb36+(_0x3f763e?_0x28c384[_0x1d1bc3(0x131)]:'')+'...');if(_0x585e74){console['log']('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await installChromiumBinary(_0x23cb36,_0xfd233d),console[_0x1d1bc3(0x15e)](_0x28c384['XcnMC']);}catch(_0x2f251a){console['error'](_0x1d1bc3(0x170),_0x28c384['MgBcb'](_0x2f251a,Error)?_0x2f251a['message']:_0x2f251a),console[_0x1d1bc3(0x15e)](_0x1d1bc3(0x16e)),console[_0x1d1bc3(0x15e)](_0x1d1bc3(0x190)+_0x23cb36+_0x1d1bc3(0x14b));}}else console['log'](_0x28c384[_0x1d1bc3(0x18c)]),console[_0x1d1bc3(0x15e)](_0x28c384['hpRlf']),console['log']('\x20\x20npx\x20playwright@'+_0x23cb36+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x520787){const _0x51f897=_0x2f3c02,_0x23634a={'eRZht':function(_0x427187,_0x4d1320,_0x515177){return _0x427187(_0x4d1320,_0x515177);},'VUejm':_0x51f897(0x19a)},_0x103c22=join(_0x520787,'.gitignore'),_0x5d7d54=_0x51f897(0x16d);await _0x23634a[_0x51f897(0x145)](writeFile,_0x103c22,_0x5d7d54),console[_0x51f897(0x15e)](_0x23634a[_0x51f897(0x171)]);}export async function ensureLocalEnv(_0x46e017,_0x4243ac){const _0x46d67b=_0x2f3c02,_0x404d51={'FPhns':function(_0x4bf559){return _0x4bf559();},'zEugL':function(_0x2ff81f,_0x33b263){return _0x2ff81f===_0x33b263;},'CDpqE':_0x46d67b(0x185),'XOYkc':function(_0x5555f7,_0x27272a,_0x36234a,_0x36fcff){return _0x5555f7(_0x27272a,_0x36234a,_0x36fcff);},'OwZCh':'\x0a❌\x20Profile\x20setup\x20failed:'};if(!_0x404d51['FPhns'](findGitRoot)&&_0x46e017?.['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 _0x3f05c9=_0x404d51['zEugL'](_0x46e017?.['scope'],'user')?getRangerHomeDir():undefined;if(findExistingEnv(_0x404d51[_0x46d67b(0x158)],{'locations':[_0x404d51['CDpqE']],'rangerDir':_0x3f05c9}))return console[_0x46d67b(0x15e)](_0x46d67b(0x163)),{'ready':!![],'skipped':![]};try{return await _0x404d51['XOYkc'](addEnv,_0x404d51['CDpqE'],{'url':_0x46e017?.[_0x46d67b(0x180)],'force':_0x46e017?.['force'],'allowInsecureLocalhost':_0x46e017?.['allowInsecureLocalhost'],'scope':_0x46e017?.[_0x46d67b(0x169)]},_0x4243ac),{'ready':!![],'skipped':![]};}catch(_0x3ef5cc){return console[_0x46d67b(0x146)](_0x404d51[_0x46d67b(0x188)],_0x3ef5cc instanceof Error?_0x3ef5cc[_0x46d67b(0x150)]:_0x3ef5cc),{'ready':![],'skipped':![]};}}export async function start(_0x2ec5b0,_0x3e4398,_0x57d510){const _0x303faf=_0x2f3c02,_0x30d6b1={'RgYAh':'\x0a🚀\x20Ranger\x20Setup\x0a','bVcfE':function(_0x574898,_0x2b0948){return _0x574898!==_0x2b0948;},'zrhvo':_0x303faf(0x197),'RYSYw':function(_0x1f1c7b,_0x514578){return _0x1f1c7b(_0x514578);},'ohVvz':_0x303faf(0x168),'tWMto':'auth','OcQYe':function(_0x4faa0b,_0x273a57){return _0x4faa0b(_0x273a57);},'bDarl':_0x303faf(0x132),'xiEzF':'plugin','xCGbu':function(_0x3ec4c5,_0x4519b8){return _0x3ec4c5&&_0x4519b8;},'JtrwJ':function(_0x47a16e,_0x18d809,_0x3e14ca){return _0x47a16e(_0x18d809,_0x3e14ca);},'vxFub':_0x303faf(0x134),'EwprS':function(_0x57bffa){return _0x57bffa();},'iVqzp':_0x303faf(0x184),'luoPC':function(_0x5d6c32,_0x5c850c){return _0x5d6c32(_0x5c850c);},'msdCH':'profile','OKObF':function(_0x177fc3,_0x2aeb33,_0x35f548){return _0x177fc3(_0x2aeb33,_0x35f548);},'LOKqp':function(_0x2d9eae,_0x3df7e4){return _0x2d9eae+_0x3df7e4;},'MRbCc':_0x303faf(0x178),'AwEMh':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','Aqgdz':function(_0x5f48b7,_0x5b30c9){return _0x5f48b7+_0x5b30c9;}};console[_0x303faf(0x15e)](_0x30d6b1[_0x303faf(0x175)]);_0x30d6b1['bVcfE'](_0x3e4398?.['scope'],undefined)&&_0x3e4398['scope']!==_0x303faf(0x197)&&(console[_0x303faf(0x146)]('ranger\x20setup\x20--scope='+String(_0x3e4398[_0x303faf(0x169)])+_0x303faf(0x13f)+_0x303faf(0x17e)+_0x303faf(0x17c)),process[_0x303faf(0x14d)](0x1));_0x3e4398={..._0x3e4398,'scope':_0x30d6b1[_0x303faf(0x18e)]};const _0x50abbf=!_0x30d6b1[_0x303faf(0x181)](existsSync,getRangerHomeDir());await ensureRangerDir(_0x30d6b1['zrhvo']);if(_0x3e4398?.['skipAuth'])console['log'](_0x30d6b1[_0x303faf(0x167)]),_0x57d510?.[_0x303faf(0x14f)]('auth',{'isFirstRun':_0x50abbf,'method':'skipped'});else{_0x57d510?.['trackPhaseStart'](_0x30d6b1[_0x303faf(0x159)]);const _0x1933fd=await _0x30d6b1['OcQYe'](authenticate,_0x2ec5b0);_0x57d510?.[_0x303faf(0x14f)]('auth',{'isFirstRun':_0x50abbf,'method':_0x1933fd[_0x303faf(0x136)]});}_0x57d510?.[_0x303faf(0x16c)](_0x30d6b1['bDarl']);_0x3e4398?.['skipChromium']?console[_0x303faf(0x15e)]('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await _0x30d6b1['OcQYe'](ensureChromium,_0x3e4398?.[_0x303faf(0x179)]);_0x57d510?.[_0x303faf(0x14f)](_0x303faf(0x132),{'isFirstRun':_0x50abbf,'skipped':!!_0x3e4398?.['skipChromium']}),console[_0x303faf(0x15e)]('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0x1000ac=_0x3e4398?.['scope'],_0x1c4dfb=_0x3e4398?.[_0x303faf(0x149)]??![];let _0x525f4a=null;_0x1c4dfb?(_0x57d510?.['trackPhaseStart'](_0x30d6b1[_0x303faf(0x141)]),_0x525f4a=await _0x30d6b1['OcQYe'](ensureOpencodePluginConfig,_0x1000ac),_0x57d510?.[_0x303faf(0x14f)](_0x30d6b1['xiEzF'],{'isFirstRun':_0x50abbf,'opencode':!![]})):(_0x57d510?.[_0x303faf(0x16c)]('plugin'),await _0x30d6b1['OcQYe'](ensureClaudePlugin,_0x1000ac),_0x57d510?.[_0x303faf(0x14f)](_0x30d6b1['xiEzF'],{'isFirstRun':_0x50abbf}));if(_0x30d6b1[_0x303faf(0x193)](_0x1c4dfb,_0x525f4a)){_0x57d510?.[_0x303faf(0x16c)](_0x303faf(0x184));try{await _0x30d6b1['JtrwJ'](installSkill,_0x30d6b1[_0x303faf(0x162)],{'level':_0x525f4a['scope'],'cliVersion':_0x30d6b1['EwprS'](getCurrentVersion),'platform':_0x303faf(0x149)}),_0x57d510?.['trackPhaseEnd'](_0x30d6b1['iVqzp'],{'isFirstRun':_0x50abbf,'opencode':!![]});}catch(_0x147ec3){console[_0x303faf(0x15d)]('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x147ec3 instanceof Error?_0x147ec3[_0x303faf(0x150)]:_0x147ec3),_0x57d510?.['trackPhaseEnd']('skills',{'isFirstRun':_0x50abbf,'opencode':!![],'failed':!![]});}}else _0x57d510?.[_0x303faf(0x16c)]('skills'),await _0x30d6b1['luoPC'](ensureClaudeSkills,_0x1000ac),_0x57d510?.['trackPhaseEnd'](_0x303faf(0x184),{'isFirstRun':_0x50abbf});if(_0x3e4398?.['skipAuth'])console[_0x303faf(0x15e)](_0x303faf(0x196));else{if(_0x3e4398?.['url']){_0x57d510?.[_0x303faf(0x16c)](_0x30d6b1[_0x303faf(0x143)]);const _0xbd15ba=await _0x30d6b1[_0x303faf(0x15c)](ensureLocalEnv,{'url':_0x3e4398['url'],'force':_0x3e4398?.[_0x303faf(0x154)],'allowInsecureLocalhost':_0x3e4398?.[_0x303faf(0x187)],'scope':_0x30d6b1[_0x303faf(0x18e)]},_0x57d510);_0x57d510?.[_0x303faf(0x14f)]('profile',{'isFirstRun':_0x50abbf,'profileReady':_0xbd15ba[_0x303faf(0x140)],'userSkipped':_0xbd15ba[_0x303faf(0x15a)]});}else console[_0x303faf(0x15e)](_0x30d6b1['LOKqp']('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:'+(_0x303faf(0x177)+bold(_0x303faf(0x186)))+_0x303faf(0x155),'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:')+_0x303faf(0x164));}if(_0x1c4dfb)console[_0x303faf(0x15e)](_0x30d6b1['MRbCc']),console[_0x303faf(0x15e)](_0x303faf(0x194)),console[_0x303faf(0x15e)](_0x30d6b1['AwEMh']),console['log']('verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');else{const _0x3c8151=_0x30d6b1[_0x303faf(0x181)](bold,'/ranger:enable');console[_0x303faf(0x15e)](_0x30d6b1['Aqgdz'](_0x30d6b1['Aqgdz'](_0x303faf(0x14e)+_0x3c8151+_0x303faf(0x166),'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with'),'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser')+_0x303faf(0x16f));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x167bee,_0x87f885){const _0x4e3bea=_0x30eb,_0x463ff6=_0x167bee();while(!![]){try{const _0x73b7b4=-parseInt(_0x4e3bea(0x14d))/0x1+parseInt(_0x4e3bea(0x123))/0x2+parseInt(_0x4e3bea(0x11e))/0x3+-parseInt(_0x4e3bea(0x17b))/0x4*(parseInt(_0x4e3bea(0x167))/0x5)+-parseInt(_0x4e3bea(0x16b))/0x6+parseInt(_0x4e3bea(0x14c))/0x7*(parseInt(_0x4e3bea(0x171))/0x8)+parseInt(_0x4e3bea(0x136))/0x9*(parseInt(_0x4e3bea(0x134))/0xa);if(_0x73b7b4===_0x87f885)break;else _0x463ff6['push'](_0x463ff6['shift']());}catch(_0x92dd8f){_0x463ff6['push'](_0x463ff6['shift']());}}}(_0x1aa2,0x63811));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';function _0x30eb(_0x1f5c5a,_0x4a094e){_0x1f5c5a=_0x1f5c5a-0x11d;const _0x1aa217=_0x1aa2();let _0x30eb91=_0x1aa217[_0x1f5c5a];return _0x30eb91;}import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';function _0x1aa2(){const _0x446a0=['sessionUpdatedAt','ducmx','\x20\x20Not\x20configured','fwnRm','API\x20Environment:\x20','KiuIw','string','8PHIlUp','map','success','isArray','tYphw','YgDVl','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','wqQBE','1312044gOdMjN','no\x20session','\x20(up\x20to\x20date)','name','hasPlaintextAuth','422932KPjcES','Root:\x20','ggtMn','soimq','not_configured','ohKYS','DcGOB','user',':\x20configured','BdeYd','lMcDA','TgCJT','GNAqE','\x20\x20\x20\x20Session:\x20','pipe','log','UGIXa','10gTFoZr','includes','11623230fJwecV','VXlbg','cwd','join','match','\x20\x20User-level:','LgIjO','Version:\x20','some','not_installed','kfIaa','configured','mFNXz','filter','dDJNX','\x20\x20Project-level:','API\x20URL:\x20','\x20\x20\x20\x20Auth:\x20','\x20\x20Run:\x20ranger\x20setup\x20--opencode','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','\x20(active)','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','790111bSNfnz','743307nVVEBu','SLMIz','WTrAI','details','path','plaintext','OBocA','has','stderr','parse','GlYar','organizationName','@ranger-testing/opencode-plugin','No\x20profiles\x20configured','\x20cloud','close','\x20[cloud]','none','sCXcv','OZagm','HxZIm','encrypted','\x20\x20Run:\x20ranger\x20skillup','gObcm','settingsPath','opencode-plugin','1860370TxUtXQ','push','EYPAc','rmyro','1626036WwoQHH','fNaJa','\x0a---\x20Claude\x20Code\x20Plugin\x20---','data','length','auth.json','16ncTehc','opencode','API\x20Token:\x20✗\x20Not\x20found'];_0x1aa2=function(){return _0x446a0;};return _0x1aa2();}import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x3fc81d=>'\x1b[1m'+_0x3fc81d+'\x1b[0m',link=(_0x1028f6,_0x56c89b)=>'\x1b]8;;file://'+_0x1028f6+'\x07'+(_0x56c89b||_0x1028f6)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x4bc808=_0x30eb,_0x4c86b1={'wqQBE':function(_0x252964,_0x2d398a){return _0x252964(_0x2d398a);},'fNaJa':_0x4bc808(0x13f),'KiuIw':function(_0x22cd97,_0xcfef6f){return _0x22cd97>_0xcfef6f;},'GNAqE':function(_0x58ed2d,_0x5b961e){return _0x58ed2d(_0x5b961e);},'RauQC':'not_configured','GlYar':_0x4bc808(0x166),'tYphw':function(_0x7f0301,_0x117ba9,_0x580fdc,_0x338311){return _0x7f0301(_0x117ba9,_0x580fdc,_0x338311);},'ggtMn':'config','YNena':'ignore','ducmx':_0x4bc808(0x131),'TgCJT':_0x4bc808(0x15c)};return new Promise(_0x29bb26=>{const _0x1689f8=_0x4bc808,_0x45bc9e={'UGIXa':function(_0x9ada4c,_0x5a9596){const _0x1fb4d1=_0x30eb;return _0x4c86b1[_0x1fb4d1(0x12f)](_0x9ada4c,_0x5a9596);},'WTrAI':_0x4c86b1['fNaJa'],'omUHT':function(_0x38c3b2,_0x9b5750){return _0x38c3b2!==_0x9b5750;},'ohKYS':_0x4c86b1[_0x1689f8(0x157)]},_0x3b91a2=_0x4c86b1[_0x1689f8(0x17f)](spawn,_0x1689f8(0x172),['debug',_0x4c86b1[_0x1689f8(0x125)]],{'stdio':[_0x4c86b1['YNena'],_0x1689f8(0x131),_0x4c86b1[_0x1689f8(0x175)]]});let _0x2975f2='';_0x3b91a2['stdout']?.['on'](_0x1689f8(0x16e),_0x67cf52=>{_0x2975f2+=_0x67cf52['toString']();}),_0x3b91a2[_0x1689f8(0x155)]?.['on'](_0x1689f8(0x16e),_0x21a836=>{_0x2975f2+=_0x21a836['toString']();}),_0x3b91a2['on']('error',()=>{const _0x3e49f6=_0x1689f8;_0x45bc9e[_0x3e49f6(0x133)](_0x29bb26,{'status':_0x45bc9e[_0x3e49f6(0x14f)]});}),_0x3b91a2['on'](_0x4c86b1[_0x1689f8(0x12e)],_0x5c7540=>{const _0x4a08bf=_0x1689f8;if(_0x5c7540!==0x0){_0x4c86b1[_0x4a08bf(0x11d)](_0x29bb26,{'status':_0x4c86b1[_0x4a08bf(0x16c)]});return;}const _0x6a22db=_0x2975f2['trim']();let _0x45f2be=null;if(_0x6a22db)try{_0x45f2be=JSON[_0x4a08bf(0x156)](_0x6a22db);}catch{const _0xd40c98=_0x6a22db[_0x4a08bf(0x13a)](/\{[\s\S]*\}$/);if(_0xd40c98)try{_0x45f2be=JSON['parse'](_0xd40c98[0x0]);}catch{_0x45f2be=null;}}const _0x3c6b70=Array[_0x4a08bf(0x17e)](_0x45f2be?.['plugin'])?_0x45f2be?.['plugin']:[],_0x4c117a=_0x3c6b70[_0x4a08bf(0x13e)](_0x41a8f7=>{const _0x377c13=_0x4a08bf;if(_0x45bc9e['omUHT'](typeof _0x41a8f7,_0x377c13(0x17a)))return![];return _0x41a8f7['includes'](_0x377c13(0x159))||_0x41a8f7[_0x377c13(0x135)](_0x45bc9e[_0x377c13(0x128)]);});if(_0x4c117a){_0x29bb26({'status':_0x4a08bf(0x141),'details':_0x4c86b1[_0x4a08bf(0x179)](_0x3c6b70['length'],0x0)?_0x3c6b70[_0x4a08bf(0x16f)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x3c6b70['length']>0x0){_0x4c86b1[_0x4a08bf(0x12f)](_0x29bb26,{'status':_0x4c86b1['RauQC'],'details':_0x3c6b70['length']+'\x20plugin(s)\x20configured'});return;}_0x29bb26({'status':_0x4a08bf(0x127)});});});}async function getSkillsFromDir(_0x5d15c0,_0x156925){const _0x2e8955=_0x30eb,_0x1afd10={'lDvDD':function(_0xc9021a,_0x302f05){return _0xc9021a(_0x302f05);},'mFNXz':'SKILL.md','HxZIm':function(_0x37aaa5,_0x11c0be){return _0x37aaa5(_0x11c0be);},'wmZCr':'utf-8'};if(!_0x1afd10['lDvDD'](existsSync,_0x5d15c0))return[];const _0x447570=[];try{const _0x105729=await readdir(_0x5d15c0,{'withFileTypes':!![]});for(const _0x3864a5 of _0x105729){if(_0x3864a5['isDirectory']()){const _0x3602b7=join(_0x5d15c0,_0x3864a5[_0x2e8955(0x121)],_0x1afd10[_0x2e8955(0x142)]);if(_0x1afd10[_0x2e8955(0x161)](existsSync,_0x3602b7)){let _0x550277=_0x3864a5['name'];try{const _0x39b26f=await readFile(_0x3602b7,_0x1afd10['wmZCr']),_0x226849=_0x39b26f['match'](/name:\s*(.+)/);_0x226849&&(_0x550277=_0x226849[0x1]['trim']());}catch{}_0x447570[_0x2e8955(0x168)]({'name':_0x3864a5['name'],'displayName':_0x550277,'path':_0x3602b7,'level':_0x156925});}}}}catch{return[];}return _0x447570;}async function getInstalledSkills(){const _0x2253a7=_0x30eb,_0x50d36e={'rcNDJ':function(_0x485f79){return _0x485f79();},'jCJDl':'project','fcImU':function(_0x410e1f,_0x5caea9,_0x2e4813){return _0x410e1f(_0x5caea9,_0x2e4813);},'rmyro':'user'},[_0x13d2e0,_0x4f548b]=await Promise['all']([getSkillsFromDir(_0x50d36e['rcNDJ'](getProjectSkillsDir),_0x50d36e['jCJDl']),_0x50d36e['fcImU'](getSkillsFromDir,getUserSkillsDir(),_0x50d36e[_0x2253a7(0x16a)])]);return{'project':_0x13d2e0,'user':_0x4f548b};}async function getEnvironments(){const _0xe55a5a=_0x30eb,_0x176b35={'dDJNX':function(_0x222b04,_0x918ff6){return _0x222b04(_0x918ff6);},'bzZkK':function(_0x3c5964,_0x3cb910,_0x135e02){return _0x3c5964(_0x3cb910,_0x135e02);},'adUaM':'settings.json','RzqEN':_0xe55a5a(0x170),'MeALX':function(_0x239b7d,_0x32467e){return _0x239b7d(_0x32467e);},'soimq':function(_0x5d0944){return _0x5d0944();},'YgDVl':function(_0x4042ed){return _0x4042ed();}},{envNames:_0x465844,activeEnv:_0x1bbbbe}=await _0x176b35[_0xe55a5a(0x126)](getEnvNames),_0x1913f7=_0x176b35[_0xe55a5a(0x180)](getRangerDir);if(!_0x176b35[_0xe55a5a(0x144)](existsSync,_0x1913f7))return{'envs':[],'activeEnv':null};const _0x18f7ab=_0x465844['map'](_0x4f93fe=>{const _0x30fcb0=_0xe55a5a,_0x4d85bf=_0x176b35[_0x30fcb0(0x144)](getEnvDir,_0x4f93fe),_0x4e1ea2=_0x176b35['bzZkK'](join,_0x4d85bf,_0x176b35['adUaM']),_0x1163c6=_0x176b35['bzZkK'](join,_0x4d85bf,_0x176b35['RzqEN']),_0x109167=join(_0x4d85bf,'auth.json.enc');return{'name':_0x4f93fe,'settingsPath':existsSync(_0x4e1ea2)?_0x4e1ea2:'(not\x20found)','hasPlaintextAuth':existsSync(_0x1163c6),'hasEncryptedAuth':_0x176b35['MeALX'](existsSync,_0x109167),'isActive':_0x4f93fe===_0x1bbbbe};});return{'envs':_0x18f7ab,'activeEnv':_0x1bbbbe};}export async function status(){const _0x328ed0=_0x30eb,_0x1a27bc={'lMcDA':'\x0a📊\x20Ranger\x20Status\x0a','EYPAc':function(_0x2bc4f9){return _0x2bc4f9();},'BdeYd':function(_0x259dba,_0xc5e819){return _0x259dba(_0xc5e819);},'OZagm':function(_0x4efa42,_0x36ccb3,_0x304b54){return _0x4efa42(_0x36ccb3,_0x304b54);},'uxNYW':function(_0x17ed30){return _0x17ed30();},'kfIaa':'not_configured','vkfBX':_0x328ed0(0x149),'MssJE':_0x328ed0(0x16d),'gObcm':'ranger@trailhead','VXlbg':'\x20\x20Not\x20installed','LgIjO':_0x328ed0(0x181),'fIevs':'\x0a---\x20Skills\x20---','DcGOB':function(_0x1709d3,_0x38e753){return _0x1709d3+_0x38e753;},'ZtQZZ':function(_0x2f8552,_0x2a6578){return _0x2f8552>_0x2a6578;},'OBocA':function(_0x486df2,_0xcb039d,_0x7dcdb9){return _0x486df2(_0xcb039d,_0x7dcdb9);},'xYbep':function(_0x441f1b,_0x106939){return _0x441f1b(_0x106939);},'sCXcv':function(_0x44dc47,_0x429aac){return _0x44dc47(_0x429aac);},'CswYg':function(_0x1375b7){return _0x1375b7();},'SLMIz':function(_0x5ab2b4,_0x9002db){return _0x5ab2b4>_0x9002db;},'fwnRm':function(_0x51c377,_0x4a977c){return _0x51c377===_0x4a977c;},'VGQaj':_0x328ed0(0x14a),'qHyfl':_0x328ed0(0x11f),'djGxo':_0x328ed0(0x15e),'BrhZf':function(_0x5818f5,_0x60bf1e){return _0x5818f5!==_0x60bf1e;},'TAVyj':'(not\x20found)'};console[_0x328ed0(0x132)](_0x1a27bc[_0x328ed0(0x12d)]);const _0x1d889a=process[_0x328ed0(0x138)](),_0x405c24=_0x1a27bc[_0x328ed0(0x169)](getRangerDir);if(!_0x1a27bc[_0x328ed0(0x12c)](existsSync,_0x405c24)){console[_0x328ed0(0x132)]('Root:\x20'+link(_0x1d889a,_0x1a27bc[_0x328ed0(0x12c)](bold,basename(_0x1d889a)))),console[_0x328ed0(0x132)]('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log'](_0x328ed0(0x14b));return;}console[_0x328ed0(0x132)](_0x328ed0(0x124)+_0x1a27bc['OZagm'](link,_0x1d889a,_0x1a27bc[_0x328ed0(0x12c)](bold,_0x1a27bc[_0x328ed0(0x12c)](basename,_0x1d889a))));const _0x4bf0=getCurrentVersion(),_0x486732=_0x1a27bc['uxNYW'](getLatestVersion);if(_0x486732['version']&&_0x486732['version']!==_0x4bf0)console['log']('Version:\x20'+_0x4bf0+'\x20(latest:\x20'+_0x486732['version']+')'),console[_0x328ed0(0x132)]('\x20\x20Run:\x20ranger\x20update');else _0x486732['version']?console[_0x328ed0(0x132)](_0x328ed0(0x13d)+_0x4bf0+_0x328ed0(0x120)):console[_0x328ed0(0x132)]('Version:\x20'+_0x4bf0);const _0x31083d=await getToken();if(_0x31083d){const _0x53a282=await getCurrentUser(_0x31083d);_0x53a282[_0x328ed0(0x17d)]?console[_0x328ed0(0x132)]('Organization:\x20'+bold(_0x53a282[_0x328ed0(0x12a)][_0x328ed0(0x158)])):(console[_0x328ed0(0x132)]('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0x328ed0(0x132)](_0x328ed0(0x173)),console[_0x328ed0(0x132)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process['env']['DEBUG']&&(console[_0x328ed0(0x132)](_0x328ed0(0x178)+_0x1a27bc['uxNYW'](getCurrentEnvironment)),console[_0x328ed0(0x132)](_0x328ed0(0x146)+getApiBaseUrl()));console['log']('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x3e6f2f=await getOpencodePluginStatus();if(_0x3e6f2f['status']==='configured')console[_0x328ed0(0x132)]('\x20\x20'+bold(_0x328ed0(0x159))+_0x328ed0(0x12b)),_0x3e6f2f[_0x328ed0(0x150)]&&console['log']('\x20\x20'+_0x3e6f2f['details']);else _0x3e6f2f['status']===_0x1a27bc[_0x328ed0(0x140)]?(console[_0x328ed0(0x132)](_0x328ed0(0x176)),_0x3e6f2f[_0x328ed0(0x150)]&&console['log']('\x20\x20'+_0x3e6f2f['details']),console[_0x328ed0(0x132)](_0x328ed0(0x148))):console[_0x328ed0(0x132)](_0x1a27bc['vkfBX']);console[_0x328ed0(0x132)](_0x1a27bc['MssJE']);const _0x3b46fe=await getPluginInfo('ranger@trailhead');if(_0x3b46fe){const _0x5307d3=_0x3b46fe['scope']||'unknown',_0x263af7=_0x3b46fe['enabled']?'enabled':'disabled';console[_0x328ed0(0x132)]('\x20\x20'+bold(_0x1a27bc[_0x328ed0(0x164)])+':\x20installed\x20('+_0x5307d3+',\x20'+_0x263af7+')');}else console['log'](_0x1a27bc[_0x328ed0(0x137)]),console['log'](_0x1a27bc[_0x328ed0(0x13c)]);console['log'](_0x1a27bc['fIevs']);const {project:_0x3f1fce,user:_0x46d2f4}=await getInstalledSkills(),_0x1814b2=_0x3f1fce['filter'](_0x4b3a76=>RANGER_MANAGED_SKILLS['includes'](_0x4b3a76['name'])),_0x3292a0=_0x46d2f4[_0x328ed0(0x143)](_0xd9557a=>RANGER_MANAGED_SKILLS[_0x328ed0(0x135)](_0xd9557a['name'])),_0x471c80=_0x1a27bc['DcGOB'](_0x1814b2['length'],_0x3292a0['length']);if(_0x471c80===0x0)console['log']('No\x20skills\x20installed'),console[_0x328ed0(0x132)](_0x328ed0(0x163));else{if(_0x1a27bc['ZtQZZ'](_0x1814b2['length'],0x0)){console['log'](_0x328ed0(0x145));for(const _0x5c98a3 of _0x1814b2){console['log']('\x20\x20\x20\x20'+bold(_0x5c98a3['displayName'])+':\x20'+_0x1a27bc[_0x328ed0(0x153)](link,_0x5c98a3['path'],_0x1a27bc['xYbep'](basename,_0x5c98a3['path'])));}}if(_0x3292a0[_0x328ed0(0x16f)]>0x0){console[_0x328ed0(0x132)](_0x328ed0(0x13b));for(const _0x12d006 of _0x3292a0){console['log']('\x20\x20\x20\x20'+_0x1a27bc[_0x328ed0(0x15f)](bold,_0x12d006['displayName'])+':\x20'+link(_0x12d006[_0x328ed0(0x151)],basename(_0x12d006[_0x328ed0(0x151)])));}}}console['log']('\x0a---\x20Profiles\x20---');const {envs:_0x1e1f6d,activeEnv:_0x3b96ca}=await _0x1a27bc['CswYg'](getEnvironments);let _0x463210=[];if(_0x31083d)try{_0x463210=await _0x1a27bc['uxNYW'](listCloudProfiles);}catch{}const _0x2a2442=_0x1a27bc[_0x328ed0(0x129)](_0x1e1f6d['length'],_0x463210[_0x328ed0(0x16f)]);if(_0x2a2442===0x0)console[_0x328ed0(0x132)](_0x328ed0(0x15a)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0x1a27bc[_0x328ed0(0x14e)](_0x2a2442,0x5)){const _0x3cb062=[];_0x463210[_0x328ed0(0x16f)]>0x0&&_0x3cb062['push'](_0x463210['length']+_0x328ed0(0x15b)),_0x1e1f6d[_0x328ed0(0x16f)]>0x0&&_0x3cb062['push'](_0x1e1f6d['length']+'\x20local'),console['log'](_0x2a2442+'\x20profiles\x20configured\x20('+_0x3cb062[_0x328ed0(0x139)](',\x20')+')'),_0x3b96ca&&console[_0x328ed0(0x132)]('\x20\x20Active:\x20'+bold(_0x3b96ca)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x2a3c74 of _0x463210){const _0x1cfb2f=_0x1a27bc[_0x328ed0(0x177)](_0x2a3c74[_0x328ed0(0x121)],_0x3b96ca)?_0x1a27bc['VGQaj']:'';console['log']('\x20\x20'+bold(_0x2a3c74['name'])+_0x328ed0(0x15d)+_0x1cfb2f);const _0x305fbf=_0x2a3c74[_0x328ed0(0x174)]?'cached\x20(updated\x20'+_0x2a3c74[_0x328ed0(0x174)]+')':_0x1a27bc['qHyfl'];console['log'](_0x328ed0(0x130)+_0x305fbf);}const _0x4d6a22=new Set(_0x463210[_0x328ed0(0x17c)](_0x555261=>_0x555261[_0x328ed0(0x121)]));for(const _0x27f99b of _0x1e1f6d){if(_0x4d6a22['has'](_0x27f99b['name']))continue;const _0x3940a0=_0x27f99b['isActive']?_0x328ed0(0x14a):'',_0x26b2a2=_0x27f99b['hasEncryptedAuth']?_0x328ed0(0x162):_0x27f99b[_0x328ed0(0x122)]?_0x328ed0(0x152):_0x1a27bc['djGxo'];console['log']('\x20\x20'+bold(_0x27f99b[_0x328ed0(0x121)])+'\x20[local]'+_0x3940a0),console['log'](_0x328ed0(0x147)+_0x26b2a2),_0x1a27bc['BrhZf'](_0x27f99b[_0x328ed0(0x165)],_0x1a27bc['TAVyj'])&&console['log']('\x20\x20\x20\x20Settings:\x20'+_0x1a27bc[_0x328ed0(0x160)](link,_0x27f99b['settingsPath'],basename(_0x27f99b['settingsPath'])));}if(!_0x3b96ca){console[_0x328ed0(0x132)]('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x101719=[..._0x463210[_0x328ed0(0x17c)](_0x3c9045=>_0x3c9045[_0x328ed0(0x121)]),..._0x1e1f6d['filter'](_0x413c9f=>!_0x4d6a22[_0x328ed0(0x154)](_0x413c9f['name']))[_0x328ed0(0x17c)](_0x5efff6=>_0x5efff6[_0x328ed0(0x121)])];console[_0x328ed0(0x132)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x101719[_0x328ed0(0x139)](',\x20')+')');}}}console[_0x328ed0(0x132)]('');}
|
|
1
|
+
const _0x3921db=_0x4c60;(function(_0x107dfe,_0x35795a){const _0x538da0=_0x4c60,_0xb217da=_0x107dfe();while(!![]){try{const _0x5f5bae=parseInt(_0x538da0(0x227))/0x1*(parseInt(_0x538da0(0x21c))/0x2)+-parseInt(_0x538da0(0x20c))/0x3+-parseInt(_0x538da0(0x22b))/0x4*(-parseInt(_0x538da0(0x23c))/0x5)+-parseInt(_0x538da0(0x1de))/0x6+-parseInt(_0x538da0(0x23d))/0x7*(-parseInt(_0x538da0(0x1e7))/0x8)+parseInt(_0x538da0(0x20b))/0x9*(-parseInt(_0x538da0(0x236))/0xa)+parseInt(_0x538da0(0x1f1))/0xb;if(_0x5f5bae===_0x35795a)break;else _0xb217da['push'](_0xb217da['shift']());}catch(_0x3ec75b){_0xb217da['push'](_0xb217da['shift']());}}}(_0x2d83,0xd046c));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';function _0x4c60(_0x2bd818,_0x530a9b){_0x2bd818=_0x2bd818-0x1d5;const _0x2d83ff=_0x2d83();let _0x4c605a=_0x2d83ff[_0x2bd818];return _0x4c605a;}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=_0x3fcc4a=>_0x3921db(0x1dc)+_0x3fcc4a+_0x3921db(0x238),link=(_0x450904,_0x97a9fa)=>'\x1b]8;;file://'+_0x450904+'\x07'+(_0x97a9fa||_0x450904)+_0x3921db(0x248);function _0x2d83(){const _0x3197f9=['API\x20Environment:\x20','details','19544oQhTfz','UZgju','disabled','push','Root:\x20','SnpuS','organizationName','UdKYN','ranger@trailhead','\x20[local]','4768467DThsVN','stdout','scope','name','HByie','configured','yizYw','hCGSe','aqPAn','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','filter','settings.json','no\x20session','none','version','(not\x20found)','GDLgW','data','log','bqdFV','bulwc','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','unknown','Organization:\x20','error','CseLz','11871xJaYoj','1575138bYTFXZ','bhoDS','\x20\x20Run:\x20ranger\x20skillup','env','isDirectory','includes','\x0a\x20\x20No\x20active\x20profile\x20set','FPzAZ','WotlD','\x20(active)','toString','auth.json','sXEeT','MqEsq','isActive','GSLGD','6pjxNgb','CaupT','\x20\x20\x20\x20Session:\x20','kldDd','WoMyi','GaNLi','ejMgz','displayName','status','bEkbD','isArray','41147UieKos','success','\x20\x20\x20\x20','\x20\x20User-level:','4783820qPbaYx','not_configured','ZxpHe','ePavf','\x20plugin(s)\x20configured','dSjdJ','yuOdF','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','API\x20Token:\x20✗\x20Not\x20found','vckbN','mWqwM','12120wHkUiO','dVbRv','\x1b[0m','\x20\x20Run:\x20ranger\x20setup\x20[token]','CMSAD','No\x20profiles\x20configured','5EweVGn','4648pGIuUa','has','opencode-plugin','\x20\x20Not\x20installed','plugin','user','path','API\x20URL:\x20','\x20cloud','debug','AJuRw','\x1b]8;;\x07','hasPlaintextAuth','\x20\x20Project-level:','some','join','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','sessionUpdatedAt','vNcQE','\x20\x20Run:\x20ranger\x20update','\x0a---\x20OpenCode\x20Plugin\x20---','\x20profiles\x20configured\x20(','zykIK','YHnRh','DEBUG','map','\x1b[1m','No\x20skills\x20installed','2389626AioikE','length','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','\x20local','not_installed','hasEncryptedAuth','aUZnC'];_0x2d83=function(){return _0x3197f9;};return _0x2d83();}async function getOpencodePluginStatus(){const _0x5f0a98=_0x3921db,_0x28f0dd={'rKDjL':'string','Uhhmh':function(_0x23ea1e,_0x31290d,_0x38c173,_0x29be17){return _0x23ea1e(_0x31290d,_0x38c173,_0x29be17);},'GDLgW':'opencode','ePavf':'config','PpZvy':'ignore','UZgju':'pipe','QahDm':_0x5f0a98(0x202),'MqEsq':_0x5f0a98(0x209)};return new Promise(_0x54af18=>{const _0x2f5a64=_0x5f0a98,_0x38ff1e={'GSLGD':function(_0x3a22fa,_0x4aabeb){return _0x3a22fa!==_0x4aabeb;},'YHnRh':_0x28f0dd['rKDjL'],'ZxpHe':function(_0x1793aa,_0x49e5a0){return _0x1793aa(_0x49e5a0);},'UdKYN':_0x2f5a64(0x1e2),'hjUDl':function(_0x238b65,_0x4ce181){return _0x238b65(_0x4ce181);},'ouqiG':_0x2f5a64(0x22c)},_0xa151b8=_0x28f0dd['Uhhmh'](spawn,_0x28f0dd[_0x2f5a64(0x201)],[_0x2f5a64(0x246),_0x28f0dd[_0x2f5a64(0x22e)]],{'stdio':[_0x28f0dd['PpZvy'],_0x28f0dd[_0x2f5a64(0x1e8)],'pipe']});let _0x43e490='';_0xa151b8[_0x2f5a64(0x1f2)]?.['on'](_0x28f0dd['QahDm'],_0x5d2057=>{const _0x4faac3=_0x2f5a64;_0x43e490+=_0x5d2057[_0x4faac3(0x216)]();}),_0xa151b8['stderr']?.['on'](_0x28f0dd['QahDm'],_0x3b335d=>{_0x43e490+=_0x3b335d['toString']();}),_0xa151b8['on'](_0x28f0dd[_0x2f5a64(0x219)],()=>{_0x54af18({'status':'not_installed'});}),_0xa151b8['on']('close',_0x277673=>{const _0x190bab=_0x2f5a64;if(_0x277673!==0x0){_0x38ff1e[_0x190bab(0x22d)](_0x54af18,{'status':_0x38ff1e[_0x190bab(0x1ee)]});return;}const _0x2ef133=_0x43e490['trim']();let _0x5790ae=null;if(_0x2ef133)try{_0x5790ae=JSON['parse'](_0x2ef133);}catch{const _0x315d13=_0x2ef133['match'](/\{[\s\S]*\}$/);if(_0x315d13)try{_0x5790ae=JSON['parse'](_0x315d13[0x0]);}catch{_0x5790ae=null;}}const _0x2b3d12=Array[_0x190bab(0x226)](_0x5790ae?.[_0x190bab(0x241)])?_0x5790ae?.[_0x190bab(0x241)]:[],_0x240a77=_0x2b3d12[_0x190bab(0x24b)](_0x34b87f=>{const _0x32c014=_0x190bab;if(_0x38ff1e[_0x32c014(0x21b)](typeof _0x34b87f,_0x38ff1e[_0x32c014(0x1d9)]))return![];return _0x34b87f['includes']('@ranger-testing/opencode-plugin')||_0x34b87f['includes'](_0x32c014(0x23f));});if(_0x240a77){_0x38ff1e['ZxpHe'](_0x54af18,{'status':_0x190bab(0x1f6),'details':_0x2b3d12[_0x190bab(0x1df)]>0x0?_0x2b3d12[_0x190bab(0x1df)]+_0x190bab(0x22f):undefined});return;}if(_0x2b3d12['length']>0x0){_0x38ff1e['hjUDl'](_0x54af18,{'status':_0x38ff1e['ouqiG'],'details':_0x2b3d12['length']+'\x20plugin(s)\x20configured'});return;}_0x38ff1e['hjUDl'](_0x54af18,{'status':'not_configured'});});});}async function getSkillsFromDir(_0x16d9e6,_0x516005){const _0x28a2d9=_0x3921db,_0x5439d8={'hoUgS':function(_0x1a1b22,_0x542075,_0x3d8b7c,_0x113e06){return _0x1a1b22(_0x542075,_0x3d8b7c,_0x113e06);},'dSjdJ':function(_0x1d16d4,_0x517c5a,_0x23562f){return _0x1d16d4(_0x517c5a,_0x23562f);}};if(!existsSync(_0x16d9e6))return[];const _0x254591=[];try{const _0xd2c5aa=await readdir(_0x16d9e6,{'withFileTypes':!![]});for(const _0x11eb7f of _0xd2c5aa){if(_0x11eb7f[_0x28a2d9(0x210)]()){const _0x5907ec=_0x5439d8['hoUgS'](join,_0x16d9e6,_0x11eb7f['name'],'SKILL.md');if(existsSync(_0x5907ec)){let _0x130bb7=_0x11eb7f[_0x28a2d9(0x1f4)];try{const _0xa801d4=await _0x5439d8[_0x28a2d9(0x230)](readFile,_0x5907ec,'utf-8'),_0x546873=_0xa801d4['match'](/name:\s*(.+)/);_0x546873&&(_0x130bb7=_0x546873[0x1]['trim']());}catch{}_0x254591[_0x28a2d9(0x1ea)]({'name':_0x11eb7f[_0x28a2d9(0x1f4)],'displayName':_0x130bb7,'path':_0x5907ec,'level':_0x516005});}}}}catch{return[];}return _0x254591;}async function getInstalledSkills(){const _0x1c2c0d=_0x3921db,_0x369084={'yuOdF':function(_0x57507f,_0x246aef,_0x58e95b){return _0x57507f(_0x246aef,_0x58e95b);},'RRoJh':function(_0x283c79){return _0x283c79();},'aUZnC':_0x1c2c0d(0x242)},[_0x571a29,_0x458ddb]=await Promise['all']([_0x369084[_0x1c2c0d(0x231)](getSkillsFromDir,_0x369084['RRoJh'](getProjectSkillsDir),'project'),_0x369084[_0x1c2c0d(0x231)](getSkillsFromDir,getUserSkillsDir(),_0x369084[_0x1c2c0d(0x1e4)])]);return{'project':_0x571a29,'user':_0x458ddb};}async function getEnvironments(){const _0x16ab3b=_0x3921db,_0x1e4074={'CseLz':function(_0x501ea4,_0x52d503){return _0x501ea4(_0x52d503);},'Zscmj':function(_0x20c2d9,_0x21007c,_0x4b6cf7){return _0x20c2d9(_0x21007c,_0x4b6cf7);},'isHEh':_0x16ab3b(0x1fc),'vckbN':function(_0x1efa0a,_0x36dc06,_0x11d2d2){return _0x1efa0a(_0x36dc06,_0x11d2d2);},'TmQan':function(_0x51b03a,_0x4024ed,_0x4da9e7){return _0x51b03a(_0x4024ed,_0x4da9e7);},'sXMRl':_0x16ab3b(0x200),'zykIK':function(_0x547a06,_0x5cef80){return _0x547a06(_0x5cef80);},'AJuRw':function(_0x2d7a16,_0x3edf8c){return _0x2d7a16===_0x3edf8c;},'CMSAD':function(_0x3ec811){return _0x3ec811();}},{envNames:_0x2320bb,activeEnv:_0x190532}=await getEnvNames(),_0xe7d4e3=_0x1e4074[_0x16ab3b(0x23a)](getRangerDir);if(!_0x1e4074['CseLz'](existsSync,_0xe7d4e3))return{'envs':[],'activeEnv':null};const _0x3fc242=_0x2320bb[_0x16ab3b(0x1db)](_0x98a6d3=>{const _0x3b7c69=_0x16ab3b,_0x1a11f1=_0x1e4074[_0x3b7c69(0x20a)](getEnvDir,_0x98a6d3),_0x59b7af=_0x1e4074['Zscmj'](join,_0x1a11f1,_0x1e4074['isHEh']),_0x273cf1=_0x1e4074[_0x3b7c69(0x234)](join,_0x1a11f1,_0x3b7c69(0x217)),_0x16bc59=_0x1e4074['TmQan'](join,_0x1a11f1,'auth.json.enc');return{'name':_0x98a6d3,'settingsPath':_0x1e4074['CseLz'](existsSync,_0x59b7af)?_0x59b7af:_0x1e4074['sXMRl'],'hasPlaintextAuth':existsSync(_0x273cf1),'hasEncryptedAuth':_0x1e4074[_0x3b7c69(0x1d8)](existsSync,_0x16bc59),'isActive':_0x1e4074[_0x3b7c69(0x247)](_0x98a6d3,_0x190532)};});return{'envs':_0x3fc242,'activeEnv':_0x190532};}export async function status(){const _0x374b92=_0x3921db,_0x3196de={'bEkbD':'\x0a📊\x20Ranger\x20Status\x0a','dVbRv':function(_0x1f6f0a,_0x3733c7){return _0x1f6f0a(_0x3733c7);},'GaNLi':function(_0x2ed6bf,_0x29ae1d,_0x41809c){return _0x2ed6bf(_0x29ae1d,_0x41809c);},'gIMhb':function(_0x5ccefe,_0x5326d8){return _0x5ccefe(_0x5326d8);},'hCGSe':function(_0x1c11e1,_0x401cf6){return _0x1c11e1(_0x401cf6);},'jktVn':function(_0x4ff89b){return _0x4ff89b();},'PLpDp':function(_0x44897d){return _0x44897d();},'FPzAZ':function(_0x2c1ae3){return _0x2c1ae3();},'oZfhI':function(_0x33d92b,_0x3e1300){return _0x33d92b(_0x3e1300);},'WotlD':function(_0x378f01){return _0x378f01();},'CaupT':function(_0x1e95d3){return _0x1e95d3();},'BSZmw':_0x374b92(0x1d6),'WoMyi':function(_0x57aca,_0x5eceab){return _0x57aca===_0x5eceab;},'kldDd':'configured','sXEeT':'@ranger-testing/opencode-plugin','EPlos':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','TpZsL':_0x374b92(0x207),'GbLJt':'enabled','bulwc':'ranger@trailhead','yizYw':_0x374b92(0x240),'bhoDS':function(_0x2448b0,_0xe94796){return _0x2448b0>_0xe94796;},'yZSBH':_0x374b92(0x24a),'aqPAn':_0x374b92(0x22a),'jpgls':function(_0x2ec58a,_0x5e4eea,_0xa00d05){return _0x2ec58a(_0x5e4eea,_0xa00d05);},'CufAs':function(_0x3d0945,_0x3d4d94){return _0x3d0945(_0x3d4d94);},'SnpuS':function(_0x14e701){return _0x14e701();},'bMzDP':function(_0x565ef8,_0x5372d3){return _0x565ef8+_0x5372d3;},'mWqwM':function(_0x18284a,_0x2766ac){return _0x18284a===_0x2766ac;},'bqdFV':function(_0x41288d,_0x27bde0){return _0x41288d>_0x27bde0;},'HByie':function(_0x11781a,_0x52e860){return _0x11781a>_0x52e860;},'qdLRs':function(_0x4570a9,_0x40baf8){return _0x4570a9(_0x40baf8);},'ejMgz':_0x374b92(0x215),'vNcQE':_0x374b92(0x1fd),'rutFK':'encrypted','kIkjB':_0x374b92(0x1fe)};console[_0x374b92(0x203)](_0x3196de[_0x374b92(0x225)]);const _0x5b6f98=process['cwd'](),_0x5bd9ce=getRangerDir();if(!_0x3196de['dVbRv'](existsSync,_0x5bd9ce)){console[_0x374b92(0x203)](_0x374b92(0x1eb)+_0x3196de['GaNLi'](link,_0x5b6f98,_0x3196de['dVbRv'](bold,basename(_0x5b6f98)))),console['log']('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log'](_0x374b92(0x1e0));return;}console[_0x374b92(0x203)](_0x374b92(0x1eb)+_0x3196de[_0x374b92(0x221)](link,_0x5b6f98,_0x3196de['gIMhb'](bold,_0x3196de[_0x374b92(0x1f8)](basename,_0x5b6f98))));const _0x3d3883=_0x3196de['jktVn'](getCurrentVersion),_0x351423=_0x3196de['PLpDp'](getLatestVersion);if(_0x351423['version']&&_0x351423[_0x374b92(0x1ff)]!==_0x3d3883)console[_0x374b92(0x203)]('Version:\x20'+_0x3d3883+'\x20(latest:\x20'+_0x351423['version']+')'),console['log'](_0x374b92(0x1d5));else _0x351423[_0x374b92(0x1ff)]?console['log']('Version:\x20'+_0x3d3883+'\x20(up\x20to\x20date)'):console[_0x374b92(0x203)]('Version:\x20'+_0x3d3883);const _0x3e1219=await _0x3196de[_0x374b92(0x213)](getToken);if(_0x3e1219){const _0x16b28b=await _0x3196de['oZfhI'](getCurrentUser,_0x3e1219);_0x16b28b[_0x374b92(0x228)]?console['log'](_0x374b92(0x208)+_0x3196de[_0x374b92(0x1f8)](bold,_0x16b28b['user'][_0x374b92(0x1ed)])):(console['log'](_0x374b92(0x232)),console[_0x374b92(0x203)](_0x374b92(0x239)));}else console[_0x374b92(0x203)](_0x374b92(0x233)),console[_0x374b92(0x203)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0x374b92(0x20f)][_0x374b92(0x1da)]&&(console['log'](_0x374b92(0x1e5)+_0x3196de[_0x374b92(0x214)](getCurrentEnvironment)),console['log'](_0x374b92(0x244)+_0x3196de[_0x374b92(0x21d)](getApiBaseUrl)));console[_0x374b92(0x203)](_0x3196de['BSZmw']);const _0xb80109=await getOpencodePluginStatus();if(_0x3196de[_0x374b92(0x220)](_0xb80109['status'],_0x3196de[_0x374b92(0x21f)]))console[_0x374b92(0x203)]('\x20\x20'+bold(_0x3196de[_0x374b92(0x218)])+':\x20configured'),_0xb80109[_0x374b92(0x1e6)]&&console[_0x374b92(0x203)]('\x20\x20'+_0xb80109['details']);else _0xb80109[_0x374b92(0x224)]==='not_configured'?(console['log']('\x20\x20Not\x20configured'),_0xb80109['details']&&console[_0x374b92(0x203)]('\x20\x20'+_0xb80109['details']),console[_0x374b92(0x203)]('\x20\x20Run:\x20ranger\x20setup\x20--opencode')):console[_0x374b92(0x203)](_0x3196de['EPlos']);console[_0x374b92(0x203)]('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x58c0ea=await getPluginInfo(_0x374b92(0x1ef));if(_0x58c0ea){const _0x2659f4=_0x58c0ea[_0x374b92(0x1f3)]||_0x3196de['TpZsL'],_0x3a88e5=_0x58c0ea['enabled']?_0x3196de['GbLJt']:_0x374b92(0x1e9);console['log']('\x20\x20'+_0x3196de['hCGSe'](bold,_0x3196de[_0x374b92(0x205)])+':\x20installed\x20('+_0x2659f4+',\x20'+_0x3a88e5+')');}else console['log'](_0x3196de[_0x374b92(0x1f7)]),console[_0x374b92(0x203)](_0x374b92(0x24d));console['log']('\x0a---\x20Skills\x20---');const {project:_0x2fb3ca,user:_0x286ba4}=await _0x3196de['CaupT'](getInstalledSkills),_0x143d73=_0x2fb3ca['filter'](_0x136558=>RANGER_MANAGED_SKILLS[_0x374b92(0x211)](_0x136558['name'])),_0x2aa5b=_0x286ba4[_0x374b92(0x1fb)](_0x3cd494=>RANGER_MANAGED_SKILLS['includes'](_0x3cd494[_0x374b92(0x1f4)])),_0x2f9da4=_0x143d73['length']+_0x2aa5b['length'];if(_0x2f9da4===0x0)console['log'](_0x374b92(0x1dd)),console['log'](_0x374b92(0x20e));else{if(_0x3196de[_0x374b92(0x20d)](_0x143d73[_0x374b92(0x1df)],0x0)){console['log'](_0x3196de['yZSBH']);for(const _0x4c3d99 of _0x143d73){console[_0x374b92(0x203)]('\x20\x20\x20\x20'+bold(_0x4c3d99[_0x374b92(0x223)])+':\x20'+link(_0x4c3d99[_0x374b92(0x243)],_0x3196de['oZfhI'](basename,_0x4c3d99[_0x374b92(0x243)])));}}if(_0x2aa5b['length']>0x0){console['log'](_0x3196de[_0x374b92(0x1f9)]);for(const _0xa7d7b3 of _0x2aa5b){console[_0x374b92(0x203)](_0x374b92(0x229)+_0x3196de[_0x374b92(0x237)](bold,_0xa7d7b3[_0x374b92(0x223)])+':\x20'+_0x3196de['jpgls'](link,_0xa7d7b3[_0x374b92(0x243)],_0x3196de['CufAs'](basename,_0xa7d7b3[_0x374b92(0x243)])));}}}console[_0x374b92(0x203)]('\x0a---\x20Profiles\x20---');const {envs:_0x3ced86,activeEnv:_0x548a17}=await getEnvironments();let _0x4db6f4=[];if(_0x3e1219)try{_0x4db6f4=await _0x3196de[_0x374b92(0x1ec)](listCloudProfiles);}catch{}const _0x254811=_0x3196de['bMzDP'](_0x3ced86['length'],_0x4db6f4['length']);if(_0x3196de[_0x374b92(0x235)](_0x254811,0x0))console[_0x374b92(0x203)](_0x374b92(0x23b)),console[_0x374b92(0x203)](_0x374b92(0x1fa));else{if(_0x3196de[_0x374b92(0x204)](_0x254811,0x5)){const _0x353bdd=[];_0x3196de[_0x374b92(0x1f5)](_0x4db6f4['length'],0x0)&&_0x353bdd[_0x374b92(0x1ea)](_0x4db6f4[_0x374b92(0x1df)]+_0x374b92(0x245)),_0x3196de['HByie'](_0x3ced86[_0x374b92(0x1df)],0x0)&&_0x353bdd['push'](_0x3ced86[_0x374b92(0x1df)]+_0x374b92(0x1e1)),console['log'](_0x254811+_0x374b92(0x1d7)+_0x353bdd['join'](',\x20')+')'),_0x548a17&&console[_0x374b92(0x203)]('\x20\x20Active:\x20'+_0x3196de['qdLRs'](bold,_0x548a17)),console[_0x374b92(0x203)]('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x426412 of _0x4db6f4){const _0x2b6dc7=_0x426412[_0x374b92(0x1f4)]===_0x548a17?_0x3196de[_0x374b92(0x222)]:'';console[_0x374b92(0x203)]('\x20\x20'+bold(_0x426412[_0x374b92(0x1f4)])+'\x20[cloud]'+_0x2b6dc7);const _0xf16729=_0x426412['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x426412[_0x374b92(0x24e)]+')':_0x3196de[_0x374b92(0x24f)];console[_0x374b92(0x203)](_0x374b92(0x21e)+_0xf16729);}const _0x45e7da=new Set(_0x4db6f4[_0x374b92(0x1db)](_0x47e938=>_0x47e938[_0x374b92(0x1f4)]));for(const _0x39f8c0 of _0x3ced86){if(_0x45e7da[_0x374b92(0x23e)](_0x39f8c0[_0x374b92(0x1f4)]))continue;const _0x54457a=_0x39f8c0[_0x374b92(0x21a)]?_0x3196de[_0x374b92(0x222)]:'',_0x32b428=_0x39f8c0[_0x374b92(0x1e3)]?_0x3196de['rutFK']:_0x39f8c0[_0x374b92(0x249)]?'plaintext':_0x3196de['kIkjB'];console['log']('\x20\x20'+bold(_0x39f8c0[_0x374b92(0x1f4)])+_0x374b92(0x1f0)+_0x54457a),console['log']('\x20\x20\x20\x20Auth:\x20'+_0x32b428),_0x39f8c0['settingsPath']!==_0x374b92(0x200)&&console[_0x374b92(0x203)]('\x20\x20\x20\x20Settings:\x20'+link(_0x39f8c0['settingsPath'],basename(_0x39f8c0['settingsPath'])));}if(!_0x548a17){console[_0x374b92(0x203)](_0x374b92(0x212));const _0x36257b=[..._0x4db6f4['map'](_0x1fecd1=>_0x1fecd1['name']),..._0x3ced86['filter'](_0x382a3f=>!_0x45e7da['has'](_0x382a3f[_0x374b92(0x1f4)]))[_0x374b92(0x1db)](_0x36937f=>_0x36937f['name'])];console['log'](_0x374b92(0x206)+_0x36257b[_0x374b92(0x24c)](',\x20')+')');}}}console['log']('');}
|