@ranger-testing/ranger-cli 2.5.4-alpha.36a12ca-10 → 2.5.4-alpha.5f9facb-17
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/README.md +36 -14
- 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/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 -0
- 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/opencodeConfig.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/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/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/skills/ranger/SKILL.md +24 -8
- package/build/skills/ranger/create.md +16 -3
- package/build/skills/ranger/verify.md +35 -10
- package/package.json +3 -2
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4b540f,_0x28529b){const _0x5706cc=_0x3cab,_0x5a2f0a=_0x4b540f();while(!![]){try{const _0x3b9357=parseInt(_0x5706cc(0x141))/0x1*(parseInt(_0x5706cc(0x155))/0x2)+parseInt(_0x5706cc(0x154))/0x3*(-parseInt(_0x5706cc(0x143))/0x4)+parseInt(_0x5706cc(0x150))/0x5+parseInt(_0x5706cc(0x14a))/0x6*(parseInt(_0x5706cc(0x153))/0x7)+parseInt(_0x5706cc(0x142))/0x8*(parseInt(_0x5706cc(0x14c))/0x9)+-parseInt(_0x5706cc(0x152))/0xa*(parseInt(_0x5706cc(0x149))/0xb)+parseInt(_0x5706cc(0x14b))/0xc*(-parseInt(_0x5706cc(0x144))/0xd);if(_0x3b9357===_0x28529b)break;else _0x5a2f0a['push'](_0x5a2f0a['shift']());}catch(_0x521f78){_0x5a2f0a['push'](_0x5a2f0a['shift']());}}}(_0x474f,0x7116d));function _0x474f(){const _0x354b0d=['36QLHXUB','18fQAWZB','success','hNlAw','log','3044075pbMBZM','Re-authenticating\x20via\x20MCP\x20bootstrap...','3786250xbgVuD','10759TNkYFz','1212MNljSq','170dtNwnp','2104UjDvFD','3389592lcNfSI','8636dSBOXo','1462526UlesRh','Login\x20failed:\x20','\x0a✅\x20API\x20key\x20stored\x20successfully','organizationName','isTTY','11oeIvJZ','1626YZUjBL'];_0x474f=function(){return _0x354b0d;};return _0x474f();}import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';function _0x3cab(_0x411baf,_0x23f8ee){_0x411baf=_0x411baf-0x141;const _0x474f84=_0x474f();let _0x3cab9c=_0x474f84[_0x411baf];return _0x3cab9c;}export async function login(){const _0x3ccb9d=_0x3cab,_0xf5c425={'hNlAw':function(_0x4a6c40){return _0x4a6c40();},'fPbbl':function(_0x33457f,_0x3d579d){return _0x33457f(_0x3d579d);},'oKazM':function(_0x2494ad,_0x2f6cdb){return _0x2494ad instanceof _0x2f6cdb;}},_0x1a114f=await getMcpAuthOrigin();if(_0x1a114f){console['log'](_0x3ccb9d(0x151)),await _0xf5c425[_0x3ccb9d(0x14e)](mcpBootstrap);return;}const _0x1324ba=process['stdin']['isTTY']&&process['stdout'][_0x3ccb9d(0x148)];if(!_0x1324ba)throw new Error('Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');try{const _0x1fe778=await runDeviceAuthFlow(),_0x1c6427=await _0xf5c425['fPbbl'](getCurrentUser,_0x1fe778);_0x1c6427[_0x3ccb9d(0x14d)]?console['log']('\x0a✅\x20Logged\x20in\x20to\x20'+_0x1c6427['user'][_0x3ccb9d(0x147)]):console[_0x3ccb9d(0x14f)](_0x3ccb9d(0x146));}catch(_0x31e8c1){throw new Error(_0x3ccb9d(0x145)+(_0xf5c425['oKazM'](_0x31e8c1,Error)?_0x31e8c1['message']:_0x31e8c1));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0xc9d8f1=_0x11c1;(function(_0x5af041,_0x406458){const _0x25b4ec=_0x11c1,_0x11cc8b=_0x5af041();while(!![]){try{const _0x42b8bb=-parseInt(_0x25b4ec(0x11f))/0x1+parseInt(_0x25b4ec(0xb8))/0x2+-parseInt(_0x25b4ec(0xc1))/0x3+-parseInt(_0x25b4ec(0xd0))/0x4*(-parseInt(_0x25b4ec(0x111))/0x5)+-parseInt(_0x25b4ec(0xd5))/0x6+parseInt(_0x25b4ec(0x11b))/0x7*(-parseInt(_0x25b4ec(0x9c))/0x8)+parseInt(_0x25b4ec(0xed))/0x9*(parseInt(_0x25b4ec(0xe5))/0xa);if(_0x42b8bb===_0x406458)break;else _0x11cc8b['push'](_0x11cc8b['shift']());}catch(_0x5d6018){_0x11cc8b['push'](_0x11cc8b['shift']());}}}(_0x7598,0x80059));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';function _0x7598(){const _0x19a1c9=['redirect_uri','\x20done','Bearer\x20','registration_endpoint','4197972xsvxSD','\x0aToken\x20written\x20to\x20','client_secret','ksYcO','LWNnb','result','YTtNe','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','darwin','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','sLSwv','origin','refresh.txt','SFEwz','WjTVO','aAaKW','13260470ZOZIyd','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','application/json,\x20text/event-stream','accessToken','FoSJJ','HTTP\x20','jBycq','glVWv','9PQlied','StSCA','then','APZdC','WdNmY','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','nKNSJ','Initializing\x20MCP\x20session...','response_type','code','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','string','platform','parse','end','initialize','uyPEg','smkLn','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','VBnBO','searchParams','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','http://localhost:','2.0','utf-8','Dlwqj','writeHead','write','jVTXA','access_token','Ranger\x20CLI','bBoeE','undqQ','AGuIm','stringify','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','2511285NumkhQ','\x0aOpening\x20browser\x20for\x20authentication...','match','vpJgj','structuredContent','content','SJwNb','authorization_endpoint','expiresAt','status','56FqYSqr','Requesting\x20CLI\x20token...','coPAa','content-type','122177tOUKFO','SpKXs','text/event-stream','start','name','WRYSh','clientId','HXhPj','error','clientSecret','ocPuH','jnpWs','Kxleb','Hyfur','application/json','text','type','tDqZt','split','code_challenge_method','tools/call','client_id','get_cli_token\x20failed:\x20','2025-03-26','stdout','log','601712hoMjuM','pRlxa','Exchanging\x20authorization\x20code...','text/html','cyBDZ','set','authorization_code','base64url','kfTxL','application/x-www-form-urlencoded','token','GVrAe','MCP\x20initialize\x20failed:\x20','JcOgB','authorization_servers','sha256','PiDCw','vaLMP','QyCHY','POST','cpBFA','ItRgP','YgZAB','/.well-known/oauth-protected-resource','slice','rtdWL','aejfY','resource','887166bEWMjO','zdKGH','sqlZK','/callback','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','Authorization','Unknown\x20error','state','get','2478648NSpdBH','json','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','refresh_token','.ranger','zFErV','close','needs-oauth','update','1.0.0','message','/.well-known/oauth-authorization-server','UcDWF','win32','XXTsv','8vxuQoX'];_0x7598=function(){return _0x19a1c9;};return _0x7598();}import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),_0xc9d8f1(0xc5),'auth-origin.txt');export async function getMcpAuthOrigin(){const _0x12cb3b=_0xc9d8f1,_0x5a90ec={'bDago':_0x12cb3b(0x105)};try{const _0x4438f7=(await readFile(AUTH_ORIGIN_PATH,_0x5a90ec['bDago']))['trim']();return _0x4438f7||null;}catch{return null;}}export async function mcpBootstrap(){const _0x2ea947=_0xc9d8f1,_0x42b429={'ZQthr':function(_0x4fee91){return _0x4fee91();},'HXhPj':function(_0x4463fc,_0x2088f0){return _0x4463fc(_0x2088f0);},'JcOgB':_0x2ea947(0xc3),'ocPuH':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'},_0x9381b8=_0x42b429['ZQthr'](getMcpAuthUrl);currentOrigin=_0x9381b8;const _0x133e4c=process[_0x2ea947(0x9a)]['isTTY']??![];console['log'](_0x2ea947(0xf7)+_0x9381b8+'\x0a');const _0x1be46d=await _0x42b429[_0x2ea947(0x126)](tryUnauthenticated,_0x9381b8);let _0x12bae2=null;if(_0x1be46d==='proxied')_0x12bae2='';else{_0x12bae2=await loadCachedToken();if(!_0x12bae2){if(!_0x133e4c)throw new Error(_0x42b429[_0x2ea947(0xa9)]+_0x42b429[_0x2ea947(0x129)]);_0x12bae2=await _0x42b429['HXhPj'](oauthFlow,_0x9381b8);}}await callGetCliToken(_0x9381b8,_0x12bae2);}async function tryUnauthenticated(_0x508d6){const _0x293699=_0xc9d8f1,_0x107580={'PtdSe':'application/json,\x20text/event-stream','XXTsv':'2.0','smkLn':_0x293699(0xfc),'vaLMP':_0x293699(0xca)},_0x169896=await fetch(_0x508d6,{'method':_0x293699(0xaf),'headers':{'Content-Type':'application/json','Accept':_0x107580['PtdSe']},'body':JSON[_0x293699(0x10f)]({'jsonrpc':_0x107580[_0x293699(0xcf)],'id':0x1,'method':_0x107580[_0x293699(0xfe)],'params':{'protocolVersion':_0x293699(0x99),'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x107580[_0x293699(0xad)]}}})});if(_0x169896['ok'])return await _0x169896[_0x293699(0x91)](),'proxied';if(_0x169896[_0x293699(0x11a)]===0x191)return await _0x169896['text'](),_0x293699(0xc8);const _0x393a56=await _0x169896[_0x293699(0x91)]();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x169896['status']+':\x20'+_0x393a56);}class OAuthTimeoutError extends Error{constructor(_0x34a9a3){const _0x1ba92a=_0xc9d8f1;super(_0x34a9a3),this[_0x1ba92a(0x123)]='OAuthTimeoutError';}}function _0x11c1(_0x530cef,_0x359032){_0x530cef=_0x530cef-0x8d;const _0x7598d2=_0x7598();let _0x11c128=_0x7598d2[_0x530cef];return _0x11c128;}async function oauthFlow(_0x4e0e0b){const _0x5ec0b1=_0xc9d8f1,_0x352788={'SFEwz':function(_0x19350f,_0x2b0981){return _0x19350f(_0x2b0981);},'PiDCw':function(_0x5ae3b0,_0x56d22e){return _0x5ae3b0 instanceof _0x56d22e;}};try{return await _0x352788[_0x5ec0b1(0xe2)](oauthFlowAttempt,_0x4e0e0b);}catch(_0x3e7088){if(_0x352788[_0x5ec0b1(0xac)](_0x3e7088,OAuthTimeoutError)&&await loadCachedClient())return console['log']('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await clearCachedClient(),await oauthFlowAttempt(_0x4e0e0b);throw _0x3e7088;}}async function oauthFlowAttempt(_0x28ad06){const _0x143047=_0xc9d8f1,_0x351c26={'cpBFA':'Discovering\x20authorization\x20server...','Ezjax':function(_0x481497,_0x5e8d09){return _0x481497(_0x5e8d09);},'yAlZy':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','YeTEF':_0x143047(0xdc),'nsqBp':function(_0x255aa1){return _0x255aa1();},'yasFP':function(_0x4fe51d,_0xdfb0f,_0x450107){return _0x4fe51d(_0xdfb0f,_0x450107);},'LSnmB':_0x143047(0xaf),'WnbvG':_0x143047(0x90),'YgZAB':_0x143047(0x10b),'APZdC':_0x143047(0xa2),'FeCNS':'refresh_token','Dlwqj':'\x20done','rtdWL':'base64url','YTtNe':function(_0x2c79a8,_0x3ecb2b){return _0x2c79a8(_0x3ecb2b);},'FoSJJ':'hex','YniNl':_0x143047(0xf5),'cyBDZ':'code','uyPEg':'S256','sqlZK':'resource'},_0x509923=_0x28ad06['replace'](/\/mcp$/,'');process['stdout']['write'](_0x351c26[_0x143047(0xb0)]);const _0x26b739=await _0x351c26['Ezjax'](fetch,_0x509923+_0x143047(0xb3));if(!_0x26b739['ok'])throw new Error(_0x351c26['yAlZy']);const _0x402cf4=await _0x26b739['json'](),_0x1da09d=_0x402cf4[_0x143047(0xaa)]?.[0x0];if(!_0x1da09d)throw new Error(_0x351c26['YeTEF']);console[_0x143047(0x9b)]('\x20'+_0x1da09d);const _0x3220eb=await fetchAuthServerMetadata(_0x1da09d);let _0x592625,_0x297318;const _0x34f156=await _0x351c26['nsqBp'](loadCachedClient);if(_0x34f156)_0x592625=_0x34f156[_0x143047(0x125)],_0x297318=_0x34f156[_0x143047(0x128)];else{if(_0x3220eb[_0x143047(0xd4)]){process['stdout'][_0x143047(0x108)]('Registering\x20OAuth\x20client...');const _0x564c8e=await _0x351c26['yasFP'](fetch,_0x3220eb[_0x143047(0xd4)],{'method':_0x351c26['LSnmB'],'headers':{'Content-Type':_0x351c26['WnbvG']},'body':JSON['stringify']({'client_name':_0x351c26[_0x143047(0xb2)],'redirect_uris':[_0x143047(0x103)+CALLBACK_PORT+_0x143047(0xbb)],'grant_types':[_0x351c26[_0x143047(0xf0)],_0x351c26['FeCNS']],'response_types':[_0x143047(0xf6)],'token_endpoint_auth_method':'none'})});if(!_0x564c8e['ok']){const _0x26cd60=await _0x564c8e[_0x143047(0x91)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x26cd60);}const _0x25410d=await _0x564c8e[_0x143047(0xc2)]();_0x592625=_0x25410d[_0x143047(0x97)],_0x297318=_0x25410d['client_secret'],await saveCachedClient(_0x592625,_0x297318),console[_0x143047(0x9b)](_0x351c26[_0x143047(0x106)]);}else throw new Error(_0x143047(0xbc));}const _0x5bf08c=randomBytes(0x20)['toString'](_0x143047(0xa3)),_0x22fedb=createHash(_0x143047(0xab))[_0x143047(0xc9)](_0x5bf08c)['digest'](_0x351c26[_0x143047(0xb5)]),_0x42f82e=_0x351c26[_0x143047(0xdb)](randomBytes,0x10)['toString'](_0x351c26[_0x143047(0xe9)]),_0x59d8c0=new URL(_0x3220eb[_0x143047(0x118)]);_0x59d8c0['searchParams'][_0x143047(0xa1)](_0x351c26['YniNl'],_0x351c26[_0x143047(0xa0)]),_0x59d8c0['searchParams']['set'](_0x143047(0x97),_0x592625),_0x59d8c0[_0x143047(0x101)]['set'](_0x143047(0xd1),_0x143047(0x103)+CALLBACK_PORT+_0x143047(0xbb)),_0x59d8c0[_0x143047(0x101)][_0x143047(0xa1)]('code_challenge',_0x22fedb),_0x59d8c0['searchParams'][_0x143047(0xa1)](_0x143047(0x95),_0x351c26[_0x143047(0xfd)]),_0x59d8c0[_0x143047(0x101)]['set'](_0x143047(0xbf),_0x42f82e);_0x402cf4['resource']&&_0x59d8c0['searchParams'][_0x143047(0xa1)](_0x351c26['sqlZK'],_0x402cf4[_0x143047(0xb7)]);console[_0x143047(0x9b)](_0x143047(0x112)),console['log'](_0x143047(0xe6)+_0x59d8c0['toString']()+'\x0a'),await openBrowser(_0x59d8c0['toString']());const _0x120719=await _0x351c26['YTtNe'](waitForCallback,_0x42f82e);process['stdout']['write'](_0x143047(0x9e));const _0x4b2ce6=new URLSearchParams({'grant_type':'authorization_code','code':_0x120719,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0x592625,'code_verifier':_0x5bf08c});_0x297318&&_0x4b2ce6['set'](_0x143047(0xd7),_0x297318);_0x402cf4[_0x143047(0xb7)]&&_0x4b2ce6['set'](_0x351c26[_0x143047(0xba)],_0x402cf4['resource']);const _0x5ea6f7=await fetch(_0x3220eb['token_endpoint'],{'method':_0x351c26['LSnmB'],'headers':{'Content-Type':_0x143047(0xa5)},'body':_0x4b2ce6});if(!_0x5ea6f7['ok']){const _0xae28ce=await _0x5ea6f7['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0xae28ce);}const _0x36f069=await _0x5ea6f7['json']();return console[_0x143047(0x9b)](_0x351c26[_0x143047(0x106)]),await saveCachedToken(_0x36f069[_0x143047(0x10a)],_0x36f069[_0x143047(0xc4)],_0x36f069['expires_in']),_0x36f069[_0x143047(0x10a)];}async function callGetCliToken(_0x2ec370,_0x152358){const _0x312aab=_0xc9d8f1,_0x5490ff={'glVWv':'application/json','jBycq':_0x312aab(0xbd),'JSCEW':function(_0x50f1dd,_0x5dfd3c){return _0x50f1dd(_0x5dfd3c);},'Kxleb':_0x312aab(0x104),'dPZRr':'initialize','jnpWs':_0x312aab(0x99),'UfghE':_0x312aab(0xca),'AGuIm':'\x20done','UcDWF':function(_0x53db54,_0x307b40,_0xda3b62){return _0x53db54(_0x307b40,_0xda3b62);},'ksYcO':'POST','sLSwv':_0x312aab(0x11c),'UZUsu':function(_0x48787c,_0x38c7a3){return _0x48787c(_0x38c7a3);},'whbDl':_0x312aab(0x96),'nKNSJ':'get_cli_token','zFErV':'\x0aUnexpected\x20response\x20structure:','WCEXq':function(_0x342f02){return _0x342f02();},'WRYSh':_0x312aab(0xe1),'LRlcO':function(_0x538dc2,_0x9cfce4,_0x4b65ee){return _0x538dc2(_0x9cfce4,_0x4b65ee);},'nQskX':function(_0x1ea759,_0x204f8d,_0x64749,_0x2907c0){return _0x1ea759(_0x204f8d,_0x64749,_0x2907c0);},'SpKXs':'auth-origin.txt'},_0x448b90={'Content-Type':_0x5490ff[_0x312aab(0xec)],'Accept':_0x312aab(0xe7)};_0x152358&&(_0x448b90[_0x5490ff[_0x312aab(0xeb)]]=_0x312aab(0xd3)+_0x152358);const _0x5bbe96=async _0x3acc50=>{const _0x133564=_0x312aab,_0x16bd3d=await fetch(_0x2ec370,{'method':'POST','headers':_0x448b90,'body':JSON['stringify'](_0x3acc50)});if(!_0x16bd3d['ok']){const _0x48f874=await _0x16bd3d[_0x133564(0x91)]();throw new Error(_0x133564(0xea)+_0x16bd3d[_0x133564(0x11a)]+':\x20'+_0x48f874);}return parseResponse(_0x16bd3d);};process['stdout']['write'](_0x312aab(0xf4));const _0x61e397=await _0x5490ff['JSCEW'](_0x5bbe96,{'jsonrpc':_0x5490ff['Kxleb'],'id':0x1,'method':_0x5490ff['dPZRr'],'params':{'protocolVersion':_0x5490ff[_0x312aab(0x8d)],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x5490ff['UfghE']}}});if(_0x61e397[_0x312aab(0x127)])throw new Error(_0x312aab(0xa8)+(_0x61e397[_0x312aab(0x127)][_0x312aab(0xcb)]??JSON[_0x312aab(0x10f)](_0x61e397['error'])));console[_0x312aab(0x9b)](_0x5490ff[_0x312aab(0x10e)]),await _0x5490ff['UcDWF'](fetch,_0x2ec370,{'method':_0x5490ff[_0x312aab(0xd8)],'headers':_0x448b90,'body':JSON[_0x312aab(0x10f)]({'jsonrpc':_0x5490ff[_0x312aab(0x8e)],'method':'notifications/initialized'})})[_0x312aab(0xef)](_0x46a9c6=>_0x46a9c6[_0x312aab(0x91)]()),process['stdout'][_0x312aab(0x108)](_0x5490ff[_0x312aab(0xdf)]);const _0x42476d=await _0x5490ff['UZUsu'](_0x5bbe96,{'jsonrpc':_0x5490ff[_0x312aab(0x8e)],'id':0x2,'method':_0x5490ff['whbDl'],'params':{'name':_0x5490ff[_0x312aab(0xf3)],'arguments':{}}});if(_0x42476d[_0x312aab(0x127)])throw new Error(_0x312aab(0x98)+(_0x42476d[_0x312aab(0x127)]['message']??JSON['stringify'](_0x42476d[_0x312aab(0x127)])));console['log'](_0x312aab(0xd2));const _0x3169ff=extractToken(_0x42476d['result']);if(!_0x3169ff){console[_0x312aab(0x127)](_0x5490ff[_0x312aab(0xc6)]),console[_0x312aab(0x127)](JSON['stringify'](_0x42476d[_0x312aab(0xda)],null,0x2));throw new Error(_0x312aab(0xf2));}const _0x15cdad=_0x5490ff['UcDWF'](join,_0x5490ff['WCEXq'](homedir),'.ranger'),_0x2402e3=_0x5490ff[_0x312aab(0xcd)](join,_0x15cdad,_0x5490ff[_0x312aab(0x124)]);await _0x5490ff['LRlcO'](mkdir,_0x15cdad,{'recursive':!![]}),await _0x5490ff['nQskX'](writeFile,_0x2402e3,_0x3169ff,{'mode':0x180}),await writeFile(join(_0x15cdad,_0x5490ff[_0x312aab(0x120)]),_0x2ec370,{'mode':0x180}),console[_0x312aab(0x9b)](_0x312aab(0xd6)+_0x2402e3),console['log']('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0x3743b6){const _0x305863=_0xc9d8f1,_0x4506c4=_0x3743b6+_0x305863(0xcc),_0xe00ffe=await fetch(_0x4506c4);if(!_0xe00ffe['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x4506c4+':\x20'+_0xe00ffe['status']);return _0xe00ffe[_0x305863(0xc2)]();}function waitForCallback(_0x4a310e){const _0x23a6bc=_0xc9d8f1,_0x5ab5d0={'iBiCq':function(_0x1de444,_0x107852){return _0x1de444!==_0x107852;},'aAaKW':_0x23a6bc(0xf6),'coPAa':_0x23a6bc(0xbf),'avGzg':_0x23a6bc(0xff),'WjTVO':'text/html','GBKvs':_0x23a6bc(0xde),'tiNQr':function(_0x525586,_0x1f93af,_0x282352){return _0x525586(_0x1f93af,_0x282352);},'EMmkG':function(_0x3f3d22,_0x2a4703){return _0x3f3d22(_0x2a4703);},'hOJZo':'127.0.0.1'};return new Promise((_0x1c3c82,_0x5208d5)=>{const _0x38d58f=_0x23a6bc,_0x1f97e6={'WJgdb':function(_0xc6b4ff,_0x5048e9){return _0x5ab5d0['iBiCq'](_0xc6b4ff,_0x5048e9);},'UxeqG':_0x5ab5d0[_0x38d58f(0xe4)],'aejfY':_0x5ab5d0[_0x38d58f(0x11d)],'ItRgP':'error','bBoeE':'error_description','pRlxa':_0x5ab5d0['avGzg'],'SJwNb':_0x5ab5d0[_0x38d58f(0xe3)],'StSCA':_0x5ab5d0['GBKvs'],'tDqZt':function(_0x21659e,_0x5c99ba){return _0x21659e(_0x5c99ba);}},_0x5db271=_0x5ab5d0['tiNQr'](setTimeout,()=>{const _0x5e4ba3=_0x38d58f;_0x108eec[_0x5e4ba3(0xc7)](),_0x5208d5(new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x108eec=_0x5ab5d0['EMmkG'](createServer,(_0x1e8cdf,_0x1fd188)=>{const _0x209f4a=_0x38d58f,_0x2f96e2=new URL(_0x1e8cdf['url']??'/',_0x209f4a(0x103)+CALLBACK_PORT);if(_0x1f97e6['WJgdb'](_0x2f96e2['pathname'],_0x209f4a(0xbb))){_0x1fd188['writeHead'](0x194),_0x1fd188[_0x209f4a(0xfb)]('Not\x20found');return;}const _0x3a57a3=_0x2f96e2['searchParams'][_0x209f4a(0xc0)](_0x1f97e6['UxeqG']),_0x2cacfa=_0x2f96e2[_0x209f4a(0x101)]['get'](_0x1f97e6[_0x209f4a(0xb6)]),_0x1353d6=_0x2f96e2[_0x209f4a(0x101)]['get'](_0x1f97e6[_0x209f4a(0xb1)]);if(_0x1353d6){const _0x144f07=_0x2f96e2['searchParams']['get'](_0x1f97e6[_0x209f4a(0x10c)])??_0x1353d6;_0x1fd188['writeHead'](0xc8,{'Content-Type':_0x209f4a(0x9f)}),_0x1fd188[_0x209f4a(0xfb)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x144f07+_0x209f4a(0x110)),clearTimeout(_0x5db271),_0x108eec[_0x209f4a(0xc7)](),_0x5208d5(new Error('OAuth\x20error:\x20'+_0x144f07));return;}if(!_0x3a57a3||_0x2cacfa!==_0x4a310e){_0x1fd188[_0x209f4a(0x107)](0x190,{'Content-Type':_0x209f4a(0x9f)}),_0x1fd188[_0x209f4a(0xfb)](_0x1f97e6[_0x209f4a(0x9d)]);return;}_0x1fd188['writeHead'](0xc8,{'Content-Type':_0x1f97e6[_0x209f4a(0x117)]}),_0x1fd188['end'](_0x1f97e6[_0x209f4a(0xee)]),clearTimeout(_0x5db271),_0x108eec[_0x209f4a(0xc7)](),_0x1f97e6[_0x209f4a(0x93)](_0x1c3c82,_0x3a57a3);});_0x108eec['listen'](CALLBACK_PORT,_0x5ab5d0['hOJZo']);});}async function openBrowser(_0x2bfef4){const _0x34164b=_0xc9d8f1,_0x322a34={'kfTxL':function(_0x449b7c,_0x55f654){return _0x449b7c===_0x55f654;},'VBnBO':_0x34164b(0xce),'ZLOIG':_0x34164b(0x122),'undqQ':function(_0x5e50d7,_0x17900e){return _0x5e50d7(_0x17900e);}},{exec:_0x54b444}=await import('child_process'),_0x5a93f3=process['platform']===_0x34164b(0xdd)?'open':_0x322a34[_0x34164b(0xa4)](process[_0x34164b(0xf9)],_0x322a34[_0x34164b(0x100)])?_0x322a34['ZLOIG']:'xdg-open';_0x322a34[_0x34164b(0x10d)](_0x54b444,_0x5a93f3+'\x20\x22'+_0x2bfef4+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x5c4a2b=_0xc9d8f1,_0x1f6746={'LWNnb':'utf-8','QyCHY':function(_0x345628,_0x162edb){return _0x345628!==_0x162edb;}};try{const _0x4b1566=JSON[_0x5c4a2b(0xfa)](await readFile(TOKEN_CACHE_PATH,_0x1f6746[_0x5c4a2b(0xd9)]));if(_0x4b1566[_0x5c4a2b(0xe0)]&&_0x1f6746[_0x5c4a2b(0xae)](_0x4b1566[_0x5c4a2b(0xe0)],currentOrigin))return null;if(_0x4b1566[_0x5c4a2b(0x119)]&&Date['now']()>_0x4b1566['expiresAt'])return null;return _0x4b1566['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x24df88,_0x555d49,_0x249ffd){const _0x5a8d03=_0xc9d8f1,_0x4ec214={'JBVlM':function(_0x4dd153,_0x331a60){return _0x4dd153+_0x331a60;},'bVraq':function(_0x372a8b,_0x21b872,_0x4e801d){return _0x372a8b(_0x21b872,_0x4e801d);}},_0x59c617=await loadCachedData(),_0x254ee5={..._0x59c617,'origin':currentOrigin,'accessToken':_0x24df88,'refreshToken':_0x555d49??_0x59c617?.['refreshToken'],'expiresAt':_0x249ffd?_0x4ec214['JBVlM'](Date['now'](),_0x249ffd*0x3e8):undefined};await mkdir(_0x4ec214['bVraq'](join,homedir(),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x5a8d03(0x10f)](_0x254ee5),{'mode':0x180});}async function loadCachedClient(){const _0x22c714=_0xc9d8f1,_0x481ce0={'csWAu':function(_0x36a6e3){return _0x36a6e3();}},_0x7aef1d=await _0x481ce0['csWAu'](loadCachedData);if(_0x7aef1d?.['origin']&&_0x7aef1d['origin']!==currentOrigin)return null;return _0x7aef1d?.[_0x22c714(0x125)]?{'clientId':_0x7aef1d[_0x22c714(0x125)],'clientSecret':_0x7aef1d['clientSecret']}:null;}async function clearCachedClient(){const _0x3e3a03=_0xc9d8f1,_0x2cc70c={'zdKGH':function(_0x1c986c,_0x5144e2,_0x3b26f7,_0x5bf84f){return _0x1c986c(_0x5144e2,_0x3b26f7,_0x5bf84f);}},_0x8469d6=await loadCachedData();if(!_0x8469d6)return;const {clientId:_0x3e18a9,clientSecret:_0x6b1eb9,..._0x57d19f}=_0x8469d6;await _0x2cc70c[_0x3e3a03(0xb9)](writeFile,TOKEN_CACHE_PATH,JSON[_0x3e3a03(0x10f)](_0x57d19f),{'mode':0x180});}async function saveCachedClient(_0x367d3a,_0x527940){const _0x5346e=_0xc9d8f1,_0x579c39={'GVrAe':function(_0x40b18f){return _0x40b18f();},'rNiEX':function(_0x55a648){return _0x55a648();},'jVTXA':_0x5346e(0xc5),'nLinv':function(_0x440415,_0x40bd68,_0x4c2344,_0x45d07b){return _0x440415(_0x40bd68,_0x4c2344,_0x45d07b);}},_0x1d546f=await _0x579c39[_0x5346e(0xa7)](loadCachedData),_0x4a448a={..._0x1d546f,'origin':currentOrigin,'accessToken':_0x1d546f?.[_0x5346e(0xe8)]??'','clientId':_0x367d3a,'clientSecret':_0x527940};await mkdir(join(_0x579c39['rNiEX'](homedir),_0x579c39[_0x5346e(0x109)]),{'recursive':!![]}),await _0x579c39['nLinv'](writeFile,TOKEN_CACHE_PATH,JSON[_0x5346e(0x10f)](_0x4a448a),{'mode':0x180});}async function loadCachedData(){const _0x1eebf1=_0xc9d8f1;try{return JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x1eebf1(0x105)));}catch{return null;}}async function parseResponse(_0x4d3ed3){const _0x5f588c=_0xc9d8f1,_0x5b5ea7={'CWMwV':_0x5f588c(0x11e),'Hyfur':'data:','WdNmY':_0x5f588c(0x102)},_0xe6bc4f=_0x4d3ed3['headers']['get'](_0x5b5ea7['CWMwV'])??'';if(_0xe6bc4f['includes'](_0x5f588c(0x121))){const _0x3f1463=await _0x4d3ed3[_0x5f588c(0x91)]();for(const _0x470c0c of _0x3f1463[_0x5f588c(0x94)]('\x0a')){const _0x4e3f77=_0x470c0c['trim']();if(_0x4e3f77['startsWith'](_0x5b5ea7['Hyfur'])){const _0x483ec6=_0x4e3f77[_0x5f588c(0xb4)](_0x5b5ea7[_0x5f588c(0x8f)]['length'])['trim']();if(!_0x483ec6)continue;try{const _0x1a6cdd=JSON['parse'](_0x483ec6);if(_0x1a6cdd['id']!==undefined||_0x1a6cdd[_0x5f588c(0x127)])return _0x1a6cdd;}catch{}}}throw new Error(_0x5b5ea7[_0x5f588c(0xf1)]);}return _0x4d3ed3['json']();}function extractToken(_0x593008){const _0x4b5d91=_0xc9d8f1,_0x5beafe={'mdiHU':function(_0x244016,_0x33da44){return _0x244016===_0x33da44;},'SXUzd':'string','vpJgj':function(_0xa6651c,_0x3c260f){return _0xa6651c===_0x3c260f;}};if(!_0x593008)return null;const _0x40c606=_0x593008[_0x4b5d91(0x115)];if(_0x40c606?.[_0x4b5d91(0xa6)]&&_0x5beafe['mdiHU'](typeof _0x40c606['token'],_0x5beafe['SXUzd']))return _0x40c606['token'];if(_0x593008['isError']){const _0x413b97=_0x593008[_0x4b5d91(0x116)];throw new Error('Server\x20returned\x20error:\x20'+(_0x413b97?.[0x0]?.[_0x4b5d91(0x91)]??_0x4b5d91(0xbe)));}const _0x51b1a3=_0x593008[_0x4b5d91(0x116)];if(_0x51b1a3)for(const _0x4e799f of _0x51b1a3){if(_0x5beafe[_0x4b5d91(0x114)](_0x4e799f[_0x4b5d91(0x92)],_0x4b5d91(0x91))&&_0x4e799f['text']){try{const _0x4cdd77=JSON[_0x4b5d91(0xfa)](_0x4e799f['text']);if(typeof _0x4cdd77?.[_0x4b5d91(0xa6)]===_0x4b5d91(0xf8))return _0x4cdd77['token'];}catch{}const _0x12692e=_0x4e799f['text'][_0x4b5d91(0x113)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x12692e)return _0x12692e[0x1];}}return null;}
|
|
1
|
+
const _0x5af043=_0x1381;(function(_0x4787a8,_0x47f0d8){const _0x1d1671=_0x1381,_0x2475b6=_0x4787a8();while(!![]){try{const _0x3dcd59=parseInt(_0x1d1671(0x1cd))/0x1+-parseInt(_0x1d1671(0x1c6))/0x2*(-parseInt(_0x1d1671(0x20d))/0x3)+-parseInt(_0x1d1671(0x1de))/0x4+-parseInt(_0x1d1671(0x1ee))/0x5+-parseInt(_0x1d1671(0x1f8))/0x6+parseInt(_0x1d1671(0x1fe))/0x7*(parseInt(_0x1d1671(0x1f9))/0x8)+-parseInt(_0x1d1671(0x234))/0x9*(-parseInt(_0x1d1671(0x238))/0xa);if(_0x3dcd59===_0x47f0d8)break;else _0x2475b6['push'](_0x2475b6['shift']());}catch(_0x50ef44){_0x2475b6['push'](_0x2475b6['shift']());}}}(_0x4406,0x80ef2));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),_0x5af043(0x1dd),'auth-origin.txt');export async function getMcpAuthOrigin(){const _0x4c26e6=_0x5af043,_0x52760f={'sJjrY':function(_0x348904,_0x1fa6ea,_0x33e298){return _0x348904(_0x1fa6ea,_0x33e298);},'twWwv':function(_0x5236e9,_0x13ccbb){return _0x5236e9||_0x13ccbb;}};try{const _0x359656=(await _0x52760f['sJjrY'](readFile,AUTH_ORIGIN_PATH,_0x4c26e6(0x1da)))['trim']();return _0x52760f['twWwv'](_0x359656,null);}catch{return null;}}export async function mcpBootstrap(){const _0x35249e=_0x5af043,_0x39c320={'ShqHf':function(_0x5e9dbc,_0xc504a8){return _0x5e9dbc===_0xc504a8;},'TqZzM':_0x35249e(0x1f1),'uusZm':function(_0xaba29c){return _0xaba29c();},'EBMbJ':function(_0x1e72f5,_0x31ff10){return _0x1e72f5+_0x31ff10;},'vgNat':_0x35249e(0x226)},_0x568b40=getMcpAuthUrl();currentOrigin=_0x568b40;const _0x189737=process['stdout']['isTTY']??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x568b40+'\x0a');const _0x34c12c=await tryUnauthenticated(_0x568b40);let _0x56fbf6=null;if(_0x39c320[_0x35249e(0x1e6)](_0x34c12c,_0x39c320['TqZzM']))_0x56fbf6='';else{_0x56fbf6=await _0x39c320['uusZm'](loadCachedToken);if(!_0x56fbf6){if(!_0x189737)throw new Error(_0x39c320['EBMbJ']('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a',_0x39c320['vgNat']));_0x56fbf6=await oauthFlow(_0x568b40);}}await callGetCliToken(_0x568b40,_0x56fbf6);}async function tryUnauthenticated(_0x3ef349){const _0x3034c2=_0x5af043,_0x34b046={'AeysS':function(_0x4dd09f,_0x490dbe,_0x1f1dae){return _0x4dd09f(_0x490dbe,_0x1f1dae);},'uFuAF':'initialize','ZaRhE':'1.0.0','eaOzt':'proxied','CKnLm':function(_0x26c62e,_0xb0695d){return _0x26c62e===_0xb0695d;}},_0x10319c=await _0x34b046[_0x3034c2(0x213)](fetch,_0x3ef349,{'method':_0x3034c2(0x1e7),'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x1,'method':_0x34b046[_0x3034c2(0x243)],'params':{'protocolVersion':_0x3034c2(0x21f),'capabilities':{},'clientInfo':{'name':_0x3034c2(0x1fb),'version':_0x34b046['ZaRhE']}}})});if(_0x10319c['ok'])return await _0x10319c['text'](),_0x34b046['eaOzt'];if(_0x34b046[_0x3034c2(0x235)](_0x10319c[_0x3034c2(0x21b)],0x191))return await _0x10319c[_0x3034c2(0x1f3)](),_0x3034c2(0x1f4);const _0x1c3778=await _0x10319c[_0x3034c2(0x1f3)]();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x10319c[_0x3034c2(0x21b)]+':\x20'+_0x1c3778);}class OAuthTimeoutError extends Error{constructor(_0x106295){const _0x533783=_0x5af043,_0x165ca8={'YIEQx':'OAuthTimeoutError'};super(_0x106295),this[_0x533783(0x20c)]=_0x165ca8[_0x533783(0x1f2)];}}async function oauthFlow(_0x2dee2e){const _0x350d6c=_0x5af043,_0x44e69={'MVJNW':function(_0x4d9db4,_0x133c8d){return _0x4d9db4(_0x133c8d);},'ZFgsx':function(_0x214c4a,_0x2149f4){return _0x214c4a instanceof _0x2149f4;},'BTFQg':function(_0x4668f4){return _0x4668f4();}};try{return await _0x44e69['MVJNW'](oauthFlowAttempt,_0x2dee2e);}catch(_0x5e9a73){if(_0x44e69[_0x350d6c(0x229)](_0x5e9a73,OAuthTimeoutError)&&await _0x44e69['BTFQg'](loadCachedClient))return console['log']('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await _0x44e69[_0x350d6c(0x1fd)](clearCachedClient),await oauthFlowAttempt(_0x2dee2e);throw _0x5e9a73;}}async function oauthFlowAttempt(_0x5e1110){const _0x253eef=_0x5af043,_0x3ce480={'OhOqk':function(_0x2406d3,_0x3c2b4e){return _0x2406d3(_0x3c2b4e);},'wiKBc':_0x253eef(0x245),'nDmby':function(_0x431641){return _0x431641();},'mQrMY':'Registering\x20OAuth\x20client...','Tlixa':'sha256','KyfEC':_0x253eef(0x206),'BgHRs':'response_type','tkAJh':_0x253eef(0x233),'YJXzr':_0x253eef(0x21c),'mWEYh':'code_challenge_method','oqfbV':_0x253eef(0x1ce),'TmCUp':function(_0x53896f,_0x22d0d1){return _0x53896f(_0x22d0d1);},'lKrJj':'Exchanging\x20authorization\x20code...','lgQwe':_0x253eef(0x23c),'gIRCY':'POST','hOCoM':_0x253eef(0x1f7)},_0x434ad3=_0x5e1110[_0x253eef(0x1ef)](/\/mcp$/,'');process['stdout'][_0x253eef(0x228)]('Discovering\x20authorization\x20server...');const _0x39ab01=await _0x3ce480['OhOqk'](fetch,_0x434ad3+'/.well-known/oauth-protected-resource');if(!_0x39ab01['ok'])throw new Error(_0x3ce480[_0x253eef(0x1e9)]);const _0x2a1715=await _0x39ab01[_0x253eef(0x23f)](),_0x5a12cd=_0x2a1715[_0x253eef(0x1d6)]?.[0x0];if(!_0x5a12cd)throw new Error(_0x253eef(0x217));console['log']('\x20'+_0x5a12cd);const _0x4d6a48=await _0x3ce480[_0x253eef(0x1f5)](fetchAuthServerMetadata,_0x5a12cd);let _0x173c2e,_0x520593;const _0x1a4df5=await _0x3ce480['nDmby'](loadCachedClient);if(_0x1a4df5)_0x173c2e=_0x1a4df5['clientId'],_0x520593=_0x1a4df5[_0x253eef(0x1dc)];else{if(_0x4d6a48['registration_endpoint']){process[_0x253eef(0x224)][_0x253eef(0x228)](_0x3ce480[_0x253eef(0x1ea)]);const _0x258fc1=await fetch(_0x4d6a48['registration_endpoint'],{'method':_0x253eef(0x1e7),'headers':{'Content-Type':_0x253eef(0x22d)},'body':JSON[_0x253eef(0x203)]({'client_name':'Ranger\x20CLI','redirect_uris':[_0x253eef(0x1eb)+CALLBACK_PORT+_0x253eef(0x1be)],'grant_types':['authorization_code',_0x253eef(0x1e4)],'response_types':['code'],'token_endpoint_auth_method':_0x253eef(0x241)})});if(!_0x258fc1['ok']){const _0x5d4275=await _0x258fc1[_0x253eef(0x1f3)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x5d4275);}const _0x446cfa=await _0x258fc1[_0x253eef(0x23f)]();_0x173c2e=_0x446cfa['client_id'],_0x520593=_0x446cfa[_0x253eef(0x23c)],await saveCachedClient(_0x173c2e,_0x520593),console['log']('\x20done');}else throw new Error(_0x253eef(0x1d3));}const _0x1930e7=randomBytes(0x20)[_0x253eef(0x1e8)](_0x253eef(0x206)),_0x93920d=createHash(_0x3ce480[_0x253eef(0x1e1)])[_0x253eef(0x216)](_0x1930e7)[_0x253eef(0x1b9)](_0x3ce480['KyfEC']),_0x370349=_0x3ce480[_0x253eef(0x1f5)](randomBytes,0x10)[_0x253eef(0x1e8)]('hex'),_0x548652=new URL(_0x4d6a48['authorization_endpoint']);_0x548652[_0x253eef(0x1d2)][_0x253eef(0x227)](_0x3ce480[_0x253eef(0x22b)],_0x3ce480[_0x253eef(0x20b)]),_0x548652['searchParams'][_0x253eef(0x227)]('client_id',_0x173c2e),_0x548652[_0x253eef(0x1d2)][_0x253eef(0x227)](_0x3ce480[_0x253eef(0x1bf)],'http://localhost:'+CALLBACK_PORT+_0x253eef(0x1be)),_0x548652['searchParams'][_0x253eef(0x227)]('code_challenge',_0x93920d),_0x548652['searchParams'][_0x253eef(0x227)](_0x3ce480[_0x253eef(0x205)],_0x3ce480[_0x253eef(0x1c0)]),_0x548652['searchParams']['set']('state',_0x370349);_0x2a1715[_0x253eef(0x1ca)]&&_0x548652[_0x253eef(0x1d2)][_0x253eef(0x227)](_0x253eef(0x1ca),_0x2a1715['resource']);console[_0x253eef(0x23d)]('\x0aOpening\x20browser\x20for\x20authentication...'),console[_0x253eef(0x23d)](_0x253eef(0x1cf)+_0x548652[_0x253eef(0x1e8)]()+'\x0a'),await _0x3ce480[_0x253eef(0x1c2)](openBrowser,_0x548652['toString']());const _0x58f3d4=await waitForCallback(_0x370349);process[_0x253eef(0x224)]['write'](_0x3ce480['lKrJj']);const _0x1614a4=new URLSearchParams({'grant_type':'authorization_code','code':_0x58f3d4,'redirect_uri':_0x253eef(0x1eb)+CALLBACK_PORT+'/callback','client_id':_0x173c2e,'code_verifier':_0x1930e7});_0x520593&&_0x1614a4['set'](_0x3ce480['lgQwe'],_0x520593);_0x2a1715[_0x253eef(0x1ca)]&&_0x1614a4['set']('resource',_0x2a1715[_0x253eef(0x1ca)]);const _0x1f3a41=await fetch(_0x4d6a48['token_endpoint'],{'method':_0x3ce480[_0x253eef(0x240)],'headers':{'Content-Type':_0x253eef(0x1ba)},'body':_0x1614a4});if(!_0x1f3a41['ok']){const _0x2c1b77=await _0x1f3a41[_0x253eef(0x1f3)]();throw new Error(_0x253eef(0x1df)+_0x2c1b77);}const _0x3eace8=await _0x1f3a41[_0x253eef(0x23f)]();return console[_0x253eef(0x23d)](_0x3ce480['hOCoM']),await saveCachedToken(_0x3eace8['access_token'],_0x3eace8['refresh_token'],_0x3eace8['expires_in']),_0x3eace8['access_token'];}async function callGetCliToken(_0x43a1fa,_0x8ceea6){const _0x49bed5=_0x5af043,_0x381bef={'pfxFO':_0x49bed5(0x1e7),'KGSuP':'application/json','dyPKP':_0x49bed5(0x1d5),'hApfk':_0x49bed5(0x207),'LKZfR':function(_0x4a57f0,_0x9b79ca){return _0x4a57f0(_0x9b79ca);},'bNmcL':_0x49bed5(0x1f0),'qJaxG':_0x49bed5(0x1c7),'btBII':'ranger-cli','YKvyr':_0x49bed5(0x1cc),'fCRvQ':'notifications/initialized','jeUsn':'get_cli_token','SDfVE':'\x20done','FBNRO':function(_0x4fb8a4,_0x397253){return _0x4fb8a4(_0x397253);},'Prsgz':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','xzMsL':'.ranger','waUVy':_0x49bed5(0x1e2),'pavEp':function(_0x40388d,_0x1c906c,_0x28adf2){return _0x40388d(_0x1c906c,_0x28adf2);},'HGbJy':function(_0x245a2c,_0x153089,_0x3a2d22,_0xfbb866){return _0x245a2c(_0x153089,_0x3a2d22,_0xfbb866);},'qtGFt':_0x49bed5(0x22c)},_0x5a8ee7={'Content-Type':_0x381bef[_0x49bed5(0x1d7)],'Accept':'application/json,\x20text/event-stream'};_0x8ceea6&&(_0x5a8ee7[_0x381bef['dyPKP']]=_0x49bed5(0x218)+_0x8ceea6);const _0xef1e36=async _0x8e4eb2=>{const _0x4a086f=_0x49bed5,_0x71fef6=await fetch(_0x43a1fa,{'method':_0x381bef['pfxFO'],'headers':_0x5a8ee7,'body':JSON['stringify'](_0x8e4eb2)});if(!_0x71fef6['ok']){const _0x6a7604=await _0x71fef6[_0x4a086f(0x1f3)]();throw new Error(_0x4a086f(0x1d1)+_0x71fef6[_0x4a086f(0x21b)]+':\x20'+_0x6a7604);}return parseResponse(_0x71fef6);};process['stdout'][_0x49bed5(0x228)](_0x381bef[_0x49bed5(0x208)]);const _0x1a8ac0=await _0x381bef['LKZfR'](_0xef1e36,{'jsonrpc':_0x381bef['bNmcL'],'id':0x1,'method':_0x381bef['qJaxG'],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x381bef['btBII'],'version':_0x381bef['YKvyr']}}});if(_0x1a8ac0[_0x49bed5(0x201)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x1a8ac0[_0x49bed5(0x201)]['message']??JSON[_0x49bed5(0x203)](_0x1a8ac0['error'])));console['log']('\x20done'),await fetch(_0x43a1fa,{'method':_0x381bef[_0x49bed5(0x1bc)],'headers':_0x5a8ee7,'body':JSON[_0x49bed5(0x203)]({'jsonrpc':'2.0','method':_0x381bef[_0x49bed5(0x215)]})})[_0x49bed5(0x246)](_0x537b14=>_0x537b14['text']()),process['stdout']['write']('Requesting\x20CLI\x20token...');const _0x446bb4=await _0x381bef[_0x49bed5(0x230)](_0xef1e36,{'jsonrpc':_0x381bef['bNmcL'],'id':0x2,'method':_0x49bed5(0x212),'params':{'name':_0x381bef['jeUsn'],'arguments':{}}});if(_0x446bb4['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x446bb4[_0x49bed5(0x201)][_0x49bed5(0x1c5)]??JSON['stringify'](_0x446bb4['error'])));console['log'](_0x381bef['SDfVE']);const _0x2e7b58=_0x381bef[_0x49bed5(0x219)](extractToken,_0x446bb4['result']);if(!_0x2e7b58){console['error']('\x0aUnexpected\x20response\x20structure:'),console[_0x49bed5(0x201)](JSON['stringify'](_0x446bb4['result'],null,0x2));throw new Error(_0x381bef['Prsgz']);}const _0x4e403b=join(homedir(),_0x381bef[_0x49bed5(0x23a)]),_0x9572a9=join(_0x4e403b,_0x381bef[_0x49bed5(0x1d0)]);await _0x381bef[_0x49bed5(0x239)](mkdir,_0x4e403b,{'recursive':!![]}),await _0x381bef[_0x49bed5(0x23e)](writeFile,_0x9572a9,_0x2e7b58,{'mode':0x180}),await writeFile(join(_0x4e403b,_0x381bef[_0x49bed5(0x232)]),_0x43a1fa,{'mode':0x180}),console['log'](_0x49bed5(0x242)+_0x9572a9),console[_0x49bed5(0x23d)]('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}function _0x4406(){const _0x4a98c0=['then','trim','digest','application/x-www-form-urlencoded','GHOxr','pfxFO','FVAPL','/callback','YJXzr','oqfbV','end','TmCUp','writeHead','NigEY','message','10etjnHp','initialize','ELmaY','WlReq','resource','kBrTd','1.0.0','82541WfJFsq','S256','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','waUVy','HTTP\x20','searchParams','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','type','Authorization','authorization_servers','KGSuP','parse','VvPMb','utf-8','Not\x20found','clientSecret','.ranger','4074456WTPeFC','Token\x20exchange\x20failed:\x20','txiwS','Tlixa','refresh.txt','JrExy','refresh_token','data:','ShqHf','POST','toString','wiKBc','mQrMY','http://localhost:','win32','slice','4804045ysRQfI','replace','2.0','proxied','YIEQx','text','needs-oauth','OhOqk','pathname','\x20done','4048386APdcJF','312qqJQtm','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','ranger-cli','length','BTFQg','168987aMtjLz','close','<html><body><h2>Authentication\x20failed</h2><p>','error','isError','stringify','text/html','mWEYh','base64url','Initializing\x20MCP\x20session...','hApfk','token','get','tkAJh','name','115719SBBpnV','origin','text/event-stream','now','structuredContent','tools/call','AeysS','yjHla','fCRvQ','update','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','Bearer\x20','FBNRO','tFvBZ','status','redirect_uri','vJonN','platform','2025-03-26','refreshToken','127.0.0.1','expiresAt','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','stdout','string','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','set','write','ZFgsx','LDwRj','BgHRs','auth-origin.txt','application/json','OAuth\x20error:\x20','xBOWV','LKZfR','url','qtGFt','code','17688267ZzAIxC','CKnLm','aDfdV','Hpmzh','10MKohfA','pavEp','xzMsL','MhoIa','client_secret','log','HGbJy','json','gIRCY','none','\x0aToken\x20written\x20to\x20','uFuAF','darwin','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server'];_0x4406=function(){return _0x4a98c0;};return _0x4406();}async function fetchAuthServerMetadata(_0x576fb7){const _0x3deb7c=_0x5af043,_0x37e43f={'KQiLv':function(_0x11454e,_0x4a7daf){return _0x11454e(_0x4a7daf);}},_0x39a769=_0x576fb7+'/.well-known/oauth-authorization-server',_0x1fa728=await _0x37e43f['KQiLv'](fetch,_0x39a769);if(!_0x1fa728['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x39a769+':\x20'+_0x1fa728['status']);return _0x1fa728[_0x3deb7c(0x23f)]();}function waitForCallback(_0x80e1fd){const _0x13b260=_0x5af043,_0xf096d={'yjHla':function(_0x317014){return _0x317014();},'vJonN':function(_0x2d2d41,_0x2e1b34){return _0x2d2d41(_0x2e1b34);},'OCDDz':'OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','leJbD':'/callback','UIlDz':_0x13b260(0x1db),'GHOxr':'code','MhoIa':'state','SWYzh':_0x13b260(0x201),'ELmaY':'error_description','SHbNH':_0x13b260(0x204),'ljAzV':function(_0x2590dd,_0x448629){return _0x2590dd(_0x448629);},'xBOWV':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','NigEY':function(_0x1ab39f){return _0x1ab39f();}};return new Promise((_0x1600c6,_0x1a106a)=>{const _0x51f8c2=_0x13b260,_0x377f53=()=>{const _0x22f437=_0x1381;_0x81098f['closeAllConnections'](),_0x81098f[_0x22f437(0x1ff)]();},_0x603bf2=setTimeout(()=>{const _0x3e6e54=_0x1381;_0xf096d[_0x3e6e54(0x214)](_0x377f53),_0xf096d[_0x3e6e54(0x21d)](_0x1a106a,new OAuthTimeoutError(_0xf096d['OCDDz']));},0x1d4c0),_0x81098f=createServer((_0x189b38,_0x31da76)=>{const _0x20c039=_0x1381,_0x3ee442=new URL(_0x189b38[_0x20c039(0x231)]??'/','http://localhost:'+CALLBACK_PORT);if(_0x3ee442[_0x20c039(0x1f6)]!==_0xf096d['leJbD']){_0x31da76['writeHead'](0x194),_0x31da76[_0x20c039(0x1c1)](_0xf096d['UIlDz']);return;}const _0x55fa62=_0x3ee442['searchParams'][_0x20c039(0x20a)](_0xf096d[_0x20c039(0x1bb)]),_0x3562cb=_0x3ee442[_0x20c039(0x1d2)]['get'](_0xf096d[_0x20c039(0x23b)]),_0x192baa=_0x3ee442['searchParams']['get'](_0xf096d['SWYzh']);if(_0x192baa){const _0x2376ea=_0x3ee442['searchParams'][_0x20c039(0x20a)](_0xf096d[_0x20c039(0x1c8)])??_0x192baa;_0x31da76[_0x20c039(0x1c3)](0xc8,{'Content-Type':_0xf096d['SHbNH']}),_0x31da76[_0x20c039(0x1c1)](_0x20c039(0x200)+_0x2376ea+_0x20c039(0x1fa)),_0xf096d['ljAzV'](clearTimeout,_0x603bf2),_0x377f53(),_0xf096d[_0x20c039(0x21d)](_0x1a106a,new Error(_0x20c039(0x22e)+_0x2376ea));return;}if(!_0x55fa62||_0x3562cb!==_0x80e1fd){_0x31da76['writeHead'](0x190,{'Content-Type':'text/html'}),_0x31da76['end'](_0xf096d[_0x20c039(0x22f)]);return;}_0x31da76['writeHead'](0xc8,{'Content-Type':_0x20c039(0x204)}),_0x31da76['end']('<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'),clearTimeout(_0x603bf2),_0xf096d[_0x20c039(0x1c4)](_0x377f53),_0xf096d['vJonN'](_0x1600c6,_0x55fa62);});_0x81098f['listen'](CALLBACK_PORT,_0x51f8c2(0x221));});}async function openBrowser(_0x1c247b){const _0x1bcbf4=_0x5af043,_0x50b949={'HUtSp':_0x1bcbf4(0x244),'LDwRj':'open','Hpmzh':function(_0x3ceae8,_0x1f6902){return _0x3ceae8===_0x1f6902;}},_0x4ecce6=process[_0x1bcbf4(0x21e)]===_0x50b949['HUtSp']?_0x50b949[_0x1bcbf4(0x22a)]:_0x50b949[_0x1bcbf4(0x237)](process['platform'],_0x1bcbf4(0x1ec))?'start':'xdg-open';exec(_0x4ecce6+'\x20\x22'+_0x1c247b+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x59eefd=_0x5af043,_0x2f7a0c={'CnOMJ':'utf-8'};try{const _0x659651=JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x2f7a0c['CnOMJ']));if(_0x659651['origin']&&_0x659651['origin']!==currentOrigin)return null;if(_0x659651[_0x59eefd(0x222)]&&Date[_0x59eefd(0x210)]()>_0x659651['expiresAt'])return null;return _0x659651['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x2c522d,_0x92db09,_0x23ae5f){const _0x49663a=_0x5af043,_0x8517fd={'aDfdV':function(_0x59e8d2,_0xf288a1){return _0x59e8d2+_0xf288a1;},'JrExy':function(_0x5516dd,_0x25eb7f){return _0x5516dd*_0x25eb7f;},'tFvBZ':function(_0x41629f,_0x4e788b,_0x38a90c){return _0x41629f(_0x4e788b,_0x38a90c);},'ztPSJ':function(_0x3f24a8){return _0x3f24a8();}},_0x1041dd=await loadCachedData(),_0x1a8861={..._0x1041dd,'origin':currentOrigin,'accessToken':_0x2c522d,'refreshToken':_0x92db09??_0x1041dd?.[_0x49663a(0x220)],'expiresAt':_0x23ae5f?_0x8517fd[_0x49663a(0x236)](Date[_0x49663a(0x210)](),_0x8517fd[_0x49663a(0x1e3)](_0x23ae5f,0x3e8)):undefined};await _0x8517fd['tFvBZ'](mkdir,_0x8517fd[_0x49663a(0x21a)](join,_0x8517fd['ztPSJ'](homedir),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x1a8861),{'mode':0x180});}async function loadCachedClient(){const _0x2660ae=_0x5af043,_0x5aa981={'VvPMb':function(_0x31b2d7,_0x30f8fa){return _0x31b2d7!==_0x30f8fa;}},_0x1773ab=await loadCachedData();if(_0x1773ab?.[_0x2660ae(0x20e)]&&_0x5aa981[_0x2660ae(0x1d9)](_0x1773ab[_0x2660ae(0x20e)],currentOrigin))return null;return _0x1773ab?.['clientId']?{'clientId':_0x1773ab['clientId'],'clientSecret':_0x1773ab[_0x2660ae(0x1dc)]}:null;}async function clearCachedClient(){const _0x5b43a2=_0x5af043,_0x17f912={'WlReq':function(_0x22de82){return _0x22de82();},'kBrTd':function(_0x45e6f3,_0x3787c6,_0x4fd098,_0x14831f){return _0x45e6f3(_0x3787c6,_0x4fd098,_0x14831f);}},_0x22a2ca=await _0x17f912[_0x5b43a2(0x1c9)](loadCachedData);if(!_0x22a2ca)return;const {clientId:_0x29a38c,clientSecret:_0x457c78,..._0x554e75}=_0x22a2ca;await _0x17f912[_0x5b43a2(0x1cb)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x554e75),{'mode':0x180});}async function saveCachedClient(_0x102b75,_0xcc6f8){const _0x48c4a6=_0x5af043,_0x3ed28a={'UbiCh':function(_0x3d9524,_0x95ba16,_0x395757){return _0x3d9524(_0x95ba16,_0x395757);},'ASZZK':_0x48c4a6(0x1dd),'vTdHp':function(_0xda7b13,_0xcac98b,_0x3102ee,_0x3d0bf9){return _0xda7b13(_0xcac98b,_0x3102ee,_0x3d0bf9);}},_0x762a97=await loadCachedData(),_0xf76122={..._0x762a97,'origin':currentOrigin,'accessToken':_0x762a97?.['accessToken']??'','clientId':_0x102b75,'clientSecret':_0xcc6f8};await mkdir(_0x3ed28a['UbiCh'](join,homedir(),_0x3ed28a['ASZZK']),{'recursive':!![]}),await _0x3ed28a['vTdHp'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0xf76122),{'mode':0x180});}async function loadCachedData(){const _0x5ef90d=_0x5af043;try{return JSON[_0x5ef90d(0x1d8)](await readFile(TOKEN_CACHE_PATH,_0x5ef90d(0x1da)));}catch{return null;}}async function parseResponse(_0x4e8b16){const _0x295513=_0x5af043,_0x575907={'bYYub':'content-type','txiwS':_0x295513(0x20f),'dQDGr':_0x295513(0x1e5),'aRDFq':function(_0x3814cf,_0x7796af){return _0x3814cf!==_0x7796af;}},_0x49e990=_0x4e8b16['headers'][_0x295513(0x20a)](_0x575907['bYYub'])??'';if(_0x49e990['includes'](_0x575907[_0x295513(0x1e0)])){const _0x9146f7=await _0x4e8b16['text']();for(const _0x2a9f0d of _0x9146f7['split']('\x0a')){const _0x58e82a=_0x2a9f0d['trim']();if(_0x58e82a['startsWith'](_0x575907['dQDGr'])){const _0x2907bc=_0x58e82a[_0x295513(0x1ed)]('data:'[_0x295513(0x1fc)])[_0x295513(0x247)]();if(!_0x2907bc)continue;try{const _0x2af126=JSON[_0x295513(0x1d8)](_0x2907bc);if(_0x575907['aRDFq'](_0x2af126['id'],undefined)||_0x2af126['error'])return _0x2af126;}catch{}}}throw new Error(_0x295513(0x223));}return _0x4e8b16[_0x295513(0x23f)]();}function _0x1381(_0x1d30fe,_0x4393a3){_0x1d30fe=_0x1d30fe-0x1b9;const _0x4406d7=_0x4406();let _0x138138=_0x4406d7[_0x1d30fe];return _0x138138;}function extractToken(_0x11c763){const _0x54295d=_0x5af043,_0x5e78ed={'FVAPL':function(_0x123284,_0x2f4427){return _0x123284===_0x2f4427;},'xAcnr':'Unknown\x20error','prQPU':'text','Bjrsj':'string'};if(!_0x11c763)return null;const _0x53d6b=_0x11c763[_0x54295d(0x211)];if(_0x53d6b?.['token']&&_0x5e78ed[_0x54295d(0x1bd)](typeof _0x53d6b[_0x54295d(0x209)],_0x54295d(0x225)))return _0x53d6b[_0x54295d(0x209)];if(_0x11c763[_0x54295d(0x202)]){const _0x1ae648=_0x11c763['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x1ae648?.[0x0]?.['text']??_0x5e78ed['xAcnr']));}const _0x5acb7f=_0x11c763['content'];if(_0x5acb7f)for(const _0x4b5183 of _0x5acb7f){if(_0x5e78ed['FVAPL'](_0x4b5183[_0x54295d(0x1d4)],_0x5e78ed['prQPU'])&&_0x4b5183[_0x54295d(0x1f3)]){try{const _0x2dc7c=JSON['parse'](_0x4b5183['text']);if(typeof _0x2dc7c?.[_0x54295d(0x209)]===_0x5e78ed['Bjrsj'])return _0x2dc7c[_0x54295d(0x209)];}catch{}const _0x5b4e63=_0x4b5183[_0x54295d(0x1f3)]['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x5b4e63)return _0x5b4e63[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2f429b,_0x134b10){const _0x448cc7=_0x3581,_0x418eab=_0x2f429b();while(!![]){try{const _0x206b72=parseInt(_0x448cc7(0xe7))/0x1+parseInt(_0x448cc7(0xd7))/0x2*(parseInt(_0x448cc7(0x10c))/0x3)+-parseInt(_0x448cc7(0xe9))/0x4*(parseInt(_0x448cc7(0x101))/0x5)+parseInt(_0x448cc7(0xff))/0x6*(-parseInt(_0x448cc7(0xec))/0x7)+-parseInt(_0x448cc7(0xd8))/0x8*(parseInt(_0x448cc7(0xbb))/0x9)+-parseInt(_0x448cc7(0xf3))/0xa*(-parseInt(_0x448cc7(0xde))/0xb)+-parseInt(_0x448cc7(0x105))/0xc;if(_0x206b72===_0x134b10)break;else _0x418eab['push'](_0x418eab['shift']());}catch(_0x35abe3){_0x418eab['push'](_0x418eab['shift']());}}}(_0x1f61,0x225dc));import{readFile,rm}from'fs/promises';import{existsSync}from'fs';import{join}from'path';import _0x2c77f1 from'inquirer';import{getEnvNames}from'./env.js';import{getEnvDir,loadSettings}from'./utils/settings.js';function _0x3581(_0x2cc7e2,_0x4258ec){_0x2cc7e2=_0x2cc7e2-0xbb;const _0x1f61dd=_0x1f61();let _0x3581bc=_0x1f61dd[_0x2cc7e2];return _0x3581bc;}import{getRangerDir}from'./utils/rangerRoot.js';import{ApiError,createCloudProfile,fetchAuthConfig,saveCloudProfileCredentials,uploadCloudProfileSession}from'./utils/cloudProfile.js';import{matchAuthEnvironment}from'./utils/matchAuthEnvironment.js';import{readProjectsConfig,setProfileOverride,writeProjectsConfig}from'./utils/projectsConfig.js';import{isPathGitTracked}from'./utils/gitTracked.js';function formatPlanLine(_0x2ba3a6){const _0x755914=_0x3581;if(_0x2ba3a6[_0x755914(0xcc)]==='skip')return'\x20\x20'+_0x2ba3a6[_0x755914(0xdc)]['padEnd'](0x1e)+'\x20→\x20skip\x20('+_0x2ba3a6[_0x755914(0xf5)]+')';if(_0x2ba3a6[_0x755914(0xcb)]&&_0x2ba3a6['baseUrl'])return'\x20\x20'+_0x2ba3a6['profileName'][_0x755914(0xed)](0x1e)+_0x755914(0xca)+_0x2ba3a6[_0x755914(0xc7)]+_0x755914(0xe1)+_0x2ba3a6[_0x755914(0xdd)]+_0x755914(0xe5);if(_0x2ba3a6['baseUrl'])return'\x20\x20'+_0x2ba3a6[_0x755914(0xdc)]['padEnd'](0x1e)+_0x755914(0xca)+_0x2ba3a6['envKey']+_0x755914(0xd9)+_0x2ba3a6[_0x755914(0xdd)]+')';return'\x20\x20'+_0x2ba3a6['profileName'][_0x755914(0xed)](0x1e)+'\x20→\x20cloud\x20(env:\x20'+_0x2ba3a6['envKey']+')';}function shouldWarnGitTrackedOnce(_0x3656a5){const _0x26e892=_0x3581,_0x24952f={'pgykA':function(_0x29a70b){return _0x29a70b();},'ULPAi':function(_0x3b17ab,_0x434afc){return _0x3b17ab(_0x434afc);}},_0x17da6f=_0x24952f['pgykA'](readProjectsConfig),_0x272982=_0x17da6f[_0x26e892(0xd6)][_0x3656a5]??={},_0x4943c6=_0x272982['_warnings']??={},_0x41886e=_0x4943c6[_0x26e892(0xd3)],_0x1a7eef=new Date(),_0x23e766=_0x1a7eef[_0x26e892(0xc1)]()[_0x26e892(0x107)](0x0,0xa);if(_0x41886e===_0x23e766)return![];return _0x4943c6['gitTrackedRanger']=_0x23e766,_0x24952f['ULPAi'](writeProjectsConfig,_0x17da6f),!![];}export async function migrateProfile(_0x405c37,_0x5f59be){const _0x52650e=_0x3581,_0x31350f={'VTtft':function(_0x4e8b9a,_0x4b6f88){return _0x4e8b9a===_0x4b6f88;},'kMSUo':function(_0x1d09d6){return _0x1d09d6();},'OAPyJ':function(_0x57cdb1,_0x58e4a6){return _0x57cdb1 instanceof _0x58e4a6;},'uPlYZ':function(_0x3f2d9a,_0x106757){return _0x3f2d9a(_0x106757);},'DqJBj':_0x52650e(0xc2),'nVPAL':function(_0x2abb79){return _0x2abb79();},'dOpQF':function(_0x30dd9b,_0x5708e6){return _0x30dd9b(_0x5708e6);},'yWhan':_0x52650e(0xeb),'hAUAn':'skip','fhqSQ':_0x52650e(0xbf),'DVTBz':function(_0x15d769,_0x23fa83,_0x1bf3e6){return _0x15d769(_0x23fa83,_0x1bf3e6);},'xOsol':function(_0x2372ff,_0x20cc17){return _0x2372ff===_0x20cc17;},'svgFq':_0x52650e(0xe6),'AXYoi':function(_0x1b02e1,_0x2e2e08){return _0x1b02e1&&_0x2e2e08;},'KPVzb':'Proceed?','svoAY':'Aborted.','YKyrZ':function(_0x28a7ea){return _0x28a7ea();},'WPtPI':'Warning:\x20.ranger/\x20is\x20tracked\x20in\x20this\x20git\x20repo.','mcQwM':_0x52650e(0x10a),'qYbKj':'Continuing\x20with\x20migration...','WoYVR':_0x52650e(0xf8),'hCvVr':function(_0x2a562e,_0xc8358b,_0x27668d,_0x1cff77){return _0x2a562e(_0xc8358b,_0x27668d,_0x1cff77);},'kBGBh':_0x52650e(0xd4),'gpczO':function(_0x2fce0d,_0x4158eb,_0x430ef4,_0x4f697d,_0x23f84e){return _0x2fce0d(_0x4158eb,_0x430ef4,_0x4f697d,_0x23f84e);},'hPxvL':_0x52650e(0xdd),'azADC':function(_0x1b3223,_0x283403){return _0x1b3223 instanceof _0x283403;},'ItGyZ':function(_0x546f13,_0x17014f){return _0x546f13>_0x17014f;},'QhpPS':function(_0x231885,_0x3182df){return _0x231885>_0x3182df;}};if(!_0x405c37['profileName']&&!_0x405c37[_0x52650e(0x102)])throw new Error(_0x52650e(0xe8));let _0x49b23d;try{_0x49b23d=await _0x31350f['kMSUo'](fetchAuthConfig);}catch(_0x4cfd06){throw new Error('Could\x20not\x20fetch\x20auth\x20config\x20('+(_0x31350f['OAPyJ'](_0x4cfd06,Error)?_0x4cfd06[_0x52650e(0xd0)]:_0x31350f['uPlYZ'](String,_0x4cfd06))+_0x52650e(0xda));}if(!_0x49b23d||!_0x49b23d[_0x52650e(0xf7)]||Object['keys'](_0x49b23d[_0x52650e(0xf7)])['length']===0x0)throw new Error(_0x31350f['DqJBj']);const _0x4e0342=[];if(_0x405c37['all']){const {envNames:_0x5ba593,envTypes:_0x4bf787}=await _0x31350f['nVPAL'](getEnvNames);for(const _0x17b333 of _0x5ba593){if(_0x31350f[_0x52650e(0xe3)](_0x4bf787[_0x17b333],'ci'))continue;_0x4e0342['push'](_0x17b333);}}else _0x405c37['profileName']&&_0x4e0342['push'](_0x405c37[_0x52650e(0xdc)]);if(_0x31350f['VTtft'](_0x4e0342[_0x52650e(0xc9)],0x0)){console['log'](_0x52650e(0xee));return;}const _0x289ddd=[];for(const _0x15b1f5 of _0x4e0342){const _0x390561=_0x31350f['uPlYZ'](getEnvDir,_0x15b1f5);if(!_0x31350f['dOpQF'](existsSync,_0x390561)){_0x289ddd[_0x52650e(0x104)]({'kind':'skip','profileName':_0x15b1f5,'reason':_0x31350f[_0x52650e(0xf0)]});continue;}const _0x4d4d95=await loadSettings(_0x15b1f5),_0x10f344=_0x4d4d95['baseUrl'];if(!_0x10f344){_0x289ddd['push']({'kind':_0x31350f['hAUAn'],'profileName':_0x15b1f5,'reason':_0x31350f['fhqSQ']});continue;}const _0x1b7634=_0x31350f[_0x52650e(0xc4)](matchAuthEnvironment,_0x10f344,_0x49b23d);if(!_0x1b7634){_0x289ddd[_0x52650e(0x104)]({'kind':'skip','profileName':_0x15b1f5,'reason':_0x52650e(0xbe)});continue;}const _0x42df44=_0x49b23d['environments'][_0x1b7634],_0x467d24=_0x42df44?.['domains']??[],_0x584832=_0x467d24[_0x52650e(0x100)](_0x1fb05a=>{const _0x2a8971=_0x52650e;try{return _0x31350f['VTtft'](new URL(_0x1fb05a)[_0x2a8971(0xc8)],new URL(_0x10f344)[_0x2a8971(0xc8)]);}catch{return![];}}),_0x1f6330={};for(const [_0x5b3ddd,_0x5a5686]of Object[_0x52650e(0xc6)](_0x4d4d95)){if(_0x5b3ddd==='baseUrl')continue;if(_0x31350f[_0x52650e(0xfe)](_0x5a5686,undefined))continue;_0x1f6330[_0x5b3ddd]=_0x5a5686;}!_0x584832&&(_0x1f6330[_0x52650e(0xdd)]=_0x10f344);const _0x39af06=join(_0x390561,'auth.json'),_0x2dad2a=existsSync(_0x39af06);_0x289ddd['push']({'kind':_0x52650e(0xf6),'profileName':_0x15b1f5,'envKey':_0x1b7634,'baseUrl':_0x10f344,'preserveBaseUrl':!_0x584832,'settings':_0x1f6330,'authJsonPath':_0x2dad2a?_0x39af06:null});}console[_0x52650e(0xe0)](_0x31350f[_0x52650e(0xf2)]);for(const _0x5a67eb of _0x289ddd){console['log'](_0x31350f[_0x52650e(0xcd)](formatPlanLine,_0x5a67eb));}if(_0x405c37[_0x52650e(0xfa)]){console[_0x52650e(0xe0)]('Nothing\x20migrated.\x20Run\x20without\x20--dry-run\x20to\x20apply.');return;}const _0x5d1aa2=Boolean(process['stdin']['isTTY']&&process['stdout'][_0x52650e(0xbd)]),_0x9e77d3=_0x289ddd[_0x52650e(0x100)](_0x475f8a=>_0x475f8a['kind']==='migrate');if(_0x31350f['AXYoi'](_0x9e77d3,_0x5d1aa2)&&!_0x405c37['yes']){const {proceed:_0x59ea36}=await _0x2c77f1['prompt']([{'type':'confirm','name':'proceed','message':_0x31350f['KPVzb'],'default':![]}]);if(!_0x59ea36){console['log'](_0x31350f[_0x52650e(0xdb)]);return;}}const _0x360280=_0x31350f[_0x52650e(0xd5)](getRangerDir);let _0x524a1f=![];if(existsSync(_0x360280))try{_0x524a1f=await isPathGitTracked(_0x360280);}catch{_0x524a1f=![];}_0x524a1f&&shouldWarnGitTrackedOnce(process[_0x52650e(0xc0)]())&&(console['log'](_0x31350f['WPtPI']),console['log']('After\x20migration,\x20uncommit\x20it:'),console['log'](_0x52650e(0xd2)),console['log'](_0x31350f['mcQwM']),console[_0x52650e(0xe0)](_0x31350f['qYbKj']));let _0x15ca46=0x0,_0x210972=0x0,_0x1b7ff2=0x0,_0x36fd90=0x0;for(const _0x2a91a5 of _0x289ddd){if(_0x31350f[_0x52650e(0xfe)](_0x2a91a5[_0x52650e(0xcc)],_0x52650e(0xfc))){_0x36fd90++,_0x5f59be?.['trackPhaseEnd'](_0x31350f['WoYVR'],{'profileName':_0x2a91a5['profileName'],'reason':_0x2a91a5['reason']});continue;}_0x5f59be?.['trackPhaseStart']('profile.migrate.started',{'profileName':_0x2a91a5['profileName'],'envKey':_0x2a91a5['envKey']});try{try{await _0x31350f['hCvVr'](createCloudProfile,_0x2a91a5[_0x52650e(0xdc)],_0x2a91a5[_0x52650e(0xc7)],{'settings':_0x2a91a5[_0x52650e(0xc3)]});}catch(_0x3a5d6b){if(_0x3a5d6b instanceof ApiError&&_0x31350f['VTtft'](_0x3a5d6b[_0x52650e(0x109)],0x199)){console[_0x52650e(0xe0)]('\x20\x20⚠\x20'+_0x2a91a5['profileName']+_0x52650e(0xce)),_0x36fd90++,_0x5f59be?.['trackPhaseEnd'](_0x31350f['WoYVR'],{'profileName':_0x2a91a5[_0x52650e(0xdc)],'reason':_0x31350f['kBGBh']});continue;}throw _0x3a5d6b;}let _0x600a78=![],_0x426d7f=![];if(_0x2a91a5[_0x52650e(0xf4)])try{const _0x5353e1=await _0x31350f['DVTBz'](readFile,_0x2a91a5['authJsonPath'],_0x52650e(0xdf)),_0x252037=JSON[_0x52650e(0xfd)](_0x5353e1);await uploadCloudProfileSession(_0x2a91a5['profileName'],_0x252037),_0x600a78=!![];}catch(_0x37b07a){_0x426d7f=!![],console['log'](_0x52650e(0x10d)+_0x2a91a5[_0x52650e(0xdc)]+':\x20session\x20upload\x20failed\x20('+(_0x31350f[_0x52650e(0xf1)](_0x37b07a,Error)?_0x37b07a[_0x52650e(0xd0)]:String(_0x37b07a))+').\x20Cloud\x20profile\x20created;\x20local\x20auth.json\x20left\x20in\x20place.');}let _0x2e0b16=![];if(_0x405c37[_0x52650e(0xe2)]){const _0x5326c1=process['env'][_0x52650e(0x103)],_0x3d5ef1=process[_0x52650e(0xf9)]['RANGER_TEST_PASSWORD'];if(_0x5326c1&&_0x3d5ef1)try{await saveCloudProfileCredentials(_0x2a91a5[_0x52650e(0xdc)],_0x5326c1,_0x3d5ef1),_0x2e0b16=!![];}catch(_0x4a855b){console['log'](_0x52650e(0x10d)+_0x2a91a5[_0x52650e(0xdc)]+':\x20failed\x20to\x20save\x20credentials\x20('+(_0x4a855b instanceof Error?_0x4a855b[_0x52650e(0xd0)]:_0x31350f[_0x52650e(0xcd)](String,_0x4a855b))+').');}else console[_0x52650e(0xe0)]('\x20\x20⚠\x20'+_0x2a91a5[_0x52650e(0xdc)]+':\x20--save-creds\x20requested,\x20but\x20RANGER_TEST_USERNAME/PASSWORD\x20not\x20set\x20in\x20env.');}if(_0x2a91a5['preserveBaseUrl']&&_0x2a91a5['baseUrl'])try{_0x31350f['gpczO'](setProfileOverride,process['cwd'](),_0x2a91a5[_0x52650e(0xdc)],_0x31350f[_0x52650e(0x106)],_0x2a91a5[_0x52650e(0xdd)]);}catch(_0x2a6e0a){console['log']('\x20\x20⚠\x20'+_0x2a91a5['profileName']+':\x20failed\x20to\x20write\x20projects.json\x20override\x20('+(_0x31350f['OAPyJ'](_0x2a6e0a,Error)?_0x2a6e0a[_0x52650e(0xd0)]:String(_0x2a6e0a))+').');}const _0x4c29ea=getEnvDir(_0x2a91a5[_0x52650e(0xdc)]);if(!_0x426d7f&&existsSync(_0x4c29ea))try{await _0x31350f['DVTBz'](rm,_0x4c29ea,{'recursive':!![],'force':!![]}),_0x210972++;}catch(_0x22008){console[_0x52650e(0xe0)](_0x52650e(0x10d)+_0x2a91a5[_0x52650e(0xdc)]+':\x20failed\x20to\x20delete\x20local\x20dir\x20'+_0x4c29ea+'\x20('+(_0x22008 instanceof Error?_0x22008[_0x52650e(0xd0)]:String(_0x22008))+').');}_0x15ca46++,_0x2a91a5['preserveBaseUrl']&&_0x2a91a5['baseUrl']?console['log']('\x20\x20✓\x20'+_0x2a91a5[_0x52650e(0xdc)]+_0x52650e(0xc5)+_0x2a91a5['envKey']+',\x20baseUrl\x20override\x20→\x20projects.json)'):console['log'](_0x52650e(0xd1)+_0x2a91a5[_0x52650e(0xdc)]+_0x52650e(0xc5)+_0x2a91a5[_0x52650e(0xc7)]+')'),_0x5f59be?.['trackPhaseEnd'](_0x52650e(0xea),{'profileName':_0x2a91a5['profileName'],'envKey':_0x2a91a5[_0x52650e(0xc7)],'wasGitTracked':_0x524a1f,'hadSession':_0x600a78,'savedCreds':_0x2e0b16});}catch(_0x102e79){_0x1b7ff2++,console[_0x52650e(0xe0)](_0x52650e(0xcf)+_0x2a91a5['profileName']+_0x52650e(0xef)+(_0x102e79 instanceof Error?_0x102e79[_0x52650e(0xd0)]:String(_0x102e79))),_0x5f59be?.['trackPhaseEnd'](_0x52650e(0xfb),{'profileName':_0x2a91a5[_0x52650e(0xdc)],'error':_0x31350f[_0x52650e(0x10b)](_0x102e79,Error)?_0x102e79['message']:_0x31350f[_0x52650e(0xcd)](String,_0x102e79)});}}const _0x410085=[];if(_0x15ca46>0x0)_0x410085['push'](_0x15ca46+'\x20profile'+(_0x15ca46===0x1?'':'s')+'\x20migrated');if(_0x210972>0x0)_0x410085[_0x52650e(0x104)]('Deleted\x20'+_0x210972+_0x52650e(0x108)+(_0x210972===0x1?'y':'ies'));if(_0x31350f[_0x52650e(0xe4)](_0x36fd90,0x0))_0x410085[_0x52650e(0x104)](_0x36fd90+'\x20skipped');if(_0x31350f[_0x52650e(0xe4)](_0x1b7ff2,0x0))_0x410085[_0x52650e(0x104)](_0x1b7ff2+_0x52650e(0xbc));if(_0x31350f['QhpPS'](_0x410085[_0x52650e(0xc9)],0x0))console['log'](_0x410085['join']('.\x20')+'.');}function _0x1f61(){const _0x54a5d6=['\x20\x20✓\x20','\x20\x20git\x20rm\x20-r\x20--cached\x20.ranger/','gitTrackedRanger','name_conflict','YKyrZ','projects','2XCaWUf','8KaUODj',',\x20matches\x20',').\x20Run:\x20ranger\x20setup','svoAY','profileName','baseUrl','2546621xbRpSV','utf-8','log',',\x20preserving\x20baseUrl\x20','saveCreds','VTtft','ItGyZ','\x20as\x20project\x20override)','Plan:','143167BNgOIo','Provide\x20a\x20profile\x20name\x20or\x20--all.\x0a\x20\x20Example:\x20ranger\x20profile\x20migrate\x20--all\x20--dry-run','38284cUSvee','profile.migrate.succeeded','local\x20profile\x20directory\x20not\x20found','102739wumuXs','padEnd','No\x20local\x20profiles\x20found\x20to\x20migrate.','\x20failed:\x20','yWhan','OAPyJ','svgFq','10DExATQ','authJsonPath','reason','migrate','environments','profile.migrate.skipped','env','dryRun','profile.migrate.failed','skip','parse','xOsol','60xRqFPs','some','10ZwMEpb','all','RANGER_TEST_USERNAME','push','2281740mlTHhx','hPxvL','slice','\x20local\x20director','status','\x20\x20echo\x20\x27.ranger/\x27\x20>>\x20.gitignore','azADC','511569HLgewg','\x20\x20⚠\x20','435420kbNXdZ','\x20failed','isTTY','no\x20matching\x20auth\x20env','no\x20baseUrl\x20in\x20settings.json','cwd','toISOString','No\x20cloud\x20profile\x20auth\x20config\x20found\x20for\x20this\x20org.\x20Migration\x20requires\x20at\x20least\x20one\x20configured\x20auth\x20environment.','settings','DVTBz','\x20migrated\x20to\x20cloud\x20(env:\x20','entries','envKey','origin','length','\x20→\x20cloud\x20(env:\x20','preserveBaseUrl','kind','dOpQF',':\x20cloud\x20profile\x20with\x20this\x20name\x20already\x20exists.\x20Skipping.','\x20\x20✗\x20','message'];_0x1f61=function(){return _0x54a5d6;};return _0x1f61();}
|
|
1
|
+
function _0x1a8f(){var _0x1b2448=['1216719lQqfQR','ZfxJp','ngfNm','1336132yGAZGa','BvuVC','1301525cOBtyO','exit','657906WCzdto','361789YirRfJ','507048RUFLhX','LotrR','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','612660TuvjWK'];_0x1a8f=function(){return _0x1b2448;};return _0x1a8f();}(function(_0x291bdb,_0x382971){var _0x5da438=_0x1931,_0x5ad8ca=_0x291bdb();while(!![]){try{var _0x54a06a=parseInt(_0x5da438(0x1f6))/0x1+-parseInt(_0x5da438(0x1f5))/0x2+parseInt(_0x5da438(0x1f7))/0x3+parseInt(_0x5da438(0x1f1))/0x4+-parseInt(_0x5da438(0x1f3))/0x5+parseInt(_0x5da438(0x1fa))/0x6+-parseInt(_0x5da438(0x1ee))/0x7;if(_0x54a06a===_0x382971)break;else _0x5ad8ca['push'](_0x5ad8ca['shift']());}catch(_0x325b9a){_0x5ad8ca['push'](_0x5ad8ca['shift']());}}}(_0x1a8f,0x31c61));function _0x1931(_0x2290e8,_0xf63878){_0x2290e8=_0x2290e8-0x1ee;var _0x1a8ffc=_0x1a8f();var _0x19316d=_0x1a8ffc[_0x2290e8];return _0x19316d;}export async function migrateProfile(_0x4e9937,_0x1a60b1){var _0x4313e5=_0x1931,_0x114b93={'XINxq':function(_0x53211e,_0x27c4e5){return _0x53211e+_0x27c4e5;},'ZfxJp':function(_0x37dee1,_0x349d2e){return _0x37dee1+_0x349d2e;},'BJUxg':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','BvuVC':_0x4313e5(0x1f9),'ngfNm':'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','LotrR':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a'};console['error'](_0x114b93['XINxq'](_0x114b93['XINxq'](_0x114b93['XINxq'](_0x114b93['XINxq'](_0x114b93[_0x4313e5(0x1ef)](_0x114b93['BJUxg'],'\x0a')+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a'+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','\x0a')+_0x114b93[_0x4313e5(0x1f2)],_0x114b93[_0x4313e5(0x1f0)])+'\x0a',_0x114b93[_0x4313e5(0x1f8)]),'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.')),process[_0x4313e5(0x1f4)](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2fb846,_0x33cf90){const _0x2af5bf=_0x4955,_0x8a3a11=_0x2fb846();while(!![]){try{const _0x3705b3=parseInt(_0x2af5bf(0x1ac))/0x1+parseInt(_0x2af5bf(0x1a3))/0x2+parseInt(_0x2af5bf(0x1a6))/0x3+-parseInt(_0x2af5bf(0x1c3))/0x4+-parseInt(_0x2af5bf(0x1c6))/0x5+-parseInt(_0x2af5bf(0x199))/0x6*(parseInt(_0x2af5bf(0x19b))/0x7)+parseInt(_0x2af5bf(0x1b5))/0x8;if(_0x3705b3===_0x33cf90)break;else _0x8a3a11['push'](_0x8a3a11['shift']());}catch(_0x1390e8){_0x8a3a11['push'](_0x8a3a11['shift']());}}}(_0x4a4f,0x49614));import{join}from'path';import{existsSync}from'fs';import _0x40d215 from'inquirer';function _0x4a4f(){const _0xb9b034=['log','enable','YYjzt','418168thedsO','add','already\x20enabled','2678675NoVQvv','install','prompt','ranger@trailhead','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','kMnni','12vwjQXa','⚠\x20Failed\x20to\x20enable\x20plugin:','1478617jMybMA','project','✓\x20Ranger\x20skills\x20already\x20installed','fyMAr','\x0aYou\x20can\x20install\x20manually\x20with:','makxz','JIzlw','wantsSkillup','877974TtQEjS','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','user','1516527cLZXeA','success','TGEEj','error','SKILL.md','VqJMN','98152qIFNCe','✓\x20Marketplace\x20already\x20added','SSloh','DVJXj','DdIlQ','gLqVb','OGlqz','plugin','dLLwY','2565240joHnaa','ranger-testing/trailhead','Would\x20you\x20like\x20to\x20install\x20skills?','❌\x20Failed\x20to\x20install\x20plugin:','✓\x20Claude\x20Code\x20plugin\x20enabled','zYXJD','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','bEBKm','AHYIo','--scope','MPvdb'];_0x4a4f=function(){return _0xb9b034;};return _0x4a4f();}import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';function _0x4955(_0x127c98,_0x5d1b15){_0x127c98=_0x127c98-0x197;const _0x4a4fb2=_0x4a4f();let _0x4955aa=_0x4a4fb2[_0x127c98];return _0x4955aa;}import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x450b75){const _0x2302c4=_0x4955,_0x3cbcff={'DdIlQ':_0x2302c4(0x1a4),'DVJXj':function(_0x2602d2,_0x22a050){return _0x2602d2(_0x22a050);},'dLLwY':function(_0x3f3361,_0x322cb7,_0x1a8ba2){return _0x3f3361(_0x322cb7,_0x1a8ba2);},'sIxHp':function(_0x595fad){return _0x595fad();},'kMnni':'.claude','TGEEj':'pluginScope','lJHfm':'Where\x20should\x20the\x20plugin\x20be\x20installed?','fpBLz':'user','fyMAr':_0x2302c4(0x1ad),'makxz':_0x2302c4(0x1c4),'MPvdb':_0x2302c4(0x1b6),'IELEq':'❌\x20Failed\x20to\x20add\x20marketplace:','gLqVb':_0x2302c4(0x19f),'MZaVk':_0x2302c4(0x197),'gsGEn':_0x2302c4(0x1c7),'YYjzt':_0x2302c4(0x1c9),'zYXJD':'--scope','JIzlw':function(_0x53a0c9,_0x274d98){return _0x53a0c9===_0x274d98;},'ePmaP':_0x2302c4(0x19c),'SOYoQ':function(_0x32b74d){return _0x32b74d();},'cNavb':_0x2302c4(0x1b8),'qSIuj':_0x2302c4(0x1b3),'VqJMN':function(_0x5bfa24,_0x4b69e7,_0x4092d3){return _0x5bfa24(_0x4b69e7,_0x4092d3);},'nCDxB':_0x2302c4(0x1c5),'NgONL':_0x2302c4(0x19a),'bEBKm':_0x2302c4(0x1b9)},_0x3d2fd7=await isPluginInstalled(_0x2302c4(0x1c9));if(_0x3d2fd7)return console[_0x2302c4(0x1c0)](_0x3cbcff[_0x2302c4(0x1b0)]),![];const _0x2d57ac=_0x3cbcff[_0x2302c4(0x1af)](existsSync,_0x3cbcff[_0x2302c4(0x1b4)](join,_0x3cbcff['sIxHp'](getProjectRoot),_0x3cbcff[_0x2302c4(0x198)]));let _0x2f16ba;if(_0x450b75)_0x2f16ba=_0x450b75;else{if(_0x2d57ac)_0x2f16ba='project';else{console[_0x2302c4(0x1c0)]('\x0a📦\x20Claude\x20Code\x20Plugin\x0a');const _0x36efc8=await _0x40d215[_0x2302c4(0x1c8)]([{'type':'list','name':_0x3cbcff[_0x2302c4(0x1a8)],'message':_0x3cbcff['lJHfm'],'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':'user'},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':'project'}],'default':_0x3cbcff['fpBLz']}]);_0x2f16ba=_0x36efc8['pluginScope'];}}console[_0x2302c4(0x1c0)]('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x2f16ba+'\x20level)...\x0a');const _0x3c7d6a=await isMarketplaceAdded('trailhead');let _0x968b39=_0x3c7d6a;if(_0x3c7d6a)console[_0x2302c4(0x1c0)](_0x3cbcff[_0x2302c4(0x19e)]);else{const _0x139905=await runClaudeCommand([_0x2302c4(0x1b3),'marketplace',_0x3cbcff[_0x2302c4(0x1a0)],_0x3cbcff[_0x2302c4(0x1bf)]]);!_0x139905['success']?(console['error'](_0x3cbcff['IELEq'],_0x139905[_0x2302c4(0x1a9)]),console['log'](_0x3cbcff[_0x2302c4(0x1b1)]),console['log'](_0x3cbcff['MZaVk']),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x2f16ba)):_0x968b39=!![];}if(_0x968b39){const _0x2cd4bd=await _0x3cbcff[_0x2302c4(0x1b4)](runClaudeCommand,['plugin',_0x3cbcff['gsGEn'],_0x3cbcff[_0x2302c4(0x1c2)],_0x3cbcff[_0x2302c4(0x1ba)],_0x2f16ba],{'cwd':_0x3cbcff['JIzlw'](_0x2f16ba,_0x3cbcff['ePmaP'])?_0x3cbcff['SOYoQ'](getProjectRoot):undefined});if(!_0x2cd4bd['success'])console[_0x2302c4(0x1a9)](_0x3cbcff['cNavb'],_0x2cd4bd['error']),console['log'](_0x3cbcff[_0x2302c4(0x1b1)]),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x2f16ba);else{console[_0x2302c4(0x1c0)](_0x2302c4(0x1bb));const _0x1fc756=[_0x3cbcff['qSIuj'],_0x2302c4(0x1c1),'ranger@trailhead'];_0x2f16ba===_0x2302c4(0x19c)&&_0x1fc756['push'](_0x2302c4(0x1be),_0x3cbcff['ePmaP']);const _0x138873=await _0x3cbcff[_0x2302c4(0x1ab)](runClaudeCommand,_0x1fc756,{'captureOutput':!![],'cwd':_0x3cbcff[_0x2302c4(0x1a1)](_0x2f16ba,'project')?getProjectRoot():undefined}),_0x43b7ae=_0x138873['output']?.['includes'](_0x3cbcff['nCDxB']);!_0x138873[_0x2302c4(0x1a7)]&&!_0x43b7ae?console['error'](_0x3cbcff['NgONL'],_0x138873[_0x2302c4(0x1a9)]):console['log'](_0x3cbcff[_0x2302c4(0x1bc)]);}}return!![];}export async function ensureClaudeSkills(_0x4b3580){const _0x519592=_0x4955,_0x59daff={'SSloh':_0x519592(0x1a5),'qDFbw':_0x519592(0x1aa),'AHYIo':function(_0x1d16e6,_0x262ea6,_0x1bc42f,_0x1ca7ce){return _0x1d16e6(_0x262ea6,_0x1bc42f,_0x1ca7ce);},'OGlqz':function(_0x4edcb6,_0x590481){return _0x4edcb6(_0x590481);},'OzUvi':_0x519592(0x19c),'ZriFg':'ranger','BdOHh':function(_0x169815,_0x1e09f4){return _0x169815||_0x1e09f4;},'jRIBY':function(_0x3b1b43,_0x5164f6){return _0x3b1b43(_0x5164f6);}},_0x206c10=existsSync(join(getSkillsDir(_0x59daff[_0x519592(0x1ae)]),'ranger',_0x59daff['qDFbw'])),_0x286a8f=existsSync(_0x59daff[_0x519592(0x1bd)](join,_0x59daff[_0x519592(0x1b2)](getSkillsDir,_0x59daff['OzUvi']),_0x59daff['ZriFg'],_0x519592(0x1aa)));if(_0x59daff['BdOHh'](_0x206c10,_0x286a8f))return console[_0x519592(0x1c0)](_0x519592(0x19d)),![];const _0x36db76=existsSync(join(getProjectRoot(),'.claude'));let _0x2e50a4=!![];if(_0x4b3580)await skillup({'autoInstall':_0x4b3580,'suppressUsage':!![]});else{if(_0x36db76)await skillup({'autoInstall':_0x59daff['OzUvi'],'suppressUsage':!![]});else{const _0x3eecdd=await _0x40d215[_0x519592(0x1c8)]([{'type':'confirm','name':'wantsSkillup','message':_0x519592(0x1b7),'default':!![]}]);_0x2e50a4=_0x3eecdd[_0x519592(0x1a2)],_0x2e50a4&&await _0x59daff['jRIBY'](skillup,{'suppressUsage':!![]});}}return _0x2e50a4;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x171f51,_0x50a12c){const _0x6e4134=_0x4549,_0x52a232=_0x171f51();while(!![]){try{const _0x454c5a=-parseInt(_0x6e4134(0xe8))/0x1*(-parseInt(_0x6e4134(0xf2))/0x2)+parseInt(_0x6e4134(0xe3))/0x3*(-parseInt(_0x6e4134(0xda))/0x4)+-parseInt(_0x6e4134(0xe4))/0x5+-parseInt(_0x6e4134(0xe9))/0x6*(parseInt(_0x6e4134(0xf1))/0x7)+parseInt(_0x6e4134(0xd2))/0x8*(-parseInt(_0x6e4134(0xdf))/0x9)+-parseInt(_0x6e4134(0xdd))/0xa+parseInt(_0x6e4134(0xef))/0xb;if(_0x454c5a===_0x50a12c)break;else _0x52a232['push'](_0x52a232['shift']());}catch(_0x2a83e3){_0x52a232['push'](_0x52a232['shift']());}}}(_0x28cb,0x751af));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x5c460f from'inquirer';function _0x28cb(){const _0x2976d1=['bvbPf','✓\x20OpenCode\x20plugin\x20already\x20configured','1047380rqIzac','SuwHP','729gzkOhp','FXPWd','plugin','parse','3HWnhYI','187670MFDzvk','@ranger-testing/opencode-plugin','QyzDc','UWOeF','31sgXkey','6198pTRQYy','Failed\x20to\x20read\x20opencode.json','includes','trfVC','prompt','bZGqq','22172139daaBfs','Where\x20should\x20the\x20plugin\x20be\x20installed?','4851fLIFGN','43926cDvOwu','bZwEH','project','isArray','RcVAv','log','39816CnfszS','$schema','pluginScope','\x0a📦\x20OpenCode\x20Plugin\x0a','user','✓\x20OpenCode\x20plugin\x20configured','opencode.json','INPoL','3822244vbJkZm'];_0x28cb=function(){return _0x2976d1;};return _0x28cb();}function _0x4549(_0x5a219e,_0x1ec0d4){_0x5a219e=_0x5a219e-0xd1;const _0x28cb80=_0x28cb();let _0x454902=_0x28cb80[_0x5a219e];return _0x454902;}import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x4ebff5){const _0x50b515=_0x4549,_0xb32a1d={'bZwEH':function(_0x107801,_0x11f796){return _0x107801(_0x11f796);},'trfVC':function(_0x3d68db,_0xac9a2e,_0x3cac87){return _0x3d68db(_0xac9a2e,_0x3cac87);},'sjsJg':_0x50b515(0xf4),'TmbhY':_0x50b515(0xd8),'bZGqq':'list','QyzDc':'pluginScope','RcVAv':_0x50b515(0xf0),'lEUnw':'User\x20(available\x20in\x20all\x20your\x20projects)','FXPWd':_0x50b515(0xd6),'uoTGr':'Project\x20(shared\x20with\x20team\x20via\x20git)','bvbPf':function(_0x3c2f28,_0x5752e4){return _0x3c2f28(_0x5752e4);},'UWOeF':'https://opencode.ai/config.json','INPoL':function(_0x3ba44e,_0x7302a0){return _0x3ba44e(_0x7302a0);},'AULXH':'utf-8','BSMnX':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','TCOMl':function(_0x31b317,_0x3d0d35,_0x155988){return _0x31b317(_0x3d0d35,_0x155988);},'mhgJd':function(_0x11728f,_0x4043e4){return _0x11728f+_0x4043e4;},'SuwHP':_0x50b515(0xd7)},_0x16091b=_0xb32a1d[_0x50b515(0xf3)](existsSync,_0xb32a1d[_0x50b515(0xec)](join,getOpencodeConfigDir(_0xb32a1d['sjsJg']),_0xb32a1d['TmbhY']));let _0x38f7c4;if(_0x4ebff5)_0x38f7c4=_0x4ebff5;else{if(_0x16091b)_0x38f7c4='project';else{console['log'](_0x50b515(0xd5));const _0x578580=await _0x5c460f[_0x50b515(0xed)]([{'type':_0xb32a1d[_0x50b515(0xee)],'name':_0xb32a1d[_0x50b515(0xe6)],'message':_0xb32a1d[_0x50b515(0xf6)],'choices':[{'name':_0xb32a1d['lEUnw'],'value':_0xb32a1d[_0x50b515(0xe0)]},{'name':_0xb32a1d['uoTGr'],'value':_0x50b515(0xf4)}],'default':_0xb32a1d['FXPWd']}]);_0x38f7c4=_0x578580[_0x50b515(0xd4)];}}const _0x539f24=join(_0xb32a1d[_0x50b515(0xdb)](getOpencodeConfigDir,_0x38f7c4),'opencode.json'),_0x225c8c=_0x50b515(0xe5),_0x5ddbb0=_0xb32a1d[_0x50b515(0xe7)];let _0x22d3b1={};if(_0xb32a1d[_0x50b515(0xd9)](existsSync,_0x539f24))try{const _0x26ca24=await _0xb32a1d[_0x50b515(0xec)](readFile,_0x539f24,_0xb32a1d['AULXH']);_0x22d3b1=JSON[_0x50b515(0xe2)](_0x26ca24);}catch(_0x5049f9){return console['error'](_0xb32a1d['BSMnX']),{'configured':![],'scope':_0x38f7c4,'error':_0x50b515(0xea),'details':_0x5049f9};}const _0x58d2e=Array[_0x50b515(0xf5)](_0x22d3b1[_0x50b515(0xe1)])?_0x22d3b1[_0x50b515(0xe1)]:[];if(_0x58d2e[_0x50b515(0xeb)](_0x225c8c))return console[_0x50b515(0xd1)](_0x50b515(0xdc)),{'configured':![],'scope':_0x38f7c4};return _0x22d3b1[_0x50b515(0xd3)]=_0x22d3b1[_0x50b515(0xd3)]||_0x5ddbb0,_0x22d3b1['plugin']=[..._0x58d2e,_0x225c8c],await _0xb32a1d['TCOMl'](mkdir,getOpencodeConfigDir(_0x38f7c4),{'recursive':!![]}),await writeFile(_0x539f24,_0xb32a1d['mhgJd'](JSON['stringify'](_0x22d3b1,null,0x2),'\x0a')),console[_0x50b515(0xd1)](_0xb32a1d[_0x50b515(0xde)]),{'configured':!![],'scope':_0x38f7c4};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4efd13,_0x1333ea){const _0x133552=_0x1c16,_0x3da377=_0x4efd13();while(!![]){try{const _0x55b750=-parseInt(_0x133552(0x12a))/0x1+parseInt(_0x133552(0x118))/0x2+-parseInt(_0x133552(0x12f))/0x3*(parseInt(_0x133552(0x129))/0x4)+parseInt(_0x133552(0x105))/0x5*(parseInt(_0x133552(0x127))/0x6)+parseInt(_0x133552(0x11d))/0x7+-parseInt(_0x133552(0x101))/0x8+-parseInt(_0x133552(0x10f))/0x9;if(_0x55b750===_0x1333ea)break;else _0x3da377['push'](_0x3da377['shift']());}catch(_0x21aa16){_0x3da377['push'](_0x3da377['shift']());}}}(_0x22cc,0xb2596));import{mkdir,readFile,readdir}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{authenticate,ensureRangerDir,ensureChromium,writeRangerGitignore}from'./start.js';function _0x22cc(){const _0x580a42=['filter','14310vQIlPe','plugin','install','No\x20API\x20token\x20available\x20for\x20decryption','ktmGt','SwnyJ','✓\x20Encrypted\x20auth\x20verified\x20(will\x20decrypt\x20at\x20runtime)','Failed\x20to\x20add\x20marketplace:','BLlOJ','path','4347135CnLhou','Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.','length','\x0a✅\x20Ranger\x20CI\x20setup\x20complete!\x0a','trackPhaseStart','No\x20CI\x20profiles\x20found.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','flCje','No\x20CI\x20profiles\x20found\x20in\x20.ranger/ci/.\x20Create\x20one\x20first\x20with:\x20ranger\x20profile\x20add\x20<name>\x20--ci\x0a','error','1947206tgxxRc','vZZHF','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20project','oTPUj','\x22\x20has\x20no\x20settings.json.\x20Use\x20--base-url\x20to\x20configure\x20it.','8107078SSbSQG','wlkOL','ZCOTV','\x22:\x20','dir_setup','sessions','log','AiiPP','skipChromium','.\x20Use\x20--profile\x20to\x20specify\x20which\x20one.','2520dxcNgn','GXTxR','643172CBpBRs','125107VkKYuY','ZMkAS','✓\x20Marketplace\x20already\x20added','project','rJIaY','15SGmEhx','join','baseUrl','wilrR','Multiple\x20CI\x20profiles\x20found:\x20','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','add','You\x20can\x20install\x20manually:\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','skills','isDirectory','faORS','trackPhaseEnd','noOtp','name','Failed\x20to\x20verify\x20encrypted\x20auth\x20for\x20profile\x20\x22','fRYSe','Installing\x20Claude\x20Code\x20plugin\x20(project\x20level)...','CI\x20profile\x20\x22','HoFKm','9529536iKYjwV','Auto-detected\x20CI\x20profile:\x20','chromium'];_0x22cc=function(){return _0x580a42;};return _0x22cc();}import{skillup}from'./skillup.js';import{getRangerDir}from'./utils/rangerRoot.js';import{writeActiveProfileName}from'./utils/activeProfile.js';import{saveSettings}from'./utils/settings.js';import{decrypt}from'./utils/crypto.js';import{getToken}from'./utils/keychain.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'./utils/claudePlugin.js';async function findCiProfile(_0x2e7d20){const _0x5a6986=_0x1c16,_0x11a86f={'FGvzz':function(_0x38da0e){return _0x38da0e();},'gJksD':function(_0x1ebd56,_0x176cfb,_0x1be13e){return _0x1ebd56(_0x176cfb,_0x1be13e);},'wilrR':function(_0x26b56b,_0x17001a){return _0x26b56b(_0x17001a);},'noOtp':_0x5a6986(0x114)},_0x369d9b=_0x11a86f['FGvzz'](getRangerDir),_0x4a7aad=_0x11a86f['gJksD'](join,_0x369d9b,'ci');if(_0x2e7d20){const _0x3c8ab2=join(_0x4a7aad,_0x2e7d20);return{'name':_0x2e7d20,'path':_0x3c8ab2};}if(!_0x11a86f[_0x5a6986(0x132)](existsSync,_0x4a7aad))throw new Error(_0x11a86f[_0x5a6986(0xfa)]+'Or\x20specify\x20a\x20profile\x20name\x20with\x20--profile\x20and\x20--base-url\x20to\x20create\x20one.');const _0x4cf075=await readdir(_0x4a7aad,{'withFileTypes':!![]}),_0x1e3930=_0x4cf075[_0x5a6986(0x104)](_0x18d8eb=>_0x18d8eb[_0x5a6986(0xf7)]())['map'](_0x1fc710=>_0x1fc710[_0x5a6986(0xfb)]);if(_0x1e3930[_0x5a6986(0x111)]===0x0)throw new Error(_0x5a6986(0x116)+_0x5a6986(0x110));if(_0x1e3930['length']===0x1){const _0x4b56c4=_0x1e3930[0x0];return console[_0x5a6986(0x123)](_0x5a6986(0x102)+_0x4b56c4),{'name':_0x4b56c4,'path':_0x11a86f['gJksD'](join,_0x4a7aad,_0x4b56c4)};}throw new Error(_0x5a6986(0x133)+_0x1e3930[_0x5a6986(0x130)](',\x20')+_0x5a6986(0x126));}function _0x1c16(_0xbb27f8,_0xc46af7){_0xbb27f8=_0xbb27f8-0xf7;const _0x22cc98=_0x22cc();let _0x1c1665=_0x22cc98[_0xbb27f8];return _0x1c1665;}async function installPluginNonInteractive(){const _0x301713=_0x1c16,_0x3266e4={'GXTxR':function(_0x2c5218,_0x53ff47){return _0x2c5218(_0x53ff47);},'BkAxz':function(_0x143aa6,_0x3403b4){return _0x143aa6(_0x3403b4);},'NGnwt':_0x301713(0x12c),'NIAki':'ranger-testing/trailhead','ZCOTV':_0x301713(0x136),'faORS':_0x301713(0x107),'JhCPD':'--scope','fRYSe':_0x301713(0x12d),'yVwKa':_0x301713(0x11a),'wlkOL':'✓\x20Claude\x20Code\x20plugin\x20installed'},_0x3a56d5=await _0x3266e4['GXTxR'](isPluginInstalled,'ranger@trailhead');if(_0x3a56d5)return console['log'](_0x301713(0x134)),![];console['log'](_0x301713(0xfe));const _0x3b58b0=await _0x3266e4['BkAxz'](isMarketplaceAdded,'trailhead');let _0x54a7f5=_0x3b58b0;if(_0x3b58b0)console['log'](_0x3266e4['NGnwt']);else{const _0x569b5b=await _0x3266e4[_0x301713(0x128)](runClaudeCommand,['plugin','marketplace',_0x301713(0x135),_0x3266e4['NIAki']]);!_0x569b5b['success']?(console['error'](_0x301713(0x10c),_0x569b5b[_0x301713(0x117)]),console['log'](_0x3266e4[_0x301713(0x11f)])):_0x54a7f5=!![];}if(_0x54a7f5){const _0x484f70=await runClaudeCommand(['plugin',_0x3266e4[_0x301713(0xf8)],'ranger@trailhead',_0x3266e4['JhCPD'],_0x3266e4[_0x301713(0xfd)]]);!_0x484f70['success']?(console[_0x301713(0x117)]('Failed\x20to\x20install\x20plugin:',_0x484f70['error']),console['log'](_0x3266e4['yVwKa'])):console[_0x301713(0x123)](_0x3266e4[_0x301713(0x11e)]);}return!![];}export async function setupCi(_0x19fec1,_0x192c71,_0xa795b0){const _0xecb60d=_0x1c16,_0x132717={'flCje':'auth','AiiPP':function(_0x93168d,_0x21d028,_0x258662){return _0x93168d(_0x21d028,_0x258662);},'rJIaY':_0xecb60d(0x122),'LDqxv':function(_0x2f69d4,_0x4af0f7,_0x5621fe){return _0x2f69d4(_0x4af0f7,_0x5621fe);},'ZMkAS':_0xecb60d(0x103),'KeBAn':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','biunz':function(_0x17fac9){return _0x17fac9();},'GxHmi':'settings.json','ktmGt':function(_0x5a9886,_0xef7316,_0x4a4ff5){return _0x5a9886(_0xef7316,_0x4a4ff5);},'vxaak':'auth.json','ZKZQi':function(_0x258694,_0x46860f,_0x28f2b9){return _0x258694(_0x46860f,_0x28f2b9);},'SwnyJ':'auth.json.enc','BLlOJ':function(_0x332e40,_0x3ca99b){return _0x332e40(_0x3ca99b);},'HoFKm':function(_0x40b9e5,_0x5484a8){return _0x40b9e5 instanceof _0x5484a8;},'dPjUr':'✓\x20Auth\x20state\x20found','rQJQf':'\x20\x20No\x20auth\x20state\x20found\x20(app\x20may\x20not\x20require\x20authentication)','HnsLn':function(_0x54b669,_0xfc130e){return _0x54b669(_0xfc130e);},'fOfgu':'profile_activate','mVAAQ':_0xecb60d(0x106),'tCFgq':'skills','oTPUj':function(_0x3332eb,_0x3b42f0){return _0x3332eb(_0x3b42f0);},'vZZHF':_0xecb60d(0x12d)};console['log']('\x0a🔧\x20Ranger\x20CI\x20Setup\x0a'),_0xa795b0?.[_0xecb60d(0x113)](_0x132717[_0xecb60d(0x115)]),await authenticate(_0x19fec1),_0xa795b0?.[_0xecb60d(0xf9)]('auth'),_0xa795b0?.[_0xecb60d(0x113)](_0xecb60d(0x121));const {path:_0x4f38b5,installed:_0x4f1479}=await ensureRangerDir();await writeRangerGitignore(_0x4f38b5);const _0x2ba13e=_0x132717['AiiPP'](join,_0x4f38b5,_0x132717[_0xecb60d(0x12e)]);!existsSync(_0x2ba13e)&&await _0x132717['LDqxv'](mkdir,_0x2ba13e,{'recursive':!![]});_0xa795b0?.['trackPhaseEnd']('dir_setup',{'installed':_0x4f1479}),_0xa795b0?.[_0xecb60d(0x113)](_0x132717[_0xecb60d(0x12b)]);let _0x4b3371=![];_0x192c71?.[_0xecb60d(0x125)]?console[_0xecb60d(0x123)](_0x132717['KeBAn']):_0x4b3371=await _0x132717['biunz'](ensureChromium);_0xa795b0?.[_0xecb60d(0xf9)](_0x132717['ZMkAS'],{'installed':_0x4b3371,'skipped':!!_0x192c71?.['skipChromium']}),_0xa795b0?.[_0xecb60d(0x113)]('profile_activate');const _0x335e80=await findCiProfile(_0x192c71?.['profile']);let _0x2327b7=![];_0x192c71?.[_0xecb60d(0x131)]&&(await mkdir(_0x335e80['path'],{'recursive':!![]}),await saveSettings(_0x335e80[_0xecb60d(0xfb)],{'baseUrl':_0x192c71[_0xecb60d(0x131)],'headless':!![]}),console['log']('✓\x20Created\x20profile\x20settings:\x20baseUrl='+_0x192c71[_0xecb60d(0x131)]),_0x2327b7=!![]);const _0x3aa928=_0x132717[_0xecb60d(0x124)](join,_0x335e80[_0xecb60d(0x10e)],_0x132717['GxHmi']);if(!existsSync(_0x3aa928)&&!_0x2327b7)throw new Error(_0xecb60d(0xff)+_0x335e80[_0xecb60d(0xfb)]+_0xecb60d(0x11c));const _0x3ab628=_0x132717[_0xecb60d(0x109)](join,_0x335e80['path'],_0x132717['vxaak']),_0x30b889=_0x132717['ZKZQi'](join,_0x335e80['path'],_0x132717[_0xecb60d(0x10a)]),_0x478539=_0x132717[_0xecb60d(0x10d)](existsSync,_0x3ab628),_0x2f6943=_0x132717[_0xecb60d(0x10d)](existsSync,_0x30b889);if(_0x2f6943)try{const _0x45efa0=await _0x132717['biunz'](getToken);if(!_0x45efa0)throw new Error(_0xecb60d(0x108));const _0xbf55d3=await _0x132717[_0xecb60d(0x10d)](readFile,_0x30b889);decrypt(_0xbf55d3,_0x45efa0),console[_0xecb60d(0x123)](_0xecb60d(0x10b));}catch(_0x1fe2d9){const _0x176918=_0x132717[_0xecb60d(0x100)](_0x1fe2d9,Error)?_0x1fe2d9['message']:_0x132717['BLlOJ'](String,_0x1fe2d9);throw new Error(_0xecb60d(0xfc)+_0x335e80[_0xecb60d(0xfb)]+_0xecb60d(0x120)+_0x176918);}else _0x478539?console['log'](_0x132717['dPjUr']):console['log'](_0x132717['rQJQf']);await _0x132717['HnsLn'](writeActiveProfileName,_0x335e80[_0xecb60d(0xfb)]),console[_0xecb60d(0x123)]('✓\x20Active\x20profile:\x20'+_0x335e80[_0xecb60d(0xfb)]),_0xa795b0?.['trackPhaseEnd'](_0x132717['fOfgu'],{'profileName':_0x335e80[_0xecb60d(0xfb)],'hasAuth':_0x478539,'hasEncryptedAuth':_0x2f6943,'createdSettings':_0x2327b7}),_0xa795b0?.[_0xecb60d(0x113)](_0x132717['mVAAQ']);const _0x58ff06=await _0x132717['biunz'](installPluginNonInteractive);_0xa795b0?.[_0xecb60d(0xf9)]('plugin',{'installed':_0x58ff06}),_0xa795b0?.[_0xecb60d(0x113)](_0x132717['tCFgq']),await _0x132717[_0xecb60d(0x11b)](skillup,{'autoInstall':_0x132717[_0xecb60d(0x119)]}),_0xa795b0?.[_0xecb60d(0xf9)](_0xecb60d(0x137)),console['log'](_0xecb60d(0x112));}
|
|
1
|
+
function _0x222d(_0x4aacbd,_0xe7828b){_0x4aacbd=_0x4aacbd-0x1df;var _0x1b254e=_0x1b25();var _0x222d1f=_0x1b254e[_0x4aacbd];return _0x222d1f;}(function(_0x274571,_0x2a1c3c){var _0x27081a=_0x222d,_0x3a4f9a=_0x274571();while(!![]){try{var _0x1cbc1e=-parseInt(_0x27081a(0x1e0))/0x1+parseInt(_0x27081a(0x1e8))/0x2*(-parseInt(_0x27081a(0x1e4))/0x3)+-parseInt(_0x27081a(0x1e3))/0x4+parseInt(_0x27081a(0x1ea))/0x5+-parseInt(_0x27081a(0x1ee))/0x6+-parseInt(_0x27081a(0x1e2))/0x7*(-parseInt(_0x27081a(0x1df))/0x8)+parseInt(_0x27081a(0x1e5))/0x9;if(_0x1cbc1e===_0x2a1c3c)break;else _0x3a4f9a['push'](_0x3a4f9a['shift']());}catch(_0x2fe1e6){_0x3a4f9a['push'](_0x3a4f9a['shift']());}}}(_0x1b25,0x50d28));export async function setupCi(_0x4780ad,_0x45f54c,_0x357b78){var _0x55c676=_0x222d,_0x547fa6={'tdEJK':function(_0x378563,_0x341c12){return _0x378563+_0x341c12;},'gJuGa':'ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','orTib':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','szrTx':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','cbTfB':_0x55c676(0x1e1)};console[_0x55c676(0x1e7)](_0x547fa6['tdEJK'](_0x547fa6[_0x55c676(0x1e6)](_0x547fa6[_0x55c676(0x1e6)](_0x547fa6['gJuGa'],'\x0a')+_0x547fa6[_0x55c676(0x1ed)],_0x547fa6[_0x55c676(0x1e9)])+'\x0a'+_0x547fa6['cbTfB'],_0x55c676(0x1ec))),process[_0x55c676(0x1eb)](0x1);}function _0x1b25(){var _0x2aecda=['For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','601706KTEnok','449020xaEFdm','6LbdiMD','5432220mUWzoL','tdEJK','error','51478STlxAP','szrTx','2748060geQiyb','exit','\x20\x20https://docs.ranger.net/main/concepts/profiles','orTib','2560008CfpDfp','32EUuhEE','575575hcOvRl'];_0x1b25=function(){return _0x2aecda;};return _0x1b25();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x304296,_0x36418e){const _0x55166d=_0x3e6e,_0x211f3c=_0x304296();while(!![]){try{const _0x5ed125=parseInt(_0x55166d(0xc3))/0x1+-parseInt(_0x55166d(0xb3))/0x2*(parseInt(_0x55166d(0xca))/0x3)+-parseInt(_0x55166d(0xbd))/0x4+parseInt(_0x55166d(0xcd))/0x5*(-parseInt(_0x55166d(0xd4))/0x6)+-parseInt(_0x55166d(0xbb))/0x7*(parseInt(_0x55166d(0xbf))/0x8)+-parseInt(_0x55166d(0xd3))/0x9+parseInt(_0x55166d(0xc2))/0xa;if(_0x5ed125===_0x36418e)break;else _0x211f3c['push'](_0x211f3c['shift']());}catch(_0x317804){_0x211f3c['push'](_0x211f3c['shift']());}}}(_0xe599,0xdf79c));import{basename}from'path';import _0x3ac249 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 _0xe599(){const _0x41d735=['zYxkG','mBRAg','13507272ZlMDAo','106242hpwVrH','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','XgoIB','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','\x20\x202.\x20Run:\x20ranger\x20setup','installLevel','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','\x0a📦\x20Installing\x20skills...\x0a','All\x20projects\x20(','ranger','To\x20get\x20started:','log','qxBuk','/skills/','user','40162OfAkSg','mIQoM','stdin','opencode','stdout','Where\x20should\x20skills\x20be\x20installed?','KEspv','message','10905412zMvLJT','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','1495288OoZrYQ','list','8GlqqkD','TYteb','prompt','53688360ZagZdX','582780zsUGOL','vGlaK','yzbeo','To\x20use:','itLGH','suppressUsage','MIYvy','147VzebQi','\x20--opencode','NDiCE','175pbtcjQ','/.opencode/skills/','wOkPS','atcnI'];_0xe599=function(){return _0x41d735;};return _0xe599();}import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';function _0x3e6e(_0x26d724,_0x2d3f2a){_0x26d724=_0x26d724-0xb3;const _0xe59997=_0xe599();let _0x3e6edc=_0xe59997[_0x26d724];return _0x3e6edc;}export async function skillup(_0xc0c69c={}){const _0x3a7ede=_0x3e6e,_0x533302={'XgoIB':'claude','Dgtqu':_0x3a7ede(0xd7),'MIYvy':_0x3a7ede(0xde),'qxBuk':'\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','wOkPS':function(_0x5ecb0c,_0x16c891){return _0x5ecb0c===_0x16c891;},'TYteb':function(_0x369a19,_0x3662b5){return _0x369a19===_0x3662b5;},'itLGH':_0x3a7ede(0xb6),'YtUtW':_0x3a7ede(0xcb),'yzbeo':'✓\x20Found\x20API\x20token','mBRAg':function(_0x3467f7){return _0x3467f7();},'FSTxj':function(_0x59a8fb,_0x5470b4){return _0x59a8fb(_0x5470b4);},'qPvno':_0x3a7ede(0xd9),'vGlaK':_0x3a7ede(0xb8),'FyOgs':_0x3a7ede(0xe2),'zYxkG':'project','VZvhc':_0x3a7ede(0xdb),'NDiCE':function(_0x4406ac,_0x417941,_0x142d62){return _0x4406ac(_0x417941,_0x142d62);},'OlVuv':'\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','mIQoM':function(_0xe92933,_0x2716a6){return _0xe92933===_0x2716a6;},'fSrGX':'user-level','KEspv':'\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!','atcnI':_0x3a7ede(0xd5)};console['log']('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x2122d2=_0xc0c69c['platform']??_0x533302[_0x3a7ede(0xd6)],_0x4948a0=await getToken();if(!_0x4948a0){console[_0x3a7ede(0xdf)](_0x533302['Dgtqu']),console[_0x3a7ede(0xdf)](_0x533302[_0x3a7ede(0xc9)]),console[_0x3a7ede(0xdf)](_0x533302[_0x3a7ede(0xe0)]),console['log'](_0x3a7ede(0xd8)+(_0x533302[_0x3a7ede(0xcf)](_0x2122d2,_0x3a7ede(0xb6))?'\x20--opencode':'')+'\x20<your-api-token>'),console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x533302[_0x3a7ede(0xc0)](_0x2122d2,_0x533302['itLGH'])?_0x533302['YtUtW']:'')+'\x0a');return;}console[_0x3a7ede(0xdf)](_0x533302[_0x3a7ede(0xc5)]);const _0x2dd6f2=_0x533302[_0x3a7ede(0xd2)](getProjectRoot),_0x1c1444=basename(_0x2dd6f2),_0x26ae2e=_0x2122d2==='opencode'?_0x533302['FSTxj'](getOpencodeConfigDir,'user')+_0x3a7ede(0xe1):getClaudeConfigDir()+'/skills/',_0x218ae0=_0x2122d2===_0x533302[_0x3a7ede(0xc7)]?_0x2dd6f2+_0x3a7ede(0xce):_0x2dd6f2+'/.claude/skills/',_0x1e0f1c=process[_0x3a7ede(0xb5)]['isTTY']&&process[_0x3a7ede(0xb7)]['isTTY'];let _0x8666f7;if(_0xc0c69c['autoInstall'])_0x8666f7=_0xc0c69c['autoInstall'];else{if(_0x1e0f1c){const _0xe325fb=await _0x3ac249[_0x3a7ede(0xc1)]([{'type':_0x3a7ede(0xbe),'name':_0x533302['qPvno'],'message':_0x533302[_0x3a7ede(0xc4)],'choices':[{'name':_0x3a7ede(0xdc)+_0x26ae2e+')','value':_0x533302['FyOgs']},{'name':'This\x20project\x20only\x20('+_0x218ae0+')','value':_0x533302['zYxkG']}]}]);_0x8666f7=_0xe325fb['installLevel'];}else _0x8666f7=_0x533302[_0x3a7ede(0xd1)],console['log'](_0x3a7ede(0xda)+_0x218ae0+')');}let _0x1eb0ef=0x0;const _0x3978a4=getCurrentVersion();console['log'](_0x533302['VZvhc']);try{const _0xefc3b3=await _0x533302[_0x3a7ede(0xcc)](installSkill,_0x3a7ede(0xdd),{'cliVersion':_0x3978a4,'level':_0x8666f7,'platform':_0x2122d2});_0xefc3b3&&_0x1eb0ef++;}catch(_0x5c6fbd){console['warn'](_0x533302['OlVuv'],_0x5c6fbd instanceof Error?_0x5c6fbd[_0x3a7ede(0xba)]:_0x5c6fbd);}if(_0x1eb0ef>0x0){const _0x384680=_0x533302[_0x3a7ede(0xb4)](_0x8666f7,_0x3a7ede(0xe2))?_0x533302['fSrGX']:'project-level';console[_0x3a7ede(0xdf)]('\x0a✅\x20Installed\x20'+_0x1eb0ef+'\x20'+_0x384680+'\x20skill'+(_0x1eb0ef>0x1?'s':'')+'\x20successfully!\x0a'),!_0xc0c69c[_0x3a7ede(0xc8)]&&(console['log'](_0x3a7ede(0xc6)),_0x533302[_0x3a7ede(0xcf)](_0x2122d2,_0x533302['itLGH'])?console['log'](_0x3a7ede(0xbc)):console['log'](_0x533302[_0x3a7ede(0xb9)]));}else console['log'](_0x533302[_0x3a7ede(0xd0)]);}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x409d75=_0x3d13;(function(_0x54025f,_0x50d2a0){const _0x4a8a75=_0x3d13,_0x117fb9=_0x54025f();while(!![]){try{const _0x5711f5=-parseInt(_0x4a8a75(0xd1))/0x1*(-parseInt(_0x4a8a75(0x10c))/0x2)+parseInt(_0x4a8a75(0xf5))/0x3+-parseInt(_0x4a8a75(0xa2))/0x4*(parseInt(_0x4a8a75(0xc4))/0x5)+-parseInt(_0x4a8a75(0xc3))/0x6+parseInt(_0x4a8a75(0xc6))/0x7*(-parseInt(_0x4a8a75(0xbe))/0x8)+parseInt(_0x4a8a75(0xde))/0x9+parseInt(_0x4a8a75(0x109))/0xa*(parseInt(_0x4a8a75(0xad))/0xb);if(_0x5711f5===_0x50d2a0)break;else _0x117fb9['push'](_0x117fb9['shift']());}catch(_0x39260a){_0x117fb9['push'](_0x117fb9['shift']());}}}(_0x1009,0xcfb0a));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x469b3a from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);function _0x3d13(_0x159cdc,_0xf88f8d){_0x159cdc=_0x159cdc-0xa2;const _0x1009b9=_0x1009();let _0x3d1398=_0x1009b9[_0x159cdc];return _0x3d1398;}export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x1f6574=>_0x409d75(0xf4)+_0x1f6574+_0x409d75(0xf9);function _0x1009(){const _0x496985=['kVUDh','90WqSSvi','force','allowInsecureLocalhost','2154SkAjbP','jZcOB','2698584OPnuCz','\x20now?','✓\x20Skipping\x20authentication\x20(--skip-auth)','✓\x20Authenticated\x20to\x20','vGtpY','TEiJM','\x20may\x20need\x20a\x20one-time\x20headed\x20login\x20instead\x20—',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','✓\x20~/.ranger/\x20directory\x20already\x20exists','✓\x20Exported\x20credentials\x20for\x20CI','mXxkz','339482RDibix','prompt','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','opencode','scope','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','\x20\x20npx\x20playwright@','status','chromium','message','\x0a🚀\x20Ranger\x20Setup\x0a','provided_token','✓\x20Playwright\x20Chromium\x20browser\x20found','You\x20can\x20install\x20it\x20manually\x20by\x20running:','RANGER_TEST_USERNAME','warn','QiCjN','45984uTKJxb','npx','keVTK','AcxqW','wSKSf','8333088NlSHcm','5QalAsH','SUPix','721jlpWuz','user','success','\x0aTo\x20verify\x20with\x20a\x20browser,\x20set\x20','kTWee','The\x20required\x20version\x20(','\x0aInstalling\x20Chromium\x20browser...\x0a','XjhQh','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','trackPhaseStart','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','502WPgcpG','ignore','withDeps','\x0a⚠\x20Skipping\x20Chromium\x20installation.','--with-deps','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','local','/ranger:enable','device_auth','RbxEn','organizationName','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','\x0a\x20\x20your\x20org\x27s\x20auth\x20config\x20drives\x20which\x20flow\x20runs.','11417967tOTRFh','\x20(fallback\x20version)','YHYFx','skipAuth','ZqadV','plugin','\x20install\x20chromium','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','\x20for\x20explicit\x20profile\x20management).','ffcHi','nIayw','trackPhaseEnd','KKvWS','ready','Authentication\x20failed:\x20','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','Yzdsp','platform','isTTY','✓\x20Created\x20.ranger/.gitignore','VAHdj','✓\x20Local\x20profile\x20already\x20exists','\x1b[1m','4257483vmBAod','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','lfeJn','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','\x1b[0m','resolve','skipped','\x20and\x20prompt\x20the\x20coding','QuLXb','XOkID','stdout','error','aVwNL','btJpd','jqfXF','cDUtX','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','existing_token','log'];_0x1009=function(){return _0x496985;};return _0x1009();}export function getPlaywrightVersion(){const _0x4c6cf2=_0x409d75,_0xea7100={'ZqadV':'playwright/package.json'};try{const _0x36c2c7=require[_0x4c6cf2(0xfa)](_0xea7100[_0x4c6cf2(0xe2)]),_0x358051=require(_0x36c2c7);return _0x358051['version'];}catch{return null;}}export function installChromiumBinary(_0x2bed3b,_0x5bc291=![]){const _0x5e00c7=_0x409d75,_0x4571b8={'BjtuK':_0x5e00c7(0xd5),'wSKSf':_0x5e00c7(0xd2),'imAqv':function(_0x34f9ca,_0x3cfa8d){return _0x34f9ca===_0x3cfa8d;},'wUGhM':'error'};return new Promise((_0x15d3cc,_0x11bfb9)=>{const _0x1346da=_0x5e00c7,_0x54d166={'SUPix':function(_0x4c9f27,_0x1564e9){return _0x4c9f27===_0x1564e9;},'fKdlG':function(_0x52546f){return _0x52546f();}},_0x41de42=['playwright@'+_0x2bed3b,'install',..._0x5bc291?[_0x4571b8['BjtuK']]:[],_0x1346da(0xb5)],_0x2effe4=spawn(_0x1346da(0xbf),_0x41de42,{'stdio':[_0x4571b8[_0x1346da(0xc2)],'inherit','inherit'],'shell':_0x4571b8['imAqv'](process[_0x1346da(0xef)],'win32')});_0x2effe4['on']('close',_0x1eb962=>{const _0x221c8b=_0x1346da;_0x54d166[_0x221c8b(0xc5)](_0x1eb962,0x0)?_0x54d166['fKdlG'](_0x15d3cc):_0x11bfb9(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x1eb962));}),_0x2effe4['on'](_0x4571b8['wUGhM'],_0x39b9a6=>{_0x11bfb9(_0x39b9a6);});});}export async function authenticate(_0x5be8e6){const _0x207b04=_0x409d75,_0x501e58={'jTIVe':_0x207b04(0x106),'YHYFx':function(_0x3d7933,_0x352c69){return _0x3d7933 instanceof _0x352c69;},'KZBXY':function(_0x3194e3,_0x31e27e){return _0x3194e3(_0x31e27e);},'QiCjN':_0x207b04(0xd9),'ffcHi':'Validating\x20API\x20token...','XOkID':'✓\x20Stored\x20credentials\x20locally','QPDoO':_0x207b04(0xb8)};if(!_0x5be8e6){const _0x377b39=await getToken();if(_0x377b39){const _0x1c5d0d=await getCurrentUser(_0x377b39);if(_0x1c5d0d['success'])return console[_0x207b04(0x107)]('✓\x20Already\x20authenticated\x20to\x20'+_0x1c5d0d[_0x207b04(0xc7)]['organizationName']),{'token':_0x377b39,'method':_0x501e58['jTIVe']};}try{_0x5be8e6=await runDeviceAuthFlow();}catch(_0x447182){throw new Error('Authentication\x20failed:\x20'+(_0x501e58[_0x207b04(0xe0)](_0x447182,Error)?_0x447182['message']:_0x447182));}const _0x3fd7e6=await _0x501e58['KZBXY'](getCurrentUser,_0x5be8e6);if(!_0x3fd7e6['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x3fd7e6[_0x207b04(0x100)]);return console['log'](_0x207b04(0xa5)+_0x3fd7e6[_0x207b04(0xc7)][_0x207b04(0xdb)]),{'token':_0x5be8e6,'method':_0x501e58[_0x207b04(0xbd)]};}console['log'](_0x501e58[_0x207b04(0xe7)]);const _0x3dafb0=await _0x501e58['KZBXY'](getCurrentUser,_0x5be8e6);if(!_0x3dafb0[_0x207b04(0xc8)]){if(_0x3dafb0[_0x207b04(0xb4)])throw new Error(_0x207b04(0xec)+_0x3dafb0[_0x207b04(0x100)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x3dafb0['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x207b04(0x107)]('✓\x20Authenticated\x20to\x20'+_0x3dafb0[_0x207b04(0xc7)]['organizationName']),await _0x501e58['KZBXY'](storeToken,_0x5be8e6),console[_0x207b04(0x107)](process['env']['GITHUB_ENV']?_0x207b04(0xab):_0x501e58[_0x207b04(0xfe)]),{'token':_0x5be8e6,'method':_0x501e58['QPDoO']};}export async function ensureRangerDir(_0x2950ba){const _0x1bb19f=_0x409d75,_0x2f2de1={'mlMaV':function(_0xad10b4,_0x2cdce8){return _0xad10b4(_0x2cdce8);},'ebgDY':function(_0x358ac2,_0x510b82,_0x395fc3){return _0x358ac2(_0x510b82,_0x395fc3);},'FPJWY':'✓\x20Created\x20~/.ranger/\x20directory','fcXBx':_0x1bb19f(0xaa)};void _0x2950ba;const _0x2b8ce4=getRangerHomeDir();return!_0x2f2de1['mlMaV'](existsSync,_0x2b8ce4)?(await _0x2f2de1['ebgDY'](mkdir,_0x2b8ce4,{'recursive':!![]}),console['log'](_0x2f2de1['FPJWY']),{'path':_0x2b8ce4,'installed':!![]}):(console['log'](_0x2f2de1['fcXBx']),{'path':_0x2b8ce4,'installed':![]});}export async function ensureChromium(_0x4473c3=![]){const _0x5c8311=_0x409d75,_0x50d87f={'NbLwu':_0x5c8311(0xb9),'jreeH':function(_0x52e464){return _0x52e464();},'lgabD':function(_0x3d19c9,_0x30e09){return _0x3d19c9??_0x30e09;},'GVaER':_0x5c8311(0xdf),'kTWee':_0x5c8311(0xaf)};let _0x1f9f54=![];try{const _0x598370=chromium['executablePath']();_0x1f9f54=existsSync(_0x598370);}catch{_0x1f9f54=![];}if(_0x1f9f54)return console['log'](_0x50d87f['NbLwu']),![];const _0x4ee2e9=_0x50d87f['jreeH'](getPlaywrightVersion),_0x347335=_0x50d87f['lgabD'](_0x4ee2e9,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x434ef6=!_0x4ee2e9,_0x5d00eb=process['stdin'][_0x5c8311(0xf0)]&&process[_0x5c8311(0xff)][_0x5c8311(0xf0)];let _0x8705c6=!![];if(_0x5d00eb){const {install:_0x274337}=await _0x469b3a[_0x5c8311(0xae)]([{'type':'confirm','name':'install','message':_0x434ef6?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x347335+_0x5c8311(0xa3):_0x5c8311(0xcb)+_0x347335+_0x5c8311(0xa9),'default':!![]}]);_0x8705c6=_0x274337;}else console['log'](_0x5c8311(0xd0)+_0x347335+(_0x434ef6?_0x50d87f['GVaER']:'')+'...');if(_0x8705c6){console[_0x5c8311(0x107)](_0x5c8311(0xcc));try{await installChromiumBinary(_0x347335,_0x4473c3),console[_0x5c8311(0x107)]('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x181e52){console[_0x5c8311(0x100)](_0x5c8311(0xf8),_0x181e52 instanceof Error?_0x181e52[_0x5c8311(0xb6)]:_0x181e52),console['log'](_0x5c8311(0xba)),console[_0x5c8311(0x107)](_0x5c8311(0xb3)+_0x347335+'\x20install\x20chromium');}}else console[_0x5c8311(0x107)](_0x5c8311(0xd4)),console['log'](_0x50d87f[_0x5c8311(0xca)]),console[_0x5c8311(0x107)](_0x5c8311(0xb3)+_0x347335+_0x5c8311(0xe4));return!![];}export async function writeRangerGitignore(_0x4872eb){const _0x90f860=_0x409d75,_0x4ff283=join(_0x4872eb,'.gitignore'),_0x108d4f='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await writeFile(_0x4ff283,_0x108d4f),console[_0x90f860(0x107)](_0x90f860(0xf1));}export async function ensureLocalEnv(_0xadce61,_0x412fa7){const _0xa0f57d=_0x409d75,_0xb88090={'jJZgD':function(_0x43594a){return _0x43594a();},'trYgS':_0xa0f57d(0xc7),'vGtpY':_0xa0f57d(0xd7),'kVUDh':_0xa0f57d(0xf3),'AcxqW':function(_0x3a6a34,_0x4efdcd,_0xe5c6ed,_0x31efbd){return _0x3a6a34(_0x4efdcd,_0xe5c6ed,_0x31efbd);},'btJpd':function(_0xd03324,_0x4a57c3){return _0xd03324 instanceof _0x4a57c3;}};if(!_0xb88090['jJZgD'](findGitRoot)&&_0xadce61?.['scope']!==_0xb88090['trYgS'])return console['log']('⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.'),{'ready':![],'skipped':!![]};const _0x16a579=_0xadce61?.[_0xa0f57d(0xb1)]==='user'?getRangerHomeDir():undefined;if(findExistingEnv(_0xb88090[_0xa0f57d(0xa6)],{'locations':[_0xa0f57d(0xd7)],'rangerDir':_0x16a579}))return console['log'](_0xb88090[_0xa0f57d(0x108)]),{'ready':!![],'skipped':![]};try{return await _0xb88090[_0xa0f57d(0xc1)](addEnv,_0xb88090[_0xa0f57d(0xa6)],{'url':_0xadce61?.['url'],'force':_0xadce61?.['force'],'allowInsecureLocalhost':_0xadce61?.['allowInsecureLocalhost'],'scope':_0xadce61?.[_0xa0f57d(0xb1)]},_0x412fa7),{'ready':!![],'skipped':![]};}catch(_0x4f74ac){return console[_0xa0f57d(0x100)]('\x0a❌\x20Profile\x20setup\x20failed:',_0xb88090[_0xa0f57d(0x102)](_0x4f74ac,Error)?_0x4f74ac['message']:_0x4f74ac),{'ready':![],'skipped':![]};}}export async function start(_0x1fa4bb,_0x5b5b35,_0x1f517d){const _0x409b17=_0x409d75,_0x57ac63={'Yzdsp':'user','lfeJn':function(_0x569300,_0x36d820){return _0x569300(_0x36d820);},'cDUtX':function(_0x51bd65){return _0x51bd65();},'KKvWS':'auth','JRVGM':_0x409b17(0xfb),'KCoOA':function(_0x2210ce,_0x4ad418){return _0x2210ce(_0x4ad418);},'HFkbz':_0x409b17(0xb5),'PkPTi':'plugin','UuXzA':function(_0x2aaa18,_0x34e3b8){return _0x2aaa18&&_0x34e3b8;},'keVTK':'skills','LpElM':function(_0x2ed3c9,_0x49662e,_0x20aeb0){return _0x2ed3c9(_0x49662e,_0x20aeb0);},'XjhQh':_0x409b17(0xf6),'pBnpE':function(_0x18507b,_0x4c5d83){return _0x18507b instanceof _0x4c5d83;},'jqfXF':'profile','egpJn':function(_0x212682,_0x5632fc){return _0x212682+_0x5632fc;},'mmdZK':_0x409b17(0xbb),'TEiJM':'RANGER_TEST_PASSWORD','nIayw':'ranger\x20profile\x20add','VAHdj':_0x409b17(0xb2),'QuLXb':_0x409b17(0xce),'aVwNL':'verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','jZcOB':function(_0x2b009d,_0x205c2d){return _0x2b009d(_0x205c2d);},'qtgZt':_0x409b17(0xd8),'RbxEn':function(_0x5d3ae3,_0x24deff){return _0x5d3ae3+_0x24deff;},'mXxkz':function(_0xb66b81,_0x23d6bd){return _0xb66b81+_0x23d6bd;}};console[_0x409b17(0x107)](_0x409b17(0xb7)),_0x5b5b35={..._0x5b5b35,'scope':_0x57ac63[_0x409b17(0xee)]};const _0x1d578a=!_0x57ac63['lfeJn'](existsSync,_0x57ac63[_0x409b17(0x104)](getRangerHomeDir));await _0x57ac63['lfeJn'](ensureRangerDir,_0x57ac63[_0x409b17(0xee)]);if(_0x5b5b35?.[_0x409b17(0xe1)])console['log'](_0x409b17(0xa4)),_0x1f517d?.['trackPhaseEnd'](_0x57ac63[_0x409b17(0xea)],{'isFirstRun':_0x1d578a,'method':_0x57ac63['JRVGM']});else{_0x1f517d?.['trackPhaseStart'](_0x57ac63[_0x409b17(0xea)]);const _0x3596ce=await _0x57ac63['KCoOA'](authenticate,_0x1fa4bb);_0x1f517d?.['trackPhaseEnd']('auth',{'isFirstRun':_0x1d578a,'method':_0x3596ce['method']});}_0x1f517d?.['trackPhaseStart'](_0x409b17(0xb5));_0x5b5b35?.['skipChromium']?console[_0x409b17(0x107)]('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await ensureChromium(_0x5b5b35?.[_0x409b17(0xd3)]);_0x1f517d?.[_0x409b17(0xe9)](_0x57ac63['HFkbz'],{'isFirstRun':_0x1d578a,'skipped':!!_0x5b5b35?.['skipChromium']}),console[_0x409b17(0x107)](_0x409b17(0xd6));const _0x85fbb5=_0x5b5b35?.[_0x409b17(0xb1)],_0x2b9c66=_0x5b5b35?.[_0x409b17(0xb0)]??![];let _0x2a6924=null;_0x2b9c66?(_0x1f517d?.[_0x409b17(0xcf)](_0x409b17(0xe3)),_0x2a6924=await ensureOpencodePluginConfig(_0x85fbb5),_0x1f517d?.['trackPhaseEnd'](_0x57ac63['PkPTi'],{'isFirstRun':_0x1d578a,'opencode':!![]})):(_0x1f517d?.['trackPhaseStart'](_0x409b17(0xe3)),await ensureClaudePlugin(_0x85fbb5),_0x1f517d?.[_0x409b17(0xe9)]('plugin',{'isFirstRun':_0x1d578a}));if(_0x57ac63['UuXzA'](_0x2b9c66,_0x2a6924)){_0x1f517d?.[_0x409b17(0xcf)](_0x57ac63[_0x409b17(0xc0)]);try{await _0x57ac63['LpElM'](installSkill,'ranger',{'level':_0x2a6924['scope'],'cliVersion':_0x57ac63[_0x409b17(0x104)](getCurrentVersion),'platform':_0x409b17(0xb0)}),_0x1f517d?.[_0x409b17(0xe9)](_0x57ac63[_0x409b17(0xc0)],{'isFirstRun':_0x1d578a,'opencode':!![]});}catch(_0x1c110d){console[_0x409b17(0xbc)](_0x57ac63[_0x409b17(0xcd)],_0x57ac63['pBnpE'](_0x1c110d,Error)?_0x1c110d['message']:_0x1c110d),_0x1f517d?.[_0x409b17(0xe9)]('skills',{'isFirstRun':_0x1d578a,'opencode':!![],'failed':!![]});}}else _0x1f517d?.[_0x409b17(0xcf)]('skills'),await ensureClaudeSkills(_0x85fbb5),_0x1f517d?.['trackPhaseEnd'](_0x57ac63['keVTK'],{'isFirstRun':_0x1d578a});if(_0x5b5b35?.[_0x409b17(0xe1)])console[_0x409b17(0x107)](_0x409b17(0xed));else{if(_0x5b5b35?.['url']){_0x1f517d?.['trackPhaseStart'](_0x57ac63['jqfXF']);const _0x453232=await ensureLocalEnv({'url':_0x5b5b35['url'],'force':_0x5b5b35?.[_0x409b17(0x10a)],'allowInsecureLocalhost':_0x5b5b35?.[_0x409b17(0x10b)],'scope':'user'},_0x1f517d);_0x1f517d?.[_0x409b17(0xe9)](_0x57ac63[_0x409b17(0x103)],{'isFirstRun':_0x1d578a,'profileReady':_0x453232[_0x409b17(0xeb)],'userSkipped':_0x453232[_0x409b17(0xfb)]});}else console['log'](_0x57ac63['egpJn'](_0x409b17(0xc9)+_0x57ac63['KCoOA'](bold,_0x57ac63['mmdZK'])+'\x20'+('(and\x20'+_0x57ac63['KCoOA'](bold,_0x57ac63[_0x409b17(0xa7)])+'\x20when\x20the\x20org\x27s\x20login')+'\x0a\x20\x20config\x20uses\x20username+password).\x20Orgs\x20on\x20SSO/SAML/OAuth',_0x409b17(0xa8))+_0x409b17(0xdd)),console['log']('\x20\x20(or\x20use\x20'+_0x57ac63[_0x409b17(0xf7)](bold,_0x57ac63[_0x409b17(0xe8)])+_0x409b17(0xe6));}if(_0x2b9c66)console[_0x409b17(0x107)](_0x57ac63[_0x409b17(0xf2)]),console['log'](_0x409b17(0x105)),console[_0x409b17(0x107)](_0x57ac63[_0x409b17(0xfd)]),console['log'](_0x57ac63[_0x409b17(0x101)]);else{const _0x24275b=_0x57ac63[_0x409b17(0x10d)](bold,_0x57ac63['qtgZt']);console['log'](_0x57ac63[_0x409b17(0xda)](_0x57ac63[_0x409b17(0xac)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x24275b+_0x409b17(0xfc)+_0x409b17(0xdc),_0x409b17(0xe5)),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
|
|
1
|
+
const _0x427b40=_0x573a;(function(_0x53880a,_0x4536c7){const _0x54ca37=_0x573a,_0x2bb5a8=_0x53880a();while(!![]){try{const _0x476309=-parseInt(_0x54ca37(0x13c))/0x1*(parseInt(_0x54ca37(0x14c))/0x2)+-parseInt(_0x54ca37(0x131))/0x3*(parseInt(_0x54ca37(0x149))/0x4)+-parseInt(_0x54ca37(0x100))/0x5+-parseInt(_0x54ca37(0x118))/0x6*(-parseInt(_0x54ca37(0xff))/0x7)+parseInt(_0x54ca37(0x14d))/0x8+-parseInt(_0x54ca37(0x148))/0x9+parseInt(_0x54ca37(0x152))/0xa*(parseInt(_0x54ca37(0x14e))/0xb);if(_0x476309===_0x4536c7)break;else _0x2bb5a8['push'](_0x2bb5a8['shift']());}catch(_0x4c1773){_0x2bb5a8['push'](_0x2bb5a8['shift']());}}}(_0x2286,0xe4cc1));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x249681 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';function _0x2286(){const _0x222506=['✓\x20Already\x20authenticated\x20to\x20','QDvCs','chromium','BwMcG','method','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','qiRmy','prompt','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','szGBM','RYxoG','194243MaDyon','8643845iyshjP','organizationName','FoEoi','version','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','skipChromium','profile','The\x20required\x20version\x20(','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','yZQnj','YeJcd','sQMoc','exit','warn','status','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','fGZEE','/ranger:enable','yIYnu','xWwpe','opencode','UhlzM','Cphna','user','354BLkjVa','force','\x0aIn\x20Claude\x20Code,\x20run\x20','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','stdout','✓\x20Created\x20~/.ranger/\x20directory','QxaoW','playwright@','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','executablePath','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','UGiCL','scope','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','allowInsecureLocalhost','Validating\x20API\x20token...','GyNcO','XCiQC','env','stdin','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','87rOBKNv','NGlVY','Authentication\x20failed:\x20','iNoOq','\x20is\x20no\x20longer\x20supported.\x20','pnJHm','\x1b[1m','\x0aInstalling\x20Chromium\x20browser...\x0a',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','log','XLNVA','116913ahlbBT','YYoFH','skipAuth','TuHKx','aYwUy','✓\x20Stored\x20credentials\x20locally','lyARE','isTTY','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','BnlSO','NrjYm','\x20install\x20chromium','7522425OEqOQO','103516TMXzou','success','trackPhaseEnd','18gkimGQ','2044712OFanUC','500379PtMbCw','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','GITHUB_ENV','zEHsW','750YVBerN','vGVRj','ready','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','.gitignore','...','message','error','trackPhaseStart','close','\x1b[0m'];_0x2286=function(){return _0x222506;};return _0x2286();}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';function _0x573a(_0x23a8f2,_0x482399){_0x23a8f2=_0x23a8f2-0xf0;const _0x228630=_0x2286();let _0x573a7a=_0x228630[_0x23a8f2];return _0x573a7a;}const bold=_0x5595e2=>_0x427b40(0x137)+_0x5595e2+_0x427b40(0xf3);export function getPlaywrightVersion(){const _0x16c108=_0x427b40,_0x1afd5e={'HiNYq':'playwright/package.json'};try{const _0x752ad6=require['resolve'](_0x1afd5e['HiNYq']),_0x29adfe=require(_0x752ad6);return _0x29adfe[_0x16c108(0x103)];}catch{return null;}}export function installChromiumBinary(_0x4946d9,_0x2a562b=![]){const _0x42d163=_0x427b40,_0x172892={'YYoFH':function(_0x5d4162,_0x63e94c){return _0x5d4162===_0x63e94c;},'LTujd':'install','xoDfR':'--with-deps','YCyXC':function(_0x427ba6,_0x3edffa,_0x172be9,_0x29de21){return _0x427ba6(_0x3edffa,_0x172be9,_0x29de21);},'NGlVY':'ignore','UhlzM':'inherit','qiRmy':'win32','mUkzJ':_0x42d163(0xf2),'TuHKx':_0x42d163(0xf0)};return new Promise((_0x53ec24,_0xe03806)=>{const _0x4994be=_0x42d163,_0xfd872e={'tUXal':function(_0x3d6261,_0x2aa660){const _0xd1277f=_0x573a;return _0x172892[_0xd1277f(0x13d)](_0x3d6261,_0x2aa660);},'NrjYm':function(_0x43a39a,_0x378a4b){return _0x43a39a(_0x378a4b);}},_0x5d1fd7=[_0x4994be(0x11f)+_0x4946d9,_0x172892['LTujd'],..._0x2a562b?[_0x172892['xoDfR']]:[],'chromium'],_0x5d177d=_0x172892['YCyXC'](spawn,'npx',_0x5d1fd7,{'stdio':[_0x172892[_0x4994be(0x132)],_0x172892['UhlzM'],_0x172892[_0x4994be(0x115)]],'shell':_0x172892['YYoFH'](process['platform'],_0x172892[_0x4994be(0xfa)])});_0x5d177d['on'](_0x172892['mUkzJ'],_0x9c6e47=>{_0xfd872e['tUXal'](_0x9c6e47,0x0)?_0x53ec24():_0xe03806(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x9c6e47));}),_0x5d177d['on'](_0x172892[_0x4994be(0x13f)],_0x12ddd4=>{const _0x18c998=_0x4994be;_0xfd872e[_0x18c998(0x146)](_0xe03806,_0x12ddd4);});});}export async function authenticate(_0x30f693){const _0x3f095b=_0x427b40,_0x354453={'yZQnj':function(_0x2cb7a5){return _0x2cb7a5();},'DToGE':function(_0x38afd1,_0x29b22b){return _0x38afd1(_0x29b22b);},'nzJHA':_0x3f095b(0x12b),'QDvCs':_0x3f095b(0x141),'nQttm':'provided_token'};if(!_0x30f693){const _0x31551a=await _0x354453[_0x3f095b(0x109)](getToken);if(_0x31551a){const _0x3beec5=await getCurrentUser(_0x31551a);if(_0x3beec5[_0x3f095b(0x14a)])return console[_0x3f095b(0x13a)](_0x3f095b(0xf4)+_0x3beec5[_0x3f095b(0x117)][_0x3f095b(0x101)]),{'token':_0x31551a,'method':'existing_token'};}try{_0x30f693=await runDeviceAuthFlow();}catch(_0x19d51a){throw new Error('Authentication\x20failed:\x20'+(_0x19d51a instanceof Error?_0x19d51a[_0x3f095b(0x158)]:_0x19d51a));}const _0x2dafcd=await _0x354453['DToGE'](getCurrentUser,_0x30f693);if(!_0x2dafcd[_0x3f095b(0x14a)])throw new Error(_0x3f095b(0x104)+_0x2dafcd['error']);return console['log']('✓\x20Authenticated\x20to\x20'+_0x2dafcd['user']['organizationName']),{'token':_0x30f693,'method':'device_auth'};}console['log'](_0x354453['nzJHA']);const _0x4127a0=await getCurrentUser(_0x30f693);if(!_0x4127a0['success']){if(_0x4127a0[_0x3f095b(0x10e)])throw new Error(_0x3f095b(0x133)+_0x4127a0[_0x3f095b(0xf0)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x4127a0[_0x3f095b(0xf0)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x3f095b(0x13a)]('✓\x20Authenticated\x20to\x20'+_0x4127a0[_0x3f095b(0x117)][_0x3f095b(0x101)]),await _0x354453['DToGE'](storeToken,_0x30f693),console['log'](process[_0x3f095b(0x12e)][_0x3f095b(0x150)]?'✓\x20Exported\x20credentials\x20for\x20CI':_0x354453[_0x3f095b(0xf5)]),{'token':_0x30f693,'method':_0x354453['nQttm']};}export async function ensureRangerDir(_0x531ec3){const _0x5ef62c=_0x427b40,_0x4bf41f={'BLdwm':function(_0x1c0608,_0xcb52f8,_0xff1848){return _0x1c0608(_0xcb52f8,_0xff1848);},'WQcDG':_0x5ef62c(0x11d)};void _0x531ec3;const _0x326b67=getRangerHomeDir();return!existsSync(_0x326b67)?(await _0x4bf41f['BLdwm'](mkdir,_0x326b67,{'recursive':!![]}),console['log'](_0x4bf41f['WQcDG']),{'path':_0x326b67,'installed':!![]}):(console['log']('✓\x20~/.ranger/\x20directory\x20already\x20exists'),{'path':_0x326b67,'installed':![]});}export async function ensureChromium(_0x4a869e=![]){const _0x42cfd3=_0x427b40,_0x392419={'ZfvXx':function(_0x5f40d5){return _0x5f40d5();},'fGZEE':function(_0x1362d0,_0x563e30){return _0x1362d0??_0x563e30;},'mFPyB':'install','aYwUy':'\x20(fallback\x20version)','YeJcd':_0x42cfd3(0x138),'xWwpe':function(_0x5c10e7,_0x11e635,_0x5208f2){return _0x5c10e7(_0x11e635,_0x5208f2);},'QxaoW':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','VRPRF':function(_0x2bd2c6,_0x464620){return _0x2bd2c6 instanceof _0x464620;},'ohVoN':'You\x20can\x20install\x20it\x20manually\x20by\x20running:','eVVxw':'\x0a⚠\x20Skipping\x20Chromium\x20installation.'};let _0x329da1=![];try{const _0x3d35d5=chromium[_0x42cfd3(0x124)]();_0x329da1=existsSync(_0x3d35d5);}catch{_0x329da1=![];}if(_0x329da1)return console[_0x42cfd3(0x13a)]('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x1eeeb1=_0x392419['ZfvXx'](getPlaywrightVersion),_0xb012c4=_0x392419[_0x42cfd3(0x110)](_0x1eeeb1,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x4e2bb7=!_0x1eeeb1,_0x3e5d96=process[_0x42cfd3(0x12f)][_0x42cfd3(0x143)]&&process[_0x42cfd3(0x11c)][_0x42cfd3(0x143)];let _0x4c820c=!![];if(_0x3e5d96){const {install:_0x8d7d65}=await _0x249681[_0x42cfd3(0xfb)]([{'type':'confirm','name':_0x392419['mFPyB'],'message':_0x4e2bb7?_0x42cfd3(0x155)+_0xb012c4+'\x20now?':_0x42cfd3(0x107)+_0xb012c4+_0x42cfd3(0x139),'default':!![]}]);_0x4c820c=_0x8d7d65;}else console[_0x42cfd3(0x13a)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0xb012c4+(_0x4e2bb7?_0x392419[_0x42cfd3(0x140)]:'')+_0x42cfd3(0x157));if(_0x4c820c){console['log'](_0x392419[_0x42cfd3(0x10a)]);try{await _0x392419[_0x42cfd3(0x113)](installChromiumBinary,_0xb012c4,_0x4a869e),console['log'](_0x392419[_0x42cfd3(0x11e)]);}catch(_0x288a05){console['error'](_0x42cfd3(0x130),_0x392419['VRPRF'](_0x288a05,Error)?_0x288a05[_0x42cfd3(0x158)]:_0x288a05),console[_0x42cfd3(0x13a)](_0x392419['ohVoN']),console['log']('\x20\x20npx\x20playwright@'+_0xb012c4+'\x20install\x20chromium');}}else console[_0x42cfd3(0x13a)](_0x392419['eVVxw']),console[_0x42cfd3(0x13a)]('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console['log']('\x20\x20npx\x20playwright@'+_0xb012c4+_0x42cfd3(0x147));return!![];}export async function writeRangerGitignore(_0xd96bfc){const _0x1ea663=_0x427b40,_0x527358={'RYxoG':function(_0x125bcf,_0x19e65d,_0x904d90){return _0x125bcf(_0x19e65d,_0x904d90);},'UGiCL':_0x1ea663(0x156),'vGVRj':function(_0x45e2e0,_0x5ae320,_0x5aba27){return _0x45e2e0(_0x5ae320,_0x5aba27);},'rxdxb':'✓\x20Created\x20.ranger/.gitignore'},_0x4bd058=_0x527358[_0x1ea663(0xfe)](join,_0xd96bfc,_0x527358[_0x1ea663(0x127)]),_0x306137='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await _0x527358[_0x1ea663(0x153)](writeFile,_0x4bd058,_0x306137),console['log'](_0x527358['rxdxb']);}export async function ensureLocalEnv(_0x51901d,_0x2b0500){const _0x43b5a0=_0x427b40,_0x5f22a8={'FoEoi':function(_0x5c8fe5,_0xfda466){return _0x5c8fe5!==_0xfda466;},'GyNcO':function(_0x32e696,_0x4a6fc0){return _0x32e696===_0x4a6fc0;},'zEHsW':'✓\x20Local\x20profile\x20already\x20exists','ugyRW':function(_0x4052b4,_0x3700db,_0x2ece34,_0x5e42ac){return _0x4052b4(_0x3700db,_0x2ece34,_0x5e42ac);}};if(!findGitRoot()&&_0x5f22a8[_0x43b5a0(0x102)](_0x51901d?.['scope'],'user'))return console['log'](_0x43b5a0(0x144)),{'ready':![],'skipped':!![]};const _0x5afa40=_0x5f22a8[_0x43b5a0(0x12c)](_0x51901d?.['scope'],_0x43b5a0(0x117))?getRangerHomeDir():undefined;if(findExistingEnv('local',{'locations':['local'],'rangerDir':_0x5afa40}))return console['log'](_0x5f22a8[_0x43b5a0(0x151)]),{'ready':!![],'skipped':![]};try{return await _0x5f22a8['ugyRW'](addEnv,'local',{'url':_0x51901d?.['url'],'force':_0x51901d?.[_0x43b5a0(0x119)],'allowInsecureLocalhost':_0x51901d?.[_0x43b5a0(0x12a)],'scope':_0x51901d?.['scope']},_0x2b0500),{'ready':!![],'skipped':![]};}catch(_0x249f46){return console['error']('\x0a❌\x20Profile\x20setup\x20failed:',_0x249f46 instanceof Error?_0x249f46['message']:_0x249f46),{'ready':![],'skipped':![]};}}export async function start(_0x1d94d1,_0xa190c0,_0x5c9a4c){const _0x20e082=_0x427b40,_0x342457={'SQjfL':'\x0a🚀\x20Ranger\x20Setup\x0a','lFeHy':function(_0x5ca8f1,_0x19f941){return _0x5ca8f1!==_0x19f941;},'XLNVA':function(_0x1fe17b,_0x581eae){return _0x1fe17b+_0x581eae;},'yIYnu':function(_0xfe628d,_0x116b9b){return _0xfe628d(_0x116b9b);},'BwMcG':_0x20e082(0x117),'Cphna':function(_0x265f92,_0x41c228){return _0x265f92(_0x41c228);},'iNoOq':'✓\x20Skipping\x20authentication\x20(--skip-auth)','POkpF':'auth','szGBM':_0x20e082(0xf6),'XCiQC':'plugin','pnJHm':function(_0x46eae0,_0x56cc99){return _0x46eae0(_0x56cc99);},'TXHEo':function(_0x3863db,_0x3bc10b){return _0x3863db&&_0x3bc10b;},'BnlSO':'skills','sQMoc':function(_0x2fcef,_0x2f852e,_0xda5b3f){return _0x2fcef(_0x2f852e,_0xda5b3f);},'wcNVl':'ranger','lyARE':_0x20e082(0x106),'sklCs':'ranger\x20profile\x20add\x20<name>','vgrEK':'verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'};console[_0x20e082(0x13a)](_0x342457['SQjfL']);_0x342457['lFeHy'](_0xa190c0?.[_0x20e082(0x128)],undefined)&&_0x342457['lFeHy'](_0xa190c0[_0x20e082(0x128)],'user')&&(console['error'](_0x342457[_0x20e082(0x13b)]('ranger\x20setup\x20--scope='+_0x342457[_0x20e082(0x112)](String,_0xa190c0[_0x20e082(0x128)])+_0x20e082(0x135)+_0x20e082(0x122),_0x20e082(0x126))),process[_0x20e082(0x10c)](0x1));_0xa190c0={..._0xa190c0,'scope':_0x342457[_0x20e082(0xf7)]};const _0x48ab14=!_0x342457['Cphna'](existsSync,getRangerHomeDir());await ensureRangerDir(_0x20e082(0x117));if(_0xa190c0?.[_0x20e082(0x13e)])console[_0x20e082(0x13a)](_0x342457[_0x20e082(0x134)]),_0x5c9a4c?.['trackPhaseEnd'](_0x342457['POkpF'],{'isFirstRun':_0x48ab14,'method':'skipped'});else{_0x5c9a4c?.[_0x20e082(0xf1)](_0x342457['POkpF']);const _0x19c14e=await _0x342457[_0x20e082(0x116)](authenticate,_0x1d94d1);_0x5c9a4c?.['trackPhaseEnd'](_0x342457['POkpF'],{'isFirstRun':_0x48ab14,'method':_0x19c14e[_0x20e082(0xf8)]});}_0x5c9a4c?.[_0x20e082(0xf1)](_0x342457['szGBM']);_0xa190c0?.[_0x20e082(0x105)]?console[_0x20e082(0x13a)](_0x20e082(0x10f)):await ensureChromium(_0xa190c0?.['withDeps']);_0x5c9a4c?.[_0x20e082(0x14b)](_0x342457[_0x20e082(0xfd)],{'isFirstRun':_0x48ab14,'skipped':!!_0xa190c0?.['skipChromium']}),console[_0x20e082(0x13a)](_0x20e082(0x129));const _0x5f040f=_0xa190c0?.['scope'],_0x27c7f1=_0xa190c0?.[_0x20e082(0x114)]??![];let _0x525d0b=null;_0x27c7f1?(_0x5c9a4c?.['trackPhaseStart'](_0x342457[_0x20e082(0x12d)]),_0x525d0b=await _0x342457[_0x20e082(0x136)](ensureOpencodePluginConfig,_0x5f040f),_0x5c9a4c?.[_0x20e082(0x14b)]('plugin',{'isFirstRun':_0x48ab14,'opencode':!![]})):(_0x5c9a4c?.['trackPhaseStart'](_0x342457['XCiQC']),await ensureClaudePlugin(_0x5f040f),_0x5c9a4c?.[_0x20e082(0x14b)](_0x342457[_0x20e082(0x12d)],{'isFirstRun':_0x48ab14}));if(_0x342457['TXHEo'](_0x27c7f1,_0x525d0b)){_0x5c9a4c?.[_0x20e082(0xf1)](_0x342457[_0x20e082(0x145)]);try{await _0x342457[_0x20e082(0x10b)](installSkill,_0x342457['wcNVl'],{'level':_0x525d0b['scope'],'cliVersion':getCurrentVersion(),'platform':_0x20e082(0x114)}),_0x5c9a4c?.[_0x20e082(0x14b)]('skills',{'isFirstRun':_0x48ab14,'opencode':!![]});}catch(_0x41ce90){console[_0x20e082(0x10d)]('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x41ce90 instanceof Error?_0x41ce90[_0x20e082(0x158)]:_0x41ce90),_0x5c9a4c?.['trackPhaseEnd'](_0x342457[_0x20e082(0x145)],{'isFirstRun':_0x48ab14,'opencode':!![],'failed':!![]});}}else _0x5c9a4c?.['trackPhaseStart'](_0x342457['BnlSO']),await ensureClaudeSkills(_0x5f040f),_0x5c9a4c?.[_0x20e082(0x14b)](_0x342457['BnlSO'],{'isFirstRun':_0x48ab14});if(_0xa190c0?.['skipAuth'])console['log'](_0x20e082(0x11b));else{if(_0xa190c0?.['url']){_0x5c9a4c?.['trackPhaseStart'](_0x342457[_0x20e082(0x142)]);const _0x4883d0=await ensureLocalEnv({'url':_0xa190c0['url'],'force':_0xa190c0?.['force'],'allowInsecureLocalhost':_0xa190c0?.[_0x20e082(0x12a)],'scope':_0x342457[_0x20e082(0xf7)]},_0x5c9a4c);_0x5c9a4c?.['trackPhaseEnd'](_0x20e082(0x106),{'isFirstRun':_0x48ab14,'profileReady':_0x4883d0[_0x20e082(0x154)],'userSkipped':_0x4883d0['skipped']});}else console['log'](_0x342457['XLNVA']('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:'+('\x0a\x20\x20'+bold(_0x342457['sklCs']))+_0x20e082(0x125),_0x20e082(0x121))+_0x20e082(0x123));}if(_0x27c7f1)console[_0x20e082(0x13a)]('\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)'),console[_0x20e082(0x13a)](_0x20e082(0x120)),console['log'](_0x20e082(0x14f)),console['log'](_0x342457['vgrEK']);else{const _0x43dede=_0x342457['yIYnu'](bold,_0x20e082(0x111));console[_0x20e082(0x13a)](_0x342457[_0x20e082(0x13b)](_0x342457[_0x20e082(0x13b)](_0x20e082(0x11a)+_0x43dede+'\x20and\x20prompt\x20the\x20coding',_0x20e082(0x108))+_0x20e082(0xf9),_0x20e082(0xfc)));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x3b1eee=_0x39ae;(function(_0x11bd3c,_0x47e4d1){const _0x3d1c0c=_0x39ae,_0x5a71d1=_0x11bd3c();while(!![]){try{const _0x11d56b=-parseInt(_0x3d1c0c(0xca))/0x1+-parseInt(_0x3d1c0c(0x9a))/0x2*(parseInt(_0x3d1c0c(0x73))/0x3)+parseInt(_0x3d1c0c(0x86))/0x4+parseInt(_0x3d1c0c(0x88))/0x5+-parseInt(_0x3d1c0c(0xaf))/0x6*(parseInt(_0x3d1c0c(0x94))/0x7)+parseInt(_0x3d1c0c(0x72))/0x8*(-parseInt(_0x3d1c0c(0xb7))/0x9)+parseInt(_0x3d1c0c(0xae))/0xa;if(_0x11d56b===_0x47e4d1)break;else _0x5a71d1['push'](_0x5a71d1['shift']());}catch(_0x46c5ec){_0x5a71d1['push'](_0x5a71d1['shift']());}}}(_0x4e41,0x62017));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';function _0x4e41(){const _0x311f20=['scope','11610450zWyUGt','6BfVMoY','raISh','length','error','configured','auth.json','user','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','183798rlsYSv','wKADD','FCTDM','(not\x20found)','LRKlq','encrypted','HcUgy','\x0a---\x20Skills\x20---','cwd','\x0a---\x20Claude\x20Code\x20Plugin\x20---','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','string','Root:\x20','\x20\x20User-level:','Xhpkk','cuSHx','Version:\x20','\x1b]8;;\x07','jDwWd','152336uGxqEj','organizationName','trim','none','\x20\x20Run:\x20ranger\x20setup\x20[token]','RJwnp','parse','noWUQ','not_configured','No\x20profiles\x20configured','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','296mWvMnf','276jTuUnr','isDirectory','hLlGB','stdout','details','not_installed','version','some','siVGI','settingsPath','ivnSM','\x20\x20Run:\x20ranger\x20skillup','wiTMX','log','xPRtB','env','XkrvS','auth.json.enc','\x0a📊\x20Ranger\x20Status\x0a','2622468VmULdO','filter','821740qrhgwP','\x20(latest:\x20','@ranger-testing/opencode-plugin','HeHTD','\x20plugin(s)\x20configured','\x1b]8;;file://','displayName','data','vijdF','close','rXWiW','\x20\x20\x20\x20Auth:\x20','3893827CiZduC','SKILL.md','disabled','qWgDL','\x1b[0m','Organization:\x20','2508VprLZf','includes','map','join','API\x20URL:\x20','MFnID','\x0a---\x20Profiles\x20---','pZuTb','\x20\x20Not\x20configured','Rkfud','name','cslno','status','opencode','success','pxpJs','path','\x20\x20\x20\x20','stderr'];_0x4e41=function(){return _0x311f20;};return _0x4e41();}import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';function _0x39ae(_0x2450d8,_0x2a8579){_0x2450d8=_0x2450d8-0x72;const _0x4e4135=_0x4e41();let _0x39ae05=_0x4e4135[_0x2450d8];return _0x39ae05;}import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x5903db=>'\x1b[1m'+_0x5903db+_0x3b1eee(0x98),link=(_0x10c110,_0x128edc)=>_0x3b1eee(0x8d)+_0x10c110+'\x07'+(_0x128edc||_0x10c110)+_0x3b1eee(0xc8);async function getOpencodePluginStatus(){const _0x4a5479=_0x3b1eee,_0x50a0f4={'xjlva':function(_0x5ef4f4,_0x4de65c){return _0x5ef4f4(_0x4de65c);},'qWgDL':_0x4a5479(0x78),'wiTMX':function(_0x279444,_0x1e0ca8){return _0x279444(_0x1e0ca8);},'wKADD':_0x4a5479(0xb3),'UEuev':function(_0x14fc1e,_0x22a595){return _0x14fc1e>_0x22a595;},'vijdF':function(_0x2b18e1,_0x3e9d5c){return _0x2b18e1(_0x3e9d5c);},'MFnID':_0x4a5479(0xd2),'Xhpkk':'debug','CoJBq':'config','zsOYb':'ignore','LlElM':_0x4a5479(0x8f),'LRKlq':_0x4a5479(0x91)};return new Promise(_0x5a2d1f=>{const _0x34d575=_0x4a5479,_0x292249=spawn(_0x34d575(0xa7),[_0x50a0f4[_0x34d575(0xc5)],_0x50a0f4['CoJBq']],{'stdio':[_0x50a0f4['zsOYb'],'pipe','pipe']});let _0x4e75a0='';_0x292249[_0x34d575(0x76)]?.['on'](_0x50a0f4['LlElM'],_0x92f76c=>{_0x4e75a0+=_0x92f76c['toString']();}),_0x292249[_0x34d575(0xac)]?.['on'](_0x34d575(0x8f),_0xa1dd2a=>{_0x4e75a0+=_0xa1dd2a['toString']();}),_0x292249['on'](_0x34d575(0xb2),()=>{const _0x17f036=_0x34d575;_0x50a0f4['xjlva'](_0x5a2d1f,{'status':_0x50a0f4[_0x17f036(0x97)]});}),_0x292249['on'](_0x50a0f4[_0x34d575(0xbb)],_0x514456=>{const _0x2ea4a6=_0x34d575,_0x4c45c8={'rXWiW':'opencode-plugin'};if(_0x514456!==0x0){_0x5a2d1f({'status':_0x50a0f4['qWgDL']});return;}const _0x1ef329=_0x4e75a0[_0x2ea4a6(0xcc)]();let _0x462132=null;if(_0x1ef329)try{_0x462132=JSON[_0x2ea4a6(0xd0)](_0x1ef329);}catch{const _0x120584=_0x1ef329['match'](/\{[\s\S]*\}$/);if(_0x120584)try{_0x462132=JSON[_0x2ea4a6(0xd0)](_0x120584[0x0]);}catch{_0x462132=null;}}const _0x5a019c=Array['isArray'](_0x462132?.['plugin'])?_0x462132?.['plugin']:[],_0x38dbde=_0x5a019c[_0x2ea4a6(0x7a)](_0x43a319=>{const _0x32691a=_0x2ea4a6;if(typeof _0x43a319!==_0x32691a(0xc2))return![];return _0x43a319['includes'](_0x32691a(0x8a))||_0x43a319[_0x32691a(0x9b)](_0x4c45c8[_0x32691a(0x92)]);});if(_0x38dbde){_0x50a0f4[_0x2ea4a6(0x7f)](_0x5a2d1f,{'status':_0x50a0f4[_0x2ea4a6(0xb8)],'details':_0x50a0f4['UEuev'](_0x5a019c[_0x2ea4a6(0xb1)],0x0)?_0x5a019c['length']+_0x2ea4a6(0x8c):undefined});return;}if(_0x5a019c['length']>0x0){_0x50a0f4['vijdF'](_0x5a2d1f,{'status':_0x2ea4a6(0xd2),'details':_0x5a019c[_0x2ea4a6(0xb1)]+_0x2ea4a6(0x8c)});return;}_0x50a0f4[_0x2ea4a6(0x90)](_0x5a2d1f,{'status':_0x50a0f4[_0x2ea4a6(0x9f)]});});});}async function getSkillsFromDir(_0x4b62e3,_0x4b634a){const _0x6755ab=_0x3b1eee,_0x50f68c={'pZuTb':function(_0x5b95c4,_0x536923){return _0x5b95c4(_0x536923);},'cuSHx':function(_0x12e3af,_0x598ac8,_0x489934,_0x1396d3){return _0x12e3af(_0x598ac8,_0x489934,_0x1396d3);}};if(!_0x50f68c[_0x6755ab(0xa1)](existsSync,_0x4b62e3))return[];const _0x49ccc0=[];try{const _0x26516c=await readdir(_0x4b62e3,{'withFileTypes':!![]});for(const _0x5c6f76 of _0x26516c){if(_0x5c6f76[_0x6755ab(0x74)]()){const _0x35679b=_0x50f68c[_0x6755ab(0xc6)](join,_0x4b62e3,_0x5c6f76[_0x6755ab(0xa4)],_0x6755ab(0x95));if(_0x50f68c['pZuTb'](existsSync,_0x35679b)){let _0x19641a=_0x5c6f76[_0x6755ab(0xa4)];try{const _0x98e6f8=await readFile(_0x35679b,'utf-8'),_0xdd4d87=_0x98e6f8['match'](/name:\s*(.+)/);_0xdd4d87&&(_0x19641a=_0xdd4d87[0x1][_0x6755ab(0xcc)]());}catch{}_0x49ccc0['push']({'name':_0x5c6f76['name'],'displayName':_0x19641a,'path':_0x35679b,'level':_0x4b634a});}}}}catch{return[];}return _0x49ccc0;}async function getInstalledSkills(){const _0x3e97c9=_0x3b1eee,_0xf44a59={'MQWkw':function(_0x1be3d1,_0x41294f,_0x2db9f8){return _0x1be3d1(_0x41294f,_0x2db9f8);},'raISh':function(_0x188c65){return _0x188c65();},'SBJzE':'project','xPRtB':_0x3e97c9(0xb5)},[_0x3ba5c9,_0x34c74e]=await Promise['all']([_0xf44a59['MQWkw'](getSkillsFromDir,_0xf44a59[_0x3e97c9(0xb0)](getProjectSkillsDir),_0xf44a59['SBJzE']),getSkillsFromDir(getUserSkillsDir(),_0xf44a59[_0x3e97c9(0x81)])]);return{'project':_0x3ba5c9,'user':_0x34c74e};}async function getEnvironments(){const _0x146126=_0x3b1eee,_0x48a6b2={'DhNEY':function(_0x2f4ece,_0x565d76,_0x49bbaa){return _0x2f4ece(_0x565d76,_0x49bbaa);},'pxpJs':function(_0x4dd66f,_0x4f3dd4,_0x356b3e){return _0x4dd66f(_0x4f3dd4,_0x356b3e);},'jDwWd':_0x146126(0xb4),'NPHLs':_0x146126(0x84),'mKzIz':'(not\x20found)','jYHuu':function(_0x1dbd5d){return _0x1dbd5d();}},{envNames:_0x307352,activeEnv:_0x4e21c0}=await _0x48a6b2['jYHuu'](getEnvNames),_0x39fde5=getRangerDir();if(!existsSync(_0x39fde5))return{'envs':[],'activeEnv':null};const _0x264cf3=_0x307352[_0x146126(0x9c)](_0x1be039=>{const _0x3073ee=_0x146126,_0x36fd31=getEnvDir(_0x1be039),_0x38fe9d=_0x48a6b2['DhNEY'](join,_0x36fd31,'settings.json'),_0xaf652c=_0x48a6b2[_0x3073ee(0xa9)](join,_0x36fd31,_0x48a6b2[_0x3073ee(0xc9)]),_0x184c8e=join(_0x36fd31,_0x48a6b2['NPHLs']);return{'name':_0x1be039,'settingsPath':existsSync(_0x38fe9d)?_0x38fe9d:_0x48a6b2['mKzIz'],'hasPlaintextAuth':existsSync(_0xaf652c),'hasEncryptedAuth':existsSync(_0x184c8e),'isActive':_0x1be039===_0x4e21c0};});return{'envs':_0x264cf3,'activeEnv':_0x4e21c0};}export async function status(){const _0x215fda=_0x3b1eee,_0x3a16de={'FCTDM':_0x215fda(0x85),'siVGI':function(_0x5361f4){return _0x5361f4();},'XkrvS':function(_0x490e74,_0x47c4bf){return _0x490e74(_0x47c4bf);},'PqMmF':function(_0x49b2de,_0x1ef024,_0x3c8b4f){return _0x49b2de(_0x1ef024,_0x3c8b4f);},'hLlGB':function(_0x3d8e90,_0x575b66){return _0x3d8e90!==_0x575b66;},'SYoNQ':function(_0x2c0b4e){return _0x2c0b4e();},'GQqHr':'\x0a---\x20OpenCode\x20Plugin\x20---','HeHTD':function(_0x553ae0,_0x36d33d){return _0x553ae0===_0x36d33d;},'BjxSK':_0x215fda(0xa2),'HcUgy':'\x20\x20Run:\x20ranger\x20setup\x20--opencode','RJwnp':_0x215fda(0xc0),'UJzqi':'ranger@trailhead','pZhlJ':'unknown','NAZpO':'enabled','CEhPe':_0x215fda(0x96),'cslno':'\x20\x20Not\x20installed','dLEuJ':_0x215fda(0xbe),'WLiBG':function(_0x2a0c81){return _0x2a0c81();},'ivnSM':function(_0x37dc02,_0x266bb7){return _0x37dc02+_0x266bb7;},'Rkfud':function(_0x4905cc,_0x27fb1e){return _0x4905cc>_0x27fb1e;},'noWUQ':_0x215fda(0xc4),'IFpyR':'plaintext','QJOTY':_0x215fda(0xcd),'THIvR':_0x215fda(0xba)};console[_0x215fda(0x80)](_0x3a16de[_0x215fda(0xb9)]);const _0x62ae00=process[_0x215fda(0xbf)](),_0x1543b7=_0x3a16de[_0x215fda(0x7b)](getRangerDir);if(!_0x3a16de['XkrvS'](existsSync,_0x1543b7)){console[_0x215fda(0x80)]('Root:\x20'+link(_0x62ae00,bold(basename(_0x62ae00)))),console['log']('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x215fda(0x80)](_0x215fda(0xc3)+_0x3a16de['PqMmF'](link,_0x62ae00,bold(basename(_0x62ae00))));const _0x57af51=getCurrentVersion(),_0x406eda=getLatestVersion();if(_0x406eda[_0x215fda(0x79)]&&_0x3a16de[_0x215fda(0x75)](_0x406eda['version'],_0x57af51))console['log'](_0x215fda(0xc7)+_0x57af51+_0x215fda(0x89)+_0x406eda[_0x215fda(0x79)]+')'),console[_0x215fda(0x80)]('\x20\x20Run:\x20ranger\x20update');else _0x406eda['version']?console['log'](_0x215fda(0xc7)+_0x57af51+'\x20(up\x20to\x20date)'):console[_0x215fda(0x80)](_0x215fda(0xc7)+_0x57af51);const _0x4d2504=await _0x3a16de['SYoNQ'](getToken);if(_0x4d2504){const _0x2d1c91=await getCurrentUser(_0x4d2504);_0x2d1c91[_0x215fda(0xa8)]?console[_0x215fda(0x80)](_0x215fda(0x99)+bold(_0x2d1c91[_0x215fda(0xb5)][_0x215fda(0xcb)])):(console[_0x215fda(0x80)]('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log'](_0x215fda(0xce)));}else console[_0x215fda(0x80)]('API\x20Token:\x20✗\x20Not\x20found'),console[_0x215fda(0x80)](_0x215fda(0xce));process[_0x215fda(0x82)]['DEBUG']&&(console['log']('API\x20Environment:\x20'+getCurrentEnvironment()),console[_0x215fda(0x80)](_0x215fda(0x9e)+getApiBaseUrl()));console[_0x215fda(0x80)](_0x3a16de['GQqHr']);const _0x5cc455=await _0x3a16de['SYoNQ'](getOpencodePluginStatus);if(_0x3a16de['HeHTD'](_0x5cc455['status'],'configured'))console[_0x215fda(0x80)]('\x20\x20'+_0x3a16de['XkrvS'](bold,_0x215fda(0x8a))+':\x20configured'),_0x5cc455['details']&&console[_0x215fda(0x80)]('\x20\x20'+_0x5cc455['details']);else _0x3a16de[_0x215fda(0x8b)](_0x5cc455[_0x215fda(0xa6)],'not_configured')?(console[_0x215fda(0x80)](_0x3a16de['BjxSK']),_0x5cc455[_0x215fda(0x77)]&&console[_0x215fda(0x80)]('\x20\x20'+_0x5cc455[_0x215fda(0x77)]),console[_0x215fda(0x80)](_0x3a16de[_0x215fda(0xbd)])):console['log'](_0x215fda(0xc1));console['log'](_0x3a16de[_0x215fda(0xcf)]);const _0x526a5f=await getPluginInfo(_0x3a16de['UJzqi']);if(_0x526a5f){const _0x4bebf0=_0x526a5f[_0x215fda(0xad)]||_0x3a16de['pZhlJ'],_0x5cb334=_0x526a5f['enabled']?_0x3a16de['NAZpO']:_0x3a16de['CEhPe'];console[_0x215fda(0x80)]('\x20\x20'+_0x3a16de[_0x215fda(0x83)](bold,_0x3a16de['UJzqi'])+':\x20installed\x20('+_0x4bebf0+',\x20'+_0x5cb334+')');}else console['log'](_0x3a16de[_0x215fda(0xa5)]),console[_0x215fda(0x80)](_0x215fda(0xb6));console['log'](_0x3a16de['dLEuJ']);const {project:_0x2ec281,user:_0xcc2c54}=await _0x3a16de['WLiBG'](getInstalledSkills),_0x5b1882=_0x2ec281[_0x215fda(0x87)](_0x21b47e=>RANGER_MANAGED_SKILLS['includes'](_0x21b47e['name'])),_0x530629=_0xcc2c54[_0x215fda(0x87)](_0x340da3=>RANGER_MANAGED_SKILLS['includes'](_0x340da3['name'])),_0x1845c7=_0x3a16de[_0x215fda(0x7d)](_0x5b1882[_0x215fda(0xb1)],_0x530629[_0x215fda(0xb1)]);if(_0x1845c7===0x0)console['log']('No\x20skills\x20installed'),console[_0x215fda(0x80)](_0x215fda(0x7e));else{if(_0x5b1882['length']>0x0){console[_0x215fda(0x80)]('\x20\x20Project-level:');for(const _0x453539 of _0x5b1882){console['log']('\x20\x20\x20\x20'+bold(_0x453539['displayName'])+':\x20'+link(_0x453539[_0x215fda(0xaa)],_0x3a16de[_0x215fda(0x83)](basename,_0x453539[_0x215fda(0xaa)])));}}if(_0x3a16de[_0x215fda(0xa3)](_0x530629[_0x215fda(0xb1)],0x0)){console[_0x215fda(0x80)](_0x3a16de[_0x215fda(0xd1)]);for(const _0x159cbd of _0x530629){console['log'](_0x215fda(0xab)+_0x3a16de['XkrvS'](bold,_0x159cbd[_0x215fda(0x8e)])+':\x20'+link(_0x159cbd['path'],basename(_0x159cbd['path'])));}}}console['log'](_0x215fda(0xa0));const {envs:_0x315180,activeEnv:_0x4f2f0f}=await getEnvironments();if(_0x315180['length']===0x0)console[_0x215fda(0x80)](_0x215fda(0xd3)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{for(const _0x5116a9 of _0x315180){const _0x559589=_0x5116a9['isActive']?'\x20(active)':'',_0x277adb=_0x5116a9['hasEncryptedAuth']?_0x215fda(0xbc):_0x5116a9['hasPlaintextAuth']?_0x3a16de['IFpyR']:_0x3a16de['QJOTY'];console['log']('\x20\x20'+bold(_0x5116a9[_0x215fda(0xa4)])+_0x559589),console[_0x215fda(0x80)](_0x215fda(0x93)+_0x277adb),_0x3a16de['hLlGB'](_0x5116a9[_0x215fda(0x7c)],_0x3a16de['THIvR'])&&console['log']('\x20\x20\x20\x20Settings:\x20'+link(_0x5116a9[_0x215fda(0x7c)],basename(_0x5116a9['settingsPath'])));}!_0x4f2f0f&&(console[_0x215fda(0x80)]('\x0a\x20\x20No\x20active\x20profile\x20set'),console['log'](_0x215fda(0xd4)+_0x315180[_0x215fda(0x9c)](_0x29ff19=>_0x29ff19['name'])[_0x215fda(0x9d)](',\x20')+')'));}console['log']('');}
|
|
1
|
+
const _0x4c4fad=_0x56ec;(function(_0xdcb5fd,_0x2cd3d0){const _0x1851df=_0x56ec,_0x12ae99=_0xdcb5fd();while(!![]){try{const _0x5d5f9d=-parseInt(_0x1851df(0x1b6))/0x1*(parseInt(_0x1851df(0x19e))/0x2)+parseInt(_0x1851df(0x176))/0x3+-parseInt(_0x1851df(0x1b4))/0x4+-parseInt(_0x1851df(0x19f))/0x5+parseInt(_0x1851df(0x191))/0x6+parseInt(_0x1851df(0x1b1))/0x7*(-parseInt(_0x1851df(0x186))/0x8)+parseInt(_0x1851df(0x167))/0x9*(parseInt(_0x1851df(0x197))/0xa);if(_0x5d5f9d===_0x2cd3d0)break;else _0x12ae99['push'](_0x12ae99['shift']());}catch(_0x2fb506){_0x12ae99['push'](_0x12ae99['shift']());}}}(_0x20fd,0xac081));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';function _0x56ec(_0x513b9d,_0x36184b){_0x513b9d=_0x513b9d-0x154;const _0x20fde4=_0x20fd();let _0x56ecbe=_0x20fde4[_0x513b9d];return _0x56ecbe;}import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x8aaa07=>_0x4c4fad(0x189)+_0x8aaa07+_0x4c4fad(0x15a),link=(_0x76b86f,_0x7d366)=>_0x4c4fad(0x16b)+_0x76b86f+'\x07'+(_0x7d366||_0x76b86f)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x449a0d=_0x4c4fad,_0x4deca1={'ZjjsE':'string','fbQJA':_0x449a0d(0x162),'sEioa':function(_0x3866c3,_0xdbd894){return _0x3866c3(_0xdbd894);},'sASib':function(_0x58ab2d,_0x1df344){return _0x58ab2d>_0x1df344;},'eQKMA':'not_configured','YQrxd':_0x449a0d(0x174),'TZOrD':_0x449a0d(0x183),'tgLXT':_0x449a0d(0x1a1),'PLzVp':_0x449a0d(0x17a),'fGsQZ':'data','GRDSA':'close'};return new Promise(_0xea6e8c=>{const _0x5ec789=_0x449a0d,_0x205d70={'nyftf':function(_0x1ae6ab,_0x48a6dc){return _0x1ae6ab(_0x48a6dc);},'FgDDs':'not_installed'},_0xa7eb97=spawn(_0x4deca1[_0x5ec789(0x169)],[_0x4deca1[_0x5ec789(0x159)],'config'],{'stdio':[_0x4deca1['tgLXT'],_0x4deca1['PLzVp'],_0x4deca1['PLzVp']]});let _0x1cfe74='';_0xa7eb97['stdout']?.['on'](_0x4deca1['fGsQZ'],_0x5103fe=>{_0x1cfe74+=_0x5103fe['toString']();}),_0xa7eb97[_0x5ec789(0x1af)]?.['on'](_0x4deca1['fGsQZ'],_0x8be266=>{const _0x3d11cc=_0x5ec789;_0x1cfe74+=_0x8be266[_0x3d11cc(0x18f)]();}),_0xa7eb97['on']('error',()=>{const _0x7379de=_0x5ec789;_0x205d70['nyftf'](_0xea6e8c,{'status':_0x205d70[_0x7379de(0x154)]});}),_0xa7eb97['on'](_0x4deca1['GRDSA'],_0x573fab=>{const _0x3c39d3=_0x5ec789,_0x41f8f7={'Cdgqs':function(_0x4a4987,_0x9f2d18){return _0x4a4987!==_0x9f2d18;},'nPuDv':_0x4deca1['ZjjsE'],'aSLJv':_0x4deca1['fbQJA']};if(_0x573fab!==0x0){_0xea6e8c({'status':_0x3c39d3(0x18c)});return;}const _0x47de77=_0x1cfe74[_0x3c39d3(0x19c)]();let _0x4ba203=null;if(_0x47de77)try{_0x4ba203=JSON[_0x3c39d3(0x19d)](_0x47de77);}catch{const _0x23ad38=_0x47de77[_0x3c39d3(0x1ab)](/\{[\s\S]*\}$/);if(_0x23ad38)try{_0x4ba203=JSON[_0x3c39d3(0x19d)](_0x23ad38[0x0]);}catch{_0x4ba203=null;}}const _0x3f57f0=Array['isArray'](_0x4ba203?.[_0x3c39d3(0x1a3)])?_0x4ba203?.[_0x3c39d3(0x1a3)]:[],_0x2b9253=_0x3f57f0[_0x3c39d3(0x184)](_0x3061ec=>{const _0x2f2cc8=_0x3c39d3;if(_0x41f8f7[_0x2f2cc8(0x170)](typeof _0x3061ec,_0x41f8f7['nPuDv']))return![];return _0x3061ec['includes'](_0x41f8f7[_0x2f2cc8(0x19a)])||_0x3061ec[_0x2f2cc8(0x1b3)](_0x2f2cc8(0x163));});if(_0x2b9253){_0x4deca1[_0x3c39d3(0x165)](_0xea6e8c,{'status':_0x3c39d3(0x1b5),'details':_0x3f57f0['length']>0x0?_0x3f57f0['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x4deca1['sASib'](_0x3f57f0[_0x3c39d3(0x190)],0x0)){_0x4deca1['sEioa'](_0xea6e8c,{'status':_0x4deca1['eQKMA'],'details':_0x3f57f0[_0x3c39d3(0x190)]+'\x20plugin(s)\x20configured'});return;}_0xea6e8c({'status':_0x4deca1[_0x3c39d3(0x181)]});});});}async function getSkillsFromDir(_0x59c8be,_0x2e81fe){const _0x59084e=_0x4c4fad,_0x529e22={'JcxPK':function(_0x59b4b1,_0x17a80b){return _0x59b4b1(_0x17a80b);},'wVHOb':function(_0x314daf,_0x511b24,_0x4e61d1){return _0x314daf(_0x511b24,_0x4e61d1);},'ELqLI':function(_0x42f085,_0x1b1756,_0x120efd,_0x2ee2ba){return _0x42f085(_0x1b1756,_0x120efd,_0x2ee2ba);},'vKGLO':_0x59084e(0x18a),'MSrJm':_0x59084e(0x16c)};if(!_0x529e22[_0x59084e(0x17b)](existsSync,_0x59c8be))return[];const _0x3990cf=[];try{const _0x22d33c=await _0x529e22[_0x59084e(0x166)](readdir,_0x59c8be,{'withFileTypes':!![]});for(const _0x4d3300 of _0x22d33c){if(_0x4d3300['isDirectory']()){const _0x320462=_0x529e22['ELqLI'](join,_0x59c8be,_0x4d3300[_0x59084e(0x1b7)],_0x529e22['vKGLO']);if(existsSync(_0x320462)){let _0x3c4e8d=_0x4d3300['name'];try{const _0x5a3ee4=await _0x529e22[_0x59084e(0x166)](readFile,_0x320462,_0x529e22['MSrJm']),_0x1bb6e7=_0x5a3ee4['match'](/name:\s*(.+)/);_0x1bb6e7&&(_0x3c4e8d=_0x1bb6e7[0x1]['trim']());}catch{}_0x3990cf['push']({'name':_0x4d3300['name'],'displayName':_0x3c4e8d,'path':_0x320462,'level':_0x2e81fe});}}}}catch{return[];}return _0x3990cf;}async function getInstalledSkills(){const _0x2b0d86=_0x4c4fad,_0x405bfd={'JeZip':function(_0x4852ea,_0x4fc159,_0x500f49){return _0x4852ea(_0x4fc159,_0x500f49);},'LrHIn':'project','essns':'user'},[_0xade57f,_0x19bfe8]=await Promise[_0x2b0d86(0x1a0)]([_0x405bfd['JeZip'](getSkillsFromDir,getProjectSkillsDir(),_0x405bfd['LrHIn']),getSkillsFromDir(getUserSkillsDir(),_0x405bfd[_0x2b0d86(0x168)])]);return{'project':_0xade57f,'user':_0x19bfe8};}function _0x20fd(){const _0x565527=['status','bjYOf','qKQFZ','TZOrD','\x1b[0m','\x20\x20User-level:','Version:\x20','settingsPath','NmKml','API\x20Token:\x20✗\x20Not\x20found','\x0a\x20\x20No\x20active\x20profile\x20set','No\x20profiles\x20configured','@ranger-testing/opencode-plugin','opencode-plugin','gMWps','sEioa','wVHOb','110151MazuqD','essns','YQrxd','No\x20skills\x20installed','\x1b]8;;file://','utf-8','dNHaH',':\x20configured','PAsUw','Cdgqs','env','hasEncryptedAuth','\x20\x20\x20\x20Settings:\x20','opencode','QHInA','3647160hOCmnu','join','path','ranger@trailhead','pipe','JcxPK','kArHx','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','zVsAw','user','HyFpE','eQKMA','unknown','debug','some','\x0a---\x20OpenCode\x20Plugin\x20---','4909592OsUwCH','jVzwn','log','\x1b[1m','SKILL.md','details','not_installed','hasPlaintextAuth','gYSIz','toString','length','6123522jonOUV','wTszl','edadd','(not\x20found)','disabled','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','1270jGJXTV','\x20\x20Run:\x20ranger\x20skillup','displayName','aSLJv','RpwxI','trim','parse','1857520uWZnCm','1061680naGlZt','all','ignore','\x20\x20\x20\x20','plugin','mEGJZ','Root:\x20','rKriY','enabled','\x20\x20Project-level:','MKWPs','version','match','isActive','YNHEg','auth.json.enc','stderr','\x0a📊\x20Ranger\x20Status\x0a','7xVOAIe','\x20(up\x20to\x20date)','includes','5324896gLeKXI','configured','1kCEQxi','name','FgDDs','success'];_0x20fd=function(){return _0x565527;};return _0x20fd();}async function getEnvironments(){const _0x9d8fc3=_0x4c4fad,_0x10cab1={'bjYOf':function(_0x1d577e,_0x10ce07,_0x336920){return _0x1d577e(_0x10ce07,_0x336920);},'iIenN':_0x9d8fc3(0x1ae),'zVsAw':function(_0x21cf30,_0x1bb0be){return _0x21cf30(_0x1bb0be);},'kArHx':function(_0x59303a){return _0x59303a();}},{envNames:_0x1b7d67,activeEnv:_0x3f1f1c}=await _0x10cab1['kArHx'](getEnvNames),_0x10fefe=_0x10cab1[_0x9d8fc3(0x17c)](getRangerDir);if(!existsSync(_0x10fefe))return{'envs':[],'activeEnv':null};const _0x430184=_0x1b7d67['map'](_0xb36e95=>{const _0x5b264a=_0x9d8fc3,_0x4bb923=getEnvDir(_0xb36e95),_0x406a65=_0x10cab1[_0x5b264a(0x157)](join,_0x4bb923,'settings.json'),_0x59d972=_0x10cab1[_0x5b264a(0x157)](join,_0x4bb923,'auth.json'),_0x5700f1=join(_0x4bb923,_0x10cab1['iIenN']);return{'name':_0xb36e95,'settingsPath':_0x10cab1[_0x5b264a(0x17e)](existsSync,_0x406a65)?_0x406a65:'(not\x20found)','hasPlaintextAuth':existsSync(_0x59d972),'hasEncryptedAuth':existsSync(_0x5700f1),'isActive':_0xb36e95===_0x3f1f1c};});return{'envs':_0x430184,'activeEnv':_0x3f1f1c};}export async function status(){const _0x2e73dd=_0x4c4fad,_0x6fb2a9={'MKWPs':_0x2e73dd(0x1b0),'mEGJZ':function(_0x2c3359){return _0x2c3359();},'AWNnx':function(_0x44aa2d,_0x2f24a5){return _0x44aa2d(_0x2f24a5);},'RpwxI':function(_0x3f3c18,_0x1ebf66){return _0x3f3c18(_0x1ebf66);},'PAsUw':function(_0x555c91,_0x3ca51a){return _0x555c91(_0x3ca51a);},'wTszl':function(_0x50e370,_0x1f84ed){return _0x50e370!==_0x1f84ed;},'YNHEg':function(_0x4e3ca3,_0x47dc5d){return _0x4e3ca3(_0x47dc5d);},'gYSIz':_0x2e73dd(0x185),'dNHaH':'configured','mVrpy':function(_0x4ad5a5,_0x265757){return _0x4ad5a5(_0x265757);},'HyFpE':'@ranger-testing/opencode-plugin','EPWqc':'\x20\x20Not\x20configured','xclwm':_0x2e73dd(0x182),'NmKml':_0x2e73dd(0x1a7),'QHInA':'\x20\x20Not\x20installed','wQuTe':'\x0a---\x20Skills\x20---','PuNrI':function(_0x33c96a){return _0x33c96a();},'tgeBO':function(_0x550378,_0xd15105){return _0x550378+_0xd15105;},'rKriY':function(_0x214cd3,_0x4ff547){return _0x214cd3===_0x4ff547;},'jVzwn':_0x2e73dd(0x16a),'qKQFZ':function(_0x31f7eb,_0x3e7999,_0x671254){return _0x31f7eb(_0x3e7999,_0x671254);},'wWjTQ':function(_0x505e7c,_0x48811e){return _0x505e7c(_0x48811e);},'edadd':function(_0x27f825,_0x377958){return _0x27f825>_0x377958;},'YvXEZ':_0x2e73dd(0x15b),'Ivxdi':'encrypted','vLRhB':_0x2e73dd(0x194),'gMWps':function(_0x51bcf0,_0x11bc8a,_0x435e4f){return _0x51bcf0(_0x11bc8a,_0x435e4f);}};console['log'](_0x6fb2a9[_0x2e73dd(0x1a9)]);const _0x595e94=process['cwd'](),_0x2f3a2b=_0x6fb2a9['mEGJZ'](getRangerDir);if(!_0x6fb2a9['AWNnx'](existsSync,_0x2f3a2b)){console[_0x2e73dd(0x188)](_0x2e73dd(0x1a5)+link(_0x595e94,_0x6fb2a9['AWNnx'](bold,_0x6fb2a9[_0x2e73dd(0x19b)](basename,_0x595e94)))),console[_0x2e73dd(0x188)](_0x2e73dd(0x17d)),console[_0x2e73dd(0x188)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x2e73dd(0x1a5)+link(_0x595e94,_0x6fb2a9['PAsUw'](bold,basename(_0x595e94))));const _0x6be19f=getCurrentVersion(),_0xcfc092=getLatestVersion();if(_0xcfc092[_0x2e73dd(0x1aa)]&&_0x6fb2a9[_0x2e73dd(0x192)](_0xcfc092[_0x2e73dd(0x1aa)],_0x6be19f))console['log'](_0x2e73dd(0x15c)+_0x6be19f+'\x20(latest:\x20'+_0xcfc092[_0x2e73dd(0x1aa)]+')'),console[_0x2e73dd(0x188)]('\x20\x20Run:\x20ranger\x20update');else _0xcfc092['version']?console['log'](_0x2e73dd(0x15c)+_0x6be19f+_0x2e73dd(0x1b2)):console[_0x2e73dd(0x188)](_0x2e73dd(0x15c)+_0x6be19f);const _0x59ee2e=await _0x6fb2a9[_0x2e73dd(0x1a4)](getToken);if(_0x59ee2e){const _0x5dd421=await _0x6fb2a9[_0x2e73dd(0x1ad)](getCurrentUser,_0x59ee2e);_0x5dd421[_0x2e73dd(0x155)]?console['log']('Organization:\x20'+_0x6fb2a9[_0x2e73dd(0x16f)](bold,_0x5dd421[_0x2e73dd(0x17f)]['organizationName'])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console[_0x2e73dd(0x188)]('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0x2e73dd(0x188)](_0x2e73dd(0x15f)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0x2e73dd(0x171)]['DEBUG']&&(console[_0x2e73dd(0x188)]('API\x20Environment:\x20'+getCurrentEnvironment()),console[_0x2e73dd(0x188)]('API\x20URL:\x20'+getApiBaseUrl()));console[_0x2e73dd(0x188)](_0x6fb2a9[_0x2e73dd(0x18e)]);const _0x19d17b=await getOpencodePluginStatus();if(_0x19d17b[_0x2e73dd(0x156)]===_0x6fb2a9[_0x2e73dd(0x16d)])console[_0x2e73dd(0x188)]('\x20\x20'+_0x6fb2a9['mVrpy'](bold,_0x6fb2a9[_0x2e73dd(0x180)])+_0x2e73dd(0x16e)),_0x19d17b[_0x2e73dd(0x18b)]&&console['log']('\x20\x20'+_0x19d17b[_0x2e73dd(0x18b)]);else _0x19d17b['status']==='not_configured'?(console[_0x2e73dd(0x188)](_0x6fb2a9['EPWqc']),_0x19d17b[_0x2e73dd(0x18b)]&&console[_0x2e73dd(0x188)]('\x20\x20'+_0x19d17b[_0x2e73dd(0x18b)]),console['log']('\x20\x20Run:\x20ranger\x20setup\x20--opencode')):console[_0x2e73dd(0x188)]('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console['log']('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x402083=await getPluginInfo('ranger@trailhead');if(_0x402083){const _0x260df4=_0x402083['scope']||_0x6fb2a9['xclwm'],_0x294660=_0x402083['enabled']?_0x6fb2a9[_0x2e73dd(0x15e)]:_0x2e73dd(0x195);console['log']('\x20\x20'+bold(_0x2e73dd(0x179))+':\x20installed\x20('+_0x260df4+',\x20'+_0x294660+')');}else console['log'](_0x6fb2a9[_0x2e73dd(0x175)]),console[_0x2e73dd(0x188)](_0x2e73dd(0x196));console['log'](_0x6fb2a9['wQuTe']);const {project:_0x4ff25c,user:_0xf40afa}=await _0x6fb2a9['PuNrI'](getInstalledSkills),_0x4c6b15=_0x4ff25c['filter'](_0x41efe9=>RANGER_MANAGED_SKILLS['includes'](_0x41efe9[_0x2e73dd(0x1b7)])),_0x56f945=_0xf40afa['filter'](_0x49af24=>RANGER_MANAGED_SKILLS['includes'](_0x49af24[_0x2e73dd(0x1b7)])),_0x3654f4=_0x6fb2a9['tgeBO'](_0x4c6b15[_0x2e73dd(0x190)],_0x56f945['length']);if(_0x6fb2a9[_0x2e73dd(0x1a6)](_0x3654f4,0x0))console[_0x2e73dd(0x188)](_0x6fb2a9[_0x2e73dd(0x187)]),console['log'](_0x2e73dd(0x198));else{if(_0x4c6b15[_0x2e73dd(0x190)]>0x0){console['log'](_0x2e73dd(0x1a8));for(const _0x14a707 of _0x4c6b15){console[_0x2e73dd(0x188)](_0x2e73dd(0x1a2)+bold(_0x14a707[_0x2e73dd(0x199)])+':\x20'+_0x6fb2a9[_0x2e73dd(0x158)](link,_0x14a707['path'],_0x6fb2a9['wWjTQ'](basename,_0x14a707[_0x2e73dd(0x178)])));}}if(_0x6fb2a9[_0x2e73dd(0x193)](_0x56f945[_0x2e73dd(0x190)],0x0)){console['log'](_0x6fb2a9['YvXEZ']);for(const _0x3972aa of _0x56f945){console[_0x2e73dd(0x188)]('\x20\x20\x20\x20'+bold(_0x3972aa['displayName'])+':\x20'+link(_0x3972aa['path'],basename(_0x3972aa[_0x2e73dd(0x178)])));}}}console[_0x2e73dd(0x188)]('\x0a---\x20Profiles\x20---');const {envs:_0x47a5c5,activeEnv:_0x285a76}=await getEnvironments();if(_0x6fb2a9['rKriY'](_0x47a5c5['length'],0x0))console[_0x2e73dd(0x188)](_0x2e73dd(0x161)),console[_0x2e73dd(0x188)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{for(const _0x20deea of _0x47a5c5){const _0x3a0b7b=_0x20deea[_0x2e73dd(0x1ac)]?'\x20(active)':'',_0x5bdbf4=_0x20deea[_0x2e73dd(0x172)]?_0x6fb2a9['Ivxdi']:_0x20deea[_0x2e73dd(0x18d)]?'plaintext':'none';console[_0x2e73dd(0x188)]('\x20\x20'+bold(_0x20deea[_0x2e73dd(0x1b7)])+_0x3a0b7b),console[_0x2e73dd(0x188)]('\x20\x20\x20\x20Auth:\x20'+_0x5bdbf4),_0x20deea['settingsPath']!==_0x6fb2a9['vLRhB']&&console[_0x2e73dd(0x188)](_0x2e73dd(0x173)+_0x6fb2a9[_0x2e73dd(0x164)](link,_0x20deea['settingsPath'],_0x6fb2a9['YNHEg'](basename,_0x20deea[_0x2e73dd(0x15d)])));}!_0x285a76&&(console['log'](_0x2e73dd(0x160)),console[_0x2e73dd(0x188)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x47a5c5['map'](_0x291722=>_0x291722[_0x2e73dd(0x1b7)])[_0x2e73dd(0x177)](',\x20')+')'));}console['log']('');}
|