@ranger-testing/ranger-cli 3.1.1 → 3.1.2-alpha.b450a14-41
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(_0x38dee0,_0x4afe1e){const _0x2bffa1=_0x28c4,_0x445c03=_0x38dee0();while(!![]){try{const _0x4f4b17=parseInt(_0x2bffa1(0x1a0))/0x1*(parseInt(_0x2bffa1(0x190))/0x2)+-parseInt(_0x2bffa1(0x194))/0x3*(-parseInt(_0x2bffa1(0x19c))/0x4)+-parseInt(_0x2bffa1(0x19a))/0x5*(-parseInt(_0x2bffa1(0x198))/0x6)+-parseInt(_0x2bffa1(0x192))/0x7*(-parseInt(_0x2bffa1(0x19f))/0x8)+parseInt(_0x2bffa1(0x19e))/0x9*(-parseInt(_0x2bffa1(0x1a2))/0xa)+-parseInt(_0x2bffa1(0x193))/0xb+-parseInt(_0x2bffa1(0x199))/0xc*(parseInt(_0x2bffa1(0x18e))/0xd);if(_0x4f4b17===_0x4afe1e)break;else _0x445c03['push'](_0x445c03['shift']());}catch(_0x100195){_0x445c03['push'](_0x445c03['shift']());}}}(_0x48fc,0x27f46));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0xd1a9b6=_0x28c4,_0x17f371={'oAOuR':function(_0x2fd8ae){return _0x2fd8ae();},'HsYzE':'Re-authenticating\x20via\x20MCP\x20bootstrap...','rpxUP':_0xd1a9b6(0x18d),'aXwIb':function(_0x2dc503){return _0x2dc503();},'BRgIc':'\x0a✅\x20API\x20key\x20stored\x20successfully','blggC':function(_0x18a23c,_0x31e928){return _0x18a23c instanceof _0x31e928;}},_0x48b9d6=await _0x17f371['oAOuR'](getMcpAuthOrigin);if(_0x48b9d6){console[_0xd1a9b6(0x1a1)](_0x17f371[_0xd1a9b6(0x195)]),await _0x17f371['oAOuR'](mcpBootstrap);return;}if(!isInteractive())throw new Error(_0x17f371[_0xd1a9b6(0x196)]);try{const _0x1c32be=await _0x17f371[_0xd1a9b6(0x19d)](runDeviceAuthFlow),_0x53fb2f=await getCurrentUser(_0x1c32be);_0x53fb2f[_0xd1a9b6(0x19b)]?console[_0xd1a9b6(0x1a1)](_0xd1a9b6(0x18f)+_0x53fb2f[_0xd1a9b6(0x197)]['organizationName']):console['log'](_0x17f371[_0xd1a9b6(0x191)]);}catch(_0x40eba8){throw new Error('Login\x20failed:\x20'+(_0x17f371['blggC'](_0x40eba8,Error)?_0x40eba8['message']:_0x40eba8));}}function _0x28c4(_0x55af19,_0x1f7b67){_0x55af19=_0x55af19-0x18d;const _0x48fcae=_0x48fc();let _0x28c4a8=_0x48fcae[_0x55af19];return _0x28c4a8;}function _0x48fc(){const _0x4717bb=['success','306260ymtKng','aXwIb','63rmWqQY','6856kXvPoj','219LktJtz','log','110570QzttUm','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','1722799kaxLno','\x0a✅\x20Logged\x20in\x20to\x20','1822kqZWgq','BRgIc','2604IMaUjZ','1884993mBGlTA','3sDegll','HsYzE','rpxUP','user','144DwbhRC','24sdwpGz','17205NiuCKX'];_0x48fc=function(){return _0x4717bb;};return _0x48fc();}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
const _0x4fe080=_0x5598;(function(_0x3d7251,_0x9d01dc){const _0xc0be5b=_0x5598,_0x5d42c9=_0x3d7251();while(!![]){try{const _0x11feb6=parseInt(_0xc0be5b(0x13f))/0x1*(-parseInt(_0xc0be5b(0xed))/0x2)+-parseInt(_0xc0be5b(0x144))/0x3*(-parseInt(_0xc0be5b(0x14b))/0x4)+-parseInt(_0xc0be5b(0xe5))/0x5+parseInt(_0xc0be5b(0x127))/0x6+-parseInt(_0xc0be5b(0x110))/0x7+-parseInt(_0xc0be5b(0xd6))/0x8+parseInt(_0xc0be5b(0xe0))/0x9*(parseInt(_0xc0be5b(0xf4))/0xa);if(_0x11feb6===_0x9d01dc)break;else _0x5d42c9['push'](_0x5d42c9['shift']());}catch(_0x390fab){_0x5d42c9['push'](_0x5d42c9['shift']());}}}(_0x5c15,0x831a1));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger',_0x4fe080(0x106)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x4fe080(0x148));export async function getMcpAuthOrigin(){const _0x3dad5a=_0x4fe080,_0x8f051c={'cwtcg':'utf-8','WSlTn':function(_0x30251a,_0x3f7903){return _0x30251a||_0x3f7903;}};try{const _0x59e8fa=(await readFile(AUTH_ORIGIN_PATH,_0x8f051c[_0x3dad5a(0xcd)]))[_0x3dad5a(0xf9)]();return _0x8f051c[_0x3dad5a(0x136)](_0x59e8fa,null);}catch{return null;}}export async function mcpBootstrap(){const _0x5d6f4f=_0x4fe080,_0x57e091={'RovUt':function(_0x97b936){return _0x97b936();},'CtTmP':function(_0x46f056,_0x1aa651){return _0x46f056(_0x1aa651);},'XssSr':function(_0x5c6c61,_0x21b24a){return _0x5c6c61===_0x21b24a;},'gRUPN':function(_0x30e8ab,_0x491abd){return _0x30e8ab(_0x491abd);}},_0x57587f=_0x57e091['RovUt'](getMcpAuthUrl);currentOrigin=_0x57587f;const _0x356d8c=process['stdout']['isTTY']??![];console['log']('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x57587f+'\x0a');const _0x3ca093=await _0x57e091[_0x5d6f4f(0x140)](tryUnauthenticated,_0x57587f);let _0x36da9f=null;if(_0x57e091['XssSr'](_0x3ca093,'proxied'))_0x36da9f='';else{_0x36da9f=await loadCachedToken();if(!_0x36da9f){if(!_0x356d8c)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x5d6f4f(0xc2));_0x36da9f=await _0x57e091[_0x5d6f4f(0xfc)](oauthFlow,_0x57587f);}}await callGetCliToken(_0x57587f,_0x36da9f);}async function tryUnauthenticated(_0xf8f1d9){const _0xfe7b76=_0x4fe080,_0x4690ba={'mAysf':function(_0x1cfaf9,_0x42177f,_0x565aa2){return _0x1cfaf9(_0x42177f,_0x565aa2);},'FmHef':'application/json,\x20text/event-stream','bFqPL':_0xfe7b76(0xc7),'mhURq':_0xfe7b76(0x10c),'RMTXP':_0xfe7b76(0x14d),'FgKAA':'1.0.0','NyqHu':'proxied','HYIlD':function(_0x16a2d7,_0x56018b){return _0x16a2d7===_0x56018b;}},_0x22faf0=await _0x4690ba[_0xfe7b76(0x11d)](fetch,_0xf8f1d9,{'method':_0xfe7b76(0xe7),'headers':{'Content-Type':_0xfe7b76(0x11a),'Accept':_0x4690ba['FmHef']},'body':JSON['stringify']({'jsonrpc':_0x4690ba[_0xfe7b76(0x112)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0x4690ba['mhURq'],'capabilities':{},'clientInfo':{'name':_0x4690ba['RMTXP'],'version':_0x4690ba['FgKAA']}}})});if(_0x22faf0['ok'])return await _0x22faf0[_0xfe7b76(0xda)](),_0x4690ba['NyqHu'];if(_0x4690ba['HYIlD'](_0x22faf0['status'],0x191))return await _0x22faf0['text'](),_0xfe7b76(0xf1);const _0x574441=await _0x22faf0[_0xfe7b76(0xda)]();throw new Error(_0xfe7b76(0x10f)+_0x22faf0['status']+':\x20'+_0x574441);}function _0x5598(_0x119ce8,_0x26e5e7){_0x119ce8=_0x119ce8-0xc2;const _0x5c1566=_0x5c15();let _0x559895=_0x5c1566[_0x119ce8];return _0x559895;}class OAuthTimeoutError extends Error{constructor(_0x4ad7a9){const _0x56b168=_0x4fe080,_0x27a439={'JLoRL':'OAuthTimeoutError'};super(_0x4ad7a9),this['name']=_0x27a439[_0x56b168(0xdd)];}}async function oauthFlow(_0x4ec4ea){const _0x2e65d2=_0x4fe080,_0x512af6={'jLIrV':function(_0x2416ac,_0x3f8011){return _0x2416ac(_0x3f8011);},'gntAj':_0x2e65d2(0x133)};try{return await _0x512af6['jLIrV'](oauthFlowAttempt,_0x4ec4ea);}catch(_0x25a9df){if(_0x25a9df instanceof OAuthTimeoutError&&await loadCachedClient())return console['log'](_0x512af6[_0x2e65d2(0x149)]),await clearCachedClient(),await oauthFlowAttempt(_0x4ec4ea);throw _0x25a9df;}}async function oauthFlowAttempt(_0x1191ac){const _0x4d2428=_0x4fe080,_0x44e8d8={'btZAt':'Discovering\x20authorization\x20server...','trJwi':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','HCDKn':_0x4d2428(0x12b),'oVKvR':_0x4d2428(0xe7),'MILVe':_0x4d2428(0xc4),'Grxku':_0x4d2428(0xec),'QPXwS':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','AXtrq':function(_0x4bb9a7,_0x4e66bd){return _0x4bb9a7(_0x4e66bd);},'JsTJB':'sha256','GqQaa':function(_0x30056a,_0xcaaffd){return _0x30056a(_0xcaaffd);},'MntnH':'hex','OrxSo':_0x4d2428(0xeb),'znGrg':_0x4d2428(0x13a),'WBswi':_0x4d2428(0x122),'LeEaK':'code_challenge_method','kFevX':_0x4d2428(0x111),'DRInj':'resource','cDnIQ':_0x4d2428(0xff),'xigqE':_0x4d2428(0x132),'sslYF':function(_0x5d1483,_0x507c4c,_0x65fea1){return _0x5d1483(_0x507c4c,_0x65fea1);},'OLJrb':_0x4d2428(0xc5)},_0x28522d=_0x1191ac['replace'](/\/mcp$/,'');process['stdout'][_0x4d2428(0xdc)](_0x44e8d8[_0x4d2428(0x138)]);const _0x342f0e=await fetch(_0x28522d+_0x4d2428(0xc6));if(!_0x342f0e['ok'])throw new Error(_0x44e8d8[_0x4d2428(0xc3)]);const _0x39b199=await _0x342f0e['json'](),_0x29ebb6=_0x39b199['authorization_servers']?.[0x0];if(!_0x29ebb6)throw new Error('No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata');console[_0x4d2428(0x14f)]('\x20'+_0x29ebb6);const _0x30d34f=await fetchAuthServerMetadata(_0x29ebb6);let _0x5ee89a,_0x5d7d79;const _0x1c5679=await loadCachedClient();if(_0x1c5679)_0x5ee89a=_0x1c5679[_0x4d2428(0x141)],_0x5d7d79=_0x1c5679[_0x4d2428(0x121)];else{if(_0x30d34f['registration_endpoint']){process['stdout']['write'](_0x44e8d8['HCDKn']);const _0x3d3560=await fetch(_0x30d34f['registration_endpoint'],{'method':_0x44e8d8['oVKvR'],'headers':{'Content-Type':'application/json'},'body':JSON[_0x4d2428(0x12e)]({'client_name':_0x44e8d8['MILVe'],'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x4d2428(0x12a)],'grant_types':[_0x44e8d8[_0x4d2428(0x13c)],'refresh_token'],'response_types':['code'],'token_endpoint_auth_method':_0x4d2428(0x113)})});if(!_0x3d3560['ok']){const _0x354190=await _0x3d3560['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x354190);}const _0x190cb0=await _0x3d3560['json']();_0x5ee89a=_0x190cb0[_0x4d2428(0x13a)],_0x5d7d79=_0x190cb0['client_secret'],await saveCachedClient(_0x5ee89a,_0x5d7d79),console['log']('\x20done');}else throw new Error(_0x44e8d8[_0x4d2428(0xca)]);}const _0x46b20c=randomBytes(0x20)[_0x4d2428(0xfa)]('base64url'),_0x166483=_0x44e8d8[_0x4d2428(0xdb)](createHash,_0x44e8d8['JsTJB'])['update'](_0x46b20c)[_0x4d2428(0xf0)]('base64url'),_0x5ce671=_0x44e8d8['GqQaa'](randomBytes,0x10)['toString'](_0x44e8d8[_0x4d2428(0x14a)]),_0x1f6ada=new URL(_0x30d34f['authorization_endpoint']);_0x1f6ada['searchParams']['set'](_0x44e8d8['OrxSo'],'code'),_0x1f6ada[_0x4d2428(0xf8)]['set'](_0x44e8d8['znGrg'],_0x5ee89a),_0x1f6ada['searchParams'][_0x4d2428(0x11f)]('redirect_uri','http://localhost:'+CALLBACK_PORT+_0x4d2428(0x12a)),_0x1f6ada['searchParams'][_0x4d2428(0x11f)](_0x44e8d8[_0x4d2428(0x104)],_0x166483),_0x1f6ada[_0x4d2428(0xf8)]['set'](_0x44e8d8['LeEaK'],_0x4d2428(0xde)),_0x1f6ada[_0x4d2428(0xf8)][_0x4d2428(0x11f)](_0x44e8d8[_0x4d2428(0x137)],_0x5ce671);_0x39b199[_0x4d2428(0x142)]&&_0x1f6ada['searchParams'][_0x4d2428(0x11f)](_0x44e8d8['DRInj'],_0x39b199[_0x4d2428(0x142)]);console[_0x4d2428(0x14f)](_0x44e8d8['cDnIQ']),console[_0x4d2428(0x14f)](_0x4d2428(0x13d)+_0x1f6ada['toString']()+'\x0a'),await openBrowser(_0x1f6ada['toString']());const _0x1aeadf=await waitForCallback(_0x5ce671);process['stdout'][_0x4d2428(0xdc)](_0x44e8d8['xigqE']);const _0x534309=new URLSearchParams({'grant_type':_0x44e8d8[_0x4d2428(0x13c)],'code':_0x1aeadf,'redirect_uri':_0x4d2428(0x124)+CALLBACK_PORT+'/callback','client_id':_0x5ee89a,'code_verifier':_0x46b20c});_0x5d7d79&&_0x534309['set'](_0x4d2428(0x100),_0x5d7d79);_0x39b199[_0x4d2428(0x142)]&&_0x534309[_0x4d2428(0x11f)](_0x4d2428(0x142),_0x39b199['resource']);const _0x128900=await _0x44e8d8[_0x4d2428(0xd2)](fetch,_0x30d34f['token_endpoint'],{'method':_0x4d2428(0xe7),'headers':{'Content-Type':_0x4d2428(0xdf)},'body':_0x534309});if(!_0x128900['ok']){const _0x1debbd=await _0x128900[_0x4d2428(0xda)]();throw new Error(_0x4d2428(0xfd)+_0x1debbd);}const _0x300751=await _0x128900[_0x4d2428(0x102)]();return console[_0x4d2428(0x14f)](_0x44e8d8['OLJrb']),await saveCachedToken(_0x300751[_0x4d2428(0x12d)],_0x300751[_0x4d2428(0x14e)],_0x300751['expires_in']),_0x300751[_0x4d2428(0x12d)];}async function callGetCliToken(_0x750e7f,_0x267d60){const _0x3c57aa=_0x4fe080,_0x59fa05={'jCgNP':function(_0x5b9708,_0x569c68,_0x157556){return _0x5b9708(_0x569c68,_0x157556);},'oxXtR':_0x3c57aa(0xe7),'WgKzj':'application/json','DnfDK':function(_0x2a6975,_0x5e20b7){return _0x2a6975(_0x5e20b7);},'WTbzE':'2025-03-26','fqTQT':'1.0.0','thDIs':_0x3c57aa(0xc5),'oMGyU':_0x3c57aa(0xc7),'vrRBk':_0x3c57aa(0x129),'DQEkc':'tools/call','IdfWn':'get_cli_token','yOZoi':_0x3c57aa(0x12c),'odSRK':function(_0x273d9f){return _0x273d9f();},'kKNNL':_0x3c57aa(0x12f),'wuczA':function(_0x2e3b42,_0xa387f3,_0x182a84,_0x3dfd3a){return _0x2e3b42(_0xa387f3,_0x182a84,_0x3dfd3a);},'okJMk':_0x3c57aa(0xfb)},_0x1c0b6f={'Content-Type':_0x59fa05[_0x3c57aa(0x130)],'Accept':'application/json,\x20text/event-stream'};_0x267d60&&(_0x1c0b6f['Authorization']='Bearer\x20'+_0x267d60);const _0x3e68c3=async _0x1eb8a3=>{const _0x28d5ef=_0x3c57aa,_0x32d098=await _0x59fa05[_0x28d5ef(0xd0)](fetch,_0x750e7f,{'method':_0x59fa05[_0x28d5ef(0xf5)],'headers':_0x1c0b6f,'body':JSON[_0x28d5ef(0x12e)](_0x1eb8a3)});if(!_0x32d098['ok']){const _0x30ec33=await _0x32d098['text']();throw new Error('HTTP\x20'+_0x32d098['status']+':\x20'+_0x30ec33);}return parseResponse(_0x32d098);};process['stdout']['write'](_0x3c57aa(0xf2));const _0x11b597=await _0x59fa05[_0x3c57aa(0x108)](_0x3e68c3,{'jsonrpc':_0x3c57aa(0xc7),'id':0x1,'method':_0x3c57aa(0xe8),'params':{'protocolVersion':_0x59fa05['WTbzE'],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x59fa05['fqTQT']}}});if(_0x11b597['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x11b597['error'][_0x3c57aa(0x143)]??JSON[_0x3c57aa(0x12e)](_0x11b597[_0x3c57aa(0xd3)])));console[_0x3c57aa(0x14f)](_0x59fa05[_0x3c57aa(0xea)]),await fetch(_0x750e7f,{'method':_0x59fa05['oxXtR'],'headers':_0x1c0b6f,'body':JSON[_0x3c57aa(0x12e)]({'jsonrpc':_0x59fa05[_0x3c57aa(0xe4)],'method':_0x3c57aa(0x13e)})})['then'](_0x448c49=>_0x448c49[_0x3c57aa(0xda)]()),process[_0x3c57aa(0xd1)][_0x3c57aa(0xdc)](_0x59fa05[_0x3c57aa(0xcb)]);const _0x227b1a=await _0x59fa05['DnfDK'](_0x3e68c3,{'jsonrpc':_0x59fa05[_0x3c57aa(0xe4)],'id':0x2,'method':_0x59fa05['DQEkc'],'params':{'name':_0x59fa05[_0x3c57aa(0x120)],'arguments':{}}});if(_0x227b1a[_0x3c57aa(0xd3)])throw new Error(_0x3c57aa(0x126)+(_0x227b1a[_0x3c57aa(0xd3)]['message']??JSON['stringify'](_0x227b1a['error'])));console[_0x3c57aa(0x14f)](_0x59fa05['thDIs']);const _0x281195=extractToken(_0x227b1a['result']);if(!_0x281195){console[_0x3c57aa(0xd3)](_0x59fa05[_0x3c57aa(0x135)]),console['error'](JSON['stringify'](_0x227b1a['result'],null,0x2));throw new Error('Could\x20not\x20extract\x20token\x20from\x20MCP\x20response');}const _0x56c17e=join(_0x59fa05['odSRK'](homedir),_0x59fa05['kKNNL']),_0x3573e9=_0x59fa05[_0x3c57aa(0xd0)](join,_0x56c17e,_0x3c57aa(0xce));await _0x59fa05['jCgNP'](mkdir,_0x56c17e,{'recursive':!![]}),await _0x59fa05['wuczA'](writeFile,_0x3573e9,_0x281195,{'mode':0x180}),await writeFile(join(_0x56c17e,'auth-origin.txt'),_0x750e7f,{'mode':0x180}),console[_0x3c57aa(0x14f)]('\x0aToken\x20written\x20to\x20'+_0x3573e9),console[_0x3c57aa(0x14f)](_0x59fa05[_0x3c57aa(0xf7)]);}async function fetchAuthServerMetadata(_0x3ef6ac){const _0x349f21=_0x4fe080,_0x44467c=_0x3ef6ac+'/.well-known/oauth-authorization-server',_0xc14f23=await fetch(_0x44467c);if(!_0xc14f23['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x44467c+':\x20'+_0xc14f23[_0x349f21(0xf6)]);return _0xc14f23[_0x349f21(0x102)]();}function waitForCallback(_0x174615){const _0x46ce69=_0x4fe080,_0x47098e={'UJlFe':function(_0x5c1a46,_0x2ee73b){return _0x5c1a46(_0x2ee73b);},'bjwpD':_0x46ce69(0xc8),'cFljV':function(_0xefd52e){return _0xefd52e();}};return new Promise((_0x5e1036,_0x3b1a22)=>{const _0x46f0d1=_0x46ce69,_0x3326f7={'bHHmf':function(_0x24634a,_0x4ad361){return _0x24634a!==_0x4ad361;},'mgfgh':_0x46f0d1(0x103),'lAVKb':_0x47098e['bjwpD'],'wIPHt':_0x46f0d1(0x131),'RPmnq':_0x46f0d1(0x14c),'wtHsx':function(_0x8cafc7,_0x20f970){return _0x47098e['UJlFe'](_0x8cafc7,_0x20f970);},'gQRWD':function(_0x5db9c5){return _0x47098e['cFljV'](_0x5db9c5);},'Ryxkg':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>'},_0x39ed40=()=>{const _0x113d5a=_0x46f0d1;_0x3c0ea5['closeAllConnections'](),_0x3c0ea5[_0x113d5a(0x101)]();},_0x1a3262=setTimeout(()=>{const _0x576eb9=_0x46f0d1;_0x39ed40(),_0x47098e[_0x576eb9(0x11e)](_0x3b1a22,new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x3c0ea5=createServer((_0x2fabe3,_0xb64723)=>{const _0x365bda=_0x46f0d1,_0x279342=new URL(_0x2fabe3['url']??'/',_0x365bda(0x124)+CALLBACK_PORT);if(_0x3326f7['bHHmf'](_0x279342['pathname'],'/callback')){_0xb64723[_0x365bda(0x10d)](0x194),_0xb64723[_0x365bda(0x107)](_0x3326f7[_0x365bda(0xd9)]);return;}const _0x4c8c00=_0x279342[_0x365bda(0xf8)][_0x365bda(0xe1)](_0x3326f7[_0x365bda(0x10b)]),_0x5000ae=_0x279342['searchParams']['get'](_0x365bda(0x111)),_0x131cee=_0x279342[_0x365bda(0xf8)][_0x365bda(0xe1)](_0x365bda(0xd3));if(_0x131cee){const _0x540784=_0x279342['searchParams']['get'](_0x3326f7[_0x365bda(0x128)])??_0x131cee;_0xb64723['writeHead'](0xc8,{'Content-Type':_0x3326f7[_0x365bda(0x147)]}),_0xb64723[_0x365bda(0x107)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x540784+_0x365bda(0x114)),_0x3326f7['wtHsx'](clearTimeout,_0x1a3262),_0x3326f7[_0x365bda(0xcc)](_0x39ed40),_0x3b1a22(new Error('OAuth\x20error:\x20'+_0x540784));return;}if(!_0x4c8c00||_0x3326f7[_0x365bda(0x105)](_0x5000ae,_0x174615)){_0xb64723[_0x365bda(0x10d)](0x190,{'Content-Type':_0x365bda(0x14c)}),_0xb64723['end'](_0x3326f7['Ryxkg']);return;}_0xb64723[_0x365bda(0x10d)](0xc8,{'Content-Type':_0x3326f7[_0x365bda(0x147)]}),_0xb64723[_0x365bda(0x107)]('<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'),clearTimeout(_0x1a3262),_0x39ed40(),_0x3326f7['wtHsx'](_0x5e1036,_0x4c8c00);});_0x3c0ea5[_0x46f0d1(0x146)](CALLBACK_PORT,'127.0.0.1');});}async function openBrowser(_0x43f865){const _0x460c12=_0x4fe080,_0x2b403e={'dXVky':function(_0x2b5a21,_0x3c662f){return _0x2b5a21===_0x3c662f;},'gxDFT':_0x460c12(0x109),'KUqsF':'win32','vUzye':_0x460c12(0xf3)},_0x158f26=_0x2b403e['dXVky'](process[_0x460c12(0xc9)],_0x2b403e[_0x460c12(0xd7)])?_0x460c12(0x139):process[_0x460c12(0xc9)]===_0x2b403e[_0x460c12(0x11b)]?'start':_0x2b403e[_0x460c12(0xee)];exec(_0x158f26+'\x20\x22'+_0x43f865+'\x22');}function _0x5c15(){const _0x4d7c83=['thDIs','response_type','authorization_code','18nTtpuz','vUzye','origin','digest','needs-oauth','Initializing\x20MCP\x20session...','xdg-open','22579610hevkEL','oxXtR','status','okJMk','searchParams','trim','toString','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','gRUPN','Token\x20exchange\x20failed:\x20','LvIBt','\x0aOpening\x20browser\x20for\x20authentication...','client_secret','close','json','Not\x20found','WBswi','bHHmf','mcp-oauth-tokens.json','end','DnfDK','darwin','gfLug','lAVKb','2025-03-26','writeHead','refreshToken','MCP\x20server\x20returned\x20HTTP\x20','7178668KgUlPF','state','bFqPL','none','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','parse','startsWith','No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream','headers','oqSWo','application/json','KUqsF','iHcJn','mAysf','UJlFe','set','IdfWn','clientSecret','code_challenge','accessToken','http://localhost:','data:','get_cli_token\x20failed:\x20','520068pdHlDb','wIPHt','Requesting\x20CLI\x20token...','/callback','Registering\x20OAuth\x20client...','\x0aUnexpected\x20response\x20structure:','access_token','stringify','.ranger','WgKzj','error_description','Exchanging\x20authorization\x20code...','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','string','yOZoi','WSlTn','kFevX','btZAt','open','client_id','zptuA','Grxku','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','notifications/initialized','83221uskVpm','CtTmP','clientId','resource','message','525SDUxpV','zNskR','listen','RPmnq','auth-origin.txt','gntAj','MntnH','10876cVIqPT','text/html','ranger-cli','refresh_token','log','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','trJwi','Ranger\x20CLI','\x20done','/.well-known/oauth-protected-resource','2.0','code','platform','QPXwS','vrRBk','gQRWD','cwtcg','refresh.txt','content','jCgNP','stdout','sslYF','error','token','text/event-stream','3443712KegLnR','gxDFT','now','mgfgh','text','AXtrq','write','JLoRL','S256','application/x-www-form-urlencoded','9uLXqTA','get','utf-8','iauBG','oMGyU','392470EVTtDH','content-type','POST','initialize','slice'];_0x5c15=function(){return _0x4d7c83;};return _0x5c15();}let currentOrigin='';async function loadCachedToken(){const _0x20c477=_0x4fe080,_0x171c1c={'gfLug':function(_0x56fda3,_0x46ab4f,_0x4c4fe0){return _0x56fda3(_0x46ab4f,_0x4c4fe0);},'KJMye':_0x20c477(0xe2)};try{const _0xbf4355=JSON[_0x20c477(0x115)](await _0x171c1c[_0x20c477(0x10a)](readFile,TOKEN_CACHE_PATH,_0x171c1c['KJMye']));if(_0xbf4355['origin']&&_0xbf4355['origin']!==currentOrigin)return null;if(_0xbf4355['expiresAt']&&Date[_0x20c477(0xd8)]()>_0xbf4355['expiresAt'])return null;return _0xbf4355[_0x20c477(0x123)]??null;}catch{return null;}}async function saveCachedToken(_0x4fd9f0,_0x366dad,_0x43cafc){const _0x4c55b3=_0x4fe080,_0x3c3767={'zNskR':function(_0x3526c0,_0x4952c6){return _0x3526c0+_0x4952c6;},'MrovC':function(_0x2f5f76){return _0x2f5f76();},'TQKSU':_0x4c55b3(0x12f)},_0x465964=await loadCachedData(),_0x9dcb34={..._0x465964,'origin':currentOrigin,'accessToken':_0x4fd9f0,'refreshToken':_0x366dad??_0x465964?.[_0x4c55b3(0x10e)],'expiresAt':_0x43cafc?_0x3c3767[_0x4c55b3(0x145)](Date[_0x4c55b3(0xd8)](),_0x43cafc*0x3e8):undefined};await mkdir(join(_0x3c3767['MrovC'](homedir),_0x3c3767['TQKSU']),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x9dcb34),{'mode':0x180});}async function loadCachedClient(){const _0x3133d5=_0x4fe080,_0x1b0eaf=await loadCachedData();if(_0x1b0eaf?.['origin']&&_0x1b0eaf[_0x3133d5(0xef)]!==currentOrigin)return null;return _0x1b0eaf?.['clientId']?{'clientId':_0x1b0eaf[_0x3133d5(0x141)],'clientSecret':_0x1b0eaf[_0x3133d5(0x121)]}:null;}async function clearCachedClient(){const _0x5b5e95=_0x4fe080,_0x3ded10={'iHcJn':function(_0x37498c){return _0x37498c();},'LvIBt':function(_0x503d6e,_0x4fa3b8,_0x340219,_0x47b752){return _0x503d6e(_0x4fa3b8,_0x340219,_0x47b752);}},_0x3f0d4f=await _0x3ded10[_0x5b5e95(0x11c)](loadCachedData);if(!_0x3f0d4f)return;const {clientId:_0x84b607,clientSecret:_0x3ea6bd,..._0x450dab}=_0x3f0d4f;await _0x3ded10[_0x5b5e95(0xfe)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x450dab),{'mode':0x180});}async function saveCachedClient(_0x119b91,_0x547299){const _0x1a9f3d=_0x4fe080,_0xc7c1d={'zptuA':function(_0x57af86,_0x5d512c,_0x2e73ac){return _0x57af86(_0x5d512c,_0x2e73ac);},'oqSWo':'.ranger'},_0x5104b3=await loadCachedData(),_0x48b2e7={..._0x5104b3,'origin':currentOrigin,'accessToken':_0x5104b3?.['accessToken']??'','clientId':_0x119b91,'clientSecret':_0x547299};await _0xc7c1d[_0x1a9f3d(0x13b)](mkdir,_0xc7c1d['zptuA'](join,homedir(),_0xc7c1d[_0x1a9f3d(0x119)]),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x48b2e7),{'mode':0x180});}async function loadCachedData(){const _0x238809=_0x4fe080;try{return JSON[_0x238809(0x115)](await readFile(TOKEN_CACHE_PATH,_0x238809(0xe2)));}catch{return null;}}async function parseResponse(_0xb9e6e9){const _0x26754f=_0x4fe080,_0x56595d={'wUnTi':_0x26754f(0xd5),'qHfkj':_0x26754f(0x125),'iauBG':_0x26754f(0x117)},_0x505d22=_0xb9e6e9[_0x26754f(0x118)][_0x26754f(0xe1)](_0x26754f(0xe6))??'';if(_0x505d22['includes'](_0x56595d['wUnTi'])){const _0x230b64=await _0xb9e6e9['text']();for(const _0x41e071 of _0x230b64['split']('\x0a')){const _0x2c34d0=_0x41e071[_0x26754f(0xf9)]();if(_0x2c34d0[_0x26754f(0x116)]('data:')){const _0x4491ae=_0x2c34d0[_0x26754f(0xe9)](_0x56595d['qHfkj']['length'])['trim']();if(!_0x4491ae)continue;try{const _0x3abfce=JSON['parse'](_0x4491ae);if(_0x3abfce['id']!==undefined||_0x3abfce[_0x26754f(0xd3)])return _0x3abfce;}catch{}}}throw new Error(_0x56595d[_0x26754f(0xe3)]);}return _0xb9e6e9['json']();}function extractToken(_0xa7175b){const _0x58bf7a=_0x4fe080,_0x366d10={'isugs':_0x58bf7a(0x134)};if(!_0xa7175b)return null;const _0x3cf8e3=_0xa7175b['structuredContent'];if(_0x3cf8e3?.[_0x58bf7a(0xd4)]&&typeof _0x3cf8e3['token']==='string')return _0x3cf8e3['token'];if(_0xa7175b['isError']){const _0x15d703=_0xa7175b['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x15d703?.[0x0]?.[_0x58bf7a(0xda)]??'Unknown\x20error'));}const _0x1f420d=_0xa7175b[_0x58bf7a(0xcf)];if(_0x1f420d)for(const _0x4523e8 of _0x1f420d){if(_0x4523e8['type']==='text'&&_0x4523e8[_0x58bf7a(0xda)]){try{const _0x1ecf2b=JSON['parse'](_0x4523e8['text']);if(typeof _0x1ecf2b?.['token']===_0x366d10['isugs'])return _0x1ecf2b[_0x58bf7a(0xd4)];}catch{}const _0x4a4e0f=_0x4523e8['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x4a4e0f)return _0x4a4e0f[0x1];}}return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5a71b8,_0x502e3b){var _0x2febe7=_0x7120,_0x418972=_0x5a71b8();while(!![]){try{var _0x19946b=parseInt(_0x2febe7(0x145))/0x1*(-parseInt(_0x2febe7(0x146))/0x2)+-parseInt(_0x2febe7(0x147))/0x3*(parseInt(_0x2febe7(0x13c))/0x4)+-parseInt(_0x2febe7(0x142))/0x5+parseInt(_0x2febe7(0x141))/0x6+parseInt(_0x2febe7(0x143))/0x7+-parseInt(_0x2febe7(0x13d))/0x8+-parseInt(_0x2febe7(0x149))/0x9*(-parseInt(_0x2febe7(0x13f))/0xa);if(_0x19946b===_0x502e3b)break;else _0x418972['push'](_0x418972['shift']());}catch(_0x46b279){_0x418972['push'](_0x418972['shift']());}}}(_0x58a2,0x2d33d));function _0x7120(_0x415180,_0x368b54){_0x415180=_0x415180-0x13c;var _0x58a258=_0x58a2();var _0x7120fe=_0x58a258[_0x415180];return _0x7120fe;}export async function migrateProfile(_0x20dece,_0x15c3f8){var _0x34d594=_0x7120,_0x2113cb={'iRcJC':function(_0x191c82,_0x42f1ad){return _0x191c82+_0x42f1ad;},'EFHvb':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','MwAoC':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','gXupr':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','acRHS':'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'};console[_0x34d594(0x14a)](_0x2113cb[_0x34d594(0x13e)](_0x2113cb[_0x34d594(0x13e)](_0x2113cb[_0x34d594(0x140)]+'\x0a'+_0x34d594(0x144)+_0x2113cb['MwAoC']+'\x0a',_0x34d594(0x148))+'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a'+'\x0a',_0x2113cb['gXupr'])+_0x2113cb['acRHS']),process['exit'](0x1);}function _0x58a2(){var _0x4d6e54=['To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','20yHLWzs','9862jAopkZ','12gquAxc','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','3597786IUcqdM','error','95156MviuOW','551200HJJaTN','iRcJC','10fccTWo','EFHvb','1558062CFAhjD','1463520wbAtYx','567686ufGzjM'];_0x58a2=function(){return _0x4d6e54;};return _0x58a2();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x19dd09,_0x2de59c){const _0x5c0c14=_0x2735,_0x439766=_0x19dd09();while(!![]){try{const _0x3ab31e=-parseInt(_0x5c0c14(0xcf))/0x1+parseInt(_0x5c0c14(0xa5))/0x2*(-parseInt(_0x5c0c14(0xd0))/0x3)+-parseInt(_0x5c0c14(0xd6))/0x4+-parseInt(_0x5c0c14(0xd1))/0x5+-parseInt(_0x5c0c14(0xc7))/0x6*(parseInt(_0x5c0c14(0xa7))/0x7)+-parseInt(_0x5c0c14(0xd3))/0x8*(parseInt(_0x5c0c14(0xc1))/0x9)+parseInt(_0x5c0c14(0xaf))/0xa;if(_0x3ab31e===_0x2de59c)break;else _0x439766['push'](_0x439766['shift']());}catch(_0x5a47de){_0x439766['push'](_0x439766['shift']());}}}(_0x3018,0x26f10));import{join}from'path';function _0x2735(_0x6c1d5b,_0x5651a2){_0x6c1d5b=_0x6c1d5b-0xa2;const _0x30188e=_0x3018();let _0x273525=_0x30188e[_0x6c1d5b];return _0x273525;}import{existsSync}from'fs';import _0x171137 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x310cc8){const _0x203d51=_0x2735,_0x2bcf10={'MtYcO':function(_0x2f7169,_0x632654){return _0x2f7169(_0x632654);},'YBBkR':'✓\x20Claude\x20Code\x20plugin\x20already\x20installed','viGPW':_0x203d51(0xca),'vZack':_0x203d51(0xc5),'JTbOH':_0x203d51(0xb0),'kkChY':_0x203d51(0xb8),'fOJGB':'User\x20(available\x20in\x20all\x20your\x20projects)','wYHGC':'Project\x20(shared\x20with\x20team\x20via\x20git)','XTizp':_0x203d51(0xcc),'sXdRj':'user','bKvMU':_0x203d51(0xc0),'gkvTz':'plugin','uvgtN':'marketplace','HrEqW':_0x203d51(0xb7),'TBUEU':'ranger-testing/trailhead','IPRgB':'❌\x20Failed\x20to\x20add\x20marketplace:','zYbSk':'\x0aYou\x20can\x20install\x20manually\x20with:','uPcYq':'ranger@trailhead','IYeSs':'--scope','zPoGW':function(_0x126336){return _0x126336();},'hlOoK':'✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','KkJMH':'enable','FVMJv':function(_0x3a5ed1,_0x297e71,_0x1742d5){return _0x3a5ed1(_0x297e71,_0x1742d5);},'bJUEW':function(_0x5d4c8a,_0x5da581){return _0x5d4c8a===_0x5da581;},'HpgNH':_0x203d51(0xbb)},_0x324a20=await _0x2bcf10[_0x203d51(0xbf)](isPluginInstalled,_0x203d51(0xae));if(_0x324a20)return console[_0x203d51(0xcb)](_0x2bcf10[_0x203d51(0xc2)]),![];const _0x179024=_0x2bcf10['MtYcO'](existsSync,join(getProjectRoot(),_0x2bcf10['viGPW']));let _0x2892e2;if(_0x310cc8)_0x2892e2=_0x310cc8;else{if(_0x179024)_0x2892e2='project';else{console['log'](_0x2bcf10['vZack']);const _0x22719e=await _0x171137[_0x203d51(0xa4)]([{'type':'list','name':_0x2bcf10['JTbOH'],'message':_0x2bcf10[_0x203d51(0xaa)],'choices':[{'name':_0x2bcf10['fOJGB'],'value':'user'},{'name':_0x2bcf10['wYHGC'],'value':_0x2bcf10['XTizp']}],'default':_0x2bcf10[_0x203d51(0xbd)]}]);_0x2892e2=_0x22719e['pluginScope'];}}console[_0x203d51(0xcb)](_0x203d51(0xba)+_0x2892e2+'\x20level)...\x0a');const _0x10d8b7=await _0x2bcf10['MtYcO'](isMarketplaceAdded,_0x2bcf10[_0x203d51(0xa2)]);let _0x4d5a83=_0x10d8b7;if(_0x10d8b7)console['log']('✓\x20Marketplace\x20already\x20added');else{const _0x524f0b=await runClaudeCommand([_0x2bcf10['gkvTz'],_0x2bcf10[_0x203d51(0xbe)],_0x2bcf10['HrEqW'],_0x2bcf10[_0x203d51(0xc3)]]);!_0x524f0b['success']?(console['error'](_0x2bcf10['IPRgB'],_0x524f0b[_0x203d51(0xa6)]),console[_0x203d51(0xcb)](_0x2bcf10[_0x203d51(0xb9)]),console[_0x203d51(0xcb)](_0x203d51(0xac)),console[_0x203d51(0xcb)](_0x203d51(0xbc)+_0x2892e2)):_0x4d5a83=!![];}if(_0x4d5a83){const _0xef6eb3=await runClaudeCommand([_0x2bcf10['gkvTz'],_0x203d51(0xc9),_0x2bcf10[_0x203d51(0xb4)],_0x2bcf10[_0x203d51(0xd5)],_0x2892e2],{'cwd':_0x2892e2===_0x203d51(0xcc)?_0x2bcf10[_0x203d51(0xa3)](getProjectRoot):undefined});if(!_0xef6eb3['success'])console[_0x203d51(0xa6)](_0x203d51(0xce),_0xef6eb3['error']),console['log'](_0x203d51(0xc6)),console['log'](_0x203d51(0xbc)+_0x2892e2);else{console[_0x203d51(0xcb)](_0x2bcf10['hlOoK']);const _0x4a6a77=[_0x203d51(0xb5),_0x2bcf10['KkJMH'],_0x2bcf10[_0x203d51(0xb4)]];_0x2892e2===_0x2bcf10[_0x203d51(0xc4)]&&_0x4a6a77[_0x203d51(0xc8)](_0x2bcf10[_0x203d51(0xd5)],'project');const _0x5cbd67=await _0x2bcf10['FVMJv'](runClaudeCommand,_0x4a6a77,{'captureOutput':!![],'cwd':_0x2bcf10['bJUEW'](_0x2892e2,_0x2bcf10['XTizp'])?getProjectRoot():undefined}),_0x4e4755=_0x5cbd67[_0x203d51(0xb6)]?.[_0x203d51(0xb3)]('already\x20enabled');!_0x5cbd67[_0x203d51(0xb1)]&&!_0x4e4755?console[_0x203d51(0xa6)](_0x203d51(0xcd),_0x5cbd67['error']):console[_0x203d51(0xcb)](_0x2bcf10['HpgNH']);}}return!![];}function _0x3018(){const _0x413aba=['confirm','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','ajEkH','ranger@trailhead','12023390jUQtBK','pluginScope','success','SKILL.md','includes','uPcYq','plugin','output','add','Where\x20should\x20the\x20plugin\x20be\x20installed?','zYbSk','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','✓\x20Claude\x20Code\x20plugin\x20enabled','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','sXdRj','uvgtN','MtYcO','trailhead','9sNCaje','YBBkR','TBUEU','XTizp','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','\x0aYou\x20can\x20install\x20manually\x20with:','6sJtetI','push','install','.claude','log','project','⚠\x20Failed\x20to\x20enable\x20plugin:','❌\x20Failed\x20to\x20install\x20plugin:','91176Hxngir','3ijyMpn','418140VuKTAw','wantsSkillup','754104DYRVRz','GoUTA','IYeSs','1269188ejAHyl','bKvMU','zPoGW','prompt','520794UtRYsd','error','1372518GuBlec','ranger','vsMXl','kkChY'];_0x3018=function(){return _0x413aba;};return _0x3018();}export async function ensureClaudeSkills(_0x5e0334){const _0x22e784=_0x2735,_0x3023ad={'ajEkH':function(_0x1c4e0f,_0x1da4a9){return _0x1c4e0f(_0x1da4a9);},'ZUbsW':'ranger','asoMt':function(_0x28d71e,_0x5cb07c,_0x554ca0,_0x52b668){return _0x28d71e(_0x5cb07c,_0x554ca0,_0x52b668);},'vsMXl':'SKILL.md','zVQBm':'✓\x20Ranger\x20skills\x20already\x20installed','ppkrj':function(_0x2b5a46,_0x18d54a,_0x171485){return _0x2b5a46(_0x18d54a,_0x171485);},'FAojJ':function(_0x2431e3){return _0x2431e3();},'GoUTA':'project','aYqKC':_0x22e784(0xd2)},_0x530593=_0x3023ad[_0x22e784(0xad)](existsSync,join(getSkillsDir('user'),_0x3023ad['ZUbsW'],_0x22e784(0xb2))),_0x9a174f=existsSync(_0x3023ad['asoMt'](join,getSkillsDir(_0x22e784(0xcc)),_0x22e784(0xa8),_0x3023ad[_0x22e784(0xa9)]));if(_0x530593||_0x9a174f)return console[_0x22e784(0xcb)](_0x3023ad['zVQBm']),![];const _0x275d86=existsSync(_0x3023ad['ppkrj'](join,_0x3023ad['FAojJ'](getProjectRoot),'.claude'));let _0x1a8b9d=!![];if(_0x5e0334)await skillup({'autoInstall':_0x5e0334,'suppressUsage':!![]});else{if(_0x275d86)await skillup({'autoInstall':_0x3023ad[_0x22e784(0xd4)],'suppressUsage':!![]});else{const _0x1884cb=await _0x171137[_0x22e784(0xa4)]([{'type':_0x22e784(0xab),'name':_0x3023ad['aYqKC'],'message':'Would\x20you\x20like\x20to\x20install\x20skills?','default':!![]}]);_0x1a8b9d=_0x1884cb[_0x22e784(0xd2)],_0x1a8b9d&&await skillup({'suppressUsage':!![]});}}return _0x1a8b9d;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function _0x3423(_0x16611a,_0x4f93a3){_0x16611a=_0x16611a-0x1a4;const _0x19ba98=_0x19ba();let _0x3423b6=_0x19ba98[_0x16611a];return _0x3423b6;}function _0x19ba(){const _0x527fe3=['6wPbiFw','104302oRluLC','Project\x20(shared\x20with\x20team\x20via\x20git)','389618hcnzQi','40ygYhDe','pluginScope','9FBgoWZ','270262yWlKjD','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','project','1050126BoSmah','https://opencode.ai/config.json','plugin','154450fUpqpp','opencode.json','Failed\x20to\x20read\x20opencode.json','MsPvu','3262408yxVssP','290JictkE','isArray','KRwPt','list','\x0a📦\x20OpenCode\x20Plugin\x0a','User\x20(available\x20in\x20all\x20your\x20projects)','$schema','2119146AsHJBr','user'];_0x19ba=function(){return _0x527fe3;};return _0x19ba();}(function(_0x1f5c33,_0x13d8fb){const _0x1d7f83=_0x3423,_0x401eed=_0x1f5c33();while(!![]){try{const _0x5649b3=parseInt(_0x1d7f83(0x1a5))/0x1+parseInt(_0x1d7f83(0x1bc))/0x2*(-parseInt(_0x1d7f83(0x1b9))/0x3)+-parseInt(_0x1d7f83(0x1bd))/0x4*(-parseInt(_0x1d7f83(0x1ab))/0x5)+parseInt(_0x1d7f83(0x1b7))/0x6+-parseInt(_0x1d7f83(0x1a8))/0x7+-parseInt(_0x1d7f83(0x1af))/0x8*(parseInt(_0x1d7f83(0x1a4))/0x9)+-parseInt(_0x1d7f83(0x1b0))/0xa*(-parseInt(_0x1d7f83(0x1ba))/0xb);if(_0x5649b3===_0x13d8fb)break;else _0x401eed['push'](_0x401eed['shift']());}catch(_0x121097){_0x401eed['push'](_0x401eed['shift']());}}}(_0x19ba,0x3f736));import{join}from'path';import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x5a298e from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x887173){const _0x58da82=_0x3423,_0x520093={'MsPvu':_0x58da82(0x1a7),'ofpKs':_0x58da82(0x1b4),'pAEcU':'pluginScope','aetqA':_0x58da82(0x1b5),'KRwPt':_0x58da82(0x1b8),'tBBnl':function(_0x321fcf,_0x550ce1){return _0x321fcf(_0x550ce1);},'sxmxd':_0x58da82(0x1a6),'zWfzh':_0x58da82(0x1ad),'rSDmz':function(_0x5a63eb,_0x2c072a,_0x301a97){return _0x5a63eb(_0x2c072a,_0x301a97);},'GKnDw':function(_0x18baeb,_0x18171c,_0x7ad589){return _0x18baeb(_0x18171c,_0x7ad589);}},_0xd16b4f=existsSync(join(getOpencodeConfigDir(_0x58da82(0x1a7)),'opencode.json'));let _0x50b32a;if(_0x887173)_0x50b32a=_0x887173;else{if(_0xd16b4f)_0x50b32a=_0x520093[_0x58da82(0x1ae)];else{console['log'](_0x520093['ofpKs']);const _0x4985f9=await _0x5a298e['prompt']([{'type':_0x58da82(0x1b3),'name':_0x520093['pAEcU'],'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x520093['aetqA'],'value':_0x520093[_0x58da82(0x1b2)]},{'name':_0x58da82(0x1bb),'value':_0x520093[_0x58da82(0x1ae)]}],'default':'user'}]);_0x50b32a=_0x4985f9[_0x58da82(0x1be)];}}const _0x14c981=join(_0x520093['tBBnl'](getOpencodeConfigDir,_0x50b32a),_0x58da82(0x1ac)),_0x4b6f12='@ranger-testing/opencode-plugin',_0x26a4d7=_0x58da82(0x1a9);let _0x338366={};if(existsSync(_0x14c981))try{const _0xd0dc27=await readFile(_0x14c981,'utf-8');_0x338366=JSON['parse'](_0xd0dc27);}catch(_0x5aa86d){return console['error'](_0x520093['sxmxd']),{'configured':![],'scope':_0x50b32a,'error':_0x520093['zWfzh'],'details':_0x5aa86d};}const _0x14ddf7=Array[_0x58da82(0x1b1)](_0x338366['plugin'])?_0x338366[_0x58da82(0x1aa)]:[];if(_0x14ddf7['includes'](_0x4b6f12))return console['log']('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x50b32a};return _0x338366[_0x58da82(0x1b6)]=_0x338366[_0x58da82(0x1b6)]||_0x26a4d7,_0x338366['plugin']=[..._0x14ddf7,_0x4b6f12],await _0x520093['rSDmz'](mkdir,getOpencodeConfigDir(_0x50b32a),{'recursive':!![]}),await _0x520093['GKnDw'](writeFile,_0x14c981,JSON['stringify'](_0x338366,null,0x2)+'\x0a'),console['log']('✓\x20OpenCode\x20plugin\x20configured'),{'configured':!![],'scope':_0x50b32a};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xab84c2,_0x54cb03){var _0x992549=_0x4477,_0x54ae0=_0xab84c2();while(!![]){try{var _0x2051e4=parseInt(_0x992549(0x6c))/0x1+-parseInt(_0x992549(0x71))/0x2+parseInt(_0x992549(0x6d))/0x3+-parseInt(_0x992549(0x6f))/0x4+-parseInt(_0x992549(0x70))/0x5+-parseInt(_0x992549(0x74))/0x6+parseInt(_0x992549(0x6b))/0x7*(parseInt(_0x992549(0x75))/0x8);if(_0x2051e4===_0x54cb03)break;else _0x54ae0['push'](_0x54ae0['shift']());}catch(_0x437db8){_0x54ae0['push'](_0x54ae0['shift']());}}}(_0x3495,0x8dd09));function _0x4477(_0x5bdd63,_0x10fc2e){_0x5bdd63=_0x5bdd63-0x6a;var _0x349562=_0x3495();var _0x447758=_0x349562[_0x5bdd63];return _0x447758;}function _0x3495(){var _0xfe0e71=['ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','1862344WQtkMe','4268875umUCOe','640032VdMSxR','exit','QPDjP','376296qIGOYv','246272ZtwQSt','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','231LdWzJA','884563gpfTBP','1147593lzYCPL'];_0x3495=function(){return _0xfe0e71;};return _0x3495();}export async function setupCi(_0x14ab1e,_0x5771a8,_0x530e07){var _0x27399f=_0x4477,_0x564047={'QPDjP':function(_0x22e48d,_0x362a96){return _0x22e48d+_0x362a96;}};console['error'](_0x564047[_0x27399f(0x73)](_0x564047[_0x27399f(0x73)](_0x564047[_0x27399f(0x73)](_0x564047['QPDjP'](_0x27399f(0x6e)+'\x0a','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a')+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','\x0a'),_0x27399f(0x6a)),'\x20\x20https://docs.ranger.net/main/concepts/profiles')),process[_0x27399f(0x72)](0x1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x39f698,_0x176205){const _0x421845=_0x4b4c,_0x54ce4c=_0x39f698();while(!![]){try{const _0x350399=-parseInt(_0x421845(0x12a))/0x1+-parseInt(_0x421845(0x127))/0x2*(-parseInt(_0x421845(0x135))/0x3)+parseInt(_0x421845(0x14a))/0x4*(parseInt(_0x421845(0x141))/0x5)+-parseInt(_0x421845(0x133))/0x6+-parseInt(_0x421845(0x14d))/0x7*(-parseInt(_0x421845(0x148))/0x8)+parseInt(_0x421845(0x132))/0x9*(-parseInt(_0x421845(0x137))/0xa)+-parseInt(_0x421845(0x13e))/0xb;if(_0x350399===_0x176205)break;else _0x54ce4c['push'](_0x54ce4c['shift']());}catch(_0x20ae1b){_0x54ce4c['push'](_0x54ce4c['shift']());}}}(_0x4523,0x8f1bf));import{basename}from'path';import _0x1396b1 from'inquirer';import{getToken}from'./utils/keychain.js';function _0x4b4c(_0x3b7b4c,_0x477e21){_0x3b7b4c=_0x3b7b4c-0x124;const _0x4523e1=_0x4523();let _0x4b4c2e=_0x4523e1[_0x3b7b4c];return _0x4b4c2e;}import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';function _0x4523(){const _0x429018=['ranger','stdin','message','637641BNZvzs','1938756svTzUJ','BaBDQ','57NzTVbv','\x20\x202.\x20Run:\x20ranger\x20setup','60XLwAga','autoInstall','installLevel','Where\x20should\x20skills\x20be\x20installed?','To\x20use:','kWLzm','log','8306958Lbjmgb','\x20--opencode','claude','15SqkBUw','opencode','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','jlhrS','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','\x20skill','FNtsi','8ENSagx','djeqo','346252CjaoMy','StPiW','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','5737473JahbOm','\x20\x20-\x20Open\x20Claude\x20Code\x20in\x20plan\x20mode\x20and\x20run\x20/ranger:enable.\x20Plan\x20out\x20a\x20UI\x20feature\x20with\x20Ranger\x20and\x20watch\x20Ranger\x20test\x20it\x20for\x20you!','This\x20project\x20only\x20(','ijOpS','stdout','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','UWODQ','/skills/','isTTY','To\x20get\x20started:','119694CMjAQG','/.opencode/skills/','KVxek','126848fskbmu','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','warn','user','QAoOn'];_0x4523=function(){return _0x429018;};return _0x4523();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x4a90fb={}){const _0x44f0c0=_0x4b4c,_0x44fabb={'StPiW':_0x44f0c0(0x140),'kWLzm':_0x44f0c0(0x145),'FNtsi':function(_0x4f7564,_0x3b32be){return _0x4f7564===_0x3b32be;},'jlhrS':'opencode','BaBDQ':_0x44f0c0(0x13f),'djeqo':_0x44f0c0(0x12b),'CiwYq':function(_0x248e53){return _0x248e53();},'JXnrp':function(_0x24339b,_0x302ec3){return _0x24339b===_0x302ec3;},'GRHnm':function(_0x432bfd,_0xa175aa){return _0x432bfd(_0xa175aa);},'KVxek':'installLevel','hxmRm':_0x44f0c0(0x13a),'BZruJ':_0x44f0c0(0x12d),'UWODQ':'project','ijOpS':'\x0a📦\x20Installing\x20skills...\x0a','ozNRT':function(_0x3b15de,_0x30ce1b){return _0x3b15de>_0x30ce1b;},'nVJvL':function(_0x5c52c6,_0x109d81){return _0x5c52c6>_0x109d81;},'QAoOn':_0x44f0c0(0x13b),'ZTIJX':function(_0x579257,_0x8b427f){return _0x579257===_0x8b427f;},'TLTCp':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.'};console['log']('\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a');const _0x43bcbd=_0x4a90fb['platform']??_0x44fabb[_0x44f0c0(0x14b)],_0x2d10a5=await getToken();if(!_0x2d10a5){const _0x3fc6de='0|3|4|1|5|2'['split']('|');let _0xc4bbfb=0x0;while(!![]){switch(_0x3fc6de[_0xc4bbfb++]){case'0':console[_0x44f0c0(0x13d)](_0x44fabb[_0x44f0c0(0x13c)]);continue;case'1':console[_0x44f0c0(0x13d)](_0x44f0c0(0x136)+(_0x44fabb[_0x44f0c0(0x147)](_0x43bcbd,_0x44fabb[_0x44f0c0(0x144)])?_0x44fabb['BaBDQ']:'')+'\x20<your-api-token>');continue;case'2':return;case'3':console['log'](_0x44f0c0(0x126));continue;case'4':console[_0x44f0c0(0x13d)](_0x44fabb[_0x44f0c0(0x149)]);continue;case'5':console['log']('\x20\x203.\x20Run:\x20ranger\x20skillup'+(_0x43bcbd==='opencode'?_0x44fabb[_0x44f0c0(0x134)]:'')+'\x0a');continue;}break;}}console[_0x44f0c0(0x13d)]('✓\x20Found\x20API\x20token');const _0x567b72=_0x44fabb['CiwYq'](getProjectRoot),_0x410b13=basename(_0x567b72),_0x3233e7=_0x44fabb['JXnrp'](_0x43bcbd,_0x44fabb[_0x44f0c0(0x144)])?_0x44fabb['GRHnm'](getOpencodeConfigDir,_0x44f0c0(0x12d))+_0x44f0c0(0x124):getClaudeConfigDir()+_0x44f0c0(0x124),_0x53e0c8=_0x43bcbd===_0x44f0c0(0x142)?_0x567b72+_0x44f0c0(0x128):_0x567b72+'/.claude/skills/',_0x44313d=process[_0x44f0c0(0x130)][_0x44f0c0(0x125)]&&process[_0x44f0c0(0x151)][_0x44f0c0(0x125)];let _0x3fefc7;if(_0x4a90fb[_0x44f0c0(0x138)])_0x3fefc7=_0x4a90fb[_0x44f0c0(0x138)];else{if(_0x44313d){const _0x1f10b9=await _0x1396b1['prompt']([{'type':'list','name':_0x44fabb[_0x44f0c0(0x129)],'message':_0x44fabb['hxmRm'],'choices':[{'name':'All\x20projects\x20('+_0x3233e7+')','value':_0x44fabb['BZruJ']},{'name':_0x44f0c0(0x14f)+_0x53e0c8+')','value':_0x44fabb[_0x44f0c0(0x153)]}]}]);_0x3fefc7=_0x1f10b9[_0x44f0c0(0x139)];}else _0x3fefc7=_0x44fabb['UWODQ'],console['log'](_0x44f0c0(0x143)+_0x53e0c8+')');}let _0xbda909=0x0;const _0x435bfc=getCurrentVersion();console[_0x44f0c0(0x13d)](_0x44fabb[_0x44f0c0(0x150)]);try{const _0x4b29cb=await installSkill(_0x44f0c0(0x12f),{'cliVersion':_0x435bfc,'level':_0x3fefc7,'platform':_0x43bcbd});_0x4b29cb&&_0xbda909++;}catch(_0x1053e5){console[_0x44f0c0(0x12c)](_0x44f0c0(0x14c),_0x1053e5 instanceof Error?_0x1053e5[_0x44f0c0(0x131)]:_0x1053e5);}if(_0x44fabb['ozNRT'](_0xbda909,0x0)){const _0x3be209=_0x3fefc7===_0x44fabb['BZruJ']?'user-level':'project-level';console['log']('\x0a✅\x20Installed\x20'+_0xbda909+'\x20'+_0x3be209+_0x44f0c0(0x146)+(_0x44fabb['nVJvL'](_0xbda909,0x1)?'s':'')+'\x20successfully!\x0a'),!_0x4a90fb['suppressUsage']&&(console['log'](_0x44fabb[_0x44f0c0(0x12e)]),_0x44fabb['ZTIJX'](_0x43bcbd,_0x44f0c0(0x142))?console['log'](_0x44fabb['TLTCp']):console['log'](_0x44f0c0(0x14e)));}else console[_0x44f0c0(0x13d)](_0x44f0c0(0x152));}
|
package/build/commands/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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.');}}
|
|
1
|
+
(function(_0x43f370,_0xf392d5){const _0x357ed6=_0x426c,_0x41e90e=_0x43f370();while(!![]){try{const _0x295eb0=parseInt(_0x357ed6(0x1cf))/0x1*(-parseInt(_0x357ed6(0x1c2))/0x2)+parseInt(_0x357ed6(0x1b3))/0x3+-parseInt(_0x357ed6(0x223))/0x4+-parseInt(_0x357ed6(0x21f))/0x5+-parseInt(_0x357ed6(0x205))/0x6*(parseInt(_0x357ed6(0x1d6))/0x7)+parseInt(_0x357ed6(0x1b8))/0x8*(-parseInt(_0x357ed6(0x1df))/0x9)+-parseInt(_0x357ed6(0x1fc))/0xa*(-parseInt(_0x357ed6(0x213))/0xb);if(_0x295eb0===_0xf392d5)break;else _0x41e90e['push'](_0x41e90e['shift']());}catch(_0x24360e){_0x41e90e['push'](_0x41e90e['shift']());}}}(_0x2b07,0x4b485));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';function _0x426c(_0x2e38be,_0x3ef5d7){_0x2e38be=_0x2e38be-0x1b2;const _0x2b07b8=_0x2b07();let _0x426c93=_0x2b07b8[_0x2e38be];return _0x426c93;}import{createRequire}from'module';import{spawn}from'child_process';import _0x53a6b0 from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';const require=createRequire(import.meta.url);function _0x2b07(){const _0xa4696=['\x20now?','✓\x20Authenticated\x20to\x20','✓\x20Exported\x20credentials\x20for\x20CI','local','method','plugin','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','37JGZldS','REPoX','skipChromium','xsSVx','version','organizationName','Validating\x20API\x20token...','1062502YGGqRa','auXui','ranger','YhgIN','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','\x20is\x20no\x20longer\x20supported.\x20','confirm','9sdrOqx','resolve','\x0a🚀\x20Ranger\x20Setup\x0a','status','ready','url','profile','chromium','ignore','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','close','tfVZQ','UmrYq','mBjlD','rrNOB','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','trackPhaseEnd','aHNLo','\x20(fallback\x20version)','ZZJLK','success','The\x20required\x20version\x20(','skipAuth','GBGTp','rpiYp','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','1150zKfzQx','bzfNC','platform','scope','✓\x20Already\x20authenticated\x20to\x20','existing_token','pBlFQ','...','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','6SENIle','\x0aInstalling\x20Chromium\x20browser...\x0a','user','geJTy','DnDkR','igzdi','ENWEj','error','OSIwM','playwright/package.json','lHlLC','inherit','win32','isTTY','133265CeKJXZ','trackPhaseStart','warn','GITHUB_ENV','provided_token','/ranger:enable','CMTXz','YYGHh','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','exit','xdPoa','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','328850xWsfPF','\x0a\x20\x20','opencode','skipped','453280pwXGoY','message','ilOHP','--with-deps','coboP','force','✓\x20Created\x20~/.ranger/\x20directory','880017pPAfmJ','log','stdout','cevzZ','\x20and\x20prompt\x20the\x20coding','4616488KKimgi','device_auth','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','wKvSa','skills','DEcgd','lDfoE','JxYJG','25420CBziTO','npx','.gitignore','\x20\x20npx\x20playwright@',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','zHxNt'];_0x2b07=function(){return _0xa4696;};return _0x2b07();}export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x888b14=>'\x1b[1m'+_0x888b14+'\x1b[0m';export function getPlaywrightVersion(){const _0x1ae2f0=_0x426c;try{const _0x792ae4=require[_0x1ae2f0(0x1e0)](_0x1ae2f0(0x20e)),_0x140b83=require(_0x792ae4);return _0x140b83[_0x1ae2f0(0x1d3)];}catch{return null;}}export function installChromiumBinary(_0x1e8ad3,_0x2848cb=![]){const _0x138f73=_0x426c,_0x299aed={'otxmL':function(_0x32237d){return _0x32237d();},'lzHgg':_0x138f73(0x226),'ZZJLK':'chromium','NbQwg':function(_0x361c67,_0x5e3cfd,_0x4a41ff,_0x48c468){return _0x361c67(_0x5e3cfd,_0x4a41ff,_0x48c468);},'MNYEz':_0x138f73(0x1e7),'wKvSa':_0x138f73(0x210),'cwCUB':_0x138f73(0x1eb),'igzdi':'error'};return new Promise((_0x2e1aa7,_0x1e3dde)=>{const _0x2ff49d=_0x138f73,_0x58b497={'IXogc':function(_0xc7fe65,_0x58c315){return _0xc7fe65(_0x58c315);}},_0x25eab3=['playwright@'+_0x1e8ad3,'install',..._0x2848cb?[_0x299aed['lzHgg']]:[],_0x299aed[_0x2ff49d(0x1f5)]],_0x352f81=_0x299aed['NbQwg'](spawn,_0x2ff49d(0x1c3),_0x25eab3,{'stdio':[_0x299aed['MNYEz'],_0x299aed[_0x2ff49d(0x1bd)],_0x2ff49d(0x210)],'shell':process[_0x2ff49d(0x1fe)]===_0x2ff49d(0x211)});_0x352f81['on'](_0x299aed['cwCUB'],_0x4116b5=>{_0x4116b5===0x0?_0x299aed['otxmL'](_0x2e1aa7):_0x1e3dde(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x4116b5));}),_0x352f81['on'](_0x299aed[_0x2ff49d(0x20a)],_0xd15bb3=>{_0x58b497['IXogc'](_0x1e3dde,_0xd15bb3);});});}export async function authenticate(_0x2b554a){const _0x193f9b=_0x426c,_0x50455c={'xsSVx':function(_0xb8c422){return _0xb8c422();},'YhgIN':function(_0x3f3ef4,_0x1596f2){return _0x3f3ef4(_0x1596f2);},'DnDkR':function(_0x33f167,_0x81cafc){return _0x33f167(_0x81cafc);},'xGdhM':_0x193f9b(0x1b9),'SykQX':_0x193f9b(0x1d5)};if(!_0x2b554a){const _0x108d47=await _0x50455c[_0x193f9b(0x1d2)](getToken);if(_0x108d47){const _0xea928b=await _0x50455c['YhgIN'](getCurrentUser,_0x108d47);if(_0xea928b[_0x193f9b(0x1f6)])return console[_0x193f9b(0x1b4)](_0x193f9b(0x200)+_0xea928b[_0x193f9b(0x207)]['organizationName']),{'token':_0x108d47,'method':_0x193f9b(0x201)};}try{_0x2b554a=await _0x50455c[_0x193f9b(0x1d2)](runDeviceAuthFlow);}catch(_0xe0dc74){throw new Error('Authentication\x20failed:\x20'+(_0xe0dc74 instanceof Error?_0xe0dc74[_0x193f9b(0x224)]:_0xe0dc74));}const _0x33bc83=await _0x50455c[_0x193f9b(0x209)](getCurrentUser,_0x2b554a);if(!_0x33bc83['success'])throw new Error(_0x193f9b(0x1bc)+_0x33bc83[_0x193f9b(0x20c)]);return console[_0x193f9b(0x1b4)](_0x193f9b(0x1c9)+_0x33bc83['user']['organizationName']),{'token':_0x2b554a,'method':_0x50455c['xGdhM']};}console[_0x193f9b(0x1b4)](_0x50455c['SykQX']);const _0x3dc51a=await getCurrentUser(_0x2b554a);if(!_0x3dc51a[_0x193f9b(0x1f6)]){if(_0x3dc51a[_0x193f9b(0x1e2)])throw new Error('Authentication\x20failed:\x20'+_0x3dc51a[_0x193f9b(0x20c)]+_0x193f9b(0x1ce));else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x3dc51a['error']+_0x193f9b(0x21b));}return console['log']('✓\x20Authenticated\x20to\x20'+_0x3dc51a['user'][_0x193f9b(0x1d4)]),await _0x50455c[_0x193f9b(0x1d9)](storeToken,_0x2b554a),console['log'](process['env'][_0x193f9b(0x216)]?_0x193f9b(0x1ca):'✓\x20Stored\x20credentials\x20locally'),{'token':_0x2b554a,'method':_0x193f9b(0x217)};}export async function ensureRangerDir(_0x3d3bf3){const _0x3b9616=_0x426c,_0x3126b8={'tfVZQ':function(_0x14db8b,_0x2567b5,_0x546b0b){return _0x14db8b(_0x2567b5,_0x546b0b);},'REPoX':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x3d3bf3;const _0x3c5597=getRangerHomeDir();return!existsSync(_0x3c5597)?(await _0x3126b8[_0x3b9616(0x1ec)](mkdir,_0x3c5597,{'recursive':!![]}),console[_0x3b9616(0x1b4)](_0x3b9616(0x1b2)),{'path':_0x3c5597,'installed':!![]}):(console[_0x3b9616(0x1b4)](_0x3126b8[_0x3b9616(0x1d0)]),{'path':_0x3c5597,'installed':![]});}export async function ensureChromium(_0x417eef=![]){const _0x19d84a=_0x426c,_0x7f4ae0={'DUSIF':function(_0x4859b5,_0x1702e3){return _0x4859b5(_0x1702e3);},'rpiYp':function(_0xe3c78b){return _0xe3c78b();},'rFvGi':_0x19d84a(0x1de),'cevzZ':'install','JxYJG':function(_0x424526,_0x49d380,_0x873e70){return _0x424526(_0x49d380,_0x873e70);},'NcZlR':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','ztbOn':function(_0x34a666,_0x54bbb7){return _0x34a666 instanceof _0x54bbb7;},'eDefO':'You\x20can\x20install\x20it\x20manually\x20by\x20running:','bTtLM':'\x0a⚠\x20Skipping\x20Chromium\x20installation.','ppmVO':_0x19d84a(0x1ea)};let _0x5229ed=![];try{const _0xca96bb=chromium['executablePath']();_0x5229ed=_0x7f4ae0['DUSIF'](existsSync,_0xca96bb);}catch{_0x5229ed=![];}if(_0x5229ed)return console[_0x19d84a(0x1b4)]('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x216e4c=_0x7f4ae0[_0x19d84a(0x1fa)](getPlaywrightVersion),_0x16fdaf=_0x216e4c??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x10f6b3=!_0x216e4c,_0x4ce33c=process['stdin'][_0x19d84a(0x212)]&&process[_0x19d84a(0x1b5)][_0x19d84a(0x212)];let _0x289bd0=!![];if(_0x4ce33c){const {install:_0xe9797}=await _0x53a6b0['prompt']([{'type':_0x7f4ae0['rFvGi'],'name':_0x7f4ae0[_0x19d84a(0x1b6)],'message':_0x10f6b3?_0x19d84a(0x1f0)+_0x16fdaf+_0x19d84a(0x1c8):_0x19d84a(0x1f7)+_0x16fdaf+_0x19d84a(0x1c6),'default':!![]}]);_0x289bd0=_0xe9797;}else console[_0x19d84a(0x1b4)](_0x19d84a(0x1fb)+_0x16fdaf+(_0x10f6b3?_0x19d84a(0x1f4):'')+_0x19d84a(0x203));if(_0x289bd0){console[_0x19d84a(0x1b4)](_0x19d84a(0x206));try{await _0x7f4ae0[_0x19d84a(0x1c1)](installChromiumBinary,_0x16fdaf,_0x417eef),console[_0x19d84a(0x1b4)](_0x7f4ae0['NcZlR']);}catch(_0x3c6976){console['error']('\x0a❌\x20Failed\x20to\x20install\x20Chromium:',_0x7f4ae0['ztbOn'](_0x3c6976,Error)?_0x3c6976['message']:_0x3c6976),console[_0x19d84a(0x1b4)](_0x7f4ae0['eDefO']),console[_0x19d84a(0x1b4)](_0x19d84a(0x1c5)+_0x16fdaf+'\x20install\x20chromium');}}else console['log'](_0x7f4ae0['bTtLM']),console['log'](_0x7f4ae0['ppmVO']),console[_0x19d84a(0x1b4)]('\x20\x20npx\x20playwright@'+_0x16fdaf+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x4aafd9){const _0x3bcdc5=_0x426c,_0x13389e={'GBGTp':function(_0x217daf,_0x4e1c50,_0x2d8fb9){return _0x217daf(_0x4e1c50,_0x2d8fb9);},'ilOHP':_0x3bcdc5(0x1c4),'vAbnL':function(_0x2e0823,_0x1240fc,_0x511063){return _0x2e0823(_0x1240fc,_0x511063);},'epjvk':'✓\x20Created\x20.ranger/.gitignore'},_0x1955e7=_0x13389e[_0x3bcdc5(0x1f9)](join,_0x4aafd9,_0x13389e[_0x3bcdc5(0x225)]),_0x5fd6ed='\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 _0x13389e['vAbnL'](writeFile,_0x1955e7,_0x5fd6ed),console['log'](_0x13389e['epjvk']);}export async function ensureLocalEnv(_0x468b5f,_0x2e0485){const _0x2712cc=_0x426c,_0x5b53e1={'XAfTa':'⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','rrNOB':_0x2712cc(0x207),'JfQRj':_0x2712cc(0x1cb),'ulXzI':'✓\x20Local\x20profile\x20already\x20exists','bzfNC':function(_0x180e7c,_0x52eff7,_0x3739b7,_0x3bc48e){return _0x180e7c(_0x52eff7,_0x3739b7,_0x3bc48e);},'amhyC':'\x0a❌\x20Profile\x20setup\x20failed:'};if(!findGitRoot()&&_0x468b5f?.[_0x2712cc(0x1ff)]!==_0x2712cc(0x207))return console[_0x2712cc(0x1b4)](_0x5b53e1['XAfTa']),{'ready':![],'skipped':!![]};const _0x139442=_0x468b5f?.['scope']===_0x5b53e1[_0x2712cc(0x1ef)]?getRangerHomeDir():undefined;if(findExistingEnv(_0x5b53e1['JfQRj'],{'locations':['local'],'rangerDir':_0x139442}))return console[_0x2712cc(0x1b4)](_0x5b53e1['ulXzI']),{'ready':!![],'skipped':![]};try{return await _0x5b53e1[_0x2712cc(0x1fd)](addEnv,_0x2712cc(0x1cb),{'url':_0x468b5f?.[_0x2712cc(0x1e4)],'force':_0x468b5f?.[_0x2712cc(0x228)],'allowInsecureLocalhost':_0x468b5f?.['allowInsecureLocalhost'],'scope':_0x468b5f?.[_0x2712cc(0x1ff)]},_0x2e0485),{'ready':!![],'skipped':![]};}catch(_0x494a04){return console[_0x2712cc(0x20c)](_0x5b53e1['amhyC'],_0x494a04 instanceof Error?_0x494a04['message']:_0x494a04),{'ready':![],'skipped':![]};}}export async function start(_0x23dd1d,_0x10a241,_0x17f365){const _0x596c6a=_0x426c,_0x2dfed8={'geJTy':_0x596c6a(0x207),'auXui':function(_0x3adf20,_0x4772bb){return _0x3adf20+_0x4772bb;},'mBjlD':function(_0x17defa,_0x3ab003){return _0x17defa(_0x3ab003);},'lDfoE':'auth','pBlFQ':_0x596c6a(0x1cd),'UmrYq':function(_0x241e7f,_0x3d0e30){return _0x241e7f(_0x3d0e30);},'coboP':function(_0x2145ec){return _0x2145ec();},'ENWEj':_0x596c6a(0x1be),'CMTXz':function(_0x134270,_0x96e414){return _0x134270(_0x96e414);},'xdPoa':function(_0x17c658,_0x348ee8,_0x185db1){return _0x17c658(_0x348ee8,_0x185db1);},'aHNLo':_0x596c6a(0x1e5),'zHxNt':function(_0x3d480c,_0x3af78d){return _0x3d480c+_0x3af78d;},'lHlLC':function(_0x1c44d6,_0x1f7891){return _0x1c44d6(_0x1f7891);},'IGsaJ':'ranger\x20profile\x20add\x20<name>','YYGHh':'\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','KPQMV':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','OSIwM':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','RUPOS':_0x596c6a(0x1dc),'PKgYI':function(_0x5c1abb,_0x6001c){return _0x5c1abb(_0x6001c);},'tbgvU':_0x596c6a(0x218),'DEcgd':function(_0xafed1d,_0x23b8d8){return _0xafed1d+_0x23b8d8;}};console[_0x596c6a(0x1b4)](_0x596c6a(0x1e1));_0x10a241?.['scope']!==undefined&&_0x10a241[_0x596c6a(0x1ff)]!==_0x2dfed8[_0x596c6a(0x208)]&&(console['error'](_0x2dfed8[_0x596c6a(0x1d7)]('ranger\x20setup\x20--scope='+String(_0x10a241[_0x596c6a(0x1ff)])+_0x596c6a(0x1dd),_0x596c6a(0x1ba))+'project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.'),process[_0x596c6a(0x21c)](0x1));_0x10a241={..._0x10a241,'scope':'user'};const _0x10c7bc=!_0x2dfed8[_0x596c6a(0x1ee)](existsSync,getRangerHomeDir());await _0x2dfed8['mBjlD'](ensureRangerDir,_0x2dfed8[_0x596c6a(0x208)]);if(_0x10a241?.[_0x596c6a(0x1f8)])console[_0x596c6a(0x1b4)]('✓\x20Skipping\x20authentication\x20(--skip-auth)'),_0x17f365?.['trackPhaseEnd'](_0x2dfed8[_0x596c6a(0x1c0)],{'isFirstRun':_0x10c7bc,'method':'skipped'});else{_0x17f365?.['trackPhaseStart']('auth');const _0x2779d8=await authenticate(_0x23dd1d);_0x17f365?.['trackPhaseEnd'](_0x2dfed8[_0x596c6a(0x1c0)],{'isFirstRun':_0x10c7bc,'method':_0x2779d8[_0x596c6a(0x1cc)]});}_0x17f365?.[_0x596c6a(0x214)](_0x596c6a(0x1e6));_0x10a241?.[_0x596c6a(0x1d1)]?console[_0x596c6a(0x1b4)](_0x596c6a(0x21e)):await _0x2dfed8['mBjlD'](ensureChromium,_0x10a241?.['withDeps']);_0x17f365?.[_0x596c6a(0x1f2)](_0x596c6a(0x1e6),{'isFirstRun':_0x10c7bc,'skipped':!!_0x10a241?.[_0x596c6a(0x1d1)]}),console[_0x596c6a(0x1b4)]('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0x10c6fa=_0x10a241?.[_0x596c6a(0x1ff)],_0x5007d6=_0x10a241?.['opencode']??![];let _0x3e23a7=null;_0x5007d6?(_0x17f365?.['trackPhaseStart'](_0x2dfed8[_0x596c6a(0x202)]),_0x3e23a7=await ensureOpencodePluginConfig(_0x10c6fa),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8['pBlFQ'],{'isFirstRun':_0x10c7bc,'opencode':!![]})):(_0x17f365?.[_0x596c6a(0x214)](_0x2dfed8[_0x596c6a(0x202)]),await _0x2dfed8[_0x596c6a(0x1ed)](ensureClaudePlugin,_0x10c6fa),_0x17f365?.[_0x596c6a(0x1f2)]('plugin',{'isFirstRun':_0x10c7bc}));if(_0x5007d6&&_0x3e23a7){_0x17f365?.['trackPhaseStart']('skills');try{await installSkill(_0x596c6a(0x1d8),{'level':_0x3e23a7[_0x596c6a(0x1ff)],'cliVersion':_0x2dfed8[_0x596c6a(0x227)](getCurrentVersion),'platform':_0x596c6a(0x221)}),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8[_0x596c6a(0x20b)],{'isFirstRun':_0x10c7bc,'opencode':!![]});}catch(_0x7d7273){console[_0x596c6a(0x215)]('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x7d7273 instanceof Error?_0x7d7273[_0x596c6a(0x224)]:_0x7d7273),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8[_0x596c6a(0x20b)],{'isFirstRun':_0x10c7bc,'opencode':!![],'failed':!![]});}}else _0x17f365?.[_0x596c6a(0x214)](_0x2dfed8[_0x596c6a(0x20b)]),await _0x2dfed8[_0x596c6a(0x219)](ensureClaudeSkills,_0x10c6fa),_0x17f365?.[_0x596c6a(0x1f2)](_0x2dfed8['ENWEj'],{'isFirstRun':_0x10c7bc});if(_0x10a241?.['skipAuth'])console['log'](_0x596c6a(0x204));else{if(_0x10a241?.['url']){_0x17f365?.[_0x596c6a(0x214)]('profile');const _0x54f3f3=await _0x2dfed8[_0x596c6a(0x21d)](ensureLocalEnv,{'url':_0x10a241['url'],'force':_0x10a241?.[_0x596c6a(0x228)],'allowInsecureLocalhost':_0x10a241?.['allowInsecureLocalhost'],'scope':_0x596c6a(0x207)},_0x17f365);_0x17f365?.['trackPhaseEnd'](_0x2dfed8[_0x596c6a(0x1f3)],{'isFirstRun':_0x10c7bc,'profileReady':_0x54f3f3[_0x596c6a(0x1e3)],'userSkipped':_0x54f3f3[_0x596c6a(0x222)]});}else console[_0x596c6a(0x1b4)](_0x2dfed8['auXui'](_0x2dfed8[_0x596c6a(0x1d7)](_0x2dfed8['zHxNt'](_0x596c6a(0x1f1),_0x596c6a(0x220)+_0x2dfed8[_0x596c6a(0x20f)](bold,_0x2dfed8['IGsaJ']))+_0x596c6a(0x1e9),_0x596c6a(0x1e8)),_0x596c6a(0x1da)));}if(_0x5007d6)console['log'](_0x2dfed8[_0x596c6a(0x21a)]),console['log'](_0x2dfed8['KPQMV']),console['log'](_0x2dfed8[_0x596c6a(0x20d)]),console[_0x596c6a(0x1b4)](_0x2dfed8['RUPOS']);else{const _0x297575=_0x2dfed8['PKgYI'](bold,_0x2dfed8['tbgvU']);console['log'](_0x2dfed8[_0x596c6a(0x1c7)](_0x2dfed8['auXui'](_0x2dfed8[_0x596c6a(0x1bf)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x297575+_0x596c6a(0x1b7),'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with'),_0x596c6a(0x1db)),_0x596c6a(0x1bb)));}}
|
package/build/commands/status.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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)]('');}
|
|
1
|
+
const _0x54954e=_0x3c88;(function(_0x3053d3,_0x527049){const _0x4b4cea=_0x3c88,_0x4f14e2=_0x3053d3();while(!![]){try{const _0x3dad6a=parseInt(_0x4b4cea(0x14d))/0x1*(-parseInt(_0x4b4cea(0xfe))/0x2)+parseInt(_0x4b4cea(0xf2))/0x3*(parseInt(_0x4b4cea(0x111))/0x4)+-parseInt(_0x4b4cea(0xea))/0x5*(-parseInt(_0x4b4cea(0x145))/0x6)+-parseInt(_0x4b4cea(0x13a))/0x7*(parseInt(_0x4b4cea(0x123))/0x8)+parseInt(_0x4b4cea(0x143))/0x9+parseInt(_0x4b4cea(0x107))/0xa+-parseInt(_0x4b4cea(0x144))/0xb*(parseInt(_0x4b4cea(0x147))/0xc);if(_0x3dad6a===_0x527049)break;else _0x4f14e2['push'](_0x4f14e2['shift']());}catch(_0x34b089){_0x4f14e2['push'](_0x4f14e2['shift']());}}}(_0x3968,0xc8fc2));import{readFile,readdir}from'fs/promises';function _0x3c88(_0x29798d,_0x3738e4){_0x29798d=_0x29798d-0xe6;const _0x3968e2=_0x3968();let _0x3c88de=_0x3968e2[_0x29798d];return _0x3c88de;}import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x5c773b=>'\x1b[1m'+_0x5c773b+_0x54954e(0x135),link=(_0x29e6a1,_0x33d27c)=>_0x54954e(0x148)+_0x29e6a1+'\x07'+(_0x33d27c||_0x29e6a1)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x317634=_0x54954e,_0x33c722={'KVRnf':_0x317634(0xe8),'wAljD':_0x317634(0xfc),'Yddqr':_0x317634(0x149),'plEDN':'not_configured','fLplX':_0x317634(0x10c),'ALwOb':_0x317634(0x11a),'MiuYD':_0x317634(0x130),'UbdMC':_0x317634(0x137)};return new Promise(_0x177bc7=>{const _0x2400d2=_0x317634,_0x3d8336={'MwESw':_0x33c722[_0x2400d2(0x115)],'wVfqC':_0x33c722[_0x2400d2(0x110)],'cSeDW':_0x33c722[_0x2400d2(0x113)],'MGOSa':function(_0x34ee40,_0x2d4a66){return _0x34ee40(_0x2d4a66);},'HTrWB':_0x33c722['plEDN']},_0x4718c4=spawn('opencode',[_0x33c722['fLplX'],_0x33c722[_0x2400d2(0x14e)]],{'stdio':[_0x33c722['MiuYD'],'pipe','pipe']});let _0x4ffaf5='';_0x4718c4[_0x2400d2(0x11b)]?.['on']('data',_0x403523=>{const _0x5b0027=_0x2400d2;_0x4ffaf5+=_0x403523[_0x5b0027(0xf1)]();}),_0x4718c4['stderr']?.['on'](_0x33c722[_0x2400d2(0x119)],_0x10b89f=>{_0x4ffaf5+=_0x10b89f['toString']();}),_0x4718c4['on'](_0x2400d2(0x109),()=>{_0x177bc7({'status':'not_installed'});}),_0x4718c4['on'](_0x2400d2(0x128),_0x38d9ac=>{const _0x50ac10=_0x2400d2;if(_0x38d9ac!==0x0){_0x177bc7({'status':_0x50ac10(0x14f)});return;}const _0x26387f=_0x4ffaf5['trim']();let _0x1d17fd=null;if(_0x26387f)try{_0x1d17fd=JSON['parse'](_0x26387f);}catch{const _0x3384df=_0x26387f['match'](/\{[\s\S]*\}$/);if(_0x3384df)try{_0x1d17fd=JSON['parse'](_0x3384df[0x0]);}catch{_0x1d17fd=null;}}const _0x1a34ab=Array['isArray'](_0x1d17fd?.['plugin'])?_0x1d17fd?.[_0x50ac10(0xf6)]:[],_0x75775c=_0x1a34ab['some'](_0x406810=>{const _0x295c5b=_0x50ac10;if(typeof _0x406810!==_0x3d8336['MwESw'])return![];return _0x406810['includes'](_0x295c5b(0x14b))||_0x406810[_0x295c5b(0x105)](_0x3d8336[_0x295c5b(0x14a)]);});if(_0x75775c){_0x177bc7({'status':_0x3d8336['cSeDW'],'details':_0x1a34ab[_0x50ac10(0xf8)]>0x0?_0x1a34ab['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x1a34ab['length']>0x0){_0x3d8336[_0x50ac10(0xf0)](_0x177bc7,{'status':_0x3d8336['HTrWB'],'details':_0x1a34ab['length']+'\x20plugin(s)\x20configured'});return;}_0x3d8336[_0x50ac10(0xf0)](_0x177bc7,{'status':_0x50ac10(0x11e)});});});}async function getSkillsFromDir(_0x4a1428,_0x1ff255){const _0x4b848c=_0x54954e,_0x4a9667={'nzGvf':function(_0x446dc6,_0x9423a6){return _0x446dc6(_0x9423a6);},'OtxBg':function(_0x4fcb3f,_0x23f049,_0x54c405){return _0x4fcb3f(_0x23f049,_0x54c405);},'pKByD':'SKILL.md','CLnKv':function(_0x55efe6,_0x54da81){return _0x55efe6(_0x54da81);},'udWZs':function(_0x308637,_0x179c59,_0xd09979){return _0x308637(_0x179c59,_0xd09979);}};if(!_0x4a9667[_0x4b848c(0x131)](existsSync,_0x4a1428))return[];const _0x5373d3=[];try{const _0x354ee2=await _0x4a9667[_0x4b848c(0xee)](readdir,_0x4a1428,{'withFileTypes':!![]});for(const _0x2cfeb1 of _0x354ee2){if(_0x2cfeb1[_0x4b848c(0x146)]()){const _0x5f29ad=join(_0x4a1428,_0x2cfeb1[_0x4b848c(0x150)],_0x4a9667['pKByD']);if(_0x4a9667['CLnKv'](existsSync,_0x5f29ad)){let _0x11351d=_0x2cfeb1['name'];try{const _0x253b14=await _0x4a9667[_0x4b848c(0x104)](readFile,_0x5f29ad,_0x4b848c(0x11f)),_0x50cc8a=_0x253b14['match'](/name:\s*(.+)/);_0x50cc8a&&(_0x11351d=_0x50cc8a[0x1]['trim']());}catch{}_0x5373d3[_0x4b848c(0x14c)]({'name':_0x2cfeb1[_0x4b848c(0x150)],'displayName':_0x11351d,'path':_0x5f29ad,'level':_0x1ff255});}}}}catch{return[];}return _0x5373d3;}function _0x3968(){const _0x2641fa=['project','bTqBh','\x0a---\x20Profiles\x20---','\x20\x20\x20\x20Session:\x20','DEBUG','string','VSzFL','615SGMBIE','settingsPath','version','No\x20profiles\x20configured','OtxBg','\x0a---\x20Claude\x20Code\x20Plugin\x20---','MGOSa','toString','9IvaWri','YoAbc','rlUKs','scope','plugin','GIMSD','length','ranger@trailhead','UAGhE','path','opencode-plugin','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','14426jDbZbQ','disabled','all','map','Xsfmt','cwd','udWZs','includes','PWqdF','14702160UgEQTI','organizationName','error','\x0a---\x20OpenCode\x20Plugin\x20---','unknown','debug','\x20\x20\x20\x20','\x20\x20Run:\x20ranger\x20update','\x0a\x20\x20No\x20active\x20profile\x20set','wAljD','1734556QucfWz','hasEncryptedAuth','Yddqr','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','KVRnf','TClPI','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','no\x20session','UbdMC','config','stdout','has','\x0a📊\x20Ranger\x20Status\x0a','not_configured','utf-8','\x20(up\x20to\x20date)','KdKdi','Root:\x20','1208edwPIJ','\x20\x20Not\x20installed','\x20\x20\x20\x20Auth:\x20','uqyWQ','success','close','join','isActive','\x20\x20Run:\x20ranger\x20setup\x20--opencode','\x20\x20Project-level:','\x20local','\x20\x20Run:\x20ranger\x20skillup','filter','ignore','nzGvf','enabled','Organization:\x20','details','\x1b[0m','env','data',':\x20installed\x20(','log','5348grwCdt','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','cached\x20(updated\x20','displayName','hasPlaintextAuth','Version:\x20','lKRNJ','QUfWc','\x20\x20\x20\x20Settings:\x20','3658284lcilpt','29330312PSOLur','63774VfLIGy','isDirectory','12BamHwL','\x1b]8;;file://','configured','wVfqC','@ranger-testing/opencode-plugin','push','122kvtOFA','ALwOb','not_installed','name'];_0x3968=function(){return _0x2641fa;};return _0x3968();}async function getInstalledSkills(){const _0x2a73f=_0x54954e,_0x2febdb={'UWoxR':function(_0x215afd,_0x1e35b7,_0x1bc5cc){return _0x215afd(_0x1e35b7,_0x1bc5cc);},'pGrgQ':function(_0x119106){return _0x119106();}},[_0x388bc7,_0x32abe0]=await Promise[_0x2a73f(0x100)]([_0x2febdb['UWoxR'](getSkillsFromDir,_0x2febdb['pGrgQ'](getProjectSkillsDir),_0x2a73f(0x151)),_0x2febdb['UWoxR'](getSkillsFromDir,getUserSkillsDir(),'user')]);return{'project':_0x388bc7,'user':_0x32abe0};}async function getEnvironments(){const _0xc775d5={'Xsfmt':'settings.json','ZvgMF':function(_0x52802b,_0x2dd05e){return _0x52802b(_0x2dd05e);},'ZbDhG':'(not\x20found)'},{envNames:_0x2aadde,activeEnv:_0x2806fb}=await getEnvNames(),_0x4fece1=getRangerDir();if(!existsSync(_0x4fece1))return{'envs':[],'activeEnv':null};const _0x3bb61b=_0x2aadde['map'](_0x1ddcf0=>{const _0x48e338=_0x3c88,_0x18e008=getEnvDir(_0x1ddcf0),_0x3be000=join(_0x18e008,_0xc775d5[_0x48e338(0x102)]),_0x456765=join(_0x18e008,'auth.json'),_0xb72b4=join(_0x18e008,'auth.json.enc');return{'name':_0x1ddcf0,'settingsPath':_0xc775d5['ZvgMF'](existsSync,_0x3be000)?_0x3be000:_0xc775d5['ZbDhG'],'hasPlaintextAuth':existsSync(_0x456765),'hasEncryptedAuth':_0xc775d5['ZvgMF'](existsSync,_0xb72b4),'isActive':_0x1ddcf0===_0x2806fb};});return{'envs':_0x3bb61b,'activeEnv':_0x2806fb};}export async function status(){const _0xd2682f=_0x54954e,_0x31655b={'bTqBh':function(_0x32e7f3,_0x8e5526){return _0x32e7f3(_0x8e5526);},'VSzFL':function(_0xa6e807,_0x36baa9){return _0xa6e807(_0x36baa9);},'gwSoZ':function(_0x577ae2,_0x3ba73e){return _0x577ae2(_0x3ba73e);},'rwpEk':function(_0x3988ce,_0x1793f9){return _0x3988ce(_0x1793f9);},'oJBlY':function(_0x46d14c){return _0x46d14c();},'lKRNJ':function(_0x1942fd){return _0x1942fd();},'CsceK':function(_0x3b5fd5,_0x29e98e){return _0x3b5fd5(_0x29e98e);},'CxOEh':function(_0x1e34c1){return _0x1e34c1();},'hCYYH':function(_0x4fc09b){return _0x4fc09b();},'GIMSD':_0xd2682f(0x10a),'QWSnU':function(_0x16dcc2){return _0x16dcc2();},'CWBqJ':function(_0x4131d1,_0xaeed42){return _0x4131d1===_0xaeed42;},'mansY':_0xd2682f(0x149),'UAGhE':'@ranger-testing/opencode-plugin','KdKdi':function(_0x1e401f,_0x499899){return _0x1e401f===_0x499899;},'rlUKs':'\x20\x20Not\x20configured','JOyjz':_0xd2682f(0x12b),'QUfWc':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','uqyWQ':_0xd2682f(0xef),'YxxwV':_0xd2682f(0x10b),'tGHZP':_0xd2682f(0x124),'Sazrl':'\x0a---\x20Skills\x20---','gciEy':function(_0x16c5c8,_0x276414){return _0x16c5c8+_0x276414;},'PWqdF':function(_0x2e1ac9,_0x4c0b24,_0x2fbdd2){return _0x2e1ac9(_0x4c0b24,_0x2fbdd2);},'qoaeg':function(_0x3d95cd,_0x3b2c04){return _0x3d95cd>_0x3b2c04;},'YoAbc':_0xd2682f(0x153),'yqlfC':function(_0x4fef68){return _0x4fef68();},'rZXRg':function(_0x1e30c4,_0x436d85){return _0x1e30c4+_0x436d85;},'RtAAn':function(_0x474727,_0x3cd2eb){return _0x474727>_0x3cd2eb;},'IAtaM':function(_0x2b70f5,_0x351d4a){return _0x2b70f5>_0x351d4a;},'TClPI':'\x20(active)','fgfZI':'(not\x20found)'};console['log'](_0xd2682f(0x11d));const _0x45fea1=process[_0xd2682f(0x103)](),_0x1abbe4=getRangerDir();if(!_0x31655b[_0xd2682f(0x152)](existsSync,_0x1abbe4)){console['log']('Root:\x20'+link(_0x45fea1,_0x31655b[_0xd2682f(0xe9)](bold,_0x31655b['gwSoZ'](basename,_0x45fea1)))),console['log'](_0xd2682f(0x13b)),console[_0xd2682f(0x139)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0xd2682f(0x139)](_0xd2682f(0x122)+link(_0x45fea1,_0x31655b['gwSoZ'](bold,_0x31655b['rwpEk'](basename,_0x45fea1))));const _0x84951d=getCurrentVersion(),_0x23db44=_0x31655b['oJBlY'](getLatestVersion);if(_0x23db44['version']&&_0x23db44[_0xd2682f(0xec)]!==_0x84951d)console[_0xd2682f(0x139)](_0xd2682f(0x13f)+_0x84951d+'\x20(latest:\x20'+_0x23db44[_0xd2682f(0xec)]+')'),console['log'](_0xd2682f(0x10e));else _0x23db44[_0xd2682f(0xec)]?console[_0xd2682f(0x139)]('Version:\x20'+_0x84951d+_0xd2682f(0x120)):console[_0xd2682f(0x139)](_0xd2682f(0x13f)+_0x84951d);const _0x480c38=await _0x31655b[_0xd2682f(0x140)](getToken);if(_0x480c38){const _0x350dcd=await _0x31655b['CsceK'](getCurrentUser,_0x480c38);_0x350dcd[_0xd2682f(0x127)]?console[_0xd2682f(0x139)](_0xd2682f(0x133)+bold(_0x350dcd['user'][_0xd2682f(0x108)])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0xd2682f(0x139)]('API\x20Token:\x20✗\x20Not\x20found'),console[_0xd2682f(0x139)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0xd2682f(0x136)][_0xd2682f(0xe7)]&&(console[_0xd2682f(0x139)]('API\x20Environment:\x20'+_0x31655b['CxOEh'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+_0x31655b['hCYYH'](getApiBaseUrl)));console[_0xd2682f(0x139)](_0x31655b[_0xd2682f(0xf7)]);const _0xe6148=await _0x31655b['QWSnU'](getOpencodePluginStatus);if(_0x31655b['CWBqJ'](_0xe6148['status'],_0x31655b['mansY']))console['log']('\x20\x20'+bold(_0x31655b[_0xd2682f(0xfa)])+':\x20configured'),_0xe6148[_0xd2682f(0x134)]&&console['log']('\x20\x20'+_0xe6148['details']);else _0x31655b[_0xd2682f(0x121)](_0xe6148['status'],'not_configured')?(console[_0xd2682f(0x139)](_0x31655b[_0xd2682f(0xf4)]),_0xe6148[_0xd2682f(0x134)]&&console[_0xd2682f(0x139)]('\x20\x20'+_0xe6148['details']),console['log'](_0x31655b['JOyjz'])):console[_0xd2682f(0x139)](_0x31655b[_0xd2682f(0x141)]);console['log'](_0x31655b[_0xd2682f(0x126)]);const _0x300893=await getPluginInfo(_0xd2682f(0xf9));if(_0x300893){const _0xf8cdc8=_0x300893[_0xd2682f(0xf5)]||_0x31655b['YxxwV'],_0x120ddc=_0x300893[_0xd2682f(0x132)]?_0xd2682f(0x132):_0xd2682f(0xff);console['log']('\x20\x20'+bold(_0xd2682f(0xf9))+_0xd2682f(0x138)+_0xf8cdc8+',\x20'+_0x120ddc+')');}else console['log'](_0x31655b['tGHZP']),console[_0xd2682f(0x139)](_0xd2682f(0x114));console[_0xd2682f(0x139)](_0x31655b['Sazrl']);const {project:_0xb10494,user:_0x229cd8}=await getInstalledSkills(),_0x9cb307=_0xb10494[_0xd2682f(0x12f)](_0x18bcbb=>RANGER_MANAGED_SKILLS[_0xd2682f(0x105)](_0x18bcbb[_0xd2682f(0x150)])),_0x1785de=_0x229cd8[_0xd2682f(0x12f)](_0x50cb7f=>RANGER_MANAGED_SKILLS[_0xd2682f(0x105)](_0x50cb7f[_0xd2682f(0x150)])),_0x1428eb=_0x31655b['gciEy'](_0x9cb307[_0xd2682f(0xf8)],_0x1785de[_0xd2682f(0xf8)]);if(_0x31655b['KdKdi'](_0x1428eb,0x0))console['log']('No\x20skills\x20installed'),console['log'](_0xd2682f(0x12e));else{if(_0x9cb307[_0xd2682f(0xf8)]>0x0){console['log'](_0xd2682f(0x12c));for(const _0x1efea3 of _0x9cb307){console['log'](_0xd2682f(0x10d)+bold(_0x1efea3['displayName'])+':\x20'+_0x31655b[_0xd2682f(0x106)](link,_0x1efea3[_0xd2682f(0xfb)],basename(_0x1efea3[_0xd2682f(0xfb)])));}}if(_0x31655b['qoaeg'](_0x1785de[_0xd2682f(0xf8)],0x0)){console[_0xd2682f(0x139)]('\x20\x20User-level:');for(const _0x422ac5 of _0x1785de){console[_0xd2682f(0x139)]('\x20\x20\x20\x20'+_0x31655b['VSzFL'](bold,_0x422ac5[_0xd2682f(0x13d)])+':\x20'+link(_0x422ac5['path'],basename(_0x422ac5['path'])));}}}console['log'](_0x31655b[_0xd2682f(0xf3)]);const {envs:_0x4d3a2c,activeEnv:_0x1ede43}=await _0x31655b['CxOEh'](getEnvironments);let _0x235c65=[];if(_0x480c38)try{_0x235c65=await _0x31655b['yqlfC'](listCloudProfiles);}catch{}const _0x2dabee=_0x31655b['rZXRg'](_0x4d3a2c[_0xd2682f(0xf8)],_0x235c65[_0xd2682f(0xf8)]);if(_0x31655b['KdKdi'](_0x2dabee,0x0))console[_0xd2682f(0x139)](_0xd2682f(0xed)),console[_0xd2682f(0x139)](_0xd2682f(0x117));else{if(_0x31655b['RtAAn'](_0x2dabee,0x5)){const _0xb77f09=[];_0x235c65['length']>0x0&&_0xb77f09['push'](_0x235c65['length']+'\x20cloud'),_0x31655b['IAtaM'](_0x4d3a2c['length'],0x0)&&_0xb77f09[_0xd2682f(0x14c)](_0x4d3a2c['length']+_0xd2682f(0x12d)),console[_0xd2682f(0x139)](_0x2dabee+'\x20profiles\x20configured\x20('+_0xb77f09[_0xd2682f(0x129)](',\x20')+')'),_0x1ede43&&console['log']('\x20\x20Active:\x20'+bold(_0x1ede43)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x227afc of _0x235c65){const _0x60e761=_0x227afc['name']===_0x1ede43?'\x20(active)':'';console[_0xd2682f(0x139)]('\x20\x20'+bold(_0x227afc[_0xd2682f(0x150)])+'\x20[cloud]'+_0x60e761);const _0x5b6b06=_0x227afc['sessionUpdatedAt']?_0xd2682f(0x13c)+_0x227afc['sessionUpdatedAt']+')':_0xd2682f(0x118);console['log'](_0xd2682f(0xe6)+_0x5b6b06);}const _0x7e9a43=new Set(_0x235c65[_0xd2682f(0x101)](_0x44f5dc=>_0x44f5dc[_0xd2682f(0x150)]));for(const _0x25b987 of _0x4d3a2c){if(_0x7e9a43[_0xd2682f(0x11c)](_0x25b987['name']))continue;const _0x48842d=_0x25b987[_0xd2682f(0x12a)]?_0x31655b[_0xd2682f(0x116)]:'',_0x45666d=_0x25b987[_0xd2682f(0x112)]?'encrypted':_0x25b987[_0xd2682f(0x13e)]?'plaintext':'none';console['log']('\x20\x20'+_0x31655b['rwpEk'](bold,_0x25b987[_0xd2682f(0x150)])+'\x20[local]'+_0x48842d),console[_0xd2682f(0x139)](_0xd2682f(0x125)+_0x45666d),_0x25b987[_0xd2682f(0xeb)]!==_0x31655b['fgfZI']&&console['log'](_0xd2682f(0x142)+_0x31655b[_0xd2682f(0x106)](link,_0x25b987['settingsPath'],basename(_0x25b987[_0xd2682f(0xeb)])));}if(!_0x1ede43){console['log'](_0xd2682f(0x10f));const _0x36a968=[..._0x235c65['map'](_0x5c063b=>_0x5c063b[_0xd2682f(0x150)]),..._0x4d3a2c[_0xd2682f(0x12f)](_0xb7e5b6=>!_0x7e9a43[_0xd2682f(0x11c)](_0xb7e5b6['name']))['map'](_0x243a7e=>_0x243a7e[_0xd2682f(0x150)])];console['log'](_0xd2682f(0xfd)+_0x36a968['join'](',\x20')+')');}}}console[_0xd2682f(0x139)]('');}
|