@ranger-testing/ranger-cli 2.5.4-alpha.152f635-21 → 2.5.4-alpha.1b80607-25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -0
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/novaActCli.js +1 -0
- 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/commands/verifyFeatureNovaCli.js +1 -0
- package/build/skills/ranger/SKILL.md +1 -1
- package/package.json +1 -1
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x9abdcc,_0xa2e479){const _0x135855=_0x1032,_0x4fd46e=_0x9abdcc();while(!![]){try{const _0x4f4be5=-parseInt(_0x135855(0x1a1))/0x1+-parseInt(_0x135855(0x1aa))/0x2+-parseInt(_0x135855(0x1a3))/0x3*(parseInt(_0x135855(0x1ae))/0x4)+-parseInt(_0x135855(0x1a7))/0x5+parseInt(_0x135855(0x1ab))/0x6*(parseInt(_0x135855(0x1b0))/0x7)+-parseInt(_0x135855(0x1ac))/0x8+parseInt(_0x135855(0x1b1))/0x9;if(_0x4f4be5===_0xa2e479)break;else _0x4fd46e['push'](_0x4fd46e['shift']());}catch(_0x10eae7){_0x4fd46e['push'](_0x4fd46e['shift']());}}}(_0x274d,0x34435));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';function _0x274d(){const _0x3df43e=['4AxwCHo','ZAXRJ','7UNCAKk','8914392alZmoE','message','Login\x20failed:\x20','HkuFb','179445FiVYTA','user','1000920HCWUtK','success','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','\x0a✅\x20Logged\x20in\x20to\x20','905655LtmNYm','Re-authenticating\x20via\x20MCP\x20bootstrap...','log','599894WihRUO','1575426SWHDuV','358616TKukzK','JyrAR'];_0x274d=function(){return _0x3df43e;};return _0x274d();}import{isInteractive}from'./utils/cloudProfileSession.js';function _0x1032(_0x101a47,_0x5959bf){_0x101a47=_0x101a47-0x1a0;const _0x274d11=_0x274d();let _0x103255=_0x274d11[_0x101a47];return _0x103255;}export async function login(){const _0x1b4b15=_0x1032,_0x31ec44={'HkuFb':function(_0x14f4dc){return _0x14f4dc();},'JyrAR':function(_0x58adbb,_0x4a68aa){return _0x58adbb(_0x4a68aa);},'Rfkik':'\x0a✅\x20API\x20key\x20stored\x20successfully','ZAXRJ':function(_0x95e8a2,_0x3e6c80){return _0x95e8a2 instanceof _0x3e6c80;}},_0x15287e=await getMcpAuthOrigin();if(_0x15287e){console[_0x1b4b15(0x1a9)](_0x1b4b15(0x1a8)),await _0x31ec44[_0x1b4b15(0x1a0)](mcpBootstrap);return;}if(!isInteractive())throw new Error(_0x1b4b15(0x1a5));try{const _0x54da1c=await runDeviceAuthFlow(),_0x1d5229=await _0x31ec44[_0x1b4b15(0x1ad)](getCurrentUser,_0x54da1c);_0x1d5229[_0x1b4b15(0x1a4)]?console['log'](_0x1b4b15(0x1a6)+_0x1d5229[_0x1b4b15(0x1a2)]['organizationName']):console['log'](_0x31ec44['Rfkik']);}catch(_0x161e95){throw new Error(_0x1b4b15(0x1b3)+(_0x31ec44[_0x1b4b15(0x1af)](_0x161e95,Error)?_0x161e95[_0x1b4b15(0x1b2)]:_0x161e95));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x18dc21=_0x301b;(function(_0x5580bf,_0x90bafd){const _0x1b43aa=_0x301b,_0x8e42ac=_0x5580bf();while(!![]){try{const _0x2ef3da=-parseInt(_0x1b43aa(0x198))/0x1*(-parseInt(_0x1b43aa(0x160))/0x2)+parseInt(_0x1b43aa(0x1a6))/0x3*(-parseInt(_0x1b43aa(0x194))/0x4)+-parseInt(_0x1b43aa(0x14e))/0x5+parseInt(_0x1b43aa(0x14c))/0x6+-parseInt(_0x1b43aa(0x14d))/0x7*(-parseInt(_0x1b43aa(0x122))/0x8)+-parseInt(_0x1b43aa(0x17c))/0x9*(-parseInt(_0x1b43aa(0x168))/0xa)+parseInt(_0x1b43aa(0x17e))/0xb*(-parseInt(_0x1b43aa(0x143))/0xc);if(_0x2ef3da===_0x90bafd)break;else _0x8e42ac['push'](_0x8e42ac['shift']());}catch(_0x5b31d4){_0x8e42ac['push'](_0x8e42ac['shift']());}}}(_0x3fd9,0xc6c51));import{mkdir,writeFile,readFile}from'fs/promises';function _0x301b(_0x364117,_0x8a8ec9){_0x364117=_0x364117-0x114;const _0x3fd9e8=_0x3fd9();let _0x301ba3=_0x3fd9e8[_0x364117];return _0x301ba3;}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',_0x18dc21(0x19f)),AUTH_ORIGIN_PATH=join(homedir(),_0x18dc21(0x11d),'auth-origin.txt');export async function getMcpAuthOrigin(){const _0x52fc49=_0x18dc21,_0x1d48ed={'VZMLy':function(_0x2b8e61,_0xaa00bb,_0x3f2799){return _0x2b8e61(_0xaa00bb,_0x3f2799);}};try{const _0x19dfa4=(await _0x1d48ed['VZMLy'](readFile,AUTH_ORIGIN_PATH,_0x52fc49(0x14a)))[_0x52fc49(0x144)]();return _0x19dfa4||null;}catch{return null;}}export async function mcpBootstrap(){const _0x399817=_0x18dc21,_0x34072e={'olUZB':'proxied','TuskX':function(_0x59cc0f){return _0x59cc0f();},'ISdGw':_0x399817(0x16c),'ulhjz':'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','ItnRl':function(_0x118c88,_0x59bbad,_0x35a8e1){return _0x118c88(_0x59bbad,_0x35a8e1);}},_0x4eafa3=getMcpAuthUrl();currentOrigin=_0x4eafa3;const _0x1f2512=process['stdout']['isTTY']??![];console['log'](_0x399817(0x146)+_0x4eafa3+'\x0a');const _0x556375=await tryUnauthenticated(_0x4eafa3);let _0x46bed1=null;if(_0x556375===_0x34072e['olUZB'])_0x46bed1='';else{_0x46bed1=await _0x34072e[_0x399817(0x16d)](loadCachedToken);if(!_0x46bed1){if(!_0x1f2512)throw new Error(_0x34072e['ISdGw']+_0x34072e['ulhjz']);_0x46bed1=await oauthFlow(_0x4eafa3);}}await _0x34072e[_0x399817(0x175)](callGetCliToken,_0x4eafa3,_0x46bed1);}async function tryUnauthenticated(_0xd05171){const _0x58deb3=_0x18dc21,_0x18bc25={'RDxme':'application/json,\x20text/event-stream','HRHIH':_0x58deb3(0x164),'CSlkt':_0x58deb3(0x176),'jdabJ':'ranger-cli','TpUgl':'needs-oauth'},_0xdc161d=await fetch(_0xd05171,{'method':_0x58deb3(0x163),'headers':{'Content-Type':'application/json','Accept':_0x18bc25[_0x58deb3(0x130)]},'body':JSON['stringify']({'jsonrpc':_0x18bc25['HRHIH'],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x18bc25[_0x58deb3(0x179)],'capabilities':{},'clientInfo':{'name':_0x18bc25[_0x58deb3(0x17d)],'version':'1.0.0'}}})});if(_0xdc161d['ok'])return await _0xdc161d[_0x58deb3(0x148)](),_0x58deb3(0x172);if(_0xdc161d['status']===0x191)return await _0xdc161d[_0x58deb3(0x148)](),_0x18bc25[_0x58deb3(0x12e)];const _0x3c0c20=await _0xdc161d[_0x58deb3(0x148)]();throw new Error(_0x58deb3(0x184)+_0xdc161d[_0x58deb3(0x193)]+':\x20'+_0x3c0c20);}class OAuthTimeoutError extends Error{constructor(_0x481ec1){const _0x1375eb=_0x18dc21,_0x1e8e4a={'cjETv':_0x1375eb(0x11a)};super(_0x481ec1),this['name']=_0x1e8e4a[_0x1375eb(0x13d)];}}async function oauthFlow(_0x3d0540){const _0x59f2d4=_0x18dc21,_0x1487eb={'gQQDu':function(_0x3bd302,_0x569502){return _0x3bd302 instanceof _0x569502;},'xlxDw':function(_0x3e82a1){return _0x3e82a1();},'MwqPF':function(_0x1b1ec1,_0x19cdbe){return _0x1b1ec1(_0x19cdbe);}};try{return await oauthFlowAttempt(_0x3d0540);}catch(_0x5c9492){if(_0x1487eb[_0x59f2d4(0x17b)](_0x5c9492,OAuthTimeoutError)&&await loadCachedClient())return console[_0x59f2d4(0x15e)](_0x59f2d4(0x11b)),await _0x1487eb['xlxDw'](clearCachedClient),await _0x1487eb[_0x59f2d4(0x129)](oauthFlowAttempt,_0x3d0540);throw _0x5c9492;}}function _0x3fd9(){const _0x1b655f=['authorization_servers','token','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','VUqNp','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','get','nUptn','cjETv','writeHead','client_secret','accessToken','gqVDZ','jXprR','46164EWHIZy','trim','closeAllConnections','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','clientSecret','text','resource','utf-8','string','7661250PhOSSx','2219VeYjYh','4276415duRAtV','set','NWjyk','searchParams','stringify','begUK','http://localhost:','DQFJJ','xClQh','result','tools/call','IPkxl','lAHMQ','content','kObRN','get_cli_token\x20failed:\x20','log','EiadZ','397502qwjrlP','refreshToken','WQqEq','POST','2.0','redirect_uri','<html><body><h2>Authentication\x20failed</h2><p>','APCGg','50lfXGup','authorization_endpoint','WqEYU','/.well-known/oauth-protected-resource','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','TuskX','Eciyj','/callback','GwmBn','application/x-www-form-urlencoded','proxied','toString','slice','ItnRl','2025-03-26','wUbNu','refresh_token','CSlkt','EwKqG','gQQDu','2040651jiHBOW','jdabJ','363sPgYqa','text/html','expiresAt','tpSUk','write','jfUgP','MCP\x20server\x20returned\x20HTTP\x20','LtwRN','Bearer\x20','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','RtuyF','parse','hex','uwoup','XAuwM','error','Exchanging\x20authorization\x20code...','RgEfP','json','Requesting\x20CLI\x20token...','isError','status','2855780KPZWVe','state','Not\x20found','LXVuU','3KKOTVC','bYXNr','pQAXd','close','token_endpoint','Server\x20returned\x20error:\x20','code','mcp-oauth-tokens.json','then','sha256','get_cli_token','end','iduwI','Unknown\x20error','6SpwZdf','headers','registration_endpoint','CLnKv','message','url','PgjWX','now','qWXap','OAuthTimeoutError','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','PFory','.ranger','OAuth\x20error:\x20','notifications/initialized','dPlyI','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','5488UBJYcs','Client\x20registration\x20failed:\x20','access_token','ROkpJ','fKtlu','open','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','MwqPF','clVJJ','application/json','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','update','TpUgl','origin','RDxme','stdout','content-type','rUlKT','application/json,\x20text/event-stream','clientId'];_0x3fd9=function(){return _0x1b655f;};return _0x3fd9();}async function oauthFlowAttempt(_0x58dad9){const _0xcb0e6b=_0x18dc21,_0x45dea7={'CLnKv':'Discovering\x20authorization\x20server...','pQAXd':function(_0x2d07b1,_0x526f4e){return _0x2d07b1(_0x526f4e);},'uwoup':_0xcb0e6b(0x121),'EiadZ':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','kObRN':function(_0x2a43cd){return _0x2a43cd();},'APCGg':'Registering\x20OAuth\x20client...','MAAbk':function(_0x8ab7bf,_0x99c6a0,_0x2bce40){return _0x8ab7bf(_0x99c6a0,_0x2bce40);},'NuHCY':_0xcb0e6b(0x12b),'iZAHy':'Ranger\x20CLI','Eciyj':'authorization_code','svOce':_0xcb0e6b(0x178),'begUK':_0xcb0e6b(0x19e),'ZQYVc':'none','zqvpU':function(_0x3d77eb,_0x4e441e){return _0x3d77eb(_0x4e441e);},'DofZl':_0xcb0e6b(0x1a1),'EiCDd':'base64url','IPkxl':function(_0x48cd5c,_0x4a5d68){return _0x48cd5c(_0x4a5d68);},'iduwI':'client_id','nUptn':_0xcb0e6b(0x165),'eVrlT':'code_challenge','VUqNp':'code_challenge_method','ScTZk':'S256','xClQh':'resource','XAuwM':_0xcb0e6b(0x18e),'tpSUk':_0xcb0e6b(0x13f),'ROkpJ':'POST','WCShe':'\x20done'},_0xabae0b=_0x58dad9['replace'](/\/mcp$/,'');process['stdout'][_0xcb0e6b(0x182)](_0x45dea7[_0xcb0e6b(0x114)]);const _0x4ea97f=await _0x45dea7[_0xcb0e6b(0x19a)](fetch,_0xabae0b+_0xcb0e6b(0x16b));if(!_0x4ea97f['ok'])throw new Error(_0x45dea7[_0xcb0e6b(0x18b)]);const _0x24bb2f=await _0x4ea97f[_0xcb0e6b(0x190)](),_0x6b0d50=_0x24bb2f[_0xcb0e6b(0x136)]?.[0x0];if(!_0x6b0d50)throw new Error(_0x45dea7[_0xcb0e6b(0x15f)]);console[_0xcb0e6b(0x15e)]('\x20'+_0x6b0d50);const _0xd34f7e=await fetchAuthServerMetadata(_0x6b0d50);let _0x49fcfc,_0x4cb3af;const _0x19ce67=await _0x45dea7[_0xcb0e6b(0x15c)](loadCachedClient);if(_0x19ce67)_0x49fcfc=_0x19ce67['clientId'],_0x4cb3af=_0x19ce67[_0xcb0e6b(0x147)];else{if(_0xd34f7e[_0xcb0e6b(0x1a8)]){process['stdout']['write'](_0x45dea7[_0xcb0e6b(0x167)]);const _0xf60ea9=await _0x45dea7['MAAbk'](fetch,_0xd34f7e['registration_endpoint'],{'method':'POST','headers':{'Content-Type':_0x45dea7['NuHCY']},'body':JSON[_0xcb0e6b(0x152)]({'client_name':_0x45dea7['iZAHy'],'redirect_uris':[_0xcb0e6b(0x154)+CALLBACK_PORT+'/callback'],'grant_types':[_0x45dea7[_0xcb0e6b(0x16e)],_0x45dea7['svOce']],'response_types':[_0x45dea7[_0xcb0e6b(0x153)]],'token_endpoint_auth_method':_0x45dea7['ZQYVc']})});if(!_0xf60ea9['ok']){const _0x21298e=await _0xf60ea9[_0xcb0e6b(0x148)]();throw new Error(_0xcb0e6b(0x123)+_0x21298e);}const _0x24048e=await _0xf60ea9['json']();_0x49fcfc=_0x24048e['client_id'],_0x4cb3af=_0x24048e[_0xcb0e6b(0x13f)],await saveCachedClient(_0x49fcfc,_0x4cb3af),console['log']('\x20done');}else throw new Error('Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found');}const _0x4d0374=_0x45dea7['zqvpU'](randomBytes,0x20)[_0xcb0e6b(0x173)]('base64url'),_0x4b76ed=createHash(_0x45dea7['DofZl'])[_0xcb0e6b(0x12d)](_0x4d0374)['digest'](_0x45dea7['EiCDd']),_0x5bee7e=_0x45dea7[_0xcb0e6b(0x159)](randomBytes,0x10)['toString'](_0xcb0e6b(0x18a)),_0x44f45f=new URL(_0xd34f7e[_0xcb0e6b(0x169)]);_0x44f45f[_0xcb0e6b(0x151)][_0xcb0e6b(0x14f)]('response_type',_0x45dea7['begUK']),_0x44f45f['searchParams'][_0xcb0e6b(0x14f)](_0x45dea7[_0xcb0e6b(0x1a4)],_0x49fcfc),_0x44f45f['searchParams']['set'](_0x45dea7[_0xcb0e6b(0x13c)],_0xcb0e6b(0x154)+CALLBACK_PORT+_0xcb0e6b(0x16f)),_0x44f45f[_0xcb0e6b(0x151)][_0xcb0e6b(0x14f)](_0x45dea7['eVrlT'],_0x4b76ed),_0x44f45f[_0xcb0e6b(0x151)]['set'](_0x45dea7[_0xcb0e6b(0x139)],_0x45dea7['ScTZk']),_0x44f45f['searchParams'][_0xcb0e6b(0x14f)](_0xcb0e6b(0x195),_0x5bee7e);_0x24bb2f['resource']&&_0x44f45f['searchParams']['set'](_0x45dea7['xClQh'],_0x24bb2f['resource']);console[_0xcb0e6b(0x15e)]('\x0aOpening\x20browser\x20for\x20authentication...'),console[_0xcb0e6b(0x15e)](_0xcb0e6b(0x128)+_0x44f45f['toString']()+'\x0a'),await openBrowser(_0x44f45f[_0xcb0e6b(0x173)]());const _0x16641c=await waitForCallback(_0x5bee7e);process['stdout']['write'](_0x45dea7[_0xcb0e6b(0x18c)]);const _0x3d76a1=new URLSearchParams({'grant_type':_0x45dea7['Eciyj'],'code':_0x16641c,'redirect_uri':_0xcb0e6b(0x154)+CALLBACK_PORT+_0xcb0e6b(0x16f),'client_id':_0x49fcfc,'code_verifier':_0x4d0374});_0x4cb3af&&_0x3d76a1[_0xcb0e6b(0x14f)](_0x45dea7[_0xcb0e6b(0x181)],_0x4cb3af);_0x24bb2f[_0xcb0e6b(0x149)]&&_0x3d76a1['set'](_0x45dea7[_0xcb0e6b(0x156)],_0x24bb2f[_0xcb0e6b(0x149)]);const _0x202f18=await fetch(_0xd34f7e[_0xcb0e6b(0x19c)],{'method':_0x45dea7[_0xcb0e6b(0x125)],'headers':{'Content-Type':_0xcb0e6b(0x171)},'body':_0x3d76a1});if(!_0x202f18['ok']){const _0x5f05cd=await _0x202f18[_0xcb0e6b(0x148)]();throw new Error('Token\x20exchange\x20failed:\x20'+_0x5f05cd);}const _0x2fc88f=await _0x202f18['json']();return console['log'](_0x45dea7['WCShe']),await saveCachedToken(_0x2fc88f[_0xcb0e6b(0x124)],_0x2fc88f['refresh_token'],_0x2fc88f['expires_in']),_0x2fc88f['access_token'];}async function callGetCliToken(_0x30328c,_0x58ce7b){const _0x2f6e6e=_0x18dc21,_0x16262d={'sHyTf':function(_0x27b31e,_0x236129,_0x121812){return _0x27b31e(_0x236129,_0x121812);},'RgEfP':'application/json','QKxHP':_0x2f6e6e(0x134),'qZFkx':'Authorization','owUdc':'Initializing\x20MCP\x20session...','TklyF':function(_0x225677,_0x3ccc7f){return _0x225677(_0x3ccc7f);},'WQqEq':'initialize','RtuyF':'1.0.0','GwmBn':'\x20done','EwKqG':function(_0x59de55,_0x3ad582,_0x57c20f){return _0x59de55(_0x3ad582,_0x57c20f);},'dPlyI':_0x2f6e6e(0x163),'mFmuA':_0x2f6e6e(0x164),'DQFJJ':_0x2f6e6e(0x158),'UkctQ':_0x2f6e6e(0x1a2),'lAHMQ':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','gqVDZ':function(_0x2d04c8,_0x5124f1,_0x53500f){return _0x2d04c8(_0x5124f1,_0x53500f);},'nVLcJ':'refresh.txt','fKtlu':function(_0x4644a6,_0x3e29c9,_0x5d83d1,_0x443813){return _0x4644a6(_0x3e29c9,_0x5d83d1,_0x443813);},'jfUgP':function(_0x426c6c,_0x449a0e,_0x24b3e6,_0x5cc533){return _0x426c6c(_0x449a0e,_0x24b3e6,_0x5cc533);},'CCPLB':'Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a'},_0x2f3f47={'Content-Type':_0x16262d[_0x2f6e6e(0x18f)],'Accept':_0x16262d['QKxHP']};_0x58ce7b&&(_0x2f3f47[_0x16262d['qZFkx']]=_0x2f6e6e(0x186)+_0x58ce7b);const _0x22add5=async _0x2e302a=>{const _0x309571=_0x2f6e6e,_0x464b9b=await _0x16262d['sHyTf'](fetch,_0x30328c,{'method':_0x309571(0x163),'headers':_0x2f3f47,'body':JSON[_0x309571(0x152)](_0x2e302a)});if(!_0x464b9b['ok']){const _0x3e7d19=await _0x464b9b['text']();throw new Error('HTTP\x20'+_0x464b9b[_0x309571(0x193)]+':\x20'+_0x3e7d19);}return parseResponse(_0x464b9b);};process['stdout'][_0x2f6e6e(0x182)](_0x16262d['owUdc']);const _0x216526=await _0x16262d['TklyF'](_0x22add5,{'jsonrpc':_0x2f6e6e(0x164),'id':0x1,'method':_0x16262d[_0x2f6e6e(0x162)],'params':{'protocolVersion':_0x2f6e6e(0x176),'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x16262d[_0x2f6e6e(0x188)]}}});if(_0x216526['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x216526[_0x2f6e6e(0x18d)][_0x2f6e6e(0x115)]??JSON['stringify'](_0x216526[_0x2f6e6e(0x18d)])));console[_0x2f6e6e(0x15e)](_0x16262d[_0x2f6e6e(0x170)]),await _0x16262d[_0x2f6e6e(0x17a)](fetch,_0x30328c,{'method':_0x16262d[_0x2f6e6e(0x120)],'headers':_0x2f3f47,'body':JSON[_0x2f6e6e(0x152)]({'jsonrpc':_0x2f6e6e(0x164),'method':_0x2f6e6e(0x11f)})})[_0x2f6e6e(0x1a0)](_0x55928f=>_0x55928f['text']()),process[_0x2f6e6e(0x131)][_0x2f6e6e(0x182)](_0x2f6e6e(0x191));const _0xe4e59b=await _0x16262d['TklyF'](_0x22add5,{'jsonrpc':_0x16262d['mFmuA'],'id':0x2,'method':_0x16262d[_0x2f6e6e(0x155)],'params':{'name':_0x16262d['UkctQ'],'arguments':{}}});if(_0xe4e59b[_0x2f6e6e(0x18d)])throw new Error(_0x2f6e6e(0x15d)+(_0xe4e59b['error']['message']??JSON[_0x2f6e6e(0x152)](_0xe4e59b['error'])));console['log']('\x20done');const _0x37e3a3=extractToken(_0xe4e59b[_0x2f6e6e(0x157)]);if(!_0x37e3a3){console['error']('\x0aUnexpected\x20response\x20structure:'),console['error'](JSON[_0x2f6e6e(0x152)](_0xe4e59b['result'],null,0x2));throw new Error(_0x16262d[_0x2f6e6e(0x15a)]);}const _0xc05a5f=_0x16262d[_0x2f6e6e(0x141)](join,homedir(),_0x2f6e6e(0x11d)),_0x369ec4=_0x16262d[_0x2f6e6e(0x17a)](join,_0xc05a5f,_0x16262d['nVLcJ']);await mkdir(_0xc05a5f,{'recursive':!![]}),await _0x16262d[_0x2f6e6e(0x126)](writeFile,_0x369ec4,_0x37e3a3,{'mode':0x180}),await _0x16262d[_0x2f6e6e(0x183)](writeFile,_0x16262d[_0x2f6e6e(0x141)](join,_0xc05a5f,'auth-origin.txt'),_0x30328c,{'mode':0x180}),console['log']('\x0aToken\x20written\x20to\x20'+_0x369ec4),console['log'](_0x16262d['CCPLB']);}async function fetchAuthServerMetadata(_0x13d330){const _0x36466e=_0x18dc21,_0x401108=_0x13d330+'/.well-known/oauth-authorization-server',_0x1ff132=await fetch(_0x401108);if(!_0x1ff132['ok'])throw new Error(_0x36466e(0x13a)+_0x401108+':\x20'+_0x1ff132[_0x36466e(0x193)]);return _0x1ff132['json']();}function waitForCallback(_0x37a3cd){const _0x5e4526=_0x18dc21,_0x16279c={'PFory':function(_0x2b389c){return _0x2b389c();},'WqEYU':function(_0x45bc9d,_0x3ce683){return _0x45bc9d(_0x3ce683);},'FTvuM':_0x5e4526(0x19e),'jXprR':_0x5e4526(0x17f),'IXeri':function(_0x53e7ff,_0x1810ba,_0x5e45a7){return _0x53e7ff(_0x1810ba,_0x5e45a7);},'rUlKT':'127.0.0.1'};return new Promise((_0x43fa36,_0x2d9be1)=>{const _0x5250dc=_0x5e4526,_0x43e466={'FoIzO':_0x16279c['FTvuM'],'iBoLZ':_0x5250dc(0x195),'avkYJ':_0x16279c[_0x5250dc(0x142)],'fZmiI':function(_0x515681,_0x41ff9f){return _0x515681(_0x41ff9f);},'klnxe':function(_0x5d401b,_0x1aa190){return _0x5d401b!==_0x1aa190;}},_0xc4f67e=()=>{const _0x37d55e=_0x5250dc;_0x367fa2[_0x37d55e(0x145)](),_0x367fa2[_0x37d55e(0x19b)]();},_0x42614b=_0x16279c['IXeri'](setTimeout,()=>{const _0x54ab04=_0x5250dc;_0x16279c[_0x54ab04(0x11c)](_0xc4f67e),_0x16279c[_0x54ab04(0x16a)](_0x2d9be1,new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x367fa2=createServer((_0x3d8734,_0x3dd4b4)=>{const _0x5276d7=_0x5250dc,_0xcff3c1=new URL(_0x3d8734[_0x5276d7(0x116)]??'/',_0x5276d7(0x154)+CALLBACK_PORT);if(_0xcff3c1['pathname']!=='/callback'){_0x3dd4b4['writeHead'](0x194),_0x3dd4b4['end'](_0x5276d7(0x196));return;}const _0xe18649=_0xcff3c1['searchParams'][_0x5276d7(0x13b)](_0x43e466['FoIzO']),_0x341d72=_0xcff3c1['searchParams'][_0x5276d7(0x13b)](_0x43e466['iBoLZ']),_0x10d550=_0xcff3c1[_0x5276d7(0x151)][_0x5276d7(0x13b)](_0x5276d7(0x18d));if(_0x10d550){const _0x4a8c59=_0xcff3c1[_0x5276d7(0x151)]['get']('error_description')??_0x10d550;_0x3dd4b4[_0x5276d7(0x13e)](0xc8,{'Content-Type':_0x43e466['avkYJ']}),_0x3dd4b4[_0x5276d7(0x1a3)](_0x5276d7(0x166)+_0x4a8c59+_0x5276d7(0x12c)),_0x43e466['fZmiI'](clearTimeout,_0x42614b),_0xc4f67e(),_0x2d9be1(new Error(_0x5276d7(0x11e)+_0x4a8c59));return;}if(!_0xe18649||_0x43e466['klnxe'](_0x341d72,_0x37a3cd)){_0x3dd4b4['writeHead'](0x190,{'Content-Type':_0x43e466['avkYJ']}),_0x3dd4b4[_0x5276d7(0x1a3)](_0x5276d7(0x138));return;}_0x3dd4b4[_0x5276d7(0x13e)](0xc8,{'Content-Type':_0x5276d7(0x17f)}),_0x3dd4b4['end'](_0x5276d7(0x187)),clearTimeout(_0x42614b),_0xc4f67e(),_0x43fa36(_0xe18649);});_0x367fa2['listen'](CALLBACK_PORT,_0x16279c[_0x5250dc(0x133)]);});}async function openBrowser(_0x1994ef){const _0x44dd4b=_0x18dc21,_0x2cd368={'NWjyk':function(_0x48f7c3,_0x13a88c){return _0x48f7c3===_0x13a88c;},'kNuWa':'win32','ErEcn':'start','wUbNu':function(_0x5d4e3a,_0x171265){return _0x5d4e3a(_0x171265);}},_0x14ebd9=_0x2cd368[_0x44dd4b(0x150)](process['platform'],'darwin')?_0x44dd4b(0x127):process['platform']===_0x2cd368['kNuWa']?_0x2cd368['ErEcn']:'xdg-open';_0x2cd368[_0x44dd4b(0x177)](exec,_0x14ebd9+'\x20\x22'+_0x1994ef+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x2466c6=_0x18dc21;try{const _0x5eeb83=JSON[_0x2466c6(0x189)](await readFile(TOKEN_CACHE_PATH,_0x2466c6(0x14a)));if(_0x5eeb83[_0x2466c6(0x12f)]&&_0x5eeb83[_0x2466c6(0x12f)]!==currentOrigin)return null;if(_0x5eeb83['expiresAt']&&Date[_0x2466c6(0x118)]()>_0x5eeb83[_0x2466c6(0x180)])return null;return _0x5eeb83[_0x2466c6(0x140)]??null;}catch{return null;}}async function saveCachedToken(_0x3d12b0,_0x57cdf3,_0x1a2001){const _0x5056f7=_0x18dc21,_0x1ae3a8={'GOiUS':function(_0x487240,_0x3d37c2){return _0x487240+_0x3d37c2;},'LXVuU':function(_0x18a640,_0x19c19d,_0xe3cc66){return _0x18a640(_0x19c19d,_0xe3cc66);},'eNkXK':function(_0x3d283f){return _0x3d283f();},'clVJJ':_0x5056f7(0x11d)},_0x835ebe=await loadCachedData(),_0x89bf48={..._0x835ebe,'origin':currentOrigin,'accessToken':_0x3d12b0,'refreshToken':_0x57cdf3??_0x835ebe?.[_0x5056f7(0x161)],'expiresAt':_0x1a2001?_0x1ae3a8['GOiUS'](Date[_0x5056f7(0x118)](),_0x1a2001*0x3e8):undefined};await _0x1ae3a8[_0x5056f7(0x197)](mkdir,_0x1ae3a8['LXVuU'](join,_0x1ae3a8['eNkXK'](homedir),_0x1ae3a8[_0x5056f7(0x12a)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x89bf48),{'mode':0x180});}async function loadCachedClient(){const _0x200b0d=_0x18dc21,_0x37d5bc=await loadCachedData();if(_0x37d5bc?.[_0x200b0d(0x12f)]&&_0x37d5bc[_0x200b0d(0x12f)]!==currentOrigin)return null;return _0x37d5bc?.[_0x200b0d(0x135)]?{'clientId':_0x37d5bc['clientId'],'clientSecret':_0x37d5bc['clientSecret']}:null;}async function clearCachedClient(){const _0x12ac45=_0x18dc21,_0x495228={'RvQKS':function(_0x16a10a,_0x2a26ec,_0x2f46ea,_0x596962){return _0x16a10a(_0x2a26ec,_0x2f46ea,_0x596962);}},_0x19330d=await loadCachedData();if(!_0x19330d)return;const {clientId:_0x35c9c9,clientSecret:_0x2eb18b,..._0x16aaec}=_0x19330d;await _0x495228['RvQKS'](writeFile,TOKEN_CACHE_PATH,JSON[_0x12ac45(0x152)](_0x16aaec),{'mode':0x180});}async function saveCachedClient(_0xad0100,_0x2acd18){const _0x508dce=_0x18dc21,_0x302fe3={'nSkaZ':function(_0x41a57d){return _0x41a57d();},'LtwRN':function(_0x24166f,_0x12d084,_0x1cbd23){return _0x24166f(_0x12d084,_0x1cbd23);},'qWXap':function(_0x45eb8e,_0xba6e3d,_0x57368b){return _0x45eb8e(_0xba6e3d,_0x57368b);},'wySkC':'.ranger'},_0xf7fc8b=await _0x302fe3['nSkaZ'](loadCachedData),_0x1c5d2a={..._0xf7fc8b,'origin':currentOrigin,'accessToken':_0xf7fc8b?.[_0x508dce(0x140)]??'','clientId':_0xad0100,'clientSecret':_0x2acd18};await _0x302fe3[_0x508dce(0x185)](mkdir,_0x302fe3[_0x508dce(0x119)](join,homedir(),_0x302fe3['wySkC']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x508dce(0x152)](_0x1c5d2a),{'mode':0x180});}async function loadCachedData(){const _0x522554={'iMedp':function(_0x58406b,_0x5996e6,_0x51255a){return _0x58406b(_0x5996e6,_0x51255a);},'mmESn':'utf-8'};try{return JSON['parse'](await _0x522554['iMedp'](readFile,TOKEN_CACHE_PATH,_0x522554['mmESn']));}catch{return null;}}async function parseResponse(_0xa9ded7){const _0x5ce14c=_0x18dc21,_0x3fa643={'qbnnP':_0x5ce14c(0x132),'PgjWX':'data:','xuhET':'No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream'},_0x46e8ce=_0xa9ded7[_0x5ce14c(0x1a7)]['get'](_0x3fa643['qbnnP'])??'';if(_0x46e8ce['includes']('text/event-stream')){const _0x59e2a0=await _0xa9ded7['text']();for(const _0x2a6917 of _0x59e2a0['split']('\x0a')){const _0x14a727=_0x2a6917['trim']();if(_0x14a727['startsWith'](_0x3fa643['PgjWX'])){const _0x3641c7=_0x14a727[_0x5ce14c(0x174)](_0x3fa643[_0x5ce14c(0x117)]['length'])['trim']();if(!_0x3641c7)continue;try{const _0x541e7=JSON['parse'](_0x3641c7);if(_0x541e7['id']!==undefined||_0x541e7['error'])return _0x541e7;}catch{}}}throw new Error(_0x3fa643['xuhET']);}return _0xa9ded7['json']();}function extractToken(_0x4eb4a2){const _0x4805c2=_0x18dc21,_0x1028c2={'ObkiE':_0x4805c2(0x14b),'bYXNr':_0x4805c2(0x1a5),'tbEMF':function(_0x537ef8,_0x50f12f){return _0x537ef8===_0x50f12f;}};if(!_0x4eb4a2)return null;const _0x1933ce=_0x4eb4a2['structuredContent'];if(_0x1933ce?.['token']&&typeof _0x1933ce[_0x4805c2(0x137)]===_0x1028c2['ObkiE'])return _0x1933ce[_0x4805c2(0x137)];if(_0x4eb4a2[_0x4805c2(0x192)]){const _0x308048=_0x4eb4a2[_0x4805c2(0x15b)];throw new Error(_0x4805c2(0x19d)+(_0x308048?.[0x0]?.[_0x4805c2(0x148)]??_0x1028c2[_0x4805c2(0x199)]));}const _0x776056=_0x4eb4a2['content'];if(_0x776056)for(const _0x4cc26c of _0x776056){if(_0x1028c2['tbEMF'](_0x4cc26c['type'],_0x4805c2(0x148))&&_0x4cc26c['text']){try{const _0x40d3b3=JSON[_0x4805c2(0x189)](_0x4cc26c['text']);if(_0x1028c2['tbEMF'](typeof _0x40d3b3?.['token'],_0x4805c2(0x14b)))return _0x40d3b3['token'];}catch{}const _0x171ab3=_0x4cc26c[_0x4805c2(0x148)]['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x171ab3)return _0x171ab3[0x1];}}return null;}
|
|
1
|
+
const _0x3bd94e=_0x73f1;(function(_0x153b71,_0x475614){const _0x5e789f=_0x73f1,_0x2f258a=_0x153b71();while(!![]){try{const _0x2f3916=parseInt(_0x5e789f(0x22c))/0x1+parseInt(_0x5e789f(0x241))/0x2+parseInt(_0x5e789f(0x206))/0x3*(parseInt(_0x5e789f(0x1b5))/0x4)+-parseInt(_0x5e789f(0x21f))/0x5+-parseInt(_0x5e789f(0x208))/0x6*(-parseInt(_0x5e789f(0x229))/0x7)+-parseInt(_0x5e789f(0x1d7))/0x8*(-parseInt(_0x5e789f(0x22f))/0x9)+-parseInt(_0x5e789f(0x1c2))/0xa;if(_0x2f3916===_0x475614)break;else _0x2f258a['push'](_0x2f258a['shift']());}catch(_0x318341){_0x2f258a['push'](_0x2f258a['shift']());}}}(_0x26e0,0x1fb0a));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',_0x3bd94e(0x1e6)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x3bd94e(0x212));export async function getMcpAuthOrigin(){const _0x283746=_0x3bd94e,_0x192e18={'Dghgm':'utf-8'};try{const _0x2153db=(await readFile(AUTH_ORIGIN_PATH,_0x192e18[_0x283746(0x20a)]))[_0x283746(0x218)]();return _0x2153db||null;}catch{return null;}}export async function mcpBootstrap(){const _0x3405c8=_0x3bd94e,_0x578276={'wTaHR':function(_0x29d3df){return _0x29d3df();},'yyAld':function(_0x56843a,_0x40601e){return _0x56843a(_0x40601e);},'Ltbox':function(_0x1973b4,_0x420784){return _0x1973b4===_0x420784;},'Gqkbk':_0x3405c8(0x23d),'KspyX':function(_0x198799){return _0x198799();},'qeaPa':_0x3405c8(0x1e5)},_0xf986ec=_0x578276['wTaHR'](getMcpAuthUrl);currentOrigin=_0xf986ec;const _0x26f3ba=process[_0x3405c8(0x1bc)][_0x3405c8(0x1f3)]??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0xf986ec+'\x0a');const _0x20ed0d=await _0x578276['yyAld'](tryUnauthenticated,_0xf986ec);let _0x3a0fbc=null;if(_0x578276['Ltbox'](_0x20ed0d,_0x578276['Gqkbk']))_0x3a0fbc='';else{_0x3a0fbc=await _0x578276['KspyX'](loadCachedToken);if(!_0x3a0fbc){if(!_0x26f3ba)throw new Error(_0x3405c8(0x21c)+_0x578276[_0x3405c8(0x1df)]);_0x3a0fbc=await oauthFlow(_0xf986ec);}}await callGetCliToken(_0xf986ec,_0x3a0fbc);}async function tryUnauthenticated(_0x438df8){const _0x30166a=_0x3bd94e,_0x579c7f={'CXPlH':_0x30166a(0x1ec),'MTKWN':'2.0','WtHJc':_0x30166a(0x1b7),'RBPDk':_0x30166a(0x226),'dbVxj':'needs-oauth'},_0x4e58af=await fetch(_0x438df8,{'method':_0x30166a(0x237),'headers':{'Content-Type':_0x30166a(0x20c),'Accept':_0x579c7f[_0x30166a(0x220)]},'body':JSON['stringify']({'jsonrpc':_0x579c7f['MTKWN'],'id':0x1,'method':_0x579c7f[_0x30166a(0x215)],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x579c7f[_0x30166a(0x1cb)]}}})});if(_0x4e58af['ok'])return await _0x4e58af[_0x30166a(0x1e4)](),'proxied';if(_0x4e58af['status']===0x191)return await _0x4e58af['text'](),_0x579c7f[_0x30166a(0x1de)];const _0x19ac27=await _0x4e58af['text']();throw new Error(_0x30166a(0x22a)+_0x4e58af[_0x30166a(0x1c5)]+':\x20'+_0x19ac27);}class OAuthTimeoutError extends Error{constructor(_0x42fa33){const _0x21bc29=_0x3bd94e,_0x536162={'cbBTJ':_0x21bc29(0x1ca)};super(_0x42fa33),this['name']=_0x536162['cbBTJ'];}}async function oauthFlow(_0x19ba15){const _0x5ea207=_0x3bd94e,_0x157622={'EcvMv':function(_0x280797,_0x1d75c9){return _0x280797(_0x1d75c9);},'PhJeV':function(_0x472d19){return _0x472d19();},'lOjxn':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','RvTEG':function(_0x33837f,_0x1c9acb){return _0x33837f(_0x1c9acb);}};try{return await _0x157622['EcvMv'](oauthFlowAttempt,_0x19ba15);}catch(_0x2af267){if(_0x2af267 instanceof OAuthTimeoutError&&await _0x157622['PhJeV'](loadCachedClient))return console['log'](_0x157622[_0x5ea207(0x239)]),await _0x157622['PhJeV'](clearCachedClient),await _0x157622['RvTEG'](oauthFlowAttempt,_0x19ba15);throw _0x2af267;}}async function oauthFlowAttempt(_0x3fe284){const _0x1a1b67=_0x3bd94e,_0x425143={'FiDom':function(_0x39771a){return _0x39771a();},'xaErv':'Registering\x20OAuth\x20client...','SlthC':function(_0x1e1ace,_0x22d629,_0x3bf6c8){return _0x1e1ace(_0x22d629,_0x3bf6c8);},'bsAQf':_0x1a1b67(0x237),'LQvNH':_0x1a1b67(0x20c),'kfInO':_0x1a1b67(0x1ef),'iQoUi':'\x20done','RpEPX':function(_0x34e0ed,_0x265097){return _0x34e0ed(_0x265097);},'SGqUK':_0x1a1b67(0x207),'vsJfK':'response_type','SOdDh':'code','yNpZA':'redirect_uri','wYxan':_0x1a1b67(0x221),'UpJGF':_0x1a1b67(0x23b),'gBoga':_0x1a1b67(0x1f0),'OEExU':'client_secret','yEPQH':'application/x-www-form-urlencoded','HRuAa':function(_0x3260da,_0x4cea8f,_0x880b6f,_0x538887){return _0x3260da(_0x4cea8f,_0x880b6f,_0x538887);}},_0x2db3cd=_0x3fe284['replace'](/\/mcp$/,'');process[_0x1a1b67(0x1bc)][_0x1a1b67(0x20e)](_0x1a1b67(0x1ce));const _0x553e4b=await fetch(_0x2db3cd+_0x1a1b67(0x227));if(!_0x553e4b['ok'])throw new Error(_0x1a1b67(0x1c7));const _0x1f525a=await _0x553e4b[_0x1a1b67(0x20b)](),_0x4b8ed2=_0x1f525a[_0x1a1b67(0x22e)]?.[0x0];if(!_0x4b8ed2)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console[_0x1a1b67(0x1f2)]('\x20'+_0x4b8ed2);const _0x41e312=await fetchAuthServerMetadata(_0x4b8ed2);let _0x271597,_0x557a51;const _0x2c904d=await _0x425143['FiDom'](loadCachedClient);if(_0x2c904d)_0x271597=_0x2c904d['clientId'],_0x557a51=_0x2c904d['clientSecret'];else{if(_0x41e312[_0x1a1b67(0x219)]){process['stdout']['write'](_0x425143['xaErv']);const _0x67275c=await _0x425143[_0x1a1b67(0x1c8)](fetch,_0x41e312[_0x1a1b67(0x219)],{'method':_0x425143['bsAQf'],'headers':{'Content-Type':_0x425143['LQvNH']},'body':JSON[_0x1a1b67(0x22b)]({'client_name':_0x1a1b67(0x230),'redirect_uris':['http://localhost:'+CALLBACK_PORT+'/callback'],'grant_types':[_0x425143['kfInO'],_0x1a1b67(0x1dc)],'response_types':[_0x1a1b67(0x1dd)],'token_endpoint_auth_method':_0x1a1b67(0x20f)})});if(!_0x67275c['ok']){const _0x380ced=await _0x67275c[_0x1a1b67(0x1e4)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x380ced);}const _0x5cab8f=await _0x67275c[_0x1a1b67(0x20b)]();_0x271597=_0x5cab8f[_0x1a1b67(0x1ea)],_0x557a51=_0x5cab8f['client_secret'],await _0x425143['SlthC'](saveCachedClient,_0x271597,_0x557a51),console['log'](_0x425143[_0x1a1b67(0x210)]);}else throw new Error(_0x1a1b67(0x1e0));}const _0x3fd533=_0x425143['RpEPX'](randomBytes,0x20)[_0x1a1b67(0x1e1)](_0x425143['SGqUK']),_0x4d8e95=_0x425143['RpEPX'](createHash,_0x1a1b67(0x1fb))[_0x1a1b67(0x232)](_0x3fd533)['digest']('base64url'),_0x1a75ff=_0x425143['RpEPX'](randomBytes,0x10)['toString']('hex'),_0x439a9c=new URL(_0x41e312[_0x1a1b67(0x23f)]);_0x439a9c[_0x1a1b67(0x201)][_0x1a1b67(0x234)](_0x425143['vsJfK'],_0x425143['SOdDh']),_0x439a9c['searchParams']['set']('client_id',_0x271597),_0x439a9c['searchParams'][_0x1a1b67(0x234)](_0x425143[_0x1a1b67(0x1d1)],'http://localhost:'+CALLBACK_PORT+_0x1a1b67(0x236)),_0x439a9c['searchParams'][_0x1a1b67(0x234)](_0x1a1b67(0x1d9),_0x4d8e95),_0x439a9c['searchParams'][_0x1a1b67(0x234)](_0x1a1b67(0x214),_0x425143['wYxan']),_0x439a9c['searchParams'][_0x1a1b67(0x234)](_0x425143['UpJGF'],_0x1a75ff);_0x1f525a['resource']&&_0x439a9c[_0x1a1b67(0x201)]['set'](_0x1a1b67(0x22d),_0x1f525a['resource']);console['log'](_0x425143[_0x1a1b67(0x213)]),console[_0x1a1b67(0x1f2)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x439a9c['toString']()+'\x0a'),await openBrowser(_0x439a9c['toString']());const _0x3ca4e8=await _0x425143['RpEPX'](waitForCallback,_0x1a75ff);process['stdout']['write']('Exchanging\x20authorization\x20code...');const _0x35ff06=new URLSearchParams({'grant_type':_0x425143[_0x1a1b67(0x222)],'code':_0x3ca4e8,'redirect_uri':_0x1a1b67(0x1c3)+CALLBACK_PORT+'/callback','client_id':_0x271597,'code_verifier':_0x3fd533});_0x557a51&&_0x35ff06[_0x1a1b67(0x234)](_0x425143[_0x1a1b67(0x21a)],_0x557a51);_0x1f525a['resource']&&_0x35ff06['set']('resource',_0x1f525a['resource']);const _0x44f457=await fetch(_0x41e312[_0x1a1b67(0x1cf)],{'method':_0x425143[_0x1a1b67(0x1ff)],'headers':{'Content-Type':_0x425143[_0x1a1b67(0x211)]},'body':_0x35ff06});if(!_0x44f457['ok']){const _0x9b07f3=await _0x44f457[_0x1a1b67(0x1e4)]();throw new Error(_0x1a1b67(0x224)+_0x9b07f3);}const _0x2972cb=await _0x44f457['json']();return console['log'](_0x425143[_0x1a1b67(0x210)]),await _0x425143[_0x1a1b67(0x1f9)](saveCachedToken,_0x2972cb['access_token'],_0x2972cb[_0x1a1b67(0x1dc)],_0x2972cb['expires_in']),_0x2972cb['access_token'];}async function callGetCliToken(_0x444de2,_0x2f3d9c){const _0x52bc3a=_0x3bd94e,_0x1684e1={'WHpla':_0x52bc3a(0x20c),'DBXKr':'application/json,\x20text/event-stream','ySnJJ':_0x52bc3a(0x231),'oPvvr':function(_0x5b3ded,_0x5e32e6){return _0x5b3ded(_0x5e32e6);},'DivPP':'2.0','YSEhn':'initialize','KROJL':'1.0.0','kmWZs':_0x52bc3a(0x1f8),'pmRuD':function(_0x5c1021,_0x4937ca,_0x4bb6e9){return _0x5c1021(_0x4937ca,_0x4bb6e9);},'whSzk':'POST','RQMya':'get_cli_token','efaJv':_0x52bc3a(0x1bf),'OeBYk':function(_0xf28bc){return _0xf28bc();},'Onvit':function(_0x257f68,_0x433334,_0x34fde2){return _0x257f68(_0x433334,_0x34fde2);},'MLmhc':function(_0x3226e6,_0x36c723,_0x3c2356,_0x5c2a72){return _0x3226e6(_0x36c723,_0x3c2356,_0x5c2a72);},'Tamcx':function(_0xd5da1d,_0x2b5b33,_0x5b3351){return _0xd5da1d(_0x2b5b33,_0x5b3351);},'qYjJr':_0x52bc3a(0x212)},_0x23f836={'Content-Type':_0x1684e1[_0x52bc3a(0x1b9)],'Accept':_0x1684e1['DBXKr']};_0x2f3d9c&&(_0x23f836[_0x1684e1[_0x52bc3a(0x1e3)]]='Bearer\x20'+_0x2f3d9c);const _0x5ae2de=async _0x2ac0f7=>{const _0x14ba16=_0x52bc3a,_0x49cd60=await fetch(_0x444de2,{'method':_0x14ba16(0x237),'headers':_0x23f836,'body':JSON['stringify'](_0x2ac0f7)});if(!_0x49cd60['ok']){const _0x16d143=await _0x49cd60['text']();throw new Error(_0x14ba16(0x1cd)+_0x49cd60['status']+':\x20'+_0x16d143);}return parseResponse(_0x49cd60);};process[_0x52bc3a(0x1bc)][_0x52bc3a(0x20e)](_0x52bc3a(0x1d4));const _0x4d9be7=await _0x1684e1['oPvvr'](_0x5ae2de,{'jsonrpc':_0x1684e1[_0x52bc3a(0x1bd)],'id':0x1,'method':_0x1684e1[_0x52bc3a(0x21b)],'params':{'protocolVersion':_0x52bc3a(0x1b6),'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x1684e1[_0x52bc3a(0x209)]}}});if(_0x4d9be7['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x4d9be7['error']['message']??JSON[_0x52bc3a(0x22b)](_0x4d9be7[_0x52bc3a(0x225)])));console[_0x52bc3a(0x1f2)](_0x1684e1[_0x52bc3a(0x20d)]),await _0x1684e1[_0x52bc3a(0x1f7)](fetch,_0x444de2,{'method':_0x1684e1[_0x52bc3a(0x1d3)],'headers':_0x23f836,'body':JSON[_0x52bc3a(0x22b)]({'jsonrpc':_0x1684e1['DivPP'],'method':'notifications/initialized'})})['then'](_0x4f1c15=>_0x4f1c15['text']()),process['stdout']['write']('Requesting\x20CLI\x20token...');const _0x56ccc9=await _0x5ae2de({'jsonrpc':_0x52bc3a(0x1d2),'id':0x2,'method':'tools/call','params':{'name':_0x1684e1['RQMya'],'arguments':{}}});if(_0x56ccc9[_0x52bc3a(0x225)])throw new Error('get_cli_token\x20failed:\x20'+(_0x56ccc9[_0x52bc3a(0x225)]['message']??JSON[_0x52bc3a(0x22b)](_0x56ccc9['error'])));console['log'](_0x52bc3a(0x1f8));const _0x32c5b2=extractToken(_0x56ccc9[_0x52bc3a(0x1e8)]);if(!_0x32c5b2){console['error']('\x0aUnexpected\x20response\x20structure:'),console[_0x52bc3a(0x225)](JSON['stringify'](_0x56ccc9['result'],null,0x2));throw new Error(_0x1684e1[_0x52bc3a(0x238)]);}const _0x721213=_0x1684e1['pmRuD'](join,_0x1684e1[_0x52bc3a(0x205)](homedir),_0x52bc3a(0x216)),_0x165098=_0x1684e1['Onvit'](join,_0x721213,'refresh.txt');await mkdir(_0x721213,{'recursive':!![]}),await _0x1684e1['MLmhc'](writeFile,_0x165098,_0x32c5b2,{'mode':0x180}),await _0x1684e1[_0x52bc3a(0x235)](writeFile,_0x1684e1[_0x52bc3a(0x1be)](join,_0x721213,_0x1684e1['qYjJr']),_0x444de2,{'mode':0x180}),console[_0x52bc3a(0x1f2)]('\x0aToken\x20written\x20to\x20'+_0x165098),console[_0x52bc3a(0x1f2)](_0x52bc3a(0x1e7));}async function fetchAuthServerMetadata(_0x150fee){const _0x35635d=_0x3bd94e,_0x2eaa5b={'ktSWD':function(_0x4d9f3f,_0x55cc36){return _0x4d9f3f(_0x55cc36);}},_0x1b261a=_0x150fee+_0x35635d(0x242),_0x35844=await _0x2eaa5b[_0x35635d(0x223)](fetch,_0x1b261a);if(!_0x35844['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x1b261a+':\x20'+_0x35844['status']);return _0x35844['json']();}function waitForCallback(_0xd4b828){const _0x571b04=_0x3bd94e,_0x1a9742={'ABYwN':function(_0x3075e1){return _0x3075e1();},'eNPsJ':'OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','hmhIA':_0x571b04(0x236),'NvImp':'error','eGkwg':function(_0x383664,_0x8bf758){return _0x383664(_0x8bf758);},'zIQLC':function(_0x384334,_0x2239ef){return _0x384334(_0x2239ef);}};return new Promise((_0x31e8bb,_0x21d7a5)=>{const _0x1cc929=_0x571b04,_0x23f98f={'NgKvV':_0x1a9742['hmhIA'],'TqvPD':_0x1cc929(0x1c1),'xhDPL':_0x1a9742[_0x1cc929(0x1fe)],'LWdGt':'error_description','KYpEA':'text/html','bTNaW':function(_0x3ec97f,_0xf6d761){const _0x2708c4=_0x1cc929;return _0x1a9742[_0x2708c4(0x1c4)](_0x3ec97f,_0xf6d761);},'rvItf':function(_0x261ef5){const _0x469b14=_0x1cc929;return _0x1a9742[_0x469b14(0x228)](_0x261ef5);},'TeMTW':function(_0x16a6f2,_0xc8c448){return _0x16a6f2(_0xc8c448);}},_0x26c1c0=()=>{const _0x20e46a=_0x1cc929;_0x29709b[_0x20e46a(0x1da)](),_0x29709b['close']();},_0x5a443a=setTimeout(()=>{const _0x2b02df=_0x1cc929;_0x1a9742['ABYwN'](_0x26c1c0),_0x21d7a5(new OAuthTimeoutError(_0x1a9742[_0x2b02df(0x1fd)]));},0x1d4c0),_0x29709b=_0x1a9742['zIQLC'](createServer,(_0x35d887,_0x41d181)=>{const _0x405e78=_0x1cc929,_0x3fd351=new URL(_0x35d887[_0x405e78(0x1db)]??'/','http://localhost:'+CALLBACK_PORT);if(_0x3fd351[_0x405e78(0x244)]!==_0x23f98f['NgKvV']){_0x41d181[_0x405e78(0x240)](0x194),_0x41d181['end'](_0x23f98f['TqvPD']);return;}const _0x1510d4=_0x3fd351[_0x405e78(0x201)][_0x405e78(0x1c6)](_0x405e78(0x1dd)),_0x26023e=_0x3fd351[_0x405e78(0x201)]['get'](_0x405e78(0x23b)),_0x217d28=_0x3fd351['searchParams'][_0x405e78(0x1c6)](_0x23f98f['xhDPL']);if(_0x217d28){const _0x509b54=_0x3fd351[_0x405e78(0x201)][_0x405e78(0x1c6)](_0x23f98f['LWdGt'])??_0x217d28;_0x41d181['writeHead'](0xc8,{'Content-Type':_0x23f98f['KYpEA']}),_0x41d181[_0x405e78(0x23a)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x509b54+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),_0x23f98f[_0x405e78(0x1fa)](clearTimeout,_0x5a443a),_0x23f98f[_0x405e78(0x1e9)](_0x26c1c0),_0x23f98f['TeMTW'](_0x21d7a5,new Error('OAuth\x20error:\x20'+_0x509b54));return;}if(!_0x1510d4||_0x26023e!==_0xd4b828){_0x41d181[_0x405e78(0x240)](0x190,{'Content-Type':'text/html'}),_0x41d181[_0x405e78(0x23a)]('<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>');return;}_0x41d181['writeHead'](0xc8,{'Content-Type':'text/html'}),_0x41d181[_0x405e78(0x23a)]('<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'),_0x23f98f['bTNaW'](clearTimeout,_0x5a443a),_0x26c1c0(),_0x31e8bb(_0x1510d4);});_0x29709b['listen'](CALLBACK_PORT,'127.0.0.1');});}async function openBrowser(_0x37a505){const _0x25cfe3=_0x3bd94e,_0x40ab32={'aJHLk':function(_0x4c5ba4,_0x4ea32b){return _0x4c5ba4===_0x4ea32b;},'gCuYI':'darwin','ylEff':'win32','hEMfv':function(_0x33adab,_0x467bcd){return _0x33adab(_0x467bcd);}},_0x3702af=_0x40ab32['aJHLk'](process['platform'],_0x40ab32['gCuYI'])?'open':process[_0x25cfe3(0x23e)]===_0x40ab32[_0x25cfe3(0x1c9)]?_0x25cfe3(0x243):'xdg-open';_0x40ab32['hEMfv'](exec,_0x3702af+'\x20\x22'+_0x37a505+'\x22');}function _0x26e0(){const _0x1b5604=['\x20done','HRuAa','bTNaW','sha256','now','eNPsJ','NvImp','bsAQf','ujkTH','searchParams','type','match','CcVQL','OeBYk','120153jpSbKd','base64url','926274psPvcq','KROJL','Dghgm','json','application/json','kmWZs','write','none','iQoUi','yEPQH','auth-origin.txt','gBoga','code_challenge_method','WtHJc','.ranger','expiresAt','trim','registration_endpoint','OEExU','YSEhn','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','bOlSl','1246325bxiYXe','CXPlH','S256','kfInO','ktSWD','Token\x20exchange\x20failed:\x20','error','1.0.0','/.well-known/oauth-protected-resource','ABYwN','7zpeKJq','MCP\x20server\x20returned\x20HTTP\x20','stringify','206925yQxRDd','resource','authorization_servers','13401smgPTz','Ranger\x20CLI','Authorization','update','includes','set','MLmhc','/callback','POST','efaJv','lOjxn','end','state','wtaYT','proxied','platform','authorization_endpoint','writeHead','281520kNdzQX','/.well-known/oauth-authorization-server','start','pathname','4tzzRtL','2025-03-26','initialize','XnADa','WHpla','refreshToken','IIbTi','stdout','DivPP','Tamcx','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','split','Not\x20found','3849090NIiEHd','http://localhost:','eGkwg','status','get','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','SlthC','ylEff','OAuthTimeoutError','RBPDk','content-type','HTTP\x20','Discovering\x20authorization\x20server...','token_endpoint','origin','yNpZA','2.0','whSzk','Initializing\x20MCP\x20session...','structuredContent','Server\x20returned\x20error:\x20','1192oLfqrp','clientSecret','code_challenge','closeAllConnections','url','refresh_token','code','dbVxj','qeaPa','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','toString','MTJwY','ySnJJ','text','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','mcp-oauth-tokens.json','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','result','rvItf','client_id','token','application/json,\x20text/event-stream','accessToken','content','authorization_code','\x0aOpening\x20browser\x20for\x20authentication...','vPtjn','log','isTTY','parse','QxLmh','slice','pmRuD'];_0x26e0=function(){return _0x1b5604;};return _0x26e0();}let currentOrigin='';async function loadCachedToken(){const _0x5ee23c=_0x3bd94e,_0x105af2={'iCSId':'utf-8','noidk':function(_0x5d1494,_0x1ed788){return _0x5d1494!==_0x1ed788;},'CcVQL':function(_0x89307d,_0x294624){return _0x89307d>_0x294624;}};try{const _0x167b96=JSON[_0x5ee23c(0x1f4)](await readFile(TOKEN_CACHE_PATH,_0x105af2['iCSId']));if(_0x167b96[_0x5ee23c(0x1d0)]&&_0x105af2['noidk'](_0x167b96[_0x5ee23c(0x1d0)],currentOrigin))return null;if(_0x167b96['expiresAt']&&_0x105af2[_0x5ee23c(0x204)](Date['now'](),_0x167b96[_0x5ee23c(0x217)]))return null;return _0x167b96['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0xefe613,_0x4713e1,_0x21e890){const _0x4ca89b=_0x3bd94e,_0xc80f53={'dBncx':function(_0x4f81ee,_0x250ff1){return _0x4f81ee*_0x250ff1;},'MTJwY':function(_0x43a04d,_0x443efb,_0x212109){return _0x43a04d(_0x443efb,_0x212109);},'PjVNQ':function(_0x58c7a7){return _0x58c7a7();},'bOlSl':_0x4ca89b(0x216)},_0x40828c=await loadCachedData(),_0x355045={..._0x40828c,'origin':currentOrigin,'accessToken':_0xefe613,'refreshToken':_0x4713e1??_0x40828c?.[_0x4ca89b(0x1ba)],'expiresAt':_0x21e890?Date[_0x4ca89b(0x1fc)]()+_0xc80f53['dBncx'](_0x21e890,0x3e8):undefined};await mkdir(_0xc80f53[_0x4ca89b(0x1e2)](join,_0xc80f53['PjVNQ'](homedir),_0xc80f53[_0x4ca89b(0x21e)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x4ca89b(0x22b)](_0x355045),{'mode':0x180});}async function loadCachedClient(){const _0x548830=_0x3bd94e,_0x6fbe54={'dHytu':function(_0x175bf9){return _0x175bf9();}},_0x2c31b9=await _0x6fbe54['dHytu'](loadCachedData);if(_0x2c31b9?.['origin']&&_0x2c31b9[_0x548830(0x1d0)]!==currentOrigin)return null;return _0x2c31b9?.['clientId']?{'clientId':_0x2c31b9['clientId'],'clientSecret':_0x2c31b9[_0x548830(0x1d8)]}:null;}async function clearCachedClient(){const _0xa823fe=_0x3bd94e,_0x2029be=await loadCachedData();if(!_0x2029be)return;const {clientId:_0x21a566,clientSecret:_0x4bfa1a,..._0x2931b6}=_0x2029be;await writeFile(TOKEN_CACHE_PATH,JSON[_0xa823fe(0x22b)](_0x2931b6),{'mode':0x180});}function _0x73f1(_0x17c025,_0x4a5cc1){_0x17c025=_0x17c025-0x1b5;const _0x26e06f=_0x26e0();let _0x73f199=_0x26e06f[_0x17c025];return _0x73f199;}async function saveCachedClient(_0x385ac2,_0x2c53e8){const _0x5ee9fd=_0x3bd94e,_0x448039={'wtaYT':function(_0x3ed61d){return _0x3ed61d();},'vPtjn':function(_0x51df08,_0x297d74,_0x5d214c){return _0x51df08(_0x297d74,_0x5d214c);},'UjTZr':function(_0x565057){return _0x565057();},'BUsLX':function(_0x35c7ab,_0xf3181d,_0x20aa20,_0x57ac53){return _0x35c7ab(_0xf3181d,_0x20aa20,_0x57ac53);}},_0x543d0=await _0x448039[_0x5ee9fd(0x23c)](loadCachedData),_0x16561f={..._0x543d0,'origin':currentOrigin,'accessToken':_0x543d0?.[_0x5ee9fd(0x1ed)]??'','clientId':_0x385ac2,'clientSecret':_0x2c53e8};await _0x448039[_0x5ee9fd(0x1f1)](mkdir,_0x448039['vPtjn'](join,_0x448039['UjTZr'](homedir),_0x5ee9fd(0x216)),{'recursive':!![]}),await _0x448039['BUsLX'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x16561f),{'mode':0x180});}async function loadCachedData(){const _0x54e852={'yVgau':function(_0x1a421e,_0xbc6d87,_0x46edd0){return _0x1a421e(_0xbc6d87,_0x46edd0);},'HslNO':'utf-8'};try{return JSON['parse'](await _0x54e852['yVgau'](readFile,TOKEN_CACHE_PATH,_0x54e852['HslNO']));}catch{return null;}}async function parseResponse(_0x38ce48){const _0x9014f9=_0x3bd94e,_0x3906d2={'QxLmh':_0x9014f9(0x1cc),'GQcXl':'data:'},_0x33d1b2=_0x38ce48['headers']['get'](_0x3906d2[_0x9014f9(0x1f5)])??'';if(_0x33d1b2[_0x9014f9(0x233)]('text/event-stream')){const _0x5e411b=await _0x38ce48[_0x9014f9(0x1e4)]();for(const _0x1b3a06 of _0x5e411b[_0x9014f9(0x1c0)]('\x0a')){const _0xf8f309=_0x1b3a06[_0x9014f9(0x218)]();if(_0xf8f309['startsWith'](_0x3906d2['GQcXl'])){const _0x17360b=_0xf8f309[_0x9014f9(0x1f6)](_0x3906d2['GQcXl']['length'])[_0x9014f9(0x218)]();if(!_0x17360b)continue;try{const _0x47cb9d=JSON[_0x9014f9(0x1f4)](_0x17360b);if(_0x47cb9d['id']!==undefined||_0x47cb9d['error'])return _0x47cb9d;}catch{}}}throw new Error(_0x9014f9(0x21d));}return _0x38ce48['json']();}function extractToken(_0xfd436e){const _0x1327d0=_0x3bd94e,_0x42b4a6={'IIbTi':'string','ujkTH':'Unknown\x20error','XnADa':function(_0x5432d6,_0x1f5120){return _0x5432d6===_0x1f5120;},'xTftK':function(_0x1069f3,_0x240539){return _0x1069f3===_0x240539;}};if(!_0xfd436e)return null;const _0x4157d9=_0xfd436e[_0x1327d0(0x1d5)];if(_0x4157d9?.[_0x1327d0(0x1eb)]&&typeof _0x4157d9['token']===_0x42b4a6[_0x1327d0(0x1bb)])return _0x4157d9['token'];if(_0xfd436e['isError']){const _0x9bada=_0xfd436e[_0x1327d0(0x1ee)];throw new Error(_0x1327d0(0x1d6)+(_0x9bada?.[0x0]?.['text']??_0x42b4a6[_0x1327d0(0x200)]));}const _0x21bb0f=_0xfd436e['content'];if(_0x21bb0f)for(const _0x502641 of _0x21bb0f){if(_0x42b4a6[_0x1327d0(0x1b8)](_0x502641[_0x1327d0(0x202)],_0x1327d0(0x1e4))&&_0x502641['text']){try{const _0x5efab8=JSON[_0x1327d0(0x1f4)](_0x502641[_0x1327d0(0x1e4)]);if(_0x42b4a6['xTftK'](typeof _0x5efab8?.[_0x1327d0(0x1eb)],_0x42b4a6['IIbTi']))return _0x5efab8['token'];}catch{}const _0x340c50=_0x502641[_0x1327d0(0x1e4)][_0x1327d0(0x203)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x340c50)return _0x340c50[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x20ebb1,_0x582894){var _0x48101e=_0x2b00,_0x52f208=_0x20ebb1();while(!![]){try{var _0x56c3c5=-parseInt(_0x48101e(0x7c))/0x1*(-parseInt(_0x48101e(0x80))/0x2)+-parseInt(_0x48101e(0x7a))/0x3+parseInt(_0x48101e(0x7f))/0x4+parseInt(_0x48101e(0x7d))/0x5*(parseInt(_0x48101e(0x82))/0x6)+parseInt(_0x48101e(0x83))/0x7*(parseInt(_0x48101e(0x78))/0x8)+parseInt(_0x48101e(0x72))/0x9*(parseInt(_0x48101e(0x73))/0xa)+parseInt(_0x48101e(0x75))/0xb*(-parseInt(_0x48101e(0x77))/0xc);if(_0x56c3c5===_0x582894)break;else _0x52f208['push'](_0x52f208['shift']());}catch(_0x4c97f4){_0x52f208['push'](_0x52f208['shift']());}}}(_0x3d29,0xe994a));export async function migrateProfile(_0x13ee27,_0x518aea){var _0x58853b=_0x2b00,_0x385b97={'KBKMw':function(_0x1a6b1b,_0x1b4774){return _0x1a6b1b+_0x1b4774;},'nNmMG':function(_0x3cab9e,_0x3b1cb7){return _0x3cab9e+_0x3b1cb7;},'QkITV':_0x58853b(0x7e)};console['error'](_0x385b97[_0x58853b(0x76)](_0x385b97[_0x58853b(0x79)](_0x385b97['nNmMG'](_0x385b97[_0x58853b(0x79)](_0x385b97[_0x58853b(0x79)]('ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a'+'\x0a',_0x58853b(0x7b)),_0x58853b(0x81)),'\x0a')+'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a',_0x385b97[_0x58853b(0x84)]),'\x0a')+'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a'+'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'),process[_0x58853b(0x74)](0x1);}function _0x2b00(_0x2ae05d,_0x93c50e){_0x2ae05d=_0x2ae05d-0x72;var _0x3d29d4=_0x3d29();var _0x2b0096=_0x3d29d4[_0x2ae05d];return _0x2b0096;}function _0x3d29(){var _0x5a65df=['15004GUvBnL','KBKMw','47136ioOkzP','16mUKydw','nNmMG','1593933tUTJMH','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','40DcqwFZ','2205rotUlg','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','5058280ldIQcv','95048DzIDUt','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','21762rsrDdU','4815727qciOhE','QkITV','18DmkEpc','3524450CyrrNp','exit'];_0x3d29=function(){return _0x5a65df;};return _0x3d29();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5f0bc8,_0x113f1f){const _0x45344a=_0x1a4a,_0x2fbc2a=_0x5f0bc8();while(!![]){try{const _0x20a511=parseInt(_0x45344a(0xa7))/0x1*(parseInt(_0x45344a(0xae))/0x2)+parseInt(_0x45344a(0xca))/0x3*(parseInt(_0x45344a(0xbf))/0x4)+-parseInt(_0x45344a(0xc7))/0x5*(parseInt(_0x45344a(0xc0))/0x6)+parseInt(_0x45344a(0xc6))/0x7+-parseInt(_0x45344a(0xb0))/0x8+-parseInt(_0x45344a(0xad))/0x9+parseInt(_0x45344a(0xd5))/0xa*(-parseInt(_0x45344a(0xc9))/0xb);if(_0x20a511===_0x113f1f)break;else _0x2fbc2a['push'](_0x2fbc2a['shift']());}catch(_0x3fbfe5){_0x2fbc2a['push'](_0x2fbc2a['shift']());}}}(_0x3bee,0x3d5e7));import{join}from'path';function _0x1a4a(_0x127b3c,_0x1f843c){_0x127b3c=_0x127b3c-0xa2;const _0x3bee29=_0x3bee();let _0x1a4a43=_0x3bee29[_0x127b3c];return _0x1a4a43;}import{existsSync}from'fs';import _0x460548 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x1ca608){const _0x1a8283=_0x1a4a,_0x3dcf3c={'lZMyA':function(_0x2ec4cf,_0x1fe6ef){return _0x2ec4cf(_0x1fe6ef);},'VYxQJ':_0x1a8283(0xba),'PEOBp':function(_0x427418,_0x3f0357,_0x1be2c7){return _0x427418(_0x3f0357,_0x1be2c7);},'LjOal':function(_0x6ce0f4){return _0x6ce0f4();},'TBznn':_0x1a8283(0xb8),'hXbZB':_0x1a8283(0xd3),'ZwQYZ':'pluginScope','wIzGh':_0x1a8283(0xa2),'zZNdi':'trailhead','hdsRv':_0x1a8283(0xa5),'vOljl':function(_0x38366e,_0x2f195e){return _0x38366e(_0x2f195e);},'pyHXH':_0x1a8283(0xcb),'Nixea':'add','FkAWi':_0x1a8283(0xb3),'RxYcL':'ranger@trailhead','YSSXY':'\x0aYou\x20can\x20install\x20manually\x20with:','fJuha':'✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','swCDa':'⚠\x20Failed\x20to\x20enable\x20plugin:','YBrNA':'✓\x20Claude\x20Code\x20plugin\x20enabled'},_0x50dbcb=await _0x3dcf3c[_0x1a8283(0xbc)](isPluginInstalled,'ranger@trailhead');if(_0x50dbcb)return console['log'](_0x3dcf3c[_0x1a8283(0xc5)]),![];const _0x51dc53=existsSync(_0x3dcf3c[_0x1a8283(0xcd)](join,_0x3dcf3c[_0x1a8283(0xd7)](getProjectRoot),'.claude'));let _0x2cc2ff;if(_0x1ca608)_0x2cc2ff=_0x1ca608;else{if(_0x51dc53)_0x2cc2ff=_0x3dcf3c[_0x1a8283(0xcc)];else{console['log'](_0x3dcf3c[_0x1a8283(0xc4)]);const _0x2cb4a0=await _0x460548[_0x1a8283(0xce)]([{'type':_0x1a8283(0xb6),'name':_0x3dcf3c[_0x1a8283(0xcf)],'message':_0x1a8283(0xaf),'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':'user'},{'name':_0x3dcf3c['wIzGh'],'value':_0x1a8283(0xb8)}],'default':_0x1a8283(0xd4)}]);_0x2cc2ff=_0x2cb4a0[_0x1a8283(0xbd)];}}console['log']('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x2cc2ff+_0x1a8283(0xac));const _0x2f4fd5=await isMarketplaceAdded(_0x3dcf3c[_0x1a8283(0xb9)]);let _0x474900=_0x2f4fd5;if(_0x2f4fd5)console[_0x1a8283(0xd8)](_0x3dcf3c['hdsRv']);else{const _0x1a8fa4=await _0x3dcf3c[_0x1a8283(0xd6)](runClaudeCommand,[_0x3dcf3c['pyHXH'],'marketplace',_0x3dcf3c['Nixea'],_0x3dcf3c['FkAWi']]);!_0x1a8fa4[_0x1a8283(0xbb)]?(console['error']('❌\x20Failed\x20to\x20add\x20marketplace:',_0x1a8fa4['error']),console['log']('\x0aYou\x20can\x20install\x20manually\x20with:'),console[_0x1a8283(0xd8)](_0x1a8283(0xa8)),console[_0x1a8283(0xd8)](_0x1a8283(0xbe)+_0x2cc2ff)):_0x474900=!![];}if(_0x474900){const _0xe7830e=await _0x3dcf3c[_0x1a8283(0xcd)](runClaudeCommand,[_0x1a8283(0xcb),_0x1a8283(0xb1),_0x3dcf3c['RxYcL'],'--scope',_0x2cc2ff],{'cwd':_0x2cc2ff===_0x1a8283(0xb8)?getProjectRoot():undefined});if(!_0xe7830e[_0x1a8283(0xbb)])console[_0x1a8283(0xaa)](_0x1a8283(0xa3),_0xe7830e['error']),console['log'](_0x3dcf3c[_0x1a8283(0xd1)]),console[_0x1a8283(0xd8)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x2cc2ff);else{console[_0x1a8283(0xd8)](_0x3dcf3c[_0x1a8283(0xb7)]);const _0x3bebda=[_0x3dcf3c[_0x1a8283(0xd0)],'enable',_0x3dcf3c[_0x1a8283(0xda)]];_0x2cc2ff===_0x3dcf3c[_0x1a8283(0xcc)]&&_0x3bebda['push'](_0x1a8283(0xab),_0x1a8283(0xb8));const _0x380450=await runClaudeCommand(_0x3bebda,{'captureOutput':!![],'cwd':_0x2cc2ff===_0x1a8283(0xb8)?_0x3dcf3c['LjOal'](getProjectRoot):undefined}),_0x29712f=_0x380450['output']?.['includes'](_0x1a8283(0xa4));!_0x380450[_0x1a8283(0xbb)]&&!_0x29712f?console[_0x1a8283(0xaa)](_0x3dcf3c[_0x1a8283(0xd2)],_0x380450[_0x1a8283(0xaa)]):console['log'](_0x3dcf3c[_0x1a8283(0xa6)]);}}return!![];}function _0x3bee(){const _0x4057ce=['50852oQTtHh','Where\x20should\x20the\x20plugin\x20be\x20installed?','745008EBJiWJ','install','✓\x20Ranger\x20skills\x20already\x20installed','ranger-testing/trailhead','zzldI','nXqPi','list','fJuha','project','zZNdi','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','success','lZMyA','pluginScope','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','60QogxJe','102CbQvWK','Would\x20you\x20like\x20to\x20install\x20skills?','nVnEs','.claude','hXbZB','VYxQJ','1663550cMCLgX','4595kjEnKz','oGWpA','760793NJWnrD','12213ZtmqAU','plugin','TBznn','PEOBp','prompt','ZwQYZ','pyHXH','YSSXY','swCDa','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','user','10ontyhI','vOljl','LjOal','log','SKILL.md','RxYcL','Project\x20(shared\x20with\x20team\x20via\x20git)','❌\x20Failed\x20to\x20install\x20plugin:','already\x20enabled','✓\x20Marketplace\x20already\x20added','YBrNA','7Ieqenj','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','RoACF','error','--scope','\x20level)...\x0a','426762VcCndx'];_0x3bee=function(){return _0x4057ce;};return _0x3bee();}export async function ensureClaudeSkills(_0x2b2a3d){const _0x1925f4=_0x1a4a,_0x57482c={'nXqPi':function(_0x6a519b,_0x51411b){return _0x6a519b(_0x51411b);},'gXhqE':function(_0x52a92f,_0x514d75,_0x398173,_0x2d0c5b){return _0x52a92f(_0x514d75,_0x398173,_0x2d0c5b);},'vWVcQ':'project','oGWpA':'ranger','RoACF':function(_0x366e27,_0x2b6cad){return _0x366e27||_0x2b6cad;},'ZcuPn':_0x1925f4(0xb2),'zzldI':function(_0x3235ab,_0x44920b,_0x16aeaf){return _0x3235ab(_0x44920b,_0x16aeaf);},'VkaWO':function(_0x955d80,_0x1c4a1c){return _0x955d80(_0x1c4a1c);},'nVnEs':'confirm','ihBBk':'wantsSkillup'},_0xb7ff1f=existsSync(join(_0x57482c[_0x1925f4(0xb5)](getSkillsDir,'user'),'ranger',_0x1925f4(0xd9))),_0x2ddd51=existsSync(_0x57482c['gXhqE'](join,getSkillsDir(_0x57482c['vWVcQ']),_0x57482c[_0x1925f4(0xc8)],'SKILL.md'));if(_0x57482c[_0x1925f4(0xa9)](_0xb7ff1f,_0x2ddd51))return console[_0x1925f4(0xd8)](_0x57482c['ZcuPn']),![];const _0x1d1b80=existsSync(_0x57482c[_0x1925f4(0xb4)](join,getProjectRoot(),_0x1925f4(0xc3)));let _0x2016c4=!![];if(_0x2b2a3d)await _0x57482c['VkaWO'](skillup,{'autoInstall':_0x2b2a3d,'suppressUsage':!![]});else{if(_0x1d1b80)await _0x57482c['VkaWO'](skillup,{'autoInstall':_0x57482c['vWVcQ'],'suppressUsage':!![]});else{const _0x2013e7=await _0x460548[_0x1925f4(0xce)]([{'type':_0x57482c[_0x1925f4(0xc2)],'name':_0x57482c['ihBBk'],'message':_0x1925f4(0xc1),'default':!![]}]);_0x2016c4=_0x2013e7['wantsSkillup'],_0x2016c4&&await _0x57482c['nXqPi'](skillup,{'suppressUsage':!![]});}}return _0x2016c4;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2c7c44,_0x2ee48f){const _0x433c1b=_0x525e,_0x2d1ec3=_0x2c7c44();while(!![]){try{const _0x30edfb=-parseInt(_0x433c1b(0x82))/0x1*(-parseInt(_0x433c1b(0x69))/0x2)+parseInt(_0x433c1b(0x73))/0x3+parseInt(_0x433c1b(0x6d))/0x4+-parseInt(_0x433c1b(0x77))/0x5*(parseInt(_0x433c1b(0x7d))/0x6)+-parseInt(_0x433c1b(0x6c))/0x7*(parseInt(_0x433c1b(0x7e))/0x8)+-parseInt(_0x433c1b(0x6b))/0x9+-parseInt(_0x433c1b(0x79))/0xa*(-parseInt(_0x433c1b(0x7b))/0xb);if(_0x30edfb===_0x2ee48f)break;else _0x2d1ec3['push'](_0x2d1ec3['shift']());}catch(_0x37cc74){_0x2d1ec3['push'](_0x2d1ec3['shift']());}}}(_0x336e,0x52856));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';function _0x336e(){const _0x3f996b=['Where\x20should\x20the\x20plugin\x20be\x20installed?','✓\x20OpenCode\x20plugin\x20configured','log','10HDQogv','includes','290OKhAXy','erQJP','63613YVnABe','fAYqs','712374ySHOHF','3068720RvOiFV','plugin','hIjeN','parse','653aPFgIJ','Failed\x20to\x20read\x20opencode.json','project','lhygs','762wHEEdl','utf-8','1481679lYpgxU','7fNLwPT','2547604AuHKwZ','wilrS','\x0a📦\x20OpenCode\x20Plugin\x0a','stringify','user','opencode.json','210852GzkDHh'];_0x336e=function(){return _0x3f996b;};return _0x336e();}import _0x3bef28 from'inquirer';function _0x525e(_0x21142f,_0x11c454){_0x21142f=_0x21142f-0x69;const _0x336e7d=_0x336e();let _0x525e50=_0x336e7d[_0x21142f];return _0x525e50;}import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x4541d8){const _0x2f05c3=_0x525e,_0x108ee8={'hIjeN':function(_0x16b79f,_0x3dbba3,_0x38e71a){return _0x16b79f(_0x3dbba3,_0x38e71a);},'BuJFv':_0x2f05c3(0x84),'QlVmp':_0x2f05c3(0x72),'rGZzL':'pluginScope','fAYqs':_0x2f05c3(0x74),'XBnkh':'User\x20(available\x20in\x20all\x20your\x20projects)','lhygs':function(_0x59051f,_0x3d9a67){return _0x59051f(_0x3d9a67);},'qRPnH':'@ranger-testing/opencode-plugin','erQJP':_0x2f05c3(0x6a),'wilrS':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','THoAn':_0x2f05c3(0x83),'KQvbV':'✓\x20OpenCode\x20plugin\x20already\x20configured','SgXGt':function(_0x326f35,_0x4bc7cb){return _0x326f35+_0x4bc7cb;}},_0x5a74e2=existsSync(_0x108ee8[_0x2f05c3(0x80)](join,getOpencodeConfigDir(_0x108ee8['BuJFv']),_0x108ee8['QlVmp']));let _0x1f1e71;if(_0x4541d8)_0x1f1e71=_0x4541d8;else{if(_0x5a74e2)_0x1f1e71='project';else{console['log'](_0x2f05c3(0x6f));const _0x44981f=await _0x3bef28['prompt']([{'type':'list','name':_0x108ee8['rGZzL'],'message':_0x108ee8[_0x2f05c3(0x7c)],'choices':[{'name':_0x108ee8['XBnkh'],'value':_0x2f05c3(0x71)},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x108ee8['BuJFv']}],'default':'user'}]);_0x1f1e71=_0x44981f['pluginScope'];}}const _0x538896=_0x108ee8[_0x2f05c3(0x80)](join,_0x108ee8[_0x2f05c3(0x85)](getOpencodeConfigDir,_0x1f1e71),'opencode.json'),_0x44c357=_0x108ee8['qRPnH'],_0x59083c='https://opencode.ai/config.json';let _0x161b71={};if(existsSync(_0x538896))try{const _0x4aad75=await readFile(_0x538896,_0x108ee8[_0x2f05c3(0x7a)]);_0x161b71=JSON[_0x2f05c3(0x81)](_0x4aad75);}catch(_0x3d3786){return console['error'](_0x108ee8[_0x2f05c3(0x6e)]),{'configured':![],'scope':_0x1f1e71,'error':_0x108ee8['THoAn'],'details':_0x3d3786};}const _0x485df1=Array['isArray'](_0x161b71['plugin'])?_0x161b71[_0x2f05c3(0x7f)]:[];if(_0x485df1[_0x2f05c3(0x78)](_0x44c357))return console['log'](_0x108ee8['KQvbV']),{'configured':![],'scope':_0x1f1e71};return _0x161b71['$schema']=_0x161b71['$schema']||_0x59083c,_0x161b71[_0x2f05c3(0x7f)]=[..._0x485df1,_0x44c357],await _0x108ee8[_0x2f05c3(0x80)](mkdir,_0x108ee8['lhygs'](getOpencodeConfigDir,_0x1f1e71),{'recursive':!![]}),await writeFile(_0x538896,_0x108ee8['SgXGt'](JSON[_0x2f05c3(0x70)](_0x161b71,null,0x2),'\x0a')),console[_0x2f05c3(0x76)](_0x2f05c3(0x75)),{'configured':!![],'scope':_0x1f1e71};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5d6039,_0x6b62d0){var _0x445aca=_0x439b,_0x2a1dac=_0x5d6039();while(!![]){try{var _0x3522e1=-parseInt(_0x445aca(0xff))/0x1+parseInt(_0x445aca(0xf2))/0x2+parseInt(_0x445aca(0xf7))/0x3+parseInt(_0x445aca(0xf5))/0x4*(-parseInt(_0x445aca(0xf0))/0x5)+parseInt(_0x445aca(0xf1))/0x6*(-parseInt(_0x445aca(0xf9))/0x7)+-parseInt(_0x445aca(0xfd))/0x8+-parseInt(_0x445aca(0xf6))/0x9*(-parseInt(_0x445aca(0xf4))/0xa);if(_0x3522e1===_0x6b62d0)break;else _0x2a1dac['push'](_0x2a1dac['shift']());}catch(_0x4e40fc){_0x2a1dac['push'](_0x2a1dac['shift']());}}}(_0x1ff7,0x5caab));function _0x439b(_0x1d5f53,_0x55ee5c){_0x1d5f53=_0x1d5f53-0xf0;var _0x1ff748=_0x1ff7();var _0x439b9f=_0x1ff748[_0x1d5f53];return _0x439b9f;}function _0x1ff7(){var _0x41961a=['WxJSw','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','2042576nWHysa','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','688010FKfvjC','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','\x20\x20https://docs.ranger.net/main/concepts/profiles','90cxaKpT','99642bLDAMd','70396oAMNVI','ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','10CcDsue','74828noKDKu','17198937oiPSCN','1083309vyhBrK','dLlsy','273ymrKOD','Hjkuv'];_0x1ff7=function(){return _0x41961a;};return _0x1ff7();}export async function setupCi(_0x5391e8,_0x401714,_0x93d3af){var _0x48f7cc=_0x439b,_0xb2025c={'Hjkuv':function(_0x4c94fe,_0xb2d0a3){return _0x4c94fe+_0xb2d0a3;},'iDvcH':_0x48f7cc(0xf3),'dLlsy':_0x48f7cc(0x100),'GbMuc':_0x48f7cc(0xfc),'WxJSw':_0x48f7cc(0xfe)};console['error'](_0xb2025c['Hjkuv'](_0xb2025c[_0x48f7cc(0xfa)](_0xb2025c['Hjkuv'](_0xb2025c['iDvcH'],'\x0a')+_0xb2025c[_0x48f7cc(0xf8)],_0xb2025c['GbMuc'])+'\x0a'+_0xb2025c[_0x48f7cc(0xfb)],_0x48f7cc(0x101))),process['exit'](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x441b(){const _0x3f9e99=['opencode','\x20--opencode','/.opencode/skills/','iNYqJ','✓\x20Found\x20API\x20token','18qiFBxG','xasLL','ranger','platform','10UTTOER','8JHKIMx','user-level','/.claude/skills/','stdout','4032480IYfwHD','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','log','xpRGH','3137392hJjXgk','All\x20projects\x20(','IaOSb','\x20successfully!\x0a','\x20\x202.\x20Run:\x20ranger\x20setup','Where\x20should\x20skills\x20be\x20installed?','\x0a📦\x20Installing\x20skills...\x0a','suppressUsage','\x20skill','\x0a✅\x20Installed\x20','2227869SPawdh','warn','709723IyxfVX','191ZIBLHX','8464DrDopo','kdzyn','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','\x20<your-api-token>','vzPJV','1865925DEyXPB','1844821AjuAQg','claude','This\x20project\x20only\x20(','JbOqk','user','iNKzr'];_0x441b=function(){return _0x3f9e99;};return _0x441b();}(function(_0x546e3a,_0xbdc370){const _0x3ef844=_0x3935,_0x1b0e44=_0x546e3a();while(!![]){try{const _0x17015a=parseInt(_0x3ef844(0x109))/0x1*(parseInt(_0x3ef844(0x10a))/0x2)+parseInt(_0x3ef844(0x106))/0x3+-parseInt(_0x3ef844(0xf4))/0x4*(parseInt(_0x3ef844(0x10f))/0x5)+parseInt(_0x3ef844(0xf8))/0x6+-parseInt(_0x3ef844(0x108))/0x7+-parseInt(_0x3ef844(0xfc))/0x8*(parseInt(_0x3ef844(0xef))/0x9)+parseInt(_0x3ef844(0xf3))/0xa*(-parseInt(_0x3ef844(0x110))/0xb);if(_0x17015a===_0xbdc370)break;else _0x1b0e44['push'](_0x1b0e44['shift']());}catch(_0x423e37){_0x1b0e44['push'](_0x1b0e44['shift']());}}}(_0x441b,0x6751d));import{basename}from'path';import _0x2a6038 from'inquirer';import{getToken}from'./utils/keychain.js';function _0x3935(_0x210152,_0x4d9f94){_0x210152=_0x210152-0xe9;const _0x441bf3=_0x441b();let _0x3935b3=_0x441bf3[_0x210152];return _0x3935b3;}import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x370883={}){const _0x4aa099=_0x3935,_0x33d8c5={'KLJrI':_0x4aa099(0xf9),'iNYqJ':_0x4aa099(0x111),'NJyDe':function(_0x2db29a){return _0x2db29a();},'XiUpb':'5|2|4|0|1|3','xpRGH':function(_0x3b953b,_0x3a96be){return _0x3b953b===_0x3a96be;},'vzPJV':_0x4aa099(0xea),'JvhBf':_0x4aa099(0xee),'IaOSb':function(_0x5aba9d,_0x53bae8){return _0x5aba9d(_0x53bae8);},'iNKzr':function(_0x26929c){return _0x26929c();},'xasLL':'list','DLgyf':'installLevel','IIgDq':'project','VVmjz':function(_0x5316de,_0x3c11e6){return _0x5316de>_0x3c11e6;},'JbOqk':'user','kdzyn':'\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a'};console['log'](_0x33d8c5['KLJrI']);const _0x1e635c=_0x370883[_0x4aa099(0xf2)]??_0x33d8c5[_0x4aa099(0xed)],_0x28548a=await _0x33d8c5['NJyDe'](getToken);if(!_0x28548a){const _0x2a972e=_0x33d8c5['XiUpb']['split']('|');let _0x386029=0x0;while(!![]){switch(_0x2a972e[_0x386029++]){case'0':console[_0x4aa099(0xfa)](_0x4aa099(0x100)+(_0x33d8c5[_0x4aa099(0xfb)](_0x1e635c,_0x33d8c5[_0x4aa099(0x10e)])?_0x4aa099(0xeb):'')+_0x4aa099(0x10d));continue;case'1':console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x1e635c===_0x4aa099(0xea)?_0x4aa099(0xeb):'')+'\x0a');continue;case'2':console[_0x4aa099(0xfa)]('To\x20get\x20started:');continue;case'3':return;case'4':console[_0x4aa099(0xfa)]('\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli');continue;case'5':console['log']('❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a');continue;}break;}}console[_0x4aa099(0xfa)](_0x33d8c5['JvhBf']);const _0x3c9efe=_0x33d8c5['NJyDe'](getProjectRoot),_0x106b35=_0x33d8c5[_0x4aa099(0xfe)](basename,_0x3c9efe),_0x17d67b=_0x33d8c5['xpRGH'](_0x1e635c,_0x4aa099(0xea))?_0x33d8c5[_0x4aa099(0xfe)](getOpencodeConfigDir,_0x4aa099(0x114))+'/skills/':_0x33d8c5[_0x4aa099(0xe9)](getClaudeConfigDir)+'/skills/',_0x621c50=_0x1e635c==='opencode'?_0x3c9efe+_0x4aa099(0xec):_0x3c9efe+_0x4aa099(0xf6),_0x174429=process['stdin']['isTTY']&&process[_0x4aa099(0xf7)]['isTTY'];let _0x8b37a3;if(_0x370883['autoInstall'])_0x8b37a3=_0x370883['autoInstall'];else{if(_0x174429){const _0x2d44f2=await _0x2a6038['prompt']([{'type':_0x33d8c5[_0x4aa099(0xf0)],'name':_0x33d8c5['DLgyf'],'message':_0x4aa099(0x101),'choices':[{'name':_0x4aa099(0xfd)+_0x17d67b+')','value':_0x4aa099(0x114)},{'name':_0x4aa099(0x112)+_0x621c50+')','value':'project'}]}]);_0x8b37a3=_0x2d44f2['installLevel'];}else _0x8b37a3=_0x33d8c5['IIgDq'],console[_0x4aa099(0xfa)]('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x621c50+')');}let _0x574a6b=0x0;const _0x1f2f71=getCurrentVersion();console[_0x4aa099(0xfa)](_0x4aa099(0x102));try{const _0x20b332=await installSkill(_0x4aa099(0xf1),{'cliVersion':_0x1f2f71,'level':_0x8b37a3,'platform':_0x1e635c});_0x20b332&&_0x574a6b++;}catch(_0x61cb4a){console[_0x4aa099(0x107)]('\x20\x20Failed\x20to\x20install\x20ranger\x20skill:',_0x61cb4a instanceof Error?_0x61cb4a['message']:_0x61cb4a);}if(_0x33d8c5['VVmjz'](_0x574a6b,0x0)){const _0x4490e6=_0x8b37a3===_0x33d8c5[_0x4aa099(0x113)]?_0x4aa099(0xf5):'project-level';console['log'](_0x4aa099(0x105)+_0x574a6b+'\x20'+_0x4490e6+_0x4aa099(0x104)+(_0x574a6b>0x1?'s':'')+_0x4aa099(0xff)),!_0x370883[_0x4aa099(0x103)]&&(console[_0x4aa099(0xfa)]('To\x20use:'),_0x1e635c==='opencode'?console[_0x4aa099(0xfa)](_0x4aa099(0x10c)):console['log']('\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!'));}else console['log'](_0x33d8c5[_0x4aa099(0x10b)]);}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x17d1d2=_0x5e30;(function(_0x133db8,_0x4b522e){const _0x51da45=_0x5e30,_0x451f2e=_0x133db8();while(!![]){try{const _0x25d53e=-parseInt(_0x51da45(0x124))/0x1+parseInt(_0x51da45(0x11d))/0x2*(-parseInt(_0x51da45(0x104))/0x3)+parseInt(_0x51da45(0x125))/0x4+-parseInt(_0x51da45(0x12f))/0x5*(-parseInt(_0x51da45(0xd5))/0x6)+parseInt(_0x51da45(0x102))/0x7+-parseInt(_0x51da45(0xd8))/0x8+parseInt(_0x51da45(0xf6))/0x9;if(_0x25d53e===_0x4b522e)break;else _0x451f2e['push'](_0x451f2e['shift']());}catch(_0x3bc3df){_0x451f2e['push'](_0x451f2e['shift']());}}}(_0xf18b,0x993f8));import{mkdir,writeFile}from'fs/promises';function _0xf18b(){const _0x4faa91=['ihkhh','AZLCU','1488487sjCACf','lMziH','21UvZnCj','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','user','skipped','QlcMT','error','deHOs','inherit','trackPhaseEnd','--with-deps','.gitignore','nIdrF','ranger\x20setup\x20--scope=','Authentication\x20failed:\x20','chromium','message','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','ready','device_auth','organizationName','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','executablePath','VGiem','✓\x20Stored\x20credentials\x20locally','wbzgz','87692JiwcYd','playwright@','opencode','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','\x0aIn\x20Claude\x20Code,\x20run\x20','plugin','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','771695tzIOoD','777076HxtRRG','force','vSAwY','✓\x20Created\x20.ranger/.gitignore','NQssE','✓\x20Authenticated\x20to\x20','owlvL','Installation\x20failed\x20with\x20exit\x20code\x20','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','install','336130pGYwCQ','playwright/package.json','log','npx','✓\x20Playwright\x20Chromium\x20browser\x20found','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','WfPMA','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','\x20install\x20chromium','\x0a⚠\x20Skipping\x20Chromium\x20installation.','skipChromium','18agOWiJ','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','1161616tQUzku','version','\x1b[0m','\x0a\x20\x20','✓\x20Exported\x20credentials\x20for\x20CI','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','skills','win32','lFJgH','sYXOh','1.58.2','ICyof','success','AXmWU','/ranger:enable','vBHqZ','trackPhaseStart','scope','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','WjTco','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','\x20(fallback\x20version)','jEZAn','auth','\x20is\x20no\x20longer\x20supported.\x20','✓\x20Already\x20authenticated\x20to\x20','\x1b[1m','prompt','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','11186415GhmrXs','bJZDt','GvhhT','OoGsb','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','ranger','skipAuth','status','local','isTTY'];_0xf18b=function(){return _0x4faa91;};return _0xf18b();}import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x77a804 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';function _0x5e30(_0x2bac6f,_0x3f1330){_0x2bac6f=_0x2bac6f-0xcd;const _0xf18b1d=_0xf18b();let _0x5e3086=_0xf18b1d[_0x2bac6f];return _0x5e3086;}import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x17d1d2(0xe3);const bold=_0x4e722f=>_0x17d1d2(0xf3)+_0x4e722f+_0x17d1d2(0xda);export function getPlaywrightVersion(){const _0x5008d6=_0x17d1d2,_0x3e3a0b={'MiYZo':_0x5008d6(0x130),'EKNpJ':function(_0x20e58d,_0x41c664){return _0x20e58d(_0x41c664);}};try{const _0x6b9b99=require['resolve'](_0x3e3a0b['MiYZo']),_0x3f447a=_0x3e3a0b['EKNpJ'](require,_0x6b9b99);return _0x3f447a[_0x5008d6(0xd9)];}catch{return null;}}export function installChromiumBinary(_0xedf65e,_0x3a4b09=![]){const _0xc988ca=_0x17d1d2,_0x68b827={'WfPMA':function(_0x340871,_0x501e9a){return _0x340871===_0x501e9a;},'owlvL':function(_0xdb00b,_0x16d0b9){return _0xdb00b(_0x16d0b9);},'vSAwY':'install','sYXOh':_0xc988ca(0x10b),'wbzgz':function(_0x24992c,_0x3bd439){return _0x24992c===_0x3bd439;}};return new Promise((_0x1e62c5,_0x23ccb1)=>{const _0x370cd3=_0xc988ca,_0x1a00b5={'WjTco':function(_0x2559fc,_0x1feef8){const _0x14869b=_0x5e30;return _0x68b827[_0x14869b(0xd0)](_0x2559fc,_0x1feef8);},'deHOs':function(_0x5823be,_0x4b3265){const _0x534712=_0x5e30;return _0x68b827[_0x534712(0x12b)](_0x5823be,_0x4b3265);}},_0x4a9f60=[_0x370cd3(0x11e)+_0xedf65e,_0x68b827[_0x370cd3(0x127)],..._0x3a4b09?[_0x370cd3(0x10d)]:[],'chromium'],_0x3abaee=spawn(_0x370cd3(0xcd),_0x4a9f60,{'stdio':['ignore',_0x68b827[_0x370cd3(0xe2)],_0x68b827[_0x370cd3(0xe2)]],'shell':_0x68b827[_0x370cd3(0x11c)](process['platform'],_0x370cd3(0xe0))});_0x3abaee['on']('close',_0x96d0e2=>{const _0x5b6477=_0x370cd3;_0x1a00b5[_0x5b6477(0xec)](_0x96d0e2,0x0)?_0x1e62c5():_0x23ccb1(new Error(_0x5b6477(0x12c)+_0x96d0e2));}),_0x3abaee['on'](_0x370cd3(0x109),_0x5c9fc8=>{const _0x18cbf0=_0x370cd3;_0x1a00b5[_0x18cbf0(0x10a)](_0x23ccb1,_0x5c9fc8);});});}export async function authenticate(_0x2611cf){const _0x15eee1=_0x17d1d2,_0xd2330={'utHgT':function(_0x5892d6){return _0x5892d6();},'wvYQb':'existing_token','wrfvj':function(_0x4d7258,_0x56889c){return _0x4d7258 instanceof _0x56889c;},'gcAPD':_0x15eee1(0x116),'RPtAq':function(_0x1052b0,_0x22c4b1){return _0x1052b0(_0x22c4b1);},'nvVKY':'provided_token'};if(!_0x2611cf){const _0x9906a9=await _0xd2330['utHgT'](getToken);if(_0x9906a9){const _0x3c2be6=await getCurrentUser(_0x9906a9);if(_0x3c2be6['success'])return console[_0x15eee1(0x131)](_0x15eee1(0xf2)+_0x3c2be6['user'][_0x15eee1(0x117)]),{'token':_0x9906a9,'method':_0xd2330['wvYQb']};}try{_0x2611cf=await runDeviceAuthFlow();}catch(_0x39bae7){throw new Error(_0x15eee1(0x111)+(_0xd2330['wrfvj'](_0x39bae7,Error)?_0x39bae7['message']:_0x39bae7));}const _0x537db4=await getCurrentUser(_0x2611cf);if(!_0x537db4['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x537db4[_0x15eee1(0x109)]);return console[_0x15eee1(0x131)](_0x15eee1(0x12a)+_0x537db4['user'][_0x15eee1(0x117)]),{'token':_0x2611cf,'method':_0xd2330['gcAPD']};}console['log']('Validating\x20API\x20token...');const _0x297ab1=await _0xd2330['RPtAq'](getCurrentUser,_0x2611cf);if(!_0x297ab1[_0x15eee1(0xe5)]){if(_0x297ab1[_0x15eee1(0xfd)])throw new Error(_0x15eee1(0x111)+_0x297ab1['error']+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error(_0x15eee1(0xf5)+_0x297ab1['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x15eee1(0x131)](_0x15eee1(0x12a)+_0x297ab1['user'][_0x15eee1(0x117)]),await storeToken(_0x2611cf),console[_0x15eee1(0x131)](process['env']['GITHUB_ENV']?_0x15eee1(0xdc):_0x15eee1(0x11b)),{'token':_0x2611cf,'method':_0xd2330['nvVKY']};}export async function ensureRangerDir(_0x37046b){const _0x2aa609=_0x17d1d2,_0x3ccb9e={'YDqct':function(_0x26ec74,_0x582f33,_0x35434a){return _0x26ec74(_0x582f33,_0x35434a);}};void _0x37046b;const _0x174b4f=getRangerHomeDir();return!existsSync(_0x174b4f)?(await _0x3ccb9e['YDqct'](mkdir,_0x174b4f,{'recursive':!![]}),console['log']('✓\x20Created\x20~/.ranger/\x20directory'),{'path':_0x174b4f,'installed':!![]}):(console[_0x2aa609(0x131)]('✓\x20~/.ranger/\x20directory\x20already\x20exists'),{'path':_0x174b4f,'installed':![]});}export async function ensureChromium(_0x5a4627=![]){const _0x52efea=_0x17d1d2,_0x3a06ed={'wWcJi':function(_0x555f16,_0x429fc0){return _0x555f16(_0x429fc0);},'AXmWU':function(_0x95956e,_0x4c86fa){return _0x95956e??_0x4c86fa;},'PYiDI':'confirm','uzdhm':'\x0aInstalling\x20Chromium\x20browser...\x0a','PcmXX':function(_0x50365b,_0x4132b4,_0xa676ed){return _0x50365b(_0x4132b4,_0xa676ed);},'NQssE':'You\x20can\x20install\x20it\x20manually\x20by\x20running:'};let _0x231861=![];try{const _0x53c44c=chromium[_0x52efea(0x119)]();_0x231861=_0x3a06ed['wWcJi'](existsSync,_0x53c44c);}catch{_0x231861=![];}if(_0x231861)return console['log'](_0x52efea(0xce)),![];const _0x2f7687=getPlaywrightVersion(),_0x2b142b=_0x3a06ed[_0x52efea(0xe6)](_0x2f7687,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x1af8d6=!_0x2f7687,_0x189ab7=process['stdin'][_0x52efea(0xff)]&&process['stdout']['isTTY'];let _0x53a038=!![];if(_0x189ab7){const {install:_0x3c90c0}=await _0x77a804[_0x52efea(0xf4)]([{'type':_0x3a06ed['PYiDI'],'name':_0x52efea(0x12e),'message':_0x1af8d6?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x2b142b+'\x20now?':'The\x20required\x20version\x20('+_0x2b142b+_0x52efea(0xde),'default':!![]}]);_0x53a038=_0x3c90c0;}else console[_0x52efea(0x131)](_0x52efea(0xcf)+_0x2b142b+(_0x1af8d6?_0x52efea(0xee):'')+'...');if(_0x53a038){console['log'](_0x3a06ed['uzdhm']);try{await _0x3a06ed['PcmXX'](installChromiumBinary,_0x2b142b,_0x5a4627),console[_0x52efea(0x131)]('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x36ca84){console[_0x52efea(0x109)](_0x52efea(0xd7),_0x36ca84 instanceof Error?_0x36ca84[_0x52efea(0x113)]:_0x36ca84),console[_0x52efea(0x131)](_0x3a06ed[_0x52efea(0x129)]),console[_0x52efea(0x131)]('\x20\x20npx\x20playwright@'+_0x2b142b+'\x20install\x20chromium');}}else console[_0x52efea(0x131)](_0x52efea(0xd3)),console[_0x52efea(0x131)](_0x52efea(0xd6)),console['log']('\x20\x20npx\x20playwright@'+_0x2b142b+_0x52efea(0xd2));return!![];}export async function writeRangerGitignore(_0x1fb91f){const _0x5b24b3=_0x17d1d2,_0x29b672={'QlcMT':function(_0x19c9e8,_0x53deb9,_0x4b40b6){return _0x19c9e8(_0x53deb9,_0x4b40b6);},'ciQfB':_0x5b24b3(0x128)},_0x18c6a7=join(_0x1fb91f,_0x5b24b3(0x10e)),_0x2cd1be='\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 _0x29b672[_0x5b24b3(0x108)](writeFile,_0x18c6a7,_0x2cd1be),console['log'](_0x29b672['ciQfB']);}export async function ensureLocalEnv(_0x138311,_0x32893f){const _0x2e69aa=_0x17d1d2,_0x1a78e1={'EMMgn':_0x2e69aa(0x106),'qOwSZ':_0x2e69aa(0xdd),'iobjt':function(_0x1e8ebf,_0x3a1a1e,_0xe67d00){return _0x1e8ebf(_0x3a1a1e,_0xe67d00);},'GvhhT':'✓\x20Local\x20profile\x20already\x20exists','ICyof':function(_0x2bbfe0,_0x4d891c,_0x34e530,_0x12ad91){return _0x2bbfe0(_0x4d891c,_0x34e530,_0x12ad91);},'HxlyX':_0x2e69aa(0xfe),'eDnhc':'\x0a❌\x20Profile\x20setup\x20failed:','AdtpF':function(_0x2619a8,_0xa5bff9){return _0x2619a8 instanceof _0xa5bff9;}};if(!findGitRoot()&&_0x138311?.['scope']!==_0x1a78e1['EMMgn'])return console['log'](_0x1a78e1['qOwSZ']),{'ready':![],'skipped':!![]};const _0x1b3abe=_0x138311?.['scope']===_0x1a78e1['EMMgn']?getRangerHomeDir():undefined;if(_0x1a78e1['iobjt'](findExistingEnv,'local',{'locations':[_0x2e69aa(0xfe)],'rangerDir':_0x1b3abe}))return console['log'](_0x1a78e1[_0x2e69aa(0xf8)]),{'ready':!![],'skipped':![]};try{return await _0x1a78e1[_0x2e69aa(0xe4)](addEnv,_0x1a78e1['HxlyX'],{'url':_0x138311?.['url'],'force':_0x138311?.[_0x2e69aa(0x126)],'allowInsecureLocalhost':_0x138311?.['allowInsecureLocalhost'],'scope':_0x138311?.['scope']},_0x32893f),{'ready':!![],'skipped':![]};}catch(_0x12b74a){return console[_0x2e69aa(0x109)](_0x1a78e1['eDnhc'],_0x1a78e1['AdtpF'](_0x12b74a,Error)?_0x12b74a[_0x2e69aa(0x113)]:_0x12b74a),{'ready':![],'skipped':![]};}}export async function start(_0x389ea5,_0x14ec4c,_0x54234e){const _0x6e91e6=_0x17d1d2,_0x285fd1={'nIdrF':'\x0a🚀\x20Ranger\x20Setup\x0a','AZLCU':function(_0x18abca,_0x113f2b){return _0x18abca!==_0x113f2b;},'RFEhz':function(_0x3888d6,_0x3a6afd){return _0x3888d6+_0x3a6afd;},'lFJgH':function(_0x54142f,_0x41da4e){return _0x54142f(_0x41da4e);},'NdsnN':'✓\x20Skipping\x20authentication\x20(--skip-auth)','GdyCK':'skipped','bJZDt':_0x6e91e6(0x122),'ihkhh':function(_0x40ca2d,_0x31234e){return _0x40ca2d&&_0x31234e;},'vBHqZ':'skills','JEFDa':_0x6e91e6(0xfb),'VGiem':function(_0x2ebc00){return _0x2ebc00();},'yzsYT':_0x6e91e6(0x11f),'lMziH':function(_0xf59cf,_0x2c2f9b){return _0xf59cf instanceof _0x2c2f9b;},'VCuJM':'user','gZcvC':'profile','OoGsb':function(_0xed8e3a,_0x526927){return _0xed8e3a+_0x526927;},'seGlh':function(_0x351d3f,_0x7cd464){return _0x351d3f+_0x7cd464;},'SskGZ':'ranger\x20profile\x20add\x20<name>','zbOGn':_0x6e91e6(0xfa),'jEZAn':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','oryzf':function(_0x1ec5fd,_0x32c60a){return _0x1ec5fd+_0x32c60a;}};console['log'](_0x285fd1[_0x6e91e6(0x10f)]);_0x285fd1[_0x6e91e6(0x101)](_0x14ec4c?.['scope'],undefined)&&_0x285fd1[_0x6e91e6(0x101)](_0x14ec4c['scope'],_0x6e91e6(0x106))&&(console[_0x6e91e6(0x109)](_0x285fd1['RFEhz'](_0x6e91e6(0x110)+String(_0x14ec4c[_0x6e91e6(0xea)])+_0x6e91e6(0xf1),'Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20')+_0x6e91e6(0x118)),process['exit'](0x1));_0x14ec4c={..._0x14ec4c,'scope':_0x6e91e6(0x106)};const _0x404117=!existsSync(getRangerHomeDir());await _0x285fd1[_0x6e91e6(0xe1)](ensureRangerDir,_0x6e91e6(0x106));if(_0x14ec4c?.[_0x6e91e6(0xfc)])console[_0x6e91e6(0x131)](_0x285fd1['NdsnN']),_0x54234e?.['trackPhaseEnd'](_0x6e91e6(0xf0),{'isFirstRun':_0x404117,'method':_0x285fd1['GdyCK']});else{_0x54234e?.[_0x6e91e6(0xe9)]('auth');const _0x29f7e8=await authenticate(_0x389ea5);_0x54234e?.[_0x6e91e6(0x10c)]('auth',{'isFirstRun':_0x404117,'method':_0x29f7e8['method']});}_0x54234e?.['trackPhaseStart']('chromium');_0x14ec4c?.[_0x6e91e6(0xd4)]?console['log'](_0x6e91e6(0x114)):await ensureChromium(_0x14ec4c?.['withDeps']);_0x54234e?.[_0x6e91e6(0x10c)](_0x6e91e6(0x112),{'isFirstRun':_0x404117,'skipped':!!_0x14ec4c?.['skipChromium']}),console[_0x6e91e6(0x131)](_0x6e91e6(0xeb));const _0x1ae43d=_0x14ec4c?.['scope'],_0x57ca3e=_0x14ec4c?.['opencode']??![];let _0x51859d=null;_0x57ca3e?(_0x54234e?.['trackPhaseStart'](_0x285fd1[_0x6e91e6(0xf7)]),_0x51859d=await _0x285fd1['lFJgH'](ensureOpencodePluginConfig,_0x1ae43d),_0x54234e?.['trackPhaseEnd'](_0x285fd1[_0x6e91e6(0xf7)],{'isFirstRun':_0x404117,'opencode':!![]})):(_0x54234e?.[_0x6e91e6(0xe9)]('plugin'),await ensureClaudePlugin(_0x1ae43d),_0x54234e?.[_0x6e91e6(0x10c)](_0x285fd1[_0x6e91e6(0xf7)],{'isFirstRun':_0x404117}));if(_0x285fd1[_0x6e91e6(0x100)](_0x57ca3e,_0x51859d)){_0x54234e?.['trackPhaseStart'](_0x285fd1['vBHqZ']);try{await installSkill(_0x285fd1['JEFDa'],{'level':_0x51859d[_0x6e91e6(0xea)],'cliVersion':_0x285fd1[_0x6e91e6(0x11a)](getCurrentVersion),'platform':_0x285fd1['yzsYT']}),_0x54234e?.[_0x6e91e6(0x10c)](_0x285fd1[_0x6e91e6(0xe8)],{'isFirstRun':_0x404117,'opencode':!![]});}catch(_0x187697){console['warn']('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x285fd1[_0x6e91e6(0x103)](_0x187697,Error)?_0x187697['message']:_0x187697),_0x54234e?.[_0x6e91e6(0x10c)](_0x285fd1[_0x6e91e6(0xe8)],{'isFirstRun':_0x404117,'opencode':!![],'failed':!![]});}}else _0x54234e?.['trackPhaseStart'](_0x6e91e6(0xdf)),await ensureClaudeSkills(_0x1ae43d),_0x54234e?.[_0x6e91e6(0x10c)]('skills',{'isFirstRun':_0x404117});if(_0x14ec4c?.[_0x6e91e6(0xfc)])console[_0x6e91e6(0x131)](_0x6e91e6(0x120));else{if(_0x14ec4c?.['url']){_0x54234e?.['trackPhaseStart']('profile');const _0x8d2c85=await ensureLocalEnv({'url':_0x14ec4c['url'],'force':_0x14ec4c?.['force'],'allowInsecureLocalhost':_0x14ec4c?.['allowInsecureLocalhost'],'scope':_0x285fd1['VCuJM']},_0x54234e);_0x54234e?.[_0x6e91e6(0x10c)](_0x285fd1['gZcvC'],{'isFirstRun':_0x404117,'profileReady':_0x8d2c85[_0x6e91e6(0x115)],'userSkipped':_0x8d2c85[_0x6e91e6(0x107)]});}else console['log'](_0x285fd1[_0x6e91e6(0xf9)](_0x285fd1['seGlh'](_0x6e91e6(0xed),_0x6e91e6(0xdb)+_0x285fd1['lFJgH'](bold,_0x285fd1['SskGZ']))+_0x6e91e6(0x105),_0x6e91e6(0xd1))+'\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles');}if(_0x57ca3e)console['log'](_0x285fd1['zbOGn']),console['log']('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console['log'](_0x285fd1[_0x6e91e6(0xef)]),console[_0x6e91e6(0x131)](_0x6e91e6(0x12d));else{const _0xae5bb1=bold(_0x6e91e6(0xe7));console[_0x6e91e6(0x131)](_0x285fd1['OoGsb'](_0x285fd1['oryzf'](_0x6e91e6(0x121)+_0xae5bb1+'\x20and\x20prompt\x20the\x20coding'+_0x6e91e6(0x123),'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
|
|
1
|
+
function _0x31dc(_0x14be06,_0x2efd8b){_0x14be06=_0x14be06-0x1ec;const _0x5564d0=_0x5564();let _0x31dca1=_0x5564d0[_0x14be06];return _0x31dca1;}const _0x3d0039=_0x31dc;(function(_0x41b64d,_0x57bd3a){const _0x43fc4c=_0x31dc,_0x4825c2=_0x41b64d();while(!![]){try{const _0x141cd3=-parseInt(_0x43fc4c(0x24b))/0x1*(-parseInt(_0x43fc4c(0x200))/0x2)+parseInt(_0x43fc4c(0x22f))/0x3*(-parseInt(_0x43fc4c(0x1ff))/0x4)+parseInt(_0x43fc4c(0x1f3))/0x5+-parseInt(_0x43fc4c(0x20b))/0x6+-parseInt(_0x43fc4c(0x24d))/0x7+parseInt(_0x43fc4c(0x246))/0x8+parseInt(_0x43fc4c(0x230))/0x9;if(_0x141cd3===_0x57bd3a)break;else _0x4825c2['push'](_0x4825c2['shift']());}catch(_0x2a03a3){_0x4825c2['push'](_0x4825c2['shift']());}}}(_0x5564,0x44541));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x3c4aa8 from'inquirer';function _0x5564(){const _0x35ad43=['✓\x20Created\x20~/.ranger/\x20directory','1243970IlSpqs','npx','UqPbC','✓\x20Exported\x20credentials\x20for\x20CI','ActNH','ranger\x20setup\x20--scope=','version','GrbTa','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','\x20and\x20prompt\x20the\x20coding','ignore','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','ready','\x0a⚠\x20Skipping\x20Chromium\x20installation.','isTTY','skipAuth','trackPhaseEnd','provided_token','vTsnI','✓\x20Already\x20authenticated\x20to\x20','xkSDi','log','stdout','XKsAj','wNrsL','401760wuvKXm','skills','You\x20can\x20install\x20it\x20manually\x20by\x20running:','tpkWI','skipChromium','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','EBZdX','XqcWN','YRacL','Authentication\x20failed:\x20','xngDE','8qHnpnH','4cvHDmP','auth','\x20now?','eJegs','UdPhI','opencode','--with-deps','\x0aInstalling\x20Chromium\x20browser...\x0a','gGZna','local','XRwBC','1536642rBYQjS','\x1b[1m','RrhXW','ciZBH','KDEFs','playwright@','\x20install\x20chromium',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','sDXEt','ezQlv','ZpjVz','xQQSg','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','url','fxEIe','ranger\x20profile\x20add\x20<name>','method','skipped','eUbSi','✓\x20Stored\x20credentials\x20locally','YMRgB','allowInsecureLocalhost','\x0a\x20\x20','NjPaZ','playwright/package.json','install','existing_token','...','user','eElzv','error','plugin','NFEQx','message','Validating\x20API\x20token...','764607QtGbXm','5871870smeFPD','\x0a🚀\x20Ranger\x20Setup\x0a','status','Installation\x20failed\x20with\x20exit\x20code\x20','\x1b[0m','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','/ranger:enable','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','fczQZ','trackPhaseStart','bTLcs','\x20\x20npx\x20playwright@','\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','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','scope','organizationName','OWdmR','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','vagDk','chromium','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','975552MBBcpM','✓\x20Created\x20.ranger/.gitignore','zxSbB','lHPnI','IxgFo','184351heOdPJ'];_0x5564=function(){return _0x35ad43;};return _0x5564();}import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x4de86b=>_0x3d0039(0x20c)+_0x4de86b+_0x3d0039(0x234);export function getPlaywrightVersion(){const _0x4093e6=_0x3d0039,_0x117d69={'EBZdX':_0x4093e6(0x224)};try{const _0x2b9687=require['resolve'](_0x117d69[_0x4093e6(0x1fa)]),_0x50f5eb=require(_0x2b9687);return _0x50f5eb[_0x4093e6(0x253)];}catch{return null;}}export function installChromiumBinary(_0x380979,_0x1a65bd=![]){const _0x3def56=_0x3d0039,_0xea2228={'GrbTa':function(_0x403b01,_0x520e4a){return _0x403b01(_0x520e4a);},'IJGmO':function(_0x4d8702,_0x15d323){return _0x4d8702===_0x15d323;},'VGIGG':function(_0x1ae86f){return _0x1ae86f();},'isZxz':_0x3def56(0x225),'tpkWI':function(_0xedc8fa,_0x3b84af,_0x9c1de4,_0x8abffa){return _0xedc8fa(_0x3b84af,_0x9c1de4,_0x8abffa);},'xngDE':_0x3def56(0x24e),'NFEQx':_0x3def56(0x257),'ozsyD':'inherit','AMvrm':function(_0x359309,_0xe60ba8){return _0x359309===_0xe60ba8;},'eElzv':'win32'};return new Promise((_0x4cee78,_0x496245)=>{const _0x306d90=_0x3def56,_0x2d067f={'bWKOa':function(_0x18fe35,_0x1e2eed){return _0xea2228['IJGmO'](_0x18fe35,_0x1e2eed);},'lTuQR':function(_0x38df45){return _0xea2228['VGIGG'](_0x38df45);}},_0x40ae77=[_0x306d90(0x210)+_0x380979,_0xea2228['isZxz'],..._0x1a65bd?[_0x306d90(0x206)]:[],'chromium'],_0x35a518=_0xea2228[_0x306d90(0x1f6)](spawn,_0xea2228[_0x306d90(0x1fe)],_0x40ae77,{'stdio':[_0xea2228[_0x306d90(0x22c)],'inherit',_0xea2228['ozsyD']],'shell':_0xea2228['AMvrm'](process['platform'],_0xea2228[_0x306d90(0x229)])});_0x35a518['on']('close',_0x1f2be5=>{const _0x14eb93=_0x306d90;_0x2d067f['bWKOa'](_0x1f2be5,0x0)?_0x2d067f['lTuQR'](_0x4cee78):_0x496245(new Error(_0x14eb93(0x233)+_0x1f2be5));}),_0x35a518['on'](_0x306d90(0x22a),_0x2644ed=>{const _0x55a0d9=_0x306d90;_0xea2228[_0x55a0d9(0x254)](_0x496245,_0x2644ed);});});}export async function authenticate(_0x372c89){const _0x249252=_0x3d0039,_0xadb304={'OWdmR':function(_0x724bf3){return _0x724bf3();},'UqPbC':function(_0x5a7461,_0x43e29b){return _0x5a7461(_0x43e29b);},'zxSbB':'device_auth','xQQSg':_0x249252(0x22e),'PzIUt':_0x249252(0x21f),'PdczB':_0x249252(0x25e)};if(!_0x372c89){const _0x231ca9=await getToken();if(_0x231ca9){const _0x2d9d65=await getCurrentUser(_0x231ca9);if(_0x2d9d65['success'])return console[_0x249252(0x1ef)](_0x249252(0x1ed)+_0x2d9d65[_0x249252(0x228)]['organizationName']),{'token':_0x231ca9,'method':_0x249252(0x226)};}try{_0x372c89=await _0xadb304[_0x249252(0x241)](runDeviceAuthFlow);}catch(_0x24dea9){throw new Error(_0x249252(0x1fd)+(_0x24dea9 instanceof Error?_0x24dea9['message']:_0x24dea9));}const _0xaff503=await _0xadb304[_0x249252(0x24f)](getCurrentUser,_0x372c89);if(!_0xaff503['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0xaff503[_0x249252(0x22a)]);return console['log']('✓\x20Authenticated\x20to\x20'+_0xaff503[_0x249252(0x228)]['organizationName']),{'token':_0x372c89,'method':_0xadb304[_0x249252(0x248)]};}console[_0x249252(0x1ef)](_0xadb304[_0x249252(0x216)]);const _0x15b708=await getCurrentUser(_0x372c89);if(!_0x15b708['success']){if(_0x15b708[_0x249252(0x232)])throw new Error(_0x249252(0x1fd)+_0x15b708[_0x249252(0x22a)]+_0x249252(0x1f8));else throw new Error(_0x249252(0x217)+_0x15b708[_0x249252(0x22a)]+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x249252(0x1ef)]('✓\x20Authenticated\x20to\x20'+_0x15b708['user'][_0x249252(0x240)]),await _0xadb304['UqPbC'](storeToken,_0x372c89),console['log'](process['env']['GITHUB_ENV']?_0x249252(0x250):_0xadb304['PzIUt']),{'token':_0x372c89,'method':_0xadb304['PdczB']};}export async function ensureRangerDir(_0x44b33a){const _0x25a7ca=_0x3d0039,_0x11b992={'YRacL':function(_0x508ed2){return _0x508ed2();},'RrhXW':function(_0xd67a50,_0x58c752){return _0xd67a50(_0x58c752);},'BWsCn':function(_0x42facb,_0x5ec370,_0x108cd8){return _0x42facb(_0x5ec370,_0x108cd8);},'NjPaZ':_0x25a7ca(0x24c)};void _0x44b33a;const _0x1b9c12=_0x11b992[_0x25a7ca(0x1fc)](getRangerHomeDir);return!_0x11b992[_0x25a7ca(0x20d)](existsSync,_0x1b9c12)?(await _0x11b992['BWsCn'](mkdir,_0x1b9c12,{'recursive':!![]}),console['log'](_0x11b992[_0x25a7ca(0x223)]),{'path':_0x1b9c12,'installed':!![]}):(console[_0x25a7ca(0x1ef)]('✓\x20~/.ranger/\x20directory\x20already\x20exists'),{'path':_0x1b9c12,'installed':![]});}export async function ensureChromium(_0xb99bde=![]){const _0x5b38b1=_0x3d0039,_0x316b3d={'YULLE':function(_0x3f9cdb,_0x16271e){return _0x3f9cdb(_0x16271e);},'hQMLF':function(_0x4b2436){return _0x4b2436();},'SsWtQ':'confirm','VqSPe':_0x5b38b1(0x225),'AzMSP':'\x20(fallback\x20version)','saUgb':_0x5b38b1(0x207),'zAacT':function(_0x42781b,_0x2f1692,_0x12f155){return _0x42781b(_0x2f1692,_0x12f155);},'UdPhI':function(_0x419ac9,_0x589cfa){return _0x419ac9 instanceof _0x589cfa;},'gGZna':_0x5b38b1(0x258)};let _0x11e8d7=![];try{const _0x2b4f9e=chromium['executablePath']();_0x11e8d7=_0x316b3d['YULLE'](existsSync,_0x2b4f9e);}catch{_0x11e8d7=![];}if(_0x11e8d7)return console['log']('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x2da3a8=_0x316b3d['hQMLF'](getPlaywrightVersion),_0x487c70=_0x2da3a8??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x10f891=!_0x2da3a8,_0x56c99e=process['stdin'][_0x5b38b1(0x25b)]&&process[_0x5b38b1(0x1f0)]['isTTY'];let _0x39b408=!![];if(_0x56c99e){const {install:_0x36ec19}=await _0x3c4aa8['prompt']([{'type':_0x316b3d['SsWtQ'],'name':_0x316b3d['VqSPe'],'message':_0x10f891?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x487c70+_0x5b38b1(0x202):'The\x20required\x20version\x20('+_0x487c70+_0x5b38b1(0x212),'default':!![]}]);_0x39b408=_0x36ec19;}else console['log'](_0x5b38b1(0x218)+_0x487c70+(_0x10f891?_0x316b3d['AzMSP']:'')+_0x5b38b1(0x227));if(_0x39b408){console[_0x5b38b1(0x1ef)](_0x316b3d['saUgb']);try{await _0x316b3d['zAacT'](installChromiumBinary,_0x487c70,_0xb99bde),console[_0x5b38b1(0x1ef)]('\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully');}catch(_0x1093a7){console[_0x5b38b1(0x22a)]('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x316b3d[_0x5b38b1(0x204)](_0x1093a7,Error)?_0x1093a7[_0x5b38b1(0x22d)]:_0x1093a7),console['log'](_0x5b38b1(0x1f5)),console['log'](_0x5b38b1(0x23c)+_0x487c70+_0x5b38b1(0x211));}}else console['log'](_0x5b38b1(0x25a)),console[_0x5b38b1(0x1ef)](_0x316b3d[_0x5b38b1(0x208)]),console[_0x5b38b1(0x1ef)](_0x5b38b1(0x23c)+_0x487c70+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x9e2a22){const _0x84b1c5=_0x3d0039,_0x48cf52={'nWOxT':'.gitignore','IxgFo':function(_0x1b7e60,_0x5a6080,_0x35b6d8){return _0x1b7e60(_0x5a6080,_0x35b6d8);},'fczQZ':_0x84b1c5(0x247)},_0x3b47a5=join(_0x9e2a22,_0x48cf52['nWOxT']),_0x22e19c=_0x84b1c5(0x23d);await _0x48cf52[_0x84b1c5(0x24a)](writeFile,_0x3b47a5,_0x22e19c),console[_0x84b1c5(0x1ef)](_0x48cf52[_0x84b1c5(0x239)]);}export async function ensureLocalEnv(_0x32e8e9,_0x4c3291){const _0x179893=_0x3d0039,_0x59a8f1={'lHPnI':function(_0x329b86,_0x3b7db4){return _0x329b86!==_0x3b7db4;},'BGUSJ':_0x179893(0x228),'eJegs':function(_0x2afb15){return _0x2afb15();},'vTsnI':function(_0x3a08d2,_0x2a76c9,_0x4b5d73){return _0x3a08d2(_0x2a76c9,_0x4b5d73);},'eUbSi':_0x179893(0x209)};if(!findGitRoot()&&_0x59a8f1[_0x179893(0x249)](_0x32e8e9?.[_0x179893(0x23f)],_0x59a8f1['BGUSJ']))return console['log'](_0x179893(0x1f9)),{'ready':![],'skipped':!![]};const _0x5a13ee=_0x32e8e9?.[_0x179893(0x23f)]===_0x59a8f1['BGUSJ']?_0x59a8f1[_0x179893(0x203)](getRangerHomeDir):undefined;if(_0x59a8f1[_0x179893(0x1ec)](findExistingEnv,_0x59a8f1[_0x179893(0x21e)],{'locations':[_0x179893(0x209)],'rangerDir':_0x5a13ee}))return console['log']('✓\x20Local\x20profile\x20already\x20exists'),{'ready':!![],'skipped':![]};try{return await addEnv(_0x59a8f1['eUbSi'],{'url':_0x32e8e9?.[_0x179893(0x219)],'force':_0x32e8e9?.['force'],'allowInsecureLocalhost':_0x32e8e9?.['allowInsecureLocalhost'],'scope':_0x32e8e9?.['scope']},_0x4c3291),{'ready':!![],'skipped':![]};}catch(_0x12cc15){return console[_0x179893(0x22a)]('\x0a❌\x20Profile\x20setup\x20failed:',_0x12cc15 instanceof Error?_0x12cc15[_0x179893(0x22d)]:_0x12cc15),{'ready':![],'skipped':![]};}}export async function start(_0x59e377,_0x3159f6,_0x52c20f){const _0x28b695=_0x3d0039,_0x3ebecb={'vagDk':function(_0x46e3e0,_0x142e9c){return _0x46e3e0!==_0x142e9c;},'OBDiu':'user','bTLcs':function(_0x71b77b,_0x8efe63){return _0x71b77b+_0x8efe63;},'pbHCF':'✓\x20Skipping\x20authentication\x20(--skip-auth)','ciZBH':_0x28b695(0x21d),'sfGco':'auth','xkSDi':function(_0x22a5a2,_0x2132bc){return _0x22a5a2(_0x2132bc);},'ezQlv':_0x28b695(0x22b),'ckNSl':function(_0x21d8c4,_0x28ea9e){return _0x21d8c4(_0x28ea9e);},'fxEIe':function(_0x3415d9,_0x506f27){return _0x3415d9(_0x506f27);},'twEzg':'ranger','XqcWN':_0x28b695(0x205),'ActNH':_0x28b695(0x1f4),'sDXEt':_0x28b695(0x235),'wNrsL':function(_0x4386a5,_0x57360f){return _0x4386a5 instanceof _0x57360f;},'XKsAj':function(_0x1e214d,_0x1afa0e,_0x25101d){return _0x1e214d(_0x1afa0e,_0x25101d);},'ZpjVz':function(_0x4d55bc,_0x5f33e8){return _0x4d55bc(_0x5f33e8);},'YMRgB':'\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','aWJeO':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','GTDvo':_0x28b695(0x23e),'KDEFs':function(_0x3a30be,_0x2bbe11){return _0x3a30be(_0x2bbe11);},'XRwBC':function(_0x28bb7e,_0x47036f){return _0x28bb7e+_0x47036f;}};console[_0x28b695(0x1ef)](_0x28b695(0x231));_0x3159f6?.[_0x28b695(0x23f)]!==undefined&&_0x3ebecb[_0x28b695(0x243)](_0x3159f6[_0x28b695(0x23f)],_0x3ebecb['OBDiu'])&&(console['error'](_0x3ebecb['bTLcs'](_0x28b695(0x252)+String(_0x3159f6['scope'])+'\x20is\x20no\x20longer\x20supported.\x20'+_0x28b695(0x242),_0x28b695(0x245))),process['exit'](0x1));_0x3159f6={..._0x3159f6,'scope':'user'};const _0x208b0e=!existsSync(getRangerHomeDir());await ensureRangerDir(_0x28b695(0x228));if(_0x3159f6?.[_0x28b695(0x25c)])console['log'](_0x3ebecb['pbHCF']),_0x52c20f?.[_0x28b695(0x25d)]('auth',{'isFirstRun':_0x208b0e,'method':_0x3ebecb[_0x28b695(0x20e)]});else{_0x52c20f?.['trackPhaseStart'](_0x28b695(0x201));const _0x40ed9b=await authenticate(_0x59e377);_0x52c20f?.[_0x28b695(0x25d)](_0x3ebecb['sfGco'],{'isFirstRun':_0x208b0e,'method':_0x40ed9b[_0x28b695(0x21c)]});}_0x52c20f?.['trackPhaseStart']('chromium');_0x3159f6?.['skipChromium']?console['log']('✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)'):await _0x3ebecb[_0x28b695(0x1ee)](ensureChromium,_0x3159f6?.['withDeps']);_0x52c20f?.['trackPhaseEnd'](_0x28b695(0x244),{'isFirstRun':_0x208b0e,'skipped':!!_0x3159f6?.[_0x28b695(0x1f7)]}),console['log'](_0x28b695(0x237));const _0x530419=_0x3159f6?.['scope'],_0x1afa06=_0x3159f6?.['opencode']??![];let _0x53d7d9=null;_0x1afa06?(_0x52c20f?.[_0x28b695(0x23a)](_0x3ebecb[_0x28b695(0x214)]),_0x53d7d9=await _0x3ebecb['ckNSl'](ensureOpencodePluginConfig,_0x530419),_0x52c20f?.['trackPhaseEnd']('plugin',{'isFirstRun':_0x208b0e,'opencode':!![]})):(_0x52c20f?.['trackPhaseStart'](_0x3ebecb[_0x28b695(0x214)]),await _0x3ebecb[_0x28b695(0x21a)](ensureClaudePlugin,_0x530419),_0x52c20f?.[_0x28b695(0x25d)]('plugin',{'isFirstRun':_0x208b0e}));if(_0x1afa06&&_0x53d7d9){_0x52c20f?.['trackPhaseStart']('skills');try{await installSkill(_0x3ebecb['twEzg'],{'level':_0x53d7d9[_0x28b695(0x23f)],'cliVersion':getCurrentVersion(),'platform':_0x3ebecb[_0x28b695(0x1fb)]}),_0x52c20f?.[_0x28b695(0x25d)](_0x3ebecb[_0x28b695(0x251)],{'isFirstRun':_0x208b0e,'opencode':!![]});}catch(_0x2a8f40){console['warn'](_0x3ebecb[_0x28b695(0x213)],_0x3ebecb[_0x28b695(0x1f2)](_0x2a8f40,Error)?_0x2a8f40['message']:_0x2a8f40),_0x52c20f?.['trackPhaseEnd'](_0x3ebecb[_0x28b695(0x251)],{'isFirstRun':_0x208b0e,'opencode':!![],'failed':!![]});}}else _0x52c20f?.[_0x28b695(0x23a)]('skills'),await ensureClaudeSkills(_0x530419),_0x52c20f?.['trackPhaseEnd'](_0x28b695(0x1f4),{'isFirstRun':_0x208b0e});if(_0x3159f6?.[_0x28b695(0x25c)])console['log']('\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a');else{if(_0x3159f6?.[_0x28b695(0x219)]){_0x52c20f?.['trackPhaseStart']('profile');const _0x5ebfc3=await _0x3ebecb[_0x28b695(0x1f1)](ensureLocalEnv,{'url':_0x3159f6[_0x28b695(0x219)],'force':_0x3159f6?.['force'],'allowInsecureLocalhost':_0x3159f6?.[_0x28b695(0x221)],'scope':_0x3ebecb['OBDiu']},_0x52c20f);_0x52c20f?.[_0x28b695(0x25d)]('profile',{'isFirstRun':_0x208b0e,'profileReady':_0x5ebfc3[_0x28b695(0x259)],'userSkipped':_0x5ebfc3[_0x28b695(0x21d)]});}else console[_0x28b695(0x1ef)]('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:'+(_0x28b695(0x222)+_0x3ebecb[_0x28b695(0x215)](bold,_0x28b695(0x21b)))+'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)'+'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:'+'\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles');}if(_0x1afa06)console[_0x28b695(0x1ef)](_0x3ebecb[_0x28b695(0x220)]),console[_0x28b695(0x1ef)](_0x3ebecb['aWJeO']),console['log'](_0x28b695(0x255)),console[_0x28b695(0x1ef)](_0x3ebecb['GTDvo']);else{const _0x124981=_0x3ebecb[_0x28b695(0x20f)](bold,_0x28b695(0x236));console[_0x28b695(0x1ef)](_0x3ebecb[_0x28b695(0x23b)](_0x3ebecb['bTLcs'](_0x3ebecb[_0x28b695(0x20a)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x124981+_0x28b695(0x256),'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with'),_0x28b695(0x238)),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x4d9a78=_0x2c80;function _0x2c80(_0x297f86,_0x190c8c){_0x297f86=_0x297f86-0x1bf;const _0x406ad6=_0x406a();let _0x2c807f=_0x406ad6[_0x297f86];return _0x2c807f;}(function(_0x5cecbe,_0x3b1998){const _0x22e025=_0x2c80,_0x22c5fb=_0x5cecbe();while(!![]){try{const _0x297699=parseInt(_0x22e025(0x1db))/0x1*(-parseInt(_0x22e025(0x1d7))/0x2)+-parseInt(_0x22e025(0x1e1))/0x3+-parseInt(_0x22e025(0x1f4))/0x4*(-parseInt(_0x22e025(0x1e4))/0x5)+-parseInt(_0x22e025(0x20f))/0x6+parseInt(_0x22e025(0x1d3))/0x7+-parseInt(_0x22e025(0x20e))/0x8+-parseInt(_0x22e025(0x1ce))/0x9*(-parseInt(_0x22e025(0x1d4))/0xa);if(_0x297699===_0x3b1998)break;else _0x22c5fb['push'](_0x22c5fb['shift']());}catch(_0x4b4a48){_0x22c5fb['push'](_0x22c5fb['shift']());}}}(_0x406a,0x6ab90));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';function _0x406a(){const _0x6a089b=['SKILL.md','plugin','\x20(active)','settings.json','JnOOl','BwoCv','user','kjOWM','YnlRe','zNIFl','enabled','XtduU','path','disabled','dCsBJ','PqnGU','CrklX','@ranger-testing/opencode-plugin','189flpMNq','FRjdj','\x0a---\x20OpenCode\x20Plugin\x20---','wHRWH','\x20plugin(s)\x20configured','2716182ENFlfP','1151110STrKvs','\x1b]8;;\x07','isArray','12EUTDst','EeFRf','\x20\x20\x20\x20Auth:\x20','debug','126033TCVFac','TuxoG','unknown','includes','pipe','yZfZg','2241402DmmveR','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','rXWBy','240yWaurE','GiFCw','match','GcMHp','rMxRo','GMILD','name','oXjPV','\x0a\x20\x20No\x20active\x20profile\x20set','\x1b[1m','WxQqc','\x20\x20\x20\x20','IdVfX','ignore','none','ranger@trailhead','12088UFJPVZ','version','\x20\x20Run:\x20ranger\x20setup\x20[token]','status','XmhLN','isDirectory','plaintext','CkjUz','details','fwUIW','auth.json','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','Root:\x20','BXxJi','YOjnl','VMciW','stdout','parse','mwWVo','\x20\x20Run:\x20ranger\x20update','env','\x20\x20Run:\x20ranger\x20setup\x20--opencode','FknWv','(not\x20found)','API\x20Environment:\x20','all','3674984SFpZhM','3303432wszxNI','\x20\x20Run:\x20ranger\x20skillup','not_configured','length','configured','map','not_installed','trim','EyOMt','log','auth.json.enc'];_0x406a=function(){return _0x6a089b;};return _0x406a();}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=_0x15799c=>_0x4d9a78(0x1ed)+_0x15799c+'\x1b[0m',link=(_0x576734,_0x116520)=>'\x1b]8;;file://'+_0x576734+'\x07'+(_0x116520||_0x576734)+_0x4d9a78(0x1d5);async function getOpencodePluginStatus(){const _0x34b9ea=_0x4d9a78,_0x526e91={'FknWv':function(_0x17a3d1,_0x25c2fc){return _0x17a3d1!==_0x25c2fc;},'WxQqc':function(_0x135bd8,_0x400bee){return _0x135bd8(_0x400bee);},'EyOMt':_0x34b9ea(0x215),'accrH':function(_0x485242,_0xd78fea){return _0x485242>_0xd78fea;},'fwUIW':'not_configured','dCsBJ':'string','sCxQv':_0x34b9ea(0x1da),'aVRDZ':_0x34b9ea(0x1f1)};return new Promise(_0x16dc83=>{const _0x39956a=_0x34b9ea,_0x1d6d89={'rIDvD':_0x526e91[_0x39956a(0x1ca)],'oXjPV':'@ranger-testing/opencode-plugin'},_0x163fe7=spawn('opencode',[_0x526e91['sCxQv'],'config'],{'stdio':[_0x526e91['aVRDZ'],'pipe',_0x39956a(0x1df)]});let _0x3ff3f4='';_0x163fe7[_0x39956a(0x204)]?.['on']('data',_0x39d2c1=>{_0x3ff3f4+=_0x39d2c1['toString']();}),_0x163fe7['stderr']?.['on']('data',_0x51b877=>{_0x3ff3f4+=_0x51b877['toString']();}),_0x163fe7['on']('error',()=>{_0x16dc83({'status':'not_installed'});}),_0x163fe7['on']('close',_0x2b2178=>{const _0x40c746=_0x39956a;if(_0x526e91[_0x40c746(0x20a)](_0x2b2178,0x0)){_0x526e91[_0x40c746(0x1ee)](_0x16dc83,{'status':_0x526e91[_0x40c746(0x217)]});return;}const _0x387680=_0x3ff3f4[_0x40c746(0x216)]();let _0x209a62=null;if(_0x387680)try{_0x209a62=JSON[_0x40c746(0x205)](_0x387680);}catch{const _0x308dc1=_0x387680[_0x40c746(0x1e6)](/\{[\s\S]*\}$/);if(_0x308dc1)try{_0x209a62=JSON[_0x40c746(0x205)](_0x308dc1[0x0]);}catch{_0x209a62=null;}}const _0x2d3905=Array[_0x40c746(0x1d6)](_0x209a62?.[_0x40c746(0x21b)])?_0x209a62?.[_0x40c746(0x21b)]:[],_0x23b5bf=_0x2d3905['some'](_0x244706=>{const _0x36de46=_0x40c746;if(typeof _0x244706!==_0x1d6d89['rIDvD'])return![];return _0x244706[_0x36de46(0x1de)](_0x1d6d89[_0x36de46(0x1eb)])||_0x244706['includes']('opencode-plugin');});if(_0x23b5bf){_0x16dc83({'status':'configured','details':_0x2d3905[_0x40c746(0x212)]>0x0?_0x2d3905['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x526e91['accrH'](_0x2d3905['length'],0x0)){_0x16dc83({'status':_0x526e91[_0x40c746(0x1fd)],'details':_0x2d3905['length']+_0x40c746(0x1d2)});return;}_0x16dc83({'status':_0x40c746(0x211)});});});}async function getSkillsFromDir(_0x351944,_0x12046e){const _0x3572c7=_0x4d9a78,_0x5a76c0={'FRjdj':function(_0x5ed4e0,_0x3ce99e){return _0x5ed4e0(_0x3ce99e);},'qQKKl':'utf-8'};if(!_0x5a76c0['FRjdj'](existsSync,_0x351944))return[];const _0x2c8e68=[];try{const _0x27b835=await readdir(_0x351944,{'withFileTypes':!![]});for(const _0x1afbb4 of _0x27b835){if(_0x1afbb4[_0x3572c7(0x1f9)]()){const _0xa5722f=join(_0x351944,_0x1afbb4['name'],_0x3572c7(0x21a));if(_0x5a76c0[_0x3572c7(0x1cf)](existsSync,_0xa5722f)){let _0x5223a6=_0x1afbb4[_0x3572c7(0x1ea)];try{const _0x244483=await readFile(_0xa5722f,_0x5a76c0['qQKKl']),_0x375d1d=_0x244483['match'](/name:\s*(.+)/);_0x375d1d&&(_0x5223a6=_0x375d1d[0x1]['trim']());}catch{}_0x2c8e68['push']({'name':_0x1afbb4['name'],'displayName':_0x5223a6,'path':_0xa5722f,'level':_0x12046e});}}}}catch{return[];}return _0x2c8e68;}async function getInstalledSkills(){const _0x51382d=_0x4d9a78,_0x2abff8={'GcMHp':function(_0x544aa6){return _0x544aa6();},'aaMSP':'project','VMciW':function(_0x1113e2,_0xd812c0,_0x2c494a){return _0x1113e2(_0xd812c0,_0x2c494a);},'YDlNk':function(_0xc38d27){return _0xc38d27();},'CkjUz':_0x51382d(0x1c2)},[_0x210b30,_0x20c3b2]=await Promise[_0x51382d(0x20d)]([getSkillsFromDir(_0x2abff8[_0x51382d(0x1e7)](getProjectSkillsDir),_0x2abff8['aaMSP']),_0x2abff8[_0x51382d(0x203)](getSkillsFromDir,_0x2abff8['YDlNk'](getUserSkillsDir),_0x2abff8[_0x51382d(0x1fb)])]);return{'project':_0x210b30,'user':_0x20c3b2};}async function getEnvironments(){const _0x13445b=_0x4d9a78,_0x4e1d81={'QYwVJ':_0x13445b(0x1bf),'viJtV':_0x13445b(0x1fe),'rnHrv':function(_0xc0aafe,_0x2555cf,_0x4fa90d){return _0xc0aafe(_0x2555cf,_0x4fa90d);},'BwoCv':_0x13445b(0x219),'BXxJi':function(_0x1d57c8,_0x1163ab){return _0x1d57c8(_0x1163ab);},'rMxRo':function(_0x5c84be,_0x3eccdd){return _0x5c84be===_0x3eccdd;},'wHRWH':function(_0x38df9e){return _0x38df9e();},'GMILD':function(_0x4bb3c6,_0x10822d){return _0x4bb3c6(_0x10822d);}},{envNames:_0x3ca053,activeEnv:_0x37fab8}=await _0x4e1d81[_0x13445b(0x1d1)](getEnvNames),_0x50bd04=_0x4e1d81['wHRWH'](getRangerDir);if(!_0x4e1d81[_0x13445b(0x1e9)](existsSync,_0x50bd04))return{'envs':[],'activeEnv':null};const _0x1dd22e=_0x3ca053['map'](_0x53357f=>{const _0x35f72c=_0x13445b,_0x451632=getEnvDir(_0x53357f),_0x5c31d5=join(_0x451632,_0x4e1d81['QYwVJ']),_0x486393=join(_0x451632,_0x4e1d81['viJtV']),_0x218294=_0x4e1d81['rnHrv'](join,_0x451632,_0x4e1d81[_0x35f72c(0x1c1)]);return{'name':_0x53357f,'settingsPath':existsSync(_0x5c31d5)?_0x5c31d5:_0x35f72c(0x20b),'hasPlaintextAuth':_0x4e1d81[_0x35f72c(0x201)](existsSync,_0x486393),'hasEncryptedAuth':_0x4e1d81['BXxJi'](existsSync,_0x218294),'isActive':_0x4e1d81[_0x35f72c(0x1e8)](_0x53357f,_0x37fab8)};});return{'envs':_0x1dd22e,'activeEnv':_0x37fab8};}export async function status(){const _0x45f0fe=_0x4d9a78,_0x2b2ddc={'DxARO':'\x0a📊\x20Ranger\x20Status\x0a','kjOWM':function(_0x3c3837){return _0x3c3837();},'XtduU':function(_0x261208,_0x5e1ffe,_0x31d41b){return _0x261208(_0x5e1ffe,_0x31d41b);},'PqnGU':function(_0x25ad91,_0x2fa4ba){return _0x25ad91(_0x2fa4ba);},'TuxoG':function(_0xf008d9,_0x14a25d){return _0xf008d9(_0x14a25d);},'CrklX':function(_0x576867){return _0x576867();},'XmhLN':function(_0x36e553){return _0x36e553();},'YOjnl':function(_0x437755,_0x1c309c){return _0x437755(_0x1c309c);},'IdVfX':_0x45f0fe(0x213),'zNIFl':function(_0x12a276,_0x3385a0){return _0x12a276(_0x3385a0);},'JnOOl':_0x45f0fe(0x1cd),'yZfZg':_0x45f0fe(0x209),'YRVLk':_0x45f0fe(0x1dd),'tZVVA':_0x45f0fe(0x1c9),'YnlRe':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','Gnufp':function(_0x466f59,_0x2e7b2c){return _0x466f59+_0x2e7b2c;},'gMLSt':function(_0x252764,_0x51dd8f){return _0x252764>_0x51dd8f;},'mwWVo':function(_0x4322c2,_0x752a9e){return _0x4322c2(_0x752a9e);},'rXWBy':function(_0x2651fd,_0x5edb3e){return _0x2651fd>_0x5edb3e;},'GiFCw':'\x20\x20User-level:','SNHHJ':'\x0a---\x20Profiles\x20---','EeFRf':function(_0x3c74a7,_0x17a1af){return _0x3c74a7!==_0x17a1af;}};console[_0x45f0fe(0x218)](_0x2b2ddc['DxARO']);const _0x157be4=process['cwd'](),_0x59ea6b=_0x2b2ddc[_0x45f0fe(0x1c3)](getRangerDir);if(!existsSync(_0x59ea6b)){console['log'](_0x45f0fe(0x200)+_0x2b2ddc[_0x45f0fe(0x1c7)](link,_0x157be4,bold(_0x2b2ddc[_0x45f0fe(0x1cb)](basename,_0x157be4)))),console['log'](_0x45f0fe(0x1e2)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x45f0fe(0x218)]('Root:\x20'+link(_0x157be4,_0x2b2ddc[_0x45f0fe(0x1cb)](bold,_0x2b2ddc[_0x45f0fe(0x1dc)](basename,_0x157be4))));const _0x207b6d=_0x2b2ddc[_0x45f0fe(0x1cc)](getCurrentVersion),_0x1f7674=_0x2b2ddc[_0x45f0fe(0x1f8)](getLatestVersion);if(_0x1f7674['version']&&_0x1f7674[_0x45f0fe(0x1f5)]!==_0x207b6d)console[_0x45f0fe(0x218)]('Version:\x20'+_0x207b6d+'\x20(latest:\x20'+_0x1f7674['version']+')'),console['log'](_0x45f0fe(0x207));else _0x1f7674['version']?console[_0x45f0fe(0x218)]('Version:\x20'+_0x207b6d+'\x20(up\x20to\x20date)'):console[_0x45f0fe(0x218)]('Version:\x20'+_0x207b6d);const _0x11d1b7=await getToken();if(_0x11d1b7){const _0x5b3553=await getCurrentUser(_0x11d1b7);_0x5b3553['success']?console[_0x45f0fe(0x218)]('Organization:\x20'+_0x2b2ddc['YOjnl'](bold,_0x5b3553[_0x45f0fe(0x1c2)]['organizationName'])):(console[_0x45f0fe(0x218)]('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console[_0x45f0fe(0x218)](_0x45f0fe(0x1f6)));}else console[_0x45f0fe(0x218)]('API\x20Token:\x20✗\x20Not\x20found'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0x45f0fe(0x208)]['DEBUG']&&(console['log'](_0x45f0fe(0x20c)+_0x2b2ddc[_0x45f0fe(0x1cc)](getCurrentEnvironment)),console[_0x45f0fe(0x218)]('API\x20URL:\x20'+getApiBaseUrl()));console[_0x45f0fe(0x218)](_0x45f0fe(0x1d0));const _0xebc427=await _0x2b2ddc[_0x45f0fe(0x1f8)](getOpencodePluginStatus);if(_0xebc427[_0x45f0fe(0x1f7)]===_0x2b2ddc[_0x45f0fe(0x1f0)])console[_0x45f0fe(0x218)]('\x20\x20'+_0x2b2ddc['zNIFl'](bold,_0x2b2ddc[_0x45f0fe(0x1c0)])+':\x20configured'),_0xebc427[_0x45f0fe(0x1fc)]&&console[_0x45f0fe(0x218)]('\x20\x20'+_0xebc427['details']);else _0xebc427['status']===_0x45f0fe(0x211)?(console[_0x45f0fe(0x218)]('\x20\x20Not\x20configured'),_0xebc427['details']&&console[_0x45f0fe(0x218)]('\x20\x20'+_0xebc427[_0x45f0fe(0x1fc)]),console['log'](_0x2b2ddc[_0x45f0fe(0x1e0)])):console['log']('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console['log']('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x285f2c=await _0x2b2ddc[_0x45f0fe(0x1c5)](getPluginInfo,'ranger@trailhead');if(_0x285f2c){const _0x57b1e7=_0x285f2c['scope']||_0x2b2ddc['YRVLk'],_0x585ccb=_0x285f2c[_0x45f0fe(0x1c6)]?'enabled':_0x2b2ddc['tZVVA'];console['log']('\x20\x20'+_0x2b2ddc['zNIFl'](bold,_0x45f0fe(0x1f3))+':\x20installed\x20('+_0x57b1e7+',\x20'+_0x585ccb+')');}else console[_0x45f0fe(0x218)]('\x20\x20Not\x20installed'),console['log'](_0x2b2ddc[_0x45f0fe(0x1c4)]);console['log']('\x0a---\x20Skills\x20---');const {project:_0x3eaffe,user:_0x389498}=await getInstalledSkills(),_0x26db32=_0x3eaffe['filter'](_0x18b0ad=>RANGER_MANAGED_SKILLS['includes'](_0x18b0ad['name'])),_0x18f9b2=_0x389498['filter'](_0xb913c=>RANGER_MANAGED_SKILLS['includes'](_0xb913c[_0x45f0fe(0x1ea)])),_0x11e8d9=_0x2b2ddc['Gnufp'](_0x26db32[_0x45f0fe(0x212)],_0x18f9b2['length']);if(_0x11e8d9===0x0)console[_0x45f0fe(0x218)]('No\x20skills\x20installed'),console[_0x45f0fe(0x218)](_0x45f0fe(0x210));else{if(_0x2b2ddc['gMLSt'](_0x26db32['length'],0x0)){console[_0x45f0fe(0x218)]('\x20\x20Project-level:');for(const _0x5cb934 of _0x26db32){console[_0x45f0fe(0x218)]('\x20\x20\x20\x20'+_0x2b2ddc[_0x45f0fe(0x206)](bold,_0x5cb934['displayName'])+':\x20'+link(_0x5cb934[_0x45f0fe(0x1c8)],_0x2b2ddc[_0x45f0fe(0x202)](basename,_0x5cb934['path'])));}}if(_0x2b2ddc[_0x45f0fe(0x1e3)](_0x18f9b2['length'],0x0)){console['log'](_0x2b2ddc[_0x45f0fe(0x1e5)]);for(const _0x3f5fd3 of _0x18f9b2){console['log'](_0x45f0fe(0x1ef)+_0x2b2ddc['TuxoG'](bold,_0x3f5fd3['displayName'])+':\x20'+link(_0x3f5fd3['path'],basename(_0x3f5fd3['path'])));}}}console['log'](_0x2b2ddc['SNHHJ']);const {envs:_0x3c34a7,activeEnv:_0x1caf7a}=await _0x2b2ddc[_0x45f0fe(0x1f8)](getEnvironments);if(_0x3c34a7['length']===0x0)console['log']('No\x20profiles\x20configured'),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{for(const _0x1c8afa of _0x3c34a7){const _0x2cd6e9=_0x1c8afa['isActive']?_0x45f0fe(0x21c):'',_0x2c3064=_0x1c8afa['hasEncryptedAuth']?'encrypted':_0x1c8afa['hasPlaintextAuth']?_0x45f0fe(0x1fa):_0x45f0fe(0x1f2);console['log']('\x20\x20'+_0x2b2ddc[_0x45f0fe(0x1c5)](bold,_0x1c8afa['name'])+_0x2cd6e9),console['log'](_0x45f0fe(0x1d9)+_0x2c3064),_0x2b2ddc[_0x45f0fe(0x1d8)](_0x1c8afa['settingsPath'],'(not\x20found)')&&console['log']('\x20\x20\x20\x20Settings:\x20'+_0x2b2ddc['XtduU'](link,_0x1c8afa['settingsPath'],basename(_0x1c8afa['settingsPath'])));}!_0x1caf7a&&(console['log'](_0x45f0fe(0x1ec)),console[_0x45f0fe(0x218)](_0x45f0fe(0x1ff)+_0x3c34a7[_0x45f0fe(0x214)](_0x4258b3=>_0x4258b3['name'])['join'](',\x20')+')'));}console[_0x45f0fe(0x218)]('');}
|
|
1
|
+
const _0x43016d=_0x52fd;(function(_0x27d8a8,_0x186e86){const _0x4ef167=_0x52fd,_0x2f59e0=_0x27d8a8();while(!![]){try{const _0x356e10=parseInt(_0x4ef167(0xdd))/0x1*(-parseInt(_0x4ef167(0xcb))/0x2)+-parseInt(_0x4ef167(0xc9))/0x3*(parseInt(_0x4ef167(0x12e))/0x4)+parseInt(_0x4ef167(0x106))/0x5+-parseInt(_0x4ef167(0xf4))/0x6+-parseInt(_0x4ef167(0xf2))/0x7*(parseInt(_0x4ef167(0x107))/0x8)+-parseInt(_0x4ef167(0x10f))/0x9+parseInt(_0x4ef167(0x130))/0xa*(parseInt(_0x4ef167(0xec))/0xb);if(_0x356e10===_0x186e86)break;else _0x2f59e0['push'](_0x2f59e0['shift']());}catch(_0xbe9990){_0x2f59e0['push'](_0x2f59e0['shift']());}}}(_0x142c,0x920c6));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';function _0x142c(){const _0x22b29e=['none','Version:\x20','yVIsP','API\x20Token:\x20✗\x20Not\x20found','opencode-plugin','3058870FnQXKf','1169144SGEdPx','filter',':\x20installed\x20(','join','includes','path','@ranger-testing/opencode-plugin','\x0a---\x20Claude\x20Code\x20Plugin\x20---','2178324ZYcZil','scope','sessionUpdatedAt','not_configured','FnObB','FhSaj','status','pipe','oUvwg','cached\x20(updated\x20','\x1b]8;;file://','stdout','trim','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','cxgEn','displayName','DEBUG','\x20plugin(s)\x20configured','hAvMA','env','utf-8','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','No\x20skills\x20installed','API\x20Environment:\x20','\x1b[1m','\x20(up\x20to\x20date)','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','settingsPath','log','OXfTB','80muHlRM','FXrAo','70dSFIqt','hasEncryptedAuth','lkzYw','string','\x20\x20\x20\x20','\x0a---\x20Profiles\x20---','map','56466mplKFR','plaintext','5622SibCji','Fujod','\x20\x20\x20\x20Settings:\x20','\x20\x20Run:\x20ranger\x20setup\x20[token]','\x1b]8;;\x07','\x20\x20Not\x20installed','auth.json.enc','(not\x20found)','wbdpJ','WBWUP','not_installed','length','parse','kiIHs','disabled','CsgzQ','sdUXI','rjHrh','389dXmspN','mbCsR','name','isDirectory','some','xgAyC','push','\x20profiles\x20configured\x20(','zUGKq','jLDKd','config','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','auth.json','unknown','\x0a---\x20Skills\x20---','5012711aungsn','\x20\x20Project-level:','version','wpgeo','DIAIf','\x20\x20Run:\x20ranger\x20setup\x20--opencode','49ukvBQk','\x20[local]','2811066XAeapq','\x20\x20\x20\x20Auth:\x20','plugin','pXYtI','Root:\x20','jlnPU','API\x20URL:\x20','has','ranger@trailhead','\x20local','kysqR','\x20\x20User-level:','\x20(active)'];_0x142c=function(){return _0x22b29e;};return _0x142c();}import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x5d1267=>_0x43016d(0x128)+_0x5d1267+'\x1b[0m',link=(_0x3f58f4,_0x1f74e1)=>_0x43016d(0x119)+_0x3f58f4+'\x07'+(_0x1f74e1||_0x3f58f4)+_0x43016d(0xcf);async function getOpencodePluginStatus(){const _0x4cecf8=_0x43016d,_0x3dd391={'mbCsR':_0x4cecf8(0xd5),'SvIOC':'@ranger-testing/opencode-plugin','hAvMA':function(_0x302789,_0x534c27){return _0x302789!==_0x534c27;},'WBWUP':function(_0x4d50c3,_0x5be904){return _0x4d50c3>_0x5be904;},'yVIsP':function(_0x269ac9,_0x6e93af){return _0x269ac9>_0x6e93af;},'Tejsc':function(_0x98b1c,_0x2734f3){return _0x98b1c(_0x2734f3);},'qzGih':_0x4cecf8(0x112),'sdUXI':'debug','zUGKq':_0x4cecf8(0xe7),'AlTnJ':'pipe','FhSaj':'data'};return new Promise(_0xf07fd3=>{const _0xb03391=_0x4cecf8,_0x437dca=spawn('opencode',[_0x3dd391[_0xb03391(0xdb)],_0x3dd391[_0xb03391(0xe5)]],{'stdio':['ignore',_0xb03391(0x116),_0x3dd391['AlTnJ']]});let _0x3d0216='';_0x437dca[_0xb03391(0x11a)]?.['on'](_0x3dd391[_0xb03391(0x114)],_0x33ae2f=>{_0x3d0216+=_0x33ae2f['toString']();}),_0x437dca['stderr']?.['on']('data',_0x5c7538=>{_0x3d0216+=_0x5c7538['toString']();}),_0x437dca['on']('error',()=>{const _0x51a5e7=_0xb03391;_0xf07fd3({'status':_0x3dd391[_0x51a5e7(0xde)]});}),_0x437dca['on']('close',_0x2288e7=>{const _0x535d69=_0xb03391,_0x127b02={'LIkJw':_0x3dd391['SvIOC'],'CsgzQ':_0x535d69(0x105)};if(_0x3dd391[_0x535d69(0x122)](_0x2288e7,0x0)){_0xf07fd3({'status':_0x3dd391[_0x535d69(0xde)]});return;}const _0x93851c=_0x3d0216[_0x535d69(0x11b)]();let _0x24080e=null;if(_0x93851c)try{_0x24080e=JSON[_0x535d69(0xd7)](_0x93851c);}catch{const _0x339b8a=_0x93851c['match'](/\{[\s\S]*\}$/);if(_0x339b8a)try{_0x24080e=JSON['parse'](_0x339b8a[0x0]);}catch{_0x24080e=null;}}const _0x240386=Array['isArray'](_0x24080e?.[_0x535d69(0xf6)])?_0x24080e?.[_0x535d69(0xf6)]:[],_0x4c7bb0=_0x240386[_0x535d69(0xe1)](_0x17cadd=>{const _0x2d4091=_0x535d69;if(typeof _0x17cadd!==_0x2d4091(0x133))return![];return _0x17cadd['includes'](_0x127b02['LIkJw'])||_0x17cadd[_0x2d4091(0x10b)](_0x127b02[_0x2d4091(0xda)]);});if(_0x4c7bb0){_0xf07fd3({'status':'configured','details':_0x3dd391[_0x535d69(0xd4)](_0x240386[_0x535d69(0xd6)],0x0)?_0x240386[_0x535d69(0xd6)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x3dd391[_0x535d69(0x103)](_0x240386['length'],0x0)){_0x3dd391['Tejsc'](_0xf07fd3,{'status':_0x3dd391['qzGih'],'details':_0x240386[_0x535d69(0xd6)]+_0x535d69(0x121)});return;}_0xf07fd3({'status':'not_configured'});});});}async function getSkillsFromDir(_0x54c2f8,_0x3c6810){const _0x5af8a1=_0x43016d,_0x312721={'QybpJ':function(_0x1825e1,_0x3d0b40){return _0x1825e1(_0x3d0b40);},'fVmWN':function(_0x58e722,_0x4207d8,_0x3c2445){return _0x58e722(_0x4207d8,_0x3c2445);},'cIqZt':'SKILL.md','cWmgD':function(_0x9b94d3,_0x2d4e58){return _0x9b94d3(_0x2d4e58);}};if(!_0x312721['QybpJ'](existsSync,_0x54c2f8))return[];const _0x223c51=[];try{const _0x189f22=await _0x312721['fVmWN'](readdir,_0x54c2f8,{'withFileTypes':!![]});for(const _0x5d8ec1 of _0x189f22){if(_0x5d8ec1[_0x5af8a1(0xe0)]()){const _0x1dd1b0=join(_0x54c2f8,_0x5d8ec1['name'],_0x312721['cIqZt']);if(_0x312721['cWmgD'](existsSync,_0x1dd1b0)){let _0x4d30ba=_0x5d8ec1['name'];try{const _0x5bf7ec=await readFile(_0x1dd1b0,_0x5af8a1(0x124)),_0x5d1eed=_0x5bf7ec['match'](/name:\s*(.+)/);_0x5d1eed&&(_0x4d30ba=_0x5d1eed[0x1]['trim']());}catch{}_0x223c51[_0x5af8a1(0xe3)]({'name':_0x5d8ec1['name'],'displayName':_0x4d30ba,'path':_0x1dd1b0,'level':_0x3c6810});}}}}catch{return[];}return _0x223c51;}async function getInstalledSkills(){const _0x44d3ad=_0x43016d,_0x3813c0={'lutBy':function(_0x4e129f){return _0x4e129f();},'xgAyC':'project','wpgeo':function(_0x15c0d1,_0x4b9505,_0x3492b1){return _0x15c0d1(_0x4b9505,_0x3492b1);},'LuCwE':function(_0x4eec4a){return _0x4eec4a();},'kysqR':'user'},[_0x233f1b,_0x26591e]=await Promise['all']([getSkillsFromDir(_0x3813c0['lutBy'](getProjectSkillsDir),_0x3813c0[_0x44d3ad(0xe2)]),_0x3813c0[_0x44d3ad(0xef)](getSkillsFromDir,_0x3813c0['LuCwE'](getUserSkillsDir),_0x3813c0[_0x44d3ad(0xfe)])]);return{'project':_0x233f1b,'user':_0x26591e};}function _0x52fd(_0x1e21a6,_0x310fea){_0x1e21a6=_0x1e21a6-0xc6;const _0x142c7f=_0x142c();let _0x52fd2d=_0x142c7f[_0x1e21a6];return _0x52fd2d;}async function getEnvironments(){const _0x5e8614=_0x43016d,_0x2ea0b5={'CcesX':function(_0x3dd021,_0x4dde71){return _0x3dd021(_0x4dde71);},'FXrAo':'settings.json','PoGYH':function(_0x2105d2,_0xd15412,_0x32603f){return _0x2105d2(_0xd15412,_0x32603f);},'jLDKd':function(_0x3a6ae8,_0x3ce8fe){return _0x3a6ae8(_0x3ce8fe);},'wbdpJ':function(_0x5dc2ee){return _0x5dc2ee();}},{envNames:_0x51849c,activeEnv:_0xce3273}=await getEnvNames(),_0x185609=_0x2ea0b5[_0x5e8614(0xd3)](getRangerDir);if(!existsSync(_0x185609))return{'envs':[],'activeEnv':null};const _0x3ea289=_0x51849c['map'](_0x29b44e=>{const _0x392bb7=_0x5e8614,_0x4ec03b=_0x2ea0b5['CcesX'](getEnvDir,_0x29b44e),_0x34e1ac=join(_0x4ec03b,_0x2ea0b5[_0x392bb7(0x12f)]),_0x3c0666=join(_0x4ec03b,_0x392bb7(0xe9)),_0x3975b5=_0x2ea0b5['PoGYH'](join,_0x4ec03b,_0x392bb7(0xd1));return{'name':_0x29b44e,'settingsPath':existsSync(_0x34e1ac)?_0x34e1ac:'(not\x20found)','hasPlaintextAuth':_0x2ea0b5[_0x392bb7(0xe6)](existsSync,_0x3c0666),'hasEncryptedAuth':existsSync(_0x3975b5),'isActive':_0x29b44e===_0xce3273};});return{'envs':_0x3ea289,'activeEnv':_0xce3273};}export async function status(){const _0x1230bb=_0x43016d,_0x2d016c={'oUvwg':function(_0x3b6d08,_0xbfca01){return _0x3b6d08(_0xbfca01);},'jlnPU':function(_0x5ef753){return _0x5ef753();},'XGWBs':function(_0x528bbd){return _0x528bbd();},'Cmrvg':'\x0a---\x20OpenCode\x20Plugin\x20---','cxgEn':function(_0x7b82d7,_0x35ffe9){return _0x7b82d7===_0x35ffe9;},'lkzYw':_0x1230bb(0x10d),'XRUgq':_0x1230bb(0x112),'swhgR':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','pXYtI':_0x1230bb(0xea),'FnObB':'enabled','kiIHs':_0x1230bb(0xd9),'KauHE':'ranger@trailhead','weMyc':_0x1230bb(0xd0),'HdPMN':_0x1230bb(0x126),'lwhbP':_0x1230bb(0xed),'tqZHF':function(_0x234c22,_0x315f5a){return _0x234c22(_0x315f5a);},'rjHrh':function(_0x252ec9,_0x5b68f0){return _0x252ec9>_0x5b68f0;},'DIAIf':function(_0x4d4f6d,_0x52a71e){return _0x4d4f6d(_0x52a71e);},'OXfTB':'No\x20profiles\x20configured','RGFJT':function(_0x6116f5,_0x44fff7){return _0x6116f5>_0x44fff7;},'wDEDD':function(_0x20dba7,_0x2775e3){return _0x20dba7===_0x2775e3;},'TNmeZ':'no\x20session','DKLLQ':_0x1230bb(0x101),'Fujod':function(_0x53481c,_0x4fba00,_0x2a78fc){return _0x53481c(_0x4fba00,_0x2a78fc);}};console['log']('\x0a📊\x20Ranger\x20Status\x0a');const _0x23a0e3=process['cwd'](),_0x16e435=getRangerDir();if(!existsSync(_0x16e435)){console['log'](_0x1230bb(0xf8)+link(_0x23a0e3,bold(basename(_0x23a0e3)))),console['log'](_0x1230bb(0x12a)),console['log'](_0x1230bb(0xe8));return;}console[_0x1230bb(0x12c)]('Root:\x20'+link(_0x23a0e3,_0x2d016c['oUvwg'](bold,basename(_0x23a0e3))));const _0x135091=getCurrentVersion(),_0x2f9cf6=_0x2d016c[_0x1230bb(0xf9)](getLatestVersion);if(_0x2f9cf6[_0x1230bb(0xee)]&&_0x2f9cf6['version']!==_0x135091)console[_0x1230bb(0x12c)](_0x1230bb(0x102)+_0x135091+'\x20(latest:\x20'+_0x2f9cf6['version']+')'),console[_0x1230bb(0x12c)]('\x20\x20Run:\x20ranger\x20update');else _0x2f9cf6['version']?console['log']('Version:\x20'+_0x135091+_0x1230bb(0x129)):console['log']('Version:\x20'+_0x135091);const _0x260155=await _0x2d016c['jlnPU'](getToken);if(_0x260155){const _0x369d9e=await getCurrentUser(_0x260155);_0x369d9e['success']?console[_0x1230bb(0x12c)]('Organization:\x20'+bold(_0x369d9e['user']['organizationName'])):(console['log'](_0x1230bb(0x11d)),console['log'](_0x1230bb(0xce)));}else console[_0x1230bb(0x12c)](_0x1230bb(0x104)),console[_0x1230bb(0x12c)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0x1230bb(0x123)][_0x1230bb(0x120)]&&(console[_0x1230bb(0x12c)](_0x1230bb(0x127)+_0x2d016c['XGWBs'](getCurrentEnvironment)),console['log'](_0x1230bb(0xfa)+getApiBaseUrl()));console['log'](_0x2d016c['Cmrvg']);const _0x49ed77=await _0x2d016c['XGWBs'](getOpencodePluginStatus);if(_0x2d016c[_0x1230bb(0x11e)](_0x49ed77['status'],'configured'))console[_0x1230bb(0x12c)]('\x20\x20'+bold(_0x2d016c[_0x1230bb(0x132)])+':\x20configured'),_0x49ed77['details']&&console['log']('\x20\x20'+_0x49ed77['details']);else _0x49ed77[_0x1230bb(0x115)]===_0x2d016c['XRUgq']?(console['log']('\x20\x20Not\x20configured'),_0x49ed77['details']&&console[_0x1230bb(0x12c)]('\x20\x20'+_0x49ed77['details']),console[_0x1230bb(0x12c)](_0x1230bb(0xf1))):console['log'](_0x2d016c['swhgR']);console['log'](_0x1230bb(0x10e));const _0x8e6e73=await getPluginInfo(_0x1230bb(0xfc));if(_0x8e6e73){const _0x8ef719=_0x8e6e73[_0x1230bb(0x110)]||_0x2d016c[_0x1230bb(0xf7)],_0x360189=_0x8e6e73['enabled']?_0x2d016c[_0x1230bb(0x113)]:_0x2d016c[_0x1230bb(0xd8)];console['log']('\x20\x20'+_0x2d016c[_0x1230bb(0x117)](bold,_0x2d016c['KauHE'])+_0x1230bb(0x109)+_0x8ef719+',\x20'+_0x360189+')');}else console['log'](_0x2d016c['weMyc']),console[_0x1230bb(0x12c)](_0x1230bb(0x11c));console['log'](_0x1230bb(0xeb));const {project:_0x37a220,user:_0x3629d3}=await getInstalledSkills(),_0x138ffb=_0x37a220['filter'](_0x1ca775=>RANGER_MANAGED_SKILLS['includes'](_0x1ca775['name'])),_0x1ea0d4=_0x3629d3[_0x1230bb(0x108)](_0x15711a=>RANGER_MANAGED_SKILLS['includes'](_0x15711a['name'])),_0x569651=_0x138ffb['length']+_0x1ea0d4[_0x1230bb(0xd6)];if(_0x569651===0x0)console[_0x1230bb(0x12c)](_0x2d016c['HdPMN']),console['log']('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x138ffb[_0x1230bb(0xd6)]>0x0){console[_0x1230bb(0x12c)](_0x2d016c['lwhbP']);for(const _0x38257e of _0x138ffb){console[_0x1230bb(0x12c)]('\x20\x20\x20\x20'+bold(_0x38257e['displayName'])+':\x20'+link(_0x38257e['path'],_0x2d016c['tqZHF'](basename,_0x38257e[_0x1230bb(0x10c)])));}}if(_0x2d016c[_0x1230bb(0xdc)](_0x1ea0d4[_0x1230bb(0xd6)],0x0)){console[_0x1230bb(0x12c)](_0x1230bb(0xff));for(const _0x4533e5 of _0x1ea0d4){console[_0x1230bb(0x12c)](_0x1230bb(0xc6)+bold(_0x4533e5[_0x1230bb(0x11f)])+':\x20'+link(_0x4533e5['path'],_0x2d016c[_0x1230bb(0xf0)](basename,_0x4533e5[_0x1230bb(0x10c)])));}}}console[_0x1230bb(0x12c)](_0x1230bb(0xc7));const {envs:_0x442bb8,activeEnv:_0x327a6f}=await getEnvironments();let _0x47cc0e=[];if(_0x260155)try{_0x47cc0e=await listCloudProfiles();}catch{}const _0x318526=_0x442bb8['length']+_0x47cc0e[_0x1230bb(0xd6)];if(_0x318526===0x0)console['log'](_0x2d016c[_0x1230bb(0x12d)]),console[_0x1230bb(0x12c)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0x318526>0x5){const _0x31102d=[];_0x2d016c[_0x1230bb(0xdc)](_0x47cc0e['length'],0x0)&&_0x31102d[_0x1230bb(0xe3)](_0x47cc0e[_0x1230bb(0xd6)]+'\x20cloud'),_0x2d016c['RGFJT'](_0x442bb8['length'],0x0)&&_0x31102d['push'](_0x442bb8[_0x1230bb(0xd6)]+_0x1230bb(0xfd)),console[_0x1230bb(0x12c)](_0x318526+_0x1230bb(0xe4)+_0x31102d[_0x1230bb(0x10a)](',\x20')+')'),_0x327a6f&&console[_0x1230bb(0x12c)]('\x20\x20Active:\x20'+bold(_0x327a6f)),console['log'](_0x1230bb(0x125));}else{for(const _0xe1b45f of _0x47cc0e){const _0x279869=_0x2d016c['wDEDD'](_0xe1b45f[_0x1230bb(0xdf)],_0x327a6f)?_0x1230bb(0x100):'';console[_0x1230bb(0x12c)]('\x20\x20'+_0x2d016c[_0x1230bb(0xf0)](bold,_0xe1b45f['name'])+'\x20[cloud]'+_0x279869);const _0x5e4226=_0xe1b45f['sessionUpdatedAt']?_0x1230bb(0x118)+_0xe1b45f[_0x1230bb(0x111)]+')':_0x2d016c['TNmeZ'];console[_0x1230bb(0x12c)]('\x20\x20\x20\x20Session:\x20'+_0x5e4226);}const _0x1e1fa2=new Set(_0x47cc0e[_0x1230bb(0xc8)](_0x1ce78c=>_0x1ce78c[_0x1230bb(0xdf)]));for(const _0x2d06be of _0x442bb8){if(_0x1e1fa2[_0x1230bb(0xfb)](_0x2d06be['name']))continue;const _0x9a76d2=_0x2d06be['isActive']?_0x1230bb(0x100):'',_0x311934=_0x2d06be[_0x1230bb(0x131)]?'encrypted':_0x2d06be['hasPlaintextAuth']?_0x1230bb(0xca):_0x2d016c['DKLLQ'];console['log']('\x20\x20'+bold(_0x2d06be['name'])+_0x1230bb(0xf3)+_0x9a76d2),console[_0x1230bb(0x12c)](_0x1230bb(0xf5)+_0x311934),_0x2d06be[_0x1230bb(0x12b)]!==_0x1230bb(0xd2)&&console[_0x1230bb(0x12c)](_0x1230bb(0xcd)+_0x2d016c[_0x1230bb(0xcc)](link,_0x2d06be[_0x1230bb(0x12b)],_0x2d016c[_0x1230bb(0x117)](basename,_0x2d06be['settingsPath'])));}if(!_0x327a6f){console['log']('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x1a99d2=[..._0x47cc0e[_0x1230bb(0xc8)](_0x152d2d=>_0x152d2d['name']),..._0x442bb8[_0x1230bb(0x108)](_0x25a988=>!_0x1e1fa2[_0x1230bb(0xfb)](_0x25a988['name']))[_0x1230bb(0xc8)](_0x4b6acc=>_0x4b6acc['name'])];console['log']('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x1a99d2['join'](',\x20')+')');}}}console['log']('');}
|