@ranger-testing/ranger-cli 3.0.1-alpha.bb18058-34 → 3.0.1-alpha.c0b290b-36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cli.js +1 -1
- package/build/commands/addEnv.js +1 -1
- package/build/commands/authEncrypt.js +1 -1
- package/build/commands/clean.js +1 -1
- package/build/commands/config.js +1 -1
- package/build/commands/deleteProfile.js +1 -1
- package/build/commands/env.js +1 -1
- package/build/commands/feature.js +1 -1
- package/build/commands/hook.js +1 -1
- package/build/commands/hooks/autoPrompt.js +1 -1
- package/build/commands/hooks/disable.js +1 -1
- package/build/commands/hooks/enable.js +1 -1
- package/build/commands/hooks/exitPlanMode.js +1 -1
- package/build/commands/hooks/index.js +1 -1
- package/build/commands/hooks/output.js +1 -1
- package/build/commands/hooks/planReminder.js +1 -1
- package/build/commands/hooks/planStart.js +1 -1
- package/build/commands/hooks/postEdit.js +1 -1
- package/build/commands/hooks/preCompact.js +1 -1
- package/build/commands/hooks/sessionEnd.js +1 -1
- package/build/commands/hooks/sessionStart.js +1 -1
- package/build/commands/hooks/stopHook.js +1 -1
- package/build/commands/index.js +1 -1
- package/build/commands/login.js +1 -1
- package/build/commands/mcpBootstrap.js +1 -1
- package/build/commands/migrateProfile.js +1 -1
- package/build/commands/setup/claude.js +1 -1
- package/build/commands/setup/opencode.js +1 -1
- package/build/commands/setupCi.js +1 -1
- package/build/commands/skillup.js +1 -1
- package/build/commands/start.js +1 -1
- package/build/commands/status.js +1 -1
- package/build/commands/update.js +1 -1
- package/build/commands/updateEnv.js +1 -1
- package/build/commands/useEnv.js +1 -1
- package/build/commands/utils/activeProfile.js +1 -1
- package/build/commands/utils/agentEnv.js +1 -1
- package/build/commands/utils/browserSessionsApi.js +1 -1
- package/build/commands/utils/claudeConfig.js +1 -1
- package/build/commands/utils/claudeOverrideSettings.js +1 -1
- package/build/commands/utils/claudePlugin.js +1 -1
- package/build/commands/utils/cloudProfile.js +1 -1
- package/build/commands/utils/cloudProfileSession.js +1 -1
- package/build/commands/utils/crypto.js +1 -1
- package/build/commands/utils/desirePathLog.js +1 -1
- package/build/commands/utils/deviceAuth.js +1 -1
- package/build/commands/utils/environment.js +1 -1
- package/build/commands/utils/featureApi.js +1 -1
- package/build/commands/utils/fixWebmDuration.js +1 -1
- package/build/commands/utils/gitTracked.js +1 -1
- package/build/commands/utils/keychain.js +1 -1
- package/build/commands/utils/legacyWarning.js +1 -1
- package/build/commands/utils/localAgentInstallationsApi.js +1 -1
- package/build/commands/utils/matchAuthEnvironment.js +1 -1
- package/build/commands/utils/mcpImageBase64.js +1 -1
- package/build/commands/utils/model.js +1 -1
- package/build/commands/utils/novaActCli.js +1 -1
- package/build/commands/utils/opencodeConfig.js +1 -1
- package/build/commands/utils/organizationEnvApi.js +1 -1
- package/build/commands/utils/playwrightCli.js +1 -1
- package/build/commands/utils/profileMessages.js +1 -1
- package/build/commands/utils/profileSetupBanner.js +1 -1
- package/build/commands/utils/projectsConfig.js +1 -1
- package/build/commands/utils/rangerConfig.js +1 -1
- package/build/commands/utils/rangerRoot.js +1 -1
- package/build/commands/utils/rangerwrightCli.js +1 -1
- package/build/commands/utils/resolveProfileContext.js +1 -1
- package/build/commands/utils/resolveProfileUrl.js +1 -1
- package/build/commands/utils/retry.js +1 -1
- package/build/commands/utils/sessionCache.js +1 -1
- package/build/commands/utils/settings.js +1 -1
- package/build/commands/utils/skillContent.js +1 -1
- package/build/commands/utils/skills.js +1 -1
- package/build/commands/utils/stitchWebmFiles.js +1 -1
- package/build/commands/utils/telemetry.js +1 -1
- package/build/commands/utils/tokenRefresh.js +1 -1
- package/build/commands/utils/traceSnapshotMapper.js +1 -1
- package/build/commands/utils/tunnelClient.js +1 -0
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/commands/verifyFeatureNovaCli.js +1 -1
- package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
- package/package.json +3 -1
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x28d003,_0x51e2bc){const _0x44065b=_0x4a1a,_0x2a899a=_0x28d003();while(!![]){try{const _0x58e26b=-parseInt(_0x44065b(0x179))/0x1*(parseInt(_0x44065b(0x176))/0x2)+parseInt(_0x44065b(0x178))/0x3+-parseInt(_0x44065b(0x17e))/0x4+parseInt(_0x44065b(0x172))/0x5+-parseInt(_0x44065b(0x17b))/0x6*(-parseInt(_0x44065b(0x173))/0x7)+-parseInt(_0x44065b(0x181))/0x8*(parseInt(_0x44065b(0x175))/0x9)+-parseInt(_0x44065b(0x182))/0xa;if(_0x58e26b===_0x51e2bc)break;else _0x2a899a['push'](_0x2a899a['shift']());}catch(_0x3b4037){_0x2a899a['push'](_0x2a899a['shift']());}}}(_0x5528,0x5831f));function _0x4a1a(_0x16c2ea,_0x6509a1){_0x16c2ea=_0x16c2ea-0x172;const _0x552880=_0x5528();let _0x4a1acf=_0x552880[_0x16c2ea];return _0x4a1acf;}import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0x19f24f=_0x4a1a,_0x38c797={'wSFeG':function(_0x3b01f3){return _0x3b01f3();},'TUBVe':function(_0x5535c3){return _0x5535c3();},'kGMdw':function(_0x529ddd,_0x1c6c6f){return _0x529ddd(_0x1c6c6f);}},_0x13a91e=await getMcpAuthOrigin();if(_0x13a91e){console['log'](_0x19f24f(0x174)),await _0x38c797[_0x19f24f(0x180)](mcpBootstrap);return;}if(!_0x38c797[_0x19f24f(0x17c)](isInteractive))throw new Error(_0x19f24f(0x177));try{const _0x22ec25=await runDeviceAuthFlow(),_0x47996c=await _0x38c797['kGMdw'](getCurrentUser,_0x22ec25);_0x47996c['success']?console['log'](_0x19f24f(0x17a)+_0x47996c[_0x19f24f(0x184)][_0x19f24f(0x17d)]):console['log'](_0x19f24f(0x17f));}catch(_0x4877f9){throw new Error(_0x19f24f(0x183)+(_0x4877f9 instanceof Error?_0x4877f9['message']:_0x4877f9));}}function _0x5528(){const _0x1df594=['TUBVe','organizationName','1720264RziqZO','\x0a✅\x20API\x20key\x20stored\x20successfully','wSFeG','8pQFKeX','1086980RrCAnG','Login\x20failed:\x20','user','2803410OYjswq','175JiEOzQ','Re-authenticating\x20via\x20MCP\x20bootstrap...','34407ahSqzu','932034rVIZVO','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','357432GCeVyJ','1YNSDTI','\x0a✅\x20Logged\x20in\x20to\x20','165606bkcwYL'];_0x5528=function(){return _0x1df594;};return _0x5528();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x5d485c=_0x5d3d;(function(_0x525054,_0x485541){const _0xecf433=_0x5d3d,_0xa6d24c=_0x525054();while(!![]){try{const _0x5e201e=parseInt(_0xecf433(0x163))/0x1*(-parseInt(_0xecf433(0x14d))/0x2)+parseInt(_0xecf433(0x197))/0x3+-parseInt(_0xecf433(0x15d))/0x4*(parseInt(_0xecf433(0x138))/0x5)+parseInt(_0xecf433(0x18f))/0x6+parseInt(_0xecf433(0x116))/0x7*(-parseInt(_0xecf433(0x15b))/0x8)+parseInt(_0xecf433(0x136))/0x9+parseInt(_0xecf433(0x107))/0xa;if(_0x5e201e===_0x485541)break;else _0xa6d24c['push'](_0xa6d24c['shift']());}catch(_0x585bf7){_0xa6d24c['push'](_0xa6d24c['shift']());}}}(_0x1f41,0x55fcd));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',_0x5d485c(0x159)),AUTH_ORIGIN_PATH=join(homedir(),_0x5d485c(0x135),'auth-origin.txt');function _0x1f41(){const _0x529971=['RDwqk','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','slice','match','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','proxied','ArvRS','42BCyvJL','includes','/callback','platform','darwin','log','hex','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','2025-03-26','replace','pOlge','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','QhWJD','ywcxe','\x20done','IISDY','fiEOh','clientId','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','oJKZx','state','BDWHH','parse','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','application/json','end','searchParams','writeHead','data:','WPkVE','name','.ranger','101088JhfBcq','json','35msTUVj','RryHt','QuvnO','application/x-www-form-urlencoded','access_token','ranger-cli','anaiW','EiAaL','authorization_endpoint','IiJLF','initialize','\x0aToken\x20written\x20to\x20','/.well-known/oauth-protected-resource','utf-8','code_challenge','refresh_token','client_id','content-type','client_secret','QCFeU','token','2674JSRUGQ','content','Server\x20returned\x20error:\x20','Ranger\x20CLI','clientSecret','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','start','accessToken','pVrrV','uZgmf','status','OAuthTimeoutError','mcp-oauth-tokens.json','JImys','698536PemgMJ','toString','310028EHFkOe','POST','base64url','LIISb','HgMZm','error','334bqNcNH','S256','SrqLy','127.0.0.1','digest','startsWith','response_type','<html><body><h2>Authentication\x20failed</h2><p>','expiresAt','registration_endpoint','stringify','jypmp','closeAllConnections','idokG','split','Exchanging\x20authorization\x20code...','text','Not\x20found','resource','get_cli_token','OXvjl','RgLha','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','1.0.0','now','error_description','get_cli_token\x20failed:\x20','Initializing\x20MCP\x20session...','AYrDx','kheSB','origin','MLslO','jievB','refresh.txt','nkmfg','Bearer\x20','write','2.0','IWAam','hmldo','headers','veTgm','isError','TzBfP','3617160UUupMq','pjbax','stdout','XoBLs','string','code_challenge_method','IDLcT','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','303891SJPhmZ','LMBub','sIaHg','11498250RGfltl','ZXtDb','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','SARpL','get','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','set'];_0x1f41=function(){return _0x529971;};return _0x1f41();}export async function getMcpAuthOrigin(){const _0x37a2a1=_0x5d485c,_0x25c0c9={'WtZnp':function(_0x2ca0f6,_0x4e30ee,_0x52465b){return _0x2ca0f6(_0x4e30ee,_0x52465b);},'ZfPxo':function(_0x5ed6c9,_0x9d64f5){return _0x5ed6c9||_0x9d64f5;}};try{const _0xb1f2c1=(await _0x25c0c9['WtZnp'](readFile,AUTH_ORIGIN_PATH,_0x37a2a1(0x145)))['trim']();return _0x25c0c9['ZfPxo'](_0xb1f2c1,null);}catch{return null;}}export async function mcpBootstrap(){const _0x193191=_0x5d485c,_0x35255e={'LIISb':function(_0x5308e1){return _0x5308e1();},'veTgm':function(_0x48c64e,_0x40def1){return _0x48c64e(_0x40def1);},'UUuxM':'proxied','IusvW':function(_0x155b8e,_0x222c36){return _0x155b8e+_0x222c36;},'WPkVE':_0x193191(0x10a)},_0x8d9080=_0x35255e[_0x193191(0x160)](getMcpAuthUrl);currentOrigin=_0x8d9080;const _0x128f5d=process['stdout']['isTTY']??![];console[_0x193191(0x11b)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x8d9080+'\x0a');const _0x11f314=await _0x35255e['veTgm'](tryUnauthenticated,_0x8d9080);let _0x2a0ece=null;if(_0x11f314===_0x35255e['UUuxM'])_0x2a0ece='';else{_0x2a0ece=await loadCachedToken();if(!_0x2a0ece){if(!_0x128f5d)throw new Error(_0x35255e['IusvW'](_0x35255e[_0x193191(0x133)],_0x193191(0x11d)));_0x2a0ece=await _0x35255e[_0x193191(0x18c)](oauthFlow,_0x8d9080);}}await callGetCliToken(_0x8d9080,_0x2a0ece);}async function tryUnauthenticated(_0x1a5101){const _0x2eebf8=_0x5d485c,_0x431c54={'pjbax':'POST','aBavP':_0x2eebf8(0x11e),'pOlge':_0x2eebf8(0x17a),'idokG':function(_0x37a51a,_0x2d8600){return _0x37a51a===_0x2d8600;},'EiAaL':'needs-oauth'},_0x1849a1=await fetch(_0x1a5101,{'method':_0x431c54[_0x2eebf8(0x190)],'headers':{'Content-Type':_0x2eebf8(0x12e),'Accept':'application/json,\x20text/event-stream'},'body':JSON[_0x2eebf8(0x16d)]({'jsonrpc':_0x2eebf8(0x188),'id':0x1,'method':_0x2eebf8(0x142),'params':{'protocolVersion':_0x431c54['aBavP'],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x431c54[_0x2eebf8(0x120)]}}})});if(_0x1849a1['ok'])return await _0x1849a1['text'](),_0x2eebf8(0x114);if(_0x431c54[_0x2eebf8(0x170)](_0x1849a1['status'],0x191))return await _0x1849a1['text'](),_0x431c54[_0x2eebf8(0x13f)];const _0x224a30=await _0x1849a1['text']();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x1849a1[_0x2eebf8(0x157)]+':\x20'+_0x224a30);}class OAuthTimeoutError extends Error{constructor(_0x549cad){const _0x387870=_0x5d485c,_0x5221a7={'zsnqL':_0x387870(0x158)};super(_0x549cad),this[_0x387870(0x134)]=_0x5221a7['zsnqL'];}}async function oauthFlow(_0x3ab406){const _0x4c967e=_0x5d485c,_0x5b1af7={'BDWHH':function(_0x4c1da1,_0x519ed9){return _0x4c1da1(_0x519ed9);},'anaiW':function(_0x5c8d67){return _0x5c8d67();},'zLaWK':_0x4c967e(0x121)};try{return await _0x5b1af7[_0x4c967e(0x12b)](oauthFlowAttempt,_0x3ab406);}catch(_0x571cbb){if(_0x571cbb instanceof OAuthTimeoutError&&await _0x5b1af7[_0x4c967e(0x13e)](loadCachedClient))return console['log'](_0x5b1af7['zLaWK']),await clearCachedClient(),await _0x5b1af7['BDWHH'](oauthFlowAttempt,_0x3ab406);throw _0x571cbb;}}async function oauthFlowAttempt(_0x5c59ec){const _0x2a9638=_0x5d485c,_0x1b542f={'IDLcT':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','IiJLF':function(_0x2455a0){return _0x2455a0();},'SboJY':'Registering\x20OAuth\x20client...','kheSB':'authorization_code','LMBub':'refresh_token','OQcLd':'code','hmldo':'none','RgLha':_0x2a9638(0x124),'nkmfg':function(_0x34efa2,_0x559b13){return _0x34efa2(_0x559b13);},'MsIEX':_0x2a9638(0x15f),'ywcxe':_0x2a9638(0x169),'CQYoB':_0x2a9638(0x148),'OXvjl':'redirect_uri','rsKRM':_0x2a9638(0x146),'AYrDx':_0x2a9638(0x194),'zBdKb':_0x2a9638(0x12a),'UrfhI':'client_secret','fiEOh':_0x2a9638(0x13b),'Webvb':function(_0x1c606a,_0x268983,_0x3bb230,_0x5d3b33){return _0x1c606a(_0x268983,_0x3bb230,_0x5d3b33);}},_0x191895=_0x5c59ec[_0x2a9638(0x11f)](/\/mcp$/,'');process['stdout']['write']('Discovering\x20authorization\x20server...');const _0x5664c7=await fetch(_0x191895+_0x2a9638(0x144));if(!_0x5664c7['ok'])throw new Error(_0x1b542f[_0x2a9638(0x195)]);const _0x179e8f=await _0x5664c7['json'](),_0x476b1b=_0x179e8f['authorization_servers']?.[0x0];if(!_0x476b1b)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console[_0x2a9638(0x11b)]('\x20'+_0x476b1b);const _0x8497a0=await fetchAuthServerMetadata(_0x476b1b);let _0x17b5b5,_0x4213b5;const _0xc38af=await _0x1b542f[_0x2a9638(0x141)](loadCachedClient);if(_0xc38af)_0x17b5b5=_0xc38af[_0x2a9638(0x127)],_0x4213b5=_0xc38af[_0x2a9638(0x151)];else{if(_0x8497a0['registration_endpoint']){process[_0x2a9638(0x191)]['write'](_0x1b542f['SboJY']);const _0x5dd718=await fetch(_0x8497a0[_0x2a9638(0x16c)],{'method':_0x2a9638(0x15e),'headers':{'Content-Type':_0x2a9638(0x12e)},'body':JSON[_0x2a9638(0x16d)]({'client_name':_0x2a9638(0x150),'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x2a9638(0x118)],'grant_types':[_0x1b542f[_0x2a9638(0x180)],_0x1b542f[_0x2a9638(0x105)]],'response_types':[_0x1b542f['OQcLd']],'token_endpoint_auth_method':_0x1b542f[_0x2a9638(0x18a)]})});if(!_0x5dd718['ok']){const _0x434d79=await _0x5dd718['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x434d79);}const _0x46e195=await _0x5dd718['json']();_0x17b5b5=_0x46e195['client_id'],_0x4213b5=_0x46e195[_0x2a9638(0x14a)],await saveCachedClient(_0x17b5b5,_0x4213b5),console[_0x2a9638(0x11b)](_0x1b542f[_0x2a9638(0x178)]);}else throw new Error(_0x2a9638(0x196));}const _0x5d06c3=_0x1b542f[_0x2a9638(0x185)](randomBytes,0x20)[_0x2a9638(0x15c)](_0x1b542f['MsIEX']),_0x15d0b4=createHash('sha256')['update'](_0x5d06c3)[_0x2a9638(0x167)](_0x1b542f['MsIEX']),_0x3706e8=randomBytes(0x10)['toString'](_0x2a9638(0x11c)),_0x52a27e=new URL(_0x8497a0[_0x2a9638(0x140)]);_0x52a27e[_0x2a9638(0x130)][_0x2a9638(0x10e)](_0x1b542f[_0x2a9638(0x123)],_0x1b542f['OQcLd']),_0x52a27e['searchParams']['set'](_0x1b542f['CQYoB'],_0x17b5b5),_0x52a27e[_0x2a9638(0x130)][_0x2a9638(0x10e)](_0x1b542f[_0x2a9638(0x177)],'http://localhost:'+CALLBACK_PORT+_0x2a9638(0x118)),_0x52a27e[_0x2a9638(0x130)]['set'](_0x1b542f['rsKRM'],_0x15d0b4),_0x52a27e['searchParams'][_0x2a9638(0x10e)](_0x1b542f[_0x2a9638(0x17f)],_0x2a9638(0x164)),_0x52a27e['searchParams']['set'](_0x1b542f['zBdKb'],_0x3706e8);_0x179e8f['resource']&&_0x52a27e[_0x2a9638(0x130)][_0x2a9638(0x10e)](_0x2a9638(0x175),_0x179e8f[_0x2a9638(0x175)]);console['log']('\x0aOpening\x20browser\x20for\x20authentication...'),console['log'](_0x2a9638(0x109)+_0x52a27e[_0x2a9638(0x15c)]()+'\x0a'),await openBrowser(_0x52a27e['toString']());const _0x5d0d6c=await waitForCallback(_0x3706e8);process['stdout'][_0x2a9638(0x187)](_0x2a9638(0x172));const _0x100d2c=new URLSearchParams({'grant_type':_0x1b542f[_0x2a9638(0x180)],'code':_0x5d0d6c,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0x2a9638(0x118),'client_id':_0x17b5b5,'code_verifier':_0x5d06c3});_0x4213b5&&_0x100d2c['set'](_0x1b542f['UrfhI'],_0x4213b5);_0x179e8f[_0x2a9638(0x175)]&&_0x100d2c[_0x2a9638(0x10e)]('resource',_0x179e8f['resource']);const _0x120a27=await fetch(_0x8497a0['token_endpoint'],{'method':_0x2a9638(0x15e),'headers':{'Content-Type':_0x1b542f[_0x2a9638(0x126)]},'body':_0x100d2c});if(!_0x120a27['ok']){const _0x2542f3=await _0x120a27['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0x2542f3);}const _0x22aa40=await _0x120a27[_0x2a9638(0x137)]();return console['log'](_0x1b542f['RgLha']),await _0x1b542f['Webvb'](saveCachedToken,_0x22aa40[_0x2a9638(0x13c)],_0x22aa40[_0x2a9638(0x147)],_0x22aa40['expires_in']),_0x22aa40['access_token'];}async function callGetCliToken(_0x49add4,_0x2afc43){const _0x21f364=_0x5d485c,_0x3f4d46={'PQsLk':function(_0x449286,_0x205f70,_0x20e762){return _0x449286(_0x205f70,_0x20e762);},'vNElj':_0x21f364(0x15e),'krDMh':'application/json','pVrrV':'application/json,\x20text/event-stream','bQCkz':_0x21f364(0x17e),'jypmp':_0x21f364(0x188),'ZXtDb':_0x21f364(0x142),'GIKzF':_0x21f364(0x11e),'RDwqk':'1.0.0','YOqOu':_0x21f364(0x124),'uzctg':'notifications/initialized','GaqXt':'Requesting\x20CLI\x20token...','iNrCO':'tools/call','abace':function(_0x2f168b,_0x2551e8){return _0x2f168b(_0x2551e8);},'XdYOS':'\x0aUnexpected\x20response\x20structure:','SARpL':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','oJKZx':function(_0x296893,_0x18e92f,_0x425615){return _0x296893(_0x18e92f,_0x425615);},'CMMin':function(_0x53010d,_0x14aac1,_0x4992df,_0x254a3e){return _0x53010d(_0x14aac1,_0x4992df,_0x254a3e);},'QCFeU':_0x21f364(0x12d)},_0x17aaa0={'Content-Type':_0x3f4d46['krDMh'],'Accept':_0x3f4d46[_0x21f364(0x155)]};_0x2afc43&&(_0x17aaa0['Authorization']=_0x21f364(0x186)+_0x2afc43);const _0x5cd024=async _0x52e90a=>{const _0x3f6205=_0x21f364,_0x1b3c00=await _0x3f4d46['PQsLk'](fetch,_0x49add4,{'method':_0x3f4d46['vNElj'],'headers':_0x17aaa0,'body':JSON['stringify'](_0x52e90a)});if(!_0x1b3c00['ok']){const _0x287de3=await _0x1b3c00['text']();throw new Error('HTTP\x20'+_0x1b3c00[_0x3f6205(0x157)]+':\x20'+_0x287de3);}return parseResponse(_0x1b3c00);};process[_0x21f364(0x191)][_0x21f364(0x187)](_0x3f4d46['bQCkz']);const _0xbefd6a=await _0x5cd024({'jsonrpc':_0x3f4d46['jypmp'],'id':0x1,'method':_0x3f4d46[_0x21f364(0x108)],'params':{'protocolVersion':_0x3f4d46['GIKzF'],'capabilities':{},'clientInfo':{'name':_0x21f364(0x13d),'version':_0x3f4d46[_0x21f364(0x10f)]}}});if(_0xbefd6a[_0x21f364(0x162)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0xbefd6a['error']['message']??JSON[_0x21f364(0x16d)](_0xbefd6a[_0x21f364(0x162)])));console[_0x21f364(0x11b)](_0x3f4d46['YOqOu']),await _0x3f4d46['PQsLk'](fetch,_0x49add4,{'method':_0x21f364(0x15e),'headers':_0x17aaa0,'body':JSON[_0x21f364(0x16d)]({'jsonrpc':_0x3f4d46[_0x21f364(0x16e)],'method':_0x3f4d46['uzctg']})})['then'](_0x1e9feb=>_0x1e9feb['text']()),process['stdout']['write'](_0x3f4d46['GaqXt']);const _0x29d4d2=await _0x5cd024({'jsonrpc':_0x3f4d46['jypmp'],'id':0x2,'method':_0x3f4d46['iNrCO'],'params':{'name':_0x21f364(0x176),'arguments':{}}});if(_0x29d4d2[_0x21f364(0x162)])throw new Error(_0x21f364(0x17d)+(_0x29d4d2['error']['message']??JSON[_0x21f364(0x16d)](_0x29d4d2['error'])));console['log'](_0x3f4d46['YOqOu']);const _0x571be7=_0x3f4d46['abace'](extractToken,_0x29d4d2['result']);if(!_0x571be7){console['error'](_0x3f4d46['XdYOS']),console['error'](JSON['stringify'](_0x29d4d2['result'],null,0x2));throw new Error(_0x3f4d46[_0x21f364(0x10b)]);}const _0x5308b9=join(homedir(),'.ranger'),_0x5128a4=_0x3f4d46['oJKZx'](join,_0x5308b9,_0x21f364(0x184));await _0x3f4d46[_0x21f364(0x129)](mkdir,_0x5308b9,{'recursive':!![]}),await _0x3f4d46['CMMin'](writeFile,_0x5128a4,_0x571be7,{'mode':0x180}),await writeFile(join(_0x5308b9,'auth-origin.txt'),_0x49add4,{'mode':0x180}),console[_0x21f364(0x11b)](_0x21f364(0x143)+_0x5128a4),console[_0x21f364(0x11b)](_0x3f4d46[_0x21f364(0x14b)]);}async function fetchAuthServerMetadata(_0x19135c){const _0x54e90b=_0x5d485c,_0x55ae95=_0x19135c+'/.well-known/oauth-authorization-server',_0x488750=await fetch(_0x55ae95);if(!_0x488750['ok'])throw new Error(_0x54e90b(0x128)+_0x55ae95+':\x20'+_0x488750[_0x54e90b(0x157)]);return _0x488750[_0x54e90b(0x137)]();}function waitForCallback(_0x3334d3){const _0x2e945c=_0x5d485c,_0x325aee={'ZbfnN':function(_0x53cbf5){return _0x53cbf5();},'WRLyN':_0x2e945c(0x113),'TzBfP':function(_0xc666fd,_0x40420b){return _0xc666fd!==_0x40420b;},'yIFjM':_0x2e945c(0x174),'jievB':'code','MLslO':_0x2e945c(0x162),'sIaHg':'text/html','NPsQt':function(_0x1cc7fa,_0x32e291){return _0x1cc7fa(_0x32e291);},'orXTC':function(_0x32dba5,_0x11bb3b){return _0x32dba5(_0x11bb3b);},'WDmNO':function(_0x49cea7,_0x3b544f){return _0x49cea7!==_0x3b544f;},'XtISs':function(_0x334024,_0x3e01ab,_0x300007){return _0x334024(_0x3e01ab,_0x300007);},'JImys':function(_0x5ca3e,_0x5d8202){return _0x5ca3e(_0x5d8202);}};return new Promise((_0x52f55e,_0x38b514)=>{const _0x5a3463=_0x2e945c,_0xdf9348=()=>{const _0x1ff25f=_0x5d3d;_0x4785c3[_0x1ff25f(0x16f)](),_0x4785c3['close']();},_0x54ecbf=_0x325aee['XtISs'](setTimeout,()=>{_0x325aee['ZbfnN'](_0xdf9348),_0x38b514(new OAuthTimeoutError(_0x325aee['WRLyN']));},0x1d4c0),_0x4785c3=_0x325aee[_0x5a3463(0x15a)](createServer,(_0x20abb5,_0xffeb7d)=>{const _0x50cd33=_0x5a3463,_0x6b91ee=new URL(_0x20abb5['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x325aee[_0x50cd33(0x18e)](_0x6b91ee['pathname'],'/callback')){_0xffeb7d['writeHead'](0x194),_0xffeb7d['end'](_0x325aee['yIFjM']);return;}const _0x2bee65=_0x6b91ee[_0x50cd33(0x130)]['get'](_0x325aee[_0x50cd33(0x183)]),_0x53bdbd=_0x6b91ee[_0x50cd33(0x130)][_0x50cd33(0x10c)](_0x50cd33(0x12a)),_0x17a231=_0x6b91ee['searchParams']['get'](_0x325aee[_0x50cd33(0x182)]);if(_0x17a231){const _0x36383e=_0x6b91ee[_0x50cd33(0x130)]['get'](_0x50cd33(0x17c))??_0x17a231;_0xffeb7d[_0x50cd33(0x131)](0xc8,{'Content-Type':_0x325aee['sIaHg']}),_0xffeb7d['end'](_0x50cd33(0x16a)+_0x36383e+_0x50cd33(0x110)),_0x325aee['NPsQt'](clearTimeout,_0x54ecbf),_0xdf9348(),_0x325aee['orXTC'](_0x38b514,new Error('OAuth\x20error:\x20'+_0x36383e));return;}if(!_0x2bee65||_0x325aee['WDmNO'](_0x53bdbd,_0x3334d3)){_0xffeb7d['writeHead'](0x190,{'Content-Type':_0x325aee['sIaHg']}),_0xffeb7d[_0x50cd33(0x12f)](_0x50cd33(0x179));return;}_0xffeb7d['writeHead'](0xc8,{'Content-Type':_0x325aee[_0x50cd33(0x106)]}),_0xffeb7d[_0x50cd33(0x12f)](_0x50cd33(0x10d)),clearTimeout(_0x54ecbf),_0x325aee['ZbfnN'](_0xdf9348),_0x52f55e(_0x2bee65);});_0x4785c3['listen'](CALLBACK_PORT,_0x5a3463(0x166));});}async function openBrowser(_0x1b59b3){const _0x290a47=_0x5d485c,_0x75778d={'uZgmf':function(_0x115649,_0xc76f8){return _0x115649===_0xc76f8;},'SrqLy':'win32','eqwHB':function(_0x16c2e5,_0x18a368){return _0x16c2e5(_0x18a368);}},_0x4891d3=process[_0x290a47(0x119)]===_0x290a47(0x11a)?'open':_0x75778d[_0x290a47(0x156)](process[_0x290a47(0x119)],_0x75778d[_0x290a47(0x165)])?_0x290a47(0x153):'xdg-open';_0x75778d['eqwHB'](exec,_0x4891d3+'\x20\x22'+_0x1b59b3+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x24febf=_0x5d485c,_0x581833={'ozxsc':function(_0x1a84cb,_0x4aef65,_0x14bf96){return _0x1a84cb(_0x4aef65,_0x14bf96);},'KPylB':_0x24febf(0x145),'QhWJD':function(_0x203000,_0xeafaa9){return _0x203000>_0xeafaa9;}};try{const _0x12bd9a=JSON['parse'](await _0x581833['ozxsc'](readFile,TOKEN_CACHE_PATH,_0x581833['KPylB']));if(_0x12bd9a['origin']&&_0x12bd9a['origin']!==currentOrigin)return null;if(_0x12bd9a[_0x24febf(0x16b)]&&_0x581833[_0x24febf(0x122)](Date[_0x24febf(0x17b)](),_0x12bd9a['expiresAt']))return null;return _0x12bd9a[_0x24febf(0x154)]??null;}catch{return null;}}async function saveCachedToken(_0x510c46,_0x1da7bd,_0x146453){const _0x3c364e=_0x5d485c,_0x57a746={'MWfdr':function(_0x59fc7e){return _0x59fc7e();},'IISDY':function(_0x13d7ae,_0x344b84,_0x5d228){return _0x13d7ae(_0x344b84,_0x5d228);},'RryHt':function(_0x24d220){return _0x24d220();},'Alzar':function(_0x3cf6b7,_0x34173a,_0x2f6253,_0x1983a1){return _0x3cf6b7(_0x34173a,_0x2f6253,_0x1983a1);}},_0x10b66d=await _0x57a746['MWfdr'](loadCachedData),_0x27e3db={..._0x10b66d,'origin':currentOrigin,'accessToken':_0x510c46,'refreshToken':_0x1da7bd??_0x10b66d?.['refreshToken'],'expiresAt':_0x146453?Date['now']()+_0x146453*0x3e8:undefined};await _0x57a746[_0x3c364e(0x125)](mkdir,join(_0x57a746[_0x3c364e(0x139)](homedir),'.ranger'),{'recursive':!![]}),await _0x57a746['Alzar'](writeFile,TOKEN_CACHE_PATH,JSON[_0x3c364e(0x16d)](_0x27e3db),{'mode':0x180});}function _0x5d3d(_0x20d6d5,_0x3fb80e){_0x20d6d5=_0x20d6d5-0x105;const _0x1f41dd=_0x1f41();let _0x5d3d9e=_0x1f41dd[_0x20d6d5];return _0x5d3d9e;}async function loadCachedClient(){const _0x1d6fd4=_0x5d485c,_0x2c6e3f={'McVSO':function(_0x29b8c7){return _0x29b8c7();},'aqJrP':function(_0x6cda3f,_0x7fb3b3){return _0x6cda3f!==_0x7fb3b3;}},_0x3ae480=await _0x2c6e3f['McVSO'](loadCachedData);if(_0x3ae480?.[_0x1d6fd4(0x181)]&&_0x2c6e3f['aqJrP'](_0x3ae480['origin'],currentOrigin))return null;return _0x3ae480?.[_0x1d6fd4(0x127)]?{'clientId':_0x3ae480[_0x1d6fd4(0x127)],'clientSecret':_0x3ae480[_0x1d6fd4(0x151)]}:null;}async function clearCachedClient(){const _0x9ca094=_0x5d485c,_0x2cf3e2={'QuvnO':function(_0x346a75){return _0x346a75();},'LmBdA':function(_0x592e0a,_0x4948c8,_0x57dfda,_0x4ed37e){return _0x592e0a(_0x4948c8,_0x57dfda,_0x4ed37e);}},_0x3c780c=await _0x2cf3e2[_0x9ca094(0x13a)](loadCachedData);if(!_0x3c780c)return;const {clientId:_0x2888e1,clientSecret:_0x1f3c4b,..._0x18c07e}=_0x3c780c;await _0x2cf3e2['LmBdA'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x18c07e),{'mode':0x180});}async function saveCachedClient(_0x5179e3,_0x4f58e0){const _0x195bd3=_0x5d485c,_0x6c43e5={'IWAam':function(_0xe2ea8){return _0xe2ea8();}},_0x3dc3b4=await _0x6c43e5['IWAam'](loadCachedData),_0x457c95={..._0x3dc3b4,'origin':currentOrigin,'accessToken':_0x3dc3b4?.['accessToken']??'','clientId':_0x5179e3,'clientSecret':_0x4f58e0};await mkdir(join(_0x6c43e5[_0x195bd3(0x189)](homedir),_0x195bd3(0x135)),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x195bd3(0x16d)](_0x457c95),{'mode':0x180});}async function loadCachedData(){const _0x13ce47=_0x5d485c,_0x2f0160={'YvhQO':function(_0x3ecc5b,_0x440129,_0x35baa3){return _0x3ecc5b(_0x440129,_0x35baa3);}};try{return JSON['parse'](await _0x2f0160['YvhQO'](readFile,TOKEN_CACHE_PATH,_0x13ce47(0x145)));}catch{return null;}}async function parseResponse(_0x221ffa){const _0x6cb6d=_0x5d485c,_0x597daa={'KXwwC':_0x6cb6d(0x149),'ArvRS':'data:','twPGX':_0x6cb6d(0x152)},_0x2932e5=_0x221ffa[_0x6cb6d(0x18b)][_0x6cb6d(0x10c)](_0x597daa['KXwwC'])??'';if(_0x2932e5[_0x6cb6d(0x117)]('text/event-stream')){const _0x3c2baa=await _0x221ffa['text']();for(const _0x277fdd of _0x3c2baa[_0x6cb6d(0x171)]('\x0a')){const _0x2713a5=_0x277fdd['trim']();if(_0x2713a5[_0x6cb6d(0x168)](_0x597daa[_0x6cb6d(0x115)])){const _0x1df05c=_0x2713a5[_0x6cb6d(0x111)](_0x6cb6d(0x132)['length'])['trim']();if(!_0x1df05c)continue;try{const _0x4e01ff=JSON[_0x6cb6d(0x12c)](_0x1df05c);if(_0x4e01ff['id']!==undefined||_0x4e01ff[_0x6cb6d(0x162)])return _0x4e01ff;}catch{}}}throw new Error(_0x597daa['twPGX']);}return _0x221ffa[_0x6cb6d(0x137)]();}function extractToken(_0x35a61d){const _0x1e032f=_0x5d485c,_0x3500f1={'HgMZm':function(_0x199cef,_0x38af6a){return _0x199cef===_0x38af6a;},'nzTvW':'Unknown\x20error','XoBLs':_0x1e032f(0x173),'ncPTw':_0x1e032f(0x193)};if(!_0x35a61d)return null;const _0x291a1a=_0x35a61d['structuredContent'];if(_0x291a1a?.[_0x1e032f(0x14c)]&&_0x3500f1[_0x1e032f(0x161)](typeof _0x291a1a[_0x1e032f(0x14c)],'string'))return _0x291a1a[_0x1e032f(0x14c)];if(_0x35a61d[_0x1e032f(0x18d)]){const _0x3a8136=_0x35a61d[_0x1e032f(0x14e)];throw new Error(_0x1e032f(0x14f)+(_0x3a8136?.[0x0]?.[_0x1e032f(0x173)]??_0x3500f1['nzTvW']));}const _0x4e9991=_0x35a61d[_0x1e032f(0x14e)];if(_0x4e9991)for(const _0xb7764c of _0x4e9991){if(_0xb7764c['type']===_0x3500f1[_0x1e032f(0x192)]&&_0xb7764c['text']){try{const _0x3e3beb=JSON['parse'](_0xb7764c['text']);if(_0x3500f1[_0x1e032f(0x161)](typeof _0x3e3beb?.[_0x1e032f(0x14c)],_0x3500f1['ncPTw']))return _0x3e3beb['token'];}catch{}const _0x3cb23f=_0xb7764c['text'][_0x1e032f(0x112)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x3cb23f)return _0x3cb23f[0x1];}}return null;}
|
|
1
|
+
const _0x130e48=_0x37c6;(function(_0x4c0314,_0xf37bb5){const _0x47c2f7=_0x37c6,_0x508769=_0x4c0314();while(!![]){try{const _0xe119de=parseInt(_0x47c2f7(0xda))/0x1*(parseInt(_0x47c2f7(0x107))/0x2)+-parseInt(_0x47c2f7(0xd1))/0x3*(-parseInt(_0x47c2f7(0xde))/0x4)+parseInt(_0x47c2f7(0xdb))/0x5*(-parseInt(_0x47c2f7(0xdc))/0x6)+-parseInt(_0x47c2f7(0xbb))/0x7+-parseInt(_0x47c2f7(0xb7))/0x8*(parseInt(_0x47c2f7(0x11e))/0x9)+-parseInt(_0x47c2f7(0xf5))/0xa+parseInt(_0x47c2f7(0x9f))/0xb*(parseInt(_0x47c2f7(0xf3))/0xc);if(_0xe119de===_0xf37bb5)break;else _0x508769['push'](_0x508769['shift']());}catch(_0x441422){_0x508769['push'](_0x508769['shift']());}}}(_0x15c0,0xa0aa3));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';function _0x15c0(){const _0xa89671=['proxied','expires_in','trim','gCDUV','POST','GlLBy','code','string','XfQNU','application/json,\x20text/event-stream','237992ShNbuW','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','1.0.0','set','7791007NoXOWS','ymQAf','token','type','gQHda','Authorization','stdout','ODTIy','BLtdl','iwvvJ','client_id','resource','MCP\x20server\x20returned\x20HTTP\x20','authorization_code','result','base64url','refresh_token','expiresAt','parse','text','tools/call','/.well-known/oauth-protected-resource','9niUHVx','state','token_endpoint','auQOs','SUjPq','notifications/initialized','Not\x20found','qrJFB','headers','34231CCPoTK','170WxxfHp','57648MrgQaN','127.0.0.1','1377536BFSqBO','get','rFgIq','error_description','qbDxp','HGoNO','writeHead','refreshToken','rQyuy','Exchanging\x20authorization\x20code...','platform','origin','stringify','log','none','sha256','data:','application/json','listen','.ranger','message','1836FgYfnn','oEijt','12089520UQTlGY','clientSecret','bqWyG','access_token','LBxuj','Qwvnb','\x20done','searchParams','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','write','now','auth-origin.txt','\x0aOpening\x20browser\x20for\x20authentication...','win32','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','wCMVy','match','thuAw','66aslOzp','json','2.0','dzbal','text/html','YvRyj','error','/callback','code_challenge','clientId','MuQGU','toString','znbPj','AlBuH','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','registration_endpoint','HrHtX','Initializing\x20MCP\x20session...','qOlol','UmDTG','isTTY','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','HTTP\x20','27AWQuDB','Ranger\x20CLI','get_cli_token','lUyEp','client_secret','YqBpv','\x0aToken\x20written\x20to\x20','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','pathname','name','Registering\x20OAuth\x20client...','TWFxA','oCVJy','includes','bfiui','\x0aUnexpected\x20response\x20structure:','isError','MCP\x20initialize\x20failed:\x20','end','fYFNR','http://localhost:','88660biSXKE','utf-8','ucgLN','status','KDSdm','jHWgA','NBNJM','Requesting\x20CLI\x20token...','wywTn','authorization_servers','response_type','slice','<html><body><h2>Authentication\x20failed</h2><p>','lwkzC'];_0x15c0=function(){return _0xa89671;};return _0x15c0();}const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),_0x130e48(0xf1),'auth-origin.txt');export async function getMcpAuthOrigin(){const _0x3012d2=_0x130e48,_0xaec417={'pXdcF':function(_0x2ed65d,_0x4f58bb){return _0x2ed65d||_0x4f58bb;}};try{const _0x55cdf8=(await readFile(AUTH_ORIGIN_PATH,'utf-8'))[_0x3012d2(0xaf)]();return _0xaec417['pXdcF'](_0x55cdf8,null);}catch{return null;}}export async function mcpBootstrap(){const _0x2494e6=_0x130e48,_0x31dd1c={'dlMPs':function(_0x19b93e){return _0x19b93e();},'cebnw':function(_0x528b96,_0x39bba9){return _0x528b96===_0x39bba9;},'qrJFB':'proxied','wCMVy':function(_0x2f3cf0){return _0x2f3cf0();},'OTPOw':function(_0x540e92,_0x4e8a3d){return _0x540e92+_0x4e8a3d;},'iVkVe':_0x2494e6(0x91),'lNkCc':function(_0x1650f1,_0x25e8a2,_0x1e7ba6){return _0x1650f1(_0x25e8a2,_0x1e7ba6);}},_0x49f22a=_0x31dd1c['dlMPs'](getMcpAuthUrl);currentOrigin=_0x49f22a;const _0x35eec8=process[_0x2494e6(0xc1)][_0x2494e6(0x11b)]??![];console[_0x2494e6(0xeb)](_0x2494e6(0xb8)+_0x49f22a+'\x0a');const _0x3c87b2=await tryUnauthenticated(_0x49f22a);let _0x388b72=null;if(_0x31dd1c['cebnw'](_0x3c87b2,_0x31dd1c[_0x2494e6(0xd8)]))_0x388b72='';else{_0x388b72=await _0x31dd1c[_0x2494e6(0x104)](loadCachedToken);if(!_0x388b72){if(!_0x35eec8)throw new Error(_0x31dd1c['OTPOw'](_0x2494e6(0xfd),_0x31dd1c['iVkVe']));_0x388b72=await oauthFlow(_0x49f22a);}}await _0x31dd1c['lNkCc'](callGetCliToken,_0x49f22a,_0x388b72);}async function tryUnauthenticated(_0x41a056){const _0x23656b=_0x130e48,_0x14972e={'YdpHc':'POST','jMNoD':_0x23656b(0x109),'NBNJM':'initialize','VEGEq':'ranger-cli','qOlol':function(_0x360010,_0x314d5e){return _0x360010===_0x314d5e;}},_0xe45e46=await fetch(_0x41a056,{'method':_0x14972e['YdpHc'],'headers':{'Content-Type':_0x23656b(0xef),'Accept':'application/json,\x20text/event-stream'},'body':JSON['stringify']({'jsonrpc':_0x14972e['jMNoD'],'id':0x1,'method':_0x14972e[_0x23656b(0xa5)],'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x14972e['VEGEq'],'version':'1.0.0'}}})});if(_0xe45e46['ok'])return await _0xe45e46[_0x23656b(0xce)](),_0x23656b(0xad);if(_0x14972e[_0x23656b(0x119)](_0xe45e46['status'],0x191))return await _0xe45e46['text'](),'needs-oauth';const _0x105da9=await _0xe45e46[_0x23656b(0xce)]();throw new Error(_0x23656b(0xc7)+_0xe45e46['status']+':\x20'+_0x105da9);}class OAuthTimeoutError extends Error{constructor(_0xcdcc86){const _0x146bfe=_0x130e48,_0x48c7a8={'thuAw':'OAuthTimeoutError'};super(_0xcdcc86),this[_0x146bfe(0x93)]=_0x48c7a8[_0x146bfe(0x106)];}}async function oauthFlow(_0x318cb8){const _0x30b60b={'cKtov':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'};try{return await oauthFlowAttempt(_0x318cb8);}catch(_0x439905){if(_0x439905 instanceof OAuthTimeoutError&&await loadCachedClient())return console['log'](_0x30b60b['cKtov']),await clearCachedClient(),await oauthFlowAttempt(_0x318cb8);throw _0x439905;}}async function oauthFlowAttempt(_0xa4afd7){const _0x2b8241=_0x130e48,_0x53461a={'nSccq':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','ZPykV':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','lwkzC':function(_0x2d3517,_0x599c2e){return _0x2d3517(_0x599c2e);},'SUjPq':function(_0x3e7ee3){return _0x3e7ee3();},'fYFNR':_0x2b8241(0x94),'GlLBy':_0x2b8241(0xcb),'wywTn':'code','qVJQj':function(_0x3ce60e,_0x2364ab,_0x5cd100){return _0x3ce60e(_0x2364ab,_0x5cd100);},'ucgLN':'\x20done','TWFxA':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','thUBT':'base64url','bFmmH':function(_0x3622c6,_0x4cff23){return _0x3622c6(_0x4cff23);},'aqZDt':_0x2b8241(0xed),'HGoNO':function(_0x1e9185,_0x2f04c8){return _0x1e9185(_0x2f04c8);},'gqRsF':_0x2b8241(0xa9),'cegUc':'redirect_uri','iKggt':_0x2b8241(0xd2),'dadMj':function(_0x47143c,_0x4e3787){return _0x47143c(_0x4e3787);},'lUyEp':_0x2b8241(0xc8),'rJDYM':'resource','dzbal':_0x2b8241(0xb1),'bfiui':'application/x-www-form-urlencoded'},_0x12b532=_0xa4afd7['replace'](/\/mcp$/,'');process[_0x2b8241(0xc1)][_0x2b8241(0xfe)]('Discovering\x20authorization\x20server...');const _0x5c5e14=await fetch(_0x12b532+_0x2b8241(0xd0));if(!_0x5c5e14['ok'])throw new Error(_0x53461a['nSccq']);const _0x2e56f3=await _0x5c5e14[_0x2b8241(0x108)](),_0x56bd37=_0x2e56f3[_0x2b8241(0xa8)]?.[0x0];if(!_0x56bd37)throw new Error(_0x53461a['ZPykV']);console['log']('\x20'+_0x56bd37);const _0x231dc3=await _0x53461a[_0x2b8241(0xac)](fetchAuthServerMetadata,_0x56bd37);let _0xeba8ad,_0x2a3b57;const _0x1e362a=await _0x53461a[_0x2b8241(0xd5)](loadCachedClient);if(_0x1e362a)_0xeba8ad=_0x1e362a[_0x2b8241(0x110)],_0x2a3b57=_0x1e362a['clientSecret'];else{if(_0x231dc3['registration_endpoint']){process['stdout']['write'](_0x53461a[_0x2b8241(0x9d)]);const _0x480b32=await fetch(_0x231dc3[_0x2b8241(0x116)],{'method':'POST','headers':{'Content-Type':_0x2b8241(0xef)},'body':JSON[_0x2b8241(0xea)]({'client_name':_0x2b8241(0x11f),'redirect_uris':[_0x2b8241(0x9e)+CALLBACK_PORT+'/callback'],'grant_types':[_0x2b8241(0xc8),_0x53461a[_0x2b8241(0xb2)]],'response_types':[_0x53461a[_0x2b8241(0xa7)]],'token_endpoint_auth_method':_0x2b8241(0xec)})});if(!_0x480b32['ok']){const _0x3cdb40=await _0x480b32[_0x2b8241(0xce)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x3cdb40);}const _0x15b840=await _0x480b32['json']();_0xeba8ad=_0x15b840[_0x2b8241(0xc5)],_0x2a3b57=_0x15b840[_0x2b8241(0x122)],await _0x53461a['qVJQj'](saveCachedClient,_0xeba8ad,_0x2a3b57),console[_0x2b8241(0xeb)](_0x53461a[_0x2b8241(0xa1)]);}else throw new Error(_0x53461a[_0x2b8241(0x95)]);}const _0x4cb6a9=_0x53461a['lwkzC'](randomBytes,0x20)[_0x2b8241(0x112)](_0x53461a['thUBT']),_0x4ff2d1=_0x53461a['bFmmH'](createHash,_0x53461a['aqZDt'])['update'](_0x4cb6a9)['digest'](_0x2b8241(0xca)),_0x4140bb=_0x53461a['HGoNO'](randomBytes,0x10)['toString']('hex'),_0x1f6374=new URL(_0x231dc3['authorization_endpoint']);_0x1f6374['searchParams']['set'](_0x53461a['gqRsF'],_0x2b8241(0xb3)),_0x1f6374[_0x2b8241(0xfc)][_0x2b8241(0xba)]('client_id',_0xeba8ad),_0x1f6374['searchParams']['set'](_0x53461a['cegUc'],'http://localhost:'+CALLBACK_PORT+'/callback'),_0x1f6374[_0x2b8241(0xfc)][_0x2b8241(0xba)](_0x2b8241(0x10f),_0x4ff2d1),_0x1f6374[_0x2b8241(0xfc)]['set']('code_challenge_method','S256'),_0x1f6374['searchParams']['set'](_0x53461a['iKggt'],_0x4140bb);_0x2e56f3['resource']&&_0x1f6374['searchParams']['set'](_0x2b8241(0xc6),_0x2e56f3[_0x2b8241(0xc6)]);console[_0x2b8241(0xeb)](_0x2b8241(0x101)),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x1f6374['toString']()+'\x0a'),await _0x53461a[_0x2b8241(0xe3)](openBrowser,_0x1f6374[_0x2b8241(0x112)]());const _0x397184=await _0x53461a['dadMj'](waitForCallback,_0x4140bb);process['stdout']['write'](_0x2b8241(0xe7));const _0x203d2e=new URLSearchParams({'grant_type':_0x53461a[_0x2b8241(0x121)],'code':_0x397184,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0xeba8ad,'code_verifier':_0x4cb6a9});_0x2a3b57&&_0x203d2e[_0x2b8241(0xba)](_0x2b8241(0x122),_0x2a3b57);_0x2e56f3['resource']&&_0x203d2e['set'](_0x53461a['rJDYM'],_0x2e56f3['resource']);const _0x1f6e0b=await fetch(_0x231dc3[_0x2b8241(0xd3)],{'method':_0x53461a[_0x2b8241(0x10a)],'headers':{'Content-Type':_0x53461a[_0x2b8241(0x98)]},'body':_0x203d2e});if(!_0x1f6e0b['ok']){const _0x4e9f0d=await _0x1f6e0b['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0x4e9f0d);}const _0x6e231b=await _0x1f6e0b[_0x2b8241(0x108)]();return console[_0x2b8241(0xeb)](_0x2b8241(0xfb)),await saveCachedToken(_0x6e231b['access_token'],_0x6e231b['refresh_token'],_0x6e231b[_0x2b8241(0xae)]),_0x6e231b[_0x2b8241(0xf8)];}async function callGetCliToken(_0x24124e,_0x551189){const _0x235ceb=_0x130e48,_0x19b534={'GoIox':function(_0x5beada,_0xf622b5,_0x47c365){return _0x5beada(_0xf622b5,_0x47c365);},'jHWgA':'application/json','iwvvJ':function(_0x5cf5c7,_0x5a1671){return _0x5cf5c7(_0x5a1671);},'rFgIq':_0x235ceb(0x109),'zjblg':'2025-03-26','KDSdm':'ranger-cli','znbPj':_0x235ceb(0xb9),'HrHtX':_0x235ceb(0xb1),'xCVDF':_0x235ceb(0xd6),'bppDd':_0x235ceb(0xa6),'rCtom':_0x235ceb(0xcf),'nxoWW':_0x235ceb(0x120),'JRJxH':_0x235ceb(0x99),'DNYOl':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','MuQGU':function(_0x2e809c){return _0x2e809c();},'ttDyj':function(_0x325b02,_0x501241,_0x2bd54b){return _0x325b02(_0x501241,_0x2bd54b);},'YvRyj':'refresh.txt','UmDTG':function(_0x2c5b53,_0x1f4626,_0x358ce4){return _0x2c5b53(_0x1f4626,_0x358ce4);},'ODTIy':function(_0x410514,_0x49ca01,_0x5e7cfc,_0x388adb){return _0x410514(_0x49ca01,_0x5e7cfc,_0x388adb);},'pBjMx':'Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a'},_0x31e93c={'Content-Type':_0x19b534[_0x235ceb(0xa4)],'Accept':_0x235ceb(0xb6)};_0x551189&&(_0x31e93c[_0x235ceb(0xc0)]='Bearer\x20'+_0x551189);const _0x4656fe=async _0x4ec375=>{const _0x445725=_0x235ceb,_0x3e8682=await _0x19b534['GoIox'](fetch,_0x24124e,{'method':'POST','headers':_0x31e93c,'body':JSON['stringify'](_0x4ec375)});if(!_0x3e8682['ok']){const _0x2d9543=await _0x3e8682[_0x445725(0xce)]();throw new Error(_0x445725(0x11d)+_0x3e8682[_0x445725(0xa2)]+':\x20'+_0x2d9543);}return parseResponse(_0x3e8682);};process[_0x235ceb(0xc1)]['write'](_0x235ceb(0x118));const _0x21e6ba=await _0x19b534[_0x235ceb(0xc4)](_0x4656fe,{'jsonrpc':_0x19b534[_0x235ceb(0xe0)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x19b534['zjblg'],'capabilities':{},'clientInfo':{'name':_0x19b534[_0x235ceb(0xa3)],'version':_0x19b534[_0x235ceb(0x113)]}}});if(_0x21e6ba['error'])throw new Error(_0x235ceb(0x9b)+(_0x21e6ba['error'][_0x235ceb(0xf2)]??JSON['stringify'](_0x21e6ba['error'])));console['log'](_0x235ceb(0xfb)),await fetch(_0x24124e,{'method':_0x19b534[_0x235ceb(0x117)],'headers':_0x31e93c,'body':JSON['stringify']({'jsonrpc':_0x19b534[_0x235ceb(0xe0)],'method':_0x19b534['xCVDF']})})['then'](_0xf433b5=>_0xf433b5['text']()),process[_0x235ceb(0xc1)][_0x235ceb(0xfe)](_0x19b534['bppDd']);const _0x35e9bb=await _0x4656fe({'jsonrpc':'2.0','id':0x2,'method':_0x19b534['rCtom'],'params':{'name':_0x19b534['nxoWW'],'arguments':{}}});if(_0x35e9bb['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x35e9bb['error'][_0x235ceb(0xf2)]??JSON[_0x235ceb(0xea)](_0x35e9bb['error'])));console['log']('\x20done');const _0x1049c9=_0x19b534['iwvvJ'](extractToken,_0x35e9bb[_0x235ceb(0xc9)]);if(!_0x1049c9){console[_0x235ceb(0x10d)](_0x19b534['JRJxH']),console['error'](JSON[_0x235ceb(0xea)](_0x35e9bb['result'],null,0x2));throw new Error(_0x19b534['DNYOl']);}const _0x4fdd13=join(_0x19b534[_0x235ceb(0x111)](homedir),'.ranger'),_0x502e26=_0x19b534['ttDyj'](join,_0x4fdd13,_0x19b534[_0x235ceb(0x10c)]);await _0x19b534[_0x235ceb(0x11a)](mkdir,_0x4fdd13,{'recursive':!![]}),await _0x19b534[_0x235ceb(0xc2)](writeFile,_0x502e26,_0x1049c9,{'mode':0x180}),await writeFile(join(_0x4fdd13,_0x235ceb(0x100)),_0x24124e,{'mode':0x180}),console[_0x235ceb(0xeb)](_0x235ceb(0x90)+_0x502e26),console[_0x235ceb(0xeb)](_0x19b534['pBjMx']);}async function fetchAuthServerMetadata(_0x333bc7){const _0x29780b=_0x333bc7+'/.well-known/oauth-authorization-server',_0x41c148=await fetch(_0x29780b);if(!_0x41c148['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x29780b+':\x20'+_0x41c148['status']);return _0x41c148['json']();}function waitForCallback(_0x12fed5){const _0x3868ef=_0x130e48,_0x363278={'uznjd':function(_0x35aeb9,_0x5bf73b){return _0x35aeb9(_0x5bf73b);},'tieAi':function(_0x2fe3d8,_0xbfccba){return _0x2fe3d8!==_0xbfccba;},'ZtgzN':_0x3868ef(0xd7),'auQOs':_0x3868ef(0xb3),'bqWyG':_0x3868ef(0x10d),'wAJLq':function(_0x339508,_0x442d88){return _0x339508(_0x442d88);},'Bhqsb':function(_0x29c53b){return _0x29c53b();},'KHQed':function(_0x5ee3aa,_0xa12faf){return _0x5ee3aa(_0xa12faf);},'MbwKi':function(_0x1f2133,_0x55b9c6){return _0x1f2133!==_0x55b9c6;},'Qwvnb':_0x3868ef(0x10b),'aipRR':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','NDgGW':function(_0x3bcd78){return _0x3bcd78();},'oCVJy':function(_0x2efaba,_0x270bb1){return _0x2efaba(_0x270bb1);}};return new Promise((_0x177a70,_0x1eff4f)=>{const _0x1e9ac0=_0x3868ef,_0x287ca4=()=>{_0xca202d['closeAllConnections'](),_0xca202d['close']();},_0x1cb0f8=setTimeout(()=>{const _0x4b1fee=_0x37c6;_0x287ca4(),_0x363278['uznjd'](_0x1eff4f,new OAuthTimeoutError(_0x4b1fee(0x11c)));},0x1d4c0),_0xca202d=_0x363278[_0x1e9ac0(0x96)](createServer,(_0x1502a7,_0x29055b)=>{const _0x428c18=_0x1e9ac0,_0x491330=new URL(_0x1502a7['url']??'/',_0x428c18(0x9e)+CALLBACK_PORT);if(_0x363278['tieAi'](_0x491330[_0x428c18(0x92)],_0x428c18(0x10e))){_0x29055b[_0x428c18(0xe4)](0x194),_0x29055b['end'](_0x363278['ZtgzN']);return;}const _0xb5f67c=_0x491330[_0x428c18(0xfc)]['get'](_0x363278[_0x428c18(0xd4)]),_0xb133bb=_0x491330['searchParams'][_0x428c18(0xdf)](_0x428c18(0xd2)),_0xcb59e9=_0x491330['searchParams']['get'](_0x363278[_0x428c18(0xf7)]);if(_0xcb59e9){const _0x51ccf9=_0x491330['searchParams'][_0x428c18(0xdf)](_0x428c18(0xe1))??_0xcb59e9;_0x29055b['writeHead'](0xc8,{'Content-Type':'text/html'}),_0x29055b[_0x428c18(0x9c)](_0x428c18(0xab)+_0x51ccf9+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),_0x363278['wAJLq'](clearTimeout,_0x1cb0f8),_0x363278['Bhqsb'](_0x287ca4),_0x363278['KHQed'](_0x1eff4f,new Error('OAuth\x20error:\x20'+_0x51ccf9));return;}if(!_0xb5f67c||_0x363278['MbwKi'](_0xb133bb,_0x12fed5)){_0x29055b['writeHead'](0x190,{'Content-Type':_0x363278[_0x428c18(0xfa)]}),_0x29055b[_0x428c18(0x9c)](_0x363278['aipRR']);return;}_0x29055b['writeHead'](0xc8,{'Content-Type':_0x428c18(0x10b)}),_0x29055b[_0x428c18(0x9c)](_0x428c18(0x103)),clearTimeout(_0x1cb0f8),_0x363278['NDgGW'](_0x287ca4),_0x177a70(_0xb5f67c);});_0xca202d[_0x1e9ac0(0xf0)](CALLBACK_PORT,_0x1e9ac0(0xdd));});}async function openBrowser(_0x3dee48){const _0x16c2c6=_0x130e48,_0x426eb5={'BLtdl':'darwin','dxGLU':'open','gCDUV':_0x16c2c6(0x102),'KaWfL':'start','gQHda':'xdg-open'},_0x3c8bee=process[_0x16c2c6(0xe8)]===_0x426eb5[_0x16c2c6(0xc3)]?_0x426eb5['dxGLU']:process[_0x16c2c6(0xe8)]===_0x426eb5[_0x16c2c6(0xb0)]?_0x426eb5['KaWfL']:_0x426eb5[_0x16c2c6(0xbf)];exec(_0x3c8bee+'\x20\x22'+_0x3dee48+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x5ab17c=_0x130e48,_0x5f01bf={'pHgWM':function(_0x25a9cf,_0x485023,_0x1a9fc8){return _0x25a9cf(_0x485023,_0x1a9fc8);},'cosdS':function(_0x51e082,_0x34ff7d){return _0x51e082!==_0x34ff7d;},'LBxuj':function(_0x4e5c41,_0x30f800){return _0x4e5c41>_0x30f800;}};try{const _0x275c88=JSON[_0x5ab17c(0xcd)](await _0x5f01bf['pHgWM'](readFile,TOKEN_CACHE_PATH,_0x5ab17c(0xa0)));if(_0x275c88[_0x5ab17c(0xe9)]&&_0x5f01bf['cosdS'](_0x275c88[_0x5ab17c(0xe9)],currentOrigin))return null;if(_0x275c88[_0x5ab17c(0xcc)]&&_0x5f01bf[_0x5ab17c(0xf9)](Date[_0x5ab17c(0xff)](),_0x275c88['expiresAt']))return null;return _0x275c88['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x306374,_0x4f1fc2,_0x353f38){const _0x320203=_0x130e48,_0x333079={'ymQAf':function(_0x42675a,_0x1938bd){return _0x42675a*_0x1938bd;},'AlBuH':function(_0x579b0a,_0x1f696c,_0x2e896c){return _0x579b0a(_0x1f696c,_0x2e896c);}},_0x819a53=await loadCachedData(),_0x527ec7={..._0x819a53,'origin':currentOrigin,'accessToken':_0x306374,'refreshToken':_0x4f1fc2??_0x819a53?.[_0x320203(0xe5)],'expiresAt':_0x353f38?Date[_0x320203(0xff)]()+_0x333079[_0x320203(0xbc)](_0x353f38,0x3e8):undefined};await _0x333079['AlBuH'](mkdir,_0x333079[_0x320203(0x114)](join,homedir(),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x320203(0xea)](_0x527ec7),{'mode':0x180});}async function loadCachedClient(){const _0x4d714d=_0x130e48,_0x2aa672=await loadCachedData();if(_0x2aa672?.['origin']&&_0x2aa672['origin']!==currentOrigin)return null;return _0x2aa672?.[_0x4d714d(0x110)]?{'clientId':_0x2aa672['clientId'],'clientSecret':_0x2aa672[_0x4d714d(0xf6)]}:null;}async function clearCachedClient(){const _0x5d2a3d=_0x130e48,_0x1569aa={'YqBpv':function(_0x164be1){return _0x164be1();}},_0x56a829=await _0x1569aa[_0x5d2a3d(0x8f)](loadCachedData);if(!_0x56a829)return;const {clientId:_0x5740ac,clientSecret:_0x574656,..._0x1a9736}=_0x56a829;await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x1a9736),{'mode':0x180});}async function saveCachedClient(_0x128d83,_0x1f2542){const _0x4c280b=_0x130e48,_0x2becaa={'oEijt':function(_0xe16279){return _0xe16279();},'IDkNc':function(_0x1f74e0,_0x5274ba,_0x3c60a3){return _0x1f74e0(_0x5274ba,_0x3c60a3);},'gpPpj':'.ranger'},_0x2ffd27=await _0x2becaa[_0x4c280b(0xf4)](loadCachedData),_0x330abc={..._0x2ffd27,'origin':currentOrigin,'accessToken':_0x2ffd27?.['accessToken']??'','clientId':_0x128d83,'clientSecret':_0x1f2542};await _0x2becaa['IDkNc'](mkdir,join(homedir(),_0x2becaa['gpPpj']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x4c280b(0xea)](_0x330abc),{'mode':0x180});}function _0x37c6(_0x402886,_0x178b1f){_0x402886=_0x402886-0x8f;const _0x15c075=_0x15c0();let _0x37c64e=_0x15c075[_0x402886];return _0x37c64e;}async function loadCachedData(){const _0x1ed408=_0x130e48;try{return JSON[_0x1ed408(0xcd)](await readFile(TOKEN_CACHE_PATH,'utf-8'));}catch{return null;}}async function parseResponse(_0x164325){const _0x20948d=_0x130e48,_0xa02264=_0x164325[_0x20948d(0xd9)]['get']('content-type')??'';if(_0xa02264[_0x20948d(0x97)]('text/event-stream')){const _0xa39f13=await _0x164325[_0x20948d(0xce)]();for(const _0x58d1d9 of _0xa39f13['split']('\x0a')){const _0x43bcc5=_0x58d1d9['trim']();if(_0x43bcc5['startsWith'](_0x20948d(0xee))){const _0x220da1=_0x43bcc5[_0x20948d(0xaa)](_0x20948d(0xee)['length'])['trim']();if(!_0x220da1)continue;try{const _0x2172d5=JSON['parse'](_0x220da1);if(_0x2172d5['id']!==undefined||_0x2172d5[_0x20948d(0x10d)])return _0x2172d5;}catch{}}}throw new Error(_0x20948d(0x115));}return _0x164325[_0x20948d(0x108)]();}function extractToken(_0x4b348b){const _0x31dca6=_0x130e48,_0x1c7b83={'RpMJI':function(_0x212992,_0x2734d1){return _0x212992===_0x2734d1;},'XfQNU':function(_0x5db410,_0x2f371f){return _0x5db410===_0x2f371f;},'qbDxp':_0x31dca6(0xce),'rQyuy':'string'};if(!_0x4b348b)return null;const _0x587372=_0x4b348b['structuredContent'];if(_0x587372?.[_0x31dca6(0xbd)]&&_0x1c7b83['RpMJI'](typeof _0x587372['token'],_0x31dca6(0xb4)))return _0x587372[_0x31dca6(0xbd)];if(_0x4b348b[_0x31dca6(0x9a)]){const _0x45cc3d=_0x4b348b['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x45cc3d?.[0x0]?.['text']??'Unknown\x20error'));}const _0x23b1e7=_0x4b348b['content'];if(_0x23b1e7)for(const _0x153544 of _0x23b1e7){if(_0x1c7b83[_0x31dca6(0xb5)](_0x153544[_0x31dca6(0xbe)],_0x1c7b83[_0x31dca6(0xe2)])&&_0x153544[_0x31dca6(0xce)]){try{const _0x141903=JSON['parse'](_0x153544['text']);if(typeof _0x141903?.['token']===_0x1c7b83[_0x31dca6(0xe6)])return _0x141903['token'];}catch{}const _0x2089f7=_0x153544[_0x31dca6(0xce)][_0x31dca6(0x105)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x2089f7)return _0x2089f7[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1b096a,_0x1999b2){var _0x2799ff=_0x1b3f,_0xeec332=_0x1b096a();while(!![]){try{var _0x3c8b13=parseInt(_0x2799ff(0x1e8))/0x1+-parseInt(_0x2799ff(0x1e7))/0x2*(-parseInt(_0x2799ff(0x1ec))/0x3)+-parseInt(_0x2799ff(0x1ed))/0x4+parseInt(_0x2799ff(0x1f1))/0x5*(parseInt(_0x2799ff(0x1ef))/0x6)+-parseInt(_0x2799ff(0x1eb))/0x7*(parseInt(_0x2799ff(0x1f3))/0x8)+parseInt(_0x2799ff(0x1e4))/0x9+-parseInt(_0x2799ff(0x1e5))/0xa;if(_0x3c8b13===_0x1999b2)break;else _0xeec332['push'](_0xeec332['shift']());}catch(_0x2d4c87){_0xeec332['push'](_0xeec332['shift']());}}}(_0x4f9e,0x7abcd));function _0x1b3f(_0x29bb69,_0x1e3530){_0x29bb69=_0x29bb69-0x1e3;var _0x4f9e28=_0x4f9e();var _0x1b3f55=_0x4f9e28[_0x29bb69];return _0x1b3f55;}export async function migrateProfile(_0x4844ed,_0x4b9f3c){var _0x549447=_0x1b3f,_0x325682={'JWsEt':function(_0x132bb9,_0x3b38f5){return _0x132bb9+_0x3b38f5;},'ulIJM':function(_0x804cea,_0x1e4227){return _0x804cea+_0x1e4227;},'ybppp':_0x549447(0x1e6),'mFTSr':_0x549447(0x1e3),'NhodV':_0x549447(0x1ea),'WWken':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a'};console[_0x549447(0x1f5)](_0x325682[_0x549447(0x1ee)](_0x325682['ulIJM'](_0x325682[_0x549447(0x1ee)](_0x325682['ybppp']+'\x0a',_0x325682[_0x549447(0x1f0)]),_0x549447(0x1f4))+'\x0a',_0x549447(0x1e9))+_0x325682[_0x549447(0x1f2)]+'\x0a'+_0x325682['WWken']+'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'),process['exit'](0x1);}function _0x4f9e(){var _0x35beb9=['error','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','7920837dDRwWv','713370CKNWJv','ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','14LqykxX','580784FlFiMk','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','6480691gnUbgN','58545EQeANC','1071728BHiZOg','JWsEt','6BhYRNg','mFTSr','851665ECBtwh','NhodV','8WmPQog','\x20\x20ranger\x20profile\x20add\x20<name>\x0a'];_0x4f9e=function(){return _0x35beb9;};return _0x4f9e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x172eea,_0x594b7f){const _0x5b1572=_0x5741,_0x4fc462=_0x172eea();while(!![]){try{const _0x40fb0f=-parseInt(_0x5b1572(0x105))/0x1+-parseInt(_0x5b1572(0xed))/0x2+parseInt(_0x5b1572(0xfc))/0x3+parseInt(_0x5b1572(0xfe))/0x4*(parseInt(_0x5b1572(0x107))/0x5)+-parseInt(_0x5b1572(0xd7))/0x6+-parseInt(_0x5b1572(0x109))/0x7+-parseInt(_0x5b1572(0xf9))/0x8*(-parseInt(_0x5b1572(0xfa))/0x9);if(_0x40fb0f===_0x594b7f)break;else _0x4fc462['push'](_0x4fc462['shift']());}catch(_0x16d0c2){_0x4fc462['push'](_0x4fc462['shift']());}}}(_0x4165,0x402fb));import{join}from'path';function _0x5741(_0x2bf4a2,_0x23441b){_0x2bf4a2=_0x2bf4a2-0xd4;const _0x4165b3=_0x4165();let _0x574193=_0x4165b3[_0x2bf4a2];return _0x574193;}import{existsSync}from'fs';import _0x2f9eca 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(_0x2168bd){const _0x1c2194=_0x5741,_0x47efd5={'sorga':function(_0xd1b2bf,_0xf8a3cf){return _0xd1b2bf(_0xf8a3cf);},'PAeVx':function(_0x1689a2,_0xf9bcde,_0xa7e18e){return _0x1689a2(_0xf9bcde,_0xa7e18e);},'TVkLW':function(_0x1f6d00){return _0x1f6d00();},'ISOeu':'.claude','Tfglb':'project','YXCjz':_0x1c2194(0xe3),'wrKQE':_0x1c2194(0xdc),'CYgWk':'user','nEbMo':_0x1c2194(0xd5),'PEsbR':_0x1c2194(0xe9),'twLrR':_0x1c2194(0x102),'eQBig':_0x1c2194(0xe7),'aAFAN':'plugin','ExCqN':'--scope','VPflU':function(_0x4e4859,_0x4c8efc){return _0x4e4859===_0x4c8efc;},'gVTFS':_0x1c2194(0xd6),'IOyZR':_0x1c2194(0xef),'JLoUV':'⚠\x20Failed\x20to\x20enable\x20plugin:'},_0x2dbaeb=await isPluginInstalled('ranger@trailhead');if(_0x2dbaeb)return console['log'](_0x1c2194(0xfd)),![];const _0xcb0a5f=_0x47efd5[_0x1c2194(0xec)](existsSync,_0x47efd5[_0x1c2194(0xf6)](join,_0x47efd5['TVkLW'](getProjectRoot),_0x47efd5['ISOeu']));let _0x29cc99;if(_0x2168bd)_0x29cc99=_0x2168bd;else{if(_0xcb0a5f)_0x29cc99=_0x47efd5[_0x1c2194(0xf3)];else{console[_0x1c2194(0xf7)]('\x0a📦\x20Claude\x20Code\x20Plugin\x0a');const _0x261554=await _0x2f9eca[_0x1c2194(0xdf)]([{'type':_0x47efd5[_0x1c2194(0xff)],'name':'pluginScope','message':_0x47efd5[_0x1c2194(0xe2)],'choices':[{'name':_0x1c2194(0xf1),'value':_0x47efd5['CYgWk']},{'name':_0x1c2194(0xf2),'value':_0x47efd5['Tfglb']}],'default':_0x47efd5[_0x1c2194(0xde)]}]);_0x29cc99=_0x261554['pluginScope'];}}console['log']('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x29cc99+'\x20level)...\x0a');const _0x2ab200=await isMarketplaceAdded('trailhead');let _0x29a056=_0x2ab200;if(_0x2ab200)console[_0x1c2194(0xf7)](_0x1c2194(0xe1));else{const _0x4a3fb9=await runClaudeCommand([_0x1c2194(0x104),_0x47efd5[_0x1c2194(0xf4)],'add',_0x47efd5[_0x1c2194(0x103)]]);!_0x4a3fb9[_0x1c2194(0xf5)]?(console['error'](_0x47efd5['twLrR'],_0x4a3fb9[_0x1c2194(0x100)]),console[_0x1c2194(0xf7)](_0x47efd5['eQBig']),console[_0x1c2194(0xf7)](_0x1c2194(0xfb)),console[_0x1c2194(0xf7)](_0x1c2194(0xd8)+_0x29cc99)):_0x29a056=!![];}if(_0x29a056){const _0x4a7f21=await _0x47efd5[_0x1c2194(0xf6)](runClaudeCommand,[_0x47efd5[_0x1c2194(0xdd)],'install',_0x1c2194(0x106),_0x47efd5['ExCqN'],_0x29cc99],{'cwd':_0x47efd5['VPflU'](_0x29cc99,_0x47efd5[_0x1c2194(0xf3)])?_0x47efd5['TVkLW'](getProjectRoot):undefined});if(!_0x4a7f21['success'])console[_0x1c2194(0x100)]('❌\x20Failed\x20to\x20install\x20plugin:',_0x4a7f21['error']),console['log'](_0x47efd5['eQBig']),console['log'](_0x1c2194(0xd8)+_0x29cc99);else{console['log'](_0x47efd5[_0x1c2194(0xe5)]);const _0x3cef5f=[_0x47efd5['aAFAN'],_0x1c2194(0xda),_0x1c2194(0x106)];_0x29cc99===_0x47efd5[_0x1c2194(0xf3)]&&_0x3cef5f[_0x1c2194(0xee)](_0x1c2194(0xeb),_0x47efd5[_0x1c2194(0xf3)]);const _0x336828=await runClaudeCommand(_0x3cef5f,{'captureOutput':!![],'cwd':_0x47efd5['VPflU'](_0x29cc99,_0x47efd5['Tfglb'])?_0x47efd5[_0x1c2194(0xea)](getProjectRoot):undefined}),_0x320ff7=_0x336828['output']?.[_0x1c2194(0xe0)](_0x47efd5[_0x1c2194(0xf0)]);!_0x336828[_0x1c2194(0xf5)]&&!_0x320ff7?console['error'](_0x47efd5[_0x1c2194(0xe4)],_0x336828[_0x1c2194(0x100)]):console[_0x1c2194(0xf7)](_0x1c2194(0x108));}}return!![];}export async function ensureClaudeSkills(_0x3a0e33){const _0x19aebc=_0x5741,_0x23b3a5={'yEVsX':function(_0xc218bc,_0x40ab43){return _0xc218bc(_0x40ab43);},'uXUsb':function(_0x3fe156,_0x1dd0ee,_0x369bcd,_0x19afeb){return _0x3fe156(_0x1dd0ee,_0x369bcd,_0x19afeb);},'TDsQx':'user','yCreF':_0x19aebc(0x101),'jybXa':'SKILL.md','hUMeA':'project','kOQrG':function(_0x4e1447,_0x88cb80){return _0x4e1447||_0x88cb80;},'InrSL':function(_0x4354e4){return _0x4354e4();},'FcNls':'.claude','jPKym':'wantsSkillup','ekoZG':'Would\x20you\x20like\x20to\x20install\x20skills?'},_0x329d06=_0x23b3a5[_0x19aebc(0x10a)](existsSync,_0x23b3a5['uXUsb'](join,getSkillsDir(_0x23b3a5['TDsQx']),_0x23b3a5['yCreF'],_0x23b3a5['jybXa'])),_0x419d05=existsSync(join(_0x23b3a5['yEVsX'](getSkillsDir,_0x23b3a5[_0x19aebc(0xf8)]),_0x23b3a5[_0x19aebc(0xe6)],'SKILL.md'));if(_0x23b3a5[_0x19aebc(0xe8)](_0x329d06,_0x419d05))return console[_0x19aebc(0xf7)]('✓\x20Ranger\x20skills\x20already\x20installed'),![];const _0x596f87=existsSync(join(_0x23b3a5['InrSL'](getProjectRoot),_0x23b3a5[_0x19aebc(0xd4)]));let _0x4bd9a6=!![];if(_0x3a0e33)await _0x23b3a5[_0x19aebc(0x10a)](skillup,{'autoInstall':_0x3a0e33,'suppressUsage':!![]});else{if(_0x596f87)await _0x23b3a5[_0x19aebc(0x10a)](skillup,{'autoInstall':_0x23b3a5[_0x19aebc(0xf8)],'suppressUsage':!![]});else{const _0x2d6d33=await _0x2f9eca[_0x19aebc(0xdf)]([{'type':_0x19aebc(0xd9),'name':_0x23b3a5['jPKym'],'message':_0x23b3a5['ekoZG'],'default':!![]}]);_0x4bd9a6=_0x2d6d33[_0x19aebc(0xdb)],_0x4bd9a6&&await skillup({'suppressUsage':!![]});}}return _0x4bd9a6;}function _0x4165(){const _0x939724=['301308uTHdaD','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','24MNJaIr','YXCjz','error','ranger','❌\x20Failed\x20to\x20add\x20marketplace:','PEsbR','plugin','33541ssvJxX','ranger@trailhead','372915LXRgzr','✓\x20Claude\x20Code\x20plugin\x20enabled','1686993Gmsmba','yEVsX','FcNls','marketplace','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','3127332yxpjYl','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','confirm','enable','wantsSkillup','Where\x20should\x20the\x20plugin\x20be\x20installed?','aAFAN','CYgWk','prompt','includes','✓\x20Marketplace\x20already\x20added','wrKQE','list','JLoUV','gVTFS','yCreF','\x0aYou\x20can\x20install\x20manually\x20with:','kOQrG','ranger-testing/trailhead','TVkLW','--scope','sorga','983018dgwDeS','push','already\x20enabled','IOyZR','User\x20(available\x20in\x20all\x20your\x20projects)','Project\x20(shared\x20with\x20team\x20via\x20git)','Tfglb','nEbMo','success','PAeVx','log','hUMeA','8017952FgIuqS','9MKpPwe','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'];_0x4165=function(){return _0x939724;};return _0x4165();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3eef76,_0x332ceb){const _0x479530=_0x2cf7,_0x6e23bf=_0x3eef76();while(!![]){try{const _0x5723b5=parseInt(_0x479530(0x134))/0x1+parseInt(_0x479530(0x13b))/0x2*(parseInt(_0x479530(0x138))/0x3)+-parseInt(_0x479530(0x13e))/0x4*(-parseInt(_0x479530(0x145))/0x5)+-parseInt(_0x479530(0x13f))/0x6*(parseInt(_0x479530(0x13a))/0x7)+parseInt(_0x479530(0x13c))/0x8+parseInt(_0x479530(0x147))/0x9*(-parseInt(_0x479530(0x14d))/0xa)+-parseInt(_0x479530(0x151))/0xb;if(_0x5723b5===_0x332ceb)break;else _0x6e23bf['push'](_0x6e23bf['shift']());}catch(_0x44676f){_0x6e23bf['push'](_0x6e23bf['shift']());}}}(_0x3031,0x9db8c));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x307e6b from'inquirer';function _0x2cf7(_0x345b19,_0x563fd2){_0x345b19=_0x345b19-0x12c;const _0x303186=_0x3031();let _0x2cf7c6=_0x303186[_0x345b19];return _0x2cf7c6;}import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0xa27943){const _0x1f06e8=_0x2cf7,_0x5ce635={'TUKBT':function(_0x25a754,_0x3ab001){return _0x25a754(_0x3ab001);},'UFwgN':function(_0x17359c,_0xcafdfd){return _0x17359c(_0xcafdfd);},'nweRk':_0x1f06e8(0x12c),'YMnkq':'project','sBVhE':'pluginScope','OuDEV':'Project\x20(shared\x20with\x20team\x20via\x20git)','mIzEA':_0x1f06e8(0x141),'qIPtq':_0x1f06e8(0x140),'rwgHf':_0x1f06e8(0x135),'YPcJa':_0x1f06e8(0x132),'TKSFT':_0x1f06e8(0x146),'xQIzR':function(_0xd3c827,_0x359d63,_0x25594e){return _0xd3c827(_0x359d63,_0x25594e);},'TaMwR':function(_0x5483ed,_0x4bd6d9){return _0x5483ed+_0x4bd6d9;},'FziFJ':_0x1f06e8(0x142)},_0x2572f1=_0x5ce635['TUKBT'](existsSync,join(_0x5ce635['UFwgN'](getOpencodeConfigDir,'project'),_0x5ce635[_0x1f06e8(0x14a)]));let _0x1eb744;if(_0xa27943)_0x1eb744=_0xa27943;else{if(_0x2572f1)_0x1eb744=_0x5ce635[_0x1f06e8(0x139)];else{console['log'](_0x1f06e8(0x130));const _0x592e06=await _0x307e6b['prompt']([{'type':_0x1f06e8(0x14c),'name':_0x5ce635['sBVhE'],'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x1f06e8(0x14f),'value':_0x1f06e8(0x12f)},{'name':_0x5ce635['OuDEV'],'value':'project'}],'default':'user'}]);_0x1eb744=_0x592e06['pluginScope'];}}const _0x4ae00c=join(getOpencodeConfigDir(_0x1eb744),_0x5ce635['nweRk']),_0xa55cc7='@ranger-testing/opencode-plugin',_0x5934e9=_0x5ce635[_0x1f06e8(0x133)];let _0x29d244={};if(existsSync(_0x4ae00c))try{const _0x20f6b7=await readFile(_0x4ae00c,_0x5ce635[_0x1f06e8(0x14b)]);_0x29d244=JSON[_0x1f06e8(0x149)](_0x20f6b7);}catch(_0x20888a){return console[_0x1f06e8(0x137)](_0x5ce635[_0x1f06e8(0x12e)]),{'configured':![],'scope':_0x1eb744,'error':_0x5ce635[_0x1f06e8(0x148)],'details':_0x20888a};}const _0x4cafe4=Array[_0x1f06e8(0x150)](_0x29d244['plugin'])?_0x29d244[_0x1f06e8(0x131)]:[];if(_0x4cafe4[_0x1f06e8(0x144)](_0xa55cc7))return console[_0x1f06e8(0x14e)](_0x5ce635[_0x1f06e8(0x143)]),{'configured':![],'scope':_0x1eb744};return _0x29d244['$schema']=_0x29d244['$schema']||_0x5934e9,_0x29d244['plugin']=[..._0x4cafe4,_0xa55cc7],await _0x5ce635[_0x1f06e8(0x13d)](mkdir,getOpencodeConfigDir(_0x1eb744),{'recursive':!![]}),await _0x5ce635[_0x1f06e8(0x13d)](writeFile,_0x4ae00c,_0x5ce635[_0x1f06e8(0x136)](JSON['stringify'](_0x29d244,null,0x2),'\x0a')),console[_0x1f06e8(0x14e)](_0x5ce635[_0x1f06e8(0x12d)]),{'configured':!![],'scope':_0x1eb744};}function _0x3031(){const _0x590b50=['qIPtq','list','50340mwLEQZ','log','User\x20(available\x20in\x20all\x20your\x20projects)','isArray','27409195mAxuGH','opencode.json','FziFJ','rwgHf','user','\x0a📦\x20OpenCode\x20Plugin\x0a','plugin','Failed\x20to\x20read\x20opencode.json','mIzEA','739687lbKesX','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','TaMwR','error','6ImIRFb','YMnkq','2342053PDqWIn','1092466YvtxQC','4385576OYNImR','xQIzR','8WYmMJo','6LJNBjJ','utf-8','https://opencode.ai/config.json','✓\x20OpenCode\x20plugin\x20configured','TKSFT','includes','3208235shnrPh','✓\x20OpenCode\x20plugin\x20already\x20configured','342rxqZGd','YPcJa','parse','nweRk'];_0x3031=function(){return _0x590b50;};return _0x3031();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x2107(_0x4822bb,_0x482b0e){_0x4822bb=_0x4822bb-0x1a1;var _0x3fd018=_0x3fd0();var _0x21075e=_0x3fd018[_0x4822bb];return _0x21075e;}function _0x3fd0(){var _0x909ac1=['7504376ZfAQaZ','2503066EVGfEw','290682QsFtMZ','3QTJqRR','1848124KNWlHi','aITGY','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','kGGKe','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','VZAaR','94350wehGRM','160YctWSA','14772150iwIzQr','1255252FiFRXQ'];_0x3fd0=function(){return _0x909ac1;};return _0x3fd0();}(function(_0x326a59,_0x34bbfd){var _0xc03978=_0x2107,_0x315a69=_0x326a59();while(!![]){try{var _0x427e94=parseInt(_0xc03978(0x1a4))/0x1+-parseInt(_0xc03978(0x1a6))/0x2+parseInt(_0xc03978(0x1a8))/0x3*(parseInt(_0xc03978(0x1a9))/0x4)+-parseInt(_0xc03978(0x1a2))/0x5*(parseInt(_0xc03978(0x1a1))/0x6)+parseInt(_0xc03978(0x1a7))/0x7+-parseInt(_0xc03978(0x1a5))/0x8+parseInt(_0xc03978(0x1a3))/0x9;if(_0x427e94===_0x34bbfd)break;else _0x315a69['push'](_0x315a69['shift']());}catch(_0x2dc05e){_0x315a69['push'](_0x315a69['shift']());}}}(_0x3fd0,0xacb33));export async function setupCi(_0x3e8726,_0x596238,_0x4f8273){var _0x5285de=_0x2107,_0x228132={'kGGKe':function(_0x490110,_0x4ee1d9){return _0x490110+_0x4ee1d9;},'CkAAC':function(_0x439cdb,_0x33e721){return _0x439cdb+_0x33e721;},'QBMnT':'ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','aITGY':_0x5285de(0x1ab),'omhaY':_0x5285de(0x1ad),'VZAaR':'\x20\x20https://docs.ranger.net/main/concepts/profiles'};console['error'](_0x228132[_0x5285de(0x1ac)](_0x228132['CkAAC'](_0x228132['CkAAC'](_0x228132['QBMnT'],'\x0a'),_0x228132[_0x5285de(0x1aa)])+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a'+'\x0a',_0x228132['omhaY'])+_0x228132[_0x5285de(0x1ae)]),process['exit'](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4fd6ec,_0x3d4ed5){const _0x3f5626=_0xdd38,_0x4f4c08=_0x4fd6ec();while(!![]){try{const _0x391790=parseInt(_0x3f5626(0x102))/0x1+-parseInt(_0x3f5626(0x114))/0x2*(-parseInt(_0x3f5626(0x11a))/0x3)+parseInt(_0x3f5626(0xed))/0x4*(-parseInt(_0x3f5626(0xf8))/0x5)+-parseInt(_0x3f5626(0x116))/0x6+parseInt(_0x3f5626(0xf7))/0x7*(parseInt(_0x3f5626(0xf3))/0x8)+-parseInt(_0x3f5626(0xfc))/0x9+parseInt(_0x3f5626(0x104))/0xa;if(_0x391790===_0x3d4ed5)break;else _0x4f4c08['push'](_0x4f4c08['shift']());}catch(_0x43d05e){_0x4f4c08['push'](_0x4f4c08['shift']());}}}(_0x1e46,0xbddc6));import{basename}from'path';import _0x24dc20 from'inquirer';import{getToken}from'./utils/keychain.js';function _0xdd38(_0x4ced9c,_0x1e81bc){_0x4ced9c=_0x4ced9c-0xec;const _0x1e4631=_0x1e46();let _0xdd38ee=_0x1e4631[_0x4ced9c];return _0xdd38ee;}import{installSkill}from'./utils/skills.js';function _0x1e46(){const _0x6a95b3=['\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','zUSxb','user','16ZhsDJD','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','/skills/','/.claude/skills/','1058036seFljY','4445835VPvdJh','anfss','claude','message','9291600juDTAM','\x0a📦\x20Installing\x20skills...\x0a','ngXvZ','\x20--opencode','To\x20get\x20started:','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','892166oWRhkE','GeagW','22244410KJLHeN','installLevel','project-level','split','stdin','log','warn','prompt','DIjzz','\x20successfully!\x0a','autoInstall','\x20<your-api-token>','yfbrn','Where\x20should\x20skills\x20be\x20installed?','LMIvX','opencode','3428eqBsKT','isTTY','7331208OyrUmQ','suppressUsage','jzjWJ','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','879oObtYo','oQhEN','project','All\x20projects\x20(','4Abbppu','\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!','This\x20project\x20only\x20('];_0x1e46=function(){return _0x6a95b3;};return _0x1e46();}import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x1aeddc={}){const _0x550176=_0xdd38,_0xb1faaf={'FbGKB':'0|5|1|2|3|4','hNpwY':_0x550176(0xf4),'oQhEN':_0x550176(0xf0),'anfss':function(_0x4fe91c,_0x3d52f3){return _0x4fe91c===_0x3d52f3;},'UDuYA':'opencode','zUSxb':'\x20--opencode','ZWgPD':'✓\x20Found\x20API\x20token','LMIvX':function(_0x134867,_0x5e61cf){return _0x134867(_0x5e61cf);},'ykqrT':'list','GeagW':'user','jzjWJ':_0x550176(0x11c),'BMbas':_0x550176(0xfd),'LKhdl':function(_0x517552,_0x54f86f,_0x3bf22b){return _0x517552(_0x54f86f,_0x3bf22b);},'yfbrn':'ranger','DIjzz':'user-level','ngXvZ':_0x550176(0x106),'zxAds':function(_0x168378,_0x27128d){return _0x168378>_0x27128d;},'UwqLd':_0x550176(0xee)};console[_0x550176(0x109)]('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x45b147=_0x1aeddc['platform']??_0x550176(0xfa),_0x2ffd10=await getToken();if(!_0x2ffd10){const _0xf62828=_0xb1faaf['FbGKB'][_0x550176(0x107)]('|');let _0x35ca34=0x0;while(!![]){switch(_0xf62828[_0x35ca34++]){case'0':console[_0x550176(0x109)](_0xb1faaf['hNpwY']);continue;case'1':console[_0x550176(0x109)](_0xb1faaf[_0x550176(0x11b)]);continue;case'2':console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0xb1faaf['anfss'](_0x45b147,_0xb1faaf['UDuYA'])?_0x550176(0xff):'')+_0x550176(0x10f));continue;case'3':console[_0x550176(0x109)]('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x45b147===_0x550176(0x113)?_0xb1faaf[_0x550176(0xf1)]:'')+'\x0a');continue;case'4':return;case'5':console[_0x550176(0x109)](_0x550176(0x100));continue;}break;}}console[_0x550176(0x109)](_0xb1faaf['ZWgPD']);const _0x3cb1c3=getProjectRoot(),_0x43618e=basename(_0x3cb1c3),_0x13bf3d=_0x45b147===_0x550176(0x113)?_0xb1faaf[_0x550176(0x112)](getOpencodeConfigDir,_0x550176(0xf2))+_0x550176(0xf5):getClaudeConfigDir()+_0x550176(0xf5),_0x265bef=_0xb1faaf[_0x550176(0xf9)](_0x45b147,_0x550176(0x113))?_0x3cb1c3+'/.opencode/skills/':_0x3cb1c3+_0x550176(0xf6),_0x1f7f43=process[_0x550176(0x108)]['isTTY']&&process['stdout'][_0x550176(0x115)];let _0x554709;if(_0x1aeddc[_0x550176(0x10e)])_0x554709=_0x1aeddc['autoInstall'];else{if(_0x1f7f43){const _0x9fa13=await _0x24dc20[_0x550176(0x10b)]([{'type':_0xb1faaf['ykqrT'],'name':_0x550176(0x105),'message':_0x550176(0x111),'choices':[{'name':_0x550176(0xec)+_0x13bf3d+')','value':_0xb1faaf[_0x550176(0x103)]},{'name':_0x550176(0xef)+_0x265bef+')','value':_0x550176(0x11c)}]}]);_0x554709=_0x9fa13['installLevel'];}else _0x554709=_0xb1faaf[_0x550176(0x118)],console['log']('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x265bef+')');}let _0xbe9d44=0x0;const _0x22db8c=getCurrentVersion();console['log'](_0xb1faaf['BMbas']);try{const _0x3eaac8=await _0xb1faaf['LKhdl'](installSkill,_0xb1faaf[_0x550176(0x110)],{'cliVersion':_0x22db8c,'level':_0x554709,'platform':_0x45b147});_0x3eaac8&&_0xbe9d44++;}catch(_0xc4a6da){console[_0x550176(0x10a)](_0x550176(0x119),_0xc4a6da instanceof Error?_0xc4a6da[_0x550176(0xfb)]:_0xc4a6da);}if(_0xbe9d44>0x0){const _0x167d22=_0x554709==='user'?_0xb1faaf[_0x550176(0x10c)]:_0xb1faaf[_0x550176(0xfe)];console['log']('\x0a✅\x20Installed\x20'+_0xbe9d44+'\x20'+_0x167d22+'\x20skill'+(_0xb1faaf['zxAds'](_0xbe9d44,0x1)?'s':'')+_0x550176(0x10d)),!_0x1aeddc[_0x550176(0x117)]&&(console['log']('To\x20use:'),_0x45b147===_0x550176(0x113)?console['log']('\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.'):console['log'](_0xb1faaf['UwqLd']));}else console['log'](_0x550176(0x101));}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x9f6b82=_0x262f;(function(_0x49586f,_0x1d6b97){const _0xb60fc0=_0x262f,_0x7b1186=_0x49586f();while(!![]){try{const _0x508c3a=parseInt(_0xb60fc0(0x223))/0x1*(-parseInt(_0xb60fc0(0x22b))/0x2)+-parseInt(_0xb60fc0(0x222))/0x3*(parseInt(_0xb60fc0(0x21e))/0x4)+parseInt(_0xb60fc0(0x21a))/0x5*(-parseInt(_0xb60fc0(0x1dc))/0x6)+parseInt(_0xb60fc0(0x1f3))/0x7*(parseInt(_0xb60fc0(0x1d5))/0x8)+-parseInt(_0xb60fc0(0x1eb))/0x9*(-parseInt(_0xb60fc0(0x1d0))/0xa)+parseInt(_0xb60fc0(0x1d3))/0xb*(-parseInt(_0xb60fc0(0x219))/0xc)+parseInt(_0xb60fc0(0x1db))/0xd;if(_0x508c3a===_0x1d6b97)break;else _0x7b1186['push'](_0x7b1186['shift']());}catch(_0x25d45f){_0x7b1186['push'](_0x7b1186['shift']());}}}(_0x4039,0x2afbd));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x2bf274 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';function _0x262f(_0x168c58,_0x48e0ae){_0x168c58=_0x168c58-0x1cb;const _0x403989=_0x4039();let _0x262f4a=_0x403989[_0x168c58];return _0x262f4a;}import{addEnv}from'./addEnv.js';function _0x4039(){const _0x2cf092=['\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','nfhGh','platform','vUXXa','message','44532tkpJXG','user','ignore','chromium','Installation\x20failed\x20with\x20exit\x20code\x20','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','rfNiG','✓\x20Authenticated\x20to\x20','63eHDIxA','✓\x20Skipping\x20authentication\x20(--skip-auth)','playwright@','log','\x1b[1m','You\x20can\x20install\x20it\x20manually\x20by\x20running:','WtSIr','trackPhaseStart','npx','provided_token','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','LYEcc','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','oKwSt','warn','aMzjz','success','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','...','ready','qMcvO','IPURS','resolve','skipped','skills','✓\x20Already\x20authenticated\x20to\x20','win32','profile','ranger','device_auth','JRrvj','opencode','withDeps','YIXKr','\x20\x20npx\x20playwright@','ranger\x20setup\x20--scope=','\x0a❌\x20Profile\x20setup\x20failed:','exit','1884tLgOoW','15110uVmLBd','trackPhaseEnd','install','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','784AivGkH','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','\x20install\x20chromium','rCwni','1470ChShmf','16CvtusB','uaVCD','cZptG','FykWS','lJljG','isTTY','allowInsecureLocalhost','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','28484kVbDaG','Ejcig','url','stdout','scope','method','\x20is\x20no\x20longer\x20supported.\x20','350IoQKDb','sLykZ','\x0aInstalling\x20Chromium\x20browser...\x0a','1672sbUwuG','\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','228440wlJPSE','The\x20required\x20version\x20(','error','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','bqilY','✓\x20Created\x20.ranger/.gitignore','4046198IaFNPt','432ihWCZw','CQhmz','plugin','auth','organizationName','hJETF','JluAW','local','pSqeX','status'];_0x4039=function(){return _0x2cf092;};return _0x4039();}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=_0x434ffa=>_0x9f6b82(0x1f7)+_0x434ffa+'\x1b[0m';export function getPlaywrightVersion(){const _0x54b208=_0x9f6b82,_0x521d80={'lJljG':'playwright/package.json'};try{const _0x1218fe=require[_0x54b208(0x209)](_0x521d80[_0x54b208(0x227)]),_0x2b32d9=require(_0x1218fe);return _0x2b32d9['version'];}catch{return null;}}export function installChromiumBinary(_0x214dc9,_0x3f4825=![]){const _0x2fa63c=_0x9f6b82,_0x592810={'rfNiG':function(_0x2967ae,_0x1d90db){return _0x2967ae(_0x1d90db);},'XoBpH':function(_0x52b5e1,_0x2e9a18,_0x5b8bfc,_0x5b85a7){return _0x52b5e1(_0x2e9a18,_0x5b8bfc,_0x5b85a7);},'cYZEt':function(_0x26579,_0x51f8eb){return _0x26579===_0x51f8eb;},'cgdqW':_0x2fa63c(0x20d)};return new Promise((_0x29a27f,_0x1d5e65)=>{const _0x135de7=_0x2fa63c,_0x2663f3=[_0x135de7(0x1f5)+_0x214dc9,_0x135de7(0x21c),..._0x3f4825?['--with-deps']:[],'chromium'],_0x1306ec=_0x592810['XoBpH'](spawn,_0x135de7(0x1fb),_0x2663f3,{'stdio':[_0x135de7(0x1ed),'inherit','inherit'],'shell':_0x592810['cYZEt'](process[_0x135de7(0x1e8)],_0x592810['cgdqW'])});_0x1306ec['on']('close',_0x368a2f=>{const _0x23773a=_0x135de7;_0x368a2f===0x0?_0x29a27f():_0x592810[_0x23773a(0x1f1)](_0x1d5e65,new Error(_0x23773a(0x1ef)+_0x368a2f));}),_0x1306ec['on']('error',_0x21a67e=>{_0x1d5e65(_0x21a67e);});});}export async function authenticate(_0x203359){const _0x3948aa=_0x9f6b82,_0x2c04ea={'AAtZU':function(_0x478876){return _0x478876();},'LYEcc':function(_0x279fbc){return _0x279fbc();},'CQhmz':function(_0x53b363,_0x35ef5a){return _0x53b363(_0x35ef5a);},'nfhGh':'✓\x20Exported\x20credentials\x20for\x20CI'};if(!_0x203359){const _0x4f9c2e=await _0x2c04ea['AAtZU'](getToken);if(_0x4f9c2e){const _0x1ff817=await getCurrentUser(_0x4f9c2e);if(_0x1ff817['success'])return console['log'](_0x3948aa(0x20c)+_0x1ff817['user'][_0x3948aa(0x1e0)]),{'token':_0x4f9c2e,'method':'existing_token'};}try{_0x203359=await _0x2c04ea[_0x3948aa(0x1fe)](runDeviceAuthFlow);}catch(_0x5ecb71){throw new Error('Authentication\x20failed:\x20'+(_0x5ecb71 instanceof Error?_0x5ecb71['message']:_0x5ecb71));}const _0x1cc99e=await _0x2c04ea['CQhmz'](getCurrentUser,_0x203359);if(!_0x1cc99e[_0x3948aa(0x203)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x1cc99e[_0x3948aa(0x1d7)]);return console[_0x3948aa(0x1f6)](_0x3948aa(0x1f2)+_0x1cc99e[_0x3948aa(0x1ec)]['organizationName']),{'token':_0x203359,'method':_0x3948aa(0x210)};}console['log']('Validating\x20API\x20token...');const _0x1b2bce=await getCurrentUser(_0x203359);if(!_0x1b2bce['success']){if(_0x1b2bce[_0x3948aa(0x1e5)])throw new Error('Authentication\x20failed:\x20'+_0x1b2bce[_0x3948aa(0x1d7)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error(_0x3948aa(0x21d)+_0x1b2bce['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console[_0x3948aa(0x1f6)]('✓\x20Authenticated\x20to\x20'+_0x1b2bce['user']['organizationName']),await _0x2c04ea[_0x3948aa(0x1dd)](storeToken,_0x203359),console['log'](process['env']['GITHUB_ENV']?_0x2c04ea[_0x3948aa(0x1e7)]:'✓\x20Stored\x20credentials\x20locally'),{'token':_0x203359,'method':_0x3948aa(0x1fc)};}export async function ensureRangerDir(_0x14e3a1){const _0x1a31cf=_0x9f6b82,_0x465163={'JluAW':function(_0x1344e4){return _0x1344e4();},'UfTRc':function(_0x3dbad7,_0x59a277,_0x40a2ed){return _0x3dbad7(_0x59a277,_0x40a2ed);},'qeKFa':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x14e3a1;const _0x2b0646=_0x465163[_0x1a31cf(0x1e2)](getRangerHomeDir);return!existsSync(_0x2b0646)?(await _0x465163['UfTRc'](mkdir,_0x2b0646,{'recursive':!![]}),console['log']('✓\x20Created\x20~/.ranger/\x20directory'),{'path':_0x2b0646,'installed':!![]}):(console[_0x1a31cf(0x1f6)](_0x465163['qeKFa']),{'path':_0x2b0646,'installed':![]});}export async function ensureChromium(_0x24060d=![]){const _0x21f6b0=_0x9f6b82,_0x3371ac={'jhVzO':function(_0x51ae65,_0x1710fe){return _0x51ae65(_0x1710fe);},'OXVnf':'✓\x20Playwright\x20Chromium\x20browser\x20found','sLykZ':function(_0x3eac7c,_0x40a7d9){return _0x3eac7c??_0x40a7d9;},'qZYwv':'\x20(fallback\x20version)','oKwSt':function(_0x32742d,_0x4e0390){return _0x32742d instanceof _0x4e0390;},'BCJLA':_0x21f6b0(0x1f8)};let _0x327607=![];try{const _0x2d5bdc=chromium['executablePath']();_0x327607=_0x3371ac['jhVzO'](existsSync,_0x2d5bdc);}catch{_0x327607=![];}if(_0x327607)return console['log'](_0x3371ac['OXVnf']),![];const _0x502a55=getPlaywrightVersion(),_0x10c9ca=_0x3371ac[_0x21f6b0(0x1d1)](_0x502a55,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x54815c=!_0x502a55,_0x277549=process['stdin'][_0x21f6b0(0x228)]&&process[_0x21f6b0(0x1cc)][_0x21f6b0(0x228)];let _0x107cfe=!![];if(_0x277549){const {install:_0x4e4d00}=await _0x2bf274['prompt']([{'type':'confirm','name':_0x21f6b0(0x21c),'message':_0x54815c?_0x21f6b0(0x1ff)+_0x10c9ca+'\x20now?':_0x21f6b0(0x1d6)+_0x10c9ca+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x107cfe=_0x4e4d00;}else console[_0x21f6b0(0x1f6)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x10c9ca+(_0x54815c?_0x3371ac['qZYwv']:'')+_0x21f6b0(0x205));if(_0x107cfe){console[_0x21f6b0(0x1f6)](_0x21f6b0(0x1d2));try{await installChromiumBinary(_0x10c9ca,_0x24060d),console['log'](_0x21f6b0(0x1e6));}catch(_0x4a5888){console[_0x21f6b0(0x1d7)]('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x3371ac[_0x21f6b0(0x200)](_0x4a5888,Error)?_0x4a5888['message']:_0x4a5888),console[_0x21f6b0(0x1f6)](_0x3371ac['BCJLA']),console[_0x21f6b0(0x1f6)](_0x21f6b0(0x215)+_0x10c9ca+_0x21f6b0(0x220));}}else console['log']('\x0a⚠\x20Skipping\x20Chromium\x20installation.'),console['log']('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console[_0x21f6b0(0x1f6)](_0x21f6b0(0x215)+_0x10c9ca+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x5b8ca0){const _0x465f57=_0x9f6b82,_0xfdb8bd={'iMrDA':'.gitignore','rCwni':function(_0x136dc1,_0x3fad7e,_0x3f7e98){return _0x136dc1(_0x3fad7e,_0x3f7e98);},'vUXXa':_0x465f57(0x1da)},_0x384e0d=join(_0x5b8ca0,_0xfdb8bd['iMrDA']),_0x3540f0=_0x465f57(0x1d4);await _0xfdb8bd[_0x465f57(0x221)](writeFile,_0x384e0d,_0x3540f0),console[_0x465f57(0x1f6)](_0xfdb8bd[_0x465f57(0x1e9)]);}export async function ensureLocalEnv(_0x5ce3cb,_0x10fe03){const _0x3dc7f9=_0x9f6b82,_0xd1849c={'dUizi':function(_0x5c2c78){return _0x5c2c78();},'GAVwi':function(_0x22d553,_0x522de1){return _0x22d553!==_0x522de1;},'lLski':function(_0x2f34c4,_0x4eda1e){return _0x2f34c4===_0x4eda1e;},'VPORU':_0x3dc7f9(0x1ec),'tTODe':function(_0x3448f6){return _0x3448f6();},'bPDdJ':function(_0x3a16f4,_0xbcc842,_0x474499){return _0x3a16f4(_0xbcc842,_0x474499);},'Ejcig':_0x3dc7f9(0x1e3),'TKsJL':'✓\x20Local\x20profile\x20already\x20exists','WtSIr':function(_0x31bde6,_0x34fd6e,_0x5272ef,_0x7a6a80){return _0x31bde6(_0x34fd6e,_0x5272ef,_0x7a6a80);},'IPURS':_0x3dc7f9(0x217),'SRFlV':function(_0x17f329,_0x17ce7e){return _0x17f329 instanceof _0x17ce7e;}};if(!_0xd1849c['dUizi'](findGitRoot)&&_0xd1849c['GAVwi'](_0x5ce3cb?.['scope'],_0x3dc7f9(0x1ec)))return console['log']('⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.'),{'ready':![],'skipped':!![]};const _0x4681c0=_0xd1849c['lLski'](_0x5ce3cb?.[_0x3dc7f9(0x1cd)],_0xd1849c['VPORU'])?_0xd1849c['tTODe'](getRangerHomeDir):undefined;if(_0xd1849c['bPDdJ'](findExistingEnv,_0xd1849c[_0x3dc7f9(0x22c)],{'locations':[_0x3dc7f9(0x1e3)],'rangerDir':_0x4681c0}))return console['log'](_0xd1849c['TKsJL']),{'ready':!![],'skipped':![]};try{return await _0xd1849c[_0x3dc7f9(0x1f9)](addEnv,'local',{'url':_0x5ce3cb?.['url'],'force':_0x5ce3cb?.['force'],'allowInsecureLocalhost':_0x5ce3cb?.[_0x3dc7f9(0x229)],'scope':_0x5ce3cb?.[_0x3dc7f9(0x1cd)]},_0x10fe03),{'ready':!![],'skipped':![]};}catch(_0xa57259){return console[_0x3dc7f9(0x1d7)](_0xd1849c[_0x3dc7f9(0x208)],_0xd1849c['SRFlV'](_0xa57259,Error)?_0xa57259[_0x3dc7f9(0x1ea)]:_0xa57259),{'ready':![],'skipped':![]};}}export async function start(_0x5d085a,_0x47dd86,_0x552cac){const _0x2ba3f1=_0x9f6b82,_0x2cf2b6={'YIXKr':function(_0x3d7a0a,_0x563769){return _0x3d7a0a!==_0x563769;},'sKOGq':_0x2ba3f1(0x1ec),'SqdcA':function(_0x20f884,_0x35a5b2){return _0x20f884+_0x35a5b2;},'qMcvO':function(_0x516647,_0x3e86b2){return _0x516647(_0x3e86b2);},'chrpk':function(_0x554c77,_0x34c395){return _0x554c77(_0x34c395);},'cZptG':_0x2ba3f1(0x1f4),'hJETF':_0x2ba3f1(0x1df),'aMzjz':function(_0xf43a2f,_0x3cd6c1){return _0xf43a2f(_0x3cd6c1);},'tVktJ':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','pSqeX':_0x2ba3f1(0x1ee),'bqilY':_0x2ba3f1(0x1de),'uaVCD':function(_0x349210,_0x1a2394){return _0x349210(_0x1a2394);},'koAxF':function(_0x355a6f,_0x11366d){return _0x355a6f&&_0x11366d;},'PLtrx':_0x2ba3f1(0x20b),'oaoci':_0x2ba3f1(0x20f),'aQSRs':function(_0x2cfd5f){return _0x2cfd5f();},'FykWS':'\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','zISiS':function(_0x1254e2,_0x2af144,_0x3d1508){return _0x1254e2(_0x2af144,_0x3d1508);},'QOviO':'ranger\x20profile\x20add\x20<name>','BApGH':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','ujFjL':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','JTaOO':_0x2ba3f1(0x21f),'FUdku':'/ranger:enable','JRrvj':function(_0x3b1526,_0x15a299){return _0x3b1526+_0x15a299;}};console[_0x2ba3f1(0x1f6)]('\x0a🚀\x20Ranger\x20Setup\x0a');_0x2cf2b6[_0x2ba3f1(0x214)](_0x47dd86?.['scope'],undefined)&&_0x47dd86['scope']!==_0x2cf2b6['sKOGq']&&(console['error'](_0x2cf2b6['SqdcA'](_0x2ba3f1(0x216)+_0x2cf2b6[_0x2ba3f1(0x207)](String,_0x47dd86[_0x2ba3f1(0x1cd)])+_0x2ba3f1(0x1cf)+_0x2ba3f1(0x204),'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.')),process[_0x2ba3f1(0x218)](0x1));_0x47dd86={..._0x47dd86,'scope':_0x2ba3f1(0x1ec)};const _0x5b4808=!_0x2cf2b6['chrpk'](existsSync,getRangerHomeDir());await _0x2cf2b6[_0x2ba3f1(0x207)](ensureRangerDir,'user');if(_0x47dd86?.['skipAuth'])console[_0x2ba3f1(0x1f6)](_0x2cf2b6[_0x2ba3f1(0x225)]),_0x552cac?.['trackPhaseEnd'](_0x2cf2b6[_0x2ba3f1(0x1e1)],{'isFirstRun':_0x5b4808,'method':_0x2ba3f1(0x20a)});else{_0x552cac?.[_0x2ba3f1(0x1fa)]('auth');const _0x2fcc1e=await _0x2cf2b6[_0x2ba3f1(0x202)](authenticate,_0x5d085a);_0x552cac?.[_0x2ba3f1(0x21b)]('auth',{'isFirstRun':_0x5b4808,'method':_0x2fcc1e[_0x2ba3f1(0x1ce)]});}_0x552cac?.[_0x2ba3f1(0x1fa)](_0x2ba3f1(0x1ee));_0x47dd86?.['skipChromium']?console['log'](_0x2cf2b6['tVktJ']):await ensureChromium(_0x47dd86?.[_0x2ba3f1(0x213)]);_0x552cac?.[_0x2ba3f1(0x21b)](_0x2cf2b6[_0x2ba3f1(0x1e4)],{'isFirstRun':_0x5b4808,'skipped':!!_0x47dd86?.['skipChromium']}),console[_0x2ba3f1(0x1f6)]('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0x21e83f=_0x47dd86?.[_0x2ba3f1(0x1cd)],_0xf0e91=_0x47dd86?.[_0x2ba3f1(0x212)]??![];let _0x23c858=null;_0xf0e91?(_0x552cac?.[_0x2ba3f1(0x1fa)](_0x2cf2b6[_0x2ba3f1(0x1d9)]),_0x23c858=await ensureOpencodePluginConfig(_0x21e83f),_0x552cac?.[_0x2ba3f1(0x21b)](_0x2cf2b6[_0x2ba3f1(0x1d9)],{'isFirstRun':_0x5b4808,'opencode':!![]})):(_0x552cac?.[_0x2ba3f1(0x1fa)](_0x2cf2b6['bqilY']),await _0x2cf2b6[_0x2ba3f1(0x224)](ensureClaudePlugin,_0x21e83f),_0x552cac?.[_0x2ba3f1(0x21b)](_0x2cf2b6[_0x2ba3f1(0x1d9)],{'isFirstRun':_0x5b4808}));if(_0x2cf2b6['koAxF'](_0xf0e91,_0x23c858)){_0x552cac?.['trackPhaseStart'](_0x2cf2b6['PLtrx']);try{await installSkill(_0x2cf2b6['oaoci'],{'level':_0x23c858['scope'],'cliVersion':_0x2cf2b6['aQSRs'](getCurrentVersion),'platform':'opencode'}),_0x552cac?.[_0x2ba3f1(0x21b)](_0x2ba3f1(0x20b),{'isFirstRun':_0x5b4808,'opencode':!![]});}catch(_0x582225){console[_0x2ba3f1(0x201)](_0x2ba3f1(0x22a),_0x582225 instanceof Error?_0x582225[_0x2ba3f1(0x1ea)]:_0x582225),_0x552cac?.['trackPhaseEnd'](_0x2cf2b6['PLtrx'],{'isFirstRun':_0x5b4808,'opencode':!![],'failed':!![]});}}else _0x552cac?.['trackPhaseStart'](_0x2ba3f1(0x20b)),await ensureClaudeSkills(_0x21e83f),_0x552cac?.[_0x2ba3f1(0x21b)]('skills',{'isFirstRun':_0x5b4808});if(_0x47dd86?.['skipAuth'])console[_0x2ba3f1(0x1f6)](_0x2cf2b6[_0x2ba3f1(0x226)]);else{if(_0x47dd86?.[_0x2ba3f1(0x1cb)]){_0x552cac?.[_0x2ba3f1(0x1fa)](_0x2ba3f1(0x20e));const _0x1785ad=await _0x2cf2b6['zISiS'](ensureLocalEnv,{'url':_0x47dd86[_0x2ba3f1(0x1cb)],'force':_0x47dd86?.['force'],'allowInsecureLocalhost':_0x47dd86?.['allowInsecureLocalhost'],'scope':'user'},_0x552cac);_0x552cac?.[_0x2ba3f1(0x21b)](_0x2ba3f1(0x20e),{'isFirstRun':_0x5b4808,'profileReady':_0x1785ad[_0x2ba3f1(0x206)],'userSkipped':_0x1785ad['skipped']});}else console[_0x2ba3f1(0x1f6)](_0x2cf2b6['SqdcA'](_0x2ba3f1(0x1f0),'\x0a\x20\x20'+bold(_0x2cf2b6['QOviO']))+'\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(_0xf0e91)console['log']('\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)'),console['log'](_0x2cf2b6['BApGH']),console[_0x2ba3f1(0x1f6)](_0x2cf2b6['ujFjL']),console[_0x2ba3f1(0x1f6)](_0x2cf2b6['JTaOO']);else{const _0x1e6642=_0x2cf2b6['uaVCD'](bold,_0x2cf2b6['FUdku']);console['log'](_0x2cf2b6[_0x2ba3f1(0x211)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x1e6642+'\x20and\x20prompt\x20the\x20coding'+_0x2ba3f1(0x1fd)+'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser',_0x2ba3f1(0x1d8)));}}
|
|
1
|
+
(function(_0x2a448f,_0x2051cd){const _0x291b28=_0x12ba,_0x5c4609=_0x2a448f();while(!![]){try{const _0x48be58=parseInt(_0x291b28(0x1cf))/0x1*(parseInt(_0x291b28(0x1a4))/0x2)+parseInt(_0x291b28(0x1a2))/0x3*(parseInt(_0x291b28(0x1d1))/0x4)+-parseInt(_0x291b28(0x1d6))/0x5*(parseInt(_0x291b28(0x1bc))/0x6)+parseInt(_0x291b28(0x1bf))/0x7*(parseInt(_0x291b28(0x1b1))/0x8)+parseInt(_0x291b28(0x1e9))/0x9+-parseInt(_0x291b28(0x1ff))/0xa*(-parseInt(_0x291b28(0x1c0))/0xb)+-parseInt(_0x291b28(0x1fc))/0xc;if(_0x48be58===_0x2051cd)break;else _0x5c4609['push'](_0x5c4609['shift']());}catch(_0x512093){_0x5c4609['push'](_0x5c4609['shift']());}}}(_0xa85a,0x26a8f));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x4c2724 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x54695c=>'\x1b[1m'+_0x54695c+'\x1b[0m';export function getPlaywrightVersion(){try{const _0x589e13=require['resolve']('playwright/package.json'),_0xee4670=require(_0x589e13);return _0xee4670['version'];}catch{return null;}}export function installChromiumBinary(_0x1ed062,_0x34e810=![]){const _0x1962b7={'VwsiW':function(_0x2bebf4,_0xaecbb9){return _0x2bebf4(_0xaecbb9);},'zAEAx':function(_0x59a156,_0x2817c9){return _0x59a156(_0x2817c9);},'WJRnW':'--with-deps','FRGLO':function(_0xee57c6,_0x140fb5,_0x5000b8,_0x28a3cf){return _0xee57c6(_0x140fb5,_0x5000b8,_0x28a3cf);},'DoVmQ':'ignore','MYJAq':'inherit','ebqxS':function(_0x15b610,_0x46dd06){return _0x15b610===_0x46dd06;}};return new Promise((_0x1f9529,_0x4cd275)=>{const _0x30859d=_0x12ba,_0x4feff5=[_0x30859d(0x1d5)+_0x1ed062,'install',..._0x34e810?[_0x1962b7['WJRnW']]:[],'chromium'],_0x197c5d=_0x1962b7['FRGLO'](spawn,'npx',_0x4feff5,{'stdio':[_0x1962b7['DoVmQ'],_0x1962b7['MYJAq'],_0x30859d(0x1b4)],'shell':_0x1962b7['ebqxS'](process[_0x30859d(0x1e8)],'win32')});_0x197c5d['on']('close',_0x29a6ff=>{const _0x178985=_0x30859d;_0x29a6ff===0x0?_0x1f9529():_0x1962b7[_0x178985(0x1b0)](_0x4cd275,new Error(_0x178985(0x1f0)+_0x29a6ff));}),_0x197c5d['on'](_0x30859d(0x1c5),_0x2aca6d=>{const _0x2a35b4=_0x30859d;_0x1962b7[_0x2a35b4(0x1c4)](_0x4cd275,_0x2aca6d);});});}export async function authenticate(_0x24b236){const _0x31feaf=_0x12ba,_0x1f784b={'YarAj':function(_0xbe3e83){return _0xbe3e83();},'vzvLF':function(_0x2f1b9c,_0x2ba19b){return _0x2f1b9c instanceof _0x2ba19b;},'JlVMg':_0x31feaf(0x19b),'AugpI':function(_0x59b35c,_0x528cf5){return _0x59b35c(_0x528cf5);},'LbnyB':function(_0x3428b9,_0x1913c1){return _0x3428b9(_0x1913c1);},'btihF':'✓\x20Exported\x20credentials\x20for\x20CI','iQjnV':'✓\x20Stored\x20credentials\x20locally'};if(!_0x24b236){const _0x4885a2=await getToken();if(_0x4885a2){const _0x5519e7=await getCurrentUser(_0x4885a2);if(_0x5519e7['success'])return console['log'](_0x31feaf(0x1e2)+_0x5519e7['user']['organizationName']),{'token':_0x4885a2,'method':'existing_token'};}try{_0x24b236=await _0x1f784b['YarAj'](runDeviceAuthFlow);}catch(_0x4a3454){throw new Error(_0x31feaf(0x1e7)+(_0x1f784b[_0x31feaf(0x1ce)](_0x4a3454,Error)?_0x4a3454[_0x31feaf(0x1a9)]:_0x4a3454));}const _0x453a45=await getCurrentUser(_0x24b236);if(!_0x453a45['success'])throw new Error(_0x31feaf(0x1f2)+_0x453a45[_0x31feaf(0x1c5)]);return console['log'](_0x31feaf(0x1eb)+_0x453a45['user']['organizationName']),{'token':_0x24b236,'method':_0x31feaf(0x1d9)};}console[_0x31feaf(0x1e1)](_0x1f784b[_0x31feaf(0x1f3)]);const _0x5166d5=await _0x1f784b[_0x31feaf(0x1ee)](getCurrentUser,_0x24b236);if(!_0x5166d5[_0x31feaf(0x1ab)]){if(_0x5166d5['status'])throw new Error('Authentication\x20failed:\x20'+_0x5166d5['error']+_0x31feaf(0x1ed));else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x5166d5['error']+'.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.');}return console['log'](_0x31feaf(0x1eb)+_0x5166d5['user'][_0x31feaf(0x1fe)]),await _0x1f784b[_0x31feaf(0x199)](storeToken,_0x24b236),console['log'](process[_0x31feaf(0x1d7)]['GITHUB_ENV']?_0x1f784b['btihF']:_0x1f784b['iQjnV']),{'token':_0x24b236,'method':'provided_token'};}function _0xa85a(){const _0x25168f=['✓\x20Authenticated\x20to\x20','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','AugpI','HSgbs','Installation\x20failed\x20with\x20exit\x20code\x20','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','JlVMg','install','withDeps','qECXP','UiVVB','fJJyv','DUAxn','✓\x20Created\x20~/.ranger/\x20directory','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','10338492BlRzAZ','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','organizationName','10YONLiq','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','user','cFqMN','LbnyB','method','Validating\x20API\x20token...','CXfle','plugin','kznyj','trackPhaseEnd','chromium','PEojV','3Upxyck','sJKDC','2hpsAtg','✓\x20Playwright\x20Chromium\x20browser\x20found','scope','\x20install\x20chromium','profile','message','rWfgu','success','oDgiq','DjNwT','Kalig','MPhbT','VwsiW','96440JrMcwn','exit','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','inherit','✓\x20~/.ranger/\x20directory\x20already\x20exists','skipAuth','\x20\x20npx\x20playwright@','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','.gitignore','GBBEz','skills','348dsJxpC','ranger\x20profile\x20add\x20<name>','oxCIW','133GJPoxm','2165977odfEZE','The\x20required\x20version\x20(','ilobe','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','zAEAx','error','ready','force','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','mxINu','eljJY','\x0a⚠\x20Skipping\x20Chromium\x20installation.','auth','trackPhaseStart','vzvLF','90801FvWkIq','allowInsecureLocalhost','1025476JlMcFc','oahsh','skipChromium','...','playwright@','1195NWapcv','env','klgzX','device_auth','opencode','skipped','\x20and\x20prompt\x20the\x20coding','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','QHQRx','You\x20can\x20install\x20it\x20manually\x20by\x20running:','\x0a🚀\x20Ranger\x20Setup\x0a','log','✓\x20Already\x20authenticated\x20to\x20','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','GGPRw','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','Authentication\x20failed:\x20','platform','2345688vJsokw','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'];_0xa85a=function(){return _0x25168f;};return _0xa85a();}function _0x12ba(_0xd9a340,_0x2e3851){_0xd9a340=_0xd9a340-0x199;const _0xa85a69=_0xa85a();let _0x12baa0=_0xa85a69[_0xd9a340];return _0x12baa0;}export async function ensureRangerDir(_0x544878){const _0x5bcb99=_0x12ba,_0x440e95={'kznyj':_0x5bcb99(0x1fa)};void _0x544878;const _0x3de11b=getRangerHomeDir();return!existsSync(_0x3de11b)?(await mkdir(_0x3de11b,{'recursive':!![]}),console[_0x5bcb99(0x1e1)](_0x440e95[_0x5bcb99(0x19e)]),{'path':_0x3de11b,'installed':!![]}):(console['log'](_0x5bcb99(0x1b5)),{'path':_0x3de11b,'installed':![]});}export async function ensureChromium(_0x180f9c=![]){const _0x12f677=_0x12ba,_0x996f87={'yddUx':function(_0x575367,_0x307490){return _0x575367(_0x307490);},'Nwelb':_0x12f677(0x1a5),'WOiSW':function(_0x3b02a2){return _0x3b02a2();},'jRfca':function(_0x2f8b6c,_0x4c257c){return _0x2f8b6c??_0x4c257c;},'cFqMN':'confirm','DUAxn':'\x20(fallback\x20version)','awiVQ':'\x0aInstalling\x20Chromium\x20browser...\x0a','FEcUs':function(_0x28819f,_0x37290f,_0x1dc9f){return _0x28819f(_0x37290f,_0x1dc9f);},'oDgiq':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','oahsh':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','DjNwT':function(_0x16b3a7,_0x40a6db){return _0x16b3a7 instanceof _0x40a6db;},'hqHxr':_0x12f677(0x1df),'GBBEz':_0x12f677(0x1e5)};let _0x28d960=![];try{const _0x2aebc0=chromium['executablePath']();_0x28d960=_0x996f87['yddUx'](existsSync,_0x2aebc0);}catch{_0x28d960=![];}if(_0x28d960)return console['log'](_0x996f87['Nwelb']),![];const _0x54aed3=_0x996f87['WOiSW'](getPlaywrightVersion),_0x592f29=_0x996f87['jRfca'](_0x54aed3,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x3b4d5d=!_0x54aed3,_0x1153ae=process['stdin']['isTTY']&&process['stdout']['isTTY'];let _0x36b858=!![];if(_0x1153ae){const {install:_0x1af919}=await _0x4c2724['prompt']([{'type':_0x996f87[_0x12f677(0x202)],'name':_0x12f677(0x1f4),'message':_0x3b4d5d?_0x12f677(0x1fd)+_0x592f29+'\x20now?':_0x12f677(0x1c1)+_0x592f29+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x36b858=_0x1af919;}else console[_0x12f677(0x1e1)](_0x12f677(0x1c8)+_0x592f29+(_0x3b4d5d?_0x996f87[_0x12f677(0x1f9)]:'')+_0x12f677(0x1d4));if(_0x36b858){console['log'](_0x996f87['awiVQ']);try{await _0x996f87['FEcUs'](installChromiumBinary,_0x592f29,_0x180f9c),console[_0x12f677(0x1e1)](_0x996f87[_0x12f677(0x1ac)]);}catch(_0x53d257){console[_0x12f677(0x1c5)](_0x996f87[_0x12f677(0x1d2)],_0x996f87[_0x12f677(0x1ad)](_0x53d257,Error)?_0x53d257[_0x12f677(0x1a9)]:_0x53d257),console['log'](_0x996f87['hqHxr']),console[_0x12f677(0x1e1)](_0x12f677(0x1b7)+_0x592f29+_0x12f677(0x1a7));}}else console[_0x12f677(0x1e1)](_0x12f677(0x1cb)),console['log'](_0x996f87[_0x12f677(0x1ba)]),console[_0x12f677(0x1e1)](_0x12f677(0x1b7)+_0x592f29+_0x12f677(0x1a7));return!![];}export async function writeRangerGitignore(_0x432a63){const _0xf8b95b=_0x12ba,_0x2dfc81={'SMGZe':_0xf8b95b(0x1b9),'UiVVB':function(_0x465af5,_0x1836bf,_0x2f71ac){return _0x465af5(_0x1836bf,_0x2f71ac);},'klgzX':'✓\x20Created\x20.ranger/.gitignore'},_0x4eb6ea=join(_0x432a63,_0x2dfc81['SMGZe']),_0x469c25='\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 _0x2dfc81[_0xf8b95b(0x1f7)](writeFile,_0x4eb6ea,_0x469c25),console['log'](_0x2dfc81[_0xf8b95b(0x1d8)]);}export async function ensureLocalEnv(_0x536d5e,_0x14bd16){const _0x2583e=_0x12ba,_0x1607dd={'QHQRx':function(_0x4f9918){return _0x4f9918();},'mqVkW':function(_0x27dbc0,_0x131b8f){return _0x27dbc0!==_0x131b8f;},'PEojV':_0x2583e(0x201),'Kalig':'local','TsCGZ':'✓\x20Local\x20profile\x20already\x20exists','cIlMP':function(_0x5b4758,_0x34f5ec,_0x47edcf,_0x3c0617){return _0x5b4758(_0x34f5ec,_0x47edcf,_0x3c0617);}};if(!_0x1607dd[_0x2583e(0x1de)](findGitRoot)&&_0x1607dd['mqVkW'](_0x536d5e?.['scope'],_0x1607dd[_0x2583e(0x1a1)]))return console['log'](_0x2583e(0x1ec)),{'ready':![],'skipped':!![]};const _0x2acbf6=_0x536d5e?.['scope']==='user'?getRangerHomeDir():undefined;if(findExistingEnv('local',{'locations':[_0x1607dd[_0x2583e(0x1ae)]],'rangerDir':_0x2acbf6}))return console['log'](_0x1607dd['TsCGZ']),{'ready':!![],'skipped':![]};try{return await _0x1607dd['cIlMP'](addEnv,'local',{'url':_0x536d5e?.['url'],'force':_0x536d5e?.[_0x2583e(0x1c7)],'allowInsecureLocalhost':_0x536d5e?.[_0x2583e(0x1d0)],'scope':_0x536d5e?.[_0x2583e(0x1a6)]},_0x14bd16),{'ready':!![],'skipped':![]};}catch(_0x32fe9c){return console['error']('\x0a❌\x20Profile\x20setup\x20failed:',_0x32fe9c instanceof Error?_0x32fe9c[_0x2583e(0x1a9)]:_0x32fe9c),{'ready':![],'skipped':![]};}}export async function start(_0x4681dd,_0xc91495,_0x3e62bd){const _0x19d97d=_0x12ba,_0x55d538={'JdLjf':function(_0x3bdfff,_0x1811bb){return _0x3bdfff!==_0x1811bb;},'dSQVj':function(_0x47d3ae,_0x2dc240){return _0x47d3ae+_0x2dc240;},'OjKfG':function(_0x180e47,_0x27b9b2){return _0x180e47+_0x27b9b2;},'rWfgu':function(_0x3a866c,_0x311af2){return _0x3a866c(_0x311af2);},'HSgbs':'user','oxCIW':function(_0x562830){return _0x562830();},'nAfdU':_0x19d97d(0x1cc),'CXfle':_0x19d97d(0x1db),'zDVmR':'chromium','sJKDC':_0x19d97d(0x1b3),'GGPRw':function(_0x3fd5c5,_0x251f33){return _0x3fd5c5(_0x251f33);},'mxINu':'\x0a✅\x20Ranger\x20setup\x20complete!\x0a','MPhbT':_0x19d97d(0x19d),'MRXAL':function(_0xd80e92,_0x3d93b7,_0x2d0c83){return _0xd80e92(_0x3d93b7,_0x2d0c83);},'qECXP':'ranger','WkQrv':_0x19d97d(0x1dd),'eljJY':'skills','fJJyv':'\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','ilobe':function(_0x5de278,_0x1499e0){return _0x5de278+_0x1499e0;},'fGZXQ':_0x19d97d(0x1bd),'tsGPP':_0x19d97d(0x1c3),'PtBBw':function(_0xb0f437,_0x4167da){return _0xb0f437+_0x4167da;}};console[_0x19d97d(0x1e1)](_0x19d97d(0x1e0));_0x55d538['JdLjf'](_0xc91495?.[_0x19d97d(0x1a6)],undefined)&&_0xc91495['scope']!=='user'&&(console[_0x19d97d(0x1c5)](_0x55d538['dSQVj'](_0x55d538['OjKfG']('ranger\x20setup\x20--scope='+_0x55d538[_0x19d97d(0x1aa)](String,_0xc91495['scope'])+'\x20is\x20no\x20longer\x20supported.\x20','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20'),'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.')),process[_0x19d97d(0x1b2)](0x1));_0xc91495={..._0xc91495,'scope':_0x55d538[_0x19d97d(0x1ef)]};const _0xc8cc2d=!_0x55d538[_0x19d97d(0x1aa)](existsSync,_0x55d538[_0x19d97d(0x1be)](getRangerHomeDir));await ensureRangerDir(_0x19d97d(0x201));if(_0xc91495?.[_0x19d97d(0x1b6)])console['log']('✓\x20Skipping\x20authentication\x20(--skip-auth)'),_0x3e62bd?.[_0x19d97d(0x19f)](_0x55d538['nAfdU'],{'isFirstRun':_0xc8cc2d,'method':_0x55d538[_0x19d97d(0x19c)]});else{_0x3e62bd?.[_0x19d97d(0x1cd)](_0x19d97d(0x1cc));const _0x38b8a9=await authenticate(_0x4681dd);_0x3e62bd?.['trackPhaseEnd'](_0x19d97d(0x1cc),{'isFirstRun':_0xc8cc2d,'method':_0x38b8a9[_0x19d97d(0x19a)]});}_0x3e62bd?.[_0x19d97d(0x1cd)](_0x55d538['zDVmR']);_0xc91495?.['skipChromium']?console[_0x19d97d(0x1e1)](_0x55d538[_0x19d97d(0x1a3)]):await _0x55d538[_0x19d97d(0x1e4)](ensureChromium,_0xc91495?.[_0x19d97d(0x1f5)]);_0x3e62bd?.['trackPhaseEnd'](_0x19d97d(0x1a0),{'isFirstRun':_0xc8cc2d,'skipped':!!_0xc91495?.[_0x19d97d(0x1d3)]}),console[_0x19d97d(0x1e1)](_0x55d538[_0x19d97d(0x1c9)]);const _0x29e2fd=_0xc91495?.[_0x19d97d(0x1a6)],_0x1504f7=_0xc91495?.[_0x19d97d(0x1da)]??![];let _0xc880b5=null;_0x1504f7?(_0x3e62bd?.['trackPhaseStart']('plugin'),_0xc880b5=await ensureOpencodePluginConfig(_0x29e2fd),_0x3e62bd?.['trackPhaseEnd'](_0x55d538['MPhbT'],{'isFirstRun':_0xc8cc2d,'opencode':!![]})):(_0x3e62bd?.[_0x19d97d(0x1cd)]('plugin'),await ensureClaudePlugin(_0x29e2fd),_0x3e62bd?.[_0x19d97d(0x19f)](_0x55d538[_0x19d97d(0x1af)],{'isFirstRun':_0xc8cc2d}));if(_0x1504f7&&_0xc880b5){_0x3e62bd?.[_0x19d97d(0x1cd)](_0x19d97d(0x1bb));try{await _0x55d538['MRXAL'](installSkill,_0x55d538[_0x19d97d(0x1f6)],{'level':_0xc880b5['scope'],'cliVersion':getCurrentVersion(),'platform':'opencode'}),_0x3e62bd?.['trackPhaseEnd'](_0x19d97d(0x1bb),{'isFirstRun':_0xc8cc2d,'opencode':!![]});}catch(_0x51d9f2){console['warn'](_0x55d538['WkQrv'],_0x51d9f2 instanceof Error?_0x51d9f2['message']:_0x51d9f2),_0x3e62bd?.[_0x19d97d(0x19f)](_0x55d538['eljJY'],{'isFirstRun':_0xc8cc2d,'opencode':!![],'failed':!![]});}}else _0x3e62bd?.['trackPhaseStart'](_0x19d97d(0x1bb)),await _0x55d538[_0x19d97d(0x1aa)](ensureClaudeSkills,_0x29e2fd),_0x3e62bd?.['trackPhaseEnd'](_0x55d538[_0x19d97d(0x1ca)],{'isFirstRun':_0xc8cc2d});if(_0xc91495?.['skipAuth'])console[_0x19d97d(0x1e1)](_0x55d538[_0x19d97d(0x1f8)]);else{if(_0xc91495?.['url']){_0x3e62bd?.[_0x19d97d(0x1cd)](_0x19d97d(0x1a8));const _0x15b54e=await ensureLocalEnv({'url':_0xc91495['url'],'force':_0xc91495?.[_0x19d97d(0x1c7)],'allowInsecureLocalhost':_0xc91495?.['allowInsecureLocalhost'],'scope':'user'},_0x3e62bd);_0x3e62bd?.['trackPhaseEnd']('profile',{'isFirstRun':_0xc8cc2d,'profileReady':_0x15b54e[_0x19d97d(0x1c6)],'userSkipped':_0x15b54e[_0x19d97d(0x1db)]});}else console[_0x19d97d(0x1e1)](_0x55d538['ilobe'](_0x55d538['dSQVj'](_0x55d538[_0x19d97d(0x1c2)]('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','\x0a\x20\x20'+bold(_0x55d538['fGZXQ'])),_0x19d97d(0x200))+_0x19d97d(0x1fb),_0x19d97d(0x1f1)));}if(_0x1504f7)console[_0x19d97d(0x1e1)](_0x19d97d(0x1e6)),console[_0x19d97d(0x1e1)]('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console['log'](_0x19d97d(0x1b8)),console['log'](_0x55d538['tsGPP']);else{const _0x586c49=bold('/ranger:enable');console['log'](_0x55d538['PtBBw']('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x586c49+_0x19d97d(0x1dc)+_0x19d97d(0x1e3),'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser')+_0x19d97d(0x1ea));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x25c6fa=_0x9e42;(function(_0x517c61,_0x4f1997){const _0x458a48=_0x9e42,_0x3de672=_0x517c61();while(!![]){try{const _0x2f083d=parseInt(_0x458a48(0x1de))/0x1+-parseInt(_0x458a48(0x17f))/0x2*(-parseInt(_0x458a48(0x19f))/0x3)+-parseInt(_0x458a48(0x18d))/0x4*(parseInt(_0x458a48(0x1d7))/0x5)+parseInt(_0x458a48(0x1c6))/0x6*(-parseInt(_0x458a48(0x1b6))/0x7)+parseInt(_0x458a48(0x17c))/0x8+-parseInt(_0x458a48(0x1bb))/0x9*(-parseInt(_0x458a48(0x1d3))/0xa)+-parseInt(_0x458a48(0x1d2))/0xb;if(_0x2f083d===_0x4f1997)break;else _0x3de672['push'](_0x3de672['shift']());}catch(_0x238476){_0x3de672['push'](_0x3de672['shift']());}}}(_0x19da,0x9aa3f));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';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=_0x2b5cc7=>'\x1b[1m'+_0x2b5cc7+_0x25c6fa(0x17d),link=(_0x3738e3,_0x565cb9)=>_0x25c6fa(0x1bc)+_0x3738e3+'\x07'+(_0x565cb9||_0x3738e3)+_0x25c6fa(0x197);async function getOpencodePluginStatus(){const _0x3366c0=_0x25c6fa,_0x2b993e={'XtTuk':function(_0x5d9667,_0x13de9e){return _0x5d9667(_0x13de9e);},'GzvxX':function(_0x30bb6b,_0x41a579){return _0x30bb6b!==_0x41a579;},'fDZcR':'@ranger-testing/opencode-plugin','NIefY':function(_0x2665cc,_0x4e4839){return _0x2665cc>_0x4e4839;},'PmTov':_0x3366c0(0x17a),'MhtUI':function(_0x4525f8,_0x41b773,_0x2070d0,_0x99ba90){return _0x4525f8(_0x41b773,_0x2070d0,_0x99ba90);},'PODpH':'pipe','oHAWO':_0x3366c0(0x1ca),'jSCUU':_0x3366c0(0x19c)};return new Promise(_0x5ba450=>{const _0x1cf8c2=_0x3366c0,_0x23e9f6={'Novhj':function(_0x44a0a1,_0x1db13b){const _0x5f4bfb=_0x9e42;return _0x2b993e[_0x5f4bfb(0x18f)](_0x44a0a1,_0x1db13b);},'JPcqd':function(_0x211688,_0x560a5e){return _0x2b993e['GzvxX'](_0x211688,_0x560a5e);},'geNtG':_0x2b993e['fDZcR'],'sxjvT':'configured','FeaxC':function(_0x1def64,_0x304746){return _0x2b993e['NIefY'](_0x1def64,_0x304746);},'vsBLo':_0x2b993e['PmTov']},_0x5d8021=_0x2b993e[_0x1cf8c2(0x1d5)](spawn,'opencode',['debug',_0x1cf8c2(0x187)],{'stdio':['ignore','pipe',_0x2b993e[_0x1cf8c2(0x1b2)]]});let _0x1e0b30='';_0x5d8021[_0x1cf8c2(0x1c1)]?.['on'](_0x2b993e['oHAWO'],_0x10758a=>{_0x1e0b30+=_0x10758a['toString']();}),_0x5d8021[_0x1cf8c2(0x1a2)]?.['on']('data',_0x414ab9=>{_0x1e0b30+=_0x414ab9['toString']();}),_0x5d8021['on'](_0x1cf8c2(0x1b1),()=>{const _0x28c374=_0x1cf8c2;_0x23e9f6['Novhj'](_0x5ba450,{'status':_0x28c374(0x194)});}),_0x5d8021['on'](_0x2b993e['jSCUU'],_0x67d1b5=>{const _0x212f7b=_0x1cf8c2;if(_0x67d1b5!==0x0){_0x23e9f6[_0x212f7b(0x173)](_0x5ba450,{'status':_0x212f7b(0x194)});return;}const _0x300e27=_0x1e0b30[_0x212f7b(0x176)]();let _0x19031e=null;if(_0x300e27)try{_0x19031e=JSON[_0x212f7b(0x1c5)](_0x300e27);}catch{const _0xee0e1b=_0x300e27['match'](/\{[\s\S]*\}$/);if(_0xee0e1b)try{_0x19031e=JSON[_0x212f7b(0x1c5)](_0xee0e1b[0x0]);}catch{_0x19031e=null;}}const _0x5eb7cc=Array[_0x212f7b(0x1a8)](_0x19031e?.['plugin'])?_0x19031e?.[_0x212f7b(0x1dd)]:[],_0x4f5169=_0x5eb7cc[_0x212f7b(0x177)](_0x5626b6=>{if(_0x23e9f6['JPcqd'](typeof _0x5626b6,'string'))return![];return _0x5626b6['includes'](_0x23e9f6['geNtG'])||_0x5626b6['includes']('opencode-plugin');});if(_0x4f5169){_0x23e9f6[_0x212f7b(0x173)](_0x5ba450,{'status':_0x23e9f6['sxjvT'],'details':_0x23e9f6['FeaxC'](_0x5eb7cc[_0x212f7b(0x170)],0x0)?_0x5eb7cc[_0x212f7b(0x170)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x5eb7cc[_0x212f7b(0x170)]>0x0){_0x5ba450({'status':_0x23e9f6['vsBLo'],'details':_0x5eb7cc['length']+_0x212f7b(0x195)});return;}_0x5ba450({'status':'not_configured'});});});}function _0x19da(){const _0x52f5db=['displayName','8DlTZOT','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','XtTuk','CQfTS','scope','includes','version','not_installed','\x20plugin(s)\x20configured','enabled','\x1b]8;;\x07','isDirectory','@ranger-testing/opencode-plugin','project','filter','close','RrFHy','\x20\x20User-level:','9xTUihS','hasEncryptedAuth','unknown','stderr','sbWap','API\x20Environment:\x20','auth.json','bKGKB','Root:\x20','isArray','\x20\x20Project-level:','push','cwd','(not\x20found)','\x20(active)','NKxhn','\x20\x20Run:\x20ranger\x20setup\x20[token]','details','error','PODpH','\x20\x20Run:\x20ranger\x20setup\x20--opencode','log','isActive','6692791iLLLdh','\x0a---\x20OpenCode\x20Plugin\x20---','ranger@trailhead','aMEBx','match','1665uceaLH','\x1b]8;;file://','all','OeJpR','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','hasPlaintextAuth','stdout','SKILL.md','\x20\x20\x20\x20Session:\x20','name','parse','6VJIwMi','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','success','GaApE','data','\x20(latest:\x20','status','RrAfC','path','vltBa','\x20[local]','ipDoE','4618691KKvNBf','24430nudKfM','\x20\x20\x20\x20','MhtUI','sessionUpdatedAt','97400pLWelG','no\x20session','pGhar','xBtgr','auth.json.enc','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','plugin','832746RtCOtr','length','has','join','Novhj','API\x20URL:\x20','env','trim','some','plaintext','\x20\x20Not\x20configured','not_configured','user','1689512DxxhRw','\x1b[0m','cached\x20(updated\x20','368314FvtsUf','No\x20profiles\x20configured','vxEZL','\x0a---\x20Claude\x20Code\x20Plugin\x20---','YAWCI','utf-8','map','Organization:\x20','config','organizationName','\x20[cloud]','No\x20skills\x20installed','sRfNk'];_0x19da=function(){return _0x52f5db;};return _0x19da();}async function getSkillsFromDir(_0x69dccd,_0x473d52){const _0x84afa3=_0x25c6fa,_0x33f711={'JJUmC':function(_0x4d8ace,_0x449827){return _0x4d8ace(_0x449827);},'ipDoE':function(_0x269f05,_0xf9b8c5,_0x42d9ec){return _0x269f05(_0xf9b8c5,_0x42d9ec);},'RrFHy':_0x84afa3(0x1c2),'YAWCI':_0x84afa3(0x184)};if(!_0x33f711['JJUmC'](existsSync,_0x69dccd))return[];const _0x382557=[];try{const _0x2917a4=await _0x33f711[_0x84afa3(0x1d1)](readdir,_0x69dccd,{'withFileTypes':!![]});for(const _0x32202e of _0x2917a4){if(_0x32202e[_0x84afa3(0x198)]()){const _0x3117d3=join(_0x69dccd,_0x32202e[_0x84afa3(0x1c4)],_0x33f711[_0x84afa3(0x19d)]);if(existsSync(_0x3117d3)){let _0x558486=_0x32202e[_0x84afa3(0x1c4)];try{const _0x5bee68=await readFile(_0x3117d3,_0x33f711[_0x84afa3(0x183)]),_0x18ef58=_0x5bee68[_0x84afa3(0x1ba)](/name:\s*(.+)/);_0x18ef58&&(_0x558486=_0x18ef58[0x1]['trim']());}catch{}_0x382557['push']({'name':_0x32202e['name'],'displayName':_0x558486,'path':_0x3117d3,'level':_0x473d52});}}}}catch{return[];}return _0x382557;}async function getInstalledSkills(){const _0x58dd7c=_0x25c6fa,_0x2528a3={'FZizg':function(_0x162284,_0x11df9b,_0xb5a761){return _0x162284(_0x11df9b,_0xb5a761);},'NZTZB':function(_0x4283d5){return _0x4283d5();},'GaApE':_0x58dd7c(0x19a),'OeJpR':'user'},[_0x11e7a,_0x40412e]=await Promise[_0x58dd7c(0x1bd)]([_0x2528a3['FZizg'](getSkillsFromDir,_0x2528a3['NZTZB'](getProjectSkillsDir),_0x2528a3[_0x58dd7c(0x1c9)]),_0x2528a3['FZizg'](getSkillsFromDir,getUserSkillsDir(),_0x2528a3[_0x58dd7c(0x1be)])]);return{'project':_0x11e7a,'user':_0x40412e};}function _0x9e42(_0x2f3ba8,_0x3d7be2){_0x2f3ba8=_0x2f3ba8-0x170;const _0x19da2d=_0x19da();let _0x9e420d=_0x19da2d[_0x2f3ba8];return _0x9e420d;}async function getEnvironments(){const _0x3b5e20=_0x25c6fa,_0x419dda={'GIgDc':function(_0x5a3727,_0x597dad){return _0x5a3727(_0x597dad);},'dcGeY':_0x3b5e20(0x1db),'wejfD':function(_0xf14de0,_0x2eae64){return _0xf14de0(_0x2eae64);},'wDZth':function(_0x4d8876,_0x513b0d){return _0x4d8876===_0x513b0d;}},{envNames:_0x206274,activeEnv:_0x5d6d69}=await getEnvNames(),_0x51b94a=getRangerDir();if(!existsSync(_0x51b94a))return{'envs':[],'activeEnv':null};const _0x8f236e=_0x206274[_0x3b5e20(0x185)](_0x2f84c9=>{const _0x5d525b=_0x3b5e20,_0x51c58f=_0x419dda['GIgDc'](getEnvDir,_0x2f84c9),_0x48f1b3=join(_0x51c58f,'settings.json'),_0x5d5e3e=join(_0x51c58f,_0x5d525b(0x1a5)),_0x375c9c=join(_0x51c58f,_0x419dda['dcGeY']);return{'name':_0x2f84c9,'settingsPath':existsSync(_0x48f1b3)?_0x48f1b3:_0x5d525b(0x1ac),'hasPlaintextAuth':_0x419dda['wejfD'](existsSync,_0x5d5e3e),'hasEncryptedAuth':existsSync(_0x375c9c),'isActive':_0x419dda['wDZth'](_0x2f84c9,_0x5d6d69)};});return{'envs':_0x8f236e,'activeEnv':_0x5d6d69};}export async function status(){const _0x819df4=_0x25c6fa,_0x12c0ab={'sRfNk':function(_0x131815,_0x401805){return _0x131815(_0x401805);},'vltBa':function(_0x5b0d20,_0x1b3558){return _0x5b0d20(_0x1b3558);},'xBtgr':function(_0x4beea8,_0x3e8af4,_0x33f2db){return _0x4beea8(_0x3e8af4,_0x33f2db);},'sbWap':function(_0x1ac194,_0x5a3859){return _0x1ac194(_0x5a3859);},'aMEBx':function(_0x4e05df,_0x4027a5){return _0x4e05df!==_0x4027a5;},'CQfTS':function(_0x5c7e70){return _0x5c7e70();},'pGhar':_0x819df4(0x199),'bKGKB':function(_0x44898f,_0x415414){return _0x44898f===_0x415414;},'vJAjo':_0x819df4(0x1b3),'RrAfC':'disabled','WBdXO':'\x0a---\x20Skills\x20---','TWozb':function(_0x3df83e,_0x53d1c8){return _0x3df83e>_0x53d1c8;},'NKxhn':_0x819df4(0x1a9),'JfdEh':function(_0x577dfc,_0x4e2a4d,_0x2b2106){return _0x577dfc(_0x4e2a4d,_0x2b2106);},'zOdgU':_0x819df4(0x180),'njOpF':_0x819df4(0x1ad),'vjgtr':_0x819df4(0x1d8),'vxEZL':'none','GqSuN':'(not\x20found)'};console[_0x819df4(0x1b4)]('\x0a📊\x20Ranger\x20Status\x0a');const _0x3b51e3=process[_0x819df4(0x1ab)](),_0x2715ca=getRangerDir();if(!_0x12c0ab[_0x819df4(0x18b)](existsSync,_0x2715ca)){console['log'](_0x819df4(0x1a7)+link(_0x3b51e3,bold(_0x12c0ab['vltBa'](basename,_0x3b51e3)))),console[_0x819df4(0x1b4)]('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x819df4(0x1a7)+_0x12c0ab[_0x819df4(0x1da)](link,_0x3b51e3,bold(_0x12c0ab[_0x819df4(0x1a3)](basename,_0x3b51e3))));const _0x53d5f4=getCurrentVersion(),_0x4eb7ed=getLatestVersion();if(_0x4eb7ed[_0x819df4(0x193)]&&_0x12c0ab[_0x819df4(0x1b9)](_0x4eb7ed[_0x819df4(0x193)],_0x53d5f4))console['log']('Version:\x20'+_0x53d5f4+_0x819df4(0x1cb)+_0x4eb7ed['version']+')'),console[_0x819df4(0x1b4)]('\x20\x20Run:\x20ranger\x20update');else _0x4eb7ed['version']?console['log']('Version:\x20'+_0x53d5f4+'\x20(up\x20to\x20date)'):console[_0x819df4(0x1b4)]('Version:\x20'+_0x53d5f4);const _0x5dfbce=await _0x12c0ab['CQfTS'](getToken);if(_0x5dfbce){const _0x3c7f26=await getCurrentUser(_0x5dfbce);_0x3c7f26[_0x819df4(0x1c8)]?console['log'](_0x819df4(0x186)+bold(_0x3c7f26[_0x819df4(0x17b)][_0x819df4(0x188)])):(console[_0x819df4(0x1b4)](_0x819df4(0x1bf)),console['log'](_0x819df4(0x1af)));}else console[_0x819df4(0x1b4)]('API\x20Token:\x20✗\x20Not\x20found'),console[_0x819df4(0x1b4)](_0x819df4(0x1af));process[_0x819df4(0x175)]['DEBUG']&&(console[_0x819df4(0x1b4)](_0x819df4(0x1a4)+getCurrentEnvironment()),console['log'](_0x819df4(0x174)+_0x12c0ab['CQfTS'](getApiBaseUrl)));console[_0x819df4(0x1b4)](_0x819df4(0x1b7));const _0x5a624b=await getOpencodePluginStatus();if(_0x5a624b[_0x819df4(0x1cc)]==='configured')console[_0x819df4(0x1b4)]('\x20\x20'+bold(_0x12c0ab[_0x819df4(0x1d9)])+':\x20configured'),_0x5a624b['details']&&console['log']('\x20\x20'+_0x5a624b[_0x819df4(0x1b0)]);else _0x12c0ab[_0x819df4(0x1a6)](_0x5a624b['status'],'not_configured')?(console['log'](_0x819df4(0x179)),_0x5a624b[_0x819df4(0x1b0)]&&console[_0x819df4(0x1b4)]('\x20\x20'+_0x5a624b[_0x819df4(0x1b0)]),console[_0x819df4(0x1b4)](_0x12c0ab['vJAjo'])):console[_0x819df4(0x1b4)]('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console[_0x819df4(0x1b4)](_0x819df4(0x182));const _0x52b03d=await getPluginInfo('ranger@trailhead');if(_0x52b03d){const _0x39b0e1=_0x52b03d[_0x819df4(0x191)]||_0x819df4(0x1a1),_0x3a7b5=_0x52b03d[_0x819df4(0x196)]?'enabled':_0x12c0ab[_0x819df4(0x1cd)];console['log']('\x20\x20'+bold(_0x819df4(0x1b8))+':\x20installed\x20('+_0x39b0e1+',\x20'+_0x3a7b5+')');}else console[_0x819df4(0x1b4)]('\x20\x20Not\x20installed'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)');console['log'](_0x12c0ab['WBdXO']);const {project:_0x329db4,user:_0x2d787f}=await getInstalledSkills(),_0x9d50a2=_0x329db4[_0x819df4(0x19b)](_0x53d122=>RANGER_MANAGED_SKILLS['includes'](_0x53d122['name'])),_0x967621=_0x2d787f['filter'](_0x59c6aa=>RANGER_MANAGED_SKILLS[_0x819df4(0x192)](_0x59c6aa[_0x819df4(0x1c4)])),_0x1abd74=_0x9d50a2[_0x819df4(0x170)]+_0x967621[_0x819df4(0x170)];if(_0x1abd74===0x0)console['log'](_0x819df4(0x18a)),console[_0x819df4(0x1b4)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x12c0ab['TWozb'](_0x9d50a2[_0x819df4(0x170)],0x0)){console[_0x819df4(0x1b4)](_0x12c0ab[_0x819df4(0x1ae)]);for(const _0x197d89 of _0x9d50a2){console[_0x819df4(0x1b4)](_0x819df4(0x1d4)+bold(_0x197d89[_0x819df4(0x18c)])+':\x20'+link(_0x197d89[_0x819df4(0x1ce)],basename(_0x197d89['path'])));}}if(_0x967621['length']>0x0){console[_0x819df4(0x1b4)](_0x819df4(0x19e));for(const _0x5be26d of _0x967621){console['log']('\x20\x20\x20\x20'+bold(_0x5be26d['displayName'])+':\x20'+_0x12c0ab['JfdEh'](link,_0x5be26d[_0x819df4(0x1ce)],basename(_0x5be26d[_0x819df4(0x1ce)])));}}}console['log']('\x0a---\x20Profiles\x20---');const {envs:_0x2f1ea2,activeEnv:_0x37dc37}=await _0x12c0ab[_0x819df4(0x190)](getEnvironments);let _0x32c2e9=[];if(_0x5dfbce)try{_0x32c2e9=await listCloudProfiles();}catch{}const _0x2ac32c=_0x2f1ea2['length']+_0x32c2e9[_0x819df4(0x170)];if(_0x2ac32c===0x0)console[_0x819df4(0x1b4)](_0x12c0ab['zOdgU']),console['log'](_0x819df4(0x18e));else{if(_0x2ac32c>0x5){const _0x5e5c90=[];_0x12c0ab['TWozb'](_0x32c2e9[_0x819df4(0x170)],0x0)&&_0x5e5c90[_0x819df4(0x1aa)](_0x32c2e9['length']+'\x20cloud'),_0x12c0ab['TWozb'](_0x2f1ea2[_0x819df4(0x170)],0x0)&&_0x5e5c90['push'](_0x2f1ea2[_0x819df4(0x170)]+'\x20local'),console[_0x819df4(0x1b4)](_0x2ac32c+'\x20profiles\x20configured\x20('+_0x5e5c90['join'](',\x20')+')'),_0x37dc37&&console['log']('\x20\x20Active:\x20'+bold(_0x37dc37)),console[_0x819df4(0x1b4)](_0x819df4(0x1c7));}else{for(const _0x695f7e of _0x32c2e9){const _0x39208b=_0x12c0ab['bKGKB'](_0x695f7e[_0x819df4(0x1c4)],_0x37dc37)?_0x12c0ab['njOpF']:'';console['log']('\x20\x20'+bold(_0x695f7e[_0x819df4(0x1c4)])+_0x819df4(0x189)+_0x39208b);const _0x3b1d4a=_0x695f7e['sessionUpdatedAt']?_0x819df4(0x17e)+_0x695f7e[_0x819df4(0x1d6)]+')':_0x12c0ab['vjgtr'];console['log'](_0x819df4(0x1c3)+_0x3b1d4a);}const _0x8b143e=new Set(_0x32c2e9['map'](_0x33be48=>_0x33be48[_0x819df4(0x1c4)]));for(const _0x28601b of _0x2f1ea2){if(_0x8b143e['has'](_0x28601b['name']))continue;const _0x2dce9e=_0x28601b[_0x819df4(0x1b5)]?'\x20(active)':'',_0x5b5b95=_0x28601b[_0x819df4(0x1a0)]?'encrypted':_0x28601b[_0x819df4(0x1c0)]?_0x819df4(0x178):_0x12c0ab[_0x819df4(0x181)];console[_0x819df4(0x1b4)]('\x20\x20'+_0x12c0ab[_0x819df4(0x1cf)](bold,_0x28601b[_0x819df4(0x1c4)])+_0x819df4(0x1d0)+_0x2dce9e),console[_0x819df4(0x1b4)]('\x20\x20\x20\x20Auth:\x20'+_0x5b5b95),_0x28601b['settingsPath']!==_0x12c0ab['GqSuN']&&console['log']('\x20\x20\x20\x20Settings:\x20'+_0x12c0ab[_0x819df4(0x1da)](link,_0x28601b['settingsPath'],basename(_0x28601b['settingsPath'])));}if(!_0x37dc37){console[_0x819df4(0x1b4)]('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x392cf1=[..._0x32c2e9[_0x819df4(0x185)](_0x4ee362=>_0x4ee362['name']),..._0x2f1ea2['filter'](_0x1a357b=>!_0x8b143e[_0x819df4(0x171)](_0x1a357b[_0x819df4(0x1c4)]))[_0x819df4(0x185)](_0x50dca2=>_0x50dca2[_0x819df4(0x1c4)])];console[_0x819df4(0x1b4)](_0x819df4(0x1dc)+_0x392cf1[_0x819df4(0x172)](',\x20')+')');}}}console['log']('');}
|
|
1
|
+
const _0x5eef89=_0x1876;(function(_0x70a5e0,_0x351e6a){const _0x50774e=_0x1876,_0x540809=_0x70a5e0();while(!![]){try{const _0x231a95=parseInt(_0x50774e(0x221))/0x1*(-parseInt(_0x50774e(0x20a))/0x2)+parseInt(_0x50774e(0x1f7))/0x3+parseInt(_0x50774e(0x1d7))/0x4+parseInt(_0x50774e(0x215))/0x5*(parseInt(_0x50774e(0x1ba))/0x6)+parseInt(_0x50774e(0x1ef))/0x7*(-parseInt(_0x50774e(0x1c0))/0x8)+parseInt(_0x50774e(0x1c4))/0x9*(-parseInt(_0x50774e(0x1f5))/0xa)+parseInt(_0x50774e(0x1f4))/0xb;if(_0x231a95===_0x351e6a)break;else _0x540809['push'](_0x540809['shift']());}catch(_0x4b04c6){_0x540809['push'](_0x540809['shift']());}}}(_0x4e45,0xf3e1f));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';function _0x4e45(){const _0x2a0325=['TvVQK','3923980JMwmYu','some','\x1b]8;;\x07','isDirectory','API\x20Token:\x20✗\x20Not\x20found','scope','yUqTF','\x20\x20Active:\x20','(not\x20found)','\x20\x20Run:\x20ranger\x20setup\x20[token]','\x20\x20Run:\x20ranger\x20setup\x20--opencode','trim','log','EahJd','sessionUpdatedAt','Version:\x20','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','qHOHw','name','fAXzc','encrypted','\x20\x20Project-level:','match','toString','2898SQpdkO','\x0a📊\x20Ranger\x20Status\x0a','settingsPath','isActive','nYHNg','23437359SFcWCG','220QPpTSt','@ranger-testing/opencode-plugin','4637121ZBPcJd','\x20plugin(s)\x20configured','version','stdout','eBZIO','PWPDd','data','filter','LwKEz','DEBUG','\x20profiles\x20configured\x20(','cmvyU','lvdPK','has','length','\x20[local]','opencode-plugin','\x20\x20\x20\x20','includes','10FvSTeN','NBKzB','status','path',':\x20configured','\x1b[1m','No\x20profiles\x20configured','JuWii','\x20\x20\x20\x20Settings:\x20','details','\x20(latest:\x20','6245GvcyrD',':\x20installed\x20(','settings.json','configured','project','kXEpC','glAcb','gOKou','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','YiVeQ','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','133127oRVbFb','iljEz','not_installed','TVVqh','iJZkn','ZNlyL','618pUFTrw','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','organizationName','unknown','EeyHl','displayName','31168uBAYTR','\x0a\x20\x20No\x20active\x20profile\x20set','auth.json','\x20[cloud]','617112sdLckV','user','AFCfH','vgCQn','merlh','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','GwASg','opencode','\x20\x20Not\x20installed','iRQRt','map','API\x20URL:\x20','plaintext','cached\x20(updated\x20','Root:\x20','API\x20Environment:\x20','eGxKV','\x20\x20User-level:'];_0x4e45=function(){return _0x2a0325;};return _0x4e45();}import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x136466=>_0x5eef89(0x20f)+_0x136466+'\x1b[0m',link=(_0x1fd636,_0xbe65c8)=>'\x1b]8;;file://'+_0x1fd636+'\x07'+(_0xbe65c8||_0x1fd636)+_0x5eef89(0x1d9);function _0x1876(_0x4e33bc,_0x64e9ba){_0x4e33bc=_0x4e33bc-0x1b9;const _0x4e455a=_0x4e45();let _0x1876b9=_0x4e455a[_0x4e33bc];return _0x1876b9;}async function getOpencodePluginStatus(){const _0x3de4ad=_0x5eef89,_0x16fba0={'eBZIO':_0x3de4ad(0x207),'glAcb':_0x3de4ad(0x223),'HKXIZ':function(_0x25fdb5,_0x55a7e4){return _0x25fdb5(_0x55a7e4);},'IvNkA':function(_0x416456,_0x2e51e9){return _0x416456>_0x2e51e9;},'TvVQK':'not_configured','JuWii':function(_0xaeacac,_0xb6ac07,_0x1ac92c,_0x16febd){return _0xaeacac(_0xb6ac07,_0x1ac92c,_0x16febd);},'EeyHl':'config','lvdPK':_0x3de4ad(0x1fd),'YiVeQ':'close'};return new Promise(_0x112ed1=>{const _0x36354f=_0x3de4ad,_0x26b8f4={'mdGez':_0x16fba0[_0x36354f(0x21b)]},_0x41e89c=_0x16fba0[_0x36354f(0x211)](spawn,_0x36354f(0x1cb),['debug',_0x16fba0[_0x36354f(0x1be)]],{'stdio':['ignore','pipe','pipe']});let _0x3a290b='';_0x41e89c[_0x36354f(0x1fa)]?.['on'](_0x16fba0['lvdPK'],_0x5bb722=>{_0x3a290b+=_0x5bb722['toString']();}),_0x41e89c['stderr']?.['on'](_0x16fba0[_0x36354f(0x203)],_0x340352=>{const _0x142ddc=_0x36354f;_0x3a290b+=_0x340352[_0x142ddc(0x1ee)]();}),_0x41e89c['on']('error',()=>{_0x112ed1({'status':_0x26b8f4['mdGez']});}),_0x41e89c['on'](_0x16fba0[_0x36354f(0x21e)],_0x24b99c=>{const _0x266463=_0x36354f,_0x15c3bf={'nYHNg':function(_0x3b2300,_0x5d3ee9){return _0x3b2300!==_0x5d3ee9;},'iljEz':_0x16fba0[_0x266463(0x1fb)]};if(_0x24b99c!==0x0){_0x112ed1({'status':_0x16fba0[_0x266463(0x21b)]});return;}const _0x7d938=_0x3a290b['trim']();let _0x124c4f=null;if(_0x7d938)try{_0x124c4f=JSON['parse'](_0x7d938);}catch{const _0x1002c7=_0x7d938[_0x266463(0x1ed)](/\{[\s\S]*\}$/);if(_0x1002c7)try{_0x124c4f=JSON['parse'](_0x1002c7[0x0]);}catch{_0x124c4f=null;}}const _0x25f678=Array['isArray'](_0x124c4f?.['plugin'])?_0x124c4f?.['plugin']:[],_0x54f4c5=_0x25f678[_0x266463(0x1d8)](_0x278b27=>{const _0x362812=_0x266463;if(_0x15c3bf[_0x362812(0x1f3)](typeof _0x278b27,'string'))return![];return _0x278b27[_0x362812(0x209)](_0x362812(0x1f6))||_0x278b27['includes'](_0x15c3bf[_0x362812(0x222)]);});if(_0x54f4c5){_0x16fba0['HKXIZ'](_0x112ed1,{'status':_0x266463(0x218),'details':_0x25f678[_0x266463(0x205)]>0x0?_0x25f678[_0x266463(0x205)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x16fba0['IvNkA'](_0x25f678[_0x266463(0x205)],0x0)){_0x112ed1({'status':_0x16fba0[_0x266463(0x1d6)],'details':_0x25f678['length']+_0x266463(0x1f8)});return;}_0x112ed1({'status':_0x16fba0[_0x266463(0x1d6)]});});});}async function getSkillsFromDir(_0x256c50,_0x39b6e0){const _0x3aa096=_0x5eef89,_0x10e404={'PWPDd':function(_0x45ac91,_0x265894){return _0x45ac91(_0x265894);},'esgPs':function(_0x4c03fc,_0x5f50a7,_0x124971){return _0x4c03fc(_0x5f50a7,_0x124971);},'LwKEz':'SKILL.md','cmvyU':function(_0x811ddd,_0x166d0b){return _0x811ddd(_0x166d0b);}};if(!_0x10e404[_0x3aa096(0x1fc)](existsSync,_0x256c50))return[];const _0x594d11=[];try{const _0x5c6de6=await _0x10e404['esgPs'](readdir,_0x256c50,{'withFileTypes':!![]});for(const _0x2d95b8 of _0x5c6de6){if(_0x2d95b8[_0x3aa096(0x1da)]()){const _0x46c354=join(_0x256c50,_0x2d95b8[_0x3aa096(0x1e9)],_0x10e404[_0x3aa096(0x1ff)]);if(_0x10e404[_0x3aa096(0x202)](existsSync,_0x46c354)){let _0x33498c=_0x2d95b8['name'];try{const _0x33c24f=await readFile(_0x46c354,'utf-8'),_0x5ef705=_0x33c24f[_0x3aa096(0x1ed)](/name:\s*(.+)/);_0x5ef705&&(_0x33498c=_0x5ef705[0x1][_0x3aa096(0x1e2)]());}catch{}_0x594d11['push']({'name':_0x2d95b8[_0x3aa096(0x1e9)],'displayName':_0x33498c,'path':_0x46c354,'level':_0x39b6e0});}}}}catch{return[];}return _0x594d11;}async function getInstalledSkills(){const _0x37c64d=_0x5eef89,_0x43ce51={'hojNz':function(_0x31141e,_0x412574,_0x363286){return _0x31141e(_0x412574,_0x363286);},'TVVqh':function(_0x56aef1){return _0x56aef1();},'iQBGU':'user'},[_0x2b943d,_0x3fc39d]=await Promise['all']([getSkillsFromDir(getProjectSkillsDir(),_0x37c64d(0x219)),_0x43ce51['hojNz'](getSkillsFromDir,_0x43ce51[_0x37c64d(0x224)](getUserSkillsDir),_0x43ce51['iQBGU'])]);return{'project':_0x2b943d,'user':_0x3fc39d};}async function getEnvironments(){const _0xeecf5d=_0x5eef89,_0x3981cf={'iJZkn':function(_0x432d3e,_0x51b22a){return _0x432d3e(_0x51b22a);},'ZNlyL':function(_0x376511,_0xe5b72a,_0x7dab73){return _0x376511(_0xe5b72a,_0x7dab73);},'qHOHw':function(_0x55eafa){return _0x55eafa();},'fAXzc':function(_0xa31fe){return _0xa31fe();}},{envNames:_0x42a5d1,activeEnv:_0x42714d}=await _0x3981cf[_0xeecf5d(0x1e8)](getEnvNames),_0x47bb0c=_0x3981cf[_0xeecf5d(0x1ea)](getRangerDir);if(!_0x3981cf['iJZkn'](existsSync,_0x47bb0c))return{'envs':[],'activeEnv':null};const _0x45706a=_0x42a5d1[_0xeecf5d(0x1ce)](_0x4fdf0c=>{const _0x3c4c6c=_0xeecf5d,_0x56bb70=_0x3981cf[_0x3c4c6c(0x225)](getEnvDir,_0x4fdf0c),_0x30cb31=_0x3981cf[_0x3c4c6c(0x1b9)](join,_0x56bb70,_0x3c4c6c(0x217)),_0x5c91cc=join(_0x56bb70,_0x3c4c6c(0x1c2)),_0x1df43d=_0x3981cf[_0x3c4c6c(0x1b9)](join,_0x56bb70,'auth.json.enc');return{'name':_0x4fdf0c,'settingsPath':_0x3981cf[_0x3c4c6c(0x225)](existsSync,_0x30cb31)?_0x30cb31:_0x3c4c6c(0x1df),'hasPlaintextAuth':_0x3981cf[_0x3c4c6c(0x225)](existsSync,_0x5c91cc),'hasEncryptedAuth':_0x3981cf[_0x3c4c6c(0x225)](existsSync,_0x1df43d),'isActive':_0x4fdf0c===_0x42714d};});return{'envs':_0x45706a,'activeEnv':_0x42714d};}export async function status(){const _0x74912=_0x5eef89,_0xe6627e={'TUSIW':function(_0x1e8b51){return _0x1e8b51();},'vgCQn':function(_0x1a6ad6,_0x3b1a65){return _0x1a6ad6(_0x3b1a65);},'fDKrq':function(_0x4864f4,_0x26e915){return _0x4864f4(_0x26e915);},'Xhsiz':function(_0x14e6e1,_0x2bb096){return _0x14e6e1(_0x2bb096);},'ftuRi':function(_0x39eeb8,_0x414a30){return _0x39eeb8(_0x414a30);},'bpsKo':function(_0x1ce96e){return _0x1ce96e();},'NaWyW':function(_0x238dda){return _0x238dda();},'VZQJe':function(_0x21d46f,_0x4d9787){return _0x21d46f(_0x4d9787);},'Ctnwc':'\x0a---\x20OpenCode\x20Plugin\x20---','yUqTF':function(_0x562b5a,_0x32e418){return _0x562b5a===_0x32e418;},'Vfmcg':function(_0x1ef0ca,_0x4e9891){return _0x1ef0ca(_0x4e9891);},'mAaBp':_0x74912(0x1f6),'AFCfH':'not_configured','XMEXZ':_0x74912(0x1e1),'daDgh':_0x74912(0x21f),'kXEpC':'\x0a---\x20Claude\x20Code\x20Plugin\x20---','merlh':'ranger@trailhead','iRQRt':_0x74912(0x1cc),'NBKzB':_0x74912(0x1bb),'WmyRo':'\x0a---\x20Skills\x20---','wqhbN':function(_0x5ecb6f){return _0x5ecb6f();},'GwASg':function(_0x39b7a6,_0x54170a){return _0x39b7a6+_0x54170a;},'EahJd':function(_0x2f8648,_0x22e3f4){return _0x2f8648>_0x22e3f4;},'gOKou':_0x74912(0x1ec),'JwEaX':_0x74912(0x1d5),'VetBF':'\x0a---\x20Profiles\x20---','TQrJQ':function(_0x30f8be){return _0x30f8be();},'MFdOD':_0x74912(0x210),'SOMxZ':'no\x20session','eGxKV':'\x20(active)','tqICb':'(not\x20found)'};console[_0x74912(0x1e3)](_0x74912(0x1f0));const _0x14284b=process['cwd'](),_0x5b6d39=_0xe6627e['TUSIW'](getRangerDir);if(!_0xe6627e[_0x74912(0x1c7)](existsSync,_0x5b6d39)){console[_0x74912(0x1e3)](_0x74912(0x1d2)+link(_0x14284b,bold(_0xe6627e['fDKrq'](basename,_0x14284b)))),console['log'](_0x74912(0x220)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x74912(0x1d2)+link(_0x14284b,_0xe6627e['Xhsiz'](bold,_0xe6627e['ftuRi'](basename,_0x14284b))));const _0x56984f=_0xe6627e['bpsKo'](getCurrentVersion),_0x282f9b=_0xe6627e['NaWyW'](getLatestVersion);if(_0x282f9b[_0x74912(0x1f9)]&&_0x282f9b['version']!==_0x56984f)console['log'](_0x74912(0x1e6)+_0x56984f+_0x74912(0x214)+_0x282f9b['version']+')'),console[_0x74912(0x1e3)]('\x20\x20Run:\x20ranger\x20update');else _0x282f9b[_0x74912(0x1f9)]?console[_0x74912(0x1e3)]('Version:\x20'+_0x56984f+'\x20(up\x20to\x20date)'):console[_0x74912(0x1e3)]('Version:\x20'+_0x56984f);const _0x718982=await getToken();if(_0x718982){const _0x5be1f0=await getCurrentUser(_0x718982);_0x5be1f0['success']?console['log']('Organization:\x20'+_0xe6627e['VZQJe'](bold,_0x5be1f0[_0x74912(0x1c5)][_0x74912(0x1bc)])):(console['log'](_0x74912(0x1c9)),console[_0x74912(0x1e3)](_0x74912(0x1e0)));}else console['log'](_0x74912(0x1db)),console[_0x74912(0x1e3)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process['env'][_0x74912(0x200)]&&(console[_0x74912(0x1e3)](_0x74912(0x1d3)+getCurrentEnvironment()),console['log'](_0x74912(0x1cf)+_0xe6627e['NaWyW'](getApiBaseUrl)));console[_0x74912(0x1e3)](_0xe6627e['Ctnwc']);const _0x5d4ed1=await getOpencodePluginStatus();if(_0xe6627e[_0x74912(0x1dd)](_0x5d4ed1[_0x74912(0x20c)],_0x74912(0x218)))console[_0x74912(0x1e3)]('\x20\x20'+_0xe6627e['Vfmcg'](bold,_0xe6627e['mAaBp'])+_0x74912(0x20e)),_0x5d4ed1['details']&&console[_0x74912(0x1e3)]('\x20\x20'+_0x5d4ed1[_0x74912(0x213)]);else _0xe6627e['yUqTF'](_0x5d4ed1['status'],_0xe6627e[_0x74912(0x1c6)])?(console['log']('\x20\x20Not\x20configured'),_0x5d4ed1[_0x74912(0x213)]&&console['log']('\x20\x20'+_0x5d4ed1['details']),console['log'](_0xe6627e['XMEXZ'])):console[_0x74912(0x1e3)](_0xe6627e['daDgh']);console[_0x74912(0x1e3)](_0xe6627e[_0x74912(0x21a)]);const _0x53a810=await getPluginInfo(_0xe6627e[_0x74912(0x1c8)]);if(_0x53a810){const _0x611d2d=_0x53a810[_0x74912(0x1dc)]||_0x74912(0x1bd),_0x101c47=_0x53a810['enabled']?'enabled':'disabled';console[_0x74912(0x1e3)]('\x20\x20'+bold('ranger@trailhead')+_0x74912(0x216)+_0x611d2d+',\x20'+_0x101c47+')');}else console[_0x74912(0x1e3)](_0xe6627e[_0x74912(0x1cd)]),console[_0x74912(0x1e3)](_0xe6627e[_0x74912(0x20b)]);console[_0x74912(0x1e3)](_0xe6627e['WmyRo']);const {project:_0x4f6f8c,user:_0x4bc40c}=await _0xe6627e['wqhbN'](getInstalledSkills),_0x2d4651=_0x4f6f8c[_0x74912(0x1fe)](_0x1bec69=>RANGER_MANAGED_SKILLS['includes'](_0x1bec69['name'])),_0x9e049f=_0x4bc40c[_0x74912(0x1fe)](_0x54996=>RANGER_MANAGED_SKILLS[_0x74912(0x209)](_0x54996[_0x74912(0x1e9)])),_0x5c46d9=_0xe6627e[_0x74912(0x1ca)](_0x2d4651[_0x74912(0x205)],_0x9e049f['length']);if(_0x5c46d9===0x0)console['log']('No\x20skills\x20installed'),console[_0x74912(0x1e3)]('\x20\x20Run:\x20ranger\x20skillup');else{if(_0xe6627e['EahJd'](_0x2d4651['length'],0x0)){console['log'](_0xe6627e[_0x74912(0x21c)]);for(const _0x1039b0 of _0x2d4651){console['log'](_0x74912(0x208)+_0xe6627e['Xhsiz'](bold,_0x1039b0[_0x74912(0x1bf)])+':\x20'+link(_0x1039b0['path'],basename(_0x1039b0['path'])));}}if(_0x9e049f['length']>0x0){console[_0x74912(0x1e3)](_0xe6627e['JwEaX']);for(const _0x5e442d of _0x9e049f){console['log']('\x20\x20\x20\x20'+bold(_0x5e442d['displayName'])+':\x20'+link(_0x5e442d[_0x74912(0x20d)],_0xe6627e['fDKrq'](basename,_0x5e442d[_0x74912(0x20d)])));}}}console['log'](_0xe6627e['VetBF']);const {envs:_0x4e3f40,activeEnv:_0x1960ea}=await getEnvironments();let _0x362e01=[];if(_0x718982)try{_0x362e01=await _0xe6627e['TQrJQ'](listCloudProfiles);}catch{}const _0x339135=_0xe6627e['GwASg'](_0x4e3f40[_0x74912(0x205)],_0x362e01['length']);if(_0x339135===0x0)console['log'](_0xe6627e['MFdOD']),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0xe6627e[_0x74912(0x1e4)](_0x339135,0x5)){const _0x2515cf=[];_0x362e01[_0x74912(0x205)]>0x0&&_0x2515cf['push'](_0x362e01[_0x74912(0x205)]+'\x20cloud'),_0x4e3f40['length']>0x0&&_0x2515cf['push'](_0x4e3f40['length']+'\x20local'),console['log'](_0x339135+_0x74912(0x201)+_0x2515cf['join'](',\x20')+')'),_0x1960ea&&console['log'](_0x74912(0x1de)+_0xe6627e['Vfmcg'](bold,_0x1960ea)),console['log'](_0x74912(0x21d));}else{for(const _0x1896ef of _0x362e01){const _0x1dbdfb=_0x1896ef[_0x74912(0x1e9)]===_0x1960ea?'\x20(active)':'';console[_0x74912(0x1e3)]('\x20\x20'+bold(_0x1896ef['name'])+_0x74912(0x1c3)+_0x1dbdfb);const _0xd23674=_0x1896ef[_0x74912(0x1e5)]?_0x74912(0x1d1)+_0x1896ef['sessionUpdatedAt']+')':_0xe6627e['SOMxZ'];console['log']('\x20\x20\x20\x20Session:\x20'+_0xd23674);}const _0x3d6f38=new Set(_0x362e01[_0x74912(0x1ce)](_0x2f6316=>_0x2f6316['name']));for(const _0x32541f of _0x4e3f40){if(_0x3d6f38[_0x74912(0x204)](_0x32541f['name']))continue;const _0x5c97f6=_0x32541f[_0x74912(0x1f2)]?_0xe6627e[_0x74912(0x1d4)]:'',_0x32ac1c=_0x32541f['hasEncryptedAuth']?_0x74912(0x1eb):_0x32541f['hasPlaintextAuth']?_0x74912(0x1d0):'none';console[_0x74912(0x1e3)]('\x20\x20'+bold(_0x32541f[_0x74912(0x1e9)])+_0x74912(0x206)+_0x5c97f6),console['log']('\x20\x20\x20\x20Auth:\x20'+_0x32ac1c),_0x32541f['settingsPath']!==_0xe6627e['tqICb']&&console['log'](_0x74912(0x212)+link(_0x32541f[_0x74912(0x1f1)],basename(_0x32541f['settingsPath'])));}if(!_0x1960ea){console['log'](_0x74912(0x1c1));const _0x2217ed=[..._0x362e01['map'](_0x462aa7=>_0x462aa7['name']),..._0x4e3f40[_0x74912(0x1fe)](_0x1894c3=>!_0x3d6f38[_0x74912(0x204)](_0x1894c3[_0x74912(0x1e9)]))['map'](_0x18b9a4=>_0x18b9a4['name'])];console['log'](_0x74912(0x1e7)+_0x2217ed['join'](',\x20')+')');}}}console[_0x74912(0x1e3)]('');}
|