@ranger-testing/ranger-cli 3.1.1-alpha.b22d278-38 → 3.1.1
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 -1
- package/build/commands/utils/userApi.js +1 -1
- package/build/commands/utils/version.js +1 -1
- package/build/commands/verifyFeature.js +1 -1
- package/build/commands/verifyFeatureCli.js +1 -1
- package/build/commands/verifyFeatureNovaCli.js +1 -1
- package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
- package/package.json +1 -1
package/build/commands/login.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5fea29,_0x28ef44){const _0x49693f=_0x5ee5,_0x5de434=_0x5fea29();while(!![]){try{const _0x3e8fee=-parseInt(_0x49693f(0x11a))/0x1+-parseInt(_0x49693f(0x126))/0x2+parseInt(_0x49693f(0x123))/0x3*(parseInt(_0x49693f(0x129))/0x4)+-parseInt(_0x49693f(0x120))/0x5*(-parseInt(_0x49693f(0x11b))/0x6)+-parseInt(_0x49693f(0x11e))/0x7+parseInt(_0x49693f(0x11d))/0x8*(-parseInt(_0x49693f(0x122))/0x9)+parseInt(_0x49693f(0x12a))/0xa;if(_0x3e8fee===_0x28ef44)break;else _0x5de434['push'](_0x5de434['shift']());}catch(_0x197c90){_0x5de434['push'](_0x5de434['shift']());}}}(_0x7894,0x8c023));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';function _0x5ee5(_0x326a73,_0x54f089){_0x326a73=_0x326a73-0x117;const _0x7894bb=_0x7894();let _0x5ee543=_0x7894bb[_0x326a73];return _0x5ee543;}function _0x7894(){const _0x4cdbae=['2006890XyABKE','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','234JgFOwC','1262121hESKPe','KtNYM','\x0a✅\x20API\x20key\x20stored\x20successfully','1845556CFYWih','success','dhgDx','4urBWPN','20553200VHAdrg','log','xTwBh','Re-authenticating\x20via\x20MCP\x20bootstrap...','\x0a✅\x20Logged\x20in\x20to\x20','674789GajoDE','12IHhkvt','organizationName','236152BgeUCw','2381729Lxakpj','Login\x20failed:\x20'];_0x7894=function(){return _0x4cdbae;};return _0x7894();}import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0x311eec=_0x5ee5,_0x5d93d6={'xTwBh':function(_0x3493e5){return _0x3493e5();},'KtNYM':_0x311eec(0x121),'dhgDx':function(_0x11b123,_0x3bce93){return _0x11b123(_0x3bce93);}},_0x2d8455=await _0x5d93d6[_0x311eec(0x117)](getMcpAuthOrigin);if(_0x2d8455){console[_0x311eec(0x12b)](_0x311eec(0x118)),await _0x5d93d6['xTwBh'](mcpBootstrap);return;}if(!isInteractive())throw new Error(_0x5d93d6[_0x311eec(0x124)]);try{const _0x36e68=await runDeviceAuthFlow(),_0x32954a=await _0x5d93d6[_0x311eec(0x128)](getCurrentUser,_0x36e68);_0x32954a[_0x311eec(0x127)]?console[_0x311eec(0x12b)](_0x311eec(0x119)+_0x32954a['user'][_0x311eec(0x11c)]):console[_0x311eec(0x12b)](_0x311eec(0x125));}catch(_0x2516b1){throw new Error(_0x311eec(0x11f)+(_0x2516b1 instanceof Error?_0x2516b1['message']:_0x2516b1));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x56443f=_0x58a7;(function(_0x35a11c,_0x139b19){const _0xd99f04=_0x58a7,_0x31539f=_0x35a11c();while(!![]){try{const _0x1f25df=-parseInt(_0xd99f04(0x109))/0x1+-parseInt(_0xd99f04(0x124))/0x2*(parseInt(_0xd99f04(0xfc))/0x3)+-parseInt(_0xd99f04(0x155))/0x4*(-parseInt(_0xd99f04(0x10f))/0x5)+parseInt(_0xd99f04(0x120))/0x6*(-parseInt(_0xd99f04(0x122))/0x7)+-parseInt(_0xd99f04(0x14e))/0x8*(parseInt(_0xd99f04(0x15f))/0x9)+-parseInt(_0xd99f04(0x150))/0xa+-parseInt(_0xd99f04(0x12e))/0xb*(-parseInt(_0xd99f04(0x11b))/0xc);if(_0x1f25df===_0x139b19)break;else _0x31539f['push'](_0x31539f['shift']());}catch(_0x424d81){_0x31539f['push'](_0x31539f['shift']());}}}(_0x42d0,0x942e5));function _0x58a7(_0x438335,_0x5cb988){_0x438335=_0x438335-0xdf;const _0x42d0e0=_0x42d0();let _0x58a7ab=_0x42d0e0[_0x438335];return _0x58a7ab;}import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';function _0x42d0(){const _0x53247a=['\x0aOpening\x20browser\x20for\x20authentication...','close','dqWeF','ZnRzZ','Registering\x20OAuth\x20client...','bkKMP','split','XZKjk','then','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','client_id','POST','expires_in','hKCug','6skHDSu','suhcu','/callback','MxcxW','text','error','log','RToDe','ranger-cli','OQbRG','OAuth\x20error:\x20','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','Server\x20returned\x20error:\x20','707486bmElIV','\x0aToken\x20written\x20to\x20','UAory','KENcm','iZmLO','none','5931445EXADEh','2.0','proxied','ZNVKE','MCP\x20server\x20returned\x20HTTP\x20','IKhVv','toString','redirect_uri','start','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','sha256','rHITh','26844HmKdel','data:','mmlMW','HMAfR','oMcgW','356622ymIMjF','rJsRl','105sReBbx','expiresAt','756282zzVLcr','Iwovl','tHKWa','nxNkT','AqduF','authorization_endpoint','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','write','platform','result','17567JcNTXt','trim','string','stringify','LhZaP','2025-03-26','GPFMt','json','FVQxt','get_cli_token','url','pXAHy','iOYHC','now','rIeIu','open','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','Client\x20registration\x20failed:\x20','Plyju','set','xWuln','get','NpPLy','WrfAl','response_type','kmXlK','ANcXW','registration_endpoint','text/html','pathname','.ranger','kVcEf','48LUhvuH','authorization_code','8840560qxawEt','tools/call','QMaQK','parse','clientSecret','4CHgVFG','base64url','token','oYNCf','resource','Requesting\x20CLI\x20token...','jOABn','VhNrh','Exchanging\x20authorization\x20code...','stdout','1368675SgqArO','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','vCqKr','state','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','initialize','token_endpoint','\x0aUnexpected\x20response\x20structure:','clientId','OSzxI','searchParams','status','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','\x20done','origin','end','1.0.0','writeHead','TEbuY','code'];_0x42d0=function(){return _0x53247a;};return _0x42d0();}import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),_0x56443f(0x14c),'auth-origin.txt');export async function getMcpAuthOrigin(){const _0x5a4cc5=_0x56443f,_0x1a9871={'xWuln':function(_0x4cea24,_0x155064,_0x14306d){return _0x4cea24(_0x155064,_0x14306d);},'utYaC':'utf-8','GshLn':function(_0x47ebcf,_0x40000d){return _0x47ebcf||_0x40000d;}};try{const _0x65f724=(await _0x1a9871[_0x5a4cc5(0x142)](readFile,AUTH_ORIGIN_PATH,_0x1a9871['utYaC']))['trim']();return _0x1a9871['GshLn'](_0x65f724,null);}catch{return null;}}export async function mcpBootstrap(){const _0x9f00=_0x56443f,_0x1d2b25={'qDSLP':function(_0x5593e4){return _0x5593e4();},'hKEOH':function(_0x3883c0,_0x2efbb8){return _0x3883c0(_0x2efbb8);},'rHITh':function(_0x40cf02,_0x3acfe2){return _0x40cf02===_0x3acfe2;},'iZmLO':_0x9f00(0x111),'VSAeB':function(_0x3bee61,_0x3d20c0){return _0x3bee61+_0x3d20c0;},'AqduF':function(_0x330d68,_0x5d4054,_0x3e8882){return _0x330d68(_0x5d4054,_0x3e8882);}},_0x5a0a9e=_0x1d2b25['qDSLP'](getMcpAuthUrl);currentOrigin=_0x5a0a9e;const _0x582e5d=process[_0x9f00(0x15e)]['isTTY']??![];console[_0x9f00(0x102)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x5a0a9e+'\x0a');const _0x19041f=await _0x1d2b25['hKEOH'](tryUnauthenticated,_0x5a0a9e);let _0x164059=null;if(_0x1d2b25[_0x9f00(0x11a)](_0x19041f,_0x1d2b25[_0x9f00(0x10d)]))_0x164059='';else{_0x164059=await loadCachedToken();if(!_0x164059){if(!_0x582e5d)throw new Error(_0x1d2b25['VSAeB'](_0x9f00(0x107),'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.'));_0x164059=await oauthFlow(_0x5a0a9e);}}await _0x1d2b25[_0x9f00(0x128)](callGetCliToken,_0x5a0a9e,_0x164059);}async function tryUnauthenticated(_0x688d48){const _0x46cf74=_0x56443f,_0x4e8e79={'Iwovl':'2025-03-26','dqWeF':_0x46cf74(0x111),'CUPWq':function(_0x451dca,_0x571278){return _0x451dca===_0x571278;},'Plyju':'needs-oauth'},_0x39d3f0=await fetch(_0x688d48,{'method':'POST','headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'},'body':JSON[_0x46cf74(0x131)]({'jsonrpc':'2.0','id':0x1,'method':_0x46cf74(0xdf),'params':{'protocolVersion':_0x4e8e79[_0x46cf74(0x125)],'capabilities':{},'clientInfo':{'name':_0x46cf74(0x104),'version':_0x46cf74(0xea)}}})});if(_0x39d3f0['ok'])return await _0x39d3f0[_0x46cf74(0x100)](),_0x4e8e79[_0x46cf74(0xf0)];if(_0x4e8e79['CUPWq'](_0x39d3f0[_0x46cf74(0xe5)],0x191))return await _0x39d3f0[_0x46cf74(0x100)](),_0x4e8e79[_0x46cf74(0x140)];const _0x378666=await _0x39d3f0['text']();throw new Error(_0x46cf74(0x113)+_0x39d3f0[_0x46cf74(0xe5)]+':\x20'+_0x378666);}class OAuthTimeoutError extends Error{constructor(_0x5cb63d){super(_0x5cb63d),this['name']='OAuthTimeoutError';}}async function oauthFlow(_0xc2bdaa){const _0x369702=_0x56443f,_0x3d3d72={'suhcu':function(_0x2f78aa,_0x1938a0){return _0x2f78aa(_0x1938a0);},'nxNkT':function(_0x1b8fab){return _0x1b8fab();}};try{return await _0x3d3d72[_0x369702(0xfd)](oauthFlowAttempt,_0xc2bdaa);}catch(_0xd28c43){if(_0xd28c43 instanceof OAuthTimeoutError&&await _0x3d3d72[_0x369702(0x127)](loadCachedClient))return console[_0x369702(0x102)](_0x369702(0x163)),await clearCachedClient(),await _0x3d3d72[_0x369702(0xfd)](oauthFlowAttempt,_0xc2bdaa);throw _0xd28c43;}}async function oauthFlowAttempt(_0x4dbeec){const _0x348e27=_0x56443f,_0x572d27={'hVvRp':_0x348e27(0x160),'UAory':function(_0x2710ad){return _0x2710ad();},'OxtwG':_0x348e27(0xf2),'QMaQK':'application/json','kmXlK':_0x348e27(0x14f),'xmpqi':'refresh_token','mmlMW':_0x348e27(0x10e),'AhWIf':function(_0x178972,_0x42bb06,_0x19f068){return _0x178972(_0x42bb06,_0x19f068);},'myojR':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','pXAHy':_0x348e27(0x156),'wpySH':_0x348e27(0x119),'CwdrB':'hex','HPKSx':_0x348e27(0x146),'XZKjk':_0x348e27(0xf8),'oYIgY':'code_challenge_method','oYNCf':'state','OwVcV':function(_0x357f10,_0xf06230){return _0x357f10(_0xf06230);},'bkKMP':'client_secret','hKCug':'resource','BsdOI':'\x20done','iYKUU':function(_0x308560,_0x26af57,_0x3b6bb8,_0x998d9){return _0x308560(_0x26af57,_0x3b6bb8,_0x998d9);}},_0x88a281=_0x4dbeec['replace'](/\/mcp$/,'');process[_0x348e27(0x15e)]['write']('Discovering\x20authorization\x20server...');const _0x386a54=await fetch(_0x88a281+'/.well-known/oauth-protected-resource');if(!_0x386a54['ok'])throw new Error(_0x348e27(0xe6));const _0x3d2536=await _0x386a54['json'](),_0x706020=_0x3d2536['authorization_servers']?.[0x0];if(!_0x706020)throw new Error(_0x572d27['hVvRp']);console['log']('\x20'+_0x706020);const _0x412da2=await fetchAuthServerMetadata(_0x706020);let _0x135a52,_0x302e2;const _0x56eb02=await _0x572d27[_0x348e27(0x10b)](loadCachedClient);if(_0x56eb02)_0x135a52=_0x56eb02[_0x348e27(0xe2)],_0x302e2=_0x56eb02['clientSecret'];else{if(_0x412da2[_0x348e27(0x149)]){process[_0x348e27(0x15e)][_0x348e27(0x12b)](_0x572d27['OxtwG']);const _0x1bc797=await fetch(_0x412da2['registration_endpoint'],{'method':_0x348e27(0xf9),'headers':{'Content-Type':_0x572d27[_0x348e27(0x152)]},'body':JSON[_0x348e27(0x131)]({'client_name':'Ranger\x20CLI','redirect_uris':['http://localhost:'+CALLBACK_PORT+'/callback'],'grant_types':[_0x572d27[_0x348e27(0x147)],_0x572d27['xmpqi']],'response_types':['code'],'token_endpoint_auth_method':_0x572d27[_0x348e27(0x11d)]})});if(!_0x1bc797['ok']){const _0x59274f=await _0x1bc797['text']();throw new Error(_0x348e27(0x13f)+_0x59274f);}const _0x5ab93b=await _0x1bc797[_0x348e27(0x135)]();_0x135a52=_0x5ab93b[_0x348e27(0xf8)],_0x302e2=_0x5ab93b['client_secret'],await _0x572d27['AhWIf'](saveCachedClient,_0x135a52,_0x302e2),console['log']('\x20done');}else throw new Error(_0x572d27['myojR']);}const _0x36b967=randomBytes(0x20)[_0x348e27(0x115)](_0x572d27[_0x348e27(0x139)]),_0x46dfa7=createHash(_0x572d27['wpySH'])['update'](_0x36b967)['digest']('base64url'),_0x33774b=randomBytes(0x10)[_0x348e27(0x115)](_0x572d27['CwdrB']),_0x1bf05f=new URL(_0x412da2[_0x348e27(0x129)]);_0x1bf05f[_0x348e27(0xe4)][_0x348e27(0x141)](_0x572d27['HPKSx'],_0x348e27(0xed)),_0x1bf05f['searchParams']['set'](_0x572d27[_0x348e27(0xf5)],_0x135a52),_0x1bf05f['searchParams']['set'](_0x348e27(0x116),'http://localhost:'+CALLBACK_PORT+_0x348e27(0xfe)),_0x1bf05f['searchParams']['set']('code_challenge',_0x46dfa7),_0x1bf05f[_0x348e27(0xe4)]['set'](_0x572d27['oYIgY'],'S256'),_0x1bf05f['searchParams']['set'](_0x572d27[_0x348e27(0x158)],_0x33774b);_0x3d2536[_0x348e27(0x159)]&&_0x1bf05f['searchParams']['set'](_0x348e27(0x159),_0x3d2536['resource']);console[_0x348e27(0x102)](_0x348e27(0xee)),console[_0x348e27(0x102)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x1bf05f['toString']()+'\x0a'),await openBrowser(_0x1bf05f['toString']());const _0x476aab=await _0x572d27['OwVcV'](waitForCallback,_0x33774b);process['stdout'][_0x348e27(0x12b)](_0x348e27(0x15d));const _0x4bd039=new URLSearchParams({'grant_type':_0x572d27['kmXlK'],'code':_0x476aab,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0x135a52,'code_verifier':_0x36b967});_0x302e2&&_0x4bd039['set'](_0x572d27[_0x348e27(0xf3)],_0x302e2);_0x3d2536[_0x348e27(0x159)]&&_0x4bd039['set'](_0x572d27[_0x348e27(0xfb)],_0x3d2536['resource']);const _0xe8be05=await fetch(_0x412da2[_0x348e27(0xe0)],{'method':_0x348e27(0xf9),'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x4bd039});if(!_0xe8be05['ok']){const _0xb5ae73=await _0xe8be05['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0xb5ae73);}const _0x3d9ab5=await _0xe8be05[_0x348e27(0x135)]();return console['log'](_0x572d27['BsdOI']),await _0x572d27['iYKUU'](saveCachedToken,_0x3d9ab5['access_token'],_0x3d9ab5['refresh_token'],_0x3d9ab5[_0x348e27(0xfa)]),_0x3d9ab5['access_token'];}async function callGetCliToken(_0x4ada59,_0x3a42cc){const _0x10cd2b=_0x56443f,_0x54b127={'HMAfR':function(_0x3eb122,_0x3c762f,_0x440696){return _0x3eb122(_0x3c762f,_0x440696);},'kVcEf':'application/json','oMcgW':'Initializing\x20MCP\x20session...','OSzxI':function(_0x254e6e,_0x52cbc8){return _0x254e6e(_0x52cbc8);},'HjECw':_0x10cd2b(0x133),'pmltT':function(_0x4548ba,_0x55a6ee,_0x4fd9ee){return _0x4548ba(_0x55a6ee,_0x4fd9ee);},'MxcxW':'2.0','NpPLy':_0x10cd2b(0x15a),'vCqKr':function(_0x243e8c,_0x5ae838,_0x325ead){return _0x243e8c(_0x5ae838,_0x325ead);},'WrfAl':function(_0x4c0ced){return _0x4c0ced();},'FSrZI':'.ranger','SwGrw':function(_0x91904a,_0x338115,_0x518ea4){return _0x91904a(_0x338115,_0x518ea4);},'tHKWa':function(_0x5614d2,_0x22bc13,_0x329c66,_0x16137f){return _0x5614d2(_0x22bc13,_0x329c66,_0x16137f);},'OQbRG':function(_0x34617e,_0x246b58,_0x3fdc0c){return _0x34617e(_0x246b58,_0x3fdc0c);}},_0x43a471={'Content-Type':_0x54b127[_0x10cd2b(0x14d)],'Accept':'application/json,\x20text/event-stream'};_0x3a42cc&&(_0x43a471['Authorization']='Bearer\x20'+_0x3a42cc);const _0x19bdab=async _0x4ed5e9=>{const _0x50dda3=_0x10cd2b,_0x2fd29e=await _0x54b127[_0x50dda3(0x11e)](fetch,_0x4ada59,{'method':_0x50dda3(0xf9),'headers':_0x43a471,'body':JSON[_0x50dda3(0x131)](_0x4ed5e9)});if(!_0x2fd29e['ok']){const _0x40ac21=await _0x2fd29e[_0x50dda3(0x100)]();throw new Error('HTTP\x20'+_0x2fd29e[_0x50dda3(0xe5)]+':\x20'+_0x40ac21);}return parseResponse(_0x2fd29e);};process['stdout']['write'](_0x54b127[_0x10cd2b(0x11f)]);const _0x290654=await _0x54b127[_0x10cd2b(0xe3)](_0x19bdab,{'jsonrpc':'2.0','id':0x1,'method':'initialize','params':{'protocolVersion':_0x54b127['HjECw'],'capabilities':{},'clientInfo':{'name':_0x10cd2b(0x104),'version':_0x10cd2b(0xea)}}});if(_0x290654['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x290654['error']['message']??JSON[_0x10cd2b(0x131)](_0x290654['error'])));console['log'](_0x10cd2b(0xe7)),await _0x54b127['pmltT'](fetch,_0x4ada59,{'method':_0x10cd2b(0xf9),'headers':_0x43a471,'body':JSON['stringify']({'jsonrpc':_0x54b127[_0x10cd2b(0xff)],'method':'notifications/initialized'})})[_0x10cd2b(0xf6)](_0x12ad51=>_0x12ad51['text']()),process[_0x10cd2b(0x15e)]['write'](_0x54b127[_0x10cd2b(0x144)]);const _0x56e438=await _0x54b127['OSzxI'](_0x19bdab,{'jsonrpc':_0x10cd2b(0x110),'id':0x2,'method':_0x10cd2b(0x151),'params':{'name':_0x10cd2b(0x137),'arguments':{}}});if(_0x56e438[_0x10cd2b(0x101)])throw new Error('get_cli_token\x20failed:\x20'+(_0x56e438[_0x10cd2b(0x101)]['message']??JSON['stringify'](_0x56e438['error'])));console[_0x10cd2b(0x102)](_0x10cd2b(0xe7));const _0x127d40=_0x54b127['OSzxI'](extractToken,_0x56e438[_0x10cd2b(0x12d)]);if(!_0x127d40){console['error'](_0x10cd2b(0xe1)),console['error'](JSON[_0x10cd2b(0x131)](_0x56e438[_0x10cd2b(0x12d)],null,0x2));throw new Error(_0x10cd2b(0x13e));}const _0x22f327=_0x54b127[_0x10cd2b(0x161)](join,_0x54b127[_0x10cd2b(0x145)](homedir),_0x54b127['FSrZI']),_0x54020c=_0x54b127[_0x10cd2b(0x161)](join,_0x22f327,'refresh.txt');await _0x54b127['SwGrw'](mkdir,_0x22f327,{'recursive':!![]}),await _0x54b127[_0x10cd2b(0x126)](writeFile,_0x54020c,_0x127d40,{'mode':0x180}),await writeFile(_0x54b127[_0x10cd2b(0x105)](join,_0x22f327,'auth-origin.txt'),_0x4ada59,{'mode':0x180}),console[_0x10cd2b(0x102)](_0x10cd2b(0x10a)+_0x54020c),console['log'](_0x10cd2b(0x118));}async function fetchAuthServerMetadata(_0x2a426a){const _0x5081f1={'xneUt':function(_0x1cd8f7,_0x16ad6d){return _0x1cd8f7(_0x16ad6d);}},_0x2f1915=_0x2a426a+'/.well-known/oauth-authorization-server',_0x25b6d4=await _0x5081f1['xneUt'](fetch,_0x2f1915);if(!_0x25b6d4['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x2f1915+':\x20'+_0x25b6d4['status']);return _0x25b6d4['json']();}function waitForCallback(_0x348eb9){const _0x3695bb=_0x56443f,_0x57270a={'VhNrh':function(_0x13545b){return _0x13545b();},'LhZaP':function(_0x404e38,_0x572cde){return _0x404e38(_0x572cde);},'ICudw':function(_0x25bbbe,_0x4f661d){return _0x25bbbe!==_0x4f661d;},'sJxrD':'Not\x20found','RToDe':'code','KENcm':_0x3695bb(0x162),'jOABn':'error_description','GRVEq':_0x3695bb(0x14a),'TEbuY':function(_0x515d2f){return _0x515d2f();},'GSrmS':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','BoGyI':function(_0x57f97b){return _0x57f97b();},'VkIJZ':function(_0x21bfb6,_0x39df76){return _0x21bfb6(_0x39df76);}};return new Promise((_0x4f08d7,_0x45d34f)=>{const _0x48f7e3=()=>{const _0x3060fd=_0x58a7;_0xf2751f['closeAllConnections'](),_0xf2751f[_0x3060fd(0xef)]();},_0x2686fd=setTimeout(()=>{const _0x280167=_0x58a7;_0x57270a[_0x280167(0x15c)](_0x48f7e3),_0x57270a[_0x280167(0x132)](_0x45d34f,new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0xf2751f=_0x57270a['LhZaP'](createServer,(_0x25cdd8,_0x4aaeb7)=>{const _0x13383c=_0x58a7,_0x5544e6=new URL(_0x25cdd8[_0x13383c(0x138)]??'/','http://localhost:'+CALLBACK_PORT);if(_0x57270a['ICudw'](_0x5544e6[_0x13383c(0x14b)],_0x13383c(0xfe))){_0x4aaeb7[_0x13383c(0xeb)](0x194),_0x4aaeb7[_0x13383c(0xe9)](_0x57270a['sJxrD']);return;}const _0x101fb9=_0x5544e6[_0x13383c(0xe4)]['get'](_0x57270a[_0x13383c(0x103)]),_0x28cd83=_0x5544e6[_0x13383c(0xe4)]['get'](_0x57270a[_0x13383c(0x10c)]),_0xc28cc0=_0x5544e6[_0x13383c(0xe4)][_0x13383c(0x143)]('error');if(_0xc28cc0){const _0x3044bc=_0x5544e6[_0x13383c(0xe4)][_0x13383c(0x143)](_0x57270a[_0x13383c(0x15b)])??_0xc28cc0;_0x4aaeb7[_0x13383c(0xeb)](0xc8,{'Content-Type':_0x57270a['GRVEq']}),_0x4aaeb7['end']('<html><body><h2>Authentication\x20failed</h2><p>'+_0x3044bc+_0x13383c(0x12a)),clearTimeout(_0x2686fd),_0x57270a[_0x13383c(0xec)](_0x48f7e3),_0x45d34f(new Error(_0x13383c(0x106)+_0x3044bc));return;}if(!_0x101fb9||_0x28cd83!==_0x348eb9){_0x4aaeb7['writeHead'](0x190,{'Content-Type':'text/html'}),_0x4aaeb7['end']('<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>');return;}_0x4aaeb7['writeHead'](0xc8,{'Content-Type':_0x57270a['GRVEq']}),_0x4aaeb7['end'](_0x57270a['GSrmS']),clearTimeout(_0x2686fd),_0x57270a['BoGyI'](_0x48f7e3),_0x57270a['VkIJZ'](_0x4f08d7,_0x101fb9);});_0xf2751f['listen'](CALLBACK_PORT,'127.0.0.1');});}async function openBrowser(_0x10b5a4){const _0x38eee1=_0x56443f,_0x591951={'ANcXW':function(_0x6df7af,_0x2c0b9b){return _0x6df7af===_0x2c0b9b;},'gzruO':'darwin','aJiBh':_0x38eee1(0x13d),'iOYHC':'win32','rIeIu':'xdg-open'},_0x460b64=_0x591951[_0x38eee1(0x148)](process[_0x38eee1(0x12c)],_0x591951['gzruO'])?_0x591951['aJiBh']:_0x591951[_0x38eee1(0x148)](process[_0x38eee1(0x12c)],_0x591951[_0x38eee1(0x13a)])?_0x38eee1(0x117):_0x591951[_0x38eee1(0x13c)];exec(_0x460b64+'\x20\x22'+_0x10b5a4+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x1ad07b=_0x56443f,_0x2d2dd2={'NPCfd':function(_0x592d9f,_0x4a4270,_0x39b52c){return _0x592d9f(_0x4a4270,_0x39b52c);},'GPFMt':function(_0x4410f8,_0x2a3e2a){return _0x4410f8>_0x2a3e2a;}};try{const _0x294d01=JSON[_0x1ad07b(0x153)](await _0x2d2dd2['NPCfd'](readFile,TOKEN_CACHE_PATH,'utf-8'));if(_0x294d01['origin']&&_0x294d01['origin']!==currentOrigin)return null;if(_0x294d01['expiresAt']&&_0x2d2dd2[_0x1ad07b(0x134)](Date[_0x1ad07b(0x13b)](),_0x294d01[_0x1ad07b(0x123)]))return null;return _0x294d01['accessToken']??null;}catch{return null;}}async function saveCachedToken(_0x322927,_0x24ac24,_0x579913){const _0x5ce415=_0x56443f,_0x4dd4af={'SokFo':function(_0x396fd5,_0x3bf4c5){return _0x396fd5+_0x3bf4c5;},'qBwHP':'.ranger'},_0x2d5964=await loadCachedData(),_0x5ade7d={..._0x2d5964,'origin':currentOrigin,'accessToken':_0x322927,'refreshToken':_0x24ac24??_0x2d5964?.['refreshToken'],'expiresAt':_0x579913?_0x4dd4af['SokFo'](Date[_0x5ce415(0x13b)](),_0x579913*0x3e8):undefined};await mkdir(join(homedir(),_0x4dd4af['qBwHP']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON[_0x5ce415(0x131)](_0x5ade7d),{'mode':0x180});}async function loadCachedClient(){const _0x3d77e6=_0x56443f,_0x1b5bac={'ZnRzZ':function(_0x3a673d){return _0x3a673d();}},_0x32f327=await _0x1b5bac[_0x3d77e6(0xf1)](loadCachedData);if(_0x32f327?.[_0x3d77e6(0xe8)]&&_0x32f327['origin']!==currentOrigin)return null;return _0x32f327?.['clientId']?{'clientId':_0x32f327[_0x3d77e6(0xe2)],'clientSecret':_0x32f327[_0x3d77e6(0x154)]}:null;}async function clearCachedClient(){const _0x423cb2=await loadCachedData();if(!_0x423cb2)return;const {clientId:_0x1d6f47,clientSecret:_0x50bd16,..._0x431713}=_0x423cb2;await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x431713),{'mode':0x180});}async function saveCachedClient(_0x10cd16,_0x10fe3b){const _0x5e1a19=_0x56443f,_0x3303b2={'ZNVKE':function(_0x17a3bd,_0x2c275f,_0x375b01){return _0x17a3bd(_0x2c275f,_0x375b01);},'IKhVv':function(_0xde4c0a){return _0xde4c0a();},'FFJnv':'.ranger'},_0x3e4462=await loadCachedData(),_0x5f24f2={..._0x3e4462,'origin':currentOrigin,'accessToken':_0x3e4462?.['accessToken']??'','clientId':_0x10cd16,'clientSecret':_0x10fe3b};await mkdir(_0x3303b2[_0x5e1a19(0x112)](join,_0x3303b2[_0x5e1a19(0x114)](homedir),_0x3303b2['FFJnv']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x5f24f2),{'mode':0x180});}async function loadCachedData(){const _0x4f3d61={'WsWJJ':'utf-8'};try{return JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x4f3d61['WsWJJ']));}catch{return null;}}async function parseResponse(_0x3a2753){const _0x4eda7d=_0x56443f,_0x20b612={'nDZGD':'text/event-stream','FVQxt':_0x4eda7d(0x11c)},_0x49a099=_0x3a2753['headers'][_0x4eda7d(0x143)]('content-type')??'';if(_0x49a099['includes'](_0x20b612['nDZGD'])){const _0x55a102=await _0x3a2753['text']();for(const _0x35f29b of _0x55a102[_0x4eda7d(0xf4)]('\x0a')){const _0x11181d=_0x35f29b['trim']();if(_0x11181d['startsWith'](_0x20b612['FVQxt'])){const _0x107c5e=_0x11181d['slice'](_0x20b612[_0x4eda7d(0x136)]['length'])[_0x4eda7d(0x12f)]();if(!_0x107c5e)continue;try{const _0x44c97a=JSON[_0x4eda7d(0x153)](_0x107c5e);if(_0x44c97a['id']!==undefined||_0x44c97a['error'])return _0x44c97a;}catch{}}}throw new Error(_0x4eda7d(0xf7));}return _0x3a2753[_0x4eda7d(0x135)]();}function extractToken(_0x3c4827){const _0x309dc5=_0x56443f,_0xf953bf={'LLcEX':_0x309dc5(0x130),'rJsRl':function(_0x32addc,_0xbdc978){return _0x32addc===_0xbdc978;}};if(!_0x3c4827)return null;const _0x1466ed=_0x3c4827['structuredContent'];if(_0x1466ed?.['token']&&typeof _0x1466ed[_0x309dc5(0x157)]===_0xf953bf['LLcEX'])return _0x1466ed['token'];if(_0x3c4827['isError']){const _0x55ee77=_0x3c4827['content'];throw new Error(_0x309dc5(0x108)+(_0x55ee77?.[0x0]?.[_0x309dc5(0x100)]??'Unknown\x20error'));}const _0x286b64=_0x3c4827['content'];if(_0x286b64)for(const _0x569ee2 of _0x286b64){if(_0xf953bf[_0x309dc5(0x121)](_0x569ee2['type'],_0x309dc5(0x100))&&_0x569ee2[_0x309dc5(0x100)]){try{const _0x168431=JSON[_0x309dc5(0x153)](_0x569ee2[_0x309dc5(0x100)]);if(typeof _0x168431?.[_0x309dc5(0x157)]==='string')return _0x168431['token'];}catch{}const _0xf7254=_0x569ee2[_0x309dc5(0x100)]['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0xf7254)return _0xf7254[0x1];}}return null;}
|
|
1
|
+
const _0x10f084=_0x4402;(function(_0x4e4a77,_0x7301a3){const _0x5a781a=_0x4402,_0x136048=_0x4e4a77();while(!![]){try{const _0x23405d=parseInt(_0x5a781a(0x211))/0x1+parseInt(_0x5a781a(0x218))/0x2+parseInt(_0x5a781a(0x21c))/0x3+-parseInt(_0x5a781a(0x1c8))/0x4+parseInt(_0x5a781a(0x1e5))/0x5*(parseInt(_0x5a781a(0x1ee))/0x6)+parseInt(_0x5a781a(0x219))/0x7*(parseInt(_0x5a781a(0x1b1))/0x8)+-parseInt(_0x5a781a(0x1ff))/0x9;if(_0x23405d===_0x7301a3)break;else _0x136048['push'](_0x136048['shift']());}catch(_0x46992a){_0x136048['push'](_0x136048['shift']());}}}(_0xdc2b,0x36353));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(),_0x10f084(0x202),'mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');function _0x4402(_0x5cca37,_0x3a07c9){_0x5cca37=_0x5cca37-0x1a1;const _0xdc2b41=_0xdc2b();let _0x440201=_0xdc2b41[_0x5cca37];return _0x440201;}export async function getMcpAuthOrigin(){const _0x197dab=_0x10f084,_0x46be82={'emBwD':'utf-8','sYAPN':function(_0x7b05ce,_0x579d2d){return _0x7b05ce||_0x579d2d;}};try{const _0x572036=(await readFile(AUTH_ORIGIN_PATH,_0x46be82[_0x197dab(0x1e6)]))[_0x197dab(0x203)]();return _0x46be82[_0x197dab(0x1c6)](_0x572036,null);}catch{return null;}}export async function mcpBootstrap(){const _0x360f8d=_0x10f084,_0x446847={'vmKNa':'proxied','PQJqM':function(_0x2cb595){return _0x2cb595();},'UTVdH':_0x360f8d(0x221),'LIvRa':function(_0x34efc9,_0x4c934d,_0x56ade1){return _0x34efc9(_0x4c934d,_0x56ade1);}},_0x58d9a5=getMcpAuthUrl();currentOrigin=_0x58d9a5;const _0x2d61fe=process[_0x360f8d(0x1e1)]['isTTY']??![];console['log'](_0x360f8d(0x214)+_0x58d9a5+'\x0a');const _0x403af9=await tryUnauthenticated(_0x58d9a5);let _0x577bd1=null;if(_0x403af9===_0x446847['vmKNa'])_0x577bd1='';else{_0x577bd1=await _0x446847['PQJqM'](loadCachedToken);if(!_0x577bd1){if(!_0x2d61fe)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x446847[_0x360f8d(0x1e9)]);_0x577bd1=await oauthFlow(_0x58d9a5);}}await _0x446847[_0x360f8d(0x1c2)](callGetCliToken,_0x58d9a5,_0x577bd1);}async function tryUnauthenticated(_0x3d65c3){const _0x1008ec=_0x10f084,_0x288010={'yTvVs':_0x1008ec(0x1dd),'tOYTj':'application/json,\x20text/event-stream','HQNTO':'ranger-cli'},_0x2b9a70=await fetch(_0x3d65c3,{'method':_0x288010['yTvVs'],'headers':{'Content-Type':_0x1008ec(0x1c9),'Accept':_0x288010[_0x1008ec(0x1be)]},'body':JSON[_0x1008ec(0x1bf)]({'jsonrpc':_0x1008ec(0x21d),'id':0x1,'method':'initialize','params':{'protocolVersion':_0x1008ec(0x207),'capabilities':{},'clientInfo':{'name':_0x288010[_0x1008ec(0x1c0)],'version':_0x1008ec(0x206)}}})});if(_0x2b9a70['ok'])return await _0x2b9a70[_0x1008ec(0x229)](),'proxied';if(_0x2b9a70[_0x1008ec(0x1f9)]===0x191)return await _0x2b9a70['text'](),'needs-oauth';const _0x2b93cd=await _0x2b9a70['text']();throw new Error(_0x1008ec(0x1f6)+_0x2b9a70['status']+':\x20'+_0x2b93cd);}class OAuthTimeoutError extends Error{constructor(_0x24c7f4){const _0x47842c=_0x10f084,_0x3986dd={'FRKFW':'OAuthTimeoutError'};super(_0x24c7f4),this['name']=_0x3986dd[_0x47842c(0x1ec)];}}function _0xdc2b(){const _0x23c3f2=['set','clientId','LwvmP','vGSTw','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','rpArx','type','access_token','UtRZY','632568hErEtQ','EMmzn','state','resource','aCquw','/.well-known/oauth-protected-resource','GZBYS','darwin','oYTHJ','onMZU','registration_endpoint','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','qKxEN','tOYTj','stringify','HQNTO','result','LIvRa','dUmez','end','CjYKs','sYAPN','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','1009520sftHFG','application/json','get','127.0.0.1','token_endpoint','teGUP','tools/call','Requesting\x20CLI\x20token...','OhIbX','ZhDnv','json','UMdYO','slice','refreshToken','PWlso','expiresAt','content-type','client_id','Ynyfm','log','xdg-open','POST','headers','KddaG','mIvYR','stdout','Token\x20exchange\x20failed:\x20','xyglE','error_description','11190PKCBWP','emBwD','TSgtW','client_secret','UTVdH','bMuqG','authorization_code','FRKFW','initialize','702NLTWbE','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','error','string','code','writeHead','\x0aToken\x20written\x20to\x20','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','MCP\x20server\x20returned\x20HTTP\x20','Registering\x20OAuth\x20client...','code_challenge_method','status','Server\x20returned\x20error:\x20','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','refresh_token','token','data:','9653535qBKiOU','apFmx','OKZcV','.ranger','trim','OAuth\x20error:\x20','clientSecret','1.0.0','2025-03-26','rGzeQ','hex','RPNoo','http://localhost:','/callback','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','expires_in','parse','authorization_endpoint','370780RyWVib','YHgwK','wYFkr','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','CGcwx','LCufy','564962gbOmWg','21SufxvK','accessToken','searchParams','1184130jbDOOX','2.0','message','open','platform','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','text/html','Ranger\x20CLI','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','\x0aUnexpected\x20response\x20structure:','qNbNN','application/x-www-form-urlencoded','\x20done','text','content','VOkHg','toString','write','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','EvHUC','Bearer\x20','gnQoF'];_0xdc2b=function(){return _0x23c3f2;};return _0xdc2b();}async function oauthFlow(_0x5e18e8){const _0x2bc5a0=_0x10f084,_0x1aefd4={'qKxpM':function(_0x3465e3){return _0x3465e3();},'UMdYO':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','teGUP':function(_0x5e13cc){return _0x5e13cc();},'hhndB':function(_0x398e5a,_0x2aac3e){return _0x398e5a(_0x2aac3e);}};try{return await oauthFlowAttempt(_0x5e18e8);}catch(_0x169693){if(_0x169693 instanceof OAuthTimeoutError&&await _0x1aefd4['qKxpM'](loadCachedClient))return console[_0x2bc5a0(0x1db)](_0x1aefd4[_0x2bc5a0(0x1d3)]),await _0x1aefd4[_0x2bc5a0(0x1cd)](clearCachedClient),await _0x1aefd4['hhndB'](oauthFlowAttempt,_0x5e18e8);throw _0x169693;}}async function oauthFlowAttempt(_0x2c8462){const _0x37a869=_0x10f084,_0x4e0690={'LwvmP':function(_0x2ab706,_0x571978){return _0x2ab706(_0x571978);},'aCquw':_0x37a869(0x215),'KddaG':_0x37a869(0x1f5),'aCduj':function(_0x2d8eac){return _0x2d8eac();},'cAhpw':_0x37a869(0x1f7),'mBNPU':function(_0x3ac75e,_0x200605,_0x5e4987){return _0x3ac75e(_0x200605,_0x5e4987);},'apFmx':_0x37a869(0x1dd),'mxMVq':'none','xyglE':function(_0x395ccc,_0x204ec1,_0xcf468c){return _0x395ccc(_0x204ec1,_0xcf468c);},'EMmzn':_0x37a869(0x228),'xHGom':function(_0x50e935,_0x374b18){return _0x50e935(_0x374b18);},'EvHUC':'response_type','uFEcD':'code','VOkHg':_0x37a869(0x1d9),'rGzeQ':_0x37a869(0x1f8),'uDmOq':'\x0aOpening\x20browser\x20for\x20authentication...','wYFkr':'Exchanging\x20authorization\x20code...','dUmez':_0x37a869(0x1eb),'UtRZY':_0x37a869(0x1e8),'GZBYS':_0x37a869(0x227)},_0x3b496e=_0x2c8462['replace'](/\/mcp$/,'');process['stdout']['write']('Discovering\x20authorization\x20server...');const _0x1a5957=await _0x4e0690['LwvmP'](fetch,_0x3b496e+_0x37a869(0x1b6));if(!_0x1a5957['ok'])throw new Error(_0x4e0690[_0x37a869(0x1b5)]);const _0x6e5b2d=await _0x1a5957[_0x37a869(0x1d2)](),_0x241e43=_0x6e5b2d['authorization_servers']?.[0x0];if(!_0x241e43)throw new Error(_0x4e0690[_0x37a869(0x1df)]);console['log']('\x20'+_0x241e43);const _0xed77b6=await _0x4e0690['LwvmP'](fetchAuthServerMetadata,_0x241e43);let _0x1e4231,_0xc224e6;const _0x3a5be6=await _0x4e0690['aCduj'](loadCachedClient);if(_0x3a5be6)_0x1e4231=_0x3a5be6[_0x37a869(0x1a9)],_0xc224e6=_0x3a5be6[_0x37a869(0x205)];else{if(_0xed77b6[_0x37a869(0x1bb)]){process[_0x37a869(0x1e1)][_0x37a869(0x1a3)](_0x4e0690['cAhpw']);const _0x2f3159=await _0x4e0690['mBNPU'](fetch,_0xed77b6['registration_endpoint'],{'method':_0x4e0690[_0x37a869(0x200)],'headers':{'Content-Type':_0x37a869(0x1c9)},'body':JSON[_0x37a869(0x1bf)]({'client_name':_0x37a869(0x223),'redirect_uris':[_0x37a869(0x20b)+CALLBACK_PORT+_0x37a869(0x20c)],'grant_types':['authorization_code',_0x37a869(0x1fc)],'response_types':['code'],'token_endpoint_auth_method':_0x4e0690['mxMVq']})});if(!_0x2f3159['ok']){const _0x52ebad=await _0x2f3159[_0x37a869(0x229)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x52ebad);}const _0x2f7b16=await _0x2f3159['json']();_0x1e4231=_0x2f7b16[_0x37a869(0x1d9)],_0xc224e6=_0x2f7b16['client_secret'],await _0x4e0690[_0x37a869(0x1e3)](saveCachedClient,_0x1e4231,_0xc224e6),console['log'](_0x4e0690[_0x37a869(0x1b2)]);}else throw new Error(_0x37a869(0x20d));}const _0x10ddc0=randomBytes(0x20)[_0x37a869(0x1a2)]('base64url'),_0x49771b=createHash('sha256')['update'](_0x10ddc0)['digest']('base64url'),_0x13a504=_0x4e0690['xHGom'](randomBytes,0x10)['toString'](_0x37a869(0x209)),_0x3721f9=new URL(_0xed77b6[_0x37a869(0x210)]);_0x3721f9[_0x37a869(0x21b)][_0x37a869(0x1a8)](_0x4e0690[_0x37a869(0x1a5)],_0x4e0690['uFEcD']),_0x3721f9[_0x37a869(0x21b)]['set'](_0x4e0690[_0x37a869(0x1a1)],_0x1e4231),_0x3721f9['searchParams'][_0x37a869(0x1a8)]('redirect_uri',_0x37a869(0x20b)+CALLBACK_PORT+_0x37a869(0x20c)),_0x3721f9[_0x37a869(0x21b)]['set']('code_challenge',_0x49771b),_0x3721f9[_0x37a869(0x21b)]['set'](_0x4e0690[_0x37a869(0x208)],'S256'),_0x3721f9['searchParams'][_0x37a869(0x1a8)](_0x37a869(0x1b3),_0x13a504);_0x6e5b2d['resource']&&_0x3721f9['searchParams']['set']('resource',_0x6e5b2d['resource']);console['log'](_0x4e0690['uDmOq']),console[_0x37a869(0x1db)](_0x37a869(0x1c7)+_0x3721f9[_0x37a869(0x1a2)]()+'\x0a'),await _0x4e0690[_0x37a869(0x1aa)](openBrowser,_0x3721f9[_0x37a869(0x1a2)]());const _0x4d4a99=await _0x4e0690[_0x37a869(0x1aa)](waitForCallback,_0x13a504);process['stdout'][_0x37a869(0x1a3)](_0x4e0690[_0x37a869(0x213)]);const _0x49160a=new URLSearchParams({'grant_type':_0x4e0690[_0x37a869(0x1c3)],'code':_0x4d4a99,'redirect_uri':_0x37a869(0x20b)+CALLBACK_PORT+'/callback','client_id':_0x1e4231,'code_verifier':_0x10ddc0});_0xc224e6&&_0x49160a[_0x37a869(0x1a8)](_0x4e0690[_0x37a869(0x1b0)],_0xc224e6);_0x6e5b2d['resource']&&_0x49160a[_0x37a869(0x1a8)](_0x37a869(0x1b4),_0x6e5b2d['resource']);const _0x3e966a=await fetch(_0xed77b6[_0x37a869(0x1cc)],{'method':_0x37a869(0x1dd),'headers':{'Content-Type':_0x4e0690[_0x37a869(0x1b7)]},'body':_0x49160a});if(!_0x3e966a['ok']){const _0x41b983=await _0x3e966a[_0x37a869(0x229)]();throw new Error(_0x37a869(0x1e2)+_0x41b983);}const _0x293ccb=await _0x3e966a['json']();return console[_0x37a869(0x1db)](_0x37a869(0x228)),await saveCachedToken(_0x293ccb['access_token'],_0x293ccb[_0x37a869(0x1fc)],_0x293ccb[_0x37a869(0x20e)]),_0x293ccb[_0x37a869(0x1af)];}async function callGetCliToken(_0x72c7ef,_0x5b6123){const _0x2cc37e=_0x10f084,_0x541135={'bMuqG':_0x2cc37e(0x1dd),'jgHWL':'Authorization','SLmOK':function(_0x85f769,_0x1a5142){return _0x85f769(_0x1a5142);},'mIvYR':'2.0','mgobB':_0x2cc37e(0x1ed),'NGcPc':function(_0x2dd676,_0x24dcef,_0x2f4d18){return _0x2dd676(_0x24dcef,_0x2f4d18);},'XelrY':'notifications/initialized','FuTil':_0x2cc37e(0x1cf),'NhNHQ':_0x2cc37e(0x1ce),'VACnB':'get_cli_token','ptNhK':_0x2cc37e(0x228),'qNbNN':_0x2cc37e(0x1bc),'LCufy':'.ranger','GJEwG':'refresh.txt','OKZcV':function(_0x415288,_0x110683,_0x314ddc,_0x25cb7a){return _0x415288(_0x110683,_0x314ddc,_0x25cb7a);},'vwlGZ':'auth-origin.txt','PWlso':_0x2cc37e(0x1ac)},_0x29da04={'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'};_0x5b6123&&(_0x29da04[_0x541135['jgHWL']]=_0x2cc37e(0x1a6)+_0x5b6123);const _0x36771d=async _0x16c6f2=>{const _0x5f34ee=_0x2cc37e,_0x1e5419=await fetch(_0x72c7ef,{'method':_0x541135[_0x5f34ee(0x1ea)],'headers':_0x29da04,'body':JSON['stringify'](_0x16c6f2)});if(!_0x1e5419['ok']){const _0x30c53c=await _0x1e5419[_0x5f34ee(0x229)]();throw new Error('HTTP\x20'+_0x1e5419[_0x5f34ee(0x1f9)]+':\x20'+_0x30c53c);}return parseResponse(_0x1e5419);};process[_0x2cc37e(0x1e1)][_0x2cc37e(0x1a3)]('Initializing\x20MCP\x20session...');const _0x24ecaa=await _0x541135['SLmOK'](_0x36771d,{'jsonrpc':_0x541135['mIvYR'],'id':0x1,'method':_0x541135['mgobB'],'params':{'protocolVersion':_0x2cc37e(0x207),'capabilities':{},'clientInfo':{'name':'ranger-cli','version':'1.0.0'}}});if(_0x24ecaa[_0x2cc37e(0x1f0)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x24ecaa['error'][_0x2cc37e(0x21e)]??JSON[_0x2cc37e(0x1bf)](_0x24ecaa[_0x2cc37e(0x1f0)])));console[_0x2cc37e(0x1db)](_0x2cc37e(0x228)),await _0x541135['NGcPc'](fetch,_0x72c7ef,{'method':_0x2cc37e(0x1dd),'headers':_0x29da04,'body':JSON[_0x2cc37e(0x1bf)]({'jsonrpc':_0x2cc37e(0x21d),'method':_0x541135['XelrY']})})['then'](_0xabf31b=>_0xabf31b['text']()),process[_0x2cc37e(0x1e1)]['write'](_0x541135['FuTil']);const _0x1bf512=await _0x36771d({'jsonrpc':_0x541135[_0x2cc37e(0x1e0)],'id':0x2,'method':_0x541135['NhNHQ'],'params':{'name':_0x541135['VACnB'],'arguments':{}}});if(_0x1bf512[_0x2cc37e(0x1f0)])throw new Error('get_cli_token\x20failed:\x20'+(_0x1bf512['error']['message']??JSON['stringify'](_0x1bf512[_0x2cc37e(0x1f0)])));console[_0x2cc37e(0x1db)](_0x541135['ptNhK']);const _0x38125f=extractToken(_0x1bf512[_0x2cc37e(0x1c1)]);if(!_0x38125f){console['error'](_0x2cc37e(0x225)),console[_0x2cc37e(0x1f0)](JSON[_0x2cc37e(0x1bf)](_0x1bf512['result'],null,0x2));throw new Error(_0x541135[_0x2cc37e(0x226)]);}const _0x1f8c69=join(homedir(),_0x541135[_0x2cc37e(0x217)]),_0x5b9160=join(_0x1f8c69,_0x541135['GJEwG']);await _0x541135['NGcPc'](mkdir,_0x1f8c69,{'recursive':!![]}),await _0x541135[_0x2cc37e(0x201)](writeFile,_0x5b9160,_0x38125f,{'mode':0x180}),await writeFile(join(_0x1f8c69,_0x541135['vwlGZ']),_0x72c7ef,{'mode':0x180}),console['log'](_0x2cc37e(0x1f4)+_0x5b9160),console['log'](_0x541135[_0x2cc37e(0x1d6)]);}async function fetchAuthServerMetadata(_0x372cff){const _0x11b269=_0x10f084,_0x56825e=_0x372cff+'/.well-known/oauth-authorization-server',_0x3ef8ac=await fetch(_0x56825e);if(!_0x3ef8ac['ok'])throw new Error(_0x11b269(0x1a4)+_0x56825e+':\x20'+_0x3ef8ac['status']);return _0x3ef8ac['json']();}function waitForCallback(_0x32dd74){const _0x5cfe18={'sQZHY':function(_0x4c7bee){return _0x4c7bee();},'ZhDnv':function(_0x57c696,_0x4e33dd){return _0x57c696(_0x4e33dd);},'JkwKR':function(_0x1d0a9b,_0xd2049){return _0x1d0a9b(_0xd2049);},'NsHkn':function(_0x4b6489,_0x480184){return _0x4b6489!==_0x480184;},'ykJOP':function(_0x2a4613,_0x2cbb5d,_0x2a5ca6){return _0x2a4613(_0x2cbb5d,_0x2a5ca6);}};return new Promise((_0x256df3,_0x1ba964)=>{const _0x48ff5c=_0x4402,_0x3601aa={'BUSjx':_0x48ff5c(0x20c),'vGSTw':'Not\x20found','CjYKs':'state','EgSfK':_0x48ff5c(0x1f0),'CGcwx':function(_0xbe4eb9,_0x271e18){return _0x5cfe18['JkwKR'](_0xbe4eb9,_0x271e18);},'onMZU':function(_0x243aa2){return _0x243aa2();},'gnQoF':function(_0x4e4ed3,_0x51d6cf){return _0x4e4ed3(_0x51d6cf);},'qKxEN':function(_0x2d172f,_0x464fa1){return _0x5cfe18['NsHkn'](_0x2d172f,_0x464fa1);},'fhECA':_0x48ff5c(0x222),'VrXIK':_0x48ff5c(0x1ef),'TSgtW':_0x48ff5c(0x224)},_0x59e239=()=>{_0x2369cb['closeAllConnections'](),_0x2369cb['close']();},_0x34e6f0=_0x5cfe18['ykJOP'](setTimeout,()=>{_0x5cfe18['sQZHY'](_0x59e239),_0x5cfe18['ZhDnv'](_0x1ba964,new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x2369cb=_0x5cfe18[_0x48ff5c(0x1d1)](createServer,(_0x4a5231,_0x1eb81b)=>{const _0x5d84b8=_0x48ff5c,_0x364a2f=new URL(_0x4a5231['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x364a2f['pathname']!==_0x3601aa['BUSjx']){_0x1eb81b[_0x5d84b8(0x1f3)](0x194),_0x1eb81b['end'](_0x3601aa[_0x5d84b8(0x1ab)]);return;}const _0x21a6cd=_0x364a2f[_0x5d84b8(0x21b)][_0x5d84b8(0x1ca)](_0x5d84b8(0x1f2)),_0x54051c=_0x364a2f['searchParams']['get'](_0x3601aa[_0x5d84b8(0x1c5)]),_0x40c710=_0x364a2f['searchParams']['get'](_0x3601aa['EgSfK']);if(_0x40c710){const _0x2fb21f=_0x364a2f[_0x5d84b8(0x21b)][_0x5d84b8(0x1ca)](_0x5d84b8(0x1e4))??_0x40c710;_0x1eb81b[_0x5d84b8(0x1f3)](0xc8,{'Content-Type':_0x5d84b8(0x222)}),_0x1eb81b[_0x5d84b8(0x1c4)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x2fb21f+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),_0x3601aa[_0x5d84b8(0x216)](clearTimeout,_0x34e6f0),_0x3601aa[_0x5d84b8(0x1ba)](_0x59e239),_0x3601aa[_0x5d84b8(0x1a7)](_0x1ba964,new Error(_0x5d84b8(0x204)+_0x2fb21f));return;}if(!_0x21a6cd||_0x3601aa[_0x5d84b8(0x1bd)](_0x54051c,_0x32dd74)){_0x1eb81b['writeHead'](0x190,{'Content-Type':_0x3601aa['fhECA']}),_0x1eb81b[_0x5d84b8(0x1c4)](_0x3601aa['VrXIK']);return;}_0x1eb81b[_0x5d84b8(0x1f3)](0xc8,{'Content-Type':_0x3601aa['fhECA']}),_0x1eb81b['end'](_0x3601aa[_0x5d84b8(0x1e7)]),_0x3601aa['gnQoF'](clearTimeout,_0x34e6f0),_0x59e239(),_0x256df3(_0x21a6cd);});_0x2369cb['listen'](CALLBACK_PORT,_0x48ff5c(0x1cb));});}async function openBrowser(_0x40f292){const _0x4d089c=_0x10f084,_0x191963={'qegqI':function(_0x396b92,_0x36af5c){return _0x396b92===_0x36af5c;},'RPNoo':_0x4d089c(0x1b8),'iHHwN':'win32','BssKS':'start'},_0x34a13e=_0x191963['qegqI'](process[_0x4d089c(0x220)],_0x191963[_0x4d089c(0x20a)])?_0x4d089c(0x21f):process['platform']===_0x191963['iHHwN']?_0x191963['BssKS']:_0x4d089c(0x1dc);exec(_0x34a13e+'\x20\x22'+_0x40f292+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x1aa9d8=_0x10f084,_0x5b20be={'IvbpL':function(_0x401027,_0x5c8441){return _0x401027>_0x5c8441;}};try{const _0x225c16=JSON['parse'](await readFile(TOKEN_CACHE_PATH,'utf-8'));if(_0x225c16['origin']&&_0x225c16['origin']!==currentOrigin)return null;if(_0x225c16[_0x1aa9d8(0x1d7)]&&_0x5b20be['IvbpL'](Date['now'](),_0x225c16['expiresAt']))return null;return _0x225c16[_0x1aa9d8(0x21a)]??null;}catch{return null;}}async function saveCachedToken(_0x5e0a03,_0x39dde7,_0x2e44c3){const _0x4771a8=_0x10f084,_0x2c4c6b={'rpArx':function(_0x43418d){return _0x43418d();},'rnMPe':function(_0x7faf16,_0x41ae73){return _0x7faf16+_0x41ae73;},'gESjG':function(_0x2ad729,_0x7871c6,_0x3a4006,_0x42a23c){return _0x2ad729(_0x7871c6,_0x3a4006,_0x42a23c);}},_0x4d0e20=await _0x2c4c6b['rpArx'](loadCachedData),_0x2ec66d={..._0x4d0e20,'origin':currentOrigin,'accessToken':_0x5e0a03,'refreshToken':_0x39dde7??_0x4d0e20?.[_0x4771a8(0x1d5)],'expiresAt':_0x2e44c3?_0x2c4c6b['rnMPe'](Date['now'](),_0x2e44c3*0x3e8):undefined};await mkdir(join(_0x2c4c6b[_0x4771a8(0x1ad)](homedir),'.ranger'),{'recursive':!![]}),await _0x2c4c6b['gESjG'](writeFile,TOKEN_CACHE_PATH,JSON[_0x4771a8(0x1bf)](_0x2ec66d),{'mode':0x180});}async function loadCachedClient(){const _0x3c80a1=_0x10f084,_0xfdfee={'oYTHJ':function(_0x352e1e){return _0x352e1e();},'MKeIX':function(_0xa63846,_0x49e1b6){return _0xa63846!==_0x49e1b6;}},_0x7aae06=await _0xfdfee[_0x3c80a1(0x1b9)](loadCachedData);if(_0x7aae06?.['origin']&&_0xfdfee['MKeIX'](_0x7aae06['origin'],currentOrigin))return null;return _0x7aae06?.[_0x3c80a1(0x1a9)]?{'clientId':_0x7aae06['clientId'],'clientSecret':_0x7aae06['clientSecret']}:null;}async function clearCachedClient(){const _0x6fce5d=_0x10f084,_0x508301={'Ynyfm':function(_0xd9cd70,_0xd5e6d0,_0x1aa0ca,_0x368431){return _0xd9cd70(_0xd5e6d0,_0x1aa0ca,_0x368431);}},_0x2b227e=await loadCachedData();if(!_0x2b227e)return;const {clientId:_0x886ec4,clientSecret:_0x27f6ea,..._0x596927}=_0x2b227e;await _0x508301[_0x6fce5d(0x1da)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x596927),{'mode':0x180});}async function saveCachedClient(_0x34718a,_0x2efe21){const _0x52bb88={'UlTcV':function(_0x3bca62){return _0x3bca62();},'Nmimu':function(_0x4347bc,_0x2cee51,_0x27fe81){return _0x4347bc(_0x2cee51,_0x27fe81);}},_0x3bd5c3=await _0x52bb88['UlTcV'](loadCachedData),_0x44aed5={..._0x3bd5c3,'origin':currentOrigin,'accessToken':_0x3bd5c3?.['accessToken']??'','clientId':_0x34718a,'clientSecret':_0x2efe21};await mkdir(_0x52bb88['Nmimu'](join,homedir(),'.ranger'),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x44aed5),{'mode':0x180});}async function loadCachedData(){const _0x422ac6=_0x10f084,_0x3d0246={'nHuIO':'utf-8'};try{return JSON[_0x422ac6(0x20f)](await readFile(TOKEN_CACHE_PATH,_0x3d0246['nHuIO']));}catch{return null;}}async function parseResponse(_0x521dc0){const _0x1e352c=_0x10f084,_0x12491d={'cNhwV':_0x1e352c(0x1d8),'OhIbX':_0x1e352c(0x1fe)},_0x25421b=_0x521dc0[_0x1e352c(0x1de)]['get'](_0x12491d['cNhwV'])??'';if(_0x25421b['includes']('text/event-stream')){const _0x25077d=await _0x521dc0[_0x1e352c(0x229)]();for(const _0x3692ec of _0x25077d['split']('\x0a')){const _0x2de814=_0x3692ec[_0x1e352c(0x203)]();if(_0x2de814['startsWith'](_0x12491d['OhIbX'])){const _0x179c8e=_0x2de814[_0x1e352c(0x1d4)](_0x12491d[_0x1e352c(0x1d0)]['length'])['trim']();if(!_0x179c8e)continue;try{const _0x1678a8=JSON[_0x1e352c(0x20f)](_0x179c8e);if(_0x1678a8['id']!==undefined||_0x1678a8[_0x1e352c(0x1f0)])return _0x1678a8;}catch{}}}throw new Error(_0x1e352c(0x1fb));}return _0x521dc0['json']();}function extractToken(_0x3fd596){const _0xa0d205=_0x10f084,_0x560d21={'YHgwK':_0xa0d205(0x1f1),'pUhrX':function(_0x927e88,_0x5a6184){return _0x927e88===_0x5a6184;},'AJXsU':_0xa0d205(0x229)};if(!_0x3fd596)return null;const _0xffe745=_0x3fd596['structuredContent'];if(_0xffe745?.[_0xa0d205(0x1fd)]&&typeof _0xffe745['token']===_0x560d21[_0xa0d205(0x212)])return _0xffe745[_0xa0d205(0x1fd)];if(_0x3fd596['isError']){const _0x1bf687=_0x3fd596[_0xa0d205(0x22a)];throw new Error(_0xa0d205(0x1fa)+(_0x1bf687?.[0x0]?.[_0xa0d205(0x229)]??'Unknown\x20error'));}const _0x4a284b=_0x3fd596['content'];if(_0x4a284b)for(const _0x3a3058 of _0x4a284b){if(_0x560d21['pUhrX'](_0x3a3058[_0xa0d205(0x1ae)],_0x560d21['AJXsU'])&&_0x3a3058[_0xa0d205(0x229)]){try{const _0x4b1b1e=JSON[_0xa0d205(0x20f)](_0x3a3058['text']);if(typeof _0x4b1b1e?.[_0xa0d205(0x1fd)]===_0x560d21[_0xa0d205(0x212)])return _0x4b1b1e[_0xa0d205(0x1fd)];}catch{}const _0x467dc6=_0x3a3058['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x467dc6)return _0x467dc6[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x29bf(){var _0x249a90=['1338mKjLGy','1WOROZt','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','7FNneWj','27475OjDFkn','rarMQ','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','FZFYd','14647259gqcfkz','2883178JkMhAd','eChkv','859461PfmDMn','2809630CzCAVT','8858392YwNjLL','18GGztKR','error','2263976LrcUGX'];_0x29bf=function(){return _0x249a90;};return _0x29bf();}(function(_0x5c70c9,_0x2f1a4f){var _0x2a24b1=_0x496d,_0x41a549=_0x5c70c9();while(!![]){try{var _0x452df9=parseInt(_0x2a24b1(0x1e1))/0x1*(parseInt(_0x2a24b1(0x1d8))/0x2)+parseInt(_0x2a24b1(0x1da))/0x3+parseInt(_0x2a24b1(0x1df))/0x4+parseInt(_0x2a24b1(0x1d2))/0x5*(-parseInt(_0x2a24b1(0x1e0))/0x6)+-parseInt(_0x2a24b1(0x1d1))/0x7*(parseInt(_0x2a24b1(0x1dc))/0x8)+-parseInt(_0x2a24b1(0x1dd))/0x9*(parseInt(_0x2a24b1(0x1db))/0xa)+parseInt(_0x2a24b1(0x1d7))/0xb;if(_0x452df9===_0x2f1a4f)break;else _0x41a549['push'](_0x41a549['shift']());}catch(_0x1aa15c){_0x41a549['push'](_0x41a549['shift']());}}}(_0x29bf,0xb2795));function _0x496d(_0x5daacf,_0x312c95){_0x5daacf=_0x5daacf-0x1d1;var _0x29bf33=_0x29bf();var _0x496df9=_0x29bf33[_0x5daacf];return _0x496df9;}export async function migrateProfile(_0x2671c7,_0x27493a){var _0x1d94b7=_0x496d,_0x4e47fa={'FZFYd':function(_0x41d178,_0x1a3d0b){return _0x41d178+_0x1a3d0b;},'RStmn':function(_0x1e505a,_0x3ef35e){return _0x1e505a+_0x3ef35e;},'iOpsI':function(_0x472155,_0x46e011){return _0x472155+_0x46e011;},'eChkv':function(_0x5d474e,_0x183b97){return _0x5d474e+_0x183b97;},'rarMQ':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a'};console[_0x1d94b7(0x1de)](_0x4e47fa['FZFYd'](_0x4e47fa[_0x1d94b7(0x1d6)](_0x4e47fa[_0x1d94b7(0x1d6)](_0x4e47fa['RStmn'](_0x4e47fa['iOpsI'](_0x4e47fa['iOpsI'](_0x4e47fa[_0x1d94b7(0x1d9)](_0x4e47fa[_0x1d94b7(0x1d3)],'\x0a')+_0x1d94b7(0x1d5)+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','\x0a'),_0x1d94b7(0x1e2)),_0x1d94b7(0x1d4)),'\x0a'),'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a'),'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.')),process['exit'](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1ddc30,_0x4bdd62){const _0x4e4585=_0xe837,_0x4fd33e=_0x1ddc30();while(!![]){try{const _0x3ed56c=parseInt(_0x4e4585(0xc4))/0x1*(parseInt(_0x4e4585(0xc3))/0x2)+parseInt(_0x4e4585(0xc8))/0x3*(parseInt(_0x4e4585(0xbd))/0x4)+-parseInt(_0x4e4585(0xb8))/0x5*(parseInt(_0x4e4585(0xc6))/0x6)+parseInt(_0x4e4585(0xc5))/0x7*(parseInt(_0x4e4585(0xac))/0x8)+-parseInt(_0x4e4585(0xc2))/0x9*(-parseInt(_0x4e4585(0xaf))/0xa)+-parseInt(_0x4e4585(0xb5))/0xb+-parseInt(_0x4e4585(0xaa))/0xc;if(_0x3ed56c===_0x4bdd62)break;else _0x4fd33e['push'](_0x4fd33e['shift']());}catch(_0x41bbc8){_0x4fd33e['push'](_0x4fd33e['shift']());}}}(_0x4f56,0xefc50));import{join}from'path';import{existsSync}from'fs';import _0x531c04 from'inquirer';import{skillup}from'../skillup.js';function _0x4f56(){const _0x165728=['.claude','SlttS','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','⚠\x20Failed\x20to\x20enable\x20plugin:','ltQJV','11888393OQInRM','jhJJm','yRsiL','8031245wFJyhi','ranger@trailhead','\x0aYou\x20can\x20install\x20manually\x20with:','marketplace','MvqST','3220532qbSpLJ','cFDmh','plugin','yyniS','fnHGG','45owhLXP','44122rjGQwG','89cWvhyU','39466gMlRGc','6lBHjNL','error','3HAOWoO','log','voJId','confirm','kuvil','❌\x20Failed\x20to\x20add\x20marketplace:','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','tDdDX','install','Would\x20you\x20like\x20to\x20install\x20skills?','pluginScope','wantsSkillup','gpUnY','list','trailhead','ozueK','jtzmf','project','✓\x20Ranger\x20skills\x20already\x20installed','KQzym','includes','user','--scope','yxntw','enable','pszyi','24618660ngkQlC','ranger','2256ZuMqdE','Fgxdl','success','2724370FCYnyY'];_0x4f56=function(){return _0x165728;};return _0x4f56();}import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x3a342b){const _0xe61d41=_0xe837,_0x3667b2={'SoxUf':function(_0xb236be,_0x46fbc2){return _0xb236be(_0x46fbc2);},'cFDmh':_0xe61d41(0xb9),'pszyi':function(_0x253e11,_0x109eaf,_0x588d00){return _0x253e11(_0x109eaf,_0x588d00);},'tDdDX':'\x0a📦\x20Claude\x20Code\x20Plugin\x0a','iobeF':_0xe61d41(0xd5),'yRsiL':_0xe61d41(0xa5),'SlttS':'Project\x20(shared\x20with\x20team\x20via\x20git)','fmkoy':function(_0x545c6e,_0x4f131b){return _0x545c6e(_0x4f131b);},'fnHGG':'✓\x20Marketplace\x20already\x20added','Fgxdl':function(_0x4122d1,_0x655a3b){return _0x4122d1(_0x655a3b);},'ltQJV':_0xe61d41(0xbb),'TdoQo':_0xe61d41(0xcd),'SOXnc':_0xe61d41(0xd9),'voJId':_0xe61d41(0xce),'IugUr':'plugin','NfJpJ':'--scope','zCqeU':function(_0xfe4fef,_0x5e83dd){return _0xfe4fef===_0x5e83dd;},'jtzmf':function(_0x44b6e0){return _0x44b6e0();},'jhJJm':'already\x20enabled','SCHzs':'✓\x20Claude\x20Code\x20plugin\x20enabled'},_0x4e6bd7=await _0x3667b2['SoxUf'](isPluginInstalled,_0x3667b2[_0xe61d41(0xbe)]);if(_0x4e6bd7)return console['log']('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];const _0x5797d9=_0x3667b2['SoxUf'](existsSync,_0x3667b2[_0xe61d41(0xa9)](join,getProjectRoot(),_0xe61d41(0xb0)));let _0x3e018d;if(_0x3a342b)_0x3e018d=_0x3a342b;else{if(_0x5797d9)_0x3e018d='project';else{console[_0xe61d41(0xc9)](_0x3667b2[_0xe61d41(0xcf)]);const _0x37eed9=await _0x531c04['prompt']([{'type':_0x3667b2['iobeF'],'name':'pluginScope','message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x3667b2[_0xe61d41(0xb7)]},{'name':_0x3667b2[_0xe61d41(0xb1)],'value':_0xe61d41(0xd9)}],'default':'user'}]);_0x3e018d=_0x37eed9[_0xe61d41(0xd2)];}}console['log']('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x3e018d+'\x20level)...\x0a');const _0x2efcb9=await _0x3667b2['fmkoy'](isMarketplaceAdded,_0xe61d41(0xd6));let _0xcc2e27=_0x2efcb9;if(_0x2efcb9)console[_0xe61d41(0xc9)](_0x3667b2[_0xe61d41(0xc1)]);else{const _0x6207cb=await _0x3667b2[_0xe61d41(0xad)](runClaudeCommand,[_0xe61d41(0xbf),_0x3667b2[_0xe61d41(0xb4)],'add','ranger-testing/trailhead']);!_0x6207cb[_0xe61d41(0xae)]?(console[_0xe61d41(0xc7)](_0x3667b2['TdoQo'],_0x6207cb['error']),console[_0xe61d41(0xc9)](_0xe61d41(0xba)),console['log']('\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead'),console[_0xe61d41(0xc9)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x3e018d)):_0xcc2e27=!![];}if(_0xcc2e27){const _0x233e3d=await runClaudeCommand(['plugin',_0xe61d41(0xd0),_0x3667b2[_0xe61d41(0xbe)],_0xe61d41(0xa6),_0x3e018d],{'cwd':_0x3e018d===_0x3667b2['SOXnc']?getProjectRoot():undefined});if(!_0x233e3d[_0xe61d41(0xae)])console[_0xe61d41(0xc7)]('❌\x20Failed\x20to\x20install\x20plugin:',_0x233e3d['error']),console['log'](_0xe61d41(0xba)),console['log'](_0xe61d41(0xb2)+_0x3e018d);else{console['log'](_0x3667b2[_0xe61d41(0xca)]);const _0xd5a926=[_0x3667b2['IugUr'],_0xe61d41(0xa8),'ranger@trailhead'];_0x3e018d===_0xe61d41(0xd9)&&_0xd5a926['push'](_0x3667b2['NfJpJ'],_0xe61d41(0xd9));const _0x4f91df=await _0x3667b2[_0xe61d41(0xa9)](runClaudeCommand,_0xd5a926,{'captureOutput':!![],'cwd':_0x3667b2['zCqeU'](_0x3e018d,_0xe61d41(0xd9))?_0x3667b2[_0xe61d41(0xd8)](getProjectRoot):undefined}),_0x475643=_0x4f91df['output']?.[_0xe61d41(0xa4)](_0x3667b2[_0xe61d41(0xb6)]);!_0x4f91df[_0xe61d41(0xae)]&&!_0x475643?console['error'](_0xe61d41(0xb3),_0x4f91df[_0xe61d41(0xc7)]):console['log'](_0x3667b2['SCHzs']);}}return!![];}function _0xe837(_0x6f2aea,_0x2ecb6f){_0x6f2aea=_0x6f2aea-0xa4;const _0x4f5685=_0x4f56();let _0xe837f5=_0x4f5685[_0x6f2aea];return _0xe837f5;}export async function ensureClaudeSkills(_0x3f26ef){const _0x23af94=_0xe837,_0x1af278={'MvqST':function(_0x5c4814,_0x54903b){return _0x5c4814(_0x54903b);},'iojhK':_0x23af94(0xa5),'yxntw':'SKILL.md','kuvil':'project','EKPur':_0x23af94(0xda),'fsPNG':function(_0x5f3104){return _0x5f3104();},'KQzym':_0x23af94(0xb0),'yyniS':_0x23af94(0xcb),'gpUnY':_0x23af94(0xd3),'ozueK':_0x23af94(0xd1)},_0x34389e=_0x1af278['MvqST'](existsSync,join(getSkillsDir(_0x1af278['iojhK']),_0x23af94(0xab),_0x1af278[_0x23af94(0xa7)])),_0x51f23b=_0x1af278[_0x23af94(0xbc)](existsSync,join(getSkillsDir(_0x1af278[_0x23af94(0xcc)]),_0x23af94(0xab),_0x1af278['yxntw']));if(_0x34389e||_0x51f23b)return console[_0x23af94(0xc9)](_0x1af278['EKPur']),![];const _0x5b8aad=existsSync(join(_0x1af278['fsPNG'](getProjectRoot),_0x1af278[_0x23af94(0xdb)]));let _0x21d7ef=!![];if(_0x3f26ef)await skillup({'autoInstall':_0x3f26ef,'suppressUsage':!![]});else{if(_0x5b8aad)await skillup({'autoInstall':_0x1af278['kuvil'],'suppressUsage':!![]});else{const _0x1b320a=await _0x531c04['prompt']([{'type':_0x1af278[_0x23af94(0xc0)],'name':_0x1af278[_0x23af94(0xd4)],'message':_0x1af278[_0x23af94(0xd7)],'default':!![]}]);_0x21d7ef=_0x1b320a['wantsSkillup'],_0x21d7ef&&await skillup({'suppressUsage':!![]});}}return _0x21d7ef;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x546e80,_0x57427b){const _0x2e977a=_0x5355,_0x590b88=_0x546e80();while(!![]){try{const _0x2ea96c=-parseInt(_0x2e977a(0xeb))/0x1*(-parseInt(_0x2e977a(0xe8))/0x2)+parseInt(_0x2e977a(0xd6))/0x3+parseInt(_0x2e977a(0xde))/0x4+-parseInt(_0x2e977a(0xef))/0x5+parseInt(_0x2e977a(0xec))/0x6+parseInt(_0x2e977a(0xe7))/0x7*(parseInt(_0x2e977a(0xda))/0x8)+-parseInt(_0x2e977a(0xd7))/0x9;if(_0x2ea96c===_0x57427b)break;else _0x590b88['push'](_0x590b88['shift']());}catch(_0x2c08bb){_0x590b88['push'](_0x590b88['shift']());}}}(_0x147d,0x7f9fb));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x5185c1 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';function _0x5355(_0x4d663d,_0x157601){_0x4d663d=_0x4d663d-0xd6;const _0x147d96=_0x147d();let _0x535528=_0x147d96[_0x4d663d];return _0x535528;}export async function ensureOpencodePluginConfig(_0x4c0507){const _0x5e0a62=_0x5355,_0x426320={'EOnPt':function(_0xa8b7f8,_0x8216ed){return _0xa8b7f8(_0x8216ed);},'eYyNd':'opencode.json','TlgKv':_0x5e0a62(0xe1),'srBWo':'\x0a📦\x20OpenCode\x20Plugin\x0a','lLvxf':_0x5e0a62(0xf1),'XzkAk':'User\x20(available\x20in\x20all\x20your\x20projects)','GzEUM':'user','PNwTA':_0x5e0a62(0xed),'Whzul':function(_0x56663c,_0xef5e37,_0x5cea85){return _0x56663c(_0xef5e37,_0x5cea85);},'ZdzeP':function(_0x334db6,_0x5ca462){return _0x334db6+_0x5ca462;},'wSuBb':'✓\x20OpenCode\x20plugin\x20configured'},_0x512cf0=_0x426320[_0x5e0a62(0xdd)](existsSync,join(_0x426320['EOnPt'](getOpencodeConfigDir,_0x5e0a62(0xe1)),_0x426320[_0x5e0a62(0xe9)]));let _0x44ac07;if(_0x4c0507)_0x44ac07=_0x4c0507;else{if(_0x512cf0)_0x44ac07=_0x426320['TlgKv'];else{console[_0x5e0a62(0xee)](_0x426320[_0x5e0a62(0xe5)]);const _0x4892d4=await _0x5185c1[_0x5e0a62(0xf3)]([{'type':_0x5e0a62(0xe3),'name':_0x5e0a62(0xea),'message':_0x426320['lLvxf'],'choices':[{'name':_0x426320['XzkAk'],'value':_0x426320[_0x5e0a62(0xe0)]},{'name':_0x5e0a62(0xdb),'value':'project'}],'default':_0x426320['GzEUM']}]);_0x44ac07=_0x4892d4['pluginScope'];}}const _0x375780=join(_0x426320['EOnPt'](getOpencodeConfigDir,_0x44ac07),_0x426320['eYyNd']),_0x194bcf=_0x5e0a62(0xe4),_0x2f7a0a='https://opencode.ai/config.json';let _0x438f2a={};if(existsSync(_0x375780))try{const _0x31a02b=await readFile(_0x375780,_0x5e0a62(0xdf));_0x438f2a=JSON['parse'](_0x31a02b);}catch(_0x559d82){return console[_0x5e0a62(0xf2)](_0x426320['PNwTA']),{'configured':![],'scope':_0x44ac07,'error':'Failed\x20to\x20read\x20opencode.json','details':_0x559d82};}const _0x33ba0e=Array[_0x5e0a62(0xe6)](_0x438f2a['plugin'])?_0x438f2a[_0x5e0a62(0xd9)]:[];if(_0x33ba0e['includes'](_0x194bcf))return console[_0x5e0a62(0xee)]('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x44ac07};return _0x438f2a[_0x5e0a62(0xf0)]=_0x438f2a[_0x5e0a62(0xf0)]||_0x2f7a0a,_0x438f2a[_0x5e0a62(0xd9)]=[..._0x33ba0e,_0x194bcf],await _0x426320['Whzul'](mkdir,getOpencodeConfigDir(_0x44ac07),{'recursive':!![]}),await writeFile(_0x375780,_0x426320[_0x5e0a62(0xe2)](JSON[_0x5e0a62(0xd8)](_0x438f2a,null,0x2),'\x0a')),console[_0x5e0a62(0xee)](_0x426320[_0x5e0a62(0xdc)]),{'configured':!![],'scope':_0x44ac07};}function _0x147d(){const _0x40fcea=['list','@ranger-testing/opencode-plugin','srBWo','isArray','6879733Sacilm','1395574vDAEuW','eYyNd','pluginScope','1gZPCyY','2930388IrkPki','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','log','2159030MxQwrc','$schema','Where\x20should\x20the\x20plugin\x20be\x20installed?','error','prompt','2097105ZJuySv','24894081iiKXfB','stringify','plugin','8OvaRbl','Project\x20(shared\x20with\x20team\x20via\x20git)','wSuBb','EOnPt','3410092HaWUuE','utf-8','GzEUM','project','ZdzeP'];_0x147d=function(){return _0x40fcea;};return _0x147d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x206b(_0x162a4c,_0xd58782){_0x162a4c=_0x162a4c-0x94;var _0x94f85c=_0x94f8();var _0x206b03=_0x94f85c[_0x162a4c];return _0x206b03;}(function(_0x3a6a88,_0x53a384){var _0x47ef14=_0x206b,_0x448ea4=_0x3a6a88();while(!![]){try{var _0x6f83b3=parseInt(_0x47ef14(0x9f))/0x1+parseInt(_0x47ef14(0x9a))/0x2*(parseInt(_0x47ef14(0x99))/0x3)+-parseInt(_0x47ef14(0x94))/0x4+parseInt(_0x47ef14(0x96))/0x5*(-parseInt(_0x47ef14(0xa0))/0x6)+parseInt(_0x47ef14(0x9d))/0x7*(parseInt(_0x47ef14(0xa2))/0x8)+parseInt(_0x47ef14(0x98))/0x9+parseInt(_0x47ef14(0x9e))/0xa;if(_0x6f83b3===_0x53a384)break;else _0x448ea4['push'](_0x448ea4['shift']());}catch(_0x696cb5){_0x448ea4['push'](_0x448ea4['shift']());}}}(_0x94f8,0xb00b9));function _0x94f8(){var _0x3aa5b2=['88zjbVBd','afEbb','1721620iLcWJQ','ZpVse','3434815pKMhpA','exit','8578323pSeYFy','15earHoY','33870lOcSSp','oSSOI','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','503853sgqqoZ','2165190BlkZoe','479302izWDJd','12cfnrUB','\x20\x20ranger\x20profile\x20add\x20<name>\x0a'];_0x94f8=function(){return _0x3aa5b2;};return _0x94f8();}export async function setupCi(_0x2aac5a,_0x1982f2,_0x4aacfb){var _0x2e15ab=_0x206b,_0x4b89d6={'yotrD':function(_0x4160b2,_0x4d0f8d){return _0x4160b2+_0x4d0f8d;},'afEbb':function(_0x3de9fc,_0x56f03e){return _0x3de9fc+_0x56f03e;},'DgARf':function(_0x1f2e08,_0x18d435){return _0x1f2e08+_0x18d435;},'oSSOI':function(_0x342425,_0x41a61e){return _0x342425+_0x41a61e;},'ZpVse':_0x2e15ab(0xa1)};console['error'](_0x4b89d6['yotrD'](_0x4b89d6[_0x2e15ab(0xa3)](_0x4b89d6['DgARf'](_0x4b89d6[_0x2e15ab(0x9b)]('ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','\x0a')+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a',_0x4b89d6[_0x2e15ab(0x95)]),'\x0a'),_0x2e15ab(0x9c))+'\x20\x20https://docs.ranger.net/main/concepts/profiles'),process[_0x2e15ab(0x97)](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x45a939,_0x4598ed){const _0x186a80=_0x263c,_0xb2e02f=_0x45a939();while(!![]){try{const _0x1db408=parseInt(_0x186a80(0x114))/0x1+parseInt(_0x186a80(0xf5))/0x2+parseInt(_0x186a80(0xfe))/0x3+-parseInt(_0x186a80(0x10c))/0x4*(parseInt(_0x186a80(0x111))/0x5)+parseInt(_0x186a80(0x113))/0x6+parseInt(_0x186a80(0x104))/0x7*(parseInt(_0x186a80(0xef))/0x8)+-parseInt(_0x186a80(0x10d))/0x9;if(_0x1db408===_0x4598ed)break;else _0xb2e02f['push'](_0xb2e02f['shift']());}catch(_0x2657a6){_0xb2e02f['push'](_0xb2e02f['shift']());}}}(_0x2442,0xc256e));import{basename}from'path';import _0x183501 from'inquirer';import{getToken}from'./utils/keychain.js';function _0x2442(){const _0xe3d7a1=['\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','lvkYe','/skills/','201789mmvjko','log','Where\x20should\x20skills\x20be\x20installed?','suppressUsage','\x20successfully!\x0a','hEqUq','55006PCFtWk','\x20skill','ranger','fmBpe','cxQXv','UBuuG','\x0a📦\x20Installing\x20skills...\x0a','mvGIm','12KbxdGH','15456618WDLIuf','list','claude','\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!','414160ZhqgJo','This\x20project\x20only\x20(','9512280ZsNbFC','227079dmjCFZ','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','\x20--opencode','ocoRz','456GjvfKD','message','All\x20projects\x20(','prompt','Rngcz','To\x20use:','868568PEKUVz','project-level','project','matMc','autoInstall','vXGNX'];_0x2442=function(){return _0xe3d7a1;};return _0x2442();}import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';function _0x263c(_0x2d4dd2,_0x267532){_0x2d4dd2=_0x2d4dd2-0xef;const _0x2442e0=_0x2442();let _0x263c7d=_0x2442e0[_0x2d4dd2];return _0x263c7d;}import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x383591={}){const _0x2ab05d=_0x263c,_0xdf6ca1={'idILp':'\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','GbEkr':'❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','nLiYs':'\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','fmBpe':'opencode','Rngcz':function(_0x27e7ac,_0x109556){return _0x27e7ac===_0x109556;},'DXepe':_0x2ab05d(0x116),'matMc':'✓\x20Found\x20API\x20token','lvkYe':function(_0x433364,_0x2c8fcd){return _0x433364===_0x2c8fcd;},'hEqUq':function(_0x10ea62,_0xec367e){return _0x10ea62===_0xec367e;},'vXGNX':_0x2ab05d(0x10e),'MFQvR':function(_0x4f9f42){return _0x4f9f42();},'mvGIm':function(_0x56f9ab,_0x38d405){return _0x56f9ab instanceof _0x38d405;},'ocoRz':function(_0x2465d7,_0x2ae757){return _0x2465d7>_0x2ae757;},'UBuuG':_0x2ab05d(0xf6),'cxQXv':_0x2ab05d(0xfb),'nDIQb':'\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a'};console['log'](_0xdf6ca1['idILp']);const _0x4ce444=_0x383591['platform']??_0x2ab05d(0x10f),_0x96ae47=await getToken();if(!_0x96ae47){console[_0x2ab05d(0xff)](_0xdf6ca1['GbEkr']),console['log']('To\x20get\x20started:'),console['log'](_0xdf6ca1['nLiYs']),console[_0x2ab05d(0xff)]('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x4ce444===_0xdf6ca1[_0x2ab05d(0x107)]?_0x2ab05d(0x116):'')+'\x20<your-api-token>'),console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0xdf6ca1[_0x2ab05d(0xf3)](_0x4ce444,'opencode')?_0xdf6ca1['DXepe']:'')+'\x0a');return;}console[_0x2ab05d(0xff)](_0xdf6ca1[_0x2ab05d(0xf8)]);const _0x54d5d3=getProjectRoot(),_0x3e3b59=basename(_0x54d5d3),_0x30724a=_0xdf6ca1[_0x2ab05d(0xfc)](_0x4ce444,_0xdf6ca1[_0x2ab05d(0x107)])?getOpencodeConfigDir('user')+_0x2ab05d(0xfd):getClaudeConfigDir()+'/skills/',_0x266a98=_0xdf6ca1[_0x2ab05d(0x103)](_0x4ce444,_0xdf6ca1['fmBpe'])?_0x54d5d3+'/.opencode/skills/':_0x54d5d3+'/.claude/skills/',_0x371a90=process['stdin']['isTTY']&&process['stdout']['isTTY'];let _0xc804fa;if(_0x383591['autoInstall'])_0xc804fa=_0x383591[_0x2ab05d(0xf9)];else{if(_0x371a90){const _0x57cd73=await _0x183501[_0x2ab05d(0xf2)]([{'type':_0xdf6ca1[_0x2ab05d(0xfa)],'name':'installLevel','message':_0x2ab05d(0x100),'choices':[{'name':_0x2ab05d(0xf1)+_0x30724a+')','value':'user'},{'name':_0x2ab05d(0x112)+_0x266a98+')','value':_0x2ab05d(0xf7)}]}]);_0xc804fa=_0x57cd73['installLevel'];}else _0xc804fa=_0x2ab05d(0xf7),console['log']('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x266a98+')');}let _0xe32428=0x0;const _0x295eaa=_0xdf6ca1['MFQvR'](getCurrentVersion);console['log'](_0x2ab05d(0x10a));try{const _0x3f2019=await installSkill(_0x2ab05d(0x106),{'cliVersion':_0x295eaa,'level':_0xc804fa,'platform':_0x4ce444});_0x3f2019&&_0xe32428++;}catch(_0x83786a){console['warn'](_0x2ab05d(0x115),_0xdf6ca1[_0x2ab05d(0x10b)](_0x83786a,Error)?_0x83786a[_0x2ab05d(0xf0)]:_0x83786a);}if(_0xdf6ca1[_0x2ab05d(0x117)](_0xe32428,0x0)){const _0x1a2667=_0xdf6ca1['hEqUq'](_0xc804fa,'user')?'user-level':_0xdf6ca1[_0x2ab05d(0x109)];console['log']('\x0a✅\x20Installed\x20'+_0xe32428+'\x20'+_0x1a2667+_0x2ab05d(0x105)+(_0xe32428>0x1?'s':'')+_0x2ab05d(0x102)),!_0x383591[_0x2ab05d(0x101)]&&(console[_0x2ab05d(0xff)](_0x2ab05d(0xf4)),_0xdf6ca1[_0x2ab05d(0xf3)](_0x4ce444,_0xdf6ca1[_0x2ab05d(0x107)])?console[_0x2ab05d(0xff)](_0xdf6ca1[_0x2ab05d(0x108)]):console[_0x2ab05d(0xff)](_0x2ab05d(0x110)));}else console['log'](_0xdf6ca1['nDIQb']);}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x47b65a=_0x8395;(function(_0x2f71f6,_0x1b8b32){const _0x27d300=_0x8395,_0x2868e7=_0x2f71f6();while(!![]){try{const _0xd4ae76=parseInt(_0x27d300(0x22f))/0x1+parseInt(_0x27d300(0x222))/0x2*(-parseInt(_0x27d300(0x1e4))/0x3)+parseInt(_0x27d300(0x1f5))/0x4+parseInt(_0x27d300(0x1fa))/0x5*(-parseInt(_0x27d300(0x1e7))/0x6)+-parseInt(_0x27d300(0x1e3))/0x7*(-parseInt(_0x27d300(0x21a))/0x8)+parseInt(_0x27d300(0x1f9))/0x9+parseInt(_0x27d300(0x230))/0xa*(parseInt(_0x27d300(0x233))/0xb);if(_0xd4ae76===_0x1b8b32)break;else _0x2868e7['push'](_0x2868e7['shift']());}catch(_0x4c66a4){_0x2868e7['push'](_0x2868e7['shift']());}}}(_0x5280,0xa1362));import{mkdir,writeFile}from'fs/promises';import{join}from'path';function _0x5280(){const _0x18a596=['chromium','\x0a⚠\x20Skipping\x20Chromium\x20installation.','\x0aIn\x20Claude\x20Code,\x20run\x20','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','isTTY','message','withDeps','yvfPM','\x0aInstalling\x20Chromium\x20browser...\x0a','Cwhsb','platform','✓\x20Skipping\x20authentication\x20(--skip-auth)','hSqUS','nHYFj','env','status','\x0a\x20\x20','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','808kjBeTf','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','skipChromium','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','QJTkN','warn','npx','402778Bwgxbm','cMsEX','.gitignore','mMnDi','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','scope','OfgzU','✓\x20Created\x20~/.ranger/\x20directory','✓\x20Authenticated\x20to\x20','plugin','success','BrrFf','OyIJQ','89923vHxQAE','1930opeVYO','NuUiD','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','16731GFAzls','\x20(fallback\x20version)','Validating\x20API\x20token...','device_auth','ranger','user','GuSqV','confirm','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','...','install','trackPhaseStart','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','skills','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','profile','organizationName','\x20is\x20no\x20longer\x20supported.\x20','auth','allowInsecureLocalhost','pOnum','19621DnQzWu','9mwKJVe','resolve','XbEin','302532pGCozb','\x20now?','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','executablePath','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','BAQse','You\x20can\x20install\x20it\x20manually\x20by\x20running:','MHNED','url','inherit','\x1b[0m','✓\x20Stored\x20credentials\x20locally','\x0a🚀\x20Ranger\x20Setup\x0a','trackPhaseEnd','1934336ccbCpP','FdaQr','VQxST','fmBKz','6928308AozxnB','65IGopjc','skipAuth','Authentication\x20failed:\x20','error','log','nVLqu','close','skipped','vVzxU','✓\x20Playwright\x20Chromium\x20browser\x20found','mxmZM','Zipox','zOwTI','force'];_0x5280=function(){return _0x18a596;};return _0x5280();}import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x4a7d50 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';function _0x8395(_0x1cb0c9,_0x5c5c5a){_0x1cb0c9=_0x1cb0c9-0x1e2;const _0x528045=_0x5280();let _0x83957=_0x528045[_0x1cb0c9];return _0x83957;}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=_0x23322b=>'\x1b[1m'+_0x23322b+_0x47b65a(0x1f1);export function getPlaywrightVersion(){const _0x4c762a=_0x47b65a,_0x56b27d={'BAQse':'playwright/package.json'};try{const _0x720114=require[_0x4c762a(0x1e5)](_0x56b27d[_0x4c762a(0x1ec)]),_0x31c750=require(_0x720114);return _0x31c750['version'];}catch{return null;}}export function installChromiumBinary(_0x1e2360,_0xf582b1=![]){const _0x287b9c=_0x47b65a,_0x3d17ab={'yRqde':function(_0x8cd30d){return _0x8cd30d();},'zJZrY':_0x287b9c(0x208),'mxmZM':function(_0x4689b0,_0x47a722,_0x187c17,_0x157828){return _0x4689b0(_0x47a722,_0x187c17,_0x157828);},'OfgzU':'win32'};return new Promise((_0x3bcbf5,_0x4936f7)=>{const _0x240ec2=_0x287b9c,_0x1bc49d={'dQFRG':function(_0x23f2e8,_0x33c883){return _0x23f2e8(_0x33c883);}},_0x194a91=['playwright@'+_0x1e2360,'install',..._0xf582b1?['--with-deps']:[],_0x3d17ab['zJZrY']],_0x22af81=_0x3d17ab[_0x240ec2(0x204)](spawn,_0x240ec2(0x221),_0x194a91,{'stdio':['ignore',_0x240ec2(0x1f0),_0x240ec2(0x1f0)],'shell':process[_0x240ec2(0x212)]===_0x3d17ab[_0x240ec2(0x228)]});_0x22af81['on'](_0x240ec2(0x200),_0x36449d=>{_0x36449d===0x0?_0x3d17ab['yRqde'](_0x3bcbf5):_0x4936f7(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x36449d));}),_0x22af81['on']('error',_0x55f8f3=>{_0x1bc49d['dQFRG'](_0x4936f7,_0x55f8f3);});});}export async function authenticate(_0x3f6ec5){const _0x46af64=_0x47b65a,_0x6cbdf3={'IHfzB':function(_0x3c2e67,_0x1f4aaa){return _0x3c2e67(_0x1f4aaa);},'SGMqr':'existing_token','nVLqu':function(_0x43208a,_0x30a21a){return _0x43208a(_0x30a21a);},'fGGqN':_0x46af64(0x1f2),'OyIJQ':'provided_token'};if(!_0x3f6ec5){const _0x2c1a57=await getToken();if(_0x2c1a57){const _0x4b2450=await _0x6cbdf3['IHfzB'](getCurrentUser,_0x2c1a57);if(_0x4b2450[_0x46af64(0x22c)])return console['log']('✓\x20Already\x20authenticated\x20to\x20'+_0x4b2450[_0x46af64(0x238)][_0x46af64(0x245)]),{'token':_0x2c1a57,'method':_0x6cbdf3['SGMqr']};}try{_0x3f6ec5=await runDeviceAuthFlow();}catch(_0x5921a4){throw new Error('Authentication\x20failed:\x20'+(_0x5921a4 instanceof Error?_0x5921a4[_0x46af64(0x20d)]:_0x5921a4));}const _0x108aad=await _0x6cbdf3[_0x46af64(0x1ff)](getCurrentUser,_0x3f6ec5);if(!_0x108aad['success'])throw new Error(_0x46af64(0x21e)+_0x108aad[_0x46af64(0x1fd)]);return console['log']('✓\x20Authenticated\x20to\x20'+_0x108aad['user']['organizationName']),{'token':_0x3f6ec5,'method':_0x46af64(0x236)};}console['log'](_0x46af64(0x235));const _0x499558=await getCurrentUser(_0x3f6ec5);if(!_0x499558[_0x46af64(0x22c)]){if(_0x499558[_0x46af64(0x217)])throw new Error(_0x46af64(0x1fc)+_0x499558[_0x46af64(0x1fd)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x499558[_0x46af64(0x1fd)]+_0x46af64(0x23b));}return console['log'](_0x46af64(0x22a)+_0x499558[_0x46af64(0x238)]['organizationName']),await _0x6cbdf3['nVLqu'](storeToken,_0x3f6ec5),console[_0x46af64(0x1fe)](process[_0x46af64(0x216)]['GITHUB_ENV']?'✓\x20Exported\x20credentials\x20for\x20CI':_0x6cbdf3['fGGqN']),{'token':_0x3f6ec5,'method':_0x6cbdf3[_0x46af64(0x22e)]};}export async function ensureRangerDir(_0x5e8442){const _0x2326ac=_0x47b65a,_0x4b0a5c={'yvfPM':function(_0x297134,_0x2299b5){return _0x297134(_0x2299b5);},'XEcgA':_0x2326ac(0x229)};void _0x5e8442;const _0x2cc476=getRangerHomeDir();return!_0x4b0a5c[_0x2326ac(0x20f)](existsSync,_0x2cc476)?(await mkdir(_0x2cc476,{'recursive':!![]}),console['log'](_0x4b0a5c['XEcgA']),{'path':_0x2cc476,'installed':!![]}):(console[_0x2326ac(0x1fe)]('✓\x20~/.ranger/\x20directory\x20already\x20exists'),{'path':_0x2cc476,'installed':![]});}export async function ensureChromium(_0x131766=![]){const _0x3025dc=_0x47b65a,_0x2175a7={'zOwTI':function(_0x384812,_0x351631){return _0x384812(_0x351631);},'Cwhsb':_0x3025dc(0x23a),'NMhhs':_0x3025dc(0x234),'KVaqj':function(_0xa33eee,_0x2ca7c6,_0x483034){return _0xa33eee(_0x2ca7c6,_0x483034);},'vVzxU':_0x3025dc(0x1ed),'BrrFf':_0x3025dc(0x209),'jxOXt':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0x3d95e5=![];try{const _0x44b422=chromium[_0x3025dc(0x1ea)]();_0x3d95e5=_0x2175a7[_0x3025dc(0x206)](existsSync,_0x44b422);}catch{_0x3d95e5=![];}if(_0x3d95e5)return console[_0x3025dc(0x1fe)](_0x3025dc(0x203)),![];const _0x18356b=getPlaywrightVersion(),_0x2c0de0=_0x18356b??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x43ea94=!_0x18356b,_0x28897f=process['stdin'][_0x3025dc(0x20c)]&&process['stdout']['isTTY'];let _0x495302=!![];if(_0x28897f){const {install:_0x14deef}=await _0x4a7d50['prompt']([{'type':_0x2175a7[_0x3025dc(0x211)],'name':_0x3025dc(0x23f),'message':_0x43ea94?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x2c0de0+_0x3025dc(0x1e8):'The\x20required\x20version\x20('+_0x2c0de0+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x495302=_0x14deef;}else console[_0x3025dc(0x1fe)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x2c0de0+(_0x43ea94?_0x2175a7['NMhhs']:'')+_0x3025dc(0x23e));if(_0x495302){console[_0x3025dc(0x1fe)](_0x3025dc(0x210));try{await _0x2175a7['KVaqj'](installChromiumBinary,_0x2c0de0,_0x131766),console[_0x3025dc(0x1fe)](_0x3025dc(0x23c));}catch(_0x298214){console['error']('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x298214 instanceof Error?_0x298214['message']:_0x298214),console['log'](_0x2175a7[_0x3025dc(0x202)]),console[_0x3025dc(0x1fe)]('\x20\x20npx\x20playwright@'+_0x2c0de0+'\x20install\x20chromium');}}else console['log'](_0x2175a7[_0x3025dc(0x22d)]),console['log'](_0x2175a7['jxOXt']),console[_0x3025dc(0x1fe)]('\x20\x20npx\x20playwright@'+_0x2c0de0+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x29e4e1){const _0x2e2cfc=_0x47b65a,_0x379d46={'zaHjs':function(_0x22cce,_0x4a1670,_0x5ccebe){return _0x22cce(_0x4a1670,_0x5ccebe);}},_0x37fb98=_0x379d46['zaHjs'](join,_0x29e4e1,_0x2e2cfc(0x224)),_0x478510='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await writeFile(_0x37fb98,_0x478510),console[_0x2e2cfc(0x1fe)]('✓\x20Created\x20.ranger/.gitignore');}export async function ensureLocalEnv(_0xe44787,_0xc555cf){const _0x5ad5cb=_0x47b65a,_0x54b0ab={'kowXp':function(_0x253254){return _0x253254();},'hSqUS':function(_0x1b6815,_0x5d4b28){return _0x1b6815!==_0x5d4b28;},'NuUiD':'user','QfpSp':_0x5ad5cb(0x23d),'nHYFj':'local'};if(!_0x54b0ab['kowXp'](findGitRoot)&&_0x54b0ab[_0x5ad5cb(0x214)](_0xe44787?.[_0x5ad5cb(0x227)],_0x54b0ab[_0x5ad5cb(0x231)]))return console['log'](_0x54b0ab['QfpSp']),{'ready':![],'skipped':!![]};const _0x32a6d6=_0xe44787?.[_0x5ad5cb(0x227)]==='user'?getRangerHomeDir():undefined;if(findExistingEnv(_0x54b0ab[_0x5ad5cb(0x215)],{'locations':['local'],'rangerDir':_0x32a6d6}))return console['log']('✓\x20Local\x20profile\x20already\x20exists'),{'ready':!![],'skipped':![]};try{return await addEnv('local',{'url':_0xe44787?.['url'],'force':_0xe44787?.['force'],'allowInsecureLocalhost':_0xe44787?.[_0x5ad5cb(0x248)],'scope':_0xe44787?.[_0x5ad5cb(0x227)]},_0xc555cf),{'ready':!![],'skipped':![]};}catch(_0x5107de){return console[_0x5ad5cb(0x1fd)]('\x0a❌\x20Profile\x20setup\x20failed:',_0x5107de instanceof Error?_0x5107de[_0x5ad5cb(0x20d)]:_0x5107de),{'ready':![],'skipped':![]};}}export async function start(_0x454a8d,_0x45fd3d,_0x14d39f){const _0x5d7c74=_0x47b65a,_0x47a152={'FdaQr':function(_0x474a13,_0x11273){return _0x474a13!==_0x11273;},'VQxST':function(_0x31f1f6,_0x20b65d){return _0x31f1f6+_0x20b65d;},'Zipox':function(_0x13947b,_0x5c8308){return _0x13947b(_0x5c8308);},'XbEin':_0x5d7c74(0x213),'mMnDi':_0x5d7c74(0x247),'UrwvY':'chromium','jNplB':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','RLDMv':function(_0x20f3f3,_0x152255){return _0x20f3f3(_0x152255);},'fmBKz':_0x5d7c74(0x22b),'QJTkN':function(_0x3647c4,_0x3ec42d){return _0x3647c4(_0x3ec42d);},'pOnum':_0x5d7c74(0x242),'cMsEX':function(_0x15bd47,_0x589751,_0x25e3e9){return _0x15bd47(_0x589751,_0x25e3e9);},'KNzin':function(_0xe8c003,_0x2af1b9){return _0xe8c003(_0x2af1b9);},'eKdsq':_0x5d7c74(0x241),'LUgZC':function(_0xc52a03,_0x573448,_0x500a1c){return _0xc52a03(_0x573448,_0x500a1c);},'uuCUP':_0x5d7c74(0x238),'vDuEO':function(_0x52e0f6,_0x52de50){return _0x52e0f6+_0x52de50;},'GuSqV':function(_0x45d057,_0x3a3536){return _0x45d057+_0x3a3536;},'OlBUT':_0x5d7c74(0x232),'MHNED':function(_0x446c01,_0x23b477){return _0x446c01+_0x23b477;}};console['log'](_0x5d7c74(0x1f3));_0x45fd3d?.['scope']!==undefined&&_0x47a152[_0x5d7c74(0x1f6)](_0x45fd3d['scope'],_0x5d7c74(0x238))&&(console[_0x5d7c74(0x1fd)](_0x47a152['VQxST']('ranger\x20setup\x20--scope='+_0x47a152[_0x5d7c74(0x205)](String,_0x45fd3d['scope'])+_0x5d7c74(0x246),_0x5d7c74(0x20b))+'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.'),process['exit'](0x1));_0x45fd3d={..._0x45fd3d,'scope':'user'};const _0x35afaa=!existsSync(getRangerHomeDir());await _0x47a152[_0x5d7c74(0x205)](ensureRangerDir,'user');if(_0x45fd3d?.[_0x5d7c74(0x1fb)])console['log'](_0x47a152[_0x5d7c74(0x1e6)]),_0x14d39f?.['trackPhaseEnd'](_0x47a152[_0x5d7c74(0x225)],{'isFirstRun':_0x35afaa,'method':'skipped'});else{_0x14d39f?.['trackPhaseStart'](_0x47a152[_0x5d7c74(0x225)]);const _0x2cf1dc=await _0x47a152['Zipox'](authenticate,_0x454a8d);_0x14d39f?.[_0x5d7c74(0x1f4)]('auth',{'isFirstRun':_0x35afaa,'method':_0x2cf1dc['method']});}_0x14d39f?.[_0x5d7c74(0x240)](_0x47a152['UrwvY']);_0x45fd3d?.[_0x5d7c74(0x21c)]?console['log'](_0x47a152['jNplB']):await _0x47a152['RLDMv'](ensureChromium,_0x45fd3d?.[_0x5d7c74(0x20e)]);_0x14d39f?.['trackPhaseEnd'](_0x5d7c74(0x208),{'isFirstRun':_0x35afaa,'skipped':!!_0x45fd3d?.['skipChromium']}),console[_0x5d7c74(0x1fe)](_0x5d7c74(0x219));const _0x49abc9=_0x45fd3d?.[_0x5d7c74(0x227)],_0x312eec=_0x45fd3d?.['opencode']??![];let _0x4a977e=null;_0x312eec?(_0x14d39f?.[_0x5d7c74(0x240)](_0x47a152[_0x5d7c74(0x1f8)]),_0x4a977e=await _0x47a152[_0x5d7c74(0x21f)](ensureOpencodePluginConfig,_0x49abc9),_0x14d39f?.[_0x5d7c74(0x1f4)]('plugin',{'isFirstRun':_0x35afaa,'opencode':!![]})):(_0x14d39f?.['trackPhaseStart']('plugin'),await ensureClaudePlugin(_0x49abc9),_0x14d39f?.[_0x5d7c74(0x1f4)](_0x47a152['fmBKz'],{'isFirstRun':_0x35afaa}));if(_0x312eec&&_0x4a977e){_0x14d39f?.[_0x5d7c74(0x240)](_0x47a152['pOnum']);try{await _0x47a152[_0x5d7c74(0x223)](installSkill,_0x5d7c74(0x237),{'level':_0x4a977e[_0x5d7c74(0x227)],'cliVersion':getCurrentVersion(),'platform':'opencode'}),_0x14d39f?.[_0x5d7c74(0x1f4)](_0x47a152['pOnum'],{'isFirstRun':_0x35afaa,'opencode':!![]});}catch(_0x8a4494){console[_0x5d7c74(0x220)](_0x5d7c74(0x21d),_0x8a4494 instanceof Error?_0x8a4494[_0x5d7c74(0x20d)]:_0x8a4494),_0x14d39f?.[_0x5d7c74(0x1f4)]('skills',{'isFirstRun':_0x35afaa,'opencode':!![],'failed':!![]});}}else _0x14d39f?.[_0x5d7c74(0x240)](_0x47a152[_0x5d7c74(0x1e2)]),await _0x47a152['KNzin'](ensureClaudeSkills,_0x49abc9),_0x14d39f?.[_0x5d7c74(0x1f4)]('skills',{'isFirstRun':_0x35afaa});if(_0x45fd3d?.['skipAuth'])console['log'](_0x47a152['eKdsq']);else{if(_0x45fd3d?.['url']){_0x14d39f?.[_0x5d7c74(0x240)](_0x5d7c74(0x244));const _0x9d7344=await _0x47a152['LUgZC'](ensureLocalEnv,{'url':_0x45fd3d[_0x5d7c74(0x1ef)],'force':_0x45fd3d?.[_0x5d7c74(0x207)],'allowInsecureLocalhost':_0x45fd3d?.[_0x5d7c74(0x248)],'scope':_0x47a152['uuCUP']},_0x14d39f);_0x14d39f?.[_0x5d7c74(0x1f4)](_0x5d7c74(0x244),{'isFirstRun':_0x35afaa,'profileReady':_0x9d7344['ready'],'userSkipped':_0x9d7344[_0x5d7c74(0x201)]});}else console[_0x5d7c74(0x1fe)](_0x47a152['vDuEO'](_0x47a152['VQxST'](_0x47a152[_0x5d7c74(0x239)](_0x5d7c74(0x1eb)+(_0x5d7c74(0x218)+bold('ranger\x20profile\x20add\x20<name>')),_0x5d7c74(0x1e9)),'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:'),_0x5d7c74(0x226)));}if(_0x312eec)console['log'](_0x47a152['OlBUT']),console['log']('and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review'),console[_0x5d7c74(0x1fe)](_0x5d7c74(0x21b)),console['log']('verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');else{const _0x415596=bold('/ranger:enable');console[_0x5d7c74(0x1fe)](_0x47a152[_0x5d7c74(0x1f7)](_0x47a152['vDuEO'](_0x47a152[_0x5d7c74(0x1ee)](_0x5d7c74(0x20a)+_0x415596+'\x20and\x20prompt\x20the\x20coding',_0x5d7c74(0x243)),'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
|
|
1
|
+
const _0x4c7a97=_0x442d;(function(_0x5283bf,_0x219087){const _0x2a0980=_0x442d,_0x511611=_0x5283bf();while(!![]){try{const _0x45efae=-parseInt(_0x2a0980(0x136))/0x1+-parseInt(_0x2a0980(0xf2))/0x2*(-parseInt(_0x2a0980(0xee))/0x3)+parseInt(_0x2a0980(0xeb))/0x4*(-parseInt(_0x2a0980(0x134))/0x5)+-parseInt(_0x2a0980(0xfb))/0x6*(-parseInt(_0x2a0980(0x106))/0x7)+-parseInt(_0x2a0980(0xfd))/0x8+parseInt(_0x2a0980(0xf9))/0x9+parseInt(_0x2a0980(0xef))/0xa;if(_0x45efae===_0x219087)break;else _0x511611['push'](_0x511611['shift']());}catch(_0xb7723f){_0x511611['push'](_0x511611['shift']());}}}(_0x3c90,0x2b72f));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x2ac3a2 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=_0x292e93=>'\x1b[1m'+_0x292e93+_0x4c7a97(0x12e);function _0x442d(_0x26bf27,_0x1055a0){_0x26bf27=_0x26bf27-0xd5;const _0x3c9077=_0x3c90();let _0x442d2a=_0x3c9077[_0x26bf27];return _0x442d2a;}export function getPlaywrightVersion(){const _0x553897=_0x4c7a97,_0x12b2f4={'qqHeW':function(_0x26fb5c,_0x499b27){return _0x26fb5c(_0x499b27);}};try{const _0x3f5f90=require[_0x553897(0xe6)]('playwright/package.json'),_0x186560=_0x12b2f4['qqHeW'](require,_0x3f5f90);return _0x186560[_0x553897(0x114)];}catch{return null;}}export function installChromiumBinary(_0x31e866,_0x36e4ef=![]){const _0x128f3a=_0x4c7a97,_0x24ccfd={'EGHvv':function(_0x5a146f,_0x17b506){return _0x5a146f===_0x17b506;},'dBUZB':function(_0x12a06b,_0x16d0e8){return _0x12a06b(_0x16d0e8);},'cagml':_0x128f3a(0x129),'lziVf':_0x128f3a(0xe2),'KwRmF':_0x128f3a(0x137),'ODeha':_0x128f3a(0x108),'haPJC':'error'};return new Promise((_0x14506f,_0x3b3287)=>{const _0x23deb5=_0x128f3a,_0xb5599f=['playwright@'+_0x31e866,_0x24ccfd['cagml'],..._0x36e4ef?[_0x23deb5(0x135)]:[],'chromium'],_0x2310e7=spawn(_0x24ccfd['lziVf'],_0xb5599f,{'stdio':[_0x24ccfd['KwRmF'],'inherit','inherit'],'shell':_0x24ccfd['EGHvv'](process[_0x23deb5(0x112)],_0x24ccfd[_0x23deb5(0x111)])});_0x2310e7['on']('close',_0x3932d6=>{const _0x342a92=_0x23deb5;_0x24ccfd['EGHvv'](_0x3932d6,0x0)?_0x14506f():_0x24ccfd[_0x342a92(0x119)](_0x3b3287,new Error(_0x342a92(0x107)+_0x3932d6));}),_0x2310e7['on'](_0x24ccfd['haPJC'],_0x2ab6ab=>{const _0x1e31fe=_0x23deb5;_0x24ccfd[_0x1e31fe(0x119)](_0x3b3287,_0x2ab6ab);});});}export async function authenticate(_0x2f5531){const _0xdb40b5=_0x4c7a97,_0x202dde={'UWHSh':function(_0x38fce2){return _0x38fce2();},'MJSxH':function(_0x5a0327,_0x3a25d8){return _0x5a0327(_0x3a25d8);},'MwbZB':_0xdb40b5(0x12d)};if(!_0x2f5531){const _0x72caeb=await _0x202dde['UWHSh'](getToken);if(_0x72caeb){const _0x9625f3=await _0x202dde[_0xdb40b5(0x123)](getCurrentUser,_0x72caeb);if(_0x9625f3['success'])return console['log'](_0xdb40b5(0x13c)+_0x9625f3[_0xdb40b5(0x11e)]['organizationName']),{'token':_0x72caeb,'method':_0xdb40b5(0x10d)};}try{_0x2f5531=await _0x202dde[_0xdb40b5(0x12f)](runDeviceAuthFlow);}catch(_0x45951f){throw new Error(_0xdb40b5(0xd9)+(_0x45951f instanceof Error?_0x45951f['message']:_0x45951f));}const _0x53890f=await getCurrentUser(_0x2f5531);if(!_0x53890f[_0xdb40b5(0xda)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x53890f['error']);return console['log'](_0xdb40b5(0x10e)+_0x53890f[_0xdb40b5(0x11e)][_0xdb40b5(0xdc)]),{'token':_0x2f5531,'method':_0x202dde[_0xdb40b5(0x11a)]};}console['log']('Validating\x20API\x20token...');const _0x57bf41=await getCurrentUser(_0x2f5531);if(!_0x57bf41['success']){if(_0x57bf41[_0xdb40b5(0x100)])throw new Error(_0xdb40b5(0xd9)+_0x57bf41['error']+_0xdb40b5(0x101));else throw new Error(_0xdb40b5(0xe4)+_0x57bf41[_0xdb40b5(0x103)]+_0xdb40b5(0x131));}return console['log'](_0xdb40b5(0x10e)+_0x57bf41['user']['organizationName']),await storeToken(_0x2f5531),console[_0xdb40b5(0x13e)](process['env']['GITHUB_ENV']?'✓\x20Exported\x20credentials\x20for\x20CI':_0xdb40b5(0xfe)),{'token':_0x2f5531,'method':_0xdb40b5(0xe5)};}export async function ensureRangerDir(_0x29f89f){const _0x4cf9b0=_0x4c7a97,_0x5c563a={'GRsnI':function(_0x30cdae,_0x4460eb){return _0x30cdae(_0x4460eb);},'ytMmL':'✓\x20Created\x20~/.ranger/\x20directory','hliCd':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x29f89f;const _0x20e345=getRangerHomeDir();return!_0x5c563a[_0x4cf9b0(0xd6)](existsSync,_0x20e345)?(await mkdir(_0x20e345,{'recursive':!![]}),console[_0x4cf9b0(0x13e)](_0x5c563a[_0x4cf9b0(0x11c)]),{'path':_0x20e345,'installed':!![]}):(console['log'](_0x5c563a[_0x4cf9b0(0xf0)]),{'path':_0x20e345,'installed':![]});}function _0x3c90(){const _0x4a3e5b=['\x0a✅\x20Ranger\x20setup\x20complete!\x0a','12360ObhHaI','--with-deps','348972rrOEVh','ignore','✓\x20Local\x20profile\x20already\x20exists','stdin','skipAuth','✓\x20Playwright\x20Chromium\x20browser\x20found','✓\x20Already\x20authenticated\x20to\x20','EpgOu','log','hQKgn','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','\x0aIn\x20Claude\x20Code,\x20run\x20','.gitignore','GRsnI','PiaLk','zudND','Authentication\x20failed:\x20','success','trackPhaseStart','organizationName','SNStS','cWnBM','stdout','message','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','npx','DAHrZ','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','provided_token','resolve','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','opencode','plugin','\x0a\x20\x20','344TIscHv','local','XdJDV','3zrhyms','5155580UfdQdt','hliCd','KLSyx','85458hmTRSP','\x20(fallback\x20version)','/ranger:enable','bFPih','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','ready','prompt','1063584CwYswt','skipChromium','37194UOVhRd','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','1528728kyZyxn','✓\x20Stored\x20credentials\x20locally','OxRdb','status','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','skills','error','\x20install\x20chromium','ranger\x20setup\x20--scope=','287NiotGy','Installation\x20failed\x20with\x20exit\x20code\x20','win32','ZzYIB','✓\x20Created\x20.ranger/.gitignore','EIUdA','chromium','existing_token','✓\x20Authenticated\x20to\x20','\x0a🚀\x20Ranger\x20Setup\x0a','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','ODeha','platform','method','version','\x20is\x20no\x20longer\x20supported.\x20','HQUtX','XXKoe','The\x20required\x20version\x20(','dBUZB','MwbZB','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','ytMmL','vWbsT','user','confirm','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','MJSxH','url','yfXGj','skipped','FxAdM','rsQgM','install','allowInsecureLocalhost','scope','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','device_auth','\x1b[0m','UWHSh','trackPhaseEnd','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'];_0x3c90=function(){return _0x4a3e5b;};return _0x3c90();}export async function ensureChromium(_0x35440c=![]){const _0x3b5950=_0x4c7a97,_0x47c9eb={'Acfrn':function(_0x25c530,_0x3f3b77){return _0x25c530(_0x3f3b77);},'CSoll':_0x3b5950(0xf3),'owjQC':function(_0x4b7000,_0x5cd24f,_0x580ef3){return _0x4b7000(_0x5cd24f,_0x580ef3);},'ETrUX':_0x3b5950(0x140),'MMpzl':_0x3b5950(0x110),'lqByv':'You\x20can\x20install\x20it\x20manually\x20by\x20running:'};let _0x3786f7=![];try{const _0x4db899=chromium['executablePath']();_0x3786f7=_0x47c9eb['Acfrn'](existsSync,_0x4db899);}catch{_0x3786f7=![];}if(_0x3786f7)return console['log'](_0x3b5950(0x13b)),![];const _0x57540c=getPlaywrightVersion(),_0x395ada=_0x57540c??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x43a0bb=!_0x57540c,_0xfc66c9=process[_0x3b5950(0x139)]['isTTY']&&process[_0x3b5950(0xdf)]['isTTY'];let _0x136f46=!![];if(_0xfc66c9){const {install:_0x5a4a93}=await _0x2ac3a2[_0x3b5950(0xf8)]([{'type':_0x3b5950(0x11f),'name':_0x3b5950(0x129),'message':_0x43a0bb?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x395ada+'\x20now?':_0x3b5950(0x118)+_0x395ada+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x136f46=_0x5a4a93;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x395ada+(_0x43a0bb?_0x47c9eb['CSoll']:'')+'...');if(_0x136f46){console['log']('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await _0x47c9eb['owjQC'](installChromiumBinary,_0x395ada,_0x35440c),console['log'](_0x47c9eb['ETrUX']);}catch(_0x5f3a61){console['error'](_0x47c9eb['MMpzl'],_0x5f3a61 instanceof Error?_0x5f3a61[_0x3b5950(0xe0)]:_0x5f3a61),console[_0x3b5950(0x13e)](_0x47c9eb['lqByv']),console['log']('\x20\x20npx\x20playwright@'+_0x395ada+_0x3b5950(0x104));}}else console['log']('\x0a⚠\x20Skipping\x20Chromium\x20installation.'),console['log']('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console[_0x3b5950(0x13e)]('\x20\x20npx\x20playwright@'+_0x395ada+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x5945d4){const _0x4e5562=_0x4c7a97,_0x1b383f=join(_0x5945d4,_0x4e5562(0xd5)),_0x3c0e08='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await writeFile(_0x1b383f,_0x3c0e08),console['log'](_0x4e5562(0x10a));}export async function ensureLocalEnv(_0x1b52e1,_0x5ac053){const _0x2d2b44=_0x4c7a97,_0x13a3e4={'vWbsT':'⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','fbskQ':_0x2d2b44(0x11e),'bsjnQ':function(_0x1d0d3f){return _0x1d0d3f();},'itsME':function(_0x483d6c,_0x17aa7f,_0xc5665b){return _0x483d6c(_0x17aa7f,_0xc5665b);},'KLSyx':_0x2d2b44(0xec),'JfxiZ':function(_0x159876,_0xb153cf,_0x5038ec,_0x3ee879){return _0x159876(_0xb153cf,_0x5038ec,_0x3ee879);},'EpgOu':function(_0x41434d,_0x5ec3dc){return _0x41434d instanceof _0x5ec3dc;}};if(!findGitRoot()&&_0x1b52e1?.[_0x2d2b44(0x12b)]!==_0x2d2b44(0x11e))return console['log'](_0x13a3e4[_0x2d2b44(0x11d)]),{'ready':![],'skipped':!![]};const _0x341d4f=_0x1b52e1?.[_0x2d2b44(0x12b)]===_0x13a3e4['fbskQ']?_0x13a3e4['bsjnQ'](getRangerHomeDir):undefined;if(_0x13a3e4['itsME'](findExistingEnv,_0x13a3e4[_0x2d2b44(0xf1)],{'locations':['local'],'rangerDir':_0x341d4f}))return console[_0x2d2b44(0x13e)](_0x2d2b44(0x138)),{'ready':!![],'skipped':![]};try{return await _0x13a3e4['JfxiZ'](addEnv,_0x13a3e4[_0x2d2b44(0xf1)],{'url':_0x1b52e1?.[_0x2d2b44(0x124)],'force':_0x1b52e1?.['force'],'allowInsecureLocalhost':_0x1b52e1?.['allowInsecureLocalhost'],'scope':_0x1b52e1?.['scope']},_0x5ac053),{'ready':!![],'skipped':![]};}catch(_0x4028cc){return console[_0x2d2b44(0x103)]('\x0a❌\x20Profile\x20setup\x20failed:',_0x13a3e4[_0x2d2b44(0x13d)](_0x4028cc,Error)?_0x4028cc[_0x2d2b44(0xe0)]:_0x4028cc),{'ready':![],'skipped':![]};}}export async function start(_0x121685,_0x2b3351,_0x533f50){const _0x4a5f81=_0x4c7a97,_0x273a8c={'XXKoe':_0x4a5f81(0x10f),'rNxzI':function(_0x23b5d1,_0x4bf90e){return _0x23b5d1!==_0x4bf90e;},'cWnBM':'user','zudND':function(_0x45928d,_0x1e293f){return _0x45928d+_0x1e293f;},'mNOEF':function(_0x426a14,_0x4f72a0){return _0x426a14(_0x4f72a0);},'FxAdM':function(_0x3bae2f,_0x241941){return _0x3bae2f(_0x241941);},'EIUdA':function(_0x10e97a,_0x1c34c6){return _0x10e97a(_0x1c34c6);},'HQUtX':'chromium','XdJDV':function(_0xec285a,_0x2a2901){return _0xec285a(_0x2a2901);},'SNStS':'plugin','bFPih':_0x4a5f81(0x102),'PiaLk':function(_0x26fbe6,_0x558b39,_0x367ca7){return _0x26fbe6(_0x558b39,_0x367ca7);},'rsQgM':'ranger','BHNJl':_0x4a5f81(0xe8),'yfXGj':_0x4a5f81(0xe1),'KUcRa':function(_0x4404d6,_0x1040dd){return _0x4404d6(_0x1040dd);},'DXqGx':'\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','hQKgn':function(_0x445196,_0x4b42c5,_0x2b8453){return _0x445196(_0x4b42c5,_0x2b8453);},'ZzYIB':'ranger\x20profile\x20add\x20<name>','vooOk':_0x4a5f81(0x122),'OxRdb':_0x4a5f81(0xf4),'DAHrZ':function(_0x2081b0,_0x435454){return _0x2081b0+_0x435454;}};console[_0x4a5f81(0x13e)](_0x273a8c[_0x4a5f81(0x117)]);_0x2b3351?.['scope']!==undefined&&_0x273a8c['rNxzI'](_0x2b3351[_0x4a5f81(0x12b)],_0x273a8c['cWnBM'])&&(console[_0x4a5f81(0x103)](_0x273a8c['zudND'](_0x4a5f81(0x105)+String(_0x2b3351[_0x4a5f81(0x12b)])+_0x4a5f81(0x115)+_0x4a5f81(0x120),_0x4a5f81(0x12c))),process['exit'](0x1));_0x2b3351={..._0x2b3351,'scope':_0x4a5f81(0x11e)};const _0x3bc9b5=!_0x273a8c['mNOEF'](existsSync,getRangerHomeDir());await ensureRangerDir('user');if(_0x2b3351?.[_0x4a5f81(0x13a)])console['log']('✓\x20Skipping\x20authentication\x20(--skip-auth)'),_0x533f50?.[_0x4a5f81(0x130)]('auth',{'isFirstRun':_0x3bc9b5,'method':_0x4a5f81(0x126)});else{_0x533f50?.[_0x4a5f81(0xdb)]('auth');const _0x2bbe11=await _0x273a8c[_0x4a5f81(0x127)](authenticate,_0x121685);_0x533f50?.['trackPhaseEnd']('auth',{'isFirstRun':_0x3bc9b5,'method':_0x2bbe11[_0x4a5f81(0x113)]});}_0x533f50?.[_0x4a5f81(0xdb)](_0x4a5f81(0x10c));_0x2b3351?.[_0x4a5f81(0xfa)]?console['log'](_0x4a5f81(0xe7)):await _0x273a8c[_0x4a5f81(0x10b)](ensureChromium,_0x2b3351?.['withDeps']);_0x533f50?.[_0x4a5f81(0x130)](_0x273a8c[_0x4a5f81(0x116)],{'isFirstRun':_0x3bc9b5,'skipped':!!_0x2b3351?.['skipChromium']}),console['log'](_0x4a5f81(0x133));const _0xfb1392=_0x2b3351?.['scope'],_0x2572c4=_0x2b3351?.[_0x4a5f81(0xe8)]??![];let _0x38b4f2=null;_0x2572c4?(_0x533f50?.['trackPhaseStart'](_0x4a5f81(0xe9)),_0x38b4f2=await _0x273a8c[_0x4a5f81(0xed)](ensureOpencodePluginConfig,_0xfb1392),_0x533f50?.['trackPhaseEnd'](_0x273a8c[_0x4a5f81(0xdd)],{'isFirstRun':_0x3bc9b5,'opencode':!![]})):(_0x533f50?.['trackPhaseStart']('plugin'),await ensureClaudePlugin(_0xfb1392),_0x533f50?.[_0x4a5f81(0x130)](_0x273a8c[_0x4a5f81(0xdd)],{'isFirstRun':_0x3bc9b5}));if(_0x2572c4&&_0x38b4f2){_0x533f50?.[_0x4a5f81(0xdb)](_0x273a8c[_0x4a5f81(0xf5)]);try{await _0x273a8c[_0x4a5f81(0xd7)](installSkill,_0x273a8c[_0x4a5f81(0x128)],{'level':_0x38b4f2['scope'],'cliVersion':getCurrentVersion(),'platform':_0x273a8c['BHNJl']}),_0x533f50?.[_0x4a5f81(0x130)](_0x273a8c['bFPih'],{'isFirstRun':_0x3bc9b5,'opencode':!![]});}catch(_0x4d8bbc){console['warn'](_0x273a8c[_0x4a5f81(0x125)],_0x4d8bbc instanceof Error?_0x4d8bbc['message']:_0x4d8bbc),_0x533f50?.['trackPhaseEnd'](_0x273a8c['bFPih'],{'isFirstRun':_0x3bc9b5,'opencode':!![],'failed':!![]});}}else _0x533f50?.['trackPhaseStart'](_0x273a8c[_0x4a5f81(0xf5)]),await _0x273a8c['KUcRa'](ensureClaudeSkills,_0xfb1392),_0x533f50?.['trackPhaseEnd']('skills',{'isFirstRun':_0x3bc9b5});if(_0x2b3351?.[_0x4a5f81(0x13a)])console[_0x4a5f81(0x13e)](_0x273a8c['DXqGx']);else{if(_0x2b3351?.[_0x4a5f81(0x124)]){_0x533f50?.[_0x4a5f81(0xdb)]('profile');const _0x845787=await _0x273a8c[_0x4a5f81(0x13f)](ensureLocalEnv,{'url':_0x2b3351['url'],'force':_0x2b3351?.['force'],'allowInsecureLocalhost':_0x2b3351?.[_0x4a5f81(0x12a)],'scope':_0x273a8c[_0x4a5f81(0xde)]},_0x533f50);_0x533f50?.[_0x4a5f81(0x130)]('profile',{'isFirstRun':_0x3bc9b5,'profileReady':_0x845787[_0x4a5f81(0xf7)],'userSkipped':_0x845787[_0x4a5f81(0x126)]});}else console['log'](_0x273a8c[_0x4a5f81(0xd8)](_0x273a8c['zudND'](_0x273a8c[_0x4a5f81(0xd8)]('\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:'+(_0x4a5f81(0xea)+_0x273a8c['KUcRa'](bold,_0x273a8c[_0x4a5f81(0x109)])),'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)'),_0x4a5f81(0x141)),_0x4a5f81(0xfc)));}if(_0x2572c4)console['log'](_0x273a8c['vooOk']),console[_0x4a5f81(0x13e)](_0x4a5f81(0x11b)),console[_0x4a5f81(0x13e)](_0x4a5f81(0x121)),console[_0x4a5f81(0x13e)](_0x4a5f81(0x132));else{const _0x35c44f=_0x273a8c['FxAdM'](bold,_0x273a8c[_0x4a5f81(0xff)]);console['log'](_0x273a8c[_0x4a5f81(0xe3)](_0x4a5f81(0x142)+_0x35c44f+'\x20and\x20prompt\x20the\x20coding'+'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with',_0x4a5f81(0xf6))+'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const _0x44d257=_0x3f07;(function(_0x34d5f8,_0x32100a){const _0x24a6e4=_0x3f07,_0x201cc2=_0x34d5f8();while(!![]){try{const _0x1cea09=-parseInt(_0x24a6e4(0x1fa))/0x1*(-parseInt(_0x24a6e4(0x217))/0x2)+parseInt(_0x24a6e4(0x238))/0x3*(parseInt(_0x24a6e4(0x1fc))/0x4)+-parseInt(_0x24a6e4(0x1ee))/0x5*(parseInt(_0x24a6e4(0x1f1))/0x6)+-parseInt(_0x24a6e4(0x221))/0x7+parseInt(_0x24a6e4(0x202))/0x8+-parseInt(_0x24a6e4(0x22d))/0x9*(-parseInt(_0x24a6e4(0x23e))/0xa)+parseInt(_0x24a6e4(0x23c))/0xb*(-parseInt(_0x24a6e4(0x22c))/0xc);if(_0x1cea09===_0x32100a)break;else _0x201cc2['push'](_0x201cc2['shift']());}catch(_0x3fd825){_0x201cc2['push'](_0x201cc2['shift']());}}}(_0x1c21,0x7bbb7));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 _0x1c21(){const _0x2e2ffe=['Root:\x20','filter','sessionUpdatedAt','utf-8','590qesCNZ','\x20(up\x20to\x20date)','8wniOXi','\x20plugin(s)\x20configured','map','stdout','config',':\x20installed\x20(','2847776TpslDB','user','xwjrD','tEIcM','hasEncryptedAuth','path','\x20\x20\x20\x20Session:\x20','not_installed','\x20profiles\x20configured\x20(','isDirectory','error','HFueq','unknown','\x20\x20\x20\x20Settings:\x20','iEzkq','XxjQY','\x20\x20\x20\x20Auth:\x20','no\x20session','qoYCR','\x20\x20Run:\x20ranger\x20update','IFpta','516mtYBJW','details','ranger@trailhead','ymWhp','JswcM','\x20\x20Not\x20configured','displayName','plugin','disabled','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','4211158yTTyeD','\x20[local]','version','close','has','scope','settingsPath','includes','VoZUP','not_configured','ZnYtR','446604XNwueQ','1035ykPWiX','hasPlaintextAuth','\x0a---\x20Claude\x20Code\x20Plugin\x20---','dJZfY','LUDyz','pWIac','\x1b]8;;\x07','(not\x20found)','\x20\x20Not\x20installed','SKILL.md','\x0a\x20\x20No\x20active\x20profile\x20set','659427XgjIeq','LgQLM','XFDdt','uhBlp','11CPGpxh','KeejS','28930iEwHfP','log','WwfDP','IBsCU','vGsew','some','length','API\x20Environment:\x20','\x0a---\x20Profiles\x20---','vfGGu','pipe','trim','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','status','WnYEa','Version:\x20','ifeaq','zXtgw','eBvCM','all','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','No\x20skills\x20installed','configured','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','sqeDi','name','ctQEV','\x20local','674435IywLZd','\x20(active)','data','6KWZqxz','\x20\x20Run:\x20ranger\x20skillup','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','join','push'];_0x1c21=function(){return _0x2e2ffe;};return _0x1c21();}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=_0x458a0c=>'\x1b[1m'+_0x458a0c+'\x1b[0m',link=(_0x584b84,_0x4cde82)=>'\x1b]8;;file://'+_0x584b84+'\x07'+(_0x4cde82||_0x584b84)+_0x44d257(0x233);async function getOpencodePluginStatus(){const _0x5717de=_0x44d257,_0x276066={'ENqXO':function(_0x2f8411,_0xeacaea){return _0x2f8411!==_0xeacaea;},'rMswA':_0x5717de(0x209),'NcKOq':function(_0x526111,_0x555f24){return _0x526111>_0x555f24;},'pWIac':function(_0xac62a1,_0x31ac15){return _0xac62a1>_0x31ac15;},'VoZUP':function(_0x2c7378,_0x53878e){return _0x2c7378(_0x53878e);},'BIQll':'not_configured','KThzf':'debug','DhBno':_0x5717de(0x200),'ymWhp':_0x5717de(0x248)};return new Promise(_0x3fa9b4=>{const _0x5e0cb1=_0x5717de,_0x364d84=spawn('opencode',[_0x276066['KThzf'],_0x276066['DhBno']],{'stdio':['ignore',_0x5e0cb1(0x248),_0x276066[_0x5e0cb1(0x21a)]]});let _0x239ba2='';_0x364d84[_0x5e0cb1(0x1ff)]?.['on']('data',_0x13765c=>{_0x239ba2+=_0x13765c['toString']();}),_0x364d84['stderr']?.['on'](_0x5e0cb1(0x1f0),_0x111b18=>{_0x239ba2+=_0x111b18['toString']();}),_0x364d84['on'](_0x5e0cb1(0x20c),()=>{_0x3fa9b4({'status':'not_installed'});}),_0x364d84['on'](_0x5e0cb1(0x224),_0x456818=>{const _0x4ca1d3=_0x5e0cb1,_0x3981f9={'XxjQY':function(_0x3b62ca,_0x3a8f43){return _0x276066['ENqXO'](_0x3b62ca,_0x3a8f43);}};if(_0x456818!==0x0){_0x3fa9b4({'status':_0x276066['rMswA']});return;}const _0x11cab9=_0x239ba2[_0x4ca1d3(0x249)]();let _0x14f406=null;if(_0x11cab9)try{_0x14f406=JSON['parse'](_0x11cab9);}catch{const _0x1351fd=_0x11cab9['match'](/\{[\s\S]*\}$/);if(_0x1351fd)try{_0x14f406=JSON['parse'](_0x1351fd[0x0]);}catch{_0x14f406=null;}}const _0x208c80=Array['isArray'](_0x14f406?.['plugin'])?_0x14f406?.[_0x4ca1d3(0x21e)]:[],_0x2f5702=_0x208c80[_0x4ca1d3(0x243)](_0x5e8d88=>{const _0x59e3b2=_0x4ca1d3;if(_0x3981f9[_0x59e3b2(0x211)](typeof _0x5e8d88,'string'))return![];return _0x5e8d88[_0x59e3b2(0x228)]('@ranger-testing/opencode-plugin')||_0x5e8d88['includes']('opencode-plugin');});if(_0x2f5702){_0x3fa9b4({'status':_0x4ca1d3(0x254),'details':_0x276066['NcKOq'](_0x208c80[_0x4ca1d3(0x244)],0x0)?_0x208c80['length']+_0x4ca1d3(0x1fd):undefined});return;}if(_0x276066[_0x4ca1d3(0x232)](_0x208c80[_0x4ca1d3(0x244)],0x0)){_0x276066[_0x4ca1d3(0x229)](_0x3fa9b4,{'status':_0x276066['BIQll'],'details':_0x208c80['length']+'\x20plugin(s)\x20configured'});return;}_0x3fa9b4({'status':'not_configured'});});});}async function getSkillsFromDir(_0x441951,_0x499596){const _0x3b2358=_0x44d257,_0x13d7d6={'vfGGu':_0x3b2358(0x236),'RnxUm':function(_0x4f049b,_0x37367f){return _0x4f049b(_0x37367f);}};if(!existsSync(_0x441951))return[];const _0x14db98=[];try{const _0x3edf79=await readdir(_0x441951,{'withFileTypes':!![]});for(const _0x74c28 of _0x3edf79){if(_0x74c28[_0x3b2358(0x20b)]()){const _0x393609=join(_0x441951,_0x74c28['name'],_0x13d7d6[_0x3b2358(0x247)]);if(_0x13d7d6['RnxUm'](existsSync,_0x393609)){let _0x4896f1=_0x74c28[_0x3b2358(0x1eb)];try{const _0x220e6e=await readFile(_0x393609,_0x3b2358(0x1f9)),_0x20137d=_0x220e6e['match'](/name:\s*(.+)/);_0x20137d&&(_0x4896f1=_0x20137d[0x1][_0x3b2358(0x249)]());}catch{}_0x14db98['push']({'name':_0x74c28['name'],'displayName':_0x4896f1,'path':_0x393609,'level':_0x499596});}}}}catch{return[];}return _0x14db98;}function _0x3f07(_0x3ba11a,_0x33df79){_0x3ba11a=_0x3ba11a-0x1e9;const _0x1c2157=_0x1c21();let _0x3f07d4=_0x1c2157[_0x3ba11a];return _0x3f07d4;}async function getInstalledSkills(){const _0x2f1202=_0x44d257,_0x2acf60={'McQxK':function(_0x43b691,_0x5e1013,_0x2b20da){return _0x43b691(_0x5e1013,_0x2b20da);},'uhBlp':function(_0x7e9e66){return _0x7e9e66();},'XFDdt':'project','LUDyz':function(_0x13453b,_0x505e34,_0xd32284){return _0x13453b(_0x505e34,_0xd32284);},'iEzkq':function(_0x7c8da4){return _0x7c8da4();},'wgTEm':_0x2f1202(0x203)},[_0x3f042,_0x484b3e]=await Promise[_0x2f1202(0x251)]([_0x2acf60['McQxK'](getSkillsFromDir,_0x2acf60[_0x2f1202(0x23b)](getProjectSkillsDir),_0x2acf60[_0x2f1202(0x23a)]),_0x2acf60[_0x2f1202(0x231)](getSkillsFromDir,_0x2acf60[_0x2f1202(0x210)](getUserSkillsDir),_0x2acf60['wgTEm'])]);return{'project':_0x3f042,'user':_0x484b3e};}async function getEnvironments(){const _0x145baf=_0x44d257,_0x131c20={'KeejS':function(_0x4b5f87,_0x48e090,_0x48a5e3){return _0x4b5f87(_0x48e090,_0x48a5e3);},'dJZfY':'settings.json','MjlPn':function(_0x5226a9,_0x248e83,_0x194ec1){return _0x5226a9(_0x248e83,_0x194ec1);},'cgnlS':_0x145baf(0x234),'JRvWf':function(_0x429c9c,_0x22fa44){return _0x429c9c===_0x22fa44;},'QEuqZ':function(_0x320df4){return _0x320df4();},'qoYCR':function(_0x5dba19,_0x23b356){return _0x5dba19(_0x23b356);}},{envNames:_0x1847ba,activeEnv:_0x40efa6}=await getEnvNames(),_0x4ccde2=_0x131c20['QEuqZ'](getRangerDir);if(!_0x131c20[_0x145baf(0x214)](existsSync,_0x4ccde2))return{'envs':[],'activeEnv':null};const _0x238e61=_0x1847ba['map'](_0x45c6a0=>{const _0xa3282c=_0x145baf,_0x19572a=getEnvDir(_0x45c6a0),_0x1e40da=_0x131c20[_0xa3282c(0x23d)](join,_0x19572a,_0x131c20[_0xa3282c(0x230)]),_0x2faa6d=join(_0x19572a,'auth.json'),_0x42cdcb=_0x131c20['MjlPn'](join,_0x19572a,'auth.json.enc');return{'name':_0x45c6a0,'settingsPath':existsSync(_0x1e40da)?_0x1e40da:_0x131c20['cgnlS'],'hasPlaintextAuth':existsSync(_0x2faa6d),'hasEncryptedAuth':existsSync(_0x42cdcb),'isActive':_0x131c20['JRvWf'](_0x45c6a0,_0x40efa6)};});return{'envs':_0x238e61,'activeEnv':_0x40efa6};}export async function status(){const _0xbb15ee=_0x44d257,_0x311f7c={'xGPyy':function(_0x4dd5d8){return _0x4dd5d8();},'icbfZ':function(_0x2e3f30,_0x589e48){return _0x2e3f30(_0x589e48);},'WnYEa':function(_0x4fde50,_0x16463a,_0x426725){return _0x4fde50(_0x16463a,_0x426725);},'MgNaU':function(_0x379672){return _0x379672();},'sqeDi':function(_0x19ea80,_0x56fb55){return _0x19ea80!==_0x56fb55;},'LgQLM':function(_0x53ed74,_0x47adaf){return _0x53ed74(_0x47adaf);},'eBvCM':function(_0x46e3a5,_0x7599f6){return _0x46e3a5(_0x7599f6);},'qKkXe':_0xbb15ee(0x254),'TzdeD':'\x20\x20Run:\x20ranger\x20setup\x20--opencode','cxkeV':_0xbb15ee(0x1e9),'JswcM':_0xbb15ee(0x20e),'ifeaq':'enabled','zXtgw':_0xbb15ee(0x235),'ctQEV':'\x0a---\x20Skills\x20---','ZnYtR':function(_0x631d82,_0x4e657a){return _0x631d82+_0x4e657a;},'WwfDP':function(_0x420063,_0x1feba5){return _0x420063===_0x1feba5;},'vGsew':function(_0x20d16b,_0x6bbabe){return _0x20d16b>_0x6bbabe;},'PZBOn':function(_0xff2d42,_0x561c9c,_0x130c46){return _0xff2d42(_0x561c9c,_0x130c46);},'oKnOo':function(_0x1be8ee,_0x205c59){return _0x1be8ee>_0x205c59;},'wEYky':'\x20\x20User-level:','klEjF':_0xbb15ee(0x246),'tEIcM':function(_0xdb5aee){return _0xdb5aee();},'IFpta':function(_0x3075b8){return _0x3075b8();},'xwjrD':'No\x20profiles\x20configured','HFueq':function(_0x3a640e,_0x6d6a54){return _0x3a640e(_0x6d6a54);},'IBsCU':'\x20(active)','xoCGK':'encrypted','jjufP':'plaintext','rSyDE':function(_0x169118,_0x25db4a){return _0x169118(_0x25db4a);},'gnplS':function(_0xe4fdf5,_0x3c3cbe,_0x110144){return _0xe4fdf5(_0x3c3cbe,_0x110144);}};console['log']('\x0a📊\x20Ranger\x20Status\x0a');const _0x479aeb=process['cwd'](),_0x493122=_0x311f7c['xGPyy'](getRangerDir);if(!_0x311f7c['icbfZ'](existsSync,_0x493122)){console[_0xbb15ee(0x23f)](_0xbb15ee(0x1f6)+_0x311f7c[_0xbb15ee(0x24c)](link,_0x479aeb,_0x311f7c['icbfZ'](bold,basename(_0x479aeb)))),console[_0xbb15ee(0x23f)](_0xbb15ee(0x220)),console['log'](_0xbb15ee(0x24a));return;}console['log'](_0xbb15ee(0x1f6)+link(_0x479aeb,bold(basename(_0x479aeb))));const _0x4b1b98=getCurrentVersion(),_0x3b5e0b=_0x311f7c['MgNaU'](getLatestVersion);if(_0x3b5e0b[_0xbb15ee(0x223)]&&_0x311f7c[_0xbb15ee(0x1ea)](_0x3b5e0b['version'],_0x4b1b98))console['log'](_0xbb15ee(0x24d)+_0x4b1b98+'\x20(latest:\x20'+_0x3b5e0b[_0xbb15ee(0x223)]+')'),console[_0xbb15ee(0x23f)](_0xbb15ee(0x215));else _0x3b5e0b[_0xbb15ee(0x223)]?console[_0xbb15ee(0x23f)](_0xbb15ee(0x24d)+_0x4b1b98+_0xbb15ee(0x1fb)):console[_0xbb15ee(0x23f)](_0xbb15ee(0x24d)+_0x4b1b98);const _0x5151e7=await getToken();if(_0x5151e7){const _0x3e5654=await _0x311f7c[_0xbb15ee(0x239)](getCurrentUser,_0x5151e7);_0x3e5654['success']?console[_0xbb15ee(0x23f)]('Organization:\x20'+_0x311f7c['eBvCM'](bold,_0x3e5654['user']['organizationName'])):(console['log'](_0xbb15ee(0x1f3)),console[_0xbb15ee(0x23f)]('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console['log']('API\x20Token:\x20✗\x20Not\x20found'),console[_0xbb15ee(0x23f)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process['env']['DEBUG']&&(console['log'](_0xbb15ee(0x245)+_0x311f7c['xGPyy'](getCurrentEnvironment)),console[_0xbb15ee(0x23f)]('API\x20URL:\x20'+getApiBaseUrl()));console['log']('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x52e4d7=await _0x311f7c['MgNaU'](getOpencodePluginStatus);if(_0x52e4d7['status']===_0x311f7c['qKkXe'])console['log']('\x20\x20'+bold('@ranger-testing/opencode-plugin')+':\x20configured'),_0x52e4d7['details']&&console[_0xbb15ee(0x23f)]('\x20\x20'+_0x52e4d7['details']);else _0x52e4d7[_0xbb15ee(0x24b)]===_0xbb15ee(0x22a)?(console['log'](_0xbb15ee(0x21c)),_0x52e4d7[_0xbb15ee(0x218)]&&console['log']('\x20\x20'+_0x52e4d7['details']),console[_0xbb15ee(0x23f)](_0x311f7c['TzdeD'])):console[_0xbb15ee(0x23f)](_0x311f7c['cxkeV']);console[_0xbb15ee(0x23f)](_0xbb15ee(0x22f));const _0x58bad6=await getPluginInfo(_0xbb15ee(0x219));if(_0x58bad6){const _0x10109a=_0x58bad6[_0xbb15ee(0x226)]||_0x311f7c[_0xbb15ee(0x21b)],_0x32933d=_0x58bad6['enabled']?_0x311f7c[_0xbb15ee(0x24e)]:_0xbb15ee(0x21f);console['log']('\x20\x20'+bold('ranger@trailhead')+_0xbb15ee(0x201)+_0x10109a+',\x20'+_0x32933d+')');}else console['log'](_0x311f7c[_0xbb15ee(0x24f)]),console[_0xbb15ee(0x23f)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)');console['log'](_0x311f7c[_0xbb15ee(0x1ec)]);const {project:_0x560947,user:_0x4ecb83}=await getInstalledSkills(),_0x41c47b=_0x560947[_0xbb15ee(0x1f7)](_0x1f6504=>RANGER_MANAGED_SKILLS[_0xbb15ee(0x228)](_0x1f6504['name'])),_0x37500d=_0x4ecb83['filter'](_0x29a379=>RANGER_MANAGED_SKILLS['includes'](_0x29a379[_0xbb15ee(0x1eb)])),_0x34950b=_0x311f7c[_0xbb15ee(0x22b)](_0x41c47b['length'],_0x37500d[_0xbb15ee(0x244)]);if(_0x311f7c[_0xbb15ee(0x240)](_0x34950b,0x0))console[_0xbb15ee(0x23f)](_0xbb15ee(0x253)),console[_0xbb15ee(0x23f)](_0xbb15ee(0x1f2));else{if(_0x311f7c['vGsew'](_0x41c47b[_0xbb15ee(0x244)],0x0)){console['log']('\x20\x20Project-level:');for(const _0x89727a of _0x41c47b){console['log']('\x20\x20\x20\x20'+bold(_0x89727a['displayName'])+':\x20'+_0x311f7c['PZBOn'](link,_0x89727a[_0xbb15ee(0x207)],basename(_0x89727a[_0xbb15ee(0x207)])));}}if(_0x311f7c['oKnOo'](_0x37500d[_0xbb15ee(0x244)],0x0)){console[_0xbb15ee(0x23f)](_0x311f7c['wEYky']);for(const _0x382031 of _0x37500d){console[_0xbb15ee(0x23f)]('\x20\x20\x20\x20'+_0x311f7c['LgQLM'](bold,_0x382031[_0xbb15ee(0x21d)])+':\x20'+link(_0x382031['path'],_0x311f7c['eBvCM'](basename,_0x382031[_0xbb15ee(0x207)])));}}}console['log'](_0x311f7c['klEjF']);const {envs:_0x2b0cac,activeEnv:_0x1fa91b}=await _0x311f7c[_0xbb15ee(0x205)](getEnvironments);let _0x30f842=[];if(_0x5151e7)try{_0x30f842=await _0x311f7c[_0xbb15ee(0x216)](listCloudProfiles);}catch{}const _0x3b616e=_0x311f7c[_0xbb15ee(0x22b)](_0x2b0cac['length'],_0x30f842[_0xbb15ee(0x244)]);if(_0x3b616e===0x0)console[_0xbb15ee(0x23f)](_0x311f7c[_0xbb15ee(0x204)]),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0x3b616e>0x5){const _0x702ecc=[];_0x311f7c[_0xbb15ee(0x242)](_0x30f842[_0xbb15ee(0x244)],0x0)&&_0x702ecc[_0xbb15ee(0x1f5)](_0x30f842[_0xbb15ee(0x244)]+'\x20cloud'),_0x2b0cac[_0xbb15ee(0x244)]>0x0&&_0x702ecc[_0xbb15ee(0x1f5)](_0x2b0cac[_0xbb15ee(0x244)]+_0xbb15ee(0x1ed)),console[_0xbb15ee(0x23f)](_0x3b616e+_0xbb15ee(0x20a)+_0x702ecc[_0xbb15ee(0x1f4)](',\x20')+')'),_0x1fa91b&&console['log']('\x20\x20Active:\x20'+_0x311f7c[_0xbb15ee(0x20d)](bold,_0x1fa91b)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x39a0d8 of _0x30f842){const _0x714970=_0x311f7c['WwfDP'](_0x39a0d8['name'],_0x1fa91b)?_0x311f7c[_0xbb15ee(0x241)]:'';console['log']('\x20\x20'+_0x311f7c[_0xbb15ee(0x250)](bold,_0x39a0d8[_0xbb15ee(0x1eb)])+'\x20[cloud]'+_0x714970);const _0x429492=_0x39a0d8['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x39a0d8[_0xbb15ee(0x1f8)]+')':_0xbb15ee(0x213);console[_0xbb15ee(0x23f)](_0xbb15ee(0x208)+_0x429492);}const _0x4cae21=new Set(_0x30f842['map'](_0x3ef762=>_0x3ef762['name']));for(const _0x4dc3c7 of _0x2b0cac){if(_0x4cae21['has'](_0x4dc3c7['name']))continue;const _0xc8987f=_0x4dc3c7['isActive']?_0xbb15ee(0x1ef):'',_0x2283e1=_0x4dc3c7[_0xbb15ee(0x206)]?_0x311f7c['xoCGK']:_0x4dc3c7[_0xbb15ee(0x22e)]?_0x311f7c['jjufP']:'none';console['log']('\x20\x20'+_0x311f7c['rSyDE'](bold,_0x4dc3c7[_0xbb15ee(0x1eb)])+_0xbb15ee(0x222)+_0xc8987f),console['log'](_0xbb15ee(0x212)+_0x2283e1),_0x4dc3c7[_0xbb15ee(0x227)]!==_0xbb15ee(0x234)&&console['log'](_0xbb15ee(0x20f)+_0x311f7c['gnplS'](link,_0x4dc3c7['settingsPath'],_0x311f7c['HFueq'](basename,_0x4dc3c7['settingsPath'])));}if(!_0x1fa91b){console['log'](_0xbb15ee(0x237));const _0xd725c4=[..._0x30f842[_0xbb15ee(0x1fe)](_0x4f96ee=>_0x4f96ee['name']),..._0x2b0cac['filter'](_0x19ad8e=>!_0x4cae21[_0xbb15ee(0x225)](_0x19ad8e[_0xbb15ee(0x1eb)]))['map'](_0x1f3e85=>_0x1f3e85['name'])];console[_0xbb15ee(0x23f)](_0xbb15ee(0x252)+_0xd725c4[_0xbb15ee(0x1f4)](',\x20')+')');}}}console['log']('');}
|
|
1
|
+
const _0x3a3058=_0x2e98;(function(_0x3d395d,_0x5cd112){const _0x5afadf=_0x2e98,_0x5f1396=_0x3d395d();while(!![]){try{const _0x43e96f=parseInt(_0x5afadf(0x196))/0x1*(parseInt(_0x5afadf(0x164))/0x2)+-parseInt(_0x5afadf(0x18c))/0x3*(parseInt(_0x5afadf(0x199))/0x4)+parseInt(_0x5afadf(0x17a))/0x5+parseInt(_0x5afadf(0x186))/0x6*(-parseInt(_0x5afadf(0x1a0))/0x7)+-parseInt(_0x5afadf(0x1b4))/0x8+parseInt(_0x5afadf(0x188))/0x9+parseInt(_0x5afadf(0x1a6))/0xa;if(_0x43e96f===_0x5cd112)break;else _0x5f1396['push'](_0x5f1396['shift']());}catch(_0x53b043){_0x5f1396['push'](_0x5f1396['shift']());}}}(_0x4294,0xddcc6));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';function _0x2e98(_0x5372eb,_0x58a32e){_0x5372eb=_0x5372eb-0x15b;const _0x429482=_0x4294();let _0x2e98bc=_0x429482[_0x5372eb];return _0x2e98bc;}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=_0x301b09=>_0x3a3058(0x173)+_0x301b09+'\x1b[0m',link=(_0x531b31,_0x47c102)=>_0x3a3058(0x17e)+_0x531b31+'\x07'+(_0x47c102||_0x531b31)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x215e58=_0x3a3058,_0x43a59e={'ntEJJ':function(_0xc7a3d5,_0x5b5c0b){return _0xc7a3d5(_0x5b5c0b);},'MsopP':'not_installed','UPwYu':_0x215e58(0x190),'VqRDy':function(_0x20ca99,_0x63542b){return _0x20ca99!==_0x63542b;},'NBSvH':'@ranger-testing/opencode-plugin','cOoVQ':_0x215e58(0x19b),'KCUGE':function(_0x74a646,_0x5ec132,_0x2dd5cc,_0x13c476){return _0x74a646(_0x5ec132,_0x2dd5cc,_0x13c476);},'mmope':_0x215e58(0x161),'spcNb':_0x215e58(0x193),'EsRKv':_0x215e58(0x15f),'YvCTC':_0x215e58(0x15d)};return new Promise(_0x382981=>{const _0x1026e5=_0x215e58,_0x5ae149={'IThjb':function(_0x1c96a0,_0x94516d){return _0x43a59e['VqRDy'](_0x1c96a0,_0x94516d);},'wGWVD':'string','kzPQt':_0x43a59e['NBSvH'],'BhnPp':_0x43a59e['cOoVQ']},_0x2716ff=_0x43a59e['KCUGE'](spawn,_0x43a59e['mmope'],[_0x1026e5(0x1a3),'config'],{'stdio':['ignore','pipe',_0x1026e5(0x17c)]});let _0x132365='';_0x2716ff['stdout']?.['on'](_0x43a59e['spcNb'],_0x4f5567=>{const _0x31f543=_0x1026e5;_0x132365+=_0x4f5567[_0x31f543(0x160)]();}),_0x2716ff[_0x1026e5(0x19a)]?.['on'](_0x43a59e['spcNb'],_0x8ac610=>{const _0x3bab16=_0x1026e5;_0x132365+=_0x8ac610[_0x3bab16(0x160)]();}),_0x2716ff['on'](_0x43a59e[_0x1026e5(0x19e)],()=>{const _0x2934b8=_0x1026e5;_0x43a59e[_0x2934b8(0x1b7)](_0x382981,{'status':_0x43a59e[_0x2934b8(0x1ae)]});}),_0x2716ff['on'](_0x43a59e[_0x1026e5(0x19f)],_0x3efd02=>{const _0x5c3d35=_0x1026e5;if(_0x3efd02!==0x0){_0x382981({'status':_0x5c3d35(0x1c5)});return;}const _0x5dbb5c=_0x132365[_0x5c3d35(0x1c6)]();let _0x571b2b=null;if(_0x5dbb5c)try{_0x571b2b=JSON[_0x5c3d35(0x1b9)](_0x5dbb5c);}catch{const _0x2d20f6=_0x5dbb5c[_0x5c3d35(0x1ba)](/\{[\s\S]*\}$/);if(_0x2d20f6)try{_0x571b2b=JSON['parse'](_0x2d20f6[0x0]);}catch{_0x571b2b=null;}}const _0x50d06d=Array['isArray'](_0x571b2b?.['plugin'])?_0x571b2b?.[_0x5c3d35(0x177)]:[],_0x4f9793=_0x50d06d[_0x5c3d35(0x162)](_0x531bc6=>{const _0x3f7b5d=_0x5c3d35;if(_0x5ae149[_0x3f7b5d(0x1a5)](typeof _0x531bc6,_0x5ae149['wGWVD']))return![];return _0x531bc6['includes'](_0x5ae149[_0x3f7b5d(0x165)])||_0x531bc6['includes'](_0x5ae149['BhnPp']);});if(_0x4f9793){_0x43a59e[_0x5c3d35(0x1b7)](_0x382981,{'status':'configured','details':_0x50d06d['length']>0x0?_0x50d06d[_0x5c3d35(0x175)]+_0x5c3d35(0x179):undefined});return;}if(_0x50d06d['length']>0x0){_0x43a59e[_0x5c3d35(0x1b7)](_0x382981,{'status':_0x43a59e[_0x5c3d35(0x168)],'details':_0x50d06d['length']+_0x5c3d35(0x179)});return;}_0x43a59e[_0x5c3d35(0x1b7)](_0x382981,{'status':_0x43a59e[_0x5c3d35(0x168)]});});});}async function getSkillsFromDir(_0x4e4690,_0x46874f){const _0x1dfce4=_0x3a3058,_0x532854={'nfshJ':function(_0x916e9e,_0x27e010,_0x2b3a11){return _0x916e9e(_0x27e010,_0x2b3a11);},'MXnsT':_0x1dfce4(0x1ab),'NzQpu':'utf-8'};if(!existsSync(_0x4e4690))return[];const _0x4dfe60=[];try{const _0x498dfe=await _0x532854[_0x1dfce4(0x18d)](readdir,_0x4e4690,{'withFileTypes':!![]});for(const _0x1e5004 of _0x498dfe){if(_0x1e5004[_0x1dfce4(0x16a)]()){const _0x394b22=join(_0x4e4690,_0x1e5004['name'],_0x532854['MXnsT']);if(existsSync(_0x394b22)){let _0x40078c=_0x1e5004[_0x1dfce4(0x172)];try{const _0xe17d56=await readFile(_0x394b22,_0x532854['NzQpu']),_0x544fa7=_0xe17d56[_0x1dfce4(0x1ba)](/name:\s*(.+)/);_0x544fa7&&(_0x40078c=_0x544fa7[0x1][_0x1dfce4(0x1c6)]());}catch{}_0x4dfe60['push']({'name':_0x1e5004[_0x1dfce4(0x172)],'displayName':_0x40078c,'path':_0x394b22,'level':_0x46874f});}}}}catch{return[];}return _0x4dfe60;}function _0x4294(){const _0x9900a6=['error','toString','opencode','some','ZyCxy','26eIBqmh','kzPQt','includes','bXhGk','UPwYu','details','isDirectory','project','fOgDg','\x20\x20\x20\x20Auth:\x20','auth.json.enc','sessionUpdatedAt','configured','path','name','\x1b[1m','env','length','dudip','plugin','No\x20profiles\x20configured','\x20plugin(s)\x20configured','2434425jOhGzH','imBuV','pipe','Root:\x20','\x1b]8;;file://','no\x20session','cached\x20(updated\x20','Jotdc','\x20\x20Run:\x20ranger\x20setup\x20--opencode','none','has','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','480372VkUJta','\x20\x20Active:\x20','2433861wQNJzP','isActive','qTTNz','Version:\x20','6BwnaqP','nfshJ','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','\x0a📊\x20Ranger\x20Status\x0a','not_configured','\x20(active)','MzHZN','data','\x20(up\x20to\x20date)','\x0a---\x20Skills\x20---','104074PSPsCQ','saSAl','\x20cloud','496004xEREAq','stderr','opencode-plugin','gJfmQ','YyEFY','EsRKv','YvCTC','119eDxwEh','pCSpm','wVUWg','debug','hpmta','IThjb','18534300FEhsYI','user','\x20\x20\x20\x20','hasPlaintextAuth','organizationName','SKILL.md','displayName','yJDtJ','MsopP','\x20\x20Project-level:','enabled','DjNDo','filter','KfTZp','11569312WWRBUR','\x20\x20\x20\x20Session:\x20',':\x20installed\x20(','ntEJJ','join','parse','match','success','HugxX','log','DEBUG','API\x20Token:\x20✗\x20Not\x20found','\x20\x20\x20\x20Settings:\x20','Uwjmi','\x0a\x20\x20No\x20active\x20profile\x20set','encrypted','status','not_installed','trim','\x20\x20Not\x20installed','(not\x20found)','close','map'];_0x4294=function(){return _0x9900a6;};return _0x4294();}async function getInstalledSkills(){const _0x4463d3=_0x3a3058,_0x1efabe={'Uwjmi':function(_0x552561,_0x35df56,_0x48043f){return _0x552561(_0x35df56,_0x48043f);},'BXjiN':_0x4463d3(0x16b),'yJDtJ':'user'},[_0x2e5c8b,_0x2d307e]=await Promise['all']([_0x1efabe[_0x4463d3(0x1c1)](getSkillsFromDir,getProjectSkillsDir(),_0x1efabe['BXjiN']),getSkillsFromDir(getUserSkillsDir(),_0x1efabe[_0x4463d3(0x1ad)])]);return{'project':_0x2e5c8b,'user':_0x2d307e};}async function getEnvironments(){const _0x107dbe=_0x3a3058,_0x5e9071={'HugxX':function(_0x204259,_0x5bbf21){return _0x204259(_0x5bbf21);},'bXhGk':'settings.json','NDmUK':_0x107dbe(0x16e),'wVUWg':_0x107dbe(0x15c),'AlsNr':function(_0x77a031){return _0x77a031();},'YYcXA':function(_0x2f4ec5,_0x3681f3){return _0x2f4ec5(_0x3681f3);}},{envNames:_0x1a65d0,activeEnv:_0x58d57e}=await _0x5e9071['AlsNr'](getEnvNames),_0x23c28b=_0x5e9071['AlsNr'](getRangerDir);if(!_0x5e9071['YYcXA'](existsSync,_0x23c28b))return{'envs':[],'activeEnv':null};const _0x1450c5=_0x1a65d0['map'](_0x6eaca6=>{const _0x5b3580=_0x107dbe,_0x5bd47f=_0x5e9071[_0x5b3580(0x1bc)](getEnvDir,_0x6eaca6),_0x146633=join(_0x5bd47f,_0x5e9071[_0x5b3580(0x167)]),_0x14320d=join(_0x5bd47f,'auth.json'),_0x4ac7b5=join(_0x5bd47f,_0x5e9071['NDmUK']);return{'name':_0x6eaca6,'settingsPath':existsSync(_0x146633)?_0x146633:_0x5e9071[_0x5b3580(0x1a2)],'hasPlaintextAuth':_0x5e9071['HugxX'](existsSync,_0x14320d),'hasEncryptedAuth':_0x5e9071[_0x5b3580(0x1bc)](existsSync,_0x4ac7b5),'isActive':_0x6eaca6===_0x58d57e};});return{'envs':_0x1450c5,'activeEnv':_0x58d57e};}export async function status(){const _0x5b6f4b=_0x3a3058,_0x2a5e02={'fOgDg':_0x5b6f4b(0x18f),'hpmta':function(_0x30e515,_0x527d19,_0x2d3bc5){return _0x30e515(_0x527d19,_0x2d3bc5);},'gJfmQ':function(_0x2a80cf,_0x278994){return _0x2a80cf(_0x278994);},'HEuIO':function(_0x1647c1){return _0x1647c1();},'YyEFY':function(_0x5b27d6,_0x135750){return _0x5b27d6!==_0x135750;},'ZDlmb':function(_0x5dfb87){return _0x5dfb87();},'imBuV':function(_0x5e871f){return _0x5e871f();},'saSAl':function(_0x21c4ce,_0x337e61){return _0x21c4ce===_0x337e61;},'AdXTo':'\x20\x20Not\x20configured','XoJnw':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','pCSpm':function(_0x17e9bb,_0x5746b){return _0x17e9bb(_0x5746b);},'sLQlO':'unknown','duIaf':'ranger@trailhead','ZyCxy':_0x5b6f4b(0x15b),'mUpRl':_0x5b6f4b(0x18e),'nAqKl':function(_0x21d4b2,_0x2440d0){return _0x21d4b2===_0x2440d0;},'Rvnzl':'No\x20skills\x20installed','DjNDo':function(_0x2758a3,_0x1cc9f7){return _0x2758a3>_0x1cc9f7;},'qTTNz':_0x5b6f4b(0x1af),'PCAoc':function(_0x413484,_0x502bc3,_0x4a4419){return _0x413484(_0x502bc3,_0x4a4419);},'Jotdc':'\x0a---\x20Profiles\x20---','xIlyZ':function(_0x5f0c48,_0x82aace){return _0x5f0c48(_0x82aace);},'KfTZp':_0x5b6f4b(0x191),'dudip':function(_0x5b5bfc,_0x5273f7){return _0x5b5bfc(_0x5273f7);},'MzHZN':'plaintext','ZcmeC':_0x5b6f4b(0x183),'xdWON':'(not\x20found)'};console[_0x5b6f4b(0x1bd)](_0x2a5e02[_0x5b6f4b(0x16c)]);const _0x558381=process['cwd'](),_0x211624=getRangerDir();if(!existsSync(_0x211624)){console[_0x5b6f4b(0x1bd)](_0x5b6f4b(0x17d)+_0x2a5e02[_0x5b6f4b(0x1a4)](link,_0x558381,bold(basename(_0x558381)))),console['log'](_0x5b6f4b(0x185)),console[_0x5b6f4b(0x1bd)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x5b6f4b(0x1bd)]('Root:\x20'+link(_0x558381,_0x2a5e02[_0x5b6f4b(0x19c)](bold,basename(_0x558381))));const _0x32d042=getCurrentVersion(),_0x666935=_0x2a5e02['HEuIO'](getLatestVersion);if(_0x666935['version']&&_0x2a5e02['YyEFY'](_0x666935['version'],_0x32d042))console[_0x5b6f4b(0x1bd)]('Version:\x20'+_0x32d042+'\x20(latest:\x20'+_0x666935['version']+')'),console[_0x5b6f4b(0x1bd)]('\x20\x20Run:\x20ranger\x20update');else _0x666935['version']?console[_0x5b6f4b(0x1bd)]('Version:\x20'+_0x32d042+_0x5b6f4b(0x194)):console[_0x5b6f4b(0x1bd)](_0x5b6f4b(0x18b)+_0x32d042);const _0x26feb1=await getToken();if(_0x26feb1){const _0x156ae0=await getCurrentUser(_0x26feb1);_0x156ae0[_0x5b6f4b(0x1bb)]?console[_0x5b6f4b(0x1bd)]('Organization:\x20'+bold(_0x156ae0[_0x5b6f4b(0x1a7)][_0x5b6f4b(0x1aa)])):(console[_0x5b6f4b(0x1bd)]('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0x5b6f4b(0x1bd)](_0x5b6f4b(0x1bf)),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0x5b6f4b(0x174)][_0x5b6f4b(0x1be)]&&(console['log']('API\x20Environment:\x20'+_0x2a5e02['ZDlmb'](getCurrentEnvironment)),console[_0x5b6f4b(0x1bd)]('API\x20URL:\x20'+_0x2a5e02[_0x5b6f4b(0x17b)](getApiBaseUrl)));console['log']('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x56f273=await _0x2a5e02['ZDlmb'](getOpencodePluginStatus);if(_0x2a5e02[_0x5b6f4b(0x197)](_0x56f273[_0x5b6f4b(0x1c4)],_0x5b6f4b(0x170)))console[_0x5b6f4b(0x1bd)]('\x20\x20'+bold('@ranger-testing/opencode-plugin')+':\x20configured'),_0x56f273['details']&&console['log']('\x20\x20'+_0x56f273['details']);else _0x56f273[_0x5b6f4b(0x1c4)]===_0x5b6f4b(0x190)?(console[_0x5b6f4b(0x1bd)](_0x2a5e02['AdXTo']),_0x56f273['details']&&console[_0x5b6f4b(0x1bd)]('\x20\x20'+_0x56f273[_0x5b6f4b(0x169)]),console['log'](_0x5b6f4b(0x182))):console['log'](_0x2a5e02['XoJnw']);console['log']('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x3f9b24=await _0x2a5e02[_0x5b6f4b(0x1a1)](getPluginInfo,'ranger@trailhead');if(_0x3f9b24){const _0x3f8f1d=_0x3f9b24['scope']||_0x2a5e02['sLQlO'],_0x32e31f=_0x3f9b24[_0x5b6f4b(0x1b0)]?_0x5b6f4b(0x1b0):'disabled';console[_0x5b6f4b(0x1bd)]('\x20\x20'+bold(_0x2a5e02['duIaf'])+_0x5b6f4b(0x1b6)+_0x3f8f1d+',\x20'+_0x32e31f+')');}else console[_0x5b6f4b(0x1bd)](_0x2a5e02[_0x5b6f4b(0x163)]),console['log'](_0x2a5e02['mUpRl']);console[_0x5b6f4b(0x1bd)](_0x5b6f4b(0x195));const {project:_0x5b71e1,user:_0x4310dd}=await getInstalledSkills(),_0x1caa0b=_0x5b71e1[_0x5b6f4b(0x1b2)](_0x212aec=>RANGER_MANAGED_SKILLS[_0x5b6f4b(0x166)](_0x212aec[_0x5b6f4b(0x172)])),_0x520f63=_0x4310dd['filter'](_0x568e4f=>RANGER_MANAGED_SKILLS[_0x5b6f4b(0x166)](_0x568e4f['name'])),_0x1aabba=_0x1caa0b['length']+_0x520f63[_0x5b6f4b(0x175)];if(_0x2a5e02['nAqKl'](_0x1aabba,0x0))console['log'](_0x2a5e02['Rvnzl']),console['log']('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x2a5e02[_0x5b6f4b(0x1b1)](_0x1caa0b[_0x5b6f4b(0x175)],0x0)){console[_0x5b6f4b(0x1bd)](_0x2a5e02[_0x5b6f4b(0x18a)]);for(const _0x4b371c of _0x1caa0b){console[_0x5b6f4b(0x1bd)](_0x5b6f4b(0x1a8)+_0x2a5e02['gJfmQ'](bold,_0x4b371c[_0x5b6f4b(0x1ac)])+':\x20'+link(_0x4b371c[_0x5b6f4b(0x171)],basename(_0x4b371c[_0x5b6f4b(0x171)])));}}if(_0x520f63['length']>0x0){console['log']('\x20\x20User-level:');for(const _0x2a0478 of _0x520f63){console[_0x5b6f4b(0x1bd)]('\x20\x20\x20\x20'+_0x2a5e02[_0x5b6f4b(0x1a1)](bold,_0x2a0478['displayName'])+':\x20'+_0x2a5e02['PCAoc'](link,_0x2a0478[_0x5b6f4b(0x171)],basename(_0x2a0478[_0x5b6f4b(0x171)])));}}}console['log'](_0x2a5e02[_0x5b6f4b(0x181)]);const {envs:_0x18fba0,activeEnv:_0x485547}=await getEnvironments();let _0x2ef6f1=[];if(_0x26feb1)try{_0x2ef6f1=await _0x2a5e02['HEuIO'](listCloudProfiles);}catch{}const _0xc301d=_0x18fba0[_0x5b6f4b(0x175)]+_0x2ef6f1['length'];if(_0xc301d===0x0)console[_0x5b6f4b(0x1bd)](_0x5b6f4b(0x178)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0x2a5e02['DjNDo'](_0xc301d,0x5)){const _0x55689f=[];_0x2a5e02['DjNDo'](_0x2ef6f1['length'],0x0)&&_0x55689f['push'](_0x2ef6f1[_0x5b6f4b(0x175)]+_0x5b6f4b(0x198)),_0x2a5e02['DjNDo'](_0x18fba0[_0x5b6f4b(0x175)],0x0)&&_0x55689f['push'](_0x18fba0[_0x5b6f4b(0x175)]+'\x20local'),console['log'](_0xc301d+'\x20profiles\x20configured\x20('+_0x55689f[_0x5b6f4b(0x1b8)](',\x20')+')'),_0x485547&&console['log'](_0x5b6f4b(0x187)+_0x2a5e02['xIlyZ'](bold,_0x485547)),console[_0x5b6f4b(0x1bd)]('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x4222ce of _0x2ef6f1){const _0x16d3ab=_0x4222ce['name']===_0x485547?_0x2a5e02[_0x5b6f4b(0x1b3)]:'';console['log']('\x20\x20'+_0x2a5e02[_0x5b6f4b(0x176)](bold,_0x4222ce['name'])+'\x20[cloud]'+_0x16d3ab);const _0x2ba5b3=_0x4222ce['sessionUpdatedAt']?_0x5b6f4b(0x180)+_0x4222ce[_0x5b6f4b(0x16f)]+')':_0x5b6f4b(0x17f);console[_0x5b6f4b(0x1bd)](_0x5b6f4b(0x1b5)+_0x2ba5b3);}const _0x4b9a46=new Set(_0x2ef6f1[_0x5b6f4b(0x15e)](_0x2795f7=>_0x2795f7[_0x5b6f4b(0x172)]));for(const _0x15fbd5 of _0x18fba0){if(_0x4b9a46['has'](_0x15fbd5[_0x5b6f4b(0x172)]))continue;const _0x6363ae=_0x15fbd5[_0x5b6f4b(0x189)]?_0x2a5e02['KfTZp']:'',_0x12dee4=_0x15fbd5['hasEncryptedAuth']?_0x5b6f4b(0x1c3):_0x15fbd5[_0x5b6f4b(0x1a9)]?_0x2a5e02[_0x5b6f4b(0x192)]:_0x2a5e02['ZcmeC'];console[_0x5b6f4b(0x1bd)]('\x20\x20'+bold(_0x15fbd5[_0x5b6f4b(0x172)])+'\x20[local]'+_0x6363ae),console[_0x5b6f4b(0x1bd)](_0x5b6f4b(0x16d)+_0x12dee4),_0x2a5e02[_0x5b6f4b(0x19d)](_0x15fbd5['settingsPath'],_0x2a5e02['xdWON'])&&console['log'](_0x5b6f4b(0x1c0)+_0x2a5e02[_0x5b6f4b(0x1a4)](link,_0x15fbd5['settingsPath'],basename(_0x15fbd5['settingsPath'])));}if(!_0x485547){console['log'](_0x5b6f4b(0x1c2));const _0x35d8dc=[..._0x2ef6f1[_0x5b6f4b(0x15e)](_0x3ec85e=>_0x3ec85e[_0x5b6f4b(0x172)]),..._0x18fba0['filter'](_0x29a4d1=>!_0x4b9a46[_0x5b6f4b(0x184)](_0x29a4d1['name']))['map'](_0x3193af=>_0x3193af['name'])];console['log']('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x35d8dc[_0x5b6f4b(0x1b8)](',\x20')+')');}}}console[_0x5b6f4b(0x1bd)]('');}
|