@ranger-testing/ranger-cli 3.1.6 → 3.1.7-alpha.62f152a-54

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.
Files changed (86) hide show
  1. package/build/cli.js +1 -1
  2. package/build/commands/addEnv.js +1 -1
  3. package/build/commands/authEncrypt.js +1 -1
  4. package/build/commands/clean.js +1 -1
  5. package/build/commands/config.js +1 -1
  6. package/build/commands/deleteProfile.js +1 -1
  7. package/build/commands/env.js +1 -1
  8. package/build/commands/feature.js +1 -1
  9. package/build/commands/hook.js +1 -1
  10. package/build/commands/hooks/autoPrompt.js +1 -1
  11. package/build/commands/hooks/disable.js +1 -1
  12. package/build/commands/hooks/enable.js +1 -1
  13. package/build/commands/hooks/exitPlanMode.js +1 -1
  14. package/build/commands/hooks/index.js +1 -1
  15. package/build/commands/hooks/output.js +1 -1
  16. package/build/commands/hooks/planReminder.js +1 -1
  17. package/build/commands/hooks/planStart.js +1 -1
  18. package/build/commands/hooks/postEdit.js +1 -1
  19. package/build/commands/hooks/preCompact.js +1 -1
  20. package/build/commands/hooks/sessionEnd.js +1 -1
  21. package/build/commands/hooks/sessionStart.js +1 -1
  22. package/build/commands/hooks/stopHook.js +1 -1
  23. package/build/commands/index.js +1 -1
  24. package/build/commands/login.js +1 -1
  25. package/build/commands/mcpBootstrap.js +1 -1
  26. package/build/commands/migrateProfile.js +1 -1
  27. package/build/commands/setup/claude.js +1 -1
  28. package/build/commands/setup/opencode.js +1 -1
  29. package/build/commands/setupCi.js +1 -1
  30. package/build/commands/skillup.js +1 -1
  31. package/build/commands/start.js +1 -1
  32. package/build/commands/status.js +1 -1
  33. package/build/commands/update.js +1 -1
  34. package/build/commands/updateEnv.js +1 -1
  35. package/build/commands/useEnv.js +1 -1
  36. package/build/commands/utils/activeProfile.js +1 -1
  37. package/build/commands/utils/agentEnv.js +1 -1
  38. package/build/commands/utils/browserSessionsApi.js +1 -1
  39. package/build/commands/utils/claudeConfig.js +1 -1
  40. package/build/commands/utils/claudeOverrideSettings.js +1 -1
  41. package/build/commands/utils/claudePlugin.js +1 -1
  42. package/build/commands/utils/cloudProfile.js +1 -1
  43. package/build/commands/utils/cloudProfileSession.js +1 -1
  44. package/build/commands/utils/crypto.js +1 -1
  45. package/build/commands/utils/desirePathLog.js +1 -1
  46. package/build/commands/utils/deviceAuth.js +1 -1
  47. package/build/commands/utils/environment.js +1 -1
  48. package/build/commands/utils/featureApi.js +1 -1
  49. package/build/commands/utils/fixWebmDuration.js +1 -1
  50. package/build/commands/utils/gitTracked.js +1 -1
  51. package/build/commands/utils/keychain.js +1 -1
  52. package/build/commands/utils/legacyWarning.js +1 -1
  53. package/build/commands/utils/localAgentInstallationsApi.js +1 -1
  54. package/build/commands/utils/matchAuthEnvironment.js +1 -1
  55. package/build/commands/utils/mcpImageBase64.js +1 -1
  56. package/build/commands/utils/model.js +1 -1
  57. package/build/commands/utils/novaActCli.js +1 -1
  58. package/build/commands/utils/opencodeConfig.js +1 -1
  59. package/build/commands/utils/organizationEnvApi.js +1 -1
  60. package/build/commands/utils/playwrightCli.js +1 -1
  61. package/build/commands/utils/profileMessages.js +1 -1
  62. package/build/commands/utils/profileSetupBanner.js +1 -1
  63. package/build/commands/utils/projectsConfig.js +1 -1
  64. package/build/commands/utils/rangerConfig.js +1 -1
  65. package/build/commands/utils/rangerRoot.js +1 -1
  66. package/build/commands/utils/rangerwrightCli.js +1 -1
  67. package/build/commands/utils/resolveProfileContext.js +1 -1
  68. package/build/commands/utils/resolveProfileUrl.js +1 -1
  69. package/build/commands/utils/retry.js +1 -1
  70. package/build/commands/utils/scenarioOriginCheck.js +1 -1
  71. package/build/commands/utils/sessionCache.js +1 -1
  72. package/build/commands/utils/settings.js +1 -1
  73. package/build/commands/utils/skillContent.js +1 -1
  74. package/build/commands/utils/skills.js +1 -1
  75. package/build/commands/utils/stitchWebmFiles.js +1 -1
  76. package/build/commands/utils/telemetry.js +1 -1
  77. package/build/commands/utils/tokenRefresh.js +1 -1
  78. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  79. package/build/commands/utils/tunnelClient.js +1 -1
  80. package/build/commands/utils/userApi.js +1 -1
  81. package/build/commands/utils/version.js +1 -1
  82. package/build/commands/verifyFeature.js +1 -1
  83. package/build/commands/verifyFeatureCli.js +1 -1
  84. package/build/commands/verifyFeatureNovaCli.js +1 -1
  85. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  86. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x433a46,_0x448c4c){const _0x37b005=_0x8e48,_0x2045b9=_0x433a46();while(!![]){try{const _0x5a89c1=-parseInt(_0x37b005(0x1b1))/0x1*(-parseInt(_0x37b005(0x1be))/0x2)+parseInt(_0x37b005(0x1b7))/0x3*(-parseInt(_0x37b005(0x1bb))/0x4)+-parseInt(_0x37b005(0x1ba))/0x5*(-parseInt(_0x37b005(0x1b2))/0x6)+-parseInt(_0x37b005(0x1af))/0x7+parseInt(_0x37b005(0x1b9))/0x8+-parseInt(_0x37b005(0x1bf))/0x9*(parseInt(_0x37b005(0x1bd))/0xa)+-parseInt(_0x37b005(0x1ae))/0xb*(-parseInt(_0x37b005(0x1b3))/0xc);if(_0x5a89c1===_0x448c4c)break;else _0x2045b9['push'](_0x2045b9['shift']());}catch(_0x1eaf4b){_0x2045b9['push'](_0x2045b9['shift']());}}}(_0x3398,0xc0280));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';function _0x3398(){const _0x2f4bfe=['126DtMNcH','11gSHydR','7500283VXeRWD','\x0a✅\x20API\x20key\x20stored\x20successfully','452947vdAAvE','306DydDzA','20809608qCXdvf','Re-authenticating\x20via\x20MCP\x20bootstrap...','message','wEXtw','3swuxuB','TBrbh','5079160qNhOck','8185AoHBNv','1457912iAFzRU','log','487460gZeaBr','2tyrJUe'];_0x3398=function(){return _0x2f4bfe;};return _0x3398();}import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';function _0x8e48(_0x1480eb,_0x14459e){_0x1480eb=_0x1480eb-0x1ae;const _0x3398ed=_0x3398();let _0x8e48bc=_0x3398ed[_0x1480eb];return _0x8e48bc;}export async function login(){const _0xc2236=_0x8e48,_0x5141ee={'TBrbh':'Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','wEXtw':function(_0x3fdc80){return _0x3fdc80();},'NhumB':function(_0x7515f8,_0x2df454){return _0x7515f8 instanceof _0x2df454;}},_0x400448=await getMcpAuthOrigin();if(_0x400448){console[_0xc2236(0x1bc)](_0xc2236(0x1b4)),await mcpBootstrap();return;}if(!isInteractive())throw new Error(_0x5141ee[_0xc2236(0x1b8)]);try{const _0x2657d2=await _0x5141ee[_0xc2236(0x1b6)](runDeviceAuthFlow),_0x492cdb=await getCurrentUser(_0x2657d2);_0x492cdb['success']?console['log']('\x0a✅\x20Logged\x20in\x20to\x20'+_0x492cdb['user']['organizationName']):console[_0xc2236(0x1bc)](_0xc2236(0x1b0));}catch(_0x5352b2){throw new Error('Login\x20failed:\x20'+(_0x5141ee['NhumB'](_0x5352b2,Error)?_0x5352b2[_0xc2236(0x1b5)]:_0x5352b2));}}
1
+ (function(_0x531f09,_0x4c1497){const _0x1325c4=_0x46a5,_0x471818=_0x531f09();while(!![]){try{const _0x588ac7=parseInt(_0x1325c4(0x18d))/0x1+-parseInt(_0x1325c4(0x18f))/0x2*(parseInt(_0x1325c4(0x189))/0x3)+parseInt(_0x1325c4(0x195))/0x4*(parseInt(_0x1325c4(0x190))/0x5)+parseInt(_0x1325c4(0x18b))/0x6*(parseInt(_0x1325c4(0x196))/0x7)+parseInt(_0x1325c4(0x186))/0x8*(-parseInt(_0x1325c4(0x18c))/0x9)+-parseInt(_0x1325c4(0x185))/0xa+parseInt(_0x1325c4(0x194))/0xb;if(_0x588ac7===_0x4c1497)break;else _0x471818['push'](_0x471818['shift']());}catch(_0x477e03){_0x471818['push'](_0x471818['shift']());}}}(_0x323c,0x61a0c));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';function _0x46a5(_0x19a6b6,_0x49b0b0){_0x19a6b6=_0x19a6b6-0x185;const _0x323cf5=_0x323c();let _0x46a538=_0x323cf5[_0x19a6b6];return _0x46a538;}export async function login(){const _0x5b9811=_0x46a5,_0x1b460a={'Pwwvx':'Re-authenticating\x20via\x20MCP\x20bootstrap...','Bgblw':function(_0x2d6189){return _0x2d6189();},'dzQpD':_0x5b9811(0x198),'wbAcl':_0x5b9811(0x19a)},_0x5c857b=await getMcpAuthOrigin();if(_0x5c857b){console['log'](_0x1b460a[_0x5b9811(0x192)]),await mcpBootstrap();return;}if(!_0x1b460a[_0x5b9811(0x191)](isInteractive))throw new Error(_0x1b460a[_0x5b9811(0x18e)]);try{const _0x3a146a=await runDeviceAuthFlow(),_0x2fadb5=await getCurrentUser(_0x3a146a);_0x2fadb5['success']?console[_0x5b9811(0x188)]('\x0a✅\x20Logged\x20in\x20to\x20'+_0x2fadb5[_0x5b9811(0x197)][_0x5b9811(0x18a)]):console['log'](_0x1b460a[_0x5b9811(0x199)]);}catch(_0x2b6752){throw new Error(_0x5b9811(0x187)+(_0x2b6752 instanceof Error?_0x2b6752[_0x5b9811(0x193)]:_0x2b6752));}}function _0x323c(){const _0x5d0d66=['72GDEMSA','486384WWIoMq','dzQpD','177530iMNeBS','231705uIXdzE','Bgblw','Pwwvx','message','4245164bcmGDd','28SCgtVL','1961309OXlOQI','user','Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','wbAcl','\x0a✅\x20API\x20key\x20stored\x20successfully','6772260YlqOOi','44712pWPiMZ','Login\x20failed:\x20','log','12VxYPwm','organizationName','6MzPESX'];_0x323c=function(){return _0x5d0d66;};return _0x323c();}
@@ -1 +1 @@
1
- const _0x495f8d=_0x4ef2;(function(_0x10e316,_0xe7487e){const _0x739611=_0x4ef2,_0x495b63=_0x10e316();while(!![]){try{const _0x29e0f2=-parseInt(_0x739611(0x1df))/0x1+parseInt(_0x739611(0x21a))/0x2+-parseInt(_0x739611(0x1b5))/0x3+-parseInt(_0x739611(0x1d8))/0x4*(parseInt(_0x739611(0x1f5))/0x5)+-parseInt(_0x739611(0x23f))/0x6+-parseInt(_0x739611(0x1eb))/0x7*(parseInt(_0x739611(0x1d3))/0x8)+-parseInt(_0x739611(0x226))/0x9*(-parseInt(_0x739611(0x207))/0xa);if(_0x29e0f2===_0xe7487e)break;else _0x495b63['push'](_0x495b63['shift']());}catch(_0x3447aa){_0x495b63['push'](_0x495b63['shift']());}}}(_0x353f,0x96b73));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(),_0x495f8d(0x1e0),'mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x495f8d(0x1fa));export async function getMcpAuthOrigin(){const _0xcdfddc=_0x495f8d,_0x3dc4f0={'VbXtN':function(_0x291734,_0x4e40fa,_0x47c696){return _0x291734(_0x4e40fa,_0x47c696);},'xiNdf':_0xcdfddc(0x20a),'bBgnm':function(_0x2d6b0a,_0x576683){return _0x2d6b0a||_0x576683;}};try{const _0x10b900=(await _0x3dc4f0['VbXtN'](readFile,AUTH_ORIGIN_PATH,_0x3dc4f0['xiNdf']))['trim']();return _0x3dc4f0['bBgnm'](_0x10b900,null);}catch{return null;}}export async function mcpBootstrap(){const _0x14356b=_0x495f8d,_0x36342b={'MEBgv':function(_0x34765e){return _0x34765e();},'wOelU':function(_0x151dd1,_0x11db9a){return _0x151dd1(_0x11db9a);},'LfznC':function(_0x519ec5){return _0x519ec5();}},_0xe9ab62=_0x36342b[_0x14356b(0x23e)](getMcpAuthUrl);currentOrigin=_0xe9ab62;const _0x236aa6=process[_0x14356b(0x22c)][_0x14356b(0x1de)]??![];console[_0x14356b(0x1ab)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0xe9ab62+'\x0a');const _0x3cdc71=await _0x36342b[_0x14356b(0x216)](tryUnauthenticated,_0xe9ab62);let _0x3c6b23=null;if(_0x3cdc71===_0x14356b(0x1af))_0x3c6b23='';else{_0x3c6b23=await _0x36342b[_0x14356b(0x1b9)](loadCachedToken);if(!_0x3c6b23){if(!_0x236aa6)throw new Error(_0x14356b(0x1d6)+'Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.');_0x3c6b23=await oauthFlow(_0xe9ab62);}}await callGetCliToken(_0xe9ab62,_0x3c6b23);}async function tryUnauthenticated(_0x4518d4){const _0x264b7f=_0x495f8d,_0x51ecab={'IWYJN':function(_0x10fc91,_0x5cec57,_0x55b91d){return _0x10fc91(_0x5cec57,_0x55b91d);},'UMyNW':_0x264b7f(0x24d),'LMYHU':_0x264b7f(0x1d9),'WuFGR':'initialize','BoOIk':_0x264b7f(0x245),'EfJWB':_0x264b7f(0x1c2),'WdvKB':'1.0.0','XsFjZ':function(_0x136b19,_0x5080ef){return _0x136b19===_0x5080ef;}},_0x361634=await _0x51ecab[_0x264b7f(0x1d1)](fetch,_0x4518d4,{'method':_0x51ecab[_0x264b7f(0x248)],'headers':{'Content-Type':_0x264b7f(0x204),'Accept':_0x264b7f(0x1b2)},'body':JSON[_0x264b7f(0x213)]({'jsonrpc':_0x51ecab[_0x264b7f(0x200)],'id':0x1,'method':_0x51ecab[_0x264b7f(0x23b)],'params':{'protocolVersion':_0x51ecab[_0x264b7f(0x1d7)],'capabilities':{},'clientInfo':{'name':_0x51ecab['EfJWB'],'version':_0x51ecab[_0x264b7f(0x217)]}}})});if(_0x361634['ok'])return await _0x361634[_0x264b7f(0x1cd)](),_0x264b7f(0x1af);if(_0x51ecab['XsFjZ'](_0x361634[_0x264b7f(0x249)],0x191))return await _0x361634['text'](),_0x264b7f(0x1b1);const _0x25505f=await _0x361634[_0x264b7f(0x1cd)]();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x361634['status']+':\x20'+_0x25505f);}class OAuthTimeoutError extends Error{constructor(_0x812fd8){const _0x2409d4={'odqxI':'OAuthTimeoutError'};super(_0x812fd8),this['name']=_0x2409d4['odqxI'];}}function _0x353f(){const _0x2e246c=['LMYHU','vPVBe','text/html','DifpM','application/json','write','get','10HnQNQE','VPydb','length','utf-8','notifications/initialized','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','OAuth\x20error:\x20','authorization_code','code','ysuly','digest','origin','stringify','iscpn','Exchanging\x20authorization\x20code...','wOelU','WdvKB','VcaeA','error','291190JPQgqr','toString','Authorization','KRXZv','code_challenge','xdg-open','BMitF','twmyY','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','initialize','zbXBA','jIdfr','34759359yqatlJ','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','CyiWz','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','http://localhost:','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','stdout','base64url','Ranger\x20CLI','expires_in','slice','RbJNn','set','jUhAu','NOaEo','code_challenge_method','Geeyo','close','win32','mMWts','/.well-known/oauth-authorization-server','WuFGR','token','type','MEBgv','911280auOAeQ','KDyWM','refresh.txt','/callback','content','client_secret','2025-03-26','XHcKc','Unknown\x20error','UMyNW','status','clientId','trim','structuredContent','POST','clientSecret','aomTe','log','eszfA','accessToken','isError','proxied','vgepr','needs-oauth','application/json,\x20text/event-stream','searchParams','ntuZK','2979132KbgVXU','cKfqN','hJUWP','okDNx','LfznC','vQmIo','MwqzS','\x20done','pathname','fOYDa','SCWtS','writeHead','then','ranger-cli','authorization_servers','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','hrGRJ','redirect_uri','json','startsWith','sha256','registration_endpoint','data:','Zbfso','text','update','ethdY','Discovering\x20authorization\x20server...','IWYJN','OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','4624SmZECq','message','kFCMv','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','BoOIk','8GVBDzp','2.0','S256','XgtgH','HqlFy','ALkoi','isTTY','42309jyeGlF','.ranger','nukXd','darwin','replace','OEDKK','nPsOS','refresh_token','state','UKAdU','resource','open','14798uqYkPI','mUSCc','expiresAt','\x0aOpening\x20browser\x20for\x20authentication...','parse','client_id','split','ediDr','zhAsu','access_token','2453225ojFPzf','SWMvl','authorization_endpoint','end','GZenu','auth-origin.txt','platform','cOviZ','string','text/event-stream','cieJJ'];_0x353f=function(){return _0x2e246c;};return _0x353f();}async function oauthFlow(_0x5e8b20){const _0x10d1a7=_0x495f8d,_0x3074c5={'cKfqN':function(_0x1ddf0f,_0x32360f){return _0x1ddf0f(_0x32360f);},'hJUWP':function(_0x3f70d8,_0x504af2){return _0x3f70d8 instanceof _0x504af2;},'okDNx':function(_0x3b5d3a){return _0x3b5d3a();},'zQkOO':'\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'};try{return await _0x3074c5[_0x10d1a7(0x1b6)](oauthFlowAttempt,_0x5e8b20);}catch(_0x1af280){if(_0x3074c5[_0x10d1a7(0x1b7)](_0x1af280,OAuthTimeoutError)&&await _0x3074c5[_0x10d1a7(0x1b8)](loadCachedClient))return console[_0x10d1a7(0x1ab)](_0x3074c5['zQkOO']),await clearCachedClient(),await _0x3074c5[_0x10d1a7(0x1b6)](oauthFlowAttempt,_0x5e8b20);throw _0x1af280;}}async function oauthFlowAttempt(_0x52393d){const _0x384025=_0x495f8d,_0x177a1d={'tNXGY':function(_0x1a86c6,_0x25e9fd){return _0x1a86c6(_0x25e9fd);},'ysuly':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','CyiWz':function(_0x57268d,_0x5e9e67,_0x3b7763){return _0x57268d(_0x5e9e67,_0x3b7763);},'GAZmJ':_0x384025(0x22e),'Geeyo':_0x384025(0x20e),'nxxHP':_0x384025(0x1c4),'vQmIo':function(_0x1658ae,_0x102cf4){return _0x1658ae(_0x102cf4);},'UcxmF':_0x384025(0x1c9),'mMWts':'hex','NHurO':_0x384025(0x1c6),'DifpM':_0x384025(0x21e),'tHMXw':_0x384025(0x235),'jIdfr':_0x384025(0x1ee),'RswBA':_0x384025(0x215),'zhAsu':_0x384025(0x244),'VieOd':'resource','nPsOS':function(_0x298767,_0x1ac3c9,_0x27b550,_0x15534b){return _0x298767(_0x1ac3c9,_0x27b550,_0x15534b);}},_0xbf3963=_0x52393d[_0x384025(0x1e3)](/\/mcp$/,'');process[_0x384025(0x22c)][_0x384025(0x205)](_0x384025(0x1d0));const _0x30e21c=await _0x177a1d['tNXGY'](fetch,_0xbf3963+'/.well-known/oauth-protected-resource');if(!_0x30e21c['ok'])throw new Error(_0x177a1d[_0x384025(0x210)]);const _0x47eb23=await _0x30e21c[_0x384025(0x1c7)](),_0x467d27=_0x47eb23[_0x384025(0x1c3)]?.[0x0];if(!_0x467d27)throw new Error(_0x384025(0x22b));console[_0x384025(0x1ab)]('\x20'+_0x467d27);const _0x2b84ae=await fetchAuthServerMetadata(_0x467d27);let _0x44f1aa,_0x3ac87c;const _0x304249=await loadCachedClient();if(_0x304249)_0x44f1aa=_0x304249['clientId'],_0x3ac87c=_0x304249[_0x384025(0x24e)];else{if(_0x2b84ae[_0x384025(0x1ca)]){process['stdout'][_0x384025(0x205)]('Registering\x20OAuth\x20client...');const _0x50ca7d=await _0x177a1d['CyiWz'](fetch,_0x2b84ae['registration_endpoint'],{'method':_0x384025(0x24d),'headers':{'Content-Type':_0x384025(0x204)},'body':JSON['stringify']({'client_name':_0x177a1d['GAZmJ'],'redirect_uris':['http://localhost:'+CALLBACK_PORT+'/callback'],'grant_types':[_0x177a1d['Geeyo'],_0x384025(0x1e6)],'response_types':['code'],'token_endpoint_auth_method':'none'})});if(!_0x50ca7d['ok']){const _0x52d0f0=await _0x50ca7d[_0x384025(0x1cd)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x52d0f0);}const _0x27d84a=await _0x50ca7d[_0x384025(0x1c7)]();_0x44f1aa=_0x27d84a[_0x384025(0x1f0)],_0x3ac87c=_0x27d84a['client_secret'],await saveCachedClient(_0x44f1aa,_0x3ac87c),console['log'](_0x384025(0x1bc));}else throw new Error(_0x177a1d['nxxHP']);}const _0x1fada9=randomBytes(0x20)['toString'](_0x384025(0x22d)),_0x5aaab5=_0x177a1d['vQmIo'](createHash,_0x177a1d['UcxmF'])[_0x384025(0x1ce)](_0x1fada9)[_0x384025(0x211)](_0x384025(0x22d)),_0x23511=_0x177a1d['vQmIo'](randomBytes,0x10)[_0x384025(0x21b)](_0x177a1d[_0x384025(0x239)]),_0xc83f2c=new URL(_0x2b84ae[_0x384025(0x1f7)]);_0xc83f2c['searchParams'][_0x384025(0x232)]('response_type',_0x384025(0x20f)),_0xc83f2c[_0x384025(0x1b3)]['set']('client_id',_0x44f1aa),_0xc83f2c['searchParams'][_0x384025(0x232)](_0x177a1d['NHurO'],_0x384025(0x22a)+CALLBACK_PORT+_0x384025(0x242)),_0xc83f2c[_0x384025(0x1b3)][_0x384025(0x232)](_0x177a1d[_0x384025(0x203)],_0x5aaab5),_0xc83f2c['searchParams']['set'](_0x177a1d['tHMXw'],_0x384025(0x1da)),_0xc83f2c['searchParams']['set']('state',_0x23511);_0x47eb23[_0x384025(0x1e9)]&&_0xc83f2c['searchParams'][_0x384025(0x232)]('resource',_0x47eb23[_0x384025(0x1e9)]);console['log'](_0x177a1d[_0x384025(0x225)]),console[_0x384025(0x1ab)]('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0xc83f2c[_0x384025(0x21b)]()+'\x0a'),await openBrowser(_0xc83f2c[_0x384025(0x21b)]());const _0x192cb2=await _0x177a1d[_0x384025(0x1ba)](waitForCallback,_0x23511);process[_0x384025(0x22c)][_0x384025(0x205)](_0x177a1d['RswBA']);const _0x4200a1=new URLSearchParams({'grant_type':_0x177a1d[_0x384025(0x236)],'code':_0x192cb2,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0x384025(0x242),'client_id':_0x44f1aa,'code_verifier':_0x1fada9});_0x3ac87c&&_0x4200a1['set'](_0x177a1d[_0x384025(0x1f3)],_0x3ac87c);_0x47eb23['resource']&&_0x4200a1['set'](_0x177a1d['VieOd'],_0x47eb23['resource']);const _0x508a2b=await _0x177a1d[_0x384025(0x228)](fetch,_0x2b84ae['token_endpoint'],{'method':'POST','headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x4200a1});if(!_0x508a2b['ok']){const _0x1f00b7=await _0x508a2b[_0x384025(0x1cd)]();throw new Error('Token\x20exchange\x20failed:\x20'+_0x1f00b7);}const _0x316747=await _0x508a2b['json']();return console['log'](_0x384025(0x1bc)),await _0x177a1d[_0x384025(0x1e5)](saveCachedToken,_0x316747[_0x384025(0x1f4)],_0x316747['refresh_token'],_0x316747[_0x384025(0x22f)]),_0x316747['access_token'];}async function callGetCliToken(_0x26fd73,_0x4d774c){const _0xaf3bc=_0x495f8d,_0x50ff67={'UKAdU':_0xaf3bc(0x24d),'SWMvl':function(_0x46a6cc,_0x42ed1f){return _0x46a6cc(_0x42ed1f);},'ediDr':'application/json','xgEeC':_0xaf3bc(0x1b2),'rZoKT':function(_0x4ed959,_0x92fa58){return _0x4ed959(_0x92fa58);},'uVndd':_0xaf3bc(0x245),'ntuZK':'ranger-cli','UZBTt':function(_0x5dc148,_0x54995c,_0x2154b4){return _0x5dc148(_0x54995c,_0x2154b4);},'BMitF':'2.0','VPydb':_0xaf3bc(0x20b),'ethdY':'Requesting\x20CLI\x20token...','uJNWY':function(_0x5d87c4,_0x24e93d){return _0x5d87c4(_0x24e93d);},'KRXZv':'tools/call','RbJNn':'\x20done','nukXd':'\x0aUnexpected\x20response\x20structure:','mUSCc':function(_0x24ed18,_0x583ede,_0x1620f8){return _0x24ed18(_0x583ede,_0x1620f8);},'FKRgV':function(_0x53ace2){return _0x53ace2();},'ALkoi':'.ranger','VcaeA':function(_0x433811,_0x3e9f07,_0x34b0a7){return _0x433811(_0x3e9f07,_0x34b0a7);},'vSRxT':_0xaf3bc(0x241),'OEDKK':function(_0x13b11d,_0x47695d,_0x5e035e,_0x1ad044){return _0x13b11d(_0x47695d,_0x5e035e,_0x1ad044);}},_0x2ecf41={'Content-Type':_0x50ff67[_0xaf3bc(0x1f2)],'Accept':_0x50ff67['xgEeC']};_0x4d774c&&(_0x2ecf41[_0xaf3bc(0x21c)]='Bearer\x20'+_0x4d774c);const _0x321dfc=async _0x36e250=>{const _0x18857a=_0xaf3bc,_0x22fc91=await fetch(_0x26fd73,{'method':_0x50ff67['UKAdU'],'headers':_0x2ecf41,'body':JSON[_0x18857a(0x213)](_0x36e250)});if(!_0x22fc91['ok']){const _0x20b930=await _0x22fc91['text']();throw new Error('HTTP\x20'+_0x22fc91[_0x18857a(0x249)]+':\x20'+_0x20b930);}return _0x50ff67['SWMvl'](parseResponse,_0x22fc91);};process[_0xaf3bc(0x22c)][_0xaf3bc(0x205)]('Initializing\x20MCP\x20session...');const _0x1189f0=await _0x50ff67['rZoKT'](_0x321dfc,{'jsonrpc':_0xaf3bc(0x1d9),'id':0x1,'method':_0xaf3bc(0x223),'params':{'protocolVersion':_0x50ff67['uVndd'],'capabilities':{},'clientInfo':{'name':_0x50ff67[_0xaf3bc(0x1b4)],'version':'1.0.0'}}});if(_0x1189f0[_0xaf3bc(0x219)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x1189f0[_0xaf3bc(0x219)]['message']??JSON['stringify'](_0x1189f0[_0xaf3bc(0x219)])));console[_0xaf3bc(0x1ab)](_0xaf3bc(0x1bc)),await _0x50ff67['UZBTt'](fetch,_0x26fd73,{'method':_0x50ff67[_0xaf3bc(0x1e8)],'headers':_0x2ecf41,'body':JSON[_0xaf3bc(0x213)]({'jsonrpc':_0x50ff67[_0xaf3bc(0x220)],'method':_0x50ff67[_0xaf3bc(0x208)]})})[_0xaf3bc(0x1c1)](_0x1671dc=>_0x1671dc['text']()),process[_0xaf3bc(0x22c)][_0xaf3bc(0x205)](_0x50ff67[_0xaf3bc(0x1cf)]);const _0xfcbc0c=await _0x50ff67['uJNWY'](_0x321dfc,{'jsonrpc':_0xaf3bc(0x1d9),'id':0x2,'method':_0x50ff67[_0xaf3bc(0x21d)],'params':{'name':'get_cli_token','arguments':{}}});if(_0xfcbc0c['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0xfcbc0c[_0xaf3bc(0x219)][_0xaf3bc(0x1d4)]??JSON['stringify'](_0xfcbc0c['error'])));console['log'](_0x50ff67[_0xaf3bc(0x231)]);const _0x53eefa=_0x50ff67[_0xaf3bc(0x1f6)](extractToken,_0xfcbc0c['result']);if(!_0x53eefa){console['error'](_0x50ff67[_0xaf3bc(0x1e1)]),console[_0xaf3bc(0x219)](JSON['stringify'](_0xfcbc0c['result'],null,0x2));throw new Error('Could\x20not\x20extract\x20token\x20from\x20MCP\x20response');}const _0x30561a=_0x50ff67[_0xaf3bc(0x1ec)](join,_0x50ff67['FKRgV'](homedir),_0x50ff67[_0xaf3bc(0x1dd)]),_0x1f90b3=_0x50ff67[_0xaf3bc(0x218)](join,_0x30561a,_0x50ff67['vSRxT']);await mkdir(_0x30561a,{'recursive':!![]}),await _0x50ff67[_0xaf3bc(0x1e4)](writeFile,_0x1f90b3,_0x53eefa,{'mode':0x180}),await _0x50ff67[_0xaf3bc(0x1e4)](writeFile,_0x50ff67[_0xaf3bc(0x218)](join,_0x30561a,'auth-origin.txt'),_0x26fd73,{'mode':0x180}),console['log']('\x0aToken\x20written\x20to\x20'+_0x1f90b3),console[_0xaf3bc(0x1ab)](_0xaf3bc(0x229));}async function fetchAuthServerMetadata(_0x1ea59d){const _0x29e1cc=_0x495f8d,_0x30fb39=_0x1ea59d+_0x29e1cc(0x23a),_0x4dc8b5=await fetch(_0x30fb39);if(!_0x4dc8b5['ok'])throw new Error(_0x29e1cc(0x20c)+_0x30fb39+':\x20'+_0x4dc8b5[_0x29e1cc(0x249)]);return _0x4dc8b5[_0x29e1cc(0x1c7)]();}function waitForCallback(_0x9a8c6f){const _0x2da5d4=_0x495f8d,_0x287d3f={'OljZK':function(_0x4db4e8){return _0x4db4e8();},'cOviZ':_0x2da5d4(0x219),'twmyY':_0x2da5d4(0x202),'kzyrY':'127.0.0.1'};return new Promise((_0x5ce257,_0x14a696)=>{const _0xd891f5=_0x2da5d4,_0x599915={'HqlFy':function(_0x304a6b){return _0x287d3f['OljZK'](_0x304a6b);},'KDyWM':'Not\x20found','cCSRL':_0x287d3f[_0xd891f5(0x1fc)],'fOYDa':_0x287d3f[_0xd891f5(0x221)],'GZenu':function(_0x3073bd){return _0x3073bd();},'mzHPI':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','XgtgH':function(_0x44efa7,_0x3e8c74){return _0x44efa7(_0x3e8c74);},'NOaEo':function(_0x53f994,_0x3efe63){return _0x53f994(_0x3efe63);}},_0x520cca=()=>{const _0xd0e5ab=_0xd891f5;_0xd18439['closeAllConnections'](),_0xd18439[_0xd0e5ab(0x237)]();},_0x48cfb7=setTimeout(()=>{const _0x1b1a93=_0xd891f5;_0x599915[_0x1b1a93(0x1dc)](_0x520cca),_0x14a696(new OAuthTimeoutError(_0x1b1a93(0x1d2)));},0x1d4c0),_0xd18439=createServer((_0x89dc8b,_0x35c1e3)=>{const _0x5929a3=_0xd891f5,_0x252a2c=new URL(_0x89dc8b['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x252a2c[_0x5929a3(0x1bd)]!=='/callback'){_0x35c1e3['writeHead'](0x194),_0x35c1e3['end'](_0x599915[_0x5929a3(0x240)]);return;}const _0xb2cf8f=_0x252a2c[_0x5929a3(0x1b3)]['get'](_0x5929a3(0x20f)),_0x511b4c=_0x252a2c[_0x5929a3(0x1b3)]['get'](_0x5929a3(0x1e7)),_0x455cc5=_0x252a2c[_0x5929a3(0x1b3)]['get'](_0x599915['cCSRL']);if(_0x455cc5){const _0x39cd8b=_0x252a2c[_0x5929a3(0x1b3)][_0x5929a3(0x206)]('error_description')??_0x455cc5;_0x35c1e3[_0x5929a3(0x1c0)](0xc8,{'Content-Type':_0x599915['fOYDa']}),_0x35c1e3[_0x5929a3(0x1f8)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x39cd8b+_0x5929a3(0x222)),clearTimeout(_0x48cfb7),_0x599915[_0x5929a3(0x1f9)](_0x520cca),_0x14a696(new Error(_0x5929a3(0x20d)+_0x39cd8b));return;}if(!_0xb2cf8f||_0x511b4c!==_0x9a8c6f){_0x35c1e3[_0x5929a3(0x1c0)](0x190,{'Content-Type':_0x599915['fOYDa']}),_0x35c1e3[_0x5929a3(0x1f8)](_0x5929a3(0x227));return;}_0x35c1e3[_0x5929a3(0x1c0)](0xc8,{'Content-Type':_0x599915[_0x5929a3(0x1be)]}),_0x35c1e3['end'](_0x599915['mzHPI']),_0x599915[_0x5929a3(0x1db)](clearTimeout,_0x48cfb7),_0x520cca(),_0x599915[_0x5929a3(0x234)](_0x5ce257,_0xb2cf8f);});_0xd18439['listen'](CALLBACK_PORT,_0x287d3f['kzyrY']);});}async function openBrowser(_0x514ebc){const _0x207bb9=_0x495f8d,_0x1b98a4={'iscpn':_0x207bb9(0x1e2),'jUhAu':_0x207bb9(0x1ea),'jqPnO':_0x207bb9(0x238),'cFayV':'start','pXXqq':_0x207bb9(0x21f),'zbXBA':function(_0x5eb968,_0x5dac45){return _0x5eb968(_0x5dac45);}},_0x111788=process[_0x207bb9(0x1fb)]===_0x1b98a4[_0x207bb9(0x214)]?_0x1b98a4[_0x207bb9(0x233)]:process[_0x207bb9(0x1fb)]===_0x1b98a4['jqPnO']?_0x1b98a4['cFayV']:_0x1b98a4['pXXqq'];_0x1b98a4[_0x207bb9(0x224)](exec,_0x111788+'\x20\x22'+_0x514ebc+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x2fd163=_0x495f8d,_0x39a5fa={'vPVBe':function(_0x5aa45b,_0x4e6822){return _0x5aa45b!==_0x4e6822;},'Gxtlg':function(_0x106c49,_0x2edcdd){return _0x106c49>_0x2edcdd;}};try{const _0x54e4a5=JSON['parse'](await readFile(TOKEN_CACHE_PATH,'utf-8'));if(_0x54e4a5['origin']&&_0x39a5fa[_0x2fd163(0x201)](_0x54e4a5[_0x2fd163(0x212)],currentOrigin))return null;if(_0x54e4a5[_0x2fd163(0x1ed)]&&_0x39a5fa['Gxtlg'](Date['now'](),_0x54e4a5['expiresAt']))return null;return _0x54e4a5[_0x2fd163(0x1ad)]??null;}catch{return null;}}async function saveCachedToken(_0x25c1f,_0x3e3374,_0xabfeb9){const _0x12aa62=_0x495f8d,_0x6d0a02={'hrGRJ':function(_0x57d27a,_0x58da11,_0x2c66c9){return _0x57d27a(_0x58da11,_0x2c66c9);},'JLiBS':function(_0x52f633,_0x322c70,_0x20f98d,_0x26be50){return _0x52f633(_0x322c70,_0x20f98d,_0x26be50);}},_0x17b9e6=await loadCachedData(),_0x5e354c={..._0x17b9e6,'origin':currentOrigin,'accessToken':_0x25c1f,'refreshToken':_0x3e3374??_0x17b9e6?.['refreshToken'],'expiresAt':_0xabfeb9?Date['now']()+_0xabfeb9*0x3e8:undefined};await _0x6d0a02[_0x12aa62(0x1c5)](mkdir,join(homedir(),'.ranger'),{'recursive':!![]}),await _0x6d0a02['JLiBS'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x5e354c),{'mode':0x180});}async function loadCachedClient(){const _0xf34d33=_0x495f8d,_0x234bdf={'kFCMv':function(_0x3db8fc,_0x29eca3){return _0x3db8fc!==_0x29eca3;}},_0x5b2043=await loadCachedData();if(_0x5b2043?.[_0xf34d33(0x212)]&&_0x234bdf[_0xf34d33(0x1d5)](_0x5b2043['origin'],currentOrigin))return null;return _0x5b2043?.['clientId']?{'clientId':_0x5b2043[_0xf34d33(0x24a)],'clientSecret':_0x5b2043['clientSecret']}:null;}async function clearCachedClient(){const _0x5267d4=_0x495f8d,_0x5e7d40={'eszfA':function(_0x14bb85,_0x155f1d,_0xc09650,_0x558977){return _0x14bb85(_0x155f1d,_0xc09650,_0x558977);}},_0x4aeb59=await loadCachedData();if(!_0x4aeb59)return;const {clientId:_0x5ccb9b,clientSecret:_0x1ddd62,..._0x162bab}=_0x4aeb59;await _0x5e7d40[_0x5267d4(0x1ac)](writeFile,TOKEN_CACHE_PATH,JSON[_0x5267d4(0x213)](_0x162bab),{'mode':0x180});}async function saveCachedClient(_0x1365b4,_0x42ad49){const _0x55d85e=_0x495f8d,_0x274215={'aomTe':function(_0x49367f){return _0x49367f();},'Zbfso':function(_0x42c91f,_0x28f61e,_0x1ae0e0){return _0x42c91f(_0x28f61e,_0x1ae0e0);},'naUzB':function(_0x229e90){return _0x229e90();},'cieJJ':'.ranger','XHcKc':function(_0x47c393,_0x3125ca,_0x34a57b,_0xd90f63){return _0x47c393(_0x3125ca,_0x34a57b,_0xd90f63);}},_0x37c54d=await _0x274215[_0x55d85e(0x24f)](loadCachedData),_0x5e51ba={..._0x37c54d,'origin':currentOrigin,'accessToken':_0x37c54d?.[_0x55d85e(0x1ad)]??'','clientId':_0x1365b4,'clientSecret':_0x42ad49};await _0x274215[_0x55d85e(0x1cc)](mkdir,join(_0x274215['naUzB'](homedir),_0x274215[_0x55d85e(0x1ff)]),{'recursive':!![]}),await _0x274215[_0x55d85e(0x246)](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x5e51ba),{'mode':0x180});}function _0x4ef2(_0x127b6f,_0x28af85){_0x127b6f=_0x127b6f-0x1ab;const _0x353fc9=_0x353f();let _0x4ef273=_0x353fc9[_0x127b6f];return _0x4ef273;}async function loadCachedData(){const _0x440905=_0x495f8d,_0x3422c3={'BWAtC':_0x440905(0x20a)};try{return JSON[_0x440905(0x1ef)](await readFile(TOKEN_CACHE_PATH,_0x3422c3['BWAtC']));}catch{return null;}}async function parseResponse(_0x210757){const _0x155efe=_0x495f8d,_0x8f9ef0={'nCsED':_0x155efe(0x1fe),'vgepr':function(_0xecbb6e,_0x3bc19c){return _0xecbb6e!==_0x3bc19c;},'MwqzS':'No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream'},_0xdbc8=_0x210757['headers']['get']('content-type')??'';if(_0xdbc8['includes'](_0x8f9ef0['nCsED'])){const _0x1477e7=await _0x210757['text']();for(const _0x489f43 of _0x1477e7[_0x155efe(0x1f1)]('\x0a')){const _0x5362de=_0x489f43[_0x155efe(0x24b)]();if(_0x5362de[_0x155efe(0x1c8)](_0x155efe(0x1cb))){const _0x3ac38f=_0x5362de[_0x155efe(0x230)]('data:'[_0x155efe(0x209)])[_0x155efe(0x24b)]();if(!_0x3ac38f)continue;try{const _0x176bc5=JSON['parse'](_0x3ac38f);if(_0x8f9ef0[_0x155efe(0x1b0)](_0x176bc5['id'],undefined)||_0x176bc5['error'])return _0x176bc5;}catch{}}}throw new Error(_0x8f9ef0[_0x155efe(0x1bb)]);}return _0x210757['json']();}function extractToken(_0x5d86f8){const _0x4e9fca=_0x495f8d,_0x4b45cc={'SCWtS':function(_0x2fd586,_0x4aa6ba){return _0x2fd586===_0x4aa6ba;},'FStGY':'string','OVEDR':_0x4e9fca(0x247)};if(!_0x5d86f8)return null;const _0x1579da=_0x5d86f8[_0x4e9fca(0x24c)];if(_0x1579da?.[_0x4e9fca(0x23c)]&&_0x4b45cc['SCWtS'](typeof _0x1579da['token'],_0x4b45cc['FStGY']))return _0x1579da['token'];if(_0x5d86f8[_0x4e9fca(0x1ae)]){const _0x2768b=_0x5d86f8[_0x4e9fca(0x243)];throw new Error('Server\x20returned\x20error:\x20'+(_0x2768b?.[0x0]?.['text']??_0x4b45cc['OVEDR']));}const _0x38cf70=_0x5d86f8['content'];if(_0x38cf70)for(const _0x1509b7 of _0x38cf70){if(_0x4b45cc[_0x4e9fca(0x1bf)](_0x1509b7[_0x4e9fca(0x23d)],_0x4e9fca(0x1cd))&&_0x1509b7[_0x4e9fca(0x1cd)]){try{const _0x382d54=JSON[_0x4e9fca(0x1ef)](_0x1509b7[_0x4e9fca(0x1cd)]);if(typeof _0x382d54?.['token']===_0x4e9fca(0x1fd))return _0x382d54[_0x4e9fca(0x23c)];}catch{}const _0x5f589f=_0x1509b7['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x5f589f)return _0x5f589f[0x1];}}return null;}
1
+ const _0x1cff32=_0x47ab;(function(_0x2f6425,_0x4c0ff5){const _0x389f97=_0x47ab,_0x317ee1=_0x2f6425();while(!![]){try{const _0x2bd3cd=-parseInt(_0x389f97(0x173))/0x1*(-parseInt(_0x389f97(0x125))/0x2)+-parseInt(_0x389f97(0x114))/0x3+parseInt(_0x389f97(0x174))/0x4*(-parseInt(_0x389f97(0x105))/0x5)+parseInt(_0x389f97(0x10f))/0x6*(parseInt(_0x389f97(0x12e))/0x7)+-parseInt(_0x389f97(0x10a))/0x8+parseInt(_0x389f97(0x189))/0x9*(-parseInt(_0x389f97(0x158))/0xa)+parseInt(_0x389f97(0x14d))/0xb*(parseInt(_0x389f97(0x107))/0xc);if(_0x2bd3cd===_0x4c0ff5)break;else _0x317ee1['push'](_0x317ee1['shift']());}catch(_0x280b4a){_0x317ee1['push'](_0x317ee1['shift']());}}}(_0x1aee,0x69afa));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(),_0x1cff32(0x166),_0x1cff32(0x102)),AUTH_ORIGIN_PATH=join(homedir(),_0x1cff32(0x166),'auth-origin.txt');export async function getMcpAuthOrigin(){const _0x2f4ea5=_0x1cff32,_0x1bfa59={'yDKwN':function(_0x1fa9db,_0x3d0f18,_0x257167){return _0x1fa9db(_0x3d0f18,_0x257167);}};try{const _0x232cbc=(await _0x1bfa59[_0x2f4ea5(0x17e)](readFile,AUTH_ORIGIN_PATH,'utf-8'))['trim']();return _0x232cbc||null;}catch{return null;}}export async function mcpBootstrap(){const _0x107141=_0x1cff32,_0x4a8466={'NjLlk':function(_0x58ddf6,_0x9a8479){return _0x58ddf6(_0x9a8479);},'hAwJc':function(_0x1772fc){return _0x1772fc();},'rhTCH':function(_0x3ead75,_0xb12370){return _0x3ead75(_0xb12370);}},_0x32302d=getMcpAuthUrl();currentOrigin=_0x32302d;const _0x3a6246=process['stdout'][_0x107141(0x187)]??![];console[_0x107141(0x116)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x32302d+'\x0a');const _0x4a7a4a=await _0x4a8466[_0x107141(0x164)](tryUnauthenticated,_0x32302d);let _0x323b22=null;if(_0x4a7a4a===_0x107141(0x17c))_0x323b22='';else{_0x323b22=await _0x4a8466[_0x107141(0x18c)](loadCachedToken);if(!_0x323b22){if(!_0x3a6246)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x107141(0x11d));_0x323b22=await _0x4a8466['rhTCH'](oauthFlow,_0x32302d);}}await callGetCliToken(_0x32302d,_0x323b22);}async function tryUnauthenticated(_0x6f0189){const _0x3b57a0=_0x1cff32,_0x3c07eb={'VhGUa':function(_0x497e7d,_0x46bec1,_0x37c16b){return _0x497e7d(_0x46bec1,_0x37c16b);},'uwQRI':'POST','eWMEe':_0x3b57a0(0x108),'jqKAA':_0x3b57a0(0x130),'TUMBT':'2025-03-26','dJjNs':_0x3b57a0(0x145),'dsWAo':'1.0.0','YPZcE':function(_0x200d05,_0x2788e5){return _0x200d05===_0x2788e5;},'qCeMI':'needs-oauth'},_0x51f695=await _0x3c07eb[_0x3b57a0(0x163)](fetch,_0x6f0189,{'method':_0x3c07eb['uwQRI'],'headers':{'Content-Type':'application/json','Accept':_0x3c07eb[_0x3b57a0(0x123)]},'body':JSON['stringify']({'jsonrpc':_0x3c07eb[_0x3b57a0(0x16f)],'id':0x1,'method':_0x3b57a0(0x18b),'params':{'protocolVersion':_0x3c07eb['TUMBT'],'capabilities':{},'clientInfo':{'name':_0x3c07eb[_0x3b57a0(0x100)],'version':_0x3c07eb['dsWAo']}}})});if(_0x51f695['ok'])return await _0x51f695[_0x3b57a0(0x157)](),_0x3b57a0(0x17c);if(_0x3c07eb[_0x3b57a0(0x133)](_0x51f695['status'],0x191))return await _0x51f695['text'](),_0x3c07eb['qCeMI'];const _0x2bf797=await _0x51f695[_0x3b57a0(0x157)]();throw new Error('MCP\x20server\x20returned\x20HTTP\x20'+_0x51f695[_0x3b57a0(0x15c)]+':\x20'+_0x2bf797);}class OAuthTimeoutError extends Error{constructor(_0x573fba){const _0x4748a3=_0x1cff32;super(_0x573fba),this[_0x4748a3(0x180)]=_0x4748a3(0x132);}}async function oauthFlow(_0xcf6030){const _0x1dc2cd=_0x1cff32,_0x2f2e37={'khvfz':function(_0x41d03a,_0x4fd45d){return _0x41d03a(_0x4fd45d);},'OpxLJ':function(_0x3cf2cf,_0x44a966){return _0x3cf2cf instanceof _0x44a966;},'EpOxT':function(_0x2c6e15){return _0x2c6e15();}};try{return await _0x2f2e37['khvfz'](oauthFlowAttempt,_0xcf6030);}catch(_0x1d9f0d){if(_0x2f2e37['OpxLJ'](_0x1d9f0d,OAuthTimeoutError)&&await _0x2f2e37[_0x1dc2cd(0x11e)](loadCachedClient))return console['log'](_0x1dc2cd(0x152)),await clearCachedClient(),await oauthFlowAttempt(_0xcf6030);throw _0x1d9f0d;}}async function oauthFlowAttempt(_0x590df9){const _0x18ac21=_0x1cff32,_0x1282db={'zpkxv':'Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','pjQGR':_0x18ac21(0x183),'lJnyy':function(_0x18fe82,_0x4b0fef){return _0x18fe82(_0x4b0fef);},'NRFqw':'Registering\x20OAuth\x20client...','iIWVV':function(_0x5e23b9,_0x4fc14b,_0x10d2f7){return _0x5e23b9(_0x4fc14b,_0x10d2f7);},'Kwyrz':_0x18ac21(0x18f),'wocSq':'refresh_token','eMGhN':'none','yZRCf':_0x18ac21(0x172),'NbrKI':_0x18ac21(0x138),'oJejQ':function(_0x5daa8c,_0x4ec0bb){return _0x5daa8c(_0x4ec0bb);},'JUsfx':_0x18ac21(0x12d),'IgOnI':function(_0x174b33,_0x564e41){return _0x174b33(_0x564e41);},'aMgpP':'code','HGJDp':_0x18ac21(0x13f),'grYyo':_0x18ac21(0x18d),'pATHM':_0x18ac21(0x103),'HRYqb':'Exchanging\x20authorization\x20code...','mTuAn':function(_0x5331d2,_0x3be7b4,_0x303d9a){return _0x5331d2(_0x3be7b4,_0x303d9a);},'tuAJi':_0x18ac21(0x104)},_0xc2c17=_0x590df9['replace'](/\/mcp$/,'');process[_0x18ac21(0x150)][_0x18ac21(0x171)](_0x18ac21(0x162));const _0x4a1150=await fetch(_0xc2c17+_0x18ac21(0x12a));if(!_0x4a1150['ok'])throw new Error(_0x1282db[_0x18ac21(0x147)]);const _0x3470d8=await _0x4a1150[_0x18ac21(0x11a)](),_0x3f87d0=_0x3470d8[_0x18ac21(0x190)]?.[0x0];if(!_0x3f87d0)throw new Error(_0x1282db[_0x18ac21(0x122)]);console['log']('\x20'+_0x3f87d0);const _0x32bae4=await _0x1282db[_0x18ac21(0x136)](fetchAuthServerMetadata,_0x3f87d0);let _0x1f660a,_0x47a440;const _0x1d5241=await loadCachedClient();if(_0x1d5241)_0x1f660a=_0x1d5241['clientId'],_0x47a440=_0x1d5241['clientSecret'];else{if(_0x32bae4[_0x18ac21(0x176)]){process['stdout'][_0x18ac21(0x171)](_0x1282db[_0x18ac21(0x14b)]);const _0x2b30e7=await _0x1282db['iIWVV'](fetch,_0x32bae4[_0x18ac21(0x176)],{'method':_0x18ac21(0x104),'headers':{'Content-Type':_0x18ac21(0x146)},'body':JSON[_0x18ac21(0x192)]({'client_name':_0x18ac21(0x149),'redirect_uris':[_0x18ac21(0x155)+CALLBACK_PORT+_0x18ac21(0x101)],'grant_types':[_0x1282db[_0x18ac21(0x182)],_0x1282db['wocSq']],'response_types':['code'],'token_endpoint_auth_method':_0x1282db[_0x18ac21(0x12f)]})});if(!_0x2b30e7['ok']){const _0x2f8044=await _0x2b30e7[_0x18ac21(0x157)]();throw new Error(_0x18ac21(0x140)+_0x2f8044);}const _0xf693be=await _0x2b30e7['json']();_0x1f660a=_0xf693be[_0x18ac21(0x16e)],_0x47a440=_0xf693be['client_secret'],await saveCachedClient(_0x1f660a,_0x47a440),console['log'](_0x1282db[_0x18ac21(0x110)]);}else throw new Error(_0x1282db[_0x18ac21(0x154)]);}const _0x55adaa=_0x1282db['oJejQ'](randomBytes,0x20)[_0x18ac21(0x16a)](_0x1282db[_0x18ac21(0x115)]),_0x1e04bb=_0x1282db[_0x18ac21(0x113)](createHash,_0x18ac21(0x18a))['update'](_0x55adaa)[_0x18ac21(0x129)](_0x1282db['JUsfx']),_0x16277e=_0x1282db['oJejQ'](randomBytes,0x10)[_0x18ac21(0x16a)](_0x18ac21(0x17d)),_0x2b217d=new URL(_0x32bae4[_0x18ac21(0x15e)]);_0x2b217d[_0x18ac21(0x14a)][_0x18ac21(0x17b)](_0x18ac21(0x170),_0x1282db[_0x18ac21(0x111)]),_0x2b217d[_0x18ac21(0x14a)]['set']('client_id',_0x1f660a),_0x2b217d['searchParams'][_0x18ac21(0x17b)](_0x1282db['HGJDp'],'http://localhost:'+CALLBACK_PORT+'/callback'),_0x2b217d['searchParams'][_0x18ac21(0x17b)](_0x18ac21(0x15d),_0x1e04bb),_0x2b217d['searchParams'][_0x18ac21(0x17b)]('code_challenge_method',_0x1282db['grYyo']),_0x2b217d['searchParams'][_0x18ac21(0x17b)](_0x18ac21(0x10e),_0x16277e);_0x3470d8[_0x18ac21(0x103)]&&_0x2b217d['searchParams']['set'](_0x1282db[_0x18ac21(0x106)],_0x3470d8[_0x18ac21(0x103)]);console['log'](_0x18ac21(0x13b)),console['log']('If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a'+_0x2b217d['toString']()+'\x0a'),await openBrowser(_0x2b217d['toString']());const _0xcf690a=await waitForCallback(_0x16277e);process[_0x18ac21(0x150)][_0x18ac21(0x171)](_0x1282db['HRYqb']);const _0x3f9e15=new URLSearchParams({'grant_type':'authorization_code','code':_0xcf690a,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0x1f660a,'code_verifier':_0x55adaa});_0x47a440&&_0x3f9e15[_0x18ac21(0x17b)](_0x18ac21(0x112),_0x47a440);_0x3470d8['resource']&&_0x3f9e15[_0x18ac21(0x17b)](_0x18ac21(0x103),_0x3470d8['resource']);const _0x495225=await _0x1282db['mTuAn'](fetch,_0x32bae4['token_endpoint'],{'method':_0x1282db['tuAJi'],'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x3f9e15});if(!_0x495225['ok']){const _0x155442=await _0x495225['text']();throw new Error(_0x18ac21(0x143)+_0x155442);}const _0x475a0e=await _0x495225['json']();return console['log'](_0x1282db['yZRCf']),await saveCachedToken(_0x475a0e['access_token'],_0x475a0e['refresh_token'],_0x475a0e[_0x18ac21(0x13e)]),_0x475a0e['access_token'];}async function callGetCliToken(_0x7fda62,_0x4bf249){const _0x39cbe3=_0x1cff32,_0x15cd09={'Nclfs':function(_0x4c8d63,_0x2c52f1,_0x3a16e7){return _0x4c8d63(_0x2c52f1,_0x3a16e7);},'ioHMQ':_0x39cbe3(0x146),'uOQtw':_0x39cbe3(0x17f),'HNLqr':'2.0','DHhMa':_0x39cbe3(0x10c),'eAXgR':function(_0x10e7cb,_0x6c8adc){return _0x10e7cb(_0x6c8adc);},'tmyxJ':'tools/call','uPAew':'get_cli_token','pUale':_0x39cbe3(0x13c),'cAhjC':function(_0x1c6201){return _0x1c6201();},'HnEgv':function(_0x3b97ff,_0x1181d1,_0x470269,_0x2e8fda){return _0x3b97ff(_0x1181d1,_0x470269,_0x2e8fda);},'Cyqhv':function(_0x537570,_0x304d94,_0x1e3016){return _0x537570(_0x304d94,_0x1e3016);},'Pvnem':'auth-origin.txt'},_0x52f6fb={'Content-Type':_0x15cd09[_0x39cbe3(0x134)],'Accept':'application/json,\x20text/event-stream'};_0x4bf249&&(_0x52f6fb[_0x39cbe3(0x117)]='Bearer\x20'+_0x4bf249);const _0x107d47=async _0x2a998b=>{const _0x273786=_0x39cbe3,_0x3349a1=await _0x15cd09[_0x273786(0x118)](fetch,_0x7fda62,{'method':_0x273786(0x104),'headers':_0x52f6fb,'body':JSON[_0x273786(0x192)](_0x2a998b)});if(!_0x3349a1['ok']){const _0x32f931=await _0x3349a1['text']();throw new Error('HTTP\x20'+_0x3349a1[_0x273786(0x15c)]+':\x20'+_0x32f931);}return parseResponse(_0x3349a1);};process['stdout'][_0x39cbe3(0x171)](_0x15cd09[_0x39cbe3(0x156)]);const _0x34f77a=await _0x107d47({'jsonrpc':_0x15cd09[_0x39cbe3(0x13d)],'id':0x1,'method':_0x39cbe3(0x18b),'params':{'protocolVersion':'2025-03-26','capabilities':{},'clientInfo':{'name':_0x39cbe3(0x145),'version':'1.0.0'}}});if(_0x34f77a[_0x39cbe3(0x139)])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x34f77a['error'][_0x39cbe3(0x131)]??JSON[_0x39cbe3(0x192)](_0x34f77a['error'])));console['log'](_0x39cbe3(0x172)),await fetch(_0x7fda62,{'method':_0x39cbe3(0x104),'headers':_0x52f6fb,'body':JSON[_0x39cbe3(0x192)]({'jsonrpc':'2.0','method':_0x39cbe3(0x153)})})['then'](_0x1e14e8=>_0x1e14e8['text']()),process['stdout']['write'](_0x15cd09['DHhMa']);const _0x5536ee=await _0x15cd09[_0x39cbe3(0x177)](_0x107d47,{'jsonrpc':'2.0','id':0x2,'method':_0x15cd09['tmyxJ'],'params':{'name':_0x15cd09['uPAew'],'arguments':{}}});if(_0x5536ee[_0x39cbe3(0x139)])throw new Error(_0x39cbe3(0x16d)+(_0x5536ee[_0x39cbe3(0x139)][_0x39cbe3(0x131)]??JSON[_0x39cbe3(0x192)](_0x5536ee['error'])));console['log']('\x20done');const _0x42802f=extractToken(_0x5536ee[_0x39cbe3(0x16b)]);if(!_0x42802f){console['error'](_0x15cd09['pUale']),console['error'](JSON[_0x39cbe3(0x192)](_0x5536ee['result'],null,0x2));throw new Error(_0x39cbe3(0x127));}const _0x399d5f=join(_0x15cd09[_0x39cbe3(0x137)](homedir),'.ranger'),_0x57c566=join(_0x399d5f,_0x39cbe3(0x159));await mkdir(_0x399d5f,{'recursive':!![]}),await _0x15cd09[_0x39cbe3(0x109)](writeFile,_0x57c566,_0x42802f,{'mode':0x180}),await writeFile(_0x15cd09['Cyqhv'](join,_0x399d5f,_0x15cd09[_0x39cbe3(0x178)]),_0x7fda62,{'mode':0x180}),console['log'](_0x39cbe3(0x181)+_0x57c566),console['log']('Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a');}async function fetchAuthServerMetadata(_0x4c040b){const _0x613737=_0x1cff32,_0x1ffc0e={'uUVdD':function(_0x4bea73,_0x40dec5){return _0x4bea73(_0x40dec5);}},_0x4d597c=_0x4c040b+_0x613737(0x11c),_0x161343=await _0x1ffc0e['uUVdD'](fetch,_0x4d597c);if(!_0x161343['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x4d597c+':\x20'+_0x161343[_0x613737(0x15c)]);return _0x161343['json']();}function waitForCallback(_0xb41027){const _0x43136a=_0x1cff32,_0xb27df6={'Vtfsc':function(_0x44c277){return _0x44c277();},'yHfzt':_0x43136a(0x10e),'XELyj':'error','iKnLu':function(_0x2463d5){return _0x2463d5();},'TtlDz':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','MItKi':function(_0x32bccc,_0x13fcb9){return _0x32bccc(_0x13fcb9);},'FQvLV':'127.0.0.1'};return new Promise((_0x52a5d5,_0x582e80)=>{const _0xcadcc5=_0x43136a,_0x5c8083={'BbrlL':function(_0x55ca50){const _0x129b4d=_0x47ab;return _0xb27df6[_0x129b4d(0x144)](_0x55ca50);},'pOoti':'OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','JBgao':'/callback','kExIV':_0xb27df6['yHfzt'],'txmua':_0xb27df6['XELyj'],'RDQBT':_0xcadcc5(0x167),'ISfzY':function(_0x882133,_0x20b274){return _0x882133(_0x20b274);},'RygLe':function(_0x20ff28){const _0x4f7d1a=_0xcadcc5;return _0xb27df6[_0x4f7d1a(0x186)](_0x20ff28);},'ewqAN':_0xb27df6['TtlDz'],'JSzHw':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>'},_0x1064a7=()=>{_0x101e2a['closeAllConnections'](),_0x101e2a['close']();},_0x3f71ca=setTimeout(()=>{const _0x2ef27c=_0xcadcc5;_0x5c8083[_0x2ef27c(0x12c)](_0x1064a7),_0x582e80(new OAuthTimeoutError(_0x5c8083[_0x2ef27c(0x15b)]));},0x1d4c0),_0x101e2a=_0xb27df6[_0xcadcc5(0x148)](createServer,(_0xec690c,_0xba4223)=>{const _0x3327cf=_0xcadcc5,_0x4cb802=new URL(_0xec690c['url']??'/','http://localhost:'+CALLBACK_PORT);if(_0x4cb802['pathname']!==_0x5c8083['JBgao']){_0xba4223[_0x3327cf(0x188)](0x194),_0xba4223[_0x3327cf(0x128)](_0x3327cf(0x16c));return;}const _0x1dd2fd=_0x4cb802[_0x3327cf(0x14a)][_0x3327cf(0x160)](_0x3327cf(0x17a)),_0x4d1195=_0x4cb802[_0x3327cf(0x14a)]['get'](_0x5c8083[_0x3327cf(0x11f)]),_0x353729=_0x4cb802['searchParams']['get'](_0x5c8083[_0x3327cf(0x14f)]);if(_0x353729){const _0x74cf08=_0x4cb802['searchParams'][_0x3327cf(0x160)]('error_description')??_0x353729;_0xba4223['writeHead'](0xc8,{'Content-Type':_0x5c8083[_0x3327cf(0x126)]}),_0xba4223[_0x3327cf(0x128)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x74cf08+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),_0x5c8083[_0x3327cf(0x13a)](clearTimeout,_0x3f71ca),_0x5c8083['RygLe'](_0x1064a7),_0x582e80(new Error('OAuth\x20error:\x20'+_0x74cf08));return;}if(!_0x1dd2fd||_0x4d1195!==_0xb41027){_0xba4223['writeHead'](0x190,{'Content-Type':_0x5c8083['RDQBT']}),_0xba4223['end'](_0x5c8083[_0x3327cf(0x191)]);return;}_0xba4223['writeHead'](0xc8,{'Content-Type':'text/html'}),_0xba4223['end'](_0x5c8083['JSzHw']),_0x5c8083[_0x3327cf(0x13a)](clearTimeout,_0x3f71ca),_0x1064a7(),_0x5c8083['ISfzY'](_0x52a5d5,_0x1dd2fd);});_0x101e2a['listen'](CALLBACK_PORT,_0xb27df6[_0xcadcc5(0x15a)]);});}async function openBrowser(_0x4e92f6){const _0x1f12d1=_0x1cff32,_0x53206f={'TRSYf':_0x1f12d1(0x15f),'pbaGf':_0x1f12d1(0x161),'DQKEu':function(_0x4337cd,_0x2b8555){return _0x4337cd(_0x2b8555);}},_0x40d785=process[_0x1f12d1(0x141)]===_0x1f12d1(0x169)?_0x53206f['TRSYf']:process['platform']===_0x53206f['pbaGf']?_0x1f12d1(0x18e):_0x1f12d1(0x119);_0x53206f['DQKEu'](exec,_0x40d785+'\x20\x22'+_0x4e92f6+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x42fb34=_0x1cff32,_0x3d8959={'bcdNV':function(_0xa9b774,_0x56b55c,_0x23b797){return _0xa9b774(_0x56b55c,_0x23b797);}};try{const _0x3d06ec=JSON[_0x42fb34(0x10d)](await _0x3d8959['bcdNV'](readFile,TOKEN_CACHE_PATH,'utf-8'));if(_0x3d06ec['origin']&&_0x3d06ec[_0x42fb34(0x10b)]!==currentOrigin)return null;if(_0x3d06ec['expiresAt']&&Date['now']()>_0x3d06ec[_0x42fb34(0x124)])return null;return _0x3d06ec['accessToken']??null;}catch{return null;}}function _0x1aee(){const _0x459209=['ewqAN','stringify','structuredContent','dJjNs','/callback','mcp-oauth-tokens.json','resource','POST','5gjAAyo','pATHM','12lZQmxy','application/json,\x20text/event-stream','HnEgv','4092448yfxQmz','origin','Requesting\x20CLI\x20token...','parse','state','6fLeJdQ','yZRCf','aMgpP','client_secret','IgOnI','2195907lRYXqL','JUsfx','log','Authorization','Nclfs','xdg-open','json','ZCTTX','/.well-known/oauth-authorization-server','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','EpOxT','kExIV','accessToken','clientId','pjQGR','eWMEe','expiresAt','70502qcTizg','RDQBT','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','end','digest','/.well-known/oauth-protected-resource','Ezejg','BbrlL','base64url','123739FFoDbP','eMGhN','2.0','message','OAuthTimeoutError','YPZcE','ioHMQ','JHvJI','lJnyy','cAhjC','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','error','ISfzY','\x0aOpening\x20browser\x20for\x20authentication...','\x0aUnexpected\x20response\x20structure:','HNLqr','expires_in','redirect_uri','Client\x20registration\x20failed:\x20','platform','utf-8','Token\x20exchange\x20failed:\x20','Vtfsc','ranger-cli','application/json','zpkxv','MItKi','Ranger\x20CLI','searchParams','NRFqw','content-type','22607695sSYSdq','text/event-stream','txmua','stdout','yiFHZ','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','notifications/initialized','NbrKI','http://localhost:','uOQtw','text','1110AKskry','refresh.txt','FQvLV','pOoti','status','code_challenge','authorization_endpoint','open','get','win32','Discovering\x20authorization\x20server...','VhGUa','NjLlk','YUmLT','.ranger','text/html','type','darwin','toString','result','Not\x20found','get_cli_token\x20failed:\x20','client_id','jqKAA','response_type','write','\x20done','11QZebJJ','2507036hNlaDO','TXTqc','registration_endpoint','eAXgR','Pvnem','data:','code','set','proxied','hex','yDKwN','Initializing\x20MCP\x20session...','name','\x0aToken\x20written\x20to\x20','Kwyrz','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','slice','token','iKnLu','isTTY','writeHead','12771szPWEE','sha256','initialize','hAwJc','S256','start','authorization_code','authorization_servers'];_0x1aee=function(){return _0x459209;};return _0x1aee();}async function saveCachedToken(_0x53c842,_0x337e09,_0x441ab2){const _0x5b311a=_0x1cff32,_0x2a43c2={'Ezejg':function(_0xd26f1c,_0x3abb86,_0x3741bb){return _0xd26f1c(_0x3abb86,_0x3741bb);},'SzMpi':function(_0x10826b,_0xd9ce8a,_0x126b7e,_0x2e0156){return _0x10826b(_0xd9ce8a,_0x126b7e,_0x2e0156);}},_0x5bda5e=await loadCachedData(),_0x870a5e={..._0x5bda5e,'origin':currentOrigin,'accessToken':_0x53c842,'refreshToken':_0x337e09??_0x5bda5e?.['refreshToken'],'expiresAt':_0x441ab2?Date['now']()+_0x441ab2*0x3e8:undefined};await mkdir(_0x2a43c2[_0x5b311a(0x12b)](join,homedir(),_0x5b311a(0x166)),{'recursive':!![]}),await _0x2a43c2['SzMpi'](writeFile,TOKEN_CACHE_PATH,JSON[_0x5b311a(0x192)](_0x870a5e),{'mode':0x180});}async function loadCachedClient(){const _0x113a47=_0x1cff32,_0x442358={'RzNKP':function(_0x3fc1c5){return _0x3fc1c5();}},_0x2dbfa1=await _0x442358['RzNKP'](loadCachedData);if(_0x2dbfa1?.[_0x113a47(0x10b)]&&_0x2dbfa1[_0x113a47(0x10b)]!==currentOrigin)return null;return _0x2dbfa1?.['clientId']?{'clientId':_0x2dbfa1[_0x113a47(0x121)],'clientSecret':_0x2dbfa1['clientSecret']}:null;}async function clearCachedClient(){const _0x40b0a4={'hffPz':function(_0x1d0ea2,_0x585666,_0x1d4088,_0xe244f7){return _0x1d0ea2(_0x585666,_0x1d4088,_0xe244f7);}},_0x9ae522=await loadCachedData();if(!_0x9ae522)return;const {clientId:_0xc9798f,clientSecret:_0x36c1d9,..._0x567cfa}=_0x9ae522;await _0x40b0a4['hffPz'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x567cfa),{'mode':0x180});}async function saveCachedClient(_0x5bdf7d,_0x1ae346){const _0x2da624=_0x1cff32,_0x1e9929={'QHrXJ':function(_0x3b3171,_0x468f36,_0xc34589){return _0x3b3171(_0x468f36,_0xc34589);},'FOSwM':function(_0x775fc5){return _0x775fc5();},'JHvJI':_0x2da624(0x166),'imeVe':function(_0x7c16b9,_0x2a7345,_0x4437d4,_0x342f79){return _0x7c16b9(_0x2a7345,_0x4437d4,_0x342f79);}},_0xfbde29=await loadCachedData(),_0x8dfcb5={..._0xfbde29,'origin':currentOrigin,'accessToken':_0xfbde29?.[_0x2da624(0x120)]??'','clientId':_0x5bdf7d,'clientSecret':_0x1ae346};await mkdir(_0x1e9929['QHrXJ'](join,_0x1e9929['FOSwM'](homedir),_0x1e9929[_0x2da624(0x135)]),{'recursive':!![]}),await _0x1e9929['imeVe'](writeFile,TOKEN_CACHE_PATH,JSON[_0x2da624(0x192)](_0x8dfcb5),{'mode':0x180});}async function loadCachedData(){const _0xa9d94=_0x1cff32,_0x32ff40={'yiFHZ':function(_0x381a79,_0x3df337,_0x4a1ffa){return _0x381a79(_0x3df337,_0x4a1ffa);}};try{return JSON['parse'](await _0x32ff40[_0xa9d94(0x151)](readFile,TOKEN_CACHE_PATH,_0xa9d94(0x142)));}catch{return null;}}function _0x47ab(_0x8ba3da,_0x419daa){_0x8ba3da=_0x8ba3da-0xff;const _0x1aeeb9=_0x1aee();let _0x47ab7a=_0x1aeeb9[_0x8ba3da];return _0x47ab7a;}async function parseResponse(_0x49f237){const _0x3a413c=_0x1cff32,_0x58fc3b={'ZCTTX':_0x3a413c(0x179),'TXTqc':function(_0xdb9db6,_0x48ff62){return _0xdb9db6!==_0x48ff62;}},_0x3a2981=_0x49f237['headers'][_0x3a413c(0x160)](_0x3a413c(0x14c))??'';if(_0x3a2981['includes'](_0x3a413c(0x14e))){const _0xc5d643=await _0x49f237[_0x3a413c(0x157)]();for(const _0xdabfff of _0xc5d643['split']('\x0a')){const _0x49d4fc=_0xdabfff['trim']();if(_0x49d4fc['startsWith'](_0x58fc3b[_0x3a413c(0x11b)])){const _0x21e827=_0x49d4fc[_0x3a413c(0x184)](_0x3a413c(0x179)['length'])['trim']();if(!_0x21e827)continue;try{const _0x1d3958=JSON[_0x3a413c(0x10d)](_0x21e827);if(_0x58fc3b[_0x3a413c(0x175)](_0x1d3958['id'],undefined)||_0x1d3958[_0x3a413c(0x139)])return _0x1d3958;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x49f237['json']();}function extractToken(_0x405562){const _0x2a99ed=_0x1cff32,_0x1b0dff={'fyzfX':'string','YUmLT':'Unknown\x20error'};if(!_0x405562)return null;const _0x33f97e=_0x405562[_0x2a99ed(0xff)];if(_0x33f97e?.['token']&&typeof _0x33f97e['token']===_0x1b0dff['fyzfX'])return _0x33f97e[_0x2a99ed(0x185)];if(_0x405562['isError']){const _0x157eed=_0x405562['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x157eed?.[0x0]?.['text']??_0x1b0dff[_0x2a99ed(0x165)]));}const _0x2d1cff=_0x405562['content'];if(_0x2d1cff)for(const _0x209eca of _0x2d1cff){if(_0x209eca[_0x2a99ed(0x168)]==='text'&&_0x209eca[_0x2a99ed(0x157)]){try{const _0x2e25fb=JSON[_0x2a99ed(0x10d)](_0x209eca['text']);if(typeof _0x2e25fb?.['token']==='string')return _0x2e25fb['token'];}catch{}const _0x389bad=_0x209eca[_0x2a99ed(0x157)]['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x389bad)return _0x389bad[0x1];}}return null;}
@@ -1 +1 @@
1
- function _0x2db5(){var _0x52029a=['1282764SUrWQf','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','1680777Lsccdl','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','5180450xcFxRq','snjgJ','266024OcZyZU','2037MRILBd','ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','812995tgLjaF','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','exit','40hOliAc','79910GmiHNP','error','fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.','iyIFd','1828kYLTZq','1530JmrRlT'];_0x2db5=function(){return _0x52029a;};return _0x2db5();}(function(_0x567d2b,_0x4684db){var _0x3a6e87=_0x5b47,_0x1125c2=_0x567d2b();while(!![]){try{var _0x21607b=-parseInt(_0x3a6e87(0x15a))/0x1+-parseInt(_0x3a6e87(0x157))/0x2+parseInt(_0x3a6e87(0x158))/0x3*(parseInt(_0x3a6e87(0x162))/0x4)+-parseInt(_0x3a6e87(0x155))/0x5+-parseInt(_0x3a6e87(0x164))/0x6+-parseInt(_0x3a6e87(0x166))/0x7*(-parseInt(_0x3a6e87(0x15d))/0x8)+parseInt(_0x3a6e87(0x163))/0x9*(parseInt(_0x3a6e87(0x15e))/0xa);if(_0x21607b===_0x4684db)break;else _0x1125c2['push'](_0x1125c2['shift']());}catch(_0x2072ed){_0x1125c2['push'](_0x1125c2['shift']());}}}(_0x2db5,0xa469d));function _0x5b47(_0x1411d1,_0x4d6888){_0x1411d1=_0x1411d1-0x154;var _0x2db574=_0x2db5();var _0x5b4703=_0x2db574[_0x1411d1];return _0x5b4703;}export async function migrateProfile(_0x142c58,_0x2adb1a){var _0x45260d=_0x5b47,_0x4124b0={'iyIFd':function(_0x1fb3b6,_0x40e211){return _0x1fb3b6+_0x40e211;},'snjgJ':function(_0x367f09,_0x391808){return _0x367f09+_0x391808;},'nPEgo':function(_0x5e44d0,_0x4810e9){return _0x5e44d0+_0x4810e9;},'kodiW':_0x45260d(0x159),'bXVNZ':_0x45260d(0x154)};console[_0x45260d(0x15f)](_0x4124b0[_0x45260d(0x161)](_0x4124b0[_0x45260d(0x161)](_0x4124b0['snjgJ'](_0x4124b0['nPEgo'](_0x4124b0[_0x45260d(0x156)](_0x4124b0[_0x45260d(0x161)](_0x4124b0['kodiW']+'\x0a'+_0x45260d(0x165)+_0x45260d(0x15b),'\x0a'),_0x45260d(0x167)),_0x4124b0['bXVNZ']),'\x0a'),'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a'),_0x45260d(0x160))),process[_0x45260d(0x15c)](0x1);}
1
+ (function(_0x4df19d,_0x1f7291){var _0x3756b7=_0x456f,_0x19be93=_0x4df19d();while(!![]){try{var _0x51468b=parseInt(_0x3756b7(0x13e))/0x1*(-parseInt(_0x3756b7(0x143))/0x2)+-parseInt(_0x3756b7(0x13d))/0x3*(parseInt(_0x3756b7(0x139))/0x4)+parseInt(_0x3756b7(0x142))/0x5+-parseInt(_0x3756b7(0x134))/0x6+-parseInt(_0x3756b7(0x148))/0x7+-parseInt(_0x3756b7(0x140))/0x8+parseInt(_0x3756b7(0x144))/0x9*(parseInt(_0x3756b7(0x141))/0xa);if(_0x51468b===_0x1f7291)break;else _0x19be93['push'](_0x19be93['shift']());}catch(_0x284148){_0x19be93['push'](_0x19be93['shift']());}}}(_0x337d,0x79c19));function _0x456f(_0x23654d,_0x326d98){_0x23654d=_0x23654d-0x134;var _0x337de6=_0x337d();var _0x456f30=_0x337de6[_0x23654d];return _0x456f30;}function _0x337d(){var _0x569afc=['1729287sVsAxI','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','1387464HtifhR','cSNdP','YoAWm','TNjhp','Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','259132RZwflc','bNhPM','ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','error','3BsPnLP','6euqPaO','exit','730640ZClvCM','3605680NzIJnJ','775645zEByiZ','34574jVvBst','27vUEFWh','XiOdS','vLqFx','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a'];_0x337d=function(){return _0x569afc;};return _0x337d();}export async function migrateProfile(_0x10fc6e,_0x345245){var _0x51aaa7=_0x456f,_0x4206e0={'YoAWm':function(_0x1fab60,_0x5a5995){return _0x1fab60+_0x5a5995;},'TNjhp':function(_0x2d1edd,_0x36677f){return _0x2d1edd+_0x36677f;},'cSNdP':_0x51aaa7(0x13b),'XiOdS':_0x51aaa7(0x147),'EMzRU':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','bNhPM':_0x51aaa7(0x149),'xZodJ':'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','vLqFx':_0x51aaa7(0x138)};console[_0x51aaa7(0x13c)](_0x4206e0[_0x51aaa7(0x136)](_0x4206e0[_0x51aaa7(0x137)](_0x4206e0['YoAWm'](_0x4206e0['YoAWm'](_0x4206e0[_0x51aaa7(0x135)],'\x0a')+_0x4206e0[_0x51aaa7(0x145)],_0x4206e0['EMzRU']),'\x0a')+_0x4206e0[_0x51aaa7(0x13a)]+_0x4206e0['xZodJ'],'\x0a')+_0x4206e0[_0x51aaa7(0x146)]+'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'),process[_0x51aaa7(0x13f)](0x1);}
@@ -1 +1 @@
1
- (function(_0x574f29,_0x43f501){const _0xc8429f=_0x23e7,_0xbc61bf=_0x574f29();while(!![]){try{const _0x2bd60c=parseInt(_0xc8429f(0x15d))/0x1+-parseInt(_0xc8429f(0x181))/0x2+-parseInt(_0xc8429f(0x182))/0x3+parseInt(_0xc8429f(0x185))/0x4*(-parseInt(_0xc8429f(0x160))/0x5)+-parseInt(_0xc8429f(0x15b))/0x6*(-parseInt(_0xc8429f(0x178))/0x7)+-parseInt(_0xc8429f(0x17a))/0x8+parseInt(_0xc8429f(0x186))/0x9*(parseInt(_0xc8429f(0x168))/0xa);if(_0x2bd60c===_0x43f501)break;else _0xbc61bf['push'](_0xbc61bf['shift']());}catch(_0x4be85d){_0xbc61bf['push'](_0xbc61bf['shift']());}}}(_0x50c2,0xd9f7a));import{join}from'path';function _0x50c2(){const _0x413b10=['install','4678758aVjcAg','SKILL.md','8700840kejbRS','user','trailhead','plugin','qpmFy','ujIJP','yZpQf','2762282xWcZnF','1560180EvEKTx','error','add','4562940EeTPsq','2934arLUzR','project','6ktnJRT','\x0aYou\x20can\x20install\x20manually\x20with:','367287aoinBi','CzkFq','iIhQb','5kqipJo','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','ranger','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','HwhoH','enable','success','YmmOF','122290jTeXRT','✓\x20Claude\x20Code\x20plugin\x20already\x20installed','prompt','log','Amfts','ranger@trailhead','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','cvoAy','--scope','Where\x20should\x20the\x20plugin\x20be\x20installed?','ZGPJw','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','VGQjA','confirm','KzwUx'];_0x50c2=function(){return _0x413b10;};return _0x50c2();}import{existsSync}from'fs';function _0x23e7(_0x6448c8,_0x57ef85){_0x6448c8=_0x6448c8-0x15b;const _0x50c221=_0x50c2();let _0x23e76c=_0x50c221[_0x6448c8];return _0x23e76c;}import _0x1406a3 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(_0x1f3db0){const _0x55ac91=_0x23e7,_0x55c572={'VGQjA':function(_0x48587f,_0x4f1b93){return _0x48587f(_0x4f1b93);},'TdJEL':'.claude','PSTdT':'pluginScope','qpmFy':_0x55ac91(0x171),'PcIAi':_0x55ac91(0x17b),'ujIJP':_0x55ac91(0x187),'Otbxr':_0x55ac91(0x17c),'wtDKy':'ranger-testing/trailhead','ZqQAG':'❌\x20Failed\x20to\x20add\x20marketplace:','wbQlo':_0x55ac91(0x15c),'wfqGP':_0x55ac91(0x163),'NMpDd':_0x55ac91(0x17d),'NkGwx':_0x55ac91(0x177),'JsWll':_0x55ac91(0x16d),'YmmOF':_0x55ac91(0x170),'KzwUx':_0x55ac91(0x161),'yZpQf':_0x55ac91(0x165),'cvoAy':function(_0x466415,_0x2cf0ae){return _0x466415===_0x2cf0ae;},'VGgbC':'already\x20enabled','FTYyV':'✓\x20Claude\x20Code\x20plugin\x20enabled'},_0x186367=await _0x55c572[_0x55ac91(0x174)](isPluginInstalled,'ranger@trailhead');if(_0x186367)return console['log'](_0x55ac91(0x169)),![];const _0xaeceef=existsSync(join(getProjectRoot(),_0x55c572['TdJEL']));let _0x5b1682;if(_0x1f3db0)_0x5b1682=_0x1f3db0;else{if(_0xaeceef)_0x5b1682=_0x55ac91(0x187);else{console['log'](_0x55ac91(0x16e));const _0x8db4d0=await _0x1406a3[_0x55ac91(0x16a)]([{'type':'list','name':_0x55c572['PSTdT'],'message':_0x55c572[_0x55ac91(0x17e)],'choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':_0x55c572['PcIAi']},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x55c572[_0x55ac91(0x17f)]}],'default':_0x55ac91(0x17b)}]);_0x5b1682=_0x8db4d0['pluginScope'];}}console[_0x55ac91(0x16b)](_0x55ac91(0x173)+_0x5b1682+'\x20level)...\x0a');const _0x44e549=await isMarketplaceAdded(_0x55c572['Otbxr']);let _0x4341b6=_0x44e549;if(_0x44e549)console[_0x55ac91(0x16b)]('✓\x20Marketplace\x20already\x20added');else{const _0x2f135f=await _0x55c572['VGQjA'](runClaudeCommand,[_0x55ac91(0x17d),'marketplace',_0x55ac91(0x184),_0x55c572['wtDKy']]);!_0x2f135f['success']?(console['error'](_0x55c572['ZqQAG'],_0x2f135f[_0x55ac91(0x183)]),console[_0x55ac91(0x16b)](_0x55c572['wbQlo']),console[_0x55ac91(0x16b)](_0x55c572['wfqGP']),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x5b1682)):_0x4341b6=!![];}if(_0x4341b6){const _0x56c2ce=await runClaudeCommand([_0x55c572['NMpDd'],_0x55c572['NkGwx'],_0x55c572['JsWll'],_0x55c572[_0x55ac91(0x167)],_0x5b1682],{'cwd':_0x5b1682===_0x55c572[_0x55ac91(0x17f)]?getProjectRoot():undefined});if(!_0x56c2ce[_0x55ac91(0x166)])console['error']('❌\x20Failed\x20to\x20install\x20plugin:',_0x56c2ce['error']),console[_0x55ac91(0x16b)]('\x0aYou\x20can\x20install\x20manually\x20with:'),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x5b1682);else{console['log'](_0x55c572[_0x55ac91(0x176)]);const _0x2953ea=[_0x55c572['NMpDd'],_0x55c572[_0x55ac91(0x180)],_0x55c572['JsWll']];_0x55c572[_0x55ac91(0x16f)](_0x5b1682,_0x55ac91(0x187))&&_0x2953ea['push'](_0x55c572[_0x55ac91(0x167)],_0x55c572['ujIJP']);const _0x1f7a01=await runClaudeCommand(_0x2953ea,{'captureOutput':!![],'cwd':_0x5b1682===_0x55ac91(0x187)?getProjectRoot():undefined}),_0x2f1426=_0x1f7a01['output']?.['includes'](_0x55c572['VGgbC']);!_0x1f7a01[_0x55ac91(0x166)]&&!_0x2f1426?console['error']('⚠\x20Failed\x20to\x20enable\x20plugin:',_0x1f7a01['error']):console['log'](_0x55c572['FTYyV']);}}return!![];}export async function ensureClaudeSkills(_0x52bc08){const _0x2ba472=_0x23e7,_0x1aa65e={'wywZz':function(_0x345a97,_0x2ed030){return _0x345a97(_0x2ed030);},'HwhoH':'ranger','CzkFq':_0x2ba472(0x179),'iIhQb':function(_0x9e7880,_0x1a891f){return _0x9e7880(_0x1a891f);},'Amfts':'✓\x20Ranger\x20skills\x20already\x20installed','ZGPJw':'.claude'},_0x36f5ea=_0x1aa65e['wywZz'](existsSync,join(getSkillsDir(_0x2ba472(0x17b)),_0x1aa65e[_0x2ba472(0x164)],_0x1aa65e[_0x2ba472(0x15e)])),_0x1c712b=_0x1aa65e[_0x2ba472(0x15f)](existsSync,join(getSkillsDir(_0x2ba472(0x187)),_0x2ba472(0x162),_0x2ba472(0x179)));if(_0x36f5ea||_0x1c712b)return console['log'](_0x1aa65e[_0x2ba472(0x16c)]),![];const _0x12024a=existsSync(join(getProjectRoot(),_0x1aa65e[_0x2ba472(0x172)]));let _0x20a720=!![];if(_0x52bc08)await skillup({'autoInstall':_0x52bc08,'suppressUsage':!![]});else{if(_0x12024a)await skillup({'autoInstall':'project','suppressUsage':!![]});else{const _0x2743db=await _0x1406a3['prompt']([{'type':_0x2ba472(0x175),'name':'wantsSkillup','message':'Would\x20you\x20like\x20to\x20install\x20skills?','default':!![]}]);_0x20a720=_0x2743db['wantsSkillup'],_0x20a720&&await skillup({'suppressUsage':!![]});}}return _0x20a720;}
1
+ function _0x2c09(_0x4ec352,_0x4be285){_0x4ec352=_0x4ec352-0x17a;const _0x4d0741=_0x4d07();let _0x2c0904=_0x4d0741[_0x4ec352];return _0x2c0904;}(function(_0x31c2cd,_0x419c1b){const _0x4377e3=_0x2c09,_0x1ef449=_0x31c2cd();while(!![]){try{const _0x5eb11c=-parseInt(_0x4377e3(0x18f))/0x1*(parseInt(_0x4377e3(0x1aa))/0x2)+parseInt(_0x4377e3(0x17d))/0x3*(-parseInt(_0x4377e3(0x17a))/0x4)+parseInt(_0x4377e3(0x1a6))/0x5*(parseInt(_0x4377e3(0x19a))/0x6)+parseInt(_0x4377e3(0x1a9))/0x7*(parseInt(_0x4377e3(0x1a4))/0x8)+-parseInt(_0x4377e3(0x189))/0x9+-parseInt(_0x4377e3(0x196))/0xa*(-parseInt(_0x4377e3(0x184))/0xb)+parseInt(_0x4377e3(0x181))/0xc;if(_0x5eb11c===_0x419c1b)break;else _0x1ef449['push'](_0x1ef449['shift']());}catch(_0xbb83fc){_0x1ef449['push'](_0x1ef449['shift']());}}}(_0x4d07,0x6dc4b));import{join}from'path';import{existsSync}from'fs';function _0x4d07(){const _0x8e727f=['RaGfr','HBKaQ','enable','--scope','JAEZG','tcqKf','❌\x20Failed\x20to\x20add\x20marketplace:','nNIFf','40ZElkvw','project','5jZSFmT','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','error','1237334zTyTRQ','110uUdxDS','Project\x20(shared\x20with\x20team\x20via\x20git)','TmpXy','csTBh','364lMNPTm','success','✓\x20Ranger\x20skills\x20already\x20installed','28416LGlepe','ranger@trailhead','BHeQL','qOcGV','2344368lBhTft','ZMNgR','OQryh','4158VJZfDe','\x0a📦\x20Claude\x20Code\x20Plugin\x0a','user','jLdhk','ranger-testing/trailhead','3684384NxMnPZ','yJHOW','plugin','marketplace','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','wantsSkillup','15443mtUtma','DnjQW','CjcoW','\x0aYou\x20can\x20install\x20manually\x20with:','VooPI','✓\x20Marketplace\x20already\x20added','UbEqS','16280xDwiVE','LercH','✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','5254476wzKwwS','log'];_0x4d07=function(){return _0x8e727f;};return _0x4d07();}import _0x6b25b8 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(_0x133260){const _0x4f46f7=_0x2c09,_0x4d9f75={'OQryh':function(_0x3a5acb,_0xddbe53){return _0x3a5acb(_0xddbe53);},'VooPI':_0x4f46f7(0x17e),'iWpRA':'✓\x20Claude\x20Code\x20plugin\x20already\x20installed','eZvsE':function(_0xa38bf0,_0xf9bc8b){return _0xa38bf0(_0xf9bc8b);},'qOcGV':function(_0x205166){return _0x205166();},'JAEZG':'pluginScope','yJHOW':_0x4f46f7(0x1a5),'ubIXl':'user','csTBh':'trailhead','TmpXy':'add','MbwoX':_0x4f46f7(0x1a2),'nNIFf':_0x4f46f7(0x192),'RaGfr':function(_0x320552){return _0x320552();},'IjFfk':_0x4f46f7(0x18b),'HBKaQ':_0x4f46f7(0x19e),'jLdhk':function(_0x36a964,_0x12ed32){return _0x36a964===_0x12ed32;},'CjcoW':function(_0x421b7e,_0x4f2f57){return _0x421b7e===_0x4f2f57;},'IxdpQ':'already\x20enabled','WKKHW':'✓\x20Claude\x20Code\x20plugin\x20enabled'},_0x58fa9b=await _0x4d9f75[_0x4f46f7(0x183)](isPluginInstalled,_0x4d9f75['VooPI']);if(_0x58fa9b)return console['log'](_0x4d9f75['iWpRA']),![];const _0x5573a0=_0x4d9f75['eZvsE'](existsSync,join(_0x4d9f75[_0x4f46f7(0x180)](getProjectRoot),'.claude'));let _0x19c51d;if(_0x133260)_0x19c51d=_0x133260;else{if(_0x5573a0)_0x19c51d=_0x4f46f7(0x1a5);else{console['log'](_0x4f46f7(0x185));const _0x28b509=await _0x6b25b8['prompt']([{'type':'list','name':_0x4d9f75[_0x4f46f7(0x1a0)],'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':'User\x20(available\x20in\x20all\x20your\x20projects)','value':'user'},{'name':_0x4f46f7(0x1ab),'value':_0x4d9f75['yJHOW']}],'default':_0x4d9f75['ubIXl']}]);_0x19c51d=_0x28b509['pluginScope'];}}console['log'](_0x4f46f7(0x199)+_0x19c51d+'\x20level)...\x0a');const _0x34f89f=await isMarketplaceAdded(_0x4d9f75[_0x4f46f7(0x1ad)]);let _0x56de26=_0x34f89f;if(_0x34f89f)console[_0x4f46f7(0x19b)](_0x4f46f7(0x194));else{const _0x457d35=await runClaudeCommand(['plugin',_0x4f46f7(0x18c),_0x4d9f75[_0x4f46f7(0x1ac)],_0x4f46f7(0x188)]);!_0x457d35[_0x4f46f7(0x17b)]?(console['error'](_0x4d9f75['MbwoX'],_0x457d35['error']),console['log'](_0x4d9f75[_0x4f46f7(0x1a3)]),console['log'](_0x4f46f7(0x1a7)),console['log']('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x19c51d)):_0x56de26=!![];}if(_0x56de26){const _0x15f83b=await runClaudeCommand(['plugin','install',_0x4d9f75[_0x4f46f7(0x193)],_0x4f46f7(0x19f),_0x19c51d],{'cwd':_0x19c51d===_0x4f46f7(0x1a5)?_0x4d9f75[_0x4f46f7(0x19c)](getProjectRoot):undefined});if(!_0x15f83b['success'])console[_0x4f46f7(0x1a8)]('❌\x20Failed\x20to\x20install\x20plugin:',_0x15f83b[_0x4f46f7(0x1a8)]),console['log'](_0x4d9f75['nNIFf']),console[_0x4f46f7(0x19b)](_0x4f46f7(0x18d)+_0x19c51d);else{console[_0x4f46f7(0x19b)](_0x4f46f7(0x198));const _0x3af341=[_0x4d9f75['IjFfk'],_0x4d9f75[_0x4f46f7(0x19d)],'ranger@trailhead'];_0x4d9f75[_0x4f46f7(0x187)](_0x19c51d,_0x4d9f75[_0x4f46f7(0x18a)])&&_0x3af341['push']('--scope',_0x4d9f75[_0x4f46f7(0x18a)]);const _0x369a0d=await runClaudeCommand(_0x3af341,{'captureOutput':!![],'cwd':_0x4d9f75[_0x4f46f7(0x191)](_0x19c51d,_0x4d9f75['yJHOW'])?getProjectRoot():undefined}),_0x42feca=_0x369a0d['output']?.['includes'](_0x4d9f75['IxdpQ']);!_0x369a0d['success']&&!_0x42feca?console[_0x4f46f7(0x1a8)]('⚠\x20Failed\x20to\x20enable\x20plugin:',_0x369a0d[_0x4f46f7(0x1a8)]):console[_0x4f46f7(0x19b)](_0x4d9f75['WKKHW']);}}return!![];}export async function ensureClaudeSkills(_0x955f98){const _0x4a722a=_0x2c09,_0x26e9a5={'LercH':function(_0x72fa81,_0x513c2c,_0x2f9f98,_0x58c987){return _0x72fa81(_0x513c2c,_0x2f9f98,_0x58c987);},'djCLF':_0x4a722a(0x186),'DnjQW':function(_0x5e61e5,_0x10fafd){return _0x5e61e5(_0x10fafd);},'UPhmP':_0x4a722a(0x1a5),'EVITm':'SKILL.md','JWVfF':function(_0xba9cce,_0x362670){return _0xba9cce||_0x362670;},'ZMNgR':function(_0x56618d,_0x3bb9b2,_0x449c3d){return _0x56618d(_0x3bb9b2,_0x449c3d);},'BHeQL':function(_0x5df810){return _0x5df810();},'tcqKf':'.claude','UbEqS':'Would\x20you\x20like\x20to\x20install\x20skills?'},_0x2a1e67=existsSync(_0x26e9a5['LercH'](join,getSkillsDir(_0x26e9a5['djCLF']),'ranger','SKILL.md')),_0x368a29=_0x26e9a5[_0x4a722a(0x190)](existsSync,_0x26e9a5[_0x4a722a(0x197)](join,getSkillsDir(_0x26e9a5['UPhmP']),'ranger',_0x26e9a5['EVITm']));if(_0x26e9a5['JWVfF'](_0x2a1e67,_0x368a29))return console[_0x4a722a(0x19b)](_0x4a722a(0x17c)),![];const _0x4d077b=existsSync(_0x26e9a5[_0x4a722a(0x182)](join,_0x26e9a5[_0x4a722a(0x17f)](getProjectRoot),_0x26e9a5[_0x4a722a(0x1a1)]));let _0x5a8634=!![];if(_0x955f98)await skillup({'autoInstall':_0x955f98,'suppressUsage':!![]});else{if(_0x4d077b)await skillup({'autoInstall':_0x26e9a5['UPhmP'],'suppressUsage':!![]});else{const _0x5147b0=await _0x6b25b8['prompt']([{'type':'confirm','name':'wantsSkillup','message':_0x26e9a5[_0x4a722a(0x195)],'default':!![]}]);_0x5a8634=_0x5147b0[_0x4a722a(0x18e)],_0x5a8634&&await _0x26e9a5[_0x4a722a(0x190)](skillup,{'suppressUsage':!![]});}}return _0x5a8634;}
@@ -1 +1 @@
1
- (function(_0x23d015,_0xa3cf47){const _0x3c5c4d=_0x3658,_0xb1ba60=_0x23d015();while(!![]){try{const _0x262dde=parseInt(_0x3c5c4d(0x1ce))/0x1+parseInt(_0x3c5c4d(0x1cd))/0x2*(parseInt(_0x3c5c4d(0x1e4))/0x3)+-parseInt(_0x3c5c4d(0x1e1))/0x4*(parseInt(_0x3c5c4d(0x1dc))/0x5)+-parseInt(_0x3c5c4d(0x1de))/0x6+parseInt(_0x3c5c4d(0x1d1))/0x7*(-parseInt(_0x3c5c4d(0x1d4))/0x8)+-parseInt(_0x3c5c4d(0x1c7))/0x9*(-parseInt(_0x3c5c4d(0x1d5))/0xa)+parseInt(_0x3c5c4d(0x1dd))/0xb*(parseInt(_0x3c5c4d(0x1c8))/0xc);if(_0x262dde===_0xa3cf47)break;else _0xb1ba60['push'](_0xb1ba60['shift']());}catch(_0x975f11){_0xb1ba60['push'](_0xb1ba60['shift']());}}}(_0x2060,0x39dee));import{join}from'path';function _0x2060(){const _0x3caa8d=['120Vtrhsd','plugin','log','User\x20(available\x20in\x20all\x20your\x20projects)','WnMQQ','734544kqzeLl','427379GUBnbS','prompt','EEVPl','98qeSGRK','XEYBd','ANZuA','112440RGKfDL','7110gFZBks','zWSCz','@ranger-testing/opencode-plugin','zSspJ','user','https://opencode.ai/config.json','stringify','14715ijQMAL','37664rkRZYA','1654080xjJeHl','isArray','Failed\x20to\x20read\x20opencode.json','544hyBUnt','pluginScope','project','3yQmrfT','opencode.json','✓\x20OpenCode\x20plugin\x20configured','3555vRbEST'];_0x2060=function(){return _0x3caa8d;};return _0x2060();}import{existsSync}from'fs';function _0x3658(_0x1b8353,_0x3366c2){_0x1b8353=_0x1b8353-0x1c6;const _0x20605b=_0x2060();let _0x365851=_0x20605b[_0x1b8353];return _0x365851;}import{mkdir,readFile,writeFile}from'fs/promises';import _0x3ab118 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x59d794){const _0x3b6985=_0x3658,_0x10b33e={'zSspJ':function(_0x29efc1,_0x51fea4,_0x3d9699){return _0x29efc1(_0x51fea4,_0x3d9699);},'XEYBd':function(_0x36133b,_0x2a68f0){return _0x36133b(_0x2a68f0);},'yStPd':_0x3b6985(0x1e3),'EEVPl':_0x3b6985(0x1e5),'WnMQQ':'pluginScope','ANZuA':_0x3b6985(0x1cb),'tACjV':'user','HCwNo':function(_0xe14c99,_0x41529f){return _0xe14c99(_0x41529f);},'nvyBR':'utf-8','zWSCz':function(_0x52c3cb,_0xecfe31,_0x465b05){return _0x52c3cb(_0xecfe31,_0x465b05);}},_0x564cef=existsSync(_0x10b33e['zSspJ'](join,_0x10b33e[_0x3b6985(0x1d2)](getOpencodeConfigDir,_0x10b33e['yStPd']),_0x10b33e[_0x3b6985(0x1d0)]));let _0x19f616;if(_0x59d794)_0x19f616=_0x59d794;else{if(_0x564cef)_0x19f616=_0x3b6985(0x1e3);else{console[_0x3b6985(0x1ca)]('\x0a📦\x20OpenCode\x20Plugin\x0a');const _0x45f3a1=await _0x3ab118[_0x3b6985(0x1cf)]([{'type':'list','name':_0x10b33e[_0x3b6985(0x1cc)],'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x10b33e[_0x3b6985(0x1d3)],'value':_0x10b33e['tACjV']},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x3b6985(0x1e3)}],'default':_0x3b6985(0x1d9)}]);_0x19f616=_0x45f3a1[_0x3b6985(0x1e2)];}}const _0x14dff3=_0x10b33e[_0x3b6985(0x1d8)](join,_0x10b33e[_0x3b6985(0x1d2)](getOpencodeConfigDir,_0x19f616),_0x3b6985(0x1e5)),_0x420718=_0x3b6985(0x1d7),_0xab4edf=_0x3b6985(0x1da);let _0x38a417={};if(_0x10b33e['HCwNo'](existsSync,_0x14dff3))try{const _0x1241a2=await _0x10b33e['zSspJ'](readFile,_0x14dff3,_0x10b33e['nvyBR']);_0x38a417=JSON['parse'](_0x1241a2);}catch(_0x3f05d3){return console['error']('⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.'),{'configured':![],'scope':_0x19f616,'error':_0x3b6985(0x1e0),'details':_0x3f05d3};}const _0x2fdd7e=Array[_0x3b6985(0x1df)](_0x38a417['plugin'])?_0x38a417['plugin']:[];if(_0x2fdd7e['includes'](_0x420718))return console[_0x3b6985(0x1ca)]('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x19f616};return _0x38a417['$schema']=_0x38a417['$schema']||_0xab4edf,_0x38a417[_0x3b6985(0x1c9)]=[..._0x2fdd7e,_0x420718],await _0x10b33e['zSspJ'](mkdir,getOpencodeConfigDir(_0x19f616),{'recursive':!![]}),await _0x10b33e[_0x3b6985(0x1d6)](writeFile,_0x14dff3,JSON[_0x3b6985(0x1db)](_0x38a417,null,0x2)+'\x0a'),console['log'](_0x3b6985(0x1c6)),{'configured':!![],'scope':_0x19f616};}
1
+ (function(_0x23f88f,_0x3c09f7){const _0x2dfd95=_0x2747,_0x31752a=_0x23f88f();while(!![]){try{const _0x504dbb=parseInt(_0x2dfd95(0xb3))/0x1+parseInt(_0x2dfd95(0xa3))/0x2*(-parseInt(_0x2dfd95(0xaa))/0x3)+parseInt(_0x2dfd95(0xbe))/0x4*(-parseInt(_0x2dfd95(0xaf))/0x5)+parseInt(_0x2dfd95(0xb6))/0x6*(-parseInt(_0x2dfd95(0xba))/0x7)+-parseInt(_0x2dfd95(0xbd))/0x8+-parseInt(_0x2dfd95(0xbc))/0x9+-parseInt(_0x2dfd95(0xb0))/0xa*(-parseInt(_0x2dfd95(0xa7))/0xb);if(_0x504dbb===_0x3c09f7)break;else _0x31752a['push'](_0x31752a['shift']());}catch(_0x35de5d){_0x31752a['push'](_0x31752a['shift']());}}}(_0x2996,0x993d5));import{join}from'path';import{existsSync}from'fs';function _0x2996(){const _0x339f9d=['plugin','https://opencode.ai/config.json','15DLycgC','@ranger-testing/opencode-plugin','User\x20(available\x20in\x20all\x20your\x20projects)','ICHXH','✓\x20OpenCode\x20plugin\x20configured','2832505fqYqtw','2028970kTwIlP','project','✓\x20OpenCode\x20plugin\x20already\x20configured','1006860QVRtbJ','mCEJF','uVXPs','17040HlzZbJ','user','Failed\x20to\x20read\x20opencode.json','Where\x20should\x20the\x20plugin\x20be\x20installed?','1764LSwChZ','log','1436166YmtnTB','8715504XPvUGi','4bsBIol','pluginScope','31946CzTZfy','⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','$schema','isArray','121zXJzqH'];_0x2996=function(){return _0x339f9d;};return _0x2996();}function _0x2747(_0x323796,_0x21d8db){_0x323796=_0x323796-0xa2;const _0x2996c0=_0x2996();let _0x274796=_0x2996c0[_0x323796];return _0x274796;}import{mkdir,readFile,writeFile}from'fs/promises';import _0x4ef52c from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x1aa9ee){const _0x32fc6d=_0x2747,_0x1955cf={'plXJQ':'pluginScope','RYmtZ':'user','uVXPs':'Project\x20(shared\x20with\x20team\x20via\x20git)','paSaq':_0x32fc6d(0xb1),'ICHXH':function(_0x4ab95c,_0x477718,_0x493099){return _0x4ab95c(_0x477718,_0x493099);},'KsGyy':'utf-8','aAkFZ':_0x32fc6d(0xa4),'mCEJF':function(_0x56cb40,_0x1613aa){return _0x56cb40(_0x1613aa);}},_0x2fc3b3=existsSync(join(getOpencodeConfigDir('project'),'opencode.json'));let _0x5729ec;if(_0x1aa9ee)_0x5729ec=_0x1aa9ee;else{if(_0x2fc3b3)_0x5729ec=_0x32fc6d(0xb1);else{console['log']('\x0a📦\x20OpenCode\x20Plugin\x0a');const _0xf001a2=await _0x4ef52c['prompt']([{'type':'list','name':_0x1955cf['plXJQ'],'message':_0x32fc6d(0xb9),'choices':[{'name':_0x32fc6d(0xac),'value':_0x1955cf['RYmtZ']},{'name':_0x1955cf[_0x32fc6d(0xb5)],'value':_0x1955cf['paSaq']}],'default':_0x32fc6d(0xb7)}]);_0x5729ec=_0xf001a2[_0x32fc6d(0xa2)];}}const _0x5657a7=_0x1955cf['ICHXH'](join,getOpencodeConfigDir(_0x5729ec),'opencode.json'),_0x2781f9=_0x32fc6d(0xab),_0xcd8f4f=_0x32fc6d(0xa9);let _0xb291ab={};if(existsSync(_0x5657a7))try{const _0x559721=await _0x1955cf[_0x32fc6d(0xad)](readFile,_0x5657a7,_0x1955cf['KsGyy']);_0xb291ab=JSON['parse'](_0x559721);}catch(_0x5edd3a){return console['error'](_0x1955cf['aAkFZ']),{'configured':![],'scope':_0x5729ec,'error':_0x32fc6d(0xb8),'details':_0x5edd3a};}const _0x36ca8a=Array[_0x32fc6d(0xa6)](_0xb291ab[_0x32fc6d(0xa8)])?_0xb291ab['plugin']:[];if(_0x36ca8a['includes'](_0x2781f9))return console['log'](_0x32fc6d(0xb2)),{'configured':![],'scope':_0x5729ec};return _0xb291ab[_0x32fc6d(0xa5)]=_0xb291ab[_0x32fc6d(0xa5)]||_0xcd8f4f,_0xb291ab['plugin']=[..._0x36ca8a,_0x2781f9],await _0x1955cf['ICHXH'](mkdir,_0x1955cf[_0x32fc6d(0xb4)](getOpencodeConfigDir,_0x5729ec),{'recursive':!![]}),await _0x1955cf['ICHXH'](writeFile,_0x5657a7,JSON['stringify'](_0xb291ab,null,0x2)+'\x0a'),console[_0x32fc6d(0xbb)](_0x32fc6d(0xae)),{'configured':!![],'scope':_0x5729ec};}
@@ -1 +1 @@
1
- (function(_0x32b6b2,_0x12d774){var _0x23556e=_0x372d,_0x58462e=_0x32b6b2();while(!![]){try{var _0x342bae=-parseInt(_0x23556e(0x180))/0x1*(parseInt(_0x23556e(0x181))/0x2)+parseInt(_0x23556e(0x17d))/0x3+parseInt(_0x23556e(0x185))/0x4*(parseInt(_0x23556e(0x17c))/0x5)+-parseInt(_0x23556e(0x17a))/0x6+parseInt(_0x23556e(0x17e))/0x7*(parseInt(_0x23556e(0x17b))/0x8)+parseInt(_0x23556e(0x188))/0x9*(parseInt(_0x23556e(0x183))/0xa)+-parseInt(_0x23556e(0x186))/0xb;if(_0x342bae===_0x12d774)break;else _0x58462e['push'](_0x58462e['shift']());}catch(_0x3fcddc){_0x58462e['push'](_0x58462e['shift']());}}}(_0x31bf,0xdf712));function _0x31bf(){var _0x393c46=['40mAOfqx','5979885ViEaxy','4008216miJxba','1063391JMouSt','iFFWY','1qSdxxZ','3432322cPrJXe','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','10UYfGCK','\x20\x20https://docs.ranger.net/main/concepts/profiles','4dnbuho','6569849CvNZap','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','10611036ejLowE','7451880wChiFF'];_0x31bf=function(){return _0x393c46;};return _0x31bf();}function _0x372d(_0x14042e,_0x1f238e){_0x14042e=_0x14042e-0x17a;var _0x31bf05=_0x31bf();var _0x372d41=_0x31bf05[_0x14042e];return _0x372d41;}export async function setupCi(_0x519286,_0x2b1fd2,_0x1cc1a9){var _0x5864b9=_0x372d,_0x1a6910={'JahEu':function(_0xac7a51,_0x4df85d){return _0xac7a51+_0x4df85d;},'jHmxy':function(_0x3b4118,_0x25ee0c){return _0x3b4118+_0x25ee0c;},'bjuDN':function(_0x41df20,_0x31b3a4){return _0x41df20+_0x31b3a4;},'iFFWY':function(_0x2e85ca,_0x8c18fe){return _0x2e85ca+_0x8c18fe;},'YlkUv':'ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a'};console['error'](_0x1a6910['JahEu'](_0x1a6910['jHmxy'](_0x1a6910['bjuDN'](_0x1a6910[_0x5864b9(0x17f)](_0x1a6910['YlkUv'],'\x0a')+_0x5864b9(0x182)+_0x5864b9(0x187),'\x0a'),'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a'),_0x5864b9(0x184))),process['exit'](0x1);}
1
+ function _0x51f7(_0x2286ce,_0x53716f){_0x2286ce=_0x2286ce-0x12f;var _0x3b7ceb=_0x3b7c();var _0x51f752=_0x3b7ceb[_0x2286ce];return _0x51f752;}function _0x3b7c(){var _0x3feacd=['2ZCOGCn','tXsyE','error','mwcci','exit','94507sOEWzl','160295FgHAHn','1500076poMrZI','TfUAB','\x20\x20https://docs.ranger.net/main/concepts/profiles','ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','2150coSVvA','301331XePTNA','ZaSXP','186042RQDDqX','156GSdnog','23121naJuzm','1806856SStihJ'];_0x3b7c=function(){return _0x3feacd;};return _0x3b7c();}(function(_0xff4b19,_0x2b3969){var _0x177ec9=_0x51f7,_0x2bd420=_0xff4b19();while(!![]){try{var _0x26c089=parseInt(_0x177ec9(0x138))/0x1+parseInt(_0x177ec9(0x13e))/0x2*(parseInt(_0x177ec9(0x13a))/0x3)+parseInt(_0x177ec9(0x133))/0x4+-parseInt(_0x177ec9(0x132))/0x5+-parseInt(_0x177ec9(0x13b))/0x6*(-parseInt(_0x177ec9(0x131))/0x7)+-parseInt(_0x177ec9(0x13d))/0x8+parseInt(_0x177ec9(0x13c))/0x9*(-parseInt(_0x177ec9(0x137))/0xa);if(_0x26c089===_0x2b3969)break;else _0x2bd420['push'](_0x2bd420['shift']());}catch(_0x1d12ce){_0x2bd420['push'](_0x2bd420['shift']());}}}(_0x3b7c,0x44263));export async function setupCi(_0x574d6c,_0x2fd998,_0x44cc88){var _0x3866a8=_0x51f7,_0x40d568={'TfUAB':function(_0x1775e6,_0x4e7b80){return _0x1775e6+_0x4e7b80;},'mwcci':function(_0x5b402d,_0xeb0a3){return _0x5b402d+_0xeb0a3;},'ZaSXP':_0x3866a8(0x136),'MJHGP':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','tXsyE':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','YhOzK':_0x3866a8(0x135)};console[_0x3866a8(0x140)](_0x40d568[_0x3866a8(0x134)](_0x40d568[_0x3866a8(0x12f)](_0x40d568[_0x3866a8(0x134)](_0x40d568[_0x3866a8(0x139)]+'\x0a',_0x40d568['MJHGP'])+_0x40d568[_0x3866a8(0x13f)],'\x0a')+'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a',_0x40d568['YhOzK'])),process[_0x3866a8(0x130)](0x1);}
@@ -1 +1 @@
1
- function _0x2c2c(_0x255d74,_0x4f78f9){_0x255d74=_0x255d74-0x1ed;const _0x1bcad3=_0x1bca();let _0x2c2c5d=_0x1bcad3[_0x255d74];return _0x2c2c5d;}(function(_0x31203c,_0x4fbd52){const _0x4f55d4=_0x2c2c,_0x1a6a61=_0x31203c();while(!![]){try{const _0x1d491e=parseInt(_0x4f55d4(0x216))/0x1+parseInt(_0x4f55d4(0x20a))/0x2*(parseInt(_0x4f55d4(0x200))/0x3)+-parseInt(_0x4f55d4(0x20f))/0x4+parseInt(_0x4f55d4(0x1f4))/0x5+parseInt(_0x4f55d4(0x208))/0x6*(-parseInt(_0x4f55d4(0x1ff))/0x7)+-parseInt(_0x4f55d4(0x217))/0x8*(-parseInt(_0x4f55d4(0x1fc))/0x9)+-parseInt(_0x4f55d4(0x204))/0xa;if(_0x1d491e===_0x4fbd52)break;else _0x1a6a61['push'](_0x1a6a61['shift']());}catch(_0x126176){_0x1a6a61['push'](_0x1a6a61['shift']());}}}(_0x1bca,0x71b25));function _0x1bca(){const _0x61d7da=['\x20\x203.\x20Run:\x20ranger\x20skillup','warn','list','To\x20get\x20started:','819295VkwXLT','5613528FMqcSk','\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a','\x20<your-api-token>','project-level','stdin','This\x20project\x20only\x20(','/skills/','Where\x20should\x20skills\x20be\x20installed?','\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!','EgJSy','qNfFb','installLevel','277980fWCPso','\x0a✅\x20Installed\x20','zcYib','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','opencode','log','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','9rbhPQZ','autoInstall','OOmkR','14SDkqHW','669996RfrBUv','suppressUsage','\x20--opencode','\x20successfully!\x0a','5340460zfCPBq','/.opencode/skills/','user-level','Xhuub','1280352jqdKji','/.claude/skills/','4lieQGD','✓\x20Found\x20API\x20token','ShxqH','stdout','WZTvW','2386860ZnrpxT','YhjJQ','VCTlN'];_0x1bca=function(){return _0x61d7da;};return _0x1bca();}import{basename}from'path';import _0x454d56 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x1470f2={}){const _0xd9f5d=_0x2c2c,_0x7e8d0f={'odBzb':'claude','OOmkR':function(_0x38b389){return _0x38b389();},'YhjJQ':function(_0x35ddb1,_0x2e3742){return _0x35ddb1===_0x2e3742;},'MZFsv':function(_0x50e26e,_0x48bf6c){return _0x50e26e===_0x48bf6c;},'xApas':function(_0x4e03c1){return _0x4e03c1();},'EgJSy':function(_0x36dcbd,_0x2bdb82){return _0x36dcbd(_0x2bdb82);},'jGDBZ':_0xd9f5d(0x1f8),'daAra':function(_0x58c6e3,_0x303104){return _0x58c6e3(_0x303104);},'xQDRd':'user','qNfFb':_0xd9f5d(0x1ef),'WZTvW':'\x0a📦\x20Installing\x20skills...\x0a','zcYib':function(_0x4b728d,_0x5b09d8){return _0x4b728d instanceof _0x5b09d8;},'ShxqH':function(_0x138dde,_0x41e04d){return _0x138dde>_0x41e04d;},'CRLvf':function(_0x46599a,_0x59ec02){return _0x46599a===_0x59ec02;},'VCTlN':_0xd9f5d(0x206),'Xhuub':_0xd9f5d(0x21a),'WrpHP':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','VkpjI':_0xd9f5d(0x1f0),'ZfVTE':_0xd9f5d(0x218)};console[_0xd9f5d(0x1f9)](_0xd9f5d(0x1fa));const _0x582ecf=_0x1470f2['platform']??_0x7e8d0f['odBzb'],_0xac0348=await _0x7e8d0f[_0xd9f5d(0x1fe)](getToken);if(!_0xac0348){console['log']('❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a'),console[_0xd9f5d(0x1f9)](_0xd9f5d(0x215)),console[_0xd9f5d(0x1f9)](_0xd9f5d(0x1f7)),console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x7e8d0f['YhjJQ'](_0x582ecf,_0xd9f5d(0x1f8))?'\x20--opencode':'')+_0xd9f5d(0x219)),console[_0xd9f5d(0x1f9)](_0xd9f5d(0x212)+(_0x7e8d0f['MZFsv'](_0x582ecf,_0xd9f5d(0x1f8))?_0xd9f5d(0x202):'')+'\x0a');return;}console[_0xd9f5d(0x1f9)](_0xd9f5d(0x20b));const _0x245ca0=_0x7e8d0f['xApas'](getProjectRoot),_0x16fcc2=_0x7e8d0f[_0xd9f5d(0x1f1)](basename,_0x245ca0),_0x165a41=_0x7e8d0f[_0xd9f5d(0x210)](_0x582ecf,_0x7e8d0f['jGDBZ'])?_0x7e8d0f['daAra'](getOpencodeConfigDir,_0x7e8d0f['xQDRd'])+'/skills/':getClaudeConfigDir()+_0xd9f5d(0x1ee),_0x51b9b9=_0x582ecf===_0xd9f5d(0x1f8)?_0x245ca0+_0xd9f5d(0x205):_0x245ca0+_0xd9f5d(0x209),_0x483eda=process[_0xd9f5d(0x21b)]['isTTY']&&process[_0xd9f5d(0x20d)]['isTTY'];let _0x446080;if(_0x1470f2[_0xd9f5d(0x1fd)])_0x446080=_0x1470f2[_0xd9f5d(0x1fd)];else{if(_0x483eda){const _0x476d44=await _0x454d56['prompt']([{'type':_0xd9f5d(0x214),'name':_0xd9f5d(0x1f3),'message':_0x7e8d0f[_0xd9f5d(0x1f2)],'choices':[{'name':'All\x20projects\x20('+_0x165a41+')','value':'user'},{'name':_0xd9f5d(0x1ed)+_0x51b9b9+')','value':'project'}]}]);_0x446080=_0x476d44[_0xd9f5d(0x1f3)];}else _0x446080='project',console['log']('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x51b9b9+')');}let _0xd7913e=0x0;const _0x451892=_0x7e8d0f[_0xd9f5d(0x1fe)](getCurrentVersion);console[_0xd9f5d(0x1f9)](_0x7e8d0f[_0xd9f5d(0x20e)]);try{const _0x3daabb=await installSkill('ranger',{'cliVersion':_0x451892,'level':_0x446080,'platform':_0x582ecf});_0x3daabb&&_0xd7913e++;}catch(_0x837269){console[_0xd9f5d(0x213)](_0xd9f5d(0x1fb),_0x7e8d0f[_0xd9f5d(0x1f6)](_0x837269,Error)?_0x837269['message']:_0x837269);}if(_0x7e8d0f[_0xd9f5d(0x20c)](_0xd7913e,0x0)){const _0x5c6a63=_0x7e8d0f['CRLvf'](_0x446080,_0x7e8d0f['xQDRd'])?_0x7e8d0f[_0xd9f5d(0x211)]:_0x7e8d0f[_0xd9f5d(0x207)];console[_0xd9f5d(0x1f9)](_0xd9f5d(0x1f5)+_0xd7913e+'\x20'+_0x5c6a63+'\x20skill'+(_0xd7913e>0x1?'s':'')+_0xd9f5d(0x203)),!_0x1470f2[_0xd9f5d(0x201)]&&(console[_0xd9f5d(0x1f9)]('To\x20use:'),_0x582ecf===_0x7e8d0f['jGDBZ']?console['log'](_0x7e8d0f['WrpHP']):console[_0xd9f5d(0x1f9)](_0x7e8d0f['VkpjI']));}else console['log'](_0x7e8d0f['ZfVTE']);}
1
+ (function(_0x226384,_0x539963){const _0x45de50=_0x1470,_0x1e8c21=_0x226384();while(!![]){try{const _0x161667=parseInt(_0x45de50(0x112))/0x1*(-parseInt(_0x45de50(0xfb))/0x2)+parseInt(_0x45de50(0x123))/0x3+parseInt(_0x45de50(0x114))/0x4+-parseInt(_0x45de50(0x10b))/0x5+parseInt(_0x45de50(0x124))/0x6+-parseInt(_0x45de50(0x120))/0x7*(parseInt(_0x45de50(0x100))/0x8)+parseInt(_0x45de50(0x115))/0x9;if(_0x161667===_0x539963)break;else _0x1e8c21['push'](_0x1e8c21['shift']());}catch(_0x1d4fc5){_0x1e8c21['push'](_0x1e8c21['shift']());}}}(_0x2d79,0x48c22));import{basename}from'path';import _0x14043c from'inquirer';import{getToken}from'./utils/keychain.js';function _0x1470(_0x58813c,_0x188c50){_0x58813c=_0x58813c-0xfa;const _0x2d7961=_0x2d79();let _0x147012=_0x2d7961[_0x58813c];return _0x147012;}import{installSkill}from'./utils/skills.js';function _0x2d79(){const _0x591b4d=['user','191384fFBrPd','QIkHE','uMGyg','isTTY','opencode','stdin','\x20\x203.\x20Run:\x20ranger\x20skillup','To\x20get\x20started:','Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20(','iUGFA','installLevel','2419910dIZkzh','zzqjD','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','Where\x20should\x20skills\x20be\x20installed?','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','autoInstall','\x0a✅\x20Installed\x20','290LHcBPS','xXxce','282268crlidE','4015161CxBQpG','RCKWA','This\x20project\x20only\x20(','\x20\x20Failed\x20to\x20install\x20ranger\x20skill:','hTDSR','/.opencode/skills/','list','stdout','\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','log','ICIpN','7VbIxzf','uDfqM','platform','447354IzgLkL','1788954TgXyOb','✓\x20Found\x20API\x20token','\x20successfully!\x0a','1090FAUgjY','warn','sHxLp','\x0a📦\x20Installing\x20skills...\x0a'];_0x2d79=function(){return _0x591b4d;};return _0x2d79();}import{getCurrentVersion}from'./utils/version.js';import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x19704f={}){const _0x23ff66=_0x1470,_0x5b280a={'iUGFA':_0x23ff66(0x10f),'ICIpN':'opencode','nrrNG':'\x20--opencode','QIkHE':_0x23ff66(0x125),'RCKWA':function(_0x50c83b){return _0x50c83b();},'zWVHD':function(_0x4effca,_0x2c5224){return _0x4effca===_0x2c5224;},'hTDSR':function(_0x34e185,_0x169d8e){return _0x34e185(_0x169d8e);},'gjaju':_0x23ff66(0x11b),'zzqjD':'project','KBdrU':function(_0x4a4f0c){return _0x4a4f0c();},'KRdxB':_0x23ff66(0xfe),'OciCL':function(_0x1bbc1d,_0x83bcde,_0xae5972){return _0x1bbc1d(_0x83bcde,_0xae5972);},'vgiov':_0x23ff66(0x118),'uMGyg':function(_0x1051c6,_0x509c42){return _0x1051c6===_0x509c42;},'uDfqM':'user-level','xXxce':function(_0x284c65,_0x12e717){return _0x284c65>_0x12e717;},'PDFdw':'To\x20use:','sHxLp':'\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!'};console[_0x23ff66(0x11e)](_0x5b280a[_0x23ff66(0x109)]);const _0xd7596f=_0x19704f[_0x23ff66(0x122)]??'claude',_0x1587ec=await getToken();if(!_0x1587ec){console[_0x23ff66(0x11e)]('❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a'),console['log'](_0x23ff66(0x107)),console['log'](_0x23ff66(0x10d)),console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0xd7596f===_0x5b280a['ICIpN']?'\x20--opencode':'')+'\x20<your-api-token>'),console[_0x23ff66(0x11e)](_0x23ff66(0x106)+(_0xd7596f===_0x5b280a[_0x23ff66(0x11f)]?_0x5b280a['nrrNG']:'')+'\x0a');return;}console['log'](_0x5b280a[_0x23ff66(0x101)]);const _0x2d7a32=_0x5b280a['RCKWA'](getProjectRoot),_0x3d2a40=basename(_0x2d7a32),_0x214d85=_0x5b280a['zWVHD'](_0xd7596f,_0x23ff66(0x104))?_0x5b280a[_0x23ff66(0x119)](getOpencodeConfigDir,'user')+'/skills/':_0x5b280a[_0x23ff66(0x116)](getClaudeConfigDir)+'/skills/',_0xf6ac7c=_0xd7596f==='opencode'?_0x2d7a32+_0x23ff66(0x11a):_0x2d7a32+'/.claude/skills/',_0x4cec07=process[_0x23ff66(0x105)][_0x23ff66(0x103)]&&process[_0x23ff66(0x11c)]['isTTY'];let _0x11b080;if(_0x19704f['autoInstall'])_0x11b080=_0x19704f[_0x23ff66(0x110)];else{if(_0x4cec07){const _0x5a1ce0=await _0x14043c['prompt']([{'type':_0x5b280a['gjaju'],'name':'installLevel','message':_0x23ff66(0x10e),'choices':[{'name':'All\x20projects\x20('+_0x214d85+')','value':_0x23ff66(0xff)},{'name':_0x23ff66(0x117)+_0xf6ac7c+')','value':_0x5b280a[_0x23ff66(0x10c)]}]}]);_0x11b080=_0x5a1ce0[_0x23ff66(0x10a)];}else _0x11b080='project',console['log'](_0x23ff66(0x108)+_0xf6ac7c+')');}let _0x559503=0x0;const _0x4dfb41=_0x5b280a['KBdrU'](getCurrentVersion);console['log'](_0x5b280a['KRdxB']);try{const _0x495ab2=await _0x5b280a['OciCL'](installSkill,'ranger',{'cliVersion':_0x4dfb41,'level':_0x11b080,'platform':_0xd7596f});_0x495ab2&&_0x559503++;}catch(_0x5e3ff5){console[_0x23ff66(0xfc)](_0x5b280a['vgiov'],_0x5e3ff5 instanceof Error?_0x5e3ff5['message']:_0x5e3ff5);}if(_0x559503>0x0){const _0x25d070=_0x5b280a[_0x23ff66(0x102)](_0x11b080,_0x23ff66(0xff))?_0x5b280a[_0x23ff66(0x121)]:'project-level';console['log'](_0x23ff66(0x111)+_0x559503+'\x20'+_0x25d070+'\x20skill'+(_0x5b280a[_0x23ff66(0x113)](_0x559503,0x1)?'s':'')+_0x23ff66(0xfa)),!_0x19704f['suppressUsage']&&(console[_0x23ff66(0x11e)](_0x5b280a['PDFdw']),_0x5b280a[_0x23ff66(0x102)](_0xd7596f,'opencode')?console['log'](_0x23ff66(0x11d)):console[_0x23ff66(0x11e)](_0x5b280a[_0x23ff66(0xfd)]));}else console['log']('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}
@@ -1 +1 @@
1
- const _0x5a6c3d=_0x361e;(function(_0x108191,_0x4fad2e){const _0xe6ff6f=_0x361e,_0x3bc352=_0x108191();while(!![]){try{const _0x2a693e=-parseInt(_0xe6ff6f(0xd5))/0x1+parseInt(_0xe6ff6f(0xca))/0x2+-parseInt(_0xe6ff6f(0xde))/0x3+-parseInt(_0xe6ff6f(0xc6))/0x4+-parseInt(_0xe6ff6f(0xcd))/0x5*(-parseInt(_0xe6ff6f(0x10c))/0x6)+-parseInt(_0xe6ff6f(0x105))/0x7+parseInt(_0xe6ff6f(0x10d))/0x8;if(_0x2a693e===_0x4fad2e)break;else _0x3bc352['push'](_0x3bc352['shift']());}catch(_0xb4c598){_0x3bc352['push'](_0x3bc352['shift']());}}}(_0x57a3,0xa22b1));import{mkdir,writeFile}from'fs/promises';import{join,dirname}from'path';function _0x57a3(){const _0x593d2b=['MutqO',');\x20retrying...','aeOWn','playwright/package.json','2857320yoqCiz','✓\x20Stored\x20credentials\x20locally','UWONJ','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','skills','skipAuth','rVxFa','DBQbJ','JErwW','ugWaz','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','✓\x20Exported\x20credentials\x20for\x20CI','✓\x20~/.ranger/\x20directory\x20already\x20exists','✓\x20Created\x20.ranger/.gitignore','oMMBI','✓\x20Local\x20profile\x20already\x20exists','\x20failed\x20(','DNvYM','ranger\x20profile\x20add\x20<name>','...','ZqJLX','Nhrou','executablePath','\x0aInstalling\x20Chromium\x20browser...\x0a','log','AUQiO','✓\x20Authenticated\x20to\x20','chromium','FRSxV','\x20\x20npx\x20playwright@','close','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','OuNbR','kHBLu','tgYEM','FjedQ','QHoDL','VGZag','env','1437604IPuuzQ','inherit','pWNSQ','opencode','\x0a\x20\x20','CEgwG','error','558ZWRusu','11772712EUdVTy','\x20\x20\x20\x20RANGER_CHROMIUM_INSTALL_TIMEOUT_MS=1800000\x20ranger\x20setup\x20deps','MaXZh','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','stdout','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','platform','hELbN','FiDGY','rgqjw','Validating\x20API\x20token...','\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','confirm','skipChromium','profile','EtVvj','install','method','status','user','You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:','success','DXuGK','\x0a\x20\x20Chromium\x20install\x20timed\x20out\x20(limit\x20','force','skipped','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','\x20install\x20chromium','s).\x20On\x20a\x20slow\x20or\x20proxied\x20connection,\x20raise\x20the\x20limit\x20and\x20retry,\x20e.g.:\x0a','trackPhaseEnd','Kmrjh','2050008GQjAdV','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','RANGER_CHROMIUM_INSTALL_TIMEOUT_MS','scope','1781836DIUzVY','exit','auth','54195RQTFUn','device_auth','XmBlb','dNYrw','Yquyt','ZkGea','withDeps','GbDVR','1035979MFAlGL','trackPhaseStart','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','message','ApbCV'];_0x57a3=function(){return _0x593d2b;};return _0x57a3();}import{existsSync}from'fs';import{createRequire}from'module';import _0x5b86ff from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';function _0x361e(_0x48d94e,_0x9e7399){_0x48d94e=_0x48d94e-0xbd;const _0x57a356=_0x57a3();let _0x361e76=_0x57a356[_0x48d94e];return _0x361e76;}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';import{spawn}from'child_process';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.56.1';const bold=_0x3e1005=>'\x1b[1m'+_0x3e1005+'\x1b[0m';export function getPlaywrightVersion(){const _0x3dcb7a=_0x361e,_0x32edfd={'MutqO':_0x3dcb7a(0xdd),'LHHGq':function(_0x4356e4,_0x5119c2){return _0x4356e4(_0x5119c2);}};try{const _0x245348=require['resolve'](_0x32edfd[_0x3dcb7a(0xda)]),_0x53ca66=_0x32edfd['LHHGq'](require,_0x245348);return _0x53ca66['version'];}catch{return null;}}function resolveBundledPlaywrightCli(){const _0x1f100c=_0x361e,_0x35a1f6={'EtVvj':function(_0x5a8257,_0x1d3677,_0x3ca348){return _0x5a8257(_0x1d3677,_0x3ca348);},'FRSxV':function(_0x32ada0,_0x551942){return _0x32ada0(_0x551942);},'jlXCS':_0x1f100c(0xdd)};try{const _0x29316f=_0x35a1f6[_0x1f100c(0x11d)](join,_0x35a1f6[_0x1f100c(0xfa)](dirname,require['resolve'](_0x35a1f6['jlXCS'])),'cli.js');return existsSync(_0x29316f)?_0x29316f:null;}catch{return null;}}const CHROMIUM_INSTALL_TIMEOUT_MS=Number(process[_0x5a6c3d(0x104)][_0x5a6c3d(0xc8)])||0x927c0;class ChromiumInstallTimeoutError extends Error{}export async function installChromiumBinary(_0x3b5321,_0x1e1e62=![]){const _0x43a44a=_0x5a6c3d,_0x553291={'yCCYI':function(_0x5e7181){return _0x5e7181();},'nkNDL':'npx','VGZag':_0x43a44a(0x11e),'rgqjw':function(_0x299958,_0x391769,_0x219626){return _0x299958(_0x391769,_0x219626);},'QBoff':function(_0x301798,_0x19069c){return _0x301798+_0x19069c;},'KdbEn':function(_0x82baa7,_0x5e2fd4){return _0x82baa7/_0x5e2fd4;}},_0x5434d1=_0x553291['yCCYI'](resolveBundledPlaywrightCli),_0x31166d=_0x5434d1?process['execPath']:_0x553291['nkNDL'],_0x173552=[_0x5434d1??'playwright@'+_0x3b5321,_0x553291[_0x43a44a(0x103)],..._0x1e1e62?['--with-deps']:[],_0x43a44a(0xf9)];let _0x30d6d3=![];for(let _0x207953=0x1;;_0x207953++){try{await _0x553291[_0x43a44a(0x117)](runChromiumInstall,_0x31166d,_0x173552);return;}catch(_0x1a8645){_0x1a8645 instanceof ChromiumInstallTimeoutError&&!_0x30d6d3&&(_0x30d6d3=!![],console['log'](_0x553291['QBoff'](_0x43a44a(0xbe)+Math['round'](_0x553291['KdbEn'](CHROMIUM_INSTALL_TIMEOUT_MS,0x3e8))+_0x43a44a(0xc3),_0x43a44a(0x10e))));if(_0x207953>=0x3)throw _0x1a8645;const _0x38180a=_0x1a8645 instanceof Error?_0x1a8645['message']:String(_0x1a8645);console[_0x43a44a(0xf6)]('\x20\x20Chromium\x20install\x20attempt\x20'+_0x207953+_0x43a44a(0xee)+_0x38180a+_0x43a44a(0xdb));}}}function runChromiumInstall(_0x4d7011,_0x4b6f03){const _0x1cab5f={'oMMBI':function(_0x4c68f0,_0x11a575){return _0x4c68f0(_0x11a575);},'MrbNl':'SIGKILL','YtEHT':function(_0x2a2591,_0x29064e){return _0x2a2591/_0x29064e;},'DXuGK':function(_0x32e31d,_0x18dca3,_0x31f355,_0xe1a1bb){return _0x32e31d(_0x18dca3,_0x31f355,_0xe1a1bb);},'DPJmu':function(_0x50da44,_0x181460){return _0x50da44===_0x181460;},'wEbFG':'win32','dBBGg':function(_0x11b9a6,_0x4a17af,_0xb87270){return _0x11b9a6(_0x4a17af,_0xb87270);},'ZzjCu':'error'};return new Promise((_0x34bc72,_0xcc950)=>{const _0x563223=_0x361e,_0x58c765={'AUQiO':_0x1cab5f['MrbNl'],'yVgwM':function(_0x234098,_0x528d39){const _0x48b4e7=_0x361e;return _0x1cab5f[_0x48b4e7(0xec)](_0x234098,_0x528d39);},'Yquyt':function(_0x264151,_0x923c62){return _0x1cab5f['YtEHT'](_0x264151,_0x923c62);},'tdvGo':function(_0x426bbb,_0x5b2cd7){const _0x55b5f4=_0x361e;return _0x1cab5f[_0x55b5f4(0xec)](_0x426bbb,_0x5b2cd7);},'QHoDL':function(_0xbfa559,_0x55ed4a){return _0xbfa559(_0x55ed4a);}},_0x259118=_0x1cab5f[_0x563223(0xbd)](spawn,_0x4d7011,_0x4b6f03,{'stdio':['ignore','inherit',_0x563223(0x106)],'shell':_0x1cab5f['DPJmu'](process[_0x563223(0x114)],_0x1cab5f['wEbFG'])}),_0x395bc5=_0x1cab5f['dBBGg'](setTimeout,()=>{const _0x412b0d=_0x563223;_0x259118['kill'](_0x58c765[_0x412b0d(0xf7)]),_0x58c765['yVgwM'](_0xcc950,new ChromiumInstallTimeoutError('Chromium\x20install\x20timed\x20out\x20after\x20'+Math['round'](_0x58c765[_0x412b0d(0xd1)](CHROMIUM_INSTALL_TIMEOUT_MS,0x3e8))+'s'));},CHROMIUM_INSTALL_TIMEOUT_MS);_0x259118['on'](_0x563223(0xfc),_0x3f5c19=>{const _0x58ccae=_0x563223;_0x1cab5f[_0x58ccae(0xec)](clearTimeout,_0x395bc5);if(_0x3f5c19===0x0)_0x34bc72();else _0xcc950(new Error('Installation\x20failed\x20with\x20exit\x20code\x20'+_0x3f5c19));}),_0x259118['on'](_0x1cab5f['ZzjCu'],_0x106d3b=>{const _0x37ffb4=_0x563223;_0x58c765['tdvGo'](clearTimeout,_0x395bc5),_0x58c765[_0x37ffb4(0x102)](_0xcc950,_0x106d3b);});});}export async function authenticate(_0x17e012){const _0x5c4e05=_0x5a6c3d,_0x48608d={'jpREn':function(_0x3800ac,_0xdb6f9e){return _0x3800ac instanceof _0xdb6f9e;},'DBQbJ':function(_0x2d8224,_0x29ea5d){return _0x2d8224(_0x29ea5d);},'hELbN':_0x5c4e05(0xe9),'AYkTY':_0x5c4e05(0xdf)};if(!_0x17e012){const _0x54fe22=await getToken();if(_0x54fe22){const _0x451c3c=await getCurrentUser(_0x54fe22);if(_0x451c3c['success'])return console[_0x5c4e05(0xf6)]('✓\x20Already\x20authenticated\x20to\x20'+_0x451c3c['user']['organizationName']),{'token':_0x54fe22,'method':'existing_token'};}try{_0x17e012=await runDeviceAuthFlow();}catch(_0x750023){throw new Error('Authentication\x20failed:\x20'+(_0x48608d['jpREn'](_0x750023,Error)?_0x750023['message']:_0x750023));}const _0x4518fb=await _0x48608d[_0x5c4e05(0xe5)](getCurrentUser,_0x17e012);if(!_0x4518fb['success'])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x4518fb['error']);return console['log'](_0x5c4e05(0xf8)+_0x4518fb[_0x5c4e05(0x121)]['organizationName']),{'token':_0x17e012,'method':_0x5c4e05(0xce)};}console['log'](_0x5c4e05(0x118));const _0x20a7ec=await _0x48608d[_0x5c4e05(0xe5)](getCurrentUser,_0x17e012);if(!_0x20a7ec[_0x5c4e05(0x123)]){if(_0x20a7ec[_0x5c4e05(0x120)])throw new Error('Authentication\x20failed:\x20'+_0x20a7ec['error']+_0x5c4e05(0x110));else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x20a7ec[_0x5c4e05(0x10b)]+_0x5c4e05(0xfd));}return console[_0x5c4e05(0xf6)](_0x5c4e05(0xf8)+_0x20a7ec['user']['organizationName']),await storeToken(_0x17e012),console['log'](process[_0x5c4e05(0x104)]['GITHUB_ENV']?_0x48608d[_0x5c4e05(0x115)]:_0x48608d['AYkTY']),{'token':_0x17e012,'method':'provided_token'};}export async function ensureRangerDir(_0x4c943c){const _0x303715=_0x5a6c3d,_0x41f2a1={'qsNYW':function(_0x112b57,_0x275e50){return _0x112b57(_0x275e50);},'MaXZh':_0x303715(0xea)};void _0x4c943c;const _0x3a8499=getRangerHomeDir();return!_0x41f2a1['qsNYW'](existsSync,_0x3a8499)?(await mkdir(_0x3a8499,{'recursive':!![]}),console['log']('✓\x20Created\x20~/.ranger/\x20directory'),{'path':_0x3a8499,'installed':!![]}):(console[_0x303715(0xf6)](_0x41f2a1[_0x303715(0x10f)]),{'path':_0x3a8499,'installed':![]});}export async function ensureChromium(_0x16ab01=![]){const _0x2b13f7=_0x5a6c3d,_0x50260c={'JErwW':function(_0x3d8154){return _0x3d8154();},'CEgwG':function(_0x7546e7,_0x3d55b2){return _0x7546e7??_0x3d55b2;},'ZePjY':'\x20(fallback\x20version)','pOCRH':_0x2b13f7(0xf5),'jFhBg':'\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','Nhrou':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','LNywt':function(_0x22b226,_0x500ca5){return _0x22b226 instanceof _0x500ca5;},'XmBlb':'\x0a⚠\x20Skipping\x20Chromium\x20installation.'};let _0x2cb506=![];try{const _0x471413=chromium[_0x2b13f7(0xf4)]();_0x2cb506=existsSync(_0x471413);}catch{_0x2cb506=![];}if(_0x2cb506)return console[_0x2b13f7(0xf6)]('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x22d4c2=_0x50260c[_0x2b13f7(0xe6)](getPlaywrightVersion),_0x4c31db=_0x50260c[_0x2b13f7(0x10a)](_0x22d4c2,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x2e81a9=!_0x22d4c2,_0x3c7357=process['stdin']['isTTY']&&process[_0x2b13f7(0x111)]['isTTY'];let _0x253793=!![];if(_0x3c7357){const {install:_0x330e01}=await _0x5b86ff['prompt']([{'type':_0x2b13f7(0x11a),'name':_0x2b13f7(0x11e),'message':_0x2e81a9?'Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20'+_0x4c31db+'\x20now?':'The\x20required\x20version\x20('+_0x4c31db+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x253793=_0x330e01;}else console[_0x2b13f7(0xf6)](_0x2b13f7(0xe8)+_0x4c31db+(_0x2e81a9?_0x50260c['ZePjY']:'')+_0x2b13f7(0xf1));if(_0x253793){console['log'](_0x50260c['pOCRH']);try{await installChromiumBinary(_0x4c31db,_0x16ab01),console['log'](_0x50260c['jFhBg']);}catch(_0x43caba){console['error'](_0x50260c[_0x2b13f7(0xf3)],_0x50260c['LNywt'](_0x43caba,Error)?_0x43caba[_0x2b13f7(0xd8)]:_0x43caba),console[_0x2b13f7(0xf6)]('You\x20can\x20install\x20it\x20manually\x20by\x20running:'),console[_0x2b13f7(0xf6)]('\x20\x20npx\x20playwright@'+_0x4c31db+_0x2b13f7(0xc2));}}else console['log'](_0x50260c[_0x2b13f7(0xcf)]),console[_0x2b13f7(0xf6)](_0x2b13f7(0x122)),console['log'](_0x2b13f7(0xfb)+_0x4c31db+_0x2b13f7(0xc2));return!![];}export async function writeRangerGitignore(_0x49c14c){const _0x11228f=_0x5a6c3d,_0x331b99={'YNjcF':function(_0x13986c,_0x1a77d9,_0x345830){return _0x13986c(_0x1a77d9,_0x345830);},'FiDGY':_0x11228f(0xeb)},_0x7b977c=_0x331b99['YNjcF'](join,_0x49c14c,'.gitignore'),_0x23359b='\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 _0x331b99['YNjcF'](writeFile,_0x7b977c,_0x23359b),console['log'](_0x331b99[_0x11228f(0x116)]);}export async function ensureLocalEnv(_0x4419b6,_0x107f70){const _0xcb675b=_0x5a6c3d,_0x1c8a48={'Ocyyf':function(_0x5c6d2e){return _0x5c6d2e();},'raFgC':'user','aeOWn':'local','tgYEM':function(_0x288825,_0x7807a0){return _0x288825 instanceof _0x7807a0;}};if(!_0x1c8a48['Ocyyf'](findGitRoot)&&_0x4419b6?.[_0xcb675b(0xc9)]!==_0x1c8a48['raFgC'])return console[_0xcb675b(0xf6)](_0xcb675b(0x113)),{'ready':![],'skipped':!![]};const _0x5e68ed=_0x4419b6?.['scope']===_0x1c8a48['raFgC']?_0x1c8a48['Ocyyf'](getRangerHomeDir):undefined;if(findExistingEnv(_0x1c8a48[_0xcb675b(0xdc)],{'locations':[_0x1c8a48['aeOWn']],'rangerDir':_0x5e68ed}))return console[_0xcb675b(0xf6)](_0xcb675b(0xed)),{'ready':!![],'skipped':![]};try{return await addEnv('local',{'url':_0x4419b6?.['url'],'force':_0x4419b6?.[_0xcb675b(0xbf)],'allowInsecureLocalhost':_0x4419b6?.['allowInsecureLocalhost'],'scope':_0x4419b6?.['scope']},_0x107f70),{'ready':!![],'skipped':![]};}catch(_0x3314cc){return console[_0xcb675b(0x10b)]('\x0a❌\x20Profile\x20setup\x20failed:',_0x1c8a48[_0xcb675b(0x100)](_0x3314cc,Error)?_0x3314cc[_0xcb675b(0xd8)]:_0x3314cc),{'ready':![],'skipped':![]};}}export async function start(_0xdb8ce2,_0x55863c,_0x307674){const _0x1bfcce=_0x5a6c3d,_0x1fe5e8={'FjedQ':'\x0a🚀\x20Ranger\x20Setup\x0a','XKQle':function(_0x18cc3e,_0x1ca6d6){return _0x18cc3e+_0x1ca6d6;},'ZqJLX':function(_0x31ffdf){return _0x31ffdf();},'pWNSQ':'user','ugWaz':'✓\x20Skipping\x20authentication\x20(--skip-auth)','dNYrw':'chromium','DfShJ':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','ZkGea':function(_0x3af8f9,_0x346925){return _0x3af8f9(_0x346925);},'GbDVR':'plugin','UWONJ':'skills','OuNbR':'ranger','ApbCV':_0x1bfcce(0x108),'DNvYM':function(_0x38f994,_0x419ec1){return _0x38f994 instanceof _0x419ec1;},'ddPRQ':'\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','qexxr':_0x1bfcce(0x11c),'RpSvM':function(_0x29aefa,_0x1f17e9,_0x1cac7d){return _0x29aefa(_0x1f17e9,_0x1cac7d);},'nTQqu':function(_0x23bc33,_0x7ebcc7){return _0x23bc33+_0x7ebcc7;},'kHBLu':_0x1bfcce(0x112),'ELFau':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','rVxFa':'/ranger:enable','Kmrjh':function(_0x233894,_0x561095){return _0x233894+_0x561095;},'qQvfq':function(_0xc14d38,_0x3a85ea){return _0xc14d38+_0x3a85ea;}};console[_0x1bfcce(0xf6)](_0x1fe5e8[_0x1bfcce(0x101)]);_0x55863c?.[_0x1bfcce(0xc9)]!==undefined&&_0x55863c[_0x1bfcce(0xc9)]!==_0x1bfcce(0x121)&&(console['error'](_0x1fe5e8['XKQle'](_0x1fe5e8['XKQle']('ranger\x20setup\x20--scope='+String(_0x55863c[_0x1bfcce(0xc9)])+'\x20is\x20no\x20longer\x20supported.\x20','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20'),_0x1bfcce(0xd7))),process[_0x1bfcce(0xcb)](0x1));_0x55863c={..._0x55863c,'scope':'user'};const _0x16df40=!existsSync(_0x1fe5e8[_0x1bfcce(0xf2)](getRangerHomeDir));await ensureRangerDir(_0x1fe5e8[_0x1bfcce(0x107)]);if(_0x55863c?.['skipAuth'])console['log'](_0x1fe5e8[_0x1bfcce(0xe7)]),_0x307674?.['trackPhaseEnd']('auth',{'isFirstRun':_0x16df40,'method':_0x1bfcce(0xc0)});else{_0x307674?.[_0x1bfcce(0xd6)](_0x1bfcce(0xcc));const _0x3baff8=await authenticate(_0xdb8ce2);_0x307674?.['trackPhaseEnd']('auth',{'isFirstRun':_0x16df40,'method':_0x3baff8[_0x1bfcce(0x11f)]});}_0x307674?.['trackPhaseStart'](_0x1fe5e8[_0x1bfcce(0xd0)]);_0x55863c?.['skipChromium']?console['log'](_0x1fe5e8['DfShJ']):await _0x1fe5e8[_0x1bfcce(0xd2)](ensureChromium,_0x55863c?.[_0x1bfcce(0xd3)]);_0x307674?.[_0x1bfcce(0xc4)](_0x1bfcce(0xf9),{'isFirstRun':_0x16df40,'skipped':!!_0x55863c?.[_0x1bfcce(0x11b)]}),console[_0x1bfcce(0xf6)]('\x0a✅\x20Ranger\x20setup\x20complete!\x0a');const _0x3fbcd0=_0x55863c?.['scope'],_0xd4232f=_0x55863c?.['opencode']??![];let _0x2e04a7=null;_0xd4232f?(_0x307674?.['trackPhaseStart'](_0x1fe5e8[_0x1bfcce(0xd4)]),_0x2e04a7=await ensureOpencodePluginConfig(_0x3fbcd0),_0x307674?.['trackPhaseEnd'](_0x1fe5e8[_0x1bfcce(0xd4)],{'isFirstRun':_0x16df40,'opencode':!![]})):(_0x307674?.[_0x1bfcce(0xd6)](_0x1fe5e8[_0x1bfcce(0xd4)]),await ensureClaudePlugin(_0x3fbcd0),_0x307674?.[_0x1bfcce(0xc4)](_0x1fe5e8[_0x1bfcce(0xd4)],{'isFirstRun':_0x16df40}));if(_0xd4232f&&_0x2e04a7){_0x307674?.[_0x1bfcce(0xd6)](_0x1fe5e8[_0x1bfcce(0xe0)]);try{await installSkill(_0x1fe5e8[_0x1bfcce(0xfe)],{'level':_0x2e04a7['scope'],'cliVersion':_0x1fe5e8[_0x1bfcce(0xf2)](getCurrentVersion),'platform':_0x1fe5e8[_0x1bfcce(0xd9)]}),_0x307674?.['trackPhaseEnd']('skills',{'isFirstRun':_0x16df40,'opencode':!![]});}catch(_0x4b9d8e){console['warn']('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x1fe5e8[_0x1bfcce(0xef)](_0x4b9d8e,Error)?_0x4b9d8e['message']:_0x4b9d8e),_0x307674?.[_0x1bfcce(0xc4)](_0x1fe5e8[_0x1bfcce(0xe0)],{'isFirstRun':_0x16df40,'opencode':!![],'failed':!![]});}}else _0x307674?.[_0x1bfcce(0xd6)](_0x1bfcce(0xe2)),await ensureClaudeSkills(_0x3fbcd0),_0x307674?.['trackPhaseEnd'](_0x1fe5e8['UWONJ'],{'isFirstRun':_0x16df40});if(_0x55863c?.[_0x1bfcce(0xe3)])console['log'](_0x1fe5e8['ddPRQ']);else{if(_0x55863c?.['url']){_0x307674?.['trackPhaseStart'](_0x1fe5e8['qexxr']);const _0x18eb6a=await _0x1fe5e8['RpSvM'](ensureLocalEnv,{'url':_0x55863c['url'],'force':_0x55863c?.[_0x1bfcce(0xbf)],'allowInsecureLocalhost':_0x55863c?.['allowInsecureLocalhost'],'scope':_0x1fe5e8[_0x1bfcce(0x107)]},_0x307674);_0x307674?.[_0x1bfcce(0xc4)](_0x1fe5e8['qexxr'],{'isFirstRun':_0x16df40,'profileReady':_0x18eb6a['ready'],'userSkipped':_0x18eb6a['skipped']});}else console['log'](_0x1fe5e8['nTQqu'](_0x1fe5e8['nTQqu'](_0x1bfcce(0xc7)+(_0x1bfcce(0x109)+bold(_0x1bfcce(0xf0))),'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)'),_0x1bfcce(0x119))+_0x1bfcce(0xe1));}if(_0xd4232f)console[_0x1bfcce(0xf6)](_0x1fe5e8[_0x1bfcce(0xff)]),console[_0x1bfcce(0xf6)](_0x1fe5e8['ELFau']),console[_0x1bfcce(0xf6)]('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console['log']('verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');else{const _0x4f8cbd=_0x1fe5e8['ZkGea'](bold,_0x1fe5e8[_0x1bfcce(0xe4)]);console[_0x1bfcce(0xf6)](_0x1fe5e8[_0x1bfcce(0xc5)](_0x1fe5e8['qQvfq']('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x4f8cbd+'\x20and\x20prompt\x20the\x20coding',_0x1bfcce(0xc1)),'\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser')+'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');}}
1
+ const _0x5cd83e=_0x1a39;(function(_0x19ea68,_0x138b39){const _0x4d0e05=_0x1a39,_0x45602b=_0x19ea68();while(!![]){try{const _0x151426=-parseInt(_0x4d0e05(0xf0))/0x1+-parseInt(_0x4d0e05(0x128))/0x2*(-parseInt(_0x4d0e05(0xff))/0x3)+parseInt(_0x4d0e05(0x105))/0x4+parseInt(_0x4d0e05(0xfc))/0x5*(parseInt(_0x4d0e05(0x110))/0x6)+parseInt(_0x4d0e05(0x12d))/0x7*(parseInt(_0x4d0e05(0xea))/0x8)+-parseInt(_0x4d0e05(0xec))/0x9+-parseInt(_0x4d0e05(0x151))/0xa*(parseInt(_0x4d0e05(0x129))/0xb);if(_0x151426===_0x138b39)break;else _0x45602b['push'](_0x45602b['shift']());}catch(_0x480557){_0x45602b['push'](_0x45602b['shift']());}}}(_0x390d,0x3c950));import{mkdir,writeFile}from'fs/promises';import{join,dirname}from'path';import{existsSync}from'fs';import{createRequire}from'module';import _0x2b1032 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';function _0x1a39(_0x1bfef6,_0x22f879){_0x1bfef6=_0x1bfef6-0xe3;const _0x390d90=_0x390d();let _0x1a3958=_0x390d90[_0x1bfef6];return _0x1a3958;}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';import{spawn}from'child_process';const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x5cd83e(0x108);const bold=_0x18364a=>'\x1b[1m'+_0x18364a+_0x5cd83e(0x159);export function getPlaywrightVersion(){const _0xaf647c=_0x5cd83e;try{const _0x2027d3=require[_0xaf647c(0x134)](_0xaf647c(0x122)),_0x452fc1=require(_0x2027d3);return _0x452fc1['version'];}catch{return null;}}function resolveBundledPlaywrightCli(){const _0x2260de=_0x5cd83e,_0x4d37a0={'MXDew':_0x2260de(0x122),'yfLTH':'cli.js'};try{const _0x15197f=join(dirname(require['resolve'](_0x4d37a0['MXDew'])),_0x4d37a0[_0x2260de(0x13c)]);return existsSync(_0x15197f)?_0x15197f:null;}catch{return null;}}const CHROMIUM_INSTALL_TIMEOUT_MS=Number(process['env'][_0x5cd83e(0x154)])||0x927c0;class ChromiumInstallTimeoutError extends Error{}function _0x390d(){const _0x5ad975=['local','yCDAf','1.56.1','You\x20can\x20install\x20it\x20manually\x20by\x20running:','ngfyJ','organizationName','aYxAh','ignore','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','xANhT','6coIKNe','✓\x20Stored\x20credentials\x20locally','SIGKILL','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','\x20\x20Chromium\x20install\x20attempt\x20','\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','/ranger:enable','...','\x20now?','jpKKq','LuhEa','PTtQI','exit','device_auth','SGIbv','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','WXIXu','✓\x20Authenticated\x20to\x20','playwright/package.json','oqeEL','✓\x20~/.ranger/\x20directory\x20already\x20exists','Ulcfs','SDeLy','vQRVD','2cjCkTY','5687902dPfLAm','profile','\x0a\x20\x20','EaXuN','1524761aCCuez','opencode','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20','bqvrr','and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','Installation\x20failed\x20with\x20exit\x20code\x20','resolve','bvWBY','jKLdG','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','auth','install','log','yfLTH','EMkTk','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','✓\x20Exported\x20credentials\x20for\x20CI','skills','user','MGEto','✓\x20Playwright\x20Chromium\x20browser\x20found','NHnqB','vaoAC','ranger\x20profile\x20add\x20<name>','force','✓\x20Local\x20profile\x20already\x20exists','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','ranger','inherit','skipAuth','chromium','trackPhaseStart','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','warn','10TNNJSX','ready','env','RANGER_CHROMIUM_INSTALL_TIMEOUT_MS','eVbGP','trackPhaseEnd','OLkQS','plugin','\x1b[0m','jImZG','JZMqt','EpwWR','existing_token','round','gXdXX','success','execPath','oVxYt','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','lzkWU','JFloW','kBWGv','16nNeGlx','win32','2355489lzODBJ','kill','skipChromium','\x20install\x20chromium','143976FOmuYW','hVrRa','skipped','lzwAZ','.gitignore','error','\x20failed\x20(','isTTY','url','platform','\x20\x20npx\x20playwright@','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','1021690uGNQMi','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','Authentication\x20failed:\x20','663213ZbGaIP','scope','✓\x20Created\x20~/.ranger/\x20directory','executablePath','CEuhn','message','1239472iAVGIb'];_0x390d=function(){return _0x5ad975;};return _0x390d();}export async function installChromiumBinary(_0x1a58f4,_0x19e6ed=![]){const _0x345009=_0x5cd83e,_0x11a21a={'EMkTk':function(_0x512b88){return _0x512b88();},'WXIXu':_0x345009(0x13a),'EaXuN':'--with-deps','bvWBY':_0x345009(0x14d),'Ulcfs':function(_0x533f1d,_0x55b9ac){return _0x533f1d+_0x55b9ac;},'lzwAZ':function(_0x970525,_0x2431e3){return _0x970525(_0x2431e3);}},_0x20de7f=_0x11a21a[_0x345009(0x13d)](resolveBundledPlaywrightCli),_0x46178c=_0x20de7f?process[_0x345009(0xe4)]:'npx',_0x16d8fa=[_0x20de7f??'playwright@'+_0x1a58f4,_0x11a21a[_0x345009(0x120)],..._0x19e6ed?[_0x11a21a[_0x345009(0x12c)]]:[],_0x11a21a[_0x345009(0x135)]];let _0x4c98fc=![];for(let _0x188fb6=0x1;;_0x188fb6++){try{await runChromiumInstall(_0x46178c,_0x16d8fa);return;}catch(_0x578308){_0x578308 instanceof ChromiumInstallTimeoutError&&!_0x4c98fc&&(_0x4c98fc=!![],console['log'](_0x11a21a[_0x345009(0x125)]('\x0a\x20\x20Chromium\x20install\x20timed\x20out\x20(limit\x20'+Math[_0x345009(0x15e)](CHROMIUM_INSTALL_TIMEOUT_MS/0x3e8)+'s).\x20On\x20a\x20slow\x20or\x20proxied\x20connection,\x20raise\x20the\x20limit\x20and\x20retry,\x20e.g.:\x0a','\x20\x20\x20\x20RANGER_CHROMIUM_INSTALL_TIMEOUT_MS=1800000\x20ranger\x20setup\x20deps')));if(_0x188fb6>=0x3)throw _0x578308;const _0x458491=_0x578308 instanceof Error?_0x578308['message']:_0x11a21a[_0x345009(0xf3)](String,_0x578308);console['log'](_0x345009(0x114)+_0x188fb6+_0x345009(0xf6)+_0x458491+');\x20retrying...');}}}function runChromiumInstall(_0x5e6d29,_0x44e1bf){const _0x219898=_0x5cd83e,_0x570bd2={'yCDAf':function(_0x13185f,_0x2356d9){return _0x13185f(_0x2356d9);},'aYxAh':function(_0x10f9e9,_0x2978fb){return _0x10f9e9/_0x2978fb;},'PDIRC':function(_0x25b801,_0x578098){return _0x25b801(_0x578098);},'JfEBE':function(_0x49a103){return _0x49a103();},'BBDJS':function(_0x34ba22,_0x7c9d40){return _0x34ba22(_0x7c9d40);},'HLBdU':function(_0xf50981,_0x28aa4d,_0xe62c9d,_0x4799e6){return _0xf50981(_0x28aa4d,_0xe62c9d,_0x4799e6);},'vQRVD':_0x219898(0x14b),'CjGBR':_0x219898(0xeb),'oMfcO':function(_0x538a40,_0x1b21b4,_0x526575){return _0x538a40(_0x1b21b4,_0x526575);},'HCteA':'error'};return new Promise((_0x2aafd0,_0x11df00)=>{const _0x21d1d3=_0x219898,_0xebc7f0={'oVxYt':function(_0x1d88a2,_0x1c6931){return _0x1d88a2(_0x1c6931);}},_0x2b2af9=_0x570bd2['HLBdU'](spawn,_0x5e6d29,_0x44e1bf,{'stdio':[_0x21d1d3(0x10d),_0x21d1d3(0x14b),_0x570bd2[_0x21d1d3(0x127)]],'shell':process[_0x21d1d3(0xf9)]===_0x570bd2['CjGBR']}),_0xbb62ab=_0x570bd2['oMfcO'](setTimeout,()=>{const _0x2ff5f4=_0x21d1d3;_0x2b2af9[_0x2ff5f4(0xed)](_0x2ff5f4(0x112)),_0x570bd2[_0x2ff5f4(0x107)](_0x11df00,new ChromiumInstallTimeoutError('Chromium\x20install\x20timed\x20out\x20after\x20'+Math[_0x2ff5f4(0x15e)](_0x570bd2[_0x2ff5f4(0x10c)](CHROMIUM_INSTALL_TIMEOUT_MS,0x3e8))+'s'));},CHROMIUM_INSTALL_TIMEOUT_MS);_0x2b2af9['on']('close',_0x4425be=>{const _0x203f41=_0x21d1d3;_0x570bd2['PDIRC'](clearTimeout,_0xbb62ab);if(_0x4425be===0x0)_0x570bd2['JfEBE'](_0x2aafd0);else _0x570bd2['BBDJS'](_0x11df00,new Error(_0x203f41(0x133)+_0x4425be));}),_0x2b2af9['on'](_0x570bd2['HCteA'],_0x3987c7=>{const _0x5a1c59=_0x21d1d3;_0xebc7f0[_0x5a1c59(0xe5)](clearTimeout,_0xbb62ab),_0xebc7f0['oVxYt'](_0x11df00,_0x3987c7);});});}export async function authenticate(_0x4e2996){const _0x222039=_0x5cd83e,_0xc78658={'jKLdG':function(_0x349edb){return _0x349edb();},'dPInj':function(_0x9a5ab3,_0x1d0e32){return _0x9a5ab3(_0x1d0e32);},'kBWGv':function(_0xcf82f5,_0x3a2e58){return _0xcf82f5 instanceof _0x3a2e58;},'KhsZT':function(_0xee5679,_0x5bedf2){return _0xee5679(_0x5bedf2);},'eEccw':'Validating\x20API\x20token...','akGkB':_0x222039(0x111)};if(!_0x4e2996){const _0x2e2c73=await _0xc78658[_0x222039(0x136)](getToken);if(_0x2e2c73){const _0x504095=await _0xc78658['dPInj'](getCurrentUser,_0x2e2c73);if(_0x504095[_0x222039(0xe3)])return console[_0x222039(0x13b)]('✓\x20Already\x20authenticated\x20to\x20'+_0x504095[_0x222039(0x141)][_0x222039(0x10b)]),{'token':_0x2e2c73,'method':_0x222039(0x15d)};}try{_0x4e2996=await _0xc78658['jKLdG'](runDeviceAuthFlow);}catch(_0x49518b){throw new Error('Authentication\x20failed:\x20'+(_0xc78658[_0x222039(0xe9)](_0x49518b,Error)?_0x49518b[_0x222039(0x104)]:_0x49518b));}const _0x303577=await _0xc78658['KhsZT'](getCurrentUser,_0x4e2996);if(!_0x303577[_0x222039(0xe3)])throw new Error('Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20'+_0x303577['error']);return console['log'](_0x222039(0x121)+_0x303577['user']['organizationName']),{'token':_0x4e2996,'method':_0x222039(0x11d)};}console['log'](_0xc78658['eEccw']);const _0x4ae165=await getCurrentUser(_0x4e2996);if(!_0x4ae165[_0x222039(0xe3)]){if(_0x4ae165['status'])throw new Error(_0x222039(0xfe)+_0x4ae165['error']+_0x222039(0x138));else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x4ae165[_0x222039(0xf5)]+_0x222039(0xe6));}return console['log'](_0x222039(0x121)+_0x4ae165[_0x222039(0x141)]['organizationName']),await storeToken(_0x4e2996),console['log'](process[_0x222039(0x153)]['GITHUB_ENV']?_0x222039(0x13f):_0xc78658['akGkB']),{'token':_0x4e2996,'method':'provided_token'};}export async function ensureRangerDir(_0x2399d3){const _0x3deb8a=_0x5cd83e,_0x7d9186={'UJduJ':function(_0x7bb930){return _0x7bb930();},'vaoAC':function(_0xb242ba,_0x52ec3d,_0x19745c){return _0xb242ba(_0x52ec3d,_0x19745c);},'MGEto':_0x3deb8a(0x101)};void _0x2399d3;const _0x268812=_0x7d9186['UJduJ'](getRangerHomeDir);return!existsSync(_0x268812)?(await _0x7d9186[_0x3deb8a(0x145)](mkdir,_0x268812,{'recursive':!![]}),console['log'](_0x7d9186[_0x3deb8a(0x142)]),{'path':_0x268812,'installed':!![]}):(console[_0x3deb8a(0x13b)](_0x3deb8a(0x124)),{'path':_0x268812,'installed':![]});}export async function ensureChromium(_0x34734f=![]){const _0x26e2a5=_0x5cd83e,_0x1134b0={'SGIbv':function(_0x235fa7,_0x2c83b6){return _0x235fa7(_0x2c83b6);},'eVbGP':'\x20(fallback\x20version)','bqvrr':'\x0aInstalling\x20Chromium\x20browser...\x0a','mlEVb':function(_0x57cd86,_0x2e737d,_0x2fd104){return _0x57cd86(_0x2e737d,_0x2fd104);},'SJfgs':_0x26e2a5(0x137),'sXnpZ':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0x540fb3=![];try{const _0x184c4c=chromium[_0x26e2a5(0x102)]();_0x540fb3=_0x1134b0[_0x26e2a5(0x11e)](existsSync,_0x184c4c);}catch{_0x540fb3=![];}if(_0x540fb3)return console[_0x26e2a5(0x13b)](_0x26e2a5(0x143)),![];const _0x5ef6f0=getPlaywrightVersion(),_0x1ccbda=_0x5ef6f0??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x4f7f81=!_0x5ef6f0,_0x329b0f=process['stdin'][_0x26e2a5(0xf7)]&&process['stdout'][_0x26e2a5(0xf7)];let _0x38e2b8=!![];if(_0x329b0f){const {install:_0x4fdd79}=await _0x2b1032['prompt']([{'type':'confirm','name':'install','message':_0x4f7f81?_0x26e2a5(0xfd)+_0x1ccbda+_0x26e2a5(0x118):'The\x20required\x20version\x20('+_0x1ccbda+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x38e2b8=_0x4fdd79;}else console['log'](_0x26e2a5(0x130)+_0x1ccbda+(_0x4f7f81?_0x1134b0[_0x26e2a5(0x155)]:'')+_0x26e2a5(0x117));if(_0x38e2b8){console['log'](_0x1134b0[_0x26e2a5(0x131)]);try{await _0x1134b0['mlEVb'](installChromiumBinary,_0x1ccbda,_0x34734f),console['log'](_0x1134b0['SJfgs']);}catch(_0x2ac7ab){console['error'](_0x26e2a5(0x14f),_0x2ac7ab instanceof Error?_0x2ac7ab['message']:_0x2ac7ab),console['log'](_0x26e2a5(0x109)),console[_0x26e2a5(0x13b)](_0x26e2a5(0xfa)+_0x1ccbda+_0x26e2a5(0xef));}}else console[_0x26e2a5(0x13b)]('\x0a⚠\x20Skipping\x20Chromium\x20installation.'),console['log'](_0x1134b0['sXnpZ']),console[_0x26e2a5(0x13b)]('\x20\x20npx\x20playwright@'+_0x1ccbda+_0x26e2a5(0xef));return!![];}export async function writeRangerGitignore(_0x1d369d){const _0x591808=_0x5cd83e,_0x47b02b={'lzkWU':function(_0x380f6d,_0xd98064,_0x12b1a5){return _0x380f6d(_0xd98064,_0x12b1a5);}},_0x1c5abb=_0x47b02b[_0x591808(0xe7)](join,_0x1d369d,_0x591808(0xf4)),_0x5e34e0='\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 _0x47b02b['lzkWU'](writeFile,_0x1c5abb,_0x5e34e0),console[_0x591808(0x13b)]('✓\x20Created\x20.ranger/.gitignore');}export async function ensureLocalEnv(_0x199800,_0x31f89f){const _0x1383fe=_0x5cd83e,_0x3c755b={'OLkQS':function(_0x2cb43e,_0x2c2a7b){return _0x2cb43e!==_0x2c2a7b;},'TvSrj':_0x1383fe(0x12f),'fpFKz':function(_0x541b5e,_0x458fc3){return _0x541b5e===_0x458fc3;},'NJjXD':_0x1383fe(0x141),'gXdXX':function(_0x187501,_0x293671,_0x59d4e2){return _0x187501(_0x293671,_0x59d4e2);},'PTtQI':_0x1383fe(0x106),'JFloW':_0x1383fe(0x148),'zabaB':function(_0x21472e,_0x37ddfb,_0x38a1dc,_0x3ddbf1){return _0x21472e(_0x37ddfb,_0x38a1dc,_0x3ddbf1);},'nMSHM':'\x0a❌\x20Profile\x20setup\x20failed:'};if(!findGitRoot()&&_0x3c755b[_0x1383fe(0x157)](_0x199800?.[_0x1383fe(0x100)],_0x1383fe(0x141)))return console['log'](_0x3c755b['TvSrj']),{'ready':![],'skipped':!![]};const _0xa671dd=_0x3c755b['fpFKz'](_0x199800?.[_0x1383fe(0x100)],_0x3c755b['NJjXD'])?getRangerHomeDir():undefined;if(_0x3c755b[_0x1383fe(0x15f)](findExistingEnv,_0x3c755b[_0x1383fe(0x11b)],{'locations':['local'],'rangerDir':_0xa671dd}))return console['log'](_0x3c755b[_0x1383fe(0xe8)]),{'ready':!![],'skipped':![]};try{return await _0x3c755b['zabaB'](addEnv,_0x3c755b[_0x1383fe(0x11b)],{'url':_0x199800?.['url'],'force':_0x199800?.['force'],'allowInsecureLocalhost':_0x199800?.['allowInsecureLocalhost'],'scope':_0x199800?.[_0x1383fe(0x100)]},_0x31f89f),{'ready':!![],'skipped':![]};}catch(_0x24871a){return console[_0x1383fe(0xf5)](_0x3c755b['nMSHM'],_0x24871a instanceof Error?_0x24871a['message']:_0x24871a),{'ready':![],'skipped':![]};}}export async function start(_0xb8d7e9,_0x214481,_0x162c9b){const _0x29944b=_0x5cd83e,_0x25244f={'kpdlk':function(_0x2b2dcd,_0x39cf34){return _0x2b2dcd!==_0x39cf34;},'JZMqt':'user','oQGwf':function(_0x1abe82,_0x51211b){return _0x1abe82+_0x51211b;},'SDeLy':function(_0x1d9267,_0x182414){return _0x1d9267+_0x182414;},'NHnqB':function(_0x37ed4d){return _0x37ed4d();},'JdiJW':function(_0x3b9bc2,_0x5526a1){return _0x3b9bc2(_0x5526a1);},'StswP':'✓\x20Skipping\x20authentication\x20(--skip-auth)','CEuhn':_0x29944b(0xf2),'ZNSHv':_0x29944b(0x14d),'YLEAh':'✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','cSLFD':_0x29944b(0xfb),'LuhEa':'plugin','EtIMq':function(_0x4fffab,_0x588a2a){return _0x4fffab(_0x588a2a);},'EpwWR':_0x29944b(0x140),'jpKKq':function(_0xe6ee00){return _0xe6ee00();},'oqeEL':'\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','ngfyJ':_0x29944b(0x115),'xANhT':_0x29944b(0x12a),'TYQVj':function(_0x40275d,_0x3e79bc,_0xc7ced7){return _0x40275d(_0x3e79bc,_0xc7ced7);},'TXUJe':function(_0x166268,_0x4f37aa){return _0x166268+_0x4f37aa;},'AscUn':_0x29944b(0x146),'EowvG':_0x29944b(0x149),'hVrRa':_0x29944b(0x132),'jImZG':'with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','xDdWn':function(_0x1db95e,_0x48a05f){return _0x1db95e+_0x48a05f;},'eoXzL':function(_0x2a8ec2,_0x207a7c){return _0x2a8ec2+_0x207a7c;}};console[_0x29944b(0x13b)]('\x0a🚀\x20Ranger\x20Setup\x0a');_0x25244f['kpdlk'](_0x214481?.[_0x29944b(0x100)],undefined)&&_0x214481['scope']!==_0x25244f[_0x29944b(0x15b)]&&(console['error'](_0x25244f['oQGwf'](_0x25244f['SDeLy']('ranger\x20setup\x20--scope='+String(_0x214481['scope'])+'\x20is\x20no\x20longer\x20supported.\x20','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20'),_0x29944b(0x10e))),process[_0x29944b(0x11c)](0x1));_0x214481={..._0x214481,'scope':'user'};const _0x3e1318=!existsSync(_0x25244f[_0x29944b(0x144)](getRangerHomeDir));await _0x25244f['JdiJW'](ensureRangerDir,_0x29944b(0x141));if(_0x214481?.[_0x29944b(0x14c)])console[_0x29944b(0x13b)](_0x25244f['StswP']),_0x162c9b?.['trackPhaseEnd']('auth',{'isFirstRun':_0x3e1318,'method':_0x25244f[_0x29944b(0x103)]});else{_0x162c9b?.['trackPhaseStart']('auth');const _0x3ccbb2=await _0x25244f['JdiJW'](authenticate,_0xb8d7e9);_0x162c9b?.['trackPhaseEnd'](_0x29944b(0x139),{'isFirstRun':_0x3e1318,'method':_0x3ccbb2['method']});}_0x162c9b?.[_0x29944b(0x14e)](_0x25244f['ZNSHv']);_0x214481?.[_0x29944b(0xee)]?console[_0x29944b(0x13b)](_0x25244f['YLEAh']):await ensureChromium(_0x214481?.['withDeps']);_0x162c9b?.[_0x29944b(0x156)](_0x25244f['ZNSHv'],{'isFirstRun':_0x3e1318,'skipped':!!_0x214481?.['skipChromium']}),console[_0x29944b(0x13b)](_0x25244f['cSLFD']);const _0x357477=_0x214481?.['scope'],_0x1e6d31=_0x214481?.['opencode']??![];let _0x4b4e8c=null;_0x1e6d31?(_0x162c9b?.[_0x29944b(0x14e)](_0x25244f[_0x29944b(0x11a)]),_0x4b4e8c=await _0x25244f['EtIMq'](ensureOpencodePluginConfig,_0x357477),_0x162c9b?.['trackPhaseEnd'](_0x29944b(0x158),{'isFirstRun':_0x3e1318,'opencode':!![]})):(_0x162c9b?.[_0x29944b(0x14e)](_0x29944b(0x158)),await ensureClaudePlugin(_0x357477),_0x162c9b?.['trackPhaseEnd'](_0x29944b(0x158),{'isFirstRun':_0x3e1318}));if(_0x1e6d31&&_0x4b4e8c){_0x162c9b?.[_0x29944b(0x14e)](_0x25244f[_0x29944b(0x15c)]);try{await installSkill(_0x29944b(0x14a),{'level':_0x4b4e8c['scope'],'cliVersion':_0x25244f[_0x29944b(0x119)](getCurrentVersion),'platform':_0x29944b(0x12e)}),_0x162c9b?.['trackPhaseEnd'](_0x25244f[_0x29944b(0x15c)],{'isFirstRun':_0x3e1318,'opencode':!![]});}catch(_0x3c6289){console[_0x29944b(0x150)](_0x25244f[_0x29944b(0x123)],_0x3c6289 instanceof Error?_0x3c6289[_0x29944b(0x104)]:_0x3c6289),_0x162c9b?.[_0x29944b(0x156)](_0x29944b(0x140),{'isFirstRun':_0x3e1318,'opencode':!![],'failed':!![]});}}else _0x162c9b?.[_0x29944b(0x14e)](_0x29944b(0x140)),await ensureClaudeSkills(_0x357477),_0x162c9b?.['trackPhaseEnd'](_0x25244f[_0x29944b(0x15c)],{'isFirstRun':_0x3e1318});if(_0x214481?.[_0x29944b(0x14c)])console[_0x29944b(0x13b)](_0x25244f[_0x29944b(0x10a)]);else{if(_0x214481?.[_0x29944b(0xf8)]){_0x162c9b?.[_0x29944b(0x14e)](_0x25244f[_0x29944b(0x10f)]);const _0x152bc0=await _0x25244f['TYQVj'](ensureLocalEnv,{'url':_0x214481[_0x29944b(0xf8)],'force':_0x214481?.[_0x29944b(0x147)],'allowInsecureLocalhost':_0x214481?.['allowInsecureLocalhost'],'scope':_0x25244f['JZMqt']},_0x162c9b);_0x162c9b?.['trackPhaseEnd'](_0x29944b(0x12a),{'isFirstRun':_0x3e1318,'profileReady':_0x152bc0[_0x29944b(0x152)],'userSkipped':_0x152bc0['skipped']});}else console[_0x29944b(0x13b)](_0x25244f['TXUJe'](_0x25244f[_0x29944b(0x126)](_0x25244f['oQGwf'](_0x29944b(0x11f),_0x29944b(0x12b)+bold(_0x25244f['AscUn'])),'\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)')+'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles'));}if(_0x1e6d31)console[_0x29944b(0x13b)](_0x25244f['EowvG']),console['log'](_0x25244f[_0x29944b(0xf1)]),console[_0x29944b(0x13b)](_0x25244f[_0x29944b(0x15a)]),console['log']('verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.');else{const _0x5d4ed0=_0x25244f['EtIMq'](bold,_0x29944b(0x116));console[_0x29944b(0x13b)](_0x25244f['xDdWn'](_0x25244f['eoXzL']('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x5d4ed0+'\x20and\x20prompt\x20the\x20coding'+'\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with',_0x29944b(0x13e)),_0x29944b(0x113)));}}
@@ -1 +1 @@
1
- const _0x76efdf=_0x7174;(function(_0x953d5a,_0xddeb7c){const _0x37cf6f=_0x7174,_0x433bb9=_0x953d5a();while(!![]){try{const _0x148422=-parseInt(_0x37cf6f(0x100))/0x1+parseInt(_0x37cf6f(0xdb))/0x2+-parseInt(_0x37cf6f(0xf5))/0x3*(parseInt(_0x37cf6f(0xae))/0x4)+parseInt(_0x37cf6f(0x92))/0x5+-parseInt(_0x37cf6f(0x102))/0x6*(parseInt(_0x37cf6f(0xf8))/0x7)+parseInt(_0x37cf6f(0x106))/0x8+-parseInt(_0x37cf6f(0x98))/0x9;if(_0x148422===_0xddeb7c)break;else _0x433bb9['push'](_0x433bb9['shift']());}catch(_0x1cdb63){_0x433bb9['push'](_0x433bb9['shift']());}}}(_0x2e21,0x667f9));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';function _0x7174(_0x2b3f66,_0x41db2a){_0x2b3f66=_0x2b3f66-0x90;const _0x2e21a1=_0x2e21();let _0x71749e=_0x2e21a1[_0x2b3f66];return _0x71749e;}import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';function _0x2e21(){const _0x2db2a2=['plaintext','145250RnXiAA','settingsPath','12MvVQze','ahySq','\x20cloud','version','4648048pcIgLk','MxzOn','LtAAz','details','utf-8','147320PStCXO','DEBUG','@ranger-testing/opencode-plugin','ejGMT','\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','has','2807748CoZNcg','\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20','\x1b]8;;\x07','rlEEV','\x1b[1m','includes','xqznc','not_installed','\x0a---\x20Profiles\x20---','VwRIX','CUroS','toString','log','No\x20skills\x20installed','sessionUpdatedAt',':\x20installed\x20(','KXZZh','SKILL.md','none','\x20(up\x20to\x20date)','jzBkf','VjrmO','292zGzBkn','parse','\x20\x20Run:\x20ranger\x20update','WyCvy','join','\x20\x20User-level:','ignore',':\x20configured','RRBMu','\x20\x20\x20\x20Settings:\x20','\x20plugin(s)\x20configured','zxojj','unknown','match','\x0a\x20\x20No\x20active\x20profile\x20set','IjBAL','length','dBuAf','ranger@trailhead','stdout','\x20\x20\x20\x20','hasPlaintextAuth','data','Root:\x20','configured','opencode','\x0a---\x20Claude\x20Code\x20Plugin\x20---','ETLEU','isActive','Organization:\x20','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','isArray','\x0a---\x20OpenCode\x20Plugin\x20---','API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired','JnAZS','filter','not_configured','scope','vvJnd','\x1b]8;;file://','\x0a---\x20Skills\x20---','TAPCf','XqGGR','DcajM','PodDO','1323012rynncm','API\x20Environment:\x20','\x20(latest:\x20','rPgYS','udhJv','\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)','some','NptYm','name','CLAvj','status','\x20\x20Project-level:','AVRQH','config','push','map','\x20\x20Run:\x20ranger\x20setup\x20[token]','close','TRsoz','\x20[cloud]','disabled','UlDMb','pXhsx','path','wBzum','\x20profiles\x20configured\x20(','13557dnVNjQ','\x20\x20\x20\x20Session:\x20','Version:\x20','227619xuNleE','stderr','user','pnprT','pnhqO','\x20[local]','\x20local'];_0x2e21=function(){return _0x2db2a2;};return _0x2e21();}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=_0x3fa993=>_0x76efdf(0x9c)+_0x3fa993+'\x1b[0m',link=(_0x55a8a9,_0x2e1021)=>_0x76efdf(0xd5)+_0x55a8a9+'\x07'+(_0x2e1021||_0x55a8a9)+_0x76efdf(0x9a);async function getOpencodePluginStatus(){const _0x18246b=_0x76efdf,_0x9cb14f={'PzrjF':function(_0x3009fb,_0xa9ec7a){return _0x3009fb(_0xa9ec7a);},'WyCvy':'not_installed','ImjpO':_0x18246b(0xe8),'DjUUl':'pipe','PodDO':_0x18246b(0xc4),'CLAvj':'error'};return new Promise(_0x272711=>{const _0x2d812d=_0x18246b,_0xa45b31={'HpvyF':function(_0x23d159,_0x569efa){return _0x23d159!==_0x569efa;},'sFywU':function(_0x5f116b,_0x2d8fcb){return _0x5f116b(_0x2d8fcb);},'ejGMT':function(_0x1c008a,_0x1e9d38){return _0x1c008a>_0x1e9d38;},'jzBkf':'not_configured','IjBAL':function(_0x3f7a92,_0x42a8a6){return _0x3f7a92(_0x42a8a6);}},_0x17752b=spawn(_0x2d812d(0xc7),['debug',_0x9cb14f['ImjpO']],{'stdio':[_0x2d812d(0xb4),_0x9cb14f['DjUUl'],_0x9cb14f['DjUUl']]});let _0x5e52e5='';_0x17752b[_0x2d812d(0xc1)]?.['on'](_0x2d812d(0xc4),_0x4e7145=>{_0x5e52e5+=_0x4e7145['toString']();}),_0x17752b[_0x2d812d(0xf9)]?.['on'](_0x9cb14f[_0x2d812d(0xda)],_0x453ef9=>{const _0x187594=_0x2d812d;_0x5e52e5+=_0x453ef9[_0x187594(0xa3)]();}),_0x17752b['on'](_0x9cb14f[_0x2d812d(0xe4)],()=>{const _0x468368=_0x2d812d;_0x9cb14f['PzrjF'](_0x272711,{'status':_0x9cb14f[_0x468368(0xb1)]});}),_0x17752b['on'](_0x2d812d(0xec),_0x2fd30d=>{const _0x54dcb7=_0x2d812d;if(_0x2fd30d!==0x0){_0xa45b31['sFywU'](_0x272711,{'status':_0x54dcb7(0x9f)});return;}const _0x85c930=_0x5e52e5['trim']();let _0x25e36a=null;if(_0x85c930)try{_0x25e36a=JSON['parse'](_0x85c930);}catch{const _0x4d37b4=_0x85c930[_0x54dcb7(0xbb)](/\{[\s\S]*\}$/);if(_0x4d37b4)try{_0x25e36a=JSON[_0x54dcb7(0xaf)](_0x4d37b4[0x0]);}catch{_0x25e36a=null;}}const _0x1fd20e=Array[_0x54dcb7(0xcd)](_0x25e36a?.['plugin'])?_0x25e36a?.['plugin']:[],_0x295439=_0x1fd20e[_0x54dcb7(0xe1)](_0xa1aa52=>{const _0x5abfe2=_0x54dcb7;if(_0xa45b31['HpvyF'](typeof _0xa1aa52,'string'))return![];return _0xa1aa52['includes'](_0x5abfe2(0x94))||_0xa1aa52[_0x5abfe2(0x9d)]('opencode-plugin');});if(_0x295439){_0x272711({'status':'configured','details':_0x1fd20e['length']>0x0?_0x1fd20e[_0x54dcb7(0xbe)]+_0x54dcb7(0xb8):undefined});return;}if(_0xa45b31[_0x54dcb7(0x95)](_0x1fd20e[_0x54dcb7(0xbe)],0x0)){_0x272711({'status':_0xa45b31[_0x54dcb7(0xac)],'details':_0x1fd20e[_0x54dcb7(0xbe)]+'\x20plugin(s)\x20configured'});return;}_0xa45b31[_0x54dcb7(0xbd)](_0x272711,{'status':_0x54dcb7(0xd2)});});});}async function getSkillsFromDir(_0x28ce86,_0x1ba690){const _0x19c6ce=_0x76efdf,_0x3a1c18={'rlEEV':function(_0x5ab34a,_0x2e0ec6,_0x552a3f){return _0x5ab34a(_0x2e0ec6,_0x552a3f);},'GWARo':_0x19c6ce(0xa9),'BQcnL':function(_0x43e4b0,_0x46a37e){return _0x43e4b0(_0x46a37e);},'blbmz':_0x19c6ce(0x91)};if(!existsSync(_0x28ce86))return[];const _0x50420f=[];try{const _0x4e3f9e=await _0x3a1c18[_0x19c6ce(0x9b)](readdir,_0x28ce86,{'withFileTypes':!![]});for(const _0x527598 of _0x4e3f9e){if(_0x527598['isDirectory']()){const _0x4b5eaf=join(_0x28ce86,_0x527598['name'],_0x3a1c18['GWARo']);if(_0x3a1c18['BQcnL'](existsSync,_0x4b5eaf)){let _0x44da6f=_0x527598[_0x19c6ce(0xe3)];try{const _0xe4e69d=await _0x3a1c18[_0x19c6ce(0x9b)](readFile,_0x4b5eaf,_0x3a1c18['blbmz']),_0x13f5b9=_0xe4e69d[_0x19c6ce(0xbb)](/name:\s*(.+)/);_0x13f5b9&&(_0x44da6f=_0x13f5b9[0x1]['trim']());}catch{}_0x50420f[_0x19c6ce(0xe9)]({'name':_0x527598[_0x19c6ce(0xe3)],'displayName':_0x44da6f,'path':_0x4b5eaf,'level':_0x1ba690});}}}}catch{return[];}return _0x50420f;}async function getInstalledSkills(){const _0x53c46e=_0x76efdf,_0x52e195={'CUroS':function(_0x4ecc50,_0x3119ac,_0x533ad7){return _0x4ecc50(_0x3119ac,_0x533ad7);},'ahySq':function(_0x3a83b9){return _0x3a83b9();},'LtAAz':'project'},[_0xcae550,_0x3625e2]=await Promise['all']([_0x52e195[_0x53c46e(0xa2)](getSkillsFromDir,_0x52e195[_0x53c46e(0x103)](getProjectSkillsDir),_0x52e195[_0x53c46e(0x108)]),_0x52e195['CUroS'](getSkillsFromDir,getUserSkillsDir(),_0x53c46e(0xfa))]);return{'project':_0xcae550,'user':_0x3625e2};}async function getEnvironments(){const _0x5e5f07=_0x76efdf,_0x4d43d5={'pnprT':function(_0x154cbd,_0x599de4,_0x36eded){return _0x154cbd(_0x599de4,_0x36eded);},'KXZZh':'settings.json','dBuAf':'auth.json','RVFkB':'(not\x20found)','TRsoz':function(_0x439058,_0x237136){return _0x439058(_0x237136);},'DcajM':function(_0x4d88d0,_0xacf004){return _0x4d88d0===_0xacf004;},'TAPCf':function(_0x49f056){return _0x49f056();}},{envNames:_0x512a37,activeEnv:_0x2f8c39}=await getEnvNames(),_0x1a9c04=_0x4d43d5[_0x5e5f07(0xd7)](getRangerDir);if(!_0x4d43d5[_0x5e5f07(0xed)](existsSync,_0x1a9c04))return{'envs':[],'activeEnv':null};const _0x15f659=_0x512a37['map'](_0x320c82=>{const _0x3fbe18=_0x5e5f07,_0x1e53cb=getEnvDir(_0x320c82),_0x139712=_0x4d43d5[_0x3fbe18(0xfb)](join,_0x1e53cb,_0x4d43d5[_0x3fbe18(0xa8)]),_0x2b176b=_0x4d43d5['pnprT'](join,_0x1e53cb,_0x4d43d5[_0x3fbe18(0xbf)]),_0x372c9f=join(_0x1e53cb,'auth.json.enc');return{'name':_0x320c82,'settingsPath':existsSync(_0x139712)?_0x139712:_0x4d43d5['RVFkB'],'hasPlaintextAuth':existsSync(_0x2b176b),'hasEncryptedAuth':_0x4d43d5[_0x3fbe18(0xed)](existsSync,_0x372c9f),'isActive':_0x4d43d5[_0x3fbe18(0xd9)](_0x320c82,_0x2f8c39)};});return{'envs':_0x15f659,'activeEnv':_0x2f8c39};}export async function status(){const _0x2533db=_0x76efdf,_0x8720eb={'VwRIX':'\x0a📊\x20Ranger\x20Status\x0a','vZCTh':function(_0x2e24f8){return _0x2e24f8();},'JnAZS':function(_0x55c252,_0x44241d,_0x218817){return _0x55c252(_0x44241d,_0x218817);},'ETLEU':function(_0x1fb366,_0x1bfca7,_0x44f474){return _0x1fb366(_0x1bfca7,_0x44f474);},'zxojj':function(_0x14a967,_0xf42ac4){return _0x14a967(_0xf42ac4);},'IZhxO':function(_0x961d62,_0x5f033a){return _0x961d62(_0x5f033a);},'xqznc':function(_0x4a4654){return _0x4a4654();},'udhJv':_0x2533db(0xce),'XqGGR':_0x2533db(0xc6),'pXhsx':function(_0x4bb9c0,_0x2f08e4){return _0x4bb9c0(_0x2f08e4);},'MxzOn':'\x20\x20Not\x20configured','UlDMb':'\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','qZZSd':_0x2533db(0xba),'rPgYS':_0x2533db(0xef),'pnhqO':function(_0x39d36e,_0x4f39ca){return _0x39d36e(_0x4f39ca);},'rGHfR':_0x2533db(0xa0),'VjrmO':function(_0x5b6d8c){return _0x5b6d8c();},'AVRQH':function(_0x37390d,_0x32a081){return _0x37390d+_0x32a081;},'vvJnd':'No\x20profiles\x20configured','HEPFq':function(_0x351431,_0x11782d){return _0x351431===_0x11782d;},'wBzum':'\x20(active)','RRBMu':'no\x20session','YnzBA':'encrypted','NptYm':_0x2533db(0xaa)};console['log'](_0x8720eb[_0x2533db(0xa1)]);const _0x3f30fc=process['cwd'](),_0x545e69=_0x8720eb['vZCTh'](getRangerDir);if(!existsSync(_0x545e69)){console['log'](_0x2533db(0xc5)+_0x8720eb['JnAZS'](link,_0x3f30fc,bold(basename(_0x3f30fc)))),console['log']('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console[_0x2533db(0xa4)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x2533db(0xa4)]('Root:\x20'+_0x8720eb[_0x2533db(0xc9)](link,_0x3f30fc,bold(basename(_0x3f30fc))));const _0x2b6c15=getCurrentVersion(),_0x39c0d6=getLatestVersion();if(_0x39c0d6['version']&&_0x39c0d6[_0x2533db(0x105)]!==_0x2b6c15)console[_0x2533db(0xa4)]('Version:\x20'+_0x2b6c15+_0x2533db(0xdd)+_0x39c0d6['version']+')'),console['log'](_0x2533db(0xb0));else _0x39c0d6[_0x2533db(0x105)]?console['log']('Version:\x20'+_0x2b6c15+_0x2533db(0xab)):console['log'](_0x2533db(0xf7)+_0x2b6c15);const _0x17c330=await getToken();if(_0x17c330){const _0x4a6272=await _0x8720eb[_0x2533db(0xb9)](getCurrentUser,_0x17c330);_0x4a6272['success']?console[_0x2533db(0xa4)](_0x2533db(0xcb)+_0x8720eb['IZhxO'](bold,_0x4a6272['user']['organizationName'])):(console[_0x2533db(0xa4)](_0x2533db(0xcf)),console['log'](_0x2533db(0xeb)));}else console[_0x2533db(0xa4)]('API\x20Token:\x20✗\x20Not\x20found'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]');process['env'][_0x2533db(0x93)]&&(console[_0x2533db(0xa4)](_0x2533db(0xdc)+_0x8720eb['xqznc'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+getApiBaseUrl()));console[_0x2533db(0xa4)](_0x8720eb[_0x2533db(0xdf)]);const _0x72aa85=await getOpencodePluginStatus();if(_0x72aa85[_0x2533db(0xe5)]===_0x8720eb[_0x2533db(0xd8)])console[_0x2533db(0xa4)]('\x20\x20'+_0x8720eb[_0x2533db(0xf1)](bold,'@ranger-testing/opencode-plugin')+_0x2533db(0xb5)),_0x72aa85['details']&&console[_0x2533db(0xa4)]('\x20\x20'+_0x72aa85[_0x2533db(0x90)]);else _0x72aa85[_0x2533db(0xe5)]==='not_configured'?(console[_0x2533db(0xa4)](_0x8720eb[_0x2533db(0x107)]),_0x72aa85['details']&&console['log']('\x20\x20'+_0x72aa85['details']),console['log']('\x20\x20Run:\x20ranger\x20setup\x20--opencode')):console[_0x2533db(0xa4)](_0x8720eb[_0x2533db(0xf0)]);console['log'](_0x2533db(0xc8));const _0x1115ce=await _0x8720eb[_0x2533db(0xb9)](getPluginInfo,'ranger@trailhead');if(_0x1115ce){const _0x103fc5=_0x1115ce[_0x2533db(0xd3)]||_0x8720eb['qZZSd'],_0x386afa=_0x1115ce['enabled']?'enabled':_0x8720eb[_0x2533db(0xde)];console[_0x2533db(0xa4)]('\x20\x20'+_0x8720eb['IZhxO'](bold,_0x2533db(0xc0))+_0x2533db(0xa7)+_0x103fc5+',\x20'+_0x386afa+')');}else console['log']('\x20\x20Not\x20installed'),console[_0x2533db(0xa4)](_0x2533db(0x96));console[_0x2533db(0xa4)](_0x2533db(0xd6));const {project:_0x139dcf,user:_0x5c56e3}=await getInstalledSkills(),_0x3187ff=_0x139dcf[_0x2533db(0xd1)](_0x492019=>RANGER_MANAGED_SKILLS['includes'](_0x492019['name'])),_0x5f396a=_0x5c56e3['filter'](_0x37b6b6=>RANGER_MANAGED_SKILLS[_0x2533db(0x9d)](_0x37b6b6['name'])),_0x2fc8a1=_0x3187ff['length']+_0x5f396a[_0x2533db(0xbe)];if(_0x2fc8a1===0x0)console['log'](_0x2533db(0xa5)),console['log']('\x20\x20Run:\x20ranger\x20skillup');else{if(_0x3187ff['length']>0x0){console[_0x2533db(0xa4)](_0x2533db(0xe6));for(const _0x2f28e1 of _0x3187ff){console[_0x2533db(0xa4)](_0x2533db(0xc2)+bold(_0x2f28e1['displayName'])+':\x20'+link(_0x2f28e1[_0x2533db(0xf2)],basename(_0x2f28e1['path'])));}}if(_0x5f396a['length']>0x0){console['log'](_0x2533db(0xb3));for(const _0x22b5f0 of _0x5f396a){console['log']('\x20\x20\x20\x20'+_0x8720eb['zxojj'](bold,_0x22b5f0['displayName'])+':\x20'+_0x8720eb[_0x2533db(0xd0)](link,_0x22b5f0['path'],_0x8720eb[_0x2533db(0xfc)](basename,_0x22b5f0['path'])));}}}console[_0x2533db(0xa4)](_0x8720eb['rGHfR']);const {envs:_0xa45747,activeEnv:_0xf53866}=await _0x8720eb[_0x2533db(0x9e)](getEnvironments);let _0x3700e8=[];if(_0x17c330)try{_0x3700e8=await _0x8720eb[_0x2533db(0xad)](listCloudProfiles);}catch{}const _0x3211a0=_0x8720eb[_0x2533db(0xe7)](_0xa45747['length'],_0x3700e8[_0x2533db(0xbe)]);if(_0x3211a0===0x0)console['log'](_0x8720eb[_0x2533db(0xd4)]),console['log'](_0x2533db(0xcc));else{if(_0x3211a0>0x5){const _0x25beb0=[];_0x3700e8['length']>0x0&&_0x25beb0[_0x2533db(0xe9)](_0x3700e8[_0x2533db(0xbe)]+_0x2533db(0x104)),_0xa45747[_0x2533db(0xbe)]>0x0&&_0x25beb0['push'](_0xa45747['length']+_0x2533db(0xfe)),console[_0x2533db(0xa4)](_0x3211a0+_0x2533db(0xf4)+_0x25beb0['join'](',\x20')+')'),_0xf53866&&console[_0x2533db(0xa4)]('\x20\x20Active:\x20'+_0x8720eb[_0x2533db(0xb9)](bold,_0xf53866)),console[_0x2533db(0xa4)](_0x2533db(0xe0));}else{for(const _0x25089e of _0x3700e8){const _0x2ce4b8=_0x8720eb['HEPFq'](_0x25089e['name'],_0xf53866)?_0x8720eb[_0x2533db(0xf3)]:'';console[_0x2533db(0xa4)]('\x20\x20'+bold(_0x25089e['name'])+_0x2533db(0xee)+_0x2ce4b8);const _0x5ac1ed=_0x25089e['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x25089e[_0x2533db(0xa6)]+')':_0x8720eb[_0x2533db(0xb6)];console[_0x2533db(0xa4)](_0x2533db(0xf6)+_0x5ac1ed);}const _0x37b588=new Set(_0x3700e8[_0x2533db(0xea)](_0x5c8911=>_0x5c8911[_0x2533db(0xe3)]));for(const _0x376b38 of _0xa45747){if(_0x37b588['has'](_0x376b38['name']))continue;const _0x4de4e1=_0x376b38[_0x2533db(0xca)]?_0x8720eb[_0x2533db(0xf3)]:'',_0x19280d=_0x376b38['hasEncryptedAuth']?_0x8720eb['YnzBA']:_0x376b38[_0x2533db(0xc3)]?_0x2533db(0xff):_0x8720eb[_0x2533db(0xe2)];console[_0x2533db(0xa4)]('\x20\x20'+bold(_0x376b38[_0x2533db(0xe3)])+_0x2533db(0xfd)+_0x4de4e1),console[_0x2533db(0xa4)]('\x20\x20\x20\x20Auth:\x20'+_0x19280d),_0x376b38['settingsPath']!=='(not\x20found)'&&console['log'](_0x2533db(0xb7)+link(_0x376b38['settingsPath'],basename(_0x376b38[_0x2533db(0x101)])));}if(!_0xf53866){console['log'](_0x2533db(0xbc));const _0x51bed8=[..._0x3700e8['map'](_0x888873=>_0x888873[_0x2533db(0xe3)]),..._0xa45747['filter'](_0x50c91e=>!_0x37b588[_0x2533db(0x97)](_0x50c91e[_0x2533db(0xe3)]))['map'](_0x57d54c=>_0x57d54c[_0x2533db(0xe3)])];console['log'](_0x2533db(0x99)+_0x51bed8[_0x2533db(0xb2)](',\x20')+')');}}}console['log']('');}
1
+ const _0x1faeae=_0x31f1;(function(_0x4c22da,_0x5d8f5f){const _0x231302=_0x31f1,_0x46a14a=_0x4c22da();while(!![]){try{const _0xcec824=-parseInt(_0x231302(0x1b5))/0x1+parseInt(_0x231302(0x215))/0x2+-parseInt(_0x231302(0x210))/0x3+-parseInt(_0x231302(0x21a))/0x4*(-parseInt(_0x231302(0x1d0))/0x5)+parseInt(_0x231302(0x219))/0x6*(-parseInt(_0x231302(0x1d5))/0x7)+-parseInt(_0x231302(0x1cc))/0x8*(parseInt(_0x231302(0x1df))/0x9)+parseInt(_0x231302(0x1e2))/0xa;if(_0xcec824===_0x5d8f5f)break;else _0x46a14a['push'](_0x46a14a['shift']());}catch(_0x3fb9fb){_0x46a14a['push'](_0x46a14a['shift']());}}}(_0x363f,0xd5f47));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';function _0x363f(){const _0x5b1da3=['\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','trim','hasPlaintextAuth','none','924375gzxGTF','Kjjoj','status','\x20(active)','join','370220jNYoho','\x20\x20Active:\x20','dyLvF','enabled','980898yMyXxh','6122252LJNXPq','opencode','\x1b[0m','uvLGC','isArray','API\x20Token:\x20✗\x20Not\x20found','includes','TzgLM','950945DHJylq','\x20\x20\x20\x20Auth:\x20','cQSkV','ftfie','zIKkA','NxZhC','\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a','API\x20URL:\x20','configured','API\x20Environment:\x20','sXHzz','BFXRS','\x20profiles\x20configured\x20(','version','name','isActive','GFNMC','TBCAg','QtraE','length','user','\x0a\x20\x20No\x20active\x20profile\x20set',':\x20installed\x20(','8wZnsKp','config','\x20[cloud]','\x0a---\x20Profiles\x20---','5sKbkFC','Npxyd','Root:\x20','PZEJS','PlloC','35qDpszq','(not\x20found)','debug','jopVs','mpvWM','disabled','CZBHw','gicGQ','emURj','ZAmMq','13182138vlyAzS','details',':\x20configured','27018530IvGvsi','JHXaR','NaBlt','\x0a📊\x20Ranger\x20Status\x0a','success','LQfrn','no\x20session','displayName','\x20\x20User-level:','DvJjw','map','toString','JtscC','\x20\x20Not\x20configured','No\x20profiles\x20configured','\x1b[1m','wjWXE','nWdeD','auth.json','wwuMN','not_installed','gMVuB','filter','pipe','Version:\x20','has','zDzZB','\x20cloud','parse','project','log','match','ynUaD','NVJgB','opencode-plugin','plugin','uDrDH','cwd','\x20\x20Run:\x20ranger\x20skillup','dkfpJ','eDLwO','\x20\x20Not\x20installed'];_0x363f=function(){return _0x5b1da3;};return _0x363f();}function _0x31f1(_0x14c419,_0x5156ad){_0x14c419=_0x14c419-0x1b3;const _0x363f3b=_0x363f();let _0x31f1be=_0x363f3b[_0x14c419];return _0x31f1be;}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=_0x24177a=>_0x1faeae(0x1f1)+_0x24177a+_0x1faeae(0x21c),link=(_0x531cce,_0x4149cc)=>'\x1b]8;;file://'+_0x531cce+'\x07'+(_0x4149cc||_0x531cce)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x3557fe=_0x1faeae,_0x417a5e={'ydurP':_0x3557fe(0x1bd),'gMVuB':'not_configured','JHXaR':'data','ZAmMq':'close'};return new Promise(_0x26a75b=>{const _0x316535=_0x3557fe,_0x59a458={'QtraE':'string','dkfpJ':function(_0x5e02ff,_0x359d8d){return _0x5e02ff(_0x359d8d);},'NxZhC':_0x417a5e['ydurP'],'eDLwO':function(_0x15172e,_0x31fd2f){return _0x15172e>_0x31fd2f;},'VHgUO':_0x417a5e[_0x316535(0x1f7)]},_0x2e08e7=spawn(_0x316535(0x21b),[_0x316535(0x1d7),_0x316535(0x1cd)],{'stdio':['ignore',_0x316535(0x1f9),_0x316535(0x1f9)]});let _0x246e66='';_0x2e08e7['stdout']?.['on'](_0x417a5e[_0x316535(0x1e3)],_0x2b7fb9=>{const _0x3a5d62=_0x316535;_0x246e66+=_0x2b7fb9[_0x3a5d62(0x1ed)]();}),_0x2e08e7['stderr']?.['on'](_0x417a5e['JHXaR'],_0x131d19=>{const _0xc30dc1=_0x316535;_0x246e66+=_0x131d19[_0xc30dc1(0x1ed)]();}),_0x2e08e7['on']('error',()=>{const _0x25e0eb=_0x316535;_0x26a75b({'status':_0x25e0eb(0x1f6)});}),_0x2e08e7['on'](_0x417a5e[_0x316535(0x1de)],_0x32c219=>{const _0x505993=_0x316535,_0x546e21={'mpvWM':_0x59a458[_0x505993(0x1c7)],'NaBlt':_0x505993(0x204)};if(_0x32c219!==0x0){_0x59a458[_0x505993(0x209)](_0x26a75b,{'status':'not_installed'});return;}const _0x5cf651=_0x246e66[_0x505993(0x20d)]();let _0x35dd84=null;if(_0x5cf651)try{_0x35dd84=JSON[_0x505993(0x1fe)](_0x5cf651);}catch{const _0x10abc2=_0x5cf651[_0x505993(0x201)](/\{[\s\S]*\}$/);if(_0x10abc2)try{_0x35dd84=JSON['parse'](_0x10abc2[0x0]);}catch{_0x35dd84=null;}}const _0x590131=Array[_0x505993(0x21e)](_0x35dd84?.[_0x505993(0x205)])?_0x35dd84?.[_0x505993(0x205)]:[],_0x147a85=_0x590131['some'](_0x90343a=>{const _0x4cd6e7=_0x505993;if(typeof _0x90343a!==_0x546e21[_0x4cd6e7(0x1d9)])return![];return _0x90343a[_0x4cd6e7(0x1b3)]('@ranger-testing/opencode-plugin')||_0x90343a['includes'](_0x546e21[_0x4cd6e7(0x1e4)]);});if(_0x147a85){_0x26a75b({'status':_0x59a458[_0x505993(0x1ba)],'details':_0x59a458[_0x505993(0x20a)](_0x590131['length'],0x0)?_0x590131[_0x505993(0x1c8)]+'\x20plugin(s)\x20configured':undefined});return;}if(_0x590131['length']>0x0){_0x26a75b({'status':_0x59a458['VHgUO'],'details':_0x590131['length']+'\x20plugin(s)\x20configured'});return;}_0x26a75b({'status':_0x59a458['VHgUO']});});});}async function getSkillsFromDir(_0x27c7f9,_0x5a78b6){const _0x9acd0c=_0x1faeae,_0x58e994={'zDzZB':function(_0x52ce90,_0x1ee3eb){return _0x52ce90(_0x1ee3eb);},'LQfrn':function(_0x1b3376,_0x1dbf49,_0x9ba47d){return _0x1b3376(_0x1dbf49,_0x9ba47d);},'cQSkV':'utf-8'};if(!existsSync(_0x27c7f9))return[];const _0xf9aef=[];try{const _0x48d085=await readdir(_0x27c7f9,{'withFileTypes':!![]});for(const _0x58180 of _0x48d085){if(_0x58180['isDirectory']()){const _0xec9f27=join(_0x27c7f9,_0x58180['name'],'SKILL.md');if(_0x58e994[_0x9acd0c(0x1fc)](existsSync,_0xec9f27)){let _0x56771d=_0x58180[_0x9acd0c(0x1c3)];try{const _0x5751c4=await _0x58e994[_0x9acd0c(0x1e7)](readFile,_0xec9f27,_0x58e994[_0x9acd0c(0x1b7)]),_0x5374c5=_0x5751c4['match'](/name:\s*(.+)/);_0x5374c5&&(_0x56771d=_0x5374c5[0x1]['trim']());}catch{}_0xf9aef['push']({'name':_0x58180['name'],'displayName':_0x56771d,'path':_0xec9f27,'level':_0x5a78b6});}}}}catch{return[];}return _0xf9aef;}async function getInstalledSkills(){const _0x43e44f=_0x1faeae,_0x51346e={'Npxyd':_0x43e44f(0x1ff)},[_0x2acdc7,_0x58238f]=await Promise['all']([getSkillsFromDir(getProjectSkillsDir(),_0x51346e[_0x43e44f(0x1d1)]),getSkillsFromDir(getUserSkillsDir(),_0x43e44f(0x1c9))]);return{'project':_0x2acdc7,'user':_0x58238f};}async function getEnvironments(){const _0x553343={'ekDrO':function(_0x154fa7,_0x24d0ed){return _0x154fa7(_0x24d0ed);},'jtSaV':function(_0x34e95,_0xd58042,_0xe390ff){return _0x34e95(_0xd58042,_0xe390ff);},'rzqvY':function(_0x5b56e8){return _0x5b56e8();}},{envNames:_0x267372,activeEnv:_0x127da7}=await _0x553343['rzqvY'](getEnvNames),_0x38f47e=getRangerDir();if(!existsSync(_0x38f47e))return{'envs':[],'activeEnv':null};const _0x414558=_0x267372['map'](_0xfa241d=>{const _0x1a3ece=_0x31f1,_0x1e6b31=_0x553343['ekDrO'](getEnvDir,_0xfa241d),_0x38a5a5=join(_0x1e6b31,'settings.json'),_0x5b91fc=join(_0x1e6b31,_0x1a3ece(0x1f4)),_0x24b0d9=_0x553343['jtSaV'](join,_0x1e6b31,'auth.json.enc');return{'name':_0xfa241d,'settingsPath':existsSync(_0x38a5a5)?_0x38a5a5:'(not\x20found)','hasPlaintextAuth':_0x553343['ekDrO'](existsSync,_0x5b91fc),'hasEncryptedAuth':existsSync(_0x24b0d9),'isActive':_0xfa241d===_0x127da7};});return{'envs':_0x414558,'activeEnv':_0x127da7};}export async function status(){const _0x24ebce=_0x1faeae,_0x427e73={'PZEJS':_0x24ebce(0x1e5),'ynUaD':function(_0x4a0033){return _0x4a0033();},'PlloC':function(_0x12ce49,_0xf460b9){return _0x12ce49(_0xf460b9);},'TBCAg':function(_0x495843,_0x133bfd){return _0x495843(_0x133bfd);},'dyLvF':function(_0x5541bb){return _0x5541bb();},'wwuMN':function(_0x3b30f2){return _0x3b30f2();},'ftfie':function(_0x11e211){return _0x11e211();},'jopVs':function(_0x48f95e,_0x4506f6){return _0x48f95e(_0x4506f6);},'Mwfqu':'@ranger-testing/opencode-plugin','jwlnP':'not_configured','cynrM':'\x20\x20Run:\x20ranger\x20setup\x20--opencode','JtscC':_0x24ebce(0x20c),'gicGQ':'unknown','tVALQ':_0x24ebce(0x218),'hxOXI':_0x24ebce(0x1da),'DvJjw':'ranger@trailhead','zIKkA':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','TzgLM':function(_0x24ba64,_0x4c280e){return _0x24ba64===_0x4c280e;},'GFNMC':'\x20\x20Project-level:','XSUSJ':function(_0x4cd49a,_0x3fc6c5,_0x5c915b){return _0x4cd49a(_0x3fc6c5,_0x5c915b);},'sXHzz':function(_0x29a32d,_0x38c796){return _0x29a32d>_0x38c796;},'yLtae':_0x24ebce(0x1ea),'uvLGC':_0x24ebce(0x1cf),'eaYek':function(_0x33ddbc){return _0x33ddbc();},'nWdeD':function(_0x3451b1){return _0x3451b1();},'KLtFC':function(_0x1293e1,_0x6ece89){return _0x1293e1+_0x6ece89;},'uDrDH':_0x24ebce(0x1f0),'CZBHw':function(_0x1e8e28,_0x6ac7eb){return _0x1e8e28>_0x6ac7eb;},'Kjjoj':_0x24ebce(0x213),'XZhWQ':'encrypted','BFXRS':'plaintext','FzPZz':_0x24ebce(0x20f),'emURj':function(_0x3e1856,_0x5c6fb9){return _0x3e1856!==_0x5c6fb9;},'wjWXE':function(_0x1bc092,_0x291a1d,_0x196645){return _0x1bc092(_0x291a1d,_0x196645);},'NVJgB':function(_0x1730c3,_0x576a94){return _0x1730c3(_0x576a94);}};console[_0x24ebce(0x200)](_0x427e73[_0x24ebce(0x1d3)]);const _0x27ea91=process[_0x24ebce(0x207)](),_0x19abd2=_0x427e73['ynUaD'](getRangerDir);if(!_0x427e73[_0x24ebce(0x1d4)](existsSync,_0x19abd2)){console[_0x24ebce(0x200)]('Root:\x20'+link(_0x27ea91,_0x427e73['TBCAg'](bold,basename(_0x27ea91)))),console[_0x24ebce(0x200)]('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console['log'](_0x24ebce(0x1bb));return;}console['log'](_0x24ebce(0x1d2)+link(_0x27ea91,_0x427e73[_0x24ebce(0x1d4)](bold,_0x427e73[_0x24ebce(0x1d4)](basename,_0x27ea91))));const _0x112d86=getCurrentVersion(),_0x15084b=_0x427e73[_0x24ebce(0x202)](getLatestVersion);if(_0x15084b[_0x24ebce(0x1c2)]&&_0x15084b[_0x24ebce(0x1c2)]!==_0x112d86)console['log'](_0x24ebce(0x1fa)+_0x112d86+'\x20(latest:\x20'+_0x15084b['version']+')'),console[_0x24ebce(0x200)]('\x20\x20Run:\x20ranger\x20update');else _0x15084b[_0x24ebce(0x1c2)]?console[_0x24ebce(0x200)]('Version:\x20'+_0x112d86+'\x20(up\x20to\x20date)'):console[_0x24ebce(0x200)]('Version:\x20'+_0x112d86);const _0x294edb=await _0x427e73[_0x24ebce(0x217)](getToken);if(_0x294edb){const _0x3839c3=await _0x427e73[_0x24ebce(0x1c6)](getCurrentUser,_0x294edb);_0x3839c3[_0x24ebce(0x1e6)]?console['log']('Organization:\x20'+_0x427e73[_0x24ebce(0x1c6)](bold,_0x3839c3[_0x24ebce(0x1c9)]['organizationName'])):(console[_0x24ebce(0x200)]('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console['log'](_0x24ebce(0x21f)),console[_0x24ebce(0x200)]('\x20\x20Run:\x20ranger\x20setup\x20[token]');process['env']['DEBUG']&&(console['log'](_0x24ebce(0x1be)+_0x427e73[_0x24ebce(0x1f5)](getCurrentEnvironment)),console['log'](_0x24ebce(0x1bc)+_0x427e73[_0x24ebce(0x1b8)](getApiBaseUrl)));console[_0x24ebce(0x200)]('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x566c96=await getOpencodePluginStatus();if(_0x566c96[_0x24ebce(0x212)]==='configured')console['log']('\x20\x20'+_0x427e73[_0x24ebce(0x1d8)](bold,_0x427e73['Mwfqu'])+_0x24ebce(0x1e1)),_0x566c96[_0x24ebce(0x1e0)]&&console['log']('\x20\x20'+_0x566c96[_0x24ebce(0x1e0)]);else _0x566c96[_0x24ebce(0x212)]===_0x427e73['jwlnP']?(console['log'](_0x24ebce(0x1ef)),_0x566c96[_0x24ebce(0x1e0)]&&console['log']('\x20\x20'+_0x566c96[_0x24ebce(0x1e0)]),console['log'](_0x427e73['cynrM'])):console['log'](_0x427e73[_0x24ebce(0x1ee)]);console['log']('\x0a---\x20Claude\x20Code\x20Plugin\x20---');const _0x17b90e=await getPluginInfo('ranger@trailhead');if(_0x17b90e){const _0x10a813=_0x17b90e['scope']||_0x427e73[_0x24ebce(0x1dc)],_0x55a9c0=_0x17b90e[_0x24ebce(0x218)]?_0x427e73['tVALQ']:_0x427e73['hxOXI'];console['log']('\x20\x20'+_0x427e73[_0x24ebce(0x1d4)](bold,_0x427e73[_0x24ebce(0x1eb)])+_0x24ebce(0x1cb)+_0x10a813+',\x20'+_0x55a9c0+')');}else console['log'](_0x24ebce(0x20b)),console['log'](_0x427e73[_0x24ebce(0x1b9)]);console[_0x24ebce(0x200)]('\x0a---\x20Skills\x20---');const {project:_0x22cf77,user:_0x1a9bc4}=await getInstalledSkills(),_0x51bab1=_0x22cf77[_0x24ebce(0x1f8)](_0x2e4c11=>RANGER_MANAGED_SKILLS['includes'](_0x2e4c11['name'])),_0x445024=_0x1a9bc4[_0x24ebce(0x1f8)](_0x298e4d=>RANGER_MANAGED_SKILLS['includes'](_0x298e4d[_0x24ebce(0x1c3)])),_0x5a6870=_0x51bab1[_0x24ebce(0x1c8)]+_0x445024['length'];if(_0x427e73[_0x24ebce(0x1b4)](_0x5a6870,0x0))console['log']('No\x20skills\x20installed'),console[_0x24ebce(0x200)](_0x24ebce(0x208));else{if(_0x51bab1['length']>0x0){console[_0x24ebce(0x200)](_0x427e73[_0x24ebce(0x1c5)]);for(const _0x372a34 of _0x51bab1){console[_0x24ebce(0x200)]('\x20\x20\x20\x20'+bold(_0x372a34[_0x24ebce(0x1e9)])+':\x20'+_0x427e73['XSUSJ'](link,_0x372a34['path'],_0x427e73[_0x24ebce(0x1d4)](basename,_0x372a34['path'])));}}if(_0x427e73[_0x24ebce(0x1bf)](_0x445024['length'],0x0)){console['log'](_0x427e73['yLtae']);for(const _0x3aefcb of _0x445024){console['log']('\x20\x20\x20\x20'+bold(_0x3aefcb[_0x24ebce(0x1e9)])+':\x20'+link(_0x3aefcb['path'],basename(_0x3aefcb['path'])));}}}console[_0x24ebce(0x200)](_0x427e73[_0x24ebce(0x21d)]);const {envs:_0x26c276,activeEnv:_0x551ae3}=await _0x427e73['eaYek'](getEnvironments);let _0xace2b6=[];if(_0x294edb)try{_0xace2b6=await _0x427e73[_0x24ebce(0x1f3)](listCloudProfiles);}catch{}const _0x21fa95=_0x427e73['KLtFC'](_0x26c276[_0x24ebce(0x1c8)],_0xace2b6['length']);if(_0x427e73['TzgLM'](_0x21fa95,0x0))console['log'](_0x427e73[_0x24ebce(0x206)]),console['log']('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0x21fa95>0x5){const _0x4c0189=[];_0x427e73[_0x24ebce(0x1db)](_0xace2b6[_0x24ebce(0x1c8)],0x0)&&_0x4c0189['push'](_0xace2b6[_0x24ebce(0x1c8)]+_0x24ebce(0x1fd)),_0x427e73['CZBHw'](_0x26c276[_0x24ebce(0x1c8)],0x0)&&_0x4c0189['push'](_0x26c276['length']+'\x20local'),console[_0x24ebce(0x200)](_0x21fa95+_0x24ebce(0x1c1)+_0x4c0189[_0x24ebce(0x214)](',\x20')+')'),_0x551ae3&&console[_0x24ebce(0x200)](_0x24ebce(0x216)+bold(_0x551ae3)),console[_0x24ebce(0x200)]('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x13f550 of _0xace2b6){const _0x5161bf=_0x13f550['name']===_0x551ae3?_0x427e73[_0x24ebce(0x211)]:'';console[_0x24ebce(0x200)]('\x20\x20'+_0x427e73[_0x24ebce(0x1d8)](bold,_0x13f550[_0x24ebce(0x1c3)])+_0x24ebce(0x1ce)+_0x5161bf);const _0x38a7ee=_0x13f550['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x13f550['sessionUpdatedAt']+')':_0x24ebce(0x1e8);console[_0x24ebce(0x200)]('\x20\x20\x20\x20Session:\x20'+_0x38a7ee);}const _0x181922=new Set(_0xace2b6[_0x24ebce(0x1ec)](_0x5626ce=>_0x5626ce[_0x24ebce(0x1c3)]));for(const _0xab8fd6 of _0x26c276){if(_0x181922[_0x24ebce(0x1fb)](_0xab8fd6[_0x24ebce(0x1c3)]))continue;const _0x5d49ba=_0xab8fd6[_0x24ebce(0x1c4)]?_0x427e73[_0x24ebce(0x211)]:'',_0x478f57=_0xab8fd6['hasEncryptedAuth']?_0x427e73['XZhWQ']:_0xab8fd6[_0x24ebce(0x20e)]?_0x427e73[_0x24ebce(0x1c0)]:_0x427e73['FzPZz'];console[_0x24ebce(0x200)]('\x20\x20'+_0x427e73[_0x24ebce(0x1c6)](bold,_0xab8fd6[_0x24ebce(0x1c3)])+'\x20[local]'+_0x5d49ba),console['log'](_0x24ebce(0x1b6)+_0x478f57),_0x427e73[_0x24ebce(0x1dd)](_0xab8fd6['settingsPath'],_0x24ebce(0x1d6))&&console['log']('\x20\x20\x20\x20Settings:\x20'+_0x427e73[_0x24ebce(0x1f2)](link,_0xab8fd6['settingsPath'],_0x427e73[_0x24ebce(0x203)](basename,_0xab8fd6['settingsPath'])));}if(!_0x551ae3){console[_0x24ebce(0x200)](_0x24ebce(0x1ca));const _0x4a316f=[..._0xace2b6[_0x24ebce(0x1ec)](_0x55b853=>_0x55b853[_0x24ebce(0x1c3)]),..._0x26c276[_0x24ebce(0x1f8)](_0x677969=>!_0x181922['has'](_0x677969[_0x24ebce(0x1c3)]))[_0x24ebce(0x1ec)](_0x5166f0=>_0x5166f0[_0x24ebce(0x1c3)])];console[_0x24ebce(0x200)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x4a316f['join'](',\x20')+')');}}}console[_0x24ebce(0x200)]('');}