@ranger-testing/ranger-cli 3.1.3 → 3.1.4-alpha.fb796e7-45

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 (85) 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/sessionCache.js +1 -1
  71. package/build/commands/utils/settings.js +1 -1
  72. package/build/commands/utils/skillContent.js +1 -1
  73. package/build/commands/utils/skills.js +1 -1
  74. package/build/commands/utils/stitchWebmFiles.js +1 -1
  75. package/build/commands/utils/telemetry.js +1 -1
  76. package/build/commands/utils/tokenRefresh.js +1 -1
  77. package/build/commands/utils/traceSnapshotMapper.js +1 -1
  78. package/build/commands/utils/tunnelClient.js +1 -1
  79. package/build/commands/utils/userApi.js +1 -1
  80. package/build/commands/utils/version.js +1 -1
  81. package/build/commands/verifyFeature.js +1 -1
  82. package/build/commands/verifyFeatureCli.js +1 -1
  83. package/build/commands/verifyFeatureNovaCli.js +1 -1
  84. package/build/commands/verifyFeatureRangerwrightCli.js +1 -1
  85. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x49b562,_0xd9de7b){const _0x472fd7=_0x39dc,_0x3aca2f=_0x49b562();while(!![]){try{const _0x240ebb=-parseInt(_0x472fd7(0x156))/0x1+parseInt(_0x472fd7(0x157))/0x2+parseInt(_0x472fd7(0x151))/0x3*(parseInt(_0x472fd7(0x150))/0x4)+parseInt(_0x472fd7(0x15c))/0x5+parseInt(_0x472fd7(0x15b))/0x6*(parseInt(_0x472fd7(0x152))/0x7)+-parseInt(_0x472fd7(0x14f))/0x8+-parseInt(_0x472fd7(0x159))/0x9*(-parseInt(_0x472fd7(0x14e))/0xa);if(_0x240ebb===_0xd9de7b)break;else _0x3aca2f['push'](_0x3aca2f['shift']());}catch(_0x27a7a9){_0x3aca2f['push'](_0x3aca2f['shift']());}}}(_0x3d1b,0x7e908));import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';function _0x3d1b(){const _0x3afc28=['2586Okrqqm','1330380fqNfsf','Cimfk','\x0a✅\x20API\x20key\x20stored\x20successfully','log','5245910iBJckC','6857952VgoSCG','252644yuChSb','3tUgcpv','5663JZEjgD','user','UyrJr','organizationName','292144mjJWxo','930578PHwuhS','message','9UGHOiT','\x0a✅\x20Logged\x20in\x20to\x20'];_0x3d1b=function(){return _0x3afc28;};return _0x3d1b();}import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';function _0x39dc(_0x2f793b,_0x404c74){_0x2f793b=_0x2f793b-0x14d;const _0x3d1bdb=_0x3d1b();let _0x39dce0=_0x3d1bdb[_0x2f793b];return _0x39dce0;}import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0x2a8918=_0x39dc,_0x5b988e={'UyrJr':'Re-authenticating\x20via\x20MCP\x20bootstrap...','OPdXF':function(_0x2b92d4){return _0x2b92d4();},'Cimfk':function(_0x4135ee,_0x5306d1){return _0x4135ee(_0x5306d1);}},_0x28e606=await getMcpAuthOrigin();if(_0x28e606){console[_0x2a8918(0x14d)](_0x5b988e[_0x2a8918(0x154)]),await mcpBootstrap();return;}if(!isInteractive())throw new Error('Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.');try{const _0x5d8909=await _0x5b988e['OPdXF'](runDeviceAuthFlow),_0x4fd469=await _0x5b988e[_0x2a8918(0x15d)](getCurrentUser,_0x5d8909);_0x4fd469['success']?console['log'](_0x2a8918(0x15a)+_0x4fd469[_0x2a8918(0x153)][_0x2a8918(0x155)]):console['log'](_0x2a8918(0x15e));}catch(_0x4bfca2){throw new Error('Login\x20failed:\x20'+(_0x4bfca2 instanceof Error?_0x4bfca2[_0x2a8918(0x158)]:_0x4bfca2));}}
1
+ (function(_0xdfe7f9,_0x4f726f){const _0x570ab7=_0x2ed3,_0x2719e5=_0xdfe7f9();while(!![]){try{const _0x22951e=-parseInt(_0x570ab7(0x178))/0x1+-parseInt(_0x570ab7(0x180))/0x2*(parseInt(_0x570ab7(0x170))/0x3)+parseInt(_0x570ab7(0x16d))/0x4*(parseInt(_0x570ab7(0x17d))/0x5)+-parseInt(_0x570ab7(0x175))/0x6+-parseInt(_0x570ab7(0x16f))/0x7*(-parseInt(_0x570ab7(0x17e))/0x8)+-parseInt(_0x570ab7(0x173))/0x9*(parseInt(_0x570ab7(0x174))/0xa)+parseInt(_0x570ab7(0x177))/0xb;if(_0x22951e===_0x4f726f)break;else _0x2719e5['push'](_0x2719e5['shift']());}catch(_0x20a575){_0x2719e5['push'](_0x2719e5['shift']());}}}(_0xcd81,0x202ad));function _0x2ed3(_0x15fae9,_0x5e18b0){_0x15fae9=_0x15fae9-0x16d;const _0xcd812d=_0xcd81();let _0x2ed368=_0xcd812d[_0x15fae9];return _0x2ed368;}function _0xcd81(){const _0x56d78f=['Login\x20requires\x20an\x20interactive\x20terminal.\x20In\x20CI,\x20use:\x20ranger\x20setup\x20[token]\x20or\x20set\x20RANGER_CLI_TOKEN.','10pBxTDC','776KBKNoo','spjUh','4942tvbaIu','484956Maflbt','user','7721HSHcig','51iTyQpg','\x0a✅\x20Logged\x20in\x20to\x20','JvHRA','9bWDKcg','2158310aPyOzD','1173276hxUSkl','organizationName','5313825lwCeNX','247403ImpanQ','Login\x20failed:\x20','log','message'];_0xcd81=function(){return _0x56d78f;};return _0xcd81();}import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{getCurrentUser}from'./utils/userApi.js';import{getMcpAuthOrigin,mcpBootstrap}from'./mcpBootstrap.js';import{isInteractive}from'./utils/cloudProfileSession.js';export async function login(){const _0xc281eb=_0x2ed3,_0x2f60d3={'YdBLg':function(_0x5f0843){return _0x5f0843();},'spjUh':function(_0x46e475){return _0x46e475();},'VdSIu':function(_0x479c87){return _0x479c87();},'JvHRA':function(_0x509d7b,_0x5a68a4){return _0x509d7b instanceof _0x5a68a4;}},_0x17091a=await _0x2f60d3['YdBLg'](getMcpAuthOrigin);if(_0x17091a){console[_0xc281eb(0x17a)]('Re-authenticating\x20via\x20MCP\x20bootstrap...'),await _0x2f60d3[_0xc281eb(0x17f)](mcpBootstrap);return;}if(!isInteractive())throw new Error(_0xc281eb(0x17c));try{const _0x119fe6=await _0x2f60d3['VdSIu'](runDeviceAuthFlow),_0x2dbc89=await getCurrentUser(_0x119fe6);_0x2dbc89['success']?console['log'](_0xc281eb(0x171)+_0x2dbc89[_0xc281eb(0x16e)][_0xc281eb(0x176)]):console['log']('\x0a✅\x20API\x20key\x20stored\x20successfully');}catch(_0x28af52){throw new Error(_0xc281eb(0x179)+(_0x2f60d3[_0xc281eb(0x172)](_0x28af52,Error)?_0x28af52[_0xc281eb(0x17b)]:_0x28af52));}}
@@ -1 +1 @@
1
- (function(_0x35f96f,_0x2005d4){const _0x25884c=_0x2bf3,_0x5bc7be=_0x35f96f();while(!![]){try{const _0x1e05ca=parseInt(_0x25884c(0x14d))/0x1+-parseInt(_0x25884c(0x162))/0x2+parseInt(_0x25884c(0x121))/0x3*(-parseInt(_0x25884c(0x14b))/0x4)+parseInt(_0x25884c(0xea))/0x5*(parseInt(_0x25884c(0x12b))/0x6)+parseInt(_0x25884c(0x119))/0x7*(-parseInt(_0x25884c(0x16d))/0x8)+parseInt(_0x25884c(0x15b))/0x9*(parseInt(_0x25884c(0x10e))/0xa)+parseInt(_0x25884c(0xef))/0xb;if(_0x1e05ca===_0x2005d4)break;else _0x5bc7be['push'](_0x5bc7be['shift']());}catch(_0x1c6035){_0x5bc7be['push'](_0x5bc7be['shift']());}}}(_0x3e4b,0x25279));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';import{homedir}from'os';import{createServer}from'http';import{randomBytes,createHash}from'crypto';import{exec}from'child_process';import{getMcpAuthUrl}from'./utils/environment.js';function _0x3e4b(){const _0x204273=['utf-8','close','RrooD','rlUWi','authorization_servers','FZHAf','slice','url','jnHnv','hzvfn','split','length','qvErp','searchParams','NxrpD','1.0.0','now','TfrqZ','error','VVGFS','OAuthTimeoutError','authorization_code','14255kXfdUU','YRkgJ','bGEEg','closeAllConnections','text/html','2199076kcTMFX','string','accessToken','.ranger','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>','log','refresh_token','qPDOa','headers','parse','KLTKu','OAuth\x20error:\x20','application/json,\x20text/event-stream','hAnHQ','Discovering\x20authorization\x20server...','start','UfZIB','poPRM','oXJCW','YXhPT','end','name','response_type','Authorization','isTTY','includes','content','FcTFo','Unknown\x20error','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','93820EdVONd','code_challenge','pRCGc','tNWut','ddKYs','proxied','kdcuA','wsDRj','origin','application/json','qRNPP','958020lThevj','MCP\x20initialize\x20failed:\x20','HTTP\x20','UkUQx','write','nFFEP','BwUgs','VibxS','19392KjrxOB','clientSecret','structuredContent','code_challenge_method','token','2025-03-26','ZoDTf','EJjQf','access_token','<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','54vPDIsr','Initializing\x20MCP\x20session...','sha256','clientId','/callback','digest','NLCGH','POST','match','expires_in','OIpVb','expiresAt','stdout','BEAQK','refresh.txt','resource','qMCBs','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','bpJzN','MCP\x20server\x20returned\x20HTTP\x20','set','writeHead','Exchanging\x20authorization\x20code...','\x0aToken\x20written\x20to\x20','text','AyKTd','\x20done','plCOh','registration_endpoint','PiIzs','code','auth-origin.txt','20QhbFjL','bsGFh','189474wiPtIj','HLLpi','Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20','cvTZS','stringify','json','tUUGO','Requesting\x20CLI\x20token...','pathname','Grwwj','hlqDQ','status','OXWCe','trim','171JLIMUz','error_description','get','platform','oNIva','toString','base64url','270164uuYWgw','SmZRo','state','message','CIGOI','TpuBj','2.0','result','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','win32','content-type','16SbCeyp','yFSEb','text/event-stream','pSKqQ'];_0x3e4b=function(){return _0x204273;};return _0x3e4b();}const CALLBACK_PORT=0x4d78,TOKEN_CACHE_PATH=join(homedir(),'.ranger','mcp-oauth-tokens.json'),AUTH_ORIGIN_PATH=join(homedir(),'.ranger','auth-origin.txt');export async function getMcpAuthOrigin(){const _0xf6023f=_0x2bf3;try{const _0x40e4d3=(await readFile(AUTH_ORIGIN_PATH,_0xf6023f(0x171)))[_0xf6023f(0x15a)]();return _0x40e4d3||null;}catch{return null;}}export async function mcpBootstrap(){const _0x4a54c3=_0x2bf3,_0x3beb3b={'hlqDQ':function(_0x3229ae,_0x3aab3b){return _0x3229ae(_0x3aab3b);},'LkciE':function(_0x3923f2,_0x405883){return _0x3923f2===_0x405883;}},_0x1cd609=getMcpAuthUrl();currentOrigin=_0x1cd609;const _0x47416c=process[_0x4a54c3(0x137)][_0x4a54c3(0x108)]??![];console[_0x4a54c3(0xf5)]('\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20'+_0x1cd609+'\x0a');const _0x4e98e1=await _0x3beb3b[_0x4a54c3(0x157)](tryUnauthenticated,_0x1cd609);let _0x307ff8=null;if(_0x3beb3b['LkciE'](_0x4e98e1,_0x4a54c3(0x113)))_0x307ff8='';else{_0x307ff8=await loadCachedToken();if(!_0x307ff8){if(!_0x47416c)throw new Error('MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a'+_0x4a54c3(0x16a));_0x307ff8=await oauthFlow(_0x1cd609);}}await callGetCliToken(_0x1cd609,_0x307ff8);}function _0x2bf3(_0x18396f,_0x29807d){_0x18396f=_0x18396f-0xdb;const _0x3e4b44=_0x3e4b();let _0x2bf315=_0x3e4b44[_0x18396f];return _0x2bf315;}async function tryUnauthenticated(_0x2afe6e){const _0x582b3b=_0x2bf3,_0x290b09={'UMpDX':function(_0x519dec,_0x2a3652,_0x2aa303){return _0x519dec(_0x2a3652,_0x2aa303);},'qvErp':_0x582b3b(0x132),'ZoDTf':'2.0','BEAQK':'initialize','kdcuA':'2025-03-26','qMCBs':_0x582b3b(0x113),'nkFJd':function(_0x1f294a,_0x35a0cf){return _0x1f294a===_0x35a0cf;},'GpkVC':'needs-oauth'},_0x52721b=await _0x290b09['UMpDX'](fetch,_0x2afe6e,{'method':_0x290b09[_0x582b3b(0xe0)],'headers':{'Content-Type':'application/json','Accept':'application/json,\x20text/event-stream'},'body':JSON['stringify']({'jsonrpc':_0x290b09[_0x582b3b(0x127)],'id':0x1,'method':_0x290b09[_0x582b3b(0x138)],'params':{'protocolVersion':_0x290b09[_0x582b3b(0x114)],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x582b3b(0xe3)}}})});if(_0x52721b['ok'])return await _0x52721b[_0x582b3b(0x143)](),_0x290b09[_0x582b3b(0x13b)];if(_0x290b09['nkFJd'](_0x52721b['status'],0x191))return await _0x52721b[_0x582b3b(0x143)](),_0x290b09['GpkVC'];const _0x6bae40=await _0x52721b[_0x582b3b(0x143)]();throw new Error(_0x582b3b(0x13e)+_0x52721b['status']+':\x20'+_0x6bae40);}class OAuthTimeoutError extends Error{constructor(_0x5e4541){const _0x17dc23=_0x2bf3,_0x54da64={'NxrpD':_0x17dc23(0xe8)};super(_0x5e4541),this[_0x17dc23(0x105)]=_0x54da64[_0x17dc23(0xe2)];}}async function oauthFlow(_0x33c053){const _0x1367c2=_0x2bf3,_0x317bf9={'plCOh':function(_0x5bc9c2,_0x44316a){return _0x5bc9c2(_0x44316a);}};try{return await oauthFlowAttempt(_0x33c053);}catch(_0x4a1ab7){if(_0x4a1ab7 instanceof OAuthTimeoutError&&await loadCachedClient())return console['log']('\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a'),await clearCachedClient(),await _0x317bf9[_0x1367c2(0x146)](oauthFlowAttempt,_0x33c053);throw _0x4a1ab7;}}async function oauthFlowAttempt(_0x44321f){const _0x176e08=_0x2bf3,_0x5beafb={'nFFEP':_0x176e08(0xfe),'InwKB':function(_0x549c1b,_0x5be84d){return _0x549c1b(_0x5be84d);},'CIGOI':_0x176e08(0x10d),'edGMW':'No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','eyNEv':function(_0x2de7ec,_0x573e3d,_0x4a38bf){return _0x2de7ec(_0x573e3d,_0x4a38bf);},'dMqlm':'Ranger\x20CLI','YRkgJ':'refresh_token','PiIzs':_0x176e08(0x145),'Grwwj':'Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','IdQFW':_0x176e08(0x12d),'zeeSf':'base64url','jbBAy':'code','qPDOa':'redirect_uri','WzDYS':_0x176e08(0x124),'AyKTd':'state','QGkQE':'resource','gmnez':'\x0aOpening\x20browser\x20for\x20authentication...','xmjnE':_0x176e08(0x141),'FZHAf':_0x176e08(0xe9),'SmZRo':function(_0x392457,_0x2af9f4,_0xdef5aa){return _0x392457(_0x2af9f4,_0xdef5aa);}},_0x143141=_0x44321f['replace'](/\/mcp$/,'');process[_0x176e08(0x137)]['write'](_0x5beafb[_0x176e08(0x11e)]);const _0x118b13=await _0x5beafb['InwKB'](fetch,_0x143141+'/.well-known/oauth-protected-resource');if(!_0x118b13['ok'])throw new Error(_0x5beafb[_0x176e08(0x166)]);const _0xaad6a9=await _0x118b13['json'](),_0x34ba59=_0xaad6a9[_0x176e08(0x175)]?.[0x0];if(!_0x34ba59)throw new Error(_0x5beafb['edGMW']);console[_0x176e08(0xf5)]('\x20'+_0x34ba59);const _0x6653d4=await _0x5beafb['InwKB'](fetchAuthServerMetadata,_0x34ba59);let _0x4f5e65,_0x21a507;const _0x9d47f6=await loadCachedClient();if(_0x9d47f6)_0x4f5e65=_0x9d47f6['clientId'],_0x21a507=_0x9d47f6[_0x176e08(0x122)];else{if(_0x6653d4[_0x176e08(0x147)]){process[_0x176e08(0x137)]['write']('Registering\x20OAuth\x20client...');const _0x5a41d5=await _0x5beafb['eyNEv'](fetch,_0x6653d4['registration_endpoint'],{'method':_0x176e08(0x132),'headers':{'Content-Type':_0x176e08(0x117)},'body':JSON[_0x176e08(0x151)]({'client_name':_0x5beafb['dMqlm'],'redirect_uris':['http://localhost:'+CALLBACK_PORT+'/callback'],'grant_types':['authorization_code',_0x5beafb[_0x176e08(0xeb)]],'response_types':['code'],'token_endpoint_auth_method':'none'})});if(!_0x5a41d5['ok']){const _0x3e1241=await _0x5a41d5['text']();throw new Error('Client\x20registration\x20failed:\x20'+_0x3e1241);}const _0x3b3501=await _0x5a41d5[_0x176e08(0x152)]();_0x4f5e65=_0x3b3501['client_id'],_0x21a507=_0x3b3501['client_secret'],await saveCachedClient(_0x4f5e65,_0x21a507),console[_0x176e08(0xf5)](_0x5beafb[_0x176e08(0x148)]);}else throw new Error(_0x5beafb[_0x176e08(0x156)]);}const _0x4b7ec3=randomBytes(0x20)[_0x176e08(0x160)](_0x176e08(0x161)),_0x4b7cd8=createHash(_0x5beafb['IdQFW'])['update'](_0x4b7ec3)[_0x176e08(0x130)](_0x5beafb['zeeSf']),_0x28b3ee=randomBytes(0x10)[_0x176e08(0x160)]('hex'),_0x534a25=new URL(_0x6653d4['authorization_endpoint']);_0x534a25[_0x176e08(0xe1)][_0x176e08(0x13f)](_0x176e08(0x106),_0x5beafb['jbBAy']),_0x534a25[_0x176e08(0xe1)][_0x176e08(0x13f)]('client_id',_0x4f5e65),_0x534a25['searchParams'][_0x176e08(0x13f)](_0x5beafb[_0x176e08(0xf7)],'http://localhost:'+CALLBACK_PORT+_0x176e08(0x12f)),_0x534a25['searchParams']['set'](_0x176e08(0x10f),_0x4b7cd8),_0x534a25['searchParams']['set'](_0x5beafb['WzDYS'],'S256'),_0x534a25['searchParams']['set'](_0x5beafb[_0x176e08(0x144)],_0x28b3ee);_0xaad6a9[_0x176e08(0x13a)]&&_0x534a25[_0x176e08(0xe1)][_0x176e08(0x13f)](_0x5beafb['QGkQE'],_0xaad6a9[_0x176e08(0x13a)]);console[_0x176e08(0xf5)](_0x5beafb['gmnez']),console['log'](_0x176e08(0xf3)+_0x534a25[_0x176e08(0x160)]()+'\x0a'),await openBrowser(_0x534a25[_0x176e08(0x160)]());const _0x4d2ca4=await waitForCallback(_0x28b3ee);process[_0x176e08(0x137)]['write'](_0x5beafb['xmjnE']);const _0x40dd1=new URLSearchParams({'grant_type':_0x5beafb[_0x176e08(0x176)],'code':_0x4d2ca4,'redirect_uri':'http://localhost:'+CALLBACK_PORT+_0x176e08(0x12f),'client_id':_0x4f5e65,'code_verifier':_0x4b7ec3});_0x21a507&&_0x40dd1[_0x176e08(0x13f)]('client_secret',_0x21a507);_0xaad6a9[_0x176e08(0x13a)]&&_0x40dd1['set'](_0x5beafb['QGkQE'],_0xaad6a9['resource']);const _0x372612=await _0x5beafb[_0x176e08(0x163)](fetch,_0x6653d4['token_endpoint'],{'method':'POST','headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0x40dd1});if(!_0x372612['ok']){const _0x124b1b=await _0x372612[_0x176e08(0x143)]();throw new Error('Token\x20exchange\x20failed:\x20'+_0x124b1b);}const _0x359f46=await _0x372612[_0x176e08(0x152)]();return console[_0x176e08(0xf5)](_0x5beafb['PiIzs']),await saveCachedToken(_0x359f46[_0x176e08(0x129)],_0x359f46[_0x176e08(0xf6)],_0x359f46[_0x176e08(0x134)]),_0x359f46['access_token'];}async function callGetCliToken(_0x1f7ac5,_0x11e0ed){const _0xae12dc=_0x2bf3,_0x507d68={'EJjQf':function(_0x31f185,_0x39b811,_0x4426a7){return _0x31f185(_0x39b811,_0x4426a7);},'NLCGH':_0xae12dc(0x117),'pSKqQ':_0xae12dc(0xfc),'YXhPT':_0xae12dc(0x107),'qRNPP':function(_0x473ab9,_0x233fe6){return _0x473ab9(_0x233fe6);},'OIpVb':_0xae12dc(0x168),'KLTKu':'ranger-cli','BwUgs':function(_0x1ead33,_0x124ef6,_0x5416be){return _0x1ead33(_0x124ef6,_0x5416be);},'ddKYs':'notifications/initialized','HLLpi':_0xae12dc(0x154),'yFSEb':function(_0xe3170b,_0x228130){return _0xe3170b(_0x228130);},'ADyUo':'tools/call','rlUWi':'get_cli_token','VibxS':function(_0x3e76e8,_0x456967){return _0x3e76e8(_0x456967);},'FcTFo':'\x0aUnexpected\x20response\x20structure:','pfMjy':'Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','KcBHO':_0xae12dc(0x139)},_0x1bdd62={'Content-Type':_0x507d68[_0xae12dc(0x131)],'Accept':_0x507d68[_0xae12dc(0x170)]};_0x11e0ed&&(_0x1bdd62[_0x507d68[_0xae12dc(0x103)]]='Bearer\x20'+_0x11e0ed);const _0x59165b=async _0x4146d7=>{const _0x7d7545=_0xae12dc,_0x5214a7=await _0x507d68[_0x7d7545(0x128)](fetch,_0x1f7ac5,{'method':_0x7d7545(0x132),'headers':_0x1bdd62,'body':JSON['stringify'](_0x4146d7)});if(!_0x5214a7['ok']){const _0x3f3464=await _0x5214a7[_0x7d7545(0x143)]();throw new Error(_0x7d7545(0x11b)+_0x5214a7['status']+':\x20'+_0x3f3464);}return parseResponse(_0x5214a7);};process[_0xae12dc(0x137)]['write'](_0xae12dc(0x12c));const _0x483c3d=await _0x507d68[_0xae12dc(0x118)](_0x59165b,{'jsonrpc':_0x507d68[_0xae12dc(0x135)],'id':0x1,'method':'initialize','params':{'protocolVersion':_0xae12dc(0x126),'capabilities':{},'clientInfo':{'name':_0x507d68[_0xae12dc(0xfa)],'version':'1.0.0'}}});if(_0x483c3d[_0xae12dc(0xe6)])throw new Error(_0xae12dc(0x11a)+(_0x483c3d[_0xae12dc(0xe6)][_0xae12dc(0x165)]??JSON['stringify'](_0x483c3d['error'])));console[_0xae12dc(0xf5)]('\x20done'),await _0x507d68[_0xae12dc(0x11f)](fetch,_0x1f7ac5,{'method':'POST','headers':_0x1bdd62,'body':JSON[_0xae12dc(0x151)]({'jsonrpc':_0x507d68[_0xae12dc(0x135)],'method':_0x507d68[_0xae12dc(0x112)]})})['then'](_0x16c2b4=>_0x16c2b4[_0xae12dc(0x143)]()),process[_0xae12dc(0x137)][_0xae12dc(0x11d)](_0x507d68[_0xae12dc(0x14e)]);const _0x45bc8b=await _0x507d68[_0xae12dc(0x16e)](_0x59165b,{'jsonrpc':_0x507d68['OIpVb'],'id':0x2,'method':_0x507d68['ADyUo'],'params':{'name':_0x507d68[_0xae12dc(0x174)],'arguments':{}}});if(_0x45bc8b['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x45bc8b['error']['message']??JSON['stringify'](_0x45bc8b['error'])));console['log'](_0xae12dc(0x145));const _0x436d9d=_0x507d68[_0xae12dc(0x120)](extractToken,_0x45bc8b[_0xae12dc(0x169)]);if(!_0x436d9d){console['error'](_0x507d68[_0xae12dc(0x10b)]),console[_0xae12dc(0xe6)](JSON[_0xae12dc(0x151)](_0x45bc8b['result'],null,0x2));throw new Error(_0x507d68['pfMjy']);}const _0x145ed9=_0x507d68['BwUgs'](join,homedir(),'.ranger'),_0x1a3612=join(_0x145ed9,_0x507d68['KcBHO']);await mkdir(_0x145ed9,{'recursive':!![]}),await writeFile(_0x1a3612,_0x436d9d,{'mode':0x180}),await writeFile(join(_0x145ed9,_0xae12dc(0x14a)),_0x1f7ac5,{'mode':0x180}),console['log'](_0xae12dc(0x142)+_0x1a3612),console['log'](_0xae12dc(0x13c));}async function fetchAuthServerMetadata(_0x5a5b7f){const _0x27e2c7=_0x2bf3,_0xb35eaa={'UCgka':function(_0x3e2f46,_0xc3fac0){return _0x3e2f46(_0xc3fac0);}},_0x31e787=_0x5a5b7f+'/.well-known/oauth-authorization-server',_0x33a7a=await _0xb35eaa['UCgka'](fetch,_0x31e787);if(!_0x33a7a['ok'])throw new Error(_0x27e2c7(0x14f)+_0x31e787+':\x20'+_0x33a7a[_0x27e2c7(0x158)]);return _0x33a7a[_0x27e2c7(0x152)]();}function waitForCallback(_0x4d7b1b){const _0x45d732=_0x2bf3,_0x11b85e={'RuqOR':'OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes','tNWut':_0x45d732(0x149),'hzvfn':_0x45d732(0xe6),'xHjtI':_0x45d732(0x15c),'oNIva':'<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','xwsmZ':function(_0x137535,_0xa4be2b,_0x21d4ef){return _0x137535(_0xa4be2b,_0x21d4ef);},'GUqzT':'127.0.0.1'};return new Promise((_0x43a443,_0x2f8b44)=>{const _0x2d87be=_0x45d732,_0x376918={'uOOCv':function(_0x4a22bb,_0x5a4783){return _0x4a22bb(_0x5a4783);},'UkUQx':_0x11b85e['RuqOR'],'bsGFh':function(_0x19b9a0,_0x2730ba){return _0x19b9a0!==_0x2730ba;},'ZvSUe':_0x11b85e[_0x2d87be(0x111)],'jnHnv':_0x11b85e[_0x2d87be(0xdd)],'zkGQH':_0x11b85e['xHjtI'],'vlEGZ':_0x2d87be(0xee),'TfrqZ':function(_0x57bd74,_0x17fac7){return _0x57bd74(_0x17fac7);},'hkSpP':_0x11b85e[_0x2d87be(0x15f)]},_0x19f56e=()=>{const _0x59f692=_0x2d87be;_0x478a2b[_0x59f692(0xed)](),_0x478a2b[_0x59f692(0x172)]();},_0x52c587=_0x11b85e['xwsmZ'](setTimeout,()=>{const _0x13d4bd=_0x2d87be;_0x19f56e(),_0x376918['uOOCv'](_0x2f8b44,new OAuthTimeoutError(_0x376918[_0x13d4bd(0x11c)]));},0x1d4c0),_0x478a2b=createServer((_0x1a22af,_0x3d2250)=>{const _0x1824ed=_0x2d87be,_0x49022a=new URL(_0x1a22af[_0x1824ed(0xdb)]??'/','http://localhost:'+CALLBACK_PORT);if(_0x376918['bsGFh'](_0x49022a[_0x1824ed(0x155)],_0x1824ed(0x12f))){_0x3d2250[_0x1824ed(0x140)](0x194),_0x3d2250[_0x1824ed(0x104)]('Not\x20found');return;}const _0x512726=_0x49022a['searchParams'][_0x1824ed(0x15d)](_0x376918['ZvSUe']),_0x419e14=_0x49022a['searchParams'][_0x1824ed(0x15d)](_0x1824ed(0x164)),_0x24ecef=_0x49022a[_0x1824ed(0xe1)][_0x1824ed(0x15d)](_0x376918[_0x1824ed(0xdc)]);if(_0x24ecef){const _0x419373=_0x49022a[_0x1824ed(0xe1)][_0x1824ed(0x15d)](_0x376918['zkGQH'])??_0x24ecef;_0x3d2250[_0x1824ed(0x140)](0xc8,{'Content-Type':_0x376918['vlEGZ']}),_0x3d2250[_0x1824ed(0x104)]('<html><body><h2>Authentication\x20failed</h2><p>'+_0x419373+_0x1824ed(0xf4)),clearTimeout(_0x52c587),_0x19f56e(),_0x376918[_0x1824ed(0xe5)](_0x2f8b44,new Error(_0x1824ed(0xfb)+_0x419373));return;}if(!_0x512726||_0x376918[_0x1824ed(0x14c)](_0x419e14,_0x4d7b1b)){_0x3d2250[_0x1824ed(0x140)](0x190,{'Content-Type':_0x1824ed(0xee)}),_0x3d2250[_0x1824ed(0x104)](_0x376918['hkSpP']);return;}_0x3d2250['writeHead'](0xc8,{'Content-Type':_0x1824ed(0xee)}),_0x3d2250[_0x1824ed(0x104)](_0x1824ed(0x12a)),clearTimeout(_0x52c587),_0x19f56e(),_0x43a443(_0x512726);});_0x478a2b['listen'](CALLBACK_PORT,_0x11b85e['GUqzT']);});}async function openBrowser(_0x2adffc){const _0x429aa5=_0x2bf3,_0x223cf4={'wsDRj':'darwin','OXWCe':'open','dnHLM':_0x429aa5(0x16b)},_0x4ed090=process[_0x429aa5(0x15e)]===_0x223cf4[_0x429aa5(0x115)]?_0x223cf4[_0x429aa5(0x159)]:process['platform']===_0x223cf4['dnHLM']?_0x429aa5(0xff):'xdg-open';exec(_0x4ed090+'\x20\x22'+_0x2adffc+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x3798bd=_0x2bf3,_0x3eec8e={'tUUGO':function(_0x10235c,_0x3ed142,_0xd0b43f){return _0x10235c(_0x3ed142,_0xd0b43f);},'WGGBD':function(_0x59a7cf,_0x359c47){return _0x59a7cf!==_0x359c47;},'UfZIB':function(_0xfa0de8,_0x1d32b8){return _0xfa0de8>_0x1d32b8;}};try{const _0x37fee9=JSON['parse'](await _0x3eec8e[_0x3798bd(0x153)](readFile,TOKEN_CACHE_PATH,'utf-8'));if(_0x37fee9[_0x3798bd(0x116)]&&_0x3eec8e['WGGBD'](_0x37fee9['origin'],currentOrigin))return null;if(_0x37fee9[_0x3798bd(0x136)]&&_0x3eec8e[_0x3798bd(0x100)](Date['now'](),_0x37fee9['expiresAt']))return null;return _0x37fee9[_0x3798bd(0xf1)]??null;}catch{return null;}}async function saveCachedToken(_0x4a4ca3,_0x3aa207,_0x415dbf){const _0x4b4be4=_0x2bf3,_0xff947b={'WLeMt':function(_0x26e43a,_0xa120c){return _0x26e43a*_0xa120c;},'cvTZS':function(_0x5d4651,_0x3212c5,_0x1b9c41){return _0x5d4651(_0x3212c5,_0x1b9c41);},'TpuBj':function(_0xe24e02,_0x3a0554,_0x74ea12){return _0xe24e02(_0x3a0554,_0x74ea12);},'bpJzN':function(_0x526a2d){return _0x526a2d();},'RQRYK':function(_0x20f0b6,_0x5c4fbe,_0x2ff388,_0x4224cc){return _0x20f0b6(_0x5c4fbe,_0x2ff388,_0x4224cc);}},_0x3c0269=await loadCachedData(),_0x442b04={..._0x3c0269,'origin':currentOrigin,'accessToken':_0x4a4ca3,'refreshToken':_0x3aa207??_0x3c0269?.['refreshToken'],'expiresAt':_0x415dbf?Date[_0x4b4be4(0xe4)]()+_0xff947b['WLeMt'](_0x415dbf,0x3e8):undefined};await _0xff947b[_0x4b4be4(0x150)](mkdir,_0xff947b[_0x4b4be4(0x167)](join,_0xff947b[_0x4b4be4(0x13d)](homedir),'.ranger'),{'recursive':!![]}),await _0xff947b['RQRYK'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x442b04),{'mode':0x180});}async function loadCachedClient(){const _0x3e00e4=_0x2bf3,_0x1ad431={'OvwOt':function(_0x357212){return _0x357212();},'poPRM':function(_0x4474db,_0x4a1073){return _0x4474db!==_0x4a1073;}},_0x236c2d=await _0x1ad431['OvwOt'](loadCachedData);if(_0x236c2d?.[_0x3e00e4(0x116)]&&_0x1ad431[_0x3e00e4(0x101)](_0x236c2d['origin'],currentOrigin))return null;return _0x236c2d?.[_0x3e00e4(0x12e)]?{'clientId':_0x236c2d['clientId'],'clientSecret':_0x236c2d[_0x3e00e4(0x122)]}:null;}async function clearCachedClient(){const _0x34113d=_0x2bf3,_0x4b8880={'RSDKk':function(_0x1862ce){return _0x1862ce();},'RYTzu':function(_0x4c15f3,_0xa542ff,_0x339c3e,_0x5eefc3){return _0x4c15f3(_0xa542ff,_0x339c3e,_0x5eefc3);}},_0x2b3f6d=await _0x4b8880['RSDKk'](loadCachedData);if(!_0x2b3f6d)return;const {clientId:_0x33863c,clientSecret:_0x2e3502,..._0x342053}=_0x2b3f6d;await _0x4b8880['RYTzu'](writeFile,TOKEN_CACHE_PATH,JSON[_0x34113d(0x151)](_0x342053),{'mode':0x180});}async function saveCachedClient(_0x583a1c,_0x21096f){const _0x4fe958=_0x2bf3,_0x50e5de={'hAnHQ':function(_0x3b98ae){return _0x3b98ae();},'RrooD':function(_0x896c97){return _0x896c97();}},_0x398d70=await _0x50e5de[_0x4fe958(0xfd)](loadCachedData),_0x4cee1a={..._0x398d70,'origin':currentOrigin,'accessToken':_0x398d70?.['accessToken']??'','clientId':_0x583a1c,'clientSecret':_0x21096f};await mkdir(join(_0x50e5de[_0x4fe958(0x173)](homedir),_0x4fe958(0xf2)),{'recursive':!![]}),await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0x4cee1a),{'mode':0x180});}async function loadCachedData(){const _0x1c2435={'lNIoX':function(_0x3e7146,_0x3a83cf,_0x4e82c3){return _0x3e7146(_0x3a83cf,_0x4e82c3);},'zFnGw':'utf-8'};try{return JSON['parse'](await _0x1c2435['lNIoX'](readFile,TOKEN_CACHE_PATH,_0x1c2435['zFnGw']));}catch{return null;}}async function parseResponse(_0x373a48){const _0x2f3ee6=_0x2bf3,_0x1781a5={'VVGFS':_0x2f3ee6(0x16f),'pRCGc':'data:'},_0x54d80a=_0x373a48[_0x2f3ee6(0xf8)][_0x2f3ee6(0x15d)](_0x2f3ee6(0x16c))??'';if(_0x54d80a[_0x2f3ee6(0x109)](_0x1781a5[_0x2f3ee6(0xe7)])){const _0x122a90=await _0x373a48[_0x2f3ee6(0x143)]();for(const _0x342254 of _0x122a90[_0x2f3ee6(0xde)]('\x0a')){const _0xa92a0a=_0x342254[_0x2f3ee6(0x15a)]();if(_0xa92a0a['startsWith']('data:')){const _0x5d49a4=_0xa92a0a[_0x2f3ee6(0x177)](_0x1781a5[_0x2f3ee6(0x110)][_0x2f3ee6(0xdf)])['trim']();if(!_0x5d49a4)continue;try{const _0x5d5ccc=JSON[_0x2f3ee6(0xf9)](_0x5d49a4);if(_0x5d5ccc['id']!==undefined||_0x5d5ccc['error'])return _0x5d5ccc;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x373a48['json']();}function extractToken(_0x506863){const _0x295515=_0x2bf3,_0x2022be={'oXJCW':function(_0x8062f3,_0xa34404){return _0x8062f3===_0xa34404;},'bGEEg':function(_0x33a897,_0x18a18c){return _0x33a897===_0x18a18c;},'SxURg':'string'};if(!_0x506863)return null;const _0x216bca=_0x506863[_0x295515(0x123)];if(_0x216bca?.[_0x295515(0x125)]&&_0x2022be[_0x295515(0x102)](typeof _0x216bca[_0x295515(0x125)],_0x295515(0xf0)))return _0x216bca[_0x295515(0x125)];if(_0x506863['isError']){const _0x28130c=_0x506863['content'];throw new Error('Server\x20returned\x20error:\x20'+(_0x28130c?.[0x0]?.[_0x295515(0x143)]??_0x295515(0x10c)));}const _0x39f8ea=_0x506863[_0x295515(0x10a)];if(_0x39f8ea)for(const _0x1f1b26 of _0x39f8ea){if(_0x2022be['oXJCW'](_0x1f1b26['type'],_0x295515(0x143))&&_0x1f1b26['text']){try{const _0x32c1c7=JSON[_0x295515(0xf9)](_0x1f1b26[_0x295515(0x143)]);if(_0x2022be[_0x295515(0xec)](typeof _0x32c1c7?.[_0x295515(0x125)],_0x2022be['SxURg']))return _0x32c1c7['token'];}catch{}const _0x4cbab7=_0x1f1b26[_0x295515(0x143)][_0x295515(0x133)](/(rngr_[A-Za-z0-9_-]+)/);if(_0x4cbab7)return _0x4cbab7[0x1];}}return null;}
1
+ const _0x21aab3=_0x2e24;(function(_0x59c40b,_0x1bc593){const _0x3b0b47=_0x2e24,_0x3fbd73=_0x59c40b();while(!![]){try{const _0x2aeb87=-parseInt(_0x3b0b47(0x12a))/0x1+parseInt(_0x3b0b47(0x11a))/0x2+parseInt(_0x3b0b47(0x131))/0x3*(parseInt(_0x3b0b47(0x100))/0x4)+-parseInt(_0x3b0b47(0x143))/0x5+parseInt(_0x3b0b47(0x15f))/0x6*(-parseInt(_0x3b0b47(0x12c))/0x7)+parseInt(_0x3b0b47(0x17b))/0x8*(-parseInt(_0x3b0b47(0x186))/0x9)+parseInt(_0x3b0b47(0x14f))/0xa*(parseInt(_0x3b0b47(0xfc))/0xb);if(_0x2aeb87===_0x1bc593)break;else _0x3fbd73['push'](_0x3fbd73['shift']());}catch(_0x47c308){_0x3fbd73['push'](_0x3fbd73['shift']());}}}(_0x42ae,0xade90));import{mkdir,writeFile,readFile}from'fs/promises';import{join}from'path';function _0x2e24(_0x59a764,_0x3ed83b){_0x59a764=_0x59a764-0xfa;const _0x42ae21=_0x42ae();let _0x2e24a9=_0x42ae21[_0x59a764];return _0x2e24a9;}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(),_0x21aab3(0x142),_0x21aab3(0x128)),AUTH_ORIGIN_PATH=join(homedir(),'.ranger',_0x21aab3(0x139));export async function getMcpAuthOrigin(){const _0x1df4a5=_0x21aab3,_0x3fe4a0={'fDLoe':function(_0x1e32c9,_0x343eef){return _0x1e32c9||_0x343eef;}};try{const _0x8f0643=(await readFile(AUTH_ORIGIN_PATH,'utf-8'))[_0x1df4a5(0x15b)]();return _0x3fe4a0[_0x1df4a5(0x136)](_0x8f0643,null);}catch{return null;}}export async function mcpBootstrap(){const _0x462569=_0x21aab3,_0x5a31c9={'ycbMc':function(_0x26adba,_0xec7275){return _0x26adba(_0xec7275);},'MzZbi':'proxied','lcBIh':function(_0x203c00){return _0x203c00();},'vxVTR':function(_0x54c22e,_0x5b6a90){return _0x54c22e+_0x5b6a90;}},_0x5221ad=getMcpAuthUrl();currentOrigin=_0x5221ad;const _0x21e9ee=process['stdout'][_0x462569(0x137)]??![];console[_0x462569(0x18b)](_0x462569(0xfd)+_0x5221ad+'\x0a');const _0x51ebe5=await _0x5a31c9['ycbMc'](tryUnauthenticated,_0x5221ad);let _0x5578ff=null;if(_0x51ebe5===_0x5a31c9[_0x462569(0xfa)])_0x5578ff='';else{_0x5578ff=await _0x5a31c9['lcBIh'](loadCachedToken);if(!_0x5578ff){if(!_0x21e9ee)throw new Error(_0x5a31c9['vxVTR'](_0x462569(0x161),_0x462569(0x16c)));_0x5578ff=await oauthFlow(_0x5221ad);}}await callGetCliToken(_0x5221ad,_0x5578ff);}async function tryUnauthenticated(_0x355a77){const _0x60650b=_0x21aab3,_0x50fa54={'ANEBG':function(_0x92d5fb,_0x5c99fb,_0x30d097){return _0x92d5fb(_0x5c99fb,_0x30d097);},'IvtJf':_0x60650b(0x149),'fSPej':'application/json','iltyH':'initialize','alHbU':_0x60650b(0x184),'BrzdZ':_0x60650b(0x16f),'DWRcu':function(_0x3bad1d,_0x546606){return _0x3bad1d===_0x546606;}},_0x34e615=await _0x50fa54[_0x60650b(0x116)](fetch,_0x355a77,{'method':_0x50fa54['IvtJf'],'headers':{'Content-Type':_0x50fa54[_0x60650b(0x152)],'Accept':_0x60650b(0x179)},'body':JSON['stringify']({'jsonrpc':'2.0','id':0x1,'method':_0x50fa54['iltyH'],'params':{'protocolVersion':_0x60650b(0x166),'capabilities':{},'clientInfo':{'name':_0x50fa54['alHbU'],'version':'1.0.0'}}})});if(_0x34e615['ok'])return await _0x34e615['text'](),_0x50fa54['BrzdZ'];if(_0x50fa54[_0x60650b(0x14a)](_0x34e615[_0x60650b(0x13c)],0x191))return await _0x34e615[_0x60650b(0x121)](),_0x60650b(0xfe);const _0x190f19=await _0x34e615[_0x60650b(0x121)]();throw new Error(_0x60650b(0x109)+_0x34e615[_0x60650b(0x13c)]+':\x20'+_0x190f19);}class OAuthTimeoutError extends Error{constructor(_0x3a98f7){const _0x419a96=_0x21aab3,_0x126c79={'yledk':_0x419a96(0x130)};super(_0x3a98f7),this['name']=_0x126c79['yledk'];}}async function oauthFlow(_0x58dce7){const _0x50166f=_0x21aab3,_0x177808={'goDpp':function(_0x1cf660,_0x10a749){return _0x1cf660 instanceof _0x10a749;},'Jzrub':_0x50166f(0x14c),'ieaTk':function(_0x3e9224,_0x1af3a6){return _0x3e9224(_0x1af3a6);}};try{return await oauthFlowAttempt(_0x58dce7);}catch(_0x4b5495){if(_0x177808['goDpp'](_0x4b5495,OAuthTimeoutError)&&await loadCachedClient())return console['log'](_0x177808['Jzrub']),await clearCachedClient(),await _0x177808[_0x50166f(0x169)](oauthFlowAttempt,_0x58dce7);throw _0x4b5495;}}async function oauthFlowAttempt(_0xf102ce){const _0x2f9d7b=_0x21aab3,_0x432014={'kwqXz':'Discovering\x20authorization\x20server...','wzyev':function(_0x45eb0e,_0xffefc6){return _0x45eb0e(_0xffefc6);},'nERkt':function(_0x20505d){return _0x20505d();},'USRJB':function(_0x3326e6,_0x46bdcd,_0x9db4b2){return _0x3326e6(_0x46bdcd,_0x9db4b2);},'LUhvR':_0x2f9d7b(0x154),'PfcGF':'Ranger\x20CLI','LByyp':_0x2f9d7b(0x164),'VvUab':_0x2f9d7b(0x174),'ljjwS':'base64url','ahFkd':'redirect_uri','zkwPU':_0x2f9d7b(0x151),'jtAXm':_0x2f9d7b(0x150),'KxwUP':'resource','dKVum':_0x2f9d7b(0x11f),'nhwMY':function(_0x382fa9,_0x143c15){return _0x382fa9(_0x143c15);},'ExTFC':'authorization_code','bpPIO':'client_secret','NeJsB':function(_0x2ab6fc,_0x95c3b5,_0x36ef6c){return _0x2ab6fc(_0x95c3b5,_0x36ef6c);},'qJJht':function(_0x119a9a,_0x3150d3,_0x3a6c29,_0x5c42f1){return _0x119a9a(_0x3150d3,_0x3a6c29,_0x5c42f1);}},_0x405b7d=_0xf102ce['replace'](/\/mcp$/,'');process[_0x2f9d7b(0x14e)]['write'](_0x432014['kwqXz']);const _0x52544a=await _0x432014['wzyev'](fetch,_0x405b7d+'/.well-known/oauth-protected-resource');if(!_0x52544a['ok'])throw new Error(_0x2f9d7b(0x187));const _0x599fbb=await _0x52544a[_0x2f9d7b(0x129)](),_0x16fe4b=_0x599fbb[_0x2f9d7b(0x125)]?.[0x0];if(!_0x16fe4b)throw new Error(_0x2f9d7b(0x177));console[_0x2f9d7b(0x18b)]('\x20'+_0x16fe4b);const _0x34251b=await fetchAuthServerMetadata(_0x16fe4b);let _0x22a69,_0x2a346f;const _0x505614=await _0x432014[_0x2f9d7b(0x133)](loadCachedClient);if(_0x505614)_0x22a69=_0x505614['clientId'],_0x2a346f=_0x505614['clientSecret'];else{if(_0x34251b[_0x2f9d7b(0x110)]){process[_0x2f9d7b(0x14e)]['write'](_0x2f9d7b(0x163));const _0x1b20ca=await _0x432014['USRJB'](fetch,_0x34251b['registration_endpoint'],{'method':'POST','headers':{'Content-Type':_0x432014['LUhvR']},'body':JSON[_0x2f9d7b(0x141)]({'client_name':_0x432014[_0x2f9d7b(0x159)],'redirect_uris':['http://localhost:'+CALLBACK_PORT+_0x2f9d7b(0x11e)],'grant_types':['authorization_code','refresh_token'],'response_types':[_0x2f9d7b(0x126)],'token_endpoint_auth_method':_0x432014[_0x2f9d7b(0x13d)]})});if(!_0x1b20ca['ok']){const _0x1ec779=await _0x1b20ca[_0x2f9d7b(0x121)]();throw new Error('Client\x20registration\x20failed:\x20'+_0x1ec779);}const _0x5ba1=await _0x1b20ca['json']();_0x22a69=_0x5ba1[_0x2f9d7b(0x12d)],_0x2a346f=_0x5ba1['client_secret'],await saveCachedClient(_0x22a69,_0x2a346f),console[_0x2f9d7b(0x18b)](_0x432014['VvUab']);}else throw new Error(_0x2f9d7b(0xff));}const _0x4234b3=_0x432014['wzyev'](randomBytes,0x20)['toString'](_0x432014['ljjwS']),_0x5aeb6f=createHash(_0x2f9d7b(0x178))[_0x2f9d7b(0x15a)](_0x4234b3)['digest'](_0x432014[_0x2f9d7b(0x123)]),_0x42ef6f=randomBytes(0x10)['toString'](_0x2f9d7b(0x127)),_0x517ff6=new URL(_0x34251b['authorization_endpoint']);_0x517ff6[_0x2f9d7b(0x107)]['set']('response_type',_0x2f9d7b(0x126)),_0x517ff6[_0x2f9d7b(0x107)][_0x2f9d7b(0x17d)](_0x2f9d7b(0x12d),_0x22a69),_0x517ff6['searchParams'][_0x2f9d7b(0x17d)](_0x432014[_0x2f9d7b(0x134)],'http://localhost:'+CALLBACK_PORT+_0x2f9d7b(0x11e)),_0x517ff6[_0x2f9d7b(0x107)]['set']('code_challenge',_0x5aeb6f),_0x517ff6[_0x2f9d7b(0x107)][_0x2f9d7b(0x17d)](_0x432014[_0x2f9d7b(0x162)],_0x432014['jtAXm']),_0x517ff6[_0x2f9d7b(0x107)][_0x2f9d7b(0x17d)]('state',_0x42ef6f);_0x599fbb['resource']&&_0x517ff6['searchParams']['set'](_0x432014[_0x2f9d7b(0x157)],_0x599fbb['resource']);console['log'](_0x432014['dKVum']),console['log'](_0x2f9d7b(0x12f)+_0x517ff6[_0x2f9d7b(0x16a)]()+'\x0a'),await _0x432014[_0x2f9d7b(0x15c)](openBrowser,_0x517ff6[_0x2f9d7b(0x16a)]());const _0x2733f4=await waitForCallback(_0x42ef6f);process['stdout']['write'](_0x2f9d7b(0x117));const _0x3cb8df=new URLSearchParams({'grant_type':_0x432014['ExTFC'],'code':_0x2733f4,'redirect_uri':'http://localhost:'+CALLBACK_PORT+'/callback','client_id':_0x22a69,'code_verifier':_0x4234b3});_0x2a346f&&_0x3cb8df['set'](_0x432014['bpPIO'],_0x2a346f);_0x599fbb['resource']&&_0x3cb8df[_0x2f9d7b(0x17d)](_0x2f9d7b(0x16d),_0x599fbb[_0x2f9d7b(0x16d)]);const _0x14ac94=await _0x432014['NeJsB'](fetch,_0x34251b['token_endpoint'],{'method':_0x2f9d7b(0x149),'headers':{'Content-Type':_0x2f9d7b(0x153)},'body':_0x3cb8df});if(!_0x14ac94['ok']){const _0x2c3fc3=await _0x14ac94['text']();throw new Error('Token\x20exchange\x20failed:\x20'+_0x2c3fc3);}const _0x5a2ec1=await _0x14ac94[_0x2f9d7b(0x129)]();return console['log'](_0x432014['VvUab']),await _0x432014[_0x2f9d7b(0x185)](saveCachedToken,_0x5a2ec1[_0x2f9d7b(0x173)],_0x5a2ec1[_0x2f9d7b(0x146)],_0x5a2ec1[_0x2f9d7b(0x147)]),_0x5a2ec1['access_token'];}async function callGetCliToken(_0x2b97d2,_0x32378b){const _0x3f4599=_0x21aab3,_0x14cb38={'ZViMV':_0x3f4599(0x149),'vzsUS':'application/json','vtNwq':_0x3f4599(0x179),'WvWbt':function(_0x5c90b8,_0x3a099b){return _0x5c90b8(_0x3a099b);},'AOvKf':'2.0','sJZSf':_0x3f4599(0x18c),'yKHNA':'2025-03-26','AYSPX':function(_0x5382fb,_0x538edf,_0x1f3eb4){return _0x5382fb(_0x538edf,_0x1f3eb4);},'VxkZt':'notifications/initialized','DRcsn':'Requesting\x20CLI\x20token...','WvyPI':function(_0x5f1800,_0x182e10){return _0x5f1800(_0x182e10);},'Nvdkt':'get_cli_token','OKOOD':function(_0x138745,_0x2c61d2){return _0x138745(_0x2c61d2);},'ITZla':_0x3f4599(0x155),'UZwYl':function(_0x12cc3a,_0x574348,_0x508706){return _0x12cc3a(_0x574348,_0x508706);},'LVNGs':function(_0x2cac3c,_0x4c1e9d,_0x5cecd0,_0x159903){return _0x2cac3c(_0x4c1e9d,_0x5cecd0,_0x159903);},'HCKhu':_0x3f4599(0xfb)},_0x1554fe={'Content-Type':_0x14cb38['vzsUS'],'Accept':_0x14cb38[_0x3f4599(0x105)]};_0x32378b&&(_0x1554fe[_0x3f4599(0x10b)]=_0x3f4599(0x138)+_0x32378b);const _0x27da6e=async _0x34cd20=>{const _0xb871b8=_0x3f4599,_0x18cbc0=await fetch(_0x2b97d2,{'method':_0x14cb38[_0xb871b8(0x113)],'headers':_0x1554fe,'body':JSON['stringify'](_0x34cd20)});if(!_0x18cbc0['ok']){const _0x502109=await _0x18cbc0[_0xb871b8(0x121)]();throw new Error(_0xb871b8(0x144)+_0x18cbc0['status']+':\x20'+_0x502109);}return parseResponse(_0x18cbc0);};process[_0x3f4599(0x14e)]['write'](_0x3f4599(0x189));const _0x495f13=await _0x14cb38['WvWbt'](_0x27da6e,{'jsonrpc':_0x14cb38[_0x3f4599(0x10a)],'id':0x1,'method':_0x14cb38['sJZSf'],'params':{'protocolVersion':_0x14cb38['yKHNA'],'capabilities':{},'clientInfo':{'name':'ranger-cli','version':_0x3f4599(0x165)}}});if(_0x495f13['error'])throw new Error('MCP\x20initialize\x20failed:\x20'+(_0x495f13['error'][_0x3f4599(0x16b)]??JSON[_0x3f4599(0x141)](_0x495f13[_0x3f4599(0x188)])));console[_0x3f4599(0x18b)](_0x3f4599(0x174)),await _0x14cb38['AYSPX'](fetch,_0x2b97d2,{'method':_0x3f4599(0x149),'headers':_0x1554fe,'body':JSON[_0x3f4599(0x141)]({'jsonrpc':'2.0','method':_0x14cb38['VxkZt']})})['then'](_0x566a75=>_0x566a75['text']()),process['stdout']['write'](_0x14cb38['DRcsn']);const _0x30ec74=await _0x14cb38[_0x3f4599(0x14b)](_0x27da6e,{'jsonrpc':_0x14cb38['AOvKf'],'id':0x2,'method':_0x3f4599(0x13f),'params':{'name':_0x14cb38['Nvdkt'],'arguments':{}}});if(_0x30ec74['error'])throw new Error('get_cli_token\x20failed:\x20'+(_0x30ec74[_0x3f4599(0x188)]['message']??JSON['stringify'](_0x30ec74['error'])));console[_0x3f4599(0x18b)]('\x20done');const _0xeeb545=_0x14cb38[_0x3f4599(0x132)](extractToken,_0x30ec74[_0x3f4599(0x171)]);if(!_0xeeb545){console[_0x3f4599(0x188)](_0x3f4599(0x17c)),console['error'](JSON['stringify'](_0x30ec74['result'],null,0x2));throw new Error(_0x14cb38[_0x3f4599(0x172)]);}const _0x2a91b4=_0x14cb38[_0x3f4599(0x10d)](join,homedir(),_0x3f4599(0x142)),_0x521d8e=_0x14cb38['AYSPX'](join,_0x2a91b4,_0x3f4599(0x145));await mkdir(_0x2a91b4,{'recursive':!![]}),await _0x14cb38['LVNGs'](writeFile,_0x521d8e,_0xeeb545,{'mode':0x180}),await writeFile(join(_0x2a91b4,'auth-origin.txt'),_0x2b97d2,{'mode':0x180}),console[_0x3f4599(0x18b)](_0x3f4599(0x176)+_0x521d8e),console[_0x3f4599(0x18b)](_0x14cb38['HCKhu']);}async function fetchAuthServerMetadata(_0x5bf344){const _0x57dc93=_0x21aab3,_0x1a6760=_0x5bf344+_0x57dc93(0x10c),_0x344a06=await fetch(_0x1a6760);if(!_0x344a06['ok'])throw new Error('Could\x20not\x20fetch\x20auth\x20server\x20metadata\x20from\x20'+_0x1a6760+':\x20'+_0x344a06['status']);return _0x344a06[_0x57dc93(0x129)]();}function waitForCallback(_0x5e8d9d){const _0x9fa653=_0x21aab3,_0xf83abe={'nLoin':function(_0x4bab97,_0x1b0bc4){return _0x4bab97!==_0x1b0bc4;},'LvShk':'error','NfqnY':function(_0x573a9b,_0x4aa071){return _0x573a9b(_0x4aa071);},'iPOMW':_0x9fa653(0x13b),'KsRoj':_0x9fa653(0x112),'OKdlw':'<html><body><h2>Authenticated!</h2><p>You\x20can\x20close\x20this\x20window\x20and\x20return\x20to\x20the\x20terminal.</p></body></html>','XeAge':'127.0.0.1'};return new Promise((_0x598a0d,_0x35d790)=>{const _0x55c716=_0x9fa653,_0x379316={'VilJo':function(_0x5ee373){return _0x5ee373();},'jVQVs':function(_0x5474e5,_0x1fcb05){const _0x28894b=_0x2e24;return _0xf83abe[_0x28894b(0x168)](_0x5474e5,_0x1fcb05);},'tWDHX':_0x55c716(0x101),'BbcRj':_0xf83abe['LvShk'],'VHaxQ':function(_0x57c456,_0x461d60){return _0xf83abe['NfqnY'](_0x57c456,_0x461d60);},'ndDWE':_0xf83abe[_0x55c716(0x122)],'zAqwj':_0xf83abe['KsRoj'],'fbwsJ':_0xf83abe['OKdlw']},_0x5cc4be=()=>{const _0x228579=_0x55c716;_0x1aeb13['closeAllConnections'](),_0x1aeb13[_0x228579(0x170)]();},_0x93f619=setTimeout(()=>{_0x379316['VilJo'](_0x5cc4be),_0x35d790(new OAuthTimeoutError('OAuth\x20callback\x20timed\x20out\x20after\x202\x20minutes'));},0x1d4c0),_0x1aeb13=createServer((_0xe7847,_0x4d8f78)=>{const _0x56d68f=_0x55c716,_0x53511e=new URL(_0xe7847[_0x56d68f(0x182)]??'/',_0x56d68f(0x175)+CALLBACK_PORT);if(_0x379316['jVQVs'](_0x53511e['pathname'],_0x56d68f(0x11e))){_0x4d8f78['writeHead'](0x194),_0x4d8f78[_0x56d68f(0x160)](_0x56d68f(0x115));return;}const _0x5b645f=_0x53511e[_0x56d68f(0x107)][_0x56d68f(0x15e)](_0x56d68f(0x126)),_0x3d42b9=_0x53511e['searchParams'][_0x56d68f(0x15e)](_0x379316[_0x56d68f(0x158)]),_0x1d8317=_0x53511e['searchParams']['get'](_0x379316['BbcRj']);if(_0x1d8317){const _0x5de629=_0x53511e['searchParams']['get']('error_description')??_0x1d8317;_0x4d8f78['writeHead'](0xc8,{'Content-Type':_0x56d68f(0x13b)}),_0x4d8f78['end'](_0x56d68f(0x13e)+_0x5de629+'</p><p>You\x20can\x20close\x20this\x20window.</p></body></html>'),clearTimeout(_0x93f619),_0x379316[_0x56d68f(0x148)](_0x5cc4be),_0x379316['VHaxQ'](_0x35d790,new Error('OAuth\x20error:\x20'+_0x5de629));return;}if(!_0x5b645f||_0x3d42b9!==_0x5e8d9d){_0x4d8f78['writeHead'](0x190,{'Content-Type':_0x379316[_0x56d68f(0x17a)]}),_0x4d8f78['end'](_0x379316[_0x56d68f(0x10e)]);return;}_0x4d8f78[_0x56d68f(0x156)](0xc8,{'Content-Type':_0x56d68f(0x13b)}),_0x4d8f78[_0x56d68f(0x160)](_0x379316[_0x56d68f(0x10f)]),_0x379316['VHaxQ'](clearTimeout,_0x93f619),_0x5cc4be(),_0x598a0d(_0x5b645f);});_0x1aeb13['listen'](CALLBACK_PORT,_0xf83abe[_0x55c716(0x111)]);});}async function openBrowser(_0x4fd159){const _0x4a96bc=_0x21aab3,_0x4b1918={'dVoBk':'darwin','MCiiP':function(_0x39ff46,_0x2a16b1){return _0x39ff46===_0x2a16b1;},'XCIpB':_0x4a96bc(0x167),'yIKGp':_0x4a96bc(0x120),'jJNKY':_0x4a96bc(0x183)},_0x4efc89=process[_0x4a96bc(0x180)]===_0x4b1918[_0x4a96bc(0x17f)]?'open':_0x4b1918['MCiiP'](process['platform'],_0x4b1918['XCIpB'])?_0x4b1918['yIKGp']:_0x4b1918['jJNKY'];exec(_0x4efc89+'\x20\x22'+_0x4fd159+'\x22');}let currentOrigin='';async function loadCachedToken(){const _0x258966=_0x21aab3,_0x20979d={'VcXOm':function(_0x540183,_0x10b1e2,_0x402e7f){return _0x540183(_0x10b1e2,_0x402e7f);},'dliJy':function(_0x2b0c9c,_0x38fbc6){return _0x2b0c9c>_0x38fbc6;}};try{const _0x14d685=JSON['parse'](await _0x20979d[_0x258966(0x12b)](readFile,TOKEN_CACHE_PATH,'utf-8'));if(_0x14d685['origin']&&_0x14d685[_0x258966(0x124)]!==currentOrigin)return null;if(_0x14d685['expiresAt']&&_0x20979d[_0x258966(0x181)](Date[_0x258966(0x14d)](),_0x14d685[_0x258966(0x102)]))return null;return _0x14d685['accessToken']??null;}catch{return null;}}function _0x42ae(){const _0x132e65=['start','text','iPOMW','ljjwS','origin','authorization_servers','code','hex','mcp-oauth-tokens.json','json','996488SqjnIT','VcXOm','7EtHQij','client_id','nNZyY','If\x20the\x20browser\x20doesn\x27t\x20open,\x20visit:\x0a','OAuthTimeoutError','3ogFsjh','OKOOD','nERkt','ahFkd','split','fDLoe','isTTY','Bearer\x20','auth-origin.txt','string','text/html','status','LByyp','<html><body><h2>Authentication\x20failed</h2><p>','tools/call','content','stringify','.ranger','432135NCycww','HTTP\x20','refresh.txt','refresh_token','expires_in','VilJo','POST','DWRcu','WvyPI','\x0aCached\x20OAuth\x20client\x20may\x20be\x20stale\x20—\x20clearing\x20and\x20retrying...\x0a','now','stdout','20142130jMZUYR','S256','code_challenge_method','fSPej','application/x-www-form-urlencoded','application/json','Could\x20not\x20extract\x20token\x20from\x20MCP\x20response','writeHead','KxwUP','tWDHX','PfcGF','update','trim','nhwMY','accessToken','get','7376988EgtLem','end','MCP\x20server\x20requires\x20authentication\x20but\x20running\x20in\x20non-interactive\x20mode.\x0a','zkwPU','Registering\x20OAuth\x20client...','none','1.0.0','2025-03-26','win32','nLoin','ieaTk','toString','message','Run\x20`ranger\x20setup\x20--mcp-bootstrap`\x20interactively\x20first.','resource','WWfTh','proxied','close','result','ITZla','access_token','\x20done','http://localhost:','\x0aToken\x20written\x20to\x20','No\x20authorization_servers\x20in\x20protected\x20resource\x20metadata','sha256','application/json,\x20text/event-stream','ndDWE','8gdBqxn','\x0aUnexpected\x20response\x20structure:','set','slice','dVoBk','platform','dliJy','url','xdg-open','ranger-cli','qJJht','1627749bqRYfa','Could\x20not\x20fetch\x20protected\x20resource\x20metadata\x20from\x20MCP\x20server','error','Initializing\x20MCP\x20session...','type','log','initialize','MzZbi','Run\x20`ranger\x20status`\x20to\x20verify\x20authentication.\x0a','11WjgJBa','\x0aConnecting\x20to\x20MCP\x20auth\x20server:\x20','needs-oauth','Authorization\x20server\x20does\x20not\x20support\x20dynamic\x20client\x20registration\x20and\x20no\x20cached\x20client\x20found','881868HOvLEA','state','expiresAt','isError','utf-8','vtNwq','Tjyhr','searchParams','REkXM','MCP\x20server\x20returned\x20HTTP\x20','AOvKf','Authorization','/.well-known/oauth-authorization-server','UZwYl','zAqwj','fbwsJ','registration_endpoint','XeAge','<html><body><h2>Invalid\x20callback</h2><p>Missing\x20code\x20or\x20state\x20mismatch.</p></body></html>','ZViMV','token','Not\x20found','ANEBG','Exchanging\x20authorization\x20code...','refreshToken','content-type','1941860UqpQZY','parse','ZmYsy','YHQci','/callback','\x0aOpening\x20browser\x20for\x20authentication...'];_0x42ae=function(){return _0x132e65;};return _0x42ae();}async function saveCachedToken(_0x520954,_0x2349a3,_0x2ea04d){const _0x20ecac=_0x21aab3,_0x14efcb={'tBrVr':function(_0x57b952,_0x5a598c){return _0x57b952*_0x5a598c;},'oTvoX':function(_0x3a73bd,_0x12e317,_0x26ba10){return _0x3a73bd(_0x12e317,_0x26ba10);},'YHQci':function(_0x4b0036){return _0x4b0036();},'VPfXu':function(_0x5d2560,_0x2edef1,_0x1cef39,_0x46f962){return _0x5d2560(_0x2edef1,_0x1cef39,_0x46f962);}},_0x284f6e=await loadCachedData(),_0xe623fe={..._0x284f6e,'origin':currentOrigin,'accessToken':_0x520954,'refreshToken':_0x2349a3??_0x284f6e?.[_0x20ecac(0x118)],'expiresAt':_0x2ea04d?Date['now']()+_0x14efcb['tBrVr'](_0x2ea04d,0x3e8):undefined};await mkdir(_0x14efcb['oTvoX'](join,_0x14efcb[_0x20ecac(0x11d)](homedir),_0x20ecac(0x142)),{'recursive':!![]}),await _0x14efcb['VPfXu'](writeFile,TOKEN_CACHE_PATH,JSON[_0x20ecac(0x141)](_0xe623fe),{'mode':0x180});}async function loadCachedClient(){const _0x3cb419=_0x21aab3,_0x11ceb8={'WWfTh':function(_0x4f8a9a){return _0x4f8a9a();},'nNZyY':function(_0x3ea3dc,_0x2279bb){return _0x3ea3dc!==_0x2279bb;}},_0x4d3dcc=await _0x11ceb8[_0x3cb419(0x16e)](loadCachedData);if(_0x4d3dcc?.[_0x3cb419(0x124)]&&_0x11ceb8[_0x3cb419(0x12e)](_0x4d3dcc['origin'],currentOrigin))return null;return _0x4d3dcc?.['clientId']?{'clientId':_0x4d3dcc['clientId'],'clientSecret':_0x4d3dcc['clientSecret']}:null;}async function clearCachedClient(){const _0x51feaa=await loadCachedData();if(!_0x51feaa)return;const {clientId:_0x1e6641,clientSecret:_0x5de1bd,..._0xc61518}=_0x51feaa;await writeFile(TOKEN_CACHE_PATH,JSON['stringify'](_0xc61518),{'mode':0x180});}async function saveCachedClient(_0x195698,_0x25fb96){const _0x276bf6=_0x21aab3,_0x272d52={'RyKhQ':function(_0x133896,_0x45bd5b,_0x92590c,_0x393b0e){return _0x133896(_0x45bd5b,_0x92590c,_0x393b0e);}},_0x553178=await loadCachedData(),_0x5138da={..._0x553178,'origin':currentOrigin,'accessToken':_0x553178?.[_0x276bf6(0x15d)]??'','clientId':_0x195698,'clientSecret':_0x25fb96};await mkdir(join(homedir(),_0x276bf6(0x142)),{'recursive':!![]}),await _0x272d52['RyKhQ'](writeFile,TOKEN_CACHE_PATH,JSON['stringify'](_0x5138da),{'mode':0x180});}async function loadCachedData(){const _0x214a4e=_0x21aab3;try{return JSON['parse'](await readFile(TOKEN_CACHE_PATH,_0x214a4e(0x104)));}catch{return null;}}async function parseResponse(_0x5bf8c4){const _0x1921ae=_0x21aab3,_0x559818={'Tjyhr':function(_0xee5bfa,_0x45706a){return _0xee5bfa!==_0x45706a;}},_0x592986=_0x5bf8c4['headers'][_0x1921ae(0x15e)](_0x1921ae(0x119))??'';if(_0x592986['includes']('text/event-stream')){const _0x42d78e=await _0x5bf8c4['text']();for(const _0x3b2e0b of _0x42d78e[_0x1921ae(0x135)]('\x0a')){const _0x5d5ab5=_0x3b2e0b[_0x1921ae(0x15b)]();if(_0x5d5ab5['startsWith']('data:')){const _0x21b8e1=_0x5d5ab5[_0x1921ae(0x17e)]('data:'['length'])['trim']();if(!_0x21b8e1)continue;try{const _0xc4aca=JSON['parse'](_0x21b8e1);if(_0x559818[_0x1921ae(0x106)](_0xc4aca['id'],undefined)||_0xc4aca['error'])return _0xc4aca;}catch{}}}throw new Error('No\x20JSON-RPC\x20response\x20found\x20in\x20SSE\x20stream');}return _0x5bf8c4['json']();}function extractToken(_0x241852){const _0x22100a=_0x21aab3,_0x9c98d7={'REkXM':function(_0x405a5b,_0x1dd3fc){return _0x405a5b===_0x1dd3fc;},'ZmYsy':'text','FEhTT':function(_0x4d8c5e,_0x265d0c){return _0x4d8c5e===_0x265d0c;}};if(!_0x241852)return null;const _0x1a0296=_0x241852['structuredContent'];if(_0x1a0296?.['token']&&_0x9c98d7[_0x22100a(0x108)](typeof _0x1a0296[_0x22100a(0x114)],'string'))return _0x1a0296['token'];if(_0x241852[_0x22100a(0x103)]){const _0x2f8d24=_0x241852[_0x22100a(0x140)];throw new Error('Server\x20returned\x20error:\x20'+(_0x2f8d24?.[0x0]?.[_0x22100a(0x121)]??'Unknown\x20error'));}const _0x4ff94c=_0x241852['content'];if(_0x4ff94c)for(const _0x194fc2 of _0x4ff94c){if(_0x194fc2[_0x22100a(0x18a)]===_0x9c98d7[_0x22100a(0x11c)]&&_0x194fc2[_0x22100a(0x121)]){try{const _0x5e2faf=JSON[_0x22100a(0x11b)](_0x194fc2[_0x22100a(0x121)]);if(_0x9c98d7['FEhTT'](typeof _0x5e2faf?.[_0x22100a(0x114)],_0x22100a(0x13a)))return _0x5e2faf['token'];}catch{}const _0x831873=_0x194fc2['text']['match'](/(rngr_[A-Za-z0-9_-]+)/);if(_0x831873)return _0x831873[0x1];}}return null;}
@@ -1 +1 @@
1
- function _0x4055(_0x512fb9,_0x1f7ffd){_0x512fb9=_0x512fb9-0x1de;var _0x17c567=_0x17c5();var _0x40553a=_0x17c567[_0x512fb9];return _0x40553a;}(function(_0x3b3f95,_0x5317e4){var _0x2456a9=_0x4055,_0x351347=_0x3b3f95();while(!![]){try{var _0x16915e=parseInt(_0x2456a9(0x1e4))/0x1*(parseInt(_0x2456a9(0x1ee))/0x2)+parseInt(_0x2456a9(0x1de))/0x3*(parseInt(_0x2456a9(0x1ec))/0x4)+parseInt(_0x2456a9(0x1e3))/0x5+parseInt(_0x2456a9(0x1eb))/0x6*(parseInt(_0x2456a9(0x1e9))/0x7)+parseInt(_0x2456a9(0x1ea))/0x8+-parseInt(_0x2456a9(0x1ed))/0x9+-parseInt(_0x2456a9(0x1df))/0xa*(parseInt(_0x2456a9(0x1e8))/0xb);if(_0x16915e===_0x5317e4)break;else _0x351347['push'](_0x351347['shift']());}catch(_0x36444e){_0x351347['push'](_0x351347['shift']());}}}(_0x17c5,0xb0652));export async function migrateProfile(_0x4734f1,_0x317ec0){var _0x25c22c=_0x4055,_0x4e16b0={'cWCLi':function(_0x50817c,_0x778ad2){return _0x50817c+_0x778ad2;},'wPaWh':function(_0x44affa,_0x41d608){return _0x44affa+_0x41d608;},'IuNTu':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','CROlF':'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','jbAIe':_0x25c22c(0x1e1),'kkMei':'\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','oaflr':'Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a'};console['error'](_0x4e16b0[_0x25c22c(0x1e7)](_0x4e16b0[_0x25c22c(0x1e2)](_0x4e16b0[_0x25c22c(0x1e2)](_0x4e16b0[_0x25c22c(0x1e0)],'\x0a')+_0x4e16b0[_0x25c22c(0x1e6)]+'\x20\x20ranger\x20profile\x20add\x20<name>\x0a'+'\x0a'+_0x4e16b0['jbAIe']+_0x4e16b0[_0x25c22c(0x1e5)],'\x0a'),_0x4e16b0['oaflr'])+'fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.'),process['exit'](0x1);}function _0x17c5(){var _0x4fb234=['wPaWh','3743435HZOvMG','42121fUmGGC','kkMei','CROlF','cWCLi','44YfaljT','7dmyczt','1190176FoPimi','258132hDmwwX','5725444nNgexc','8192187AaSAGa','62eEAplW','3WqKAMH','5112090PwMljG','IuNTu','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a'];_0x17c5=function(){return _0x4fb234;};return _0x17c5();}
1
+ function _0x38f8(){var _0xad8b3f=['Existing\x20sessions\x20in\x20your\x20old\x20<project>/.ranger/\x20dirs\x20still\x20work\x20as\x20a\x0a','500252slvJIa','3997007DReTtd','WXkNx','tWWcu','19938670wMJDJX','2096274SuXQpn','\x20\x20https://docs.ranger.net/main/concepts/profiles\x0a','829191vICrNV','4549970EOYusk','DaFUW','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a','6cKHLOg','2rnUifm','fallback;\x20you\x20can\x20delete\x20them\x20once\x20you\x20have\x20re-auth-ed.','oUvhe','303328xgTvul','279mKGOdM'];_0x38f8=function(){return _0xad8b3f;};return _0x38f8();}function _0x55a9(_0x1eb269,_0x38ccb5){_0x1eb269=_0x1eb269-0x106;var _0x38f840=_0x38f8();var _0x55a978=_0x38f840[_0x1eb269];return _0x55a978;}(function(_0x3c124d,_0x308c29){var _0x7f77da=_0x55a9,_0xd4ba23=_0x3c124d();while(!![]){try{var _0x14b4c0=parseInt(_0x7f77da(0x10a))/0x1+-parseInt(_0x7f77da(0x110))/0x2*(-parseInt(_0x7f77da(0x108))/0x3)+-parseInt(_0x7f77da(0x116))/0x4+-parseInt(_0x7f77da(0x10b))/0x5+parseInt(_0x7f77da(0x10f))/0x6*(-parseInt(_0x7f77da(0x117))/0x7)+-parseInt(_0x7f77da(0x113))/0x8*(parseInt(_0x7f77da(0x114))/0x9)+parseInt(_0x7f77da(0x107))/0xa;if(_0x14b4c0===_0x308c29)break;else _0xd4ba23['push'](_0xd4ba23['shift']());}catch(_0x2b60cf){_0xd4ba23['push'](_0xd4ba23['shift']());}}}(_0x38f8,0xb4c0a));export async function migrateProfile(_0x39ad99,_0x2ba022){var _0x2ea85e=_0x55a9,_0x305f6b={'oUvhe':function(_0x2c7678,_0x1faa88){return _0x2c7678+_0x1faa88;},'tWWcu':function(_0x4e714b,_0x3c0a33){return _0x4e714b+_0x3c0a33;},'Zhojr':function(_0x61a128,_0x12ff19){return _0x61a128+_0x12ff19;},'XEvHH':'ranger\x20profile\x20migrate\x20is\x20no\x20longer\x20supported.\x0a','jyWXj':_0x2ea85e(0x10e),'WXkNx':'For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','FOLSO':_0x2ea85e(0x109),'DaFUW':_0x2ea85e(0x111)};console['error'](_0x305f6b['oUvhe'](_0x305f6b[_0x2ea85e(0x106)](_0x305f6b[_0x2ea85e(0x112)](_0x305f6b['Zhojr'](_0x305f6b[_0x2ea85e(0x112)](_0x305f6b['XEvHH']+'\x0a',_0x305f6b['jyWXj']),_0x2ea85e(0x10d)),'\x0a'),_0x305f6b[_0x2ea85e(0x118)])+_0x305f6b['FOLSO'],'\x0a')+_0x2ea85e(0x115)+_0x305f6b[_0x2ea85e(0x10c)]),process['exit'](0x1);}
@@ -1 +1 @@
1
- (function(_0x5a4d3b,_0x19f1ba){const _0x5a8f21=_0x5d56,_0x38002b=_0x5a4d3b();while(!![]){try{const _0xdf7592=-parseInt(_0x5a8f21(0x17d))/0x1+-parseInt(_0x5a8f21(0x171))/0x2*(parseInt(_0x5a8f21(0x1a3))/0x3)+parseInt(_0x5a8f21(0x198))/0x4+parseInt(_0x5a8f21(0x19a))/0x5*(parseInt(_0x5a8f21(0x1a2))/0x6)+-parseInt(_0x5a8f21(0x16d))/0x7*(parseInt(_0x5a8f21(0x19f))/0x8)+-parseInt(_0x5a8f21(0x175))/0x9*(-parseInt(_0x5a8f21(0x170))/0xa)+parseInt(_0x5a8f21(0x190))/0xb;if(_0xdf7592===_0x19f1ba)break;else _0x38002b['push'](_0x38002b['shift']());}catch(_0x3c36cf){_0x38002b['push'](_0x38002b['shift']());}}}(_0x17f6,0x7c7af));import{join}from'path';import{existsSync}from'fs';import _0x52a815 from'inquirer';import{skillup}from'../skillup.js';import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';function _0x5d56(_0x3e1f70,_0x21ccd0){_0x3e1f70=_0x3e1f70-0x16b;const _0x17f694=_0x17f6();let _0x5d56ac=_0x17f694[_0x3e1f70];return _0x5d56ac;}function _0x17f6(){const _0xcc043b=['wZtGl','prompt','rTigW','pluginScope','push','list','UqIVm','⚠\x20Failed\x20to\x20enable\x20plugin:','nqoJr','ustUJ','ugHcx','22865007MrFliD','success','✓\x20Marketplace\x20already\x20added','hnpNv','log','qZEfp','✓\x20Ranger\x20skills\x20already\x20installed','output','812776AGrDOj','already\x20enabled','10785NcWDZX','iBAKS','error','User\x20(available\x20in\x20all\x20your\x20projects)','wantsSkillup','3652496wkSgXB','Where\x20should\x20the\x20plugin\x20be\x20installed?','GIrul','732PBtYrD','15003WkMkQA','project','ASTCl','JbZEt','\x20level)...\x0a','14PdAUDZ','HiebS','gRhxH','3770IUtpZq','214hZAMLX','ranger@trailhead','includes','iMHXv','3744ikdkFW','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','Project\x20(shared\x20with\x20team\x20via\x20git)','\x0aYou\x20can\x20install\x20manually\x20with:','JaSBZ','.claude','ohFdQ','cpKkS','743715EdRCAo','--scope','gAvha','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','oiOhi','EWXFf','user','✓\x20Claude\x20Code\x20plugin\x20enabled'];_0x17f6=function(){return _0xcc043b;};return _0x17f6();}import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x3a2cca){const _0x3e4bf0=_0x5d56,_0x81b83={'Ahngv':function(_0x57fe6c,_0x400ca3){return _0x57fe6c(_0x400ca3);},'ohFdQ':_0x3e4bf0(0x172),'qZEfp':function(_0x2e0857,_0x446f4a,_0x4a084c){return _0x2e0857(_0x446f4a,_0x4a084c);},'DDgxr':_0x3e4bf0(0x17a),'HiebS':_0x3e4bf0(0x18a),'hpfjm':_0x3e4bf0(0x188),'iBAKS':_0x3e4bf0(0x19d),'cpKkS':'user','JaSBZ':_0x3e4bf0(0x177),'ASTCl':'project','wKTPq':'trailhead','EWXFf':_0x3e4bf0(0x192),'wZtGl':'plugin','gRhxH':'add','GIrul':'❌\x20Failed\x20to\x20add\x20marketplace:','rTigW':_0x3e4bf0(0x176),'ugHcx':'install','HGFpN':function(_0x1869de,_0x11a8a7){return _0x1869de===_0x11a8a7;},'gAvha':function(_0x19b91b){return _0x19b91b();},'yMVzn':'❌\x20Failed\x20to\x20install\x20plugin:','OHmPB':_0x3e4bf0(0x178),'ustUJ':'enable','tjtjk':_0x3e4bf0(0x17e),'JbZEt':function(_0x3b39b0,_0xef7c8d){return _0x3b39b0===_0xef7c8d;},'nqoJr':function(_0x8db4da){return _0x8db4da();}},_0x2a76a0=await _0x81b83['Ahngv'](isPluginInstalled,_0x81b83[_0x3e4bf0(0x17b)]);if(_0x2a76a0)return console['log']('✓\x20Claude\x20Code\x20plugin\x20already\x20installed'),![];const _0x551e31=existsSync(_0x81b83[_0x3e4bf0(0x195)](join,getProjectRoot(),_0x81b83['DDgxr']));let _0x1a8704;if(_0x3a2cca)_0x1a8704=_0x3a2cca;else{if(_0x551e31)_0x1a8704='project';else{console['log']('\x0a📦\x20Claude\x20Code\x20Plugin\x0a');const _0x33a01a=await _0x52a815[_0x3e4bf0(0x186)]([{'type':_0x81b83[_0x3e4bf0(0x16e)],'name':_0x81b83['hpfjm'],'message':_0x3e4bf0(0x1a0),'choices':[{'name':_0x81b83[_0x3e4bf0(0x19b)],'value':_0x81b83[_0x3e4bf0(0x17c)]},{'name':_0x81b83[_0x3e4bf0(0x179)],'value':_0x81b83[_0x3e4bf0(0x1a5)]}],'default':'user'}]);_0x1a8704=_0x33a01a['pluginScope'];}}console['log']('\x0aInstalling\x20Claude\x20Code\x20plugin\x20('+_0x1a8704+_0x3e4bf0(0x16c));const _0x1be100=await isMarketplaceAdded(_0x81b83['wKTPq']);let _0x4e7f60=_0x1be100;if(_0x1be100)console['log'](_0x81b83[_0x3e4bf0(0x182)]);else{const _0x4e7e7e=await runClaudeCommand([_0x81b83['wZtGl'],'marketplace',_0x81b83[_0x3e4bf0(0x16f)],'ranger-testing/trailhead']);!_0x4e7e7e[_0x3e4bf0(0x191)]?(console[_0x3e4bf0(0x19c)](_0x81b83[_0x3e4bf0(0x1a1)],_0x4e7e7e['error']),console[_0x3e4bf0(0x194)]('\x0aYou\x20can\x20install\x20manually\x20with:'),console['log'](_0x81b83[_0x3e4bf0(0x187)]),console['log'](_0x3e4bf0(0x180)+_0x1a8704)):_0x4e7f60=!![];}if(_0x4e7f60){const _0xb14bd1=await runClaudeCommand(['plugin',_0x81b83[_0x3e4bf0(0x18f)],_0x81b83['ohFdQ'],_0x3e4bf0(0x17e),_0x1a8704],{'cwd':_0x81b83['HGFpN'](_0x1a8704,_0x3e4bf0(0x1a4))?_0x81b83[_0x3e4bf0(0x17f)](getProjectRoot):undefined});if(!_0xb14bd1['success'])console['error'](_0x81b83['yMVzn'],_0xb14bd1['error']),console['log'](_0x81b83['OHmPB']),console[_0x3e4bf0(0x194)](_0x3e4bf0(0x180)+_0x1a8704);else{console[_0x3e4bf0(0x194)]('✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully');const _0x4ccfcb=[_0x81b83[_0x3e4bf0(0x185)],_0x81b83[_0x3e4bf0(0x18e)],_0x81b83['ohFdQ']];_0x81b83['HGFpN'](_0x1a8704,'project')&&_0x4ccfcb[_0x3e4bf0(0x189)](_0x81b83['tjtjk'],_0x81b83['ASTCl']);const _0x3539c3=await runClaudeCommand(_0x4ccfcb,{'captureOutput':!![],'cwd':_0x81b83[_0x3e4bf0(0x16b)](_0x1a8704,_0x81b83[_0x3e4bf0(0x1a5)])?_0x81b83[_0x3e4bf0(0x18d)](getProjectRoot):undefined}),_0x38bbd6=_0x3539c3[_0x3e4bf0(0x197)]?.[_0x3e4bf0(0x173)](_0x3e4bf0(0x199));!_0x3539c3[_0x3e4bf0(0x191)]&&!_0x38bbd6?console['error'](_0x3e4bf0(0x18c),_0x3539c3[_0x3e4bf0(0x19c)]):console['log'](_0x3e4bf0(0x184));}}return!![];}export async function ensureClaudeSkills(_0x4c3c7f){const _0x580eab=_0x5d56,_0x5e8379={'xiWAI':_0x580eab(0x183),'iMHXv':function(_0x4f2e21,_0x3a221e){return _0x4f2e21(_0x3a221e);},'UqIVm':_0x580eab(0x1a4),'oiOhi':'ranger','Jxgxu':'SKILL.md','hnpNv':_0x580eab(0x196),'zjZMs':'confirm','ZoqNF':'Would\x20you\x20like\x20to\x20install\x20skills?'},_0x4010ff=existsSync(join(getSkillsDir(_0x5e8379['xiWAI']),'ranger','SKILL.md')),_0x95d06a=_0x5e8379[_0x580eab(0x174)](existsSync,join(getSkillsDir(_0x5e8379[_0x580eab(0x18b)]),_0x5e8379[_0x580eab(0x181)],_0x5e8379['Jxgxu']));if(_0x4010ff||_0x95d06a)return console[_0x580eab(0x194)](_0x5e8379[_0x580eab(0x193)]),![];const _0x255c47=existsSync(join(getProjectRoot(),'.claude'));let _0x10cbf5=!![];if(_0x4c3c7f)await skillup({'autoInstall':_0x4c3c7f,'suppressUsage':!![]});else{if(_0x255c47)await skillup({'autoInstall':_0x5e8379['UqIVm'],'suppressUsage':!![]});else{const _0x560ca2=await _0x52a815['prompt']([{'type':_0x5e8379['zjZMs'],'name':_0x580eab(0x19e),'message':_0x5e8379['ZoqNF'],'default':!![]}]);_0x10cbf5=_0x560ca2['wantsSkillup'],_0x10cbf5&&await skillup({'suppressUsage':!![]});}}return _0x10cbf5;}
1
+ (function(_0x3b3b67,_0x2d5da5){const _0x31e715=_0x39c3,_0x40c034=_0x3b3b67();while(!![]){try{const _0x5b8d0c=parseInt(_0x31e715(0x1ea))/0x1+parseInt(_0x31e715(0x1c4))/0x2+-parseInt(_0x31e715(0x1ce))/0x3+parseInt(_0x31e715(0x1e6))/0x4*(-parseInt(_0x31e715(0x1b6))/0x5)+parseInt(_0x31e715(0x1d5))/0x6*(-parseInt(_0x31e715(0x1cb))/0x7)+parseInt(_0x31e715(0x1eb))/0x8*(parseInt(_0x31e715(0x1d6))/0x9)+-parseInt(_0x31e715(0x1c3))/0xa*(-parseInt(_0x31e715(0x1dc))/0xb);if(_0x5b8d0c===_0x2d5da5)break;else _0x40c034['push'](_0x40c034['shift']());}catch(_0x48debe){_0x40c034['push'](_0x40c034['shift']());}}}(_0x1b04,0x203f3));import{join}from'path';import{existsSync}from'fs';import _0x13ca24 from'inquirer';import{skillup}from'../skillup.js';function _0x1b04(){const _0x4a8f86=['\x0a📦\x20Claude\x20Code\x20Plugin\x0a','user','kMVcz','ranger','YzvTW','XehVo','123070RyhcaJ','470296irOkEd','bkHsv','✓\x20Marketplace\x20already\x20added','--scope','❌\x20Failed\x20to\x20install\x20plugin:','enable','log','7djdjeS','pHxFH','\x20\x20claude\x20plugin\x20marketplace\x20add\x20ranger-testing/trailhead','782433OeiOkc','marketplace','uRONk','EmOIG','User\x20(available\x20in\x20all\x20your\x20projects)','PuQtV','dHEBF','573894cCPwVK','4131cIltxy','pluginScope','\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20','Would\x20you\x20like\x20to\x20install\x20skills?','already\x20enabled','\x20level)...\x0a','143bJcsHE','WgexA','.claude','WANdM','btrPq','nRMkF','list','GzGpW','ranger@trailhead','error','292764XBKbJg','✓\x20Claude\x20Code\x20plugin\x20enabled','push','❌\x20Failed\x20to\x20add\x20marketplace:','51806pneTtN','4552lTZbCw','\x0aInstalling\x20Claude\x20Code\x20plugin\x20(','15FjJBCM','project','\x0aYou\x20can\x20install\x20manually\x20with:','ranger-testing/trailhead','⚠\x20Failed\x20to\x20enable\x20plugin:','DzLUi','SKILL.md'];_0x1b04=function(){return _0x4a8f86;};return _0x1b04();}function _0x39c3(_0x2ddd84,_0xd05a6c){_0x2ddd84=_0x2ddd84-0x1b6;const _0x1b043f=_0x1b04();let _0x39c353=_0x1b043f[_0x2ddd84];return _0x39c353;}import{runClaudeCommand,isMarketplaceAdded,isPluginInstalled}from'../utils/claudePlugin.js';import{getProjectRoot,getSkillsDir}from'../utils/claudeConfig.js';export async function ensureClaudePlugin(_0x266dd7){const _0x1a4069=_0x39c3,_0x5253ca={'BuJJk':'✓\x20Claude\x20Code\x20plugin\x20already\x20installed','EmOIG':function(_0x402b13,_0x584204){return _0x402b13(_0x584204);},'DzLUi':function(_0x493ec7,_0x55db94,_0x1c1fbb){return _0x493ec7(_0x55db94,_0x1c1fbb);},'PuQtV':function(_0x4ab5a9){return _0x4ab5a9();},'uRONk':'.claude','nRMkF':_0x1a4069(0x1b7),'dHEBF':_0x1a4069(0x1bd),'GzGpW':_0x1a4069(0x1be),'abmCF':'trailhead','pHxFH':_0x1a4069(0x1c6),'kYqKt':_0x1a4069(0x1cf),'WANdM':'add','YzvTW':_0x1a4069(0x1b9),'BKkAK':'install','btrPq':'ranger@trailhead','XehVo':_0x1a4069(0x1c7),'WgexA':function(_0x1a0ea0,_0x500801){return _0x1a0ea0===_0x500801;},'ZFnfd':_0x1a4069(0x1c8),'jsQkB':'✓\x20Claude\x20Code\x20plugin\x20installed\x20successfully','BZJGG':'plugin','IAIaI':_0x1a4069(0x1ba)},_0x690234=await isPluginInstalled(_0x1a4069(0x1e4));if(_0x690234)return console['log'](_0x5253ca['BuJJk']),![];const _0x2da6b9=_0x5253ca[_0x1a4069(0x1d1)](existsSync,_0x5253ca[_0x1a4069(0x1bb)](join,_0x5253ca[_0x1a4069(0x1d3)](getProjectRoot),_0x5253ca[_0x1a4069(0x1d0)]));let _0x4165f8;if(_0x266dd7)_0x4165f8=_0x266dd7;else{if(_0x2da6b9)_0x4165f8=_0x5253ca[_0x1a4069(0x1e1)];else{console[_0x1a4069(0x1ca)](_0x5253ca[_0x1a4069(0x1d4)]);const _0x5450dd=await _0x13ca24['prompt']([{'type':_0x1a4069(0x1e2),'name':'pluginScope','message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x1a4069(0x1d2),'value':_0x5253ca['GzGpW']},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':'project'}],'default':_0x5253ca[_0x1a4069(0x1e3)]}]);_0x4165f8=_0x5450dd[_0x1a4069(0x1d7)];}}console[_0x1a4069(0x1ca)](_0x1a4069(0x1ec)+_0x4165f8+_0x1a4069(0x1db));const _0x158bc6=await isMarketplaceAdded(_0x5253ca['abmCF']);let _0x3fe124=_0x158bc6;if(_0x158bc6)console[_0x1a4069(0x1ca)](_0x5253ca[_0x1a4069(0x1cc)]);else{const _0x49f2e8=await _0x5253ca['EmOIG'](runClaudeCommand,['plugin',_0x5253ca['kYqKt'],_0x5253ca[_0x1a4069(0x1df)],_0x5253ca[_0x1a4069(0x1c1)]]);!_0x49f2e8['success']?(console[_0x1a4069(0x1e5)](_0x1a4069(0x1e9),_0x49f2e8['error']),console[_0x1a4069(0x1ca)]('\x0aYou\x20can\x20install\x20manually\x20with:'),console['log'](_0x1a4069(0x1cd)),console[_0x1a4069(0x1ca)]('\x20\x20claude\x20plugin\x20install\x20ranger@trailhead\x20--scope\x20'+_0x4165f8)):_0x3fe124=!![];}if(_0x3fe124){const _0x4428d1=await _0x5253ca[_0x1a4069(0x1bb)](runClaudeCommand,['plugin',_0x5253ca['BKkAK'],_0x5253ca[_0x1a4069(0x1e0)],_0x5253ca[_0x1a4069(0x1c2)],_0x4165f8],{'cwd':_0x5253ca[_0x1a4069(0x1dd)](_0x4165f8,'project')?getProjectRoot():undefined});if(!_0x4428d1['success'])console[_0x1a4069(0x1e5)](_0x5253ca['ZFnfd'],_0x4428d1['error']),console['log'](_0x1a4069(0x1b8)),console[_0x1a4069(0x1ca)](_0x1a4069(0x1d8)+_0x4165f8);else{console[_0x1a4069(0x1ca)](_0x5253ca['jsQkB']);const _0x3e0545=[_0x5253ca['BZJGG'],_0x1a4069(0x1c9),_0x5253ca['btrPq']];_0x5253ca[_0x1a4069(0x1dd)](_0x4165f8,_0x5253ca[_0x1a4069(0x1e1)])&&_0x3e0545[_0x1a4069(0x1e8)](_0x1a4069(0x1c7),_0x1a4069(0x1b7));const _0x56d26e=await _0x5253ca[_0x1a4069(0x1bb)](runClaudeCommand,_0x3e0545,{'captureOutput':!![],'cwd':_0x4165f8===_0x5253ca[_0x1a4069(0x1e1)]?getProjectRoot():undefined}),_0xfe56a2=_0x56d26e['output']?.['includes'](_0x1a4069(0x1da));!_0x56d26e['success']&&!_0xfe56a2?console[_0x1a4069(0x1e5)](_0x5253ca['IAIaI'],_0x56d26e['error']):console['log'](_0x1a4069(0x1e7));}}return!![];}export async function ensureClaudeSkills(_0x134353){const _0x40af1e=_0x39c3,_0x511a0a={'vdsMo':function(_0x5abfd5,_0x130eb1,_0xb8c7fd,_0x31cf89){return _0x5abfd5(_0x130eb1,_0xb8c7fd,_0x31cf89);},'kMVcz':function(_0x1b2eec,_0x357de7){return _0x1b2eec(_0x357de7);},'dHaxu':_0x40af1e(0x1c0),'lwulF':function(_0x5b9274,_0x47b6f5){return _0x5b9274(_0x47b6f5);},'bkHsv':_0x40af1e(0x1b7),'HSdls':function(_0x4aa918,_0x424f5c){return _0x4aa918||_0x424f5c;},'ytckv':'✓\x20Ranger\x20skills\x20already\x20installed','AgTEc':_0x40af1e(0x1de),'XVgRQ':'wantsSkillup','fZOKH':function(_0x810f4a,_0x506373){return _0x810f4a(_0x506373);}},_0x6c8d65=existsSync(_0x511a0a['vdsMo'](join,_0x511a0a['kMVcz'](getSkillsDir,'user'),_0x511a0a['dHaxu'],_0x40af1e(0x1bc))),_0x15335d=_0x511a0a['lwulF'](existsSync,_0x511a0a['vdsMo'](join,getSkillsDir(_0x511a0a[_0x40af1e(0x1c5)]),'ranger',_0x40af1e(0x1bc)));if(_0x511a0a['HSdls'](_0x6c8d65,_0x15335d))return console[_0x40af1e(0x1ca)](_0x511a0a['ytckv']),![];const _0x475cba=existsSync(join(getProjectRoot(),_0x511a0a['AgTEc']));let _0x2619b1=!![];if(_0x134353)await _0x511a0a[_0x40af1e(0x1bf)](skillup,{'autoInstall':_0x134353,'suppressUsage':!![]});else{if(_0x475cba)await skillup({'autoInstall':_0x40af1e(0x1b7),'suppressUsage':!![]});else{const _0x5b3936=await _0x13ca24['prompt']([{'type':'confirm','name':_0x511a0a['XVgRQ'],'message':_0x40af1e(0x1d9),'default':!![]}]);_0x2619b1=_0x5b3936['wantsSkillup'],_0x2619b1&&await _0x511a0a['fZOKH'](skillup,{'suppressUsage':!![]});}}return _0x2619b1;}
@@ -1 +1 @@
1
- (function(_0x35025f,_0x3b0f13){const _0x41eadb=_0x7d2d,_0x4abb42=_0x35025f();while(!![]){try{const _0x20d45f=-parseInt(_0x41eadb(0xe0))/0x1*(-parseInt(_0x41eadb(0xd4))/0x2)+parseInt(_0x41eadb(0xdb))/0x3*(-parseInt(_0x41eadb(0xc6))/0x4)+-parseInt(_0x41eadb(0xd7))/0x5*(parseInt(_0x41eadb(0xcb))/0x6)+parseInt(_0x41eadb(0xdf))/0x7+-parseInt(_0x41eadb(0xce))/0x8+-parseInt(_0x41eadb(0xd5))/0x9*(-parseInt(_0x41eadb(0xca))/0xa)+-parseInt(_0x41eadb(0xd0))/0xb;if(_0x20d45f===_0x3b0f13)break;else _0x4abb42['push'](_0x4abb42['shift']());}catch(_0x3fc4ca){_0x4abb42['push'](_0x4abb42['shift']());}}}(_0x5e8f,0x20e79));import{join}from'path';function _0x7d2d(_0x7677ed,_0x446e8c){_0x7677ed=_0x7677ed-0xc4;const _0x5e8f36=_0x5e8f();let _0x7d2d8c=_0x5e8f36[_0x7677ed];return _0x7d2d8c;}import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';function _0x5e8f(){const _0x5ce4c3=['project','PGslI','1827952DUrLBR','2851LZLgDj','user','prompt','754764bPlNoq','log','Project\x20(shared\x20with\x20team\x20via\x20git)','zYCDt','30INyKwi','564mzUmDz','parse','stringify','566376ULAhQm','lOlUv','1201464mBugTE','pluginScope','ZaHxw','lxMIy','76EJvous','657819KbLUMI','plugin','4535bcUYgS','zbPRQ','https://opencode.ai/config.json','opencode.json','3XrOCoQ','sXxxD'];_0x5e8f=function(){return _0x5ce4c3;};return _0x5e8f();}import _0x49cd87 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0xd440be){const _0x27785f=_0x7d2d,_0x32e89b={'lxMIy':function(_0x305fa5,_0x5bb603){return _0x305fa5(_0x5bb603);},'WDPfj':'project','zYCDt':'\x0a📦\x20OpenCode\x20Plugin\x0a','PGslI':'list','ZaHxw':'User\x20(available\x20in\x20all\x20your\x20projects)','rQoQL':'user','zbPRQ':_0x27785f(0xc8),'lOlUv':function(_0x5351d6,_0x46f0ce,_0x2b9bee){return _0x5351d6(_0x46f0ce,_0x2b9bee);},'sXxxD':'utf-8','wGTTQ':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','vfKnP':'Failed\x20to\x20read\x20opencode.json','AJVnL':'✓\x20OpenCode\x20plugin\x20configured'},_0x5f4a21=_0x32e89b[_0x27785f(0xd3)](existsSync,join(getOpencodeConfigDir(_0x32e89b['WDPfj']),_0x27785f(0xda)));let _0x35afc5;if(_0xd440be)_0x35afc5=_0xd440be;else{if(_0x5f4a21)_0x35afc5=_0x27785f(0xdd);else{console['log'](_0x32e89b[_0x27785f(0xc9)]);const _0x5434ea=await _0x49cd87[_0x27785f(0xc5)]([{'type':_0x32e89b[_0x27785f(0xde)],'name':_0x27785f(0xd1),'message':'Where\x20should\x20the\x20plugin\x20be\x20installed?','choices':[{'name':_0x32e89b[_0x27785f(0xd2)],'value':_0x32e89b['rQoQL']},{'name':_0x32e89b[_0x27785f(0xd8)],'value':_0x32e89b['WDPfj']}],'default':_0x27785f(0xc4)}]);_0x35afc5=_0x5434ea['pluginScope'];}}const _0x2edb44=join(getOpencodeConfigDir(_0x35afc5),_0x27785f(0xda)),_0x5214df='@ranger-testing/opencode-plugin',_0x4f030a=_0x27785f(0xd9);let _0xdbf94a={};if(existsSync(_0x2edb44))try{const _0x422f6c=await _0x32e89b[_0x27785f(0xcf)](readFile,_0x2edb44,_0x32e89b[_0x27785f(0xdc)]);_0xdbf94a=JSON[_0x27785f(0xcc)](_0x422f6c);}catch(_0xa69c32){return console['error'](_0x32e89b['wGTTQ']),{'configured':![],'scope':_0x35afc5,'error':_0x32e89b['vfKnP'],'details':_0xa69c32};}const _0x488a35=Array['isArray'](_0xdbf94a[_0x27785f(0xd6)])?_0xdbf94a[_0x27785f(0xd6)]:[];if(_0x488a35['includes'](_0x5214df))return console[_0x27785f(0xc7)]('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x35afc5};return _0xdbf94a['$schema']=_0xdbf94a['$schema']||_0x4f030a,_0xdbf94a['plugin']=[..._0x488a35,_0x5214df],await mkdir(_0x32e89b['lxMIy'](getOpencodeConfigDir,_0x35afc5),{'recursive':!![]}),await writeFile(_0x2edb44,JSON[_0x27785f(0xcd)](_0xdbf94a,null,0x2)+'\x0a'),console['log'](_0x32e89b['AJVnL']),{'configured':!![],'scope':_0x35afc5};}
1
+ (function(_0x17be11,_0x1b0e4d){const _0x326a55=_0x396f,_0x54a3cd=_0x17be11();while(!![]){try{const _0x435fee=parseInt(_0x326a55(0x1c5))/0x1+parseInt(_0x326a55(0x1c9))/0x2+parseInt(_0x326a55(0x1cc))/0x3+parseInt(_0x326a55(0x1c2))/0x4*(-parseInt(_0x326a55(0x1b8))/0x5)+parseInt(_0x326a55(0x1d4))/0x6*(-parseInt(_0x326a55(0x1d6))/0x7)+parseInt(_0x326a55(0x1c0))/0x8*(-parseInt(_0x326a55(0x1c6))/0x9)+parseInt(_0x326a55(0x1cf))/0xa;if(_0x435fee===_0x1b0e4d)break;else _0x54a3cd['push'](_0x54a3cd['shift']());}catch(_0x42ecb7){_0x54a3cd['push'](_0x54a3cd['shift']());}}}(_0x443c,0xbdc14));import{join}from'path';function _0x443c(){const _0x6b0390=['WWvik','user','406650VxNZNO','opencode.json','133fIDVBg','project','wBAKD','15FRmwMA','plugin','$schema','OljVw','list','log','sYKTj','UzIMZ','441776MOlbWq','oxMry','772764ntdDOk','Failed\x20to\x20read\x20opencode.json','cZFxm','878885VrBkza','117KPluLB','utf-8','https://opencode.ai/config.json','991188OTyPbV','✓\x20OpenCode\x20plugin\x20configured','isArray','3161253ilIsyH','pluginScope','parse','9341900OjVqez','ulbtW','JJNRr'];_0x443c=function(){return _0x6b0390;};return _0x443c();}function _0x396f(_0x2653f6,_0x1f6d1c){_0x2653f6=_0x2653f6-0x1b7;const _0x443cc9=_0x443c();let _0x396f45=_0x443cc9[_0x2653f6];return _0x396f45;}import{existsSync}from'fs';import{mkdir,readFile,writeFile}from'fs/promises';import _0x278dd7 from'inquirer';import{getOpencodeConfigDir}from'../utils/opencodeConfig.js';export async function ensureOpencodePluginConfig(_0x1f2496){const _0x2bc089=_0x396f,_0x15ce26={'ulbtW':function(_0x30b236,_0x589d8a,_0x47948a){return _0x30b236(_0x589d8a,_0x47948a);},'JJNRr':function(_0x287b1b,_0x5368fb){return _0x287b1b(_0x5368fb);},'tIHvX':'opencode.json','Quvxm':_0x2bc089(0x1bc),'cZFxm':'pluginScope','ZWenV':'Where\x20should\x20the\x20plugin\x20be\x20installed?','oxMry':'User\x20(available\x20in\x20all\x20your\x20projects)','wtDHi':function(_0x2742d5,_0x5b0962,_0x402cb1){return _0x2742d5(_0x5b0962,_0x402cb1);},'wBAKD':'@ranger-testing/opencode-plugin','OljVw':_0x2bc089(0x1c8),'WWvik':_0x2bc089(0x1c7),'UzIMZ':'⚠\x20Failed\x20to\x20read\x20opencode.json.\x20Please\x20add\x20the\x20plugin\x20manually.','AODuJ':_0x2bc089(0x1c3),'sYKTj':_0x2bc089(0x1ca)},_0x1982d0=existsSync(_0x15ce26[_0x2bc089(0x1d0)](join,_0x15ce26[_0x2bc089(0x1d1)](getOpencodeConfigDir,_0x2bc089(0x1d7)),_0x15ce26['tIHvX']));let _0x35a9d8;if(_0x1f2496)_0x35a9d8=_0x1f2496;else{if(_0x1982d0)_0x35a9d8='project';else{console['log']('\x0a📦\x20OpenCode\x20Plugin\x0a');const _0x576bdf=await _0x278dd7['prompt']([{'type':_0x15ce26['Quvxm'],'name':_0x15ce26[_0x2bc089(0x1c4)],'message':_0x15ce26['ZWenV'],'choices':[{'name':_0x15ce26[_0x2bc089(0x1c1)],'value':_0x2bc089(0x1d3)},{'name':'Project\x20(shared\x20with\x20team\x20via\x20git)','value':_0x2bc089(0x1d7)}],'default':_0x2bc089(0x1d3)}]);_0x35a9d8=_0x576bdf[_0x2bc089(0x1cd)];}}const _0x405347=_0x15ce26['wtDHi'](join,_0x15ce26[_0x2bc089(0x1d1)](getOpencodeConfigDir,_0x35a9d8),_0x2bc089(0x1d5)),_0x525336=_0x15ce26[_0x2bc089(0x1b7)],_0x4a7b22=_0x15ce26[_0x2bc089(0x1bb)];let _0x7631ec={};if(_0x15ce26[_0x2bc089(0x1d1)](existsSync,_0x405347))try{const _0x2983dd=await _0x15ce26['ulbtW'](readFile,_0x405347,_0x15ce26[_0x2bc089(0x1d2)]);_0x7631ec=JSON[_0x2bc089(0x1ce)](_0x2983dd);}catch(_0x33b19d){return console['error'](_0x15ce26[_0x2bc089(0x1bf)]),{'configured':![],'scope':_0x35a9d8,'error':_0x15ce26['AODuJ'],'details':_0x33b19d};}const _0xdaeead=Array[_0x2bc089(0x1cb)](_0x7631ec['plugin'])?_0x7631ec[_0x2bc089(0x1b9)]:[];if(_0xdaeead['includes'](_0x525336))return console[_0x2bc089(0x1bd)]('✓\x20OpenCode\x20plugin\x20already\x20configured'),{'configured':![],'scope':_0x35a9d8};return _0x7631ec[_0x2bc089(0x1ba)]=_0x7631ec['$schema']||_0x4a7b22,_0x7631ec[_0x2bc089(0x1b9)]=[..._0xdaeead,_0x525336],await mkdir(getOpencodeConfigDir(_0x35a9d8),{'recursive':!![]}),await _0x15ce26['wtDHi'](writeFile,_0x405347,JSON['stringify'](_0x7631ec,null,0x2)+'\x0a'),console[_0x2bc089(0x1bd)](_0x15ce26[_0x2bc089(0x1be)]),{'configured':!![],'scope':_0x35a9d8};}
@@ -1 +1 @@
1
- (function(_0x1b8e0a,_0x56014b){var _0x5b3213=_0x3158,_0x279393=_0x1b8e0a();while(!![]){try{var _0x5eb3bd=-parseInt(_0x5b3213(0x168))/0x1*(parseInt(_0x5b3213(0x16c))/0x2)+parseInt(_0x5b3213(0x162))/0x3*(parseInt(_0x5b3213(0x169))/0x4)+-parseInt(_0x5b3213(0x163))/0x5*(-parseInt(_0x5b3213(0x16a))/0x6)+-parseInt(_0x5b3213(0x16b))/0x7+parseInt(_0x5b3213(0x15e))/0x8+parseInt(_0x5b3213(0x15d))/0x9+parseInt(_0x5b3213(0x161))/0xa*(-parseInt(_0x5b3213(0x15c))/0xb);if(_0x5eb3bd===_0x56014b)break;else _0x279393['push'](_0x279393['shift']());}catch(_0x46494){_0x279393['push'](_0x279393['shift']());}}}(_0xd7c0,0xda4ab));function _0x3158(_0x34c556,_0x4d5f82){_0x34c556=_0x34c556-0x15c;var _0xd7c043=_0xd7c0();var _0x31588d=_0xd7c043[_0x34c556];return _0x31588d;}export async function setupCi(_0x129432,_0x354018,_0x48a920){var _0x53b6db=_0x3158,_0x241403={'VzvpY':function(_0x75c1b3,_0x1dca3c){return _0x75c1b3+_0x1dca3c;},'LbEwW':_0x53b6db(0x164),'WUiIa':'\x20\x20https://docs.ranger.net/main/concepts/profiles'};console[_0x53b6db(0x165)](_0x241403[_0x53b6db(0x15f)](_0x241403[_0x53b6db(0x15f)](_0x241403['VzvpY']('ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','\x0a')+'To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a'+_0x241403['LbEwW'],'\x0a'),_0x53b6db(0x166))+_0x241403[_0x53b6db(0x167)]),process[_0x53b6db(0x160)](0x1);}function _0xd7c0(){var _0x40b233=['exit','343250mEuHRX','588972IoctmB','981880CkgMbe','\x20\x20ranger\x20profile\x20add\x20<name>\x0a','error','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','WUiIa','4yOoLcZ','8HGXbKj','24otnxNZ','2744476yjBDOa','248662NsJNPC','781qpreHh','15436890IwFLkW','10617824FxPWpc','VzvpY'];_0xd7c0=function(){return _0x40b233;};return _0xd7c0();}
1
+ function _0x4a45(_0x35e11e,_0x3abd01){_0x35e11e=_0x35e11e-0x12a;var _0x3d62e6=_0x3d62();var _0x4a45e2=_0x3d62e6[_0x35e11e];return _0x4a45e2;}function _0x3d62(){var _0x3a55f4=['28Dcmolt','ranger\x20setup\x20--ci\x20writes\x20to\x20the\x20legacy\x20.ranger/ci/\x20tree\x20which\x20is\x20no\x20longer\x20supported.\x0a','175266nGQkbn','error','75126zjsFZs','24BSsLpY','1956376Qrrzwa','12461295YECWAB','\x20\x20https://docs.ranger.net/main/concepts/profiles','For\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:\x0a','24eeVYye','635AfQZcb','50aKTbpD','189cvbUVh','EmxuV','40374sYxLFQ','642740WwbquA','exit','33869966upXrmC','To\x20set\x20up\x20a\x20fresh\x20profile,\x20run:\x0a'];_0x3d62=function(){return _0x3a55f4;};return _0x3d62();}(function(_0x5ab2bb,_0x159914){var _0x5dde48=_0x4a45,_0x1a4429=_0x5ab2bb();while(!![]){try{var _0x58377f=-parseInt(_0x5dde48(0x12b))/0x1*(-parseInt(_0x5dde48(0x13c))/0x2)+parseInt(_0x5dde48(0x132))/0x3*(-parseInt(_0x5dde48(0x13a))/0x4)+-parseInt(_0x5dde48(0x13b))/0x5*(parseInt(_0x5dde48(0x134))/0x6)+parseInt(_0x5dde48(0x130))/0x7*(-parseInt(_0x5dde48(0x136))/0x8)+-parseInt(_0x5dde48(0x13d))/0x9*(parseInt(_0x5dde48(0x12c))/0xa)+-parseInt(_0x5dde48(0x137))/0xb+-parseInt(_0x5dde48(0x135))/0xc*(-parseInt(_0x5dde48(0x12e))/0xd);if(_0x58377f===_0x159914)break;else _0x1a4429['push'](_0x1a4429['shift']());}catch(_0x33a089){_0x1a4429['push'](_0x1a4429['shift']());}}}(_0x3d62,0xc7dc4));export async function setupCi(_0x4dc5e7,_0xc280f4,_0x15f48c){var _0x171760=_0x4a45,_0x86f057={'EmxuV':function(_0x5445d5,_0xe6e416){return _0x5445d5+_0xe6e416;},'jEYKC':function(_0x1be99f,_0x5f49c0){return _0x1be99f+_0x5f49c0;},'HBrdM':_0x171760(0x12f),'SPwFf':'\x20\x20ranger\x20profile\x20add\x20<name>\x0a','WENzX':_0x171760(0x138)};console[_0x171760(0x133)](_0x86f057['EmxuV'](_0x86f057[_0x171760(0x12a)](_0x86f057['jEYKC'](_0x171760(0x131)+'\x0a'+_0x86f057['HBrdM']+_0x86f057['SPwFf'],'\x0a'),_0x171760(0x139)),_0x86f057['WENzX'])),process[_0x171760(0x12d)](0x1);}
@@ -1 +1 @@
1
- (function(_0x456d4d,_0x25ffec){const _0x2b14eb=_0x1dfe,_0x56c139=_0x456d4d();while(!![]){try{const _0xccec0e=parseInt(_0x2b14eb(0x92))/0x1*(-parseInt(_0x2b14eb(0x9c))/0x2)+-parseInt(_0x2b14eb(0xa1))/0x3+-parseInt(_0x2b14eb(0x9a))/0x4+parseInt(_0x2b14eb(0x90))/0x5*(-parseInt(_0x2b14eb(0x88))/0x6)+parseInt(_0x2b14eb(0xa4))/0x7*(parseInt(_0x2b14eb(0xa6))/0x8)+parseInt(_0x2b14eb(0xa9))/0x9+parseInt(_0x2b14eb(0xa2))/0xa;if(_0xccec0e===_0x25ffec)break;else _0x56c139['push'](_0x56c139['shift']());}catch(_0x215bd3){_0x56c139['push'](_0x56c139['shift']());}}}(_0x589e,0x214da));import{basename}from'path';import _0xa54cf7 from'inquirer';import{getToken}from'./utils/keychain.js';import{installSkill}from'./utils/skills.js';function _0x1dfe(_0x34966c,_0x52edaf){_0x34966c=_0x34966c-0x85;const _0x589ea0=_0x589e();let _0x1dfed5=_0x589ea0[_0x34966c];return _0x1dfed5;}import{getCurrentVersion}from'./utils/version.js';function _0x589e(){const _0x571845=['147RxFiWa','rvNkY','1624gVvood','✓\x20Found\x20API\x20token','\x0a📦\x20Installing\x20skills...\x0a','660582OfFgYD','\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!','project','list','To\x20use:','JkKXL','60HTtEWi','autoInstall','user','ranger','claude','warn','\x20<your-api-token>','\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli','78135kWPXXg','ritIB','9dWrhUG','/.claude/skills/','installLevel','All\x20projects\x20(','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','ErmTV','This\x20project\x20only\x20(','zUdJF','242728KPzRGn','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','45844eBmbKe','\x20\x203.\x20Run:\x20ranger\x20skillup','/skills/','EjwPw','isTTY','306387JYtYal','5841280SlSbDe','log'];_0x589e=function(){return _0x571845;};return _0x589e();}import{getClaudeConfigDir,getProjectRoot}from'./utils/claudeConfig.js';import{getOpencodeConfigDir}from'./utils/opencodeConfig.js';export async function skillup(_0x57e391={}){const _0x569720=_0x1dfe,_0x3cd20e={'BPoYQ':_0x569720(0x9b),'TdyTN':_0x569720(0x96),'QPtZk':_0x569720(0x8f),'EjwPw':'opencode','aigca':'\x20--opencode','soUdC':function(_0x286369){return _0x286369();},'dCLwn':_0x569720(0x94),'rvNkY':_0x569720(0x8a),'QcaXI':'project','JkKXL':function(_0x31beef){return _0x31beef();},'qTIsn':function(_0x5c8ffc,_0x534eb5,_0x513b14){return _0x5c8ffc(_0x534eb5,_0x513b14);},'ZhovU':_0x569720(0x8b),'wnfpW':function(_0x8f365a,_0x303396){return _0x8f365a>_0x303396;},'GWyIn':function(_0x54226d,_0x5d9d6e){return _0x54226d===_0x5d9d6e;},'ErmTV':'user-level','GRGdA':'project-level','soaiJ':_0x569720(0x86),'zUdJF':'\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.','ritIB':_0x569720(0xaa)};console['log'](_0x3cd20e['BPoYQ']);const _0x5792d3=_0x57e391['platform']??_0x569720(0x8c),_0x1e6e11=await getToken();if(!_0x1e6e11){console['log'](_0x3cd20e['TdyTN']),console['log']('To\x20get\x20started:'),console['log'](_0x3cd20e['QPtZk']),console['log']('\x20\x202.\x20Run:\x20ranger\x20setup'+(_0x5792d3===_0x3cd20e[_0x569720(0x9f)]?_0x3cd20e['aigca']:'')+_0x569720(0x8e)),console['log'](_0x569720(0x9d)+(_0x5792d3==='opencode'?'\x20--opencode':'')+'\x0a');return;}console[_0x569720(0xa3)](_0x569720(0xa7));const _0x2101d7=_0x3cd20e['soUdC'](getProjectRoot),_0x28b771=basename(_0x2101d7),_0x3d4c58=_0x5792d3===_0x3cd20e['EjwPw']?getOpencodeConfigDir('user')+'/skills/':getClaudeConfigDir()+_0x569720(0x9e),_0x5576b8=_0x5792d3==='opencode'?_0x2101d7+'/.opencode/skills/':_0x2101d7+_0x569720(0x93),_0x431a60=process['stdin']['isTTY']&&process['stdout'][_0x569720(0xa0)];let _0x16a113;if(_0x57e391['autoInstall'])_0x16a113=_0x57e391[_0x569720(0x89)];else{if(_0x431a60){const _0x30d4f3=await _0xa54cf7['prompt']([{'type':_0x569720(0x85),'name':_0x3cd20e['dCLwn'],'message':'Where\x20should\x20skills\x20be\x20installed?','choices':[{'name':_0x569720(0x95)+_0x3d4c58+')','value':_0x3cd20e[_0x569720(0xa5)]},{'name':_0x569720(0x98)+_0x5576b8+')','value':_0x569720(0xab)}]}]);_0x16a113=_0x30d4f3['installLevel'];}else _0x16a113=_0x3cd20e['QcaXI'],console['log']('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x5576b8+')');}let _0x1add0e=0x0;const _0x17e044=_0x3cd20e[_0x569720(0x87)](getCurrentVersion);console[_0x569720(0xa3)](_0x569720(0xa8));try{const _0x201c07=await _0x3cd20e['qTIsn'](installSkill,_0x3cd20e['ZhovU'],{'cliVersion':_0x17e044,'level':_0x16a113,'platform':_0x5792d3});_0x201c07&&_0x1add0e++;}catch(_0x2e0f9e){console[_0x569720(0x8d)]('\x20\x20Failed\x20to\x20install\x20ranger\x20skill:',_0x2e0f9e instanceof Error?_0x2e0f9e['message']:_0x2e0f9e);}if(_0x3cd20e['wnfpW'](_0x1add0e,0x0)){const _0x351a92=_0x3cd20e['GWyIn'](_0x16a113,'user')?_0x3cd20e[_0x569720(0x97)]:_0x3cd20e['GRGdA'];console[_0x569720(0xa3)]('\x0a✅\x20Installed\x20'+_0x1add0e+'\x20'+_0x351a92+'\x20skill'+(_0x1add0e>0x1?'s':'')+'\x20successfully!\x0a'),!_0x57e391['suppressUsage']&&(console[_0x569720(0xa3)](_0x3cd20e['soaiJ']),_0x5792d3==='opencode'?console[_0x569720(0xa3)](_0x3cd20e[_0x569720(0x99)]):console[_0x569720(0xa3)](_0x3cd20e[_0x569720(0x91)]));}else console[_0x569720(0xa3)]('\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a');}
1
+ function _0x79f1(_0x19cc69,_0x1f2ca8){_0x19cc69=_0x19cc69-0xa1;const _0xa18d53=_0xa18d();let _0x79f19c=_0xa18d53[_0x19cc69];return _0x79f19c;}(function(_0x46c26b,_0x46b877){const _0xed6094=_0x79f1,_0x1976cd=_0x46c26b();while(!![]){try{const _0x1f0bc7=parseInt(_0xed6094(0xa3))/0x1+parseInt(_0xed6094(0xb8))/0x2+-parseInt(_0xed6094(0xa8))/0x3*(-parseInt(_0xed6094(0xa6))/0x4)+-parseInt(_0xed6094(0xad))/0x5+-parseInt(_0xed6094(0xbb))/0x6+parseInt(_0xed6094(0xa2))/0x7+parseInt(_0xed6094(0xbd))/0x8*(parseInt(_0xed6094(0xaa))/0x9);if(_0x1f0bc7===_0x46b877)break;else _0x1976cd['push'](_0x1976cd['shift']());}catch(_0x5e1b74){_0x1976cd['push'](_0x1976cd['shift']());}}}(_0xa18d,0x51818));function _0xa18d(){const _0x21ab04=['log','\x20\x203.\x20Run:\x20ranger\x20skillup','oWBVv','All\x20projects\x20(','\x0a📦\x20Installing\x20skills...\x0a','\x20--opencode','project','platform','2066925RGhriU','54871nRJzDM','opencode','❌\x20No\x20Ranger\x20API\x20token\x20found.\x0a','82504IBqIoW','user','15jPCONR','prompt','45ORFpLu','\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!','nXLxI','99965UFtxhi','user-level','✓\x20Found\x20API\x20token','GdgPD','warn','/skills/','ZkfHS','isTTY','ZEeti','ebiPy','\x0a🎯\x20Ranger\x20Skill\x20Setup\x0a','42828uFontV','project-level','LjDgw','1321734njYYmk','\x20successfully!\x0a','159104EniJBk','unbSx','\x20\x202.\x20Run:\x20ranger\x20setup','suppressUsage','installLevel','This\x20project\x20only\x20(','\x20skill'];_0xa18d=function(){return _0x21ab04;};return _0xa18d();}import{basename}from'path';import _0x2c1a2c 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(_0x5dd537={}){const _0x4e1bbd=_0x79f1,_0x3f570a={'bSQez':_0x4e1bbd(0xb7),'ZkfHS':'claude','ZEeti':function(_0xe2ac8f){return _0xe2ac8f();},'vyUfn':_0x4e1bbd(0xa5),'GdgPD':'To\x20get\x20started:','xKwjB':_0x4e1bbd(0xc9),'GUiJa':function(_0x912c4,_0x36ceef){return _0x912c4===_0x36ceef;},'CghWH':_0x4e1bbd(0xa4),'AQJqh':function(_0x53c767,_0x3b3d0e){return _0x53c767(_0x3b3d0e);},'LjDgw':function(_0x25bd54,_0x31e67e){return _0x25bd54===_0x31e67e;},'dVHOM':'installLevel','rVNpF':_0x4e1bbd(0xca),'oWBVv':_0x4e1bbd(0xc8),'ebiPy':'ranger','unbSx':function(_0x2d01a2,_0x3709cc){return _0x2d01a2>_0x3709cc;},'nXLxI':_0x4e1bbd(0xa7),'feWoV':_0x4e1bbd(0xae),'IfrZm':_0x4e1bbd(0xb9),'TfBkz':_0x4e1bbd(0xab),'GFYFL':'\x0a⚠️\x20\x20No\x20skills\x20were\x20installed.\x0a'};console['log'](_0x3f570a['bSQez']);const _0x458786=_0x5dd537[_0x4e1bbd(0xa1)]??_0x3f570a[_0x4e1bbd(0xb3)],_0x4d0341=await _0x3f570a[_0x4e1bbd(0xb5)](getToken);if(!_0x4d0341){console[_0x4e1bbd(0xc4)](_0x3f570a['vyUfn']),console[_0x4e1bbd(0xc4)](_0x3f570a[_0x4e1bbd(0xb0)]),console['log']('\x20\x201.\x20Get\x20your\x20API\x20token\x20from\x20https://dashboard.ranger.net/cli'),console['log'](_0x4e1bbd(0xbf)+(_0x458786==='opencode'?_0x3f570a['xKwjB']:'')+'\x20<your-api-token>'),console['log'](_0x4e1bbd(0xc5)+(_0x3f570a['GUiJa'](_0x458786,_0x3f570a['CghWH'])?_0x3f570a['xKwjB']:'')+'\x0a');return;}console[_0x4e1bbd(0xc4)](_0x4e1bbd(0xaf));const _0x44ff03=getProjectRoot(),_0x28d1d9=_0x3f570a['AQJqh'](basename,_0x44ff03),_0xd14844=_0x3f570a[_0x4e1bbd(0xba)](_0x458786,_0x4e1bbd(0xa4))?getOpencodeConfigDir(_0x4e1bbd(0xa7))+_0x4e1bbd(0xb2):getClaudeConfigDir()+'/skills/',_0x4d5d9=_0x458786==='opencode'?_0x44ff03+'/.opencode/skills/':_0x44ff03+'/.claude/skills/',_0x57bb35=process['stdin'][_0x4e1bbd(0xb4)]&&process['stdout'][_0x4e1bbd(0xb4)];let _0x7fb5a8;if(_0x5dd537['autoInstall'])_0x7fb5a8=_0x5dd537['autoInstall'];else{if(_0x57bb35){const _0x5f4e1f=await _0x2c1a2c[_0x4e1bbd(0xa9)]([{'type':'list','name':_0x3f570a['dVHOM'],'message':'Where\x20should\x20skills\x20be\x20installed?','choices':[{'name':_0x4e1bbd(0xc7)+_0xd14844+')','value':_0x4e1bbd(0xa7)},{'name':_0x4e1bbd(0xc2)+_0x4d5d9+')','value':_0x3f570a['rVNpF']}]}]);_0x7fb5a8=_0x5f4e1f[_0x4e1bbd(0xc1)];}else _0x7fb5a8=_0x3f570a['rVNpF'],console[_0x4e1bbd(0xc4)]('Non-interactive\x20mode:\x20Installing\x20skills\x20at\x20project\x20level\x20('+_0x4d5d9+')');}let _0x19c4b9=0x0;const _0x80b3a9=getCurrentVersion();console['log'](_0x3f570a[_0x4e1bbd(0xc6)]);try{const _0x4e6711=await installSkill(_0x3f570a[_0x4e1bbd(0xb6)],{'cliVersion':_0x80b3a9,'level':_0x7fb5a8,'platform':_0x458786});_0x4e6711&&_0x19c4b9++;}catch(_0x43a495){console[_0x4e1bbd(0xb1)]('\x20\x20Failed\x20to\x20install\x20ranger\x20skill:',_0x43a495 instanceof Error?_0x43a495['message']:_0x43a495);}if(_0x3f570a[_0x4e1bbd(0xbe)](_0x19c4b9,0x0)){const _0x3747bc=_0x3f570a['LjDgw'](_0x7fb5a8,_0x3f570a[_0x4e1bbd(0xac)])?_0x3f570a['feWoV']:_0x3f570a['IfrZm'];console['log']('\x0a✅\x20Installed\x20'+_0x19c4b9+'\x20'+_0x3747bc+_0x4e1bbd(0xc3)+(_0x19c4b9>0x1?'s':'')+_0x4e1bbd(0xbc)),!_0x5dd537[_0x4e1bbd(0xc0)]&&(console[_0x4e1bbd(0xc4)]('To\x20use:'),_0x458786==='opencode'?console[_0x4e1bbd(0xc4)]('\x20\x20-\x20Start\x20OpenCode\x20and\x20run\x20the\x20`ranger_enable`\x20tool\x20to\x20enable\x20hooks.'):console[_0x4e1bbd(0xc4)](_0x3f570a['TfBkz']));}else console[_0x4e1bbd(0xc4)](_0x3f570a['GFYFL']);}
@@ -1 +1 @@
1
- const _0x4233d0=_0x3119;(function(_0x41b9ec,_0x596495){const _0x590c36=_0x3119,_0x404664=_0x41b9ec();while(!![]){try{const _0x36f9b9=parseInt(_0x590c36(0x109))/0x1*(-parseInt(_0x590c36(0xe7))/0x2)+parseInt(_0x590c36(0xda))/0x3+-parseInt(_0x590c36(0x101))/0x4*(parseInt(_0x590c36(0xfa))/0x5)+parseInt(_0x590c36(0xdd))/0x6+-parseInt(_0x590c36(0xd4))/0x7*(parseInt(_0x590c36(0xe1))/0x8)+parseInt(_0x590c36(0xfe))/0x9*(-parseInt(_0x590c36(0x10b))/0xa)+parseInt(_0x590c36(0xef))/0xb*(parseInt(_0x590c36(0xf7))/0xc);if(_0x36f9b9===_0x596495)break;else _0x404664['push'](_0x404664['shift']());}catch(_0x1c58bc){_0x404664['push'](_0x404664['shift']());}}}(_0x47d1,0xea79d));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x40213f from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';function _0x3119(_0x15c12e,_0x45c075){_0x15c12e=_0x15c12e-0xd4;const _0x47d138=_0x47d1();let _0x3119e6=_0x47d138[_0x15c12e];return _0x3119e6;}import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';function _0x47d1(){const _0x31b704=['\x0a✅\x20Ranger\x20setup\x20complete!\x0a','3461148yrLBPJ','RaYIk','ZoPvj','8373774mAoZih','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','trackPhaseEnd','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','244856hrnrzP','YtDfY','inherit','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','...','auth','290fFqkWx','mlPlZ','\x20is\x20no\x20longer\x20supported.\x20','user','ZbDQY','\x20\x20npx\x20playwright@','env','jFOdq','11356532MGcuDU','✓\x20Created\x20~/.ranger/\x20directory','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','.gitignore','\x0a\x20\x20(opens\x20a\x20browser\x20so\x20you\x20can\x20log\x20in\x20once)','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','ZgOAQ','24JnmKPW','Installation\x20failed\x20with\x20exit\x20code\x20','ranger','25ylhUla','sLePp','organizationName','existing_token','3096tnmlqb','EzZdQ','RMcjA','787516jYCwxR','executablePath','Wwswi','fekXA','lCdsd','\x0a\x20\x20https://docs.ranger.net/main/concepts/profiles','status','ranger\x20setup\x20--scope=','2239qgutSa','kyfRZ','34350DiPUQu','skipAuth','yyYBH','beUGl','\x20install\x20chromium','Pgnjj','ltLxN','allowInsecureLocalhost','profile','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','prompt','error','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','CKCjU','scope','success','log','IaPbN','qaOHR','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','VumGP','local','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20','Validating\x20API\x20token...','stdin','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','ready','skills','CjRwW','\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','message','Authentication\x20failed:\x20','VIpFq','fBYny','EHvKW','skipped','confirm','RlcoH','\x20now?','1.58.2','trackPhaseStart','tzXXM','wQgIu','LsMbG','provided_token','url','chromium','win32','✓\x20Already\x20authenticated\x20to\x20','266fKreWW','fauFP','install','✓\x20Stored\x20credentials\x20locally','✓\x20Created\x20.ranger/.gitignore'];_0x47d1=function(){return _0x31b704;};return _0x47d1();}const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION=_0x4233d0(0x133);const bold=_0x202e19=>'\x1b[1m'+_0x202e19+'\x1b[0m';export function getPlaywrightVersion(){try{const _0x59832f=require['resolve']('playwright/package.json'),_0x127675=require(_0x59832f);return _0x127675['version'];}catch{return null;}}export function installChromiumBinary(_0x262c0a,_0xd8f99f=![]){const _0x4ceefd=_0x4233d0,_0x2fc4d5={'ZgOAQ':_0x4ceefd(0xd6),'ZEhcg':'--with-deps','ADXCU':'chromium','ltLxN':function(_0x3b3f41,_0x24d29a,_0x44f66d,_0x4987eb){return _0x3b3f41(_0x24d29a,_0x44f66d,_0x4987eb);},'tzXXM':'npx','fekXA':'inherit','crvBf':'close'};return new Promise((_0xaf4596,_0x218c14)=>{const _0x53686e=_0x4ceefd,_0x48d52c={'RaYIk':function(_0x38f821,_0x2dc450){return _0x38f821===_0x2dc450;}},_0x57597e=['playwright@'+_0x262c0a,_0x2fc4d5[_0x53686e(0xf6)],..._0xd8f99f?[_0x2fc4d5['ZEhcg']]:[],_0x2fc4d5['ADXCU']],_0x31fca5=_0x2fc4d5[_0x53686e(0x111)](spawn,_0x2fc4d5[_0x53686e(0x135)],_0x57597e,{'stdio':['ignore',_0x53686e(0xe3),_0x2fc4d5[_0x53686e(0x104)]],'shell':process['platform']===_0x53686e(0x13b)});_0x31fca5['on'](_0x2fc4d5['crvBf'],_0xce9baf=>{const _0x4947f5=_0x53686e;_0x48d52c[_0x4947f5(0xdb)](_0xce9baf,0x0)?_0xaf4596():_0x218c14(new Error(_0x4947f5(0xf8)+_0xce9baf));}),_0x31fca5['on'](_0x53686e(0x116),_0x4a8de7=>{_0x218c14(_0x4a8de7);});});}export async function authenticate(_0x10a1ab){const _0x2890f9=_0x4233d0,_0x476992={'pfXeO':function(_0x4e7a5d){return _0x4e7a5d();},'wQgIu':_0x2890f9(0xfd),'OnaPl':function(_0x23413f){return _0x23413f();},'fauFP':function(_0x3c8da3,_0x326328){return _0x3c8da3 instanceof _0x326328;},'gGFyB':'device_auth','jvALb':_0x2890f9(0xd7)};if(!_0x10a1ab){const _0x936409=await _0x476992['pfXeO'](getToken);if(_0x936409){const _0x1e55be=await getCurrentUser(_0x936409);if(_0x1e55be[_0x2890f9(0x11a)])return console['log'](_0x2890f9(0x13c)+_0x1e55be['user']['organizationName']),{'token':_0x936409,'method':_0x476992[_0x2890f9(0x136)]};}try{_0x10a1ab=await _0x476992['OnaPl'](runDeviceAuthFlow);}catch(_0x3a5696){throw new Error('Authentication\x20failed:\x20'+(_0x476992[_0x2890f9(0xd5)](_0x3a5696,Error)?_0x3a5696[_0x2890f9(0x12a)]:_0x3a5696));}const _0x554727=await getCurrentUser(_0x10a1ab);if(!_0x554727[_0x2890f9(0x11a)])throw new Error(_0x2890f9(0x11e)+_0x554727['error']);return console[_0x2890f9(0x11b)]('✓\x20Authenticated\x20to\x20'+_0x554727[_0x2890f9(0xea)][_0x2890f9(0xfc)]),{'token':_0x10a1ab,'method':_0x476992['gGFyB']};}console[_0x2890f9(0x11b)](_0x2890f9(0x122));const _0x526185=await getCurrentUser(_0x10a1ab);if(!_0x526185[_0x2890f9(0x11a)]){if(_0x526185[_0x2890f9(0x107)])throw new Error(_0x2890f9(0x12b)+_0x526185[_0x2890f9(0x116)]+'.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.');else throw new Error('Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20'+_0x526185['error']+_0x2890f9(0xf5));}return console[_0x2890f9(0x11b)]('✓\x20Authenticated\x20to\x20'+_0x526185['user'][_0x2890f9(0xfc)]),await storeToken(_0x10a1ab),console['log'](process[_0x2890f9(0xed)]['GITHUB_ENV']?'✓\x20Exported\x20credentials\x20for\x20CI':_0x476992['jvALb']),{'token':_0x10a1ab,'method':_0x2890f9(0x138)};}export async function ensureRangerDir(_0x283159){const _0x4d97d1=_0x4233d0,_0xe98d43={'CjRwW':function(_0x49a4a0){return _0x49a4a0();},'jFOdq':function(_0x49f304,_0x3109d9,_0x2ea12f){return _0x49f304(_0x3109d9,_0x2ea12f);},'VIpFq':_0x4d97d1(0xf0),'kAAqA':'✓\x20~/.ranger/\x20directory\x20already\x20exists'};void _0x283159;const _0x25a52b=_0xe98d43[_0x4d97d1(0x127)](getRangerHomeDir);return!existsSync(_0x25a52b)?(await _0xe98d43[_0x4d97d1(0xee)](mkdir,_0x25a52b,{'recursive':!![]}),console[_0x4d97d1(0x11b)](_0xe98d43[_0x4d97d1(0x12c)]),{'path':_0x25a52b,'installed':!![]}):(console['log'](_0xe98d43['kAAqA']),{'path':_0x25a52b,'installed':![]});}export async function ensureChromium(_0xdda4c0=![]){const _0x23b110=_0x4233d0,_0x582f16={'kyfRZ':function(_0x4fb62b,_0x1f8df1){return _0x4fb62b(_0x1f8df1);},'EHvKW':function(_0x146712){return _0x146712();},'VumGP':'install','AqLiH':'\x20(fallback\x20version)','RMcjA':_0x23b110(0xde),'LeKCd':'\x0a❌\x20Failed\x20to\x20install\x20Chromium:','IaPbN':'\x0a⚠\x20Skipping\x20Chromium\x20installation.','weium':'You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'};let _0xd4048a=![];try{const _0x430d92=chromium[_0x23b110(0x102)]();_0xd4048a=_0x582f16[_0x23b110(0x10a)](existsSync,_0x430d92);}catch{_0xd4048a=![];}if(_0xd4048a)return console[_0x23b110(0x11b)]('✓\x20Playwright\x20Chromium\x20browser\x20found'),![];const _0x3c80eb=_0x582f16[_0x23b110(0x12e)](getPlaywrightVersion),_0x37c59f=_0x3c80eb??PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION,_0x42e299=!_0x3c80eb,_0x2b6606=process[_0x23b110(0x123)]['isTTY']&&process['stdout']['isTTY'];let _0x459c3d=!![];if(_0x2b6606){const {install:_0x49613f}=await _0x40213f[_0x23b110(0x115)]([{'type':_0x23b110(0x130),'name':_0x582f16[_0x23b110(0x11f)],'message':_0x42e299?_0x23b110(0xe0)+_0x37c59f+_0x23b110(0x132):'The\x20required\x20version\x20('+_0x37c59f+')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','default':!![]}]);_0x459c3d=_0x49613f;}else console['log']('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x37c59f+(_0x42e299?_0x582f16['AqLiH']:'')+_0x23b110(0xe5));if(_0x459c3d){console['log']('\x0aInstalling\x20Chromium\x20browser...\x0a');try{await installChromiumBinary(_0x37c59f,_0xdda4c0),console['log'](_0x582f16[_0x23b110(0x100)]);}catch(_0x200c9a){console['error'](_0x582f16['LeKCd'],_0x200c9a instanceof Error?_0x200c9a['message']:_0x200c9a),console[_0x23b110(0x11b)]('You\x20can\x20install\x20it\x20manually\x20by\x20running:'),console[_0x23b110(0x11b)]('\x20\x20npx\x20playwright@'+_0x37c59f+_0x23b110(0x10f));}}else console[_0x23b110(0x11b)](_0x582f16[_0x23b110(0x11c)]),console['log'](_0x582f16['weium']),console[_0x23b110(0x11b)](_0x23b110(0xec)+_0x37c59f+'\x20install\x20chromium');return!![];}export async function writeRangerGitignore(_0x150621){const _0x563210=_0x4233d0,_0x1af831={'EzZdQ':_0x563210(0xd8)},_0x520010=join(_0x150621,_0x563210(0xf3)),_0x150960='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await writeFile(_0x520010,_0x150960),console[_0x563210(0x11b)](_0x1af831[_0x563210(0xff)]);}export async function ensureLocalEnv(_0x3a896f,_0x5746a7){const _0x4f73c4=_0x4233d0,_0x212cf0={'CfHvE':function(_0x2bc60d){return _0x2bc60d();},'kCDpI':'⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','lCdsd':'local','wwsxR':'\x0a❌\x20Profile\x20setup\x20failed:','LsMbG':function(_0x4ea3b3,_0x39471f){return _0x4ea3b3 instanceof _0x39471f;}};if(!_0x212cf0['CfHvE'](findGitRoot)&&_0x3a896f?.[_0x4f73c4(0x119)]!=='user')return console[_0x4f73c4(0x11b)](_0x212cf0['kCDpI']),{'ready':![],'skipped':!![]};const _0x484d6d=_0x3a896f?.[_0x4f73c4(0x119)]===_0x4f73c4(0xea)?getRangerHomeDir():undefined;if(findExistingEnv(_0x4f73c4(0x120),{'locations':[_0x4f73c4(0x120)],'rangerDir':_0x484d6d}))return console['log']('✓\x20Local\x20profile\x20already\x20exists'),{'ready':!![],'skipped':![]};try{return await addEnv(_0x212cf0[_0x4f73c4(0x105)],{'url':_0x3a896f?.[_0x4f73c4(0x139)],'force':_0x3a896f?.['force'],'allowInsecureLocalhost':_0x3a896f?.[_0x4f73c4(0x112)],'scope':_0x3a896f?.['scope']},_0x5746a7),{'ready':!![],'skipped':![]};}catch(_0xa8864d){return console['error'](_0x212cf0['wwsxR'],_0x212cf0[_0x4f73c4(0x137)](_0xa8864d,Error)?_0xa8864d[_0x4f73c4(0x12a)]:_0xa8864d),{'ready':![],'skipped':![]};}}export async function start(_0x6d918a,_0x1582b8,_0x3f6be8){const _0x160e31=_0x4233d0,_0x32637d={'beUGl':'\x0a🚀\x20Ranger\x20Setup\x0a','yyYBH':function(_0x1f58f8,_0x485d2f){return _0x1f58f8!==_0x485d2f;},'CKCjU':function(_0x516ed3,_0x318841){return _0x516ed3!==_0x318841;},'YtDfY':function(_0x39e7c2,_0x3d39ff){return _0x39e7c2+_0x3d39ff;},'ZbDQY':_0x160e31(0xea),'fBYny':'✓\x20Skipping\x20authentication\x20(--skip-auth)','Wwswi':'auth','Pgnjj':_0x160e31(0xf2),'sLePp':function(_0x4c2d06,_0x591a2d){return _0x4c2d06(_0x591a2d);},'uKXox':_0x160e31(0xd9),'ZoPvj':'plugin','iANOK':function(_0x79ecea,_0x354a24){return _0x79ecea&&_0x354a24;},'XbQif':function(_0xb99f4,_0xab13e6,_0x514d7f){return _0xb99f4(_0xab13e6,_0x514d7f);},'qInAI':function(_0x5d3816){return _0x5d3816();},'QcApT':'opencode','RlcoH':_0x160e31(0x126),'mlPlZ':_0x160e31(0x128),'qaOHR':function(_0x3fe0d5,_0x5116d3){return _0x3fe0d5 instanceof _0x5116d3;},'VZhxp':function(_0x419087,_0x3a11e4){return _0x419087+_0x3a11e4;},'dQbHL':function(_0x55aa9f,_0x49055c){return _0x55aa9f+_0x49055c;},'HPaSI':function(_0x503f63,_0x32df1c){return _0x503f63+_0x32df1c;},'riRHV':function(_0x4eabf1,_0x3be45a){return _0x4eabf1+_0x3be45a;},'OYNzn':'ranger\x20profile\x20add\x20<name>','Gzaty':_0x160e31(0x114),'PmXpG':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','gBmMr':'/ranger:enable'};console['log'](_0x32637d[_0x160e31(0x10e)]);_0x32637d[_0x160e31(0x10d)](_0x1582b8?.['scope'],undefined)&&_0x32637d[_0x160e31(0x118)](_0x1582b8[_0x160e31(0x119)],'user')&&(console[_0x160e31(0x116)](_0x32637d['YtDfY'](_0x160e31(0x108)+String(_0x1582b8[_0x160e31(0x119)])+_0x160e31(0xe9)+_0x160e31(0x121),_0x160e31(0x124))),process['exit'](0x1));_0x1582b8={..._0x1582b8,'scope':_0x32637d[_0x160e31(0xeb)]};const _0x1cc3ef=!existsSync(getRangerHomeDir());await ensureRangerDir(_0x32637d['ZbDQY']);if(_0x1582b8?.[_0x160e31(0x10c)])console['log'](_0x32637d[_0x160e31(0x12d)]),_0x3f6be8?.[_0x160e31(0xdf)](_0x160e31(0xe6),{'isFirstRun':_0x1cc3ef,'method':_0x160e31(0x12f)});else{_0x3f6be8?.[_0x160e31(0x134)](_0x32637d[_0x160e31(0x103)]);const _0x50655e=await authenticate(_0x6d918a);_0x3f6be8?.[_0x160e31(0xdf)](_0x160e31(0xe6),{'isFirstRun':_0x1cc3ef,'method':_0x50655e['method']});}_0x3f6be8?.[_0x160e31(0x134)](_0x160e31(0x13a));_0x1582b8?.['skipChromium']?console['log'](_0x32637d[_0x160e31(0x110)]):await _0x32637d[_0x160e31(0xfb)](ensureChromium,_0x1582b8?.['withDeps']);_0x3f6be8?.[_0x160e31(0xdf)](_0x160e31(0x13a),{'isFirstRun':_0x1cc3ef,'skipped':!!_0x1582b8?.['skipChromium']}),console['log'](_0x32637d['uKXox']);const _0x57dded=_0x1582b8?.['scope'],_0x6c488f=_0x1582b8?.['opencode']??![];let _0x34cd1e=null;_0x6c488f?(_0x3f6be8?.[_0x160e31(0x134)]('plugin'),_0x34cd1e=await _0x32637d[_0x160e31(0xfb)](ensureOpencodePluginConfig,_0x57dded),_0x3f6be8?.['trackPhaseEnd'](_0x32637d[_0x160e31(0xdc)],{'isFirstRun':_0x1cc3ef,'opencode':!![]})):(_0x3f6be8?.[_0x160e31(0x134)](_0x32637d['ZoPvj']),await _0x32637d[_0x160e31(0xfb)](ensureClaudePlugin,_0x57dded),_0x3f6be8?.['trackPhaseEnd'](_0x32637d['ZoPvj'],{'isFirstRun':_0x1cc3ef}));if(_0x32637d['iANOK'](_0x6c488f,_0x34cd1e)){_0x3f6be8?.[_0x160e31(0x134)](_0x160e31(0x126));try{await _0x32637d['XbQif'](installSkill,_0x160e31(0xf9),{'level':_0x34cd1e[_0x160e31(0x119)],'cliVersion':_0x32637d['qInAI'](getCurrentVersion),'platform':_0x32637d['QcApT']}),_0x3f6be8?.[_0x160e31(0xdf)](_0x32637d['RlcoH'],{'isFirstRun':_0x1cc3ef,'opencode':!![]});}catch(_0x53bba1){console['warn'](_0x32637d[_0x160e31(0xe8)],_0x32637d[_0x160e31(0x11d)](_0x53bba1,Error)?_0x53bba1['message']:_0x53bba1),_0x3f6be8?.['trackPhaseEnd'](_0x32637d[_0x160e31(0x131)],{'isFirstRun':_0x1cc3ef,'opencode':!![],'failed':!![]});}}else _0x3f6be8?.[_0x160e31(0x134)](_0x32637d[_0x160e31(0x131)]),await _0x32637d['sLePp'](ensureClaudeSkills,_0x57dded),_0x3f6be8?.['trackPhaseEnd']('skills',{'isFirstRun':_0x1cc3ef});if(_0x1582b8?.[_0x160e31(0x10c)])console['log']('\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a');else{if(_0x1582b8?.[_0x160e31(0x139)]){_0x3f6be8?.[_0x160e31(0x134)](_0x160e31(0x113));const _0x13f168=await ensureLocalEnv({'url':_0x1582b8['url'],'force':_0x1582b8?.['force'],'allowInsecureLocalhost':_0x1582b8?.[_0x160e31(0x112)],'scope':'user'},_0x3f6be8);_0x3f6be8?.['trackPhaseEnd'](_0x160e31(0x113),{'isFirstRun':_0x1cc3ef,'profileReady':_0x13f168[_0x160e31(0x125)],'userSkipped':_0x13f168['skipped']});}else console['log'](_0x32637d['VZhxp'](_0x32637d['dQbHL'](_0x32637d['HPaSI'](_0x32637d['riRHV'](_0x160e31(0x129),'\x0a\x20\x20'+_0x32637d['sLePp'](bold,_0x32637d['OYNzn'])),_0x160e31(0xf4)),'\x0a\x0aFor\x20CI\x20/\x20background\x20agents\x20and\x20other\x20setup\x20options,\x20see:'),_0x160e31(0x106)));}if(_0x6c488f)console['log'](_0x32637d['Gzaty']),console[_0x160e31(0x11b)](_0x32637d['PmXpG']),console['log']('with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser'),console['log'](_0x160e31(0xf1));else{const _0x3d8855=_0x32637d['sLePp'](bold,_0x32637d['gBmMr']);console['log'](_0x32637d[_0x160e31(0xe2)]('\x0aIn\x20Claude\x20Code,\x20run\x20'+_0x3d8855+'\x20and\x20prompt\x20the\x20coding'+_0x160e31(0xe4)+_0x160e31(0x117),'\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.'));}}
1
+ const _0x2f84d6=_0x19b6;(function(_0x2630f2,_0x53dafd){const _0x4e5a2e=_0x19b6,_0x2317d2=_0x2630f2();while(!![]){try{const _0x5ef5ec=parseInt(_0x4e5a2e(0xbc))/0x1+parseInt(_0x4e5a2e(0xce))/0x2+-parseInt(_0x4e5a2e(0x6e))/0x3+parseInt(_0x4e5a2e(0xa9))/0x4+parseInt(_0x4e5a2e(0xdb))/0x5*(parseInt(_0x4e5a2e(0xc7))/0x6)+parseInt(_0x4e5a2e(0xd4))/0x7*(parseInt(_0x4e5a2e(0x8e))/0x8)+-parseInt(_0x4e5a2e(0xd3))/0x9*(parseInt(_0x4e5a2e(0xbf))/0xa);if(_0x5ef5ec===_0x53dafd)break;else _0x2317d2['push'](_0x2317d2['shift']());}catch(_0x1d1a36){_0x2317d2['push'](_0x2317d2['shift']());}}}(_0x25c7,0x38c61));import{mkdir,writeFile}from'fs/promises';import{join}from'path';import{existsSync}from'fs';import{createRequire}from'module';import{spawn}from'child_process';import _0x2f619c from'inquirer';import{getToken,storeToken}from'./utils/keychain.js';import{getCurrentUser}from'./utils/userApi.js';import{chromium}from'playwright';import{addEnv}from'./addEnv.js';import{getRangerHomeDir,findGitRoot}from'./utils/rangerRoot.js';import{runDeviceAuthFlow}from'./utils/deviceAuth.js';import{findExistingEnv}from'./utils/settings.js';import{getCurrentVersion}from'./utils/version.js';import{ensureClaudePlugin,ensureClaudeSkills}from'./setup/claude.js';import{ensureOpencodePluginConfig}from'./setup/opencode.js';import{installSkill}from'./utils/skills.js';function _0x19b6(_0x2361d0,_0x66457a){_0x2361d0=_0x2361d0-0x6e;const _0x25c74d=_0x25c7();let _0x19b6c5=_0x25c74d[_0x2361d0];return _0x19b6c5;}function _0x25c7(){const _0x5d1353=['scope','trackPhaseEnd','sQgZs','Failed\x20to\x20connect\x20to\x20MCP\x20server:\x20','allowInsecureLocalhost','stdout','58345pPzowW','302136BZGUNH','GITHUB_ENV','Failed\x20to\x20validate\x20provisioned\x20API\x20key:\x20','OrWlh','\x20\x20npx\x20playwright@','chromium','force','\x0a\x20\x20','\x0aIn\x20OpenCode,\x20enable\x20Ranger\x20hooks\x20(run\x20the\x20`ranger_enable`\x20tool)','local','dSyjH','opencode','\x0ascenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','\x20(fallback\x20version)','NMpYr','raYVc','ATEEQ','skipAuth','project-scope\x20setup\x20obsolete).\x20Drop\x20the\x20--scope\x20flag\x20or\x20pass\x20--scope=user.','verification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','Installation\x20failed\x20with\x20exit\x20code\x20','ppJsv','✓\x20Playwright\x20Chromium\x20browser\x20found','\x0averification\x20to\x20check\x20its\x20work\x20as\x20it\x20builds.','\x0aagent\x20like\x20usual.\x20Claude\x20will\x20create\x20a\x20feature\x20review\x20with','qOivP','✓\x20Authenticated\x20to\x20','isTTY','device_auth','\x0a❌\x20Failed\x20to\x20install\x20Chromium:','method','trackPhaseStart','8TGCdIn','\x20now?',')\x20of\x20the\x20Playwright\x20Chromium\x20browser\x20is\x20not\x20installed.\x20Install\x20it\x20now?','\x0a✓\x20Playwright\x20Chromium\x20installed\x20successfully','\x20and\x20prompt\x20the\x20coding','error','status','\x0aInstalling\x20Chromium\x20browser...\x0a','wIcLn','version','Could\x20not\x20determine\x20local\x20Playwright\x20version.\x20Install\x20Playwright\x20Chromium\x20using\x20fallback\x20version\x20','confirm','win32','\x0aIn\x20Claude\x20Code,\x20run\x20','.\x20Please\x20check\x20your\x20API\x20token\x20and\x20try\x20again.','success','✓\x20Skipping\x20Chromium\x20check\x20(--skip-chromium)','playwright/package.json','WFhSi','exit','✓\x20Created\x20~/.ranger/\x20directory','EpBed','hXZbH','lPgDF','url','⚠\x20No\x20git\x20repository\x20found.\x20Re-run\x20with\x20`--scope\x20user`\x20to\x20store\x20the\x20profile\x20at\x20~/.ranger/.','pAaPP','327860uVmftg','skipped','\x1b[1m','wQMvR','dIHar','jzwOs','.\x20Please\x20check\x20your\x20network\x20connection\x20and\x20server\x20URL.','organizationName','mhGtU','rOjcD','skills','✓\x20Stored\x20credentials\x20locally','user','\x0aTo\x20set\x20up\x20a\x20profile\x20for\x20your\x20app,\x20run:','\x0a✅\x20Ranger\x20setup\x20complete!\x0a','REohH','message','✓\x20Already\x20authenticated\x20to\x20','with\x20scenarios\x20describing\x20what\x20to\x20verify\x20and\x20then\x20run\x20browser','188045CZSzHF','profile','ranger\x20setup\x20--scope=','30cfDhAk','skipChromium','The\x20required\x20version\x20(','ranger','qACHf','\x20install\x20chromium','otgmm','XGfbI','6iEkpXV','\x0a❌\x20Profile\x20setup\x20failed:','OzoWf','inherit','OYZnK','auth','srgBG','509800vPRzvs','log','✓\x20Exported\x20credentials\x20for\x20CI','✓\x20~/.ranger/\x20directory\x20already\x20exists','withDeps','1786707setxMx','2745729zfEiYx'];_0x25c7=function(){return _0x5d1353;};return _0x25c7();}const require=createRequire(import.meta.url);export const PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION='1.58.2';const bold=_0x5e5092=>_0x2f84d6(0xab)+_0x5e5092+'\x1b[0m';export function getPlaywrightVersion(){const _0xfa0c98=_0x2f84d6,_0x27bdaf={'bMRNQ':_0xfa0c98(0x9f),'EqoJT':function(_0x4cc16c,_0xd51589){return _0x4cc16c(_0xd51589);}};try{const _0x181259=require['resolve'](_0x27bdaf['bMRNQ']),_0x540e71=_0x27bdaf['EqoJT'](require,_0x181259);return _0x540e71[_0xfa0c98(0x97)];}catch{return null;}}export function installChromiumBinary(_0x20aa7f,_0x3bd52e=![]){const _0x272855=_0x2f84d6,_0x35114c={'ICCPQ':function(_0x2cd486){return _0x2cd486();},'ppJsv':'install','raYVc':function(_0x4c90b3,_0x3c2989,_0xdce61c,_0x3493c2){return _0x4c90b3(_0x3c2989,_0xdce61c,_0x3493c2);},'pdwtL':'npx','dSyjH':'ignore','pAaPP':_0x272855(0xca),'mhGtU':function(_0x2516f2,_0x5caac4){return _0x2516f2===_0x5caac4;},'NMpYr':'close'};return new Promise((_0x19dd83,_0x26319e)=>{const _0x2b4ae3=_0x272855,_0x34e3b8={'WhMnL':function(_0x484cd1){return _0x35114c['ICCPQ'](_0x484cd1);},'HtXMN':function(_0x25dd62,_0x1933fd){return _0x25dd62(_0x1933fd);}},_0x5b4c5b=['playwright@'+_0x20aa7f,_0x35114c[_0x2b4ae3(0x83)],..._0x3bd52e?['--with-deps']:[],'chromium'],_0x3580f9=_0x35114c[_0x2b4ae3(0x7d)](spawn,_0x35114c['pdwtL'],_0x5b4c5b,{'stdio':[_0x35114c[_0x2b4ae3(0x78)],_0x35114c[_0x2b4ae3(0xa8)],_0x35114c[_0x2b4ae3(0xa8)]],'shell':_0x35114c[_0x2b4ae3(0xb1)](process['platform'],_0x2b4ae3(0x9a))});_0x3580f9['on'](_0x35114c[_0x2b4ae3(0x7c)],_0x5cc64d=>{const _0x1fa63c=_0x2b4ae3;_0x5cc64d===0x0?_0x34e3b8['WhMnL'](_0x19dd83):_0x34e3b8['HtXMN'](_0x26319e,new Error(_0x1fa63c(0x82)+_0x5cc64d));}),_0x3580f9['on'](_0x2b4ae3(0x93),_0x27758d=>{_0x26319e(_0x27758d);});});}export async function authenticate(_0x825b89){const _0x3aad2c=_0x2f84d6,_0x3fc522={'LqaSc':function(_0x260733){return _0x260733();},'WFhSi':function(_0x415b66,_0xacde32){return _0x415b66(_0xacde32);},'SPbxO':'existing_token','yTvhA':function(_0x5bf584){return _0x5bf584();},'LFvBv':function(_0x1986f5,_0x172d25){return _0x1986f5(_0x172d25);},'EpBed':'Validating\x20API\x20token...','OYZnK':_0x3aad2c(0xd0),'EMOCS':_0x3aad2c(0xb4),'vEpjb':'provided_token'};if(!_0x825b89){const _0x1a1eec=await _0x3fc522['LqaSc'](getToken);if(_0x1a1eec){const _0x4fc8d5=await _0x3fc522[_0x3aad2c(0xa0)](getCurrentUser,_0x1a1eec);if(_0x4fc8d5[_0x3aad2c(0x9d)])return console[_0x3aad2c(0xcf)](_0x3aad2c(0xba)+_0x4fc8d5['user'][_0x3aad2c(0xb0)]),{'token':_0x1a1eec,'method':_0x3fc522['SPbxO']};}try{_0x825b89=await _0x3fc522['yTvhA'](runDeviceAuthFlow);}catch(_0x5e2949){throw new Error('Authentication\x20failed:\x20'+(_0x5e2949 instanceof Error?_0x5e2949['message']:_0x5e2949));}const _0xc9d5c5=await _0x3fc522['LFvBv'](getCurrentUser,_0x825b89);if(!_0xc9d5c5[_0x3aad2c(0x9d)])throw new Error(_0x3aad2c(0x70)+_0xc9d5c5[_0x3aad2c(0x93)]);return console[_0x3aad2c(0xcf)]('✓\x20Authenticated\x20to\x20'+_0xc9d5c5['user'][_0x3aad2c(0xb0)]),{'token':_0x825b89,'method':_0x3aad2c(0x8a)};}console['log'](_0x3fc522[_0x3aad2c(0xa3)]);const _0x5c60dc=await getCurrentUser(_0x825b89);if(!_0x5c60dc['success']){if(_0x5c60dc[_0x3aad2c(0x94)])throw new Error('Authentication\x20failed:\x20'+_0x5c60dc['error']+_0x3aad2c(0x9c));else throw new Error(_0x3aad2c(0xd8)+_0x5c60dc[_0x3aad2c(0x93)]+_0x3aad2c(0xaf));}return console['log'](_0x3aad2c(0x88)+_0x5c60dc[_0x3aad2c(0xb5)]['organizationName']),await storeToken(_0x825b89),console['log'](process['env'][_0x3aad2c(0x6f)]?_0x3fc522[_0x3aad2c(0xcb)]:_0x3fc522['EMOCS']),{'token':_0x825b89,'method':_0x3fc522['vEpjb']};}export async function ensureRangerDir(_0x9c0e9d){const _0x1e4c1d=_0x2f84d6,_0x5ec7f5={'WzgvK':function(_0x3cda47){return _0x3cda47();},'wIcLn':function(_0x4af934,_0x9189e2){return _0x4af934(_0x9189e2);},'rOjcD':_0x1e4c1d(0xa2)};void _0x9c0e9d;const _0x3a5e89=_0x5ec7f5['WzgvK'](getRangerHomeDir);return!_0x5ec7f5[_0x1e4c1d(0x96)](existsSync,_0x3a5e89)?(await mkdir(_0x3a5e89,{'recursive':!![]}),console['log'](_0x5ec7f5[_0x1e4c1d(0xb2)]),{'path':_0x3a5e89,'installed':!![]}):(console['log'](_0x1e4c1d(0xd1)),{'path':_0x3a5e89,'installed':![]});}export async function ensureChromium(_0x35dee4=![]){const _0x82ef8d=_0x2f84d6,_0x30062e={'ZBNsK':_0x82ef8d(0x84),'uSisP':function(_0x23f576,_0x21e3b7){return _0x23f576??_0x21e3b7;},'DyZRM':_0x82ef8d(0x99),'eRoCO':_0x82ef8d(0x7b),'yDFnA':_0x82ef8d(0x91),'ATEEQ':function(_0x2bf8da,_0x4bf86b){return _0x2bf8da instanceof _0x4bf86b;}};let _0x389159=![];try{const _0x5c1e00=chromium['executablePath']();_0x389159=existsSync(_0x5c1e00);}catch{_0x389159=![];}if(_0x389159)return console['log'](_0x30062e['ZBNsK']),![];const _0x215636=getPlaywrightVersion(),_0x35b123=_0x30062e['uSisP'](_0x215636,PLAYWRIGHT_CHROMIUM_INSTALL_FALLBACK_VERSION),_0x2cb774=!_0x215636,_0x490b11=process['stdin'][_0x82ef8d(0x89)]&&process[_0x82ef8d(0xda)]['isTTY'];let _0x1e48db=!![];if(_0x490b11){const {install:_0x5c863d}=await _0x2f619c['prompt']([{'type':_0x30062e['DyZRM'],'name':'install','message':_0x2cb774?_0x82ef8d(0x98)+_0x35b123+_0x82ef8d(0x8f):_0x82ef8d(0xc1)+_0x35b123+_0x82ef8d(0x90),'default':!![]}]);_0x1e48db=_0x5c863d;}else console[_0x82ef8d(0xcf)]('\x0aNon-interactive\x20mode:\x20Auto-installing\x20Playwright\x20Chromium\x20'+_0x35b123+(_0x2cb774?_0x30062e['eRoCO']:'')+'...');if(_0x1e48db){console[_0x82ef8d(0xcf)](_0x82ef8d(0x95));try{await installChromiumBinary(_0x35b123,_0x35dee4),console[_0x82ef8d(0xcf)](_0x30062e['yDFnA']);}catch(_0x27df67){console['error'](_0x82ef8d(0x8b),_0x30062e[_0x82ef8d(0x7e)](_0x27df67,Error)?_0x27df67[_0x82ef8d(0xb9)]:_0x27df67),console[_0x82ef8d(0xcf)]('You\x20can\x20install\x20it\x20manually\x20by\x20running:'),console['log'](_0x82ef8d(0x72)+_0x35b123+'\x20install\x20chromium');}}else console['log']('\x0a⚠\x20Skipping\x20Chromium\x20installation.'),console['log']('You\x20will\x20need\x20to\x20install\x20it\x20before\x20using\x20Ranger:'),console['log']('\x20\x20npx\x20playwright@'+_0x35b123+_0x82ef8d(0xc4));return!![];}export async function writeRangerGitignore(_0xea565a){const _0x7d8cf2=_0x2f84d6,_0x2c092b={'REohH':function(_0x53894f,_0xd9cad,_0x29ea39){return _0x53894f(_0xd9cad,_0x29ea39);},'dIHar':'.gitignore','lPgDF':'✓\x20Created\x20.ranger/.gitignore'},_0x544245=_0x2c092b[_0x7d8cf2(0xb8)](join,_0xea565a,_0x2c092b[_0x7d8cf2(0xad)]),_0xb7cdc6='\x0a\x0a#\x20Ignore\x20local-only\x20directories\x0alocal/\x0asessions/\x0abug-bashes/\x0areports/\x0afeedback-images/\x0a\x0aactive-profile.txt\x0aactive-feature.txt\x0a.gitignore\x0a\x0a#\x20Ignore\x20plaintext\x20auth\x20files\x20(encrypted\x20.enc\x20files\x20are\x20safe\x20to\x20commit)\x0a**/auth.json\x0a';await writeFile(_0x544245,_0xb7cdc6),console['log'](_0x2c092b[_0x7d8cf2(0xa5)]);}export async function ensureLocalEnv(_0x1738a7,_0x5e7bd5){const _0xe6f06c=_0x2f84d6,_0x345cb8={'gpXrh':function(_0x564d62,_0x1e275e){return _0x564d62!==_0x1e275e;},'Pylfs':_0xe6f06c(0xa7),'yBZFK':function(_0x5f0496,_0x52c88e){return _0x5f0496===_0x52c88e;},'GhLDq':'user','Tjzrd':function(_0x2ee49e,_0x13dfa2,_0x2d32fc){return _0x2ee49e(_0x13dfa2,_0x2d32fc);},'OzoWf':_0xe6f06c(0x77),'kfymU':'✓\x20Local\x20profile\x20already\x20exists','JycWy':function(_0x175008,_0x11f044,_0x3c63fd,_0x3720f5){return _0x175008(_0x11f044,_0x3c63fd,_0x3720f5);}};if(!findGitRoot()&&_0x345cb8['gpXrh'](_0x1738a7?.['scope'],_0xe6f06c(0xb5)))return console[_0xe6f06c(0xcf)](_0x345cb8['Pylfs']),{'ready':![],'skipped':!![]};const _0x571fe2=_0x345cb8['yBZFK'](_0x1738a7?.[_0xe6f06c(0xd5)],_0x345cb8['GhLDq'])?getRangerHomeDir():undefined;if(_0x345cb8['Tjzrd'](findExistingEnv,_0x345cb8['OzoWf'],{'locations':[_0x345cb8[_0xe6f06c(0xc9)]],'rangerDir':_0x571fe2}))return console['log'](_0x345cb8['kfymU']),{'ready':!![],'skipped':![]};try{return await _0x345cb8['JycWy'](addEnv,_0x345cb8['OzoWf'],{'url':_0x1738a7?.['url'],'force':_0x1738a7?.[_0xe6f06c(0x74)],'allowInsecureLocalhost':_0x1738a7?.[_0xe6f06c(0xd9)],'scope':_0x1738a7?.['scope']},_0x5e7bd5),{'ready':!![],'skipped':![]};}catch(_0x382ad2){return console['error'](_0xe6f06c(0xc8),_0x382ad2 instanceof Error?_0x382ad2[_0xe6f06c(0xb9)]:_0x382ad2),{'ready':![],'skipped':![]};}}export async function start(_0x31a8bd,_0x135b7a,_0x155f65){const _0x36861b=_0x2f84d6,_0x15177e={'BvgMP':'\x0a🚀\x20Ranger\x20Setup\x0a','hXZbH':'user','XGfbI':function(_0x129a88,_0x15ae63){return _0x129a88+_0x15ae63;},'srgBG':function(_0x5eb7a,_0x1584c2){return _0x5eb7a(_0x1584c2);},'iFtUC':'✓\x20Skipping\x20authentication\x20(--skip-auth)','jzwOs':_0x36861b(0xcc),'SMTOw':'skipped','sQgZs':'chromium','fqlmV':_0x36861b(0xb7),'otgmm':'plugin','OrWlh':function(_0x4abd9d,_0x681ba9){return _0x4abd9d(_0x681ba9);},'wQMvR':function(_0x1dc5e,_0x4b0dc0){return _0x1dc5e&&_0x4b0dc0;},'StVRp':function(_0x8195fb,_0x312868,_0x1a3249){return _0x8195fb(_0x312868,_0x1a3249);},'LZMFK':'skills','qACHf':'\x0aSkipping\x20profile\x20setup\x20(--skip-auth).\x20Run\x20`ranger\x20setup`\x20with\x20auth\x20to\x20add\x20a\x20profile\x20later.\x0a','ApOzX':_0x36861b(0xbd),'JiOye':'ranger\x20profile\x20add\x20<name>','oWPlS':'and\x20prompt\x20the\x20agent\x20like\x20usual.\x20Ranger\x20will\x20create\x20a\x20feature\x20review','Emxpt':_0x36861b(0x81),'qOivP':'/ranger:enable','yYuGG':function(_0x16a1e7,_0x5b3635){return _0x16a1e7+_0x5b3635;},'Iqhve':function(_0x3b3803,_0x53e8bb){return _0x3b3803+_0x53e8bb;}};console[_0x36861b(0xcf)](_0x15177e['BvgMP']);_0x135b7a?.['scope']!==undefined&&_0x135b7a['scope']!==_0x15177e[_0x36861b(0xa4)]&&(console[_0x36861b(0x93)](_0x15177e[_0x36861b(0xc6)](_0x36861b(0xbe)+_0x15177e['srgBG'](String,_0x135b7a[_0x36861b(0xd5)])+'\x20is\x20no\x20longer\x20supported.\x20','Setup\x20always\x20installs\x20at\x20user\x20scope\x20now\x20(cloud\x20profiles\x20make\x20')+_0x36861b(0x80)),process[_0x36861b(0xa1)](0x1));_0x135b7a={..._0x135b7a,'scope':'user'};const _0x4c85dd=!existsSync(getRangerHomeDir());await _0x15177e[_0x36861b(0xcd)](ensureRangerDir,_0x15177e[_0x36861b(0xa4)]);if(_0x135b7a?.[_0x36861b(0x7f)])console['log'](_0x15177e['iFtUC']),_0x155f65?.['trackPhaseEnd'](_0x15177e[_0x36861b(0xae)],{'isFirstRun':_0x4c85dd,'method':_0x15177e['SMTOw']});else{_0x155f65?.[_0x36861b(0x8d)](_0x15177e['jzwOs']);const _0x313d8a=await authenticate(_0x31a8bd);_0x155f65?.[_0x36861b(0xd6)](_0x15177e['jzwOs'],{'isFirstRun':_0x4c85dd,'method':_0x313d8a[_0x36861b(0x8c)]});}_0x155f65?.[_0x36861b(0x8d)](_0x15177e[_0x36861b(0xd7)]);_0x135b7a?.[_0x36861b(0xc0)]?console['log'](_0x36861b(0x9e)):await ensureChromium(_0x135b7a?.[_0x36861b(0xd2)]);_0x155f65?.['trackPhaseEnd'](_0x36861b(0x73),{'isFirstRun':_0x4c85dd,'skipped':!!_0x135b7a?.['skipChromium']}),console[_0x36861b(0xcf)](_0x15177e['fqlmV']);const _0x328866=_0x135b7a?.['scope'],_0x525ebc=_0x135b7a?.['opencode']??![];let _0x48463e=null;_0x525ebc?(_0x155f65?.[_0x36861b(0x8d)](_0x15177e[_0x36861b(0xc5)]),_0x48463e=await _0x15177e[_0x36861b(0x71)](ensureOpencodePluginConfig,_0x328866),_0x155f65?.[_0x36861b(0xd6)](_0x15177e['otgmm'],{'isFirstRun':_0x4c85dd,'opencode':!![]})):(_0x155f65?.[_0x36861b(0x8d)](_0x15177e['otgmm']),await _0x15177e[_0x36861b(0xcd)](ensureClaudePlugin,_0x328866),_0x155f65?.['trackPhaseEnd'](_0x15177e['otgmm'],{'isFirstRun':_0x4c85dd}));if(_0x15177e[_0x36861b(0xac)](_0x525ebc,_0x48463e)){_0x155f65?.['trackPhaseStart'](_0x36861b(0xb3));try{await _0x15177e['StVRp'](installSkill,_0x36861b(0xc2),{'level':_0x48463e['scope'],'cliVersion':getCurrentVersion(),'platform':_0x36861b(0x79)}),_0x155f65?.[_0x36861b(0xd6)](_0x15177e['LZMFK'],{'isFirstRun':_0x4c85dd,'opencode':!![]});}catch(_0x12f00e){console['warn']('\x20\x20Failed\x20to\x20install\x20OpenCode\x20skill:',_0x12f00e instanceof Error?_0x12f00e[_0x36861b(0xb9)]:_0x12f00e),_0x155f65?.[_0x36861b(0xd6)](_0x15177e['LZMFK'],{'isFirstRun':_0x4c85dd,'opencode':!![],'failed':!![]});}}else _0x155f65?.[_0x36861b(0x8d)](_0x36861b(0xb3)),await ensureClaudeSkills(_0x328866),_0x155f65?.[_0x36861b(0xd6)](_0x36861b(0xb3),{'isFirstRun':_0x4c85dd});if(_0x135b7a?.['skipAuth'])console['log'](_0x15177e[_0x36861b(0xc3)]);else{if(_0x135b7a?.[_0x36861b(0xa6)]){_0x155f65?.['trackPhaseStart'](_0x15177e['ApOzX']);const _0x572d73=await ensureLocalEnv({'url':_0x135b7a['url'],'force':_0x135b7a?.[_0x36861b(0x74)],'allowInsecureLocalhost':_0x135b7a?.['allowInsecureLocalhost'],'scope':_0x15177e['hXZbH']},_0x155f65);_0x155f65?.['trackPhaseEnd']('profile',{'isFirstRun':_0x4c85dd,'profileReady':_0x572d73['ready'],'userSkipped':_0x572d73[_0x36861b(0xaa)]});}else console[_0x36861b(0xcf)](_0x15177e[_0x36861b(0xc6)](_0x36861b(0xb6)+(_0x36861b(0x75)+bold(_0x15177e['JiOye']))+'\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(_0x525ebc)console[_0x36861b(0xcf)](_0x36861b(0x76)),console['log'](_0x15177e['oWPlS']),console[_0x36861b(0xcf)](_0x36861b(0xbb)),console[_0x36861b(0xcf)](_0x15177e['Emxpt']);else{const _0x23549b=bold(_0x15177e[_0x36861b(0x87)]);console[_0x36861b(0xcf)](_0x15177e['yYuGG'](_0x15177e['Iqhve'](_0x36861b(0x9b)+_0x23549b+_0x36861b(0x92),_0x36861b(0x86))+_0x36861b(0x7a),_0x36861b(0x85)));}}
@@ -1 +1 @@
1
- const _0x21aeca=_0x3a2f;(function(_0x49b994,_0x472c5f){const _0x1c07c0=_0x3a2f,_0x558d33=_0x49b994();while(!![]){try{const _0x311042=parseInt(_0x1c07c0(0xf4))/0x1+-parseInt(_0x1c07c0(0x10a))/0x2+-parseInt(_0x1c07c0(0xad))/0x3+parseInt(_0x1c07c0(0xbe))/0x4*(parseInt(_0x1c07c0(0xc0))/0x5)+-parseInt(_0x1c07c0(0xbd))/0x6+parseInt(_0x1c07c0(0xfd))/0x7+parseInt(_0x1c07c0(0xd7))/0x8*(parseInt(_0x1c07c0(0xd6))/0x9);if(_0x311042===_0x472c5f)break;else _0x558d33['push'](_0x558d33['shift']());}catch(_0x326c31){_0x558d33['push'](_0x558d33['shift']());}}}(_0x1a17,0x26983));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';function _0x3a2f(_0x44dfbc,_0x43d437){_0x44dfbc=_0x44dfbc-0x9e;const _0x1a1728=_0x1a17();let _0x3a2fb3=_0x1a1728[_0x44dfbc];return _0x3a2fb3;}function _0x1a17(){const _0x36b762=['vJCAk','data','DEBUG','No\x20profiles\x20configured','has','disabled','HrYTQ','EtCfS','map','Olijs','LTQVQ','env','log','\x20plugin(s)\x20configured','QldLM','unknown','492882ztuZHg','VROxk','Version:\x20','oslgw','gflmv','\x1b[0m','join','BdJJn','isActive','gUKOZ','\x20\x20Project-level:','ignore','XtlJf','plugin','length','API\x20Token:\x20✗\x20Not\x20found','1804542tUUwak','12cJCqLC','KcYZm','474025zWGGuV','path','\x20\x20User-level:','Hpqyr','djPAk','jlXcQ','pipe','\x20\x20\x20\x20Session:\x20','@ranger-testing/opencode-plugin','WVIPz','isArray','hasEncryptedAuth','cwd','\x20profiles\x20configured\x20(','rgCeu','SKILL.md','mTBaW','version','eyfRV','\x20(active)',':\x20configured','\x20\x20Run:\x20ranger\x20setup\x20--opencode','889308hhrfxH','8MEifCK','\x20\x20Run:\x20ranger\x20skillup','NdBKr','settingsPath','\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.','hUWbg','\x20\x20\x20\x20','pvxKp','JfjBG','msstg','not_configured','AQzhJ','status','trim','\x20\x20Run:\x20ranger\x20setup\x20[token]','debug','encrypted','Root:\x20','cpWzg','Udxca','dxRmO','NvbAu','UUnJe','\x0a---\x20Claude\x20Code\x20Plugin\x20---','(not\x20found)','settings.json','details','\x20(up\x20to\x20date)','\x1b[1m','261064DXwRBj','stderr','name','kQpCk','ranger@trailhead','filter','AhMdp','match','IQPbg','1849540aiLsNs','string','\x0a📊\x20Ranger\x20Status\x0a','EdAIJ','includes','pXeAH','user','\x1b]8;;file://','cached\x20(updated\x20','push',':\x20installed\x20(','\x0a---\x20Skills\x20---','plaintext','570754pIpIyd','RCdnY'];_0x1a17=function(){return _0x36b762;};return _0x1a17();}import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x483bce=>_0x21aeca(0xf3)+_0x483bce+_0x21aeca(0xb2),link=(_0x450212,_0x540109)=>_0x21aeca(0x104)+_0x450212+'\x07'+(_0x540109||_0x450212)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x108dc6=_0x21aeca,_0x306bf1={'Hpqyr':'not_installed','WVIPz':function(_0x19e23f,_0x3d390f){return _0x19e23f(_0x3d390f);},'EdAIJ':'not_configured','Olijs':function(_0x409318,_0x2b8c09,_0x46de3d,_0x5620ab){return _0x409318(_0x2b8c09,_0x46de3d,_0x5620ab);},'XAuEv':'config','kQpCk':_0x108dc6(0xb8),'AQzhJ':_0x108dc6(0xc6),'XtlJf':'data','GBCqP':'error'};return new Promise(_0x4e17fa=>{const _0x2d2c2c=_0x108dc6,_0x2a28b3={'jlXcQ':_0x2d2c2c(0xfe),'bPGBa':_0x2d2c2c(0xc8),'rZwBA':'opencode-plugin','LTQVQ':_0x306bf1[_0x2d2c2c(0xc3)],'oqHSm':'configured','KcYZm':function(_0x4bf9d4,_0x250c3a){const _0x25b480=_0x2d2c2c;return _0x306bf1[_0x25b480(0xc9)](_0x4bf9d4,_0x250c3a);},'jADsr':function(_0x1090aa,_0x52b110){const _0x1e55f5=_0x2d2c2c;return _0x306bf1[_0x1e55f5(0xc9)](_0x1090aa,_0x52b110);},'xIowG':_0x306bf1[_0x2d2c2c(0x100)]},_0x186098=_0x306bf1[_0x2d2c2c(0xa6)](spawn,'opencode',[_0x2d2c2c(0xe6),_0x306bf1['XAuEv']],{'stdio':[_0x306bf1[_0x2d2c2c(0xf7)],_0x2d2c2c(0xc6),_0x306bf1[_0x2d2c2c(0xe2)]]});let _0xb1b48e='';_0x186098['stdout']?.['on'](_0x2d2c2c(0x9e),_0x21afbf=>{_0xb1b48e+=_0x21afbf['toString']();}),_0x186098[_0x2d2c2c(0xf5)]?.['on'](_0x306bf1[_0x2d2c2c(0xb9)],_0x261f6c=>{_0xb1b48e+=_0x261f6c['toString']();}),_0x186098['on'](_0x306bf1['GBCqP'],()=>{_0x4e17fa({'status':'not_installed'});}),_0x186098['on']('close',_0x4affa5=>{const _0x353a79=_0x2d2c2c;if(_0x4affa5!==0x0){_0x4e17fa({'status':_0x2a28b3[_0x353a79(0xa7)]});return;}const _0x142ba1=_0xb1b48e['trim']();let _0x49a9fc=null;if(_0x142ba1)try{_0x49a9fc=JSON['parse'](_0x142ba1);}catch{const _0x238de8=_0x142ba1['match'](/\{[\s\S]*\}$/);if(_0x238de8)try{_0x49a9fc=JSON['parse'](_0x238de8[0x0]);}catch{_0x49a9fc=null;}}const _0x5eabe2=Array[_0x353a79(0xca)](_0x49a9fc?.[_0x353a79(0xba)])?_0x49a9fc?.[_0x353a79(0xba)]:[],_0x1d2abb=_0x5eabe2['some'](_0xf4ad44=>{const _0x3b88e7=_0x353a79;if(typeof _0xf4ad44!==_0x2a28b3[_0x3b88e7(0xc5)])return![];return _0xf4ad44[_0x3b88e7(0x101)](_0x2a28b3['bPGBa'])||_0xf4ad44[_0x3b88e7(0x101)](_0x2a28b3['rZwBA']);});if(_0x1d2abb){_0x4e17fa({'status':_0x2a28b3['oqHSm'],'details':_0x5eabe2['length']>0x0?_0x5eabe2[_0x353a79(0xbb)]+_0x353a79(0xaa):undefined});return;}if(_0x5eabe2[_0x353a79(0xbb)]>0x0){_0x2a28b3[_0x353a79(0xbf)](_0x4e17fa,{'status':_0x353a79(0xe1),'details':_0x5eabe2[_0x353a79(0xbb)]+'\x20plugin(s)\x20configured'});return;}_0x2a28b3['jADsr'](_0x4e17fa,{'status':_0x2a28b3['xIowG']});});});}async function getSkillsFromDir(_0x32f668,_0x3d1450){const _0x2cb4e8=_0x21aeca,_0x5d018d={'zcFAQ':function(_0x4714be,_0xe40a13){return _0x4714be(_0xe40a13);},'MKrFQ':function(_0x1e189c,_0x4b38cd,_0x1f61c8){return _0x1e189c(_0x4b38cd,_0x1f61c8);},'NdBKr':_0x2cb4e8(0xcf)};if(!_0x5d018d['zcFAQ'](existsSync,_0x32f668))return[];const _0x3cd01c=[];try{const _0x274a20=await _0x5d018d['MKrFQ'](readdir,_0x32f668,{'withFileTypes':!![]});for(const _0x4628d8 of _0x274a20){if(_0x4628d8['isDirectory']()){const _0x57b374=join(_0x32f668,_0x4628d8['name'],_0x5d018d[_0x2cb4e8(0xd9)]);if(_0x5d018d['zcFAQ'](existsSync,_0x57b374)){let _0x380700=_0x4628d8[_0x2cb4e8(0xf6)];try{const _0x438022=await readFile(_0x57b374,'utf-8'),_0x26360d=_0x438022[_0x2cb4e8(0xfb)](/name:\s*(.+)/);_0x26360d&&(_0x380700=_0x26360d[0x1][_0x2cb4e8(0xe4)]());}catch{}_0x3cd01c[_0x2cb4e8(0x106)]({'name':_0x4628d8[_0x2cb4e8(0xf6)],'displayName':_0x380700,'path':_0x57b374,'level':_0x3d1450});}}}}catch{return[];}return _0x3cd01c;}async function getInstalledSkills(){const _0x24d2b3=_0x21aeca,_0x47c0df={'NvbAu':function(_0x4381a0,_0x4412bd,_0x99e8a7){return _0x4381a0(_0x4412bd,_0x99e8a7);},'EPwud':'project','GFsRA':'user'},[_0x28c706,_0x5bd3ec]=await Promise['all']([_0x47c0df[_0x24d2b3(0xec)](getSkillsFromDir,getProjectSkillsDir(),_0x47c0df['EPwud']),getSkillsFromDir(getUserSkillsDir(),_0x47c0df['GFsRA'])]);return{'project':_0x28c706,'user':_0x5bd3ec};}async function getEnvironments(){const _0x7a637=_0x21aeca,_0x167ec1={'eyfRV':function(_0x6eec99,_0x2eb9f1){return _0x6eec99(_0x2eb9f1);},'BdJJn':function(_0xe35ec5,_0x2ac4f9,_0x2a9102){return _0xe35ec5(_0x2ac4f9,_0x2a9102);},'mTBaW':function(_0x5d1202,_0x41183e,_0x4b772a){return _0x5d1202(_0x41183e,_0x4b772a);},'pvxKp':function(_0x1cc222,_0x150c4a,_0x274d76){return _0x1cc222(_0x150c4a,_0x274d76);},'hUWbg':_0x7a637(0xef),'vJCAk':function(_0x555a19,_0x1b8ec6){return _0x555a19===_0x1b8ec6;},'bevOm':function(_0x148099){return _0x148099();}},{envNames:_0x52cba0,activeEnv:_0x12b8de}=await getEnvNames(),_0x1178cd=_0x167ec1['bevOm'](getRangerDir);if(!existsSync(_0x1178cd))return{'envs':[],'activeEnv':null};const _0x1d35f7=_0x52cba0['map'](_0x5e0495=>{const _0x1f1ad9=_0x7a637,_0x317f7d=_0x167ec1[_0x1f1ad9(0xd2)](getEnvDir,_0x5e0495),_0x2a7480=_0x167ec1[_0x1f1ad9(0xb4)](join,_0x317f7d,_0x1f1ad9(0xf0)),_0x4371d9=_0x167ec1[_0x1f1ad9(0xd0)](join,_0x317f7d,'auth.json'),_0x5a22a6=_0x167ec1[_0x1f1ad9(0xde)](join,_0x317f7d,'auth.json.enc');return{'name':_0x5e0495,'settingsPath':_0x167ec1['eyfRV'](existsSync,_0x2a7480)?_0x2a7480:_0x167ec1[_0x1f1ad9(0xdc)],'hasPlaintextAuth':existsSync(_0x4371d9),'hasEncryptedAuth':existsSync(_0x5a22a6),'isActive':_0x167ec1[_0x1f1ad9(0x10c)](_0x5e0495,_0x12b8de)};});return{'envs':_0x1d35f7,'activeEnv':_0x12b8de};}export async function status(){const _0x3bc402=_0x21aeca,_0xb2b07e={'djPAk':_0x3bc402(0xff),'nSnRS':function(_0x275818){return _0x275818();},'HrYTQ':function(_0x9c4b39,_0x889c84,_0x4fe147){return _0x9c4b39(_0x889c84,_0x4fe147);},'dxRmO':function(_0x23ace4,_0x55c0f5){return _0x23ace4(_0x55c0f5);},'gflmv':function(_0x356081,_0x4a10c2){return _0x356081!==_0x4a10c2;},'wOFsx':function(_0x274a72){return _0x274a72();},'Udxca':function(_0x378e82,_0x1054e9){return _0x378e82(_0x1054e9);},'UUnJe':function(_0x2899f7,_0x14e651){return _0x2899f7===_0x14e651;},'KZOwF':'configured','JfjBG':'@ranger-testing/opencode-plugin','oslgw':'\x20\x20Not\x20configured','rTUPc':_0x3bc402(0xd5),'cpWzg':_0x3bc402(0xf8),'fjHbi':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','pGmeh':_0x3bc402(0x108),'MiZJS':function(_0x40bec9,_0x23b833){return _0x40bec9+_0x23b833;},'cyEng':function(_0x1d99c0,_0x2497fd){return _0x1d99c0===_0x2497fd;},'PkAjw':'No\x20skills\x20installed','AhMdp':function(_0x9af5f1,_0x8dc499){return _0x9af5f1>_0x8dc499;},'lbZdr':_0x3bc402(0xc2),'VROxk':function(_0x4ac9a5,_0x36d648,_0x2fcca4){return _0x4ac9a5(_0x36d648,_0x2fcca4);},'msstg':function(_0x5a3c3a){return _0x5a3c3a();},'RCdnY':function(_0x280ab2,_0x35c28b){return _0x280ab2+_0x35c28b;},'QlQUa':_0x3bc402(0xa0),'IQPbg':function(_0x41d62e,_0x3da0d0){return _0x41d62e>_0x3da0d0;},'EtCfS':function(_0x5bd284,_0x5bef9e){return _0x5bd284===_0x5bef9e;},'pXeAH':'no\x20session','QldLM':_0x3bc402(0xe7),'rgCeu':'none','gUKOZ':function(_0xb9967c,_0x32663c){return _0xb9967c!==_0x32663c;}};console['log'](_0xb2b07e[_0x3bc402(0xc4)]);const _0x2ceae0=process[_0x3bc402(0xcc)](),_0x577019=_0xb2b07e['nSnRS'](getRangerDir);if(!existsSync(_0x577019)){console['log']('Root:\x20'+_0xb2b07e[_0x3bc402(0xa3)](link,_0x2ceae0,_0xb2b07e[_0x3bc402(0xeb)](bold,basename(_0x2ceae0)))),console['log'](_0x3bc402(0xdb)),console[_0x3bc402(0xa9)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console['log'](_0x3bc402(0xe8)+link(_0x2ceae0,bold(basename(_0x2ceae0))));const _0x129972=getCurrentVersion(),_0x1e220f=getLatestVersion();if(_0x1e220f[_0x3bc402(0xd1)]&&_0xb2b07e[_0x3bc402(0xb1)](_0x1e220f[_0x3bc402(0xd1)],_0x129972))console['log']('Version:\x20'+_0x129972+'\x20(latest:\x20'+_0x1e220f[_0x3bc402(0xd1)]+')'),console[_0x3bc402(0xa9)]('\x20\x20Run:\x20ranger\x20update');else _0x1e220f[_0x3bc402(0xd1)]?console['log']('Version:\x20'+_0x129972+_0x3bc402(0xf2)):console[_0x3bc402(0xa9)](_0x3bc402(0xaf)+_0x129972);const _0x56a3da=await _0xb2b07e['wOFsx'](getToken);if(_0x56a3da){const _0x2cd883=await _0xb2b07e['Udxca'](getCurrentUser,_0x56a3da);_0x2cd883['success']?console[_0x3bc402(0xa9)]('Organization:\x20'+_0xb2b07e[_0x3bc402(0xea)](bold,_0x2cd883[_0x3bc402(0x103)]['organizationName'])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console[_0x3bc402(0xa9)]('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console['log'](_0x3bc402(0xbc)),console[_0x3bc402(0xa9)](_0x3bc402(0xe5));process[_0x3bc402(0xa8)][_0x3bc402(0x9f)]&&(console['log']('API\x20Environment:\x20'+_0xb2b07e['nSnRS'](getCurrentEnvironment)),console['log']('API\x20URL:\x20'+_0xb2b07e['wOFsx'](getApiBaseUrl)));console[_0x3bc402(0xa9)]('\x0a---\x20OpenCode\x20Plugin\x20---');const _0x36c0c4=await getOpencodePluginStatus();if(_0xb2b07e[_0x3bc402(0xed)](_0x36c0c4[_0x3bc402(0xe3)],_0xb2b07e['KZOwF']))console['log']('\x20\x20'+_0xb2b07e[_0x3bc402(0xea)](bold,_0xb2b07e[_0x3bc402(0xdf)])+_0x3bc402(0xd4)),_0x36c0c4['details']&&console['log']('\x20\x20'+_0x36c0c4[_0x3bc402(0xf1)]);else _0x36c0c4[_0x3bc402(0xe3)]===_0x3bc402(0xe1)?(console[_0x3bc402(0xa9)](_0xb2b07e[_0x3bc402(0xb0)]),_0x36c0c4['details']&&console['log']('\x20\x20'+_0x36c0c4[_0x3bc402(0xf1)]),console[_0x3bc402(0xa9)](_0xb2b07e['rTUPc'])):console['log']('\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available');console[_0x3bc402(0xa9)](_0x3bc402(0xee));const _0x201f70=await getPluginInfo(_0xb2b07e[_0x3bc402(0xe9)]);if(_0x201f70){const _0x2a23b6=_0x201f70['scope']||_0x3bc402(0xac),_0x346e81=_0x201f70['enabled']?'enabled':_0x3bc402(0xa2);console['log']('\x20\x20'+bold('ranger@trailhead')+_0x3bc402(0x107)+_0x2a23b6+',\x20'+_0x346e81+')');}else console[_0x3bc402(0xa9)]('\x20\x20Not\x20installed'),console[_0x3bc402(0xa9)](_0xb2b07e['fjHbi']);console[_0x3bc402(0xa9)](_0xb2b07e['pGmeh']);const {project:_0x11c5b6,user:_0x12377b}=await getInstalledSkills(),_0x3d0891=_0x11c5b6['filter'](_0x5b6ccc=>RANGER_MANAGED_SKILLS[_0x3bc402(0x101)](_0x5b6ccc[_0x3bc402(0xf6)])),_0x17ff63=_0x12377b[_0x3bc402(0xf9)](_0x488590=>RANGER_MANAGED_SKILLS['includes'](_0x488590[_0x3bc402(0xf6)])),_0x41d8fc=_0xb2b07e['MiZJS'](_0x3d0891[_0x3bc402(0xbb)],_0x17ff63['length']);if(_0xb2b07e['cyEng'](_0x41d8fc,0x0))console[_0x3bc402(0xa9)](_0xb2b07e['PkAjw']),console['log'](_0x3bc402(0xd8));else{if(_0xb2b07e['AhMdp'](_0x3d0891['length'],0x0)){console[_0x3bc402(0xa9)](_0x3bc402(0xb7));for(const _0x44b88c of _0x3d0891){console['log'](_0x3bc402(0xdd)+bold(_0x44b88c['displayName'])+':\x20'+link(_0x44b88c['path'],basename(_0x44b88c[_0x3bc402(0xc1)])));}}if(_0xb2b07e[_0x3bc402(0xfa)](_0x17ff63['length'],0x0)){console[_0x3bc402(0xa9)](_0xb2b07e['lbZdr']);for(const _0x129ecc of _0x17ff63){console['log'](_0x3bc402(0xdd)+bold(_0x129ecc['displayName'])+':\x20'+_0xb2b07e[_0x3bc402(0xae)](link,_0x129ecc[_0x3bc402(0xc1)],basename(_0x129ecc[_0x3bc402(0xc1)])));}}}console[_0x3bc402(0xa9)]('\x0a---\x20Profiles\x20---');const {envs:_0x348b9f,activeEnv:_0x47e20f}=await getEnvironments();let _0x17260c=[];if(_0x56a3da)try{_0x17260c=await _0xb2b07e[_0x3bc402(0xe0)](listCloudProfiles);}catch{}const _0x1b4df5=_0xb2b07e[_0x3bc402(0x10b)](_0x348b9f[_0x3bc402(0xbb)],_0x17260c[_0x3bc402(0xbb)]);if(_0x1b4df5===0x0)console['log'](_0xb2b07e['QlQUa']),console[_0x3bc402(0xa9)]('\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>');else{if(_0xb2b07e['AhMdp'](_0x1b4df5,0x5)){const _0x4c87d0=[];_0xb2b07e[_0x3bc402(0xfc)](_0x17260c['length'],0x0)&&_0x4c87d0['push'](_0x17260c['length']+'\x20cloud'),_0x348b9f[_0x3bc402(0xbb)]>0x0&&_0x4c87d0[_0x3bc402(0x106)](_0x348b9f[_0x3bc402(0xbb)]+'\x20local'),console['log'](_0x1b4df5+_0x3bc402(0xcd)+_0x4c87d0['join'](',\x20')+')'),_0x47e20f&&console['log']('\x20\x20Active:\x20'+bold(_0x47e20f)),console['log']('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x4b87e3 of _0x17260c){const _0x401a4a=_0xb2b07e[_0x3bc402(0xa4)](_0x4b87e3[_0x3bc402(0xf6)],_0x47e20f)?_0x3bc402(0xd3):'';console['log']('\x20\x20'+_0xb2b07e['Udxca'](bold,_0x4b87e3[_0x3bc402(0xf6)])+'\x20[cloud]'+_0x401a4a);const _0x2c4a26=_0x4b87e3['sessionUpdatedAt']?_0x3bc402(0x105)+_0x4b87e3['sessionUpdatedAt']+')':_0xb2b07e[_0x3bc402(0x102)];console[_0x3bc402(0xa9)](_0x3bc402(0xc7)+_0x2c4a26);}const _0xab2114=new Set(_0x17260c[_0x3bc402(0xa5)](_0x116705=>_0x116705[_0x3bc402(0xf6)]));for(const _0x3e56bf of _0x348b9f){if(_0xab2114[_0x3bc402(0xa1)](_0x3e56bf[_0x3bc402(0xf6)]))continue;const _0x73b944=_0x3e56bf[_0x3bc402(0xb5)]?'\x20(active)':'',_0xb3097=_0x3e56bf[_0x3bc402(0xcb)]?_0xb2b07e[_0x3bc402(0xab)]:_0x3e56bf['hasPlaintextAuth']?_0x3bc402(0x109):_0xb2b07e[_0x3bc402(0xce)];console['log']('\x20\x20'+bold(_0x3e56bf['name'])+'\x20[local]'+_0x73b944),console['log']('\x20\x20\x20\x20Auth:\x20'+_0xb3097),_0xb2b07e[_0x3bc402(0xb6)](_0x3e56bf[_0x3bc402(0xda)],_0x3bc402(0xef))&&console['log']('\x20\x20\x20\x20Settings:\x20'+link(_0x3e56bf['settingsPath'],basename(_0x3e56bf['settingsPath'])));}if(!_0x47e20f){console['log']('\x0a\x20\x20No\x20active\x20profile\x20set');const _0x2e823c=[..._0x17260c['map'](_0x119960=>_0x119960[_0x3bc402(0xf6)]),..._0x348b9f[_0x3bc402(0xf9)](_0x13a079=>!_0xab2114['has'](_0x13a079['name']))['map'](_0x2e78be=>_0x2e78be[_0x3bc402(0xf6)])];console[_0x3bc402(0xa9)]('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x2e823c[_0x3bc402(0xb3)](',\x20')+')');}}}console[_0x3bc402(0xa9)]('');}
1
+ function _0x3579(_0xa038de,_0x5bf14d){_0xa038de=_0xa038de-0x116;const _0x54d805=_0x54d8();let _0x35795e=_0x54d805[_0xa038de];return _0x35795e;}const _0x9ebe44=_0x3579;(function(_0x1203f9,_0x3ca842){const _0x699166=_0x3579,_0x1bbf2b=_0x1203f9();while(!![]){try{const _0x116ab2=-parseInt(_0x699166(0x155))/0x1+parseInt(_0x699166(0x158))/0x2*(parseInt(_0x699166(0x17b))/0x3)+parseInt(_0x699166(0x131))/0x4+-parseInt(_0x699166(0x11e))/0x5*(parseInt(_0x699166(0x15f))/0x6)+parseInt(_0x699166(0x15a))/0x7+parseInt(_0x699166(0x128))/0x8*(parseInt(_0x699166(0x186))/0x9)+parseInt(_0x699166(0x144))/0xa;if(_0x116ab2===_0x3ca842)break;else _0x1bbf2b['push'](_0x1bbf2b['shift']());}catch(_0x6920d6){_0x1bbf2b['push'](_0x1bbf2b['shift']());}}}(_0x54d8,0xc73a6));import{readFile,readdir}from'fs/promises';import{join,basename}from'path';import{existsSync}from'fs';import{getToken}from'./utils/keychain.js';function _0x54d8(){const _0x2f5d1f=['\x1b[1m','\x20\x20Active:\x20','LDtEs','\x20profiles\x20configured\x20(','48wBXRNL','\x20(up\x20to\x20date)','LYdRw','name','QvCyC','project','not_configured','utf-8','\x20plugin(s)\x20configured','@ranger-testing/opencode-plugin','not_installed','zPlJH','data','TvPkh','stderr','trim','settingsPath','oqFxQ','rLeWI','BAlAi','UTUEc','ignore','log','\x0a---\x20Claude\x20Code\x20Plugin\x20---','Hzyax','path','\x20\x20OpenCode\x20not\x20installed\x20or\x20not\x20available','\x20\x20Run:\x20ranger\x20profile\x20add\x20<profile-name>','541398xebPmT','\x20\x20Not\x20configured','TubrB','OmqpC','env','\x0a---\x20Skills\x20---','some','push','KHClg','wZKye','API\x20Environment:\x20','62073WIDQAG','sessionUpdatedAt','SFHUn','pipe','CphcY','cqLpX','ZbNhl','plugin','CVFUI','details','lltoQ','\x20\x20Run:\x20ranger\x20skillup','Version:\x20','bILrB','81440CudieC','Sdkta','WyUJz','isActive','\x0a\x20\x20No\x20active\x20profile\x20set','cDipn','uvWbS','hiJuI','\x20local','user','544aojHES','No\x20skills\x20installed','disabled','cwd','(not\x20found)','filter','CcqMh','isDirectory','\x20\x20Run:\x20ranger\x20update','4652500OlAmRm','configured','settings.json','Organization:\x20','SKILL.md','PNYZb','rALyg','map','isArray','Root:\x20','hasPlaintextAuth','muAiH',':\x20configured','join','toString','nsLYs','no\x20session','fKMtu','all','7091370HvwyBz','\x20(latest:\x20','uWUWB','\x0a📊\x20Ranger\x20Status\x0a','\x20(active)','includes','HHnFb','enabled','parse','version','zbCxt','status','KGyYE','\x20\x20\x20\x20','QHwNS','length','rgruO','1579043cNPwbU','\x20[cloud]','\x20\x20\x20\x20Session:\x20','2hlslDe','none','25627WvZYur'];_0x54d8=function(){return _0x2f5d1f;};return _0x54d8();}import{getCurrentVersion,getLatestVersion}from'./utils/version.js';import{getApiBaseUrl,getCurrentEnvironment}from'./utils/environment.js';import{getProjectSkillsDir,getUserSkillsDir}from'./utils/claudeConfig.js';import{getEnvNames}from'./env.js';import{getCurrentUser}from'./utils/userApi.js';import{getRangerDir}from'./utils/rangerRoot.js';import{getEnvDir}from'./utils/settings.js';import{listCloudProfiles}from'./utils/cloudProfile.js';import{getPluginInfo}from'./utils/claudePlugin.js';import{RANGER_MANAGED_SKILLS}from'./utils/skills.js';import{spawn}from'child_process';const bold=_0x4e6765=>_0x9ebe44(0x15b)+_0x4e6765+'\x1b[0m',link=(_0x3f0e24,_0x20d594)=>'\x1b]8;;file://'+_0x3f0e24+'\x07'+(_0x20d594||_0x3f0e24)+'\x1b]8;;\x07';async function getOpencodePluginStatus(){const _0x19f5e2=_0x9ebe44,_0x4c5560={'KRPaX':function(_0x65606f,_0xb8e77c){return _0x65606f(_0xb8e77c);},'wzvZA':'opencode-plugin','Sdkta':_0x19f5e2(0x169),'fWKif':'debug','CVFUI':'pipe','nNVkR':_0x19f5e2(0x16b),'tQtfP':'close'};return new Promise(_0x463651=>{const _0x17aa43=_0x19f5e2,_0x4980fb={'hiJuI':function(_0x554baf,_0x994fda){return _0x4c5560['KRPaX'](_0x554baf,_0x994fda);},'cqLpX':'string','lltoQ':_0x4c5560['wzvZA'],'oqFxQ':function(_0x3366a3,_0x21179f){return _0x3366a3!==_0x21179f;},'CcqMh':_0x4c5560[_0x17aa43(0x11f)],'sZJRu':function(_0x3f3ab1,_0x42aec1){return _0x3f3ab1(_0x42aec1);},'rALyg':_0x17aa43(0x165)},_0x13f1d0=spawn('opencode',[_0x4c5560['fWKif'],'config'],{'stdio':[_0x17aa43(0x174),_0x17aa43(0x189),_0x4c5560[_0x17aa43(0x118)]]});let _0x4285fb='';_0x13f1d0['stdout']?.['on'](_0x4c5560['nNVkR'],_0x147aec=>{const _0x378c1c=_0x17aa43;_0x4285fb+=_0x147aec[_0x378c1c(0x13f)]();}),_0x13f1d0[_0x17aa43(0x16d)]?.['on'](_0x17aa43(0x16b),_0x579f7a=>{const _0x5bc64f=_0x17aa43;_0x4285fb+=_0x579f7a[_0x5bc64f(0x13f)]();}),_0x13f1d0['on']('error',()=>{const _0x533705=_0x17aa43;_0x4980fb[_0x533705(0x125)](_0x463651,{'status':'not_installed'});}),_0x13f1d0['on'](_0x4c5560['tQtfP'],_0x2e656a=>{const _0x46d604=_0x17aa43;if(_0x4980fb[_0x46d604(0x170)](_0x2e656a,0x0)){_0x463651({'status':_0x4980fb[_0x46d604(0x12e)]});return;}const _0x342f4c=_0x4285fb[_0x46d604(0x16e)]();let _0x1b6ead=null;if(_0x342f4c)try{_0x1b6ead=JSON[_0x46d604(0x14c)](_0x342f4c);}catch{const _0x47102f=_0x342f4c['match'](/\{[\s\S]*\}$/);if(_0x47102f)try{_0x1b6ead=JSON[_0x46d604(0x14c)](_0x47102f[0x0]);}catch{_0x1b6ead=null;}}const _0x58866e=Array[_0x46d604(0x139)](_0x1b6ead?.[_0x46d604(0x117)])?_0x1b6ead?.['plugin']:[],_0x43fe82=_0x58866e[_0x46d604(0x181)](_0x40ac56=>{const _0x2f0c7b=_0x46d604;if(typeof _0x40ac56!==_0x4980fb[_0x2f0c7b(0x18b)])return![];return _0x40ac56[_0x2f0c7b(0x149)](_0x2f0c7b(0x168))||_0x40ac56[_0x2f0c7b(0x149)](_0x4980fb[_0x2f0c7b(0x11a)]);});if(_0x43fe82){_0x4980fb['sZJRu'](_0x463651,{'status':_0x46d604(0x132),'details':_0x58866e[_0x46d604(0x153)]>0x0?_0x58866e['length']+'\x20plugin(s)\x20configured':undefined});return;}if(_0x58866e['length']>0x0){_0x4980fb[_0x46d604(0x125)](_0x463651,{'status':_0x4980fb[_0x46d604(0x137)],'details':_0x58866e['length']+_0x46d604(0x167)});return;}_0x4980fb[_0x46d604(0x125)](_0x463651,{'status':_0x4980fb[_0x46d604(0x137)]});});});}async function getSkillsFromDir(_0x2af1e1,_0x32176c){const _0x5423d0=_0x9ebe44,_0x312211={'nsLYs':function(_0x50b2d3,_0x29cf76){return _0x50b2d3(_0x29cf76);},'uWUWB':function(_0x182bee,_0x3f3cd0,_0x47c963){return _0x182bee(_0x3f3cd0,_0x47c963);},'UxZzt':function(_0x5dcec4,_0x1d1168,_0x4a64ba,_0x1fffbf){return _0x5dcec4(_0x1d1168,_0x4a64ba,_0x1fffbf);}};if(!_0x312211[_0x5423d0(0x140)](existsSync,_0x2af1e1))return[];const _0x3a6b0d=[];try{const _0x14f3db=await _0x312211[_0x5423d0(0x146)](readdir,_0x2af1e1,{'withFileTypes':!![]});for(const _0x59daa2 of _0x14f3db){if(_0x59daa2[_0x5423d0(0x12f)]()){const _0x4cc979=_0x312211['UxZzt'](join,_0x2af1e1,_0x59daa2[_0x5423d0(0x162)],_0x5423d0(0x135));if(_0x312211[_0x5423d0(0x140)](existsSync,_0x4cc979)){let _0xd928d0=_0x59daa2[_0x5423d0(0x162)];try{const _0x45b58b=await readFile(_0x4cc979,_0x5423d0(0x166)),_0x2775ed=_0x45b58b['match'](/name:\s*(.+)/);_0x2775ed&&(_0xd928d0=_0x2775ed[0x1][_0x5423d0(0x16e)]());}catch{}_0x3a6b0d['push']({'name':_0x59daa2[_0x5423d0(0x162)],'displayName':_0xd928d0,'path':_0x4cc979,'level':_0x32176c});}}}}catch{return[];}return _0x3a6b0d;}async function getInstalledSkills(){const _0x3a047f=_0x9ebe44,_0x1f349f={'JujpI':function(_0x48c152,_0x3a0ec5,_0x524638){return _0x48c152(_0x3a0ec5,_0x524638);},'rLeWI':function(_0x2658fd){return _0x2658fd();}},[_0xa0bdfd,_0x457137]=await Promise[_0x3a047f(0x143)]([_0x1f349f['JujpI'](getSkillsFromDir,getProjectSkillsDir(),_0x3a047f(0x164)),_0x1f349f['JujpI'](getSkillsFromDir,_0x1f349f[_0x3a047f(0x171)](getUserSkillsDir),_0x3a047f(0x127))]);return{'project':_0xa0bdfd,'user':_0x457137};}async function getEnvironments(){const _0x27992f=_0x9ebe44,_0x44f8a7={'ZbNhl':function(_0x1cbf95,_0x4f00e7){return _0x1cbf95(_0x4f00e7);},'QHwNS':function(_0x662dee,_0xc083c4,_0x5e3856){return _0x662dee(_0xc083c4,_0x5e3856);},'ZyRCu':function(_0xfe1a51,_0x18f72b,_0x3c5dbd){return _0xfe1a51(_0x18f72b,_0x3c5dbd);},'BeSMx':'auth.json.enc','Ldrlq':function(_0x4bfcea,_0x203468){return _0x4bfcea(_0x203468);},'zbCxt':_0x27992f(0x12c),'HHnFb':function(_0x74f0e5,_0x6eecb4){return _0x74f0e5(_0x6eecb4);},'KHClg':function(_0x444ac8,_0x1e217f){return _0x444ac8===_0x1e217f;},'bILrB':function(_0x85404d){return _0x85404d();},'KGyYE':function(_0x5dd40d){return _0x5dd40d();}},{envNames:_0x2f51d6,activeEnv:_0x3b839a}=await _0x44f8a7[_0x27992f(0x11d)](getEnvNames),_0x3c81ce=_0x44f8a7[_0x27992f(0x150)](getRangerDir);if(!_0x44f8a7[_0x27992f(0x14a)](existsSync,_0x3c81ce))return{'envs':[],'activeEnv':null};const _0x1e5604=_0x2f51d6[_0x27992f(0x138)](_0x4df038=>{const _0x1dbc3f=_0x27992f,_0x27f54c=_0x44f8a7[_0x1dbc3f(0x116)](getEnvDir,_0x4df038),_0x222a0f=_0x44f8a7['QHwNS'](join,_0x27f54c,_0x1dbc3f(0x133)),_0x3c1ba5=_0x44f8a7[_0x1dbc3f(0x152)](join,_0x27f54c,'auth.json'),_0x211e8c=_0x44f8a7['ZyRCu'](join,_0x27f54c,_0x44f8a7['BeSMx']);return{'name':_0x4df038,'settingsPath':_0x44f8a7['Ldrlq'](existsSync,_0x222a0f)?_0x222a0f:_0x44f8a7[_0x1dbc3f(0x14e)],'hasPlaintextAuth':existsSync(_0x3c1ba5),'hasEncryptedAuth':_0x44f8a7[_0x1dbc3f(0x14a)](existsSync,_0x211e8c),'isActive':_0x44f8a7[_0x1dbc3f(0x183)](_0x4df038,_0x3b839a)};});return{'envs':_0x1e5604,'activeEnv':_0x3b839a};}export async function status(){const _0x38a89e=_0x9ebe44,_0x3c7637={'XOjPs':_0x38a89e(0x147),'LYdRw':function(_0x3c8858,_0x20ecf5){return _0x3c8858(_0x20ecf5);},'PNYZb':function(_0xca581f,_0x28b3ab,_0x434d6d){return _0xca581f(_0x28b3ab,_0x434d6d);},'Aneps':function(_0x2599ef){return _0x2599ef();},'UTUEc':function(_0x57ce5a,_0x2d6b93){return _0x57ce5a!==_0x2d6b93;},'TubrB':function(_0x23f0f5){return _0x23f0f5();},'CphcY':function(_0x33aa5c,_0x19a81f){return _0x33aa5c(_0x19a81f);},'GRqbO':'\x0a---\x20OpenCode\x20Plugin\x20---','fKMtu':function(_0x5cea11){return _0x5cea11();},'DeoHQ':function(_0x39b386,_0x199d71){return _0x39b386===_0x199d71;},'QvCyC':_0x38a89e(0x132),'cDipn':_0x38a89e(0x168),'gSjKr':'\x20\x20Run:\x20ranger\x20setup\x20--opencode','muAiH':_0x38a89e(0x176),'MdRrK':'unknown','BYJUh':_0x38a89e(0x14b),'WyUJz':_0x38a89e(0x12a),'SFHUn':'\x20\x20Not\x20installed','BAlAi':'\x20\x20Run:\x20ranger\x20setup\x20[token]\x20\x20(includes\x20plugin\x20installation)','OPhUk':_0x38a89e(0x180),'uvWbS':function(_0x487fac,_0x30264c){return _0x487fac===_0x30264c;},'LDtEs':_0x38a89e(0x129),'XYWVU':'\x0a---\x20Profiles\x20---','LnUiT':function(_0x1b6758){return _0x1b6758();},'zPlJH':function(_0x59130a){return _0x59130a();},'OmqpC':'No\x20profiles\x20configured','TvPkh':function(_0x5944ad,_0x56d728){return _0x5944ad>_0x56d728;},'wZKye':function(_0x5301af,_0x29abdb){return _0x5301af>_0x29abdb;},'hgQgr':function(_0x564b3f,_0x3712a7){return _0x564b3f(_0x3712a7);},'gcsFz':'\x20(active)','GwgCq':_0x38a89e(0x141),'Hzyax':_0x38a89e(0x12c),'iEswY':function(_0x1de111,_0x10c8ed,_0x1201cd){return _0x1de111(_0x10c8ed,_0x1201cd);},'rgruO':function(_0x4229d4,_0x534ddb){return _0x4229d4(_0x534ddb);}};console['log'](_0x3c7637['XOjPs']);const _0x91d25a=process[_0x38a89e(0x12b)](),_0x3f806c=getRangerDir();if(!_0x3c7637[_0x38a89e(0x161)](existsSync,_0x3f806c)){console[_0x38a89e(0x175)](_0x38a89e(0x13a)+_0x3c7637[_0x38a89e(0x136)](link,_0x91d25a,_0x3c7637[_0x38a89e(0x161)](bold,_0x3c7637[_0x38a89e(0x161)](basename,_0x91d25a)))),console['log']('\x0aRanger\x20has\x20not\x20been\x20initialized\x20in\x20this\x20directory.'),console[_0x38a89e(0x175)]('\x20\x20Run:\x20ranger\x20setup\x20[token]\x0a');return;}console[_0x38a89e(0x175)](_0x38a89e(0x13a)+link(_0x91d25a,_0x3c7637['LYdRw'](bold,basename(_0x91d25a))));const _0x29437d=getCurrentVersion(),_0x5f20b7=_0x3c7637['Aneps'](getLatestVersion);if(_0x5f20b7['version']&&_0x3c7637[_0x38a89e(0x173)](_0x5f20b7[_0x38a89e(0x14d)],_0x29437d))console[_0x38a89e(0x175)](_0x38a89e(0x11c)+_0x29437d+_0x38a89e(0x145)+_0x5f20b7['version']+')'),console[_0x38a89e(0x175)](_0x38a89e(0x130));else _0x5f20b7['version']?console['log']('Version:\x20'+_0x29437d+_0x38a89e(0x160)):console['log'](_0x38a89e(0x11c)+_0x29437d);const _0x55678b=await _0x3c7637[_0x38a89e(0x17d)](getToken);if(_0x55678b){const _0xe01051=await getCurrentUser(_0x55678b);_0xe01051['success']?console[_0x38a89e(0x175)](_0x38a89e(0x134)+_0x3c7637[_0x38a89e(0x18a)](bold,_0xe01051['user']['organizationName'])):(console['log']('API\x20Token:\x20✓\x20Found\x20but\x20invalid\x20or\x20expired'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]'));}else console[_0x38a89e(0x175)]('API\x20Token:\x20✗\x20Not\x20found'),console['log']('\x20\x20Run:\x20ranger\x20setup\x20[token]');process[_0x38a89e(0x17f)]['DEBUG']&&(console[_0x38a89e(0x175)](_0x38a89e(0x185)+getCurrentEnvironment()),console[_0x38a89e(0x175)]('API\x20URL:\x20'+getApiBaseUrl()));console[_0x38a89e(0x175)](_0x3c7637['GRqbO']);const _0x432aeb=await _0x3c7637[_0x38a89e(0x142)](getOpencodePluginStatus);if(_0x3c7637['DeoHQ'](_0x432aeb[_0x38a89e(0x14f)],_0x3c7637[_0x38a89e(0x163)]))console['log']('\x20\x20'+_0x3c7637['LYdRw'](bold,_0x3c7637[_0x38a89e(0x123)])+_0x38a89e(0x13d)),_0x432aeb['details']&&console['log']('\x20\x20'+_0x432aeb[_0x38a89e(0x119)]);else _0x432aeb['status']===_0x38a89e(0x165)?(console[_0x38a89e(0x175)](_0x38a89e(0x17c)),_0x432aeb['details']&&console['log']('\x20\x20'+_0x432aeb[_0x38a89e(0x119)]),console['log'](_0x3c7637['gSjKr'])):console[_0x38a89e(0x175)](_0x38a89e(0x179));console[_0x38a89e(0x175)](_0x3c7637[_0x38a89e(0x13c)]);const _0x38cfc7=await getPluginInfo('ranger@trailhead');if(_0x38cfc7){const _0x3bd782=_0x38cfc7['scope']||_0x3c7637['MdRrK'],_0x1bb829=_0x38cfc7['enabled']?_0x3c7637['BYJUh']:_0x3c7637[_0x38a89e(0x120)];console['log']('\x20\x20'+bold('ranger@trailhead')+':\x20installed\x20('+_0x3bd782+',\x20'+_0x1bb829+')');}else console['log'](_0x3c7637[_0x38a89e(0x188)]),console['log'](_0x3c7637[_0x38a89e(0x172)]);console['log'](_0x3c7637['OPhUk']);const {project:_0x217fff,user:_0x2cb0d2}=await getInstalledSkills(),_0x16718c=_0x217fff[_0x38a89e(0x12d)](_0x272366=>RANGER_MANAGED_SKILLS['includes'](_0x272366['name'])),_0x362ad8=_0x2cb0d2[_0x38a89e(0x12d)](_0x42f0c3=>RANGER_MANAGED_SKILLS['includes'](_0x42f0c3['name'])),_0x4055bf=_0x16718c[_0x38a89e(0x153)]+_0x362ad8['length'];if(_0x3c7637[_0x38a89e(0x124)](_0x4055bf,0x0))console[_0x38a89e(0x175)](_0x3c7637[_0x38a89e(0x15d)]),console['log'](_0x38a89e(0x11b));else{if(_0x16718c['length']>0x0){console['log']('\x20\x20Project-level:');for(const _0x5c839a of _0x16718c){console['log']('\x20\x20\x20\x20'+bold(_0x5c839a['displayName'])+':\x20'+link(_0x5c839a[_0x38a89e(0x178)],basename(_0x5c839a['path'])));}}if(_0x362ad8['length']>0x0){console[_0x38a89e(0x175)]('\x20\x20User-level:');for(const _0xa84738 of _0x362ad8){console[_0x38a89e(0x175)](_0x38a89e(0x151)+bold(_0xa84738['displayName'])+':\x20'+_0x3c7637['PNYZb'](link,_0xa84738[_0x38a89e(0x178)],basename(_0xa84738[_0x38a89e(0x178)])));}}}console['log'](_0x3c7637['XYWVU']);const {envs:_0x133617,activeEnv:_0x3a397e}=await _0x3c7637['LnUiT'](getEnvironments);let _0x18b2f6=[];if(_0x55678b)try{_0x18b2f6=await _0x3c7637[_0x38a89e(0x16a)](listCloudProfiles);}catch{}const _0x947b88=_0x133617['length']+_0x18b2f6['length'];if(_0x947b88===0x0)console[_0x38a89e(0x175)](_0x3c7637[_0x38a89e(0x17e)]),console['log'](_0x38a89e(0x17a));else{if(_0x3c7637[_0x38a89e(0x16c)](_0x947b88,0x5)){const _0x58533d=[];_0x18b2f6[_0x38a89e(0x153)]>0x0&&_0x58533d['push'](_0x18b2f6['length']+'\x20cloud'),_0x3c7637[_0x38a89e(0x184)](_0x133617['length'],0x0)&&_0x58533d[_0x38a89e(0x182)](_0x133617['length']+_0x38a89e(0x126)),console['log'](_0x947b88+_0x38a89e(0x15e)+_0x58533d['join'](',\x20')+')'),_0x3a397e&&console['log'](_0x38a89e(0x15c)+_0x3c7637['hgQgr'](bold,_0x3a397e)),console[_0x38a89e(0x175)]('\x20\x20Run:\x20ranger\x20profile\x20ls\x20\x20(list\x20all)');}else{for(const _0x2c9c92 of _0x18b2f6){const _0x5584de=_0x3c7637['DeoHQ'](_0x2c9c92[_0x38a89e(0x162)],_0x3a397e)?_0x3c7637['gcsFz']:'';console['log']('\x20\x20'+bold(_0x2c9c92[_0x38a89e(0x162)])+_0x38a89e(0x156)+_0x5584de);const _0x52318f=_0x2c9c92['sessionUpdatedAt']?'cached\x20(updated\x20'+_0x2c9c92[_0x38a89e(0x187)]+')':_0x3c7637['GwgCq'];console['log'](_0x38a89e(0x157)+_0x52318f);}const _0x35a48a=new Set(_0x18b2f6['map'](_0x59ec4d=>_0x59ec4d['name']));for(const _0xb4abc8 of _0x133617){if(_0x35a48a['has'](_0xb4abc8[_0x38a89e(0x162)]))continue;const _0x30a3f4=_0xb4abc8[_0x38a89e(0x121)]?_0x38a89e(0x148):'',_0x58a031=_0xb4abc8['hasEncryptedAuth']?'encrypted':_0xb4abc8[_0x38a89e(0x13b)]?'plaintext':_0x38a89e(0x159);console[_0x38a89e(0x175)]('\x20\x20'+bold(_0xb4abc8['name'])+'\x20[local]'+_0x30a3f4),console[_0x38a89e(0x175)]('\x20\x20\x20\x20Auth:\x20'+_0x58a031),_0x3c7637[_0x38a89e(0x173)](_0xb4abc8['settingsPath'],_0x3c7637[_0x38a89e(0x177)])&&console[_0x38a89e(0x175)]('\x20\x20\x20\x20Settings:\x20'+_0x3c7637['iEswY'](link,_0xb4abc8['settingsPath'],_0x3c7637[_0x38a89e(0x154)](basename,_0xb4abc8[_0x38a89e(0x16f)])));}if(!_0x3a397e){console['log'](_0x38a89e(0x122));const _0x2808c6=[..._0x18b2f6['map'](_0x1882be=>_0x1882be[_0x38a89e(0x162)]),..._0x133617[_0x38a89e(0x12d)](_0x77f817=>!_0x35a48a['has'](_0x77f817[_0x38a89e(0x162)]))[_0x38a89e(0x138)](_0x58056c=>_0x58056c[_0x38a89e(0x162)])];console['log']('\x20\x20Run:\x20ranger\x20profile\x20use\x20<profile-name>\x20\x20(available:\x20'+_0x2808c6[_0x38a89e(0x13e)](',\x20')+')');}}}console[_0x38a89e(0x175)]('');}